mac80211 cleanups
Johannes Berg
maintainercover mac80211 cleanups
Wholesale ioctl removals, some cleanups and fixes.
Please apply all patches but the PRISM2_PARAM_NEXT_MODE removal, I want some discussion on that first how we want to handle B vs. G channels on G capable hardware unlike now where we just don't handle it because drivers only specify G channels (rightfully IMHO.)
johannes
Johannes Berg
maintainerPATCH 1/13 mac80211: remove unused ioctls (1)
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_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
@@ -549,10 +549,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)
@@ -586,8 +582,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;
@@ -638,7 +632,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
@@ -190,9 +190,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
@@ -299,9 +299,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
@@ -3818,15 +3818,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 ;
@@ -3930,34 +3921,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; }
Johannes Berg
maintainerPATCH 2/13 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 3/13 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.
--- 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 -- 8 files changed, 96 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
@@ -587,12 +587,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;
@@ -628,10 +622,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;
@@ -658,7 +648,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
@@ -293,7 +293,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);
Johannes Berg
maintainerPATCH 4/13 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
@@ -1000,8 +1000,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
@@ -263,8 +263,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;
@@ -624,8 +622,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
@@ -672,7 +672,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 */
@@ -1167,8 +1167,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);
@@ -1761,7 +1760,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);
@@ -2444,7 +2443,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); }
@@ -3421,15 +3420,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. */
@@ -3627,8 +3627,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 ;
@@ -3641,13 +3641,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) {
@@ -3815,9 +3815,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
@@ -138,8 +138,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 ;
Johannes Berg
maintainerPATCH 5/13 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, };
@@ -55,12 +53,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,
@@ -75,8 +71,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
@@ -219,24 +213,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
@@ -631,7 +631,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
@@ -297,19 +297,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 6/13 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
@@ -60,17 +60,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
@@ -153,24 +147,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;
@@ -197,21 +173,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 7/13 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
@@ -61,7 +61,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,
@@ -152,10 +151,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 8/13 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 9/13 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
@@ -127,14 +127,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 10/13 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
@@ -274,7 +274,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
@@ -2229,22 +2229,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
@@ -1167,7 +1167,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
@@ -179,14 +179,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
maintainerPATCH 11/13 mac80211: remove PRISM2_HOSTAPD_{ADD,REMOVE}_IF
In reply to Johannes BergThis is unused in hostapd/wpa_supplicant now that I made it use nl80211.
--- net/mac80211/hostapd_ioctl.h | 24 --------- net/mac80211/ieee80211_ioctl.c | 100 ----------------------------------------- 2 files changed, 124 deletions(-)
net/mac80211/hostapd_ioctl.h +0 -24
@@ -58,8 +58,6 @@ enum {PRISM2_HOSTAPD_SET_BEACON =1001 ,PRISM2_HOSTAPD_GET_HW_FEATURES =1002 ,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,
@@ -197,26 +195,4 @@ struct ieee80211_rate_data { int flags; /* IEEE80211_RATE_ flags */ }; - -/* ADD_IF and REMOVE_IF 'type' argument */ -enum { -HOSTAP_IF_WDS =1 ,HOSTAP_IF_VLAN =2 ,HOSTAP_IF_BSS =3 , -HOSTAP_IF_STA =4 -}; - -struct hostapd_if_wds { -u8 remote_addr[ETH_ALEN ]; -}; - -struct hostapd_if_vlan { -u8 id; -}; - -struct hostapd_if_bss { -u8 bssid[ETH_ALEN ]; -}; - -struct hostapd_if_sta { -}; -#endif /* HOSTAPD_IOCTL_H */
net/mac80211/ieee80211_ioctl.c +0 -100
112 lines not on this page · raw message
Johannes Berg
maintainerPATCH 12/13 mac80211: remove PRISM2_PARAM_NEXT_MODE
In reply to Johannes BergThis is now unused in hostapd/wpa_supplicant.
--- net/mac80211/hostapd_ioctl.h | 1 - net/mac80211/ieee80211_i.h | 5 ----- net/mac80211/ieee80211_ioctl.c | 13 ------------- 3 files changed, 19 deletions(-)
net/mac80211/hostapd_ioctl.h +0 -1
@@ -34,7 +34,6 @@ enum {PRISM2_PARAM_CTS_PROTECT_ERP_FRAMES =1001 ,PRISM2_PARAM_PREAMBLE =1003 ,PRISM2_PARAM_SHORT_SLOT_TIME =1006 , -PRISM2_PARAM_NEXT_MODE =1008 ,PRISM2_PARAM_PRIVACY_INVOKED =1014 ,PRISM2_PARAM_BROADCAST_SSID =1015 , PRISM2_PARAM_EAPOL = 1023,
net/mac80211/ieee80211_i.h +0 -5
@@ -501,11 +501,6 @@ struct ieee80211_local {struct rate_control_ref *rate_ctrl; -int next_mode;/* MODE_IEEE80211* -* The mode preference for next channel change. This is -* used to select .11g vs. .11b channels (or 4.9 GHz vs. -* .11a) when the channel number is not unique. */ -/* Supported and basic rate filters for different modes. These are * pointers to -1 terminated lists and rates in 100 kbps units. */ int *supp_rates[NUM_IEEE80211_MODES ];
net/mac80211/ieee80211_ioctl.c +0 -13
@@ -1270,11 +1270,6 @@ int ieee80211_set_channel(struct ieee802struct ieee80211_channel *chan = &mode->channels[c];if (chan->flag &IEEE80211_CHAN_W_SCAN && ((chan->chan == channel) || (chan->freq == freq))) { -/* Use next_mode as the mode preference to -* resolve non-unique channel numbers. */ -if (set && mode->mode != local->next_mode) -continue ; - local->oper_channel = chan; local->oper_hw_mode = mode; set++;
@@ -1885,10 +1880,6 @@ static int ieee80211_ioctl_prism2_param( local_to_hw(local), value);break ; -case PRISM2_PARAM_NEXT_MODE : - local->next_mode = value; -break ; -case PRISM2_PARAM_BROADCAST_SSID :if ((value <0 ) || (value >1 )) ret = -EINVAL ;
@@ -1961,10 +1952,6 @@ static int ieee80211_ioctl_get_prism2_pa *param = !!(local->hw.conf.flags &IEEE80211_CONF_SHORT_SLOT_TIME );break ; -case PRISM2_PARAM_NEXT_MODE : - *param = local->next_mode; -break ; -case PRISM2_PARAM_BROADCAST_SSID : *param = !!(local->hw.conf.flags &IEEE80211_CONF_SSID_HIDDEN );break ;
Johannes Berg
maintainerPATCH 13/13 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 );
@@ -870,8 +878,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 ;
@@ -962,17 +971,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
@@ -1052,10 +1063,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 ;
@@ -1065,12 +1081,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 ;
@@ -1145,15 +1165,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
@@ -1261,24 +1282,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; }
@@ -1288,19 +1313,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; }