Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 259764
b: refs/heads/master
c: 4c5c488
h: refs/heads/master
v: v3
  • Loading branch information
Henry Ptasinski authored and Greg Kroah-Hartman committed Jul 5, 2011
1 parent 0f50fb5 commit c205135
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 15 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 521223a27a760658e04e65d8deaf5339070f15f6
refs/heads/master: 4c5c488a3c0fdcbdce0e212c0e99c01cffce2039
33 changes: 19 additions & 14 deletions trunk/drivers/staging/brcm80211/brcmsmac/bmac.c
Original file line number Diff line number Diff line change
Expand Up @@ -1905,28 +1905,33 @@ static bool brcms_c_isgoodchip(struct brcms_c_hw_info *wlc_hw)
return true;
}

/* Validate some board info parameters */
static bool brcms_c_validboardtype(struct brcms_c_hw_info *wlc_hw)
{
bool goodboard = true;
uint boardrev = wlc_hw->boardrev;

/* 4 bits each for board type, major, minor, and tiny version */
uint brt = (boardrev & 0xf000) >> 12;
uint b0 = (boardrev & 0xf00) >> 8;
uint b1 = (boardrev & 0xf0) >> 4;
uint b2 = boardrev & 0xf;

/* voards from other vendors are always considered valid */
if (wlc_hw->sih->boardvendor != PCI_VENDOR_ID_BROADCOM)
return true;

/* do some boardrev sanity checks when boardvendor is Broadcom */
if (boardrev == 0)
goodboard = false;
else if (boardrev > 0xff) {
uint brt = (boardrev & 0xf000) >> 12;
uint b0 = (boardrev & 0xf00) >> 8;
uint b1 = (boardrev & 0xf0) >> 4;
uint b2 = boardrev & 0xf;
return false;

if ((brt > 2) || (brt == 0) || (b0 > 9) || (b0 == 0) || (b1 > 9)
|| (b2 > 9))
goodboard = false;
}
if (boardrev <= 0xff)
return true;

if (wlc_hw->sih->boardvendor != PCI_VENDOR_ID_BROADCOM)
return goodboard;
if ((brt > 2) || (brt == 0) || (b0 > 9) || (b0 == 0) || (b1 > 9)
|| (b2 > 9))
return false;

return goodboard;
return true;
}

static char *brcms_c_get_macaddr(struct brcms_c_hw_info *wlc_hw)
Expand Down

0 comments on commit c205135

Please sign in to comment.