aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless
diff options
context:
space:
mode:
authorHante Meuleman <meuleman@broadcom.com>2012-09-27 08:17:49 -0400
committerJohn W. Linville <linville@tuxdriver.com>2012-09-28 13:54:08 -0400
commit040128950595d3e71ff84810044b8ed35208232f (patch)
treea5cea503dc5968bc7374a78414980f983cbd1ec1 /drivers/net/wireless
parentf09d0c02b63d9fd9873087b21311507988674221 (diff)
brcmfmac: use define instead of hardcoded values.
brcmf_parse_tlvs was using hardcoded values. Reviewed-by: Arend Van Spriel <arend@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Hante Meuleman <meuleman@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
index d0a2fa0babbf..8674d344f245 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/wl_cfg80211.c
@@ -48,6 +48,8 @@
48#define BRCMF_PNO_SCAN_COMPLETE 1 48#define BRCMF_PNO_SCAN_COMPLETE 1
49#define BRCMF_PNO_SCAN_INCOMPLETE 0 49#define BRCMF_PNO_SCAN_INCOMPLETE 0
50 50
51#define TLV_HDR_LEN 2 /* header length */
52
51#define BRCMF_ASSOC_PARAMS_FIXED_SIZE \ 53#define BRCMF_ASSOC_PARAMS_FIXED_SIZE \
52 (sizeof(struct brcmf_assoc_params_le) - sizeof(u16)) 54 (sizeof(struct brcmf_assoc_params_le) - sizeof(u16))
53 55
@@ -2608,15 +2610,15 @@ static struct brcmf_tlv *brcmf_parse_tlvs(void *buf, int buflen, uint key)
2608 totlen = buflen; 2610 totlen = buflen;
2609 2611
2610 /* find tagged parameter */ 2612 /* find tagged parameter */
2611 while (totlen >= 2) { 2613 while (totlen >= TLV_HDR_LEN) {
2612 int len = elt->len; 2614 int len = elt->len;
2613 2615
2614 /* validate remaining totlen */ 2616 /* validate remaining totlen */
2615 if ((elt->id == key) && (totlen >= (len + 2))) 2617 if ((elt->id == key) && (totlen >= (len + TLV_HDR_LEN)))
2616 return elt; 2618 return elt;
2617 2619
2618 elt = (struct brcmf_tlv *) ((u8 *) elt + (len + 2)); 2620 elt = (struct brcmf_tlv *) ((u8 *) elt + (len + TLV_HDR_LEN));
2619 totlen -= (len + 2); 2621 totlen -= (len + TLV_HDR_LEN);
2620 } 2622 }
2621 2623
2622 return NULL; 2624 return NULL;