#include <linux/skbuff.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
+#include <linux/mmc/sdio_func.h>
#include <linux/random.h>
#include <linux/spinlock.h>
#include <linux/ethtool.h>
#include <linux/fcntl.h>
#include <linux/fs.h>
-#include <asm/uaccess.h>
-#include <asm/unaligned.h>
+#include <linux/uaccess.h>
#include <bcmutils.h>
#include <bcmendian.h>
MODULE_SUPPORTED_DEVICE("Broadcom 802.11n WLAN fullmac cards");
MODULE_LICENSE("Dual BSD/GPL");
+#define DRV_MODULE_NAME "brcmfmac"
+
/* Linux wireless extension support */
#if defined(CONFIG_WIRELESS_EXT)
#include <wl_iw.h>
{
dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
- sprintf(info->driver, "wl");
+ sprintf(info->driver, DRV_MODULE_NAME);
sprintf(info->version, "%lu", dhd->pub.drv_version);
+ sprintf(info->fw_version, "%s", wl_cfg80211_get_fwname());
+ sprintf(info->bus_info, "%s", dev_name(&wl_cfg80211_get_sdio_func()->dev));
}
struct ethtool_ops dhd_ethtool_ops = {
/*
** register/deregister sdio function
*/
-static struct sdio_func *wl_sdio_func(void);
+struct sdio_func *wl_cfg80211_get_sdio_func(void);
static void wl_clear_sdio_func(void);
/*
struct wl_priv *wl = ndev_to_wl(ndev);
struct cfg80211_ssid *ssids;
struct wl_scan_req *sr = wl_to_sr(wl);
- uint32 n_ssids;
bool iscan_req;
bool spec_scan;
int32 err = 0;
spec_scan = FALSE;
if (request) { /* scan bss */
ssids = request->ssids;
- n_ssids = min(request->n_ssids, WL_NUM_SCAN_MAX);
- if (wl->iscan_on && n_ssids && !ssids->ssid_len) { /* for
+ if (wl->iscan_on && (!ssids || !ssids->ssid_len)) { /* for
* specific scan,
* ssids->ssid_len has
* non-zero(ssid string)
} else { /* scan in ibss */
/* we don't do iscan in ibss */
ssids = this_ssid;
- n_ssids = 1;
}
wl->scan_request = request;
set_bit(WL_STATUS_SCANNING, &wl->status);
else
goto scan_out;
} else {
- WL_DBG(("n_ssid (%d), ssid \"%s\", ssid_len (%d)\n",
- n_ssids, ssids->ssid, ssids->ssid_len));
+ WL_DBG(("ssid \"%s\", ssid_len (%d)\n",
+ ssids->ssid, ssids->ssid_len));
memset(&sr->ssid, 0, sizeof(sr->ssid));
- if (n_ssids) {
- sr->ssid.SSID_len =
+ sr->ssid.SSID_len =
MIN(sizeof(sr->ssid.SSID), ssids->ssid_len);
- if (sr->ssid.SSID_len) {
- memcpy(sr->ssid.SSID, ssids->ssid,
- sr->ssid.SSID_len);
- sr->ssid.SSID_len = htod32(sr->ssid.SSID_len);
- WL_DBG(("Specific scan ssid=\"%s\" len=%d\n",
+ if (sr->ssid.SSID_len) {
+ memcpy(sr->ssid.SSID, ssids->ssid, sr->ssid.SSID_len);
+ sr->ssid.SSID_len = htod32(sr->ssid.SSID_len);
+ WL_DBG(("Specific scan ssid=\"%s\" len=%d\n",
sr->ssid.SSID, sr->ssid.SSID_len));
- spec_scan = TRUE;
- } else {
- WL_DBG(("Broadcast scan\n"));
- }
+ spec_scan = TRUE;
} else {
- /* broadcast scan */
WL_DBG(("Broadcast scan\n"));
}
WL_DBG(("sr->ssid.SSID_len (%d)\n", sr->ssid.SSID_len));
WL_ERR(("wl_cfg80211_dev is invalid\n"));
return -ENOMEM;
}
- WL_DBG(("func %p\n", wl_sdio_func()));
- wdev = wl_alloc_wdev(sizeof(struct wl_iface), &wl_sdio_func()->dev);
+ WL_DBG(("func %p\n", wl_cfg80211_get_sdio_func()));
+ wdev = wl_alloc_wdev(sizeof(struct wl_iface), &wl_cfg80211_get_sdio_func()->dev);
if (unlikely(IS_ERR(wdev)))
return -ENOMEM;
cfg80211_sdio_func = NULL;
}
-static struct sdio_func *wl_sdio_func(void)
+struct sdio_func *wl_cfg80211_get_sdio_func(void)
{
return cfg80211_sdio_func;
}
if (unlikely
(err =
request_firmware(&wl->fw->fw_entry, file_name,
- &wl_sdio_func()->dev))) {
+ &wl_cfg80211_get_sdio_func()->dev))) {
WL_ERR(("Could not download fw (%d)\n", err));
goto req_fw_out;
}
if (unlikely
(err =
request_firmware(&wl->fw->fw_entry, file_name,
- &wl_sdio_func()->dev))) {
+ &wl_cfg80211_get_sdio_func()->dev))) {
WL_ERR(("Could not download nvram (%d)\n", err));
goto req_fw_out;
}