#define MAX_PKTGEN_LEN 1800
#endif
-extern char fw_path[MOD_PARAM_PATHLEN];
-extern char nv_path[MOD_PARAM_PATHLEN];
+extern char brcmf_fw_path[MOD_PARAM_PATHLEN];
+extern char brcmf_nv_path[MOD_PARAM_PATHLEN];
extern u32 g_assert_type;
extern const bcmevent_name_t bcmevent_names[];
/* Indication from bus module to change flow-control state */
extern void dhd_txflowcontrol(dhd_pub_t *dhdp, int ifidx, bool on);
-extern bool dhd_prec_enq(dhd_pub_t *dhdp, struct pktq *q,
+extern bool brcmf_c_prec_enq(dhd_pub_t *dhdp, struct pktq *q,
struct sk_buff *pkt, int prec);
/* Receive frame for delivery to OS. Callee disposes of rxp. */
extern int dhd_ifname2idx(struct dhd_info *dhd, char *name);
extern u8 *dhd_bssidx2bssid(dhd_pub_t *dhd, int idx);
-extern int wl_host_event(struct dhd_info *dhd, int *idx, void *pktdata,
+extern int brcmf_c_host_event(struct dhd_info *dhd, int *idx, void *pktdata,
wl_event_msg_t *, void **data_ptr);
-extern void dhd_common_init(void);
+extern void brcmf_c_init(void);
extern int dhd_add_if(struct dhd_info *dhd, int ifidx, void *handle,
char *name, u8 *mac_addr, u32 flags, u8 bssidx);
extern void dhd_wait_event_wakeup(dhd_pub_t *dhd);
#ifdef PKT_FILTER_SUPPORT
-extern void dhd_pktfilter_offload_set(dhd_pub_t *dhd, char *arg);
-extern void dhd_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg, int enable,
- int master_mode);
+extern void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg);
+extern void brcmf_c_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg,
+ int enable, int master_mode);
#endif
#ifdef BCMDBG
#define DOT11_OUI_LEN 3
#define BCMILCP_BCM_SUBTYPE_EVENT 1
-int dhd_msg_level;
-char fw_path[MOD_PARAM_PATHLEN];
-char nv_path[MOD_PARAM_PATHLEN];
+int brcmf_msg_level;
+char brcmf_fw_path[MOD_PARAM_PATHLEN];
+char brcmf_nv_path[MOD_PARAM_PATHLEN];
extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
uint len);
#define MSGTRACE_VERSION 1
#ifdef DHD_DEBUG
-const char dhd_version[] =
+const char brcmf_version[] =
"Dongle Host Driver, version " EPI_VERSION_STR "\nCompiled on " __DATE__
" at " __TIME__;
#else
-const char dhd_version[] = "Dongle Host Driver, version " EPI_VERSION_STR;
+const char brcmf_version[] = "Dongle Host Driver, version " EPI_VERSION_STR;
#endif
/* IOVar table */
IOV_LAST
};
-const struct brcmu_iovar dhd_iovars[] = {
- {"version", IOV_VERSION, 0, IOVT_BUFFER, sizeof(dhd_version)}
+const struct brcmu_iovar brcmf_iovars[] = {
+ {"version", IOV_VERSION, 0, IOVT_BUFFER, sizeof(brcmf_version)}
,
#ifdef DHD_DEBUG
{"msglevel", IOV_MSGLEVEL, 0, IOVT_UINT32, 0}
because of trace overflow */
} __packed;
-void dhd_common_init(void)
+void brcmf_c_init(void)
{
/* Init global variables at run-time, not as part of the declaration.
* This is required to support init/de-init of the driver.
* first time that the driver is initialized vs subsequent
* initializations.
*/
- dhd_msg_level = DHD_ERROR_VAL;
+ brcmf_msg_level = DHD_ERROR_VAL;
#ifdef CONFIG_BCM4329_FW_PATH
- strncpy(fw_path, CONFIG_BCM4329_FW_PATH, MOD_PARAM_PATHLEN - 1);
+ strncpy(brcmf_fw_path, CONFIG_BCM4329_FW_PATH, MOD_PARAM_PATHLEN - 1);
#else
- fw_path[0] = '\0';
+ brcmf_fw_path[0] = '\0';
#endif
#ifdef CONFIG_BCM4329_NVRAM_PATH
- strncpy(nv_path, CONFIG_BCM4329_NVRAM_PATH, MOD_PARAM_PATHLEN - 1);
+ strncpy(brcmf_nv_path,
+ CONFIG_BCM4329_NVRAM_PATH, MOD_PARAM_PATHLEN - 1);
#else
- nv_path[0] = '\0';
+ brcmf_nv_path[0] = '\0';
#endif
}
-static int dhd_dump(dhd_pub_t *dhdp, char *buf, int buflen)
+static int brcmf_c_dump(dhd_pub_t *dhdp, char *buf, int buflen)
{
struct brcmu_strbuf b;
struct brcmu_strbuf *strbuf = &b;
brcmu_binit(strbuf, buf, buflen);
/* Base DHD info */
- brcmu_bprintf(strbuf, "%s\n", dhd_version);
+ brcmu_bprintf(strbuf, "%s\n", brcmf_version);
brcmu_bprintf(strbuf, "\n");
brcmu_bprintf(strbuf, "pub.up %d pub.txoff %d pub.busstate %d\n",
dhdp->up, dhdp->txoff, dhdp->busstate);
}
static int
-dhd_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
+brcmf_c_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
const char *name, void *params, int plen, void *arg, int len,
int val_size)
{
switch (actionid) {
case IOV_GVAL(IOV_VERSION):
/* Need to have checked buffer length */
- strncpy((char *)arg, dhd_version, len);
+ strncpy((char *)arg, brcmf_version, len);
break;
case IOV_GVAL(IOV_MSGLEVEL):
- int_val = (s32) dhd_msg_level;
+ int_val = (s32) brcmf_msg_level;
memcpy(arg, &int_val, val_size);
break;
case IOV_SVAL(IOV_MSGLEVEL):
- dhd_msg_level = int_val;
+ brcmf_msg_level = int_val;
break;
case IOV_GVAL(IOV_BCMERRORSTR):
break;
case IOV_GVAL(IOV_DUMP):
- bcmerror = dhd_dump(dhd_pub, arg, len);
+ bcmerror = brcmf_c_dump(dhd_pub, arg, len);
break;
#ifdef DHD_DEBUG
return bcmerror;
}
-bool dhd_prec_enq(dhd_pub_t *dhdp, struct pktq *q, struct sk_buff *pkt,
+bool brcmf_c_prec_enq(dhd_pub_t *dhdp, struct pktq *q, struct sk_buff *pkt,
int prec)
{
struct sk_buff *p;
}
static int
-dhd_iovar_op(dhd_pub_t *dhd_pub, const char *name,
+brcmf_c_iovar_op(dhd_pub_t *dhd_pub, const char *name,
void *params, int plen, void *arg, int len, bool set)
{
int bcmerror = 0;
/* Set does NOT take qualifiers */
ASSERT(!set || (!params && !plen));
- vi = brcmu_iovar_lookup(dhd_iovars, name);
+ vi = brcmu_iovar_lookup(brcmf_iovars, name);
if (vi == NULL) {
bcmerror = -ENOTSUPP;
goto exit;
actionid = set ? IOV_SVAL(vi->varid) : IOV_GVAL(vi->varid);
bcmerror =
- dhd_doiovar(dhd_pub, vi, actionid, name, params, plen, arg, len,
+ brcmf_c_doiovar(dhd_pub, vi, actionid, name, params, plen, arg, len,
val_size);
exit:
return bcmerror;
}
-int dhd_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf, uint buflen)
+int brcmf_c_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf, uint buflen)
{
int bcmerror = 0;
/* call with the appropriate arguments */
if (ioc->cmd == DHD_GET_VAR)
- bcmerror =
- dhd_iovar_op(dhd_pub, buf, arg, arglen, buf,
- buflen, IOV_GET);
+ bcmerror = brcmf_c_iovar_op(dhd_pub, buf, arg,
+ arglen, buf, buflen, IOV_GET);
else
bcmerror =
- dhd_iovar_op(dhd_pub, buf, NULL, 0, arg,
- arglen, IOV_SET);
+ brcmf_c_iovar_op(dhd_pub, buf, NULL, 0, arg,
+ arglen, IOV_SET);
if (bcmerror != -ENOTSUPP)
break;
}
#ifdef SHOW_EVENTS
-static void wl_show_host_event(wl_event_msg_t *event, void *event_data)
+static void brcmf_c_show_host_event(wl_event_msg_t *event, void *event_data)
{
uint i, status, reason;
bool group = false, flush_txq = false, link = false;
#endif /* SHOW_EVENTS */
int
-wl_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
+brcmf_c_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
wl_event_msg_t *event, void **data_ptr)
{
/* check whether packet is a BRCM event pkt */
}
#ifdef SHOW_EVENTS
- wl_show_host_event(event, event_data);
+ brcmf_c_show_host_event(event, event_data);
#endif /* SHOW_EVENTS */
return 0;
}
/* Convert user's input in hex pattern to byte-size mask */
-static int wl_pattern_atoh(char *src, char *dst)
+static int brcmf_c_pattern_atoh(char *src, char *dst)
{
int i;
if (strncmp(src, "0x", 2) != 0 && strncmp(src, "0X", 2) != 0) {
}
void
-dhd_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg, int enable,
+brcmf_c_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg, int enable,
int master_mode)
{
char *argv[8];
kfree(arg_org);
}
-void dhd_pktfilter_offload_set(dhd_pub_t *dhd, char *arg)
+void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg)
{
const char *str;
wl_pkt_filter_t pkt_filter;
/* Parse pattern filter mask. */
mask_size =
- wl_pattern_atoh
+ brcmf_c_pattern_atoh
(argv[i], (char *)pkt_filterp->u.pattern.mask_and_pattern);
if (NULL == argv[++i]) {
/* Parse pattern filter pattern. */
pattern_size =
- wl_pattern_atoh(argv[i],
+ brcmf_c_pattern_atoh(argv[i],
(char *)&pkt_filterp->u.pattern.
mask_and_pattern[mask_size]);
kfree(buf);
}
-void dhd_arp_offload_set(dhd_pub_t *dhd, int arp_mode)
+void brcmf_c_arp_offload_set(dhd_pub_t *dhd, int arp_mode)
{
char iovbuf[32];
int retcode;
__func__, arp_mode));
}
-void dhd_arp_offload_enable(dhd_pub_t *dhd, int arp_enable)
+void brcmf_c_arp_offload_enable(dhd_pub_t *dhd, int arp_enable)
{
char iovbuf[32];
int retcode;
__func__, arp_enable));
}
-int dhd_preinit_ioctls(dhd_pub_t *dhd)
+int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
{
char iovbuf[WL_EVENTING_MASK_LEN + 12]; /* Room for
"event_msgs" + '\0' + bitvec */
#ifdef ARP_OFFLOAD_SUPPORT
/* Set and enable ARP offload feature */
if (dhd_arp_enable)
- dhd_arp_offload_set(dhd, dhd_arp_mode);
- dhd_arp_offload_enable(dhd, dhd_arp_enable);
+ brcmf_c_arp_offload_set(dhd, dhd_arp_mode);
+ brcmf_c_arp_offload_enable(dhd, dhd_arp_enable);
#endif /* ARP_OFFLOAD_SUPPORT */
#ifdef PKT_FILTER_SUPPORT
/* Set up pkt filter */
if (dhd_pkt_filter_enable) {
for (i = 0; i < dhd->pktfilter_count; i++) {
- dhd_pktfilter_offload_set(dhd,
+ brcmf_c_pktfilter_offload_set(dhd,
dhd->pktfilter[i]);
- dhd_pktfilter_offload_enable(dhd,
+ brcmf_c_pktfilter_offload_enable(dhd,
dhd->pktfilter[i],
dhd_pkt_filter_init,
dhd_master_mode);
#if defined(DHD_DEBUG)
-#define DHD_ERROR(args) \
- do {if ((dhd_msg_level & DHD_ERROR_VAL) && (net_ratelimit())) \
+#define DHD_ERROR(args) \
+ do {if ((brcmf_msg_level & DHD_ERROR_VAL) && (net_ratelimit())) \
printk args; } while (0)
-#define DHD_TRACE(args) do {if (dhd_msg_level & DHD_TRACE_VAL) \
+#define DHD_TRACE(args) do {if (brcmf_msg_level & DHD_TRACE_VAL) \
printk args; } while (0)
-#define DHD_INFO(args) do {if (dhd_msg_level & DHD_INFO_VAL) \
+#define DHD_INFO(args) do {if (brcmf_msg_level & DHD_INFO_VAL) \
printk args; } while (0)
-#define DHD_DATA(args) do {if (dhd_msg_level & DHD_DATA_VAL) \
+#define DHD_DATA(args) do {if (brcmf_msg_level & DHD_DATA_VAL) \
printk args; } while (0)
-#define DHD_CTL(args) do {if (dhd_msg_level & DHD_CTL_VAL) \
+#define DHD_CTL(args) do {if (brcmf_msg_level & DHD_CTL_VAL) \
printk args; } while (0)
-#define DHD_TIMER(args) do {if (dhd_msg_level & DHD_TIMER_VAL) \
+#define DHD_TIMER(args) do {if (brcmf_msg_level & DHD_TIMER_VAL) \
printk args; } while (0)
-#define DHD_HDRS(args) do {if (dhd_msg_level & DHD_HDRS_VAL) \
+#define DHD_HDRS(args) do {if (brcmf_msg_level & DHD_HDRS_VAL) \
printk args; } while (0)
-#define DHD_BYTES(args) do {if (dhd_msg_level & DHD_BYTES_VAL) \
+#define DHD_BYTES(args) do {if (brcmf_msg_level & DHD_BYTES_VAL) \
printk args; } while (0)
-#define DHD_INTR(args) do {if (dhd_msg_level & DHD_INTR_VAL) \
+#define DHD_INTR(args) do {if (brcmf_msg_level & DHD_INTR_VAL) \
printk args; } while (0)
-#define DHD_GLOM(args) do {if (dhd_msg_level & DHD_GLOM_VAL) \
+#define DHD_GLOM(args) do {if (brcmf_msg_level & DHD_GLOM_VAL) \
printk args; } while (0)
-#define DHD_EVENT(args) do {if (dhd_msg_level & DHD_EVENT_VAL) \
+#define DHD_EVENT(args) do {if (brcmf_msg_level & DHD_EVENT_VAL) \
printk args; } while (0)
-#define DHD_BTA(args) do {if (dhd_msg_level & DHD_BTA_VAL) \
+#define DHD_BTA(args) do {if (brcmf_msg_level & DHD_BTA_VAL) \
printk args; } while (0)
-#define DHD_ISCAN(args) do {if (dhd_msg_level & DHD_ISCAN_VAL) \
+#define DHD_ISCAN(args) do {if (brcmf_msg_level & DHD_ISCAN_VAL) \
printk args; } while (0)
-#define DHD_ERROR_ON() (dhd_msg_level & DHD_ERROR_VAL)
-#define DHD_TRACE_ON() (dhd_msg_level & DHD_TRACE_VAL)
-#define DHD_INFO_ON() (dhd_msg_level & DHD_INFO_VAL)
-#define DHD_DATA_ON() (dhd_msg_level & DHD_DATA_VAL)
-#define DHD_CTL_ON() (dhd_msg_level & DHD_CTL_VAL)
-#define DHD_TIMER_ON() (dhd_msg_level & DHD_TIMER_VAL)
-#define DHD_HDRS_ON() (dhd_msg_level & DHD_HDRS_VAL)
-#define DHD_BYTES_ON() (dhd_msg_level & DHD_BYTES_VAL)
-#define DHD_INTR_ON() (dhd_msg_level & DHD_INTR_VAL)
-#define DHD_GLOM_ON() (dhd_msg_level & DHD_GLOM_VAL)
-#define DHD_EVENT_ON() (dhd_msg_level & DHD_EVENT_VAL)
-#define DHD_BTA_ON() (dhd_msg_level & DHD_BTA_VAL)
-#define DHD_ISCAN_ON() (dhd_msg_level & DHD_ISCAN_VAL)
+#define DHD_ERROR_ON() (brcmf_msg_level & DHD_ERROR_VAL)
+#define DHD_TRACE_ON() (brcmf_msg_level & DHD_TRACE_VAL)
+#define DHD_INFO_ON() (brcmf_msg_level & DHD_INFO_VAL)
+#define DHD_DATA_ON() (brcmf_msg_level & DHD_DATA_VAL)
+#define DHD_CTL_ON() (brcmf_msg_level & DHD_CTL_VAL)
+#define DHD_TIMER_ON() (brcmf_msg_level & DHD_TIMER_VAL)
+#define DHD_HDRS_ON() (brcmf_msg_level & DHD_HDRS_VAL)
+#define DHD_BYTES_ON() (brcmf_msg_level & DHD_BYTES_VAL)
+#define DHD_INTR_ON() (brcmf_msg_level & DHD_INTR_VAL)
+#define DHD_GLOM_ON() (brcmf_msg_level & DHD_GLOM_VAL)
+#define DHD_EVENT_ON() (brcmf_msg_level & DHD_EVENT_VAL)
+#define DHD_BTA_ON() (brcmf_msg_level & DHD_BTA_VAL)
+#define DHD_ISCAN_ON() (brcmf_msg_level & DHD_ISCAN_VAL)
#else /* (defined BCMDBG) || (defined DHD_DEBUG) */
#define DHD_LOG(args)
#define DHD_NONE(args)
-extern int dhd_msg_level;
+extern int brcmf_msg_level;
#endif /* _dhd_dbg_ */
module_param(dhd_no_fw_req, bool, 0);
/* Error bits */
-module_param(dhd_msg_level, int, 0);
+module_param(brcmf_msg_level, int, 0);
/* Spawn a thread for system ioctls (set mac, set mcast) */
uint dhd_sysioc = true;
int i;
for (i = 0; i < dhd->pktfilter_count; i++) {
- dhd_pktfilter_offload_set(dhd, dhd->pktfilter[i]);
- dhd_pktfilter_offload_enable(dhd, dhd->pktfilter[i],
+ brcmf_c_pktfilter_offload_set(dhd, dhd->pktfilter[i]);
+ brcmf_c_pktfilter_offload_enable(dhd, dhd->pktfilter[i],
value, dhd_master_mode);
}
}
/* check for local dhd ioctl and handle it */
if (driver == DHD_IOCTL_MAGIC) {
- bcmerror = dhd_ioctl((void *)&dhd->pub, &ioc, buf, buflen);
+ bcmerror = brcmf_c_ioctl((void *)&dhd->pub, &ioc, buf, buflen);
if (bcmerror)
dhd->pub.bcmerror = bcmerror;
goto done;
/* updates firmware nvram path if it was provided as module
paramters */
if ((firmware_path != NULL) && (firmware_path[0] != '\0'))
- strcpy(fw_path, firmware_path);
+ strcpy(brcmf_fw_path, firmware_path);
if ((nvram_path != NULL) && (nvram_path[0] != '\0'))
- strcpy(nv_path, nvram_path);
+ strcpy(brcmf_nv_path, nvram_path);
/* Allocate etherdev, including space for private structure */
net = alloc_etherdev(sizeof(dhd));
goto fail;
}
if (!dhd_no_fw_req) {
- strcpy(fw_path, wl_cfg80211_get_fwname());
- strcpy(nv_path, wl_cfg80211_get_nvramname());
+ strcpy(brcmf_fw_path, wl_cfg80211_get_fwname());
+ strcpy(brcmf_nv_path, wl_cfg80211_get_nvramname());
}
/* Set up the watchdog timer */
/* try to download image and nvram to the dongle */
if (dhd->pub.busstate == DHD_BUS_DOWN) {
- if (!(dhd_bus_download_firmware(dhd->pub.bus,
- fw_path, nv_path))) {
+ if (!(dhd_bus_download_firmware(dhd->pub.bus, brcmf_fw_path,
+ brcmf_nv_path))) {
DHD_ERROR(("%s: dhd_bus_download_firmware failed. "
"firmware = %s nvram = %s\n",
- __func__, fw_path, nv_path));
+ __func__, brcmf_fw_path, brcmf_nv_path));
return -1;
}
}
ASSERT(dhd != NULL);
- bcmerror = wl_host_event(dhd, ifidx, pktdata, event, data);
+ bcmerror = brcmf_c_host_event(dhd, ifidx, pktdata, event, data);
if (bcmerror != 0)
return bcmerror;
{
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
- dhd_preinit_ioctls(&dhd->pub);
+ brcmf_c_preinit_ioctls(&dhd->pub);
}
#ifdef PNO_SUPPORT