aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/work.c
diff options
context:
space:
mode:
authorBen Greear <greearb@candelatech.com>2011-02-07 16:44:36 -0500
committerJohn W. Linville <linville@tuxdriver.com>2011-02-09 16:09:46 -0500
commitda2fd1f0f7b78f21f6378f726d1f6de9d573b2d4 (patch)
treefc5bf7979e01651aeff0d7b14130c76cd9fa176c /net/mac80211/work.c
parent4f2e9d91f84ce39698517203974ffc2bcc32a21d (diff)
mac80211: Allow work items to use existing channel type.
Narrow channel types can function within larger channel types. So, use existing channel type for work items when possible. This decreases hardware channel changes significantly when using non NO_HT channel types on the operating channel. Signed-off-by: Ben Greear <greearb@candelatech.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/work.c')
-rw-r--r--net/mac80211/work.c53
1 files changed, 50 insertions, 3 deletions
diff --git a/net/mac80211/work.c b/net/mac80211/work.c
index 6bf787a5b38a..64f2b2871282 100644
--- a/net/mac80211/work.c
+++ b/net/mac80211/work.c
@@ -874,6 +874,44 @@ static void ieee80211_work_rx_queued_mgmt(struct ieee80211_local *local,
874 kfree_skb(skb); 874 kfree_skb(skb);
875} 875}
876 876
877static bool ieee80211_work_ct_coexists(enum nl80211_channel_type wk_ct,
878 enum nl80211_channel_type oper_ct)
879{
880 switch (wk_ct) {
881 case NL80211_CHAN_NO_HT:
882 return true;
883 case NL80211_CHAN_HT20:
884 if (oper_ct != NL80211_CHAN_NO_HT)
885 return true;
886 return false;
887 case NL80211_CHAN_HT40MINUS:
888 case NL80211_CHAN_HT40PLUS:
889 return (wk_ct == oper_ct);
890 }
891 WARN_ON(1); /* shouldn't get here */
892 return false;
893}
894
895static enum nl80211_channel_type
896ieee80211_calc_ct(enum nl80211_channel_type wk_ct,
897 enum nl80211_channel_type oper_ct)
898{
899 switch (wk_ct) {
900 case NL80211_CHAN_NO_HT:
901 return oper_ct;
902 case NL80211_CHAN_HT20:
903 if (oper_ct != NL80211_CHAN_NO_HT)
904 return oper_ct;
905 return wk_ct;
906 case NL80211_CHAN_HT40MINUS:
907 case NL80211_CHAN_HT40PLUS:
908 return wk_ct;
909 }
910 WARN_ON(1); /* shouldn't get here */
911 return wk_ct;
912}
913
914
877static void ieee80211_work_timer(unsigned long data) 915static void ieee80211_work_timer(unsigned long data)
878{ 916{
879 struct ieee80211_local *local = (void *) data; 917 struct ieee80211_local *local = (void *) data;
@@ -927,14 +965,22 @@ static void ieee80211_work_work(struct work_struct *work)
927 bool on_oper_chan; 965 bool on_oper_chan;
928 bool tmp_chan_changed = false; 966 bool tmp_chan_changed = false;
929 bool on_oper_chan2; 967 bool on_oper_chan2;
968 enum nl80211_channel_type wk_ct;
930 on_oper_chan = ieee80211_cfg_on_oper_channel(local); 969 on_oper_chan = ieee80211_cfg_on_oper_channel(local);
970
971 /* Work with existing channel type if possible. */
972 wk_ct = wk->chan_type;
973 if (wk->chan == local->hw.conf.channel)
974 wk_ct = ieee80211_calc_ct(wk->chan_type,
975 local->hw.conf.channel_type);
976
931 if (local->tmp_channel) 977 if (local->tmp_channel)
932 if ((local->tmp_channel != wk->chan) || 978 if ((local->tmp_channel != wk->chan) ||
933 (local->tmp_channel_type != wk->chan_type)) 979 (local->tmp_channel_type != wk_ct))
934 tmp_chan_changed = true; 980 tmp_chan_changed = true;
935 981
936 local->tmp_channel = wk->chan; 982 local->tmp_channel = wk->chan;
937 local->tmp_channel_type = wk->chan_type; 983 local->tmp_channel_type = wk_ct;
938 /* 984 /*
939 * Leave the station vifs in awake mode if they 985 * Leave the station vifs in awake mode if they
940 * happen to be on the same channel as 986 * happen to be on the same channel as
@@ -1031,7 +1077,8 @@ static void ieee80211_work_work(struct work_struct *work)
1031 continue; 1077 continue;
1032 if (wk->chan != local->tmp_channel) 1078 if (wk->chan != local->tmp_channel)
1033 continue; 1079 continue;
1034 if (wk->chan_type != local->tmp_channel_type) 1080 if (ieee80211_work_ct_coexists(wk->chan_type,
1081 local->tmp_channel_type))
1035 continue; 1082 continue;
1036 remain_off_channel = true; 1083 remain_off_channel = true;
1037 } 1084 }