linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michael Buesch <mb@bu3sch.de>
To: "John W. Linville" <linville@tuxdriver.com>
Cc: linux-wireless@vger.kernel.org,
	Larry Finger <Larry.Finger@lwfinger.net>,
	stable@kernel.org
Subject: Re: [PATCH] ssb: do not read SPROM if it does not exist
Date: Fri, 19 Mar 2010 20:41:47 +0100	[thread overview]
Message-ID: <201003192041.47211.mb@bu3sch.de> (raw)
In-Reply-To: <1269025687-9817-1-git-send-email-linville@tuxdriver.com>

On Friday 19 March 2010 20:08:07 John W. Linville wrote:
> +	switch (bus->chip_id) {
> +	case 0x4312:
> +		return SSB_CHIPCO_CHST_4312_SPROM_PRESENT(bus->chipco.status);

Not sure why we want to hide the logic in defines. But I don't care much, either.

> +	case 0x4322:
> +		return SSB_CHIPCO_CHST_4322_SPROM_PRESENT(bus->chipco.status);
> +	case 0x4325:
> +		return SSB_CHIPCO_CHST_4325_SPROM_PRESENT(bus->chipco.status);
> +	default:
> +		break;
> +	}
> +	if (bus->chip_rev >= 31)

This check is wrong.
You need to check the chipcommon core revision. Not the chip revision.

> +		return bus->chipco.capabilities & SSB_CHIPCO_CAP_SPROM;
> +
> +	return true;
> +}
> diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
> index 24f9885..3b4da23 100644
> --- a/include/linux/ssb/ssb.h
> +++ b/include/linux/ssb/ssb.h
> @@ -394,6 +394,9 @@ extern int ssb_bus_sdiobus_register(struct ssb_bus *bus,
>  
>  extern void ssb_bus_unregister(struct ssb_bus *bus);
>  
> +/* Does the device have an SPROM? */
> +extern bool ssb_is_sprom_available(struct ssb_bus *bus);
> +
>  /* Set a fallback SPROM.
>   * See kdoc at the function definition for complete documentation. */
>  extern int ssb_arch_set_fallback_sprom(const struct ssb_sprom *sprom);
> diff --git a/include/linux/ssb/ssb_driver_chipcommon.h b/include/linux/ssb/ssb_driver_chipcommon.h
> index 4e27acf..4e5726d 100644
> --- a/include/linux/ssb/ssb_driver_chipcommon.h
> +++ b/include/linux/ssb/ssb_driver_chipcommon.h
> @@ -30,6 +30,7 @@
>  #define   SSB_CHIPCO_CAP_UARTCLK_INT	0x00000008	/* UARTs are driven by internal divided clock */
>  #define  SSB_CHIPCO_CAP_UARTGPIO	0x00000020	/* UARTs on GPIO 15-12 */
>  #define  SSB_CHIPCO_CAP_EXTBUS		0x000000C0	/* External buses present */
> +#define  SSB_CHIPCO_CAP_SPROM		0x40000000	/* SPROM present */
>  #define  SSB_CHIPCO_CAP_FLASHT		0x00000700	/* Flash Type */

Probably keep ordering of capabilities correct.

>  #define   SSB_CHIPCO_FLASHT_NONE	0x00000000	/* No flash */
>  #define   SSB_CHIPCO_FLASHT_STSER	0x00000100	/* ST serial flash */
> @@ -385,6 +386,7 @@

-- 
Greetings, Michael.

  reply	other threads:[~2010-03-19 19:43 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-18 17:46 RFC: A workaround for BCM43XX devices with no on-board SPROM Larry Finger
2010-03-18 19:31 ` Michael Buesch
2010-03-18 20:20   ` John W. Linville
2010-03-18 20:31     ` Johannes Berg
2010-03-18 21:38   ` Larry Finger
2010-03-19  7:36     ` Michael Buesch
2010-03-18 20:51 ` Nicolas de Pesloüan
2010-03-18 20:53 ` Johannes Berg
2010-03-18 21:10   ` Larry Finger
2010-03-18 21:20     ` Johannes Berg
2010-03-18 21:47       ` Larry Finger
2010-03-19 18:40     ` Kalle Valo
2010-03-19 19:08 ` [PATCH] ssb: do not read SPROM if it does not exist John W. Linville
2010-03-19 19:41   ` Michael Buesch [this message]
2010-03-19 19:46     ` Michael Buesch
2010-03-19 20:21     ` John W. Linville
2010-03-19 20:30       ` Michael Buesch
2010-03-19 20:31         ` John W. Linville
2010-03-19 20:33   ` [PATCH v2] " John W. Linville
2010-03-19 20:41     ` [PATCH v3] " John W. Linville
2010-03-19 21:12       ` Michael Buesch
2010-03-19 22:10         ` John W. Linville
2010-03-19 22:10         ` [PATCH v4] " John W. Linville

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=201003192041.47211.mb@bu3sch.de \
    --to=mb@bu3sch.de \
    --cc=Larry.Finger@lwfinger.net \
    --cc=linux-wireless@vger.kernel.org \
    --cc=linville@tuxdriver.com \
    --cc=stable@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 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).