Search Linux Wireless

Re: [PATCH 3/3] Internalize Atheros Turbo modes and Turbo modulation

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 9/14/07, Jiri Slaby <jirislaby@xxxxxxxxx> wrote:
> Luis R. Rodriguez napsal(a):
> > This patch:
> >
> > * Internalizes Atheros Turbo modes (MODE_ATHEROS_TURBO, MODE_ATHEROS_TURBOG)
> >
> > * Internatizes Turbo modulation (MODULATION_TURBO)
> >
> > * Adds documention for Atheros Turbo modes (MODE_ATHEROS_TURBO,
> > MODE_ATHEROS_TURBOG), Turbo modulation (MODULATION_TURBO) and XR
> > modulation (MODULATION_XR)
> >
> > This patch is intended for the ath5k branch of wireless-dev after a
> > pull from origin/everything once
> > 01-remove-atheros-turbo-from-mac80211.diff is applied.
> >
> > drivers/net/wireless/ath5k_base.c |    2 +-
> > 1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > Changes-licensed-under: BSD
> > Signed-off-by: Luis R. Rodriguez <mcgrof@xxxxxxxxx>
> >
> > drivers/net/wireless/ath5k.h    |   86 +++++++++++++++++++++++++++++++++------
> > drivers/net/wireless/ath5k_hw.c |    4 +-
> > 2 files changed, 76 insertions(+), 14 deletions(-)
> >
> > Changes-licensed-under: ISC
> > Signed-off-by: Luis R. Rodriguez <mcgrof@xxxxxxxxx>
> >
> > Cc: Zhu Yi <yi.zhu@xxxxxxxxx>
> > Cc: Jiri Slaby <jirislaby@xxxxxxxxx>
> > Cc: Michael Wu <flamingice@xxxxxxxxxxxx>
> > CC: Johannes Berg <johannes@xxxxxxxxxxxxxxxx
>
> Just a question if it doesn't affect somehow supp_rates/basic_rates, which
> has up to NUM_IEEE80211_MODES pointers.

These are accessed through a mac80211 mode as its index so so long as
the driver doesn't add a mode of its own to pass down to mac8021 we
are good.

For example, util.c ieee80211_prepare_rates() access these as follows:

                if (local->supp_rates[mode->mode]) {
                        if (!rate_list_match(local->supp_rates[mode->mode],
                                             rate->rate))
                                continue;
                }

Or in ieee80211_ioctl.c ieee80211_ioctl_set_rate_sets() called when
PRISM2_HOSTAPD_SET_RATE_SETS is received and accesses these as
follows:

        prev = local->supp_rates[mode];
        local->supp_rates[mode] = supp;
        kfree(prev);

        prev = local->basic_rates[mode];
        local->basic_rates[mode] = basic;
        kfree(prev);

To be safe we can apply the attached patch to test if the driver
passed an invalid mode on ieee80211_register_hwmode().

Signed-off-by: Luis R. Rodriguez <mcgrof@xxxxxxxxx>

 net/mac80211/ieee80211.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

  Luis
diff --git a/net/mac80211/ieee80211.c b/net/mac80211/ieee80211.c
index 031308f..0bf5756 100644
--- a/net/mac80211/ieee80211.c
+++ b/net/mac80211/ieee80211.c
@@ -1375,6 +1375,7 @@ int ieee80211_register_hwmode(struct ieee80211_hw *hw,
 	struct ieee80211_rate *rate;
 	int i;
 
+	BUG_ON(mode >= NUM_IEEE80211_MODES);
 	INIT_LIST_HEAD(&mode->list);
 	list_add_tail(&mode->list, &local->modes_list);
 

[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]
  Powered by Linux