Skip to contentSkip to conversation

mac80211: debugfs support for TSM and DLS

PATCH In review Zhu Yi 2 participants 3 messages May 14, 2007 – May 24, 2007 mac80211

lore
Share & tools
lore

Zhu Yi

author
#0 lore raw

PATCH 3/3 mac80211: debugfs support for TSM and DLS

This patch adds the debugfs support for the TSM and DLS features. All the stuff will be in the new directory /sys/kernel/debug/ieee80211/phy0/netdev:wlan0/qos/ in STA mode.

--

net/mac80211/ieee80211_i.h +73 -0
index 8b939d0..c273afe 100644
@@ -59,6 +60,10 @@ struct ieee80211_local;
  * increased memory use (about 2 kB of RAM per entry). */
 #define IEEE80211_FRAGMENT_MAX 4
 
+/* Minimum and Maximum TSID used by EDCA. EDCA uses 0~7; HCCA uses 8~15 */
+#define EDCA_TSID_MIN 0
+#define EDCA_TSID_MAX 7
+
 struct ieee80211_fragment_entry {
 	unsigned long first_frag_time;
 	unsigned int seq;
@@ -178,6 +183,31 @@ struct ieee80211_tx_stored_packet {
 	unsigned int last_frag_rate_ctrl_probe:1;
 };
 
+struct sta_ts_data {
+	enum {
+		TS_STATUS_UNUSED	= 0,
+		TS_STATUS_ACTIVE	= 1,
+		TS_STATUS_INACTIVE	= 2,
+		TS_STATUS_THROTTLING	= 3,
+	} status;
+	u8 dialog_token;
+	u8 up;
+	u32 admitted_time_usec;
+	u32 used_time_usec;
+};
+
+#define DLS_STATUS_OK		0
+#define DLS_STATUS_NOLINK	1
+#define DLS_STATUS_SETUP	2
+struct dls_info {
+	atomic_t refcnt;
+	int status;
+	u8 addr[ETH_ALEN];
+	struct dls_info *hnext; /* next entry in hash table list */
+	u32 timeout;
+	u32 supp_rates;
+};
+
 typedef ieee80211_txrx_result (*ieee80211_tx_handler)
 (struct ieee80211_txrx_data *tx);
 
@@ -222,6 +252,7 @@ struct ieee80211_if_sta {
 	} state;
 	struct timer_list timer;
 	struct work_struct work;
+	struct timer_list admit_timer; /* Recompute EDCA admitted time */
 	u8 bssid[ETH_ALEN], prev_bssid[ETH_ALEN];
 	u8 ssid[IEEE80211_MAX_SSID_LEN];
 	size_t ssid_len;
@@ -271,6 +302,16 @@ struct ieee80211_if_sta {
 	u32 supp_rates_bits;
 
 	int wmm_last_param_set;
+
+	u32 dot11EDCAAveragingPeriod;
+	u32 MPDUExchangeTime;
+#define STA_TSID_NUM   16
+#define STA_TSDIR_NUM  2
+	/* EDCA: 0~7, HCCA: 8~15 */
+	struct sta_ts_data ts_data[STA_TSID_NUM][STA_TSDIR_NUM];
+
+	struct dls_info *dls_hash[STA_HASH_SIZE];
+	spinlock_t dls_lock;
 };
 
 
@@ -338,6 +379,39 @@ struct ieee80211_sub_if_data {
 			struct dentry *auth_alg;
 			struct dentry *auth_transaction;
 			struct dentry *flags;
+			struct dentry *qos_dir;
+			struct {
+				struct dentry *addts_11e;
+				struct dentry *addts_wmm;
+				struct dentry *delts_11e;
+				struct dentry *delts_wmm;
+				struct dentry *dls_mac;
+				struct dentry *dls_op;
+			} qos;
+			struct dentry *tsinfo_dir;
+			struct {
+				struct dentry *tsid;
+				struct dentry *direction;
+				struct dentry *up;
+			} tsinfo;
+			struct dentry *tspec_dir;
+			struct {
+				struct dentry *nominal_msdu_size;
+				struct dentry *max_msdu_size;
+				struct dentry *min_service_interval;
+				struct dentry *max_service_interval;
+				struct dentry *inactivity_interval;
+				struct dentry *suspension_interval;
+				struct dentry *service_start_time;
+				struct dentry *min_data_rate;
+				struct dentry *mean_data_rate;
+				struct dentry *peak_data_rate;
+				struct dentry *burst_size;
+				struct dentry *delay_bound;
+				struct dentry *min_phy_rate;
+				struct dentry *surplus_band_allow;
+				struct dentry *medium_time;
+			} tspec;
 		} sta;
 		struct {
 			struct dentry *channel_use;
net/mac80211/debugfs_netdev.c +343 -0

367 lines not on this page · raw message

#1 lore raw
Quoted 37 lines · Zhu Yi
net/mac80211/ieee80211_i.h +22 -0
index 8b939d0..c273afe 100644
@@ -59,6 +60,10 @@ struct ieee80211_local;
  * increased memory use (about 2 kB of RAM per entry). */
 #define IEEE80211_FRAGMENT_MAX 4
 
+/* Minimum and Maximum TSID used by EDCA. EDCA uses 0~7; HCCA uses 8~15 */
+#define EDCA_TSID_MIN 0
+#define EDCA_TSID_MAX 7
+
 struct ieee80211_fragment_entry {
 	unsigned long first_frag_time;
 	unsigned int seq;
@@ -178,6 +183,31 @@ struct ieee80211_tx_stored_packet {
 	unsigned int last_frag_rate_ctrl_probe:1;
 };
 
+struct sta_ts_data {
+	enum {
+		TS_STATUS_UNUSED	= 0,
+		TS_STATUS_ACTIVE	= 1,
+		TS_STATUS_INACTIVE	= 2,
+		TS_STATUS_THROTTLING	= 3,
+	} status;
+	u8 dialog_token;
+	u8 up;
+	u32 admitted_time_usec;
+	u32 used_time_usec;
+};
+
+#define DLS_STATUS_OK		0
+#define DLS_STATUS_NOLINK	1
+#define DLS_STATUS_SETUP	2
+struct dls_info {
+	atomic_t refcnt;

net/mac80211/ieee80211_i.h struct ieee80211_tx_stored_packet { · line 213

Quoted 10 lines
net/mac80211/ieee80211_i.h +7 -0
+	int status;
+	u8 addr[ETH_ALEN];
+	struct dls_info *hnext; /* next entry in hash table list */
+	u32 timeout;
+	u32 supp_rates;
+};
+
 typedef ieee80211_txrx_result (*ieee80211_tx_handler)
 (struct ieee80211_txrx_data *tx);
 

These chunks were present in the second patch of this series.

So, who is going to be responsible for configuring DLS and TS? If we're going to leave this policy up to userspace.. why not implement most of the DLS handshake/teardown code in wpa_supplicant directly? It would make the remaining DLS code in the kernel much more straightforward.

However, that's still more of an implementation detail. I'm curious about how DLS would actually get initiated and used if I am, for example, transferring a large file from one STA to another on the same AP. It seems like the sort of information needed to make this decision are similar to what is needed to decide when to set up BA.

-Michael Wu

author
#2 lore raw
Quoted 1 line · Michael Wu

These chunks were present in the second patch of this series.

Yup. Will remove.

Quoted 4 lines

So, who is going to be responsible for configuring DLS and TS? If we're going to leave this policy up to userspace.. why not implement most of the DLS handshake/teardown code in wpa_supplicant directly? It would make the remaining DLS code in the kernel much more straightforward.

Agreed. The end users should never use the debugfs stuff. These symbols are exported for debug and testing. I'd agree to move the policy things to wpa_supplicant.

Quoted 5 lines

However, that's still more of an implementation detail. I'm curious about how DLS would actually get initiated and used if I am, for example, transferring a large file from one STA to another on the same AP. It seems like the sort of information needed to make this decision are similar to what is needed to decide when to set up BA.

In the DLS request side, with this patch, you can setup the target MAC address via debugfs "dls_mac" and set 1 to "dls_op" (of course, these will be done by wpa_supplicant in the future). So that mac80211 will initiate DLS setup process. In the receiver side, currently, it accepts or denies the DLS request based on the debugfs "dls_op" value. In the future, the decision should be done by userspace via wpa_supplicant or cfg80211.

Thanks,
-yi