Re: [PATCH wireless-dev] d80211: Don't discriminate against 802.11b drivers

2006-05-19 Thread John W. Linville
On Mon, May 15, 2006 at 01:19:23PM -0400, Michael Wu wrote:
 On Monday 15 May 2006 07:37, Jiri Benc wrote:
  This issue can be easily solved by not masking hw_modes by
  valid_hw_modes in ieee80211_ioctl_prism2_param and
  ieee80211_precalc_modes. Just check (hw_modes  valid_hw_modes) instead
  of hw_modes in ieee80211_sta_scan_timer.
 
  And yes, hw_modes is a confusing name. It should be named
  hw_modes_mask_disabled_by_user or so. Maybe at least some better comment
  about this in ieee80211_i.h won't be a bad idea.
 
 Okay, how about this? Instead of adding valid_hw_modes, I added 
 enabled_modes, 
 and replaced all instances of local-hw_modes with local-enabled_modes. 
 local-hw_modes now really means what modes are supported by the hardware.

Are we satisfied w/ this patch?  If so, please repost the patch after
cleaning-up the changelog according to the rules here:

http://linux.yyz.us/patch-format.html

Thanks,

John
-- 
John W. Linville
[EMAIL PROTECTED]
-
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 wireless-dev] d80211: Don't discriminate against 802.11b drivers

2006-05-19 Thread Michael Wu
On Friday 19 May 2006 14:06, John W. Linville wrote:
 Are we satisfied w/ this patch?  If so, please repost the patch after
 cleaning-up the changelog according to the rules here:

   http://linux.yyz.us/patch-format.html

I was going to after getting a response, but Jiri Benc already pulled it into 
his dscape tree and cleaned up the changelog, so I assumed that was enough. 
I'll repost if needed.

-Michael Wu
-
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 wireless-dev] d80211: Don't discriminate against 802.11b drivers

2006-05-19 Thread John W. Linville
On Fri, May 19, 2006 at 03:03:11PM -0400, Michael Wu wrote:
 On Friday 19 May 2006 14:06, John W. Linville wrote:
  Are we satisfied w/ this patch?  If so, please repost the patch after
  cleaning-up the changelog according to the rules here:
 
  http://linux.yyz.us/patch-format.html
 
 I was going to after getting a response, but Jiri Benc already pulled it into 
 his dscape tree and cleaned up the changelog, so I assumed that was enough. 
 I'll repost if needed.

I'm happy to take patches from Jiri (or pull from Jiri's tree).

Jiri, I'll count on you to pass this on when you are ready.

John
-- 
John W. Linville
[EMAIL PROTECTED]
-
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 wireless-dev] d80211: Don't discriminate against 802.11b drivers

2006-05-15 Thread Jiri Benc
On Fri, 12 May 2006 16:35:27 -0400, Michael Wu wrote:
 Hm, so why not add something that will tell you what modes are supported by 
 the hardware?

Sounds reasonable.

 Only problem with this patch is if the hardware adds any modes after 
 registration, they will be disabled initially. Hopefully, no drivers will 
 actually need to do that.

bcm43xx does that. If I understand it correctly, bcm43xx driver doesn't
know allowed modes until it loads firmware. And the firmware is not
loaded until the device is opened (they probably have a reason for
this).

This issue can be easily solved by not masking hw_modes by
valid_hw_modes in ieee80211_ioctl_prism2_param and
ieee80211_precalc_modes. Just check (hw_modes  valid_hw_modes) instead
of hw_modes in ieee80211_sta_scan_timer.

And yes, hw_modes is a confusing name. It should be named
hw_modes_mask_disabled_by_user or so. Maybe at least some better comment
about this in ieee80211_i.h won't be a bad idea.

Thanks,

 Jiri

-- 
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 wireless-dev] d80211: Don't discriminate against 802.11b drivers

2006-05-15 Thread Johannes Berg
On Mon, 2006-05-15 at 13:37 +0200, Jiri Benc wrote:
 
 bcm43xx does that. If I understand it correctly, bcm43xx driver doesn't
 know allowed modes until it loads firmware. And the firmware is not
 loaded until the device is opened (they probably have a reason for
 this). 

No, that's not right, the firmware has nothing to do with it. At least
not that we know of, so we treat it as all doing the same :)

johannes


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


Re: [PATCH wireless-dev] d80211: Don't discriminate against 802.11b drivers

2006-05-15 Thread Jiri Benc
[removed some people from Cc: list as this is probably not much
interesting for them]

On Mon, 15 May 2006 14:04:44 +0200, Johannes Berg wrote:
 On Mon, 2006-05-15 at 13:37 +0200, Jiri Benc wrote:
  bcm43xx does that. If I understand it correctly, bcm43xx driver doesn't
  know allowed modes until it loads firmware. And the firmware is not
  loaded until the device is opened (they probably have a reason for
  this). 
 
 No, that's not right, the firmware has nothing to do with it. At least
 not that we know of, so we treat it as all doing the same :)

Hm, so your calls to ieee80211_update_hw are probably unnecessary.
Anyway, I'm still inclined towards not masking hw_modes by
valid_hw_modes.

 Jiri

-- 
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 wireless-dev] d80211: Don't discriminate against 802.11b drivers

2006-05-15 Thread Michael Buesch
On Monday 15 May 2006 15:35, you wrote:
 [removed some people from Cc: list as this is probably not much
 interesting for them]

 On Mon, 15 May 2006 14:04:44 +0200, Johannes Berg wrote:
  On Mon, 2006-05-15 at 13:37 +0200, Jiri Benc wrote:
   bcm43xx does that. If I understand it correctly, bcm43xx driver doesn't
   know allowed modes until it loads firmware. And the firmware is not
   loaded until the device is opened (they probably have a reason for
   this).
 
  No, that's not right, the firmware has nothing to do with it. At least
  not that we know of, so we treat it as all doing the same :)

 Hm, so your calls to ieee80211_update_hw are probably unnecessary.

No, We must allocate the ieee80211_hw, before we can attach the board.
But before we attached the board, we don't know what hardware it is.
Sure, this can be worked around by some very ugly hack (It was done
in an early version of the dscape port, because there was no 
ieee80211_update_hw), but I am not very happy to add the hack again.
(I am not sure anymore _what_ we actually did to workaround it. I would
have to look up the SVN repository ;) )
-
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 wireless-dev] d80211: Don't discriminate against 802.11b drivers

2006-05-15 Thread Jiri Benc
On Mon, 15 May 2006 16:01:48 +0200, Michael Buesch wrote:
 No, We must allocate the ieee80211_hw, before we can attach the board.
 But before we attached the board, we don't know what hardware it is.
 Sure, this can be worked around by some very ugly hack (It was done
 in an early version of the dscape port, because there was no 
 ieee80211_update_hw), but I am not very happy to add the hack again.
 (I am not sure anymore _what_ we actually did to workaround it. I would
 have to look up the SVN repository ;) )

Isn't it possible to do attaching of the board between
ieee80211_alloc_hw and ieee80211_register_hw calls? You don't need to
call ieee80211_update_hw then.

Anyway, the ieee80211_update_hw function is here for a reason (solving
issues with a firmware primarily, but not exclusively), so use it if it
is easier for you.

 Jiri

-- 
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 wireless-dev] d80211: Don't discriminate against 802.11b drivers

2006-05-15 Thread Michael Wu
On Monday 15 May 2006 07:37, Jiri Benc wrote:
 This issue can be easily solved by not masking hw_modes by
 valid_hw_modes in ieee80211_ioctl_prism2_param and
 ieee80211_precalc_modes. Just check (hw_modes  valid_hw_modes) instead
 of hw_modes in ieee80211_sta_scan_timer.

 And yes, hw_modes is a confusing name. It should be named
 hw_modes_mask_disabled_by_user or so. Maybe at least some better comment
 about this in ieee80211_i.h won't be a bad idea.

Okay, how about this? Instead of adding valid_hw_modes, I added enabled_modes, 
and replaced all instances of local-hw_modes with local-enabled_modes. 
local-hw_modes now really means what modes are supported by the hardware.

Signed-off-by: Michael Wu [EMAIL PROTECTED]

diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c
index ffb7985..135db24 100644
--- a/net/d80211/ieee80211.c
+++ b/net/d80211/ieee80211.c
@@ -3999,14 +3999,17 @@ void ieee80211_if_setup(struct net_devic
 }
 
 
-static void ieee80211_precalc_rates(struct ieee80211_hw *hw)
+static void ieee80211_precalc_modes(struct ieee80211_hw *hw,
+   struct ieee80211_local *local)
 {
struct ieee80211_hw_modes *mode;
struct ieee80211_rate *rate;
int m, r;
 
+   local-hw_modes = 0;
for (m = 0; m  hw-num_modes; m++) {
mode = hw-modes[m];
+   local-hw_modes |= 1  mode-mode;
for (r = 0; r  mode-num_rates; r++) {
rate = mode-rates[r];
rate-rate_inv = CHAN_UTIL_RATE_LCM / rate-rate;
@@ -4087,7 +4090,7 @@ struct net_device *ieee80211_alloc_hw(si
local-rate_ctrl_num_down = RATE_CONTROL_NUM_DOWN;
 
 local-scan.in_scan = 0;
-   local-hw_modes = (unsigned int) -1;
+   local-enabled_modes = (unsigned int) -1;
 
 init_timer(local-scan.timer); /* clear it out */
 
@@ -4257,7 +4260,7 @@ int ieee80211_update_hw(struct net_devic
!hw-modes-num_channels || !hw-modes-num_rates)
return -1;
 
-   ieee80211_precalc_rates(hw);
+   ieee80211_precalc_modes(hw, local);
local-conf.phymode = hw-modes[0].mode;
local-curr_rates = hw-modes[0].rates;
local-num_curr_rates = hw-modes[0].num_rates;
diff --git a/net/d80211/ieee80211_i.h b/net/d80211/ieee80211_i.h
index ee0b399..595f6b1 100644
--- a/net/d80211/ieee80211_i.h
+++ b/net/d80211/ieee80211_i.h
@@ -409,7 +409,6 @@ #define IEEE80211_IRQSAFE_QUEUE_LIMIT 12
int scan_oper_antenna_max;
u8 scan_ssid[IEEE80211_MAX_SSID_LEN];
size_t scan_ssid_len;
-   int scan_skip_11b;
struct list_head sta_bss_list;
struct ieee80211_sta_bss *sta_bss_hash[STA_HASH_SIZE];
spinlock_t sta_bss_lock;
@@ -500,7 +499,9 @@ #endif /* CONFIG_D80211_DEBUG_COUNTERS *
int wifi_wme_noack_test;
unsigned int wmm_acm; /* bit field of ACM bits (BIT(802.1D tag)) */
 
-   unsigned int hw_modes; /* bitfield of allowed hardware modes;
+   unsigned int enabled_modes; /* bitfield of allowed modes;
+ * (1  MODE_*) */
+   unsigned int hw_modes; /* bitfield of supported hardware modes;
* (1  MODE_*) */
 };
 
diff --git a/net/d80211/ieee80211_ioctl.c b/net/d80211/ieee80211_ioctl.c
index 5d31a8f..04df0a9 100644
--- a/net/d80211/ieee80211_ioctl.c
+++ b/net/d80211/ieee80211_ioctl.c
@@ -1699,7 +1699,7 @@ int ieee80211_ioctl_siwfreq(struct net_d
if (chan-flag  IEEE80211_CHAN_W_SCAN 
((freq-e == 0  chan-chan == freq-m) ||
 (freq-e  0  nfreq == chan-freq)) 
-   (local-hw_modes  (1  mode-mode))) {
+   (local-enabled_modes  (1  mode-mode))) {
/* Use next_mode as the mode preference to
 * resolve non-unique channel numbers. */
if (set  mode-mode != local-next_mode)
@@ -2447,7 +2447,7 @@ static int ieee80211_ioctl_prism2_param(
break;
 
case PRISM2_PARAM_HW_MODES:
-   local-hw_modes = value;
+   local-enabled_modes = value;
break;
 
case PRISM2_PARAM_CREATE_IBSS:
@@ -2620,7 +2620,7 @@ static int ieee80211_ioctl_get_prism2_pa
break;
 
case PRISM2_PARAM_HW_MODES:
-   *param = local-hw_modes;
+   *param = local-enabled_modes;
break;
 
case PRISM2_PARAM_CREATE_IBSS:
diff --git a/net/d80211/ieee80211_sta.c b/net/d80211/ieee80211_sta.c
index 2720f1d..af58013 100644
--- a/net/d80211/ieee80211_sta.c
+++ b/net/d80211/ieee80211_sta.c
@@ -2462,13 +2462,13 @@ static void ieee80211_sta_scan_timer(uns
}
return;
}
-   skip = !(local-hw_modes  (1  mode-mode));
+   skip = !(local-enabled_modes  (1  mode-mode));
  

Re: [PATCH wireless-dev] d80211: Don't discriminate against 802.11b drivers

2006-05-12 Thread Jiri Benc
On Wed, 10 May 2006 13:31:39 -0400, Michael Wu wrote:
 I think this is overkill to fix a hack. IMHO, scan_skip_11b shouldn't exist 
 in 
 the first place. One alternative would be to modify 802.11g drivers to not 
 set IEEE80211_CHAN_W_SCAN on 802.11b channels when there are equivalent 
 802.11g channels.

This won't work when 11g is administratively disabled. We can surely add
another flags; but I'm not sure if it is really desirable to require
drivers to be aware of this when it is easily determinable by the stack.

 It seems like hw_modes is more useful for saying 
 what modes shouldn't be used than saying what modes are supported by the 
 hardware and should be used.

This is exactly the purpose of hw_modes. This also means you don't need
any validation.

 Jiri

-- 
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 wireless-dev] d80211: Don't discriminate against 802.11b drivers

2006-05-12 Thread Michael Wu
On Friday 12 May 2006 06:47, you wrote:
  It seems like hw_modes is more useful for saying
  what modes shouldn't be used than saying what modes are supported by the
  hardware and should be used.

 This is exactly the purpose of hw_modes. This also means you don't need
 any validation.

Hm, so why not add something that will tell you what modes are supported by 
the hardware?

Only problem with this patch is if the hardware adds any modes after 
registration, they will be disabled initially. Hopefully, no drivers will 
actually need to do that.

Signed-off-by: Michael Wu [EMAIL PROTECTED]

diff --git a/net/d80211/ieee80211.c b/net/d80211/ieee80211.c
index ffb7985..e110237 100644
--- a/net/d80211/ieee80211.c
+++ b/net/d80211/ieee80211.c
@@ -3999,19 +3999,24 @@ void ieee80211_if_setup(struct net_devic
 }
 
 
-static void ieee80211_precalc_rates(struct ieee80211_hw *hw)
+static void ieee80211_precalc_modes(struct ieee80211_hw *hw,
+   struct ieee80211_local *local)
 {
struct ieee80211_hw_modes *mode;
struct ieee80211_rate *rate;
int m, r;
 
+   local-valid_hw_modes = 0;
for (m = 0; m  hw-num_modes; m++) {
mode = hw-modes[m];
+   local-valid_hw_modes |= 1  mode-mode;
for (r = 0; r  mode-num_rates; r++) {
rate = mode-rates[r];
rate-rate_inv = CHAN_UTIL_RATE_LCM / rate-rate;
}
}
+
+   local-hw_modes = local-valid_hw_modes;
 }
 
 
@@ -4257,7 +4262,7 @@ int ieee80211_update_hw(struct net_devic
!hw-modes-num_channels || !hw-modes-num_rates)
return -1;
 
-   ieee80211_precalc_rates(hw);
+   ieee80211_precalc_modes(hw, local);
local-conf.phymode = hw-modes[0].mode;
local-curr_rates = hw-modes[0].rates;
local-num_curr_rates = hw-modes[0].num_rates;
diff --git a/net/d80211/ieee80211_i.h b/net/d80211/ieee80211_i.h
index ee0b399..6f33a75 100644
--- a/net/d80211/ieee80211_i.h
+++ b/net/d80211/ieee80211_i.h
@@ -409,7 +409,6 @@ #define IEEE80211_IRQSAFE_QUEUE_LIMIT 12
int scan_oper_antenna_max;
u8 scan_ssid[IEEE80211_MAX_SSID_LEN];
size_t scan_ssid_len;
-   int scan_skip_11b;
struct list_head sta_bss_list;
struct ieee80211_sta_bss *sta_bss_hash[STA_HASH_SIZE];
spinlock_t sta_bss_lock;
@@ -500,6 +499,8 @@ #endif /* CONFIG_D80211_DEBUG_COUNTERS *
int wifi_wme_noack_test;
unsigned int wmm_acm; /* bit field of ACM bits (BIT(802.1D tag)) */
 
+   unsigned int valid_hw_modes; /* bitfield of supported hardware modes;
+ * (1  MODE_*) */
unsigned int hw_modes; /* bitfield of allowed hardware modes;
* (1  MODE_*) */
 };
diff --git a/net/d80211/ieee80211_ioctl.c b/net/d80211/ieee80211_ioctl.c
index 5d31a8f..89db144 100644
--- a/net/d80211/ieee80211_ioctl.c
+++ b/net/d80211/ieee80211_ioctl.c
@@ -2447,7 +2447,7 @@ static int ieee80211_ioctl_prism2_param(
break;
 
case PRISM2_PARAM_HW_MODES:
-   local-hw_modes = value;
+   local-hw_modes = value  local-valid_hw_modes;
break;
 
case PRISM2_PARAM_CREATE_IBSS:
diff --git a/net/d80211/ieee80211_sta.c b/net/d80211/ieee80211_sta.c
index 2720f1d..7955767 100644
--- a/net/d80211/ieee80211_sta.c
+++ b/net/d80211/ieee80211_sta.c
@@ -2468,7 +2468,7 @@ static void ieee80211_sta_scan_timer(uns
(sdata-type == IEEE80211_IF_TYPE_IBSS 
 !(chan-flag  IEEE80211_CHAN_W_IBSS)) ||
(local-hw_modes  (1  MODE_IEEE80211G) 
-mode-mode == MODE_IEEE80211B  local-scan_skip_11b))
+mode-mode == MODE_IEEE80211B))
skip = 1;
 
if (!skip) {
@@ -2566,7 +2566,6 @@ int ieee80211_sta_req_scan(struct net_de
memcpy(local-scan_ssid, ssid, ssid_len);
} else
local-scan_ssid_len = 0;
-   local-scan_skip_11b = 1; /* FIX: clear this is 11g is not supported */
local-scan_state = SCAN_SET_CHANNEL;
local-scan_hw_mode_idx = 0;
local-scan_channel_idx = 0;
-
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 wireless-dev] d80211: Don't discriminate against 802.11b drivers

2006-05-11 Thread Jiri Benc
On Thu, 4 May 2006 22:32:35 -0400, Michael Wu wrote:
 This makes the current hack used to prevent 802.11g cards from scanning with 
 802.11b channels not break scanning in 802.11b drivers.

I think this should be better:

Signed-off-by: Jiri Benc [EMAIL PROTECTED]

---

 net/d80211/ieee80211.c |   14 ++
 net/d80211/ieee80211_sta.c |1 -
 2 files changed, 14 insertions(+), 1 deletion(-)

--- dscape.orig/net/d80211/ieee80211.c
+++ dscape/net/d80211/ieee80211.c
@@ -4014,6 +4014,19 @@ static void ieee80211_precalc_rates(stru
}
 }
 
+static inline void ieee80211_apply_modes(struct ieee80211_hw *hw,
+struct ieee80211_local *local)
+{
+   struct ieee80211_hw_modes *mode;
+   int i;
+
+   local-scan_skip_11b = 0;
+   for (i = 0; i  hw-num_modes; i++) {
+   mode = hw-modes[i];
+   if (mode-mode == MODE_IEEE80211G)
+   local-scan_skip_11b = 1;
+   }
+}
 
 struct net_device *ieee80211_alloc_hw(size_t priv_data_len,
  void (*setup)(struct net_device *))
@@ -4258,6 +4271,7 @@ int ieee80211_update_hw(struct net_devic
return -1;
 
ieee80211_precalc_rates(hw);
+   ieee80211_apply_modes(hw, local);
local-conf.phymode = hw-modes[0].mode;
local-curr_rates = hw-modes[0].rates;
local-num_curr_rates = hw-modes[0].num_rates;
--- dscape.orig/net/d80211/ieee80211_sta.c
+++ dscape/net/d80211/ieee80211_sta.c
@@ -2566,7 +2566,6 @@ int ieee80211_sta_req_scan(struct net_de
memcpy(local-scan_ssid, ssid, ssid_len);
} else
local-scan_ssid_len = 0;
-   local-scan_skip_11b = 1; /* FIX: clear this is 11g is not supported */
local-scan_state = SCAN_SET_CHANNEL;
local-scan_hw_mode_idx = 0;
local-scan_channel_idx = 0;


-- 
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 wireless-dev] d80211: Don't discriminate against 802.11b drivers

2006-05-11 Thread Michael Buesch
On Thursday 11 May 2006 17:54, you wrote:
 On Thu, 4 May 2006 22:32:35 -0400, Michael Wu wrote:
  This makes the current hack used to prevent 802.11g cards from scanning 
  with 
  802.11b channels not break scanning in 802.11b drivers.
 
 I think this should be better:
 
 Signed-off-by: Jiri Benc [EMAIL PROTECTED]
 
 ---
 
  net/d80211/ieee80211.c |   14 ++
  net/d80211/ieee80211_sta.c |1 -
  2 files changed, 14 insertions(+), 1 deletion(-)
 
 --- dscape.orig/net/d80211/ieee80211.c
 +++ dscape/net/d80211/ieee80211.c
 @@ -4014,6 +4014,19 @@ static void ieee80211_precalc_rates(stru
   }
  }
  
 +static inline void ieee80211_apply_modes(struct ieee80211_hw *hw,
 +  struct ieee80211_local *local)

Just a minor nitpick, but please remove the inline.
This is a candidate for binary bloat, if it is called later
on another place, too, and modern compilers will inline it anyway, if
only used once.
Additionally it is not a hotpath.

 +{
 + struct ieee80211_hw_modes *mode;
 + int i;
 +
 + local-scan_skip_11b = 0;
 + for (i = 0; i  hw-num_modes; i++) {
 + mode = hw-modes[i];
 + if (mode-mode == MODE_IEEE80211G)
 + local-scan_skip_11b = 1;
 + }
 +}
  
  struct net_device *ieee80211_alloc_hw(size_t priv_data_len,
 void (*setup)(struct net_device *))
 @@ -4258,6 +4271,7 @@ int ieee80211_update_hw(struct net_devic
   return -1;
  
   ieee80211_precalc_rates(hw);
 + ieee80211_apply_modes(hw, local);
   local-conf.phymode = hw-modes[0].mode;
   local-curr_rates = hw-modes[0].rates;
   local-num_curr_rates = hw-modes[0].num_rates;
 --- dscape.orig/net/d80211/ieee80211_sta.c
 +++ dscape/net/d80211/ieee80211_sta.c
 @@ -2566,7 +2566,6 @@ int ieee80211_sta_req_scan(struct net_de
   memcpy(local-scan_ssid, ssid, ssid_len);
   } else
   local-scan_ssid_len = 0;
 - local-scan_skip_11b = 1; /* FIX: clear this is 11g is not supported */
   local-scan_state = SCAN_SET_CHANNEL;
   local-scan_hw_mode_idx = 0;
   local-scan_channel_idx = 0;
 
 

-- 
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 wireless-dev] d80211: Don't discriminate against 802.11b drivers

2006-05-11 Thread Michael Wu
On Thursday 11 May 2006 11:54, Jiri Benc wrote:
 On Thu, 4 May 2006 22:32:35 -0400, Michael Wu wrote:
  This makes the current hack used to prevent 802.11g cards from scanning
  with 802.11b channels not break scanning in 802.11b drivers.

 I think this should be better:

I think this is overkill to fix a hack. IMHO, scan_skip_11b shouldn't exist in 
the first place. One alternative would be to modify 802.11g drivers to not 
set IEEE80211_CHAN_W_SCAN on 802.11b channels when there are equivalent 
802.11g channels. Another would be to set the local-hw_modes bitfield 
correctly during driver initialization instead of relying on userspace to set 
it, so the existing logic for avoiding 802.11b channels when 802.11g is 
supported actually works.

Hmm... that ioctl for changing the hw_modes bitfield doesn't seem too good.. 
No validity checking at all .. but then again, the current value of hw_modes 
isn't valid to begin with. It seems like hw_modes is more useful for saying 
what modes shouldn't be used than saying what modes are supported by the 
hardware and should be used.

-Michael Wu
-
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


[PATCH wireless-dev] d80211: Don't discriminate against 802.11b drivers

2006-05-04 Thread Michael Wu
This makes the current hack used to prevent 802.11g cards from scanning with 
802.11b channels not break scanning in 802.11b drivers.

Signed-off-by: Michael Wu [EMAIL PROTECTED]

diff --git a/net/d80211/ieee80211_sta.c b/net/d80211/ieee80211_sta.c
index 2720f1d..5c8fe22 100644
--- a/net/d80211/ieee80211_sta.c
+++ b/net/d80211/ieee80211_sta.c
@@ -2566,7 +2566,7 @@ int ieee80211_sta_req_scan(struct net_de
memcpy(local-scan_ssid, ssid, ssid_len);
} else
local-scan_ssid_len = 0;
-   local-scan_skip_11b = 1; /* FIX: clear this is 11g is not supported */
+   local-scan_skip_11b = local-hw-num_modes  1;
local-scan_state = SCAN_SET_CHANNEL;
local-scan_hw_mode_idx = 0;
local-scan_channel_idx = 0;
-
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