From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from na3sys009aog101.obsmtp.com ([74.125.149.67]:49270 "EHLO na3sys009aog101.obsmtp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750758Ab2AQDs3 (ORCPT ); Mon, 16 Jan 2012 22:48:29 -0500 Received: by lami14 with SMTP id i14so1923475lam.6 for ; Mon, 16 Jan 2012 19:48:27 -0800 (PST) Subject: Re: [PATCH 2/2] wl12xx: add operation to retrieve the MAC address from Fuse ROM From: Luciano Coelho To: Julian Calaby Cc: linux-wireless@vger.kernel.org In-Reply-To: References: <1326723806-15960-1-git-send-email-coelho@ti.com> <1326723806-15960-3-git-send-email-coelho@ti.com> Content-Type: text/plain; charset="UTF-8" Date: Tue, 17 Jan 2012 05:48:22 +0200 Message-ID: <1326772102.4598.63.camel@cumari> (sfid-20120117_044833_913355_3EB6154B) Mime-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org List-ID: On Tue, 2012-01-17 at 11:46 +1100, Julian Calaby wrote: > Hi Luciano, > > On Tue, Jan 17, 2012 at 01:23, Luciano Coelho 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 > > --- > > 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.