All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luciano Coelho <coelho@ti.com>
To: Julian Calaby <julian.calaby@gmail.com>
Cc: linux-wireless@vger.kernel.org
Subject: Re: [PATCH 2/2] wl12xx: add operation to retrieve the MAC address from Fuse ROM
Date: Tue, 17 Jan 2012 05:48:22 +0200	[thread overview]
Message-ID: <1326772102.4598.63.camel@cumari> (raw)
In-Reply-To: <CAGRGNgVfJeEji1EtU5u_GfHN9sgKGEkDRg9ko7JdkMqUUFvFyw@mail.gmail.com>

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@ti.com> 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@ti.com>
> > ---
> >  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.


  reply	other threads:[~2012-01-17  3:48 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-16 14:23 [PATCH 0/2] wl12xx: read MAC from fuse rom Luciano Coelho
2012-01-16 14:23 ` [PATCH 1/2] wl12xx: move partition table definition to io.c Luciano Coelho
2012-01-16 14:23 ` [PATCH 2/2] wl12xx: add operation to retrieve the MAC address from Fuse ROM Luciano Coelho
2012-01-17  0:46   ` Julian Calaby
2012-01-17  3:48     ` Luciano Coelho [this message]
2012-01-17  3:51       ` Julian Calaby
2012-01-17  4:02         ` Luciano Coelho

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1326772102.4598.63.camel@cumari \
    --to=coelho@ti.com \
    --cc=julian.calaby@gmail.com \
    --cc=linux-wireless@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.