Skip to contentSkip to conversation

mac80211: remove DLS code again

PATCH New Johannes Berg 1 participant 1 message Sep 20, 2007

Subsystems (2)
lore
Share & tools
lore

Johannes Berg

author maintainer
#0 lore raw

PATCH 1/1 mac80211: remove DLS code again

The DLS code cannot possibly
(1) work correctly nor
(2) have any users.

This is because
(1) the WLAN_STA_DLS flag is never set so we can't ever look up a DLS peer when we receive action frames about it
(2) debugfs files with mode 0444 aren't really writable, yet the only way to trigger DLS.

Remove it all again until we figure out if we *really* need it.

---
Applies after the sta info flags fix.

 include/linux/ieee80211.h      |  174 ---------
 net/mac80211/debugfs_netdev.c  |  335 -----------------
 net/mac80211/ieee80211.c       |    1 
 net/mac80211/ieee80211_i.h     |   90 ----
 net/mac80211/ieee80211_iface.c |   16 
 net/mac80211/ieee80211_sta.c   |  782 -----------------------------------------
 net/mac80211/sta_info.c        |   30 -
 net/mac80211/sta_info.h        |    9 
 net/mac80211/tx.c              |   17 
 net/mac80211/wme.c             |   33 -
 10 files changed, 18 insertions(+), 1469 deletions(-)
include/linux/ieee80211.h +2 -172
@@ -124,58 +124,6 @@ struct ieee80211_ht_additional_info {
 	u8 basic_set[16];
 }__attribute__ ((packed));
 
-
-#define IEEE80211_TSINFO_TYPE(a)	((a.byte1 & 0x01) >> 0)
-#define IEEE80211_TSINFO_TSID(a)	((a.byte1 & 0x1E) >> 1)
-#define IEEE80211_TSINFO_DIR(a)		((a.byte1 & 0x60) >> 5)
-#define IEEE80211_TSINFO_POLICY(a)	((a.byte1 & 0x80) >> 7 + \
-					 (a.byte2 & 0x01) << 1)
-#define IEEE80211_TSINFO_AGG(a)		((a.byte2 & 0x02) >> 1)
-#define IEEE80211_TSINFO_APSD(a)	((a.byte2 & 0x04) >> 2)
-#define IEEE80211_TSINFO_UP(a)		((a.byte2 & 0x38) >> 3)
-#define IEEE80211_TSINFO_ACK(a)		((a.byte2 & 0xC0) >> 6)
-#define IEEE80211_TSINFO_SCHEDULE(a)	((a.byte3 & 0x01) >> 0)
-
-#define IEEE80211_SET_TSINFO_TYPE(i, d)		(i.byte1 |= (d << 0) & 0x01)
-#define IEEE80211_SET_TSINFO_TSID(i, d)		(i.byte1 |= (d << 1) & 0x1E)
-#define IEEE80211_SET_TSINFO_DIR(i, d)		(i.byte1 |= (d << 5) & 0x60)
-#define IEEE80211_SET_TSINFO_POLICY(i, d)	\
-do {						\
-						i.byte1 |= (d & 0x01) << 7; \
-						i.byte2 |= (d & 0x02) >> 1; \
-} while(0)
-#define IEEE80211_SET_TSINFO_AGG(i, d)		(i.byte2 |= (d << 1) & 0x02)
-#define IEEE80211_SET_TSINFO_APSD(i, d)		(i.byte2 |= (d << 2) & 0x04)
-#define IEEE80211_SET_TSINFO_UP(i, d)		(i.byte2 |= (d << 3) & 0x38)
-#define IEEE80211_SET_TSINFO_ACK(i, d)		(i.byte2 |= (d << 6) & 0xC0)
-#define IEEE80211_SET_TSINFO_SCHEDULE(i, d)	(i.byte3 |= (d << 0) & 0x01)
-
-struct ieee80211_ts_info {
-	u8 byte1;
-	u8 byte2;
-	u8 byte3;
-} __attribute__ ((packed));
-
-struct ieee80211_elem_tspec {
-	struct ieee80211_ts_info ts_info;
-	__le16 nominal_msdu_size;
-	__le16 max_msdu_size;
-	__le32 min_service_interval;
-	__le32 max_service_interval;
-	__le32 inactivity_interval;
-	__le32 suspension_interval;
-	__le32 service_start_time;
-	__le32 min_data_rate;
-	__le32 mean_data_rate;
-	__le32 peak_data_rate;
-	__le32 burst_size;
-	__le32 delay_bound;
-	__le32 min_phy_rate;
-	__le16 surplus_band_allow;
-	__le16 medium_time;
-} __attribute__ ((packed));
-
-
 struct ieee80211_mgmt {
 	__le16 frame_control;
 	__le16 duration;
@@ -243,51 +191,9 @@ struct ieee80211_mgmt {
 				struct {
 					u8 action_code;
 					u8 dialog_token;
-					u8 variable[0];
-				} __attribute__ ((packed)) addts_req;
-				struct {
-					u8 action_code;
-					u8 dialog_token;
-					__le16 status_code;
-					u8 variable[0];
-				} __attribute__ ((packed)) addts_resp;
-				struct {
-					u8 action_code;
-					struct ieee80211_ts_info ts_info;
-					__le16 reason_code;
-				} __attribute__ ((packed)) delts;
-				struct {
-					u8 action_code;
-					u8 dialog_token;
 					u8 status_code;
 					u8 variable[0];
 				} __attribute__ ((packed)) wme_action;
-				struct {
-					u8 action_code;
-					u8 dest[6];
-					u8 src[6];
-					__le16 capab_info;
-					__le16 timeout;
-					/* Followed by Supported Rates and
-					 * Extended Supported Rates */
-					u8 variable[0];
-				} __attribute__ ((packed)) dls_req;
-				struct {
-					u8 action_code;
-					__le16 status_code;
-					u8 dest[6];
-					u8 src[6];
-					/* Followed by Capability Information,
-					 * Supported Rates and Extended
-					 * Supported Rates */
-					u8 variable[0];
-				} __attribute__ ((packed)) dls_resp;
-				struct {
-					u8 action_code;
-					u8 dest[6];
-					u8 src[6];
-					__le16 reason_code;
-				} __attribute__ ((packed)) dls_teardown;
 				struct{
 					u8 action_code;
 					u8 element_id;
@@ -393,6 +299,8 @@ enum ieee80211_statuscode {
 	/* 802.11g */
 	WLAN_STATUS_ASSOC_DENIED_NOSHORTTIME = 25,
 	WLAN_STATUS_ASSOC_DENIED_NODSSSOFDM = 26,
+	/* 802.11e */
+	WLAN_STATUS_REQUEST_DECLINED = 37,
 	/* 802.11i */
 	WLAN_STATUS_INVALID_IE = 40,
 	WLAN_STATUS_INVALID_GROUP_CIPHER = 41,
@@ -401,18 +309,6 @@ enum ieee80211_statuscode {
 	WLAN_STATUS_UNSUPP_RSN_VERSION = 44,
 	WLAN_STATUS_INVALID_RSN_IE_CAP = 45,
 	WLAN_STATUS_CIPHER_SUITE_REJECTED = 46,
-	/* 802.11e */
-	WLAN_STATUS_UNSPECIFIED_QOS = 32,
-	WLAN_STATUS_ASSOC_DENIED_NOBANDWIDTH = 33,
-	WLAN_STATUS_ASSOC_DENIED_LOWACK = 34,
-	WLAN_STATUS_ASSOC_DENIED_UNSUPP_QOS = 35,
-	WLAN_STATUS_REQUEST_DECLINED = 37,
-	WLAN_STATUS_INVALID_QOS_PARAM = 38,
-	WLAN_STATUS_CHANGE_TSPEC = 39,
-	WLAN_STATUS_WAIT_TS_DELAY = 47,
-	WLAN_STATUS_NO_DIRECT_LINK = 48,
-	WLAN_STATUS_STA_NOT_PRESENT = 49,
-	WLAN_STATUS_STA_NOT_QSTA = 50,
 };
 
 
@@ -443,16 +339,6 @@ enum ieee80211_reasoncode {
 	WLAN_REASON_INVALID_RSN_IE_CAP = 22,
 	WLAN_REASON_IEEE8021X_FAILED = 23,
 	WLAN_REASON_CIPHER_SUITE_REJECTED = 24,
-	/* 802.11e */
-	WLAN_REASON_DISASSOC_UNSPECIFIED_QOS = 32,
-	WLAN_REASON_DISASSOC_QAP_NO_BANDWIDTH = 33,
-	WLAN_REASON_DISASSOC_LOW_ACK = 34,
-	WLAN_REASON_DISASSOC_QAP_EXCEED_TXOP = 35,
-	WLAN_REASON_QSTA_LEAVE_QBSS = 36,
-	WLAN_REASON_QSTA_NOT_USE = 37,
-	WLAN_REASON_QSTA_REQUIRE_SETUP = 38,
-	WLAN_REASON_QSTA_TIMEOUT = 39,
-	WLAN_REASON_QSTA_CIPHER_NOT_SUPP = 45,
 };
 
 
@@ -465,20 +351,6 @@ enum ieee80211_category {
 	WLAN_CATEGORY_WMM = 17,
 };
 
-/* QoS Action Code */
-enum ieee80211_qos_actioncode {
-	WLAN_ACTION_QOS_ADDTS_REQ = 0,
-	WLAN_ACTION_QOS_ADDTS_RESP = 1,
-	WLAN_ACTION_QOS_DELTS = 2,
-	WLAN_ACTION_QOS_SCHEDULE = 3,
-};
-
-/* DLS Action Code */
-enum ieee80211_dls_actioncode {
-	WLAN_ACTION_DLS_REQ = 0,
-	WLAN_ACTION_DLS_RESP = 1,
-	WLAN_ACTION_DLS_TEARDOWN = 2,
-};
 
 /* BACK Action Code */
 enum ieee80211_back_actioncode {
@@ -502,15 +374,6 @@ enum ieee80211_eid {
 	WLAN_EID_HP_PARAMS = 8,
 	WLAN_EID_HP_TABLE = 9,
 	WLAN_EID_REQUEST = 10,
-	/* 802.11e */
-	WLAN_EID_QBSS_LOAD = 11,
-	WLAN_EID_EDCA_PARAM_SET = 12,
-	WLAN_EID_TSPEC = 13,
-	WLAN_EID_TCLAS = 14,
-	WLAN_EID_SCHEDULE = 15,
-	WLAN_EID_TS_DELAY = 43,
-	WLAN_EID_TCLAS_PROCESSING = 44,
-	WLAN_EID_QOS_CAPA = 46,
 	/* 802.11h */
 	WLAN_EID_PWR_CONSTRAINT = 32,
 	WLAN_EID_PWR_CAPABILITY = 33,
@@ -549,39 +412,6 @@ enum ieee80211_eid {
 
 #define WLAN_MAX_KEY_LEN		32
 
-enum ieee80211_tsinfo_direction {
-	WLAN_TSINFO_UPLINK = 0,
-	WLAN_TSINFO_DOWNLINK = 1,
-	WLAN_TSINFO_DIRECTLINK = 2,
-	WLAN_TSINFO_BIDIRECTIONAL = 3,
-};
-
-enum ieee80211_tsinfo_access {
-	WLAN_TSINFO_EDCA = 1,
-	WLAN_TSINFO_HCCA = 2,
-	WLAN_TSINFO_HEMM = 3,
-};
-
-enum ieee80211_tsinfo_psb {
-	WLAN_TSINFO_PSB_LEGACY = 0,
-	WLAN_TSINFO_PSB_APSD = 1,
-};
-
-
-/* WI-FI Alliance OUI Type and Subtype */
-enum wifi_oui_type {
-	WIFI_OUI_TYPE_WPA = 1,
-	WIFI_OUI_TYPE_WMM = 2,
-	WIFI_OUI_TYPE_WSC = 4,
-	WIFI_OUI_TYPE_PSD = 6,
-};
-
-enum wifi_oui_stype_wmm {
-	WIFI_OUI_STYPE_WMM_INFO = 0,
-	WIFI_OUI_STYPE_WMM_PARAM = 1,
-	WIFI_OUI_STYPE_WMM_TSPEC = 2,
-};
-
 /**
  * ieee80211_get_SA - get pointer to SA
  *
net/mac80211/debugfs_netdev.c +0 -335

359 lines not on this page · raw message

net/mac80211/ieee80211_i.h +0 -90

138 lines not on this page · raw message

net/mac80211/ieee80211_iface.c +0 -16
@@ -184,10 +184,6 @@ void ieee80211_if_set_type(struct net_de
 			    (unsigned long) sdata);
 		skb_queue_head_init(&ifsta->skb_queue);
 
-		init_timer(&ifsta->admit_timer);
-		ifsta->admit_timer.data = (unsigned long) dev;
-		ifsta->admit_timer.function = ieee80211_admit_refresh;
-
 		ifsta->capab = WLAN_CAPABILITY_ESS;
 		ifsta->auth_algs = IEEE80211_AUTH_ALG_OPEN |
 			IEEE80211_AUTH_ALG_SHARED_KEY;
@@ -196,18 +192,6 @@ void ieee80211_if_set_type(struct net_de
 			IEEE80211_STA_AUTO_BSSID_SEL |
 			IEEE80211_STA_AUTO_CHANNEL_SEL;
 
-		/* Initialize non-AP QSTA QoS Params */
-		ifsta->dot11EDCAAveragingPeriod = 5;
-		ifsta->MPDUExchangeTime = 0;
-#ifdef CONFIG_MAC80211_DEBUGFS
-		ifsta->tspec.nominal_msdu_size = cpu_to_le16(200),
-		ifsta->tspec.inactivity_interval = cpu_to_le32(40),
-		ifsta->tspec.mean_data_rate = cpu_to_le32(40000),
-		ifsta->tspec.min_phy_rate = cpu_to_le32(6000000),
-		ifsta->tspec.surplus_band_allow = cpu_to_le16(8192),
-		ifsta->tspec.medium_time = cpu_to_le16(30),
-#endif
-
 		msdata = IEEE80211_DEV_TO_SUB_IF(sdata->local->mdev);
 		sdata->bss = &msdata->u.ap;
 		break;
net/mac80211/ieee80211.c +0 -1
@@ -467,7 +467,6 @@ static int ieee80211_stop(struct net_dev
 	case IEEE80211_IF_TYPE_IBSS:
 		sdata->u.sta.state = IEEE80211_DISABLED;
 		del_timer_sync(&sdata->u.sta.timer);
-		del_timer_sync(&sdata->u.sta.admit_timer);
 		/*
 		 * When we get here, the interface is marked down.
 		 * Call synchronize_rcu() to wait for the RX path
net/mac80211/ieee80211_sta.c +5 -777

849 lines not on this page · raw message

net/mac80211/sta_info.c +2 -28
@@ -32,7 +32,7 @@ static void sta_info_hash_add(struct iee
 
 /* Caller must hold local->sta_lock */
 static int sta_info_hash_del(struct ieee80211_local *local,
-			     struct sta_info *sta, int dls)
+			     struct sta_info *sta)
 {
 	struct sta_info *s;
 
@@ -40,8 +40,6 @@ static int sta_info_hash_del(struct ieee
 	if (!s)
 		return -ENOENT;
 	if (s == sta) {
-		if (dls && !(s->flags & WLAN_STA_DLS))
-			return -ENOENT;
 		local->sta_hash[STA_HASH(sta->addr)] = s->hnext;
 		return 0;
 	}
@@ -49,8 +47,6 @@ static int sta_info_hash_del(struct ieee
 	while (s->hnext && s->hnext != sta)
 		s = s->hnext;
 	if (s->hnext) {
-		if (dls && !(s->hnext->flags & WLAN_STA_DLS))
-			return -ENOENT;
 		s->hnext = sta->hnext;
 		return 0;
 	}
@@ -77,28 +73,6 @@ struct sta_info *sta_info_get(struct iee
 }
 EXPORT_SYMBOL(sta_info_get);
 
-struct sta_info *dls_info_get(struct ieee80211_local *local, u8 *addr)
-{
-	struct sta_info *sta;
-
-	read_lock_bh(&local->sta_lock);
-	sta = local->sta_hash[STA_HASH(addr)];
-	while (sta) {
-		if (memcmp(sta->addr, addr, ETH_ALEN) == 0) {
-			if (!(sta->flags & WLAN_STA_DLS)) {
-				sta = NULL;
-				break;
-			}
-			__sta_info_get(sta);
-			break;
-		}
-		sta = sta->hnext;
-	}
-	read_unlock_bh(&local->sta_lock);
-
-	return sta;
-}
-
 int sta_info_min_txrate_get(struct ieee80211_local *local)
 {
 	struct sta_info *sta;
@@ -211,7 +185,7 @@ void sta_info_remove(struct sta_info *st
 	struct ieee80211_sub_if_data *sdata;
 
 	/* don't do anything if we've been removed already */
-	if (sta_info_hash_del(local, sta, 0))
+	if (sta_info_hash_del(local, sta))
 		return;
 
 	list_del(&sta->list);
net/mac80211/sta_info.h +1 -8
@@ -29,7 +29,6 @@
  * @WLAN_STA_ASSOC_AP: STA is an AP we are associated with as a client
  * @WLAN_STA_WME: STA is QoS capable
  * @WLAN_STA_HT: STA is HT capable
- * @WLAN_STA_DLS: STA is a DLS peer
  * @WLAN_STA_WDS: STA is a WDS peer
  */
 enum sta_flags {
@@ -42,8 +41,7 @@ enum sta_flags {
 	WLAN_STA_ASSOC_AP	= 1<<6,
 	WLAN_STA_WME		= 1<<7,
 	WLAN_STA_HT		= 1<<8,
-	WLAN_STA_DLS		= 1<<9,
-	WLAN_STA_WDS		= 1<<10,
+	WLAN_STA_WDS		= 1<<9,
 };
 
 
@@ -107,11 +105,6 @@ struct sta_info {
 	int channel_use;
 	int channel_use_raw;
 
-#define DLS_STATUS_OK		0
-#define DLS_STATUS_NOLINK	1
-	int dls_status;
-	u32 dls_timeout;
-
 #ifdef CONFIG_HOSTAPD_WPA_TESTING
 	u32 wpa_trigger;
 #endif /* CONFIG_HOSTAPD_WPA_TESTING */
net/mac80211/tx.c +5 -12
@@ -1374,18 +1374,11 @@ int ieee80211_subif_start_xmit(struct sk
 		hdrlen = 30;
 		break;
 	case IEEE80211_IF_TYPE_STA:
-		if (dls_link_status(local, skb->data) == DLS_STATUS_OK) {
-			/* DA SA BSSID */
-			memcpy(hdr.addr1, skb->data, ETH_ALEN);
-			memcpy(hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN);
-			memcpy(hdr.addr3, sdata->u.sta.bssid, ETH_ALEN);
-		} else {
-			fc |= IEEE80211_FCTL_TODS;
-			/* BSSID SA DA */
-			memcpy(hdr.addr1, sdata->u.sta.bssid, ETH_ALEN);
-			memcpy(hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN);
-			memcpy(hdr.addr3, skb->data, ETH_ALEN);
-		}
+		fc |= IEEE80211_FCTL_TODS;
+		/* BSSID SA DA */
+		memcpy(hdr.addr1, sdata->u.sta.bssid, ETH_ALEN);
+		memcpy(hdr.addr2, skb->data + ETH_ALEN, ETH_ALEN);
+		memcpy(hdr.addr3, skb->data, ETH_ALEN);
 		hdrlen = 24;
 		break;
 	case IEEE80211_IF_TYPE_IBSS:
net/mac80211/wme.c +3 -30
@@ -94,13 +94,11 @@ static inline int wme_downgrade_ac(struc
 static inline int classify80211(struct sk_buff *skb, struct Qdisc *qd)
 {
 	struct ieee80211_local *local = wdev_priv(qd->dev->ieee80211_ptr);
-	struct ieee80211_sub_if_data *sdata = IEEE80211_DEV_TO_SUB_IF(qd->dev);
-	struct ieee80211_if_sta *ifsta = &sdata->u.sta;
 	struct ieee80211_tx_packet_data *pkt_data =
 		(struct ieee80211_tx_packet_data *) skb->cb;
 	struct ieee80211_hdr *hdr = (struct ieee80211_hdr *) skb->data;
 	unsigned short fc = le16_to_cpu(hdr->frame_control);
-	int qos, tsid, dir;
+	int qos;
 	const int ieee802_1d_to_ac[8] = { 2, 3, 3, 2, 1, 1, 0, 0 };
 
 	/* see if frame is data or non data frame */
@@ -127,36 +125,11 @@ static inline int classify80211(struct s
 	}
 
 	/* use the data classifier to determine what 802.1d tag the
-	 * data frame has */
+	* data frame has */
 	skb->priority = classify_1d(skb, qd);
-	tsid = 8 + skb->priority;
-
-	/* FIXME: only uplink needs to be checked for Tx */
-	dir = STA_TS_UPLINK;
-
-	if ((sdata->type == IEEE80211_IF_TYPE_STA) &&
-	    (local->wmm_acm & BIT(skb->priority))) {
-		switch (ifsta->ts_data[tsid][dir].status) {
-		case TS_STATUS_ACTIVE:
-			/* if TS Management is enabled, update used_time */
-			ifsta->ts_data[tsid][dir].used_time_usec +=
-				ifsta->MPDUExchangeTime;
-			break;
-		case TS_STATUS_THROTTLING:
-			/* if admitted time is used up, refuse to send more */
-			if (net_ratelimit())
-				printk(KERN_DEBUG "QoS packet throttling\n");
-			break;
-		default:
-			break;
-		}
-	}
 
 	/* in case we are a client verify acm is not set for this ac */
-	while ((local->wmm_acm & BIT(skb->priority)) &&
-	       !((sdata->type == IEEE80211_IF_TYPE_STA) &&
-		 (ifsta->ts_data[skb->priority + EDCA_TSID_MIN][dir].status
-			== TS_STATUS_ACTIVE))) {
+	while (unlikely(local->wmm_acm & BIT(skb->priority))) {
 		if (wme_downgrade_ac(skb)) {
 			/* No AC with lower priority has acm=0, drop packet. */
 			return -1;