Skip to contentSkip to conversation

remove a few more unused constants

PATCH In review Johannes Berg 2 participants 8 messages Aug 10, 2007 – Aug 11, 2007 mac80211

lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

cover remove a few more unused constants

Resend of the patches from just a few minutes ago against the 'everything' branch.

johannes

author maintainer
#1 lore raw

PATCH 1/4 mac80211: remove ieee80211_msg_wep_frame_unknown_key

Neither hostapd nor wpa_supplicant really use it.

---
 net/mac80211/ieee80211_common.h |    2 +-
 net/mac80211/rx.c               |   11 +++++------
 2 files changed, 6 insertions(+), 7 deletions(-)
net/mac80211/rx.c +5 -6
@@ -350,12 +350,11 @@ ieee80211_rx_h_load_key(struct ieee80211
 				       MAC_ARG(hdr->addr1),
 				       MAC_ARG(hdr->addr2),
 				       MAC_ARG(hdr->addr3));
-				if (!rx->local->apdev)
-					return TXRX_DROP;
-				ieee80211_rx_mgmt(
-					rx->local, rx->skb, rx->u.rx.status,
-					ieee80211_msg_wep_frame_unknown_key);
-				return TXRX_QUEUED;
+				/*
+				 * TODO: notify userspace about this
+				 * via cfg/nl80211
+				 */
+				return TXRX_DROP;
 			}
 		}
 	}
net/mac80211/ieee80211_common.h +1 -1
@@ -48,7 +48,7 @@ enum ieee80211_msg_type {
 	ieee80211_msg_tx_callback_ack = 1,
 	ieee80211_msg_tx_callback_fail = 2,
 	/* hole at 3, was ieee80211_msg_passive_scan but unused */
-	ieee80211_msg_wep_frame_unknown_key = 4,
+	/* hole at 4, was ieee80211_msg_wep_frame_unknown_key but now unused */
 	ieee80211_msg_michael_mic_failure = 5,
 	/* hole at 6, was monitor but never sent to userspace */
 	ieee80211_msg_sta_not_assoc = 7,
author maintainer
#2 lore raw

PATCH 2/4 mac80211: dont send frames from unassociated stations up

In reply to Johannes Berg

Hostapd doesn't care anyway right now. And it could probably use the monitor interface if we added a flag or something.

---
 net/mac80211/ieee80211_common.h |    2 +-
 net/mac80211/rx.c               |   13 +++++++------
 2 files changed, 8 insertions(+), 7 deletions(-)
net/mac80211/rx.c +7 -6
@@ -301,12 +301,13 @@ ieee80211_rx_h_check(struct ieee80211_tx
 			return TXRX_DROP;
 		}
 
-		if (!rx->local->apdev)
-			return TXRX_DROP;
-
-		ieee80211_rx_mgmt(rx->local, rx->skb, rx->u.rx.status,
-				  ieee80211_msg_sta_not_assoc);
-		return TXRX_QUEUED;
+		/*
+		 * TODO: hostapd is really responsible for this.
+		 * But it doesn't care right now. So until it wants to care
+		 * drop it, and at that point just add a radiotap flag
+		 * or something
+		 */
+		return TXRX_DROP;
 	}
 
 	return TXRX_CONTINUE;
net/mac80211/ieee80211_common.h +1 -1
@@ -51,7 +51,7 @@ enum ieee80211_msg_type {
 	/* hole at 4, was ieee80211_msg_wep_frame_unknown_key but now unused */
 	ieee80211_msg_michael_mic_failure = 5,
 	/* hole at 6, was monitor but never sent to userspace */
-	ieee80211_msg_sta_not_assoc = 7,
+	/* hole at 7, was ieee80211_msg_sta_not_assoc but now unused */
 	/* 8 was ieee80211_msg_set_aid_for_sta */
 	ieee80211_msg_key_threshold_notification = 9,
 	ieee80211_msg_radar = 11,
author maintainer
#3 lore raw

PATCH 3/4 mac80211: remove ieee80211_msg_key_threshold_notification

In reply to Johannes Berg

Hostapd doesn't care at the moment.

---
 net/mac80211/ieee80211.c        |   31 ++-----------------------------
 net/mac80211/ieee80211_common.h |    2 +-
 2 files changed, 3 insertions(+), 30 deletions(-)
net/mac80211/ieee80211.c +2 -29
@@ -233,35 +233,8 @@ void ieee80211_key_threshold_notify(stru
 				    struct ieee80211_key *key,
 				    struct sta_info *sta)
 {
-	struct ieee80211_local *local = wdev_priv(dev->ieee80211_ptr);
-	struct sk_buff *skb;
-	struct ieee80211_msg_key_notification *msg;
-
-	/* if no one will get it anyway, don't even allocate it.
-	 * unlikely because this is only relevant for APs
-	 * where the device must be open... */
-	if (unlikely(!local->apdev))
-		return;
-
-	skb = dev_alloc_skb(sizeof(struct ieee80211_frame_info) +
-			    sizeof(struct ieee80211_msg_key_notification));
-	if (!skb)
-		return;
-
-	skb_reserve(skb, sizeof(struct ieee80211_frame_info));
-	msg = (struct ieee80211_msg_key_notification *)
-		skb_put(skb, sizeof(struct ieee80211_msg_key_notification));
-	msg->tx_rx_count = key->tx_rx_count;
-	memcpy(msg->ifname, dev->name, IFNAMSIZ);
-	if (sta)
-		memcpy(msg->addr, sta->addr, ETH_ALEN);
-	else
-		memset(msg->addr, 0xff, ETH_ALEN);
-
-	key->tx_rx_count = 0;
-
-	ieee80211_rx_mgmt(local, skb, NULL,
-			  ieee80211_msg_key_threshold_notification);
+	/* dummy function for when we add back support */
+	/* TODO: add back support via cfg80211/nl80211 */
 }
 
 static int ieee80211_mgmt_open(struct net_device *dev)
net/mac80211/ieee80211_common.h +1 -1
@@ -53,7 +53,7 @@ enum ieee80211_msg_type {
 	/* hole at 6, was monitor but never sent to userspace */
 	/* hole at 7, was ieee80211_msg_sta_not_assoc but now unused */
 	/* 8 was ieee80211_msg_set_aid_for_sta */
-	ieee80211_msg_key_threshold_notification = 9,
+	/* hole at 9, was ieee80211_msg_key_threshold_notification */
 	ieee80211_msg_radar = 11,
 };
 
author maintainer
#4 lore raw

PATCH 4/4 mac80211: remove radar stuff

In reply to Johannes Berg

Unused in drivers, userspace and mac80211.

---
 include/net/mac80211.h          |    6 ------
 net/mac80211/ieee80211.c        |   28 ----------------------------
 net/mac80211/ieee80211_common.h |    2 +-
 3 files changed, 1 insertion(+), 35 deletions(-)
include/net/mac80211.h +0 -6
@@ -1038,12 +1038,6 @@ ieee80211_get_mc_list_item(struct ieee80
 /* called by driver to notify scan status completed */
 void ieee80211_scan_completed(struct ieee80211_hw *hw);
 
-/* Function to indicate Radar Detection. The low level driver must call this
- * function to indicate the presence of radar in the current channel.
- * Additionally the radar type also could be sent */
-int  ieee80211_radar_status(struct ieee80211_hw *hw, int channel,
-			    int radar, int radar_type);
-
 /* return a pointer to the source address (SA) */
 static inline u8 *ieee80211_get_SA(struct ieee80211_hdr *hdr)
 {
net/mac80211/ieee80211.c +0 -28
@@ -201,34 +201,6 @@ ieee80211_rx_mgmt(struct ieee80211_local
 	netif_rx(skb);
 }
 
-int ieee80211_radar_status(struct ieee80211_hw *hw, int channel,
-			   int radar, int radar_type)
-{
-	struct sk_buff *skb;
-	struct ieee80211_radar_info *msg;
-	struct ieee80211_local *local = hw_to_local(hw);
-
-	if (!local->apdev)
-		return 0;
-
-	skb = dev_alloc_skb(sizeof(struct ieee80211_frame_info) +
-			    sizeof(struct ieee80211_radar_info));
-
-	if (!skb)
-		return -ENOMEM;
-	skb_reserve(skb, sizeof(struct ieee80211_frame_info));
-
-	msg = (struct ieee80211_radar_info *)
-		skb_put(skb, sizeof(struct ieee80211_radar_info));
-	msg->channel = channel;
-	msg->radar = radar;
-	msg->radar_type = radar_type;
-
-	ieee80211_rx_mgmt(local, skb, NULL, ieee80211_msg_radar);
-	return 0;
-}
-EXPORT_SYMBOL(ieee80211_radar_status);
-
 void ieee80211_key_threshold_notify(struct net_device *dev,
 				    struct ieee80211_key *key,
 				    struct sta_info *sta)
net/mac80211/ieee80211_common.h +1 -1
@@ -54,7 +54,7 @@ enum ieee80211_msg_type {
 	/* hole at 7, was ieee80211_msg_sta_not_assoc but now unused */
 	/* 8 was ieee80211_msg_set_aid_for_sta */
 	/* hole at 9, was ieee80211_msg_key_threshold_notification */
-	ieee80211_msg_radar = 11,
+	/* 11 was ieee80211_msg_radar */
 };
 
 struct ieee80211_msg_key_notification {
#5 lore raw

Re: [PATCH 4/4] mac80211: remove radar stuff

Quoted 4 lines · Johannes Berg

Unused in drivers, userspace and mac80211.

---

Won't 802.11a drivers need this? If so, does it hurt to leave it in for now?

Larry

author maintainer
#6 lore raw

Re: [PATCH 4/4] mac80211: remove radar stuff

Quoted 7 lines · Larry Finger
Quoted 4 lines · Johannes Berg

Unused in drivers, userspace and mac80211.

---

Won't 802.11a drivers need this? If so, does it hurt to leave it in for now?

Absolutely correct, they probably will. None of the ones we have, however, actually uses it, and it uses the management interface we're trying to get rid of for the notification. The same function should probably be added back to mac80211 or cfg80211 once somebody actually wants it, but do the notification
1) with well-defined arguments (explanation for the two args anyone?)
2) via nl80211

It doesn't really "hurt" but I'm trying to actually remove the master interface now and I'm almost there, so this code is in my way.

johannes

#7 lore raw

Re: [PATCH 4/4] mac80211: remove radar stuff

Quoted 16 lines · Johannes Berg
Quoted 6 lines · Larry Finger
Quoted 4 lines · Johannes Berg

Unused in drivers, userspace and mac80211.

---

Won't 802.11a drivers need this? If so, does it hurt to leave it in for now?

Absolutely correct, they probably will. None of the ones we have, however, actually uses it, and it uses the management interface we're trying to get rid of for the notification. The same function should probably be added back to mac80211 or cfg80211 once somebody actually wants it, but do the notification
1) with well-defined arguments (explanation for the two args anyone?)
2) via nl80211

Quoted 2 lines

It doesn't really "hurt" but I'm trying to actually remove the master interface now and I'm almost there, so this code is in my way.

OK, thanks for the explanation.

Larry