aboutsummaryrefslogtreecommitdiffstats
path: root/net/mac80211/ieee80211_i.h
diff options
context:
space:
mode:
authorJohannes Berg <johannes@sipsolutions.net>2008-07-09 08:40:34 -0400
committerJohn W. Linville <linville@tuxdriver.com>2008-07-14 14:30:06 -0400
commit3e122be089e6fb8d3f322416da4cdbb80ce12927 (patch)
tree087db56fcbe05e9a8e2caa874262c81267c27573 /net/mac80211/ieee80211_i.h
parent500c11973233437cbfd298b9d41ba942550aec76 (diff)
mac80211: make master netdev handling sane
Currently, almost every interface type has a 'bss' pointer pointing to BSS information. This BSS information, however, is for a _local_ BSS, not for the BSS we joined, so having it on a STA mode interface makes little sense, but now they have it pointing to the master device, which is an AP mode virtual interface. However, except for some bitrate control data, this pointer is only used in AP/VLAN modes (for power saving stations.) Overall, it is not necessary to even have the master netdev be a valid virtual interface, and it doesn't have to be on the list of interfaces either. This patch changes the master netdev to be special, it now - no longer is on the list of virtual interfaces, which lets me remove a lot of tests for that - no longer has sub_if_data attached, since that isn't used Additionally, this patch changes some vlan/ap mode handling that is related to these 'bss' pointers described above (but in the VLAN case they actually make sense because there they point to the AP they belong to); it also adds some debugging code to IEEE80211_DEV_TO_SUB_IF to validate it is not called on the master netdev any more. Signed-off-by: Johannes Berg <johannes@sipsolutions.net> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'net/mac80211/ieee80211_i.h')
-rw-r--r--net/mac80211/ieee80211_i.h41
1 files changed, 24 insertions, 17 deletions
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 02a8753a4eca..1b1fc53dad36 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -237,8 +237,6 @@ struct ieee80211_if_ap {
237 struct sk_buff_head ps_bc_buf; 237 struct sk_buff_head ps_bc_buf;
238 atomic_t num_sta_ps; /* number of stations in PS mode */ 238 atomic_t num_sta_ps; /* number of stations in PS mode */
239 int dtim_count; 239 int dtim_count;
240 int force_unicast_rateidx; /* forced TX rateidx for unicast frames */
241 int max_ratectrl_rateidx; /* max TX rateidx for rate control */
242 int num_beacons; /* number of TXed beacon frames for this BSS */ 240 int num_beacons; /* number of TXed beacon frames for this BSS */
243}; 241};
244 242
@@ -248,7 +246,6 @@ struct ieee80211_if_wds {
248}; 246};
249 247
250struct ieee80211_if_vlan { 248struct ieee80211_if_vlan {
251 struct ieee80211_sub_if_data *ap;
252 struct list_head list; 249 struct list_head list;
253}; 250};
254 251
@@ -432,16 +429,18 @@ struct ieee80211_sub_if_data {
432 struct ieee80211_key *keys[NUM_DEFAULT_KEYS]; 429 struct ieee80211_key *keys[NUM_DEFAULT_KEYS];
433 struct ieee80211_key *default_key; 430 struct ieee80211_key *default_key;
434 431
432 /* BSS configuration for this interface. */
433 struct ieee80211_bss_conf bss_conf;
434
435 /* 435 /*
436 * BSS configuration for this interface. 436 * AP this belongs to: self in AP mode and
437 * 437 * corresponding AP in VLAN mode, NULL for
438 * FIXME: I feel bad putting this here when we already have a 438 * all others (might be needed later in IBSS)
439 * bss pointer, but the bss pointer is just wrong when
440 * you have multiple virtual STA mode interfaces...
441 * This needs to be fixed.
442 */ 439 */
443 struct ieee80211_bss_conf bss_conf; 440 struct ieee80211_if_ap *bss;
444 struct ieee80211_if_ap *bss; /* BSS that this device belongs to */ 441
442 int force_unicast_rateidx; /* forced TX rateidx for unicast frames */
443 int max_ratectrl_rateidx; /* max TX rateidx for rate control */
445 444
446 union { 445 union {
447 struct ieee80211_if_ap ap; 446 struct ieee80211_if_ap ap;
@@ -533,8 +532,6 @@ struct ieee80211_sub_if_data *vif_to_sdata(struct ieee80211_vif *p)
533 return container_of(p, struct ieee80211_sub_if_data, vif); 532 return container_of(p, struct ieee80211_sub_if_data, vif);
534} 533}
535 534
536#define IEEE80211_DEV_TO_SUB_IF(dev) netdev_priv(dev)
537
538enum { 535enum {
539 IEEE80211_RX_MSG = 1, 536 IEEE80211_RX_MSG = 1,
540 IEEE80211_TX_STATUS_MSG = 2, 537 IEEE80211_TX_STATUS_MSG = 2,
@@ -760,6 +757,16 @@ static inline int ieee80211_is_multiqueue(struct ieee80211_local *local)
760#endif 757#endif
761} 758}
762 759
760static inline struct ieee80211_sub_if_data *
761IEEE80211_DEV_TO_SUB_IF(struct net_device *dev)
762{
763 struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
764
765 BUG_ON(!local || local->mdev == dev);
766
767 return netdev_priv(dev);
768}
769
763/* this struct represents 802.11n's RA/TID combination */ 770/* this struct represents 802.11n's RA/TID combination */
764struct ieee80211_ra_tid { 771struct ieee80211_ra_tid {
765 u8 ra[ETH_ALEN]; 772 u8 ra[ETH_ALEN];
@@ -883,8 +890,8 @@ int ieee80211_sta_scan_results(struct net_device *dev,
883ieee80211_rx_result ieee80211_sta_rx_scan( 890ieee80211_rx_result ieee80211_sta_rx_scan(
884 struct net_device *dev, struct sk_buff *skb, 891 struct net_device *dev, struct sk_buff *skb,
885 struct ieee80211_rx_status *rx_status); 892 struct ieee80211_rx_status *rx_status);
886void ieee80211_rx_bss_list_init(struct net_device *dev); 893void ieee80211_rx_bss_list_init(struct ieee80211_local *local);
887void ieee80211_rx_bss_list_deinit(struct net_device *dev); 894void ieee80211_rx_bss_list_deinit(struct ieee80211_local *local);
888int ieee80211_sta_set_extra_ie(struct net_device *dev, char *ie, size_t len); 895int ieee80211_sta_set_extra_ie(struct net_device *dev, char *ie, size_t len);
889struct sta_info *ieee80211_ibss_add_sta(struct net_device *dev, 896struct sta_info *ieee80211_ibss_add_sta(struct net_device *dev,
890 struct sk_buff *skb, u8 *bssid, 897 struct sk_buff *skb, u8 *bssid,
@@ -925,8 +932,8 @@ static inline void ieee80211_start_mesh(struct net_device *dev)
925{} 932{}
926#endif 933#endif
927 934
928/* ieee80211_iface.c */ 935/* interface handling */
929int ieee80211_if_add(struct net_device *dev, const char *name, 936int ieee80211_if_add(struct ieee80211_local *local, const char *name,
930 struct net_device **new_dev, int type, 937 struct net_device **new_dev, int type,
931 struct vif_params *params); 938 struct vif_params *params);
932void ieee80211_if_set_type(struct net_device *dev, int type); 939void ieee80211_if_set_type(struct net_device *dev, int type);