Re: [PATCH] d80211: fix scan issues with new ops

2006-11-19 Thread David Kimdon
On Sun, Nov 19, 2006 at 01:21:13AM +0100, Johannes Berg wrote:
 If hardware shall do scanning, the hw_scan operation must be set. However,
 if the driver is for multiple cards that may or may not do hardware
 scanning, it'll need a flag.

What is wrong with the driver setting the function pointer to NULL for
the cards that do not support scanning?  Where does this requirment
come from that the function pointers in struct ieee80211_wiphy be
identical for all cards?

-David
-
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] d80211: fix scan issues with new ops

2006-11-19 Thread Michael Buesch
On Sunday 19 November 2006 01:21, Johannes Berg wrote:
 If hardware shall do scanning, the hw_scan operation must be set. However,
 if the driver is for multiple cards that may or may not do hardware
 scanning, it'll need a flag.
 
 Similar issues arise with passive_scan().
 
 This patch introduces flags to fix these issues.
 
 Signed-off-by: Johannes Berg [EMAIL PROTECTED]
 
 ---
 more fallout from my earlier patches... this time it's the scanning ops
 that were still used as flags as well as ops.
 
 --- wireless-dev.orig/include/net/d80211.h2006-11-19 01:08:12.439520302 
 +0100
 +++ wireless-dev/include/net/d80211.h 2006-11-19 01:14:14.859520302 +0100
 @@ -504,6 +504,12 @@ struct ieee80211_wiphy {
   /* do hardware fragmentation */
  #define IEEE80211_HW_FRAG (115)
  
 + /* hardware does scanning instead of software */
 +#define IEEE80211_HW_PASSIVE_SCAN (116)
 +
 + /* hardware does scanning instead of software */
 +#define IEEE80211_HW_SCAN (117)
 +
   u32 flags;  /* hardware flags defined above */
  
   /* Set to the size of a needed device specific skb headroom for TX 
 skbs. */
 @@ -627,7 +633,8 @@ struct ieee80211_ops {
  struct ieee80211_scan_conf *conf);
  
   /* Ask the hardware to service the scan request, no need to start
 -  * the scan state machine in stack. */
 +  * the scan state machine in stack.
 +  * This callback goes along with the IEEE80211_HW_SCAN flag */
   int (*hw_scan)(struct ieee80211_wiphy *wiphy, u8 *ssid,
  size_t len);
  
 --- wireless-dev.orig/net/d80211/ieee80211_sta.c  2006-11-19 
 01:07:49.509520302 +0100
 +++ wireless-dev/net/d80211/ieee80211_sta.c   2006-11-19 01:18:49.879520302 
 +0100
 @@ -2552,7 +2552,7 @@ int ieee80211_sta_req_scan(struct net_de
  
   printk(KERN_DEBUG %s: starting scan\n, dev-name);
  
 - if (local-ops-hw_scan) {
 + if (local-ops-hw_scan  local-wiphy.flags  IEEE80211_HW_SCAN) {

Please wrap this into ()

(Hm, actually, the compiler should complain on this...)

   int rc = local-ops-hw_scan(local_to_wiphy(local),
   ssid, ssid_len);
   if (!rc) {
 --- wireless-dev.orig/net/d80211/ieee80211_scan.c 2006-11-19 
 01:18:19.249520302 +0100
 +++ wireless-dev/net/d80211/ieee80211_scan.c  2006-11-19 01:18:22.599520302 
 +0100
 @@ -114,7 +114,8 @@ static void ieee80211_scan_start(struct 
   struct ieee80211_channel *chan = NULL;
   int ret;
  
 - if (!local-hw-passive_scan) {
 + if (!local-ops-passive_scan ||
 + !(local-wiphy.flags  IEEE80211_HW_PASSIVE_SCAN)) {
   printk(KERN_DEBUG %s: Scan handler called, yet the hardware 
  does not support passive scanning. Disabled.\n,
  local-mdev-name);
 
 
 

-- 
Greetings Michael.
-
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] d80211: fix scan issues with new ops

2006-11-19 Thread Johannes Berg
On Sun, 2006-11-19 at 07:56 -0800, David Kimdon wrote:

 What is wrong with the driver setting the function pointer to NULL for
 the cards that do not support scanning?  Where does this requirment
 come from that the function pointers in struct ieee80211_wiphy be
 identical for all cards?

Well I want to allow drivers to make assign the 33 function pointers in
a static structure, and differences between cards must then be handled
in the non-static part.

johannes


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


Re: [PATCH] d80211: fix scan issues with new ops

2006-11-19 Thread Johannes Berg
On Sun, 2006-11-19 at 17:15 +0100, Michael Buesch wrote:

  -   if (local-ops-hw_scan) {
  +   if (local-ops-hw_scan  local-wiphy.flags  IEEE80211_HW_SCAN) {
 
 Please wrap this into ()

Good point :)

johannes


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


Re: [PATCH] d80211: fix scan issues with new ops

2006-11-19 Thread David Kimdon
On Sun, Nov 19, 2006 at 05:34:49PM +0100, Johannes Berg wrote:
 On Sun, 2006-11-19 at 07:56 -0800, David Kimdon wrote:
 
  What is wrong with the driver setting the function pointer to NULL for
  the cards that do not support scanning?  Where does this requirment
  come from that the function pointers in struct ieee80211_wiphy be
  identical for all cards?
 
 Well I want to allow drivers to make assign the 33 function pointers in
 a static structure, and differences between cards must then be handled
 in the non-static part.

ok.  I am concerned that making this split between per driver and per
card is difficult to get right.  Setting or not setting a function
pointer for an operation is fairly standard practice and I don't see
the value in introducing yet another way to indicate support.

-David
-
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] d80211: fix scan issues with new ops

2006-11-19 Thread Johannes Berg
On Sun, 2006-11-19 at 08:55 -0800, David Kimdon wrote:

 ok.  I am concerned that making this split between per driver and per
 card is difficult to get right.  Setting or not setting a function
 pointer for an operation is fairly standard practice and I don't see
 the value in introducing yet another way to indicate support.

I guess we can punt this patch until some driver shows up that actually
has some cards that need the function and some that don't. I'm actually
guessing such a driver won't exist but wanted this for completeness in
the split between _wiphy and _ops.

johannes


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


Re: [PATCH] d80211: fix scan issues with new ops

2006-11-19 Thread David Kimdon
On Sun, Nov 19, 2006 at 05:57:39PM +0100, Johannes Berg wrote:
 On Sun, 2006-11-19 at 08:55 -0800, David Kimdon wrote:
 
  ok.  I am concerned that making this split between per driver and per
  card is difficult to get right.  Setting or not setting a function
  pointer for an operation is fairly standard practice and I don't see
  the value in introducing yet another way to indicate support.
 
 I guess we can punt this patch until some driver shows up that actually
 has some cards that need the function and some that don't. I'm actually
 guessing such a driver won't exist but wanted this for completeness in
 the split between _wiphy and _ops.

Perhaps that is a split that we do not need?  I don't see the problem
that 'd80211: split ieee80211_hw' is solving.  I do see what it is
doing, but maybe I am missing something . . .  

 
 johannes


-
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] d80211: fix scan issues with new ops

2006-11-19 Thread Johannes Berg
On Sun, 2006-11-19 at 09:25 -0800, David Kimdon wrote:

 Perhaps that is a split that we do not need?  I don't see the problem
 that 'd80211: split ieee80211_hw' is solving.  I do see what it is
 doing, but maybe I am missing something . . .  

Oh, I just figured that on 64-bit systems the _ops part is something
like 264 bytes that we needlessly allocate for every device when in
reality it doesn't really change between cards for a single driver.

johannes


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


[PATCH] d80211: fix scan issues with new ops

2006-11-18 Thread Johannes Berg
If hardware shall do scanning, the hw_scan operation must be set. However,
if the driver is for multiple cards that may or may not do hardware
scanning, it'll need a flag.

Similar issues arise with passive_scan().

This patch introduces flags to fix these issues.

Signed-off-by: Johannes Berg [EMAIL PROTECTED]

---
more fallout from my earlier patches... this time it's the scanning ops
that were still used as flags as well as ops.

--- wireless-dev.orig/include/net/d80211.h  2006-11-19 01:08:12.439520302 
+0100
+++ wireless-dev/include/net/d80211.h   2006-11-19 01:14:14.859520302 +0100
@@ -504,6 +504,12 @@ struct ieee80211_wiphy {
/* do hardware fragmentation */
 #define IEEE80211_HW_FRAG (115)
 
+   /* hardware does scanning instead of software */
+#define IEEE80211_HW_PASSIVE_SCAN (116)
+
+   /* hardware does scanning instead of software */
+#define IEEE80211_HW_SCAN (117)
+
u32 flags;  /* hardware flags defined above */
 
/* Set to the size of a needed device specific skb headroom for TX 
skbs. */
@@ -627,7 +633,8 @@ struct ieee80211_ops {
 struct ieee80211_scan_conf *conf);
 
/* Ask the hardware to service the scan request, no need to start
-* the scan state machine in stack. */
+* the scan state machine in stack.
+* This callback goes along with the IEEE80211_HW_SCAN flag */
int (*hw_scan)(struct ieee80211_wiphy *wiphy, u8 *ssid,
   size_t len);
 
--- wireless-dev.orig/net/d80211/ieee80211_sta.c2006-11-19 
01:07:49.509520302 +0100
+++ wireless-dev/net/d80211/ieee80211_sta.c 2006-11-19 01:18:49.879520302 
+0100
@@ -2552,7 +2552,7 @@ int ieee80211_sta_req_scan(struct net_de
 
printk(KERN_DEBUG %s: starting scan\n, dev-name);
 
-   if (local-ops-hw_scan) {
+   if (local-ops-hw_scan  local-wiphy.flags  IEEE80211_HW_SCAN) {
int rc = local-ops-hw_scan(local_to_wiphy(local),
ssid, ssid_len);
if (!rc) {
--- wireless-dev.orig/net/d80211/ieee80211_scan.c   2006-11-19 
01:18:19.249520302 +0100
+++ wireless-dev/net/d80211/ieee80211_scan.c2006-11-19 01:18:22.599520302 
+0100
@@ -114,7 +114,8 @@ static void ieee80211_scan_start(struct 
struct ieee80211_channel *chan = NULL;
int ret;
 
-   if (!local-hw-passive_scan) {
+   if (!local-ops-passive_scan ||
+   !(local-wiphy.flags  IEEE80211_HW_PASSIVE_SCAN)) {
printk(KERN_DEBUG %s: Scan handler called, yet the hardware 
   does not support passive scanning. Disabled.\n,
   local-mdev-name);


-
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