Search Linux Wireless

Re: [PATCH 2/4] brcmutil: add helper function to format board revision

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

 



I am holding patches 2-4 until we resolve the brcmu_boardrev_str
build thing...

On Thu, Nov 20, 2014 at 10:27:00PM +0100, Arend van Spriel wrote:
> The board revision that is available in hardware can be translated
> so it matches the labelling on the board. This is accomplished by
> this helper function.
> 
> Reviewed-by: Hante Meuleman <meuleman@xxxxxxxxxxxx>
> Reviewed-by: Pieter-Paul Giesberts <pieterpg@xxxxxxxxxxxx>
> Signed-off-by: Arend van Spriel <arend@xxxxxxxxxxxx>
> ---
>  drivers/net/wireless/brcm80211/brcmutil/utils.c      | 16 ++++++++++++++++
>  drivers/net/wireless/brcm80211/include/brcmu_utils.h |  2 ++
>  2 files changed, 18 insertions(+)
> 
> diff --git a/drivers/net/wireless/brcm80211/brcmutil/utils.c b/drivers/net/wireless/brcm80211/brcmutil/utils.c
> index 0f7e1c7..af97f8b 100644
> --- a/drivers/net/wireless/brcm80211/brcmutil/utils.c
> +++ b/drivers/net/wireless/brcm80211/brcmutil/utils.c
> @@ -292,4 +292,20 @@ void brcmu_dbg_hex_dump(const void *data, size_t size, const char *fmt, ...)
>  	print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, data, size);
>  }
>  EXPORT_SYMBOL(brcmu_dbg_hex_dump);
> +
> +/* Produce a human-readable string for boardrev */
> +char *brcmu_boardrev_str(u32 brev, char *buf)
> +{
> +	char c;
> +
> +	if (brev < 0x100) {
> +		snprintf(buf, 8, "%d.%d", (brev & 0xf0) >> 4, brev & 0xf);
> +	} else {
> +		c = (brev & 0xf000) == 0x1000 ? 'P' : 'A';
> +		snprintf(buf, 8, "%c%03x", c, brev & 0xfff);
> +	}
> +	return buf;
> +}
> +EXPORT_SYMBOL(brcmu_boardrev_str);
> +
>  #endif				/* defined(DEBUG) */
> diff --git a/drivers/net/wireless/brcm80211/include/brcmu_utils.h b/drivers/net/wireless/brcm80211/include/brcmu_utils.h
> index 8ba445b..a043e29 100644
> --- a/drivers/net/wireless/brcm80211/include/brcmu_utils.h
> +++ b/drivers/net/wireless/brcm80211/include/brcmu_utils.h
> @@ -218,4 +218,6 @@ void brcmu_dbg_hex_dump(const void *data, size_t size, const char *fmt, ...)
>  }
>  #endif
>  
> +char *brcmu_boardrev_str(u32 brev, char *buf);
> +
>  #endif				/* _BRCMU_UTILS_H_ */
> -- 
> 1.9.1
> 
> 

-- 
John W. Linville		Someday the world will need a hero, and you
linville@xxxxxxxxxxxxx			might be all we have.  Be ready.
--
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 Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux