mac80211: reduce reliance on netdev
Johannes Berg
maintainerRFC 1/1 mac80211: reduce reliance on netdev
For bluetooth 3, we will most likely not have a netdev for a virtual interface (sdata), so prepare for that by reducing the reliance on having a netdev. This patch moves the name and address fields into the sdata struct and uses them from there all over. Some work is needed to keep them sync'ed, but that's not a lot of work and in slow paths anyway.
In doing so, this also reduces the number of pointer dereferences in many places, because of things like sdata->dev->dev_addr becoming sdata->vif.addr.
Signed-off-by Johannes Berg <[email protected]>
--- include/net/mac80211.h | 2 + net/mac80211/agg-rx.c | 6 ++-- net/mac80211/agg-tx.c | 14 ++++----- net/mac80211/cfg.c | 2 - net/mac80211/debugfs_key.c | 2 - net/mac80211/debugfs_netdev.c | 55 +++---------------------------------- net/mac80211/debugfs_netdev.h | 9 ++---- net/mac80211/debugfs_sta.c | 2 - net/mac80211/driver-ops.h | 4 +- net/mac80211/driver-trace.h | 12 +++----- net/mac80211/ht.c | 6 ++-- net/mac80211/ibss.c | 32 ++++++++++----------- net/mac80211/ieee80211_i.h | 5 ++- net/mac80211/iface.c | 62 +++++++++++++++++++++++++++++++++++++++--- net/mac80211/main.c | 19 ++++++++---- net/mac80211/mesh.c | 4 +- net/mac80211/mesh_hwmp.c | 18 ++++++------ net/mac80211/mesh_pathtbl.c | 6 ++-- net/mac80211/mesh_plink.c | 2 - net/mac80211/mlme.c | 62 +++++++++++++++++++++--------------------- net/mac80211/pm.c | 2 - net/mac80211/rx.c | 43 ++++++++++++++--------------- net/mac80211/scan.c | 2 - net/mac80211/spectmgmt.c | 4 +- net/mac80211/sta_info.c | 8 ++--- net/mac80211/tx.c | 33 ++++++++++------------ net/mac80211/util.c | 14 ++++----- 27 files changed, 223 insertions(+), 207 deletions(-)
net/mac80211/agg-rx.c +3 -3
@@ -140,7 +140,7 @@ static void ieee80211_send_addba_resp(stif (!skb) {printk (KERN_DEBUG "%s: failed to allocate buffer " -"for addba resp frame\n" , sdata->dev->name); +"for addba resp frame\n" , sdata->name);return ; }
@@ -148,10 +148,10 @@ static void ieee80211_send_addba_resp(st mgmt = (struct ieee80211_mgmt *)skb_put (skb,24 );memset (mgmt,0 ,24 );memcpy (mgmt->da, da,ETH_ALEN ); -memcpy (mgmt->sa, sdata->dev->dev_addr,ETH_ALEN ); +memcpy (mgmt->sa, sdata->vif.addr,ETH_ALEN );if (sdata->vif.type ==NL80211_IFTYPE_AP || sdata->vif.type ==NL80211_IFTYPE_AP_VLAN ) -memcpy (mgmt->bssid, sdata->dev->dev_addr,ETH_ALEN ); +memcpy (mgmt->bssid, sdata->vif.addr,ETH_ALEN );else if (sdata->vif.type ==NL80211_IFTYPE_STATION )memcpy (mgmt->bssid, sdata->u.mgd.bssid,ETH_ALEN );
net/mac80211/agg-tx.c +7 -7
@@ -58,17 +58,17 @@ static void ieee80211_send_addba_requestif (!skb) {printk (KERN_ERR "%s: failed to allocate buffer " -"for addba request frame\n" , sdata->dev->name); +"for addba request frame\n" , sdata->name);return ; }skb_reserve (skb, local->hw.extra_tx_headroom); mgmt = (struct ieee80211_mgmt *)skb_put (skb,24 );memset (mgmt,0 ,24 );memcpy (mgmt->da, da,ETH_ALEN ); -memcpy (mgmt->sa, sdata->dev->dev_addr,ETH_ALEN ); +memcpy (mgmt->sa, sdata->vif.addr,ETH_ALEN );if (sdata->vif.type ==NL80211_IFTYPE_AP || sdata->vif.type ==NL80211_IFTYPE_AP_VLAN ) -memcpy (mgmt->bssid, sdata->dev->dev_addr,ETH_ALEN ); +memcpy (mgmt->bssid, sdata->vif.addr,ETH_ALEN );else if (sdata->vif.type ==NL80211_IFTYPE_STATION )memcpy (mgmt->bssid, sdata->u.mgd.bssid,ETH_ALEN );
@@ -104,7 +104,7 @@ void ieee80211_send_bar(struct ieee80211 skb =dev_alloc_skb (sizeof (*bar) + local->hw.extra_tx_headroom);if (!skb) {printk (KERN_ERR "%s: failed to allocate buffer for " -"bar frame\n" , sdata->dev->name); +"bar frame\n" , sdata->name);return ; }skb_reserve (skb, local->hw.extra_tx_headroom);
@@ -113,7 +113,7 @@ void ieee80211_send_bar(struct ieee80211 bar->frame_control =cpu_to_le16 (IEEE80211_FTYPE_CTL |IEEE80211_STYPE_BACK_REQ );memcpy (bar->ra, ra,ETH_ALEN ); -memcpy (bar->ta, sdata->dev->dev_addr,ETH_ALEN ); +memcpy (bar->ta, sdata->vif.addr,ETH_ALEN ); bar_control |= (u16 )IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL ; bar_control |= (u16 )IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA ; bar_control |= (u16)(tid <<12 );
@@ -482,7 +482,7 @@ void ieee80211_start_tx_ba_cb_irqsafe(st#ifdef CONFIG_MAC80211_HT_DEBUG if (net_ratelimit ())printk (KERN_WARNING "%s: Not enough memory, " -"dropping start BA session" , skb->dev->name); +"dropping start BA session" , sdata->name);#endif return ; }
@@ -618,7 +618,7 @@ void ieee80211_stop_tx_ba_cb_irqsafe(str#ifdef CONFIG_MAC80211_HT_DEBUG if (net_ratelimit ())printk (KERN_WARNING "%s: Not enough memory, " -"dropping stop BA session" , skb->dev->name); +"dropping stop BA session" , sdata->name);#endif return ; }
net/mac80211/ht.c +3 -3
@@ -106,7 +106,7 @@ void ieee80211_send_delba(struct ieee802if (!skb) {printk (KERN_ERR "%s: failed to allocate buffer " -"for delba frame\n" , sdata->dev->name); +"for delba frame\n" , sdata->name);return ; }
@@ -114,10 +114,10 @@ void ieee80211_send_delba(struct ieee802 mgmt = (struct ieee80211_mgmt *)skb_put (skb,24 );memset (mgmt,0 ,24 );memcpy (mgmt->da, da,ETH_ALEN ); -memcpy (mgmt->sa, sdata->dev->dev_addr,ETH_ALEN ); +memcpy (mgmt->sa, sdata->vif.addr,ETH_ALEN );if (sdata->vif.type ==NL80211_IFTYPE_AP || sdata->vif.type ==NL80211_IFTYPE_AP_VLAN ) -memcpy (mgmt->bssid, sdata->dev->dev_addr,ETH_ALEN ); +memcpy (mgmt->bssid, sdata->vif.addr,ETH_ALEN );else if (sdata->vif.type ==NL80211_IFTYPE_STATION )memcpy (mgmt->bssid, sdata->u.mgd.bssid,ETH_ALEN );
net/mac80211/ibss.c +16 -16
@@ -117,7 +117,7 @@ static void __ieee80211_sta_join_ibss(st mgmt->frame_control =cpu_to_le16 (IEEE80211_FTYPE_MGMT |IEEE80211_STYPE_PROBE_RESP );memset (mgmt->da,0xff ,ETH_ALEN ); -memcpy (mgmt->sa, sdata->dev->dev_addr,ETH_ALEN ); +memcpy (mgmt->sa, sdata->vif.addr,ETH_ALEN );memcpy (mgmt->bssid, ifibss->bssid,ETH_ALEN ); mgmt->u.beacon.beacon_int =cpu_to_le16 (beacon_int); mgmt->u.beacon.timestamp =cpu_to_le64 (tsf);
@@ -266,7 +266,7 @@ static void ieee80211_rx_bss_info(struct printk(KERN_DEBUG "%s: updated supp_rates set " "for %pM based on beacon info (0x%llx | " "0x%llx -> 0x%llx)\n", - sdata->dev->name, + sdata->name, sta->sta.addr, (unsigned long long) prev_rates, (unsigned long long) supp_rates,
@@ -364,7 +364,7 @@ static void ieee80211_rx_bss_info(struct#ifdef CONFIG_MAC80211_IBSS_DEBUG printk (KERN_DEBUG "%s: beacon TSF higher than " "local TSF - IBSS merge with BSSID %pM\n" , - sdata->dev->name, mgmt->bssid); + sdata->name, mgmt->bssid);#endif ieee80211_sta_join_ibss (sdata, bss);ieee80211_ibss_add_sta (sdata, mgmt->bssid, mgmt->sa, supp_rates);
@@ -393,7 +393,7 @@ struct sta_info *ieee80211_ibss_add_sta(if (local->num_sta >=IEEE80211_IBSS_MAX_STA_ENTRIES ) {if (net_ratelimit ())printk (KERN_DEBUG "%s: No room for a new IBSS STA entry %pM\n" , - sdata->dev->name, addr); + sdata->name, addr);return NULL ; }
@@ -402,7 +402,7 @@ struct sta_info *ieee80211_ibss_add_sta(#ifdef CONFIG_MAC80211_VERBOSE_DEBUG printk (KERN_DEBUG "%s: Adding new IBSS station %pM (dev=%s)\n" , -wiphy_name (local->hw.wiphy), addr, sdata->dev->name); +wiphy_name (local->hw.wiphy), addr, sdata->name);#endif sta =sta_info_alloc (sdata, addr,GFP_ATOMIC );
@@ -466,7 +466,7 @@ static void ieee80211_sta_merge_ibss(strreturn ;printk (KERN_DEBUG "%s: No active IBSS STAs - trying to scan for other " -"IBSS networks with same SSID (merge)\n" , sdata->dev->name); +"IBSS networks with same SSID (merge)\n" , sdata->name);ieee80211_request_internal_scan (sdata, ifibss->ssid, ifibss->ssid_len); }
@@ -488,13 +488,13 @@ static void ieee80211_sta_create_ibss(st* random number generator get different BSSID. */ get_random_bytes (bssid,ETH_ALEN );for (i =0 ; i <ETH_ALEN ; i++) - bssid[i] ^= sdata->dev->dev_addr[i]; + bssid[i] ^= sdata->vif.addr[i]; bssid[0 ] &= ~0x01 ; bssid[0 ] |=0x02 ; }printk (KERN_DEBUG "%s: Creating new IBSS network, BSSID %pM\n" , - sdata->dev->name, bssid); + sdata->name, bssid); sband = local->hw.wiphy->bands[ifibss->channel->band];
@@ -523,7 +523,7 @@ static void ieee80211_sta_find_ibss(stru active_ibss =ieee80211_sta_active_ibss (sdata);#ifdef CONFIG_MAC80211_IBSS_DEBUG printk (KERN_DEBUG "%s: sta_find_ibss (active_ibss=%d)\n" , - sdata->dev->name, active_ibss); + sdata->name, active_ibss);#endif /* CONFIG_MAC80211_IBSS_DEBUG */ if (active_ibss)
@@ -552,7 +552,7 @@ static void ieee80211_sta_find_ibss(struprintk (KERN_DEBUG "%s: Selected IBSS BSSID %pM" " based on configured SSID\n" , - sdata->dev->name, bss->cbss.bssid); + sdata->name, bss->cbss.bssid);ieee80211_sta_join_ibss (sdata, bss);ieee80211_rx_bss_put (local, bss);
@@ -571,7 +571,7 @@ static void ieee80211_sta_find_ibss(stru }else if (time_after (jiffies, ifibss->last_scan_completed +IEEE80211_SCAN_INTERVAL )) {printk (KERN_DEBUG "%s: Trigger new scan to find an IBSS to " -"join\n" , sdata->dev->name); +"join\n" , sdata->name);ieee80211_request_internal_scan (sdata, ifibss->ssid, ifibss->ssid_len);
@@ -585,7 +585,7 @@ static void ieee80211_sta_find_ibss(strureturn ; }printk (KERN_DEBUG "%s: IBSS not allowed on" -" %d MHz\n" , sdata->dev->name, +" %d MHz\n" , sdata->name, local->hw.conf.channel->center_freq);/* No IBSS found - decrease scan interval and continue
@@ -619,7 +619,7 @@ static void ieee80211_rx_mgmt_probe_req(#ifdef CONFIG_MAC80211_IBSS_DEBUG printk (KERN_DEBUG "%s: RX ProbeReq SA=%pM DA=%pM BSSID=%pM" " (tx_last_beacon=%d)\n" , - sdata->dev->name, mgmt->sa, mgmt->da, + sdata->name, mgmt->sa, mgmt->da, mgmt->bssid, tx_last_beacon);#endif /* CONFIG_MAC80211_IBSS_DEBUG */
@@ -637,7 +637,7 @@ static void ieee80211_rx_mgmt_probe_req(#ifdef CONFIG_MAC80211_IBSS_DEBUG printk (KERN_DEBUG "%s: Invalid SSID IE in ProbeReq " "from %pM\n" , - sdata->dev->name, mgmt->sa); + sdata->name, mgmt->sa);#endif return ; }
@@ -657,7 +657,7 @@ static void ieee80211_rx_mgmt_probe_req(memcpy (resp->da, mgmt->sa,ETH_ALEN );#ifdef CONFIG_MAC80211_IBSS_DEBUG printk (KERN_DEBUG "%s: Sending ProbeResp to %pM\n" , - sdata->dev->name, resp->da); + sdata->name, resp->da);#endif /* CONFIG_MAC80211_IBSS_DEBUG */ ieee80211_tx_skb (sdata, skb,0 ); }
@@ -670,7 +670,7 @@ static void ieee80211_rx_mgmt_probe_respsize_t baselen;struct ieee802_11_elems elems; -if (memcmp (mgmt->da, sdata->dev->dev_addr,ETH_ALEN )) +if (memcmp (mgmt->da, sdata->vif.addr,ETH_ALEN ))return ;/* ignore ProbeResp to foreign address */ baselen = (u8 *) mgmt->u.probe_resp.variable - (u8 *) mgmt;
net/mac80211/main.c +13 -6
@@ -35,7 +35,6 @@#include "led.h" #include "cfg.h" #include "debugfs.h" -#include "debugfs_netdev.h" /* * For seeing transmitted packets on monitor interfaces
@@ -189,7 +188,7 @@ void ieee80211_bss_info_change_notify(st }else if (sdata->vif.type ==NL80211_IFTYPE_ADHOC ) sdata->vif.bss_conf.bssid = sdata->u.ibss.bssid;else if (sdata->vif.type ==NL80211_IFTYPE_AP ) - sdata->vif.bss_conf.bssid = sdata->dev->dev_addr; + sdata->vif.bss_conf.bssid = sdata->vif.addr;else if (ieee80211_vif_is_mesh (&sdata->vif)) { sdata->vif.bss_conf.bssid = zero; }else {
@@ -444,7 +443,7 @@ void ieee80211_tx_status(struct ieee8021for_each_sta_info (local, hdr->addr1, sta, tmp) {/* skip wrong virtual interface */ -if (memcmp (hdr->addr2, sta->sdata->dev->dev_addr,ETH_ALEN )) +if (memcmp (hdr->addr2, sta->sdata->vif.addr,ETH_ALEN ))continue ; if (!(info->flags & IEEE80211_TX_STAT_ACK) &&
@@ -1003,11 +1002,19 @@ static int __init ieee80211_init(void) ret =rc80211_pid_init ();if (ret) -return ret; + goto err_pid; -ieee80211_debugfs_netdev_init (); + ret =ieee80211_iface_init (); +if (ret) + goto err_netdev;return 0 ; + err_netdev: +rc80211_pid_exit (); + err_pid: +rc80211_minstrel_exit (); + +return ret; } static void __exit ieee80211_exit(void)
@@ -1024,7 +1031,7 @@ static void __exit ieee80211_exit(void)if (mesh_allocated)ieee80211s_stop (); -ieee80211_debugfs_netdev_exit (); +ieee80211_iface_exit (); }
net/mac80211/mesh.c +2 -2
@@ -463,7 +463,7 @@ static void ieee80211_mesh_housekeeping(#ifdef CONFIG_MAC80211_VERBOSE_DEBUG printk (KERN_DEBUG "%s: running mesh housekeeping\n" , - sdata->dev->name); + sdata->name);#endif ieee80211_sta_expire (sdata,IEEE80211_MESH_PEER_INACTIVITY_LIMIT );
@@ -571,7 +571,7 @@ static void ieee80211_mesh_rx_bcn_presp(/* ignore ProbeResp to foreign address */ if (stype ==IEEE80211_STYPE_PROBE_RESP && -compare_ether_addr (mgmt->da, sdata->dev->dev_addr)) +compare_ether_addr (mgmt->da, sdata->vif.addr))return ; baselen = (u8 *) mgmt->u.probe_resp.variable - (u8 *) mgmt;
net/mac80211/mesh_hwmp.c +9 -9
@@ -126,9 +126,9 @@ static int mesh_path_sel_frame_tx(enum m IEEE80211_STYPE_ACTION);memcpy (mgmt->da, da,ETH_ALEN ); -memcpy (mgmt->sa, sdata->dev->dev_addr,ETH_ALEN ); +memcpy (mgmt->sa, sdata->vif.addr,ETH_ALEN );/* BSSID == SA */ -memcpy (mgmt->bssid, sdata->dev->dev_addr,ETH_ALEN ); +memcpy (mgmt->bssid, sdata->vif.addr,ETH_ALEN ); mgmt->u.action.category =MESH_PATH_SEL_CATEGORY ; mgmt->u.action.u.mesh_action.action_code =MESH_PATH_SEL_ACTION ;
@@ -220,7 +220,7 @@ int mesh_path_error_tx(u8 ttl, u8 *targe IEEE80211_STYPE_ACTION);memcpy (mgmt->da, ra,ETH_ALEN ); -memcpy (mgmt->sa, sdata->dev->dev_addr,ETH_ALEN ); +memcpy (mgmt->sa, sdata->vif.addr,ETH_ALEN );/* BSSID is left zeroed, wildcard value */ mgmt->u.action.category =MESH_PATH_SEL_CATEGORY ; mgmt->u.action.u.mesh_action.action_code =MESH_PATH_SEL_ACTION ;
@@ -372,7 +372,7 @@ static u32 hwmp_route_info_get(struct ie new_metric =MAX_METRIC ; exp_time =TU_TO_EXP_TIME (orig_lifetime); -if (memcmp (orig_addr, sdata->dev->dev_addr,ETH_ALEN ) ==0 ) { +if (memcmp (orig_addr, sdata->vif.addr,ETH_ALEN ) ==0 ) {/* This MP is the originator, we are not interested in this * frame, except for updating transmitter's path info. */
@@ -484,7 +484,7 @@ static void hwmp_preq_frame_process(strumhwmp_dbg ("received PREQ from %pM\n" , orig_addr); -if (memcmp (target_addr, sdata->dev->dev_addr,ETH_ALEN ) ==0 ) { +if (memcmp (target_addr, sdata->vif.addr,ETH_ALEN ) ==0 ) {mhwmp_dbg ("PREQ is for us\n" ); forward = false; reply = true;
@@ -577,7 +577,7 @@ static void hwmp_prep_frame_process(stru* replies */ target_addr =PREP_IE_TARGET_ADDR (prep_elem); -if (memcmp (target_addr, sdata->dev->dev_addr,ETH_ALEN ) ==0 ) +if (memcmp (target_addr, sdata->vif.addr,ETH_ALEN ) ==0 )/* destination, no forwarding required */ return ;
@@ -888,7 +888,7 @@ void mesh_path_start_discovery(struct ie target_flags =MP_F_RF ;spin_unlock_bh (&mpath->state_lock); - mesh_path_sel_frame_tx(MPATH_PREQ, 0, sdata->dev->dev_addr, + mesh_path_sel_frame_tx(MPATH_PREQ, 0, sdata->vif.addr, cpu_to_le32(ifmsh->sn), target_flags, mpath->dst, cpu_to_le32(mpath->sn), sdata->dev->broadcast, 0, ttl, cpu_to_le32(lifetime), 0,
@@ -936,7 +936,7 @@ int mesh_nexthop_lookup(struct sk_buff *if (mpath->flags &MESH_PATH_ACTIVE ) {if (time_after (jiffies, mpath->exp_time +msecs_to_jiffies (sdata->u.mesh.mshcfg.path_refresh_time)) - && !memcmp (sdata->dev->dev_addr, hdr->addr4, + && !memcmp (sdata->vif.addr, hdr->addr4,ETH_ALEN ) && !(mpath->flags &MESH_PATH_RESOLVING ) && !(mpath->flags &MESH_PATH_FIXED )) {
@@ -1009,7 +1009,7 @@ mesh_path_tx_root_frame(struct ieee80211 {struct ieee80211_if_mesh *ifmsh = &sdata->u.mesh; -mesh_path_sel_frame_tx (MPATH_RANN ,0 , sdata->dev->dev_addr, +mesh_path_sel_frame_tx (MPATH_RANN ,0 , sdata->vif.addr,cpu_to_le32 (++ifmsh->sn),0 ,NULL ,0 , sdata->dev->broadcast,0 ,MESH_TTL ,0 ,0 ,0 , sdata);
net/mac80211/mesh_pathtbl.c +3 -3
@@ -260,7 +260,7 @@ int mesh_path_add(u8 *dst, struct ieee80int err =0 ;u32 hash_idx; -if (memcmp (dst, sdata->dev->dev_addr,ETH_ALEN ) ==0 ) +if (memcmp (dst, sdata->vif.addr,ETH_ALEN ) ==0 )/* never add ourselves as neighbours */ return -ENOTSUPP ;
@@ -377,7 +377,7 @@ int mpp_path_add(u8 *dst, u8 *mpp, strucint err =0 ;u32 hash_idx; -if (memcmp (dst, sdata->dev->dev_addr,ETH_ALEN ) ==0 ) +if (memcmp (dst, sdata->vif.addr,ETH_ALEN ) ==0 )/* never add ourselves as neighbours */ return -ENOTSUPP ;
@@ -604,7 +604,7 @@ void mesh_path_discard_frame(struct sk_bstruct mesh_path *mpath;u32 sn =0 ; -if (memcmp (hdr->addr4, sdata->dev->dev_addr,ETH_ALEN ) !=0 ) { +if (memcmp (hdr->addr4, sdata->vif.addr,ETH_ALEN ) !=0 ) {u8 *ra, *da; da = hdr->addr3;
net/mac80211/mesh_plink.c +1 -1
@@ -169,7 +169,7 @@ static int mesh_plink_frame_tx(struct ie mgmt->frame_control =cpu_to_le16 (IEEE80211_FTYPE_MGMT |IEEE80211_STYPE_ACTION );memcpy (mgmt->da, da,ETH_ALEN ); -memcpy (mgmt->sa, sdata->dev->dev_addr,ETH_ALEN ); +memcpy (mgmt->sa, sdata->vif.addr,ETH_ALEN );/* BSSID is left zeroed, wildcard value */ mgmt->u.action.category =MESH_PLINK_CATEGORY ; mgmt->u.action.u.plink_action.action_code = action;
net/mac80211/mlme.c +31 -31
243 lines not on this page · raw message
net/mac80211/rx.c +21 -22
161 lines not on this page · raw message
net/mac80211/scan.c +1 -1
@@ -147,7 +147,7 @@ ieee80211_scan_rx(struct ieee80211_sub_i presp =ieee80211_is_probe_resp (fc);if (presp) {/* ignore ProbeResp to foreign address */ -if (memcmp (mgmt->da, sdata->dev->dev_addr,ETH_ALEN )) +if (memcmp (mgmt->da, sdata->vif.addr,ETH_ALEN ))return RX_DROP_MONITOR ; presp = true;
net/mac80211/spectmgmt.c +2 -2
@@ -35,7 +35,7 @@ static void ieee80211_send_refuse_measurif (!skb) {printk (KERN_ERR "%s: failed to allocate buffer for " -"measurement report frame\n" , sdata->dev->name); +"measurement report frame\n" , sdata->name);return ; }
@@ -43,7 +43,7 @@ static void ieee80211_send_refuse_measur msr_report = (struct ieee80211_mgmt *)skb_put (skb,24 );memset (msr_report,0 ,24 );memcpy (msr_report->da, da,ETH_ALEN ); -memcpy (msr_report->sa, sdata->dev->dev_addr,ETH_ALEN ); +memcpy (msr_report->sa, sdata->vif.addr,ETH_ALEN );memcpy (msr_report->bssid, bssid,ETH_ALEN ); msr_report->frame_control =cpu_to_le16 (IEEE80211_FTYPE_MGMT |IEEE80211_STYPE_ACTION );
net/mac80211/sta_info.c +4 -4
@@ -372,7 +372,7 @@ int sta_info_insert(struct sta_info *sta goto out_free; } -if (WARN_ON (compare_ether_addr (sta->sta.addr, sdata->dev->dev_addr) ==0 || +if (WARN_ON (compare_ether_addr (sta->sta.addr, sdata->vif.addr) ==0 ||is_multicast_ether_addr (sta->sta.addr))) { err = -EINVAL ; goto out_free;
@@ -831,7 +831,7 @@ void ieee80211_sta_expire(struct ieee802if (time_after (jiffies, sta->last_rx + exp_time)) {#ifdef CONFIG_MAC80211_IBSS_DEBUG printk (KERN_DEBUG "%s: expiring inactive STA %pM\n" , - sdata->dev->name, sta->sta.addr); + sdata->name, sta->sta.addr);#endif __sta_info_unlink (&sta);if (sta)
@@ -889,7 +889,7 @@ void ieee80211_sta_ps_deliver_wakeup(str#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG printk (KERN_DEBUG "%s: STA %pM aid %d sending %d filtered/%d PS frames " -"since STA not sleeping anymore\n" , sdata->dev->name, +"since STA not sleeping anymore\n" , sdata->name, sta->sta.addr, sta->sta.aid, sent - buffered, buffered);#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ }
@@ -948,7 +948,7 @@ void ieee80211_sta_ps_deliver_poll_respo*/ printk (KERN_DEBUG "%s: STA %pM sent PS Poll even " "though there are no buffered frames for it\n" , - sdata->dev->name, sta->sta.addr); + sdata->name, sta->sta.addr);#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */ } }
net/mac80211/tx.c +16 -17
@@ -223,7 +223,7 @@ ieee80211_tx_h_check_assoc(struct ieee80#ifdef CONFIG_MAC80211_VERBOSE_DEBUG printk (KERN_DEBUG "%s: dropped data frame to not " "associated station %pM\n" , - tx->dev->name, hdr->addr1); + tx->sdata->name, hdr->addr1);#endif /* CONFIG_MAC80211_VERBOSE_DEBUG */ I802_DEBUG_INC (tx->local->tx_handlers_drop_not_assoc);return TX_DROP ;
@@ -331,7 +331,7 @@ ieee80211_tx_h_multicast_ps_buf(struct i#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG if (net_ratelimit ())printk (KERN_DEBUG "%s: BC TX buffer full - dropping the oldest frame\n" , - tx->dev->name); + tx->sdata->name);#endif dev_kfree_skb (skb_dequeue (&tx->sdata->bss->ps_bc_buf)); }else
@@ -390,7 +390,7 @@ ieee80211_tx_h_unicast_ps_buf(struct ieeif (net_ratelimit ()) {printk (KERN_DEBUG "%s: STA %pM TX " "buffer full - dropping oldest frame\n" , - tx->dev->name, sta->sta.addr); + tx->sdata->name, sta->sta.addr); }#endif dev_kfree_skb (old);
@@ -415,7 +415,7 @@ ieee80211_tx_h_unicast_ps_buf(struct iee#ifdef CONFIG_MAC80211_VERBOSE_PS_DEBUG else if (unlikely(staflags & WLAN_STA_PS_STA)) {printk (KERN_DEBUG "%s: STA %pM in PS mode, but pspoll " -"set -> send frame\n" , tx->dev->name, +"set -> send frame\n" , tx->sdata->name, sta->sta.addr); }#endif /* CONFIG_MAC80211_VERBOSE_PS_DEBUG */
@@ -548,7 +548,7 @@ ieee80211_tx_h_rate_ctrl(struct ieee8021"%s: Dropped data frame as no usable bitrate found while " "scanning and associated. Target station: " "%pM on %d GHz band\n" , - tx->dev->name, hdr->addr1, + tx->sdata->name, hdr->addr1, tx->channel->band ? 5 : 2)) return TX_DROP;
@@ -1020,7 +1020,6 @@ ieee80211_tx_prepare(struct ieee80211_sumemset (tx,0 ,sizeof (*tx)); tx->skb = skb; - tx->dev = sdata->dev;/* use original interface */ tx->local = local; tx->sdata = sdata; tx->channel = local->hw.conf.channel;
@@ -1476,7 +1475,7 @@ static void ieee80211_xmit(struct ieee80continue ;if (tmp_sdata->vif.type !=NL80211_IFTYPE_AP )continue ; -if (compare_ether_addr (tmp_sdata->dev->dev_addr, +if (compare_ether_addr (tmp_sdata->vif.addr, hdr->addr2) ==0 ) {dev_hold (tmp_sdata->dev);dev_put (sdata->dev);
@@ -1642,7 +1641,7 @@ netdev_tx_t ieee80211_subif_start_xmit(s fc |=cpu_to_le16 (IEEE80211_FCTL_FROMDS |IEEE80211_FCTL_TODS );/* RA TA DA SA */ memcpy (hdr.addr1, sta->sta.addr,ETH_ALEN ); -memcpy (hdr.addr2, dev->dev_addr,ETH_ALEN ); +memcpy (hdr.addr2, sdata->vif.addr,ETH_ALEN );memcpy (hdr.addr3, skb->data,ETH_ALEN );memcpy (hdr.addr4, skb->data +ETH_ALEN ,ETH_ALEN ); hdrlen =30 ;
@@ -1656,7 +1655,7 @@ netdev_tx_t ieee80211_subif_start_xmit(s fc |=cpu_to_le16 (IEEE80211_FCTL_FROMDS );/* DA BSSID SA */ memcpy (hdr.addr1, skb->data,ETH_ALEN ); -memcpy (hdr.addr2, dev->dev_addr,ETH_ALEN ); +memcpy (hdr.addr2, sdata->vif.addr,ETH_ALEN );memcpy (hdr.addr3, skb->data +ETH_ALEN ,ETH_ALEN ); hdrlen =24 ;break ;
@@ -1664,7 +1663,7 @@ netdev_tx_t ieee80211_subif_start_xmit(s fc |=cpu_to_le16 (IEEE80211_FCTL_FROMDS |IEEE80211_FCTL_TODS );/* RA TA DA SA */ memcpy (hdr.addr1, sdata->u.wds.remote_addr,ETH_ALEN ); -memcpy (hdr.addr2, dev->dev_addr,ETH_ALEN ); +memcpy (hdr.addr2, sdata->vif.addr,ETH_ALEN );memcpy (hdr.addr3, skb->data,ETH_ALEN );memcpy (hdr.addr4, skb->data +ETH_ALEN ,ETH_ALEN ); hdrlen =30 ;
@@ -1678,8 +1677,8 @@ netdev_tx_t ieee80211_subif_start_xmit(s goto fail; } -if (compare_ether_addr (dev->dev_addr, - skb->data +ETH_ALEN ) ==0 ) { +if (compare_ether_addr (sdata->vif.addr, + skb->data +ETH_ALEN ) ==0 ) { hdrlen =ieee80211_fill_mesh_addresses (&hdr, &fc, skb->data, skb->data +ETH_ALEN ); meshhdrlen = ieee80211_new_mesh_header(&mesh_hdr,
@@ -1705,7 +1704,7 @@ netdev_tx_t ieee80211_subif_start_xmit(s mesh_da = dev->broadcast; } hdrlen =ieee80211_fill_mesh_addresses (&hdr, &fc, - mesh_da, dev->dev_addr); + mesh_da, sdata->vif.addr);rcu_read_unlock ();if (is_mesh_mcast) meshhdrlen =
@@ -1730,7 +1729,7 @@ netdev_tx_t ieee80211_subif_start_xmit(sif (sdata->use_4addr && ethertype !=ETH_P_PAE ) { fc |=cpu_to_le16 (IEEE80211_FCTL_FROMDS |IEEE80211_FCTL_TODS );/* RA TA DA SA */ -memcpy (hdr.addr2, dev->dev_addr,ETH_ALEN ); +memcpy (hdr.addr2, sdata->vif.addr,ETH_ALEN );memcpy (hdr.addr3, skb->data,ETH_ALEN );memcpy (hdr.addr4, skb->data +ETH_ALEN ,ETH_ALEN ); hdrlen =30 ;
@@ -1781,7 +1780,7 @@ netdev_tx_t ieee80211_subif_start_xmit(s unlikely(!is_multicast_ether_addr(hdr.addr1) && !(sta_flags & WLAN_STA_AUTHORIZED) && !(ethertype == ETH_P_PAE && - compare_ether_addr(dev->dev_addr, + compare_ether_addr(sdata->vif.addr, skb->data + ETH_ALEN) == 0))) {#ifdef CONFIG_MAC80211_VERBOSE_DEBUG if (net_ratelimit ())
@@ -2147,8 +2146,8 @@ struct sk_buff *ieee80211_beacon_get_tim mgmt->frame_control =cpu_to_le16 (IEEE80211_FTYPE_MGMT |IEEE80211_STYPE_BEACON );memset (mgmt->da,0xff ,ETH_ALEN ); -memcpy (mgmt->sa, sdata->dev->dev_addr,ETH_ALEN ); -memcpy (mgmt->bssid, sdata->dev->dev_addr,ETH_ALEN ); +memcpy (mgmt->sa, sdata->vif.addr,ETH_ALEN ); +memcpy (mgmt->bssid, sdata->vif.addr,ETH_ALEN ); mgmt->u.beacon.beacon_int =cpu_to_le16 (sdata->vif.bss_conf.beacon_int); mgmt->u.beacon.capab_info =0x0 ;/* 0x0 for MPs */
net/mac80211/util.c +7 -7
@@ -469,7 +469,7 @@ void ieee80211_iterate_active_interfacesbreak ; }if (netif_running (sdata->dev)) -iterator (data, sdata->dev->dev_addr, +iterator (data, sdata->vif.addr, &sdata->vif); }
@@ -503,7 +503,7 @@ void ieee80211_iterate_active_interfacesbreak ; }if (netif_running (sdata->dev)) -iterator (data, sdata->dev->dev_addr, +iterator (data, sdata->vif.addr, &sdata->vif); }
@@ -848,7 +848,7 @@ void ieee80211_send_auth(struct ieee8021 sizeof(*mgmt) + 6 + extra_len);if (!skb) {printk (KERN_DEBUG "%s: failed to allocate buffer for auth " -"frame\n" , sdata->dev->name); +"frame\n" , sdata->name);return ; }skb_reserve (skb, local->hw.extra_tx_headroom);
@@ -858,7 +858,7 @@ void ieee80211_send_auth(struct ieee8021 mgmt->frame_control =cpu_to_le16 (IEEE80211_FTYPE_MGMT |IEEE80211_STYPE_AUTH );memcpy (mgmt->da, bssid,ETH_ALEN ); -memcpy (mgmt->sa, sdata->dev->dev_addr,ETH_ALEN ); +memcpy (mgmt->sa, sdata->vif.addr,ETH_ALEN );memcpy (mgmt->bssid, bssid,ETH_ALEN ); mgmt->u.auth.auth_alg =cpu_to_le16 (auth_alg); mgmt->u.auth.auth_transaction =cpu_to_le16 (transaction);
@@ -948,7 +948,7 @@ void ieee80211_send_probe_req(struct iee ie_len);if (!skb) {printk (KERN_DEBUG "%s: failed to allocate buffer for probe " -"request\n" , sdata->dev->name); +"request\n" , sdata->name);return ; }skb_reserve (skb, local->hw.extra_tx_headroom);
@@ -957,7 +957,7 @@ void ieee80211_send_probe_req(struct ieememset (mgmt,0 ,24 ); mgmt->frame_control =cpu_to_le16 (IEEE80211_FTYPE_MGMT |IEEE80211_STYPE_PROBE_REQ ); -memcpy (mgmt->sa, sdata->dev->dev_addr,ETH_ALEN ); +memcpy (mgmt->sa, sdata->vif.addr,ETH_ALEN );if (dst) {memcpy (mgmt->da, dst,ETH_ALEN );memcpy (mgmt->bssid, dst,ETH_ALEN );
@@ -1053,7 +1053,7 @@ int ieee80211_reconfig(struct ieee80211_ netif_running(sdata->dev)) { conf.vif = &sdata->vif; conf.type = sdata->vif.type; - conf.mac_addr = sdata->dev->dev_addr; + conf.mac_addr = sdata->vif.addr; res =drv_add_interface (local, &conf); } }
include/net/mac80211.h +2 -0
@@ -656,12 +656,14 @@ struct ieee80211_conf {* @type: type of this virtual interface * @bss_conf: BSS configuration for this interface, either our own * or the BSS we're associated to +* @addr: address of this interface * @drv_priv: data area for driver use, will always be aligned to * sizeof(void *). */ struct ieee80211_vif {enum nl80211_iftype type;struct ieee80211_bss_conf bss_conf; +u8 addr[ETH_ALEN ];/* must be last */ u8 drv_priv[0 ] __attribute__((__aligned__ (sizeof (void *)))); };
net/mac80211/driver-ops.h +2 -2
@@ -39,7 +39,7 @@ static inline int drv_add_interface(stru struct ieee80211_if_init_conf *conf) {int ret = local->ops->add_interface (&local->hw, conf); -trace_drv_add_interface (local, conf->mac_addr, conf->vif, ret); +trace_drv_add_interface (local, conf->vif, ret);return ret; }
@@ -47,7 +47,7 @@ static inline void drv_remove_interface( struct ieee80211_if_init_conf *conf) { local->ops->remove_interface (&local->hw, conf); -trace_drv_remove_interface (local, conf->mac_addr, conf->vif); +trace_drv_remove_interface (local, conf->vif); }static inline int drv_config (struct ieee80211_local *local,u32 changed)
net/mac80211/driver-trace.h +5 -7
@@ -70,11 +70,10 @@ TRACE_EVENT(drv_stop, TRACE_EVENT(drv_add_interface, TP_PROTO(struct ieee80211_local *local, - const u8 *addr, struct ieee80211_vif *vif, int ret), - TP_ARGS(local, addr, vif, ret), + TP_ARGS(local, vif, ret), TP_STRUCT__entry( LOCAL_ENTRY
@@ -86,7 +85,7 @@ TRACE_EVENT(drv_add_interface,TP_fast_assign ( LOCAL_ASSIGN;VIF_ASSIGN ; -memcpy (__entry->addr, addr,6 ); +memcpy (__entry->addr, vif->addr,6 ); __entry->ret = ret; ),
@@ -97,10 +96,9 @@ TRACE_EVENT(drv_add_interface, ); TRACE_EVENT(drv_remove_interface, - TP_PROTO(struct ieee80211_local *local, - const u8 *addr, struct ieee80211_vif *vif), + TP_PROTO(struct ieee80211_local *local, struct ieee80211_vif *vif), - TP_ARGS(local, addr, vif), + TP_ARGS(local, vif), TP_STRUCT__entry( LOCAL_ENTRY
@@ -111,7 +109,7 @@ TRACE_EVENT(drv_remove_interface,TP_fast_assign ( LOCAL_ASSIGN;VIF_ASSIGN ; -memcpy (__entry->addr, addr,6 ); +memcpy (__entry->addr, vif->addr,6 ); ), TP_printk(
net/mac80211/iface.c +59 -3
95 lines not on this page · raw message
net/mac80211/debugfs_netdev.c +5 -50
79 lines not on this page · raw message
net/mac80211/debugfs_netdev.h +3 -6
@@ -6,8 +6,7 @@#ifdef CONFIG_MAC80211_DEBUGFS void ieee80211_debugfs_add_netdev (struct ieee80211_sub_if_data *sdata);void ieee80211_debugfs_remove_netdev (struct ieee80211_sub_if_data *sdata); -void ieee80211_debugfs_netdev_init (void ); -void ieee80211_debugfs_netdev_exit (void ); +void ieee80211_debugfs_rename_netdev (struct ieee80211_sub_if_data *sdata);#else static inline void ieee80211_debugfs_add_netdev (struct ieee80211_sub_if_data *sdata)
@@ -15,10 +14,8 @@ static inline void ieee80211_debugfs_addstatic inline void ieee80211_debugfs_remove_netdev (struct ieee80211_sub_if_data *sdata) {} -static inline void ieee80211_debugfs_netdev_init (void ) -{} - -static inline void ieee80211_debugfs_netdev_exit (void ) +static inline void ieee80211_debugfs_rename_netdev ( +struct ieee80211_sub_if_data *sdata) {}#endif
net/mac80211/ieee80211_i.h +4 -1
@@ -139,7 +139,6 @@ typedef unsigned __bitwise__ ieee80211_tstruct ieee80211_tx_data {struct sk_buff *skb; -struct net_device *dev;struct ieee80211_local *local;struct ieee80211_sub_if_data *sdata;struct sta_info *sta;
@@ -430,6 +429,8 @@ struct ieee80211_sub_if_data {int drop_unencrypted; +char name[IFNAMSIZ ]; +/* * keep track of whether the HT opmode (stored in * vif.bss_info.ht_operation_mode) is valid.
@@ -930,6 +931,8 @@ void ieee80211_rx_bss_put(struct ieee802 struct ieee80211_bss *bss);/* interface handling */ +int ieee80211_iface_init (void ); +void ieee80211_iface_exit (void );int ieee80211_if_add (struct ieee80211_local *local,const char *name,struct net_device **new_dev,enum nl80211_iftype type,struct vif_params *params);
net/mac80211/debugfs_sta.c +1 -1
@@ -44,7 +44,7 @@ static const struct file_operations sta_STA_OPS (name) STA_FILE(aid, sta.aid, D); -STA_FILE (dev, sdata->dev->name,S ); +STA_FILE (dev, sdata->name,S );STA_FILE (rx_packets, rx_packets,LU );STA_FILE (tx_packets, tx_packets,LU );STA_FILE (rx_bytes, rx_bytes,LU );
net/mac80211/debugfs_key.c +1 -1
@@ -56,7 +56,7 @@ KEY_CONF_FILE(keyidx, D);KEY_CONF_FILE (hw_key_idx,D );KEY_FILE (flags,X );KEY_FILE (tx_rx_count,D ); -KEY_READ (ifindex, sdata->dev->ifindex,20 ,"%d\n" ); +KEY_READ (ifindex, sdata->name,IFNAMSIZ +2 ,"%s\n" );KEY_OPS (ifindex); static ssize_t key_algorithm_read(struct file *file,
net/mac80211/cfg.c +1 -1
@@ -734,7 +734,7 @@ static int ieee80211_add_station(struct }else sdata =IEEE80211_DEV_TO_SUB_IF (dev); -if (compare_ether_addr (mac, dev->dev_addr) ==0 ) +if (compare_ether_addr (mac, sdata->vif.addr) ==0 )return -EINVAL ;if (is_multicast_ether_addr (mac))
net/mac80211/pm.c +1 -1
@@ -102,7 +102,7 @@ int __ieee80211_suspend(struct ieee80211 conf.vif = &sdata->vif; conf.type = sdata->vif.type; - conf.mac_addr = sdata->dev->dev_addr; + conf.mac_addr = sdata->vif.addr;drv_remove_interface (local, &conf); }