reorganised patches
Johannes Berg
maintainercover reorganised patches
This series contains those patches that should be uncontroversial. I haven't included the nl80211 VLAN removal again because I already sent that to davem.
johannes
Johannes Berg
maintainerPATCH 1/20 mac80211: fix showing transmitted frames on multiple monitor interfaces
--- net/mac80211/ieee80211.c | 1 - 1 file changed, 1 deletion(-)
net/mac80211/ieee80211.c +0 -1
@@ -1190,7 +1190,6 @@ void ieee80211_tx_status(struct ieee8021memset (skb->cb,0 ,sizeof (skb->cb));netif_rx (skb); skb = skb2; -break ; } } out:
Johannes Berg
maintainerPATCH 2/20 mac80211: remove ieee80211_msg_wep_frame_unknown_key
In reply to Johannes BergNeither hostapd nor wpa_supplicant really use it.
--- net/mac80211/ieee80211_common.h | 2 +- net/mac80211/rx.c | 11 +++++------ 2 files changed, 6 insertions(+), 7 deletions(-)
net/mac80211/rx.c +5 -6
@@ -350,12 +350,11 @@ ieee80211_rx_h_load_key(struct ieee80211MAC_ARG (hdr->addr1),MAC_ARG (hdr->addr2), MAC_ARG(hdr->addr3)); -if (!rx->local->apdev) -return TXRX_DROP ; -ieee80211_rx_mgmt ( - rx->local, rx->skb, rx->u.rx.status, - ieee80211_msg_wep_frame_unknown_key); -return TXRX_QUEUED ; +/* +* TODO: notify userspace about this +* via cfg/nl80211 +*/ +return TXRX_DROP ; } } }
net/mac80211/ieee80211_common.h +1 -1
@@ -48,7 +48,7 @@ enum ieee80211_msg_type { ieee80211_msg_tx_callback_ack =1 , ieee80211_msg_tx_callback_fail =2 ,/* hole at 3, was ieee80211_msg_passive_scan but unused */ - ieee80211_msg_wep_frame_unknown_key =4 , +/* hole at 4, was ieee80211_msg_wep_frame_unknown_key but now unused */ ieee80211_msg_michael_mic_failure =5 ,/* hole at 6, was monitor but never sent to userspace */ ieee80211_msg_sta_not_assoc = 7,
Johannes Berg
maintainerPATCH 3/20 mac80211: remove radar stuff
In reply to Johannes BergUnused in drivers, userspace and mac80211.
--- include/net/mac80211.h | 6 ------ net/mac80211/ieee80211.c | 28 ---------------------------- net/mac80211/ieee80211_common.h | 2 +- 3 files changed, 1 insertion(+), 35 deletions(-)
include/net/mac80211.h +0 -6
@@ -1038,12 +1038,6 @@ ieee80211_get_mc_list_item(struct ieee80/* called by driver to notify scan status completed */ void ieee80211_scan_completed (struct ieee80211_hw *hw); -/* Function to indicate Radar Detection. The low level driver must call this -* function to indicate the presence of radar in the current channel. -* Additionally the radar type also could be sent */ -int ieee80211_radar_status (struct ieee80211_hw *hw,int channel, -int radar,int radar_type); -/* return a pointer to the source address (SA) */ static inline u8 *ieee80211_get_SA (struct ieee80211_hdr *hdr) {
net/mac80211/ieee80211.c +0 -28
@@ -201,34 +201,6 @@ ieee80211_rx_mgmt(struct ieee80211_localnetif_rx (skb); } -int ieee80211_radar_status (struct ieee80211_hw *hw,int channel, -int radar,int radar_type) -{ -struct sk_buff *skb; -struct ieee80211_radar_info *msg; -struct ieee80211_local *local =hw_to_local (hw); - -if (!local->apdev) -return 0 ; - - skb =dev_alloc_skb (sizeof (struct ieee80211_frame_info ) + -sizeof (struct ieee80211_radar_info )); - -if (!skb) -return -ENOMEM ; -skb_reserve (skb,sizeof (struct ieee80211_frame_info )); - - msg = (struct ieee80211_radar_info *) -skb_put (skb,sizeof (struct ieee80211_radar_info )); - msg->channel = channel; - msg->radar = radar; - msg->radar_type = radar_type; - -ieee80211_rx_mgmt (local, skb,NULL , ieee80211_msg_radar); -return 0 ; -} -EXPORT_SYMBOL (ieee80211_radar_status); -void ieee80211_key_threshold_notify (struct net_device *dev,struct ieee80211_key *key,struct sta_info *sta)
net/mac80211/ieee80211_common.h +1 -1
@@ -54,7 +54,7 @@ enum ieee80211_msg_type { ieee80211_msg_sta_not_assoc =7 ,/* 8 was ieee80211_msg_set_aid_for_sta */ ieee80211_msg_key_threshold_notification = 9, - ieee80211_msg_radar = 11, + /* 11 was ieee80211_msg_radar */ }; struct ieee80211_msg_key_notification {
Johannes Berg
maintainerPATCH 4/20 cfg80211: extend radiotap parser by all remaining fields
In reply to Johannes BergThese fields are defined so the parser might as well understand them.
--- net/wireless/radiotap.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
net/wireless/radiotap.c +5 -1
@@ -161,7 +161,11 @@ int ieee80211_radiotap_iterator_next( [IEEE80211_RADIOTAP_DBM_TX_POWER] = 0x11, [IEEE80211_RADIOTAP_ANTENNA] = 0x11, [IEEE80211_RADIOTAP_DB_ANTSIGNAL] = 0x11, - [IEEE80211_RADIOTAP_DB_ANTNOISE ] =0x11 + [IEEE80211_RADIOTAP_DB_ANTNOISE] = 0x11, + [IEEE80211_RADIOTAP_RX_FLAGS] = 0x22, + [IEEE80211_RADIOTAP_TX_FLAGS] = 0x22, + [IEEE80211_RADIOTAP_RTS_RETRIES] = 0x11, + [IEEE80211_RADIOTAP_DATA_RETRIES] = 0x11,/* * add more here as they are defined in * include/net/ieee80211_radiotap.h
Johannes Berg
maintainerPATCH 5/20 mac80211: remove unused ioctls (1)
In reply to Johannes BergThe ioctls
* PRISM2_PARAM_WIFI_WME_NOACK_TEST
* PRISM2_PARAM_HOST_ENCRYPT
* PRISM2_PARAM_HOST_DECRYPT
* PRISM2_PARAM_ANTENNA_MODE
* PRISM2_PARAM_STAT_TIME
* PRISM2_PARAM_SCAN_FLAGS
are not used by hostapd or wpa_supplicant.
--- include/net/mac80211.h | 3 -- net/mac80211/hostapd_ioctl.h | 6 ---- net/mac80211/ieee80211.c | 42 ------------------------------- net/mac80211/ieee80211_i.h | 7 ----- net/mac80211/ieee80211_ioctl.c | 54 ----------------------------------------- net/mac80211/ieee80211_sta.c | 37 ---------------------------- net/mac80211/wme.c | 3 -- 7 files changed, 152 deletions(-)
net/mac80211/hostapd_ioctl.h +0 -6
@@ -28,8 +28,6 @@ enum {PRISM2_PARAM_BEACON_INT =3 ,PRISM2_PARAM_AP_BRIDGE_PACKETS =10 ,PRISM2_PARAM_DTIM_PERIOD =11 , -PRISM2_PARAM_HOST_ENCRYPT =17 , -PRISM2_PARAM_HOST_DECRYPT =18 , PRISM2_PARAM_IEEE_802_1X = 23,/* Instant802 additions */
@@ -38,19 +36,15 @@ enum {PRISM2_PARAM_SHORT_SLOT_TIME =1006 ,PRISM2_PARAM_NEXT_MODE =1008 ,PRISM2_PARAM_RADIO_ENABLED =1010 , -PRISM2_PARAM_ANTENNA_MODE =1013 ,PRISM2_PARAM_PRIVACY_INVOKED =1014 ,PRISM2_PARAM_BROADCAST_SSID =1015 , -PRISM2_PARAM_STAT_TIME =1016 ,PRISM2_PARAM_STA_ANTENNA_SEL =1017 ,PRISM2_PARAM_TX_POWER_REDUCTION =1022 ,PRISM2_PARAM_EAPOL =1023 ,PRISM2_PARAM_KEY_TX_RX_THRESHOLD =1024 ,PRISM2_PARAM_KEY_INDEX =1025 ,PRISM2_PARAM_DEFAULT_WEP_ONLY =1026 , -PRISM2_PARAM_WIFI_WME_NOACK_TEST =1033 ,PRISM2_PARAM_ALLOW_BROADCAST_ALWAYS =1034 , -PRISM2_PARAM_SCAN_FLAGS =1035 ,PRISM2_PARAM_HW_MODES =1036 ,PRISM2_PARAM_CREATE_IBSS =1037 , PRISM2_PARAM_WMM_ENABLED = 1038,
net/mac80211/ieee80211_i.h +0 -7
@@ -553,10 +553,6 @@ struct ieee80211_local {struct list_head sta_bss_list;struct ieee80211_sta_bss *sta_bss_hash[STA_HASH_SIZE ];spinlock_t sta_bss_lock; -#define IEEE80211_SCAN_MATCH_SSID BIT(0) -#define IEEE80211_SCAN_WPA_ONLY BIT(1) -#define IEEE80211_SCAN_EXTRA_INFO BIT(2) -int scan_flags;#ifdef CONFIG_HOSTAPD_WPA_TESTING #define WPA_TRIGGER_FAIL_TX_MIC BIT(0)
@@ -590,8 +586,6 @@ struct ieee80211_local {u32 channel_use;u32 channel_use_raw; -u32 stat_time; -struct timer_list stat_timer;#ifdef CONFIG_MAC80211_DEBUGFS struct work_struct sta_debugfs_add;
@@ -642,7 +636,6 @@ struct ieee80211_local {* even when there are no associated STAs */ -int wifi_wme_noack_test;unsigned int wmm_acm;/* bit field of ACM bits (BIT(802.1D tag)) */ unsigned int enabled_modes;/* bitfield of allowed modes;
net/mac80211/ieee80211_ioctl.c +0 -54
117 lines not on this page · raw message
net/mac80211/wme.c +0 -3
@@ -192,9 +192,6 @@ static int wme_qdiscop_enqueue(struct skif (WLAN_FC_IS_QOS_DATA (fc)) {u8 *p = skb->data +ieee80211_get_hdrlen (fc) -2 ;u8 qos_hdr = skb->priority &QOS_CONTROL_TAG1D_MASK ; -if (local->wifi_wme_noack_test) - qos_hdr |=QOS_CONTROL_ACK_POLICY_NOACK << -QOS_CONTROL_ACK_POLICY_SHIFT ;/* qos header is 2 bytes, second reserved */ *p = qos_hdr; p++;
include/net/mac80211.h +0 -3
@@ -300,9 +300,6 @@ struct ieee80211_conf {u8 antenna_sel_tx;u8 antenna_sel_rx; -int antenna_def; -int antenna_mode; -/* Following five fields are used for IEEE 802.11H */ unsigned int radar_detect;unsigned int spect_mgmt;
net/mac80211/ieee80211.c +0 -42
60 lines not on this page · raw message
net/mac80211/ieee80211_sta.c +0 -37
@@ -3819,15 +3819,6 @@ ieee80211_sta_scan_result(struct net_devif (!(local->enabled_modes & (1 << bss->hw_mode)))return current_ev; -if (local->scan_flags &IEEE80211_SCAN_WPA_ONLY && - !bss->wpa_ie && !bss->rsn_ie) -return current_ev; - -if (local->scan_flags &IEEE80211_SCAN_MATCH_SSID && - (local->scan_ssid_len != bss->ssid_len || -memcmp (local->scan_ssid, bss->ssid, bss->ssid_len) !=0 )) -return current_ev; -memset (&iwe,0 ,sizeof (iwe)); iwe.cmd =SIOCGIWAP ; iwe.u.ap_addr.sa_family =ARPHRD_ETHER ;
@@ -3931,34 +3922,6 @@ ieee80211_sta_scan_result(struct net_dev } } -do { -char *buf; - -if (!(local->scan_flags &IEEE80211_SCAN_EXTRA_INFO )) -break ; - - buf =kmalloc (100 ,GFP_ATOMIC ); -if (!buf) -break ; - -memset (&iwe,0 ,sizeof (iwe)); - iwe.cmd =IWEVCUSTOM ; -sprintf (buf,"bcn_int=%d" , bss->beacon_int); - iwe.u.data.length =strlen (buf); - current_ev =iwe_stream_add_point (current_ev, end_buf, &iwe, - buf); - -memset (&iwe,0 ,sizeof (iwe)); - iwe.cmd =IWEVCUSTOM ; -sprintf (buf,"capab=0x%04x" , bss->capability); - iwe.u.data.length =strlen (buf); - current_ev =iwe_stream_add_point (current_ev, end_buf, &iwe, - buf); - -kfree (buf); -break ; - }while (0 ); -return current_ev; }
Re: [PATCH 05/20] mac80211: remove unused ioctls (1)
Quoted 10 lines · Johannes Berg
The ioctls
*
PRISM2_PARAM_WIFI_WME_NOACK_TEST
*PRISM2_PARAM_HOST_ENCRYPT
*PRISM2_PARAM_HOST_DECRYPT
*PRISM2_PARAM_ANTENNA_MODE
*PRISM2_PARAM_STAT_TIME
*PRISM2_PARAM_SCAN_FLAGSare not used by hostapd or
wpa_supplicant.
No, but some of them can be assumed to be used with iwpriv.. First one is useful should one be interested in WFA certifications tests. Scan flags can be useful in filtering out scan results in cases where there are huge numbers of APs around. I could agree with the other ones being more or less useless here.
Quoted 10 lines
net/mac80211/ieee80211_sta.c +0
-5@@ -3931,34 +3922,6 @@ ieee80211_sta_scan_result(struct net_dev -if (!(local->scan_flags &IEEE80211_SCAN_EXTRA_INFO )) -break ; -memset (&iwe,0 ,sizeof (iwe)); - iwe.cmd =IWEVCUSTOM ; -sprintf (buf,"bcn_int=%d" , bss->beacon_int);
net/mac80211/ieee80211_sta.c ieee80211_sta_scan_result(struct net_dev · line 3947
Quoted 10 lines
net/mac80211/ieee80211_sta.c +0
-10- iwe.u.data.length =strlen (buf); - current_ev =iwe_stream_add_point (current_ev, end_buf, &iwe, - buf); - -memset (&iwe,0 ,sizeof (iwe)); - iwe.cmd =IWEVCUSTOM ; -sprintf (buf,"capab=0x%04x" , bss->capability); - iwe.u.data.length =strlen (buf); - current_ev =iwe_stream_add_point (current_ev, end_buf, &iwe, - buf);
Even if you end up removing scan_flags, you could leave these pieces of information available in scan results.
Signature · 1 line
Jouni Malinen PGP id EFC895FA
Johannes Berg
maintainerRe: [PATCH 05/20] mac80211: remove unused ioctls (1)
Quoted 1 line · Jouni Malinen
No, but some of them can be assumed to be used with iwpriv..
As for that, see my other mail.
Quoted 2 lines
First one
is useful should one be interested in WFA certifications tests.
That should, imho, rather live in debugfs. Somebody doing certification tests ought to be able to enable debugfs on their system.
Quoted 3 lines
Scan
flags can be useful in filtering out scan results in cases where there are huge numbers of APs around.
Plan has it that the new cfg80211 API for scanning allows scanning for things rather than filtering the results after the fact, e.g. (like iwlist already supports) scanning for a particular SSID. I suppose hardware designs like iwlwifi could make much better use of that than mac80211 itself though.
Quoted 2 lines
Even if you end up removing
scan_flags, you could leave these pieces of information available in scan results.
Sure, I can do that.
johannes
Re: [PATCH 05/20] mac80211: remove unused ioctls (1)
Quoted 7 lines · Johannes Berg
Quoted 2 lines · Jouni Malinen
First one
is useful should one be interested in WFA certifications tests.That should, imho, rather live in debugfs. Somebody doing certification tests ought to be able to enable debugfs on their system.
Sure, that's fine. I was mainly objecting for the part of completely removing the code (i.e., not just the ioctl). I don't really care how this command goes through, but anyway, I would agree that debugfs would be more reasonable location now that it is available and already being used elsewhere in mac80211.
Quoted 9 lines
Quoted 3 lines
Scan
flags can be useful in filtering out scan results in cases where there are huge numbers of APs around.Plan has it that the new cfg80211 API for scanning allows scanning for things rather than filtering the results after the fact, e.g. (like iwlist already supports) scanning for a particular SSID. I suppose hardware designs like iwlwifi could make much better use of that than mac80211 itself though.
OK. I was more commenting on part of removing functionality, not on the removal of ioctl itself.
Signature · 1 line
Jouni Malinen PGP id EFC895FA
Johannes Berg
maintainerRe: [PATCH 05/20] mac80211: remove unused ioctls (1)
Quoted 5 lines · Jouni Malinen
Sure, that's fine. I was mainly objecting for the part of completely removing the code (i.e., not just the ioctl). I don't really care how this command goes through, but anyway, I would agree that debugfs would be more reasonable location now that it is available and already being used elsewhere in mac80211.
Ok. I'll update the patch to move that flag instead. Though that has me thinking, should it be a per-netdev flag rather than a global one?
johannes
Johannes Berg
maintainerPATCH 6/20 mac80211: remove PRISM2_PARAM_RADIO_ENABLED
In reply to Johannes BergThis now is unused in hostapd/wpa_supplicant.
--- net/mac80211/hostapd_ioctl.h | 1 - net/mac80211/ieee80211_ioctl.c | 14 -------------- 2 files changed, 15 deletions(-)
net/mac80211/hostapd_ioctl.h +0 -1
@@ -35,7 +35,6 @@ enum {PRISM2_PARAM_PREAMBLE =1003 ,PRISM2_PARAM_SHORT_SLOT_TIME =1006 ,PRISM2_PARAM_NEXT_MODE =1008 , -PRISM2_PARAM_RADIO_ENABLED =1010 ,PRISM2_PARAM_PRIVACY_INVOKED =1014 ,PRISM2_PARAM_BROADCAST_SSID =1015 , PRISM2_PARAM_STA_ANTENNA_SEL = 1017,
net/mac80211/ieee80211_ioctl.c +0 -14
@@ -1157,16 +1157,6 @@ static int ieee80211_ioctl_set_regulator } -static int ieee80211_ioctl_set_radio_enabled (struct net_device *dev, -int val) -{ -struct ieee80211_local *local =wdev_priv (dev->ieee80211_ptr); -struct ieee80211_conf *conf = &local->hw.conf; - - conf->radio_enabled = val; -return ieee80211_hw_config (wdev_priv (dev->ieee80211_ptr)); -} -static int ieee80211_ioctl_set_tx_queue_params (struct net_device *dev,struct prism2_hostapd_param *param)
@@ -2202,10 +2192,6 @@ static int ieee80211_ioctl_prism2_param( local->next_mode = value;break ; -case PRISM2_PARAM_RADIO_ENABLED : - ret =ieee80211_ioctl_set_radio_enabled (dev, value); -break ; -case PRISM2_PARAM_BROADCAST_SSID :if ((value <0 ) || (value >1 )) ret = -EINVAL ;
Johannes Berg
maintainerPATCH 7/20 mac80211: remove unused ioctls (2)
In reply to Johannes BergThe ioctls
* PRISM2_PARAM_STA_ANTENNA_SEL
* PRISM2_PARAM_TX_POWER_REDUCTION
* PRISM2_PARAM_KEY_INDEX
* PRISM2_PARAM_DEFAULT_WEP_ONLY
* PRISM2_PARAM_ALLOW_BROADCAST_ALWAYS
are not used by hostapd or wpa_supplicant.
--- drivers/net/wireless/iwl-4965-rs.c | 2 - include/net/mac80211.h | 1 net/mac80211/debugfs.c | 5 --- net/mac80211/hostapd_ioctl.h | 5 --- net/mac80211/ieee80211_i.h | 11 ------ net/mac80211/ieee80211_ioctl.c | 59 ------------------------------------- net/mac80211/rc80211_simple.c | 8 ----- net/mac80211/sta_info.h | 4 -- net/mac80211/tx.c | 3 - 9 files changed, 98 deletions(-)
net/mac80211/hostapd_ioctl.h +0 -5
@@ -37,13 +37,8 @@ enum {PRISM2_PARAM_NEXT_MODE =1008 ,PRISM2_PARAM_PRIVACY_INVOKED =1014 ,PRISM2_PARAM_BROADCAST_SSID =1015 , -PRISM2_PARAM_STA_ANTENNA_SEL =1017 , -PRISM2_PARAM_TX_POWER_REDUCTION =1022 ,PRISM2_PARAM_EAPOL =1023 ,PRISM2_PARAM_KEY_TX_RX_THRESHOLD =1024 , -PRISM2_PARAM_KEY_INDEX =1025 , -PRISM2_PARAM_DEFAULT_WEP_ONLY =1026 , -PRISM2_PARAM_ALLOW_BROADCAST_ALWAYS =1034 ,PRISM2_PARAM_HW_MODES =1036 ,PRISM2_PARAM_CREATE_IBSS =1037 , PRISM2_PARAM_WMM_ENABLED = 1038,
net/mac80211/ieee80211_i.h +0 -11
@@ -591,12 +591,6 @@ struct ieee80211_local {struct work_struct sta_debugfs_add;#endif -enum { -STA_ANTENNA_SEL_AUTO =0 , -STA_ANTENNA_SEL_SW_CTRL =1 , -STA_ANTENNA_SEL_SW_CTRL_DEBUG =2 - } sta_antenna_sel; -#ifdef CONFIG_MAC80211_DEBUG_COUNTERS /* TX/RX handler statistics */ unsigned int tx_handlers_drop;
@@ -632,10 +626,6 @@ struct ieee80211_local {int total_ps_buffered;/* total number of all buffered unicast and * multicast packets for power saving stations */ -int allow_broadcast_always;/* whether to allow TX of broadcast frames -* even when there are no associated STAs -*/ -unsigned int wmm_acm;/* bit field of ACM bits (BIT(802.1D tag)) */ unsigned int enabled_modes;/* bitfield of allowed modes;
@@ -662,7 +652,6 @@ struct ieee80211_local {struct dentry *mode;struct dentry *wep_iv;struct dentry *rate_ctrl_alg; -struct dentry *tx_power_reduction;struct dentry *modes;struct dentry *statistics;struct local_debugfsdentries_statsdentries {
net/mac80211/ieee80211_ioctl.c +0 -59
83 lines not on this page · raw message
net/mac80211/rc80211_simple.c +0 -8
@@ -147,14 +147,6 @@ static void rate_control_simple_tx_statu srctrl = sta->rate_ctrl_priv; srctrl->tx_num_xmit++;if (status->excessive_retries) { - sta->antenna_sel_tx = sta->antenna_sel_tx ==1 ?2 :1 ; - sta->antenna_sel_rx = sta->antenna_sel_rx ==1 ?2 :1 ; -if (local->sta_antenna_sel ==STA_ANTENNA_SEL_SW_CTRL_DEBUG ) { -printk (KERN_DEBUG "%s: " MAC_FMT " TX antenna --> %d " -"RX antenna --> %d (@%lu)\n" , - dev->name,MAC_ARG (hdr->addr1), - sta->antenna_sel_tx, sta->antenna_sel_rx, jiffies); - } srctrl->tx_num_failures++; sta->tx_retry_failed++; sta->tx_num_consecutive_failures++;
net/mac80211/tx.c +0 -3
@@ -243,7 +243,6 @@ ieee80211_tx_h_check_assoc(struct ieee80 }else {if (unlikely ((tx->fc &IEEE80211_FCTL_FTYPE ) ==IEEE80211_FTYPE_DATA && tx->local->num_sta ==0 && - !tx->local->allow_broadcast_always && tx->sdata->type !=IEEE80211_IF_TYPE_IBSS )) {/* * No associated STAs - no need to send multicast
@@ -959,8 +958,6 @@ __ieee80211_tx_prepare(struct ieee80211_*/ control->power_level = local->hw.conf.power_level; control->antenna_sel_tx = local->hw.conf.antenna_sel_tx; -if (local->sta_antenna_sel !=STA_ANTENNA_SEL_AUTO && tx->sta) - control->antenna_sel_tx = tx->sta->antenna_sel_tx;/* process and remove the injection radiotap header */ sdata =IEEE80211_DEV_TO_SUB_IF (dev);
net/mac80211/sta_info.h +0 -4
@@ -91,10 +91,6 @@ struct sta_info {int channel_use;int channel_use_raw; -u8 antenna_sel_tx; -u8 antenna_sel_rx; - -int key_idx_compression;/* key table index for compression and TX * filtering; used only if sta->key is not * set */
include/net/mac80211.h +0 -1
@@ -294,7 +294,6 @@ struct ieee80211_conf {u8 power_level;/* transmit power limit for current * regulatory domain; in dBm */ u8 antenna_max;/* maximum antenna gain */ -short tx_power_reduction;/* in 0.1 dBm */ /* 0 = default/diversity, 1 = Ant0, 2 = Ant1 */ u8 antenna_sel_tx;
net/mac80211/debugfs.c +0 -5
@@ -124,9 +124,6 @@ DEBUGFS_READONLY_FILE(mode, 20, "%s", ieee80211_mode_str(local->hw.conf.phymode));DEBUGFS_READONLY_FILE (wep_iv,20 ,"%#06x" , local->wep_iv &0xffffff ); -DEBUGFS_READONLY_FILE (tx_power_reduction,20 ,"%d.%d dBm" , - local->hw.conf.tx_power_reduction /10 , - local->hw.conf.tx_power_reduction %10 );DEBUGFS_READ (rate_ctrl_alg,100 ,"%s" , local->rate_ctrl ? local->rate_ctrl->ops->name :"<unset>" );
@@ -347,7 +344,6 @@ void debugfs_hw_add(struct ieee80211_locDEBUGFS_ADD (total_ps_buffered);DEBUGFS_ADD (mode);DEBUGFS_ADD (wep_iv); -DEBUGFS_ADD (tx_power_reduction);DEBUGFS_ADD_MODE (rate_ctrl_alg,0644 );DEBUGFS_ADD (modes);
@@ -413,7 +409,6 @@ void debugfs_hw_del(struct ieee80211_locDEBUGFS_DEL (total_ps_buffered);DEBUGFS_DEL (mode);DEBUGFS_DEL (wep_iv); -DEBUGFS_DEL (tx_power_reduction);DEBUGFS_DEL (rate_ctrl_alg);DEBUGFS_DEL (modes);
drivers/net/wireless/iwl-4965-rs.c +0 -2
@@ -1661,8 +1661,6 @@ out: (lq_data->phymode == (u8) MODE_ATHEROS_TURBO)) sta->txrate = i - IWL_FIRST_OFDM_RATE; - sta->antenna_sel_tx = tbl->lq_type; -return ; }
Re: [PATCH 07/20] mac80211: remove unused ioctls (2)
Quoted 9 lines · Johannes Berg
The ioctls
*
PRISM2_PARAM_STA_ANTENNA_SEL
*PRISM2_PARAM_TX_POWER_REDUCTION
*PRISM2_PARAM_KEY_INDEX
*PRISM2_PARAM_DEFAULT_WEP_ONLY
*PRISM2_PARAM_ALLOW_BROADCAST_ALWAYSare not used by hostapd or
wpa_supplicant.
Well, maybe so. But again, some are useful for testing (e.g., allow broadcast always for continuous TX tests). Default WEP only is useful for optimizing hwaccel in some multi-SSID cases, but it seemed to have already been broken before..
Signature · 1 line
Jouni Malinen PGP id EFC895FA
Johannes Berg
maintainerRe: [PATCH 07/20] mac80211: remove unused ioctls (2)
Quoted 2 lines · Jouni Malinen
Well, maybe so. But again, some are useful for testing (e.g., allow broadcast always for continuous TX tests).
Again, a case for debugfs. I've already moved the WPA testing hooks there previous to this patch series.
Quoted 3 lines
Default WEP only is useful
for optimizing hwaccel in some multi-SSID cases, but it seemed to have already been broken before..
Could have been me, could have been elsewhere, I don't know. However, it's also undocumented and there's no driver that actually cares. If we find hardware that requires it I'm all for optimising it, but until then I don't much see the point. Yes, it'll require some more effort for the author of that driver, but at least then we'll be sure that it works as advertised.
johannes
Re: [PATCH 07/20] mac80211: remove unused ioctls (2)
Quoted 7 lines · Johannes Berg
Quoted 2 lines · Jouni Malinen
Well, maybe so. But again, some are useful for testing (e.g., allow broadcast always for continuous TX tests).
Again, a case for debugfs. I've already moved the WPA testing hooks there previous to this patch series.
Agreed as far as debugfs is concerned. However, I thought a bit more about the test case where this used to be helpful and I think that the test can be implemented differently, so I'm fine with the send-group-when-no-associated-STAs option just go away.
Quoted 10 lines
Quoted 3 lines
Default WEP only is useful
for optimizing hwaccel in some multi-SSID cases, but it seemed to have already been broken before..Could have been me, could have been elsewhere, I don't know. However, it's also undocumented and there's no driver that actually cares. If we find hardware that requires it I'm all for optimising it, but until then I don't much see the point. Yes, it'll require some more effort for the author of that driver, but at least then we'll be sure that it works as advertised.
This is a very good example of something that should have been documented since it would take me some thinking to remember what exactly was the issue ;-). I just know that there was one with a common wlan hardware design and the optimization was quite useful for some of the configurations we were hitting. Without knowing how the WEP keys are used, some of the optimizations were impossible to do in hwaccel and we had to do most of decryption in software (not a very nice thing on an AP with just barely fast enough CPU to handle open network at full transmit rate)..
Then again, I think I'm actually fine with removing this now and see if anyone complains.. If nothing else, that saves me having to figure out now what the configuration was that forced me to add this extra information.
Signature · 1 line
Jouni Malinen PGP id EFC895FA
Johannes Berg
maintainerRe: [PATCH 07/20] mac80211: remove unused ioctls (2)
Quoted 4 lines · Jouni Malinen
Agreed as far as debugfs is concerned. However, I thought a bit more about the test case where this used to be helpful and I think that the test can be implemented differently, so I'm fine with the send-group-when-no-associated-STAs option just go away.
Mind explaining the test case? I'm just curious :)
Quoted 5 lines
Quoted 1 line
Quoted 1 line
Default WEP
This is a very good example of something that should have been documented since it would take me some thinking to remember what exactly was the issue ;-).
Heh.
Quoted 7 lines
I just know that there was one with a common wlan
hardware design and the optimization was quite useful for some of the configurations we were hitting. Without knowing how the WEP keys are used, some of the optimizations were impossible to do in hwaccel and we had to do most of decryption in software (not a very nice thing on an AP with just barely fast enough CPU to handle open network at full transmit rate)..
That all makes sense. I've been reworking the set_key() callback though so that the driver will be able to make most decisions without extra information, for example I've removed the TKIP+WME=broken flag in favour of telling the driver with each key whether it may be used with WME.
Quoted 4 lines
Then again, I think I'm actually fine with removing this now and see if anyone complains.. If nothing else, that saves me having to figure out now what the configuration was that forced me to add this extra information.
:)
Now I only need to go through this patch and see what we agreed on and what not. I'll do that later.
johannes
Johannes Berg
maintainerPATCH 8/20 mac80211: remove unused ioctls (3)
In reply to Johannes BergThe ioctls
* PRISM2_PARAM_HW_MODES
* PRISM2_PARAM_CREATE_IBSS
* PRISM2_PARAM_WMM_ENABLED
* PRISM2_PARAM_MIXED_CELL
* PRISM2_PARAM_KEY_MGMT
are not used by hostapd or wpa_supplicant.
--- net/mac80211/hostapd_ioctl.h | 5 -- net/mac80211/ieee80211.c | 2 - net/mac80211/ieee80211_i.h | 4 -- net/mac80211/ieee80211_iface.c | 2 - net/mac80211/ieee80211_ioctl.c | 71 +---------------------------------------- net/mac80211/ieee80211_sta.c | 37 +++++++++------------ 6 files changed, 19 insertions(+), 102 deletions(-)
net/mac80211/hostapd_ioctl.h +0 -5
@@ -39,11 +39,6 @@ enum {PRISM2_PARAM_BROADCAST_SSID =1015 ,PRISM2_PARAM_EAPOL =1023 ,PRISM2_PARAM_KEY_TX_RX_THRESHOLD =1024 , -PRISM2_PARAM_HW_MODES =1036 , -PRISM2_PARAM_CREATE_IBSS =1037 , -PRISM2_PARAM_WMM_ENABLED =1038 , -PRISM2_PARAM_MIXED_CELL =1039 , -PRISM2_PARAM_KEY_MGMT =1040 ,PRISM2_PARAM_RADAR_DETECT =1043 ,PRISM2_PARAM_SPECTRUM_MGMT =1044 , PRISM2_PARAM_USER_SPACE_MLME = 1045,
net/mac80211/ieee80211.c +0 -2
@@ -1209,8 +1209,6 @@ struct ieee80211_hw *ieee80211_alloc_hw( local->long_retry_limit =4 ; local->hw.conf.radio_enabled =1 ; - local->enabled_modes = (unsigned int )-1 ; -INIT_LIST_HEAD (&local->modes_list);rwlock_init (&local->sub_if_lock);
net/mac80211/ieee80211_i.h +0 -4
@@ -266,8 +266,6 @@ struct ieee80211_if_sta { unsigned int authenticated:1; unsigned int associated:1; unsigned int probereq_poll:1; - unsigned int create_ibss:1; - unsigned int mixed_cell:1; unsigned int wmm_enabled:1; unsigned int ht_enabled:1; unsigned int auto_ssid_sel:1;
@@ -628,8 +626,6 @@ struct ieee80211_local {*/ unsigned int wmm_acm;/* bit field of ACM bits (BIT(802.1D tag)) */ -unsigned int enabled_modes;/* bitfield of allowed modes; -* (1 << MODE_*) */ unsigned int hw_modes;/* bitfield of supported hardware modes; * (1 << MODE_*) */
net/mac80211/ieee80211_ioctl.c +2 -69
95 lines not on this page · raw message
net/mac80211/ieee80211_sta.c +17 -20
@@ -673,7 +673,7 @@ static void ieee80211_send_assoc(structmemcpy (pos, ifsta->extra_ie, ifsta->extra_ie_len); } -if (wmm && ifsta->wmm_enabled) { +if (wmm) { pos =skb_put (skb,9 ); *pos++ =WLAN_EID_VENDOR_SPECIFIC ; *pos++ =7 ;/* len */
@@ -1168,8 +1168,7 @@ static int ieee80211_privacy_mismatch(ststruct ieee80211_sta_bss *bss;int res =0 ; -if (!ifsta || ifsta->mixed_cell || - ifsta->key_mgmt !=IEEE80211_KEY_MGMT_NONE ) +if (!ifsta || ifsta->key_mgmt !=IEEE80211_KEY_MGMT_NONE )return 0 ; bss =ieee80211_rx_bss_get (dev, ifsta->bssid);
@@ -1762,7 +1761,7 @@ static void ieee80211_rx_mgmt_assoc_resprate_control_rate_init (sta, local); -if (elems.wmm_param && ifsta->wmm_enabled) { +if (elems.wmm_param) { sta->flags |=WLAN_STA_WME ;ieee80211_sta_wmm_params (dev, ifsta, elems.wmm_param, elems.wmm_param_len);
@@ -2445,7 +2444,7 @@ static void ieee80211_rx_mgmt_beacon(strif (elems.erp_info && elems.erp_info_len >=1 )ieee80211_handle_erp_ie (dev, elems.erp_info[0 ]); -if (elems.wmm_param && ifsta->wmm_enabled) { +if (elems.wmm_param) {ieee80211_sta_wmm_params (dev, ifsta, elems.wmm_param, elems.wmm_param_len); }
@@ -3422,15 +3421,16 @@ static int ieee80211_sta_find_ibss(strucif (time_after (jiffies, ifsta->ibss_join_req +IEEE80211_IBSS_JOIN_TIMEOUT )) { -if (ifsta->create_ibss && - local->oper_channel->flag &IEEE80211_CHAN_W_IBSS ) +if (local->oper_channel->flag &IEEE80211_CHAN_W_IBSS )return ieee80211_sta_create_ibss (dev, ifsta); -if (ifsta->create_ibss) { -printk (KERN_DEBUG "%s: IBSS not allowed on the" -" configured channel %d (%d MHz)\n" , - dev->name, local->hw.conf.channel, - local->hw.conf.freq); - } +/* +* I suspect the if (create_ibss) test here should have been +* inverted but this patch series is janitorial. +*/ +printk (KERN_DEBUG "%s: IBSS not allowed on the" +" configured channel %d (%d MHz)\n" , + dev->name, local->hw.conf.channel, + local->hw.conf.freq);/* No IBSS found - decrease scan interval and continue * scanning. */
@@ -3628,8 +3628,8 @@ void ieee80211_sta_scan_work(struct workstruct ieee80211_sub_if_data *sdata =IEEE80211_DEV_TO_SUB_IF (dev);struct ieee80211_hw_mode *mode;struct ieee80211_channel *chan; -int skip;unsigned long next_delay =0 ; +int skip;if (!local->sta_scanning)return ;
@@ -3642,13 +3642,13 @@ void ieee80211_sta_scan_work(struct workieee80211_scan_completed (local_to_hw (local));return ; } - skip = !(local->enabled_modes & (1 << mode->mode)); chan = &mode->channels[local->scan_channel_idx]; + skip =0 ;if (!(chan->flag &IEEE80211_CHAN_W_SCAN ) || (sdata->type ==IEEE80211_IF_TYPE_IBSS && !(chan->flag &IEEE80211_CHAN_W_IBSS )) || - (local->hw_modes & local->enabled_modes & - (1 <<MODE_IEEE80211G ) && mode->mode ==MODE_IEEE80211B )) + (local->hw_modes & (1 <<MODE_IEEE80211G ) && + mode->mode ==MODE_IEEE80211B )) skip =1 ;if (!skip) {
@@ -3816,9 +3816,6 @@ ieee80211_sta_scan_result(struct net_dev bss->last_update + IEEE80211_SCAN_RESULT_EXPIRE))return current_ev; -if (!(local->enabled_modes & (1 << bss->hw_mode))) -return current_ev; -memset (&iwe,0 ,sizeof (iwe)); iwe.cmd =SIOCGIWAP ; iwe.u.ap_addr.sa_family =ARPHRD_ETHER ;
net/mac80211/ieee80211_iface.c +0 -2
@@ -192,8 +192,6 @@ void ieee80211_if_set_type(struct net_de ifsta->capab =WLAN_CAPABILITY_ESS ; ifsta->auth_algs =IEEE80211_AUTH_ALG_OPEN |IEEE80211_AUTH_ALG_SHARED_KEY ; - ifsta->create_ibss =1 ; - ifsta->wmm_enabled =1 ; ifsta->ht_enabled =1 ; ifsta->auto_channel_sel =1 ; ifsta->auto_bssid_sel =1 ;
Re: [PATCH 08/20] mac80211: remove unused ioctls (3)
Quoted 9 lines · Johannes Berg
The ioctls
*
PRISM2_PARAM_HW_MODES
*PRISM2_PARAM_CREATE_IBSS
*PRISM2_PARAM_WMM_ENABLED
*PRISM2_PARAM_MIXED_CELL
*PRISM2_PARAM_KEY_MGMTare not used by hostapd or
wpa_supplicant.
No, but iwpriv.. See the pattern here.. ;-)
Create IBSS is a somewhat commonly used configuration and so is mixed cell configuration in Cisco-world (and the only point for the privacy_mismatch check that is left broken after this patch).
Signature · 1 line
Jouni Malinen PGP id EFC895FA
Johannes Berg
maintainerRe: [PATCH 08/20] mac80211: remove unused ioctls (3)
Quoted 3 lines · Jouni Malinen
Create IBSS is a somewhat commonly used configuration and so is mixed cell configuration in Cisco-world (and the only point for the
privacy_mismatchcheck that is left broken after this patch).
I was under the impression that the auth mechanism setting would still do that. What is "mixed cell configuration" anyway?
Quoted 1 line
No, but iwpriv.. See the pattern here.. ;-)
Oh, I can see that, but none of these things are documented nor do any existing tools use them. I don't contend the fact that these may indeed be useful, but I think none of them should be private ioctls. If you have a use case for all of these I'd be happy to see an explanation so we can add this with proper documentation elsewhere. Without documentation, they are a rather useless special configurations nobody will ever touch.
johannes
Re: [PATCH 08/20] mac80211: remove unused ioctls (3)
Quoted 8 lines · Johannes Berg
Quoted 3 lines · Jouni Malinen
Create IBSS is a somewhat commonly used configuration and so is mixed cell configuration in Cisco-world (and the only point for the
privacy_mismatchcheck that is left broken after this patch).I was under the impression that the auth mechanism setting would still do that. What is "mixed cell configuration" anyway?
As far as I know, it is an option that allows the client to associate with a network that has a mismatch in the privacy setting (with its own configuration). This would only happen in case the same SSID/beacon frame were to be used to advertise multiple networks with conflicting security policies (open and encryption), i.e., a "mixed cell".
Quoted 9 lines
Quoted 1 line
No, but iwpriv.. See the pattern here.. ;-)
Oh, I can see that, but none of these things are documented nor do any existing tools use them. I don't contend the fact that these may indeed be useful, but I think none of them should be private ioctls. If you have a use case for all of these I'd be happy to see an explanation so we can add this with proper documentation elsewhere. Without documentation, they are a rather useless special configurations nobody will ever touch.
iwpriv is an existing tool that uses these. I'm perfectly fine with doing this any other way, so no problems there, and I can also accept that there is unfortunate lack of documentation for many of the parameters.
Signature · 1 line
Jouni Malinen PGP id EFC895FA
Johannes Berg
maintainerPATCH 9/20 mac80211: remove unused ioctls (4)
In reply to Johannes BergThe ioctls
* PRISM2_PARAM_RADAR_DETECT
* PRISM2_PARAM_SPECTRUM_MGMT
* PRISM2_HOSTAPD_MLME
* PRISM2_HOSTAPD_SET_RADAR_PARAMS
* PRISM2_HOSTAPD_SET_QUIET_PARAMS
are not used by hostapd or wpa_supplicant,
* PRISM2_HOSTAPD_WPA_TRIGGER
was not in use any more since the wpa trigger moved into debugfs.
--- include/net/mac80211.h | 13 -------- net/mac80211/debugfs.c | 4 -- net/mac80211/hostapd_ioctl.h | 24 -------------- net/mac80211/ieee80211_i.h | 1 net/mac80211/ieee80211_ioctl.c | 66 ----------------------------------------- 5 files changed, 108 deletions(-)
net/mac80211/debugfs.c +0 -4
@@ -100,8 +100,6 @@ DEBUGFS_READONLY_FILE(channel, 20, "%d", local->hw.conf.channel);DEBUGFS_READONLY_FILE (frequency,20 ,"%d" , local->hw.conf.freq); -DEBUGFS_READONLY_FILE (radar_detect,20 ,"%d" , - local->hw.conf.radar_detect);DEBUGFS_READONLY_FILE (antenna_sel_tx,20 ,"%d" , local->hw.conf.antenna_sel_tx); DEBUGFS_READONLY_FILE(antenna_sel_rx, 20, "%d",
@@ -332,7 +330,6 @@ void debugfs_hw_add(struct ieee80211_locDEBUGFS_ADD (channel);DEBUGFS_ADD (frequency); -DEBUGFS_ADD (radar_detect);DEBUGFS_ADD (antenna_sel_tx);DEBUGFS_ADD (antenna_sel_rx);DEBUGFS_ADD (bridge_packets);
@@ -397,7 +394,6 @@ void debugfs_hw_del(struct ieee80211_loc {DEBUGFS_DEL (channel);DEBUGFS_DEL (frequency); -DEBUGFS_DEL (radar_detect);DEBUGFS_DEL (antenna_sel_tx);DEBUGFS_DEL (antenna_sel_rx);DEBUGFS_DEL (bridge_packets);
net/mac80211/hostapd_ioctl.h +0 -24
@@ -39,8 +39,6 @@ enum {PRISM2_PARAM_BROADCAST_SSID =1015 ,PRISM2_PARAM_EAPOL =1023 ,PRISM2_PARAM_KEY_TX_RX_THRESHOLD =1024 , -PRISM2_PARAM_RADAR_DETECT =1043 , -PRISM2_PARAM_SPECTRUM_MGMT =1044 ,PRISM2_PARAM_USER_SPACE_MLME =1045 , PRISM2_PARAM_MGMT_IF = 1046, };
@@ -56,12 +54,10 @@ enum {PRISM2_SET_ENCRYPTION =6 ,PRISM2_GET_ENCRYPTION =7 ,PRISM2_HOSTAPD_SET_FLAGS_STA =8 , -PRISM2_HOSTAPD_MLME =13 ,/* Instant802 additions */ PRISM2_HOSTAPD_SET_BEACON =1001 ,PRISM2_HOSTAPD_GET_HW_FEATURES =1002 , -PRISM2_HOSTAPD_WPA_TRIGGER =1004 ,PRISM2_HOSTAPD_SET_RATE_SETS =1005 ,PRISM2_HOSTAPD_ADD_IF =1006 , PRISM2_HOSTAPD_REMOVE_IF = 1007,
@@ -76,8 +72,6 @@ enum {PRISM2_HOSTAPD_SCAN_REQ =1019 ,PRISM2_STA_GET_STATE =1020 , PRISM2_HOSTAPD_FLUSH_IFS = 1021, -PRISM2_HOSTAPD_SET_RADAR_PARAMS =1023 , - PRISM2_HOSTAPD_SET_QUIET_PARAMS = 1024, };#define PRISM2_HOSTAPD_MAX_BUF_SIZE 2048
@@ -220,24 +214,6 @@ struct prism2_hostapd_param {u32 state; } sta_get_state;struct { -#define MLME_STA_DEAUTH 0 -#define MLME_STA_DISASSOC 1 -u16 cmd; -u16 reason_code; - } mlme; -struct { -u8 radar_firpwr_threshold; -u8 radar_rssi_threshold; -u8 pulse_height_threshold; -u8 pulse_rssi_threshold; -u8 pulse_inband_threshold; - } radar; -struct { -unsigned int period; -unsigned int offset; -unsigned int duration; - } quiet; -struct {u8 dummy[80 ];/* Make sizeof() this struct large enough * with some compiler versions. */ } dummy;
net/mac80211/ieee80211_i.h +0 -1
@@ -635,7 +635,6 @@ struct ieee80211_local {struct local_debugfsdentries {struct dentry *channel;struct dentry *frequency; -struct dentry *radar_detect;struct dentry *antenna_sel_tx;struct dentry *antenna_sel_rx;struct dentry *bridge_packets;
net/mac80211/ieee80211_ioctl.c +0 -66
90 lines not on this page · raw message
include/net/mac80211.h +0 -13
@@ -298,19 +298,6 @@ struct ieee80211_conf {/* 0 = default/diversity, 1 = Ant0, 2 = Ant1 */ u8 antenna_sel_tx;u8 antenna_sel_rx; - -/* Following five fields are used for IEEE 802.11H */ -unsigned int radar_detect; -unsigned int spect_mgmt; -unsigned int quiet_duration;/* duration of quiet period */ -unsigned int quiet_offset;/* how far into the beacon is the quiet -* period */ -unsigned int quiet_period; -u8 radar_firpwr_threshold; -u8 radar_rssi_threshold; -u8 pulse_height_threshold; -u8 pulse_rssi_threshold; -u8 pulse_inband_threshold; };/**
Johannes Berg
maintainerPATCH 10/20 mac80211: remove unused ioctls (5)
In reply to Johannes BergThe ioctls
* PRISM2_HOSTAPD_GET_DOT11COUNTERSTABLE
* PRISM2_HOSTAPD_GET_LOAD_STATS
* PRISM2_HOSTAPD_GET_TX_STATS
* PRISM2_HOSTAPD_SCAN_REQ
* PRISM2_STA_GET_STATE
* PRISM2_HOSTAPD_FLUSH_IFS
are not used by hostapd or wpa_supplicant.
--- net/mac80211/hostapd_ioctl.h | 39 ------------- net/mac80211/ieee80211_ioctl.c | 120 ----------------------------------------- 2 files changed, 159 deletions(-)
net/mac80211/hostapd_ioctl.h +0 -39
@@ -61,17 +61,11 @@ enum {PRISM2_HOSTAPD_SET_RATE_SETS =1005 ,PRISM2_HOSTAPD_ADD_IF =1006 ,PRISM2_HOSTAPD_REMOVE_IF =1007 , -PRISM2_HOSTAPD_GET_DOT11COUNTERSTABLE =1008 , -PRISM2_HOSTAPD_GET_LOAD_STATS =1009 ,PRISM2_HOSTAPD_SET_STA_VLAN =1010 ,PRISM2_HOSTAPD_SET_GENERIC_INFO_ELEM =1011 ,PRISM2_HOSTAPD_SET_CHANNEL_FLAG =1012 ,PRISM2_HOSTAPD_SET_REGULATORY_DOMAIN =1013 , PRISM2_HOSTAPD_SET_TX_QUEUE_PARAMS = 1014, -PRISM2_HOSTAPD_GET_TX_STATS =1016 , -PRISM2_HOSTAPD_SCAN_REQ =1019 , -PRISM2_STA_GET_STATE =1020 , - PRISM2_HOSTAPD_FLUSH_IFS = 1021, };#define PRISM2_HOSTAPD_MAX_BUF_SIZE 2048
@@ -154,24 +148,6 @@ struct prism2_hostapd_param {u8 name[IFNAMSIZ ]; u8 data[0] ALIGNED; } if_info; -struct dot11_counters { -u32 dot11TransmittedFragmentCount; -u32 dot11MulticastTransmittedFrameCount; -u32 dot11FailedCount; -u32 dot11ReceivedFragmentCount; -u32 dot11MulticastReceivedFrameCount; -u32 dot11FCSErrorCount; -u32 dot11TransmittedFrameCount; -u32 dot11WEPUndecryptableCount; -u32 dot11ACKFailureCount; -u32 dot11RTSFailureCount; -u32 dot11RTSSuccessCount; - } dot11CountersTable; -struct { -#define LOAD_STATS_CLEAR BIT(1) -u32 flags; -u32 channel_use; - } get_load_stats;struct {char vlan_name[IFNAMSIZ ];int vlan_id;
@@ -198,21 +174,6 @@ struct prism2_hostapd_param {u32 burst_time;/* maximum burst time in 0.1 ms, i.e., * 10 = 1 ms */ } tx_queue_params; -struct ieee80211_tx_stats { -struct { -unsigned int len;/* num packets in queue */ -unsigned int limit;/* queue len (soft) limit -*/ -unsigned int count;/* total num frames sent */ - } data[4 ]; - } get_tx_stats; -struct { -u8 ssid_len; - u8 ssid[0] ALIGNED; - } scan_req; -struct { -u32 state; - } sta_get_state;struct {u8 dummy[80 ];/* Make sizeof() this struct large enough * with some compiler versions. */
net/mac80211/ieee80211_ioctl.c +0 -120
150 lines not on this page · raw message
Johannes Berg
maintainerPATCH 11/20 mac80211: remove PRISM2_HOSTAPD_SET_GENERIC_INFO_ELEM
In reply to Johannes BergThis is now unused in hostapd/wpa_supplicant, it uses SIOCSIWGENIE.
--- net/mac80211/hostapd_ioctl.h | 5 ----- net/mac80211/ieee80211_ioctl.c | 20 -------------------- 2 files changed, 25 deletions(-)
net/mac80211/hostapd_ioctl.h +0 -5
@@ -62,7 +62,6 @@ enum {PRISM2_HOSTAPD_ADD_IF =1006 ,PRISM2_HOSTAPD_REMOVE_IF =1007 ,PRISM2_HOSTAPD_SET_STA_VLAN =1010 , -PRISM2_HOSTAPD_SET_GENERIC_INFO_ELEM =1011 ,PRISM2_HOSTAPD_SET_CHANNEL_FLAG =1012 ,PRISM2_HOSTAPD_SET_REGULATORY_DOMAIN =1013 , PRISM2_HOSTAPD_SET_TX_QUEUE_PARAMS = 1014,
@@ -153,10 +152,6 @@ struct prism2_hostapd_param {int vlan_id; } set_sta_vlan;struct { -u8 len; - u8 data[0] ALIGNED; - } set_generic_info_elem; -struct {u16 mode;/* MODE_* */ u16 chan;u32 flag;
net/mac80211/ieee80211_ioctl.c +0 -20
@@ -1028,22 +1028,6 @@ static int ieee80211_set_gen_ie(struct n } -static int -ieee80211_ioctl_set_generic_info_elem (struct net_device *dev, -struct prism2_hostapd_param *param, -int param_len) -{ -u8 *pos = param->u.set_generic_info_elem.data; -int left = param_len - ((u8 *) pos - (u8 *) param); -int len = param->u.set_generic_info_elem.len; - -if (left < len) -return -EINVAL ; - -return ieee80211_set_gen_ie (dev, pos, len); -} - -static int ieee80211_ioctl_set_regulatory_domain (struct net_device *dev,struct prism2_hostapd_param *param) {
@@ -1176,10 +1160,6 @@ static int ieee80211_ioctl_priv_hostapd(case PRISM2_HOSTAPD_SET_STA_VLAN : ret =ieee80211_ioctl_set_sta_vlan (dev, param);break ; -case PRISM2_HOSTAPD_SET_GENERIC_INFO_ELEM : - ret =ieee80211_ioctl_set_generic_info_elem (dev, param, - p->length); -break ;case PRISM2_HOSTAPD_SET_CHANNEL_FLAG : ret =ieee80211_ioctl_set_channel_flag (dev, param);break ;
Johannes Berg
maintainerPATCH 12/20 mac80211: fix preamble setting
In reply to Johannes BergIt looks like in commit 28487a90 the condition was unintentionally negated by moving some code, fix it.
--- net/mac80211/ieee80211_ioctl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/mac80211/ieee80211_ioctl.c +1 -1
@@ -1962,7 +1962,7 @@ static int ieee80211_ioctl_prism2_param(break ;case PRISM2_PARAM_PREAMBLE : -if (sdata->type !=IEEE80211_IF_TYPE_AP ) { +if (sdata->type ==IEEE80211_IF_TYPE_AP ) { sdata->short_preamble = !!value;ieee80211_erp_info_change_notify (dev,IEEE80211_ERP_CHANGE_PREAMBLE ); }else {
Johannes Berg
maintainerPATCH 13/20 mac80211: remove scan struct from hostapd_param
In reply to Johannes BergThis hasn't been used for quite a while.
--- net/mac80211/hostapd_ioctl.h | 8 -------- 1 file changed, 8 deletions(-)
net/mac80211/hostapd_ioctl.h +0 -8
@@ -128,14 +128,6 @@ struct prism2_hostapd_param { u8 data[0] ALIGNED; /* num_modes * feature data */ } hw_features;struct { -u8 now; -s8 our_mode_only; -s16 last_rx; -u16 channel; -s16 interval;/* seconds */ -s32 listen;/* microseconds */ - } scan; -struct {u16 mode;/* MODE_* */ u16 num_supported_rates;u16 num_basic_rates;
Johannes Berg
maintainerPATCH 14/20 mac80211: kill key_mgmt variable, use privacy_enabled
In reply to Johannes BergThe key_mgmt variable for STA interfaces doesn't seem well-defined nor do we actually use the values other than "NONE", so change it to be named better.
--- net/mac80211/hostapd_ioctl.h | 8 -------- net/mac80211/ieee80211_i.h | 2 +- net/mac80211/ieee80211_ioctl.c | 24 +++++++++--------------- net/mac80211/ieee80211_sta.c | 2 +- 4 files changed, 11 insertions(+), 25 deletions(-)
net/mac80211/ieee80211_i.h +1 -1
@@ -277,7 +277,7 @@ struct ieee80211_if_sta {unsigned long request;struct sk_buff_head skb_queue; -int key_mgmt; +int privacy_enabled;unsigned long last_probe;#define IEEE80211_AUTH_ALG_OPEN BIT(0)
net/mac80211/ieee80211_ioctl.c +9 -15
@@ -2245,22 +2245,16 @@ static int ieee80211_ioctl_siwauth(struc ret = -EINVAL ; else {/* -* TODO: sdata->u.sta.key_mgmt does not match with WE18 -* value completely; could consider modifying this to -* be closer to WE18. For now, this value is not really -* used for anything else than Privacy matching, so the -* current code here should be more or less OK. +* What are the semantics in wext supposed to be? +* +* Don't bother figuring that out... It's wext after +* all so figuring it out will most likely require a +* moderate amount of clairvoyance. +* +* TODO: remove in favour of something well-defined +* in cfg80211/nl80211. */ -if (data->value &IW_AUTH_KEY_MGMT_802_1X ) { - sdata->u.sta.key_mgmt = -IEEE80211_KEY_MGMT_WPA_EAP ; - }else if (data->value &IW_AUTH_KEY_MGMT_PSK ) { - sdata->u.sta.key_mgmt = -IEEE80211_KEY_MGMT_WPA_PSK ; - }else { - sdata->u.sta.key_mgmt = -IEEE80211_KEY_MGMT_NONE ; - } + sdata->u.sta.privacy_enabled = !!data->value; }break ;case IW_AUTH_80211_AUTH_ALG :
net/mac80211/ieee80211_sta.c +1 -1
@@ -1168,7 +1168,7 @@ static int ieee80211_privacy_mismatch(ststruct ieee80211_sta_bss *bss;int res =0 ; -if (!ifsta || ifsta->key_mgmt !=IEEE80211_KEY_MGMT_NONE ) +if (!ifsta || !ifsta->privacy_enabled)return 0 ; bss =ieee80211_rx_bss_get (dev, ifsta->bssid);
net/mac80211/hostapd_ioctl.h +0 -8
@@ -180,14 +180,6 @@ struct prism2_hostapd_param {#define HOSTAP_HW_FLAG_NULLFUNC_OK BIT(0) -enum { -IEEE80211_KEY_MGMT_NONE =0 , -IEEE80211_KEY_MGMT_IEEE8021X =1 , -IEEE80211_KEY_MGMT_WPA_PSK =2 , -IEEE80211_KEY_MGMT_WPA_EAP =3 , -}; - -/* Data structures used for get_hw_features ioctl */ struct hostapd_ioctl_hw_modes_hdr {int mode;
Johannes Berg
maintainerRe: [PATCH 14/20] mac80211: kill key_mgmt variable, use privacy_enabled
net/mac80211/ieee80211_sta.c static int ieee80211_privacy_mismatch(st · line 1171
Quoted 2 lines · Johannes Berg
net/mac80211/ieee80211_sta.c +1
-1-if (!ifsta || ifsta->key_mgmt !=IEEE80211_KEY_MGMT_NONE ) +if (!ifsta || !ifsta->privacy_enabled)
^ be gone!
That privacy_enabled test is inverted.
johannes
Johannes Berg
maintainerPATCH v2 14/20 mac80211: kill key_mgmt variable, use privacy_enabled
The key_mgmt variable for STA interfaces doesn't seem well-defined nor do we actually use the values other than "NONE", so change it to be named better.
--- net/mac80211/hostapd_ioctl.h | 8 -------- net/mac80211/ieee80211_i.h | 2 +- net/mac80211/ieee80211_ioctl.c | 24 +++++++++--------------- net/mac80211/ieee80211_sta.c | 2 +- 4 files changed, 11 insertions(+), 25 deletions(-)
net/mac80211/ieee80211_i.h +1 -1
@@ -277,7 +277,7 @@ struct ieee80211_if_sta {unsigned long request;struct sk_buff_head skb_queue; -int key_mgmt; +int privacy_enabled;unsigned long last_probe;#define IEEE80211_AUTH_ALG_OPEN BIT(0)
net/mac80211/ieee80211_ioctl.c +9 -15
@@ -2245,22 +2245,16 @@ static int ieee80211_ioctl_siwauth(struc ret = -EINVAL ; else {/* -* TODO: sdata->u.sta.key_mgmt does not match with WE18 -* value completely; could consider modifying this to -* be closer to WE18. For now, this value is not really -* used for anything else than Privacy matching, so the -* current code here should be more or less OK. +* What are the semantics in wext supposed to be? +* +* Don't bother figuring that out... It's wext after +* all so figuring it out will most likely require a +* moderate amount of clairvoyance. +* +* TODO: remove in favour of something well-defined +* in cfg80211/nl80211. */ -if (data->value &IW_AUTH_KEY_MGMT_802_1X ) { - sdata->u.sta.key_mgmt = -IEEE80211_KEY_MGMT_WPA_EAP ; - }else if (data->value &IW_AUTH_KEY_MGMT_PSK ) { - sdata->u.sta.key_mgmt = -IEEE80211_KEY_MGMT_WPA_PSK ; - }else { - sdata->u.sta.key_mgmt = -IEEE80211_KEY_MGMT_NONE ; - } + sdata->u.sta.privacy_enabled = !!data->value; }break ;case IW_AUTH_80211_AUTH_ALG :
net/mac80211/ieee80211_sta.c +1 -1
@@ -1168,7 +1168,7 @@ static int ieee80211_privacy_mismatch(ststruct ieee80211_sta_bss *bss;int res =0 ; -if (!ifsta || ifsta->key_mgmt !=IEEE80211_KEY_MGMT_NONE ) +if (!ifsta || ifsta->privacy_enabled)return 0 ; bss =ieee80211_rx_bss_get (dev, ifsta->bssid);
net/mac80211/hostapd_ioctl.h +0 -8
@@ -180,14 +180,6 @@ struct prism2_hostapd_param {#define HOSTAP_HW_FLAG_NULLFUNC_OK BIT(0) -enum { -IEEE80211_KEY_MGMT_NONE =0 , -IEEE80211_KEY_MGMT_IEEE8021X =1 , -IEEE80211_KEY_MGMT_WPA_PSK =2 , -IEEE80211_KEY_MGMT_WPA_EAP =3 , -}; - -/* Data structures used for get_hw_features ioctl */ struct hostapd_ioctl_hw_modes_hdr {int mode;
Re: [PATCH 14/20] mac80211: kill key_mgmt variable, use privacy_enabled
In reply to Johannes BergQuoted 3 lines · Johannes Berg
The
key_mgmtvariable for STA interfaces doesn't seem well-defined nor do we actually use the values other than "NONE", so change it to be named better.
Most drivers should not need key_mgmt configuration. The only exception that I'm aware of is firmware designs that insist on generating WPA/RSN IE internally. None of them are likely to be using mac80211, though.
net/mac80211/ieee80211_ioctl.c static int ieee80211_ioctl_siwauth(struc · line 2252
Quoted 5 lines
net/mac80211/ieee80211_ioctl.c +5
-0+* What are the semantics in wext supposed to be? +* +* Don't bother figuring that out... It's wext after +* all so figuring it out will most likely require a +* moderate amount of clairvoyance.
Isn't this a bit unnecessary?
net/mac80211/ieee80211_ioctl.c static int ieee80211_ioctl_siwauth(struc · line 2257
Quoted 1 line
net/mac80211/ieee80211_ioctl.c +1
-0+ sdata->u.sta.privacy_enabled = !!data->value;
This looks a bit odd, though, taken into account that this is coming from IW_AUTH_KEY_MGMT and not IW_AUTH_PRIVACY_INVOKED.. It would probably be better to just remove all the crab from here can ignore the IW_AUTH_KEY_MGMT value in mac80211. The only place that actually used it in the client code (mixed cell configuration) had already been broken, so this could all be just removed completely unless someone has plans on fixing privacy mismatch detection.
Signature · 1 line
Jouni Malinen PGP id EFC895FA
Johannes Berg
maintainerRe: [PATCH 14/20] mac80211: kill key_mgmt variable, use privacy_enabled
Quoted 7 lines · Jouni Malinen
This looks a bit odd, though, taken into account that this is coming from
IW_AUTH_KEY_MGMTand notIW_AUTH_PRIVACY_INVOKED.. It would probably be better to just remove all the crab from here can ignore theIW_AUTH_KEY_MGMTvalue in mac80211. The only place that actually used it in the client code (mixed cell configuration) had already been broken, so this could all be just removed completely unless someone has plans on fixing privacy mismatch detection.
Yeah, it should probably be called "key_management_enabled". However, privacy mismatch detection does work for WPA, just not for Volker with dynamic WEP for some reason.
johannes
Johannes Berg
maintainerPATCH 15/20 mac80211: refactor event sending
In reply to Johannes BergCreate a new file event.c that will contain code to send mac/mlme events to userspace. For now put the Michael MIC failure condition into it and remove sending of that condition via the management interface, hostapd interestingly doesn't do anything when it gets such a packet besides printing a message, it reacts only on the private iwevent.
--- net/mac80211/Makefile | 1 + net/mac80211/event.c | 36 ++++++++++++++++++++++++++++++++++++ net/mac80211/ieee80211_i.h | 2 ++ net/mac80211/rx.c | 37 ++++++------------------------------- net/mac80211/wpa.c | 34 ++++------------------------------ 5 files changed, 49 insertions(+), 61 deletions(-)
net/mac80211/ieee80211_i.h +2 -0
@@ -929,5 +929,7 @@ u8 *ieee80211_get_bssid(struct ieee80211int ieee80211_is_eapol (const struct sk_buff *skb);int ieee80211_frame_duration (struct ieee80211_local *local,size_t len,int rate,int erp,int short_preamble); +void mac80211_ev_michael_mic_failure (struct net_device *dev,int keyidx, +struct ieee80211_hdr *hdr);#endif /* IEEE80211_I_H */
net/mac80211/wpa.c +4 -30
@@ -11,10 +11,8 @@#include <linux/slab.h> #include <linux/skbuff.h> #include <linux/compiler.h> -#include <net/iw_handler.h> -#include <net/mac80211.h> -#include "ieee80211_common.h" +#include "ieee80211_i.h" #include "michael.h" #include "tkip.h"
@@ -245,33 +243,9 @@ ieee80211_rx_h_michael_mic_verify(structprintk (" (%d)\n" , authenticator);#endif /* CONFIG_HOSTAPD_WPA_TESTING */ -do { -struct ieee80211_hdr *hdr; -union iwreq_data wrqu; -char *buf =kmalloc (128 ,GFP_ATOMIC ); -if (!buf) -break ; - -/* TODO: needed parameters: count, key type, TSC */ - hdr = (struct ieee80211_hdr *) skb->data; -sprintf (buf,"MLME-MICHAELMICFAILURE.indication(" -"keyid=%d %scast addr=" MAC_FMT ")" , - rx->key->keyidx, - hdr->addr1[0 ] &0x01 ?"broad" :"uni" , -MAC_ARG (hdr->addr2)); -memset (&wrqu,0 ,sizeof (wrqu)); - wrqu.data.length =strlen (buf); -wireless_send_event (rx->dev,IWEVCUSTOM , &wrqu, buf); -kfree (buf); - }while (0 ); - -if (!rx->local->apdev) -return TXRX_DROP ; - -ieee80211_rx_mgmt (rx->local, rx->skb, rx->u.rx.status, - ieee80211_msg_michael_mic_failure); - -return TXRX_QUEUED ; +mac80211_ev_michael_mic_failure (rx->dev, rx->key->keyidx, + (void *) skb->data); +return TXRX_DROP ; } remove_mic:
net/mac80211/rx.c +6 -31
@@ -13,7 +13,6 @@#include <linux/skbuff.h> #include <linux/netdevice.h> #include <linux/etherdevice.h> -#include <net/iw_handler.h> #include <net/mac80211.h> #include <net/ieee80211_radiotap.h>
@@ -1295,18 +1294,15 @@ static void ieee80211_rx_michael_mic_rep }if ((rx->local->hw.flags &IEEE80211_HW_WEP_INCLUDE_IV ) && - rx->sdata->type ==IEEE80211_IF_TYPE_AP ) { - keyidx =ieee80211_wep_get_keyidx (rx->skb); + rx->sdata->type ==IEEE80211_IF_TYPE_AP && keyidx) {/* AP with Pairwise keys support should never receive Michael * MIC errors for non-zero keyidx because these are reserved * for group keys and only the AP is sending real multicast * frames in BSS. */ -if (keyidx) { -printk (KERN_DEBUG "%s: ignored Michael MIC error for " -"a frame with non-zero keyidx (%d) (src " MAC_FMT -")\n" , dev->name, keyidx,MAC_ARG (hdr->addr2)); - goto ignore; - } +printk (KERN_DEBUG "%s: ignored Michael MIC error for " +"a frame with non-zero keyidx (%d) (src " MAC_FMT +")\n" , dev->name, keyidx,MAC_ARG (hdr->addr2)); + goto ignore; } if ((rx->fc & IEEE80211_FCTL_FTYPE) != IEEE80211_FTYPE_DATA &&
@@ -1319,32 +1315,11 @@ static void ieee80211_rx_michael_mic_rep goto ignore; } -do { -union iwreq_data wrqu; -char *buf =kmalloc (128 ,GFP_ATOMIC ); -if (!buf) -break ; - -/* TODO: needed parameters: count, key type, TSC */ -sprintf (buf,"MLME-MICHAELMICFAILURE.indication(" -"keyid=%d %scast addr=" MAC_FMT ")" , - keyidx, hdr->addr1[0 ] &0x01 ?"broad" :"uni" , -MAC_ARG (hdr->addr2)); -memset (&wrqu,0 ,sizeof (wrqu)); - wrqu.data.length =strlen (buf); -wireless_send_event (rx->dev,IWEVCUSTOM , &wrqu, buf); -kfree (buf); - }while (0 ); -/* TODO: consider verifying the MIC error report with software * implementation if we get too many spurious reports from the * hardware. */ -if (!rx->local->apdev) - goto ignore; -ieee80211_rx_mgmt (rx->local, rx->skb, rx->u.rx.status, - ieee80211_msg_michael_mic_failure); -return ; +mac80211_ev_michael_mic_failure (rx->dev, keyidx, hdr); ignore:dev_kfree_skb (rx->skb); rx->skb =NULL ;
net/mac80211/Makefile +1 -0
@@ -22,4 +22,5 @@ mac80211-objs := \ tx.o \ key.o \ util.o \ + event.o \ $(mac80211-objs-y)
net/mac80211/event.c new file +36 -0
@@ -0,0 +1,36 @@ +/* +* mac80211 - events +*/ + +#include <linux/netdevice.h> +#include <net/iw_handler.h> +#include "ieee80211_i.h" + +/* +* indicate a failed Michael MIC to userspace; the passed packet +* (in the variable hdr) must be long enough to extract the TKIP +* fields like TSC +*/ +void mac80211_ev_michael_mic_failure (struct net_device *dev,int keyidx, +struct ieee80211_hdr *hdr) +{ +union iwreq_data wrqu; +char *buf =kmalloc (128 ,GFP_ATOMIC ); + +if (buf) { +/* TODO: needed parameters: count, key type, TSC */ +sprintf (buf,"MLME-MICHAELMICFAILURE.indication(" +"keyid=%d %scast addr=" MAC_FMT ")" , + keyidx, hdr->addr1[0 ] &0x01 ?"broad" :"uni" , +MAC_ARG (hdr->addr2)); +memset (&wrqu,0 ,sizeof (wrqu)); + wrqu.data.length =strlen (buf); +wireless_send_event (dev,IWEVCUSTOM , &wrqu, buf); +kfree (buf); + } + +/* +* TODO: re-add support for sending MIC failure indication +* with all info via nl80211 +*/ +}
Johannes Berg
maintainerPATCH 16/20 mac80211: ratelimit some RX messages
In reply to Johannes BergMany if not all of these messages can be triggered by sending a few rogue frames which is trivially done and then we overflow our logs.
--- net/mac80211/rx.c | 134 ++++++++++++++++++++++++++++++++---------------------- 1 file changed, 81 insertions(+), 53 deletions(-)
net/mac80211/rx.c +81 -53
@@ -342,13 +342,16 @@ ieee80211_rx_h_load_key(struct ieee80211if (!rx->key) {if (!rx->u.rx.ra_match)return TXRX_DROP ; -printk (KERN_DEBUG "%s: RX WEP frame with " -"unknown keyidx %d (A1=" MAC_FMT " A2=" -MAC_FMT " A3=" MAC_FMT ")\n" , - rx->dev->name, keyidx, -MAC_ARG (hdr->addr1), -MAC_ARG (hdr->addr2), -MAC_ARG (hdr->addr3)); +if (net_ratelimit ()) +printk (KERN_DEBUG "%s: RX WEP frame " +"with unknown keyidx %d " +"(A1=" MAC_FMT +" A2=" MAC_FMT +" A3=" MAC_FMT ")\n" , + rx->dev->name, keyidx, +MAC_ARG (hdr->addr1), +MAC_ARG (hdr->addr2), +MAC_ARG (hdr->addr3));/* * TODO: notify userspace about this * via cfg/nl80211
@@ -528,16 +531,18 @@ ieee80211_rx_h_wep_decrypt(struct ieee80return TXRX_CONTINUE ;if (!rx->key) { -printk (KERN_DEBUG "%s: RX WEP frame, but no key set\n" , - rx->dev->name); +if (net_ratelimit ()) +printk (KERN_DEBUG "%s: RX WEP frame, but no key set\n" , + rx->dev->name);return TXRX_DROP ; }if (!(rx->u.rx.status->flag &RX_FLAG_DECRYPTED ) || rx->key->force_sw_encrypt) {if (ieee80211_wep_decrypt (rx->local, rx->skb, rx->key)) { -printk (KERN_DEBUG "%s: RX WEP frame, decrypt " -"failed\n" , rx->dev->name); +if (net_ratelimit ()) +printk (KERN_DEBUG "%s: RX WEP frame, decrypt " +"failed\n" , rx->dev->name);return TXRX_DROP ; } }else if (rx->local->hw.flags &IEEE80211_HW_WEP_INCLUDE_IV ) {
@@ -694,12 +699,15 @@ ieee80211_rx_h_defragment(struct ieee802 } rpn = rx->key->u.ccmp.rx_pn[rx->u.rx.queue];if (memcmp (pn, rpn,CCMP_PN_LEN ) !=0 ) { -printk (KERN_DEBUG "%s: defrag: CCMP PN not sequential" -" A2=" MAC_FMT " PN=%02x%02x%02x%02x%02x%02x " -"(expected %02x%02x%02x%02x%02x%02x)\n" , - rx->dev->name,MAC_ARG (hdr->addr2), - rpn[0 ], rpn[1 ], rpn[2 ], rpn[3 ], rpn[4 ], rpn[5 ], - pn[0 ], pn[1 ], pn[2 ], pn[3 ], pn[4 ], pn[5 ]); +if (net_ratelimit ()) +printk (KERN_DEBUG "%s: defrag: CCMP PN not " +"sequential A2=" MAC_FMT +" PN=%02x%02x%02x%02x%02x%02x " +"(expected %02x%02x%02x%02x%02x%02x)\n" , + rx->dev->name,MAC_ARG (hdr->addr2), + rpn[0 ], rpn[1 ], rpn[2 ], rpn[3 ], rpn[4 ], + rpn[5 ], pn[0 ], pn[1 ], pn[2 ], pn[3 ], + pn[4 ], pn[5 ]);return TXRX_DROP ; }memcpy (entry->last_pn, pn,CCMP_PN_LEN );
@@ -877,8 +885,9 @@ ieee80211_rx_h_drop_unencrypted(struct i (rx->key || rx->sdata->drop_unencrypted) && (rx->sdata->eapol == 0 || !ieee80211_is_eapol(rx->skb)))) { -printk (KERN_DEBUG "%s: RX non-WEP frame, but expected " -"encryption\n" , rx->dev->name); +if (net_ratelimit ()) +printk (KERN_DEBUG "%s: RX non-WEP frame, but expected " +"encryption\n" , rx->dev->name);return TXRX_DROP ; }return TXRX_CONTINUE ;
@@ -969,17 +978,19 @@ ieee80211_rx_h_data_agg(struct ieee80211* in local net stack and back to the wireless * media */ skb2 =skb_copy (frame,GFP_ATOMIC ); -if (!skb2) +if (!skb2 &&net_ratelimit ())printk (KERN_DEBUG "%s: failed to clone" " multicast frame\n" , dev->name); }else {struct sta_info *dsta; dsta =sta_info_get (local, frame->data); -if (dsta && !dsta->dev) -printk (KERN_DEBUG "Station with null " -"dev structure!\n" ); -else if (dsta && dsta->dev == dev) { +if (dsta && !dsta->dev) { +if (net_ratelimit ()) +printk (KERN_DEBUG "Station " +"with null dev " +"structure!\n" ); + }else if (dsta && dsta->dev == dev) {/* Destination station is associated * to this AP, so send the frame * directly to it and do not pass
@@ -1059,10 +1070,15 @@ ieee80211_rx_h_data(struct ieee80211_txrif (unlikely (sdata->type !=IEEE80211_IF_TYPE_AP && sdata->type !=IEEE80211_IF_TYPE_VLAN )) { -printk (KERN_DEBUG "%s: dropped ToDS frame (BSSID=" -MAC_FMT " SA=" MAC_FMT " DA=" MAC_FMT ")\n" , - dev->name,MAC_ARG (hdr->addr1), -MAC_ARG (hdr->addr2),MAC_ARG (hdr->addr3)); +if (net_ratelimit ()) +printk (KERN_DEBUG "%s: dropped ToDS frame " +"(BSSID=" MAC_FMT +" SA=" MAC_FMT +" DA=" MAC_FMT ")\n" , + dev->name, +MAC_ARG (hdr->addr1), +MAC_ARG (hdr->addr2), +MAC_ARG (hdr->addr3));return TXRX_DROP ; }break ;
@@ -1072,12 +1088,16 @@ ieee80211_rx_h_data(struct ieee80211_txrmemcpy (src, hdr->addr4,ETH_ALEN );if (unlikely (sdata->type !=IEEE80211_IF_TYPE_WDS )) { -printk (KERN_DEBUG "%s: dropped FromDS&ToDS frame (RA=" -MAC_FMT " TA=" MAC_FMT " DA=" MAC_FMT " SA=" -MAC_FMT ")\n" , - rx->dev->name,MAC_ARG (hdr->addr1), -MAC_ARG (hdr->addr2),MAC_ARG (hdr->addr3), -MAC_ARG (hdr->addr4)); +if (net_ratelimit ()) +printk (KERN_DEBUG "%s: dropped FromDS&ToDS " +"frame (RA=" MAC_FMT +" TA=" MAC_FMT " DA=" MAC_FMT +" SA=" MAC_FMT ")\n" , + rx->dev->name, +MAC_ARG (hdr->addr1), +MAC_ARG (hdr->addr2), +MAC_ARG (hdr->addr3), +MAC_ARG (hdr->addr4));return TXRX_DROP ; }break ;
@@ -1152,15 +1172,16 @@ ieee80211_rx_h_data(struct ieee80211_txr/* send multicast frames both to higher layers in * local net stack and back to the wireless media */ skb2 =skb_copy (skb,GFP_ATOMIC ); -if (!skb2) +if (!skb2 &&net_ratelimit ())printk (KERN_DEBUG "%s: failed to clone " "multicast frame\n" , dev->name); }else {struct sta_info *dsta; dsta =sta_info_get (local, skb->data);if (dsta && !dsta->dev) { -printk (KERN_DEBUG "Station with null dev " -"structure!\n" ); +if (net_ratelimit ()) +printk (KERN_DEBUG "Station with null " +"dev structure!\n" ); }else if (dsta && dsta->dev == dev) {/* Destination station is associated to this * AP, so send the frame directly to it and
@@ -1272,24 +1293,28 @@ static void ieee80211_rx_michael_mic_rep/* TODO: verify that this is not triggered by fragmented * frames (hw does not verify MIC for them). */ -printk (KERN_DEBUG "%s: TKIP hwaccel reported Michael MIC " -"failure from " MAC_FMT " to " MAC_FMT " keyidx=%d\n" , - dev->name,MAC_ARG (hdr->addr2),MAC_ARG (hdr->addr1), keyidx); +if (net_ratelimit ()) +printk (KERN_DEBUG "%s: TKIP hwaccel reported Michael MIC " +"failure from " MAC_FMT " to " MAC_FMT " keyidx=%d\n" , + dev->name,MAC_ARG (hdr->addr2),MAC_ARG (hdr->addr1), + keyidx);if (!sta) {/* Some hardware versions seem to generate incorrect * Michael MIC reports; ignore them to avoid triggering * countermeasures. */ -printk (KERN_DEBUG "%s: ignored spurious Michael MIC " -"error for unknown address " MAC_FMT "\n" , - dev->name,MAC_ARG (hdr->addr2)); +if (net_ratelimit ()) +printk (KERN_DEBUG "%s: ignored spurious Michael MIC " +"error for unknown address " MAC_FMT "\n" , + dev->name,MAC_ARG (hdr->addr2)); goto ignore; }if (!(rx->fc &IEEE80211_FCTL_PROTECTED )) { -printk (KERN_DEBUG "%s: ignored spurious Michael MIC " -"error for a frame with no ISWEP flag (src " -MAC_FMT ")\n" , dev->name,MAC_ARG (hdr->addr2)); +if (net_ratelimit ()) +printk (KERN_DEBUG "%s: ignored spurious Michael MIC " +"error for a frame with no ISWEP flag (src " +MAC_FMT ")\n" , dev->name,MAC_ARG (hdr->addr2)); goto ignore; }
@@ -1299,19 +1324,22 @@ static void ieee80211_rx_michael_mic_rep* MIC errors for non-zero keyidx because these are reserved * for group keys and only the AP is sending real multicast * frames in BSS. */ -printk (KERN_DEBUG "%s: ignored Michael MIC error for " -"a frame with non-zero keyidx (%d) (src " MAC_FMT -")\n" , dev->name, keyidx,MAC_ARG (hdr->addr2)); +if (net_ratelimit ()) +printk (KERN_DEBUG "%s: ignored Michael MIC error for " +"a frame with non-zero keyidx (%d) (src " +MAC_FMT ")\n" , dev->name, keyidx, +MAC_ARG (hdr->addr2)); goto ignore; }if ((rx->fc &IEEE80211_FCTL_FTYPE ) !=IEEE80211_FTYPE_DATA && ((rx->fc &IEEE80211_FCTL_FTYPE ) !=IEEE80211_FTYPE_MGMT || (rx->fc &IEEE80211_FCTL_STYPE ) !=IEEE80211_STYPE_AUTH )) { -printk (KERN_DEBUG "%s: ignored spurious Michael MIC " -"error for a frame that cannot be encrypted " -"(fc=0x%04x) (src " MAC_FMT ")\n" , - dev->name, rx->fc,MAC_ARG (hdr->addr2)); +if (net_ratelimit ()) +printk (KERN_DEBUG "%s: ignored spurious Michael MIC " +"error for a frame that cannot be encrypted " +"(fc=0x%04x) (src " MAC_FMT ")\n" , + dev->name, rx->fc,MAC_ARG (hdr->addr2)); goto ignore; }
Johannes Berg
maintainerPATCH 17/20 mac80211: avoid copying packets to interfaces that are down
In reply to Johannes BergDavid Woodhouse noticed that under some circumstances the number of slab allocations kept growing. After looking a bit, this seemed to happen when you had a management mode interface that was *down*.
The reason for this is that when the device is down, all management frames get queued to the in-kernel MLME (via ieee80211_sta_rx_mgmt) but then the sta work is invoked but doesn't run when the netif is down. When you then bring the interface up, all such frames are freed, but if you change the mode all of them are lost because the skb queue is reinitialised as soon as you go back to managed mode. The skb queue is correctly cleared when the interface is brought down, but the code doesn't account for the fact that it may be filled while it is not up.
This patch should fix the issue by simply ignoring all interfaces that are down when going through the RX handlers.
---
Is there a possibility of a race condition here? If the interface is brought down right after this check the SKB could be copied to that interface after the skb queue has been flushed.
net/mac80211/rx.c | 3 +++ 1 file changed, 3 insertions(+)
net/mac80211/rx.c +3 -0
@@ -1522,6 +1522,9 @@ void __ieee80211_rx(struct ieee80211_hwlist_for_each_entry (sdata, &local->sub_if_list, list) { rx.u.rx.ra_match =1 ; +if (!netif_running (sdata->dev)) +continue ; + prepres =prepare_for_handlers (sdata, bssid, &rx, hdr);/* prepare_for_handlers can change sta */ sta = rx.sta;
Re: [PATCH 17/20] mac80211: avoid copying packets to interfaces that are down
Quoted 4 lines · Johannes Berg
Is there a possibility of a race condition here? If the interface is brought down right after this check the SKB could be copied to that interface after the skb queue has been flushed.
Yeah. This can be avoided by holding a write lock on the subif lock while flushing the skb queue. Not sure how much I like doing that, but it should work.
-Michael Wu
Johannes Berg
maintainerRe: [PATCH 17/20] mac80211: avoid copying packets to interfaces that are down
Quoted 8 lines · Michael Wu
Quoted 4 lines · Johannes Berg
Is there a possibility of a race condition here? If the interface is brought down right after this check the SKB could be copied to that interface after the skb queue has been flushed.
Yeah. This can be avoided by holding a write lock on the subif lock while flushing the skb queue. Not sure how much I like doing that, but it should work.
Hmm. Not entirely sure what you mean.
johannes
Johannes Berg
maintainerPATCH v2 17/20 mac80211: avoid copying packets to interfaces that are down
In reply to Michael WuDavid Woodhouse noticed that under some circumstances the number of slab allocations kept growing. After looking a bit, this seemed to happen when you had a management mode interface that was *down*.
The reason for this is that when the device is down, all management frames get queued to the in-kernel MLME (via ieee80211_sta_rx_mgmt) but then the sta work is invoked but doesn't run when the netif is down. When you then bring the interface up, all such frames are freed, but if you change the mode all of them are lost because the skb queue is reinitialised as soon as you go back to managed mode. The skb queue is correctly cleared when the interface is brought down, but the code doesn't account for the fact that it may be filled while it is not up.
This patch should fix the issue by simply ignoring all interfaces that are down when going through the RX handlers.
--- net/mac80211/ieee80211.c | 9 +++++++++ net/mac80211/rx.c | 3 +++ 2 files changed, 12 insertions(+)
net/mac80211/rx.c +3 -0
@@ -1522,6 +1522,9 @@ void __ieee80211_rx(struct ieee80211_hwlist_for_each_entry (sdata, &local->sub_if_list, list) { rx.u.rx.ra_match =1 ; +if (!netif_running (sdata->dev)) +continue ; + prepres =prepare_for_handlers (sdata, bssid, &rx, hdr);/* prepare_for_handlers can change sta */ sta = rx.sta;
net/mac80211/ieee80211.c +9 -0
@@ -466,7 +466,16 @@ static void ieee80211_if_shutdown(struct sdata->u.sta.state =IEEE80211_DISABLED ;del_timer_sync (&sdata->u.sta.timer);del_timer_sync (&sdata->u.sta.admit_timer); +/* +* Holding the sub_if_lock for writing here blocks +* out the receive path and makes sure it's not +* currently processing a packet that may get +* added to the queue. +*/ +write_lock_bh (&local->sub_if_lock);skb_queue_purge (&sdata->u.sta.skb_queue); +write_unlock_bh (&local->sub_if_lock); +if (!local->ops->hw_scan && local->scan_dev == sdata->dev) { local->sta_scanning =0 ;
Johannes Berg
maintainerPATCH 18/20 mac80211, drivers: remove reset callback
In reply to Johannes BergThe callback isn't used so remove it.
--- drivers/net/wireless/adm8211.c | 38 -------------------------------------- drivers/net/wireless/b43/main.c | 18 ------------------ drivers/net/wireless/rt2400pci.c | 1 - drivers/net/wireless/rt2500pci.c | 1 - drivers/net/wireless/rt2500usb.c | 1 - drivers/net/wireless/rt2x00mac.c | 1 - drivers/net/wireless/rt61pci.c | 1 - drivers/net/wireless/rt73usb.c | 1 - include/net/mac80211.h | 3 --- 9 files changed, 65 deletions(-)
include/net/mac80211.h +0 -3
@@ -551,9 +551,6 @@ struct ieee80211_ops {int (*tx)(struct ieee80211_hw *hw,struct sk_buff *skb,struct ieee80211_tx_control *control); -/* Handler for performing hardware reset. */ -int (*reset)(struct ieee80211_hw *hw); -/* Handler that is called when any netdevice attached to the hardware * device is set UP for the first time. This can be used, e.g., to * enable interrupts and beacon sending. */
drivers/net/wireless/adm8211.c +0 -38
@@ -1643,43 +1643,6 @@ static int adm8211_stop(struct ieee80211return 0 ; } -static int adm8211_reset (struct ieee80211_hw *dev) -{ -struct adm8211_priv *priv = dev->priv; -int retval =0 ; - - priv->nar =0 ; -ADM8211_CSR_WRITE (NAR ,0 ); -ADM8211_CSR_WRITE (IER ,0 ); -ADM8211_CSR_READ (NAR ); - -adm8211_free_rings (dev); - - retval =adm8211_hw_reset (dev); -if (retval) { -printk (KERN_ERR "%s: hardware reset failed\n" , -wiphy_name (dev->wiphy)); - goto fail; - } - - retval =adm8211_init_rings (dev); -if (retval) { -printk (KERN_ERR "%s: failed to initialize rings\n" , -wiphy_name (dev->wiphy)); - goto fail; - } - -adm8211_hw_init (dev); -adm8211_rf_set_channel (dev, priv->channel); - -ADM8211_CSR_WRITE (IER ,ADM8211_INTMASK ); -adm8211_update_mode (dev); -ADM8211_CSR_WRITE (RDR ,0 ); - -fail: -return retval; -} -static void adm8211_calc_durations (int *dur,int *plcp,size_t payload_len,int len,int plcp_signal,int short_preamble) {
@@ -1878,7 +1841,6 @@ static int adm8211_alloc_rings(struct iestatic const struct ieee80211_ops adm8211_ops = { .tx = adm8211_tx, - .reset = adm8211_reset, .open = adm8211_open, .stop = adm8211_stop, .add_interface = adm8211_add_interface,
drivers/net/wireless/b43/main.c +0 -18
@@ -2536,23 +2536,6 @@ static int b43_get_stats(struct ieee8021return 0 ; } -static int b43_dev_reset (struct ieee80211_hw *hw) -{ -struct b43_wl *wl =hw_to_b43_wl (hw); -struct b43_wldev *dev; -int err = -ENODEV ; - -mutex_lock (&wl->mutex); - dev = wl->current_dev; -if (dev) { -b43_controller_restart (dev,"Reset by ieee80211 subsystem" ); - err =0 ; - } -mutex_unlock (&wl->mutex); - -return 0 ; -} -static const char *phymode_to_string (unsigned int phymode) {switch (phymode) {
@@ -3485,7 +3468,6 @@ static const struct ieee80211_ops b43_hw .conf_tx = b43_conf_tx, .add_interface = b43_add_interface, .remove_interface = b43_remove_interface, - .reset = b43_dev_reset, .config = b43_dev_config, .config_interface = b43_config_interface, .set_multicast_list = b43_set_multicast_list,
drivers/net/wireless/rt2400pci.c +0 -1
@@ -1589,7 +1589,6 @@ static int rt2400pci_tx_last_beacon(strustatic const struct ieee80211_ops rt2400pci_mac80211_ops = { .tx = rt2x00mac_tx, - .reset = rt2x00mac_reset, .add_interface = rt2x00mac_add_interface, .remove_interface = rt2x00mac_remove_interface, .config = rt2x00mac_config,
drivers/net/wireless/rt2500pci.c +0 -1
@@ -1824,7 +1824,6 @@ static int rt2500pci_tx_last_beacon(strustatic const struct ieee80211_ops rt2500pci_mac80211_ops = { .tx = rt2x00mac_tx, - .reset = rt2x00mac_reset, .add_interface = rt2x00mac_add_interface, .remove_interface = rt2x00mac_remove_interface, .config = rt2x00mac_config,
drivers/net/wireless/rt2500usb.c +0 -1
@@ -1512,7 +1512,6 @@ static int rt2500usb_probe_hw(struct rt2*/ static const struct ieee80211_ops rt2500usb_mac80211_ops = { .tx = rt2x00mac_tx, - .reset = rt2x00mac_reset, .add_interface = rt2x00mac_add_interface, .remove_interface = rt2x00mac_remove_interface, .config = rt2x00mac_config,
drivers/net/wireless/rt2x00mac.c +0 -1
@@ -166,7 +166,6 @@ exit:return retval; } -EXPORT_SYMBOL_GPL (rt2x00mac_reset);int rt2x00mac_add_interface (struct ieee80211_hw *hw,struct ieee80211_if_init_conf *conf)
drivers/net/wireless/rt61pci.c +0 -1
@@ -2340,7 +2340,6 @@ static void rt61pci_reset_tsf(struct ieestatic const struct ieee80211_ops rt61pci_mac80211_ops = { .tx = rt2x00mac_tx, - .reset = rt2x00mac_reset, .add_interface = rt2x00mac_add_interface, .remove_interface = rt2x00mac_remove_interface, .config = rt2x00mac_config,
drivers/net/wireless/rt73usb.c +0 -1
@@ -1813,7 +1813,6 @@ static void rt73usb_reset_tsf(struct ieestatic const struct ieee80211_ops rt73usb_mac80211_ops = { .tx = rt2x00mac_tx, - .reset = rt2x00mac_reset, .add_interface = rt2x00mac_add_interface, .remove_interface = rt2x00mac_remove_interface, .config = rt2x00mac_config,
Re: [PATCH 18/20] mac80211, drivers: remove reset callback
Quoted 6 lines · On Wednesday 15 August 2007 16:49:38 Johannes Berg wrote:
drivers/net/wireless/b43/main.c +0
-6-static int b43_dev_reset (struct ieee80211_hw *hw) -{ -struct b43_wl *wl =hw_to_b43_wl (hw); -struct b43_wldev *dev; -int err = -ENODEV ; -
drivers/net/wireless/b43/main.c static int b43_get_stats(struct ieee8021 · line 2554
Quoted 10 lines
drivers/net/wireless/b43/main.c +0
-10-mutex_lock (&wl->mutex); - dev = wl->current_dev; -if (dev) { -b43_controller_restart (dev,"Reset by ieee80211 subsystem" ); - err =0 ; - } -mutex_unlock (&wl->mutex); - -return 0 ; -}
Ack. This also fixes the bug here, that was on my todo list ;)
Signature · 1 line
Greetings Michael.
Re: [PATCH 18/20] mac80211, drivers: remove reset callback
In reply to Johannes BergQuoted 3 lines · Johannes Berg
The callback isn't used so remove it.
Signed-off-by Johannes Berg <[email protected]>
ACK for the rt2x00 part.
If reset is permenantly gone, I'll probably move the reset handler to rt2x00dev.c soon since that is the only place where it is used at this time.
Ivo
Johannes Berg
maintainerRe: [PATCH 18/20] mac80211, drivers: remove reset callback
Quoted 4 lines · Ivo van Doorn
ACK for the rt2x00 part.
If reset is permenantly gone, I'll probably move the reset handler tort2x00dev.csoon since that is the only place where it is used at this time.
I noticed, but wasn't sure what you planned so refrained from further changes (also to make the diff smaller etc.)
johannes
Johannes Berg
maintainerPATCH 19/20 mac80211: remove IEEE80211_HW_HOST_GEN_BEACON flag
In reply to Johannes BergThere's no point in setting that flag, drivers simply call ieee80211_beacon_get() if they need it.
--- drivers/net/wireless/rt2400pci.c | 1 - drivers/net/wireless/rt2500pci.c | 1 - drivers/net/wireless/rt61pci.c | 1 - include/net/mac80211.h | 13 ++++++------- 4 files changed, 6 insertions(+), 10 deletions(-)
include/net/mac80211.h +6 -7
@@ -445,14 +445,13 @@ struct ieee80211_hw {/* TODO: frame_type 802.11/802.3, sw_encryption requirements */ -/* Some wireless LAN chipsets generate beacons in the hardware/firmware -* and others rely on host generated beacons. This option is used to -* configure the upper layer IEEE 802.11 module to generate beacons. -* The low-level driver can use ieee80211_beacon_get() to fetch the -* next beacon frame. */ -#define IEEE80211_HW_HOST_GEN_BEACON (1<<0) +/* hole at 0 */ -/* The device needs to be supplied with a beacon template only. */ +/* +* The device only needs to be supplied with a beacon template. +* If you need the host to generate each beacon then don't use +* this flag and use ieee80211_beacon_get(). +*/ #define IEEE80211_HW_HOST_GEN_BEACON_TEMPLATE (1<<1)/* Some devices handle decryption internally and do not
drivers/net/wireless/rt2400pci.c +0 -1
@@ -1444,7 +1444,6 @@ static void rt2400pci_probe_hw_mode(stru* Initialize all hw fields. */ rt2x00dev->hw->flags = -IEEE80211_HW_HOST_GEN_BEACON |IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING |IEEE80211_HW_WEP_INCLUDE_IV | IEEE80211_HW_DATA_NULLFUNC_ACK |
drivers/net/wireless/rt2500pci.c +0 -1
@@ -1689,7 +1689,6 @@ static void rt2500pci_probe_hw_mode(stru* Initialize all hw fields. */ rt2x00dev->hw->flags = -IEEE80211_HW_HOST_GEN_BEACON |IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING |IEEE80211_HW_WEP_INCLUDE_IV | IEEE80211_HW_DATA_NULLFUNC_ACK |
drivers/net/wireless/rt61pci.c +0 -1
@@ -2213,7 +2213,6 @@ static void rt61pci_probe_hw_mode(struct* Initialize all hw fields. */ rt2x00dev->hw->flags = -IEEE80211_HW_HOST_GEN_BEACON |IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING |IEEE80211_HW_WEP_INCLUDE_IV | IEEE80211_HW_DATA_NULLFUNC_ACK |
Johannes Berg
maintainerPATCH 20/20 mac80211: remove VLAN stuff
In reply to Johannes BergThis patch removes all VLAN stuff from mac80211.
At the moment, it cannot possibly work, mac80211 doesn't actually do anything with those VLAN type interfaces. Also, there doesn't seem to be any point in doing it in the wireless stack. The recently added "macvlan" shows how you can do VLANs based on destination address, what we will need is something like "smacvlan" that does VLANs based on source address.
Hence, let's remove this, and when somebody needs it they get to add it properly.
--- include/net/mac80211.h | 2 - net/mac80211/debugfs_netdev.c | 27 -------------------- net/mac80211/debugfs_sta.c | 1 net/mac80211/hostapd_ioctl.h | 9 +----- net/mac80211/ieee80211.c | 7 ----- net/mac80211/ieee80211_i.h | 12 --------- net/mac80211/ieee80211_iface.c | 2 - net/mac80211/ieee80211_ioctl.c | 54 ----------------------------------------- net/mac80211/rx.c | 12 +++------ net/mac80211/sta_info.h | 2 - net/mac80211/tx.c | 5 +-- 11 files changed, 11 insertions(+), 122 deletions(-)
net/mac80211/ieee80211.c +1 -6
@@ -308,12 +308,7 @@ static inline int identical_mac_addr_all type2 == IEEE80211_IF_TYPE_WDS) || (type1 ==IEEE80211_IF_TYPE_WDS && (type2 ==IEEE80211_IF_TYPE_WDS || - type2 ==IEEE80211_IF_TYPE_AP )) || - (type1 ==IEEE80211_IF_TYPE_AP && - type2 ==IEEE80211_IF_TYPE_VLAN ) || - (type1 ==IEEE80211_IF_TYPE_VLAN && - (type2 ==IEEE80211_IF_TYPE_AP || - type2 == IEEE80211_IF_TYPE_VLAN))); + type2 == IEEE80211_IF_TYPE_AP))); }/* Check if running monitor interfaces should go to a "soft monitor" mode
include/net/mac80211.h +0 -2
@@ -310,7 +310,6 @@ struct ieee80211_conf {* @IEEE80211_IF_TYPE_IBSS: interface in IBSS (ad-hoc) mode. * @IEEE80211_IF_TYPE_MNTR: interface in monitor (rfmon) mode. * @IEEE80211_IF_TYPE_WDS: interface in WDS mode. -* @IEEE80211_IF_TYPE_VLAN: not used. */ enum ieee80211_if_types {IEEE80211_IF_TYPE_AP =0x00000000 ,
@@ -319,7 +318,6 @@ enum ieee80211_if_types {IEEE80211_IF_TYPE_IBSS =0x00000003 ,IEEE80211_IF_TYPE_MNTR =0x00000004 , IEEE80211_IF_TYPE_WDS = 0x5A580211, - IEEE80211_IF_TYPE_VLAN = 0x00080211, };/**
net/mac80211/debugfs_netdev.c +0 -27
@@ -422,9 +422,6 @@ __IEEE80211_IF_FILE(beacon_tail_len);/* WDS attributes */ IEEE80211_IF_FILE (peer, u.wds.remote_addr,MAC ); -/* VLAN attributes */ -IEEE80211_IF_FILE (vlan_id, u.vlan.id,DEC ); -/* MONITOR attributes */ static ssize_t ieee80211_if_fmt_mode (const struct ieee80211_sub_if_data *sdata,char *buf,int buflen)
@@ -531,15 +528,6 @@ static void add_wds_files(struct ieee802DEBUGFS_ADD (peer, wds); } -static void add_vlan_files (struct ieee80211_sub_if_data *sdata) -{ -DEBUGFS_ADD (channel_use, vlan); -DEBUGFS_ADD (drop_unencrypted, vlan); -DEBUGFS_ADD (eapol, vlan); -DEBUGFS_ADD (ieee8021_x, vlan); -DEBUGFS_ADD (vlan_id, vlan); -} -static void add_monitor_files (struct ieee80211_sub_if_data *sdata) {DEBUGFS_ADD (mode, monitor);
@@ -564,9 +552,6 @@ static void add_files(struct ieee80211_scase IEEE80211_IF_TYPE_MNTR :add_monitor_files (sdata);break ; -case IEEE80211_IF_TYPE_VLAN : -add_vlan_files (sdata); -break ;default :break ; }
@@ -660,15 +645,6 @@ static void del_wds_files(struct ieee802DEBUGFS_DEL (peer, wds); } -static void del_vlan_files (struct ieee80211_sub_if_data *sdata) -{ -DEBUGFS_DEL (channel_use, vlan); -DEBUGFS_DEL (drop_unencrypted, vlan); -DEBUGFS_DEL (eapol, vlan); -DEBUGFS_DEL (ieee8021_x, vlan); -DEBUGFS_DEL (vlan_id, vlan); -} -static void del_monitor_files (struct ieee80211_sub_if_data *sdata) {DEBUGFS_DEL (mode, monitor);
@@ -693,9 +669,6 @@ static void del_files(struct ieee80211_scase IEEE80211_IF_TYPE_MNTR :del_monitor_files (sdata);break ; -case IEEE80211_IF_TYPE_VLAN : -del_vlan_files (sdata); -break ;default :break ; }
net/mac80211/hostapd_ioctl.h +2 -7
@@ -61,7 +61,6 @@ enum {PRISM2_HOSTAPD_SET_RATE_SETS =1005 ,PRISM2_HOSTAPD_ADD_IF =1006 ,PRISM2_HOSTAPD_REMOVE_IF =1007 , -PRISM2_HOSTAPD_SET_STA_VLAN =1010 ,PRISM2_HOSTAPD_SET_CHANNEL_FLAG =1012 ,PRISM2_HOSTAPD_SET_REGULATORY_DOMAIN =1013 , PRISM2_HOSTAPD_SET_TX_QUEUE_PARAMS = 1014,
@@ -135,15 +134,11 @@ struct prism2_hostapd_param {* num_basic_rates * u16 */ } set_rate_sets;struct { -u8 type;/* WDS, VLAN, etc */ +u8 type;/* WDS, etc */ u8 name[IFNAMSIZ ]; u8 data[0] ALIGNED; } if_info;struct { -char vlan_name[IFNAMSIZ ]; -int vlan_id; - } set_sta_vlan; -struct {u16 mode;/* MODE_* */ u16 chan;u32 flag;
@@ -201,7 +196,7 @@ struct ieee80211_rate_data {/* ADD_IF and REMOVE_IF 'type' argument */ enum { -HOSTAP_IF_WDS =1 ,HOSTAP_IF_VLAN =2 ,HOSTAP_IF_BSS =3 , +HOSTAP_IF_WDS =1 ,HOSTAP_IF_BSS =3 ,HOSTAP_IF_STA =4 };
net/mac80211/ieee80211_i.h +0 -12
@@ -233,10 +233,6 @@ struct ieee80211_if_wds {struct sta_info *sta; }; -struct ieee80211_if_vlan { -u8 id; -}; -struct ieee80211_if_sta {enum {IEEE80211_DISABLED ,IEEE80211_AUTHENTICATE ,
@@ -348,7 +344,6 @@ struct ieee80211_sub_if_data {union {struct ieee80211_if_ap ap;struct ieee80211_if_wds wds; -struct ieee80211_if_vlan vlan;struct ieee80211_if_sta sta; } u;int channel_use;
@@ -433,13 +428,6 @@ struct ieee80211_sub_if_data {struct dentry *peer; } wds;struct { -struct dentry *channel_use; -struct dentry *drop_unencrypted; -struct dentry *eapol; -struct dentry *ieee8021_x; -struct dentry *vlan_id; - } vlan; -struct {struct dentry *mode; } monitor;struct dentry *default_key;
net/mac80211/ieee80211_iface.c +0 -2
@@ -165,8 +165,6 @@ void ieee80211_if_set_type(struct net_decase IEEE80211_IF_TYPE_WDS : sdata->bss =NULL ;break ; -case IEEE80211_IF_TYPE_VLAN : -break ;case IEEE80211_IF_TYPE_AP : sdata->u.ap.dtim_period =2 ; sdata->u.ap.force_unicast_rateidx =-1 ;
net/mac80211/ieee80211_ioctl.c +1 -53
96 lines not on this page · raw message
net/mac80211/tx.c +2 -3
@@ -1319,7 +1319,7 @@ fail:/** * ieee80211_subif_start_xmit - netif start_xmit function for Ethernet-type -* subinterfaces (wlan#, WDS, and VLAN interfaces) +* subinterfaces * @skb: packet to be sent * @dev: incoming interface *
@@ -1363,8 +1363,7 @@ int ieee80211_subif_start_xmit(struct sk/* TODO: handling for 802.1x authorized/unauthorized port */ fc =IEEE80211_FTYPE_DATA |IEEE80211_STYPE_DATA ; -if (likely (sdata->type ==IEEE80211_IF_TYPE_AP || - sdata->type ==IEEE80211_IF_TYPE_VLAN )) { +if (likely (sdata->type ==IEEE80211_IF_TYPE_AP )) { fc |=IEEE80211_FCTL_FROMDS ;/* DA BSSID SA */ memcpy (hdr.addr1, skb->data,ETH_ALEN );
net/mac80211/debugfs_sta.c +0 -1
@@ -62,7 +62,6 @@ static const struct file_operations sta_STA_FILE (aid, aid,D );STA_FILE (key_idx_compression, key_idx_compression,D );STA_FILE (dev, dev->name,S ); -STA_FILE (vlan_id, vlan_id,D );STA_FILE (rx_packets, rx_packets,LU );STA_FILE (tx_packets, tx_packets,LU );STA_FILE (rx_bytes, rx_bytes,LU );
net/mac80211/sta_info.h +0 -2
@@ -113,8 +113,6 @@ struct sta_info {unsigned int wme_tx_queue[NUM_RX_DATA_QUEUES ];#endif /* CONFIG_MAC80211_DEBUG_COUNTERS */ -int vlan_id; -u16 listen_interval;#ifdef CONFIG_MAC80211_DEBUGFS
net/mac80211/rx.c +5 -7
@@ -970,9 +970,8 @@ ieee80211_rx_h_data_agg(struct ieee80211 sdata->stats.rx_bytes += frame->len;if (local->bridge_packets && - (sdata->type ==IEEE80211_IF_TYPE_AP || - sdata->type ==IEEE80211_IF_TYPE_VLAN ) && - rx->u.rx.ra_match) { + sdata->type ==IEEE80211_IF_TYPE_AP && + rx->u.rx.ra_match) {if (is_multicast_ether_addr (frame->data)) {/* send multicast frames both to higher layers * in local net stack and back to the wireless
@@ -1068,8 +1067,7 @@ ieee80211_rx_h_data(struct ieee80211_txrmemcpy (dst, hdr->addr3,ETH_ALEN );memcpy (src, hdr->addr2,ETH_ALEN ); -if (unlikely (sdata->type !=IEEE80211_IF_TYPE_AP && - sdata->type !=IEEE80211_IF_TYPE_VLAN )) { +if (unlikely (sdata->type !=IEEE80211_IF_TYPE_AP )) {if (net_ratelimit ())printk (KERN_DEBUG "%s: dropped ToDS frame " "(BSSID=" MAC_FMT
@@ -1166,8 +1164,8 @@ ieee80211_rx_h_data(struct ieee80211_txr sdata->stats.rx_packets++; sdata->stats.rx_bytes += skb->len; -if (local->bridge_packets && (sdata->type ==IEEE80211_IF_TYPE_AP - || sdata->type ==IEEE80211_IF_TYPE_VLAN ) && rx->u.rx.ra_match) { +if (local->bridge_packets && sdata->type ==IEEE80211_IF_TYPE_AP + && rx->u.rx.ra_match) {if (is_multicast_ether_addr (skb->data)) {/* send multicast frames both to higher layers in * local net stack and back to the wireless media */
Johannes Berg
maintainerRe: [PATCH 20/20] mac80211: remove VLAN stuff
Quoted 2 lines · Johannes Berg
plain text document attachment (036-mac80211-remove-vlans.patch) This patch removes all VLAN stuff from mac80211.
Whoops. Please consider withdrawn, Jouni actually pointed me to a use of the VLAN interfaces.
johannes