Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 259781
b: refs/heads/master
c: 0aa94b8
h: refs/heads/master
i:
  259779: 572d9ac
v: v3
  • Loading branch information
Arend van Spriel authored and Greg Kroah-Hartman committed Jul 5, 2011
1 parent b0c0366 commit 03c21f6
Show file tree
Hide file tree
Showing 7 changed files with 116 additions and 104 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: fa04cb9ee70bf2ba308ce7e4765c9b47c7e44551
refs/heads/master: 0aa94b8484d353b56ec58d6d9a846f050cc06e83
4 changes: 2 additions & 2 deletions trunk/drivers/staging/brcm80211/brcmfmac/dhd.h
Original file line number Diff line number Diff line change
Expand Up @@ -909,8 +909,8 @@ extern void brcmf_txcomplete(dhd_pub_t *dhdp, struct sk_buff *txp,
bool success);

/* Query ioctl */
extern int dhdcdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
uint len);
extern int brcmf_proto_cdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd,
void *buf, uint len);

/* OS independent layer functions */
extern int brcmf_os_proto_block(dhd_pub_t *pub);
Expand Down
49 changes: 27 additions & 22 deletions trunk/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ struct cdc_ioctl {
((idx) << CDCF_IOC_IF_SHIFT)))

/*
* BDC header
* BDC header - Broadcom specific extension of CDC.
* Used on data packets to convey priority across USB.
*/
#define BDC_HEADER_LEN 4
Expand Down Expand Up @@ -112,7 +112,7 @@ typedef struct dhd_prot {
unsigned char buf[BRCMF_C_IOCTL_MAXLEN + ROUND_UP_MARGIN];
} dhd_prot_t;

static int dhdcdc_msg(dhd_pub_t *dhd)
static int brcmf_proto_cdc_msg(dhd_pub_t *dhd)
{
dhd_prot_t *prot = dhd->prot;
int len = le32_to_cpu(prot->msg.len) + sizeof(struct cdc_ioctl);
Expand All @@ -131,7 +131,7 @@ static int dhdcdc_msg(dhd_pub_t *dhd)
len);
}

static int dhdcdc_cmplt(dhd_pub_t *dhd, u32 id, u32 len)
static int brcmf_proto_cdc_cmplt(dhd_pub_t *dhd, u32 id, u32 len)
{
int ret;
dhd_prot_t *prot = dhd->prot;
Expand All @@ -150,7 +150,8 @@ static int dhdcdc_cmplt(dhd_pub_t *dhd, u32 id, u32 len)
}

int
dhdcdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)
brcmf_proto_cdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
uint len)
{
dhd_prot_t *prot = dhd->prot;
struct cdc_ioctl *msg = &prot->msg;
Expand Down Expand Up @@ -184,7 +185,7 @@ dhdcdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)
if (buf)
memcpy(prot->buf, buf, len);

ret = dhdcdc_msg(dhd);
ret = brcmf_proto_cdc_msg(dhd);
if (ret < 0) {
DHD_ERROR(("dhdcdc_query_ioctl: dhdcdc_msg failed w/status "
"%d\n", ret));
Expand All @@ -193,7 +194,7 @@ dhdcdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)

retry:
/* wait for interrupt and get first fragment */
ret = dhdcdc_cmplt(dhd, prot->reqid, len);
ret = brcmf_proto_cdc_cmplt(dhd, prot->reqid, len);
if (ret < 0)
goto done;

Expand Down Expand Up @@ -231,7 +232,8 @@ dhdcdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)
return ret;
}

int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)
int brcmf_proto_cdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd,
void *buf, uint len)
{
dhd_prot_t *prot = dhd->prot;
struct cdc_ioctl *msg = &prot->msg;
Expand All @@ -252,11 +254,11 @@ int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)
if (buf)
memcpy(prot->buf, buf, len);

ret = dhdcdc_msg(dhd);
ret = brcmf_proto_cdc_msg(dhd);
if (ret < 0)
goto done;

ret = dhdcdc_cmplt(dhd, prot->reqid, len);
ret = brcmf_proto_cdc_cmplt(dhd, prot->reqid, len);
if (ret < 0)
goto done;

Expand Down Expand Up @@ -284,7 +286,8 @@ int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)

extern int dhd_bus_interface(struct dhd_bus *bus, uint arg, void *arg2);
int
dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len)
brcmf_proto_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf,
int len)
{
dhd_prot_t *prot = dhd->prot;
int ret = -1;
Expand Down Expand Up @@ -318,9 +321,10 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len)
prot->pending = true;
prot->lastcmd = ioc->cmd;
if (ioc->set)
ret = dhdcdc_set_ioctl(dhd, ifidx, ioc->cmd, buf, len);
ret = brcmf_proto_cdc_set_ioctl(dhd, ifidx, ioc->cmd, buf, len);
else {
ret = dhdcdc_query_ioctl(dhd, ifidx, ioc->cmd, buf, len);
ret = brcmf_proto_cdc_query_ioctl(dhd, ifidx, ioc->cmd,
buf, len);
if (ret > 0)
ioc->used = ret - sizeof(struct cdc_ioctl);
}
Expand Down Expand Up @@ -363,18 +367,18 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len)
skb->ip_summed is overloaded */

int
dhd_prot_iovar_op(dhd_pub_t *dhdp, const char *name,
brcmf_proto_iovar_op(dhd_pub_t *dhdp, const char *name,
void *params, int plen, void *arg, int len, bool set)
{
return -ENOTSUPP;
}

void dhd_prot_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf)
void brcmf_proto_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf)
{
brcmu_bprintf(strbuf, "Protocol CDC: reqid %d\n", dhdp->prot->reqid);
}

void dhd_prot_hdrpush(dhd_pub_t *dhd, int ifidx, struct sk_buff *pktbuf)
void brcmf_proto_hdrpush(dhd_pub_t *dhd, int ifidx, struct sk_buff *pktbuf)
{
struct bdc_header *h;

Expand All @@ -396,7 +400,7 @@ void dhd_prot_hdrpush(dhd_pub_t *dhd, int ifidx, struct sk_buff *pktbuf)
BDC_SET_IF_IDX(h, ifidx);
}

int dhd_prot_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
int brcmf_proto_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
{
struct bdc_header *h;

Expand Down Expand Up @@ -440,7 +444,7 @@ int dhd_prot_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
return 0;
}

int dhd_prot_attach(dhd_pub_t *dhd)
int brcmf_proto_attach(dhd_pub_t *dhd)
{
dhd_prot_t *cdc;

Expand Down Expand Up @@ -468,13 +472,13 @@ int dhd_prot_attach(dhd_pub_t *dhd)
}

/* ~NOTE~ What if another thread is waiting on the semaphore? Holding it? */
void dhd_prot_detach(dhd_pub_t *dhd)
void brcmf_proto_detach(dhd_pub_t *dhd)
{
kfree(dhd->prot);
dhd->prot = NULL;
}

void dhd_prot_dstats(dhd_pub_t *dhd)
void brcmf_proto_dstats(dhd_pub_t *dhd)
{
/* No stats from dongle added yet, copy bus stats */
dhd->dstats.tx_packets = dhd->tx_packets;
Expand All @@ -486,7 +490,7 @@ void dhd_prot_dstats(dhd_pub_t *dhd)
return;
}

int dhd_prot_init(dhd_pub_t *dhd)
int brcmf_proto_init(dhd_pub_t *dhd)
{
int ret = 0;
char buf[128];
Expand All @@ -497,7 +501,8 @@ int dhd_prot_init(dhd_pub_t *dhd)

/* Get the device MAC address */
strcpy(buf, "cur_etheraddr");
ret = dhdcdc_query_ioctl(dhd, 0, BRCMF_C_GET_VAR, buf, sizeof(buf));
ret = brcmf_proto_cdc_query_ioctl(dhd, 0, BRCMF_C_GET_VAR,
buf, sizeof(buf));
if (ret < 0) {
brcmf_os_proto_unblock(dhd);
return ret;
Expand All @@ -516,7 +521,7 @@ int dhd_prot_init(dhd_pub_t *dhd)
return ret;
}

void dhd_prot_stop(dhd_pub_t *dhd)
void brcmf_proto_stop(dhd_pub_t *dhd)
{
/* Nothing to do for CDC */
}
Loading

0 comments on commit 03c21f6

Please sign in to comment.