From 90fc4b3a5ba24f09af2a8c4a723651a328949460 Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Sat, 18 Dec 2010 17:20:48 +0100 Subject: mac80211: implement off-channel TX using hw r-o-c offload When the driver has remain-on-channel offload, implement off-channel transmission using that primitive. Signed-off-by: Johannes Berg Signed-off-by: John W. Linville --- net/mac80211/offchannel.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) (limited to 'net/mac80211/offchannel.c') diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c index 49b9ec2..b4e5267 100644 --- a/net/mac80211/offchannel.c +++ b/net/mac80211/offchannel.c @@ -196,6 +196,7 @@ static void ieee80211_hw_roc_start(struct work_struct *work) { struct ieee80211_local *local = container_of(work, struct ieee80211_local, hw_roc_start); + struct ieee80211_sub_if_data *sdata; mutex_lock(&local->mtx); @@ -206,11 +207,19 @@ static void ieee80211_hw_roc_start(struct work_struct *work) ieee80211_recalc_idle(local); - cfg80211_ready_on_channel(local->hw_roc_dev, local->hw_roc_cookie, - local->hw_roc_channel, - local->hw_roc_channel_type, - local->hw_roc_duration, - GFP_KERNEL); + if (local->hw_roc_skb) { + sdata = IEEE80211_DEV_TO_SUB_IF(local->hw_roc_dev); + ieee80211_tx_skb(sdata, local->hw_roc_skb); + local->hw_roc_skb = NULL; + } else { + cfg80211_ready_on_channel(local->hw_roc_dev, + local->hw_roc_cookie, + local->hw_roc_channel, + local->hw_roc_channel_type, + local->hw_roc_duration, + GFP_KERNEL); + } + mutex_unlock(&local->mtx); } @@ -236,11 +245,12 @@ static void ieee80211_hw_roc_done(struct work_struct *work) return; } - cfg80211_remain_on_channel_expired(local->hw_roc_dev, - local->hw_roc_cookie, - local->hw_roc_channel, - local->hw_roc_channel_type, - GFP_KERNEL); + if (!local->hw_roc_for_tx) + cfg80211_remain_on_channel_expired(local->hw_roc_dev, + local->hw_roc_cookie, + local->hw_roc_channel, + local->hw_roc_channel_type, + GFP_KERNEL); local->hw_roc_channel = NULL; local->hw_roc_cookie = 0; -- cgit v1.1