linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Larry Finger <Larry.Finger@lwfinger.net>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: linux-wireless@vger.kernel.org,
	"John W. Linville" <linville@tuxdriver.com>,
	b43-dev@lists.infradead.org
Subject: Re: [PATCH] b43: be more user friendly with PHY info
Date: Mon, 23 Jul 2012 11:46:28 -0500	[thread overview]
Message-ID: <500D7FE4.1090100@lwfinger.net> (raw)
In-Reply-To: <1343063462-3719-1-git-send-email-zajec5@gmail.com>

On 07/23/2012 12:11 PM, Rafał Miłecki wrote:
> First of all, use PHY names instead of magic numbers. It should make
> configuring kernel easier in case of not enabled PHY type support.
> Secondly, always print info about PHY. This is really basic info about
> hardware and quite important for the support level.
>
> Signed-off-by: Rafał Miłecki <zajec5@gmail.com>
> ---
>   drivers/net/wireless/b43/main.c |   36 +++++++++++++++++++++++++++++++-----
>   1 files changed, 31 insertions(+), 5 deletions(-)

I like this change. It is worth the small increase in the size of b43.

Larry

>
> diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
> index b80352b..a56f182 100644
> --- a/drivers/net/wireless/b43/main.c
> +++ b/drivers/net/wireless/b43/main.c
> @@ -4277,6 +4277,33 @@ out:
>   	return err;
>   }
>
> +static char *b43_phy_name(struct b43_wldev *dev, u8 phy_type)
> +{
> +	switch (phy_type) {
> +	case B43_PHYTYPE_A:
> +		return "A";
> +	case B43_PHYTYPE_B:
> +		return "B";
> +	case B43_PHYTYPE_G:
> +		return "G";
> +	case B43_PHYTYPE_N:
> +		return "N";
> +	case B43_PHYTYPE_LP:
> +		return "LP";
> +	case B43_PHYTYPE_SSLPN:
> +		return "SSLPN";
> +	case B43_PHYTYPE_HT:
> +		return "HT";
> +	case B43_PHYTYPE_LCN:
> +		return "LCN";
> +	case B43_PHYTYPE_LCNXN:
> +		return "LCNXN";
> +	}
> +
> +	b43err(dev->wl, "Unknown PHY Type: %d\n", phy_type);
> +	return "UNKNOWN";
> +}
> +
>   /* Get PHY and RADIO versioning numbers */
>   static int b43_phy_versioning(struct b43_wldev *dev)
>   {
> @@ -4337,13 +4364,12 @@ static int b43_phy_versioning(struct b43_wldev *dev)
>   		unsupported = 1;
>   	}
>   	if (unsupported) {
> -		b43err(dev->wl, "FOUND UNSUPPORTED PHY "
> -		       "(Analog %u, Type %u, Revision %u)\n",
> -		       analog_type, phy_type, phy_rev);
> +		b43err(dev->wl, "FOUND UNSUPPORTED PHY (Analog %u, Type %s, Revision %u)\n",
> +		       analog_type, b43_phy_name(dev, phy_type), phy_rev);
>   		return -EOPNOTSUPP;
>   	}
> -	b43dbg(dev->wl, "Found PHY: Analog %u, Type %u, Revision %u\n",
> -	       analog_type, phy_type, phy_rev);
> +	b43info(dev->wl, "Found PHY: Analog %u, Type %s, Revision %u\n",
> +		analog_type, b43_phy_name(dev, phy_type), phy_rev);
>
>   	/* Get RADIO versioning */
>   	if (dev->dev->core_rev >= 24) {
>



      reply	other threads:[~2012-07-23 16:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-23 17:11 [PATCH] b43: be more user friendly with PHY info Rafał Miłecki
2012-07-23 16:46 ` Larry Finger [this message]

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=500D7FE4.1090100@lwfinger.net \
    --to=larry.finger@lwfinger.net \
    --cc=b43-dev@lists.infradead.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=zajec5@gmail.com \
    /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 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).