RE: [PATCH 6/6] d80211: add sysfs interface for QoS functions

2006-12-18 Thread Zhu Yi
On Thu, 2006-12-14 at 21:35 -0800, Simon Barber wrote:
 This is all part of the client MLME - it would be much better to add
 this functionality to wpa_supplicant, rather than adding it to the
 kernel. Nothing here needs to be in the kernel for any reason.

Theoretically, the whole network stack can be put into userspace. But we
gain performance and userspace tool independency from implementing it in
the kernel. Currently d80211 handles beacon, associate response and
other MLMEs, I see no reason why they need to be in the kernel according
to your point.

IMHO, for the MLME handling, if it involves policy or decision making
from the user, it should be done by the userspace, otherwise we
implement it in the kernel for better performance and userspace tool
independency.

Thanks,
-yi

 The client MLME functions that are in the kernel were put in there for
 test and debugging convenience only - the right client MLME to use is
 the one in wpa_supplicant. Especially with all the new and very
 complex
 MLME functions that are being added to 802.11 we do not want this huge
 amount of code in the kernel when it does not need to be there.
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 6/6] d80211: add sysfs interface for QoS functions

2006-12-14 Thread Jiri Benc
On Thu, 14 Dec 2006 12:03:02 +0800, Zhu Yi wrote:
 The sysfs interface here is only a proof of concept. It provides a way for
 the userspace applications to use the advanced QoS features supported by
 d80211 stack. The finial solution should be switched to cfg80211.

So... what about implementing that into cfg80211? :-)

I'm not inclined towards this patch (even if you address Stephen's
comment).

Thanks,

 Jiri

(Btw, it will take me some time to review patches 4 and 5.)

-- 
Jiri Benc
SUSE Labs
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: [PATCH 6/6] d80211: add sysfs interface for QoS functions

2006-12-14 Thread Johannes Berg
On Thu, 2006-12-14 at 12:23 +0100, Jiri Benc wrote:
 On Thu, 14 Dec 2006 12:03:02 +0800, Zhu Yi wrote:
  The sysfs interface here is only a proof of concept. It provides a way for
  the userspace applications to use the advanced QoS features supported by
  d80211 stack. The finial solution should be switched to cfg80211.
 
 So... what about implementing that into cfg80211? :-)

I agree, we should put this into cfg80211/nl80211 from the start. It's
not really hard to still have some things over WE and start using
cfg/nl80211 now.

johannes


signature.asc
Description: This is a digitally signed message part


Re: [PATCH 6/6] d80211: add sysfs interface for QoS functions

2006-12-14 Thread Zhu Yi
On Thu, 2006-12-14 at 12:23 +0100, Jiri Benc wrote:
 So... what about implementing that into cfg80211? :-)
 
 I'm not inclined towards this patch (even if you address Stephen's
 comment). 

OK. This is only for my testing (or maybe someone else wants to try the
code). I'm not asking to merge it. When all the other code is reviewed
and accepted, I will write a cfg80211 interface for it.

Thanks,
-yi
-
To unsubscribe from this list: send the line unsubscribe netdev in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: [PATCH 6/6] d80211: add sysfs interface for QoS functions

2006-12-14 Thread Simon Barber
This is all part of the client MLME - it would be much better to add
this functionality to wpa_supplicant, rather than adding it to the
kernel. Nothing here needs to be in the kernel for any reason.

The client MLME functions that are in the kernel were put in there for
test and debugging convenience only - the right client MLME to use is
the one in wpa_supplicant. Especially with all the new and very complex
MLME functions that are being added to 802.11 we do not want this huge
amount of code in the kernel when it does not need to be there.

The client MLME in the kernel should be #ifdefed out and made a kernel
option - off by default.

Simon
 

-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Zhu Yi
Sent: Wednesday, December 13, 2006 8:03 PM
To: netdev@vger.kernel.org
Subject: [PATCH 6/6] d80211: add sysfs interface for QoS functions

The sysfs interface here is only a proof of concept. It provides a way
for the userspace applications to use the advanced QoS features
supported by
d80211 stack. The finial solution should be switched to cfg80211.

Signed-off-by: Zhu Yi [EMAIL PROTECTED]

---

 net/d80211/ieee80211_i.h |   13 ++
 net/d80211/ieee80211_sysfs.c |  245
++
 2 files changed, 258 insertions(+), 0 deletions(-)

83d49f70af1f38c152d8bd3abd69756ec087622e
diff --git a/net/d80211/ieee80211_i.h b/net/d80211/ieee80211_i.h index
d09f65e..7904033 100644
--- a/net/d80211/ieee80211_i.h
+++ b/net/d80211/ieee80211_i.h
@@ -20,6 +20,7 @@
 #include linux/workqueue.h
 #include linux/types.h
 #include linux/spinlock.h
+#include net/d80211_mgmt.h
 #include ieee80211_key.h
 #include sta_info.h
 
@@ -329,6 +330,7 @@ struct ieee80211_sub_if_data {
 int channel_use_raw;
 
struct attribute_group *sysfs_group;
+   struct attribute_group *sysfs_qos_group;
 };
 
 #define IEEE80211_DEV_TO_SUB_IF(dev) netdev_priv(dev) @@ -702,6 +704,17
@@ struct sta_info * ieee80211_ibss_add_sta
 u8 *addr);
 int ieee80211_sta_deauthenticate(struct net_device *dev, u16 reason);
int ieee80211_sta_disassociate(struct net_device *dev, u16 reason);
+void ieee80211_send_addts(struct net_device *dev,
+ struct ieee802_11_elem_tspec *tspec); void
wmm_send_addts(struct 
+net_device *dev,
+   struct ieee802_11_elem_tspec *tspec); void 
+ieee80211_send_delts(struct net_device *dev, u8 tsid, u8 direction,
+ u32 medium_time);
+void wmm_send_delts(struct net_device *dev, u8 tsid, u8 direction,
+   u32 medium_time);
+void ieee80211_send_dls_req(struct net_device *dev, struct dls_info 
+*dls); void ieee80211_send_dls_teardown(struct net_device *dev, u8 
+*mac, u16 reason); void dls_info_add(struct ieee80211_local *local, 
+struct dls_info *dls);
 void dls_info_stop(struct ieee80211_local *local);  int
dls_link_status(struct ieee80211_local *local, u8 *addr);
 
diff --git a/net/d80211/ieee80211_sysfs.c b/net/d80211/ieee80211_sysfs.c
index 6a60077..31dc1f4 100644
--- a/net/d80211/ieee80211_sysfs.c
+++ b/net/d80211/ieee80211_sysfs.c
@@ -13,6 +13,7 @@
 #include linux/netdevice.h
 #include linux/rtnetlink.h
 #include net/d80211.h
+#include net/d80211_mgmt.h
 #include ieee80211_i.h
 #include ieee80211_rate.h
 
@@ -21,6 +22,15 @@
 #define to_net_dev(class) \
container_of(class, struct net_device, class_dev)
 
+/* For sysfs and debug only */
+static struct ieee802_11_elem_tspec _tspec; static u8 
+_dls_mac[ETH_ALEN];
+
+#define TSID _tspec.ts_info.tsid
+#define TSDIR _tspec.ts_info.direction
+#define TSUP _tspec.ts_info.up
+
+
 static inline int rtnl_lock_local(struct ieee80211_local *local)  {
rtnl_lock();
@@ -657,6 +667,230 @@ static struct class ieee80211_class = {  #endif
};
 
+
+/* QoS sysfs entries */
+static ssize_t show_ts_info(struct class_device *dev, char *buf) {
+   /* TSID, Direction, UP */
+   return sprintf(buf, %u %u %u\n, TSID, TSDIR, TSUP); }
+
+static ssize_t store_ts_info(struct class_device *dev, const char *buf,
+size_t len)
+{
+   unsigned int id, index, up;
+
+   if (sscanf(buf, %u, %u, %u, id, index, up) != 3) {
+   printk(KERN_ERR %s: sscanf error\n, __FUNCTION__);
+   return -EINVAL;
+   }
+   if (id  8 || id  15) {
+   printk(KERN_ERR invalid tsid %d\n, id);
+   return -EINVAL;
+   }
+   if ((index != 0)  (index != 1)  (index != 3)) {
+   printk(KERN_ERR invalid direction %d\n, index);
+   return -EINVAL;
+   }
+   if (up  0 || up  7) {
+   printk(KERN_ERR invalid UP %d\n, up);
+   return -EINVAL;
+   }
+   TSID = id;
+   TSDIR = index;
+   TSUP = up;
+   return len;
+}
+
+static CLASS_DEVICE_ATTR(ts_info, S_IWUSR|S_IRUGO, show_ts_info, 
+store_ts_info);
+
+static ssize_t show_tspec(struct class_device *dev, char *buf) {
+