* [PATCH wireless-dev] d80211: Don't discriminate against 802.11b drivers @ 2006-05-05 2:32 Michael Wu 2006-05-11 15:54 ` Jiri Benc 0 siblings, 1 reply; 15+ messages in thread From: Michael Wu @ 2006-05-05 2:32 UTC (permalink / raw) To: John W. Linville; +Cc: Jiri Benc, Jouni Malinen, netdev, jkmaline 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 <flamingice@sourmilk.net> 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; ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH wireless-dev] d80211: Don't discriminate against 802.11b drivers 2006-05-05 2:32 [PATCH wireless-dev] d80211: Don't discriminate against 802.11b drivers Michael Wu @ 2006-05-11 15:54 ` Jiri Benc 2006-05-10 17:31 ` Michael Wu 2006-05-11 20:41 ` Michael Buesch 0 siblings, 2 replies; 15+ messages in thread From: Jiri Benc @ 2006-05-11 15:54 UTC (permalink / raw) To: Michael Wu; +Cc: John W. Linville, Jouni Malinen, netdev, jkmaline 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 <jbenc@suse.cz> --- 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 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH wireless-dev] d80211: Don't discriminate against 802.11b drivers 2006-05-11 15:54 ` Jiri Benc @ 2006-05-10 17:31 ` Michael Wu 2006-05-12 10:47 ` Jiri Benc 2006-05-11 20:41 ` Michael Buesch 1 sibling, 1 reply; 15+ messages in thread From: Michael Wu @ 2006-05-10 17:31 UTC (permalink / raw) To: Jiri Benc; +Cc: John W. Linville, Jouni Malinen, netdev, jkmaline 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 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH wireless-dev] d80211: Don't discriminate against 802.11b drivers 2006-05-10 17:31 ` Michael Wu @ 2006-05-12 10:47 ` Jiri Benc 2006-05-12 20:35 ` Michael Wu 0 siblings, 1 reply; 15+ messages in thread From: Jiri Benc @ 2006-05-12 10:47 UTC (permalink / raw) To: Michael Wu; +Cc: John W. Linville, Jouni Malinen, netdev, jkmaline 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 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH wireless-dev] d80211: Don't discriminate against 802.11b drivers 2006-05-12 10:47 ` Jiri Benc @ 2006-05-12 20:35 ` Michael Wu 2006-05-15 11:37 ` Jiri Benc 0 siblings, 1 reply; 15+ messages in thread From: Michael Wu @ 2006-05-12 20:35 UTC (permalink / raw) To: Jiri Benc; +Cc: John W. Linville, Jouni Malinen, netdev, jkmaline 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 <flamingice@sourmilk.net> 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; ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH wireless-dev] d80211: Don't discriminate against 802.11b drivers 2006-05-12 20:35 ` Michael Wu @ 2006-05-15 11:37 ` Jiri Benc 2006-05-15 12:04 ` Johannes Berg 2006-05-15 17:19 ` Michael Wu 0 siblings, 2 replies; 15+ messages in thread From: Jiri Benc @ 2006-05-15 11:37 UTC (permalink / raw) To: Michael Wu; +Cc: John W. Linville, Jouni Malinen, netdev, jkmaline 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 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH wireless-dev] d80211: Don't discriminate against 802.11b drivers 2006-05-15 11:37 ` Jiri Benc @ 2006-05-15 12:04 ` Johannes Berg 2006-05-15 13:35 ` Jiri Benc 2006-05-15 17:19 ` Michael Wu 1 sibling, 1 reply; 15+ messages in thread From: Johannes Berg @ 2006-05-15 12:04 UTC (permalink / raw) To: Jiri Benc; +Cc: Michael Wu, John W. Linville, Jouni Malinen, netdev, jkmaline [-- Attachment #1: Type: text/plain, Size: 432 bytes --] 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 [-- Attachment #2: This is a digitally signed message part --] [-- Type: application/pgp-signature, Size: 793 bytes --] ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH wireless-dev] d80211: Don't discriminate against 802.11b drivers 2006-05-15 12:04 ` Johannes Berg @ 2006-05-15 13:35 ` Jiri Benc 2006-05-15 14:01 ` Michael Buesch 0 siblings, 1 reply; 15+ messages in thread From: Jiri Benc @ 2006-05-15 13:35 UTC (permalink / raw) To: Johannes Berg; +Cc: Michael Wu, netdev [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 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH wireless-dev] d80211: Don't discriminate against 802.11b drivers 2006-05-15 13:35 ` Jiri Benc @ 2006-05-15 14:01 ` Michael Buesch 2006-05-15 14:12 ` Jiri Benc 0 siblings, 1 reply; 15+ messages in thread From: Michael Buesch @ 2006-05-15 14:01 UTC (permalink / raw) To: Jiri Benc, Michael Wu, netdev, Johannes Berg 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 ;) ) ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH wireless-dev] d80211: Don't discriminate against 802.11b drivers 2006-05-15 14:01 ` Michael Buesch @ 2006-05-15 14:12 ` Jiri Benc 0 siblings, 0 replies; 15+ messages in thread From: Jiri Benc @ 2006-05-15 14:12 UTC (permalink / raw) To: Michael Buesch; +Cc: Michael Wu, netdev, Johannes Berg 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 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH wireless-dev] d80211: Don't discriminate against 802.11b drivers 2006-05-15 11:37 ` Jiri Benc 2006-05-15 12:04 ` Johannes Berg @ 2006-05-15 17:19 ` Michael Wu 2006-05-19 18:06 ` John W. Linville 1 sibling, 1 reply; 15+ messages in thread From: Michael Wu @ 2006-05-15 17:19 UTC (permalink / raw) To: Jiri Benc; +Cc: John W. Linville, Jouni Malinen, netdev, jkmaline 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 <flamingice@sourmilk.net> 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)); chan = &mode->channels[local->scan_channel_idx]; if (!(chan->flag & IEEE80211_CHAN_W_SCAN) || (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)) + (local->hw_modes & local->enabled_modes & + (1 << MODE_IEEE80211G) && 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; @@ -2592,7 +2591,7 @@ ieee80211_sta_scan_result(struct net_dev bss->last_update + IEEE80211_SCAN_RESULT_EXPIRE)) return current_ev; - if (!(local->hw_modes & (1 << bss->hw_mode))) + if (!(local->enabled_modes & (1 << bss->hw_mode))) return current_ev; if (local->scan_flags & IEEE80211_SCAN_WPA_ONLY && ^ permalink raw reply related [flat|nested] 15+ messages in thread
* Re: [PATCH wireless-dev] d80211: Don't discriminate against 802.11b drivers 2006-05-15 17:19 ` Michael Wu @ 2006-05-19 18:06 ` John W. Linville 2006-05-19 19:03 ` Michael Wu 0 siblings, 1 reply; 15+ messages in thread From: John W. Linville @ 2006-05-19 18:06 UTC (permalink / raw) To: Michael Wu; +Cc: Jiri Benc, Jouni Malinen, netdev, jkmaline 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 linville@tuxdriver.com ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH wireless-dev] d80211: Don't discriminate against 802.11b drivers 2006-05-19 18:06 ` John W. Linville @ 2006-05-19 19:03 ` Michael Wu 2006-05-19 19:22 ` John W. Linville 0 siblings, 1 reply; 15+ messages in thread From: Michael Wu @ 2006-05-19 19:03 UTC (permalink / raw) To: John W. Linville; +Cc: Jiri Benc, Jouni Malinen, netdev, jkmaline 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 ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH wireless-dev] d80211: Don't discriminate against 802.11b drivers 2006-05-19 19:03 ` Michael Wu @ 2006-05-19 19:22 ` John W. Linville 0 siblings, 0 replies; 15+ messages in thread From: John W. Linville @ 2006-05-19 19:22 UTC (permalink / raw) To: Michael Wu; +Cc: Jiri Benc, Jouni Malinen, netdev, jkmaline 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 linville@tuxdriver.com ^ permalink raw reply [flat|nested] 15+ messages in thread
* Re: [PATCH wireless-dev] d80211: Don't discriminate against 802.11b drivers 2006-05-11 15:54 ` Jiri Benc 2006-05-10 17:31 ` Michael Wu @ 2006-05-11 20:41 ` Michael Buesch 1 sibling, 0 replies; 15+ messages in thread From: Michael Buesch @ 2006-05-11 20:41 UTC (permalink / raw) To: Jiri Benc; +Cc: John W. Linville, Jouni Malinen, netdev, jkmaline, Michael Wu 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 <jbenc@suse.cz> > > --- > > 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. ^ permalink raw reply [flat|nested] 15+ messages in thread
end of thread, other threads:[~2006-05-19 19:22 UTC | newest] Thread overview: 15+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2006-05-05 2:32 [PATCH wireless-dev] d80211: Don't discriminate against 802.11b drivers Michael Wu 2006-05-11 15:54 ` Jiri Benc 2006-05-10 17:31 ` Michael Wu 2006-05-12 10:47 ` Jiri Benc 2006-05-12 20:35 ` Michael Wu 2006-05-15 11:37 ` Jiri Benc 2006-05-15 12:04 ` Johannes Berg 2006-05-15 13:35 ` Jiri Benc 2006-05-15 14:01 ` Michael Buesch 2006-05-15 14:12 ` Jiri Benc 2006-05-15 17:19 ` Michael Wu 2006-05-19 18:06 ` John W. Linville 2006-05-19 19:03 ` Michael Wu 2006-05-19 19:22 ` John W. Linville 2006-05-11 20:41 ` Michael Buesch
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for NNTP newsgroup(s).