Skip to contentSkip to conversation

mac80211: move channel switch code

PATCH New Johannes Berg 1 participant 1 message May 15, 2009 mac80211

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 mac80211: move channel switch code

The channel switch code is currently in the spectrum management file, where arguably it belongs. However, it is for managed mode only and uses the structures for that mode only so having it in a more generic file can be confusing. Additionally, my next patch gets simpler with the code here.

When/if we ever implement this for IBSS or mesh then we will need to rework the structures it uses anyway at which point we could move the code back.

---
 net/mac80211/ieee80211_i.h |   11 +---
 net/mac80211/mlme.c        |   99 +++++++++++++++++++++++++++++++++++++++++++-
 net/mac80211/rx.c          |    5 +-
 net/mac80211/spectmgmt.c   |  101 ---------------------------------------------
 4 files changed, 105 insertions(+), 111 deletions(-)
net/mac80211/ieee80211_i.h +3 -8
@@ -938,6 +938,9 @@ void ieee80211_send_pspoll(struct ieee80
 void ieee80211_recalc_ps(struct ieee80211_local *local, s32 latency);
 int ieee80211_max_network_latency(struct notifier_block *nb,
 				  unsigned long data, void *dummy);
+void ieee80211_sta_process_chanswitch(struct ieee80211_sub_if_data *sdata,
+				      struct ieee80211_channel_sw_ie *sw_elem,
+				      struct ieee80211_bss *bss);
 
 /* IBSS code */
 void ieee80211_ibss_notify_scan_completed(struct ieee80211_local *local);
@@ -1035,14 +1038,6 @@ int __ieee80211_stop_tx_ba_session(struc
 void ieee80211_process_measurement_req(struct ieee80211_sub_if_data *sdata,
 				       struct ieee80211_mgmt *mgmt,
 				       size_t len);
-void ieee80211_chswitch_timer(unsigned long data);
-void ieee80211_chswitch_work(struct work_struct *work);
-void ieee80211_process_chanswitch(struct ieee80211_sub_if_data *sdata,
-				  struct ieee80211_channel_sw_ie *sw_elem,
-				  struct ieee80211_bss *bss);
-void ieee80211_handle_pwr_constr(struct ieee80211_sub_if_data *sdata,
-				 u16 capab_info, u8 *pwr_constr_elem,
-				 u8 pwr_constr_elem_len);
 
 /* Suspend/resume and hw reconfiguration */
 int ieee80211_reconfig(struct ieee80211_local *local);
net/mac80211/mlme.c +98 -1

111 lines not on this page · raw message

net/mac80211/spectmgmt.c +0 -101

104 lines not on this page · raw message

net/mac80211/rx.c +4 -1
@@ -1846,6 +1846,9 @@ ieee80211_rx_h_action(struct ieee80211_r
 				   sizeof(mgmt->u.action.u.chan_switch)))
 				return RX_DROP_MONITOR;
 
+			if (sdata->vif.type != NL80211_IFTYPE_STATION)
+				return RX_DROP_MONITOR;
+
 			if (memcmp(mgmt->bssid, sdata->u.mgd.bssid, ETH_ALEN))
 				return RX_DROP_MONITOR;
 
@@ -1856,7 +1859,7 @@ ieee80211_rx_h_action(struct ieee80211_r
 			if (!bss)
 				return RX_DROP_MONITOR;
 
-			ieee80211_process_chanswitch(sdata,
+			ieee80211_sta_process_chanswitch(sdata,
 				     &mgmt->u.action.u.chan_switch.sw_elem, bss);
 			ieee80211_rx_bss_put(local, bss);
 			break;