Commit 17966e3b authored by Roland Vossen's avatar Roland Vossen Committed by Greg Kroah-Hartman

staging: brcm80211: cleaned up softmac srom macro

Substituted macro.
Reported-by: default avatarJohannes Berg <johannes@sipsolutions.net>
Reported-by: default avatarJoe Perches <joe@perches.com>
Reviewed-by: default avatarPieter-Paul Giesberts <pieterpg@broadcom.com>
Reviewed-by: default avatarArend van Spriel <arend@broadcom.com>
Signed-off-by: default avatarRoland Vossen <rvossen@broadcom.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 94dde6f4
...@@ -28,18 +28,6 @@ ...@@ -28,18 +28,6 @@
#include "otp.h" #include "otp.h"
#include "srom.h" #include "srom.h"
#define SROM_OFFSET(sih) ((sih->ccrev > 31) ? \
(((sih->cccaps & CC_CAP_SROM) == 0) ? NULL : \
((u8 *)curmap + PCI_16KB0_CCREGS_OFFSET + CC_SROM_OTP)) : \
((u8 *)curmap + PCI_BAR0_SPROM_OFFSET))
#if defined(BCMDBG)
/* 500 ms after write enable/disable toggle */
#define WRITE_ENABLE_DELAY 500
/* 20 ms between each word write */
#define WRITE_WORD_DELAY 20
#endif
/* /*
* SROM CRC8 polynomial value: * SROM CRC8 polynomial value:
* *
...@@ -792,6 +780,16 @@ static const struct brcms_sromvar perpath_pci_sromvars[] = { ...@@ -792,6 +780,16 @@ static const struct brcms_sromvar perpath_pci_sromvars[] = {
static u8 srom_crc8_table[CRC8_TABLE_SIZE]; static u8 srom_crc8_table[CRC8_TABLE_SIZE];
static u16 *srom_window_address(struct si_pub *sih, u8 *curmap)
{
if (sih->ccrev < 32)
return (u16 *)(curmap + PCI_BAR0_SPROM_OFFSET);
if (sih->cccaps & CC_CAP_SROM)
return (u16 *)(curmap + PCI_16KB0_CCREGS_OFFSET + CC_SROM_OTP);
return NULL;
}
/* Parse SROM and create name=value pairs. 'srom' points to /* Parse SROM and create name=value pairs. 'srom' points to
* the SROM word array. 'off' specifies the offset of the * the SROM word array. 'off' specifies the offset of the
* first word 'srom' points to, which should be either 0 or * first word 'srom' points to, which should be either 0 or
...@@ -1147,7 +1145,7 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars, ...@@ -1147,7 +1145,7 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
if (!srom) if (!srom)
return -ENOMEM; return -ENOMEM;
sromwindow = (u16 *) SROM_OFFSET(sih); sromwindow = srom_window_address(sih, curmap);
crc8_populate_lsb(srom_crc8_table, SROM_CRC8_POLY); crc8_populate_lsb(srom_crc8_table, SROM_CRC8_POLY);
if (ai_is_sprom_available(sih)) { if (ai_is_sprom_available(sih)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment