Skip to content

Commit

Permalink
brcmfmac: use different fw api for encryption,auth. config
Browse files Browse the repository at this point in the history
This patch changes the commands being used to configure
encryption and authentication. These new methods are needed
for when p2p and hostap support are added.

Reviewed-by: Arend Van Spriel <arend@broadcom.com>
Reviewed-by: Franky (Zhenhui) Lin <frankyl@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>
  • Loading branch information
Hante Meuleman authored and John W. Linville committed Sep 28, 2012
1 parent 70398a5 commit f09d0c0
Show file tree
Hide file tree
Showing 4 changed files with 219 additions and 97 deletions.
2 changes: 2 additions & 0 deletions drivers/net/wireless/brcm80211/brcmfmac/dhd.h
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,8 @@ extern const struct bcmevent_name bcmevent_names[];

extern uint brcmf_c_mkiovar(char *name, char *data, uint datalen,
char *buf, uint len);
extern uint brcmf_c_mkiovar_bsscfg(char *name, char *data, uint datalen,
char *buf, uint buflen, s32 bssidx);

extern int brcmf_netdev_wait_pend8021x(struct net_device *ndev);

Expand Down
46 changes: 46 additions & 0 deletions drivers/net/wireless/brcm80211/brcmfmac/dhd_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,52 @@ brcmf_c_mkiovar(char *name, char *data, uint datalen, char *buf, uint buflen)
return len;
}

uint
brcmf_c_mkiovar_bsscfg(char *name, char *data, uint datalen,
char *buf, uint buflen, s32 bssidx)
{
const s8 *prefix = "bsscfg:";
s8 *p;
u32 prefixlen;
u32 namelen;
u32 iolen;
__le32 bssidx_le;

if (bssidx == 0)
return brcmf_c_mkiovar(name, data, datalen, buf, buflen);

prefixlen = (u32) strlen(prefix); /* lengh of bsscfg prefix */
namelen = (u32) strlen(name) + 1; /* lengh of iovar name + null */
iolen = prefixlen + namelen + sizeof(bssidx_le) + datalen;

if (buflen < 0 || iolen > (u32)buflen) {
brcmf_dbg(ERROR, "buffer is too short\n");
return 0;
}

p = buf;

/* copy prefix, no null */
memcpy(p, prefix, prefixlen);
p += prefixlen;

/* copy iovar name including null */
memcpy(p, name, namelen);
p += namelen;

/* bss config index as first data */
bssidx_le = cpu_to_le32(bssidx);
memcpy(p, &bssidx_le, sizeof(bssidx_le));
p += sizeof(bssidx_le);

/* parameter buffer follows */
if (datalen)
memcpy(p, data, datalen);

return iolen;

}

bool brcmf_c_prec_enq(struct device *dev, struct pktq *q,
struct sk_buff *pkt, int prec)
{
Expand Down
Loading

0 comments on commit f09d0c0

Please sign in to comment.