summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/bcmdhd/dhd_common.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/bcmdhd/dhd_common.c')
-rw-r--r--drivers/net/wireless/bcmdhd/dhd_common.c98
1 files changed, 66 insertions, 32 deletions
diff --git a/drivers/net/wireless/bcmdhd/dhd_common.c b/drivers/net/wireless/bcmdhd/dhd_common.c
index a54c39152e4..afe1e2818e8 100644
--- a/drivers/net/wireless/bcmdhd/dhd_common.c
+++ b/drivers/net/wireless/bcmdhd/dhd_common.c
@@ -1,9 +1,9 @@
/*
* Broadcom Dongle Host Driver (DHD), common DHD core.
*
- * Copyright (C) 1999-2011, Broadcom Corporation
+ * Copyright (C) 1999-2012, Broadcom Corporation
*
- * Unless you and Broadcom execute a separate written software license
+ * Unless you and Broadcom execute a separate written software license
* agreement governing use of this software, this software is licensed to you
* under the terms of the GNU General Public License version 2 (the "GPL"),
* available at http://www.broadcom.com/licenses/GPLv2.php, with the
@@ -21,7 +21,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: dhd_common.c 307573 2012-01-12 00:04:39Z $
+ * $Id: dhd_common.c 304622 2011-12-22 19:51:18Z $
*/
#include <typedefs.h>
#include <osl.h>
@@ -44,8 +44,10 @@
#ifdef WL_CFG80211
#include <wl_cfg80211.h>
#endif
+#ifdef WLBTAMP
#include <proto/bt_amp_hci.h>
#include <dhd_bta.h>
+#endif
#ifdef SET_RANDOM_MAC_SOFTAP
#include <linux/random.h>
#include <linux/jiffies.h>
@@ -115,8 +117,10 @@ enum {
IOV_LOGSTAMP,
IOV_GPIOOB,
IOV_IOCTLTIMEOUT,
+#ifdef WLBTAMP
IOV_HCI_CMD, /* HCI command */
IOV_HCI_ACL_DATA, /* HCI data packet */
+#endif
#if defined(DHD_DEBUG)
IOV_CONS,
IOV_DCONSOLE_POLL,
@@ -130,6 +134,7 @@ enum {
IOV_WLPKTDLYSTAT_SZ,
#endif
IOV_CHANGEMTU,
+ IOV_HOSTREORDER_FLOWS,
IOV_LAST
};
@@ -149,8 +154,10 @@ const bcm_iovar_t dhd_iovars[] = {
{"clearcounts", IOV_CLEARCOUNTS, 0, IOVT_VOID, 0 },
{"gpioob", IOV_GPIOOB, 0, IOVT_UINT32, 0 },
{"ioctl_timeout", IOV_IOCTLTIMEOUT, 0, IOVT_UINT32, 0 },
+#ifdef WLBTAMP
{"HCI_cmd", IOV_HCI_CMD, 0, IOVT_BUFFER, 0},
{"HCI_ACL_data", IOV_HCI_ACL_DATA, 0, IOVT_BUFFER, 0},
+#endif
#ifdef PROP_TXSTATUS
{"proptx", IOV_PROPTXSTATUS_ENABLE, 0, IOVT_UINT32, 0 },
/*
@@ -166,6 +173,8 @@ const bcm_iovar_t dhd_iovars[] = {
{"pktdlystatsz", IOV_WLPKTDLYSTAT_SZ, 0, IOVT_UINT8, 0 },
#endif
{"changemtu", IOV_CHANGEMTU, 0, IOVT_UINT32, 0 },
+ {"host_reorder_flows", IOV_HOSTREORDER_FLOWS, 0, IOVT_BUFFER,
+ (WLHOST_REORDERDATA_MAXFLOWS + 1) },
{NULL, 0, 0, 0, 0 }
};
@@ -336,11 +345,6 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, uint32 actionid, const ch
case IOV_SVAL(IOV_MSGLEVEL):
dhd_msg_level = int_val;
-#ifdef WL_CFG80211
- /* Enable DHD and WL logs in oneshot */
- if (dhd_msg_level & DHD_WL_VAL)
- wl_cfg80211_enable_trace(dhd_msg_level);
-#endif
break;
case IOV_GVAL(IOV_BCMERRORSTR):
bcm_strncpy_s((char *)arg, len, bcmerrorstr(dhd_pub->bcmerror), BCME_STRLEN);
@@ -430,6 +434,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, uint32 actionid, const ch
break;
}
+#ifdef WLBTAMP
case IOV_SVAL(IOV_HCI_CMD): {
amp_hci_cmd_t *cmd = (amp_hci_cmd_t *)arg;
@@ -459,6 +464,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, uint32 actionid, const ch
dhd_bta_tx_hcidata(dhd_pub, ACL_data, len);
break;
}
+#endif /* WLBTAMP */
#ifdef PROP_TXSTATUS
case IOV_GVAL(IOV_PROPTXSTATUS_ENABLE):
@@ -513,6 +519,25 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const bcm_iovar_t *vi, uint32 actionid, const ch
bcmerror = dhd_change_mtu(dhd_pub, int_val, 0);
break;
+ case IOV_GVAL(IOV_HOSTREORDER_FLOWS):
+ {
+ uint i = 0;
+ uint8 *ptr = (uint8 *)arg;
+ uint8 count = 0;
+
+ ptr++;
+ for (i = 0; i < WLHOST_REORDERDATA_MAXFLOWS; i++) {
+ if (dhd_pub->reorder_bufs[i] != NULL) {
+ *ptr = dhd_pub->reorder_bufs[i]->flow_id;
+ ptr++;
+ count++;
+ }
+ }
+ ptr = (uint8 *)arg;
+ *ptr = count;
+ break;
+ }
+
default:
bcmerror = BCME_UNSUPPORTED;
break;
@@ -734,6 +759,7 @@ wl_show_host_event(wl_event_msg_t *event, void *event_data)
flags = ntoh16(event->flags);
status = ntoh32(event->status);
reason = ntoh32(event->reason);
+ BCM_REFERENCE(reason);
auth_type = ntoh32(event->auth_type);
datalen = ntoh32(event->datalen);
@@ -813,6 +839,7 @@ wl_show_host_event(wl_event_msg_t *event, void *event_data)
DHD_EVENT(("MACEVENT: %s, MAC %s, %s, FAILURE, reason %d\n",
event_name, eabuf, auth_str, (int)reason));
}
+ BCM_REFERENCE(auth_str);
break;
@@ -843,11 +870,14 @@ wl_show_host_event(wl_event_msg_t *event, void *event_data)
case WLC_E_LINK:
DHD_EVENT(("MACEVENT: %s %s\n", event_name, link?"UP":"DOWN"));
+ BCM_REFERENCE(link);
break;
case WLC_E_MIC_ERROR:
DHD_EVENT(("MACEVENT: %s, MAC %s, Group %d, Flush %d\n",
event_name, eabuf, group, flush_txq));
+ BCM_REFERENCE(group);
+ BCM_REFERENCE(flush_txq);
break;
case WLC_E_ICV_ERROR:
@@ -968,7 +998,7 @@ wl_host_event(dhd_pub_t *dhd_pub, int *ifidx, void *pktdata,
/* check whether packet is a BRCM event pkt */
bcm_event_t *pvt_data = (bcm_event_t *)pktdata;
uint8 *event_data;
- uint32 type, status, reason, datalen;
+ uint32 type, status, datalen;
uint16 flags;
int evlen;
@@ -992,7 +1022,6 @@ wl_host_event(dhd_pub_t *dhd_pub, int *ifidx, void *pktdata,
type = ntoh32_ua((void *)&event->event_type);
flags = ntoh16_ua((void *)&event->flags);
status = ntoh32_ua((void *)&event->status);
- reason = ntoh32_ua((void *)&event->reason);
datalen = ntoh32_ua((void *)&event->datalen);
evlen = datalen + sizeof(bcm_event_t);
@@ -1010,26 +1039,26 @@ wl_host_event(dhd_pub_t *dhd_pub, int *ifidx, void *pktdata,
case WLC_E_IF:
{
- dhd_if_event_t *ifevent = (dhd_if_event_t *)event_data;
+ dhd_if_event_t *ifevent = (dhd_if_event_t *)event_data;
#ifdef PROP_TXSTATUS
{
- uint8* ea = pvt_data->eth.ether_dhost;
- WLFC_DBGMESG(("WLC_E_IF: idx:%d, action:%s, iftype:%s, "
- "[%02x:%02x:%02x:%02x:%02x:%02x]\n",
- ifevent->ifidx,
- ((ifevent->action == WLC_E_IF_ADD) ? "ADD":"DEL"),
- ((ifevent->is_AP == 0) ? "STA":"AP "),
- ea[0], ea[1], ea[2], ea[3], ea[4], ea[5]));
- (void)ea;
-
- dhd_wlfc_interface_event(dhd_pub->info,
- ((ifevent->action == WLC_E_IF_ADD) ?
- eWLFC_MAC_ENTRY_ACTION_ADD : eWLFC_MAC_ENTRY_ACTION_DEL),
- ifevent->ifidx, ifevent->is_AP, ea);
-
- /* dhd already has created an interface by default, for 0 */
- if (ifevent->ifidx == 0)
- break;
+ uint8* ea = pvt_data->eth.ether_dhost;
+ WLFC_DBGMESG(("WLC_E_IF: idx:%d, action:%s, iftype:%s, "
+ "[%02x:%02x:%02x:%02x:%02x:%02x]\n",
+ ifevent->ifidx,
+ ((ifevent->action == WLC_E_IF_ADD) ? "ADD":"DEL"),
+ ((ifevent->is_AP == 0) ? "STA":"AP "),
+ ea[0], ea[1], ea[2], ea[3], ea[4], ea[5]));
+ (void)ea;
+
+ dhd_wlfc_interface_event(dhd_pub->info,
+ ((ifevent->action == WLC_E_IF_ADD) ?
+ eWLFC_MAC_ENTRY_ACTION_ADD : eWLFC_MAC_ENTRY_ACTION_DEL),
+ ifevent->ifidx, ifevent->is_AP, ea);
+
+ /* dhd already has created an interface by default, for 0 */
+ if (ifevent->ifidx == 0)
+ break;
}
#endif /* PROP_TXSTATUS */
@@ -1043,7 +1072,7 @@ wl_host_event(dhd_pub_t *dhd_pub, int *ifidx, void *pktdata,
return (BCME_OK);
}
#endif /* WL_CFG80211 */
- if (ifevent->ifidx > 0 && ifevent->ifidx < DHD_MAX_IFS) {
+ if (ifevent->ifidx > 0 && ifevent->ifidx < DHD_MAX_IFS) {
if (ifevent->action == WLC_E_IF_ADD) {
if (dhd_add_if(dhd_pub->info, ifevent->ifidx,
NULL, event->ifname,
@@ -1070,7 +1099,7 @@ wl_host_event(dhd_pub_t *dhd_pub, int *ifidx, void *pktdata,
*ifidx = dhd_ifname2idx(dhd_pub->info, event->ifname);
/* push up to external supp/auth */
dhd_event(dhd_pub->info, (char *)pvt_data, evlen, *ifidx);
- break;
+ break;
#ifdef WLMEDIA_HTSF
@@ -1100,6 +1129,8 @@ wl_host_event(dhd_pub_t *dhd_pub, int *ifidx, void *pktdata,
dhd_event(dhd_pub->info, (char *)pvt_data, evlen, *ifidx);
DHD_TRACE(("%s: MAC event %d, flags %x, status %x\n",
__FUNCTION__, type, flags, status));
+ BCM_REFERENCE(flags);
+ BCM_REFERENCE(status);
/* put it back to WLC_E_NDIS_LINK */
if (type == WLC_E_NDIS_LINK) {
@@ -1488,7 +1519,7 @@ int
dhd_arp_get_arp_hostip_table(dhd_pub_t *dhd, void *buf, int buflen)
{
int retcode, i;
- int iov_len = 0;
+ int iov_len;
uint32 *ptr32 = buf;
bool clr_bottom = FALSE;
@@ -1496,6 +1527,7 @@ dhd_arp_get_arp_hostip_table(dhd_pub_t *dhd, void *buf, int buflen)
return -1;
iov_len = bcm_mkiovar("arp_hostip", 0, 0, buf, buflen);
+ BCM_REFERENCE(iov_len);
retcode = dhd_wl_ioctl_cmd(dhd, WLC_GET_VAR, buf, buflen, FALSE, 0);
if (retcode) {
@@ -1525,8 +1557,10 @@ void
dhd_sendup_event_common(dhd_pub_t *dhdp, wl_event_msg_t *event, void *data)
{
switch (ntoh32(event->event_type)) {
+#ifdef WLBTAMP
case WLC_E_BTA_HCI_EVENT:
break;
+#endif /* WLBTAMP */
default:
break;
}
@@ -2048,7 +2082,7 @@ int dhd_keep_alive_onoff(dhd_pub_t *dhd)
mkeep_alive_pkt.keep_alive_id = 0;
mkeep_alive_pkt.len_bytes = 0;
buf_len += WL_MKEEP_ALIVE_FIXED_LEN;
- /* Keep-alive attributes are set in local variable (mkeep_alive_pkt), and
+ /* Keep-alive attributes are set in local variable (mkeep_alive_pkt), and
* then memcpy'ed into buffer (mkeep_alive_pktp) since there is no
* guarantee that the buffer is properly aligned.
*/