Search Linux Wireless

Re: [PATCH 2/2] wl12xx: add operation to retrieve the MAC address from Fuse ROM

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

 



On Tue, 2012-01-17 at 11:46 +1100, Julian Calaby wrote: 
> Hi Luciano,
> 
> On Tue, Jan 17, 2012 at 01:23, Luciano Coelho <coelho@xxxxxx> wrote:
> > Add a testmode command to retrieve the MAC address that is stored in
> > the Fuse ROM in newer PGs.  In old PGs this operation is not
> > supported.
> >
> > Signed-off-by: Luciano Coelho <coelho@xxxxxx>
> > ---
> >  drivers/net/wireless/wl12xx/boot.c     |    3 +-
> >  drivers/net/wireless/wl12xx/boot.h     |   10 ----
> >  drivers/net/wireless/wl12xx/reg.h      |   15 ++++++
> >  drivers/net/wireless/wl12xx/testmode.c |   87 ++++++++++++++++++++++++++++++++
> >  4 files changed, 104 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/net/wireless/wl12xx/testmode.c b/drivers/net/wireless/wl12xx/testmode.c
> > index 25093c0..613e0b3 100644
> > --- a/drivers/net/wireless/wl12xx/testmode.c
> > +++ b/drivers/net/wireless/wl12xx/testmode.c
> > @@ -264,6 +266,89 @@ static int wl1271_tm_cmd_recover(struct wl1271 *wl, struct nlattr *tb[])
> >        return 0;
> >  }
> >
> > +static bool wl12xx_tm_mac_in_fuse(struct wl1271 *wl)
> > +{
> > +       bool supported = false;
> > +       u8 major, minor;
> > +
> > +       if (wl->chip.id == CHIP_ID_1283_PG20) {
> > +               major = (wl->hw_pg_ver & WL128X_PG_MAJOR_VER_MASK) >>
> > +                       WL128X_PG_MAJOR_VER_OFFSET;
> > +               minor = (wl->hw_pg_ver & WL128X_PG_MINOR_VER_MASK) >>
> > +                       WL128X_PG_MINOR_VER_OFFSET;
> > +
> > +               /* in wl128x we have the MAC address if the PG is >= (2, 1) */
> > +               if (major > 2 || (major == 2 && minor >= 1))
> > +                       supported = true;
> > +       } else {
> > +               major = (wl->hw_pg_ver & WL127X_PG_MAJOR_VER_MASK) >>
> > +                       WL127X_PG_MAJOR_VER_OFFSET;
> > +               minor = (wl->hw_pg_ver & WL127X_PG_MINOR_VER_MASK) >>
> > +                       WL127X_PG_MINOR_VER_OFFSET;
> > +
> > +               /* in wl127x we have the MAC address if the PG is >= (3, 1) */
> > +               if (major == 3 && minor >= 1)
> 
> Is this test correct? Do only major == 3 PGs support this command?

Yes, major == 3 and minor greater than or equal to 1.  Actually, there
can't be a major greater than 3, because it's only 2 bits, so 3 is the
maximum value.

-- 
Cheers,
Luca.

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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