#endif /* DHDTHREAD */
#define DHD_IF_VIF 0x01 /* Virtual IF (Hidden from user) */
+unsigned long dhd_os_spin_lock(dhd_pub_t *pub);
+void dhd_os_spin_unlock(dhd_pub_t *pub, unsigned long flags);
+
/* Wakelock Functions */
extern int dhd_os_wake_lock(dhd_pub_t *pub);
extern int dhd_os_wake_unlock(dhd_pub_t *pub);
#define DHD_OS_WAKE_LOCK_TIMEOUT(pub) dhd_os_wake_lock_timeout(pub)
#define DHD_OS_WAKE_LOCK_TIMEOUT_ENABLE(pub) dhd_os_wake_lock_timeout_enable(pub)
-extern unsigned long dhd_os_spin_lock(dhd_pub_t *pub);
-extern void dhd_os_spin_unlock(dhd_pub_t *pub, unsigned long flags);
-
/* interface operations (register, remove) should be atomic, use this lock to prevent race
* condition among wifi on/off and interface operation functions
bool ap_cfg_running = FALSE;
bool ap_fw_loaded = FALSE;
-
#if defined(KEEP_ALIVE)
int dhd_keep_alive_onoff(dhd_pub_t *dhd, int ka_on);
#endif /* KEEP_ALIVE */
uint32 mpc = 0; /* Turn MPC off for AP/APSTA mode */
uint32 apsta = 1; /* Enable APSTA mode */
#endif
-#ifdef GET_CUSTOM_MAC_ENABLE
- struct ether_addr ea_addr;
-#endif /* GET_CUSTOM_MAC_ENABLE */
#ifdef GET_CUSTOM_MAC_ENABLE
- /*
- ** Read MAC address from external customer place
- ** NOTE that default mac address has to be present in otp or nvram file
- ** to bring up firmware but unique per board mac address maybe provided
- ** by customer code
- */
- ret = dhd_custom_get_mac_address(ea_addr.octet);
- if (!ret) {
- bcm_mkiovar("cur_etheraddr", (void *)&ea_addr, ETHER_ADDR_LEN, buf, sizeof(buf));
+ /* MAC address already defined in dhd->mac.octet */
+ memset(buf, 0, sizeof(buf));
+ bcm_mkiovar("cur_etheraddr", dhd->mac.octet, ETHER_ADDR_LEN, buf, sizeof(buf));
ret = dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, buf, sizeof(buf), TRUE, 0);
if (ret < 0) {
DHD_ERROR(("%s: can't set MAC address , error=%d\n", __FUNCTION__, ret));
- } else
- memcpy(dhd->mac.octet, (void *)&ea_addr, ETHER_ADDR_LEN);
- } else {
-#endif /* GET_CUSTOM_MAC_ENABLE */
+ return BCME_NOTUP;
+ }
+#else /* GET_CUSTOM_MAC_ENABLE */
/* Get the default device MAC address directly from firmware */
- strcpy(iovbuf, "cur_etheraddr");
- if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_GET_VAR, iovbuf, sizeof(iovbuf),
+ memset(buf, 0, sizeof(buf));
+ bcm_mkiovar("cur_etheraddr", 0, 0, buf, sizeof(buf));
+ if ((ret = dhd_wl_ioctl_cmd(dhd, WLC_GET_VAR, buf, sizeof(buf),
FALSE, 0)) < 0) {
DHD_ERROR(("%s: can't get MAC address , error=%d\n", __FUNCTION__, ret));
return BCME_NOTUP;
}
- memcpy(dhd->mac.octet, iovbuf, ETHER_ADDR_LEN);
-#ifdef GET_CUSTOM_MAC_ENABLE
- }
+ /* Update public MAC address after reading from Firmware */
+ memcpy(dhd->mac.octet, buf, ETHER_ADDR_LEN);
#endif /* GET_CUSTOM_MAC_ENABLE */
#ifdef SET_RANDOM_MAC_SOFTAP
}
#endif /* SET_RANDOM_MAC_SOFTAP */
- DHD_ERROR(("Broadcom Dongle Host Driver mac=%02x:%02x:%02x:%02x:%02x:%02x\n",
- iovbuf[0], iovbuf[1], iovbuf[2], iovbuf[3], iovbuf[4], iovbuf[5]));
+ DHD_ERROR(("Firmware up: Broadcom Dongle Host Driver mac=%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
+ dhd->mac.octet[0], dhd->mac.octet[1], dhd->mac.octet[2],
+ dhd->mac.octet[3], dhd->mac.octet[4], dhd->mac.octet[5]));
/* Set Country code */
if (dhd->dhd_cspec.ccode[0] != 0) {
}
#endif /* ARP_OFFLOAD_SUPPORT */
+#ifdef PKT_FILTER_SUPPORT
+ if (ap_fw_loaded) {
+ int i;
+ for (i = 0; i < dhd->pktfilter_count; i++) {
+ dhd_pktfilter_offload_enable(dhd, dhd->pktfilter[i],
+ 0, dhd_master_mode);
+ }
+ }
+#endif /* PKT_FILTER_SUPPORT */
+
done:
return ret;
void get_customized_country_code(char *country_iso_code, wl_country_t *cspec)
{
#if defined(CUSTOMER_HW2) && (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 39))
+
struct cntry_locales_custom *cloc_ptr;
if (!cspec)
ifidx = dhd_net2idx(dhd, net);
DHD_TRACE(("%s: ifidx %d\n", __FUNCTION__, ifidx));
+ if (ifidx < 0) {
+ DHD_ERROR(("%s: Error: called with invalid IF\n", __FUNCTION__));
+ return -1;
+ }
+
if (!dhd->iflist[ifidx] || dhd->iflist[ifidx]->state == WLC_E_IF_DEL) {
DHD_ERROR(("%s: Error: called when IF already deleted\n", __FUNCTION__));
return -1;
goto fail;
}
- printf("%s: Broadcom Dongle Host Driver mac=%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n", net->name,
+ printf("%s: Driver up: Broadcom Dongle Host Driver mac=%.2x:%.2x:%.2x:%.2x:%.2x:%.2x\n",
+ net->name,
dhd->pub.mac.octet[0], dhd->pub.mac.octet[1], dhd->pub.mac.octet[2],
dhd->pub.mac.octet[3], dhd->pub.mac.octet[4], dhd->pub.mac.octet[5]);
static bool forcealign;
/* Flag to indicate if we should download firmware on driver load */
-uint dhd_download_fw_on_driverload = 1;
+uint dhd_download_fw_on_driverload = TRUE;
#define ALIGNMENT 4
void * regsva, uint16 devid);
static bool dhdsdio_probe_malloc(dhd_bus_t *bus, osl_t *osh, void *sdh);
static bool dhdsdio_probe_init(dhd_bus_t *bus, osl_t *osh, void *sdh);
-static void dhdsdio_release_dongle(dhd_bus_t *bus, osl_t *osh, bool dongle_isolation, bool reset_flag);
+static void dhdsdio_release_dongle(dhd_bus_t *bus, osl_t *osh, bool dongle_isolation,
+ bool reset_flag);
static void dhd_dongle_setmemsize(struct dhd_bus *bus, int mem_size);
static int dhd_bcmsdh_recv_buf(dhd_bus_t *bus, uint32 addr, uint fn, uint flags,
int ret;
dhd_bus_t *bus;
dhd_cmn_t *cmn;
+#ifdef GET_CUSTOM_MAC_ENABLE
+ struct ether_addr ea_addr;
+#endif /* GET_CUSTOM_MAC_ENABLE */
/* Init global variables at run-time, not as part of the declaration.
* This is required to support init/de-init of the driver. Initialization
DHD_INFO(("%s: completed!!\n", __FUNCTION__));
+#ifdef GET_CUSTOM_MAC_ENABLE
+ /* Read MAC address from external customer place */
+ memset(&ea_addr, 0, sizeof(ea_addr));
+ ret = dhd_custom_get_mac_address(ea_addr.octet);
+ if (!ret) {
+ memcpy(bus->dhd->mac.octet, (void *)&ea_addr, ETHER_ADDR_LEN);
+ } else {
+ /* MAC address must be present when Driver insmod */
+ DHD_ERROR(("%s unable to get MAC address\n", __FUNCTION__));
+ goto fail;
+ }
+#endif /* GET_CUSTOM_MAC_ENABLE */
/* if firmware path present try to download and bring up bus */
if (dhd_download_fw_on_driverload && (ret = dhd_bus_start(bus->dhd)) != 0) {
/* Download image */
while ((offset + MEMBLOCK) < sizeof(dlarray)) {
- bcmerror = dhdsdio_membytes(bus, TRUE, offset, (uint8 *) (dlarray + offset), MEMBLOCK);
+ bcmerror = dhdsdio_membytes(bus, TRUE, offset,
+ (uint8 *) (dlarray + offset), MEMBLOCK);
if (bcmerror) {
DHD_ERROR(("%s: error %d on writing %d membytes at 0x%08x\n",
__FUNCTION__, bcmerror, MEMBLOCK, offset));
DHD_TRACE(("%s: WLAN ON DONE\n", __FUNCTION__));
} else {
dhd_bus_stop(bus, FALSE);
- dhdsdio_release_dongle(bus, bus->dhd->osh, TRUE, FALSE);
+ dhdsdio_release_dongle(bus, bus->dhd->osh,
+ TRUE, FALSE);
}
} else
bcmerror = BCME_SDIO_ERROR;
#define EPI_RC_NUMBER 125
-#define EPI_INCREMENTAL_NUMBER 32
+#define EPI_INCREMENTAL_NUMBER 33
#define EPI_BUILD_NUMBER 0
-#define EPI_VERSION 5, 90, 125, 32
+#define EPI_VERSION 5, 90, 125, 33
-#define EPI_VERSION_NUM 0x055a7d20
+#define EPI_VERSION_NUM 0x055a7d21
#define EPI_VERSION_DEV 5.90.125
-#define EPI_VERSION_STR "5.90.125.32"
+#define EPI_VERSION_STR "5.90.125.33"
#endif
{
int i;
- for (i = 0; i < MAX_STATIC_PKT_NUM*2; i++)
+ for (i = 0; i < MAX_STATIC_PKT_NUM; i++)
{
if (p == bcm_static_skb->skb_4k[i])
{
bcm_static_skb->pkt_use[i] = 0;
up(&bcm_static_skb->osl_pkt_sem);
+ return;
+ }
+ }
+
+ for (i = 0; i < MAX_STATIC_PKT_NUM; i++)
+ {
+ if (p == bcm_static_skb->skb_8k[i])
+ {
+ down(&bcm_static_skb->osl_pkt_sem);
+ bcm_static_skb->pkt_use[i + MAX_STATIC_PKT_NUM] = 0;
+ up(&bcm_static_skb->osl_pkt_sem);
return;
}
}
+
return osl_pktfree(osh, p, send);
}
#endif
* time (only) in dhd_open, subsequential wifi on will be handled by
* wl_android_wifi_on
*/
-static int g_wifi_on = 1;
+static int g_wifi_on = TRUE;
/**
* Local (static) function definitions
return ret;
}
+
int wl_android_init(void)
{
int ret = 0;
dhd_msg_level = DHD_ERROR_VAL;
- dhd_download_fw_on_driverload = 0;
+#ifdef ENABLE_INSMOD_NO_FW_LOAD
+#ifdef GET_CUSTOM_MAC_ENABLE
+ dhd_download_fw_on_driverload = FALSE;
+#else
+#error GET_CUSTOM_MAC_ENABLE must be defined to isnmod Driver with no FW load
+#endif /* GET_CUSTOM_MAC_ENABLE */
+#endif /* ENABLE_INSMOD_NO_FW_LOAD */
return ret;
}
s32 i;
bss_list = wl->bss_list;
+ /*
if (unlikely(bss_list->version != WL_BSS_INFO_VERSION)) {
- WL_ERR(("Version %d != WL_BSS_INFO_VERSION\n",
- bss_list->version));
+ WL_ERR(("Version %d != %d\n",
+ bss_list->version, WL_BSS_INFO_VERSION));
return -EOPNOTSUPP;
}
+ */
WL_DBG(("scanned AP count (%d)\n", bss_list->count));
bi = next_bss(bss_list, bi);
for_each_bss(bss_list, bi, i) {
if (test_bit(WL_STATUS_CONNECTING, &wl->status))
wl_bss_connect_done(wl, ndev, e, data, false);
} else {
- printk("nothing");
+ printk("%s nothing\n", __FUNCTION__);
}
printk("\n");
}