staging: brcm80211: rename macros in dhd_dbg.h
The header file dhd_dbg.h contains several macros used throughout the code starting with DHD_. These have been renamed to get rid of this broadcom specific acronym. Reviewed-by: Roland Vossen <rvossen@broadcom.com> Reviewed-by: Franky (Zhenhui) Lin <frankyl@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
c4eae44c54
commit
96c75e4818
|
@ -105,7 +105,7 @@ static int brcmf_proto_cdc_msg(struct brcmf_pub *drvr)
|
|||
int len = le32_to_cpu(prot->msg.len) +
|
||||
sizeof(struct brcmf_proto_cdc_ioctl);
|
||||
|
||||
DHD_TRACE(("%s: Enter\n", __func__));
|
||||
BRCMF_TRACE(("%s: Enter\n", __func__));
|
||||
|
||||
/* NOTE : cdc->msg.len holds the desired length of the buffer to be
|
||||
* returned. Only up to CDC_MAX_MSG_SIZE of this buffer area
|
||||
|
@ -124,7 +124,7 @@ static int brcmf_proto_cdc_cmplt(struct brcmf_pub *drvr, u32 id, u32 len)
|
|||
int ret;
|
||||
struct brcmf_proto *prot = drvr->prot;
|
||||
|
||||
DHD_TRACE(("%s: Enter\n", __func__));
|
||||
BRCMF_TRACE(("%s: Enter\n", __func__));
|
||||
|
||||
do {
|
||||
ret = brcmf_sdbrcm_bus_rxctl(drvr->bus,
|
||||
|
@ -147,8 +147,8 @@ brcmf_proto_cdc_query_ioctl(struct brcmf_pub *drvr, int ifidx, uint cmd,
|
|||
int ret = 0, retries = 0;
|
||||
u32 id, flags = 0;
|
||||
|
||||
DHD_TRACE(("%s: Enter\n", __func__));
|
||||
DHD_CTL(("%s: cmd %d len %d\n", __func__, cmd, len));
|
||||
BRCMF_TRACE(("%s: Enter\n", __func__));
|
||||
BRCMF_CTL(("%s: cmd %d len %d\n", __func__, cmd, len));
|
||||
|
||||
/* Respond "bcmerror" and "bcmerrorstr" with local cache */
|
||||
if (cmd == BRCMF_C_GET_VAR && buf) {
|
||||
|
@ -175,8 +175,8 @@ brcmf_proto_cdc_query_ioctl(struct brcmf_pub *drvr, int ifidx, uint cmd,
|
|||
|
||||
ret = brcmf_proto_cdc_msg(drvr);
|
||||
if (ret < 0) {
|
||||
DHD_ERROR(("brcmf_proto_cdc_query_ioctl: brcmf_proto_cdc_msg "
|
||||
"failed w/status %d\n", ret));
|
||||
BRCMF_ERROR(("brcmf_proto_cdc_query_ioctl: brcmf_proto_cdc_msg "
|
||||
"failed w/status %d\n", ret));
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
@ -192,9 +192,9 @@ retry:
|
|||
if ((id < prot->reqid) && (++retries < RETRIES))
|
||||
goto retry;
|
||||
if (id != prot->reqid) {
|
||||
DHD_ERROR(("%s: %s: unexpected request id %d (expected %d)\n",
|
||||
brcmf_ifname(drvr, ifidx), __func__, id,
|
||||
prot->reqid));
|
||||
BRCMF_ERROR(("%s: %s: unexpected request id %d (expected %d)\n",
|
||||
brcmf_ifname(drvr, ifidx), __func__, id,
|
||||
prot->reqid));
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
@ -228,8 +228,8 @@ int brcmf_proto_cdc_set_ioctl(struct brcmf_pub *drvr, int ifidx, uint cmd,
|
|||
int ret = 0;
|
||||
u32 flags, id;
|
||||
|
||||
DHD_TRACE(("%s: Enter\n", __func__));
|
||||
DHD_CTL(("%s: cmd %d len %d\n", __func__, cmd, len));
|
||||
BRCMF_TRACE(("%s: Enter\n", __func__));
|
||||
BRCMF_CTL(("%s: cmd %d len %d\n", __func__, cmd, len));
|
||||
|
||||
memset(msg, 0, sizeof(struct brcmf_proto_cdc_ioctl));
|
||||
|
||||
|
@ -254,9 +254,9 @@ int brcmf_proto_cdc_set_ioctl(struct brcmf_pub *drvr, int ifidx, uint cmd,
|
|||
id = (flags & CDCF_IOC_ID_MASK) >> CDCF_IOC_ID_SHIFT;
|
||||
|
||||
if (id != prot->reqid) {
|
||||
DHD_ERROR(("%s: %s: unexpected request id %d (expected %d)\n",
|
||||
brcmf_ifname(drvr, ifidx), __func__, id,
|
||||
prot->reqid));
|
||||
BRCMF_ERROR(("%s: %s: unexpected request id %d (expected %d)\n",
|
||||
brcmf_ifname(drvr, ifidx), __func__, id,
|
||||
prot->reqid));
|
||||
ret = -EINVAL;
|
||||
goto done;
|
||||
}
|
||||
|
@ -280,13 +280,13 @@ brcmf_proto_ioctl(struct brcmf_pub *drvr, int ifidx, struct brcmf_ioctl *ioc,
|
|||
int ret = -1;
|
||||
|
||||
if (drvr->busstate == BRCMF_BUS_DOWN) {
|
||||
DHD_ERROR(("%s : bus is down. we have nothing to do\n",
|
||||
__func__));
|
||||
BRCMF_ERROR(("%s : bus is down. we have nothing to do\n",
|
||||
__func__));
|
||||
return ret;
|
||||
}
|
||||
brcmf_os_proto_block(drvr);
|
||||
|
||||
DHD_TRACE(("%s: Enter\n", __func__));
|
||||
BRCMF_TRACE(("%s: Enter\n", __func__));
|
||||
|
||||
ASSERT(len <= BRCMF_C_IOCTL_MAXLEN);
|
||||
|
||||
|
@ -294,13 +294,13 @@ brcmf_proto_ioctl(struct brcmf_pub *drvr, int ifidx, struct brcmf_ioctl *ioc,
|
|||
goto done;
|
||||
|
||||
if (prot->pending == true) {
|
||||
DHD_TRACE(("CDC packet is pending!!!! cmd=0x%x (%lu) "
|
||||
"lastcmd=0x%x (%lu)\n",
|
||||
ioc->cmd, (unsigned long)ioc->cmd, prot->lastcmd,
|
||||
(unsigned long)prot->lastcmd));
|
||||
BRCMF_TRACE(("CDC packet is pending!!!! cmd=0x%x (%lu) "
|
||||
"lastcmd=0x%x (%lu)\n",
|
||||
ioc->cmd, (unsigned long)ioc->cmd, prot->lastcmd,
|
||||
(unsigned long)prot->lastcmd));
|
||||
if ((ioc->cmd == BRCMF_C_SET_VAR) ||
|
||||
(ioc->cmd == BRCMF_C_GET_VAR))
|
||||
DHD_TRACE(("iovar cmd=%s\n", (char *)buf));
|
||||
BRCMF_TRACE(("iovar cmd=%s\n", (char *)buf));
|
||||
|
||||
goto done;
|
||||
}
|
||||
|
@ -361,7 +361,7 @@ void brcmf_proto_hdrpush(struct brcmf_pub *drvr, int ifidx,
|
|||
{
|
||||
struct brcmf_proto_bdc_header *h;
|
||||
|
||||
DHD_TRACE(("%s: Enter\n", __func__));
|
||||
BRCMF_TRACE(("%s: Enter\n", __func__));
|
||||
|
||||
/* Push BDC header used to convey priority for buses that don't */
|
||||
|
||||
|
@ -384,13 +384,13 @@ int brcmf_proto_hdrpull(struct brcmf_pub *drvr, int *ifidx,
|
|||
{
|
||||
struct brcmf_proto_bdc_header *h;
|
||||
|
||||
DHD_TRACE(("%s: Enter\n", __func__));
|
||||
BRCMF_TRACE(("%s: Enter\n", __func__));
|
||||
|
||||
/* Pop BDC header used to convey priority for buses that don't */
|
||||
|
||||
if (pktbuf->len < BDC_HEADER_LEN) {
|
||||
DHD_ERROR(("%s: rx data too short (%d < %d)\n", __func__,
|
||||
pktbuf->len, BDC_HEADER_LEN));
|
||||
BRCMF_ERROR(("%s: rx data too short (%d < %d)\n", __func__,
|
||||
pktbuf->len, BDC_HEADER_LEN));
|
||||
return -EBADE;
|
||||
}
|
||||
|
||||
|
@ -398,22 +398,22 @@ int brcmf_proto_hdrpull(struct brcmf_pub *drvr, int *ifidx,
|
|||
|
||||
*ifidx = BDC_GET_IF_IDX(h);
|
||||
if (*ifidx >= BRCMF_MAX_IFS) {
|
||||
DHD_ERROR(("%s: rx data ifnum out of range (%d)\n",
|
||||
__func__, *ifidx));
|
||||
BRCMF_ERROR(("%s: rx data ifnum out of range (%d)\n",
|
||||
__func__, *ifidx));
|
||||
return -EBADE;
|
||||
}
|
||||
|
||||
if (((h->flags & BDC_FLAG_VER_MASK) >> BDC_FLAG_VER_SHIFT) !=
|
||||
BDC_PROTO_VER) {
|
||||
DHD_ERROR(("%s: non-BDC packet received, flags 0x%x\n",
|
||||
brcmf_ifname(drvr, *ifidx), h->flags));
|
||||
BRCMF_ERROR(("%s: non-BDC packet received, flags 0x%x\n",
|
||||
brcmf_ifname(drvr, *ifidx), h->flags));
|
||||
return -EBADE;
|
||||
}
|
||||
|
||||
if (h->flags & BDC_FLAG_SUM_GOOD) {
|
||||
DHD_INFO(("%s: BDC packet received with good rx-csum, "
|
||||
"flags 0x%x\n",
|
||||
brcmf_ifname(drvr, *ifidx), h->flags));
|
||||
BRCMF_INFO(("%s: BDC packet received with good rx-csum, "
|
||||
"flags 0x%x\n",
|
||||
brcmf_ifname(drvr, *ifidx), h->flags));
|
||||
PKTSETSUMGOOD(pktbuf, true);
|
||||
}
|
||||
|
||||
|
@ -430,13 +430,13 @@ int brcmf_proto_attach(struct brcmf_pub *drvr)
|
|||
|
||||
cdc = kzalloc(sizeof(struct brcmf_proto), GFP_ATOMIC);
|
||||
if (!cdc) {
|
||||
DHD_ERROR(("%s: kmalloc failed\n", __func__));
|
||||
BRCMF_ERROR(("%s: kmalloc failed\n", __func__));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* ensure that the msg buf directly follows the cdc msg struct */
|
||||
if ((unsigned long)(&cdc->msg + 1) != (unsigned long)cdc->buf) {
|
||||
DHD_ERROR(("struct brcmf_proto is not correctly defined\n"));
|
||||
BRCMF_ERROR(("struct brcmf_proto is not correctly defined\n"));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -475,7 +475,7 @@ int brcmf_proto_init(struct brcmf_pub *drvr)
|
|||
int ret = 0;
|
||||
char buf[128];
|
||||
|
||||
DHD_TRACE(("%s: Enter\n", __func__));
|
||||
BRCMF_TRACE(("%s: Enter\n", __func__));
|
||||
|
||||
brcmf_os_proto_block(drvr);
|
||||
|
||||
|
|
|
@ -176,7 +176,7 @@ brcmf_c_doiovar(struct brcmf_pub *drvr, const struct brcmu_iovar *vi,
|
|||
int bcmerror = 0;
|
||||
s32 int_val = 0;
|
||||
|
||||
DHD_TRACE(("%s: Enter\n", __func__));
|
||||
BRCMF_TRACE(("%s: Enter\n", __func__));
|
||||
|
||||
bcmerror = brcmu_iovar_lencheck(vi, arg, len, IOV_ISSET(actionid));
|
||||
if (bcmerror != 0)
|
||||
|
@ -288,8 +288,8 @@ bool brcmf_c_prec_enq(struct brcmf_pub *drvr, struct pktq *q,
|
|||
p = discard_oldest ? brcmu_pktq_pdeq(q, eprec) :
|
||||
brcmu_pktq_pdeq_tail(q, eprec);
|
||||
if (p == NULL) {
|
||||
DHD_ERROR(("%s: brcmu_pktq_penq() failed, oldest %d.",
|
||||
__func__, discard_oldest));
|
||||
BRCMF_ERROR(("%s: brcmu_pktq_penq() failed, oldest %d.",
|
||||
__func__, discard_oldest));
|
||||
ASSERT(p);
|
||||
}
|
||||
|
||||
|
@ -299,7 +299,7 @@ bool brcmf_c_prec_enq(struct brcmf_pub *drvr, struct pktq *q,
|
|||
/* Enqueue */
|
||||
p = brcmu_pktq_penq(q, prec, pkt);
|
||||
if (p == NULL) {
|
||||
DHD_ERROR(("%s: brcmu_pktq_penq() failed.", __func__));
|
||||
BRCMF_ERROR(("%s: brcmu_pktq_penq() failed.", __func__));
|
||||
ASSERT(p);
|
||||
}
|
||||
|
||||
|
@ -315,7 +315,7 @@ brcmf_c_iovar_op(struct brcmf_pub *drvr, const char *name,
|
|||
const struct brcmu_iovar *vi = NULL;
|
||||
u32 actionid;
|
||||
|
||||
DHD_TRACE(("%s: Enter\n", __func__));
|
||||
BRCMF_TRACE(("%s: Enter\n", __func__));
|
||||
|
||||
ASSERT(name);
|
||||
ASSERT(len >= 0);
|
||||
|
@ -332,8 +332,8 @@ brcmf_c_iovar_op(struct brcmf_pub *drvr, const char *name,
|
|||
goto exit;
|
||||
}
|
||||
|
||||
DHD_CTL(("%s: %s %s, len %d plen %d\n", __func__,
|
||||
name, (set ? "set" : "get"), len, plen));
|
||||
BRCMF_CTL(("%s: %s %s, len %d plen %d\n", __func__,
|
||||
name, (set ? "set" : "get"), len, plen));
|
||||
|
||||
/* set up 'params' pointer in case this is a set command so that
|
||||
* the convenience int and bool code can be common to set and get
|
||||
|
@ -365,7 +365,7 @@ int brcmf_c_ioctl(struct brcmf_pub *drvr, struct brcmf_c_ioctl *ioc, void *buf,
|
|||
{
|
||||
int bcmerror = 0;
|
||||
|
||||
DHD_TRACE(("%s: Enter\n", __func__));
|
||||
BRCMF_TRACE(("%s: Enter\n", __func__));
|
||||
|
||||
if (!buf)
|
||||
return -EINVAL;
|
||||
|
@ -521,9 +521,9 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
|
|||
event_name = event_names[i].event_name;
|
||||
}
|
||||
|
||||
DHD_EVENT(("EVENT: %s, event ID = %d\n", event_name, event_type));
|
||||
DHD_EVENT(("flags 0x%04x, status %d, reason %d, auth_type %d MAC %s\n",
|
||||
flags, status, reason, auth_type, eabuf));
|
||||
BRCMF_EVENT(("EVENT: %s, event ID = %d\n", event_name, event_type));
|
||||
BRCMF_EVENT(("flags 0x%04x, status %d, reason %d, auth_type %d"
|
||||
" MAC %s\n", flags, status, reason, auth_type, eabuf));
|
||||
|
||||
if (flags & BRCMF_EVENT_MSG_LINK)
|
||||
link = true;
|
||||
|
@ -536,35 +536,36 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
|
|||
case BRCMF_E_START:
|
||||
case BRCMF_E_DEAUTH:
|
||||
case BRCMF_E_DISASSOC:
|
||||
DHD_EVENT(("MACEVENT: %s, MAC %s\n", event_name, eabuf));
|
||||
BRCMF_EVENT(("MACEVENT: %s, MAC %s\n", event_name, eabuf));
|
||||
break;
|
||||
|
||||
case BRCMF_E_ASSOC_IND:
|
||||
case BRCMF_E_REASSOC_IND:
|
||||
DHD_EVENT(("MACEVENT: %s, MAC %s\n", event_name, eabuf));
|
||||
BRCMF_EVENT(("MACEVENT: %s, MAC %s\n", event_name, eabuf));
|
||||
break;
|
||||
|
||||
case BRCMF_E_ASSOC:
|
||||
case BRCMF_E_REASSOC:
|
||||
if (status == BRCMF_E_STATUS_SUCCESS) {
|
||||
DHD_EVENT(("MACEVENT: %s, MAC %s, SUCCESS\n",
|
||||
event_name, eabuf));
|
||||
BRCMF_EVENT(("MACEVENT: %s, MAC %s, SUCCESS\n",
|
||||
event_name, eabuf));
|
||||
} else if (status == BRCMF_E_STATUS_TIMEOUT) {
|
||||
DHD_EVENT(("MACEVENT: %s, MAC %s, TIMEOUT\n",
|
||||
event_name, eabuf));
|
||||
BRCMF_EVENT(("MACEVENT: %s, MAC %s, TIMEOUT\n",
|
||||
event_name, eabuf));
|
||||
} else if (status == BRCMF_E_STATUS_FAIL) {
|
||||
DHD_EVENT(("MACEVENT: %s, MAC %s, FAILURE, reason %d\n",
|
||||
event_name, eabuf, (int)reason));
|
||||
BRCMF_EVENT(("MACEVENT: %s, MAC %s, FAILURE,"
|
||||
" reason %d\n", event_name, eabuf,
|
||||
(int)reason));
|
||||
} else {
|
||||
DHD_EVENT(("MACEVENT: %s, MAC %s, unexpected status "
|
||||
"%d\n", event_name, eabuf, (int)status));
|
||||
BRCMF_EVENT(("MACEVENT: %s, MAC %s, unexpected status "
|
||||
"%d\n", event_name, eabuf, (int)status));
|
||||
}
|
||||
break;
|
||||
|
||||
case BRCMF_E_DEAUTH_IND:
|
||||
case BRCMF_E_DISASSOC_IND:
|
||||
DHD_EVENT(("MACEVENT: %s, MAC %s, reason %d\n", event_name,
|
||||
eabuf, (int)reason));
|
||||
BRCMF_EVENT(("MACEVENT: %s, MAC %s, reason %d\n", event_name,
|
||||
eabuf, (int)reason));
|
||||
break;
|
||||
|
||||
case BRCMF_E_AUTH:
|
||||
|
@ -578,18 +579,18 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
|
|||
auth_str = err_msg;
|
||||
}
|
||||
if (event_type == BRCMF_E_AUTH_IND) {
|
||||
DHD_EVENT(("MACEVENT: %s, MAC %s, %s\n", event_name,
|
||||
eabuf, auth_str));
|
||||
BRCMF_EVENT(("MACEVENT: %s, MAC %s, %s\n", event_name,
|
||||
eabuf, auth_str));
|
||||
} else if (status == BRCMF_E_STATUS_SUCCESS) {
|
||||
DHD_EVENT(("MACEVENT: %s, MAC %s, %s, SUCCESS\n",
|
||||
event_name, eabuf, auth_str));
|
||||
BRCMF_EVENT(("MACEVENT: %s, MAC %s, %s, SUCCESS\n",
|
||||
event_name, eabuf, auth_str));
|
||||
} else if (status == BRCMF_E_STATUS_TIMEOUT) {
|
||||
DHD_EVENT(("MACEVENT: %s, MAC %s, %s, TIMEOUT\n",
|
||||
event_name, eabuf, auth_str));
|
||||
BRCMF_EVENT(("MACEVENT: %s, MAC %s, %s, TIMEOUT\n",
|
||||
event_name, eabuf, auth_str));
|
||||
} else if (status == BRCMF_E_STATUS_FAIL) {
|
||||
DHD_EVENT(("MACEVENT: %s, MAC %s, %s, FAILURE, "
|
||||
"reason %d\n",
|
||||
event_name, eabuf, auth_str, (int)reason));
|
||||
BRCMF_EVENT(("MACEVENT: %s, MAC %s, %s, FAILURE, "
|
||||
"reason %d\n",
|
||||
event_name, eabuf, auth_str, (int)reason));
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -598,64 +599,64 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
|
|||
case BRCMF_E_ROAM:
|
||||
case BRCMF_E_SET_SSID:
|
||||
if (status == BRCMF_E_STATUS_SUCCESS) {
|
||||
DHD_EVENT(("MACEVENT: %s, MAC %s\n", event_name,
|
||||
eabuf));
|
||||
BRCMF_EVENT(("MACEVENT: %s, MAC %s\n", event_name,
|
||||
eabuf));
|
||||
} else if (status == BRCMF_E_STATUS_FAIL) {
|
||||
DHD_EVENT(("MACEVENT: %s, failed\n", event_name));
|
||||
BRCMF_EVENT(("MACEVENT: %s, failed\n", event_name));
|
||||
} else if (status == BRCMF_E_STATUS_NO_NETWORKS) {
|
||||
DHD_EVENT(("MACEVENT: %s, no networks found\n",
|
||||
event_name));
|
||||
BRCMF_EVENT(("MACEVENT: %s, no networks found\n",
|
||||
event_name));
|
||||
} else {
|
||||
DHD_EVENT(("MACEVENT: %s, unexpected status %d\n",
|
||||
event_name, (int)status));
|
||||
BRCMF_EVENT(("MACEVENT: %s, unexpected status %d\n",
|
||||
event_name, (int)status));
|
||||
}
|
||||
break;
|
||||
|
||||
case BRCMF_E_BEACON_RX:
|
||||
if (status == BRCMF_E_STATUS_SUCCESS) {
|
||||
DHD_EVENT(("MACEVENT: %s, SUCCESS\n", event_name));
|
||||
BRCMF_EVENT(("MACEVENT: %s, SUCCESS\n", event_name));
|
||||
} else if (status == BRCMF_E_STATUS_FAIL) {
|
||||
DHD_EVENT(("MACEVENT: %s, FAIL\n", event_name));
|
||||
BRCMF_EVENT(("MACEVENT: %s, FAIL\n", event_name));
|
||||
} else {
|
||||
DHD_EVENT(("MACEVENT: %s, status %d\n", event_name,
|
||||
status));
|
||||
BRCMF_EVENT(("MACEVENT: %s, status %d\n", event_name,
|
||||
status));
|
||||
}
|
||||
break;
|
||||
|
||||
case BRCMF_E_LINK:
|
||||
DHD_EVENT(("MACEVENT: %s %s\n", event_name,
|
||||
link ? "UP" : "DOWN"));
|
||||
BRCMF_EVENT(("MACEVENT: %s %s\n", event_name,
|
||||
link ? "UP" : "DOWN"));
|
||||
break;
|
||||
|
||||
case BRCMF_E_MIC_ERROR:
|
||||
DHD_EVENT(("MACEVENT: %s, MAC %s, Group %d, Flush %d\n",
|
||||
event_name, eabuf, group, flush_txq));
|
||||
BRCMF_EVENT(("MACEVENT: %s, MAC %s, Group %d, Flush %d\n",
|
||||
event_name, eabuf, group, flush_txq));
|
||||
break;
|
||||
|
||||
case BRCMF_E_ICV_ERROR:
|
||||
case BRCMF_E_UNICAST_DECODE_ERROR:
|
||||
case BRCMF_E_MULTICAST_DECODE_ERROR:
|
||||
DHD_EVENT(("MACEVENT: %s, MAC %s\n", event_name, eabuf));
|
||||
BRCMF_EVENT(("MACEVENT: %s, MAC %s\n", event_name, eabuf));
|
||||
break;
|
||||
|
||||
case BRCMF_E_TXFAIL:
|
||||
DHD_EVENT(("MACEVENT: %s, RA %s\n", event_name, eabuf));
|
||||
BRCMF_EVENT(("MACEVENT: %s, RA %s\n", event_name, eabuf));
|
||||
break;
|
||||
|
||||
case BRCMF_E_SCAN_COMPLETE:
|
||||
case BRCMF_E_PMKID_CACHE:
|
||||
DHD_EVENT(("MACEVENT: %s\n", event_name));
|
||||
BRCMF_EVENT(("MACEVENT: %s\n", event_name));
|
||||
break;
|
||||
|
||||
case BRCMF_E_PFN_NET_FOUND:
|
||||
case BRCMF_E_PFN_NET_LOST:
|
||||
case BRCMF_E_PFN_SCAN_COMPLETE:
|
||||
DHD_EVENT(("PNOEVENT: %s\n", event_name));
|
||||
BRCMF_EVENT(("PNOEVENT: %s\n", event_name));
|
||||
break;
|
||||
|
||||
case BRCMF_E_PSK_SUP:
|
||||
case BRCMF_E_PRUNE:
|
||||
DHD_EVENT(("MACEVENT: %s, status %d, reason %d\n",
|
||||
BRCMF_EVENT(("MACEVENT: %s, status %d, reason %d\n",
|
||||
event_name, (int)status, (int)reason));
|
||||
break;
|
||||
|
||||
|
@ -670,7 +671,7 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
|
|||
memcpy(&hdr, buf, sizeof(struct msgtrace_hdr));
|
||||
|
||||
if (hdr.version != MSGTRACE_VERSION) {
|
||||
DHD_ERROR(
|
||||
BRCMF_ERROR(
|
||||
("\nMACEVENT: %s [unsupported version --> "
|
||||
"brcmf version:%d dongle version:%d]\n",
|
||||
event_name, MSGTRACE_VERSION, hdr.version)
|
||||
|
@ -686,7 +687,7 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
|
|||
|
||||
if (be32_to_cpu(hdr.discarded_bytes)
|
||||
|| be32_to_cpu(hdr.discarded_printf)) {
|
||||
DHD_ERROR(
|
||||
BRCMF_ERROR(
|
||||
("\nWLC_E_TRACE: [Discarded traces in dongle -->"
|
||||
"discarded_bytes %d discarded_printf %d]\n",
|
||||
be32_to_cpu(hdr.discarded_bytes),
|
||||
|
@ -695,7 +696,7 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
|
|||
|
||||
nblost = be32_to_cpu(hdr.seqnum) - seqnum_prev - 1;
|
||||
if (nblost > 0) {
|
||||
DHD_ERROR(
|
||||
BRCMF_ERROR(
|
||||
("\nWLC_E_TRACE: [Event lost --> seqnum %d nblost %d\n",
|
||||
be32_to_cpu(hdr.seqnum), nblost));
|
||||
}
|
||||
|
@ -719,24 +720,24 @@ brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
|
|||
break;
|
||||
|
||||
case BRCMF_E_RSSI:
|
||||
DHD_EVENT(("MACEVENT: %s %d\n", event_name,
|
||||
be32_to_cpu(*((int *)event_data))));
|
||||
BRCMF_EVENT(("MACEVENT: %s %d\n", event_name,
|
||||
be32_to_cpu(*((int *)event_data))));
|
||||
break;
|
||||
|
||||
default:
|
||||
DHD_EVENT(("MACEVENT: %s %d, MAC %s, status %d, reason %d, "
|
||||
"auth %d\n", event_name, event_type, eabuf,
|
||||
(int)status, (int)reason, (int)auth_type));
|
||||
BRCMF_EVENT(("MACEVENT: %s %d, MAC %s, status %d, reason %d, "
|
||||
"auth %d\n", event_name, event_type, eabuf,
|
||||
(int)status, (int)reason, (int)auth_type));
|
||||
break;
|
||||
}
|
||||
|
||||
/* show any appended data */
|
||||
if (datalen) {
|
||||
buf = (unsigned char *) event_data;
|
||||
DHD_EVENT((" data (%d) : ", datalen));
|
||||
BRCMF_EVENT((" data (%d) : ", datalen));
|
||||
for (i = 0; i < datalen; i++)
|
||||
DHD_EVENT((" 0x%02x ", *buf++));
|
||||
DHD_EVENT(("\n"));
|
||||
BRCMF_EVENT((" 0x%02x ", *buf++));
|
||||
BRCMF_EVENT(("\n"));
|
||||
}
|
||||
}
|
||||
#endif /* SHOW_EVENTS */
|
||||
|
@ -753,14 +754,14 @@ brcmf_c_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
|
|||
int evlen;
|
||||
|
||||
if (memcmp(BRCM_OUI, &pvt_data->hdr.oui[0], DOT11_OUI_LEN)) {
|
||||
DHD_ERROR(("%s: mismatched OUI, bailing\n", __func__));
|
||||
BRCMF_ERROR(("%s: mismatched OUI, bailing\n", __func__));
|
||||
return -EBADE;
|
||||
}
|
||||
|
||||
/* BRCM event pkt may be unaligned - use xxx_ua to load user_subtype. */
|
||||
if (get_unaligned_be16(&pvt_data->hdr.usr_subtype) !=
|
||||
BCMILCP_BCM_SUBTYPE_EVENT) {
|
||||
DHD_ERROR(("%s: mismatched subtype, bailing\n", __func__));
|
||||
BRCMF_ERROR(("%s: mismatched subtype, bailing\n", __func__));
|
||||
return -EBADE;
|
||||
}
|
||||
|
||||
|
@ -781,7 +782,7 @@ brcmf_c_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
|
|||
{
|
||||
struct brcmf_if_event *ifevent =
|
||||
(struct brcmf_if_event *) event_data;
|
||||
DHD_TRACE(("%s: if event\n", __func__));
|
||||
BRCMF_TRACE(("%s: if event\n", __func__));
|
||||
|
||||
if (ifevent->ifidx > 0 &&
|
||||
ifevent->ifidx < BRCMF_MAX_IFS) {
|
||||
|
@ -794,9 +795,9 @@ brcmf_c_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
|
|||
else
|
||||
brcmf_del_if(drvr_priv, ifevent->ifidx);
|
||||
} else {
|
||||
DHD_ERROR(("%s: Invalid ifidx %d for %s\n",
|
||||
__func__, ifevent->ifidx,
|
||||
event->ifname));
|
||||
BRCMF_ERROR(("%s: Invalid ifidx %d for %s\n",
|
||||
__func__, ifevent->ifidx,
|
||||
event->ifname));
|
||||
}
|
||||
}
|
||||
/* send up the if event: btamp user needs it */
|
||||
|
@ -813,15 +814,16 @@ brcmf_c_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
|
|||
/* Fall through: this should get _everything_ */
|
||||
|
||||
*ifidx = brcmf_ifname2idx(drvr_priv, event->ifname);
|
||||
DHD_TRACE(("%s: MAC event %d, flags %x, status %x\n",
|
||||
__func__, type, flags, status));
|
||||
BRCMF_TRACE(("%s: MAC event %d, flags %x, status %x\n",
|
||||
__func__, type, flags, status));
|
||||
|
||||
/* put it back to BRCMF_E_NDIS_LINK */
|
||||
if (type == BRCMF_E_NDIS_LINK) {
|
||||
u32 temp;
|
||||
|
||||
temp = get_unaligned_be32(&event->event_type);
|
||||
DHD_TRACE(("Converted to WLC_E_LINK type %d\n", temp));
|
||||
BRCMF_TRACE(("Converted to WLC_E_LINK type %d\n",
|
||||
temp));
|
||||
|
||||
temp = be32_to_cpu(BRCMF_E_NDIS_LINK);
|
||||
memcpy((void *)(&pvt_data->msg.event_type), &temp,
|
||||
|
@ -842,12 +844,12 @@ static int brcmf_c_pattern_atoh(char *src, char *dst)
|
|||
{
|
||||
int i;
|
||||
if (strncmp(src, "0x", 2) != 0 && strncmp(src, "0X", 2) != 0) {
|
||||
DHD_ERROR(("Mask invalid format. Needs to start with 0x\n"));
|
||||
BRCMF_ERROR(("Mask invalid format. Needs to start with 0x\n"));
|
||||
return -1;
|
||||
}
|
||||
src = src + 2; /* Skip past 0x */
|
||||
if (strlen(src) % 2 != 0) {
|
||||
DHD_ERROR(("Mask invalid format. Length must be even.\n"));
|
||||
BRCMF_ERROR(("Mask invalid format. Length must be even.\n"));
|
||||
return -1;
|
||||
}
|
||||
for (i = 0; *src != '\0'; i++) {
|
||||
|
@ -877,7 +879,7 @@ brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg, int enable,
|
|||
|
||||
arg_save = kmalloc(strlen(arg) + 1, GFP_ATOMIC);
|
||||
if (!arg_save) {
|
||||
DHD_ERROR(("%s: kmalloc failed\n", __func__));
|
||||
BRCMF_ERROR(("%s: kmalloc failed\n", __func__));
|
||||
goto fail;
|
||||
}
|
||||
arg_org = arg_save;
|
||||
|
@ -887,7 +889,7 @@ brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg, int enable,
|
|||
|
||||
i = 0;
|
||||
if (NULL == argv[i]) {
|
||||
DHD_ERROR(("No args provided\n"));
|
||||
BRCMF_ERROR(("No args provided\n"));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -912,11 +914,11 @@ brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg, int enable,
|
|||
rc = brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR, buf, buf_len);
|
||||
rc = rc >= 0 ? 0 : rc;
|
||||
if (rc)
|
||||
DHD_TRACE(("%s: failed to add pktfilter %s, retcode = %d\n",
|
||||
__func__, arg, rc));
|
||||
BRCMF_TRACE(("%s: failed to add pktfilter %s, retcode = %d\n",
|
||||
__func__, arg, rc));
|
||||
else
|
||||
DHD_TRACE(("%s: successfully added pktfilter %s\n",
|
||||
__func__, arg));
|
||||
BRCMF_TRACE(("%s: successfully added pktfilter %s\n",
|
||||
__func__, arg));
|
||||
|
||||
/* Contorl the master mode */
|
||||
brcmu_mkiovar("pkt_filter_mode", (char *)&master_mode, 4, buf,
|
||||
|
@ -925,8 +927,8 @@ brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg, int enable,
|
|||
sizeof(buf));
|
||||
rc = rc >= 0 ? 0 : rc;
|
||||
if (rc)
|
||||
DHD_TRACE(("%s: failed to add pktfilter %s, retcode = %d\n",
|
||||
__func__, arg, rc));
|
||||
BRCMF_TRACE(("%s: failed to add pktfilter %s, retcode = %d\n",
|
||||
__func__, arg, rc));
|
||||
|
||||
fail:
|
||||
kfree(arg_org);
|
||||
|
@ -948,7 +950,7 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
|
|||
|
||||
arg_save = kmalloc(strlen(arg) + 1, GFP_ATOMIC);
|
||||
if (!arg_save) {
|
||||
DHD_ERROR(("%s: kmalloc failed\n", __func__));
|
||||
BRCMF_ERROR(("%s: kmalloc failed\n", __func__));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -956,15 +958,15 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
|
|||
|
||||
buf = kmalloc(PKTFILTER_BUF_SIZE, GFP_ATOMIC);
|
||||
if (!buf) {
|
||||
DHD_ERROR(("%s: kmalloc failed\n", __func__));
|
||||
BRCMF_ERROR(("%s: kmalloc failed\n", __func__));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
memcpy(arg_save, arg, strlen(arg) + 1);
|
||||
|
||||
if (strlen(arg) > PKTFILTER_BUF_SIZE) {
|
||||
DHD_ERROR(("Not enough buffer %d < %d\n", (int)strlen(arg),
|
||||
(int)sizeof(buf)));
|
||||
BRCMF_ERROR(("Not enough buffer %d < %d\n", (int)strlen(arg),
|
||||
(int)sizeof(buf)));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -974,7 +976,7 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
|
|||
|
||||
i = 0;
|
||||
if (NULL == argv[i]) {
|
||||
DHD_ERROR(("No args provided\n"));
|
||||
BRCMF_ERROR(("No args provided\n"));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -990,7 +992,7 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
|
|||
pkt_filter.id = simple_strtoul(argv[i], NULL, 0);
|
||||
|
||||
if (NULL == argv[++i]) {
|
||||
DHD_ERROR(("Polarity not provided\n"));
|
||||
BRCMF_ERROR(("Polarity not provided\n"));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -998,7 +1000,7 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
|
|||
pkt_filter.negate_match = simple_strtoul(argv[i], NULL, 0);
|
||||
|
||||
if (NULL == argv[++i]) {
|
||||
DHD_ERROR(("Filter type not provided\n"));
|
||||
BRCMF_ERROR(("Filter type not provided\n"));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -1006,7 +1008,7 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
|
|||
pkt_filter.type = simple_strtoul(argv[i], NULL, 0);
|
||||
|
||||
if (NULL == argv[++i]) {
|
||||
DHD_ERROR(("Offset not provided\n"));
|
||||
BRCMF_ERROR(("Offset not provided\n"));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -1014,7 +1016,7 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
|
|||
pkt_filter.u.pattern.offset = simple_strtoul(argv[i], NULL, 0);
|
||||
|
||||
if (NULL == argv[++i]) {
|
||||
DHD_ERROR(("Bitmask not provided\n"));
|
||||
BRCMF_ERROR(("Bitmask not provided\n"));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -1024,7 +1026,7 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
|
|||
(argv[i], (char *)pkt_filterp->u.pattern.mask_and_pattern);
|
||||
|
||||
if (NULL == argv[++i]) {
|
||||
DHD_ERROR(("Pattern not provided\n"));
|
||||
BRCMF_ERROR(("Pattern not provided\n"));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -1035,7 +1037,7 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
|
|||
mask_and_pattern[mask_size]);
|
||||
|
||||
if (mask_size != pattern_size) {
|
||||
DHD_ERROR(("Mask and pattern not the same size\n"));
|
||||
BRCMF_ERROR(("Mask and pattern not the same size\n"));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -1056,11 +1058,11 @@ void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
|
|||
rc = rc >= 0 ? 0 : rc;
|
||||
|
||||
if (rc)
|
||||
DHD_TRACE(("%s: failed to add pktfilter %s, retcode = %d\n",
|
||||
__func__, arg, rc));
|
||||
BRCMF_TRACE(("%s: failed to add pktfilter %s, retcode = %d\n",
|
||||
__func__, arg, rc));
|
||||
else
|
||||
DHD_TRACE(("%s: successfully added pktfilter %s\n",
|
||||
__func__, arg));
|
||||
BRCMF_TRACE(("%s: successfully added pktfilter %s\n",
|
||||
__func__, arg));
|
||||
|
||||
fail:
|
||||
kfree(arg_org);
|
||||
|
@ -1078,11 +1080,11 @@ void brcmf_c_arp_offload_set(struct brcmf_pub *drvr, int arp_mode)
|
|||
iovbuf, sizeof(iovbuf));
|
||||
retcode = retcode >= 0 ? 0 : retcode;
|
||||
if (retcode)
|
||||
DHD_TRACE(("%s: failed to set ARP offload mode to 0x%x, "
|
||||
"retcode = %d\n", __func__, arp_mode, retcode));
|
||||
BRCMF_TRACE(("%s: failed to set ARP offload mode to 0x%x, "
|
||||
"retcode = %d\n", __func__, arp_mode, retcode));
|
||||
else
|
||||
DHD_TRACE(("%s: successfully set ARP offload mode to 0x%x\n",
|
||||
__func__, arp_mode));
|
||||
BRCMF_TRACE(("%s: successfully set ARP offload mode to 0x%x\n",
|
||||
__func__, arp_mode));
|
||||
}
|
||||
|
||||
void brcmf_c_arp_offload_enable(struct brcmf_pub *drvr, int arp_enable)
|
||||
|
@ -1095,11 +1097,11 @@ void brcmf_c_arp_offload_enable(struct brcmf_pub *drvr, int arp_enable)
|
|||
iovbuf, sizeof(iovbuf));
|
||||
retcode = retcode >= 0 ? 0 : retcode;
|
||||
if (retcode)
|
||||
DHD_TRACE(("%s: failed to enabe ARP offload to %d, "
|
||||
"retcode = %d\n", __func__, arp_enable, retcode));
|
||||
BRCMF_TRACE(("%s: failed to enabe ARP offload to %d, "
|
||||
"retcode = %d\n", __func__, arp_enable, retcode));
|
||||
else
|
||||
DHD_TRACE(("%s: successfully enabed ARP offload to %d\n",
|
||||
__func__, arp_enable));
|
||||
BRCMF_TRACE(("%s: successfully enabed ARP offload to %d\n",
|
||||
__func__, arp_enable));
|
||||
}
|
||||
|
||||
int brcmf_c_preinit_ioctls(struct brcmf_pub *drvr)
|
||||
|
@ -1123,8 +1125,8 @@ int brcmf_c_preinit_ioctls(struct brcmf_pub *drvr)
|
|||
if (brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_COUNTRY,
|
||||
drvr->country_code,
|
||||
sizeof(drvr->country_code)) < 0) {
|
||||
DHD_ERROR(("%s: country code setting failed\n",
|
||||
__func__));
|
||||
BRCMF_ERROR(("%s: country code setting failed\n",
|
||||
__func__));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1135,7 +1137,7 @@ int brcmf_c_preinit_ioctls(struct brcmf_pub *drvr)
|
|||
brcmf_proto_cdc_query_ioctl(drvr, 0, BRCMF_C_GET_VAR, buf, sizeof(buf));
|
||||
strsep(&ptr, "\n");
|
||||
/* Print fw version info */
|
||||
DHD_ERROR(("Firmware version = %s\n", buf));
|
||||
BRCMF_ERROR(("Firmware version = %s\n", buf));
|
||||
|
||||
/* Set PowerSave mode */
|
||||
brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_PM, (char *)&power_mode,
|
||||
|
|
|
@ -19,55 +19,49 @@
|
|||
|
||||
#if defined(BCMDBG)
|
||||
|
||||
#define DHD_ERROR(args) \
|
||||
#define BRCMF_ERROR(args) \
|
||||
do {if ((brcmf_msg_level & BRCMF_ERROR_VAL) && (net_ratelimit())) \
|
||||
printk args; } while (0)
|
||||
#define DHD_TRACE(args) do {if (brcmf_msg_level & BRCMF_TRACE_VAL) \
|
||||
#define BRCMF_TRACE(args) do {if (brcmf_msg_level & BRCMF_TRACE_VAL) \
|
||||
printk args; } while (0)
|
||||
#define DHD_INFO(args) do {if (brcmf_msg_level & BRCMF_INFO_VAL) \
|
||||
#define BRCMF_INFO(args) do {if (brcmf_msg_level & BRCMF_INFO_VAL) \
|
||||
printk args; } while (0)
|
||||
#define DHD_DATA(args) do {if (brcmf_msg_level & BRCMF_DATA_VAL) \
|
||||
#define BRCMF_DATA(args) do {if (brcmf_msg_level & BRCMF_DATA_VAL) \
|
||||
printk args; } while (0)
|
||||
#define DHD_CTL(args) do {if (brcmf_msg_level & BRCMF_CTL_VAL) \
|
||||
#define BRCMF_CTL(args) do {if (brcmf_msg_level & BRCMF_CTL_VAL) \
|
||||
printk args; } while (0)
|
||||
#define DHD_TIMER(args) do {if (brcmf_msg_level & BRCMF_TIMER_VAL) \
|
||||
#define BRCMF_TIMER(args) do {if (brcmf_msg_level & BRCMF_TIMER_VAL) \
|
||||
printk args; } while (0)
|
||||
#define DHD_HDRS(args) do {if (brcmf_msg_level & BRCMF_HDRS_VAL) \
|
||||
#define BRCMF_INTR(args) do {if (brcmf_msg_level & BRCMF_INTR_VAL) \
|
||||
printk args; } while (0)
|
||||
#define DHD_BYTES(args) do {if (brcmf_msg_level & BRCMF_BYTES_VAL) \
|
||||
#define BRCMF_GLOM(args) do {if (brcmf_msg_level & BRCMF_GLOM_VAL) \
|
||||
printk args; } while (0)
|
||||
#define DHD_INTR(args) do {if (brcmf_msg_level & BRCMF_INTR_VAL) \
|
||||
printk args; } while (0)
|
||||
#define DHD_GLOM(args) do {if (brcmf_msg_level & BRCMF_GLOM_VAL) \
|
||||
printk args; } while (0)
|
||||
#define DHD_EVENT(args) do {if (brcmf_msg_level & BRCMF_EVENT_VAL) \
|
||||
#define BRCMF_EVENT(args) do {if (brcmf_msg_level & BRCMF_EVENT_VAL) \
|
||||
printk args; } while (0)
|
||||
|
||||
#define DHD_DATA_ON() (brcmf_msg_level & BRCMF_DATA_VAL)
|
||||
#define DHD_CTL_ON() (brcmf_msg_level & BRCMF_CTL_VAL)
|
||||
#define DHD_HDRS_ON() (brcmf_msg_level & BRCMF_HDRS_VAL)
|
||||
#define DHD_BYTES_ON() (brcmf_msg_level & BRCMF_BYTES_VAL)
|
||||
#define DHD_GLOM_ON() (brcmf_msg_level & BRCMF_GLOM_VAL)
|
||||
#define BRCMF_DATA_ON() (brcmf_msg_level & BRCMF_DATA_VAL)
|
||||
#define BRCMF_CTL_ON() (brcmf_msg_level & BRCMF_CTL_VAL)
|
||||
#define BRCMF_HDRS_ON() (brcmf_msg_level & BRCMF_HDRS_VAL)
|
||||
#define BRCMF_BYTES_ON() (brcmf_msg_level & BRCMF_BYTES_VAL)
|
||||
#define BRCMF_GLOM_ON() (brcmf_msg_level & BRCMF_GLOM_VAL)
|
||||
|
||||
#else /* (defined BCMDBG) || (defined BCMDBG) */
|
||||
|
||||
#define DHD_ERROR(args) do {if (net_ratelimit()) printk args; } while (0)
|
||||
#define DHD_TRACE(args)
|
||||
#define DHD_INFO(args)
|
||||
#define DHD_DATA(args)
|
||||
#define DHD_CTL(args)
|
||||
#define DHD_TIMER(args)
|
||||
#define DHD_HDRS(args)
|
||||
#define DHD_BYTES(args)
|
||||
#define DHD_INTR(args)
|
||||
#define DHD_GLOM(args)
|
||||
#define DHD_EVENT(args)
|
||||
#define BRCMF_ERROR(args) do {if (net_ratelimit()) printk args; } while (0)
|
||||
#define BRCMF_TRACE(args)
|
||||
#define BRCMF_INFO(args)
|
||||
#define BRCMF_DATA(args)
|
||||
#define BRCMF_CTL(args)
|
||||
#define BRCMF_TIMER(args)
|
||||
#define BRCMF_INTR(args)
|
||||
#define BRCMF_GLOM(args)
|
||||
#define BRCMF_EVENT(args)
|
||||
|
||||
#define DHD_DATA_ON() 0
|
||||
#define DHD_CTL_ON() 0
|
||||
#define DHD_HDRS_ON() 0
|
||||
#define DHD_BYTES_ON() 0
|
||||
#define DHD_GLOM_ON() 0
|
||||
#define BRCMF_DATA_ON() 0
|
||||
#define BRCMF_CTL_ON() 0
|
||||
#define BRCMF_HDRS_ON() 0
|
||||
#define BRCMF_BYTES_ON() 0
|
||||
#define BRCMF_GLOM_ON() 0
|
||||
|
||||
#endif /* defined(BCMDBG) */
|
||||
|
||||
|
|
|
@ -259,7 +259,7 @@ int brcmf_ifname2idx(struct brcmf_info *drvr_priv, char *name)
|
|||
&& !strncmp(drvr_priv->iflist[i]->name, name, IFNAMSIZ))
|
||||
break;
|
||||
|
||||
DHD_TRACE(("%s: return idx %d for \"%s\"\n", __func__, i, name));
|
||||
BRCMF_TRACE(("%s: return idx %d for \"%s\"\n", __func__, i, name));
|
||||
|
||||
return i; /* default - the primary interface */
|
||||
}
|
||||
|
@ -271,12 +271,12 @@ char *brcmf_ifname(struct brcmf_pub *drvr, int ifidx)
|
|||
ASSERT(drvr_priv);
|
||||
|
||||
if (ifidx < 0 || ifidx >= BRCMF_MAX_IFS) {
|
||||
DHD_ERROR(("%s: ifidx %d out of range\n", __func__, ifidx));
|
||||
BRCMF_ERROR(("%s: ifidx %d out of range\n", __func__, ifidx));
|
||||
return "<if_bad>";
|
||||
}
|
||||
|
||||
if (drvr_priv->iflist[ifidx] == NULL) {
|
||||
DHD_ERROR(("%s: null i/f %d\n", __func__, ifidx));
|
||||
BRCMF_ERROR(("%s: null i/f %d\n", __func__, ifidx));
|
||||
return "<if_null>";
|
||||
}
|
||||
|
||||
|
@ -309,8 +309,8 @@ static void _brcmf_set_multicast_list(struct brcmf_info *drvr_priv, int ifidx)
|
|||
buflen = sizeof("mcast_list") + sizeof(cnt) + (cnt * ETH_ALEN);
|
||||
bufp = buf = kmalloc(buflen, GFP_ATOMIC);
|
||||
if (!bufp) {
|
||||
DHD_ERROR(("%s: out of memory for mcast_list, cnt %d\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx), cnt));
|
||||
BRCMF_ERROR(("%s: out of memory for mcast_list, cnt %d\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx), cnt));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -337,8 +337,8 @@ static void _brcmf_set_multicast_list(struct brcmf_info *drvr_priv, int ifidx)
|
|||
|
||||
ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
|
||||
if (ret < 0) {
|
||||
DHD_ERROR(("%s: set mcast_list failed, cnt %d\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx), cnt));
|
||||
BRCMF_ERROR(("%s: set mcast_list failed, cnt %d\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx), cnt));
|
||||
allmulti = cnt ? true : allmulti;
|
||||
}
|
||||
|
||||
|
@ -352,17 +352,18 @@ static void _brcmf_set_multicast_list(struct brcmf_info *drvr_priv, int ifidx)
|
|||
buflen = sizeof("allmulti") + sizeof(allmulti);
|
||||
buf = kmalloc(buflen, GFP_ATOMIC);
|
||||
if (!buf) {
|
||||
DHD_ERROR(("%s: out of memory for allmulti\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx)));
|
||||
BRCMF_ERROR(("%s: out of memory for allmulti\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx)));
|
||||
return;
|
||||
}
|
||||
allmulti = cpu_to_le32(allmulti);
|
||||
|
||||
if (!brcmu_mkiovar
|
||||
("allmulti", (void *)&allmulti, sizeof(allmulti), buf, buflen)) {
|
||||
DHD_ERROR(("%s: mkiovar failed for allmulti, datalen %d "
|
||||
"buflen %u\n", brcmf_ifname(&drvr_priv->pub, ifidx),
|
||||
(int)sizeof(allmulti), buflen));
|
||||
BRCMF_ERROR(("%s: mkiovar failed for allmulti, datalen %d "
|
||||
"buflen %u\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx),
|
||||
(int)sizeof(allmulti), buflen));
|
||||
kfree(buf);
|
||||
return;
|
||||
}
|
||||
|
@ -375,9 +376,9 @@ static void _brcmf_set_multicast_list(struct brcmf_info *drvr_priv, int ifidx)
|
|||
|
||||
ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
|
||||
if (ret < 0) {
|
||||
DHD_ERROR(("%s: set allmulti %d failed\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx),
|
||||
le32_to_cpu(allmulti)));
|
||||
BRCMF_ERROR(("%s: set allmulti %d failed\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx),
|
||||
le32_to_cpu(allmulti)));
|
||||
}
|
||||
|
||||
kfree(buf);
|
||||
|
@ -396,9 +397,9 @@ static void _brcmf_set_multicast_list(struct brcmf_info *drvr_priv, int ifidx)
|
|||
|
||||
ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
|
||||
if (ret < 0) {
|
||||
DHD_ERROR(("%s: set promisc %d failed\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx),
|
||||
le32_to_cpu(allmulti)));
|
||||
BRCMF_ERROR(("%s: set promisc %d failed\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx),
|
||||
le32_to_cpu(allmulti)));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -408,11 +409,11 @@ static int _brcmf_set_mac_address(struct brcmf_info *drvr_priv, int ifidx, u8 *a
|
|||
struct brcmf_ioctl ioc;
|
||||
int ret;
|
||||
|
||||
DHD_TRACE(("%s enter\n", __func__));
|
||||
BRCMF_TRACE(("%s enter\n", __func__));
|
||||
if (!brcmu_mkiovar
|
||||
("cur_etheraddr", (char *)addr, ETH_ALEN, buf, 32)) {
|
||||
DHD_ERROR(("%s: mkiovar failed for cur_etheraddr\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx)));
|
||||
BRCMF_ERROR(("%s: mkiovar failed for cur_etheraddr\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx)));
|
||||
return -1;
|
||||
}
|
||||
memset(&ioc, 0, sizeof(ioc));
|
||||
|
@ -423,8 +424,8 @@ static int _brcmf_set_mac_address(struct brcmf_info *drvr_priv, int ifidx, u8 *a
|
|||
|
||||
ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
|
||||
if (ret < 0) {
|
||||
DHD_ERROR(("%s: set cur_etheraddr failed\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx)));
|
||||
BRCMF_ERROR(("%s: set cur_etheraddr failed\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx)));
|
||||
} else {
|
||||
memcpy(drvr_priv->iflist[ifidx]->net->dev_addr, addr, ETH_ALEN);
|
||||
}
|
||||
|
@ -445,7 +446,7 @@ static void brcmf_op_if(struct brcmf_if *ifp)
|
|||
|
||||
drvr_priv = ifp->info;
|
||||
|
||||
DHD_TRACE(("%s: idx %d, state %d\n", __func__, ifp->idx, ifp->state));
|
||||
BRCMF_TRACE(("%s: idx %d, state %d\n", __func__, ifp->idx, ifp->state));
|
||||
|
||||
switch (ifp->state) {
|
||||
case BRCMF_E_IF_ADD:
|
||||
|
@ -454,9 +455,9 @@ static void brcmf_op_if(struct brcmf_if *ifp)
|
|||
* in case we missed the BRCMF_E_IF_DEL event.
|
||||
*/
|
||||
if (ifp->net != NULL) {
|
||||
DHD_ERROR(("%s: ERROR: netdev:%s already exists, "
|
||||
"try free & unregister\n",
|
||||
__func__, ifp->net->name));
|
||||
BRCMF_ERROR(("%s: ERROR: netdev:%s already exists, "
|
||||
"try free & unregister\n",
|
||||
__func__, ifp->net->name));
|
||||
netif_stop_queue(ifp->net);
|
||||
unregister_netdev(ifp->net);
|
||||
free_netdev(ifp->net);
|
||||
|
@ -464,7 +465,7 @@ static void brcmf_op_if(struct brcmf_if *ifp)
|
|||
/* Allocate etherdev, including space for private structure */
|
||||
ifp->net = alloc_etherdev(sizeof(drvr_priv));
|
||||
if (!ifp->net) {
|
||||
DHD_ERROR(("%s: OOM - alloc_etherdev\n", __func__));
|
||||
BRCMF_ERROR(("%s: OOM - alloc_etherdev\n", __func__));
|
||||
ret = -ENOMEM;
|
||||
}
|
||||
if (ret == 0) {
|
||||
|
@ -472,9 +473,9 @@ static void brcmf_op_if(struct brcmf_if *ifp)
|
|||
memcpy(netdev_priv(ifp->net), &drvr_priv, sizeof(drvr_priv));
|
||||
err = brcmf_net_attach(&drvr_priv->pub, ifp->idx);
|
||||
if (err != 0) {
|
||||
DHD_ERROR(("%s: brcmf_net_attach failed, "
|
||||
"err %d\n",
|
||||
__func__, err));
|
||||
BRCMF_ERROR(("%s: brcmf_net_attach failed, "
|
||||
"err %d\n",
|
||||
__func__, err));
|
||||
ret = -EOPNOTSUPP;
|
||||
} else {
|
||||
#ifdef SOFTAP
|
||||
|
@ -489,17 +490,17 @@ static void brcmf_op_if(struct brcmf_if *ifp)
|
|||
wl0.1 is ready */
|
||||
up(&ap_eth_sema);
|
||||
#endif
|
||||
DHD_TRACE(("\n ==== pid:%x, net_device for "
|
||||
"if:%s created ===\n\n",
|
||||
current->pid, ifp->net->name));
|
||||
BRCMF_TRACE(("\n ==== pid:%x, net_device for "
|
||||
"if:%s created ===\n\n",
|
||||
current->pid, ifp->net->name));
|
||||
ifp->state = 0;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case BRCMF_E_IF_DEL:
|
||||
if (ifp->net != NULL) {
|
||||
DHD_TRACE(("\n%s: got 'WLC_E_IF_DEL' state\n",
|
||||
__func__));
|
||||
BRCMF_TRACE(("\n%s: got 'WLC_E_IF_DEL' state\n",
|
||||
__func__));
|
||||
netif_stop_queue(ifp->net);
|
||||
unregister_netdev(ifp->net);
|
||||
ret = BRCMF_DEL_IF; /* Make sure the free_netdev()
|
||||
|
@ -507,7 +508,7 @@ static void brcmf_op_if(struct brcmf_if *ifp)
|
|||
}
|
||||
break;
|
||||
default:
|
||||
DHD_ERROR(("%s: bad op %d\n", __func__, ifp->state));
|
||||
BRCMF_ERROR(("%s: bad op %d\n", __func__, ifp->state));
|
||||
ASSERT(!ifp->state);
|
||||
break;
|
||||
}
|
||||
|
@ -540,32 +541,35 @@ static int _brcmf_sysioc_thread(void *data)
|
|||
if (kthread_should_stop())
|
||||
break;
|
||||
for (i = 0; i < BRCMF_MAX_IFS; i++) {
|
||||
if (drvr_priv->iflist[i]) {
|
||||
struct brcmf_if *ifentry = drvr_priv->iflist[i];
|
||||
if (ifentry) {
|
||||
#ifdef SOFTAP
|
||||
in_ap = (ap_net_dev != NULL);
|
||||
#endif /* SOFTAP */
|
||||
if (drvr_priv->iflist[i]->state)
|
||||
brcmf_op_if(drvr_priv->iflist[i]);
|
||||
if (ifentry->state)
|
||||
brcmf_op_if(ifentry);
|
||||
#ifdef SOFTAP
|
||||
if (drvr_priv->iflist[i] == NULL) {
|
||||
DHD_TRACE(("\n\n %s: interface %d "
|
||||
"removed!\n", __func__, i));
|
||||
BRCMF_TRACE(("\n\n %s: interface %d "
|
||||
"removed!\n", __func__,
|
||||
i));
|
||||
continue;
|
||||
}
|
||||
|
||||
if (in_ap && drvr_priv->set_macaddress) {
|
||||
DHD_TRACE(("attempt to set MAC for %s "
|
||||
"in AP Mode," "blocked.\n",
|
||||
drvr_priv->iflist[i]->net->name));
|
||||
BRCMF_TRACE(("attempt to set MAC for"
|
||||
" %s in AP Mode,"
|
||||
" blocked.\n",
|
||||
ifentry->net->name));
|
||||
drvr_priv->set_macaddress = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (in_ap && drvr_priv->set_multicast) {
|
||||
DHD_TRACE(("attempt to set MULTICAST "
|
||||
"list for %s in AP Mode, "
|
||||
"blocked.\n",
|
||||
drvr_priv->iflist[i]->net->name));
|
||||
BRCMF_TRACE(("attempt to set MULTICAST "
|
||||
"list for %s in AP Mode, "
|
||||
"blocked.\n",
|
||||
ifentry->net->name));
|
||||
drvr_priv->set_multicast = false;
|
||||
continue;
|
||||
}
|
||||
|
@ -577,7 +581,7 @@ static int _brcmf_sysioc_thread(void *data)
|
|||
if (drvr_priv->set_macaddress) {
|
||||
drvr_priv->set_macaddress = false;
|
||||
_brcmf_set_mac_address(drvr_priv, i,
|
||||
drvr_priv->macvalue);
|
||||
drvr_priv->macvalue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -651,19 +655,20 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *net)
|
|||
struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
|
||||
int ifidx;
|
||||
|
||||
DHD_TRACE(("%s: Enter\n", __func__));
|
||||
BRCMF_TRACE(("%s: Enter\n", __func__));
|
||||
|
||||
/* Reject if down */
|
||||
if (!drvr_priv->pub.up || (drvr_priv->pub.busstate == BRCMF_BUS_DOWN)) {
|
||||
DHD_ERROR(("%s: xmit rejected pub.up=%d busstate=%d\n",
|
||||
__func__, drvr_priv->pub.up, drvr_priv->pub.busstate));
|
||||
BRCMF_ERROR(("%s: xmit rejected pub.up=%d busstate=%d\n",
|
||||
__func__, drvr_priv->pub.up,
|
||||
drvr_priv->pub.busstate));
|
||||
netif_stop_queue(net);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
ifidx = brcmf_net2idx(drvr_priv, net);
|
||||
if (ifidx == BRCMF_BAD_IF) {
|
||||
DHD_ERROR(("%s: bad ifidx %d\n", __func__, ifidx));
|
||||
BRCMF_ERROR(("%s: bad ifidx %d\n", __func__, ifidx));
|
||||
netif_stop_queue(net);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
@ -672,15 +677,15 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *net)
|
|||
if (skb_headroom(skb) < drvr_priv->pub.hdrlen) {
|
||||
struct sk_buff *skb2;
|
||||
|
||||
DHD_INFO(("%s: insufficient headroom\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx)));
|
||||
BRCMF_INFO(("%s: insufficient headroom\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx)));
|
||||
drvr_priv->pub.tx_realloc++;
|
||||
skb2 = skb_realloc_headroom(skb, drvr_priv->pub.hdrlen);
|
||||
dev_kfree_skb(skb);
|
||||
skb = skb2;
|
||||
if (skb == NULL) {
|
||||
DHD_ERROR(("%s: skb_realloc_headroom failed\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx)));
|
||||
BRCMF_ERROR(("%s: skb_realloc_headroom failed\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx)));
|
||||
ret = -ENOMEM;
|
||||
goto done;
|
||||
}
|
||||
|
@ -703,7 +708,7 @@ void brcmf_txflowcontrol(struct brcmf_pub *drvr, int ifidx, bool state)
|
|||
struct net_device *net;
|
||||
struct brcmf_info *drvr_priv = drvr->info;
|
||||
|
||||
DHD_TRACE(("%s: Enter\n", __func__));
|
||||
BRCMF_TRACE(("%s: Enter\n", __func__));
|
||||
|
||||
drvr->txoff = state;
|
||||
ASSERT(drvr_priv && drvr_priv->iflist[ifidx]);
|
||||
|
@ -726,7 +731,7 @@ void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx, struct sk_buff *skb,
|
|||
struct brcmf_if *ifp;
|
||||
struct brcmf_event_msg event;
|
||||
|
||||
DHD_TRACE(("%s: Enter\n", __func__));
|
||||
BRCMF_TRACE(("%s: Enter\n", __func__));
|
||||
|
||||
save_pktbuf = skb;
|
||||
|
||||
|
@ -821,7 +826,7 @@ static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net)
|
|||
struct brcmf_if *ifp;
|
||||
int ifidx;
|
||||
|
||||
DHD_TRACE(("%s: Enter\n", __func__));
|
||||
BRCMF_TRACE(("%s: Enter\n", __func__));
|
||||
|
||||
ifidx = brcmf_net2idx(drvr_priv, net);
|
||||
if (ifidx == BRCMF_BAD_IF)
|
||||
|
@ -869,13 +874,13 @@ static int brcmf_toe_get(struct brcmf_info *drvr_priv, int ifidx, u32 *toe_ol)
|
|||
if (ret < 0) {
|
||||
/* Check for older dongle image that doesn't support toe_ol */
|
||||
if (ret == -EIO) {
|
||||
DHD_ERROR(("%s: toe not supported by device\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx)));
|
||||
BRCMF_ERROR(("%s: toe not supported by device\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx)));
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
DHD_INFO(("%s: could not get toe_ol: ret=%d\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx), ret));
|
||||
BRCMF_INFO(("%s: could not get toe_ol: ret=%d\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx), ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -905,8 +910,8 @@ static int brcmf_toe_set(struct brcmf_info *drvr_priv, int ifidx, u32 toe_ol)
|
|||
|
||||
ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
|
||||
if (ret < 0) {
|
||||
DHD_ERROR(("%s: could not set toe_ol: ret=%d\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx), ret));
|
||||
BRCMF_ERROR(("%s: could not set toe_ol: ret=%d\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx), ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -919,8 +924,8 @@ static int brcmf_toe_set(struct brcmf_info *drvr_priv, int ifidx, u32 toe_ol)
|
|||
|
||||
ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
|
||||
if (ret < 0) {
|
||||
DHD_ERROR(("%s: could not set toe: ret=%d\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx), ret));
|
||||
BRCMF_ERROR(("%s: could not set toe: ret=%d\n",
|
||||
brcmf_ifname(&drvr_priv->pub, ifidx), ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
@ -952,7 +957,7 @@ static int brcmf_ethtool(struct brcmf_info *drvr_priv, void *uaddr)
|
|||
u32 toe_cmpnt, csum_dir;
|
||||
int ret;
|
||||
|
||||
DHD_TRACE(("%s: Enter\n", __func__));
|
||||
BRCMF_TRACE(("%s: Enter\n", __func__));
|
||||
|
||||
/* all ethtool calls start with a cmd word */
|
||||
if (copy_from_user(&cmd, uaddr, sizeof(u32)))
|
||||
|
@ -978,7 +983,7 @@ static int brcmf_ethtool(struct brcmf_info *drvr_priv, void *uaddr)
|
|||
|
||||
/* otherwise, require dongle to be up */
|
||||
else if (!drvr_priv->pub.up) {
|
||||
DHD_ERROR(("%s: dongle is not up\n", __func__));
|
||||
BRCMF_ERROR(("%s: dongle is not up\n", __func__));
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
@ -991,8 +996,8 @@ static int brcmf_ethtool(struct brcmf_info *drvr_priv, void *uaddr)
|
|||
sprintf(info.version, "%lu", drvr_priv->pub.drv_version);
|
||||
if (copy_to_user(uaddr, &info, sizeof(info)))
|
||||
return -EFAULT;
|
||||
DHD_CTL(("%s: given %*s, returning %s\n", __func__,
|
||||
(int)sizeof(drvname), drvname, info.driver));
|
||||
BRCMF_CTL(("%s: given %*s, returning %s\n", __func__,
|
||||
(int)sizeof(drvname), drvname, info.driver));
|
||||
break;
|
||||
|
||||
/* Get toe offload components from dongle */
|
||||
|
@ -1067,7 +1072,7 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
|
|||
bool is_set_key_cmd;
|
||||
|
||||
ifidx = brcmf_net2idx(drvr_priv, net);
|
||||
DHD_TRACE(("%s: ifidx %d, cmd 0x%04x\n", __func__, ifidx, cmd));
|
||||
BRCMF_TRACE(("%s: ifidx %d, cmd 0x%04x\n", __func__, ifidx, cmd));
|
||||
|
||||
if (ifidx == BRCMF_BAD_IF)
|
||||
return -1;
|
||||
|
@ -1130,7 +1135,7 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
|
|||
|
||||
/* send to dongle (must be up, and wl) */
|
||||
if ((drvr_priv->pub.busstate != BRCMF_BUS_DATA)) {
|
||||
DHD_ERROR(("%s DONGLE_DOWN,__func__\n", __func__));
|
||||
BRCMF_ERROR(("%s DONGLE_DOWN,__func__\n", __func__));
|
||||
bcmerror = -EIO;
|
||||
goto done;
|
||||
}
|
||||
|
@ -1175,7 +1180,7 @@ static int brcmf_netdev_stop(struct net_device *net)
|
|||
#if !defined(IGNORE_ETH0_DOWN)
|
||||
struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
|
||||
|
||||
DHD_TRACE(("%s: Enter\n", __func__));
|
||||
BRCMF_TRACE(("%s: Enter\n", __func__));
|
||||
brcmf_cfg80211_down();
|
||||
if (drvr_priv->pub.up == 0)
|
||||
return 0;
|
||||
|
@ -1184,8 +1189,8 @@ static int brcmf_netdev_stop(struct net_device *net)
|
|||
drvr_priv->pub.up = 0;
|
||||
netif_stop_queue(net);
|
||||
#else
|
||||
DHD_ERROR(("BYPASS %s:due to BRCM compilation : under investigation\n",
|
||||
__func__));
|
||||
BRCMF_ERROR(("BYPASS %s:due to BRCM compilation: under investigation\n",
|
||||
__func__));
|
||||
#endif /* !defined(IGNORE_ETH0_DOWN) */
|
||||
|
||||
return 0;
|
||||
|
@ -1198,14 +1203,15 @@ static int brcmf_netdev_open(struct net_device *net)
|
|||
int ifidx = brcmf_net2idx(drvr_priv, net);
|
||||
s32 ret = 0;
|
||||
|
||||
DHD_TRACE(("%s: ifidx %d\n", __func__, ifidx));
|
||||
BRCMF_TRACE(("%s: ifidx %d\n", __func__, ifidx));
|
||||
|
||||
if (ifidx == 0) { /* do it only for primary eth0 */
|
||||
|
||||
/* try to bring up bus */
|
||||
ret = brcmf_bus_start(&drvr_priv->pub);
|
||||
if (ret != 0) {
|
||||
DHD_ERROR(("%s: failed with code %d\n", __func__, ret));
|
||||
BRCMF_ERROR(("%s: failed with code %d\n",
|
||||
__func__, ret));
|
||||
return -1;
|
||||
}
|
||||
atomic_set(&drvr_priv->pend_8021x_cnt, 0);
|
||||
|
@ -1215,16 +1221,18 @@ static int brcmf_netdev_open(struct net_device *net)
|
|||
/* Get current TOE mode from dongle */
|
||||
if (brcmf_toe_get(drvr_priv, ifidx, &toe_ol) >= 0
|
||||
&& (toe_ol & TOE_TX_CSUM_OL) != 0)
|
||||
drvr_priv->iflist[ifidx]->net->features |= NETIF_F_IP_CSUM;
|
||||
drvr_priv->iflist[ifidx]->net->features |=
|
||||
NETIF_F_IP_CSUM;
|
||||
else
|
||||
drvr_priv->iflist[ifidx]->net->features &= ~NETIF_F_IP_CSUM;
|
||||
drvr_priv->iflist[ifidx]->net->features &=
|
||||
~NETIF_F_IP_CSUM;
|
||||
}
|
||||
/* Allow transmit calls */
|
||||
netif_start_queue(net);
|
||||
drvr_priv->pub.up = 1;
|
||||
if (unlikely(brcmf_cfg80211_up())) {
|
||||
DHD_ERROR(("%s: failed to bring up cfg80211\n",
|
||||
__func__));
|
||||
BRCMF_ERROR(("%s: failed to bring up cfg80211\n",
|
||||
__func__));
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
@ -1237,7 +1245,7 @@ brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx, void *handle, char *name,
|
|||
{
|
||||
struct brcmf_if *ifp;
|
||||
|
||||
DHD_TRACE(("%s: idx %d, handle->%p\n", __func__, ifidx, handle));
|
||||
BRCMF_TRACE(("%s: idx %d, handle->%p\n", __func__, ifidx, handle));
|
||||
|
||||
ASSERT(drvr_priv && (ifidx < BRCMF_MAX_IFS));
|
||||
|
||||
|
@ -1245,7 +1253,7 @@ brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx, void *handle, char *name,
|
|||
if (!ifp) {
|
||||
ifp = kmalloc(sizeof(struct brcmf_if), GFP_ATOMIC);
|
||||
if (!ifp) {
|
||||
DHD_ERROR(("%s: OOM - struct brcmf_if\n", __func__));
|
||||
BRCMF_ERROR(("%s: OOM - struct brcmf_if\n", __func__));
|
||||
return -ENOMEM;
|
||||
}
|
||||
}
|
||||
|
@ -1272,12 +1280,12 @@ void brcmf_del_if(struct brcmf_info *drvr_priv, int ifidx)
|
|||
{
|
||||
struct brcmf_if *ifp;
|
||||
|
||||
DHD_TRACE(("%s: idx %d\n", __func__, ifidx));
|
||||
BRCMF_TRACE(("%s: idx %d\n", __func__, ifidx));
|
||||
|
||||
ASSERT(drvr_priv && ifidx && (ifidx < BRCMF_MAX_IFS));
|
||||
ifp = drvr_priv->iflist[ifidx];
|
||||
if (!ifp) {
|
||||
DHD_ERROR(("%s: Null interface\n", __func__));
|
||||
BRCMF_ERROR(("%s: Null interface\n", __func__));
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1292,19 +1300,19 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)
|
|||
struct brcmf_info *drvr_priv = NULL;
|
||||
struct net_device *net;
|
||||
|
||||
DHD_TRACE(("%s: Enter\n", __func__));
|
||||
BRCMF_TRACE(("%s: Enter\n", __func__));
|
||||
|
||||
/* Allocate etherdev, including space for private structure */
|
||||
net = alloc_etherdev(sizeof(drvr_priv));
|
||||
if (!net) {
|
||||
DHD_ERROR(("%s: OOM - alloc_etherdev\n", __func__));
|
||||
BRCMF_ERROR(("%s: OOM - alloc_etherdev\n", __func__));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* Allocate primary brcmf_info */
|
||||
drvr_priv = kzalloc(sizeof(struct brcmf_info), GFP_ATOMIC);
|
||||
if (!drvr_priv) {
|
||||
DHD_ERROR(("%s: OOM - alloc brcmf_info\n", __func__));
|
||||
BRCMF_ERROR(("%s: OOM - alloc brcmf_info\n", __func__));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -1343,13 +1351,13 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)
|
|||
|
||||
/* Attach and link in the protocol */
|
||||
if (brcmf_proto_attach(&drvr_priv->pub) != 0) {
|
||||
DHD_ERROR(("brcmf_proto_attach failed\n"));
|
||||
BRCMF_ERROR(("brcmf_prot_attach failed\n"));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
/* Attach and link in the cfg80211 */
|
||||
if (unlikely(brcmf_cfg80211_attach(net, &drvr_priv->pub))) {
|
||||
DHD_ERROR(("wl_cfg80211_attach failed\n"));
|
||||
BRCMF_ERROR(("wl_cfg80211_attach failed\n"));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
|
@ -1393,19 +1401,19 @@ int brcmf_bus_start(struct brcmf_pub *drvr)
|
|||
|
||||
ASSERT(drvr_priv);
|
||||
|
||||
DHD_TRACE(("%s:\n", __func__));
|
||||
BRCMF_TRACE(("%s:\n", __func__));
|
||||
|
||||
/* Bring up the bus */
|
||||
ret = brcmf_sdbrcm_bus_init(&drvr_priv->pub, true);
|
||||
if (ret != 0) {
|
||||
DHD_ERROR(("%s, brcmf_sdbrcm_bus_init failed %d\n", __func__,
|
||||
ret));
|
||||
BRCMF_ERROR(("%s, brcmf_sdbrcm_bus_init failed %d\n", __func__,
|
||||
ret));
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* If bus is not ready, can't come up */
|
||||
if (drvr_priv->pub.busstate != BRCMF_BUS_DATA) {
|
||||
DHD_ERROR(("%s failed bus is not ready\n", __func__));
|
||||
BRCMF_ERROR(("%s failed bus is not ready\n", __func__));
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
|
@ -1465,7 +1473,7 @@ int brcmf_net_attach(struct brcmf_pub *drvr, int ifidx)
|
|||
u8 temp_addr[ETH_ALEN] = {
|
||||
0x00, 0x90, 0x4c, 0x11, 0x22, 0x33};
|
||||
|
||||
DHD_TRACE(("%s: ifidx %d\n", __func__, ifidx));
|
||||
BRCMF_TRACE(("%s: ifidx %d\n", __func__, ifidx));
|
||||
|
||||
ASSERT(drvr_priv && drvr_priv->iflist[ifidx]);
|
||||
|
||||
|
@ -1485,7 +1493,7 @@ int brcmf_net_attach(struct brcmf_pub *drvr, int ifidx)
|
|||
}
|
||||
|
||||
if (ifidx == 1) {
|
||||
DHD_TRACE(("%s ACCESS POINT MAC:\n", __func__));
|
||||
BRCMF_TRACE(("%s ACCESS POINT MAC:\n", __func__));
|
||||
/* ACCESSPOINT INTERFACE CASE */
|
||||
temp_addr[0] |= 0X02; /* set bit 2 ,
|
||||
- Locally Administered address */
|
||||
|
@ -1500,12 +1508,12 @@ int brcmf_net_attach(struct brcmf_pub *drvr, int ifidx)
|
|||
memcpy(net->dev_addr, temp_addr, ETH_ALEN);
|
||||
|
||||
if (register_netdev(net) != 0) {
|
||||
DHD_ERROR(("%s: couldn't register the net device\n",
|
||||
__func__));
|
||||
BRCMF_ERROR(("%s: couldn't register the net device\n",
|
||||
__func__));
|
||||
goto fail;
|
||||
}
|
||||
|
||||
DHD_INFO(("%s: Broadcom Dongle Host Driver\n", net->name));
|
||||
BRCMF_INFO(("%s: Broadcom Dongle Host Driver\n", net->name));
|
||||
|
||||
return 0;
|
||||
|
||||
|
@ -1518,7 +1526,7 @@ static void brcmf_bus_detach(struct brcmf_pub *drvr)
|
|||
{
|
||||
struct brcmf_info *drvr_priv;
|
||||
|
||||
DHD_TRACE(("%s: Enter\n", __func__));
|
||||
BRCMF_TRACE(("%s: Enter\n", __func__));
|
||||
|
||||
if (drvr) {
|
||||
drvr_priv = drvr->info;
|
||||
|
@ -1536,7 +1544,7 @@ void brcmf_detach(struct brcmf_pub *drvr)
|
|||
{
|
||||
struct brcmf_info *drvr_priv;
|
||||
|
||||
DHD_TRACE(("%s: Enter\n", __func__));
|
||||
BRCMF_TRACE(("%s: Enter\n", __func__));
|
||||
|
||||
if (drvr) {
|
||||
drvr_priv = drvr->info;
|
||||
|
@ -1577,7 +1585,7 @@ void brcmf_detach(struct brcmf_pub *drvr)
|
|||
|
||||
static void __exit brcmf_module_cleanup(void)
|
||||
{
|
||||
DHD_TRACE(("%s: Enter\n", __func__));
|
||||
BRCMF_TRACE(("%s: Enter\n", __func__));
|
||||
|
||||
brcmf_bus_unregister();
|
||||
}
|
||||
|
@ -1586,12 +1594,12 @@ static int __init brcmf_module_init(void)
|
|||
{
|
||||
int error;
|
||||
|
||||
DHD_TRACE(("%s: Enter\n", __func__));
|
||||
BRCMF_TRACE(("%s: Enter\n", __func__));
|
||||
|
||||
error = brcmf_bus_register();
|
||||
|
||||
if (error) {
|
||||
DHD_ERROR(("%s: brcmf_bus_register failed\n", __func__));
|
||||
BRCMF_ERROR(("%s: brcmf_bus_register failed\n", __func__));
|
||||
goto failed;
|
||||
}
|
||||
return 0;
|
||||
|
@ -1742,7 +1750,7 @@ int brcmf_write_to_file(struct brcmf_pub *drvr, u8 *buf, int size)
|
|||
/* open file to write */
|
||||
fp = filp_open("/tmp/mem_dump", O_WRONLY | O_CREAT, 0640);
|
||||
if (!fp) {
|
||||
DHD_ERROR(("%s: open file error\n", __func__));
|
||||
BRCMF_ERROR(("%s: open file error\n", __func__));
|
||||
ret = -1;
|
||||
goto exit;
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue