linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 00/13] mac80211 cleanups
@ 2007-08-14  9:20 Johannes Berg
  2007-08-14  9:20 ` [PATCH 01/13] mac80211: remove unused ioctls (1) Johannes Berg
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: Johannes Berg @ 2007-08-14  9:20 UTC (permalink / raw)
  To: John W. Linville; +Cc: Jiri Benc, Michael Wu, linux-wireless

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


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 01/13] mac80211: remove unused ioctls (1)
  2007-08-14  9:20 [PATCH 00/13] mac80211 cleanups Johannes Berg
@ 2007-08-14  9:20 ` Johannes Berg
  2007-08-14  9:20 ` [PATCH 02/13] mac80211: remove PRISM2_PARAM_RADIO_ENABLED Johannes Berg
                   ` (11 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Johannes Berg @ 2007-08-14  9:20 UTC (permalink / raw)
  To: John W. Linville; +Cc: Jiri Benc, Michael Wu, linux-wireless

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.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>

---
 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(-)

--- wireless-dev.orig/net/mac80211/hostapd_ioctl.h	2007-08-13 18:03:34.745589257 +0200
+++ wireless-dev/net/mac80211/hostapd_ioctl.h	2007-08-14 11:07:18.954229604 +0200
@@ -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,
--- wireless-dev.orig/net/mac80211/ieee80211_i.h	2007-08-13 18:03:16.995589257 +0200
+++ wireless-dev/net/mac80211/ieee80211_i.h	2007-08-14 11:07:18.954229604 +0200
@@ -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;
--- wireless-dev.orig/net/mac80211/ieee80211_ioctl.c	2007-08-13 18:03:23.225589257 +0200
+++ wireless-dev/net/mac80211/ieee80211_ioctl.c	2007-08-14 11:07:18.964229604 +0200
@@ -1792,7 +1792,6 @@ static int ieee80211_ioctl_siwscan(struc
 				   struct iw_request_info *info,
 				   struct iw_point *data, char *extra)
 {
-	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
 	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(dev);
 	u8 *ssid = NULL;
 	size_t ssid_len = 0;
@@ -1803,16 +1802,7 @@ static int ieee80211_ioctl_siwscan(struc
 	switch (sdata->type) {
 	case IEEE80211_IF_TYPE_STA:
 	case IEEE80211_IF_TYPE_IBSS:
-		if (local->scan_flags & IEEE80211_SCAN_MATCH_SSID) {
-			ssid = sdata->u.sta.ssid;
-			ssid_len = sdata->u.sta.ssid_len;
-		}
-		break;
 	case IEEE80211_IF_TYPE_AP:
-		if (local->scan_flags & IEEE80211_SCAN_MATCH_SSID) {
-			ssid = sdata->u.ap.ssid;
-			ssid_len = sdata->u.ap.ssid_len;
-		}
 		break;
 	default:
 		return -EOPNOTSUPP;
@@ -2145,12 +2135,6 @@ static int ieee80211_ioctl_prism2_param(
 	sdata = IEEE80211_DEV_TO_SUB_IF(dev);
 
 	switch (param) {
-	case PRISM2_PARAM_HOST_ENCRYPT:
-	case PRISM2_PARAM_HOST_DECRYPT:
-		/* TODO: implement these; return success now to prevent
-		 * hostapd from aborting */
-		break;
-
 	case PRISM2_PARAM_BEACON_INT:
 		local->hw.conf.beacon_int = value;
 		if (ieee80211_hw_config(local))
@@ -2199,15 +2183,6 @@ static int ieee80211_ioctl_prism2_param(
 		}
 		break;
 
-	case PRISM2_PARAM_STAT_TIME:
-		if (!local->stat_time && value) {
-			local->stat_timer.expires = jiffies + HZ * value / 100;
-			add_timer(&local->stat_timer);
-		} else if (local->stat_time && !value) {
-			del_timer_sync(&local->stat_timer);
-		}
-		local->stat_time = value;
-		break;
 	case PRISM2_PARAM_SHORT_SLOT_TIME:
 		if (value)
 			local->hw.conf.flags |= IEEE80211_CONF_SHORT_SLOT_TIME;
@@ -2231,12 +2206,6 @@ static int ieee80211_ioctl_prism2_param(
 		ret = ieee80211_ioctl_set_radio_enabled(dev, value);
 		break;
 
-	case PRISM2_PARAM_ANTENNA_MODE:
-		local->hw.conf.antenna_mode = value;
-		if (ieee80211_hw_config(local))
-			ret = -EINVAL;
-		break;
-
 	case PRISM2_PARAM_BROADCAST_SSID:
 		if ((value < 0) || (value > 1))
 			ret = -EINVAL;
@@ -2278,18 +2247,10 @@ static int ieee80211_ioctl_prism2_param(
 		ret = ieee80211_ioctl_default_wep_only(local, value);
 		break;
 
-	case PRISM2_PARAM_WIFI_WME_NOACK_TEST:
-		local->wifi_wme_noack_test = value;
-		break;
-
 	case PRISM2_PARAM_ALLOW_BROADCAST_ALWAYS:
 		local->allow_broadcast_always = value;
 		break;
 
-	case PRISM2_PARAM_SCAN_FLAGS:
-		local->scan_flags = value;
-		break;
-
 	case PRISM2_PARAM_MIXED_CELL:
 		if (sdata->type != IEEE80211_IF_TYPE_STA &&
 		    sdata->type != IEEE80211_IF_TYPE_IBSS)
@@ -2379,9 +2340,6 @@ static int ieee80211_ioctl_get_prism2_pa
 		*param = sdata->short_preamble;
 		break;
 
-	case PRISM2_PARAM_STAT_TIME:
-		*param = local->stat_time;
-		break;
 	case PRISM2_PARAM_SHORT_SLOT_TIME:
 		*param = !!(local->hw.conf.flags & IEEE80211_CONF_SHORT_SLOT_TIME);
 		break;
@@ -2390,10 +2348,6 @@ static int ieee80211_ioctl_get_prism2_pa
 		*param = local->next_mode;
 		break;
 
-	case PRISM2_PARAM_ANTENNA_MODE:
-		*param = local->hw.conf.antenna_mode;
-		break;
-
 	case PRISM2_PARAM_BROADCAST_SSID:
 		*param = !!(local->hw.conf.flags & IEEE80211_CONF_SSID_HIDDEN);
 		break;
@@ -2433,18 +2387,10 @@ static int ieee80211_ioctl_get_prism2_pa
 		*param = local->default_wep_only;
 		break;
 
-	case PRISM2_PARAM_WIFI_WME_NOACK_TEST:
-		*param = local->wifi_wme_noack_test;
-		break;
-
 	case PRISM2_PARAM_ALLOW_BROADCAST_ALWAYS:
 		*param = local->allow_broadcast_always;
 		break;
 
-	case PRISM2_PARAM_SCAN_FLAGS:
-		*param = local->scan_flags;
-		break;
-
 	case PRISM2_PARAM_HW_MODES:
 		*param = local->enabled_modes;
 		break;
--- wireless-dev.orig/net/mac80211/wme.c	2007-08-13 18:03:01.885589257 +0200
+++ wireless-dev/net/mac80211/wme.c	2007-08-13 18:03:12.185589257 +0200
@@ -190,9 +190,6 @@ static int wme_qdiscop_enqueue(struct sk
 	if (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++;
--- wireless-dev.orig/include/net/mac80211.h	2007-08-14 11:06:10.734229604 +0200
+++ wireless-dev/include/net/mac80211.h	2007-08-14 11:07:15.374229604 +0200
@@ -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;
--- wireless-dev.orig/net/mac80211/ieee80211.c	2007-08-14 11:06:10.454229604 +0200
+++ wireless-dev/net/mac80211/ieee80211.c	2007-08-14 11:07:18.954229604 +0200
@@ -593,42 +593,6 @@ struct dev_mc_list *ieee80211_get_mc_lis
 }
 EXPORT_SYMBOL(ieee80211_get_mc_list_item);
 
-static void ieee80211_stat_refresh(unsigned long data)
-{
-	struct ieee80211_local *local = (struct ieee80211_local *) data;
-	struct sta_info *sta;
-	struct ieee80211_sub_if_data *sdata;
-
-	if (!local->stat_time)
-		return;
-
-	/* go through all stations */
-	read_lock_bh(&local->sta_lock);
-	list_for_each_entry(sta, &local->sta_list, list) {
-		sta->channel_use = (sta->channel_use_raw / local->stat_time) /
-			CHAN_UTIL_PER_10MS;
-		sta->channel_use_raw = 0;
-	}
-	read_unlock_bh(&local->sta_lock);
-
-	/* go through all subinterfaces */
-	read_lock(&local->sub_if_lock);
-	list_for_each_entry(sdata, &local->sub_if_list, list) {
-		sdata->channel_use = (sdata->channel_use_raw /
-				      local->stat_time) / CHAN_UTIL_PER_10MS;
-		sdata->channel_use_raw = 0;
-	}
-	read_unlock(&local->sub_if_lock);
-
-	/* hardware interface */
-	local->channel_use = (local->channel_use_raw /
-			      local->stat_time) / CHAN_UTIL_PER_10MS;
-	local->channel_use_raw = 0;
-
-	local->stat_timer.expires = jiffies + HZ * local->stat_time / 100;
-	add_timer(&local->stat_timer);
-}
-
 void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw,
 				 struct sk_buff *skb,
 				 struct ieee80211_tx_status *status)
@@ -1044,9 +1008,6 @@ struct ieee80211_hw *ieee80211_alloc_hw(
 	INIT_LIST_HEAD(&local->sub_if_list);
 
 	INIT_DELAYED_WORK(&local->scan_work, ieee80211_sta_scan_work);
-	init_timer(&local->stat_timer);
-	local->stat_timer.function = ieee80211_stat_refresh;
-	local->stat_timer.data = (unsigned long) local;
 	ieee80211_rx_bss_list_init(mdev);
 
 	sta_info_init(local);
@@ -1244,9 +1205,6 @@ void ieee80211_unregister_hw(struct ieee
 
 	rtnl_unlock();
 
-	if (local->stat_time)
-		del_timer_sync(&local->stat_timer);
-
 	ieee80211_rx_bss_list_deinit(local->mdev);
 	ieee80211_clear_tx_pending(local);
 	sta_info_stop(local);
--- wireless-dev.orig/net/mac80211/ieee80211_sta.c	2007-08-14 11:06:11.334229604 +0200
+++ wireless-dev/net/mac80211/ieee80211_sta.c	2007-08-14 11:06:43.854229604 +0200
@@ -3818,15 +3818,6 @@ ieee80211_sta_scan_result(struct net_dev
 	if (!(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;
 }
 

-- 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 02/13] mac80211: remove PRISM2_PARAM_RADIO_ENABLED
  2007-08-14  9:20 [PATCH 00/13] mac80211 cleanups Johannes Berg
  2007-08-14  9:20 ` [PATCH 01/13] mac80211: remove unused ioctls (1) Johannes Berg
@ 2007-08-14  9:20 ` Johannes Berg
  2007-08-14  9:20 ` [PATCH 03/13] mac80211: remove unused ioctls (2) Johannes Berg
                   ` (10 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Johannes Berg @ 2007-08-14  9:20 UTC (permalink / raw)
  To: John W. Linville; +Cc: Jiri Benc, Michael Wu, linux-wireless

This now is unused in hostapd/wpa_supplicant.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/hostapd_ioctl.h   |    1 -
 net/mac80211/ieee80211_ioctl.c |   14 --------------
 2 files changed, 15 deletions(-)

--- wireless-dev.orig/net/mac80211/hostapd_ioctl.h	2007-08-14 11:07:30.814229604 +0200
+++ wireless-dev/net/mac80211/hostapd_ioctl.h	2007-08-14 11:08:49.724229604 +0200
@@ -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,
--- wireless-dev.orig/net/mac80211/ieee80211_ioctl.c	2007-08-14 11:07:30.854229604 +0200
+++ wireless-dev/net/mac80211/ieee80211_ioctl.c	2007-08-14 11:08:49.724229604 +0200
@@ -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;

-- 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 03/13] mac80211: remove unused ioctls (2)
  2007-08-14  9:20 [PATCH 00/13] mac80211 cleanups Johannes Berg
  2007-08-14  9:20 ` [PATCH 01/13] mac80211: remove unused ioctls (1) Johannes Berg
  2007-08-14  9:20 ` [PATCH 02/13] mac80211: remove PRISM2_PARAM_RADIO_ENABLED Johannes Berg
@ 2007-08-14  9:20 ` Johannes Berg
  2007-08-14  9:20 ` [PATCH 04/13] mac80211: remove unused ioctls (3) Johannes Berg
                   ` (9 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Johannes Berg @ 2007-08-14  9:20 UTC (permalink / raw)
  To: John W. Linville; +Cc: Jiri Benc, Michael Wu, linux-wireless

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_ALWAYS

are not used by hostapd or wpa_supplicant.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 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(-)

--- wireless-dev.orig/net/mac80211/hostapd_ioctl.h	2007-08-14 11:08:49.724229604 +0200
+++ wireless-dev/net/mac80211/hostapd_ioctl.h	2007-08-14 11:09:55.444229604 +0200
@@ -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,
--- wireless-dev.orig/net/mac80211/ieee80211_i.h	2007-08-14 11:07:18.954229604 +0200
+++ wireless-dev/net/mac80211/ieee80211_i.h	2007-08-14 11:09:55.454229604 +0200
@@ -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 {
--- wireless-dev.orig/net/mac80211/ieee80211_ioctl.c	2007-08-14 11:08:49.724229604 +0200
+++ wireless-dev/net/mac80211/ieee80211_ioctl.c	2007-08-14 11:09:55.444229604 +0200
@@ -2201,17 +2201,6 @@ static int ieee80211_ioctl_prism2_param(
 			local->hw.conf.flags &= ~IEEE80211_CONF_SSID_HIDDEN;
 		break;
 
-	case PRISM2_PARAM_STA_ANTENNA_SEL:
-		local->sta_antenna_sel = value;
-		break;
-
-	case PRISM2_PARAM_TX_POWER_REDUCTION:
-		if (value < 0)
-			ret = -EINVAL;
-		else
-			local->hw.conf.tx_power_reduction = value;
-		break;
-
 	case PRISM2_PARAM_EAPOL:
 		sdata->eapol = value;
 		break;
@@ -2220,23 +2209,6 @@ static int ieee80211_ioctl_prism2_param(
 		local->key_tx_rx_threshold = value;
 		break;
 
-	case PRISM2_PARAM_KEY_INDEX:
-		if (value < 0 || value >= NUM_DEFAULT_KEYS)
-			ret = -EINVAL;
-		else if (!sdata->keys[value])
-			ret = -ENOENT;
-		else
-			sdata->default_key = sdata->keys[value];
-		break;
-
-	case PRISM2_PARAM_DEFAULT_WEP_ONLY:
-		ret = ieee80211_ioctl_default_wep_only(local, value);
-		break;
-
-	case PRISM2_PARAM_ALLOW_BROADCAST_ALWAYS:
-		local->allow_broadcast_always = value;
-		break;
-
 	case PRISM2_PARAM_MIXED_CELL:
 		if (sdata->type != IEEE80211_IF_TYPE_STA &&
 		    sdata->type != IEEE80211_IF_TYPE_IBSS)
@@ -2338,14 +2310,6 @@ static int ieee80211_ioctl_get_prism2_pa
 		*param = !!(local->hw.conf.flags & IEEE80211_CONF_SSID_HIDDEN);
 		break;
 
-	case PRISM2_PARAM_STA_ANTENNA_SEL:
-		*param = local->sta_antenna_sel;
-		break;
-
-	case PRISM2_PARAM_TX_POWER_REDUCTION:
-		*param = local->hw.conf.tx_power_reduction;
-		break;
-
 	case PRISM2_PARAM_EAPOL:
 		*param = sdata->eapol;
 		break;
@@ -2354,29 +2318,6 @@ static int ieee80211_ioctl_get_prism2_pa
 		*param = local->key_tx_rx_threshold;
 		break;
 
-	case PRISM2_PARAM_KEY_INDEX:
-		if (!sdata->default_key)
-			ret = -ENOENT;
-		else if (sdata->default_key == sdata->keys[0])
-			*param = 0;
-		else if (sdata->default_key == sdata->keys[1])
-			*param = 1;
-		else if (sdata->default_key == sdata->keys[2])
-			*param = 2;
-		else if (sdata->default_key == sdata->keys[3])
-			*param = 3;
-		else
-			ret = -ENOENT;
-		break;
-
-	case PRISM2_PARAM_DEFAULT_WEP_ONLY:
-		*param = local->default_wep_only;
-		break;
-
-	case PRISM2_PARAM_ALLOW_BROADCAST_ALWAYS:
-		*param = local->allow_broadcast_always;
-		break;
-
 	case PRISM2_PARAM_HW_MODES:
 		*param = local->enabled_modes;
 		break;
--- wireless-dev.orig/net/mac80211/rc80211_simple.c	2007-08-14 11:06:09.714229604 +0200
+++ wireless-dev/net/mac80211/rc80211_simple.c	2007-08-14 11:08:57.504229604 +0200
@@ -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++;
--- wireless-dev.orig/net/mac80211/tx.c	2007-08-14 11:06:09.774229604 +0200
+++ wireless-dev/net/mac80211/tx.c	2007-08-14 11:09:55.454229604 +0200
@@ -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);
--- wireless-dev.orig/net/mac80211/sta_info.h	2007-08-14 11:06:09.814229604 +0200
+++ wireless-dev/net/mac80211/sta_info.h	2007-08-14 11:08:57.514229604 +0200
@@ -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 */
--- wireless-dev.orig/include/net/mac80211.h	2007-08-14 11:07:15.374229604 +0200
+++ wireless-dev/include/net/mac80211.h	2007-08-14 11:09:43.604229604 +0200
@@ -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;
--- wireless-dev.orig/net/mac80211/debugfs.c	2007-08-14 11:02:57.004229604 +0200
+++ wireless-dev/net/mac80211/debugfs.c	2007-08-14 11:09:43.544229604 +0200
@@ -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_loc
 	DEBUGFS_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_loc
 	DEBUGFS_DEL(total_ps_buffered);
 	DEBUGFS_DEL(mode);
 	DEBUGFS_DEL(wep_iv);
-	DEBUGFS_DEL(tx_power_reduction);
 	DEBUGFS_DEL(rate_ctrl_alg);
 	DEBUGFS_DEL(modes);
 

-- 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 04/13] mac80211: remove unused ioctls (3)
  2007-08-14  9:20 [PATCH 00/13] mac80211 cleanups Johannes Berg
                   ` (2 preceding siblings ...)
  2007-08-14  9:20 ` [PATCH 03/13] mac80211: remove unused ioctls (2) Johannes Berg
@ 2007-08-14  9:20 ` Johannes Berg
  2007-08-14  9:20 ` [PATCH 05/13] mac80211: remove unused ioctls (4) Johannes Berg
                   ` (8 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Johannes Berg @ 2007-08-14  9:20 UTC (permalink / raw)
  To: John W. Linville; +Cc: Jiri Benc, Michael Wu, linux-wireless

The 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.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 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(-)

--- wireless-dev.orig/net/mac80211/hostapd_ioctl.h	2007-08-14 11:11:16.834229604 +0200
+++ wireless-dev/net/mac80211/hostapd_ioctl.h	2007-08-14 11:12:07.624229604 +0200
@@ -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,
--- wireless-dev.orig/net/mac80211/ieee80211.c	2007-08-14 11:11:16.864229604 +0200
+++ wireless-dev/net/mac80211/ieee80211.c	2007-08-14 11:11:29.824229604 +0200
@@ -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);
--- wireless-dev.orig/net/mac80211/ieee80211_i.h	2007-08-14 11:11:16.924229604 +0200
+++ wireless-dev/net/mac80211/ieee80211_i.h	2007-08-14 11:12:04.234229604 +0200
@@ -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_*) */
 
--- wireless-dev.orig/net/mac80211/ieee80211_ioctl.c	2007-08-14 11:11:16.944229604 +0200
+++ wireless-dev/net/mac80211/ieee80211_ioctl.c	2007-08-14 11:12:07.624229604 +0200
@@ -1456,9 +1456,8 @@ static int ieee80211_ioctl_giwrange(stru
 	list_for_each_entry(mode, &local->modes_list, list) {
 		int i = 0;
 
-		if (!(local->enabled_modes & (1 << mode->mode)) ||
-		    (local->hw_modes & local->enabled_modes &
-		     (1 << MODE_IEEE80211G) && mode->mode == MODE_IEEE80211B))
+		if ((local->hw_modes & (1 << MODE_IEEE80211G) &&
+		    mode->mode == MODE_IEEE80211B))
 			continue;
 
 		while (i < mode->num_channels && c < IW_MAX_FREQUENCIES) {
@@ -1567,8 +1566,6 @@ int ieee80211_set_channel(struct ieee802
 	int ret = -EINVAL;
 
 	list_for_each_entry(mode, &local->modes_list, list) {
-		if (!(local->enabled_modes & (1 << mode->mode)))
-			continue;
 		for (c = 0; c < mode->num_channels; c++) {
 			struct ieee80211_channel *chan = &mode->channels[c];
 			if (chan->flag & IEEE80211_CHAN_W_SCAN &&
@@ -2209,38 +2206,6 @@ static int ieee80211_ioctl_prism2_param(
 		local->key_tx_rx_threshold = value;
 		break;
 
-	case PRISM2_PARAM_MIXED_CELL:
-		if (sdata->type != IEEE80211_IF_TYPE_STA &&
-		    sdata->type != IEEE80211_IF_TYPE_IBSS)
-			ret = -EINVAL;
-		else
-			sdata->u.sta.mixed_cell = !!value;
-		break;
-
-	case PRISM2_PARAM_KEY_MGMT:
-		if (sdata->type != IEEE80211_IF_TYPE_STA)
-			ret = -EINVAL;
-		else
-			sdata->u.sta.key_mgmt = value;
-		break;
-
-	case PRISM2_PARAM_HW_MODES:
-		local->enabled_modes = value;
-		break;
-
-	case PRISM2_PARAM_CREATE_IBSS:
-		if (sdata->type != IEEE80211_IF_TYPE_IBSS)
-			ret = -EINVAL;
-		else
-			sdata->u.sta.create_ibss = !!value;
-		break;
-	case PRISM2_PARAM_WMM_ENABLED:
-		if (sdata->type != IEEE80211_IF_TYPE_STA &&
-		    sdata->type != IEEE80211_IF_TYPE_IBSS)
-			ret = -EINVAL;
-		else
-			sdata->u.sta.wmm_enabled = !!value;
-		break;
 	case PRISM2_PARAM_RADAR_DETECT:
 		local->hw.conf.radar_detect = value;
 		break;
@@ -2318,38 +2283,6 @@ static int ieee80211_ioctl_get_prism2_pa
 		*param = local->key_tx_rx_threshold;
 		break;
 
-	case PRISM2_PARAM_HW_MODES:
-		*param = local->enabled_modes;
-		break;
-
-	case PRISM2_PARAM_CREATE_IBSS:
-		if (sdata->type != IEEE80211_IF_TYPE_IBSS)
-			ret = -EINVAL;
-		else
-			*param = !!sdata->u.sta.create_ibss;
-		break;
-
-	case PRISM2_PARAM_MIXED_CELL:
-		if (sdata->type != IEEE80211_IF_TYPE_STA &&
-		    sdata->type != IEEE80211_IF_TYPE_IBSS)
-			ret = -EINVAL;
-		else
-			*param = !!sdata->u.sta.mixed_cell;
-		break;
-
-	case PRISM2_PARAM_KEY_MGMT:
-		if (sdata->type != IEEE80211_IF_TYPE_STA)
-			ret = -EINVAL;
-		else
-			*param = sdata->u.sta.key_mgmt;
-		break;
-	case PRISM2_PARAM_WMM_ENABLED:
-		if (sdata->type != IEEE80211_IF_TYPE_STA &&
-		    sdata->type != IEEE80211_IF_TYPE_IBSS)
-			ret = -EINVAL;
-		else
-			*param = !!sdata->u.sta.wmm_enabled;
-		break;
 	case PRISM2_PARAM_USER_SPACE_MLME:
 		*param = local->user_space_mlme;
 		break;
--- wireless-dev.orig/net/mac80211/ieee80211_sta.c	2007-08-14 11:11:17.004229604 +0200
+++ wireless-dev/net/mac80211/ieee80211_sta.c	2007-08-14 11:12:04.244229604 +0200
@@ -672,7 +672,7 @@ static void ieee80211_send_assoc(struct 
 		memcpy(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(st
 	struct 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_resp
 
 	rate_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(str
 	if (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(struc
 
 		if (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 work
 	struct 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 work
 			ieee80211_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;
--- wireless-dev.orig/net/mac80211/ieee80211_iface.c	2007-08-14 11:02:54.324229604 +0200
+++ wireless-dev/net/mac80211/ieee80211_iface.c	2007-08-14 11:12:02.134229604 +0200
@@ -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;

-- 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 05/13] mac80211: remove unused ioctls (4)
  2007-08-14  9:20 [PATCH 00/13] mac80211 cleanups Johannes Berg
                   ` (3 preceding siblings ...)
  2007-08-14  9:20 ` [PATCH 04/13] mac80211: remove unused ioctls (3) Johannes Berg
@ 2007-08-14  9:20 ` Johannes Berg
  2007-08-14  9:20 ` [PATCH 06/13] mac80211: remove unused ioctls (5) Johannes Berg
                   ` (7 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Johannes Berg @ 2007-08-14  9:20 UTC (permalink / raw)
  To: John W. Linville; +Cc: Jiri Benc, Michael Wu, linux-wireless

The 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.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 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(-)

--- wireless-dev.orig/net/mac80211/debugfs.c	2007-08-14 11:09:43.544229604 +0200
+++ wireless-dev/net/mac80211/debugfs.c	2007-08-14 11:13:19.844229604 +0200
@@ -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_loc
 
 	DEBUGFS_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);
--- wireless-dev.orig/net/mac80211/hostapd_ioctl.h	2007-08-14 11:12:07.624229604 +0200
+++ wireless-dev/net/mac80211/hostapd_ioctl.h	2007-08-14 11:14:03.454229604 +0200
@@ -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;
--- wireless-dev.orig/net/mac80211/ieee80211_i.h	2007-08-14 11:12:04.234229604 +0200
+++ wireless-dev/net/mac80211/ieee80211_i.h	2007-08-14 11:13:19.854229604 +0200
@@ -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;
--- wireless-dev.orig/net/mac80211/ieee80211_ioctl.c	2007-08-14 11:12:07.624229604 +0200
+++ wireless-dev/net/mac80211/ieee80211_ioctl.c	2007-08-14 11:14:00.904229604 +0200
@@ -1031,29 +1031,6 @@ static int ieee80211_ioctl_sta_get_state
 }
 
 
-static int ieee80211_ioctl_mlme(struct net_device *dev,
-				struct prism2_hostapd_param *param)
-{
-	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
-	struct ieee80211_sub_if_data *sdata;
-
-	if (local->user_space_mlme)
-		return -EOPNOTSUPP;
-
-	sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-	if (sdata->type != IEEE80211_IF_TYPE_STA &&
-	    sdata->type != IEEE80211_IF_TYPE_IBSS)
-		return -EINVAL;
-	switch (param->u.mlme.cmd) {
-	case MLME_STA_DEAUTH:
-		return ieee80211_sta_deauthenticate(dev, param->u.mlme.reason_code);
-	case MLME_STA_DISASSOC:
-		return ieee80211_sta_disassociate(dev, param->u.mlme.reason_code);
-	}
-	return 0;
-}
-
-
 static int ieee80211_ioctl_get_load_stats(struct net_device *dev,
 					  struct prism2_hostapd_param *param)
 {
@@ -1240,34 +1217,6 @@ found:
 }
 
 
-static int ieee80211_ioctl_set_quiet_params(struct net_device *dev,
-					    struct prism2_hostapd_param *param)
-{
-	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
-	struct ieee80211_conf *conf = &local->hw.conf;
-
-	conf->quiet_duration = param->u.quiet.duration;
-	conf->quiet_offset = param->u.quiet.offset;
-	conf->quiet_period = param->u.quiet.period;
-	return 0;
-}
-
-
-static int ieee80211_ioctl_set_radar_params(struct net_device *dev,
-					    struct prism2_hostapd_param *param)
-{
-	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
-	struct ieee80211_conf *conf = &local->hw.conf;
-
-	conf->radar_firpwr_threshold = param->u.radar.radar_firpwr_threshold;
-	conf->radar_rssi_threshold = param->u.radar.radar_rssi_threshold;
-	conf->pulse_height_threshold = param->u.radar.pulse_height_threshold;
-	conf->pulse_rssi_threshold = param->u.radar.pulse_rssi_threshold;
-	conf->pulse_inband_threshold = param->u.radar.pulse_inband_threshold;
-	return 0;
-}
-
-
 static int ieee80211_ioctl_priv_hostapd(struct net_device *dev,
 					struct iw_point *p)
 {
@@ -1360,15 +1309,6 @@ static int ieee80211_ioctl_priv_hostapd(
 	case PRISM2_STA_GET_STATE:
 		ret = ieee80211_ioctl_sta_get_state(dev, param);
 		break;
-	case PRISM2_HOSTAPD_MLME:
-		ret = ieee80211_ioctl_mlme(dev, param);
-		break;
-	case PRISM2_HOSTAPD_SET_RADAR_PARAMS:
-		ret = ieee80211_ioctl_set_radar_params(dev, param);
-		break;
-	case PRISM2_HOSTAPD_SET_QUIET_PARAMS:
-		ret = ieee80211_ioctl_set_quiet_params(dev, param);
-		break;
 	default:
 		ret = -EOPNOTSUPP;
 		break;
@@ -2206,12 +2146,6 @@ static int ieee80211_ioctl_prism2_param(
 		local->key_tx_rx_threshold = value;
 		break;
 
-	case PRISM2_PARAM_RADAR_DETECT:
-		local->hw.conf.radar_detect = value;
-		break;
-	case PRISM2_PARAM_SPECTRUM_MGMT:
-		local->hw.conf.spect_mgmt = value;
-		break;
 	case PRISM2_PARAM_USER_SPACE_MLME:
 		local->user_space_mlme = value;
 		break;
--- wireless-dev.orig/include/net/mac80211.h	2007-08-14 11:09:43.604229604 +0200
+++ wireless-dev/include/net/mac80211.h	2007-08-14 11:13:58.134229604 +0200
@@ -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;
 };
 
 /**

-- 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 06/13] mac80211: remove unused ioctls (5)
  2007-08-14  9:20 [PATCH 00/13] mac80211 cleanups Johannes Berg
                   ` (4 preceding siblings ...)
  2007-08-14  9:20 ` [PATCH 05/13] mac80211: remove unused ioctls (4) Johannes Berg
@ 2007-08-14  9:20 ` Johannes Berg
  2007-08-14  9:20 ` [PATCH 07/13] mac80211: remove PRISM2_HOSTAPD_SET_GENERIC_INFO_ELEM Johannes Berg
                   ` (6 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Johannes Berg @ 2007-08-14  9:20 UTC (permalink / raw)
  To: John W. Linville; +Cc: Jiri Benc, Michael Wu, linux-wireless

The 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.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/hostapd_ioctl.h   |   39 -------------
 net/mac80211/ieee80211_ioctl.c |  120 -----------------------------------------
 2 files changed, 159 deletions(-)

--- wireless-dev.orig/net/mac80211/hostapd_ioctl.h	2007-08-14 11:14:03.454229604 +0200
+++ wireless-dev/net/mac80211/hostapd_ioctl.h	2007-08-14 11:16:41.694229604 +0200
@@ -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. */
--- wireless-dev.orig/net/mac80211/ieee80211_ioctl.c	2007-08-14 11:14:00.904229604 +0200
+++ wireless-dev/net/mac80211/ieee80211_ioctl.c	2007-08-14 11:16:39.034229604 +0200
@@ -316,38 +316,6 @@ static int ieee80211_ioctl_remove_sta(st
 }
 
 
-static int ieee80211_ioctl_get_dot11counterstable(struct net_device *dev,
-					struct prism2_hostapd_param *param)
-{
-	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
-	struct ieee80211_low_level_stats stats;
-
-	memset(&stats, 0, sizeof(stats));
-	if (local->ops->get_stats)
-		local->ops->get_stats(local_to_hw(local), &stats);
-	param->u.dot11CountersTable.dot11TransmittedFragmentCount =
-		local->dot11TransmittedFragmentCount;
-	param->u.dot11CountersTable.dot11MulticastTransmittedFrameCount =
-		local->dot11MulticastTransmittedFrameCount;
-	param->u.dot11CountersTable.dot11ReceivedFragmentCount =
-		local->dot11ReceivedFragmentCount;
-	param->u.dot11CountersTable.dot11MulticastReceivedFrameCount =
-		local->dot11MulticastReceivedFrameCount;
-	param->u.dot11CountersTable.dot11TransmittedFrameCount =
-		local->dot11TransmittedFrameCount;
-	param->u.dot11CountersTable.dot11FCSErrorCount =
-		stats.dot11FCSErrorCount;
-	param->u.dot11CountersTable.dot11ACKFailureCount =
-		stats.dot11ACKFailureCount;
-	param->u.dot11CountersTable.dot11RTSFailureCount =
-		stats.dot11RTSFailureCount;
-	param->u.dot11CountersTable.dot11RTSSuccessCount =
-		stats.dot11RTSSuccessCount;
-
-	return 0;
-}
-
-
 static int ieee80211_ioctl_get_info_sta(struct net_device *dev,
 					struct prism2_hostapd_param *param)
 {
@@ -995,54 +963,6 @@ static int ieee80211_ioctl_remove_if(str
 	return ieee80211_if_remove(dev, param->u.if_info.name, type);
 }
 
-static int ieee80211_ioctl_scan_req(struct net_device *dev,
-				    struct prism2_hostapd_param *param,
-				    int param_len)
-{
-	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
-	u8 *pos = param->u.scan_req.ssid;
-	int left = param_len - ((u8 *) pos - (u8 *) param);
-	int len = param->u.scan_req.ssid_len;
-
-	if (local->user_space_mlme)
-		return -EOPNOTSUPP;
-
-	if (!netif_running(dev))
-		return -ENETDOWN;
-
-	if (left < len || len > IEEE80211_MAX_SSID_LEN)
-		return -EINVAL;
-
-	return ieee80211_sta_req_scan(dev, pos, len);
-}
-
-
-static int ieee80211_ioctl_sta_get_state(struct net_device *dev,
-					 struct prism2_hostapd_param *param)
-{
-	struct ieee80211_sub_if_data *sdata;
-
-	sdata = IEEE80211_DEV_TO_SUB_IF(dev);
-	if (sdata->type != IEEE80211_IF_TYPE_STA &&
-	    sdata->type != IEEE80211_IF_TYPE_IBSS)
-		return -EINVAL;
-	param->u.sta_get_state.state = sdata->u.sta.state;
-	return 0;
-}
-
-
-static int ieee80211_ioctl_get_load_stats(struct net_device *dev,
-					  struct prism2_hostapd_param *param)
-{
-	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
-
-	param->u.get_load_stats.channel_use = local->channel_use;
-/*	if (param->u.get_load_stats.flags & LOAD_STATS_CLEAR)
-		local->channel_use = 0; */ /* now it's not raw counter */
-
-	return 0;
-}
-
 
 static int ieee80211_ioctl_set_sta_vlan(struct net_device *dev,
 					struct prism2_hostapd_param *param)
@@ -1159,31 +1079,6 @@ ieee80211_ioctl_set_tx_queue_params(stru
 }
 
 
-static int ieee80211_ioctl_get_tx_stats(struct net_device *dev,
-					struct prism2_hostapd_param *param)
-{
-	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
-	struct ieee80211_tx_queue_stats stats;
-	int ret, i;
-
-	if (!local->ops->get_tx_stats)
-		return -EOPNOTSUPP;
-
-	memset(&stats, 0, sizeof(stats));
-	ret = local->ops->get_tx_stats(local_to_hw(local), &stats);
-	if (ret)
-		return ret;
-
-	for (i = 0; i < 4; i++) {
-		param->u.get_tx_stats.data[i].len = stats.data[i].len;
-		param->u.get_tx_stats.data[i].limit = stats.data[i].limit;
-		param->u.get_tx_stats.data[i].count = stats.data[i].count;
-	}
-
-	return 0;
-}
-
-
 static int ieee80211_ioctl_set_channel_flag(struct net_device *dev,
 					    struct prism2_hostapd_param *param)
 {
@@ -1278,12 +1173,6 @@ static int ieee80211_ioctl_priv_hostapd(
 	case PRISM2_HOSTAPD_REMOVE_IF:
 		ret = ieee80211_ioctl_remove_if(dev, param);
 		break;
-	case PRISM2_HOSTAPD_GET_DOT11COUNTERSTABLE:
-		ret = ieee80211_ioctl_get_dot11counterstable(dev, param);
-		break;
-	case PRISM2_HOSTAPD_GET_LOAD_STATS:
-		ret = ieee80211_ioctl_get_load_stats(dev, param);
-		break;
 	case PRISM2_HOSTAPD_SET_STA_VLAN:
 		ret = ieee80211_ioctl_set_sta_vlan(dev, param);
 		break;
@@ -1300,15 +1189,6 @@ static int ieee80211_ioctl_priv_hostapd(
 	case PRISM2_HOSTAPD_SET_TX_QUEUE_PARAMS:
 		ret = ieee80211_ioctl_set_tx_queue_params(dev, param);
 		break;
-	case PRISM2_HOSTAPD_GET_TX_STATS:
-		ret = ieee80211_ioctl_get_tx_stats(dev, param);
-		break;
-	case PRISM2_HOSTAPD_SCAN_REQ:
-		ret = ieee80211_ioctl_scan_req(dev, param, p->length);
-		break;
-	case PRISM2_STA_GET_STATE:
-		ret = ieee80211_ioctl_sta_get_state(dev, param);
-		break;
 	default:
 		ret = -EOPNOTSUPP;
 		break;

-- 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 07/13] mac80211: remove PRISM2_HOSTAPD_SET_GENERIC_INFO_ELEM
  2007-08-14  9:20 [PATCH 00/13] mac80211 cleanups Johannes Berg
                   ` (5 preceding siblings ...)
  2007-08-14  9:20 ` [PATCH 06/13] mac80211: remove unused ioctls (5) Johannes Berg
@ 2007-08-14  9:20 ` Johannes Berg
  2007-08-14  9:20 ` [PATCH 08/13] mac80211: fix preamble setting Johannes Berg
                   ` (5 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Johannes Berg @ 2007-08-14  9:20 UTC (permalink / raw)
  To: John W. Linville; +Cc: Jiri Benc, Michael Wu, linux-wireless

This is now unused in hostapd/wpa_supplicant, it uses SIOCSIWGENIE.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/hostapd_ioctl.h   |    5 -----
 net/mac80211/ieee80211_ioctl.c |   20 --------------------
 2 files changed, 25 deletions(-)

--- wireless-dev.orig/net/mac80211/hostapd_ioctl.h	2007-08-14 00:27:30.935589257 +0200
+++ wireless-dev/net/mac80211/hostapd_ioctl.h	2007-08-14 00:27:31.475589257 +0200
@@ -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;
--- wireless-dev.orig/net/mac80211/ieee80211_ioctl.c	2007-08-14 00:27:30.345589257 +0200
+++ wireless-dev/net/mac80211/ieee80211_ioctl.c	2007-08-14 00:27:31.475589257 +0200
@@ -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;

-- 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 08/13] mac80211: fix preamble setting
  2007-08-14  9:20 [PATCH 00/13] mac80211 cleanups Johannes Berg
                   ` (6 preceding siblings ...)
  2007-08-14  9:20 ` [PATCH 07/13] mac80211: remove PRISM2_HOSTAPD_SET_GENERIC_INFO_ELEM Johannes Berg
@ 2007-08-14  9:20 ` Johannes Berg
  2007-08-14  9:20 ` [PATCH 09/13] mac80211: remove scan struct from hostapd_param Johannes Berg
                   ` (4 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Johannes Berg @ 2007-08-14  9:20 UTC (permalink / raw)
  To: John W. Linville; +Cc: Jiri Benc, Michael Wu, linux-wireless, Daniel Drake

It looks like in commit 28487a90 the condition was unintentionally
negated by moving some code, fix it.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
Cc: Daniel Drake <dsd@gentoo.org>

---
 net/mac80211/ieee80211_ioctl.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- wireless-dev.orig/net/mac80211/ieee80211_ioctl.c	2007-08-14 00:27:31.475589257 +0200
+++ wireless-dev/net/mac80211/ieee80211_ioctl.c	2007-08-14 00:27:32.175589257 +0200
@@ -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 {

-- 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 09/13] mac80211: remove scan struct from hostapd_param
  2007-08-14  9:20 [PATCH 00/13] mac80211 cleanups Johannes Berg
                   ` (7 preceding siblings ...)
  2007-08-14  9:20 ` [PATCH 08/13] mac80211: fix preamble setting Johannes Berg
@ 2007-08-14  9:20 ` Johannes Berg
  2007-08-14  9:20 ` [PATCH 10/13] mac80211: kill key_mgmt variable, use privacy_enabled Johannes Berg
                   ` (3 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Johannes Berg @ 2007-08-14  9:20 UTC (permalink / raw)
  To: John W. Linville; +Cc: Jiri Benc, Michael Wu, linux-wireless

This hasn't been used for quite a while.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/hostapd_ioctl.h |    8 --------
 1 file changed, 8 deletions(-)

--- wireless-dev.orig/net/mac80211/hostapd_ioctl.h	2007-08-14 00:27:31.475589257 +0200
+++ wireless-dev/net/mac80211/hostapd_ioctl.h	2007-08-14 00:27:32.715589257 +0200
@@ -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;

-- 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 10/13] mac80211: kill key_mgmt variable, use privacy_enabled
  2007-08-14  9:20 [PATCH 00/13] mac80211 cleanups Johannes Berg
                   ` (8 preceding siblings ...)
  2007-08-14  9:20 ` [PATCH 09/13] mac80211: remove scan struct from hostapd_param Johannes Berg
@ 2007-08-14  9:20 ` Johannes Berg
  2007-08-14  9:20 ` [PATCH 11/13] mac80211: remove PRISM2_HOSTAPD_{ADD,REMOVE}_IF Johannes Berg
                   ` (2 subsequent siblings)
  12 siblings, 0 replies; 14+ messages in thread
From: Johannes Berg @ 2007-08-14  9:20 UTC (permalink / raw)
  To: John W. Linville; +Cc: Jiri Benc, Michael Wu, linux-wireless

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.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 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(-)

--- wireless-dev.orig/net/mac80211/ieee80211_i.h	2007-08-14 00:27:24.975589257 +0200
+++ wireless-dev/net/mac80211/ieee80211_i.h	2007-08-14 00:27:33.255589257 +0200
@@ -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)
--- wireless-dev.orig/net/mac80211/ieee80211_ioctl.c	2007-08-14 00:27:32.175589257 +0200
+++ wireless-dev/net/mac80211/ieee80211_ioctl.c	2007-08-14 00:27:33.265589257 +0200
@@ -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:
--- wireless-dev.orig/net/mac80211/ieee80211_sta.c	2007-08-14 00:27:23.765589257 +0200
+++ wireless-dev/net/mac80211/ieee80211_sta.c	2007-08-14 00:27:33.265589257 +0200
@@ -1167,7 +1167,7 @@ static int ieee80211_privacy_mismatch(st
 	struct 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);
--- wireless-dev.orig/net/mac80211/hostapd_ioctl.h	2007-08-14 00:27:32.715589257 +0200
+++ wireless-dev/net/mac80211/hostapd_ioctl.h	2007-08-14 00:27:33.265589257 +0200
@@ -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;

-- 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 11/13] mac80211: remove PRISM2_HOSTAPD_{ADD,REMOVE}_IF
  2007-08-14  9:20 [PATCH 00/13] mac80211 cleanups Johannes Berg
                   ` (9 preceding siblings ...)
  2007-08-14  9:20 ` [PATCH 10/13] mac80211: kill key_mgmt variable, use privacy_enabled Johannes Berg
@ 2007-08-14  9:20 ` Johannes Berg
  2007-08-14  9:20 ` [PATCH 12/13] mac80211: remove PRISM2_PARAM_NEXT_MODE Johannes Berg
  2007-08-14  9:20 ` [PATCH 13/13] mac80211: ratelimit some RX messages Johannes Berg
  12 siblings, 0 replies; 14+ messages in thread
From: Johannes Berg @ 2007-08-14  9:20 UTC (permalink / raw)
  To: John W. Linville; +Cc: Jiri Benc, Michael Wu, linux-wireless

This is unused in hostapd/wpa_supplicant now that I made it
use nl80211.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/hostapd_ioctl.h   |   24 ---------
 net/mac80211/ieee80211_ioctl.c |  100 -----------------------------------------
 2 files changed, 124 deletions(-)

--- wireless-dev.orig/net/mac80211/hostapd_ioctl.h	2007-08-14 00:27:33.265589257 +0200
+++ wireless-dev/net/mac80211/hostapd_ioctl.h	2007-08-14 00:27:33.885589257 +0200
@@ -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 */
--- wireless-dev.orig/net/mac80211/ieee80211_ioctl.c	2007-08-14 00:27:33.265589257 +0200
+++ wireless-dev/net/mac80211/ieee80211_ioctl.c	2007-08-14 00:27:33.885589257 +0200
@@ -870,100 +870,6 @@ static int ieee80211_ioctl_set_rate_sets
 }
 
 
-static int ieee80211_ioctl_add_if(struct net_device *dev,
-				  struct prism2_hostapd_param *param,
-				  int param_len)
-{
-	u8 *pos = param->u.if_info.data;
-	int left = param_len - ((u8 *) pos - (u8 *) param);
-	struct net_device *new_dev;
-	int res;
-	struct hostapd_if_wds *wds;
-	struct hostapd_if_bss *bss;
-
-	printk(KERN_WARNING "PRISM2_HOSTAPD_ADD_IF ioctl is deprecated!");
-	switch (param->u.if_info.type) {
-	case HOSTAP_IF_WDS:
-		wds = (struct hostapd_if_wds *) param->u.if_info.data;
-
-		if (left < sizeof(struct hostapd_if_wds))
-			return -EPROTO;
-
-		res = ieee80211_if_add(dev, param->u.if_info.name, &new_dev,
-				       IEEE80211_IF_TYPE_WDS);
-		if (res)
-			return res;
-		res = ieee80211_if_update_wds(new_dev, wds->remote_addr);
-		if (unlikely(res)) {
-			struct ieee80211_local *local =
-				wdev_priv(dev->ieee80211_ptr);
-			struct ieee80211_sub_if_data *sdata =
-				IEEE80211_DEV_TO_SUB_IF(new_dev);
-			write_lock_bh(&local->sub_if_lock);
-			list_del(&sdata->list);
-			write_unlock_bh(&local->sub_if_lock);
-			__ieee80211_if_del(local, sdata);
-		}
-		return res;
-	case HOSTAP_IF_VLAN:
-		if (left < sizeof(struct hostapd_if_vlan))
-			return -EPROTO;
-
-		res = ieee80211_if_add(dev, param->u.if_info.name, NULL,
-				       IEEE80211_IF_TYPE_VLAN);
-		return res;
-	case HOSTAP_IF_BSS:
-		bss = (struct hostapd_if_bss *) param->u.if_info.data;
-
-		if (left < sizeof(struct hostapd_if_bss))
-			return -EPROTO;
-
-		res = ieee80211_if_add(dev, param->u.if_info.name, &new_dev,
-				       IEEE80211_IF_TYPE_AP);
-		if (res)
-			return res;
-		memcpy(new_dev->dev_addr, bss->bssid, ETH_ALEN);
-		return 0;
-	case HOSTAP_IF_STA:
-		if (left < sizeof(struct hostapd_if_sta))
-			return -EPROTO;
-
-		res = ieee80211_if_add(dev, param->u.if_info.name, NULL,
-				       IEEE80211_IF_TYPE_STA);
-		return res;
-	default:
-		return -EINVAL;
-	}
-
-	return 0;
-}
-
-static int ieee80211_ioctl_remove_if(struct net_device *dev,
-				     struct prism2_hostapd_param *param)
-{
-	unsigned int type;
-
-	switch (param->u.if_info.type) {
-	case HOSTAP_IF_WDS:
-		type = IEEE80211_IF_TYPE_WDS;
-		break;
-	case HOSTAP_IF_VLAN:
-		type = IEEE80211_IF_TYPE_VLAN;
-		break;
-	case HOSTAP_IF_BSS:
-		type = IEEE80211_IF_TYPE_AP;
-		break;
-	case HOSTAP_IF_STA:
-		type = IEEE80211_IF_TYPE_STA;
-		break;
-	default:
-		return -EINVAL;
-	}
-
-	return ieee80211_if_remove(dev, param->u.if_info.name, type);
-}
-
-
 static int ieee80211_ioctl_set_sta_vlan(struct net_device *dev,
 					struct prism2_hostapd_param *param)
 {
@@ -1151,12 +1057,6 @@ static int ieee80211_ioctl_priv_hostapd(
 	case PRISM2_HOSTAPD_SET_RATE_SETS:
 		ret = ieee80211_ioctl_set_rate_sets(dev, param, p->length);
 		break;
-	case PRISM2_HOSTAPD_ADD_IF:
-		ret = ieee80211_ioctl_add_if(dev, param, p->length);
-		break;
-	case PRISM2_HOSTAPD_REMOVE_IF:
-		ret = ieee80211_ioctl_remove_if(dev, param);
-		break;
 	case PRISM2_HOSTAPD_SET_STA_VLAN:
 		ret = ieee80211_ioctl_set_sta_vlan(dev, param);
 		break;

-- 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 12/13] mac80211: remove PRISM2_PARAM_NEXT_MODE
  2007-08-14  9:20 [PATCH 00/13] mac80211 cleanups Johannes Berg
                   ` (10 preceding siblings ...)
  2007-08-14  9:20 ` [PATCH 11/13] mac80211: remove PRISM2_HOSTAPD_{ADD,REMOVE}_IF Johannes Berg
@ 2007-08-14  9:20 ` Johannes Berg
  2007-08-14  9:20 ` [PATCH 13/13] mac80211: ratelimit some RX messages Johannes Berg
  12 siblings, 0 replies; 14+ messages in thread
From: Johannes Berg @ 2007-08-14  9:20 UTC (permalink / raw)
  To: John W. Linville; +Cc: Jiri Benc, Michael Wu, linux-wireless

This is now unused in hostapd/wpa_supplicant.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>
---
 net/mac80211/hostapd_ioctl.h   |    1 -
 net/mac80211/ieee80211_i.h     |    5 -----
 net/mac80211/ieee80211_ioctl.c |   13 -------------
 3 files changed, 19 deletions(-)

--- wireless-dev.orig/net/mac80211/hostapd_ioctl.h	2007-08-14 00:27:33.885589257 +0200
+++ wireless-dev/net/mac80211/hostapd_ioctl.h	2007-08-14 00:27:34.505589257 +0200
@@ -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,
--- wireless-dev.orig/net/mac80211/ieee80211_i.h	2007-08-14 00:27:33.255589257 +0200
+++ wireless-dev/net/mac80211/ieee80211_i.h	2007-08-14 00:27:34.505589257 +0200
@@ -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];
--- wireless-dev.orig/net/mac80211/ieee80211_ioctl.c	2007-08-14 00:27:33.885589257 +0200
+++ wireless-dev/net/mac80211/ieee80211_ioctl.c	2007-08-14 00:27:34.515589257 +0200
@@ -1270,11 +1270,6 @@ int ieee80211_set_channel(struct ieee802
 			struct 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;

-- 


^ permalink raw reply	[flat|nested] 14+ messages in thread

* [PATCH 13/13] mac80211: ratelimit some RX messages
  2007-08-14  9:20 [PATCH 00/13] mac80211 cleanups Johannes Berg
                   ` (11 preceding siblings ...)
  2007-08-14  9:20 ` [PATCH 12/13] mac80211: remove PRISM2_PARAM_NEXT_MODE Johannes Berg
@ 2007-08-14  9:20 ` Johannes Berg
  12 siblings, 0 replies; 14+ messages in thread
From: Johannes Berg @ 2007-08-14  9:20 UTC (permalink / raw)
  To: John W. Linville; +Cc: Jiri Benc, Michael Wu, linux-wireless

Many 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.

Signed-off-by: Johannes Berg <johannes@sipsolutions.net>

---
 net/mac80211/rx.c |  134 ++++++++++++++++++++++++++++++++----------------------
 1 file changed, 81 insertions(+), 53 deletions(-)

--- wireless-dev.orig/net/mac80211/rx.c	2007-08-14 00:48:27.605589257 +0200
+++ wireless-dev/net/mac80211/rx.c	2007-08-14 00:58:06.745589257 +0200
@@ -342,13 +342,16 @@ ieee80211_rx_h_load_key(struct ieee80211
 			if (!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 ieee80
 		return 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_txr
 
 		if (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_txr
 		memcpy(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;
 	}
 

-- 


^ permalink raw reply	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2007-08-14 11:49 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-14  9:20 [PATCH 00/13] mac80211 cleanups Johannes Berg
2007-08-14  9:20 ` [PATCH 01/13] mac80211: remove unused ioctls (1) Johannes Berg
2007-08-14  9:20 ` [PATCH 02/13] mac80211: remove PRISM2_PARAM_RADIO_ENABLED Johannes Berg
2007-08-14  9:20 ` [PATCH 03/13] mac80211: remove unused ioctls (2) Johannes Berg
2007-08-14  9:20 ` [PATCH 04/13] mac80211: remove unused ioctls (3) Johannes Berg
2007-08-14  9:20 ` [PATCH 05/13] mac80211: remove unused ioctls (4) Johannes Berg
2007-08-14  9:20 ` [PATCH 06/13] mac80211: remove unused ioctls (5) Johannes Berg
2007-08-14  9:20 ` [PATCH 07/13] mac80211: remove PRISM2_HOSTAPD_SET_GENERIC_INFO_ELEM Johannes Berg
2007-08-14  9:20 ` [PATCH 08/13] mac80211: fix preamble setting Johannes Berg
2007-08-14  9:20 ` [PATCH 09/13] mac80211: remove scan struct from hostapd_param Johannes Berg
2007-08-14  9:20 ` [PATCH 10/13] mac80211: kill key_mgmt variable, use privacy_enabled Johannes Berg
2007-08-14  9:20 ` [PATCH 11/13] mac80211: remove PRISM2_HOSTAPD_{ADD,REMOVE}_IF Johannes Berg
2007-08-14  9:20 ` [PATCH 12/13] mac80211: remove PRISM2_PARAM_NEXT_MODE Johannes Berg
2007-08-14  9:20 ` [PATCH 13/13] mac80211: ratelimit some RX messages Johannes Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).