Search Linux Wireless

Re: [PATCH] ssb: do not read SPROM if it does not exist

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

 



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.
--
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