Most of these patches are brcmfmac cleanup.
Arend van Spriel (67):
staging: brcm80211: fix checkpatch errors in types.h
staging: brcm80211: remove flash related code from
initvars_srom_pci()
staging: brcm80211: minor cleanup in initvars_srom_pci()
staging: brcm80211: make use of linux error codes in srom.c
staging: brcm80211: remove code for unsupported chipsets from
brcmsmac
staging: brcm80211: remove unsupported chipset code from brcmsmac phy
staging: brcm80211: remove otp power control functions
staging: brcm80211: remove code from pmu.c related to unsupported
chipsets
staging: brcm80211: remove unused macro definitions from pmu.c
staging: brcm80211: remove chip simulation specific code
staging: brcm80211: remove macro FOREACH_AS_STA
staging: brcm80211: change FOREACH_BSS macro to remove checkpatch
error
staging: brcm80211: remove macro definition DRV_MODULE_NAME
staging: brcm80211: get rid on IS_CFG80211_FAVORITE macro
staging: brcm80211: move assert function to dhd_linux.c
staging: brcm80211: correct bcmsdh_recv_buf() calls
staging: brcm80211: remove wireless extensions support from brcmfmac
staging: brcm80211: remove dhd_set_timer function prototype
staging: brcm80211: remove unused globals from dhd_common.c
staging: brcm80211: remove extern function prototypes from c files
staging: brcm80211: rename functions and variables in dhd_common.c
staging: brcm80211: rename ioctl command codes in dhd.h
staging: brcm80211: remove unused definitions from dhd.h
staging: brcm80211: replace macro BCM_MSG_IFNAME_MAX with IFNAMSIZ
staging: brcm80211: rename event handling definition
staging: brcm80211: rename module parameters
staging: brcm80211: remove unnecessary abstraction for scheduler
staging: brcm80211: rename fullmac functions
staging: brcm80211: remove unused prototypes from dhd.h
staging: brcm80211: rename fullmac protocol related functions
staging: brcm80211: get rid of PKT[TO/FROM]NATIVE macros
staging: brcm80211: rename dhd_prot and get rid of dhd_prot_t typedef
staging: brcm80211: remove conditional SIMPLE_ISCAN code
staging: brcm80211: rename netdevice related functions in fullmac
staging: brcm80211: rename static functions in dhd_linux.c
staging: brcm80211: rename more brcmfmac module parameters
staging: brcm80211: further renaming in fullmac sources
staging: brcm80211: remove ARP_OFFLOAD_SUPPORT macro definition
staging: brcm80211: remove PKT_FILTER_SUPPORT macro definition
staging: brcm80211: remove BCMLXSDMMC macro definition
staging: brcm80211: always enable code for PLATFORM_BUS functionality
staging: brcm80211: remove DHD_SCHED macro definition
staging: brcm80211: remove EMBEDDED_PLATFORM macro definition
staging: brcm80211: remove MMC_SDIO_ABORT macro definition
staging: brcm80211: remove TOE macro definition
staging: brcm80211: define SHOW_EVENTS macro only for debugging
staging: brcm80211: replace DHD_DEBUG macro with BCMDBG
staging: brcm80211: remove unnecessary macro defintions
staging: brcm80211: remove custom gpio support code
staging: brcm80211: remove conditional code fragments from brcmfmac
staging: brcm80211: rename EPI_VERSION_STR macro
staging: brcm80211: use linux native ethertype iso ETH_P_BRCM
staging: brcm80211: rename function variables
staging: brcm80211: remove unused definitions from dhd.h
staging: brcm80211: rename structure definitions in dhd.h
staging: brcm80211: rename macro definitions in dhd.h
staging: brcm80211: remove unused macro definitions from dhd.h
staging: brcm80211: structure renaming in dhd.h
staging: brcm80211: rename structure definitions in dhd_linux.c
staging: brcm80211: rename struct dhd_pub to struct brcmf_pub
staging: brcm80211: rename function variables
staging: brcm80211: remove unused macros from dhd_dbg.h
staging: brcm80211: rename dhd_bus structure and functions
staging: brcm80211: rename static functions in wl_cfg80211.c
staging: brcm80211: rename structures and variables in wl_cfg80211.c
staging: brcm80211: rename pointer conversion macros in wl_cfg80211.h
staging: brcm80211: rename external function in wl_cfg80211.c
Franky Lin (11):
staging: brcm80211: remove unused sdtxlock from fullmac
staging: brcm80211: remove empty sdrxqlock from fullmac
staging: brcm80211: move sdtxqlock codes to dhd_sdio.c
staging: brcm80211: remove unused files from fullmac
staging: brcm80211: move sdio related suspend/resume code to bus
interface layer
staging: brcm80211: move waitqueue code to dhd_sdio.c
staging: brcm80211: move fullmac watchdog timer code to dhd_sdio.c
staging: brcm80211: move debug console related code to dhd_sdio.c
staging: brcm80211: move dpc code to dhd_sdio.c
staging: brcm80211: move sdio resource lock to dhd_sdio.c
staging: brcm80211: clean up firmware download code in fullmac
Henry Ptasinski (9):
staging: brcm80211: removed unneeded 'if' statement
staging: brcm80211: delete empty brcmfmac/README file
staging: brcm80211: run scripts/cleanfile to remove whitespace errors
staging: brcm80211: cleanup whitespace errors
staging: brcm80211: add missing KERN_ facility level to printk()
staging: brcm80211: flatten wlc_phy_shared_detach()
staging: brcm80211: remove unnecessary null check
staging: brcm80211: reorg brcms_c_validboardtype for clarity
staging: brcm80211: updated TODO file
Roland Vossen (31):
staging: brcm80211: parsed ADDBA response ack window parameter
staging: brcm80211: taking max AMPDU length advertized by peer into
account
staging: brcm80211: corrected tx status feedback for non AMPDU
packets
staging: brcm80211: Changed comments
staging: brcm80211: replaced prefix of SDIO related functions
staging: brcm80211: removed BDC defines
staging: brcm80211: replaced typedef sdioh_info_t by struct
sdioh_info
staging: brcm80211: replaced typedef bcmsdh_info_t by struct
brcmf_sdio
staging: brcm80211: replaced typedef by struct for several sdio types
staging: brcm80211: replaced typedef SDIOH_API_RC by int
staging: brcm80211: replaced more sdio related typedefs by structs
staging: brmc80211: cleaned up sdio related error codes
staging: brcm80211: removed global function declarations from .c
files
staging: brcm80211: removed last occurrences of bcmsdh/BCMSDH
staging: brcm80211: sdh related code cleanup
staging: brcm80211: removed brcmf_sdioh_interrupt_pending()
staging: brcm80211: removed brcmf_sdioh_reset()
staging: brcm80211: removed brcmf_sdioh_start() and
brcmf_sdioh_stop()
staging: brcm80211: removed file sdiovar.h
staging: brcm80211: further cleaned fullmac header files
staging: brcm80211: removed last global function declaration in .c
file
staging: brcm80211: removed last typedefs from fullmac
staging: brcm80211: removed unused code and definitions from fullmac
staging: brcm80211: fullmac register access macro's take u32 instead
of pointers
staging: brcm80211: replaced macro R_SDREG by function r_sdreg()
staging: brcm80211: replaced macro W_SDREG by function w_sdreg()
staging: brcm80211: got rid of redundant member 'regs' of struct
dhd_bus
staging: brcm80211: removed last amd64 compiler warnings
staging: brcm80211: W_REG macro cleanup in fullmac SDIO
staging: brcm80211: removed unused definitions from dhd_sdio.c
staging: brcm80211: fix for reported log spam problem
Sukesh Srikakula (1):
staging:brcm80211:brcmfmac: CONNECTING status bit is set at
appropriate location
drivers/staging/brcm80211/Makefile | 2 +-
drivers/staging/brcm80211/TODO | 12 +-
drivers/staging/brcm80211/brcmfmac/Makefile | 23 +-
drivers/staging/brcm80211/brcmfmac/README | 2 -
drivers/staging/brcm80211/brcmfmac/aiutils.c | 1 -
drivers/staging/brcm80211/brcmfmac/bcmchip.h | 3 +
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h | 181 +-
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 489 ++--
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c | 273 +--
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 441 +--
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h | 132 -
.../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c | 130 +-
drivers/staging/brcm80211/brcmfmac/dhd.h | 1057 +++----
drivers/staging/brcm80211/brcmfmac/dhd_bus.h | 61 +-
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 225 +-
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 1237 ++-----
.../staging/brcm80211/brcmfmac/dhd_custom_gpio.c | 158 -
drivers/staging/brcm80211/brcmfmac/dhd_dbg.h | 66 +-
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 2048 +++--------
.../staging/brcm80211/brcmfmac/dhd_linux_sched.c | 25 -
drivers/staging/brcm80211/brcmfmac/dhd_proto.h | 48 +-
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 2821 ++++++++-------
drivers/staging/brcm80211/brcmfmac/dngl_stats.h | 4 +-
drivers/staging/brcm80211/brcmfmac/pcicfg.h | 50 -
drivers/staging/brcm80211/brcmfmac/sbsdio.h | 98 +-
drivers/staging/brcm80211/brcmfmac/sdio_host.h | 165 +-
drivers/staging/brcm80211/brcmfmac/sdiovar.h | 38 -
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 2374 ++++++-------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h | 193 +-
drivers/staging/brcm80211/brcmfmac/wl_iw.c | 3711 --------------------
drivers/staging/brcm80211/brcmfmac/wl_iw.h | 138 -
drivers/staging/brcm80211/brcmsmac/aiutils.c | 66 +-
drivers/staging/brcm80211/brcmsmac/aiutils.h | 4 -
drivers/staging/brcm80211/brcmsmac/ampdu.c | 78 +-
drivers/staging/brcm80211/brcmsmac/bmac.c | 44 +-
drivers/staging/brcm80211/brcmsmac/d11.h | 30 +-
drivers/staging/brcm80211/brcmsmac/dma.c | 2 +-
drivers/staging/brcm80211/brcmsmac/mac80211_if.c | 24 +-
drivers/staging/brcm80211/brcmsmac/main.c | 90 +-
drivers/staging/brcm80211/brcmsmac/nicpci.c | 49 +-
drivers/staging/brcm80211/brcmsmac/otp.c | 19 +-
drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c | 59 +-
drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h | 7 +-
drivers/staging/brcm80211/brcmsmac/phy/phy_int.h | 14 +-
drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c | 28 +-
drivers/staging/brcm80211/brcmsmac/phy/phy_n.c | 167 +-
drivers/staging/brcm80211/brcmsmac/phy/phyreg_n.h | 14 +-
.../staging/brcm80211/brcmsmac/phy/phytbl_lcn.c | 18 +-
drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.c | 28 +-
drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.h | 10 +-
drivers/staging/brcm80211/brcmsmac/phy_shim.h | 4 +-
drivers/staging/brcm80211/brcmsmac/pmu.c | 1925 +----------
drivers/staging/brcm80211/brcmsmac/pmu.h | 3 -
drivers/staging/brcm80211/brcmsmac/pub.h | 2 +
drivers/staging/brcm80211/brcmsmac/rate.h | 6 +-
drivers/staging/brcm80211/brcmsmac/scb.h | 7 +-
drivers/staging/brcm80211/brcmsmac/srom.c | 160 +-
drivers/staging/brcm80211/brcmsmac/types.h | 32 +-
drivers/staging/brcm80211/brcmutil/utils.c | 4 +-
drivers/staging/brcm80211/brcmutil/wifi.c | 1 -
drivers/staging/brcm80211/include/brcmu_utils.h | 6 +-
drivers/staging/brcm80211/include/soc.h | 2 +-
62 files changed, 5110 insertions(+), 13999 deletions(-)
delete mode 100644 drivers/staging/brcm80211/brcmfmac/README
delete mode 100644 drivers/staging/brcm80211/brcmfmac/aiutils.c
delete mode 100644 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
delete mode 100644 drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c
delete mode 100644 drivers/staging/brcm80211/brcmfmac/dhd_linux_sched.c
delete mode 100644 drivers/staging/brcm80211/brcmfmac/pcicfg.h
delete mode 100644 drivers/staging/brcm80211/brcmfmac/sdiovar.h
delete mode 100644 drivers/staging/brcm80211/brcmfmac/wl_iw.c
delete mode 100644 drivers/staging/brcm80211/brcmfmac/wl_iw.h
From: Arend van Spriel <[email protected]>
The macro is always intended to be defined so no need for it.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/Makefile | 1 -
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 2 -
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 5 +-
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 238 ----------------------
4 files changed, 1 insertions(+), 245 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/Makefile b/drivers/staging/brcm80211/brcmfmac/Makefile
index 1444fd4..2ccfa1f 100644
--- a/drivers/staging/brcm80211/brcmfmac/Makefile
+++ b/drivers/staging/brcm80211/brcmfmac/Makefile
@@ -20,7 +20,6 @@ ccflags-y := \
-DBRCM_FULLMAC \
-DBRCMF_FIRSTREAD=64 \
-DBRCMF_SDALIGN=64 \
- -DEMBEDDED_PLATFORM \
-DMAX_HDR_READ=64 \
-DMMC_SDIO_ABORT \
-DSHOW_EVENTS \
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index 594c217..a766707 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -504,9 +504,7 @@ int brcmf_proto_init(dhd_pub_t *dhd)
brcmf_os_proto_unblock(dhd);
-#ifdef EMBEDDED_PLATFORM
ret = brcmf_c_preinit_ioctls(dhd);
-#endif /* EMBEDDED_PLATFORM */
/* Always assumes wl for now */
dhd->iswl = true;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 593d180..8a2c73d 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -1930,10 +1930,8 @@ int brcmf_bus_start(dhd_pub_t *dhdp)
{
int ret = -1;
dhd_info_t *dhd = (dhd_info_t *) dhdp->info;
-#ifdef EMBEDDED_PLATFORM
char iovbuf[WL_EVENTING_MASK_LEN + 12]; /* Room for "event_msgs" +
'\0' + bitvec */
-#endif /* EMBEDDED_PLATFORM */
ASSERT(dhd);
@@ -1981,7 +1979,7 @@ int brcmf_bus_start(dhd_pub_t *dhdp)
DHD_ERROR(("%s failed bus is not ready\n", __func__));
return -ENODEV;
}
-#ifdef EMBEDDED_PLATFORM
+
brcmu_mkiovar("event_msgs", dhdp->eventmask, WL_EVENTING_MASK_LEN,
iovbuf, sizeof(iovbuf));
brcmf_proto_cdc_query_ioctl(dhdp, 0, BRCMF_C_GET_VAR, iovbuf,
@@ -2015,7 +2013,6 @@ int brcmf_bus_start(dhd_pub_t *dhdp)
dhdp->pktfilter_count = 1;
/* Setup filter to allow only unicast */
dhdp->pktfilter[0] = "100 0 0 0 0x01 0x00";
-#endif /* EMBEDDED_PLATFORM */
/* Bus is ready, do any protocol initialization */
ret = brcmf_proto_init(&dhd->pub);
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index 086a93b..1d80d75 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -250,20 +250,6 @@ static void wl_init_conf(struct wl_conf *conf);
/*
** dongle configuration utilities
*/
-#ifndef EMBEDDED_PLATFORM
-static s32 wl_dongle_mode(struct net_device *ndev, s32 iftype);
-static s32 wl_dongle_country(struct net_device *ndev, u8 ccode);
-static s32 wl_dongle_up(struct net_device *ndev, u32 up);
-static s32 wl_dongle_power(struct net_device *ndev, u32 power_mode);
-static s32 wl_dongle_glom(struct net_device *ndev, u32 glom,
- u32 dongle_align);
-static s32 wl_dongle_offload(struct net_device *ndev, s32 arpoe,
- s32 arp_ol);
-static s32 wl_pattern_atoh(s8 *src, s8 *dst);
-static s32 wl_dongle_filter(struct net_device *ndev, u32 filter_mode);
-static s32 wl_update_wiphybands(struct wl_priv *wl);
-#endif /* !EMBEDDED_PLATFORM */
-
static s32 wl_dongle_eventmsg(struct net_device *ndev);
static s32 wl_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
s32 scan_unassoc_time, s32 scan_passive_time);
@@ -3657,212 +3643,6 @@ static s32 wl_dongle_mode(struct net_device *ndev, s32 iftype)
return 0;
}
-#ifndef EMBEDDED_PLATFORM
-static s32 wl_dongle_country(struct net_device *ndev, u8 ccode)
-{
-
- s32 err = 0;
-
- return err;
-}
-
-static s32 wl_dongle_up(struct net_device *ndev, u32 up)
-{
- s32 err = 0;
-
- err = wl_dev_ioctl(ndev, BRCMF_C_UP, &up, sizeof(up));
- if (unlikely(err)) {
- WL_ERR("WLC_UP error (%d)\n", err);
- }
- return err;
-}
-
-static s32 wl_dongle_power(struct net_device *ndev, u32 power_mode)
-{
- s32 err = 0;
-
- err = wl_dev_ioctl(ndev, BRCMF_C_SET_PM,
- &power_mode, sizeof(power_mode));
- if (unlikely(err)) {
- WL_ERR("WLC_SET_PM error (%d)\n", err);
- }
- return err;
-}
-
-static s32
-wl_dongle_glom(struct net_device *ndev, u32 glom, u32 dongle_align)
-{
- s8 iovbuf[WL_EVENTING_MASK_LEN + 12]; /* Room for "event_msgs" +
- '\0' + bitvec */
- s32 err = 0;
-
- /* Match Host and Dongle rx alignment */
- brcmu_mkiovar("bus:txglomalign", (char *)&dongle_align, 4, iovbuf,
- sizeof(iovbuf));
- err = wl_dev_ioctl(ndev, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
- if (unlikely(err)) {
- WL_ERR("txglomalign error (%d)\n", err);
- goto dongle_glom_out;
- }
- /* disable glom option per default */
- brcmu_mkiovar("bus:txglom", (char *)&glom, 4, iovbuf, sizeof(iovbuf));
- err = wl_dev_ioctl(ndev, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
- if (unlikely(err)) {
- WL_ERR("txglom error (%d)\n", err);
- goto dongle_glom_out;
- }
-dongle_glom_out:
- return err;
-}
-
-static s32
-wl_dongle_offload(struct net_device *ndev, s32 arpoe, s32 arp_ol)
-{
- s8 iovbuf[WL_EVENTING_MASK_LEN + 12]; /* Room for "event_msgs" +
- '\0' + bitvec */
- s32 err = 0;
-
- /* Set ARP offload */
- brcmu_mkiovar("arpoe", (char *)&arpoe, 4, iovbuf, sizeof(iovbuf));
- err = wl_dev_ioctl(ndev, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
- if (err) {
- if (err == -EOPNOTSUPP)
- WL_INFO("arpoe is not supported\n");
- else
- WL_ERR("arpoe error (%d)\n", err);
-
- goto dongle_offload_out;
- }
- brcmu_mkiovar("arp_ol", (char *)&arp_ol, 4, iovbuf, sizeof(iovbuf));
- err = wl_dev_ioctl(ndev, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
- if (err) {
- if (err == -EOPNOTSUPP)
- WL_INFO("arp_ol is not supported\n");
- else
- WL_ERR("arp_ol error (%d)\n", err);
-
- goto dongle_offload_out;
- }
-
-dongle_offload_out:
- return err;
-}
-
-static s32 wl_pattern_atoh(s8 *src, s8 *dst)
-{
- int i;
- if (strncmp(src, "0x", 2) != 0 && strncmp(src, "0X", 2) != 0) {
- WL_ERR("Mask invalid format. Needs to start with 0x\n");
- return -1;
- }
- src = src + 2; /* Skip past 0x */
- if (strlen(src) % 2 != 0) {
- WL_ERR("Mask invalid format. Needs to be of even length\n");
- return -1;
- }
- for (i = 0; *src != '\0'; i++) {
- char num[3];
- strncpy(num, src, 2);
- num[2] = '\0';
- dst[i] = (u8) simple_strtoul(num, NULL, 16);
- src += 2;
- }
- return i;
-}
-
-static s32 wl_dongle_filter(struct net_device *ndev, u32 filter_mode)
-{
- s8 iovbuf[WL_EVENTING_MASK_LEN + 12]; /* Room for "event_msgs" +
- '\0' + bitvec */
- const s8 *str;
- struct wl_pkt_filter pkt_filter;
- struct wl_pkt_filter *pkt_filterp;
- s32 buf_len;
- s32 str_len;
- u32 mask_size;
- u32 pattern_size;
- s8 buf[256];
- s32 err = 0;
-
-/* add a default packet filter pattern */
- str = "pkt_filter_add";
- str_len = strlen(str);
- strncpy(buf, str, str_len);
- buf[str_len] = '\0';
- buf_len = str_len + 1;
-
- pkt_filterp = (struct wl_pkt_filter *)(buf + str_len + 1);
-
- /* Parse packet filter id. */
- pkt_filter.id = cpu_to_le32(100);
-
- /* Parse filter polarity. */
- pkt_filter.negate_match = cpu_to_le32(0);
-
- /* Parse filter type. */
- pkt_filter.type = cpu_to_le32(0);
-
- /* Parse pattern filter offset. */
- pkt_filter.u.pattern.offset = cpu_to_le32(0);
-
- /* Parse pattern filter mask. */
- mask_size = cpu_to_le32(wl_pattern_atoh("0xff",
- (char *)pkt_filterp->u.pattern.
- mask_and_pattern));
-
- /* Parse pattern filter pattern. */
- pattern_size = cpu_to_le32(wl_pattern_atoh("0x00",
- (char *)&pkt_filterp->u.
- pattern.
- mask_and_pattern
- [mask_size]));
-
- if (mask_size != pattern_size) {
- WL_ERR("Mask and pattern not the same size\n");
- err = -EINVAL;
- goto dongle_filter_out;
- }
-
- pkt_filter.u.pattern.size_bytes = mask_size;
- buf_len += WL_PKT_FILTER_FIXED_LEN;
- buf_len += (WL_PKT_FILTER_PATTERN_FIXED_LEN + 2 * mask_size);
-
- /* Keep-alive attributes are set in local
- * variable (keep_alive_pkt), and
- * then memcpy'ed into buffer (keep_alive_pktp) since there is no
- * guarantee that the buffer is properly aligned.
- */
- memcpy((char *)pkt_filterp, &pkt_filter,
- WL_PKT_FILTER_FIXED_LEN + WL_PKT_FILTER_PATTERN_FIXED_LEN);
-
- err = wl_dev_ioctl(ndev, BRCMF_C_SET_VAR, buf, buf_len);
- if (err) {
- if (err == -EOPNOTSUPP) {
- WL_INFO("filter not supported\n");
- } else {
- WL_ERR("filter (%d)\n", err);
- }
- goto dongle_filter_out;
- }
-
- /* set mode to allow pattern */
- brcmu_mkiovar("pkt_filter_mode", (char *)&filter_mode, 4, iovbuf,
- sizeof(iovbuf));
- err = wl_dev_ioctl(ndev, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
- if (err) {
- if (err == -EOPNOTSUPP) {
- WL_INFO("filter_mode not supported\n");
- } else {
- WL_ERR("filter_mode (%d)\n", err);
- }
- goto dongle_filter_out;
- }
-
-dongle_filter_out:
- return err;
-}
-#endif /* !EMBEDDED_PLATFORM */
-
static s32 wl_dongle_eventmsg(struct net_device *ndev)
{
s8 iovbuf[WL_EVENTING_MASK_LEN + 12]; /* Room for "event_msgs" +
@@ -4026,24 +3806,6 @@ s32 wl_config_dongle(struct wl_priv *wl, bool need_lock)
if (need_lock)
rtnl_lock();
-#ifndef EMBEDDED_PLATFORM
- err = wl_dongle_up(ndev, 0);
- if (unlikely(err))
- goto default_conf_out;
- err = wl_dongle_country(ndev, 0);
- if (unlikely(err))
- goto default_conf_out;
- err = wl_dongle_power(ndev, PM_FAST);
- if (unlikely(err))
- goto default_conf_out;
- err = wl_dongle_glom(ndev, 0, BRCMF_SDALIGN);
- if (unlikely(err))
- goto default_conf_out;
-
- wl_dongle_offload(ndev, 1, 0xf);
- wl_dongle_filter(ndev, 1);
-#endif /* !EMBEDDED_PLATFORM */
-
wl_dongle_scantime(ndev, WL_SCAN_CHANNEL_TIME,
WL_SCAN_UNASSOC_TIME, WL_SCAN_PASSIVE_TIME);
--
1.7.1
From: Arend van Spriel <[email protected]>
A couple of prototypes are not defined or not used and have been
removed from the driver.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 5 -----
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 9 ---------
2 files changed, 0 insertions(+), 14 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index d19d091..3f1b757 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -943,7 +943,6 @@ extern void brcmf_timeout_start(dhd_timeout_t *tmo, uint usec);
extern int brcmf_timeout_expired(dhd_timeout_t *tmo);
extern int brcmf_ifname2idx(struct dhd_info *dhd, char *name);
-extern u8 *dhd_bssidx2bssid(dhd_pub_t *dhd, int idx);
extern int brcmf_c_host_event(struct dhd_info *dhd, int *idx, void *pktdata,
brcmf_event_msg_t *, void **data_ptr);
@@ -964,11 +963,7 @@ extern void brcmf_vif_sendup(struct dhd_info *dhd, int ifidx,
/* Send packet to dongle via data channel */
extern int brcmf_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pkt);
-/* Send event to host */
-extern void dhd_sendup_event(dhd_pub_t *dhdp, brcmf_event_msg_t *event,
- void *data);
extern int brcmf_bus_devreset(dhd_pub_t *dhdp, u8 flag);
-extern uint dhd_bus_status(dhd_pub_t *dhdp);
extern int brcmf_bus_start(dhd_pub_t *dhdp);
extern void brcmf_wait_for_event(dhd_pub_t *dhd, bool * lockvar);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 928220c..f326071 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -2519,15 +2519,6 @@ dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
return bcmerror;
}
-/* send up locally generated event */
-void dhd_sendup_event(dhd_pub_t *dhdp, brcmf_event_msg_t *event, void *data)
-{
- switch (be32_to_cpu(event->event_type)) {
- default:
- break;
- }
-}
-
void brcmf_wait_for_event(dhd_pub_t *dhd, bool *lockvar)
{
struct dhd_info *dhdinfo = dhd->info;
--
1.7.1
From: Henry Ptasinski <[email protected]>
kfree(NULL) is safe, and the rest of the cleanup should be done regardless
to make sure the state is consistent.
Signed-off-by: Henry Ptasinski <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 48550f3..0fae0b1 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -5567,11 +5567,9 @@ static void dhdsdio_release_malloc(dhd_bus_t *bus)
if (bus->dhd && bus->dhd->dongle_reset)
return;
- if (bus->rxbuf) {
- kfree(bus->rxbuf);
- bus->rxctl = bus->rxbuf = NULL;
- bus->rxlen = 0;
- }
+ kfree(bus->rxbuf);
+ bus->rxctl = bus->rxbuf = NULL;
+ bus->rxlen = 0;
kfree(bus->databuf);
bus->databuf = NULL;
--
1.7.1
From: Arend van Spriel <[email protected]>
Change functions related to netdevice in fullmac to more consistent
naming convention.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 1 +
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 71 +++++++++++-----------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 7 +-
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h | 2 +-
4 files changed, 40 insertions(+), 41 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 8736e6f..c990a2c 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -884,6 +884,7 @@ static inline void MUTEX_UNLOCK_WL_SCAN_SET(void)
extern dhd_pub_t *brcmf_attach(struct dhd_bus *bus,
uint bus_hdrlen);
extern int brcmf_net_attach(dhd_pub_t *dhdp, int idx);
+extern int brcmf_netdev_wait_pend8021x(struct net_device *dev);
/* Indication from bus module regarding removal/absence of dongle */
extern void brcmf_detach(dhd_pub_t *dhdp);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index a3b60da..aa31bf0 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -364,8 +364,6 @@ module_param(brcmf_pktgen_len, uint, 0);
#endif
static void dhd_dpc(unsigned long data);
-/* forward decl */
-extern int dhd_wait_pend8021x(struct net_device *dev);
#ifdef TOE
static int dhd_toe_get(dhd_info_t *dhd, int idx, u32 *toe_ol);
@@ -923,7 +921,7 @@ static int _dhd_sysioc_thread(void *data)
return 0;
}
-static int dhd_set_mac_address(struct net_device *dev, void *addr)
+static int brcmf_netdev_set_mac_address(struct net_device *dev, void *addr)
{
int ret = 0;
@@ -943,7 +941,7 @@ static int dhd_set_mac_address(struct net_device *dev, void *addr)
return ret;
}
-static void dhd_set_multicast_list(struct net_device *dev)
+static void brcmf_netdev_set_multicast_list(struct net_device *dev)
{
dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(dev);
int ifidx;
@@ -990,7 +988,7 @@ int brcmf_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf)
return ret;
}
-static int dhd_start_xmit(struct sk_buff *skb, struct net_device *net)
+static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *net)
{
int ret;
dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
@@ -1165,7 +1163,7 @@ void brcmf_txcomplete(dhd_pub_t *dhdp, struct sk_buff *txp, bool success)
}
-static struct net_device_stats *dhd_get_stats(struct net_device *net)
+static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net)
{
dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
dhd_if_t *ifp;
@@ -1404,7 +1402,7 @@ static int dhd_toe_set(dhd_info_t *dhd, int ifidx, u32 toe_ol)
}
#endif /* TOE */
-static void dhd_ethtool_get_drvinfo(struct net_device *net,
+static void brcmf_ethtool_get_drvinfo(struct net_device *net,
struct ethtool_drvinfo *info)
{
dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
@@ -1415,11 +1413,11 @@ static void dhd_ethtool_get_drvinfo(struct net_device *net,
sprintf(info->bus_info, "%s", dev_name(&wl_cfg80211_get_sdio_func()->dev));
}
-struct ethtool_ops dhd_ethtool_ops = {
- .get_drvinfo = dhd_ethtool_get_drvinfo
+struct ethtool_ops brcmf_ethtool_ops = {
+ .get_drvinfo = brcmf_ethtool_get_drvinfo
};
-static int dhd_ethtool(dhd_info_t *dhd, void *uaddr)
+static int brcmf_ethtool(dhd_info_t *dhd, void *uaddr)
{
struct ethtool_drvinfo info;
char drvname[sizeof(info.driver)];
@@ -1534,7 +1532,8 @@ static int dhd_ethtool(dhd_info_t *dhd, void *uaddr)
return 0;
}
-static int dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
+static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
+ int cmd)
{
dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
dhd_ioctl_t ioc;
@@ -1552,7 +1551,7 @@ static int dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
return -1;
if (cmd == SIOCETHTOOL)
- return dhd_ethtool(dhd, (void *)ifr->ifr_data);
+ return brcmf_ethtool(dhd, (void *)ifr->ifr_data);
if (cmd != SIOCDEVPRIVATE)
return -EOPNOTSUPP;
@@ -1629,7 +1628,7 @@ static int dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
((ioc.cmd == BRCMF_C_SET_VAR) &&
!(strncmp("bsscfg:wsec_key", ioc.buf, 15))));
if (is_set_key_cmd)
- dhd_wait_pend8021x(net);
+ brcmf_netdev_wait_pend8021x(net);
bcmerror =
brcmf_proto_ioctl(&dhd->pub, ifidx, (wl_ioctl_t *)&ioc, buf,
@@ -1649,7 +1648,7 @@ done:
return bcmerror;
}
-static int dhd_stop(struct net_device *net)
+static int brcmf_netdev_stop(struct net_device *net)
{
#if !defined(IGNORE_ETH0_DOWN)
dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
@@ -1670,7 +1669,7 @@ static int dhd_stop(struct net_device *net)
return 0;
}
-static int dhd_open(struct net_device *net)
+static int brcmf_netdev_open(struct net_device *net)
{
dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
#ifdef TOE
@@ -2059,13 +2058,13 @@ dhd_iovar(dhd_pub_t *pub, int ifidx, char *name, char *cmd_buf, uint cmd_len,
}
static struct net_device_ops dhd_ops_pri = {
- .ndo_open = dhd_open,
- .ndo_stop = dhd_stop,
- .ndo_get_stats = dhd_get_stats,
- .ndo_do_ioctl = dhd_ioctl_entry,
- .ndo_start_xmit = dhd_start_xmit,
- .ndo_set_mac_address = dhd_set_mac_address,
- .ndo_set_multicast_list = dhd_set_multicast_list
+ .ndo_open = brcmf_netdev_open,
+ .ndo_stop = brcmf_netdev_stop,
+ .ndo_get_stats = brcmf_netdev_get_stats,
+ .ndo_do_ioctl = brcmf_netdev_ioctl_entry,
+ .ndo_start_xmit = brcmf_netdev_start_xmit,
+ .ndo_set_mac_address = brcmf_netdev_set_mac_address,
+ .ndo_set_multicast_list = brcmf_netdev_set_multicast_list
};
int brcmf_net_attach(dhd_pub_t *dhdp, int ifidx)
@@ -2102,7 +2101,7 @@ int brcmf_net_attach(dhd_pub_t *dhdp, int ifidx)
}
net->hard_header_len = ETH_HLEN + dhd->pub.hdrlen;
- net->ethtool_ops = &dhd_ethtool_ops;
+ net->ethtool_ops = &brcmf_ethtool_ops;
dhd->pub.rxsz = net->mtu + net->hard_header_len + dhd->pub.hdrlen;
@@ -2172,7 +2171,7 @@ void brcmf_detach(dhd_pub_t *dhdp)
ifp = dhd->iflist[0];
ASSERT(ifp);
if (ifp->net->netdev_ops == &dhd_ops_pri) {
- dhd_stop(ifp->net);
+ brcmf_netdev_stop(ifp->net);
unregister_netdev(ifp->net);
}
@@ -2506,7 +2505,7 @@ void brcmf_wait_event_wakeup(dhd_pub_t *dhd)
return;
}
-int dhd_dev_reset(struct net_device *dev, u8 flag)
+int brcmf_netdev_reset(struct net_device *dev, u8 flag)
{
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
@@ -2524,7 +2523,7 @@ int dhd_dev_reset(struct net_device *dev, u8 flag)
return 1;
}
-int net_os_set_suspend_disable(struct net_device *dev, int val)
+int brcmf_netdev_set_suspend_disable(struct net_device *dev, int val)
{
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
int ret = 0;
@@ -2536,7 +2535,7 @@ int net_os_set_suspend_disable(struct net_device *dev, int val)
return ret;
}
-int net_os_set_suspend(struct net_device *dev, int val)
+int brcmf_netdev_set_suspend(struct net_device *dev, int val)
{
int ret = 0;
#if defined(CONFIG_HAS_EARLYSUSPEND)
@@ -2551,7 +2550,7 @@ int net_os_set_suspend(struct net_device *dev, int val)
return ret;
}
-int net_os_set_dtim_skip(struct net_device *dev, int val)
+int brcmf_netdev_set_dtim_skip(struct net_device *dev, int val)
{
dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(dev);
@@ -2561,7 +2560,7 @@ int net_os_set_dtim_skip(struct net_device *dev, int val)
return 0;
}
-int net_os_set_packet_filter(struct net_device *dev, int val)
+int brcmf_netdev_set_packet_filter(struct net_device *dev, int val)
{
dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(dev);
int ret = 0;
@@ -2582,7 +2581,7 @@ int net_os_set_packet_filter(struct net_device *dev, int val)
return ret;
}
-void dhd_dev_init_ioctl(struct net_device *dev)
+void brcmf_netdev_init_ioctl(struct net_device *dev)
{
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
@@ -2591,7 +2590,7 @@ void dhd_dev_init_ioctl(struct net_device *dev)
#ifdef PNO_SUPPORT
/* Linux wrapper to call common dhd_pno_clean */
-int dhd_dev_pno_reset(struct net_device *dev)
+int brcmf_netdev_pno_reset(struct net_device *dev)
{
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
@@ -2599,7 +2598,7 @@ int dhd_dev_pno_reset(struct net_device *dev)
}
/* Linux wrapper to call common dhd_pno_enable */
-int dhd_dev_pno_enable(struct net_device *dev, int pfn_enabled)
+int brcmf_netdev_pno_enable(struct net_device *dev, int pfn_enabled)
{
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
@@ -2608,7 +2607,7 @@ int dhd_dev_pno_enable(struct net_device *dev, int pfn_enabled)
/* Linux wrapper to call common dhd_pno_set */
int
-dhd_dev_pno_set(struct net_device *dev, wlc_ssid_t *ssids_local, int nssid,
+brcmf_netdev_pno_set(struct net_device *dev, wlc_ssid_t *ssids_local, int nssid,
unsigned char scan_fr)
{
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
@@ -2617,7 +2616,7 @@ dhd_dev_pno_set(struct net_device *dev, wlc_ssid_t *ssids_local, int nssid,
}
/* Linux wrapper to get pno status */
-int dhd_dev_get_pno_status(struct net_device *dev)
+int brcmf_netdev_get_pno_status(struct net_device *dev)
{
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
@@ -2633,7 +2632,7 @@ static int dhd_get_pend_8021x_cnt(dhd_info_t *dhd)
#define MAX_WAIT_FOR_8021X_TX 10
-int dhd_wait_pend8021x(struct net_device *dev)
+int brcmf_netdev_wait_pend8021x(struct net_device *dev)
{
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
int timeout = 10 * HZ / 1000;
@@ -2652,7 +2651,7 @@ int dhd_wait_pend8021x(struct net_device *dev)
return pend;
}
-void wl_os_wd_timer(struct net_device *ndev, uint wdtick)
+void brcmf_netdev_os_wd_timer(struct net_device *ndev, uint wdtick)
{
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(ndev);
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index dd47451..ca45829 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -342,7 +342,6 @@ do { \
} \
} while (0)
-extern int dhd_wait_pend8021x(struct net_device *dev);
#define CHAN2G(_channel, _freq, _flags) { \
.band = IEEE80211_BAND_2GHZ, \
.center_freq = (_freq), \
@@ -1677,7 +1676,7 @@ wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
}
swap_key_from_BE(&key);
- dhd_wait_pend8021x(dev);
+ brcmf_netdev_wait_pend8021x(dev);
err = wl_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
if (unlikely(err)) {
WL_ERR("WLC_SET_KEY error (%d)\n", err);
@@ -2101,7 +2100,7 @@ static s32 wl_cfg80211_resume(struct wiphy *wiphy)
if (test_bit(WL_STATUS_READY, &wl->status)) {
/* Turn on Watchdog timer */
- wl_os_wd_timer(ndev, brcmf_watchdog_ms);
+ brcmf_netdev_os_wd_timer(ndev, brcmf_watchdog_ms);
wl_invoke_iscan(wiphy_to_wl(wiphy));
}
@@ -2163,7 +2162,7 @@ static s32 wl_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow)
if (test_bit(WL_STATUS_READY, &wl->status)) {
WL_INFO("Terminate watchdog timer and enable MPC\n");
wl_set_mpc(ndev, 1);
- wl_os_wd_timer(ndev, 0);
+ brcmf_netdev_os_wd_timer(ndev, 0);
}
#if defined(CONFIG_PM_SLEEP)
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
index 77d0559..6ad6b5b 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
@@ -404,6 +404,6 @@ extern s8 *wl_cfg80211_get_fwname(void); /* get firmware name for
the dongle */
extern s8 *wl_cfg80211_get_nvramname(void); /* get nvram name for
the dongle */
-extern void wl_os_wd_timer(struct net_device *ndev, uint wdtick);
+extern void brcmf_netdev_os_wd_timer(struct net_device *ndev, uint wdtick);
#endif /* _wl_cfg80211_h_ */
--
1.7.1
From: Arend van Spriel <[email protected]>
functions in dhd_linux.c are renamed according more consistent
naming convention.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 121 ++++++++++++------------
1 files changed, 59 insertions(+), 62 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index aa31bf0..fb5bef0 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -363,17 +363,17 @@ module_param(brcmf_pktgen_len, uint, 0);
#define DHD_COMPILED
#endif
-static void dhd_dpc(unsigned long data);
+static void brcmf_dpc(unsigned long data);
#ifdef TOE
-static int dhd_toe_get(dhd_info_t *dhd, int idx, u32 *toe_ol);
-static int dhd_toe_set(dhd_info_t *dhd, int idx, u32 toe_ol);
+static int brcmf_toe_get(dhd_info_t *dhd, int idx, u32 *toe_ol);
+static int brcmf_toe_set(dhd_info_t *dhd, int idx, u32 toe_ol);
#endif /* TOE */
-static int dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
+static int brcmf_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
brcmf_event_msg_t *event_ptr, void **data_ptr);
-static void dhd_set_packet_filter(int value, dhd_pub_t *dhd)
+static void brcmf_set_packet_filter(int value, dhd_pub_t *dhd)
{
#ifdef PKT_FILTER_SUPPORT
DHD_TRACE(("%s: %d\n", __func__, value));
@@ -392,7 +392,7 @@ static void dhd_set_packet_filter(int value, dhd_pub_t *dhd)
}
#if defined(CONFIG_HAS_EARLYSUSPEND)
-static int dhd_set_suspend(int value, dhd_pub_t *dhd)
+static int brcmf_set_suspend(int value, dhd_pub_t *dhd)
{
int power_mode = PM_MAX;
/* wl_pkt_filter_enable_t enable_parm; */
@@ -418,7 +418,7 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
/* Enable packet filter, only allow unicast
packet to send up */
- dhd_set_packet_filter(1, dhd);
+ brcmf_set_packet_filter(1, dhd);
/* if dtim skip setup as default force it
* to wake each third dtim
@@ -455,7 +455,7 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
sizeof(power_mode));
/* disable pkt filter */
- dhd_set_packet_filter(0, dhd);
+ brcmf_set_packet_filter(0, dhd);
/* restore pre-suspend setting for dtim_skip */
brcmu_mkiovar("bcn_li_dtim", (char *)&dhd->dtim_skip,
@@ -476,7 +476,7 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
return 0;
}
-static void dhd_suspend_resume_helper(struct dhd_info *dhd, int val)
+static void brcmf_suspend_resume_helper(struct dhd_info *dhd, int val)
{
dhd_pub_t *dhdp = &dhd->pub;
@@ -484,11 +484,11 @@ static void dhd_suspend_resume_helper(struct dhd_info *dhd, int val)
/* Set flag when early suspend was called */
dhdp->in_suspend = val;
if (!dhdp->suspend_disable_flag)
- dhd_set_suspend(val, dhdp);
+ brcmf_set_suspend(val, dhdp);
brcmf_os_proto_unblock(dhdp);
}
-static void dhd_early_suspend(struct early_suspend *h)
+static void brcmf_early_suspend(struct early_suspend *h)
{
struct dhd_info *dhd = container_of(h, struct dhd_info, early_suspend);
@@ -499,7 +499,7 @@ static void dhd_early_suspend(struct early_suspend *h)
}
-static void dhd_late_resume(struct early_suspend *h)
+static void brcmf_late_resume(struct early_suspend *h)
{
struct dhd_info *dhd = container_of(h, struct dhd_info, early_suspend);
@@ -568,7 +568,7 @@ int brcmf_timeout_expired(dhd_timeout_t *tmo)
return 0;
}
-static int dhd_net2idx(dhd_info_t *dhd, struct net_device *net)
+static int brcmf_net2idx(dhd_info_t *dhd, struct net_device *net)
{
int i = 0;
@@ -623,7 +623,7 @@ char *brcmf_ifname(dhd_pub_t *dhdp, int ifidx)
return "<if_none>";
}
-static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
+static void _brcmf_set_multicast_list(dhd_info_t *dhd, int ifidx)
{
struct net_device *dev;
struct netdev_hw_addr *ha;
@@ -739,8 +739,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
}
}
-static int
-_dhd_set_mac_address(dhd_info_t *dhd, int ifidx, u8 *addr)
+static int _brcmf_set_mac_address(dhd_info_t *dhd, int ifidx, u8 *addr)
{
char buf[32];
wl_ioctl_t ioc;
@@ -774,7 +773,7 @@ _dhd_set_mac_address(dhd_info_t *dhd, int ifidx, u8 *addr)
extern struct net_device *ap_net_dev;
#endif
-static void dhd_op_if(dhd_if_t *ifp)
+static void brcmf_op_if(dhd_if_t *ifp)
{
dhd_info_t *dhd;
int ret = 0, err = 0;
@@ -864,7 +863,7 @@ static void dhd_op_if(dhd_if_t *ifp)
}
}
-static int _dhd_sysioc_thread(void *data)
+static int _brcmf_sysioc_thread(void *data)
{
dhd_info_t *dhd = (dhd_info_t *) data;
int i;
@@ -883,7 +882,7 @@ static int _dhd_sysioc_thread(void *data)
in_ap = (ap_net_dev != NULL);
#endif /* SOFTAP */
if (dhd->iflist[i]->state)
- dhd_op_if(dhd->iflist[i]);
+ brcmf_op_if(dhd->iflist[i]);
#ifdef SOFTAP
if (dhd->iflist[i] == NULL) {
DHD_TRACE(("\n\n %s: interface %d "
@@ -908,11 +907,11 @@ static int _dhd_sysioc_thread(void *data)
#endif /* SOFTAP */
if (dhd->set_multicast) {
dhd->set_multicast = false;
- _dhd_set_multicast_list(dhd, i);
+ _brcmf_set_multicast_list(dhd, i);
}
if (dhd->set_macaddress) {
dhd->set_macaddress = false;
- _dhd_set_mac_address(dhd, i,
+ _brcmf_set_mac_address(dhd, i,
dhd->macvalue);
}
}
@@ -929,7 +928,7 @@ static int brcmf_netdev_set_mac_address(struct net_device *dev, void *addr)
struct sockaddr *sa = (struct sockaddr *)addr;
int ifidx;
- ifidx = dhd_net2idx(dhd, dev);
+ ifidx = brcmf_net2idx(dhd, dev);
if (ifidx == DHD_BAD_IF)
return -1;
@@ -946,7 +945,7 @@ static void brcmf_netdev_set_multicast_list(struct net_device *dev)
dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(dev);
int ifidx;
- ifidx = dhd_net2idx(dhd, dev);
+ ifidx = brcmf_net2idx(dhd, dev);
if (ifidx == DHD_BAD_IF)
return;
@@ -1004,7 +1003,7 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *net)
return -ENODEV;
}
- ifidx = dhd_net2idx(dhd, net);
+ ifidx = brcmf_net2idx(dhd, net);
if (ifidx == DHD_BAD_IF) {
DHD_ERROR(("%s: bad ifidx %d\n", __func__, ifidx));
netif_stop_queue(net);
@@ -1112,7 +1111,7 @@ void brcmf_rx_frame(dhd_pub_t *dhdp, int ifidx, struct sk_buff *skb,
/* Process special event packets and then discard them */
if (ntohs(skb->protocol) == ETH_P_BRCM)
- dhd_wl_host_event(dhd, &ifidx,
+ brcmf_host_event(dhd, &ifidx,
skb_mac_header(skb),
&event, &data);
@@ -1171,7 +1170,7 @@ static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net)
DHD_TRACE(("%s: Enter\n", __func__));
- ifidx = dhd_net2idx(dhd, net);
+ ifidx = brcmf_net2idx(dhd, net);
if (ifidx == DHD_BAD_IF)
return NULL;
@@ -1197,7 +1196,7 @@ static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net)
return &ifp->stats;
}
-static int dhd_watchdog_thread(void *data)
+static int brcmf_watchdog_thread(void *data)
{
dhd_info_t *dhd = (dhd_info_t *) data;
@@ -1231,7 +1230,7 @@ static int dhd_watchdog_thread(void *data)
return 0;
}
-static void dhd_watchdog(unsigned long data)
+static void brcmf_watchdog(unsigned long data)
{
dhd_info_t *dhd = (dhd_info_t *) data;
@@ -1257,7 +1256,7 @@ static void dhd_watchdog(unsigned long data)
mod_timer(&dhd->timer, jiffies + brcmf_watchdog_ms * HZ / 1000);
}
-static int dhd_dpc_thread(void *data)
+static int brcmf_dpc_thread(void *data)
{
dhd_info_t *dhd = (dhd_info_t *) data;
@@ -1295,7 +1294,7 @@ static int dhd_dpc_thread(void *data)
return 0;
}
-static void dhd_dpc(unsigned long data)
+static void brcmf_dpc(unsigned long data)
{
dhd_info_t *dhd;
@@ -1325,7 +1324,7 @@ void brcmf_sched_dpc(dhd_pub_t *dhdp)
#ifdef TOE
/* Retrieve current toe component enables, which are kept
as a bitmap in toe_ol iovar */
-static int dhd_toe_get(dhd_info_t *dhd, int ifidx, u32 *toe_ol)
+static int brcmf_toe_get(dhd_info_t *dhd, int ifidx, u32 *toe_ol)
{
wl_ioctl_t ioc;
char buf[32];
@@ -1359,7 +1358,7 @@ static int dhd_toe_get(dhd_info_t *dhd, int ifidx, u32 *toe_ol)
/* Set current toe component enables in toe_ol iovar,
and set toe global enable iovar */
-static int dhd_toe_set(dhd_info_t *dhd, int ifidx, u32 toe_ol)
+static int brcmf_toe_set(dhd_info_t *dhd, int ifidx, u32 toe_ol)
{
wl_ioctl_t ioc;
char buf[32];
@@ -1475,7 +1474,7 @@ static int brcmf_ethtool(dhd_info_t *dhd, void *uaddr)
/* Get toe offload components from dongle */
case ETHTOOL_GRXCSUM:
case ETHTOOL_GTXCSUM:
- ret = dhd_toe_get(dhd, 0, &toe_cmpnt);
+ ret = brcmf_toe_get(dhd, 0, &toe_cmpnt);
if (ret < 0)
return ret;
@@ -1496,7 +1495,7 @@ static int brcmf_ethtool(dhd_info_t *dhd, void *uaddr)
return -EFAULT;
/* Read the current settings, update and write back */
- ret = dhd_toe_get(dhd, 0, &toe_cmpnt);
+ ret = brcmf_toe_get(dhd, 0, &toe_cmpnt);
if (ret < 0)
return ret;
@@ -1508,7 +1507,7 @@ static int brcmf_ethtool(dhd_info_t *dhd, void *uaddr)
else
toe_cmpnt &= ~csum_dir;
- ret = dhd_toe_set(dhd, 0, toe_cmpnt);
+ ret = brcmf_toe_set(dhd, 0, toe_cmpnt);
if (ret < 0)
return ret;
@@ -1544,7 +1543,7 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
int ifidx;
bool is_set_key_cmd;
- ifidx = dhd_net2idx(dhd, net);
+ ifidx = brcmf_net2idx(dhd, net);
DHD_TRACE(("%s: ifidx %d, cmd 0x%04x\n", __func__, ifidx, cmd));
if (ifidx == DHD_BAD_IF)
@@ -1675,7 +1674,7 @@ static int brcmf_netdev_open(struct net_device *net)
#ifdef TOE
u32 toe_ol;
#endif
- int ifidx = dhd_net2idx(dhd, net);
+ int ifidx = brcmf_net2idx(dhd, net);
s32 ret = 0;
DHD_TRACE(("%s: ifidx %d\n", __func__, ifidx));
@@ -1694,7 +1693,7 @@ static int brcmf_netdev_open(struct net_device *net)
#ifdef TOE
/* Get current TOE mode from dongle */
- if (dhd_toe_get(dhd, ifidx, &toe_ol) >= 0
+ if (brcmf_toe_get(dhd, ifidx, &toe_ol) >= 0
&& (toe_ol & TOE_TX_CSUM_OL) != 0)
dhd->iflist[ifidx]->net->features |= NETIF_F_IP_CSUM;
else
@@ -1852,7 +1851,7 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
/* Set up the watchdog timer */
init_timer(&dhd->timer);
dhd->timer.data = (unsigned long) dhd;
- dhd->timer.function = dhd_watchdog;
+ dhd->timer.function = brcmf_watchdog;
/* Initialize thread based operation and lock */
sema_init(&dhd->sdsem, 1);
@@ -1864,7 +1863,7 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
if (dhd_dpc_prio >= 0) {
/* Initialize watchdog thread */
sema_init(&dhd->watchdog_sem, 0);
- dhd->watchdog_tsk = kthread_run(dhd_watchdog_thread, dhd,
+ dhd->watchdog_tsk = kthread_run(brcmf_watchdog_thread, dhd,
"dhd_watchdog");
if (IS_ERR(dhd->watchdog_tsk)) {
printk(KERN_WARNING
@@ -1879,20 +1878,20 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
if (dhd_dpc_prio >= 0) {
/* Initialize DPC thread */
sema_init(&dhd->dpc_sem, 0);
- dhd->dpc_tsk = kthread_run(dhd_dpc_thread, dhd, "dhd_dpc");
+ dhd->dpc_tsk = kthread_run(brcmf_dpc_thread, dhd, "dhd_dpc");
if (IS_ERR(dhd->dpc_tsk)) {
printk(KERN_WARNING
"dhd_dpc thread failed to start\n");
dhd->dpc_tsk = NULL;
}
} else {
- tasklet_init(&dhd->tasklet, dhd_dpc, (unsigned long) dhd);
+ tasklet_init(&dhd->tasklet, brcmf_dpc, (unsigned long) dhd);
dhd->dpc_tsk = NULL;
}
if (dhd_sysioc) {
sema_init(&dhd->sysioc_sem, 0);
- dhd->sysioc_tsk = kthread_run(_dhd_sysioc_thread, dhd,
+ dhd->sysioc_tsk = kthread_run(_brcmf_sysioc_thread, dhd,
"_dhd_sysioc");
if (IS_ERR(dhd->sysioc_tsk)) {
printk(KERN_WARNING
@@ -1917,8 +1916,8 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
/* Init lock suspend to prevent kernel going to suspend */
#ifdef CONFIG_HAS_EARLYSUSPEND
dhd->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 20;
- dhd->early_suspend.suspend = dhd_early_suspend;
- dhd->early_suspend.resume = dhd_late_resume;
+ dhd->early_suspend.suspend = brcmf_early_suspend;
+ dhd->early_suspend.resume = brcmf_late_resume;
register_early_suspend(&dhd->early_suspend);
#endif
@@ -2032,9 +2031,8 @@ int brcmf_bus_start(dhd_pub_t *dhdp)
return 0;
}
-int
-dhd_iovar(dhd_pub_t *pub, int ifidx, char *name, char *cmd_buf, uint cmd_len,
- int set)
+int brcmf_iovar(dhd_pub_t *pub, int ifidx, char *name, char *cmd_buf,
+ uint cmd_len, int set)
{
char buf[strlen(name) + 1 + cmd_len];
int len = sizeof(buf);
@@ -2122,7 +2120,7 @@ fail:
return -EBADE;
}
-void dhd_bus_detach(dhd_pub_t *dhdp)
+static void brcmf_bus_detach(dhd_pub_t *dhdp)
{
dhd_info_t *dhd;
@@ -2194,7 +2192,7 @@ void brcmf_detach(dhd_pub_t *dhdp)
dhd->sysioc_tsk = NULL;
}
- dhd_bus_detach(dhdp);
+ brcmf_bus_detach(dhdp);
if (dhdp->prot)
brcmf_proto_detach(dhdp);
@@ -2209,7 +2207,7 @@ void brcmf_detach(dhd_pub_t *dhdp)
}
}
-static void __exit dhd_module_cleanup(void)
+static void __exit brcmf_module_cleanup(void)
{
DHD_TRACE(("%s: Enter\n", __func__));
@@ -2221,7 +2219,7 @@ static void __exit dhd_module_cleanup(void)
brcmf_customer_gpio_wlan_ctrl(WLAN_POWER_OFF);
}
-static int __init dhd_module_init(void)
+static int __init brcmf_module_init(void)
{
int error;
@@ -2278,8 +2276,8 @@ failed:
return -EINVAL;
}
-module_init(dhd_module_init);
-module_exit(dhd_module_cleanup);
+module_init(brcmf_module_init);
+module_exit(brcmf_module_cleanup);
/*
* OS specific functions required to implement DHD driver in OS independent way
@@ -2467,9 +2465,8 @@ void brcmf_os_sdunlock(dhd_pub_t *pub)
spin_unlock_bh(&dhd->sdlock);
}
-static int
-dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
- brcmf_event_msg_t *event, void **data)
+static int brcmf_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
+ brcmf_event_msg_t *event, void **data)
{
int bcmerror = 0;
@@ -2543,7 +2540,7 @@ int brcmf_netdev_set_suspend(struct net_device *dev, int val)
if (dhd) {
brcmf_os_proto_block(&dhd->pub);
- ret = dhd_set_suspend(val, &dhd->pub);
+ ret = brcmf_set_suspend(val, &dhd->pub);
brcmf_os_proto_unblock(&dhd->pub);
}
#endif /* defined(CONFIG_HAS_EARLYSUSPEND) */
@@ -2574,7 +2571,7 @@ int brcmf_netdev_set_packet_filter(struct net_device *dev, int val)
brcmf_os_proto_block(&dhd->pub);
if (dhd->pub.in_suspend) {
if (!val || (val && !dhd->pub.suspend_disable_flag))
- dhd_set_packet_filter(val, &dhd->pub);
+ brcmf_set_packet_filter(val, &dhd->pub);
}
brcmf_os_proto_unblock(&dhd->pub);
}
@@ -2625,7 +2622,7 @@ int brcmf_netdev_get_pno_status(struct net_device *dev)
#endif /* PNO_SUPPORT */
-static int dhd_get_pend_8021x_cnt(dhd_info_t *dhd)
+static int brcmf_get_pend_8021x_cnt(dhd_info_t *dhd)
{
return atomic_read(&dhd->pend_8021x_cnt);
}
@@ -2637,7 +2634,7 @@ int brcmf_netdev_wait_pend8021x(struct net_device *dev)
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
int timeout = 10 * HZ / 1000;
int ntimes = MAX_WAIT_FOR_8021X_TX;
- int pend = dhd_get_pend_8021x_cnt(dhd);
+ int pend = brcmf_get_pend_8021x_cnt(dhd);
while (ntimes && pend) {
if (pend) {
@@ -2646,7 +2643,7 @@ int brcmf_netdev_wait_pend8021x(struct net_device *dev)
set_current_state(TASK_RUNNING);
ntimes--;
}
- pend = dhd_get_pend_8021x_cnt(dhd);
+ pend = brcmf_get_pend_8021x_cnt(dhd);
}
return pend;
}
--
1.7.1
From: Arend van Spriel <[email protected]>
The data structures in fullmac driver references are made easier by
using provided macros in wl_cfg80211.h. The abbreviation 'wl' in these
macros has been replaced by cfg or the macro has been removed if used
only once.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 134 +++++++++++-----------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h | 23 ++---
2 files changed, 76 insertions(+), 81 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index 5c858c5..d109de1 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -323,12 +323,12 @@ static void brcmf_debugfs_remove_netdev(struct brcmf_cfg80211_priv *cfg_priv);
WL_ERR("wl_cfg80211_dev is unavailable\n"); \
BUG(); \
} \
- ci_to_wl(ci); \
+ ci->cfg_priv; \
})
#define CHECK_SYS_UP() \
do { \
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy); \
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy); \
if (unlikely(!test_bit(WL_STATUS_READY, &cfg_priv->status))) { \
WL_INFO("device is not ready : status (%d)\n", \
(int)cfg_priv->status); \
@@ -561,7 +561,7 @@ brcmf_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
enum nl80211_iftype type, u32 *flags,
struct vif_params *params)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
struct wireless_dev *wdev;
s32 infra = 0;
s32 err = 0;
@@ -690,8 +690,8 @@ brcmf_run_iscan(struct brcmf_cfg80211_iscan_ctrl *iscan,
static s32 brcmf_do_iscan(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct brcmf_cfg80211_iscan_ctrl *iscan = wl_to_iscan(cfg_priv);
- struct net_device *ndev = wl_to_ndev(cfg_priv);
+ struct brcmf_cfg80211_iscan_ctrl *iscan = cfg_to_iscan(cfg_priv);
+ struct net_device *ndev = cfg_to_ndev(cfg_priv);
struct brcmf_ssid ssid;
s32 passive_scan;
s32 err = 0;
@@ -702,7 +702,7 @@ static s32 brcmf_do_iscan(struct brcmf_cfg80211_priv *cfg_priv)
iscan->state = WL_ISCAN_STATE_SCANING;
passive_scan = cfg_priv->active_scan ? 0 : 1;
- err = brcmf_dev_ioctl(wl_to_ndev(cfg_priv), BRCMF_C_SET_PASSIVE_SCAN,
+ err = brcmf_dev_ioctl(cfg_to_ndev(cfg_priv), BRCMF_C_SET_PASSIVE_SCAN,
&passive_scan, sizeof(passive_scan));
if (unlikely(err)) {
WL_ERR("error (%d)\n", err);
@@ -722,9 +722,9 @@ __brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
struct cfg80211_scan_request *request,
struct cfg80211_ssid *this_ssid)
{
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(ndev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(ndev);
struct cfg80211_ssid *ssids;
- struct brcmf_cfg80211_scan_req *sr = wl_to_sr(cfg_priv);
+ struct brcmf_cfg80211_scan_req *sr = cfg_priv->scan_req_int;
s32 passive_scan;
bool iscan_req;
bool spec_scan;
@@ -908,8 +908,8 @@ static s32 brcmf_set_retry(struct net_device *dev, u32 retry, bool l)
static s32 brcmf_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
- struct net_device *ndev = wl_to_ndev(cfg_priv);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
+ struct net_device *ndev = cfg_to_ndev(cfg_priv);
s32 err = 0;
WL_TRACE("Enter\n");
@@ -953,7 +953,7 @@ static s32
brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_ibss_params *params)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
struct brcmf_join_params join_params;
size_t join_params_size = 0;
s32 err = 0;
@@ -1096,7 +1096,7 @@ done:
static s32 brcmf_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
s32 err = 0;
WL_TRACE("Enter\n");
@@ -1112,7 +1112,7 @@ static s32 brcmf_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev
static s32
brcmf_set_wpa_version(struct net_device *dev, struct cfg80211_connect_params *sme)
{
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(dev);
struct brcmf_cfg80211_security *sec;
s32 val = 0;
s32 err = 0;
@@ -1137,7 +1137,7 @@ brcmf_set_wpa_version(struct net_device *dev, struct cfg80211_connect_params *sm
static s32
brcmf_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme)
{
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(dev);
struct brcmf_cfg80211_security *sec;
s32 val = 0;
s32 err = 0;
@@ -1176,7 +1176,7 @@ brcmf_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme)
static s32
brcmf_set_set_cipher(struct net_device *dev, struct cfg80211_connect_params *sme)
{
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(dev);
struct brcmf_cfg80211_security *sec;
s32 pval = 0;
s32 gval = 0;
@@ -1242,7 +1242,7 @@ brcmf_set_set_cipher(struct net_device *dev, struct cfg80211_connect_params *sme
static s32
brcmf_set_key_mgmt(struct net_device *dev, struct cfg80211_connect_params *sme)
{
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(dev);
struct brcmf_cfg80211_security *sec;
s32 val = 0;
s32 err = 0;
@@ -1298,7 +1298,7 @@ static s32
brcmf_set_set_sharedkey(struct net_device *dev,
struct cfg80211_connect_params *sme)
{
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(dev);
struct brcmf_cfg80211_security *sec;
struct brcmf_wsec_key key;
s32 val;
@@ -1364,7 +1364,7 @@ static s32
brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_connect_params *sme)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
struct ieee80211_channel *chan = sme->channel;
struct brcmf_join_params join_params;
size_t join_params_size;
@@ -1462,7 +1462,7 @@ static s32
brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
u16 reason_code)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
struct brcmf_scb_val scbval;
s32 err = 0;
@@ -1490,8 +1490,8 @@ brcmf_cfg80211_set_tx_power(struct wiphy *wiphy,
enum nl80211_tx_power_setting type, s32 dbm)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
- struct net_device *ndev = wl_to_ndev(cfg_priv);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
+ struct net_device *ndev = cfg_to_ndev(cfg_priv);
u16 txpwrmw;
s32 err = 0;
s32 disable = 0;
@@ -1541,8 +1541,8 @@ done:
static s32 brcmf_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
- struct net_device *ndev = wl_to_ndev(cfg_priv);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
+ struct net_device *ndev = cfg_to_ndev(cfg_priv);
s32 txpwrdbm;
u8 result;
s32 err = 0;
@@ -1850,7 +1850,7 @@ brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
{
struct key_params params;
struct brcmf_wsec_key key;
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
struct brcmf_cfg80211_security *sec;
s32 wsec;
s32 err = 0;
@@ -1919,7 +1919,7 @@ static s32
brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
u8 *mac, struct station_info *sinfo)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
struct brcmf_scb_val scb_val;
int rssi;
s32 rate;
@@ -2082,7 +2082,7 @@ done:
static s32 brcmf_cfg80211_resume(struct wiphy *wiphy)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
/*
* Check for WL_STATUS_READY before any function call which
@@ -2096,7 +2096,7 @@ static s32 brcmf_cfg80211_resume(struct wiphy *wiphy)
#endif /* defined(CONFIG_PM_SLEEP) */
if (test_bit(WL_STATUS_READY, &cfg_priv->status))
- brcmf_invoke_iscan(wiphy_to_wl(wiphy));
+ brcmf_invoke_iscan(wiphy_to_cfg(wiphy));
WL_TRACE("Exit\n");
return 0;
@@ -2105,8 +2105,8 @@ static s32 brcmf_cfg80211_resume(struct wiphy *wiphy)
static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy,
struct cfg80211_wowlan *wow)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
- struct net_device *ndev = wl_to_ndev(cfg_priv);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
+ struct net_device *ndev = cfg_to_ndev(cfg_priv);
WL_TRACE("Enter\n");
@@ -2190,7 +2190,7 @@ static s32
brcmf_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_pmksa *pmksa)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
struct _pmkid_list *pmkids = &cfg_priv->pmk_list->pmkids;
s32 err = 0;
int i;
@@ -2224,7 +2224,7 @@ static s32
brcmf_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_pmksa *pmksa)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
struct _pmkid_list pmkid;
s32 err = 0;
int i;
@@ -2271,7 +2271,7 @@ brcmf_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
static s32
brcmf_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *dev)
{
- struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_cfg(wiphy);
s32 err = 0;
WL_TRACE("Enter\n");
@@ -2387,7 +2387,7 @@ wiphy_new_out:
static void brcmf_free_wdev(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct wireless_dev *wdev = wl_to_wdev(cfg_priv);
+ struct wireless_dev *wdev = cfg_to_wdev(cfg_priv);
if (unlikely(!wdev)) {
WL_ERR("wdev is invalid\n");
@@ -2396,7 +2396,7 @@ static void brcmf_free_wdev(struct brcmf_cfg80211_priv *cfg_priv)
wiphy_unregister(wdev->wiphy);
wiphy_free(wdev->wiphy);
kfree(wdev);
- wl_to_wdev(cfg_priv) = NULL;
+ cfg_to_wdev(cfg_priv) = NULL;
}
static s32 brcmf_inform_bss(struct brcmf_cfg80211_priv *cfg_priv)
@@ -2426,7 +2426,7 @@ static s32 brcmf_inform_bss(struct brcmf_cfg80211_priv *cfg_priv)
static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_priv *cfg_priv,
struct brcmf_bss_info *bi)
{
- struct wiphy *wiphy = wl_to_wiphy(cfg_priv);
+ struct wiphy *wiphy = cfg_to_wiphy(cfg_priv);
struct ieee80211_channel *notify_channel;
struct cfg80211_bss *bss;
struct ieee80211_supported_band *band;
@@ -2487,7 +2487,7 @@ static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_priv *cfg_priv,
static s32 wl_inform_ibss(struct brcmf_cfg80211_priv *cfg_priv,
struct net_device *dev, const u8 *bssid)
{
- struct wiphy *wiphy = wl_to_wiphy(cfg_priv);
+ struct wiphy *wiphy = cfg_to_wiphy(cfg_priv);
struct ieee80211_channel *notify_channel;
struct brcmf_bss_info *bi = NULL;
struct ieee80211_supported_band *band;
@@ -2674,7 +2674,7 @@ brcmf_notify_roaming_status(struct brcmf_cfg80211_priv *cfg_priv,
static __used s32
brcmf_dev_bufvar_set(struct net_device *dev, s8 *name, s8 *buf, s32 len)
{
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(dev);
u32 buflen;
buflen = brcmu_mkiovar(name, buf, len, cfg_priv->ioctl_buf,
@@ -2689,7 +2689,7 @@ static s32
brcmf_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
s32 buf_len)
{
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(dev);
u32 len;
s32 err = 0;
@@ -2709,9 +2709,9 @@ brcmf_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct net_device *ndev = wl_to_ndev(cfg_priv);
+ struct net_device *ndev = cfg_to_ndev(cfg_priv);
struct brcmf_cfg80211_assoc_ielen *assoc_info;
- struct brcmf_cfg80211_connect_info *conn_info = wl_to_conn(cfg_priv);
+ struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg_priv);
u32 req_len;
u32 resp_len;
s32 err = 0;
@@ -2767,7 +2767,7 @@ static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_priv *cfg_priv)
static void brcmf_clear_assoc_ies(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct brcmf_cfg80211_connect_info *conn_info = wl_to_conn(cfg_priv);
+ struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg_priv);
kfree(conn_info->req_ie);
conn_info->req_ie = NULL;
@@ -2830,7 +2830,7 @@ static s32 brcmf_update_bss_info(struct brcmf_cfg80211_priv *cfg_priv)
ssid = (struct brcmf_ssid *)brcmf_read_prof(cfg_priv, WL_PROF_SSID);
*(u32 *)cfg_priv->extra_buf = cpu_to_le32(WL_EXTRA_BUF_MAX);
- err = brcmf_dev_ioctl(wl_to_ndev(cfg_priv), BRCMF_C_GET_BSS_INFO,
+ err = brcmf_dev_ioctl(cfg_to_ndev(cfg_priv), BRCMF_C_GET_BSS_INFO,
cfg_priv->extra_buf, WL_EXTRA_BUF_MAX);
if (unlikely(err)) {
WL_ERR("Could not get bss info %d\n", err);
@@ -2856,7 +2856,7 @@ static s32 brcmf_update_bss_info(struct brcmf_cfg80211_priv *cfg_priv)
* so we speficially query dtim information to dongle.
*/
u32 var;
- err = brcmf_dev_intvar_get(wl_to_ndev(cfg_priv),
+ err = brcmf_dev_intvar_get(cfg_to_ndev(cfg_priv),
"dtim_assoc", &var);
if (unlikely(err)) {
WL_ERR("wl dtim_assoc failed (%d)\n", err);
@@ -2878,7 +2878,7 @@ brcmf_bss_roaming_done(struct brcmf_cfg80211_priv *cfg_priv,
struct net_device *ndev,
const struct brcmf_event_msg *e, void *data)
{
- struct brcmf_cfg80211_connect_info *conn_info = wl_to_conn(cfg_priv);
+ struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg_priv);
s32 err = 0;
WL_TRACE("Enter\n");
@@ -2903,7 +2903,7 @@ brcmf_bss_connect_done(struct brcmf_cfg80211_priv *cfg_priv,
struct net_device *ndev, const struct brcmf_event_msg *e,
void *data, bool completed)
{
- struct brcmf_cfg80211_connect_info *conn_info = wl_to_conn(cfg_priv);
+ struct brcmf_cfg80211_connect_info *conn_info = cfg_to_conn(cfg_priv);
s32 err = 0;
WL_TRACE("Enter\n");
@@ -2970,7 +2970,7 @@ brcmf_notify_scan_status(struct brcmf_cfg80211_priv *cfg_priv,
if (cfg_priv->iscan_on && cfg_priv->iscan_kickstart) {
WL_TRACE("Exit\n");
- return brcmf_wakeup_iscan(wl_to_iscan(cfg_priv));
+ return brcmf_wakeup_iscan(cfg_to_iscan(cfg_priv));
}
if (unlikely(!test_and_clear_bit(WL_STATUS_SCANNING,
@@ -3157,7 +3157,7 @@ static void brcmf_destroy_event_handler(struct brcmf_cfg80211_priv *cfg_priv)
static void brcmf_term_iscan(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct brcmf_cfg80211_iscan_ctrl *iscan = wl_to_iscan(cfg_priv);
+ struct brcmf_cfg80211_iscan_ctrl *iscan = cfg_to_iscan(cfg_priv);
if (cfg_priv->iscan_on && iscan->tsk) {
iscan->state = WL_ISCAN_STATE_IDLE;
@@ -3170,8 +3170,8 @@ static void brcmf_term_iscan(struct brcmf_cfg80211_priv *cfg_priv)
static void brcmf_notify_iscan_complete(struct brcmf_cfg80211_iscan_ctrl *iscan,
bool aborted)
{
- struct brcmf_cfg80211_priv *cfg_priv = iscan_to_wl(iscan);
- struct net_device *ndev = wl_to_ndev(cfg_priv);
+ struct brcmf_cfg80211_priv *cfg_priv = iscan_to_cfg(iscan);
+ struct net_device *ndev = cfg_to_ndev(cfg_priv);
if (unlikely(!test_and_clear_bit(WL_STATUS_SCANNING,
&cfg_priv->status))) {
@@ -3295,7 +3295,7 @@ static s32 brcmf_iscan_thread(void *data)
struct sched_param param = {.sched_priority = MAX_RT_PRIO - 1 };
struct brcmf_cfg80211_iscan_ctrl *iscan =
(struct brcmf_cfg80211_iscan_ctrl *)data;
- struct brcmf_cfg80211_priv *cfg_priv = iscan_to_wl(iscan);
+ struct brcmf_cfg80211_priv *cfg_priv = iscan_to_cfg(iscan);
struct brcmf_cfg80211_iscan_eloop *el = &iscan->el;
u32 status;
int err = 0;
@@ -3343,7 +3343,7 @@ static void brcmf_iscan_timer(unsigned long data)
static s32 brcmf_invoke_iscan(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct brcmf_cfg80211_iscan_ctrl *iscan = wl_to_iscan(cfg_priv);
+ struct brcmf_cfg80211_iscan_ctrl *iscan = cfg_to_iscan(cfg_priv);
int err = 0;
if (cfg_priv->iscan_on && !iscan->tsk) {
@@ -3372,11 +3372,11 @@ static void brcmf_init_iscan_eloop(struct brcmf_cfg80211_iscan_eloop *el)
static s32 brcmf_init_iscan(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct brcmf_cfg80211_iscan_ctrl *iscan = wl_to_iscan(cfg_priv);
+ struct brcmf_cfg80211_iscan_ctrl *iscan = cfg_to_iscan(cfg_priv);
int err = 0;
if (cfg_priv->iscan_on) {
- iscan->dev = wl_to_ndev(cfg_priv);
+ iscan->dev = cfg_to_ndev(cfg_priv);
iscan->state = WL_ISCAN_STATE_IDLE;
brcmf_init_iscan_eloop(&iscan->el);
iscan->timer_ms = WL_ISCAN_TIMER_INTERVAL_MS;
@@ -3398,7 +3398,7 @@ static s32 brcmf_init_iscan(struct brcmf_cfg80211_priv *cfg_priv)
static s32 wl_init_priv(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct wiphy *wiphy = wl_to_wiphy(cfg_priv);
+ struct wiphy *wiphy = cfg_to_wiphy(cfg_priv);
s32 err = 0;
cfg_priv->scan_request = NULL;
@@ -3463,10 +3463,10 @@ s32 wl_cfg80211_attach(struct net_device *ndev, void *data)
return -ENOMEM;
wdev->iftype = brcmf_mode_to_nl80211_iftype(WL_MODE_BSS);
- cfg_priv = wdev_to_wl(wdev);
+ cfg_priv = wdev_to_cfg(wdev);
cfg_priv->wdev = wdev;
cfg_priv->pub = data;
- ci = (struct brcmf_cfg80211_iface *)wl_to_ci(cfg_priv);
+ ci = (struct brcmf_cfg80211_iface *)&cfg_priv->ci;
ci->cfg_priv = cfg_priv;
ndev->ieee80211_ptr = wdev;
SET_NETDEV_DEV(ndev, wiphy_dev(wdev->wiphy));
@@ -3524,7 +3524,7 @@ static s32 brcmf_event_handler(void *data)
WL_INFO("event type (%d)\n", e->etype);
if (cfg_priv->el.handler[e->etype]) {
cfg_priv->el.handler[e->etype](cfg_priv,
- wl_to_ndev(cfg_priv),
+ cfg_to_ndev(cfg_priv),
&e->emsg, e->edata);
} else {
WL_INFO("Unknown Event (%d): ignoring\n", e->etype);
@@ -3540,7 +3540,7 @@ wl_cfg80211_event(struct net_device *ndev,
const struct brcmf_event_msg *e, void *data)
{
u32 event_type = be32_to_cpu(e->event_type);
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(ndev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(ndev);
if (likely(!brcmf_enq_event(cfg_priv, event_type, e, data)))
brcmf_wakeup_event(cfg_priv);
@@ -3825,7 +3825,7 @@ s32 brcmf_config_dongle(struct brcmf_cfg80211_priv *cfg_priv, bool need_lock)
if (cfg_priv->dongle_up)
return err;
- ndev = wl_to_ndev(cfg_priv);
+ ndev = cfg_to_ndev(cfg_priv);
wdev = ndev->ieee80211_ptr;
if (need_lock)
rtnl_lock();
@@ -3866,7 +3866,7 @@ static s32 wl_update_wiphybands(struct brcmf_cfg80211_priv *cfg_priv)
s8 phy;
s32 err = 0;
- err = brcmf_dev_ioctl(wl_to_ndev(cfg_priv), WLC_GET_PHYLIST, &phy_list,
+ err = brcmf_dev_ioctl(cfg_to_ndev(cfg_priv), WLC_GET_PHYLIST, &phy_list,
sizeof(phy_list));
if (unlikely(err)) {
WL_ERR("error (%d)\n", err);
@@ -3876,7 +3876,7 @@ static s32 wl_update_wiphybands(struct brcmf_cfg80211_priv *cfg_priv)
phy = ((char *)&phy_list)[1];
WL_INFO("%c phy\n", phy);
if (phy == 'n' || phy == 'a') {
- wiphy = wl_to_wiphy(cfg_priv);
+ wiphy = cfg_to_wiphy(cfg_priv);
wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_n;
}
@@ -3926,7 +3926,7 @@ static s32 __brcmf_cfg80211_down(struct brcmf_cfg80211_priv *cfg_priv)
if (cfg_priv->scan_request) {
cfg80211_scan_done(cfg_priv->scan_request, true);
/* May need to perform this to cover rmmod */
- /* wl_set_mpc(wl_to_ndev(wl), 1); */
+ /* wl_set_mpc(cfg_to_ndev(wl), 1); */
cfg_priv->scan_request = NULL;
}
clear_bit(WL_STATUS_READY, &cfg_priv->status);
@@ -4032,7 +4032,7 @@ static bool brcmf_is_ibssmode(struct brcmf_cfg80211_priv *cfg_priv)
static __used s32 brcmf_add_ie(struct brcmf_cfg80211_priv *cfg_priv,
u8 t, u8 l, u8 *v)
{
- struct brcmf_cfg80211_ie *ie = wl_to_ie(cfg_priv);
+ struct brcmf_cfg80211_ie *ie = &cfg_priv->ie;
s32 err = 0;
if (unlikely(ie->offset + l + 2 > WL_TLV_INFO_MAX)) {
@@ -4055,7 +4055,7 @@ static void brcmf_link_down(struct brcmf_cfg80211_priv *cfg_priv)
WL_TRACE("Enter\n");
if (cfg_priv->link_up) {
- dev = wl_to_ndev(cfg_priv);
+ dev = cfg_to_ndev(cfg_priv);
WL_INFO("Call WLC_DISASSOC to stop excess roaming\n ");
err = brcmf_dev_ioctl(dev, BRCMF_C_DISASSOC, NULL, 0);
if (unlikely(err))
@@ -4107,7 +4107,7 @@ static void *brcmf_get_drvdata(struct brcmf_cfg80211_dev *dev)
static void brcmf_set_mpc(struct net_device *ndev, int mpc)
{
s32 err = 0;
- struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(ndev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_cfg(ndev);
if (test_bit(WL_STATUS_READY, &cfg_priv->status)) {
err = brcmf_dev_intvar_set(ndev, "mpc", mpc);
@@ -4125,9 +4125,9 @@ static int brcmf_debugfs_add_netdev_params(struct brcmf_cfg80211_priv *cfg_priv)
struct dentry *fd;
s32 err = 0;
- sprintf(buf, "netdev:%s", wl_to_ndev(cfg_priv)->name);
+ sprintf(buf, "netdev:%s", cfg_to_ndev(cfg_priv)->name);
cfg_priv->debugfsdir = debugfs_create_dir(buf,
- wl_to_wiphy(cfg_priv)->debugfsdir);
+ cfg_to_wiphy(cfg_priv)->debugfsdir);
fd = debugfs_create_u16("beacon_int", S_IRUGO, cfg_priv->debugfsdir,
(u16 *)&cfg_priv->profile->beacon_interval);
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
index e2f41ab..3ee7a3f 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
@@ -321,20 +321,15 @@ struct brcmf_cfg80211_priv {
u8 ci[0] __attribute__ ((__aligned__(NETDEV_ALIGN)));
};
-#define wl_to_dev(w) (wiphy_dev(wl->wdev->wiphy))
-#define wl_to_wiphy(w) (w->wdev->wiphy)
-#define wiphy_to_wl(w) ((struct brcmf_cfg80211_priv *)(wiphy_priv(w)))
-#define wl_to_wdev(w) (w->wdev)
-#define wdev_to_wl(w) ((struct brcmf_cfg80211_priv *)(wdev_priv(w)))
-#define wl_to_ndev(w) (w->wdev->netdev)
-#define ndev_to_wl(n) (wdev_to_wl(n->ieee80211_ptr))
-#define ci_to_wl(c) (ci->cfg_priv)
-#define wl_to_ci(w) (&w->ci)
-#define wl_to_sr(w) (w->scan_req_int)
-#define wl_to_ie(w) (&w->ie)
-#define iscan_to_wl(i) ((struct brcmf_cfg80211_priv *)(i->data))
-#define wl_to_iscan(w) (w->iscan)
-#define wl_to_conn(w) (&w->conn_info)
+#define cfg_to_wiphy(w) (w->wdev->wiphy)
+#define wiphy_to_cfg(w) ((struct brcmf_cfg80211_priv *)(wiphy_priv(w)))
+#define cfg_to_wdev(w) (w->wdev)
+#define wdev_to_cfg(w) ((struct brcmf_cfg80211_priv *)(wdev_priv(w)))
+#define cfg_to_ndev(w) (w->wdev->netdev)
+#define ndev_to_cfg(n) (wdev_to_cfg(n->ieee80211_ptr))
+#define iscan_to_cfg(i) ((struct brcmf_cfg80211_priv *)(i->data))
+#define cfg_to_iscan(w) (w->iscan)
+#define cfg_to_conn(w) (&w->conn_info)
static inline struct brcmf_bss_info *next_bss(struct brcmf_scan_results *list,
struct brcmf_bss_info *bss)
--
1.7.1
From: Arend van Spriel <[email protected]>
The driver contained several code paths specific to running the
driver against a simulated chip. This is not needed and removed.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/aiutils.h | 2 -
drivers/staging/brcm80211/brcmsmac/main.c | 6 +--
drivers/staging/brcm80211/brcmsmac/nicpci.c | 39 ++++++--------
drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c | 38 +++++---------
drivers/staging/brcm80211/brcmsmac/phy/phy_n.c | 4 +-
drivers/staging/brcm80211/brcmsmac/pmu.c | 10 +---
drivers/staging/brcm80211/brcmsmac/srom.c | 61 +---------------------
7 files changed, 37 insertions(+), 123 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/aiutils.h b/drivers/staging/brcm80211/brcmsmac/aiutils.h
index 965eb94..b00780d 100644
--- a/drivers/staging/brcm80211/brcmsmac/aiutils.h
+++ b/drivers/staging/brcm80211/brcmsmac/aiutils.h
@@ -409,8 +409,6 @@ struct si_pub {
#define SI_PCIDOWN 2
#define SI_PCIUP 3
-#define ISSIM_ENAB(sih) 0
-
/* PMU clock/power control */
#if defined(BCMPMUCTL)
#define PMUCTL_ENAB(sih) (BCMPMUCTL)
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index ca9f195..093f3bf 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -5480,10 +5480,8 @@ static void brcms_c_bss_default_init(struct brcms_c_info *wlc)
/* init default and target BSS with some sane initial values */
memset((char *)(bi), 0, sizeof(wlc_bss_info_t));
- bi->beacon_period = ISSIM_ENAB(wlc->pub->sih) ? BEACON_INTERVAL_DEF_QT :
- BEACON_INTERVAL_DEFAULT;
- bi->dtim_period = ISSIM_ENAB(wlc->pub->sih) ? DTIM_INTERVAL_DEF_QT :
- DTIM_INTERVAL_DEFAULT;
+ bi->beacon_period = BEACON_INTERVAL_DEFAULT;
+ bi->dtim_period = DTIM_INTERVAL_DEFAULT;
/* fill the default channel as the first valid channel
* starting from the 2G channels
diff --git a/drivers/staging/brcm80211/brcmsmac/nicpci.c b/drivers/staging/brcm80211/brcmsmac/nicpci.c
index 5a19182..70d4173 100644
--- a/drivers/staging/brcm80211/brcmsmac/nicpci.c
+++ b/drivers/staging/brcm80211/brcmsmac/nicpci.c
@@ -596,28 +596,23 @@ static void pcie_war_aspm_clkreq(pcicore_info_t *pi)
return;
/* bypass this on QT or VSIM */
- if (!ISSIM_ENAB(sih)) {
-
- reg16 = &pcieregs->sprom[SRSH_ASPM_OFFSET];
- val16 = R_REG(reg16);
+ reg16 = &pcieregs->sprom[SRSH_ASPM_OFFSET];
+ val16 = R_REG(reg16);
- val16 &= ~SRSH_ASPM_ENB;
- if (pi->pcie_war_aspm_ovr == PCIE_ASPM_ENAB)
- val16 |= SRSH_ASPM_ENB;
- else if (pi->pcie_war_aspm_ovr == PCIE_ASPM_L1_ENAB)
- val16 |= SRSH_ASPM_L1_ENB;
- else if (pi->pcie_war_aspm_ovr == PCIE_ASPM_L0s_ENAB)
- val16 |= SRSH_ASPM_L0s_ENB;
+ val16 &= ~SRSH_ASPM_ENB;
+ if (pi->pcie_war_aspm_ovr == PCIE_ASPM_ENAB)
+ val16 |= SRSH_ASPM_ENB;
+ else if (pi->pcie_war_aspm_ovr == PCIE_ASPM_L1_ENAB)
+ val16 |= SRSH_ASPM_L1_ENB;
+ else if (pi->pcie_war_aspm_ovr == PCIE_ASPM_L0s_ENAB)
+ val16 |= SRSH_ASPM_L0s_ENB;
- W_REG(reg16, val16);
+ W_REG(reg16, val16);
- pci_read_config_dword(pi->dev, pi->pciecap_lcreg_offset,
- &w);
- w &= ~PCIE_ASPM_ENAB;
- w |= pi->pcie_war_aspm_ovr;
- pci_write_config_dword(pi->dev,
- pi->pciecap_lcreg_offset, w);
- }
+ pci_read_config_dword(pi->dev, pi->pciecap_lcreg_offset, &w);
+ w &= ~PCIE_ASPM_ENAB;
+ w |= pi->pcie_war_aspm_ovr;
+ pci_write_config_dword(pi->dev, pi->pciecap_lcreg_offset, w);
reg16 = &pcieregs->sprom[SRSH_CLKREQ_OFFSET_REV5];
val16 = R_REG(reg16);
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
index dd56f10..a15c145 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
@@ -519,6 +519,7 @@ wlc_phy_t *wlc_phy_attach(shared_phy_t *sh, void *regs, int bandtype,
phy_info_t *pi;
u32 sflags = 0;
uint phyversion;
+ u32 idcode;
int i;
if (D11REV_IS(sh->corerev, 4))
@@ -589,27 +590,19 @@ wlc_phy_t *wlc_phy_attach(shared_phy_t *sh, void *regs, int bandtype,
}
}
- if (ISSIM_ENAB(pi->sh->sih)) {
- pi->pubpi.radioid = NORADIO_ID;
- pi->pubpi.radiorev = 5;
- } else {
- u32 idcode;
-
- wlc_phy_anacore((wlc_phy_t *) pi, ON);
-
- idcode = wlc_phy_get_radio_ver(pi);
- pi->pubpi.radioid =
- (idcode & IDCODE_ID_MASK) >> IDCODE_ID_SHIFT;
- pi->pubpi.radiorev =
- (idcode & IDCODE_REV_MASK) >> IDCODE_REV_SHIFT;
- pi->pubpi.radiover =
- (idcode & IDCODE_VER_MASK) >> IDCODE_VER_SHIFT;
- if (!VALID_RADIO(pi, pi->pubpi.radioid)) {
- goto err;
- }
+ wlc_phy_anacore((wlc_phy_t *) pi, ON);
- wlc_phy_switch_radio((wlc_phy_t *) pi, OFF);
- }
+ idcode = wlc_phy_get_radio_ver(pi);
+ pi->pubpi.radioid =
+ (idcode & IDCODE_ID_MASK) >> IDCODE_ID_SHIFT;
+ pi->pubpi.radiorev =
+ (idcode & IDCODE_REV_MASK) >> IDCODE_REV_SHIFT;
+ pi->pubpi.radiover =
+ (idcode & IDCODE_VER_MASK) >> IDCODE_VER_SHIFT;
+ if (!VALID_RADIO(pi, pi->pubpi.radioid))
+ goto err;
+
+ wlc_phy_switch_radio((wlc_phy_t *) pi, OFF);
wlc_set_phy_uninitted(pi);
@@ -1195,11 +1188,6 @@ void wlc_phy_do_dummy_tx(phy_info_t *pi, bool ofdm, bool pa_on)
i = 0;
count = ofdm ? 30 : 250;
-
- if (ISSIM_ENAB(pi->sh->sih)) {
- count *= 100;
- }
-
while ((i++ < count)
&& (R_REG(®s->txe_status) & (1 << 7))) {
udelay(10);
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
index ff0eb22..57fff0f 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
@@ -15369,9 +15369,7 @@ static void wlc_phy_workarounds_nphy(phy_info_t *pi)
if (pi->phyhang_avoid)
wlc_phy_stay_in_carriersearch_nphy(pi, true);
- if (!ISSIM_ENAB(pi->sh->sih)) {
- or_phy_reg(pi, 0xb1, NPHY_IQFlip_ADC1 | NPHY_IQFlip_ADC2);
- }
+ or_phy_reg(pi, 0xb1, NPHY_IQFlip_ADC1 | NPHY_IQFlip_ADC2);
if (NREV_GE(pi->pubpi.phy_rev, 7)) {
diff --git a/drivers/staging/brcm80211/brcmsmac/pmu.c b/drivers/staging/brcm80211/brcmsmac/pmu.c
index 6508243..e8b2b81 100644
--- a/drivers/staging/brcm80211/brcmsmac/pmu.c
+++ b/drivers/staging/brcm80211/brcmsmac/pmu.c
@@ -203,7 +203,7 @@ u32 si_pmu_ilp_clock(struct si_pub *sih)
{
static u32 ilpcycles_per_sec;
- if (ISSIM_ENAB(sih) || !PMUCTL_ENAB(sih))
+ if (!PMUCTL_ENAB(sih))
return ILP_CLOCK;
if (ilpcycles_per_sec == 0) {
@@ -225,21 +225,15 @@ u16 si_pmu_fast_pwrup_delay(struct si_pub *sih)
{
uint delay = PMU_MAX_TRANSITION_DLY;
- /* Remember original core before switch to chipc */
- origidx = ai_coreidx(sih);
- cc = ai_setcoreidx(sih, SI_CC_IDX);
-
switch (sih->chip) {
case BCM43224_CHIP_ID:
case BCM43225_CHIP_ID:
case BCM4313_CHIP_ID:
- delay = ISSIM_ENAB(sih) ? 70 : 3700;
+ delay = 3700;
break;
default:
break;
}
- /* Return to original core */
- ai_setcoreidx(sih, origidx);
return (u16) delay;
}
diff --git a/drivers/staging/brcm80211/brcmsmac/srom.c b/drivers/staging/brcm80211/brcmsmac/srom.c
index 34c19ef..de3e703 100644
--- a/drivers/staging/brcm80211/brcmsmac/srom.c
+++ b/drivers/staging/brcm80211/brcmsmac/srom.c
@@ -783,8 +783,6 @@ static int sprom_read_pci(struct si_pub *sih, u16 *sprom,
#if defined(BCMNVRAMR)
static int otp_read_pci(struct si_pub *sih, u16 *buf, uint bufsz);
#endif
-static u16 srom_cc_cmd(struct si_pub *sih, void *ccregs, u32 cmd,
- uint wordoff, u16 data);
static int initvars_table(char *start, char *end,
char **vars, uint *count);
@@ -873,38 +871,6 @@ int srom_var_init(struct si_pub *sih, uint bustype, void *curmap,
return -EINVAL;
}
-/* In chips with chipcommon rev 32 and later, the srom is in chipcommon,
- * not in the bus cores.
- */
-static u16
-srom_cc_cmd(struct si_pub *sih, void *ccregs, u32 cmd,
- uint wordoff, u16 data)
-{
- chipcregs_t *cc = (chipcregs_t *) ccregs;
- uint wait_cnt = 1000;
-
- if ((cmd == SRC_OP_READ) || (cmd == SRC_OP_WRITE)) {
- W_REG(&cc->sromaddress, wordoff * 2);
- if (cmd == SRC_OP_WRITE)
- W_REG(&cc->sromdata, data);
- }
-
- W_REG(&cc->sromcontrol, SRC_START | cmd);
-
- while (wait_cnt--) {
- if ((R_REG(&cc->sromcontrol) & SRC_BUSY) == 0)
- break;
- }
-
- if (!wait_cnt) {
- return 0xffff;
- }
- if (cmd == SRC_OP_READ)
- return (u16) R_REG(&cc->sromdata);
- else
- return 0xffff;
-}
-
static inline void ltoh16_buf(u16 *buf, unsigned int size)
{
for (size /= 2; size; size--)
@@ -927,33 +893,10 @@ sprom_read_pci(struct si_pub *sih, u16 *sprom, uint wordoff,
{
int err = 0;
uint i;
- void *ccregs = NULL;
/* read the sprom */
- for (i = 0; i < nwords; i++) {
-
- if (sih->ccrev > 31 && ISSIM_ENAB(sih)) {
- /* use indirect since direct is too slow on QT */
- if ((sih->cccaps & CC_CAP_SROM) == 0)
- return -ENODEV;
-
- ccregs = (void *)((u8 *) sprom - CC_SROM_OTP);
- buf[i] =
- srom_cc_cmd(sih, ccregs, SRC_OP_READ,
- wordoff + i, 0);
-
- } else {
- if (ISSIM_ENAB(sih))
- buf[i] = R_REG(&sprom[wordoff + i]);
-
- buf[i] = R_REG(&sprom[wordoff + i]);
- }
-
- }
-
- /* bypass crc checking for simulation to allow srom hack */
- if (ISSIM_ENAB(sih))
- return 0;
+ for (i = 0; i < nwords; i++)
+ buf[i] = R_REG(&sprom[wordoff + i]);
if (check_crc) {
--
1.7.1
From: Arend van Spriel <[email protected]>
Making an effort getting rid of the wl_ prefix from the fullmac source
files.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 1246 +++++++++++----------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h | 103 +--
2 files changed, 695 insertions(+), 654 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index 85ff00b..5c858c5 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -36,7 +36,7 @@
#include "wl_cfg80211.h"
static struct sdio_func *cfg80211_sdio_func;
-static struct wl_dev *wl_cfg80211_dev;
+static struct brcmf_cfg80211_dev *cfg80211_dev;
static const u8 ether_bcast[ETH_ALEN] = {255, 255, 255, 255, 255, 255};
u32 brcmf_dbg_level = WL_DBG_ERR;
@@ -45,34 +45,35 @@ u32 brcmf_dbg_level = WL_DBG_ERR;
** cfg80211_ops api/callback list
*/
static s32 brcmf_cfg80211_change_iface(struct wiphy *wiphy,
- struct net_device *ndev,
- enum nl80211_iftype type, u32 *flags,
- struct vif_params *params);
+ struct net_device *ndev,
+ enum nl80211_iftype type, u32 *flags,
+ struct vif_params *params);
static s32 __brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
- struct cfg80211_scan_request *request,
- struct cfg80211_ssid *this_ssid);
+ struct cfg80211_scan_request *request,
+ struct cfg80211_ssid *this_ssid);
static s32 brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
- struct cfg80211_scan_request *request);
+ struct cfg80211_scan_request *request);
static s32 brcmf_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed);
static s32 brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
- struct cfg80211_ibss_params *params);
+ struct cfg80211_ibss_params *params);
static s32 brcmf_cfg80211_leave_ibss(struct wiphy *wiphy,
- struct net_device *dev);
+ struct net_device *dev);
static s32 brcmf_cfg80211_get_station(struct wiphy *wiphy,
- struct net_device *dev, u8 *mac,
- struct station_info *sinfo);
+ struct net_device *dev, u8 *mac,
+ struct station_info *sinfo);
static s32 brcmf_cfg80211_set_power_mgmt(struct wiphy *wiphy,
- struct net_device *dev, bool enabled,
- s32 timeout);
+ struct net_device *dev, bool enabled,
+ s32 timeout);
static s32 brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy,
- struct net_device *dev,
- const u8 *addr,
- const struct cfg80211_bitrate_mask
- *mask);
+ struct net_device *dev,
+ const u8 *addr,
+ const struct cfg80211_bitrate_mask
+ *mask);
static int brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
- struct cfg80211_connect_params *sme);
-static s32 brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
- u16 reason_code);
+ struct cfg80211_connect_params *sme);
+static s32 brcmf_cfg80211_disconnect(struct wiphy *wiphy,
+ struct net_device *dev,
+ u16 reason_code);
static s32 brcmf_cfg80211_set_tx_power(struct wiphy *wiphy,
enum nl80211_tx_power_setting type,
s32 dbm);
@@ -106,40 +107,47 @@ static s32 brcmf_cfg80211_flush_pmksa(struct wiphy *wiphy,
/*
** event & event Q handlers for cfg80211 interfaces
*/
-static s32 brcmf_create_event_handler(struct wl_priv *wl);
-static void brcmf_destroy_event_handler(struct wl_priv *wl);
+static s32 brcmf_create_event_handler(struct brcmf_cfg80211_priv *cfg_priv);
+static void brcmf_destroy_event_handler(struct brcmf_cfg80211_priv *cfg_priv);
static s32 brcmf_event_handler(void *data);
-static void brcmf_init_eq(struct wl_priv *wl);
-static void brcmf_flush_eq(struct wl_priv *wl);
-static void brcmf_lock_eq(struct wl_priv *wl);
-static void brcmf_unlock_eq(struct wl_priv *wl);
-static void brcmf_init_eq_lock(struct wl_priv *wl);
-static void brcmf_init_eloop_handler(struct wl_event_loop *el);
-static struct wl_event_q *brcmf_deq_event(struct wl_priv *wl);
-static s32 brcmf_enq_event(struct wl_priv *wl, u32 type,
- const struct brcmf_event_msg *msg, void *data);
-static void brcmf_put_event(struct wl_event_q *e);
-static void brcmf_wakeup_event(struct wl_priv *wl);
-static s32 brcmf_notify_connect_status(struct wl_priv *wl, struct net_device *ndev,
+static void brcmf_init_eq(struct brcmf_cfg80211_priv *cfg_priv);
+static void brcmf_flush_eq(struct brcmf_cfg80211_priv *cfg_priv);
+static void brcmf_lock_eq(struct brcmf_cfg80211_priv *cfg_priv);
+static void brcmf_unlock_eq(struct brcmf_cfg80211_priv *cfg_priv);
+static void brcmf_init_eq_lock(struct brcmf_cfg80211_priv *cfg_priv);
+static void brcmf_init_eloop_handler(struct brcmf_cfg80211_event_loop *el);
+static struct brcmf_cfg80211_event_q *
+brcmf_deq_event(struct brcmf_cfg80211_priv *cfg_priv);
+static s32 brcmf_enq_event(struct brcmf_cfg80211_priv *cfg_priv, u32 type,
+ const struct brcmf_event_msg *msg, void *data);
+static void brcmf_put_event(struct brcmf_cfg80211_event_q *e);
+static void brcmf_wakeup_event(struct brcmf_cfg80211_priv *cfg_priv);
+static s32 brcmf_notify_connect_status(struct brcmf_cfg80211_priv *cfg_priv,
+ struct net_device *ndev,
+ const struct brcmf_event_msg *e,
+ void *data);
+static s32 brcmf_notify_roaming_status(struct brcmf_cfg80211_priv *cfg_priv,
+ struct net_device *ndev,
const struct brcmf_event_msg *e,
void *data);
-static s32 brcmf_notify_roaming_status(struct wl_priv *wl, struct net_device *ndev,
+static s32 brcmf_notify_scan_status(struct brcmf_cfg80211_priv *cfg_priv,
+ struct net_device *ndev,
const struct brcmf_event_msg *e,
void *data);
-static s32 brcmf_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
- const struct brcmf_event_msg *e, void *data);
-static s32 brcmf_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
+static s32 brcmf_bss_connect_done(struct brcmf_cfg80211_priv *cfg_priv,
+ struct net_device *ndev,
const struct brcmf_event_msg *e, void *data,
bool completed);
-static s32 brcmf_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
+static s32 brcmf_bss_roaming_done(struct brcmf_cfg80211_priv *cfg_priv,
+ struct net_device *ndev,
const struct brcmf_event_msg *e, void *data);
-static s32 brcmf_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
+static s32 brcmf_notify_mic_status(struct brcmf_cfg80211_priv *cfg_priv,
+ struct net_device *ndev,
const struct brcmf_event_msg *e, void *data);
/*
** register/deregister sdio function
*/
-struct sdio_func *wl_cfg80211_get_sdio_func(void);
static void brcmf_clear_sdio_func(void);
/*
@@ -165,10 +173,11 @@ static s32 brcmf_set_retry(struct net_device *dev, u32 retry, bool l);
/*
** wl profile utilities
*/
-static s32 brcmf_update_prof(struct wl_priv *wl, const struct brcmf_event_msg *e,
+static s32 brcmf_update_prof(struct brcmf_cfg80211_priv *cfg_priv,
+ const struct brcmf_event_msg *e,
void *data, s32 item);
-static void *brcmf_read_prof(struct wl_priv *wl, s32 item);
-static void brcmf_init_prof(struct wl_profile *prof);
+static void *brcmf_read_prof(struct brcmf_cfg80211_priv *cfg_priv, s32 item);
+static void brcmf_init_prof(struct brcmf_cfg80211_profile *prof);
/*
** cfg80211 connect utilites
@@ -183,22 +192,24 @@ static s32 brcmf_set_key_mgmt(struct net_device *dev,
struct cfg80211_connect_params *sme);
static s32 brcmf_set_set_sharedkey(struct net_device *dev,
struct cfg80211_connect_params *sme);
-static s32 brcmf_get_assoc_ies(struct wl_priv *wl);
-static void brcmf_clear_assoc_ies(struct wl_priv *wl);
+static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_priv *cfg_priv);
+static void brcmf_clear_assoc_ies(struct brcmf_cfg80211_priv *cfg_priv);
static void brcmf_ch_to_chanspec(int ch,
struct brcmf_join_params *join_params, size_t *join_params_size);
/*
** information element utilities
*/
-static __used s32 brcmf_add_ie(struct wl_priv *wl, u8 t, u8 l, u8 *v);
+static __used s32 brcmf_add_ie(struct brcmf_cfg80211_priv *cfg_priv,
+ u8 t, u8 l, u8 *v);
static s32 brcmf_mode_to_nl80211_iftype(s32 mode);
static struct wireless_dev *brcmf_alloc_wdev(s32 sizeof_iface,
struct device *dev);
-static void brcmf_free_wdev(struct wl_priv *wl);
-static s32 brcmf_inform_bss(struct wl_priv *wl);
-static s32 brcmf_inform_single_bss(struct wl_priv *wl, struct brcmf_bss_info *bi);
-static s32 brcmf_update_bss_info(struct wl_priv *wl);
+static void brcmf_free_wdev(struct brcmf_cfg80211_priv *cfg_priv);
+static s32 brcmf_inform_bss(struct brcmf_cfg80211_priv *cfg_priv);
+static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_priv *cfg_priv,
+ struct brcmf_bss_info *bi);
+static s32 brcmf_update_bss_info(struct brcmf_cfg80211_priv *cfg_priv);
static s32 brcmf_add_keyext(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, const u8 *mac_addr,
struct key_params *params);
@@ -210,45 +221,48 @@ static void swap_key_from_BE(struct brcmf_wsec_key *key);
static void swap_key_to_BE(struct brcmf_wsec_key *key);
/*
-** wl_priv memory init/deinit utilities
+** brcmf_cfg80211_priv memory init/deinit utilities
*/
-static s32 brcmf_init_priv_mem(struct wl_priv *wl);
-static void brcmf_deinit_priv_mem(struct wl_priv *wl);
+static s32 brcmf_init_priv_mem(struct brcmf_cfg80211_priv *cfg_priv);
+static void brcmf_deinit_priv_mem(struct brcmf_cfg80211_priv *cfg_priv);
static void brcmf_delay(u32 ms);
/*
** store/restore cfg80211 instance data
*/
-static void brcmf_set_drvdata(struct wl_dev *dev, void *data);
-static void *brcmf_get_drvdata(struct wl_dev *dev);
+static void brcmf_set_drvdata(struct brcmf_cfg80211_dev *dev, void *data);
+static void *brcmf_get_drvdata(struct brcmf_cfg80211_dev *dev);
/*
** ibss mode utilities
*/
-static bool brcmf_is_ibssmode(struct wl_priv *wl);
+static bool brcmf_is_ibssmode(struct brcmf_cfg80211_priv *cfg_priv);
/*
** dongle up/down , default configuration utilities
*/
-static bool brcmf_is_linkdown(struct wl_priv *wl, const struct brcmf_event_msg *e);
-static bool brcmf_is_linkup(struct wl_priv *wl, const struct brcmf_event_msg *e);
-static bool brcmf_is_nonetwork(struct wl_priv *wl,
+static bool brcmf_is_linkdown(struct brcmf_cfg80211_priv *cfg_priv,
+ const struct brcmf_event_msg *e);
+static bool brcmf_is_linkup(struct brcmf_cfg80211_priv *cfg_priv,
+ const struct brcmf_event_msg *e);
+static bool brcmf_is_nonetwork(struct brcmf_cfg80211_priv *cfg_priv,
const struct brcmf_event_msg *e);
-static void brcmf_link_down(struct wl_priv *wl);
+static void brcmf_link_down(struct brcmf_cfg80211_priv *cfg_priv);
static s32 brcmf_dongle_mode(struct net_device *ndev, s32 iftype);
-static s32 __brcmf_cfg80211_up(struct wl_priv *wl);
-static s32 __brcmf_cfg80211_down(struct wl_priv *wl);
-static s32 brcmf_dongle_probecap(struct wl_priv *wl);
-static void brcmf_init_conf(struct wl_conf *conf);
+static s32 __brcmf_cfg80211_up(struct brcmf_cfg80211_priv *cfg_priv);
+static s32 __brcmf_cfg80211_down(struct brcmf_cfg80211_priv *cfg_priv);
+static s32 brcmf_dongle_probecap(struct brcmf_cfg80211_priv *cfg_priv);
+static void brcmf_init_conf(struct brcmf_cfg80211_conf *conf);
/*
** dongle configuration utilities
*/
static s32 brcmf_dongle_eventmsg(struct net_device *ndev);
static s32 brcmf_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
- s32 scan_unassoc_time, s32 scan_passive_time);
-static s32 brcmf_config_dongle(struct wl_priv *wl, bool need_lock);
+ s32 scan_unassoc_time, s32 scan_passive_time);
+static s32 brcmf_config_dongle(struct brcmf_cfg80211_priv *cfg_priv,
+ bool need_lock);
static s32 brcmf_dongle_roam(struct net_device *ndev, u32 roamvar,
u32 bcn_timeout);
@@ -256,8 +270,8 @@ static s32 brcmf_dongle_roam(struct net_device *ndev, u32 roamvar,
** iscan handler
*/
static void brcmf_iscan_timer(unsigned long data);
-static void brcmf_term_iscan(struct wl_priv *wl);
-static s32 brcmf_init_iscan(struct wl_priv *wl);
+static void brcmf_term_iscan(struct brcmf_cfg80211_priv *cfg_priv);
+static s32 brcmf_init_iscan(struct brcmf_cfg80211_priv *cfg_priv);
static s32 brcmf_iscan_thread(void *data);
static s32 brcmf_dev_iovar_setbuf(struct net_device *dev, s8 *iovar,
void *param, s32 paramlen, void *bufptr,
@@ -265,19 +279,21 @@ static s32 brcmf_dev_iovar_setbuf(struct net_device *dev, s8 *iovar,
static s32 brcmf_dev_iovar_getbuf(struct net_device *dev, s8 *iovar,
void *param, s32 paramlen, void *bufptr,
s32 buflen);
-static s32 brcmf_run_iscan(struct wl_iscan_ctrl *iscan, struct brcmf_ssid *ssid,
- u16 action);
-static s32 brcmf_do_iscan(struct wl_priv *wl);
-static s32 brcmf_wakeup_iscan(struct wl_iscan_ctrl *iscan);
-static s32 brcmf_invoke_iscan(struct wl_priv *wl);
-static s32 brcmf_get_iscan_results(struct wl_iscan_ctrl *iscan, u32 *status,
- struct brcmf_scan_results **bss_list);
-static void brcmf_notify_iscan_complete(struct wl_iscan_ctrl *iscan, bool aborted);
-static void brcmf_init_iscan_eloop(struct wl_iscan_eloop *el);
-static s32 brcmf_iscan_done(struct wl_priv *wl);
-static s32 brcmf_iscan_pending(struct wl_priv *wl);
-static s32 brcmf_iscan_inprogress(struct wl_priv *wl);
-static s32 brcmf_iscan_aborted(struct wl_priv *wl);
+static s32 brcmf_run_iscan(struct brcmf_cfg80211_iscan_ctrl *iscan,
+ struct brcmf_ssid *ssid, u16 action);
+static s32 brcmf_do_iscan(struct brcmf_cfg80211_priv *cfg_priv);
+static s32 brcmf_wakeup_iscan(struct brcmf_cfg80211_iscan_ctrl *iscan);
+static s32 brcmf_invoke_iscan(struct brcmf_cfg80211_priv *cfg_priv);
+static s32 brcmf_get_iscan_results(struct brcmf_cfg80211_iscan_ctrl *iscan,
+ u32 *status,
+ struct brcmf_scan_results **bss_list);
+static void brcmf_notify_iscan_complete(struct brcmf_cfg80211_iscan_ctrl *iscan,
+ bool aborted);
+static void brcmf_init_iscan_eloop(struct brcmf_cfg80211_iscan_eloop *el);
+static s32 brcmf_iscan_done(struct brcmf_cfg80211_priv *cfg_priv);
+static s32 brcmf_iscan_pending(struct brcmf_cfg80211_priv *cfg_priv);
+static s32 brcmf_iscan_inprogress(struct brcmf_cfg80211_priv *cfg_priv);
+static s32 brcmf_iscan_aborted(struct brcmf_cfg80211_priv *cfg_priv);
/*
* find most significant bit set
@@ -288,19 +304,21 @@ static __used u32 brcmf_find_msb(u16 bit16);
* update pmklist to dongle
*/
static __used s32 brcmf_update_pmklist(struct net_device *dev,
- struct wl_pmk_list *pmk_list, s32 err);
+ struct brcmf_cfg80211_pmk_list *pmk_list,
+ s32 err);
static void brcmf_set_mpc(struct net_device *ndev, int mpc);
/*
* debufs support
*/
-static int brcmf_debugfs_add_netdev_params(struct wl_priv *wl);
-static void brcmf_debugfs_remove_netdev(struct wl_priv *wl);
+static int
+brcmf_debugfs_add_netdev_params(struct brcmf_cfg80211_priv *cfg_priv);
+static void brcmf_debugfs_remove_netdev(struct brcmf_cfg80211_priv *cfg_priv);
#define WL_PRIV_GET() \
({ \
- struct wl_iface *ci = brcmf_get_drvdata(wl_cfg80211_dev); \
+ struct brcmf_cfg80211_iface *ci = brcmf_get_drvdata(cfg80211_dev); \
if (unlikely(!ci)) { \
WL_ERR("wl_cfg80211_dev is unavailable\n"); \
BUG(); \
@@ -310,10 +328,10 @@ static void brcmf_debugfs_remove_netdev(struct wl_priv *wl);
#define CHECK_SYS_UP() \
do { \
- struct wl_priv *wl = wiphy_to_wl(wiphy); \
- if (unlikely(!test_bit(WL_STATUS_READY, &wl->status))) { \
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy); \
+ if (unlikely(!test_bit(WL_STATUS_READY, &cfg_priv->status))) { \
WL_INFO("device is not ready : status (%d)\n", \
- (int)wl->status); \
+ (int)cfg_priv->status); \
return -EIO; \
} \
} while (0)
@@ -543,7 +561,7 @@ brcmf_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
enum nl80211_iftype type, u32 *flags,
struct vif_params *params)
{
- struct wl_priv *wl = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
struct wireless_dev *wdev;
s32 infra = 0;
s32 err = 0;
@@ -558,11 +576,11 @@ brcmf_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
type);
return -EOPNOTSUPP;
case NL80211_IFTYPE_ADHOC:
- wl->conf->mode = WL_MODE_IBSS;
+ cfg_priv->conf->mode = WL_MODE_IBSS;
infra = 0;
break;
case NL80211_IFTYPE_STATION:
- wl->conf->mode = WL_MODE_BSS;
+ cfg_priv->conf->mode = WL_MODE_BSS;
infra = 1;
break;
default:
@@ -581,7 +599,7 @@ brcmf_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
}
WL_INFO("IF Type = %s\n",
- (wl->conf->mode == WL_MODE_IBSS) ? "Adhoc" : "Infra");
+ (cfg_priv->conf->mode == WL_MODE_IBSS) ? "Adhoc" : "Infra");
done:
WL_TRACE("Exit\n");
@@ -635,7 +653,8 @@ brcmf_dev_iovar_getbuf(struct net_device *dev, s8 * iovar, void *param,
}
static s32
-brcmf_run_iscan(struct wl_iscan_ctrl *iscan, struct brcmf_ssid *ssid, u16 action)
+brcmf_run_iscan(struct brcmf_cfg80211_iscan_ctrl *iscan,
+ struct brcmf_ssid *ssid, u16 action)
{
s32 params_size = (BRCMF_SCAN_PARAMS_FIXED_SIZE +
offsetof(struct brcmf_iscan_params, params));
@@ -669,10 +688,10 @@ brcmf_run_iscan(struct wl_iscan_ctrl *iscan, struct brcmf_ssid *ssid, u16 action
return err;
}
-static s32 brcmf_do_iscan(struct wl_priv *wl)
+static s32 brcmf_do_iscan(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct wl_iscan_ctrl *iscan = wl_to_iscan(wl);
- struct net_device *ndev = wl_to_ndev(wl);
+ struct brcmf_cfg80211_iscan_ctrl *iscan = wl_to_iscan(cfg_priv);
+ struct net_device *ndev = wl_to_ndev(cfg_priv);
struct brcmf_ssid ssid;
s32 passive_scan;
s32 err = 0;
@@ -682,15 +701,15 @@ static s32 brcmf_do_iscan(struct wl_priv *wl)
iscan->state = WL_ISCAN_STATE_SCANING;
- passive_scan = wl->active_scan ? 0 : 1;
- err = brcmf_dev_ioctl(wl_to_ndev(wl), BRCMF_C_SET_PASSIVE_SCAN,
+ passive_scan = cfg_priv->active_scan ? 0 : 1;
+ err = brcmf_dev_ioctl(wl_to_ndev(cfg_priv), BRCMF_C_SET_PASSIVE_SCAN,
&passive_scan, sizeof(passive_scan));
if (unlikely(err)) {
WL_ERR("error (%d)\n", err);
return err;
}
brcmf_set_mpc(ndev, 0);
- wl->iscan_kickstart = true;
+ cfg_priv->iscan_kickstart = true;
brcmf_run_iscan(iscan, &ssid, BRCMF_SCAN_ACTION_START);
mod_timer(&iscan->timer, jiffies + iscan->timer_ms * HZ / 1000);
iscan->timer_on = 1;
@@ -703,26 +722,26 @@ __brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
struct cfg80211_scan_request *request,
struct cfg80211_ssid *this_ssid)
{
- struct wl_priv *wl = ndev_to_wl(ndev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(ndev);
struct cfg80211_ssid *ssids;
- struct wl_scan_req *sr = wl_to_sr(wl);
+ struct brcmf_cfg80211_scan_req *sr = wl_to_sr(cfg_priv);
s32 passive_scan;
bool iscan_req;
bool spec_scan;
s32 err = 0;
- if (unlikely(test_bit(WL_STATUS_SCANNING, &wl->status))) {
- WL_ERR("Scanning already : status (%d)\n", (int)wl->status);
+ if (unlikely(test_bit(WL_STATUS_SCANNING, &cfg_priv->status))) {
+ WL_ERR("Scanning already : status (%lu)\n", cfg_priv->status);
return -EAGAIN;
}
- if (unlikely(test_bit(WL_STATUS_SCAN_ABORTING, &wl->status))) {
- WL_ERR("Scanning being aborted : status (%d)\n",
- (int)wl->status);
+ if (unlikely(test_bit(WL_STATUS_SCAN_ABORTING, &cfg_priv->status))) {
+ WL_ERR("Scanning being aborted : status (%lu)\n",
+ cfg_priv->status);
return -EAGAIN;
}
- if (test_bit(WL_STATUS_CONNECTING, &wl->status)) {
- WL_ERR("Connecting : status (%d)\n",
- (int)wl->status);
+ if (test_bit(WL_STATUS_CONNECTING, &cfg_priv->status)) {
+ WL_ERR("Connecting : status (%lu)\n",
+ cfg_priv->status);
return -EAGAIN;
}
@@ -731,7 +750,7 @@ __brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
if (request) {
/* scan bss */
ssids = request->ssids;
- if (wl->iscan_on && (!ssids || !ssids->ssid_len))
+ if (cfg_priv->iscan_on && (!ssids || !ssids->ssid_len))
iscan_req = true;
} else {
/* scan in ibss */
@@ -739,10 +758,10 @@ __brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
ssids = this_ssid;
}
- wl->scan_request = request;
- set_bit(WL_STATUS_SCANNING, &wl->status);
+ cfg_priv->scan_request = request;
+ set_bit(WL_STATUS_SCANNING, &cfg_priv->status);
if (iscan_req) {
- err = brcmf_do_iscan(wl);
+ err = brcmf_do_iscan(cfg_priv);
if (likely(!err))
return err;
else
@@ -761,7 +780,7 @@ __brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
WL_SCAN("Broadcast scan\n");
}
- passive_scan = wl->active_scan ? 0 : 1;
+ passive_scan = cfg_priv->active_scan ? 0 : 1;
err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_PASSIVE_SCAN,
&passive_scan, sizeof(passive_scan));
if (unlikely(err)) {
@@ -786,8 +805,8 @@ __brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
return 0;
scan_out:
- clear_bit(WL_STATUS_SCANNING, &wl->status);
- wl->scan_request = NULL;
+ clear_bit(WL_STATUS_SCANNING, &cfg_priv->status);
+ cfg_priv->scan_request = NULL;
return err;
}
@@ -889,38 +908,38 @@ static s32 brcmf_set_retry(struct net_device *dev, u32 retry, bool l)
static s32 brcmf_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
{
- struct wl_priv *wl = wiphy_to_wl(wiphy);
- struct net_device *ndev = wl_to_ndev(wl);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct net_device *ndev = wl_to_ndev(cfg_priv);
s32 err = 0;
WL_TRACE("Enter\n");
CHECK_SYS_UP();
if (changed & WIPHY_PARAM_RTS_THRESHOLD &&
- (wl->conf->rts_threshold != wiphy->rts_threshold)) {
- wl->conf->rts_threshold = wiphy->rts_threshold;
- err = brcmf_set_rts(ndev, wl->conf->rts_threshold);
+ (cfg_priv->conf->rts_threshold != wiphy->rts_threshold)) {
+ cfg_priv->conf->rts_threshold = wiphy->rts_threshold;
+ err = brcmf_set_rts(ndev, cfg_priv->conf->rts_threshold);
if (!err)
goto done;
}
if (changed & WIPHY_PARAM_FRAG_THRESHOLD &&
- (wl->conf->frag_threshold != wiphy->frag_threshold)) {
- wl->conf->frag_threshold = wiphy->frag_threshold;
- err = brcmf_set_frag(ndev, wl->conf->frag_threshold);
+ (cfg_priv->conf->frag_threshold != wiphy->frag_threshold)) {
+ cfg_priv->conf->frag_threshold = wiphy->frag_threshold;
+ err = brcmf_set_frag(ndev, cfg_priv->conf->frag_threshold);
if (!err)
goto done;
}
if (changed & WIPHY_PARAM_RETRY_LONG
- && (wl->conf->retry_long != wiphy->retry_long)) {
- wl->conf->retry_long = wiphy->retry_long;
- err = brcmf_set_retry(ndev, wl->conf->retry_long, true);
+ && (cfg_priv->conf->retry_long != wiphy->retry_long)) {
+ cfg_priv->conf->retry_long = wiphy->retry_long;
+ err = brcmf_set_retry(ndev, cfg_priv->conf->retry_long, true);
if (!err)
goto done;
}
if (changed & WIPHY_PARAM_RETRY_SHORT
- && (wl->conf->retry_short != wiphy->retry_short)) {
- wl->conf->retry_short = wiphy->retry_short;
- err = brcmf_set_retry(ndev, wl->conf->retry_short, false);
+ && (cfg_priv->conf->retry_short != wiphy->retry_short)) {
+ cfg_priv->conf->retry_short = wiphy->retry_short;
+ err = brcmf_set_retry(ndev, cfg_priv->conf->retry_short, false);
if (!err)
goto done;
}
@@ -934,7 +953,7 @@ static s32
brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_ibss_params *params)
{
- struct wl_priv *wl = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
struct brcmf_join_params join_params;
size_t join_params_size = 0;
s32 err = 0;
@@ -951,7 +970,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
return -EOPNOTSUPP;
}
- set_bit(WL_STATUS_CONNECTING, &wl->status);
+ set_bit(WL_STATUS_CONNECTING, &cfg_priv->status);
if (params->bssid)
WL_CONN("BSSID: %02X %02X %02X %02X %02X %02X\n",
@@ -1021,7 +1040,7 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
memcpy(join_params.ssid.SSID, params->ssid, join_params.ssid.SSID_len);
join_params.ssid.SSID_len = cpu_to_le32(join_params.ssid.SSID_len);
join_params_size = sizeof(join_params.ssid);
- brcmf_update_prof(wl, NULL, &join_params.ssid, WL_PROF_SSID);
+ brcmf_update_prof(cfg_priv, NULL, &join_params.ssid, WL_PROF_SSID);
/* BSSID */
if (params->bssid) {
@@ -1031,23 +1050,24 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
} else {
memcpy(join_params.params.bssid, ether_bcast, ETH_ALEN);
}
- brcmf_update_prof(wl, NULL, &join_params.params.bssid, WL_PROF_BSSID);
+ brcmf_update_prof(cfg_priv, NULL,
+ &join_params.params.bssid, WL_PROF_BSSID);
/* Channel */
if (params->channel) {
u32 target_channel;
- wl->channel =
+ cfg_priv->channel =
ieee80211_frequency_to_channel(
params->channel->center_freq);
if (params->channel_fixed) {
/* adding chanspec */
- brcmf_ch_to_chanspec(wl->channel,
+ brcmf_ch_to_chanspec(cfg_priv->channel,
&join_params, &join_params_size);
}
/* set channel for starter */
- target_channel = cpu_to_le32(wl->channel);
+ target_channel = cpu_to_le32(cfg_priv->channel);
err = brcmf_dev_ioctl(dev, WLC_SET_CHANNEL,
&target_channel, sizeof(target_channel));
if (unlikely(err)) {
@@ -1055,9 +1075,9 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
goto done;
}
} else
- wl->channel = 0;
+ cfg_priv->channel = 0;
- wl->ibss_starter = false;
+ cfg_priv->ibss_starter = false;
err = brcmf_dev_ioctl(dev, BRCMF_C_SET_SSID,
@@ -1069,20 +1089,20 @@ brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
done:
if (err)
- clear_bit(WL_STATUS_CONNECTING, &wl->status);
+ clear_bit(WL_STATUS_CONNECTING, &cfg_priv->status);
WL_TRACE("Exit\n");
return err;
}
static s32 brcmf_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
{
- struct wl_priv *wl = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
s32 err = 0;
WL_TRACE("Enter\n");
CHECK_SYS_UP();
- brcmf_link_down(wl);
+ brcmf_link_down(cfg_priv);
WL_TRACE("Exit\n");
@@ -1092,8 +1112,8 @@ static s32 brcmf_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev
static s32
brcmf_set_wpa_version(struct net_device *dev, struct cfg80211_connect_params *sme)
{
- struct wl_priv *wl = ndev_to_wl(dev);
- struct wl_security *sec;
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
+ struct brcmf_cfg80211_security *sec;
s32 val = 0;
s32 err = 0;
@@ -1109,7 +1129,7 @@ brcmf_set_wpa_version(struct net_device *dev, struct cfg80211_connect_params *sm
WL_ERR("set wpa_auth failed (%d)\n", err);
return err;
}
- sec = brcmf_read_prof(wl, WL_PROF_SEC);
+ sec = brcmf_read_prof(cfg_priv, WL_PROF_SEC);
sec->wpa_versions = sme->crypto.wpa_versions;
return err;
}
@@ -1117,8 +1137,8 @@ brcmf_set_wpa_version(struct net_device *dev, struct cfg80211_connect_params *sm
static s32
brcmf_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme)
{
- struct wl_priv *wl = ndev_to_wl(dev);
- struct wl_security *sec;
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
+ struct brcmf_cfg80211_security *sec;
s32 val = 0;
s32 err = 0;
@@ -1148,7 +1168,7 @@ brcmf_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme)
WL_ERR("set auth failed (%d)\n", err);
return err;
}
- sec = brcmf_read_prof(wl, WL_PROF_SEC);
+ sec = brcmf_read_prof(cfg_priv, WL_PROF_SEC);
sec->auth_type = sme->auth_type;
return err;
}
@@ -1156,8 +1176,8 @@ brcmf_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme)
static s32
brcmf_set_set_cipher(struct net_device *dev, struct cfg80211_connect_params *sme)
{
- struct wl_priv *wl = ndev_to_wl(dev);
- struct wl_security *sec;
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
+ struct brcmf_cfg80211_security *sec;
s32 pval = 0;
s32 gval = 0;
s32 err = 0;
@@ -1212,7 +1232,7 @@ brcmf_set_set_cipher(struct net_device *dev, struct cfg80211_connect_params *sme
return err;
}
- sec = brcmf_read_prof(wl, WL_PROF_SEC);
+ sec = brcmf_read_prof(cfg_priv, WL_PROF_SEC);
sec->cipher_pairwise = sme->crypto.ciphers_pairwise[0];
sec->cipher_group = sme->crypto.cipher_group;
@@ -1222,8 +1242,8 @@ brcmf_set_set_cipher(struct net_device *dev, struct cfg80211_connect_params *sme
static s32
brcmf_set_key_mgmt(struct net_device *dev, struct cfg80211_connect_params *sme)
{
- struct wl_priv *wl = ndev_to_wl(dev);
- struct wl_security *sec;
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
+ struct brcmf_cfg80211_security *sec;
s32 val = 0;
s32 err = 0;
@@ -1268,7 +1288,7 @@ brcmf_set_key_mgmt(struct net_device *dev, struct cfg80211_connect_params *sme)
return err;
}
}
- sec = brcmf_read_prof(wl, WL_PROF_SEC);
+ sec = brcmf_read_prof(cfg_priv, WL_PROF_SEC);
sec->wpa_auth = sme->crypto.akm_suites[0];
return err;
@@ -1278,15 +1298,15 @@ static s32
brcmf_set_set_sharedkey(struct net_device *dev,
struct cfg80211_connect_params *sme)
{
- struct wl_priv *wl = ndev_to_wl(dev);
- struct wl_security *sec;
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
+ struct brcmf_cfg80211_security *sec;
struct brcmf_wsec_key key;
s32 val;
s32 err = 0;
WL_CONN("key len (%d)\n", sme->key_len);
if (sme->key_len) {
- sec = brcmf_read_prof(wl, WL_PROF_SEC);
+ sec = brcmf_read_prof(cfg_priv, WL_PROF_SEC);
WL_CONN("wpa_versions 0x%x cipher_pairwise 0x%x\n",
sec->wpa_versions, sec->cipher_pairwise);
if (!
@@ -1344,7 +1364,7 @@ static s32
brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_connect_params *sme)
{
- struct wl_priv *wl = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
struct ieee80211_channel *chan = sme->channel;
struct brcmf_join_params join_params;
size_t join_params_size;
@@ -1359,15 +1379,15 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
return -EOPNOTSUPP;
}
- set_bit(WL_STATUS_CONNECTING, &wl->status);
+ set_bit(WL_STATUS_CONNECTING, &cfg_priv->status);
if (chan) {
- wl->channel =
+ cfg_priv->channel =
ieee80211_frequency_to_channel(chan->center_freq);
WL_CONN("channel (%d), center_req (%d)\n",
- wl->channel, chan->center_freq);
+ cfg_priv->channel, chan->center_freq);
} else
- wl->channel = 0;
+ cfg_priv->channel = 0;
WL_INFO("ie (%p), ie_len (%zd)\n", sme->ie, sme->ie_len);
@@ -1401,7 +1421,7 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
goto done;
}
- brcmf_update_prof(wl, NULL, sme->bssid, WL_PROF_BSSID);
+ brcmf_update_prof(cfg_priv, NULL, sme->bssid, WL_PROF_BSSID);
/*
** Join with specific BSSID and cached SSID
** If SSID is zero join based on BSSID only
@@ -1412,7 +1432,7 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
join_params.ssid.SSID_len = min(sizeof(join_params.ssid.SSID), sme->ssid_len);
memcpy(&join_params.ssid.SSID, sme->ssid, join_params.ssid.SSID_len);
join_params.ssid.SSID_len = cpu_to_le32(join_params.ssid.SSID_len);
- brcmf_update_prof(wl, NULL, &join_params.ssid, WL_PROF_SSID);
+ brcmf_update_prof(cfg_priv, NULL, &join_params.ssid, WL_PROF_SSID);
if (sme->bssid)
memcpy(join_params.params.bssid, sme->bssid, ETH_ALEN);
@@ -1424,7 +1444,8 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
join_params.ssid.SSID, join_params.ssid.SSID_len);
}
- brcmf_ch_to_chanspec(wl->channel, &join_params, &join_params_size);
+ brcmf_ch_to_chanspec(cfg_priv->channel,
+ &join_params, &join_params_size);
err = brcmf_dev_ioctl(dev, BRCMF_C_SET_SSID,
&join_params, join_params_size);
if (err)
@@ -1432,7 +1453,7 @@ brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
done:
if (err)
- clear_bit(WL_STATUS_CONNECTING, &wl->status);
+ clear_bit(WL_STATUS_CONNECTING, &cfg_priv->status);
WL_TRACE("Exit\n");
return err;
}
@@ -1441,24 +1462,24 @@ static s32
brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
u16 reason_code)
{
- struct wl_priv *wl = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
struct brcmf_scb_val scbval;
s32 err = 0;
WL_TRACE("Enter. Reason code = %d\n", reason_code);
CHECK_SYS_UP();
- clear_bit(WL_STATUS_CONNECTED, &wl->status);
+ clear_bit(WL_STATUS_CONNECTED, &cfg_priv->status);
scbval.val = reason_code;
- memcpy(&scbval.ea, brcmf_read_prof(wl, WL_PROF_BSSID), ETH_ALEN);
+ memcpy(&scbval.ea, brcmf_read_prof(cfg_priv, WL_PROF_BSSID), ETH_ALEN);
scbval.val = cpu_to_le32(scbval.val);
err = brcmf_dev_ioctl(dev, BRCMF_C_DISASSOC, &scbval,
sizeof(struct brcmf_scb_val));
if (unlikely(err))
WL_ERR("error (%d)\n", err);
- wl->link_up = false;
+ cfg_priv->link_up = false;
WL_TRACE("Exit\n");
return err;
@@ -1469,8 +1490,8 @@ brcmf_cfg80211_set_tx_power(struct wiphy *wiphy,
enum nl80211_tx_power_setting type, s32 dbm)
{
- struct wl_priv *wl = wiphy_to_wl(wiphy);
- struct net_device *ndev = wl_to_ndev(wl);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct net_device *ndev = wl_to_ndev(cfg_priv);
u16 txpwrmw;
s32 err = 0;
s32 disable = 0;
@@ -1511,7 +1532,7 @@ brcmf_cfg80211_set_tx_power(struct wiphy *wiphy,
(s32) (brcmu_mw_to_qdbm(txpwrmw)));
if (unlikely(err))
WL_ERR("qtxpower error (%d)\n", err);
- wl->conf->tx_power = dbm;
+ cfg_priv->conf->tx_power = dbm;
done:
WL_TRACE("Exit\n");
@@ -1520,8 +1541,8 @@ done:
static s32 brcmf_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm)
{
- struct wl_priv *wl = wiphy_to_wl(wiphy);
- struct net_device *ndev = wl_to_ndev(wl);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct net_device *ndev = wl_to_ndev(cfg_priv);
s32 txpwrdbm;
u8 result;
s32 err = 0;
@@ -1829,8 +1850,8 @@ brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
{
struct key_params params;
struct brcmf_wsec_key key;
- struct wl_priv *wl = wiphy_to_wl(wiphy);
- struct wl_security *sec;
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_security *sec;
s32 wsec;
s32 err = 0;
@@ -1855,7 +1876,7 @@ brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
wsec = le32_to_cpu(wsec);
switch (wsec) {
case WEP_ENABLED:
- sec = brcmf_read_prof(wl, WL_PROF_SEC);
+ sec = brcmf_read_prof(cfg_priv, WL_PROF_SEC);
if (sec->cipher_pairwise & WLAN_CIPHER_SUITE_WEP40) {
params.cipher = WLAN_CIPHER_SUITE_WEP40;
WL_CONN("WLAN_CIPHER_SUITE_WEP40\n");
@@ -1898,12 +1919,12 @@ static s32
brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
u8 *mac, struct station_info *sinfo)
{
- struct wl_priv *wl = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
struct brcmf_scb_val scb_val;
int rssi;
s32 rate;
s32 err = 0;
- u8 *bssid = brcmf_read_prof(wl, WL_PROF_BSSID);
+ u8 *bssid = brcmf_read_prof(cfg_priv, WL_PROF_BSSID);
WL_TRACE("Enter\n");
CHECK_SYS_UP();
@@ -1930,7 +1951,7 @@ brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
WL_CONN("Rate %d Mbps\n", rate / 2);
}
- if (test_bit(WL_STATUS_CONNECTED, &wl->status)) {
+ if (test_bit(WL_STATUS_CONNECTED, &cfg_priv->status)) {
scb_val.val = 0;
err = brcmf_dev_ioctl(dev, BRCMF_C_GET_RSSI, &scb_val,
sizeof(struct brcmf_scb_val));
@@ -2061,7 +2082,7 @@ done:
static s32 brcmf_cfg80211_resume(struct wiphy *wiphy)
{
- struct wl_priv *wl = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
/*
* Check for WL_STATUS_READY before any function call which
@@ -2074,17 +2095,18 @@ static s32 brcmf_cfg80211_resume(struct wiphy *wiphy)
atomic_set(&brcmf_mmc_suspend, false);
#endif /* defined(CONFIG_PM_SLEEP) */
- if (test_bit(WL_STATUS_READY, &wl->status))
+ if (test_bit(WL_STATUS_READY, &cfg_priv->status))
brcmf_invoke_iscan(wiphy_to_wl(wiphy));
WL_TRACE("Exit\n");
return 0;
}
-static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow)
+static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy,
+ struct cfg80211_wowlan *wow)
{
- struct wl_priv *wl = wiphy_to_wl(wiphy);
- struct net_device *ndev = wl_to_ndev(wl);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct net_device *ndev = wl_to_ndev(cfg_priv);
WL_TRACE("Enter\n");
@@ -2098,12 +2120,12 @@ static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *w
* While going to suspend if associated with AP disassociate
* from AP to save power while system is in suspended state
*/
- if ((test_bit(WL_STATUS_CONNECTED, &wl->status) ||
- test_bit(WL_STATUS_CONNECTING, &wl->status)) &&
- test_bit(WL_STATUS_READY, &wl->status)) {
+ if ((test_bit(WL_STATUS_CONNECTED, &cfg_priv->status) ||
+ test_bit(WL_STATUS_CONNECTING, &cfg_priv->status)) &&
+ test_bit(WL_STATUS_READY, &cfg_priv->status)) {
WL_INFO("Disassociating from AP"
" while entering suspend state\n");
- brcmf_link_down(wl);
+ brcmf_link_down(cfg_priv);
/*
* Make sure WPA_Supplicant receives all the event
@@ -2115,21 +2137,21 @@ static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *w
rtnl_lock();
}
- set_bit(WL_STATUS_SCAN_ABORTING, &wl->status);
- if (test_bit(WL_STATUS_READY, &wl->status))
- brcmf_term_iscan(wl);
+ set_bit(WL_STATUS_SCAN_ABORTING, &cfg_priv->status);
+ if (test_bit(WL_STATUS_READY, &cfg_priv->status))
+ brcmf_term_iscan(cfg_priv);
- if (wl->scan_request) {
+ if (cfg_priv->scan_request) {
/* Indidate scan abort to cfg80211 layer */
WL_INFO("Terminating scan in progress\n");
- cfg80211_scan_done(wl->scan_request, true);
- wl->scan_request = NULL;
+ cfg80211_scan_done(cfg_priv->scan_request, true);
+ cfg_priv->scan_request = NULL;
}
- clear_bit(WL_STATUS_SCANNING, &wl->status);
- clear_bit(WL_STATUS_SCAN_ABORTING, &wl->status);
+ clear_bit(WL_STATUS_SCANNING, &cfg_priv->status);
+ clear_bit(WL_STATUS_SCAN_ABORTING, &cfg_priv->status);
/* Turn off watchdog timer */
- if (test_bit(WL_STATUS_READY, &wl->status)) {
+ if (test_bit(WL_STATUS_READY, &cfg_priv->status)) {
WL_INFO("Enable MPC\n");
brcmf_set_mpc(ndev, 1);
}
@@ -2144,8 +2166,8 @@ static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *w
}
static __used s32
-brcmf_update_pmklist(struct net_device *dev, struct wl_pmk_list *pmk_list,
- s32 err)
+brcmf_update_pmklist(struct net_device *dev,
+ struct brcmf_cfg80211_pmk_list *pmk_list, s32 err)
{
int i, j;
@@ -2166,37 +2188,33 @@ brcmf_update_pmklist(struct net_device *dev, struct wl_pmk_list *pmk_list,
static s32
brcmf_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev,
- struct cfg80211_pmksa *pmksa)
+ struct cfg80211_pmksa *pmksa)
{
- struct wl_priv *wl = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
+ struct _pmkid_list *pmkids = &cfg_priv->pmk_list->pmkids;
s32 err = 0;
int i;
WL_TRACE("Enter\n");
CHECK_SYS_UP();
- for (i = 0; i < wl->pmk_list->pmkids.npmkid; i++)
- if (!memcmp(pmksa->bssid, &wl->pmk_list->pmkids.pmkid[i].BSSID,
- ETH_ALEN))
+ for (i = 0; i < pmkids->npmkid; i++)
+ if (!memcmp(pmksa->bssid, pmkids->pmkid[i].BSSID, ETH_ALEN))
break;
if (i < WL_NUM_PMKIDS_MAX) {
- memcpy(&wl->pmk_list->pmkids.pmkid[i].BSSID, pmksa->bssid,
- ETH_ALEN);
- memcpy(&wl->pmk_list->pmkids.pmkid[i].PMKID, pmksa->pmkid,
- WLAN_PMKID_LEN);
- if (i == wl->pmk_list->pmkids.npmkid)
- wl->pmk_list->pmkids.npmkid++;
+ memcpy(pmkids->pmkid[i].BSSID, pmksa->bssid, ETH_ALEN);
+ memcpy(pmkids->pmkid[i].PMKID, pmksa->pmkid, WLAN_PMKID_LEN);
+ if (i == pmkids->npmkid)
+ pmkids->npmkid++;
} else
err = -EINVAL;
WL_CONN("set_pmksa,IW_PMKSA_ADD - PMKID: %pM =\n",
- &wl->pmk_list->pmkids.pmkid[wl->pmk_list->pmkids.npmkid].BSSID);
+ pmkids->pmkid[pmkids->npmkid].BSSID);
for (i = 0; i < WLAN_PMKID_LEN; i++)
- WL_CONN("%02x\n",
- wl->pmk_list->pmkids.pmkid[wl->pmk_list->pmkids.npmkid].
- PMKID[i]);
+ WL_CONN("%02x\n", pmkids->pmkid[pmkids->npmkid].PMKID[i]);
- err = brcmf_update_pmklist(dev, wl->pmk_list, err);
+ err = brcmf_update_pmklist(dev, cfg_priv->pmk_list, err);
WL_TRACE("Exit\n");
return err;
@@ -2206,7 +2224,7 @@ static s32
brcmf_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_pmksa *pmksa)
{
- struct wl_priv *wl = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
struct _pmkid_list pmkid;
s32 err = 0;
int i;
@@ -2221,28 +2239,29 @@ brcmf_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
for (i = 0; i < WLAN_PMKID_LEN; i++)
WL_CONN("%02x\n", pmkid.pmkid[0].PMKID[i]);
- for (i = 0; i < wl->pmk_list->pmkids.npmkid; i++)
+ for (i = 0; i < cfg_priv->pmk_list->pmkids.npmkid; i++)
if (!memcmp
- (pmksa->bssid, &wl->pmk_list->pmkids.pmkid[i].BSSID,
+ (pmksa->bssid, &cfg_priv->pmk_list->pmkids.pmkid[i].BSSID,
ETH_ALEN))
break;
- if ((wl->pmk_list->pmkids.npmkid > 0)
- && (i < wl->pmk_list->pmkids.npmkid)) {
- memset(&wl->pmk_list->pmkids.pmkid[i], 0, sizeof(pmkid_t));
- for (; i < (wl->pmk_list->pmkids.npmkid - 1); i++) {
- memcpy(&wl->pmk_list->pmkids.pmkid[i].BSSID,
- &wl->pmk_list->pmkids.pmkid[i + 1].BSSID,
+ if ((cfg_priv->pmk_list->pmkids.npmkid > 0)
+ && (i < cfg_priv->pmk_list->pmkids.npmkid)) {
+ memset(&cfg_priv->pmk_list->pmkids.pmkid[i], 0,
+ sizeof(pmkid_t));
+ for (; i < (cfg_priv->pmk_list->pmkids.npmkid - 1); i++) {
+ memcpy(&cfg_priv->pmk_list->pmkids.pmkid[i].BSSID,
+ &cfg_priv->pmk_list->pmkids.pmkid[i + 1].BSSID,
ETH_ALEN);
- memcpy(&wl->pmk_list->pmkids.pmkid[i].PMKID,
- &wl->pmk_list->pmkids.pmkid[i + 1].PMKID,
+ memcpy(&cfg_priv->pmk_list->pmkids.pmkid[i].PMKID,
+ &cfg_priv->pmk_list->pmkids.pmkid[i + 1].PMKID,
WLAN_PMKID_LEN);
}
- wl->pmk_list->pmkids.npmkid--;
+ cfg_priv->pmk_list->pmkids.npmkid--;
} else
err = -EINVAL;
- err = brcmf_update_pmklist(dev, wl->pmk_list, err);
+ err = brcmf_update_pmklist(dev, cfg_priv->pmk_list, err);
WL_TRACE("Exit\n");
return err;
@@ -2252,14 +2271,14 @@ brcmf_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
static s32
brcmf_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *dev)
{
- struct wl_priv *wl = wiphy_to_wl(wiphy);
+ struct brcmf_cfg80211_priv *cfg_priv = wiphy_to_wl(wiphy);
s32 err = 0;
WL_TRACE("Enter\n");
CHECK_SYS_UP();
- memset(wl->pmk_list, 0, sizeof(*wl->pmk_list));
- err = brcmf_update_pmklist(dev, wl->pmk_list, err);
+ memset(cfg_priv->pmk_list, 0, sizeof(*cfg_priv->pmk_list));
+ err = brcmf_update_pmklist(dev, cfg_priv->pmk_list, err);
WL_TRACE("Exit\n");
return err;
@@ -2319,7 +2338,8 @@ static struct wireless_dev *brcmf_alloc_wdev(s32 sizeof_iface,
return ERR_PTR(-ENOMEM);
}
wdev->wiphy =
- wiphy_new(&wl_cfg80211_ops, sizeof(struct wl_priv) + sizeof_iface);
+ wiphy_new(&wl_cfg80211_ops,
+ sizeof(struct brcmf_cfg80211_priv) + sizeof_iface);
if (unlikely(!wdev->wiphy)) {
WL_ERR("Couldn not allocate wiphy device\n");
err = -ENOMEM;
@@ -2365,9 +2385,9 @@ wiphy_new_out:
return ERR_PTR(err);
}
-static void brcmf_free_wdev(struct wl_priv *wl)
+static void brcmf_free_wdev(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct wireless_dev *wdev = wl_to_wdev(wl);
+ struct wireless_dev *wdev = wl_to_wdev(cfg_priv);
if (unlikely(!wdev)) {
WL_ERR("wdev is invalid\n");
@@ -2376,17 +2396,17 @@ static void brcmf_free_wdev(struct wl_priv *wl)
wiphy_unregister(wdev->wiphy);
wiphy_free(wdev->wiphy);
kfree(wdev);
- wl_to_wdev(wl) = NULL;
+ wl_to_wdev(cfg_priv) = NULL;
}
-static s32 brcmf_inform_bss(struct wl_priv *wl)
+static s32 brcmf_inform_bss(struct brcmf_cfg80211_priv *cfg_priv)
{
struct brcmf_scan_results *bss_list;
struct brcmf_bss_info *bi = NULL; /* must be initialized */
s32 err = 0;
int i;
- bss_list = wl->bss_list;
+ bss_list = cfg_priv->bss_list;
if (unlikely(bss_list->version != BRCMF_BSS_INFO_VERSION)) {
WL_ERR("Version %d != WL_BSS_INFO_VERSION\n",
bss_list->version);
@@ -2395,7 +2415,7 @@ static s32 brcmf_inform_bss(struct wl_priv *wl)
WL_SCAN("scanned AP count (%d)\n", bss_list->count);
bi = next_bss(bss_list, bi);
for_each_bss(bss_list, bi, i) {
- err = brcmf_inform_single_bss(wl, bi);
+ err = brcmf_inform_single_bss(cfg_priv, bi);
if (unlikely(err))
break;
}
@@ -2403,9 +2423,10 @@ static s32 brcmf_inform_bss(struct wl_priv *wl)
}
-static s32 brcmf_inform_single_bss(struct wl_priv *wl, struct brcmf_bss_info *bi)
+static s32 brcmf_inform_single_bss(struct brcmf_cfg80211_priv *cfg_priv,
+ struct brcmf_bss_info *bi)
{
- struct wiphy *wiphy = wl_to_wiphy(wl);
+ struct wiphy *wiphy = wl_to_wiphy(cfg_priv);
struct ieee80211_channel *notify_channel;
struct cfg80211_bss *bss;
struct ieee80211_supported_band *band;
@@ -2463,10 +2484,10 @@ static s32 brcmf_inform_single_bss(struct wl_priv *wl, struct brcmf_bss_info *bi
return err;
}
-static s32
-wl_inform_ibss(struct wl_priv *wl, struct net_device *dev, const u8 *bssid)
+static s32 wl_inform_ibss(struct brcmf_cfg80211_priv *cfg_priv,
+ struct net_device *dev, const u8 *bssid)
{
- struct wiphy *wiphy = wl_to_wiphy(wl);
+ struct wiphy *wiphy = wl_to_wiphy(cfg_priv);
struct ieee80211_channel *notify_channel;
struct brcmf_bss_info *bi = NULL;
struct ieee80211_supported_band *band;
@@ -2537,21 +2558,23 @@ CleanUp:
return err;
}
-static bool brcmf_is_linkup(struct wl_priv *wl, const struct brcmf_event_msg *e)
+static bool brcmf_is_linkup(struct brcmf_cfg80211_priv *cfg_priv,
+ const struct brcmf_event_msg *e)
{
u32 event = be32_to_cpu(e->event_type);
u32 status = be32_to_cpu(e->status);
if (event == BRCMF_E_SET_SSID && status == BRCMF_E_STATUS_SUCCESS) {
WL_CONN("Processing set ssid\n");
- wl->link_up = true;
+ cfg_priv->link_up = true;
return true;
}
return false;
}
-static bool brcmf_is_linkdown(struct wl_priv *wl, const struct brcmf_event_msg *e)
+static bool brcmf_is_linkdown(struct brcmf_cfg80211_priv *cfg_priv,
+ const struct brcmf_event_msg *e)
{
u32 event = be32_to_cpu(e->event_type);
u16 flags = be16_to_cpu(e->flags);
@@ -2563,7 +2586,8 @@ static bool brcmf_is_linkdown(struct wl_priv *wl, const struct brcmf_event_msg *
return false;
}
-static bool brcmf_is_nonetwork(struct wl_priv *wl, const struct brcmf_event_msg *e)
+static bool brcmf_is_nonetwork(struct brcmf_cfg80211_priv *cfg_priv,
+ const struct brcmf_event_msg *e)
{
u32 event = be32_to_cpu(e->event_type);
u32 status = be32_to_cpu(e->status);
@@ -2584,51 +2608,53 @@ static bool brcmf_is_nonetwork(struct wl_priv *wl, const struct brcmf_event_msg
}
static s32
-brcmf_notify_connect_status(struct wl_priv *wl, struct net_device *ndev,
+brcmf_notify_connect_status(struct brcmf_cfg80211_priv *cfg_priv,
+ struct net_device *ndev,
const struct brcmf_event_msg *e, void *data)
{
s32 err = 0;
- if (brcmf_is_linkup(wl, e)) {
+ if (brcmf_is_linkup(cfg_priv, e)) {
WL_CONN("Linkup\n");
- if (brcmf_is_ibssmode(wl)) {
- brcmf_update_prof(wl, NULL, (void *)e->addr,
+ if (brcmf_is_ibssmode(cfg_priv)) {
+ brcmf_update_prof(cfg_priv, NULL, (void *)e->addr,
WL_PROF_BSSID);
- wl_inform_ibss(wl, ndev, e->addr);
+ wl_inform_ibss(cfg_priv, ndev, e->addr);
cfg80211_ibss_joined(ndev, e->addr, GFP_KERNEL);
- clear_bit(WL_STATUS_CONNECTING, &wl->status);
- set_bit(WL_STATUS_CONNECTED, &wl->status);
+ clear_bit(WL_STATUS_CONNECTING, &cfg_priv->status);
+ set_bit(WL_STATUS_CONNECTED, &cfg_priv->status);
} else
- brcmf_bss_connect_done(wl, ndev, e, data, true);
- } else if (brcmf_is_linkdown(wl, e)) {
+ brcmf_bss_connect_done(cfg_priv, ndev, e, data, true);
+ } else if (brcmf_is_linkdown(cfg_priv, e)) {
WL_CONN("Linkdown\n");
- if (brcmf_is_ibssmode(wl)) {
- clear_bit(WL_STATUS_CONNECTING, &wl->status);
+ if (brcmf_is_ibssmode(cfg_priv)) {
+ clear_bit(WL_STATUS_CONNECTING, &cfg_priv->status);
if (test_and_clear_bit(WL_STATUS_CONNECTED,
- &wl->status))
- brcmf_link_down(wl);
+ &cfg_priv->status))
+ brcmf_link_down(cfg_priv);
} else {
- brcmf_bss_connect_done(wl, ndev, e, data, false);
+ brcmf_bss_connect_done(cfg_priv, ndev, e, data, false);
if (test_and_clear_bit(WL_STATUS_CONNECTED,
- &wl->status)) {
+ &cfg_priv->status)) {
cfg80211_disconnected(ndev, 0, NULL, 0,
GFP_KERNEL);
- brcmf_link_down(wl);
+ brcmf_link_down(cfg_priv);
}
}
- brcmf_init_prof(wl->profile);
- } else if (brcmf_is_nonetwork(wl, e)) {
- if (brcmf_is_ibssmode(wl))
- clear_bit(WL_STATUS_CONNECTING, &wl->status);
+ brcmf_init_prof(cfg_priv->profile);
+ } else if (brcmf_is_nonetwork(cfg_priv, e)) {
+ if (brcmf_is_ibssmode(cfg_priv))
+ clear_bit(WL_STATUS_CONNECTING, &cfg_priv->status);
else
- brcmf_bss_connect_done(wl, ndev, e, data, false);
+ brcmf_bss_connect_done(cfg_priv, ndev, e, data, false);
}
return err;
}
static s32
-brcmf_notify_roaming_status(struct wl_priv *wl, struct net_device *ndev,
+brcmf_notify_roaming_status(struct brcmf_cfg80211_priv *cfg_priv,
+ struct net_device *ndev,
const struct brcmf_event_msg *e, void *data)
{
s32 err = 0;
@@ -2636,10 +2662,10 @@ brcmf_notify_roaming_status(struct wl_priv *wl, struct net_device *ndev,
u32 status = be32_to_cpu(e->status);
if (event == BRCMF_E_ROAM && status == BRCMF_E_STATUS_SUCCESS) {
- if (test_bit(WL_STATUS_CONNECTED, &wl->status))
- brcmf_bss_roaming_done(wl, ndev, e, data);
+ if (test_bit(WL_STATUS_CONNECTED, &cfg_priv->status))
+ brcmf_bss_roaming_done(cfg_priv, ndev, e, data);
else
- brcmf_bss_connect_done(wl, ndev, e, data, true);
+ brcmf_bss_connect_done(cfg_priv, ndev, e, data, true);
}
return err;
@@ -2648,80 +2674,87 @@ brcmf_notify_roaming_status(struct wl_priv *wl, struct net_device *ndev,
static __used s32
brcmf_dev_bufvar_set(struct net_device *dev, s8 *name, s8 *buf, s32 len)
{
- struct wl_priv *wl = ndev_to_wl(dev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
u32 buflen;
- buflen = brcmu_mkiovar(name, buf, len, wl->ioctl_buf, WL_IOCTL_LEN_MAX);
+ buflen = brcmu_mkiovar(name, buf, len, cfg_priv->ioctl_buf,
+ WL_IOCTL_LEN_MAX);
BUG_ON(!buflen);
- return brcmf_dev_ioctl(dev, BRCMF_C_SET_VAR, wl->ioctl_buf, buflen);
+ return brcmf_dev_ioctl(dev, BRCMF_C_SET_VAR, cfg_priv->ioctl_buf,
+ buflen);
}
static s32
brcmf_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
s32 buf_len)
{
- struct wl_priv *wl = ndev_to_wl(dev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(dev);
u32 len;
s32 err = 0;
- len = brcmu_mkiovar(name, NULL, 0, wl->ioctl_buf, WL_IOCTL_LEN_MAX);
+ len = brcmu_mkiovar(name, NULL, 0, cfg_priv->ioctl_buf,
+ WL_IOCTL_LEN_MAX);
BUG_ON(!len);
- err = brcmf_dev_ioctl(dev, BRCMF_C_GET_VAR, (void *)wl->ioctl_buf,
+ err = brcmf_dev_ioctl(dev, BRCMF_C_GET_VAR, (void *)cfg_priv->ioctl_buf,
WL_IOCTL_LEN_MAX);
if (unlikely(err)) {
WL_ERR("error (%d)\n", err);
return err;
}
- memcpy(buf, wl->ioctl_buf, buf_len);
+ memcpy(buf, cfg_priv->ioctl_buf, buf_len);
return err;
}
-static s32 brcmf_get_assoc_ies(struct wl_priv *wl)
+static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct net_device *ndev = wl_to_ndev(wl);
- struct wl_assoc_ielen *assoc_info;
- struct wl_connect_info *conn_info = wl_to_conn(wl);
+ struct net_device *ndev = wl_to_ndev(cfg_priv);
+ struct brcmf_cfg80211_assoc_ielen *assoc_info;
+ struct brcmf_cfg80211_connect_info *conn_info = wl_to_conn(cfg_priv);
u32 req_len;
u32 resp_len;
s32 err = 0;
- brcmf_clear_assoc_ies(wl);
+ brcmf_clear_assoc_ies(cfg_priv);
- err = brcmf_dev_bufvar_get(ndev, "assoc_info", wl->extra_buf,
+ err = brcmf_dev_bufvar_get(ndev, "assoc_info", cfg_priv->extra_buf,
WL_ASSOC_INFO_MAX);
if (unlikely(err)) {
WL_ERR("could not get assoc info (%d)\n", err);
return err;
}
- assoc_info = (struct wl_assoc_ielen *)wl->extra_buf;
+ assoc_info = (struct brcmf_cfg80211_assoc_ielen *)cfg_priv->extra_buf;
req_len = assoc_info->req_len;
resp_len = assoc_info->resp_len;
if (req_len) {
- err = brcmf_dev_bufvar_get(ndev, "assoc_req_ies", wl->extra_buf,
- WL_ASSOC_INFO_MAX);
+ err = brcmf_dev_bufvar_get(ndev, "assoc_req_ies",
+ cfg_priv->extra_buf,
+ WL_ASSOC_INFO_MAX);
if (unlikely(err)) {
WL_ERR("could not get assoc req (%d)\n", err);
return err;
}
conn_info->req_ie_len = req_len;
conn_info->req_ie =
- kmemdup(wl->extra_buf, conn_info->req_ie_len, GFP_KERNEL);
+ kmemdup(cfg_priv->extra_buf, conn_info->req_ie_len,
+ GFP_KERNEL);
} else {
conn_info->req_ie_len = 0;
conn_info->req_ie = NULL;
}
if (resp_len) {
- err = brcmf_dev_bufvar_get(ndev, "assoc_resp_ies", wl->extra_buf,
- WL_ASSOC_INFO_MAX);
+ err = brcmf_dev_bufvar_get(ndev, "assoc_resp_ies",
+ cfg_priv->extra_buf,
+ WL_ASSOC_INFO_MAX);
if (unlikely(err)) {
WL_ERR("could not get assoc resp (%d)\n", err);
return err;
}
conn_info->resp_ie_len = resp_len;
conn_info->resp_ie =
- kmemdup(wl->extra_buf, conn_info->resp_ie_len, GFP_KERNEL);
+ kmemdup(cfg_priv->extra_buf, conn_info->resp_ie_len,
+ GFP_KERNEL);
} else {
conn_info->resp_ie_len = 0;
conn_info->resp_ie = NULL;
@@ -2732,9 +2765,9 @@ static s32 brcmf_get_assoc_ies(struct wl_priv *wl)
return err;
}
-static void brcmf_clear_assoc_ies(struct wl_priv *wl)
+static void brcmf_clear_assoc_ies(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct wl_connect_info *conn_info = wl_to_conn(wl);
+ struct brcmf_cfg80211_connect_info *conn_info = wl_to_conn(cfg_priv);
kfree(conn_info->req_ie);
conn_info->req_ie = NULL;
@@ -2779,7 +2812,7 @@ static void brcmf_ch_to_chanspec(int ch, struct brcmf_join_params *join_params,
}
}
-static s32 brcmf_update_bss_info(struct wl_priv *wl)
+static s32 brcmf_update_bss_info(struct brcmf_cfg80211_priv *cfg_priv)
{
struct brcmf_bss_info *bi;
struct brcmf_ssid *ssid;
@@ -2791,21 +2824,21 @@ static s32 brcmf_update_bss_info(struct wl_priv *wl)
s32 err = 0;
WL_TRACE("Enter\n");
- if (brcmf_is_ibssmode(wl))
+ if (brcmf_is_ibssmode(cfg_priv))
return err;
- ssid = (struct brcmf_ssid *)brcmf_read_prof(wl, WL_PROF_SSID);
+ ssid = (struct brcmf_ssid *)brcmf_read_prof(cfg_priv, WL_PROF_SSID);
- *(u32 *)wl->extra_buf = cpu_to_le32(WL_EXTRA_BUF_MAX);
- err = brcmf_dev_ioctl(wl_to_ndev(wl), BRCMF_C_GET_BSS_INFO,
- wl->extra_buf, WL_EXTRA_BUF_MAX);
+ *(u32 *)cfg_priv->extra_buf = cpu_to_le32(WL_EXTRA_BUF_MAX);
+ err = brcmf_dev_ioctl(wl_to_ndev(cfg_priv), BRCMF_C_GET_BSS_INFO,
+ cfg_priv->extra_buf, WL_EXTRA_BUF_MAX);
if (unlikely(err)) {
WL_ERR("Could not get bss info %d\n", err);
goto update_bss_info_out;
}
- bi = (struct brcmf_bss_info *)(wl->extra_buf + 4);
- err = brcmf_inform_single_bss(wl, bi);
+ bi = (struct brcmf_bss_info *)(cfg_priv->extra_buf + 4);
+ err = brcmf_inform_single_bss(cfg_priv, bi);
if (unlikely(err))
goto update_bss_info_out;
@@ -2823,7 +2856,8 @@ static s32 brcmf_update_bss_info(struct wl_priv *wl)
* so we speficially query dtim information to dongle.
*/
u32 var;
- err = brcmf_dev_intvar_get(wl_to_ndev(wl), "dtim_assoc", &var);
+ err = brcmf_dev_intvar_get(wl_to_ndev(cfg_priv),
+ "dtim_assoc", &var);
if (unlikely(err)) {
WL_ERR("wl dtim_assoc failed (%d)\n", err);
goto update_bss_info_out;
@@ -2831,8 +2865,8 @@ static s32 brcmf_update_bss_info(struct wl_priv *wl)
dtim_period = (u8)var;
}
- brcmf_update_prof(wl, NULL, &beacon_interval, WL_PROF_BEACONINT);
- brcmf_update_prof(wl, NULL, &dtim_period, WL_PROF_DTIMPERIOD);
+ brcmf_update_prof(cfg_priv, NULL, &beacon_interval, WL_PROF_BEACONINT);
+ brcmf_update_prof(cfg_priv, NULL, &dtim_period, WL_PROF_DTIMPERIOD);
update_bss_info_out:
WL_TRACE("Exit");
@@ -2840,54 +2874,59 @@ update_bss_info_out:
}
static s32
-brcmf_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
+brcmf_bss_roaming_done(struct brcmf_cfg80211_priv *cfg_priv,
+ struct net_device *ndev,
const struct brcmf_event_msg *e, void *data)
{
- struct wl_connect_info *conn_info = wl_to_conn(wl);
+ struct brcmf_cfg80211_connect_info *conn_info = wl_to_conn(cfg_priv);
s32 err = 0;
WL_TRACE("Enter\n");
- brcmf_get_assoc_ies(wl);
- brcmf_update_prof(wl, NULL, &e->addr, WL_PROF_BSSID);
- brcmf_update_bss_info(wl);
+ brcmf_get_assoc_ies(cfg_priv);
+ brcmf_update_prof(cfg_priv, NULL, &e->addr, WL_PROF_BSSID);
+ brcmf_update_bss_info(cfg_priv);
cfg80211_roamed(ndev, NULL,
- (u8 *)brcmf_read_prof(wl, WL_PROF_BSSID),
+ (u8 *)brcmf_read_prof(cfg_priv, WL_PROF_BSSID),
conn_info->req_ie, conn_info->req_ie_len,
conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL);
WL_CONN("Report roaming result\n");
- set_bit(WL_STATUS_CONNECTED, &wl->status);
+ set_bit(WL_STATUS_CONNECTED, &cfg_priv->status);
WL_TRACE("Exit\n");
return err;
}
static s32
-brcmf_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
- const struct brcmf_event_msg *e, void *data, bool completed)
+brcmf_bss_connect_done(struct brcmf_cfg80211_priv *cfg_priv,
+ struct net_device *ndev, const struct brcmf_event_msg *e,
+ void *data, bool completed)
{
- struct wl_connect_info *conn_info = wl_to_conn(wl);
+ struct brcmf_cfg80211_connect_info *conn_info = wl_to_conn(cfg_priv);
s32 err = 0;
WL_TRACE("Enter\n");
- if (test_and_clear_bit(WL_STATUS_CONNECTING, &wl->status)) {
+ if (test_and_clear_bit(WL_STATUS_CONNECTING, &cfg_priv->status)) {
if (completed) {
- brcmf_get_assoc_ies(wl);
- brcmf_update_prof(wl, NULL, &e->addr, WL_PROF_BSSID);
- brcmf_update_bss_info(wl);
+ brcmf_get_assoc_ies(cfg_priv);
+ brcmf_update_prof(cfg_priv, NULL, &e->addr,
+ WL_PROF_BSSID);
+ brcmf_update_bss_info(cfg_priv);
}
cfg80211_connect_result(ndev,
- (u8 *)brcmf_read_prof(wl, WL_PROF_BSSID),
+ (u8 *)brcmf_read_prof(cfg_priv,
+ WL_PROF_BSSID),
conn_info->req_ie,
conn_info->req_ie_len,
conn_info->resp_ie,
conn_info->resp_ie_len,
- completed ? WLAN_STATUS_SUCCESS : WLAN_STATUS_AUTH_TIMEOUT,
+ completed ? WLAN_STATUS_SUCCESS :
+ WLAN_STATUS_AUTH_TIMEOUT,
GFP_KERNEL);
if (completed)
- set_bit(WL_STATUS_CONNECTED, &wl->status);
+ set_bit(WL_STATUS_CONNECTED, &cfg_priv->status);
WL_CONN("Report connect result - connection %s\n",
completed ? "succeeded" : "failed");
}
@@ -2896,7 +2935,8 @@ brcmf_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
}
static s32
-brcmf_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
+brcmf_notify_mic_status(struct brcmf_cfg80211_priv *cfg_priv,
+ struct net_device *ndev,
const struct brcmf_event_msg *e, void *data)
{
u16 flags = be16_to_cpu(e->flags);
@@ -2916,7 +2956,8 @@ brcmf_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
}
static s32
-brcmf_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
+brcmf_notify_scan_status(struct brcmf_cfg80211_priv *cfg_priv,
+ struct net_device *ndev,
const struct brcmf_event_msg *e, void *data)
{
struct brcmf_channel_info channel_inform;
@@ -2927,12 +2968,13 @@ brcmf_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
WL_TRACE("Enter\n");
- if (wl->iscan_on && wl->iscan_kickstart) {
+ if (cfg_priv->iscan_on && cfg_priv->iscan_kickstart) {
WL_TRACE("Exit\n");
- return brcmf_wakeup_iscan(wl_to_iscan(wl));
+ return brcmf_wakeup_iscan(wl_to_iscan(cfg_priv));
}
- if (unlikely(!test_and_clear_bit(WL_STATUS_SCANNING, &wl->status))) {
+ if (unlikely(!test_and_clear_bit(WL_STATUS_SCANNING,
+ &cfg_priv->status))) {
WL_ERR("Scan complete while device not scanning\n");
scan_abort = true;
err = -EINVAL;
@@ -2952,8 +2994,8 @@ brcmf_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
WL_CONN("channel_inform.scan_channel (%d)\n",
channel_inform.scan_channel);
}
- wl->bss_list = wl->scan_results;
- bss_list = wl->bss_list;
+ cfg_priv->bss_list = cfg_priv->scan_results;
+ bss_list = cfg_priv->bss_list;
memset(bss_list, 0, len);
bss_list->buflen = cpu_to_le32(len);
@@ -2968,18 +3010,18 @@ brcmf_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
bss_list->version = le32_to_cpu(bss_list->version);
bss_list->count = le32_to_cpu(bss_list->count);
- err = brcmf_inform_bss(wl);
+ err = brcmf_inform_bss(cfg_priv);
if (err) {
scan_abort = true;
goto scan_done_out;
}
scan_done_out:
- if (wl->scan_request) {
+ if (cfg_priv->scan_request) {
WL_SCAN("calling cfg80211_scan_done\n");
- cfg80211_scan_done(wl->scan_request, scan_abort);
+ cfg80211_scan_done(cfg_priv->scan_request, scan_abort);
brcmf_set_mpc(ndev, 1);
- wl->scan_request = NULL;
+ cfg_priv->scan_request = NULL;
}
WL_TRACE("Exit\n");
@@ -2987,7 +3029,7 @@ scan_done_out:
return err;
}
-static void brcmf_init_conf(struct wl_conf *conf)
+static void brcmf_init_conf(struct brcmf_cfg80211_conf *conf)
{
conf->mode = (u32)-1;
conf->frag_threshold = (u32)-1;
@@ -2997,12 +3039,12 @@ static void brcmf_init_conf(struct wl_conf *conf)
conf->tx_power = -1;
}
-static void brcmf_init_prof(struct wl_profile *prof)
+static void brcmf_init_prof(struct brcmf_cfg80211_profile *prof)
{
memset(prof, 0, sizeof(*prof));
}
-static void brcmf_init_eloop_handler(struct wl_event_loop *el)
+static void brcmf_init_eloop_handler(struct brcmf_cfg80211_event_loop *el)
{
memset(el, 0, sizeof(*el));
el->handler[BRCMF_E_SCAN_COMPLETE] = brcmf_notify_scan_status;
@@ -3012,50 +3054,51 @@ static void brcmf_init_eloop_handler(struct wl_event_loop *el)
el->handler[BRCMF_E_SET_SSID] = brcmf_notify_connect_status;
}
-static s32 brcmf_init_priv_mem(struct wl_priv *wl)
+static s32 brcmf_init_priv_mem(struct brcmf_cfg80211_priv *cfg_priv)
{
- wl->scan_results = kzalloc(WL_SCAN_BUF_MAX, GFP_KERNEL);
- if (unlikely(!wl->scan_results)) {
+ cfg_priv->scan_results = kzalloc(WL_SCAN_BUF_MAX, GFP_KERNEL);
+ if (unlikely(!cfg_priv->scan_results)) {
WL_ERR("Scan results alloc failed\n");
goto init_priv_mem_out;
}
- wl->conf = kzalloc(sizeof(*wl->conf), GFP_KERNEL);
- if (unlikely(!wl->conf)) {
+ cfg_priv->conf = kzalloc(sizeof(*cfg_priv->conf), GFP_KERNEL);
+ if (unlikely(!cfg_priv->conf)) {
WL_ERR("wl_conf alloc failed\n");
goto init_priv_mem_out;
}
- wl->profile = kzalloc(sizeof(*wl->profile), GFP_KERNEL);
- if (unlikely(!wl->profile)) {
+ cfg_priv->profile = kzalloc(sizeof(*cfg_priv->profile), GFP_KERNEL);
+ if (unlikely(!cfg_priv->profile)) {
WL_ERR("wl_profile alloc failed\n");
goto init_priv_mem_out;
}
- wl->bss_info = kzalloc(WL_BSS_INFO_MAX, GFP_KERNEL);
- if (unlikely(!wl->bss_info)) {
+ cfg_priv->bss_info = kzalloc(WL_BSS_INFO_MAX, GFP_KERNEL);
+ if (unlikely(!cfg_priv->bss_info)) {
WL_ERR("Bss information alloc failed\n");
goto init_priv_mem_out;
}
- wl->scan_req_int = kzalloc(sizeof(*wl->scan_req_int), GFP_KERNEL);
- if (unlikely(!wl->scan_req_int)) {
+ cfg_priv->scan_req_int = kzalloc(sizeof(*cfg_priv->scan_req_int),
+ GFP_KERNEL);
+ if (unlikely(!cfg_priv->scan_req_int)) {
WL_ERR("Scan req alloc failed\n");
goto init_priv_mem_out;
}
- wl->ioctl_buf = kzalloc(WL_IOCTL_LEN_MAX, GFP_KERNEL);
- if (unlikely(!wl->ioctl_buf)) {
+ cfg_priv->ioctl_buf = kzalloc(WL_IOCTL_LEN_MAX, GFP_KERNEL);
+ if (unlikely(!cfg_priv->ioctl_buf)) {
WL_ERR("Ioctl buf alloc failed\n");
goto init_priv_mem_out;
}
- wl->extra_buf = kzalloc(WL_EXTRA_BUF_MAX, GFP_KERNEL);
- if (unlikely(!wl->extra_buf)) {
+ cfg_priv->extra_buf = kzalloc(WL_EXTRA_BUF_MAX, GFP_KERNEL);
+ if (unlikely(!cfg_priv->extra_buf)) {
WL_ERR("Extra buf alloc failed\n");
goto init_priv_mem_out;
}
- wl->iscan = kzalloc(sizeof(*wl->iscan), GFP_KERNEL);
- if (unlikely(!wl->iscan)) {
+ cfg_priv->iscan = kzalloc(sizeof(*cfg_priv->iscan), GFP_KERNEL);
+ if (unlikely(!cfg_priv->iscan)) {
WL_ERR("Iscan buf alloc failed\n");
goto init_priv_mem_out;
}
- wl->pmk_list = kzalloc(sizeof(*wl->pmk_list), GFP_KERNEL);
- if (unlikely(!wl->pmk_list)) {
+ cfg_priv->pmk_list = kzalloc(sizeof(*cfg_priv->pmk_list), GFP_KERNEL);
+ if (unlikely(!cfg_priv->pmk_list)) {
WL_ERR("pmk list alloc failed\n");
goto init_priv_mem_out;
}
@@ -3063,59 +3106,60 @@ static s32 brcmf_init_priv_mem(struct wl_priv *wl)
return 0;
init_priv_mem_out:
- brcmf_deinit_priv_mem(wl);
+ brcmf_deinit_priv_mem(cfg_priv);
return -ENOMEM;
}
-static void brcmf_deinit_priv_mem(struct wl_priv *wl)
-{
- kfree(wl->scan_results);
- wl->scan_results = NULL;
- kfree(wl->bss_info);
- wl->bss_info = NULL;
- kfree(wl->conf);
- wl->conf = NULL;
- kfree(wl->profile);
- wl->profile = NULL;
- kfree(wl->scan_req_int);
- wl->scan_req_int = NULL;
- kfree(wl->ioctl_buf);
- wl->ioctl_buf = NULL;
- kfree(wl->extra_buf);
- wl->extra_buf = NULL;
- kfree(wl->iscan);
- wl->iscan = NULL;
- kfree(wl->pmk_list);
- wl->pmk_list = NULL;
-}
-
-static s32 brcmf_create_event_handler(struct wl_priv *wl)
-{
- sema_init(&wl->event_sync, 0);
- wl->event_tsk = kthread_run(brcmf_event_handler, wl, "wl_event_handler");
- if (IS_ERR(wl->event_tsk)) {
- wl->event_tsk = NULL;
+static void brcmf_deinit_priv_mem(struct brcmf_cfg80211_priv *cfg_priv)
+{
+ kfree(cfg_priv->scan_results);
+ cfg_priv->scan_results = NULL;
+ kfree(cfg_priv->bss_info);
+ cfg_priv->bss_info = NULL;
+ kfree(cfg_priv->conf);
+ cfg_priv->conf = NULL;
+ kfree(cfg_priv->profile);
+ cfg_priv->profile = NULL;
+ kfree(cfg_priv->scan_req_int);
+ cfg_priv->scan_req_int = NULL;
+ kfree(cfg_priv->ioctl_buf);
+ cfg_priv->ioctl_buf = NULL;
+ kfree(cfg_priv->extra_buf);
+ cfg_priv->extra_buf = NULL;
+ kfree(cfg_priv->iscan);
+ cfg_priv->iscan = NULL;
+ kfree(cfg_priv->pmk_list);
+ cfg_priv->pmk_list = NULL;
+}
+
+static s32 brcmf_create_event_handler(struct brcmf_cfg80211_priv *cfg_priv)
+{
+ sema_init(&cfg_priv->event_sync, 0);
+ cfg_priv->event_tsk = kthread_run(brcmf_event_handler, cfg_priv,
+ "wl_event_handler");
+ if (IS_ERR(cfg_priv->event_tsk)) {
+ cfg_priv->event_tsk = NULL;
WL_ERR("failed to create event thread\n");
return -ENOMEM;
}
return 0;
}
-static void brcmf_destroy_event_handler(struct wl_priv *wl)
+static void brcmf_destroy_event_handler(struct brcmf_cfg80211_priv *cfg_priv)
{
- if (wl->event_tsk) {
- send_sig(SIGTERM, wl->event_tsk, 1);
- kthread_stop(wl->event_tsk);
- wl->event_tsk = NULL;
+ if (cfg_priv->event_tsk) {
+ send_sig(SIGTERM, cfg_priv->event_tsk, 1);
+ kthread_stop(cfg_priv->event_tsk);
+ cfg_priv->event_tsk = NULL;
}
}
-static void brcmf_term_iscan(struct wl_priv *wl)
+static void brcmf_term_iscan(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct wl_iscan_ctrl *iscan = wl_to_iscan(wl);
+ struct brcmf_cfg80211_iscan_ctrl *iscan = wl_to_iscan(cfg_priv);
- if (wl->iscan_on && iscan->tsk) {
+ if (cfg_priv->iscan_on && iscan->tsk) {
iscan->state = WL_ISCAN_STATE_IDLE;
send_sig(SIGTERM, iscan->tsk, 1);
kthread_stop(iscan->tsk);
@@ -3123,26 +3167,28 @@ static void brcmf_term_iscan(struct wl_priv *wl)
}
}
-static void brcmf_notify_iscan_complete(struct wl_iscan_ctrl *iscan, bool aborted)
+static void brcmf_notify_iscan_complete(struct brcmf_cfg80211_iscan_ctrl *iscan,
+ bool aborted)
{
- struct wl_priv *wl = iscan_to_wl(iscan);
- struct net_device *ndev = wl_to_ndev(wl);
+ struct brcmf_cfg80211_priv *cfg_priv = iscan_to_wl(iscan);
+ struct net_device *ndev = wl_to_ndev(cfg_priv);
- if (unlikely(!test_and_clear_bit(WL_STATUS_SCANNING, &wl->status))) {
+ if (unlikely(!test_and_clear_bit(WL_STATUS_SCANNING,
+ &cfg_priv->status))) {
WL_ERR("Scan complete while device not scanning\n");
return;
}
- if (likely(wl->scan_request)) {
+ if (likely(cfg_priv->scan_request)) {
WL_SCAN("ISCAN Completed scan: %s\n",
aborted ? "Aborted" : "Done");
- cfg80211_scan_done(wl->scan_request, aborted);
+ cfg80211_scan_done(cfg_priv->scan_request, aborted);
brcmf_set_mpc(ndev, 1);
- wl->scan_request = NULL;
+ cfg_priv->scan_request = NULL;
}
- wl->iscan_kickstart = false;
+ cfg_priv->iscan_kickstart = false;
}
-static s32 brcmf_wakeup_iscan(struct wl_iscan_ctrl *iscan)
+static s32 brcmf_wakeup_iscan(struct brcmf_cfg80211_iscan_ctrl *iscan)
{
if (likely(iscan->state != WL_ISCAN_STATE_IDLE)) {
WL_SCAN("wake up iscan\n");
@@ -3154,7 +3200,7 @@ static s32 brcmf_wakeup_iscan(struct wl_iscan_ctrl *iscan)
}
static s32
-brcmf_get_iscan_results(struct wl_iscan_ctrl *iscan, u32 *status,
+brcmf_get_iscan_results(struct brcmf_cfg80211_iscan_ctrl *iscan, u32 *status,
struct brcmf_scan_results **bss_list)
{
struct brcmf_iscan_results list;
@@ -3189,23 +3235,23 @@ brcmf_get_iscan_results(struct wl_iscan_ctrl *iscan, u32 *status,
return err;
}
-static s32 brcmf_iscan_done(struct wl_priv *wl)
+static s32 brcmf_iscan_done(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct wl_iscan_ctrl *iscan = wl->iscan;
+ struct brcmf_cfg80211_iscan_ctrl *iscan = cfg_priv->iscan;
s32 err = 0;
iscan->state = WL_ISCAN_STATE_IDLE;
rtnl_lock();
- brcmf_inform_bss(wl);
+ brcmf_inform_bss(cfg_priv);
brcmf_notify_iscan_complete(iscan, false);
rtnl_unlock();
return err;
}
-static s32 brcmf_iscan_pending(struct wl_priv *wl)
+static s32 brcmf_iscan_pending(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct wl_iscan_ctrl *iscan = wl->iscan;
+ struct brcmf_cfg80211_iscan_ctrl *iscan = cfg_priv->iscan;
s32 err = 0;
/* Reschedule the timer */
@@ -3215,13 +3261,13 @@ static s32 brcmf_iscan_pending(struct wl_priv *wl)
return err;
}
-static s32 brcmf_iscan_inprogress(struct wl_priv *wl)
+static s32 brcmf_iscan_inprogress(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct wl_iscan_ctrl *iscan = wl->iscan;
+ struct brcmf_cfg80211_iscan_ctrl *iscan = cfg_priv->iscan;
s32 err = 0;
rtnl_lock();
- brcmf_inform_bss(wl);
+ brcmf_inform_bss(cfg_priv);
brcmf_run_iscan(iscan, NULL, BRCMF_SCAN_ACTION_CONTINUE);
rtnl_unlock();
/* Reschedule the timer */
@@ -3231,9 +3277,9 @@ static s32 brcmf_iscan_inprogress(struct wl_priv *wl)
return err;
}
-static s32 brcmf_iscan_aborted(struct wl_priv *wl)
+static s32 brcmf_iscan_aborted(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct wl_iscan_ctrl *iscan = wl->iscan;
+ struct brcmf_cfg80211_iscan_ctrl *iscan = cfg_priv->iscan;
s32 err = 0;
iscan->state = WL_ISCAN_STATE_IDLE;
@@ -3247,9 +3293,10 @@ static s32 brcmf_iscan_aborted(struct wl_priv *wl)
static s32 brcmf_iscan_thread(void *data)
{
struct sched_param param = {.sched_priority = MAX_RT_PRIO - 1 };
- struct wl_iscan_ctrl *iscan = (struct wl_iscan_ctrl *)data;
- struct wl_priv *wl = iscan_to_wl(iscan);
- struct wl_iscan_eloop *el = &iscan->el;
+ struct brcmf_cfg80211_iscan_ctrl *iscan =
+ (struct brcmf_cfg80211_iscan_ctrl *)data;
+ struct brcmf_cfg80211_priv *cfg_priv = iscan_to_wl(iscan);
+ struct brcmf_cfg80211_iscan_eloop *el = &iscan->el;
u32 status;
int err = 0;
@@ -3264,13 +3311,14 @@ static s32 brcmf_iscan_thread(void *data)
iscan->timer_on = 0;
}
rtnl_lock();
- err = brcmf_get_iscan_results(iscan, &status, &wl->bss_list);
+ err = brcmf_get_iscan_results(iscan, &status,
+ &cfg_priv->bss_list);
if (unlikely(err)) {
status = BRCMF_SCAN_RESULTS_ABORTED;
WL_ERR("Abort iscan\n");
}
rtnl_unlock();
- el->handler[status] (wl);
+ el->handler[status](cfg_priv);
}
if (iscan->timer_on) {
del_timer_sync(&iscan->timer);
@@ -3283,7 +3331,8 @@ static s32 brcmf_iscan_thread(void *data)
static void brcmf_iscan_timer(unsigned long data)
{
- struct wl_iscan_ctrl *iscan = (struct wl_iscan_ctrl *)data;
+ struct brcmf_cfg80211_iscan_ctrl *iscan =
+ (struct brcmf_cfg80211_iscan_ctrl *)data;
if (iscan) {
iscan->timer_on = 0;
@@ -3292,12 +3341,12 @@ static void brcmf_iscan_timer(unsigned long data)
}
}
-static s32 brcmf_invoke_iscan(struct wl_priv *wl)
+static s32 brcmf_invoke_iscan(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct wl_iscan_ctrl *iscan = wl_to_iscan(wl);
+ struct brcmf_cfg80211_iscan_ctrl *iscan = wl_to_iscan(cfg_priv);
int err = 0;
- if (wl->iscan_on && !iscan->tsk) {
+ if (cfg_priv->iscan_on && !iscan->tsk) {
iscan->state = WL_ISCAN_STATE_IDLE;
sema_init(&iscan->sync, 0);
iscan->tsk = kthread_run(brcmf_iscan_thread, iscan, "wl_iscan");
@@ -3311,7 +3360,7 @@ static s32 brcmf_invoke_iscan(struct wl_priv *wl)
return err;
}
-static void brcmf_init_iscan_eloop(struct wl_iscan_eloop *el)
+static void brcmf_init_iscan_eloop(struct brcmf_cfg80211_iscan_eloop *el)
{
memset(el, 0, sizeof(*el));
el->handler[BRCMF_SCAN_RESULTS_SUCCESS] = brcmf_iscan_done;
@@ -3321,13 +3370,13 @@ static void brcmf_init_iscan_eloop(struct wl_iscan_eloop *el)
el->handler[BRCMF_SCAN_RESULTS_NO_MEM] = brcmf_iscan_aborted;
}
-static s32 brcmf_init_iscan(struct wl_priv *wl)
+static s32 brcmf_init_iscan(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct wl_iscan_ctrl *iscan = wl_to_iscan(wl);
+ struct brcmf_cfg80211_iscan_ctrl *iscan = wl_to_iscan(cfg_priv);
int err = 0;
- if (wl->iscan_on) {
- iscan->dev = wl_to_ndev(wl);
+ if (cfg_priv->iscan_on) {
+ iscan->dev = wl_to_ndev(cfg_priv);
iscan->state = WL_ISCAN_STATE_IDLE;
brcmf_init_iscan_eloop(&iscan->el);
iscan->timer_ms = WL_ISCAN_TIMER_INTERVAL_MS;
@@ -3341,139 +3390,142 @@ static s32 brcmf_init_iscan(struct wl_priv *wl)
iscan->tsk = NULL;
return -ENOMEM;
}
- iscan->data = wl;
+ iscan->data = cfg_priv;
}
return err;
}
-static s32 wl_init_priv(struct wl_priv *wl)
+static s32 wl_init_priv(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct wiphy *wiphy = wl_to_wiphy(wl);
+ struct wiphy *wiphy = wl_to_wiphy(cfg_priv);
s32 err = 0;
- wl->scan_request = NULL;
- wl->pwr_save = !!(wiphy->flags & WIPHY_FLAG_PS_ON_BY_DEFAULT);
- wl->iscan_on = true; /* iscan on & off switch.
+ cfg_priv->scan_request = NULL;
+ cfg_priv->pwr_save = !!(wiphy->flags & WIPHY_FLAG_PS_ON_BY_DEFAULT);
+ cfg_priv->iscan_on = true; /* iscan on & off switch.
we enable iscan per default */
- wl->roam_on = false; /* roam on & off switch.
+ cfg_priv->roam_on = false; /* roam on & off switch.
we enable roam per default */
- wl->iscan_kickstart = false;
- wl->active_scan = true; /* we do active scan for
+ cfg_priv->iscan_kickstart = false;
+ cfg_priv->active_scan = true; /* we do active scan for
specific scan per default */
- wl->dongle_up = false; /* dongle is not up yet */
- brcmf_init_eq(wl);
- err = brcmf_init_priv_mem(wl);
+ cfg_priv->dongle_up = false; /* dongle is not up yet */
+ brcmf_init_eq(cfg_priv);
+ err = brcmf_init_priv_mem(cfg_priv);
if (unlikely(err))
return err;
- if (unlikely(brcmf_create_event_handler(wl)))
+ if (unlikely(brcmf_create_event_handler(cfg_priv)))
return -ENOMEM;
- brcmf_init_eloop_handler(&wl->el);
- mutex_init(&wl->usr_sync);
- err = brcmf_init_iscan(wl);
+ brcmf_init_eloop_handler(&cfg_priv->el);
+ mutex_init(&cfg_priv->usr_sync);
+ err = brcmf_init_iscan(cfg_priv);
if (unlikely(err))
return err;
- brcmf_init_conf(wl->conf);
- brcmf_init_prof(wl->profile);
- brcmf_link_down(wl);
+ brcmf_init_conf(cfg_priv->conf);
+ brcmf_init_prof(cfg_priv->profile);
+ brcmf_link_down(cfg_priv);
return err;
}
-static void wl_deinit_priv(struct wl_priv *wl)
+static void wl_deinit_priv(struct brcmf_cfg80211_priv *cfg_priv)
{
- brcmf_destroy_event_handler(wl);
- wl->dongle_up = false; /* dongle down */
- brcmf_flush_eq(wl);
- brcmf_link_down(wl);
- brcmf_term_iscan(wl);
- brcmf_deinit_priv_mem(wl);
+ brcmf_destroy_event_handler(cfg_priv);
+ cfg_priv->dongle_up = false; /* dongle down */
+ brcmf_flush_eq(cfg_priv);
+ brcmf_link_down(cfg_priv);
+ brcmf_term_iscan(cfg_priv);
+ brcmf_deinit_priv_mem(cfg_priv);
}
s32 wl_cfg80211_attach(struct net_device *ndev, void *data)
{
struct wireless_dev *wdev;
- struct wl_priv *wl;
- struct wl_iface *ci;
+ struct brcmf_cfg80211_priv *cfg_priv;
+ struct brcmf_cfg80211_iface *ci;
s32 err = 0;
if (unlikely(!ndev)) {
WL_ERR("ndev is invalid\n");
return -ENODEV;
}
- wl_cfg80211_dev = kzalloc(sizeof(struct wl_dev), GFP_KERNEL);
- if (unlikely(!wl_cfg80211_dev)) {
+ cfg80211_dev = kzalloc(sizeof(struct brcmf_cfg80211_dev), GFP_KERNEL);
+ if (unlikely(!cfg80211_dev)) {
WL_ERR("wl_cfg80211_dev is invalid\n");
return -ENOMEM;
}
WL_INFO("func %p\n", wl_cfg80211_get_sdio_func());
- wdev = brcmf_alloc_wdev(sizeof(struct wl_iface), &wl_cfg80211_get_sdio_func()->dev);
+ wdev = brcmf_alloc_wdev(sizeof(struct brcmf_cfg80211_iface),
+ &wl_cfg80211_get_sdio_func()->dev);
if (IS_ERR(wdev))
return -ENOMEM;
wdev->iftype = brcmf_mode_to_nl80211_iftype(WL_MODE_BSS);
- wl = wdev_to_wl(wdev);
- wl->wdev = wdev;
- wl->pub = data;
- ci = (struct wl_iface *)wl_to_ci(wl);
- ci->wl = wl;
+ cfg_priv = wdev_to_wl(wdev);
+ cfg_priv->wdev = wdev;
+ cfg_priv->pub = data;
+ ci = (struct brcmf_cfg80211_iface *)wl_to_ci(cfg_priv);
+ ci->cfg_priv = cfg_priv;
ndev->ieee80211_ptr = wdev;
SET_NETDEV_DEV(ndev, wiphy_dev(wdev->wiphy));
wdev->netdev = ndev;
- err = wl_init_priv(wl);
+ err = wl_init_priv(cfg_priv);
if (unlikely(err)) {
WL_ERR("Failed to init iwm_priv (%d)\n", err);
goto cfg80211_attach_out;
}
- brcmf_set_drvdata(wl_cfg80211_dev, ci);
+ brcmf_set_drvdata(cfg80211_dev, ci);
return err;
cfg80211_attach_out:
- brcmf_free_wdev(wl);
+ brcmf_free_wdev(cfg_priv);
return err;
}
void wl_cfg80211_detach(void)
{
- struct wl_priv *wl;
+ struct brcmf_cfg80211_priv *cfg_priv;
- wl = WL_PRIV_GET();
+ cfg_priv = WL_PRIV_GET();
- wl_deinit_priv(wl);
- brcmf_free_wdev(wl);
- brcmf_set_drvdata(wl_cfg80211_dev, NULL);
- kfree(wl_cfg80211_dev);
- wl_cfg80211_dev = NULL;
+ wl_deinit_priv(cfg_priv);
+ brcmf_free_wdev(cfg_priv);
+ brcmf_set_drvdata(cfg80211_dev, NULL);
+ kfree(cfg80211_dev);
+ cfg80211_dev = NULL;
brcmf_clear_sdio_func();
}
-static void brcmf_wakeup_event(struct wl_priv *wl)
+static void brcmf_wakeup_event(struct brcmf_cfg80211_priv *cfg_priv)
{
- up(&wl->event_sync);
+ up(&cfg_priv->event_sync);
}
static s32 brcmf_event_handler(void *data)
{
- struct wl_priv *wl = (struct wl_priv *)data;
+ struct brcmf_cfg80211_priv *cfg_priv =
+ (struct brcmf_cfg80211_priv *)data;
struct sched_param param = {.sched_priority = MAX_RT_PRIO - 1 };
- struct wl_event_q *e;
+ struct brcmf_cfg80211_event_q *e;
sched_setscheduler(current, SCHED_FIFO, ¶m);
allow_signal(SIGTERM);
- while (likely(!down_interruptible(&wl->event_sync))) {
+ while (likely(!down_interruptible(&cfg_priv->event_sync))) {
if (kthread_should_stop())
break;
- e = brcmf_deq_event(wl);
+ e = brcmf_deq_event(cfg_priv);
if (unlikely(!e)) {
WL_ERR("event queue empty...\n");
BUG();
}
WL_INFO("event type (%d)\n", e->etype);
- if (wl->el.handler[e->etype]) {
- wl->el.handler[e->etype] (wl, wl_to_ndev(wl), &e->emsg,
- e->edata);
+ if (cfg_priv->el.handler[e->etype]) {
+ cfg_priv->el.handler[e->etype](cfg_priv,
+ wl_to_ndev(cfg_priv),
+ &e->emsg, e->edata);
} else {
WL_INFO("Unknown Event (%d): ignoring\n", e->etype);
}
@@ -3488,45 +3540,48 @@ wl_cfg80211_event(struct net_device *ndev,
const struct brcmf_event_msg *e, void *data)
{
u32 event_type = be32_to_cpu(e->event_type);
- struct wl_priv *wl = ndev_to_wl(ndev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(ndev);
- if (likely(!brcmf_enq_event(wl, event_type, e, data)))
- brcmf_wakeup_event(wl);
+ if (likely(!brcmf_enq_event(cfg_priv, event_type, e, data)))
+ brcmf_wakeup_event(cfg_priv);
}
-static void brcmf_init_eq(struct wl_priv *wl)
+static void brcmf_init_eq(struct brcmf_cfg80211_priv *cfg_priv)
{
- brcmf_init_eq_lock(wl);
- INIT_LIST_HEAD(&wl->eq_list);
+ brcmf_init_eq_lock(cfg_priv);
+ INIT_LIST_HEAD(&cfg_priv->eq_list);
}
-static void brcmf_flush_eq(struct wl_priv *wl)
+static void brcmf_flush_eq(struct brcmf_cfg80211_priv *cfg_priv)
{
- struct wl_event_q *e;
+ struct brcmf_cfg80211_event_q *e;
- brcmf_lock_eq(wl);
- while (!list_empty(&wl->eq_list)) {
- e = list_first_entry(&wl->eq_list, struct wl_event_q, eq_list);
+ brcmf_lock_eq(cfg_priv);
+ while (!list_empty(&cfg_priv->eq_list)) {
+ e = list_first_entry(&cfg_priv->eq_list,
+ struct brcmf_cfg80211_event_q, eq_list);
list_del(&e->eq_list);
kfree(e);
}
- brcmf_unlock_eq(wl);
+ brcmf_unlock_eq(cfg_priv);
}
/*
* retrieve first queued event from head
*/
-static struct wl_event_q *brcmf_deq_event(struct wl_priv *wl)
+static struct brcmf_cfg80211_event_q *brcmf_deq_event(
+ struct brcmf_cfg80211_priv *cfg_priv)
{
- struct wl_event_q *e = NULL;
+ struct brcmf_cfg80211_event_q *e = NULL;
- brcmf_lock_eq(wl);
- if (likely(!list_empty(&wl->eq_list))) {
- e = list_first_entry(&wl->eq_list, struct wl_event_q, eq_list);
+ brcmf_lock_eq(cfg_priv);
+ if (likely(!list_empty(&cfg_priv->eq_list))) {
+ e = list_first_entry(&cfg_priv->eq_list,
+ struct brcmf_cfg80211_event_q, eq_list);
list_del(&e->eq_list);
}
- brcmf_unlock_eq(wl);
+ brcmf_unlock_eq(cfg_priv);
return e;
}
@@ -3536,13 +3591,13 @@ static struct wl_event_q *brcmf_deq_event(struct wl_priv *wl)
*/
static s32
-brcmf_enq_event(struct wl_priv *wl, u32 event, const struct brcmf_event_msg *msg,
- void *data)
+brcmf_enq_event(struct brcmf_cfg80211_priv *cfg_priv, u32 event,
+ const struct brcmf_event_msg *msg, void *data)
{
- struct wl_event_q *e;
+ struct brcmf_cfg80211_event_q *e;
s32 err = 0;
- e = kzalloc(sizeof(struct wl_event_q), GFP_KERNEL);
+ e = kzalloc(sizeof(struct brcmf_cfg80211_event_q), GFP_KERNEL);
if (unlikely(!e)) {
WL_ERR("event alloc failed\n");
return -ENOMEM;
@@ -3552,14 +3607,14 @@ brcmf_enq_event(struct wl_priv *wl, u32 event, const struct brcmf_event_msg *msg
memcpy(&e->emsg, msg, sizeof(struct brcmf_event_msg));
if (data) {
}
- brcmf_lock_eq(wl);
- list_add_tail(&e->eq_list, &wl->eq_list);
- brcmf_unlock_eq(wl);
+ brcmf_lock_eq(cfg_priv);
+ list_add_tail(&e->eq_list, &cfg_priv->eq_list);
+ brcmf_unlock_eq(cfg_priv);
return err;
}
-static void brcmf_put_event(struct wl_event_q *e)
+static void brcmf_put_event(struct brcmf_cfg80211_event_q *e)
{
kfree(e);
}
@@ -3761,16 +3816,16 @@ dongle_scantime_out:
return err;
}
-s32 brcmf_config_dongle(struct wl_priv *wl, bool need_lock)
+s32 brcmf_config_dongle(struct brcmf_cfg80211_priv *cfg_priv, bool need_lock)
{
struct net_device *ndev;
struct wireless_dev *wdev;
s32 err = 0;
- if (wl->dongle_up)
+ if (cfg_priv->dongle_up)
return err;
- ndev = wl_to_ndev(wl);
+ ndev = wl_to_ndev(cfg_priv);
wdev = ndev->ieee80211_ptr;
if (need_lock)
rtnl_lock();
@@ -3781,13 +3836,14 @@ s32 brcmf_config_dongle(struct wl_priv *wl, bool need_lock)
err = brcmf_dongle_eventmsg(ndev);
if (unlikely(err))
goto default_conf_out;
- err = brcmf_dongle_roam(ndev, (wl->roam_on ? 0 : 1), WL_BEACON_TIMEOUT);
+ err = brcmf_dongle_roam(ndev, (cfg_priv->roam_on ? 0 : 1),
+ WL_BEACON_TIMEOUT);
if (unlikely(err))
goto default_conf_out;
err = brcmf_dongle_mode(ndev, wdev->iftype);
if (unlikely(err && err != -EINPROGRESS))
goto default_conf_out;
- err = brcmf_dongle_probecap(wl);
+ err = brcmf_dongle_probecap(cfg_priv);
if (unlikely(err))
goto default_conf_out;
@@ -3797,20 +3853,20 @@ default_conf_out:
if (need_lock)
rtnl_unlock();
- wl->dongle_up = true;
+ cfg_priv->dongle_up = true;
return err;
}
-static s32 wl_update_wiphybands(struct wl_priv *wl)
+static s32 wl_update_wiphybands(struct brcmf_cfg80211_priv *cfg_priv)
{
struct wiphy *wiphy;
s32 phy_list;
s8 phy;
s32 err = 0;
- err = brcmf_dev_ioctl(wl_to_ndev(wl), WLC_GET_PHYLIST, &phy_list,
+ err = brcmf_dev_ioctl(wl_to_ndev(cfg_priv), WLC_GET_PHYLIST, &phy_list,
sizeof(phy_list));
if (unlikely(err)) {
WL_ERR("error (%d)\n", err);
@@ -3820,41 +3876,41 @@ static s32 wl_update_wiphybands(struct wl_priv *wl)
phy = ((char *)&phy_list)[1];
WL_INFO("%c phy\n", phy);
if (phy == 'n' || phy == 'a') {
- wiphy = wl_to_wiphy(wl);
+ wiphy = wl_to_wiphy(cfg_priv);
wiphy->bands[IEEE80211_BAND_5GHZ] = &__wl_band_5ghz_n;
}
return err;
}
-static s32 __brcmf_cfg80211_up(struct wl_priv *wl)
+static s32 __brcmf_cfg80211_up(struct brcmf_cfg80211_priv *cfg_priv)
{
s32 err = 0;
- set_bit(WL_STATUS_READY, &wl->status);
+ set_bit(WL_STATUS_READY, &cfg_priv->status);
- brcmf_debugfs_add_netdev_params(wl);
+ brcmf_debugfs_add_netdev_params(cfg_priv);
- err = brcmf_config_dongle(wl, false);
+ err = brcmf_config_dongle(cfg_priv, false);
if (unlikely(err))
return err;
- brcmf_invoke_iscan(wl);
+ brcmf_invoke_iscan(cfg_priv);
return err;
}
-static s32 __brcmf_cfg80211_down(struct wl_priv *wl)
+static s32 __brcmf_cfg80211_down(struct brcmf_cfg80211_priv *cfg_priv)
{
/*
* While going down, if associated with AP disassociate
* from AP to save power
*/
- if ((test_bit(WL_STATUS_CONNECTED, &wl->status) ||
- test_bit(WL_STATUS_CONNECTING, &wl->status)) &&
- test_bit(WL_STATUS_READY, &wl->status)) {
+ if ((test_bit(WL_STATUS_CONNECTED, &cfg_priv->status) ||
+ test_bit(WL_STATUS_CONNECTING, &cfg_priv->status)) &&
+ test_bit(WL_STATUS_READY, &cfg_priv->status)) {
WL_INFO("Disassociating from AP");
- brcmf_link_down(wl);
+ brcmf_link_down(cfg_priv);
/* Make sure WPA_Supplicant receives all the event
generated due to DISASSOC call to the fw to keep
@@ -3865,71 +3921,71 @@ static s32 __brcmf_cfg80211_down(struct wl_priv *wl)
rtnl_lock();
}
- set_bit(WL_STATUS_SCAN_ABORTING, &wl->status);
- brcmf_term_iscan(wl);
- if (wl->scan_request) {
- cfg80211_scan_done(wl->scan_request, true);
+ set_bit(WL_STATUS_SCAN_ABORTING, &cfg_priv->status);
+ brcmf_term_iscan(cfg_priv);
+ if (cfg_priv->scan_request) {
+ cfg80211_scan_done(cfg_priv->scan_request, true);
/* May need to perform this to cover rmmod */
/* wl_set_mpc(wl_to_ndev(wl), 1); */
- wl->scan_request = NULL;
+ cfg_priv->scan_request = NULL;
}
- clear_bit(WL_STATUS_READY, &wl->status);
- clear_bit(WL_STATUS_SCANNING, &wl->status);
- clear_bit(WL_STATUS_SCAN_ABORTING, &wl->status);
+ clear_bit(WL_STATUS_READY, &cfg_priv->status);
+ clear_bit(WL_STATUS_SCANNING, &cfg_priv->status);
+ clear_bit(WL_STATUS_SCAN_ABORTING, &cfg_priv->status);
- brcmf_debugfs_remove_netdev(wl);
+ brcmf_debugfs_remove_netdev(cfg_priv);
return 0;
}
s32 wl_cfg80211_up(void)
{
- struct wl_priv *wl;
+ struct brcmf_cfg80211_priv *cfg_priv;
s32 err = 0;
- wl = WL_PRIV_GET();
- mutex_lock(&wl->usr_sync);
- err = __brcmf_cfg80211_up(wl);
- mutex_unlock(&wl->usr_sync);
+ cfg_priv = WL_PRIV_GET();
+ mutex_lock(&cfg_priv->usr_sync);
+ err = __brcmf_cfg80211_up(cfg_priv);
+ mutex_unlock(&cfg_priv->usr_sync);
return err;
}
s32 wl_cfg80211_down(void)
{
- struct wl_priv *wl;
+ struct brcmf_cfg80211_priv *cfg_priv;
s32 err = 0;
- wl = WL_PRIV_GET();
- mutex_lock(&wl->usr_sync);
- err = __brcmf_cfg80211_down(wl);
- mutex_unlock(&wl->usr_sync);
+ cfg_priv = WL_PRIV_GET();
+ mutex_lock(&cfg_priv->usr_sync);
+ err = __brcmf_cfg80211_down(cfg_priv);
+ mutex_unlock(&cfg_priv->usr_sync);
return err;
}
-static s32 brcmf_dongle_probecap(struct wl_priv *wl)
+static s32 brcmf_dongle_probecap(struct brcmf_cfg80211_priv *cfg_priv)
{
- return wl_update_wiphybands(wl);
+ return wl_update_wiphybands(cfg_priv);
}
-static void *brcmf_read_prof(struct wl_priv *wl, s32 item)
+static void *brcmf_read_prof(struct brcmf_cfg80211_priv *cfg_priv, s32 item)
{
switch (item) {
case WL_PROF_SEC:
- return &wl->profile->sec;
+ return &cfg_priv->profile->sec;
case WL_PROF_BSSID:
- return &wl->profile->bssid;
+ return &cfg_priv->profile->bssid;
case WL_PROF_SSID:
- return &wl->profile->ssid;
+ return &cfg_priv->profile->ssid;
}
WL_ERR("invalid item (%d)\n", item);
return NULL;
}
static s32
-brcmf_update_prof(struct wl_priv *wl, const struct brcmf_event_msg *e, void *data,
- s32 item)
+brcmf_update_prof(struct brcmf_cfg80211_priv *cfg_priv,
+ const struct brcmf_event_msg *e, void *data, s32 item)
{
s32 err = 0;
struct brcmf_ssid *ssid;
@@ -3937,25 +3993,27 @@ brcmf_update_prof(struct wl_priv *wl, const struct brcmf_event_msg *e, void *dat
switch (item) {
case WL_PROF_SSID:
ssid = (struct brcmf_ssid *) data;
- memset(wl->profile->ssid.SSID, 0,
- sizeof(wl->profile->ssid.SSID));
- memcpy(wl->profile->ssid.SSID, ssid->SSID, ssid->SSID_len);
- wl->profile->ssid.SSID_len = ssid->SSID_len;
+ memset(cfg_priv->profile->ssid.SSID, 0,
+ sizeof(cfg_priv->profile->ssid.SSID));
+ memcpy(cfg_priv->profile->ssid.SSID,
+ ssid->SSID, ssid->SSID_len);
+ cfg_priv->profile->ssid.SSID_len = ssid->SSID_len;
break;
case WL_PROF_BSSID:
if (data)
- memcpy(wl->profile->bssid, data, ETH_ALEN);
+ memcpy(cfg_priv->profile->bssid, data, ETH_ALEN);
else
- memset(wl->profile->bssid, 0, ETH_ALEN);
+ memset(cfg_priv->profile->bssid, 0, ETH_ALEN);
break;
case WL_PROF_SEC:
- memcpy(&wl->profile->sec, data, sizeof(wl->profile->sec));
+ memcpy(&cfg_priv->profile->sec, data,
+ sizeof(cfg_priv->profile->sec));
break;
case WL_PROF_BEACONINT:
- wl->profile->beacon_interval = *(u16 *)data;
+ cfg_priv->profile->beacon_interval = *(u16 *)data;
break;
case WL_PROF_DTIMPERIOD:
- wl->profile->dtim_period = *(u8 *)data;
+ cfg_priv->profile->dtim_period = *(u8 *)data;
break;
default:
WL_ERR("unsupported item (%d)\n", item);
@@ -3966,14 +4024,15 @@ brcmf_update_prof(struct wl_priv *wl, const struct brcmf_event_msg *e, void *dat
return err;
}
-static bool brcmf_is_ibssmode(struct wl_priv *wl)
+static bool brcmf_is_ibssmode(struct brcmf_cfg80211_priv *cfg_priv)
{
- return wl->conf->mode == WL_MODE_IBSS;
+ return cfg_priv->conf->mode == WL_MODE_IBSS;
}
-static __used s32 brcmf_add_ie(struct wl_priv *wl, u8 t, u8 l, u8 *v)
+static __used s32 brcmf_add_ie(struct brcmf_cfg80211_priv *cfg_priv,
+ u8 t, u8 l, u8 *v)
{
- struct wl_ie *ie = wl_to_ie(wl);
+ struct brcmf_cfg80211_ie *ie = wl_to_ie(cfg_priv);
s32 err = 0;
if (unlikely(ie->offset + l + 2 > WL_TLV_INFO_MAX)) {
@@ -3988,37 +4047,37 @@ static __used s32 brcmf_add_ie(struct wl_priv *wl, u8 t, u8 l, u8 *v)
return err;
}
-static void brcmf_link_down(struct wl_priv *wl)
+static void brcmf_link_down(struct brcmf_cfg80211_priv *cfg_priv)
{
struct net_device *dev = NULL;
s32 err = 0;
WL_TRACE("Enter\n");
- if (wl->link_up) {
- dev = wl_to_ndev(wl);
+ if (cfg_priv->link_up) {
+ dev = wl_to_ndev(cfg_priv);
WL_INFO("Call WLC_DISASSOC to stop excess roaming\n ");
err = brcmf_dev_ioctl(dev, BRCMF_C_DISASSOC, NULL, 0);
if (unlikely(err))
WL_ERR("WLC_DISASSOC failed (%d)\n", err);
- wl->link_up = false;
+ cfg_priv->link_up = false;
}
WL_TRACE("Exit\n");
}
-static void brcmf_lock_eq(struct wl_priv *wl)
+static void brcmf_lock_eq(struct brcmf_cfg80211_priv *cfg_priv)
{
- spin_lock_irq(&wl->eq_lock);
+ spin_lock_irq(&cfg_priv->eq_lock);
}
-static void brcmf_unlock_eq(struct wl_priv *wl)
+static void brcmf_unlock_eq(struct brcmf_cfg80211_priv *cfg_priv)
{
- spin_unlock_irq(&wl->eq_lock);
+ spin_unlock_irq(&cfg_priv->eq_lock);
}
-static void brcmf_init_eq_lock(struct wl_priv *wl)
+static void brcmf_init_eq_lock(struct brcmf_cfg80211_priv *cfg_priv)
{
- spin_lock_init(&wl->eq_lock);
+ spin_lock_init(&cfg_priv->eq_lock);
}
static void brcmf_delay(u32 ms)
@@ -4031,12 +4090,12 @@ static void brcmf_delay(u32 ms)
}
}
-static void brcmf_set_drvdata(struct wl_dev *dev, void *data)
+static void brcmf_set_drvdata(struct brcmf_cfg80211_dev *dev, void *data)
{
dev->driver_data = data;
}
-static void *brcmf_get_drvdata(struct wl_dev *dev)
+static void *brcmf_get_drvdata(struct brcmf_cfg80211_dev *dev)
{
void *data = NULL;
@@ -4048,9 +4107,9 @@ static void *brcmf_get_drvdata(struct wl_dev *dev)
static void brcmf_set_mpc(struct net_device *ndev, int mpc)
{
s32 err = 0;
- struct wl_priv *wl = ndev_to_wl(ndev);
+ struct brcmf_cfg80211_priv *cfg_priv = ndev_to_wl(ndev);
- if (test_bit(WL_STATUS_READY, &wl->status)) {
+ if (test_bit(WL_STATUS_READY, &cfg_priv->status)) {
err = brcmf_dev_intvar_set(ndev, "mpc", mpc);
if (unlikely(err)) {
WL_ERR("fail to set mpc\n");
@@ -4060,24 +4119,25 @@ static void brcmf_set_mpc(struct net_device *ndev, int mpc)
}
}
-static int brcmf_debugfs_add_netdev_params(struct wl_priv *wl)
+static int brcmf_debugfs_add_netdev_params(struct brcmf_cfg80211_priv *cfg_priv)
{
char buf[10+IFNAMSIZ];
struct dentry *fd;
s32 err = 0;
- sprintf(buf, "netdev:%s", wl_to_ndev(wl)->name);
- wl->debugfsdir = debugfs_create_dir(buf, wl_to_wiphy(wl)->debugfsdir);
+ sprintf(buf, "netdev:%s", wl_to_ndev(cfg_priv)->name);
+ cfg_priv->debugfsdir = debugfs_create_dir(buf,
+ wl_to_wiphy(cfg_priv)->debugfsdir);
- fd = debugfs_create_u16("beacon_int", S_IRUGO, wl->debugfsdir,
- (u16 *)&wl->profile->beacon_interval);
+ fd = debugfs_create_u16("beacon_int", S_IRUGO, cfg_priv->debugfsdir,
+ (u16 *)&cfg_priv->profile->beacon_interval);
if (!fd) {
err = -ENOMEM;
goto err_out;
}
- fd = debugfs_create_u8("dtim_period", S_IRUGO, wl->debugfsdir,
- (u8 *)&wl->profile->dtim_period);
+ fd = debugfs_create_u8("dtim_period", S_IRUGO, cfg_priv->debugfsdir,
+ (u8 *)&cfg_priv->profile->dtim_period);
if (!fd) {
err = -ENOMEM;
goto err_out;
@@ -4087,8 +4147,8 @@ err_out:
return err;
}
-static void brcmf_debugfs_remove_netdev(struct wl_priv *wl)
+static void brcmf_debugfs_remove_netdev(struct brcmf_cfg80211_priv *cfg_priv)
{
- debugfs_remove_recursive(wl->debugfsdir);
- wl->debugfsdir = NULL;
+ debugfs_remove_recursive(cfg_priv->debugfsdir);
+ cfg_priv->debugfsdir = NULL;
}
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
index af62cee..e2f41ab 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
@@ -17,11 +17,11 @@
#ifndef _wl_cfg80211_h_
#define _wl_cfg80211_h_
-struct wl_conf;
-struct wl_iface;
-struct wl_priv;
-struct wl_security;
-struct wl_ibss;
+struct brcmf_cfg80211_conf;
+struct brcmf_cfg80211_iface;
+struct brcmf_cfg80211_priv;
+struct brcmf_cfg80211_security;
+struct brcmf_cfg80211_ibss;
#define WL_DBG_NONE 0
#define WL_DBG_CONN (1 << 5)
@@ -90,8 +90,6 @@ do { \
#define WL_CONN(fmt, args...)
#endif /* (defined BCMDBG) */
-
-#define WL_SCAN_RETRY_MAX 3 /* used for ibss scan */
#define WL_NUM_SCAN_MAX 1
#define WL_NUM_PMKIDS_MAX MAXPMKID /* will be used
* for 2.6.33 kernel
@@ -160,16 +158,8 @@ enum wl_iscan_state {
WL_ISCAN_STATE_SCANING
};
-/* beacon / probe_response */
-struct beacon_proberesp {
- __le64 timestamp;
- __le16 beacon_int;
- __le16 capab_info;
- u8 variable[0];
-} __attribute__ ((packed));
-
/* dongle configuration */
-struct wl_conf {
+struct brcmf_cfg80211_conf {
u32 mode; /* adhoc , infrastructure or ap */
u32 frag_threshold;
u32 rts_threshold;
@@ -180,44 +170,35 @@ struct wl_conf {
};
/* cfg80211 main event loop */
-struct wl_event_loop {
- s32(*handler[BRCMF_E_LAST]) (struct wl_priv *wl,
+struct brcmf_cfg80211_event_loop {
+ s32(*handler[BRCMF_E_LAST]) (struct brcmf_cfg80211_priv *cfg_priv,
struct net_device *ndev,
const struct brcmf_event_msg *e,
void *data);
};
/* representing interface of cfg80211 plane */
-struct wl_iface {
- struct wl_priv *wl;
+struct brcmf_cfg80211_iface {
+ struct brcmf_cfg80211_priv *cfg_priv;
};
-struct wl_dev {
+struct brcmf_cfg80211_dev {
void *driver_data; /* to store cfg80211 object information */
};
-/* bss inform structure for cfg80211 interface */
-struct wl_cfg80211_bss_info {
- u16 band;
- u16 channel;
- s16 rssi;
- u16 frame_len;
- u8 frame_buf[1];
-};
-
/* basic structure of scan request */
-struct wl_scan_req {
+struct brcmf_cfg80211_scan_req {
struct brcmf_ssid ssid;
};
/* basic structure of information element */
-struct wl_ie {
+struct brcmf_cfg80211_ie {
u16 offset;
u8 buf[WL_TLV_INFO_MAX];
};
/* event queue for cfg80211 main event */
-struct wl_event_q {
+struct brcmf_cfg80211_event_q {
struct list_head eq_list;
u32 etype;
struct brcmf_event_msg emsg;
@@ -225,7 +206,7 @@ struct wl_event_q {
};
/* security information with currently associated ap */
-struct wl_security {
+struct brcmf_cfg80211_security {
u32 wpa_versions;
u32 auth_type;
u32 cipher_pairwise;
@@ -234,7 +215,7 @@ struct wl_security {
};
/* ibss information for currently joined ibss network */
-struct wl_ibss {
+struct brcmf_cfg80211_ibss {
u8 beacon_interval; /* in millisecond */
u8 atim; /* in millisecond */
s8 join_only;
@@ -243,24 +224,25 @@ struct wl_ibss {
};
/* dongle profile */
-struct wl_profile {
+struct brcmf_cfg80211_profile {
u32 mode;
struct brcmf_ssid ssid;
u8 bssid[ETH_ALEN];
u16 beacon_interval;
u8 dtim_period;
- struct wl_security sec;
- struct wl_ibss ibss;
+ struct brcmf_cfg80211_security sec;
+ struct brcmf_cfg80211_ibss ibss;
s32 band;
};
/* dongle iscan event loop */
-struct wl_iscan_eloop {
- s32(*handler[WL_SCAN_ERSULTS_LAST]) (struct wl_priv *wl);
+struct brcmf_cfg80211_iscan_eloop {
+ s32 (*handler[WL_SCAN_ERSULTS_LAST])
+ (struct brcmf_cfg80211_priv *cfg_priv);
};
/* dongle iscan controller */
-struct wl_iscan_ctrl {
+struct brcmf_cfg80211_iscan_ctrl {
struct net_device *dev;
struct timer_list timer;
u32 timer_ms;
@@ -268,14 +250,14 @@ struct wl_iscan_ctrl {
s32 state;
struct task_struct *tsk;
struct semaphore sync;
- struct wl_iscan_eloop el;
+ struct brcmf_cfg80211_iscan_eloop el;
void *data;
s8 ioctl_buf[BRCMF_C_IOCTL_SMLEN];
s8 scan_buf[WL_ISCAN_BUF_MAX];
};
/* association inform */
-struct wl_connect_info {
+struct brcmf_cfg80211_connect_info {
u8 *req_ie;
s32 req_ie_len;
u8 *resp_ie;
@@ -283,43 +265,42 @@ struct wl_connect_info {
};
/* assoc ie length */
-struct wl_assoc_ielen {
+struct brcmf_cfg80211_assoc_ielen {
u32 req_len;
u32 resp_len;
};
/* wpa2 pmk list */
-struct wl_pmk_list {
+struct brcmf_cfg80211_pmk_list {
pmkid_list_t pmkids;
pmkid_t foo[MAXPMKID - 1];
};
/* dongle private data of cfg80211 interface */
-struct wl_priv {
+struct brcmf_cfg80211_priv {
struct wireless_dev *wdev; /* representing wl cfg80211 device */
- struct wl_conf *conf; /* dongle configuration */
+ struct brcmf_cfg80211_conf *conf; /* dongle configuration */
struct cfg80211_scan_request *scan_request; /* scan request
object */
- struct wl_event_loop el; /* main event loop */
+ struct brcmf_cfg80211_event_loop el; /* main event loop */
struct list_head eq_list; /* used for event queue */
spinlock_t eq_lock; /* for event queue synchronization */
struct mutex usr_sync; /* maily for dongle up/down synchronization */
struct brcmf_scan_results *bss_list; /* bss_list holding scanned
ap information */
struct brcmf_scan_results *scan_results;
- struct wl_scan_req *scan_req_int; /* scan request object for
- internal purpose */
+ struct brcmf_cfg80211_scan_req *scan_req_int; /* scan request object
+ for internal purpose */
struct wl_cfg80211_bss_info *bss_info; /* bss information for
cfg80211 layer */
- struct wl_ie ie; /* information element object for
+ struct brcmf_cfg80211_ie ie; /* information element object for
internal purpose */
struct semaphore event_sync; /* for synchronization of main event
thread */
- struct wl_profile *profile; /* holding dongle profile */
- struct wl_iscan_ctrl *iscan; /* iscan controller */
- struct wl_connect_info conn_info; /* association information
- container */
- struct wl_pmk_list *pmk_list; /* wpa2 pmk list */
+ struct brcmf_cfg80211_profile *profile; /* holding dongle profile */
+ struct brcmf_cfg80211_iscan_ctrl *iscan; /* iscan controller */
+ struct brcmf_cfg80211_connect_info conn_info; /* association info */
+ struct brcmf_cfg80211_pmk_list *pmk_list; /* wpa2 pmk list */
struct task_struct *event_tsk; /* task of main event handler thread */
unsigned long status; /* current dongle status */
void *pub;
@@ -342,16 +323,16 @@ struct wl_priv {
#define wl_to_dev(w) (wiphy_dev(wl->wdev->wiphy))
#define wl_to_wiphy(w) (w->wdev->wiphy)
-#define wiphy_to_wl(w) ((struct wl_priv *)(wiphy_priv(w)))
+#define wiphy_to_wl(w) ((struct brcmf_cfg80211_priv *)(wiphy_priv(w)))
#define wl_to_wdev(w) (w->wdev)
-#define wdev_to_wl(w) ((struct wl_priv *)(wdev_priv(w)))
+#define wdev_to_wl(w) ((struct brcmf_cfg80211_priv *)(wdev_priv(w)))
#define wl_to_ndev(w) (w->wdev->netdev)
#define ndev_to_wl(n) (wdev_to_wl(n->ieee80211_ptr))
-#define ci_to_wl(c) (ci->wl)
+#define ci_to_wl(c) (ci->cfg_priv)
#define wl_to_ci(w) (&w->ci)
#define wl_to_sr(w) (w->scan_req_int)
#define wl_to_ie(w) (&w->ie)
-#define iscan_to_wl(i) ((struct wl_priv *)(i->data))
+#define iscan_to_wl(i) ((struct brcmf_cfg80211_priv *)(i->data))
#define wl_to_iscan(w) (w->iscan)
#define wl_to_conn(w) (&w->conn_info)
@@ -373,7 +354,7 @@ extern void wl_cfg80211_detach(void);
extern void wl_cfg80211_event(struct net_device *ndev,
const struct brcmf_event_msg *e, void *data);
extern void wl_cfg80211_sdio_func(void *func); /* set sdio function info */
-extern struct sdio_func *wl_cfg80211_get_sdio_func(void); /* set sdio function info */
+extern struct sdio_func *wl_cfg80211_get_sdio_func(void);
extern s32 wl_cfg80211_up(void); /* dongle up */
extern s32 wl_cfg80211_down(void); /* dongle down */
extern void wl_cfg80211_dbg_level(u32 level); /* set dongle
--
1.7.1
From: Roland Vossen <[email protected]>
Code cleanup. W_REG was defined the same for both big and little endian systems.
Replaced W_REG on two spots with its expansion.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 18 +++++-------------
1 files changed, 5 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index cdc57f9..ba57481 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -51,22 +51,13 @@
})
#endif /* __mips__ */
-#define W_REG(r, v, typ) do { \
- brcmf_sdcard_reg_write(NULL, (r), sizeof(typ), (v)); \
- } while (0)
#else /* __BIG_ENDIAN */
#define R_REG(r, typ) \
brcmf_sdcard_reg_read(NULL, (r), sizeof(typ))
-#define W_REG(r, v, typ) do { \
- brcmf_sdcard_reg_write(NULL, (r), sizeof(typ), (v)); \
- } while (0)
#endif /* __BIG_ENDIAN */
-#define AND_REG(r, v, typ) W_REG((r), R_REG(r, typ) & (v), typ)
-#define OR_REG(r, v, typ) W_REG((r), R_REG(r, typ) | (v), typ)
-
-#define SET_REG(r, mask, val, typ) \
- W_REG((r), ((R_REG(r) & ~(mask)) | (val)), typ)
+#define OR_REG(r, v, typ) \
+ brcmf_sdcard_reg_write(NULL, (r), sizeof(typ), R_REG(r, typ) | (v))
#ifdef BCMDBG
@@ -609,7 +600,7 @@ struct brcmf_bus {
uint console_addr; /* Console address from shared struct */
#endif /* BCMDBG */
- uint regfails; /* Count of R_REG/W_REG failures */
+ uint regfails; /* Count of R_REG failures */
uint clkstate; /* State of sd and backplane clock(s) */
bool activity; /* Activity flag for clock down */
@@ -850,7 +841,8 @@ w_sdreg32(struct brcmf_bus *bus, u32 regval, u32 reg_offset, u32 *retryvar)
{
*retryvar = 0;
do {
- W_REG(bus->ci->buscorebase + reg_offset, regval, u32);
+ brcmf_sdcard_reg_write(NULL, bus->ci->buscorebase + reg_offset,
+ sizeof(u32), regval);
} while (brcmf_sdcard_regfail(bus->card) &&
(++(*retryvar) <= retry_limit));
if (*retryvar) {
--
1.7.1
From: Arend van Spriel <[email protected]>
The structure dhd_prot has been renamed to brcmf_proto to align with
fullmac naming convention and removed structure typedef dhd_prot_t.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 16 ++++----
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 55 +++++++++++++-------------
2 files changed, 36 insertions(+), 35 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 2cde233..8736e6f 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -21,11 +21,6 @@
#ifndef _dhd_h_
#define _dhd_h_
-/* Forward decls */
-struct dhd_bus;
-struct dhd_prot;
-struct dhd_info;
-
#define BRCMF_C_IOCTL_SMLEN 256 /* "small" ioctl buffer required */
#define BRCMF_C_IOCTL_MEDLEN 1536 /* "med" ioctl buffer required */
#define BRCMF_C_IOCTL_MAXLEN 8192
@@ -633,12 +628,17 @@ typedef struct wl_ioctl {
uint needed; /* bytes needed (optional) */
} wl_ioctl_t;
+/* Forward decls for struct dhd_pub (see below) */
+struct dhd_bus; /* device bus info */
+struct brcmf_proto; /* device communication protocol info */
+struct dhd_info; /* device driver info */
+
/* Common structure for module and instance linkage */
typedef struct dhd_pub {
/* Linkage ponters */
- struct dhd_bus *bus; /* Bus module handle */
- struct dhd_prot *prot; /* Protocol module handle */
- struct dhd_info *info; /* Info module handle */
+ struct dhd_bus *bus;
+ struct brcmf_proto *prot;
+ struct dhd_info *info;
/* Internal dhd items */
bool up; /* Driver up/down (to OS) */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index 9828ab1..c544cbf 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -28,7 +28,7 @@
#include "dhd_bus.h"
#include "dhd_dbg.h"
-struct cdc_ioctl {
+struct brcmf_proto_cdc_ioctl {
u32 cmd; /* ioctl command value */
u32 len; /* lower 16: output buflen;
* upper 16: input buflen (excludes header) */
@@ -72,7 +72,7 @@ struct cdc_ioctl {
((hdr)->flags2 = (((hdr)->flags2 & ~BDC_FLAG2_IF_MASK) | \
((idx) << BDC_FLAG2_IF_SHIFT)))
-struct bdc_header {
+struct brcmf_proto_bdc_header {
u8 flags;
u8 priority; /* 802.1d Priority, 4:7 flow control info for usb */
u8 flags2;
@@ -103,19 +103,20 @@ int wifi_get_mac_addr(unsigned char *buf);
* round off at the end of buffer
*/
-typedef struct dhd_prot {
+struct brcmf_proto {
u16 reqid;
u8 pending;
u32 lastcmd;
u8 bus_header[BUS_HEADER_LEN];
- struct cdc_ioctl msg;
+ struct brcmf_proto_cdc_ioctl msg;
unsigned char buf[BRCMF_C_IOCTL_MAXLEN + ROUND_UP_MARGIN];
-} dhd_prot_t;
+};
static int brcmf_proto_cdc_msg(dhd_pub_t *dhd)
{
- dhd_prot_t *prot = dhd->prot;
- int len = le32_to_cpu(prot->msg.len) + sizeof(struct cdc_ioctl);
+ struct brcmf_proto *prot = dhd->prot;
+ int len = le32_to_cpu(prot->msg.len) +
+ sizeof(struct brcmf_proto_cdc_ioctl);
DHD_TRACE(("%s: Enter\n", __func__));
@@ -134,14 +135,14 @@ static int brcmf_proto_cdc_msg(dhd_pub_t *dhd)
static int brcmf_proto_cdc_cmplt(dhd_pub_t *dhd, u32 id, u32 len)
{
int ret;
- dhd_prot_t *prot = dhd->prot;
+ struct brcmf_proto *prot = dhd->prot;
DHD_TRACE(("%s: Enter\n", __func__));
do {
ret = brcmf_sdbrcm_bus_rxctl(dhd->bus,
- (unsigned char *)&prot->msg,
- len + sizeof(struct cdc_ioctl));
+ (unsigned char *)&prot->msg,
+ len + sizeof(struct brcmf_proto_cdc_ioctl));
if (ret < 0)
break;
} while (CDC_IOC_ID(le32_to_cpu(prot->msg.flags)) != id);
@@ -153,8 +154,8 @@ int
brcmf_proto_cdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
uint len)
{
- dhd_prot_t *prot = dhd->prot;
- struct cdc_ioctl *msg = &prot->msg;
+ struct brcmf_proto *prot = dhd->prot;
+ struct brcmf_proto_cdc_ioctl *msg = &prot->msg;
void *info;
int ret = 0, retries = 0;
u32 id, flags = 0;
@@ -174,7 +175,7 @@ brcmf_proto_cdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
}
}
- memset(msg, 0, sizeof(struct cdc_ioctl));
+ memset(msg, 0, sizeof(struct brcmf_proto_cdc_ioctl));
msg->cmd = cpu_to_le32(cmd);
msg->len = cpu_to_le32(len);
@@ -235,15 +236,15 @@ done:
int brcmf_proto_cdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd,
void *buf, uint len)
{
- dhd_prot_t *prot = dhd->prot;
- struct cdc_ioctl *msg = &prot->msg;
+ struct brcmf_proto *prot = dhd->prot;
+ struct brcmf_proto_cdc_ioctl *msg = &prot->msg;
int ret = 0;
u32 flags, id;
DHD_TRACE(("%s: Enter\n", __func__));
DHD_CTL(("%s: cmd %d len %d\n", __func__, cmd, len));
- memset(msg, 0, sizeof(struct cdc_ioctl));
+ memset(msg, 0, sizeof(struct brcmf_proto_cdc_ioctl));
msg->cmd = cpu_to_le32(cmd);
msg->len = cpu_to_le32(len);
@@ -289,7 +290,7 @@ int
brcmf_proto_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf,
int len)
{
- dhd_prot_t *prot = dhd->prot;
+ struct brcmf_proto *prot = dhd->prot;
int ret = -1;
if (dhd->busstate == DHD_BUS_DOWN) {
@@ -326,14 +327,14 @@ brcmf_proto_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf,
ret = brcmf_proto_cdc_query_ioctl(dhd, ifidx, ioc->cmd,
buf, len);
if (ret > 0)
- ioc->used = ret - sizeof(struct cdc_ioctl);
+ ioc->used = ret - sizeof(struct brcmf_proto_cdc_ioctl);
}
/* Too many programs assume ioctl() returns 0 on success */
if (ret >= 0)
ret = 0;
else {
- struct cdc_ioctl *msg = &prot->msg;
+ struct brcmf_proto_cdc_ioctl *msg = &prot->msg;
/* len == needed when set/query fails from dongle */
ioc->needed = le32_to_cpu(msg->len);
}
@@ -380,7 +381,7 @@ void brcmf_proto_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf)
void brcmf_proto_hdrpush(dhd_pub_t *dhd, int ifidx, struct sk_buff *pktbuf)
{
- struct bdc_header *h;
+ struct brcmf_proto_bdc_header *h;
DHD_TRACE(("%s: Enter\n", __func__));
@@ -388,7 +389,7 @@ void brcmf_proto_hdrpush(dhd_pub_t *dhd, int ifidx, struct sk_buff *pktbuf)
skb_push(pktbuf, BDC_HEADER_LEN);
- h = (struct bdc_header *)(pktbuf->data);
+ h = (struct brcmf_proto_bdc_header *)(pktbuf->data);
h->flags = (BDC_PROTO_VER << BDC_FLAG_VER_SHIFT);
if (PKTSUMNEEDED(pktbuf))
@@ -402,7 +403,7 @@ void brcmf_proto_hdrpush(dhd_pub_t *dhd, int ifidx, struct sk_buff *pktbuf)
int brcmf_proto_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
{
- struct bdc_header *h;
+ struct brcmf_proto_bdc_header *h;
DHD_TRACE(("%s: Enter\n", __func__));
@@ -414,7 +415,7 @@ int brcmf_proto_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
return -EBADE;
}
- h = (struct bdc_header *)(pktbuf->data);
+ h = (struct brcmf_proto_bdc_header *)(pktbuf->data);
*ifidx = BDC_GET_IF_IDX(h);
if (*ifidx >= DHD_MAX_IFS) {
@@ -446,9 +447,9 @@ int brcmf_proto_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
int brcmf_proto_attach(dhd_pub_t *dhd)
{
- dhd_prot_t *cdc;
+ struct brcmf_proto *cdc;
- cdc = kzalloc(sizeof(dhd_prot_t), GFP_ATOMIC);
+ cdc = kzalloc(sizeof(struct brcmf_proto), GFP_ATOMIC);
if (!cdc) {
DHD_ERROR(("%s: kmalloc failed\n", __func__));
goto fail;
@@ -456,14 +457,14 @@ int brcmf_proto_attach(dhd_pub_t *dhd)
/* ensure that the msg buf directly follows the cdc msg struct */
if ((unsigned long)(&cdc->msg + 1) != (unsigned long)cdc->buf) {
- DHD_ERROR(("dhd_prot_t is not correctly defined\n"));
+ DHD_ERROR(("struct brcmf_proto is not correctly defined\n"));
goto fail;
}
dhd->prot = cdc;
dhd->hdrlen += BDC_HEADER_LEN;
dhd->maxctl = BRCMF_C_IOCTL_MAXLEN +
- sizeof(struct cdc_ioctl) + ROUND_UP_MARGIN;
+ sizeof(struct brcmf_proto_cdc_ioctl) + ROUND_UP_MARGIN;
return 0;
fail:
--
1.7.1
From: Roland Vossen <[email protected]>
Code cleanup. Deleted unused definitions. Moved locally used definitions to
.c files. Moved definitions from bcmsdh_sdmmc.h to bcmsdbus.h.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h | 109 +++++++++++++++-
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 22 +++
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c | 2 +-
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 11 ++-
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h | 140 --------------------
.../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c | 2 -
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 90 +++++++++++++-
drivers/staging/brcm80211/brcmfmac/sbsdio.h | 96 -------------
drivers/staging/brcm80211/brcmfmac/sdio_host.h | 24 ----
9 files changed, 228 insertions(+), 268 deletions(-)
delete mode 100644 drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
index 3ba3c3f..3dff170 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
@@ -32,6 +32,60 @@
#define SDIOH_DATA_PIO 0 /* PIO mode */
#define SDIOH_DATA_DMA 1 /* DMA mode */
+/* internal return code */
+#define SUCCESS 0
+#define ERROR 1
+
+/* Common msglevel constants */
+#define SDH_ERROR_VAL 0x0001 /* Error */
+#define SDH_TRACE_VAL 0x0002 /* Trace */
+#define SDH_INFO_VAL 0x0004 /* Info */
+#define SDH_DEBUG_VAL 0x0008 /* Debug */
+#define SDH_DATA_VAL 0x0010 /* Data */
+#define SDH_CTRL_VAL 0x0020 /* Control Regs */
+#define SDH_LOG_VAL 0x0040 /* Enable bcmlog */
+#define SDH_DMA_VAL 0x0080 /* DMA */
+
+#ifdef BCMDBG
+#define sd_err(x) \
+ do { \
+ if ((sd_msglevel & SDH_ERROR_VAL) && net_ratelimit()) \
+ printk x; \
+ } while (0)
+#define sd_trace(x) \
+ do { \
+ if ((sd_msglevel & SDH_TRACE_VAL) && net_ratelimit()) \
+ printk x; \
+ } while (0)
+#define sd_info(x) \
+ do { \
+ if ((sd_msglevel & SDH_INFO_VAL) && net_ratelimit()) \
+ printk x; \
+ } while (0)
+#define sd_debug(x) \
+ do { \
+ if ((sd_msglevel & SDH_DEBUG_VAL) && net_ratelimit()) \
+ printk x; \
+ } while (0)
+#define sd_data(x) \
+ do { \
+ if ((sd_msglevel & SDH_DATA_VAL) && net_ratelimit()) \
+ printk x; \
+ } while (0)
+#define sd_ctrl(x) \
+ do { \
+ if ((sd_msglevel & SDH_CTRL_VAL) && net_ratelimit()) \
+ printk x; \
+ } while (0)
+#else
+#define sd_err(x)
+#define sd_trace(x)
+#define sd_info(x)
+#define sd_debug(x)
+#define sd_data(x)
+#define sd_ctrl(x)
+#endif
+
struct brcmf_sdreg {
int func;
int offset;
@@ -41,6 +95,54 @@ struct brcmf_sdreg {
/* callback function, taking one arg */
typedef void (*sdioh_cb_fn_t) (void *);
+struct sdioh_info {
+ struct osl_info *osh; /* osh handler */
+ bool client_intr_enabled; /* interrupt connnected flag */
+ bool intr_handler_valid; /* client driver interrupt handler valid */
+ sdioh_cb_fn_t intr_handler; /* registered interrupt handler */
+ void *intr_handler_arg; /* argument to call interrupt handler */
+ u16 intmask; /* Current active interrupts */
+ void *sdos_info; /* Pointer to per-OS private data */
+
+ uint irq; /* Client irq */
+ int intrcount; /* Client interrupts */
+ bool sd_blockmode; /* sd_blockmode == false => 64 Byte Cmd 53s. */
+ /* Must be on for sd_multiblock to be effective */
+ bool use_client_ints; /* If this is false, make sure to restore */
+ int client_block_size[SDIOD_MAX_IOFUNCS]; /* Blocksize */
+ u8 num_funcs; /* Supported funcs on client */
+ u32 com_cis_ptr;
+ u32 func_cis_ptr[SDIOD_MAX_IOFUNCS];
+ uint max_dma_len;
+ uint max_dma_descriptors; /* DMA Descriptors supported by this controller. */
+ /* SDDMA_DESCRIPTOR SGList[32]; *//* Scatter/Gather DMA List */
+};
+
+struct brcmf_sdmmc_instance {
+ struct sdioh_info *sd;
+ struct sdio_func *func[SDIOD_MAX_IOFUNCS];
+ u32 host_claimed;
+};
+
+/* Allocate/init/free per-OS private data */
+extern int brcmf_sdioh_osinit(struct sdioh_info *sd);
+extern void brcmf_sdioh_osfree(struct sdioh_info *sd);
+
+/* OS-independent interrupt handler */
+extern bool brcmf_sdioh_check_client_intr(struct sdioh_info *sd);
+
+/* Core interrupt enable/disable of device interrupts */
+extern void brcmf_sdioh_dev_intr_on(struct sdioh_info *sd);
+extern void brcmf_sdioh_dev_intr_off(struct sdioh_info *sd);
+
+/* Register mapping routines */
+extern u32 *brcmf_sdioh_reg_map(s32 addr, int size);
+extern void brcmf_sdioh_reg_unmap(s32 addr, int size);
+
+/* Interrupt (de)registration routines */
+extern int brcmf_sdioh_register_irq(struct sdioh_info *sd, uint irq);
+extern void brcmf_sdioh_free_irq(uint irq, struct sdioh_info *sd);
+
/* attach, return handler on success, NULL if failed.
* The handler shall be provided by all subsequent calls. No local cache
* cfghdl points to the starting address of pci device mapped memory
@@ -59,9 +161,6 @@ brcmf_sdioh_interrupt_query(struct sdioh_info *si, bool *onoff);
extern int
brcmf_sdioh_interrupt_set(struct sdioh_info *si, bool enable_disable);
-extern int brcmf_sdioh_claim_host_and_lock(struct sdioh_info *si);
-extern int brcmf_sdioh_release_host_and_unlock(struct sdioh_info *si);
-
/* read or write one byte using cmd52 */
extern int
brcmf_sdioh_request_byte(struct sdioh_info *si, uint rw, uint fnc, uint addr,
@@ -105,4 +204,8 @@ void *brcmf_sdcard_get_sdioh(struct brcmf_sdio_card *card);
/* Watchdog timer interface for pm ops */
extern void brcmf_sdio_wdtmr_enable(bool enable);
+extern uint sd_msglevel; /* Debug message level */
+
+extern struct brcmf_sdmmc_instance *gInstance;
+
#endif /* _sdio_api_h_ */
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
index 09bad40..fd36679 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
@@ -31,6 +31,28 @@
#include "dhd.h"
#define SDIOH_API_ACCESS_RETRY_LIMIT 2
+
+#define BRCMF_SD_ERROR_VAL 0x0001 /* Error */
+#define BRCMF_SD_INFO_VAL 0x0002 /* Info */
+
+#ifdef BCMDBG
+#define BRCMF_SD_ERROR(x) \
+ do { \
+ if ((brcmf_sdio_msglevel & BRCMF_SD_ERROR_VAL) && \
+ net_ratelimit()) \
+ printk x; \
+ } while (0)
+#define BRCMF_SD_INFO(x) \
+ do { \
+ if ((brcmf_sdio_msglevel & BRCMF_SD_INFO_VAL) && \
+ net_ratelimit()) \
+ printk x; \
+ } while (0)
+#else /* BCMDBG */
+#define BRCMF_SD_ERROR(x)
+#define BRCMF_SD_INFO(x)
+#endif /* BCMDBG */
+
const uint brcmf_sdio_msglevel = BRCMF_SD_ERROR_VAL;
struct brcmf_sdio_card {
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
index fe875e8..56e2435 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
@@ -34,6 +34,7 @@
#include "dngl_stats.h"
#include "dhd.h"
#include "dhd_bus.h"
+#include "bcmsdbus.h"
/**
* SDIO Host Controller info
@@ -208,7 +209,6 @@ void brcmf_sdio_unregister(void)
/* Module parameters specific to each host-controller driver */
-extern uint sd_msglevel; /* Debug message level */
module_param(sd_msglevel, uint, 0);
extern uint sd_f2_blocksize;
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 7bc9d02..4f4ec47 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -30,7 +30,16 @@
#include "bcmsdbus.h"
#include "dngl_stats.h"
#include "dhd.h"
-#include "bcmsdh_sdmmc.h"
+
+#define BLOCK_SIZE_64 64
+#define BLOCK_SIZE_512 512
+#define BLOCK_SIZE_4318 64
+#define BLOCK_SIZE_4328 512
+
+/* private bus modes */
+#define SDIOH_MODE_SD4 2
+
+#define CLIENT_INTR 0x100 /* Get rid of this! */
static void brcmf_sdioh_irqhandler(struct sdio_func *func);
static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func);
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
deleted file mode 100644
index 962fa4b..0000000
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * Copyright (c) 2010 Broadcom Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-/*
- * BRCMF SDIO Function Driver for the native SDIO/MMC driver in the Linux Kernel
- */
-
-#ifndef __BCMSDH_SDMMC_H__
-#define __BCMSDH_SDMMC_H__
-
-/* Common msglevel constants */
-#define SDH_ERROR_VAL 0x0001 /* Error */
-#define SDH_TRACE_VAL 0x0002 /* Trace */
-#define SDH_INFO_VAL 0x0004 /* Info */
-#define SDH_DEBUG_VAL 0x0008 /* Debug */
-#define SDH_DATA_VAL 0x0010 /* Data */
-#define SDH_CTRL_VAL 0x0020 /* Control Regs */
-#define SDH_LOG_VAL 0x0040 /* Enable bcmlog */
-#define SDH_DMA_VAL 0x0080 /* DMA */
-
-#ifdef BCMDBG
-#define sd_err(x) \
- do { \
- if ((sd_msglevel & SDH_ERROR_VAL) && net_ratelimit()) \
- printk x; \
- } while (0)
-#define sd_trace(x) \
- do { \
- if ((sd_msglevel & SDH_TRACE_VAL) && net_ratelimit()) \
- printk x; \
- } while (0)
-#define sd_info(x) \
- do { \
- if ((sd_msglevel & SDH_INFO_VAL) && net_ratelimit()) \
- printk x; \
- } while (0)
-#define sd_debug(x) \
- do { \
- if ((sd_msglevel & SDH_DEBUG_VAL) && net_ratelimit()) \
- printk x; \
- } while (0)
-#define sd_data(x) \
- do { \
- if ((sd_msglevel & SDH_DATA_VAL) && net_ratelimit()) \
- printk x; \
- } while (0)
-#define sd_ctrl(x) \
- do { \
- if ((sd_msglevel & SDH_CTRL_VAL) && net_ratelimit()) \
- printk x; \
- } while (0)
-#else
-#define sd_err(x)
-#define sd_trace(x)
-#define sd_info(x)
-#define sd_debug(x)
-#define sd_data(x)
-#define sd_ctrl(x)
-#endif
-
-#define BLOCK_SIZE_64 64
-#define BLOCK_SIZE_512 512
-#define BLOCK_SIZE_4318 64
-#define BLOCK_SIZE_4328 512
-
-/* internal return code */
-#define SUCCESS 0
-#define ERROR 1
-
-/* private bus modes */
-#define SDIOH_MODE_SD4 2
-#define CLIENT_INTR 0x100 /* Get rid of this! */
-
-struct sdioh_info {
- struct osl_info *osh; /* osh handler */
- bool client_intr_enabled; /* interrupt connnected flag */
- bool intr_handler_valid; /* client driver interrupt handler valid */
- sdioh_cb_fn_t intr_handler; /* registered interrupt handler */
- void *intr_handler_arg; /* argument to call interrupt handler */
- u16 intmask; /* Current active interrupts */
- void *sdos_info; /* Pointer to per-OS private data */
-
- uint irq; /* Client irq */
- int intrcount; /* Client interrupts */
- bool sd_blockmode; /* sd_blockmode == false => 64 Byte Cmd 53s. */
- /* Must be on for sd_multiblock to be effective */
- bool use_client_ints; /* If this is false, make sure to restore */
- int client_block_size[SDIOD_MAX_IOFUNCS]; /* Blocksize */
- u8 num_funcs; /* Supported funcs on client */
- u32 com_cis_ptr;
- u32 func_cis_ptr[SDIOD_MAX_IOFUNCS];
- uint max_dma_len;
- uint max_dma_descriptors; /* DMA Descriptors supported by this controller. */
- /* SDDMA_DESCRIPTOR SGList[32]; *//* Scatter/Gather DMA List */
-};
-
-/* Global message bits */
-extern uint sd_msglevel;
-
-/* Allocate/init/free per-OS private data */
-extern int brcmf_sdioh_osinit(struct sdioh_info *sd);
-extern void brcmf_sdioh_osfree(struct sdioh_info *sd);
-
-/* OS-independent interrupt handler */
-extern bool brcmf_sdioh_check_client_intr(struct sdioh_info *sd);
-
-/* Core interrupt enable/disable of device interrupts */
-extern void brcmf_sdioh_dev_intr_on(struct sdioh_info *sd);
-extern void brcmf_sdioh_dev_intr_off(struct sdioh_info *sd);
-
-/* Register mapping routines */
-extern u32 *brcmf_sdioh_reg_map(s32 addr, int size);
-extern void brcmf_sdioh_reg_unmap(s32 addr, int size);
-
-/* Interrupt (de)registration routines */
-extern int brcmf_sdioh_register_irq(struct sdioh_info *sd, uint irq);
-extern void brcmf_sdioh_free_irq(uint irq, struct sdioh_info *sd);
-
-struct brcmf_sdmmc_instance {
- struct sdioh_info *sd;
- struct sdio_func *func[SDIOD_MAX_IOFUNCS];
- u32 host_claimed;
-};
-
-extern struct brcmf_sdmmc_instance *gInstance;
-
-#endif /* __BCMSDH_SDMMC_H__ */
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
index b8ab242..0a632f5 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
@@ -50,8 +50,6 @@
#define SDIO_DEVICE_ID_BROADCOM_4319 0x4319
#endif /* !defined(SDIO_DEVICE_ID_BROADCOM_4329) */
-#include <bcmsdh_sdmmc.h>
-
#include "dhd_dbg.h"
#include "wl_cfg80211.h"
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 6a53ac8..c9ec69b 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -33,7 +33,6 @@
#include <soc.h>
#include "sdio_host.h"
#include "bcmsdbus.h"
-#include "bcmsdh_sdmmc.h"
/* register access macros */
#ifndef __BIG_ENDIAN
@@ -413,6 +412,95 @@ BRCMF_SPINWAIT_SLEEP_INIT(sdioh_spinwait_sleep);
#define CORE_SB(base, field) \
(base + SBCONFIGOFF + offsetof(sbconfig_t, field))
+/* core registers */
+struct sdpcmd_regs {
+ u32 corecontrol; /* 0x00, rev8 */
+ u32 corestatus; /* rev8 */
+ u32 PAD[1];
+ u32 biststatus; /* rev8 */
+
+ /* PCMCIA access */
+ u16 pcmciamesportaladdr; /* 0x010, rev8 */
+ u16 PAD[1];
+ u16 pcmciamesportalmask; /* rev8 */
+ u16 PAD[1];
+ u16 pcmciawrframebc; /* rev8 */
+ u16 PAD[1];
+ u16 pcmciaunderflowtimer; /* rev8 */
+ u16 PAD[1];
+
+ /* interrupt */
+ u32 intstatus; /* 0x020, rev8 */
+ u32 hostintmask; /* rev8 */
+ u32 intmask; /* rev8 */
+ u32 sbintstatus; /* rev8 */
+ u32 sbintmask; /* rev8 */
+ u32 funcintmask; /* rev4 */
+ u32 PAD[2];
+ u32 tosbmailbox; /* 0x040, rev8 */
+ u32 tohostmailbox; /* rev8 */
+ u32 tosbmailboxdata; /* rev8 */
+ u32 tohostmailboxdata; /* rev8 */
+
+ /* synchronized access to registers in SDIO clock domain */
+ u32 sdioaccess; /* 0x050, rev8 */
+ u32 PAD[3];
+
+ /* PCMCIA frame control */
+ u8 pcmciaframectrl; /* 0x060, rev8 */
+ u8 PAD[3];
+ u8 pcmciawatermark; /* rev8 */
+ u8 PAD[155];
+
+ /* interrupt batching control */
+ u32 intrcvlazy; /* 0x100, rev8 */
+ u32 PAD[3];
+
+ /* counters */
+ u32 cmd52rd; /* 0x110, rev8 */
+ u32 cmd52wr; /* rev8 */
+ u32 cmd53rd; /* rev8 */
+ u32 cmd53wr; /* rev8 */
+ u32 abort; /* rev8 */
+ u32 datacrcerror; /* rev8 */
+ u32 rdoutofsync; /* rev8 */
+ u32 wroutofsync; /* rev8 */
+ u32 writebusy; /* rev8 */
+ u32 readwait; /* rev8 */
+ u32 readterm; /* rev8 */
+ u32 writeterm; /* rev8 */
+ u32 PAD[40];
+ u32 clockctlstatus; /* rev8 */
+ u32 PAD[7];
+
+ u32 PAD[128]; /* DMA engines */
+
+ /* SDIO/PCMCIA CIS region */
+ char cis[512]; /* 0x400-0x5ff, rev6 */
+
+ /* PCMCIA function control registers */
+ char pcmciafcr[256]; /* 0x600-6ff, rev6 */
+ u16 PAD[55];
+
+ /* PCMCIA backplane access */
+ u16 backplanecsr; /* 0x76E, rev6 */
+ u16 backplaneaddr0; /* rev6 */
+ u16 backplaneaddr1; /* rev6 */
+ u16 backplaneaddr2; /* rev6 */
+ u16 backplaneaddr3; /* rev6 */
+ u16 backplanedata0; /* rev6 */
+ u16 backplanedata1; /* rev6 */
+ u16 backplanedata2; /* rev6 */
+ u16 backplanedata3; /* rev6 */
+ u16 PAD[31];
+
+ /* sprom "size" & "blank" info */
+ u16 spromstatus; /* 0x7BE, rev2 */
+ u32 PAD[464];
+
+ u16 PAD[0x80];
+};
+
#ifdef BCMDBG
/* Device console log buffer state */
struct dhd_console {
diff --git a/drivers/staging/brcm80211/brcmfmac/sbsdio.h b/drivers/staging/brcm80211/brcmfmac/sbsdio.h
index 614a25f..db9f607 100644
--- a/drivers/staging/brcm80211/brcmfmac/sbsdio.h
+++ b/drivers/staging/brcm80211/brcmfmac/sbsdio.h
@@ -274,100 +274,4 @@
/* HW frame tag */
#define SDPCM_FRAMETAG_LEN 4 /* 2 bytes len, 2 bytes check val */
-/* cpp contortions to concatenate w/arg prescan */
-#ifndef PAD
-#define _PADLINE(line) pad ## line
-#define _XSTR(line) _PADLINE(line)
-#define PAD _XSTR(__LINE__)
-#endif /* PAD */
-
-/* core registers */
-struct sdpcmd_regs {
- u32 corecontrol; /* 0x00, rev8 */
- u32 corestatus; /* rev8 */
- u32 PAD[1];
- u32 biststatus; /* rev8 */
-
- /* PCMCIA access */
- u16 pcmciamesportaladdr; /* 0x010, rev8 */
- u16 PAD[1];
- u16 pcmciamesportalmask; /* rev8 */
- u16 PAD[1];
- u16 pcmciawrframebc; /* rev8 */
- u16 PAD[1];
- u16 pcmciaunderflowtimer; /* rev8 */
- u16 PAD[1];
-
- /* interrupt */
- u32 intstatus; /* 0x020, rev8 */
- u32 hostintmask; /* rev8 */
- u32 intmask; /* rev8 */
- u32 sbintstatus; /* rev8 */
- u32 sbintmask; /* rev8 */
- u32 funcintmask; /* rev4 */
- u32 PAD[2];
- u32 tosbmailbox; /* 0x040, rev8 */
- u32 tohostmailbox; /* rev8 */
- u32 tosbmailboxdata; /* rev8 */
- u32 tohostmailboxdata; /* rev8 */
-
- /* synchronized access to registers in SDIO clock domain */
- u32 sdioaccess; /* 0x050, rev8 */
- u32 PAD[3];
-
- /* PCMCIA frame control */
- u8 pcmciaframectrl; /* 0x060, rev8 */
- u8 PAD[3];
- u8 pcmciawatermark; /* rev8 */
- u8 PAD[155];
-
- /* interrupt batching control */
- u32 intrcvlazy; /* 0x100, rev8 */
- u32 PAD[3];
-
- /* counters */
- u32 cmd52rd; /* 0x110, rev8 */
- u32 cmd52wr; /* rev8 */
- u32 cmd53rd; /* rev8 */
- u32 cmd53wr; /* rev8 */
- u32 abort; /* rev8 */
- u32 datacrcerror; /* rev8 */
- u32 rdoutofsync; /* rev8 */
- u32 wroutofsync; /* rev8 */
- u32 writebusy; /* rev8 */
- u32 readwait; /* rev8 */
- u32 readterm; /* rev8 */
- u32 writeterm; /* rev8 */
- u32 PAD[40];
- u32 clockctlstatus; /* rev8 */
- u32 PAD[7];
-
- u32 PAD[128]; /* DMA engines */
-
- /* SDIO/PCMCIA CIS region */
- char cis[512]; /* 0x400-0x5ff, rev6 */
-
- /* PCMCIA function control registers */
- char pcmciafcr[256]; /* 0x600-6ff, rev6 */
- u16 PAD[55];
-
- /* PCMCIA backplane access */
- u16 backplanecsr; /* 0x76E, rev6 */
- u16 backplaneaddr0; /* rev6 */
- u16 backplaneaddr1; /* rev6 */
- u16 backplaneaddr2; /* rev6 */
- u16 backplaneaddr3; /* rev6 */
- u16 backplanedata0; /* rev6 */
- u16 backplanedata1; /* rev6 */
- u16 backplanedata2; /* rev6 */
- u16 backplanedata3; /* rev6 */
- u16 PAD[31];
-
- /* sprom "size" & "blank" info */
- u16 spromstatus; /* 0x7BE, rev2 */
- u32 PAD[464];
-
- u16 PAD[0x80];
-};
-
#endif /* _SBSDIO_H */
diff --git a/drivers/staging/brcm80211/brcmfmac/sdio_host.h b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
index 712d0df..02c820b 100644
--- a/drivers/staging/brcm80211/brcmfmac/sdio_host.h
+++ b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
@@ -18,28 +18,8 @@
#define _BRCM_SDH_H_
#include <linux/skbuff.h>
-#define BRCMF_SD_ERROR_VAL 0x0001 /* Error */
-#define BRCMF_SD_INFO_VAL 0x0002 /* Info */
extern const uint brcmf_sdio_msglevel;
-#ifdef BCMDBG
-#define BRCMF_SD_ERROR(x) \
- do { \
- if ((brcmf_sdio_msglevel & BRCMF_SD_ERROR_VAL) && \
- net_ratelimit()) \
- printk x; \
- } while (0)
-#define BRCMF_SD_INFO(x) \
- do { \
- if ((brcmf_sdio_msglevel & BRCMF_SD_INFO_VAL) && \
- net_ratelimit()) \
- printk x; \
- } while (0)
-#else /* BCMDBG */
-#define BRCMF_SD_ERROR(x)
-#define BRCMF_SD_INFO(x)
-#endif /* BCMDBG */
-
#define SDIO_FUNC_0 0
#define SDIO_FUNC_1 1
#define SDIO_FUNC_2 2
@@ -221,11 +201,7 @@ extern int brcmf_sdio_function_init(void);
extern int brcmf_sdio_register(struct brcmf_sdioh_driver *driver);
extern void brcmf_sdio_unregister(void);
extern bool brcmf_sdio_chipmatch(u16 vendor, u16 device);
-extern void brcmf_sdio_device_remove(void *card);
extern void brcmf_sdio_function_cleanup(void);
-
-extern void brcmf_sdioh_dev_intr_off(struct sdioh_info *sd);
-extern void brcmf_sdioh_dev_intr_on(struct sdioh_info *sd);
extern int brcmf_sdio_probe(struct device *dev);
extern int brcmf_sdio_remove(struct device *dev);
--
1.7.1
From: Roland Vossen <[email protected]>
Code cleanup. Leads to more readable code and better type checking.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 74 ++++++++++++++-----------
1 files changed, 41 insertions(+), 33 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 13a319d..9ac256e 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -847,20 +847,20 @@ r_sdreg32(struct brcmf_bus *bus, u32 *regvar, u32 reg_offset, u32 *retryvar)
}
}
-#define W_SDREG(regval, regaddr, retryvar, typ) \
-do { \
- retryvar = 0; \
- do { \
- W_REG((u32)(regaddr), regval, typ); \
- } while (brcmf_sdcard_regfail(bus->card) && \
- (++retryvar <= retry_limit)); \
- if (retryvar) { \
- bus->regfails += (retryvar-1); \
- if (retryvar > retry_limit) \
- DHD_ERROR(("%s: FAILED REGISTER WRITE, LINE %d\n", \
- __func__, __LINE__)); \
- } \
-} while (0)
+static void
+w_sdreg32(struct brcmf_bus *bus, u32 regval, u32 reg_offset, u32 *retryvar)
+{
+ *retryvar = 0;
+ do {
+ W_REG(bus->ci->buscorebase + reg_offset, regval, u32);
+ } while (brcmf_sdcard_regfail(bus->card) &&
+ (++(*retryvar) <= retry_limit));
+ if (*retryvar) {
+ bus->regfails += (*retryvar-1);
+ if (*retryvar > retry_limit)
+ DHD_ERROR(("FAILED REGISTER WRITE %Xh\n", reg_offset));
+ }
+}
#define DHD_BUS SDIO_BUS
@@ -1173,7 +1173,6 @@ static int brcmf_sdbrcm_clkctl(struct brcmf_bus *bus, uint target, bool pendok)
int brcmf_sdbrcm_bussleep(struct brcmf_bus *bus, bool sleep)
{
struct brcmf_sdio_card *card = bus->card;
- struct sdpcmd_regs *regs = bus->regs;
uint retries = 0;
DHD_INFO(("brcmf_sdbrcm_bussleep: request %s (currently %s)\n",
@@ -1197,7 +1196,8 @@ int brcmf_sdbrcm_bussleep(struct brcmf_bus *bus, bool sleep)
brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
/* Tell device to start using OOB wakeup */
- W_SDREG(SMB_USE_OOB, ®s->tosbmailbox, retries, u32);
+ w_sdreg32(bus, SMB_USE_OOB,
+ offsetof(struct sdpcmd_regs, tosbmailbox), &retries);
if (retries > retry_limit)
DHD_ERROR(("CANNOT SIGNAL CHIP, WILL NOT WAKE UP!!\n"));
@@ -1236,9 +1236,12 @@ int brcmf_sdbrcm_bussleep(struct brcmf_bus *bus, bool sleep)
brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
/* Send misc interrupt to indicate OOB not needed */
- W_SDREG(0, ®s->tosbmailboxdata, retries, u32);
+ w_sdreg32(bus, 0, offsetof(struct sdpcmd_regs, tosbmailboxdata),
+ &retries);
if (retries <= retry_limit)
- W_SDREG(SMB_DEV_INT, ®s->tosbmailbox, retries, u32);
+ w_sdreg32(bus, SMB_DEV_INT,
+ offsetof(struct sdpcmd_regs, tosbmailbox),
+ &retries);
if (retries > retry_limit)
DHD_ERROR(("CANNOT SIGNAL CHIP TO CLEAR OOB!!\n"));
@@ -3036,7 +3039,8 @@ static int brcmf_sdbrcm_download_state(struct brcmf_bus *bus, bool enter)
bcmerror = 0;
}
- W_SDREG(0xFFFFFFFF, &bus->regs->intstatus, retries, u32);
+ w_sdreg32(bus, 0xFFFFFFFF,
+ offsetof(struct sdpcmd_regs, intstatus), &retries);
brcmf_sdbrcm_chip_resetcore(bus->card, bus->ci->armcorebase);
@@ -3169,7 +3173,7 @@ void brcmf_sdbrcm_bus_stop(struct brcmf_bus *bus, bool enforce_mutex)
tasklet_kill(&bus->tasklet);
/* Disable and clear interrupts at the chip level also */
- W_SDREG(0, &bus->regs->hostintmask, retries, u32);
+ w_sdreg32(bus, 0, offsetof(struct sdpcmd_regs, hostintmask), &retries);
local_hostintmask = bus->hostintmask;
bus->hostintmask = 0;
@@ -3196,7 +3200,8 @@ void brcmf_sdbrcm_bus_stop(struct brcmf_bus *bus, bool enforce_mutex)
SDIO_FUNC_ENABLE_1, NULL);
/* Clear any pending interrupts now that F2 is disabled */
- W_SDREG(local_hostintmask, &bus->regs->intstatus, retries, u32);
+ w_sdreg32(bus, local_hostintmask,
+ offsetof(struct sdpcmd_regs, intstatus), &retries);
/* Turn off the backplane clock (only) */
brcmf_sdbrcm_clkctl(bus, CLK_SDONLY, false);
@@ -3274,8 +3279,8 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex)
}
/* Enable function 2 (frame transfers) */
- W_SDREG((SDPCM_PROT_VERSION << SMB_DATA_VERSION_SHIFT),
- &bus->regs->tosbmailboxdata, retries, u32);
+ w_sdreg32(bus, SDPCM_PROT_VERSION << SMB_DATA_VERSION_SHIFT,
+ offsetof(struct sdpcmd_regs, tosbmailboxdata), &retries);
enable = (SDIO_FUNC_ENABLE_1 | SDIO_FUNC_ENABLE_2);
brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_0, SDIO_CCCR_IOEx, enable,
@@ -3296,9 +3301,8 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex)
if (ready == enable) {
/* Set up the interrupt mask and enable interrupts */
bus->hostintmask = HOSTINTMASK;
- W_SDREG(bus->hostintmask,
- (unsigned int *)CORE_BUS_REG(bus->ci->buscorebase,
- hostintmask), retries, u32);
+ w_sdreg32(bus, bus->hostintmask,
+ offsetof(struct sdpcmd_regs, hostintmask), &retries);
brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_1, SBSDIO_WATERMARK,
(u8) watermark, &err);
@@ -3356,7 +3360,6 @@ exit:
static void brcmf_sdbrcm_rxfail(struct brcmf_bus *bus, bool abort, bool rtx)
{
struct brcmf_sdio_card *card = bus->card;
- struct sdpcmd_regs *regs = bus->regs;
uint retries = 0;
u16 lastrbc;
u8 hi, lo;
@@ -3402,7 +3405,9 @@ static void brcmf_sdbrcm_rxfail(struct brcmf_bus *bus, bool abort, bool rtx)
if (rtx) {
bus->rxrtx++;
- W_SDREG(SMB_NAK, ®s->tosbmailbox, retries, u32);
+ w_sdreg32(bus, SMB_NAK,
+ offsetof(struct sdpcmd_regs, tosbmailbox), &retries);
+
bus->f1regdata++;
if (retries <= retry_limit)
bus->rxskip = true;
@@ -4523,7 +4528,6 @@ deliver:
static u32 brcmf_sdbrcm_hostmail(struct brcmf_bus *bus)
{
- struct sdpcmd_regs *regs = bus->regs;
u32 intstatus = 0;
u32 hmb_data;
u8 fcbits;
@@ -4536,7 +4540,8 @@ static u32 brcmf_sdbrcm_hostmail(struct brcmf_bus *bus)
offsetof(struct sdpcmd_regs, tohostmailboxdata), &retries);
if (retries <= retry_limit)
- W_SDREG(SMB_INT_ACK, ®s->tosbmailbox, retries, u32);
+ w_sdreg32(bus, SMB_INT_ACK,
+ offsetof(struct sdpcmd_regs, tosbmailbox), &retries);
bus->f1regdata += 2;
/* Dongle recomposed rx frames, accept them again */
@@ -4600,7 +4605,6 @@ static u32 brcmf_sdbrcm_hostmail(struct brcmf_bus *bus)
static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)
{
struct brcmf_sdio_card *card = bus->card;
- struct sdpcmd_regs *regs = bus->regs;
u32 intstatus, newstatus = 0;
uint retries = 0;
uint rxlimit = brcmf_rxbound; /* Rx frames to read before resched */
@@ -4686,7 +4690,9 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)
newstatus &= bus->hostintmask;
bus->fcstate = !!(newstatus & I_HMB_FC_STATE);
if (newstatus) {
- W_SDREG(newstatus, ®s->intstatus, retries, u32);
+ w_sdreg32(bus, newstatus,
+ offsetof(struct sdpcmd_regs, intstatus),
+ &retries);
bus->f1regdata++;
}
}
@@ -4701,7 +4707,9 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)
*/
if (intstatus & I_HMB_FC_CHANGE) {
intstatus &= ~I_HMB_FC_CHANGE;
- W_SDREG(I_HMB_FC_CHANGE, ®s->intstatus, retries, u32);
+ w_sdreg32(bus, I_HMB_FC_CHANGE,
+ offsetof(struct sdpcmd_regs, intstatus), &retries);
+
r_sdreg32(bus, &newstatus,
offsetof(struct sdpcmd_regs, intstatus), &retries);
bus->f1regdata += 2;
--
1.7.1
From: Arend van Spriel <[email protected]>
The calls in dhd_sdio.c to bcmsdh_recv_buf() function passed a wrong
handle. The parameter in the function prototype was typed as void
pointer so compiler could not detect. This patch makes the type
explicit and fixes the calls to the function.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 3 +--
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 14 +++++++-------
drivers/staging/brcm80211/brcmfmac/sdio_host.h | 2 +-
3 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
index 3d0c8e7..58dffc0 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
@@ -447,11 +447,10 @@ bool bcmsdh_regfail(void *sdh)
}
int
-bcmsdh_recv_buf(void *sdh, u32 addr, uint fn, uint flags,
+bcmsdh_recv_buf(bcmsdh_info_t *bcmsdh, u32 addr, uint fn, uint flags,
u8 *buf, uint nbytes, struct sk_buff *pkt,
bcmsdh_cmplt_fn_t complete, void *handle)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
SDIOH_API_RC status;
uint incr_fix;
uint width;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 0fae0b1..7e4dfde 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -3323,7 +3323,7 @@ dhdsdio_read_control(dhd_bus_t *bus, u8 *hdr, uint len, uint doff)
}
/* Read remainder of frame body into the rxctl buffer */
- sdret = bcmsdh_recv_buf(bus, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2,
+ sdret = bcmsdh_recv_buf(sdh, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2,
F2SYNC, (bus->rxctl + firstread), rdlen,
NULL, NULL, NULL);
bus->f2rxdata++;
@@ -3485,12 +3485,12 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
* packet and and copy into the chain.
*/
if (usechain) {
- errcode = bcmsdh_recv_buf(bus,
+ errcode = bcmsdh_recv_buf(bus->sdh,
bcmsdh_cur_sbwad(bus->sdh), SDIO_FUNC_2,
F2SYNC, (u8 *) pfirst->data, dlen,
pfirst, NULL, NULL);
} else if (bus->dataptr) {
- errcode = bcmsdh_recv_buf(bus,
+ errcode = bcmsdh_recv_buf(bus->sdh,
bcmsdh_cur_sbwad(bus->sdh), SDIO_FUNC_2,
F2SYNC, bus->dataptr, dlen,
NULL, NULL, NULL);
@@ -3867,7 +3867,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
ASSERT(bus->rxctl >= bus->rxbuf);
rxbuf = bus->rxctl;
/* Read the entire frame */
- sdret = bcmsdh_recv_buf(bus,
+ sdret = bcmsdh_recv_buf(sdh,
bcmsdh_cur_sbwad(sdh),
SDIO_FUNC_2, F2SYNC,
rxbuf, rdlen,
@@ -3908,7 +3908,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
PKTALIGN(pkt, rdlen, DHD_SDALIGN);
rxbuf = (u8 *) (pkt->data);
/* Read the entire frame */
- sdret = bcmsdh_recv_buf(bus,
+ sdret = bcmsdh_recv_buf(sdh,
bcmsdh_cur_sbwad(sdh),
SDIO_FUNC_2, F2SYNC,
rxbuf, rdlen,
@@ -4086,7 +4086,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
break;
/* Read frame header (hardware and software) */
- sdret = bcmsdh_recv_buf(bus, bcmsdh_cur_sbwad(sdh),
+ sdret = bcmsdh_recv_buf(sdh, bcmsdh_cur_sbwad(sdh),
SDIO_FUNC_2, F2SYNC, bus->rxhdr, firstread,
NULL, NULL, NULL);
bus->f2rxhdrs++;
@@ -4247,7 +4247,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
PKTALIGN(pkt, rdlen, DHD_SDALIGN);
/* Read the remaining frame data */
- sdret = bcmsdh_recv_buf(bus, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2,
+ sdret = bcmsdh_recv_buf(sdh, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2,
F2SYNC, ((u8 *) (pkt->data)), rdlen,
pkt, NULL, NULL);
bus->f2rxdata++;
diff --git a/drivers/staging/brcm80211/brcmfmac/sdio_host.h b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
index 96a43cb..7fa79d6 100644
--- a/drivers/staging/brcm80211/brcmfmac/sdio_host.h
+++ b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
@@ -150,7 +150,7 @@ typedef void (*bcmsdh_cmplt_fn_t) (void *handle, int status, bool sync_waiting);
extern int bcmsdh_send_buf(void *sdh, u32 addr, uint fn, uint flags,
u8 *buf, uint nbytes, void *pkt,
bcmsdh_cmplt_fn_t complete, void *handle);
-extern int bcmsdh_recv_buf(void *sdh, u32 addr, uint fn, uint flags,
+extern int bcmsdh_recv_buf(bcmsdh_info_t *sdh, u32 addr, uint fn, uint flags,
u8 *buf, uint nbytes, struct sk_buff *pkt,
bcmsdh_cmplt_fn_t complete, void *handle);
--
1.7.1
From: Henry Ptasinski <[email protected]>
wlc_phy_shared_detach() is an unnecessary level of indirection to just
call kfree(), so replace the function with kfree().
Signed-off-by: Henry Ptasinski <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/bmac.c | 2 +-
drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c | 7 -------
drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h | 1 -
3 files changed, 1 insertions(+), 9 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/bmac.c b/drivers/staging/brcm80211/brcmsmac/bmac.c
index 90d1b32..f44f581 100644
--- a/drivers/staging/brcm80211/brcmsmac/bmac.c
+++ b/drivers/staging/brcm80211/brcmsmac/bmac.c
@@ -982,7 +982,7 @@ int brcms_b_detach(struct brcms_c_info *wlc)
}
/* Free shared phy state */
- wlc_phy_shared_detach(wlc_hw->phy_sh);
+ kfree(wlc_hw->phy_sh);
wlc_phy_shim_detach(wlc_hw->physhim);
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
index a15c145..b527e5f 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
@@ -506,13 +506,6 @@ shared_phy_t *wlc_phy_shared_attach(shared_phy_params_t *shp)
return sh;
}
-void wlc_phy_shared_detach(shared_phy_t *phy_sh)
-{
- if (phy_sh) {
- kfree(phy_sh);
- }
-}
-
wlc_phy_t *wlc_phy_attach(shared_phy_t *sh, void *regs, int bandtype,
char *vars, struct wiphy *wiphy)
{
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h b/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h
index 3c125c3..0ea337b 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h
@@ -177,7 +177,6 @@ struct shared_phy_params {
extern shared_phy_t *wlc_phy_shared_attach(shared_phy_params_t *shp);
-extern void wlc_phy_shared_detach(shared_phy_t *phy_sh);
extern wlc_phy_t *wlc_phy_attach(shared_phy_t *sh, void *regs, int bandtype,
char *vars, struct wiphy *wiphy);
extern void wlc_phy_detach(wlc_phy_t *ppi);
--
1.7.1
From: Roland Vossen <[email protected]>
Code cleanup. Leads to more readable code and better type checking.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 68 ++++++++++++++----------
1 files changed, 40 insertions(+), 28 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 5a15002..13a319d 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -403,7 +403,10 @@ struct rte_console {
BRCMF_SPINWAIT_SLEEP_INIT(sdioh_spinwait_sleep);
-/* Core reg address translation */
+/*
+ * Core reg address translation.
+ * Both macro's returns a 32 bits byte address on the backplane bus.
+ */
#define CORE_CC_REG(base, field) (base + offsetof(chipcregs_t, field))
#define CORE_BUS_REG(base, field) \
(base + offsetof(struct sdpcmd_regs, field))
@@ -530,7 +533,7 @@ struct chip_info {
u32 cccorebase;
u32 ccrev;
u32 cccaps;
- u32 buscorebase;
+ u32 buscorebase; /* 32 bits backplane bus address */
u32 buscorerev;
u32 buscoretype;
u32 ramcorebase;
@@ -549,7 +552,8 @@ struct brcmf_bus {
uint varsz; /* Size of variables buffer */
u32 sbaddr; /* Current SB window pointer (-1, invalid) */
- struct sdpcmd_regs *regs; /* SDIO core */
+ /* SDIO core, 32 bit address on the backplane bus: */
+ struct sdpcmd_regs *regs;
uint sdpcmrev; /* SDIO core revision */
uint armrev; /* CPU core revision */
uint ramrev; /* SOCRAM core revision */
@@ -822,24 +826,26 @@ static bool brcmf_readahead;
(((u8)(bus->tx_max - bus->tx_seq) != 0) && \
(((u8)(bus->tx_max - bus->tx_seq) & 0x80) == 0))
-/* Macros to get register read/write status */
-/* NOTE: these assume a local dhdsdio_bus_t *bus! */
-#define R_SDREG(regvar, regaddr, retryvar, typ) \
-do { \
- retryvar = 0; \
- do { \
- regvar = R_REG((u32)(regaddr), typ); \
- } while (brcmf_sdcard_regfail(bus->card) && \
- (++retryvar <= retry_limit)); \
- if (retryvar) { \
- bus->regfails += (retryvar-1); \
- if (retryvar > retry_limit) { \
- DHD_ERROR(("%s: FAILED" #regvar "READ, LINE %d\n", \
- __func__, __LINE__)); \
- regvar = 0; \
- } \
- } \
-} while (0)
+/*
+ * Reads a register in the SDIO hardware block. This block occupies a series of
+ * adresses on the 32 bit backplane bus.
+ */
+static void
+r_sdreg32(struct brcmf_bus *bus, u32 *regvar, u32 reg_offset, u32 *retryvar)
+{
+ *retryvar = 0;
+ do {
+ *regvar = R_REG(bus->ci->buscorebase + reg_offset, u32);
+ } while (brcmf_sdcard_regfail(bus->card) &&
+ (++(*retryvar) <= retry_limit));
+ if (*retryvar) {
+ bus->regfails += (*retryvar-1);
+ if (*retryvar > retry_limit) {
+ DHD_ERROR(("FAILED READ %Xh\n", reg_offset));
+ *regvar = 0;
+ }
+ }
+}
#define W_SDREG(regval, regaddr, retryvar, typ) \
do { \
@@ -992,8 +998,9 @@ static int brcmf_sdbrcm_htclk(struct brcmf_bus *bus, bool on, bool pendok)
if (pendok && ((bus->ci->buscoretype == PCMCIA_CORE_ID)
&& (bus->ci->buscorerev == 9))) {
u32 dummy, retries;
- R_SDREG(dummy, &bus->regs->clockctlstatus, retries,
- u32);
+ r_sdreg32(bus, &dummy,
+ offsetof(struct sdpcmd_regs, clockctlstatus),
+ &retries);
}
/* Check current status */
@@ -1521,7 +1528,6 @@ static uint brcmf_sdbrcm_sendfromq(struct brcmf_bus *bus, uint maxframes)
u8 tx_prec_map;
struct brcmf_pub *drvr = bus->drvr;
- struct sdpcmd_regs *regs = bus->regs;
DHD_TRACE(("%s: Enter\n", __func__));
@@ -1553,7 +1559,9 @@ static uint brcmf_sdbrcm_sendfromq(struct brcmf_bus *bus, uint maxframes)
/* In poll mode, need to check for other events */
if (!bus->intr && cnt) {
/* Check device status, signal pending interrupt */
- R_SDREG(intstatus, ®s->intstatus, retries, u32);
+ r_sdreg32(bus, &intstatus,
+ offsetof(struct sdpcmd_regs, intstatus),
+ &retries);
bus->f2txdata++;
if (brcmf_sdcard_regfail(bus->card))
break;
@@ -4524,7 +4532,9 @@ static u32 brcmf_sdbrcm_hostmail(struct brcmf_bus *bus)
DHD_TRACE(("%s: Enter\n", __func__));
/* Read mailbox data and ack that we did so */
- R_SDREG(hmb_data, ®s->tohostmailboxdata, retries, u32);
+ r_sdreg32(bus, &hmb_data,
+ offsetof(struct sdpcmd_regs, tohostmailboxdata), &retries);
+
if (retries <= retry_limit)
W_SDREG(SMB_INT_ACK, ®s->tosbmailbox, retries, u32);
bus->f1regdata += 2;
@@ -4668,7 +4678,8 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)
/* Pending interrupt indicates new device status */
if (bus->ipend) {
bus->ipend = false;
- R_SDREG(newstatus, ®s->intstatus, retries, u32);
+ r_sdreg32(bus, &newstatus,
+ offsetof(struct sdpcmd_regs, intstatus), &retries);
bus->f1regdata++;
if (brcmf_sdcard_regfail(bus->card))
newstatus = 0;
@@ -4691,7 +4702,8 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)
if (intstatus & I_HMB_FC_CHANGE) {
intstatus &= ~I_HMB_FC_CHANGE;
W_SDREG(I_HMB_FC_CHANGE, ®s->intstatus, retries, u32);
- R_SDREG(newstatus, ®s->intstatus, retries, u32);
+ r_sdreg32(bus, &newstatus,
+ offsetof(struct sdpcmd_regs, intstatus), &retries);
bus->f1regdata += 2;
bus->fcstate =
!!(newstatus & (I_HMB_FC_STATE | I_HMB_FC_CHANGE));
--
1.7.1
From: Arend van Spriel <[email protected]>
Renamed external function getting rid of wl_ prefix. Removed unused
function from the API header file wl_cfg80211.h as it was not defined.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
.../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c | 2 +-
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 14 ++++++++------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 18 +++++++++---------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h | 19 +++++++++----------
4 files changed, 27 insertions(+), 26 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
index cdaa042..e229bcb 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
@@ -88,7 +88,7 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
gInstance->func[func->num] = func;
if (func->num == 2) {
- wl_cfg80211_sdio_func(func);
+ brcmf_cfg80211_sdio_func(func);
sd_trace(("F2 found, calling brcmf_sdio_probe...\n"));
ret = brcmf_sdio_probe(&sdmmc_dev);
}
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 8db4609..a6dc346 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -1052,7 +1052,8 @@ static void brcmf_ethtool_get_drvinfo(struct net_device *net,
sprintf(info->driver, KBUILD_MODNAME);
sprintf(info->version, "%lu", drvr_priv->pub.drv_version);
sprintf(info->fw_version, "%s", BCM4329_FW_NAME);
- sprintf(info->bus_info, "%s", dev_name(&wl_cfg80211_get_sdio_func()->dev));
+ sprintf(info->bus_info, "%s",
+ dev_name(&brcmf_cfg80211_get_sdio_func()->dev));
}
struct ethtool_ops brcmf_ethtool_ops = {
@@ -1292,7 +1293,7 @@ static int brcmf_netdev_stop(struct net_device *net)
struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
DHD_TRACE(("%s: Enter\n", __func__));
- wl_cfg80211_down();
+ brcmf_cfg80211_down();
if (drvr_priv->pub.up == 0)
return 0;
@@ -1338,7 +1339,7 @@ static int brcmf_netdev_open(struct net_device *net)
/* Allow transmit calls */
netif_start_queue(net);
drvr_priv->pub.up = 1;
- if (unlikely(wl_cfg80211_up())) {
+ if (unlikely(brcmf_cfg80211_up())) {
DHD_ERROR(("%s: failed to bring up cfg80211\n",
__func__));
return -1;
@@ -1464,7 +1465,7 @@ struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)
}
/* Attach and link in the cfg80211 */
- if (unlikely(wl_cfg80211_attach(net, &drvr_priv->pub))) {
+ if (unlikely(brcmf_cfg80211_attach(net, &drvr_priv->pub))) {
DHD_ERROR(("wl_cfg80211_attach failed\n"));
goto fail;
}
@@ -1700,7 +1701,7 @@ void brcmf_detach(struct brcmf_pub *drvr)
if (drvr->prot)
brcmf_proto_detach(drvr);
- wl_cfg80211_detach();
+ brcmf_cfg80211_detach();
/* && defined(DHD_GPL) */
free_netdev(ifp->net);
@@ -1824,7 +1825,8 @@ static int brcmf_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktd
ASSERT(drvr_priv->iflist[*ifidx] != NULL);
ASSERT(drvr_priv->iflist[*ifidx]->net != NULL);
if (drvr_priv->iflist[*ifidx]->net)
- wl_cfg80211_event(drvr_priv->iflist[*ifidx]->net, event, *data);
+ brcmf_cfg80211_event(drvr_priv->iflist[*ifidx]->net,
+ event, *data);
return bcmerror;
}
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index d109de1..17a6bf0 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -3440,7 +3440,7 @@ static void wl_deinit_priv(struct brcmf_cfg80211_priv *cfg_priv)
brcmf_deinit_priv_mem(cfg_priv);
}
-s32 wl_cfg80211_attach(struct net_device *ndev, void *data)
+s32 brcmf_cfg80211_attach(struct net_device *ndev, void *data)
{
struct wireless_dev *wdev;
struct brcmf_cfg80211_priv *cfg_priv;
@@ -3456,9 +3456,9 @@ s32 wl_cfg80211_attach(struct net_device *ndev, void *data)
WL_ERR("wl_cfg80211_dev is invalid\n");
return -ENOMEM;
}
- WL_INFO("func %p\n", wl_cfg80211_get_sdio_func());
+ WL_INFO("func %p\n", brcmf_cfg80211_get_sdio_func());
wdev = brcmf_alloc_wdev(sizeof(struct brcmf_cfg80211_iface),
- &wl_cfg80211_get_sdio_func()->dev);
+ &brcmf_cfg80211_get_sdio_func()->dev);
if (IS_ERR(wdev))
return -ENOMEM;
@@ -3485,7 +3485,7 @@ cfg80211_attach_out:
return err;
}
-void wl_cfg80211_detach(void)
+void brcmf_cfg80211_detach(void)
{
struct brcmf_cfg80211_priv *cfg_priv;
@@ -3536,7 +3536,7 @@ static s32 brcmf_event_handler(void *data)
}
void
-wl_cfg80211_event(struct net_device *ndev,
+brcmf_cfg80211_event(struct net_device *ndev,
const struct brcmf_event_msg *e, void *data)
{
u32 event_type = be32_to_cpu(e->event_type);
@@ -3619,7 +3619,7 @@ static void brcmf_put_event(struct brcmf_cfg80211_event_q *e)
kfree(e);
}
-void wl_cfg80211_sdio_func(void *func)
+void brcmf_cfg80211_sdio_func(void *func)
{
cfg80211_sdio_func = (struct sdio_func *)func;
}
@@ -3629,7 +3629,7 @@ static void brcmf_clear_sdio_func(void)
cfg80211_sdio_func = NULL;
}
-struct sdio_func *wl_cfg80211_get_sdio_func(void)
+struct sdio_func *brcmf_cfg80211_get_sdio_func(void)
{
return cfg80211_sdio_func;
}
@@ -3938,7 +3938,7 @@ static s32 __brcmf_cfg80211_down(struct brcmf_cfg80211_priv *cfg_priv)
return 0;
}
-s32 wl_cfg80211_up(void)
+s32 brcmf_cfg80211_up(void)
{
struct brcmf_cfg80211_priv *cfg_priv;
s32 err = 0;
@@ -3951,7 +3951,7 @@ s32 wl_cfg80211_up(void)
return err;
}
-s32 wl_cfg80211_down(void)
+s32 brcmf_cfg80211_down(void)
{
struct brcmf_cfg80211_priv *cfg_priv;
s32 err = 0;
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
index 3ee7a3f..f26d087 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
@@ -343,15 +343,14 @@ static inline struct brcmf_bss_info *next_bss(struct brcmf_scan_results *list,
#define for_each_bss(list, bss, __i) \
for (__i = 0; __i < list->count && __i < WL_AP_MAX; __i++, bss = next_bss(list, bss))
-extern s32 wl_cfg80211_attach(struct net_device *ndev, void *data);
-extern void wl_cfg80211_detach(void);
+extern s32 brcmf_cfg80211_attach(struct net_device *ndev, void *data);
+extern void brcmf_cfg80211_detach(void);
/* event handler from dongle */
-extern void wl_cfg80211_event(struct net_device *ndev,
- const struct brcmf_event_msg *e, void *data);
-extern void wl_cfg80211_sdio_func(void *func); /* set sdio function info */
-extern struct sdio_func *wl_cfg80211_get_sdio_func(void);
-extern s32 wl_cfg80211_up(void); /* dongle up */
-extern s32 wl_cfg80211_down(void); /* dongle down */
-extern void wl_cfg80211_dbg_level(u32 level); /* set dongle
- debugging level */
+extern void brcmf_cfg80211_event(struct net_device *ndev,
+ const struct brcmf_event_msg *e, void *data);
+extern void brcmf_cfg80211_sdio_func(void *func); /* set sdio function info */
+extern struct sdio_func *brcmf_cfg80211_get_sdio_func(void);
+extern s32 brcmf_cfg80211_up(void); /* dongle up */
+extern s32 brcmf_cfg80211_down(void); /* dongle down */
+
#endif /* _wl_cfg80211_h_ */
--
1.7.1
From: Arend van Spriel <[email protected]>
The naming convention in the driver is to be aligned. This commit
changes the prefix used for the ioctl command codes.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 96 +++++++++---------
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 20 ++--
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 58 ++++++------
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 39 ++++----
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 118 +++++++++++-----------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h | 4 +-
6 files changed, 171 insertions(+), 164 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index b16ffc2..14713f5 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -26,50 +26,54 @@ struct dhd_bus;
struct dhd_prot;
struct dhd_info;
-#define WLC_UP 2
-#define WLC_SET_PROMISC 10
-#define WLC_GET_RATE 12
-#define WLC_GET_INFRA 19
-#define WLC_SET_INFRA 20
-#define WLC_GET_AUTH 21
-#define WLC_SET_AUTH 22
-#define WLC_GET_BSSID 23
-#define WLC_GET_SSID 25
-#define WLC_SET_SSID 26
-#define WLC_GET_CHANNEL 29
-#define WLC_GET_SRL 31
-#define WLC_GET_LRL 33
-#define WLC_GET_RADIO 37
-#define WLC_SET_RADIO 38
-#define WLC_GET_PHYTYPE 39
-#define WLC_SET_KEY 45
-#define WLC_SET_PASSIVE_SCAN 49
-#define WLC_SCAN 50
-#define WLC_SCAN_RESULTS 51
-#define WLC_DISASSOC 52
-#define WLC_REASSOC 53
-#define WLC_SET_ROAM_TRIGGER 55
-#define WLC_SET_ROAM_DELTA 57
-#define WLC_GET_DTIMPRD 77
-#define WLC_SET_COUNTRY 84
-#define WLC_GET_PM 85
-#define WLC_SET_PM 86
-#define WLC_GET_AP 117
-#define WLC_SET_AP 118
-#define WLC_GET_RSSI 127
-#define WLC_GET_WSEC 133
-#define WLC_SET_WSEC 134
-#define WLC_GET_PHY_NOISE 135
-#define WLC_GET_BSS_INFO 136
-#define WLC_SET_SCAN_CHANNEL_TIME 185
-#define WLC_SET_SCAN_UNASSOC_TIME 187
-#define WLC_SCB_DEAUTHENTICATE_FOR_REASON 201
-#define WLC_GET_VALID_CHANNELS 217
-#define WLC_GET_KEY_PRIMARY 235
-#define WLC_SET_KEY_PRIMARY 236
-#define WLC_SET_SCAN_PASSIVE_TIME 258
-#define WLC_GET_VAR 262 /* get value of named variable */
-#define WLC_SET_VAR 263 /* set named variable to value */
+#define BRCMF_C_IOCTL_SMLEN 256 /* "small" ioctl buffer required */
+#define BRCMF_C_IOCTL_MEDLEN 1536 /* "med" ioctl buffer required */
+#define BRCMF_C_IOCTL_MAXLEN 8192
+
+#define BRCMF_C_UP 2
+#define BRCMF_C_SET_PROMISC 10
+#define BRCMF_C_GET_RATE 12
+#define BRCMF_C_GET_INFRA 19
+#define BRCMF_C_SET_INFRA 20
+#define BRCMF_C_GET_AUTH 21
+#define BRCMF_C_SET_AUTH 22
+#define BRCMF_C_GET_BSSID 23
+#define BRCMF_C_GET_SSID 25
+#define BRCMF_C_SET_SSID 26
+#define BRCMF_C_GET_CHANNEL 29
+#define BRCMF_C_GET_SRL 31
+#define BRCMF_C_GET_LRL 33
+#define BRCMF_C_GET_RADIO 37
+#define BRCMF_C_SET_RADIO 38
+#define BRCMF_C_GET_PHYTYPE 39
+#define BRCMF_C_SET_KEY 45
+#define BRCMF_C_SET_PASSIVE_SCAN 49
+#define BRCMF_C_SCAN 50
+#define BRCMF_C_SCAN_RESULTS 51
+#define BRCMF_C_DISASSOC 52
+#define BRCMF_C_REASSOC 53
+#define BRCMF_C_SET_ROAM_TRIGGER 55
+#define BRCMF_C_SET_ROAM_DELTA 57
+#define BRCMF_C_GET_DTIMPRD 77
+#define BRCMF_C_SET_COUNTRY 84
+#define BRCMF_C_GET_PM 85
+#define BRCMF_C_SET_PM 86
+#define BRCMF_C_GET_AP 117
+#define BRCMF_C_SET_AP 118
+#define BRCMF_C_GET_RSSI 127
+#define BRCMF_C_GET_WSEC 133
+#define BRCMF_C_SET_WSEC 134
+#define BRCMF_C_GET_PHY_NOISE 135
+#define BRCMF_C_GET_BSS_INFO 136
+#define BRCMF_C_SET_SCAN_CHANNEL_TIME 185
+#define BRCMF_C_SET_SCAN_UNASSOC_TIME 187
+#define BRCMF_C_SCB_DEAUTHENTICATE_FOR_REASON 201
+#define BRCMF_C_GET_VALID_CHANNELS 217
+#define BRCMF_C_GET_KEY_PRIMARY 235
+#define BRCMF_C_SET_KEY_PRIMARY 236
+#define BRCMF_C_SET_SCAN_PASSIVE_TIME 258
+#define BRCMF_C_GET_VAR 262
+#define BRCMF_C_SET_VAR 263
/* phy types (returned by WLC_GET_PHYTPE) */
#define WLC_PHY_TYPE_A 0
@@ -154,10 +158,6 @@ struct dhd_info;
#define WL_KF_RES_5 (1 << 5) /* Reserved for backward compat */
#define WL_IBSS_PEER_GROUP_KEY (1 << 6) /* Indicates a group key for a IBSS PEER */
-#define WLC_IOCTL_SMLEN 256 /* "small" length ioctl buffer required */
-#define WLC_IOCTL_MEDLEN 1536 /* "med" length ioctl buffer required */
-#define WLC_IOCTL_MAXLEN 8192
-
#define DHD_IF_VIF 0x01 /* Virtual IF (Hidden from user) */
/* optionally set by a module_param_string() */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index af78764..0ed62a0 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -109,7 +109,7 @@ typedef struct dhd_prot {
u32 lastcmd;
u8 bus_header[BUS_HEADER_LEN];
struct cdc_ioctl msg;
- unsigned char buf[WLC_IOCTL_MAXLEN + ROUND_UP_MARGIN];
+ unsigned char buf[BRCMF_C_IOCTL_MAXLEN + ROUND_UP_MARGIN];
} dhd_prot_t;
static int dhdcdc_msg(dhd_pub_t *dhd)
@@ -162,7 +162,7 @@ dhdcdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)
DHD_CTL(("%s: cmd %d len %d\n", __func__, cmd, len));
/* Respond "bcmerror" and "bcmerrorstr" with local cache */
- if (cmd == WLC_GET_VAR && buf) {
+ if (cmd == BRCMF_C_GET_VAR && buf) {
if (!strcmp((char *)buf, "bcmerrorstr")) {
strncpy((char *)buf, "bcm_error",
BCME_STRLEN);
@@ -296,9 +296,9 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len)
DHD_TRACE(("%s: Enter\n", __func__));
- ASSERT(len <= WLC_IOCTL_MAXLEN);
+ ASSERT(len <= BRCMF_C_IOCTL_MAXLEN);
- if (len > WLC_IOCTL_MAXLEN)
+ if (len > BRCMF_C_IOCTL_MAXLEN)
goto done;
if (prot->pending == true) {
@@ -306,7 +306,8 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len)
"lastcmd=0x%x (%lu)\n",
ioc->cmd, (unsigned long)ioc->cmd, prot->lastcmd,
(unsigned long)prot->lastcmd));
- if ((ioc->cmd == WLC_SET_VAR) || (ioc->cmd == WLC_GET_VAR))
+ if ((ioc->cmd == BRCMF_C_SET_VAR) ||
+ (ioc->cmd == BRCMF_C_GET_VAR))
DHD_TRACE(("iovar cmd=%s\n", (char *)buf));
goto done;
@@ -332,7 +333,8 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len)
}
/* Intercept the wme_dp ioctl here */
- if ((!ret) && (ioc->cmd == WLC_SET_VAR) && (!strcmp(buf, "wme_dp"))) {
+ if (!ret && ioc->cmd == BRCMF_C_SET_VAR &&
+ !strcmp(buf, "wme_dp")) {
int slen, val = 0;
slen = strlen("wme_dp") + 1;
@@ -464,8 +466,8 @@ int dhd_prot_attach(dhd_pub_t *dhd)
#ifdef BDC
dhd->hdrlen += BDC_HEADER_LEN;
#endif
- dhd->maxctl =
- WLC_IOCTL_MAXLEN + sizeof(struct cdc_ioctl) + ROUND_UP_MARGIN;
+ dhd->maxctl = BRCMF_C_IOCTL_MAXLEN +
+ sizeof(struct cdc_ioctl) + ROUND_UP_MARGIN;
return 0;
fail:
@@ -503,7 +505,7 @@ int dhd_prot_init(dhd_pub_t *dhd)
/* Get the device MAC address */
strcpy(buf, "cur_etheraddr");
- ret = dhdcdc_query_ioctl(dhd, 0, WLC_GET_VAR, buf, sizeof(buf));
+ ret = dhdcdc_query_ioctl(dhd, 0, BRCMF_C_GET_VAR, buf, sizeof(buf));
if (ret < 0) {
dhd_os_proto_unblock(dhd);
return ret;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 849203c..4318bed 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -997,7 +997,7 @@ brcmf_c_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg, int enable,
memcpy((char *)pkt_filterp, &enable_parm, sizeof(enable_parm));
/* Enable/disable the specified filter. */
- rc = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, buf, buf_len);
+ rc = dhdcdc_set_ioctl(dhd, 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",
@@ -1009,7 +1009,7 @@ brcmf_c_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg, int enable,
/* Contorl the master mode */
brcmu_mkiovar("pkt_filter_mode", (char *)&master_mode, 4, buf,
sizeof(buf));
- rc = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, buf, sizeof(buf));
+ rc = dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, buf, sizeof(buf));
rc = rc >= 0 ? 0 : rc;
if (rc)
DHD_TRACE(("%s: failed to add pktfilter %s, retcode = %d\n",
@@ -1140,7 +1140,7 @@ void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg)
&pkt_filter,
WL_PKT_FILTER_FIXED_LEN + WL_PKT_FILTER_PATTERN_FIXED_LEN);
- rc = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, buf, buf_len);
+ rc = dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, buf, buf_len);
rc = rc >= 0 ? 0 : rc;
if (rc)
@@ -1162,8 +1162,8 @@ void brcmf_c_arp_offload_set(dhd_pub_t *dhd, int arp_mode)
int retcode;
brcmu_mkiovar("arp_ol", (char *)&arp_mode, 4, iovbuf, sizeof(iovbuf));
- retcode = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
- sizeof(iovbuf));
+ retcode = dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
+ iovbuf, sizeof(iovbuf));
retcode = retcode >= 0 ? 0 : retcode;
if (retcode)
DHD_TRACE(("%s: failed to set ARP offload mode to 0x%x, "
@@ -1179,8 +1179,8 @@ void brcmf_c_arp_offload_enable(dhd_pub_t *dhd, int arp_enable)
int retcode;
brcmu_mkiovar("arpoe", (char *)&arp_enable, 4, iovbuf, sizeof(iovbuf));
- retcode = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
- sizeof(iovbuf));
+ retcode = dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
+ iovbuf, sizeof(iovbuf));
retcode = retcode >= 0 ? 0 : retcode;
if (retcode)
DHD_TRACE(("%s: failed to enabe ARP offload to %d, "
@@ -1220,8 +1220,8 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
if (!ret) {
brcmu_mkiovar("cur_etheraddr", (void *)ea_addr, ETH_ALEN,
buf, sizeof(buf));
- ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, buf,
- sizeof(buf));
+ ret = dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
+ buf, sizeof(buf));
if (ret < 0) {
DHD_ERROR(("%s: can't set MAC address , error=%d\n",
__func__, ret));
@@ -1233,7 +1233,7 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
/* Set Country code */
if (dhd->country_code[0] != 0) {
- if (dhdcdc_set_ioctl(dhd, 0, WLC_SET_COUNTRY,
+ if (dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_COUNTRY,
dhd->country_code,
sizeof(dhd->country_code)) < 0) {
DHD_ERROR(("%s: country code setting failed\n",
@@ -1245,47 +1245,47 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
memset(buf, 0, sizeof(buf));
ptr = buf;
brcmu_mkiovar("ver", 0, 0, buf, sizeof(buf));
- dhdcdc_query_ioctl(dhd, 0, WLC_GET_VAR, buf, sizeof(buf));
+ dhdcdc_query_ioctl(dhd, 0, BRCMF_C_GET_VAR, buf, sizeof(buf));
strsep(&ptr, "\n");
/* Print fw version info */
DHD_ERROR(("Firmware version = %s\n", buf));
/* Set PowerSave mode */
- dhdcdc_set_ioctl(dhd, 0, WLC_SET_PM, (char *)&power_mode,
+ dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_PM, (char *)&power_mode,
sizeof(power_mode));
/* Match Host and Dongle rx alignment */
brcmu_mkiovar("bus:txglomalign", (char *)&dongle_align, 4, iovbuf,
sizeof(iovbuf));
- dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
+ dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
/* disable glom option per default */
brcmu_mkiovar("bus:txglom", (char *)&glom, 4, iovbuf, sizeof(iovbuf));
- dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
+ dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
/* Setup timeout if Beacons are lost and roam is off to report
link down */
brcmu_mkiovar("bcn_timeout", (char *)&bcn_timeout, 4, iovbuf,
sizeof(iovbuf));
- dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
+ dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
/* Enable/Disable build-in roaming to allowed ext supplicant to take
of romaing */
brcmu_mkiovar("roam_off", (char *)&dhd_roam, 4, iovbuf, sizeof(iovbuf));
- dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
+ dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
/* Force STA UP */
if (dhd_radio_up)
- dhdcdc_set_ioctl(dhd, 0, WLC_UP, (char *)&up, sizeof(up));
+ dhdcdc_set_ioctl(dhd, 0, BRCMF_C_UP, (char *)&up, sizeof(up));
/* Setup event_msgs */
brcmu_mkiovar("event_msgs", dhd->eventmask, WL_EVENTING_MASK_LEN,
iovbuf, sizeof(iovbuf));
- dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
+ dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
- dhdcdc_set_ioctl(dhd, 0, WLC_SET_SCAN_CHANNEL_TIME,
+ dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_SCAN_CHANNEL_TIME,
(char *)&scan_assoc_time, sizeof(scan_assoc_time));
- dhdcdc_set_ioctl(dhd, 0, WLC_SET_SCAN_UNASSOC_TIME,
+ dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_SCAN_UNASSOC_TIME,
(char *)&scan_unassoc_time, sizeof(scan_unassoc_time));
#ifdef ARP_OFFLOAD_SUPPORT
@@ -1626,7 +1626,7 @@ int dhd_iscan_request(void *dhdp, u16 action)
int rc;
wl_iscan_params_t params;
dhd_pub_t *dhd = dhd_bus_pub(dhdp);
- char buf[WLC_IOCTL_SMLEN];
+ char buf[BRCMF_C_IOCTL_SMLEN];
memset(¶ms, 0, sizeof(wl_iscan_params_t));
memcpy(¶ms.params.bssid, ðer_bcast, ETH_ALEN);
@@ -1645,8 +1645,8 @@ int dhd_iscan_request(void *dhdp, u16 action)
params.scan_duration = 0;
brcmu_mkiovar("iscan", (char *)¶ms, sizeof(wl_iscan_params_t), buf,
- WLC_IOCTL_SMLEN);
- rc = dhd_wl_ioctl(dhdp, WLC_SET_VAR, buf, WLC_IOCTL_SMLEN);
+ BRCMF_C_IOCTL_SMLEN);
+ rc = dhd_wl_ioctl(dhdp, BRCMF_C_SET_VAR, buf, BRCMF_C_IOCTL_SMLEN);
return rc;
}
@@ -1683,7 +1683,7 @@ static int dhd_iscan_get_partial_result(void *dhdp, uint *scan_count)
brcmu_mkiovar("iscanresults", (char *)&list,
WL_ISCAN_RESULTS_FIXED_SIZE,
iscan_cur->iscan_buf, WLC_IW_ISCAN_MAXLEN);
- rc = dhd_wl_ioctl(dhdp, WLC_GET_VAR, iscan_cur->iscan_buf,
+ rc = dhd_wl_ioctl(dhdp, BRCMF_C_GET_VAR, iscan_cur->iscan_buf,
WLC_IW_ISCAN_MAXLEN);
results->buflen = results->buflen;
@@ -1714,13 +1714,13 @@ int dhd_pno_clean(dhd_pub_t *dhd)
/* Disable pfn */
iov_len = brcmu_mkiovar("pfn", (char *)&pfn_enabled, 4, iovbuf,
sizeof(iovbuf));
- ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
+ ret = dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
if (ret >= 0) {
/* clear pfn */
iov_len = brcmu_mkiovar("pfnclear", 0, 0, iovbuf,
sizeof(iovbuf));
if (iov_len) {
- ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
+ ret = dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
iov_len);
if (ret < 0) {
DHD_ERROR(("%s failed code %d\n", __func__,
@@ -1750,7 +1750,7 @@ int dhd_pno_enable(dhd_pub_t *dhd, int pfn_enabled)
ret = brcmu_mkiovar("pfn", (char *)&pfn_enabled, 4, iovbuf,
sizeof(iovbuf));
if (ret > 0) {
- ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
+ ret = dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
sizeof(iovbuf));
if (ret < 0) {
DHD_ERROR(("%s failed for error=%d\n", __func__, ret));
@@ -1822,7 +1822,7 @@ dhd_pno_set(dhd_pub_t *dhd, wlc_ssid_t *ssids_local, int nssid, unsigned char sc
brcmu_mkiovar("pfn_set", (char *)&pfn_param, sizeof(pfn_param), iovbuf,
sizeof(iovbuf));
- dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
+ dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
/* set all pfn ssid */
for (i = 0; i < nssid; i++) {
@@ -1840,7 +1840,7 @@ dhd_pno_set(dhd_pub_t *dhd, wlc_ssid_t *ssids_local, int nssid, unsigned char sc
err = brcmu_mkiovar("pfn_add", (char *)&pfn_element,
sizeof(pfn_element), iovbuf, sizeof(iovbuf));
if (err > 0) {
- err = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
+ err = dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
sizeof(iovbuf));
if (err < 0) {
DHD_ERROR(("%s failed for i=%d error=%d\n",
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index da39948..0ab95b3 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -417,7 +417,7 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
DHD_TRACE(("%s: force extra Suspend setting\n",
__func__));
- dhdcdc_set_ioctl(dhd, 0, WLC_SET_PM,
+ dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_PM,
(char *)&power_mode,
sizeof(power_mode));
@@ -437,7 +437,7 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
bcn_li_dtim = dhd->dtim_skip;
brcmu_mkiovar("bcn_li_dtim", (char *)&bcn_li_dtim,
4, iovbuf, sizeof(iovbuf));
- dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
+ dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
sizeof(iovbuf));
#ifdef CUSTOMER_HW2
/* Disable build-in roaming to allowed \
@@ -445,7 +445,7 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
*/
brcmu_mkiovar("roam_off", (char *)&roamvar, 4,
iovbuf, sizeof(iovbuf));
- dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
+ dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
sizeof(iovbuf));
#endif /* CUSTOMER_HW2 */
} else {
@@ -455,7 +455,7 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
__func__));
power_mode = PM_FAST;
- dhdcdc_set_ioctl(dhd, 0, WLC_SET_PM,
+ dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_PM,
(char *)&power_mode,
sizeof(power_mode));
@@ -466,13 +466,13 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
brcmu_mkiovar("bcn_li_dtim", (char *)&dhd->dtim_skip,
4, iovbuf, sizeof(iovbuf));
- dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
+ dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
sizeof(iovbuf));
#ifdef CUSTOMER_HW2
roamvar = 0;
brcmu_mkiovar("roam_off", (char *)&roamvar, 4, iovbuf,
sizeof(iovbuf));
- dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
+ dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
sizeof(iovbuf));
#endif /* CUSTOMER_HW2 */
}
@@ -672,7 +672,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
}
memset(&ioc, 0, sizeof(ioc));
- ioc.cmd = WLC_SET_VAR;
+ ioc.cmd = BRCMF_C_SET_VAR;
ioc.buf = buf;
ioc.len = buflen;
ioc.set = true;
@@ -710,7 +710,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
}
memset(&ioc, 0, sizeof(ioc));
- ioc.cmd = WLC_SET_VAR;
+ ioc.cmd = BRCMF_C_SET_VAR;
ioc.buf = buf;
ioc.len = buflen;
ioc.set = true;
@@ -731,7 +731,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
allmulti = cpu_to_le32(allmulti);
memset(&ioc, 0, sizeof(ioc));
- ioc.cmd = WLC_SET_PROMISC;
+ ioc.cmd = BRCMF_C_SET_PROMISC;
ioc.buf = &allmulti;
ioc.len = sizeof(allmulti);
ioc.set = true;
@@ -759,7 +759,7 @@ _dhd_set_mac_address(dhd_info_t *dhd, int ifidx, u8 *addr)
return -1;
}
memset(&ioc, 0, sizeof(ioc));
- ioc.cmd = WLC_SET_VAR;
+ ioc.cmd = BRCMF_C_SET_VAR;
ioc.buf = buf;
ioc.len = 32;
ioc.set = true;
@@ -1368,7 +1368,7 @@ static int dhd_toe_get(dhd_info_t *dhd, int ifidx, u32 *toe_ol)
memset(&ioc, 0, sizeof(ioc));
- ioc.cmd = WLC_GET_VAR;
+ ioc.cmd = BRCMF_C_GET_VAR;
ioc.buf = buf;
ioc.len = (uint) sizeof(buf);
ioc.set = false;
@@ -1402,7 +1402,7 @@ static int dhd_toe_set(dhd_info_t *dhd, int ifidx, u32 toe_ol)
memset(&ioc, 0, sizeof(ioc));
- ioc.cmd = WLC_SET_VAR;
+ ioc.cmd = BRCMF_C_SET_VAR;
ioc.buf = buf;
ioc.len = (uint) sizeof(buf);
ioc.set = true;
@@ -1652,13 +1652,14 @@ static int dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
goto done;
}
- /* Intercept WLC_SET_KEY IOCTL - serialize M4 send and set key IOCTL to
- * prevent M4 encryption.
+ /*
+ * Intercept BRCMF_C_SET_KEY IOCTL - serialize M4 send and
+ * set key IOCTL to prevent M4 encryption.
*/
- is_set_key_cmd = ((ioc.cmd == WLC_SET_KEY) ||
- ((ioc.cmd == WLC_SET_VAR) &&
+ is_set_key_cmd = ((ioc.cmd == BRCMF_C_SET_KEY) ||
+ ((ioc.cmd == BRCMF_C_SET_VAR) &&
!(strncmp("wsec_key", ioc.buf, 9))) ||
- ((ioc.cmd == WLC_SET_VAR) &&
+ ((ioc.cmd == BRCMF_C_SET_VAR) &&
!(strncmp("bsscfg:wsec_key", ioc.buf, 15))));
if (is_set_key_cmd)
dhd_wait_pend8021x(net);
@@ -2023,7 +2024,7 @@ int dhd_bus_start(dhd_pub_t *dhdp)
#ifdef EMBEDDED_PLATFORM
brcmu_mkiovar("event_msgs", dhdp->eventmask, WL_EVENTING_MASK_LEN,
iovbuf, sizeof(iovbuf));
- dhdcdc_query_ioctl(dhdp, 0, WLC_GET_VAR, iovbuf, sizeof(iovbuf));
+ dhdcdc_query_ioctl(dhdp, 0, BRCMF_C_GET_VAR, iovbuf, sizeof(iovbuf));
memcpy(dhdp->eventmask, iovbuf, WL_EVENTING_MASK_LEN);
setbit(dhdp->eventmask, WLC_E_SET_SSID);
@@ -2076,7 +2077,7 @@ dhd_iovar(dhd_pub_t *pub, int ifidx, char *name, char *cmd_buf, uint cmd_len,
memset(&ioc, 0, sizeof(ioc));
- ioc.cmd = set ? WLC_SET_VAR : WLC_GET_VAR;
+ ioc.cmd = set ? BRCMF_C_SET_VAR : BRCMF_C_GET_VAR;
ioc.buf = buf;
ioc.len = len;
ioc.set = set;
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index 915546c..ee751a0 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -596,7 +596,7 @@ wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
}
infra = cpu_to_le32(infra);
- err = wl_dev_ioctl(ndev, WLC_SET_INFRA, &infra, sizeof(infra));
+ err = wl_dev_ioctl(ndev, BRCMF_C_SET_INFRA, &infra, sizeof(infra));
if (unlikely(err)) {
WL_ERR("WLC_SET_INFRA error (%d)\n", err);
err = -EAGAIN;
@@ -643,7 +643,7 @@ wl_dev_iovar_setbuf(struct net_device *dev, s8 * iovar, void *param,
iolen = brcmu_mkiovar(iovar, param, paramlen, bufptr, buflen);
BUG_ON(!iolen);
- return wl_dev_ioctl(dev, WLC_SET_VAR, bufptr, iolen);
+ return wl_dev_ioctl(dev, BRCMF_C_SET_VAR, bufptr, iolen);
}
static s32
@@ -655,7 +655,7 @@ wl_dev_iovar_getbuf(struct net_device *dev, s8 * iovar, void *param,
iolen = brcmu_mkiovar(iovar, param, paramlen, bufptr, buflen);
BUG_ON(!iolen);
- return wl_dev_ioctl(dev, WLC_GET_VAR, bufptr, buflen);
+ return wl_dev_ioctl(dev, BRCMF_C_GET_VAR, bufptr, buflen);
}
static s32
@@ -671,7 +671,7 @@ wl_run_iscan(struct wl_iscan_ctrl *iscan, struct wlc_ssid *ssid, u16 action)
params = kzalloc(params_size, GFP_KERNEL);
if (unlikely(!params))
return -ENOMEM;
- BUG_ON(params_size >= WLC_IOCTL_SMLEN);
+ BUG_ON(params_size >= BRCMF_C_IOCTL_SMLEN);
wl_iscan_prep(¶ms->params, ssid);
@@ -681,7 +681,7 @@ wl_run_iscan(struct wl_iscan_ctrl *iscan, struct wlc_ssid *ssid, u16 action)
/* params_size += offsetof(wl_iscan_params_t, params); */
err = wl_dev_iovar_setbuf(iscan->dev, "iscan", params, params_size,
- iscan->ioctl_buf, WLC_IOCTL_SMLEN);
+ iscan->ioctl_buf, BRCMF_C_IOCTL_SMLEN);
if (unlikely(err)) {
if (err == -EBUSY) {
WL_INFO("system busy : iscan canceled\n");
@@ -707,7 +707,7 @@ static s32 wl_do_iscan(struct wl_priv *wl)
iscan->state = WL_ISCAN_STATE_SCANING;
passive_scan = wl->active_scan ? 0 : 1;
- err = wl_dev_ioctl(wl_to_ndev(wl), WLC_SET_PASSIVE_SCAN,
+ err = wl_dev_ioctl(wl_to_ndev(wl), BRCMF_C_SET_PASSIVE_SCAN,
&passive_scan, sizeof(passive_scan));
if (unlikely(err)) {
WL_ERR("error (%d)\n", err);
@@ -786,14 +786,14 @@ __wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
}
passive_scan = wl->active_scan ? 0 : 1;
- err = wl_dev_ioctl(ndev, WLC_SET_PASSIVE_SCAN,
+ err = wl_dev_ioctl(ndev, BRCMF_C_SET_PASSIVE_SCAN,
&passive_scan, sizeof(passive_scan));
if (unlikely(err)) {
WL_ERR("WLC_SET_PASSIVE_SCAN error (%d)\n", err);
goto scan_out;
}
wl_set_mpc(ndev, 0);
- err = wl_dev_ioctl(ndev, WLC_SCAN, &sr->ssid,
+ err = wl_dev_ioctl(ndev, BRCMF_C_SCAN, &sr->ssid,
sizeof(sr->ssid));
if (err) {
if (err == -EBUSY) {
@@ -835,7 +835,7 @@ wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
static s32 wl_dev_intvar_set(struct net_device *dev, s8 *name, s32 val)
{
- s8 buf[WLC_IOCTL_SMLEN];
+ s8 buf[BRCMF_C_IOCTL_SMLEN];
u32 len;
s32 err = 0;
@@ -844,7 +844,7 @@ static s32 wl_dev_intvar_set(struct net_device *dev, s8 *name, s32 val)
sizeof(buf));
BUG_ON(!len);
- err = wl_dev_ioctl(dev, WLC_SET_VAR, buf, len);
+ err = wl_dev_ioctl(dev, BRCMF_C_SET_VAR, buf, len);
if (unlikely(err))
WL_ERR("error (%d)\n", err);
@@ -855,7 +855,7 @@ static s32
wl_dev_intvar_get(struct net_device *dev, s8 *name, s32 *retval)
{
union {
- s8 buf[WLC_IOCTL_SMLEN];
+ s8 buf[BRCMF_C_IOCTL_SMLEN];
s32 val;
} var;
u32 len;
@@ -866,7 +866,7 @@ wl_dev_intvar_get(struct net_device *dev, s8 *name, s32 *retval)
brcmu_mkiovar(name, (char *)(&data_null), 0, (char *)(&var),
sizeof(var.buf));
BUG_ON(!len);
- err = wl_dev_ioctl(dev, WLC_GET_VAR, &var, len);
+ err = wl_dev_ioctl(dev, BRCMF_C_GET_VAR, &var, len);
if (unlikely(err))
WL_ERR("error (%d)\n", err);
@@ -1084,7 +1084,8 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
wl->ibss_starter = false;
- err = wl_dev_ioctl(dev, WLC_SET_SSID, &join_params, join_params_size);
+ err = wl_dev_ioctl(dev, BRCMF_C_SET_SSID,
+ &join_params, join_params_size);
if (unlikely(err)) {
WL_ERR("WLC_SET_SSID failed (%d)\n", err);
goto done;
@@ -1343,7 +1344,7 @@ wl_set_set_sharedkey(struct net_device *dev,
key.len, key.index, key.algo);
WL_CONN("key \"%s\"\n", key.data);
swap_key_from_BE(&key);
- err = wl_dev_ioctl(dev, WLC_SET_KEY, &key,
+ err = wl_dev_ioctl(dev, BRCMF_C_SET_KEY, &key,
sizeof(key));
if (unlikely(err)) {
WL_ERR("WLC_SET_KEY error (%d)\n", err);
@@ -1448,7 +1449,8 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
}
wl_ch_to_chanspec(wl->channel, &join_params, &join_params_size);
- err = wl_dev_ioctl(dev, WLC_SET_SSID, &join_params, join_params_size);
+ err = wl_dev_ioctl(dev, BRCMF_C_SET_SSID,
+ &join_params, join_params_size);
if (err)
WL_ERR("WLC_SET_SSID failed (%d)\n", err);
@@ -1475,7 +1477,7 @@ wl_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
scbval.val = reason_code;
memcpy(&scbval.ea, wl_read_prof(wl, WL_PROF_BSSID), ETH_ALEN);
scbval.val = cpu_to_le32(scbval.val);
- err = wl_dev_ioctl(dev, WLC_DISASSOC, &scbval,
+ err = wl_dev_ioctl(dev, BRCMF_C_DISASSOC, &scbval,
sizeof(scb_val_t));
if (unlikely(err))
WL_ERR("error (%d)\n", err);
@@ -1521,7 +1523,7 @@ wl_cfg80211_set_tx_power(struct wiphy *wiphy,
/* Make sure radio is off or on as far as software is concerned */
disable = WL_RADIO_SW_DISABLE << 16;
disable = cpu_to_le32(disable);
- err = wl_dev_ioctl(ndev, WLC_SET_RADIO, &disable, sizeof(disable));
+ err = wl_dev_ioctl(ndev, BRCMF_C_SET_RADIO, &disable, sizeof(disable));
if (unlikely(err))
WL_ERR("WLC_SET_RADIO error (%d)\n", err);
@@ -1577,7 +1579,7 @@ wl_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *dev,
WL_CONN("key index (%d)\n", key_idx);
CHECK_SYS_UP();
- err = wl_dev_ioctl(dev, WLC_GET_WSEC, &wsec, sizeof(wsec));
+ err = wl_dev_ioctl(dev, BRCMF_C_GET_WSEC, &wsec, sizeof(wsec));
if (unlikely(err)) {
WL_ERR("WLC_GET_WSEC error (%d)\n", err);
goto done;
@@ -1588,7 +1590,7 @@ wl_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *dev,
/* Just select a new current key */
index = (u32) key_idx;
index = cpu_to_le32(index);
- err = wl_dev_ioctl(dev, WLC_SET_KEY_PRIMARY, &index,
+ err = wl_dev_ioctl(dev, BRCMF_C_SET_KEY_PRIMARY, &index,
sizeof(index));
if (unlikely(err))
WL_ERR("error (%d)\n", err);
@@ -1616,7 +1618,7 @@ wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
if (key.len == 0) {
/* key delete */
swap_key_from_BE(&key);
- err = wl_dev_ioctl(dev, WLC_SET_KEY, &key, sizeof(key));
+ err = wl_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
if (unlikely(err)) {
WL_ERR("key delete error (%d)\n", err);
return err;
@@ -1676,7 +1678,7 @@ wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
swap_key_from_BE(&key);
dhd_wait_pend8021x(dev);
- err = wl_dev_ioctl(dev, WLC_SET_KEY, &key, sizeof(key));
+ err = wl_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
if (unlikely(err)) {
WL_ERR("WLC_SET_KEY error (%d)\n", err);
return err;
@@ -1749,7 +1751,7 @@ wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
/* Set the new key/index */
swap_key_from_BE(&key);
- err = wl_dev_ioctl(dev, WLC_SET_KEY, &key, sizeof(key));
+ err = wl_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
if (unlikely(err)) {
WL_ERR("WLC_SET_KEY error (%d)\n", err);
goto done;
@@ -1771,7 +1773,7 @@ wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
val = 1; /* assume shared key. otherwise 0 */
val = cpu_to_le32(val);
- err = wl_dev_ioctl(dev, WLC_SET_AUTH, &val, sizeof(val));
+ err = wl_dev_ioctl(dev, BRCMF_C_SET_AUTH, &val, sizeof(val));
if (unlikely(err))
WL_ERR("WLC_SET_AUTH error (%d)\n", err);
done:
@@ -1799,7 +1801,7 @@ wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
WL_CONN("key index (%d)\n", key_idx);
/* Set the new key/index */
swap_key_from_BE(&key);
- err = wl_dev_ioctl(dev, WLC_SET_KEY, &key, sizeof(key));
+ err = wl_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
if (unlikely(err)) {
if (err == -EINVAL) {
if (key.index >= DOT11_MAX_DEFAULT_KEYS)
@@ -1833,7 +1835,7 @@ wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
val = 0; /* assume open key. otherwise 1 */
val = cpu_to_le32(val);
- err = wl_dev_ioctl(dev, WLC_SET_AUTH, &val, sizeof(val));
+ err = wl_dev_ioctl(dev, BRCMF_C_SET_AUTH, &val, sizeof(val));
if (unlikely(err)) {
WL_ERR("WLC_SET_AUTH error (%d)\n", err);
/* Ignore this error, may happen during DISASSOC */
@@ -1867,7 +1869,7 @@ wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
params.key_len = (u8) min_t(u8, WLAN_MAX_KEY_LEN, key.len);
memcpy(params.key, key.data, params.key_len);
- err = wl_dev_ioctl(dev, WLC_GET_WSEC, &wsec, sizeof(wsec));
+ err = wl_dev_ioctl(dev, BRCMF_C_GET_WSEC, &wsec, sizeof(wsec));
if (unlikely(err)) {
WL_ERR("WLC_GET_WSEC error (%d)\n", err);
/* Ignore this error, may happen during DISASSOC */
@@ -1942,7 +1944,7 @@ wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
}
/* Report the current tx rate */
- err = wl_dev_ioctl(dev, WLC_GET_RATE, &rate, sizeof(rate));
+ err = wl_dev_ioctl(dev, BRCMF_C_GET_RATE, &rate, sizeof(rate));
if (err) {
WL_ERR("Could not get rate (%d)\n", err);
} else {
@@ -1954,7 +1956,7 @@ wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
if (test_bit(WL_STATUS_CONNECTED, &wl->status)) {
scb_val.val = 0;
- err = wl_dev_ioctl(dev, WLC_GET_RSSI, &scb_val,
+ err = wl_dev_ioctl(dev, BRCMF_C_GET_RSSI, &scb_val,
sizeof(scb_val_t));
if (unlikely(err)) {
WL_ERR("Could not get rssi (%d)\n", err);
@@ -1984,7 +1986,7 @@ wl_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
pm = cpu_to_le32(pm);
WL_INFO("power save %s\n", (pm ? "enabled" : "disabled"));
- err = wl_dev_ioctl(dev, WLC_SET_PM, &pm, sizeof(pm));
+ err = wl_dev_ioctl(dev, BRCMF_C_SET_PM, &pm, sizeof(pm));
if (unlikely(err)) {
if (err == -ENODEV)
WL_ERR("net_device is not ready yet\n");
@@ -2522,7 +2524,7 @@ wl_inform_ibss(struct wl_priv *wl, struct net_device *dev, const u8 *bssid)
*(u32 *)buf = cpu_to_le32(WL_BSS_INFO_MAX);
- err = wl_dev_ioctl(dev, WLC_GET_BSS_INFO, buf, WL_BSS_INFO_MAX);
+ err = wl_dev_ioctl(dev, BRCMF_C_GET_BSS_INFO, buf, WL_BSS_INFO_MAX);
if (unlikely(err)) {
WL_ERR("WLC_GET_BSS_INFO failed: %d\n", err);
goto CleanUp;
@@ -2684,7 +2686,7 @@ wl_dev_bufvar_set(struct net_device *dev, s8 *name, s8 *buf, s32 len)
buflen = brcmu_mkiovar(name, buf, len, wl->ioctl_buf, WL_IOCTL_LEN_MAX);
BUG_ON(!buflen);
- return wl_dev_ioctl(dev, WLC_SET_VAR, wl->ioctl_buf, buflen);
+ return wl_dev_ioctl(dev, BRCMF_C_SET_VAR, wl->ioctl_buf, buflen);
}
static s32
@@ -2697,7 +2699,7 @@ wl_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
len = brcmu_mkiovar(name, NULL, 0, wl->ioctl_buf, WL_IOCTL_LEN_MAX);
BUG_ON(!len);
- err = wl_dev_ioctl(dev, WLC_GET_VAR, (void *)wl->ioctl_buf,
+ err = wl_dev_ioctl(dev, BRCMF_C_GET_VAR, (void *)wl->ioctl_buf,
WL_IOCTL_LEN_MAX);
if (unlikely(err)) {
WL_ERR("error (%d)\n", err);
@@ -2827,7 +2829,7 @@ static s32 wl_update_bss_info(struct wl_priv *wl)
ssid = (struct wlc_ssid *)wl_read_prof(wl, WL_PROF_SSID);
*(u32 *)wl->extra_buf = cpu_to_le32(WL_EXTRA_BUF_MAX);
- err = wl_dev_ioctl(wl_to_ndev(wl), WLC_GET_BSS_INFO,
+ err = wl_dev_ioctl(wl_to_ndev(wl), BRCMF_C_GET_BSS_INFO,
wl->extra_buf, WL_EXTRA_BUF_MAX);
if (unlikely(err)) {
WL_ERR("Could not get bss info %d\n", err);
@@ -2969,7 +2971,7 @@ wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
goto scan_done_out;
}
- err = wl_dev_ioctl(ndev, WLC_GET_CHANNEL, &channel_inform,
+ err = wl_dev_ioctl(ndev, BRCMF_C_GET_CHANNEL, &channel_inform,
sizeof(channel_inform));
if (unlikely(err)) {
WL_ERR("scan busy (%d)\n", err);
@@ -2987,7 +2989,7 @@ wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
memset(bss_list, 0, len);
bss_list->buflen = cpu_to_le32(len);
- err = wl_dev_ioctl(ndev, WLC_SCAN_RESULTS, bss_list, len);
+ err = wl_dev_ioctl(ndev, BRCMF_C_SCAN_RESULTS, bss_list, len);
if (unlikely(err)) {
WL_ERR("%s Scan_results error (%d)\n", ndev->name, err);
err = -EINVAL;
@@ -3646,7 +3648,7 @@ static s32 wl_dongle_mode(struct net_device *ndev, s32 iftype)
return err;
}
infra = cpu_to_le32(infra);
- err = wl_dev_ioctl(ndev, WLC_SET_INFRA, &infra, sizeof(infra));
+ err = wl_dev_ioctl(ndev, BRCMF_C_SET_INFRA, &infra, sizeof(infra));
if (unlikely(err)) {
WL_ERR("WLC_SET_INFRA error (%d)\n", err);
return err;
@@ -3668,7 +3670,7 @@ static s32 wl_dongle_up(struct net_device *ndev, u32 up)
{
s32 err = 0;
- err = wl_dev_ioctl(ndev, WLC_UP, &up, sizeof(up));
+ err = wl_dev_ioctl(ndev, BRCMF_C_UP, &up, sizeof(up));
if (unlikely(err)) {
WL_ERR("WLC_UP error (%d)\n", err);
}
@@ -3679,7 +3681,8 @@ static s32 wl_dongle_power(struct net_device *ndev, u32 power_mode)
{
s32 err = 0;
- err = wl_dev_ioctl(ndev, WLC_SET_PM, &power_mode, sizeof(power_mode));
+ err = wl_dev_ioctl(ndev, BRCMF_C_SET_PM,
+ &power_mode, sizeof(power_mode));
if (unlikely(err)) {
WL_ERR("WLC_SET_PM error (%d)\n", err);
}
@@ -3696,14 +3699,14 @@ wl_dongle_glom(struct net_device *ndev, u32 glom, u32 dongle_align)
/* Match Host and Dongle rx alignment */
brcmu_mkiovar("bus:txglomalign", (char *)&dongle_align, 4, iovbuf,
sizeof(iovbuf));
- err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
+ err = wl_dev_ioctl(ndev, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
if (unlikely(err)) {
WL_ERR("txglomalign error (%d)\n", err);
goto dongle_glom_out;
}
/* disable glom option per default */
brcmu_mkiovar("bus:txglom", (char *)&glom, 4, iovbuf, sizeof(iovbuf));
- err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
+ err = wl_dev_ioctl(ndev, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
if (unlikely(err)) {
WL_ERR("txglom error (%d)\n", err);
goto dongle_glom_out;
@@ -3721,7 +3724,7 @@ wl_dongle_offload(struct net_device *ndev, s32 arpoe, s32 arp_ol)
/* Set ARP offload */
brcmu_mkiovar("arpoe", (char *)&arpoe, 4, iovbuf, sizeof(iovbuf));
- err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
+ err = wl_dev_ioctl(ndev, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
if (err) {
if (err == -EOPNOTSUPP)
WL_INFO("arpoe is not supported\n");
@@ -3731,7 +3734,7 @@ wl_dongle_offload(struct net_device *ndev, s32 arpoe, s32 arp_ol)
goto dongle_offload_out;
}
brcmu_mkiovar("arp_ol", (char *)&arp_ol, 4, iovbuf, sizeof(iovbuf));
- err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
+ err = wl_dev_ioctl(ndev, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
if (err) {
if (err == -EOPNOTSUPP)
WL_INFO("arp_ol is not supported\n");
@@ -3832,7 +3835,7 @@ static s32 wl_dongle_filter(struct net_device *ndev, u32 filter_mode)
memcpy((char *)pkt_filterp, &pkt_filter,
WL_PKT_FILTER_FIXED_LEN + WL_PKT_FILTER_PATTERN_FIXED_LEN);
- err = wl_dev_ioctl(ndev, WLC_SET_VAR, buf, buf_len);
+ err = wl_dev_ioctl(ndev, BRCMF_C_SET_VAR, buf, buf_len);
if (err) {
if (err == -EOPNOTSUPP) {
WL_INFO("filter not supported\n");
@@ -3845,7 +3848,7 @@ static s32 wl_dongle_filter(struct net_device *ndev, u32 filter_mode)
/* set mode to allow pattern */
brcmu_mkiovar("pkt_filter_mode", (char *)&filter_mode, 4, iovbuf,
sizeof(iovbuf));
- err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
+ err = wl_dev_ioctl(ndev, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
if (err) {
if (err == -EOPNOTSUPP) {
WL_INFO("filter_mode not supported\n");
@@ -3872,7 +3875,7 @@ static s32 wl_dongle_eventmsg(struct net_device *ndev)
/* Setup event_msgs */
brcmu_mkiovar("event_msgs", eventmask, WL_EVENTING_MASK_LEN, iovbuf,
sizeof(iovbuf));
- err = wl_dev_ioctl(ndev, WLC_GET_VAR, iovbuf, sizeof(iovbuf));
+ err = wl_dev_ioctl(ndev, BRCMF_C_GET_VAR, iovbuf, sizeof(iovbuf));
if (unlikely(err)) {
WL_ERR("Get event_msgs error (%d)\n", err);
goto dongle_eventmsg_out;
@@ -3901,7 +3904,7 @@ static s32 wl_dongle_eventmsg(struct net_device *ndev)
brcmu_mkiovar("event_msgs", eventmask, WL_EVENTING_MASK_LEN, iovbuf,
sizeof(iovbuf));
- err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
+ err = wl_dev_ioctl(ndev, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
if (unlikely(err)) {
WL_ERR("Set event_msgs error (%d)\n", err);
goto dongle_eventmsg_out;
@@ -3927,7 +3930,8 @@ wl_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
if (roamvar) {
brcmu_mkiovar("bcn_timeout", (char *)&bcn_timeout,
sizeof(bcn_timeout), iovbuf, sizeof(iovbuf));
- err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
+ err = wl_dev_ioctl(ndev, BRCMF_C_SET_VAR,
+ iovbuf, sizeof(iovbuf));
if (unlikely(err)) {
WL_ERR("bcn_timeout error (%d)\n", err);
goto dongle_rom_out;
@@ -3941,7 +3945,7 @@ wl_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
WL_INFO("Internal Roaming = %s\n", roamvar ? "Off" : "On");
brcmu_mkiovar("roam_off", (char *)&roamvar,
sizeof(roamvar), iovbuf, sizeof(iovbuf));
- err = wl_dev_ioctl(ndev, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
+ err = wl_dev_ioctl(ndev, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
if (unlikely(err)) {
WL_ERR("roam_off error (%d)\n", err);
goto dongle_rom_out;
@@ -3949,7 +3953,7 @@ wl_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
roamtrigger[0] = WL_ROAM_TRIGGER_LEVEL;
roamtrigger[1] = WLC_BAND_ALL;
- err = wl_dev_ioctl(ndev, WLC_SET_ROAM_TRIGGER,
+ err = wl_dev_ioctl(ndev, BRCMF_C_SET_ROAM_TRIGGER,
(void *)roamtrigger, sizeof(roamtrigger));
if (unlikely(err)) {
WL_ERR("WLC_SET_ROAM_TRIGGER error (%d)\n", err);
@@ -3958,7 +3962,7 @@ wl_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
roam_delta[0] = WL_ROAM_DELTA;
roam_delta[1] = WLC_BAND_ALL;
- err = wl_dev_ioctl(ndev, WLC_SET_ROAM_DELTA,
+ err = wl_dev_ioctl(ndev, BRCMF_C_SET_ROAM_DELTA,
(void *)roam_delta, sizeof(roam_delta));
if (unlikely(err)) {
WL_ERR("WLC_SET_ROAM_DELTA error (%d)\n", err);
@@ -3975,8 +3979,8 @@ wl_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
{
s32 err = 0;
- err = wl_dev_ioctl(ndev, WLC_SET_SCAN_CHANNEL_TIME, &scan_assoc_time,
- sizeof(scan_assoc_time));
+ err = wl_dev_ioctl(ndev, BRCMF_C_SET_SCAN_CHANNEL_TIME,
+ &scan_assoc_time, sizeof(scan_assoc_time));
if (err) {
if (err == -EOPNOTSUPP)
WL_INFO("Scan assoc time is not supported\n");
@@ -3984,8 +3988,8 @@ wl_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
WL_ERR("Scan assoc time error (%d)\n", err);
goto dongle_scantime_out;
}
- err = wl_dev_ioctl(ndev, WLC_SET_SCAN_UNASSOC_TIME, &scan_unassoc_time,
- sizeof(scan_unassoc_time));
+ err = wl_dev_ioctl(ndev, BRCMF_C_SET_SCAN_UNASSOC_TIME,
+ &scan_unassoc_time, sizeof(scan_unassoc_time));
if (err) {
if (err == -EOPNOTSUPP)
WL_INFO("Scan unassoc time is not supported\n");
@@ -3994,8 +3998,8 @@ wl_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
goto dongle_scantime_out;
}
- err = wl_dev_ioctl(ndev, WLC_SET_SCAN_PASSIVE_TIME, &scan_passive_time,
- sizeof(scan_passive_time));
+ err = wl_dev_ioctl(ndev, BRCMF_C_SET_SCAN_PASSIVE_TIME,
+ &scan_passive_time, sizeof(scan_passive_time));
if (err) {
if (err == -EOPNOTSUPP)
WL_INFO("Scan passive time is not supported\n");
@@ -4266,7 +4270,7 @@ static void wl_link_down(struct wl_priv *wl)
if (wl->link_up) {
dev = wl_to_ndev(wl);
WL_INFO("Call WLC_DISASSOC to stop excess roaming\n ");
- err = wl_dev_ioctl(dev, WLC_DISASSOC, NULL, 0);
+ err = wl_dev_ioctl(dev, BRCMF_C_DISASSOC, NULL, 0);
if (unlikely(err))
WL_ERR("WLC_DISASSOC failed (%d)\n", err);
wl->link_up = false;
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
index 80940bd..3b0c8ae 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
@@ -108,7 +108,7 @@ do { \
#define WL_IOCTL_LEN_MAX 1024
#define WL_EXTRA_BUF_MAX 2048
#define WL_ISCAN_BUF_MAX 2048 /*
- * the buf lengh can be WLC_IOCTL_MAXLEN (8K)
+ * the buf length can be BRCMF_C_IOCTL_MAXLEN
* to reduce iteration
*/
#define WL_ISCAN_TIMER_INTERVAL_MS 3000
@@ -276,7 +276,7 @@ struct wl_iscan_ctrl {
struct semaphore sync;
struct wl_iscan_eloop el;
void *data;
- s8 ioctl_buf[WLC_IOCTL_SMLEN];
+ s8 ioctl_buf[BRCMF_C_IOCTL_SMLEN];
s8 scan_buf[WL_ISCAN_BUF_MAX];
};
--
1.7.1
In fullmac the lock is for race condition for sdio interface. Move
the code to dhd_sdio.c
Signed-off-by: Franky Lin <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 6 --
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 38 --------
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 109 +++++++++++++++---------
3 files changed, 70 insertions(+), 83 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index e7746f7..b11eeee 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -810,10 +810,6 @@ extern uint brcmf_sdiod_drive_strength;
/* Override to force tx queueing all the time */
extern uint brcmf_force_tx_queueing;
-/* thread priority for watchdog and dpc */
-extern int brcmf_watchdog_prio;
-extern int brcmf_dpc_prio;
-
#ifdef SDTEST
/* Echo packet generator (SDIO), pkts/s */
extern uint brcmf_pktgen;
@@ -919,8 +915,6 @@ extern void brcmf_os_set_ioctl_resp_timeout(unsigned int timeout_msec);
extern void *brcmf_os_open_image(char *filename);
extern int brcmf_os_get_image_block(char *buf, int len, void *image);
extern void brcmf_os_close_image(void *image);
-extern void brcmf_os_sdlock(dhd_pub_t *pub);
-extern void brcmf_os_sdunlock(dhd_pub_t *pub);
extern void brcmf_os_sdlock_sndup_rxq(dhd_pub_t *pub);
extern void brcmf_customer_gpio_wlan_ctrl(int onoff);
extern int brcmf_custom_get_mac_address(unsigned char *buf);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index fac8302..2213e4e 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -82,10 +82,6 @@ typedef struct dhd_info {
struct semaphore proto_sem;
wait_queue_head_t ioctl_resp_wait;
- spinlock_t sdlock;
- /* Thread based operation */
- bool threads_only;
- struct semaphore sdsem;
/* Thread to issue ioctl for multicast */
struct task_struct *sysioc_tsk;
@@ -1489,9 +1485,6 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
/* Initialize other structure content */
init_waitqueue_head(&dhd->ioctl_resp_wait);
- /* Initialize the spinlocks */
- spin_lock_init(&dhd->sdlock);
-
/* Link to info module */
dhd->pub.info = dhd;
@@ -1515,13 +1508,6 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
strcpy(brcmf_nv_path, wl_cfg80211_get_nvramname());
}
- /* Initialize thread based operation and lock */
- sema_init(&dhd->sdsem, 1);
- if ((brcmf_watchdog_prio >= 0) && (brcmf_dpc_prio >= 0))
- dhd->threads_only = true;
- else
- dhd->threads_only = false;
-
if (brcmf_sysioc) {
sema_init(&dhd->sysioc_sem, 0);
dhd->sysioc_tsk = kthread_run(_brcmf_sysioc_thread, dhd,
@@ -1941,30 +1927,6 @@ void brcmf_os_close_image(void *image)
filp_close((struct file *)image, NULL);
}
-void brcmf_os_sdlock(dhd_pub_t *pub)
-{
- dhd_info_t *dhd;
-
- dhd = (dhd_info_t *) (pub->info);
-
- if (dhd->threads_only)
- down(&dhd->sdsem);
- else
- spin_lock_bh(&dhd->sdlock);
-}
-
-void brcmf_os_sdunlock(dhd_pub_t *pub)
-{
- dhd_info_t *dhd;
-
- dhd = (dhd_info_t *) (pub->info);
-
- if (dhd->threads_only)
- up(&dhd->sdsem);
- else
- spin_unlock_bh(&dhd->sdlock);
-}
-
static int brcmf_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
brcmf_event_msg_t *event, void **data)
{
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 6f69413..d64ba7b 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -597,6 +597,10 @@ typedef struct dhd_bus {
struct tasklet_struct tasklet;
struct task_struct *dpc_tsk;
struct completion dpc_wait;
+
+ bool threads_only;
+ struct semaphore sdsem;
+ spinlock_t sdlock;
} dhd_bus_t;
typedef volatile struct _sbconfig {
@@ -809,13 +813,15 @@ static void brcmf_sdbrcm_chip_resetcore(struct brcmf_sdio *sdh, u32 corebase);
static void brcmf_sdbrcm_sdiod_drive_strength_init(struct dhd_bus *bus,
u32 drivestrength);
static void brcmf_sdbrcm_chip_detach(struct dhd_bus *bus);
-static void brcmf_sdbrcm_wait_for_event(dhd_pub_t *dhd, bool *lockvar);
+static void brcmf_sdbrcm_wait_for_event(dhd_bus_t *bus, bool *lockvar);
static void brcmf_sdbrcm_wait_event_wakeup(dhd_bus_t *bus);
static void brcmf_sdbrcm_watchdog(unsigned long data);
static int brcmf_sdbrcm_watchdog_thread(void *data);
static int brcmf_sdbrcm_dpc_thread(void *data);
static void brcmf_sdbrcm_dpc_tasklet(unsigned long data);
static void brcmf_sdbrcm_sched_dpc(dhd_bus_t *bus);
+static void brcmf_sdbrcm_sdlock(dhd_bus_t *bus);
+static void brcmf_sdbrcm_sdunlock(dhd_bus_t *bus);
/* Packet free applicable unconditionally for sdio and sdspi.
* Conditional if bufpool was present for gspi bus.
@@ -1295,9 +1301,9 @@ static int brcmf_sdbrcm_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
done:
/* restore pkt buffer pointer before calling tx complete routine */
skb_pull(pkt, SDPCM_HDRLEN + pad);
- brcmf_os_sdunlock(bus->dhd);
+ brcmf_sdbrcm_sdunlock(bus);
brcmf_txcomplete(bus->dhd, pkt, ret != 0);
- brcmf_os_sdlock(bus->dhd);
+ brcmf_sdbrcm_sdlock(bus);
if (free_pkt)
brcmu_pkt_buf_free_skb(pkt);
@@ -1371,7 +1377,7 @@ int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
}
} else {
/* Lock: we're about to use shared data/code (and SDIO) */
- brcmf_os_sdlock(bus->dhd);
+ brcmf_sdbrcm_sdlock(bus);
/* Otherwise, send it now */
BUS_WAKE(bus);
@@ -1396,7 +1402,7 @@ int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
brcmf_sdbrcm_clkctl(bus, CLK_NONE, true);
}
- brcmf_os_sdunlock(bus->dhd);
+ brcmf_sdbrcm_sdunlock(bus);
}
return ret;
@@ -1512,7 +1518,7 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
ASSERT(IS_ALIGNED((unsigned long)frame, 2));
/* Need to lock here to protect txseq and SDIO tx calls */
- brcmf_os_sdlock(bus->dhd);
+ brcmf_sdbrcm_sdlock(bus);
BUS_WAKE(bus);
@@ -1540,7 +1546,7 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
bus->ctrl_frame_buf = frame;
bus->ctrl_frame_len = len;
- brcmf_sdbrcm_wait_for_event(bus->dhd, &bus->ctrl_frame_stat);
+ brcmf_sdbrcm_wait_for_event(bus, &bus->ctrl_frame_stat);
if (bus->ctrl_frame_stat == false) {
DHD_INFO(("%s: ctrl_frame_stat == false\n", __func__));
@@ -1614,7 +1620,7 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
brcmf_sdbrcm_clkctl(bus, CLK_NONE, true);
}
- brcmf_os_sdunlock(bus->dhd);
+ brcmf_sdbrcm_sdunlock(bus);
if (ret)
bus->dhd->tx_ctlerrs++;
@@ -1638,11 +1644,11 @@ int brcmf_sdbrcm_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
/* Wait until control frame is available */
timeleft = brcmf_os_ioctl_resp_wait(bus->dhd, &bus->rxlen, &pending);
- brcmf_os_sdlock(bus->dhd);
+ brcmf_sdbrcm_sdlock(bus);
rxlen = bus->rxlen;
memcpy(msg, bus->rxctl, min(msglen, rxlen));
bus->rxlen = 0;
- brcmf_os_sdunlock(bus->dhd);
+ brcmf_sdbrcm_sdunlock(bus);
if (rxlen) {
DHD_CTL(("%s: resumed on rxctl frame, got %d expected %d\n",
@@ -1650,20 +1656,20 @@ int brcmf_sdbrcm_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
} else if (timeleft == 0) {
DHD_ERROR(("%s: resumed on timeout\n", __func__));
#ifdef BCMDBG
- brcmf_os_sdlock(bus->dhd);
+ brcmf_sdbrcm_sdlock(bus);
brcmf_sdbrcm_checkdied(bus, NULL, 0);
- brcmf_os_sdunlock(bus->dhd);
-#endif /* BCMDBG */
+ brcmf_sdbrcm_sdunlock(bus);
+#endif /* DHD_DEBUG */
} else if (pending == true) {
DHD_CTL(("%s: cancelled\n", __func__));
return -ERESTARTSYS;
} else {
DHD_CTL(("%s: resumed for unknown reason?\n", __func__));
#ifdef BCMDBG
- brcmf_os_sdlock(bus->dhd);
+ brcmf_sdbrcm_sdlock(bus);
brcmf_sdbrcm_checkdied(bus, NULL, 0);
- brcmf_os_sdunlock(bus->dhd);
-#endif /* BCMDBG */
+ brcmf_sdbrcm_sdunlock(bus);
+#endif /* DHD_DEBUG */
}
if (rxlen)
@@ -2373,7 +2379,7 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
bool_val = (int_val != 0) ? true : false;
/* Some ioctls use the bus */
- brcmf_os_sdlock(bus->dhd);
+ brcmf_sdbrcm_sdlock(bus);
/* Check if dongle is in reset. If so, only allow DEVRESET iovars */
if (bus->dhd->dongle_reset && !(actionid == IOV_SVAL(IOV_DEVRESET) ||
@@ -2786,7 +2792,7 @@ exit:
brcmf_sdbrcm_clkctl(bus, CLK_NONE, true);
}
- brcmf_os_sdunlock(bus->dhd);
+ brcmf_sdbrcm_sdunlock(bus);
if (actionid == IOV_SVAL(IOV_DEVRESET) && bool_val == false)
brcmf_c_preinit_ioctls((dhd_pub_t *) bus->dhd);
@@ -2958,7 +2964,7 @@ brcmf_sdbrcm_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
/* Look up var locally; if not found pass to host driver */
vi = brcmu_iovar_lookup(dhdsdio_iovars, name);
if (vi == NULL) {
- brcmf_os_sdlock(bus->dhd);
+ brcmf_sdbrcm_sdlock(bus);
BUS_WAKE(bus);
@@ -2991,7 +2997,7 @@ brcmf_sdbrcm_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
brcmf_sdbrcm_clkctl(bus, CLK_NONE, true);
}
- brcmf_os_sdunlock(bus->dhd);
+ brcmf_sdbrcm_sdunlock(bus);
goto exit;
}
@@ -3032,7 +3038,7 @@ void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
DHD_TRACE(("%s: Enter\n", __func__));
if (enforce_mutex)
- brcmf_os_sdlock(bus->dhd);
+ brcmf_sdbrcm_sdlock(bus);
BUS_WAKE(bus);
@@ -3106,7 +3112,7 @@ void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
bus->tx_seq = bus->rx_seq = 0;
if (enforce_mutex)
- brcmf_os_sdunlock(bus->dhd);
+ brcmf_sdbrcm_sdunlock(bus);
#if defined(OOB_INTR_ONLY)
brcmf_sdio_unregister_oob_intr();
@@ -3133,7 +3139,7 @@ int brcmf_sdbrcm_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
brcmf_sdbrcm_wd_timer(bus, brcmf_watchdog_ms);
if (enforce_mutex)
- brcmf_os_sdlock(bus->dhd);
+ brcmf_sdbrcm_sdlock(bus);
/* Make sure backplane clock is on, needed to generate F2 interrupt */
brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
@@ -3233,7 +3239,7 @@ int brcmf_sdbrcm_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
exit:
if (enforce_mutex)
- brcmf_os_sdunlock(bus->dhd);
+ brcmf_sdbrcm_sdunlock(bus);
return ret;
}
@@ -3797,9 +3803,9 @@ static u8 brcmf_sdbrcm_rxglom(dhd_bus_t *bus, u8 rxseq)
#endif /* BCMDBG */
}
if (num) {
- brcmf_os_sdunlock(bus->dhd);
+ brcmf_sdbrcm_sdunlock(bus);
brcmf_rx_frame(bus->dhd, ifidx, save_pfirst, num);
- brcmf_os_sdlock(bus->dhd);
+ brcmf_sdbrcm_sdlock(bus);
}
bus->rxglomframes++;
@@ -4383,9 +4389,9 @@ deliver:
}
/* Unlock during rx call */
- brcmf_os_sdunlock(bus->dhd);
+ brcmf_sdbrcm_sdunlock(bus);
brcmf_rx_frame(bus->dhd, ifidx, pkt, 1);
- brcmf_os_sdlock(bus->dhd);
+ brcmf_sdbrcm_sdlock(bus);
}
rxcount = maxframes - rxleft;
#ifdef BCMDBG
@@ -4495,7 +4501,7 @@ static bool brcmf_sdbrcm_dpc(dhd_bus_t *bus)
/* Start with leftover status bits */
intstatus = bus->intstatus;
- brcmf_os_sdlock(bus->dhd);
+ brcmf_sdbrcm_sdlock(bus);
/* If waiting for HTAVAIL, check status */
if (bus->clkstate == CLK_PENDING) {
@@ -4725,7 +4731,7 @@ clkwait:
brcmf_sdbrcm_clkctl(bus, CLK_NONE, false);
}
- brcmf_os_sdunlock(bus->dhd);
+ brcmf_sdbrcm_sdunlock(bus);
return resched;
}
@@ -5054,7 +5060,7 @@ extern bool brcmf_sdbrcm_bus_watchdog(dhd_pub_t *dhdp)
if (bus->sleeping)
return false;
- brcmf_os_sdlock(bus->dhd);
+ brcmf_sdbrcm_sdlock(bus);
/* Poll period: check device if appropriate. */
if (bus->poll && (++bus->polltick >= bus->pollrate)) {
@@ -5131,7 +5137,7 @@ extern bool brcmf_sdbrcm_bus_watchdog(dhd_pub_t *dhdp)
}
}
- brcmf_os_sdunlock(bus->dhd);
+ brcmf_sdbrcm_sdunlock(bus);
return bus->ipend;
}
@@ -5150,11 +5156,11 @@ static int brcmf_sdbrcm_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg,
return -ENOTSUPP;
/* Exclusive bus access */
- brcmf_os_sdlock(bus->dhd);
+ brcmf_sdbrcm_sdlock(bus);
/* Don't allow input if dongle is in reset */
if (bus->dhd->dongle_reset) {
- brcmf_os_sdunlock(bus->dhd);
+ brcmf_sdbrcm_sdunlock(bus);
return -EPERM;
}
@@ -5196,7 +5202,7 @@ done:
brcmf_sdbrcm_clkctl(bus, CLK_NONE, true);
}
- brcmf_os_sdunlock(bus->dhd);
+ brcmf_sdbrcm_sdunlock(bus);
return rv;
}
@@ -5318,6 +5324,15 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
bus->timer.data = (unsigned long)bus;
bus->timer.function = brcmf_sdbrcm_watchdog;
+ /* Initialize thread based operation and lock */
+ if ((brcmf_watchdog_prio >= 0) && (brcmf_dpc_prio >= 0)) {
+ bus->threads_only = true;
+ sema_init(&bus->sdsem, 1);
+ } else {
+ bus->threads_only = false;
+ spin_lock_init(&bus->sdlock);
+ }
+
if (brcmf_dpc_prio >= 0) {
/* Initialize watchdog thread */
init_completion(&bus->watchdog_wait);
@@ -6470,12 +6485,12 @@ brcmf_sdbrcm_chip_detach(struct dhd_bus *bus)
}
static void
-brcmf_sdbrcm_wait_for_event(dhd_pub_t *dhd, bool *lockvar)
+brcmf_sdbrcm_wait_for_event(dhd_bus_t *bus, bool *lockvar)
{
- brcmf_os_sdunlock(dhd);
- wait_event_interruptible_timeout(dhd->bus->ctrl_wait,
+ brcmf_sdbrcm_sdunlock(bus);
+ wait_event_interruptible_timeout(bus->ctrl_wait,
(*lockvar == false), HZ * 2);
- brcmf_os_sdlock(dhd);
+ brcmf_sdbrcm_sdlock(bus);
return;
}
@@ -6638,3 +6653,19 @@ static void brcmf_sdbrcm_sched_dpc(dhd_bus_t *bus)
tasklet_schedule(&bus->tasklet);
}
+
+static void brcmf_sdbrcm_sdlock(dhd_bus_t *bus)
+{
+ if (bus->threads_only)
+ down(&bus->sdsem);
+ else
+ spin_lock_bh(&bus->sdlock);
+}
+
+static void brcmf_sdbrcm_sdunlock(dhd_bus_t *bus)
+{
+ if (bus->threads_only)
+ up(&bus->sdsem);
+ else
+ spin_unlock_bh(&bus->sdlock);
+}
--
1.7.1
From: Henry Ptasinski <[email protected]>
Cleanup remaining whitespace errors:
- space before tabs
- spaces at the start of a line
- space between function name and open parenthesis '('
- unnecessary whitespace before a quoted newline
Signed-off-by: Henry Ptasinski <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 6 ++--
drivers/staging/brcm80211/brcmfmac/sbsdio.h | 2 +-
drivers/staging/brcm80211/brcmsmac/dma.c | 2 +-
drivers/staging/brcm80211/brcmsmac/phy/phy_int.h | 10 +++---
drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c | 10 +++----
.../staging/brcm80211/brcmsmac/phy/phytbl_lcn.c | 18 ++++++------
drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.c | 28 ++++++++++----------
drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.h | 10 +++---
drivers/staging/brcm80211/brcmsmac/phy_shim.h | 4 +-
drivers/staging/brcm80211/brcmutil/utils.c | 2 +-
drivers/staging/brcm80211/include/brcmu_utils.h | 4 +-
11 files changed, 47 insertions(+), 49 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index e0cd8e1..c556191 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -916,14 +916,14 @@ static int _dhd_sysioc_thread(void *data)
if (in_ap && dhd->set_macaddress) {
DHD_TRACE(("attempt to set MAC for %s "
- "in AP Mode," "blocked. \n",
+ "in AP Mode," "blocked.\n",
dhd->iflist[i]->net->name));
dhd->set_macaddress = false;
continue;
}
if (in_ap && dhd->set_multicast) {
- DHD_TRACE(("attempt to set MULTICAST list for %s" "in AP Mode, blocked. \n",
+ DHD_TRACE(("attempt to set MULTICAST list for %s" "in AP Mode, blocked.\n",
dhd->iflist[i]->net->name));
dhd->set_multicast = false;
continue;
@@ -2157,7 +2157,7 @@ int dhd_net_attach(dhd_pub_t *dhdp, int ifidx)
}
if (ifidx == 1) {
- DHD_TRACE(("%s ACCESS POINT MAC: \n", __func__));
+ DHD_TRACE(("%s ACCESS POINT MAC:\n", __func__));
/* ACCESSPOINT INTERFACE CASE */
temp_addr[0] |= 0X02; /* set bit 2 ,
- Locally Administered address */
diff --git a/drivers/staging/brcm80211/brcmfmac/sbsdio.h b/drivers/staging/brcm80211/brcmfmac/sbsdio.h
index 86b62b8..614a25f 100644
--- a/drivers/staging/brcm80211/brcmfmac/sbsdio.h
+++ b/drivers/staging/brcm80211/brcmfmac/sbsdio.h
@@ -37,7 +37,7 @@
#define SBSDIO_FUNC1_SBADDRHIGH 0x1000C /* SB Address Window High (b31:b24) */
#define SBSDIO_FUNC1_FRAMECTRL 0x1000D /* Frame Control (frame term/abort) */
#define SBSDIO_FUNC1_CHIPCLKCSR 0x1000E /* ChipClockCSR (ALP/HT ctl/status) */
-#define SBSDIO_FUNC1_SDIOPULLUP 0x1000F /* SdioPullUp (on cmd, d0-d2) */
+#define SBSDIO_FUNC1_SDIOPULLUP 0x1000F /* SdioPullUp (on cmd, d0-d2) */
#define SBSDIO_FUNC1_WFRAMEBCLO 0x10019 /* Write Frame Byte Count Low */
#define SBSDIO_FUNC1_WFRAMEBCHI 0x1001A /* Write Frame Byte Count High */
#define SBSDIO_FUNC1_RFRAMEBCLO 0x1001B /* Read Frame Byte Count Low */
diff --git a/drivers/staging/brcm80211/brcmsmac/dma.c b/drivers/staging/brcm80211/brcmsmac/dma.c
index adf364c..5cdbfe9 100644
--- a/drivers/staging/brcm80211/brcmsmac/dma.c
+++ b/drivers/staging/brcm80211/brcmsmac/dma.c
@@ -34,7 +34,7 @@
#define D64MAXRINGSZ (1 << D64RINGALIGN_BITS)
#define D64RINGALIGN (1 << D64RINGALIGN_BITS)
-#define D64MAXDD (D64MAXRINGSZ / sizeof (dma64dd_t))
+#define D64MAXDD (D64MAXRINGSZ / sizeof(dma64dd_t))
/* transmit channel control */
#define D64_XC_XE 0x00000001 /* transmit enable */
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h b/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
index 68938fe..0019c04 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
@@ -966,16 +966,16 @@ struct lcnphy_radio_regs {
extern lcnphy_radio_regs_t lcnphy_radio_regs_2064[];
extern lcnphy_radio_regs_t lcnphy_radio_regs_2066[];
extern radio_regs_t regs_2055[], regs_SYN_2056[], regs_TX_2056[],
- regs_RX_2056[];
+ regs_RX_2056[];
extern radio_regs_t regs_SYN_2056_A1[], regs_TX_2056_A1[], regs_RX_2056_A1[];
extern radio_regs_t regs_SYN_2056_rev5[], regs_TX_2056_rev5[],
- regs_RX_2056_rev5[];
+ regs_RX_2056_rev5[];
extern radio_regs_t regs_SYN_2056_rev6[], regs_TX_2056_rev6[],
- regs_RX_2056_rev6[];
+ regs_RX_2056_rev6[];
extern radio_regs_t regs_SYN_2056_rev7[], regs_TX_2056_rev7[],
- regs_RX_2056_rev7[];
+ regs_RX_2056_rev7[];
extern radio_regs_t regs_SYN_2056_rev8[], regs_TX_2056_rev8[],
- regs_RX_2056_rev8[];
+ regs_RX_2056_rev8[];
extern radio_20xx_regs_t regs_2057_rev4[], regs_2057_rev5[], regs_2057_rev5v1[];
extern radio_20xx_regs_t regs_2057_rev7[], regs_2057_rev8[];
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
index 4d35e5d..3b61beb 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
@@ -888,9 +888,8 @@ lcnphy_radio_regs_t lcnphy_radio_regs_2064[] = {
#define LCNPHY_NUM_DIG_FILT_COEFFS 16
#define LCNPHY_NUM_TX_DIG_FILTERS_CCK 13
-u16
- LCNPHY_txdigfiltcoeffs_cck[LCNPHY_NUM_TX_DIG_FILTERS_CCK]
- [LCNPHY_NUM_DIG_FILT_COEFFS + 1] = {
+u16 LCNPHY_txdigfiltcoeffs_cck[LCNPHY_NUM_TX_DIG_FILTERS_CCK]
+ [LCNPHY_NUM_DIG_FILT_COEFFS + 1] = {
{0, 1, 415, 1874, 64, 128, 64, 792, 1656, 64, 128, 64, 778, 1582, 64,
128, 64,},
{1, 1, 402, 1847, 259, 59, 259, 671, 1794, 68, 54, 68, 608, 1863, 93,
@@ -920,9 +919,8 @@ u16
};
#define LCNPHY_NUM_TX_DIG_FILTERS_OFDM 3
-u16
- LCNPHY_txdigfiltcoeffs_ofdm[LCNPHY_NUM_TX_DIG_FILTERS_OFDM]
- [LCNPHY_NUM_DIG_FILT_COEFFS + 1] = {
+u16 LCNPHY_txdigfiltcoeffs_ofdm[LCNPHY_NUM_TX_DIG_FILTERS_OFDM]
+ [LCNPHY_NUM_DIG_FILT_COEFFS + 1] = {
{0, 0, 0xa2, 0x0, 0x100, 0x100, 0x0, 0x0, 0x0, 0x100, 0x0, 0x0,
0x278, 0xfea0, 0x80, 0x100, 0x80,},
{1, 0, 374, 0xFF79, 16, 32, 16, 799, 0xFE74, 50, 32, 50,
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phytbl_lcn.c b/drivers/staging/brcm80211/brcmsmac/phy/phytbl_lcn.c
index 6439d81..5b6538f 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phytbl_lcn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phytbl_lcn.c
@@ -1608,20 +1608,20 @@ const dot11lcnphytbl_info_t dot11lcnphytbl_rx_gain_info_extlna_5G_rev2[] = {
};
const u32 dot11lcnphytbl_rx_gain_info_sz_rev0 =
- sizeof(dot11lcnphytbl_rx_gain_info_rev0) /
- sizeof(dot11lcnphytbl_rx_gain_info_rev0[0]);
+ sizeof(dot11lcnphytbl_rx_gain_info_rev0) /
+ sizeof(dot11lcnphytbl_rx_gain_info_rev0[0]);
const u32 dot11lcnphytbl_rx_gain_info_sz_rev1 =
- sizeof(dot11lcnphytbl_rx_gain_info_rev1) /
- sizeof(dot11lcnphytbl_rx_gain_info_rev1[0]);
+ sizeof(dot11lcnphytbl_rx_gain_info_rev1) /
+ sizeof(dot11lcnphytbl_rx_gain_info_rev1[0]);
const u32 dot11lcnphytbl_rx_gain_info_2G_rev2_sz =
- sizeof(dot11lcnphytbl_rx_gain_info_2G_rev2) /
- sizeof(dot11lcnphytbl_rx_gain_info_2G_rev2[0]);
+ sizeof(dot11lcnphytbl_rx_gain_info_2G_rev2) /
+ sizeof(dot11lcnphytbl_rx_gain_info_2G_rev2[0]);
const u32 dot11lcnphytbl_rx_gain_info_5G_rev2_sz =
- sizeof(dot11lcnphytbl_rx_gain_info_5G_rev2) /
- sizeof(dot11lcnphytbl_rx_gain_info_5G_rev2[0]);
+ sizeof(dot11lcnphytbl_rx_gain_info_5G_rev2) /
+ sizeof(dot11lcnphytbl_rx_gain_info_5G_rev2[0]);
const u16 dot11lcn_min_sig_sq_tbl_rev0[] = {
0x014d,
@@ -2857,7 +2857,7 @@ const dot11lcnphytbl_info_t dot11lcn_sw_ctrl_tbl_info_4313_bt_epa_p250 = {
};
const u32 dot11lcnphytbl_info_sz_rev0 =
- sizeof(dot11lcnphytbl_info_rev0) / sizeof(dot11lcnphytbl_info_rev0[0]);
+ sizeof(dot11lcnphytbl_info_rev0) / sizeof(dot11lcnphytbl_info_rev0[0]);
const lcnphy_tx_gain_tbl_entry dot11lcnphy_2GHz_extPA_gaintable_rev0[128] = {
{3, 0, 31, 0, 72,}
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.c b/drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.c
index 84b4f69..8835367 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.c
@@ -4535,10 +4535,10 @@ const mimophytbl_info_t mimophytbl_info_rev0[] = {
};
const u32 mimophytbl_info_sz_rev0 =
- sizeof(mimophytbl_info_rev0) / sizeof(mimophytbl_info_rev0[0]);
+ sizeof(mimophytbl_info_rev0) / sizeof(mimophytbl_info_rev0[0]);
const u32 mimophytbl_info_sz_rev0_volatile =
- sizeof(mimophytbl_info_rev0_volatile) /
- sizeof(mimophytbl_info_rev0_volatile[0]);
+ sizeof(mimophytbl_info_rev0_volatile) /
+ sizeof(mimophytbl_info_rev0_volatile[0]);
const u16 ant_swctrl_tbl_rev3[] = {
0x0082,
@@ -9475,19 +9475,19 @@ const mimophytbl_info_t mimophytbl_info_rev3[] = {
};
const u32 mimophytbl_info_sz_rev3 =
- sizeof(mimophytbl_info_rev3) / sizeof(mimophytbl_info_rev3[0]);
+ sizeof(mimophytbl_info_rev3) / sizeof(mimophytbl_info_rev3[0]);
const u32 mimophytbl_info_sz_rev3_volatile =
- sizeof(mimophytbl_info_rev3_volatile) /
- sizeof(mimophytbl_info_rev3_volatile[0]);
+ sizeof(mimophytbl_info_rev3_volatile) /
+ sizeof(mimophytbl_info_rev3_volatile[0]);
const u32 mimophytbl_info_sz_rev3_volatile1 =
- sizeof(mimophytbl_info_rev3_volatile1) /
- sizeof(mimophytbl_info_rev3_volatile1[0]);
+ sizeof(mimophytbl_info_rev3_volatile1) /
+ sizeof(mimophytbl_info_rev3_volatile1[0]);
const u32 mimophytbl_info_sz_rev3_volatile2 =
- sizeof(mimophytbl_info_rev3_volatile2) /
- sizeof(mimophytbl_info_rev3_volatile2[0]);
+ sizeof(mimophytbl_info_rev3_volatile2) /
+ sizeof(mimophytbl_info_rev3_volatile2[0]);
const u32 mimophytbl_info_sz_rev3_volatile3 =
- sizeof(mimophytbl_info_rev3_volatile3) /
- sizeof(mimophytbl_info_rev3_volatile3[0]);
+ sizeof(mimophytbl_info_rev3_volatile3) /
+ sizeof(mimophytbl_info_rev3_volatile3[0]);
const u32 tmap_tbl_rev7[] = {
0x8a88aa80,
@@ -10579,7 +10579,7 @@ const mimophytbl_info_t mimophytbl_info_rev7[] = {
};
const u32 mimophytbl_info_sz_rev7 =
- sizeof(mimophytbl_info_rev7) / sizeof(mimophytbl_info_rev7[0]);
+ sizeof(mimophytbl_info_rev7) / sizeof(mimophytbl_info_rev7[0]);
const mimophytbl_info_t mimophytbl_info_rev16[] = {
{&noise_var_tbl_rev7,
@@ -10626,4 +10626,4 @@ const mimophytbl_info_t mimophytbl_info_rev16[] = {
};
const u32 mimophytbl_info_sz_rev16 =
- sizeof(mimophytbl_info_rev16) / sizeof(mimophytbl_info_rev16[0]);
+ sizeof(mimophytbl_info_rev16) / sizeof(mimophytbl_info_rev16[0]);
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.h b/drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.h
index a02b73c..4b2a04d 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phytbl_n.h
@@ -20,15 +20,15 @@
#include "phy_int.h"
extern const mimophytbl_info_t mimophytbl_info_rev0[],
- mimophytbl_info_rev0_volatile[];
+ mimophytbl_info_rev0_volatile[];
extern const u32 mimophytbl_info_sz_rev0, mimophytbl_info_sz_rev0_volatile;
extern const mimophytbl_info_t mimophytbl_info_rev3[],
- mimophytbl_info_rev3_volatile[], mimophytbl_info_rev3_volatile1[],
- mimophytbl_info_rev3_volatile2[], mimophytbl_info_rev3_volatile3[];
+ mimophytbl_info_rev3_volatile[], mimophytbl_info_rev3_volatile1[],
+ mimophytbl_info_rev3_volatile2[], mimophytbl_info_rev3_volatile3[];
extern const u32 mimophytbl_info_sz_rev3, mimophytbl_info_sz_rev3_volatile,
- mimophytbl_info_sz_rev3_volatile1, mimophytbl_info_sz_rev3_volatile2,
- mimophytbl_info_sz_rev3_volatile3;
+ mimophytbl_info_sz_rev3_volatile1, mimophytbl_info_sz_rev3_volatile2,
+ mimophytbl_info_sz_rev3_volatile3;
extern const u32 noise_var_tbl_rev3[];
diff --git a/drivers/staging/brcm80211/brcmsmac/phy_shim.h b/drivers/staging/brcm80211/brcmsmac/phy_shim.h
index 413d5db..61b3720 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy_shim.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy_shim.h
@@ -31,8 +31,8 @@
#define RADAR_TYPE_ITU_K 5 /* ITU K Radar type */
#define RADAR_TYPE_UNCLASSIFIED 6 /* Unclassified Radar type */
#define RADAR_TYPE_BIN5 7 /* long pulse radar type */
-#define RADAR_TYPE_STG2 8 /* staggered-2 radar */
-#define RADAR_TYPE_STG3 9 /* staggered-3 radar */
+#define RADAR_TYPE_STG2 8 /* staggered-2 radar */
+#define RADAR_TYPE_STG3 9 /* staggered-3 radar */
#define RADAR_TYPE_FRA 10 /* French radar */
/* French radar pulse widths */
diff --git a/drivers/staging/brcm80211/brcmutil/utils.c b/drivers/staging/brcm80211/brcmutil/utils.c
index e221a3b..37b6b77 100644
--- a/drivers/staging/brcm80211/brcmutil/utils.c
+++ b/drivers/staging/brcm80211/brcmutil/utils.c
@@ -510,7 +510,7 @@ static const u8 crc8_table[256] = {
u8 brcmu_crc8(u8 *pdata, /* pointer to array of data to process */
uint nbytes, /* number of input data bytes to process */
u8 crc /* either CRC8_INIT_VALUE or previous return value */
- ) {
+ ) {
/* loop over the buffer data */
while (nbytes-- > 0)
crc = crc8_table[(crc ^ *pdata++) & 0xff];
diff --git a/drivers/staging/brcm80211/include/brcmu_utils.h b/drivers/staging/brcm80211/include/brcmu_utils.h
index b0f36e3..d0039d7 100644
--- a/drivers/staging/brcm80211/include/brcmu_utils.h
+++ b/drivers/staging/brcm80211/include/brcmu_utils.h
@@ -246,9 +246,9 @@ extern int brcmu_iovar_lencheck(const struct brcmu_iovar *table, void *arg,
/* modulo add/sub - assumes x, y E [0, bound - 1] */
#define MODADD(x, y, bound) \
- MUX((x) + (y) >= (bound), (x) + (y) - (bound), (x) + (y))
+ MUX((x) + (y) >= (bound), (x) + (y) - (bound), (x) + (y))
#define MODSUB(x, y, bound) \
- MUX(((int)(x)) - ((int)(y)) < 0, (x) - (y) + (bound), (x) - (y))
+ MUX(((int)(x)) - ((int)(y)) < 0, (x) - (y) + (bound), (x) - (y))
/* module add/sub, bound = 2^k */
#define MODADD_POW2(x, y, bound) (((x) + (y)) & ((bound) - 1))
--
1.7.1
From: Arend van Spriel <[email protected]>
Renaming fullmac to have more consistent naming throughout the
driver. This commit renames identifiers related to firmware event
handling.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 326 +++++++++++-----------
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 242 ++++++++--------
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 56 ++--
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 111 ++++----
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h | 10 +-
5 files changed, 371 insertions(+), 374 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 55cbd8a..1145e5b 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -136,11 +136,11 @@ struct dhd_info;
#define DOT11_BSSTYPE_ANY 2
#define DOT11_MAX_DEFAULT_KEYS 4
-#define WLC_EVENT_MSG_LINK 0x01
-#define WLC_EVENT_MSG_FLUSHTXQ 0x02
-#define WLC_EVENT_MSG_GROUP 0x04
+#define BRCMF_EVENT_MSG_LINK 0x01
+#define BRCMF_EVENT_MSG_FLUSHTXQ 0x02
+#define BRCMF_EVENT_MSG_GROUP 0x04
-typedef struct {
+typedef struct brcmf_event_msg {
u16 version;
u16 flags;
u32 event_type;
@@ -150,173 +150,169 @@ typedef struct {
u32 datalen;
u8 addr[ETH_ALEN];
char ifname[IFNAMSIZ];
-} __attribute__((packed)) wl_event_msg_t;
+} __packed brcmf_event_msg_t;
-typedef struct bcmeth_hdr {
+struct brcm_ethhdr {
u16 subtype;
u16 length;
u8 version;
u8 oui[3];
u16 usr_subtype;
-} __attribute__((packed)) bcmeth_hdr_t;
+} __packed;
-#ifdef BRCM_FULLMAC
-typedef struct bcm_event {
+typedef struct brcmf_event {
struct ethhdr eth;
- bcmeth_hdr_t bcm_hdr;
- wl_event_msg_t event;
-} __attribute__((packed)) bcm_event_t;
-#endif
-#define BCM_MSG_LEN (sizeof(bcm_event_t) - sizeof(bcmeth_hdr_t) - \
- sizeof(struct ether_header))
-
-#define WLC_E_SET_SSID 0
-#define WLC_E_JOIN 1
-#define WLC_E_START 2
-#define WLC_E_AUTH 3
-#define WLC_E_AUTH_IND 4
-#define WLC_E_DEAUTH 5
-#define WLC_E_DEAUTH_IND 6
-#define WLC_E_ASSOC 7
-#define WLC_E_ASSOC_IND 8
-#define WLC_E_REASSOC 9
-#define WLC_E_REASSOC_IND 10
-#define WLC_E_DISASSOC 11
-#define WLC_E_DISASSOC_IND 12
-#define WLC_E_QUIET_START 13
-#define WLC_E_QUIET_END 14
-#define WLC_E_BEACON_RX 15
-#define WLC_E_LINK 16
-#define WLC_E_MIC_ERROR 17
-#define WLC_E_NDIS_LINK 18
-#define WLC_E_ROAM 19
-#define WLC_E_TXFAIL 20
-#define WLC_E_PMKID_CACHE 21
-#define WLC_E_RETROGRADE_TSF 22
-#define WLC_E_PRUNE 23
-#define WLC_E_AUTOAUTH 24
-#define WLC_E_EAPOL_MSG 25
-#define WLC_E_SCAN_COMPLETE 26
-#define WLC_E_ADDTS_IND 27
-#define WLC_E_DELTS_IND 28
-#define WLC_E_BCNSENT_IND 29
-#define WLC_E_BCNRX_MSG 30
-#define WLC_E_BCNLOST_MSG 31
-#define WLC_E_ROAM_PREP 32
-#define WLC_E_PFN_NET_FOUND 33
-#define WLC_E_PFN_NET_LOST 34
-#define WLC_E_RESET_COMPLETE 35
-#define WLC_E_JOIN_START 36
-#define WLC_E_ROAM_START 37
-#define WLC_E_ASSOC_START 38
-#define WLC_E_IBSS_ASSOC 39
-#define WLC_E_RADIO 40
-#define WLC_E_PSM_WATCHDOG 41
-#define WLC_E_PROBREQ_MSG 44
-#define WLC_E_SCAN_CONFIRM_IND 45
-#define WLC_E_PSK_SUP 46
-#define WLC_E_COUNTRY_CODE_CHANGED 47
-#define WLC_E_EXCEEDED_MEDIUM_TIME 48
-#define WLC_E_ICV_ERROR 49
-#define WLC_E_UNICAST_DECODE_ERROR 50
-#define WLC_E_MULTICAST_DECODE_ERROR 51
-#define WLC_E_TRACE 52
-#define WLC_E_IF 54
-#define WLC_E_RSSI 56
-#define WLC_E_PFN_SCAN_COMPLETE 57
-#define WLC_E_EXTLOG_MSG 58
-#define WLC_E_ACTION_FRAME 59
-#define WLC_E_ACTION_FRAME_COMPLETE 60
-#define WLC_E_PRE_ASSOC_IND 61
-#define WLC_E_PRE_REASSOC_IND 62
-#define WLC_E_CHANNEL_ADOPTED 63
-#define WLC_E_AP_STARTED 64
-#define WLC_E_DFS_AP_STOP 65
-#define WLC_E_DFS_AP_RESUME 66
-#define WLC_E_RESERVED1 67
-#define WLC_E_RESERVED2 68
-#define WLC_E_ESCAN_RESULT 69
-#define WLC_E_ACTION_FRAME_OFF_CHAN_COMPLETE 70
-#define WLC_E_DCS_REQUEST 73
-
-#define WLC_E_FIFO_CREDIT_MAP 74
-
-#define WLC_E_LAST 75
-
-#define WLC_E_STATUS_SUCCESS 0
-#define WLC_E_STATUS_FAIL 1
-#define WLC_E_STATUS_TIMEOUT 2
-#define WLC_E_STATUS_NO_NETWORKS 3
-#define WLC_E_STATUS_ABORT 4
-#define WLC_E_STATUS_NO_ACK 5
-#define WLC_E_STATUS_UNSOLICITED 6
-#define WLC_E_STATUS_ATTEMPT 7
-#define WLC_E_STATUS_PARTIAL 8
-#define WLC_E_STATUS_NEWSCAN 9
-#define WLC_E_STATUS_NEWASSOC 10
-#define WLC_E_STATUS_11HQUIET 11
-#define WLC_E_STATUS_SUPPRESS 12
-#define WLC_E_STATUS_NOCHANS 13
-#define WLC_E_STATUS_CS_ABORT 15
-#define WLC_E_STATUS_ERROR 16
-
-#define WLC_E_REASON_INITIAL_ASSOC 0
-#define WLC_E_REASON_LOW_RSSI 1
-#define WLC_E_REASON_DEAUTH 2
-#define WLC_E_REASON_DISASSOC 3
-#define WLC_E_REASON_BCNS_LOST 4
-#define WLC_E_REASON_MINTXRATE 9
-#define WLC_E_REASON_TXFAIL 10
-
-#define WLC_E_REASON_FAST_ROAM_FAILED 5
-#define WLC_E_REASON_DIRECTED_ROAM 6
-#define WLC_E_REASON_TSPEC_REJECTED 7
-#define WLC_E_REASON_BETTER_AP 8
-
-#define WLC_E_PRUNE_ENCR_MISMATCH 1
-#define WLC_E_PRUNE_BCAST_BSSID 2
-#define WLC_E_PRUNE_MAC_DENY 3
-#define WLC_E_PRUNE_MAC_NA 4
-#define WLC_E_PRUNE_REG_PASSV 5
-#define WLC_E_PRUNE_SPCT_MGMT 6
-#define WLC_E_PRUNE_RADAR 7
-#define WLC_E_RSN_MISMATCH 8
-#define WLC_E_PRUNE_NO_COMMON_RATES 9
-#define WLC_E_PRUNE_BASIC_RATES 10
-#define WLC_E_PRUNE_CIPHER_NA 12
-#define WLC_E_PRUNE_KNOWN_STA 13
-#define WLC_E_PRUNE_WDS_PEER 15
-#define WLC_E_PRUNE_QBSS_LOAD 16
-#define WLC_E_PRUNE_HOME_AP 17
-
-#define WLC_E_SUP_OTHER 0
-#define WLC_E_SUP_DECRYPT_KEY_DATA 1
-#define WLC_E_SUP_BAD_UCAST_WEP128 2
-#define WLC_E_SUP_BAD_UCAST_WEP40 3
-#define WLC_E_SUP_UNSUP_KEY_LEN 4
-#define WLC_E_SUP_PW_KEY_CIPHER 5
-#define WLC_E_SUP_MSG3_TOO_MANY_IE 6
-#define WLC_E_SUP_MSG3_IE_MISMATCH 7
-#define WLC_E_SUP_NO_INSTALL_FLAG 8
-#define WLC_E_SUP_MSG3_NO_GTK 9
-#define WLC_E_SUP_GRP_KEY_CIPHER 10
-#define WLC_E_SUP_GRP_MSG1_NO_GTK 11
-#define WLC_E_SUP_GTK_DECRYPT_FAIL 12
-#define WLC_E_SUP_SEND_FAIL 13
-#define WLC_E_SUP_DEAUTH 14
-
-#define WLC_E_IF_ADD 1
-#define WLC_E_IF_DEL 2
-#define WLC_E_IF_CHANGE 3
-
-#define WLC_E_IF_ROLE_STA 0
-#define WLC_E_IF_ROLE_AP 1
-#define WLC_E_IF_ROLE_WDS 2
-
-#define WLC_E_LINK_BCN_LOSS 1
-#define WLC_E_LINK_DISASSOC 2
-#define WLC_E_LINK_ASSOC_REC 3
-#define WLC_E_LINK_BSSCFG_DIS 4
+ struct brcm_ethhdr hdr;
+ struct brcmf_event_msg msg;
+} __packed brcmf_event_t;
+
+#define BRCMF_E_SET_SSID 0
+#define BRCMF_E_JOIN 1
+#define BRCMF_E_START 2
+#define BRCMF_E_AUTH 3
+#define BRCMF_E_AUTH_IND 4
+#define BRCMF_E_DEAUTH 5
+#define BRCMF_E_DEAUTH_IND 6
+#define BRCMF_E_ASSOC 7
+#define BRCMF_E_ASSOC_IND 8
+#define BRCMF_E_REASSOC 9
+#define BRCMF_E_REASSOC_IND 10
+#define BRCMF_E_DISASSOC 11
+#define BRCMF_E_DISASSOC_IND 12
+#define BRCMF_E_QUIET_START 13
+#define BRCMF_E_QUIET_END 14
+#define BRCMF_E_BEACON_RX 15
+#define BRCMF_E_LINK 16
+#define BRCMF_E_MIC_ERROR 17
+#define BRCMF_E_NDIS_LINK 18
+#define BRCMF_E_ROAM 19
+#define BRCMF_E_TXFAIL 20
+#define BRCMF_E_PMKID_CACHE 21
+#define BRCMF_E_RETROGRADE_TSF 22
+#define BRCMF_E_PRUNE 23
+#define BRCMF_E_AUTOAUTH 24
+#define BRCMF_E_EAPOL_MSG 25
+#define BRCMF_E_SCAN_COMPLETE 26
+#define BRCMF_E_ADDTS_IND 27
+#define BRCMF_E_DELTS_IND 28
+#define BRCMF_E_BCNSENT_IND 29
+#define BRCMF_E_BCNRX_MSG 30
+#define BRCMF_E_BCNLOST_MSG 31
+#define BRCMF_E_ROAM_PREP 32
+#define BRCMF_E_PFN_NET_FOUND 33
+#define BRCMF_E_PFN_NET_LOST 34
+#define BRCMF_E_RESET_COMPLETE 35
+#define BRCMF_E_JOIN_START 36
+#define BRCMF_E_ROAM_START 37
+#define BRCMF_E_ASSOC_START 38
+#define BRCMF_E_IBSS_ASSOC 39
+#define BRCMF_E_RADIO 40
+#define BRCMF_E_PSM_WATCHDOG 41
+#define BRCMF_E_PROBREQ_MSG 44
+#define BRCMF_E_SCAN_CONFIRM_IND 45
+#define BRCMF_E_PSK_SUP 46
+#define BRCMF_E_COUNTRY_CODE_CHANGED 47
+#define BRCMF_E_EXCEEDED_MEDIUM_TIME 48
+#define BRCMF_E_ICV_ERROR 49
+#define BRCMF_E_UNICAST_DECODE_ERROR 50
+#define BRCMF_E_MULTICAST_DECODE_ERROR 51
+#define BRCMF_E_TRACE 52
+#define BRCMF_E_IF 54
+#define BRCMF_E_RSSI 56
+#define BRCMF_E_PFN_SCAN_COMPLETE 57
+#define BRCMF_E_EXTLOG_MSG 58
+#define BRCMF_E_ACTION_FRAME 59
+#define BRCMF_E_ACTION_FRAME_COMPLETE 60
+#define BRCMF_E_PRE_ASSOC_IND 61
+#define BRCMF_E_PRE_REASSOC_IND 62
+#define BRCMF_E_CHANNEL_ADOPTED 63
+#define BRCMF_E_AP_STARTED 64
+#define BRCMF_E_DFS_AP_STOP 65
+#define BRCMF_E_DFS_AP_RESUME 66
+#define BRCMF_E_RESERVED1 67
+#define BRCMF_E_RESERVED2 68
+#define BRCMF_E_ESCAN_RESULT 69
+#define BRCMF_E_ACTION_FRAME_OFF_CHAN_COMPLETE 70
+#define BRCMF_E_DCS_REQUEST 73
+
+#define BRCMF_E_FIFO_CREDIT_MAP 74
+
+#define BRCMF_E_LAST 75
+
+#define BRCMF_E_STATUS_SUCCESS 0
+#define BRCMF_E_STATUS_FAIL 1
+#define BRCMF_E_STATUS_TIMEOUT 2
+#define BRCMF_E_STATUS_NO_NETWORKS 3
+#define BRCMF_E_STATUS_ABORT 4
+#define BRCMF_E_STATUS_NO_ACK 5
+#define BRCMF_E_STATUS_UNSOLICITED 6
+#define BRCMF_E_STATUS_ATTEMPT 7
+#define BRCMF_E_STATUS_PARTIAL 8
+#define BRCMF_E_STATUS_NEWSCAN 9
+#define BRCMF_E_STATUS_NEWASSOC 10
+#define BRCMF_E_STATUS_11HQUIET 11
+#define BRCMF_E_STATUS_SUPPRESS 12
+#define BRCMF_E_STATUS_NOCHANS 13
+#define BRCMF_E_STATUS_CS_ABORT 15
+#define BRCMF_E_STATUS_ERROR 16
+
+#define BRCMF_E_REASON_INITIAL_ASSOC 0
+#define BRCMF_E_REASON_LOW_RSSI 1
+#define BRCMF_E_REASON_DEAUTH 2
+#define BRCMF_E_REASON_DISASSOC 3
+#define BRCMF_E_REASON_BCNS_LOST 4
+#define BRCMF_E_REASON_MINTXRATE 9
+#define BRCMF_E_REASON_TXFAIL 10
+
+#define BRCMF_E_REASON_FAST_ROAM_FAILED 5
+#define BRCMF_E_REASON_DIRECTED_ROAM 6
+#define BRCMF_E_REASON_TSPEC_REJECTED 7
+#define BRCMF_E_REASON_BETTER_AP 8
+
+#define BRCMF_E_PRUNE_ENCR_MISMATCH 1
+#define BRCMF_E_PRUNE_BCAST_BSSID 2
+#define BRCMF_E_PRUNE_MAC_DENY 3
+#define BRCMF_E_PRUNE_MAC_NA 4
+#define BRCMF_E_PRUNE_REG_PASSV 5
+#define BRCMF_E_PRUNE_SPCT_MGMT 6
+#define BRCMF_E_PRUNE_RADAR 7
+#define BRCMF_E_RSN_MISMATCH 8
+#define BRCMF_E_PRUNE_NO_COMMON_RATES 9
+#define BRCMF_E_PRUNE_BASIC_RATES 10
+#define BRCMF_E_PRUNE_CIPHER_NA 12
+#define BRCMF_E_PRUNE_KNOWN_STA 13
+#define BRCMF_E_PRUNE_WDS_PEER 15
+#define BRCMF_E_PRUNE_QBSS_LOAD 16
+#define BRCMF_E_PRUNE_HOME_AP 17
+
+#define BRCMF_E_SUP_OTHER 0
+#define BRCMF_E_SUP_DECRYPT_KEY_DATA 1
+#define BRCMF_E_SUP_BAD_UCAST_WEP128 2
+#define BRCMF_E_SUP_BAD_UCAST_WEP40 3
+#define BRCMF_E_SUP_UNSUP_KEY_LEN 4
+#define BRCMF_E_SUP_PW_KEY_CIPHER 5
+#define BRCMF_E_SUP_MSG3_TOO_MANY_IE 6
+#define BRCMF_E_SUP_MSG3_IE_MISMATCH 7
+#define BRCMF_E_SUP_NO_INSTALL_FLAG 8
+#define BRCMF_E_SUP_MSG3_NO_GTK 9
+#define BRCMF_E_SUP_GRP_KEY_CIPHER 10
+#define BRCMF_E_SUP_GRP_MSG1_NO_GTK 11
+#define BRCMF_E_SUP_GTK_DECRYPT_FAIL 12
+#define BRCMF_E_SUP_SEND_FAIL 13
+#define BRCMF_E_SUP_DEAUTH 14
+
+#define BRCMF_E_IF_ADD 1
+#define BRCMF_E_IF_DEL 2
+#define BRCMF_E_IF_CHANGE 3
+
+#define BRCMF_E_IF_ROLE_STA 0
+#define BRCMF_E_IF_ROLE_AP 1
+#define BRCMF_E_IF_ROLE_WDS 2
+
+#define BRCMF_E_LINK_BCN_LOSS 1
+#define BRCMF_E_LINK_DISASSOC 2
+#define BRCMF_E_LINK_ASSOC_REC 3
+#define BRCMF_E_LINK_BSSCFG_DIS 4
enum cust_gpio_modes {
WLAN_RESET_ON,
@@ -950,7 +946,7 @@ extern int dhd_timeout_expired(dhd_timeout_t *tmo);
extern int dhd_ifname2idx(struct dhd_info *dhd, char *name);
extern u8 *dhd_bssidx2bssid(dhd_pub_t *dhd, int idx);
extern int brcmf_c_host_event(struct dhd_info *dhd, int *idx, void *pktdata,
- wl_event_msg_t *, void **data_ptr);
+ brcmf_event_msg_t *, void **data_ptr);
extern void brcmf_c_init(void);
@@ -969,7 +965,7 @@ extern void dhd_vif_sendup(struct dhd_info *dhd, int ifidx, unsigned char * cp,
extern int dhd_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pkt);
/* Send event to host */
-extern void dhd_sendup_event(dhd_pub_t *dhdp, wl_event_msg_t *event,
+extern void dhd_sendup_event(dhd_pub_t *dhdp, brcmf_event_msg_t *event,
void *data);
extern int dhd_bus_devreset(dhd_pub_t *dhdp, u8 flag);
extern uint dhd_bus_status(dhd_pub_t *dhdp);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 4318bed..b06d7e0 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -517,7 +517,7 @@ int brcmf_c_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf, uint buflen)
}
#ifdef SHOW_EVENTS
-static void brcmf_c_show_host_event(wl_event_msg_t *event, void *event_data)
+static void brcmf_c_show_host_event(brcmf_event_msg_t *event, void *event_data)
{
uint i, status, reason;
bool group = false, flush_txq = false, link = false;
@@ -529,62 +529,62 @@ static void brcmf_c_show_host_event(wl_event_msg_t *event, void *event_data)
char *event_name;
} event_names[] = {
{
- WLC_E_SET_SSID, "SET_SSID"}, {
- WLC_E_JOIN, "JOIN"}, {
- WLC_E_START, "START"}, {
- WLC_E_AUTH, "AUTH"}, {
- WLC_E_AUTH_IND, "AUTH_IND"}, {
- WLC_E_DEAUTH, "DEAUTH"}, {
- WLC_E_DEAUTH_IND, "DEAUTH_IND"}, {
- WLC_E_ASSOC, "ASSOC"}, {
- WLC_E_ASSOC_IND, "ASSOC_IND"}, {
- WLC_E_REASSOC, "REASSOC"}, {
- WLC_E_REASSOC_IND, "REASSOC_IND"}, {
- WLC_E_DISASSOC, "DISASSOC"}, {
- WLC_E_DISASSOC_IND, "DISASSOC_IND"}, {
- WLC_E_QUIET_START, "START_QUIET"}, {
- WLC_E_QUIET_END, "END_QUIET"}, {
- WLC_E_BEACON_RX, "BEACON_RX"}, {
- WLC_E_LINK, "LINK"}, {
- WLC_E_MIC_ERROR, "MIC_ERROR"}, {
- WLC_E_NDIS_LINK, "NDIS_LINK"}, {
- WLC_E_ROAM, "ROAM"}, {
- WLC_E_TXFAIL, "TXFAIL"}, {
- WLC_E_PMKID_CACHE, "PMKID_CACHE"}, {
- WLC_E_RETROGRADE_TSF, "RETROGRADE_TSF"}, {
- WLC_E_PRUNE, "PRUNE"}, {
- WLC_E_AUTOAUTH, "AUTOAUTH"}, {
- WLC_E_EAPOL_MSG, "EAPOL_MSG"}, {
- WLC_E_SCAN_COMPLETE, "SCAN_COMPLETE"}, {
- WLC_E_ADDTS_IND, "ADDTS_IND"}, {
- WLC_E_DELTS_IND, "DELTS_IND"}, {
- WLC_E_BCNSENT_IND, "BCNSENT_IND"}, {
- WLC_E_BCNRX_MSG, "BCNRX_MSG"}, {
- WLC_E_BCNLOST_MSG, "BCNLOST_MSG"}, {
- WLC_E_ROAM_PREP, "ROAM_PREP"}, {
- WLC_E_PFN_NET_FOUND, "PNO_NET_FOUND"}, {
- WLC_E_PFN_NET_LOST, "PNO_NET_LOST"}, {
- WLC_E_RESET_COMPLETE, "RESET_COMPLETE"}, {
- WLC_E_JOIN_START, "JOIN_START"}, {
- WLC_E_ROAM_START, "ROAM_START"}, {
- WLC_E_ASSOC_START, "ASSOC_START"}, {
- WLC_E_IBSS_ASSOC, "IBSS_ASSOC"}, {
- WLC_E_RADIO, "RADIO"}, {
- WLC_E_PSM_WATCHDOG, "PSM_WATCHDOG"}, {
- WLC_E_PROBREQ_MSG, "PROBREQ_MSG"}, {
- WLC_E_SCAN_CONFIRM_IND, "SCAN_CONFIRM_IND"}, {
- WLC_E_PSK_SUP, "PSK_SUP"}, {
- WLC_E_COUNTRY_CODE_CHANGED, "COUNTRY_CODE_CHANGED"}, {
- WLC_E_EXCEEDED_MEDIUM_TIME, "EXCEEDED_MEDIUM_TIME"}, {
- WLC_E_ICV_ERROR, "ICV_ERROR"}, {
- WLC_E_UNICAST_DECODE_ERROR, "UNICAST_DECODE_ERROR"}, {
- WLC_E_MULTICAST_DECODE_ERROR, "MULTICAST_DECODE_ERROR"}, {
- WLC_E_TRACE, "TRACE"}, {
- WLC_E_ACTION_FRAME, "ACTION FRAME"}, {
- WLC_E_ACTION_FRAME_COMPLETE, "ACTION FRAME TX COMPLETE"}, {
- WLC_E_IF, "IF"}, {
- WLC_E_RSSI, "RSSI"}, {
- WLC_E_PFN_SCAN_COMPLETE, "SCAN_COMPLETE"}
+ BRCMF_E_SET_SSID, "SET_SSID"}, {
+ BRCMF_E_JOIN, "JOIN"}, {
+ BRCMF_E_START, "START"}, {
+ BRCMF_E_AUTH, "AUTH"}, {
+ BRCMF_E_AUTH_IND, "AUTH_IND"}, {
+ BRCMF_E_DEAUTH, "DEAUTH"}, {
+ BRCMF_E_DEAUTH_IND, "DEAUTH_IND"}, {
+ BRCMF_E_ASSOC, "ASSOC"}, {
+ BRCMF_E_ASSOC_IND, "ASSOC_IND"}, {
+ BRCMF_E_REASSOC, "REASSOC"}, {
+ BRCMF_E_REASSOC_IND, "REASSOC_IND"}, {
+ BRCMF_E_DISASSOC, "DISASSOC"}, {
+ BRCMF_E_DISASSOC_IND, "DISASSOC_IND"}, {
+ BRCMF_E_QUIET_START, "START_QUIET"}, {
+ BRCMF_E_QUIET_END, "END_QUIET"}, {
+ BRCMF_E_BEACON_RX, "BEACON_RX"}, {
+ BRCMF_E_LINK, "LINK"}, {
+ BRCMF_E_MIC_ERROR, "MIC_ERROR"}, {
+ BRCMF_E_NDIS_LINK, "NDIS_LINK"}, {
+ BRCMF_E_ROAM, "ROAM"}, {
+ BRCMF_E_TXFAIL, "TXFAIL"}, {
+ BRCMF_E_PMKID_CACHE, "PMKID_CACHE"}, {
+ BRCMF_E_RETROGRADE_TSF, "RETROGRADE_TSF"}, {
+ BRCMF_E_PRUNE, "PRUNE"}, {
+ BRCMF_E_AUTOAUTH, "AUTOAUTH"}, {
+ BRCMF_E_EAPOL_MSG, "EAPOL_MSG"}, {
+ BRCMF_E_SCAN_COMPLETE, "SCAN_COMPLETE"}, {
+ BRCMF_E_ADDTS_IND, "ADDTS_IND"}, {
+ BRCMF_E_DELTS_IND, "DELTS_IND"}, {
+ BRCMF_E_BCNSENT_IND, "BCNSENT_IND"}, {
+ BRCMF_E_BCNRX_MSG, "BCNRX_MSG"}, {
+ BRCMF_E_BCNLOST_MSG, "BCNLOST_MSG"}, {
+ BRCMF_E_ROAM_PREP, "ROAM_PREP"}, {
+ BRCMF_E_PFN_NET_FOUND, "PNO_NET_FOUND"}, {
+ BRCMF_E_PFN_NET_LOST, "PNO_NET_LOST"}, {
+ BRCMF_E_RESET_COMPLETE, "RESET_COMPLETE"}, {
+ BRCMF_E_JOIN_START, "JOIN_START"}, {
+ BRCMF_E_ROAM_START, "ROAM_START"}, {
+ BRCMF_E_ASSOC_START, "ASSOC_START"}, {
+ BRCMF_E_IBSS_ASSOC, "IBSS_ASSOC"}, {
+ BRCMF_E_RADIO, "RADIO"}, {
+ BRCMF_E_PSM_WATCHDOG, "PSM_WATCHDOG"}, {
+ BRCMF_E_PROBREQ_MSG, "PROBREQ_MSG"}, {
+ BRCMF_E_SCAN_CONFIRM_IND, "SCAN_CONFIRM_IND"}, {
+ BRCMF_E_PSK_SUP, "PSK_SUP"}, {
+ BRCMF_E_COUNTRY_CODE_CHANGED, "COUNTRY_CODE_CHANGED"}, {
+ BRCMF_E_EXCEEDED_MEDIUM_TIME, "EXCEEDED_MEDIUM_TIME"}, {
+ BRCMF_E_ICV_ERROR, "ICV_ERROR"}, {
+ BRCMF_E_UNICAST_DECODE_ERROR, "UNICAST_DECODE_ERROR"}, {
+ BRCMF_E_MULTICAST_DECODE_ERROR, "MULTICAST_DECODE_ERROR"}, {
+ BRCMF_E_TRACE, "TRACE"}, {
+ BRCMF_E_ACTION_FRAME, "ACTION FRAME"}, {
+ BRCMF_E_ACTION_FRAME_COMPLETE, "ACTION FRAME TX COMPLETE"}, {
+ BRCMF_E_IF, "IF"}, {
+ BRCMF_E_RSSI, "RSSI"}, {
+ BRCMF_E_PFN_SCAN_COMPLETE, "SCAN_COMPLETE"}
};
uint event_type, flags, auth_type, datalen;
event_type = be32_to_cpu(event->event_type);
@@ -606,34 +606,34 @@ static void brcmf_c_show_host_event(wl_event_msg_t *event, void *event_data)
DHD_EVENT(("flags 0x%04x, status %d, reason %d, auth_type %d MAC %s\n",
flags, status, reason, auth_type, eabuf));
- if (flags & WLC_EVENT_MSG_LINK)
+ if (flags & BRCMF_EVENT_MSG_LINK)
link = true;
- if (flags & WLC_EVENT_MSG_GROUP)
+ if (flags & BRCMF_EVENT_MSG_GROUP)
group = true;
- if (flags & WLC_EVENT_MSG_FLUSHTXQ)
+ if (flags & BRCMF_EVENT_MSG_FLUSHTXQ)
flush_txq = true;
switch (event_type) {
- case WLC_E_START:
- case WLC_E_DEAUTH:
- case WLC_E_DISASSOC:
+ case BRCMF_E_START:
+ case BRCMF_E_DEAUTH:
+ case BRCMF_E_DISASSOC:
DHD_EVENT(("MACEVENT: %s, MAC %s\n", event_name, eabuf));
break;
- case WLC_E_ASSOC_IND:
- case WLC_E_REASSOC_IND:
+ case BRCMF_E_ASSOC_IND:
+ case BRCMF_E_REASSOC_IND:
DHD_EVENT(("MACEVENT: %s, MAC %s\n", event_name, eabuf));
break;
- case WLC_E_ASSOC:
- case WLC_E_REASSOC:
- if (status == WLC_E_STATUS_SUCCESS) {
+ 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));
- } else if (status == WLC_E_STATUS_TIMEOUT) {
+ } else if (status == BRCMF_E_STATUS_TIMEOUT) {
DHD_EVENT(("MACEVENT: %s, MAC %s, TIMEOUT\n",
event_name, eabuf));
- } else if (status == WLC_E_STATUS_FAIL) {
+ } else if (status == BRCMF_E_STATUS_FAIL) {
DHD_EVENT(("MACEVENT: %s, MAC %s, FAILURE, reason %d\n",
event_name, eabuf, (int)reason));
} else {
@@ -642,14 +642,14 @@ static void brcmf_c_show_host_event(wl_event_msg_t *event, void *event_data)
}
break;
- case WLC_E_DEAUTH_IND:
- case WLC_E_DISASSOC_IND:
+ case BRCMF_E_DEAUTH_IND:
+ case BRCMF_E_DISASSOC_IND:
DHD_EVENT(("MACEVENT: %s, MAC %s, reason %d\n", event_name,
eabuf, (int)reason));
break;
- case WLC_E_AUTH:
- case WLC_E_AUTH_IND:
+ case BRCMF_E_AUTH:
+ case BRCMF_E_AUTH_IND:
if (auth_type == WLAN_AUTH_OPEN)
auth_str = "Open System";
else if (auth_type == WLAN_AUTH_SHARED_KEY)
@@ -658,16 +658,16 @@ static void brcmf_c_show_host_event(wl_event_msg_t *event, void *event_data)
sprintf(err_msg, "AUTH unknown: %d", (int)auth_type);
auth_str = err_msg;
}
- if (event_type == WLC_E_AUTH_IND) {
+ if (event_type == BRCMF_E_AUTH_IND) {
DHD_EVENT(("MACEVENT: %s, MAC %s, %s\n", event_name,
eabuf, auth_str));
- } else if (status == WLC_E_STATUS_SUCCESS) {
+ } else if (status == BRCMF_E_STATUS_SUCCESS) {
DHD_EVENT(("MACEVENT: %s, MAC %s, %s, SUCCESS\n",
event_name, eabuf, auth_str));
- } else if (status == WLC_E_STATUS_TIMEOUT) {
+ } else if (status == BRCMF_E_STATUS_TIMEOUT) {
DHD_EVENT(("MACEVENT: %s, MAC %s, %s, TIMEOUT\n",
event_name, eabuf, auth_str));
- } else if (status == WLC_E_STATUS_FAIL) {
+ } 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));
@@ -675,15 +675,15 @@ static void brcmf_c_show_host_event(wl_event_msg_t *event, void *event_data)
break;
- case WLC_E_JOIN:
- case WLC_E_ROAM:
- case WLC_E_SET_SSID:
- if (status == WLC_E_STATUS_SUCCESS) {
+ case BRCMF_E_JOIN:
+ 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));
- } else if (status == WLC_E_STATUS_FAIL) {
+ } else if (status == BRCMF_E_STATUS_FAIL) {
DHD_EVENT(("MACEVENT: %s, failed\n", event_name));
- } else if (status == WLC_E_STATUS_NO_NETWORKS) {
+ } else if (status == BRCMF_E_STATUS_NO_NETWORKS) {
DHD_EVENT(("MACEVENT: %s, no networks found\n",
event_name));
} else {
@@ -692,10 +692,10 @@ static void brcmf_c_show_host_event(wl_event_msg_t *event, void *event_data)
}
break;
- case WLC_E_BEACON_RX:
- if (status == WLC_E_STATUS_SUCCESS) {
+ case BRCMF_E_BEACON_RX:
+ if (status == BRCMF_E_STATUS_SUCCESS) {
DHD_EVENT(("MACEVENT: %s, SUCCESS\n", event_name));
- } else if (status == WLC_E_STATUS_FAIL) {
+ } else if (status == BRCMF_E_STATUS_FAIL) {
DHD_EVENT(("MACEVENT: %s, FAIL\n", event_name));
} else {
DHD_EVENT(("MACEVENT: %s, status %d\n", event_name,
@@ -703,44 +703,44 @@ static void brcmf_c_show_host_event(wl_event_msg_t *event, void *event_data)
}
break;
- case WLC_E_LINK:
+ case BRCMF_E_LINK:
DHD_EVENT(("MACEVENT: %s %s\n", event_name,
link ? "UP" : "DOWN"));
break;
- case WLC_E_MIC_ERROR:
+ case BRCMF_E_MIC_ERROR:
DHD_EVENT(("MACEVENT: %s, MAC %s, Group %d, Flush %d\n",
event_name, eabuf, group, flush_txq));
break;
- case WLC_E_ICV_ERROR:
- case WLC_E_UNICAST_DECODE_ERROR:
- case WLC_E_MULTICAST_DECODE_ERROR:
+ 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));
break;
- case WLC_E_TXFAIL:
+ case BRCMF_E_TXFAIL:
DHD_EVENT(("MACEVENT: %s, RA %s\n", event_name, eabuf));
break;
- case WLC_E_SCAN_COMPLETE:
- case WLC_E_PMKID_CACHE:
+ case BRCMF_E_SCAN_COMPLETE:
+ case BRCMF_E_PMKID_CACHE:
DHD_EVENT(("MACEVENT: %s\n", event_name));
break;
- case WLC_E_PFN_NET_FOUND:
- case WLC_E_PFN_NET_LOST:
- case WLC_E_PFN_SCAN_COMPLETE:
+ 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));
break;
- case WLC_E_PSK_SUP:
- case WLC_E_PRUNE:
+ case BRCMF_E_PSK_SUP:
+ case BRCMF_E_PRUNE:
DHD_EVENT(("MACEVENT: %s, status %d, reason %d\n",
event_name, (int)status, (int)reason));
break;
- case WLC_E_TRACE:
+ case BRCMF_E_TRACE:
{
static u32 seqnum_prev;
struct msgtrace_hdr hdr;
@@ -799,7 +799,7 @@ static void brcmf_c_show_host_event(wl_event_msg_t *event, void *event_data)
}
break;
- case WLC_E_RSSI:
+ case BRCMF_E_RSSI:
DHD_EVENT(("MACEVENT: %s %d\n", event_name,
be32_to_cpu(*((int *)event_data))));
break;
@@ -824,22 +824,22 @@ static void brcmf_c_show_host_event(wl_event_msg_t *event, void *event_data)
int
brcmf_c_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
- wl_event_msg_t *event, void **data_ptr)
+ brcmf_event_msg_t *event, void **data_ptr)
{
/* check whether packet is a BRCM event pkt */
- bcm_event_t *pvt_data = (bcm_event_t *) pktdata;
+ brcmf_event_t *pvt_data = (brcmf_event_t *) pktdata;
char *event_data;
u32 type, status;
u16 flags;
int evlen;
- if (memcmp(BRCM_OUI, &pvt_data->bcm_hdr.oui[0], DOT11_OUI_LEN)) {
+ if (memcmp(BRCM_OUI, &pvt_data->hdr.oui[0], DOT11_OUI_LEN)) {
DHD_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->bcm_hdr.usr_subtype) !=
+ if (get_unaligned_be16(&pvt_data->hdr.usr_subtype) !=
BCMILCP_BCM_SUBTYPE_EVENT) {
DHD_ERROR(("%s: mismatched subtype, bailing\n", __func__));
return -EBADE;
@@ -849,22 +849,22 @@ brcmf_c_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
event_data = *data_ptr;
/* memcpy since BRCM event pkt may be unaligned. */
- memcpy(event, &pvt_data->event, sizeof(wl_event_msg_t));
+ memcpy(event, &pvt_data->msg, sizeof(brcmf_event_msg_t));
type = get_unaligned_be32(&event->event_type);
flags = get_unaligned_be16(&event->flags);
status = get_unaligned_be32(&event->status);
- evlen = get_unaligned_be32(&event->datalen) + sizeof(bcm_event_t);
+ evlen = get_unaligned_be32(&event->datalen) + sizeof(brcmf_event_t);
switch (type) {
- case WLC_E_IF:
+ case BRCMF_E_IF:
{
dhd_if_event_t *ifevent = (dhd_if_event_t *) event_data;
DHD_TRACE(("%s: if event\n", __func__));
if (ifevent->ifidx > 0 &&
ifevent->ifidx < DHD_MAX_IFS) {
- if (ifevent->action == WLC_E_IF_ADD)
+ if (ifevent->action == BRCMF_E_IF_ADD)
dhd_add_if(dhd, ifevent->ifidx,
NULL, event->ifname,
pvt_data->eth.h_dest,
@@ -885,16 +885,16 @@ brcmf_c_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
break;
#ifdef P2P
- case WLC_E_NDIS_LINK:
+ case BRCMF_E_NDIS_LINK:
break;
#endif
/* fall through */
/* These are what external supplicant/authenticator wants */
- case WLC_E_LINK:
- case WLC_E_ASSOC_IND:
- case WLC_E_REASSOC_IND:
- case WLC_E_DISASSOC_IND:
- case WLC_E_MIC_ERROR:
+ case BRCMF_E_LINK:
+ case BRCMF_E_ASSOC_IND:
+ case BRCMF_E_REASSOC_IND:
+ case BRCMF_E_DISASSOC_IND:
+ case BRCMF_E_MIC_ERROR:
default:
/* Fall through: this should get _everything_ */
@@ -904,16 +904,16 @@ brcmf_c_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
DHD_TRACE(("%s: MAC event %d, flags %x, status %x\n",
__func__, type, flags, status));
- /* put it back to WLC_E_NDIS_LINK */
- if (type == WLC_E_NDIS_LINK) {
+ /* 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));
- temp = be32_to_cpu(WLC_E_NDIS_LINK);
- memcpy((void *)(&pvt_data->event.event_type), &temp,
- sizeof(pvt_data->event.event_type));
+ temp = be32_to_cpu(BRCMF_E_NDIS_LINK);
+ memcpy((void *)(&pvt_data->msg.event_type), &temp,
+ sizeof(pvt_data->msg.event_type));
}
break;
}
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 0ab95b3..c6cae48 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -376,7 +376,7 @@ static int dhd_toe_set(dhd_info_t *dhd, int idx, u32 toe_ol);
#endif /* TOE */
static int dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
- wl_event_msg_t *event_ptr, void **data_ptr);
+ brcmf_event_msg_t *event_ptr, void **data_ptr);
static void dhd_set_packet_filter(int value, dhd_pub_t *dhd)
{
@@ -791,10 +791,10 @@ static void dhd_op_if(dhd_if_t *ifp)
DHD_TRACE(("%s: idx %d, state %d\n", __func__, ifp->idx, ifp->state));
switch (ifp->state) {
- case WLC_E_IF_ADD:
+ case BRCMF_E_IF_ADD:
/*
* Delete the existing interface before overwriting it
- * in case we missed the WLC_E_IF_DEL event.
+ * in case we missed the BRCMF_E_IF_DEL event.
*/
if (ifp->net != NULL) {
DHD_ERROR(("%s: ERROR: netdev:%s already exists, "
@@ -839,7 +839,7 @@ static void dhd_op_if(dhd_if_t *ifp)
}
}
break;
- case WLC_E_IF_DEL:
+ case BRCMF_E_IF_DEL:
if (ifp->net != NULL) {
DHD_TRACE(("\n%s: got 'WLC_E_IF_DEL' state\n",
__func__));
@@ -1100,7 +1100,7 @@ void dhd_rx_frame(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf,
struct sk_buff *pnext, *save_pktbuf;
int i;
dhd_if_t *ifp;
- wl_event_msg_t event;
+ brcmf_event_msg_t event;
DHD_TRACE(("%s: Enter\n", __func__));
@@ -1773,7 +1773,7 @@ dhd_add_if(dhd_info_t *dhd, int ifidx, void *handle, char *name,
memcpy(&ifp->mac_addr, mac_addr, ETH_ALEN);
if (handle == NULL) {
- ifp->state = WLC_E_IF_ADD;
+ ifp->state = BRCMF_E_IF_ADD;
ifp->idx = ifidx;
ASSERT(dhd->sysioc_tsk);
up(&dhd->sysioc_sem);
@@ -1796,7 +1796,7 @@ void dhd_del_if(dhd_info_t *dhd, int ifidx)
return;
}
- ifp->state = WLC_E_IF_DEL;
+ ifp->state = BRCMF_E_IF_DEL;
ifp->idx = ifidx;
ASSERT(dhd->sysioc_tsk);
up(&dhd->sysioc_sem);
@@ -2027,26 +2027,26 @@ int dhd_bus_start(dhd_pub_t *dhdp)
dhdcdc_query_ioctl(dhdp, 0, BRCMF_C_GET_VAR, iovbuf, sizeof(iovbuf));
memcpy(dhdp->eventmask, iovbuf, WL_EVENTING_MASK_LEN);
- setbit(dhdp->eventmask, WLC_E_SET_SSID);
- setbit(dhdp->eventmask, WLC_E_PRUNE);
- setbit(dhdp->eventmask, WLC_E_AUTH);
- setbit(dhdp->eventmask, WLC_E_REASSOC);
- setbit(dhdp->eventmask, WLC_E_REASSOC_IND);
- setbit(dhdp->eventmask, WLC_E_DEAUTH_IND);
- setbit(dhdp->eventmask, WLC_E_DISASSOC_IND);
- setbit(dhdp->eventmask, WLC_E_DISASSOC);
- setbit(dhdp->eventmask, WLC_E_JOIN);
- setbit(dhdp->eventmask, WLC_E_ASSOC_IND);
- setbit(dhdp->eventmask, WLC_E_PSK_SUP);
- setbit(dhdp->eventmask, WLC_E_LINK);
- setbit(dhdp->eventmask, WLC_E_NDIS_LINK);
- setbit(dhdp->eventmask, WLC_E_MIC_ERROR);
- setbit(dhdp->eventmask, WLC_E_PMKID_CACHE);
- setbit(dhdp->eventmask, WLC_E_TXFAIL);
- setbit(dhdp->eventmask, WLC_E_JOIN_START);
- setbit(dhdp->eventmask, WLC_E_SCAN_COMPLETE);
+ setbit(dhdp->eventmask, BRCMF_E_SET_SSID);
+ setbit(dhdp->eventmask, BRCMF_E_PRUNE);
+ setbit(dhdp->eventmask, BRCMF_E_AUTH);
+ setbit(dhdp->eventmask, BRCMF_E_REASSOC);
+ setbit(dhdp->eventmask, BRCMF_E_REASSOC_IND);
+ setbit(dhdp->eventmask, BRCMF_E_DEAUTH_IND);
+ setbit(dhdp->eventmask, BRCMF_E_DISASSOC_IND);
+ setbit(dhdp->eventmask, BRCMF_E_DISASSOC);
+ setbit(dhdp->eventmask, BRCMF_E_JOIN);
+ setbit(dhdp->eventmask, BRCMF_E_ASSOC_IND);
+ setbit(dhdp->eventmask, BRCMF_E_PSK_SUP);
+ setbit(dhdp->eventmask, BRCMF_E_LINK);
+ setbit(dhdp->eventmask, BRCMF_E_NDIS_LINK);
+ setbit(dhdp->eventmask, BRCMF_E_MIC_ERROR);
+ setbit(dhdp->eventmask, BRCMF_E_PMKID_CACHE);
+ setbit(dhdp->eventmask, BRCMF_E_TXFAIL);
+ setbit(dhdp->eventmask, BRCMF_E_JOIN_START);
+ setbit(dhdp->eventmask, BRCMF_E_SCAN_COMPLETE);
#ifdef PNO_SUPPORT
- setbit(dhdp->eventmask, WLC_E_PFN_NET_FOUND);
+ setbit(dhdp->eventmask, BRCMF_E_PFN_NET_FOUND);
#endif /* PNO_SUPPORT */
/* enable dongle roaming event */
@@ -2501,7 +2501,7 @@ void dhd_os_sdunlock(dhd_pub_t *pub)
static int
dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
- wl_event_msg_t *event, void **data)
+ brcmf_event_msg_t *event, void **data)
{
int bcmerror = 0;
@@ -2520,7 +2520,7 @@ dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
}
/* send up locally generated event */
-void dhd_sendup_event(dhd_pub_t *dhdp, wl_event_msg_t *event, void *data)
+void dhd_sendup_event(dhd_pub_t *dhdp, brcmf_event_msg_t *event, void *data)
{
switch (be32_to_cpu(event->event_type)) {
default:
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index ee751a0..b30ae73 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -123,24 +123,24 @@ static void wl_init_eq_lock(struct wl_priv *wl);
static void wl_init_eloop_handler(struct wl_event_loop *el);
static struct wl_event_q *wl_deq_event(struct wl_priv *wl);
static s32 wl_enq_event(struct wl_priv *wl, u32 type,
- const wl_event_msg_t *msg, void *data);
+ const brcmf_event_msg_t *msg, void *data);
static void wl_put_event(struct wl_event_q *e);
static void wl_wakeup_event(struct wl_priv *wl);
static s32 wl_notify_connect_status(struct wl_priv *wl,
struct net_device *ndev,
- const wl_event_msg_t *e, void *data);
+ const brcmf_event_msg_t *e, void *data);
static s32 wl_notify_roaming_status(struct wl_priv *wl,
struct net_device *ndev,
- const wl_event_msg_t *e, void *data);
+ const brcmf_event_msg_t *e, void *data);
static s32 wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
- const wl_event_msg_t *e, void *data);
+ const brcmf_event_msg_t *e, void *data);
static s32 wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
- const wl_event_msg_t *e, void *data,
+ const brcmf_event_msg_t *e, void *data,
bool completed);
static s32 wl_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
- const wl_event_msg_t *e, void *data);
+ const brcmf_event_msg_t *e, void *data);
static s32 wl_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
- const wl_event_msg_t *e, void *data);
+ const brcmf_event_msg_t *e, void *data);
/*
** register/deregister sdio function
@@ -171,7 +171,7 @@ static s32 wl_set_retry(struct net_device *dev, u32 retry, bool l);
/*
** wl profile utilities
*/
-static s32 wl_update_prof(struct wl_priv *wl, const wl_event_msg_t *e,
+static s32 wl_update_prof(struct wl_priv *wl, const brcmf_event_msg_t *e,
void *data, s32 item);
static void *wl_read_prof(struct wl_priv *wl, s32 item);
static void wl_init_prof(struct wl_profile *prof);
@@ -237,9 +237,9 @@ static bool wl_is_ibssmode(struct wl_priv *wl);
/*
** dongle up/down , default configuration utilities
*/
-static bool wl_is_linkdown(struct wl_priv *wl, const wl_event_msg_t *e);
-static bool wl_is_linkup(struct wl_priv *wl, const wl_event_msg_t *e);
-static bool wl_is_nonetwork(struct wl_priv *wl, const wl_event_msg_t *e);
+static bool wl_is_linkdown(struct wl_priv *wl, const brcmf_event_msg_t *e);
+static bool wl_is_linkup(struct wl_priv *wl, const brcmf_event_msg_t *e);
+static bool wl_is_nonetwork(struct wl_priv *wl, const brcmf_event_msg_t *e);
static void wl_link_down(struct wl_priv *wl);
static s32 wl_dongle_mode(struct net_device *ndev, s32 iftype);
static s32 __wl_cfg80211_up(struct wl_priv *wl);
@@ -2569,12 +2569,12 @@ CleanUp:
return err;
}
-static bool wl_is_linkup(struct wl_priv *wl, const wl_event_msg_t *e)
+static bool wl_is_linkup(struct wl_priv *wl, const brcmf_event_msg_t *e)
{
u32 event = be32_to_cpu(e->event_type);
u32 status = be32_to_cpu(e->status);
- if (event == WLC_E_SET_SSID && status == WLC_E_STATUS_SUCCESS) {
+ if (event == BRCMF_E_SET_SSID && status == BRCMF_E_STATUS_SUCCESS) {
WL_CONN("Processing set ssid\n");
wl->link_up = true;
return true;
@@ -2583,31 +2583,31 @@ static bool wl_is_linkup(struct wl_priv *wl, const wl_event_msg_t *e)
return false;
}
-static bool wl_is_linkdown(struct wl_priv *wl, const wl_event_msg_t *e)
+static bool wl_is_linkdown(struct wl_priv *wl, const brcmf_event_msg_t *e)
{
u32 event = be32_to_cpu(e->event_type);
u16 flags = be16_to_cpu(e->flags);
- if (event == WLC_E_LINK && (!(flags & WLC_EVENT_MSG_LINK))) {
+ if (event == BRCMF_E_LINK && (!(flags & BRCMF_EVENT_MSG_LINK))) {
WL_CONN("Processing link down\n");
return true;
}
return false;
}
-static bool wl_is_nonetwork(struct wl_priv *wl, const wl_event_msg_t *e)
+static bool wl_is_nonetwork(struct wl_priv *wl, const brcmf_event_msg_t *e)
{
u32 event = be32_to_cpu(e->event_type);
u32 status = be32_to_cpu(e->status);
- if (event == WLC_E_LINK && status == WLC_E_STATUS_NO_NETWORKS) {
+ if (event == BRCMF_E_LINK && status == BRCMF_E_STATUS_NO_NETWORKS) {
WL_CONN("Processing Link %s & no network found\n",
- be16_to_cpu(e->flags) & WLC_EVENT_MSG_LINK ?
+ be16_to_cpu(e->flags) & BRCMF_EVENT_MSG_LINK ?
"up" : "down");
return true;
}
- if (event == WLC_E_SET_SSID && status != WLC_E_STATUS_SUCCESS) {
+ if (event == BRCMF_E_SET_SSID && status != BRCMF_E_STATUS_SUCCESS) {
WL_CONN("Processing connecting & no network found\n");
return true;
}
@@ -2617,7 +2617,7 @@ static bool wl_is_nonetwork(struct wl_priv *wl, const wl_event_msg_t *e)
static s32
wl_notify_connect_status(struct wl_priv *wl, struct net_device *ndev,
- const wl_event_msg_t *e, void *data)
+ const brcmf_event_msg_t *e, void *data)
{
s32 err = 0;
@@ -2661,13 +2661,13 @@ wl_notify_connect_status(struct wl_priv *wl, struct net_device *ndev,
static s32
wl_notify_roaming_status(struct wl_priv *wl, struct net_device *ndev,
- const wl_event_msg_t *e, void *data)
+ const brcmf_event_msg_t *e, void *data)
{
s32 err = 0;
u32 event = be32_to_cpu(e->event_type);
u32 status = be32_to_cpu(e->status);
- if (event == WLC_E_ROAM && status == WLC_E_STATUS_SUCCESS) {
+ if (event == BRCMF_E_ROAM && status == BRCMF_E_STATUS_SUCCESS) {
if (test_bit(WL_STATUS_CONNECTED, &wl->status))
wl_bss_roaming_done(wl, ndev, e, data);
else
@@ -2873,7 +2873,7 @@ update_bss_info_out:
static s32
wl_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
- const wl_event_msg_t *e, void *data)
+ const brcmf_event_msg_t *e, void *data)
{
struct wl_connect_info *conn_info = wl_to_conn(wl);
s32 err = 0;
@@ -2897,7 +2897,7 @@ wl_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
static s32
wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
- const wl_event_msg_t *e, void *data, bool completed)
+ const brcmf_event_msg_t *e, void *data, bool completed)
{
struct wl_connect_info *conn_info = wl_to_conn(wl);
s32 err = 0;
@@ -2929,13 +2929,13 @@ wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
static s32
wl_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
- const wl_event_msg_t *e, void *data)
+ const brcmf_event_msg_t *e, void *data)
{
u16 flags = be16_to_cpu(e->flags);
enum nl80211_key_type key_type;
rtnl_lock();
- if (flags & WLC_EVENT_MSG_GROUP)
+ if (flags & BRCMF_EVENT_MSG_GROUP)
key_type = NL80211_KEYTYPE_GROUP;
else
key_type = NL80211_KEYTYPE_PAIRWISE;
@@ -2949,7 +2949,7 @@ wl_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
static s32
wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
- const wl_event_msg_t *e, void *data)
+ const brcmf_event_msg_t *e, void *data)
{
struct channel_info channel_inform;
struct wl_scan_results *bss_list;
@@ -3037,11 +3037,11 @@ static void wl_init_prof(struct wl_profile *prof)
static void wl_init_eloop_handler(struct wl_event_loop *el)
{
memset(el, 0, sizeof(*el));
- el->handler[WLC_E_SCAN_COMPLETE] = wl_notify_scan_status;
- el->handler[WLC_E_LINK] = wl_notify_connect_status;
- el->handler[WLC_E_ROAM] = wl_notify_roaming_status;
- el->handler[WLC_E_MIC_ERROR] = wl_notify_mic_status;
- el->handler[WLC_E_SET_SSID] = wl_notify_connect_status;
+ el->handler[BRCMF_E_SCAN_COMPLETE] = wl_notify_scan_status;
+ el->handler[BRCMF_E_LINK] = wl_notify_connect_status;
+ el->handler[BRCMF_E_ROAM] = wl_notify_roaming_status;
+ el->handler[BRCMF_E_MIC_ERROR] = wl_notify_mic_status;
+ el->handler[BRCMF_E_SET_SSID] = wl_notify_connect_status;
}
static s32 wl_init_priv_mem(struct wl_priv *wl)
@@ -3530,7 +3530,8 @@ static s32 wl_event_handler(void *data)
}
void
-wl_cfg80211_event(struct net_device *ndev, const wl_event_msg_t * e, void *data)
+wl_cfg80211_event(struct net_device *ndev,
+ const brcmf_event_msg_t *e, void *data)
{
u32 event_type = be32_to_cpu(e->event_type);
struct wl_priv *wl = ndev_to_wl(ndev);
@@ -3581,7 +3582,7 @@ static struct wl_event_q *wl_deq_event(struct wl_priv *wl)
*/
static s32
-wl_enq_event(struct wl_priv *wl, u32 event, const wl_event_msg_t *msg,
+wl_enq_event(struct wl_priv *wl, u32 event, const brcmf_event_msg_t *msg,
void *data)
{
struct wl_event_q *e;
@@ -3594,7 +3595,7 @@ wl_enq_event(struct wl_priv *wl, u32 event, const wl_event_msg_t *msg,
}
e->etype = event;
- memcpy(&e->emsg, msg, sizeof(wl_event_msg_t));
+ memcpy(&e->emsg, msg, sizeof(brcmf_event_msg_t));
if (data) {
}
wl_lock_eq(wl);
@@ -3882,25 +3883,25 @@ static s32 wl_dongle_eventmsg(struct net_device *ndev)
}
memcpy(eventmask, iovbuf, WL_EVENTING_MASK_LEN);
- setbit(eventmask, WLC_E_SET_SSID);
- setbit(eventmask, WLC_E_ROAM);
- setbit(eventmask, WLC_E_PRUNE);
- setbit(eventmask, WLC_E_AUTH);
- setbit(eventmask, WLC_E_REASSOC);
- setbit(eventmask, WLC_E_REASSOC_IND);
- setbit(eventmask, WLC_E_DEAUTH_IND);
- setbit(eventmask, WLC_E_DISASSOC_IND);
- setbit(eventmask, WLC_E_DISASSOC);
- setbit(eventmask, WLC_E_JOIN);
- setbit(eventmask, WLC_E_ASSOC_IND);
- setbit(eventmask, WLC_E_PSK_SUP);
- setbit(eventmask, WLC_E_LINK);
- setbit(eventmask, WLC_E_NDIS_LINK);
- setbit(eventmask, WLC_E_MIC_ERROR);
- setbit(eventmask, WLC_E_PMKID_CACHE);
- setbit(eventmask, WLC_E_TXFAIL);
- setbit(eventmask, WLC_E_JOIN_START);
- setbit(eventmask, WLC_E_SCAN_COMPLETE);
+ setbit(eventmask, BRCMF_E_SET_SSID);
+ setbit(eventmask, BRCMF_E_ROAM);
+ setbit(eventmask, BRCMF_E_PRUNE);
+ setbit(eventmask, BRCMF_E_AUTH);
+ setbit(eventmask, BRCMF_E_REASSOC);
+ setbit(eventmask, BRCMF_E_REASSOC_IND);
+ setbit(eventmask, BRCMF_E_DEAUTH_IND);
+ setbit(eventmask, BRCMF_E_DISASSOC_IND);
+ setbit(eventmask, BRCMF_E_DISASSOC);
+ setbit(eventmask, BRCMF_E_JOIN);
+ setbit(eventmask, BRCMF_E_ASSOC_IND);
+ setbit(eventmask, BRCMF_E_PSK_SUP);
+ setbit(eventmask, BRCMF_E_LINK);
+ setbit(eventmask, BRCMF_E_NDIS_LINK);
+ setbit(eventmask, BRCMF_E_MIC_ERROR);
+ setbit(eventmask, BRCMF_E_PMKID_CACHE);
+ setbit(eventmask, BRCMF_E_TXFAIL);
+ setbit(eventmask, BRCMF_E_JOIN_START);
+ setbit(eventmask, BRCMF_E_SCAN_COMPLETE);
brcmu_mkiovar("event_msgs", eventmask, WL_EVENTING_MASK_LEN, iovbuf,
sizeof(iovbuf));
@@ -4200,7 +4201,7 @@ static void *wl_read_prof(struct wl_priv *wl, s32 item)
}
static s32
-wl_update_prof(struct wl_priv *wl, const wl_event_msg_t *e, void *data,
+wl_update_prof(struct wl_priv *wl, const brcmf_event_msg_t *e, void *data,
s32 item)
{
s32 err = 0;
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
index 3b0c8ae..77d0559 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
@@ -188,9 +188,9 @@ struct wl_conf {
/* cfg80211 main event loop */
struct wl_event_loop {
- s32(*handler[WLC_E_LAST]) (struct wl_priv *wl,
+ s32(*handler[BRCMF_E_LAST]) (struct wl_priv *wl,
struct net_device *ndev,
- const wl_event_msg_t *e, void *data);
+ const brcmf_event_msg_t *e, void *data);
};
/* representing interface of cfg80211 plane */
@@ -226,7 +226,7 @@ struct wl_ie {
struct wl_event_q {
struct list_head eq_list;
u32 etype;
- wl_event_msg_t emsg;
+ brcmf_event_msg_t emsg;
s8 edata[1];
};
@@ -387,8 +387,8 @@ static inline struct wl_bss_info *next_bss(struct wl_scan_results *list,
extern s32 wl_cfg80211_attach(struct net_device *ndev, void *data);
extern void wl_cfg80211_detach(void);
/* event handler from dongle */
-extern void wl_cfg80211_event(struct net_device *ndev, const wl_event_msg_t *e,
- void *data);
+extern void wl_cfg80211_event(struct net_device *ndev,
+ const brcmf_event_msg_t *e, void *data);
extern void wl_cfg80211_sdio_func(void *func); /* set sdio function info */
extern struct sdio_func *wl_cfg80211_get_sdio_func(void); /* set sdio function info */
extern s32 wl_cfg80211_up(void); /* dongle up */
--
1.7.1
Unused sdtx lock functions are removed from dhd_linux.c
Signed-off-by: Franky Lin <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 2 --
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 10 ----------
2 files changed, 0 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 1fc5202..4d92d69 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -988,8 +988,6 @@ extern int write_to_file(dhd_pub_t *dhd, u8 *buf, int size);
#if defined(OOB_INTR_ONLY)
extern int dhd_customer_oob_irq_map(unsigned long *irq_flags_ptr);
#endif /* defined(OOB_INTR_ONLY) */
-extern void dhd_os_sdtxlock(dhd_pub_t *pub);
-extern void dhd_os_sdtxunlock(dhd_pub_t *pub);
int setScheduler(struct task_struct *p, int policy, struct sched_param *param);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 9c9b8ba..d7f7449 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -2603,16 +2603,6 @@ void dhd_os_sdunlock_rxq(dhd_pub_t *pub)
{
}
-void dhd_os_sdtxlock(dhd_pub_t *pub)
-{
- dhd_os_sdlock(pub);
-}
-
-void dhd_os_sdtxunlock(dhd_pub_t *pub)
-{
- dhd_os_sdunlock(pub);
-}
-
static int
dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
wl_event_msg_t *event, void **data)
--
1.7.1
On 06/30/2011 01:16 PM, Luciano Coelho wrote:
> Hi Henry,
>
> On Thu, 2011-06-30 at 10:42 -0700, Henry Ptasinski wrote:
>> On 06/29/2011 11:29 PM, Rafał Miłecki wrote:
>>> 2011/6/30 Franky Lin<[email protected]>:
>>>> Most of these patches are brcmfmac cleanup.
>>>
>>>
>>> Hm, interesting improvement in your "Release early, release often" strategy.
>>>
>>
>> Yea, we were waiting for the previous series to get applied. Not sure
>> how to make this work better. Any process suggestions would be appreciated.
>
> Keep sending them in small batches, I think it is just normal to apply
> the batches one after the other, no need to keep waiting. If there are
> no conflicts, everything should go smoothly. And if it doesn't, someone
> will ping you. ;)
>
That's what we had been doing, but along the way a patch or two got
dropped and that caused a train wreck.
We were hoping that switching to a more batch-oriented mode would help,
but obviously that approach has it's own problems.
- Henry
From: Roland Vossen <[email protected]>
Code cleanup. Contents merged into other files.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h | 6 +++
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 1 -
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h | 10 +++++
.../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c | 1 -
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 1 -
drivers/staging/brcm80211/brcmfmac/sdiovar.h | 38 --------------------
6 files changed, 16 insertions(+), 41 deletions(-)
delete mode 100644 drivers/staging/brcm80211/brcmfmac/sdiovar.h
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
index 761ec20..3ba3c3f 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
@@ -32,6 +32,12 @@
#define SDIOH_DATA_PIO 0 /* PIO mode */
#define SDIOH_DATA_DMA 1 /* DMA mode */
+struct brcmf_sdreg {
+ int func;
+ int offset;
+ int value;
+};
+
/* callback function, taking one arg */
typedef void (*sdioh_cb_fn_t) (void *);
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 7da200f..7bc9d02 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -28,7 +28,6 @@
#include <brcmu_wifi.h>
#include "sdio_host.h"
#include "bcmsdbus.h"
-#include "sdiovar.h" /* ioctl/iovars */
#include "dngl_stats.h"
#include "dhd.h"
#include "bcmsdh_sdmmc.h"
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
index 5eb4c65..962fa4b 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
@@ -21,6 +21,16 @@
#ifndef __BCMSDH_SDMMC_H__
#define __BCMSDH_SDMMC_H__
+/* Common msglevel constants */
+#define SDH_ERROR_VAL 0x0001 /* Error */
+#define SDH_TRACE_VAL 0x0002 /* Trace */
+#define SDH_INFO_VAL 0x0004 /* Info */
+#define SDH_DEBUG_VAL 0x0008 /* Debug */
+#define SDH_DATA_VAL 0x0010 /* Data */
+#define SDH_CTRL_VAL 0x0020 /* Control Regs */
+#define SDH_LOG_VAL 0x0040 /* Enable bcmlog */
+#define SDH_DMA_VAL 0x0080 /* DMA */
+
#ifdef BCMDBG
#define sd_err(x) \
do { \
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
index 9d00c49..b8ab242 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
@@ -28,7 +28,6 @@
#include <brcmu_wifi.h>
#include "sdio_host.h"
#include "bcmsdbus.h"
-#include "sdiovar.h" /* to get msglevel bit values */
#include "dngl_stats.h"
#include "dhd.h"
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 4b0352f..6a53ac8 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -176,7 +176,6 @@ struct rte_console {
#include "dhd_bus.h"
#include "dhd_proto.h"
#include "dhd_dbg.h"
-#include <sdiovar.h>
#include <bcmchip.h>
#ifndef DHDSDIO_MEM_DUMP_FNAME
diff --git a/drivers/staging/brcm80211/brcmfmac/sdiovar.h b/drivers/staging/brcm80211/brcmfmac/sdiovar.h
deleted file mode 100644
index 35e913b..0000000
--- a/drivers/staging/brcm80211/brcmfmac/sdiovar.h
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * Copyright (c) 2010 Broadcom Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _sdiovar_h_
-#define _sdiovar_h_
-
-struct brcmf_sdreg {
- int func;
- int offset;
- int value;
-};
-
-/* Common msglevel constants */
-#define SDH_ERROR_VAL 0x0001 /* Error */
-#define SDH_TRACE_VAL 0x0002 /* Trace */
-#define SDH_INFO_VAL 0x0004 /* Info */
-#define SDH_DEBUG_VAL 0x0008 /* Debug */
-#define SDH_DATA_VAL 0x0010 /* Data */
-#define SDH_CTRL_VAL 0x0020 /* Control Regs */
-#define SDH_LOG_VAL 0x0040 /* Enable bcmlog */
-#define SDH_DMA_VAL 0x0080 /* DMA */
-
-#define NUM_PREV_TRANSACTIONS 16
-
-#endif /* _sdiovar_h_ */
--
1.7.1
From: Roland Vossen <[email protected]>
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 25 ++-----------------------
1 files changed, 2 insertions(+), 23 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index ba57481..5e079b0 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -65,11 +65,6 @@
/* Trap types defined by ARM (see arminc.h) */
-/* Trap locations in lo memory */
-#define TRAP_STRIDE 4
-#define FIRST_TRAP TR_RST
-#define LAST_TRAP (TR_FIQ * TRAP_STRIDE)
-
#if defined(__ARM_ARCH_4T__)
#define MAX_TRAP_TYPE (TR_FIQ + 1)
#elif defined(__ARM_ARCH_7M__)
@@ -114,8 +109,6 @@ struct brcmf_trap {
#define CBUF_LEN (128)
-#define LOG_BUF_LEN 1024
-
struct rte_log {
u32 buf; /* Can't be pointer on (64-bit) hosts */
uint buf_size;
@@ -166,10 +159,6 @@ struct rte_console {
#include "dhd_dbg.h"
#include <bcmchip.h>
-#ifndef DHDSDIO_MEM_DUMP_FNAME
-#define DHDSDIO_MEM_DUMP_FNAME "mem_dump"
-#endif
-
#define TXQLEN 2048 /* bulk tx queue length */
#define TXHI (TXQLEN - 256) /* turn on flow control above TXHI */
#define TXLOW (TXHI - 256) /* turn off flow control below TXLOW */
@@ -344,7 +333,6 @@ struct rte_console {
/* Value for ChipClockCSR during initial setup */
#define DHD_INIT_CLKCTL1 (SBSDIO_FORCE_HW_CLKREQ_OFF | \
SBSDIO_ALP_AVAIL_REQ)
-#define DHD_INIT_CLKCTL2 (SBSDIO_FORCE_HW_CLKREQ_OFF | SBSDIO_FORCE_ALP)
/* Flags for SDH calls */
#define F2SYNC (SDIO_REQ_4BYTE | SDIO_REQ_FIXED)
@@ -541,11 +529,7 @@ struct brcmf_bus {
struct chip_info *ci; /* Chip info struct */
char *vars; /* Variables (from CIS and/or other) */
uint varsz; /* Size of variables buffer */
- u32 sbaddr; /* Current SB window pointer (-1, invalid) */
- uint sdpcmrev; /* SDIO core revision */
- uint armrev; /* CPU core revision */
- uint ramrev; /* SOCRAM core revision */
u32 ramsize; /* Size of RAM in SOCRAM (bytes) */
u32 orig_ramsize; /* Size of RAM in SOCRAM (bytes) */
@@ -612,8 +596,6 @@ struct brcmf_bus {
bool sleeping; /* Is SDIO bus sleeping? */
bool rxflow_mode; /* Rx flow control mode */
bool rxflow; /* Is rx flow control on */
- uint prev_rxlim_hit; /* Is prev rx limit exceeded
- (per dpc schedule) */
bool alp_only; /* Don't use HT clock (ALP only) */
/* Field to decide if rx of control frames happen in rxbuf or lb-pool */
bool usebufpool;
@@ -782,8 +764,6 @@ static bool retrydata;
static const uint watermark = 8;
static const uint firstread = BRCMF_FIRSTREAD;
-#define HDATLEN (firstread - (SDPCM_HDRLEN))
-
/* Retry count for register access failures */
static const uint retry_limit = 2;
@@ -5584,8 +5564,8 @@ brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, void *card, u32 regsva,
/* Get info on the ARM and SOCRAM cores... */
if (!DHD_NOPMU(bus)) {
- bus->armrev = SBCOREREV(brcmf_sdcard_reg_read(bus->card,
- CORE_SB(bus->ci->armcorebase, sbidhigh), 4));
+ brcmf_sdcard_reg_read(bus->card,
+ CORE_SB(bus->ci->armcorebase, sbidhigh), 4);
bus->orig_ramsize = bus->ci->ramsize;
if (!(bus->orig_ramsize)) {
DHD_ERROR(("%s: failed to find SOCRAM memory!\n",
@@ -5680,7 +5660,6 @@ static bool brcmf_sdbrcm_probe_init(struct brcmf_bus *bus, void *card)
bus->drvr->busstate = DHD_BUS_DOWN;
bus->sleeping = false;
bus->rxflow = false;
- bus->prev_rxlim_hit = 0;
/* Done with backplane-dependent accesses, can drop clock... */
brcmf_sdcard_cfg_write(card, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, 0,
--
1.7.1
From: Roland Vossen <[email protected]>
AP advertizes max AMPDU rx length in beacon/probe response frame. Code now
uses this information to limit the length of AMPDU frames it transmits.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/ampdu.c | 25 ++++++++-------------
drivers/staging/brcm80211/brcmsmac/mac80211_if.c | 7 ++++-
drivers/staging/brcm80211/brcmsmac/pub.h | 2 +-
drivers/staging/brcm80211/brcmsmac/scb.h | 2 +-
4 files changed, 17 insertions(+), 19 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/ampdu.c b/drivers/staging/brcm80211/brcmsmac/ampdu.c
index e9b78bf..6271ad1 100644
--- a/drivers/staging/brcm80211/brcmsmac/ampdu.c
+++ b/drivers/staging/brcm80211/brcmsmac/ampdu.c
@@ -220,9 +220,9 @@ static void brcms_c_scb_ampdu_update_config(struct ampdu_info *ampdu,
scb_ampdu->release = min_t(u8, scb_ampdu->max_pdu, AMPDU_SCB_MAX_RELEASE);
- if (scb_ampdu->max_rxlen)
- scb_ampdu->release =
- min_t(u8, scb_ampdu->release, scb_ampdu->max_rxlen / 1600);
+ if (scb_ampdu->max_rx_ampdu_bytes)
+ scb_ampdu->release = min_t(u8, scb_ampdu->release,
+ scb_ampdu->max_rx_ampdu_bytes / 1600);
scb_ampdu->release = min(scb_ampdu->release,
ampdu->fifo_tb[TX_AC_BE_FIFO].
@@ -410,7 +410,8 @@ static void brcms_c_ffpld_calc_mcs2ampdu_table(struct ampdu_info *ampdu, int f)
void
brcms_c_ampdu_tx_operational(struct brcms_c_info *wlc, u8 tid,
- u8 ba_wsize) /* negotiated ba window size (in pdu) */
+ u8 ba_wsize, /* negotiated ba window size (in pdu) */
+ uint max_rx_ampdu_bytes) /* from ht_cap in beacon */
{
scb_ampdu_t *scb_ampdu;
scb_ampdu_tid_ini_t *ini;
@@ -428,6 +429,7 @@ brcms_c_ampdu_tx_operational(struct brcms_c_info *wlc, u8 tid,
ini->tid = tid;
ini->scb = scb_ampdu->scb;
ini->ba_wsize = ba_wsize;
+ scb_ampdu->max_rx_ampdu_bytes = max_rx_ampdu_bytes;
}
int
@@ -446,7 +448,7 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_c_txq_info *qi,
bool rr = true, fbr = false;
uint i, count = 0, fifo, seg_cnt = 0;
u16 plen, len, seq = 0, mcl, mch, index, frameid, dma_len = 0;
- u32 ampdu_len, maxlen = 0;
+ u32 ampdu_len, max_ampdu_bytes = 0;
d11txh_t *txh = NULL;
u8 *plcp;
struct ieee80211_hdr *h;
@@ -611,15 +613,10 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_c_txq_info *qi,
is40 = (plcp0 & MIMO_PLCP_40MHZ) ? 1 : 0;
sgi = PLCP3_ISSGI(plcp3) ? 1 : 0;
mcs = plcp0 & ~MIMO_PLCP_40MHZ;
- maxlen =
- min(scb_ampdu->max_rxlen,
+ max_ampdu_bytes =
+ min(scb_ampdu->max_rx_ampdu_bytes,
ampdu->max_txlen[mcs][is40][sgi]);
- /* XXX Fix me to honor real max_rxlen */
- /* can fix this as soon as ampdu_action() in mac80211.h
- * gets extra u8buf_size par */
- maxlen = 64 * 1024;
-
if (is40)
mimo_ctlchbw =
CHSPEC_SB_UPPER(WLC_BAND_PI_RADIO_CHANSPEC)
@@ -681,10 +678,8 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_c_txq_info *qi,
AMPDU_MAX_MPDU_OVERHEAD;
plen = max(scb_ampdu->min_len, plen);
- if ((plen + ampdu_len) > maxlen) {
+ if ((plen + ampdu_len) > max_ampdu_bytes) {
p = NULL;
- wiphy_err(wiphy, "%s: Bogus plen #1\n",
- __func__);
continue;
}
diff --git a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
index 547df75..c74c186 100644
--- a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
@@ -659,10 +659,13 @@ brcms_ops_ampdu_action(struct ieee80211_hw *hw,
/*
* BA window size from ADDBA response ('buf_size') defines how
* many outstanding MPDUs are allowed for the BA stream by
- * recipient and traffic class.
+ * recipient and traffic class. 'ampdu_factor' gives maximum
+ * AMPDU size.
*/
LOCK(wl);
- brcms_c_ampdu_tx_operational(wl->wlc, tid, buf_size);
+ brcms_c_ampdu_tx_operational(wl->wlc, tid, buf_size,
+ (1 << (IEEE80211_HT_MAX_AMPDU_FACTOR +
+ sta->ht_cap.ampdu_factor)) - 1);
UNLOCK(wl);
/* Power save wakeup */
break;
diff --git a/drivers/staging/brcm80211/brcmsmac/pub.h b/drivers/staging/brcm80211/brcmsmac/pub.h
index 14c0d20..58ae61d 100644
--- a/drivers/staging/brcm80211/brcmsmac/pub.h
+++ b/drivers/staging/brcm80211/brcmsmac/pub.h
@@ -627,7 +627,7 @@ extern void brcms_default_rateset(struct brcms_c_info *wlc, wlc_rateset_t *rs);
extern void brcms_c_ampdu_flush(struct brcms_c_info *wlc,
struct ieee80211_sta *sta, u16 tid);
extern void brcms_c_ampdu_tx_operational(struct brcms_c_info *wlc, u8 tid,
- u8 ba_wsize);
+ u8 ba_wsize, uint max_rx_ampdu_bytes);
extern int brcms_c_set_par(struct brcms_c_info *wlc, enum wlc_par_id par_id,
int val);
extern int brcms_c_get_par(struct brcms_c_info *wlc, enum wlc_par_id par_id,
diff --git a/drivers/staging/brcm80211/brcmsmac/scb.h b/drivers/staging/brcm80211/brcmsmac/scb.h
index c2080e9..62e005e 100644
--- a/drivers/staging/brcm80211/brcmsmac/scb.h
+++ b/drivers/staging/brcm80211/brcmsmac/scb.h
@@ -40,7 +40,7 @@ struct scb_ampdu {
u8 max_pdu; /* max pdus allowed in ampdu */
u8 release; /* # of mpdus released at a time */
u16 min_len; /* min mpdu len to support the density */
- u32 max_rxlen; /* max ampdu rcv length; 8k, 16k, 32k, 64k */
+ u32 max_rx_ampdu_bytes; /* max ampdu rcv length; 8k, 16k, 32k, 64k */
struct pktq txq; /* sdu transmit queue pending aggregation */
/* This could easily be a ini[] pointer and we keep this info in wl itself instead
--
1.7.1
From: Arend van Spriel <[email protected]>
The custom gpio code is intended for hardware platform for specific
customers and require supporting functionality not included in the
fullmac driver. The fullmac driver does not need this so it has been
removed.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/Makefile | 1 -
.../staging/brcm80211/brcmfmac/dhd_custom_gpio.c | 156 --------------------
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 8 +-
3 files changed, 1 insertions(+), 164 deletions(-)
delete mode 100644 drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c
diff --git a/drivers/staging/brcm80211/brcmfmac/Makefile b/drivers/staging/brcm80211/brcmfmac/Makefile
index f097246..c38fa55 100644
--- a/drivers/staging/brcm80211/brcmfmac/Makefile
+++ b/drivers/staging/brcm80211/brcmfmac/Makefile
@@ -30,7 +30,6 @@ DHDOFILES = \
wl_cfg80211.o \
dhd_cdc.o \
dhd_common.o \
- dhd_custom_gpio.o \
dhd_sdio.o \
dhd_linux.o \
bcmsdh.o \
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c b/drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c
deleted file mode 100644
index 6fd1072..0000000
--- a/drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c
+++ /dev/null
@@ -1,156 +0,0 @@
-/*
- * Copyright (c) 2010 Broadcom Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#include <linux/netdevice.h>
-#include <linux/sched.h>
-#include <brcmu_utils.h>
-#include <defs.h>
-#include <brcmu_wifi.h>
-
-#include "dngl_stats.h"
-#include "dhd.h"
-
-#define WL_ERROR(fmt, args...) printk(fmt, ##args)
-#define WL_TRACE(fmt, args...) no_printk(fmt, ##args)
-
-#ifdef CUSTOMER_HW
-extern void bcm_wlan_power_off(int);
-extern void bcm_wlan_power_on(int);
-#endif /* CUSTOMER_HW */
-#ifdef CUSTOMER_HW2
-int wifi_set_carddetect(int on);
-int wifi_set_power(int on, unsigned long msec);
-int wifi_get_irq_number(unsigned long *irq_flags_ptr);
-#endif
-
-#if defined(OOB_INTR_ONLY)
-
-extern int sdioh_mmc_irq(int irq);
-
-#ifdef CUSTOMER_HW3
-#include <mach/gpio.h>
-#endif
-
-/* Customer specific Host GPIO definition */
-static int dhd_oob_gpio_num = -1; /* GG 19 */
-
-module_param(dhd_oob_gpio_num, int, 0644);
-MODULE_PARM_DESC(dhd_oob_gpio_num, "DHD oob gpio number");
-
-int brcmf_customer_oob_irq_map(unsigned long *irq_flags_ptr)
-{
- int host_oob_irq = 0;
-
-#ifdef CUSTOMER_HW2
- host_oob_irq = wifi_get_irq_number(irq_flags_ptr);
-
-#else /* for NOT CUSTOMER_HW2 */
-#if defined(CUSTOM_OOB_GPIO_NUM)
- if (dhd_oob_gpio_num < 0)
- dhd_oob_gpio_num = CUSTOM_OOB_GPIO_NUM;
-#endif
-
- if (dhd_oob_gpio_num < 0) {
- WL_ERROR("%s: ERROR customer specific Host GPIO is NOT defined\n",
- __func__);
- return dhd_oob_gpio_num;
- }
-
- WL_ERROR("%s: customer specific Host GPIO number is (%d)\n",
- __func__, dhd_oob_gpio_num);
-
-#if defined CUSTOMER_HW
- host_oob_irq = MSM_GPIO_TO_INT(dhd_oob_gpio_num);
-#elif defined CUSTOMER_HW3
- gpio_request(dhd_oob_gpio_num, "oob irq");
- host_oob_irq = gpio_to_irq(dhd_oob_gpio_num);
- gpio_direction_input(dhd_oob_gpio_num);
-#endif /* CUSTOMER_HW */
-#endif /* CUSTOMER_HW2 */
-
- return host_oob_irq;
-}
-#endif /* defined(OOB_INTR_ONLY) */
-
-/* Customer function to control hw specific wlan gpios */
-void brcmf_customer_gpio_wlan_ctrl(int onoff)
-{
- switch (onoff) {
- case WLAN_RESET_OFF:
- WL_TRACE("%s: call customer specific GPIO to insert WLAN RESET\n",
- __func__);
-#ifdef CUSTOMER_HW
- bcm_wlan_power_off(2);
-#endif /* CUSTOMER_HW */
-#ifdef CUSTOMER_HW2
- wifi_set_power(0, 0);
-#endif
- WL_ERROR("=========== WLAN placed in RESET ========\n");
- break;
-
- case WLAN_RESET_ON:
- WL_TRACE("%s: callc customer specific GPIO to remove WLAN RESET\n",
- __func__);
-#ifdef CUSTOMER_HW
- bcm_wlan_power_on(2);
-#endif /* CUSTOMER_HW */
-#ifdef CUSTOMER_HW2
- wifi_set_power(1, 0);
-#endif
- WL_ERROR("=========== WLAN going back to live ========\n");
- break;
-
- case WLAN_POWER_OFF:
- WL_TRACE("%s: call customer specific GPIO to turn off WL_REG_ON\n",
- __func__);
-#ifdef CUSTOMER_HW
- bcm_wlan_power_off(1);
-#endif /* CUSTOMER_HW */
- break;
-
- case WLAN_POWER_ON:
- WL_TRACE("%s: call customer specific GPIO to turn on WL_REG_ON\n",
- __func__);
-#ifdef CUSTOMER_HW
- bcm_wlan_power_on(1);
-#endif /* CUSTOMER_HW */
- /* Lets customer power to get stable */
- udelay(200);
- break;
- }
-}
-
-#ifdef GET_CUSTOM_MAC_ENABLE
-/* Function to get custom MAC address */
-int brcmf_custom_get_mac_address(unsigned char *buf)
-{
- WL_TRACE("%s Enter\n", __func__);
- if (!buf)
- return -EINVAL;
-
- /* Customer access to MAC address stored outside of DHD driver */
-
-#ifdef EXAMPLE_GET_MAC
- /* EXAMPLE code */
- {
- u8 ea_example[ETH_ALEN] = {0x00, 0x11, 0x22, 0x33, 0x44, 0xFF};
- memcpy(buf, ea_example, ETH_ALEN);
- }
-#endif /* EXAMPLE_GET_MAC */
-
- return 0;
-}
-#endif /* GET_CUSTOM_MAC_ENABLE */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 6507891..5a0bcb2 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -2192,8 +2192,6 @@ static void __exit brcmf_module_cleanup(void)
#if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC)
wifi_del_dev();
#endif
- /* Call customer gpio to turn off power with WL_REG_ON signal */
- brcmf_customer_gpio_wlan_ctrl(WLAN_POWER_OFF);
}
static int __init brcmf_module_init(void)
@@ -2216,8 +2214,6 @@ static int __init brcmf_module_init(void)
DHD_ERROR(("Invalid module parameters.\n"));
return -EINVAL;
} while (0);
- /* Call customer gpio to turn on power with WL_REG_ON signal */
- brcmf_customer_gpio_wlan_ctrl(WLAN_POWER_ON);
#if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC)
sema_init(&wifi_control_sem, 0);
@@ -2245,11 +2241,9 @@ static int __init brcmf_module_init(void)
DHD_ERROR(("%s: dhd_bus_register failed\n", __func__));
goto failed;
}
- return error;
+ return 0;
failed:
- /* turn off power and exit */
- brcmf_customer_gpio_wlan_ctrl(WLAN_POWER_OFF);
return -EINVAL;
}
--
1.7.1
From: Arend van Spriel <[email protected]>
The macro SHOW_EVENTS will only be defined when Kconfig setting
BRCMDBG is set.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/Makefile | 5 ++---
1 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/Makefile b/drivers/staging/brcm80211/brcmfmac/Makefile
index 7441649..2fcc409 100644
--- a/drivers/staging/brcm80211/brcmfmac/Makefile
+++ b/drivers/staging/brcm80211/brcmfmac/Makefile
@@ -20,10 +20,9 @@ ccflags-y := \
-DBRCM_FULLMAC \
-DBRCMF_FIRSTREAD=64 \
-DBRCMF_SDALIGN=64 \
- -DMAX_HDR_READ=64 \
- -DSHOW_EVENTS
+ -DMAX_HDR_READ=64
-ccflags-$(CONFIG_BRCMDBG) += -DDHD_DEBUG
+ccflags-$(CONFIG_BRCMDBG) += -DDHD_DEBUG -DSHOW_EVENTS
ccflags-y += \
-Idrivers/staging/brcm80211/brcmfmac \
--
1.7.1
From: Arend van Spriel <[email protected]>
The common makefile and the fullmac makefile contained a few
macro definitions that are not or no longer used. These are
removed.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/Makefile | 2 +-
drivers/staging/brcm80211/brcmfmac/Makefile | 2 --
2 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/brcm80211/Makefile b/drivers/staging/brcm80211/Makefile
index db9a57e..8b01f5e 100644
--- a/drivers/staging/brcm80211/Makefile
+++ b/drivers/staging/brcm80211/Makefile
@@ -17,7 +17,7 @@
# common flags
subdir-ccflags-y := -DBCMDMA32
-subdir-ccflags-$(CONFIG_BRCMDBG) += -DBCMDBG -DBCMDBG_ASSERT
+subdir-ccflags-$(CONFIG_BRCMDBG) += -DBCMDBG
obj-$(CONFIG_BRCMUTIL) += brcmutil/
obj-$(CONFIG_BRCMFMAC) += brcmfmac/
diff --git a/drivers/staging/brcm80211/brcmfmac/Makefile b/drivers/staging/brcm80211/brcmfmac/Makefile
index a54a7d3..f097246 100644
--- a/drivers/staging/brcm80211/brcmfmac/Makefile
+++ b/drivers/staging/brcm80211/brcmfmac/Makefile
@@ -16,8 +16,6 @@
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
ccflags-y := \
- -DBCMSDIO \
- -DBRCM_FULLMAC \
-DBRCMF_FIRSTREAD=64 \
-DBRCMF_SDALIGN=64 \
-DMAX_HDR_READ=64
--
1.7.1
aiutils.c and pcicfg.h are no longer needed by fullmac
Signed-off-by: Franky Lin <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/aiutils.c | 1 -
drivers/staging/brcm80211/brcmfmac/pcicfg.h | 50 --------------------------
2 files changed, 0 insertions(+), 51 deletions(-)
delete mode 100644 drivers/staging/brcm80211/brcmfmac/aiutils.c
delete mode 100644 drivers/staging/brcm80211/brcmfmac/pcicfg.h
diff --git a/drivers/staging/brcm80211/brcmfmac/aiutils.c b/drivers/staging/brcm80211/brcmfmac/aiutils.c
deleted file mode 100644
index e648086..0000000
--- a/drivers/staging/brcm80211/brcmfmac/aiutils.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "../util/aiutils.c"
diff --git a/drivers/staging/brcm80211/brcmfmac/pcicfg.h b/drivers/staging/brcm80211/brcmfmac/pcicfg.h
deleted file mode 100644
index 3258449..0000000
--- a/drivers/staging/brcm80211/brcmfmac/pcicfg.h
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * Copyright (c) 2010 Broadcom Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _h_pcicfg_
-#define _h_pcicfg_
-
-#include <linux/pci_regs.h>
-
-/* PCI configuration address space size */
-#define PCI_SZPCR 256
-
-/* Everything below is Broadcom specific */
-
-/* Brcm PCI configuration registers */
-#define PCI_BAR0_WIN 0x80 /* backplane address space accessed by BAR0 */
-#define PCI_SPROM_CONTROL 0x88 /* sprom property control */
-#define PCI_INT_MASK 0x94 /* mask of PCI and other cores interrupts */
-#define PCI_SBIM_SHIFT 8 /* backplane core interrupt mask bits offset */
-#define PCI_BAR0_WIN2 0xac /* backplane address space accessed by second 4KB of BAR0 */
-#define PCI_GPIO_IN 0xb0 /* pci config space gpio input (>=rev3) */
-#define PCI_GPIO_OUT 0xb4 /* pci config space gpio output (>=rev3) */
-#define PCI_GPIO_OUTEN 0xb8 /* pci config space gpio output enable (>=rev3) */
-
-#define PCI_BAR0_SPROM_OFFSET (4 * 1024) /* bar0 + 4K accesses external sprom */
-#define PCI_BAR0_PCIREGS_OFFSET (6 * 1024) /* bar0 + 6K accesses pci core registers */
-#define PCI_BAR0_PCISBR_OFFSET (4 * 1024) /* pci core SB registers are at the end of the
- * 8KB window, so their address is the "regular"
- * address plus 4K
- */
-#define PCI_BAR0_WINSZ (16 * 1024) /* bar0 window size Match with corerev 13 */
-/* On pci corerev >= 13 and all pcie, the bar0 is now 16KB and it maps: */
-#define PCI_16KB0_PCIREGS_OFFSET (8 * 1024) /* bar0 + 8K accesses pci/pcie core registers */
-#define PCI_16KB0_CCREGS_OFFSET (12 * 1024) /* bar0 + 12K accesses chipc core registers */
-
-#define PCI_SBIM_STATUS_SERR 0x4 /* backplane SBErr interrupt status */
-
-#endif /* _h_pcicfg_ */
--
1.7.1
From: Arend van Spriel <[email protected]>
cfg80211 module is always favorite for the brcmfmac driver so the
macro is not needed to know the answer.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 108 +++++------------------
1 files changed, 24 insertions(+), 84 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index d09706b..386955e 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -262,6 +262,10 @@ char nvram_path[MOD_PARAM_PATHLEN];
module_param_string(firmware_path, firmware_path, MOD_PARAM_PATHLEN, 0);
module_param_string(nvram_path, nvram_path, MOD_PARAM_PATHLEN, 0);
+/* No firmware required */
+bool dhd_no_fw_req;
+module_param(dhd_no_fw_req, bool, 0);
+
/* Error bits */
module_param(dhd_msg_level, int, 0);
@@ -339,10 +343,6 @@ module_param(dhd_idletime, int, 0);
uint dhd_poll;
module_param(dhd_poll, uint, 0);
-/* Use cfg80211 */
-uint dhd_cfg80211 = true;
-module_param(dhd_cfg80211, uint, 0);
-
/* Use interrupts */
uint dhd_intr = true;
module_param(dhd_intr, uint, 0);
@@ -371,11 +371,6 @@ uint dhd_pktgen_len;
module_param(dhd_pktgen_len, uint, 0);
#endif
-#define FAVORITE_WIFI_CP (!!dhd_cfg80211)
-#define IS_CFG80211_FAVORITE() FAVORITE_WIFI_CP
-#define DBG_CFG80211_GET() ((dhd_cfg80211 & WL_DBG_MASK) >> 1)
-#define NO_FW_REQ() (dhd_cfg80211 & 0x80)
-
/* Version string to report */
#ifdef DHD_DEBUG
#define DHD_COMPILED "\nCompiled in " SRCBASE
@@ -398,32 +393,6 @@ static int dhd_toe_set(dhd_info_t *dhd, int idx, u32 toe_ol);
static int dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
wl_event_msg_t *event_ptr, void **data_ptr);
-#if defined(CONFIG_PM_SLEEP)
-static int dhd_sleep_pm_callback(struct notifier_block *nfb,
- unsigned long action, void *ignored)
-{
- switch (action) {
- case PM_HIBERNATION_PREPARE:
- case PM_SUSPEND_PREPARE:
- atomic_set(&dhd_mmc_suspend, true);
- return NOTIFY_OK;
- case PM_POST_HIBERNATION:
- case PM_POST_SUSPEND:
- atomic_set(&dhd_mmc_suspend, false);
- return NOTIFY_OK;
- }
- return 0;
-}
-
-static struct notifier_block dhd_sleep_pm_notifier = {
- .notifier_call = dhd_sleep_pm_callback,
- .priority = 0
-};
-
-extern int register_pm_notifier(struct notifier_block *nb);
-extern int unregister_pm_notifier(struct notifier_block *nb);
-#endif /* defined(CONFIG_PM_SLEEP) */
- /* && defined(DHD_GPL) */
static void dhd_set_packet_filter(int value, dhd_pub_t *dhd)
{
#ifdef PKT_FILTER_SUPPORT
@@ -1740,9 +1709,7 @@ static int dhd_stop(struct net_device *net)
dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
DHD_TRACE(("%s: Enter\n", __func__));
- if (IS_CFG80211_FAVORITE()) {
- wl_cfg80211_down();
- }
+ wl_cfg80211_down();
if (dhd->pub.up == 0)
return 0;
@@ -1792,12 +1759,10 @@ static int dhd_open(struct net_device *net)
/* Allow transmit calls */
netif_start_queue(net);
dhd->pub.up = 1;
- if (IS_CFG80211_FAVORITE()) {
- if (unlikely(wl_cfg80211_up())) {
- DHD_ERROR(("%s: failed to bring up cfg80211\n",
- __func__));
- return -1;
- }
+ if (unlikely(wl_cfg80211_up())) {
+ DHD_ERROR(("%s: failed to bring up cfg80211\n",
+ __func__));
+ return -1;
}
return ret;
@@ -1937,15 +1902,13 @@ dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen)
#endif /* defined(CONFIG_WIRELESS_EXT) */
/* Attach and link in the cfg80211 */
- if (IS_CFG80211_FAVORITE()) {
- if (unlikely(wl_cfg80211_attach(net, &dhd->pub))) {
- DHD_ERROR(("wl_cfg80211_attach failed\n"));
- goto fail;
- }
- if (!NO_FW_REQ()) {
- strcpy(fw_path, wl_cfg80211_get_fwname());
- strcpy(nv_path, wl_cfg80211_get_nvramname());
- }
+ if (unlikely(wl_cfg80211_attach(net, &dhd->pub))) {
+ DHD_ERROR(("wl_cfg80211_attach failed\n"));
+ goto fail;
+ }
+ if (!dhd_no_fw_req) {
+ strcpy(fw_path, wl_cfg80211_get_fwname());
+ strcpy(nv_path, wl_cfg80211_get_nvramname());
}
/* Set up the watchdog timer */
@@ -2011,8 +1974,6 @@ dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen)
#endif
#if defined(CONFIG_PM_SLEEP)
atomic_set(&dhd_mmc_suspend, false);
- if (!IS_CFG80211_FAVORITE())
- register_pm_notifier(&dhd_sleep_pm_notifier);
#endif /* defined(CONFIG_PM_SLEEP) */
/* && defined(DHD_GPL) */
/* Init lock suspend to prevent kernel going to suspend */
@@ -2302,13 +2263,8 @@ void dhd_detach(dhd_pub_t *dhdp)
wl_iw_detach();
#endif /* (CONFIG_WIRELESS_EXT) */
- if (IS_CFG80211_FAVORITE())
- wl_cfg80211_detach();
+ wl_cfg80211_detach();
-#if defined(CONFIG_PM_SLEEP)
- if (!IS_CFG80211_FAVORITE())
- unregister_pm_notifier(&dhd_sleep_pm_notifier);
-#endif /* defined(CONFIG_PM_SLEEP) */
/* && defined(DHD_GPL) */
free_netdev(ifp->net);
kfree(ifp);
@@ -2509,7 +2465,7 @@ void *dhd_os_open_image(char *filename)
{
struct file *fp;
- if (IS_CFG80211_FAVORITE() && !NO_FW_REQ())
+ if (!dhd_no_fw_req)
return wl_cfg80211_request_fw(filename);
fp = filp_open(filename, O_RDONLY, 0);
@@ -2530,7 +2486,7 @@ int dhd_os_get_image_block(char *buf, int len, void *image)
struct file *fp = (struct file *)image;
int rdlen;
- if (IS_CFG80211_FAVORITE() && !NO_FW_REQ())
+ if (!dhd_no_fw_req)
return wl_cfg80211_read_fw(buf, len);
if (!image)
@@ -2545,7 +2501,7 @@ int dhd_os_get_image_block(char *buf, int len, void *image)
void dhd_os_close_image(void *image)
{
- if (IS_CFG80211_FAVORITE() && !NO_FW_REQ())
+ if (!dhd_no_fw_req)
return wl_cfg80211_release_fw();
if (image)
filp_close((struct file *)image, NULL);
@@ -2587,26 +2543,10 @@ dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
if (bcmerror != 0)
return bcmerror;
-#if defined(CONFIG_WIRELESS_EXT)
- if (!IS_CFG80211_FAVORITE()) {
- if ((dhd->iflist[*ifidx] == NULL)
- || (dhd->iflist[*ifidx]->net == NULL)) {
- DHD_ERROR(("%s Exit null pointer\n", __func__));
- return bcmerror;
- }
-
- if (dhd->iflist[*ifidx]->net)
- wl_iw_event(dhd->iflist[*ifidx]->net, event, *data);
- }
-#endif /* defined(CONFIG_WIRELESS_EXT) */
-
- if (IS_CFG80211_FAVORITE()) {
- ASSERT(dhd->iflist[*ifidx] != NULL);
- ASSERT(dhd->iflist[*ifidx]->net != NULL);
- if (dhd->iflist[*ifidx]->net)
- wl_cfg80211_event(dhd->iflist[*ifidx]->net, event,
- *data);
- }
+ ASSERT(dhd->iflist[*ifidx] != NULL);
+ ASSERT(dhd->iflist[*ifidx]->net != NULL);
+ if (dhd->iflist[*ifidx]->net)
+ wl_cfg80211_event(dhd->iflist[*ifidx]->net, event, *data);
return bcmerror;
}
--
1.7.1
From: Roland Vossen <[email protected]>
IEEE80211_AMPDU_TX_OPERATIONAL provides a BA window size parameter. Code
is now using this parameter to restrict the amount of outstanding tx
AMPDUs.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/ampdu.c | 55 +++++++---------------
drivers/staging/brcm80211/brcmsmac/mac80211_if.c | 9 +++-
drivers/staging/brcm80211/brcmsmac/pub.h | 2 +
drivers/staging/brcm80211/brcmsmac/scb.h | 3 +-
4 files changed, 29 insertions(+), 40 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/ampdu.c b/drivers/staging/brcm80211/brcmsmac/ampdu.c
index 74c4055..e9b78bf 100644
--- a/drivers/staging/brcm80211/brcmsmac/ampdu.c
+++ b/drivers/staging/brcm80211/brcmsmac/ampdu.c
@@ -114,9 +114,6 @@ static void brcms_c_ffpld_init(struct ampdu_info *ampdu);
static int brcms_c_ffpld_check_txfunfl(struct brcms_c_info *wlc, int f);
static void brcms_c_ffpld_calc_mcs2ampdu_table(struct ampdu_info *ampdu, int f);
-static scb_ampdu_tid_ini_t *brcms_c_ampdu_init_tid_ini(struct ampdu_info *ampdu,
- scb_ampdu_t *scb_ampdu,
- u8 tid, bool override);
static void brcms_c_scb_ampdu_update_max_txlen(struct ampdu_info *ampdu,
u8 dur);
static void brcms_c_scb_ampdu_update_config(struct ampdu_info *ampdu,
@@ -411,22 +408,26 @@ static void brcms_c_ffpld_calc_mcs2ampdu_table(struct ampdu_info *ampdu, int f)
}
}
-static void
-brcms_c_ampdu_agg(struct ampdu_info *ampdu, struct scb *scb, struct sk_buff *p,
- uint prec)
+void
+brcms_c_ampdu_tx_operational(struct brcms_c_info *wlc, u8 tid,
+ u8 ba_wsize) /* negotiated ba window size (in pdu) */
{
scb_ampdu_t *scb_ampdu;
scb_ampdu_tid_ini_t *ini;
- u8 tid = (u8) (p->priority);
-
+ struct ampdu_info *ampdu = wlc->ampdu;
+ struct scb *scb = wlc->pub->global_scb;
scb_ampdu = SCB_AMPDU_CUBBY(ampdu, scb);
- /* initialize initiator on first packet; sends addba req */
- ini = SCB_AMPDU_INI(scb_ampdu, tid);
- if (ini->magic != INI_MAGIC) {
- ini = brcms_c_ampdu_init_tid_ini(ampdu, scb_ampdu, tid, false);
+ if (!ampdu->ini_enable[tid]) {
+ wiphy_err(ampdu->wlc->wiphy, "%s: Rejecting tid %d\n",
+ __func__, tid);
+ return;
}
- return;
+
+ ini = SCB_AMPDU_INI(scb_ampdu, tid);
+ ini->tid = tid;
+ ini->scb = scb_ampdu->scb;
+ ini->ba_wsize = ba_wsize;
}
int
@@ -479,12 +480,13 @@ brcms_c_sendampdu(struct ampdu_info *ampdu, struct brcms_c_txq_info *qi,
/* Let pressure continue to build ... */
qlen = pktq_plen(&qi->q, prec);
- if (ini->tx_in_transit > 0 && qlen < scb_ampdu->max_pdu) {
+ if (ini->tx_in_transit > 0 &&
+ qlen < min(scb_ampdu->max_pdu, ini->ba_wsize)) {
+ /* Collect multiple MPDU's to be sent in the next AMPDU */
return -EBUSY;
}
- brcms_c_ampdu_agg(ampdu, scb, p, tid);
-
+ /* at this point we intend to transmit an AMPDU */
rr_retry_limit = ampdu->rr_retry_limit_tid[tid];
ampdu_len = 0;
dma_len = 0;
@@ -1083,27 +1085,6 @@ brcms_c_ampdu_dotxstatus_complete(struct ampdu_info *ampdu, struct scb *scb,
brcms_c_txfifo_complete(wlc, queue, ampdu->txpkt_weight);
}
-/* initialize the initiator code for tid */
-static scb_ampdu_tid_ini_t *brcms_c_ampdu_init_tid_ini(struct ampdu_info *ampdu,
- scb_ampdu_t *scb_ampdu,
- u8 tid, bool override)
-{
- scb_ampdu_tid_ini_t *ini;
-
- /* check for per-tid control of ampdu */
- if (!ampdu->ini_enable[tid]) {
- wiphy_err(ampdu->wlc->wiphy, "%s: Rejecting tid %d\n",
- __func__, tid);
- return NULL;
- }
-
- ini = SCB_AMPDU_INI(scb_ampdu, tid);
- ini->tid = tid;
- ini->scb = scb_ampdu->scb;
- ini->magic = INI_MAGIC;
- return ini;
-}
-
static int brcms_c_ampdu_set(struct ampdu_info *ampdu, bool on)
{
struct brcms_c_info *wlc = ampdu->wlc;
diff --git a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
index 73e60df..547df75 100644
--- a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
@@ -656,7 +656,14 @@ brcms_ops_ampdu_action(struct ieee80211_hw *hw,
ieee80211_stop_tx_ba_cb_irqsafe(vif, sta->addr, tid);
break;
case IEEE80211_AMPDU_TX_OPERATIONAL:
- /* Not sure what to do here */
+ /*
+ * BA window size from ADDBA response ('buf_size') defines how
+ * many outstanding MPDUs are allowed for the BA stream by
+ * recipient and traffic class.
+ */
+ LOCK(wl);
+ brcms_c_ampdu_tx_operational(wl->wlc, tid, buf_size);
+ UNLOCK(wl);
/* Power save wakeup */
break;
default:
diff --git a/drivers/staging/brcm80211/brcmsmac/pub.h b/drivers/staging/brcm80211/brcmsmac/pub.h
index 2345a31..14c0d20 100644
--- a/drivers/staging/brcm80211/brcmsmac/pub.h
+++ b/drivers/staging/brcm80211/brcmsmac/pub.h
@@ -626,6 +626,8 @@ extern void brcms_default_rateset(struct brcms_c_info *wlc, wlc_rateset_t *rs);
extern void brcms_c_ampdu_flush(struct brcms_c_info *wlc,
struct ieee80211_sta *sta, u16 tid);
+extern void brcms_c_ampdu_tx_operational(struct brcms_c_info *wlc, u8 tid,
+ u8 ba_wsize);
extern int brcms_c_set_par(struct brcms_c_info *wlc, enum wlc_par_id par_id,
int val);
extern int brcms_c_get_par(struct brcms_c_info *wlc, enum wlc_par_id par_id,
diff --git a/drivers/staging/brcm80211/brcmsmac/scb.h b/drivers/staging/brcm80211/brcmsmac/scb.h
index fa5c0b3..c2080e9 100644
--- a/drivers/staging/brcm80211/brcmsmac/scb.h
+++ b/drivers/staging/brcm80211/brcmsmac/scb.h
@@ -25,11 +25,11 @@
#define AMPDU_TX_BA_MAX_WSIZE 64 /* max Tx ba window size (in pdu) */
/* structure to store per-tid state for the ampdu initiator */
struct scb_ampdu_tid_ini {
- u32 magic;
u8 tx_in_transit; /* number of pending mpdus in transit in driver */
u8 tid; /* initiator tid for easy lookup */
u8 txretry[AMPDU_TX_BA_MAX_WSIZE]; /* tx retry count; indexed by seq modulo */
struct scb *scb; /* backptr for easy lookup */
+ u8 ba_wsize; /* negotiated ba window size (in pdu) */
};
#define AMPDU_MAX_SCB_TID NUMPRIO
@@ -51,7 +51,6 @@ struct scb_ampdu {
};
#define SCB_MAGIC 0xbeefcafe
-#define INI_MAGIC 0xabcd1234
/* station control block - one per remote MAC address */
struct scb {
--
1.7.1
On 06/30/2011 11:32 AM, Dan Carpenter wrote:
> On Thu, Jun 30, 2011 at 10:42:31AM -0700, Henry Ptasinski wrote:
>> On 06/29/2011 11:29 PM, Rafał Miłecki wrote:
>>> 2011/6/30 Franky Lin<[email protected]>:
>>>> Most of these patches are brcmfmac cleanup.
>>>
>>>
>>> Hm, interesting improvement in your "Release early, release often" strategy.
>>>
>>
>> Yea, we were waiting for the previous series to get applied. Not
>> sure how to make this work better. Any process suggestions would be
>> appreciated.
>
> Maintain your own git tree. Post patches in bunches. If no one
> comments on them within 3 days then probably you can assume they
> are going to be merged. In the [0 / X] patch say something like:
>
> Fixes blah blah blah.
>
> Applies to linux-next with the following patch sets applied:
> Message-ID:<[email protected]>
> Message-ID:<[email protected]>
> Or you can get the patches from git://whatever branch.
>
> regards,
> dan carpenter
>
So there are two suggestions here:
1. post patches in smaller bunches, and include dependency info in the
0/X patch. Presumably, if one of the dependencies is dropped, then
people will know to drop this series as well, and we would have to
repost everything that was dropped once we fix the identified issues.
2. maintain a public git tree that people can pull from. If we do (1),
is this needed and/or still useful? Do community folks that want to
contribute changes send them to us or Greg/John/whoever is upstream?
Pros/cons? Anybody have tips on workflow (my git mastery is still quite
weak)?
Thanks,
- Henry
From: Roland Vossen <[email protected]>
Code cleanup. This function always returned 0.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h | 4 ----
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 8 --------
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 7 -------
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 3 +--
drivers/staging/brcm80211/brcmfmac/sdio_host.h | 5 -----
5 files changed, 1 insertions(+), 26 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
index ee01e48..656caeb 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
@@ -53,10 +53,6 @@ brcmf_sdioh_interrupt_query(struct sdioh_info *si, bool *onoff);
extern int
brcmf_sdioh_interrupt_set(struct sdioh_info *si, bool enable_disable);
-#if defined(BCMDBG)
-extern bool brcmf_sdioh_interrupt_pending(struct sdioh_info *si);
-#endif
-
extern int brcmf_sdioh_claim_host_and_lock(struct sdioh_info *si);
extern int brcmf_sdioh_release_host_and_unlock(struct sdioh_info *si);
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
index 4c7e4a9..132b18f 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
@@ -138,14 +138,6 @@ int brcmf_sdcard_intr_dereg(struct brcmf_sdio_card *card)
return brcmf_sdioh_interrupt_deregister(card->sdioh);
}
-#if defined(BCMDBG)
-bool brcmf_sdcard_intr_pending(struct brcmf_sdio_card *card)
-{
- ASSERT(card);
- return brcmf_sdioh_interrupt_pending(card->sdioh);
-}
-#endif
-
int brcmf_sdcard_devremove_reg(struct brcmf_sdio_card *card,
brcmf_sdiocard_cb_fn_t fn,
void *argh)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index d0e9b3d..092d044 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -244,13 +244,6 @@ brcmf_sdioh_interrupt_query(struct sdioh_info *sd, bool *onoff)
return 0;
}
-#if defined(BCMDBG)
-extern bool brcmf_sdioh_interrupt_pending(struct sdioh_info *sd)
-{
- return 0;
-}
-#endif
-
uint brcmf_sdioh_query_iofnum(struct sdioh_info *sd)
{
return sd->num_funcs;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 3ed9e12..e43c53a 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -1889,8 +1889,7 @@ void brcmf_sdbrcm_bus_dump(struct brcmf_pub *dhdp, struct brcmu_strbuf *strbuf)
#endif /* SDTEST */
#ifdef BCMDBG
brcmu_bprintf(strbuf, "dpc_sched %d host interrupt%spending\n",
- bus->dpc_sched,
- (brcmf_sdcard_intr_pending(bus->card) ? " " : " not "));
+ bus->dpc_sched, " not ");
brcmu_bprintf(strbuf, "blocksize %d roundup %d\n", bus->blocksize,
bus->roundup);
#endif /* BCMDBG */
diff --git a/drivers/staging/brcm80211/brcmfmac/sdio_host.h b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
index 5c5bbca..f05067a 100644
--- a/drivers/staging/brcm80211/brcmfmac/sdio_host.h
+++ b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
@@ -93,11 +93,6 @@ brcmf_sdcard_intr_reg(struct brcmf_sdio_card *card, brcmf_sdiocard_cb_fn_t fn,
extern int brcmf_sdcard_intr_dereg(struct brcmf_sdio_card *card);
-#if defined(BCMDBG)
-/* Query pending interrupt status from the host controller */
-extern bool brcmf_sdcard_intr_pending(struct brcmf_sdio_card *card);
-#endif
-
/* Register a callback to be called on device removal.
* No-op in the case of non-removable/hardwired devices.
*/
--
1.7.1
From: Roland Vossen <[email protected]>
Code cleanup. These functions were empty.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h | 4 ----
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 10 ----------
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 10 ----------
drivers/staging/brcm80211/brcmfmac/sdio_host.h | 6 ------
4 files changed, 0 insertions(+), 30 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
index eb08152..761ec20 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
@@ -93,10 +93,6 @@ extern int brcmf_sdioh_iovar_op(struct sdioh_info *si, const char *name,
/* Issue abort to the specified function and clear controller as needed */
extern int brcmf_sdioh_abort(struct sdioh_info *si, uint fnc);
-/* Start and Stop SDIO without re-enumerating the SD card. */
-extern int brcmf_sdioh_start(struct sdioh_info *si, int stage);
-extern int brcmf_sdioh_stop(struct sdioh_info *si);
-
/* Helper function */
void *brcmf_sdcard_get_sdioh(struct brcmf_sdio_card *card);
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
index 11abd55..09bad40 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
@@ -521,16 +521,6 @@ int brcmf_sdcard_abort(struct brcmf_sdio_card *card, uint fn)
return brcmf_sdioh_abort(card->sdioh, fn);
}
-int brcmf_sdcard_start(struct brcmf_sdio_card *card, int stage)
-{
- return brcmf_sdioh_start(card->sdioh, stage);
-}
-
-int brcmf_sdcard_stop(struct brcmf_sdio_card *card)
-{
- return brcmf_sdioh_stop(card->sdioh);
-}
-
int brcmf_sdcard_query_device(struct brcmf_sdio_card *card)
{
card->vendevid = (PCI_VENDOR_ID_BROADCOM << 16) | 0;
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 0f0dc42..7da200f 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -921,13 +921,3 @@ static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func)
ASSERT(sd != NULL);
}
-
-int brcmf_sdioh_start(struct sdioh_info *si, int stage)
-{
- return 0;
-}
-
-int brcmf_sdioh_stop(struct sdioh_info *si)
-{
- return 0;
-}
diff --git a/drivers/staging/brcm80211/brcmfmac/sdio_host.h b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
index df4063c..712d0df 100644
--- a/drivers/staging/brcm80211/brcmfmac/sdio_host.h
+++ b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
@@ -190,12 +190,6 @@ extern int brcmf_sdcard_rwdata(struct brcmf_sdio_card *card, uint rw, u32 addr,
/* Issue an abort to the specified function */
extern int brcmf_sdcard_abort(struct brcmf_sdio_card *card, uint fn);
-/* Start SDIO Host Controller communication */
-extern int brcmf_sdcard_start(struct brcmf_sdio_card *card, int stage);
-
-/* Stop SDIO Host Controller communication */
-extern int brcmf_sdcard_stop(struct brcmf_sdio_card *card);
-
/* Returns the "Device ID" of target device on the SDIO bus. */
extern int brcmf_sdcard_query_device(struct brcmf_sdio_card *card);
--
1.7.1
From: Arend van Spriel <[email protected]>
The header file dhd.h contained a number of macro definitions that
are not used within the driver and have been removed.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 41 ------------------------------
1 files changed, 0 insertions(+), 41 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 14713f5..9b27982 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -119,47 +119,12 @@ struct dhd_info;
#define WL_SCAN_RESULTS_ABORTED 3
#define WL_SCAN_RESULTS_NO_MEM 4
-#define MAX_CCA_CHANNELS 38 /* Max number of 20 Mhz wide channels */
-#define MAX_CCA_SECS 60 /* CCA keeps this many seconds history */
-
-#define IBSS_MED 15 /* Mediom in-bss congestion percentage */
-#define IBSS_HI 25 /* Hi in-bss congestion percentage */
-#define OBSS_MED 12
-#define OBSS_HI 25
-#define INTERFER_MED 5
-#define INTERFER_HI 10
-
-#define CCA_FLAG_2G_ONLY 0x01 /* Return a channel from 2.4 Ghz band */
-#define CCA_FLAG_5G_ONLY 0x02 /* Return a channel from 2.4 Ghz band */
-#define CCA_FLAG_IGNORE_DURATION 0x04 /* Ignore dwell time for each channel */
-#define CCA_FLAGS_PREFER_1_6_11 0x10
-#define CCA_FLAG_IGNORE_INTERFER 0x20 /* do not exlude channel based on interfer level */
-
-#define CCA_ERRNO_BAND 1 /* After filtering for band pref, no choices left */
-#define CCA_ERRNO_DURATION 2 /* After filtering for duration, no choices left */
-#define CCA_ERRNO_PREF_CHAN 3 /* After filtering for chan pref, no choices left */
-#define CCA_ERRNO_INTERFER 4 /* After filtering for interference, no choices left */
-#define CCA_ERRNO_TOO_FEW 5 /* Only 1 channel was input */
-
-#define WL_NUM_RPI_BINS 8
-#define WL_RM_TYPE_BASIC 1
-#define WL_RM_TYPE_CCA 2
-#define WL_RM_TYPE_RPI 3
-
-#define WL_RM_FLAG_PARALLEL (1<<0)
-
-#define WL_RM_FLAG_LATE (1<<1)
-#define WL_RM_FLAG_INCAPABLE (1<<2)
-#define WL_RM_FLAG_REFUSED (1<<3)
-
#define WL_SOFT_KEY (1 << 0) /* Indicates this key is using soft encrypt */
#define WL_PRIMARY_KEY (1 << 1) /* Indicates this key is the primary (ie tx) key */
#define WL_KF_RES_4 (1 << 4) /* Reserved for backward compat */
#define WL_KF_RES_5 (1 << 5) /* Reserved for backward compat */
#define WL_IBSS_PEER_GROUP_KEY (1 << 6) /* Indicates a group key for a IBSS PEER */
-#define DHD_IF_VIF 0x01 /* Virtual IF (Hidden from user) */
-
/* optionally set by a module_param_string() */
#define MOD_PARAM_PATHLEN 2048
@@ -171,7 +136,6 @@ struct dhd_info;
#define DOT11_BSSTYPE_ANY 2
#define DOT11_MAX_DEFAULT_KEYS 4
-#define BCM_EVENT_MSG_VERSION 1
#define BCM_MSG_IFNAME_MAX 16
#define WLC_EVENT_MSG_LINK 0x01
@@ -522,7 +486,6 @@ typedef struct wl_assoc_params {
/* used for reassociation/roam to a specific BSSID and channel */
typedef wl_assoc_params_t wl_reassoc_params_t;
-#define WL_REASSOC_PARAMS_FIXED_SIZE WL_ASSOC_PARAMS_FIXED_SIZE
/* used for join with or without a specific bssid and channel list */
typedef struct wl_join_params {
@@ -531,7 +494,6 @@ typedef struct wl_join_params {
* of the wl_assoc_params_t struct when it does present.
*/
} wl_join_params_t;
-#define WL_JOIN_PARAMS_FIXED_SIZE (sizeof(wl_join_params_t) - sizeof(chanspec_t))
/* size of wl_scan_results not including variable length array */
#define WL_SCAN_RESULTS_FIXED_SIZE (sizeof(wl_scan_results_t) - sizeof(wl_bss_info_t))
@@ -609,7 +571,6 @@ typedef struct wl_rm_req {
void *cb_arg; /* arg to completion callback function */
wl_rm_req_elt_t req[1]; /* variable length block of requests */
} wl_rm_req_t;
-#define WL_RM_REQ_FIXED_LEN offsetof(wl_rm_req_t, req)
typedef struct wl_rm_rep_elt {
s8 type;
@@ -622,7 +583,6 @@ typedef struct wl_rm_rep_elt {
u32 len; /* byte length of data block */
u8 data[1]; /* variable length data block */
} wl_rm_rep_elt_t;
-#define WL_RM_REP_ELT_FIXED_LEN 24 /* length excluding data block */
#define WL_RPI_REP_BIN_NUM 8
typedef struct wl_rm_rpi_rep {
@@ -635,7 +595,6 @@ typedef struct wl_rm_rep {
u32 len; /* length of measurement report block */
wl_rm_rep_elt_t rep[1]; /* variable length block of reports */
} wl_rm_rep_t;
-#define WL_RM_REP_FIXED_LEN 8
typedef struct wl_wsec_key {
u32 index; /* key index */
--
1.7.1
From: Arend van Spriel <[email protected]>
The source file pmu.c contained a large number of definitions that
are no longer needed and have been removed.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/pmu.c | 491 ------------------------------
1 files changed, 0 insertions(+), 491 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/pmu.c b/drivers/staging/brcm80211/brcmsmac/pmu.c
index d7ca7ed..6508243 100644
--- a/drivers/staging/brcm80211/brcmsmac/pmu.c
+++ b/drivers/staging/brcm80211/brcmsmac/pmu.c
@@ -25,11 +25,6 @@
#include "pmu.h"
/*
- * d11 slow to fast clock transition time in slow clock cycles
- */
-#define D11SCC_SLOW2FAST_TRANSITION 2
-
-/*
* external LPO crystal frequency
*/
#define EXT_ILP_HZ 32768
@@ -41,93 +36,6 @@
*/
#define ILP_CALC_DUR 10
-/*
- * FVCO frequency
- */
-#define FVCO_880 880000 /* 880MHz */
-#define FVCO_1760 1760000 /* 1760MHz */
-#define FVCO_1440 1440000 /* 1440MHz */
-#define FVCO_960 960000 /* 960MHz */
-
-/*
- * PMU crystal table indices for 1440MHz fvco
- */
-#define PMU1_XTALTAB0_1440_12000K 0
-#define PMU1_XTALTAB0_1440_13000K 1
-#define PMU1_XTALTAB0_1440_14400K 2
-#define PMU1_XTALTAB0_1440_15360K 3
-#define PMU1_XTALTAB0_1440_16200K 4
-#define PMU1_XTALTAB0_1440_16800K 5
-#define PMU1_XTALTAB0_1440_19200K 6
-#define PMU1_XTALTAB0_1440_19800K 7
-#define PMU1_XTALTAB0_1440_20000K 8
-#define PMU1_XTALTAB0_1440_25000K 9
-#define PMU1_XTALTAB0_1440_26000K 10
-#define PMU1_XTALTAB0_1440_30000K 11
-#define PMU1_XTALTAB0_1440_37400K 12
-#define PMU1_XTALTAB0_1440_38400K 13
-#define PMU1_XTALTAB0_1440_40000K 14
-#define PMU1_XTALTAB0_1440_48000K 15
-
-/*
- * PMU crystal table indices for 960MHz fvco
- */
-#define PMU1_XTALTAB0_960_12000K 0
-#define PMU1_XTALTAB0_960_13000K 1
-#define PMU1_XTALTAB0_960_14400K 2
-#define PMU1_XTALTAB0_960_15360K 3
-#define PMU1_XTALTAB0_960_16200K 4
-#define PMU1_XTALTAB0_960_16800K 5
-#define PMU1_XTALTAB0_960_19200K 6
-#define PMU1_XTALTAB0_960_19800K 7
-#define PMU1_XTALTAB0_960_20000K 8
-#define PMU1_XTALTAB0_960_25000K 9
-#define PMU1_XTALTAB0_960_26000K 10
-#define PMU1_XTALTAB0_960_30000K 11
-#define PMU1_XTALTAB0_960_37400K 12
-#define PMU1_XTALTAB0_960_38400K 13
-#define PMU1_XTALTAB0_960_40000K 14
-#define PMU1_XTALTAB0_960_48000K 15
-
-/*
- * PMU crystal table indices for 880MHz fvco
- */
-#define PMU1_XTALTAB0_880_12000K 0
-#define PMU1_XTALTAB0_880_13000K 1
-#define PMU1_XTALTAB0_880_14400K 2
-#define PMU1_XTALTAB0_880_15360K 3
-#define PMU1_XTALTAB0_880_16200K 4
-#define PMU1_XTALTAB0_880_16800K 5
-#define PMU1_XTALTAB0_880_19200K 6
-#define PMU1_XTALTAB0_880_19800K 7
-#define PMU1_XTALTAB0_880_20000K 8
-#define PMU1_XTALTAB0_880_24000K 9
-#define PMU1_XTALTAB0_880_25000K 10
-#define PMU1_XTALTAB0_880_26000K 11
-#define PMU1_XTALTAB0_880_30000K 12
-#define PMU1_XTALTAB0_880_37400K 13
-#define PMU1_XTALTAB0_880_38400K 14
-#define PMU1_XTALTAB0_880_40000K 15
-
-/*
- * crystal frequency values
- */
-#define XTAL_FREQ_24000MHZ 24000
-#define XTAL_FREQ_30000MHZ 30000
-#define XTAL_FREQ_37400MHZ 37400
-#define XTAL_FREQ_48000MHZ 48000
-
-/*
- * Resource dependancies mask change action
- *
- * @RES_DEPEND_SET: Override the dependancies mask
- * @RES_DEPEND_ADD: Add to the dependancies mask
- * @RES_DEPEND_REMOVE: Remove from the dependancies mask
- */
-#define RES_DEPEND_SET 0
-#define RES_DEPEND_ADD 1
-#define RES_DEPEND_REMOVE -1
-
/* Fields in pmucontrol */
#define PCTL_ILP_DIV_MASK 0xffff0000
#define PCTL_ILP_DIV_SHIFT 16
@@ -140,24 +48,12 @@
#define PCTL_ILP_DIV_EN 0x00000002
#define PCTL_LPO_SEL 0x00000001
-/* Fields in clkstretch */
-#define CSTRETCH_HT 0xffff0000
-#define CSTRETCH_ALP 0x0000ffff
-
-/* d11 slow to fast clock transition time in slow clock cycles */
-#define D11SCC_SLOW2FAST_TRANSITION 2
-
/* ILP clock */
#define ILP_CLOCK 32000
/* ALP clock on pre-PMU chips */
#define ALP_CLOCK 20000000
-/* HT clock */
-#define HT_CLOCK 80000000
-
-#define OTPS_READY 0x00001000
-
/* pmustatus */
#define PST_EXTLPOAVAIL 0x0100
#define PST_WDRESET 0x0080
@@ -170,411 +66,27 @@
#define PST_HTAVAIL 0x0004
#define PST_RESINIT 0x0003
-/* PMU Resource Request Timer registers */
-/* This is based on PmuRev0 */
-#define PRRT_TIME_MASK 0x03ff
-#define PRRT_INTEN 0x0400
-#define PRRT_REQ_ACTIVE 0x0800
-#define PRRT_ALP_REQ 0x1000
-#define PRRT_HT_REQ 0x2000
-
/* PMU resource bit position */
#define PMURES_BIT(bit) (1 << (bit))
-/* PMU resource number limit */
-#define PMURES_MAX_RESNUM 30
-
-/* PMU chip control0 register */
-#define PMU_CHIPCTL0 0
-
-/* PMU chip control1 register */
-#define PMU_CHIPCTL1 1
-#define PMU_CC1_RXC_DLL_BYPASS 0x00010000
-
-#define PMU_CC1_IF_TYPE_MASK 0x00000030
-#define PMU_CC1_IF_TYPE_RMII 0x00000000
-#define PMU_CC1_IF_TYPE_MII 0x00000010
-#define PMU_CC1_IF_TYPE_RGMII 0x00000020
-
-#define PMU_CC1_SW_TYPE_MASK 0x000000c0
-#define PMU_CC1_SW_TYPE_EPHY 0x00000000
-#define PMU_CC1_SW_TYPE_EPHYMII 0x00000040
-#define PMU_CC1_SW_TYPE_EPHYRMII 0x00000080
-#define PMU_CC1_SW_TYPE_RGMII 0x000000c0
-
/* PMU corerev and chip specific PLL controls.
* PMU<rev>_PLL<num>_XX where <rev> is PMU corerev and <num> is an arbitrary number
* to differentiate different PLLs controlled by the same PMU rev.
*/
/* pllcontrol registers */
-/* PDIV, div_phy, div_arm, div_adc, dith_sel, ioff, kpd_scale, lsb_sel, mash_sel, lf_c & lf_r */
-#define PMU0_PLL0_PLLCTL0 0
-#define PMU0_PLL0_PC0_PDIV_MASK 1
-#define PMU0_PLL0_PC0_PDIV_FREQ 25000
-#define PMU0_PLL0_PC0_DIV_ARM_MASK 0x00000038
-#define PMU0_PLL0_PC0_DIV_ARM_SHIFT 3
-#define PMU0_PLL0_PC0_DIV_ARM_BASE 8
-
-/* PC0_DIV_ARM for PLLOUT_ARM */
-#define PMU0_PLL0_PC0_DIV_ARM_110MHZ 0
-#define PMU0_PLL0_PC0_DIV_ARM_97_7MHZ 1
-#define PMU0_PLL0_PC0_DIV_ARM_88MHZ 2
-#define PMU0_PLL0_PC0_DIV_ARM_80MHZ 3 /* Default */
-#define PMU0_PLL0_PC0_DIV_ARM_73_3MHZ 4
-#define PMU0_PLL0_PC0_DIV_ARM_67_7MHZ 5
-#define PMU0_PLL0_PC0_DIV_ARM_62_9MHZ 6
-#define PMU0_PLL0_PC0_DIV_ARM_58_6MHZ 7
-
-/* Wildcard base, stop_mod, en_lf_tp, en_cal & lf_r2 */
-#define PMU0_PLL0_PLLCTL1 1
-#define PMU0_PLL0_PC1_WILD_INT_MASK 0xf0000000
-#define PMU0_PLL0_PC1_WILD_INT_SHIFT 28
-#define PMU0_PLL0_PC1_WILD_FRAC_MASK 0x0fffff00
-#define PMU0_PLL0_PC1_WILD_FRAC_SHIFT 8
-#define PMU0_PLL0_PC1_STOP_MOD 0x00000040
-
-/* Wildcard base, vco_calvar, vco_swc, vco_var_selref, vso_ical & vco_sel_avdd */
-#define PMU0_PLL0_PLLCTL2 2
-#define PMU0_PLL0_PC2_WILD_INT_MASK 0xf
-#define PMU0_PLL0_PC2_WILD_INT_SHIFT 4
-
-/* pllcontrol registers */
/* ndiv_pwrdn, pwrdn_ch<x>, refcomp_pwrdn, dly_ch<x>, p1div, p2div, _bypass_sdmod */
#define PMU1_PLL0_PLLCTL0 0
-#define PMU1_PLL0_PC0_P1DIV_MASK 0x00f00000
-#define PMU1_PLL0_PC0_P1DIV_SHIFT 20
-#define PMU1_PLL0_PC0_P2DIV_MASK 0x0f000000
-#define PMU1_PLL0_PC0_P2DIV_SHIFT 24
-
-/* m<x>div */
#define PMU1_PLL0_PLLCTL1 1
-#define PMU1_PLL0_PC1_M1DIV_MASK 0x000000ff
-#define PMU1_PLL0_PC1_M1DIV_SHIFT 0
-#define PMU1_PLL0_PC1_M2DIV_MASK 0x0000ff00
-#define PMU1_PLL0_PC1_M2DIV_SHIFT 8
-#define PMU1_PLL0_PC1_M3DIV_MASK 0x00ff0000
-#define PMU1_PLL0_PC1_M3DIV_SHIFT 16
-#define PMU1_PLL0_PC1_M4DIV_MASK 0xff000000
-#define PMU1_PLL0_PC1_M4DIV_SHIFT 24
-
-#define PMU1_PLL0_CHIPCTL0 0
-#define PMU1_PLL0_CHIPCTL1 1
-#define PMU1_PLL0_CHIPCTL2 2
-
-#define DOT11MAC_880MHZ_CLK_DIVISOR_SHIFT 8
-#define DOT11MAC_880MHZ_CLK_DIVISOR_MASK (0xFF << DOT11MAC_880MHZ_CLK_DIVISOR_SHIFT)
-#define DOT11MAC_880MHZ_CLK_DIVISOR_VAL (0xE << DOT11MAC_880MHZ_CLK_DIVISOR_SHIFT)
-
-/* m<x>div, ndiv_dither_mfb, ndiv_mode, ndiv_int */
#define PMU1_PLL0_PLLCTL2 2
-#define PMU1_PLL0_PC2_M5DIV_MASK 0x000000ff
-#define PMU1_PLL0_PC2_M5DIV_SHIFT 0
-#define PMU1_PLL0_PC2_M6DIV_MASK 0x0000ff00
-#define PMU1_PLL0_PC2_M6DIV_SHIFT 8
-#define PMU1_PLL0_PC2_NDIV_MODE_MASK 0x000e0000
-#define PMU1_PLL0_PC2_NDIV_MODE_SHIFT 17
-#define PMU1_PLL0_PC2_NDIV_MODE_MASH 1
-#define PMU1_PLL0_PC2_NDIV_MODE_MFB 2 /* recommended for 4319 */
-#define PMU1_PLL0_PC2_NDIV_INT_MASK 0x1ff00000
-#define PMU1_PLL0_PC2_NDIV_INT_SHIFT 20
-
-/* ndiv_frac */
#define PMU1_PLL0_PLLCTL3 3
-#define PMU1_PLL0_PC3_NDIV_FRAC_MASK 0x00ffffff
-#define PMU1_PLL0_PC3_NDIV_FRAC_SHIFT 0
-
-/* pll_ctrl */
#define PMU1_PLL0_PLLCTL4 4
-
-/* pll_ctrl, vco_rng, clkdrive_ch<x> */
#define PMU1_PLL0_PLLCTL5 5
-#define PMU1_PLL0_PC5_CLK_DRV_MASK 0xffffff00
-#define PMU1_PLL0_PC5_CLK_DRV_SHIFT 8
-
-/* PMU rev 2 control words */
-#define PMU2_PHY_PLL_PLLCTL 4
-#define PMU2_SI_PLL_PLLCTL 10
-
-/* PMU rev 2 */
-/* pllcontrol registers */
-/* ndiv_pwrdn, pwrdn_ch<x>, refcomp_pwrdn, dly_ch<x>, p1div, p2div, _bypass_sdmod */
-#define PMU2_PLL_PLLCTL0 0
-#define PMU2_PLL_PC0_P1DIV_MASK 0x00f00000
-#define PMU2_PLL_PC0_P1DIV_SHIFT 20
-#define PMU2_PLL_PC0_P2DIV_MASK 0x0f000000
-#define PMU2_PLL_PC0_P2DIV_SHIFT 24
-
-/* m<x>div */
-#define PMU2_PLL_PLLCTL1 1
-#define PMU2_PLL_PC1_M1DIV_MASK 0x000000ff
-#define PMU2_PLL_PC1_M1DIV_SHIFT 0
-#define PMU2_PLL_PC1_M2DIV_MASK 0x0000ff00
-#define PMU2_PLL_PC1_M2DIV_SHIFT 8
-#define PMU2_PLL_PC1_M3DIV_MASK 0x00ff0000
-#define PMU2_PLL_PC1_M3DIV_SHIFT 16
-#define PMU2_PLL_PC1_M4DIV_MASK 0xff000000
-#define PMU2_PLL_PC1_M4DIV_SHIFT 24
-
-/* m<x>div, ndiv_dither_mfb, ndiv_mode, ndiv_int */
-#define PMU2_PLL_PLLCTL2 2
-#define PMU2_PLL_PC2_M5DIV_MASK 0x000000ff
-#define PMU2_PLL_PC2_M5DIV_SHIFT 0
-#define PMU2_PLL_PC2_M6DIV_MASK 0x0000ff00
-#define PMU2_PLL_PC2_M6DIV_SHIFT 8
-#define PMU2_PLL_PC2_NDIV_MODE_MASK 0x000e0000
-#define PMU2_PLL_PC2_NDIV_MODE_SHIFT 17
-#define PMU2_PLL_PC2_NDIV_INT_MASK 0x1ff00000
-#define PMU2_PLL_PC2_NDIV_INT_SHIFT 20
-
-/* ndiv_frac */
-#define PMU2_PLL_PLLCTL3 3
-#define PMU2_PLL_PC3_NDIV_FRAC_MASK 0x00ffffff
-#define PMU2_PLL_PC3_NDIV_FRAC_SHIFT 0
-
-/* pll_ctrl */
-#define PMU2_PLL_PLLCTL4 4
-
-/* pll_ctrl, vco_rng, clkdrive_ch<x> */
-#define PMU2_PLL_PLLCTL5 5
-#define PMU2_PLL_PC5_CLKDRIVE_CH1_MASK 0x00000f00
-#define PMU2_PLL_PC5_CLKDRIVE_CH1_SHIFT 8
-#define PMU2_PLL_PC5_CLKDRIVE_CH2_MASK 0x0000f000
-#define PMU2_PLL_PC5_CLKDRIVE_CH2_SHIFT 12
-#define PMU2_PLL_PC5_CLKDRIVE_CH3_MASK 0x000f0000
-#define PMU2_PLL_PC5_CLKDRIVE_CH3_SHIFT 16
-#define PMU2_PLL_PC5_CLKDRIVE_CH4_MASK 0x00f00000
-#define PMU2_PLL_PC5_CLKDRIVE_CH4_SHIFT 20
-#define PMU2_PLL_PC5_CLKDRIVE_CH5_MASK 0x0f000000
-#define PMU2_PLL_PC5_CLKDRIVE_CH5_SHIFT 24
-#define PMU2_PLL_PC5_CLKDRIVE_CH6_MASK 0xf0000000
-#define PMU2_PLL_PC5_CLKDRIVE_CH6_SHIFT 28
-
-/* PMU rev 5 (& 6) */
-#define PMU5_PLL_P1P2_OFF 0
-#define PMU5_PLL_P1_MASK 0x0f000000
-#define PMU5_PLL_P1_SHIFT 24
-#define PMU5_PLL_P2_MASK 0x00f00000
-#define PMU5_PLL_P2_SHIFT 20
-#define PMU5_PLL_M14_OFF 1
-#define PMU5_PLL_MDIV_MASK 0x000000ff
-#define PMU5_PLL_MDIV_WIDTH 8
-#define PMU5_PLL_NM5_OFF 2
-#define PMU5_PLL_NDIV_MASK 0xfff00000
-#define PMU5_PLL_NDIV_SHIFT 20
-#define PMU5_PLL_NDIV_MODE_MASK 0x000e0000
-#define PMU5_PLL_NDIV_MODE_SHIFT 17
-#define PMU5_PLL_FMAB_OFF 3
-#define PMU5_PLL_MRAT_MASK 0xf0000000
-#define PMU5_PLL_MRAT_SHIFT 28
-#define PMU5_PLL_ABRAT_MASK 0x08000000
-#define PMU5_PLL_ABRAT_SHIFT 27
-#define PMU5_PLL_FDIV_MASK 0x07ffffff
-#define PMU5_PLL_PLLCTL_OFF 4
-#define PMU5_PLL_PCHI_OFF 5
-#define PMU5_PLL_PCHI_MASK 0x0000003f
/* pmu XtalFreqRatio */
#define PMU_XTALFREQ_REG_ILPCTR_MASK 0x00001FFF
#define PMU_XTALFREQ_REG_MEASURE_MASK 0x80000000
#define PMU_XTALFREQ_REG_MEASURE_SHIFT 31
-/* Divider allocation in 4716/47162/5356/5357 */
-#define PMU5_MAINPLL_CPU 1
-#define PMU5_MAINPLL_MEM 2
-#define PMU5_MAINPLL_SI 3
-
-#define PMU7_PLL_PLLCTL7 7
-#define PMU7_PLL_PLLCTL8 8
-#define PMU7_PLL_PLLCTL11 11
-
-/* PLL usage in 4716/47162 */
-#define PMU4716_MAINPLL_PLL0 12
-
-/* PLL usage in 5356/5357 */
-#define PMU5356_MAINPLL_PLL0 0
-#define PMU5357_MAINPLL_PLL0 0
-
-/* 4328 resources */
-#define RES4328_EXT_SWITCHER_PWM 0 /* 0x00001 */
-#define RES4328_BB_SWITCHER_PWM 1 /* 0x00002 */
-#define RES4328_BB_SWITCHER_BURST 2 /* 0x00004 */
-#define RES4328_BB_EXT_SWITCHER_BURST 3 /* 0x00008 */
-#define RES4328_ILP_REQUEST 4 /* 0x00010 */
-#define RES4328_RADIO_SWITCHER_PWM 5 /* 0x00020 */
-#define RES4328_RADIO_SWITCHER_BURST 6 /* 0x00040 */
-#define RES4328_ROM_SWITCH 7 /* 0x00080 */
-#define RES4328_PA_REF_LDO 8 /* 0x00100 */
-#define RES4328_RADIO_LDO 9 /* 0x00200 */
-#define RES4328_AFE_LDO 10 /* 0x00400 */
-#define RES4328_PLL_LDO 11 /* 0x00800 */
-#define RES4328_BG_FILTBYP 12 /* 0x01000 */
-#define RES4328_TX_FILTBYP 13 /* 0x02000 */
-#define RES4328_RX_FILTBYP 14 /* 0x04000 */
-#define RES4328_XTAL_PU 15 /* 0x08000 */
-#define RES4328_XTAL_EN 16 /* 0x10000 */
-#define RES4328_BB_PLL_FILTBYP 17 /* 0x20000 */
-#define RES4328_RF_PLL_FILTBYP 18 /* 0x40000 */
-#define RES4328_BB_PLL_PU 19 /* 0x80000 */
-
-/* 4325 A0/A1 resources */
-#define RES4325_BUCK_BOOST_BURST 0 /* 0x00000001 */
-#define RES4325_CBUCK_BURST 1 /* 0x00000002 */
-#define RES4325_CBUCK_PWM 2 /* 0x00000004 */
-#define RES4325_CLDO_CBUCK_BURST 3 /* 0x00000008 */
-#define RES4325_CLDO_CBUCK_PWM 4 /* 0x00000010 */
-#define RES4325_BUCK_BOOST_PWM 5 /* 0x00000020 */
-#define RES4325_ILP_REQUEST 6 /* 0x00000040 */
-#define RES4325_ABUCK_BURST 7 /* 0x00000080 */
-#define RES4325_ABUCK_PWM 8 /* 0x00000100 */
-#define RES4325_LNLDO1_PU 9 /* 0x00000200 */
-#define RES4325_OTP_PU 10 /* 0x00000400 */
-#define RES4325_LNLDO3_PU 11 /* 0x00000800 */
-#define RES4325_LNLDO4_PU 12 /* 0x00001000 */
-#define RES4325_XTAL_PU 13 /* 0x00002000 */
-#define RES4325_ALP_AVAIL 14 /* 0x00004000 */
-#define RES4325_RX_PWRSW_PU 15 /* 0x00008000 */
-#define RES4325_TX_PWRSW_PU 16 /* 0x00010000 */
-#define RES4325_RFPLL_PWRSW_PU 17 /* 0x00020000 */
-#define RES4325_LOGEN_PWRSW_PU 18 /* 0x00040000 */
-#define RES4325_AFE_PWRSW_PU 19 /* 0x00080000 */
-#define RES4325_BBPLL_PWRSW_PU 20 /* 0x00100000 */
-#define RES4325_HT_AVAIL 21 /* 0x00200000 */
-
-/* 4325 B0/C0 resources */
-#define RES4325B0_CBUCK_LPOM 1 /* 0x00000002 */
-#define RES4325B0_CBUCK_BURST 2 /* 0x00000004 */
-#define RES4325B0_CBUCK_PWM 3 /* 0x00000008 */
-#define RES4325B0_CLDO_PU 4 /* 0x00000010 */
-
-/* 4325 C1 resources */
-#define RES4325C1_LNLDO2_PU 12 /* 0x00001000 */
-
-#define RES4329_RESERVED0 0 /* 0x00000001 */
-#define RES4329_CBUCK_LPOM 1 /* 0x00000002 */
-#define RES4329_CBUCK_BURST 2 /* 0x00000004 */
-#define RES4329_CBUCK_PWM 3 /* 0x00000008 */
-#define RES4329_CLDO_PU 4 /* 0x00000010 */
-#define RES4329_PALDO_PU 5 /* 0x00000020 */
-#define RES4329_ILP_REQUEST 6 /* 0x00000040 */
-#define RES4329_RESERVED7 7 /* 0x00000080 */
-#define RES4329_RESERVED8 8 /* 0x00000100 */
-#define RES4329_LNLDO1_PU 9 /* 0x00000200 */
-#define RES4329_OTP_PU 10 /* 0x00000400 */
-#define RES4329_RESERVED11 11 /* 0x00000800 */
-#define RES4329_LNLDO2_PU 12 /* 0x00001000 */
-#define RES4329_XTAL_PU 13 /* 0x00002000 */
-#define RES4329_ALP_AVAIL 14 /* 0x00004000 */
-#define RES4329_RX_PWRSW_PU 15 /* 0x00008000 */
-#define RES4329_TX_PWRSW_PU 16 /* 0x00010000 */
-#define RES4329_RFPLL_PWRSW_PU 17 /* 0x00020000 */
-#define RES4329_LOGEN_PWRSW_PU 18 /* 0x00040000 */
-#define RES4329_AFE_PWRSW_PU 19 /* 0x00080000 */
-#define RES4329_BBPLL_PWRSW_PU 20 /* 0x00100000 */
-#define RES4329_HT_AVAIL 21 /* 0x00200000 */
-
-/* 4315 resources */
-#define RES4315_CBUCK_LPOM 1 /* 0x00000002 */
-#define RES4315_CBUCK_BURST 2 /* 0x00000004 */
-#define RES4315_CBUCK_PWM 3 /* 0x00000008 */
-#define RES4315_CLDO_PU 4 /* 0x00000010 */
-#define RES4315_PALDO_PU 5 /* 0x00000020 */
-#define RES4315_ILP_REQUEST 6 /* 0x00000040 */
-#define RES4315_LNLDO1_PU 9 /* 0x00000200 */
-#define RES4315_OTP_PU 10 /* 0x00000400 */
-#define RES4315_LNLDO2_PU 12 /* 0x00001000 */
-#define RES4315_XTAL_PU 13 /* 0x00002000 */
-#define RES4315_ALP_AVAIL 14 /* 0x00004000 */
-#define RES4315_RX_PWRSW_PU 15 /* 0x00008000 */
-#define RES4315_TX_PWRSW_PU 16 /* 0x00010000 */
-#define RES4315_RFPLL_PWRSW_PU 17 /* 0x00020000 */
-#define RES4315_LOGEN_PWRSW_PU 18 /* 0x00040000 */
-#define RES4315_AFE_PWRSW_PU 19 /* 0x00080000 */
-#define RES4315_BBPLL_PWRSW_PU 20 /* 0x00100000 */
-#define RES4315_HT_AVAIL 21 /* 0x00200000 */
-
-/* 4319 resources */
-#define RES4319_CBUCK_LPOM 1 /* 0x00000002 */
-#define RES4319_CBUCK_BURST 2 /* 0x00000004 */
-#define RES4319_CBUCK_PWM 3 /* 0x00000008 */
-#define RES4319_CLDO_PU 4 /* 0x00000010 */
-#define RES4319_PALDO_PU 5 /* 0x00000020 */
-#define RES4319_ILP_REQUEST 6 /* 0x00000040 */
-#define RES4319_LNLDO1_PU 9 /* 0x00000200 */
-#define RES4319_OTP_PU 10 /* 0x00000400 */
-#define RES4319_LNLDO2_PU 12 /* 0x00001000 */
-#define RES4319_XTAL_PU 13 /* 0x00002000 */
-#define RES4319_ALP_AVAIL 14 /* 0x00004000 */
-#define RES4319_RX_PWRSW_PU 15 /* 0x00008000 */
-#define RES4319_TX_PWRSW_PU 16 /* 0x00010000 */
-#define RES4319_RFPLL_PWRSW_PU 17 /* 0x00020000 */
-#define RES4319_LOGEN_PWRSW_PU 18 /* 0x00040000 */
-#define RES4319_AFE_PWRSW_PU 19 /* 0x00080000 */
-#define RES4319_BBPLL_PWRSW_PU 20 /* 0x00100000 */
-#define RES4319_HT_AVAIL 21 /* 0x00200000 */
-
-#define CCTL_4319USB_XTAL_SEL_MASK 0x00180000
-#define CCTL_4319USB_XTAL_SEL_SHIFT 19
-#define CCTL_4319USB_48MHZ_PLL_SEL 1
-#define CCTL_4319USB_24MHZ_PLL_SEL 2
-
-/* PMU resources for 4336 */
-#define RES4336_CBUCK_LPOM 0
-#define RES4336_CBUCK_BURST 1
-#define RES4336_CBUCK_LP_PWM 2
-#define RES4336_CBUCK_PWM 3
-#define RES4336_CLDO_PU 4
-#define RES4336_DIS_INT_RESET_PD 5
-#define RES4336_ILP_REQUEST 6
-#define RES4336_LNLDO_PU 7
-#define RES4336_LDO3P3_PU 8
-#define RES4336_OTP_PU 9
-#define RES4336_XTAL_PU 10
-#define RES4336_ALP_AVAIL 11
-#define RES4336_RADIO_PU 12
-#define RES4336_BG_PU 13
-#define RES4336_VREG1p4_PU_PU 14
-#define RES4336_AFE_PWRSW_PU 15
-#define RES4336_RX_PWRSW_PU 16
-#define RES4336_TX_PWRSW_PU 17
-#define RES4336_BB_PWRSW_PU 18
-#define RES4336_SYNTH_PWRSW_PU 19
-#define RES4336_MISC_PWRSW_PU 20
-#define RES4336_LOGEN_PWRSW_PU 21
-#define RES4336_BBPLL_PWRSW_PU 22
-#define RES4336_MACPHY_CLKAVAIL 23
-#define RES4336_HT_AVAIL 24
-#define RES4336_RSVD 25
-
-/* 4330 resources */
-#define RES4330_CBUCK_LPOM 0
-#define RES4330_CBUCK_BURST 1
-#define RES4330_CBUCK_LP_PWM 2
-#define RES4330_CBUCK_PWM 3
-#define RES4330_CLDO_PU 4
-#define RES4330_DIS_INT_RESET_PD 5
-#define RES4330_ILP_REQUEST 6
-#define RES4330_LNLDO_PU 7
-#define RES4330_LDO3P3_PU 8
-#define RES4330_OTP_PU 9
-#define RES4330_XTAL_PU 10
-#define RES4330_ALP_AVAIL 11
-#define RES4330_RADIO_PU 12
-#define RES4330_BG_PU 13
-#define RES4330_VREG1p4_PU_PU 14
-#define RES4330_AFE_PWRSW_PU 15
-#define RES4330_RX_PWRSW_PU 16
-#define RES4330_TX_PWRSW_PU 17
-#define RES4330_BB_PWRSW_PU 18
-#define RES4330_SYNTH_PWRSW_PU 19
-#define RES4330_MISC_PWRSW_PU 20
-#define RES4330_LOGEN_PWRSW_PU 21
-#define RES4330_BBPLL_PWRSW_PU 22
-#define RES4330_MACPHY_CLKAVAIL 23
-#define RES4330_HT_AVAIL 24
-#define RES4330_5gRX_PWRSW_PU 25
-#define RES4330_5gTX_PWRSW_PU 26
-#define RES4330_5g_LOGEN_PWRSW_PU 27
-
/* 4313 resources */
#define RES4313_BB_PU_RSRC 0
#define RES4313_ILP_REQ_RSRC 1
@@ -593,9 +105,6 @@
#define RES4313_HT_AVAIL_RSRC 14
#define RES4313_MACPHY_CLK_AVAIL_RSRC 15
-/* PMU resource up transition time in ILP cycles */
-#define PMURES_UP_TRANSITION 2
-
/* Determine min/max rsrc masks. Value 0 leaves hardware at default. */
static void si_pmu_res_masks(struct si_pub *sih, u32 * pmin, u32 * pmax)
{
--
1.7.1
From: Roland Vossen <[email protected]>
Code cleanup. Decreases amd64 compiler warnings.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 12 +++++-------
1 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 9ac256e..9bc47a4 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -552,8 +552,6 @@ struct brcmf_bus {
uint varsz; /* Size of variables buffer */
u32 sbaddr; /* Current SB window pointer (-1, invalid) */
- /* SDIO core, 32 bit address on the backplane bus: */
- struct sdpcmd_regs *regs;
uint sdpcmrev; /* SDIO core revision */
uint armrev; /* CPU core revision */
uint ramrev; /* SOCRAM core revision */
@@ -2725,7 +2723,7 @@ brcmf_sdbrcm_doiovar(struct brcmf_bus *bus, const struct brcmu_iovar *vi, u32 ac
sd_ptr = (struct brcmf_sdreg *) params;
- addr = (unsigned long)bus->regs + sd_ptr->offset;
+ addr = bus->ci->buscorebase + sd_ptr->offset;
size = sd_ptr->func;
int_val = (s32) brcmf_sdcard_reg_read(bus->card, addr,
size);
@@ -2742,7 +2740,7 @@ brcmf_sdbrcm_doiovar(struct brcmf_bus *bus, const struct brcmu_iovar *vi, u32 ac
sd_ptr = (struct brcmf_sdreg *) params;
- addr = (unsigned long)bus->regs + sd_ptr->offset;
+ addr = bus->ci->buscorebase + sd_ptr->offset;
size = sd_ptr->func;
brcmf_sdcard_reg_write(bus->card, addr, size,
sd_ptr->value);
@@ -5610,10 +5608,10 @@ brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, void *card, void *regsva,
bus->ramsize, bus->orig_ramsize));
}
- bus->regs = (void *)bus->ci->buscorebase;
-
/* Set core control so an SDIO reset does a backplane reset */
- OR_REG((u32)&bus->regs->corecontrol, CC_BPRESEN, u32);
+ OR_REG(bus->ci->buscorebase + offsetof(struct sdpcmd_regs,
+ corecontrol),
+ CC_BPRESEN, u32);
brcmu_pktq_init(&bus->txq, (PRIOMASK + 1), TXQLEN);
--
1.7.1
From: Arend van Spriel <[email protected]>
The brcmsmac driver code contains code fragments for chipsets that are not
supported. These have been removed from the brcmsmac source files.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/aiutils.c | 52 +-------------------------
drivers/staging/brcm80211/brcmsmac/bmac.c | 6 +--
drivers/staging/brcm80211/brcmsmac/main.c | 10 +----
3 files changed, 4 insertions(+), 64 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/aiutils.c b/drivers/staging/brcm80211/brcmsmac/aiutils.c
index 82809cb..d41104f 100644
--- a/drivers/staging/brcm80211/brcmsmac/aiutils.c
+++ b/drivers/staging/brcm80211/brcmsmac/aiutils.c
@@ -1157,25 +1157,6 @@ static si_info_t *ai_doattach(si_info_t *sii,
goto exit;
}
- /* assume current core is CC */
- if ((sii->pub.ccrev == 0x25)
- &&
- ((sih->chip == BCM43236_CHIP_ID
- || sih->chip == BCM43235_CHIP_ID
- || sih->chip == BCM43238_CHIP_ID)
- && (sii->pub.chiprev <= 2))) {
-
- if ((cc->chipstatus & CST43236_BP_CLK) != 0) {
- uint clkdiv;
- clkdiv = R_REG(&cc->clkdiv);
- /* otp_clk_div is even number, 120/14 < 9mhz */
- clkdiv = (clkdiv & ~CLKD_OTP) | (14 << CLKD_OTP_SHIFT);
- W_REG(&cc->clkdiv, clkdiv);
- SI_ERROR(("%s: set clkdiv to %x\n", __func__, clkdiv));
- }
- udelay(10);
- }
-
/* Init nvram from sprom/otp if they exist */
if (srom_var_init
(&sii->pub, bustype, regs, vars, varsz)) {
@@ -1215,8 +1196,7 @@ static si_info_t *ai_doattach(si_info_t *sii,
pcicore_attach(sii->pch, pvars, SI_DOATTACH);
}
- if ((sih->chip == BCM43224_CHIP_ID) ||
- (sih->chip == BCM43421_CHIP_ID)) {
+ if (sih->chip == BCM43224_CHIP_ID) {
/*
* enable 12 mA drive strenth for 43224 and
* set chipControl register bit 15
@@ -1247,11 +1227,6 @@ static si_info_t *ai_doattach(si_info_t *sii,
CCTRL_4313_12MA_LED_DRIVE);
}
- if (sih->chip == BCM4331_CHIP_ID) {
- /* Enable Ext PA lines depending on chip package option */
- ai_chipcontrl_epa4331(sih, true);
- }
-
return sii;
exit:
if (sih->bustype == PCI_BUS) {
@@ -2283,18 +2258,8 @@ bool ai_is_sprom_available(struct si_pub *sih)
}
switch (sih->chip) {
- case BCM4329_CHIP_ID:
- return (sih->chipst & CST4329_SPROM_SEL) != 0;
- case BCM4319_CHIP_ID:
- return (sih->chipst & CST4319_SPROM_SEL) != 0;
- case BCM4336_CHIP_ID:
- return (sih->chipst & CST4336_SPROM_PRESENT) != 0;
- case BCM4330_CHIP_ID:
- return (sih->chipst & CST4330_SPROM_PRESENT) != 0;
case BCM4313_CHIP_ID:
return (sih->chipst & CST4313_SPROM_PRESENT) != 0;
- case BCM4331_CHIP_ID:
- return (sih->chipst & CST4331_SPROM_PRESENT) != 0;
default:
return true;
}
@@ -2303,26 +2268,11 @@ bool ai_is_sprom_available(struct si_pub *sih)
bool ai_is_otp_disabled(struct si_pub *sih)
{
switch (sih->chip) {
- case BCM4329_CHIP_ID:
- return (sih->chipst & CST4329_SPROM_OTP_SEL_MASK) ==
- CST4329_OTP_PWRDN;
- case BCM4319_CHIP_ID:
- return (sih->chipst & CST4319_SPROM_OTP_SEL_MASK) ==
- CST4319_OTP_PWRDN;
- case BCM4336_CHIP_ID:
- return (sih->chipst & CST4336_OTP_PRESENT) == 0;
- case BCM4330_CHIP_ID:
- return (sih->chipst & CST4330_OTP_PRESENT) == 0;
case BCM4313_CHIP_ID:
return (sih->chipst & CST4313_OTP_PRESENT) == 0;
/* These chips always have their OTP on */
case BCM43224_CHIP_ID:
case BCM43225_CHIP_ID:
- case BCM43421_CHIP_ID:
- case BCM43235_CHIP_ID:
- case BCM43236_CHIP_ID:
- case BCM43238_CHIP_ID:
- case BCM4331_CHIP_ID:
default:
return false;
}
diff --git a/drivers/staging/brcm80211/brcmsmac/bmac.c b/drivers/staging/brcm80211/brcmsmac/bmac.c
index f8878c7..735230f 100644
--- a/drivers/staging/brcm80211/brcmsmac/bmac.c
+++ b/drivers/staging/brcm80211/brcmsmac/bmac.c
@@ -1980,8 +1980,7 @@ bool brcms_b_radio_read_hwdisabled(struct brcms_c_hw_info *wlc_hw)
/* AI chip doesn't restore bar0win2 on hibernation/resume, need sw fixup */
if ((wlc_hw->sih->chip == BCM43224_CHIP_ID) ||
- (wlc_hw->sih->chip == BCM43225_CHIP_ID) ||
- (wlc_hw->sih->chip == BCM43421_CHIP_ID))
+ (wlc_hw->sih->chip == BCM43225_CHIP_ID))
wlc_hw->regs =
(d11regs_t *) ai_setcore(wlc_hw->sih, D11_CORE_ID,
0);
@@ -2022,8 +2021,7 @@ void brcms_b_hw_up(struct brcms_c_hw_info *wlc_hw)
/* AI chip doesn't restore bar0win2 on hibernation/resume, need sw fixup */
if ((wlc_hw->sih->chip == BCM43224_CHIP_ID) ||
- (wlc_hw->sih->chip == BCM43225_CHIP_ID) ||
- (wlc_hw->sih->chip == BCM43421_CHIP_ID))
+ (wlc_hw->sih->chip == BCM43225_CHIP_ID))
wlc_hw->regs =
(d11regs_t *) ai_setcore(wlc_hw->sih, D11_CORE_ID,
0);
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index 611873c..ca9f195 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -1586,15 +1586,7 @@ void *brcms_c_attach(struct brcms_info *wl, u16 vendor, u16 device, uint unit,
/* initialize radio_mpc_disable according to wlc->mpc */
brcms_c_radio_mpc_upd(wlc);
-
- if ((wlc->pub->sih->chip) == BCM43235_CHIP_ID) {
- if ((getintvar(wlc->pub->vars, "aa2g") == 7) ||
- (getintvar(wlc->pub->vars, "aa5g") == 7)) {
- brcms_b_antsel_set(wlc->hw, 1);
- }
- } else {
- brcms_b_antsel_set(wlc->hw, wlc->asi->antsel_avail);
- }
+ brcms_b_antsel_set(wlc->hw, wlc->asi->antsel_avail);
if (perr)
*perr = 0;
--
1.7.1
From: Arend van Spriel <[email protected]>
The linux native ethertype ETH_P_LINK_CTL is matching ETH_P_BRCM so
lets use that definition and get rid of ETH_P_BRCM.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 19e09bd..c3cbda6 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -43,8 +43,6 @@
#include "dhd_dbg.h"
#include "wl_cfg80211.h"
-#define ETH_P_BRCM 0x886c
-
/* Global ASSERT type flag */
u32 g_assert_type;
@@ -947,7 +945,7 @@ void brcmf_rx_frame(dhd_pub_t *dhdp, int ifidx, struct sk_buff *skb,
skb_pull(skb, ETH_HLEN);
/* Process special event packets and then discard them */
- if (ntohs(skb->protocol) == ETH_P_BRCM)
+ if (ntohs(skb->protocol) == ETH_P_LINK_CTL)
brcmf_host_event(dhd, &ifidx,
skb_mac_header(skb),
&event, &data);
--
1.7.1
From: Henry Ptasinski <[email protected]>
The structure of the function made it difficult to understand, so reorganize it
to make it clearer.
Reported-by: Greg Dietsche <[email protected]>
Signed-off-by: Henry Ptasinski <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/bmac.c | 35 ++++++++++++++++------------
1 files changed, 20 insertions(+), 15 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/bmac.c b/drivers/staging/brcm80211/brcmsmac/bmac.c
index f44f581..4a220d4 100644
--- a/drivers/staging/brcm80211/brcmsmac/bmac.c
+++ b/drivers/staging/brcm80211/brcmsmac/bmac.c
@@ -1905,28 +1905,33 @@ static bool brcms_c_isgoodchip(struct brcms_c_hw_info *wlc_hw)
return true;
}
+/* Validate some board info parameters */
static bool brcms_c_validboardtype(struct brcms_c_hw_info *wlc_hw)
{
- bool goodboard = true;
uint boardrev = wlc_hw->boardrev;
+ /* 4 bits each for board type, major, minor, and tiny version */
+ uint brt = (boardrev & 0xf000) >> 12;
+ uint b0 = (boardrev & 0xf00) >> 8;
+ uint b1 = (boardrev & 0xf0) >> 4;
+ uint b2 = boardrev & 0xf;
+
+ /* voards from other vendors are always considered valid */
+ if (wlc_hw->sih->boardvendor != PCI_VENDOR_ID_BROADCOM)
+ return true;
+
+ /* do some boardrev sanity checks when boardvendor is Broadcom */
if (boardrev == 0)
- goodboard = false;
- else if (boardrev > 0xff) {
- uint brt = (boardrev & 0xf000) >> 12;
- uint b0 = (boardrev & 0xf00) >> 8;
- uint b1 = (boardrev & 0xf0) >> 4;
- uint b2 = boardrev & 0xf;
+ return false;
- if ((brt > 2) || (brt == 0) || (b0 > 9) || (b0 == 0) || (b1 > 9)
- || (b2 > 9))
- goodboard = false;
- }
+ if (boardrev <= 0xff)
+ return true;
- if (wlc_hw->sih->boardvendor != PCI_VENDOR_ID_BROADCOM)
- return goodboard;
+ if ((brt > 2) || (brt == 0) || (b0 > 9) || (b0 == 0) || (b1 > 9)
+ || (b2 > 9))
+ return false;
- return goodboard;
+ return true;
}
static char *brcms_c_get_macaddr(struct brcms_c_hw_info *wlc_hw)
--
1.7.1
On Wed, Jun 29, 2011 at 04:46:41PM -0700, Franky Lin wrote:
> #define FOREACH_BSS(wlc, idx, cfg) \
> - for (idx = 0; (int) idx < WLC_MAXBSSCFG; idx++) \
> - if ((cfg = (wlc)->bsscfg[idx]))
> + for (idx = 0, cfg = (wlc)->bsscfg[idx]; \
> + idx < WLC_MAXBSSCFG; cfg = (wlc)->bsscfg[++idx]) \
> + if (cfg)
>
That's pretty ugly. Better to leave the original in and ignore the
checkpatch warning. Or maybe do something like this:
for (idx = 0; (int) idx < WLC_MAXBSSCFG; idx++) { \
cfg = (wlc)->bsscfg[idx]; \
if (!cfg) \
continue; \
Then #define END_FOREACH_BSS() }
Btw, this patchset has over 100 patches so unless there is something
drastically wrong lets just apply it as is and fix up any complaints
that people have in later patches. It sucks when people resend huge
patchsets and we have to review everything again.
regards,
dan carpenter
From: Roland Vossen <[email protected]>
Code cleanup. This was a Broadcom specific acronym.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 282 ++++++++++----------
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c | 14 +-
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 35 ++--
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h | 16 +-
.../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c | 27 +-
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 34 ++--
drivers/staging/brcm80211/brcmfmac/sdio_host.h | 47 ++--
7 files changed, 225 insertions(+), 230 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
index d785b05..5eb95b2 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
@@ -13,7 +13,7 @@
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* ****************** BCMSDH Interface Functions *************************** */
+/* ****************** SDIOCARD Interface Functions ***************************/
#include <linux/types.h>
#include <linux/netdevice.h>
@@ -31,7 +31,7 @@
#include "dhd.h"
#define SDIOH_API_ACCESS_RETRY_LIMIT 2
-const uint bcmsdh_msglevel = BCMSDH_ERROR_VAL;
+const uint brcmf_sdio_msglevel = BRCMF_SD_ERROR_VAL;
struct brcmf_sdio {
bool init_success; /* underlying driver successfully attached */
@@ -42,49 +42,49 @@ struct brcmf_sdio {
u32 sbwad; /* Save backplane window address */
};
/* local copy of bcm sd handler */
-struct brcmf_sdio *l_bcmsdh;
+static struct brcmf_sdio *l_card;
struct brcmf_sdio *brcmf_sdcard_attach(void *cfghdl, void **regsva, uint irq)
{
- struct brcmf_sdio *bcmsdh;
+ struct brcmf_sdio *card;
- bcmsdh = kzalloc(sizeof(struct brcmf_sdio), GFP_ATOMIC);
- if (bcmsdh == NULL) {
- BCMSDH_ERROR(("bcmsdh_attach: out of memory"));
+ card = kzalloc(sizeof(struct brcmf_sdio), GFP_ATOMIC);
+ if (card == NULL) {
+ BRCMF_SD_ERROR(("sdcard_attach: out of memory"));
return NULL;
}
/* save the handler locally */
- l_bcmsdh = bcmsdh;
+ l_card = card;
- bcmsdh->sdioh = brcmf_sdioh_attach(cfghdl, irq);
- if (!bcmsdh->sdioh) {
- brcmf_sdcard_detach(bcmsdh);
+ card->sdioh = brcmf_sdioh_attach(cfghdl, irq);
+ if (!card->sdioh) {
+ brcmf_sdcard_detach(card);
return NULL;
}
- bcmsdh->init_success = true;
+ card->init_success = true;
*regsva = (u32 *) SI_ENUM_BASE;
/* Report the BAR, to fix if needed */
- bcmsdh->sbwad = SI_ENUM_BASE;
- return bcmsdh;
+ card->sbwad = SI_ENUM_BASE;
+ return card;
}
int brcmf_sdcard_detach(void *sdh)
{
- struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+ struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
- if (bcmsdh != NULL) {
- if (bcmsdh->sdioh) {
- brcmf_sdioh_detach(bcmsdh->sdioh);
- bcmsdh->sdioh = NULL;
+ if (card != NULL) {
+ if (card->sdioh) {
+ brcmf_sdioh_detach(card->sdioh);
+ card->sdioh = NULL;
}
- kfree(bcmsdh);
+ kfree(card);
}
- l_bcmsdh = NULL;
+ l_card = NULL;
return 0;
}
@@ -92,19 +92,19 @@ int
brcmf_sdcard_iovar_op(void *sdh, const char *name,
void *params, int plen, void *arg, int len, bool set)
{
- struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- return brcmf_sdioh_iovar_op(bcmsdh->sdioh, name, params, plen, arg,
+ struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
+ return brcmf_sdioh_iovar_op(card->sdioh, name, params, plen, arg,
len, set);
}
bool brcmf_sdcard_intr_query(void *sdh)
{
- struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+ struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
int status;
bool on;
- ASSERT(bcmsdh);
- status = brcmf_sdioh_interrupt_query(bcmsdh->sdioh, &on);
+ ASSERT(card);
+ status = brcmf_sdioh_interrupt_query(card->sdioh, &on);
if (status == 0)
return false;
else
@@ -113,47 +113,47 @@ bool brcmf_sdcard_intr_query(void *sdh)
int brcmf_sdcard_intr_enable(void *sdh)
{
- struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- ASSERT(bcmsdh);
+ struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
+ ASSERT(card);
- return brcmf_sdioh_interrupt_set(bcmsdh->sdioh, true);
+ return brcmf_sdioh_interrupt_set(card->sdioh, true);
}
int brcmf_sdcard_intr_disable(void *sdh)
{
- struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- ASSERT(bcmsdh);
+ struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
+ ASSERT(card);
- return brcmf_sdioh_interrupt_set(bcmsdh->sdioh, false);
+ return brcmf_sdioh_interrupt_set(card->sdioh, false);
}
-int brcmf_sdcard_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
+int brcmf_sdcard_intr_reg(void *sdh, brcmf_sdiocard_cb_fn_t fn, void *argh)
{
- struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- ASSERT(bcmsdh);
+ struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
+ ASSERT(card);
- return brcmf_sdioh_interrupt_register(bcmsdh->sdioh, fn, argh);
+ return brcmf_sdioh_interrupt_register(card->sdioh, fn, argh);
}
int brcmf_sdcard_intr_dereg(void *sdh)
{
- struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- ASSERT(bcmsdh);
+ struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
+ ASSERT(card);
- return brcmf_sdioh_interrupt_deregister(bcmsdh->sdioh);
+ return brcmf_sdioh_interrupt_deregister(card->sdioh);
}
#if defined(BCMDBG)
bool brcmf_sdcard_intr_pending(void *sdh)
{
- struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+ struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
ASSERT(sdh);
- return brcmf_sdioh_interrupt_pending(bcmsdh->sdioh);
+ return brcmf_sdioh_interrupt_pending(card->sdioh);
}
#endif
-int brcmf_sdcard_devremove_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
+int brcmf_sdcard_devremove_reg(void *sdh, brcmf_sdiocard_cb_fn_t fn, void *argh)
{
ASSERT(sdh);
@@ -163,17 +163,17 @@ int brcmf_sdcard_devremove_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
u8 brcmf_sdcard_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
{
- struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+ struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
int status;
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
s32 retry = 0;
#endif
u8 data = 0;
- if (!bcmsdh)
- bcmsdh = l_bcmsdh;
+ if (!card)
+ card = l_card;
- ASSERT(bcmsdh->init_success);
+ ASSERT(card->init_success);
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
do {
@@ -181,7 +181,7 @@ u8 brcmf_sdcard_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
udelay(1000);
#endif
status =
- brcmf_sdioh_cfg_read(bcmsdh->sdioh, fnc_num, addr,
+ brcmf_sdioh_cfg_read(card->sdioh, fnc_num, addr,
(u8 *) &data);
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
} while (status != 0
@@ -190,7 +190,7 @@ u8 brcmf_sdcard_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
if (err)
*err = status;
- BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u8data = 0x%x\n",
+ BRCMF_SD_INFO(("%s:fun = %d, addr = 0x%x, u8data = 0x%x\n",
__func__, fnc_num, addr, data));
return data;
@@ -199,16 +199,16 @@ u8 brcmf_sdcard_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
void
brcmf_sdcard_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
{
- struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+ struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
int status;
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
s32 retry = 0;
#endif
- if (!bcmsdh)
- bcmsdh = l_bcmsdh;
+ if (!card)
+ card = l_card;
- ASSERT(bcmsdh->init_success);
+ ASSERT(card->init_success);
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
do {
@@ -216,7 +216,7 @@ brcmf_sdcard_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
udelay(1000);
#endif
status =
- brcmf_sdioh_cfg_write(bcmsdh->sdioh, fnc_num, addr,
+ brcmf_sdioh_cfg_write(card->sdioh, fnc_num, addr,
(u8 *) &data);
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
} while (status != 0
@@ -225,28 +225,28 @@ brcmf_sdcard_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
if (err)
*err = status;
- BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u8data = 0x%x\n",
+ BRCMF_SD_INFO(("%s:fun = %d, addr = 0x%x, u8data = 0x%x\n",
__func__, fnc_num, addr, data));
}
u32 brcmf_sdcard_cfg_read_word(void *sdh, uint fnc_num, u32 addr, int *err)
{
- struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+ struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
int status;
u32 data = 0;
- if (!bcmsdh)
- bcmsdh = l_bcmsdh;
+ if (!card)
+ card = l_card;
- ASSERT(bcmsdh->init_success);
+ ASSERT(card->init_success);
- status = brcmf_sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
+ status = brcmf_sdioh_request_word(card->sdioh, SDIOH_CMD_TYPE_NORMAL,
SDIOH_READ, fnc_num, addr, &data, 4);
if (err)
*err = status;
- BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u32data = 0x%x\n",
+ BRCMF_SD_INFO(("%s:fun = %d, addr = 0x%x, u32data = 0x%x\n",
__func__, fnc_num, addr, data));
return data;
@@ -256,28 +256,28 @@ void
brcmf_sdcard_cfg_write_word(void *sdh, uint fnc_num, u32 addr, u32 data,
int *err)
{
- struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+ struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
int status;
- if (!bcmsdh)
- bcmsdh = l_bcmsdh;
+ if (!card)
+ card = l_card;
- ASSERT(bcmsdh->init_success);
+ ASSERT(card->init_success);
status =
- brcmf_sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
+ brcmf_sdioh_request_word(card->sdioh, SDIOH_CMD_TYPE_NORMAL,
SDIOH_WRITE, fnc_num, addr, &data, 4);
if (err)
*err = status;
- BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u32data = 0x%x\n",
+ BRCMF_SD_INFO(("%s:fun = %d, addr = 0x%x, u32data = 0x%x\n",
__func__, fnc_num, addr, data));
}
int brcmf_sdcard_cis_read(void *sdh, uint func, u8 * cis, uint length)
{
- struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+ struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
int status;
u8 *tmp_buf, *tmp_ptr;
@@ -285,21 +285,21 @@ int brcmf_sdcard_cis_read(void *sdh, uint func, u8 * cis, uint length)
bool ascii = func & ~0xf;
func &= 0x7;
- if (!bcmsdh)
- bcmsdh = l_bcmsdh;
+ if (!card)
+ card = l_card;
- ASSERT(bcmsdh->init_success);
+ ASSERT(card->init_success);
ASSERT(cis);
ASSERT(length <= SBSDIO_CIS_SIZE_LIMIT);
- status = brcmf_sdioh_cis_read(bcmsdh->sdioh, func, cis, length);
+ status = brcmf_sdioh_cis_read(card->sdioh, func, cis, length);
if (ascii) {
/* Move binary bits to tmp and format them
into the provided buffer. */
tmp_buf = kmalloc(length, GFP_ATOMIC);
if (tmp_buf == NULL) {
- BCMSDH_ERROR(("%s: out of memory\n", __func__));
+ BRCMF_SD_ERROR(("%s: out of memory\n", __func__));
return -ENOMEM;
}
memcpy(tmp_buf, cis, length);
@@ -318,16 +318,16 @@ int brcmf_sdcard_cis_read(void *sdh, uint func, u8 * cis, uint length)
static int brcmf_sdcard_set_sbaddr_window(void *sdh, u32 address)
{
int err = 0;
- struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- brcmf_sdcard_cfg_write(bcmsdh, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRLOW,
+ struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
+ brcmf_sdcard_cfg_write(card, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRLOW,
(address >> 8) & SBSDIO_SBADDRLOW_MASK, &err);
if (!err)
- brcmf_sdcard_cfg_write(bcmsdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_write(card, SDIO_FUNC_1,
SBSDIO_FUNC1_SBADDRMID,
(address >> 16) & SBSDIO_SBADDRMID_MASK,
&err);
if (!err)
- brcmf_sdcard_cfg_write(bcmsdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_write(card, SDIO_FUNC_1,
SBSDIO_FUNC1_SBADDRHIGH,
(address >> 24) & SBSDIO_SBADDRHIGH_MASK,
&err);
@@ -337,35 +337,35 @@ static int brcmf_sdcard_set_sbaddr_window(void *sdh, u32 address)
u32 brcmf_sdcard_reg_read(void *sdh, u32 addr, uint size)
{
- struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+ struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
int status;
u32 word = 0;
uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
- BCMSDH_INFO(("%s:fun = 1, addr = 0x%x, ", __func__, addr));
+ BRCMF_SD_INFO(("%s:fun = 1, addr = 0x%x, ", __func__, addr));
- if (!bcmsdh)
- bcmsdh = l_bcmsdh;
+ if (!card)
+ card = l_card;
- ASSERT(bcmsdh->init_success);
+ ASSERT(card->init_success);
- if (bar0 != bcmsdh->sbwad) {
- if (brcmf_sdcard_set_sbaddr_window(bcmsdh, bar0))
+ if (bar0 != card->sbwad) {
+ if (brcmf_sdcard_set_sbaddr_window(card, bar0))
return 0xFFFFFFFF;
- bcmsdh->sbwad = bar0;
+ card->sbwad = bar0;
}
addr &= SBSDIO_SB_OFT_ADDR_MASK;
if (size == 4)
addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
- status = brcmf_sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
+ status = brcmf_sdioh_request_word(card->sdioh, SDIOH_CMD_TYPE_NORMAL,
SDIOH_READ, SDIO_FUNC_1, addr, &word, size);
- bcmsdh->regfail = (status != 0);
+ card->regfail = (status != 0);
- BCMSDH_INFO(("u32data = 0x%x\n", word));
+ BRCMF_SD_INFO(("u32data = 0x%x\n", word));
/* if ok, return appropriately masked word */
if (status == 0) {
@@ -377,52 +377,52 @@ u32 brcmf_sdcard_reg_read(void *sdh, u32 addr, uint size)
case sizeof(u32):
return word;
default:
- bcmsdh->regfail = true;
+ card->regfail = true;
}
}
/* otherwise, bad sdio access or invalid size */
- BCMSDH_ERROR(("%s: error reading addr 0x%04x size %d\n", __func__,
+ BRCMF_SD_ERROR(("%s: error reading addr 0x%04x size %d\n", __func__,
addr, size));
return 0xFFFFFFFF;
}
u32 brcmf_sdcard_reg_write(void *sdh, u32 addr, uint size, u32 data)
{
- struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+ struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
int status;
uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
int err = 0;
- BCMSDH_INFO(("%s:fun = 1, addr = 0x%x, uint%ddata = 0x%x\n",
+ BRCMF_SD_INFO(("%s:fun = 1, addr = 0x%x, uint%ddata = 0x%x\n",
__func__, addr, size * 8, data));
- if (!bcmsdh)
- bcmsdh = l_bcmsdh;
+ if (!card)
+ card = l_card;
- ASSERT(bcmsdh->init_success);
+ ASSERT(card->init_success);
- if (bar0 != bcmsdh->sbwad) {
- err = brcmf_sdcard_set_sbaddr_window(bcmsdh, bar0);
+ if (bar0 != card->sbwad) {
+ err = brcmf_sdcard_set_sbaddr_window(card, bar0);
if (err)
return err;
- bcmsdh->sbwad = bar0;
+ card->sbwad = bar0;
}
addr &= SBSDIO_SB_OFT_ADDR_MASK;
if (size == 4)
addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
status =
- brcmf_sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
+ brcmf_sdioh_request_word(card->sdioh, SDIOH_CMD_TYPE_NORMAL,
SDIOH_WRITE, SDIO_FUNC_1, addr, &data, size);
- bcmsdh->regfail = (status != 0);
+ card->regfail = (status != 0);
if (status == 0)
return 0;
- BCMSDH_ERROR(("%s: error writing 0x%08x to addr 0x%04x size %d\n",
+ BRCMF_SD_ERROR(("%s: error writing 0x%08x to addr 0x%04x size %d\n",
__func__, data, addr, size));
return 0xFFFFFFFF;
}
@@ -433,9 +433,9 @@ bool brcmf_sdcard_regfail(void *sdh)
}
int
-brcmf_sdcard_recv_buf(struct brcmf_sdio *bcmsdh, u32 addr, uint fn, uint flags,
+brcmf_sdcard_recv_buf(struct brcmf_sdio *card, u32 addr, uint fn, uint flags,
u8 *buf, uint nbytes, struct sk_buff *pkt,
- bcmsdh_cmplt_fn_t complete, void *handle)
+ brcmf_sdio_cmplt_fn_t complete, void *handle)
{
int status;
uint incr_fix;
@@ -443,10 +443,10 @@ brcmf_sdcard_recv_buf(struct brcmf_sdio *bcmsdh, u32 addr, uint fn, uint flags,
uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
int err = 0;
- ASSERT(bcmsdh);
- ASSERT(bcmsdh->init_success);
+ ASSERT(card);
+ ASSERT(card->init_success);
- BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, size = %d\n",
+ BRCMF_SD_INFO(("%s:fun = %d, addr = 0x%x, size = %d\n",
__func__, fn, addr, nbytes));
/* Async not implemented yet */
@@ -454,12 +454,12 @@ brcmf_sdcard_recv_buf(struct brcmf_sdio *bcmsdh, u32 addr, uint fn, uint flags,
if (flags & SDIO_REQ_ASYNC)
return -ENOTSUPP;
- if (bar0 != bcmsdh->sbwad) {
- err = brcmf_sdcard_set_sbaddr_window(bcmsdh, bar0);
+ if (bar0 != card->sbwad) {
+ err = brcmf_sdcard_set_sbaddr_window(card, bar0);
if (err)
return err;
- bcmsdh->sbwad = bar0;
+ card->sbwad = bar0;
}
addr &= SBSDIO_SB_OFT_ADDR_MASK;
@@ -469,7 +469,7 @@ brcmf_sdcard_recv_buf(struct brcmf_sdio *bcmsdh, u32 addr, uint fn, uint flags,
if (width == 4)
addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
- status = brcmf_sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO,
+ status = brcmf_sdioh_request_buffer(card->sdioh, SDIOH_DATA_PIO,
incr_fix, SDIOH_READ, fn, addr, width, nbytes, buf, pkt);
return status;
@@ -478,18 +478,18 @@ brcmf_sdcard_recv_buf(struct brcmf_sdio *bcmsdh, u32 addr, uint fn, uint flags,
int
brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags,
u8 *buf, uint nbytes, void *pkt,
- bcmsdh_cmplt_fn_t complete, void *handle)
+ brcmf_sdio_cmplt_fn_t complete, void *handle)
{
- struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+ struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
uint incr_fix;
uint width;
uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
int err = 0;
- ASSERT(bcmsdh);
- ASSERT(bcmsdh->init_success);
+ ASSERT(card);
+ ASSERT(card->init_success);
- BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, size = %d\n",
+ BRCMF_SD_INFO(("%s:fun = %d, addr = 0x%x, size = %d\n",
__func__, fn, addr, nbytes));
/* Async not implemented yet */
@@ -497,12 +497,12 @@ brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags,
if (flags & SDIO_REQ_ASYNC)
return -ENOTSUPP;
- if (bar0 != bcmsdh->sbwad) {
- err = brcmf_sdcard_set_sbaddr_window(bcmsdh, bar0);
+ if (bar0 != card->sbwad) {
+ err = brcmf_sdcard_set_sbaddr_window(card, bar0);
if (err)
return err;
- bcmsdh->sbwad = bar0;
+ card->sbwad = bar0;
}
addr &= SBSDIO_SB_OFT_ADDR_MASK;
@@ -512,69 +512,69 @@ brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags,
if (width == 4)
addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
- return brcmf_sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO,
+ return brcmf_sdioh_request_buffer(card->sdioh, SDIOH_DATA_PIO,
incr_fix, SDIOH_WRITE, fn, addr, width, nbytes, buf, pkt);
}
int brcmf_sdcard_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes)
{
- struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+ struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
- ASSERT(bcmsdh);
- ASSERT(bcmsdh->init_success);
+ ASSERT(card);
+ ASSERT(card->init_success);
ASSERT((addr & SBSDIO_SBWINDOW_MASK) == 0);
addr &= SBSDIO_SB_OFT_ADDR_MASK;
addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
- return brcmf_sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO,
+ return brcmf_sdioh_request_buffer(card->sdioh, SDIOH_DATA_PIO,
SDIOH_DATA_INC, (rw ? SDIOH_WRITE : SDIOH_READ), SDIO_FUNC_1,
addr, 4, nbytes, buf, NULL);
}
int brcmf_sdcard_abort(void *sdh, uint fn)
{
- struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+ struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
- return brcmf_sdioh_abort(bcmsdh->sdioh, fn);
+ return brcmf_sdioh_abort(card->sdioh, fn);
}
int brcmf_sdcard_start(void *sdh, int stage)
{
- struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+ struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
- return brcmf_sdioh_start(bcmsdh->sdioh, stage);
+ return brcmf_sdioh_start(card->sdioh, stage);
}
int brcmf_sdcard_stop(void *sdh)
{
- struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+ struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
- return brcmf_sdioh_stop(bcmsdh->sdioh);
+ return brcmf_sdioh_stop(card->sdioh);
}
int brcmf_sdcard_query_device(void *sdh)
{
- struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- bcmsdh->vendevid = (PCI_VENDOR_ID_BROADCOM << 16) | 0;
- return bcmsdh->vendevid;
+ struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
+ card->vendevid = (PCI_VENDOR_ID_BROADCOM << 16) | 0;
+ return card->vendevid;
}
uint brcmf_sdcard_query_iofnum(void *sdh)
{
- struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+ struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
- if (!bcmsdh)
- bcmsdh = l_bcmsdh;
+ if (!card)
+ card = l_card;
- return brcmf_sdioh_query_iofnum(bcmsdh->sdioh);
+ return brcmf_sdioh_query_iofnum(card->sdioh);
}
int brcmf_sdcard_reset(struct brcmf_sdio *sdh)
{
- struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+ struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
- return brcmf_sdioh_reset(bcmsdh->sdioh);
+ return brcmf_sdioh_reset(card->sdioh);
}
void *brcmf_sdcard_get_sdioh(struct brcmf_sdio *sdh)
@@ -591,12 +591,12 @@ u32 brcmf_sdcard_get_dstatus(void *sdh)
u32 brcmf_sdcard_cur_sbwad(void *sdh)
{
- struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
+ struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
- if (!bcmsdh)
- bcmsdh = l_bcmsdh;
+ if (!card)
+ card = l_card;
- return bcmsdh->sbwad;
+ return card->sbwad;
}
void brcmf_sdcard_chipinfo(void *sdh, u32 chip, u32 chiprev)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
index 1198ee6..a3cf05f 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
@@ -38,8 +38,8 @@
/**
* SDIO Host Controller info
*/
-struct bcmsdh_hc {
- struct bcmsdh_hc *next;
+struct sdio_hc {
+ struct sdio_hc *next;
struct device *dev; /* platform device handle */
void *regs; /* SDIO Host Controller address */
struct brcmf_sdio *sdh; /* SDIO Host Controller handle */
@@ -49,7 +49,7 @@ struct bcmsdh_hc {
as edge and etc */
bool oob_irq_registered;
};
-static struct bcmsdh_hc *sdhcinfo;
+static struct sdio_hc *sdhcinfo;
/* driver info, initialized when brcmf_sdio_register is called */
static struct brcmf_sdioh_driver drvinfo = { NULL, NULL };
@@ -111,7 +111,7 @@ EXPORT_SYMBOL(brcmf_sdio_remove);
int brcmf_sdio_probe(struct device *dev)
{
- struct bcmsdh_hc *sdhc = NULL;
+ struct sdio_hc *sdhc = NULL;
unsigned long regs = 0;
struct brcmf_sdio *sdh = NULL;
int irq = 0;
@@ -119,7 +119,7 @@ int brcmf_sdio_probe(struct device *dev)
unsigned long irq_flags = 0;
/* allocate SDIO Host Controller state info */
- sdhc = kzalloc(sizeof(struct bcmsdh_hc), GFP_ATOMIC);
+ sdhc = kzalloc(sizeof(struct sdio_hc), GFP_ATOMIC);
if (!sdhc) {
SDLX_MSG(("%s: out of memory\n", __func__));
goto err;
@@ -128,7 +128,7 @@ int brcmf_sdio_probe(struct device *dev)
sdh = brcmf_sdcard_attach((void *)0, (void **)®s, irq);
if (!sdh) {
- SDLX_MSG(("%s: bcmsdh_attach failed\n", __func__));
+ SDLX_MSG(("%s: attach failed\n", __func__));
goto err;
}
@@ -166,7 +166,7 @@ err:
int brcmf_sdio_remove(struct device *dev)
{
- struct bcmsdh_hc *sdhc, *prev;
+ struct sdio_hc *sdhc, *prev;
sdhc = sdhcinfo;
drvinfo.detach(sdhc->ch);
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index b7726f2..d0e9b3d 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -27,7 +27,7 @@
#include <brcmu_utils.h>
#include <brcmu_wifi.h>
#include "sdio_host.h"
-#include "bcmsdbus.h" /* bcmsdh to/from specific controller APIs */
+#include "bcmsdbus.h"
#include "sdiovar.h" /* ioctl/iovars */
#include "dngl_stats.h"
#include "dhd.h"
@@ -83,8 +83,8 @@ static int brcmf_sdioh_enablefuncs(struct sdioh_info *sd)
err_ret = sdio_enable_func(gInstance->func[1]);
sdio_release_host(gInstance->func[1]);
if (err_ret) {
- sd_err(("bcmsdh_sdmmc: Failed to enable F1 Err: 0x%08x",
- err_ret));
+ sd_err(("brcmf_sdioh_enablefuncs: Failed to enable F1 "
+ "Err: 0x%08x", err_ret));
}
return false;
@@ -128,7 +128,7 @@ struct sdioh_info *brcmf_sdioh_attach(void *bar0, uint irq)
sd->client_block_size[1] = 64;
err_ret = sdio_set_block_size(gInstance->func[1], 64);
if (err_ret)
- sd_err(("bcmsdh_sdmmc: Failed to set F1 blocksize\n"));
+ sd_err(("brcmf_sdioh_attach: Failed to set F1 blocksize\n"));
/* Release host controller F1 */
sdio_release_host(gInstance->func[1]);
@@ -141,8 +141,8 @@ struct sdioh_info *brcmf_sdioh_attach(void *bar0, uint irq)
err_ret =
sdio_set_block_size(gInstance->func[2], sd_f2_blocksize);
if (err_ret)
- sd_err(("bcmsdh_sdmmc: Failed to set F2 blocksize "
- "to %d\n", sd_f2_blocksize));
+ sd_err(("brcmf_sdioh_attach: Failed to set F2 blocksize"
+ " to %d\n", sd_f2_blocksize));
/* Release host controller F2 */
sdio_release_host(gInstance->func[2]);
@@ -549,7 +549,9 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
sdio_enable_func
(gInstance->func[2]);
if (err_ret)
- sd_err(("bcmsdh_sdmmc: enable F2 failed:%d",
+ sd_err(("request_byte: "
+ "enable F2 "
+ "failed:%d",
err_ret));
} else {
/* Disable Function 2 */
@@ -557,7 +559,9 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
sdio_disable_func
(gInstance->func[2]);
if (err_ret)
- sd_err(("bcmsdh_sdmmc: Disab F2 failed:%d",
+ sd_err(("request_byte: "
+ "Disab F2 "
+ "failed:%d",
err_ret));
}
sdio_release_host(gInstance->func[2]);
@@ -577,7 +581,7 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
sdio_release_host(gInstance->func[func]);
}
else if (regaddr < 0xF0) {
- sd_err(("bcmsdh_sdmmc: F0 Wr:0x%02x: write "
+ sd_err(("brcmf: F0 Wr:0x%02x: write "
"disallowed\n", regaddr));
} else {
/* Claim host controller, perform F0 write,
@@ -613,7 +617,7 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
}
if (err_ret)
- sd_err(("bcmsdh_sdmmc: Failed to %s byte F%d:@0x%05x=%02x, "
+ sd_err(("brcmf: Failed to %s byte F%d:@0x%05x=%02x, "
"Err: %d\n", rw ? "Write" : "Read", func, regaddr,
*byte, err_ret));
@@ -666,7 +670,7 @@ brcmf_sdioh_request_word(struct sdioh_info *sd, uint cmd_type, uint rw,
sdio_release_host(gInstance->func[func]);
if (err_ret) {
- sd_err(("bcmsdh_sdmmc: Failed to %s word, Err: 0x%08x",
+ sd_err(("brcmf: Failed to %s word, Err: 0x%08x",
rw ? "Write" : "Read", err_ret));
}
@@ -896,12 +900,11 @@ brcmf_sdioh_card_regread(struct sdioh_info *sd, int func, u32 regaddr,
return SUCCESS;
}
-/* bcmsdh_sdmmc interrupt handler */
static void brcmf_sdioh_irqhandler(struct sdio_func *func)
{
struct sdioh_info *sd;
- sd_trace(("bcmsdh_sdmmc: ***IRQHandler\n"));
+ sd_trace(("brcmf: ***IRQHandler\n"));
sd = gInstance->sd;
ASSERT(sd != NULL);
@@ -913,7 +916,7 @@ static void brcmf_sdioh_irqhandler(struct sdio_func *func)
ASSERT(sd->intr_handler_arg);
(sd->intr_handler) (sd->intr_handler_arg);
} else {
- sd_err(("bcmsdh_sdmmc: ***IRQHandler\n"));
+ sd_err(("brcmf: ***IRQHandler\n"));
sd_err(("%s: Not ready for intr: enabled %d, handler %p\n",
__func__, sd->client_intr_enabled, sd->intr_handler));
@@ -922,12 +925,12 @@ static void brcmf_sdioh_irqhandler(struct sdio_func *func)
sdio_claim_host(gInstance->func[0]);
}
-/* bcmsdh_sdmmc interrupt handler for F2 (dummy handler) */
+/* interrupt handler for F2 (dummy handler) */
static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func)
{
struct sdioh_info *sd;
- sd_trace(("bcmsdh_sdmmc: ***IRQHandlerF2\n"));
+ sd_trace(("brcmf: ***IRQHandlerF2\n"));
sd = gInstance->sd;
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
index a0f985c..5eb4c65 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
@@ -15,7 +15,7 @@
*/
/*
- * BCMSDH Function Driver for the native SDIO/MMC driver in the Linux Kernel
+ * BRCMF SDIO Function Driver for the native SDIO/MMC driver in the Linux Kernel
*/
#ifndef __BCMSDH_SDMMC_H__
@@ -97,10 +97,6 @@ struct sdioh_info {
/* SDDMA_DESCRIPTOR SGList[32]; *//* Scatter/Gather DMA List */
};
-/************************************************************
- * Internal interfaces: per-port references into bcmsdh_sdmmc.c
- */
-
/* Global message bits */
extern uint sd_msglevel;
@@ -115,10 +111,6 @@ extern bool brcmf_sdioh_check_client_intr(struct sdioh_info *sd);
extern void brcmf_sdioh_dev_intr_on(struct sdioh_info *sd);
extern void brcmf_sdioh_dev_intr_off(struct sdioh_info *sd);
-/**************************************************************
- * Internal interfaces: bcmsdh_sdmmc.c references to per-port code
- */
-
/* Register mapping routines */
extern u32 *brcmf_sdioh_reg_map(s32 addr, int size);
extern void brcmf_sdioh_reg_unmap(s32 addr, int size);
@@ -127,12 +119,12 @@ extern void brcmf_sdioh_reg_unmap(s32 addr, int size);
extern int brcmf_sdioh_register_irq(struct sdioh_info *sd, uint irq);
extern void brcmf_sdioh_free_irq(uint irq, struct sdioh_info *sd);
-typedef struct _BCMSDH_SDMMC_INSTANCE {
+struct brcmf_sdmmc_instance {
struct sdioh_info *sd;
struct sdio_func *func[SDIOD_MAX_IOFUNCS];
u32 host_claimed;
-} BCMSDH_SDMMC_INSTANCE, *PBCMSDH_SDMMC_INSTANCE;
+};
-extern PBCMSDH_SDMMC_INSTANCE gInstance;
+extern struct brcmf_sdmmc_instance *gInstance;
#endif /* __BCMSDH_SDMMC_H__ */
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
index e5c3b25..9d00c49 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
@@ -27,7 +27,7 @@
#include <brcmu_utils.h>
#include <brcmu_wifi.h>
#include "sdio_host.h"
-#include "bcmsdbus.h" /* bcmsdh to/from specific controller APIs */
+#include "bcmsdbus.h"
#include "sdiovar.h" /* to get msglevel bit values */
#include "dngl_stats.h"
#include "dhd.h"
@@ -62,10 +62,7 @@ static int clockoverride;
module_param(clockoverride, int, 0644);
MODULE_PARM_DESC(clockoverride, "SDIO card clock override");
-PBCMSDH_SDMMC_INSTANCE gInstance;
-
-/* Maximum number of bcmsdh_sdmmc devices supported by driver */
-#define BCMSDH_SDMMC_MAX_DEVICES 1
+struct brcmf_sdmmc_instance *gInstance;
struct device sdmmc_dev;
@@ -74,8 +71,8 @@ static int brcmf_ops_sdio_probe(struct sdio_func *func,
{
int ret = 0;
static struct sdio_func sdio_func_0;
- sd_trace(("bcmsdh_sdmmc: %s Enter\n", __func__));
- sd_trace(("sdio_bcmsdh: func->class=%x\n", func->class));
+ sd_trace(("sdio_probe: %s Enter\n", __func__));
+ sd_trace(("sdio_probe: func->class=%x\n", func->class));
sd_trace(("sdio_vendor: 0x%04x\n", func->vendor));
sd_trace(("sdio_device: 0x%04x\n", func->device));
sd_trace(("Function#: 0x%04x\n", func->num));
@@ -117,7 +114,7 @@ static void brcmf_ops_sdio_remove(struct sdio_func *func)
}
/* devices we support, null terminated */
-static const struct sdio_device_id bcmsdh_sdmmc_ids[] = {
+static const struct sdio_device_id brcmf_sdmmc_ids[] = {
{SDIO_DEVICE(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_DEFAULT)},
{SDIO_DEVICE
(SDIO_VENDOR_ID_BROADCOM, SDIO_DEVICE_ID_BROADCOM_4325_SDGWB)},
@@ -127,7 +124,7 @@ static const struct sdio_device_id bcmsdh_sdmmc_ids[] = {
{ /* end: all zeroes */ },
};
-MODULE_DEVICE_TABLE(sdio, bcmsdh_sdmmc_ids);
+MODULE_DEVICE_TABLE(sdio, brcmf_sdmmc_ids);
#ifdef CONFIG_PM
static int brcmf_sdio_suspend(struct device *dev)
@@ -166,11 +163,11 @@ static const struct dev_pm_ops brcmf_sdio_pm_ops = {
};
#endif /* CONFIG_PM */
-static struct sdio_driver bcmsdh_sdmmc_driver = {
+static struct sdio_driver brcmf_sdmmc_driver = {
.probe = brcmf_ops_sdio_probe,
.remove = brcmf_ops_sdio_remove,
.name = "brcmfmac",
- .id_table = bcmsdh_sdmmc_ids,
+ .id_table = brcmf_sdmmc_ids,
#ifdef CONFIG_PM
.drv = {
.pm = &brcmf_sdio_pm_ops,
@@ -243,14 +240,14 @@ int brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable)
int brcmf_sdio_function_init(void)
{
int error = 0;
- sd_trace(("bcmsdh_sdmmc: %s Enter\n", __func__));
+ sd_trace(("brcmf_sdio_function_init: %s Enter\n", __func__));
- gInstance = kzalloc(sizeof(BCMSDH_SDMMC_INSTANCE), GFP_KERNEL);
+ gInstance = kzalloc(sizeof(struct brcmf_sdmmc_instance), GFP_KERNEL);
if (!gInstance)
return -ENOMEM;
memset(&sdmmc_dev, 0, sizeof(sdmmc_dev));
- error = sdio_register_driver(&bcmsdh_sdmmc_driver);
+ error = sdio_register_driver(&brcmf_sdmmc_driver);
return error;
}
@@ -263,7 +260,7 @@ void brcmf_sdio_function_cleanup(void)
{
sd_trace(("%s Enter\n", __func__));
- sdio_unregister_driver(&bcmsdh_sdmmc_driver);
+ sdio_unregister_driver(&brcmf_sdmmc_driver);
kfree(gInstance);
}
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index da5a2ff..6c7407a 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -458,7 +458,7 @@ struct chip_info {
typedef struct dhd_bus {
struct brcmf_pub *dhd;
- struct brcmf_sdio *sdh; /* Handle for BCMSDH calls */
+ struct brcmf_sdio *sdh; /* Handle for sdio card calls */
struct chip_info *ci; /* Chip info struct */
char *vars; /* Variables (from CIS and/or other) */
uint varsz; /* Size of variables buffer */
@@ -529,7 +529,7 @@ typedef struct dhd_bus {
s32 idletime; /* Control for activity timeout */
s32 idlecount; /* Activity timeout counter */
s32 idleclock; /* How to set bus driver when idle */
- s32 sd_rxchain; /* If bcmsdh api accepts PKT chains */
+ s32 sd_rxchain;
bool use_rxchain; /* If dhd should use PKT chains */
bool sleeping; /* Is SDIO bus sleeping? */
bool rxflow_mode; /* Rx flow control mode */
@@ -805,8 +805,8 @@ static uint brcmf_process_nvram_vars(char *varbuf, uint len);
static void brcmf_sdbrcm_setmemsize(struct dhd_bus *bus, int mem_size);
static int brcmf_sdbrcm_send_buf(dhd_bus_t *bus, u32 addr, uint fn,
uint flags, u8 *buf, uint nbytes,
- struct sk_buff *pkt, bcmsdh_cmplt_fn_t complete,
- void *handle);
+ struct sk_buff *pkt,
+ brcmf_sdio_cmplt_fn_t complete, void *handle);
static bool brcmf_sdbrcm_download_firmware(struct dhd_bus *bus, void *sdh);
static int _brcmf_sdbrcm_download_firmware(struct dhd_bus *bus);
@@ -3210,8 +3210,6 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *dhdp, bool enforce_mutex)
/* Set bus state according to enable result */
dhdp->busstate = DHD_BUS_DATA;
- /* bcmsdh_intr_unmask(bus->sdh); */
-
bus->intdis = false;
if (bus->intr) {
DHD_INTR(("%s: enable SDIO device interrupts\n",
@@ -3844,7 +3842,7 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
u16 rdlen; /* Total number of bytes to read */
u8 rxseq; /* Next sequence number to expect */
uint rxleft = 0; /* Remaining number of frames allowed */
- int sdret; /* Return code from bcmsdh calls */
+ int sdret; /* Return code from calls */
u8 txmax; /* Maximum tx sequence offered */
bool len_consistent; /* Result of comparing readahead len and
len from hw-hdr */
@@ -4857,7 +4855,7 @@ static void brcmf_sdbrcm_pktgen(dhd_bus_t *bus)
/* Allocate an appropriate-sized packet */
len = bus->pktgen_len;
pkt = brcmu_pkt_buf_get_skb(
- (len + SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + BRCMF_SDALIGN),
+ len + SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + BRCMF_SDALIGN,
true);
if (!pkt) {
DHD_ERROR(("%s: brcmu_pkt_buf_get_skb failed!\n",
@@ -5268,7 +5266,7 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
/* We make assumptions about address window mappings */
ASSERT((unsigned long)regsva == SI_ENUM_BASE);
- /* BCMSDH passes venid and devid based on CIS parsing -- but
+ /* SDIO car passes venid and devid based on CIS parsing -- but
* low-power start
* means early parse could fail, so here we should get either an ID
* we recognize OR (-1) indicating we must request power first.
@@ -5402,7 +5400,7 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
brcmf_sdcard_intr_disable(sdh);
ret = brcmf_sdcard_intr_reg(sdh, brcmf_sdbrcm_isr, bus);
if (ret != 0) {
- DHD_ERROR(("%s: FAILED: bcmsdh_intr_reg returned %d\n",
+ DHD_ERROR(("%s: FAILED: sdcard_intr_reg returned %d\n",
__func__, ret));
goto fail;
}
@@ -5510,7 +5508,8 @@ brcmf_sdbrcm_probe_attach(struct dhd_bus *bus, void *sdh, void *regsva,
brcmu_pktq_init(&bus->txq, (PRIOMASK + 1), TXQLEN);
/* Locate an appropriately-aligned portion of hdrbuf */
- bus->rxhdr = (u8 *) roundup((unsigned long)&bus->hdrbuf[0], BRCMF_SDALIGN);
+ bus->rxhdr = (u8 *) roundup((unsigned long)&bus->hdrbuf[0],
+ BRCMF_SDALIGN);
/* Set the poll and/or interrupt flags */
bus->intr = (bool) brcmf_intr;
@@ -5553,9 +5552,8 @@ static bool brcmf_sdbrcm_probe_malloc(dhd_bus_t *bus, void *sdh)
/* Align the buffer */
if ((unsigned long)bus->databuf % BRCMF_SDALIGN)
- bus->dataptr =
- bus->databuf + (BRCMF_SDALIGN -
- ((unsigned long)bus->databuf % BRCMF_SDALIGN));
+ bus->dataptr = bus->databuf + (BRCMF_SDALIGN -
+ ((unsigned long)bus->databuf % BRCMF_SDALIGN));
else
bus->dataptr = bus->databuf;
@@ -5612,7 +5610,7 @@ static bool brcmf_sdbrcm_probe_init(dhd_bus_t *bus, void *sdh)
false) != 0) {
bus->sd_rxchain = false;
} else {
- DHD_INFO(("%s: bus module (through bcmsdh API) %s chaining\n",
+ DHD_INFO(("%s: bus module (through sdiocard API) %s chaining\n",
__func__,
(bus->sd_rxchain ? "supports" : "does not support")));
}
@@ -5773,8 +5771,8 @@ static int brcmf_sdbrcm_download_code_file(struct dhd_bus *bus)
goto err;
}
if ((u32)(unsigned long)memblock % BRCMF_SDALIGN)
- memptr +=
- (BRCMF_SDALIGN - ((u32)(unsigned long)memblock % BRCMF_SDALIGN));
+ memptr += (BRCMF_SDALIGN -
+ ((u32)(unsigned long)memblock % BRCMF_SDALIGN));
/* Download image */
while ((len =
@@ -5946,7 +5944,7 @@ err:
static int
brcmf_sdbrcm_send_buf(dhd_bus_t *bus, u32 addr, uint fn, uint flags,
u8 *buf, uint nbytes, struct sk_buff *pkt,
- bcmsdh_cmplt_fn_t complete, void *handle)
+ brcmf_sdio_cmplt_fn_t complete, void *handle)
{
return brcmf_sdcard_send_buf
(bus->sdh, addr, fn, flags, buf, nbytes, pkt, complete,
diff --git a/drivers/staging/brcm80211/brcmfmac/sdio_host.h b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
index 85e3d6a..17ea8b2 100644
--- a/drivers/staging/brcm80211/brcmfmac/sdio_host.h
+++ b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
@@ -18,24 +18,26 @@
#define _BRCM_SDH_H_
#include <linux/skbuff.h>
-#define BCMSDH_ERROR_VAL 0x0001 /* Error */
-#define BCMSDH_INFO_VAL 0x0002 /* Info */
-extern const uint bcmsdh_msglevel;
+#define BRCMF_SD_ERROR_VAL 0x0001 /* Error */
+#define BRCMF_SD_INFO_VAL 0x0002 /* Info */
+extern const uint brcmf_sdio_msglevel;
#ifdef BCMDBG
-#define BCMSDH_ERROR(x) \
+#define BRCMF_SD_ERROR(x) \
do { \
- if ((bcmsdh_msglevel & BCMSDH_ERROR_VAL) && net_ratelimit()) \
+ if ((brcmf_sdio_msglevel & BRCMF_SD_ERROR_VAL) && \
+ net_ratelimit()) \
printk x; \
} while (0)
-#define BCMSDH_INFO(x) \
+#define BRCMF_SD_INFO(x) \
do { \
- if ((bcmsdh_msglevel & BCMSDH_INFO_VAL) && net_ratelimit()) \
+ if ((brcmf_sdio_msglevel & BRCMF_SD_INFO_VAL) && \
+ net_ratelimit()) \
printk x; \
} while (0)
#else /* BCMDBG */
-#define BCMSDH_ERROR(x)
-#define BCMSDH_INFO(x)
+#define BRCMF_SD_ERROR(x)
+#define BRCMF_SD_INFO(x)
#endif /* BCMDBG */
#define SDIO_FUNC_0 0
@@ -61,11 +63,12 @@ extern const uint bcmsdh_msglevel;
/* forward declarations */
struct brcmf_sdio;
-typedef void (*bcmsdh_cb_fn_t) (void *);
+typedef void (*brcmf_sdiocard_cb_fn_t) (void *);
/* Attach and build an interface to the underlying SD host driver.
- * - Allocates resources (structs, arrays, mem, OS handles, etc) needed by bcmsdh.
- * - Returns the bcmsdh handle and virtual address base for register access.
+ * - Allocates resources (structs, arrays, mem, OS handles, etc) needed by
+ * brcmf_sdcard.
+ * - Returns the sdio card handle and virtual address base for register access.
* The returned handle should be used in all subsequent calls, but the bcmsh
* implementation may maintain a single "default" handle (e.g. the first or
* most recent one) to enable single-instance implementations to pass NULL.
@@ -84,20 +87,21 @@ extern int brcmf_sdcard_intr_enable(void *sdh);
extern int brcmf_sdcard_intr_disable(void *sdh);
/* Register/deregister device interrupt handler. */
-extern int brcmf_sdcard_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh);
+extern int
+brcmf_sdcard_intr_reg(void *sdh, brcmf_sdiocard_cb_fn_t fn, void *argh);
+
extern int brcmf_sdcard_intr_dereg(void *sdh);
#if defined(BCMDBG)
/* Query pending interrupt status from the host controller */
extern bool brcmf_sdcard_intr_pending(void *sdh);
#endif
-extern int bcmsdh_claim_host_and_lock(void *sdh);
-extern int bcmsdh_release_host_and_unlock(void *sdh);
-/* Register a callback to be called if and when bcmsdh detects
- * device removal. No-op in the case of non-removable/hardwired devices.
+/* Register a callback to be called on device removal.
+ * No-op in the case of non-removable/hardwired devices.
*/
-extern int brcmf_sdcard_devremove_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh);
+extern int
+brcmf_sdcard_devremove_reg(void *sdh, brcmf_sdiocard_cb_fn_t fn, void *argh);
/* Access SDIO address space (e.g. CCCR) using CMD52 (single-byte interface).
* fn: function number
@@ -147,13 +151,14 @@ extern bool brcmf_sdcard_regfail(void *sdh);
* Returns 0 or error code.
* NOTE: Async operation is not currently supported.
*/
-typedef void (*bcmsdh_cmplt_fn_t) (void *handle, int status, bool sync_waiting);
+typedef void (*brcmf_sdio_cmplt_fn_t)
+ (void *handle, int status, bool sync_waiting);
extern int brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags,
u8 *buf, uint nbytes, void *pkt,
- bcmsdh_cmplt_fn_t complete, void *handle);
+ brcmf_sdio_cmplt_fn_t complete, void *handle);
extern int brcmf_sdcard_recv_buf(struct brcmf_sdio *sdh, u32 addr, uint fn,
uint flags, u8 *buf, uint nbytes, struct sk_buff *pkt,
- bcmsdh_cmplt_fn_t complete, void *handle);
+ brcmf_sdio_cmplt_fn_t complete, void *handle);
/* Flags bits */
#define SDIO_REQ_4BYTE 0x1 /* Four-byte target (backplane) width (vs. two-byte) */
--
1.7.1
From: Roland Vossen <[email protected]>
Code cleanup. BDC (Broadcom Device Class) protocol extension is used on top
of the USB related CDC (Communication Device Class) definition. BDC is always
used, so the #ifdefs were redundant.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/Makefile | 1 -
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 10 ----------
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 3 ---
drivers/staging/brcm80211/brcmfmac/dhd_proto.h | 13 -------------
4 files changed, 0 insertions(+), 27 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/Makefile b/drivers/staging/brcm80211/brcmfmac/Makefile
index 4963155..9fa689b 100644
--- a/drivers/staging/brcm80211/brcmfmac/Makefile
+++ b/drivers/staging/brcm80211/brcmfmac/Makefile
@@ -20,7 +20,6 @@ ccflags-y := \
-DBCMLXSDMMC \
-DBCMPLATFORM_BUS \
-DBCMSDIO \
- -DBDC \
-DBRCM_FULLMAC \
-DDHD_FIRSTREAD=64 \
-DDHD_SCHED \
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index b229e05..156abd6 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -376,13 +376,10 @@ void dhd_prot_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf)
void dhd_prot_hdrpush(dhd_pub_t *dhd, int ifidx, struct sk_buff *pktbuf)
{
-#ifdef BDC
struct bdc_header *h;
-#endif /* BDC */
DHD_TRACE(("%s: Enter\n", __func__));
-#ifdef BDC
/* Push BDC header used to convey priority for buses that don't */
skb_push(pktbuf, BDC_HEADER_LEN);
@@ -396,19 +393,15 @@ void dhd_prot_hdrpush(dhd_pub_t *dhd, int ifidx, struct sk_buff *pktbuf)
h->priority = (pktbuf->priority & BDC_PRIORITY_MASK);
h->flags2 = 0;
h->rssi = 0;
-#endif /* BDC */
BDC_SET_IF_IDX(h, ifidx);
}
int dhd_prot_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
{
-#ifdef BDC
struct bdc_header *h;
-#endif
DHD_TRACE(("%s: Enter\n", __func__));
-#ifdef BDC
/* Pop BDC header used to convey priority for buses that don't */
if (pktbuf->len < BDC_HEADER_LEN) {
@@ -443,7 +436,6 @@ int dhd_prot_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
pktbuf->priority = h->priority & BDC_PRIORITY_MASK;
skb_pull(pktbuf, BDC_HEADER_LEN);
-#endif /* BDC */
return 0;
}
@@ -465,9 +457,7 @@ int dhd_prot_attach(dhd_pub_t *dhd)
}
dhd->prot = cdc;
-#ifdef BDC
dhd->hdrlen += BDC_HEADER_LEN;
-#endif
dhd->maxctl = BRCMF_C_IOCTL_MAXLEN +
sizeof(struct cdc_ioctl) + ROUND_UP_MARGIN;
return 0;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index f326071..f90a0be 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -368,9 +368,6 @@ static void dhd_dpc(unsigned long data);
extern int dhd_wait_pend8021x(struct net_device *dev);
#ifdef TOE
-#ifndef BDC
-#error TOE requires BDC
-#endif /* !BDC */
static int dhd_toe_get(dhd_info_t *dhd, int idx, u32 *toe_ol);
static int dhd_toe_set(dhd_info_t *dhd, int idx, u32 toe_ol);
#endif /* TOE */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_proto.h b/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
index fccd3dd..b2ab3ea 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
@@ -76,17 +76,4 @@ extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
uint len);
#endif /* defined(CONFIG_HAS_EARLYSUSPEND) */
-/********************************
- * For version-string expansion *
- */
-#if defined(BDC)
-#define DHD_PROTOCOL "bdc"
-#elif defined(CDC)
-#define DHD_PROTOCOL "cdc"
-#elif defined(RNDIS)
-#define DHD_PROTOCOL "rndis"
-#else
-#define DHD_PROTOCOL "unknown"
-#endif /* proto */
-
#endif /* _dhd_proto_h_ */
--
1.7.1
On 06/30/2011 08:29 AM, Rafał Miłecki wrote:
> 2011/6/30 Franky Lin<[email protected]>:
>> Most of these patches are brcmfmac cleanup.
>
> Hm, interesting improvement in your "Release early, release often" strategy.
Hi, Rafał
We are aware and it was not preferred way to do this. Due to lot of
renaming and (re)moving code we queued it up internally to make sure
dependent patches would apply without major hassle. The staging-next
tree did not move since beginning of June so it became quite a large
patch queue.
Gr. AvS
--
Almost nobody dances sober, unless they happen to be insane.
-- H.P. Lovecraft --
From: Roland Vossen <[email protected]>
Code cleanup.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h | 65 +++++++++---------
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 70 ++++++++++----------
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h | 16 ++--
.../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c | 12 ++--
4 files changed, 82 insertions(+), 81 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
index 7eb0354..ffe258a 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
@@ -38,9 +38,6 @@
typedef int SDIOH_API_RC;
-/* SDio Host structure */
-typedef struct sdioh_info sdioh_info_t;
-
/* callback function, taking one arg */
typedef void (*sdioh_cb_fn_t) (void *);
@@ -48,68 +45,70 @@ typedef void (*sdioh_cb_fn_t) (void *);
* The handler shall be provided by all subsequent calls. No local cache
* cfghdl points to the starting address of pci device mapped memory
*/
-extern sdioh_info_t *brcmf_sdioh_attach(void *cfghdl, uint irq);
-extern SDIOH_API_RC brcmf_sdioh_detach(sdioh_info_t *si);
-extern SDIOH_API_RC brcmf_sdioh_interrupt_register(sdioh_info_t *si,
+extern struct sdioh_info *brcmf_sdioh_attach(void *cfghdl, uint irq);
+extern SDIOH_API_RC brcmf_sdioh_detach(struct sdioh_info *si);
+extern SDIOH_API_RC brcmf_sdioh_interrupt_register(struct sdioh_info *si,
sdioh_cb_fn_t fn, void *argh);
-extern SDIOH_API_RC brcmf_sdioh_interrupt_deregister(sdioh_info_t *si);
+extern SDIOH_API_RC brcmf_sdioh_interrupt_deregister(struct sdioh_info *si);
/* query whether SD interrupt is enabled or not */
-extern SDIOH_API_RC brcmf_sdioh_interrupt_query(sdioh_info_t *si, bool *onoff);
+extern SDIOH_API_RC
+brcmf_sdioh_interrupt_query(struct sdioh_info *si, bool *onoff);
/* enable or disable SD interrupt */
extern SDIOH_API_RC
-brcmf_sdioh_interrupt_set(sdioh_info_t *si, bool enable_disable);
+brcmf_sdioh_interrupt_set(struct sdioh_info *si, bool enable_disable);
#if defined(DHD_DEBUG)
-extern bool brcmf_sdioh_interrupt_pending(sdioh_info_t *si);
+extern bool brcmf_sdioh_interrupt_pending(struct sdioh_info *si);
#endif
-extern int brcmf_sdioh_claim_host_and_lock(sdioh_info_t *si);
-extern int brcmf_sdioh_release_host_and_unlock(sdioh_info_t *si);
+extern int brcmf_sdioh_claim_host_and_lock(struct sdioh_info *si);
+extern int brcmf_sdioh_release_host_and_unlock(struct sdioh_info *si);
/* read or write one byte using cmd52 */
extern SDIOH_API_RC
-brcmf_sdioh_request_byte(sdioh_info_t *si, uint rw, uint fnc, uint addr,
+brcmf_sdioh_request_byte(struct sdioh_info *si, uint rw, uint fnc, uint addr,
u8 *byte);
/* read or write 2/4 bytes using cmd53 */
-extern SDIOH_API_RC brcmf_sdioh_request_word(sdioh_info_t *si, uint cmd_type,
- uint rw, uint fnc, uint addr,
- u32 *word, uint nbyte);
+extern SDIOH_API_RC
+brcmf_sdioh_request_word(struct sdioh_info *si, uint cmd_type,
+ uint rw, uint fnc, uint addr,
+ u32 *word, uint nbyte);
/* read or write any buffer using cmd53 */
-extern SDIOH_API_RC brcmf_sdioh_request_buffer(sdioh_info_t *si, uint pio_dma,
- uint fix_inc, uint rw, uint fnc_num,
- u32 addr, uint regwidth,
- u32 buflen, u8 *buffer,
- struct sk_buff *pkt);
+extern SDIOH_API_RC
+brcmf_sdioh_request_buffer(struct sdioh_info *si, uint pio_dma,
+ uint fix_inc, uint rw, uint fnc_num,
+ u32 addr, uint regwidth,
+ u32 buflen, u8 *buffer, struct sk_buff *pkt);
/* get cis data */
-extern SDIOH_API_RC brcmf_sdioh_cis_read(sdioh_info_t *si, uint fuc, u8 *cis,
- u32 length);
+extern SDIOH_API_RC
+brcmf_sdioh_cis_read(struct sdioh_info *si, uint fuc, u8 *cis, u32 length);
-extern SDIOH_API_RC brcmf_sdioh_cfg_read(sdioh_info_t *si, uint fuc, u32 addr,
- u8 *data);
-extern SDIOH_API_RC brcmf_sdioh_cfg_write(sdioh_info_t *si, uint fuc, u32 addr,
- u8 *data);
+extern SDIOH_API_RC
+brcmf_sdioh_cfg_read(struct sdioh_info *si, uint fuc, u32 addr, u8 *data);
+extern SDIOH_API_RC
+brcmf_sdioh_cfg_write(struct sdioh_info *si, uint fuc, u32 addr, u8 *data);
/* query number of io functions */
-extern uint brcmf_sdioh_query_iofnum(sdioh_info_t *si);
+extern uint brcmf_sdioh_query_iofnum(struct sdioh_info *si);
/* handle iovars */
-extern int brcmf_sdioh_iovar_op(sdioh_info_t *si, const char *name,
+extern int brcmf_sdioh_iovar_op(struct sdioh_info *si, const char *name,
void *params, int plen, void *arg, int len, bool set);
/* Issue abort to the specified function and clear controller as needed */
-extern int brcmf_sdioh_abort(sdioh_info_t *si, uint fnc);
+extern int brcmf_sdioh_abort(struct sdioh_info *si, uint fnc);
/* Start and Stop SDIO without re-enumerating the SD card. */
-extern int brcmf_sdioh_start(sdioh_info_t *si, int stage);
-extern int brcmf_sdioh_stop(sdioh_info_t *si);
+extern int brcmf_sdioh_start(struct sdioh_info *si, int stage);
+extern int brcmf_sdioh_stop(struct sdioh_info *si);
/* Reset and re-initialize the device */
-extern int brcmf_sdioh_reset(sdioh_info_t *si);
+extern int brcmf_sdioh_reset(struct sdioh_info *si);
/* Helper function */
void *brcmf_sdcard_get_sdioh(bcmsdh_info_t *sdh);
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 59bdfea..df1e8c1 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -39,7 +39,7 @@ extern void brcmf_sdio_function_cleanup(void);
static void brcmf_sdioh_irqhandler(struct sdio_func *func);
static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func);
#endif /* !defined(OOB_INTR_ONLY) */
-static int brcmf_sdioh_get_cisaddr(sdioh_info_t *sd, u32 regaddr);
+static int brcmf_sdioh_get_cisaddr(struct sdioh_info *sd, u32 regaddr);
extern int brcmf_sdioh_reset_comm(struct mmc_card *card);
extern PBCMSDH_SDMMC_INSTANCE gInstance;
@@ -54,7 +54,7 @@ DHD_PM_RESUME_WAIT_INIT(sdioh_request_buffer_wait);
#define DMA_ALIGN_MASK 0x03
-int brcmf_sdioh_card_regread(sdioh_info_t *sd, int func, u32 regaddr,
+int brcmf_sdioh_card_regread(struct sdioh_info *sd, int func, u32 regaddr,
int regsize, u32 *data);
void brcmf_sdioh_set_host_pm_flags(int flag)
@@ -64,7 +64,7 @@ void brcmf_sdioh_set_host_pm_flags(int flag)
__func__, (unsigned int)flag);
}
-static int brcmf_sdioh_enablefuncs(sdioh_info_t *sd)
+static int brcmf_sdioh_enablefuncs(struct sdioh_info *sd)
{
int err_ret;
u32 fbraddr;
@@ -106,9 +106,9 @@ static int brcmf_sdioh_enablefuncs(sdioh_info_t *sd)
/*
* Public entry points & extern's
*/
-sdioh_info_t *brcmf_sdioh_attach(void *bar0, uint irq)
+struct sdioh_info *brcmf_sdioh_attach(void *bar0, uint irq)
{
- sdioh_info_t *sd;
+ struct sdioh_info *sd;
int err_ret;
sd_trace(("%s\n", __func__));
@@ -118,7 +118,7 @@ sdioh_info_t *brcmf_sdioh_attach(void *bar0, uint irq)
return NULL;
}
- sd = kzalloc(sizeof(sdioh_info_t), GFP_ATOMIC);
+ sd = kzalloc(sizeof(struct sdioh_info), GFP_ATOMIC);
if (sd == NULL) {
sd_err(("sdioh_attach: out of memory\n"));
return NULL;
@@ -167,7 +167,7 @@ sdioh_info_t *brcmf_sdioh_attach(void *bar0, uint irq)
return sd;
}
-extern SDIOH_API_RC brcmf_sdioh_detach(sdioh_info_t *sd)
+extern SDIOH_API_RC brcmf_sdioh_detach(struct sdioh_info *sd)
{
sd_trace(("%s\n", __func__));
@@ -261,7 +261,8 @@ extern SDIOH_API_RC brcmf_sdioh_disable_func_intr(void)
/* Configure callback to client when we receive client interrupt */
extern SDIOH_API_RC
-brcmf_sdioh_interrupt_register(sdioh_info_t *sd, sdioh_cb_fn_t fn, void *argh)
+brcmf_sdioh_interrupt_register(struct sdioh_info *sd, sdioh_cb_fn_t fn,
+ void *argh)
{
sd_trace(("%s: Entering\n", __func__));
if (fn == NULL) {
@@ -292,7 +293,7 @@ brcmf_sdioh_interrupt_register(sdioh_info_t *sd, sdioh_cb_fn_t fn, void *argh)
return SDIOH_API_RC_SUCCESS;
}
-extern SDIOH_API_RC brcmf_sdioh_interrupt_deregister(sdioh_info_t *sd)
+extern SDIOH_API_RC brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd)
{
sd_trace(("%s: Entering\n", __func__));
@@ -321,7 +322,8 @@ extern SDIOH_API_RC brcmf_sdioh_interrupt_deregister(sdioh_info_t *sd)
return SDIOH_API_RC_SUCCESS;
}
-extern SDIOH_API_RC brcmf_sdioh_interrupt_query(sdioh_info_t *sd, bool *onoff)
+extern SDIOH_API_RC
+brcmf_sdioh_interrupt_query(struct sdioh_info *sd, bool *onoff)
{
sd_trace(("%s: Entering\n", __func__));
*onoff = sd->client_intr_enabled;
@@ -329,13 +331,13 @@ extern SDIOH_API_RC brcmf_sdioh_interrupt_query(sdioh_info_t *sd, bool *onoff)
}
#if defined(DHD_DEBUG)
-extern bool brcmf_sdioh_interrupt_pending(sdioh_info_t *sd)
+extern bool brcmf_sdioh_interrupt_pending(struct sdioh_info *sd)
{
return 0;
}
#endif
-uint brcmf_sdioh_query_iofnum(sdioh_info_t *sd)
+uint brcmf_sdioh_query_iofnum(struct sdioh_info *sd)
{
return sd->num_funcs;
}
@@ -365,7 +367,7 @@ const struct brcmu_iovar sdioh_iovars[] = {
};
int
-brcmf_sdioh_iovar_op(sdioh_info_t *si, const char *name,
+brcmf_sdioh_iovar_op(struct sdioh_info *si, const char *name,
void *params, int plen, void *arg, int len, bool set)
{
const struct brcmu_iovar *vi = NULL;
@@ -534,7 +536,7 @@ exit:
#if defined(OOB_INTR_ONLY) && defined(HW_OOB)
-SDIOH_API_RC brcmf_sdioh_enable_hw_oob_intr(sdioh_info_t *sd, bool enable)
+SDIOH_API_RC brcmf_sdioh_enable_hw_oob_intr(struct sdioh_info *sd, bool enable)
{
SDIOH_API_RC status;
u8 data;
@@ -551,7 +553,7 @@ SDIOH_API_RC brcmf_sdioh_enable_hw_oob_intr(sdioh_info_t *sd, bool enable)
#endif /* defined(OOB_INTR_ONLY) && defined(HW_OOB) */
extern SDIOH_API_RC
-brcmf_sdioh_cfg_read(sdioh_info_t *sd, uint fnc_num, u32 addr, u8 *data)
+brcmf_sdioh_cfg_read(struct sdioh_info *sd, uint fnc_num, u32 addr, u8 *data)
{
SDIOH_API_RC status;
/* No lock needed since brcmf_sdioh_request_byte does locking */
@@ -560,7 +562,7 @@ brcmf_sdioh_cfg_read(sdioh_info_t *sd, uint fnc_num, u32 addr, u8 *data)
}
extern SDIOH_API_RC
-brcmf_sdioh_cfg_write(sdioh_info_t *sd, uint fnc_num, u32 addr, u8 *data)
+brcmf_sdioh_cfg_write(struct sdioh_info *sd, uint fnc_num, u32 addr, u8 *data)
{
/* No lock needed since brcmf_sdioh_request_byte does locking */
SDIOH_API_RC status;
@@ -568,7 +570,7 @@ brcmf_sdioh_cfg_write(sdioh_info_t *sd, uint fnc_num, u32 addr, u8 *data)
return status;
}
-static int brcmf_sdioh_get_cisaddr(sdioh_info_t *sd, u32 regaddr)
+static int brcmf_sdioh_get_cisaddr(struct sdioh_info *sd, u32 regaddr)
{
/* read 24 bits and return valid 17 bit addr */
int i;
@@ -590,7 +592,7 @@ static int brcmf_sdioh_get_cisaddr(sdioh_info_t *sd, u32 regaddr)
}
extern SDIOH_API_RC
-brcmf_sdioh_cis_read(sdioh_info_t *sd, uint func, u8 *cisd, u32 length)
+brcmf_sdioh_cis_read(struct sdioh_info *sd, uint func, u8 *cisd, u32 length)
{
u32 count;
int offset;
@@ -624,8 +626,8 @@ brcmf_sdioh_cis_read(sdioh_info_t *sd, uint func, u8 *cisd, u32 length)
}
extern SDIOH_API_RC
-brcmf_sdioh_request_byte(sdioh_info_t *sd, uint rw, uint func, uint regaddr,
- u8 *byte)
+brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
+ uint regaddr, u8 *byte)
{
int err_ret;
@@ -723,8 +725,8 @@ brcmf_sdioh_request_byte(sdioh_info_t *sd, uint rw, uint func, uint regaddr,
}
extern SDIOH_API_RC
-brcmf_sdioh_request_word(sdioh_info_t *sd, uint cmd_type, uint rw, uint func,
- uint addr, u32 *word, uint nbytes)
+brcmf_sdioh_request_word(struct sdioh_info *sd, uint cmd_type, uint rw,
+ uint func, uint addr, u32 *word, uint nbytes)
{
int err_ret = SDIOH_API_RC_FAIL;
@@ -776,7 +778,7 @@ brcmf_sdioh_request_word(sdioh_info_t *sd, uint cmd_type, uint rw, uint func,
}
static SDIOH_API_RC
-brcmf_sdioh_request_packet(sdioh_info_t *sd, uint fix_inc, uint write,
+brcmf_sdioh_request_packet(struct sdioh_info *sd, uint fix_inc, uint write,
uint func, uint addr, struct sk_buff *pkt)
{
bool fifo = (fix_inc == SDIOH_DATA_FIX);
@@ -872,7 +874,7 @@ brcmf_sdioh_request_packet(sdioh_info_t *sd, uint fix_inc, uint write,
*
*/
extern SDIOH_API_RC
-brcmf_sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc,
+brcmf_sdioh_request_buffer(struct sdioh_info *sd, uint pio_dma, uint fix_inc,
uint write, uint func, uint addr, uint reg_width,
uint buflen_u, u8 *buffer, struct sk_buff *pkt)
{
@@ -945,7 +947,7 @@ brcmf_sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc,
}
/* this function performs "abort" for both of host & device */
-extern int brcmf_sdioh_abort(sdioh_info_t *sd, uint func)
+extern int brcmf_sdioh_abort(struct sdioh_info *sd, uint func)
{
#if defined(MMC_SDIO_ABORT)
char t_func = (char)func;
@@ -963,7 +965,7 @@ extern int brcmf_sdioh_abort(sdioh_info_t *sd, uint func)
}
/* Reset and re-initialize the device */
-int brcmf_sdioh_reset(sdioh_info_t *si)
+int brcmf_sdioh_reset(struct sdioh_info *si)
{
sd_trace(("%s: Enter\n", __func__));
sd_trace(("%s: Exit\n", __func__));
@@ -971,14 +973,14 @@ int brcmf_sdioh_reset(sdioh_info_t *si)
}
/* Disable device interrupt */
-void brcmf_sdioh_dev_intr_off(sdioh_info_t *sd)
+void brcmf_sdioh_dev_intr_off(struct sdioh_info *sd)
{
sd_trace(("%s: %d\n", __func__, sd->use_client_ints));
sd->intmask &= ~CLIENT_INTR;
}
/* Enable device interrupt */
-void brcmf_sdioh_dev_intr_on(sdioh_info_t *sd)
+void brcmf_sdioh_dev_intr_on(struct sdioh_info *sd)
{
sd_trace(("%s: %d\n", __func__, sd->use_client_ints));
sd->intmask |= CLIENT_INTR;
@@ -986,7 +988,7 @@ void brcmf_sdioh_dev_intr_on(sdioh_info_t *sd)
/* Read client card reg */
int
-brcmf_sdioh_card_regread(sdioh_info_t *sd, int func, u32 regaddr,
+brcmf_sdioh_card_regread(struct sdioh_info *sd, int func, u32 regaddr,
int regsize, u32 *data)
{
@@ -1013,7 +1015,7 @@ brcmf_sdioh_card_regread(sdioh_info_t *sd, int func, u32 regaddr,
/* bcmsdh_sdmmc interrupt handler */
static void brcmf_sdioh_irqhandler(struct sdio_func *func)
{
- sdioh_info_t *sd;
+ struct sdioh_info *sd;
sd_trace(("bcmsdh_sdmmc: ***IRQHandler\n"));
sd = gInstance->sd;
@@ -1039,7 +1041,7 @@ static void brcmf_sdioh_irqhandler(struct sdio_func *func)
/* bcmsdh_sdmmc interrupt handler for F2 (dummy handler) */
static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func)
{
- sdioh_info_t *sd;
+ struct sdioh_info *sd;
sd_trace(("bcmsdh_sdmmc: ***IRQHandlerF2\n"));
@@ -1052,7 +1054,7 @@ static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func)
#ifdef NOTUSED
/* Write client card reg */
static int
-brcmf_sdioh_card_regwrite(sdioh_info_t *sd, int func, u32 regaddr,
+brcmf_sdioh_card_regwrite(struct sdioh_info *sd, int func, u32 regaddr,
int regsize, u32 data)
{
@@ -1076,12 +1078,12 @@ brcmf_sdioh_card_regwrite(sdioh_info_t *sd, int func, u32 regaddr,
}
#endif /* NOTUSED */
-int brcmf_sdioh_start(sdioh_info_t *si, int stage)
+int brcmf_sdioh_start(struct sdioh_info *si, int stage)
{
return 0;
}
-int brcmf_sdioh_stop(sdioh_info_t *si)
+int brcmf_sdioh_stop(struct sdioh_info *si)
{
return 0;
}
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
index c7863b1..1a6f68a 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
@@ -62,8 +62,8 @@
#endif
/* Allocate/init/free per-OS private data */
-extern int brcmf_sdioh_osinit(sdioh_info_t *sd);
-extern void brcmf_sdioh_osfree(sdioh_info_t *sd);
+extern int brcmf_sdioh_osinit(struct sdioh_info *sd);
+extern void brcmf_sdioh_osfree(struct sdioh_info *sd);
#define BLOCK_SIZE_64 64
#define BLOCK_SIZE_512 512
@@ -109,11 +109,11 @@ struct sdioh_info {
extern uint sd_msglevel;
/* OS-independent interrupt handler */
-extern bool brcmf_sdioh_check_client_intr(sdioh_info_t *sd);
+extern bool brcmf_sdioh_check_client_intr(struct sdioh_info *sd);
/* Core interrupt enable/disable of device interrupts */
-extern void brcmf_sdioh_dev_intr_on(sdioh_info_t *sd);
-extern void brcmf_sdioh_dev_intr_off(sdioh_info_t *sd);
+extern void brcmf_sdioh_dev_intr_on(struct sdioh_info *sd);
+extern void brcmf_sdioh_dev_intr_off(struct sdioh_info *sd);
/**************************************************************
* Internal interfaces: bcmsdh_sdmmc.c references to per-port code
@@ -124,11 +124,11 @@ extern u32 *brcmf_sdioh_reg_map(s32 addr, int size);
extern void brcmf_sdioh_reg_unmap(s32 addr, int size);
/* Interrupt (de)registration routines */
-extern int brcmf_sdioh_register_irq(sdioh_info_t *sd, uint irq);
-extern void brcmf_sdioh_free_irq(uint irq, sdioh_info_t *sd);
+extern int brcmf_sdioh_register_irq(struct sdioh_info *sd, uint irq);
+extern void brcmf_sdioh_free_irq(uint irq, struct sdioh_info *sd);
typedef struct _BCMSDH_SDMMC_INSTANCE {
- sdioh_info_t *sd;
+ struct sdioh_info *sd;
struct sdio_func *func[SDIOD_MAX_IOFUNCS];
u32 host_claimed;
} BCMSDH_SDMMC_INSTANCE, *PBCMSDH_SDMMC_INSTANCE;
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
index 8f13988..955168f 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
@@ -55,8 +55,8 @@
#include "dhd_dbg.h"
#include "wl_cfg80211.h"
-extern void brcmf_sdioh_dev_intr_off(sdioh_info_t *sd);
-extern void brcmf_sdioh_dev_intr_on(sdioh_info_t *sd);
+extern void brcmf_sdioh_dev_intr_off(struct sdioh_info *sd);
+extern void brcmf_sdioh_dev_intr_on(struct sdioh_info *sd);
int brcmf_sdio_function_init(void);
void brcmf_sdio_function_cleanup(void);
@@ -144,11 +144,11 @@ static struct sdio_driver bcmsdh_sdmmc_driver = {
};
struct sdos_info {
- sdioh_info_t *sd;
+ struct sdioh_info *sd;
spinlock_t lock;
};
-int brcmf_sdioh_osinit(sdioh_info_t *sd)
+int brcmf_sdioh_osinit(struct sdioh_info *sd)
{
struct sdos_info *sdos;
@@ -162,7 +162,7 @@ int brcmf_sdioh_osinit(sdioh_info_t *sd)
return 0;
}
-void brcmf_sdioh_osfree(sdioh_info_t *sd)
+void brcmf_sdioh_osfree(struct sdioh_info *sd)
{
struct sdos_info *sdos;
ASSERT(sd && sd->sdos_info);
@@ -172,7 +172,7 @@ void brcmf_sdioh_osfree(sdioh_info_t *sd)
}
/* Interrupt enable/disable */
-SDIOH_API_RC brcmf_sdioh_interrupt_set(sdioh_info_t *sd, bool enable)
+SDIOH_API_RC brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable)
{
unsigned long flags;
struct sdos_info *sdos;
--
1.7.1
From: Roland Vossen <[email protected]>
Code still contained a 'FIXME' label that said tx status feedback (consumed by
the rate control algorithm) was not yet taking RTS/CTS into account.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/main.c | 30 ++++++++++++++++++++++------
1 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index 9aa74df..64f4fe7 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -4371,8 +4371,18 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, tx_status_t *txs, u32 frm_tx2)
if (!lastframe) {
wiphy_err(wlc->wiphy, "Not last frame!\n");
} else {
- u16 sfbl, lfbl;
- ieee80211_tx_info_clear_status(tx_info);
+ /*
+ * Set information to be consumed by Minstrel ht.
+ *
+ * The "fallback limit" is the number of tx attempts a given
+ * MPDU is sent at the "primary" rate. Tx attempts beyond that
+ * limit are sent at the "secondary" rate.
+ * A 'short frame' does not exceed RTS treshold.
+ */
+ u16 sfbl, /* Short Frame Rate Fallback Limit */
+ lfbl, /* Long Frame Rate Fallback Limit */
+ fbl;
+
if (queue < AC_COUNT) {
sfbl = WLC_WME_RETRY_SFB_GET(wlc, wme_fifo2ac[queue]);
lfbl = WLC_WME_RETRY_LFB_GET(wlc, wme_fifo2ac[queue]);
@@ -4382,14 +4392,20 @@ brcms_c_dotxstatus(struct brcms_c_info *wlc, tx_status_t *txs, u32 frm_tx2)
}
txrate = tx_info->status.rates;
- /* FIXME: this should use a combination of sfbl, lfbl depending on frame length and RTS setting */
- if ((tx_frame_count > sfbl) && (txrate[1].idx >= 0)) {
+ if (txrate[0].flags & IEEE80211_TX_RC_USE_RTS_CTS)
+ fbl = lfbl;
+ else
+ fbl = sfbl;
+
+ ieee80211_tx_info_clear_status(tx_info);
+
+ if ((tx_frame_count > fbl) && (txrate[1].idx >= 0)) {
/* rate selection requested a fallback rate and we used it */
- txrate->count = lfbl;
- txrate[1].count = tx_frame_count - lfbl;
+ txrate[0].count = fbl;
+ txrate[1].count = tx_frame_count - fbl;
} else {
/* rate selection did not request fallback rate, or we didn't need it */
- txrate->count = tx_frame_count;
+ txrate[0].count = tx_frame_count;
/* rc80211_minstrel.c:minstrel_tx_status() expects unused rates to be marked with idx = -1 */
txrate[1].idx = -1;
txrate[1].count = 0;
--
1.7.1
From: Arend van Spriel <[email protected]>
cleanup of some unused macros.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_dbg.h | 26 +-------------------------
1 files changed, 1 insertions(+), 25 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h b/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h
index 678a7e2..4733de7 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h
@@ -42,24 +42,12 @@
printk args; } while (0)
#define DHD_EVENT(args) do {if (brcmf_msg_level & BRCMF_EVENT_VAL) \
printk args; } while (0)
-#define DHD_BTA(args) do {if (brcmf_msg_level & BRCMF_BTA_VAL) \
- printk args; } while (0)
-#define DHD_ISCAN(args) do {if (brcmf_msg_level & BRCMF_ISCAN_VAL) \
- printk args; } while (0)
-#define DHD_ERROR_ON() (brcmf_msg_level & BRCMF_ERROR_VAL)
-#define DHD_TRACE_ON() (brcmf_msg_level & BRCMF_TRACE_VAL)
-#define DHD_INFO_ON() (brcmf_msg_level & BRCMF_INFO_VAL)
#define DHD_DATA_ON() (brcmf_msg_level & BRCMF_DATA_VAL)
#define DHD_CTL_ON() (brcmf_msg_level & BRCMF_CTL_VAL)
-#define DHD_TIMER_ON() (brcmf_msg_level & BRCMF_TIMER_VAL)
#define DHD_HDRS_ON() (brcmf_msg_level & BRCMF_HDRS_VAL)
#define DHD_BYTES_ON() (brcmf_msg_level & BRCMF_BYTES_VAL)
-#define DHD_INTR_ON() (brcmf_msg_level & BRCMF_INTR_VAL)
#define DHD_GLOM_ON() (brcmf_msg_level & BRCMF_GLOM_VAL)
-#define DHD_EVENT_ON() (brcmf_msg_level & BRCMF_EVENT_VAL)
-#define DHD_BTA_ON() (brcmf_msg_level & BRCMF_BTA_VAL)
-#define DHD_ISCAN_ON() (brcmf_msg_level & BRCMF_ISCAN_VAL)
#else /* (defined BCMDBG) || (defined BCMDBG) */
@@ -74,27 +62,15 @@
#define DHD_INTR(args)
#define DHD_GLOM(args)
#define DHD_EVENT(args)
-#define DHD_BTA(args)
-#define DHD_ISCAN(args)
-#define DHD_ERROR_ON() 0
-#define DHD_TRACE_ON() 0
-#define DHD_INFO_ON() 0
#define DHD_DATA_ON() 0
#define DHD_CTL_ON() 0
-#define DHD_TIMER_ON() 0
#define DHD_HDRS_ON() 0
#define DHD_BYTES_ON() 0
-#define DHD_INTR_ON() 0
#define DHD_GLOM_ON() 0
-#define DHD_EVENT_ON() 0
-#define DHD_BTA_ON() 0
-#define DHD_ISCAN_ON() 0
-#endif /* defined(BCMDBG) */
-#define DHD_LOG(args)
+#endif /* defined(BCMDBG) */
-#define DHD_NONE(args)
extern int brcmf_msg_level;
#endif /* _dhd_dbg_ */
--
1.7.1
From: Arend van Spriel <[email protected]>
The fullmac functions for firmware communication protocol handling
have been renamed to make naming more consistent.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 4 +-
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 49 ++++++++-------
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 75 +++++++++++++----------
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 56 +++++++++--------
drivers/staging/brcm80211/brcmfmac/dhd_proto.h | 26 ++++----
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 8 +--
6 files changed, 115 insertions(+), 103 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 3f1b757..2cde233 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -909,8 +909,8 @@ extern void brcmf_txcomplete(dhd_pub_t *dhdp, struct sk_buff *txp,
bool success);
/* Query ioctl */
-extern int dhdcdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
- uint len);
+extern int brcmf_proto_cdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd,
+ void *buf, uint len);
/* OS independent layer functions */
extern int brcmf_os_proto_block(dhd_pub_t *pub);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index 156abd6..9828ab1 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -53,7 +53,7 @@ struct cdc_ioctl {
((idx) << CDCF_IOC_IF_SHIFT)))
/*
- * BDC header
+ * BDC header - Broadcom specific extension of CDC.
* Used on data packets to convey priority across USB.
*/
#define BDC_HEADER_LEN 4
@@ -112,7 +112,7 @@ typedef struct dhd_prot {
unsigned char buf[BRCMF_C_IOCTL_MAXLEN + ROUND_UP_MARGIN];
} dhd_prot_t;
-static int dhdcdc_msg(dhd_pub_t *dhd)
+static int brcmf_proto_cdc_msg(dhd_pub_t *dhd)
{
dhd_prot_t *prot = dhd->prot;
int len = le32_to_cpu(prot->msg.len) + sizeof(struct cdc_ioctl);
@@ -131,7 +131,7 @@ static int dhdcdc_msg(dhd_pub_t *dhd)
len);
}
-static int dhdcdc_cmplt(dhd_pub_t *dhd, u32 id, u32 len)
+static int brcmf_proto_cdc_cmplt(dhd_pub_t *dhd, u32 id, u32 len)
{
int ret;
dhd_prot_t *prot = dhd->prot;
@@ -150,7 +150,8 @@ static int dhdcdc_cmplt(dhd_pub_t *dhd, u32 id, u32 len)
}
int
-dhdcdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)
+brcmf_proto_cdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
+ uint len)
{
dhd_prot_t *prot = dhd->prot;
struct cdc_ioctl *msg = &prot->msg;
@@ -184,7 +185,7 @@ dhdcdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)
if (buf)
memcpy(prot->buf, buf, len);
- ret = dhdcdc_msg(dhd);
+ ret = brcmf_proto_cdc_msg(dhd);
if (ret < 0) {
DHD_ERROR(("dhdcdc_query_ioctl: dhdcdc_msg failed w/status "
"%d\n", ret));
@@ -193,7 +194,7 @@ dhdcdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)
retry:
/* wait for interrupt and get first fragment */
- ret = dhdcdc_cmplt(dhd, prot->reqid, len);
+ ret = brcmf_proto_cdc_cmplt(dhd, prot->reqid, len);
if (ret < 0)
goto done;
@@ -231,7 +232,8 @@ done:
return ret;
}
-int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)
+int brcmf_proto_cdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd,
+ void *buf, uint len)
{
dhd_prot_t *prot = dhd->prot;
struct cdc_ioctl *msg = &prot->msg;
@@ -252,11 +254,11 @@ int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)
if (buf)
memcpy(prot->buf, buf, len);
- ret = dhdcdc_msg(dhd);
+ ret = brcmf_proto_cdc_msg(dhd);
if (ret < 0)
goto done;
- ret = dhdcdc_cmplt(dhd, prot->reqid, len);
+ ret = brcmf_proto_cdc_cmplt(dhd, prot->reqid, len);
if (ret < 0)
goto done;
@@ -284,7 +286,8 @@ done:
extern int dhd_bus_interface(struct dhd_bus *bus, uint arg, void *arg2);
int
-dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len)
+brcmf_proto_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf,
+ int len)
{
dhd_prot_t *prot = dhd->prot;
int ret = -1;
@@ -318,9 +321,10 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len)
prot->pending = true;
prot->lastcmd = ioc->cmd;
if (ioc->set)
- ret = dhdcdc_set_ioctl(dhd, ifidx, ioc->cmd, buf, len);
+ ret = brcmf_proto_cdc_set_ioctl(dhd, ifidx, ioc->cmd, buf, len);
else {
- ret = dhdcdc_query_ioctl(dhd, ifidx, ioc->cmd, buf, len);
+ ret = brcmf_proto_cdc_query_ioctl(dhd, ifidx, ioc->cmd,
+ buf, len);
if (ret > 0)
ioc->used = ret - sizeof(struct cdc_ioctl);
}
@@ -363,18 +367,18 @@ done:
skb->ip_summed is overloaded */
int
-dhd_prot_iovar_op(dhd_pub_t *dhdp, const char *name,
+brcmf_proto_iovar_op(dhd_pub_t *dhdp, const char *name,
void *params, int plen, void *arg, int len, bool set)
{
return -ENOTSUPP;
}
-void dhd_prot_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf)
+void brcmf_proto_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf)
{
brcmu_bprintf(strbuf, "Protocol CDC: reqid %d\n", dhdp->prot->reqid);
}
-void dhd_prot_hdrpush(dhd_pub_t *dhd, int ifidx, struct sk_buff *pktbuf)
+void brcmf_proto_hdrpush(dhd_pub_t *dhd, int ifidx, struct sk_buff *pktbuf)
{
struct bdc_header *h;
@@ -396,7 +400,7 @@ void dhd_prot_hdrpush(dhd_pub_t *dhd, int ifidx, struct sk_buff *pktbuf)
BDC_SET_IF_IDX(h, ifidx);
}
-int dhd_prot_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
+int brcmf_proto_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
{
struct bdc_header *h;
@@ -440,7 +444,7 @@ int dhd_prot_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
return 0;
}
-int dhd_prot_attach(dhd_pub_t *dhd)
+int brcmf_proto_attach(dhd_pub_t *dhd)
{
dhd_prot_t *cdc;
@@ -468,13 +472,13 @@ fail:
}
/* ~NOTE~ What if another thread is waiting on the semaphore? Holding it? */
-void dhd_prot_detach(dhd_pub_t *dhd)
+void brcmf_proto_detach(dhd_pub_t *dhd)
{
kfree(dhd->prot);
dhd->prot = NULL;
}
-void dhd_prot_dstats(dhd_pub_t *dhd)
+void brcmf_proto_dstats(dhd_pub_t *dhd)
{
/* No stats from dongle added yet, copy bus stats */
dhd->dstats.tx_packets = dhd->tx_packets;
@@ -486,7 +490,7 @@ void dhd_prot_dstats(dhd_pub_t *dhd)
return;
}
-int dhd_prot_init(dhd_pub_t *dhd)
+int brcmf_proto_init(dhd_pub_t *dhd)
{
int ret = 0;
char buf[128];
@@ -497,7 +501,8 @@ int dhd_prot_init(dhd_pub_t *dhd)
/* Get the device MAC address */
strcpy(buf, "cur_etheraddr");
- ret = dhdcdc_query_ioctl(dhd, 0, BRCMF_C_GET_VAR, buf, sizeof(buf));
+ ret = brcmf_proto_cdc_query_ioctl(dhd, 0, BRCMF_C_GET_VAR,
+ buf, sizeof(buf));
if (ret < 0) {
brcmf_os_proto_unblock(dhd);
return ret;
@@ -516,7 +521,7 @@ int dhd_prot_init(dhd_pub_t *dhd)
return ret;
}
-void dhd_prot_stop(dhd_pub_t *dhd)
+void brcmf_proto_stop(dhd_pub_t *dhd)
{
/* Nothing to do for CDC */
}
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index e4680fb..70d2591 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -35,8 +35,6 @@ 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);
extern void dhd_ind_scan_confirm(void *h, bool status);
extern int dhd_wl_ioctl(dhd_pub_t *dhd, uint cmd, char *buf, uint buflen);
void dhd_iscan_lock(void);
@@ -200,7 +198,7 @@ static int brcmf_c_dump(dhd_pub_t *dhdp, char *buf, int buflen)
brcmu_bprintf(strbuf, "\n");
/* Add any prot info */
- dhd_prot_dump(dhdp, strbuf);
+ brcmf_proto_dump(dhdp, strbuf);
brcmu_bprintf(strbuf, "\n");
/* Add any bus info */
@@ -486,13 +484,15 @@ int brcmf_c_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf, uint buflen)
/* not in generic table, try protocol module */
if (ioc->cmd == DHD_GET_VAR)
- bcmerror = dhd_prot_iovar_op(dhd_pub, buf, arg,
- arglen, buf,
- buflen, IOV_GET);
+ bcmerror = brcmf_proto_iovar_op(dhd_pub, buf,
+ arg, arglen,
+ buf, buflen,
+ IOV_GET);
else
- bcmerror = dhd_prot_iovar_op(dhd_pub, buf,
- NULL, 0, arg,
- arglen, IOV_SET);
+ bcmerror = brcmf_proto_iovar_op(dhd_pub, buf,
+ NULL, 0, arg,
+ arglen,
+ IOV_SET);
if (bcmerror != -ENOTSUPP)
break;
@@ -997,7 +997,7 @@ brcmf_c_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg, int enable,
memcpy((char *)pkt_filterp, &enable_parm, sizeof(enable_parm));
/* Enable/disable the specified filter. */
- rc = dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, buf, buf_len);
+ rc = brcmf_proto_cdc_set_ioctl(dhd, 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",
@@ -1009,7 +1009,8 @@ brcmf_c_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg, int enable,
/* Contorl the master mode */
brcmu_mkiovar("pkt_filter_mode", (char *)&master_mode, 4, buf,
sizeof(buf));
- rc = dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, buf, sizeof(buf));
+ rc = brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, buf,
+ sizeof(buf));
rc = rc >= 0 ? 0 : rc;
if (rc)
DHD_TRACE(("%s: failed to add pktfilter %s, retcode = %d\n",
@@ -1140,7 +1141,7 @@ void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg)
&pkt_filter,
WL_PKT_FILTER_FIXED_LEN + WL_PKT_FILTER_PATTERN_FIXED_LEN);
- rc = dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, buf, buf_len);
+ rc = brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, buf, buf_len);
rc = rc >= 0 ? 0 : rc;
if (rc)
@@ -1162,7 +1163,7 @@ void brcmf_c_arp_offload_set(dhd_pub_t *dhd, int arp_mode)
int retcode;
brcmu_mkiovar("arp_ol", (char *)&arp_mode, 4, iovbuf, sizeof(iovbuf));
- retcode = dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
+ retcode = brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
iovbuf, sizeof(iovbuf));
retcode = retcode >= 0 ? 0 : retcode;
if (retcode)
@@ -1179,7 +1180,7 @@ void brcmf_c_arp_offload_enable(dhd_pub_t *dhd, int arp_enable)
int retcode;
brcmu_mkiovar("arpoe", (char *)&arp_enable, 4, iovbuf, sizeof(iovbuf));
- retcode = dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
+ retcode = brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
iovbuf, sizeof(iovbuf));
retcode = retcode >= 0 ? 0 : retcode;
if (retcode)
@@ -1220,7 +1221,7 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
if (!ret) {
brcmu_mkiovar("cur_etheraddr", (void *)ea_addr, ETH_ALEN,
buf, sizeof(buf));
- ret = dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
+ ret = brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
buf, sizeof(buf));
if (ret < 0) {
DHD_ERROR(("%s: can't set MAC address , error=%d\n",
@@ -1233,7 +1234,7 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
/* Set Country code */
if (dhd->country_code[0] != 0) {
- if (dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_COUNTRY,
+ if (brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_COUNTRY,
dhd->country_code,
sizeof(dhd->country_code)) < 0) {
DHD_ERROR(("%s: country code setting failed\n",
@@ -1245,48 +1246,54 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
memset(buf, 0, sizeof(buf));
ptr = buf;
brcmu_mkiovar("ver", 0, 0, buf, sizeof(buf));
- dhdcdc_query_ioctl(dhd, 0, BRCMF_C_GET_VAR, buf, sizeof(buf));
+ brcmf_proto_cdc_query_ioctl(dhd, 0, BRCMF_C_GET_VAR, buf, sizeof(buf));
strsep(&ptr, "\n");
/* Print fw version info */
DHD_ERROR(("Firmware version = %s\n", buf));
/* Set PowerSave mode */
- dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_PM, (char *)&power_mode,
+ brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_PM, (char *)&power_mode,
sizeof(power_mode));
/* Match Host and Dongle rx alignment */
brcmu_mkiovar("bus:txglomalign", (char *)&dongle_align, 4, iovbuf,
sizeof(iovbuf));
- dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
+ brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
+ sizeof(iovbuf));
/* disable glom option per default */
brcmu_mkiovar("bus:txglom", (char *)&glom, 4, iovbuf, sizeof(iovbuf));
- dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
+ brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
+ sizeof(iovbuf));
/* Setup timeout if Beacons are lost and roam is off to report
link down */
brcmu_mkiovar("bcn_timeout", (char *)&bcn_timeout, 4, iovbuf,
sizeof(iovbuf));
- dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
+ brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
+ sizeof(iovbuf));
/* Enable/Disable build-in roaming to allowed ext supplicant to take
of romaing */
brcmu_mkiovar("roam_off", (char *)&brcmf_roam, 4,
iovbuf, sizeof(iovbuf));
- dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
+ brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
+ sizeof(iovbuf));
/* Force STA UP */
if (brcmf_radio_up)
- dhdcdc_set_ioctl(dhd, 0, BRCMF_C_UP, (char *)&up, sizeof(up));
+ brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_UP, (char *)&up,
+ sizeof(up));
/* Setup event_msgs */
brcmu_mkiovar("event_msgs", dhd->eventmask, WL_EVENTING_MASK_LEN,
iovbuf, sizeof(iovbuf));
- dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
+ brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
+ sizeof(iovbuf));
- dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_SCAN_CHANNEL_TIME,
+ brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_SCAN_CHANNEL_TIME,
(char *)&scan_assoc_time, sizeof(scan_assoc_time));
- dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_SCAN_UNASSOC_TIME,
+ brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_SCAN_UNASSOC_TIME,
(char *)&scan_unassoc_time, sizeof(scan_unassoc_time));
#ifdef ARP_OFFLOAD_SUPPORT
@@ -1715,14 +1722,15 @@ int dhd_pno_clean(dhd_pub_t *dhd)
/* Disable pfn */
iov_len = brcmu_mkiovar("pfn", (char *)&pfn_enabled, 4, iovbuf,
sizeof(iovbuf));
- ret = dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
+ ret = brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
+ sizeof(iovbuf));
if (ret >= 0) {
/* clear pfn */
iov_len = brcmu_mkiovar("pfnclear", 0, 0, iovbuf,
sizeof(iovbuf));
if (iov_len) {
- ret = dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
- iov_len);
+ ret = brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
+ iovbuf, iov_len);
if (ret < 0) {
DHD_ERROR(("%s failed code %d\n", __func__,
ret));
@@ -1751,7 +1759,7 @@ int dhd_pno_enable(dhd_pub_t *dhd, int pfn_enabled)
ret = brcmu_mkiovar("pfn", (char *)&pfn_enabled, 4, iovbuf,
sizeof(iovbuf));
if (ret > 0) {
- ret = dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
+ ret = brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
sizeof(iovbuf));
if (ret < 0) {
DHD_ERROR(("%s failed for error=%d\n", __func__, ret));
@@ -1823,7 +1831,8 @@ dhd_pno_set(dhd_pub_t *dhd, wlc_ssid_t *ssids_local, int nssid, unsigned char sc
brcmu_mkiovar("pfn_set", (char *)&pfn_param, sizeof(pfn_param), iovbuf,
sizeof(iovbuf));
- dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
+ brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
+ sizeof(iovbuf));
/* set all pfn ssid */
for (i = 0; i < nssid; i++) {
@@ -1841,8 +1850,8 @@ dhd_pno_set(dhd_pub_t *dhd, wlc_ssid_t *ssids_local, int nssid, unsigned char sc
err = brcmu_mkiovar("pfn_add", (char *)&pfn_element,
sizeof(pfn_element), iovbuf, sizeof(iovbuf));
if (err > 0) {
- err = dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
- sizeof(iovbuf));
+ err = brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
+ iovbuf, sizeof(iovbuf));
if (err < 0) {
DHD_ERROR(("%s failed for i=%d error=%d\n",
__func__, i, err));
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index f90a0be..006b642 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -414,7 +414,7 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
DHD_TRACE(("%s: force extra Suspend setting\n",
__func__));
- dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_PM,
+ brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_PM,
(char *)&power_mode,
sizeof(power_mode));
@@ -434,16 +434,16 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
bcn_li_dtim = dhd->dtim_skip;
brcmu_mkiovar("bcn_li_dtim", (char *)&bcn_li_dtim,
4, iovbuf, sizeof(iovbuf));
- dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
- sizeof(iovbuf));
+ brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
+ iovbuf, sizeof(iovbuf));
#ifdef CUSTOMER_HW2
/* Disable build-in roaming to allowed \
* supplicant to take of romaing
*/
brcmu_mkiovar("roam_off", (char *)&roamvar, 4,
iovbuf, sizeof(iovbuf));
- dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
- sizeof(iovbuf));
+ brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
+ iovbuf, sizeof(iovbuf));
#endif /* CUSTOMER_HW2 */
} else {
@@ -452,7 +452,7 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
__func__));
power_mode = PM_FAST;
- dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_PM,
+ brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_PM,
(char *)&power_mode,
sizeof(power_mode));
@@ -463,14 +463,14 @@ static int dhd_set_suspend(int value, dhd_pub_t *dhd)
brcmu_mkiovar("bcn_li_dtim", (char *)&dhd->dtim_skip,
4, iovbuf, sizeof(iovbuf));
- dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
- sizeof(iovbuf));
+ brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
+ iovbuf, sizeof(iovbuf));
#ifdef CUSTOMER_HW2
roamvar = 0;
brcmu_mkiovar("roam_off", (char *)&roamvar, 4, iovbuf,
sizeof(iovbuf));
- dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
- sizeof(iovbuf));
+ brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
+ iovbuf, sizeof(iovbuf));
#endif /* CUSTOMER_HW2 */
}
}
@@ -674,7 +674,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
ioc.len = buflen;
ioc.set = true;
- ret = dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
+ ret = brcmf_proto_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
if (ret < 0) {
DHD_ERROR(("%s: set mcast_list failed, cnt %d\n",
brcmf_ifname(&dhd->pub, ifidx), cnt));
@@ -712,7 +712,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
ioc.len = buflen;
ioc.set = true;
- ret = dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
+ ret = brcmf_proto_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
if (ret < 0) {
DHD_ERROR(("%s: set allmulti %d failed\n",
brcmf_ifname(&dhd->pub, ifidx),
@@ -733,7 +733,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
ioc.len = sizeof(allmulti);
ioc.set = true;
- ret = dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
+ ret = brcmf_proto_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
if (ret < 0) {
DHD_ERROR(("%s: set promisc %d failed\n",
brcmf_ifname(&dhd->pub, ifidx),
@@ -761,7 +761,7 @@ _dhd_set_mac_address(dhd_info_t *dhd, int ifidx, u8 *addr)
ioc.len = 32;
ioc.set = true;
- ret = dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
+ ret = brcmf_proto_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
if (ret < 0) {
DHD_ERROR(("%s: set cur_etheraddr failed\n",
brcmf_ifname(&dhd->pub, ifidx)));
@@ -978,7 +978,7 @@ int brcmf_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf)
}
/* If the protocol uses a data header, apply it */
- dhd_prot_hdrpush(dhdp, ifidx, pktbuf);
+ brcmf_proto_hdrpush(dhdp, ifidx, pktbuf);
/* Use bus module to send data frame */
#ifdef BCMDBUS
@@ -1185,7 +1185,7 @@ void brcmf_txcomplete(dhd_pub_t *dhdp, struct sk_buff *txp, bool success)
struct ethhdr *eh;
u16 type;
- dhd_prot_hdrpull(dhdp, &ifidx, txp);
+ brcmf_proto_hdrpull(dhdp, &ifidx, txp);
eh = (struct ethhdr *)(txp->data);
type = ntohs(eh->h_proto);
@@ -1212,7 +1212,7 @@ static struct net_device_stats *dhd_get_stats(struct net_device *net)
if (dhd->pub.up) {
/* Use the protocol to get dongle stats */
- dhd_prot_dstats(&dhd->pub);
+ brcmf_proto_dstats(&dhd->pub);
}
/* Copy dongle stats to net device stats */
@@ -1371,7 +1371,7 @@ static int dhd_toe_get(dhd_info_t *dhd, int ifidx, u32 *toe_ol)
ioc.set = false;
strcpy(buf, "toe_ol");
- ret = dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
+ ret = brcmf_proto_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
if (ret < 0) {
/* Check for older dongle image that doesn't support toe_ol */
if (ret == -EIO) {
@@ -1409,7 +1409,7 @@ static int dhd_toe_set(dhd_info_t *dhd, int ifidx, u32 toe_ol)
strcpy(buf, "toe_ol");
memcpy(&buf[sizeof("toe_ol")], &toe_ol, sizeof(u32));
- ret = dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
+ ret = brcmf_proto_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
if (ret < 0) {
DHD_ERROR(("%s: could not set toe_ol: ret=%d\n",
brcmf_ifname(&dhd->pub, ifidx), ret));
@@ -1423,7 +1423,7 @@ static int dhd_toe_set(dhd_info_t *dhd, int ifidx, u32 toe_ol)
strcpy(buf, "toe");
memcpy(&buf[sizeof("toe")], &toe, sizeof(u32));
- ret = dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
+ ret = brcmf_proto_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
if (ret < 0) {
DHD_ERROR(("%s: could not set toe: ret=%d\n",
brcmf_ifname(&dhd->pub, ifidx), ret));
@@ -1662,7 +1662,8 @@ static int dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
dhd_wait_pend8021x(net);
bcmerror =
- dhd_prot_ioctl(&dhd->pub, ifidx, (wl_ioctl_t *)&ioc, buf, buflen);
+ brcmf_proto_ioctl(&dhd->pub, ifidx, (wl_ioctl_t *)&ioc, buf,
+ buflen);
done:
if (!bcmerror && buf && ioc.buf) {
@@ -1864,7 +1865,7 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
dhd->pub.hdrlen = bus_hdrlen;
/* Attach and link in the protocol */
- if (dhd_prot_attach(&dhd->pub) != 0) {
+ if (brcmf_proto_attach(&dhd->pub) != 0) {
DHD_ERROR(("dhd_prot_attach failed\n"));
goto fail;
}
@@ -2021,7 +2022,8 @@ int brcmf_bus_start(dhd_pub_t *dhdp)
#ifdef EMBEDDED_PLATFORM
brcmu_mkiovar("event_msgs", dhdp->eventmask, WL_EVENTING_MASK_LEN,
iovbuf, sizeof(iovbuf));
- dhdcdc_query_ioctl(dhdp, 0, BRCMF_C_GET_VAR, iovbuf, sizeof(iovbuf));
+ brcmf_proto_cdc_query_ioctl(dhdp, 0, BRCMF_C_GET_VAR, iovbuf,
+ sizeof(iovbuf));
memcpy(dhdp->eventmask, iovbuf, WL_EVENTING_MASK_LEN);
setbit(dhdp->eventmask, BRCMF_E_SET_SSID);
@@ -2054,7 +2056,7 @@ int brcmf_bus_start(dhd_pub_t *dhdp)
#endif /* EMBEDDED_PLATFORM */
/* Bus is ready, do any protocol initialization */
- ret = dhd_prot_init(&dhd->pub);
+ ret = brcmf_proto_init(&dhd->pub);
if (ret < 0)
return ret;
@@ -2079,7 +2081,7 @@ dhd_iovar(dhd_pub_t *pub, int ifidx, char *name, char *cmd_buf, uint cmd_len,
ioc.len = len;
ioc.set = set;
- ret = dhd_prot_ioctl(pub, ifidx, &ioc, ioc.buf, ioc.len);
+ ret = brcmf_proto_ioctl(pub, ifidx, &ioc, ioc.buf, ioc.len);
if (!set && ret >= 0)
memcpy(cmd_buf, buf, cmd_len);
@@ -2161,7 +2163,7 @@ void dhd_bus_detach(dhd_pub_t *dhdp)
dhd = (dhd_info_t *) dhdp->info;
if (dhd) {
/* Stop the protocol module */
- dhd_prot_stop(&dhd->pub);
+ brcmf_proto_stop(&dhd->pub);
/* Stop the bus module */
brcmf_sdbrcm_bus_stop(dhd->pub.bus, true);
@@ -2226,7 +2228,7 @@ void brcmf_detach(dhd_pub_t *dhdp)
dhd_bus_detach(dhdp);
if (dhdp->prot)
- dhd_prot_detach(dhdp);
+ brcmf_proto_detach(dhdp);
wl_cfg80211_detach();
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_proto.h b/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
index b2ab3ea..f8ca781 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
@@ -30,50 +30,48 @@
*/
/* Linkage, sets prot link and updates hdrlen in pub */
-extern int dhd_prot_attach(dhd_pub_t *dhdp);
+extern int brcmf_proto_attach(dhd_pub_t *dhdp);
/* Unlink, frees allocated protocol memory (including dhd_prot) */
-extern void dhd_prot_detach(dhd_pub_t *dhdp);
+extern void brcmf_proto_detach(dhd_pub_t *dhdp);
/* Initialize protocol: sync w/dongle state.
* Sets dongle media info (iswl, drv_version, mac address).
*/
-extern int dhd_prot_init(dhd_pub_t *dhdp);
+extern int brcmf_proto_init(dhd_pub_t *dhdp);
/* Stop protocol: sync w/dongle state. */
-extern void dhd_prot_stop(dhd_pub_t *dhdp);
+extern void brcmf_proto_stop(dhd_pub_t *dhdp);
/* Add any protocol-specific data header.
* Caller must reserve prot_hdrlen prepend space.
*/
-extern void dhd_prot_hdrpush(dhd_pub_t *, int ifidx, struct sk_buff *txp);
+extern void brcmf_proto_hdrpush(dhd_pub_t *, int ifidx, struct sk_buff *txp);
/* Remove any protocol-specific data header. */
-extern int dhd_prot_hdrpull(dhd_pub_t *, int *ifidx, struct sk_buff *rxp);
+extern int brcmf_proto_hdrpull(dhd_pub_t *, int *ifidx, struct sk_buff *rxp);
/* Use protocol to issue ioctl to dongle */
-extern int dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc,
+extern int brcmf_proto_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc,
void *buf, int len);
/* Check for and handle local prot-specific iovar commands */
-extern int dhd_prot_iovar_op(dhd_pub_t *dhdp, const char *name,
+extern int brcmf_proto_iovar_op(dhd_pub_t *dhdp, const char *name,
void *params, int plen, void *arg, int len,
bool set);
/* Add prot dump output to a buffer */
-extern void dhd_prot_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf);
+extern void brcmf_proto_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf);
/* Update local copy of dongle statistics */
-extern void dhd_prot_dstats(dhd_pub_t *dhdp);
+extern void brcmf_proto_dstats(dhd_pub_t *dhdp);
extern int brcmf_c_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf,
uint buflen);
extern int brcmf_c_preinit_ioctls(dhd_pub_t *dhd);
-#if defined(CONFIG_HAS_EARLYSUSPEND)
-extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
- uint len);
-#endif /* defined(CONFIG_HAS_EARLYSUSPEND) */
+extern int brcmf_proto_cdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd,
+ void *buf, uint len);
#endif /* _dhd_proto_h_ */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index cb389ae..905afbc 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -408,8 +408,6 @@ typedef struct {
((prio^2)) : (prio))
DHD_SPINWAIT_SLEEP_INIT(sdioh_spinwait_sleep);
-extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
- uint len);
/* Core reg address translation */
#define CORE_CC_REG(base, field) (base + offsetof(chipcregs_t, field))
@@ -3723,8 +3721,8 @@ static u8 brcmf_sdbrcm_rxglom(dhd_bus_t *bus, u8 rxseq)
save_pfirst = pnext;
}
continue;
- } else if (dhd_prot_hdrpull(bus->dhd, &ifidx, pfirst) !=
- 0) {
+ } else if (brcmf_proto_hdrpull(bus->dhd, &ifidx, pfirst)
+ != 0) {
DHD_ERROR(("%s: rx protocol error\n",
__func__));
bus->dhd->rx_errors++;
@@ -4336,7 +4334,7 @@ deliver:
if (pkt->len == 0) {
brcmu_pkt_buf_free_skb(pkt);
continue;
- } else if (dhd_prot_hdrpull(bus->dhd, &ifidx, pkt) != 0) {
+ } else if (brcmf_proto_hdrpull(bus->dhd, &ifidx, pkt) != 0) {
DHD_ERROR(("%s: rx protocol error\n", __func__));
brcmu_pkt_buf_free_skb(pkt);
bus->dhd->rx_errors++;
--
1.7.1
From: Sukesh Srikakula <[email protected]>
'WL_STATUS_CONNECTING' status bit is set at appropriate step in bss/ibss
connect requests.
Signed-off-by: Sukesh Srikakula <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 48 ++++++++++++++--------
1 files changed, 31 insertions(+), 17 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index afafa57..52c1782 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -975,6 +975,8 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
return -EOPNOTSUPP;
}
+ set_bit(WL_STATUS_CONNECTING, &wl->status);
+
if (params->bssid)
WL_CONN("BSSID: %02X %02X %02X %02X %02X %02X\n",
params->bssid[0], params->bssid[1], params->bssid[2],
@@ -1088,9 +1090,9 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
goto done;
}
- set_bit(WL_STATUS_CONNECTING, &wl->status);
-
done:
+ if (err)
+ clear_bit(WL_STATUS_CONNECTING, &wl->status);
WL_TRACE("Exit\n");
return err;
}
@@ -1380,6 +1382,8 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
return -EOPNOTSUPP;
}
+ set_bit(WL_STATUS_CONNECTING, &wl->status);
+
if (chan) {
wl->channel =
ieee80211_frequency_to_channel(chan->center_freq);
@@ -1391,24 +1395,34 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
WL_INFO("ie (%p), ie_len (%zd)\n", sme->ie, sme->ie_len);
err = wl_set_wpa_version(dev, sme);
- if (unlikely(err))
- return err;
+ if (err) {
+ WL_ERR("wl_set_wpa_version failed (%d)\n", err);
+ goto done;
+ }
err = wl_set_auth_type(dev, sme);
- if (unlikely(err))
- return err;
+ if (err) {
+ WL_ERR("wl_set_auth_type failed (%d)\n", err);
+ goto done;
+ }
err = wl_set_set_cipher(dev, sme);
- if (unlikely(err))
- return err;
+ if (err) {
+ WL_ERR("wl_set_set_cipher failed (%d)\n", err);
+ goto done;
+ }
err = wl_set_key_mgmt(dev, sme);
- if (unlikely(err))
- return err;
+ if (err) {
+ WL_ERR("wl_set_key_mgmt failed (%d)\n", err);
+ goto done;
+ }
err = wl_set_set_sharedkey(dev, sme);
- if (unlikely(err))
- return err;
+ if (err) {
+ WL_ERR("wl_set_set_sharedkey failed (%d)\n", err);
+ goto done;
+ }
wl_update_prof(wl, NULL, sme->bssid, WL_PROF_BSSID);
/*
@@ -1435,12 +1449,12 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
wl_ch_to_chanspec(wl->channel, &join_params, &join_params_size);
err = wl_dev_ioctl(dev, WLC_SET_SSID, &join_params, join_params_size);
- if (unlikely(err)) {
- WL_ERR("error (%d)\n", err);
- return err;
- }
- set_bit(WL_STATUS_CONNECTING, &wl->status);
+ if (err)
+ WL_ERR("WLC_SET_SSID failed (%d)\n", err);
+done:
+ if (err)
+ clear_bit(WL_STATUS_CONNECTING, &wl->status);
WL_TRACE("Exit\n");
return err;
}
--
1.7.1
From: Arend van Spriel <[email protected]>
The error handling code labelled with errout: did a conditional kfree(). The
last error jump to the label is upon failure of the kmalloc() for which the
conditional kfree() is done. Therefor, the kfree is moved before the error
label and done unconditionally.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/srom.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/srom.c b/drivers/staging/brcm80211/brcmsmac/srom.c
index 5b5306a..31aa84d 100644
--- a/drivers/staging/brcm80211/brcmsmac/srom.c
+++ b/drivers/staging/brcm80211/brcmsmac/srom.c
@@ -1287,12 +1287,10 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
*vp++ = '\0';
err = initvars_table(base, vp, vars, count);
+ kfree(base);
}
errout:
- if (base)
- kfree(base);
-
kfree(srom);
return err;
}
--
1.7.1
From: Arend van Spriel <[email protected]>
the phy sources contained some code fragments for chipsets that are not
supported by this driver, which have been removed.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c | 14 +--
drivers/staging/brcm80211/brcmsmac/phy/phy_n.c | 160 ++++++----------------
2 files changed, 44 insertions(+), 130 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
index 79008a9..dd56f10 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c
@@ -981,9 +981,8 @@ wlc_phy_table_addr(phy_info_t *pi, uint tbl_id, uint tbl_offset,
pi->tbl_data_hi = tblDataHi;
pi->tbl_data_lo = tblDataLo;
- if ((pi->sh->chip == BCM43224_CHIP_ID ||
- pi->sh->chip == BCM43421_CHIP_ID) &&
- (pi->sh->chiprev == 1)) {
+ if (pi->sh->chip == BCM43224_CHIP_ID &&
+ pi->sh->chiprev == 1) {
pi->tbl_addr = tblAddr;
pi->tbl_save_id = tbl_id;
pi->tbl_save_offset = tbl_offset;
@@ -992,8 +991,7 @@ wlc_phy_table_addr(phy_info_t *pi, uint tbl_id, uint tbl_offset,
void wlc_phy_table_data_write(phy_info_t *pi, uint width, u32 val)
{
- if ((pi->sh->chip == BCM43224_CHIP_ID ||
- pi->sh->chip == BCM43421_CHIP_ID) &&
+ if ((pi->sh->chip == BCM43224_CHIP_ID) &&
(pi->sh->chiprev == 1) &&
(pi->tbl_save_id == NPHY_TBL_ID_ANTSWCTRLLUT)) {
read_phy_reg(pi, pi->tbl_data_lo);
@@ -1029,8 +1027,7 @@ wlc_phy_write_table(phy_info_t *pi, const phytbl_info_t *ptbl_info,
for (idx = 0; idx < ptbl_info->tbl_len; idx++) {
- if ((pi->sh->chip == BCM43224_CHIP_ID ||
- pi->sh->chip == BCM43421_CHIP_ID) &&
+ if ((pi->sh->chip == BCM43224_CHIP_ID) &&
(pi->sh->chiprev == 1) &&
(tbl_id == NPHY_TBL_ID_ANTSWCTRLLUT)) {
read_phy_reg(pi, tblDataLo);
@@ -1070,8 +1067,7 @@ wlc_phy_read_table(phy_info_t *pi, const phytbl_info_t *ptbl_info,
for (idx = 0; idx < ptbl_info->tbl_len; idx++) {
- if ((pi->sh->chip == BCM43224_CHIP_ID ||
- pi->sh->chip == BCM43421_CHIP_ID) &&
+ if ((pi->sh->chip == BCM43224_CHIP_ID) &&
(pi->sh->chiprev == 1)) {
(void)read_phy_reg(pi, tblDataLo);
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
index 696825f..ff0eb22 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
@@ -14550,11 +14550,6 @@ void WLBANDINITFN(wlc_phy_init_nphy) (phy_info_t *pi)
}
}
- if ((!PHY_IPA(pi)) && (pi->sh->chip == BCM5357_CHIP_ID)) {
- si_pmu_chipcontrol(pi->sh->sih, 1, CCTRL5357_EXTPA,
- CCTRL5357_EXTPA);
- }
-
if ((pi->nphy_gband_spurwar2_en) && CHSPEC_IS2G(pi->radio_chanspec) &&
CHSPEC_IS40(pi->radio_chanspec)) {
@@ -17581,11 +17576,6 @@ static void wlc_phy_radio_postinit_2057(phy_info_t *pi)
mod_radio_reg(pi, RADIO_2057_XTALPUOVR_PINCTRL, 0x1, 0x1);
- if (pi->sh->chip == !BCM6362_CHIP_ID) {
-
- mod_radio_reg(pi, RADIO_2057_XTALPUOVR_PINCTRL, 0x2, 0x2);
- }
-
mod_radio_reg(pi, RADIO_2057_RFPLL_MISC_CAL_RESETN, 0x78, 0x78);
mod_radio_reg(pi, RADIO_2057_XTAL_CONFIG2, 0x80, 0x80);
mdelay(2);
@@ -17986,23 +17976,12 @@ wlc_phy_chanspec_radio2056_setup(phy_info_t *pi,
write_radio_reg(pi, RADIO_2056_SYN_PLL_LOOPFILTER2 |
RADIO_2056_SYN, 0x1f);
- if ((pi->sh->chip == BCM4716_CHIP_ID) ||
- (pi->sh->chip == BCM47162_CHIP_ID)) {
-
- write_radio_reg(pi,
- RADIO_2056_SYN_PLL_LOOPFILTER4 |
- RADIO_2056_SYN, 0x14);
- write_radio_reg(pi,
- RADIO_2056_SYN_PLL_CP2 |
- RADIO_2056_SYN, 0x00);
- } else {
- write_radio_reg(pi,
- RADIO_2056_SYN_PLL_LOOPFILTER4 |
- RADIO_2056_SYN, 0xb);
- write_radio_reg(pi,
- RADIO_2056_SYN_PLL_CP2 |
- RADIO_2056_SYN, 0x14);
- }
+ write_radio_reg(pi,
+ RADIO_2056_SYN_PLL_LOOPFILTER4 |
+ RADIO_2056_SYN, 0xb);
+ write_radio_reg(pi,
+ RADIO_2056_SYN_PLL_CP2 |
+ RADIO_2056_SYN, 0x14);
}
}
@@ -18049,38 +18028,25 @@ wlc_phy_chanspec_radio2056_setup(phy_info_t *pi,
WRITE_RADIO_REG2(pi, RADIO_2056, TX, core,
PADG_IDAC, 0xcc);
- if ((pi->sh->chip == BCM4716_CHIP_ID) ||
- (pi->sh->chip ==
- BCM47162_CHIP_ID)) {
- bias = 0x40;
- cascbias = 0x45;
- pag_boost_tune = 0x5;
- pgag_boost_tune = 0x33;
- padg_boost_tune = 0x77;
- mixg_boost_tune = 0x55;
- } else {
- bias = 0x25;
- cascbias = 0x20;
-
- if ((pi->sh->chip ==
- BCM43224_CHIP_ID)
- || (pi->sh->chip ==
- BCM43225_CHIP_ID)
- || (pi->sh->chip ==
- BCM43421_CHIP_ID)) {
- if (pi->sh->chippkg ==
- BCM43224_FAB_SMIC) {
- bias = 0x2a;
- cascbias = 0x38;
- }
+ bias = 0x25;
+ cascbias = 0x20;
+
+ if ((pi->sh->chip ==
+ BCM43224_CHIP_ID)
+ || (pi->sh->chip ==
+ BCM43225_CHIP_ID)) {
+ if (pi->sh->chippkg ==
+ BCM43224_FAB_SMIC) {
+ bias = 0x2a;
+ cascbias = 0x38;
}
-
- pag_boost_tune = 0x4;
- pgag_boost_tune = 0x03;
- padg_boost_tune = 0x77;
- mixg_boost_tune = 0x65;
}
+ pag_boost_tune = 0x4;
+ pgag_boost_tune = 0x03;
+ padg_boost_tune = 0x77;
+ mixg_boost_tune = 0x65;
+
WRITE_RADIO_REG2(pi, RADIO_2056, TX, core,
INTPAG_IMAIN_STAT, bias);
WRITE_RADIO_REG2(pi, RADIO_2056, TX, core,
@@ -18178,8 +18144,7 @@ wlc_phy_chanspec_radio2056_setup(phy_info_t *pi,
cascbias = 0x30;
if ((pi->sh->chip == BCM43224_CHIP_ID) ||
- (pi->sh->chip == BCM43225_CHIP_ID) ||
- (pi->sh->chip == BCM43421_CHIP_ID)) {
+ (pi->sh->chip == BCM43225_CHIP_ID)) {
if (pi->sh->chippkg == BCM43224_FAB_SMIC) {
cascbias = 0x35;
}
@@ -18907,14 +18872,8 @@ static void wlc_phy_spurwar_nphy(phy_info_t *pi)
case 38:
case 102:
case 118:
- if ((pi->sh->chip == BCM4716_CHIP_ID) &&
- (pi->sh->chippkg == BCM4717_PKG_ID)) {
- nphy_adj_tone_id_buf[0] = 32;
- nphy_adj_noise_var_buf[0] = 0x21f;
- } else {
- nphy_adj_tone_id_buf[0] = 0;
- nphy_adj_noise_var_buf[0] = 0x0;
- }
+ nphy_adj_tone_id_buf[0] = 0;
+ nphy_adj_noise_var_buf[0] = 0x0;
break;
case 134:
nphy_adj_tone_id_buf[0] = 32;
@@ -19041,34 +19000,20 @@ wlc_phy_chanspec_nphy_setup(phy_info_t *pi, chanspec_t chanspec,
if (pi->nphy_aband_spurwar_en &&
((val == 38) || (val == 102)
- || (val == 118))) {
- if ((pi->sh->chip ==
- BCM4716_CHIP_ID)
- && (pi->sh->chippkg ==
- BCM4717_PKG_ID)) {
- spuravoid = 0;
- } else {
- spuravoid = 1;
- }
- }
+ || (val == 118)))
+ spuravoid = 1;
}
}
if (pi->phy_spuravoid == SPURAVOID_FORCEON)
spuravoid = 1;
- if ((pi->sh->chip == BCM4716_CHIP_ID) ||
- (pi->sh->chip == BCM47162_CHIP_ID)) {
- si_pmu_spuravoid(pi->sh->sih, spuravoid);
- } else {
- wlapi_bmac_core_phypll_ctl(pi->sh->physhim, false);
- si_pmu_spuravoid(pi->sh->sih, spuravoid);
- wlapi_bmac_core_phypll_ctl(pi->sh->physhim, true);
- }
+ wlapi_bmac_core_phypll_ctl(pi->sh->physhim, false);
+ si_pmu_spuravoid(pi->sh->sih, spuravoid);
+ wlapi_bmac_core_phypll_ctl(pi->sh->physhim, true);
if ((pi->sh->chip == BCM43224_CHIP_ID) ||
- (pi->sh->chip == BCM43225_CHIP_ID) ||
- (pi->sh->chip == BCM43421_CHIP_ID)) {
+ (pi->sh->chip == BCM43225_CHIP_ID)) {
if (spuravoid == 1) {
@@ -19085,10 +19030,7 @@ wlc_phy_chanspec_nphy_setup(phy_info_t *pi, chanspec_t chanspec,
}
}
- if (!((pi->sh->chip == BCM4716_CHIP_ID) ||
- (pi->sh->chip == BCM47162_CHIP_ID))) {
- wlapi_bmac_core_phypll_reset(pi->sh->physhim);
- }
+ wlapi_bmac_core_phypll_reset(pi->sh->physhim);
mod_phy_reg(pi, 0x01, (0x1 << 15),
((spuravoid > 0) ? (0x1 << 15) : 0));
@@ -21035,19 +20977,9 @@ s16 wlc_phy_tempsense_nphy(phy_info_t *pi)
wlc_phy_table_write_nphy(pi, NPHY_TBL_ID_AFECTRL, 1, 0x03, 16,
&auxADC_rssi_ctrlH_save);
- if (pi->sh->chip == BCM5357_CHIP_ID) {
- radio_temp[0] = (193 * (radio_temp[1] + radio_temp2[1])
- + 88 * (auxADC_Vl) - 27111 +
- 128) / 256;
- } else if (pi->sh->chip == BCM43236_CHIP_ID) {
- radio_temp[0] = (198 * (radio_temp[1] + radio_temp2[1])
- + 91 * (auxADC_Vl) - 27243 +
- 128) / 256;
- } else {
- radio_temp[0] = (179 * (radio_temp[1] + radio_temp2[1])
- + 82 * (auxADC_Vl) - 28861 +
- 128) / 256;
- }
+ radio_temp[0] = (179 * (radio_temp[1] + radio_temp2[1])
+ + 82 * (auxADC_Vl) - 28861 +
+ 128) / 256;
offset = (s16) pi->phy_tempsense_offset;
@@ -26237,11 +26169,6 @@ static u32 *wlc_phy_get_ipa_gaintbl_nphy(phy_info_t *pi)
} else if (NREV_IS(pi->pubpi.phy_rev, 6)) {
tx_pwrctrl_tbl = nphy_tpc_txgain_ipa_rev6;
- if (pi->sh->chip == BCM47162_CHIP_ID) {
-
- tx_pwrctrl_tbl = nphy_tpc_txgain_ipa_rev5;
- }
-
} else if (NREV_IS(pi->pubpi.phy_rev, 5)) {
tx_pwrctrl_tbl = nphy_tpc_txgain_ipa_rev5;
@@ -26781,11 +26708,8 @@ wlc_phy_a2_nphy(phy_info_t *pi, nphy_ipa_txcalgains_t *txgains,
phy_a2 = 63;
if (CHSPEC_IS2G(pi->radio_chanspec)) {
- if (pi->sh->chip == BCM6362_CHIP_ID) {
- phy_a1 = 35;
- phy_a3 = 35;
- } else if ((pi->pubpi.radiorev == 4)
- || (pi->pubpi.radiorev == 6)) {
+ if ((pi->pubpi.radiorev == 4)
+ || (pi->pubpi.radiorev == 6)) {
phy_a1 = 30;
phy_a3 = 30;
} else {
@@ -26891,16 +26815,10 @@ wlc_phy_a2_nphy(phy_info_t *pi, nphy_ipa_txcalgains_t *txgains,
if (txgains->useindex) {
phy_a4 = 15 - ((txgains->index) >> 3);
if (CHSPEC_IS2G(pi->radio_chanspec)) {
- if (NREV_GE(pi->pubpi.phy_rev, 6)) {
+ if (NREV_GE(pi->pubpi.phy_rev, 6))
phy_a5 = 0x00f7 | (phy_a4 << 8);
- if (pi->sh->chip ==
- BCM47162_CHIP_ID) {
- phy_a5 =
- 0x10f7 | (phy_a4 <<
- 8);
- }
- } else
+ else
if (NREV_IS(pi->pubpi.phy_rev, 5))
phy_a5 = 0x10f7 | (phy_a4 << 8);
else
--
1.7.1
From: Roland Vossen <[email protected]>
Code cleanup. BCM4321 is not supported by this driver. Removed 'XXX' in
comments since they do not signal a critical issue to be patched. Removed
FIXME in comment since it signalled a problem in the Minstrel algorithm,
not in our driver.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/bmac.c | 1 -
drivers/staging/brcm80211/brcmsmac/mac80211_if.c | 7 +------
drivers/staging/brcm80211/brcmsmac/main.c | 2 +-
3 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/bmac.c b/drivers/staging/brcm80211/brcmsmac/bmac.c
index 735230f..bdaad20 100644
--- a/drivers/staging/brcm80211/brcmsmac/bmac.c
+++ b/drivers/staging/brcm80211/brcmsmac/bmac.c
@@ -3567,7 +3567,6 @@ u16 brcms_b_rate_shm_offset(struct brcms_c_hw_info *wlc_hw, u8 rate)
u8 phy_rate, index;
/* get the phy specific rate encoding for the PLCP SIGNAL field */
- /* XXX4321 fixup needed ? */
if (IS_OFDM(rate))
table_ptr = M_RT_DIRMAP_A;
else
diff --git a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
index c74c186..caab99a 100644
--- a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
@@ -644,7 +644,7 @@ brcms_ops_ampdu_action(struct ieee80211_hw *hw,
tid);
return -EINVAL;
}
- /* XXX: Use the starting sequence number provided ... */
+ /* Future improvement: Use the starting sequence number provided ... */
*ssn = 0;
ieee80211_start_tx_ba_cb_irqsafe(vif, sta->addr, tid);
break;
@@ -1089,11 +1089,6 @@ static int ieee_hw_init(struct ieee80211_hw *hw)
hw->extra_tx_headroom = brcms_c_get_header_len();
hw->queues = N_TX_QUEUES;
- /* FIXME: this doesn't seem to be used properly in minstrel_ht.
- * mac80211/status.c:ieee80211_tx_status() checks this value,
- * but mac80211/rc80211_minstrel_ht.c:minstrel_ht_get_rate()
- * appears to always set 3 rates
- */
hw->max_rates = 2; /* Primary rate and 1 fallback rate */
hw->channel_change_time = 7 * 1000; /* channel change time is dependent on chip and band */
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index 64f4fe7..90293fa 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -3166,7 +3166,7 @@ void brcms_c_txq_enq(void *ctx, struct scb *scb, struct sk_buff *sdu,
"\n", wlc->pub->unit);
/*
- * XXX we might hit this condtion in case
+ * we might hit this condtion in case
* packet flooding from mac80211 stack
*/
brcmu_pkt_buf_free_skb(sdu);
--
1.7.1
From: Roland Vossen <[email protected]>
Code cleanup. Replaced Broadcom proprietary error codes with Linux native
ones.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h | 4 --
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 52 +++++++------------
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 43 ++++++++--------
.../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c | 5 +-
4 files changed, 44 insertions(+), 60 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
index f1d04e0..9359bba 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
@@ -19,10 +19,6 @@
#include "sdio_host.h"
-#define SDIOH_API_RC_SUCCESS (0x00)
-#define SDIOH_API_RC_FAIL (0x01)
-#define SDIOH_API_SUCCESS(status) (status == 0)
-
#define SDIOH_READ 0 /* Read request */
#define SDIOH_WRITE 1 /* Write request */
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
index c8e84d3..d785b05 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
@@ -105,7 +105,7 @@ bool brcmf_sdcard_intr_query(void *sdh)
ASSERT(bcmsdh);
status = brcmf_sdioh_interrupt_query(bcmsdh->sdioh, &on);
- if (SDIOH_API_SUCCESS(status))
+ if (status == 0)
return false;
else
return on;
@@ -114,41 +114,33 @@ bool brcmf_sdcard_intr_query(void *sdh)
int brcmf_sdcard_intr_enable(void *sdh)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- int status;
ASSERT(bcmsdh);
- status = brcmf_sdioh_interrupt_set(bcmsdh->sdioh, true);
- return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
+ return brcmf_sdioh_interrupt_set(bcmsdh->sdioh, true);
}
int brcmf_sdcard_intr_disable(void *sdh)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- int status;
ASSERT(bcmsdh);
- status = brcmf_sdioh_interrupt_set(bcmsdh->sdioh, false);
- return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
+ return brcmf_sdioh_interrupt_set(bcmsdh->sdioh, false);
}
int brcmf_sdcard_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- int status;
ASSERT(bcmsdh);
- status = brcmf_sdioh_interrupt_register(bcmsdh->sdioh, fn, argh);
- return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
+ return brcmf_sdioh_interrupt_register(bcmsdh->sdioh, fn, argh);
}
int brcmf_sdcard_intr_dereg(void *sdh)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- int status;
ASSERT(bcmsdh);
- status = brcmf_sdioh_interrupt_deregister(bcmsdh->sdioh);
- return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
+ return brcmf_sdioh_interrupt_deregister(bcmsdh->sdioh);
}
#if defined(BCMDBG)
@@ -192,11 +184,11 @@ u8 brcmf_sdcard_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
brcmf_sdioh_cfg_read(bcmsdh->sdioh, fnc_num, addr,
(u8 *) &data);
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
- } while (!SDIOH_API_SUCCESS(status)
+ } while (status != 0
&& (retry++ < SDIOH_API_ACCESS_RETRY_LIMIT));
#endif
if (err)
- *err = (SDIOH_API_SUCCESS(status) ? 0 : -EIO);
+ *err = status;
BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u8data = 0x%x\n",
__func__, fnc_num, addr, data));
@@ -227,11 +219,11 @@ brcmf_sdcard_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
brcmf_sdioh_cfg_write(bcmsdh->sdioh, fnc_num, addr,
(u8 *) &data);
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
- } while (!SDIOH_API_SUCCESS(status)
+ } while (status != 0
&& (retry++ < SDIOH_API_ACCESS_RETRY_LIMIT));
#endif
if (err)
- *err = SDIOH_API_SUCCESS(status) ? 0 : -EIO;
+ *err = status;
BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u8data = 0x%x\n",
__func__, fnc_num, addr, data));
@@ -252,7 +244,7 @@ u32 brcmf_sdcard_cfg_read_word(void *sdh, uint fnc_num, u32 addr, int *err)
SDIOH_READ, fnc_num, addr, &data, 4);
if (err)
- *err = (SDIOH_API_SUCCESS(status) ? 0 : -EIO);
+ *err = status;
BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u32data = 0x%x\n",
__func__, fnc_num, addr, data));
@@ -277,7 +269,7 @@ brcmf_sdcard_cfg_write_word(void *sdh, uint fnc_num, u32 addr, u32 data,
SDIOH_WRITE, fnc_num, addr, &data, 4);
if (err)
- *err = (SDIOH_API_SUCCESS(status) ? 0 : -EIO);
+ *err = status;
BCMSDH_INFO(("%s:fun = %d, addr = 0x%x, u32data = 0x%x\n",
__func__, fnc_num, addr, data));
@@ -320,7 +312,7 @@ int brcmf_sdcard_cis_read(void *sdh, uint func, u8 * cis, uint length)
kfree(tmp_buf);
}
- return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
+ return status;
}
static int brcmf_sdcard_set_sbaddr_window(void *sdh, u32 address)
@@ -371,12 +363,12 @@ u32 brcmf_sdcard_reg_read(void *sdh, u32 addr, uint size)
status = brcmf_sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
SDIOH_READ, SDIO_FUNC_1, addr, &word, size);
- bcmsdh->regfail = !(SDIOH_API_SUCCESS(status));
+ bcmsdh->regfail = (status != 0);
BCMSDH_INFO(("u32data = 0x%x\n", word));
/* if ok, return appropriately masked word */
- if (SDIOH_API_SUCCESS(status)) {
+ if (status == 0) {
switch (size) {
case sizeof(u8):
return word & 0xff;
@@ -425,9 +417,9 @@ u32 brcmf_sdcard_reg_write(void *sdh, u32 addr, uint size, u32 data)
status =
brcmf_sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
SDIOH_WRITE, SDIO_FUNC_1, addr, &data, size);
- bcmsdh->regfail = !(SDIOH_API_SUCCESS(status));
+ bcmsdh->regfail = (status != 0);
- if (SDIOH_API_SUCCESS(status))
+ if (status == 0)
return 0;
BCMSDH_ERROR(("%s: error writing 0x%08x to addr 0x%04x size %d\n",
@@ -480,7 +472,7 @@ brcmf_sdcard_recv_buf(struct brcmf_sdio *bcmsdh, u32 addr, uint fn, uint flags,
status = brcmf_sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO,
incr_fix, SDIOH_READ, fn, addr, width, nbytes, buf, pkt);
- return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
+ return status;
}
int
@@ -489,7 +481,6 @@ brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags,
bcmsdh_cmplt_fn_t complete, void *handle)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- int status;
uint incr_fix;
uint width;
uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
@@ -521,16 +512,13 @@ brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags,
if (width == 4)
addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
- status = brcmf_sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO,
+ return brcmf_sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO,
incr_fix, SDIOH_WRITE, fn, addr, width, nbytes, buf, pkt);
-
- return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}
int brcmf_sdcard_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- int status;
ASSERT(bcmsdh);
ASSERT(bcmsdh->init_success);
@@ -539,11 +527,9 @@ int brcmf_sdcard_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes)
addr &= SBSDIO_SB_OFT_ADDR_MASK;
addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
- status = brcmf_sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO,
+ return brcmf_sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO,
SDIOH_DATA_INC, (rw ? SDIOH_WRITE : SDIOH_READ), SDIO_FUNC_1,
addr, 4, nbytes, buf, NULL);
-
- return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}
int brcmf_sdcard_abort(void *sdh, uint fn)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 167181d..0413a59 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -20,6 +20,7 @@
#include <linux/mmc/sdio_func.h>
#include <linux/mmc/sdio_ids.h>
#include <linux/suspend.h>
+#include <linux/errno.h>
#include <defs.h>
#include <brcm_hw_ids.h>
@@ -177,7 +178,7 @@ extern int brcmf_sdioh_detach(struct sdioh_info *sd)
kfree(sd);
}
- return SDIOH_API_RC_SUCCESS;
+ return 0;
}
/* Configure callback to client when we receive client interrupt */
@@ -189,7 +190,7 @@ brcmf_sdioh_interrupt_register(struct sdioh_info *sd, sdioh_cb_fn_t fn,
if (fn == NULL) {
sd_err(("%s: interrupt handler is NULL, not registering\n",
__func__));
- return SDIOH_API_RC_FAIL;
+ return -EINVAL;
}
sd->intr_handler = fn;
@@ -209,7 +210,7 @@ brcmf_sdioh_interrupt_register(struct sdioh_info *sd, sdioh_cb_fn_t fn,
sdio_release_host(gInstance->func[1]);
}
- return SDIOH_API_RC_SUCCESS;
+ return 0;
}
extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd)
@@ -235,7 +236,7 @@ extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd)
sd->intr_handler = NULL;
sd->intr_handler_arg = NULL;
- return SDIOH_API_RC_SUCCESS;
+ return 0;
}
extern int
@@ -243,7 +244,7 @@ brcmf_sdioh_interrupt_query(struct sdioh_info *sd, bool *onoff)
{
sd_trace(("%s: Entering\n", __func__));
*onoff = sd->client_intr_enabled;
- return SDIOH_API_RC_SUCCESS;
+ return 0;
}
#if defined(BCMDBG)
@@ -504,7 +505,7 @@ brcmf_sdioh_cis_read(struct sdioh_info *sd, uint func, u8 *cisd, u32 length)
if (!sd->func_cis_ptr[func]) {
memset(cis, 0, length);
sd_err(("%s: no func_cis_ptr[%d]\n", __func__, func));
- return SDIOH_API_RC_FAIL;
+ return -ENOTSUPP;
}
sd_err(("%s: func_cis_ptr[%d]=0x%04x\n", __func__, func,
@@ -515,14 +516,14 @@ brcmf_sdioh_cis_read(struct sdioh_info *sd, uint func, u8 *cisd, u32 length)
if (brcmf_sdioh_card_regread(sd, 0, offset, 1, &foo) < 0) {
sd_err(("%s: regread failed: Can't read CIS\n",
__func__));
- return SDIOH_API_RC_FAIL;
+ return -EIO;
}
*cis = (u8) (foo & 0xff);
cis++;
}
- return SDIOH_API_RC_SUCCESS;
+ return 0;
}
extern int
@@ -535,7 +536,7 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
regaddr));
BRCMF_PM_RESUME_WAIT(sdioh_request_byte_wait);
- BRCMF_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL);
+ BRCMF_PM_RESUME_RETURN_ERROR(-EIO);
if (rw) { /* CMD52 Write */
if (func == 0) {
/* Can only directly write to some F0 registers.
@@ -619,25 +620,25 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
"Err: %d\n", rw ? "Write" : "Read", func, regaddr,
*byte, err_ret));
- return ((err_ret == 0) ? SDIOH_API_RC_SUCCESS : SDIOH_API_RC_FAIL);
+ return err_ret;
}
extern int
brcmf_sdioh_request_word(struct sdioh_info *sd, uint cmd_type, uint rw,
uint func, uint addr, u32 *word, uint nbytes)
{
- int err_ret = SDIOH_API_RC_FAIL;
+ int err_ret = -EIO;
if (func == 0) {
sd_err(("%s: Only CMD52 allowed to F0.\n", __func__));
- return SDIOH_API_RC_FAIL;
+ return -EINVAL;
}
sd_info(("%s: cmd_type=%d, rw=%d, func=%d, addr=0x%05x, nbytes=%d\n",
__func__, cmd_type, rw, func, addr, nbytes));
BRCMF_PM_RESUME_WAIT(sdioh_request_word_wait);
- BRCMF_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL);
+ BRCMF_PM_RESUME_RETURN_ERROR(-EIO);
/* Claim host controller */
sdio_claim_host(gInstance->func[func]);
@@ -672,7 +673,7 @@ brcmf_sdioh_request_word(struct sdioh_info *sd, uint cmd_type, uint rw,
rw ? "Write" : "Read", err_ret));
}
- return ((err_ret == 0) ? SDIOH_API_RC_SUCCESS : SDIOH_API_RC_FAIL);
+ return err_ret;
}
static int
@@ -689,7 +690,7 @@ brcmf_sdioh_request_packet(struct sdioh_info *sd, uint fix_inc, uint write,
ASSERT(pkt);
BRCMF_PM_RESUME_WAIT(sdioh_request_packet_wait);
- BRCMF_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL);
+ BRCMF_PM_RESUME_RETURN_ERROR(-EIO);
/* Claim host controller */
sdio_claim_host(gInstance->func[func]);
@@ -746,7 +747,7 @@ brcmf_sdioh_request_packet(struct sdioh_info *sd, uint fix_inc, uint write,
sdio_release_host(gInstance->func[func]);
sd_trace(("%s: Exit\n", __func__));
- return ((err_ret == 0) ? SDIOH_API_RC_SUCCESS : SDIOH_API_RC_FAIL);
+ return err_ret;
}
/*
@@ -775,7 +776,7 @@ brcmf_sdioh_request_buffer(struct sdioh_info *sd, uint pio_dma, uint fix_inc,
sd_trace(("%s: Enter\n", __func__));
BRCMF_PM_RESUME_WAIT(sdioh_request_buffer_wait);
- BRCMF_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL);
+ BRCMF_PM_RESUME_RETURN_ERROR(-EIO);
/* Case 1: we don't have a packet. */
if (pkt == NULL) {
sd_data(("%s: Creating new %s Packet, len=%d\n",
@@ -784,7 +785,7 @@ brcmf_sdioh_request_buffer(struct sdioh_info *sd, uint pio_dma, uint fix_inc,
if (!mypkt) {
sd_err(("%s: brcmu_pkt_buf_get_skb failed: len %d\n",
__func__, buflen_u));
- return SDIOH_API_RC_FAIL;
+ return -EIO;
}
/* For a write, copy the buffer data into the packet. */
@@ -811,7 +812,7 @@ brcmf_sdioh_request_buffer(struct sdioh_info *sd, uint pio_dma, uint fix_inc,
if (!mypkt) {
sd_err(("%s: brcmu_pkt_buf_get_skb failed: len %d\n",
__func__, pkt->len));
- return SDIOH_API_RC_FAIL;
+ return -EIO;
}
/* For a write, copy the buffer data into the packet. */
@@ -848,7 +849,7 @@ extern int brcmf_sdioh_abort(struct sdioh_info *sd, uint func)
&t_func);
sd_trace(("%s: Exit\n", __func__));
- return SDIOH_API_RC_SUCCESS;
+ return 0;
}
/* Reset and re-initialize the device */
@@ -856,7 +857,7 @@ int brcmf_sdioh_reset(struct sdioh_info *si)
{
sd_trace(("%s: Enter\n", __func__));
sd_trace(("%s: Exit\n", __func__));
- return SDIOH_API_RC_SUCCESS;
+ return 0;
}
/* Disable device interrupt */
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
index 39b0cbe..f10cddd 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
@@ -20,6 +20,7 @@
#include <linux/mmc/card.h>
#include <linux/mmc/sdio_func.h>
#include <linux/mmc/sdio_ids.h>
+#include <linux/errno.h>
#include <net/cfg80211.h>
#include <defs.h>
@@ -227,7 +228,7 @@ int brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable)
if (enable && !(sd->intr_handler && sd->intr_handler_arg)) {
sd_err(("%s: no handler registered, will not enable\n",
__func__));
- return SDIOH_API_RC_FAIL;
+ return -EINVAL;
}
/* Ensure atomicity for enable/disable calls */
@@ -241,7 +242,7 @@ int brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable)
spin_unlock_irqrestore(&sdos->lock, flags);
- return SDIOH_API_RC_SUCCESS;
+ return 0;
}
/*
--
1.7.1
From: Arend van Spriel <[email protected]>
structure have been renamed for consistency and the structure typedefs
have been removed.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 16 ++++++++--------
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 6 ++++--
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 6 +++---
drivers/staging/brcm80211/brcmfmac/dhd_proto.h | 6 +++---
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 2 +-
5 files changed, 19 insertions(+), 17 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 77b381c..d69cee1 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -595,19 +595,19 @@ typedef struct dhd_pub {
} dhd_pub_t;
-typedef struct dhd_if_event {
+struct brcmf_if_event {
u8 ifidx;
u8 action;
u8 flags;
u8 bssidx;
-} dhd_if_event_t;
+};
-typedef struct {
+struct brcmf_timeout {
u32 limit; /* Expiration time (usec) */
u32 increment; /* Current expiration increment (usec) */
u32 elapsed; /* Current elapsed time (usec) */
u32 tick; /* O/S tick time (usec) */
-} dhd_timeout_t;
+};
typedef struct {
uint event;
@@ -803,8 +803,8 @@ extern void brcmf_os_sdunlock_eventq(dhd_pub_t *pub);
extern int brcmf_write_to_file(dhd_pub_t *dhd, u8 *buf, int size);
#endif /* BCMDBG */
-extern void brcmf_timeout_start(dhd_timeout_t *tmo, uint usec);
-extern int brcmf_timeout_expired(dhd_timeout_t *tmo);
+extern void brcmf_timeout_start(struct brcmf_timeout *tmo, uint usec);
+extern int brcmf_timeout_expired(struct brcmf_timeout *tmo);
extern int brcmf_ifname2idx(struct dhd_info *dhd, char *name);
extern int brcmf_c_host_event(struct dhd_info *dhd, int *idx, void *pktdata,
@@ -843,7 +843,7 @@ extern void osl_assert(char *exp, char *file, int line);
#endif /* defined(BCMDBG) */
/* Linux network driver ioctl encoding */
-typedef struct dhd_ioctl {
+struct brcmf_c_ioctl {
uint cmd; /* common ioctl definition */
void *buf; /* pointer to user buffer */
uint len; /* length of user buffer */
@@ -851,7 +851,7 @@ typedef struct dhd_ioctl {
uint used; /* bytes read or written (optional) */
uint needed; /* bytes needed (optional) */
uint driver; /* to identify target driver */
-} dhd_ioctl_t;
+};
/* per-driver magic numbers */
#define BRCMF_IOCTL_MAGIC 0x00444944
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 9b0ad44..de07526 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -360,7 +360,8 @@ exit:
return bcmerror;
}
-int brcmf_c_ioctl(dhd_pub_t *drvr, dhd_ioctl_t *ioc, void *buf, uint buflen)
+int brcmf_c_ioctl(dhd_pub_t *drvr, struct brcmf_c_ioctl *ioc, void *buf,
+ uint buflen)
{
int bcmerror = 0;
@@ -790,7 +791,8 @@ brcmf_c_host_event(struct dhd_info *drvr_priv, int *ifidx, void *pktdata,
switch (type) {
case BRCMF_E_IF:
{
- dhd_if_event_t *ifevent = (dhd_if_event_t *) event_data;
+ struct brcmf_if_event *ifevent =
+ (struct brcmf_if_event *) event_data;
DHD_TRACE(("%s: if event\n", __func__));
if (ifevent->ifidx > 0 &&
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 2135a64..2705ec0 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -320,7 +320,7 @@ static void brcmf_late_resume(struct early_suspend *h)
* fatal();
*/
-void brcmf_timeout_start(dhd_timeout_t *tmo, uint usec)
+void brcmf_timeout_start(struct brcmf_timeout *tmo, uint usec)
{
tmo->limit = usec;
tmo->increment = 0;
@@ -328,7 +328,7 @@ void brcmf_timeout_start(dhd_timeout_t *tmo, uint usec)
tmo->tick = 1000000 / HZ;
}
-int brcmf_timeout_expired(dhd_timeout_t *tmo)
+int brcmf_timeout_expired(struct brcmf_timeout *tmo)
{
/* Does nothing the first call */
if (tmo->increment == 0) {
@@ -1197,7 +1197,7 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
int cmd)
{
dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(net);
- dhd_ioctl_t ioc;
+ struct brcmf_c_ioctl ioc;
int bcmerror = 0;
int buflen = 0;
void *buf = NULL;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_proto.h b/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
index 4ac2cd1..c78ae94 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
@@ -53,7 +53,7 @@ extern int brcmf_proto_hdrpull(dhd_pub_t *, int *ifidx, struct sk_buff *rxp);
/* Use protocol to issue ioctl to dongle */
extern int brcmf_proto_ioctl(dhd_pub_t *dhd, int ifidx, struct brcmf_ioctl *ioc,
- void *buf, int len);
+ void *buf, int len);
/* Check for and handle local prot-specific iovar commands */
extern int brcmf_proto_iovar_op(dhd_pub_t *dhdp, const char *name,
@@ -66,8 +66,8 @@ extern void brcmf_proto_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf);
/* Update local copy of dongle statistics */
extern void brcmf_proto_dstats(dhd_pub_t *dhdp);
-extern int brcmf_c_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf,
- uint buflen);
+extern int brcmf_c_ioctl(dhd_pub_t *dhd_pub, struct brcmf_c_ioctl *ioc,
+ void *buf, uint buflen);
extern int brcmf_c_preinit_ioctls(dhd_pub_t *dhd);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 8607972..ab96d37 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -3130,7 +3130,7 @@ void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
int brcmf_sdbrcm_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
{
dhd_bus_t *bus = dhdp->bus;
- dhd_timeout_t tmo;
+ struct brcmf_timeout tmo;
uint retries = 0;
u8 ready, enable;
int err, ret = 0;
--
1.7.1
From: Arend van Spriel <[email protected]>
The file types.h contains several occurrences of the checkpatch
error "(foo*)" should be "(foo *)". This has been fixed in this
patch.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/types.h | 30 ++++++++++++++--------------
1 files changed, 15 insertions(+), 15 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/types.h b/drivers/staging/brcm80211/brcmsmac/types.h
index 163973d..af1514e 100644
--- a/drivers/staging/brcm80211/brcmsmac/types.h
+++ b/drivers/staging/brcm80211/brcmsmac/types.h
@@ -257,9 +257,9 @@ do { \
#define R_REG(r) \
({\
sizeof(*(r)) == sizeof(u8) ? \
- readb((volatile u8*)(r)) : \
- sizeof(*(r)) == sizeof(u16) ? readw((volatile u16*)(r)) : \
- readl((volatile u32*)(r)); \
+ readb((u8 *)(r)) : \
+ sizeof(*(r)) == sizeof(u16) ? readw((u16 *)(r)) : \
+ readl((u32 *)(r)); \
})
#else /* __mips__ */
#define R_REG(r) \
@@ -268,14 +268,14 @@ do { \
__asm__ __volatile__("sync"); \
switch (sizeof(*(r))) { \
case sizeof(u8): \
- __osl_v = readb((volatile u8*)(r)); \
+ __osl_v = readb((u8 *)(r)); \
break; \
case sizeof(u16): \
- __osl_v = readw((volatile u16*)(r)); \
+ __osl_v = readw((u16 *)(r)); \
break; \
case sizeof(u32): \
__osl_v = \
- readl((volatile u32*)(r)); \
+ readl((u32 *)(r)); \
break; \
} \
__asm__ __volatile__("sync"); \
@@ -286,11 +286,11 @@ do { \
#define W_REG(r, v) do { \
switch (sizeof(*(r))) { \
case sizeof(u8): \
- writeb((u8)(v), (volatile u8*)(r)); break; \
+ writeb((u8)(v), (u8 *)(r)); break; \
case sizeof(u16): \
- writew((u16)(v), (volatile u16*)(r)); break; \
+ writew((u16)(v), (u16 *)(r)); break; \
case sizeof(u32): \
- writel((u32)(v), (volatile u32*)(r)); break; \
+ writel((u32)(v), (u32 *)(r)); break; \
}; \
} while (0)
#else /* __BIG_ENDIAN */
@@ -300,14 +300,14 @@ do { \
switch (sizeof(*(r))) { \
case sizeof(u8): \
__osl_v = \
- readb((volatile u8*)((r)^3)); \
+ readb((u8 *)((r)^3)); \
break; \
case sizeof(u16): \
__osl_v = \
- readw((volatile u16*)((r)^2)); \
+ readw((u16 *)((r)^2)); \
break; \
case sizeof(u32): \
- __osl_v = readl((volatile u32*)(r)); \
+ __osl_v = readl((u32 *)(r)); \
break; \
} \
__osl_v; \
@@ -317,13 +317,13 @@ do { \
switch (sizeof(*(r))) { \
case sizeof(u8): \
writeb((u8)(v), \
- (volatile u8*)((r)^3)); break; \
+ (u8 *)((r)^3)); break; \
case sizeof(u16): \
writew((u16)(v), \
- (volatile u16*)((r)^2)); break; \
+ (u16 *)((r)^2)); break; \
case sizeof(u32): \
writel((u32)(v), \
- (volatile u32*)(r)); break; \
+ (u32 *)(r)); break; \
} \
} while (0)
#endif /* __BIG_ENDIAN */
--
1.7.1
From: Arend van Spriel <[email protected]>
The naming convention of the drivers is to be made consistent. This
commit fixes the function in dhd_common.c and use the new names from
the calling code.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 16 ++--
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 2 +-
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 90 +++++++++++-----------
drivers/staging/brcm80211/brcmfmac/dhd_dbg.h | 56 +++++++-------
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 26 +++---
drivers/staging/brcm80211/brcmfmac/dhd_proto.h | 4 +-
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 8 +-
7 files changed, 101 insertions(+), 101 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 4fcdf9d..b16ffc2 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -875,8 +875,8 @@ extern uint dhd_pktgen_len;
#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[];
@@ -938,7 +938,7 @@ extern void dhd_detach(dhd_pub_t *dhdp);
/* 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. */
@@ -992,10 +992,10 @@ extern int dhd_timeout_expired(dhd_timeout_t *tmo);
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);
@@ -1022,9 +1022,9 @@ extern void dhd_wait_for_event(dhd_pub_t *dhd, bool * lockvar);
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
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index 1d94438..af78764 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -513,7 +513,7 @@ int dhd_prot_init(dhd_pub_t *dhd)
dhd_os_proto_unblock(dhd);
#ifdef EMBEDDED_PLATFORM
- ret = dhd_preinit_ioctls(dhd);
+ ret = brcmf_c_preinit_ioctls(dhd);
#endif /* EMBEDDED_PLATFORM */
/* Always assumes wl for now */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index cb7e455..849203c 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -31,9 +31,9 @@
#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);
@@ -54,11 +54,11 @@ void dhd_iscan_unlock(void);
#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 */
@@ -82,8 +82,8 @@ enum {
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}
@@ -128,7 +128,7 @@ struct msgtrace_hdr {
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.
@@ -138,20 +138,21 @@ void dhd_common_init(void)
* 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;
@@ -159,7 +160,7 @@ static int dhd_dump(dhd_pub_t *dhdp, char *buf, int buflen)
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);
@@ -209,7 +210,7 @@ static int dhd_dump(dhd_pub_t *dhdp, char *buf, int buflen)
}
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)
{
@@ -228,16 +229,16 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
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):
@@ -265,7 +266,7 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
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
@@ -322,7 +323,7 @@ exit:
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;
@@ -377,7 +378,7 @@ bool dhd_prec_enq(dhd_pub_t *dhdp, struct pktq *q, struct sk_buff *pkt,
}
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;
@@ -396,7 +397,7 @@ dhd_iovar_op(dhd_pub_t *dhd_pub, const char *name,
/* 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;
@@ -423,14 +424,14 @@ dhd_iovar_op(dhd_pub_t *dhd_pub, const char *name,
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;
@@ -474,13 +475,12 @@ int dhd_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf, uint buflen)
/* 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;
@@ -517,7 +517,7 @@ int dhd_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf, uint buflen)
}
#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;
@@ -823,7 +823,7 @@ static void wl_show_host_event(wl_event_msg_t *event, void *event_data)
#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 */
@@ -919,14 +919,14 @@ wl_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
}
#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) {
@@ -949,7 +949,7 @@ static int wl_pattern_atoh(char *src, char *dst)
}
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];
@@ -1019,7 +1019,7 @@ fail:
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;
@@ -1108,7 +1108,7 @@ void dhd_pktfilter_offload_set(dhd_pub_t *dhd, char *arg)
/* 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]) {
@@ -1118,7 +1118,7 @@ void dhd_pktfilter_offload_set(dhd_pub_t *dhd, char *arg)
/* 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]);
@@ -1156,7 +1156,7 @@ fail:
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;
@@ -1173,7 +1173,7 @@ void dhd_arp_offload_set(dhd_pub_t *dhd, int arp_mode)
__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;
@@ -1190,7 +1190,7 @@ void dhd_arp_offload_enable(dhd_pub_t *dhd, int arp_enable)
__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 */
@@ -1291,8 +1291,8 @@ int dhd_preinit_ioctls(dhd_pub_t *dhd)
#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
@@ -1301,9 +1301,9 @@ int dhd_preinit_ioctls(dhd_pub_t *dhd)
/* 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);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h b/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h
index d0fa231..2cbfb51 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h
@@ -19,47 +19,47 @@
#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) */
@@ -95,6 +95,6 @@
#define DHD_LOG(args)
#define DHD_NONE(args)
-extern int dhd_msg_level;
+extern int brcmf_msg_level;
#endif /* _dhd_dbg_ */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index ed4a296..da39948 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -252,7 +252,7 @@ bool dhd_no_fw_req;
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;
@@ -388,8 +388,8 @@ static void dhd_set_packet_filter(int value, dhd_pub_t *dhd)
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);
}
}
@@ -1634,7 +1634,7 @@ static int dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
/* 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;
@@ -1810,9 +1810,9 @@ dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen)
/* 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));
@@ -1877,8 +1877,8 @@ dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen)
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 */
@@ -1980,11 +1980,11 @@ int dhd_bus_start(dhd_pub_t *dhdp)
/* 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;
}
}
@@ -2506,7 +2506,7 @@ dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
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;
@@ -2625,7 +2625,7 @@ void dhd_dev_init_ioctl(struct net_device *dev)
{
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
- dhd_preinit_ioctls(&dhd->pub);
+ brcmf_c_preinit_ioctls(&dhd->pub);
}
#ifdef PNO_SUPPORT
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_proto.h b/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
index f75eb1c..fccd3dd 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
@@ -66,10 +66,10 @@ extern void dhd_prot_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf);
/* Update local copy of dongle statistics */
extern void dhd_prot_dstats(dhd_pub_t *dhdp);
-extern int dhd_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf,
+extern int brcmf_c_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf,
uint buflen);
-extern int dhd_preinit_ioctls(dhd_pub_t *dhd);
+extern int brcmf_c_preinit_ioctls(dhd_pub_t *dhd);
#if defined(CONFIG_HAS_EARLYSUSPEND)
extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 19ac421..7e7d288 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -1375,7 +1375,7 @@ int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
/* Priority based enq */
spin_lock_bh(&bus->txqlock);
- if (dhd_prec_enq(bus->dhd, &bus->txq, pkt, prec) == false) {
+ if (brcmf_c_prec_enq(bus->dhd, &bus->txq, pkt, prec) == false) {
skb_pull(pkt, SDPCM_HDRLEN);
dhd_txcomplete(bus->dhd, pkt, false);
brcmu_pkt_buf_free_skb(pkt);
@@ -2784,7 +2784,7 @@ exit:
dhd_os_sdunlock(bus->dhd);
if (actionid == IOV_SVAL(IOV_DEVRESET) && bool_val == false)
- dhd_preinit_ioctls((dhd_pub_t *) bus->dhd);
+ brcmf_c_preinit_ioctls((dhd_pub_t *) bus->dhd);
return bcmerror;
}
@@ -5213,7 +5213,7 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
forcealign = true;
- dhd_common_init();
+ brcmf_c_init();
DHD_TRACE(("%s: Enter\n", __func__));
DHD_INFO(("%s: venid 0x%04x devid 0x%04x\n", __func__, venid, devid));
@@ -5660,7 +5660,7 @@ static int brcmf_sdbrcm_download_code_file(struct dhd_bus *bus, char *fw_path)
void *image = NULL;
u8 *memblock = NULL, *memptr;
- DHD_INFO(("%s: download firmware %s\n", __func__, fw_path));
+ DHD_INFO(("%s: download firmware %s\n", __func__, brcmf_fw_path));
image = dhd_os_open_image(fw_path);
if (image == NULL)
--
1.7.1
From: Arend van Spriel <[email protected]>
The conditional code for ARP offloading is now always enabled
in the fullmac driver.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/Makefile | 1 -
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 2 --
2 files changed, 0 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/Makefile b/drivers/staging/brcm80211/brcmfmac/Makefile
index 07b9340..8a7cbf3 100644
--- a/drivers/staging/brcm80211/brcmfmac/Makefile
+++ b/drivers/staging/brcm80211/brcmfmac/Makefile
@@ -16,7 +16,6 @@
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
ccflags-y := \
- -DARP_OFFLOAD_SUPPORT \
-DBCMLXSDMMC \
-DBCMPLATFORM_BUS \
-DBCMSDIO \
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index deb8566..8f593cf 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -1283,12 +1283,10 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_SCAN_UNASSOC_TIME,
(char *)&scan_unassoc_time, sizeof(scan_unassoc_time));
-#ifdef ARP_OFFLOAD_SUPPORT
/* Set and enable ARP offload feature */
if (brcmf_arp_enable)
brcmf_c_arp_offload_set(dhd, brcmf_arp_mode);
brcmf_c_arp_offload_enable(dhd, brcmf_arp_enable);
-#endif /* ARP_OFFLOAD_SUPPORT */
#ifdef PKT_FILTER_SUPPORT
{
--
1.7.1
Dpc thread handles data transaction which should be placed in
bus interface layer. Move related code to dhd_sdio.c for clean up.
Signed-off-by: Franky Lin <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_bus.h | 2 -
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 113 ---------------------
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 128 +++++++++++++++++++++---
3 files changed, 112 insertions(+), 131 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
index eab5cdd..1038ddb 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
@@ -58,8 +58,6 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
extern int
brcmf_sdbrcm_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
-/* Deferred processing for the bus, return true requests reschedule */
-extern bool dhd_bus_dpc(struct dhd_bus *bus);
extern void dhd_bus_isr(bool *InterruptRecognized,
bool *QueueMiniportHandleInterrupt, void *arg);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 8491b4e..fac8302 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -82,13 +82,10 @@ typedef struct dhd_info {
struct semaphore proto_sem;
wait_queue_head_t ioctl_resp_wait;
- struct tasklet_struct tasklet;
spinlock_t sdlock;
/* Thread based operation */
bool threads_only;
struct semaphore sdsem;
- struct task_struct *dpc_tsk;
- struct semaphore dpc_sem;
/* Thread to issue ioctl for multicast */
struct task_struct *sysioc_tsk;
@@ -145,11 +142,6 @@ module_param(brcmf_pkt_filter_init, uint, 0);
uint brcmf_master_mode = true;
module_param(brcmf_master_mode, uint, 1);
-/* DPC thread priority, -1 to use tasklet */
-int brcmf_dpc_prio = 98;
-module_param(brcmf_dpc_prio, int, 0);
-
-/* DPC thread priority, -1 to use tasklet */
extern int brcmf_dongle_memsize;
module_param(brcmf_dongle_memsize, int, 0);
@@ -190,10 +182,6 @@ extern uint brcmf_rxbound;
module_param(brcmf_txbound, uint, 0);
module_param(brcmf_rxbound, uint, 0);
-/* Deferred transmits */
-extern uint brcmf_deferred_tx;
-module_param(brcmf_deferred_tx, uint, 0);
-
#ifdef SDTEST
/* Echo packet generator (pkts/s) */
uint brcmf_pktgen;
@@ -211,7 +199,6 @@ module_param(brcmf_pktgen_len, uint, 0);
#define DHD_COMPILED
#endif
-static void brcmf_dpc(unsigned long data);
static int brcmf_toe_get(dhd_info_t *dhd, int idx, u32 *toe_ol);
static int brcmf_toe_set(dhd_info_t *dhd, int idx, u32 toe_ol);
static int brcmf_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
@@ -1012,69 +999,6 @@ static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net)
return &ifp->stats;
}
-static int brcmf_dpc_thread(void *data)
-{
- dhd_info_t *dhd = (dhd_info_t *) data;
-
- /* This thread doesn't need any user-level access,
- * so get rid of all our resources
- */
- if (brcmf_dpc_prio > 0) {
- struct sched_param param;
- param.sched_priority =
- (brcmf_dpc_prio <
- MAX_RT_PRIO) ? brcmf_dpc_prio : (MAX_RT_PRIO - 1);
- sched_setscheduler(current, SCHED_FIFO, ¶m);
- }
-
- allow_signal(SIGTERM);
- /* Run until signal received */
- while (1) {
- if (kthread_should_stop())
- break;
- if (down_interruptible(&dhd->dpc_sem) == 0) {
- /* Call bus dpc unless it indicated down
- (then clean stop) */
- if (dhd->pub.busstate != DHD_BUS_DOWN) {
- if (dhd_bus_dpc(dhd->pub.bus)) {
- up(&dhd->dpc_sem);
- }
- } else {
- brcmf_sdbrcm_bus_stop(dhd->pub.bus, true);
- }
- } else
- break;
- }
- return 0;
-}
-
-static void brcmf_dpc(unsigned long data)
-{
- dhd_info_t *dhd;
-
- dhd = (dhd_info_t *) data;
-
- /* Call bus dpc unless it indicated down (then clean stop) */
- if (dhd->pub.busstate != DHD_BUS_DOWN) {
- if (dhd_bus_dpc(dhd->pub.bus))
- tasklet_schedule(&dhd->tasklet);
- } else {
- brcmf_sdbrcm_bus_stop(dhd->pub.bus, true);
- }
-}
-
-void brcmf_sched_dpc(dhd_pub_t *dhdp)
-{
- dhd_info_t *dhd = (dhd_info_t *) dhdp->info;
-
- if (dhd->dpc_tsk) {
- up(&dhd->dpc_sem);
- return;
- }
-
- tasklet_schedule(&dhd->tasklet);
-}
-
/* Retrieve current toe component enables, which are kept
as a bitmap in toe_ol iovar */
static int brcmf_toe_get(dhd_info_t *dhd, int ifidx, u32 *toe_ol)
@@ -1598,21 +1522,6 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
else
dhd->threads_only = false;
- /* Set up the bottom half handler */
- if (brcmf_dpc_prio >= 0) {
- /* Initialize DPC thread */
- sema_init(&dhd->dpc_sem, 0);
- dhd->dpc_tsk = kthread_run(brcmf_dpc_thread, dhd, "dhd_dpc");
- if (IS_ERR(dhd->dpc_tsk)) {
- printk(KERN_WARNING
- "dhd_dpc thread failed to start\n");
- dhd->dpc_tsk = NULL;
- }
- } else {
- tasklet_init(&dhd->tasklet, brcmf_dpc, (unsigned long) dhd);
- dhd->dpc_tsk = NULL;
- }
-
if (brcmf_sysioc) {
sema_init(&dhd->sysioc_sem, 0);
dhd->sysioc_tsk = kthread_run(_brcmf_sysioc_thread, dhd,
@@ -1866,13 +1775,6 @@ void brcmf_detach(dhd_pub_t *dhdp)
unregister_netdev(ifp->net);
}
- if (dhd->dpc_tsk) {
- send_sig(SIGTERM, dhd->dpc_tsk, 1);
- kthread_stop(dhd->dpc_tsk);
- dhd->dpc_tsk = NULL;
- } else
- tasklet_kill(&dhd->tasklet);
-
if (dhd->sysioc_tsk) {
send_sig(SIGTERM, dhd->sysioc_tsk, 1);
kthread_stop(dhd->sysioc_tsk);
@@ -1907,21 +1809,6 @@ static int __init brcmf_module_init(void)
DHD_TRACE(("%s: Enter\n", __func__));
- /* Sanity check on the module parameters */
- do {
- /* Both watchdog and DPC as tasklets are ok */
- if ((brcmf_watchdog_prio < 0) && (brcmf_dpc_prio < 0))
- break;
-
- /* If both watchdog and DPC are threads, TX must be deferred */
- if ((brcmf_watchdog_prio >= 0) && (brcmf_dpc_prio >= 0)
- && brcmf_deferred_tx)
- break;
-
- DHD_ERROR(("Invalid module parameters.\n"));
- return -EINVAL;
- } while (0);
-
error = dhd_bus_register();
if (error) {
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index b79e5cd..6f69413 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -593,6 +593,10 @@ typedef struct dhd_bus {
struct completion watchdog_wait;
struct task_struct *watchdog_tsk;
bool wd_timer_valid;
+
+ struct tasklet_struct tasklet;
+ struct task_struct *dpc_tsk;
+ struct completion dpc_wait;
} dhd_bus_t;
typedef volatile struct _sbconfig {
@@ -649,7 +653,8 @@ static int tx_packets[NUMPRIO];
#endif /* BCMDBG */
/* Deferred transmit */
-const uint brcmf_deferred_tx = 1;
+uint brcmf_deferred_tx = 1;
+module_param(brcmf_deferred_tx, uint, 0);
/* Watchdog thread priority, -1 to use kernel timer */
int brcmf_watchdog_prio = 97;
@@ -659,6 +664,10 @@ module_param(brcmf_watchdog_prio, int, 0);
uint brcmf_watchdog_ms = 10;
module_param(brcmf_watchdog_ms, uint, 0);
+/* DPC thread priority, -1 to use tasklet */
+int brcmf_dpc_prio = 98;
+module_param(brcmf_dpc_prio, int, 0);
+
#ifdef BCMDBG
/* Console poll interval */
uint brcmf_console_ms;
@@ -804,6 +813,9 @@ static void brcmf_sdbrcm_wait_for_event(dhd_pub_t *dhd, bool *lockvar);
static void brcmf_sdbrcm_wait_event_wakeup(dhd_bus_t *bus);
static void brcmf_sdbrcm_watchdog(unsigned long data);
static int brcmf_sdbrcm_watchdog_thread(void *data);
+static int brcmf_sdbrcm_dpc_thread(void *data);
+static void brcmf_sdbrcm_dpc_tasklet(unsigned long data);
+static void brcmf_sdbrcm_sched_dpc(dhd_bus_t *bus);
/* Packet free applicable unconditionally for sdio and sdspi.
* Conditional if bufpool was present for gspi bus.
@@ -1355,7 +1367,7 @@ int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
/* Schedule DPC if needed to send queued packet(s) */
if (brcmf_deferred_tx && !bus->dpc_sched) {
bus->dpc_sched = true;
- brcmf_sched_dpc(bus->dhd);
+ brcmf_sdbrcm_sched_dpc(bus);
}
} else {
/* Lock: we're about to use shared data/code (and SDIO) */
@@ -3033,6 +3045,13 @@ void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
bus->watchdog_tsk = NULL;
}
+ if (bus->dpc_tsk) {
+ send_sig(SIGTERM, bus->dpc_tsk, 1);
+ kthread_stop(bus->dpc_tsk);
+ bus->dpc_tsk = NULL;
+ } else
+ tasklet_kill(&bus->tasklet);
+
/* Disable and clear interrupts at the chip level also */
W_SDREG(0, &bus->regs->hostintmask, retries);
local_hostintmask = bus->hostintmask;
@@ -4459,7 +4478,7 @@ static u32 brcmf_sdbrcm_hostmail(dhd_bus_t *bus)
return intstatus;
}
-bool brcmf_sdbrcm_dpc(dhd_bus_t *bus)
+static bool brcmf_sdbrcm_dpc(dhd_bus_t *bus)
{
struct brcmf_sdio *sdh = bus->sdh;
struct sdpcmd_regs *regs = bus->regs;
@@ -4711,17 +4730,6 @@ clkwait:
return resched;
}
-bool dhd_bus_dpc(struct dhd_bus *bus)
-{
- bool resched;
-
- /* Call the DPC directly. */
- DHD_TRACE(("Calling brcmf_sdbrcm_dpc() from %s\n", __func__));
- resched = brcmf_sdbrcm_dpc(bus);
-
- return resched;
-}
-
void brcmf_sdbrcm_isr(void *arg)
{
dhd_bus_t *bus = (dhd_bus_t *) arg;
@@ -4765,7 +4773,7 @@ void brcmf_sdbrcm_isr(void *arg)
;
#else
bus->dpc_sched = true;
- brcmf_sched_dpc(bus->dhd);
+ brcmf_sdbrcm_sched_dpc(bus);
#endif
}
@@ -5077,7 +5085,7 @@ extern bool brcmf_sdbrcm_bus_watchdog(dhd_pub_t *dhdp)
brcmf_sdcard_intr_disable(bus->sdh);
bus->dpc_sched = true;
- brcmf_sched_dpc(bus->dhd);
+ brcmf_sdbrcm_sched_dpc(bus);
}
}
@@ -5323,6 +5331,23 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
} else
bus->watchdog_tsk = NULL;
+ /* Set up the bottom half handler */
+ if (brcmf_dpc_prio >= 0) {
+ /* Initialize DPC thread */
+ init_completion(&bus->dpc_wait);
+ bus->dpc_tsk = kthread_run(brcmf_sdbrcm_dpc_thread,
+ bus, "dhd_dpc");
+ if (IS_ERR(bus->dpc_tsk)) {
+ printk(KERN_WARNING
+ "dhd_dpc thread failed to start\n");
+ bus->dpc_tsk = NULL;
+ }
+ } else {
+ tasklet_init(&bus->tasklet, brcmf_sdbrcm_dpc_tasklet,
+ (unsigned long)bus);
+ bus->dpc_tsk = NULL;
+ }
+
/* Attach to the dhd/OS/network interface */
bus->dhd = brcmf_attach(bus, SDPCM_RESERVE);
if (!bus->dhd) {
@@ -5679,6 +5704,21 @@ int dhd_bus_register(void)
{
DHD_TRACE(("%s: Enter\n", __func__));
+ /* Sanity check on the module parameters */
+ do {
+ /* Both watchdog and DPC as tasklets are ok */
+ if ((brcmf_watchdog_prio < 0) && (brcmf_dpc_prio < 0))
+ break;
+
+ /* If both watchdog and DPC are threads, TX must be deferred */
+ if ((brcmf_watchdog_prio >= 0) && (brcmf_dpc_prio >= 0)
+ && brcmf_deferred_tx)
+ break;
+
+ DHD_ERROR(("Invalid module parameters.\n"));
+ return -EINVAL;
+ } while (0);
+
return brcmf_sdio_register(&dhd_sdio);
}
@@ -6542,3 +6582,59 @@ brcmf_sdbrcm_wd_timer(struct dhd_bus *bus, uint wdtick)
save_ms = wdtick;
}
}
+
+static int brcmf_sdbrcm_dpc_thread(void *data)
+{
+ dhd_bus_t *bus = (dhd_bus_t *) data;
+
+ /* This thread doesn't need any user-level access,
+ * so get rid of all our resources
+ */
+ if (brcmf_dpc_prio > 0) {
+ struct sched_param param;
+ param.sched_priority = (brcmf_dpc_prio < MAX_RT_PRIO) ?
+ brcmf_dpc_prio : (MAX_RT_PRIO - 1);
+ sched_setscheduler(current, SCHED_FIFO, ¶m);
+ }
+
+ allow_signal(SIGTERM);
+ /* Run until signal received */
+ while (1) {
+ if (kthread_should_stop())
+ break;
+ if (!wait_for_completion_interruptible(&bus->dpc_wait)) {
+ /* Call bus dpc unless it indicated down
+ (then clean stop) */
+ if (bus->dhd->busstate != DHD_BUS_DOWN) {
+ if (brcmf_sdbrcm_dpc(bus))
+ complete(&bus->dpc_wait);
+ } else {
+ brcmf_sdbrcm_bus_stop(bus, true);
+ }
+ } else
+ break;
+ }
+ return 0;
+}
+
+static void brcmf_sdbrcm_dpc_tasklet(unsigned long data)
+{
+ dhd_bus_t *bus = (dhd_bus_t *) data;
+
+ /* Call bus dpc unless it indicated down (then clean stop) */
+ if (bus->dhd->busstate != DHD_BUS_DOWN) {
+ if (brcmf_sdbrcm_dpc(bus))
+ tasklet_schedule(&bus->tasklet);
+ } else
+ brcmf_sdbrcm_bus_stop(bus, true);
+}
+
+static void brcmf_sdbrcm_sched_dpc(dhd_bus_t *bus)
+{
+ if (bus->dpc_tsk) {
+ complete(&bus->dpc_wait);
+ return;
+ }
+
+ tasklet_schedule(&bus->tasklet);
+}
--
1.7.1
From: Arend van Spriel <[email protected]>
The common Makefile for both brcm80211 drivers defines the macro
BCMDBG upon select Kconfig item BRCMDBG. The fullmac source add
another macro DHD_DEBUG with the same meaning. This is removed
and all conditional code now checks for BCMDBG definition.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/Makefile | 2 +-
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h | 2 +-
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 2 +-
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 2 +-
drivers/staging/brcm80211/brcmfmac/dhd.h | 8 +-
drivers/staging/brcm80211/brcmfmac/dhd_bus.h | 4 +-
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 12 +-
drivers/staging/brcm80211/brcmfmac/dhd_dbg.h | 6 +-
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 10 +-
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 126 ++++++++++-----------
drivers/staging/brcm80211/brcmfmac/sdio_host.h | 2 +-
11 files changed, 87 insertions(+), 89 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/Makefile b/drivers/staging/brcm80211/brcmfmac/Makefile
index 2fcc409..a54a7d3 100644
--- a/drivers/staging/brcm80211/brcmfmac/Makefile
+++ b/drivers/staging/brcm80211/brcmfmac/Makefile
@@ -22,7 +22,7 @@ ccflags-y := \
-DBRCMF_SDALIGN=64 \
-DMAX_HDR_READ=64
-ccflags-$(CONFIG_BRCMDBG) += -DDHD_DEBUG -DSHOW_EVENTS
+ccflags-$(CONFIG_BRCMDBG) += -DSHOW_EVENTS
ccflags-y += \
-Idrivers/staging/brcm80211/brcmfmac \
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
index 88d0b02..05600e0 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
@@ -57,7 +57,7 @@ brcmf_sdioh_interrupt_query(struct sdioh_info *si, bool *onoff);
extern int
brcmf_sdioh_interrupt_set(struct sdioh_info *si, bool enable_disable);
-#if defined(DHD_DEBUG)
+#if defined(BCMDBG)
extern bool brcmf_sdioh_interrupt_pending(struct sdioh_info *si);
#endif
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
index 733ba96..72a91bd 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
@@ -160,7 +160,7 @@ int brcmf_sdcard_intr_dereg(void *sdh)
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}
-#if defined(DHD_DEBUG)
+#if defined(BCMDBG)
bool brcmf_sdcard_intr_pending(void *sdh)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 5e52813..335da48 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -330,7 +330,7 @@ brcmf_sdioh_interrupt_query(struct sdioh_info *sd, bool *onoff)
return SDIOH_API_RC_SUCCESS;
}
-#if defined(DHD_DEBUG)
+#if defined(BCMDBG)
extern bool brcmf_sdioh_interrupt_pending(struct sdioh_info *sd)
{
return 0;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 65e00a8..b7ed29c 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -777,10 +777,10 @@ extern atomic_t brcmf_mmc_suspend;
/* Watchdog timer interval */
extern uint brcmf_watchdog_ms;
-#if defined(DHD_DEBUG)
+#if defined(BCMDBG)
/* Console output poll interval */
extern uint brcmf_console_ms;
-#endif /* defined(DHD_DEBUG) */
+#endif /* defined(BCMDBG) */
/* Use interrupts */
extern uint brcmf_intr;
@@ -933,9 +933,9 @@ extern int brcmf_custom_get_mac_address(unsigned char *buf);
extern void brcmf_os_sdunlock_sndup_rxq(dhd_pub_t *pub);
extern void brcmf_os_sdlock_eventq(dhd_pub_t *pub);
extern void brcmf_os_sdunlock_eventq(dhd_pub_t *pub);
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
extern int brcmf_write_to_file(dhd_pub_t *dhd, u8 *buf, int size);
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
#if defined(OOB_INTR_ONLY)
extern int brcmf_customer_oob_irq_map(unsigned long *irq_flags_ptr);
#endif /* defined(OOB_INTR_ONLY) */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
index 73b72ff..722dbb4 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
@@ -58,11 +58,11 @@ brcmf_sdbrcm_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
/* Watchdog timer function */
extern bool brcmf_sdbrcm_bus_watchdog(dhd_pub_t *dhd);
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
/* Device console input function */
extern int
brcmf_sdbrcm_bus_console_in(dhd_pub_t *dhd, unsigned char *msg, uint msglen);
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
/* Deferred processing for the bus, return true requests reschedule */
extern bool dhd_bus_dpc(struct dhd_bus *bus);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index b481eb3..6c41088 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -39,7 +39,7 @@ char brcmf_nv_path[MOD_PARAM_PATHLEN];
#define EPI_VERSION_STR "4.218.248.5"
#define MSGTRACE_VERSION 1
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
const char brcmf_version[] =
"Dongle Host Driver, version " EPI_VERSION_STR "\nCompiled on " __DATE__
" at " __TIME__;
@@ -55,7 +55,7 @@ enum {
IOV_BCMERROR,
IOV_WDTICK,
IOV_DUMP,
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
IOV_CONS,
IOV_DCONSOLE_POLL,
#endif
@@ -71,10 +71,10 @@ enum {
const struct brcmu_iovar brcmf_iovars[] = {
{"version", IOV_VERSION, 0, IOVT_BUFFER, sizeof(brcmf_version)}
,
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
{"msglevel", IOV_MSGLEVEL, 0, IOVT_UINT32, 0}
,
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
{"bcmerrorstr", IOV_BCMERRORSTR, 0, IOVT_BUFFER, BCME_STRLEN}
,
{"bcmerror", IOV_BCMERROR, 0, IOVT_INT8, 0}
@@ -83,7 +83,7 @@ const struct brcmu_iovar brcmf_iovars[] = {
,
{"dump", IOV_DUMP, 0, IOVT_BUFFER, DHD_IOCTL_MAXLEN}
,
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
{"dconpoll", IOV_DCONSOLE_POLL, 0, IOVT_UINT32, 0}
,
{"cons", IOV_CONS, 0, IOVT_BUFFER, 0}
@@ -255,7 +255,7 @@ brcmf_c_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
bcmerror = brcmf_c_dump(dhd_pub, arg, len);
break;
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
case IOV_GVAL(IOV_DCONSOLE_POLL):
int_val = (s32) brcmf_console_ms;
memcpy(arg, &int_val, val_size);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h b/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h
index 2cbfb51..e0fc124 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h
@@ -17,7 +17,7 @@
#ifndef _dhd_dbg_
#define _dhd_dbg_
-#if defined(DHD_DEBUG)
+#if defined(BCMDBG)
#define DHD_ERROR(args) \
do {if ((brcmf_msg_level & DHD_ERROR_VAL) && (net_ratelimit())) \
@@ -61,7 +61,7 @@
#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) */
+#else /* (defined BCMDBG) || (defined BCMDBG) */
#define DHD_ERROR(args) do {if (net_ratelimit()) printk args; } while (0)
#define DHD_TRACE(args)
@@ -90,7 +90,7 @@
#define DHD_EVENT_ON() 0
#define DHD_BTA_ON() 0
#define DHD_ISCAN_ON() 0
-#endif /* defined(DHD_DEBUG) */
+#endif /* defined(BCMDBG) */
#define DHD_LOG(args)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 0764d02..6507891 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -262,11 +262,11 @@ module_param(brcmf_sysioc, uint, 0);
uint brcmf_watchdog_ms = 10;
module_param(brcmf_watchdog_ms, uint, 0);
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
/* Console poll interval */
uint brcmf_console_ms;
module_param(brcmf_console_ms, uint, 0);
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
/* ARP offload agent mode : Enable ARP Host Auto-Reply
and ARP Peer Auto-Reply */
@@ -357,7 +357,7 @@ module_param(brcmf_pktgen_len, uint, 0);
#endif
/* Version string to report */
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
#define DHD_COMPILED "\nCompiled in " SRCBASE
#else
#define DHD_COMPILED
@@ -2632,7 +2632,7 @@ void brcmf_netdev_os_wd_timer(struct net_device *ndev, uint wdtick)
brcmf_os_wd_timer(&dhd->pub, wdtick);
}
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
int brcmf_write_to_file(dhd_pub_t *dhd, u8 *buf, int size)
{
int ret = 0;
@@ -2666,7 +2666,7 @@ exit:
return ret;
}
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
#if defined(BCMDBG)
void osl_assert(char *exp, char *file, int line)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index afb840a..54a0e80 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -65,7 +65,7 @@
#define SET_REG(r, mask, val) \
W_REG((r), ((R_REG(r) & ~(mask)) | (val)))
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
/* ARM trap handling */
@@ -160,7 +160,7 @@ struct rte_console {
char cbuf[CBUF_LEN];
};
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
#include <chipcommon.h>
#include "sbsdio.h"
@@ -408,7 +408,7 @@ DHD_SPINWAIT_SLEEP_INIT(sdioh_spinwait_sleep);
#define CORE_SB(base, field) \
(base + SBCONFIGOFF + offsetof(sbconfig_t, field))
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
/* Device console log buffer state */
struct dhd_console {
uint count; /* Poll interval msec counter */
@@ -418,7 +418,7 @@ struct dhd_console {
u8 *buf; /* Log buffer (host copy) */
uint last; /* Last buffer read index */
};
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
struct sdpcm_shared {
u32 flags;
@@ -514,10 +514,10 @@ typedef struct dhd_bus {
uint polltick; /* Tick counter */
uint pollcnt; /* Count of active polls */
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
struct dhd_console console; /* Console output polling support */
uint console_addr; /* Console address from shared struct */
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
uint regfails; /* Count of R_REG/W_REG failures */
@@ -636,10 +636,10 @@ typedef volatile struct _sbconfig {
#define DHD_NOPMU(dhd) (false)
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
static int qcount[NUMPRIO];
static int tx_packets[NUMPRIO];
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
/* Deferred transmit */
const uint brcmf_deferred_tx = 1;
@@ -748,10 +748,10 @@ static void brcmf_sdbrcm_checkdied(dhd_bus_t *bus, void *pkt, uint seq);
static void brcmf_sdbrcm_sdtest_set(dhd_bus_t *bus, bool start);
#endif
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
static int brcmf_sdbrcm_checkdied(dhd_bus_t *bus, u8 *data, uint size);
static int brcmf_sdbrcm_mem_dump(dhd_bus_t *bus);
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
static int brcmf_sdbrcm_download_state(dhd_bus_t *bus, bool enter);
static void brcmf_sdbrcm_release(dhd_bus_t *bus);
@@ -922,14 +922,14 @@ static int brcmf_sdbrcm_htclk(dhd_bus_t *bus, bool on, bool pendok)
bus->clkstate = CLK_AVAIL;
DHD_INFO(("CLKCTL: turned ON\n"));
-#if defined(DHD_DEBUG)
+#if defined(BCMDBG)
if (bus->alp_only != true) {
if (SBSDIO_ALPONLY(clkctl)) {
DHD_ERROR(("%s: HT Clock should be on.\n",
__func__));
}
}
-#endif /* defined (DHD_DEBUG) */
+#endif /* defined (BCMDBG) */
bus->activity = true;
} else {
@@ -973,9 +973,9 @@ static int brcmf_sdbrcm_sdclk(dhd_bus_t *bus, bool on)
/* Transition SD and backplane clock readiness */
static int brcmf_sdbrcm_clkctl(dhd_bus_t *bus, uint target, bool pendok)
{
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
uint oldstate = bus->clkstate;
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
DHD_TRACE(("%s: Enter\n", __func__));
@@ -1020,9 +1020,9 @@ static int brcmf_sdbrcm_clkctl(dhd_bus_t *bus, uint target, bool pendok)
brcmf_os_wd_timer(bus->dhd, 0);
break;
}
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
DHD_INFO(("brcmf_sdbrcm_clkctl: %d -> %d\n", oldstate, bus->clkstate));
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
return 0;
}
@@ -1227,7 +1227,7 @@ static int brcmf_sdbrcm_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
put_unaligned_le32(swheader, frame + SDPCM_FRAMETAG_LEN);
put_unaligned_le32(0, frame + SDPCM_FRAMETAG_LEN + sizeof(swheader));
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
tx_packets[pkt->priority]++;
if (DHD_BYTES_ON() &&
(((DHD_CTL_ON() && (chan == SDPCM_CONTROL_CHANNEL)) ||
@@ -1372,7 +1372,7 @@ int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
if (pktq_len(&bus->txq) >= TXHI)
brcmf_txflowcontrol(bus->dhd, 0, ON);
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
if (pktq_plen(&bus->txq, prec) > qcount[prec])
qcount[prec] = pktq_plen(&bus->txq, prec);
#endif
@@ -1564,7 +1564,7 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
}
if (ret == -1) {
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
if (DHD_BYTES_ON() && DHD_CTL_ON()) {
printk(KERN_DEBUG "Tx Frame:\n");
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET,
@@ -1661,21 +1661,21 @@ int brcmf_sdbrcm_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
__func__, rxlen, msglen));
} else if (timeleft == 0) {
DHD_ERROR(("%s: resumed on timeout\n", __func__));
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
brcmf_os_sdlock(bus->dhd);
brcmf_sdbrcm_checkdied(bus, NULL, 0);
brcmf_os_sdunlock(bus->dhd);
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
} else if (pending == true) {
DHD_CTL(("%s: cancelled\n", __func__));
return -ERESTARTSYS;
} else {
DHD_CTL(("%s: resumed for unknown reason?\n", __func__));
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
brcmf_os_sdlock(bus->dhd);
brcmf_sdbrcm_checkdied(bus, NULL, 0);
brcmf_os_sdunlock(bus->dhd);
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
}
if (rxlen)
@@ -1695,7 +1695,7 @@ enum {
IOV_SDCIS,
IOV_MEMBYTES,
IOV_MEMSIZE,
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
IOV_CHECKDIED,
#endif
IOV_DOWNLOAD,
@@ -1739,7 +1739,7 @@ const struct brcmu_iovar dhdsdio_iovars[] = {
{"alignctl", IOV_ALIGNCTL, 0, IOVT_BOOL, 0},
{"sdalign", IOV_SDALIGN, 0, IOVT_BOOL, 0},
{"devreset", IOV_DEVRESET, 0, IOVT_BOOL, 0},
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
{"sdreg", IOV_SDREG, 0, IOVT_BUFFER, sizeof(struct brcmf_sdreg)}
,
{"sbreg", IOV_SBREG, 0, IOVT_BUFFER, sizeof(struct brcmf_sdreg)}
@@ -1756,11 +1756,9 @@ const struct brcmu_iovar dhdsdio_iovars[] = {
,
{"cpu", IOV_CPU, 0, IOVT_BOOL, 0}
,
-#ifdef DHD_DEBUG
{"checkdied", IOV_CHECKDIED, 0, IOVT_BUFFER, 0}
,
-#endif /* DHD_DEBUG */
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
#ifdef SDTEST
{"extloop", IOV_EXTLOOP, 0, IOVT_BOOL, 0}
,
@@ -1873,13 +1871,13 @@ void brcmf_sdbrcm_bus_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf)
bus->pktgen_fail);
}
#endif /* SDTEST */
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
brcmu_bprintf(strbuf, "dpc_sched %d host interrupt%spending\n",
bus->dpc_sched,
(brcmf_sdcard_intr_pending(bus->sdh) ? " " : " not "));
brcmu_bprintf(strbuf, "blocksize %d roundup %d\n", bus->blocksize,
bus->roundup);
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
brcmu_bprintf(strbuf,
"clkstate %d activity %d idletime %d idlecount %d sleeping %d\n",
bus->clkstate, bus->activity, bus->idletime, bus->idlecount,
@@ -2015,7 +2013,7 @@ xfer_done:
return bcmerror;
}
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
static int brcmf_sdbrcm_readshared(dhd_bus_t *bus, struct sdpcm_shared *sh)
{
u32 addr;
@@ -2183,12 +2181,12 @@ static int brcmf_sdbrcm_checkdied(dhd_bus_t *bus, u8 *data, uint size)
if (sdpcm_shared.flags & (SDPCM_SHARED_ASSERT | SDPCM_SHARED_TRAP))
DHD_ERROR(("%s: %s\n", __func__, strbuf.origbuf));
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
if (sdpcm_shared.flags & SDPCM_SHARED_TRAP) {
/* Mem dump to a file on device */
brcmf_sdbrcm_mem_dump(bus);
}
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
done:
kfree(mbuffer);
@@ -2321,7 +2319,7 @@ break2:
return 0;
}
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
int brcmf_sdbrcm_downloadvars(dhd_bus_t *bus, void *arg, int len)
{
@@ -2581,16 +2579,16 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
memcpy(arg, &int_val, val_size);
break;
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
case IOV_GVAL(IOV_VARS):
if (bus->varsz < (uint) len)
memcpy(arg, bus->vars, bus->varsz);
else
bcmerror = -EOVERFLOW;
break;
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
case IOV_GVAL(IOV_SDREG):
{
struct brcmf_sdreg *sd_ptr;
@@ -2713,7 +2711,7 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
case IOV_SVAL(IOV_TXMINMAX):
dhd_txminmax = (uint) int_val;
break;
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
#ifdef SDTEST
case IOV_GVAL(IOV_EXTLOOP):
@@ -2779,9 +2777,9 @@ static int brcmf_sdbrcm_write_vars(dhd_bus_t *bus)
u32 varaddr;
u8 *vbuffer;
u32 varsizew;
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
char *nvram_ularray;
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
/* Even if there are no vars are to be written, we still
need to set the ramsize. */
@@ -2798,7 +2796,7 @@ static int brcmf_sdbrcm_write_vars(dhd_bus_t *bus)
/* Write the vars list */
bcmerror =
brcmf_sdbrcm_membytes(bus, true, varaddr, vbuffer, varsize);
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
/* Verify NVRAM bytes */
DHD_INFO(("Compare NVRAM dl & ul; varsize=%d\n", varsize));
nvram_ularray = kmalloc(varsize, GFP_ATOMIC);
@@ -2825,7 +2823,7 @@ static int brcmf_sdbrcm_write_vars(dhd_bus_t *bus)
__func__));
kfree(nvram_ularray);
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
kfree(vbuffer);
}
@@ -3335,7 +3333,7 @@ brcmf_sdbrcm_read_control(dhd_bus_t *bus, u8 *hdr, uint len, uint doff)
gotpkt:
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
if (DHD_BYTES_ON() && DHD_CTL_ON()) {
printk(KERN_DEBUG "RxCtrl:\n");
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, bus->rxctl, len);
@@ -3524,7 +3522,7 @@ static u8 brcmf_sdbrcm_rxglom(dhd_bus_t *bus, u8 rxseq)
}
return 0;
}
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
if (DHD_GLOM_ON()) {
printk(KERN_DEBUG "SUPERFRAME:\n");
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET,
@@ -3608,7 +3606,7 @@ static u8 brcmf_sdbrcm_rxglom(dhd_bus_t *bus, u8 rxseq)
check = get_unaligned_le16(dptr + sizeof(u16));
chan = SDPCM_PACKET_CHANNEL(&dptr[SDPCM_FRAMETAG_LEN]);
doff = SDPCM_DOFFSET_VALUE(&dptr[SDPCM_FRAMETAG_LEN]);
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
if (DHD_GLOM_ON()) {
printk(KERN_DEBUG "subframe:\n");
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET,
@@ -3686,7 +3684,7 @@ static u8 brcmf_sdbrcm_rxglom(dhd_bus_t *bus, u8 rxseq)
bus->rx_badseq++;
rxseq = seq;
}
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
if (DHD_BYTES_ON() && DHD_DATA_ON()) {
printk(KERN_DEBUG "Rx Subframe Data:\n");
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET,
@@ -3727,7 +3725,7 @@ static u8 brcmf_sdbrcm_rxglom(dhd_bus_t *bus, u8 rxseq)
plast = pfirst;
num++;
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
if (DHD_GLOM_ON()) {
DHD_GLOM(("%s subframe %d to stack, %p(%p/%d) "
"nxt/lnk %p/%p\n",
@@ -3738,7 +3736,7 @@ static u8 brcmf_sdbrcm_rxglom(dhd_bus_t *bus, u8 rxseq)
pfirst->data,
min_t(int, pfirst->len, 32));
}
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
}
if (num) {
brcmf_os_sdunlock(bus->dhd);
@@ -3775,7 +3773,7 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
int ifidx = 0;
uint rxcount = 0; /* Total frames read */
-#if defined(DHD_DEBUG) || defined(SDTEST)
+#if defined(BCMDBG) || defined(SDTEST)
bool sdtest = false; /* To limit message spew from test mode */
#endif
@@ -4035,7 +4033,7 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
}
bus->tx_max = txmax;
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
if (DHD_BYTES_ON() && DHD_DATA_ON()) {
printk(KERN_DEBUG "Rx Data:\n");
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET,
@@ -4098,7 +4096,7 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
brcmf_sdbrcm_rxfail(bus, true, true);
continue;
}
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
if (DHD_BYTES_ON() || DHD_HDRS_ON()) {
printk(KERN_DEBUG "RxHdr:\n");
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET,
@@ -4270,7 +4268,7 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
skb_push(pkt, firstread);
memcpy(pkt->data, bus->rxhdr, firstread);
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
if (DHD_BYTES_ON() && DHD_DATA_ON()) {
printk(KERN_DEBUG "Rx Data:\n");
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET,
@@ -4284,7 +4282,7 @@ deliver:
if (SDPCM_GLOMDESC(&bus->rxhdr[SDPCM_FRAMETAG_LEN])) {
DHD_GLOM(("%s: glom descriptor, %d bytes:\n",
__func__, len));
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
if (DHD_GLOM_ON()) {
printk(KERN_DEBUG "Glom Data:\n");
print_hex_dump_bytes("",
@@ -4332,13 +4330,13 @@ deliver:
brcmf_os_sdlock(bus->dhd);
}
rxcount = maxframes - rxleft;
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
/* Message if we hit the limit */
if (!rxleft && !sdtest)
DHD_DATA(("%s: hit rx limit of %d frames\n", __func__,
maxframes));
else
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
DHD_DATA(("%s: processed %d frames\n", __func__, rxcount));
/* Back off rxseq if awaiting rtx, update rx_seq */
if (bus->rxskip)
@@ -4446,7 +4444,7 @@ bool brcmf_sdbrcm_dpc(dhd_bus_t *bus)
int err;
u8 clkctl, devctl = 0;
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
/* Check for inconsistent device control */
devctl = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
SBSDIO_DEVICE_CTL, &err);
@@ -4457,7 +4455,7 @@ bool brcmf_sdbrcm_dpc(dhd_bus_t *bus)
} else {
ASSERT(devctl & SBSDIO_DEVCTL_CA_INT_ONLY);
}
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
/* Read CSR, if clock on switch to AVAIL, else ignore */
clkctl = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
@@ -4840,7 +4838,7 @@ static void brcmf_sdbrcm_pktgen(dhd_bus_t *bus)
*data++ =
SDPCM_TEST_FILL(fillbyte, (u8) bus->pktgen_sent);
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
if (DHD_BYTES_ON() && DHD_DATA_ON()) {
data = (u8 *) (pkt->data) + SDPCM_HDRLEN;
printk(KERN_DEBUG "brcmf_sdbrcm_pktgen: Tx Data:\n");
@@ -5051,7 +5049,7 @@ extern bool brcmf_sdbrcm_bus_watchdog(dhd_pub_t *dhdp)
/* Update interrupt tracking */
bus->lastintrs = bus->intrcount;
}
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
/* Poll for console output periodically */
if (dhdp->busstate == DHD_BUS_DATA && brcmf_console_ms != 0) {
bus->console.count += brcmf_watchdog_ms;
@@ -5064,7 +5062,7 @@ extern bool brcmf_sdbrcm_bus_watchdog(dhd_pub_t *dhdp)
stop trying */
}
}
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
#ifdef SDTEST
/* Generate packets if configured */
@@ -5094,7 +5092,7 @@ extern bool brcmf_sdbrcm_bus_watchdog(dhd_pub_t *dhdp)
return bus->ipend;
}
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
extern int brcmf_sdbrcm_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg,
uint msglen)
{
@@ -5158,7 +5156,7 @@ done:
return rv;
}
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
static bool brcmf_sdbrcm_chipmatch(u16 chipid)
{
@@ -5336,11 +5334,11 @@ brcmf_sdbrcm_probe_attach(struct dhd_bus *bus, void *sdh, void *regsva,
if (brcmf_sdbrcm_set_siaddr_window(bus, SI_ENUM_BASE))
DHD_ERROR(("%s: FAILED to return to SI_ENUM_BASE\n", __func__));
-#ifdef DHD_DEBUG
+#ifdef BCMDBG
printk(KERN_DEBUG "F1 signature read @0x18000000=0x%4x\n",
brcmf_sdcard_reg_read(bus->sdh, SI_ENUM_BASE, 4));
-#endif /* DHD_DEBUG */
+#endif /* BCMDBG */
/*
* Force PLL off until brcmf_sdbrcm_chip_attach()
diff --git a/drivers/staging/brcm80211/brcmfmac/sdio_host.h b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
index b7e0754..6938abc 100644
--- a/drivers/staging/brcm80211/brcmfmac/sdio_host.h
+++ b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
@@ -87,7 +87,7 @@ extern int brcmf_sdcard_intr_disable(void *sdh);
extern int brcmf_sdcard_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh);
extern int brcmf_sdcard_intr_dereg(void *sdh);
-#if defined(DHD_DEBUG)
+#if defined(BCMDBG)
/* Query pending interrupt status from the host controller */
extern bool brcmf_sdcard_intr_pending(void *sdh);
#endif
--
1.7.1
From: Roland Vossen <[email protected]>
Code cleanup. This function did not perform a reset, hence it was removed.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h | 3 ---
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 5 -----
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 8 --------
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 2 --
drivers/staging/brcm80211/brcmfmac/sdio_host.h | 3 ---
5 files changed, 0 insertions(+), 21 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
index 656caeb..eb08152 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
@@ -97,9 +97,6 @@ extern int brcmf_sdioh_abort(struct sdioh_info *si, uint fnc);
extern int brcmf_sdioh_start(struct sdioh_info *si, int stage);
extern int brcmf_sdioh_stop(struct sdioh_info *si);
-/* Reset and re-initialize the device */
-extern int brcmf_sdioh_reset(struct sdioh_info *si);
-
/* Helper function */
void *brcmf_sdcard_get_sdioh(struct brcmf_sdio_card *card);
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
index 132b18f..11abd55 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
@@ -545,11 +545,6 @@ uint brcmf_sdcard_query_iofnum(struct brcmf_sdio_card *card)
return brcmf_sdioh_query_iofnum(card->sdioh);
}
-int brcmf_sdcard_reset(struct brcmf_sdio_card *card)
-{
- return brcmf_sdioh_reset(card->sdioh);
-}
-
void *brcmf_sdcard_get_sdioh(struct brcmf_sdio_card *card)
{
ASSERT(card);
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 092d044..0f0dc42 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -846,14 +846,6 @@ extern int brcmf_sdioh_abort(struct sdioh_info *sd, uint func)
return 0;
}
-/* Reset and re-initialize the device */
-int brcmf_sdioh_reset(struct sdioh_info *si)
-{
- sd_trace(("%s: Enter\n", __func__));
- sd_trace(("%s: Exit\n", __func__));
- return 0;
-}
-
/* Disable device interrupt */
void brcmf_sdioh_dev_intr_off(struct sdioh_info *sd)
{
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index e43c53a..4b0352f 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -6013,8 +6013,6 @@ int brcmf_bus_devreset(struct brcmf_pub *dhdp, u8 flag)
if (bus->dhd->dongle_reset) {
/* Turn on WLAN */
- /* Reset SD client */
- brcmf_sdcard_reset(bus->card);
/* Attempt to re-attach & download */
if (brcmf_sdbrcm_probe_attach(bus, bus->card,
diff --git a/drivers/staging/brcm80211/brcmfmac/sdio_host.h b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
index f05067a..df4063c 100644
--- a/drivers/staging/brcm80211/brcmfmac/sdio_host.h
+++ b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
@@ -207,9 +207,6 @@ extern int brcmf_sdcard_iovar_op(struct brcmf_sdio_card *card, const char *name,
void *params, int plen, void *arg, int len,
bool set);
-/* Reset and reinitialize the device */
-extern int brcmf_sdcard_reset(struct brcmf_sdio_card *card);
-
/* helper functions */
extern void *brcmf_sdcard_get_sdioh(struct brcmf_sdio_card *card);
--
1.7.1
From: Arend van Spriel <[email protected]>
The definitions in dhd.h have been renamed with consistent prefix
BRCMF_.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 24 ++--
drivers/staging/brcm80211/brcmfmac/dhd.h | 120 ++++++++++----------
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 2 +-
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 34 +++---
drivers/staging/brcm80211/brcmfmac/dhd_dbg.h | 52 +++++-----
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 46 ++++----
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 44 ++++----
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 48 ++++----
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h | 2 +-
9 files changed, 187 insertions(+), 185 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 764d839..167181d 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -43,10 +43,10 @@ extern int brcmf_sdioh_reset_comm(struct mmc_card *card);
uint sd_f2_blocksize = 512; /* Default blocksize */
uint sd_msglevel = 0x01;
-DHD_PM_RESUME_WAIT_INIT(sdioh_request_byte_wait);
-DHD_PM_RESUME_WAIT_INIT(sdioh_request_word_wait);
-DHD_PM_RESUME_WAIT_INIT(sdioh_request_packet_wait);
-DHD_PM_RESUME_WAIT_INIT(sdioh_request_buffer_wait);
+BRCMF_PM_RESUME_WAIT_INIT(sdioh_request_byte_wait);
+BRCMF_PM_RESUME_WAIT_INIT(sdioh_request_word_wait);
+BRCMF_PM_RESUME_WAIT_INIT(sdioh_request_packet_wait);
+BRCMF_PM_RESUME_WAIT_INIT(sdioh_request_buffer_wait);
#define DMA_ALIGN_MASK 0x03
@@ -534,8 +534,8 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
sd_info(("%s: rw=%d, func=%d, addr=0x%05x\n", __func__, rw, func,
regaddr));
- DHD_PM_RESUME_WAIT(sdioh_request_byte_wait);
- DHD_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL);
+ BRCMF_PM_RESUME_WAIT(sdioh_request_byte_wait);
+ BRCMF_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL);
if (rw) { /* CMD52 Write */
if (func == 0) {
/* Can only directly write to some F0 registers.
@@ -636,8 +636,8 @@ brcmf_sdioh_request_word(struct sdioh_info *sd, uint cmd_type, uint rw,
sd_info(("%s: cmd_type=%d, rw=%d, func=%d, addr=0x%05x, nbytes=%d\n",
__func__, cmd_type, rw, func, addr, nbytes));
- DHD_PM_RESUME_WAIT(sdioh_request_word_wait);
- DHD_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL);
+ BRCMF_PM_RESUME_WAIT(sdioh_request_word_wait);
+ BRCMF_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL);
/* Claim host controller */
sdio_claim_host(gInstance->func[func]);
@@ -688,8 +688,8 @@ brcmf_sdioh_request_packet(struct sdioh_info *sd, uint fix_inc, uint write,
sd_trace(("%s: Enter\n", __func__));
ASSERT(pkt);
- DHD_PM_RESUME_WAIT(sdioh_request_packet_wait);
- DHD_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL);
+ BRCMF_PM_RESUME_WAIT(sdioh_request_packet_wait);
+ BRCMF_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL);
/* Claim host controller */
sdio_claim_host(gInstance->func[func]);
@@ -774,8 +774,8 @@ brcmf_sdioh_request_buffer(struct sdioh_info *sd, uint pio_dma, uint fix_inc,
sd_trace(("%s: Enter\n", __func__));
- DHD_PM_RESUME_WAIT(sdioh_request_buffer_wait);
- DHD_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL);
+ BRCMF_PM_RESUME_WAIT(sdioh_request_buffer_wait);
+ BRCMF_PM_RESUME_RETURN_ERROR(SDIOH_API_RC_FAIL);
/* Case 1: we don't have a packet. */
if (pkt == NULL) {
sd_data(("%s: Creating new %s Packet, len=%d\n",
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 93e0164..9b1a7f4 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -83,11 +83,11 @@
#define WLC_PHY_TYPE_LCN 8
#define WLC_PHY_TYPE_NULL 0xf
-#define WL_PKT_FILTER_FIXED_LEN offsetof(struct brcmf_pkt_filter, u)
-#define WL_PKT_FILTER_PATTERN_FIXED_LEN \
+#define BRCMF_PKT_FILTER_FIXED_LEN offsetof(struct brcmf_pkt_filter, u)
+#define BRCMF_PKT_FILTER_PATTERN_FIXED_LEN \
offsetof(struct brcmf_pkt_filter_pattern, mask_and_pattern)
-#define WL_EVENTING_MASK_LEN 16
+#define BRCMF_EVENTING_MASK_LEN 16
#define TOE_TX_CSUM_OL 0x00000001
#define TOE_RX_CSUM_OL 0x00000002
@@ -95,38 +95,38 @@
/* maximum channels returned by the get valid channels iovar */
#define WL_NUMCHANNELS 64
-#define WL_BSS_INFO_VERSION 108 /* current ver of brcmf_bss_info struct */
+#define BRCMF_BSS_INFO_VERSION 108 /* current ver of brcmf_bss_info struct */
/* size of brcmf_scan_params not including variable length array */
-#define WL_SCAN_PARAMS_FIXED_SIZE 64
+#define BRCMF_SCAN_PARAMS_FIXED_SIZE 64
/* masks for channel and ssid count */
-#define WL_SCAN_PARAMS_COUNT_MASK 0x0000ffff
-#define WL_SCAN_PARAMS_NSSID_SHIFT 16
+#define BRCMF_SCAN_PARAMS_COUNT_MASK 0x0000ffff
+#define BRCMF_SCAN_PARAMS_NSSID_SHIFT 16
-#define WL_SCAN_ACTION_START 1
-#define WL_SCAN_ACTION_CONTINUE 2
+#define BRCMF_SCAN_ACTION_START 1
+#define BRCMF_SCAN_ACTION_CONTINUE 2
#define WL_SCAN_ACTION_ABORT 3
-#define ISCAN_REQ_VERSION 1
+#define BRCMF_ISCAN_REQ_VERSION 1
/* brcmf_iscan_results status values */
-#define WL_SCAN_RESULTS_SUCCESS 0
-#define WL_SCAN_RESULTS_PARTIAL 1
-#define WL_SCAN_RESULTS_PENDING 2
-#define WL_SCAN_RESULTS_ABORTED 3
-#define WL_SCAN_RESULTS_NO_MEM 4
+#define BRCMF_SCAN_RESULTS_SUCCESS 0
+#define BRCMF_SCAN_RESULTS_PARTIAL 1
+#define BRCMF_SCAN_RESULTS_PENDING 2
+#define BRCMF_SCAN_RESULTS_ABORTED 3
+#define BRCMF_SCAN_RESULTS_NO_MEM 4
#define WL_SOFT_KEY (1 << 0) /* Indicates this key is using soft encrypt */
-#define WL_PRIMARY_KEY (1 << 1) /* Indicates this key is the primary (ie tx) key */
+#define BRCMF_PRIMARY_KEY (1 << 1) /* primary (ie tx) key */
#define WL_KF_RES_4 (1 << 4) /* Reserved for backward compat */
#define WL_KF_RES_5 (1 << 5) /* Reserved for backward compat */
#define WL_IBSS_PEER_GROUP_KEY (1 << 6) /* Indicates a group key for a IBSS PEER */
/* For supporting multiple interfaces */
-#define DHD_MAX_IFS 16
-#define DHD_DEL_IF -0xe
-#define DHD_BAD_IF -0xf
+#define BRCMF_MAX_IFS 16
+#define BRCMF_DEL_IF -0xe
+#define BRCMF_BAD_IF -0xf
#define DOT11_BSSTYPE_ANY 2
#define DOT11_MAX_DEFAULT_KEYS 4
@@ -454,7 +454,7 @@ struct brcmf_assoc_params {
*/
chanspec_t chanspec_list[1]; /* list of chanspecs */
};
-#define WL_ASSOC_PARAMS_FIXED_SIZE \
+#define BRCMF_ASSOC_PARAMS_FIXED_SIZE \
(sizeof(struct brcmf_assoc_params) - sizeof(chanspec_t))
/* used for join with or without a specific bssid and channel list */
@@ -591,7 +591,7 @@ typedef struct dhd_pub {
int pktfilter_count;
u8 country_code[WLC_CNTRY_BUF_SZ];
- char eventmask[WL_EVENTING_MASK_LEN];
+ char eventmask[BRCMF_EVENTING_MASK_LEN];
} dhd_pub_t;
@@ -616,24 +616,24 @@ typedef struct {
#if defined(CONFIG_PM_SLEEP)
extern atomic_t brcmf_mmc_suspend;
-#define DHD_PM_RESUME_WAIT_INIT(a) DECLARE_WAIT_QUEUE_HEAD(a);
-#define _DHD_PM_RESUME_WAIT(a, b) do { \
+#define BRCMF_PM_RESUME_WAIT_INIT(a) DECLARE_WAIT_QUEUE_HEAD(a);
+#define _BRCMF_PM_RESUME_WAIT(a, b) do { \
int retry = 0; \
while (atomic_read(&brcmf_mmc_suspend) && retry++ != b) { \
wait_event_timeout(a, false, HZ/100); \
} \
} while (0)
-#define DHD_PM_RESUME_WAIT(a) _DHD_PM_RESUME_WAIT(a, 30)
-#define DHD_PM_RESUME_WAIT_FOREVER(a) _DHD_PM_RESUME_WAIT(a, ~0)
-#define DHD_PM_RESUME_RETURN_ERROR(a) \
+#define BRCMF_PM_RESUME_WAIT(a) _BRCMF_PM_RESUME_WAIT(a, 30)
+#define DHD_PM_RESUME_WAIT_FOREVER(a) _BRCMF_PM_RESUME_WAIT(a, ~0)
+#define BRCMF_PM_RESUME_RETURN_ERROR(a) \
do { if (atomic_read(&brcmf_mmc_suspend)) return a; } while (0)
#define DHD_PM_RESUME_RETURN do { \
if (atomic_read(&brcmf_mmc_suspend)) \
return; \
} while (0)
-#define DHD_SPINWAIT_SLEEP_INIT(a) DECLARE_WAIT_QUEUE_HEAD(a);
-#define SPINWAIT_SLEEP(a, exp, us) do { \
+#define BRCMF_SPINWAIT_SLEEP_INIT(a) DECLARE_WAIT_QUEUE_HEAD(a);
+#define BRCMF_SPINWAIT_SLEEP(a, exp, us) do { \
uint countdown = (us) + 9999; \
while ((exp) && (countdown >= 10000)) { \
wait_event_timeout(a, false, HZ/100); \
@@ -643,14 +643,14 @@ extern atomic_t brcmf_mmc_suspend;
#else
-#define DHD_PM_RESUME_WAIT_INIT(a)
-#define DHD_PM_RESUME_WAIT(a)
+#define BRCMF_PM_RESUME_WAIT_INIT(a)
+#define BRCMF_PM_RESUME_WAIT(a)
#define DHD_PM_RESUME_WAIT_FOREVER(a)
-#define DHD_PM_RESUME_RETURN_ERROR(a)
+#define BRCMF_PM_RESUME_RETURN_ERROR(a)
#define DHD_PM_RESUME_RETURN
-#define DHD_SPINWAIT_SLEEP_INIT(a)
-#define SPINWAIT_SLEEP(a, exp, us) do { \
+#define BRCMF_SPINWAIT_SLEEP_INIT(a)
+#define BRCMF_SPINWAIT_SLEEP(a, exp, us) do { \
uint countdown = (us) + 9; \
while ((exp) && (countdown >= 10)) { \
udelay(10); \
@@ -861,35 +861,35 @@ typedef struct dhd_ioctl {
} dhd_ioctl_t;
/* per-driver magic numbers */
-#define DHD_IOCTL_MAGIC 0x00444944
+#define BRCMF_IOCTL_MAGIC 0x00444944
/* bump this number if you change the ioctl interface */
-#define DHD_IOCTL_VERSION 1
+#define BRCMF_IOCTL_VERSION 1
-#define DHD_IOCTL_MAXLEN 8192 /* max length ioctl buffer required */
+#define BRCMF_IOCTL_MAXLEN 8192 /* max length ioctl buffer required */
#define DHD_IOCTL_SMLEN 256 /* "small" length ioctl buffer required */
/* common ioctl definitions */
-#define DHD_GET_MAGIC 0
-#define DHD_GET_VERSION 1
-#define DHD_GET_VAR 2
-#define DHD_SET_VAR 3
+#define BRCMF_GET_MAGIC 0
+#define BRCMF_GET_VERSION 1
+#define BRCMF_GET_VAR 2
+#define BRCMF_SET_VAR 3
/* message levels */
-#define DHD_ERROR_VAL 0x0001
-#define DHD_TRACE_VAL 0x0002
-#define DHD_INFO_VAL 0x0004
-#define DHD_DATA_VAL 0x0008
-#define DHD_CTL_VAL 0x0010
-#define DHD_TIMER_VAL 0x0020
-#define DHD_HDRS_VAL 0x0040
-#define DHD_BYTES_VAL 0x0080
-#define DHD_INTR_VAL 0x0100
+#define BRCMF_ERROR_VAL 0x0001
+#define BRCMF_TRACE_VAL 0x0002
+#define BRCMF_INFO_VAL 0x0004
+#define BRCMF_DATA_VAL 0x0008
+#define BRCMF_CTL_VAL 0x0010
+#define BRCMF_TIMER_VAL 0x0020
+#define BRCMF_HDRS_VAL 0x0040
+#define BRCMF_BYTES_VAL 0x0080
+#define BRCMF_INTR_VAL 0x0100
#define DHD_LOG_VAL 0x0200
-#define DHD_GLOM_VAL 0x0400
-#define DHD_EVENT_VAL 0x0800
-#define DHD_BTA_VAL 0x1000
-#define DHD_ISCAN_VAL 0x2000
+#define BRCMF_GLOM_VAL 0x0400
+#define BRCMF_EVENT_VAL 0x0800
+#define BRCMF_BTA_VAL 0x1000
+#define BRCMF_ISCAN_VAL 0x2000
#ifdef SDTEST
/* For pktgen iovar */
@@ -909,22 +909,22 @@ typedef struct brcmf_pktgen {
} brcmf_pktgen_t;
/* Version in case structure changes */
-#define DHD_PKTGEN_VERSION 2
+#define BRCMF_PKTGEN_VERSION 2
/* Type of test packets to use */
-#define DHD_PKTGEN_ECHO 1 /* Send echo requests */
-#define DHD_PKTGEN_SEND 2 /* Send discard packets */
-#define DHD_PKTGEN_RXBURST 3 /* Request dongle send N packets */
-#define DHD_PKTGEN_RECV 4 /* Continuous rx from continuous
+#define BRCMF_PKTGEN_ECHO 1 /* Send echo requests */
+#define BRCMF_PKTGEN_SEND 2 /* Send discard packets */
+#define BRCMF_PKTGEN_RXBURST 3 /* Request dongle send N packets */
+#define BRCMF_PKTGEN_RECV 4 /* Continuous rx from continuous
tx dongle */
#endif /* SDTEST */
/* Enter idle immediately (no timeout) */
-#define DHD_IDLE_IMMEDIATE (-1)
+#define BRCMF_IDLE_IMMEDIATE (-1)
/* Values for idleclock iovar: other values are the sd_divisor to use
when idle */
-#define DHD_IDLE_ACTIVE 0 /* Do not request any SD clock change
+#define BRCMF_IDLE_ACTIVE 0 /* Do not request any SD clock change
when idle */
#define DHD_IDLE_STOP (-1) /* Request SD clock be stopped
(and use SD1 mode) */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index 7efe69c..a336068 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -406,7 +406,7 @@ int brcmf_proto_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
h = (struct brcmf_proto_bdc_header *)(pktbuf->data);
*ifidx = BDC_GET_IF_IDX(h);
- if (*ifidx >= DHD_MAX_IFS) {
+ if (*ifidx >= BRCMF_MAX_IFS) {
DHD_ERROR(("%s: rx data ifnum out of range (%d)\n",
__func__, *ifidx));
return -EBADE;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 84daa8e..9b0ad44 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -71,7 +71,7 @@ const struct brcmu_iovar brcmf_iovars[] = {
,
{"bcmerror", IOV_BCMERROR, 0, IOVT_INT8, 0}
,
- {"dump", IOV_DUMP, 0, IOVT_BUFFER, DHD_IOCTL_MAXLEN}
+ {"dump", IOV_DUMP, 0, IOVT_BUFFER, BRCMF_IOCTL_MAXLEN}
,
{"clearcounts", IOV_CLEARCOUNTS, 0, IOVT_VOID, 0}
,
@@ -108,7 +108,7 @@ void brcmf_c_init(void)
* first time that the driver is initialized vs subsequent
* initializations.
*/
- brcmf_msg_level = DHD_ERROR_VAL;
+ brcmf_msg_level = BRCMF_ERROR_VAL;
}
static int brcmf_c_dump(dhd_pub_t *drvr, char *buf, int buflen)
@@ -370,22 +370,22 @@ int brcmf_c_ioctl(dhd_pub_t *drvr, dhd_ioctl_t *ioc, void *buf, uint buflen)
return -EINVAL;
switch (ioc->cmd) {
- case DHD_GET_MAGIC:
+ case BRCMF_GET_MAGIC:
if (buflen < sizeof(int))
bcmerror = -EOVERFLOW;
else
- *(int *)buf = DHD_IOCTL_MAGIC;
+ *(int *)buf = BRCMF_IOCTL_MAGIC;
break;
- case DHD_GET_VERSION:
+ case BRCMF_GET_VERSION:
if (buflen < sizeof(int))
bcmerror = -EOVERFLOW;
else
- *(int *)buf = DHD_IOCTL_VERSION;
+ *(int *)buf = BRCMF_IOCTL_VERSION;
break;
- case DHD_GET_VAR:
- case DHD_SET_VAR:{
+ case BRCMF_GET_VAR:
+ case BRCMF_SET_VAR:{
char *arg;
uint arglen;
@@ -403,7 +403,7 @@ int brcmf_c_ioctl(dhd_pub_t *drvr, dhd_ioctl_t *ioc, void *buf, uint buflen)
arg++, arglen--;
/* call with the appropriate arguments */
- if (ioc->cmd == DHD_GET_VAR)
+ if (ioc->cmd == BRCMF_GET_VAR)
bcmerror = brcmf_c_iovar_op(drvr, buf, arg,
arglen, buf, buflen, IOV_GET);
else
@@ -414,7 +414,7 @@ int brcmf_c_ioctl(dhd_pub_t *drvr, dhd_ioctl_t *ioc, void *buf, uint buflen)
break;
/* not in generic table, try protocol module */
- if (ioc->cmd == DHD_GET_VAR)
+ if (ioc->cmd == BRCMF_GET_VAR)
bcmerror = brcmf_proto_iovar_op(drvr, buf,
arg, arglen,
buf, buflen,
@@ -428,7 +428,7 @@ int brcmf_c_ioctl(dhd_pub_t *drvr, dhd_ioctl_t *ioc, void *buf, uint buflen)
break;
/* if still not found, try bus module */
- if (ioc->cmd == DHD_GET_VAR)
+ if (ioc->cmd == BRCMF_GET_VAR)
bcmerror = brcmf_sdbrcm_bus_iovar_op(drvr,
buf, arg, arglen, buf, buflen,
IOV_GET);
@@ -794,7 +794,7 @@ brcmf_c_host_event(struct dhd_info *drvr_priv, int *ifidx, void *pktdata,
DHD_TRACE(("%s: if event\n", __func__));
if (ifevent->ifidx > 0 &&
- ifevent->ifidx < DHD_MAX_IFS) {
+ ifevent->ifidx < BRCMF_MAX_IFS) {
if (ifevent->action == BRCMF_E_IF_ADD)
brcmf_add_if(drvr_priv, ifevent->ifidx,
NULL, event->ifname,
@@ -1054,8 +1054,8 @@ void brcmf_c_pktfilter_offload_set(dhd_pub_t *drvr, char *arg)
}
pkt_filter.u.pattern.size_bytes = mask_size;
- buf_len += WL_PKT_FILTER_FIXED_LEN;
- buf_len += (WL_PKT_FILTER_PATTERN_FIXED_LEN + 2 * mask_size);
+ buf_len += BRCMF_PKT_FILTER_FIXED_LEN;
+ buf_len += (BRCMF_PKT_FILTER_PATTERN_FIXED_LEN + 2 * mask_size);
/* Keep-alive attributes are set in local
* variable (keep_alive_pkt), and
@@ -1064,7 +1064,7 @@ void brcmf_c_pktfilter_offload_set(dhd_pub_t *drvr, char *arg)
*/
memcpy((char *)pkt_filterp,
&pkt_filter,
- WL_PKT_FILTER_FIXED_LEN + WL_PKT_FILTER_PATTERN_FIXED_LEN);
+ BRCMF_PKT_FILTER_FIXED_LEN + BRCMF_PKT_FILTER_PATTERN_FIXED_LEN);
rc = brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR, buf, buf_len);
rc = rc >= 0 ? 0 : rc;
@@ -1118,7 +1118,7 @@ void brcmf_c_arp_offload_enable(dhd_pub_t *drvr, int arp_enable)
int brcmf_c_preinit_ioctls(dhd_pub_t *drvr)
{
- char iovbuf[WL_EVENTING_MASK_LEN + 12]; /* Room for
+ char iovbuf[BRCMF_EVENTING_MASK_LEN + 12]; /* Room for
"event_msgs" + '\0' + bitvec */
uint up = 0;
char buf[128], *ptr;
@@ -1186,7 +1186,7 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *drvr)
sizeof(up));
/* Setup event_msgs */
- brcmu_mkiovar("event_msgs", drvr->eventmask, WL_EVENTING_MASK_LEN,
+ brcmu_mkiovar("event_msgs", drvr->eventmask, BRCMF_EVENTING_MASK_LEN,
iovbuf, sizeof(iovbuf));
brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR, iovbuf,
sizeof(iovbuf));
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h b/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h
index e0fc124..678a7e2 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_dbg.h
@@ -20,46 +20,46 @@
#if defined(BCMDBG)
#define DHD_ERROR(args) \
- do {if ((brcmf_msg_level & DHD_ERROR_VAL) && (net_ratelimit())) \
+ do {if ((brcmf_msg_level & BRCMF_ERROR_VAL) && (net_ratelimit())) \
printk args; } while (0)
-#define DHD_TRACE(args) do {if (brcmf_msg_level & DHD_TRACE_VAL) \
+#define DHD_TRACE(args) do {if (brcmf_msg_level & BRCMF_TRACE_VAL) \
printk args; } while (0)
-#define DHD_INFO(args) do {if (brcmf_msg_level & DHD_INFO_VAL) \
+#define DHD_INFO(args) do {if (brcmf_msg_level & BRCMF_INFO_VAL) \
printk args; } while (0)
-#define DHD_DATA(args) do {if (brcmf_msg_level & DHD_DATA_VAL) \
+#define DHD_DATA(args) do {if (brcmf_msg_level & BRCMF_DATA_VAL) \
printk args; } while (0)
-#define DHD_CTL(args) do {if (brcmf_msg_level & DHD_CTL_VAL) \
+#define DHD_CTL(args) do {if (brcmf_msg_level & BRCMF_CTL_VAL) \
printk args; } while (0)
-#define DHD_TIMER(args) do {if (brcmf_msg_level & DHD_TIMER_VAL) \
+#define DHD_TIMER(args) do {if (brcmf_msg_level & BRCMF_TIMER_VAL) \
printk args; } while (0)
-#define DHD_HDRS(args) do {if (brcmf_msg_level & DHD_HDRS_VAL) \
+#define DHD_HDRS(args) do {if (brcmf_msg_level & BRCMF_HDRS_VAL) \
printk args; } while (0)
-#define DHD_BYTES(args) do {if (brcmf_msg_level & DHD_BYTES_VAL) \
+#define DHD_BYTES(args) do {if (brcmf_msg_level & BRCMF_BYTES_VAL) \
printk args; } while (0)
-#define DHD_INTR(args) do {if (brcmf_msg_level & DHD_INTR_VAL) \
+#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 & DHD_GLOM_VAL) \
+#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 & DHD_EVENT_VAL) \
+#define DHD_EVENT(args) do {if (brcmf_msg_level & BRCMF_EVENT_VAL) \
printk args; } while (0)
-#define DHD_BTA(args) do {if (brcmf_msg_level & DHD_BTA_VAL) \
+#define DHD_BTA(args) do {if (brcmf_msg_level & BRCMF_BTA_VAL) \
printk args; } while (0)
-#define DHD_ISCAN(args) do {if (brcmf_msg_level & DHD_ISCAN_VAL) \
+#define DHD_ISCAN(args) do {if (brcmf_msg_level & BRCMF_ISCAN_VAL) \
printk args; } while (0)
-#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)
+#define DHD_ERROR_ON() (brcmf_msg_level & BRCMF_ERROR_VAL)
+#define DHD_TRACE_ON() (brcmf_msg_level & BRCMF_TRACE_VAL)
+#define DHD_INFO_ON() (brcmf_msg_level & BRCMF_INFO_VAL)
+#define DHD_DATA_ON() (brcmf_msg_level & BRCMF_DATA_VAL)
+#define DHD_CTL_ON() (brcmf_msg_level & BRCMF_CTL_VAL)
+#define DHD_TIMER_ON() (brcmf_msg_level & BRCMF_TIMER_VAL)
+#define DHD_HDRS_ON() (brcmf_msg_level & BRCMF_HDRS_VAL)
+#define DHD_BYTES_ON() (brcmf_msg_level & BRCMF_BYTES_VAL)
+#define DHD_INTR_ON() (brcmf_msg_level & BRCMF_INTR_VAL)
+#define DHD_GLOM_ON() (brcmf_msg_level & BRCMF_GLOM_VAL)
+#define DHD_EVENT_ON() (brcmf_msg_level & BRCMF_EVENT_VAL)
+#define DHD_BTA_ON() (brcmf_msg_level & BRCMF_BTA_VAL)
+#define DHD_ISCAN_ON() (brcmf_msg_level & BRCMF_ISCAN_VAL)
#else /* (defined BCMDBG) || (defined BCMDBG) */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 6b2682f..2135a64 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -79,7 +79,7 @@ typedef struct dhd_info {
dhd_pub_t pub;
/* OS/stack specifics */
- dhd_if_t *iflist[DHD_MAX_IFS];
+ dhd_if_t *iflist[BRCMF_MAX_IFS];
struct semaphore proto_sem;
wait_queue_head_t ioctl_resp_wait;
@@ -370,18 +370,18 @@ static int brcmf_net2idx(dhd_info_t *drvr_priv, struct net_device *net)
int i = 0;
ASSERT(drvr_priv);
- while (i < DHD_MAX_IFS) {
+ while (i < BRCMF_MAX_IFS) {
if (drvr_priv->iflist[i] && (drvr_priv->iflist[i]->net == net))
return i;
i++;
}
- return DHD_BAD_IF;
+ return BRCMF_BAD_IF;
}
int brcmf_ifname2idx(dhd_info_t *drvr_priv, char *name)
{
- int i = DHD_MAX_IFS;
+ int i = BRCMF_MAX_IFS;
ASSERT(drvr_priv);
@@ -404,7 +404,7 @@ char *brcmf_ifname(dhd_pub_t *drvr, int ifidx)
ASSERT(drvr_priv);
- if (ifidx < 0 || ifidx >= DHD_MAX_IFS) {
+ if (ifidx < 0 || ifidx >= BRCMF_MAX_IFS) {
DHD_ERROR(("%s: ifidx %d out of range\n", __func__, ifidx));
return "<if_bad>";
}
@@ -636,7 +636,7 @@ static void brcmf_op_if(dhd_if_t *ifp)
__func__));
netif_stop_queue(ifp->net);
unregister_netdev(ifp->net);
- ret = DHD_DEL_IF; /* Make sure the free_netdev()
+ ret = BRCMF_DEL_IF; /* Make sure the free_netdev()
is called */
}
break;
@@ -673,7 +673,7 @@ static int _brcmf_sysioc_thread(void *data)
while (down_interruptible(&drvr_priv->sysioc_sem) == 0) {
if (kthread_should_stop())
break;
- for (i = 0; i < DHD_MAX_IFS; i++) {
+ for (i = 0; i < BRCMF_MAX_IFS; i++) {
if (drvr_priv->iflist[i]) {
#ifdef SOFTAP
in_ap = (ap_net_dev != NULL);
@@ -728,7 +728,7 @@ static int brcmf_netdev_set_mac_address(struct net_device *dev, void *addr)
int ifidx;
ifidx = brcmf_net2idx(drvr_priv, dev);
- if (ifidx == DHD_BAD_IF)
+ if (ifidx == BRCMF_BAD_IF)
return -1;
ASSERT(drvr_priv->sysioc_tsk);
@@ -745,7 +745,7 @@ static void brcmf_netdev_set_multicast_list(struct net_device *dev)
int ifidx;
ifidx = brcmf_net2idx(drvr_priv, dev);
- if (ifidx == DHD_BAD_IF)
+ if (ifidx == BRCMF_BAD_IF)
return;
ASSERT(drvr_priv->sysioc_tsk);
@@ -796,7 +796,7 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *net)
}
ifidx = brcmf_net2idx(drvr_priv, net);
- if (ifidx == DHD_BAD_IF) {
+ if (ifidx == BRCMF_BAD_IF) {
DHD_ERROR(("%s: bad ifidx %d\n", __func__, ifidx));
netif_stop_queue(net);
return -ENODEV;
@@ -907,7 +907,7 @@ void brcmf_rx_frame(dhd_pub_t *drvr, int ifidx, struct sk_buff *skb,
skb_mac_header(skb),
&event, &data);
- ASSERT(ifidx < DHD_MAX_IFS && drvr_priv->iflist[ifidx]);
+ ASSERT(ifidx < BRCMF_MAX_IFS && drvr_priv->iflist[ifidx]);
if (drvr_priv->iflist[ifidx] &&
!drvr_priv->iflist[ifidx]->state)
ifp = drvr_priv->iflist[ifidx];
@@ -964,7 +964,7 @@ static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net)
DHD_TRACE(("%s: Enter\n", __func__));
ifidx = brcmf_net2idx(drvr_priv, net);
- if (ifidx == DHD_BAD_IF)
+ if (ifidx == BRCMF_BAD_IF)
return NULL;
ifp = drvr_priv->iflist[ifidx];
@@ -1208,7 +1208,7 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
ifidx = brcmf_net2idx(drvr_priv, net);
DHD_TRACE(("%s: ifidx %d, cmd 0x%04x\n", __func__, ifidx, cmd));
- if (ifidx == DHD_BAD_IF)
+ if (ifidx == BRCMF_BAD_IF)
return -1;
if (cmd == SIOCETHTOOL)
@@ -1227,7 +1227,7 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
/* Copy out any buffer passed */
if (ioc.buf) {
- buflen = min_t(int, ioc.len, DHD_IOCTL_MAXLEN);
+ buflen = min_t(int, ioc.len, BRCMF_IOCTL_MAXLEN);
/* optimization for direct ioctl calls from kernel */
/*
if (segment_eq(get_fs(), KERNEL_DS)) {
@@ -1260,7 +1260,7 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
}
/* check for local dhd ioctl and handle it */
- if (driver == DHD_IOCTL_MAGIC) {
+ if (driver == BRCMF_IOCTL_MAGIC) {
bcmerror = brcmf_c_ioctl((void *)&drvr_priv->pub, &ioc, buf, buflen);
if (bcmerror)
drvr_priv->pub.bcmerror = bcmerror;
@@ -1378,7 +1378,7 @@ brcmf_add_if(dhd_info_t *drvr_priv, int ifidx, void *handle, char *name,
DHD_TRACE(("%s: idx %d, handle->%p\n", __func__, ifidx, handle));
- ASSERT(drvr_priv && (ifidx < DHD_MAX_IFS));
+ ASSERT(drvr_priv && (ifidx < BRCMF_MAX_IFS));
ifp = drvr_priv->iflist[ifidx];
if (!ifp) {
@@ -1413,7 +1413,7 @@ void brcmf_del_if(dhd_info_t *drvr_priv, int ifidx)
DHD_TRACE(("%s: idx %d\n", __func__, ifidx));
- ASSERT(drvr_priv && ifidx && (ifidx < DHD_MAX_IFS));
+ ASSERT(drvr_priv && ifidx && (ifidx < BRCMF_MAX_IFS));
ifp = drvr_priv->iflist[ifidx];
if (!ifp) {
DHD_ERROR(("%s: Null interface\n", __func__));
@@ -1465,7 +1465,7 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
}
if (brcmf_add_if(drvr_priv, 0, (void *)net, net->name, NULL, 0, 0) ==
- DHD_BAD_IF)
+ BRCMF_BAD_IF)
goto fail;
net->netdev_ops = NULL;
@@ -1539,8 +1539,8 @@ int brcmf_bus_start(dhd_pub_t *drvr)
{
int ret = -1;
dhd_info_t *drvr_priv = drvr->info;
- char iovbuf[WL_EVENTING_MASK_LEN + 12]; /* Room for "event_msgs" +
- '\0' + bitvec */
+ /* Room for "event_msgs" + '\0' + bitvec */
+ char iovbuf[BRCMF_EVENTING_MASK_LEN + 12];
ASSERT(drvr_priv);
@@ -1560,11 +1560,11 @@ int brcmf_bus_start(dhd_pub_t *drvr)
return -ENODEV;
}
- brcmu_mkiovar("event_msgs", drvr->eventmask, WL_EVENTING_MASK_LEN,
+ brcmu_mkiovar("event_msgs", drvr->eventmask, BRCMF_EVENTING_MASK_LEN,
iovbuf, sizeof(iovbuf));
brcmf_proto_cdc_query_ioctl(drvr, 0, BRCMF_C_GET_VAR, iovbuf,
sizeof(iovbuf));
- memcpy(drvr->eventmask, iovbuf, WL_EVENTING_MASK_LEN);
+ memcpy(drvr->eventmask, iovbuf, BRCMF_EVENTING_MASK_LEN);
setbit(drvr->eventmask, BRCMF_E_SET_SSID);
setbit(drvr->eventmask, BRCMF_E_PRUNE);
@@ -1725,7 +1725,7 @@ void brcmf_detach(dhd_pub_t *drvr)
&drvr_priv->early_suspend);
#endif /* defined(CONFIG_HAS_EARLYSUSPEND) */
- for (i = 1; i < DHD_MAX_IFS; i++)
+ for (i = 1; i < BRCMF_MAX_IFS; i++)
if (drvr_priv->iflist[i])
brcmf_del_if(drvr_priv, i);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index a4d30c7..8607972 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -404,7 +404,7 @@ struct rte_console {
(((prio) == PRIO_8021D_NONE || (prio) == PRIO_8021D_BE) ? \
((prio^2)) : (prio))
-DHD_SPINWAIT_SLEEP_INIT(sdioh_spinwait_sleep);
+BRCMF_SPINWAIT_SLEEP_INIT(sdioh_spinwait_sleep);
/* Core reg address translation */
#define CORE_CC_REG(base, field) (base + offsetof(chipcregs_t, field))
@@ -940,7 +940,7 @@ static int brcmf_sdbrcm_htclk(dhd_bus_t *bus, bool on, bool pendok)
/* Otherwise, wait here (polling) for HT Avail */
if (!SBSDIO_CLKAV(clkctl, bus->alp_only)) {
- SPINWAIT_SLEEP(sdioh_spinwait_sleep,
+ BRCMF_SPINWAIT_SLEEP(sdioh_spinwait_sleep,
((clkctl =
brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR,
@@ -1403,7 +1403,8 @@ int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
else
bus->dhd->dstats.tx_bytes += datalen;
- if ((bus->idletime == DHD_IDLE_IMMEDIATE) && !bus->dpc_sched) {
+ if (bus->idletime == BRCMF_IDLE_IMMEDIATE &&
+ !bus->dpc_sched) {
bus->activity = false;
brcmf_sdbrcm_clkctl(bus, CLK_NONE, true);
}
@@ -1621,7 +1622,7 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
} while ((ret < 0) && retries++ < TXRETRIES);
}
- if ((bus->idletime == DHD_IDLE_IMMEDIATE) && !bus->dpc_sched) {
+ if ((bus->idletime == BRCMF_IDLE_IMMEDIATE) && !bus->dpc_sched) {
bus->activity = false;
brcmf_sdbrcm_clkctl(bus, CLK_NONE, true);
}
@@ -1752,7 +1753,7 @@ const struct brcmu_iovar dhdsdio_iovars[] = {
,
{"sbreg", IOV_SBREG, 0, IOVT_BUFFER, sizeof(struct brcmf_sdreg)}
,
- {"sd_cis", IOV_SDCIS, 0, IOVT_BUFFER, DHD_IOCTL_MAXLEN}
+ {"sd_cis", IOV_SDCIS, 0, IOVT_BUFFER, BRCMF_IOCTL_MAXLEN}
,
{"forcealign", IOV_FORCEEVEN, 0, IOVT_BOOL, 0}
,
@@ -1909,7 +1910,7 @@ static int brcmf_sdbrcm_pktgen_get(dhd_bus_t *bus, u8 *arg)
{
brcmf_pktgen_t pktgen;
- pktgen.version = DHD_PKTGEN_VERSION;
+ pktgen.version = BRCMF_PKTGEN_VERSION;
pktgen.freq = bus->pktgen_freq;
pktgen.count = bus->pktgen_count;
pktgen.print = bus->pktgen_print;
@@ -1933,7 +1934,7 @@ static int brcmf_sdbrcm_pktgen_set(dhd_bus_t *bus, u8 *arg)
uint oldcnt, oldmode;
memcpy(&pktgen, arg, sizeof(pktgen));
- if (pktgen.version != DHD_PKTGEN_VERSION)
+ if (pktgen.version != BRCMF_PKTGEN_VERSION)
return -EINVAL;
oldcnt = bus->pktgen_count;
@@ -2449,7 +2450,7 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
break;
case IOV_SVAL(IOV_IDLETIME):
- if ((int_val < 0) && (int_val != DHD_IDLE_IMMEDIATE))
+ if ((int_val < 0) && (int_val != BRCMF_IDLE_IMMEDIATE))
bcmerror = -EINVAL;
else
bus->idletime = int_val;
@@ -2793,7 +2794,7 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
}
exit:
- if ((bus->idletime == DHD_IDLE_IMMEDIATE) && !bus->dpc_sched) {
+ if ((bus->idletime == BRCMF_IDLE_IMMEDIATE) && !bus->dpc_sched) {
bus->activity = false;
brcmf_sdbrcm_clkctl(bus, CLK_NONE, true);
}
@@ -2998,7 +2999,8 @@ brcmf_sdbrcm_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
}
bus->roundup = min(max_roundup, bus->blocksize);
- if ((bus->idletime == DHD_IDLE_IMMEDIATE) && !bus->dpc_sched) {
+ if (bus->idletime == BRCMF_IDLE_IMMEDIATE &&
+ !bus->dpc_sched) {
bus->activity = false;
brcmf_sdbrcm_clkctl(bus, CLK_NONE, true);
}
@@ -3859,7 +3861,7 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
#ifdef SDTEST
/* Allow pktgen to override maxframes */
- if (bus->pktgen_count && (bus->pktgen_mode == DHD_PKTGEN_RECV)) {
+ if (bus->pktgen_count && (bus->pktgen_mode == BRCMF_PKTGEN_RECV)) {
maxframes = bus->pktgen_count;
sdtest = true;
}
@@ -4738,7 +4740,7 @@ clkwait:
/* If we're done for now, turn off clock request. */
if ((bus->clkstate != CLK_PENDING)
- && bus->idletime == DHD_IDLE_IMMEDIATE) {
+ && bus->idletime == BRCMF_IDLE_IMMEDIATE) {
bus->activity = false;
brcmf_sdbrcm_clkctl(bus, CLK_NONE, false);
}
@@ -4816,7 +4818,7 @@ static void brcmf_sdbrcm_pktgen_init(dhd_bus_t *bus)
bus->pktgen_count = (brcmf_pktgen * brcmf_watchdog_ms + 999) / 1000;
/* Default to echo mode */
- bus->pktgen_mode = DHD_PKTGEN_ECHO;
+ bus->pktgen_mode = BRCMF_PKTGEN_ECHO;
bus->pktgen_stop = 1;
}
@@ -4836,7 +4838,7 @@ static void brcmf_sdbrcm_pktgen(dhd_bus_t *bus)
}
/* For recv mode, just make sure dongle has started sending */
- if (bus->pktgen_mode == DHD_PKTGEN_RECV) {
+ if (bus->pktgen_mode == BRCMF_PKTGEN_RECV) {
if (!bus->pktgen_rcvd)
brcmf_sdbrcm_sdtest_set(bus, true);
return;
@@ -4867,17 +4869,17 @@ static void brcmf_sdbrcm_pktgen(dhd_bus_t *bus)
/* Write test header cmd and extra based on mode */
switch (bus->pktgen_mode) {
- case DHD_PKTGEN_ECHO:
+ case BRCMF_PKTGEN_ECHO:
*data++ = SDPCM_TEST_ECHOREQ;
*data++ = (u8) bus->pktgen_sent;
break;
- case DHD_PKTGEN_SEND:
+ case BRCMF_PKTGEN_SEND:
*data++ = SDPCM_TEST_DISCARD;
*data++ = (u8) bus->pktgen_sent;
break;
- case DHD_PKTGEN_RXBURST:
+ case BRCMF_PKTGEN_RXBURST:
*data++ = SDPCM_TEST_BURST;
*data++ = (u8) bus->pktgen_count;
break;
@@ -4923,7 +4925,7 @@ static void brcmf_sdbrcm_pktgen(dhd_bus_t *bus)
bus->pktgen_len = (u16) bus->pktgen_minlen;
/* Special case for burst mode: just send one request! */
- if (bus->pktgen_mode == DHD_PKTGEN_RXBURST)
+ if (bus->pktgen_mode == BRCMF_PKTGEN_RXBURST)
break;
}
}
@@ -5047,7 +5049,7 @@ brcmf_sdbrcm_checkdied(dhd_bus_t *bus, struct sk_buff *pkt, uint seq)
}
/* For recv mode, stop at limie (and tell dongle to stop sending) */
- if (bus->pktgen_mode == DHD_PKTGEN_RECV) {
+ if (bus->pktgen_mode == BRCMF_PKTGEN_RECV) {
if (bus->pktgen_total
&& (bus->pktgen_rcvd >= bus->pktgen_total)) {
bus->pktgen_count = 0;
@@ -5209,7 +5211,7 @@ static int brcmf_sdbrcm_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg,
brcmf_sdbrcm_txpkt(bus, pkt, SDPCM_EVENT_CHANNEL, true);
done:
- if ((bus->idletime == DHD_IDLE_IMMEDIATE) && !bus->dpc_sched) {
+ if ((bus->idletime == BRCMF_IDLE_IMMEDIATE) && !bus->dpc_sched) {
bus->activity = false;
brcmf_sdbrcm_clkctl(bus, CLK_NONE, true);
}
@@ -5588,7 +5590,7 @@ static bool brcmf_sdbrcm_probe_init(dhd_bus_t *bus, void *sdh)
/* ...and initialize clock/power states */
bus->clkstate = CLK_SDONLY;
bus->idletime = (s32) brcmf_idletime;
- bus->idleclock = DHD_IDLE_ACTIVE;
+ bus->idleclock = BRCMF_IDLE_ACTIVE;
/* Query the F2 block size, set roundup accordingly */
fnum = 2;
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index aeb305c..2555838 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -636,7 +636,7 @@ wl_dev_iovar_getbuf(struct net_device *dev, s8 * iovar, void *param,
static s32
wl_run_iscan(struct wl_iscan_ctrl *iscan, struct brcmf_ssid *ssid, u16 action)
{
- s32 params_size = (WL_SCAN_PARAMS_FIXED_SIZE +
+ s32 params_size = (BRCMF_SCAN_PARAMS_FIXED_SIZE +
offsetof(struct brcmf_iscan_params, params));
struct brcmf_iscan_params *params;
s32 err = 0;
@@ -650,7 +650,7 @@ wl_run_iscan(struct wl_iscan_ctrl *iscan, struct brcmf_ssid *ssid, u16 action)
wl_iscan_prep(¶ms->params, ssid);
- params->version = cpu_to_le32(ISCAN_REQ_VERSION);
+ params->version = cpu_to_le32(BRCMF_ISCAN_REQ_VERSION);
params->action = cpu_to_le16(action);
params->scan_duration = cpu_to_le16(0);
@@ -690,7 +690,7 @@ static s32 wl_do_iscan(struct wl_priv *wl)
}
wl_set_mpc(ndev, 0);
wl->iscan_kickstart = true;
- wl_run_iscan(iscan, &ssid, WL_SCAN_ACTION_START);
+ wl_run_iscan(iscan, &ssid, BRCMF_SCAN_ACTION_START);
mod_timer(&iscan->timer, jiffies + iscan->timer_ms * HZ / 1000);
iscan->timer_on = 1;
@@ -1025,8 +1025,8 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
/* BSSID */
if (params->bssid) {
memcpy(join_params.params.bssid, params->bssid, ETH_ALEN);
- join_params_size =
- sizeof(join_params.ssid) + WL_ASSOC_PARAMS_FIXED_SIZE;
+ join_params_size = sizeof(join_params.ssid) +
+ BRCMF_ASSOC_PARAMS_FIXED_SIZE;
} else {
memcpy(join_params.params.bssid, ether_bcast, ETH_ALEN);
}
@@ -1301,7 +1301,7 @@ wl_set_set_sharedkey(struct net_device *dev,
return -EINVAL;
}
memcpy(key.data, sme->key, key.len);
- key.flags = WL_PRIMARY_KEY;
+ key.flags = BRCMF_PRIMARY_KEY;
switch (sec->cipher_pairwise) {
case WLAN_CIPHER_SUITE_WEP40:
key.algo = CRYPTO_ALGO_WEP1;
@@ -1693,7 +1693,7 @@ wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
}
memcpy(key.data, params->key, key.len);
- key.flags = WL_PRIMARY_KEY;
+ key.flags = BRCMF_PRIMARY_KEY;
switch (params->cipher) {
case WLAN_CIPHER_SUITE_WEP40:
key.algo = CRYPTO_ALGO_WEP1;
@@ -1770,7 +1770,7 @@ wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
memset(&key, 0, sizeof(key));
key.index = (u32) key_idx;
- key.flags = WL_PRIMARY_KEY;
+ key.flags = BRCMF_PRIMARY_KEY;
key.algo = CRYPTO_ALGO_OFF;
WL_CONN("key index (%d)\n", key_idx);
@@ -2386,7 +2386,7 @@ static s32 wl_inform_bss(struct wl_priv *wl)
int i;
bss_list = wl->bss_list;
- if (unlikely(bss_list->version != WL_BSS_INFO_VERSION)) {
+ if (unlikely(bss_list->version != BRCMF_BSS_INFO_VERSION)) {
WL_ERR("Version %d != WL_BSS_INFO_VERSION\n",
bss_list->version);
return -EOPNOTSUPP;
@@ -2761,7 +2761,7 @@ static void wl_ch_to_chanspec(int ch, struct brcmf_join_params *join_params,
chanspec |= WL_CHANSPEC_BW_20;
chanspec |= WL_CHANSPEC_CTL_SB_NONE;
- *join_params_size += WL_ASSOC_PARAMS_FIXED_SIZE +
+ *join_params_size += BRCMF_ASSOC_PARAMS_FIXED_SIZE +
join_params->params.chanspec_num * sizeof(chanspec_t);
join_params->params.chanspec_list[0] &= WL_CHANSPEC_CHAN_MASK;
@@ -3221,7 +3221,7 @@ static s32 wl_iscan_inprogress(struct wl_priv *wl)
rtnl_lock();
wl_inform_bss(wl);
- wl_run_iscan(iscan, NULL, WL_SCAN_ACTION_CONTINUE);
+ wl_run_iscan(iscan, NULL, BRCMF_SCAN_ACTION_CONTINUE);
rtnl_unlock();
/* Reschedule the timer */
mod_timer(&iscan->timer, jiffies + iscan->timer_ms * HZ / 1000);
@@ -3254,7 +3254,7 @@ static s32 wl_iscan_thread(void *data)
sched_setscheduler(current, SCHED_FIFO, ¶m);
allow_signal(SIGTERM);
- status = WL_SCAN_RESULTS_PARTIAL;
+ status = BRCMF_SCAN_RESULTS_PARTIAL;
while (likely(!down_interruptible(&iscan->sync))) {
if (kthread_should_stop())
break;
@@ -3265,7 +3265,7 @@ static s32 wl_iscan_thread(void *data)
rtnl_lock();
err = wl_get_iscan_results(iscan, &status, &wl->bss_list);
if (unlikely(err)) {
- status = WL_SCAN_RESULTS_ABORTED;
+ status = BRCMF_SCAN_RESULTS_ABORTED;
WL_ERR("Abort iscan\n");
}
rtnl_unlock();
@@ -3313,11 +3313,11 @@ static s32 wl_invoke_iscan(struct wl_priv *wl)
static void wl_init_iscan_eloop(struct wl_iscan_eloop *el)
{
memset(el, 0, sizeof(*el));
- el->handler[WL_SCAN_RESULTS_SUCCESS] = wl_iscan_done;
- el->handler[WL_SCAN_RESULTS_PARTIAL] = wl_iscan_inprogress;
- el->handler[WL_SCAN_RESULTS_PENDING] = wl_iscan_pending;
- el->handler[WL_SCAN_RESULTS_ABORTED] = wl_iscan_aborted;
- el->handler[WL_SCAN_RESULTS_NO_MEM] = wl_iscan_aborted;
+ el->handler[BRCMF_SCAN_RESULTS_SUCCESS] = wl_iscan_done;
+ el->handler[BRCMF_SCAN_RESULTS_PARTIAL] = wl_iscan_inprogress;
+ el->handler[BRCMF_SCAN_RESULTS_PENDING] = wl_iscan_pending;
+ el->handler[BRCMF_SCAN_RESULTS_ABORTED] = wl_iscan_aborted;
+ el->handler[BRCMF_SCAN_RESULTS_NO_MEM] = wl_iscan_aborted;
}
static s32 wl_init_iscan(struct wl_priv *wl)
@@ -3613,22 +3613,22 @@ static s32 wl_dongle_mode(struct net_device *ndev, s32 iftype)
static s32 wl_dongle_eventmsg(struct net_device *ndev)
{
- s8 iovbuf[WL_EVENTING_MASK_LEN + 12]; /* Room for "event_msgs" +
- '\0' + bitvec */
- s8 eventmask[WL_EVENTING_MASK_LEN];
+ /* Room for "event_msgs" + '\0' + bitvec */
+ s8 iovbuf[BRCMF_EVENTING_MASK_LEN + 12];
+ s8 eventmask[BRCMF_EVENTING_MASK_LEN];
s32 err = 0;
WL_TRACE("Enter\n");
/* Setup event_msgs */
- brcmu_mkiovar("event_msgs", eventmask, WL_EVENTING_MASK_LEN, iovbuf,
+ brcmu_mkiovar("event_msgs", eventmask, BRCMF_EVENTING_MASK_LEN, iovbuf,
sizeof(iovbuf));
err = wl_dev_ioctl(ndev, BRCMF_C_GET_VAR, iovbuf, sizeof(iovbuf));
if (unlikely(err)) {
WL_ERR("Get event_msgs error (%d)\n", err);
goto dongle_eventmsg_out;
}
- memcpy(eventmask, iovbuf, WL_EVENTING_MASK_LEN);
+ memcpy(eventmask, iovbuf, BRCMF_EVENTING_MASK_LEN);
setbit(eventmask, BRCMF_E_SET_SSID);
setbit(eventmask, BRCMF_E_ROAM);
@@ -3650,7 +3650,7 @@ static s32 wl_dongle_eventmsg(struct net_device *ndev)
setbit(eventmask, BRCMF_E_JOIN_START);
setbit(eventmask, BRCMF_E_SCAN_COMPLETE);
- brcmu_mkiovar("event_msgs", eventmask, WL_EVENTING_MASK_LEN, iovbuf,
+ brcmu_mkiovar("event_msgs", eventmask, BRCMF_EVENTING_MASK_LEN, iovbuf,
sizeof(iovbuf));
err = wl_dev_ioctl(ndev, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
if (unlikely(err)) {
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
index 3400cc9..e6df203 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
@@ -112,7 +112,7 @@ do { \
* to reduce iteration
*/
#define WL_ISCAN_TIMER_INTERVAL_MS 3000
-#define WL_SCAN_ERSULTS_LAST (WL_SCAN_RESULTS_NO_MEM+1)
+#define WL_SCAN_ERSULTS_LAST (BRCMF_SCAN_RESULTS_NO_MEM+1)
#define WL_AP_MAX 256 /* virtually unlimitted as long
* as kernel memory allows
*/
--
1.7.1
Remove empty lock functions for sdio rx queue
Signed-off-by: Franky Lin <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 2 -
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 8 ------
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 28 ------------------------
3 files changed, 0 insertions(+), 38 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 4d92d69..01bacdb 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -974,8 +974,6 @@ extern void dhd_os_sdlock(dhd_pub_t *pub);
extern void dhd_os_sdunlock(dhd_pub_t *pub);
extern void dhd_os_sdlock_txq(dhd_pub_t *pub);
extern void dhd_os_sdunlock_txq(dhd_pub_t *pub);
-extern void dhd_os_sdlock_rxq(dhd_pub_t *pub);
-extern void dhd_os_sdunlock_rxq(dhd_pub_t *pub);
extern void dhd_os_sdlock_sndup_rxq(dhd_pub_t *pub);
extern void dhd_customer_gpio_wlan_ctrl(int onoff);
extern int dhd_custom_get_mac_address(unsigned char *buf);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index d7f7449..4811d7a 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -2595,14 +2595,6 @@ void dhd_os_sdunlock_txq(dhd_pub_t *pub)
spin_unlock_bh(&dhd->txqlock);
}
-void dhd_os_sdlock_rxq(dhd_pub_t *pub)
-{
-}
-
-void dhd_os_sdunlock_rxq(dhd_pub_t *pub)
-{
-}
-
static int
dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
wl_event_msg_t *event, void **data)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index a803848..dcfebac 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -796,10 +796,8 @@ static void dhdsdio_chip_detach(struct dhd_bus *bus);
*/
static void dhdsdio_pktfree2(dhd_bus_t *bus, struct sk_buff *pkt)
{
- dhd_os_sdlock_rxq(bus->dhd);
if ((bus->bus != SPI_BUS) || bus->usebufpool)
brcmu_pkt_buf_free_skb(pkt);
- dhd_os_sdunlock_rxq(bus->dhd);
}
static void dhd_dongle_setmemsize(struct dhd_bus *bus, int mem_size)
@@ -3379,8 +3377,6 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
/* If there's a descriptor, generate the packet chain */
if (bus->glomd) {
- dhd_os_sdlock_rxq(bus->dhd);
-
pfirst = plast = pnext = NULL;
dlen = (u16) (bus->glomd->len);
dptr = bus->glomd->data;
@@ -3464,8 +3460,6 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
brcmu_pkt_buf_free_skb(bus->glomd);
bus->glomd = NULL;
bus->nextlen = 0;
-
- dhd_os_sdunlock_rxq(bus->dhd);
}
/* Ok -- either we just generated a packet chain,
@@ -3525,9 +3519,7 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
} else {
bus->glomerr = 0;
dhdsdio_rxfail(bus, true, false);
- dhd_os_sdlock_rxq(bus->dhd);
brcmu_pkt_buf_free_skb(bus->glom);
- dhd_os_sdunlock_rxq(bus->dhd);
bus->rxglomfail++;
bus->glom = NULL;
}
@@ -3658,9 +3650,7 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
} else {
bus->glomerr = 0;
dhdsdio_rxfail(bus, true, false);
- dhd_os_sdlock_rxq(bus->dhd);
brcmu_pkt_buf_free_skb(bus->glom);
- dhd_os_sdunlock_rxq(bus->dhd);
bus->rxglomfail++;
bus->glom = NULL;
}
@@ -3673,7 +3663,6 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
bus->glom = NULL;
plast = NULL;
- dhd_os_sdlock_rxq(bus->dhd);
for (num = 0; pfirst; rxseq++, pfirst = pnext) {
pnext = pfirst->next;
pfirst->next = NULL;
@@ -3752,7 +3741,6 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
}
#endif /* DHD_DEBUG */
}
- dhd_os_sdunlock_rxq(bus->dhd);
if (num) {
dhd_os_sdunlock(bus->dhd);
dhd_rx_frame(bus->dhd, ifidx, save_pfirst, num);
@@ -3860,7 +3848,6 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
* or non-data frame.
*/
/* Allocate a packet buffer */
- dhd_os_sdlock_rxq(bus->dhd);
pkt = brcmu_pkt_buf_get_skb(rdlen + DHD_SDALIGN);
if (!pkt) {
if (bus->bus == SPI_BUS) {
@@ -3894,7 +3881,6 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
rdlen, sdret));
/* dhd.rx_ctlerrs is higher */
bus->rxc_errors++;
- dhd_os_sdunlock_rxq(bus->dhd);
dhdsdio_rxfail(bus, true,
(bus->bus ==
SPI_BUS) ? false
@@ -3910,9 +3896,6 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
" len %d rdlen %d expected"
" rxseq %d\n", __func__,
len, rdlen, rxseq));
- /* Just go try again w/normal
- header read */
- dhd_os_sdunlock_rxq(bus->dhd);
continue;
}
} else {
@@ -3936,7 +3919,6 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
__func__, rdlen, sdret));
brcmu_pkt_buf_free_skb(pkt);
bus->dhd->rx_errors++;
- dhd_os_sdunlock_rxq(bus->dhd);
/* Force retry w/normal header read.
* Don't attempt NAK for
* gSPI
@@ -3948,7 +3930,6 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
continue;
}
}
- dhd_os_sdunlock_rxq(bus->dhd);
/* Now check the header */
memcpy(bus->rxhdr, rxbuf, SDPCM_HDRLEN);
@@ -4246,18 +4227,15 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
continue;
}
- dhd_os_sdlock_rxq(bus->dhd);
pkt = brcmu_pkt_buf_get_skb(rdlen + firstread + DHD_SDALIGN);
if (!pkt) {
/* Give up on data, request rtx of events */
DHD_ERROR(("%s: brcmu_pkt_buf_get_skb failed: rdlen %d"
" chan %d\n", __func__, rdlen, chan));
bus->dhd->rx_dropped++;
- dhd_os_sdunlock_rxq(bus->dhd);
dhdsdio_rxfail(bus, false, RETRYCHAN(chan));
continue;
}
- dhd_os_sdunlock_rxq(bus->dhd);
ASSERT(!(pkt->prev));
@@ -4281,9 +4259,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
SDPCM_DATA_CHANNEL)
? "data" : "test")),
sdret));
- dhd_os_sdlock_rxq(bus->dhd);
brcmu_pkt_buf_free_skb(pkt);
- dhd_os_sdunlock_rxq(bus->dhd);
bus->dhd->rx_errors++;
dhdsdio_rxfail(bus, true, RETRYCHAN(chan));
continue;
@@ -4340,15 +4316,11 @@ deliver:
#endif /* SDTEST */
if (pkt->len == 0) {
- dhd_os_sdlock_rxq(bus->dhd);
brcmu_pkt_buf_free_skb(pkt);
- dhd_os_sdunlock_rxq(bus->dhd);
continue;
} else if (dhd_prot_hdrpull(bus->dhd, &ifidx, pkt) != 0) {
DHD_ERROR(("%s: rx protocol error\n", __func__));
- dhd_os_sdlock_rxq(bus->dhd);
brcmu_pkt_buf_free_skb(pkt);
- dhd_os_sdunlock_rxq(bus->dhd);
bus->dhd->rx_errors++;
continue;
}
--
1.7.1
From: Arend van Spriel <[email protected]>
These macros are not needed in a linux-only driver and have been
removed.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 42 +++--------------------
1 files changed, 6 insertions(+), 36 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 006b642..a3b60da 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -990,26 +990,9 @@ int brcmf_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf)
return ret;
}
-static inline void *
-osl_pkt_frmnative(struct sk_buff *skb)
-{
- return (void *)skb;
-}
-#define PKTFRMNATIVE(osh, skb) \
- osl_pkt_frmnative((struct sk_buff *)(skb))
-
-static inline struct sk_buff *
-osl_pkt_tonative(void *pkt)
-{
- return (struct sk_buff *)pkt;
-}
-#define PKTTONATIVE(osh, pkt) \
- osl_pkt_tonative((pkt))
-
static int dhd_start_xmit(struct sk_buff *skb, struct net_device *net)
{
int ret;
- void *pktbuf;
dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
int ifidx;
@@ -1048,17 +1031,7 @@ static int dhd_start_xmit(struct sk_buff *skb, struct net_device *net)
}
}
- /* Convert to packet */
- pktbuf = PKTFRMNATIVE(dhd->pub.osh, skb);
- if (!pktbuf) {
- DHD_ERROR(("%s: PKTFRMNATIVE failed\n",
- brcmf_ifname(&dhd->pub, ifidx)));
- dev_kfree_skb_any(skb);
- ret = -ENOMEM;
- goto done;
- }
-
- ret = brcmf_sendpkt(&dhd->pub, ifidx, pktbuf);
+ ret = brcmf_sendpkt(&dhd->pub, ifidx, skb);
done:
if (ret)
@@ -1086,11 +1059,10 @@ void brcmf_txflowcontrol(dhd_pub_t *dhdp, int ifidx, bool state)
netif_wake_queue(net);
}
-void brcmf_rx_frame(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf,
+void brcmf_rx_frame(dhd_pub_t *dhdp, int ifidx, struct sk_buff *skb,
int numpkt)
{
dhd_info_t *dhd = (dhd_info_t *) dhdp->info;
- struct sk_buff *skb;
unsigned char *eth;
uint len;
void *data;
@@ -1101,14 +1073,12 @@ void brcmf_rx_frame(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf,
DHD_TRACE(("%s: Enter\n", __func__));
- save_pktbuf = pktbuf;
-
- for (i = 0; pktbuf && i < numpkt; i++, pktbuf = pnext) {
+ save_pktbuf = skb;
- pnext = pktbuf->next;
- pktbuf->next = NULL;
+ for (i = 0; skb && i < numpkt; i++, skb = pnext) {
- skb = PKTTONATIVE(dhdp->osh, pktbuf);
+ pnext = skb->next;
+ skb->next = NULL;
/* Get the protocol, maintain skb around eth_type_trans()
* The main reason for this hack is for the limitation of
--
1.7.1
From: Arend van Spriel <[email protected]>
Three global variable were defined but never used and have been
removed.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index bb9a72a..cb7e455 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -35,11 +35,6 @@ int dhd_msg_level;
char fw_path[MOD_PARAM_PATHLEN];
char nv_path[MOD_PARAM_PATHLEN];
-/* Last connection success/failure status */
-u32 dhd_conn_event;
-u32 dhd_conn_status;
-u32 dhd_conn_reason;
-
extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
uint len);
extern void dhd_ind_scan_confirm(void *h, bool status);
--
1.7.1
From: Arend van Spriel <[email protected]>
The macro definition FOREACH_AS_STA does an assignment inside the
if condition, which is considered a checkpatch error. It has been
removed.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/main.c | 31 +++++++++++++++-------------
1 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index 093f3bf..f7ebaf1 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -252,12 +252,6 @@ const u8 wlc_prio2prec_map[] = {
#define BSSCFG_STA(cfg) (1)
#define BSSCFG_IBSS(cfg) (!(cfg)->BSS)
-/* Iterator for "associated" STA bss configs:
- (struct brcms_c_info *wlc, int idx, struct brcms_c_bsscfg *cfg) */
-#define FOREACH_AS_STA(wlc, idx, cfg) \
- for (idx = 0; (int) idx < WLC_MAXBSSCFG; idx++) \
- if ((cfg = (wlc)->bsscfg[idx]) && BSSCFG_STA(cfg) && cfg->associated)
-
/* As above for all non-NULL BSS configs */
#define FOREACH_BSS(wlc, idx, cfg) \
for (idx = 0; (int) idx < WLC_MAXBSSCFG; idx++) \
@@ -396,13 +390,19 @@ bool brcms_c_ps_allowed(struct brcms_c_info *wlc)
if (AP_ACTIVE(wlc) || wlc->monitor)
return false;
- FOREACH_AS_STA(wlc, idx, cfg) {
- /* disallow PS when one of the following bsscfg specific conditions meets */
- if (!cfg->BSS || !WLC_PORTOPEN(cfg))
- return false;
+ for (idx = 0; idx < WLC_MAXBSSCFG; idx++) {
+ cfg = wlc->bsscfg[idx];
+ if (cfg && BSSCFG_STA(cfg) && cfg->associated) {
+ /*
+ * disallow PS when one of the following
+ * bsscfg specific conditions meets
+ */
+ if (!cfg->BSS || !WLC_PORTOPEN(cfg))
+ return false;
- if (!cfg->dtim_programmed)
- return false;
+ if (!cfg->dtim_programmed)
+ return false;
+ }
}
return true;
@@ -1060,8 +1060,11 @@ static void WLBANDINITFN(brcms_c_setband) (struct brcms_c_info *wlc,
return;
/* wait for at least one beacon before entering sleeping state */
- FOREACH_AS_STA(wlc, idx, cfg)
- cfg->PMawakebcn = true;
+ for (idx = 0; idx < WLC_MAXBSSCFG; idx++) {
+ cfg = wlc->bsscfg[idx];
+ if (cfg && BSSCFG_STA(cfg) && cfg->associated)
+ cfg->PMawakebcn = true;
+ }
brcms_c_set_ps_ctrl(wlc);
/* band-specific initializations */
--
1.7.1
From: Arend van Spriel <[email protected]>
Several unused macro definitions have been removed.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 12 ------------
1 files changed, 0 insertions(+), 12 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 9b1a7f4..77b381c 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -624,13 +624,8 @@ extern atomic_t brcmf_mmc_suspend;
} \
} while (0)
#define BRCMF_PM_RESUME_WAIT(a) _BRCMF_PM_RESUME_WAIT(a, 30)
-#define DHD_PM_RESUME_WAIT_FOREVER(a) _BRCMF_PM_RESUME_WAIT(a, ~0)
#define BRCMF_PM_RESUME_RETURN_ERROR(a) \
do { if (atomic_read(&brcmf_mmc_suspend)) return a; } while (0)
-#define DHD_PM_RESUME_RETURN do { \
- if (atomic_read(&brcmf_mmc_suspend)) \
- return; \
- } while (0)
#define BRCMF_SPINWAIT_SLEEP_INIT(a) DECLARE_WAIT_QUEUE_HEAD(a);
#define BRCMF_SPINWAIT_SLEEP(a, exp, us) do { \
@@ -645,9 +640,7 @@ extern atomic_t brcmf_mmc_suspend;
#define BRCMF_PM_RESUME_WAIT_INIT(a)
#define BRCMF_PM_RESUME_WAIT(a)
-#define DHD_PM_RESUME_WAIT_FOREVER(a)
#define BRCMF_PM_RESUME_RETURN_ERROR(a)
-#define DHD_PM_RESUME_RETURN
#define BRCMF_SPINWAIT_SLEEP_INIT(a)
#define BRCMF_SPINWAIT_SLEEP(a, exp, us) do { \
@@ -865,9 +858,7 @@ typedef struct dhd_ioctl {
/* bump this number if you change the ioctl interface */
#define BRCMF_IOCTL_VERSION 1
-
#define BRCMF_IOCTL_MAXLEN 8192 /* max length ioctl buffer required */
-#define DHD_IOCTL_SMLEN 256 /* "small" length ioctl buffer required */
/* common ioctl definitions */
#define BRCMF_GET_MAGIC 0
@@ -885,7 +876,6 @@ typedef struct dhd_ioctl {
#define BRCMF_HDRS_VAL 0x0040
#define BRCMF_BYTES_VAL 0x0080
#define BRCMF_INTR_VAL 0x0100
-#define DHD_LOG_VAL 0x0200
#define BRCMF_GLOM_VAL 0x0400
#define BRCMF_EVENT_VAL 0x0800
#define BRCMF_BTA_VAL 0x1000
@@ -926,7 +916,5 @@ typedef struct brcmf_pktgen {
when idle */
#define BRCMF_IDLE_ACTIVE 0 /* Do not request any SD clock change
when idle */
-#define DHD_IDLE_STOP (-1) /* Request SD clock be stopped
- (and use SD1 mode) */
#endif /* _dhd_h_ */
--
1.7.1
From: Roland Vossen <[email protected]>
Code cleanup. Prefixed functions with brcmf_ for unique namespace. In addition
to that, prefix has been changed to categorize functions depending on their
place in the drivers SDIO stack.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h | 48 +-
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 158 ++--
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c | 58 +-
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 146 ++--
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h | 22 +-
.../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c | 52 +-
drivers/staging/brcm80211/brcmfmac/dhd_bus.h | 22 +-
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 9 +-
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 26 +-
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 29 +-
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 1010 ++++++++++----------
drivers/staging/brcm80211/brcmfmac/sdio_host.h | 79 +-
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 4 +-
13 files changed, 855 insertions(+), 808 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
index e9da1ce..7eb0354 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
@@ -48,68 +48,70 @@ typedef void (*sdioh_cb_fn_t) (void *);
* The handler shall be provided by all subsequent calls. No local cache
* cfghdl points to the starting address of pci device mapped memory
*/
-extern sdioh_info_t *sdioh_attach(void *cfghdl, uint irq);
-extern SDIOH_API_RC sdioh_detach(sdioh_info_t *si);
-extern SDIOH_API_RC sdioh_interrupt_register(sdioh_info_t *si,
+extern sdioh_info_t *brcmf_sdioh_attach(void *cfghdl, uint irq);
+extern SDIOH_API_RC brcmf_sdioh_detach(sdioh_info_t *si);
+extern SDIOH_API_RC brcmf_sdioh_interrupt_register(sdioh_info_t *si,
sdioh_cb_fn_t fn, void *argh);
-extern SDIOH_API_RC sdioh_interrupt_deregister(sdioh_info_t *si);
+extern SDIOH_API_RC brcmf_sdioh_interrupt_deregister(sdioh_info_t *si);
/* query whether SD interrupt is enabled or not */
-extern SDIOH_API_RC sdioh_interrupt_query(sdioh_info_t *si, bool *onoff);
+extern SDIOH_API_RC brcmf_sdioh_interrupt_query(sdioh_info_t *si, bool *onoff);
/* enable or disable SD interrupt */
-extern SDIOH_API_RC sdioh_interrupt_set(sdioh_info_t *si, bool enable_disable);
+extern SDIOH_API_RC
+brcmf_sdioh_interrupt_set(sdioh_info_t *si, bool enable_disable);
#if defined(DHD_DEBUG)
-extern bool sdioh_interrupt_pending(sdioh_info_t *si);
+extern bool brcmf_sdioh_interrupt_pending(sdioh_info_t *si);
#endif
-extern int sdioh_claim_host_and_lock(sdioh_info_t *si);
-extern int sdioh_release_host_and_unlock(sdioh_info_t *si);
+extern int brcmf_sdioh_claim_host_and_lock(sdioh_info_t *si);
+extern int brcmf_sdioh_release_host_and_unlock(sdioh_info_t *si);
/* read or write one byte using cmd52 */
-extern SDIOH_API_RC sdioh_request_byte(sdioh_info_t *si, uint rw, uint fnc,
- uint addr, u8 *byte);
+extern SDIOH_API_RC
+brcmf_sdioh_request_byte(sdioh_info_t *si, uint rw, uint fnc, uint addr,
+ u8 *byte);
/* read or write 2/4 bytes using cmd53 */
-extern SDIOH_API_RC sdioh_request_word(sdioh_info_t *si, uint cmd_type,
+extern SDIOH_API_RC brcmf_sdioh_request_word(sdioh_info_t *si, uint cmd_type,
uint rw, uint fnc, uint addr,
u32 *word, uint nbyte);
/* read or write any buffer using cmd53 */
-extern SDIOH_API_RC sdioh_request_buffer(sdioh_info_t *si, uint pio_dma,
+extern SDIOH_API_RC brcmf_sdioh_request_buffer(sdioh_info_t *si, uint pio_dma,
uint fix_inc, uint rw, uint fnc_num,
u32 addr, uint regwidth,
u32 buflen, u8 *buffer,
struct sk_buff *pkt);
/* get cis data */
-extern SDIOH_API_RC sdioh_cis_read(sdioh_info_t *si, uint fuc, u8 *cis,
+extern SDIOH_API_RC brcmf_sdioh_cis_read(sdioh_info_t *si, uint fuc, u8 *cis,
u32 length);
-extern SDIOH_API_RC sdioh_cfg_read(sdioh_info_t *si, uint fuc, u32 addr,
+extern SDIOH_API_RC brcmf_sdioh_cfg_read(sdioh_info_t *si, uint fuc, u32 addr,
u8 *data);
-extern SDIOH_API_RC sdioh_cfg_write(sdioh_info_t *si, uint fuc, u32 addr,
+extern SDIOH_API_RC brcmf_sdioh_cfg_write(sdioh_info_t *si, uint fuc, u32 addr,
u8 *data);
/* query number of io functions */
-extern uint sdioh_query_iofnum(sdioh_info_t *si);
+extern uint brcmf_sdioh_query_iofnum(sdioh_info_t *si);
/* handle iovars */
-extern int sdioh_iovar_op(sdioh_info_t *si, const char *name,
+extern int brcmf_sdioh_iovar_op(sdioh_info_t *si, const char *name,
void *params, int plen, void *arg, int len, bool set);
/* Issue abort to the specified function and clear controller as needed */
-extern int sdioh_abort(sdioh_info_t *si, uint fnc);
+extern int brcmf_sdioh_abort(sdioh_info_t *si, uint fnc);
/* Start and Stop SDIO without re-enumerating the SD card. */
-extern int sdioh_start(sdioh_info_t *si, int stage);
-extern int sdioh_stop(sdioh_info_t *si);
+extern int brcmf_sdioh_start(sdioh_info_t *si, int stage);
+extern int brcmf_sdioh_stop(sdioh_info_t *si);
/* Reset and re-initialize the device */
-extern int sdioh_sdio_reset(sdioh_info_t *si);
+extern int brcmf_sdioh_reset(sdioh_info_t *si);
/* Helper function */
-void *bcmsdh_get_sdioh(bcmsdh_info_t *sdh);
+void *brcmf_sdcard_get_sdioh(bcmsdh_info_t *sdh);
#endif /* _sdio_api_h_ */
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
index 58dffc0..f41bb1e 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
@@ -45,15 +45,15 @@ struct bcmsdh_info {
bcmsdh_info_t *l_bcmsdh;
#if defined(OOB_INTR_ONLY) && defined(HW_OOB)
-extern int sdioh_enable_hw_oob_intr(void *sdioh, bool enable);
+extern int brcmf_sdioh_enable_hw_oob_intr(void *sdioh, bool enable);
-void bcmsdh_enable_hw_oob_intr(bcmsdh_info_t *sdh, bool enable)
+void brcmf_sdcard_enable_hw_oob_intr(bcmsdh_info_t *sdh, bool enable)
{
- sdioh_enable_hw_oob_intr(sdh->sdioh, enable);
+ brcmf_sdioh_enable_hw_oob_intr(sdh->sdioh, enable);
}
#endif
-bcmsdh_info_t *bcmsdh_attach(void *cfghdl, void **regsva, uint irq)
+bcmsdh_info_t *brcmf_sdcard_attach(void *cfghdl, void **regsva, uint irq)
{
bcmsdh_info_t *bcmsdh;
@@ -66,9 +66,9 @@ bcmsdh_info_t *bcmsdh_attach(void *cfghdl, void **regsva, uint irq)
/* save the handler locally */
l_bcmsdh = bcmsdh;
- bcmsdh->sdioh = sdioh_attach(cfghdl, irq);
+ bcmsdh->sdioh = brcmf_sdioh_attach(cfghdl, irq);
if (!bcmsdh->sdioh) {
- bcmsdh_detach(bcmsdh);
+ brcmf_sdcard_detach(bcmsdh);
return NULL;
}
@@ -81,13 +81,13 @@ bcmsdh_info_t *bcmsdh_attach(void *cfghdl, void **regsva, uint irq)
return bcmsdh;
}
-int bcmsdh_detach(void *sdh)
+int brcmf_sdcard_detach(void *sdh)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
if (bcmsdh != NULL) {
if (bcmsdh->sdioh) {
- sdioh_detach(bcmsdh->sdioh);
+ brcmf_sdioh_detach(bcmsdh->sdioh);
bcmsdh->sdioh = NULL;
}
kfree(bcmsdh);
@@ -98,78 +98,79 @@ int bcmsdh_detach(void *sdh)
}
int
-bcmsdh_iovar_op(void *sdh, const char *name,
+brcmf_sdcard_iovar_op(void *sdh, const char *name,
void *params, int plen, void *arg, int len, bool set)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
- return sdioh_iovar_op(bcmsdh->sdioh, name, params, plen, arg, len, set);
+ return brcmf_sdioh_iovar_op(bcmsdh->sdioh, name, params, plen, arg,
+ len, set);
}
-bool bcmsdh_intr_query(void *sdh)
+bool brcmf_sdcard_intr_query(void *sdh)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
SDIOH_API_RC status;
bool on;
ASSERT(bcmsdh);
- status = sdioh_interrupt_query(bcmsdh->sdioh, &on);
+ status = brcmf_sdioh_interrupt_query(bcmsdh->sdioh, &on);
if (SDIOH_API_SUCCESS(status))
return false;
else
return on;
}
-int bcmsdh_intr_enable(void *sdh)
+int brcmf_sdcard_intr_enable(void *sdh)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
SDIOH_API_RC status;
ASSERT(bcmsdh);
- status = sdioh_interrupt_set(bcmsdh->sdioh, true);
+ status = brcmf_sdioh_interrupt_set(bcmsdh->sdioh, true);
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}
-int bcmsdh_intr_disable(void *sdh)
+int brcmf_sdcard_intr_disable(void *sdh)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
SDIOH_API_RC status;
ASSERT(bcmsdh);
- status = sdioh_interrupt_set(bcmsdh->sdioh, false);
+ status = brcmf_sdioh_interrupt_set(bcmsdh->sdioh, false);
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}
-int bcmsdh_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
+int brcmf_sdcard_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
SDIOH_API_RC status;
ASSERT(bcmsdh);
- status = sdioh_interrupt_register(bcmsdh->sdioh, fn, argh);
+ status = brcmf_sdioh_interrupt_register(bcmsdh->sdioh, fn, argh);
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}
-int bcmsdh_intr_dereg(void *sdh)
+int brcmf_sdcard_intr_dereg(void *sdh)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
SDIOH_API_RC status;
ASSERT(bcmsdh);
- status = sdioh_interrupt_deregister(bcmsdh->sdioh);
+ status = brcmf_sdioh_interrupt_deregister(bcmsdh->sdioh);
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}
#if defined(DHD_DEBUG)
-bool bcmsdh_intr_pending(void *sdh)
+bool brcmf_sdcard_intr_pending(void *sdh)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
ASSERT(sdh);
- return sdioh_interrupt_pending(bcmsdh->sdioh);
+ return brcmf_sdioh_interrupt_pending(bcmsdh->sdioh);
}
#endif
-int bcmsdh_devremove_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
+int brcmf_sdcard_devremove_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
{
ASSERT(sdh);
@@ -177,7 +178,7 @@ int bcmsdh_devremove_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
return -ENOTSUPP;
}
-u8 bcmsdh_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
+u8 brcmf_sdcard_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
SDIOH_API_RC status;
@@ -197,7 +198,7 @@ u8 bcmsdh_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
udelay(1000);
#endif
status =
- sdioh_cfg_read(bcmsdh->sdioh, fnc_num, addr,
+ brcmf_sdioh_cfg_read(bcmsdh->sdioh, fnc_num, addr,
(u8 *) &data);
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
} while (!SDIOH_API_SUCCESS(status)
@@ -213,7 +214,7 @@ u8 bcmsdh_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
}
void
-bcmsdh_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
+brcmf_sdcard_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
SDIOH_API_RC status;
@@ -232,7 +233,7 @@ bcmsdh_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
udelay(1000);
#endif
status =
- sdioh_cfg_write(bcmsdh->sdioh, fnc_num, addr,
+ brcmf_sdioh_cfg_write(bcmsdh->sdioh, fnc_num, addr,
(u8 *) &data);
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
} while (!SDIOH_API_SUCCESS(status)
@@ -245,7 +246,7 @@ bcmsdh_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
__func__, fnc_num, addr, data));
}
-u32 bcmsdh_cfg_read_word(void *sdh, uint fnc_num, u32 addr, int *err)
+u32 brcmf_sdcard_cfg_read_word(void *sdh, uint fnc_num, u32 addr, int *err)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
SDIOH_API_RC status;
@@ -256,9 +257,8 @@ u32 bcmsdh_cfg_read_word(void *sdh, uint fnc_num, u32 addr, int *err)
ASSERT(bcmsdh->init_success);
- status =
- sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL, SDIOH_READ,
- fnc_num, addr, &data, 4);
+ status = brcmf_sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
+ SDIOH_READ, fnc_num, addr, &data, 4);
if (err)
*err = (SDIOH_API_SUCCESS(status) ? 0 : -EIO);
@@ -270,7 +270,7 @@ u32 bcmsdh_cfg_read_word(void *sdh, uint fnc_num, u32 addr, int *err)
}
void
-bcmsdh_cfg_write_word(void *sdh, uint fnc_num, u32 addr, u32 data,
+brcmf_sdcard_cfg_write_word(void *sdh, uint fnc_num, u32 addr, u32 data,
int *err)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
@@ -282,7 +282,7 @@ bcmsdh_cfg_write_word(void *sdh, uint fnc_num, u32 addr, u32 data,
ASSERT(bcmsdh->init_success);
status =
- sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
+ brcmf_sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
SDIOH_WRITE, fnc_num, addr, &data, 4);
if (err)
@@ -292,7 +292,7 @@ bcmsdh_cfg_write_word(void *sdh, uint fnc_num, u32 addr, u32 data,
__func__, fnc_num, addr, data));
}
-int bcmsdh_cis_read(void *sdh, uint func, u8 * cis, uint length)
+int brcmf_sdcard_cis_read(void *sdh, uint func, u8 * cis, uint length)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
SDIOH_API_RC status;
@@ -309,7 +309,7 @@ int bcmsdh_cis_read(void *sdh, uint func, u8 * cis, uint length)
ASSERT(cis);
ASSERT(length <= SBSDIO_CIS_SIZE_LIMIT);
- status = sdioh_cis_read(bcmsdh->sdioh, func, cis, length);
+ status = brcmf_sdioh_cis_read(bcmsdh->sdioh, func, cis, length);
if (ascii) {
/* Move binary bits to tmp and format them
@@ -332,24 +332,27 @@ int bcmsdh_cis_read(void *sdh, uint func, u8 * cis, uint length)
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}
-static int bcmsdhsdio_set_sbaddr_window(void *sdh, u32 address)
+static int brcmf_sdcard_set_sbaddr_window(void *sdh, u32 address)
{
int err = 0;
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
- bcmsdh_cfg_write(bcmsdh, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRLOW,
+ brcmf_sdcard_cfg_write(bcmsdh, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRLOW,
(address >> 8) & SBSDIO_SBADDRLOW_MASK, &err);
if (!err)
- bcmsdh_cfg_write(bcmsdh, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRMID,
- (address >> 16) & SBSDIO_SBADDRMID_MASK, &err);
+ brcmf_sdcard_cfg_write(bcmsdh, SDIO_FUNC_1,
+ SBSDIO_FUNC1_SBADDRMID,
+ (address >> 16) & SBSDIO_SBADDRMID_MASK,
+ &err);
if (!err)
- bcmsdh_cfg_write(bcmsdh, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRHIGH,
- (address >> 24) & SBSDIO_SBADDRHIGH_MASK,
- &err);
+ brcmf_sdcard_cfg_write(bcmsdh, SDIO_FUNC_1,
+ SBSDIO_FUNC1_SBADDRHIGH,
+ (address >> 24) & SBSDIO_SBADDRHIGH_MASK,
+ &err);
return err;
}
-u32 bcmsdh_reg_read(void *sdh, u32 addr, uint size)
+u32 brcmf_sdcard_reg_read(void *sdh, u32 addr, uint size)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
SDIOH_API_RC status;
@@ -364,7 +367,7 @@ u32 bcmsdh_reg_read(void *sdh, u32 addr, uint size)
ASSERT(bcmsdh->init_success);
if (bar0 != bcmsdh->sbwad) {
- if (bcmsdhsdio_set_sbaddr_window(bcmsdh, bar0))
+ if (brcmf_sdcard_set_sbaddr_window(bcmsdh, bar0))
return 0xFFFFFFFF;
bcmsdh->sbwad = bar0;
@@ -374,7 +377,7 @@ u32 bcmsdh_reg_read(void *sdh, u32 addr, uint size)
if (size == 4)
addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
- status = sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
+ status = brcmf_sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
SDIOH_READ, SDIO_FUNC_1, addr, &word, size);
bcmsdh->regfail = !(SDIOH_API_SUCCESS(status));
@@ -402,7 +405,7 @@ u32 bcmsdh_reg_read(void *sdh, u32 addr, uint size)
return 0xFFFFFFFF;
}
-u32 bcmsdh_reg_write(void *sdh, u32 addr, uint size, u32 data)
+u32 brcmf_sdcard_reg_write(void *sdh, u32 addr, uint size, u32 data)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
SDIOH_API_RC status;
@@ -418,7 +421,7 @@ u32 bcmsdh_reg_write(void *sdh, u32 addr, uint size, u32 data)
ASSERT(bcmsdh->init_success);
if (bar0 != bcmsdh->sbwad) {
- err = bcmsdhsdio_set_sbaddr_window(bcmsdh, bar0);
+ err = brcmf_sdcard_set_sbaddr_window(bcmsdh, bar0);
if (err)
return err;
@@ -429,7 +432,7 @@ u32 bcmsdh_reg_write(void *sdh, u32 addr, uint size, u32 data)
if (size == 4)
addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
status =
- sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
+ brcmf_sdioh_request_word(bcmsdh->sdioh, SDIOH_CMD_TYPE_NORMAL,
SDIOH_WRITE, SDIO_FUNC_1, addr, &data, size);
bcmsdh->regfail = !(SDIOH_API_SUCCESS(status));
@@ -441,13 +444,13 @@ u32 bcmsdh_reg_write(void *sdh, u32 addr, uint size, u32 data)
return 0xFFFFFFFF;
}
-bool bcmsdh_regfail(void *sdh)
+bool brcmf_sdcard_regfail(void *sdh)
{
return ((bcmsdh_info_t *) sdh)->regfail;
}
int
-bcmsdh_recv_buf(bcmsdh_info_t *bcmsdh, u32 addr, uint fn, uint flags,
+brcmf_sdcard_recv_buf(bcmsdh_info_t *bcmsdh, u32 addr, uint fn, uint flags,
u8 *buf, uint nbytes, struct sk_buff *pkt,
bcmsdh_cmplt_fn_t complete, void *handle)
{
@@ -469,7 +472,7 @@ bcmsdh_recv_buf(bcmsdh_info_t *bcmsdh, u32 addr, uint fn, uint flags,
return -ENOTSUPP;
if (bar0 != bcmsdh->sbwad) {
- err = bcmsdhsdio_set_sbaddr_window(bcmsdh, bar0);
+ err = brcmf_sdcard_set_sbaddr_window(bcmsdh, bar0);
if (err)
return err;
@@ -483,15 +486,14 @@ bcmsdh_recv_buf(bcmsdh_info_t *bcmsdh, u32 addr, uint fn, uint flags,
if (width == 4)
addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
- status = sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO, incr_fix,
- SDIOH_READ, fn, addr, width, nbytes, buf,
- pkt);
+ status = brcmf_sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO,
+ incr_fix, SDIOH_READ, fn, addr, width, nbytes, buf, pkt);
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}
int
-bcmsdh_send_buf(void *sdh, u32 addr, uint fn, uint flags,
+brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags,
u8 *buf, uint nbytes, void *pkt,
bcmsdh_cmplt_fn_t complete, void *handle)
{
@@ -514,7 +516,7 @@ bcmsdh_send_buf(void *sdh, u32 addr, uint fn, uint flags,
return -ENOTSUPP;
if (bar0 != bcmsdh->sbwad) {
- err = bcmsdhsdio_set_sbaddr_window(bcmsdh, bar0);
+ err = brcmf_sdcard_set_sbaddr_window(bcmsdh, bar0);
if (err)
return err;
@@ -528,14 +530,13 @@ bcmsdh_send_buf(void *sdh, u32 addr, uint fn, uint flags,
if (width == 4)
addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
- status = sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO, incr_fix,
- SDIOH_WRITE, fn, addr, width, nbytes, buf,
- pkt);
+ status = brcmf_sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO,
+ incr_fix, SDIOH_WRITE, fn, addr, width, nbytes, buf, pkt);
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}
-int bcmsdh_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes)
+int brcmf_sdcard_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
SDIOH_API_RC status;
@@ -547,72 +548,71 @@ int bcmsdh_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes)
addr &= SBSDIO_SB_OFT_ADDR_MASK;
addr |= SBSDIO_SB_ACCESS_2_4B_FLAG;
- status =
- sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO, SDIOH_DATA_INC,
- (rw ? SDIOH_WRITE : SDIOH_READ), SDIO_FUNC_1,
- addr, 4, nbytes, buf, NULL);
+ status = brcmf_sdioh_request_buffer(bcmsdh->sdioh, SDIOH_DATA_PIO,
+ SDIOH_DATA_INC, (rw ? SDIOH_WRITE : SDIOH_READ), SDIO_FUNC_1,
+ addr, 4, nbytes, buf, NULL);
return SDIOH_API_SUCCESS(status) ? 0 : -EIO;
}
-int bcmsdh_abort(void *sdh, uint fn)
+int brcmf_sdcard_abort(void *sdh, uint fn)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
- return sdioh_abort(bcmsdh->sdioh, fn);
+ return brcmf_sdioh_abort(bcmsdh->sdioh, fn);
}
-int bcmsdh_start(void *sdh, int stage)
+int brcmf_sdcard_start(void *sdh, int stage)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
- return sdioh_start(bcmsdh->sdioh, stage);
+ return brcmf_sdioh_start(bcmsdh->sdioh, stage);
}
-int bcmsdh_stop(void *sdh)
+int brcmf_sdcard_stop(void *sdh)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
- return sdioh_stop(bcmsdh->sdioh);
+ return brcmf_sdioh_stop(bcmsdh->sdioh);
}
-int bcmsdh_query_device(void *sdh)
+int brcmf_sdcard_query_device(void *sdh)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
bcmsdh->vendevid = (PCI_VENDOR_ID_BROADCOM << 16) | 0;
return bcmsdh->vendevid;
}
-uint bcmsdh_query_iofnum(void *sdh)
+uint brcmf_sdcard_query_iofnum(void *sdh)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
if (!bcmsdh)
bcmsdh = l_bcmsdh;
- return sdioh_query_iofnum(bcmsdh->sdioh);
+ return brcmf_sdioh_query_iofnum(bcmsdh->sdioh);
}
-int bcmsdh_reset(bcmsdh_info_t *sdh)
+int brcmf_sdcard_reset(bcmsdh_info_t *sdh)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
- return sdioh_sdio_reset(bcmsdh->sdioh);
+ return brcmf_sdioh_reset(bcmsdh->sdioh);
}
-void *bcmsdh_get_sdioh(bcmsdh_info_t *sdh)
+void *brcmf_sdcard_get_sdioh(bcmsdh_info_t *sdh)
{
ASSERT(sdh);
return sdh->sdioh;
}
/* Function to pass device-status bits to DHD. */
-u32 bcmsdh_get_dstatus(void *sdh)
+u32 brcmf_sdcard_get_dstatus(void *sdh)
{
return 0;
}
-u32 bcmsdh_cur_sbwad(void *sdh)
+u32 brcmf_sdcard_cur_sbwad(void *sdh)
{
bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
@@ -622,7 +622,7 @@ u32 bcmsdh_cur_sbwad(void *sdh)
return bcmsdh->sbwad;
}
-void bcmsdh_chipinfo(void *sdh, u32 chip, u32 chiprev)
+void brcmf_sdcard_chipinfo(void *sdh, u32 chip, u32 chiprev)
{
return;
}
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
index 71ef23a..8007e90 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
@@ -33,7 +33,7 @@
#if defined(OOB_INTR_ONLY)
#include <linux/irq.h>
-extern void dhdsdio_isr(void *args);
+extern void brcmf_sdbrcm_isr(void *args);
#endif /* defined(OOB_INTR_ONLY) */
#if defined(CONFIG_MACH_SANDGATE2G) || defined(CONFIG_MACH_LOGICPD_PXA270)
#if !defined(BCMPLATFORM_BUS)
@@ -71,7 +71,7 @@ struct bcmsdh_hc {
};
static bcmsdh_hc_t *sdhcinfo;
-/* driver info, initialized when bcmsdh_register is called */
+/* driver info, initialized when brcmf_sdio_register is called */
static bcmsdh_driver_t drvinfo = { NULL, NULL };
/* debugging macros */
@@ -80,7 +80,7 @@ static bcmsdh_driver_t drvinfo = { NULL, NULL };
/**
* Checks to see if vendor and device IDs match a supported SDIO Host Controller.
*/
-bool bcmsdh_chipmatch(u16 vendor, u16 device)
+bool brcmf_sdio_chipmatch(u16 vendor, u16 device)
{
/* Add other vendors and devices as required */
@@ -125,22 +125,22 @@ bool bcmsdh_chipmatch(u16 vendor, u16 device)
#if defined(BCMPLATFORM_BUS)
#if defined(BCMLXSDMMC)
/* forward declarations */
-int bcmsdh_probe(struct device *dev);
-EXPORT_SYMBOL(bcmsdh_probe);
+int brcmf_sdio_probe(struct device *dev);
+EXPORT_SYMBOL(brcmf_sdio_probe);
-int bcmsdh_remove(struct device *dev);
-EXPORT_SYMBOL(bcmsdh_remove);
+int brcmf_sdio_remove(struct device *dev);
+EXPORT_SYMBOL(brcmf_sdio_remove);
#else
/* forward declarations */
-static int __devinit bcmsdh_probe(struct device *dev);
-static int __devexit bcmsdh_remove(struct device *dev);
+static int __devinit brcmf_sdio_probe(struct device *dev);
+static int __devexit brcmf_sdio_remove(struct device *dev);
#endif /* BCMLXSDMMC */
#ifndef BCMLXSDMMC
static
#endif /* BCMLXSDMMC */
-int bcmsdh_probe(struct device *dev)
+int brcmf_sdio_probe(struct device *dev)
{
bcmsdh_hc_t *sdhc = NULL;
unsigned long regs = 0;
@@ -184,13 +184,13 @@ int bcmsdh_probe(struct device *dev)
sdhc->dev = (void *)dev;
#ifdef BCMLXSDMMC
- sdh = bcmsdh_attach((void *)0, (void **)®s, irq);
+ sdh = brcmf_sdcard_attach((void *)0, (void **)®s, irq);
if (!sdh) {
SDLX_MSG(("%s: bcmsdh_attach failed\n", __func__));
goto err;
}
#else
- sdh = bcmsdh_attach((void *)r->start, (void **)®s, irq);
+ sdh = brcmf_sdcard_attach((void *)r->start, (void **)®s, irq);
if (!sdh) {
SDLX_MSG(("%s: bcmsdh_attach failed\n", __func__));
goto err;
@@ -208,7 +208,7 @@ int bcmsdh_probe(struct device *dev)
sdhc->next = sdhcinfo;
sdhcinfo = sdhc;
/* Read the vendor/device ID from the CIS */
- vendevid = bcmsdh_query_device(sdh);
+ vendevid = brcmf_sdcard_query_device(sdh);
/* try to attach to the target device */
sdhc->ch = drvinfo.attach((vendevid >> 16), (vendevid & 0xFFFF),
@@ -224,7 +224,7 @@ int bcmsdh_probe(struct device *dev)
err:
if (sdhc) {
if (sdhc->sdh)
- bcmsdh_detach(sdhc->sdh);
+ brcmf_sdcard_detach(sdhc->sdh);
kfree(sdhc);
}
@@ -234,13 +234,13 @@ err:
#ifndef BCMLXSDMMC
static
#endif /* BCMLXSDMMC */
-int bcmsdh_remove(struct device *dev)
+int brcmf_sdio_remove(struct device *dev)
{
bcmsdh_hc_t *sdhc, *prev;
sdhc = sdhcinfo;
drvinfo.detach(sdhc->ch);
- bcmsdh_detach(sdhc->sdh);
+ brcmf_sdcard_detach(sdhc->sdh);
/* find the SDIO Host Controller state for this pdev
and take it out from the list */
for (sdhc = sdhcinfo, prev = NULL; sdhc; sdhc = sdhc->next) {
@@ -269,25 +269,25 @@ int bcmsdh_remove(struct device *dev)
}
#endif /* BCMPLATFORM_BUS */
-extern int sdio_function_init(void);
+extern int brcmf_sdio_function_init(void);
-int bcmsdh_register(bcmsdh_driver_t *driver)
+int brcmf_sdio_register(bcmsdh_driver_t *driver)
{
drvinfo = *driver;
SDLX_MSG(("Linux Kernel SDIO/MMC Driver\n"));
- return sdio_function_init();
+ return brcmf_sdio_function_init();
}
-extern void sdio_function_cleanup(void);
+extern void brcmf_sdio_function_cleanup(void);
-void bcmsdh_unregister(void)
+void brcmf_sdio_unregister(void)
{
- sdio_function_cleanup();
+ brcmf_sdio_function_cleanup();
}
#if defined(OOB_INTR_ONLY)
-void bcmsdh_oob_intr_set(bool enable)
+void brcmf_sdio_oob_intr_set(bool enable)
{
static bool curstate = 1;
unsigned long flags;
@@ -303,25 +303,25 @@ void bcmsdh_oob_intr_set(bool enable)
spin_unlock_irqrestore(&sdhcinfo->irq_lock, flags);
}
-static irqreturn_t wlan_oob_irq(int irq, void *dev_id)
+static irqreturn_t brcmf_sdio_oob_irq(int irq, void *dev_id)
{
dhd_pub_t *dhdp;
dhdp = (dhd_pub_t *) dev_get_drvdata(sdhcinfo->dev);
- bcmsdh_oob_intr_set(0);
+ brcmf_sdio_oob_intr_set(0);
if (dhdp == NULL) {
SDLX_MSG(("Out of band GPIO interrupt fired way too early\n"));
return IRQ_HANDLED;
}
- dhdsdio_isr((void *)dhdp->bus);
+ brcmf_sdbrcm_isr((void *)dhdp->bus);
return IRQ_HANDLED;
}
-int bcmsdh_register_oob_intr(void *dhdp)
+int brcmf_sdio_register_oob_intr(void *dhdp)
{
int error = 0;
@@ -338,7 +338,7 @@ int bcmsdh_register_oob_intr(void *dhdp)
/* Refer to customer Host IRQ docs about
proper irqflags definition */
error =
- request_irq(sdhcinfo->oob_irq, wlan_oob_irq,
+ request_irq(sdhcinfo->oob_irq, brcmf_sdio_oob_irq,
sdhcinfo->oob_flags, "bcmsdh_sdmmc", NULL);
if (error)
return -ENODEV;
@@ -350,7 +350,7 @@ int bcmsdh_register_oob_intr(void *dhdp)
return 0;
}
-void bcmsdh_unregister_oob_intr(void)
+void brcmf_sdio_unregister_oob_intr(void)
{
SDLX_MSG(("%s: Enter\n", __func__));
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index b90d7d0..59bdfea 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -32,15 +32,15 @@
#include "dhd.h"
#include "bcmsdh_sdmmc.h"
-extern int sdio_function_init(void);
-extern void sdio_function_cleanup(void);
+extern int brcmf_sdio_function_init(void);
+extern void brcmf_sdio_function_cleanup(void);
#if !defined(OOB_INTR_ONLY)
-static void IRQHandler(struct sdio_func *func);
-static void IRQHandlerF2(struct sdio_func *func);
+static void brcmf_sdioh_irqhandler(struct sdio_func *func);
+static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func);
#endif /* !defined(OOB_INTR_ONLY) */
-static int sdioh_sdmmc_get_cisaddr(sdioh_info_t *sd, u32 regaddr);
-extern int sdio_reset_comm(struct mmc_card *card);
+static int brcmf_sdioh_get_cisaddr(sdioh_info_t *sd, u32 regaddr);
+extern int brcmf_sdioh_reset_comm(struct mmc_card *card);
extern PBCMSDH_SDMMC_INSTANCE gInstance;
@@ -54,17 +54,17 @@ DHD_PM_RESUME_WAIT_INIT(sdioh_request_buffer_wait);
#define DMA_ALIGN_MASK 0x03
-int sdioh_sdmmc_card_regread(sdioh_info_t *sd, int func, u32 regaddr,
+int brcmf_sdioh_card_regread(sdioh_info_t *sd, int func, u32 regaddr,
int regsize, u32 *data);
-void sdioh_sdio_set_host_pm_flags(int flag)
+void brcmf_sdioh_set_host_pm_flags(int flag)
{
if (sdio_set_host_pm_flags(gInstance->func[1], flag))
printk(KERN_ERR "%s: Failed to set pm_flags 0x%08x\n",\
__func__, (unsigned int)flag);
}
-static int sdioh_sdmmc_card_enablefuncs(sdioh_info_t *sd)
+static int brcmf_sdioh_enablefuncs(sdioh_info_t *sd)
{
int err_ret;
u32 fbraddr;
@@ -73,7 +73,7 @@ static int sdioh_sdmmc_card_enablefuncs(sdioh_info_t *sd)
sd_trace(("%s\n", __func__));
/* Get the Card's common CIS address */
- sd->com_cis_ptr = sdioh_sdmmc_get_cisaddr(sd, SDIO_CCCR_CIS);
+ sd->com_cis_ptr = brcmf_sdioh_get_cisaddr(sd, SDIO_CCCR_CIS);
sd->func_cis_ptr[0] = sd->com_cis_ptr;
sd_info(("%s: Card's Common CIS Ptr = 0x%x\n", __func__,
sd->com_cis_ptr));
@@ -82,7 +82,7 @@ static int sdioh_sdmmc_card_enablefuncs(sdioh_info_t *sd)
for (fbraddr = SDIO_FBR_BASE(1), func = 1;
func <= sd->num_funcs; func++, fbraddr += SDIOD_FBR_SIZE) {
sd->func_cis_ptr[func] =
- sdioh_sdmmc_get_cisaddr(sd, SDIO_FBR_CIS + fbraddr);
+ brcmf_sdioh_get_cisaddr(sd, SDIO_FBR_CIS + fbraddr);
sd_info(("%s: Function %d CIS Ptr = 0x%x\n", __func__, func,
sd->func_cis_ptr[func]));
}
@@ -106,7 +106,7 @@ static int sdioh_sdmmc_card_enablefuncs(sdioh_info_t *sd)
/*
* Public entry points & extern's
*/
-sdioh_info_t *sdioh_attach(void *bar0, uint irq)
+sdioh_info_t *brcmf_sdioh_attach(void *bar0, uint irq)
{
sdioh_info_t *sd;
int err_ret;
@@ -123,7 +123,7 @@ sdioh_info_t *sdioh_attach(void *bar0, uint irq)
sd_err(("sdioh_attach: out of memory\n"));
return NULL;
}
- if (sdioh_sdmmc_osinit(sd) != 0) {
+ if (brcmf_sdioh_osinit(sd) != 0) {
sd_err(("%s:sdioh_sdmmc_osinit() failed\n", __func__));
kfree(sd);
return NULL;
@@ -161,13 +161,13 @@ sdioh_info_t *sdioh_attach(void *bar0, uint irq)
sdio_release_host(gInstance->func[2]);
}
- sdioh_sdmmc_card_enablefuncs(sd);
+ brcmf_sdioh_enablefuncs(sd);
sd_trace(("%s: Done\n", __func__));
return sd;
}
-extern SDIOH_API_RC sdioh_detach(sdioh_info_t *sd)
+extern SDIOH_API_RC brcmf_sdioh_detach(sdioh_info_t *sd)
{
sd_trace(("%s\n", __func__));
@@ -184,7 +184,7 @@ extern SDIOH_API_RC sdioh_detach(sdioh_info_t *sd)
sdio_release_host(gInstance->func[1]);
/* deregister irq */
- sdioh_sdmmc_osfree(sd);
+ brcmf_sdioh_osfree(sd);
kfree(sd);
}
@@ -193,7 +193,7 @@ extern SDIOH_API_RC sdioh_detach(sdioh_info_t *sd)
#if defined(OOB_INTR_ONLY) && defined(HW_OOB)
-extern SDIOH_API_RC sdioh_enable_func_intr(void)
+extern SDIOH_API_RC brcmf_sdioh_enable_func_intr(void)
{
u8 reg;
int err;
@@ -227,7 +227,7 @@ extern SDIOH_API_RC sdioh_enable_func_intr(void)
return SDIOH_API_RC_SUCCESS;
}
-extern SDIOH_API_RC sdioh_disable_func_intr(void)
+extern SDIOH_API_RC brcmf_sdioh_disable_func_intr(void)
{
u8 reg;
int err;
@@ -261,7 +261,7 @@ extern SDIOH_API_RC sdioh_disable_func_intr(void)
/* Configure callback to client when we receive client interrupt */
extern SDIOH_API_RC
-sdioh_interrupt_register(sdioh_info_t *sd, sdioh_cb_fn_t fn, void *argh)
+brcmf_sdioh_interrupt_register(sdioh_info_t *sd, sdioh_cb_fn_t fn, void *argh)
{
sd_trace(("%s: Entering\n", __func__));
if (fn == NULL) {
@@ -277,22 +277,22 @@ sdioh_interrupt_register(sdioh_info_t *sd, sdioh_cb_fn_t fn, void *argh)
/* register and unmask irq */
if (gInstance->func[2]) {
sdio_claim_host(gInstance->func[2]);
- sdio_claim_irq(gInstance->func[2], IRQHandlerF2);
+ sdio_claim_irq(gInstance->func[2], brcmf_sdioh_irqhandler_f2);
sdio_release_host(gInstance->func[2]);
}
if (gInstance->func[1]) {
sdio_claim_host(gInstance->func[1]);
- sdio_claim_irq(gInstance->func[1], IRQHandler);
+ sdio_claim_irq(gInstance->func[1], brcmf_sdioh_irqhandler);
sdio_release_host(gInstance->func[1]);
}
#elif defined(HW_OOB)
- sdioh_enable_func_intr();
+ brcmf_sdioh_enable_func_intr();
#endif /* defined(OOB_INTR_ONLY) */
return SDIOH_API_RC_SUCCESS;
}
-extern SDIOH_API_RC sdioh_interrupt_deregister(sdioh_info_t *sd)
+extern SDIOH_API_RC brcmf_sdioh_interrupt_deregister(sdioh_info_t *sd)
{
sd_trace(("%s: Entering\n", __func__));
@@ -316,12 +316,12 @@ extern SDIOH_API_RC sdioh_interrupt_deregister(sdioh_info_t *sd)
sd->intr_handler = NULL;
sd->intr_handler_arg = NULL;
#elif defined(HW_OOB)
- sdioh_disable_func_intr();
+ brcmf_sdioh_disable_func_intr();
#endif /* !defined(OOB_INTR_ONLY) */
return SDIOH_API_RC_SUCCESS;
}
-extern SDIOH_API_RC sdioh_interrupt_query(sdioh_info_t *sd, bool *onoff)
+extern SDIOH_API_RC brcmf_sdioh_interrupt_query(sdioh_info_t *sd, bool *onoff)
{
sd_trace(("%s: Entering\n", __func__));
*onoff = sd->client_intr_enabled;
@@ -329,13 +329,13 @@ extern SDIOH_API_RC sdioh_interrupt_query(sdioh_info_t *sd, bool *onoff)
}
#if defined(DHD_DEBUG)
-extern bool sdioh_interrupt_pending(sdioh_info_t *sd)
+extern bool brcmf_sdioh_interrupt_pending(sdioh_info_t *sd)
{
return 0;
}
#endif
-uint sdioh_query_iofnum(sdioh_info_t *sd)
+uint brcmf_sdioh_query_iofnum(sdioh_info_t *sd)
{
return sd->num_funcs;
}
@@ -365,8 +365,8 @@ const struct brcmu_iovar sdioh_iovars[] = {
};
int
-sdioh_iovar_op(sdioh_info_t *si, const char *name,
- void *params, int plen, void *arg, int len, bool set)
+brcmf_sdioh_iovar_op(sdioh_info_t *si, const char *name,
+ void *params, int plen, void *arg, int len, bool set)
{
const struct brcmu_iovar *vi = NULL;
int bcmerror = 0;
@@ -499,7 +499,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
sdreg_t *sd_ptr = (sdreg_t *) params;
u8 data = 0;
- if (sdioh_cfg_read
+ if (brcmf_sdioh_cfg_read
(si, sd_ptr->func, sd_ptr->offset, &data)) {
bcmerror = -EIO;
break;
@@ -515,7 +515,7 @@ sdioh_iovar_op(sdioh_info_t *si, const char *name,
sdreg_t *sd_ptr = (sdreg_t *) params;
u8 data = (u8) sd_ptr->value;
- if (sdioh_cfg_write
+ if (brcmf_sdioh_cfg_write
(si, sd_ptr->func, sd_ptr->offset, &data)) {
bcmerror = -EIO;
break;
@@ -534,7 +534,7 @@ exit:
#if defined(OOB_INTR_ONLY) && defined(HW_OOB)
-SDIOH_API_RC sdioh_enable_hw_oob_intr(sdioh_info_t *sd, bool enable)
+SDIOH_API_RC brcmf_sdioh_enable_hw_oob_intr(sdioh_info_t *sd, bool enable)
{
SDIOH_API_RC status;
u8 data;
@@ -545,37 +545,37 @@ SDIOH_API_RC sdioh_enable_hw_oob_intr(sdioh_info_t *sd, bool enable)
data = 4; /* disable hw oob interrupt */
data |= 4; /* Active HIGH */
- status = sdioh_request_byte(sd, SDIOH_WRITE, 0, 0xf2, &data);
+ status = brcmf_sdioh_request_byte(sd, SDIOH_WRITE, 0, 0xf2, &data);
return status;
}
#endif /* defined(OOB_INTR_ONLY) && defined(HW_OOB) */
extern SDIOH_API_RC
-sdioh_cfg_read(sdioh_info_t *sd, uint fnc_num, u32 addr, u8 *data)
+brcmf_sdioh_cfg_read(sdioh_info_t *sd, uint fnc_num, u32 addr, u8 *data)
{
SDIOH_API_RC status;
- /* No lock needed since sdioh_request_byte does locking */
- status = sdioh_request_byte(sd, SDIOH_READ, fnc_num, addr, data);
+ /* No lock needed since brcmf_sdioh_request_byte does locking */
+ status = brcmf_sdioh_request_byte(sd, SDIOH_READ, fnc_num, addr, data);
return status;
}
extern SDIOH_API_RC
-sdioh_cfg_write(sdioh_info_t *sd, uint fnc_num, u32 addr, u8 *data)
+brcmf_sdioh_cfg_write(sdioh_info_t *sd, uint fnc_num, u32 addr, u8 *data)
{
- /* No lock needed since sdioh_request_byte does locking */
+ /* No lock needed since brcmf_sdioh_request_byte does locking */
SDIOH_API_RC status;
- status = sdioh_request_byte(sd, SDIOH_WRITE, fnc_num, addr, data);
+ status = brcmf_sdioh_request_byte(sd, SDIOH_WRITE, fnc_num, addr, data);
return status;
}
-static int sdioh_sdmmc_get_cisaddr(sdioh_info_t *sd, u32 regaddr)
+static int brcmf_sdioh_get_cisaddr(sdioh_info_t *sd, u32 regaddr)
{
/* read 24 bits and return valid 17 bit addr */
int i;
u32 scratch, regdata;
u8 *ptr = (u8 *)&scratch;
for (i = 0; i < 3; i++) {
- if ((sdioh_sdmmc_card_regread(sd, 0, regaddr, 1, ®data)) !=
+ if ((brcmf_sdioh_card_regread(sd, 0, regaddr, 1, ®data)) !=
SUCCESS)
sd_err(("%s: Can't read!\n", __func__));
@@ -590,7 +590,7 @@ static int sdioh_sdmmc_get_cisaddr(sdioh_info_t *sd, u32 regaddr)
}
extern SDIOH_API_RC
-sdioh_cis_read(sdioh_info_t *sd, uint func, u8 *cisd, u32 length)
+brcmf_sdioh_cis_read(sdioh_info_t *sd, uint func, u8 *cisd, u32 length)
{
u32 count;
int offset;
@@ -610,7 +610,7 @@ sdioh_cis_read(sdioh_info_t *sd, uint func, u8 *cisd, u32 length)
for (count = 0; count < length; count++) {
offset = sd->func_cis_ptr[func] + count;
- if (sdioh_sdmmc_card_regread(sd, 0, offset, 1, &foo) < 0) {
+ if (brcmf_sdioh_card_regread(sd, 0, offset, 1, &foo) < 0) {
sd_err(("%s: regread failed: Can't read CIS\n",
__func__));
return SDIOH_API_RC_FAIL;
@@ -624,7 +624,7 @@ sdioh_cis_read(sdioh_info_t *sd, uint func, u8 *cisd, u32 length)
}
extern SDIOH_API_RC
-sdioh_request_byte(sdioh_info_t *sd, uint rw, uint func, uint regaddr,
+brcmf_sdioh_request_byte(sdioh_info_t *sd, uint rw, uint func, uint regaddr,
u8 *byte)
{
int err_ret;
@@ -723,7 +723,7 @@ sdioh_request_byte(sdioh_info_t *sd, uint rw, uint func, uint regaddr,
}
extern SDIOH_API_RC
-sdioh_request_word(sdioh_info_t *sd, uint cmd_type, uint rw, uint func,
+brcmf_sdioh_request_word(sdioh_info_t *sd, uint cmd_type, uint rw, uint func,
uint addr, u32 *word, uint nbytes)
{
int err_ret = SDIOH_API_RC_FAIL;
@@ -776,8 +776,8 @@ sdioh_request_word(sdioh_info_t *sd, uint cmd_type, uint rw, uint func,
}
static SDIOH_API_RC
-sdioh_request_packet(sdioh_info_t *sd, uint fix_inc, uint write, uint func,
- uint addr, struct sk_buff *pkt)
+brcmf_sdioh_request_packet(sdioh_info_t *sd, uint fix_inc, uint write,
+ uint func, uint addr, struct sk_buff *pkt)
{
bool fifo = (fix_inc == SDIOH_DATA_FIX);
u32 SGCount = 0;
@@ -807,7 +807,7 @@ sdioh_request_packet(sdioh_info_t *sd, uint fix_inc, uint write, uint func,
#endif /* CONFIG_MMC_MSM7X00A */
/* Make sure the packet is aligned properly.
* If it isn't, then this
- * is the fault of sdioh_request_buffer() which
+ * is the fault of brcmf_sdioh_request_buffer() which
* is supposed to give
* us something we can work with.
*/
@@ -872,9 +872,9 @@ sdioh_request_packet(sdioh_info_t *sd, uint fix_inc, uint write, uint func,
*
*/
extern SDIOH_API_RC
-sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,
- uint func, uint addr, uint reg_width, uint buflen_u,
- u8 *buffer, struct sk_buff *pkt)
+brcmf_sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc,
+ uint write, uint func, uint addr, uint reg_width,
+ uint buflen_u, u8 *buffer, struct sk_buff *pkt)
{
SDIOH_API_RC Status;
struct sk_buff *mypkt = NULL;
@@ -898,8 +898,8 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,
if (write)
memcpy(mypkt->data, buffer, buflen_u);
- Status =
- sdioh_request_packet(sd, fix_inc, write, func, addr, mypkt);
+ Status = brcmf_sdioh_request_packet(sd, fix_inc, write, func,
+ addr, mypkt);
/* For a read, copy the packet data back to the buffer. */
if (!write)
@@ -925,8 +925,8 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,
if (write)
memcpy(mypkt->data, pkt->data, pkt->len);
- Status =
- sdioh_request_packet(sd, fix_inc, write, func, addr, mypkt);
+ Status = brcmf_sdioh_request_packet(sd, fix_inc, write, func,
+ addr, mypkt);
/* For a read, copy the packet data back to the buffer. */
if (!write)
@@ -937,15 +937,15 @@ sdioh_request_buffer(sdioh_info_t *sd, uint pio_dma, uint fix_inc, uint write,
it is aligned. */
sd_data(("%s: Aligned %s Packet, direct DMA\n",
__func__, write ? "Tx" : "Rx"));
- Status =
- sdioh_request_packet(sd, fix_inc, write, func, addr, pkt);
+ Status = brcmf_sdioh_request_packet(sd, fix_inc, write, func,
+ addr, pkt);
}
return Status;
}
/* this function performs "abort" for both of host & device */
-extern int sdioh_abort(sdioh_info_t *sd, uint func)
+extern int brcmf_sdioh_abort(sdioh_info_t *sd, uint func)
{
#if defined(MMC_SDIO_ABORT)
char t_func = (char)func;
@@ -954,7 +954,7 @@ extern int sdioh_abort(sdioh_info_t *sd, uint func)
#if defined(MMC_SDIO_ABORT)
/* issue abort cmd52 command through F0 */
- sdioh_request_byte(sd, SDIOH_WRITE, SDIO_FUNC_0, SDIO_CCCR_ABORT,
+ brcmf_sdioh_request_byte(sd, SDIOH_WRITE, SDIO_FUNC_0, SDIO_CCCR_ABORT,
&t_func);
#endif /* defined(MMC_SDIO_ABORT) */
@@ -963,7 +963,7 @@ extern int sdioh_abort(sdioh_info_t *sd, uint func)
}
/* Reset and re-initialize the device */
-int sdioh_sdio_reset(sdioh_info_t *si)
+int brcmf_sdioh_reset(sdioh_info_t *si)
{
sd_trace(("%s: Enter\n", __func__));
sd_trace(("%s: Exit\n", __func__));
@@ -971,14 +971,14 @@ int sdioh_sdio_reset(sdioh_info_t *si)
}
/* Disable device interrupt */
-void sdioh_sdmmc_devintr_off(sdioh_info_t *sd)
+void brcmf_sdioh_dev_intr_off(sdioh_info_t *sd)
{
sd_trace(("%s: %d\n", __func__, sd->use_client_ints));
sd->intmask &= ~CLIENT_INTR;
}
/* Enable device interrupt */
-void sdioh_sdmmc_devintr_on(sdioh_info_t *sd)
+void brcmf_sdioh_dev_intr_on(sdioh_info_t *sd)
{
sd_trace(("%s: %d\n", __func__, sd->use_client_ints));
sd->intmask |= CLIENT_INTR;
@@ -986,19 +986,19 @@ void sdioh_sdmmc_devintr_on(sdioh_info_t *sd)
/* Read client card reg */
int
-sdioh_sdmmc_card_regread(sdioh_info_t *sd, int func, u32 regaddr,
+brcmf_sdioh_card_regread(sdioh_info_t *sd, int func, u32 regaddr,
int regsize, u32 *data)
{
if ((func == 0) || (regsize == 1)) {
u8 temp = 0;
- sdioh_request_byte(sd, SDIOH_READ, func, regaddr, &temp);
+ brcmf_sdioh_request_byte(sd, SDIOH_READ, func, regaddr, &temp);
*data = temp;
*data &= 0xff;
sd_data(("%s: byte read data=0x%02x\n", __func__, *data));
} else {
- sdioh_request_word(sd, 0, SDIOH_READ, func, regaddr, data,
+ brcmf_sdioh_request_word(sd, 0, SDIOH_READ, func, regaddr, data,
regsize);
if (regsize == 2)
*data &= 0xffff;
@@ -1011,7 +1011,7 @@ sdioh_sdmmc_card_regread(sdioh_info_t *sd, int func, u32 regaddr,
#if !defined(OOB_INTR_ONLY)
/* bcmsdh_sdmmc interrupt handler */
-static void IRQHandler(struct sdio_func *func)
+static void brcmf_sdioh_irqhandler(struct sdio_func *func)
{
sdioh_info_t *sd;
@@ -1037,7 +1037,7 @@ static void IRQHandler(struct sdio_func *func)
}
/* bcmsdh_sdmmc interrupt handler for F2 (dummy handler) */
-static void IRQHandlerF2(struct sdio_func *func)
+static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func)
{
sdioh_info_t *sd;
@@ -1052,7 +1052,7 @@ static void IRQHandlerF2(struct sdio_func *func)
#ifdef NOTUSED
/* Write client card reg */
static int
-sdioh_sdmmc_card_regwrite(sdioh_info_t *sd, int func, u32 regaddr,
+brcmf_sdioh_card_regwrite(sdioh_info_t *sd, int func, u32 regaddr,
int regsize, u32 data)
{
@@ -1060,14 +1060,14 @@ sdioh_sdmmc_card_regwrite(sdioh_info_t *sd, int func, u32 regaddr,
u8 temp;
temp = data & 0xff;
- sdioh_request_byte(sd, SDIOH_READ, func, regaddr, &temp);
+ brcmf_sdioh_request_byte(sd, SDIOH_READ, func, regaddr, &temp);
sd_data(("%s: byte write data=0x%02x\n", __func__, data));
} else {
if (regsize == 2)
data &= 0xffff;
- sdioh_request_word(sd, 0, SDIOH_READ, func, regaddr, &data,
- regsize);
+ brcmf_sdioh_request_word(sd, 0, SDIOH_READ, func, regaddr,
+ &data, regsize);
sd_data(("%s: word write data=0x%08x\n", __func__, data));
}
@@ -1076,12 +1076,12 @@ sdioh_sdmmc_card_regwrite(sdioh_info_t *sd, int func, u32 regaddr,
}
#endif /* NOTUSED */
-int sdioh_start(sdioh_info_t *si, int stage)
+int brcmf_sdioh_start(sdioh_info_t *si, int stage)
{
return 0;
}
-int sdioh_stop(sdioh_info_t *si)
+int brcmf_sdioh_stop(sdioh_info_t *si)
{
return 0;
}
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
index ff5e09d..c7863b1 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
@@ -14,6 +14,10 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
+/*
+ * BCMSDH Function Driver for the native SDIO/MMC driver in the Linux Kernel
+ */
+
#ifndef __BCMSDH_SDMMC_H__
#define __BCMSDH_SDMMC_H__
@@ -58,8 +62,8 @@
#endif
/* Allocate/init/free per-OS private data */
-extern int sdioh_sdmmc_osinit(sdioh_info_t *sd);
-extern void sdioh_sdmmc_osfree(sdioh_info_t *sd);
+extern int brcmf_sdioh_osinit(sdioh_info_t *sd);
+extern void brcmf_sdioh_osfree(sdioh_info_t *sd);
#define BLOCK_SIZE_64 64
#define BLOCK_SIZE_512 512
@@ -105,23 +109,23 @@ struct sdioh_info {
extern uint sd_msglevel;
/* OS-independent interrupt handler */
-extern bool check_client_intr(sdioh_info_t *sd);
+extern bool brcmf_sdioh_check_client_intr(sdioh_info_t *sd);
/* Core interrupt enable/disable of device interrupts */
-extern void sdioh_sdmmc_devintr_on(sdioh_info_t *sd);
-extern void sdioh_sdmmc_devintr_off(sdioh_info_t *sd);
+extern void brcmf_sdioh_dev_intr_on(sdioh_info_t *sd);
+extern void brcmf_sdioh_dev_intr_off(sdioh_info_t *sd);
/**************************************************************
* Internal interfaces: bcmsdh_sdmmc.c references to per-port code
*/
/* Register mapping routines */
-extern u32 *sdioh_sdmmc_reg_map(s32 addr, int size);
-extern void sdioh_sdmmc_reg_unmap(s32 addr, int size);
+extern u32 *brcmf_sdioh_reg_map(s32 addr, int size);
+extern void brcmf_sdioh_reg_unmap(s32 addr, int size);
/* Interrupt (de)registration routines */
-extern int sdioh_sdmmc_register_irq(sdioh_info_t *sd, uint irq);
-extern void sdioh_sdmmc_free_irq(uint irq, sdioh_info_t *sd);
+extern int brcmf_sdioh_register_irq(sdioh_info_t *sd, uint irq);
+extern void brcmf_sdioh_free_irq(uint irq, sdioh_info_t *sd);
typedef struct _BCMSDH_SDMMC_INSTANCE {
sdioh_info_t *sd;
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
index 5f17b8f..8f13988 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
@@ -55,11 +55,11 @@
#include "dhd_dbg.h"
#include "wl_cfg80211.h"
-extern void sdioh_sdmmc_devintr_off(sdioh_info_t *sd);
-extern void sdioh_sdmmc_devintr_on(sdioh_info_t *sd);
+extern void brcmf_sdioh_dev_intr_off(sdioh_info_t *sd);
+extern void brcmf_sdioh_dev_intr_on(sdioh_info_t *sd);
-int sdio_function_init(void);
-void sdio_function_cleanup(void);
+int brcmf_sdio_function_init(void);
+void brcmf_sdio_function_cleanup(void);
/* module param defaults */
static int clockoverride;
@@ -72,11 +72,11 @@ PBCMSDH_SDMMC_INSTANCE gInstance;
/* Maximum number of bcmsdh_sdmmc devices supported by driver */
#define BCMSDH_SDMMC_MAX_DEVICES 1
-extern int bcmsdh_probe(struct device *dev);
-extern int bcmsdh_remove(struct device *dev);
+extern int brcmf_sdio_probe(struct device *dev);
+extern int brcmf_sdio_remove(struct device *dev);
struct device sdmmc_dev;
-static int bcmsdh_sdmmc_probe(struct sdio_func *func,
+static int brcmf_ops_sdio_probe(struct sdio_func *func,
const struct sdio_device_id *id)
{
int ret = 0;
@@ -93,8 +93,8 @@ static int bcmsdh_sdmmc_probe(struct sdio_func *func,
gInstance->func[0] = &sdio_func_0;
if (func->device == 0x4) { /* 4318 */
gInstance->func[2] = NULL;
- sd_trace(("NIC found, calling bcmsdh_probe...\n"));
- ret = bcmsdh_probe(&sdmmc_dev);
+ sd_trace(("NIC found, calling brcmf_sdio_probe...\n"));
+ ret = brcmf_sdio_probe(&sdmmc_dev);
}
}
@@ -102,24 +102,24 @@ static int bcmsdh_sdmmc_probe(struct sdio_func *func,
if (func->num == 2) {
wl_cfg80211_sdio_func(func);
- sd_trace(("F2 found, calling bcmsdh_probe...\n"));
- ret = bcmsdh_probe(&sdmmc_dev);
+ sd_trace(("F2 found, calling brcmf_sdio_probe...\n"));
+ ret = brcmf_sdio_probe(&sdmmc_dev);
}
return ret;
}
-static void bcmsdh_sdmmc_remove(struct sdio_func *func)
+static void brcmf_ops_sdio_remove(struct sdio_func *func)
{
- sd_trace(("bcmsdh_sdmmc: %s Enter\n", __func__));
- sd_info(("sdio_bcmsdh: func->class=%x\n", func->class));
+ sd_trace(("%s Enter\n", __func__));
+ sd_info(("func->class=%x\n", func->class));
sd_info(("sdio_vendor: 0x%04x\n", func->vendor));
sd_info(("sdio_device: 0x%04x\n", func->device));
sd_info(("Function#: 0x%04x\n", func->num));
if (func->num == 2) {
- sd_trace(("F2 found, calling bcmsdh_remove...\n"));
- bcmsdh_remove(&sdmmc_dev);
+ sd_trace(("F2 found, calling brcmf_sdio_remove...\n"));
+ brcmf_sdio_remove(&sdmmc_dev);
}
}
@@ -137,8 +137,8 @@ static const struct sdio_device_id bcmsdh_sdmmc_ids[] = {
MODULE_DEVICE_TABLE(sdio, bcmsdh_sdmmc_ids);
static struct sdio_driver bcmsdh_sdmmc_driver = {
- .probe = bcmsdh_sdmmc_probe,
- .remove = bcmsdh_sdmmc_remove,
+ .probe = brcmf_ops_sdio_probe,
+ .remove = brcmf_ops_sdio_remove,
.name = "brcmfmac",
.id_table = bcmsdh_sdmmc_ids,
};
@@ -148,7 +148,7 @@ struct sdos_info {
spinlock_t lock;
};
-int sdioh_sdmmc_osinit(sdioh_info_t *sd)
+int brcmf_sdioh_osinit(sdioh_info_t *sd)
{
struct sdos_info *sdos;
@@ -162,7 +162,7 @@ int sdioh_sdmmc_osinit(sdioh_info_t *sd)
return 0;
}
-void sdioh_sdmmc_osfree(sdioh_info_t *sd)
+void brcmf_sdioh_osfree(sdioh_info_t *sd)
{
struct sdos_info *sdos;
ASSERT(sd && sd->sdos_info);
@@ -172,7 +172,7 @@ void sdioh_sdmmc_osfree(sdioh_info_t *sd)
}
/* Interrupt enable/disable */
-SDIOH_API_RC sdioh_interrupt_set(sdioh_info_t *sd, bool enable)
+SDIOH_API_RC brcmf_sdioh_interrupt_set(sdioh_info_t *sd, bool enable)
{
unsigned long flags;
struct sdos_info *sdos;
@@ -195,9 +195,9 @@ SDIOH_API_RC sdioh_interrupt_set(sdioh_info_t *sd, bool enable)
sd->client_intr_enabled = enable;
if (enable)
- sdioh_sdmmc_devintr_on(sd);
+ brcmf_sdioh_dev_intr_on(sd);
else
- sdioh_sdmmc_devintr_off(sd);
+ brcmf_sdioh_dev_intr_off(sd);
spin_unlock_irqrestore(&sdos->lock, flags);
@@ -207,7 +207,7 @@ SDIOH_API_RC sdioh_interrupt_set(sdioh_info_t *sd, bool enable)
/*
* module init
*/
-int sdio_function_init(void)
+int brcmf_sdio_function_init(void)
{
int error = 0;
sd_trace(("bcmsdh_sdmmc: %s Enter\n", __func__));
@@ -225,8 +225,8 @@ int sdio_function_init(void)
/*
* module cleanup
*/
-extern int bcmsdh_remove(struct device *dev);
-void sdio_function_cleanup(void)
+extern int brcmf_sdio_remove(struct device *dev);
+void brcmf_sdio_function_cleanup(void)
{
sd_trace(("%s Enter\n", __func__));
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
index b1bb04f..128a00d 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
@@ -30,26 +30,30 @@ extern bool dhd_bus_download_firmware(struct dhd_bus *bus,
char *fw_path, char *nv_path);
/* Stop bus module: clear pending frames, disable data flow */
-extern void dhd_bus_stop(struct dhd_bus *bus, bool enforce_mutex);
+extern void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex);
/* Initialize bus module: prepare for communication w/dongle */
-extern int dhd_bus_init(dhd_pub_t *dhdp, bool enforce_mutex);
+extern int brcmf_sdbrcm_bus_init(dhd_pub_t *dhdp, bool enforce_mutex);
/* Send a data frame to the dongle. Callee disposes of txp. */
-extern int dhd_bus_txdata(struct dhd_bus *bus, struct sk_buff *txp);
+extern int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *txp);
/* Send/receive a control message to/from the dongle.
* Expects caller to enforce a single outstanding transaction.
*/
-extern int dhd_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
-extern int dhd_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
+extern int
+brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
+
+extern int
+brcmf_sdbrcm_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
/* Watchdog timer function */
-extern bool dhd_bus_watchdog(dhd_pub_t *dhd);
+extern bool brcmf_sdbrcm_bus_watchdog(dhd_pub_t *dhd);
#ifdef DHD_DEBUG
/* Device console input function */
-extern int dhd_bus_console_in(dhd_pub_t *dhd, unsigned char *msg, uint msglen);
+extern int
+brcmf_sdbrcm_bus_console_in(dhd_pub_t *dhd, unsigned char *msg, uint msglen);
#endif /* DHD_DEBUG */
/* Deferred processing for the bus, return true requests reschedule */
@@ -58,12 +62,12 @@ extern void dhd_bus_isr(bool *InterruptRecognized,
bool *QueueMiniportHandleInterrupt, void *arg);
/* Check for and handle local prot-specific iovar commands */
-extern int dhd_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
+extern int brcmf_sdbrcm_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
void *params, int plen, void *arg, int len,
bool set);
/* Add bus dump output to a buffer */
-extern void dhd_bus_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf);
+extern void brcmf_sdbrcm_bus_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf);
/* Clear any bus counters */
extern void dhd_bus_clearcounts(dhd_pub_t *dhdp);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index bf3fe99..c77c86c 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -129,7 +129,8 @@ static int dhdcdc_msg(dhd_pub_t *dhd)
len = CDC_MAX_MSG_SIZE;
/* Send request */
- return dhd_bus_txctl(dhd->bus, (unsigned char *)&prot->msg, len);
+ return brcmf_sdbrcm_bus_txctl(dhd->bus, (unsigned char *)&prot->msg,
+ len);
}
static int dhdcdc_cmplt(dhd_pub_t *dhd, u32 id, u32 len)
@@ -140,9 +141,9 @@ static int dhdcdc_cmplt(dhd_pub_t *dhd, u32 id, u32 len)
DHD_TRACE(("%s: Enter\n", __func__));
do {
- ret =
- dhd_bus_rxctl(dhd->bus, (unsigned char *)&prot->msg,
- len + sizeof(struct cdc_ioctl));
+ ret = brcmf_sdbrcm_bus_rxctl(dhd->bus,
+ (unsigned char *)&prot->msg,
+ len + sizeof(struct cdc_ioctl));
if (ret < 0)
break;
} while (CDC_IOC_ID(le32_to_cpu(prot->msg.flags)) != id);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 0a5a1a4..34bd5e9 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -210,7 +210,7 @@ static int dhd_dump(dhd_pub_t *dhdp, char *buf, int buflen)
brcmu_bprintf(strbuf, "\n");
/* Add any bus info */
- dhd_bus_dump(dhdp, strbuf);
+ brcmf_sdbrcm_bus_dump(dhdp, strbuf);
return !strbuf->size ? -EOVERFLOW : 0;
}
@@ -287,7 +287,8 @@ dhd_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
case IOV_SVAL(IOV_CONS):
if (len > 0)
- bcmerror = dhd_bus_console_in(dhd_pub, arg, len - 1);
+ bcmerror = brcmf_sdbrcm_bus_console_in(dhd_pub, arg,
+ len - 1);
break;
#endif
@@ -504,13 +505,13 @@ int dhd_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf, uint buflen)
/* if still not found, try bus module */
if (ioc->cmd == DHD_GET_VAR)
- bcmerror = dhd_bus_iovar_op(dhd_pub, buf,
- arg, arglen, buf,
- buflen, IOV_GET);
+ bcmerror = brcmf_sdbrcm_bus_iovar_op(dhd_pub,
+ buf, arg, arglen, buf, buflen,
+ IOV_GET);
else
- bcmerror = dhd_bus_iovar_op(dhd_pub, buf,
- NULL, 0, arg,
- arglen, IOV_SET);
+ bcmerror = brcmf_sdbrcm_bus_iovar_op(dhd_pub,
+ buf, NULL, 0, arg, arglen,
+ IOV_SET);
break;
}
@@ -1168,7 +1169,8 @@ void dhd_arp_offload_set(dhd_pub_t *dhd, int arp_mode)
int retcode;
brcmu_mkiovar("arp_ol", (char *)&arp_mode, 4, iovbuf, sizeof(iovbuf));
- retcode = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
+ retcode = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
+ sizeof(iovbuf));
retcode = retcode >= 0 ? 0 : retcode;
if (retcode)
DHD_TRACE(("%s: failed to set ARP offload mode to 0x%x, "
@@ -1184,7 +1186,8 @@ void dhd_arp_offload_enable(dhd_pub_t *dhd, int arp_enable)
int retcode;
brcmu_mkiovar("arpoe", (char *)&arp_enable, 4, iovbuf, sizeof(iovbuf));
- retcode = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf, sizeof(iovbuf));
+ retcode = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, iovbuf,
+ sizeof(iovbuf));
retcode = retcode >= 0 ? 0 : retcode;
if (retcode)
DHD_TRACE(("%s: failed to enabe ARP offload to %d, "
@@ -1224,7 +1227,8 @@ int dhd_preinit_ioctls(dhd_pub_t *dhd)
if (!ret) {
brcmu_mkiovar("cur_etheraddr", (void *)ea_addr, ETH_ALEN,
buf, sizeof(buf));
- ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, buf, sizeof(buf));
+ ret = dhdcdc_set_ioctl(dhd, 0, WLC_SET_VAR, buf,
+ sizeof(buf));
if (ret < 0) {
DHD_ERROR(("%s: can't set MAC address , error=%d\n",
__func__, ret));
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 48859cd..f80295e 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -175,7 +175,7 @@ DECLARE_WAIT_QUEUE_HEAD(dhd_dpc_wait);
#endif /* defined(CONFIG_PM_SLEEP) */
#if defined(OOB_INTR_ONLY)
-extern void dhd_enable_oob_intr(struct dhd_bus *bus, bool enable);
+extern void brcmf_sdbrcm_enable_oob_intr(struct dhd_bus *bus, bool enable);
#endif /* defined(OOB_INTR_ONLY) */
MODULE_AUTHOR("Broadcom Corporation");
@@ -995,7 +995,7 @@ int dhd_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf)
#ifdef BCMDBUS
ret = dbus_send_pkt(dhdp->dbus, pktbuf, NULL /* pktinfo */);
#else
- ret = dhd_bus_txdata(dhdp->bus, pktbuf);
+ ret = brcmf_sdbrcm_bus_txdata(dhdp->bus, pktbuf);
#endif /* BCMDBUS */
return ret;
@@ -1264,7 +1264,7 @@ static int dhd_watchdog_thread(void *data)
if (down_interruptible(&dhd->watchdog_sem) == 0) {
if (dhd->pub.dongle_reset == false) {
/* Call the bus module watchdog */
- dhd_bus_watchdog(&dhd->pub);
+ brcmf_sdbrcm_bus_watchdog(&dhd->pub);
}
/* Count the tick for reference */
dhd->pub.tickcnt++;
@@ -1290,7 +1290,7 @@ static void dhd_watchdog(unsigned long data)
}
/* Call the bus module watchdog */
- dhd_bus_watchdog(&dhd->pub);
+ brcmf_sdbrcm_bus_watchdog(&dhd->pub);
/* Count the tick for reference */
dhd->pub.tickcnt++;
@@ -1330,7 +1330,7 @@ static int dhd_dpc_thread(void *data)
up(&dhd->dpc_sem);
}
} else {
- dhd_bus_stop(dhd->pub.bus, true);
+ brcmf_sdbrcm_bus_stop(dhd->pub.bus, true);
}
} else
break;
@@ -1349,7 +1349,7 @@ static void dhd_dpc(unsigned long data)
if (dhd_bus_dpc(dhd->pub.bus))
tasklet_schedule(&dhd->tasklet);
} else {
- dhd_bus_stop(dhd->pub.bus, true);
+ brcmf_sdbrcm_bus_stop(dhd->pub.bus, true);
}
}
@@ -1990,7 +1990,7 @@ int dhd_bus_start(dhd_pub_t *dhdp)
if (dhd->pub.busstate == DHD_BUS_DOWN) {
if (!(dhd_bus_download_firmware(dhd->pub.bus,
fw_path, nv_path))) {
- DHD_ERROR(("%s: dhdsdio_probe_download failed. "
+ DHD_ERROR(("%s: dhd_bus_download_firmware failed. "
"firmware = %s nvram = %s\n",
__func__, fw_path, nv_path));
return -1;
@@ -2002,14 +2002,15 @@ int dhd_bus_start(dhd_pub_t *dhdp)
dhd_os_wd_timer(&dhd->pub, dhd_watchdog_ms);
/* Bring up the bus */
- ret = dhd_bus_init(&dhd->pub, true);
+ ret = brcmf_sdbrcm_bus_init(&dhd->pub, true);
if (ret != 0) {
- DHD_ERROR(("%s, dhd_bus_init failed %d\n", __func__, ret));
+ DHD_ERROR(("%s, brcmf_sdbrcm_bus_init failed %d\n", __func__,
+ ret));
return ret;
}
#if defined(OOB_INTR_ONLY)
/* Host registration for OOB interrupt */
- if (bcmsdh_register_oob_intr(dhdp)) {
+ if (brcmf_sdio_register_oob_intr(dhdp)) {
del_timer_sync(&dhd->timer);
dhd->wd_timer_valid = false;
DHD_ERROR(("%s Host failed to resgister for OOB\n", __func__));
@@ -2017,7 +2018,7 @@ int dhd_bus_start(dhd_pub_t *dhdp)
}
/* Enable oob at firmware */
- dhd_enable_oob_intr(dhd->pub.bus, true);
+ brcmf_sdbrcm_enable_oob_intr(dhd->pub.bus, true);
#endif /* defined(OOB_INTR_ONLY) */
/* If bus is not ready, can't come up */
@@ -2173,9 +2174,9 @@ void dhd_bus_detach(dhd_pub_t *dhdp)
dhd_prot_stop(&dhd->pub);
/* Stop the bus module */
- dhd_bus_stop(dhd->pub.bus, true);
+ brcmf_sdbrcm_bus_stop(dhd->pub.bus, true);
#if defined(OOB_INTR_ONLY)
- bcmsdh_unregister_oob_intr();
+ brcmf_sdio_unregister_oob_intr();
#endif /* defined(OOB_INTR_ONLY) */
/* Clear the watchdog timer */
@@ -2305,7 +2306,7 @@ static int __init dhd_module_init(void)
error = dhd_bus_register();
if (error) {
- DHD_ERROR(("%s: sdio_register_driver failed\n", __func__));
+ DHD_ERROR(("%s: dhd_bus_register failed\n", __func__));
goto failed;
}
return error;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 7e4dfde..e253cb5 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -33,13 +33,13 @@
#ifndef __BIG_ENDIAN
#ifndef __mips__
#define R_REG(r) \
- bcmsdh_reg_read(NULL, (unsigned long)(r), sizeof(*(r)))
+ brcmf_sdcard_reg_read(NULL, (unsigned long)(r), sizeof(*(r)))
#else /* __mips__ */
#define R_REG(r) \
({ \
__typeof(*(r)) __osl_v; \
__asm__ __volatile__("sync"); \
- __osl_v = bcmsdh_reg_read(NULL, (unsigned long)(r),\
+ __osl_v = brcmf_sdcard_reg_read(NULL, (unsigned long)(r),\
sizeof(*(r))); \
__asm__ __volatile__("sync"); \
__osl_v; \
@@ -47,13 +47,15 @@
#endif /* __mips__ */
#define W_REG(r, v) do { \
- bcmsdh_reg_write(NULL, (unsigned long)(r), sizeof(*(r)), (v)); \
+ brcmf_sdcard_reg_write(NULL, (unsigned long)(r), sizeof(*(r)), \
+ (v)); \
} while (0)
#else /* __BIG_ENDIAN */
#define R_REG(r) \
- bcmsdh_reg_read(NULL, (unsigned long)(r), sizeof(*(r)))
+ brcmf_sdcard_reg_read(NULL, (unsigned long)(r), sizeof(*(r)))
#define W_REG(r, v) do { \
- bcmsdh_reg_write(NULL, (unsigned long)(r), sizeof(*(r)), (v)); \
+ brcmf_sdcard_reg_write(NULL, (unsigned long)(r), sizeof(*(r)), \
+ (v)); \
} while (0)
#endif /* __BIG_ENDIAN */
@@ -479,7 +481,7 @@ typedef struct dhd_bus {
bool dpc_sched; /* Indicates DPC schedule (intrpt rcvd) */
bool fcstate; /* State of dongle flow-control */
- u16 cl_devid; /* cached devid for dhdsdio_probe_attach() */
+ u16 cl_devid; /* cached devid for brcmf_sdio_probe_attach() */
char *fw_path; /* module_param: path to firmware image */
char *nv_path; /* module_param: path to nvram vars file */
const char *nvram_params; /* user specified nvram params. */
@@ -685,7 +687,7 @@ static bool forcealign;
#define ALIGNMENT 4
#if defined(OOB_INTR_ONLY) && defined(HW_OOB)
-extern void bcmsdh_enable_hw_oob_intr(void *sdh, bool enable);
+extern void brcmf_sdcard_enable_hw_oob_intr(void *sdh, bool enable);
#endif
#if defined(OOB_INTR_ONLY) && defined(SDIO_ISR_THREAD)
@@ -721,7 +723,8 @@ do { \
retryvar = 0; \
do { \
regvar = R_REG(regaddr); \
- } while (bcmsdh_regfail(bus->sdh) && (++retryvar <= retry_limit)); \
+ } while (brcmf_sdcard_regfail(bus->sdh) && \
+ (++retryvar <= retry_limit)); \
if (retryvar) { \
bus->regfails += (retryvar-1); \
if (retryvar > retry_limit) { \
@@ -737,7 +740,8 @@ do { \
retryvar = 0; \
do { \
W_REG(regaddr, regval); \
- } while (bcmsdh_regfail(bus->sdh) && (++retryvar <= retry_limit)); \
+ } while (brcmf_sdcard_regfail(bus->sdh) && \
+ (++retryvar <= retry_limit)); \
if (retryvar) { \
bus->regfails += (retryvar-1); \
if (retryvar > retry_limit) \
@@ -753,56 +757,57 @@ do { \
#define HOSTINTMASK (I_HMB_SW_MASK | I_CHIPACTIVE)
#ifdef SDTEST
-static void dhdsdio_testrcv(dhd_bus_t *bus, void *pkt, uint seq);
-static void dhdsdio_sdtest_set(dhd_bus_t *bus, bool start);
+static void brcmf_sdbrcm_checkdied(dhd_bus_t *bus, void *pkt, uint seq);
+static void brcmf_sdbrcm_sdtest_set(dhd_bus_t *bus, bool start);
#endif
#ifdef DHD_DEBUG
-static int dhdsdio_checkdied(dhd_bus_t *bus, u8 *data, uint size);
-static int dhdsdio_mem_dump(dhd_bus_t *bus);
+static int brcmf_sdbrcm_checkdied(dhd_bus_t *bus, u8 *data, uint size);
+static int brcmf_sdbrcm_mem_dump(dhd_bus_t *bus);
#endif /* DHD_DEBUG */
-static int dhdsdio_download_state(dhd_bus_t *bus, bool enter);
+static int brcmf_sdbrcm_download_state(dhd_bus_t *bus, bool enter);
-static void dhdsdio_release(dhd_bus_t *bus);
-static void dhdsdio_release_malloc(dhd_bus_t *bus);
-static void dhdsdio_disconnect(void *ptr);
-static bool dhdsdio_chipmatch(u16 chipid);
-static bool dhdsdio_probe_attach(dhd_bus_t *bus, void *sdh,
+static void brcmf_sdbrcm_release(dhd_bus_t *bus);
+static void brcmf_sdbrcm_release_malloc(dhd_bus_t *bus);
+static void brcmf_sdbrcm_disconnect(void *ptr);
+static bool brcmf_sdbrcm_chipmatch(u16 chipid);
+static bool brcmf_sdbrcm_probe_attach(dhd_bus_t *bus, void *sdh,
void *regsva, u16 devid);
-static bool dhdsdio_probe_malloc(dhd_bus_t *bus, void *sdh);
-static bool dhdsdio_probe_init(dhd_bus_t *bus, void *sdh);
-static void dhdsdio_release_dongle(dhd_bus_t *bus);
+static bool brcmf_sdbrcm_probe_malloc(dhd_bus_t *bus, void *sdh);
+static bool brcmf_sdbrcm_probe_init(dhd_bus_t *bus, void *sdh);
+static void brcmf_sdbrcm_release_dongle(dhd_bus_t *bus);
-static uint process_nvram_vars(char *varbuf, uint len);
+static uint brcmf_process_nvram_vars(char *varbuf, uint len);
-static void dhd_dongle_setmemsize(struct dhd_bus *bus, int mem_size);
-static int dhd_bcmsdh_send_buf(dhd_bus_t *bus, u32 addr, uint fn,
+static void brcmf_sdbrcm_setmemsize(struct dhd_bus *bus, int mem_size);
+static int brcmf_sdbrcm_send_buf(dhd_bus_t *bus, u32 addr, uint fn,
uint flags, u8 *buf, uint nbytes,
struct sk_buff *pkt, bcmsdh_cmplt_fn_t complete,
void *handle);
-static bool dhdsdio_download_firmware(struct dhd_bus *bus, void *sdh);
-static int _dhdsdio_download_firmware(struct dhd_bus *bus);
+static bool brcmf_sdbrcm_download_firmware(struct dhd_bus *bus, void *sdh);
+static int _brcmf_sdbrcm_download_firmware(struct dhd_bus *bus);
-static int dhdsdio_download_code_file(struct dhd_bus *bus, char *image_path);
-static int dhdsdio_download_nvram(struct dhd_bus *bus);
-static void dhdsdio_chip_disablecore(bcmsdh_info_t *sdh, u32 corebase);
-static int dhdsdio_chip_attach(struct dhd_bus *bus, void *regs);
-static void dhdsdio_chip_resetcore(bcmsdh_info_t *sdh, u32 corebase);
-static void dhdsdio_sdiod_drive_strength_init(struct dhd_bus *bus,
+static int
+brcmf_sdbrcm_download_code_file(struct dhd_bus *bus, char *image_path);
+static int brcmf_sdbrcm_download_nvram(struct dhd_bus *bus);
+static void brcmf_sdbrcm_chip_disablecore(bcmsdh_info_t *sdh, u32 corebase);
+static int brcmf_sdbrcm_chip_attach(struct dhd_bus *bus, void *regs);
+static void brcmf_sdbrcm_chip_resetcore(bcmsdh_info_t *sdh, u32 corebase);
+static void brcmf_sdbrcm_sdiod_drive_strength_init(struct dhd_bus *bus,
u32 drivestrength);
-static void dhdsdio_chip_detach(struct dhd_bus *bus);
+static void brcmf_sdbrcm_chip_detach(struct dhd_bus *bus);
/* Packet free applicable unconditionally for sdio and sdspi.
* Conditional if bufpool was present for gspi bus.
*/
-static void dhdsdio_pktfree2(dhd_bus_t *bus, struct sk_buff *pkt)
+static void brcmf_sdbrcm_pktfree2(dhd_bus_t *bus, struct sk_buff *pkt)
{
if ((bus->bus != SPI_BUS) || bus->usebufpool)
brcmu_pkt_buf_free_skb(pkt);
}
-static void dhd_dongle_setmemsize(struct dhd_bus *bus, int mem_size)
+static void brcmf_sdbrcm_setmemsize(struct dhd_bus *bus, int mem_size)
{
s32 min_size = DONGLE_MIN_MEMSIZE;
/* Restrict the memsize to user specified limit */
@@ -813,23 +818,25 @@ static void dhd_dongle_setmemsize(struct dhd_bus *bus, int mem_size)
bus->ramsize = dhd_dongle_memsize;
}
-static int dhdsdio_set_siaddr_window(dhd_bus_t *bus, u32 address)
+static int brcmf_sdbrcm_set_siaddr_window(dhd_bus_t *bus, u32 address)
{
int err = 0;
- bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRLOW,
+ brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRLOW,
(address >> 8) & SBSDIO_SBADDRLOW_MASK, &err);
if (!err)
- bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRMID,
+ brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_1,
+ SBSDIO_FUNC1_SBADDRMID,
(address >> 16) & SBSDIO_SBADDRMID_MASK, &err);
if (!err)
- bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRHIGH,
- (address >> 24) & SBSDIO_SBADDRHIGH_MASK,
- &err);
+ brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_1,
+ SBSDIO_FUNC1_SBADDRHIGH,
+ (address >> 24) & SBSDIO_SBADDRHIGH_MASK,
+ &err);
return err;
}
/* Turn backplane clock on or off */
-static int dhdsdio_htclk(dhd_bus_t *bus, bool on, bool pendok)
+static int brcmf_sdbrcm_htclk(dhd_bus_t *bus, bool on, bool pendok)
{
int err;
u8 clkctl, clkreq, devctl;
@@ -852,8 +859,8 @@ static int dhdsdio_htclk(dhd_bus_t *bus, bool on, bool pendok)
&& (bus->ci->chiprev == 0))
clkreq |= SBSDIO_FORCE_ALP;
- bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
- clkreq, &err);
+ brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
+ SBSDIO_FUNC1_CHIPCLKCSR, clkreq, &err);
if (err) {
DHD_ERROR(("%s: HT Avail request error: %d\n",
__func__, err));
@@ -867,9 +874,8 @@ static int dhdsdio_htclk(dhd_bus_t *bus, bool on, bool pendok)
}
/* Check current status */
- clkctl =
- bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
- &err);
+ clkctl = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
+ SBSDIO_FUNC1_CHIPCLKCSR, &err);
if (err) {
DHD_ERROR(("%s: HT Avail read error: %d\n",
__func__, err));
@@ -879,9 +885,8 @@ static int dhdsdio_htclk(dhd_bus_t *bus, bool on, bool pendok)
/* Go to pending and await interrupt if appropriate */
if (!SBSDIO_CLKAV(clkctl, bus->alp_only) && pendok) {
/* Allow only clock-available interrupt */
- devctl =
- bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL,
- &err);
+ devctl = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
+ SBSDIO_DEVICE_CTL, &err);
if (err) {
DHD_ERROR(("%s: Devctl error setting CA: %d\n",
__func__, err));
@@ -889,8 +894,8 @@ static int dhdsdio_htclk(dhd_bus_t *bus, bool on, bool pendok)
}
devctl |= SBSDIO_DEVCTL_CA_INT_ONLY;
- bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL,
- devctl, &err);
+ brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
+ SBSDIO_DEVICE_CTL, devctl, &err);
DHD_INFO(("CLKCTL: set PENDING\n"));
bus->clkstate = CLK_PENDING;
@@ -898,18 +903,18 @@ static int dhdsdio_htclk(dhd_bus_t *bus, bool on, bool pendok)
} else if (bus->clkstate == CLK_PENDING) {
/* Cancel CA-only interrupt filter */
devctl =
- bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL,
- &err);
+ brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
+ SBSDIO_DEVICE_CTL, &err);
devctl &= ~SBSDIO_DEVCTL_CA_INT_ONLY;
- bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL,
- devctl, &err);
+ brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
+ SBSDIO_DEVICE_CTL, devctl, &err);
}
/* Otherwise, wait here (polling) for HT Avail */
if (!SBSDIO_CLKAV(clkctl, bus->alp_only)) {
SPINWAIT_SLEEP(sdioh_spinwait_sleep,
((clkctl =
- bcmsdh_cfg_read(sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR,
&err)),
!SBSDIO_CLKAV(clkctl, bus->alp_only)),
@@ -952,17 +957,16 @@ static int dhdsdio_htclk(dhd_bus_t *bus, bool on, bool pendok)
if (bus->clkstate == CLK_PENDING) {
/* Cancel CA-only interrupt filter */
- devctl =
- bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL,
- &err);
+ devctl = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
+ SBSDIO_DEVICE_CTL, &err);
devctl &= ~SBSDIO_DEVCTL_CA_INT_ONLY;
- bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL,
- devctl, &err);
+ brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
+ SBSDIO_DEVICE_CTL, devctl, &err);
}
bus->clkstate = CLK_SDONLY;
- bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
- clkreq, &err);
+ brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
+ SBSDIO_FUNC1_CHIPCLKCSR, clkreq, &err);
DHD_INFO(("CLKCTL: turned OFF\n"));
if (err) {
DHD_ERROR(("%s: Failed access turning clock off: %d\n",
@@ -974,7 +978,7 @@ static int dhdsdio_htclk(dhd_bus_t *bus, bool on, bool pendok)
}
/* Change idle/active SD state */
-static int dhdsdio_sdclk(dhd_bus_t *bus, bool on)
+static int brcmf_sdbrcm_sdclk(dhd_bus_t *bus, bool on)
{
DHD_TRACE(("%s: Enter\n", __func__));
@@ -987,7 +991,7 @@ static int dhdsdio_sdclk(dhd_bus_t *bus, bool on)
}
/* Transition SD and backplane clock readiness */
-static int dhdsdio_clkctl(dhd_bus_t *bus, uint target, bool pendok)
+static int brcmf_sdbrcm_clkctl(dhd_bus_t *bus, uint target, bool pendok)
{
#ifdef DHD_DEBUG
uint oldstate = bus->clkstate;
@@ -1008,9 +1012,9 @@ static int dhdsdio_clkctl(dhd_bus_t *bus, uint target, bool pendok)
case CLK_AVAIL:
/* Make sure SD clock is available */
if (bus->clkstate == CLK_NONE)
- dhdsdio_sdclk(bus, true);
+ brcmf_sdbrcm_sdclk(bus, true);
/* Now request HT Avail on the backplane */
- dhdsdio_htclk(bus, true, pendok);
+ brcmf_sdbrcm_htclk(bus, true, pendok);
dhd_os_wd_timer(bus->dhd, dhd_watchdog_ms);
bus->activity = true;
break;
@@ -1018,38 +1022,38 @@ static int dhdsdio_clkctl(dhd_bus_t *bus, uint target, bool pendok)
case CLK_SDONLY:
/* Remove HT request, or bring up SD clock */
if (bus->clkstate == CLK_NONE)
- dhdsdio_sdclk(bus, true);
+ brcmf_sdbrcm_sdclk(bus, true);
else if (bus->clkstate == CLK_AVAIL)
- dhdsdio_htclk(bus, false, false);
+ brcmf_sdbrcm_htclk(bus, false, false);
else
- DHD_ERROR(("dhdsdio_clkctl: request for %d -> %d\n",
- bus->clkstate, target));
+ DHD_ERROR(("brcmf_sdbrcm_clkctl: request for %d -> %d"
+ "\n", bus->clkstate, target));
dhd_os_wd_timer(bus->dhd, dhd_watchdog_ms);
break;
case CLK_NONE:
/* Make sure to remove HT request */
if (bus->clkstate == CLK_AVAIL)
- dhdsdio_htclk(bus, false, false);
+ brcmf_sdbrcm_htclk(bus, false, false);
/* Now remove the SD clock */
- dhdsdio_sdclk(bus, false);
+ brcmf_sdbrcm_sdclk(bus, false);
dhd_os_wd_timer(bus->dhd, 0);
break;
}
#ifdef DHD_DEBUG
- DHD_INFO(("dhdsdio_clkctl: %d -> %d\n", oldstate, bus->clkstate));
+ DHD_INFO(("brcmf_sdbrcm_clkctl: %d -> %d\n", oldstate, bus->clkstate));
#endif /* DHD_DEBUG */
return 0;
}
-int dhdsdio_bussleep(dhd_bus_t *bus, bool sleep)
+int brcmf_sdbrcm_bussleep(dhd_bus_t *bus, bool sleep)
{
bcmsdh_info_t *sdh = bus->sdh;
struct sdpcmd_regs *regs = bus->regs;
uint retries = 0;
- DHD_INFO(("dhdsdio_bussleep: request %s (currently %s)\n",
+ DHD_INFO(("brcmf_sdbrcm_bussleep: request %s (currently %s)\n",
(sleep ? "SLEEP" : "WAKE"),
(bus->sleeping ? "SLEEP" : "WAKE")));
@@ -1064,10 +1068,10 @@ int dhdsdio_bussleep(dhd_bus_t *bus, bool sleep)
return -EBUSY;
/* Disable SDIO interrupts (no longer interested) */
- bcmsdh_intr_disable(bus->sdh);
+ brcmf_sdcard_intr_disable(bus->sdh);
/* Make sure the controller has the bus up */
- dhdsdio_clkctl(bus, CLK_AVAIL, false);
+ brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
/* Tell device to start using OOB wakeup */
W_SDREG(SMB_USE_OOB, ®s->tosbmailbox, retries);
@@ -1075,16 +1079,18 @@ int dhdsdio_bussleep(dhd_bus_t *bus, bool sleep)
DHD_ERROR(("CANNOT SIGNAL CHIP, WILL NOT WAKE UP!!\n"));
/* Turn off our contribution to the HT clock request */
- dhdsdio_clkctl(bus, CLK_SDONLY, false);
+ brcmf_sdbrcm_clkctl(bus, CLK_SDONLY, false);
- bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
- SBSDIO_FORCE_HW_CLKREQ_OFF, NULL);
+ brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
+ SBSDIO_FUNC1_CHIPCLKCSR,
+ SBSDIO_FORCE_HW_CLKREQ_OFF, NULL);
/* Isolate the bus */
if (bus->ci->chip != BCM4329_CHIP_ID
&& bus->ci->chip != BCM4319_CHIP_ID) {
- bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL,
- SBSDIO_DEVCTL_PADS_ISO, NULL);
+ brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
+ SBSDIO_DEVICE_CTL,
+ SBSDIO_DEVCTL_PADS_ISO, NULL);
}
/* Change state */
@@ -1093,18 +1099,18 @@ int dhdsdio_bussleep(dhd_bus_t *bus, bool sleep)
} else {
/* Waking up: bus power up is ok, set local state */
- bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
- 0, NULL);
+ brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
+ SBSDIO_FUNC1_CHIPCLKCSR, 0, NULL);
/* Force pad isolation off if possible
(in case power never toggled) */
if ((bus->ci->buscoretype == PCMCIA_CORE_ID)
&& (bus->ci->buscorerev >= 10))
- bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, 0,
- NULL);
+ brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
+ SBSDIO_DEVICE_CTL, 0, NULL);
/* Make sure the controller has the bus up */
- dhdsdio_clkctl(bus, CLK_AVAIL, false);
+ brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
/* Send misc interrupt to indicate OOB not needed */
W_SDREG(0, ®s->tosbmailboxdata, retries);
@@ -1115,7 +1121,7 @@ int dhdsdio_bussleep(dhd_bus_t *bus, bool sleep)
DHD_ERROR(("CANNOT SIGNAL CHIP TO CLEAR OOB!!\n"));
/* Make sure we have SD bus access */
- dhdsdio_clkctl(bus, CLK_SDONLY, false);
+ brcmf_sdbrcm_clkctl(bus, CLK_SDONLY, false);
/* Change state */
bus->sleeping = false;
@@ -1123,7 +1129,7 @@ int dhdsdio_bussleep(dhd_bus_t *bus, bool sleep)
/* Enable interrupts again */
if (bus->intr && (bus->dhd->busstate == DHD_BUS_DATA)) {
bus->intdis = false;
- bcmsdh_intr_enable(bus->sdh);
+ brcmf_sdcard_intr_enable(bus->sdh);
}
}
@@ -1131,15 +1137,15 @@ int dhdsdio_bussleep(dhd_bus_t *bus, bool sleep)
}
#if defined(OOB_INTR_ONLY)
-void dhd_enable_oob_intr(struct dhd_bus *bus, bool enable)
+void brcmf_sdbrcm_enable_oob_intr(struct dhd_bus *bus, bool enable)
{
#if defined(HW_OOB)
- bcmsdh_enable_hw_oob_intr(bus->sdh, enable);
+ brcmf_sdcard_enable_hw_oob_intr(bus->sdh, enable);
#else
sdpcmd_regs_t *regs = bus->regs;
uint retries = 0;
- dhdsdio_clkctl(bus, CLK_AVAIL, false);
+ brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
if (enable == true) {
/* Tell device to start using OOB wakeup */
@@ -1155,7 +1161,7 @@ void dhd_enable_oob_intr(struct dhd_bus *bus, bool enable)
}
/* Turn off our contribution to the HT clock request */
- dhdsdio_clkctl(bus, CLK_SDONLY, false);
+ brcmf_sdbrcm_clkctl(bus, CLK_SDONLY, false);
#endif /* !defined(HW_OOB) */
}
#endif /* defined(OOB_INTR_ONLY) */
@@ -1163,12 +1169,12 @@ void dhd_enable_oob_intr(struct dhd_bus *bus, bool enable)
#define BUS_WAKE(bus) \
do { \
if ((bus)->sleeping) \
- dhdsdio_bussleep((bus), false); \
+ brcmf_sdbrcm_bussleep((bus), false); \
} while (0);
/* Writes a HW/SW header into the packet and sends it. */
/* Assumes: (a) header space already there, (b) caller holds lock */
-static int dhdsdio_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
+static int brcmf_sdbrcm_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
bool free_pkt)
{
int ret;
@@ -1281,9 +1287,8 @@ static int dhdsdio_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
}
do {
- ret =
- dhd_bcmsdh_send_buf(bus, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2,
- F2SYNC, frame, len, pkt, NULL, NULL);
+ ret = brcmf_sdbrcm_send_buf(bus, brcmf_sdcard_cur_sbwad(sdh),
+ SDIO_FUNC_2, F2SYNC, frame, len, pkt, NULL, NULL);
bus->f2txdata++;
ASSERT(ret != -BCME_PENDING);
@@ -1294,18 +1299,18 @@ static int dhdsdio_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
"terminate frame.\n", __func__, ret));
bus->tx_sderrs++;
- bcmsdh_abort(sdh, SDIO_FUNC_2);
- bcmsdh_cfg_write(sdh, SDIO_FUNC_1,
+ brcmf_sdcard_abort(sdh, SDIO_FUNC_2);
+ brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
SBSDIO_FUNC1_FRAMECTRL, SFC_WF_TERM,
NULL);
bus->f1regdata++;
for (i = 0; i < 3; i++) {
u8 hi, lo;
- hi = bcmsdh_cfg_read(sdh, SDIO_FUNC_1,
+ hi = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
SBSDIO_FUNC1_WFRAMEBCHI,
NULL);
- lo = bcmsdh_cfg_read(sdh, SDIO_FUNC_1,
+ lo = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
SBSDIO_FUNC1_WFRAMEBCLO,
NULL);
bus->f1regdata += 2;
@@ -1332,7 +1337,7 @@ done:
return ret;
}
-int dhd_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
+int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
{
int ret = -EBADE;
uint datalen, prec;
@@ -1403,13 +1408,13 @@ int dhd_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
/* Otherwise, send it now */
BUS_WAKE(bus);
/* Make sure back plane ht clk is on, no pending allowed */
- dhdsdio_clkctl(bus, CLK_AVAIL, true);
+ brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, true);
#ifndef SDTEST
DHD_TRACE(("%s: calling txpkt\n", __func__));
- ret = dhdsdio_txpkt(bus, pkt, SDPCM_DATA_CHANNEL, true);
+ ret = brcmf_sdbrcm_txpkt(bus, pkt, SDPCM_DATA_CHANNEL, true);
#else
- ret = dhdsdio_txpkt(bus, pkt,
+ ret = brcmf_sdbrcm_txpkt(bus, pkt,
(bus->ext_loop ? SDPCM_TEST_CHANNEL :
SDPCM_DATA_CHANNEL), true);
#endif
@@ -1420,7 +1425,7 @@ int dhd_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
if ((bus->idletime == DHD_IDLE_IMMEDIATE) && !bus->dpc_sched) {
bus->activity = false;
- dhdsdio_clkctl(bus, CLK_NONE, true);
+ brcmf_sdbrcm_clkctl(bus, CLK_NONE, true);
}
dhd_os_sdunlock(bus->dhd);
@@ -1429,7 +1434,7 @@ int dhd_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
return ret;
}
-static uint dhdsdio_sendfromq(dhd_bus_t *bus, uint maxframes)
+static uint brcmf_sdbrcm_sendfromq(dhd_bus_t *bus, uint maxframes)
{
struct sk_buff *pkt;
u32 intstatus = 0;
@@ -1458,9 +1463,9 @@ static uint dhdsdio_sendfromq(dhd_bus_t *bus, uint maxframes)
datalen = pkt->len - SDPCM_HDRLEN;
#ifndef SDTEST
- ret = dhdsdio_txpkt(bus, pkt, SDPCM_DATA_CHANNEL, true);
+ ret = brcmf_sdbrcm_txpkt(bus, pkt, SDPCM_DATA_CHANNEL, true);
#else
- ret = dhdsdio_txpkt(bus, pkt,
+ ret = brcmf_sdbrcm_txpkt(bus, pkt,
(bus->ext_loop ? SDPCM_TEST_CHANNEL :
SDPCM_DATA_CHANNEL), true);
#endif
@@ -1474,7 +1479,7 @@ static uint dhdsdio_sendfromq(dhd_bus_t *bus, uint maxframes)
/* Check device status, signal pending interrupt */
R_SDREG(intstatus, ®s->intstatus, retries);
bus->f2txdata++;
- if (bcmsdh_regfail(bus->sdh))
+ if (brcmf_sdcard_regfail(bus->sdh))
break;
if (intstatus & bus->hostintmask)
bus->ipend = true;
@@ -1489,7 +1494,8 @@ static uint dhdsdio_sendfromq(dhd_bus_t *bus, uint maxframes)
return cnt;
}
-int dhd_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
+int
+brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
{
u8 *frame;
u16 len;
@@ -1543,7 +1549,7 @@ int dhd_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
BUS_WAKE(bus);
/* Make sure backplane clock is on */
- dhdsdio_clkctl(bus, CLK_AVAIL, false);
+ brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
/* Hardware tag: 2 byte len followed by 2 byte ~len check (all LE) */
*(u16 *) frame = cpu_to_le16((u16) msglen);
@@ -1592,10 +1598,9 @@ int dhd_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
do {
bus->ctrl_frame_stat = false;
- ret =
- dhd_bcmsdh_send_buf(bus, bcmsdh_cur_sbwad(sdh),
- SDIO_FUNC_2, F2SYNC, frame, len,
- NULL, NULL, NULL);
+ ret = brcmf_sdbrcm_send_buf(bus,
+ brcmf_sdcard_cur_sbwad(sdh), SDIO_FUNC_2,
+ F2SYNC, frame, len, NULL, NULL, NULL);
ASSERT(ret != -BCME_PENDING);
@@ -1606,21 +1611,23 @@ int dhd_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
__func__, ret));
bus->tx_sderrs++;
- bcmsdh_abort(sdh, SDIO_FUNC_2);
+ brcmf_sdcard_abort(sdh, SDIO_FUNC_2);
- bcmsdh_cfg_write(sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
SBSDIO_FUNC1_FRAMECTRL,
SFC_WF_TERM, NULL);
bus->f1regdata++;
for (i = 0; i < 3; i++) {
u8 hi, lo;
- hi = bcmsdh_cfg_read(sdh, SDIO_FUNC_1,
+ hi = brcmf_sdcard_cfg_read(sdh,
+ SDIO_FUNC_1,
SBSDIO_FUNC1_WFRAMEBCHI,
NULL);
- lo = bcmsdh_cfg_read(sdh, SDIO_FUNC_1,
+ lo = brcmf_sdcard_cfg_read(sdh,
+ SDIO_FUNC_1,
SBSDIO_FUNC1_WFRAMEBCLO,
- NULL);
+ NULL);
bus->f1regdata += 2;
if ((hi == 0) && (lo == 0))
break;
@@ -1636,7 +1643,7 @@ int dhd_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
if ((bus->idletime == DHD_IDLE_IMMEDIATE) && !bus->dpc_sched) {
bus->activity = false;
- dhdsdio_clkctl(bus, CLK_NONE, true);
+ brcmf_sdbrcm_clkctl(bus, CLK_NONE, true);
}
dhd_os_sdunlock(bus->dhd);
@@ -1649,7 +1656,7 @@ int dhd_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
return ret ? -EIO : 0;
}
-int dhd_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
+int brcmf_sdbrcm_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
{
int timeleft;
uint rxlen = 0;
@@ -1676,7 +1683,7 @@ int dhd_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
DHD_ERROR(("%s: resumed on timeout\n", __func__));
#ifdef DHD_DEBUG
dhd_os_sdlock(bus->dhd);
- dhdsdio_checkdied(bus, NULL, 0);
+ brcmf_sdbrcm_checkdied(bus, NULL, 0);
dhd_os_sdunlock(bus->dhd);
#endif /* DHD_DEBUG */
} else if (pending == true) {
@@ -1686,7 +1693,7 @@ int dhd_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
DHD_CTL(("%s: resumed for unknown reason?\n", __func__));
#ifdef DHD_DEBUG
dhd_os_sdlock(bus->dhd);
- dhdsdio_checkdied(bus, NULL, 0);
+ brcmf_sdbrcm_checkdied(bus, NULL, 0);
dhd_os_sdunlock(bus->dhd);
#endif /* DHD_DEBUG */
}
@@ -1798,7 +1805,7 @@ dhd_dump_pct(struct brcmu_strbuf *strbuf, char *desc, uint num, uint div)
}
}
-void dhd_bus_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf)
+void brcmf_sdbrcm_bus_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf)
{
dhd_bus_t *bus = dhdp->bus;
@@ -1889,7 +1896,7 @@ void dhd_bus_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf)
#ifdef DHD_DEBUG
brcmu_bprintf(strbuf, "dpc_sched %d host interrupt%spending\n",
bus->dpc_sched,
- (bcmsdh_intr_pending(bus->sdh) ? " " : " not "));
+ (brcmf_sdcard_intr_pending(bus->sdh) ? " " : " not "));
brcmu_bprintf(strbuf, "blocksize %d roundup %d\n", bus->blocksize,
bus->roundup);
#endif /* DHD_DEBUG */
@@ -1912,7 +1919,7 @@ void dhd_bus_clearcounts(dhd_pub_t *dhdp)
}
#ifdef SDTEST
-static int dhdsdio_pktgen_get(dhd_bus_t *bus, u8 *arg)
+static int brcmf_sdbrcm_pktgen_get(dhd_bus_t *bus, u8 *arg)
{
dhd_pktgen_t pktgen;
@@ -1934,7 +1941,7 @@ static int dhdsdio_pktgen_get(dhd_bus_t *bus, u8 *arg)
return 0;
}
-static int dhdsdio_pktgen_set(dhd_bus_t *bus, u8 *arg)
+static int brcmf_sdbrcm_pktgen_set(dhd_bus_t *bus, u8 *arg)
{
dhd_pktgen_t pktgen;
uint oldcnt, oldmode;
@@ -1968,7 +1975,7 @@ static int dhdsdio_pktgen_set(dhd_bus_t *bus, u8 *arg)
#endif /* SDTEST */
static int
-dhdsdio_membytes(dhd_bus_t *bus, bool write, u32 address, u8 *data,
+brcmf_sdbrcm_membytes(dhd_bus_t *bus, bool write, u32 address, u8 *data,
uint size)
{
int bcmerror = 0;
@@ -1983,7 +1990,7 @@ dhdsdio_membytes(dhd_bus_t *bus, bool write, u32 address, u8 *data,
dsize = size;
/* Set the backplane window to include the start address */
- bcmerror = dhdsdio_set_siaddr_window(bus, address);
+ bcmerror = brcmf_sdbrcm_set_siaddr_window(bus, address);
if (bcmerror) {
DHD_ERROR(("%s: window change failed\n", __func__));
goto xfer_done;
@@ -1995,7 +2002,7 @@ dhdsdio_membytes(dhd_bus_t *bus, bool write, u32 address, u8 *data,
__func__, (write ? "write" : "read"), dsize,
sdaddr, (address & SBSDIO_SBWINDOW_MASK)));
bcmerror =
- bcmsdh_rwdata(bus->sdh, write, sdaddr, data, dsize);
+ brcmf_sdcard_rwdata(bus->sdh, write, sdaddr, data, dsize);
if (bcmerror) {
DHD_ERROR(("%s: membytes transfer failed\n", __func__));
break;
@@ -2006,7 +2013,7 @@ dhdsdio_membytes(dhd_bus_t *bus, bool write, u32 address, u8 *data,
if (size) {
data += dsize;
address += dsize;
- bcmerror = dhdsdio_set_siaddr_window(bus, address);
+ bcmerror = brcmf_sdbrcm_set_siaddr_window(bus, address);
if (bcmerror) {
DHD_ERROR(("%s: window change failed\n",
__func__));
@@ -2019,23 +2026,25 @@ dhdsdio_membytes(dhd_bus_t *bus, bool write, u32 address, u8 *data,
xfer_done:
/* Return the window to backplane enumeration space for core access */
- if (dhdsdio_set_siaddr_window(bus, bcmsdh_cur_sbwad(bus->sdh))) {
+ if (brcmf_sdbrcm_set_siaddr_window(bus,
+ brcmf_sdcard_cur_sbwad(bus->sdh))) {
DHD_ERROR(("%s: FAILED to set window back to 0x%x\n",
- __func__, bcmsdh_cur_sbwad(bus->sdh)));
+ __func__, brcmf_sdcard_cur_sbwad(bus->sdh)));
}
return bcmerror;
}
#ifdef DHD_DEBUG
-static int dhdsdio_readshared(dhd_bus_t *bus, struct sdpcm_shared *sh)
+static int brcmf_sdbrcm_readshared(dhd_bus_t *bus, struct sdpcm_shared *sh)
{
u32 addr;
int rv;
/* Read last word in memory to determine address of
sdpcm_shared structure */
- rv = dhdsdio_membytes(bus, false, bus->ramsize - 4, (u8 *)&addr, 4);
+ rv = brcmf_sdbrcm_membytes(bus, false, bus->ramsize - 4, (u8 *)&addr,
+ 4);
if (rv < 0)
return rv;
@@ -2054,7 +2063,7 @@ static int dhdsdio_readshared(dhd_bus_t *bus, struct sdpcm_shared *sh)
}
/* Read rte_shared structure */
- rv = dhdsdio_membytes(bus, false, addr, (u8 *) sh,
+ rv = brcmf_sdbrcm_membytes(bus, false, addr, (u8 *) sh,
sizeof(struct sdpcm_shared));
if (rv < 0)
return rv;
@@ -2079,7 +2088,7 @@ static int dhdsdio_readshared(dhd_bus_t *bus, struct sdpcm_shared *sh)
return 0;
}
-static int dhdsdio_checkdied(dhd_bus_t *bus, u8 *data, uint size)
+static int brcmf_sdbrcm_checkdied(dhd_bus_t *bus, u8 *data, uint size)
{
int bcmerror = 0;
uint msize = 512;
@@ -2114,7 +2123,7 @@ static int dhdsdio_checkdied(dhd_bus_t *bus, u8 *data, uint size)
goto done;
}
- bcmerror = dhdsdio_readshared(bus, &sdpcm_shared);
+ bcmerror = brcmf_sdbrcm_readshared(bus, &sdpcm_shared);
if (bcmerror < 0)
goto done;
@@ -2147,7 +2156,7 @@ static int dhdsdio_checkdied(dhd_bus_t *bus, u8 *data, uint size)
brcmu_bprintf(&strbuf, "Dongle assert");
if (sdpcm_shared.assert_exp_addr != 0) {
str[0] = '\0';
- bcmerror = dhdsdio_membytes(bus, false,
+ bcmerror = brcmf_sdbrcm_membytes(bus, false,
sdpcm_shared.assert_exp_addr,
(u8 *) str, maxstrlen);
if (bcmerror < 0)
@@ -2159,7 +2168,7 @@ static int dhdsdio_checkdied(dhd_bus_t *bus, u8 *data, uint size)
if (sdpcm_shared.assert_file_addr != 0) {
str[0] = '\0';
- bcmerror = dhdsdio_membytes(bus, false,
+ bcmerror = brcmf_sdbrcm_membytes(bus, false,
sdpcm_shared.assert_file_addr,
(u8 *) str, maxstrlen);
if (bcmerror < 0)
@@ -2174,7 +2183,7 @@ static int dhdsdio_checkdied(dhd_bus_t *bus, u8 *data, uint size)
}
if (sdpcm_shared.flags & SDPCM_SHARED_TRAP) {
- bcmerror = dhdsdio_membytes(bus, false,
+ bcmerror = brcmf_sdbrcm_membytes(bus, false,
sdpcm_shared.trap_addr, (u8 *)&tr,
sizeof(trap_t));
if (bcmerror < 0)
@@ -2197,7 +2206,7 @@ static int dhdsdio_checkdied(dhd_bus_t *bus, u8 *data, uint size)
#ifdef DHD_DEBUG
if (sdpcm_shared.flags & SDPCM_SHARED_TRAP) {
/* Mem dump to a file on device */
- dhdsdio_mem_dump(bus);
+ brcmf_sdbrcm_mem_dump(bus);
}
#endif /* DHD_DEBUG */
@@ -2208,7 +2217,7 @@ done:
return bcmerror;
}
-static int dhdsdio_mem_dump(dhd_bus_t *bus)
+static int brcmf_sdbrcm_mem_dump(dhd_bus_t *bus)
{
int ret = 0;
int size; /* Full mem size */
@@ -2229,7 +2238,8 @@ static int dhdsdio_mem_dump(dhd_bus_t *bus)
databuf = buf;
while (size) {
read_size = min(MEMBLOCK, size);
- ret = dhdsdio_membytes(bus, false, start, databuf, read_size);
+ ret = brcmf_sdbrcm_membytes(bus, false, start, databuf,
+ read_size);
if (ret) {
DHD_ERROR(("%s: Error membytes %d\n", __func__, ret));
kfree(buf);
@@ -2256,7 +2266,7 @@ static int dhdsdio_mem_dump(dhd_bus_t *bus)
#define CONSOLE_LINE_MAX 192
-static int dhdsdio_readconsole(dhd_bus_t *bus)
+static int brcmf_sdbrcm_readconsole(dhd_bus_t *bus)
{
dhd_console_t *c = &bus->console;
u8 line[CONSOLE_LINE_MAX], ch;
@@ -2269,7 +2279,7 @@ static int dhdsdio_readconsole(dhd_bus_t *bus)
/* Read console log struct */
addr = bus->console_addr + offsetof(rte_cons_t, log);
- rv = dhdsdio_membytes(bus, false, addr, (u8 *)&c->log,
+ rv = brcmf_sdbrcm_membytes(bus, false, addr, (u8 *)&c->log,
sizeof(c->log));
if (rv < 0)
return rv;
@@ -2295,7 +2305,7 @@ static int dhdsdio_readconsole(dhd_bus_t *bus)
/* Read the console buffer */
addr = le32_to_cpu(c->log.buf);
- rv = dhdsdio_membytes(bus, false, addr, c->buf, c->bufsize);
+ rv = brcmf_sdbrcm_membytes(bus, false, addr, c->buf, c->bufsize);
if (rv < 0)
return rv;
@@ -2333,7 +2343,7 @@ break2:
}
#endif /* DHD_DEBUG */
-int dhdsdio_downloadvars(dhd_bus_t *bus, void *arg, int len)
+int brcmf_sdbrcm_downloadvars(dhd_bus_t *bus, void *arg, int len)
{
int bcmerror = 0;
@@ -2367,7 +2377,7 @@ err:
}
static int
-dhdsdio_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
+brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
const char *name, void *params, int plen, void *arg, int len,
int val_size)
{
@@ -2401,7 +2411,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
/* Handle sleep stuff before any clock mucking */
if (vi->varid == IOV_SLEEP) {
if (IOV_ISSET(actionid)) {
- bcmerror = dhdsdio_bussleep(bus, bool_val);
+ bcmerror = brcmf_sdbrcm_bussleep(bus, bool_val);
} else {
int_val = (s32) bus->sleeping;
memcpy(arg, &int_val, val_size);
@@ -2412,7 +2422,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
/* Request clock to allow SDIO accesses */
if (!bus->dhd->dongle_reset) {
BUS_WAKE(bus);
- dhdsdio_clkctl(bus, CLK_AVAIL, false);
+ brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
}
switch (actionid) {
@@ -2428,11 +2438,11 @@ dhdsdio_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
if (bus->intr) {
DHD_INTR(("%s: enable SDIO device interrupts\n",
__func__));
- bcmsdh_intr_enable(bus->sdh);
+ brcmf_sdcard_intr_enable(bus->sdh);
} else {
DHD_INTR(("%s: disable SDIO interrupts\n",
__func__));
- bcmsdh_intr_disable(bus->sdh);
+ brcmf_sdcard_intr_disable(bus->sdh);
}
}
break;
@@ -2525,8 +2535,8 @@ dhdsdio_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
2 * sizeof(int) : (u8 *) arg;
/* Call to do the transfer */
- bcmerror =
- dhdsdio_membytes(bus, set, address, data, size);
+ bcmerror = brcmf_sdbrcm_membytes(bus, set, address,
+ data, size);
break;
}
@@ -2543,16 +2553,16 @@ dhdsdio_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
case IOV_SVAL(IOV_SDIOD_DRIVE):
dhd_sdiod_drive_strength = int_val;
- dhdsdio_sdiod_drive_strength_init(bus,
+ brcmf_sdbrcm_sdiod_drive_strength_init(bus,
dhd_sdiod_drive_strength);
break;
case IOV_SVAL(IOV_DOWNLOAD):
- bcmerror = dhdsdio_download_state(bus, bool_val);
+ bcmerror = brcmf_sdbrcm_download_state(bus, bool_val);
break;
case IOV_SVAL(IOV_VARS):
- bcmerror = dhdsdio_downloadvars(bus, arg, len);
+ bcmerror = brcmf_sdbrcm_downloadvars(bus, arg, len);
break;
case IOV_GVAL(IOV_READAHEAD):
@@ -2610,8 +2620,9 @@ dhdsdio_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
addr = (unsigned long)bus->regs + sd_ptr->offset;
size = sd_ptr->func;
- int_val = (s32) bcmsdh_reg_read(bus->sdh, addr, size);
- if (bcmsdh_regfail(bus->sdh))
+ int_val = (s32) brcmf_sdcard_reg_read(bus->sdh, addr,
+ size);
+ if (brcmf_sdcard_regfail(bus->sdh))
bcmerror = -EIO;
memcpy(arg, &int_val, sizeof(s32));
break;
@@ -2626,8 +2637,9 @@ dhdsdio_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
addr = (unsigned long)bus->regs + sd_ptr->offset;
size = sd_ptr->func;
- bcmsdh_reg_write(bus->sdh, addr, size, sd_ptr->value);
- if (bcmsdh_regfail(bus->sdh))
+ brcmf_sdcard_reg_write(bus->sdh, addr, size,
+ sd_ptr->value);
+ if (brcmf_sdcard_regfail(bus->sdh))
bcmerror = -EIO;
break;
}
@@ -2643,8 +2655,9 @@ dhdsdio_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
addr = SI_ENUM_BASE + sdreg.offset;
size = sdreg.func;
- int_val = (s32) bcmsdh_reg_read(bus->sdh, addr, size);
- if (bcmsdh_regfail(bus->sdh))
+ int_val = (s32) brcmf_sdcard_reg_read(bus->sdh, addr,
+ size);
+ if (brcmf_sdcard_regfail(bus->sdh))
bcmerror = -EIO;
memcpy(arg, &int_val, sizeof(s32));
break;
@@ -2659,8 +2672,9 @@ dhdsdio_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
addr = SI_ENUM_BASE + sdreg.offset;
size = sdreg.func;
- bcmsdh_reg_write(bus->sdh, addr, size, sdreg.value);
- if (bcmsdh_regfail(bus->sdh))
+ brcmf_sdcard_reg_write(bus->sdh, addr, size,
+ sdreg.value);
+ if (brcmf_sdcard_regfail(bus->sdh))
bcmerror = -EIO;
break;
}
@@ -2670,15 +2684,15 @@ dhdsdio_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
*(char *)arg = 0;
strcat(arg, "\nFunc 0\n");
- bcmsdh_cis_read(bus->sdh, 0x10,
+ brcmf_sdcard_cis_read(bus->sdh, 0x10,
(u8 *) arg + strlen(arg),
SBSDIO_CIS_SIZE_LIMIT);
strcat(arg, "\nFunc 1\n");
- bcmsdh_cis_read(bus->sdh, 0x11,
+ brcmf_sdcard_cis_read(bus->sdh, 0x11,
(u8 *) arg + strlen(arg),
SBSDIO_CIS_SIZE_LIMIT);
strcat(arg, "\nFunc 2\n");
- bcmsdh_cis_read(bus->sdh, 0x12,
+ brcmf_sdcard_cis_read(bus->sdh, 0x12,
(u8 *) arg + strlen(arg),
SBSDIO_CIS_SIZE_LIMIT);
break;
@@ -2732,11 +2746,11 @@ dhdsdio_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
break;
case IOV_GVAL(IOV_PKTGEN):
- bcmerror = dhdsdio_pktgen_get(bus, arg);
+ bcmerror = brcmf_sdbrcm_pktgen_get(bus, arg);
break;
case IOV_SVAL(IOV_PKTGEN):
- bcmerror = dhdsdio_pktgen_set(bus, arg);
+ bcmerror = brcmf_sdbrcm_pktgen_set(bus, arg);
break;
#endif /* SDTEST */
@@ -2767,7 +2781,7 @@ dhdsdio_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
exit:
if ((bus->idletime == DHD_IDLE_IMMEDIATE) && !bus->dpc_sched) {
bus->activity = false;
- dhdsdio_clkctl(bus, CLK_NONE, true);
+ brcmf_sdbrcm_clkctl(bus, CLK_NONE, true);
}
dhd_os_sdunlock(bus->dhd);
@@ -2778,7 +2792,7 @@ exit:
return bcmerror;
}
-static int dhdsdio_write_vars(dhd_bus_t *bus)
+static int brcmf_sdbrcm_write_vars(dhd_bus_t *bus)
{
int bcmerror = 0;
u32 varsize;
@@ -2803,7 +2817,7 @@ static int dhdsdio_write_vars(dhd_bus_t *bus)
/* Write the vars list */
bcmerror =
- dhdsdio_membytes(bus, true, varaddr, vbuffer, varsize);
+ brcmf_sdbrcm_membytes(bus, true, varaddr, vbuffer, varsize);
#ifdef DHD_DEBUG
/* Verify NVRAM bytes */
DHD_INFO(("Compare NVRAM dl & ul; varsize=%d\n", varsize));
@@ -2816,7 +2830,7 @@ static int dhdsdio_write_vars(dhd_bus_t *bus)
/* Read the vars list to temp buffer for comparison */
bcmerror =
- dhdsdio_membytes(bus, false, varaddr, nvram_ularray,
+ brcmf_sdbrcm_membytes(bus, false, varaddr, nvram_ularray,
varsize);
if (bcmerror) {
DHD_ERROR(("%s: error %d on reading %d nvram bytes at "
@@ -2859,13 +2873,13 @@ static int dhdsdio_write_vars(dhd_bus_t *bus)
varsizew));
/* Write the length token to the last word */
- bcmerror = dhdsdio_membytes(bus, true, (bus->orig_ramsize - 4),
+ bcmerror = brcmf_sdbrcm_membytes(bus, true, (bus->orig_ramsize - 4),
(u8 *)&varsizew, 4);
return bcmerror;
}
-static int dhdsdio_download_state(dhd_bus_t *bus, bool enter)
+static int brcmf_sdbrcm_download_state(dhd_bus_t *bus, bool enter)
{
uint retries;
u32 regdata;
@@ -2877,18 +2891,18 @@ static int dhdsdio_download_state(dhd_bus_t *bus, bool enter)
if (enter) {
bus->alp_only = true;
- dhdsdio_chip_disablecore(bus->sdh, bus->ci->armcorebase);
+ brcmf_sdbrcm_chip_disablecore(bus->sdh, bus->ci->armcorebase);
- dhdsdio_chip_resetcore(bus->sdh, bus->ci->ramcorebase);
+ brcmf_sdbrcm_chip_resetcore(bus->sdh, bus->ci->ramcorebase);
/* Clear the top bit of memory */
if (bus->ramsize) {
u32 zeros = 0;
- dhdsdio_membytes(bus, true, bus->ramsize - 4,
+ brcmf_sdbrcm_membytes(bus, true, bus->ramsize - 4,
(u8 *)&zeros, 4);
}
} else {
- regdata = bcmsdh_reg_read(bus->sdh,
+ regdata = brcmf_sdcard_reg_read(bus->sdh,
CORE_SB(bus->ci->ramcorebase, sbtmstatelow), 4);
regdata &= (SBTML_RESET | SBTML_REJ_MASK |
(SICF_CLOCK_EN << SBTML_SICF_SHIFT));
@@ -2899,7 +2913,7 @@ static int dhdsdio_download_state(dhd_bus_t *bus, bool enter)
goto fail;
}
- bcmerror = dhdsdio_write_vars(bus);
+ bcmerror = brcmf_sdbrcm_write_vars(bus);
if (bcmerror) {
DHD_ERROR(("%s: no vars written to RAM\n", __func__));
bcmerror = 0;
@@ -2907,7 +2921,7 @@ static int dhdsdio_download_state(dhd_bus_t *bus, bool enter)
W_SDREG(0xFFFFFFFF, &bus->regs->intstatus, retries);
- dhdsdio_chip_resetcore(bus->sdh, bus->ci->armcorebase);
+ brcmf_sdbrcm_chip_resetcore(bus->sdh, bus->ci->armcorebase);
/* Allow HT Clock now that the ARM is running. */
bus->alp_only = false;
@@ -2919,8 +2933,8 @@ fail:
}
int
-dhd_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
- void *params, int plen, void *arg, int len, bool set)
+brcmf_sdbrcm_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
+ void *params, int plen, void *arg, int len, bool set)
{
dhd_bus_t *bus = dhdp->bus;
const struct brcmu_iovar *vi = NULL;
@@ -2947,16 +2961,15 @@ dhd_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
BUS_WAKE(bus);
/* Turn on clock in case SD command needs backplane */
- dhdsdio_clkctl(bus, CLK_AVAIL, false);
+ brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
- bcmerror =
- bcmsdh_iovar_op(bus->sdh, name, params, plen, arg, len,
- set);
+ bcmerror = brcmf_sdcard_iovar_op(bus->sdh, name, params, plen,
+ arg, len, set);
/* Similar check for blocksize change */
if (set && strcmp(name, "sd_blocksize") == 0) {
s32 fnum = 2;
- if (bcmsdh_iovar_op
+ if (brcmf_sdcard_iovar_op
(bus->sdh, "sd_blocksize", &fnum, sizeof(s32),
&bus->blocksize, sizeof(s32),
false) != 0) {
@@ -2973,7 +2986,7 @@ dhd_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
if ((bus->idletime == DHD_IDLE_IMMEDIATE) && !bus->dpc_sched) {
bus->activity = false;
- dhdsdio_clkctl(bus, CLK_NONE, true);
+ brcmf_sdbrcm_clkctl(bus, CLK_NONE, true);
}
dhd_os_sdunlock(bus->dhd);
@@ -3000,15 +3013,14 @@ dhd_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
val_size = sizeof(int);
actionid = set ? IOV_SVAL(vi->varid) : IOV_GVAL(vi->varid);
- bcmerror =
- dhdsdio_doiovar(bus, vi, actionid, name, params, plen, arg, len,
- val_size);
+ bcmerror = brcmf_sdbrcm_doiovar(bus, vi, actionid, name, params, plen,
+ arg, len, val_size);
exit:
return bcmerror;
}
-void dhd_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
+void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
{
u32 local_hostintmask;
u8 saveclk;
@@ -3023,7 +3035,7 @@ void dhd_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
BUS_WAKE(bus);
/* Enable clock for device interrupts */
- dhdsdio_clkctl(bus, CLK_AVAIL, false);
+ brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
/* Disable and clear interrupts at the chip level also */
W_SDREG(0, &bus->regs->hostintmask, retries);
@@ -3034,12 +3046,12 @@ void dhd_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
bus->dhd->busstate = DHD_BUS_DOWN;
/* Force clocks on backplane to be sure F2 interrupt propagates */
- saveclk =
- bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
- &err);
+ saveclk = brcmf_sdcard_cfg_read(bus->sdh, SDIO_FUNC_1,
+ SBSDIO_FUNC1_CHIPCLKCSR, &err);
if (!err) {
- bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
- (saveclk | SBSDIO_FORCE_HT), &err);
+ brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_1,
+ SBSDIO_FUNC1_CHIPCLKCSR,
+ (saveclk | SBSDIO_FORCE_HT), &err);
}
if (err) {
DHD_ERROR(("%s: Failed to force clock for F2: err %d\n",
@@ -3048,15 +3060,15 @@ void dhd_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
/* Turn off the bus (F2), free any pending packets */
DHD_INTR(("%s: disable SDIO interrupts\n", __func__));
- bcmsdh_intr_disable(bus->sdh);
- bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_0, SDIO_CCCR_IOEx,
+ brcmf_sdcard_intr_disable(bus->sdh);
+ brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_0, SDIO_CCCR_IOEx,
SDIO_FUNC_ENABLE_1, NULL);
/* Clear any pending interrupts now that F2 is disabled */
W_SDREG(local_hostintmask, &bus->regs->intstatus, retries);
/* Turn off the backplane clock (only) */
- dhdsdio_clkctl(bus, CLK_SDONLY, false);
+ brcmf_sdbrcm_clkctl(bus, CLK_SDONLY, false);
/* Clear the data packet queues */
brcmu_pktq_flush(&bus->txq, true, NULL, NULL);
@@ -3082,7 +3094,7 @@ void dhd_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
dhd_os_sdunlock(bus->dhd);
}
-int dhd_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
+int brcmf_sdbrcm_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
{
dhd_bus_t *bus = dhdp->bus;
dhd_timeout_t tmo;
@@ -3101,17 +3113,18 @@ int dhd_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
dhd_os_sdlock(bus->dhd);
/* Make sure backplane clock is on, needed to generate F2 interrupt */
- dhdsdio_clkctl(bus, CLK_AVAIL, false);
+ brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
if (bus->clkstate != CLK_AVAIL)
goto exit;
/* Force clocks on backplane to be sure F2 interrupt propagates */
saveclk =
- bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
- &err);
+ brcmf_sdcard_cfg_read(bus->sdh, SDIO_FUNC_1,
+ SBSDIO_FUNC1_CHIPCLKCSR, &err);
if (!err) {
- bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
- (saveclk | SBSDIO_FORCE_HT), &err);
+ brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_1,
+ SBSDIO_FUNC1_CHIPCLKCSR,
+ (saveclk | SBSDIO_FORCE_HT), &err);
}
if (err) {
DHD_ERROR(("%s: Failed to force clock for F2: err %d\n",
@@ -3124,7 +3137,8 @@ int dhd_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
&bus->regs->tosbmailboxdata, retries);
enable = (SDIO_FUNC_ENABLE_1 | SDIO_FUNC_ENABLE_2);
- bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_0, SDIO_CCCR_IOEx, enable, NULL);
+ brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_0, SDIO_CCCR_IOEx, enable,
+ NULL);
/* Give the dongle some time to do its thing and set IOR2 */
dhd_timeout_start(&tmo, DHD_WAIT_F2RDY * 1000);
@@ -3132,7 +3146,7 @@ int dhd_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
ready = 0;
while (ready != enable && !dhd_timeout_expired(&tmo))
ready =
- bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_0, SDIO_CCCR_IORx,
+ brcmf_sdcard_cfg_read(bus->sdh, SDIO_FUNC_0, SDIO_CCCR_IORx,
NULL);
DHD_INFO(("%s: enable 0x%02x, ready 0x%02x (waited %uus)\n",
@@ -3146,7 +3160,7 @@ int dhd_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
(unsigned int *)CORE_BUS_REG(bus->ci->buscorebase,
hostintmask), retries);
- bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_WATERMARK,
+ brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_WATERMARK,
(u8) watermark, &err);
/* Set bus state according to enable result */
@@ -3158,10 +3172,10 @@ int dhd_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
if (bus->intr) {
DHD_INTR(("%s: enable SDIO device interrupts\n",
__func__));
- bcmsdh_intr_enable(bus->sdh);
+ brcmf_sdcard_intr_enable(bus->sdh);
} else {
DHD_INTR(("%s: disable SDIO interrupts\n", __func__));
- bcmsdh_intr_disable(bus->sdh);
+ brcmf_sdcard_intr_disable(bus->sdh);
}
}
@@ -3169,17 +3183,17 @@ int dhd_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
else {
/* Disable F2 again */
enable = SDIO_FUNC_ENABLE_1;
- bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_0, SDIO_CCCR_IOEx, enable,
- NULL);
+ brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_0, SDIO_CCCR_IOEx,
+ enable, NULL);
}
/* Restore previous clock setting */
- bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
+ brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
saveclk, &err);
/* If we didn't come up, turn off backplane clock */
if (dhdp->busstate != DHD_BUS_DATA)
- dhdsdio_clkctl(bus, CLK_NONE, false);
+ brcmf_sdbrcm_clkctl(bus, CLK_NONE, false);
exit:
if (enforce_mutex)
@@ -3188,7 +3202,7 @@ exit:
return ret;
}
-static void dhdsdio_rxfail(dhd_bus_t *bus, bool abort, bool rtx)
+static void brcmf_sdbrcm_rxfail(dhd_bus_t *bus, bool abort, bool rtx)
{
bcmsdh_info_t *sdh = bus->sdh;
struct sdpcmd_regs *regs = bus->regs;
@@ -3202,18 +3216,18 @@ static void dhdsdio_rxfail(dhd_bus_t *bus, bool abort, bool rtx)
(rtx ? ", send NAK" : "")));
if (abort)
- bcmsdh_abort(sdh, SDIO_FUNC_2);
+ brcmf_sdcard_abort(sdh, SDIO_FUNC_2);
- bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_FRAMECTRL, SFC_RF_TERM,
- &err);
+ brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_FRAMECTRL,
+ SFC_RF_TERM, &err);
bus->f1regdata++;
/* Wait until the packet has been flushed (device/FIFO stable) */
for (lastrbc = retries = 0xffff; retries > 0; retries--) {
- hi = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_RFRAMEBCHI,
- NULL);
- lo = bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_RFRAMEBCLO,
- NULL);
+ hi = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
+ SBSDIO_FUNC1_RFRAMEBCHI, NULL);
+ lo = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
+ SBSDIO_FUNC1_RFRAMEBCLO, NULL);
bus->f1regdata += 2;
if ((hi == 0) && (lo == 0))
@@ -3247,12 +3261,12 @@ static void dhdsdio_rxfail(dhd_bus_t *bus, bool abort, bool rtx)
bus->nextlen = 0;
/* If we can't reach the device, signal failure */
- if (err || bcmsdh_regfail(sdh))
+ if (err || brcmf_sdcard_regfail(sdh))
bus->dhd->busstate = DHD_BUS_DOWN;
}
static void
-dhdsdio_read_control(dhd_bus_t *bus, u8 *hdr, uint len, uint doff)
+brcmf_sdbrcm_read_control(dhd_bus_t *bus, u8 *hdr, uint len, uint doff)
{
bcmsdh_info_t *sdh = bus->sdh;
uint rdlen, pad;
@@ -3308,7 +3322,7 @@ dhdsdio_read_control(dhd_bus_t *bus, u8 *hdr, uint len, uint doff)
DHD_ERROR(("%s: %d-byte control read exceeds %d-byte buffer\n",
__func__, rdlen, bus->dhd->maxctl));
bus->dhd->rx_errors++;
- dhdsdio_rxfail(bus, false, false);
+ brcmf_sdbrcm_rxfail(bus, false, false);
goto done;
}
@@ -3318,12 +3332,13 @@ dhdsdio_read_control(dhd_bus_t *bus, u8 *hdr, uint len, uint doff)
__func__, len, (len - doff), bus->dhd->maxctl));
bus->dhd->rx_errors++;
bus->rx_toolong++;
- dhdsdio_rxfail(bus, false, false);
+ brcmf_sdbrcm_rxfail(bus, false, false);
goto done;
}
/* Read remainder of frame body into the rxctl buffer */
- sdret = bcmsdh_recv_buf(sdh, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2,
+ sdret = brcmf_sdcard_recv_buf(sdh, brcmf_sdcard_cur_sbwad(sdh),
+ SDIO_FUNC_2,
F2SYNC, (bus->rxctl + firstread), rdlen,
NULL, NULL, NULL);
bus->f2rxdata++;
@@ -3334,7 +3349,7 @@ dhdsdio_read_control(dhd_bus_t *bus, u8 *hdr, uint len, uint doff)
DHD_ERROR(("%s: read %d control bytes failed: %d\n",
__func__, rdlen, sdret));
bus->rxc_errors++; /* dhd.rx_ctlerrs is higher level */
- dhdsdio_rxfail(bus, true, true);
+ brcmf_sdbrcm_rxfail(bus, true, true);
goto done;
}
@@ -3356,7 +3371,7 @@ done:
dhd_os_ioctl_resp_wake(bus->dhd);
}
-static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
+static u8 brcmf_sdbrcm_rxglom(dhd_bus_t *bus, u8 rxseq)
{
u16 dlen, totlen;
u8 *dptr, num = 0;
@@ -3374,7 +3389,7 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
/* If packets, issue read(s) and send up packet chain */
/* Return sequence numbers consumed? */
- DHD_TRACE(("dhdsdio_rxglom: start: glomd %p glom %p\n", bus->glomd,
+ DHD_TRACE(("brcmf_sdbrcm_rxglom: start: glomd %p glom %p\n", bus->glomd,
bus->glom));
/* If there's a descriptor, generate the packet chain */
@@ -3485,13 +3500,15 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
* packet and and copy into the chain.
*/
if (usechain) {
- errcode = bcmsdh_recv_buf(bus->sdh,
- bcmsdh_cur_sbwad(bus->sdh), SDIO_FUNC_2,
+ errcode = brcmf_sdcard_recv_buf(bus->sdh,
+ brcmf_sdcard_cur_sbwad(bus->sdh),
+ SDIO_FUNC_2,
F2SYNC, (u8 *) pfirst->data, dlen,
pfirst, NULL, NULL);
} else if (bus->dataptr) {
- errcode = bcmsdh_recv_buf(bus->sdh,
- bcmsdh_cur_sbwad(bus->sdh), SDIO_FUNC_2,
+ errcode = brcmf_sdcard_recv_buf(bus->sdh,
+ brcmf_sdcard_cur_sbwad(bus->sdh),
+ SDIO_FUNC_2,
F2SYNC, bus->dataptr, dlen,
NULL, NULL, NULL);
sublen = (u16) brcmu_pktfrombuf(pfirst, 0, dlen,
@@ -3517,10 +3534,10 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
bus->dhd->rx_errors++;
if (bus->glomerr++ < 3) {
- dhdsdio_rxfail(bus, true, true);
+ brcmf_sdbrcm_rxfail(bus, true, true);
} else {
bus->glomerr = 0;
- dhdsdio_rxfail(bus, true, false);
+ brcmf_sdbrcm_rxfail(bus, true, false);
brcmu_pkt_buf_free_skb(bus->glom);
bus->rxglomfail++;
bus->glom = NULL;
@@ -3648,10 +3665,10 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
if (bus->glomerr++ < 3) {
/* Restore superframe header space */
skb_push(pfirst, sfdoff);
- dhdsdio_rxfail(bus, true, true);
+ brcmf_sdbrcm_rxfail(bus, true, true);
} else {
bus->glomerr = 0;
- dhdsdio_rxfail(bus, true, false);
+ brcmf_sdbrcm_rxfail(bus, true, false);
brcmu_pkt_buf_free_skb(bus->glom);
bus->rxglomfail++;
bus->glom = NULL;
@@ -3756,7 +3773,8 @@ static u8 dhdsdio_rxglom(dhd_bus_t *bus, u8 rxseq)
}
/* Return true if there may be more frames to read */
-static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
+static uint
+brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
{
bcmsdh_info_t *sdh = bus->sdh;
@@ -3805,7 +3823,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
u8 cnt;
DHD_GLOM(("%s: calling rxglom: glomd %p, glom %p\n",
__func__, bus->glomd, bus->glom));
- cnt = dhdsdio_rxglom(bus, rxseq);
+ cnt = brcmf_sdbrcm_rxglom(bus, rxseq);
DHD_GLOM(("%s: rxglom returned %d\n", __func__, cnt));
rxseq += cnt - 1;
rxleft = (rxleft > cnt) ? (rxleft - cnt) : 1;
@@ -3867,8 +3885,8 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
ASSERT(bus->rxctl >= bus->rxbuf);
rxbuf = bus->rxctl;
/* Read the entire frame */
- sdret = bcmsdh_recv_buf(sdh,
- bcmsdh_cur_sbwad(sdh),
+ sdret = brcmf_sdcard_recv_buf(sdh,
+ brcmf_sdcard_cur_sbwad(sdh),
SDIO_FUNC_2, F2SYNC,
rxbuf, rdlen,
NULL, NULL, NULL);
@@ -3883,7 +3901,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
rdlen, sdret));
/* dhd.rx_ctlerrs is higher */
bus->rxc_errors++;
- dhdsdio_rxfail(bus, true,
+ brcmf_sdbrcm_rxfail(bus, true,
(bus->bus ==
SPI_BUS) ? false
: true);
@@ -3908,8 +3926,8 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
PKTALIGN(pkt, rdlen, DHD_SDALIGN);
rxbuf = (u8 *) (pkt->data);
/* Read the entire frame */
- sdret = bcmsdh_recv_buf(sdh,
- bcmsdh_cur_sbwad(sdh),
+ sdret = brcmf_sdcard_recv_buf(sdh,
+ brcmf_sdcard_cur_sbwad(sdh),
SDIO_FUNC_2, F2SYNC,
rxbuf, rdlen,
pkt, NULL, NULL);
@@ -3925,7 +3943,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
* Don't attempt NAK for
* gSPI
*/
- dhdsdio_rxfail(bus, true,
+ brcmf_sdbrcm_rxfail(bus, true,
(bus->bus ==
SPI_BUS) ? false :
true);
@@ -3944,7 +3962,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
if (!(len | check)) {
DHD_INFO(("%s (nextlen): read zeros in HW "
"header???\n", __func__));
- dhdsdio_pktfree2(bus, pkt);
+ brcmf_sdbrcm_pktfree2(bus, pkt);
continue;
}
@@ -3955,8 +3973,8 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
" 0x%04x/0x%04x/0x%04x\n",
__func__, nextlen, len, check));
bus->rx_badhdr++;
- dhdsdio_rxfail(bus, false, false);
- dhdsdio_pktfree2(bus, pkt);
+ brcmf_sdbrcm_rxfail(bus, false, false);
+ brcmf_sdbrcm_pktfree2(bus, pkt);
continue;
}
@@ -3964,7 +3982,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
if (len < SDPCM_HDRLEN) {
DHD_ERROR(("%s (nextlen): HW hdr length "
"invalid: %d\n", __func__, len));
- dhdsdio_pktfree2(bus, pkt);
+ brcmf_sdbrcm_pktfree2(bus, pkt);
continue;
}
@@ -3978,8 +3996,9 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
"expected rxseq %d\n",
__func__, nextlen,
len, roundup(len, 16), rxseq));
- dhdsdio_rxfail(bus, true, (bus->bus != SPI_BUS));
- dhdsdio_pktfree2(bus, pkt);
+ brcmf_sdbrcm_rxfail(bus, true,
+ bus->bus != SPI_BUS);
+ brcmf_sdbrcm_pktfree2(bus, pkt);
continue;
}
@@ -4050,16 +4069,16 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
if (chan == SDPCM_CONTROL_CHANNEL) {
if (bus->bus == SPI_BUS) {
- dhdsdio_read_control(bus, rxbuf, len,
- doff);
+ brcmf_sdbrcm_read_control(bus, rxbuf,
+ len, doff);
} else {
DHD_ERROR(("%s (nextlen): readahead on control" " packet %d?\n",
__func__, seq));
/* Force retry w/normal header read */
bus->nextlen = 0;
- dhdsdio_rxfail(bus, false, true);
+ brcmf_sdbrcm_rxfail(bus, false, true);
}
- dhdsdio_pktfree2(bus, pkt);
+ brcmf_sdbrcm_pktfree2(bus, pkt);
continue;
}
@@ -4073,8 +4092,8 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
if ((doff < SDPCM_HDRLEN) || (doff > len)) {
DHD_ERROR(("%s (nextlen): bad data offset %d: HW len %d min %d\n",
__func__, doff, len, SDPCM_HDRLEN));
- dhdsdio_rxfail(bus, false, false);
- dhdsdio_pktfree2(bus, pkt);
+ brcmf_sdbrcm_rxfail(bus, false, false);
+ brcmf_sdbrcm_pktfree2(bus, pkt);
continue;
}
@@ -4086,7 +4105,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
break;
/* Read frame header (hardware and software) */
- sdret = bcmsdh_recv_buf(sdh, bcmsdh_cur_sbwad(sdh),
+ sdret = brcmf_sdcard_recv_buf(sdh, brcmf_sdcard_cur_sbwad(sdh),
SDIO_FUNC_2, F2SYNC, bus->rxhdr, firstread,
NULL, NULL, NULL);
bus->f2rxhdrs++;
@@ -4096,7 +4115,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
DHD_ERROR(("%s: RXHEADER FAILED: %d\n", __func__,
sdret));
bus->rx_hdrfail++;
- dhdsdio_rxfail(bus, true, true);
+ brcmf_sdbrcm_rxfail(bus, true, true);
continue;
}
#ifdef DHD_DEBUG
@@ -4122,7 +4141,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
DHD_ERROR(("%s: HW hdr err: len/check 0x%04x/0x%04x\n",
__func__, len, check));
bus->rx_badhdr++;
- dhdsdio_rxfail(bus, false, false);
+ brcmf_sdbrcm_rxfail(bus, false, false);
continue;
}
@@ -4146,7 +4165,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
__func__, doff, len, SDPCM_HDRLEN, seq));
bus->rx_badhdr++;
ASSERT(0);
- dhdsdio_rxfail(bus, false, false);
+ brcmf_sdbrcm_rxfail(bus, false, false);
continue;
}
@@ -4192,7 +4211,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
/* Call a separate function for control frames */
if (chan == SDPCM_CONTROL_CHANNEL) {
- dhdsdio_read_control(bus, bus->rxhdr, len, doff);
+ brcmf_sdbrcm_read_control(bus, bus->rxhdr, len, doff);
continue;
}
@@ -4225,7 +4244,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
__func__, len, rdlen));
bus->dhd->rx_errors++;
bus->rx_toolong++;
- dhdsdio_rxfail(bus, false, false);
+ brcmf_sdbrcm_rxfail(bus, false, false);
continue;
}
@@ -4235,7 +4254,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
DHD_ERROR(("%s: brcmu_pkt_buf_get_skb failed: rdlen %d"
" chan %d\n", __func__, rdlen, chan));
bus->dhd->rx_dropped++;
- dhdsdio_rxfail(bus, false, RETRYCHAN(chan));
+ brcmf_sdbrcm_rxfail(bus, false, RETRYCHAN(chan));
continue;
}
@@ -4247,9 +4266,9 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
PKTALIGN(pkt, rdlen, DHD_SDALIGN);
/* Read the remaining frame data */
- sdret = bcmsdh_recv_buf(sdh, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2,
- F2SYNC, ((u8 *) (pkt->data)), rdlen,
- pkt, NULL, NULL);
+ sdret = brcmf_sdcard_recv_buf(sdh, brcmf_sdcard_cur_sbwad(sdh),
+ SDIO_FUNC_2, F2SYNC, ((u8 *) (pkt->data)),
+ rdlen, pkt, NULL, NULL);
bus->f2rxdata++;
ASSERT(sdret != -BCME_PENDING);
@@ -4263,7 +4282,7 @@ static uint dhdsdio_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
sdret));
brcmu_pkt_buf_free_skb(pkt);
bus->dhd->rx_errors++;
- dhdsdio_rxfail(bus, true, RETRYCHAN(chan));
+ brcmf_sdbrcm_rxfail(bus, true, RETRYCHAN(chan));
continue;
}
@@ -4300,7 +4319,7 @@ deliver:
} else {
DHD_ERROR(("%s: glom superframe w/o "
"descriptor!\n", __func__));
- dhdsdio_rxfail(bus, false, false);
+ brcmf_sdbrcm_rxfail(bus, false, false);
}
continue;
}
@@ -4312,7 +4331,7 @@ deliver:
#ifdef SDTEST
/* Test channel packets are processed separately */
if (chan == SDPCM_TEST_CHANNEL) {
- dhdsdio_testrcv(bus, pkt, seq);
+ brcmf_sdbrcm_checkdied(bus, pkt, seq);
continue;
}
#endif /* SDTEST */
@@ -4349,7 +4368,7 @@ deliver:
return rxcount;
}
-static u32 dhdsdio_hostmail(dhd_bus_t *bus)
+static u32 brcmf_sdbrcm_hostmail(dhd_bus_t *bus)
{
struct sdpcmd_regs *regs = bus->regs;
u32 intstatus = 0;
@@ -4423,7 +4442,7 @@ static u32 dhdsdio_hostmail(dhd_bus_t *bus)
return intstatus;
}
-bool dhdsdio_dpc(dhd_bus_t *bus)
+bool brcmf_sdbrcm_dpc(dhd_bus_t *bus)
{
bcmsdh_info_t *sdh = bus->sdh;
struct sdpcmd_regs *regs = bus->regs;
@@ -4449,8 +4468,8 @@ bool dhdsdio_dpc(dhd_bus_t *bus)
#ifdef DHD_DEBUG
/* Check for inconsistent device control */
- devctl =
- bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL, &err);
+ devctl = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
+ SBSDIO_DEVICE_CTL, &err);
if (err) {
DHD_ERROR(("%s: error reading DEVCTL: %d\n",
__func__, err));
@@ -4461,9 +4480,8 @@ bool dhdsdio_dpc(dhd_bus_t *bus)
#endif /* DHD_DEBUG */
/* Read CSR, if clock on switch to AVAIL, else ignore */
- clkctl =
- bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
- &err);
+ clkctl = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
+ SBSDIO_FUNC1_CHIPCLKCSR, &err);
if (err) {
DHD_ERROR(("%s: error reading CSR: %d\n", __func__,
err));
@@ -4474,17 +4492,16 @@ bool dhdsdio_dpc(dhd_bus_t *bus)
clkctl));
if (SBSDIO_HTAV(clkctl)) {
- devctl =
- bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL,
- &err);
+ devctl = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
+ SBSDIO_DEVICE_CTL, &err);
if (err) {
DHD_ERROR(("%s: error reading DEVCTL: %d\n",
__func__, err));
bus->dhd->busstate = DHD_BUS_DOWN;
}
devctl &= ~SBSDIO_DEVCTL_CA_INT_ONLY;
- bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_DEVICE_CTL,
- devctl, &err);
+ brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
+ SBSDIO_DEVICE_CTL, devctl, &err);
if (err) {
DHD_ERROR(("%s: error writing DEVCTL: %d\n",
__func__, err));
@@ -4499,7 +4516,7 @@ bool dhdsdio_dpc(dhd_bus_t *bus)
BUS_WAKE(bus);
/* Make sure backplane clock is on */
- dhdsdio_clkctl(bus, CLK_AVAIL, true);
+ brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, true);
if (bus->clkstate == CLK_PENDING)
goto clkwait;
@@ -4508,7 +4525,7 @@ bool dhdsdio_dpc(dhd_bus_t *bus)
bus->ipend = false;
R_SDREG(newstatus, ®s->intstatus, retries);
bus->f1regdata++;
- if (bcmsdh_regfail(bus->sdh))
+ if (brcmf_sdcard_regfail(bus->sdh))
newstatus = 0;
newstatus &= bus->hostintmask;
bus->fcstate = !!(newstatus & I_HMB_FC_STATE);
@@ -4539,7 +4556,7 @@ bool dhdsdio_dpc(dhd_bus_t *bus)
/* Handle host mailbox indication */
if (intstatus & I_HMB_HOST_INT) {
intstatus &= ~I_HMB_HOST_INT;
- intstatus |= dhdsdio_hostmail(bus);
+ intstatus |= brcmf_sdbrcm_hostmail(bus);
}
/* Generally don't ask for these, can get CRC errors... */
@@ -4570,7 +4587,7 @@ bool dhdsdio_dpc(dhd_bus_t *bus)
/* On frame indication, read available frames */
if (PKT_AVAILABLE()) {
- framecnt = dhdsdio_readframes(bus, rxlimit, &rxdone);
+ framecnt = brcmf_sdbrcm_readframes(bus, rxlimit, &rxdone);
if (rxdone || bus->rxskip)
intstatus &= ~I_HMB_FRAME_IND;
rxlimit -= min(framecnt, rxlimit);
@@ -4581,28 +4598,26 @@ bool dhdsdio_dpc(dhd_bus_t *bus)
clkwait:
#if defined(OOB_INTR_ONLY)
- bcmsdh_oob_intr_set(1);
+ brcmf_sdio_oob_intr_set(1);
#endif /* (OOB_INTR_ONLY) */
/* Re-enable interrupts to detect new device events (mailbox, rx frame)
* or clock availability. (Allows tx loop to check ipend if desired.)
* (Unless register access seems hosed, as we may not be able to ACK...)
*/
- if (bus->intr && bus->intdis && !bcmsdh_regfail(sdh)) {
+ if (bus->intr && bus->intdis && !brcmf_sdcard_regfail(sdh)) {
DHD_INTR(("%s: enable SDIO interrupts, rxdone %d framecnt %d\n",
__func__, rxdone, framecnt));
bus->intdis = false;
- bcmsdh_intr_enable(sdh);
+ brcmf_sdcard_intr_enable(sdh);
}
if (DATAOK(bus) && bus->ctrl_frame_stat &&
(bus->clkstate == CLK_AVAIL)) {
int ret, i;
- ret =
- dhd_bcmsdh_send_buf(bus, bcmsdh_cur_sbwad(sdh), SDIO_FUNC_2,
- F2SYNC, (u8 *) bus->ctrl_frame_buf,
- (u32) bus->ctrl_frame_len, NULL,
- NULL, NULL);
+ ret = brcmf_sdbrcm_send_buf(bus, brcmf_sdcard_cur_sbwad(sdh),
+ SDIO_FUNC_2, F2SYNC, (u8 *) bus->ctrl_frame_buf,
+ (u32) bus->ctrl_frame_len, NULL, NULL, NULL);
ASSERT(ret != -BCME_PENDING);
if (ret < 0) {
@@ -4612,19 +4627,19 @@ clkwait:
"terminate frame.\n", __func__, ret));
bus->tx_sderrs++;
- bcmsdh_abort(sdh, SDIO_FUNC_2);
+ brcmf_sdcard_abort(sdh, SDIO_FUNC_2);
- bcmsdh_cfg_write(sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
SBSDIO_FUNC1_FRAMECTRL, SFC_WF_TERM,
NULL);
bus->f1regdata++;
for (i = 0; i < 3; i++) {
u8 hi, lo;
- hi = bcmsdh_cfg_read(sdh, SDIO_FUNC_1,
+ hi = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
SBSDIO_FUNC1_WFRAMEBCHI,
NULL);
- lo = bcmsdh_cfg_read(sdh, SDIO_FUNC_1,
+ lo = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
SBSDIO_FUNC1_WFRAMEBCLO,
NULL);
bus->f1regdata += 2;
@@ -4645,7 +4660,7 @@ clkwait:
brcmu_pktq_mlen(&bus->txq, ~bus->flowcontrol) && txlimit
&& DATAOK(bus)) {
framecnt = rxdone ? txlimit : min(txlimit, dhd_txminmax);
- framecnt = dhdsdio_sendfromq(bus, framecnt);
+ framecnt = brcmf_sdbrcm_sendfromq(bus, framecnt);
txlimit -= framecnt;
}
@@ -4653,9 +4668,9 @@ clkwait:
else await next interrupt */
/* On failed register access, all bets are off:
no resched or interrupts */
- if ((bus->dhd->busstate == DHD_BUS_DOWN) || bcmsdh_regfail(sdh)) {
+ if ((bus->dhd->busstate == DHD_BUS_DOWN) || brcmf_sdcard_regfail(sdh)) {
DHD_ERROR(("%s: failed backplane access over SDIO, halting "
- "operation %d\n", __func__, bcmsdh_regfail(sdh)));
+ "operation %d\n", __func__, brcmf_sdcard_regfail(sdh)));
bus->dhd->busstate = DHD_BUS_DOWN;
bus->intstatus = 0;
} else if (bus->clkstate == CLK_PENDING) {
@@ -4674,7 +4689,7 @@ clkwait:
if ((bus->clkstate != CLK_PENDING)
&& bus->idletime == DHD_IDLE_IMMEDIATE) {
bus->activity = false;
- dhdsdio_clkctl(bus, CLK_NONE, false);
+ brcmf_sdbrcm_clkctl(bus, CLK_NONE, false);
}
dhd_os_sdunlock(bus->dhd);
@@ -4687,13 +4702,13 @@ bool dhd_bus_dpc(struct dhd_bus *bus)
bool resched;
/* Call the DPC directly. */
- DHD_TRACE(("Calling dhdsdio_dpc() from %s\n", __func__));
- resched = dhdsdio_dpc(bus);
+ DHD_TRACE(("Calling brcmf_sdbrcm_dpc() from %s\n", __func__));
+ resched = brcmf_sdbrcm_dpc(bus);
return resched;
}
-void dhdsdio_isr(void *arg)
+void brcmf_sdbrcm_isr(void *arg)
{
dhd_bus_t *bus = (dhd_bus_t *) arg;
bcmsdh_info_t *sdh;
@@ -4725,14 +4740,14 @@ void dhdsdio_isr(void *arg)
if (bus->intr)
DHD_INTR(("%s: disable SDIO interrupts\n", __func__));
else
- DHD_ERROR(("dhdsdio_isr() w/o interrupt configured!\n"));
+ DHD_ERROR(("brcmf_sdbrcm_isr() w/o interrupt configured!\n"));
- bcmsdh_intr_disable(sdh);
+ brcmf_sdcard_intr_disable(sdh);
bus->intdis = true;
#if defined(SDIO_ISR_THREAD)
- DHD_TRACE(("Calling dhdsdio_dpc() from %s\n", __func__));
- while (dhdsdio_dpc(bus))
+ DHD_TRACE(("Calling brcmf_sdbrcm_dpc() from %s\n", __func__));
+ while (brcmf_sdbrcm_dpc(bus))
;
#else
bus->dpc_sched = true;
@@ -4742,7 +4757,7 @@ void dhdsdio_isr(void *arg)
}
#ifdef SDTEST
-static void dhdsdio_pktgen_init(dhd_bus_t *bus)
+static void brcmf_sdbrcm_pktgen_init(dhd_bus_t *bus)
{
/* Default to specified length, or full range */
if (dhd_pktgen_len) {
@@ -4764,7 +4779,7 @@ static void dhdsdio_pktgen_init(dhd_bus_t *bus)
bus->pktgen_stop = 1;
}
-static void dhdsdio_pktgen(dhd_bus_t *bus)
+static void brcmf_sdbrcm_pktgen(dhd_bus_t *bus)
{
struct sk_buff *pkt;
u8 *data;
@@ -4782,7 +4797,7 @@ static void dhdsdio_pktgen(dhd_bus_t *bus)
/* For recv mode, just make sure dongle has started sending */
if (bus->pktgen_mode == DHD_PKTGEN_RECV) {
if (!bus->pktgen_rcvd)
- dhdsdio_sdtest_set(bus, true);
+ brcmf_sdbrcm_sdtest_set(bus, true);
return;
}
@@ -4847,14 +4862,14 @@ static void dhdsdio_pktgen(dhd_bus_t *bus)
#ifdef DHD_DEBUG
if (DHD_BYTES_ON() && DHD_DATA_ON()) {
data = (u8 *) (pkt->data) + SDPCM_HDRLEN;
- printk(KERN_DEBUG "dhdsdio_pktgen: Tx Data:\n");
+ printk(KERN_DEBUG "brcmf_sdbrcm_pktgen: Tx Data:\n");
print_hex_dump_bytes("", DUMP_PREFIX_OFFSET, data,
pkt->len - SDPCM_HDRLEN);
}
#endif
/* Send it */
- if (dhdsdio_txpkt(bus, pkt, SDPCM_TEST_CHANNEL, true)) {
+ if (brcmf_sdbrcm_txpkt(bus, pkt, SDPCM_TEST_CHANNEL, true)) {
bus->pktgen_fail++;
if (bus->pktgen_stop
&& bus->pktgen_stop == bus->pktgen_fail)
@@ -4872,7 +4887,7 @@ static void dhdsdio_pktgen(dhd_bus_t *bus)
}
}
-static void dhdsdio_sdtest_set(dhd_bus_t *bus, bool start)
+static void brcmf_sdbrcm_sdtest_set(dhd_bus_t *bus, bool start)
{
struct sk_buff *pkt;
u8 *data;
@@ -4894,11 +4909,12 @@ static void dhdsdio_sdtest_set(dhd_bus_t *bus, bool start)
*data++ = (bus->pktgen_maxlen >> 8);
/* Send it */
- if (dhdsdio_txpkt(bus, pkt, SDPCM_TEST_CHANNEL, true))
+ if (brcmf_sdbrcm_txpkt(bus, pkt, SDPCM_TEST_CHANNEL, true))
bus->pktgen_fail++;
}
-static void dhdsdio_testrcv(dhd_bus_t *bus, struct sk_buff *pkt, uint seq)
+static void
+brcmf_sdbrcm_checkdied(dhd_bus_t *bus, struct sk_buff *pkt, uint seq)
{
u8 *data;
uint pktlen;
@@ -4911,8 +4927,8 @@ static void dhdsdio_testrcv(dhd_bus_t *bus, struct sk_buff *pkt, uint seq)
/* Check for min length */
pktlen = pkt->len;
if (pktlen < SDPCM_TEST_HDRLEN) {
- DHD_ERROR(("dhdsdio_restrcv: toss runt frame, pktlen %d\n",
- pktlen));
+ DHD_ERROR(("brcmf_sdbrcm_checkdied: toss runt frame, pktlen "
+ "%d\n", pktlen));
brcmu_pkt_buf_free_skb(pkt, false);
return;
}
@@ -4928,8 +4944,9 @@ static void dhdsdio_testrcv(dhd_bus_t *bus, struct sk_buff *pkt, uint seq)
if (cmd == SDPCM_TEST_DISCARD || cmd == SDPCM_TEST_ECHOREQ
|| cmd == SDPCM_TEST_ECHORSP) {
if (pktlen != len + SDPCM_TEST_HDRLEN) {
- DHD_ERROR(("dhdsdio_testrcv: frame length mismatch, "
- "pktlen %d seq %d" " cmd %d extra %d len %d\n",
+ DHD_ERROR(("brcmf_sdbrcm_checkdied: frame length "
+ "mismatch, pktlen %d seq %d" " cmd %d extra %d "
+ "len %d\n",
pktlen, seq, cmd, extra, len));
brcmu_pkt_buf_free_skb(pkt, false);
return;
@@ -4942,9 +4959,9 @@ static void dhdsdio_testrcv(dhd_bus_t *bus, struct sk_buff *pkt, uint seq)
/* Rx->Tx turnaround ok (even on NDIS w/current
implementation) */
*(u8 *) (pkt->data) = SDPCM_TEST_ECHORSP;
- if (dhdsdio_txpkt(bus, pkt, SDPCM_TEST_CHANNEL, true) == 0) {
+ if (brcmf_sdbrcm_txpkt(bus, pkt, SDPCM_TEST_CHANNEL, true) == 0)
bus->pktgen_sent++;
- } else {
+ else {
bus->pktgen_fail++;
brcmu_pkt_buf_free_skb(pkt, false);
}
@@ -4960,9 +4977,12 @@ static void dhdsdio_testrcv(dhd_bus_t *bus, struct sk_buff *pkt, uint seq)
for (offset = 0; offset < len; offset++, data++) {
if (*data != SDPCM_TEST_FILL(offset, extra)) {
- DHD_ERROR(("dhdsdio_testrcv: echo data mismatch: " "offset %d (len %d) expect 0x%02x rcvd 0x%02x\n",
- offset, len,
- SDPCM_TEST_FILL(offset, extra), *data));
+ DHD_ERROR(("brcmf_sdbrcm_checkdied: echo data "
+ "mismatch: " "offset %d (len %d) "
+ "expect 0x%02x rcvd 0x%02x\n",
+ offset, len,
+ SDPCM_TEST_FILL(offset, extra),
+ *data));
break;
}
}
@@ -4978,8 +4998,8 @@ static void dhdsdio_testrcv(dhd_bus_t *bus, struct sk_buff *pkt, uint seq)
case SDPCM_TEST_BURST:
case SDPCM_TEST_SEND:
default:
- DHD_INFO(("dhdsdio_testrcv: unsupported or unknown command, "
- "pktlen %d seq %d" " cmd %d extra %d len %d\n",
+ DHD_INFO(("brcmf_sdbrcm_checkdied: unsupported or unknown "
+ "command, pktlen %d seq %d" " cmd %d extra %d len %d\n",
pktlen, seq, cmd, extra, len));
brcmu_pkt_buf_free_skb(pkt, false);
break;
@@ -4990,13 +5010,13 @@ static void dhdsdio_testrcv(dhd_bus_t *bus, struct sk_buff *pkt, uint seq)
if (bus->pktgen_total
&& (bus->pktgen_rcvd >= bus->pktgen_total)) {
bus->pktgen_count = 0;
- dhdsdio_sdtest_set(bus, false);
+ brcmf_sdbrcm_sdtest_set(bus, false);
}
}
}
#endif /* SDTEST */
-extern bool dhd_bus_watchdog(dhd_pub_t *dhdp)
+extern bool brcmf_sdbrcm_bus_watchdog(dhd_pub_t *dhdp)
{
dhd_bus_t *bus;
@@ -5025,9 +5045,9 @@ extern bool dhd_bus_watchdog(dhd_pub_t *dhdp)
if (!bus->dpc_sched) {
u8 devpend;
- devpend = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_0,
- SDIO_CCCR_INTx,
- NULL);
+ devpend = brcmf_sdcard_cfg_read(bus->sdh,
+ SDIO_FUNC_0, SDIO_CCCR_INTx,
+ NULL);
intstatus =
devpend & (INTR_STATUS_FUNC1 |
INTR_STATUS_FUNC2);
@@ -5039,7 +5059,7 @@ extern bool dhd_bus_watchdog(dhd_pub_t *dhdp)
bus->pollcnt++;
bus->ipend = true;
if (bus->intr)
- bcmsdh_intr_disable(bus->sdh);
+ brcmf_sdcard_intr_disable(bus->sdh);
bus->dpc_sched = true;
dhd_sched_dpc(bus->dhd);
@@ -5057,8 +5077,8 @@ extern bool dhd_bus_watchdog(dhd_pub_t *dhdp)
if (bus->console.count >= dhd_console_ms) {
bus->console.count -= dhd_console_ms;
/* Make sure backplane clock is on */
- dhdsdio_clkctl(bus, CLK_AVAIL, false);
- if (dhdsdio_readconsole(bus) < 0)
+ brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
+ if (brcmf_sdbrcm_readconsole(bus) < 0)
dhd_console_ms = 0; /* On error,
stop trying */
}
@@ -5069,9 +5089,9 @@ extern bool dhd_bus_watchdog(dhd_pub_t *dhdp)
/* Generate packets if configured */
if (bus->pktgen_count && (++bus->pktgen_tick >= bus->pktgen_freq)) {
/* Make sure backplane clock is on */
- dhdsdio_clkctl(bus, CLK_AVAIL, false);
+ brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
bus->pktgen_tick = 0;
- dhdsdio_pktgen(bus);
+ brcmf_sdbrcm_pktgen(bus);
}
#endif
@@ -5083,7 +5103,7 @@ extern bool dhd_bus_watchdog(dhd_pub_t *dhdp)
bus->activity = false;
dhd_os_wd_timer(bus->dhd, dhd_watchdog_ms);
} else {
- dhdsdio_clkctl(bus, CLK_NONE, false);
+ brcmf_sdbrcm_clkctl(bus, CLK_NONE, false);
}
}
}
@@ -5094,7 +5114,8 @@ extern bool dhd_bus_watchdog(dhd_pub_t *dhdp)
}
#ifdef DHD_DEBUG
-extern int dhd_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg, uint msglen)
+extern int brcmf_sdbrcm_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg,
+ uint msglen)
{
dhd_bus_t *bus = dhdp->bus;
u32 addr, val;
@@ -5117,25 +5138,25 @@ extern int dhd_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg, uint msglen)
/* Request clock to allow SDIO accesses */
BUS_WAKE(bus);
/* No pend allowed since txpkt is called later, ht clk has to be on */
- dhdsdio_clkctl(bus, CLK_AVAIL, false);
+ brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
/* Zero cbuf_index */
addr = bus->console_addr + offsetof(rte_cons_t, cbuf_idx);
val = cpu_to_le32(0);
- rv = dhdsdio_membytes(bus, true, addr, (u8 *)&val, sizeof(val));
+ rv = brcmf_sdbrcm_membytes(bus, true, addr, (u8 *)&val, sizeof(val));
if (rv < 0)
goto done;
/* Write message into cbuf */
addr = bus->console_addr + offsetof(rte_cons_t, cbuf);
- rv = dhdsdio_membytes(bus, true, addr, (u8 *)msg, msglen);
+ rv = brcmf_sdbrcm_membytes(bus, true, addr, (u8 *)msg, msglen);
if (rv < 0)
goto done;
/* Write length into vcons_in */
addr = bus->console_addr + offsetof(rte_cons_t, vcons_in);
val = cpu_to_le32(msglen);
- rv = dhdsdio_membytes(bus, true, addr, (u8 *)&val, sizeof(val));
+ rv = brcmf_sdbrcm_membytes(bus, true, addr, (u8 *)&val, sizeof(val));
if (rv < 0)
goto done;
@@ -5144,12 +5165,12 @@ extern int dhd_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg, uint msglen)
*/
pkt = brcmu_pkt_buf_get_skb(4 + SDPCM_RESERVE);
if ((pkt != NULL) && bus->clkstate == CLK_AVAIL)
- dhdsdio_txpkt(bus, pkt, SDPCM_EVENT_CHANNEL, true);
+ brcmf_sdbrcm_txpkt(bus, pkt, SDPCM_EVENT_CHANNEL, true);
done:
if ((bus->idletime == DHD_IDLE_IMMEDIATE) && !bus->dpc_sched) {
bus->activity = false;
- dhdsdio_clkctl(bus, CLK_NONE, true);
+ brcmf_sdbrcm_clkctl(bus, CLK_NONE, true);
}
dhd_os_sdunlock(bus->dhd);
@@ -5158,7 +5179,7 @@ done:
}
#endif /* DHD_DEBUG */
-static bool dhdsdio_chipmatch(u16 chipid)
+static bool brcmf_sdbrcm_chipmatch(u16 chipid)
{
if (chipid == BCM4325_CHIP_ID)
return true;
@@ -5169,7 +5190,7 @@ static bool dhdsdio_chipmatch(u16 chipid)
return false;
}
-static void *dhdsdio_probe(u16 venid, u16 devid, u16 bus_no,
+static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
u16 slot, u16 func, uint bustype, void *regsva,
void *sdh)
{
@@ -5261,8 +5282,8 @@ static void *dhdsdio_probe(u16 venid, u16 devid, u16 bus_no,
else use locally malloced rxbuf */
/* attempt to attach to the dongle */
- if (!(dhdsdio_probe_attach(bus, sdh, regsva, devid))) {
- DHD_ERROR(("%s: dhdsdio_probe_attach failed\n", __func__));
+ if (!(brcmf_sdbrcm_probe_attach(bus, sdh, regsva, devid))) {
+ DHD_ERROR(("%s: brcmf_sdbrcm_probe_attach failed\n", __func__));
goto fail;
}
@@ -5276,21 +5297,21 @@ static void *dhdsdio_probe(u16 venid, u16 devid, u16 bus_no,
}
/* Allocate buffers */
- if (!(dhdsdio_probe_malloc(bus, sdh))) {
- DHD_ERROR(("%s: dhdsdio_probe_malloc failed\n", __func__));
+ if (!(brcmf_sdbrcm_probe_malloc(bus, sdh))) {
+ DHD_ERROR(("%s: brcmf_sdbrcm_probe_malloc failed\n", __func__));
goto fail;
}
- if (!(dhdsdio_probe_init(bus, sdh))) {
- DHD_ERROR(("%s: dhdsdio_probe_init failed\n", __func__));
+ if (!(brcmf_sdbrcm_probe_init(bus, sdh))) {
+ DHD_ERROR(("%s: brcmf_sdbrcm_probe_init failed\n", __func__));
goto fail;
}
/* Register interrupt callback, but mask it (not operational yet). */
DHD_INTR(("%s: disable SDIO interrupts (not interested yet)\n",
__func__));
- bcmsdh_intr_disable(sdh);
- ret = bcmsdh_intr_reg(sdh, dhdsdio_isr, bus);
+ brcmf_sdcard_intr_disable(sdh);
+ ret = brcmf_sdcard_intr_reg(sdh, brcmf_sdbrcm_isr, bus);
if (ret != 0) {
DHD_ERROR(("%s: FAILED: bcmsdh_intr_reg returned %d\n",
__func__, ret));
@@ -5317,12 +5338,13 @@ static void *dhdsdio_probe(u16 venid, u16 devid, u16 bus_no,
return bus;
fail:
- dhdsdio_release(bus);
+ brcmf_sdbrcm_release(bus);
return NULL;
}
static bool
-dhdsdio_probe_attach(struct dhd_bus *bus, void *sdh, void *regsva, u16 devid)
+brcmf_sdbrcm_probe_attach(struct dhd_bus *bus, void *sdh, void *regsva,
+ u16 devid)
{
u8 clkctl = 0;
int err = 0;
@@ -5330,52 +5352,52 @@ dhdsdio_probe_attach(struct dhd_bus *bus, void *sdh, void *regsva, u16 devid)
bus->alp_only = true;
/* Return the window to backplane enumeration space for core access */
- if (dhdsdio_set_siaddr_window(bus, SI_ENUM_BASE))
+ if (brcmf_sdbrcm_set_siaddr_window(bus, SI_ENUM_BASE))
DHD_ERROR(("%s: FAILED to return to SI_ENUM_BASE\n", __func__));
#ifdef DHD_DEBUG
printk(KERN_DEBUG "F1 signature read @0x18000000=0x%4x\n",
- bcmsdh_reg_read(bus->sdh, SI_ENUM_BASE, 4));
+ brcmf_sdcard_reg_read(bus->sdh, SI_ENUM_BASE, 4));
#endif /* DHD_DEBUG */
/*
- * Force PLL off until dhdsdio_chip_attach()
+ * Force PLL off until brcmf_sdbrcm_chip_attach()
* programs PLL control regs
*/
- bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
+ brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
DHD_INIT_CLKCTL1, &err);
if (!err)
clkctl =
- bcmsdh_cfg_read(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
- &err);
+ brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
+ SBSDIO_FUNC1_CHIPCLKCSR, &err);
if (err || ((clkctl & ~SBSDIO_AVBITS) != DHD_INIT_CLKCTL1)) {
- DHD_ERROR(("dhdsdio_probe: ChipClkCSR access: err %d wrote "
- "0x%02x read 0x%02x\n",
+ DHD_ERROR(("brcmf_sdbrcm_probe: ChipClkCSR access: err %d wrote"
+ " 0x%02x read 0x%02x\n",
err, DHD_INIT_CLKCTL1, clkctl));
goto fail;
}
- if (dhdsdio_chip_attach(bus, regsva)) {
- DHD_ERROR(("%s: dhdsdio_chip_attach failed!\n", __func__));
+ if (brcmf_sdbrcm_chip_attach(bus, regsva)) {
+ DHD_ERROR(("%s: brcmf_sdbrcm_chip_attach failed!\n", __func__));
goto fail;
}
- bcmsdh_chipinfo(sdh, bus->ci->chip, bus->ci->chiprev);
+ brcmf_sdcard_chipinfo(sdh, bus->ci->chip, bus->ci->chiprev);
- if (!dhdsdio_chipmatch((u16) bus->ci->chip)) {
+ if (!brcmf_sdbrcm_chipmatch((u16) bus->ci->chip)) {
DHD_ERROR(("%s: unsupported chip: 0x%04x\n",
__func__, bus->ci->chip));
goto fail;
}
- dhdsdio_sdiod_drive_strength_init(bus, dhd_sdiod_drive_strength);
+ brcmf_sdbrcm_sdiod_drive_strength_init(bus, dhd_sdiod_drive_strength);
/* Get info on the ARM and SOCRAM cores... */
if (!DHD_NOPMU(bus)) {
- bus->armrev = SBCOREREV(bcmsdh_reg_read(bus->sdh,
+ bus->armrev = SBCOREREV(brcmf_sdcard_reg_read(bus->sdh,
CORE_SB(bus->ci->armcorebase, sbidhigh), 4));
bus->orig_ramsize = bus->ci->ramsize;
if (!(bus->orig_ramsize)) {
@@ -5385,7 +5407,7 @@ dhdsdio_probe_attach(struct dhd_bus *bus, void *sdh, void *regsva, u16 devid)
}
bus->ramsize = bus->orig_ramsize;
if (dhd_dongle_memsize)
- dhd_dongle_setmemsize(bus, dhd_dongle_memsize);
+ brcmf_sdbrcm_setmemsize(bus, dhd_dongle_memsize);
DHD_ERROR(("DHD: dongle ram size is set to %d(orig %d)\n",
bus->ramsize, bus->orig_ramsize));
@@ -5413,7 +5435,7 @@ fail:
return false;
}
-static bool dhdsdio_probe_malloc(dhd_bus_t *bus, void *sdh)
+static bool brcmf_sdbrcm_probe_malloc(dhd_bus_t *bus, void *sdh)
{
DHD_TRACE(("%s: Enter\n", __func__));
@@ -5454,19 +5476,19 @@ fail:
return false;
}
-static bool dhdsdio_probe_init(dhd_bus_t *bus, void *sdh)
+static bool brcmf_sdbrcm_probe_init(dhd_bus_t *bus, void *sdh)
{
s32 fnum;
DHD_TRACE(("%s: Enter\n", __func__));
#ifdef SDTEST
- dhdsdio_pktgen_init(bus);
+ brcmf_sdbrcm_pktgen_init(bus);
#endif /* SDTEST */
/* Disable F2 to clear any intermediate frame state on the dongle */
- bcmsdh_cfg_write(sdh, SDIO_FUNC_0, SDIO_CCCR_IOEx, SDIO_FUNC_ENABLE_1,
- NULL);
+ brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_0, SDIO_CCCR_IOEx,
+ SDIO_FUNC_ENABLE_1, NULL);
bus->dhd->busstate = DHD_BUS_DOWN;
bus->sleeping = false;
@@ -5474,7 +5496,8 @@ static bool dhdsdio_probe_init(dhd_bus_t *bus, void *sdh)
bus->prev_rxlim_hit = 0;
/* Done with backplane-dependent accesses, can drop clock... */
- bcmsdh_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, 0, NULL);
+ brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, 0,
+ NULL);
/* ...and initialize clock/power states */
bus->clkstate = CLK_SDONLY;
@@ -5483,7 +5506,7 @@ static bool dhdsdio_probe_init(dhd_bus_t *bus, void *sdh)
/* Query the F2 block size, set roundup accordingly */
fnum = 2;
- if (bcmsdh_iovar_op(sdh, "sd_blocksize", &fnum, sizeof(s32),
+ if (brcmf_sdcard_iovar_op(sdh, "sd_blocksize", &fnum, sizeof(s32),
&bus->blocksize, sizeof(s32), false) != 0) {
bus->blocksize = 0;
DHD_ERROR(("%s: fail on %s get\n", __func__, "sd_blocksize"));
@@ -5495,7 +5518,7 @@ static bool dhdsdio_probe_init(dhd_bus_t *bus, void *sdh)
/* Query if bus module supports packet chaining,
default to use if supported */
- if (bcmsdh_iovar_op(sdh, "sd_rxchain", NULL, 0,
+ if (brcmf_sdcard_iovar_op(sdh, "sd_rxchain", NULL, 0,
&bus->sd_rxchain, sizeof(s32),
false) != 0) {
bus->sd_rxchain = false;
@@ -5516,43 +5539,43 @@ dhd_bus_download_firmware(struct dhd_bus *bus, char *fw_path, char *nv_path)
bus->fw_path = fw_path;
bus->nv_path = nv_path;
- ret = dhdsdio_download_firmware(bus, bus->sdh);
+ ret = brcmf_sdbrcm_download_firmware(bus, bus->sdh);
return ret;
}
static bool
-dhdsdio_download_firmware(struct dhd_bus *bus, void *sdh)
+brcmf_sdbrcm_download_firmware(struct dhd_bus *bus, void *sdh)
{
bool ret;
/* Download the firmware */
- dhdsdio_clkctl(bus, CLK_AVAIL, false);
+ brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
- ret = _dhdsdio_download_firmware(bus) == 0;
+ ret = _brcmf_sdbrcm_download_firmware(bus) == 0;
- dhdsdio_clkctl(bus, CLK_SDONLY, false);
+ brcmf_sdbrcm_clkctl(bus, CLK_SDONLY, false);
return ret;
}
/* Detach and free everything */
-static void dhdsdio_release(dhd_bus_t *bus)
+static void brcmf_sdbrcm_release(dhd_bus_t *bus)
{
DHD_TRACE(("%s: Enter\n", __func__));
if (bus) {
/* De-register interrupt handler */
- bcmsdh_intr_disable(bus->sdh);
- bcmsdh_intr_dereg(bus->sdh);
+ brcmf_sdcard_intr_disable(bus->sdh);
+ brcmf_sdcard_intr_dereg(bus->sdh);
if (bus->dhd) {
dhd_detach(bus->dhd);
- dhdsdio_release_dongle(bus);
+ brcmf_sdbrcm_release_dongle(bus);
bus->dhd = NULL;
}
- dhdsdio_release_malloc(bus);
+ brcmf_sdbrcm_release_malloc(bus);
kfree(bus);
}
@@ -5560,7 +5583,7 @@ static void dhdsdio_release(dhd_bus_t *bus)
DHD_TRACE(("%s: Disconnected\n", __func__));
}
-static void dhdsdio_release_malloc(dhd_bus_t *bus)
+static void brcmf_sdbrcm_release_malloc(dhd_bus_t *bus)
{
DHD_TRACE(("%s: Enter\n", __func__));
@@ -5575,7 +5598,7 @@ static void dhdsdio_release_malloc(dhd_bus_t *bus)
bus->databuf = NULL;
}
-static void dhdsdio_release_dongle(dhd_bus_t *bus)
+static void brcmf_sdbrcm_release_dongle(dhd_bus_t *bus)
{
DHD_TRACE(("%s: Enter\n", __func__));
@@ -5583,9 +5606,9 @@ static void dhdsdio_release_dongle(dhd_bus_t *bus)
return;
if (bus->ci) {
- dhdsdio_clkctl(bus, CLK_AVAIL, false);
- dhdsdio_clkctl(bus, CLK_NONE, false);
- dhdsdio_chip_detach(bus);
+ brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
+ brcmf_sdbrcm_clkctl(bus, CLK_NONE, false);
+ brcmf_sdbrcm_chip_detach(bus);
if (bus->vars && bus->varsz)
kfree(bus->vars);
bus->vars = NULL;
@@ -5594,7 +5617,7 @@ static void dhdsdio_release_dongle(dhd_bus_t *bus)
DHD_TRACE(("%s: Disconnected\n", __func__));
}
-static void dhdsdio_disconnect(void *ptr)
+static void brcmf_sdbrcm_disconnect(void *ptr)
{
dhd_bus_t *bus = (dhd_bus_t *)ptr;
@@ -5602,7 +5625,7 @@ static void dhdsdio_disconnect(void *ptr)
if (bus) {
ASSERT(bus->dhd);
- dhdsdio_release(bus);
+ brcmf_sdbrcm_release(bus);
}
DHD_TRACE(("%s: Disconnected\n", __func__));
@@ -5614,25 +5637,25 @@ static void dhdsdio_disconnect(void *ptr)
*/
static bcmsdh_driver_t dhd_sdio = {
- dhdsdio_probe,
- dhdsdio_disconnect
+ brcmf_sdbrcm_probe,
+ brcmf_sdbrcm_disconnect
};
int dhd_bus_register(void)
{
DHD_TRACE(("%s: Enter\n", __func__));
- return bcmsdh_register(&dhd_sdio);
+ return brcmf_sdio_register(&dhd_sdio);
}
void dhd_bus_unregister(void)
{
DHD_TRACE(("%s: Enter\n", __func__));
- bcmsdh_unregister();
+ brcmf_sdio_unregister();
}
-static int dhdsdio_download_code_file(struct dhd_bus *bus, char *fw_path)
+static int brcmf_sdbrcm_download_code_file(struct dhd_bus *bus, char *fw_path)
{
int bcmerror = -1;
int offset = 0;
@@ -5659,7 +5682,8 @@ static int dhdsdio_download_code_file(struct dhd_bus *bus, char *fw_path)
/* Download image */
while ((len =
dhd_os_get_image_block((char *)memptr, MEMBLOCK, image))) {
- bcmerror = dhdsdio_membytes(bus, true, offset, memptr, len);
+ bcmerror = brcmf_sdbrcm_membytes(bus, true, offset, memptr,
+ len);
if (bcmerror) {
DHD_ERROR(("%s: error %d on writing %d membytes at "
"0x%08x\n", __func__, bcmerror, MEMBLOCK, offset));
@@ -5687,7 +5711,7 @@ err:
* by two NULs.
*/
-static uint process_nvram_vars(char *varbuf, uint len)
+static uint brcmf_process_nvram_vars(char *varbuf, uint len)
{
char *dp;
bool findNewline;
@@ -5750,7 +5774,7 @@ void dhd_bus_set_nvram_params(struct dhd_bus *bus, const char *nvram_params)
bus->nvram_params = nvram_params;
}
-static int dhdsdio_download_nvram(struct dhd_bus *bus)
+static int brcmf_sdbrcm_download_nvram(struct dhd_bus *bus)
{
int bcmerror = -1;
uint len;
@@ -5793,11 +5817,12 @@ static int dhdsdio_download_nvram(struct dhd_bus *bus)
if (len > 0 && len < MEMBLOCK) {
bufp = (char *)memblock;
bufp[len] = 0;
- len = process_nvram_vars(bufp, len);
+ len = brcmf_process_nvram_vars(bufp, len);
bufp += len;
*bufp++ = 0;
if (len)
- bcmerror = dhdsdio_downloadvars(bus, memblock, len + 1);
+ bcmerror = brcmf_sdbrcm_downloadvars(bus, memblock,
+ len + 1);
if (bcmerror) {
DHD_ERROR(("%s: error downloading vars: %d\n",
__func__, bcmerror));
@@ -5817,7 +5842,7 @@ err:
return bcmerror;
}
-static int _dhdsdio_download_firmware(struct dhd_bus *bus)
+static int _brcmf_sdbrcm_download_firmware(struct dhd_bus *bus)
{
int bcmerror = -1;
@@ -5829,14 +5854,14 @@ static int _dhdsdio_download_firmware(struct dhd_bus *bus)
return bcmerror;
/* Keep arm in reset */
- if (dhdsdio_download_state(bus, true)) {
+ if (brcmf_sdbrcm_download_state(bus, true)) {
DHD_ERROR(("%s: error placing ARM core in reset\n", __func__));
goto err;
}
/* External image takes precedence if specified */
if ((bus->fw_path != NULL) && (bus->fw_path[0] != '\0')) {
- if (dhdsdio_download_code_file(bus, bus->fw_path)) {
+ if (brcmf_sdbrcm_download_code_file(bus, bus->fw_path)) {
DHD_ERROR(("%s: dongle image file download failed\n",
__func__));
goto err;
@@ -5856,13 +5881,13 @@ static int _dhdsdio_download_firmware(struct dhd_bus *bus)
/* dhd_bus_set_nvram_params(bus, (char *)&nvram_array); */
/* External nvram takes precedence if specified */
- if (dhdsdio_download_nvram(bus)) {
+ if (brcmf_sdbrcm_download_nvram(bus)) {
DHD_ERROR(("%s: dongle nvram file download failed\n",
__func__));
}
/* Take arm out of reset */
- if (dhdsdio_download_state(bus, false)) {
+ if (brcmf_sdbrcm_download_state(bus, false)) {
DHD_ERROR(("%s: error getting out of ARM core reset\n",
__func__));
goto err;
@@ -5876,11 +5901,11 @@ err:
static int
-dhd_bcmsdh_send_buf(dhd_bus_t *bus, u32 addr, uint fn, uint flags,
+brcmf_sdbrcm_send_buf(dhd_bus_t *bus, u32 addr, uint fn, uint flags,
u8 *buf, uint nbytes, struct sk_buff *pkt,
bcmsdh_cmplt_fn_t complete, void *handle)
{
- return bcmsdh_send_buf
+ return brcmf_sdcard_send_buf
(bus->sdh, addr, fn, flags, buf, nbytes, pkt, complete,
handle);
}
@@ -5918,11 +5943,11 @@ int dhd_bus_devreset(dhd_pub_t *dhdp, u8 flag)
/* Expect app to have torn down any
connection before calling */
/* Stop the bus, disable F2 */
- dhd_bus_stop(bus, false);
+ brcmf_sdbrcm_bus_stop(bus, false);
/* Clean tx/rx buffer pointers,
detach from the dongle */
- dhdsdio_release_dongle(bus);
+ brcmf_sdbrcm_release_dongle(bus);
bus->dhd->dongle_reset = true;
bus->dhd->up = false;
@@ -5939,24 +5964,24 @@ int dhd_bus_devreset(dhd_pub_t *dhdp, u8 flag)
if (bus->dhd->dongle_reset) {
/* Turn on WLAN */
/* Reset SD client */
- bcmsdh_reset(bus->sdh);
+ brcmf_sdcard_reset(bus->sdh);
/* Attempt to re-attach & download */
- if (dhdsdio_probe_attach(bus, bus->sdh,
+ if (brcmf_sdbrcm_probe_attach(bus, bus->sdh,
(u32 *) SI_ENUM_BASE,
bus->cl_devid)) {
/* Attempt to download binary to the dongle */
- if (dhdsdio_probe_init
+ if (brcmf_sdbrcm_probe_init
(bus, bus->sdh)
- && dhdsdio_download_firmware(bus,
+ && brcmf_sdbrcm_download_firmware(bus,
bus->sdh)) {
/* Re-init bus, enable F2 transfer */
- dhd_bus_init((dhd_pub_t *) bus->dhd,
- false);
+ brcmf_sdbrcm_bus_init(
+ (dhd_pub_t *) bus->dhd, false);
#if defined(OOB_INTR_ONLY)
- dhd_enable_oob_intr(bus, true);
+ brcmf_sdbrcm_enable_oob_intr(bus, true);
#endif /* defined(OOB_INTR_ONLY) */
bus->dhd->dongle_reset = false;
@@ -5979,7 +6004,8 @@ int dhd_bus_devreset(dhd_pub_t *dhdp, u8 flag)
}
static int
-dhdsdio_chip_recognition(bcmsdh_info_t *sdh, struct chip_info *ci, void *regs)
+brcmf_sdbrcm_chip_recognition(bcmsdh_info_t *sdh, struct chip_info *ci,
+ void *regs)
{
u32 regdata;
@@ -5990,7 +6016,8 @@ dhdsdio_chip_recognition(bcmsdh_info_t *sdh, struct chip_info *ci, void *regs)
* other ways of recognition should be added here.
*/
ci->cccorebase = (u32)regs;
- regdata = bcmsdh_reg_read(sdh, CORE_CC_REG(ci->cccorebase, chipid), 4);
+ regdata = brcmf_sdcard_reg_read(sdh,
+ CORE_CC_REG(ci->cccorebase, chipid), 4);
ci->chip = regdata & CID_ID_MASK;
ci->chiprev = (regdata & CID_REV_MASK) >> CID_REV_SHIFT;
@@ -6011,15 +6038,16 @@ dhdsdio_chip_recognition(bcmsdh_info_t *sdh, struct chip_info *ci, void *regs)
return -ENODEV;
}
- regdata = bcmsdh_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(sdh,
CORE_SB(ci->cccorebase, sbidhigh), 4);
ci->ccrev = SBCOREREV(regdata);
- regdata = bcmsdh_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(sdh,
CORE_CC_REG(ci->cccorebase, pmucapabilities), 4);
ci->pmurev = regdata & PCAP_REV_MASK;
- regdata = bcmsdh_reg_read(sdh, CORE_SB(ci->buscorebase, sbidhigh), 4);
+ regdata = brcmf_sdcard_reg_read(sdh,
+ CORE_SB(ci->buscorebase, sbidhigh), 4);
ci->buscorerev = SBCOREREV(regdata);
ci->buscoretype = (regdata & SBIDH_CC_MASK) >> SBIDH_CC_SHIFT;
@@ -6028,93 +6056,93 @@ dhdsdio_chip_recognition(bcmsdh_info_t *sdh, struct chip_info *ci, void *regs)
ci->buscorerev, ci->buscoretype));
/* get chipcommon capabilites */
- ci->cccaps = bcmsdh_reg_read(sdh,
+ ci->cccaps = brcmf_sdcard_reg_read(sdh,
CORE_CC_REG(ci->cccorebase, capabilities), 4);
return 0;
}
static void
-dhdsdio_chip_disablecore(bcmsdh_info_t *sdh, u32 corebase)
+brcmf_sdbrcm_chip_disablecore(bcmsdh_info_t *sdh, u32 corebase)
{
u32 regdata;
- regdata = bcmsdh_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(sdh,
CORE_SB(corebase, sbtmstatelow), 4);
if (regdata & SBTML_RESET)
return;
- regdata = bcmsdh_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(sdh,
CORE_SB(corebase, sbtmstatelow), 4);
if ((regdata & (SICF_CLOCK_EN << SBTML_SICF_SHIFT)) != 0) {
/*
* set target reject and spin until busy is clear
* (preserve core-specific bits)
*/
- regdata = bcmsdh_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(sdh,
CORE_SB(corebase, sbtmstatelow), 4);
- bcmsdh_reg_write(sdh, CORE_SB(corebase, sbtmstatelow), 4,
+ brcmf_sdcard_reg_write(sdh, CORE_SB(corebase, sbtmstatelow), 4,
regdata | SBTML_REJ);
- regdata = bcmsdh_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(sdh,
CORE_SB(corebase, sbtmstatelow), 4);
udelay(1);
- SPINWAIT((bcmsdh_reg_read(sdh,
+ SPINWAIT((brcmf_sdcard_reg_read(sdh,
CORE_SB(corebase, sbtmstatehigh), 4) &
SBTMH_BUSY), 100000);
- regdata = bcmsdh_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(sdh,
CORE_SB(corebase, sbtmstatehigh), 4);
if (regdata & SBTMH_BUSY)
DHD_ERROR(("%s: ARM core still busy\n", __func__));
- regdata = bcmsdh_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(sdh,
CORE_SB(corebase, sbidlow), 4);
if (regdata & SBIDL_INIT) {
- regdata = bcmsdh_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(sdh,
CORE_SB(corebase, sbimstate), 4) |
SBIM_RJ;
- bcmsdh_reg_write(sdh,
+ brcmf_sdcard_reg_write(sdh,
CORE_SB(corebase, sbimstate), 4,
regdata);
- regdata = bcmsdh_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(sdh,
CORE_SB(corebase, sbimstate), 4);
udelay(1);
- SPINWAIT((bcmsdh_reg_read(sdh,
+ SPINWAIT((brcmf_sdcard_reg_read(sdh,
CORE_SB(corebase, sbimstate), 4) &
SBIM_BY), 100000);
}
/* set reset and reject while enabling the clocks */
- bcmsdh_reg_write(sdh,
+ brcmf_sdcard_reg_write(sdh,
CORE_SB(corebase, sbtmstatelow), 4,
(((SICF_FGC | SICF_CLOCK_EN) << SBTML_SICF_SHIFT) |
SBTML_REJ | SBTML_RESET));
- regdata = bcmsdh_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(sdh,
CORE_SB(corebase, sbtmstatelow), 4);
udelay(10);
/* clear the initiator reject bit */
- regdata = bcmsdh_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(sdh,
CORE_SB(corebase, sbidlow), 4);
if (regdata & SBIDL_INIT) {
- regdata = bcmsdh_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(sdh,
CORE_SB(corebase, sbimstate), 4) &
~SBIM_RJ;
- bcmsdh_reg_write(sdh,
+ brcmf_sdcard_reg_write(sdh,
CORE_SB(corebase, sbimstate), 4,
regdata);
}
}
/* leave reset and reject asserted */
- bcmsdh_reg_write(sdh, CORE_SB(corebase, sbtmstatelow), 4,
+ brcmf_sdcard_reg_write(sdh, CORE_SB(corebase, sbtmstatelow), 4,
(SBTML_REJ | SBTML_RESET));
udelay(1);
}
static int
-dhdsdio_chip_attach(struct dhd_bus *bus, void *regs)
+brcmf_sdbrcm_chip_attach(struct dhd_bus *bus, void *regs)
{
struct chip_info *ci;
int err;
@@ -6134,7 +6162,7 @@ dhdsdio_chip_attach(struct dhd_bus *bus, void *regs)
/* bus/core/clk setup for register access */
/* Try forcing SDIO core to do ALPAvail request only */
clkset = SBSDIO_FORCE_HW_CLKREQ_OFF | SBSDIO_ALP_AVAIL_REQ;
- bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
+ brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
clkset, &err);
if (err) {
DHD_ERROR(("%s: error writing for HT off\n", __func__));
@@ -6143,11 +6171,11 @@ dhdsdio_chip_attach(struct dhd_bus *bus, void *regs)
/* If register supported, wait for ALPAvail and then force ALP */
/* This may take up to 15 milliseconds */
- clkval = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1,
+ clkval = brcmf_sdcard_cfg_read(bus->sdh, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR, NULL);
if ((clkval & ~SBSDIO_AVBITS) == clkset) {
SPINWAIT(((clkval =
- bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_read(bus->sdh, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR,
NULL)),
!SBSDIO_ALPAV(clkval)),
@@ -6160,7 +6188,7 @@ dhdsdio_chip_attach(struct dhd_bus *bus, void *regs)
}
clkset = SBSDIO_FORCE_HW_CLKREQ_OFF |
SBSDIO_FORCE_ALP;
- bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR,
clkset, &err);
udelay(65);
@@ -6172,10 +6200,10 @@ dhdsdio_chip_attach(struct dhd_bus *bus, void *regs)
}
/* Also, disable the extra SDIO pull-ups */
- bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SDIOPULLUP, 0,
- NULL);
+ brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SDIOPULLUP,
+ 0, NULL);
- err = dhdsdio_chip_recognition(bus->sdh, ci, regs);
+ err = brcmf_sdbrcm_chip_recognition(bus->sdh, ci, regs);
if (err)
goto fail;
@@ -6183,24 +6211,24 @@ dhdsdio_chip_attach(struct dhd_bus *bus, void *regs)
* Make sure any on-chip ARM is off (in case strapping is wrong),
* or downloaded code was already running.
*/
- dhdsdio_chip_disablecore(bus->sdh, ci->armcorebase);
+ brcmf_sdbrcm_chip_disablecore(bus->sdh, ci->armcorebase);
- bcmsdh_reg_write(bus->sdh,
+ brcmf_sdcard_reg_write(bus->sdh,
CORE_CC_REG(ci->cccorebase, gpiopullup), 4, 0);
- bcmsdh_reg_write(bus->sdh,
+ brcmf_sdcard_reg_write(bus->sdh,
CORE_CC_REG(ci->cccorebase, gpiopulldown), 4, 0);
/* Disable F2 to clear any intermediate frame state on the dongle */
- bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_0, SDIO_CCCR_IOEx,
+ brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_0, SDIO_CCCR_IOEx,
SDIO_FUNC_ENABLE_1, NULL);
/* WAR: cmd52 backplane read so core HW will drop ALPReq */
- clkval = bcmsdh_cfg_read(bus->sdh, SDIO_FUNC_1,
+ clkval = brcmf_sdcard_cfg_read(bus->sdh, SDIO_FUNC_1,
0, NULL);
/* Done with backplane-dependent accesses, can drop clock... */
- bcmsdh_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, 0,
- NULL);
+ brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
+ 0, NULL);
bus->ci = ci;
return 0;
@@ -6211,7 +6239,7 @@ fail:
}
static void
-dhdsdio_chip_resetcore(bcmsdh_info_t *sdh, u32 corebase)
+brcmf_sdbrcm_chip_resetcore(bcmsdh_info_t *sdh, u32 corebase)
{
u32 regdata;
@@ -6219,35 +6247,37 @@ dhdsdio_chip_resetcore(bcmsdh_info_t *sdh, u32 corebase)
* Must do the disable sequence first to work for
* arbitrary current core state.
*/
- dhdsdio_chip_disablecore(sdh, corebase);
+ brcmf_sdbrcm_chip_disablecore(sdh, corebase);
/*
* Now do the initialization sequence.
* set reset while enabling the clock and
* forcing them on throughout the core
*/
- bcmsdh_reg_write(sdh, CORE_SB(corebase, sbtmstatelow), 4,
+ brcmf_sdcard_reg_write(sdh, CORE_SB(corebase, sbtmstatelow), 4,
((SICF_FGC | SICF_CLOCK_EN) << SBTML_SICF_SHIFT) |
SBTML_RESET);
udelay(1);
- regdata = bcmsdh_reg_read(sdh, CORE_SB(corebase, sbtmstatehigh), 4);
+ regdata = brcmf_sdcard_reg_read(sdh, CORE_SB(corebase, sbtmstatehigh),
+ 4);
if (regdata & SBTMH_SERR)
- bcmsdh_reg_write(sdh, CORE_SB(corebase, sbtmstatehigh), 4, 0);
+ brcmf_sdcard_reg_write(sdh, CORE_SB(corebase, sbtmstatehigh),
+ 4, 0);
- regdata = bcmsdh_reg_read(sdh, CORE_SB(corebase, sbimstate), 4);
+ regdata = brcmf_sdcard_reg_read(sdh, CORE_SB(corebase, sbimstate), 4);
if (regdata & (SBIM_IBE | SBIM_TO))
- bcmsdh_reg_write(sdh, CORE_SB(corebase, sbimstate), 4,
+ brcmf_sdcard_reg_write(sdh, CORE_SB(corebase, sbimstate), 4,
regdata & ~(SBIM_IBE | SBIM_TO));
/* clear reset and allow it to propagate throughout the core */
- bcmsdh_reg_write(sdh, CORE_SB(corebase, sbtmstatelow), 4,
+ brcmf_sdcard_reg_write(sdh, CORE_SB(corebase, sbtmstatelow), 4,
(SICF_FGC << SBTML_SICF_SHIFT) |
(SICF_CLOCK_EN << SBTML_SICF_SHIFT));
udelay(1);
/* leave clock enabled */
- bcmsdh_reg_write(sdh, CORE_SB(corebase, sbtmstatelow), 4,
+ brcmf_sdcard_reg_write(sdh, CORE_SB(corebase, sbtmstatelow), 4,
(SICF_CLOCK_EN << SBTML_SICF_SHIFT));
udelay(1);
}
@@ -6295,7 +6325,7 @@ static const struct sdiod_drive_str sdiod_drive_strength_tab3[] = {
#define SDIOD_DRVSTR_KEY(chip, pmu) (((chip) << 16) | (pmu))
static void
-dhdsdio_sdiod_drive_strength_init(struct dhd_bus *bus, u32 drivestrength) {
+brcmf_sdbrcm_sdiod_drive_strength_init(struct dhd_bus *bus, u32 drivestrength) {
struct sdiod_drive_str *str_tab = NULL;
u32 str_mask = 0;
u32 str_shift = 0;
@@ -6341,15 +6371,15 @@ dhdsdio_sdiod_drive_strength_init(struct dhd_bus *bus, u32 drivestrength) {
}
}
- bcmsdh_reg_write(bus->sdh,
+ brcmf_sdcard_reg_write(bus->sdh,
CORE_CC_REG(bus->ci->cccorebase, chipcontrol_addr),
4, 1);
- cc_data_temp = bcmsdh_reg_read(bus->sdh,
+ cc_data_temp = brcmf_sdcard_reg_read(bus->sdh,
CORE_CC_REG(bus->ci->cccorebase, chipcontrol_addr), 4);
cc_data_temp &= ~str_mask;
drivestrength_sel <<= str_shift;
cc_data_temp |= drivestrength_sel;
- bcmsdh_reg_write(bus->sdh,
+ brcmf_sdcard_reg_write(bus->sdh,
CORE_CC_REG(bus->ci->cccorebase, chipcontrol_addr),
4, cc_data_temp);
@@ -6359,7 +6389,7 @@ dhdsdio_sdiod_drive_strength_init(struct dhd_bus *bus, u32 drivestrength) {
}
static void
-dhdsdio_chip_detach(struct dhd_bus *bus)
+brcmf_sdbrcm_chip_detach(struct dhd_bus *bus)
{
DHD_TRACE(("%s: Enter\n", __func__));
diff --git a/drivers/staging/brcm80211/brcmfmac/sdio_host.h b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
index 7fa79d6..4063508 100644
--- a/drivers/staging/brcm80211/brcmfmac/sdio_host.h
+++ b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
@@ -70,25 +70,26 @@ typedef void (*bcmsdh_cb_fn_t) (void *);
* implementation may maintain a single "default" handle (e.g. the first or
* most recent one) to enable single-instance implementations to pass NULL.
*/
-extern bcmsdh_info_t *bcmsdh_attach(void *cfghdl, void **regsva, uint irq);
+extern bcmsdh_info_t *brcmf_sdcard_attach(void *cfghdl, void **regsva,
+ uint irq);
/* Detach - freeup resources allocated in attach */
-extern int bcmsdh_detach(void *sdh);
+extern int brcmf_sdcard_detach(void *sdh);
/* Query if SD device interrupts are enabled */
-extern bool bcmsdh_intr_query(void *sdh);
+extern bool brcmf_sdcard_intr_query(void *sdh);
/* Enable/disable SD interrupt */
-extern int bcmsdh_intr_enable(void *sdh);
-extern int bcmsdh_intr_disable(void *sdh);
+extern int brcmf_sdcard_intr_enable(void *sdh);
+extern int brcmf_sdcard_intr_disable(void *sdh);
/* Register/deregister device interrupt handler. */
-extern int bcmsdh_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh);
-extern int bcmsdh_intr_dereg(void *sdh);
+extern int brcmf_sdcard_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh);
+extern int brcmf_sdcard_intr_dereg(void *sdh);
#if defined(DHD_DEBUG)
/* Query pending interrupt status from the host controller */
-extern bool bcmsdh_intr_pending(void *sdh);
+extern bool brcmf_sdcard_intr_pending(void *sdh);
#endif
extern int bcmsdh_claim_host_and_lock(void *sdh);
extern int bcmsdh_release_host_and_unlock(void *sdh);
@@ -96,7 +97,7 @@ extern int bcmsdh_release_host_and_unlock(void *sdh);
/* Register a callback to be called if and when bcmsdh detects
* device removal. No-op in the case of non-removable/hardwired devices.
*/
-extern int bcmsdh_devremove_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh);
+extern int brcmf_sdcard_devremove_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh);
/* Access SDIO address space (e.g. CCCR) using CMD52 (single-byte interface).
* fn: function number
@@ -104,14 +105,14 @@ extern int bcmsdh_devremove_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh);
* data: data byte to write
* err: pointer to error code (or NULL)
*/
-extern u8 bcmsdh_cfg_read(void *sdh, uint func, u32 addr, int *err);
-extern void bcmsdh_cfg_write(void *sdh, uint func, u32 addr, u8 data,
+extern u8 brcmf_sdcard_cfg_read(void *sdh, uint func, u32 addr, int *err);
+extern void brcmf_sdcard_cfg_write(void *sdh, uint func, u32 addr, u8 data,
int *err);
/* Read/Write 4bytes from/to cfg space */
-extern u32 bcmsdh_cfg_read_word(void *sdh, uint fnc_num, u32 addr,
+extern u32 brcmf_sdcard_cfg_read_word(void *sdh, uint fnc_num, u32 addr,
int *err);
-extern void bcmsdh_cfg_write_word(void *sdh, uint fnc_num, u32 addr,
+extern void brcmf_sdcard_cfg_write_word(void *sdh, uint fnc_num, u32 addr,
u32 data, int *err);
/* Read CIS content for specified function.
@@ -121,18 +122,18 @@ extern void bcmsdh_cfg_write_word(void *sdh, uint fnc_num, u32 addr,
* Internally, this routine uses the values from the cis base regs (0x9-0xB)
* to form an SDIO-space address to read the data from.
*/
-extern int bcmsdh_cis_read(void *sdh, uint func, u8 *cis, uint length);
+extern int brcmf_sdcard_cis_read(void *sdh, uint func, u8 *cis, uint length);
/* Synchronous access to device (client) core registers via CMD53 to F1.
* addr: backplane address (i.e. >= regsva from attach)
* size: register width in bytes (2 or 4)
* data: data for register write
*/
-extern u32 bcmsdh_reg_read(void *sdh, u32 addr, uint size);
-extern u32 bcmsdh_reg_write(void *sdh, u32 addr, uint size, u32 data);
+extern u32 brcmf_sdcard_reg_read(void *sdh, u32 addr, uint size);
+extern u32 brcmf_sdcard_reg_write(void *sdh, u32 addr, uint size, u32 data);
/* Indicate if last reg read/write failed */
-extern bool bcmsdh_regfail(void *sdh);
+extern bool brcmf_sdcard_regfail(void *sdh);
/* Buffer transfer to/from device (client) core via cmd53.
* fn: function number
@@ -147,12 +148,12 @@ extern bool bcmsdh_regfail(void *sdh);
* NOTE: Async operation is not currently supported.
*/
typedef void (*bcmsdh_cmplt_fn_t) (void *handle, int status, bool sync_waiting);
-extern int bcmsdh_send_buf(void *sdh, u32 addr, uint fn, uint flags,
- u8 *buf, uint nbytes, void *pkt,
- bcmsdh_cmplt_fn_t complete, void *handle);
-extern int bcmsdh_recv_buf(bcmsdh_info_t *sdh, u32 addr, uint fn, uint flags,
- u8 *buf, uint nbytes, struct sk_buff *pkt,
- bcmsdh_cmplt_fn_t complete, void *handle);
+extern int brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags,
+ u8 *buf, uint nbytes, void *pkt,
+ bcmsdh_cmplt_fn_t complete, void *handle);
+extern int brcmf_sdcard_recv_buf(bcmsdh_info_t *sdh, u32 addr, uint fn,
+ uint flags, u8 *buf, uint nbytes, struct sk_buff *pkt,
+ bcmsdh_cmplt_fn_t complete, void *handle);
/* Flags bits */
#define SDIO_REQ_4BYTE 0x1 /* Four-byte target (backplane) width (vs. two-byte) */
@@ -169,35 +170,35 @@ extern int bcmsdh_recv_buf(bcmsdh_info_t *sdh, u32 addr, uint fn, uint flags,
* nbytes: number of bytes to transfer to/from buf
* Returns 0 or error code.
*/
-extern int bcmsdh_rwdata(void *sdh, uint rw, u32 addr, u8 *buf,
+extern int brcmf_sdcard_rwdata(void *sdh, uint rw, u32 addr, u8 *buf,
uint nbytes);
/* Issue an abort to the specified function */
-extern int bcmsdh_abort(void *sdh, uint fn);
+extern int brcmf_sdcard_abort(void *sdh, uint fn);
/* Start SDIO Host Controller communication */
-extern int bcmsdh_start(void *sdh, int stage);
+extern int brcmf_sdcard_start(void *sdh, int stage);
/* Stop SDIO Host Controller communication */
-extern int bcmsdh_stop(void *sdh);
+extern int brcmf_sdcard_stop(void *sdh);
/* Returns the "Device ID" of target device on the SDIO bus. */
-extern int bcmsdh_query_device(void *sdh);
+extern int brcmf_sdcard_query_device(void *sdh);
/* Returns the number of IO functions reported by the device */
-extern uint bcmsdh_query_iofnum(void *sdh);
+extern uint brcmf_sdcard_query_iofnum(void *sdh);
/* Miscellaneous knob tweaker. */
-extern int bcmsdh_iovar_op(void *sdh, const char *name,
+extern int brcmf_sdcard_iovar_op(void *sdh, const char *name,
void *params, int plen, void *arg, int len,
bool set);
/* Reset and reinitialize the device */
-extern int bcmsdh_reset(bcmsdh_info_t *sdh);
+extern int brcmf_sdcard_reset(bcmsdh_info_t *sdh);
/* helper functions */
-extern void *bcmsdh_get_sdioh(bcmsdh_info_t *sdh);
+extern void *brcmf_sdcard_get_sdioh(bcmsdh_info_t *sdh);
/* callback functions */
typedef struct {
@@ -209,18 +210,18 @@ typedef struct {
} bcmsdh_driver_t;
/* platform specific/high level functions */
-extern int bcmsdh_register(bcmsdh_driver_t *driver);
-extern void bcmsdh_unregister(void);
-extern bool bcmsdh_chipmatch(u16 vendor, u16 device);
-extern void bcmsdh_device_remove(void *sdh);
+extern int brcmf_sdio_register(bcmsdh_driver_t *driver);
+extern void brcmf_sdio_unregister(void);
+extern bool brcmf_sdio_chipmatch(u16 vendor, u16 device);
+extern void brcmf_sdio_device_remove(void *sdh);
/* Function to pass device-status bits to DHD. */
-extern u32 bcmsdh_get_dstatus(void *sdh);
+extern u32 brcmf_sdcard_get_dstatus(void *sdh);
/* Function to return current window addr */
-extern u32 bcmsdh_cur_sbwad(void *sdh);
+extern u32 brcmf_sdcard_cur_sbwad(void *sdh);
/* Function to pass chipid and rev to lower layers for controlling pr's */
-extern void bcmsdh_chipinfo(void *sdh, u32 chip, u32 chiprev);
+extern void brcmf_sdcard_chipinfo(void *sdh, u32 chip, u32 chiprev);
#endif /* _BRCM_SDH_H_ */
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index 3bccc22..915546c 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -36,7 +36,7 @@
#include "dhd.h"
#include "wl_cfg80211.h"
-void sdioh_sdio_set_host_pm_flags(int flag);
+void brcmf_sdioh_set_host_pm_flags(int flag);
static struct sdio_func *cfg80211_sdio_func;
static struct wl_dev *wl_cfg80211_dev;
@@ -2155,7 +2155,7 @@ static s32 wl_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow)
clear_bit(WL_STATUS_SCAN_ABORTING, &wl->status);
/* Inform SDIO stack not to switch off power to the chip */
- sdioh_sdio_set_host_pm_flags(MMC_PM_KEEP_POWER);
+ brcmf_sdioh_set_host_pm_flags(MMC_PM_KEEP_POWER);
/* Turn off watchdog timer */
if (test_bit(WL_STATUS_READY, &wl->status)) {
--
1.7.1
From: Roland Vossen <[email protected]>
Code cleanup.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h | 24 ++++++-------
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 30 ++++++++--------
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 36 ++++++++++----------
.../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c | 2 +-
4 files changed, 45 insertions(+), 47 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
index 5d09076..88d0b02 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
@@ -36,8 +36,6 @@
#define SDIOH_DATA_PIO 0 /* PIO mode */
#define SDIOH_DATA_DMA 1 /* DMA mode */
-typedef int SDIOH_API_RC;
-
/* callback function, taking one arg */
typedef void (*sdioh_cb_fn_t) (void *);
@@ -46,17 +44,17 @@ typedef void (*sdioh_cb_fn_t) (void *);
* cfghdl points to the starting address of pci device mapped memory
*/
extern struct sdioh_info *brcmf_sdioh_attach(void *cfghdl, uint irq);
-extern SDIOH_API_RC brcmf_sdioh_detach(struct sdioh_info *si);
-extern SDIOH_API_RC brcmf_sdioh_interrupt_register(struct sdioh_info *si,
+extern int brcmf_sdioh_detach(struct sdioh_info *si);
+extern int brcmf_sdioh_interrupt_register(struct sdioh_info *si,
sdioh_cb_fn_t fn, void *argh);
-extern SDIOH_API_RC brcmf_sdioh_interrupt_deregister(struct sdioh_info *si);
+extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *si);
/* query whether SD interrupt is enabled or not */
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_interrupt_query(struct sdioh_info *si, bool *onoff);
/* enable or disable SD interrupt */
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_interrupt_set(struct sdioh_info *si, bool enable_disable);
#if defined(DHD_DEBUG)
@@ -67,30 +65,30 @@ extern int brcmf_sdioh_claim_host_and_lock(struct sdioh_info *si);
extern int brcmf_sdioh_release_host_and_unlock(struct sdioh_info *si);
/* read or write one byte using cmd52 */
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_request_byte(struct sdioh_info *si, uint rw, uint fnc, uint addr,
u8 *byte);
/* read or write 2/4 bytes using cmd53 */
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_request_word(struct sdioh_info *si, uint cmd_type,
uint rw, uint fnc, uint addr,
u32 *word, uint nbyte);
/* read or write any buffer using cmd53 */
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_request_buffer(struct sdioh_info *si, uint pio_dma,
uint fix_inc, uint rw, uint fnc_num,
u32 addr, uint regwidth,
u32 buflen, u8 *buffer, struct sk_buff *pkt);
/* get cis data */
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_cis_read(struct sdioh_info *si, uint fuc, u8 *cis, u32 length);
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_cfg_read(struct sdioh_info *si, uint fuc, u32 addr, u8 *data);
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_cfg_write(struct sdioh_info *si, uint fuc, u32 addr, u8 *data);
/* query number of io functions */
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
index 0ebca53..733ba96 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
@@ -109,7 +109,7 @@ brcmf_sdcard_iovar_op(void *sdh, const char *name,
bool brcmf_sdcard_intr_query(void *sdh)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
bool on;
ASSERT(bcmsdh);
@@ -123,7 +123,7 @@ bool brcmf_sdcard_intr_query(void *sdh)
int brcmf_sdcard_intr_enable(void *sdh)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
ASSERT(bcmsdh);
status = brcmf_sdioh_interrupt_set(bcmsdh->sdioh, true);
@@ -133,7 +133,7 @@ int brcmf_sdcard_intr_enable(void *sdh)
int brcmf_sdcard_intr_disable(void *sdh)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
ASSERT(bcmsdh);
status = brcmf_sdioh_interrupt_set(bcmsdh->sdioh, false);
@@ -143,7 +143,7 @@ int brcmf_sdcard_intr_disable(void *sdh)
int brcmf_sdcard_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
ASSERT(bcmsdh);
status = brcmf_sdioh_interrupt_register(bcmsdh->sdioh, fn, argh);
@@ -153,7 +153,7 @@ int brcmf_sdcard_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
int brcmf_sdcard_intr_dereg(void *sdh)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
ASSERT(bcmsdh);
status = brcmf_sdioh_interrupt_deregister(bcmsdh->sdioh);
@@ -181,7 +181,7 @@ int brcmf_sdcard_devremove_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
u8 brcmf_sdcard_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
s32 retry = 0;
#endif
@@ -217,7 +217,7 @@ void
brcmf_sdcard_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
s32 retry = 0;
#endif
@@ -249,7 +249,7 @@ brcmf_sdcard_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
u32 brcmf_sdcard_cfg_read_word(void *sdh, uint fnc_num, u32 addr, int *err)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
u32 data = 0;
if (!bcmsdh)
@@ -274,7 +274,7 @@ brcmf_sdcard_cfg_write_word(void *sdh, uint fnc_num, u32 addr, u32 data,
int *err)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
if (!bcmsdh)
bcmsdh = l_bcmsdh;
@@ -295,7 +295,7 @@ brcmf_sdcard_cfg_write_word(void *sdh, uint fnc_num, u32 addr, u32 data,
int brcmf_sdcard_cis_read(void *sdh, uint func, u8 * cis, uint length)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
u8 *tmp_buf, *tmp_ptr;
u8 *ptr;
@@ -355,7 +355,7 @@ static int brcmf_sdcard_set_sbaddr_window(void *sdh, u32 address)
u32 brcmf_sdcard_reg_read(void *sdh, u32 addr, uint size)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
u32 word = 0;
uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
@@ -408,7 +408,7 @@ u32 brcmf_sdcard_reg_read(void *sdh, u32 addr, uint size)
u32 brcmf_sdcard_reg_write(void *sdh, u32 addr, uint size, u32 data)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
int err = 0;
@@ -454,7 +454,7 @@ brcmf_sdcard_recv_buf(struct brcmf_sdio *bcmsdh, u32 addr, uint fn, uint flags,
u8 *buf, uint nbytes, struct sk_buff *pkt,
bcmsdh_cmplt_fn_t complete, void *handle)
{
- SDIOH_API_RC status;
+ int status;
uint incr_fix;
uint width;
uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
@@ -498,7 +498,7 @@ brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags,
bcmsdh_cmplt_fn_t complete, void *handle)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
uint incr_fix;
uint width;
uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
@@ -539,7 +539,7 @@ brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags,
int brcmf_sdcard_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes)
{
struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
- SDIOH_API_RC status;
+ int status;
ASSERT(bcmsdh);
ASSERT(bcmsdh->init_success);
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index df1e8c1..4f7d32a 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -167,7 +167,7 @@ struct sdioh_info *brcmf_sdioh_attach(void *bar0, uint irq)
return sd;
}
-extern SDIOH_API_RC brcmf_sdioh_detach(struct sdioh_info *sd)
+extern int brcmf_sdioh_detach(struct sdioh_info *sd)
{
sd_trace(("%s\n", __func__));
@@ -193,7 +193,7 @@ extern SDIOH_API_RC brcmf_sdioh_detach(struct sdioh_info *sd)
#if defined(OOB_INTR_ONLY) && defined(HW_OOB)
-extern SDIOH_API_RC brcmf_sdioh_enable_func_intr(void)
+extern int brcmf_sdioh_enable_func_intr(void)
{
u8 reg;
int err;
@@ -227,7 +227,7 @@ extern SDIOH_API_RC brcmf_sdioh_enable_func_intr(void)
return SDIOH_API_RC_SUCCESS;
}
-extern SDIOH_API_RC brcmf_sdioh_disable_func_intr(void)
+extern int brcmf_sdioh_disable_func_intr(void)
{
u8 reg;
int err;
@@ -260,7 +260,7 @@ extern SDIOH_API_RC brcmf_sdioh_disable_func_intr(void)
#endif /* defined(OOB_INTR_ONLY) && defined(HW_OOB) */
/* Configure callback to client when we receive client interrupt */
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_interrupt_register(struct sdioh_info *sd, sdioh_cb_fn_t fn,
void *argh)
{
@@ -293,7 +293,7 @@ brcmf_sdioh_interrupt_register(struct sdioh_info *sd, sdioh_cb_fn_t fn,
return SDIOH_API_RC_SUCCESS;
}
-extern SDIOH_API_RC brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd)
+extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd)
{
sd_trace(("%s: Entering\n", __func__));
@@ -322,7 +322,7 @@ extern SDIOH_API_RC brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd)
return SDIOH_API_RC_SUCCESS;
}
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_interrupt_query(struct sdioh_info *sd, bool *onoff)
{
sd_trace(("%s: Entering\n", __func__));
@@ -536,9 +536,9 @@ exit:
#if defined(OOB_INTR_ONLY) && defined(HW_OOB)
-SDIOH_API_RC brcmf_sdioh_enable_hw_oob_intr(struct sdioh_info *sd, bool enable)
+int brcmf_sdioh_enable_hw_oob_intr(struct sdioh_info *sd, bool enable)
{
- SDIOH_API_RC status;
+ int status;
u8 data;
if (enable)
@@ -552,20 +552,20 @@ SDIOH_API_RC brcmf_sdioh_enable_hw_oob_intr(struct sdioh_info *sd, bool enable)
}
#endif /* defined(OOB_INTR_ONLY) && defined(HW_OOB) */
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_cfg_read(struct sdioh_info *sd, uint fnc_num, u32 addr, u8 *data)
{
- SDIOH_API_RC status;
+ int status;
/* No lock needed since brcmf_sdioh_request_byte does locking */
status = brcmf_sdioh_request_byte(sd, SDIOH_READ, fnc_num, addr, data);
return status;
}
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_cfg_write(struct sdioh_info *sd, uint fnc_num, u32 addr, u8 *data)
{
/* No lock needed since brcmf_sdioh_request_byte does locking */
- SDIOH_API_RC status;
+ int status;
status = brcmf_sdioh_request_byte(sd, SDIOH_WRITE, fnc_num, addr, data);
return status;
}
@@ -591,7 +591,7 @@ static int brcmf_sdioh_get_cisaddr(struct sdioh_info *sd, u32 regaddr)
return scratch;
}
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_cis_read(struct sdioh_info *sd, uint func, u8 *cisd, u32 length)
{
u32 count;
@@ -625,7 +625,7 @@ brcmf_sdioh_cis_read(struct sdioh_info *sd, uint func, u8 *cisd, u32 length)
return SDIOH_API_RC_SUCCESS;
}
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
uint regaddr, u8 *byte)
{
@@ -724,7 +724,7 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
return ((err_ret == 0) ? SDIOH_API_RC_SUCCESS : SDIOH_API_RC_FAIL);
}
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_request_word(struct sdioh_info *sd, uint cmd_type, uint rw,
uint func, uint addr, u32 *word, uint nbytes)
{
@@ -777,7 +777,7 @@ brcmf_sdioh_request_word(struct sdioh_info *sd, uint cmd_type, uint rw,
return ((err_ret == 0) ? SDIOH_API_RC_SUCCESS : SDIOH_API_RC_FAIL);
}
-static SDIOH_API_RC
+static int
brcmf_sdioh_request_packet(struct sdioh_info *sd, uint fix_inc, uint write,
uint func, uint addr, struct sk_buff *pkt)
{
@@ -873,12 +873,12 @@ brcmf_sdioh_request_packet(struct sdioh_info *sd, uint fix_inc, uint write,
* aligned packet.
*
*/
-extern SDIOH_API_RC
+extern int
brcmf_sdioh_request_buffer(struct sdioh_info *sd, uint pio_dma, uint fix_inc,
uint write, uint func, uint addr, uint reg_width,
uint buflen_u, u8 *buffer, struct sk_buff *pkt)
{
- SDIOH_API_RC Status;
+ int Status;
struct sk_buff *mypkt = NULL;
sd_trace(("%s: Enter\n", __func__));
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
index 955168f..c95112e 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
@@ -172,7 +172,7 @@ void brcmf_sdioh_osfree(struct sdioh_info *sd)
}
/* Interrupt enable/disable */
-SDIOH_API_RC brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable)
+int brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable)
{
unsigned long flags;
struct sdos_info *sdos;
--
1.7.1
From: Arend van Spriel <[email protected]>
This function prototype is not implemented nor referenced in the
brcmfmac driver so it has been removed.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 34bd5e9..bb9a72a 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -66,8 +66,6 @@ const char dhd_version[] =
const char dhd_version[] = "Dongle Host Driver, version " EPI_VERSION_STR;
#endif
-void dhd_set_timer(void *bus, uint wdtick);
-
/* IOVar table */
enum {
IOV_VERSION = 1,
--
1.7.1
From: Arend van Spriel <[email protected]>
The static functions in wl_cfg80211.c starting with wl_ prefix have
been renamed starting with brcmf_ prefix to be consistent.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 920 +++++++++++-----------
1 files changed, 460 insertions(+), 460 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index 2555838..b0ac780 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -44,162 +44,162 @@ u32 brcmf_dbg_level = WL_DBG_ERR;
/*
** cfg80211_ops api/callback list
*/
-static s32 wl_cfg80211_change_iface(struct wiphy *wiphy,
+static s32 brcmf_cfg80211_change_iface(struct wiphy *wiphy,
struct net_device *ndev,
enum nl80211_iftype type, u32 *flags,
struct vif_params *params);
-static s32 __wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
+static s32 __brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
struct cfg80211_scan_request *request,
struct cfg80211_ssid *this_ssid);
-static s32 wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
+static s32 brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
struct cfg80211_scan_request *request);
-static s32 wl_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed);
-static s32 wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
+static s32 brcmf_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed);
+static s32 brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_ibss_params *params);
-static s32 wl_cfg80211_leave_ibss(struct wiphy *wiphy,
+static s32 brcmf_cfg80211_leave_ibss(struct wiphy *wiphy,
struct net_device *dev);
-static s32 wl_cfg80211_get_station(struct wiphy *wiphy,
+static s32 brcmf_cfg80211_get_station(struct wiphy *wiphy,
struct net_device *dev, u8 *mac,
struct station_info *sinfo);
-static s32 wl_cfg80211_set_power_mgmt(struct wiphy *wiphy,
+static s32 brcmf_cfg80211_set_power_mgmt(struct wiphy *wiphy,
struct net_device *dev, bool enabled,
s32 timeout);
-static s32 wl_cfg80211_set_bitrate_mask(struct wiphy *wiphy,
+static s32 brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy,
struct net_device *dev,
const u8 *addr,
const struct cfg80211_bitrate_mask
*mask);
-static int wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
+static int brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_connect_params *sme);
-static s32 wl_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
+static s32 brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
u16 reason_code);
-static s32 wl_cfg80211_set_tx_power(struct wiphy *wiphy,
+static s32 brcmf_cfg80211_set_tx_power(struct wiphy *wiphy,
enum nl80211_tx_power_setting type,
s32 dbm);
-static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm);
-static s32 wl_cfg80211_config_default_key(struct wiphy *wiphy,
+static s32 brcmf_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm);
+static s32 brcmf_cfg80211_config_default_key(struct wiphy *wiphy,
struct net_device *dev, u8 key_idx,
bool unicast, bool multicast);
-static s32 wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
+static s32 brcmf_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, bool pairwise, const u8 *mac_addr,
struct key_params *params);
-static s32 wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
+static s32 brcmf_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, bool pairwise, const u8 *mac_addr);
-static s32 wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
+static s32 brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, bool pairwise, const u8 *mac_addr,
void *cookie, void (*callback) (void *cookie,
struct
key_params *
params));
-static s32 wl_cfg80211_config_default_mgmt_key(struct wiphy *wiphy,
+static s32 brcmf_cfg80211_config_default_mgmt_key(struct wiphy *wiphy,
struct net_device *dev,
u8 key_idx);
-static s32 wl_cfg80211_resume(struct wiphy *wiphy);
-static s32 wl_cfg80211_suspend(struct wiphy *wiphy,
+static s32 brcmf_cfg80211_resume(struct wiphy *wiphy);
+static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy,
struct cfg80211_wowlan *wow);
-static s32 wl_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev,
+static s32 brcmf_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_pmksa *pmksa);
-static s32 wl_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
+static s32 brcmf_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_pmksa *pmksa);
-static s32 wl_cfg80211_flush_pmksa(struct wiphy *wiphy,
+static s32 brcmf_cfg80211_flush_pmksa(struct wiphy *wiphy,
struct net_device *dev);
/*
** event & event Q handlers for cfg80211 interfaces
*/
-static s32 wl_create_event_handler(struct wl_priv *wl);
-static void wl_destroy_event_handler(struct wl_priv *wl);
-static s32 wl_event_handler(void *data);
-static void wl_init_eq(struct wl_priv *wl);
-static void wl_flush_eq(struct wl_priv *wl);
-static void wl_lock_eq(struct wl_priv *wl);
-static void wl_unlock_eq(struct wl_priv *wl);
-static void wl_init_eq_lock(struct wl_priv *wl);
-static void wl_init_eloop_handler(struct wl_event_loop *el);
-static struct wl_event_q *wl_deq_event(struct wl_priv *wl);
-static s32 wl_enq_event(struct wl_priv *wl, u32 type,
+static s32 brcmf_create_event_handler(struct wl_priv *wl);
+static void brcmf_destroy_event_handler(struct wl_priv *wl);
+static s32 brcmf_event_handler(void *data);
+static void brcmf_init_eq(struct wl_priv *wl);
+static void brcmf_flush_eq(struct wl_priv *wl);
+static void brcmf_lock_eq(struct wl_priv *wl);
+static void brcmf_unlock_eq(struct wl_priv *wl);
+static void brcmf_init_eq_lock(struct wl_priv *wl);
+static void brcmf_init_eloop_handler(struct wl_event_loop *el);
+static struct wl_event_q *brcmf_deq_event(struct wl_priv *wl);
+static s32 brcmf_enq_event(struct wl_priv *wl, u32 type,
const brcmf_event_msg_t *msg, void *data);
-static void wl_put_event(struct wl_event_q *e);
-static void wl_wakeup_event(struct wl_priv *wl);
-static s32 wl_notify_connect_status(struct wl_priv *wl,
+static void brcmf_put_event(struct wl_event_q *e);
+static void brcmf_wakeup_event(struct wl_priv *wl);
+static s32 brcmf_notify_connect_status(struct wl_priv *wl,
struct net_device *ndev,
const brcmf_event_msg_t *e, void *data);
-static s32 wl_notify_roaming_status(struct wl_priv *wl,
+static s32 brcmf_notify_roaming_status(struct wl_priv *wl,
struct net_device *ndev,
const brcmf_event_msg_t *e, void *data);
-static s32 wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
+static s32 brcmf_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
const brcmf_event_msg_t *e, void *data);
-static s32 wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
+static s32 brcmf_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
const brcmf_event_msg_t *e, void *data,
bool completed);
-static s32 wl_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
+static s32 brcmf_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
const brcmf_event_msg_t *e, void *data);
-static s32 wl_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
+static s32 brcmf_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
const brcmf_event_msg_t *e, void *data);
/*
** register/deregister sdio function
*/
struct sdio_func *wl_cfg80211_get_sdio_func(void);
-static void wl_clear_sdio_func(void);
+static void brcmf_clear_sdio_func(void);
/*
** ioctl utilites
*/
-static s32 wl_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
+static s32 brcmf_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
s32 buf_len);
-static __used s32 wl_dev_bufvar_set(struct net_device *dev, s8 *name,
+static __used s32 brcmf_dev_bufvar_set(struct net_device *dev, s8 *name,
s8 *buf, s32 len);
-static s32 wl_dev_intvar_set(struct net_device *dev, s8 *name, s32 val);
-static s32 wl_dev_intvar_get(struct net_device *dev, s8 *name,
+static s32 brcmf_dev_intvar_set(struct net_device *dev, s8 *name, s32 val);
+static s32 brcmf_dev_intvar_get(struct net_device *dev, s8 *name,
s32 *retval);
-static s32 wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg,
+static s32 brcmf_dev_ioctl(struct net_device *dev, u32 cmd, void *arg,
u32 len);
/*
** cfg80211 set_wiphy_params utilities
*/
-static s32 wl_set_frag(struct net_device *dev, u32 frag_threshold);
-static s32 wl_set_rts(struct net_device *dev, u32 frag_threshold);
-static s32 wl_set_retry(struct net_device *dev, u32 retry, bool l);
+static s32 brcmf_set_frag(struct net_device *dev, u32 frag_threshold);
+static s32 brcmf_set_rts(struct net_device *dev, u32 frag_threshold);
+static s32 brcmf_set_retry(struct net_device *dev, u32 retry, bool l);
/*
** wl profile utilities
*/
-static s32 wl_update_prof(struct wl_priv *wl, const brcmf_event_msg_t *e,
+static s32 brcmf_update_prof(struct wl_priv *wl, const brcmf_event_msg_t *e,
void *data, s32 item);
-static void *wl_read_prof(struct wl_priv *wl, s32 item);
-static void wl_init_prof(struct wl_profile *prof);
+static void *brcmf_read_prof(struct wl_priv *wl, s32 item);
+static void brcmf_init_prof(struct wl_profile *prof);
/*
** cfg80211 connect utilites
*/
-static s32 wl_set_wpa_version(struct net_device *dev,
+static s32 brcmf_set_wpa_version(struct net_device *dev,
struct cfg80211_connect_params *sme);
-static s32 wl_set_auth_type(struct net_device *dev,
+static s32 brcmf_set_auth_type(struct net_device *dev,
struct cfg80211_connect_params *sme);
-static s32 wl_set_set_cipher(struct net_device *dev,
+static s32 brcmf_set_set_cipher(struct net_device *dev,
struct cfg80211_connect_params *sme);
-static s32 wl_set_key_mgmt(struct net_device *dev,
+static s32 brcmf_set_key_mgmt(struct net_device *dev,
struct cfg80211_connect_params *sme);
-static s32 wl_set_set_sharedkey(struct net_device *dev,
+static s32 brcmf_set_set_sharedkey(struct net_device *dev,
struct cfg80211_connect_params *sme);
-static s32 wl_get_assoc_ies(struct wl_priv *wl);
-static void wl_clear_assoc_ies(struct wl_priv *wl);
-static void wl_ch_to_chanspec(int ch,
+static s32 brcmf_get_assoc_ies(struct wl_priv *wl);
+static void brcmf_clear_assoc_ies(struct wl_priv *wl);
+static void brcmf_ch_to_chanspec(int ch,
struct brcmf_join_params *join_params, size_t *join_params_size);
/*
** information element utilities
*/
-static __used s32 wl_add_ie(struct wl_priv *wl, u8 t, u8 l, u8 *v);
-static s32 wl_mode_to_nl80211_iftype(s32 mode);
-static struct wireless_dev *wl_alloc_wdev(s32 sizeof_iface,
+static __used s32 brcmf_add_ie(struct wl_priv *wl, u8 t, u8 l, u8 *v);
+static s32 brcmf_mode_to_nl80211_iftype(s32 mode);
+static struct wireless_dev *brcmf_alloc_wdev(s32 sizeof_iface,
struct device *dev);
-static void wl_free_wdev(struct wl_priv *wl);
-static s32 wl_inform_bss(struct wl_priv *wl);
-static s32 wl_inform_single_bss(struct wl_priv *wl, struct brcmf_bss_info *bi);
-static s32 wl_update_bss_info(struct wl_priv *wl);
-static s32 wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
+static void brcmf_free_wdev(struct wl_priv *wl);
+static s32 brcmf_inform_bss(struct wl_priv *wl);
+static s32 brcmf_inform_single_bss(struct wl_priv *wl, struct brcmf_bss_info *bi);
+static s32 brcmf_update_bss_info(struct wl_priv *wl);
+static s32 brcmf_add_keyext(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, const u8 *mac_addr,
struct key_params *params);
@@ -212,94 +212,94 @@ static void swap_key_to_BE(struct brcmf_wsec_key *key);
/*
** wl_priv memory init/deinit utilities
*/
-static s32 wl_init_priv_mem(struct wl_priv *wl);
-static void wl_deinit_priv_mem(struct wl_priv *wl);
+static s32 brcmf_init_priv_mem(struct wl_priv *wl);
+static void brcmf_deinit_priv_mem(struct wl_priv *wl);
-static void wl_delay(u32 ms);
+static void brcmf_delay(u32 ms);
/*
** store/restore cfg80211 instance data
*/
-static void wl_set_drvdata(struct wl_dev *dev, void *data);
-static void *wl_get_drvdata(struct wl_dev *dev);
+static void brcmf_set_drvdata(struct wl_dev *dev, void *data);
+static void *brcmf_get_drvdata(struct wl_dev *dev);
/*
** ibss mode utilities
*/
-static bool wl_is_ibssmode(struct wl_priv *wl);
+static bool brcmf_is_ibssmode(struct wl_priv *wl);
/*
** dongle up/down , default configuration utilities
*/
-static bool wl_is_linkdown(struct wl_priv *wl, const brcmf_event_msg_t *e);
-static bool wl_is_linkup(struct wl_priv *wl, const brcmf_event_msg_t *e);
-static bool wl_is_nonetwork(struct wl_priv *wl, const brcmf_event_msg_t *e);
-static void wl_link_down(struct wl_priv *wl);
-static s32 wl_dongle_mode(struct net_device *ndev, s32 iftype);
-static s32 __wl_cfg80211_up(struct wl_priv *wl);
-static s32 __wl_cfg80211_down(struct wl_priv *wl);
-static s32 wl_dongle_probecap(struct wl_priv *wl);
-static void wl_init_conf(struct wl_conf *conf);
+static bool brcmf_is_linkdown(struct wl_priv *wl, const brcmf_event_msg_t *e);
+static bool brcmf_is_linkup(struct wl_priv *wl, const brcmf_event_msg_t *e);
+static bool brcmf_is_nonetwork(struct wl_priv *wl, const brcmf_event_msg_t *e);
+static void brcmf_link_down(struct wl_priv *wl);
+static s32 brcmf_dongle_mode(struct net_device *ndev, s32 iftype);
+static s32 __brcmf_cfg80211_up(struct wl_priv *wl);
+static s32 __brcmf_cfg80211_down(struct wl_priv *wl);
+static s32 brcmf_dongle_probecap(struct wl_priv *wl);
+static void brcmf_init_conf(struct wl_conf *conf);
/*
** dongle configuration utilities
*/
-static s32 wl_dongle_eventmsg(struct net_device *ndev);
-static s32 wl_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
+static s32 brcmf_dongle_eventmsg(struct net_device *ndev);
+static s32 brcmf_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
s32 scan_unassoc_time, s32 scan_passive_time);
-static s32 wl_config_dongle(struct wl_priv *wl, bool need_lock);
-static s32 wl_dongle_roam(struct net_device *ndev, u32 roamvar,
+static s32 brcmf_config_dongle(struct wl_priv *wl, bool need_lock);
+static s32 brcmf_dongle_roam(struct net_device *ndev, u32 roamvar,
u32 bcn_timeout);
/*
** iscan handler
*/
-static void wl_iscan_timer(unsigned long data);
-static void wl_term_iscan(struct wl_priv *wl);
-static s32 wl_init_iscan(struct wl_priv *wl);
-static s32 wl_iscan_thread(void *data);
-static s32 wl_dev_iovar_setbuf(struct net_device *dev, s8 *iovar,
+static void brcmf_iscan_timer(unsigned long data);
+static void brcmf_term_iscan(struct wl_priv *wl);
+static s32 brcmf_init_iscan(struct wl_priv *wl);
+static s32 brcmf_iscan_thread(void *data);
+static s32 brcmf_dev_iovar_setbuf(struct net_device *dev, s8 *iovar,
void *param, s32 paramlen, void *bufptr,
s32 buflen);
-static s32 wl_dev_iovar_getbuf(struct net_device *dev, s8 *iovar,
+static s32 brcmf_dev_iovar_getbuf(struct net_device *dev, s8 *iovar,
void *param, s32 paramlen, void *bufptr,
s32 buflen);
-static s32 wl_run_iscan(struct wl_iscan_ctrl *iscan, struct brcmf_ssid *ssid,
+static s32 brcmf_run_iscan(struct wl_iscan_ctrl *iscan, struct brcmf_ssid *ssid,
u16 action);
-static s32 wl_do_iscan(struct wl_priv *wl);
-static s32 wl_wakeup_iscan(struct wl_iscan_ctrl *iscan);
-static s32 wl_invoke_iscan(struct wl_priv *wl);
-static s32 wl_get_iscan_results(struct wl_iscan_ctrl *iscan, u32 *status,
+static s32 brcmf_do_iscan(struct wl_priv *wl);
+static s32 brcmf_wakeup_iscan(struct wl_iscan_ctrl *iscan);
+static s32 brcmf_invoke_iscan(struct wl_priv *wl);
+static s32 brcmf_get_iscan_results(struct wl_iscan_ctrl *iscan, u32 *status,
struct brcmf_scan_results **bss_list);
-static void wl_notify_iscan_complete(struct wl_iscan_ctrl *iscan, bool aborted);
-static void wl_init_iscan_eloop(struct wl_iscan_eloop *el);
-static s32 wl_iscan_done(struct wl_priv *wl);
-static s32 wl_iscan_pending(struct wl_priv *wl);
-static s32 wl_iscan_inprogress(struct wl_priv *wl);
-static s32 wl_iscan_aborted(struct wl_priv *wl);
+static void brcmf_notify_iscan_complete(struct wl_iscan_ctrl *iscan, bool aborted);
+static void brcmf_init_iscan_eloop(struct wl_iscan_eloop *el);
+static s32 brcmf_iscan_done(struct wl_priv *wl);
+static s32 brcmf_iscan_pending(struct wl_priv *wl);
+static s32 brcmf_iscan_inprogress(struct wl_priv *wl);
+static s32 brcmf_iscan_aborted(struct wl_priv *wl);
/*
* find most significant bit set
*/
-static __used u32 wl_find_msb(u16 bit16);
+static __used u32 brcmf_find_msb(u16 bit16);
/*
* update pmklist to dongle
*/
-static __used s32 wl_update_pmklist(struct net_device *dev,
+static __used s32 brcmf_update_pmklist(struct net_device *dev,
struct wl_pmk_list *pmk_list, s32 err);
-static void wl_set_mpc(struct net_device *ndev, int mpc);
+static void brcmf_set_mpc(struct net_device *ndev, int mpc);
/*
* debufs support
*/
-static int wl_debugfs_add_netdev_params(struct wl_priv *wl);
-static void wl_debugfs_remove_netdev(struct wl_priv *wl);
+static int brcmf_debugfs_add_netdev_params(struct wl_priv *wl);
+static void brcmf_debugfs_remove_netdev(struct wl_priv *wl);
#define WL_PRIV_GET() \
({ \
- struct wl_iface *ci = wl_get_drvdata(wl_cfg80211_dev); \
+ struct wl_iface *ci = brcmf_get_drvdata(wl_cfg80211_dev); \
if (unlikely(!ci)) { \
WL_ERR("wl_cfg80211_dev is unavailable\n"); \
BUG(); \
@@ -515,7 +515,7 @@ static void swap_key_to_BE(struct brcmf_wsec_key *key)
}
static s32
-wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len)
+brcmf_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len)
{
struct ifreq ifr;
struct brcmf_ioctl ioc;
@@ -538,7 +538,7 @@ wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len)
}
static s32
-wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
+brcmf_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
enum nl80211_iftype type, u32 *flags,
struct vif_params *params)
{
@@ -570,7 +570,7 @@ wl_cfg80211_change_iface(struct wiphy *wiphy, struct net_device *ndev,
}
infra = cpu_to_le32(infra);
- err = wl_dev_ioctl(ndev, BRCMF_C_SET_INFRA, &infra, sizeof(infra));
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_INFRA, &infra, sizeof(infra));
if (unlikely(err)) {
WL_ERR("WLC_SET_INFRA error (%d)\n", err);
err = -EAGAIN;
@@ -610,7 +610,7 @@ static void wl_iscan_prep(struct brcmf_scan_params *params,
}
static s32
-wl_dev_iovar_setbuf(struct net_device *dev, s8 * iovar, void *param,
+brcmf_dev_iovar_setbuf(struct net_device *dev, s8 * iovar, void *param,
s32 paramlen, void *bufptr, s32 buflen)
{
s32 iolen;
@@ -618,11 +618,11 @@ wl_dev_iovar_setbuf(struct net_device *dev, s8 * iovar, void *param,
iolen = brcmu_mkiovar(iovar, param, paramlen, bufptr, buflen);
BUG_ON(!iolen);
- return wl_dev_ioctl(dev, BRCMF_C_SET_VAR, bufptr, iolen);
+ return brcmf_dev_ioctl(dev, BRCMF_C_SET_VAR, bufptr, iolen);
}
static s32
-wl_dev_iovar_getbuf(struct net_device *dev, s8 * iovar, void *param,
+brcmf_dev_iovar_getbuf(struct net_device *dev, s8 * iovar, void *param,
s32 paramlen, void *bufptr, s32 buflen)
{
s32 iolen;
@@ -630,11 +630,11 @@ wl_dev_iovar_getbuf(struct net_device *dev, s8 * iovar, void *param,
iolen = brcmu_mkiovar(iovar, param, paramlen, bufptr, buflen);
BUG_ON(!iolen);
- return wl_dev_ioctl(dev, BRCMF_C_GET_VAR, bufptr, buflen);
+ return brcmf_dev_ioctl(dev, BRCMF_C_GET_VAR, bufptr, buflen);
}
static s32
-wl_run_iscan(struct wl_iscan_ctrl *iscan, struct brcmf_ssid *ssid, u16 action)
+brcmf_run_iscan(struct wl_iscan_ctrl *iscan, struct brcmf_ssid *ssid, u16 action)
{
s32 params_size = (BRCMF_SCAN_PARAMS_FIXED_SIZE +
offsetof(struct brcmf_iscan_params, params));
@@ -655,7 +655,7 @@ wl_run_iscan(struct wl_iscan_ctrl *iscan, struct brcmf_ssid *ssid, u16 action)
params->scan_duration = cpu_to_le16(0);
/* params_size += offsetof(struct brcmf_iscan_params, params); */
- err = wl_dev_iovar_setbuf(iscan->dev, "iscan", params, params_size,
+ err = brcmf_dev_iovar_setbuf(iscan->dev, "iscan", params, params_size,
iscan->ioctl_buf, BRCMF_C_IOCTL_SMLEN);
if (unlikely(err)) {
if (err == -EBUSY) {
@@ -668,7 +668,7 @@ wl_run_iscan(struct wl_iscan_ctrl *iscan, struct brcmf_ssid *ssid, u16 action)
return err;
}
-static s32 wl_do_iscan(struct wl_priv *wl)
+static s32 brcmf_do_iscan(struct wl_priv *wl)
{
struct wl_iscan_ctrl *iscan = wl_to_iscan(wl);
struct net_device *ndev = wl_to_ndev(wl);
@@ -682,15 +682,15 @@ static s32 wl_do_iscan(struct wl_priv *wl)
iscan->state = WL_ISCAN_STATE_SCANING;
passive_scan = wl->active_scan ? 0 : 1;
- err = wl_dev_ioctl(wl_to_ndev(wl), BRCMF_C_SET_PASSIVE_SCAN,
+ err = brcmf_dev_ioctl(wl_to_ndev(wl), BRCMF_C_SET_PASSIVE_SCAN,
&passive_scan, sizeof(passive_scan));
if (unlikely(err)) {
WL_ERR("error (%d)\n", err);
return err;
}
- wl_set_mpc(ndev, 0);
+ brcmf_set_mpc(ndev, 0);
wl->iscan_kickstart = true;
- wl_run_iscan(iscan, &ssid, BRCMF_SCAN_ACTION_START);
+ brcmf_run_iscan(iscan, &ssid, BRCMF_SCAN_ACTION_START);
mod_timer(&iscan->timer, jiffies + iscan->timer_ms * HZ / 1000);
iscan->timer_on = 1;
@@ -698,7 +698,7 @@ static s32 wl_do_iscan(struct wl_priv *wl)
}
static s32
-__wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
+__brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
struct cfg80211_scan_request *request,
struct cfg80211_ssid *this_ssid)
{
@@ -741,7 +741,7 @@ __wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
wl->scan_request = request;
set_bit(WL_STATUS_SCANNING, &wl->status);
if (iscan_req) {
- err = wl_do_iscan(wl);
+ err = brcmf_do_iscan(wl);
if (likely(!err))
return err;
else
@@ -761,14 +761,14 @@ __wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
}
passive_scan = wl->active_scan ? 0 : 1;
- err = wl_dev_ioctl(ndev, BRCMF_C_SET_PASSIVE_SCAN,
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_PASSIVE_SCAN,
&passive_scan, sizeof(passive_scan));
if (unlikely(err)) {
WL_ERR("WLC_SET_PASSIVE_SCAN error (%d)\n", err);
goto scan_out;
}
- wl_set_mpc(ndev, 0);
- err = wl_dev_ioctl(ndev, BRCMF_C_SCAN, &sr->ssid,
+ brcmf_set_mpc(ndev, 0);
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_SCAN, &sr->ssid,
sizeof(sr->ssid));
if (err) {
if (err == -EBUSY) {
@@ -777,7 +777,7 @@ __wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
} else {
WL_ERR("WLC_SCAN error (%d)\n", err);
}
- wl_set_mpc(ndev, 1);
+ brcmf_set_mpc(ndev, 1);
goto scan_out;
}
}
@@ -791,7 +791,7 @@ scan_out:
}
static s32
-wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
+brcmf_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
struct cfg80211_scan_request *request)
{
s32 err = 0;
@@ -800,7 +800,7 @@ wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
CHECK_SYS_UP();
- err = __wl_cfg80211_scan(wiphy, ndev, request, NULL);
+ err = __brcmf_cfg80211_scan(wiphy, ndev, request, NULL);
if (unlikely(err))
WL_ERR("scan error (%d)\n", err);
@@ -808,7 +808,7 @@ wl_cfg80211_scan(struct wiphy *wiphy, struct net_device *ndev,
return err;
}
-static s32 wl_dev_intvar_set(struct net_device *dev, s8 *name, s32 val)
+static s32 brcmf_dev_intvar_set(struct net_device *dev, s8 *name, s32 val)
{
s8 buf[BRCMF_C_IOCTL_SMLEN];
u32 len;
@@ -819,7 +819,7 @@ static s32 wl_dev_intvar_set(struct net_device *dev, s8 *name, s32 val)
sizeof(buf));
BUG_ON(!len);
- err = wl_dev_ioctl(dev, BRCMF_C_SET_VAR, buf, len);
+ err = brcmf_dev_ioctl(dev, BRCMF_C_SET_VAR, buf, len);
if (unlikely(err))
WL_ERR("error (%d)\n", err);
@@ -827,7 +827,7 @@ static s32 wl_dev_intvar_set(struct net_device *dev, s8 *name, s32 val)
}
static s32
-wl_dev_intvar_get(struct net_device *dev, s8 *name, s32 *retval)
+brcmf_dev_intvar_get(struct net_device *dev, s8 *name, s32 *retval)
{
union {
s8 buf[BRCMF_C_IOCTL_SMLEN];
@@ -841,7 +841,7 @@ wl_dev_intvar_get(struct net_device *dev, s8 *name, s32 *retval)
brcmu_mkiovar(name, (char *)(&data_null), 0, (char *)(&var),
sizeof(var.buf));
BUG_ON(!len);
- err = wl_dev_ioctl(dev, BRCMF_C_GET_VAR, &var, len);
+ err = brcmf_dev_ioctl(dev, BRCMF_C_GET_VAR, &var, len);
if (unlikely(err))
WL_ERR("error (%d)\n", err);
@@ -850,35 +850,35 @@ wl_dev_intvar_get(struct net_device *dev, s8 *name, s32 *retval)
return err;
}
-static s32 wl_set_rts(struct net_device *dev, u32 rts_threshold)
+static s32 brcmf_set_rts(struct net_device *dev, u32 rts_threshold)
{
s32 err = 0;
- err = wl_dev_intvar_set(dev, "rtsthresh", rts_threshold);
+ err = brcmf_dev_intvar_set(dev, "rtsthresh", rts_threshold);
if (unlikely(err))
WL_ERR("Error (%d)\n", err);
return err;
}
-static s32 wl_set_frag(struct net_device *dev, u32 frag_threshold)
+static s32 brcmf_set_frag(struct net_device *dev, u32 frag_threshold)
{
s32 err = 0;
- err = wl_dev_intvar_set(dev, "fragthresh", frag_threshold);
+ err = brcmf_dev_intvar_set(dev, "fragthresh", frag_threshold);
if (unlikely(err))
WL_ERR("Error (%d)\n", err);
return err;
}
-static s32 wl_set_retry(struct net_device *dev, u32 retry, bool l)
+static s32 brcmf_set_retry(struct net_device *dev, u32 retry, bool l)
{
s32 err = 0;
u32 cmd = (l ? WLC_SET_LRL : WLC_SET_SRL);
retry = cpu_to_le32(retry);
- err = wl_dev_ioctl(dev, cmd, &retry, sizeof(retry));
+ err = brcmf_dev_ioctl(dev, cmd, &retry, sizeof(retry));
if (unlikely(err)) {
WL_ERR("cmd (%d) , error (%d)\n", cmd, err);
return err;
@@ -886,7 +886,7 @@ static s32 wl_set_retry(struct net_device *dev, u32 retry, bool l)
return err;
}
-static s32 wl_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
+static s32 brcmf_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
struct net_device *ndev = wl_to_ndev(wl);
@@ -898,28 +898,28 @@ static s32 wl_cfg80211_set_wiphy_params(struct wiphy *wiphy, u32 changed)
if (changed & WIPHY_PARAM_RTS_THRESHOLD &&
(wl->conf->rts_threshold != wiphy->rts_threshold)) {
wl->conf->rts_threshold = wiphy->rts_threshold;
- err = wl_set_rts(ndev, wl->conf->rts_threshold);
+ err = brcmf_set_rts(ndev, wl->conf->rts_threshold);
if (!err)
goto done;
}
if (changed & WIPHY_PARAM_FRAG_THRESHOLD &&
(wl->conf->frag_threshold != wiphy->frag_threshold)) {
wl->conf->frag_threshold = wiphy->frag_threshold;
- err = wl_set_frag(ndev, wl->conf->frag_threshold);
+ err = brcmf_set_frag(ndev, wl->conf->frag_threshold);
if (!err)
goto done;
}
if (changed & WIPHY_PARAM_RETRY_LONG
&& (wl->conf->retry_long != wiphy->retry_long)) {
wl->conf->retry_long = wiphy->retry_long;
- err = wl_set_retry(ndev, wl->conf->retry_long, true);
+ err = brcmf_set_retry(ndev, wl->conf->retry_long, true);
if (!err)
goto done;
}
if (changed & WIPHY_PARAM_RETRY_SHORT
&& (wl->conf->retry_short != wiphy->retry_short)) {
wl->conf->retry_short = wiphy->retry_short;
- err = wl_set_retry(ndev, wl->conf->retry_short, false);
+ err = brcmf_set_retry(ndev, wl->conf->retry_short, false);
if (!err)
goto done;
}
@@ -930,7 +930,7 @@ done:
}
static s32
-wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_ibss_params *params)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
@@ -993,7 +993,7 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
if (params->privacy)
wsec |= WEP_ENABLED;
- err = wl_dev_intvar_set(dev, "wsec", wsec);
+ err = brcmf_dev_intvar_set(dev, "wsec", wsec);
if (unlikely(err)) {
WL_ERR("wsec failed (%d)\n", err);
goto done;
@@ -1005,7 +1005,7 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
else
bcnprd = cpu_to_le32(100);
- err = wl_dev_ioctl(dev, WLC_SET_BCNPRD, &bcnprd, sizeof(bcnprd));
+ err = brcmf_dev_ioctl(dev, WLC_SET_BCNPRD, &bcnprd, sizeof(bcnprd));
if (unlikely(err)) {
WL_ERR("WLC_SET_BCNPRD failed (%d)\n", err);
goto done;
@@ -1020,7 +1020,7 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
memcpy(join_params.ssid.SSID, params->ssid, join_params.ssid.SSID_len);
join_params.ssid.SSID_len = cpu_to_le32(join_params.ssid.SSID_len);
join_params_size = sizeof(join_params.ssid);
- wl_update_prof(wl, NULL, &join_params.ssid, WL_PROF_SSID);
+ brcmf_update_prof(wl, NULL, &join_params.ssid, WL_PROF_SSID);
/* BSSID */
if (params->bssid) {
@@ -1030,7 +1030,7 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
} else {
memcpy(join_params.params.bssid, ether_bcast, ETH_ALEN);
}
- wl_update_prof(wl, NULL, &join_params.params.bssid, WL_PROF_BSSID);
+ brcmf_update_prof(wl, NULL, &join_params.params.bssid, WL_PROF_BSSID);
/* Channel */
if (params->channel) {
@@ -1041,13 +1041,13 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
params->channel->center_freq);
if (params->channel_fixed) {
/* adding chanspec */
- wl_ch_to_chanspec(wl->channel,
+ brcmf_ch_to_chanspec(wl->channel,
&join_params, &join_params_size);
}
/* set channel for starter */
target_channel = cpu_to_le32(wl->channel);
- err = wl_dev_ioctl(dev, WLC_SET_CHANNEL,
+ err = brcmf_dev_ioctl(dev, WLC_SET_CHANNEL,
&target_channel, sizeof(target_channel));
if (unlikely(err)) {
WL_ERR("WLC_SET_CHANNEL failed (%d)\n", err);
@@ -1059,7 +1059,7 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
wl->ibss_starter = false;
- err = wl_dev_ioctl(dev, BRCMF_C_SET_SSID,
+ err = brcmf_dev_ioctl(dev, BRCMF_C_SET_SSID,
&join_params, join_params_size);
if (unlikely(err)) {
WL_ERR("WLC_SET_SSID failed (%d)\n", err);
@@ -1073,7 +1073,7 @@ done:
return err;
}
-static s32 wl_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
+static s32 brcmf_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
s32 err = 0;
@@ -1081,7 +1081,7 @@ static s32 wl_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
WL_TRACE("Enter\n");
CHECK_SYS_UP();
- wl_link_down(wl);
+ brcmf_link_down(wl);
WL_TRACE("Exit\n");
@@ -1089,7 +1089,7 @@ static s32 wl_cfg80211_leave_ibss(struct wiphy *wiphy, struct net_device *dev)
}
static s32
-wl_set_wpa_version(struct net_device *dev, struct cfg80211_connect_params *sme)
+brcmf_set_wpa_version(struct net_device *dev, struct cfg80211_connect_params *sme)
{
struct wl_priv *wl = ndev_to_wl(dev);
struct wl_security *sec;
@@ -1103,18 +1103,18 @@ wl_set_wpa_version(struct net_device *dev, struct cfg80211_connect_params *sme)
else
val = WPA_AUTH_DISABLED;
WL_CONN("setting wpa_auth to 0x%0x\n", val);
- err = wl_dev_intvar_set(dev, "wpa_auth", val);
+ err = brcmf_dev_intvar_set(dev, "wpa_auth", val);
if (unlikely(err)) {
WL_ERR("set wpa_auth failed (%d)\n", err);
return err;
}
- sec = wl_read_prof(wl, WL_PROF_SEC);
+ sec = brcmf_read_prof(wl, WL_PROF_SEC);
sec->wpa_versions = sme->crypto.wpa_versions;
return err;
}
static s32
-wl_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme)
+brcmf_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme)
{
struct wl_priv *wl = ndev_to_wl(dev);
struct wl_security *sec;
@@ -1142,18 +1142,18 @@ wl_set_auth_type(struct net_device *dev, struct cfg80211_connect_params *sme)
break;
}
- err = wl_dev_intvar_set(dev, "auth", val);
+ err = brcmf_dev_intvar_set(dev, "auth", val);
if (unlikely(err)) {
WL_ERR("set auth failed (%d)\n", err);
return err;
}
- sec = wl_read_prof(wl, WL_PROF_SEC);
+ sec = brcmf_read_prof(wl, WL_PROF_SEC);
sec->auth_type = sme->auth_type;
return err;
}
static s32
-wl_set_set_cipher(struct net_device *dev, struct cfg80211_connect_params *sme)
+brcmf_set_set_cipher(struct net_device *dev, struct cfg80211_connect_params *sme)
{
struct wl_priv *wl = ndev_to_wl(dev);
struct wl_security *sec;
@@ -1205,13 +1205,13 @@ wl_set_set_cipher(struct net_device *dev, struct cfg80211_connect_params *sme)
}
WL_CONN("pval (%d) gval (%d)\n", pval, gval);
- err = wl_dev_intvar_set(dev, "wsec", pval | gval);
+ err = brcmf_dev_intvar_set(dev, "wsec", pval | gval);
if (unlikely(err)) {
WL_ERR("error (%d)\n", err);
return err;
}
- sec = wl_read_prof(wl, WL_PROF_SEC);
+ sec = brcmf_read_prof(wl, WL_PROF_SEC);
sec->cipher_pairwise = sme->crypto.ciphers_pairwise[0];
sec->cipher_group = sme->crypto.cipher_group;
@@ -1219,7 +1219,7 @@ wl_set_set_cipher(struct net_device *dev, struct cfg80211_connect_params *sme)
}
static s32
-wl_set_key_mgmt(struct net_device *dev, struct cfg80211_connect_params *sme)
+brcmf_set_key_mgmt(struct net_device *dev, struct cfg80211_connect_params *sme)
{
struct wl_priv *wl = ndev_to_wl(dev);
struct wl_security *sec;
@@ -1227,7 +1227,7 @@ wl_set_key_mgmt(struct net_device *dev, struct cfg80211_connect_params *sme)
s32 err = 0;
if (sme->crypto.n_akm_suites) {
- err = wl_dev_intvar_get(dev, "wpa_auth", &val);
+ err = brcmf_dev_intvar_get(dev, "wpa_auth", &val);
if (unlikely(err)) {
WL_ERR("could not get wpa_auth (%d)\n", err);
return err;
@@ -1261,20 +1261,20 @@ wl_set_key_mgmt(struct net_device *dev, struct cfg80211_connect_params *sme)
}
WL_CONN("setting wpa_auth to %d\n", val);
- err = wl_dev_intvar_set(dev, "wpa_auth", val);
+ err = brcmf_dev_intvar_set(dev, "wpa_auth", val);
if (unlikely(err)) {
WL_ERR("could not set wpa_auth (%d)\n", err);
return err;
}
}
- sec = wl_read_prof(wl, WL_PROF_SEC);
+ sec = brcmf_read_prof(wl, WL_PROF_SEC);
sec->wpa_auth = sme->crypto.akm_suites[0];
return err;
}
static s32
-wl_set_set_sharedkey(struct net_device *dev,
+brcmf_set_set_sharedkey(struct net_device *dev,
struct cfg80211_connect_params *sme)
{
struct wl_priv *wl = ndev_to_wl(dev);
@@ -1285,7 +1285,7 @@ wl_set_set_sharedkey(struct net_device *dev,
WL_CONN("key len (%d)\n", sme->key_len);
if (sme->key_len) {
- sec = wl_read_prof(wl, WL_PROF_SEC);
+ sec = brcmf_read_prof(wl, WL_PROF_SEC);
WL_CONN("wpa_versions 0x%x cipher_pairwise 0x%x\n",
sec->wpa_versions, sec->cipher_pairwise);
if (!
@@ -1319,7 +1319,7 @@ wl_set_set_sharedkey(struct net_device *dev,
key.len, key.index, key.algo);
WL_CONN("key \"%s\"\n", key.data);
swap_key_from_BE(&key);
- err = wl_dev_ioctl(dev, BRCMF_C_SET_KEY, &key,
+ err = brcmf_dev_ioctl(dev, BRCMF_C_SET_KEY, &key,
sizeof(key));
if (unlikely(err)) {
WL_ERR("WLC_SET_KEY error (%d)\n", err);
@@ -1328,7 +1328,7 @@ wl_set_set_sharedkey(struct net_device *dev,
if (sec->auth_type == NL80211_AUTHTYPE_OPEN_SYSTEM) {
WL_CONN("set auth_type to shared key\n");
val = 1; /* shared key */
- err = wl_dev_intvar_set(dev, "auth", val);
+ err = brcmf_dev_intvar_set(dev, "auth", val);
if (unlikely(err)) {
WL_ERR("set auth failed (%d)\n", err);
return err;
@@ -1340,7 +1340,7 @@ wl_set_set_sharedkey(struct net_device *dev,
}
static s32
-wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_connect_params *sme)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
@@ -1370,37 +1370,37 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
WL_INFO("ie (%p), ie_len (%zd)\n", sme->ie, sme->ie_len);
- err = wl_set_wpa_version(dev, sme);
+ err = brcmf_set_wpa_version(dev, sme);
if (err) {
WL_ERR("wl_set_wpa_version failed (%d)\n", err);
goto done;
}
- err = wl_set_auth_type(dev, sme);
+ err = brcmf_set_auth_type(dev, sme);
if (err) {
WL_ERR("wl_set_auth_type failed (%d)\n", err);
goto done;
}
- err = wl_set_set_cipher(dev, sme);
+ err = brcmf_set_set_cipher(dev, sme);
if (err) {
WL_ERR("wl_set_set_cipher failed (%d)\n", err);
goto done;
}
- err = wl_set_key_mgmt(dev, sme);
+ err = brcmf_set_key_mgmt(dev, sme);
if (err) {
WL_ERR("wl_set_key_mgmt failed (%d)\n", err);
goto done;
}
- err = wl_set_set_sharedkey(dev, sme);
+ err = brcmf_set_set_sharedkey(dev, sme);
if (err) {
WL_ERR("wl_set_set_sharedkey failed (%d)\n", err);
goto done;
}
- wl_update_prof(wl, NULL, sme->bssid, WL_PROF_BSSID);
+ brcmf_update_prof(wl, NULL, sme->bssid, WL_PROF_BSSID);
/*
** Join with specific BSSID and cached SSID
** If SSID is zero join based on BSSID only
@@ -1411,7 +1411,7 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
join_params.ssid.SSID_len = min(sizeof(join_params.ssid.SSID), sme->ssid_len);
memcpy(&join_params.ssid.SSID, sme->ssid, join_params.ssid.SSID_len);
join_params.ssid.SSID_len = cpu_to_le32(join_params.ssid.SSID_len);
- wl_update_prof(wl, NULL, &join_params.ssid, WL_PROF_SSID);
+ brcmf_update_prof(wl, NULL, &join_params.ssid, WL_PROF_SSID);
if (sme->bssid)
memcpy(join_params.params.bssid, sme->bssid, ETH_ALEN);
@@ -1423,8 +1423,8 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
join_params.ssid.SSID, join_params.ssid.SSID_len);
}
- wl_ch_to_chanspec(wl->channel, &join_params, &join_params_size);
- err = wl_dev_ioctl(dev, BRCMF_C_SET_SSID,
+ brcmf_ch_to_chanspec(wl->channel, &join_params, &join_params_size);
+ err = brcmf_dev_ioctl(dev, BRCMF_C_SET_SSID,
&join_params, join_params_size);
if (err)
WL_ERR("WLC_SET_SSID failed (%d)\n", err);
@@ -1437,7 +1437,7 @@ done:
}
static s32
-wl_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
u16 reason_code)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
@@ -1450,9 +1450,9 @@ wl_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
clear_bit(WL_STATUS_CONNECTED, &wl->status);
scbval.val = reason_code;
- memcpy(&scbval.ea, wl_read_prof(wl, WL_PROF_BSSID), ETH_ALEN);
+ memcpy(&scbval.ea, brcmf_read_prof(wl, WL_PROF_BSSID), ETH_ALEN);
scbval.val = cpu_to_le32(scbval.val);
- err = wl_dev_ioctl(dev, BRCMF_C_DISASSOC, &scbval,
+ err = brcmf_dev_ioctl(dev, BRCMF_C_DISASSOC, &scbval,
sizeof(struct brcmf_scb_val));
if (unlikely(err))
WL_ERR("error (%d)\n", err);
@@ -1464,7 +1464,7 @@ wl_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
}
static s32
-wl_cfg80211_set_tx_power(struct wiphy *wiphy,
+brcmf_cfg80211_set_tx_power(struct wiphy *wiphy,
enum nl80211_tx_power_setting type, s32 dbm)
{
@@ -1498,7 +1498,7 @@ wl_cfg80211_set_tx_power(struct wiphy *wiphy,
/* Make sure radio is off or on as far as software is concerned */
disable = WL_RADIO_SW_DISABLE << 16;
disable = cpu_to_le32(disable);
- err = wl_dev_ioctl(ndev, BRCMF_C_SET_RADIO, &disable, sizeof(disable));
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_RADIO, &disable, sizeof(disable));
if (unlikely(err))
WL_ERR("WLC_SET_RADIO error (%d)\n", err);
@@ -1506,7 +1506,7 @@ wl_cfg80211_set_tx_power(struct wiphy *wiphy,
txpwrmw = 0xffff;
else
txpwrmw = (u16) dbm;
- err = wl_dev_intvar_set(ndev, "qtxpower",
+ err = brcmf_dev_intvar_set(ndev, "qtxpower",
(s32) (brcmu_mw_to_qdbm(txpwrmw)));
if (unlikely(err))
WL_ERR("qtxpower error (%d)\n", err);
@@ -1517,7 +1517,7 @@ done:
return err;
}
-static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm)
+static s32 brcmf_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
struct net_device *ndev = wl_to_ndev(wl);
@@ -1528,7 +1528,7 @@ static s32 wl_cfg80211_get_tx_power(struct wiphy *wiphy, s32 *dbm)
WL_TRACE("Enter\n");
CHECK_SYS_UP();
- err = wl_dev_intvar_get(ndev, "qtxpower", &txpwrdbm);
+ err = brcmf_dev_intvar_get(ndev, "qtxpower", &txpwrdbm);
if (unlikely(err)) {
WL_ERR("error (%d)\n", err);
goto done;
@@ -1543,7 +1543,7 @@ done:
}
static s32
-wl_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, bool unicast, bool multicast)
{
u32 index;
@@ -1554,7 +1554,7 @@ wl_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *dev,
WL_CONN("key index (%d)\n", key_idx);
CHECK_SYS_UP();
- err = wl_dev_ioctl(dev, BRCMF_C_GET_WSEC, &wsec, sizeof(wsec));
+ err = brcmf_dev_ioctl(dev, BRCMF_C_GET_WSEC, &wsec, sizeof(wsec));
if (unlikely(err)) {
WL_ERR("WLC_GET_WSEC error (%d)\n", err);
goto done;
@@ -1565,7 +1565,7 @@ wl_cfg80211_config_default_key(struct wiphy *wiphy, struct net_device *dev,
/* Just select a new current key */
index = (u32) key_idx;
index = cpu_to_le32(index);
- err = wl_dev_ioctl(dev, BRCMF_C_SET_KEY_PRIMARY, &index,
+ err = brcmf_dev_ioctl(dev, BRCMF_C_SET_KEY_PRIMARY, &index,
sizeof(index));
if (unlikely(err))
WL_ERR("error (%d)\n", err);
@@ -1576,7 +1576,7 @@ done:
}
static s32
-wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
+brcmf_add_keyext(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, const u8 *mac_addr, struct key_params *params)
{
struct brcmf_wsec_key key;
@@ -1593,7 +1593,7 @@ wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
if (key.len == 0) {
/* key delete */
swap_key_from_BE(&key);
- err = wl_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
+ err = brcmf_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
if (unlikely(err)) {
WL_ERR("key delete error (%d)\n", err);
return err;
@@ -1653,7 +1653,7 @@ wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
swap_key_from_BE(&key);
brcmf_netdev_wait_pend8021x(dev);
- err = wl_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
+ err = brcmf_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
if (unlikely(err)) {
WL_ERR("WLC_SET_KEY error (%d)\n", err);
return err;
@@ -1663,7 +1663,7 @@ wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
}
static s32
-wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, bool pairwise, const u8 *mac_addr,
struct key_params *params)
{
@@ -1679,7 +1679,7 @@ wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
if (mac_addr) {
WL_TRACE("Exit");
- return wl_add_keyext(wiphy, dev, key_idx, mac_addr, params);
+ return brcmf_add_keyext(wiphy, dev, key_idx, mac_addr, params);
}
memset(&key, 0, sizeof(key));
@@ -1726,21 +1726,21 @@ wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
/* Set the new key/index */
swap_key_from_BE(&key);
- err = wl_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
+ err = brcmf_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
if (unlikely(err)) {
WL_ERR("WLC_SET_KEY error (%d)\n", err);
goto done;
}
val = WEP_ENABLED;
- err = wl_dev_intvar_get(dev, "wsec", &wsec);
+ err = brcmf_dev_intvar_get(dev, "wsec", &wsec);
if (unlikely(err)) {
WL_ERR("get wsec error (%d)\n", err);
goto done;
}
wsec &= ~(WEP_ENABLED);
wsec |= val;
- err = wl_dev_intvar_set(dev, "wsec", wsec);
+ err = brcmf_dev_intvar_set(dev, "wsec", wsec);
if (unlikely(err)) {
WL_ERR("set wsec error (%d)\n", err);
goto done;
@@ -1748,7 +1748,7 @@ wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
val = 1; /* assume shared key. otherwise 0 */
val = cpu_to_le32(val);
- err = wl_dev_ioctl(dev, BRCMF_C_SET_AUTH, &val, sizeof(val));
+ err = brcmf_dev_ioctl(dev, BRCMF_C_SET_AUTH, &val, sizeof(val));
if (unlikely(err))
WL_ERR("WLC_SET_AUTH error (%d)\n", err);
done:
@@ -1757,7 +1757,7 @@ done:
}
static s32
-wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, bool pairwise, const u8 *mac_addr)
{
struct brcmf_wsec_key key;
@@ -1776,7 +1776,7 @@ wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
WL_CONN("key index (%d)\n", key_idx);
/* Set the new key/index */
swap_key_from_BE(&key);
- err = wl_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
+ err = brcmf_dev_ioctl(dev, BRCMF_C_SET_KEY, &key, sizeof(key));
if (unlikely(err)) {
if (err == -EINVAL) {
if (key.index >= DOT11_MAX_DEFAULT_KEYS)
@@ -1791,7 +1791,7 @@ wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
}
val = 0;
- err = wl_dev_intvar_get(dev, "wsec", &wsec);
+ err = brcmf_dev_intvar_get(dev, "wsec", &wsec);
if (unlikely(err)) {
WL_ERR("get wsec error (%d)\n", err);
/* Ignore this error, may happen during DISASSOC */
@@ -1800,7 +1800,7 @@ wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
}
wsec &= ~(WEP_ENABLED);
wsec |= val;
- err = wl_dev_intvar_set(dev, "wsec", wsec);
+ err = brcmf_dev_intvar_set(dev, "wsec", wsec);
if (unlikely(err)) {
WL_ERR("set wsec error (%d)\n", err);
/* Ignore this error, may happen during DISASSOC */
@@ -1810,7 +1810,7 @@ wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
val = 0; /* assume open key. otherwise 1 */
val = cpu_to_le32(val);
- err = wl_dev_ioctl(dev, BRCMF_C_SET_AUTH, &val, sizeof(val));
+ err = brcmf_dev_ioctl(dev, BRCMF_C_SET_AUTH, &val, sizeof(val));
if (unlikely(err)) {
WL_ERR("WLC_SET_AUTH error (%d)\n", err);
/* Ignore this error, may happen during DISASSOC */
@@ -1822,7 +1822,7 @@ done:
}
static s32
-wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, bool pairwise, const u8 *mac_addr, void *cookie,
void (*callback) (void *cookie, struct key_params * params))
{
@@ -1844,7 +1844,7 @@ wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
params.key_len = (u8) min_t(u8, WLAN_MAX_KEY_LEN, key.len);
memcpy(params.key, key.data, params.key_len);
- err = wl_dev_ioctl(dev, BRCMF_C_GET_WSEC, &wsec, sizeof(wsec));
+ err = brcmf_dev_ioctl(dev, BRCMF_C_GET_WSEC, &wsec, sizeof(wsec));
if (unlikely(err)) {
WL_ERR("WLC_GET_WSEC error (%d)\n", err);
/* Ignore this error, may happen during DISASSOC */
@@ -1854,7 +1854,7 @@ wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
wsec = le32_to_cpu(wsec);
switch (wsec) {
case WEP_ENABLED:
- sec = wl_read_prof(wl, WL_PROF_SEC);
+ sec = brcmf_read_prof(wl, WL_PROF_SEC);
if (sec->cipher_pairwise & WLAN_CIPHER_SUITE_WEP40) {
params.cipher = WLAN_CIPHER_SUITE_WEP40;
WL_CONN("WLAN_CIPHER_SUITE_WEP40\n");
@@ -1884,7 +1884,7 @@ done:
}
static s32
-wl_cfg80211_config_default_mgmt_key(struct wiphy *wiphy,
+brcmf_cfg80211_config_default_mgmt_key(struct wiphy *wiphy,
struct net_device *dev, u8 key_idx)
{
WL_INFO("Not supported\n");
@@ -1894,7 +1894,7 @@ wl_cfg80211_config_default_mgmt_key(struct wiphy *wiphy,
}
static s32
-wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
u8 *mac, struct station_info *sinfo)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
@@ -1902,7 +1902,7 @@ wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
int rssi;
s32 rate;
s32 err = 0;
- u8 *bssid = wl_read_prof(wl, WL_PROF_BSSID);
+ u8 *bssid = brcmf_read_prof(wl, WL_PROF_BSSID);
WL_TRACE("Enter\n");
CHECK_SYS_UP();
@@ -1919,7 +1919,7 @@ wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
}
/* Report the current tx rate */
- err = wl_dev_ioctl(dev, BRCMF_C_GET_RATE, &rate, sizeof(rate));
+ err = brcmf_dev_ioctl(dev, BRCMF_C_GET_RATE, &rate, sizeof(rate));
if (err) {
WL_ERR("Could not get rate (%d)\n", err);
} else {
@@ -1931,7 +1931,7 @@ wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
if (test_bit(WL_STATUS_CONNECTED, &wl->status)) {
scb_val.val = 0;
- err = wl_dev_ioctl(dev, BRCMF_C_GET_RSSI, &scb_val,
+ err = brcmf_dev_ioctl(dev, BRCMF_C_GET_RSSI, &scb_val,
sizeof(struct brcmf_scb_val));
if (unlikely(err)) {
WL_ERR("Could not get rssi (%d)\n", err);
@@ -1948,7 +1948,7 @@ done:
}
static s32
-wl_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
bool enabled, s32 timeout)
{
s32 pm;
@@ -1961,7 +1961,7 @@ wl_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
pm = cpu_to_le32(pm);
WL_INFO("power save %s\n", (pm ? "enabled" : "disabled"));
- err = wl_dev_ioctl(dev, BRCMF_C_SET_PM, &pm, sizeof(pm));
+ err = brcmf_dev_ioctl(dev, BRCMF_C_SET_PM, &pm, sizeof(pm));
if (unlikely(err)) {
if (err == -ENODEV)
WL_ERR("net_device is not ready yet\n");
@@ -1972,7 +1972,7 @@ wl_cfg80211_set_power_mgmt(struct wiphy *wiphy, struct net_device *dev,
return err;
}
-static __used u32 wl_find_msb(u16 bit16)
+static __used u32 brcmf_find_msb(u16 bit16)
{
u32 ret = 0;
@@ -2000,7 +2000,7 @@ static __used u32 wl_find_msb(u16 bit16)
}
static s32
-wl_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
const u8 *addr,
const struct cfg80211_bitrate_mask *mask)
{
@@ -2017,7 +2017,7 @@ wl_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
/* addr param is always NULL. ignore it */
/* Get current rateset */
- err = wl_dev_ioctl(dev, WLC_GET_CURR_RATESET, &rateset,
+ err = brcmf_dev_ioctl(dev, WLC_GET_CURR_RATESET, &rateset,
sizeof(rateset));
if (unlikely(err)) {
WL_ERR("could not get current rateset (%d)\n", err);
@@ -2026,9 +2026,9 @@ wl_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
rateset.count = le32_to_cpu(rateset.count);
- legacy = wl_find_msb(mask->control[IEEE80211_BAND_2GHZ].legacy);
+ legacy = brcmf_find_msb(mask->control[IEEE80211_BAND_2GHZ].legacy);
if (!legacy)
- legacy = wl_find_msb(mask->control[IEEE80211_BAND_5GHZ].legacy);
+ legacy = brcmf_find_msb(mask->control[IEEE80211_BAND_5GHZ].legacy);
val = wl_g_rates[legacy - 1].bitrate * 100000;
@@ -2046,8 +2046,8 @@ wl_cfg80211_set_bitrate_mask(struct wiphy *wiphy, struct net_device *dev,
* Set rate override,
* Since the is a/b/g-blind, both a/bg_rate are enforced.
*/
- err_bg = wl_dev_intvar_set(dev, "bg_rate", rate);
- err_a = wl_dev_intvar_set(dev, "a_rate", rate);
+ err_bg = brcmf_dev_intvar_set(dev, "bg_rate", rate);
+ err_a = brcmf_dev_intvar_set(dev, "a_rate", rate);
if (unlikely(err_bg && err_a)) {
WL_ERR("could not set fixed rate (%d) (%d)\n", err_bg, err_a);
err = err_bg | err_a;
@@ -2058,7 +2058,7 @@ done:
return err;
}
-static s32 wl_cfg80211_resume(struct wiphy *wiphy)
+static s32 brcmf_cfg80211_resume(struct wiphy *wiphy)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
@@ -2074,13 +2074,13 @@ static s32 wl_cfg80211_resume(struct wiphy *wiphy)
#endif /* defined(CONFIG_PM_SLEEP) */
if (test_bit(WL_STATUS_READY, &wl->status))
- wl_invoke_iscan(wiphy_to_wl(wiphy));
+ brcmf_invoke_iscan(wiphy_to_wl(wiphy));
WL_TRACE("Exit\n");
return 0;
}
-static s32 wl_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow)
+static s32 brcmf_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
struct net_device *ndev = wl_to_ndev(wl);
@@ -2102,7 +2102,7 @@ static s32 wl_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow)
test_bit(WL_STATUS_READY, &wl->status)) {
WL_INFO("Disassociating from AP"
" while entering suspend state\n");
- wl_link_down(wl);
+ brcmf_link_down(wl);
/*
* Make sure WPA_Supplicant receives all the event
@@ -2110,13 +2110,13 @@ static s32 wl_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow)
* the state fw and WPA_Supplicant state consistent
*/
rtnl_unlock();
- wl_delay(500);
+ brcmf_delay(500);
rtnl_lock();
}
set_bit(WL_STATUS_SCAN_ABORTING, &wl->status);
if (test_bit(WL_STATUS_READY, &wl->status))
- wl_term_iscan(wl);
+ brcmf_term_iscan(wl);
if (wl->scan_request) {
/* Indidate scan abort to cfg80211 layer */
@@ -2130,7 +2130,7 @@ static s32 wl_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow)
/* Turn off watchdog timer */
if (test_bit(WL_STATUS_READY, &wl->status)) {
WL_INFO("Enable MPC\n");
- wl_set_mpc(ndev, 1);
+ brcmf_set_mpc(ndev, 1);
}
#if defined(CONFIG_PM_SLEEP)
@@ -2143,7 +2143,7 @@ static s32 wl_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow)
}
static __used s32
-wl_update_pmklist(struct net_device *dev, struct wl_pmk_list *pmk_list,
+brcmf_update_pmklist(struct net_device *dev, struct wl_pmk_list *pmk_list,
s32 err)
{
int i, j;
@@ -2157,14 +2157,14 @@ wl_update_pmklist(struct net_device *dev, struct wl_pmk_list *pmk_list,
}
if (likely(!err))
- wl_dev_bufvar_set(dev, "pmkid_info", (char *)pmk_list,
+ brcmf_dev_bufvar_set(dev, "pmkid_info", (char *)pmk_list,
sizeof(*pmk_list));
return err;
}
static s32
-wl_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_pmksa *pmksa)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
@@ -2195,14 +2195,14 @@ wl_cfg80211_set_pmksa(struct wiphy *wiphy, struct net_device *dev,
wl->pmk_list->pmkids.pmkid[wl->pmk_list->pmkids.npmkid].
PMKID[i]);
- err = wl_update_pmklist(dev, wl->pmk_list, err);
+ err = brcmf_update_pmklist(dev, wl->pmk_list, err);
WL_TRACE("Exit\n");
return err;
}
static s32
-wl_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
+brcmf_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_pmksa *pmksa)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
@@ -2241,7 +2241,7 @@ wl_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
} else
err = -EINVAL;
- err = wl_update_pmklist(dev, wl->pmk_list, err);
+ err = brcmf_update_pmklist(dev, wl->pmk_list, err);
WL_TRACE("Exit\n");
return err;
@@ -2249,7 +2249,7 @@ wl_cfg80211_del_pmksa(struct wiphy *wiphy, struct net_device *dev,
}
static s32
-wl_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *dev)
+brcmf_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *dev)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
s32 err = 0;
@@ -2258,7 +2258,7 @@ wl_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *dev)
CHECK_SYS_UP();
memset(wl->pmk_list, 0, sizeof(*wl->pmk_list));
- err = wl_update_pmklist(dev, wl->pmk_list, err);
+ err = brcmf_update_pmklist(dev, wl->pmk_list, err);
WL_TRACE("Exit\n");
return err;
@@ -2266,31 +2266,31 @@ wl_cfg80211_flush_pmksa(struct wiphy *wiphy, struct net_device *dev)
}
static struct cfg80211_ops wl_cfg80211_ops = {
- .change_virtual_intf = wl_cfg80211_change_iface,
- .scan = wl_cfg80211_scan,
- .set_wiphy_params = wl_cfg80211_set_wiphy_params,
- .join_ibss = wl_cfg80211_join_ibss,
- .leave_ibss = wl_cfg80211_leave_ibss,
- .get_station = wl_cfg80211_get_station,
- .set_tx_power = wl_cfg80211_set_tx_power,
- .get_tx_power = wl_cfg80211_get_tx_power,
- .add_key = wl_cfg80211_add_key,
- .del_key = wl_cfg80211_del_key,
- .get_key = wl_cfg80211_get_key,
- .set_default_key = wl_cfg80211_config_default_key,
- .set_default_mgmt_key = wl_cfg80211_config_default_mgmt_key,
- .set_power_mgmt = wl_cfg80211_set_power_mgmt,
- .set_bitrate_mask = wl_cfg80211_set_bitrate_mask,
- .connect = wl_cfg80211_connect,
- .disconnect = wl_cfg80211_disconnect,
- .suspend = wl_cfg80211_suspend,
- .resume = wl_cfg80211_resume,
- .set_pmksa = wl_cfg80211_set_pmksa,
- .del_pmksa = wl_cfg80211_del_pmksa,
- .flush_pmksa = wl_cfg80211_flush_pmksa
+ .change_virtual_intf = brcmf_cfg80211_change_iface,
+ .scan = brcmf_cfg80211_scan,
+ .set_wiphy_params = brcmf_cfg80211_set_wiphy_params,
+ .join_ibss = brcmf_cfg80211_join_ibss,
+ .leave_ibss = brcmf_cfg80211_leave_ibss,
+ .get_station = brcmf_cfg80211_get_station,
+ .set_tx_power = brcmf_cfg80211_set_tx_power,
+ .get_tx_power = brcmf_cfg80211_get_tx_power,
+ .add_key = brcmf_cfg80211_add_key,
+ .del_key = brcmf_cfg80211_del_key,
+ .get_key = brcmf_cfg80211_get_key,
+ .set_default_key = brcmf_cfg80211_config_default_key,
+ .set_default_mgmt_key = brcmf_cfg80211_config_default_mgmt_key,
+ .set_power_mgmt = brcmf_cfg80211_set_power_mgmt,
+ .set_bitrate_mask = brcmf_cfg80211_set_bitrate_mask,
+ .connect = brcmf_cfg80211_connect,
+ .disconnect = brcmf_cfg80211_disconnect,
+ .suspend = brcmf_cfg80211_suspend,
+ .resume = brcmf_cfg80211_resume,
+ .set_pmksa = brcmf_cfg80211_set_pmksa,
+ .del_pmksa = brcmf_cfg80211_del_pmksa,
+ .flush_pmksa = brcmf_cfg80211_flush_pmksa
};
-static s32 wl_mode_to_nl80211_iftype(s32 mode)
+static s32 brcmf_mode_to_nl80211_iftype(s32 mode)
{
s32 err = 0;
@@ -2306,7 +2306,7 @@ static s32 wl_mode_to_nl80211_iftype(s32 mode)
return err;
}
-static struct wireless_dev *wl_alloc_wdev(s32 sizeof_iface,
+static struct wireless_dev *brcmf_alloc_wdev(s32 sizeof_iface,
struct device *dev)
{
struct wireless_dev *wdev;
@@ -2364,7 +2364,7 @@ wiphy_new_out:
return ERR_PTR(err);
}
-static void wl_free_wdev(struct wl_priv *wl)
+static void brcmf_free_wdev(struct wl_priv *wl)
{
struct wireless_dev *wdev = wl_to_wdev(wl);
@@ -2378,7 +2378,7 @@ static void wl_free_wdev(struct wl_priv *wl)
wl_to_wdev(wl) = NULL;
}
-static s32 wl_inform_bss(struct wl_priv *wl)
+static s32 brcmf_inform_bss(struct wl_priv *wl)
{
struct brcmf_scan_results *bss_list;
struct brcmf_bss_info *bi = NULL; /* must be initialized */
@@ -2394,7 +2394,7 @@ static s32 wl_inform_bss(struct wl_priv *wl)
WL_SCAN("scanned AP count (%d)\n", bss_list->count);
bi = next_bss(bss_list, bi);
for_each_bss(bss_list, bi, i) {
- err = wl_inform_single_bss(wl, bi);
+ err = brcmf_inform_single_bss(wl, bi);
if (unlikely(err))
break;
}
@@ -2402,7 +2402,7 @@ static s32 wl_inform_bss(struct wl_priv *wl)
}
-static s32 wl_inform_single_bss(struct wl_priv *wl, struct brcmf_bss_info *bi)
+static s32 brcmf_inform_single_bss(struct wl_priv *wl, struct brcmf_bss_info *bi)
{
struct wiphy *wiphy = wl_to_wiphy(wl);
struct ieee80211_channel *notify_channel;
@@ -2491,7 +2491,7 @@ wl_inform_ibss(struct wl_priv *wl, struct net_device *dev, const u8 *bssid)
*(u32 *)buf = cpu_to_le32(WL_BSS_INFO_MAX);
- err = wl_dev_ioctl(dev, BRCMF_C_GET_BSS_INFO, buf, WL_BSS_INFO_MAX);
+ err = brcmf_dev_ioctl(dev, BRCMF_C_GET_BSS_INFO, buf, WL_BSS_INFO_MAX);
if (unlikely(err)) {
WL_ERR("WLC_GET_BSS_INFO failed: %d\n", err);
goto CleanUp;
@@ -2536,7 +2536,7 @@ CleanUp:
return err;
}
-static bool wl_is_linkup(struct wl_priv *wl, const brcmf_event_msg_t *e)
+static bool brcmf_is_linkup(struct wl_priv *wl, const brcmf_event_msg_t *e)
{
u32 event = be32_to_cpu(e->event_type);
u32 status = be32_to_cpu(e->status);
@@ -2550,7 +2550,7 @@ static bool wl_is_linkup(struct wl_priv *wl, const brcmf_event_msg_t *e)
return false;
}
-static bool wl_is_linkdown(struct wl_priv *wl, const brcmf_event_msg_t *e)
+static bool brcmf_is_linkdown(struct wl_priv *wl, const brcmf_event_msg_t *e)
{
u32 event = be32_to_cpu(e->event_type);
u16 flags = be16_to_cpu(e->flags);
@@ -2562,7 +2562,7 @@ static bool wl_is_linkdown(struct wl_priv *wl, const brcmf_event_msg_t *e)
return false;
}
-static bool wl_is_nonetwork(struct wl_priv *wl, const brcmf_event_msg_t *e)
+static bool brcmf_is_nonetwork(struct wl_priv *wl, const brcmf_event_msg_t *e)
{
u32 event = be32_to_cpu(e->event_type);
u32 status = be32_to_cpu(e->status);
@@ -2583,51 +2583,51 @@ static bool wl_is_nonetwork(struct wl_priv *wl, const brcmf_event_msg_t *e)
}
static s32
-wl_notify_connect_status(struct wl_priv *wl, struct net_device *ndev,
+brcmf_notify_connect_status(struct wl_priv *wl, struct net_device *ndev,
const brcmf_event_msg_t *e, void *data)
{
s32 err = 0;
- if (wl_is_linkup(wl, e)) {
+ if (brcmf_is_linkup(wl, e)) {
WL_CONN("Linkup\n");
- if (wl_is_ibssmode(wl)) {
- wl_update_prof(wl, NULL, (void *)e->addr,
+ if (brcmf_is_ibssmode(wl)) {
+ brcmf_update_prof(wl, NULL, (void *)e->addr,
WL_PROF_BSSID);
wl_inform_ibss(wl, ndev, e->addr);
cfg80211_ibss_joined(ndev, e->addr, GFP_KERNEL);
clear_bit(WL_STATUS_CONNECTING, &wl->status);
set_bit(WL_STATUS_CONNECTED, &wl->status);
} else
- wl_bss_connect_done(wl, ndev, e, data, true);
- } else if (wl_is_linkdown(wl, e)) {
+ brcmf_bss_connect_done(wl, ndev, e, data, true);
+ } else if (brcmf_is_linkdown(wl, e)) {
WL_CONN("Linkdown\n");
- if (wl_is_ibssmode(wl)) {
+ if (brcmf_is_ibssmode(wl)) {
clear_bit(WL_STATUS_CONNECTING, &wl->status);
if (test_and_clear_bit(WL_STATUS_CONNECTED,
&wl->status))
- wl_link_down(wl);
+ brcmf_link_down(wl);
} else {
- wl_bss_connect_done(wl, ndev, e, data, false);
+ brcmf_bss_connect_done(wl, ndev, e, data, false);
if (test_and_clear_bit(WL_STATUS_CONNECTED,
&wl->status)) {
cfg80211_disconnected(ndev, 0, NULL, 0,
GFP_KERNEL);
- wl_link_down(wl);
+ brcmf_link_down(wl);
}
}
- wl_init_prof(wl->profile);
- } else if (wl_is_nonetwork(wl, e)) {
- if (wl_is_ibssmode(wl))
+ brcmf_init_prof(wl->profile);
+ } else if (brcmf_is_nonetwork(wl, e)) {
+ if (brcmf_is_ibssmode(wl))
clear_bit(WL_STATUS_CONNECTING, &wl->status);
else
- wl_bss_connect_done(wl, ndev, e, data, false);
+ brcmf_bss_connect_done(wl, ndev, e, data, false);
}
return err;
}
static s32
-wl_notify_roaming_status(struct wl_priv *wl, struct net_device *ndev,
+brcmf_notify_roaming_status(struct wl_priv *wl, struct net_device *ndev,
const brcmf_event_msg_t *e, void *data)
{
s32 err = 0;
@@ -2636,16 +2636,16 @@ wl_notify_roaming_status(struct wl_priv *wl, struct net_device *ndev,
if (event == BRCMF_E_ROAM && status == BRCMF_E_STATUS_SUCCESS) {
if (test_bit(WL_STATUS_CONNECTED, &wl->status))
- wl_bss_roaming_done(wl, ndev, e, data);
+ brcmf_bss_roaming_done(wl, ndev, e, data);
else
- wl_bss_connect_done(wl, ndev, e, data, true);
+ brcmf_bss_connect_done(wl, ndev, e, data, true);
}
return err;
}
static __used s32
-wl_dev_bufvar_set(struct net_device *dev, s8 *name, s8 *buf, s32 len)
+brcmf_dev_bufvar_set(struct net_device *dev, s8 *name, s8 *buf, s32 len)
{
struct wl_priv *wl = ndev_to_wl(dev);
u32 buflen;
@@ -2653,11 +2653,11 @@ wl_dev_bufvar_set(struct net_device *dev, s8 *name, s8 *buf, s32 len)
buflen = brcmu_mkiovar(name, buf, len, wl->ioctl_buf, WL_IOCTL_LEN_MAX);
BUG_ON(!buflen);
- return wl_dev_ioctl(dev, BRCMF_C_SET_VAR, wl->ioctl_buf, buflen);
+ return brcmf_dev_ioctl(dev, BRCMF_C_SET_VAR, wl->ioctl_buf, buflen);
}
static s32
-wl_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
+brcmf_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
s32 buf_len)
{
struct wl_priv *wl = ndev_to_wl(dev);
@@ -2666,7 +2666,7 @@ wl_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
len = brcmu_mkiovar(name, NULL, 0, wl->ioctl_buf, WL_IOCTL_LEN_MAX);
BUG_ON(!len);
- err = wl_dev_ioctl(dev, BRCMF_C_GET_VAR, (void *)wl->ioctl_buf,
+ err = brcmf_dev_ioctl(dev, BRCMF_C_GET_VAR, (void *)wl->ioctl_buf,
WL_IOCTL_LEN_MAX);
if (unlikely(err)) {
WL_ERR("error (%d)\n", err);
@@ -2677,7 +2677,7 @@ wl_dev_bufvar_get(struct net_device *dev, s8 *name, s8 *buf,
return err;
}
-static s32 wl_get_assoc_ies(struct wl_priv *wl)
+static s32 brcmf_get_assoc_ies(struct wl_priv *wl)
{
struct net_device *ndev = wl_to_ndev(wl);
struct wl_assoc_ielen *assoc_info;
@@ -2686,9 +2686,9 @@ static s32 wl_get_assoc_ies(struct wl_priv *wl)
u32 resp_len;
s32 err = 0;
- wl_clear_assoc_ies(wl);
+ brcmf_clear_assoc_ies(wl);
- err = wl_dev_bufvar_get(ndev, "assoc_info", wl->extra_buf,
+ err = brcmf_dev_bufvar_get(ndev, "assoc_info", wl->extra_buf,
WL_ASSOC_INFO_MAX);
if (unlikely(err)) {
WL_ERR("could not get assoc info (%d)\n", err);
@@ -2698,7 +2698,7 @@ static s32 wl_get_assoc_ies(struct wl_priv *wl)
req_len = assoc_info->req_len;
resp_len = assoc_info->resp_len;
if (req_len) {
- err = wl_dev_bufvar_get(ndev, "assoc_req_ies", wl->extra_buf,
+ err = brcmf_dev_bufvar_get(ndev, "assoc_req_ies", wl->extra_buf,
WL_ASSOC_INFO_MAX);
if (unlikely(err)) {
WL_ERR("could not get assoc req (%d)\n", err);
@@ -2712,7 +2712,7 @@ static s32 wl_get_assoc_ies(struct wl_priv *wl)
conn_info->req_ie = NULL;
}
if (resp_len) {
- err = wl_dev_bufvar_get(ndev, "assoc_resp_ies", wl->extra_buf,
+ err = brcmf_dev_bufvar_get(ndev, "assoc_resp_ies", wl->extra_buf,
WL_ASSOC_INFO_MAX);
if (unlikely(err)) {
WL_ERR("could not get assoc resp (%d)\n", err);
@@ -2731,7 +2731,7 @@ static s32 wl_get_assoc_ies(struct wl_priv *wl)
return err;
}
-static void wl_clear_assoc_ies(struct wl_priv *wl)
+static void brcmf_clear_assoc_ies(struct wl_priv *wl)
{
struct wl_connect_info *conn_info = wl_to_conn(wl);
@@ -2744,7 +2744,7 @@ static void wl_clear_assoc_ies(struct wl_priv *wl)
}
-static void wl_ch_to_chanspec(int ch, struct brcmf_join_params *join_params,
+static void brcmf_ch_to_chanspec(int ch, struct brcmf_join_params *join_params,
size_t *join_params_size)
{
chanspec_t chanspec = 0;
@@ -2778,7 +2778,7 @@ static void wl_ch_to_chanspec(int ch, struct brcmf_join_params *join_params,
}
}
-static s32 wl_update_bss_info(struct wl_priv *wl)
+static s32 brcmf_update_bss_info(struct wl_priv *wl)
{
struct brcmf_bss_info *bi;
struct brcmf_ssid *ssid;
@@ -2790,13 +2790,13 @@ static s32 wl_update_bss_info(struct wl_priv *wl)
s32 err = 0;
WL_TRACE("Enter\n");
- if (wl_is_ibssmode(wl))
+ if (brcmf_is_ibssmode(wl))
return err;
- ssid = (struct brcmf_ssid *)wl_read_prof(wl, WL_PROF_SSID);
+ ssid = (struct brcmf_ssid *)brcmf_read_prof(wl, WL_PROF_SSID);
*(u32 *)wl->extra_buf = cpu_to_le32(WL_EXTRA_BUF_MAX);
- err = wl_dev_ioctl(wl_to_ndev(wl), BRCMF_C_GET_BSS_INFO,
+ err = brcmf_dev_ioctl(wl_to_ndev(wl), BRCMF_C_GET_BSS_INFO,
wl->extra_buf, WL_EXTRA_BUF_MAX);
if (unlikely(err)) {
WL_ERR("Could not get bss info %d\n", err);
@@ -2804,7 +2804,7 @@ static s32 wl_update_bss_info(struct wl_priv *wl)
}
bi = (struct brcmf_bss_info *)(wl->extra_buf + 4);
- err = wl_inform_single_bss(wl, bi);
+ err = brcmf_inform_single_bss(wl, bi);
if (unlikely(err))
goto update_bss_info_out;
@@ -2822,7 +2822,7 @@ static s32 wl_update_bss_info(struct wl_priv *wl)
* so we speficially query dtim information to dongle.
*/
u32 var;
- err = wl_dev_intvar_get(wl_to_ndev(wl), "dtim_assoc", &var);
+ err = brcmf_dev_intvar_get(wl_to_ndev(wl), "dtim_assoc", &var);
if (unlikely(err)) {
WL_ERR("wl dtim_assoc failed (%d)\n", err);
goto update_bss_info_out;
@@ -2830,8 +2830,8 @@ static s32 wl_update_bss_info(struct wl_priv *wl)
dtim_period = (u8)var;
}
- wl_update_prof(wl, NULL, &beacon_interval, WL_PROF_BEACONINT);
- wl_update_prof(wl, NULL, &dtim_period, WL_PROF_DTIMPERIOD);
+ brcmf_update_prof(wl, NULL, &beacon_interval, WL_PROF_BEACONINT);
+ brcmf_update_prof(wl, NULL, &dtim_period, WL_PROF_DTIMPERIOD);
update_bss_info_out:
WL_TRACE("Exit");
@@ -2839,7 +2839,7 @@ update_bss_info_out:
}
static s32
-wl_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
+brcmf_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
const brcmf_event_msg_t *e, void *data)
{
struct wl_connect_info *conn_info = wl_to_conn(wl);
@@ -2847,12 +2847,12 @@ wl_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
WL_TRACE("Enter\n");
- wl_get_assoc_ies(wl);
- wl_update_prof(wl, NULL, &e->addr, WL_PROF_BSSID);
- wl_update_bss_info(wl);
+ brcmf_get_assoc_ies(wl);
+ brcmf_update_prof(wl, NULL, &e->addr, WL_PROF_BSSID);
+ brcmf_update_bss_info(wl);
cfg80211_roamed(ndev, NULL,
- (u8 *)wl_read_prof(wl, WL_PROF_BSSID),
+ (u8 *)brcmf_read_prof(wl, WL_PROF_BSSID),
conn_info->req_ie, conn_info->req_ie_len,
conn_info->resp_ie, conn_info->resp_ie_len, GFP_KERNEL);
WL_CONN("Report roaming result\n");
@@ -2863,7 +2863,7 @@ wl_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
}
static s32
-wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
+brcmf_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
const brcmf_event_msg_t *e, void *data, bool completed)
{
struct wl_connect_info *conn_info = wl_to_conn(wl);
@@ -2873,12 +2873,12 @@ wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
if (test_and_clear_bit(WL_STATUS_CONNECTING, &wl->status)) {
if (completed) {
- wl_get_assoc_ies(wl);
- wl_update_prof(wl, NULL, &e->addr, WL_PROF_BSSID);
- wl_update_bss_info(wl);
+ brcmf_get_assoc_ies(wl);
+ brcmf_update_prof(wl, NULL, &e->addr, WL_PROF_BSSID);
+ brcmf_update_bss_info(wl);
}
cfg80211_connect_result(ndev,
- (u8 *)wl_read_prof(wl, WL_PROF_BSSID),
+ (u8 *)brcmf_read_prof(wl, WL_PROF_BSSID),
conn_info->req_ie,
conn_info->req_ie_len,
conn_info->resp_ie,
@@ -2895,7 +2895,7 @@ wl_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
}
static s32
-wl_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
+brcmf_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
const brcmf_event_msg_t *e, void *data)
{
u16 flags = be16_to_cpu(e->flags);
@@ -2915,7 +2915,7 @@ wl_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
}
static s32
-wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
+brcmf_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
const brcmf_event_msg_t *e, void *data)
{
struct brcmf_channel_info channel_inform;
@@ -2928,7 +2928,7 @@ wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
if (wl->iscan_on && wl->iscan_kickstart) {
WL_TRACE("Exit\n");
- return wl_wakeup_iscan(wl_to_iscan(wl));
+ return brcmf_wakeup_iscan(wl_to_iscan(wl));
}
if (unlikely(!test_and_clear_bit(WL_STATUS_SCANNING, &wl->status))) {
@@ -2938,7 +2938,7 @@ wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
goto scan_done_out;
}
- err = wl_dev_ioctl(ndev, BRCMF_C_GET_CHANNEL, &channel_inform,
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_GET_CHANNEL, &channel_inform,
sizeof(channel_inform));
if (unlikely(err)) {
WL_ERR("scan busy (%d)\n", err);
@@ -2956,7 +2956,7 @@ wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
memset(bss_list, 0, len);
bss_list->buflen = cpu_to_le32(len);
- err = wl_dev_ioctl(ndev, BRCMF_C_SCAN_RESULTS, bss_list, len);
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_SCAN_RESULTS, bss_list, len);
if (unlikely(err)) {
WL_ERR("%s Scan_results error (%d)\n", ndev->name, err);
err = -EINVAL;
@@ -2967,7 +2967,7 @@ wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
bss_list->version = le32_to_cpu(bss_list->version);
bss_list->count = le32_to_cpu(bss_list->count);
- err = wl_inform_bss(wl);
+ err = brcmf_inform_bss(wl);
if (err) {
scan_abort = true;
goto scan_done_out;
@@ -2977,7 +2977,7 @@ scan_done_out:
if (wl->scan_request) {
WL_SCAN("calling cfg80211_scan_done\n");
cfg80211_scan_done(wl->scan_request, scan_abort);
- wl_set_mpc(ndev, 1);
+ brcmf_set_mpc(ndev, 1);
wl->scan_request = NULL;
}
@@ -2986,7 +2986,7 @@ scan_done_out:
return err;
}
-static void wl_init_conf(struct wl_conf *conf)
+static void brcmf_init_conf(struct wl_conf *conf)
{
conf->mode = (u32)-1;
conf->frag_threshold = (u32)-1;
@@ -2996,22 +2996,22 @@ static void wl_init_conf(struct wl_conf *conf)
conf->tx_power = -1;
}
-static void wl_init_prof(struct wl_profile *prof)
+static void brcmf_init_prof(struct wl_profile *prof)
{
memset(prof, 0, sizeof(*prof));
}
-static void wl_init_eloop_handler(struct wl_event_loop *el)
+static void brcmf_init_eloop_handler(struct wl_event_loop *el)
{
memset(el, 0, sizeof(*el));
- el->handler[BRCMF_E_SCAN_COMPLETE] = wl_notify_scan_status;
- el->handler[BRCMF_E_LINK] = wl_notify_connect_status;
- el->handler[BRCMF_E_ROAM] = wl_notify_roaming_status;
- el->handler[BRCMF_E_MIC_ERROR] = wl_notify_mic_status;
- el->handler[BRCMF_E_SET_SSID] = wl_notify_connect_status;
+ el->handler[BRCMF_E_SCAN_COMPLETE] = brcmf_notify_scan_status;
+ el->handler[BRCMF_E_LINK] = brcmf_notify_connect_status;
+ el->handler[BRCMF_E_ROAM] = brcmf_notify_roaming_status;
+ el->handler[BRCMF_E_MIC_ERROR] = brcmf_notify_mic_status;
+ el->handler[BRCMF_E_SET_SSID] = brcmf_notify_connect_status;
}
-static s32 wl_init_priv_mem(struct wl_priv *wl)
+static s32 brcmf_init_priv_mem(struct wl_priv *wl)
{
wl->scan_results = kzalloc(WL_SCAN_BUF_MAX, GFP_KERNEL);
if (unlikely(!wl->scan_results)) {
@@ -3062,12 +3062,12 @@ static s32 wl_init_priv_mem(struct wl_priv *wl)
return 0;
init_priv_mem_out:
- wl_deinit_priv_mem(wl);
+ brcmf_deinit_priv_mem(wl);
return -ENOMEM;
}
-static void wl_deinit_priv_mem(struct wl_priv *wl)
+static void brcmf_deinit_priv_mem(struct wl_priv *wl)
{
kfree(wl->scan_results);
wl->scan_results = NULL;
@@ -3089,10 +3089,10 @@ static void wl_deinit_priv_mem(struct wl_priv *wl)
wl->pmk_list = NULL;
}
-static s32 wl_create_event_handler(struct wl_priv *wl)
+static s32 brcmf_create_event_handler(struct wl_priv *wl)
{
sema_init(&wl->event_sync, 0);
- wl->event_tsk = kthread_run(wl_event_handler, wl, "wl_event_handler");
+ wl->event_tsk = kthread_run(brcmf_event_handler, wl, "wl_event_handler");
if (IS_ERR(wl->event_tsk)) {
wl->event_tsk = NULL;
WL_ERR("failed to create event thread\n");
@@ -3101,7 +3101,7 @@ static s32 wl_create_event_handler(struct wl_priv *wl)
return 0;
}
-static void wl_destroy_event_handler(struct wl_priv *wl)
+static void brcmf_destroy_event_handler(struct wl_priv *wl)
{
if (wl->event_tsk) {
send_sig(SIGTERM, wl->event_tsk, 1);
@@ -3110,7 +3110,7 @@ static void wl_destroy_event_handler(struct wl_priv *wl)
}
}
-static void wl_term_iscan(struct wl_priv *wl)
+static void brcmf_term_iscan(struct wl_priv *wl)
{
struct wl_iscan_ctrl *iscan = wl_to_iscan(wl);
@@ -3122,7 +3122,7 @@ static void wl_term_iscan(struct wl_priv *wl)
}
}
-static void wl_notify_iscan_complete(struct wl_iscan_ctrl *iscan, bool aborted)
+static void brcmf_notify_iscan_complete(struct wl_iscan_ctrl *iscan, bool aborted)
{
struct wl_priv *wl = iscan_to_wl(iscan);
struct net_device *ndev = wl_to_ndev(wl);
@@ -3135,13 +3135,13 @@ static void wl_notify_iscan_complete(struct wl_iscan_ctrl *iscan, bool aborted)
WL_SCAN("ISCAN Completed scan: %s\n",
aborted ? "Aborted" : "Done");
cfg80211_scan_done(wl->scan_request, aborted);
- wl_set_mpc(ndev, 1);
+ brcmf_set_mpc(ndev, 1);
wl->scan_request = NULL;
}
wl->iscan_kickstart = false;
}
-static s32 wl_wakeup_iscan(struct wl_iscan_ctrl *iscan)
+static s32 brcmf_wakeup_iscan(struct wl_iscan_ctrl *iscan)
{
if (likely(iscan->state != WL_ISCAN_STATE_IDLE)) {
WL_SCAN("wake up iscan\n");
@@ -3153,7 +3153,7 @@ static s32 wl_wakeup_iscan(struct wl_iscan_ctrl *iscan)
}
static s32
-wl_get_iscan_results(struct wl_iscan_ctrl *iscan, u32 *status,
+brcmf_get_iscan_results(struct wl_iscan_ctrl *iscan, u32 *status,
struct brcmf_scan_results **bss_list)
{
struct brcmf_iscan_results list;
@@ -3170,7 +3170,7 @@ wl_get_iscan_results(struct wl_iscan_ctrl *iscan, u32 *status,
memset(&list, 0, sizeof(list));
list.results.buflen = cpu_to_le32(WL_ISCAN_BUF_MAX);
- err = wl_dev_iovar_getbuf(iscan->dev, "iscanresults", &list,
+ err = brcmf_dev_iovar_getbuf(iscan->dev, "iscanresults", &list,
BRCMF_ISCAN_RESULTS_FIXED_SIZE, iscan->scan_buf,
WL_ISCAN_BUF_MAX);
if (unlikely(err)) {
@@ -3188,21 +3188,21 @@ wl_get_iscan_results(struct wl_iscan_ctrl *iscan, u32 *status,
return err;
}
-static s32 wl_iscan_done(struct wl_priv *wl)
+static s32 brcmf_iscan_done(struct wl_priv *wl)
{
struct wl_iscan_ctrl *iscan = wl->iscan;
s32 err = 0;
iscan->state = WL_ISCAN_STATE_IDLE;
rtnl_lock();
- wl_inform_bss(wl);
- wl_notify_iscan_complete(iscan, false);
+ brcmf_inform_bss(wl);
+ brcmf_notify_iscan_complete(iscan, false);
rtnl_unlock();
return err;
}
-static s32 wl_iscan_pending(struct wl_priv *wl)
+static s32 brcmf_iscan_pending(struct wl_priv *wl)
{
struct wl_iscan_ctrl *iscan = wl->iscan;
s32 err = 0;
@@ -3214,14 +3214,14 @@ static s32 wl_iscan_pending(struct wl_priv *wl)
return err;
}
-static s32 wl_iscan_inprogress(struct wl_priv *wl)
+static s32 brcmf_iscan_inprogress(struct wl_priv *wl)
{
struct wl_iscan_ctrl *iscan = wl->iscan;
s32 err = 0;
rtnl_lock();
- wl_inform_bss(wl);
- wl_run_iscan(iscan, NULL, BRCMF_SCAN_ACTION_CONTINUE);
+ brcmf_inform_bss(wl);
+ brcmf_run_iscan(iscan, NULL, BRCMF_SCAN_ACTION_CONTINUE);
rtnl_unlock();
/* Reschedule the timer */
mod_timer(&iscan->timer, jiffies + iscan->timer_ms * HZ / 1000);
@@ -3230,20 +3230,20 @@ static s32 wl_iscan_inprogress(struct wl_priv *wl)
return err;
}
-static s32 wl_iscan_aborted(struct wl_priv *wl)
+static s32 brcmf_iscan_aborted(struct wl_priv *wl)
{
struct wl_iscan_ctrl *iscan = wl->iscan;
s32 err = 0;
iscan->state = WL_ISCAN_STATE_IDLE;
rtnl_lock();
- wl_notify_iscan_complete(iscan, true);
+ brcmf_notify_iscan_complete(iscan, true);
rtnl_unlock();
return err;
}
-static s32 wl_iscan_thread(void *data)
+static s32 brcmf_iscan_thread(void *data)
{
struct sched_param param = {.sched_priority = MAX_RT_PRIO - 1 };
struct wl_iscan_ctrl *iscan = (struct wl_iscan_ctrl *)data;
@@ -3263,7 +3263,7 @@ static s32 wl_iscan_thread(void *data)
iscan->timer_on = 0;
}
rtnl_lock();
- err = wl_get_iscan_results(iscan, &status, &wl->bss_list);
+ err = brcmf_get_iscan_results(iscan, &status, &wl->bss_list);
if (unlikely(err)) {
status = BRCMF_SCAN_RESULTS_ABORTED;
WL_ERR("Abort iscan\n");
@@ -3280,18 +3280,18 @@ static s32 wl_iscan_thread(void *data)
return 0;
}
-static void wl_iscan_timer(unsigned long data)
+static void brcmf_iscan_timer(unsigned long data)
{
struct wl_iscan_ctrl *iscan = (struct wl_iscan_ctrl *)data;
if (iscan) {
iscan->timer_on = 0;
WL_SCAN("timer expired\n");
- wl_wakeup_iscan(iscan);
+ brcmf_wakeup_iscan(iscan);
}
}
-static s32 wl_invoke_iscan(struct wl_priv *wl)
+static s32 brcmf_invoke_iscan(struct wl_priv *wl)
{
struct wl_iscan_ctrl *iscan = wl_to_iscan(wl);
int err = 0;
@@ -3299,7 +3299,7 @@ static s32 wl_invoke_iscan(struct wl_priv *wl)
if (wl->iscan_on && !iscan->tsk) {
iscan->state = WL_ISCAN_STATE_IDLE;
sema_init(&iscan->sync, 0);
- iscan->tsk = kthread_run(wl_iscan_thread, iscan, "wl_iscan");
+ iscan->tsk = kthread_run(brcmf_iscan_thread, iscan, "wl_iscan");
if (IS_ERR(iscan->tsk)) {
WL_ERR("Could not create iscan thread\n");
iscan->tsk = NULL;
@@ -3310,17 +3310,17 @@ static s32 wl_invoke_iscan(struct wl_priv *wl)
return err;
}
-static void wl_init_iscan_eloop(struct wl_iscan_eloop *el)
+static void brcmf_init_iscan_eloop(struct wl_iscan_eloop *el)
{
memset(el, 0, sizeof(*el));
- el->handler[BRCMF_SCAN_RESULTS_SUCCESS] = wl_iscan_done;
- el->handler[BRCMF_SCAN_RESULTS_PARTIAL] = wl_iscan_inprogress;
- el->handler[BRCMF_SCAN_RESULTS_PENDING] = wl_iscan_pending;
- el->handler[BRCMF_SCAN_RESULTS_ABORTED] = wl_iscan_aborted;
- el->handler[BRCMF_SCAN_RESULTS_NO_MEM] = wl_iscan_aborted;
+ el->handler[BRCMF_SCAN_RESULTS_SUCCESS] = brcmf_iscan_done;
+ el->handler[BRCMF_SCAN_RESULTS_PARTIAL] = brcmf_iscan_inprogress;
+ el->handler[BRCMF_SCAN_RESULTS_PENDING] = brcmf_iscan_pending;
+ el->handler[BRCMF_SCAN_RESULTS_ABORTED] = brcmf_iscan_aborted;
+ el->handler[BRCMF_SCAN_RESULTS_NO_MEM] = brcmf_iscan_aborted;
}
-static s32 wl_init_iscan(struct wl_priv *wl)
+static s32 brcmf_init_iscan(struct wl_priv *wl)
{
struct wl_iscan_ctrl *iscan = wl_to_iscan(wl);
int err = 0;
@@ -3328,13 +3328,13 @@ static s32 wl_init_iscan(struct wl_priv *wl)
if (wl->iscan_on) {
iscan->dev = wl_to_ndev(wl);
iscan->state = WL_ISCAN_STATE_IDLE;
- wl_init_iscan_eloop(&iscan->el);
+ brcmf_init_iscan_eloop(&iscan->el);
iscan->timer_ms = WL_ISCAN_TIMER_INTERVAL_MS;
init_timer(&iscan->timer);
iscan->timer.data = (unsigned long) iscan;
- iscan->timer.function = wl_iscan_timer;
+ iscan->timer.function = brcmf_iscan_timer;
sema_init(&iscan->sync, 0);
- iscan->tsk = kthread_run(wl_iscan_thread, iscan, "wl_iscan");
+ iscan->tsk = kthread_run(brcmf_iscan_thread, iscan, "wl_iscan");
if (IS_ERR(iscan->tsk)) {
WL_ERR("Could not create iscan thread\n");
iscan->tsk = NULL;
@@ -3362,32 +3362,32 @@ static s32 wl_init_priv(struct wl_priv *wl)
wl->active_scan = true; /* we do active scan for
specific scan per default */
wl->dongle_up = false; /* dongle is not up yet */
- wl_init_eq(wl);
- err = wl_init_priv_mem(wl);
+ brcmf_init_eq(wl);
+ err = brcmf_init_priv_mem(wl);
if (unlikely(err))
return err;
- if (unlikely(wl_create_event_handler(wl)))
+ if (unlikely(brcmf_create_event_handler(wl)))
return -ENOMEM;
- wl_init_eloop_handler(&wl->el);
+ brcmf_init_eloop_handler(&wl->el);
mutex_init(&wl->usr_sync);
- err = wl_init_iscan(wl);
+ err = brcmf_init_iscan(wl);
if (unlikely(err))
return err;
- wl_init_conf(wl->conf);
- wl_init_prof(wl->profile);
- wl_link_down(wl);
+ brcmf_init_conf(wl->conf);
+ brcmf_init_prof(wl->profile);
+ brcmf_link_down(wl);
return err;
}
static void wl_deinit_priv(struct wl_priv *wl)
{
- wl_destroy_event_handler(wl);
+ brcmf_destroy_event_handler(wl);
wl->dongle_up = false; /* dongle down */
- wl_flush_eq(wl);
- wl_link_down(wl);
- wl_term_iscan(wl);
- wl_deinit_priv_mem(wl);
+ brcmf_flush_eq(wl);
+ brcmf_link_down(wl);
+ brcmf_term_iscan(wl);
+ brcmf_deinit_priv_mem(wl);
}
s32 wl_cfg80211_attach(struct net_device *ndev, void *data)
@@ -3407,11 +3407,11 @@ s32 wl_cfg80211_attach(struct net_device *ndev, void *data)
return -ENOMEM;
}
WL_INFO("func %p\n", wl_cfg80211_get_sdio_func());
- wdev = wl_alloc_wdev(sizeof(struct wl_iface), &wl_cfg80211_get_sdio_func()->dev);
+ wdev = brcmf_alloc_wdev(sizeof(struct wl_iface), &wl_cfg80211_get_sdio_func()->dev);
if (IS_ERR(wdev))
return -ENOMEM;
- wdev->iftype = wl_mode_to_nl80211_iftype(WL_MODE_BSS);
+ wdev->iftype = brcmf_mode_to_nl80211_iftype(WL_MODE_BSS);
wl = wdev_to_wl(wdev);
wl->wdev = wdev;
wl->pub = data;
@@ -3425,12 +3425,12 @@ s32 wl_cfg80211_attach(struct net_device *ndev, void *data)
WL_ERR("Failed to init iwm_priv (%d)\n", err);
goto cfg80211_attach_out;
}
- wl_set_drvdata(wl_cfg80211_dev, ci);
+ brcmf_set_drvdata(wl_cfg80211_dev, ci);
return err;
cfg80211_attach_out:
- wl_free_wdev(wl);
+ brcmf_free_wdev(wl);
return err;
}
@@ -3441,19 +3441,19 @@ void wl_cfg80211_detach(void)
wl = WL_PRIV_GET();
wl_deinit_priv(wl);
- wl_free_wdev(wl);
- wl_set_drvdata(wl_cfg80211_dev, NULL);
+ brcmf_free_wdev(wl);
+ brcmf_set_drvdata(wl_cfg80211_dev, NULL);
kfree(wl_cfg80211_dev);
wl_cfg80211_dev = NULL;
- wl_clear_sdio_func();
+ brcmf_clear_sdio_func();
}
-static void wl_wakeup_event(struct wl_priv *wl)
+static void brcmf_wakeup_event(struct wl_priv *wl)
{
up(&wl->event_sync);
}
-static s32 wl_event_handler(void *data)
+static s32 brcmf_event_handler(void *data)
{
struct wl_priv *wl = (struct wl_priv *)data;
struct sched_param param = {.sched_priority = MAX_RT_PRIO - 1 };
@@ -3464,7 +3464,7 @@ static s32 wl_event_handler(void *data)
while (likely(!down_interruptible(&wl->event_sync))) {
if (kthread_should_stop())
break;
- e = wl_deq_event(wl);
+ e = brcmf_deq_event(wl);
if (unlikely(!e)) {
WL_ERR("event queue empty...\n");
BUG();
@@ -3476,7 +3476,7 @@ static s32 wl_event_handler(void *data)
} else {
WL_INFO("Unknown Event (%d): ignoring\n", e->etype);
}
- wl_put_event(e);
+ brcmf_put_event(e);
}
WL_INFO("was terminated\n");
return 0;
@@ -3489,43 +3489,43 @@ wl_cfg80211_event(struct net_device *ndev,
u32 event_type = be32_to_cpu(e->event_type);
struct wl_priv *wl = ndev_to_wl(ndev);
- if (likely(!wl_enq_event(wl, event_type, e, data)))
- wl_wakeup_event(wl);
+ if (likely(!brcmf_enq_event(wl, event_type, e, data)))
+ brcmf_wakeup_event(wl);
}
-static void wl_init_eq(struct wl_priv *wl)
+static void brcmf_init_eq(struct wl_priv *wl)
{
- wl_init_eq_lock(wl);
+ brcmf_init_eq_lock(wl);
INIT_LIST_HEAD(&wl->eq_list);
}
-static void wl_flush_eq(struct wl_priv *wl)
+static void brcmf_flush_eq(struct wl_priv *wl)
{
struct wl_event_q *e;
- wl_lock_eq(wl);
+ brcmf_lock_eq(wl);
while (!list_empty(&wl->eq_list)) {
e = list_first_entry(&wl->eq_list, struct wl_event_q, eq_list);
list_del(&e->eq_list);
kfree(e);
}
- wl_unlock_eq(wl);
+ brcmf_unlock_eq(wl);
}
/*
* retrieve first queued event from head
*/
-static struct wl_event_q *wl_deq_event(struct wl_priv *wl)
+static struct wl_event_q *brcmf_deq_event(struct wl_priv *wl)
{
struct wl_event_q *e = NULL;
- wl_lock_eq(wl);
+ brcmf_lock_eq(wl);
if (likely(!list_empty(&wl->eq_list))) {
e = list_first_entry(&wl->eq_list, struct wl_event_q, eq_list);
list_del(&e->eq_list);
}
- wl_unlock_eq(wl);
+ brcmf_unlock_eq(wl);
return e;
}
@@ -3535,7 +3535,7 @@ static struct wl_event_q *wl_deq_event(struct wl_priv *wl)
*/
static s32
-wl_enq_event(struct wl_priv *wl, u32 event, const brcmf_event_msg_t *msg,
+brcmf_enq_event(struct wl_priv *wl, u32 event, const brcmf_event_msg_t *msg,
void *data)
{
struct wl_event_q *e;
@@ -3551,14 +3551,14 @@ wl_enq_event(struct wl_priv *wl, u32 event, const brcmf_event_msg_t *msg,
memcpy(&e->emsg, msg, sizeof(brcmf_event_msg_t));
if (data) {
}
- wl_lock_eq(wl);
+ brcmf_lock_eq(wl);
list_add_tail(&e->eq_list, &wl->eq_list);
- wl_unlock_eq(wl);
+ brcmf_unlock_eq(wl);
return err;
}
-static void wl_put_event(struct wl_event_q *e)
+static void brcmf_put_event(struct wl_event_q *e)
{
kfree(e);
}
@@ -3568,7 +3568,7 @@ void wl_cfg80211_sdio_func(void *func)
cfg80211_sdio_func = (struct sdio_func *)func;
}
-static void wl_clear_sdio_func(void)
+static void brcmf_clear_sdio_func(void)
{
cfg80211_sdio_func = NULL;
}
@@ -3578,7 +3578,7 @@ struct sdio_func *wl_cfg80211_get_sdio_func(void)
return cfg80211_sdio_func;
}
-static s32 wl_dongle_mode(struct net_device *ndev, s32 iftype)
+static s32 brcmf_dongle_mode(struct net_device *ndev, s32 iftype)
{
s32 infra = 0;
s32 err = 0;
@@ -3602,7 +3602,7 @@ static s32 wl_dongle_mode(struct net_device *ndev, s32 iftype)
return err;
}
infra = cpu_to_le32(infra);
- err = wl_dev_ioctl(ndev, BRCMF_C_SET_INFRA, &infra, sizeof(infra));
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_INFRA, &infra, sizeof(infra));
if (unlikely(err)) {
WL_ERR("WLC_SET_INFRA error (%d)\n", err);
return err;
@@ -3611,7 +3611,7 @@ static s32 wl_dongle_mode(struct net_device *ndev, s32 iftype)
return 0;
}
-static s32 wl_dongle_eventmsg(struct net_device *ndev)
+static s32 brcmf_dongle_eventmsg(struct net_device *ndev)
{
/* Room for "event_msgs" + '\0' + bitvec */
s8 iovbuf[BRCMF_EVENTING_MASK_LEN + 12];
@@ -3623,7 +3623,7 @@ static s32 wl_dongle_eventmsg(struct net_device *ndev)
/* Setup event_msgs */
brcmu_mkiovar("event_msgs", eventmask, BRCMF_EVENTING_MASK_LEN, iovbuf,
sizeof(iovbuf));
- err = wl_dev_ioctl(ndev, BRCMF_C_GET_VAR, iovbuf, sizeof(iovbuf));
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_GET_VAR, iovbuf, sizeof(iovbuf));
if (unlikely(err)) {
WL_ERR("Get event_msgs error (%d)\n", err);
goto dongle_eventmsg_out;
@@ -3652,7 +3652,7 @@ static s32 wl_dongle_eventmsg(struct net_device *ndev)
brcmu_mkiovar("event_msgs", eventmask, BRCMF_EVENTING_MASK_LEN, iovbuf,
sizeof(iovbuf));
- err = wl_dev_ioctl(ndev, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
if (unlikely(err)) {
WL_ERR("Set event_msgs error (%d)\n", err);
goto dongle_eventmsg_out;
@@ -3664,7 +3664,7 @@ dongle_eventmsg_out:
}
static s32
-wl_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
+brcmf_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
{
s8 iovbuf[32];
s32 roamtrigger[2];
@@ -3678,7 +3678,7 @@ wl_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
if (roamvar) {
brcmu_mkiovar("bcn_timeout", (char *)&bcn_timeout,
sizeof(bcn_timeout), iovbuf, sizeof(iovbuf));
- err = wl_dev_ioctl(ndev, BRCMF_C_SET_VAR,
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_VAR,
iovbuf, sizeof(iovbuf));
if (unlikely(err)) {
WL_ERR("bcn_timeout error (%d)\n", err);
@@ -3693,7 +3693,7 @@ wl_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
WL_INFO("Internal Roaming = %s\n", roamvar ? "Off" : "On");
brcmu_mkiovar("roam_off", (char *)&roamvar,
sizeof(roamvar), iovbuf, sizeof(iovbuf));
- err = wl_dev_ioctl(ndev, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
if (unlikely(err)) {
WL_ERR("roam_off error (%d)\n", err);
goto dongle_rom_out;
@@ -3701,7 +3701,7 @@ wl_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
roamtrigger[0] = WL_ROAM_TRIGGER_LEVEL;
roamtrigger[1] = WLC_BAND_ALL;
- err = wl_dev_ioctl(ndev, BRCMF_C_SET_ROAM_TRIGGER,
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_ROAM_TRIGGER,
(void *)roamtrigger, sizeof(roamtrigger));
if (unlikely(err)) {
WL_ERR("WLC_SET_ROAM_TRIGGER error (%d)\n", err);
@@ -3710,7 +3710,7 @@ wl_dongle_roam(struct net_device *ndev, u32 roamvar, u32 bcn_timeout)
roam_delta[0] = WL_ROAM_DELTA;
roam_delta[1] = WLC_BAND_ALL;
- err = wl_dev_ioctl(ndev, BRCMF_C_SET_ROAM_DELTA,
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_ROAM_DELTA,
(void *)roam_delta, sizeof(roam_delta));
if (unlikely(err)) {
WL_ERR("WLC_SET_ROAM_DELTA error (%d)\n", err);
@@ -3722,12 +3722,12 @@ dongle_rom_out:
}
static s32
-wl_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
+brcmf_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
s32 scan_unassoc_time, s32 scan_passive_time)
{
s32 err = 0;
- err = wl_dev_ioctl(ndev, BRCMF_C_SET_SCAN_CHANNEL_TIME,
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_SCAN_CHANNEL_TIME,
&scan_assoc_time, sizeof(scan_assoc_time));
if (err) {
if (err == -EOPNOTSUPP)
@@ -3736,7 +3736,7 @@ wl_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
WL_ERR("Scan assoc time error (%d)\n", err);
goto dongle_scantime_out;
}
- err = wl_dev_ioctl(ndev, BRCMF_C_SET_SCAN_UNASSOC_TIME,
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_SCAN_UNASSOC_TIME,
&scan_unassoc_time, sizeof(scan_unassoc_time));
if (err) {
if (err == -EOPNOTSUPP)
@@ -3746,7 +3746,7 @@ wl_dongle_scantime(struct net_device *ndev, s32 scan_assoc_time,
goto dongle_scantime_out;
}
- err = wl_dev_ioctl(ndev, BRCMF_C_SET_SCAN_PASSIVE_TIME,
+ err = brcmf_dev_ioctl(ndev, BRCMF_C_SET_SCAN_PASSIVE_TIME,
&scan_passive_time, sizeof(scan_passive_time));
if (err) {
if (err == -EOPNOTSUPP)
@@ -3760,7 +3760,7 @@ dongle_scantime_out:
return err;
}
-s32 wl_config_dongle(struct wl_priv *wl, bool need_lock)
+s32 brcmf_config_dongle(struct wl_priv *wl, bool need_lock)
{
struct net_device *ndev;
struct wireless_dev *wdev;
@@ -3774,19 +3774,19 @@ s32 wl_config_dongle(struct wl_priv *wl, bool need_lock)
if (need_lock)
rtnl_lock();
- wl_dongle_scantime(ndev, WL_SCAN_CHANNEL_TIME,
+ brcmf_dongle_scantime(ndev, WL_SCAN_CHANNEL_TIME,
WL_SCAN_UNASSOC_TIME, WL_SCAN_PASSIVE_TIME);
- err = wl_dongle_eventmsg(ndev);
+ err = brcmf_dongle_eventmsg(ndev);
if (unlikely(err))
goto default_conf_out;
- err = wl_dongle_roam(ndev, (wl->roam_on ? 0 : 1), WL_BEACON_TIMEOUT);
+ err = brcmf_dongle_roam(ndev, (wl->roam_on ? 0 : 1), WL_BEACON_TIMEOUT);
if (unlikely(err))
goto default_conf_out;
- err = wl_dongle_mode(ndev, wdev->iftype);
+ err = brcmf_dongle_mode(ndev, wdev->iftype);
if (unlikely(err && err != -EINPROGRESS))
goto default_conf_out;
- err = wl_dongle_probecap(wl);
+ err = brcmf_dongle_probecap(wl);
if (unlikely(err))
goto default_conf_out;
@@ -3809,7 +3809,7 @@ static s32 wl_update_wiphybands(struct wl_priv *wl)
s8 phy;
s32 err = 0;
- err = wl_dev_ioctl(wl_to_ndev(wl), WLC_GET_PHYLIST, &phy_list,
+ err = brcmf_dev_ioctl(wl_to_ndev(wl), WLC_GET_PHYLIST, &phy_list,
sizeof(phy_list));
if (unlikely(err)) {
WL_ERR("error (%d)\n", err);
@@ -3826,24 +3826,24 @@ static s32 wl_update_wiphybands(struct wl_priv *wl)
return err;
}
-static s32 __wl_cfg80211_up(struct wl_priv *wl)
+static s32 __brcmf_cfg80211_up(struct wl_priv *wl)
{
s32 err = 0;
set_bit(WL_STATUS_READY, &wl->status);
- wl_debugfs_add_netdev_params(wl);
+ brcmf_debugfs_add_netdev_params(wl);
- err = wl_config_dongle(wl, false);
+ err = brcmf_config_dongle(wl, false);
if (unlikely(err))
return err;
- wl_invoke_iscan(wl);
+ brcmf_invoke_iscan(wl);
return err;
}
-static s32 __wl_cfg80211_down(struct wl_priv *wl)
+static s32 __brcmf_cfg80211_down(struct wl_priv *wl)
{
/*
* While going down, if associated with AP disassociate
@@ -3853,19 +3853,19 @@ static s32 __wl_cfg80211_down(struct wl_priv *wl)
test_bit(WL_STATUS_CONNECTING, &wl->status)) &&
test_bit(WL_STATUS_READY, &wl->status)) {
WL_INFO("Disassociating from AP");
- wl_link_down(wl);
+ brcmf_link_down(wl);
/* Make sure WPA_Supplicant receives all the event
generated due to DISASSOC call to the fw to keep
the state fw and WPA_Supplicant state consistent
*/
rtnl_unlock();
- wl_delay(500);
+ brcmf_delay(500);
rtnl_lock();
}
set_bit(WL_STATUS_SCAN_ABORTING, &wl->status);
- wl_term_iscan(wl);
+ brcmf_term_iscan(wl);
if (wl->scan_request) {
cfg80211_scan_done(wl->scan_request, true);
/* May need to perform this to cover rmmod */
@@ -3876,7 +3876,7 @@ static s32 __wl_cfg80211_down(struct wl_priv *wl)
clear_bit(WL_STATUS_SCANNING, &wl->status);
clear_bit(WL_STATUS_SCAN_ABORTING, &wl->status);
- wl_debugfs_remove_netdev(wl);
+ brcmf_debugfs_remove_netdev(wl);
return 0;
}
@@ -3888,7 +3888,7 @@ s32 wl_cfg80211_up(void)
wl = WL_PRIV_GET();
mutex_lock(&wl->usr_sync);
- err = __wl_cfg80211_up(wl);
+ err = __brcmf_cfg80211_up(wl);
mutex_unlock(&wl->usr_sync);
return err;
@@ -3901,18 +3901,18 @@ s32 wl_cfg80211_down(void)
wl = WL_PRIV_GET();
mutex_lock(&wl->usr_sync);
- err = __wl_cfg80211_down(wl);
+ err = __brcmf_cfg80211_down(wl);
mutex_unlock(&wl->usr_sync);
return err;
}
-static s32 wl_dongle_probecap(struct wl_priv *wl)
+static s32 brcmf_dongle_probecap(struct wl_priv *wl)
{
return wl_update_wiphybands(wl);
}
-static void *wl_read_prof(struct wl_priv *wl, s32 item)
+static void *brcmf_read_prof(struct wl_priv *wl, s32 item)
{
switch (item) {
case WL_PROF_SEC:
@@ -3927,7 +3927,7 @@ static void *wl_read_prof(struct wl_priv *wl, s32 item)
}
static s32
-wl_update_prof(struct wl_priv *wl, const brcmf_event_msg_t *e, void *data,
+brcmf_update_prof(struct wl_priv *wl, const brcmf_event_msg_t *e, void *data,
s32 item)
{
s32 err = 0;
@@ -3965,12 +3965,12 @@ wl_update_prof(struct wl_priv *wl, const brcmf_event_msg_t *e, void *data,
return err;
}
-static bool wl_is_ibssmode(struct wl_priv *wl)
+static bool brcmf_is_ibssmode(struct wl_priv *wl)
{
return wl->conf->mode == WL_MODE_IBSS;
}
-static __used s32 wl_add_ie(struct wl_priv *wl, u8 t, u8 l, u8 *v)
+static __used s32 brcmf_add_ie(struct wl_priv *wl, u8 t, u8 l, u8 *v)
{
struct wl_ie *ie = wl_to_ie(wl);
s32 err = 0;
@@ -3987,7 +3987,7 @@ static __used s32 wl_add_ie(struct wl_priv *wl, u8 t, u8 l, u8 *v)
return err;
}
-static void wl_link_down(struct wl_priv *wl)
+static void brcmf_link_down(struct wl_priv *wl)
{
struct net_device *dev = NULL;
s32 err = 0;
@@ -3997,7 +3997,7 @@ static void wl_link_down(struct wl_priv *wl)
if (wl->link_up) {
dev = wl_to_ndev(wl);
WL_INFO("Call WLC_DISASSOC to stop excess roaming\n ");
- err = wl_dev_ioctl(dev, BRCMF_C_DISASSOC, NULL, 0);
+ err = brcmf_dev_ioctl(dev, BRCMF_C_DISASSOC, NULL, 0);
if (unlikely(err))
WL_ERR("WLC_DISASSOC failed (%d)\n", err);
wl->link_up = false;
@@ -4005,22 +4005,22 @@ static void wl_link_down(struct wl_priv *wl)
WL_TRACE("Exit\n");
}
-static void wl_lock_eq(struct wl_priv *wl)
+static void brcmf_lock_eq(struct wl_priv *wl)
{
spin_lock_irq(&wl->eq_lock);
}
-static void wl_unlock_eq(struct wl_priv *wl)
+static void brcmf_unlock_eq(struct wl_priv *wl)
{
spin_unlock_irq(&wl->eq_lock);
}
-static void wl_init_eq_lock(struct wl_priv *wl)
+static void brcmf_init_eq_lock(struct wl_priv *wl)
{
spin_lock_init(&wl->eq_lock);
}
-static void wl_delay(u32 ms)
+static void brcmf_delay(u32 ms)
{
if (ms < 1000 / HZ) {
cond_resched();
@@ -4030,12 +4030,12 @@ static void wl_delay(u32 ms)
}
}
-static void wl_set_drvdata(struct wl_dev *dev, void *data)
+static void brcmf_set_drvdata(struct wl_dev *dev, void *data)
{
dev->driver_data = data;
}
-static void *wl_get_drvdata(struct wl_dev *dev)
+static void *brcmf_get_drvdata(struct wl_dev *dev)
{
void *data = NULL;
@@ -4044,13 +4044,13 @@ static void *wl_get_drvdata(struct wl_dev *dev)
return data;
}
-static void wl_set_mpc(struct net_device *ndev, int mpc)
+static void brcmf_set_mpc(struct net_device *ndev, int mpc)
{
s32 err = 0;
struct wl_priv *wl = ndev_to_wl(ndev);
if (test_bit(WL_STATUS_READY, &wl->status)) {
- err = wl_dev_intvar_set(ndev, "mpc", mpc);
+ err = brcmf_dev_intvar_set(ndev, "mpc", mpc);
if (unlikely(err)) {
WL_ERR("fail to set mpc\n");
return;
@@ -4059,7 +4059,7 @@ static void wl_set_mpc(struct net_device *ndev, int mpc)
}
}
-static int wl_debugfs_add_netdev_params(struct wl_priv *wl)
+static int brcmf_debugfs_add_netdev_params(struct wl_priv *wl)
{
char buf[10+IFNAMSIZ];
struct dentry *fd;
@@ -4086,7 +4086,7 @@ err_out:
return err;
}
-static void wl_debugfs_remove_netdev(struct wl_priv *wl)
+static void brcmf_debugfs_remove_netdev(struct wl_priv *wl)
{
debugfs_remove_recursive(wl->debugfsdir);
wl->debugfsdir = NULL;
--
1.7.1
From: Arend van Spriel <[email protected]>
The header file dhd_bus.h contains several function prototypes
starting with dhd_bus_ and using parameter with struct dhd_bus.
These function and structure have been renamed to brcmf_bus.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 6 +-
drivers/staging/brcm80211/brcmfmac/dhd_bus.h | 24 ++--
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 2 +-
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 6 +-
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 212 +++++++++++-----------
5 files changed, 125 insertions(+), 125 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 9f627e5..f76a3dd 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -522,14 +522,14 @@ struct brcmf_ioctl {
};
/* Forward decls for struct brcmf_pub (see below) */
-struct dhd_bus; /* device bus info */
+struct brcmf_bus; /* device bus info */
struct brcmf_proto; /* device communication protocol info */
struct brcmf_info; /* device driver info */
/* Common structure for module and instance linkage */
struct brcmf_pub {
/* Linkage ponters */
- struct dhd_bus *bus;
+ struct brcmf_bus *bus;
struct brcmf_proto *prot;
struct brcmf_info *info;
@@ -753,7 +753,7 @@ static inline void MUTEX_UNLOCK_WL_SCAN_SET(void)
* Returned structure should have bus and prot pointers filled in.
* bus_hdrlen specifies required headroom for bus module header.
*/
-extern struct brcmf_pub *brcmf_attach(struct dhd_bus *bus,
+extern struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus,
uint bus_hdrlen);
extern int brcmf_net_attach(struct brcmf_pub *drvr, int idx);
extern int brcmf_netdev_wait_pend8021x(struct net_device *dev);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
index 096d73c..50da972 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
@@ -33,26 +33,26 @@
extern uint brcmf_watchdog_ms;
/* Indicate (dis)interest in finding dongles. */
-extern int dhd_bus_register(void);
-extern void dhd_bus_unregister(void);
+extern int brcmf_bus_register(void);
+extern void brcmf_bus_unregister(void);
/* Stop bus module: clear pending frames, disable data flow */
-extern void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex);
+extern void brcmf_sdbrcm_bus_stop(struct brcmf_bus *bus, bool enforce_mutex);
/* Initialize bus module: prepare for communication w/dongle */
extern int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex);
/* Send a data frame to the dongle. Callee disposes of txp. */
-extern int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *txp);
+extern int brcmf_sdbrcm_bus_txdata(struct brcmf_bus *bus, struct sk_buff *txp);
/* Send/receive a control message to/from the dongle.
* Expects caller to enforce a single outstanding transaction.
*/
extern int
-brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
+brcmf_sdbrcm_bus_txctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen);
extern int
-brcmf_sdbrcm_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
+brcmf_sdbrcm_bus_rxctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen);
extern void dhd_bus_isr(bool *InterruptRecognized,
bool *QueueMiniportHandleInterrupt, void *arg);
@@ -67,15 +67,15 @@ extern void brcmf_sdbrcm_bus_dump(struct brcmf_pub *drvr,
struct brcmu_strbuf *strbuf);
/* Clear any bus counters */
-extern void dhd_bus_clearcounts(struct brcmf_pub *drvr);
+extern void brcmf_bus_clearcounts(struct brcmf_pub *drvr);
/* return the dongle chipid */
-extern uint dhd_bus_chip(struct dhd_bus *bus);
+extern uint brcmf_bus_chip(struct brcmf_bus *bus);
-extern void *dhd_bus_pub(struct dhd_bus *bus);
-extern void *dhd_bus_txq(struct dhd_bus *bus);
-extern uint dhd_bus_hdrlen(struct dhd_bus *bus);
+extern void *brcmf_bus_drvr(struct brcmf_bus *bus);
+extern void *brcmf_bus_txq(struct brcmf_bus *bus);
+extern uint brcmf_bus_hdrlen(struct brcmf_bus *bus);
-extern void brcmf_sdbrcm_wd_timer(struct dhd_bus *bus, uint wdtick);
+extern void brcmf_sdbrcm_wd_timer(struct brcmf_bus *bus, uint wdtick);
#endif /* _dhd_bus_h_ */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index fc361d1..14dc98d 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -225,7 +225,7 @@ brcmf_c_doiovar(struct brcmf_pub *drvr, const struct brcmu_iovar *vi,
drvr->tx_realloc = 0;
drvr->wd_dpc_sched = 0;
memset(&drvr->dstats, 0, sizeof(drvr->dstats));
- dhd_bus_clearcounts(drvr);
+ brcmf_bus_clearcounts(drvr);
break;
case IOV_GVAL(IOV_IOCTLTIMEOUT):{
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 29ed98a..aa2f81f 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -1426,7 +1426,7 @@ void brcmf_del_if(struct brcmf_info *drvr_priv, int ifidx)
up(&drvr_priv->sysioc_sem);
}
-struct brcmf_pub *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
+struct brcmf_pub *brcmf_attach(struct brcmf_bus *bus, uint bus_hdrlen)
{
struct brcmf_info *drvr_priv = NULL;
struct net_device *net;
@@ -1761,7 +1761,7 @@ static void __exit brcmf_module_cleanup(void)
{
DHD_TRACE(("%s: Enter\n", __func__));
- dhd_bus_unregister();
+ brcmf_bus_unregister();
}
static int __init brcmf_module_init(void)
@@ -1770,7 +1770,7 @@ static int __init brcmf_module_init(void)
DHD_TRACE(("%s: Enter\n", __func__));
- error = dhd_bus_register();
+ error = brcmf_bus_register();
if (error) {
DHD_ERROR(("%s: dhd_bus_register failed\n", __func__));
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index a69791e..ba3ea59 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -542,7 +542,7 @@ struct chip_info {
};
/* Private data for SDIO bus interaction */
-typedef struct dhd_bus {
+struct brcmf_bus {
struct brcmf_pub *drvr;
struct brcmf_sdio_card *card; /* Handle for sdio card calls */
@@ -695,7 +695,7 @@ typedef struct dhd_bus {
const struct firmware *firmware;
const char *nv_name;
u32 fw_ptr;
-} dhd_bus_t;
+};
typedef volatile struct _sbconfig {
u32 PAD[2];
@@ -865,74 +865,74 @@ do { \
#define HOSTINTMASK (I_HMB_SW_MASK | I_CHIPACTIVE)
#ifdef SDTEST
-static void brcmf_sdbrcm_checkdied(dhd_bus_t *bus, void *pkt, uint seq);
-static void brcmf_sdbrcm_sdtest_set(dhd_bus_t *bus, bool start);
+static void brcmf_sdbrcm_checkdied(struct brcmf_bus *bus, void *pkt, uint seq);
+static void brcmf_sdbrcm_sdtest_set(struct brcmf_bus *bus, bool start);
#endif
#ifdef BCMDBG
static int brcmf_sdbrcm_bus_console_in(struct brcmf_pub *drvr,
unsigned char *msg, uint msglen);
-static int brcmf_sdbrcm_checkdied(dhd_bus_t *bus, u8 *data, uint size);
-static int brcmf_sdbrcm_mem_dump(dhd_bus_t *bus);
+static int brcmf_sdbrcm_checkdied(struct brcmf_bus *bus, u8 *data, uint size);
+static int brcmf_sdbrcm_mem_dump(struct brcmf_bus *bus);
#endif /* BCMDBG */
-static int brcmf_sdbrcm_download_state(dhd_bus_t *bus, bool enter);
+static int brcmf_sdbrcm_download_state(struct brcmf_bus *bus, bool enter);
-static void brcmf_sdbrcm_release(dhd_bus_t *bus);
-static void brcmf_sdbrcm_release_malloc(dhd_bus_t *bus);
+static void brcmf_sdbrcm_release(struct brcmf_bus *bus);
+static void brcmf_sdbrcm_release_malloc(struct brcmf_bus *bus);
static void brcmf_sdbrcm_disconnect(void *ptr);
static bool brcmf_sdbrcm_chipmatch(u16 chipid);
-static bool brcmf_sdbrcm_probe_attach(dhd_bus_t *bus, void *card,
+static bool brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, void *card,
void *regsva, u16 devid);
-static bool brcmf_sdbrcm_probe_malloc(dhd_bus_t *bus, void *card);
-static bool brcmf_sdbrcm_probe_init(dhd_bus_t *bus, void *card);
-static void brcmf_sdbrcm_release_dongle(dhd_bus_t *bus);
+static bool brcmf_sdbrcm_probe_malloc(struct brcmf_bus *bus, void *card);
+static bool brcmf_sdbrcm_probe_init(struct brcmf_bus *bus, void *card);
+static void brcmf_sdbrcm_release_dongle(struct brcmf_bus *bus);
static uint brcmf_process_nvram_vars(char *varbuf, uint len);
-static void brcmf_sdbrcm_setmemsize(struct dhd_bus *bus, int mem_size);
-static int brcmf_sdbrcm_send_buf(dhd_bus_t *bus, u32 addr, uint fn,
+static void brcmf_sdbrcm_setmemsize(struct brcmf_bus *bus, int mem_size);
+static int brcmf_sdbrcm_send_buf(struct brcmf_bus *bus, u32 addr, uint fn,
uint flags, u8 *buf, uint nbytes,
struct sk_buff *pkt,
brcmf_sdio_cmplt_fn_t complete, void *handle);
-static bool brcmf_sdbrcm_download_firmware(struct dhd_bus *bus, void *card);
-static int _brcmf_sdbrcm_download_firmware(struct dhd_bus *bus);
+static bool brcmf_sdbrcm_download_firmware(struct brcmf_bus *bus, void *card);
+static int _brcmf_sdbrcm_download_firmware(struct brcmf_bus *bus);
-static int brcmf_sdbrcm_download_code_file(struct dhd_bus *bus);
-static int brcmf_sdbrcm_download_nvram(struct dhd_bus *bus);
+static int brcmf_sdbrcm_download_code_file(struct brcmf_bus *bus);
+static int brcmf_sdbrcm_download_nvram(struct brcmf_bus *bus);
static void
brcmf_sdbrcm_chip_disablecore(struct brcmf_sdio_card *card, u32 corebase);
-static int brcmf_sdbrcm_chip_attach(struct dhd_bus *bus, void *regs);
+static int brcmf_sdbrcm_chip_attach(struct brcmf_bus *bus, void *regs);
static void
brcmf_sdbrcm_chip_resetcore(struct brcmf_sdio_card *card, u32 corebase);
-static void brcmf_sdbrcm_sdiod_drive_strength_init(struct dhd_bus *bus,
+static void brcmf_sdbrcm_sdiod_drive_strength_init(struct brcmf_bus *bus,
u32 drivestrength);
-static void brcmf_sdbrcm_chip_detach(struct dhd_bus *bus);
-static void brcmf_sdbrcm_wait_for_event(dhd_bus_t *bus, bool *lockvar);
-static void brcmf_sdbrcm_wait_event_wakeup(dhd_bus_t *bus);
+static void brcmf_sdbrcm_chip_detach(struct brcmf_bus *bus);
+static void brcmf_sdbrcm_wait_for_event(struct brcmf_bus *bus, bool *lockvar);
+static void brcmf_sdbrcm_wait_event_wakeup(struct brcmf_bus *bus);
static void brcmf_sdbrcm_watchdog(unsigned long data);
static int brcmf_sdbrcm_watchdog_thread(void *data);
static int brcmf_sdbrcm_dpc_thread(void *data);
static void brcmf_sdbrcm_dpc_tasklet(unsigned long data);
-static void brcmf_sdbrcm_sched_dpc(dhd_bus_t *bus);
-static void brcmf_sdbrcm_sdlock(dhd_bus_t *bus);
-static void brcmf_sdbrcm_sdunlock(dhd_bus_t *bus);
-static int brcmf_sdbrcm_get_image(char *buf, int len, struct dhd_bus *bus);
+static void brcmf_sdbrcm_sched_dpc(struct brcmf_bus *bus);
+static void brcmf_sdbrcm_sdlock(struct brcmf_bus *bus);
+static void brcmf_sdbrcm_sdunlock(struct brcmf_bus *bus);
+static int brcmf_sdbrcm_get_image(char *buf, int len, struct brcmf_bus *bus);
/* Packet free applicable unconditionally for sdio and sdspi.
* Conditional if bufpool was present for gspi bus.
*/
-static void brcmf_sdbrcm_pktfree2(dhd_bus_t *bus, struct sk_buff *pkt)
+static void brcmf_sdbrcm_pktfree2(struct brcmf_bus *bus, struct sk_buff *pkt)
{
if ((bus->bus != SPI_BUS) || bus->usebufpool)
brcmu_pkt_buf_free_skb(pkt);
}
-static void brcmf_sdbrcm_setmemsize(struct dhd_bus *bus, int mem_size)
+static void brcmf_sdbrcm_setmemsize(struct brcmf_bus *bus, int mem_size)
{
s32 min_size = DONGLE_MIN_MEMSIZE;
/* Restrict the memsize to user specified limit */
@@ -943,7 +943,7 @@ static void brcmf_sdbrcm_setmemsize(struct dhd_bus *bus, int mem_size)
bus->ramsize = brcmf_dongle_memsize;
}
-static int brcmf_sdbrcm_set_siaddr_window(dhd_bus_t *bus, u32 address)
+static int brcmf_sdbrcm_set_siaddr_window(struct brcmf_bus *bus, u32 address)
{
int err = 0;
brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRLOW,
@@ -961,7 +961,7 @@ static int brcmf_sdbrcm_set_siaddr_window(dhd_bus_t *bus, u32 address)
}
/* Turn backplane clock on or off */
-static int brcmf_sdbrcm_htclk(dhd_bus_t *bus, bool on, bool pendok)
+static int brcmf_sdbrcm_htclk(struct brcmf_bus *bus, bool on, bool pendok)
{
int err;
u8 clkctl, clkreq, devctl;
@@ -1093,7 +1093,7 @@ static int brcmf_sdbrcm_htclk(dhd_bus_t *bus, bool on, bool pendok)
}
/* Change idle/active SD state */
-static int brcmf_sdbrcm_sdclk(dhd_bus_t *bus, bool on)
+static int brcmf_sdbrcm_sdclk(struct brcmf_bus *bus, bool on)
{
DHD_TRACE(("%s: Enter\n", __func__));
@@ -1106,7 +1106,7 @@ static int brcmf_sdbrcm_sdclk(dhd_bus_t *bus, bool on)
}
/* Transition SD and backplane clock readiness */
-static int brcmf_sdbrcm_clkctl(dhd_bus_t *bus, uint target, bool pendok)
+static int brcmf_sdbrcm_clkctl(struct brcmf_bus *bus, uint target, bool pendok)
{
#ifdef BCMDBG
uint oldstate = bus->clkstate;
@@ -1162,7 +1162,7 @@ static int brcmf_sdbrcm_clkctl(dhd_bus_t *bus, uint target, bool pendok)
return 0;
}
-int brcmf_sdbrcm_bussleep(dhd_bus_t *bus, bool sleep)
+int brcmf_sdbrcm_bussleep(struct brcmf_bus *bus, bool sleep)
{
struct brcmf_sdio_card *card = bus->card;
struct sdpcmd_regs *regs = bus->regs;
@@ -1259,7 +1259,7 @@ int brcmf_sdbrcm_bussleep(dhd_bus_t *bus, bool sleep)
/* Writes a HW/SW header into the packet and sends it. */
/* Assumes: (a) header space already there, (b) caller holds lock */
-static int brcmf_sdbrcm_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
+static int brcmf_sdbrcm_txpkt(struct brcmf_bus *bus, struct sk_buff *pkt, uint chan,
bool free_pkt)
{
int ret;
@@ -1411,7 +1411,7 @@ done:
return ret;
}
-int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
+int brcmf_sdbrcm_bus_txdata(struct brcmf_bus *bus, struct sk_buff *pkt)
{
int ret = -EBADE;
uint datalen, prec;
@@ -1509,7 +1509,7 @@ int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
return ret;
}
-static uint brcmf_sdbrcm_sendfromq(dhd_bus_t *bus, uint maxframes)
+static uint brcmf_sdbrcm_sendfromq(struct brcmf_bus *bus, uint maxframes)
{
struct sk_buff *pkt;
u32 intstatus = 0;
@@ -1570,7 +1570,7 @@ static uint brcmf_sdbrcm_sendfromq(dhd_bus_t *bus, uint maxframes)
}
int
-brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
+brcmf_sdbrcm_bus_txctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen)
{
u8 *frame;
u16 len;
@@ -1731,7 +1731,7 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
return ret ? -EIO : 0;
}
-int brcmf_sdbrcm_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
+int brcmf_sdbrcm_bus_rxctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen)
{
int timeleft;
uint rxlen = 0;
@@ -1888,7 +1888,7 @@ dhd_dump_pct(struct brcmu_strbuf *strbuf, char *desc, uint num, uint div)
void brcmf_sdbrcm_bus_dump(struct brcmf_pub *drvr, struct brcmu_strbuf *strbuf)
{
- dhd_bus_t *bus = drvr->bus;
+ struct brcmf_bus *bus = drvr->bus;
brcmu_bprintf(strbuf, "Bus SDIO structure:\n");
brcmu_bprintf(strbuf,
@@ -1986,9 +1986,9 @@ void brcmf_sdbrcm_bus_dump(struct brcmf_pub *drvr, struct brcmu_strbuf *strbuf)
bus->sleeping);
}
-void dhd_bus_clearcounts(struct brcmf_pub *drvr)
+void brcmf_bus_clearcounts(struct brcmf_pub *drvr)
{
- dhd_bus_t *bus = (dhd_bus_t *) drvr->bus;
+ struct brcmf_bus *bus = (struct brcmf_bus *) drvr->bus;
bus->intrcount = bus->lastintrs = bus->spurious = bus->regfails = 0;
bus->rxrtx = bus->rx_toolong = bus->rxc_errors = 0;
@@ -1999,7 +1999,7 @@ void dhd_bus_clearcounts(struct brcmf_pub *drvr)
}
#ifdef SDTEST
-static int brcmf_sdbrcm_pktgen_get(dhd_bus_t *bus, u8 *arg)
+static int brcmf_sdbrcm_pktgen_get(struct brcmf_bus *bus, u8 *arg)
{
brcmf_pktgen_t pktgen;
@@ -2021,7 +2021,7 @@ static int brcmf_sdbrcm_pktgen_get(dhd_bus_t *bus, u8 *arg)
return 0;
}
-static int brcmf_sdbrcm_pktgen_set(dhd_bus_t *bus, u8 *arg)
+static int brcmf_sdbrcm_pktgen_set(struct brcmf_bus *bus, u8 *arg)
{
brcmf_pktgen_t pktgen;
uint oldcnt, oldmode;
@@ -2055,7 +2055,7 @@ static int brcmf_sdbrcm_pktgen_set(dhd_bus_t *bus, u8 *arg)
#endif /* SDTEST */
static int
-brcmf_sdbrcm_membytes(dhd_bus_t *bus, bool write, u32 address, u8 *data,
+brcmf_sdbrcm_membytes(struct brcmf_bus *bus, bool write, u32 address, u8 *data,
uint size)
{
int bcmerror = 0;
@@ -2116,7 +2116,7 @@ xfer_done:
}
#ifdef BCMDBG
-static int brcmf_sdbrcm_readshared(dhd_bus_t *bus, struct sdpcm_shared *sh)
+static int brcmf_sdbrcm_readshared(struct brcmf_bus *bus, struct sdpcm_shared *sh)
{
u32 addr;
int rv;
@@ -2168,7 +2168,7 @@ static int brcmf_sdbrcm_readshared(dhd_bus_t *bus, struct sdpcm_shared *sh)
return 0;
}
-static int brcmf_sdbrcm_checkdied(dhd_bus_t *bus, u8 *data, uint size)
+static int brcmf_sdbrcm_checkdied(struct brcmf_bus *bus, u8 *data, uint size)
{
int bcmerror = 0;
uint msize = 512;
@@ -2297,7 +2297,7 @@ done:
return bcmerror;
}
-static int brcmf_sdbrcm_mem_dump(dhd_bus_t *bus)
+static int brcmf_sdbrcm_mem_dump(struct brcmf_bus *bus)
{
int ret = 0;
int size; /* Full mem size */
@@ -2346,7 +2346,7 @@ static int brcmf_sdbrcm_mem_dump(dhd_bus_t *bus)
#define CONSOLE_LINE_MAX 192
-static int brcmf_sdbrcm_readconsole(dhd_bus_t *bus)
+static int brcmf_sdbrcm_readconsole(struct brcmf_bus *bus)
{
struct dhd_console *c = &bus->console;
u8 line[CONSOLE_LINE_MAX], ch;
@@ -2423,7 +2423,7 @@ break2:
}
#endif /* BCMDBG */
-int brcmf_sdbrcm_downloadvars(dhd_bus_t *bus, void *arg, int len)
+int brcmf_sdbrcm_downloadvars(struct brcmf_bus *bus, void *arg, int len)
{
int bcmerror = 0;
@@ -2457,7 +2457,7 @@ err:
}
static int
-brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
+brcmf_sdbrcm_doiovar(struct brcmf_bus *bus, const struct brcmu_iovar *vi, u32 actionid,
const char *name, void *params, int plen, void *arg, int len,
int val_size)
{
@@ -2900,7 +2900,7 @@ exit:
return bcmerror;
}
-static int brcmf_sdbrcm_write_vars(dhd_bus_t *bus)
+static int brcmf_sdbrcm_write_vars(struct brcmf_bus *bus)
{
int bcmerror = 0;
u32 varsize;
@@ -2987,7 +2987,7 @@ static int brcmf_sdbrcm_write_vars(dhd_bus_t *bus)
return bcmerror;
}
-static int brcmf_sdbrcm_download_state(dhd_bus_t *bus, bool enter)
+static int brcmf_sdbrcm_download_state(struct brcmf_bus *bus, bool enter)
{
uint retries;
u32 regdata;
@@ -3044,7 +3044,7 @@ int
brcmf_sdbrcm_bus_iovar_op(struct brcmf_pub *drvr, const char *name,
void *params, int plen, void *arg, int len, bool set)
{
- dhd_bus_t *bus = drvr->bus;
+ struct brcmf_bus *bus = drvr->bus;
const struct brcmu_iovar *vi = NULL;
int bcmerror = 0;
int val_size;
@@ -3129,7 +3129,7 @@ exit:
return bcmerror;
}
-void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
+void brcmf_sdbrcm_bus_stop(struct brcmf_bus *bus, bool enforce_mutex)
{
u32 local_hostintmask;
u8 saveclk;
@@ -3218,7 +3218,7 @@ void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex)
{
- dhd_bus_t *bus = drvr->bus;
+ struct brcmf_bus *bus = drvr->bus;
struct brcmf_timeout tmo;
uint retries = 0;
u8 ready, enable;
@@ -3344,7 +3344,7 @@ exit:
return ret;
}
-static void brcmf_sdbrcm_rxfail(dhd_bus_t *bus, bool abort, bool rtx)
+static void brcmf_sdbrcm_rxfail(struct brcmf_bus *bus, bool abort, bool rtx)
{
struct brcmf_sdio_card *card = bus->card;
struct sdpcmd_regs *regs = bus->regs;
@@ -3408,7 +3408,7 @@ static void brcmf_sdbrcm_rxfail(dhd_bus_t *bus, bool abort, bool rtx)
}
static void
-brcmf_sdbrcm_read_control(dhd_bus_t *bus, u8 *hdr, uint len, uint doff)
+brcmf_sdbrcm_read_control(struct brcmf_bus *bus, u8 *hdr, uint len, uint doff)
{
struct brcmf_sdio_card *card = bus->card;
uint rdlen, pad;
@@ -3513,7 +3513,7 @@ done:
brcmf_os_ioctl_resp_wake(bus->drvr);
}
-static u8 brcmf_sdbrcm_rxglom(dhd_bus_t *bus, u8 rxseq)
+static u8 brcmf_sdbrcm_rxglom(struct brcmf_bus *bus, u8 rxseq)
{
u16 dlen, totlen;
u8 *dptr, num = 0;
@@ -3916,7 +3916,7 @@ static u8 brcmf_sdbrcm_rxglom(dhd_bus_t *bus, u8 rxseq)
/* Return true if there may be more frames to read */
static uint
-brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
+brcmf_sdbrcm_readframes(struct brcmf_bus *bus, uint maxframes, bool *finished)
{
struct brcmf_sdio_card *card = bus->card;
@@ -4512,7 +4512,7 @@ deliver:
return rxcount;
}
-static u32 brcmf_sdbrcm_hostmail(dhd_bus_t *bus)
+static u32 brcmf_sdbrcm_hostmail(struct brcmf_bus *bus)
{
struct sdpcmd_regs *regs = bus->regs;
u32 intstatus = 0;
@@ -4586,7 +4586,7 @@ static u32 brcmf_sdbrcm_hostmail(dhd_bus_t *bus)
return intstatus;
}
-static bool brcmf_sdbrcm_dpc(dhd_bus_t *bus)
+static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)
{
struct brcmf_sdio_card *card = bus->card;
struct sdpcmd_regs *regs = bus->regs;
@@ -4842,7 +4842,7 @@ clkwait:
void brcmf_sdbrcm_isr(void *arg)
{
- dhd_bus_t *bus = (dhd_bus_t *) arg;
+ struct brcmf_bus *bus = (struct brcmf_bus *) arg;
struct brcmf_sdio_card *card;
DHD_TRACE(("%s: Enter\n", __func__));
@@ -4889,7 +4889,7 @@ void brcmf_sdbrcm_isr(void *arg)
}
#ifdef SDTEST
-static void brcmf_sdbrcm_pktgen_init(dhd_bus_t *bus)
+static void brcmf_sdbrcm_pktgen_init(struct brcmf_bus *bus)
{
/* Default to specified length, or full range */
if (brcmf_pktgen_len) {
@@ -4912,7 +4912,7 @@ static void brcmf_sdbrcm_pktgen_init(dhd_bus_t *bus)
bus->pktgen_stop = 1;
}
-static void brcmf_sdbrcm_pktgen(dhd_bus_t *bus)
+static void brcmf_sdbrcm_pktgen(struct brcmf_bus *bus)
{
struct sk_buff *pkt;
u8 *data;
@@ -5020,7 +5020,7 @@ static void brcmf_sdbrcm_pktgen(dhd_bus_t *bus)
}
}
-static void brcmf_sdbrcm_sdtest_set(dhd_bus_t *bus, bool start)
+static void brcmf_sdbrcm_sdtest_set(struct brcmf_bus *bus, bool start)
{
struct sk_buff *pkt;
u8 *data;
@@ -5047,7 +5047,7 @@ static void brcmf_sdbrcm_sdtest_set(dhd_bus_t *bus, bool start)
}
static void
-brcmf_sdbrcm_checkdied(dhd_bus_t *bus, struct sk_buff *pkt, uint seq)
+brcmf_sdbrcm_checkdied(struct brcmf_bus *bus, struct sk_buff *pkt, uint seq)
{
u8 *data;
uint pktlen;
@@ -5151,7 +5151,7 @@ brcmf_sdbrcm_checkdied(dhd_bus_t *bus, struct sk_buff *pkt, uint seq)
extern bool brcmf_sdbrcm_bus_watchdog(struct brcmf_pub *drvr)
{
- dhd_bus_t *bus;
+ struct brcmf_bus *bus;
DHD_TIMER(("%s: Enter\n", __func__));
@@ -5250,7 +5250,7 @@ extern bool brcmf_sdbrcm_bus_watchdog(struct brcmf_pub *drvr)
static int brcmf_sdbrcm_bus_console_in(struct brcmf_pub *drvr,
unsigned char *msg, uint msglen)
{
- dhd_bus_t *bus = drvr->bus;
+ struct brcmf_bus *bus = drvr->bus;
u32 addr, val;
int rv;
struct sk_buff *pkt;
@@ -5328,7 +5328,7 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
void *card)
{
int ret;
- dhd_bus_t *bus;
+ struct brcmf_bus *bus;
/* Init global variables at run-time, not as part of the declaration.
* This is required to support init/de-init of the driver.
@@ -5402,9 +5402,9 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
}
/* Allocate private bus interface state */
- bus = kzalloc(sizeof(dhd_bus_t), GFP_ATOMIC);
+ bus = kzalloc(sizeof(struct brcmf_bus), GFP_ATOMIC);
if (!bus) {
- DHD_ERROR(("%s: kmalloc of dhd_bus_t failed\n", __func__));
+ DHD_ERROR(("%s: kmalloc of struct dhd_bus failed\n", __func__));
goto fail;
}
bus->card = card;
@@ -5521,7 +5521,7 @@ fail:
}
static bool
-brcmf_sdbrcm_probe_attach(struct dhd_bus *bus, void *card, void *regsva,
+brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, void *card, void *regsva,
u16 devid)
{
u8 clkctl = 0;
@@ -5614,7 +5614,7 @@ fail:
return false;
}
-static bool brcmf_sdbrcm_probe_malloc(dhd_bus_t *bus, void *card)
+static bool brcmf_sdbrcm_probe_malloc(struct brcmf_bus *bus, void *card)
{
DHD_TRACE(("%s: Enter\n", __func__));
@@ -5654,7 +5654,7 @@ fail:
return false;
}
-static bool brcmf_sdbrcm_probe_init(dhd_bus_t *bus, void *card)
+static bool brcmf_sdbrcm_probe_init(struct brcmf_bus *bus, void *card)
{
s32 fnum;
@@ -5711,7 +5711,7 @@ static bool brcmf_sdbrcm_probe_init(dhd_bus_t *bus, void *card)
}
static bool
-brcmf_sdbrcm_download_firmware(struct dhd_bus *bus, void *card)
+brcmf_sdbrcm_download_firmware(struct brcmf_bus *bus, void *card)
{
bool ret;
@@ -5726,7 +5726,7 @@ brcmf_sdbrcm_download_firmware(struct dhd_bus *bus, void *card)
}
/* Detach and free everything */
-static void brcmf_sdbrcm_release(dhd_bus_t *bus)
+static void brcmf_sdbrcm_release(struct brcmf_bus *bus)
{
DHD_TRACE(("%s: Enter\n", __func__));
@@ -5749,7 +5749,7 @@ static void brcmf_sdbrcm_release(dhd_bus_t *bus)
DHD_TRACE(("%s: Disconnected\n", __func__));
}
-static void brcmf_sdbrcm_release_malloc(dhd_bus_t *bus)
+static void brcmf_sdbrcm_release_malloc(struct brcmf_bus *bus)
{
DHD_TRACE(("%s: Enter\n", __func__));
@@ -5764,7 +5764,7 @@ static void brcmf_sdbrcm_release_malloc(dhd_bus_t *bus)
bus->databuf = NULL;
}
-static void brcmf_sdbrcm_release_dongle(dhd_bus_t *bus)
+static void brcmf_sdbrcm_release_dongle(struct brcmf_bus *bus)
{
DHD_TRACE(("%s: Enter\n", __func__));
@@ -5785,7 +5785,7 @@ static void brcmf_sdbrcm_release_dongle(dhd_bus_t *bus)
static void brcmf_sdbrcm_disconnect(void *ptr)
{
- dhd_bus_t *bus = (dhd_bus_t *)ptr;
+ struct brcmf_bus *bus = (struct brcmf_bus *)ptr;
DHD_TRACE(("%s: Enter\n", __func__));
@@ -5807,7 +5807,7 @@ static struct brcmf_sdioh_driver dhd_sdio = {
brcmf_sdbrcm_disconnect
};
-int dhd_bus_register(void)
+int brcmf_bus_register(void)
{
DHD_TRACE(("%s: Enter\n", __func__));
@@ -5829,14 +5829,14 @@ int dhd_bus_register(void)
return brcmf_sdio_register(&dhd_sdio);
}
-void dhd_bus_unregister(void)
+void brcmf_bus_unregister(void)
{
DHD_TRACE(("%s: Enter\n", __func__));
brcmf_sdio_unregister();
}
-static int brcmf_sdbrcm_download_code_file(struct dhd_bus *bus)
+static int brcmf_sdbrcm_download_code_file(struct brcmf_bus *bus)
{
int offset = 0;
uint len;
@@ -5938,7 +5938,7 @@ static uint brcmf_process_nvram_vars(char *varbuf, uint len)
return buf_len;
}
-static int brcmf_sdbrcm_download_nvram(struct dhd_bus *bus)
+static int brcmf_sdbrcm_download_nvram(struct brcmf_bus *bus)
{
uint len;
char *memblock = NULL;
@@ -5990,7 +5990,7 @@ err:
return ret;
}
-static int _brcmf_sdbrcm_download_firmware(struct dhd_bus *bus)
+static int _brcmf_sdbrcm_download_firmware(struct brcmf_bus *bus)
{
int bcmerror = -1;
@@ -6033,7 +6033,7 @@ err:
static int
-brcmf_sdbrcm_send_buf(dhd_bus_t *bus, u32 addr, uint fn, uint flags,
+brcmf_sdbrcm_send_buf(struct brcmf_bus *bus, u32 addr, uint fn, uint flags,
u8 *buf, uint nbytes, struct sk_buff *pkt,
brcmf_sdio_cmplt_fn_t complete, void *handle)
{
@@ -6042,23 +6042,23 @@ brcmf_sdbrcm_send_buf(dhd_bus_t *bus, u32 addr, uint fn, uint flags,
handle);
}
-uint dhd_bus_chip(struct dhd_bus *bus)
+uint brcmf_bus_chip(struct brcmf_bus *bus)
{
ASSERT(bus->ci != NULL);
return bus->ci->chip;
}
-void *dhd_bus_pub(struct dhd_bus *bus)
+void *brcmf_bus_drvr(struct brcmf_bus *bus)
{
return bus->drvr;
}
-void *dhd_bus_txq(struct dhd_bus *bus)
+void *brcmf_bus_txq(struct brcmf_bus *bus)
{
return &bus->txq;
}
-uint dhd_bus_hdrlen(struct dhd_bus *bus)
+uint brcmf_bus_hdrlen(struct brcmf_bus *bus)
{
return SDPCM_HDRLEN;
}
@@ -6066,7 +6066,7 @@ uint dhd_bus_hdrlen(struct dhd_bus *bus)
int brcmf_bus_devreset(struct brcmf_pub *drvr, u8 flag)
{
int bcmerror = 0;
- dhd_bus_t *bus;
+ struct brcmf_bus *bus;
bus = drvr->bus;
@@ -6265,7 +6265,7 @@ brcmf_sdbrcm_chip_disablecore(struct brcmf_sdio_card *card, u32 corebase)
}
static int
-brcmf_sdbrcm_chip_attach(struct dhd_bus *bus, void *regs)
+brcmf_sdbrcm_chip_attach(struct brcmf_bus *bus, void *regs)
{
struct chip_info *ci;
int err;
@@ -6448,7 +6448,7 @@ static const struct sdiod_drive_str sdiod_drive_strength_tab3[] = {
#define SDIOD_DRVSTR_KEY(chip, pmu) (((chip) << 16) | (pmu))
static void
-brcmf_sdbrcm_sdiod_drive_strength_init(struct dhd_bus *bus, u32 drivestrength) {
+brcmf_sdbrcm_sdiod_drive_strength_init(struct brcmf_bus *bus, u32 drivestrength) {
struct sdiod_drive_str *str_tab = NULL;
u32 str_mask = 0;
u32 str_shift = 0;
@@ -6512,7 +6512,7 @@ brcmf_sdbrcm_sdiod_drive_strength_init(struct dhd_bus *bus, u32 drivestrength) {
}
static void
-brcmf_sdbrcm_chip_detach(struct dhd_bus *bus)
+brcmf_sdbrcm_chip_detach(struct brcmf_bus *bus)
{
DHD_TRACE(("%s: Enter\n", __func__));
@@ -6521,7 +6521,7 @@ brcmf_sdbrcm_chip_detach(struct dhd_bus *bus)
}
static void
-brcmf_sdbrcm_wait_for_event(dhd_bus_t *bus, bool *lockvar)
+brcmf_sdbrcm_wait_for_event(struct brcmf_bus *bus, bool *lockvar)
{
brcmf_sdbrcm_sdunlock(bus);
wait_event_interruptible_timeout(bus->ctrl_wait,
@@ -6531,7 +6531,7 @@ brcmf_sdbrcm_wait_for_event(dhd_bus_t *bus, bool *lockvar)
}
static void
-brcmf_sdbrcm_wait_event_wakeup(dhd_bus_t *bus)
+brcmf_sdbrcm_wait_event_wakeup(struct brcmf_bus *bus)
{
if (waitqueue_active(&bus->ctrl_wait))
wake_up_interruptible(&bus->ctrl_wait);
@@ -6541,7 +6541,7 @@ brcmf_sdbrcm_wait_event_wakeup(dhd_bus_t *bus)
static int
brcmf_sdbrcm_watchdog_thread(void *data)
{
- dhd_bus_t *bus = (dhd_bus_t *)data;
+ struct brcmf_bus *bus = (struct brcmf_bus *)data;
/* This thread doesn't need any user-level access,
* so get rid of all our resources
@@ -6572,7 +6572,7 @@ brcmf_sdbrcm_watchdog_thread(void *data)
static void
brcmf_sdbrcm_watchdog(unsigned long data)
{
- dhd_bus_t *bus = (dhd_bus_t *)data;
+ struct brcmf_bus *bus = (struct brcmf_bus *)data;
if (brcmf_watchdog_prio >= 0) {
if (bus->watchdog_tsk)
@@ -6592,7 +6592,7 @@ brcmf_sdbrcm_watchdog(unsigned long data)
}
void
-brcmf_sdbrcm_wd_timer(struct dhd_bus *bus, uint wdtick)
+brcmf_sdbrcm_wd_timer(struct brcmf_bus *bus, uint wdtick)
{
static uint save_ms;
@@ -6636,7 +6636,7 @@ brcmf_sdbrcm_wd_timer(struct dhd_bus *bus, uint wdtick)
static int brcmf_sdbrcm_dpc_thread(void *data)
{
- dhd_bus_t *bus = (dhd_bus_t *) data;
+ struct brcmf_bus *bus = (struct brcmf_bus *) data;
/* This thread doesn't need any user-level access,
* so get rid of all our resources
@@ -6670,7 +6670,7 @@ static int brcmf_sdbrcm_dpc_thread(void *data)
static void brcmf_sdbrcm_dpc_tasklet(unsigned long data)
{
- dhd_bus_t *bus = (dhd_bus_t *) data;
+ struct brcmf_bus *bus = (struct brcmf_bus *) data;
/* Call bus dpc unless it indicated down (then clean stop) */
if (bus->drvr->busstate != DHD_BUS_DOWN) {
@@ -6680,7 +6680,7 @@ static void brcmf_sdbrcm_dpc_tasklet(unsigned long data)
brcmf_sdbrcm_bus_stop(bus, true);
}
-static void brcmf_sdbrcm_sched_dpc(dhd_bus_t *bus)
+static void brcmf_sdbrcm_sched_dpc(struct brcmf_bus *bus)
{
if (bus->dpc_tsk) {
complete(&bus->dpc_wait);
@@ -6690,7 +6690,7 @@ static void brcmf_sdbrcm_sched_dpc(dhd_bus_t *bus)
tasklet_schedule(&bus->tasklet);
}
-static void brcmf_sdbrcm_sdlock(dhd_bus_t *bus)
+static void brcmf_sdbrcm_sdlock(struct brcmf_bus *bus)
{
if (bus->threads_only)
down(&bus->sdsem);
@@ -6698,7 +6698,7 @@ static void brcmf_sdbrcm_sdlock(dhd_bus_t *bus)
spin_lock_bh(&bus->sdlock);
}
-static void brcmf_sdbrcm_sdunlock(dhd_bus_t *bus)
+static void brcmf_sdbrcm_sdunlock(struct brcmf_bus *bus)
{
if (bus->threads_only)
up(&bus->sdsem);
@@ -6706,7 +6706,7 @@ static void brcmf_sdbrcm_sdunlock(dhd_bus_t *bus)
spin_unlock_bh(&bus->sdlock);
}
-static int brcmf_sdbrcm_get_image(char *buf, int len, struct dhd_bus *bus)
+static int brcmf_sdbrcm_get_image(char *buf, int len, struct brcmf_bus *bus)
{
if (bus->firmware->size < bus->fw_ptr + len)
len = bus->firmware->size - bus->fw_ptr;
--
1.7.1
From: Roland Vossen <[email protected]>
Code cleanup. Warnings were due to pointer declarations being used for an
address that does not reside on the CPU bus.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 4 ++--
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c | 6 +++---
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 4 ++--
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 20 ++++++++++----------
drivers/staging/brcm80211/brcmfmac/sdio_host.h | 6 +++---
5 files changed, 20 insertions(+), 20 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
index 84d1bcd..cecb291 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
@@ -67,7 +67,7 @@ struct brcmf_sdio_card {
static struct brcmf_sdio_card *l_card;
struct brcmf_sdio_card*
-brcmf_sdcard_attach(void *cfghdl, void **regsva, uint irq)
+brcmf_sdcard_attach(void *cfghdl, u32 *regsva, uint irq)
{
struct brcmf_sdio_card *card;
@@ -88,7 +88,7 @@ brcmf_sdcard_attach(void *cfghdl, void **regsva, uint irq)
card->init_success = true;
- *regsva = (u32 *) SI_ENUM_BASE;
+ *regsva = SI_ENUM_BASE;
/* Report the BAR, to fix if needed */
card->sbwad = SI_ENUM_BASE;
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
index 45fb76e..ec7d79d 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
@@ -68,7 +68,7 @@ EXPORT_SYMBOL(brcmf_sdio_remove);
int brcmf_sdio_probe(struct device *dev)
{
struct sdio_hc *sdhc = NULL;
- unsigned long regs = 0;
+ u32 regs = 0;
struct brcmf_sdio_card *card = NULL;
int irq = 0;
u32 vendevid;
@@ -82,7 +82,7 @@ int brcmf_sdio_probe(struct device *dev)
}
sdhc->dev = (void *)dev;
- card = brcmf_sdcard_attach((void *)0, (void **)®s, irq);
+ card = brcmf_sdcard_attach((void *)0, ®s, irq);
if (!card) {
SDLX_MSG(("%s: attach failed\n", __func__));
goto err;
@@ -101,7 +101,7 @@ int brcmf_sdio_probe(struct device *dev)
/* try to attach to the target device */
sdhc->ch = drvinfo.attach((vendevid >> 16), (vendevid & 0xFFFF),
- 0, 0, 0, 0, (void *)regs, card);
+ 0, 0, 0, 0, regs, card);
if (!sdhc->ch) {
SDLX_MSG(("%s: device attach failed\n", __func__));
goto err;
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 1b55e56..4c0a031 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -694,7 +694,7 @@ brcmf_sdioh_request_packet(struct sdioh_info *sd, uint fix_inc, uint write,
* is supposed to give
* us something we can work with.
*/
- ASSERT(((u32) (pkt->data) & DMA_ALIGN_MASK) == 0);
+ ASSERT(((ulong) (pkt->data) & DMA_ALIGN_MASK) == 0);
if ((write) && (!fifo)) {
err_ret = sdio_memcpy_toio(gInstance->func[func], addr,
@@ -789,7 +789,7 @@ brcmf_sdioh_request_buffer(struct sdioh_info *sd, uint pio_dma, uint fix_inc,
memcpy(buffer, mypkt->data, buflen_u);
brcmu_pkt_buf_free_skb(mypkt);
- } else if (((u32) (pkt->data) & DMA_ALIGN_MASK) != 0) {
+ } else if (((ulong) (pkt->data) & DMA_ALIGN_MASK) != 0) {
/* Case 2: We have a packet, but it is unaligned. */
/* In this case, we cannot have a chain. */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 9bc47a4..cdc57f9 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -884,7 +884,7 @@ static void brcmf_sdbrcm_release_malloc(struct brcmf_bus *bus);
static void brcmf_sdbrcm_disconnect(void *ptr);
static bool brcmf_sdbrcm_chipmatch(u16 chipid);
static bool brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, void *card,
- void *regsva, u16 devid);
+ u32 regsva, u16 devid);
static bool brcmf_sdbrcm_probe_malloc(struct brcmf_bus *bus, void *card);
static bool brcmf_sdbrcm_probe_init(struct brcmf_bus *bus, void *card);
static void brcmf_sdbrcm_release_dongle(struct brcmf_bus *bus);
@@ -908,7 +908,7 @@ static int brcmf_sdbrcm_download_nvram(struct brcmf_bus *bus);
static void
brcmf_sdbrcm_chip_disablecore(struct brcmf_sdio_card *card, u32 corebase);
-static int brcmf_sdbrcm_chip_attach(struct brcmf_bus *bus, void *regs);
+static int brcmf_sdbrcm_chip_attach(struct brcmf_bus *bus, u32 regs);
static void
brcmf_sdbrcm_chip_resetcore(struct brcmf_sdio_card *card, u32 corebase);
@@ -5343,7 +5343,7 @@ static bool brcmf_sdbrcm_chipmatch(u16 chipid)
}
static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
- u16 slot, u16 func, uint bustype, void *regsva,
+ u16 slot, u16 func, uint bustype, u32 regsva,
void *card)
{
int ret;
@@ -5374,7 +5374,7 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
DHD_INFO(("%s: venid 0x%04x devid 0x%04x\n", __func__, venid, devid));
/* We make assumptions about address window mappings */
- ASSERT((unsigned long)regsva == SI_ENUM_BASE);
+ ASSERT(regsva == SI_ENUM_BASE);
/* SDIO car passes venid and devid based on CIS parsing -- but
* low-power start
@@ -5540,7 +5540,7 @@ fail:
}
static bool
-brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, void *card, void *regsva,
+brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, void *card, u32 regsva,
u16 devid)
{
u8 clkctl = 0;
@@ -6097,8 +6097,8 @@ int brcmf_bus_devreset(struct brcmf_pub *drvr, u8 flag)
/* Attempt to re-attach & download */
if (brcmf_sdbrcm_probe_attach(bus, bus->card,
- (u32 *) SI_ENUM_BASE,
- bus->cl_devid)) {
+ SI_ENUM_BASE,
+ bus->cl_devid)) {
/* Attempt to download binary to the dongle */
if (brcmf_sdbrcm_probe_init(bus, bus->card)) {
/* Re-init bus, enable F2 transfer */
@@ -6126,7 +6126,7 @@ int brcmf_bus_devreset(struct brcmf_pub *drvr, u8 flag)
static int
brcmf_sdbrcm_chip_recognition(struct brcmf_sdio_card *card,
- struct chip_info *ci, void *regs)
+ struct chip_info *ci, u32 regs)
{
u32 regdata;
@@ -6136,7 +6136,7 @@ brcmf_sdbrcm_chip_recognition(struct brcmf_sdio_card *card,
* For different chiptypes or old sdio hosts w/o chipcommon,
* other ways of recognition should be added here.
*/
- ci->cccorebase = (u32)regs;
+ ci->cccorebase = regs;
regdata = brcmf_sdcard_reg_read(card,
CORE_CC_REG(ci->cccorebase, chipid), 4);
ci->chip = regdata & CID_ID_MASK;
@@ -6263,7 +6263,7 @@ brcmf_sdbrcm_chip_disablecore(struct brcmf_sdio_card *card, u32 corebase)
}
static int
-brcmf_sdbrcm_chip_attach(struct brcmf_bus *bus, void *regs)
+brcmf_sdbrcm_chip_attach(struct brcmf_bus *bus, u32 regs)
{
struct chip_info *ci;
int err;
diff --git a/drivers/staging/brcm80211/brcmfmac/sdio_host.h b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
index 68a2a64..9b3c149 100644
--- a/drivers/staging/brcm80211/brcmfmac/sdio_host.h
+++ b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
@@ -52,8 +52,8 @@ struct brcmf_sdio_card;
* implementation may maintain a single "default" handle (e.g. the first or
* most recent one) to enable single-instance implementations to pass NULL.
*/
-extern struct brcmf_sdio_card *brcmf_sdcard_attach(void *cfghdl, void **regsva,
- uint irq);
+extern struct brcmf_sdio_card*
+brcmf_sdcard_attach(void *cfghdl, u32 *regsva, uint irq);
/* Detach - freeup resources allocated in attach */
extern int brcmf_sdcard_detach(struct brcmf_sdio_card *card);
@@ -174,7 +174,7 @@ extern int brcmf_sdcard_iovar_op(struct brcmf_sdio_card *card, const char *name,
struct brcmf_sdioh_driver {
/* attach to device */
void *(*attach) (u16 vend_id, u16 dev_id, u16 bus, u16 slot,
- u16 func, uint bustype, void *regsva, void *param);
+ u16 func, uint bustype, u32 regsva, void *param);
/* detach from device */
void (*detach) (void *ch);
};
--
1.7.1
From: Arend van Spriel <[email protected]>
The pmu source file contains several code fragments for chipsets that
are not supported by this driver. These have been removed.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/pmu.c | 1424 ------------------------------
drivers/staging/brcm80211/brcmsmac/pmu.h | 3 -
2 files changed, 0 insertions(+), 1427 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/pmu.c b/drivers/staging/brcm80211/brcmsmac/pmu.c
index 0b7ab82..d7ca7ed 100644
--- a/drivers/staging/brcm80211/brcmsmac/pmu.c
+++ b/drivers/staging/brcm80211/brcmsmac/pmu.c
@@ -596,432 +596,11 @@
/* PMU resource up transition time in ILP cycles */
#define PMURES_UP_TRANSITION 2
-/* Setup resource up/down timers */
-typedef struct {
- u8 resnum;
- u16 updown;
-} pmu_res_updown_t;
-
-/* Change resource dependancies masks */
-typedef struct {
- u32 res_mask; /* resources (chip specific) */
- s8 action; /* action */
- u32 depend_mask; /* changes to the dependancies mask */
- /* action is taken when filter is NULL or return true: */
- bool(*filter) (struct si_pub *sih);
-} pmu_res_depend_t;
-
-/* setup pll and query clock speed */
-typedef struct {
- u16 fref;
- u8 xf;
- u8 p1div;
- u8 p2div;
- u8 ndiv_int;
- u32 ndiv_frac;
-} pmu1_xtaltab0_t;
-
-/*
- * prototypes used in resource tables
- */
-static bool si_pmu_res_depfltr_bb(struct si_pub *sih);
-static bool si_pmu_res_depfltr_ncb(struct si_pub *sih);
-static bool si_pmu_res_depfltr_paldo(struct si_pub *sih);
-static bool si_pmu_res_depfltr_npaldo(struct si_pub *sih);
-
-static const pmu_res_updown_t bcm4328a0_res_updown[] = {
- {
- RES4328_EXT_SWITCHER_PWM, 0x0101}, {
- RES4328_BB_SWITCHER_PWM, 0x1f01}, {
- RES4328_BB_SWITCHER_BURST, 0x010f}, {
- RES4328_BB_EXT_SWITCHER_BURST, 0x0101}, {
- RES4328_ILP_REQUEST, 0x0202}, {
- RES4328_RADIO_SWITCHER_PWM, 0x0f01}, {
- RES4328_RADIO_SWITCHER_BURST, 0x0f01}, {
- RES4328_ROM_SWITCH, 0x0101}, {
- RES4328_PA_REF_LDO, 0x0f01}, {
- RES4328_RADIO_LDO, 0x0f01}, {
- RES4328_AFE_LDO, 0x0f01}, {
- RES4328_PLL_LDO, 0x0f01}, {
- RES4328_BG_FILTBYP, 0x0101}, {
- RES4328_TX_FILTBYP, 0x0101}, {
- RES4328_RX_FILTBYP, 0x0101}, {
- RES4328_XTAL_PU, 0x0101}, {
- RES4328_XTAL_EN, 0xa001}, {
- RES4328_BB_PLL_FILTBYP, 0x0101}, {
- RES4328_RF_PLL_FILTBYP, 0x0101}, {
- RES4328_BB_PLL_PU, 0x0701}
-};
-
-static const pmu_res_depend_t bcm4328a0_res_depend[] = {
- /* Adjust ILP request resource not to force ext/BB switchers into burst mode */
- {
- PMURES_BIT(RES4328_ILP_REQUEST),
- RES_DEPEND_SET,
- PMURES_BIT(RES4328_EXT_SWITCHER_PWM) |
- PMURES_BIT(RES4328_BB_SWITCHER_PWM), NULL}
-};
-
-static const pmu_res_updown_t bcm4325a0_res_updown_qt[] = {
- {
- RES4325_HT_AVAIL, 0x0300}, {
- RES4325_BBPLL_PWRSW_PU, 0x0101}, {
- RES4325_RFPLL_PWRSW_PU, 0x0101}, {
- RES4325_ALP_AVAIL, 0x0100}, {
- RES4325_XTAL_PU, 0x1000}, {
- RES4325_LNLDO1_PU, 0x0800}, {
- RES4325_CLDO_CBUCK_PWM, 0x0101}, {
- RES4325_CBUCK_PWM, 0x0803}
-};
-
-static const pmu_res_updown_t bcm4325a0_res_updown[] = {
- {
- RES4325_XTAL_PU, 0x1501}
-};
-
-static const pmu_res_depend_t bcm4325a0_res_depend[] = {
- /* Adjust OTP PU resource dependencies - remove BB BURST */
- {
- PMURES_BIT(RES4325_OTP_PU),
- RES_DEPEND_REMOVE,
- PMURES_BIT(RES4325_BUCK_BOOST_BURST), NULL},
- /* Adjust ALP/HT Avail resource dependencies - bring up BB along if it is used. */
- {
- PMURES_BIT(RES4325_ALP_AVAIL) | PMURES_BIT(RES4325_HT_AVAIL),
- RES_DEPEND_ADD,
- PMURES_BIT(RES4325_BUCK_BOOST_BURST) |
- PMURES_BIT(RES4325_BUCK_BOOST_PWM), si_pmu_res_depfltr_bb},
- /* Adjust HT Avail resource dependencies - bring up RF switches along with HT. */
- {
- PMURES_BIT(RES4325_HT_AVAIL),
- RES_DEPEND_ADD,
- PMURES_BIT(RES4325_RX_PWRSW_PU) |
- PMURES_BIT(RES4325_TX_PWRSW_PU) |
- PMURES_BIT(RES4325_LOGEN_PWRSW_PU) |
- PMURES_BIT(RES4325_AFE_PWRSW_PU), NULL},
- /* Adjust ALL resource dependencies - remove CBUCK dependancies if it is not used. */
- {
- PMURES_BIT(RES4325_ILP_REQUEST) |
- PMURES_BIT(RES4325_ABUCK_BURST) |
- PMURES_BIT(RES4325_ABUCK_PWM) |
- PMURES_BIT(RES4325_LNLDO1_PU) |
- PMURES_BIT(RES4325C1_LNLDO2_PU) |
- PMURES_BIT(RES4325_XTAL_PU) |
- PMURES_BIT(RES4325_ALP_AVAIL) |
- PMURES_BIT(RES4325_RX_PWRSW_PU) |
- PMURES_BIT(RES4325_TX_PWRSW_PU) |
- PMURES_BIT(RES4325_RFPLL_PWRSW_PU) |
- PMURES_BIT(RES4325_LOGEN_PWRSW_PU) |
- PMURES_BIT(RES4325_AFE_PWRSW_PU) |
- PMURES_BIT(RES4325_BBPLL_PWRSW_PU) |
- PMURES_BIT(RES4325_HT_AVAIL), RES_DEPEND_REMOVE,
- PMURES_BIT(RES4325B0_CBUCK_LPOM) |
- PMURES_BIT(RES4325B0_CBUCK_BURST) |
- PMURES_BIT(RES4325B0_CBUCK_PWM), si_pmu_res_depfltr_ncb}
-};
-
-static const pmu_res_updown_t bcm4315a0_res_updown_qt[] = {
- {
- RES4315_HT_AVAIL, 0x0101}, {
- RES4315_XTAL_PU, 0x0100}, {
- RES4315_LNLDO1_PU, 0x0100}, {
- RES4315_PALDO_PU, 0x0100}, {
- RES4315_CLDO_PU, 0x0100}, {
- RES4315_CBUCK_PWM, 0x0100}, {
- RES4315_CBUCK_BURST, 0x0100}, {
- RES4315_CBUCK_LPOM, 0x0100}
-};
-
-static const pmu_res_updown_t bcm4315a0_res_updown[] = {
- {
- RES4315_XTAL_PU, 0x2501}
-};
-
-static const pmu_res_depend_t bcm4315a0_res_depend[] = {
- /* Adjust OTP PU resource dependencies - not need PALDO unless write */
- {
- PMURES_BIT(RES4315_OTP_PU),
- RES_DEPEND_REMOVE,
- PMURES_BIT(RES4315_PALDO_PU), si_pmu_res_depfltr_npaldo},
- /* Adjust ALP/HT Avail resource dependencies - bring up PALDO along if it is used. */
- {
- PMURES_BIT(RES4315_ALP_AVAIL) | PMURES_BIT(RES4315_HT_AVAIL),
- RES_DEPEND_ADD,
- PMURES_BIT(RES4315_PALDO_PU), si_pmu_res_depfltr_paldo},
- /* Adjust HT Avail resource dependencies - bring up RF switches along with HT. */
- {
- PMURES_BIT(RES4315_HT_AVAIL),
- RES_DEPEND_ADD,
- PMURES_BIT(RES4315_RX_PWRSW_PU) |
- PMURES_BIT(RES4315_TX_PWRSW_PU) |
- PMURES_BIT(RES4315_LOGEN_PWRSW_PU) |
- PMURES_BIT(RES4315_AFE_PWRSW_PU), NULL},
- /* Adjust ALL resource dependencies - remove CBUCK dependancies if it is not used. */
- {
- PMURES_BIT(RES4315_CLDO_PU) | PMURES_BIT(RES4315_ILP_REQUEST) |
- PMURES_BIT(RES4315_LNLDO1_PU) |
- PMURES_BIT(RES4315_OTP_PU) |
- PMURES_BIT(RES4315_LNLDO2_PU) |
- PMURES_BIT(RES4315_XTAL_PU) |
- PMURES_BIT(RES4315_ALP_AVAIL) |
- PMURES_BIT(RES4315_RX_PWRSW_PU) |
- PMURES_BIT(RES4315_TX_PWRSW_PU) |
- PMURES_BIT(RES4315_RFPLL_PWRSW_PU) |
- PMURES_BIT(RES4315_LOGEN_PWRSW_PU) |
- PMURES_BIT(RES4315_AFE_PWRSW_PU) |
- PMURES_BIT(RES4315_BBPLL_PWRSW_PU) |
- PMURES_BIT(RES4315_HT_AVAIL), RES_DEPEND_REMOVE,
- PMURES_BIT(RES4315_CBUCK_LPOM) |
- PMURES_BIT(RES4315_CBUCK_BURST) |
- PMURES_BIT(RES4315_CBUCK_PWM), si_pmu_res_depfltr_ncb}
-};
-
- /* 4329 specific. needs to come back this issue later */
-static const pmu_res_updown_t bcm4329_res_updown[] = {
- {
- RES4329_XTAL_PU, 0x1501}
-};
-
-static const pmu_res_depend_t bcm4329_res_depend[] = {
- /* Adjust HT Avail resource dependencies */
- {
- PMURES_BIT(RES4329_HT_AVAIL),
- RES_DEPEND_ADD,
- PMURES_BIT(RES4329_CBUCK_LPOM) |
- PMURES_BIT(RES4329_CBUCK_BURST) |
- PMURES_BIT(RES4329_CBUCK_PWM) |
- PMURES_BIT(RES4329_CLDO_PU) |
- PMURES_BIT(RES4329_PALDO_PU) |
- PMURES_BIT(RES4329_LNLDO1_PU) |
- PMURES_BIT(RES4329_XTAL_PU) |
- PMURES_BIT(RES4329_ALP_AVAIL) |
- PMURES_BIT(RES4329_RX_PWRSW_PU) |
- PMURES_BIT(RES4329_TX_PWRSW_PU) |
- PMURES_BIT(RES4329_RFPLL_PWRSW_PU) |
- PMURES_BIT(RES4329_LOGEN_PWRSW_PU) |
- PMURES_BIT(RES4329_AFE_PWRSW_PU) |
- PMURES_BIT(RES4329_BBPLL_PWRSW_PU), NULL}
-};
-
-static const pmu_res_updown_t bcm4319a0_res_updown_qt[] = {
- {
- RES4319_HT_AVAIL, 0x0101}, {
- RES4319_XTAL_PU, 0x0100}, {
- RES4319_LNLDO1_PU, 0x0100}, {
- RES4319_PALDO_PU, 0x0100}, {
- RES4319_CLDO_PU, 0x0100}, {
- RES4319_CBUCK_PWM, 0x0100}, {
- RES4319_CBUCK_BURST, 0x0100}, {
- RES4319_CBUCK_LPOM, 0x0100}
-};
-
-static const pmu_res_updown_t bcm4319a0_res_updown[] = {
- {
- RES4319_XTAL_PU, 0x3f01}
-};
-
-static const pmu_res_depend_t bcm4319a0_res_depend[] = {
- /* Adjust OTP PU resource dependencies - not need PALDO unless write */
- {
- PMURES_BIT(RES4319_OTP_PU),
- RES_DEPEND_REMOVE,
- PMURES_BIT(RES4319_PALDO_PU), si_pmu_res_depfltr_npaldo},
- /* Adjust HT Avail resource dependencies - bring up PALDO along if it is used. */
- {
- PMURES_BIT(RES4319_HT_AVAIL),
- RES_DEPEND_ADD,
- PMURES_BIT(RES4319_PALDO_PU), si_pmu_res_depfltr_paldo},
- /* Adjust HT Avail resource dependencies - bring up RF switches along with HT. */
- {
- PMURES_BIT(RES4319_HT_AVAIL),
- RES_DEPEND_ADD,
- PMURES_BIT(RES4319_RX_PWRSW_PU) |
- PMURES_BIT(RES4319_TX_PWRSW_PU) |
- PMURES_BIT(RES4319_RFPLL_PWRSW_PU) |
- PMURES_BIT(RES4319_LOGEN_PWRSW_PU) |
- PMURES_BIT(RES4319_AFE_PWRSW_PU), NULL}
-};
-
-static const pmu_res_updown_t bcm4336a0_res_updown_qt[] = {
- {
- RES4336_HT_AVAIL, 0x0101}, {
- RES4336_XTAL_PU, 0x0100}, {
- RES4336_CLDO_PU, 0x0100}, {
- RES4336_CBUCK_PWM, 0x0100}, {
- RES4336_CBUCK_BURST, 0x0100}, {
- RES4336_CBUCK_LPOM, 0x0100}
-};
-
-static const pmu_res_updown_t bcm4336a0_res_updown[] = {
- {
- RES4336_HT_AVAIL, 0x0D01}
-};
-
-static const pmu_res_depend_t bcm4336a0_res_depend[] = {
- /* Just a dummy entry for now */
- {
- PMURES_BIT(RES4336_RSVD), RES_DEPEND_ADD, 0, NULL}
-};
-
-static const pmu_res_updown_t bcm4330a0_res_updown_qt[] = {
- {
- RES4330_HT_AVAIL, 0x0101}, {
- RES4330_XTAL_PU, 0x0100}, {
- RES4330_CLDO_PU, 0x0100}, {
- RES4330_CBUCK_PWM, 0x0100}, {
- RES4330_CBUCK_BURST, 0x0100}, {
- RES4330_CBUCK_LPOM, 0x0100}
-};
-
-static const pmu_res_updown_t bcm4330a0_res_updown[] = {
- {
- RES4330_HT_AVAIL, 0x0e02}
-};
-
-static const pmu_res_depend_t bcm4330a0_res_depend[] = {
- /* Just a dummy entry for now */
- {
- PMURES_BIT(RES4330_HT_AVAIL), RES_DEPEND_ADD, 0, NULL}
-};
-
-/* the following table is based on 1440Mhz fvco */
-static const pmu1_xtaltab0_t pmu1_xtaltab0_1440[] = {
- {
- 12000, 1, 1, 1, 0x78, 0x0}, {
- 13000, 2, 1, 1, 0x6E, 0xC4EC4E}, {
- 14400, 3, 1, 1, 0x64, 0x0}, {
- 15360, 4, 1, 1, 0x5D, 0xC00000}, {
- 16200, 5, 1, 1, 0x58, 0xE38E38}, {
- 16800, 6, 1, 1, 0x55, 0xB6DB6D}, {
- 19200, 7, 1, 1, 0x4B, 0}, {
- 19800, 8, 1, 1, 0x48, 0xBA2E8B}, {
- 20000, 9, 1, 1, 0x48, 0x0}, {
- 25000, 10, 1, 1, 0x39, 0x999999}, {
- 26000, 11, 1, 1, 0x37, 0x627627}, {
- 30000, 12, 1, 1, 0x30, 0x0}, {
- 37400, 13, 2, 1, 0x4D, 0x15E76}, {
- 38400, 13, 2, 1, 0x4B, 0x0}, {
- 40000, 14, 2, 1, 0x48, 0x0}, {
- 48000, 15, 2, 1, 0x3c, 0x0}, {
- 0, 0, 0, 0, 0, 0}
-};
-
-static const pmu1_xtaltab0_t pmu1_xtaltab0_960[] = {
- {
- 12000, 1, 1, 1, 0x50, 0x0}, {
- 13000, 2, 1, 1, 0x49, 0xD89D89}, {
- 14400, 3, 1, 1, 0x42, 0xAAAAAA}, {
- 15360, 4, 1, 1, 0x3E, 0x800000}, {
- 16200, 5, 1, 1, 0x39, 0x425ED0}, {
- 16800, 6, 1, 1, 0x39, 0x249249}, {
- 19200, 7, 1, 1, 0x32, 0x0}, {
- 19800, 8, 1, 1, 0x30, 0x7C1F07}, {
- 20000, 9, 1, 1, 0x30, 0x0}, {
- 25000, 10, 1, 1, 0x26, 0x666666}, {
- 26000, 11, 1, 1, 0x24, 0xEC4EC4}, {
- 30000, 12, 1, 1, 0x20, 0x0}, {
- 37400, 13, 2, 1, 0x33, 0x563EF9}, {
- 38400, 14, 2, 1, 0x32, 0x0}, {
- 40000, 15, 2, 1, 0x30, 0x0}, {
- 48000, 16, 2, 1, 0x28, 0x0}, {
- 0, 0, 0, 0, 0, 0}
-};
-
-static const pmu1_xtaltab0_t pmu1_xtaltab0_880_4329[] = {
- {
- 12000, 1, 3, 22, 0x9, 0xFFFFEF}, {
- 13000, 2, 1, 6, 0xb, 0x483483}, {
- 14400, 3, 1, 10, 0xa, 0x1C71C7}, {
- 15360, 4, 1, 5, 0xb, 0x755555}, {
- 16200, 5, 1, 10, 0x5, 0x6E9E06}, {
- 16800, 6, 1, 10, 0x5, 0x3Cf3Cf}, {
- 19200, 7, 1, 4, 0xb, 0x755555}, {
- 19800, 8, 1, 11, 0x4, 0xA57EB}, {
- 20000, 9, 1, 11, 0x4, 0x0}, {
- 24000, 10, 3, 11, 0xa, 0x0}, {
- 25000, 11, 5, 16, 0xb, 0x0}, {
- 26000, 12, 1, 1, 0x21, 0xD89D89}, {
- 30000, 13, 3, 8, 0xb, 0x0}, {
- 37400, 14, 3, 1, 0x46, 0x969696}, {
- 38400, 15, 1, 1, 0x16, 0xEAAAAA}, {
- 40000, 16, 1, 2, 0xb, 0}, {
- 0, 0, 0, 0, 0, 0}
-};
-
-/* the following table is based on 880Mhz fvco */
-static const pmu1_xtaltab0_t pmu1_xtaltab0_880[] = {
- {
- 12000, 1, 3, 22, 0x9, 0xFFFFEF}, {
- 13000, 2, 1, 6, 0xb, 0x483483}, {
- 14400, 3, 1, 10, 0xa, 0x1C71C7}, {
- 15360, 4, 1, 5, 0xb, 0x755555}, {
- 16200, 5, 1, 10, 0x5, 0x6E9E06}, {
- 16800, 6, 1, 10, 0x5, 0x3Cf3Cf}, {
- 19200, 7, 1, 4, 0xb, 0x755555}, {
- 19800, 8, 1, 11, 0x4, 0xA57EB}, {
- 20000, 9, 1, 11, 0x4, 0x0}, {
- 24000, 10, 3, 11, 0xa, 0x0}, {
- 25000, 11, 5, 16, 0xb, 0x0}, {
- 26000, 12, 1, 2, 0x10, 0xEC4EC4}, {
- 30000, 13, 3, 8, 0xb, 0x0}, {
- 33600, 14, 1, 2, 0xd, 0x186186}, {
- 38400, 15, 1, 2, 0xb, 0x755555}, {
- 40000, 16, 1, 2, 0xb, 0}, {
- 0, 0, 0, 0, 0, 0}
-};
-
-/* true if the power topology uses the buck boost to provide 3.3V to VDDIO_RF and WLAN PA */
-static bool si_pmu_res_depfltr_bb(struct si_pub *sih)
-{
- return (sih->boardflags & BFL_BUCKBOOST) != 0;
-}
-
-/* true if the power topology doesn't use the cbuck. Key on chiprev also if the chip is BCM4325. */
-static bool si_pmu_res_depfltr_ncb(struct si_pub *sih)
-{
-
- return (sih->boardflags & BFL_NOCBUCK) != 0;
-}
-
-/* true if the power topology uses the PALDO */
-static bool si_pmu_res_depfltr_paldo(struct si_pub *sih)
-{
- return (sih->boardflags & BFL_PALDO) != 0;
-}
-
-/* true if the power topology doesn't use the PALDO */
-static bool si_pmu_res_depfltr_npaldo(struct si_pub *sih)
-{
- return (sih->boardflags & BFL_PALDO) == 0;
-}
-
-/* Return dependancies (direct or all/indirect) for the given resources */
-static u32
-si_pmu_res_deps(struct si_pub *sih, chipcregs_t *cc, u32 rsrcs,
- bool all)
-{
- u32 deps = 0;
- u32 i;
-
- for (i = 0; i <= PMURES_MAX_RESNUM; i++) {
- if (!(rsrcs & PMURES_BIT(i)))
- continue;
- W_REG(&cc->res_table_sel, i);
- deps |= R_REG(&cc->res_dep_mask);
- }
-
- return !all ? deps : (deps
- ? (deps |
- si_pmu_res_deps(sih, cc, deps,
- true)) : 0);
-}
-
/* Determine min/max rsrc masks. Value 0 leaves hardware at default. */
static void si_pmu_res_masks(struct si_pub *sih, u32 * pmin, u32 * pmax)
{
u32 min_mask = 0, max_mask = 0;
uint rsrcs;
- char *val;
/* # resources */
rsrcs = (sih->pmucaps & PCAP_RC_MASK) >> PCAP_RC_SHIFT;
@@ -1030,52 +609,9 @@ static void si_pmu_res_masks(struct si_pub *sih, u32 * pmin, u32 * pmax)
switch (sih->chip) {
case BCM43224_CHIP_ID:
case BCM43225_CHIP_ID:
- case BCM43421_CHIP_ID:
- case BCM43235_CHIP_ID:
- case BCM43236_CHIP_ID:
- case BCM43238_CHIP_ID:
- case BCM4331_CHIP_ID:
- case BCM6362_CHIP_ID:
/* ??? */
break;
- case BCM4329_CHIP_ID:
- /* 4329 spedific issue. Needs to come back this issue later */
- /* Down to save the power. */
- min_mask =
- PMURES_BIT(RES4329_CBUCK_LPOM) |
- PMURES_BIT(RES4329_CLDO_PU);
- /* Allow (but don't require) PLL to turn on */
- max_mask = 0x3ff63e;
- break;
- case BCM4319_CHIP_ID:
- /* We only need a few resources to be kept on all the time */
- min_mask = PMURES_BIT(RES4319_CBUCK_LPOM) |
- PMURES_BIT(RES4319_CLDO_PU);
-
- /* Allow everything else to be turned on upon requests */
- max_mask = ~(~0 << rsrcs);
- break;
- case BCM4336_CHIP_ID:
- /* Down to save the power. */
- min_mask =
- PMURES_BIT(RES4336_CBUCK_LPOM) | PMURES_BIT(RES4336_CLDO_PU)
- | PMURES_BIT(RES4336_LDO3P3_PU) | PMURES_BIT(RES4336_OTP_PU)
- | PMURES_BIT(RES4336_DIS_INT_RESET_PD);
- /* Allow (but don't require) PLL to turn on */
- max_mask = 0x1ffffff;
- break;
-
- case BCM4330_CHIP_ID:
- /* Down to save the power. */
- min_mask =
- PMURES_BIT(RES4330_CBUCK_LPOM) | PMURES_BIT(RES4330_CLDO_PU)
- | PMURES_BIT(RES4330_DIS_INT_RESET_PD) |
- PMURES_BIT(RES4330_LDO3P3_PU) | PMURES_BIT(RES4330_OTP_PU);
- /* Allow (but don't require) PLL to turn on */
- max_mask = 0xfffffff;
- break;
-
case BCM4313_CHIP_ID:
min_mask = PMURES_BIT(RES4313_BB_PU_RSRC) |
PMURES_BIT(RES4313_XTAL_PU_RSRC) |
@@ -1087,122 +623,18 @@ static void si_pmu_res_masks(struct si_pub *sih, u32 * pmin, u32 * pmax)
break;
}
- /* Apply nvram override to min mask */
- val = getvar(NULL, "rmin");
- if (val != NULL) {
- min_mask = (u32) simple_strtoul(val, NULL, 0);
- }
- /* Apply nvram override to max mask */
- val = getvar(NULL, "rmax");
- if (val != NULL) {
- max_mask = (u32) simple_strtoul(val, NULL, 0);
- }
-
*pmin = min_mask;
*pmax = max_mask;
}
-/* Return up time in ILP cycles for the given resource. */
-static uint
-si_pmu_res_uptime(struct si_pub *sih, chipcregs_t *cc, u8 rsrc) {
- u32 deps;
- uint up, i, dup, dmax;
- u32 min_mask = 0, max_mask = 0;
-
- /* uptime of resource 'rsrc' */
- W_REG(&cc->res_table_sel, rsrc);
- up = (R_REG(&cc->res_updn_timer) >> 8) & 0xff;
-
- /* direct dependancies of resource 'rsrc' */
- deps = si_pmu_res_deps(sih, cc, PMURES_BIT(rsrc), false);
- for (i = 0; i <= PMURES_MAX_RESNUM; i++) {
- if (!(deps & PMURES_BIT(i)))
- continue;
- deps &= ~si_pmu_res_deps(sih, cc, PMURES_BIT(i), true);
- }
- si_pmu_res_masks(sih, &min_mask, &max_mask);
- deps &= ~min_mask;
-
- /* max uptime of direct dependancies */
- dmax = 0;
- for (i = 0; i <= PMURES_MAX_RESNUM; i++) {
- if (!(deps & PMURES_BIT(i)))
- continue;
- dup = si_pmu_res_uptime(sih, cc, (u8) i);
- if (dmax < dup)
- dmax = dup;
- }
-
- return up + dmax + PMURES_UP_TRANSITION;
-}
-
static void
si_pmu_spuravoid_pllupdate(struct si_pub *sih, chipcregs_t *cc, u8 spuravoid)
{
u32 tmp = 0;
- u8 phypll_offset = 0;
- u8 bcm5357_bcm43236_p1div[] = { 0x1, 0x5, 0x5 };
- u8 bcm5357_bcm43236_ndiv[] = { 0x30, 0xf6, 0xfc };
switch (sih->chip) {
- case BCM5357_CHIP_ID:
- case BCM43235_CHIP_ID:
- case BCM43236_CHIP_ID:
- case BCM43238_CHIP_ID:
-
- /*
- * BCM5357 needs to touch PLL1_PLLCTL[02],
- * so offset PLL0_PLLCTL[02] by 6
- */
- phypll_offset = (sih->chip == BCM5357_CHIP_ID) ? 6 : 0;
-
- /* RMW only the P1 divider */
- W_REG(&cc->pllcontrol_addr,
- PMU1_PLL0_PLLCTL0 + phypll_offset);
- tmp = R_REG(&cc->pllcontrol_data);
- tmp &= (~(PMU1_PLL0_PC0_P1DIV_MASK));
- tmp |=
- (bcm5357_bcm43236_p1div[spuravoid] <<
- PMU1_PLL0_PC0_P1DIV_SHIFT);
- W_REG(&cc->pllcontrol_data, tmp);
-
- /* RMW only the int feedback divider */
- W_REG(&cc->pllcontrol_addr,
- PMU1_PLL0_PLLCTL2 + phypll_offset);
- tmp = R_REG(&cc->pllcontrol_data);
- tmp &= ~(PMU1_PLL0_PC2_NDIV_INT_MASK);
- tmp |=
- (bcm5357_bcm43236_ndiv[spuravoid]) <<
- PMU1_PLL0_PC2_NDIV_INT_SHIFT;
- W_REG(&cc->pllcontrol_data, tmp);
-
- tmp = 1 << 10;
- break;
-
- case BCM4331_CHIP_ID:
- if (spuravoid == 2) {
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL0);
- W_REG(&cc->pllcontrol_data, 0x11500014);
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL2);
- W_REG(&cc->pllcontrol_data, 0x0FC00a08);
- } else if (spuravoid == 1) {
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL0);
- W_REG(&cc->pllcontrol_data, 0x11500014);
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL2);
- W_REG(&cc->pllcontrol_data, 0x0F600a08);
- } else {
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL0);
- W_REG(&cc->pllcontrol_data, 0x11100014);
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL2);
- W_REG(&cc->pllcontrol_data, 0x03000a08);
- }
- tmp = 1 << 10;
- break;
-
case BCM43224_CHIP_ID:
case BCM43225_CHIP_ID:
- case BCM43421_CHIP_ID:
- case BCM6362_CHIP_ID:
if (spuravoid == 1) {
W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL0);
W_REG(&cc->pllcontrol_data, 0x11500010);
@@ -1249,84 +681,6 @@ si_pmu_spuravoid_pllupdate(struct si_pub *sih, chipcregs_t *cc, u8 spuravoid)
tmp = 1 << 10;
break;
- case BCM4716_CHIP_ID:
- case BCM4748_CHIP_ID:
- case BCM47162_CHIP_ID:
- if (spuravoid == 1) {
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL0);
- W_REG(&cc->pllcontrol_data, 0x11500060);
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL1);
- W_REG(&cc->pllcontrol_data, 0x080C0C06);
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL2);
- W_REG(&cc->pllcontrol_data, 0x0F600000);
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL3);
- W_REG(&cc->pllcontrol_data, 0x00000000);
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL4);
- W_REG(&cc->pllcontrol_data, 0x2001E924);
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL5);
- W_REG(&cc->pllcontrol_data, 0x88888815);
- } else {
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL0);
- W_REG(&cc->pllcontrol_data, 0x11100060);
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL1);
- W_REG(&cc->pllcontrol_data, 0x080c0c06);
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL2);
- W_REG(&cc->pllcontrol_data, 0x03000000);
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL3);
- W_REG(&cc->pllcontrol_data, 0x00000000);
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL4);
- W_REG(&cc->pllcontrol_data, 0x200005c0);
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL5);
- W_REG(&cc->pllcontrol_data, 0x88888815);
- }
-
- tmp = 3 << 9;
- break;
-
- case BCM4319_CHIP_ID:
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL0);
- W_REG(&cc->pllcontrol_data, 0x11100070);
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL1);
- W_REG(&cc->pllcontrol_data, 0x1014140a);
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL5);
- W_REG(&cc->pllcontrol_data, 0x88888854);
-
- if (spuravoid == 1) {
- /* spur_avoid ON, so enable 41/82/164Mhz clock mode */
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL2);
- W_REG(&cc->pllcontrol_data, 0x05201828);
- } else {
- /* enable 40/80/160Mhz clock mode */
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL2);
- W_REG(&cc->pllcontrol_data, 0x05001828);
- }
- break;
- case BCM4336_CHIP_ID:
- /* Looks like these are only for default xtal freq 26MHz */
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL0);
- W_REG(&cc->pllcontrol_data, 0x02100020);
-
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL1);
- W_REG(&cc->pllcontrol_data, 0x0C0C0C0C);
-
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL2);
- W_REG(&cc->pllcontrol_data, 0x01240C0C);
-
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL4);
- W_REG(&cc->pllcontrol_data, 0x202C2820);
-
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL5);
- W_REG(&cc->pllcontrol_data, 0x88888825);
-
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL3);
- if (spuravoid == 1)
- W_REG(&cc->pllcontrol_data, 0x00EC4EC4);
- else
- W_REG(&cc->pllcontrol_data, 0x00762762);
-
- tmp = PCTL_PLL_PLLCTL_UPD;
- break;
-
default:
/* bail out */
return;
@@ -1336,346 +690,6 @@ si_pmu_spuravoid_pllupdate(struct si_pub *sih, chipcregs_t *cc, u8 spuravoid)
W_REG(&cc->pmucontrol, tmp);
}
-/* select default xtal frequency for each chip */
-static const pmu1_xtaltab0_t *si_pmu1_xtaldef0(struct si_pub *sih)
-{
- switch (sih->chip) {
- case BCM4329_CHIP_ID:
- /* Default to 38400Khz */
- return &pmu1_xtaltab0_880_4329[PMU1_XTALTAB0_880_38400K];
- case BCM4319_CHIP_ID:
- /* Default to 30000Khz */
- return &pmu1_xtaltab0_1440[PMU1_XTALTAB0_1440_30000K];
- case BCM4336_CHIP_ID:
- /* Default to 26000Khz */
- return &pmu1_xtaltab0_960[PMU1_XTALTAB0_960_26000K];
- case BCM4330_CHIP_ID:
- /* Default to 37400Khz */
- if (CST4330_CHIPMODE_SDIOD(sih->chipst))
- return &pmu1_xtaltab0_960[PMU1_XTALTAB0_960_37400K];
- else
- return &pmu1_xtaltab0_1440[PMU1_XTALTAB0_1440_37400K];
- default:
- break;
- }
- return NULL;
-}
-
-/* select xtal table for each chip */
-static const pmu1_xtaltab0_t *si_pmu1_xtaltab0(struct si_pub *sih)
-{
- switch (sih->chip) {
- case BCM4329_CHIP_ID:
- return pmu1_xtaltab0_880_4329;
- case BCM4319_CHIP_ID:
- return pmu1_xtaltab0_1440;
- case BCM4336_CHIP_ID:
- return pmu1_xtaltab0_960;
- case BCM4330_CHIP_ID:
- if (CST4330_CHIPMODE_SDIOD(sih->chipst))
- return pmu1_xtaltab0_960;
- else
- return pmu1_xtaltab0_1440;
- default:
- break;
- }
- return NULL;
-}
-
-/* query alp/xtal clock frequency */
-static u32
-si_pmu1_alpclk0(struct si_pub *sih, chipcregs_t *cc)
-{
- const pmu1_xtaltab0_t *xt;
- u32 xf;
-
- /* Find the frequency in the table */
- xf = (R_REG(&cc->pmucontrol) & PCTL_XTALFREQ_MASK) >>
- PCTL_XTALFREQ_SHIFT;
- for (xt = si_pmu1_xtaltab0(sih); xt != NULL && xt->fref != 0; xt++)
- if (xt->xf == xf)
- break;
- /* Could not find it so assign a default value */
- if (xt == NULL || xt->fref == 0)
- xt = si_pmu1_xtaldef0(sih);
- return xt->fref * 1000;
-}
-
-/* select default pll fvco for each chip */
-static u32 si_pmu1_pllfvco0(struct si_pub *sih)
-{
- switch (sih->chip) {
- case BCM4329_CHIP_ID:
- return FVCO_880;
- case BCM4319_CHIP_ID:
- return FVCO_1440;
- case BCM4336_CHIP_ID:
- return FVCO_960;
- case BCM4330_CHIP_ID:
- if (CST4330_CHIPMODE_SDIOD(sih->chipst))
- return FVCO_960;
- else
- return FVCO_1440;
- default:
- break;
- }
- return 0;
-}
-
-static void si_pmu_set_4330_plldivs(struct si_pub *sih)
-{
- u32 FVCO = si_pmu1_pllfvco0(sih) / 1000;
- u32 m1div, m2div, m3div, m4div, m5div, m6div;
- u32 pllc1, pllc2;
-
- m2div = m3div = m4div = m6div = FVCO / 80;
- m5div = FVCO / 160;
-
- if (CST4330_CHIPMODE_SDIOD(sih->chipst))
- m1div = FVCO / 80;
- else
- m1div = FVCO / 90;
- pllc1 =
- (m1div << PMU1_PLL0_PC1_M1DIV_SHIFT) | (m2div <<
- PMU1_PLL0_PC1_M2DIV_SHIFT) |
- (m3div << PMU1_PLL0_PC1_M3DIV_SHIFT) | (m4div <<
- PMU1_PLL0_PC1_M4DIV_SHIFT);
- si_pmu_pllcontrol(sih, PMU1_PLL0_PLLCTL1, ~0, pllc1);
-
- pllc2 = si_pmu_pllcontrol(sih, PMU1_PLL0_PLLCTL1, 0, 0);
- pllc2 &= ~(PMU1_PLL0_PC2_M5DIV_MASK | PMU1_PLL0_PC2_M6DIV_MASK);
- pllc2 |=
- ((m5div << PMU1_PLL0_PC2_M5DIV_SHIFT) |
- (m6div << PMU1_PLL0_PC2_M6DIV_SHIFT));
- si_pmu_pllcontrol(sih, PMU1_PLL0_PLLCTL2, ~0, pllc2);
-}
-
-/* Set up PLL registers in the PMU as per the crystal speed.
- * XtalFreq field in pmucontrol register being 0 indicates the PLL
- * is not programmed and the h/w default is assumed to work, in which
- * case the xtal frequency is unknown to the s/w so we need to call
- * si_pmu1_xtaldef0() wherever it is needed to return a default value.
- */
-static void si_pmu1_pllinit0(struct si_pub *sih, chipcregs_t *cc, u32 xtal)
-{
- const pmu1_xtaltab0_t *xt;
- u32 tmp;
- u32 buf_strength = 0;
- u8 ndiv_mode = 1;
-
- /* Use h/w default PLL config */
- if (xtal == 0) {
- return;
- }
-
- /* Find the frequency in the table */
- for (xt = si_pmu1_xtaltab0(sih); xt != NULL && xt->fref != 0; xt++)
- if (xt->fref == xtal)
- break;
-
- /* Check current PLL state, bail out if it has been programmed or
- * we don't know how to program it.
- */
- if (xt == NULL || xt->fref == 0) {
- return;
- }
- /* for 4319 bootloader already programs the PLL but bootloader does not
- * program the PLL4 and PLL5. So Skip this check for 4319
- */
- if ((((R_REG(&cc->pmucontrol) & PCTL_XTALFREQ_MASK) >>
- PCTL_XTALFREQ_SHIFT) == xt->xf) &&
- !((sih->chip == BCM4319_CHIP_ID)
- || (sih->chip == BCM4330_CHIP_ID)))
- return;
-
- switch (sih->chip) {
- case BCM4329_CHIP_ID:
- /* Change the BBPLL drive strength to 8 for all channels */
- buf_strength = 0x888888;
- AND_REG(&cc->min_res_mask,
- ~(PMURES_BIT(RES4329_BBPLL_PWRSW_PU) |
- PMURES_BIT(RES4329_HT_AVAIL)));
- AND_REG(&cc->max_res_mask,
- ~(PMURES_BIT(RES4329_BBPLL_PWRSW_PU) |
- PMURES_BIT(RES4329_HT_AVAIL)));
- SPINWAIT(R_REG(&cc->clk_ctl_st) & CCS_HTAVAIL,
- PMU_MAX_TRANSITION_DLY);
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL4);
- if (xt->fref == 38400)
- tmp = 0x200024C0;
- else if (xt->fref == 37400)
- tmp = 0x20004500;
- else if (xt->fref == 26000)
- tmp = 0x200024C0;
- else
- tmp = 0x200005C0; /* Chip Dflt Settings */
- W_REG(&cc->pllcontrol_data, tmp);
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL5);
- tmp =
- R_REG(&cc->pllcontrol_data) & PMU1_PLL0_PC5_CLK_DRV_MASK;
- if ((xt->fref == 38400) || (xt->fref == 37400)
- || (xt->fref == 26000))
- tmp |= 0x15;
- else
- tmp |= 0x25; /* Chip Dflt Settings */
- W_REG(&cc->pllcontrol_data, tmp);
- break;
-
- case BCM4319_CHIP_ID:
- /* Change the BBPLL drive strength to 2 for all channels */
- buf_strength = 0x222222;
-
- /* Make sure the PLL is off */
- /* WAR65104: Disable the HT_AVAIL resource first and then
- * after a delay (more than downtime for HT_AVAIL) remove the
- * BBPLL resource; backplane clock moves to ALP from HT.
- */
- AND_REG(&cc->min_res_mask,
- ~(PMURES_BIT(RES4319_HT_AVAIL)));
- AND_REG(&cc->max_res_mask,
- ~(PMURES_BIT(RES4319_HT_AVAIL)));
-
- udelay(100);
- AND_REG(&cc->min_res_mask,
- ~(PMURES_BIT(RES4319_BBPLL_PWRSW_PU)));
- AND_REG(&cc->max_res_mask,
- ~(PMURES_BIT(RES4319_BBPLL_PWRSW_PU)));
-
- udelay(100);
- SPINWAIT(R_REG(&cc->clk_ctl_st) & CCS_HTAVAIL,
- PMU_MAX_TRANSITION_DLY);
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL4);
- tmp = 0x200005c0;
- W_REG(&cc->pllcontrol_data, tmp);
- break;
-
- case BCM4336_CHIP_ID:
- AND_REG(&cc->min_res_mask,
- ~(PMURES_BIT(RES4336_HT_AVAIL) |
- PMURES_BIT(RES4336_MACPHY_CLKAVAIL)));
- AND_REG(&cc->max_res_mask,
- ~(PMURES_BIT(RES4336_HT_AVAIL) |
- PMURES_BIT(RES4336_MACPHY_CLKAVAIL)));
- udelay(100);
- SPINWAIT(R_REG(&cc->clk_ctl_st) & CCS_HTAVAIL,
- PMU_MAX_TRANSITION_DLY);
- break;
-
- case BCM4330_CHIP_ID:
- AND_REG(&cc->min_res_mask,
- ~(PMURES_BIT(RES4330_HT_AVAIL) |
- PMURES_BIT(RES4330_MACPHY_CLKAVAIL)));
- AND_REG(&cc->max_res_mask,
- ~(PMURES_BIT(RES4330_HT_AVAIL) |
- PMURES_BIT(RES4330_MACPHY_CLKAVAIL)));
- udelay(100);
- SPINWAIT(R_REG(&cc->clk_ctl_st) & CCS_HTAVAIL,
- PMU_MAX_TRANSITION_DLY);
- break;
-
- default:
- break;
- }
-
- /* Write p1div and p2div to pllcontrol[0] */
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL0);
- tmp = R_REG(&cc->pllcontrol_data) &
- ~(PMU1_PLL0_PC0_P1DIV_MASK | PMU1_PLL0_PC0_P2DIV_MASK);
- tmp |=
- ((xt->
- p1div << PMU1_PLL0_PC0_P1DIV_SHIFT) & PMU1_PLL0_PC0_P1DIV_MASK) |
- ((xt->
- p2div << PMU1_PLL0_PC0_P2DIV_SHIFT) & PMU1_PLL0_PC0_P2DIV_MASK);
- W_REG(&cc->pllcontrol_data, tmp);
-
- if ((sih->chip == BCM4330_CHIP_ID))
- si_pmu_set_4330_plldivs(sih);
-
- if ((sih->chip == BCM4329_CHIP_ID)
- && (sih->chiprev == 0)) {
-
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL1);
- tmp = R_REG(&cc->pllcontrol_data);
- tmp = tmp & (~DOT11MAC_880MHZ_CLK_DIVISOR_MASK);
- tmp = tmp | DOT11MAC_880MHZ_CLK_DIVISOR_VAL;
- W_REG(&cc->pllcontrol_data, tmp);
- }
- if ((sih->chip == BCM4319_CHIP_ID) ||
- (sih->chip == BCM4336_CHIP_ID) ||
- (sih->chip == BCM4330_CHIP_ID))
- ndiv_mode = PMU1_PLL0_PC2_NDIV_MODE_MFB;
- else
- ndiv_mode = PMU1_PLL0_PC2_NDIV_MODE_MASH;
-
- /* Write ndiv_int and ndiv_mode to pllcontrol[2] */
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL2);
- tmp = R_REG(&cc->pllcontrol_data) &
- ~(PMU1_PLL0_PC2_NDIV_INT_MASK | PMU1_PLL0_PC2_NDIV_MODE_MASK);
- tmp |=
- ((xt->
- ndiv_int << PMU1_PLL0_PC2_NDIV_INT_SHIFT) &
- PMU1_PLL0_PC2_NDIV_INT_MASK) | ((ndiv_mode <<
- PMU1_PLL0_PC2_NDIV_MODE_SHIFT) &
- PMU1_PLL0_PC2_NDIV_MODE_MASK);
- W_REG(&cc->pllcontrol_data, tmp);
-
- /* Write ndiv_frac to pllcontrol[3] */
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL3);
- tmp = R_REG(&cc->pllcontrol_data) & ~PMU1_PLL0_PC3_NDIV_FRAC_MASK;
- tmp |= ((xt->ndiv_frac << PMU1_PLL0_PC3_NDIV_FRAC_SHIFT) &
- PMU1_PLL0_PC3_NDIV_FRAC_MASK);
- W_REG(&cc->pllcontrol_data, tmp);
-
- /* Write clock driving strength to pllcontrol[5] */
- if (buf_strength) {
- W_REG(&cc->pllcontrol_addr, PMU1_PLL0_PLLCTL5);
- tmp =
- R_REG(&cc->pllcontrol_data) & ~PMU1_PLL0_PC5_CLK_DRV_MASK;
- tmp |= (buf_strength << PMU1_PLL0_PC5_CLK_DRV_SHIFT);
- W_REG(&cc->pllcontrol_data, tmp);
- }
-
- /* to operate the 4319 usb in 24MHz/48MHz; chipcontrol[2][84:83] needs
- * to be updated.
- */
- if ((sih->chip == BCM4319_CHIP_ID)
- && (xt->fref != XTAL_FREQ_30000MHZ)) {
- W_REG(&cc->chipcontrol_addr, PMU1_PLL0_CHIPCTL2);
- tmp =
- R_REG(&cc->chipcontrol_data) & ~CCTL_4319USB_XTAL_SEL_MASK;
- if (xt->fref == XTAL_FREQ_24000MHZ) {
- tmp |=
- (CCTL_4319USB_24MHZ_PLL_SEL <<
- CCTL_4319USB_XTAL_SEL_SHIFT);
- } else if (xt->fref == XTAL_FREQ_48000MHZ) {
- tmp |=
- (CCTL_4319USB_48MHZ_PLL_SEL <<
- CCTL_4319USB_XTAL_SEL_SHIFT);
- }
- W_REG(&cc->chipcontrol_data, tmp);
- }
-
- /* Flush deferred pll control registers writes */
- if (sih->pmurev >= 2)
- OR_REG(&cc->pmucontrol, PCTL_PLL_PLLCTL_UPD);
-
- /* Write XtalFreq. Set the divisor also. */
- tmp = R_REG(&cc->pmucontrol) &
- ~(PCTL_ILP_DIV_MASK | PCTL_XTALFREQ_MASK);
- tmp |= (((((xt->fref + 127) / 128) - 1) << PCTL_ILP_DIV_SHIFT) &
- PCTL_ILP_DIV_MASK) |
- ((xt->xf << PCTL_XTALFREQ_SHIFT) & PCTL_XTALFREQ_MASK);
-
- if ((sih->chip == BCM4329_CHIP_ID)
- && sih->chiprev == 0) {
- /* clear the htstretch before clearing HTReqEn */
- AND_REG(&cc->clkstretch, ~CSTRETCH_HT);
- tmp &= ~PCTL_HT_REQ_EN;
- }
-
- W_REG(&cc->pmucontrol, tmp);
-}
-
u32 si_pmu_ilp_clock(struct si_pub *sih)
{
static u32 ilpcycles_per_sec;
@@ -1698,65 +712,9 @@ u32 si_pmu_ilp_clock(struct si_pub *sih)
return ilpcycles_per_sec;
}
-void si_pmu_set_ldo_voltage(struct si_pub *sih, u8 ldo, u8 voltage)
-{
- u8 sr_cntl_shift = 0, rc_shift = 0, shift = 0, mask = 0;
- u8 addr = 0;
-
- switch (sih->chip) {
- case BCM4336_CHIP_ID:
- switch (ldo) {
- case SET_LDO_VOLTAGE_CLDO_PWM:
- addr = 4;
- rc_shift = 1;
- mask = 0xf;
- break;
- case SET_LDO_VOLTAGE_CLDO_BURST:
- addr = 4;
- rc_shift = 5;
- mask = 0xf;
- break;
- case SET_LDO_VOLTAGE_LNLDO1:
- addr = 4;
- rc_shift = 17;
- mask = 0xf;
- break;
- default:
- return;
- }
- break;
- case BCM4330_CHIP_ID:
- switch (ldo) {
- case SET_LDO_VOLTAGE_CBUCK_PWM:
- addr = 3;
- rc_shift = 0;
- mask = 0x1f;
- break;
- default:
- return;
- }
- break;
- default:
- return;
- }
-
- shift = sr_cntl_shift + rc_shift;
-
- ai_corereg(sih, SI_CC_IDX, offsetof(chipcregs_t, regcontrol_addr),
- ~0, addr);
- ai_corereg(sih, SI_CC_IDX, offsetof(chipcregs_t, regcontrol_data),
- mask << shift, (voltage & mask) << shift);
-}
-
u16 si_pmu_fast_pwrup_delay(struct si_pub *sih)
{
uint delay = PMU_MAX_TRANSITION_DLY;
- chipcregs_t *cc;
- uint origidx;
-#ifdef BCMDBG
- char chn[8];
- chn[0] = 0; /* to suppress compile error */
-#endif
/* Remember original core before switch to chipc */
origidx = ai_coreidx(sih);
@@ -1765,54 +723,9 @@ u16 si_pmu_fast_pwrup_delay(struct si_pub *sih)
switch (sih->chip) {
case BCM43224_CHIP_ID:
case BCM43225_CHIP_ID:
- case BCM43421_CHIP_ID:
- case BCM43235_CHIP_ID:
- case BCM43236_CHIP_ID:
- case BCM43238_CHIP_ID:
- case BCM4331_CHIP_ID:
- case BCM6362_CHIP_ID:
case BCM4313_CHIP_ID:
delay = ISSIM_ENAB(sih) ? 70 : 3700;
break;
- case BCM4329_CHIP_ID:
- if (ISSIM_ENAB(sih))
- delay = 70;
- else {
- u32 ilp = si_pmu_ilp_clock(sih);
- delay =
- (si_pmu_res_uptime(sih, cc, RES4329_HT_AVAIL) +
- D11SCC_SLOW2FAST_TRANSITION) * ((1000000 + ilp -
- 1) / ilp);
- delay = (11 * delay) / 10;
- }
- break;
- case BCM4319_CHIP_ID:
- delay = ISSIM_ENAB(sih) ? 70 : 3700;
- break;
- case BCM4336_CHIP_ID:
- if (ISSIM_ENAB(sih))
- delay = 70;
- else {
- u32 ilp = si_pmu_ilp_clock(sih);
- delay =
- (si_pmu_res_uptime(sih, cc, RES4336_HT_AVAIL) +
- D11SCC_SLOW2FAST_TRANSITION) * ((1000000 + ilp -
- 1) / ilp);
- delay = (11 * delay) / 10;
- }
- break;
- case BCM4330_CHIP_ID:
- if (ISSIM_ENAB(sih))
- delay = 70;
- else {
- u32 ilp = si_pmu_ilp_clock(sih);
- delay =
- (si_pmu_res_uptime(sih, cc, RES4330_HT_AVAIL) +
- D11SCC_SLOW2FAST_TRANSITION) * ((1000000 + ilp -
- 1) / ilp);
- delay = (11 * delay) / 10;
- }
- break;
default:
break;
}
@@ -1872,52 +785,23 @@ void si_pmu_pllupd(struct si_pub *sih)
/* query alp/xtal clock frequency */
u32 si_pmu_alp_clock(struct si_pub *sih)
{
- chipcregs_t *cc;
- uint origidx;
u32 clock = ALP_CLOCK;
/* bail out with default */
if (!PMUCTL_ENAB(sih))
return clock;
- /* Remember original core before switch to chipc */
- origidx = ai_coreidx(sih);
- cc = ai_setcoreidx(sih, SI_CC_IDX);
-
switch (sih->chip) {
case BCM43224_CHIP_ID:
case BCM43225_CHIP_ID:
- case BCM43421_CHIP_ID:
- case BCM43235_CHIP_ID:
- case BCM43236_CHIP_ID:
- case BCM43238_CHIP_ID:
- case BCM4331_CHIP_ID:
- case BCM6362_CHIP_ID:
- case BCM4716_CHIP_ID:
- case BCM4748_CHIP_ID:
- case BCM47162_CHIP_ID:
case BCM4313_CHIP_ID:
- case BCM5357_CHIP_ID:
/* always 20Mhz */
clock = 20000 * 1000;
break;
- case BCM4329_CHIP_ID:
- case BCM4319_CHIP_ID:
- case BCM4336_CHIP_ID:
- case BCM4330_CHIP_ID:
-
- clock = si_pmu1_alpclk0(sih, cc);
- break;
- case BCM5356_CHIP_ID:
- /* always 25Mhz */
- clock = 25000 * 1000;
- break;
default:
break;
}
- /* Return to original core */
- ai_setcoreidx(sih, origidx);
return clock;
}
@@ -1925,32 +809,14 @@ void si_pmu_spuravoid(struct si_pub *sih, u8 spuravoid)
{
chipcregs_t *cc;
uint origidx, intr_val;
- u32 tmp = 0;
/* Remember original core before switch to chipc */
cc = (chipcregs_t *) ai_switch_core(sih, CC_CORE_ID, &origidx,
&intr_val);
- /* force the HT off */
- if (sih->chip == BCM4336_CHIP_ID) {
- tmp = R_REG(&cc->max_res_mask);
- tmp &= ~RES4336_HT_AVAIL;
- W_REG(&cc->max_res_mask, tmp);
- /* wait for the ht to really go away */
- SPINWAIT(((R_REG(&cc->clk_ctl_st) & CCS_HTAVAIL) == 0),
- 10000);
- }
-
/* update the pll changes */
si_pmu_spuravoid_pllupdate(sih, cc, spuravoid);
- /* enable HT back on */
- if (sih->chip == BCM4336_CHIP_ID) {
- tmp = R_REG(&cc->max_res_mask);
- tmp |= RES4336_HT_AVAIL;
- W_REG(&cc->max_res_mask, tmp);
- }
-
/* Return to original core */
ai_restore_core(sih, origidx, intr_val);
}
@@ -1970,15 +836,6 @@ void si_pmu_init(struct si_pub *sih)
else if (sih->pmurev >= 2)
OR_REG(&cc->pmucontrol, PCTL_NOILP_ON_WAIT);
- if ((sih->chip == BCM4329_CHIP_ID) && (sih->chiprev == 2)) {
- /* Fix for 4329b0 bad LPOM state. */
- W_REG(&cc->regcontrol_addr, 2);
- OR_REG(&cc->regcontrol_data, 0x100);
-
- W_REG(&cc->regcontrol_addr, 3);
- OR_REG(&cc->regcontrol_data, 0x4);
- }
-
/* Return to original core */
ai_setcoreidx(sih, origidx);
}
@@ -2001,26 +858,6 @@ void si_pmu_chip_init(struct si_pub *sih)
/* initialize PMU switch/regulators */
void si_pmu_swreg_init(struct si_pub *sih)
{
- switch (sih->chip) {
- case BCM4336_CHIP_ID:
- /* Reduce CLDO PWM output voltage to 1.2V */
- si_pmu_set_ldo_voltage(sih, SET_LDO_VOLTAGE_CLDO_PWM, 0xe);
- /* Reduce CLDO BURST output voltage to 1.2V */
- si_pmu_set_ldo_voltage(sih, SET_LDO_VOLTAGE_CLDO_BURST,
- 0xe);
- /* Reduce LNLDO1 output voltage to 1.2V */
- si_pmu_set_ldo_voltage(sih, SET_LDO_VOLTAGE_LNLDO1, 0xe);
- if (sih->chiprev == 0)
- si_pmu_regcontrol(sih, 2, 0x400000, 0x400000);
- break;
-
- case BCM4330_CHIP_ID:
- /* CBUCK Voltage is 1.8 by default and set that to 1.5 */
- si_pmu_set_ldo_voltage(sih, SET_LDO_VOLTAGE_CBUCK_PWM, 0);
- break;
- default:
- break;
- }
}
/* initialize PLL */
@@ -2034,27 +871,11 @@ void si_pmu_pll_init(struct si_pub *sih, uint xtalfreq)
cc = ai_setcoreidx(sih, SI_CC_IDX);
switch (sih->chip) {
- case BCM4329_CHIP_ID:
- if (xtalfreq == 0)
- xtalfreq = 38400;
- si_pmu1_pllinit0(sih, cc, xtalfreq);
- break;
case BCM4313_CHIP_ID:
case BCM43224_CHIP_ID:
case BCM43225_CHIP_ID:
- case BCM43421_CHIP_ID:
- case BCM43235_CHIP_ID:
- case BCM43236_CHIP_ID:
- case BCM43238_CHIP_ID:
- case BCM4331_CHIP_ID:
- case BCM6362_CHIP_ID:
/* ??? */
break;
- case BCM4319_CHIP_ID:
- case BCM4336_CHIP_ID:
- case BCM4330_CHIP_ID:
- si_pmu1_pllinit0(sih, cc, xtalfreq);
- break;
default:
break;
}
@@ -2068,151 +889,12 @@ void si_pmu_res_init(struct si_pub *sih)
{
chipcregs_t *cc;
uint origidx;
- const pmu_res_updown_t *pmu_res_updown_table = NULL;
- uint pmu_res_updown_table_sz = 0;
- const pmu_res_depend_t *pmu_res_depend_table = NULL;
- uint pmu_res_depend_table_sz = 0;
u32 min_mask = 0, max_mask = 0;
- char name[8], *val;
- uint i, rsrcs;
/* Remember original core before switch to chipc */
origidx = ai_coreidx(sih);
cc = ai_setcoreidx(sih, SI_CC_IDX);
- switch (sih->chip) {
- case BCM4329_CHIP_ID:
- /* Optimize resources up/down timers */
- if (ISSIM_ENAB(sih)) {
- pmu_res_updown_table = NULL;
- pmu_res_updown_table_sz = 0;
- } else {
- pmu_res_updown_table = bcm4329_res_updown;
- pmu_res_updown_table_sz =
- ARRAY_SIZE(bcm4329_res_updown);
- }
- /* Optimize resources dependencies */
- pmu_res_depend_table = bcm4329_res_depend;
- pmu_res_depend_table_sz = ARRAY_SIZE(bcm4329_res_depend);
- break;
-
- case BCM4319_CHIP_ID:
- /* Optimize resources up/down timers */
- if (ISSIM_ENAB(sih)) {
- pmu_res_updown_table = bcm4319a0_res_updown_qt;
- pmu_res_updown_table_sz =
- ARRAY_SIZE(bcm4319a0_res_updown_qt);
- } else {
- pmu_res_updown_table = bcm4319a0_res_updown;
- pmu_res_updown_table_sz =
- ARRAY_SIZE(bcm4319a0_res_updown);
- }
- /* Optimize resources dependancies masks */
- pmu_res_depend_table = bcm4319a0_res_depend;
- pmu_res_depend_table_sz = ARRAY_SIZE(bcm4319a0_res_depend);
- break;
-
- case BCM4336_CHIP_ID:
- /* Optimize resources up/down timers */
- if (ISSIM_ENAB(sih)) {
- pmu_res_updown_table = bcm4336a0_res_updown_qt;
- pmu_res_updown_table_sz =
- ARRAY_SIZE(bcm4336a0_res_updown_qt);
- } else {
- pmu_res_updown_table = bcm4336a0_res_updown;
- pmu_res_updown_table_sz =
- ARRAY_SIZE(bcm4336a0_res_updown);
- }
- /* Optimize resources dependancies masks */
- pmu_res_depend_table = bcm4336a0_res_depend;
- pmu_res_depend_table_sz = ARRAY_SIZE(bcm4336a0_res_depend);
- break;
-
- case BCM4330_CHIP_ID:
- /* Optimize resources up/down timers */
- if (ISSIM_ENAB(sih)) {
- pmu_res_updown_table = bcm4330a0_res_updown_qt;
- pmu_res_updown_table_sz =
- ARRAY_SIZE(bcm4330a0_res_updown_qt);
- } else {
- pmu_res_updown_table = bcm4330a0_res_updown;
- pmu_res_updown_table_sz =
- ARRAY_SIZE(bcm4330a0_res_updown);
- }
- /* Optimize resources dependancies masks */
- pmu_res_depend_table = bcm4330a0_res_depend;
- pmu_res_depend_table_sz = ARRAY_SIZE(bcm4330a0_res_depend);
- break;
-
- default:
- break;
- }
-
- /* # resources */
- rsrcs = (sih->pmucaps & PCAP_RC_MASK) >> PCAP_RC_SHIFT;
-
- /* Program up/down timers */
- while (pmu_res_updown_table_sz--) {
- W_REG(&cc->res_table_sel,
- pmu_res_updown_table[pmu_res_updown_table_sz].resnum);
- W_REG(&cc->res_updn_timer,
- pmu_res_updown_table[pmu_res_updown_table_sz].updown);
- }
- /* Apply nvram overrides to up/down timers */
- for (i = 0; i < rsrcs; i++) {
- snprintf(name, sizeof(name), "r%dt", i);
- val = getvar(NULL, name);
- if (val == NULL)
- continue;
- W_REG(&cc->res_table_sel, (u32) i);
- W_REG(&cc->res_updn_timer,
- (u32) simple_strtoul(val, NULL, 0));
- }
-
- /* Program resource dependencies table */
- while (pmu_res_depend_table_sz--) {
- if (pmu_res_depend_table[pmu_res_depend_table_sz].filter != NULL
- && !(pmu_res_depend_table[pmu_res_depend_table_sz].
- filter) (sih))
- continue;
- for (i = 0; i < rsrcs; i++) {
- if ((pmu_res_depend_table[pmu_res_depend_table_sz].
- res_mask & PMURES_BIT(i)) == 0)
- continue;
- W_REG(&cc->res_table_sel, i);
- switch (pmu_res_depend_table[pmu_res_depend_table_sz].
- action) {
- case RES_DEPEND_SET:
- W_REG(&cc->res_dep_mask,
- pmu_res_depend_table
- [pmu_res_depend_table_sz].depend_mask);
- break;
- case RES_DEPEND_ADD:
- OR_REG(&cc->res_dep_mask,
- pmu_res_depend_table
- [pmu_res_depend_table_sz].depend_mask);
- break;
- case RES_DEPEND_REMOVE:
- AND_REG(&cc->res_dep_mask,
- ~pmu_res_depend_table
- [pmu_res_depend_table_sz].depend_mask);
- break;
- default:
- break;
- }
- }
- }
- /* Apply nvram overrides to dependancies masks */
- for (i = 0; i < rsrcs; i++) {
- snprintf(name, sizeof(name), "r%dd", i);
- val = getvar(NULL, name);
- if (val == NULL)
- continue;
- W_REG(&cc->res_table_sel, (u32) i);
- W_REG(&cc->res_dep_mask,
- (u32) simple_strtoul(val, NULL, 0));
- }
-
/* Determine min/max rsrc masks */
si_pmu_res_masks(sih, &min_mask, &max_mask);
@@ -2287,109 +969,3 @@ u32 si_pmu_measure_alpclk(struct si_pub *sih)
return alp_khz;
}
-
-bool si_pmu_is_otp_powered(struct si_pub *sih)
-{
- uint idx;
- chipcregs_t *cc;
- bool st;
-
- /* Remember original core before switch to chipc */
- idx = ai_coreidx(sih);
- cc = ai_setcoreidx(sih, SI_CC_IDX);
-
- switch (sih->chip) {
- case BCM4329_CHIP_ID:
- st = (R_REG(&cc->res_state) & PMURES_BIT(RES4329_OTP_PU))
- != 0;
- break;
- case BCM4319_CHIP_ID:
- st = (R_REG(&cc->res_state) & PMURES_BIT(RES4319_OTP_PU))
- != 0;
- break;
- case BCM4336_CHIP_ID:
- st = (R_REG(&cc->res_state) & PMURES_BIT(RES4336_OTP_PU))
- != 0;
- break;
- case BCM4330_CHIP_ID:
- st = (R_REG(&cc->res_state) & PMURES_BIT(RES4330_OTP_PU))
- != 0;
- break;
-
- /* These chip doesn't use PMU bit to power up/down OTP. OTP always on.
- * Use OTP_INIT command to reset/refresh state.
- */
- case BCM43224_CHIP_ID:
- case BCM43225_CHIP_ID:
- case BCM43421_CHIP_ID:
- case BCM43236_CHIP_ID:
- case BCM43235_CHIP_ID:
- case BCM43238_CHIP_ID:
- st = true;
- break;
- default:
- st = true;
- break;
- }
-
- /* Return to original core */
- ai_setcoreidx(sih, idx);
- return st;
-}
-
-/* power up/down OTP through PMU resources */
-void si_pmu_otp_power(struct si_pub *sih, bool on)
-{
- chipcregs_t *cc;
- uint origidx;
- u32 rsrcs = 0; /* rsrcs to turn on/off OTP power */
-
- /* Don't do anything if OTP is disabled */
- if (ai_is_otp_disabled(sih))
- return;
-
- /* Remember original core before switch to chipc */
- origidx = ai_coreidx(sih);
- cc = ai_setcoreidx(sih, SI_CC_IDX);
-
- switch (sih->chip) {
- case BCM4329_CHIP_ID:
- rsrcs = PMURES_BIT(RES4329_OTP_PU);
- break;
- case BCM4319_CHIP_ID:
- rsrcs = PMURES_BIT(RES4319_OTP_PU);
- break;
- case BCM4336_CHIP_ID:
- rsrcs = PMURES_BIT(RES4336_OTP_PU);
- break;
- case BCM4330_CHIP_ID:
- rsrcs = PMURES_BIT(RES4330_OTP_PU);
- break;
- default:
- break;
- }
-
- if (rsrcs != 0) {
- u32 otps;
-
- /* Figure out the dependancies (exclude min_res_mask) */
- u32 deps = si_pmu_res_deps(sih, cc, rsrcs, true);
- u32 min_mask = 0, max_mask = 0;
- si_pmu_res_masks(sih, &min_mask, &max_mask);
- deps &= ~min_mask;
- /* Turn on/off the power */
- if (on) {
- OR_REG(&cc->min_res_mask, (rsrcs | deps));
- SPINWAIT(!(R_REG(&cc->res_state) & rsrcs),
- PMU_MAX_TRANSITION_DLY);
- } else {
- AND_REG(&cc->min_res_mask, ~(rsrcs | deps));
- }
-
- SPINWAIT((((otps = R_REG(&cc->otpstatus)) & OTPS_READY) !=
- (on ? OTPS_READY : 0)), 100);
- }
-
- /* Return to original core */
- ai_setcoreidx(sih, origidx);
-}
diff --git a/drivers/staging/brcm80211/brcmsmac/pmu.h b/drivers/staging/brcm80211/brcmsmac/pmu.h
index 9a98890..0c7e48c 100644
--- a/drivers/staging/brcm80211/brcmsmac/pmu.h
+++ b/drivers/staging/brcm80211/brcmsmac/pmu.h
@@ -33,7 +33,6 @@
#define SET_LDO_VOLTAGE_LNLDO1 9
#define SET_LDO_VOLTAGE_LNLDO2_SEL 10
-extern void si_pmu_set_ldo_voltage(struct si_pub *sih, u8 ldo, u8 voltage);
extern u16 si_pmu_fast_pwrup_delay(struct si_pub *sih);
extern void si_pmu_sprom_enable(struct si_pub *sih, bool enable);
extern u32 si_pmu_chipcontrol(struct si_pub *sih, uint reg, u32 mask, u32 val);
@@ -49,7 +48,5 @@ extern void si_pmu_pll_init(struct si_pub *sih, u32 xtalfreq);
extern void si_pmu_res_init(struct si_pub *sih);
extern void si_pmu_swreg_init(struct si_pub *sih);
extern u32 si_pmu_measure_alpclk(struct si_pub *sih);
-extern bool si_pmu_is_otp_powered(struct si_pub *sih);
-extern void si_pmu_otp_power(struct si_pub *sih, bool on);
#endif /* _BRCM_PMU_H_ */
--
1.7.1
From: Arend van Spriel <[email protected]>
couple of items needed renaming to more consistent naming convention.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/Makefile | 4 +-
drivers/staging/brcm80211/brcmfmac/dhd.h | 8 +-
drivers/staging/brcm80211/brcmfmac/dhd_bus.h | 8 ++
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 10 +--
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 20 +---
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 10 +-
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 110 ++++++++++------------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 9 +-
8 files changed, 80 insertions(+), 99 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/Makefile b/drivers/staging/brcm80211/brcmfmac/Makefile
index 9fa689b..07b9340 100644
--- a/drivers/staging/brcm80211/brcmfmac/Makefile
+++ b/drivers/staging/brcm80211/brcmfmac/Makefile
@@ -21,9 +21,9 @@ ccflags-y := \
-DBCMPLATFORM_BUS \
-DBCMSDIO \
-DBRCM_FULLMAC \
- -DDHD_FIRSTREAD=64 \
+ -DBRCMF_FIRSTREAD=64 \
-DDHD_SCHED \
- -DDHD_SDALIGN=64 \
+ -DBRCMF_SDALIGN=64 \
-DEMBEDDED_PLATFORM \
-DMAX_HDR_READ=64 \
-DMMC_SDIO_ABORT \
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index c990a2c..fb88c05 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -725,20 +725,20 @@ typedef struct {
} bcmevent_name_t;
#if defined(CONFIG_PM_SLEEP)
-extern atomic_t dhd_mmc_suspend;
+extern atomic_t brcmf_mmc_suspend;
#define DHD_PM_RESUME_WAIT_INIT(a) DECLARE_WAIT_QUEUE_HEAD(a);
#define _DHD_PM_RESUME_WAIT(a, b) do { \
int retry = 0; \
- while (atomic_read(&dhd_mmc_suspend) && retry++ != b) { \
+ while (atomic_read(&brcmf_mmc_suspend) && retry++ != b) { \
wait_event_timeout(a, false, HZ/100); \
} \
} while (0)
#define DHD_PM_RESUME_WAIT(a) _DHD_PM_RESUME_WAIT(a, 30)
#define DHD_PM_RESUME_WAIT_FOREVER(a) _DHD_PM_RESUME_WAIT(a, ~0)
#define DHD_PM_RESUME_RETURN_ERROR(a) \
- do { if (atomic_read(&dhd_mmc_suspend)) return a; } while (0)
+ do { if (atomic_read(&brcmf_mmc_suspend)) return a; } while (0)
#define DHD_PM_RESUME_RETURN do { \
- if (atomic_read(&dhd_mmc_suspend)) \
+ if (atomic_read(&brcmf_mmc_suspend)) \
return; \
} while (0)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
index 128a00d..73b72ff 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
@@ -17,6 +17,14 @@
#ifndef _dhd_bus_h_
#define _dhd_bus_h_
+/* Packet alignment for most efficient SDIO (can change based on platform) */
+#ifndef BRCMF_SDALIGN
+#define BRCMF_SDALIGN 32
+#endif
+#if !ISPOWEROF2(BRCMF_SDALIGN)
+#error BRCMF_SDALIGN is not a power of 2!
+#endif
+
/*
* Exported from dhd bus module (dhd_usb, dhd_sdio)
*/
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index c544cbf..594c217 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -84,16 +84,8 @@ struct brcmf_proto_bdc_header {
int wifi_get_mac_addr(unsigned char *buf);
#endif
-/* Packet alignment for most efficient SDIO (can change based on platform) */
-#ifndef DHD_SDALIGN
-#define DHD_SDALIGN 32
-#endif
-#if !ISPOWEROF2(DHD_SDALIGN)
-#error DHD_SDALIGN is not a power of 2!
-#endif
-
#define RETRIES 2 /* # of retries to retrieve matching ioctl response */
-#define BUS_HEADER_LEN (16+DHD_SDALIGN) /* Must be atleast SDPCM_RESERVE
+#define BUS_HEADER_LEN (16+BRCMF_SDALIGN) /* Must be atleast SDPCM_RESERVE
* defined in dhd_sdio.c
* (amount of header tha might be added)
* plus any space that might be needed
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index a255d3d..deb8566 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -27,22 +27,15 @@
#include "dhd_proto.h"
#include "dhd_dbg.h"
-#define BRCM_OUI "\x00\x10\x18"
+#define BRCM_OUI "\x00\x10\x18"
#define DOT11_OUI_LEN 3
-#define BCMILCP_BCM_SUBTYPE_EVENT 1
+#define BCMILCP_BCM_SUBTYPE_EVENT 1
+#define PKTFILTER_BUF_SIZE 2048
int brcmf_msg_level;
char brcmf_fw_path[MOD_PARAM_PATHLEN];
char brcmf_nv_path[MOD_PARAM_PATHLEN];
-/* Packet alignment for most efficient SDIO (can change based on platform) */
-#ifndef DHD_SDALIGN
-#define DHD_SDALIGN 32
-#endif
-#if !ISPOWEROF2(DHD_SDALIGN)
-#error DHD_SDALIGN is not a power of 2!
-#endif
-
#define EPI_VERSION_STR "4.218.248.5"
#define MSGTRACE_VERSION 1
@@ -1028,7 +1021,6 @@ void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg)
char *argv[8], *buf = 0;
int i = 0;
char *arg_save = 0, *arg_org = 0;
-#define BUF_SIZE 2048
arg_save = kmalloc(strlen(arg) + 1, GFP_ATOMIC);
if (!arg_save) {
@@ -1038,7 +1030,7 @@ void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg)
arg_org = arg_save;
- buf = kmalloc(BUF_SIZE, GFP_ATOMIC);
+ buf = kmalloc(PKTFILTER_BUF_SIZE, GFP_ATOMIC);
if (!buf) {
DHD_ERROR(("%s: kmalloc failed\n", __func__));
goto fail;
@@ -1046,7 +1038,7 @@ void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg)
memcpy(arg_save, arg, strlen(arg) + 1);
- if (strlen(arg) > BUF_SIZE) {
+ if (strlen(arg) > PKTFILTER_BUF_SIZE) {
DHD_ERROR(("Not enough buffer %d < %d\n", (int)strlen(arg),
(int)sizeof(buf)));
goto fail;
@@ -1193,7 +1185,7 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
uint up = 0;
char buf[128], *ptr;
uint power_mode = PM_FAST;
- u32 dongle_align = DHD_SDALIGN;
+ u32 dongle_align = BRCMF_SDALIGN;
u32 glom = 0;
uint bcn_timeout = 3;
int scan_assoc_time = 40;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 5aa4492..9ee4866 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -173,7 +173,7 @@ void wifi_del_dev(void)
#if defined(CONFIG_PM_SLEEP)
#include <linux/suspend.h>
-atomic_t dhd_mmc_suspend;
+atomic_t brcmf_mmc_suspend;
DECLARE_WAIT_QUEUE_HEAD(dhd_dpc_wait);
#endif /* defined(CONFIG_PM_SLEEP) */
@@ -1910,7 +1910,7 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
g_bus = bus;
#endif
#if defined(CONFIG_PM_SLEEP)
- atomic_set(&dhd_mmc_suspend, false);
+ atomic_set(&brcmf_mmc_suspend, false);
#endif /* defined(CONFIG_PM_SLEEP) */
/* && defined(DHD_GPL) */
/* Init lock suspend to prevent kernel going to suspend */
@@ -2055,7 +2055,7 @@ int brcmf_iovar(dhd_pub_t *pub, int ifidx, char *name, char *cmd_buf,
return ret;
}
-static struct net_device_ops dhd_ops_pri = {
+static struct net_device_ops brcmf_netdev_ops_pri = {
.ndo_open = brcmf_netdev_open,
.ndo_stop = brcmf_netdev_stop,
.ndo_get_stats = brcmf_netdev_get_stats,
@@ -2080,7 +2080,7 @@ int brcmf_net_attach(dhd_pub_t *dhdp, int ifidx)
ASSERT(net);
ASSERT(!net->netdev_ops);
- net->netdev_ops = &dhd_ops_pri;
+ net->netdev_ops = &brcmf_netdev_ops_pri;
/*
* We have to use the primary MAC for virtual interfaces
@@ -2168,7 +2168,7 @@ void brcmf_detach(dhd_pub_t *dhdp)
ifp = dhd->iflist[0];
ASSERT(ifp);
- if (ifp->net->netdev_ops == &dhd_ops_pri) {
+ if (ifp->net->netdev_ops == &brcmf_netdev_ops_pri) {
brcmf_netdev_stop(ifp->net);
unregister_netdev(ifp->net);
}
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index e8cc8d5..2b1762e 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -202,27 +202,19 @@ struct rte_console {
#define MAX_DATA_BUF (32 * 1024) /* Must be large enough to hold
biggest possible glom */
-/* Packet alignment for most efficient SDIO (can change based on platform) */
-#ifndef DHD_SDALIGN
-#define DHD_SDALIGN 32
+#ifndef BRCMF_FIRSTREAD
+#define BRCMF_FIRSTREAD 32
#endif
-#if !ISPOWEROF2(DHD_SDALIGN)
-#error DHD_SDALIGN is not a power of 2!
-#endif
-
-#ifndef DHD_FIRSTREAD
-#define DHD_FIRSTREAD 32
-#endif
-#if !ISPOWEROF2(DHD_FIRSTREAD)
-#error DHD_FIRSTREAD is not a power of 2!
+#if !ISPOWEROF2(BRCMF_FIRSTREAD)
+#error BRCMF_FIRSTREAD is not a power of 2!
#endif
/* Total length of frame header for dongle protocol */
#define SDPCM_HDRLEN (SDPCM_FRAMETAG_LEN + SDPCM_SWHEADER_LEN)
#ifdef SDTEST
-#define SDPCM_RESERVE (SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + DHD_SDALIGN)
+#define SDPCM_RESERVE (SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + BRCMF_SDALIGN)
#else
-#define SDPCM_RESERVE (SDPCM_HDRLEN + DHD_SDALIGN)
+#define SDPCM_RESERVE (SDPCM_HDRLEN + BRCMF_SDALIGN)
#endif
/*
@@ -492,7 +484,7 @@ typedef struct dhd_bus {
u8 tx_seq; /* Transmit sequence number (next) */
u8 tx_max; /* Maximum transmit sequence allowed */
- u8 hdrbuf[MAX_HDR_READ + DHD_SDALIGN];
+ u8 hdrbuf[MAX_HDR_READ + BRCMF_SDALIGN];
u8 *rxhdr; /* Header of current rx frame (in hdrbuf) */
u16 nextlen; /* Next Read Len from last header */
u8 rx_seq; /* Receive sequence number (expected) */
@@ -669,7 +661,7 @@ static bool retrydata;
#define RETRYCHAN(chan) (((chan) == SDPCM_EVENT_CHANNEL) || retrydata)
static const uint watermark = 8;
-static const uint firstread = DHD_FIRSTREAD;
+static const uint firstread = BRCMF_FIRSTREAD;
#define HDATLEN (firstread - (SDPCM_HDRLEN))
@@ -1193,22 +1185,22 @@ static int brcmf_sdbrcm_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
frame = (u8 *) (pkt->data);
/* Add alignment padding, allocate new packet if needed */
- pad = ((unsigned long)frame % DHD_SDALIGN);
+ pad = ((unsigned long)frame % BRCMF_SDALIGN);
if (pad) {
if (skb_headroom(pkt) < pad) {
DHD_INFO(("%s: insufficient headroom %d for %d pad\n",
__func__, skb_headroom(pkt), pad));
bus->dhd->tx_realloc++;
- new = brcmu_pkt_buf_get_skb(pkt->len + DHD_SDALIGN);
+ new = brcmu_pkt_buf_get_skb(pkt->len + BRCMF_SDALIGN);
if (!new) {
DHD_ERROR(("%s: couldn't allocate new %d-byte "
"packet\n",
- __func__, pkt->len + DHD_SDALIGN));
+ __func__, pkt->len + BRCMF_SDALIGN));
ret = -ENOMEM;
goto done;
}
- PKTALIGN(new, pkt->len, DHD_SDALIGN);
+ PKTALIGN(new, pkt->len, BRCMF_SDALIGN);
memcpy(new->data, pkt->data, pkt->len);
if (free_pkt)
brcmu_pkt_buf_free_skb(pkt);
@@ -1216,7 +1208,7 @@ static int brcmf_sdbrcm_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
free_pkt = true;
pkt = new;
frame = (u8 *) (pkt->data);
- ASSERT(((unsigned long)frame % DHD_SDALIGN) == 0);
+ ASSERT(((unsigned long)frame % BRCMF_SDALIGN) == 0);
pad = 0;
} else {
skb_push(pkt, pad);
@@ -1226,7 +1218,7 @@ static int brcmf_sdbrcm_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
memset(frame, 0, pad + SDPCM_HDRLEN);
}
}
- ASSERT(pad < DHD_SDALIGN);
+ ASSERT(pad < BRCMF_SDALIGN);
/* Hardware tag: 2 byte len followed by 2 byte ~len check (all LE) */
len = (u16) (pkt->len);
@@ -1264,8 +1256,8 @@ static int brcmf_sdbrcm_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
if (pad <= skb_tailroom(pkt))
#endif /* NOTUSED */
len += pad;
- } else if (len % DHD_SDALIGN) {
- len += DHD_SDALIGN - (len % DHD_SDALIGN);
+ } else if (len % BRCMF_SDALIGN) {
+ len += BRCMF_SDALIGN - (len % BRCMF_SDALIGN);
}
/* Some controllers have trouble with odd bytes -- round to even */
@@ -1512,14 +1504,14 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
/* Add alignment padding (optional for ctl frames) */
if (dhd_alignctl) {
- doff = ((unsigned long)frame % DHD_SDALIGN);
+ doff = ((unsigned long)frame % BRCMF_SDALIGN);
if (doff) {
frame -= doff;
len += doff;
msglen += doff;
memset(frame, 0, doff + SDPCM_HDRLEN);
}
- ASSERT(doff < DHD_SDALIGN);
+ ASSERT(doff < BRCMF_SDALIGN);
}
doff += SDPCM_HDRLEN;
@@ -1528,8 +1520,8 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
u16 pad = bus->blocksize - (len % bus->blocksize);
if ((pad <= bus->roundup) && (pad < bus->blocksize))
len += pad;
- } else if (len % DHD_SDALIGN) {
- len += DHD_SDALIGN - (len % DHD_SDALIGN);
+ } else if (len % BRCMF_SDALIGN) {
+ len += BRCMF_SDALIGN - (len % BRCMF_SDALIGN);
}
/* Satisfy length-alignment requirements */
@@ -2592,7 +2584,7 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
break;
case IOV_GVAL(IOV_SDALIGN):
- int_val = DHD_SDALIGN;
+ int_val = BRCMF_SDALIGN;
memcpy(arg, &int_val, val_size);
break;
@@ -3279,9 +3271,9 @@ brcmf_sdbrcm_read_control(dhd_bus_t *bus, u8 *hdr, uint len, uint doff)
bus->rxctl = bus->rxbuf;
if (dhd_alignctl) {
bus->rxctl += firstread;
- pad = ((unsigned long)bus->rxctl % DHD_SDALIGN);
+ pad = ((unsigned long)bus->rxctl % BRCMF_SDALIGN);
if (pad)
- bus->rxctl += (DHD_SDALIGN - pad);
+ bus->rxctl += (BRCMF_SDALIGN - pad);
bus->rxctl -= firstread;
}
ASSERT(bus->rxctl >= bus->rxbuf);
@@ -3304,8 +3296,8 @@ brcmf_sdbrcm_read_control(dhd_bus_t *bus, u8 *hdr, uint len, uint doff)
if ((pad <= bus->roundup) && (pad < bus->blocksize) &&
((len + pad) < bus->dhd->maxctl))
rdlen += pad;
- } else if (rdlen % DHD_SDALIGN) {
- rdlen += DHD_SDALIGN - (rdlen % DHD_SDALIGN);
+ } else if (rdlen % BRCMF_SDALIGN) {
+ rdlen += BRCMF_SDALIGN - (rdlen % BRCMF_SDALIGN);
}
/* Satisfy length-alignment requirements */
@@ -3410,9 +3402,9 @@ static u8 brcmf_sdbrcm_rxglom(dhd_bus_t *bus, u8 rxseq)
pnext = NULL;
break;
}
- if (sublen % DHD_SDALIGN) {
+ if (sublen % BRCMF_SDALIGN) {
DHD_ERROR(("%s: sublen %d not multiple of %d\n",
- __func__, sublen, DHD_SDALIGN));
+ __func__, sublen, BRCMF_SDALIGN));
usechain = false;
}
totlen += sublen;
@@ -3426,7 +3418,7 @@ static u8 brcmf_sdbrcm_rxglom(dhd_bus_t *bus, u8 rxseq)
}
/* Allocate/chain packet for next subframe */
- pnext = brcmu_pkt_buf_get_skb(sublen + DHD_SDALIGN);
+ pnext = brcmu_pkt_buf_get_skb(sublen + BRCMF_SDALIGN);
if (pnext == NULL) {
DHD_ERROR(("%s: bcm_pkt_buf_get_skb failed, "
"num %d len %d\n", __func__,
@@ -3444,7 +3436,7 @@ static u8 brcmf_sdbrcm_rxglom(dhd_bus_t *bus, u8 rxseq)
}
/* Adhere to start alignment requirements */
- PKTALIGN(pnext, sublen, DHD_SDALIGN);
+ PKTALIGN(pnext, sublen, BRCMF_SDALIGN);
}
/* If all allocations succeeded, save packet chain
@@ -3846,9 +3838,9 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
&& ((rdlen + pad + firstread) <
MAX_RX_DATASZ))
rdlen += pad;
- } else if (rdlen % DHD_SDALIGN) {
+ } else if (rdlen % BRCMF_SDALIGN) {
rdlen +=
- DHD_SDALIGN - (rdlen % DHD_SDALIGN);
+ BRCMF_SDALIGN - (rdlen % BRCMF_SDALIGN);
}
}
@@ -3863,7 +3855,7 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
* or non-data frame.
*/
/* Allocate a packet buffer */
- pkt = brcmu_pkt_buf_get_skb(rdlen + DHD_SDALIGN);
+ pkt = brcmu_pkt_buf_get_skb(rdlen + BRCMF_SDALIGN);
if (!pkt) {
if (bus->bus == SPI_BUS) {
bus->usebufpool = false;
@@ -3871,10 +3863,10 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
if (dhd_alignctl) {
bus->rxctl += firstread;
pad = ((unsigned long)bus->rxctl %
- DHD_SDALIGN);
+ BRCMF_SDALIGN);
if (pad)
bus->rxctl +=
- (DHD_SDALIGN - pad);
+ (BRCMF_SDALIGN - pad);
bus->rxctl -= firstread;
}
ASSERT(bus->rxctl >= bus->rxbuf);
@@ -3918,7 +3910,7 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
bus->usebufpool = true;
ASSERT(!(pkt->prev));
- PKTALIGN(pkt, rdlen, DHD_SDALIGN);
+ PKTALIGN(pkt, rdlen, BRCMF_SDALIGN);
rxbuf = (u8 *) (pkt->data);
/* Read the entire frame */
sdret = brcmf_sdcard_recv_buf(sdh,
@@ -4225,8 +4217,8 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
if ((pad <= bus->roundup) && (pad < bus->blocksize) &&
((rdlen + pad + firstread) < MAX_RX_DATASZ))
rdlen += pad;
- } else if (rdlen % DHD_SDALIGN) {
- rdlen += DHD_SDALIGN - (rdlen % DHD_SDALIGN);
+ } else if (rdlen % BRCMF_SDALIGN) {
+ rdlen += BRCMF_SDALIGN - (rdlen % BRCMF_SDALIGN);
}
/* Satisfy length-alignment requirements */
@@ -4243,7 +4235,7 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
continue;
}
- pkt = brcmu_pkt_buf_get_skb(rdlen + firstread + DHD_SDALIGN);
+ pkt = brcmu_pkt_buf_get_skb(rdlen + firstread + BRCMF_SDALIGN);
if (!pkt) {
/* Give up on data, request rtx of events */
DHD_ERROR(("%s: brcmu_pkt_buf_get_skb failed: rdlen %d"
@@ -4258,7 +4250,7 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
/* Leave room for what we already read, and align remainder */
ASSERT(firstread < pkt->len);
skb_pull(pkt, firstread);
- PKTALIGN(pkt, rdlen, DHD_SDALIGN);
+ PKTALIGN(pkt, rdlen, BRCMF_SDALIGN);
/* Read the remaining frame data */
sdret = brcmf_sdcard_recv_buf(sdh, brcmf_sdcard_cur_sbwad(sdh),
@@ -4809,7 +4801,7 @@ static void brcmf_sdbrcm_pktgen(dhd_bus_t *bus)
/* Allocate an appropriate-sized packet */
len = bus->pktgen_len;
pkt = brcmu_pkt_buf_get_skb(
- (len + SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + DHD_SDALIGN),
+ (len + SDPCM_HDRLEN + SDPCM_TEST_HDRLEN + BRCMF_SDALIGN),
true);
if (!pkt) {
DHD_ERROR(("%s: brcmu_pkt_buf_get_skb failed!\n",
@@ -4817,7 +4809,7 @@ static void brcmf_sdbrcm_pktgen(dhd_bus_t *bus)
break;
}
PKTALIGN(pkt, (len + SDPCM_HDRLEN + SDPCM_TEST_HDRLEN),
- DHD_SDALIGN);
+ BRCMF_SDALIGN);
data = (u8 *) (pkt->data) + SDPCM_HDRLEN;
/* Write test header cmd and extra based on mode */
@@ -4890,12 +4882,12 @@ static void brcmf_sdbrcm_sdtest_set(dhd_bus_t *bus, bool start)
/* Allocate the packet */
pkt = brcmu_pkt_buf_get_skb(SDPCM_HDRLEN + SDPCM_TEST_HDRLEN +
- DHD_SDALIGN, true);
+ BRCMF_SDALIGN, true);
if (!pkt) {
DHD_ERROR(("%s: brcmu_pkt_buf_get_skb failed!\n", __func__));
return;
}
- PKTALIGN(pkt, (SDPCM_HDRLEN + SDPCM_TEST_HDRLEN), DHD_SDALIGN);
+ PKTALIGN(pkt, (SDPCM_HDRLEN + SDPCM_TEST_HDRLEN), BRCMF_SDALIGN);
data = (u8 *) (pkt->data) + SDPCM_HDRLEN;
/* Fill in the test header */
@@ -5417,7 +5409,7 @@ brcmf_sdbrcm_probe_attach(struct dhd_bus *bus, void *sdh, void *regsva,
brcmu_pktq_init(&bus->txq, (PRIOMASK + 1), TXQLEN);
/* Locate an appropriately-aligned portion of hdrbuf */
- bus->rxhdr = (u8 *) roundup((unsigned long)&bus->hdrbuf[0], DHD_SDALIGN);
+ bus->rxhdr = (u8 *) roundup((unsigned long)&bus->hdrbuf[0], BRCMF_SDALIGN);
/* Set the poll and/or interrupt flags */
bus->intr = (bool) brcmf_intr;
@@ -5438,7 +5430,7 @@ static bool brcmf_sdbrcm_probe_malloc(dhd_bus_t *bus, void *sdh)
if (bus->dhd->maxctl) {
bus->rxblen =
roundup((bus->dhd->maxctl + SDPCM_HDRLEN),
- ALIGNMENT) + DHD_SDALIGN;
+ ALIGNMENT) + BRCMF_SDALIGN;
bus->rxbuf = kmalloc(bus->rxblen, GFP_ATOMIC);
if (!(bus->rxbuf)) {
DHD_ERROR(("%s: kmalloc of %d-byte rxbuf failed\n",
@@ -5459,10 +5451,10 @@ static bool brcmf_sdbrcm_probe_malloc(dhd_bus_t *bus, void *sdh)
}
/* Align the buffer */
- if ((unsigned long)bus->databuf % DHD_SDALIGN)
+ if ((unsigned long)bus->databuf % BRCMF_SDALIGN)
bus->dataptr =
- bus->databuf + (DHD_SDALIGN -
- ((unsigned long)bus->databuf % DHD_SDALIGN));
+ bus->databuf + (BRCMF_SDALIGN -
+ ((unsigned long)bus->databuf % BRCMF_SDALIGN));
else
bus->dataptr = bus->databuf;
@@ -5665,15 +5657,15 @@ static int brcmf_sdbrcm_download_code_file(struct dhd_bus *bus, char *fw_path)
if (image == NULL)
goto err;
- memptr = memblock = kmalloc(MEMBLOCK + DHD_SDALIGN, GFP_ATOMIC);
+ memptr = memblock = kmalloc(MEMBLOCK + BRCMF_SDALIGN, GFP_ATOMIC);
if (memblock == NULL) {
DHD_ERROR(("%s: Failed to allocate memory %d bytes\n",
__func__, MEMBLOCK));
goto err;
}
- if ((u32)(unsigned long)memblock % DHD_SDALIGN)
+ if ((u32)(unsigned long)memblock % BRCMF_SDALIGN)
memptr +=
- (DHD_SDALIGN - ((u32)(unsigned long)memblock % DHD_SDALIGN));
+ (BRCMF_SDALIGN - ((u32)(unsigned long)memblock % BRCMF_SDALIGN));
/* Download image */
while ((len =
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index ca45829..086a93b 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -2095,7 +2095,7 @@ static s32 wl_cfg80211_resume(struct wiphy *wiphy)
WL_TRACE("Enter\n");
#if defined(CONFIG_PM_SLEEP)
- atomic_set(&dhd_mmc_suspend, false);
+ atomic_set(&brcmf_mmc_suspend, false);
#endif /* defined(CONFIG_PM_SLEEP) */
if (test_bit(WL_STATUS_READY, &wl->status)) {
@@ -2166,7 +2166,7 @@ static s32 wl_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow)
}
#if defined(CONFIG_PM_SLEEP)
- atomic_set(&dhd_mmc_suspend, true);
+ atomic_set(&brcmf_mmc_suspend, true);
#endif /* defined(CONFIG_PM_SLEEP) */
WL_TRACE("Exit\n");
@@ -4014,9 +4014,6 @@ dongle_scantime_out:
s32 wl_config_dongle(struct wl_priv *wl, bool need_lock)
{
-#ifndef DHD_SDALIGN
-#define DHD_SDALIGN 32
-#endif
struct net_device *ndev;
struct wireless_dev *wdev;
s32 err = 0;
@@ -4039,7 +4036,7 @@ s32 wl_config_dongle(struct wl_priv *wl, bool need_lock)
err = wl_dongle_power(ndev, PM_FAST);
if (unlikely(err))
goto default_conf_out;
- err = wl_dongle_glom(ndev, 0, DHD_SDALIGN);
+ err = wl_dongle_glom(ndev, 0, BRCMF_SDALIGN);
if (unlikely(err))
goto default_conf_out;
--
1.7.1
In fullmac some SDIO configurations should be done in suspend/resume
routine. It was placed under pm ops in wl_cfg80211.c which is
inappropriate. This patchs move them to sdio layer.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h | 3 +
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c | 8 ++++
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 7 ---
.../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c | 42 ++++++++++++++++++++
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 7 ---
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 14 +------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h | 2 -
7 files changed, 55 insertions(+), 28 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
index 05600e0..f1d04e0 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
@@ -111,4 +111,7 @@ extern int brcmf_sdioh_reset(struct sdioh_info *si);
/* Helper function */
void *brcmf_sdcard_get_sdioh(struct brcmf_sdio *sdh);
+/* Watchdog timer interface for pm ops */
+extern void brcmf_sdio_wdtmr_enable(bool enable);
+
#endif /* _sdio_api_h_ */
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
index c4b74ab..d0be99f 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
@@ -218,3 +218,11 @@ module_param(sd_msglevel, uint, 0);
extern uint sd_f2_blocksize;
module_param(sd_f2_blocksize, int, 0);
+
+void brcmf_sdio_wdtmr_enable(bool enable)
+{
+ if (enable)
+ brcmf_os_wd_timer(sdhcinfo->ch, brcmf_watchdog_ms);
+ else
+ brcmf_os_wd_timer(sdhcinfo->ch, 0);
+}
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index c1de2cd..48527bb 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -55,13 +55,6 @@ DHD_PM_RESUME_WAIT_INIT(sdioh_request_buffer_wait);
int brcmf_sdioh_card_regread(struct sdioh_info *sd, int func, u32 regaddr,
int regsize, u32 *data);
-void brcmf_sdioh_set_host_pm_flags(int flag)
-{
- if (sdio_set_host_pm_flags(gInstance->func[1], flag))
- printk(KERN_ERR "%s: Failed to set pm_flags 0x%08x\n",\
- __func__, (unsigned int)flag);
-}
-
static int brcmf_sdioh_enablefuncs(struct sdioh_info *sd)
{
int err_ret;
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
index 6abd9c0..39b0cbe 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
@@ -136,11 +136,53 @@ static const struct sdio_device_id bcmsdh_sdmmc_ids[] = {
MODULE_DEVICE_TABLE(sdio, bcmsdh_sdmmc_ids);
+#ifdef CONFIG_PM
+static int brcmf_sdio_suspend(struct device *dev)
+{
+ mmc_pm_flag_t sdio_flags;
+ int ret = 0;
+
+ sd_trace(("%s\n", __func__));
+
+ sdio_flags = sdio_get_host_pm_caps(gInstance->func[1]);
+ if (!(sdio_flags & MMC_PM_KEEP_POWER)) {
+ sd_err(("Host can't keep power while suspended\n"));
+ return -EINVAL;
+ }
+
+ ret = sdio_set_host_pm_flags(gInstance->func[1], MMC_PM_KEEP_POWER);
+ if (ret) {
+ sd_err(("Failed to set pm_flags\n"));
+ return ret;
+ }
+
+ brcmf_sdio_wdtmr_enable(false);
+
+ return ret;
+}
+
+static int brcmf_sdio_resume(struct device *dev)
+{
+ brcmf_sdio_wdtmr_enable(true);
+ return 0;
+}
+
+static const struct dev_pm_ops brcmf_sdio_pm_ops = {
+ .suspend = brcmf_sdio_suspend,
+ .resume = brcmf_sdio_resume,
+};
+#endif /* CONFIG_PM */
+
static struct sdio_driver bcmsdh_sdmmc_driver = {
.probe = brcmf_ops_sdio_probe,
.remove = brcmf_ops_sdio_remove,
.name = "brcmfmac",
.id_table = bcmsdh_sdmmc_ids,
+#ifdef CONFIG_PM
+ .drv = {
+ .pm = &brcmf_sdio_pm_ops,
+ },
+#endif /* CONFIG_PM */
};
struct sdos_info {
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index c3cbda6..6f351eb 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -2382,13 +2382,6 @@ int brcmf_netdev_wait_pend8021x(struct net_device *dev)
return pend;
}
-void brcmf_netdev_os_wd_timer(struct net_device *ndev, uint wdtick)
-{
- dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(ndev);
-
- brcmf_os_wd_timer(&dhd->pub, wdtick);
-}
-
#ifdef BCMDBG
int brcmf_write_to_file(dhd_pub_t *dhd, u8 *buf, int size)
{
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index 1d80d75..a3c2e87 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -36,8 +36,6 @@
#include "dhd.h"
#include "wl_cfg80211.h"
-void brcmf_sdioh_set_host_pm_flags(int flag);
-
static struct sdio_func *cfg80211_sdio_func;
static struct wl_dev *wl_cfg80211_dev;
static const u8 ether_bcast[ETH_ALEN] = {255, 255, 255, 255, 255, 255};
@@ -2071,7 +2069,6 @@ done:
static s32 wl_cfg80211_resume(struct wiphy *wiphy)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
- struct net_device *ndev = wl_to_ndev(wl);
/*
* Check for WL_STATUS_READY before any function call which
@@ -2084,11 +2081,8 @@ static s32 wl_cfg80211_resume(struct wiphy *wiphy)
atomic_set(&brcmf_mmc_suspend, false);
#endif /* defined(CONFIG_PM_SLEEP) */
- if (test_bit(WL_STATUS_READY, &wl->status)) {
- /* Turn on Watchdog timer */
- brcmf_netdev_os_wd_timer(ndev, brcmf_watchdog_ms);
+ if (test_bit(WL_STATUS_READY, &wl->status))
wl_invoke_iscan(wiphy_to_wl(wiphy));
- }
WL_TRACE("Exit\n");
return 0;
@@ -2141,14 +2135,10 @@ static s32 wl_cfg80211_suspend(struct wiphy *wiphy, struct cfg80211_wowlan *wow)
clear_bit(WL_STATUS_SCANNING, &wl->status);
clear_bit(WL_STATUS_SCAN_ABORTING, &wl->status);
- /* Inform SDIO stack not to switch off power to the chip */
- brcmf_sdioh_set_host_pm_flags(MMC_PM_KEEP_POWER);
-
/* Turn off watchdog timer */
if (test_bit(WL_STATUS_READY, &wl->status)) {
- WL_INFO("Terminate watchdog timer and enable MPC\n");
+ WL_INFO("Enable MPC\n");
wl_set_mpc(ndev, 1);
- brcmf_netdev_os_wd_timer(ndev, 0);
}
#if defined(CONFIG_PM_SLEEP)
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
index 6ad6b5b..bc7b4a3 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
@@ -404,6 +404,4 @@ extern s8 *wl_cfg80211_get_fwname(void); /* get firmware name for
the dongle */
extern s8 *wl_cfg80211_get_nvramname(void); /* get nvram name for
the dongle */
-extern void brcmf_netdev_os_wd_timer(struct net_device *ndev, uint wdtick);
-
#endif /* _wl_cfg80211_h_ */
--
1.7.1
From: Arend van Spriel <[email protected]>
The function initvars_srom_pci() has fallback to obtain drivers settings
from flash when no srom device is present. However, this driver does not
support flash so the fallback code can be removed.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/srom.c | 67 ++++++++---------------------
1 files changed, 18 insertions(+), 49 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/srom.c b/drivers/staging/brcm80211/brcmsmac/srom.c
index 1117f91..5b5306a 100644
--- a/drivers/staging/brcm80211/brcmsmac/srom.c
+++ b/drivers/staging/brcm80211/brcmsmac/srom.c
@@ -1212,14 +1212,10 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
u32 sr;
varbuf_t b;
char *vp, *base = NULL;
- bool flash = false;
int err = 0;
/*
- * Apply CRC over SROM content regardless SROM is present or not,
- * and use variable <devpath>sromrev's existence in flash to decide
- * if we should return an error when CRC fails or read SROM variables
- * from flash.
+ * Apply CRC over SROM content regardless SROM is present or not.
*/
srom = kmalloc(SROM_MAX, GFP_ATOMIC);
if (!srom)
@@ -1265,60 +1261,33 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
err = 1;
#endif
- /*
- * We want internal/wltest driver to come up with default
- * sromvars so we can program a blank SPROM/OTP.
- */
- if (err) {
- char *value;
- u32 val;
- val = 0;
-
- value = ai_getdevpathvar(sih, "sromrev");
- if (value) {
- sromrev = (u8) simple_strtoul(value, NULL, 0);
- flash = true;
- goto varscont;
- }
+ if (!err) {
+ /* Bitmask for the sromrev */
+ sr = 1 << sromrev;
- value = ai_getnvramflvar(sih, "sromrev");
- if (value) {
- err = 0;
+ /* srom version check: Current valid versions: 1, 2, 3, 4, 5, 8, 9 */
+ if ((sr & 0x33e) == 0) {
+ err = -2;
goto errout;
}
- {
- err = -1;
+ base = kmalloc(MAXSZ_NVRAM_VARS, GFP_ATOMIC);
+ if (!base) {
+ err = -2;
goto errout;
}
- }
-
- varscont:
- /* Bitmask for the sromrev */
- sr = 1 << sromrev;
- /* srom version check: Current valid versions: 1, 2, 3, 4, 5, 8, 9 */
- if ((sr & 0x33e) == 0) {
- err = -2;
- goto errout;
- }
-
- base = kmalloc(MAXSZ_NVRAM_VARS, GFP_ATOMIC);
- if (!base) {
- err = -2;
- goto errout;
- }
+ varbuf_init(&b, base, MAXSZ_NVRAM_VARS);
- varbuf_init(&b, base, MAXSZ_NVRAM_VARS);
+ /* parse SROM into name=value pairs. */
+ _initvars_srom_pci(sromrev, srom, 0, &b);
- /* parse SROM into name=value pairs. */
- _initvars_srom_pci(sromrev, srom, 0, &b);
+ /* final nullbyte terminator */
+ vp = b.buf;
+ *vp++ = '\0';
- /* final nullbyte terminator */
- vp = b.buf;
- *vp++ = '\0';
-
- err = initvars_table(base, vp, vars, count);
+ err = initvars_table(base, vp, vars, count);
+ }
errout:
if (base)
--
1.7.1
From: Arend van Spriel <[email protected]>
Several defintions from dhd.h are not used in the fullmac driver
and have been removed.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 112 ------------------------------
1 files changed, 0 insertions(+), 112 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index b2db6b9..2ebf015 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -308,13 +308,6 @@ typedef struct brcmf_event {
#define BRCMF_E_LINK_ASSOC_REC 3
#define BRCMF_E_LINK_BSSCFG_DIS 4
-enum cust_gpio_modes {
- WLAN_RESET_ON,
- WLAN_RESET_OFF,
- WLAN_POWER_ON,
- WLAN_POWER_OFF
-};
-
/* The level of bus communication with the dongle */
enum dhd_bus_state {
DHD_BUS_DOWN, /* Not ready for frame transfers */
@@ -448,20 +441,6 @@ typedef struct wl_scan_results {
wl_bss_info_t bss_info[1];
} wl_scan_results_t;
-typedef struct wl_rateset_args {
- u32 count; /* # rates in this set */
- u8 rates[WL_NUMRATES]; /* rates in 500kbps units w/hi bit set if basic */
- u8 mcs[MCSSET_LEN]; /* supported mcs index bit map */
-} wl_rateset_args_t;
-
-/* u32 list */
-typedef struct wl_u32_list {
- /* in - # of elements, out - # of entries */
- u32 count;
- /* variable length u32 list */
- u32 element[1];
-} wl_u32_list_t;
-
/* used for association with a specific BSSID and chanspec list */
typedef struct wl_assoc_params {
u8 bssid[ETH_ALEN]; /* 00:00:00:00:00:00: broadcast scan */
@@ -472,9 +451,6 @@ typedef struct wl_assoc_params {
} wl_assoc_params_t;
#define WL_ASSOC_PARAMS_FIXED_SIZE (sizeof(wl_assoc_params_t) - sizeof(chanspec_t))
-/* used for reassociation/roam to a specific BSSID and channel */
-typedef wl_assoc_params_t wl_reassoc_params_t;
-
/* used for join with or without a specific bssid and channel list */
typedef struct wl_join_params {
wlc_ssid_t ssid;
@@ -496,94 +472,6 @@ typedef struct wl_iscan_results {
#define WL_ISCAN_RESULTS_FIXED_SIZE \
(WL_SCAN_RESULTS_FIXED_SIZE + offsetof(wl_iscan_results_t, results))
-typedef struct {
- u32 duration; /* millisecs spent sampling this channel */
- u32 congest_ibss; /* millisecs in our bss (presumably this traffic will */
- /* move if cur bss moves channels) */
- u32 congest_obss; /* traffic not in our bss */
- u32 interference; /* millisecs detecting a non 802.11 interferer. */
- u32 timestamp; /* second timestamp */
-} cca_congest_t;
-
-typedef struct {
- chanspec_t chanspec; /* Which channel? */
- u8 num_secs; /* How many secs worth of data */
- cca_congest_t secs[1]; /* Data */
-} cca_congest_channel_req_t;
-
-typedef struct wl_country {
- char country_abbrev[WLC_CNTRY_BUF_SZ]; /* nul-terminated country code used in
- * the Country IE
- */
- s32 rev; /* revision specifier for ccode
- * on set, -1 indicates unspecified.
- * on get, rev >= 0
- */
- char ccode[WLC_CNTRY_BUF_SZ]; /* nul-terminated built-in country code.
- * variable length, but fixed size in
- * struct allows simple allocation for
- * expected country strings <= 3 chars.
- */
-} wl_country_t;
-
-typedef struct wl_channels_in_country {
- u32 buflen;
- u32 band;
- char country_abbrev[WLC_CNTRY_BUF_SZ];
- u32 count;
- u32 channel[1];
-} wl_channels_in_country_t;
-
-typedef struct wl_country_list {
- u32 buflen;
- u32 band_set;
- u32 band;
- u32 count;
- char country_abbrev[1];
-} wl_country_list_t;
-
-typedef struct wl_rm_req_elt {
- s8 type;
- s8 flags;
- chanspec_t chanspec;
- u32 token; /* token for this measurement */
- u32 tsf_h; /* TSF high 32-bits of Measurement start time */
- u32 tsf_l; /* TSF low 32-bits */
- u32 dur; /* TUs */
-} wl_rm_req_elt_t;
-
-typedef struct wl_rm_req {
- u32 token; /* overall measurement set token */
- u32 count; /* number of measurement requests */
- void *cb; /* completion callback function: may be NULL */
- void *cb_arg; /* arg to completion callback function */
- wl_rm_req_elt_t req[1]; /* variable length block of requests */
-} wl_rm_req_t;
-
-typedef struct wl_rm_rep_elt {
- s8 type;
- s8 flags;
- chanspec_t chanspec;
- u32 token; /* token for this measurement */
- u32 tsf_h; /* TSF high 32-bits of Measurement start time */
- u32 tsf_l; /* TSF low 32-bits */
- u32 dur; /* TUs */
- u32 len; /* byte length of data block */
- u8 data[1]; /* variable length data block */
-} wl_rm_rep_elt_t;
-
-#define WL_RPI_REP_BIN_NUM 8
-typedef struct wl_rm_rpi_rep {
- u8 rpi[WL_RPI_REP_BIN_NUM];
- s8 rpi_max[WL_RPI_REP_BIN_NUM];
-} wl_rm_rpi_rep_t;
-
-typedef struct wl_rm_rep {
- u32 token; /* overall measurement set token */
- u32 len; /* length of measurement report block */
- wl_rm_rep_elt_t rep[1]; /* variable length block of reports */
-} wl_rm_rep_t;
-
typedef struct wl_wsec_key {
u32 index; /* key index */
u32 len; /* key length */
--
1.7.1
From: Roland Vossen <[email protected]>
Every few minutes, this message would appear in syslog:
ieee80211 ph0: wl_ops_bss_info_changed: BSS idle: true (implement)
The message has been deleted, the driver requires no special action on this
particular event (). See: https://bugzilla.kernel.org/show_bug.cgi?id=38162
Reported-by: David Hill <[email protected]>
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/mac80211_if.c | 5 -----
1 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
index caab99a..77b06d5 100644
--- a/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
+++ b/drivers/staging/brcm80211/brcmsmac/mac80211_if.c
@@ -452,11 +452,6 @@ brcms_ops_bss_info_changed(struct ieee80211_hw *hw,
wiphy_err(wiphy, "%s: qos enabled: %s (implement)\n", __func__,
info->qos ? "true" : "false");
}
- if (changed & BSS_CHANGED_IDLE) {
- /* Idle changed for this BSS/interface */
- wiphy_err(wiphy, "%s: BSS idle: %s (implement)\n", __func__,
- info->idle ? "true" : "false");
- }
return;
}
--
1.7.1
From: Henry Ptasinski <[email protected]>
The 'if' is unnecessary, since no action is taken as a result of the test.
Signed-off-by: Henry Ptasinski <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/bmac.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/bmac.c b/drivers/staging/brcm80211/brcmsmac/bmac.c
index bdaad20..90d1b32 100644
--- a/drivers/staging/brcm80211/brcmsmac/bmac.c
+++ b/drivers/staging/brcm80211/brcmsmac/bmac.c
@@ -349,7 +349,7 @@ bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded)
/* TX FIFO suspend/flush completion */
if (macintstatus & MI_TXSTOP)
- if (brcms_b_tx_fifo_suspended(wlc_hw, TX_DATA_FIFO));
+ brcms_b_tx_fifo_suspended(wlc_hw, TX_DATA_FIFO);
/* noise sample collected */
if (macintstatus & MI_BG_NOISE) {
--
1.7.1
From: Arend van Spriel <[email protected]>
Packet filtering support is now always compiled into the fullmac
driver.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/Makefile | 1 -
drivers/staging/brcm80211/brcmfmac/dhd.h | 2 -
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 24 +++++++++-------------
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 2 -
4 files changed, 10 insertions(+), 19 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/Makefile b/drivers/staging/brcm80211/brcmfmac/Makefile
index 8a7cbf3..95d3147 100644
--- a/drivers/staging/brcm80211/brcmfmac/Makefile
+++ b/drivers/staging/brcm80211/brcmfmac/Makefile
@@ -26,7 +26,6 @@ ccflags-y := \
-DEMBEDDED_PLATFORM \
-DMAX_HDR_READ=64 \
-DMMC_SDIO_ABORT \
- -DPKT_FILTER_SUPPORT \
-DSHOW_EVENTS \
-DTOE
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index fb88c05..65e00a8 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -970,11 +970,9 @@ extern int brcmf_bus_start(dhd_pub_t *dhdp);
extern void brcmf_wait_for_event(dhd_pub_t *dhd, bool * lockvar);
extern void brcmf_wait_event_wakeup(dhd_pub_t *dhd);
-#ifdef PKT_FILTER_SUPPORT
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 ASSERT(exp) \
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 8f593cf..b481eb3 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -1190,6 +1190,7 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
uint bcn_timeout = 3;
int scan_assoc_time = 40;
int scan_unassoc_time = 40;
+ int i;
#ifdef GET_CUSTOM_MAC_ENABLE
int ret = 0;
u8 ea_addr[ETH_ALEN];
@@ -1288,22 +1289,17 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
brcmf_c_arp_offload_set(dhd, brcmf_arp_mode);
brcmf_c_arp_offload_enable(dhd, brcmf_arp_enable);
-#ifdef PKT_FILTER_SUPPORT
- {
- int i;
- /* Set up pkt filter */
- if (brcmf_pkt_filter_enable) {
- for (i = 0; i < dhd->pktfilter_count; i++) {
- brcmf_c_pktfilter_offload_set(dhd,
- dhd->pktfilter[i]);
- brcmf_c_pktfilter_offload_enable(dhd,
- dhd->pktfilter[i],
- brcmf_pkt_filter_init,
- brcmf_master_mode);
- }
+ /* Set up pkt filter */
+ if (brcmf_pkt_filter_enable) {
+ for (i = 0; i < dhd->pktfilter_count; i++) {
+ brcmf_c_pktfilter_offload_set(dhd,
+ dhd->pktfilter[i]);
+ brcmf_c_pktfilter_offload_enable(dhd,
+ dhd->pktfilter[i],
+ brcmf_pkt_filter_init,
+ brcmf_master_mode);
}
}
-#endif /* PKT_FILTER_SUPPORT */
brcmf_os_proto_unblock(dhd);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 9ee4866..c3a0e94 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -375,7 +375,6 @@ static int brcmf_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
static void brcmf_set_packet_filter(int value, dhd_pub_t *dhd)
{
-#ifdef PKT_FILTER_SUPPORT
DHD_TRACE(("%s: %d\n", __func__, value));
/* 1 - Enable packet filter, only allow unicast packet to send up */
/* 0 - Disable packet filter */
@@ -388,7 +387,6 @@ static void brcmf_set_packet_filter(int value, dhd_pub_t *dhd)
value, brcmf_master_mode);
}
}
-#endif
}
#if defined(CONFIG_HAS_EARLYSUSPEND)
--
1.7.1
On Thu, Jun 30, 2011 at 10:42:31AM -0700, Henry Ptasinski wrote:
> On 06/29/2011 11:29 PM, Rafał Miłecki wrote:
> >2011/6/30 Franky Lin<[email protected]>:
> >>Most of these patches are brcmfmac cleanup.
> >
> >
> >Hm, interesting improvement in your "Release early, release often" strategy.
> >
>
> Yea, we were waiting for the previous series to get applied. Not
> sure how to make this work better. Any process suggestions would be
> appreciated.
Maintain your own git tree. Post patches in bunches. If no one
comments on them within 3 days then probably you can assume they
are going to be merged. In the [0 / X] patch say something like:
Fixes blah blah blah.
Applies to linux-next with the following patch sets applied:
Message-ID: <[email protected]>
Message-ID: <[email protected]>
Or you can get the patches from git://whatever branch.
regards,
dan carpenter
From: Roland Vossen <[email protected]>
Code cleanup.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h | 12 ++--
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 14 +++--
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 2 +-
drivers/staging/brcm80211/brcmfmac/dhd.h | 22 ++++----
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 12 ++--
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 7 +-
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 20 ++++---
drivers/staging/brcm80211/brcmfmac/dngl_stats.h | 4 +-
drivers/staging/brcm80211/brcmfmac/sdio_host.h | 18 +++---
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 65 +++++++++++----------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h | 7 +-
11 files changed, 97 insertions(+), 86 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
index 3dff170..3a09aa3 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
@@ -92,14 +92,11 @@ struct brcmf_sdreg {
int value;
};
-/* callback function, taking one arg */
-typedef void (*sdioh_cb_fn_t) (void *);
-
struct sdioh_info {
struct osl_info *osh; /* osh handler */
bool client_intr_enabled; /* interrupt connnected flag */
bool intr_handler_valid; /* client driver interrupt handler valid */
- sdioh_cb_fn_t intr_handler; /* registered interrupt handler */
+ void (*intr_handler)(void *); /* registered interrupt handler */
void *intr_handler_arg; /* argument to call interrupt handler */
u16 intmask; /* Current active interrupts */
void *sdos_info; /* Pointer to per-OS private data */
@@ -149,8 +146,11 @@ extern void brcmf_sdioh_free_irq(uint irq, struct sdioh_info *sd);
*/
extern struct sdioh_info *brcmf_sdioh_attach(void *cfghdl, uint irq);
extern int brcmf_sdioh_detach(struct sdioh_info *si);
-extern int brcmf_sdioh_interrupt_register(struct sdioh_info *si,
- sdioh_cb_fn_t fn, void *argh);
+
+extern int
+brcmf_sdioh_interrupt_register(struct sdioh_info *si,
+ void (*sdioh_cb_fn)(void *), void *argh);
+
extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *si);
/* query whether SD interrupt is enabled or not */
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
index fd36679..ae83403 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
@@ -145,8 +145,7 @@ int brcmf_sdcard_intr_disable(struct brcmf_sdio_card *card)
}
int brcmf_sdcard_intr_reg(struct brcmf_sdio_card *card,
- brcmf_sdiocard_cb_fn_t fn,
- void *argh)
+ void (*fn)(void *), void *argh)
{
ASSERT(card);
@@ -161,8 +160,7 @@ int brcmf_sdcard_intr_dereg(struct brcmf_sdio_card *card)
}
int brcmf_sdcard_devremove_reg(struct brcmf_sdio_card *card,
- brcmf_sdiocard_cb_fn_t fn,
- void *argh)
+ void (*fn)(void *), void *argh)
{
ASSERT(card);
@@ -443,7 +441,9 @@ int
brcmf_sdcard_recv_buf(struct brcmf_sdio_card *card, u32 addr, uint fn,
uint flags,
u8 *buf, uint nbytes, struct sk_buff *pkt,
- brcmf_sdio_cmplt_fn_t complete, void *handle)
+ void (*complete)(void *handle, int status,
+ bool sync_waiting),
+ void *handle)
{
int status;
uint incr_fix;
@@ -486,7 +486,9 @@ brcmf_sdcard_recv_buf(struct brcmf_sdio_card *card, u32 addr, uint fn,
int
brcmf_sdcard_send_buf(struct brcmf_sdio_card *card, u32 addr, uint fn,
uint flags, u8 *buf, uint nbytes, void *pkt,
- brcmf_sdio_cmplt_fn_t complete, void *handle)
+ void (*complete)(void *handle, int status,
+ bool sync_waiting),
+ void *handle)
{
uint incr_fix;
uint width;
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 4f4ec47..2be9b08 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -188,7 +188,7 @@ extern int brcmf_sdioh_detach(struct sdioh_info *sd)
/* Configure callback to client when we receive client interrupt */
extern int
-brcmf_sdioh_interrupt_register(struct sdioh_info *sd, sdioh_cb_fn_t fn,
+brcmf_sdioh_interrupt_register(struct sdioh_info *sd, void (*fn)(void *),
void *argh)
{
sd_trace(("%s: Entering\n", __func__));
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index f76a3dd..a67d1ed 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -135,7 +135,7 @@
#define BRCMF_EVENT_MSG_FLUSHTXQ 0x02
#define BRCMF_EVENT_MSG_GROUP 0x04
-typedef struct brcmf_event_msg {
+struct brcmf_event_msg {
u16 version;
u16 flags;
u32 event_type;
@@ -145,7 +145,7 @@ typedef struct brcmf_event_msg {
u32 datalen;
u8 addr[ETH_ALEN];
char ifname[IFNAMSIZ];
-} __packed brcmf_event_msg_t;
+} __packed;
struct brcm_ethhdr {
u16 subtype;
@@ -155,11 +155,11 @@ struct brcm_ethhdr {
u16 usr_subtype;
} __packed;
-typedef struct brcmf_event {
+struct brcmf_event {
struct ethhdr eth;
struct brcm_ethhdr hdr;
struct brcmf_event_msg msg;
-} __packed brcmf_event_t;
+} __packed;
#define BRCMF_E_SET_SSID 0
#define BRCMF_E_JOIN 1
@@ -547,7 +547,7 @@ struct brcmf_pub {
bool iswl; /* Dongle-resident driver is wl */
unsigned long drv_version; /* Version of dongle-resident driver */
u8 mac[ETH_ALEN]; /* MAC address obtained from dongle */
- dngl_stats_t dstats; /* Stats for dongle-based data */
+ struct dngl_stats dstats; /* Stats for dongle-based data */
/* Additional stats for the bus level */
unsigned long tx_packets; /* Data packets sent to dongle */
@@ -609,10 +609,10 @@ struct brcmf_timeout {
u32 tick; /* O/S tick time (usec) */
};
-typedef struct {
+struct bcmevent_name {
uint event;
const char *name;
-} bcmevent_name_t;
+};
#if defined(CONFIG_PM_SLEEP)
extern atomic_t brcmf_mmc_suspend;
@@ -704,7 +704,7 @@ extern uint brcmf_pktgen_len;
#endif
extern u32 g_assert_type;
-extern const bcmevent_name_t bcmevent_names[];
+extern const struct bcmevent_name bcmevent_names[];
extern const int bcmevent_names_size;
@@ -808,7 +808,7 @@ extern int brcmf_timeout_expired(struct brcmf_timeout *tmo);
extern int brcmf_ifname2idx(struct brcmf_info *drvr_priv, char *name);
extern int brcmf_c_host_event(struct brcmf_info *drvr_priv, int *idx,
- void *pktdata, brcmf_event_msg_t *,
+ void *pktdata, struct brcmf_event_msg *,
void **data_ptr);
extern void brcmf_c_init(void);
@@ -885,7 +885,7 @@ struct brcmf_c_ioctl {
#ifdef SDTEST
/* For pktgen iovar */
-typedef struct brcmf_pktgen {
+struct brcmf_pktgen {
uint version; /* To allow structure change tracking */
uint freq; /* Max ticks between tx/rx attempts */
uint count; /* Test packets to send/rcv each attempt */
@@ -898,7 +898,7 @@ typedef struct brcmf_pktgen {
uint numfail; /* Count of test send failures */
uint mode; /* Test mode (type of test packets) */
uint stop; /* Stop after this many tx failures */
-} brcmf_pktgen_t;
+};
/* Version in case structure changes */
#define BRCMF_PKTGEN_VERSION 2
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 14dc98d..ddc2085 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -449,7 +449,8 @@ int brcmf_c_ioctl(struct brcmf_pub *drvr, struct brcmf_c_ioctl *ioc, void *buf,
}
#ifdef SHOW_EVENTS
-static void brcmf_c_show_host_event(brcmf_event_msg_t *event, void *event_data)
+static void
+brcmf_c_show_host_event(struct brcmf_event_msg *event, void *event_data)
{
uint i, status, reason;
bool group = false, flush_txq = false, link = false;
@@ -756,10 +757,10 @@ static void brcmf_c_show_host_event(brcmf_event_msg_t *event, void *event_data)
int
brcmf_c_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
- brcmf_event_msg_t *event, void **data_ptr)
+ struct brcmf_event_msg *event, void **data_ptr)
{
/* check whether packet is a BRCM event pkt */
- brcmf_event_t *pvt_data = (brcmf_event_t *) pktdata;
+ struct brcmf_event *pvt_data = (struct brcmf_event *) pktdata;
char *event_data;
u32 type, status;
u16 flags;
@@ -781,12 +782,13 @@ brcmf_c_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
event_data = *data_ptr;
/* memcpy since BRCM event pkt may be unaligned. */
- memcpy(event, &pvt_data->msg, sizeof(brcmf_event_msg_t));
+ memcpy(event, &pvt_data->msg, sizeof(struct brcmf_event_msg));
type = get_unaligned_be32(&event->event_type);
flags = get_unaligned_be16(&event->flags);
status = get_unaligned_be32(&event->status);
- evlen = get_unaligned_be32(&event->datalen) + sizeof(brcmf_event_t);
+ evlen = get_unaligned_be32(&event->datalen) +
+ sizeof(struct brcmf_event);
switch (type) {
case BRCMF_E_IF:
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index aa2f81f..fc9abba 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -185,7 +185,8 @@ module_param(brcmf_pktgen_len, uint, 0);
static int brcmf_toe_get(struct brcmf_info *drvr_priv, int idx, u32 *toe_ol);
static int brcmf_toe_set(struct brcmf_info *drvr_priv, int idx, u32 toe_ol);
static int brcmf_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
- brcmf_event_msg_t *event_ptr, void **data_ptr);
+ struct brcmf_event_msg *event_ptr,
+ void **data_ptr);
static void brcmf_set_packet_filter(int value, struct brcmf_pub *drvr)
{
@@ -858,7 +859,7 @@ void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx, struct sk_buff *skb,
struct sk_buff *pnext, *save_pktbuf;
int i;
struct brcmf_if *ifp;
- brcmf_event_msg_t event;
+ struct brcmf_event_msg event;
DHD_TRACE(("%s: Enter\n", __func__));
@@ -1858,7 +1859,7 @@ int brcmf_os_ioctl_resp_wake(struct brcmf_pub *drvr)
}
static int brcmf_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
- brcmf_event_msg_t *event, void **data)
+ struct brcmf_event_msg *event, void **data)
{
int bcmerror = 0;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index ba3ea59..3cbfacb 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -410,7 +410,7 @@ BRCMF_SPINWAIT_SLEEP_INIT(sdioh_spinwait_sleep);
#define CORE_BUS_REG(base, field) \
(base + offsetof(struct sdpcmd_regs, field))
#define CORE_SB(base, field) \
- (base + SBCONFIGOFF + offsetof(sbconfig_t, field))
+ (base + SBCONFIGOFF + offsetof(struct sbconfig, field))
/* core registers */
struct sdpcmd_regs {
@@ -697,7 +697,7 @@ struct brcmf_bus {
u32 fw_ptr;
};
-typedef volatile struct _sbconfig {
+struct sbconfig {
u32 PAD[2];
u32 sbipsflag; /* initiator port ocp slave flag */
u32 PAD[3];
@@ -735,7 +735,7 @@ typedef volatile struct _sbconfig {
u32 PAD[3];
u32 sbidlow; /* identification */
u32 sbidhigh; /* identification */
-} sbconfig_t;
+};
/* clkstate */
#define CLK_NONE 0
@@ -893,7 +893,9 @@ static void brcmf_sdbrcm_setmemsize(struct brcmf_bus *bus, int mem_size);
static int brcmf_sdbrcm_send_buf(struct brcmf_bus *bus, u32 addr, uint fn,
uint flags, u8 *buf, uint nbytes,
struct sk_buff *pkt,
- brcmf_sdio_cmplt_fn_t complete, void *handle);
+ void (*complete)(void *handle, int status,
+ bool sync_waiting),
+ void *handle);
static bool brcmf_sdbrcm_download_firmware(struct brcmf_bus *bus, void *card);
static int _brcmf_sdbrcm_download_firmware(struct brcmf_bus *bus);
@@ -1865,7 +1867,7 @@ const struct brcmu_iovar dhdsdio_iovars[] = {
#ifdef SDTEST
{"extloop", IOV_EXTLOOP, 0, IOVT_BOOL, 0}
,
- {"pktgen", IOV_PKTGEN, 0, IOVT_BUFFER, sizeof(brcmf_pktgen_t)}
+ {"pktgen", IOV_PKTGEN, 0, IOVT_BUFFER, sizeof(struct brcmf_pktgen)}
,
#endif /* SDTEST */
@@ -2001,7 +2003,7 @@ void brcmf_bus_clearcounts(struct brcmf_pub *drvr)
#ifdef SDTEST
static int brcmf_sdbrcm_pktgen_get(struct brcmf_bus *bus, u8 *arg)
{
- brcmf_pktgen_t pktgen;
+ struct brcmf_pktgen pktgen;
pktgen.version = BRCMF_PKTGEN_VERSION;
pktgen.freq = bus->pktgen_freq;
@@ -2023,7 +2025,7 @@ static int brcmf_sdbrcm_pktgen_get(struct brcmf_bus *bus, u8 *arg)
static int brcmf_sdbrcm_pktgen_set(struct brcmf_bus *bus, u8 *arg)
{
- brcmf_pktgen_t pktgen;
+ struct brcmf_pktgen pktgen;
uint oldcnt, oldmode;
memcpy(&pktgen, arg, sizeof(pktgen));
@@ -6035,7 +6037,9 @@ err:
static int
brcmf_sdbrcm_send_buf(struct brcmf_bus *bus, u32 addr, uint fn, uint flags,
u8 *buf, uint nbytes, struct sk_buff *pkt,
- brcmf_sdio_cmplt_fn_t complete, void *handle)
+ void (*complete)(void *handle, int status,
+ bool sync_waiting),
+ void *handle)
{
return brcmf_sdcard_send_buf
(bus->card, addr, fn, flags, buf, nbytes, pkt, complete,
diff --git a/drivers/staging/brcm80211/brcmfmac/dngl_stats.h b/drivers/staging/brcm80211/brcmfmac/dngl_stats.h
index 699cbff..53a50f6 100644
--- a/drivers/staging/brcm80211/brcmfmac/dngl_stats.h
+++ b/drivers/staging/brcm80211/brcmfmac/dngl_stats.h
@@ -17,7 +17,7 @@
#ifndef _dngl_stats_h_
#define _dngl_stats_h_
-typedef struct {
+struct dngl_stats {
unsigned long rx_packets; /* total packets received */
unsigned long tx_packets; /* total packets transmitted */
unsigned long rx_bytes; /* total bytes received */
@@ -27,6 +27,6 @@ typedef struct {
unsigned long rx_dropped; /* packets dropped by dongle */
unsigned long tx_dropped; /* packets dropped by dongle */
unsigned long multicast; /* multicast packets received */
-} dngl_stats_t;
+};
#endif /* _dngl_stats_h_ */
diff --git a/drivers/staging/brcm80211/brcmfmac/sdio_host.h b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
index 02c820b..5d2178d 100644
--- a/drivers/staging/brcm80211/brcmfmac/sdio_host.h
+++ b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
@@ -43,7 +43,6 @@ extern const uint brcmf_sdio_msglevel;
/* forward declarations */
struct brcmf_sdio_card;
-typedef void (*brcmf_sdiocard_cb_fn_t) (void *);
/* Attach and build an interface to the underlying SD host driver.
* - Allocates resources (structs, arrays, mem, OS handles, etc) needed by
@@ -68,8 +67,8 @@ extern int brcmf_sdcard_intr_disable(struct brcmf_sdio_card *card);
/* Register/deregister device interrupt handler. */
extern int
-brcmf_sdcard_intr_reg(struct brcmf_sdio_card *card, brcmf_sdiocard_cb_fn_t fn,
- void *argh);
+brcmf_sdcard_intr_reg(struct brcmf_sdio_card *card,
+ void (*fn)(void *), void *argh);
extern int brcmf_sdcard_intr_dereg(struct brcmf_sdio_card *card);
@@ -78,8 +77,7 @@ extern int brcmf_sdcard_intr_dereg(struct brcmf_sdio_card *card);
*/
extern int
brcmf_sdcard_devremove_reg(struct brcmf_sdio_card *card,
- brcmf_sdiocard_cb_fn_t fn,
- void *argh);
+ void (*fn)(void *), void *argh);
/* Access SDIO address space (e.g. CCCR) using CMD52 (single-byte interface).
* fn: function number
@@ -138,16 +136,18 @@ extern bool brcmf_sdcard_regfail(struct brcmf_sdio_card *card);
* Returns 0 or error code.
* NOTE: Async operation is not currently supported.
*/
-typedef void (*brcmf_sdio_cmplt_fn_t)
- (void *handle, int status, bool sync_waiting);
extern int
brcmf_sdcard_send_buf(struct brcmf_sdio_card *card, u32 addr, uint fn,
uint flags, u8 *buf, uint nbytes, void *pkt,
- brcmf_sdio_cmplt_fn_t complete, void *handle);
+ void (*complete)(void *handle, int status,
+ bool sync_waiting),
+ void *handle);
extern int
brcmf_sdcard_recv_buf(struct brcmf_sdio_card *card, u32 addr, uint fn,
uint flags, u8 *buf, uint nbytes, struct sk_buff *pkt,
- brcmf_sdio_cmplt_fn_t complete, void *handle);
+ void (*complete)(void *handle, int status,
+ bool sync_waiting),
+ void *handle);
/* Flags bits */
#define SDIO_REQ_4BYTE 0x1 /* Four-byte target (backplane) width (vs. two-byte) */
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index b0ac780..85ff00b 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -117,24 +117,24 @@ static void brcmf_init_eq_lock(struct wl_priv *wl);
static void brcmf_init_eloop_handler(struct wl_event_loop *el);
static struct wl_event_q *brcmf_deq_event(struct wl_priv *wl);
static s32 brcmf_enq_event(struct wl_priv *wl, u32 type,
- const brcmf_event_msg_t *msg, void *data);
+ const struct brcmf_event_msg *msg, void *data);
static void brcmf_put_event(struct wl_event_q *e);
static void brcmf_wakeup_event(struct wl_priv *wl);
-static s32 brcmf_notify_connect_status(struct wl_priv *wl,
- struct net_device *ndev,
- const brcmf_event_msg_t *e, void *data);
-static s32 brcmf_notify_roaming_status(struct wl_priv *wl,
- struct net_device *ndev,
- const brcmf_event_msg_t *e, void *data);
+static s32 brcmf_notify_connect_status(struct wl_priv *wl, struct net_device *ndev,
+ const struct brcmf_event_msg *e,
+ void *data);
+static s32 brcmf_notify_roaming_status(struct wl_priv *wl, struct net_device *ndev,
+ const struct brcmf_event_msg *e,
+ void *data);
static s32 brcmf_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
- const brcmf_event_msg_t *e, void *data);
+ const struct brcmf_event_msg *e, void *data);
static s32 brcmf_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
- const brcmf_event_msg_t *e, void *data,
- bool completed);
+ const struct brcmf_event_msg *e, void *data,
+ bool completed);
static s32 brcmf_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
- const brcmf_event_msg_t *e, void *data);
+ const struct brcmf_event_msg *e, void *data);
static s32 brcmf_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
- const brcmf_event_msg_t *e, void *data);
+ const struct brcmf_event_msg *e, void *data);
/*
** register/deregister sdio function
@@ -165,8 +165,8 @@ static s32 brcmf_set_retry(struct net_device *dev, u32 retry, bool l);
/*
** wl profile utilities
*/
-static s32 brcmf_update_prof(struct wl_priv *wl, const brcmf_event_msg_t *e,
- void *data, s32 item);
+static s32 brcmf_update_prof(struct wl_priv *wl, const struct brcmf_event_msg *e,
+ void *data, s32 item);
static void *brcmf_read_prof(struct wl_priv *wl, s32 item);
static void brcmf_init_prof(struct wl_profile *prof);
@@ -231,9 +231,10 @@ static bool brcmf_is_ibssmode(struct wl_priv *wl);
/*
** dongle up/down , default configuration utilities
*/
-static bool brcmf_is_linkdown(struct wl_priv *wl, const brcmf_event_msg_t *e);
-static bool brcmf_is_linkup(struct wl_priv *wl, const brcmf_event_msg_t *e);
-static bool brcmf_is_nonetwork(struct wl_priv *wl, const brcmf_event_msg_t *e);
+static bool brcmf_is_linkdown(struct wl_priv *wl, const struct brcmf_event_msg *e);
+static bool brcmf_is_linkup(struct wl_priv *wl, const struct brcmf_event_msg *e);
+static bool brcmf_is_nonetwork(struct wl_priv *wl,
+ const struct brcmf_event_msg *e);
static void brcmf_link_down(struct wl_priv *wl);
static s32 brcmf_dongle_mode(struct net_device *ndev, s32 iftype);
static s32 __brcmf_cfg80211_up(struct wl_priv *wl);
@@ -2536,7 +2537,7 @@ CleanUp:
return err;
}
-static bool brcmf_is_linkup(struct wl_priv *wl, const brcmf_event_msg_t *e)
+static bool brcmf_is_linkup(struct wl_priv *wl, const struct brcmf_event_msg *e)
{
u32 event = be32_to_cpu(e->event_type);
u32 status = be32_to_cpu(e->status);
@@ -2550,7 +2551,7 @@ static bool brcmf_is_linkup(struct wl_priv *wl, const brcmf_event_msg_t *e)
return false;
}
-static bool brcmf_is_linkdown(struct wl_priv *wl, const brcmf_event_msg_t *e)
+static bool brcmf_is_linkdown(struct wl_priv *wl, const struct brcmf_event_msg *e)
{
u32 event = be32_to_cpu(e->event_type);
u16 flags = be16_to_cpu(e->flags);
@@ -2562,7 +2563,7 @@ static bool brcmf_is_linkdown(struct wl_priv *wl, const brcmf_event_msg_t *e)
return false;
}
-static bool brcmf_is_nonetwork(struct wl_priv *wl, const brcmf_event_msg_t *e)
+static bool brcmf_is_nonetwork(struct wl_priv *wl, const struct brcmf_event_msg *e)
{
u32 event = be32_to_cpu(e->event_type);
u32 status = be32_to_cpu(e->status);
@@ -2584,7 +2585,7 @@ static bool brcmf_is_nonetwork(struct wl_priv *wl, const brcmf_event_msg_t *e)
static s32
brcmf_notify_connect_status(struct wl_priv *wl, struct net_device *ndev,
- const brcmf_event_msg_t *e, void *data)
+ const struct brcmf_event_msg *e, void *data)
{
s32 err = 0;
@@ -2628,7 +2629,7 @@ brcmf_notify_connect_status(struct wl_priv *wl, struct net_device *ndev,
static s32
brcmf_notify_roaming_status(struct wl_priv *wl, struct net_device *ndev,
- const brcmf_event_msg_t *e, void *data)
+ const struct brcmf_event_msg *e, void *data)
{
s32 err = 0;
u32 event = be32_to_cpu(e->event_type);
@@ -2840,7 +2841,7 @@ update_bss_info_out:
static s32
brcmf_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
- const brcmf_event_msg_t *e, void *data)
+ const struct brcmf_event_msg *e, void *data)
{
struct wl_connect_info *conn_info = wl_to_conn(wl);
s32 err = 0;
@@ -2864,7 +2865,7 @@ brcmf_bss_roaming_done(struct wl_priv *wl, struct net_device *ndev,
static s32
brcmf_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
- const brcmf_event_msg_t *e, void *data, bool completed)
+ const struct brcmf_event_msg *e, void *data, bool completed)
{
struct wl_connect_info *conn_info = wl_to_conn(wl);
s32 err = 0;
@@ -2896,7 +2897,7 @@ brcmf_bss_connect_done(struct wl_priv *wl, struct net_device *ndev,
static s32
brcmf_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
- const brcmf_event_msg_t *e, void *data)
+ const struct brcmf_event_msg *e, void *data)
{
u16 flags = be16_to_cpu(e->flags);
enum nl80211_key_type key_type;
@@ -2916,7 +2917,7 @@ brcmf_notify_mic_status(struct wl_priv *wl, struct net_device *ndev,
static s32
brcmf_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
- const brcmf_event_msg_t *e, void *data)
+ const struct brcmf_event_msg *e, void *data)
{
struct brcmf_channel_info channel_inform;
struct brcmf_scan_results *bss_list;
@@ -3484,7 +3485,7 @@ static s32 brcmf_event_handler(void *data)
void
wl_cfg80211_event(struct net_device *ndev,
- const brcmf_event_msg_t *e, void *data)
+ const struct brcmf_event_msg *e, void *data)
{
u32 event_type = be32_to_cpu(e->event_type);
struct wl_priv *wl = ndev_to_wl(ndev);
@@ -3535,8 +3536,8 @@ static struct wl_event_q *brcmf_deq_event(struct wl_priv *wl)
*/
static s32
-brcmf_enq_event(struct wl_priv *wl, u32 event, const brcmf_event_msg_t *msg,
- void *data)
+brcmf_enq_event(struct wl_priv *wl, u32 event, const struct brcmf_event_msg *msg,
+ void *data)
{
struct wl_event_q *e;
s32 err = 0;
@@ -3548,7 +3549,7 @@ brcmf_enq_event(struct wl_priv *wl, u32 event, const brcmf_event_msg_t *msg,
}
e->etype = event;
- memcpy(&e->emsg, msg, sizeof(brcmf_event_msg_t));
+ memcpy(&e->emsg, msg, sizeof(struct brcmf_event_msg));
if (data) {
}
brcmf_lock_eq(wl);
@@ -3927,8 +3928,8 @@ static void *brcmf_read_prof(struct wl_priv *wl, s32 item)
}
static s32
-brcmf_update_prof(struct wl_priv *wl, const brcmf_event_msg_t *e, void *data,
- s32 item)
+brcmf_update_prof(struct wl_priv *wl, const struct brcmf_event_msg *e, void *data,
+ s32 item)
{
s32 err = 0;
struct brcmf_ssid *ssid;
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
index e6df203..af62cee 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
@@ -183,7 +183,8 @@ struct wl_conf {
struct wl_event_loop {
s32(*handler[BRCMF_E_LAST]) (struct wl_priv *wl,
struct net_device *ndev,
- const brcmf_event_msg_t *e, void *data);
+ const struct brcmf_event_msg *e,
+ void *data);
};
/* representing interface of cfg80211 plane */
@@ -219,7 +220,7 @@ struct wl_ie {
struct wl_event_q {
struct list_head eq_list;
u32 etype;
- brcmf_event_msg_t emsg;
+ struct brcmf_event_msg emsg;
s8 edata[1];
};
@@ -370,7 +371,7 @@ extern s32 wl_cfg80211_attach(struct net_device *ndev, void *data);
extern void wl_cfg80211_detach(void);
/* event handler from dongle */
extern void wl_cfg80211_event(struct net_device *ndev,
- const brcmf_event_msg_t *e, void *data);
+ const struct brcmf_event_msg *e, void *data);
extern void wl_cfg80211_sdio_func(void *func); /* set sdio function info */
extern struct sdio_func *wl_cfg80211_get_sdio_func(void); /* set sdio function info */
extern s32 wl_cfg80211_up(void); /* dongle up */
--
1.7.1
From: Roland Vossen <[email protected]>
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 8 ++-
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 54 ++++++++++----------
drivers/staging/brcm80211/brcmfmac/sdiovar.h | 4 +-
3 files changed, 34 insertions(+), 32 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 4f7d32a..c814701 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -359,7 +359,7 @@ const struct brcmu_iovar sdioh_iovars[] = {
size) */
{"sd_ints", IOV_USEINTS, 0, IOVT_BOOL, 0},
{"sd_numints", IOV_NUMINTS, 0, IOVT_UINT32, 0},
- {"sd_devreg", IOV_DEVREG, 0, IOVT_BUFFER, sizeof(sdreg_t)}
+ {"sd_devreg", IOV_DEVREG, 0, IOVT_BUFFER, sizeof(struct brcmf_sdreg)}
,
{"sd_rxchain", IOV_RXCHAIN, 0, IOVT_BOOL, 0}
,
@@ -498,7 +498,8 @@ brcmf_sdioh_iovar_op(struct sdioh_info *si, const char *name,
case IOV_GVAL(IOV_DEVREG):
{
- sdreg_t *sd_ptr = (sdreg_t *) params;
+ struct brcmf_sdreg *sd_ptr =
+ (struct brcmf_sdreg *) params;
u8 data = 0;
if (brcmf_sdioh_cfg_read
@@ -514,7 +515,8 @@ brcmf_sdioh_iovar_op(struct sdioh_info *si, const char *name,
case IOV_SVAL(IOV_DEVREG):
{
- sdreg_t *sd_ptr = (sdreg_t *) params;
+ struct brcmf_sdreg *sd_ptr =
+ (struct brcmf_sdreg *) params;
u8 data = (u8) sd_ptr->value;
if (brcmf_sdioh_cfg_write
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index c00f0f2..e8cc8d5 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -95,7 +95,7 @@
#define TRAP_T_SIZE 80
-typedef struct _trap_struct {
+struct brcmf_trap {
u32 type;
u32 epc;
u32 cpsr;
@@ -116,20 +116,20 @@ typedef struct _trap_struct {
u32 r13;
u32 r14;
u32 pc;
-} trap_t;
+};
#define CBUF_LEN (128)
#define LOG_BUF_LEN 1024
-typedef struct {
+struct rte_log {
u32 buf; /* Can't be pointer on (64-bit) hosts */
uint buf_size;
uint idx;
char *_buf_compat; /* Redundant pointer for backward compat. */
-} rte_log_t;
+};
-typedef struct {
+struct rte_console {
/* Virtual UART
* When there is no UART (e.g. Quickturn),
* the host should write a complete
@@ -148,7 +148,7 @@ typedef struct {
* Output will be lost if the output wraps around faster than the host
* polls.
*/
- rte_log_t log;
+ struct rte_log log;
/* Console input line buffer
* Characters are read one at a time into cbuf
@@ -158,7 +158,7 @@ typedef struct {
*/
uint cbuf_idx;
char cbuf[CBUF_LEN];
-} rte_cons_t;
+};
#endif /* DHD_DEBUG */
#include <chipcommon.h>
@@ -418,14 +418,14 @@ DHD_SPINWAIT_SLEEP_INIT(sdioh_spinwait_sleep);
#ifdef DHD_DEBUG
/* Device console log buffer state */
-typedef struct dhd_console {
+struct dhd_console {
uint count; /* Poll interval msec counter */
uint log_addr; /* Log struct address (fixed) */
- rte_log_t log; /* Log struct (host copy) */
+ struct rte_log log; /* Log struct (host copy) */
uint bufsize; /* Size of log buffer */
u8 *buf; /* Log buffer (host copy) */
uint last; /* Last buffer read index */
-} dhd_console_t;
+};
#endif /* DHD_DEBUG */
struct sdpcm_shared {
@@ -434,7 +434,7 @@ struct sdpcm_shared {
u32 assert_exp_addr;
u32 assert_file_addr;
u32 assert_line;
- u32 console_addr; /* Address of rte_cons_t */
+ u32 console_addr; /* Address of struct rte_console */
u32 msgtrace_addr;
u8 tag[32];
};
@@ -523,7 +523,7 @@ typedef struct dhd_bus {
uint pollcnt; /* Count of active polls */
#ifdef DHD_DEBUG
- dhd_console_t console; /* Console output polling support */
+ struct dhd_console console; /* Console output polling support */
uint console_addr; /* Console address from shared struct */
#endif /* DHD_DEBUG */
@@ -1755,9 +1755,9 @@ const struct brcmu_iovar dhdsdio_iovars[] = {
{"sdalign", IOV_SDALIGN, 0, IOVT_BOOL, 0},
{"devreset", IOV_DEVRESET, 0, IOVT_BOOL, 0},
#ifdef DHD_DEBUG
- {"sdreg", IOV_SDREG, 0, IOVT_BUFFER, sizeof(sdreg_t)}
+ {"sdreg", IOV_SDREG, 0, IOVT_BUFFER, sizeof(struct brcmf_sdreg)}
,
- {"sbreg", IOV_SBREG, 0, IOVT_BUFFER, sizeof(sdreg_t)}
+ {"sbreg", IOV_SBREG, 0, IOVT_BUFFER, sizeof(struct brcmf_sdreg)}
,
{"sd_cis", IOV_SDCIS, 0, IOVT_BUFFER, DHD_IOCTL_MAXLEN}
,
@@ -2090,7 +2090,7 @@ static int brcmf_sdbrcm_checkdied(dhd_bus_t *bus, u8 *data, uint size)
char *mbuffer = NULL;
uint maxstrlen = 256;
char *str = NULL;
- trap_t tr;
+ struct brcmf_trap tr;
struct sdpcm_shared sdpcm_shared;
struct brcmu_strbuf strbuf;
@@ -2180,7 +2180,7 @@ static int brcmf_sdbrcm_checkdied(dhd_bus_t *bus, u8 *data, uint size)
if (sdpcm_shared.flags & SDPCM_SHARED_TRAP) {
bcmerror = brcmf_sdbrcm_membytes(bus, false,
sdpcm_shared.trap_addr, (u8 *)&tr,
- sizeof(trap_t));
+ sizeof(struct brcmf_trap));
if (bcmerror < 0)
goto done;
@@ -2263,7 +2263,7 @@ static int brcmf_sdbrcm_mem_dump(dhd_bus_t *bus)
static int brcmf_sdbrcm_readconsole(dhd_bus_t *bus)
{
- dhd_console_t *c = &bus->console;
+ struct dhd_console *c = &bus->console;
u8 line[CONSOLE_LINE_MAX], ch;
u32 n, idx, addr;
int rv;
@@ -2273,7 +2273,7 @@ static int brcmf_sdbrcm_readconsole(dhd_bus_t *bus)
return 0;
/* Read console log struct */
- addr = bus->console_addr + offsetof(rte_cons_t, log);
+ addr = bus->console_addr + offsetof(struct rte_console, log);
rv = brcmf_sdbrcm_membytes(bus, false, addr, (u8 *)&c->log,
sizeof(c->log));
if (rv < 0)
@@ -2608,10 +2608,10 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
#ifdef DHD_DEBUG
case IOV_GVAL(IOV_SDREG):
{
- sdreg_t *sd_ptr;
+ struct brcmf_sdreg *sd_ptr;
u32 addr, size;
- sd_ptr = (sdreg_t *) params;
+ sd_ptr = (struct brcmf_sdreg *) params;
addr = (unsigned long)bus->regs + sd_ptr->offset;
size = sd_ptr->func;
@@ -2625,10 +2625,10 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
case IOV_SVAL(IOV_SDREG):
{
- sdreg_t *sd_ptr;
+ struct brcmf_sdreg *sd_ptr;
u32 addr, size;
- sd_ptr = (sdreg_t *) params;
+ sd_ptr = (struct brcmf_sdreg *) params;
addr = (unsigned long)bus->regs + sd_ptr->offset;
size = sd_ptr->func;
@@ -2643,7 +2643,7 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
(not SDIO core) */
case IOV_GVAL(IOV_SBREG):
{
- sdreg_t sdreg;
+ struct brcmf_sdreg sdreg;
u32 addr, size;
memcpy(&sdreg, params, sizeof(sdreg));
@@ -2660,7 +2660,7 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
case IOV_SVAL(IOV_SBREG):
{
- sdreg_t sdreg;
+ struct brcmf_sdreg sdreg;
u32 addr, size;
memcpy(&sdreg, params, sizeof(sdreg));
@@ -5137,20 +5137,20 @@ extern int brcmf_sdbrcm_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg,
brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
/* Zero cbuf_index */
- addr = bus->console_addr + offsetof(rte_cons_t, cbuf_idx);
+ addr = bus->console_addr + offsetof(struct rte_console, cbuf_idx);
val = cpu_to_le32(0);
rv = brcmf_sdbrcm_membytes(bus, true, addr, (u8 *)&val, sizeof(val));
if (rv < 0)
goto done;
/* Write message into cbuf */
- addr = bus->console_addr + offsetof(rte_cons_t, cbuf);
+ addr = bus->console_addr + offsetof(struct rte_console, cbuf);
rv = brcmf_sdbrcm_membytes(bus, true, addr, (u8 *)msg, msglen);
if (rv < 0)
goto done;
/* Write length into vcons_in */
- addr = bus->console_addr + offsetof(rte_cons_t, vcons_in);
+ addr = bus->console_addr + offsetof(struct rte_console, vcons_in);
val = cpu_to_le32(msglen);
rv = brcmf_sdbrcm_membytes(bus, true, addr, (u8 *)&val, sizeof(val));
if (rv < 0)
diff --git a/drivers/staging/brcm80211/brcmfmac/sdiovar.h b/drivers/staging/brcm80211/brcmfmac/sdiovar.h
index d1cfa5f..35e913b 100644
--- a/drivers/staging/brcm80211/brcmfmac/sdiovar.h
+++ b/drivers/staging/brcm80211/brcmfmac/sdiovar.h
@@ -17,11 +17,11 @@
#ifndef _sdiovar_h_
#define _sdiovar_h_
-typedef struct sdreg {
+struct brcmf_sdreg {
int func;
int offset;
int value;
-} sdreg_t;
+};
/* Common msglevel constants */
#define SDH_ERROR_VAL 0x0001 /* Error */
--
1.7.1
From: Arend van Spriel <[email protected]>
The source file srom.c used meaningless non-zero numbers to return
upon error conditions. These have been replaced by linux error codes.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/srom.c | 36 +++++++++++++----------------
1 files changed, 16 insertions(+), 20 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/srom.c b/drivers/staging/brcm80211/brcmsmac/srom.c
index 31aa84d..34c19ef 100644
--- a/drivers/staging/brcm80211/brcmsmac/srom.c
+++ b/drivers/staging/brcm80211/brcmsmac/srom.c
@@ -870,7 +870,7 @@ int srom_var_init(struct si_pub *sih, uint bustype, void *curmap,
if (curmap != NULL && bustype == PCI_BUS)
return initvars_srom_pci(sih, curmap, vars, count);
- return -1;
+ return -EINVAL;
}
/* In chips with chipcommon rev 32 and later, the srom is in chipcommon,
@@ -935,7 +935,7 @@ sprom_read_pci(struct si_pub *sih, u16 *sprom, uint wordoff,
if (sih->ccrev > 31 && ISSIM_ENAB(sih)) {
/* use indirect since direct is too slow on QT */
if ((sih->cccaps & CC_CAP_SROM) == 0)
- return 1;
+ return -ENODEV;
ccregs = (void *)((u8 *) sprom - CC_SROM_OTP);
buf[i] =
@@ -953,7 +953,7 @@ sprom_read_pci(struct si_pub *sih, u16 *sprom, uint wordoff,
/* bypass crc checking for simulation to allow srom hack */
if (ISSIM_ENAB(sih))
- return err;
+ return 0;
if (check_crc) {
@@ -962,7 +962,7 @@ sprom_read_pci(struct si_pub *sih, u16 *sprom, uint wordoff,
* is blank, regardless of the rest of the content, so declare
* it bad.
*/
- return 1;
+ return -ENODATA;
}
/* fixup the endianness so crc8 will pass */
@@ -970,7 +970,7 @@ sprom_read_pci(struct si_pub *sih, u16 *sprom, uint wordoff,
if (brcmu_crc8((u8 *) buf, nwords * 2, CRC8_INIT_VALUE) !=
CRC8_GOOD_VALUE) {
/* DBG only pci always read srom4 first, then srom8/9 */
- err = 1;
+ err = -EIO;
}
/* now correct the endianness of the byte array */
ltoh16_buf(buf, nwords * 2);
@@ -987,7 +987,7 @@ static int otp_read_pci(struct si_pub *sih, u16 *buf, uint bufsz)
otp = kzalloc(OTP_SZ_MAX, GFP_ATOMIC);
if (otp == NULL) {
- return -EBADE;
+ return -ENOMEM;
}
err = otp_read_region(sih, OTP_HW_RGN, (u16 *) otp, &sz);
@@ -1002,14 +1002,14 @@ static int otp_read_pci(struct si_pub *sih, u16 *buf, uint bufsz)
* is blank, regardless of the rest of the content, so declare
* it bad.
*/
- return 1;
+ return -ENODATA;
}
/* fixup the endianness so crc8 will pass */
htol16_buf(buf, bufsz);
if (brcmu_crc8((u8 *) buf, SROM4_WORDS * 2, CRC8_INIT_VALUE) !=
CRC8_GOOD_VALUE) {
- err = 1;
+ err = -EIO;
}
/* now correct the endianness of the byte array */
ltoh16_buf(buf, bufsz);
@@ -1219,13 +1219,12 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
*/
srom = kmalloc(SROM_MAX, GFP_ATOMIC);
if (!srom)
- return -2;
+ return -ENOMEM;
sromwindow = (u16 *) SROM_OFFSET(sih);
if (ai_is_sprom_available(sih)) {
- err =
- sprom_read_pci(sih, sromwindow, 0, srom, SROM_WORDS,
- true);
+ err = sprom_read_pci(sih, sromwindow, 0, srom, SROM_WORDS,
+ true);
if ((srom[SROM4_SIGN] == SROM4_SIGNATURE) ||
(((sih->buscoretype == PCIE_CORE_ID)
@@ -1233,9 +1232,8 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
|| ((sih->buscoretype == PCI_CORE_ID)
&& (sih->buscorerev >= 0xe)))) {
/* sromrev >= 4, read more */
- err =
- sprom_read_pci(sih, sromwindow, 0, srom,
- SROM4_WORDS, true);
+ err = sprom_read_pci(sih, sromwindow, 0, srom,
+ SROM4_WORDS, true);
sromrev = srom[SROM4_CRCREV] & 0xff;
} else if (err == 0) {
/* srom is good and is rev < 4 */
@@ -1253,12 +1251,10 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
if (err == 0)
/* OTP only contain SROM rev8/rev9 for now */
sromrev = srom[SROM4_CRCREV] & 0xff;
- else
- err = 1;
}
#else
else
- err = 1;
+ err = -ENODEV;
#endif
if (!err) {
@@ -1267,13 +1263,13 @@ static int initvars_srom_pci(struct si_pub *sih, void *curmap, char **vars,
/* srom version check: Current valid versions: 1, 2, 3, 4, 5, 8, 9 */
if ((sr & 0x33e) == 0) {
- err = -2;
+ err = -EINVAL;
goto errout;
}
base = kmalloc(MAXSZ_NVRAM_VARS, GFP_ATOMIC);
if (!base) {
- err = -2;
+ err = -ENOMEM;
goto errout;
}
--
1.7.1
In brcmfmac the firmware download related code scatter all around.
And some old dead code which is not following the standard firmware
routine is still present. This patch limits the firmware download
related code only in dhd_sdio.c and removes the rest.
Signed-off-by: Franky Lin <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmchip.h | 3 +
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 2 -
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h | 2 +
drivers/staging/brcm80211/brcmfmac/dhd.h | 9 -
drivers/staging/brcm80211/brcmfmac/dhd_bus.h | 8 -
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 13 --
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 84 +----------
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 180 ++++++++-------------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 115 -------------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h | 27 ---
10 files changed, 77 insertions(+), 366 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmchip.h b/drivers/staging/brcm80211/brcmfmac/bcmchip.h
index 08729e1..d7d3afd 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmchip.h
+++ b/drivers/staging/brcm80211/brcmfmac/bcmchip.h
@@ -25,5 +25,8 @@
/* ARM Cortex M3 core, ID 0x82a */
#define BCM4329_CORE_ARM_BASE 0x18002000
#define BCM4329_RAMSIZE 0x48000
+/* firmware name */
+#define BCM4329_FW_NAME "brcm/bcm4329-fullmac-4.bin"
+#define BCM4329_NV_NAME "brcm/bcm4329-fullmac-4.txt"
#endif /* _bcmchip_h_ */
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 48527bb..764d839 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -40,8 +40,6 @@ static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func);
static int brcmf_sdioh_get_cisaddr(struct sdioh_info *sd, u32 regaddr);
extern int brcmf_sdioh_reset_comm(struct mmc_card *card);
-extern PBCMSDH_SDMMC_INSTANCE gInstance;
-
uint sd_f2_blocksize = 512; /* Default blocksize */
uint sd_msglevel = 0x01;
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
index 1a6f68a..9c5eee0 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
@@ -133,4 +133,6 @@ typedef struct _BCMSDH_SDMMC_INSTANCE {
u32 host_claimed;
} BCMSDH_SDMMC_INSTANCE, *PBCMSDH_SDMMC_INSTANCE;
+extern PBCMSDH_SDMMC_INSTANCE gInstance;
+
#endif /* __BCMSDH_SDMMC_H__ */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index b11eeee..b2db6b9 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -122,9 +122,6 @@
#define WL_KF_RES_5 (1 << 5) /* Reserved for backward compat */
#define WL_IBSS_PEER_GROUP_KEY (1 << 6) /* Indicates a group key for a IBSS PEER */
-/* optionally set by a module_param_string() */
-#define MOD_PARAM_PATHLEN 2048
-
/* For supporting multiple interfaces */
#define DHD_MAX_IFS 16
#define DHD_DEL_IF -0xe
@@ -819,9 +816,6 @@ extern uint brcmf_pktgen_len;
#define BRCMF_MAX_PKTGEN_LEN 1800
#endif
-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[];
extern const int bcmevent_names_size;
@@ -912,9 +906,6 @@ extern int brcmf_os_ioctl_resp_wait(dhd_pub_t *pub, uint *condition,
extern int brcmf_os_ioctl_resp_wake(dhd_pub_t *pub);
extern unsigned int brcmf_os_get_ioctl_resp_timeout(void);
extern void brcmf_os_set_ioctl_resp_timeout(unsigned int timeout_msec);
-extern void *brcmf_os_open_image(char *filename);
-extern int brcmf_os_get_image_block(char *buf, int len, void *image);
-extern void brcmf_os_close_image(void *image);
extern void brcmf_os_sdlock_sndup_rxq(dhd_pub_t *pub);
extern void brcmf_customer_gpio_wlan_ctrl(int onoff);
extern int brcmf_custom_get_mac_address(unsigned char *buf);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
index 1038ddb..c895b81 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
@@ -36,10 +36,6 @@ extern uint brcmf_watchdog_ms;
extern int dhd_bus_register(void);
extern void dhd_bus_unregister(void);
-/* Download firmware image and nvram image */
-extern bool dhd_bus_download_firmware(struct dhd_bus *bus,
- char *fw_path, char *nv_path);
-
/* Stop bus module: clear pending frames, disable data flow */
extern void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex);
@@ -75,10 +71,6 @@ extern void dhd_bus_clearcounts(dhd_pub_t *dhdp);
/* return the dongle chipid */
extern uint dhd_bus_chip(struct dhd_bus *bus);
-/* Set user-specified nvram parameters. */
-extern void dhd_bus_set_nvram_params(struct dhd_bus *bus,
- const char *nvram_params);
-
extern void *dhd_bus_pub(struct dhd_bus *bus);
extern void *dhd_bus_txq(struct dhd_bus *bus);
extern uint dhd_bus_hdrlen(struct dhd_bus *bus);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 8a32e88..44b8a25 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -33,8 +33,6 @@
#define PKTFILTER_BUF_SIZE 2048
int brcmf_msg_level;
-char brcmf_fw_path[MOD_PARAM_PATHLEN];
-char brcmf_nv_path[MOD_PARAM_PATHLEN];
#define MSGTRACE_VERSION 1
@@ -111,17 +109,6 @@ void brcmf_c_init(void)
* initializations.
*/
brcmf_msg_level = DHD_ERROR_VAL;
-#ifdef CONFIG_BCM4329_FW_PATH
- strncpy(brcmf_fw_path, CONFIG_BCM4329_FW_PATH, MOD_PARAM_PATHLEN - 1);
-#else
- brcmf_fw_path[0] = '\0';
-#endif
-#ifdef CONFIG_BCM4329_NVRAM_PATH
- strncpy(brcmf_nv_path,
- CONFIG_BCM4329_NVRAM_PATH, MOD_PARAM_PATHLEN - 1);
-#else
- brcmf_nv_path[0] = '\0';
-#endif
}
static int brcmf_c_dump(dhd_pub_t *dhdp, char *buf, int buflen)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 2213e4e..4724414 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -42,6 +42,7 @@
#include "dhd_proto.h"
#include "dhd_dbg.h"
#include "wl_cfg80211.h"
+#include "bcmchip.h"
/* Global ASSERT type flag */
u32 g_assert_type;
@@ -96,20 +97,6 @@ typedef struct dhd_info {
#endif /* CONFIG_HAS_EARLYSUSPEND */
} dhd_info_t;
-/* Definitions to provide path to the firmware and nvram
- * example nvram_path[MOD_PARAM_PATHLEN]="/projects/wlan/nvram.txt"
- */
-char firmware_path[MOD_PARAM_PATHLEN];
-char nvram_path[MOD_PARAM_PATHLEN];
-
-/* load firmware and/or nvram values from the filesystem */
-module_param_string(firmware_path, firmware_path, MOD_PARAM_PATHLEN, 0);
-module_param_string(nvram_path, nvram_path, MOD_PARAM_PATHLEN, 0);
-
-/* No firmware required */
-bool brcmf_no_fw_req;
-module_param(brcmf_no_fw_req, bool, 0);
-
/* Error bits */
module_param(brcmf_msg_level, int, 0);
@@ -1080,7 +1067,7 @@ static void brcmf_ethtool_get_drvinfo(struct net_device *net,
sprintf(info->driver, KBUILD_MODNAME);
sprintf(info->version, "%lu", dhd->pub.drv_version);
- sprintf(info->fw_version, "%s", wl_cfg80211_get_fwname());
+ sprintf(info->fw_version, "%s", BCM4329_FW_NAME);
sprintf(info->bus_info, "%s", dev_name(&wl_cfg80211_get_sdio_func()->dev));
}
@@ -1438,12 +1425,6 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
struct net_device *net;
DHD_TRACE(("%s: Enter\n", __func__));
- /* updates firmware nvram path if it was provided as module
- paramters */
- if ((firmware_path != NULL) && (firmware_path[0] != '\0'))
- strcpy(brcmf_fw_path, firmware_path);
- if ((nvram_path != NULL) && (nvram_path[0] != '\0'))
- strcpy(brcmf_nv_path, nvram_path);
/* Allocate etherdev, including space for private structure */
net = alloc_etherdev(sizeof(dhd));
@@ -1503,10 +1484,6 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
DHD_ERROR(("wl_cfg80211_attach failed\n"));
goto fail;
}
- if (!brcmf_no_fw_req) {
- strcpy(brcmf_fw_path, wl_cfg80211_get_fwname());
- strcpy(brcmf_nv_path, wl_cfg80211_get_nvramname());
- }
if (brcmf_sysioc) {
sema_init(&dhd->sysioc_sem, 0);
@@ -1562,17 +1539,6 @@ int brcmf_bus_start(dhd_pub_t *dhdp)
DHD_TRACE(("%s:\n", __func__));
- /* try to download image and nvram to the dongle */
- if (dhd->pub.busstate == DHD_BUS_DOWN) {
- 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__, brcmf_fw_path, brcmf_nv_path));
- return -1;
- }
- }
-
/* Bring up the bus */
ret = brcmf_sdbrcm_bus_init(&dhd->pub, true);
if (ret != 0) {
@@ -1881,52 +1847,6 @@ int brcmf_os_ioctl_resp_wake(dhd_pub_t *pub)
return 0;
}
-void *brcmf_os_open_image(char *filename)
-{
- struct file *fp;
-
- if (!brcmf_no_fw_req)
- return wl_cfg80211_request_fw(filename);
-
- fp = filp_open(filename, O_RDONLY, 0);
- /*
- * 2.6.11 (FC4) supports filp_open() but later revs don't?
- * Alternative:
- * fp = open_namei(AT_FDCWD, filename, O_RD, 0);
- * ???
- */
- if (IS_ERR(fp))
- fp = NULL;
-
- return fp;
-}
-
-int brcmf_os_get_image_block(char *buf, int len, void *image)
-{
- struct file *fp = (struct file *)image;
- int rdlen;
-
- if (!brcmf_no_fw_req)
- return wl_cfg80211_read_fw(buf, len);
-
- if (!image)
- return 0;
-
- rdlen = kernel_read(fp, fp->f_pos, buf, len);
- if (rdlen > 0)
- fp->f_pos += rdlen;
-
- return rdlen;
-}
-
-void brcmf_os_close_image(void *image)
-{
- if (!brcmf_no_fw_req)
- return wl_cfg80211_release_fw();
- if (image)
- filp_close((struct file *)image, NULL);
-}
-
static int brcmf_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
brcmf_event_msg_t *event, void **data)
{
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index d64ba7b..a4d30c7 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -22,6 +22,8 @@
#include <linux/netdevice.h>
#include <linux/sched.h>
#include <linux/mmc/sdio.h>
+#include <linux/mmc/sdio_func.h>
+#include <linux/firmware.h>
#include <asm/unaligned.h>
#include <defs.h>
#include <brcmu_wifi.h>
@@ -29,6 +31,8 @@
#include <brcm_hw_ids.h>
#include <soc.h>
#include "sdio_host.h"
+#include "bcmsdbus.h"
+#include "bcmsdh_sdmmc.h"
/* register access macros */
#ifndef __BIG_ENDIAN
@@ -473,9 +477,6 @@ typedef struct dhd_bus {
bool fcstate; /* State of dongle flow-control */
u16 cl_devid; /* cached devid for brcmf_sdio_probe_attach() */
- char *fw_path; /* module_param: path to firmware image */
- char *nv_path; /* module_param: path to nvram vars file */
- const char *nvram_params; /* user specified nvram params. */
uint blocksize; /* Block size of SDIO transfers */
uint roundup; /* Max roundup limit */
@@ -601,6 +602,11 @@ typedef struct dhd_bus {
bool threads_only;
struct semaphore sdsem;
spinlock_t sdlock;
+
+ const char *fw_name;
+ const struct firmware *firmware;
+ const char *nv_name;
+ u32 fw_ptr;
} dhd_bus_t;
typedef volatile struct _sbconfig {
@@ -804,8 +810,7 @@ static int brcmf_sdbrcm_send_buf(dhd_bus_t *bus, u32 addr, uint fn,
static bool brcmf_sdbrcm_download_firmware(struct dhd_bus *bus, void *sdh);
static int _brcmf_sdbrcm_download_firmware(struct dhd_bus *bus);
-static int
-brcmf_sdbrcm_download_code_file(struct dhd_bus *bus, char *image_path);
+static int brcmf_sdbrcm_download_code_file(struct dhd_bus *bus);
static int brcmf_sdbrcm_download_nvram(struct dhd_bus *bus);
static void brcmf_sdbrcm_chip_disablecore(struct brcmf_sdio *sdh, u32 corebase);
static int brcmf_sdbrcm_chip_attach(struct dhd_bus *bus, void *regs);
@@ -822,6 +827,7 @@ static void brcmf_sdbrcm_dpc_tasklet(unsigned long data);
static void brcmf_sdbrcm_sched_dpc(dhd_bus_t *bus);
static void brcmf_sdbrcm_sdlock(dhd_bus_t *bus);
static void brcmf_sdbrcm_sdunlock(dhd_bus_t *bus);
+static int brcmf_sdbrcm_get_image(char *buf, int len, struct dhd_bus *bus);
/* Packet free applicable unconditionally for sdio and sdspi.
* Conditional if bufpool was present for gspi bus.
@@ -3130,6 +3136,12 @@ int brcmf_sdbrcm_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
DHD_TRACE(("%s: Enter\n", __func__));
+ /* try to download image and nvram to the dongle */
+ if (dhdp->busstate == DHD_BUS_DOWN) {
+ if (!(brcmf_sdbrcm_download_firmware(bus, bus->sdh)))
+ return -1;
+ }
+
ASSERT(bus->dhd);
if (!bus->dhd)
return 0;
@@ -5606,18 +5618,6 @@ static bool brcmf_sdbrcm_probe_init(dhd_bus_t *bus, void *sdh)
return true;
}
-bool
-dhd_bus_download_firmware(struct dhd_bus *bus, char *fw_path, char *nv_path)
-{
- bool ret;
- bus->fw_path = fw_path;
- bus->nv_path = nv_path;
-
- ret = brcmf_sdbrcm_download_firmware(bus, bus->sdh);
-
- return ret;
-}
-
static bool
brcmf_sdbrcm_download_firmware(struct dhd_bus *bus, void *sdh)
{
@@ -5744,24 +5744,29 @@ void dhd_bus_unregister(void)
brcmf_sdio_unregister();
}
-static int brcmf_sdbrcm_download_code_file(struct dhd_bus *bus, char *fw_path)
+static int brcmf_sdbrcm_download_code_file(struct dhd_bus *bus)
{
- int bcmerror = -1;
int offset = 0;
uint len;
- void *image = NULL;
u8 *memblock = NULL, *memptr;
+ int ret;
- DHD_INFO(("%s: download firmware %s\n", __func__, brcmf_fw_path));
+ DHD_INFO(("%s: Enter\n", __func__));
- image = brcmf_os_open_image(fw_path);
- if (image == NULL)
- goto err;
+ bus->fw_name = BCM4329_FW_NAME;
+ ret = request_firmware(&bus->firmware, bus->fw_name,
+ &gInstance->func[2]->dev);
+ if (ret) {
+ DHD_ERROR(("%s: Fail to request firmware %d\n", __func__, ret));
+ return ret;
+ }
+ bus->fw_ptr = 0;
memptr = memblock = kmalloc(MEMBLOCK + BRCMF_SDALIGN, GFP_ATOMIC);
if (memblock == NULL) {
DHD_ERROR(("%s: Failed to allocate memory %d bytes\n",
__func__, MEMBLOCK));
+ ret = -ENOMEM;
goto err;
}
if ((u32)(unsigned long)memblock % BRCMF_SDALIGN)
@@ -5770,12 +5775,11 @@ static int brcmf_sdbrcm_download_code_file(struct dhd_bus *bus, char *fw_path)
/* Download image */
while ((len =
- brcmf_os_get_image_block((char *)memptr, MEMBLOCK, image))) {
- bcmerror = brcmf_sdbrcm_membytes(bus, true, offset, memptr,
- len);
- if (bcmerror) {
+ brcmf_sdbrcm_get_image((char *)memptr, MEMBLOCK, bus))) {
+ ret = brcmf_sdbrcm_membytes(bus, true, offset, memptr, len);
+ if (ret) {
DHD_ERROR(("%s: error %d on writing %d membytes at "
- "0x%08x\n", __func__, bcmerror, MEMBLOCK, offset));
+ "0x%08x\n", __func__, ret, MEMBLOCK, offset));
goto err;
}
@@ -5785,10 +5789,10 @@ static int brcmf_sdbrcm_download_code_file(struct dhd_bus *bus, char *fw_path)
err:
kfree(memblock);
- if (image)
- brcmf_os_close_image(image);
+ release_firmware(bus->firmware);
+ bus->fw_ptr = 0;
- return bcmerror;
+ return ret;
}
/*
@@ -5842,66 +5846,31 @@ static uint brcmf_process_nvram_vars(char *varbuf, uint len)
return buf_len;
}
-/*
- EXAMPLE: nvram_array
- nvram_arry format:
- name=value
- Use carriage return at the end of each assignment,
- and an empty string with
- carriage return at the end of array.
-
- For example:
- unsigned char nvram_array[] = {"name1=value1\n",
- "name2=value2\n", "\n"};
- Hex values start with 0x, and mac addr format: xx:xx:xx:xx:xx:xx.
-
- Search "EXAMPLE: nvram_array" to see how the array is activated.
-*/
-
-void dhd_bus_set_nvram_params(struct dhd_bus *bus, const char *nvram_params)
-{
- bus->nvram_params = nvram_params;
-}
-
static int brcmf_sdbrcm_download_nvram(struct dhd_bus *bus)
{
- int bcmerror = -1;
uint len;
- void *image = NULL;
char *memblock = NULL;
char *bufp;
- char *nv_path;
- bool nvram_file_exists;
-
- nv_path = bus->nv_path;
-
- nvram_file_exists = ((nv_path != NULL) && (nv_path[0] != '\0'));
- if (!nvram_file_exists && (bus->nvram_params == NULL))
- return 0;
+ int ret;
- if (nvram_file_exists) {
- image = brcmf_os_open_image(nv_path);
- if (image == NULL)
- goto err;
+ bus->nv_name = BCM4329_NV_NAME;
+ ret = request_firmware(&bus->firmware, bus->nv_name,
+ &gInstance->func[2]->dev);
+ if (ret) {
+ DHD_ERROR(("%s: Fail to request nvram %d\n", __func__, ret));
+ return ret;
}
+ bus->fw_ptr = 0;
memblock = kmalloc(MEMBLOCK, GFP_ATOMIC);
if (memblock == NULL) {
DHD_ERROR(("%s: Failed to allocate memory %d bytes\n",
__func__, MEMBLOCK));
+ ret = -ENOMEM;
goto err;
}
- /* Download variables */
- if (nvram_file_exists) {
- len = brcmf_os_get_image_block(memblock, MEMBLOCK, image);
- } else {
- len = strlen(bus->nvram_params);
- ASSERT(len <= MEMBLOCK);
- if (len > MEMBLOCK)
- len = MEMBLOCK;
- memcpy(memblock, bus->nvram_params, len);
- }
+ len = brcmf_sdbrcm_get_image(memblock, MEMBLOCK, bus);
if (len > 0 && len < MEMBLOCK) {
bufp = (char *)memblock;
@@ -5910,38 +5879,29 @@ static int brcmf_sdbrcm_download_nvram(struct dhd_bus *bus)
bufp += len;
*bufp++ = 0;
if (len)
- bcmerror = brcmf_sdbrcm_downloadvars(bus, memblock,
- len + 1);
- if (bcmerror) {
+ ret = brcmf_sdbrcm_downloadvars(bus, memblock, len + 1);
+ if (ret)
DHD_ERROR(("%s: error downloading vars: %d\n",
- __func__, bcmerror));
- }
+ __func__, ret));
} else {
DHD_ERROR(("%s: error reading nvram file: %d\n",
__func__, len));
- bcmerror = -EIO;
+ ret = -EIO;
}
err:
kfree(memblock);
- if (image)
- brcmf_os_close_image(image);
+ release_firmware(bus->firmware);
+ bus->fw_ptr = 0;
- return bcmerror;
+ return ret;
}
static int _brcmf_sdbrcm_download_firmware(struct dhd_bus *bus)
{
int bcmerror = -1;
- bool embed = false; /* download embedded firmware */
- bool dlok = false; /* download firmware succeeded */
-
- /* Out immediately if no image to download */
- if ((bus->fw_path == NULL) || (bus->fw_path[0] == '\0'))
- return bcmerror;
-
/* Keep arm in reset */
if (brcmf_sdbrcm_download_state(bus, true)) {
DHD_ERROR(("%s: error placing ARM core in reset\n", __func__));
@@ -5949,18 +5909,9 @@ static int _brcmf_sdbrcm_download_firmware(struct dhd_bus *bus)
}
/* External image takes precedence if specified */
- if ((bus->fw_path != NULL) && (bus->fw_path[0] != '\0')) {
- if (brcmf_sdbrcm_download_code_file(bus, bus->fw_path)) {
- DHD_ERROR(("%s: dongle image file download failed\n",
- __func__));
- goto err;
- } else {
- embed = false;
- dlok = true;
- }
- }
- if (!dlok) {
- DHD_ERROR(("%s: dongle image download failed\n", __func__));
+ if (brcmf_sdbrcm_download_code_file(bus)) {
+ DHD_ERROR(("%s: dongle image file download failed\n",
+ __func__));
goto err;
}
@@ -6061,11 +6012,7 @@ int brcmf_bus_devreset(dhd_pub_t *dhdp, u8 flag)
(u32 *) SI_ENUM_BASE,
bus->cl_devid)) {
/* Attempt to download binary to the dongle */
- if (brcmf_sdbrcm_probe_init
- (bus, bus->sdh)
- && brcmf_sdbrcm_download_firmware(bus,
- bus->sdh)) {
-
+ if (brcmf_sdbrcm_probe_init(bus, bus->sdh)) {
/* Re-init bus, enable F2 transfer */
brcmf_sdbrcm_bus_init(
(dhd_pub_t *) bus->dhd, false);
@@ -6669,3 +6616,16 @@ static void brcmf_sdbrcm_sdunlock(dhd_bus_t *bus)
else
spin_unlock_bh(&bus->sdlock);
}
+
+static int brcmf_sdbrcm_get_image(char *buf, int len, struct dhd_bus *bus)
+{
+ if (bus->firmware->size < bus->fw_ptr + len)
+ len = bus->firmware->size - bus->fw_ptr;
+
+ memcpy(buf, &bus->firmware->data[bus->fw_ptr], len);
+ bus->fw_ptr += len;
+ return len;
+}
+
+MODULE_FIRMWARE(BCM4329_FW_NAME);
+MODULE_FIRMWARE(BCM4329_NV_NAME);
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index a3c2e87..9d86fc1 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -24,7 +24,6 @@
#include <linux/wireless.h>
#include <linux/ieee80211.h>
#include <linux/mmc/sdio_func.h>
-#include <linux/firmware.h>
#include <linux/uaccess.h>
#include <net/cfg80211.h>
#include <net/rtnetlink.h>
@@ -42,9 +41,6 @@ static const u8 ether_bcast[ETH_ALEN] = {255, 255, 255, 255, 255, 255};
u32 brcmf_dbg_level = WL_DBG_ERR;
-#define WL_4329_FW_FILE "brcm/bcm4329-fullmac-4.bin"
-#define WL_4329_NVRAM_FILE "brcm/bcm4329-fullmac-4.txt"
-
/*
** cfg80211_ops api/callback list
*/
@@ -283,11 +279,6 @@ static s32 wl_iscan_inprogress(struct wl_priv *wl);
static s32 wl_iscan_aborted(struct wl_priv *wl);
/*
-** fw/nvram downloading handler
-*/
-static void wl_init_fw(struct wl_fw_ctrl *fw);
-
-/*
* find most significant bit set
*/
static __used u32 wl_find_msb(u16 bit16);
@@ -3061,11 +3052,6 @@ static s32 wl_init_priv_mem(struct wl_priv *wl)
WL_ERR("Iscan buf alloc failed\n");
goto init_priv_mem_out;
}
- wl->fw = kzalloc(sizeof(*wl->fw), GFP_KERNEL);
- if (unlikely(!wl->fw)) {
- WL_ERR("fw object alloc failed\n");
- goto init_priv_mem_out;
- }
wl->pmk_list = kzalloc(sizeof(*wl->pmk_list), GFP_KERNEL);
if (unlikely(!wl->pmk_list)) {
WL_ERR("pmk list alloc failed\n");
@@ -3098,8 +3084,6 @@ static void wl_deinit_priv_mem(struct wl_priv *wl)
wl->extra_buf = NULL;
kfree(wl->iscan);
wl->iscan = NULL;
- kfree(wl->fw);
- wl->fw = NULL;
kfree(wl->pmk_list);
wl->pmk_list = NULL;
}
@@ -3361,12 +3345,6 @@ static s32 wl_init_iscan(struct wl_priv *wl)
return err;
}
-static void wl_init_fw(struct wl_fw_ctrl *fw)
-{
- fw->status = 0; /* init fw loading status.
- 0 means nothing was loaded yet */
-}
-
static s32 wl_init_priv(struct wl_priv *wl)
{
struct wiphy *wiphy = wl_to_wiphy(wl);
@@ -3394,7 +3372,6 @@ static s32 wl_init_priv(struct wl_priv *wl)
err = wl_init_iscan(wl);
if (unlikely(err))
return err;
- wl_init_fw(wl->fw);
wl_init_conf(wl->conf);
wl_init_prof(wl->profile);
wl_link_down(wl);
@@ -4066,98 +4043,6 @@ static void *wl_get_drvdata(struct wl_dev *dev)
return data;
}
-s32 wl_cfg80211_read_fw(s8 *buf, u32 size)
-{
- const struct firmware *fw_entry;
- struct wl_priv *wl;
-
- wl = WL_PRIV_GET();
-
- fw_entry = wl->fw->fw_entry;
-
- if (fw_entry->size < wl->fw->ptr + size)
- size = fw_entry->size - wl->fw->ptr;
-
- memcpy(buf, &fw_entry->data[wl->fw->ptr], size);
- wl->fw->ptr += size;
- return size;
-}
-
-void wl_cfg80211_release_fw(void)
-{
- struct wl_priv *wl;
-
- wl = WL_PRIV_GET();
- release_firmware(wl->fw->fw_entry);
- wl->fw->ptr = 0;
-}
-
-void *wl_cfg80211_request_fw(s8 *file_name)
-{
- struct wl_priv *wl;
- const struct firmware *fw_entry = NULL;
- s32 err = 0;
-
- WL_INFO("file name : \"%s\"\n", file_name);
- wl = WL_PRIV_GET();
-
- if (!test_bit(WL_FW_LOADING_DONE, &wl->fw->status)) {
- err = request_firmware(&wl->fw->fw_entry, file_name,
- &wl_cfg80211_get_sdio_func()->dev);
- if (unlikely(err)) {
- WL_ERR("Could not download fw (%d)\n", err);
- goto req_fw_out;
- }
- set_bit(WL_FW_LOADING_DONE, &wl->fw->status);
- fw_entry = wl->fw->fw_entry;
- if (fw_entry) {
- WL_INFO("fw size (%zd), data (%p)\n",
- fw_entry->size, fw_entry->data);
- }
- } else if (!test_bit(WL_NVRAM_LOADING_DONE, &wl->fw->status)) {
- err = request_firmware(&wl->fw->fw_entry, file_name,
- &wl_cfg80211_get_sdio_func()->dev);
- if (unlikely(err)) {
- WL_ERR("Could not download nvram (%d)\n", err);
- goto req_fw_out;
- }
- set_bit(WL_NVRAM_LOADING_DONE, &wl->fw->status);
- fw_entry = wl->fw->fw_entry;
- if (fw_entry) {
- WL_INFO("nvram size (%zd), data (%p)\n",
- fw_entry->size, fw_entry->data);
- }
- } else {
- WL_INFO("Downloading already done. Nothing to do more\n");
- err = -EPERM;
- }
-
-req_fw_out:
- if (unlikely(err)) {
- return NULL;
- }
- wl->fw->ptr = 0;
- return (void *)fw_entry->data;
-}
-
-s8 *wl_cfg80211_get_fwname(void)
-{
- struct wl_priv *wl;
-
- wl = WL_PRIV_GET();
- strcpy(wl->fw->fw_name, WL_4329_FW_FILE);
- return wl->fw->fw_name;
-}
-
-s8 *wl_cfg80211_get_nvramname(void)
-{
- struct wl_priv *wl;
-
- wl = WL_PRIV_GET();
- strcpy(wl->fw->nvram_name, WL_4329_NVRAM_FILE);
- return wl->fw->nvram_name;
-}
-
static void wl_set_mpc(struct net_device *ndev, int mpc)
{
s32 err = 0;
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
index bc7b4a3..7848b3c 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
@@ -116,7 +116,6 @@ do { \
#define WL_AP_MAX 256 /* virtually unlimitted as long
* as kernel memory allows
*/
-#define WL_FILE_NAME_MAX 256
#define WL_ROAM_TRIGGER_LEVEL -75
#define WL_ROAM_DELTA 20
@@ -161,12 +160,6 @@ enum wl_iscan_state {
WL_ISCAN_STATE_SCANING
};
-/* fw downloading status */
-enum wl_fw_status {
- WL_FW_LOADING_DONE,
- WL_NVRAM_LOADING_DONE
-};
-
/* beacon / probe_response */
struct beacon_proberesp {
__le64 timestamp;
@@ -288,15 +281,6 @@ struct wl_connect_info {
s32 resp_ie_len;
};
-/* firmware /nvram downloading controller */
-struct wl_fw_ctrl {
- const struct firmware *fw_entry;
- unsigned long status;
- u32 ptr;
- s8 fw_name[WL_FILE_NAME_MAX];
- s8 nvram_name[WL_FILE_NAME_MAX];
-};
-
/* assoc ie length */
struct wl_assoc_ielen {
u32 req_len;
@@ -334,8 +318,6 @@ struct wl_priv {
struct wl_iscan_ctrl *iscan; /* iscan controller */
struct wl_connect_info conn_info; /* association information
container */
- struct wl_fw_ctrl *fw; /* control firwmare / nvram paramter
- downloading */
struct wl_pmk_list *pmk_list; /* wpa2 pmk list */
struct task_struct *event_tsk; /* task of main event handler thread */
unsigned long status; /* current dongle status */
@@ -395,13 +377,4 @@ extern s32 wl_cfg80211_up(void); /* dongle up */
extern s32 wl_cfg80211_down(void); /* dongle down */
extern void wl_cfg80211_dbg_level(u32 level); /* set dongle
debugging level */
-extern void *wl_cfg80211_request_fw(s8 *file_name); /* request fw /nvram
- downloading */
-extern s32 wl_cfg80211_read_fw(s8 *buf, u32 size); /* read fw
- image */
-extern void wl_cfg80211_release_fw(void); /* release fw */
-extern s8 *wl_cfg80211_get_fwname(void); /* get firmware name for
- the dongle */
-extern s8 *wl_cfg80211_get_nvramname(void); /* get nvram name for
- the dongle */
#endif /* _wl_cfg80211_h_ */
--
1.7.1
From: Arend van Spriel <[email protected]>
The fullmac version macro has been renamed and moved to dhd.h to
get rid of having it defined in two separate c source files.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 2 ++
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 5 ++---
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 3 +--
3 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 87c65f1..7e19d80 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -21,6 +21,8 @@
#ifndef _dhd_h_
#define _dhd_h_
+#define BRCMF_VERSION_STR "4.218.248.5"
+
#define BRCMF_C_IOCTL_SMLEN 256 /* "small" ioctl buffer required */
#define BRCMF_C_IOCTL_MEDLEN 1536 /* "med" ioctl buffer required */
#define BRCMF_C_IOCTL_MAXLEN 8192
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 22739f0..5207fa9 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -36,15 +36,14 @@ int brcmf_msg_level;
char brcmf_fw_path[MOD_PARAM_PATHLEN];
char brcmf_nv_path[MOD_PARAM_PATHLEN];
-#define EPI_VERSION_STR "4.218.248.5"
#define MSGTRACE_VERSION 1
#ifdef BCMDBG
const char brcmf_version[] =
-"Dongle Host Driver, version " EPI_VERSION_STR "\nCompiled on " __DATE__
+"Dongle Host Driver, version " BRCMF_VERSION_STR "\nCompiled on " __DATE__
" at " __TIME__;
#else
-const char brcmf_version[] = "Dongle Host Driver, version " EPI_VERSION_STR;
+const char brcmf_version[] = "Dongle Host Driver, version " BRCMF_VERSION_STR;
#endif
/* IOVar table */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 5327941..19e09bd 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -43,7 +43,6 @@
#include "dhd_dbg.h"
#include "wl_cfg80211.h"
-#define EPI_VERSION_STR "4.218.248.5"
#define ETH_P_BRCM 0x886c
/* Global ASSERT type flag */
@@ -1278,7 +1277,7 @@ static int brcmf_ethtool(dhd_info_t *dhd, void *uaddr)
/* if dhd requested, identify ourselves */
if (strcmp(drvname, "?dhd") == 0) {
sprintf(info.driver, "dhd");
- strcpy(info.version, EPI_VERSION_STR);
+ strcpy(info.version, BRCMF_VERSION_STR);
}
/* otherwise, require dongle to be up */
--
1.7.1
Hi Henry,
On Thu, 2011-06-30 at 10:42 -0700, Henry Ptasinski wrote:
> On 06/29/2011 11:29 PM, Rafał Miłecki wrote:
> > 2011/6/30 Franky Lin<[email protected]>:
> >> Most of these patches are brcmfmac cleanup.
> >
> >
> > Hm, interesting improvement in your "Release early, release often" strategy.
> >
>
> Yea, we were waiting for the previous series to get applied. Not sure
> how to make this work better. Any process suggestions would be appreciated.
Keep sending them in small batches, I think it is just normal to apply
the batches one after the other, no need to keep waiting. If there are
no conflicts, everything should go smoothly. And if it doesn't, someone
will ping you. ;)
--
Cheers,
Luca.
From: Arend van Spriel <[email protected]>
The macro definition DRV_MODULE_NAME has exactly the same value as
KBUILD_MODNAME so using that instead now.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index dfbbda7..d09706b 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -180,8 +180,6 @@ MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN fullmac driver.");
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>
@@ -1490,7 +1488,7 @@ static void dhd_ethtool_get_drvinfo(struct net_device *net,
{
dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
- sprintf(info->driver, DRV_MODULE_NAME);
+ sprintf(info->driver, KBUILD_MODNAME);
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));
--
1.7.1
From: Roland Vossen <[email protected]>
Gave struct brcmf_sdio the more applicable name 'brcmf_sdio_card'. Enforced
stronger type checking by replacing void *sdh by struct brcmf_sdio_card *.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h | 2 +-
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 141 +++----
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c | 20 +-
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 423 +++++++++++----------
drivers/staging/brcm80211/brcmfmac/sdio_host.h | 101 +++--
5 files changed, 345 insertions(+), 342 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
index 9359bba..ee01e48 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
@@ -105,7 +105,7 @@ extern int brcmf_sdioh_stop(struct sdioh_info *si);
extern int brcmf_sdioh_reset(struct sdioh_info *si);
/* Helper function */
-void *brcmf_sdcard_get_sdioh(struct brcmf_sdio *sdh);
+void *brcmf_sdcard_get_sdioh(struct brcmf_sdio_card *card);
/* Watchdog timer interface for pm ops */
extern void brcmf_sdio_wdtmr_enable(bool enable);
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
index 5eb95b2..4c7e4a9 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
@@ -13,7 +13,7 @@
* OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-/* ****************** SDIOCARD Interface Functions ***************************/
+/* ****************** SDIO CARD Interface Functions **************************/
#include <linux/types.h>
#include <linux/netdevice.h>
@@ -33,7 +33,7 @@
#define SDIOH_API_ACCESS_RETRY_LIMIT 2
const uint brcmf_sdio_msglevel = BRCMF_SD_ERROR_VAL;
-struct brcmf_sdio {
+struct brcmf_sdio_card {
bool init_success; /* underlying driver successfully attached */
void *sdioh; /* handler for sdioh */
u32 vendevid; /* Target Vendor and Device ID on SD bus */
@@ -42,13 +42,14 @@ struct brcmf_sdio {
u32 sbwad; /* Save backplane window address */
};
/* local copy of bcm sd handler */
-static struct brcmf_sdio *l_card;
+static struct brcmf_sdio_card *l_card;
-struct brcmf_sdio *brcmf_sdcard_attach(void *cfghdl, void **regsva, uint irq)
+struct brcmf_sdio_card*
+brcmf_sdcard_attach(void *cfghdl, void **regsva, uint irq)
{
- struct brcmf_sdio *card;
+ struct brcmf_sdio_card *card;
- card = kzalloc(sizeof(struct brcmf_sdio), GFP_ATOMIC);
+ card = kzalloc(sizeof(struct brcmf_sdio_card), GFP_ATOMIC);
if (card == NULL) {
BRCMF_SD_ERROR(("sdcard_attach: out of memory"));
return NULL;
@@ -72,10 +73,8 @@ struct brcmf_sdio *brcmf_sdcard_attach(void *cfghdl, void **regsva, uint irq)
return card;
}
-int brcmf_sdcard_detach(void *sdh)
+int brcmf_sdcard_detach(struct brcmf_sdio_card *card)
{
- struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
-
if (card != NULL) {
if (card->sdioh) {
brcmf_sdioh_detach(card->sdioh);
@@ -89,17 +88,15 @@ int brcmf_sdcard_detach(void *sdh)
}
int
-brcmf_sdcard_iovar_op(void *sdh, const char *name,
+brcmf_sdcard_iovar_op(struct brcmf_sdio_card *card, const char *name,
void *params, int plen, void *arg, int len, bool set)
{
- struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
return brcmf_sdioh_iovar_op(card->sdioh, name, params, plen, arg,
len, set);
}
-bool brcmf_sdcard_intr_query(void *sdh)
+bool brcmf_sdcard_intr_query(struct brcmf_sdio_card *card)
{
- struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
int status;
bool on;
@@ -111,59 +108,57 @@ bool brcmf_sdcard_intr_query(void *sdh)
return on;
}
-int brcmf_sdcard_intr_enable(void *sdh)
+int brcmf_sdcard_intr_enable(struct brcmf_sdio_card *card)
{
- struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
ASSERT(card);
return brcmf_sdioh_interrupt_set(card->sdioh, true);
}
-int brcmf_sdcard_intr_disable(void *sdh)
+int brcmf_sdcard_intr_disable(struct brcmf_sdio_card *card)
{
- struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
ASSERT(card);
return brcmf_sdioh_interrupt_set(card->sdioh, false);
}
-int brcmf_sdcard_intr_reg(void *sdh, brcmf_sdiocard_cb_fn_t fn, void *argh)
+int brcmf_sdcard_intr_reg(struct brcmf_sdio_card *card,
+ brcmf_sdiocard_cb_fn_t fn,
+ void *argh)
{
- struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
ASSERT(card);
return brcmf_sdioh_interrupt_register(card->sdioh, fn, argh);
}
-int brcmf_sdcard_intr_dereg(void *sdh)
+int brcmf_sdcard_intr_dereg(struct brcmf_sdio_card *card)
{
- struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
ASSERT(card);
return brcmf_sdioh_interrupt_deregister(card->sdioh);
}
#if defined(BCMDBG)
-bool brcmf_sdcard_intr_pending(void *sdh)
+bool brcmf_sdcard_intr_pending(struct brcmf_sdio_card *card)
{
- struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
-
- ASSERT(sdh);
+ ASSERT(card);
return brcmf_sdioh_interrupt_pending(card->sdioh);
}
#endif
-int brcmf_sdcard_devremove_reg(void *sdh, brcmf_sdiocard_cb_fn_t fn, void *argh)
+int brcmf_sdcard_devremove_reg(struct brcmf_sdio_card *card,
+ brcmf_sdiocard_cb_fn_t fn,
+ void *argh)
{
- ASSERT(sdh);
+ ASSERT(card);
/* don't support yet */
return -ENOTSUPP;
}
-u8 brcmf_sdcard_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
+u8 brcmf_sdcard_cfg_read(struct brcmf_sdio_card *card, uint fnc_num, u32 addr,
+ int *err)
{
- struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
int status;
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
s32 retry = 0;
@@ -197,9 +192,9 @@ u8 brcmf_sdcard_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
}
void
-brcmf_sdcard_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
+brcmf_sdcard_cfg_write(struct brcmf_sdio_card *card, uint fnc_num, u32 addr,
+ u8 data, int *err)
{
- struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
int status;
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
s32 retry = 0;
@@ -229,9 +224,9 @@ brcmf_sdcard_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
__func__, fnc_num, addr, data));
}
-u32 brcmf_sdcard_cfg_read_word(void *sdh, uint fnc_num, u32 addr, int *err)
+u32 brcmf_sdcard_cfg_read_word(struct brcmf_sdio_card *card, uint fnc_num,
+ u32 addr, int *err)
{
- struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
int status;
u32 data = 0;
@@ -253,10 +248,9 @@ u32 brcmf_sdcard_cfg_read_word(void *sdh, uint fnc_num, u32 addr, int *err)
}
void
-brcmf_sdcard_cfg_write_word(void *sdh, uint fnc_num, u32 addr, u32 data,
- int *err)
+brcmf_sdcard_cfg_write_word(struct brcmf_sdio_card *card, uint fnc_num,
+ u32 addr, u32 data, int *err)
{
- struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
int status;
if (!card)
@@ -275,9 +269,9 @@ brcmf_sdcard_cfg_write_word(void *sdh, uint fnc_num, u32 addr, u32 data,
__func__, fnc_num, addr, data));
}
-int brcmf_sdcard_cis_read(void *sdh, uint func, u8 * cis, uint length)
+int brcmf_sdcard_cis_read(struct brcmf_sdio_card *card, uint func, u8 * cis,
+ uint length)
{
- struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
int status;
u8 *tmp_buf, *tmp_ptr;
@@ -315,10 +309,10 @@ int brcmf_sdcard_cis_read(void *sdh, uint func, u8 * cis, uint length)
return status;
}
-static int brcmf_sdcard_set_sbaddr_window(void *sdh, u32 address)
+static int
+brcmf_sdcard_set_sbaddr_window(struct brcmf_sdio_card *card, u32 address)
{
int err = 0;
- struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
brcmf_sdcard_cfg_write(card, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRLOW,
(address >> 8) & SBSDIO_SBADDRLOW_MASK, &err);
if (!err)
@@ -335,9 +329,8 @@ static int brcmf_sdcard_set_sbaddr_window(void *sdh, u32 address)
return err;
}
-u32 brcmf_sdcard_reg_read(void *sdh, u32 addr, uint size)
+u32 brcmf_sdcard_reg_read(struct brcmf_sdio_card *card, u32 addr, uint size)
{
- struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
int status;
u32 word = 0;
uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
@@ -388,9 +381,9 @@ u32 brcmf_sdcard_reg_read(void *sdh, u32 addr, uint size)
return 0xFFFFFFFF;
}
-u32 brcmf_sdcard_reg_write(void *sdh, u32 addr, uint size, u32 data)
+u32 brcmf_sdcard_reg_write(struct brcmf_sdio_card *card, u32 addr, uint size,
+ u32 data)
{
- struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
int status;
uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
int err = 0;
@@ -427,15 +420,16 @@ u32 brcmf_sdcard_reg_write(void *sdh, u32 addr, uint size, u32 data)
return 0xFFFFFFFF;
}
-bool brcmf_sdcard_regfail(void *sdh)
+bool brcmf_sdcard_regfail(struct brcmf_sdio_card *card)
{
- return ((struct brcmf_sdio *) sdh)->regfail;
+ return card->regfail;
}
int
-brcmf_sdcard_recv_buf(struct brcmf_sdio *card, u32 addr, uint fn, uint flags,
- u8 *buf, uint nbytes, struct sk_buff *pkt,
- brcmf_sdio_cmplt_fn_t complete, void *handle)
+brcmf_sdcard_recv_buf(struct brcmf_sdio_card *card, u32 addr, uint fn,
+ uint flags,
+ u8 *buf, uint nbytes, struct sk_buff *pkt,
+ brcmf_sdio_cmplt_fn_t complete, void *handle)
{
int status;
uint incr_fix;
@@ -476,11 +470,10 @@ brcmf_sdcard_recv_buf(struct brcmf_sdio *card, u32 addr, uint fn, uint flags,
}
int
-brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags,
- u8 *buf, uint nbytes, void *pkt,
- brcmf_sdio_cmplt_fn_t complete, void *handle)
+brcmf_sdcard_send_buf(struct brcmf_sdio_card *card, u32 addr, uint fn,
+ uint flags, u8 *buf, uint nbytes, void *pkt,
+ brcmf_sdio_cmplt_fn_t complete, void *handle)
{
- struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
uint incr_fix;
uint width;
uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
@@ -516,10 +509,9 @@ brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags,
incr_fix, SDIOH_WRITE, fn, addr, width, nbytes, buf, pkt);
}
-int brcmf_sdcard_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes)
+int brcmf_sdcard_rwdata(struct brcmf_sdio_card *card, uint rw, u32 addr,
+ u8 *buf, uint nbytes)
{
- struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
-
ASSERT(card);
ASSERT(card->init_success);
ASSERT((addr & SBSDIO_SBWINDOW_MASK) == 0);
@@ -532,74 +524,61 @@ int brcmf_sdcard_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes)
addr, 4, nbytes, buf, NULL);
}
-int brcmf_sdcard_abort(void *sdh, uint fn)
+int brcmf_sdcard_abort(struct brcmf_sdio_card *card, uint fn)
{
- struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
-
return brcmf_sdioh_abort(card->sdioh, fn);
}
-int brcmf_sdcard_start(void *sdh, int stage)
+int brcmf_sdcard_start(struct brcmf_sdio_card *card, int stage)
{
- struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
-
return brcmf_sdioh_start(card->sdioh, stage);
}
-int brcmf_sdcard_stop(void *sdh)
+int brcmf_sdcard_stop(struct brcmf_sdio_card *card)
{
- struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
-
return brcmf_sdioh_stop(card->sdioh);
}
-int brcmf_sdcard_query_device(void *sdh)
+int brcmf_sdcard_query_device(struct brcmf_sdio_card *card)
{
- struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
card->vendevid = (PCI_VENDOR_ID_BROADCOM << 16) | 0;
return card->vendevid;
}
-uint brcmf_sdcard_query_iofnum(void *sdh)
+uint brcmf_sdcard_query_iofnum(struct brcmf_sdio_card *card)
{
- struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
-
if (!card)
card = l_card;
return brcmf_sdioh_query_iofnum(card->sdioh);
}
-int brcmf_sdcard_reset(struct brcmf_sdio *sdh)
+int brcmf_sdcard_reset(struct brcmf_sdio_card *card)
{
- struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
-
return brcmf_sdioh_reset(card->sdioh);
}
-void *brcmf_sdcard_get_sdioh(struct brcmf_sdio *sdh)
+void *brcmf_sdcard_get_sdioh(struct brcmf_sdio_card *card)
{
- ASSERT(sdh);
- return sdh->sdioh;
+ ASSERT(card);
+ return card->sdioh;
}
/* Function to pass device-status bits to DHD. */
-u32 brcmf_sdcard_get_dstatus(void *sdh)
+u32 brcmf_sdcard_get_dstatus(struct brcmf_sdio_card *card)
{
return 0;
}
-u32 brcmf_sdcard_cur_sbwad(void *sdh)
+u32 brcmf_sdcard_cur_sbwad(struct brcmf_sdio_card *card)
{
- struct brcmf_sdio *card = (struct brcmf_sdio *) sdh;
-
if (!card)
card = l_card;
return card->sbwad;
}
-void brcmf_sdcard_chipinfo(void *sdh, u32 chip, u32 chiprev)
+void brcmf_sdcard_chipinfo(struct brcmf_sdio_card *card, u32 chip, u32 chiprev)
{
return;
}
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
index a3cf05f..fe875e8 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
@@ -42,7 +42,7 @@ struct sdio_hc {
struct sdio_hc *next;
struct device *dev; /* platform device handle */
void *regs; /* SDIO Host Controller address */
- struct brcmf_sdio *sdh; /* SDIO Host Controller handle */
+ struct brcmf_sdio_card *card;
void *ch;
unsigned int oob_irq;
unsigned long oob_flags; /* OOB Host specifiction
@@ -113,7 +113,7 @@ int brcmf_sdio_probe(struct device *dev)
{
struct sdio_hc *sdhc = NULL;
unsigned long regs = 0;
- struct brcmf_sdio *sdh = NULL;
+ struct brcmf_sdio_card *card = NULL;
int irq = 0;
u32 vendevid;
unsigned long irq_flags = 0;
@@ -126,13 +126,13 @@ int brcmf_sdio_probe(struct device *dev)
}
sdhc->dev = (void *)dev;
- sdh = brcmf_sdcard_attach((void *)0, (void **)®s, irq);
- if (!sdh) {
+ card = brcmf_sdcard_attach((void *)0, (void **)®s, irq);
+ if (!card) {
SDLX_MSG(("%s: attach failed\n", __func__));
goto err;
}
- sdhc->sdh = sdh;
+ sdhc->card = card;
sdhc->oob_irq = irq;
sdhc->oob_flags = irq_flags;
sdhc->oob_irq_registered = false; /* to make sure.. */
@@ -141,11 +141,11 @@ int brcmf_sdio_probe(struct device *dev)
sdhc->next = sdhcinfo;
sdhcinfo = sdhc;
/* Read the vendor/device ID from the CIS */
- vendevid = brcmf_sdcard_query_device(sdh);
+ vendevid = brcmf_sdcard_query_device(card);
/* try to attach to the target device */
sdhc->ch = drvinfo.attach((vendevid >> 16), (vendevid & 0xFFFF),
- 0, 0, 0, 0, (void *)regs, sdh);
+ 0, 0, 0, 0, (void *)regs, card);
if (!sdhc->ch) {
SDLX_MSG(("%s: device attach failed\n", __func__));
goto err;
@@ -156,8 +156,8 @@ int brcmf_sdio_probe(struct device *dev)
/* error handling */
err:
if (sdhc) {
- if (sdhc->sdh)
- brcmf_sdcard_detach(sdhc->sdh);
+ if (sdhc->card)
+ brcmf_sdcard_detach(sdhc->card);
kfree(sdhc);
}
@@ -170,7 +170,7 @@ int brcmf_sdio_remove(struct device *dev)
sdhc = sdhcinfo;
drvinfo.detach(sdhc->ch);
- brcmf_sdcard_detach(sdhc->sdh);
+ brcmf_sdcard_detach(sdhc->card);
/* find the SDIO Host Controller state for this pdev
and take it out from the list */
for (sdhc = sdhcinfo, prev = NULL; sdhc; sdhc = sdhc->next) {
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 6c7407a..3ed9e12 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -458,7 +458,7 @@ struct chip_info {
typedef struct dhd_bus {
struct brcmf_pub *dhd;
- struct brcmf_sdio *sdh; /* Handle for sdio card calls */
+ struct brcmf_sdio_card *card; /* Handle for sdio card calls */
struct chip_info *ci; /* Chip info struct */
char *vars; /* Variables (from CIS and/or other) */
uint varsz; /* Size of variables buffer */
@@ -744,7 +744,7 @@ do { \
retryvar = 0; \
do { \
regvar = R_REG(regaddr); \
- } while (brcmf_sdcard_regfail(bus->sdh) && \
+ } while (brcmf_sdcard_regfail(bus->card) && \
(++retryvar <= retry_limit)); \
if (retryvar) { \
bus->regfails += (retryvar-1); \
@@ -761,7 +761,7 @@ do { \
retryvar = 0; \
do { \
W_REG(regaddr, regval); \
- } while (brcmf_sdcard_regfail(bus->sdh) && \
+ } while (brcmf_sdcard_regfail(bus->card) && \
(++retryvar <= retry_limit)); \
if (retryvar) { \
bus->regfails += (retryvar-1); \
@@ -794,10 +794,10 @@ static void brcmf_sdbrcm_release(dhd_bus_t *bus);
static void brcmf_sdbrcm_release_malloc(dhd_bus_t *bus);
static void brcmf_sdbrcm_disconnect(void *ptr);
static bool brcmf_sdbrcm_chipmatch(u16 chipid);
-static bool brcmf_sdbrcm_probe_attach(dhd_bus_t *bus, void *sdh,
+static bool brcmf_sdbrcm_probe_attach(dhd_bus_t *bus, void *card,
void *regsva, u16 devid);
-static bool brcmf_sdbrcm_probe_malloc(dhd_bus_t *bus, void *sdh);
-static bool brcmf_sdbrcm_probe_init(dhd_bus_t *bus, void *sdh);
+static bool brcmf_sdbrcm_probe_malloc(dhd_bus_t *bus, void *card);
+static bool brcmf_sdbrcm_probe_init(dhd_bus_t *bus, void *card);
static void brcmf_sdbrcm_release_dongle(dhd_bus_t *bus);
static uint brcmf_process_nvram_vars(char *varbuf, uint len);
@@ -808,14 +808,20 @@ static int brcmf_sdbrcm_send_buf(dhd_bus_t *bus, u32 addr, uint fn,
struct sk_buff *pkt,
brcmf_sdio_cmplt_fn_t complete, void *handle);
-static bool brcmf_sdbrcm_download_firmware(struct dhd_bus *bus, void *sdh);
+static bool brcmf_sdbrcm_download_firmware(struct dhd_bus *bus, void *card);
static int _brcmf_sdbrcm_download_firmware(struct dhd_bus *bus);
static int brcmf_sdbrcm_download_code_file(struct dhd_bus *bus);
static int brcmf_sdbrcm_download_nvram(struct dhd_bus *bus);
-static void brcmf_sdbrcm_chip_disablecore(struct brcmf_sdio *sdh, u32 corebase);
+
+static void
+brcmf_sdbrcm_chip_disablecore(struct brcmf_sdio_card *card, u32 corebase);
+
static int brcmf_sdbrcm_chip_attach(struct dhd_bus *bus, void *regs);
-static void brcmf_sdbrcm_chip_resetcore(struct brcmf_sdio *sdh, u32 corebase);
+
+static void
+brcmf_sdbrcm_chip_resetcore(struct brcmf_sdio_card *card, u32 corebase);
+
static void brcmf_sdbrcm_sdiod_drive_strength_init(struct dhd_bus *bus,
u32 drivestrength);
static void brcmf_sdbrcm_chip_detach(struct dhd_bus *bus);
@@ -853,14 +859,14 @@ static void brcmf_sdbrcm_setmemsize(struct dhd_bus *bus, int mem_size)
static int brcmf_sdbrcm_set_siaddr_window(dhd_bus_t *bus, u32 address)
{
int err = 0;
- brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRLOW,
+ brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRLOW,
(address >> 8) & SBSDIO_SBADDRLOW_MASK, &err);
if (!err)
- brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_1,
SBSDIO_FUNC1_SBADDRMID,
(address >> 16) & SBSDIO_SBADDRMID_MASK, &err);
if (!err)
- brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_1,
SBSDIO_FUNC1_SBADDRHIGH,
(address >> 24) & SBSDIO_SBADDRHIGH_MASK,
&err);
@@ -872,12 +878,12 @@ static int brcmf_sdbrcm_htclk(dhd_bus_t *bus, bool on, bool pendok)
{
int err;
u8 clkctl, clkreq, devctl;
- struct brcmf_sdio *sdh;
+ struct brcmf_sdio_card *card;
DHD_TRACE(("%s: Enter\n", __func__));
clkctl = 0;
- sdh = bus->sdh;
+ card = bus->card;
if (on) {
/* Request HT Avail */
@@ -888,7 +894,7 @@ static int brcmf_sdbrcm_htclk(dhd_bus_t *bus, bool on, bool pendok)
&& (bus->ci->chiprev == 0))
clkreq |= SBSDIO_FORCE_ALP;
- brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_write(card, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR, clkreq, &err);
if (err) {
DHD_ERROR(("%s: HT Avail request error: %d\n",
@@ -903,7 +909,7 @@ static int brcmf_sdbrcm_htclk(dhd_bus_t *bus, bool on, bool pendok)
}
/* Check current status */
- clkctl = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
+ clkctl = brcmf_sdcard_cfg_read(card, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR, &err);
if (err) {
DHD_ERROR(("%s: HT Avail read error: %d\n",
@@ -914,7 +920,7 @@ static int brcmf_sdbrcm_htclk(dhd_bus_t *bus, bool on, bool pendok)
/* Go to pending and await interrupt if appropriate */
if (!SBSDIO_CLKAV(clkctl, bus->alp_only) && pendok) {
/* Allow only clock-available interrupt */
- devctl = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
+ devctl = brcmf_sdcard_cfg_read(card, SDIO_FUNC_1,
SBSDIO_DEVICE_CTL, &err);
if (err) {
DHD_ERROR(("%s: Devctl error setting CA: %d\n",
@@ -923,7 +929,7 @@ static int brcmf_sdbrcm_htclk(dhd_bus_t *bus, bool on, bool pendok)
}
devctl |= SBSDIO_DEVCTL_CA_INT_ONLY;
- brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_write(card, SDIO_FUNC_1,
SBSDIO_DEVICE_CTL, devctl, &err);
DHD_INFO(("CLKCTL: set PENDING\n"));
bus->clkstate = CLK_PENDING;
@@ -932,22 +938,22 @@ static int brcmf_sdbrcm_htclk(dhd_bus_t *bus, bool on, bool pendok)
} else if (bus->clkstate == CLK_PENDING) {
/* Cancel CA-only interrupt filter */
devctl =
- brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_read(card, SDIO_FUNC_1,
SBSDIO_DEVICE_CTL, &err);
devctl &= ~SBSDIO_DEVCTL_CA_INT_ONLY;
- brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_write(card, SDIO_FUNC_1,
SBSDIO_DEVICE_CTL, devctl, &err);
}
/* Otherwise, wait here (polling) for HT Avail */
if (!SBSDIO_CLKAV(clkctl, bus->alp_only)) {
BRCMF_SPINWAIT_SLEEP(sdioh_spinwait_sleep,
- ((clkctl =
- brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
- SBSDIO_FUNC1_CHIPCLKCSR,
- &err)),
- !SBSDIO_CLKAV(clkctl, bus->alp_only)),
- PMU_MAX_TRANSITION_DLY);
+ ((clkctl =
+ brcmf_sdcard_cfg_read(card, SDIO_FUNC_1,
+ SBSDIO_FUNC1_CHIPCLKCSR,
+ &err)),
+ !SBSDIO_CLKAV(clkctl, bus->alp_only)),
+ PMU_MAX_TRANSITION_DLY);
}
if (err) {
DHD_ERROR(("%s: HT Avail request error: %d\n",
@@ -979,15 +985,15 @@ static int brcmf_sdbrcm_htclk(dhd_bus_t *bus, bool on, bool pendok)
if (bus->clkstate == CLK_PENDING) {
/* Cancel CA-only interrupt filter */
- devctl = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
+ devctl = brcmf_sdcard_cfg_read(card, SDIO_FUNC_1,
SBSDIO_DEVICE_CTL, &err);
devctl &= ~SBSDIO_DEVCTL_CA_INT_ONLY;
- brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_write(card, SDIO_FUNC_1,
SBSDIO_DEVICE_CTL, devctl, &err);
}
bus->clkstate = CLK_SDONLY;
- brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_write(card, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR, clkreq, &err);
DHD_INFO(("CLKCTL: turned OFF\n"));
if (err) {
@@ -1071,7 +1077,7 @@ static int brcmf_sdbrcm_clkctl(dhd_bus_t *bus, uint target, bool pendok)
int brcmf_sdbrcm_bussleep(dhd_bus_t *bus, bool sleep)
{
- struct brcmf_sdio *sdh = bus->sdh;
+ struct brcmf_sdio_card *card = bus->card;
struct sdpcmd_regs *regs = bus->regs;
uint retries = 0;
@@ -1090,7 +1096,7 @@ int brcmf_sdbrcm_bussleep(dhd_bus_t *bus, bool sleep)
return -EBUSY;
/* Disable SDIO interrupts (no longer interested) */
- brcmf_sdcard_intr_disable(bus->sdh);
+ brcmf_sdcard_intr_disable(bus->card);
/* Make sure the controller has the bus up */
brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
@@ -1103,14 +1109,14 @@ int brcmf_sdbrcm_bussleep(dhd_bus_t *bus, bool sleep)
/* Turn off our contribution to the HT clock request */
brcmf_sdbrcm_clkctl(bus, CLK_SDONLY, false);
- brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_write(card, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR,
SBSDIO_FORCE_HW_CLKREQ_OFF, NULL);
/* Isolate the bus */
if (bus->ci->chip != BCM4329_CHIP_ID
&& bus->ci->chip != BCM4319_CHIP_ID) {
- brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_write(card, SDIO_FUNC_1,
SBSDIO_DEVICE_CTL,
SBSDIO_DEVCTL_PADS_ISO, NULL);
}
@@ -1121,14 +1127,14 @@ int brcmf_sdbrcm_bussleep(dhd_bus_t *bus, bool sleep)
} else {
/* Waking up: bus power up is ok, set local state */
- brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_write(card, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR, 0, NULL);
/* Force pad isolation off if possible
(in case power never toggled) */
if ((bus->ci->buscoretype == PCMCIA_CORE_ID)
&& (bus->ci->buscorerev >= 10))
- brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_write(card, SDIO_FUNC_1,
SBSDIO_DEVICE_CTL, 0, NULL);
/* Make sure the controller has the bus up */
@@ -1151,7 +1157,7 @@ int brcmf_sdbrcm_bussleep(dhd_bus_t *bus, bool sleep)
/* Enable interrupts again */
if (bus->intr && (bus->dhd->busstate == DHD_BUS_DATA)) {
bus->intdis = false;
- brcmf_sdcard_intr_enable(bus->sdh);
+ brcmf_sdcard_intr_enable(bus->card);
}
}
@@ -1174,13 +1180,13 @@ static int brcmf_sdbrcm_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
u16 len, pad = 0;
u32 swheader;
uint retries = 0;
- struct brcmf_sdio *sdh;
+ struct brcmf_sdio_card *card;
struct sk_buff *new;
int i;
DHD_TRACE(("%s: Enter\n", __func__));
- sdh = bus->sdh;
+ card = bus->card;
if (bus->dhd->dongle_reset) {
ret = -EPERM;
@@ -1268,7 +1274,7 @@ static int brcmf_sdbrcm_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
}
do {
- ret = brcmf_sdbrcm_send_buf(bus, brcmf_sdcard_cur_sbwad(sdh),
+ ret = brcmf_sdbrcm_send_buf(bus, brcmf_sdcard_cur_sbwad(card),
SDIO_FUNC_2, F2SYNC, frame, len, pkt, NULL, NULL);
bus->f2txdata++;
ASSERT(ret != -BCME_PENDING);
@@ -1280,18 +1286,18 @@ static int brcmf_sdbrcm_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
"terminate frame.\n", __func__, ret));
bus->tx_sderrs++;
- brcmf_sdcard_abort(sdh, SDIO_FUNC_2);
- brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
+ brcmf_sdcard_abort(card, SDIO_FUNC_2);
+ brcmf_sdcard_cfg_write(card, SDIO_FUNC_1,
SBSDIO_FUNC1_FRAMECTRL, SFC_WF_TERM,
NULL);
bus->f1regdata++;
for (i = 0; i < 3; i++) {
u8 hi, lo;
- hi = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
+ hi = brcmf_sdcard_cfg_read(card, SDIO_FUNC_1,
SBSDIO_FUNC1_WFRAMEBCHI,
NULL);
- lo = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
+ lo = brcmf_sdcard_cfg_read(card, SDIO_FUNC_1,
SBSDIO_FUNC1_WFRAMEBCLO,
NULL);
bus->f1regdata += 2;
@@ -1461,7 +1467,7 @@ static uint brcmf_sdbrcm_sendfromq(dhd_bus_t *bus, uint maxframes)
/* Check device status, signal pending interrupt */
R_SDREG(intstatus, ®s->intstatus, retries);
bus->f2txdata++;
- if (brcmf_sdcard_regfail(bus->sdh))
+ if (brcmf_sdcard_regfail(bus->card))
break;
if (intstatus & bus->hostintmask)
bus->ipend = true;
@@ -1483,7 +1489,7 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
u16 len;
u32 swheader;
uint retries = 0;
- struct brcmf_sdio *sdh = bus->sdh;
+ struct brcmf_sdio_card *card = bus->card;
u8 doff = 0;
int ret = -1;
int i;
@@ -1581,7 +1587,7 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
do {
bus->ctrl_frame_stat = false;
ret = brcmf_sdbrcm_send_buf(bus,
- brcmf_sdcard_cur_sbwad(sdh), SDIO_FUNC_2,
+ brcmf_sdcard_cur_sbwad(card), SDIO_FUNC_2,
F2SYNC, frame, len, NULL, NULL, NULL);
ASSERT(ret != -BCME_PENDING);
@@ -1593,20 +1599,20 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
__func__, ret));
bus->tx_sderrs++;
- brcmf_sdcard_abort(sdh, SDIO_FUNC_2);
+ brcmf_sdcard_abort(card, SDIO_FUNC_2);
- brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_write(card, SDIO_FUNC_1,
SBSDIO_FUNC1_FRAMECTRL,
SFC_WF_TERM, NULL);
bus->f1regdata++;
for (i = 0; i < 3; i++) {
u8 hi, lo;
- hi = brcmf_sdcard_cfg_read(sdh,
+ hi = brcmf_sdcard_cfg_read(card,
SDIO_FUNC_1,
SBSDIO_FUNC1_WFRAMEBCHI,
NULL);
- lo = brcmf_sdcard_cfg_read(sdh,
+ lo = brcmf_sdcard_cfg_read(card,
SDIO_FUNC_1,
SBSDIO_FUNC1_WFRAMEBCLO,
NULL);
@@ -1884,7 +1890,7 @@ void brcmf_sdbrcm_bus_dump(struct brcmf_pub *dhdp, struct brcmu_strbuf *strbuf)
#ifdef BCMDBG
brcmu_bprintf(strbuf, "dpc_sched %d host interrupt%spending\n",
bus->dpc_sched,
- (brcmf_sdcard_intr_pending(bus->sdh) ? " " : " not "));
+ (brcmf_sdcard_intr_pending(bus->card) ? " " : " not "));
brcmu_bprintf(strbuf, "blocksize %d roundup %d\n", bus->blocksize,
bus->roundup);
#endif /* BCMDBG */
@@ -1990,7 +1996,7 @@ brcmf_sdbrcm_membytes(dhd_bus_t *bus, bool write, u32 address, u8 *data,
__func__, (write ? "write" : "read"), dsize,
sdaddr, (address & SBSDIO_SBWINDOW_MASK)));
bcmerror =
- brcmf_sdcard_rwdata(bus->sdh, write, sdaddr, data, dsize);
+ brcmf_sdcard_rwdata(bus->card, write, sdaddr, data, dsize);
if (bcmerror) {
DHD_ERROR(("%s: membytes transfer failed\n", __func__));
break;
@@ -2015,9 +2021,9 @@ brcmf_sdbrcm_membytes(dhd_bus_t *bus, bool write, u32 address, u8 *data,
xfer_done:
/* Return the window to backplane enumeration space for core access */
if (brcmf_sdbrcm_set_siaddr_window(bus,
- brcmf_sdcard_cur_sbwad(bus->sdh))) {
+ brcmf_sdcard_cur_sbwad(bus->card))) {
DHD_ERROR(("%s: FAILED to set window back to 0x%x\n",
- __func__, brcmf_sdcard_cur_sbwad(bus->sdh)));
+ __func__, brcmf_sdcard_cur_sbwad(bus->card)));
}
return bcmerror;
@@ -2426,11 +2432,11 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
if (bus->intr) {
DHD_INTR(("%s: enable SDIO device interrupts\n",
__func__));
- brcmf_sdcard_intr_enable(bus->sdh);
+ brcmf_sdcard_intr_enable(bus->card);
} else {
DHD_INTR(("%s: disable SDIO interrupts\n",
__func__));
- brcmf_sdcard_intr_disable(bus->sdh);
+ brcmf_sdcard_intr_disable(bus->card);
}
}
break;
@@ -2623,9 +2629,9 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
addr = (unsigned long)bus->regs + sd_ptr->offset;
size = sd_ptr->func;
- int_val = (s32) brcmf_sdcard_reg_read(bus->sdh, addr,
+ int_val = (s32) brcmf_sdcard_reg_read(bus->card, addr,
size);
- if (brcmf_sdcard_regfail(bus->sdh))
+ if (brcmf_sdcard_regfail(bus->card))
bcmerror = -EIO;
memcpy(arg, &int_val, sizeof(s32));
break;
@@ -2640,9 +2646,9 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
addr = (unsigned long)bus->regs + sd_ptr->offset;
size = sd_ptr->func;
- brcmf_sdcard_reg_write(bus->sdh, addr, size,
+ brcmf_sdcard_reg_write(bus->card, addr, size,
sd_ptr->value);
- if (brcmf_sdcard_regfail(bus->sdh))
+ if (brcmf_sdcard_regfail(bus->card))
bcmerror = -EIO;
break;
}
@@ -2658,9 +2664,9 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
addr = SI_ENUM_BASE + sdreg.offset;
size = sdreg.func;
- int_val = (s32) brcmf_sdcard_reg_read(bus->sdh, addr,
+ int_val = (s32) brcmf_sdcard_reg_read(bus->card, addr,
size);
- if (brcmf_sdcard_regfail(bus->sdh))
+ if (brcmf_sdcard_regfail(bus->card))
bcmerror = -EIO;
memcpy(arg, &int_val, sizeof(s32));
break;
@@ -2675,9 +2681,9 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
addr = SI_ENUM_BASE + sdreg.offset;
size = sdreg.func;
- brcmf_sdcard_reg_write(bus->sdh, addr, size,
+ brcmf_sdcard_reg_write(bus->card, addr, size,
sdreg.value);
- if (brcmf_sdcard_regfail(bus->sdh))
+ if (brcmf_sdcard_regfail(bus->card))
bcmerror = -EIO;
break;
}
@@ -2687,15 +2693,15 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
*(char *)arg = 0;
strcat(arg, "\nFunc 0\n");
- brcmf_sdcard_cis_read(bus->sdh, 0x10,
+ brcmf_sdcard_cis_read(bus->card, 0x10,
(u8 *) arg + strlen(arg),
SBSDIO_CIS_SIZE_LIMIT);
strcat(arg, "\nFunc 1\n");
- brcmf_sdcard_cis_read(bus->sdh, 0x11,
+ brcmf_sdcard_cis_read(bus->card, 0x11,
(u8 *) arg + strlen(arg),
SBSDIO_CIS_SIZE_LIMIT);
strcat(arg, "\nFunc 2\n");
- brcmf_sdcard_cis_read(bus->sdh, 0x12,
+ brcmf_sdcard_cis_read(bus->card, 0x12,
(u8 *) arg + strlen(arg),
SBSDIO_CIS_SIZE_LIMIT);
break;
@@ -2907,9 +2913,9 @@ static int brcmf_sdbrcm_download_state(dhd_bus_t *bus, bool enter)
if (enter) {
bus->alp_only = true;
- brcmf_sdbrcm_chip_disablecore(bus->sdh, bus->ci->armcorebase);
+ brcmf_sdbrcm_chip_disablecore(bus->card, bus->ci->armcorebase);
- brcmf_sdbrcm_chip_resetcore(bus->sdh, bus->ci->ramcorebase);
+ brcmf_sdbrcm_chip_resetcore(bus->card, bus->ci->ramcorebase);
/* Clear the top bit of memory */
if (bus->ramsize) {
@@ -2918,7 +2924,7 @@ static int brcmf_sdbrcm_download_state(dhd_bus_t *bus, bool enter)
(u8 *)&zeros, 4);
}
} else {
- regdata = brcmf_sdcard_reg_read(bus->sdh,
+ regdata = brcmf_sdcard_reg_read(bus->card,
CORE_SB(bus->ci->ramcorebase, sbtmstatelow), 4);
regdata &= (SBTML_RESET | SBTML_REJ_MASK |
(SICF_CLOCK_EN << SBTML_SICF_SHIFT));
@@ -2937,7 +2943,7 @@ static int brcmf_sdbrcm_download_state(dhd_bus_t *bus, bool enter)
W_SDREG(0xFFFFFFFF, &bus->regs->intstatus, retries);
- brcmf_sdbrcm_chip_resetcore(bus->sdh, bus->ci->armcorebase);
+ brcmf_sdbrcm_chip_resetcore(bus->card, bus->ci->armcorebase);
/* Allow HT Clock now that the ARM is running. */
bus->alp_only = false;
@@ -2979,14 +2985,14 @@ brcmf_sdbrcm_bus_iovar_op(struct brcmf_pub *dhdp, const char *name,
/* Turn on clock in case SD command needs backplane */
brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
- bcmerror = brcmf_sdcard_iovar_op(bus->sdh, name, params, plen,
+ bcmerror = brcmf_sdcard_iovar_op(bus->card, name, params, plen,
arg, len, set);
/* Similar check for blocksize change */
if (set && strcmp(name, "sd_blocksize") == 0) {
s32 fnum = 2;
if (brcmf_sdcard_iovar_op
- (bus->sdh, "sd_blocksize", &fnum, sizeof(s32),
+ (bus->card, "sd_blocksize", &fnum, sizeof(s32),
&bus->blocksize, sizeof(s32),
false) != 0) {
bus->blocksize = 0;
@@ -3076,10 +3082,10 @@ void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
bus->dhd->busstate = DHD_BUS_DOWN;
/* Force clocks on backplane to be sure F2 interrupt propagates */
- saveclk = brcmf_sdcard_cfg_read(bus->sdh, SDIO_FUNC_1,
+ saveclk = brcmf_sdcard_cfg_read(bus->card, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR, &err);
if (!err) {
- brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR,
(saveclk | SBSDIO_FORCE_HT), &err);
}
@@ -3090,8 +3096,8 @@ void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
/* Turn off the bus (F2), free any pending packets */
DHD_INTR(("%s: disable SDIO interrupts\n", __func__));
- brcmf_sdcard_intr_disable(bus->sdh);
- brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_0, SDIO_CCCR_IOEx,
+ brcmf_sdcard_intr_disable(bus->card);
+ brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_0, SDIO_CCCR_IOEx,
SDIO_FUNC_ENABLE_1, NULL);
/* Clear any pending interrupts now that F2 is disabled */
@@ -3141,7 +3147,7 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *dhdp, bool enforce_mutex)
/* try to download image and nvram to the dongle */
if (dhdp->busstate == DHD_BUS_DOWN) {
- if (!(brcmf_sdbrcm_download_firmware(bus, bus->sdh)))
+ if (!(brcmf_sdbrcm_download_firmware(bus, bus->card)))
return -1;
}
@@ -3163,10 +3169,10 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *dhdp, bool enforce_mutex)
/* Force clocks on backplane to be sure F2 interrupt propagates */
saveclk =
- brcmf_sdcard_cfg_read(bus->sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_read(bus->card, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR, &err);
if (!err) {
- brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR,
(saveclk | SBSDIO_FORCE_HT), &err);
}
@@ -3181,7 +3187,7 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *dhdp, bool enforce_mutex)
&bus->regs->tosbmailboxdata, retries);
enable = (SDIO_FUNC_ENABLE_1 | SDIO_FUNC_ENABLE_2);
- brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_0, SDIO_CCCR_IOEx, enable,
+ brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_0, SDIO_CCCR_IOEx, enable,
NULL);
/* Give the dongle some time to do its thing and set IOR2 */
@@ -3189,9 +3195,8 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *dhdp, bool enforce_mutex)
ready = 0;
while (ready != enable && !brcmf_timeout_expired(&tmo))
- ready =
- brcmf_sdcard_cfg_read(bus->sdh, SDIO_FUNC_0, SDIO_CCCR_IORx,
- NULL);
+ ready = brcmf_sdcard_cfg_read(bus->card, SDIO_FUNC_0,
+ SDIO_CCCR_IORx, NULL);
DHD_INFO(("%s: enable 0x%02x, ready 0x%02x (waited %uus)\n",
__func__, enable, ready, tmo.elapsed));
@@ -3204,7 +3209,7 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *dhdp, bool enforce_mutex)
(unsigned int *)CORE_BUS_REG(bus->ci->buscorebase,
hostintmask), retries);
- brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_WATERMARK,
+ brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_1, SBSDIO_WATERMARK,
(u8) watermark, &err);
/* Set bus state according to enable result */
@@ -3214,10 +3219,10 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *dhdp, bool enforce_mutex)
if (bus->intr) {
DHD_INTR(("%s: enable SDIO device interrupts\n",
__func__));
- brcmf_sdcard_intr_enable(bus->sdh);
+ brcmf_sdcard_intr_enable(bus->card);
} else {
DHD_INTR(("%s: disable SDIO interrupts\n", __func__));
- brcmf_sdcard_intr_disable(bus->sdh);
+ brcmf_sdcard_intr_disable(bus->card);
}
}
@@ -3225,12 +3230,12 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *dhdp, bool enforce_mutex)
else {
/* Disable F2 again */
enable = SDIO_FUNC_ENABLE_1;
- brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_0, SDIO_CCCR_IOEx,
+ brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_0, SDIO_CCCR_IOEx,
enable, NULL);
}
/* Restore previous clock setting */
- brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
+ brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
saveclk, &err);
#if defined(OOB_INTR_ONLY)
@@ -3259,7 +3264,7 @@ exit:
static void brcmf_sdbrcm_rxfail(dhd_bus_t *bus, bool abort, bool rtx)
{
- struct brcmf_sdio *sdh = bus->sdh;
+ struct brcmf_sdio_card *card = bus->card;
struct sdpcmd_regs *regs = bus->regs;
uint retries = 0;
u16 lastrbc;
@@ -3271,17 +3276,17 @@ static void brcmf_sdbrcm_rxfail(dhd_bus_t *bus, bool abort, bool rtx)
(rtx ? ", send NAK" : "")));
if (abort)
- brcmf_sdcard_abort(sdh, SDIO_FUNC_2);
+ brcmf_sdcard_abort(card, SDIO_FUNC_2);
- brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_FRAMECTRL,
+ brcmf_sdcard_cfg_write(card, SDIO_FUNC_1, SBSDIO_FUNC1_FRAMECTRL,
SFC_RF_TERM, &err);
bus->f1regdata++;
/* Wait until the packet has been flushed (device/FIFO stable) */
for (lastrbc = retries = 0xffff; retries > 0; retries--) {
- hi = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
+ hi = brcmf_sdcard_cfg_read(card, SDIO_FUNC_1,
SBSDIO_FUNC1_RFRAMEBCHI, NULL);
- lo = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
+ lo = brcmf_sdcard_cfg_read(card, SDIO_FUNC_1,
SBSDIO_FUNC1_RFRAMEBCLO, NULL);
bus->f1regdata += 2;
@@ -3316,14 +3321,14 @@ static void brcmf_sdbrcm_rxfail(dhd_bus_t *bus, bool abort, bool rtx)
bus->nextlen = 0;
/* If we can't reach the device, signal failure */
- if (err || brcmf_sdcard_regfail(sdh))
+ if (err || brcmf_sdcard_regfail(card))
bus->dhd->busstate = DHD_BUS_DOWN;
}
static void
brcmf_sdbrcm_read_control(dhd_bus_t *bus, u8 *hdr, uint len, uint doff)
{
- struct brcmf_sdio *sdh = bus->sdh;
+ struct brcmf_sdio_card *card = bus->card;
uint rdlen, pad;
int sdret;
@@ -3392,7 +3397,7 @@ brcmf_sdbrcm_read_control(dhd_bus_t *bus, u8 *hdr, uint len, uint doff)
}
/* Read remainder of frame body into the rxctl buffer */
- sdret = brcmf_sdcard_recv_buf(sdh, brcmf_sdcard_cur_sbwad(sdh),
+ sdret = brcmf_sdcard_recv_buf(card, brcmf_sdcard_cur_sbwad(card),
SDIO_FUNC_2,
F2SYNC, (bus->rxctl + firstread), rdlen,
NULL, NULL, NULL);
@@ -3555,14 +3560,14 @@ static u8 brcmf_sdbrcm_rxglom(dhd_bus_t *bus, u8 rxseq)
* packet and and copy into the chain.
*/
if (usechain) {
- errcode = brcmf_sdcard_recv_buf(bus->sdh,
- brcmf_sdcard_cur_sbwad(bus->sdh),
+ errcode = brcmf_sdcard_recv_buf(bus->card,
+ brcmf_sdcard_cur_sbwad(bus->card),
SDIO_FUNC_2,
F2SYNC, (u8 *) pfirst->data, dlen,
pfirst, NULL, NULL);
} else if (bus->dataptr) {
- errcode = brcmf_sdcard_recv_buf(bus->sdh,
- brcmf_sdcard_cur_sbwad(bus->sdh),
+ errcode = brcmf_sdcard_recv_buf(bus->card,
+ brcmf_sdcard_cur_sbwad(bus->card),
SDIO_FUNC_2,
F2SYNC, bus->dataptr, dlen,
NULL, NULL, NULL);
@@ -3831,7 +3836,7 @@ static u8 brcmf_sdbrcm_rxglom(dhd_bus_t *bus, u8 rxseq)
static uint
brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
{
- struct brcmf_sdio *sdh = bus->sdh;
+ struct brcmf_sdio_card *card = bus->card;
u16 len, check; /* Extracted hardware header fields */
u8 chan, seq, doff; /* Extracted software header fields */
@@ -3940,11 +3945,11 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
ASSERT(bus->rxctl >= bus->rxbuf);
rxbuf = bus->rxctl;
/* Read the entire frame */
- sdret = brcmf_sdcard_recv_buf(sdh,
- brcmf_sdcard_cur_sbwad(sdh),
- SDIO_FUNC_2, F2SYNC,
- rxbuf, rdlen,
- NULL, NULL, NULL);
+ sdret = brcmf_sdcard_recv_buf(card,
+ brcmf_sdcard_cur_sbwad(card),
+ SDIO_FUNC_2, F2SYNC,
+ rxbuf, rdlen,
+ NULL, NULL, NULL);
bus->f2rxdata++;
ASSERT(sdret != -BCME_PENDING);
@@ -3981,8 +3986,8 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
PKTALIGN(pkt, rdlen, BRCMF_SDALIGN);
rxbuf = (u8 *) (pkt->data);
/* Read the entire frame */
- sdret = brcmf_sdcard_recv_buf(sdh,
- brcmf_sdcard_cur_sbwad(sdh),
+ sdret = brcmf_sdcard_recv_buf(card,
+ brcmf_sdcard_cur_sbwad(card),
SDIO_FUNC_2, F2SYNC,
rxbuf, rdlen,
pkt, NULL, NULL);
@@ -4160,7 +4165,8 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
break;
/* Read frame header (hardware and software) */
- sdret = brcmf_sdcard_recv_buf(sdh, brcmf_sdcard_cur_sbwad(sdh),
+ sdret = brcmf_sdcard_recv_buf(card,
+ brcmf_sdcard_cur_sbwad(card),
SDIO_FUNC_2, F2SYNC, bus->rxhdr, firstread,
NULL, NULL, NULL);
bus->f2rxhdrs++;
@@ -4321,7 +4327,8 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
PKTALIGN(pkt, rdlen, BRCMF_SDALIGN);
/* Read the remaining frame data */
- sdret = brcmf_sdcard_recv_buf(sdh, brcmf_sdcard_cur_sbwad(sdh),
+ sdret = brcmf_sdcard_recv_buf(card,
+ brcmf_sdcard_cur_sbwad(card),
SDIO_FUNC_2, F2SYNC, ((u8 *) (pkt->data)),
rdlen, pkt, NULL, NULL);
bus->f2rxdata++;
@@ -4499,7 +4506,7 @@ static u32 brcmf_sdbrcm_hostmail(dhd_bus_t *bus)
static bool brcmf_sdbrcm_dpc(dhd_bus_t *bus)
{
- struct brcmf_sdio *sdh = bus->sdh;
+ struct brcmf_sdio_card *card = bus->card;
struct sdpcmd_regs *regs = bus->regs;
u32 intstatus, newstatus = 0;
uint retries = 0;
@@ -4523,7 +4530,7 @@ static bool brcmf_sdbrcm_dpc(dhd_bus_t *bus)
#ifdef BCMDBG
/* Check for inconsistent device control */
- devctl = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
+ devctl = brcmf_sdcard_cfg_read(card, SDIO_FUNC_1,
SBSDIO_DEVICE_CTL, &err);
if (err) {
DHD_ERROR(("%s: error reading DEVCTL: %d\n",
@@ -4535,7 +4542,7 @@ static bool brcmf_sdbrcm_dpc(dhd_bus_t *bus)
#endif /* BCMDBG */
/* Read CSR, if clock on switch to AVAIL, else ignore */
- clkctl = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
+ clkctl = brcmf_sdcard_cfg_read(card, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR, &err);
if (err) {
DHD_ERROR(("%s: error reading CSR: %d\n", __func__,
@@ -4547,7 +4554,7 @@ static bool brcmf_sdbrcm_dpc(dhd_bus_t *bus)
clkctl));
if (SBSDIO_HTAV(clkctl)) {
- devctl = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
+ devctl = brcmf_sdcard_cfg_read(card, SDIO_FUNC_1,
SBSDIO_DEVICE_CTL, &err);
if (err) {
DHD_ERROR(("%s: error reading DEVCTL: %d\n",
@@ -4555,7 +4562,7 @@ static bool brcmf_sdbrcm_dpc(dhd_bus_t *bus)
bus->dhd->busstate = DHD_BUS_DOWN;
}
devctl &= ~SBSDIO_DEVCTL_CA_INT_ONLY;
- brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_write(card, SDIO_FUNC_1,
SBSDIO_DEVICE_CTL, devctl, &err);
if (err) {
DHD_ERROR(("%s: error writing DEVCTL: %d\n",
@@ -4580,7 +4587,7 @@ static bool brcmf_sdbrcm_dpc(dhd_bus_t *bus)
bus->ipend = false;
R_SDREG(newstatus, ®s->intstatus, retries);
bus->f1regdata++;
- if (brcmf_sdcard_regfail(bus->sdh))
+ if (brcmf_sdcard_regfail(bus->card))
newstatus = 0;
newstatus &= bus->hostintmask;
bus->fcstate = !!(newstatus & I_HMB_FC_STATE);
@@ -4656,18 +4663,18 @@ clkwait:
* or clock availability. (Allows tx loop to check ipend if desired.)
* (Unless register access seems hosed, as we may not be able to ACK...)
*/
- if (bus->intr && bus->intdis && !brcmf_sdcard_regfail(sdh)) {
+ if (bus->intr && bus->intdis && !brcmf_sdcard_regfail(card)) {
DHD_INTR(("%s: enable SDIO interrupts, rxdone %d framecnt %d\n",
__func__, rxdone, framecnt));
bus->intdis = false;
- brcmf_sdcard_intr_enable(sdh);
+ brcmf_sdcard_intr_enable(card);
}
if (DATAOK(bus) && bus->ctrl_frame_stat &&
(bus->clkstate == CLK_AVAIL)) {
int ret, i;
- ret = brcmf_sdbrcm_send_buf(bus, brcmf_sdcard_cur_sbwad(sdh),
+ ret = brcmf_sdbrcm_send_buf(bus, brcmf_sdcard_cur_sbwad(card),
SDIO_FUNC_2, F2SYNC, (u8 *) bus->ctrl_frame_buf,
(u32) bus->ctrl_frame_len, NULL, NULL, NULL);
ASSERT(ret != -BCME_PENDING);
@@ -4679,19 +4686,19 @@ clkwait:
"terminate frame.\n", __func__, ret));
bus->tx_sderrs++;
- brcmf_sdcard_abort(sdh, SDIO_FUNC_2);
+ brcmf_sdcard_abort(card, SDIO_FUNC_2);
- brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_write(card, SDIO_FUNC_1,
SBSDIO_FUNC1_FRAMECTRL, SFC_WF_TERM,
NULL);
bus->f1regdata++;
for (i = 0; i < 3; i++) {
u8 hi, lo;
- hi = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
+ hi = brcmf_sdcard_cfg_read(card, SDIO_FUNC_1,
SBSDIO_FUNC1_WFRAMEBCHI,
NULL);
- lo = brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
+ lo = brcmf_sdcard_cfg_read(card, SDIO_FUNC_1,
SBSDIO_FUNC1_WFRAMEBCLO,
NULL);
bus->f1regdata += 2;
@@ -4720,9 +4727,11 @@ clkwait:
else await next interrupt */
/* On failed register access, all bets are off:
no resched or interrupts */
- if ((bus->dhd->busstate == DHD_BUS_DOWN) || brcmf_sdcard_regfail(sdh)) {
+ if ((bus->dhd->busstate == DHD_BUS_DOWN) ||
+ brcmf_sdcard_regfail(card)) {
DHD_ERROR(("%s: failed backplane access over SDIO, halting "
- "operation %d\n", __func__, brcmf_sdcard_regfail(sdh)));
+ "operation %d\n", __func__,
+ brcmf_sdcard_regfail(card)));
bus->dhd->busstate = DHD_BUS_DOWN;
bus->intstatus = 0;
} else if (bus->clkstate == CLK_PENDING) {
@@ -4752,7 +4761,7 @@ clkwait:
void brcmf_sdbrcm_isr(void *arg)
{
dhd_bus_t *bus = (dhd_bus_t *) arg;
- struct brcmf_sdio *sdh;
+ struct brcmf_sdio_card *card;
DHD_TRACE(("%s: Enter\n", __func__));
@@ -4760,7 +4769,7 @@ void brcmf_sdbrcm_isr(void *arg)
DHD_ERROR(("%s : bus is null pointer , exit\n", __func__));
return;
}
- sdh = bus->sdh;
+ card = bus->card;
if (bus->dhd->busstate == DHD_BUS_DOWN) {
DHD_ERROR(("%s : bus is down. we have nothing to do\n",
@@ -4783,7 +4792,7 @@ void brcmf_sdbrcm_isr(void *arg)
else
DHD_ERROR(("brcmf_sdbrcm_isr() w/o interrupt configured!\n"));
- brcmf_sdcard_intr_disable(sdh);
+ brcmf_sdcard_intr_disable(card);
bus->intdis = true;
#if defined(SDIO_ISR_THREAD)
@@ -5087,7 +5096,7 @@ extern bool brcmf_sdbrcm_bus_watchdog(struct brcmf_pub *dhdp)
if (!bus->dpc_sched) {
u8 devpend;
- devpend = brcmf_sdcard_cfg_read(bus->sdh,
+ devpend = brcmf_sdcard_cfg_read(bus->card,
SDIO_FUNC_0, SDIO_CCCR_INTx,
NULL);
intstatus =
@@ -5101,7 +5110,7 @@ extern bool brcmf_sdbrcm_bus_watchdog(struct brcmf_pub *dhdp)
bus->pollcnt++;
bus->ipend = true;
if (bus->intr)
- brcmf_sdcard_intr_disable(bus->sdh);
+ brcmf_sdcard_intr_disable(bus->card);
bus->dpc_sched = true;
brcmf_sdbrcm_sched_dpc(bus);
@@ -5234,7 +5243,7 @@ static bool brcmf_sdbrcm_chipmatch(u16 chipid)
static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
u16 slot, u16 func, uint bustype, void *regsva,
- void *sdh)
+ void *card)
{
int ret;
dhd_bus_t *bus;
@@ -5316,7 +5325,7 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
DHD_ERROR(("%s: kmalloc of dhd_bus_t failed\n", __func__));
goto fail;
}
- bus->sdh = sdh;
+ bus->card = card;
bus->cl_devid = (u16) devid;
bus->bus = DHD_BUS;
bus->tx_seq = SDPCM_SEQUENCE_WRAP - 1;
@@ -5324,7 +5333,7 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
else use locally malloced rxbuf */
/* attempt to attach to the dongle */
- if (!(brcmf_sdbrcm_probe_attach(bus, sdh, regsva, devid))) {
+ if (!(brcmf_sdbrcm_probe_attach(bus, card, regsva, devid))) {
DHD_ERROR(("%s: brcmf_sdbrcm_probe_attach failed\n", __func__));
goto fail;
}
@@ -5384,12 +5393,12 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
}
/* Allocate buffers */
- if (!(brcmf_sdbrcm_probe_malloc(bus, sdh))) {
+ if (!(brcmf_sdbrcm_probe_malloc(bus, card))) {
DHD_ERROR(("%s: brcmf_sdbrcm_probe_malloc failed\n", __func__));
goto fail;
}
- if (!(brcmf_sdbrcm_probe_init(bus, sdh))) {
+ if (!(brcmf_sdbrcm_probe_init(bus, card))) {
DHD_ERROR(("%s: brcmf_sdbrcm_probe_init failed\n", __func__));
goto fail;
}
@@ -5397,8 +5406,8 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
/* Register interrupt callback, but mask it (not operational yet). */
DHD_INTR(("%s: disable SDIO interrupts (not interested yet)\n",
__func__));
- brcmf_sdcard_intr_disable(sdh);
- ret = brcmf_sdcard_intr_reg(sdh, brcmf_sdbrcm_isr, bus);
+ brcmf_sdcard_intr_disable(card);
+ ret = brcmf_sdcard_intr_reg(card, brcmf_sdbrcm_isr, bus);
if (ret != 0) {
DHD_ERROR(("%s: FAILED: sdcard_intr_reg returned %d\n",
__func__, ret));
@@ -5430,7 +5439,7 @@ fail:
}
static bool
-brcmf_sdbrcm_probe_attach(struct dhd_bus *bus, void *sdh, void *regsva,
+brcmf_sdbrcm_probe_attach(struct dhd_bus *bus, void *card, void *regsva,
u16 devid)
{
u8 clkctl = 0;
@@ -5444,7 +5453,7 @@ brcmf_sdbrcm_probe_attach(struct dhd_bus *bus, void *sdh, void *regsva,
#ifdef BCMDBG
printk(KERN_DEBUG "F1 signature read @0x18000000=0x%4x\n",
- brcmf_sdcard_reg_read(bus->sdh, SI_ENUM_BASE, 4));
+ brcmf_sdcard_reg_read(bus->card, SI_ENUM_BASE, 4));
#endif /* BCMDBG */
@@ -5453,11 +5462,11 @@ brcmf_sdbrcm_probe_attach(struct dhd_bus *bus, void *sdh, void *regsva,
* programs PLL control regs
*/
- brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
+ brcmf_sdcard_cfg_write(card, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
DHD_INIT_CLKCTL1, &err);
if (!err)
clkctl =
- brcmf_sdcard_cfg_read(sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_read(card, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR, &err);
if (err || ((clkctl & ~SBSDIO_AVBITS) != DHD_INIT_CLKCTL1)) {
@@ -5472,7 +5481,7 @@ brcmf_sdbrcm_probe_attach(struct dhd_bus *bus, void *sdh, void *regsva,
goto fail;
}
- brcmf_sdcard_chipinfo(sdh, bus->ci->chip, bus->ci->chiprev);
+ brcmf_sdcard_chipinfo(card, bus->ci->chip, bus->ci->chiprev);
if (!brcmf_sdbrcm_chipmatch((u16) bus->ci->chip)) {
DHD_ERROR(("%s: unsupported chip: 0x%04x\n",
@@ -5484,7 +5493,7 @@ brcmf_sdbrcm_probe_attach(struct dhd_bus *bus, void *sdh, void *regsva,
/* Get info on the ARM and SOCRAM cores... */
if (!DHD_NOPMU(bus)) {
- bus->armrev = SBCOREREV(brcmf_sdcard_reg_read(bus->sdh,
+ bus->armrev = SBCOREREV(brcmf_sdcard_reg_read(bus->card,
CORE_SB(bus->ci->armcorebase, sbidhigh), 4));
bus->orig_ramsize = bus->ci->ramsize;
if (!(bus->orig_ramsize)) {
@@ -5523,7 +5532,7 @@ fail:
return false;
}
-static bool brcmf_sdbrcm_probe_malloc(dhd_bus_t *bus, void *sdh)
+static bool brcmf_sdbrcm_probe_malloc(dhd_bus_t *bus, void *card)
{
DHD_TRACE(("%s: Enter\n", __func__));
@@ -5563,7 +5572,7 @@ fail:
return false;
}
-static bool brcmf_sdbrcm_probe_init(dhd_bus_t *bus, void *sdh)
+static bool brcmf_sdbrcm_probe_init(dhd_bus_t *bus, void *card)
{
s32 fnum;
@@ -5574,7 +5583,7 @@ static bool brcmf_sdbrcm_probe_init(dhd_bus_t *bus, void *sdh)
#endif /* SDTEST */
/* Disable F2 to clear any intermediate frame state on the dongle */
- brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_0, SDIO_CCCR_IOEx,
+ brcmf_sdcard_cfg_write(card, SDIO_FUNC_0, SDIO_CCCR_IOEx,
SDIO_FUNC_ENABLE_1, NULL);
bus->dhd->busstate = DHD_BUS_DOWN;
@@ -5583,7 +5592,7 @@ static bool brcmf_sdbrcm_probe_init(dhd_bus_t *bus, void *sdh)
bus->prev_rxlim_hit = 0;
/* Done with backplane-dependent accesses, can drop clock... */
- brcmf_sdcard_cfg_write(sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, 0,
+ brcmf_sdcard_cfg_write(card, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR, 0,
NULL);
/* ...and initialize clock/power states */
@@ -5593,7 +5602,7 @@ static bool brcmf_sdbrcm_probe_init(dhd_bus_t *bus, void *sdh)
/* Query the F2 block size, set roundup accordingly */
fnum = 2;
- if (brcmf_sdcard_iovar_op(sdh, "sd_blocksize", &fnum, sizeof(s32),
+ if (brcmf_sdcard_iovar_op(card, "sd_blocksize", &fnum, sizeof(s32),
&bus->blocksize, sizeof(s32), false) != 0) {
bus->blocksize = 0;
DHD_ERROR(("%s: fail on %s get\n", __func__, "sd_blocksize"));
@@ -5605,7 +5614,7 @@ static bool brcmf_sdbrcm_probe_init(dhd_bus_t *bus, void *sdh)
/* Query if bus module supports packet chaining,
default to use if supported */
- if (brcmf_sdcard_iovar_op(sdh, "sd_rxchain", NULL, 0,
+ if (brcmf_sdcard_iovar_op(card, "sd_rxchain", NULL, 0,
&bus->sd_rxchain, sizeof(s32),
false) != 0) {
bus->sd_rxchain = false;
@@ -5620,7 +5629,7 @@ static bool brcmf_sdbrcm_probe_init(dhd_bus_t *bus, void *sdh)
}
static bool
-brcmf_sdbrcm_download_firmware(struct dhd_bus *bus, void *sdh)
+brcmf_sdbrcm_download_firmware(struct dhd_bus *bus, void *card)
{
bool ret;
@@ -5641,8 +5650,8 @@ static void brcmf_sdbrcm_release(dhd_bus_t *bus)
if (bus) {
/* De-register interrupt handler */
- brcmf_sdcard_intr_disable(bus->sdh);
- brcmf_sdcard_intr_dereg(bus->sdh);
+ brcmf_sdcard_intr_disable(bus->card);
+ brcmf_sdcard_intr_dereg(bus->card);
if (bus->dhd) {
brcmf_detach(bus->dhd);
@@ -5947,7 +5956,7 @@ brcmf_sdbrcm_send_buf(dhd_bus_t *bus, u32 addr, uint fn, uint flags,
brcmf_sdio_cmplt_fn_t complete, void *handle)
{
return brcmf_sdcard_send_buf
- (bus->sdh, addr, fn, flags, buf, nbytes, pkt, complete,
+ (bus->card, addr, fn, flags, buf, nbytes, pkt, complete,
handle);
}
@@ -6006,14 +6015,14 @@ int brcmf_bus_devreset(struct brcmf_pub *dhdp, u8 flag)
if (bus->dhd->dongle_reset) {
/* Turn on WLAN */
/* Reset SD client */
- brcmf_sdcard_reset(bus->sdh);
+ brcmf_sdcard_reset(bus->card);
/* Attempt to re-attach & download */
- if (brcmf_sdbrcm_probe_attach(bus, bus->sdh,
+ if (brcmf_sdbrcm_probe_attach(bus, bus->card,
(u32 *) SI_ENUM_BASE,
bus->cl_devid)) {
/* Attempt to download binary to the dongle */
- if (brcmf_sdbrcm_probe_init(bus, bus->sdh)) {
+ if (brcmf_sdbrcm_probe_init(bus, bus->card)) {
/* Re-init bus, enable F2 transfer */
brcmf_sdbrcm_bus_init(
(struct brcmf_pub *) bus->dhd,
@@ -6040,8 +6049,8 @@ int brcmf_bus_devreset(struct brcmf_pub *dhdp, u8 flag)
}
static int
-brcmf_sdbrcm_chip_recognition(struct brcmf_sdio *sdh, struct chip_info *ci,
- void *regs)
+brcmf_sdbrcm_chip_recognition(struct brcmf_sdio_card *card,
+ struct chip_info *ci, void *regs)
{
u32 regdata;
@@ -6052,7 +6061,7 @@ brcmf_sdbrcm_chip_recognition(struct brcmf_sdio *sdh, struct chip_info *ci,
* other ways of recognition should be added here.
*/
ci->cccorebase = (u32)regs;
- regdata = brcmf_sdcard_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(card,
CORE_CC_REG(ci->cccorebase, chipid), 4);
ci->chip = regdata & CID_ID_MASK;
ci->chiprev = (regdata & CID_REV_MASK) >> CID_REV_SHIFT;
@@ -6074,15 +6083,15 @@ brcmf_sdbrcm_chip_recognition(struct brcmf_sdio *sdh, struct chip_info *ci,
return -ENODEV;
}
- regdata = brcmf_sdcard_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(card,
CORE_SB(ci->cccorebase, sbidhigh), 4);
ci->ccrev = SBCOREREV(regdata);
- regdata = brcmf_sdcard_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(card,
CORE_CC_REG(ci->cccorebase, pmucapabilities), 4);
ci->pmurev = regdata & PCAP_REV_MASK;
- regdata = brcmf_sdcard_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(card,
CORE_SB(ci->buscorebase, sbidhigh), 4);
ci->buscorerev = SBCOREREV(regdata);
ci->buscoretype = (regdata & SBIDH_CC_MASK) >> SBIDH_CC_SHIFT;
@@ -6092,87 +6101,87 @@ brcmf_sdbrcm_chip_recognition(struct brcmf_sdio *sdh, struct chip_info *ci,
ci->buscorerev, ci->buscoretype));
/* get chipcommon capabilites */
- ci->cccaps = brcmf_sdcard_reg_read(sdh,
+ ci->cccaps = brcmf_sdcard_reg_read(card,
CORE_CC_REG(ci->cccorebase, capabilities), 4);
return 0;
}
static void
-brcmf_sdbrcm_chip_disablecore(struct brcmf_sdio *sdh, u32 corebase)
+brcmf_sdbrcm_chip_disablecore(struct brcmf_sdio_card *card, u32 corebase)
{
u32 regdata;
- regdata = brcmf_sdcard_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(card,
CORE_SB(corebase, sbtmstatelow), 4);
if (regdata & SBTML_RESET)
return;
- regdata = brcmf_sdcard_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(card,
CORE_SB(corebase, sbtmstatelow), 4);
if ((regdata & (SICF_CLOCK_EN << SBTML_SICF_SHIFT)) != 0) {
/*
* set target reject and spin until busy is clear
* (preserve core-specific bits)
*/
- regdata = brcmf_sdcard_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(card,
CORE_SB(corebase, sbtmstatelow), 4);
- brcmf_sdcard_reg_write(sdh, CORE_SB(corebase, sbtmstatelow), 4,
+ brcmf_sdcard_reg_write(card, CORE_SB(corebase, sbtmstatelow), 4,
regdata | SBTML_REJ);
- regdata = brcmf_sdcard_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(card,
CORE_SB(corebase, sbtmstatelow), 4);
udelay(1);
- SPINWAIT((brcmf_sdcard_reg_read(sdh,
+ SPINWAIT((brcmf_sdcard_reg_read(card,
CORE_SB(corebase, sbtmstatehigh), 4) &
SBTMH_BUSY), 100000);
- regdata = brcmf_sdcard_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(card,
CORE_SB(corebase, sbtmstatehigh), 4);
if (regdata & SBTMH_BUSY)
DHD_ERROR(("%s: ARM core still busy\n", __func__));
- regdata = brcmf_sdcard_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(card,
CORE_SB(corebase, sbidlow), 4);
if (regdata & SBIDL_INIT) {
- regdata = brcmf_sdcard_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(card,
CORE_SB(corebase, sbimstate), 4) |
SBIM_RJ;
- brcmf_sdcard_reg_write(sdh,
+ brcmf_sdcard_reg_write(card,
CORE_SB(corebase, sbimstate), 4,
regdata);
- regdata = brcmf_sdcard_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(card,
CORE_SB(corebase, sbimstate), 4);
udelay(1);
- SPINWAIT((brcmf_sdcard_reg_read(sdh,
+ SPINWAIT((brcmf_sdcard_reg_read(card,
CORE_SB(corebase, sbimstate), 4) &
SBIM_BY), 100000);
}
/* set reset and reject while enabling the clocks */
- brcmf_sdcard_reg_write(sdh,
+ brcmf_sdcard_reg_write(card,
CORE_SB(corebase, sbtmstatelow), 4,
(((SICF_FGC | SICF_CLOCK_EN) << SBTML_SICF_SHIFT) |
SBTML_REJ | SBTML_RESET));
- regdata = brcmf_sdcard_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(card,
CORE_SB(corebase, sbtmstatelow), 4);
udelay(10);
/* clear the initiator reject bit */
- regdata = brcmf_sdcard_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(card,
CORE_SB(corebase, sbidlow), 4);
if (regdata & SBIDL_INIT) {
- regdata = brcmf_sdcard_reg_read(sdh,
+ regdata = brcmf_sdcard_reg_read(card,
CORE_SB(corebase, sbimstate), 4) &
~SBIM_RJ;
- brcmf_sdcard_reg_write(sdh,
+ brcmf_sdcard_reg_write(card,
CORE_SB(corebase, sbimstate), 4,
regdata);
}
}
/* leave reset and reject asserted */
- brcmf_sdcard_reg_write(sdh, CORE_SB(corebase, sbtmstatelow), 4,
+ brcmf_sdcard_reg_write(card, CORE_SB(corebase, sbtmstatelow), 4,
(SBTML_REJ | SBTML_RESET));
udelay(1);
}
@@ -6198,7 +6207,7 @@ brcmf_sdbrcm_chip_attach(struct dhd_bus *bus, void *regs)
/* bus/core/clk setup for register access */
/* Try forcing SDIO core to do ALPAvail request only */
clkset = SBSDIO_FORCE_HW_CLKREQ_OFF | SBSDIO_ALP_AVAIL_REQ;
- brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
+ brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
clkset, &err);
if (err) {
DHD_ERROR(("%s: error writing for HT off\n", __func__));
@@ -6207,11 +6216,11 @@ brcmf_sdbrcm_chip_attach(struct dhd_bus *bus, void *regs)
/* If register supported, wait for ALPAvail and then force ALP */
/* This may take up to 15 milliseconds */
- clkval = brcmf_sdcard_cfg_read(bus->sdh, SDIO_FUNC_1,
+ clkval = brcmf_sdcard_cfg_read(bus->card, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR, NULL);
if ((clkval & ~SBSDIO_AVBITS) == clkset) {
SPINWAIT(((clkval =
- brcmf_sdcard_cfg_read(bus->sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_read(bus->card, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR,
NULL)),
!SBSDIO_ALPAV(clkval)),
@@ -6224,7 +6233,7 @@ brcmf_sdbrcm_chip_attach(struct dhd_bus *bus, void *regs)
}
clkset = SBSDIO_FORCE_HW_CLKREQ_OFF |
SBSDIO_FORCE_ALP;
- brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_1,
+ brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_1,
SBSDIO_FUNC1_CHIPCLKCSR,
clkset, &err);
udelay(65);
@@ -6236,10 +6245,10 @@ brcmf_sdbrcm_chip_attach(struct dhd_bus *bus, void *regs)
}
/* Also, disable the extra SDIO pull-ups */
- brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_SDIOPULLUP,
+ brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_1, SBSDIO_FUNC1_SDIOPULLUP,
0, NULL);
- err = brcmf_sdbrcm_chip_recognition(bus->sdh, ci, regs);
+ err = brcmf_sdbrcm_chip_recognition(bus->card, ci, regs);
if (err)
goto fail;
@@ -6247,23 +6256,23 @@ brcmf_sdbrcm_chip_attach(struct dhd_bus *bus, void *regs)
* Make sure any on-chip ARM is off (in case strapping is wrong),
* or downloaded code was already running.
*/
- brcmf_sdbrcm_chip_disablecore(bus->sdh, ci->armcorebase);
+ brcmf_sdbrcm_chip_disablecore(bus->card, ci->armcorebase);
- brcmf_sdcard_reg_write(bus->sdh,
+ brcmf_sdcard_reg_write(bus->card,
CORE_CC_REG(ci->cccorebase, gpiopullup), 4, 0);
- brcmf_sdcard_reg_write(bus->sdh,
+ brcmf_sdcard_reg_write(bus->card,
CORE_CC_REG(ci->cccorebase, gpiopulldown), 4, 0);
/* Disable F2 to clear any intermediate frame state on the dongle */
- brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_0, SDIO_CCCR_IOEx,
+ brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_0, SDIO_CCCR_IOEx,
SDIO_FUNC_ENABLE_1, NULL);
/* WAR: cmd52 backplane read so core HW will drop ALPReq */
- clkval = brcmf_sdcard_cfg_read(bus->sdh, SDIO_FUNC_1,
+ clkval = brcmf_sdcard_cfg_read(bus->card, SDIO_FUNC_1,
0, NULL);
/* Done with backplane-dependent accesses, can drop clock... */
- brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
+ brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
0, NULL);
bus->ci = ci;
@@ -6275,7 +6284,7 @@ fail:
}
static void
-brcmf_sdbrcm_chip_resetcore(struct brcmf_sdio *sdh, u32 corebase)
+brcmf_sdbrcm_chip_resetcore(struct brcmf_sdio_card *card, u32 corebase)
{
u32 regdata;
@@ -6283,37 +6292,37 @@ brcmf_sdbrcm_chip_resetcore(struct brcmf_sdio *sdh, u32 corebase)
* Must do the disable sequence first to work for
* arbitrary current core state.
*/
- brcmf_sdbrcm_chip_disablecore(sdh, corebase);
+ brcmf_sdbrcm_chip_disablecore(card, corebase);
/*
* Now do the initialization sequence.
* set reset while enabling the clock and
* forcing them on throughout the core
*/
- brcmf_sdcard_reg_write(sdh, CORE_SB(corebase, sbtmstatelow), 4,
+ brcmf_sdcard_reg_write(card, CORE_SB(corebase, sbtmstatelow), 4,
((SICF_FGC | SICF_CLOCK_EN) << SBTML_SICF_SHIFT) |
SBTML_RESET);
udelay(1);
- regdata = brcmf_sdcard_reg_read(sdh, CORE_SB(corebase, sbtmstatehigh),
+ regdata = brcmf_sdcard_reg_read(card, CORE_SB(corebase, sbtmstatehigh),
4);
if (regdata & SBTMH_SERR)
- brcmf_sdcard_reg_write(sdh, CORE_SB(corebase, sbtmstatehigh),
+ brcmf_sdcard_reg_write(card, CORE_SB(corebase, sbtmstatehigh),
4, 0);
- regdata = brcmf_sdcard_reg_read(sdh, CORE_SB(corebase, sbimstate), 4);
+ regdata = brcmf_sdcard_reg_read(card, CORE_SB(corebase, sbimstate), 4);
if (regdata & (SBIM_IBE | SBIM_TO))
- brcmf_sdcard_reg_write(sdh, CORE_SB(corebase, sbimstate), 4,
+ brcmf_sdcard_reg_write(card, CORE_SB(corebase, sbimstate), 4,
regdata & ~(SBIM_IBE | SBIM_TO));
/* clear reset and allow it to propagate throughout the core */
- brcmf_sdcard_reg_write(sdh, CORE_SB(corebase, sbtmstatelow), 4,
+ brcmf_sdcard_reg_write(card, CORE_SB(corebase, sbtmstatelow), 4,
(SICF_FGC << SBTML_SICF_SHIFT) |
(SICF_CLOCK_EN << SBTML_SICF_SHIFT));
udelay(1);
/* leave clock enabled */
- brcmf_sdcard_reg_write(sdh, CORE_SB(corebase, sbtmstatelow), 4,
+ brcmf_sdcard_reg_write(card, CORE_SB(corebase, sbtmstatelow), 4,
(SICF_CLOCK_EN << SBTML_SICF_SHIFT));
udelay(1);
}
@@ -6407,15 +6416,15 @@ brcmf_sdbrcm_sdiod_drive_strength_init(struct dhd_bus *bus, u32 drivestrength) {
}
}
- brcmf_sdcard_reg_write(bus->sdh,
+ brcmf_sdcard_reg_write(bus->card,
CORE_CC_REG(bus->ci->cccorebase, chipcontrol_addr),
4, 1);
- cc_data_temp = brcmf_sdcard_reg_read(bus->sdh,
+ cc_data_temp = brcmf_sdcard_reg_read(bus->card,
CORE_CC_REG(bus->ci->cccorebase, chipcontrol_addr), 4);
cc_data_temp &= ~str_mask;
drivestrength_sel <<= str_shift;
cc_data_temp |= drivestrength_sel;
- brcmf_sdcard_reg_write(bus->sdh,
+ brcmf_sdcard_reg_write(bus->card,
CORE_CC_REG(bus->ci->cccorebase, chipcontrol_addr),
4, cc_data_temp);
diff --git a/drivers/staging/brcm80211/brcmfmac/sdio_host.h b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
index 17ea8b2..5c5bbca 100644
--- a/drivers/staging/brcm80211/brcmfmac/sdio_host.h
+++ b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
@@ -62,7 +62,7 @@ extern const uint brcmf_sdio_msglevel;
#define SDIOD_MAX_IOFUNCS 7
/* forward declarations */
-struct brcmf_sdio;
+struct brcmf_sdio_card;
typedef void (*brcmf_sdiocard_cb_fn_t) (void *);
/* Attach and build an interface to the underlying SD host driver.
@@ -73,35 +73,38 @@ typedef void (*brcmf_sdiocard_cb_fn_t) (void *);
* implementation may maintain a single "default" handle (e.g. the first or
* most recent one) to enable single-instance implementations to pass NULL.
*/
-extern struct brcmf_sdio *brcmf_sdcard_attach(void *cfghdl, void **regsva,
+extern struct brcmf_sdio_card *brcmf_sdcard_attach(void *cfghdl, void **regsva,
uint irq);
/* Detach - freeup resources allocated in attach */
-extern int brcmf_sdcard_detach(void *sdh);
+extern int brcmf_sdcard_detach(struct brcmf_sdio_card *card);
/* Query if SD device interrupts are enabled */
-extern bool brcmf_sdcard_intr_query(void *sdh);
+extern bool brcmf_sdcard_intr_query(struct brcmf_sdio_card *card);
/* Enable/disable SD interrupt */
-extern int brcmf_sdcard_intr_enable(void *sdh);
-extern int brcmf_sdcard_intr_disable(void *sdh);
+extern int brcmf_sdcard_intr_enable(struct brcmf_sdio_card *card);
+extern int brcmf_sdcard_intr_disable(struct brcmf_sdio_card *card);
/* Register/deregister device interrupt handler. */
extern int
-brcmf_sdcard_intr_reg(void *sdh, brcmf_sdiocard_cb_fn_t fn, void *argh);
+brcmf_sdcard_intr_reg(struct brcmf_sdio_card *card, brcmf_sdiocard_cb_fn_t fn,
+ void *argh);
-extern int brcmf_sdcard_intr_dereg(void *sdh);
+extern int brcmf_sdcard_intr_dereg(struct brcmf_sdio_card *card);
#if defined(BCMDBG)
/* Query pending interrupt status from the host controller */
-extern bool brcmf_sdcard_intr_pending(void *sdh);
+extern bool brcmf_sdcard_intr_pending(struct brcmf_sdio_card *card);
#endif
/* Register a callback to be called on device removal.
* No-op in the case of non-removable/hardwired devices.
*/
extern int
-brcmf_sdcard_devremove_reg(void *sdh, brcmf_sdiocard_cb_fn_t fn, void *argh);
+brcmf_sdcard_devremove_reg(struct brcmf_sdio_card *card,
+ brcmf_sdiocard_cb_fn_t fn,
+ void *argh);
/* Access SDIO address space (e.g. CCCR) using CMD52 (single-byte interface).
* fn: function number
@@ -109,15 +112,19 @@ brcmf_sdcard_devremove_reg(void *sdh, brcmf_sdiocard_cb_fn_t fn, void *argh);
* data: data byte to write
* err: pointer to error code (or NULL)
*/
-extern u8 brcmf_sdcard_cfg_read(void *sdh, uint func, u32 addr, int *err);
-extern void brcmf_sdcard_cfg_write(void *sdh, uint func, u32 addr, u8 data,
- int *err);
+extern u8 brcmf_sdcard_cfg_read(struct brcmf_sdio_card *card, uint func,
+ u32 addr, int *err);
+extern void brcmf_sdcard_cfg_write(struct brcmf_sdio_card *card, uint func,
+ u32 addr, u8 data, int *err);
/* Read/Write 4bytes from/to cfg space */
-extern u32 brcmf_sdcard_cfg_read_word(void *sdh, uint fnc_num, u32 addr,
- int *err);
-extern void brcmf_sdcard_cfg_write_word(void *sdh, uint fnc_num, u32 addr,
- u32 data, int *err);
+extern u32
+brcmf_sdcard_cfg_read_word(struct brcmf_sdio_card *card, uint fnc_num,
+ u32 addr, int *err);
+
+extern void brcmf_sdcard_cfg_write_word(struct brcmf_sdio_card *card,
+ uint fnc_num, u32 addr,
+ u32 data, int *err);
/* Read CIS content for specified function.
* fn: function whose CIS is being requested (0 is common CIS)
@@ -126,18 +133,23 @@ extern void brcmf_sdcard_cfg_write_word(void *sdh, uint fnc_num, u32 addr,
* Internally, this routine uses the values from the cis base regs (0x9-0xB)
* to form an SDIO-space address to read the data from.
*/
-extern int brcmf_sdcard_cis_read(void *sdh, uint func, u8 *cis, uint length);
+extern int brcmf_sdcard_cis_read(struct brcmf_sdio_card *card, uint func,
+ u8 *cis, uint length);
/* Synchronous access to device (client) core registers via CMD53 to F1.
* addr: backplane address (i.e. >= regsva from attach)
* size: register width in bytes (2 or 4)
* data: data for register write
*/
-extern u32 brcmf_sdcard_reg_read(void *sdh, u32 addr, uint size);
-extern u32 brcmf_sdcard_reg_write(void *sdh, u32 addr, uint size, u32 data);
+extern u32
+brcmf_sdcard_reg_read(struct brcmf_sdio_card *card, u32 addr, uint size);
+
+extern u32
+brcmf_sdcard_reg_write(struct brcmf_sdio_card *card, u32 addr, uint size,
+ u32 data);
/* Indicate if last reg read/write failed */
-extern bool brcmf_sdcard_regfail(void *sdh);
+extern bool brcmf_sdcard_regfail(struct brcmf_sdio_card *card);
/* Buffer transfer to/from device (client) core via cmd53.
* fn: function number
@@ -153,12 +165,14 @@ extern bool brcmf_sdcard_regfail(void *sdh);
*/
typedef void (*brcmf_sdio_cmplt_fn_t)
(void *handle, int status, bool sync_waiting);
-extern int brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags,
- u8 *buf, uint nbytes, void *pkt,
- brcmf_sdio_cmplt_fn_t complete, void *handle);
-extern int brcmf_sdcard_recv_buf(struct brcmf_sdio *sdh, u32 addr, uint fn,
- uint flags, u8 *buf, uint nbytes, struct sk_buff *pkt,
- brcmf_sdio_cmplt_fn_t complete, void *handle);
+extern int
+brcmf_sdcard_send_buf(struct brcmf_sdio_card *card, u32 addr, uint fn,
+ uint flags, u8 *buf, uint nbytes, void *pkt,
+ brcmf_sdio_cmplt_fn_t complete, void *handle);
+extern int
+brcmf_sdcard_recv_buf(struct brcmf_sdio_card *card, u32 addr, uint fn,
+ uint flags, u8 *buf, uint nbytes, struct sk_buff *pkt,
+ brcmf_sdio_cmplt_fn_t complete, void *handle);
/* Flags bits */
#define SDIO_REQ_4BYTE 0x1 /* Four-byte target (backplane) width (vs. two-byte) */
@@ -175,35 +189,35 @@ extern int brcmf_sdcard_recv_buf(struct brcmf_sdio *sdh, u32 addr, uint fn,
* nbytes: number of bytes to transfer to/from buf
* Returns 0 or error code.
*/
-extern int brcmf_sdcard_rwdata(void *sdh, uint rw, u32 addr, u8 *buf,
- uint nbytes);
+extern int brcmf_sdcard_rwdata(struct brcmf_sdio_card *card, uint rw, u32 addr,
+ u8 *buf, uint nbytes);
/* Issue an abort to the specified function */
-extern int brcmf_sdcard_abort(void *sdh, uint fn);
+extern int brcmf_sdcard_abort(struct brcmf_sdio_card *card, uint fn);
/* Start SDIO Host Controller communication */
-extern int brcmf_sdcard_start(void *sdh, int stage);
+extern int brcmf_sdcard_start(struct brcmf_sdio_card *card, int stage);
/* Stop SDIO Host Controller communication */
-extern int brcmf_sdcard_stop(void *sdh);
+extern int brcmf_sdcard_stop(struct brcmf_sdio_card *card);
/* Returns the "Device ID" of target device on the SDIO bus. */
-extern int brcmf_sdcard_query_device(void *sdh);
+extern int brcmf_sdcard_query_device(struct brcmf_sdio_card *card);
/* Returns the number of IO functions reported by the device */
-extern uint brcmf_sdcard_query_iofnum(void *sdh);
+extern uint brcmf_sdcard_query_iofnum(struct brcmf_sdio_card *card);
/* Miscellaneous knob tweaker. */
-extern int brcmf_sdcard_iovar_op(void *sdh, const char *name,
- void *params, int plen, void *arg, int len,
- bool set);
+extern int brcmf_sdcard_iovar_op(struct brcmf_sdio_card *card, const char *name,
+ void *params, int plen, void *arg, int len,
+ bool set);
/* Reset and reinitialize the device */
-extern int brcmf_sdcard_reset(struct brcmf_sdio *sdh);
+extern int brcmf_sdcard_reset(struct brcmf_sdio_card *card);
/* helper functions */
-extern void *brcmf_sdcard_get_sdioh(struct brcmf_sdio *sdh);
+extern void *brcmf_sdcard_get_sdioh(struct brcmf_sdio_card *card);
/* callback functions */
struct brcmf_sdioh_driver {
@@ -221,7 +235,7 @@ extern int brcmf_sdio_function_init(void);
extern int brcmf_sdio_register(struct brcmf_sdioh_driver *driver);
extern void brcmf_sdio_unregister(void);
extern bool brcmf_sdio_chipmatch(u16 vendor, u16 device);
-extern void brcmf_sdio_device_remove(void *sdh);
+extern void brcmf_sdio_device_remove(void *card);
extern void brcmf_sdio_function_cleanup(void);
extern void brcmf_sdioh_dev_intr_off(struct sdioh_info *sd);
@@ -230,12 +244,13 @@ extern int brcmf_sdio_probe(struct device *dev);
extern int brcmf_sdio_remove(struct device *dev);
/* Function to pass device-status bits to DHD. */
-extern u32 brcmf_sdcard_get_dstatus(void *sdh);
+extern u32 brcmf_sdcard_get_dstatus(struct brcmf_sdio_card *card);
/* Function to return current window addr */
-extern u32 brcmf_sdcard_cur_sbwad(void *sdh);
+extern u32 brcmf_sdcard_cur_sbwad(struct brcmf_sdio_card *card);
/* Function to pass chipid and rev to lower layers for controlling pr's */
-extern void brcmf_sdcard_chipinfo(void *sdh, u32 chip, u32 chiprev);
+extern void brcmf_sdcard_chipinfo(struct brcmf_sdio_card *card, u32 chip,
+ u32 chiprev);
#endif /* _BRCM_SDH_H_ */
--
1.7.1
From: Arend van Spriel <[email protected]>
The source file wl_iw.c is primarily intended to provide wireless
extensions functionality, which is to be removed from the driver.
The assert function is moved to another source file.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 50 +++++++++++++++++++++++
drivers/staging/brcm80211/brcmfmac/wl_iw.c | 51 ------------------------
2 files changed, 50 insertions(+), 51 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 386955e..e0cd8e1 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -46,6 +46,9 @@
#define EPI_VERSION_STR "4.218.248.5"
#define ETH_P_BRCM 0x886c
+/* Global ASSERT type flag */
+u32 g_assert_type;
+
#if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC)
#include <linux/wifi_tiwlan.h>
@@ -2766,3 +2769,50 @@ exit:
return ret;
}
#endif /* DHD_DEBUG */
+
+#if defined(BCMDBG)
+void osl_assert(char *exp, char *file, int line)
+{
+ char tempbuf[256];
+ char *basename;
+
+ basename = strrchr(file, '/');
+ /* skip the '/' */
+ if (basename)
+ basename++;
+
+ if (!basename)
+ basename = file;
+
+ snprintf(tempbuf, 256,
+ "assertion \"%s\" failed: file \"%s\", line %d\n", exp,
+ basename, line);
+
+ /*
+ * Print assert message and give it time to
+ * be written to /var/log/messages
+ */
+ if (!in_interrupt()) {
+ const int delay = 3;
+ printk(KERN_ERR "%s", tempbuf);
+ printk(KERN_ERR "panic in %d seconds\n", delay);
+ set_current_state(TASK_INTERRUPTIBLE);
+ schedule_timeout(delay * HZ);
+ }
+
+ switch (g_assert_type) {
+ case 0:
+ panic(KERN_ERR "%s", tempbuf);
+ break;
+ case 1:
+ printk(KERN_ERR "%s", tempbuf);
+ BUG();
+ break;
+ case 2:
+ printk(KERN_ERR "%s", tempbuf);
+ break;
+ default:
+ break;
+ }
+}
+#endif /* defined(BCMDBG) */
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_iw.c b/drivers/staging/brcm80211/brcmfmac/wl_iw.c
index e8b45ae..ef407ec 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_iw.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_iw.c
@@ -130,9 +130,6 @@ typedef enum sup_auth_status {
static const u8 ether_bcast[ETH_ALEN] = {255, 255, 255, 255, 255, 255};
-/* Global ASSERT type flag */
-u32 g_assert_type;
-
static void wl_iw_timerfunc(unsigned long data);
static void wl_iw_set_event_mask(struct net_device *dev);
static int wl_iw_iscan(iscan_info_t *iscan, wlc_ssid_t *ssid, u16 action);
@@ -3659,53 +3656,5 @@ void wl_iw_detach(void)
#endif /* WL_IW_USE_ISCAN */
kfree(g_scan);
-
g_scan = NULL;
}
-
-#if defined(BCMDBG)
-void osl_assert(char *exp, char *file, int line)
-{
- char tempbuf[256];
- char *basename;
-
- basename = strrchr(file, '/');
- /* skip the '/' */
- if (basename)
- basename++;
-
- if (!basename)
- basename = file;
-
- snprintf(tempbuf, 256,
- "assertion \"%s\" failed: file \"%s\", line %d\n", exp,
- basename, line);
-
- /*
- * Print assert message and give it time to
- * be written to /var/log/messages
- */
- if (!in_interrupt()) {
- const int delay = 3;
- printk(KERN_ERR "%s", tempbuf);
- printk(KERN_ERR "panic in %d seconds\n", delay);
- set_current_state(TASK_INTERRUPTIBLE);
- schedule_timeout(delay * HZ);
- }
-
- switch (g_assert_type) {
- case 0:
- panic(KERN_ERR "%s", tempbuf);
- break;
- case 1:
- printk(KERN_ERR "%s", tempbuf);
- BUG();
- break;
- case 2:
- printk(KERN_ERR "%s", tempbuf);
- break;
- default:
- break;
- }
-}
-#endif /* defined(BCMDBG) */
--
1.7.1
From: Arend van Spriel <[email protected]>
Structure definitions in dhd.h have been prefixed with brcmf_ for
consistent naming in fullmac driver and typedef of these structures
has been removed.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 130 +++++++++++----------
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 2 +-
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 12 +-
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 22 ++--
drivers/staging/brcm80211/brcmfmac/dhd_proto.h | 2 +-
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 103 +++++++++---------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h | 14 +-
7 files changed, 146 insertions(+), 139 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 2ebf015..93e0164 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -83,8 +83,9 @@
#define WLC_PHY_TYPE_LCN 8
#define WLC_PHY_TYPE_NULL 0xf
-#define WL_PKT_FILTER_FIXED_LEN offsetof(wl_pkt_filter_t, u)
-#define WL_PKT_FILTER_PATTERN_FIXED_LEN offsetof(wl_pkt_filter_pattern_t, mask_and_pattern)
+#define WL_PKT_FILTER_FIXED_LEN offsetof(struct brcmf_pkt_filter, u)
+#define WL_PKT_FILTER_PATTERN_FIXED_LEN \
+ offsetof(struct brcmf_pkt_filter_pattern, mask_and_pattern)
#define WL_EVENTING_MASK_LEN 16
@@ -94,9 +95,9 @@
/* maximum channels returned by the get valid channels iovar */
#define WL_NUMCHANNELS 64
-#define WL_BSS_INFO_VERSION 108 /* current ver of wl_bss_info struct */
+#define WL_BSS_INFO_VERSION 108 /* current ver of brcmf_bss_info struct */
-/* size of wl_scan_params not including variable length array */
+/* size of brcmf_scan_params not including variable length array */
#define WL_SCAN_PARAMS_FIXED_SIZE 64
/* masks for channel and ssid count */
@@ -109,7 +110,7 @@
#define ISCAN_REQ_VERSION 1
-/* wl_iscan_results status values */
+/* brcmf_iscan_results status values */
#define WL_SCAN_RESULTS_SUCCESS 0
#define WL_SCAN_RESULTS_PARTIAL 1
#define WL_SCAN_RESULTS_PENDING 2
@@ -319,7 +320,7 @@ enum dhd_bus_state {
* start matching, the pattern to match, the size of the pattern, and a bitmask
* that indicates which bits within the pattern should be matched.
*/
-typedef struct wl_pkt_filter_pattern {
+struct brcmf_pkt_filter_pattern {
u32 offset; /* Offset within received packet to start pattern matching.
* Offset '0' is the first byte of the ethernet header.
*/
@@ -327,29 +328,29 @@ typedef struct wl_pkt_filter_pattern {
u8 mask_and_pattern[1]; /* Variable length mask and pattern data. mask starts
* at offset 0. Pattern immediately follows mask.
*/
-} wl_pkt_filter_pattern_t;
+};
/* IOVAR "pkt_filter_add" parameter. Used to install packet filters. */
-typedef struct wl_pkt_filter {
+struct brcmf_pkt_filter {
u32 id; /* Unique filter id, specified by app. */
u32 type; /* Filter type (WL_PKT_FILTER_TYPE_xxx). */
u32 negate_match; /* Negate the result of filter matches */
union { /* Filter definitions */
- wl_pkt_filter_pattern_t pattern; /* Pattern matching filter */
+ struct brcmf_pkt_filter_pattern pattern; /* Filter pattern */
} u;
-} wl_pkt_filter_t;
+};
/* IOVAR "pkt_filter_enable" parameter. */
-typedef struct wl_pkt_filter_enable {
+struct brcmf_pkt_filter_enable {
u32 id; /* Unique filter id */
u32 enable; /* Enable/disable bool */
-} wl_pkt_filter_enable_t;
+};
/* BSS info structure
* Applications MUST CHECK ie_offset field and length field to access IEs and
- * next bss_info structure in a vector (in wl_scan_results_t)
+ * next bss_info structure in a vector (in struct brcmf_scan_results)
*/
-typedef struct wl_bss_info {
+struct brcmf_bss_info {
u32 version; /* version field */
u32 length; /* byte length of data in this record,
* starting at version and including IEs
@@ -382,15 +383,15 @@ typedef struct wl_bss_info {
s16 SNR; /* average SNR of during frame reception */
/* Add new fields here */
/* variable length Information Elements */
-} wl_bss_info_t;
+};
-typedef struct wlc_ssid {
+struct brcmf_ssid {
u32 SSID_len;
unsigned char SSID[32];
-} wlc_ssid_t;
+};
-typedef struct wl_scan_params {
- wlc_ssid_t ssid; /* default: {0, ""} */
+struct brcmf_scan_params {
+ struct brcmf_ssid ssid; /* default: {0, ""} */
u8 bssid[ETH_ALEN]; /* default: bcast */
s8 bss_type; /* default: any,
* DOT11_BSSTYPE_ANY/INFRASTRUCTURE/INDEPENDENT
@@ -408,71 +409,76 @@ typedef struct wl_scan_params {
*/
s32 channel_num; /* count of channels and ssids that follow
*
- * low half is count of channels in channel_list, 0
- * means default (use all available channels)
+ * low half is count of channels in
+ * channel_list, 0 means default (use all
+ * available channels)
*
- * high half is entries in wlc_ssid_t array that
- * follows channel_list, aligned for s32 (4 bytes)
- * meaning an odd channel count implies a 2-byte pad
- * between end of channel_list and first ssid
+ * high half is entries in struct brcmf_ssid
+ * array that follows channel_list, aligned for
+ * s32 (4 bytes) meaning an odd channel count
+ * implies a 2-byte pad between end of
+ * channel_list and first ssid
*
- * if ssid count is zero, single ssid in the fixed
- * parameter portion is assumed, otherwise ssid in
- * the fixed portion is ignored
+ * if ssid count is zero, single ssid in the
+ * fixed parameter portion is assumed, otherwise
+ * ssid in the fixed portion is ignored
*/
u16 channel_list[1]; /* list of chanspecs */
-} wl_scan_params_t;
+};
/* incremental scan struct */
-typedef struct wl_iscan_params {
+struct brcmf_iscan_params {
u32 version;
u16 action;
u16 scan_duration;
- wl_scan_params_t params;
-} wl_iscan_params_t;
+ struct brcmf_scan_params params;
+};
-/* 3 fields + size of wl_scan_params, not including variable length array */
-#define WL_ISCAN_PARAMS_FIXED_SIZE (offsetof(wl_iscan_params_t, params) + sizeof(wlc_ssid_t))
+/* 3 fields + size of brcmf_scan_params, not including variable length array */
+#define BRCMF_ISCAN_PARAMS_FIXED_SIZE \
+ (offsetof(struct brcmf_iscan_params, params) + \
+ sizeof(struct brcmf_ssid))
-typedef struct wl_scan_results {
+struct brcmf_scan_results {
u32 buflen;
u32 version;
u32 count;
- wl_bss_info_t bss_info[1];
-} wl_scan_results_t;
+ struct brcmf_bss_info bss_info[1];
+};
/* used for association with a specific BSSID and chanspec list */
-typedef struct wl_assoc_params {
+struct brcmf_assoc_params {
u8 bssid[ETH_ALEN]; /* 00:00:00:00:00:00: broadcast scan */
s32 chanspec_num; /* 0: all available channels,
* otherwise count of chanspecs in chanspec_list
*/
chanspec_t chanspec_list[1]; /* list of chanspecs */
-} wl_assoc_params_t;
-#define WL_ASSOC_PARAMS_FIXED_SIZE (sizeof(wl_assoc_params_t) - sizeof(chanspec_t))
+};
+#define WL_ASSOC_PARAMS_FIXED_SIZE \
+ (sizeof(struct brcmf_assoc_params) - sizeof(chanspec_t))
/* used for join with or without a specific bssid and channel list */
-typedef struct wl_join_params {
- wlc_ssid_t ssid;
- wl_assoc_params_t params; /* optional field, but it must include the fixed portion
- * of the wl_assoc_params_t struct when it does present.
- */
-} wl_join_params_t;
+struct brcmf_join_params {
+ struct brcmf_ssid ssid;
+ struct brcmf_assoc_params params;
+};
-/* size of wl_scan_results not including variable length array */
-#define WL_SCAN_RESULTS_FIXED_SIZE (sizeof(wl_scan_results_t) - sizeof(wl_bss_info_t))
+/* size of brcmf_scan_results not including variable length array */
+#define BRCMF_SCAN_RESULTS_FIXED_SIZE \
+ (sizeof(struct brcmf_scan_results) - sizeof(struct brcmf_bss_info))
/* incremental scan results struct */
-typedef struct wl_iscan_results {
+struct brcmf_iscan_results {
u32 status;
- wl_scan_results_t results;
-} wl_iscan_results_t;
+ struct brcmf_scan_results results;
+};
-/* size of wl_iscan_results not including variable length array */
-#define WL_ISCAN_RESULTS_FIXED_SIZE \
- (WL_SCAN_RESULTS_FIXED_SIZE + offsetof(wl_iscan_results_t, results))
+/* size of brcmf_iscan_results not including variable length array */
+#define BRCMF_ISCAN_RESULTS_FIXED_SIZE \
+ (BRCMF_SCAN_RESULTS_FIXED_SIZE + \
+ offsetof(struct brcmf_iscan_results, results))
-typedef struct wl_wsec_key {
+struct brcmf_wsec_key {
u32 index; /* key index */
u32 len; /* key length */
u8 data[WLAN_MAX_KEY_LEN]; /* key data */
@@ -490,30 +496,30 @@ typedef struct wl_wsec_key {
} rxiv;
u32 pad_5[2];
u8 ea[ETH_ALEN]; /* per station */
-} wl_wsec_key_t;
+};
/* Used to get specific STA parameters */
-typedef struct {
+struct brcmf_scb_val {
u32 val;
u8 ea[ETH_ALEN];
-} scb_val_t;
+};
/* channel encoding */
-typedef struct channel_info {
+struct brcmf_channel_info {
int hw_channel;
int target_channel;
int scan_channel;
-} channel_info_t;
+};
/* Linux network driver ioctl encoding */
-typedef struct wl_ioctl {
+struct brcmf_ioctl {
uint cmd; /* common ioctl definition */
void *buf; /* pointer to user buffer */
uint len; /* length of user buffer */
u8 set; /* get or set request (optional) */
uint used; /* bytes read or written (optional) */
uint needed; /* bytes needed (optional) */
-} wl_ioctl_t;
+};
/* Forward decls for struct dhd_pub (see below) */
struct dhd_bus; /* device bus info */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index 471869f..7efe69c 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -275,7 +275,7 @@ done:
extern int dhd_bus_interface(struct dhd_bus *bus, uint arg, void *arg2);
int
-brcmf_proto_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf,
+brcmf_proto_ioctl(dhd_pub_t *dhd, int ifidx, struct brcmf_ioctl *ioc, void *buf,
int len)
{
struct brcmf_proto *prot = dhd->prot;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 244ea72..84daa8e 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -886,8 +886,8 @@ brcmf_c_pktfilter_offload_enable(dhd_pub_t *drvr, char *arg, int enable,
char *arg_save = 0, *arg_org = 0;
int rc;
char buf[128];
- wl_pkt_filter_enable_t enable_parm;
- wl_pkt_filter_enable_t *pkt_filterp;
+ struct brcmf_pkt_filter_enable enable_parm;
+ struct brcmf_pkt_filter_enable *pkt_filterp;
arg_save = kmalloc(strlen(arg) + 1, GFP_ATOMIC);
if (!arg_save) {
@@ -911,7 +911,7 @@ brcmf_c_pktfilter_offload_enable(dhd_pub_t *drvr, char *arg, int enable,
buf[str_len] = '\0';
buf_len = str_len + 1;
- pkt_filterp = (wl_pkt_filter_enable_t *) (buf + str_len + 1);
+ pkt_filterp = (struct brcmf_pkt_filter_enable *) (buf + str_len + 1);
/* Parse packet filter id. */
enable_parm.id = simple_strtoul(argv[i], NULL, 0);
@@ -949,8 +949,8 @@ fail:
void brcmf_c_pktfilter_offload_set(dhd_pub_t *drvr, char *arg)
{
const char *str;
- wl_pkt_filter_t pkt_filter;
- wl_pkt_filter_t *pkt_filterp;
+ struct brcmf_pkt_filter pkt_filter;
+ struct brcmf_pkt_filter *pkt_filterp;
int buf_len;
int str_len;
int rc;
@@ -998,7 +998,7 @@ void brcmf_c_pktfilter_offload_set(dhd_pub_t *drvr, char *arg)
buf[str_len] = '\0';
buf_len = str_len + 1;
- pkt_filterp = (wl_pkt_filter_t *) (buf + str_len + 1);
+ pkt_filterp = (struct brcmf_pkt_filter *) (buf + str_len + 1);
/* Parse packet filter id. */
pkt_filter.id = simple_strtoul(argv[i], NULL, 0);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 04b4511..6b2682f 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -209,7 +209,7 @@ static void brcmf_set_packet_filter(int value, dhd_pub_t *drvr)
static int brcmf_set_suspend(int value, dhd_pub_t *drvr)
{
int power_mode = PM_MAX;
- /* wl_pkt_filter_enable_t enable_parm; */
+ /* struct wl_pkt_filter_enable enable_parm; */
char iovbuf[32];
int bcn_li_dtim = 3;
@@ -426,7 +426,7 @@ static void _brcmf_set_multicast_list(dhd_info_t *drvr_priv, int ifidx)
struct netdev_hw_addr *ha;
u32 allmulti, cnt;
- wl_ioctl_t ioc;
+ struct brcmf_ioctl ioc;
char *buf, *bufp;
uint buflen;
int ret;
@@ -539,7 +539,7 @@ static void _brcmf_set_multicast_list(dhd_info_t *drvr_priv, int ifidx)
static int _brcmf_set_mac_address(dhd_info_t *drvr_priv, int ifidx, u8 *addr)
{
char buf[32];
- wl_ioctl_t ioc;
+ struct brcmf_ioctl ioc;
int ret;
DHD_TRACE(("%s enter\n", __func__));
@@ -993,7 +993,7 @@ static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net)
as a bitmap in toe_ol iovar */
static int brcmf_toe_get(dhd_info_t *drvr_priv, int ifidx, u32 *toe_ol)
{
- wl_ioctl_t ioc;
+ struct brcmf_ioctl ioc;
char buf[32];
int ret;
@@ -1027,7 +1027,7 @@ static int brcmf_toe_get(dhd_info_t *drvr_priv, int ifidx, u32 *toe_ol)
and set toe global enable iovar */
static int brcmf_toe_set(dhd_info_t *drvr_priv, int ifidx, u32 toe_ol)
{
- wl_ioctl_t ioc;
+ struct brcmf_ioctl ioc;
char buf[32];
int toe, ret;
@@ -1220,7 +1220,7 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
memset(&ioc, 0, sizeof(ioc));
/* Copy the ioc control structure part of ioctl request */
- if (copy_from_user(&ioc, ifr->ifr_data, sizeof(wl_ioctl_t))) {
+ if (copy_from_user(&ioc, ifr->ifr_data, sizeof(struct brcmf_ioctl))) {
bcmerror = -EINVAL;
goto done;
}
@@ -1248,8 +1248,8 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
}
/* To differentiate between wl and dhd read 4 more byes */
- if ((copy_from_user(&driver, (char *)ifr->ifr_data + sizeof(wl_ioctl_t),
- sizeof(uint)) != 0)) {
+ if ((copy_from_user(&driver, (char *)ifr->ifr_data +
+ sizeof(struct brcmf_ioctl), sizeof(uint)) != 0)) {
bcmerror = -EINVAL;
goto done;
}
@@ -1292,8 +1292,8 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
brcmf_netdev_wait_pend8021x(net);
bcmerror =
- brcmf_proto_ioctl(&drvr_priv->pub, ifidx, (wl_ioctl_t *)&ioc, buf,
- buflen);
+ brcmf_proto_ioctl(&drvr_priv->pub, ifidx, (struct brcmf_ioctl *)&ioc,
+ buf, buflen);
done:
if (!bcmerror && buf && ioc.buf) {
@@ -1604,7 +1604,7 @@ int brcmf_iovar(dhd_pub_t *drvr, int ifidx, char *name, char *cmd_buf,
{
char buf[strlen(name) + 1 + cmd_len];
int len = sizeof(buf);
- wl_ioctl_t ioc;
+ struct brcmf_ioctl ioc;
int ret;
len = brcmu_mkiovar(name, cmd_buf, cmd_len, buf, len);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_proto.h b/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
index f8ca781..4ac2cd1 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
@@ -52,7 +52,7 @@ extern void brcmf_proto_hdrpush(dhd_pub_t *, int ifidx, struct sk_buff *txp);
extern int brcmf_proto_hdrpull(dhd_pub_t *, int *ifidx, struct sk_buff *rxp);
/* Use protocol to issue ioctl to dongle */
-extern int brcmf_proto_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc,
+extern int brcmf_proto_ioctl(dhd_pub_t *dhd, int ifidx, struct brcmf_ioctl *ioc,
void *buf, int len);
/* Check for and handle local prot-specific iovar commands */
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index 9d86fc1..aeb305c 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -186,7 +186,7 @@ static s32 wl_set_set_sharedkey(struct net_device *dev,
static s32 wl_get_assoc_ies(struct wl_priv *wl);
static void wl_clear_assoc_ies(struct wl_priv *wl);
static void wl_ch_to_chanspec(int ch,
- struct wl_join_params *join_params, size_t *join_params_size);
+ struct brcmf_join_params *join_params, size_t *join_params_size);
/*
** information element utilities
@@ -197,7 +197,7 @@ static struct wireless_dev *wl_alloc_wdev(s32 sizeof_iface,
struct device *dev);
static void wl_free_wdev(struct wl_priv *wl);
static s32 wl_inform_bss(struct wl_priv *wl);
-static s32 wl_inform_single_bss(struct wl_priv *wl, struct wl_bss_info *bi);
+static s32 wl_inform_single_bss(struct wl_priv *wl, struct brcmf_bss_info *bi);
static s32 wl_update_bss_info(struct wl_priv *wl);
static s32 wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, const u8 *mac_addr,
@@ -206,8 +206,8 @@ static s32 wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
/*
** key indianess swap utilities
*/
-static void swap_key_from_BE(struct wl_wsec_key *key);
-static void swap_key_to_BE(struct wl_wsec_key *key);
+static void swap_key_from_BE(struct brcmf_wsec_key *key);
+static void swap_key_to_BE(struct brcmf_wsec_key *key);
/*
** wl_priv memory init/deinit utilities
@@ -264,13 +264,13 @@ static s32 wl_dev_iovar_setbuf(struct net_device *dev, s8 *iovar,
static s32 wl_dev_iovar_getbuf(struct net_device *dev, s8 *iovar,
void *param, s32 paramlen, void *bufptr,
s32 buflen);
-static s32 wl_run_iscan(struct wl_iscan_ctrl *iscan, struct wlc_ssid *ssid,
+static s32 wl_run_iscan(struct wl_iscan_ctrl *iscan, struct brcmf_ssid *ssid,
u16 action);
static s32 wl_do_iscan(struct wl_priv *wl);
static s32 wl_wakeup_iscan(struct wl_iscan_ctrl *iscan);
static s32 wl_invoke_iscan(struct wl_priv *wl);
static s32 wl_get_iscan_results(struct wl_iscan_ctrl *iscan, u32 *status,
- struct wl_scan_results **bss_list);
+ struct brcmf_scan_results **bss_list);
static void wl_notify_iscan_complete(struct wl_iscan_ctrl *iscan, bool aborted);
static void wl_init_iscan_eloop(struct wl_iscan_eloop *el);
static s32 wl_iscan_done(struct wl_priv *wl);
@@ -492,7 +492,7 @@ static const u32 __wl_cipher_suites[] = {
WLAN_CIPHER_SUITE_AES_CMAC,
};
-static void swap_key_from_BE(struct wl_wsec_key *key)
+static void swap_key_from_BE(struct brcmf_wsec_key *key)
{
key->index = cpu_to_le32(key->index);
key->len = cpu_to_le32(key->len);
@@ -503,7 +503,7 @@ static void swap_key_from_BE(struct wl_wsec_key *key)
key->iv_initialized = cpu_to_le32(key->iv_initialized);
}
-static void swap_key_to_BE(struct wl_wsec_key *key)
+static void swap_key_to_BE(struct brcmf_wsec_key *key)
{
key->index = le32_to_cpu(key->index);
key->len = le32_to_cpu(key->len);
@@ -518,7 +518,7 @@ static s32
wl_dev_ioctl(struct net_device *dev, u32 cmd, void *arg, u32 len)
{
struct ifreq ifr;
- struct wl_ioctl ioc;
+ struct brcmf_ioctl ioc;
mm_segment_t fs;
s32 err = 0;
@@ -588,7 +588,8 @@ done:
return err;
}
-static void wl_iscan_prep(struct wl_scan_params *params, struct wlc_ssid *ssid)
+static void wl_iscan_prep(struct brcmf_scan_params *params,
+ struct brcmf_ssid *ssid)
{
memcpy(params->bssid, ether_bcast, ETH_ALEN);
params->bss_type = DOT11_BSSTYPE_ANY;
@@ -604,7 +605,7 @@ static void wl_iscan_prep(struct wl_scan_params *params, struct wlc_ssid *ssid)
params->passive_time = cpu_to_le32(params->passive_time);
params->home_time = cpu_to_le32(params->home_time);
if (ssid && ssid->SSID_len)
- memcpy(¶ms->ssid, ssid, sizeof(wlc_ssid_t));
+ memcpy(¶ms->ssid, ssid, sizeof(struct brcmf_ssid));
}
@@ -633,15 +634,15 @@ wl_dev_iovar_getbuf(struct net_device *dev, s8 * iovar, void *param,
}
static s32
-wl_run_iscan(struct wl_iscan_ctrl *iscan, struct wlc_ssid *ssid, u16 action)
+wl_run_iscan(struct wl_iscan_ctrl *iscan, struct brcmf_ssid *ssid, u16 action)
{
- s32 params_size =
- (WL_SCAN_PARAMS_FIXED_SIZE + offsetof(wl_iscan_params_t, params));
- struct wl_iscan_params *params;
+ s32 params_size = (WL_SCAN_PARAMS_FIXED_SIZE +
+ offsetof(struct brcmf_iscan_params, params));
+ struct brcmf_iscan_params *params;
s32 err = 0;
if (ssid && ssid->SSID_len)
- params_size += sizeof(struct wlc_ssid);
+ params_size += sizeof(struct brcmf_ssid);
params = kzalloc(params_size, GFP_KERNEL);
if (unlikely(!params))
return -ENOMEM;
@@ -653,7 +654,7 @@ wl_run_iscan(struct wl_iscan_ctrl *iscan, struct wlc_ssid *ssid, u16 action)
params->action = cpu_to_le16(action);
params->scan_duration = cpu_to_le16(0);
- /* params_size += offsetof(wl_iscan_params_t, params); */
+ /* params_size += offsetof(struct brcmf_iscan_params, params); */
err = wl_dev_iovar_setbuf(iscan->dev, "iscan", params, params_size,
iscan->ioctl_buf, BRCMF_C_IOCTL_SMLEN);
if (unlikely(err)) {
@@ -671,7 +672,7 @@ static s32 wl_do_iscan(struct wl_priv *wl)
{
struct wl_iscan_ctrl *iscan = wl_to_iscan(wl);
struct net_device *ndev = wl_to_ndev(wl);
- struct wlc_ssid ssid;
+ struct brcmf_ssid ssid;
s32 passive_scan;
s32 err = 0;
@@ -933,7 +934,7 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
struct cfg80211_ibss_params *params)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
- struct wl_join_params join_params;
+ struct brcmf_join_params join_params;
size_t join_params_size = 0;
s32 err = 0;
s32 wsec = 0;
@@ -1011,7 +1012,7 @@ wl_cfg80211_join_ibss(struct wiphy *wiphy, struct net_device *dev,
}
/* Configure required join parameter */
- memset(&join_params, 0, sizeof(wl_join_params_t));
+ memset(&join_params, 0, sizeof(struct brcmf_join_params));
/* SSID */
join_params.ssid.SSID_len =
@@ -1278,7 +1279,7 @@ wl_set_set_sharedkey(struct net_device *dev,
{
struct wl_priv *wl = ndev_to_wl(dev);
struct wl_security *sec;
- struct wl_wsec_key key;
+ struct brcmf_wsec_key key;
s32 val;
s32 err = 0;
@@ -1344,7 +1345,7 @@ wl_cfg80211_connect(struct wiphy *wiphy, struct net_device *dev,
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
struct ieee80211_channel *chan = sme->channel;
- struct wl_join_params join_params;
+ struct brcmf_join_params join_params;
size_t join_params_size;
s32 err = 0;
@@ -1440,7 +1441,7 @@ wl_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
u16 reason_code)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
- scb_val_t scbval;
+ struct brcmf_scb_val scbval;
s32 err = 0;
WL_TRACE("Enter. Reason code = %d\n", reason_code);
@@ -1452,7 +1453,7 @@ wl_cfg80211_disconnect(struct wiphy *wiphy, struct net_device *dev,
memcpy(&scbval.ea, wl_read_prof(wl, WL_PROF_BSSID), ETH_ALEN);
scbval.val = cpu_to_le32(scbval.val);
err = wl_dev_ioctl(dev, BRCMF_C_DISASSOC, &scbval,
- sizeof(scb_val_t));
+ sizeof(struct brcmf_scb_val));
if (unlikely(err))
WL_ERR("error (%d)\n", err);
@@ -1578,7 +1579,7 @@ static s32
wl_add_keyext(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, const u8 *mac_addr, struct key_params *params)
{
- struct wl_wsec_key key;
+ struct brcmf_wsec_key key;
s32 err = 0;
memset(&key, 0, sizeof(key));
@@ -1666,7 +1667,7 @@ wl_cfg80211_add_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, bool pairwise, const u8 *mac_addr,
struct key_params *params)
{
- struct wl_wsec_key key;
+ struct brcmf_wsec_key key;
s32 val;
s32 wsec;
s32 err = 0;
@@ -1759,7 +1760,7 @@ static s32
wl_cfg80211_del_key(struct wiphy *wiphy, struct net_device *dev,
u8 key_idx, bool pairwise, const u8 *mac_addr)
{
- struct wl_wsec_key key;
+ struct brcmf_wsec_key key;
s32 err = 0;
s32 val;
s32 wsec;
@@ -1826,7 +1827,7 @@ wl_cfg80211_get_key(struct wiphy *wiphy, struct net_device *dev,
void (*callback) (void *cookie, struct key_params * params))
{
struct key_params params;
- struct wl_wsec_key key;
+ struct brcmf_wsec_key key;
struct wl_priv *wl = wiphy_to_wl(wiphy);
struct wl_security *sec;
s32 wsec;
@@ -1897,7 +1898,7 @@ wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
u8 *mac, struct station_info *sinfo)
{
struct wl_priv *wl = wiphy_to_wl(wiphy);
- scb_val_t scb_val;
+ struct brcmf_scb_val scb_val;
int rssi;
s32 rate;
s32 err = 0;
@@ -1931,7 +1932,7 @@ wl_cfg80211_get_station(struct wiphy *wiphy, struct net_device *dev,
if (test_bit(WL_STATUS_CONNECTED, &wl->status)) {
scb_val.val = 0;
err = wl_dev_ioctl(dev, BRCMF_C_GET_RSSI, &scb_val,
- sizeof(scb_val_t));
+ sizeof(struct brcmf_scb_val));
if (unlikely(err)) {
WL_ERR("Could not get rssi (%d)\n", err);
}
@@ -2379,8 +2380,8 @@ static void wl_free_wdev(struct wl_priv *wl)
static s32 wl_inform_bss(struct wl_priv *wl)
{
- struct wl_scan_results *bss_list;
- struct wl_bss_info *bi = NULL; /* must be initialized */
+ struct brcmf_scan_results *bss_list;
+ struct brcmf_bss_info *bi = NULL; /* must be initialized */
s32 err = 0;
int i;
@@ -2401,7 +2402,7 @@ static s32 wl_inform_bss(struct wl_priv *wl)
}
-static s32 wl_inform_single_bss(struct wl_priv *wl, struct wl_bss_info *bi)
+static s32 wl_inform_single_bss(struct wl_priv *wl, struct brcmf_bss_info *bi)
{
struct wiphy *wiphy = wl_to_wiphy(wl);
struct ieee80211_channel *notify_channel;
@@ -2466,7 +2467,7 @@ wl_inform_ibss(struct wl_priv *wl, struct net_device *dev, const u8 *bssid)
{
struct wiphy *wiphy = wl_to_wiphy(wl);
struct ieee80211_channel *notify_channel;
- struct wl_bss_info *bi = NULL;
+ struct brcmf_bss_info *bi = NULL;
struct ieee80211_supported_band *band;
u8 *buf = NULL;
s32 err = 0;
@@ -2496,7 +2497,7 @@ wl_inform_ibss(struct wl_priv *wl, struct net_device *dev, const u8 *bssid)
goto CleanUp;
}
- bi = (wl_bss_info_t *)(buf + 4);
+ bi = (struct brcmf_bss_info *)(buf + 4);
channel = bi->ctl_ch ? bi->ctl_ch :
CHSPEC_CHANNEL(le16_to_cpu(bi->chanspec));
@@ -2743,7 +2744,7 @@ static void wl_clear_assoc_ies(struct wl_priv *wl)
}
-static void wl_ch_to_chanspec(int ch, struct wl_join_params *join_params,
+static void wl_ch_to_chanspec(int ch, struct brcmf_join_params *join_params,
size_t *join_params_size)
{
chanspec_t chanspec = 0;
@@ -2779,8 +2780,8 @@ static void wl_ch_to_chanspec(int ch, struct wl_join_params *join_params,
static s32 wl_update_bss_info(struct wl_priv *wl)
{
- struct wl_bss_info *bi;
- struct wlc_ssid *ssid;
+ struct brcmf_bss_info *bi;
+ struct brcmf_ssid *ssid;
struct brcmu_tlv *tim;
u16 beacon_interval;
u8 dtim_period;
@@ -2792,7 +2793,7 @@ static s32 wl_update_bss_info(struct wl_priv *wl)
if (wl_is_ibssmode(wl))
return err;
- ssid = (struct wlc_ssid *)wl_read_prof(wl, WL_PROF_SSID);
+ ssid = (struct brcmf_ssid *)wl_read_prof(wl, WL_PROF_SSID);
*(u32 *)wl->extra_buf = cpu_to_le32(WL_EXTRA_BUF_MAX);
err = wl_dev_ioctl(wl_to_ndev(wl), BRCMF_C_GET_BSS_INFO,
@@ -2802,7 +2803,7 @@ static s32 wl_update_bss_info(struct wl_priv *wl)
goto update_bss_info_out;
}
- bi = (struct wl_bss_info *)(wl->extra_buf + 4);
+ bi = (struct brcmf_bss_info *)(wl->extra_buf + 4);
err = wl_inform_single_bss(wl, bi);
if (unlikely(err))
goto update_bss_info_out;
@@ -2917,8 +2918,8 @@ static s32
wl_notify_scan_status(struct wl_priv *wl, struct net_device *ndev,
const brcmf_event_msg_t *e, void *data)
{
- struct channel_info channel_inform;
- struct wl_scan_results *bss_list;
+ struct brcmf_channel_info channel_inform;
+ struct brcmf_scan_results *bss_list;
u32 len = WL_SCAN_BUF_MAX;
s32 err = 0;
bool scan_abort = false;
@@ -3153,24 +3154,24 @@ static s32 wl_wakeup_iscan(struct wl_iscan_ctrl *iscan)
static s32
wl_get_iscan_results(struct wl_iscan_ctrl *iscan, u32 *status,
- struct wl_scan_results **bss_list)
+ struct brcmf_scan_results **bss_list)
{
- struct wl_iscan_results list;
- struct wl_scan_results *results;
- struct wl_iscan_results *list_buf;
+ struct brcmf_iscan_results list;
+ struct brcmf_scan_results *results;
+ struct brcmf_iscan_results *list_buf;
s32 err = 0;
memset(iscan->scan_buf, 0, WL_ISCAN_BUF_MAX);
- list_buf = (struct wl_iscan_results *)iscan->scan_buf;
+ list_buf = (struct brcmf_iscan_results *)iscan->scan_buf;
results = &list_buf->results;
- results->buflen = WL_ISCAN_RESULTS_FIXED_SIZE;
+ results->buflen = BRCMF_ISCAN_RESULTS_FIXED_SIZE;
results->version = 0;
results->count = 0;
memset(&list, 0, sizeof(list));
list.results.buflen = cpu_to_le32(WL_ISCAN_BUF_MAX);
err = wl_dev_iovar_getbuf(iscan->dev, "iscanresults", &list,
- WL_ISCAN_RESULTS_FIXED_SIZE, iscan->scan_buf,
+ BRCMF_ISCAN_RESULTS_FIXED_SIZE, iscan->scan_buf,
WL_ISCAN_BUF_MAX);
if (unlikely(err)) {
WL_ERR("error (%d)\n", err);
@@ -3930,11 +3931,11 @@ wl_update_prof(struct wl_priv *wl, const brcmf_event_msg_t *e, void *data,
s32 item)
{
s32 err = 0;
- struct wlc_ssid *ssid;
+ struct brcmf_ssid *ssid;
switch (item) {
case WL_PROF_SSID:
- ssid = (wlc_ssid_t *) data;
+ ssid = (struct brcmf_ssid *) data;
memset(wl->profile->ssid.SSID, 0,
sizeof(wl->profile->ssid.SSID));
memcpy(wl->profile->ssid.SSID, ssid->SSID, ssid->SSID_len);
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
index 7848b3c..3400cc9 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
@@ -206,7 +206,7 @@ struct wl_cfg80211_bss_info {
/* basic structure of scan request */
struct wl_scan_req {
- struct wlc_ssid ssid;
+ struct brcmf_ssid ssid;
};
/* basic structure of information element */
@@ -244,7 +244,7 @@ struct wl_ibss {
/* dongle profile */
struct wl_profile {
u32 mode;
- struct wlc_ssid ssid;
+ struct brcmf_ssid ssid;
u8 bssid[ETH_ALEN];
u16 beacon_interval;
u8 dtim_period;
@@ -303,9 +303,9 @@ struct wl_priv {
struct list_head eq_list; /* used for event queue */
spinlock_t eq_lock; /* for event queue synchronization */
struct mutex usr_sync; /* maily for dongle up/down synchronization */
- struct wl_scan_results *bss_list; /* bss_list holding scanned
+ struct brcmf_scan_results *bss_list; /* bss_list holding scanned
ap information */
- struct wl_scan_results *scan_results;
+ struct brcmf_scan_results *scan_results;
struct wl_scan_req *scan_req_int; /* scan request object for
internal purpose */
struct wl_cfg80211_bss_info *bss_info; /* bss information for
@@ -354,11 +354,11 @@ struct wl_priv {
#define wl_to_iscan(w) (w->iscan)
#define wl_to_conn(w) (&w->conn_info)
-static inline struct wl_bss_info *next_bss(struct wl_scan_results *list,
- struct wl_bss_info *bss)
+static inline struct brcmf_bss_info *next_bss(struct brcmf_scan_results *list,
+ struct brcmf_bss_info *bss)
{
return bss = bss ?
- (struct wl_bss_info *)((unsigned long)bss +
+ (struct brcmf_bss_info *)((unsigned long)bss +
le32_to_cpu(bss->length)) :
list->bss_info;
}
--
1.7.1
From: Arend van Spriel <[email protected]>
The source dhd_linux_sched.c provided function setScheduler, but it
simply calls sched_setscheduler() linux function. The setScheduler()
function has been removed.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/Makefile | 1 -
drivers/staging/brcm80211/brcmfmac/dhd.h | 2 -
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 4 +-
.../staging/brcm80211/brcmfmac/dhd_linux_sched.c | 25 --------------------
4 files changed, 2 insertions(+), 30 deletions(-)
delete mode 100644 drivers/staging/brcm80211/brcmfmac/dhd_linux_sched.c
diff --git a/drivers/staging/brcm80211/brcmfmac/Makefile b/drivers/staging/brcm80211/brcmfmac/Makefile
index d907cae..4963155 100644
--- a/drivers/staging/brcm80211/brcmfmac/Makefile
+++ b/drivers/staging/brcm80211/brcmfmac/Makefile
@@ -45,7 +45,6 @@ DHDOFILES = \
dhd_custom_gpio.o \
dhd_sdio.o \
dhd_linux.o \
- dhd_linux_sched.o \
bcmsdh.o \
bcmsdh_linux.o \
bcmsdh_sdmmc.o \
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 46381bb..bccda7f 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -938,8 +938,6 @@ extern int write_to_file(dhd_pub_t *dhd, u8 *buf, int size);
extern int dhd_customer_oob_irq_map(unsigned long *irq_flags_ptr);
#endif /* defined(OOB_INTR_ONLY) */
-int setScheduler(struct task_struct *p, int policy, struct sched_param *param);
-
extern void dhd_timeout_start(dhd_timeout_t *tmo, uint usec);
extern int dhd_timeout_expired(dhd_timeout_t *tmo);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 2d4e2c7..bebdd4d 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -1244,7 +1244,7 @@ static int dhd_watchdog_thread(void *data)
struct sched_param param;
param.sched_priority = (dhd_watchdog_prio < MAX_RT_PRIO) ?
dhd_watchdog_prio : (MAX_RT_PRIO - 1);
- setScheduler(current, SCHED_FIFO, ¶m);
+ sched_setscheduler(current, SCHED_FIFO, ¶m);
}
#endif /* DHD_SCHED */
@@ -1305,7 +1305,7 @@ static int dhd_dpc_thread(void *data)
param.sched_priority =
(dhd_dpc_prio <
MAX_RT_PRIO) ? dhd_dpc_prio : (MAX_RT_PRIO - 1);
- setScheduler(current, SCHED_FIFO, ¶m);
+ sched_setscheduler(current, SCHED_FIFO, ¶m);
}
#endif /* DHD_SCHED */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux_sched.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux_sched.c
deleted file mode 100644
index c66f1c2..0000000
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux_sched.c
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * Copyright (c) 2010 Broadcom Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-#include <linux/kernel.h>
-#include <linux/module.h>
-#include <linux/sched.h>
-
-int setScheduler(struct task_struct *p, int policy, struct sched_param *param)
-{
- int rc = 0;
- rc = sched_setscheduler(p, policy, param);
- return rc;
-}
--
1.7.1
Move sdio specific tx queue lock codes to dhd_sdio.c for fullmac
Signed-off-by: Franky Lin <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 2 --
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 18 ------------------
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 14 +++++++++-----
3 files changed, 9 insertions(+), 25 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 01bacdb..a4dcaf8 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -972,8 +972,6 @@ extern void dhd_os_close_image(void *image);
extern void dhd_os_wd_timer(void *bus, uint wdtick);
extern void dhd_os_sdlock(dhd_pub_t *pub);
extern void dhd_os_sdunlock(dhd_pub_t *pub);
-extern void dhd_os_sdlock_txq(dhd_pub_t *pub);
-extern void dhd_os_sdunlock_txq(dhd_pub_t *pub);
extern void dhd_os_sdlock_sndup_rxq(dhd_pub_t *pub);
extern void dhd_customer_gpio_wlan_ctrl(int onoff);
extern int dhd_custom_get_mac_address(unsigned char *buf);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 4811d7a..dfbbda7 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -232,7 +232,6 @@ typedef struct dhd_info {
bool wd_timer_valid;
struct tasklet_struct tasklet;
spinlock_t sdlock;
- spinlock_t txqlock;
/* Thread based operation */
bool threads_only;
struct semaphore sdsem;
@@ -1918,7 +1917,6 @@ dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen)
/* Initialize the spinlocks */
spin_lock_init(&dhd->sdlock);
- spin_lock_init(&dhd->txqlock);
/* Link to info module */
dhd->pub.info = dhd;
@@ -2579,22 +2577,6 @@ void dhd_os_sdunlock(dhd_pub_t *pub)
spin_unlock_bh(&dhd->sdlock);
}
-void dhd_os_sdlock_txq(dhd_pub_t *pub)
-{
- dhd_info_t *dhd;
-
- dhd = (dhd_info_t *) (pub->info);
- spin_lock_bh(&dhd->txqlock);
-}
-
-void dhd_os_sdunlock_txq(dhd_pub_t *pub)
-{
- dhd_info_t *dhd;
-
- dhd = (dhd_info_t *) (pub->info);
- spin_unlock_bh(&dhd->txqlock);
-}
-
static int
dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
wl_event_msg_t *event, void **data)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index dcfebac..48550f3 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -592,6 +592,8 @@ typedef struct dhd_bus {
u8 *ctrl_frame_buf;
u32 ctrl_frame_len;
bool ctrl_frame_stat;
+
+ spinlock_t txqlock;
} dhd_bus_t;
typedef volatile struct _sbconfig {
@@ -1370,7 +1372,7 @@ int dhd_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
bus->fcqueued++;
/* Priority based enq */
- dhd_os_sdlock_txq(bus->dhd);
+ spin_lock_bh(&bus->txqlock);
if (dhd_prec_enq(bus->dhd, &bus->txq, pkt, prec) == false) {
skb_pull(pkt, SDPCM_HDRLEN);
dhd_txcomplete(bus->dhd, pkt, false);
@@ -1380,7 +1382,7 @@ int dhd_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
} else {
ret = 0;
}
- dhd_os_sdunlock_txq(bus->dhd);
+ spin_unlock_bh(&bus->txqlock);
if (pktq_len(&bus->txq) >= TXHI)
dhd_txflowcontrol(bus->dhd, 0, ON);
@@ -1446,13 +1448,13 @@ static uint dhdsdio_sendfromq(dhd_bus_t *bus, uint maxframes)
/* Send frames until the limit or some other event */
for (cnt = 0; (cnt < maxframes) && DATAOK(bus); cnt++) {
- dhd_os_sdlock_txq(bus->dhd);
+ spin_lock_bh(&bus->txqlock);
pkt = brcmu_pktq_mdeq(&bus->txq, tx_prec_map, &prec_out);
if (pkt == NULL) {
- dhd_os_sdunlock_txq(bus->dhd);
+ spin_unlock_bh(&bus->txqlock);
break;
}
- dhd_os_sdunlock_txq(bus->dhd);
+ spin_unlock_bh(&bus->txqlock);
datalen = pkt->len - SDPCM_HDRLEN;
#ifndef SDTEST
@@ -5264,6 +5266,8 @@ static void *dhdsdio_probe(u16 venid, u16 devid, u16 bus_no,
goto fail;
}
+ spin_lock_init(&bus->txqlock);
+
/* Attach to the dhd/OS/network interface */
bus->dhd = dhd_attach(bus, SDPCM_RESERVE);
if (!bus->dhd) {
--
1.7.1
On 06/30/2011 10:37 AM, Dan Carpenter wrote:
> On Wed, Jun 29, 2011 at 04:46:41PM -0700, Franky Lin wrote:
>> #define FOREACH_BSS(wlc, idx, cfg) \
>> - for (idx = 0; (int) idx< WLC_MAXBSSCFG; idx++) \
>> - if ((cfg = (wlc)->bsscfg[idx]))
>> + for (idx = 0, cfg = (wlc)->bsscfg[idx]; \
>> + idx< WLC_MAXBSSCFG; cfg = (wlc)->bsscfg[++idx]) \
>> + if (cfg)
>>
> That's pretty ugly. Better to leave the original in and ignore the
> checkpatch warning. Or maybe do something like this:
>
> for (idx = 0; (int) idx< WLC_MAXBSSCFG; idx++) { \
> cfg = (wlc)->bsscfg[idx]; \
> if (!cfg) \
> continue; \
>
> Then #define END_FOREACH_BSS() }
Hi Dan,
I agree this is not the nicest solution. It was a checkpatch error so we
felt an urge to fix it. A warning would have been easier to ignore. I
will have a look and see whether the patch can be dropped without
issues. Your feedback is noted so I will look for a better iteration
solution to replace this.
Gr. AvS
--
Almost nobody dances sober, unless they happen to be insane.
-- H.P. Lovecraft --
From: Henry Ptasinski <[email protected]>
Used scripts/cleanfile to remove assorted whitespace errors.
Signed-off-by: Henry Ptasinski <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h | 2 +-
drivers/staging/brcm80211/brcmfmac/dhd.h | 12 ++++----
drivers/staging/brcm80211/brcmfmac/sdio_host.h | 2 +-
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 4 +-
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h | 6 ++--
drivers/staging/brcm80211/brcmfmac/wl_iw.h | 4 +-
drivers/staging/brcm80211/brcmsmac/d11.h | 30 ++++++++++----------
drivers/staging/brcm80211/brcmsmac/main.c | 6 ++--
drivers/staging/brcm80211/brcmsmac/nicpci.c | 10 +++---
drivers/staging/brcm80211/brcmsmac/otp.c | 4 +-
drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h | 6 ++--
drivers/staging/brcm80211/brcmsmac/phy/phy_int.h | 4 +-
drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c | 18 ++++++------
drivers/staging/brcm80211/brcmsmac/phy/phyreg_n.h | 14 +++++-----
drivers/staging/brcm80211/brcmsmac/rate.h | 6 ++--
drivers/staging/brcm80211/brcmsmac/scb.h | 2 +-
drivers/staging/brcm80211/brcmsmac/types.h | 2 +-
drivers/staging/brcm80211/brcmutil/utils.c | 2 +-
drivers/staging/brcm80211/brcmutil/wifi.c | 1 -
drivers/staging/brcm80211/include/brcmu_utils.h | 2 +-
drivers/staging/brcm80211/include/soc.h | 2 +-
21 files changed, 69 insertions(+), 70 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
index 42c71a8..ff5e09d 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
@@ -72,7 +72,7 @@ extern void sdioh_sdmmc_osfree(sdioh_info_t *sd);
/* private bus modes */
#define SDIOH_MODE_SD4 2
-#define CLIENT_INTR 0x100 /* Get rid of this! */
+#define CLIENT_INTR 0x100 /* Get rid of this! */
struct sdioh_info {
struct osl_info *osh; /* osh handler */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index a4dcaf8..4bedf41 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -129,9 +129,9 @@ struct dhd_info;
#define CCA_FLAG_5G_ONLY 0x02 /* Return a channel from 2.4 Ghz band */
#define CCA_FLAG_IGNORE_DURATION 0x04 /* Ignore dwell time for each channel */
#define CCA_FLAGS_PREFER_1_6_11 0x10
-#define CCA_FLAG_IGNORE_INTERFER 0x20 /* do not exlude channel based on interfer level */
+#define CCA_FLAG_IGNORE_INTERFER 0x20 /* do not exlude channel based on interfer level */
-#define CCA_ERRNO_BAND 1 /* After filtering for band pref, no choices left */
+#define CCA_ERRNO_BAND 1 /* After filtering for band pref, no choices left */
#define CCA_ERRNO_DURATION 2 /* After filtering for duration, no choices left */
#define CCA_ERRNO_PREF_CHAN 3 /* After filtering for chan pref, no choices left */
#define CCA_ERRNO_INTERFER 4 /* After filtering for interference, no choices left */
@@ -273,8 +273,8 @@ typedef struct bcm_event {
#define WLC_E_DFS_AP_RESUME 66
#define WLC_E_RESERVED1 67
#define WLC_E_RESERVED2 68
-#define WLC_E_ESCAN_RESULT 69
-#define WLC_E_ACTION_FRAME_OFF_CHAN_COMPLETE 70
+#define WLC_E_ESCAN_RESULT 69
+#define WLC_E_ACTION_FRAME_OFF_CHAN_COMPLETE 70
#define WLC_E_DCS_REQUEST 73
#define WLC_E_FIFO_CREDIT_MAP 74
@@ -518,7 +518,7 @@ typedef struct wl_assoc_params {
*/
chanspec_t chanspec_list[1]; /* list of chanspecs */
} wl_assoc_params_t;
-#define WL_ASSOC_PARAMS_FIXED_SIZE (sizeof(wl_assoc_params_t) - sizeof(chanspec_t))
+#define WL_ASSOC_PARAMS_FIXED_SIZE (sizeof(wl_assoc_params_t) - sizeof(chanspec_t))
/* used for reassociation/roam to a specific BSSID and channel */
typedef wl_assoc_params_t wl_reassoc_params_t;
@@ -531,7 +531,7 @@ typedef struct wl_join_params {
* of the wl_assoc_params_t struct when it does present.
*/
} wl_join_params_t;
-#define WL_JOIN_PARAMS_FIXED_SIZE (sizeof(wl_join_params_t) - sizeof(chanspec_t))
+#define WL_JOIN_PARAMS_FIXED_SIZE (sizeof(wl_join_params_t) - sizeof(chanspec_t))
/* size of wl_scan_results not including variable length array */
#define WL_SCAN_RESULTS_FIXED_SIZE (sizeof(wl_scan_results_t) - sizeof(wl_bss_info_t))
diff --git a/drivers/staging/brcm80211/brcmfmac/sdio_host.h b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
index db19533..96a43cb 100644
--- a/drivers/staging/brcm80211/brcmfmac/sdio_host.h
+++ b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
@@ -42,7 +42,7 @@ extern const uint bcmsdh_msglevel;
#define SDIO_FUNC_1 1
#define SDIO_FUNC_2 2
-#define SDIOD_FBR_SIZE 0x100
+#define SDIOD_FBR_SIZE 0x100
/* io_en */
#define SDIO_FUNC_ENABLE_1 0x02
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index 52c1782..3bccc22 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -322,13 +322,13 @@ static void wl_set_mpc(struct net_device *ndev, int mpc);
static int wl_debugfs_add_netdev_params(struct wl_priv *wl);
static void wl_debugfs_remove_netdev(struct wl_priv *wl);
-#define WL_PRIV_GET() \
+#define WL_PRIV_GET() \
({ \
struct wl_iface *ci = wl_get_drvdata(wl_cfg80211_dev); \
if (unlikely(!ci)) { \
WL_ERR("wl_cfg80211_dev is unavailable\n"); \
BUG(); \
- } \
+ } \
ci_to_wl(ci); \
})
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
index 2469b90..80940bd 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h
@@ -97,8 +97,8 @@ do { \
* for 2.6.33 kernel
* or later
*/
-#define WL_SCAN_BUF_MAX (1024 * 8)
-#define WL_TLV_INFO_MAX 1024
+#define WL_SCAN_BUF_MAX (1024 * 8)
+#define WL_TLV_INFO_MAX 1024
#define WL_BSS_INFO_MAX 2048
#define WL_ASSOC_INFO_MAX 512 /*
* needs to grab assoc info from dongle to
@@ -112,7 +112,7 @@ do { \
* to reduce iteration
*/
#define WL_ISCAN_TIMER_INTERVAL_MS 3000
-#define WL_SCAN_ERSULTS_LAST (WL_SCAN_RESULTS_NO_MEM+1)
+#define WL_SCAN_ERSULTS_LAST (WL_SCAN_RESULTS_NO_MEM+1)
#define WL_AP_MAX 256 /* virtually unlimitted as long
* as kernel memory allows
*/
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_iw.h b/drivers/staging/brcm80211/brcmfmac/wl_iw.h
index aa8902c..bfd8172 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_iw.h
+++ b/drivers/staging/brcm80211/brcmfmac/wl_iw.h
@@ -20,8 +20,8 @@
#define WL_SCAN_PARAMS_SSID_MAX 10
#define GET_SSID "SSID="
#define GET_CHANNEL "CH="
-#define GET_NPROBE "NPROBE="
-#define GET_ACTIVE_ASSOC_DWELL "ACTIVE="
+#define GET_NPROBE "NPROBE="
+#define GET_ACTIVE_ASSOC_DWELL "ACTIVE="
#define GET_PASSIVE_ASSOC_DWELL "PASSIVE="
#define GET_HOME_DWELL "HOME="
#define GET_SCAN_TYPE "TYPE="
diff --git a/drivers/staging/brcm80211/brcmsmac/d11.h b/drivers/staging/brcm80211/brcmsmac/d11.h
index 44f4bc0..bb8bb38 100644
--- a/drivers/staging/brcm80211/brcmsmac/d11.h
+++ b/drivers/staging/brcm80211/brcmsmac/d11.h
@@ -1148,25 +1148,25 @@ struct tx_status {
#define M_TX_IDLE_BUSY_RATIO_X_16_OFDM (0x5A * 2)
/* CW RSSI for LCNPHY */
-#define M_LCN_RSSI_0 0x1332
-#define M_LCN_RSSI_1 0x1338
-#define M_LCN_RSSI_2 0x133e
-#define M_LCN_RSSI_3 0x1344
+#define M_LCN_RSSI_0 0x1332
+#define M_LCN_RSSI_1 0x1338
+#define M_LCN_RSSI_2 0x133e
+#define M_LCN_RSSI_3 0x1344
/* SNR for LCNPHY */
-#define M_LCN_SNR_A_0 0x1334
-#define M_LCN_SNR_B_0 0x1336
+#define M_LCN_SNR_A_0 0x1334
+#define M_LCN_SNR_B_0 0x1336
-#define M_LCN_SNR_A_1 0x133a
-#define M_LCN_SNR_B_1 0x133c
+#define M_LCN_SNR_A_1 0x133a
+#define M_LCN_SNR_B_1 0x133c
-#define M_LCN_SNR_A_2 0x1340
-#define M_LCN_SNR_B_2 0x1342
+#define M_LCN_SNR_A_2 0x1340
+#define M_LCN_SNR_B_2 0x1342
-#define M_LCN_SNR_A_3 0x1346
-#define M_LCN_SNR_B_3 0x1348
+#define M_LCN_SNR_A_3 0x1346
+#define M_LCN_SNR_B_3 0x1348
-#define M_LCN_LAST_RESET (81*2)
+#define M_LCN_LAST_RESET (81*2)
#define M_LCN_LAST_LOC (63*2)
#define M_LCNPHY_RESET_STATUS (4902)
#define M_LCNPHY_DSC_TIME (0x98d*2)
@@ -1279,7 +1279,7 @@ struct shm_acparams {
/* Flags in M_HOST_FLAGS4 */
#define MHF4_BPHY_TXCORE0 0x0080 /* force bphy Tx on core 0 (board level WAR) */
-#define MHF4_EXTPA_ENABLE 0x4000 /* for 4313A0 FEM boards */
+#define MHF4_EXTPA_ENABLE 0x4000 /* for 4313A0 FEM boards */
/* Flags in M_HOST_FLAGS5 */
#define MHF5_4313_GPIOCTRL 0x0001
@@ -1673,7 +1673,7 @@ struct macstat {
#define BPHY_PEAK_ENERGY_HI 0x34
#define BPHY_SYNC_CTL 0x35
#define BPHY_TX_PWR_CTRL 0x36
-#define BPHY_TX_EST_PWR 0x37
+#define BPHY_TX_EST_PWR 0x37
#define BPHY_STEP 0x38
#define BPHY_WARMUP 0x39
#define BPHY_LMS_CFF_READ 0x3a
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index 90293fa..20d65e0 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -224,7 +224,7 @@ const u8 prio2fifo[NUMPRIO] = {
#define _WLC_PREC_NC 14 /* NC - Network Control */
#define MAXMACLIST 64 /* max # source MAC matches */
-#define BCN_TEMPLATE_COUNT 2
+#define BCN_TEMPLATE_COUNT 2
#define WLC_BSSCFG_HW_BCN 0x20 /* The BSS is generating beacons in HW */
@@ -857,7 +857,7 @@ ratespec_t brcms_c_lowest_basic_rspec(struct brcms_c_info *wlc,
/* This function changes the phytxctl for beacon based on current beacon ratespec AND txant
* setting as per this table:
* ratespec CCK ant = wlc->stf->txant
- * OFDM ant = 3
+ * OFDM ant = 3
*/
void brcms_c_beacon_phytxctl_txant_upd(struct brcms_c_info *wlc,
ratespec_t bcn_rspec)
@@ -1357,7 +1357,7 @@ struct wlc_pub *brcms_c_pub(void *wlc)
return ((struct brcms_c_info *) wlc)->pub;
}
-#define CHIP_SUPPORTS_11N(wlc) 1
+#define CHIP_SUPPORTS_11N(wlc) 1
/*
* The common driver entry routine. Error codes should be unique
diff --git a/drivers/staging/brcm80211/brcmsmac/nicpci.c b/drivers/staging/brcm80211/brcmsmac/nicpci.c
index 70d4173..a5eebf3 100644
--- a/drivers/staging/brcm80211/brcmsmac/nicpci.c
+++ b/drivers/staging/brcm80211/brcmsmac/nicpci.c
@@ -65,9 +65,9 @@
#define MDIODATA_BLK_ADDR 0x1F /* blk address for serdes */
/* serdes regs (rev < 10) */
-#define MDIODATA_DEV_PLL 0x1d /* SERDES PLL Dev */
-#define MDIODATA_DEV_TX 0x1e /* SERDES TX Dev */
-#define MDIODATA_DEV_RX 0x1f /* SERDES RX Dev */
+#define MDIODATA_DEV_PLL 0x1d /* SERDES PLL Dev */
+#define MDIODATA_DEV_TX 0x1e /* SERDES TX Dev */
+#define MDIODATA_DEV_RX 0x1f /* SERDES RX Dev */
/* SERDES RX registers */
#define SERDES_RX_CTRL 1 /* Rx cntrl */
@@ -100,8 +100,8 @@
#define PCIE_ASPMTIMER_EXTEND 0x01000000 /* > rev7: enable extend ASPM timer */
/* different register spaces to access thr'u pcie indirect access */
-#define PCIE_CONFIGREGS 1 /* Access to config space */
-#define PCIE_PCIEREGS 2 /* Access to pcie registers */
+#define PCIE_CONFIGREGS 1 /* Access to config space */
+#define PCIE_PCIEREGS 2 /* Access to pcie registers */
/* PCIE protocol PHY diagnostic registers */
#define PCIE_PLP_STATUSREG 0x204 /* Status */
diff --git a/drivers/staging/brcm80211/brcmsmac/otp.c b/drivers/staging/brcm80211/brcmsmac/otp.c
index 4e19b35..7edc435 100644
--- a/drivers/staging/brcm80211/brcmsmac/otp.c
+++ b/drivers/staging/brcm80211/brcmsmac/otp.c
@@ -460,8 +460,8 @@ static otp_fn_t ipxotp_fn = {
* otp_size()
* otp_read_bit()
* otp_init()
- * otp_read_region()
- * otp_nvread()
+ * otp_read_region()
+ * otp_nvread()
*/
int otp_status(void *oh)
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h b/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h
index 756ad71..3c125c3 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h
@@ -80,9 +80,9 @@
#define PHY_MUTE_FOR_PREISM 1
#define PHY_MUTE_ALL 0xffffffff
-#define PHY_NOISE_FIXED_VAL (-95)
-#define PHY_NOISE_FIXED_VAL_NPHY (-92)
-#define PHY_NOISE_FIXED_VAL_LCNPHY (-92)
+#define PHY_NOISE_FIXED_VAL (-95)
+#define PHY_NOISE_FIXED_VAL_NPHY (-92)
+#define PHY_NOISE_FIXED_VAL_LCNPHY (-92)
#define PHY_MODE_CAL 0x0002
#define PHY_MODE_NOISEM 0x0004
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h b/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
index 9506da5..68938fe 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_int.h
@@ -63,7 +63,7 @@ typedef void (*detachfn_t) (phy_info_t *);
#undef ISNPHY
#undef ISLCNPHY
#define ISNPHY(pi) PHYTYPE_IS((pi)->pubpi.phy_type, PHY_TYPE_N)
-#define ISLCNPHY(pi) PHYTYPE_IS((pi)->pubpi.phy_type, PHY_TYPE_LCN)
+#define ISLCNPHY(pi) PHYTYPE_IS((pi)->pubpi.phy_type, PHY_TYPE_LCN)
#define ISPHY_11N_CAP(pi) (ISNPHY(pi) || ISLCNPHY(pi))
@@ -1092,7 +1092,7 @@ extern void wlc_phy_txpower_recalc_target(phy_info_t *pi);
#define LCNPHY_TBL_ID_PAPDCOMPDELTATBL 0x18
#define LCNPHY_TX_POWER_TABLE_SIZE 128
#define LCNPHY_MAX_TX_POWER_INDEX (LCNPHY_TX_POWER_TABLE_SIZE - 1)
-#define LCNPHY_TBL_ID_TXPWRCTL 0x07
+#define LCNPHY_TBL_ID_TXPWRCTL 0x07
#define LCNPHY_TX_PWR_CTRL_OFF 0
#define LCNPHY_TX_PWR_CTRL_SW (0x1 << 15)
#define LCNPHY_TX_PWR_CTRL_HW ((0x1 << 15) | \
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
index efa985c..4d35e5d 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c
@@ -26,8 +26,8 @@
#include "phy_lcn.h"
#define PLL_2064_NDIV 90
-#define PLL_2064_LOW_END_VCO 3000
-#define PLL_2064_LOW_END_KVCO 27
+#define PLL_2064_LOW_END_VCO 3000
+#define PLL_2064_LOW_END_KVCO 27
#define PLL_2064_HIGH_END_VCO 4200
#define PLL_2064_HIGH_END_KVCO 68
#define PLL_2064_LOOP_BW_DOUBLER 200
@@ -38,7 +38,7 @@
#define PLL_2064_MHZ 1000000
#define PLL_2064_OPEN_LOOP_DELAY 5
-#define TEMPSENSE 1
+#define TEMPSENSE 1
#define VBATSENSE 2
#define NOISE_IF_UPD_CHK_INTERVAL 1
@@ -50,10 +50,10 @@
#define NOISE_IF_CHK 1
#define NOISE_IF_ON 2
-#define PAPD_BLANKING_PROFILE 3
+#define PAPD_BLANKING_PROFILE 3
#define PAPD2LUT 0
-#define PAPD_CORR_NORM 0
-#define PAPD_BLANKING_THRESHOLD 0
+#define PAPD_CORR_NORM 0
+#define PAPD_BLANKING_THRESHOLD 0
#define PAPD_STOP_AFTER_LAST_UPDATE 0
#define LCN_TARGET_PWR 60
@@ -108,9 +108,9 @@
#define LCNPHY_TBL_ID_SAMPLEPLAY 0x15
#define LCNPHY_TBL_ID_SAMPLEPLAY1 0x16
-#define LCNPHY_TX_PWR_CTRL_RATE_OFFSET 832
-#define LCNPHY_TX_PWR_CTRL_MAC_OFFSET 128
-#define LCNPHY_TX_PWR_CTRL_GAIN_OFFSET 192
+#define LCNPHY_TX_PWR_CTRL_RATE_OFFSET 832
+#define LCNPHY_TX_PWR_CTRL_MAC_OFFSET 128
+#define LCNPHY_TX_PWR_CTRL_GAIN_OFFSET 192
#define LCNPHY_TX_PWR_CTRL_IQ_OFFSET 320
#define LCNPHY_TX_PWR_CTRL_LO_OFFSET 448
#define LCNPHY_TX_PWR_CTRL_PWR_OFFSET 576
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phyreg_n.h b/drivers/staging/brcm80211/brcmsmac/phy/phyreg_n.h
index 211bc3a..a97c3a7 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phyreg_n.h
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phyreg_n.h
@@ -123,13 +123,13 @@
#define NPHY_REV3_RFSEQ_CMD_CLR_RXRX_BIAS 0xf
#define NPHY_REV3_RFSEQ_CMD_END 0x1f
-#define NPHY_RSSI_SEL_W1 0x0
-#define NPHY_RSSI_SEL_W2 0x1
-#define NPHY_RSSI_SEL_NB 0x2
-#define NPHY_RSSI_SEL_IQ 0x3
-#define NPHY_RSSI_SEL_TSSI_2G 0x4
-#define NPHY_RSSI_SEL_TSSI_5G 0x5
-#define NPHY_RSSI_SEL_TBD 0x6
+#define NPHY_RSSI_SEL_W1 0x0
+#define NPHY_RSSI_SEL_W2 0x1
+#define NPHY_RSSI_SEL_NB 0x2
+#define NPHY_RSSI_SEL_IQ 0x3
+#define NPHY_RSSI_SEL_TSSI_2G 0x4
+#define NPHY_RSSI_SEL_TSSI_5G 0x5
+#define NPHY_RSSI_SEL_TBD 0x6
#define NPHY_RAIL_I 0x0
#define NPHY_RAIL_Q 0x1
diff --git a/drivers/staging/brcm80211/brcmsmac/rate.h b/drivers/staging/brcm80211/brcmsmac/rate.h
index 8b4de8b..268125f 100644
--- a/drivers/staging/brcm80211/brcmsmac/rate.h
+++ b/drivers/staging/brcm80211/brcmsmac/rate.h
@@ -84,7 +84,7 @@ extern const mcs_info_t mcs_table[];
#define WLC_HTPHY 127 /* HT PHY Membership */
#define RSPEC_ACTIVE(rspec) (rspec & (RSPEC_RATE_MASK | RSPEC_MIMORATE))
-#define RSPEC2RATE(rspec) ((rspec & RSPEC_MIMORATE) ? \
+#define RSPEC2RATE(rspec) ((rspec & RSPEC_MIMORATE) ? \
MCS_RATE((rspec & RSPEC_RATE_MASK), RSPEC_IS40MHZ(rspec), RSPEC_ISSGI(rspec)) : \
(rspec & RSPEC_RATE_MASK))
/* return rate in unit of 500Kbps -- for internal use in wlc_rate_sel.c */
@@ -111,8 +111,8 @@ extern const mcs_info_t mcs_table[];
#define PLCP3_STC_SHIFT 4
/* Rate info table; takes a legacy rate or ratespec_t */
-#define IS_MCS(r) (r & RSPEC_MIMORATE)
-#define IS_OFDM(r) (!IS_MCS(r) && (rate_info[(r) & RSPEC_RATE_MASK] & WLC_RATE_FLAG))
+#define IS_MCS(r) (r & RSPEC_MIMORATE)
+#define IS_OFDM(r) (!IS_MCS(r) && (rate_info[(r) & RSPEC_RATE_MASK] & WLC_RATE_FLAG))
#define IS_CCK(r) (!IS_MCS(r) && ( \
((r) & WLC_RATE_MASK) == WLC_RATE_1M || \
((r) & WLC_RATE_MASK) == WLC_RATE_2M || \
diff --git a/drivers/staging/brcm80211/brcmsmac/scb.h b/drivers/staging/brcm80211/brcmsmac/scb.h
index 62e005e..e814e5e 100644
--- a/drivers/staging/brcm80211/brcmsmac/scb.h
+++ b/drivers/staging/brcm80211/brcmsmac/scb.h
@@ -50,7 +50,7 @@ struct scb_ampdu {
scb_ampdu_tid_ini_t ini[AMPDU_MAX_SCB_TID]; /* initiator info - per tid (NUMPRIO) */
};
-#define SCB_MAGIC 0xbeefcafe
+#define SCB_MAGIC 0xbeefcafe
/* station control block - one per remote MAC address */
struct scb {
diff --git a/drivers/staging/brcm80211/brcmsmac/types.h b/drivers/staging/brcm80211/brcmsmac/types.h
index af1514e..b1370be 100644
--- a/drivers/staging/brcm80211/brcmsmac/types.h
+++ b/drivers/staging/brcm80211/brcmsmac/types.h
@@ -96,7 +96,7 @@
* 2 4330a0
*/
-#define SSLPNCONF 0x0000000f /* Supported sslpnphy revs:
+#define SSLPNCONF 0x0000000f /* Supported sslpnphy revs:
* 0 4329a0/k0
* 1 4329b0/4329C0
* 2 4319a0
diff --git a/drivers/staging/brcm80211/brcmutil/utils.c b/drivers/staging/brcm80211/brcmutil/utils.c
index 2819c1d..e221a3b 100644
--- a/drivers/staging/brcm80211/brcmutil/utils.c
+++ b/drivers/staging/brcm80211/brcmutil/utils.c
@@ -672,7 +672,7 @@ EXPORT_SYMBOL(brcmu_mkiovar);
#define QDBM_TABLE_HIGH_BOUND 64938 /* High bound */
static const u16 nqdBm_to_mW_map[QDBM_TABLE_LEN] = {
-/* qdBm: +0 +1 +2 +3 +4 +5 +6 +7 */
+/* qdBm: +0 +1 +2 +3 +4 +5 +6 +7 */
/* 153: */ 6683, 7079, 7499, 7943, 8414, 8913, 9441, 10000,
/* 161: */ 10593, 11220, 11885, 12589, 13335, 14125, 14962, 15849,
/* 169: */ 16788, 17783, 18836, 19953, 21135, 22387, 23714, 25119,
diff --git a/drivers/staging/brcm80211/brcmutil/wifi.c b/drivers/staging/brcm80211/brcmutil/wifi.c
index af88dcb..b9ffe86 100644
--- a/drivers/staging/brcm80211/brcmutil/wifi.c
+++ b/drivers/staging/brcm80211/brcmutil/wifi.c
@@ -129,4 +129,3 @@ int brcmu_mhz2channel(uint freq, uint start_factor)
return ch;
}
EXPORT_SYMBOL(brcmu_mhz2channel);
-
diff --git a/drivers/staging/brcm80211/include/brcmu_utils.h b/drivers/staging/brcm80211/include/brcmu_utils.h
index 78c84e2..b0f36e3 100644
--- a/drivers/staging/brcm80211/include/brcmu_utils.h
+++ b/drivers/staging/brcm80211/include/brcmu_utils.h
@@ -195,7 +195,7 @@ extern int brcmu_iovar_lencheck(const struct brcmu_iovar *table, void *arg,
/* ** driver/apps-shared section ** */
-#define BCME_STRLEN 64 /* Max string length for BCM errors */
+#define BCME_STRLEN 64 /* Max string length for BCM errors */
#ifndef ABS
#define ABS(a) (((a) < 0) ? -(a) : (a))
diff --git a/drivers/staging/brcm80211/include/soc.h b/drivers/staging/brcm80211/include/soc.h
index 3e59377..6e5a705 100644
--- a/drivers/staging/brcm80211/include/soc.h
+++ b/drivers/staging/brcm80211/include/soc.h
@@ -20,7 +20,7 @@
#ifdef SI_ENUM_BASE_VARIABLE
#define SI_ENUM_BASE (sii->pub.si_enum_base)
#else
-#define SI_ENUM_BASE 0x18000000 /* Enumeration space base */
+#define SI_ENUM_BASE 0x18000000 /* Enumeration space base */
#endif /* SI_ENUM_BASE_VARIABLE */
/* core codes */
--
1.7.1
From: Roland Vossen <[email protected]>
Code cleanup.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h | 21 ----
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 47 ---------
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c | 45 --------
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 13 ---
drivers/staging/brcm80211/brcmfmac/dhd.h | 17 ---
drivers/staging/brcm80211/brcmfmac/dhd_bus.h | 10 --
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 10 --
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 18 ----
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 113 ---------------------
drivers/staging/brcm80211/brcmfmac/dhd_proto.h | 5 -
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 23 ----
drivers/staging/brcm80211/brcmfmac/sdio_host.h | 23 ----
12 files changed, 0 insertions(+), 345 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
index 3a09aa3..c4c6e54 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
@@ -125,21 +125,10 @@ struct brcmf_sdmmc_instance {
extern int brcmf_sdioh_osinit(struct sdioh_info *sd);
extern void brcmf_sdioh_osfree(struct sdioh_info *sd);
-/* OS-independent interrupt handler */
-extern bool brcmf_sdioh_check_client_intr(struct sdioh_info *sd);
-
/* Core interrupt enable/disable of device interrupts */
extern void brcmf_sdioh_dev_intr_on(struct sdioh_info *sd);
extern void brcmf_sdioh_dev_intr_off(struct sdioh_info *sd);
-/* Register mapping routines */
-extern u32 *brcmf_sdioh_reg_map(s32 addr, int size);
-extern void brcmf_sdioh_reg_unmap(s32 addr, int size);
-
-/* Interrupt (de)registration routines */
-extern int brcmf_sdioh_register_irq(struct sdioh_info *sd, uint irq);
-extern void brcmf_sdioh_free_irq(uint irq, struct sdioh_info *sd);
-
/* attach, return handler on success, NULL if failed.
* The handler shall be provided by all subsequent calls. No local cache
* cfghdl points to the starting address of pci device mapped memory
@@ -153,10 +142,6 @@ brcmf_sdioh_interrupt_register(struct sdioh_info *si,
extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *si);
-/* query whether SD interrupt is enabled or not */
-extern int
-brcmf_sdioh_interrupt_query(struct sdioh_info *si, bool *onoff);
-
/* enable or disable SD interrupt */
extern int
brcmf_sdioh_interrupt_set(struct sdioh_info *si, bool enable_disable);
@@ -188,9 +173,6 @@ brcmf_sdioh_cfg_read(struct sdioh_info *si, uint fuc, u32 addr, u8 *data);
extern int
brcmf_sdioh_cfg_write(struct sdioh_info *si, uint fuc, u32 addr, u8 *data);
-/* query number of io functions */
-extern uint brcmf_sdioh_query_iofnum(struct sdioh_info *si);
-
/* handle iovars */
extern int brcmf_sdioh_iovar_op(struct sdioh_info *si, const char *name,
void *params, int plen, void *arg, int len, bool set);
@@ -198,9 +180,6 @@ extern int brcmf_sdioh_iovar_op(struct sdioh_info *si, const char *name,
/* Issue abort to the specified function and clear controller as needed */
extern int brcmf_sdioh_abort(struct sdioh_info *si, uint fnc);
-/* Helper function */
-void *brcmf_sdcard_get_sdioh(struct brcmf_sdio_card *card);
-
/* Watchdog timer interface for pm ops */
extern void brcmf_sdio_wdtmr_enable(bool enable);
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
index ae83403..84d1bcd 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
@@ -117,19 +117,6 @@ brcmf_sdcard_iovar_op(struct brcmf_sdio_card *card, const char *name,
len, set);
}
-bool brcmf_sdcard_intr_query(struct brcmf_sdio_card *card)
-{
- int status;
- bool on;
-
- ASSERT(card);
- status = brcmf_sdioh_interrupt_query(card->sdioh, &on);
- if (status == 0)
- return false;
- else
- return on;
-}
-
int brcmf_sdcard_intr_enable(struct brcmf_sdio_card *card)
{
ASSERT(card);
@@ -159,15 +146,6 @@ int brcmf_sdcard_intr_dereg(struct brcmf_sdio_card *card)
return brcmf_sdioh_interrupt_deregister(card->sdioh);
}
-int brcmf_sdcard_devremove_reg(struct brcmf_sdio_card *card,
- void (*fn)(void *), void *argh)
-{
- ASSERT(card);
-
- /* don't support yet */
- return -ENOTSUPP;
-}
-
u8 brcmf_sdcard_cfg_read(struct brcmf_sdio_card *card, uint fnc_num, u32 addr,
int *err)
{
@@ -551,26 +529,6 @@ int brcmf_sdcard_query_device(struct brcmf_sdio_card *card)
return card->vendevid;
}
-uint brcmf_sdcard_query_iofnum(struct brcmf_sdio_card *card)
-{
- if (!card)
- card = l_card;
-
- return brcmf_sdioh_query_iofnum(card->sdioh);
-}
-
-void *brcmf_sdcard_get_sdioh(struct brcmf_sdio_card *card)
-{
- ASSERT(card);
- return card->sdioh;
-}
-
-/* Function to pass device-status bits to DHD. */
-u32 brcmf_sdcard_get_dstatus(struct brcmf_sdio_card *card)
-{
- return 0;
-}
-
u32 brcmf_sdcard_cur_sbwad(struct brcmf_sdio_card *card)
{
if (!card)
@@ -578,8 +536,3 @@ u32 brcmf_sdcard_cur_sbwad(struct brcmf_sdio_card *card)
return card->sbwad;
}
-
-void brcmf_sdcard_chipinfo(struct brcmf_sdio_card *card, u32 chip, u32 chiprev)
-{
- return;
-}
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
index 56e2435..45fb76e 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
@@ -58,51 +58,6 @@ static struct brcmf_sdioh_driver drvinfo = { NULL, NULL };
/* debugging macros */
#define SDLX_MSG(x)
-/**
- * Checks to see if vendor and device IDs match a supported SDIO Host Controller.
- */
-bool brcmf_sdio_chipmatch(u16 vendor, u16 device)
-{
- /* Add other vendors and devices as required */
-
-#ifdef BCMSDIOH_STD
- /* Check for Arasan host controller */
- if (vendor == VENDOR_SI_IMAGE)
- return true;
-
- /* Check for BRCM 27XX Standard host controller */
- if (device == BCM27XX_SDIOH_ID && vendor == PCI_VENDOR_ID_BROADCOM)
- return true;
-
- /* Check for BRCM Standard host controller */
- if (device == SDIOH_FPGA_ID && vendor == PCI_VENDOR_ID_BROADCOM)
- return true;
-
- /* Check for TI PCIxx21 Standard host controller */
- if (device == PCIXX21_SDIOH_ID && vendor == VENDOR_TI)
- return true;
-
- if (device == PCIXX21_SDIOH0_ID && vendor == VENDOR_TI)
- return true;
-
- /* Ricoh R5C822 Standard SDIO Host */
- if (device == R5C822_SDIOH_ID && vendor == VENDOR_RICOH)
- return true;
-
- /* JMicron Standard SDIO Host */
- if (device == JMICRON_SDIOH_ID && vendor == VENDOR_JMICRON)
- return true;
-#endif /* BCMSDIOH_STD */
-#ifdef BCMSDIOH_SPI
- /* This is the PciSpiHost. */
- if (device == SPIH_FPGA_ID && vendor == PCI_VENDOR_ID_BROADCOM) {
- return true;
- }
-#endif /* BCMSDIOH_SPI */
-
- return false;
-}
-
/* forward declarations */
int brcmf_sdio_probe(struct device *dev);
EXPORT_SYMBOL(brcmf_sdio_probe);
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 2be9b08..1b55e56 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -244,19 +244,6 @@ extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd)
return 0;
}
-extern int
-brcmf_sdioh_interrupt_query(struct sdioh_info *sd, bool *onoff)
-{
- sd_trace(("%s: Entering\n", __func__));
- *onoff = sd->client_intr_enabled;
- return 0;
-}
-
-uint brcmf_sdioh_query_iofnum(struct sdioh_info *sd)
-{
- return sd->num_funcs;
-}
-
/* IOVar table */
enum {
IOV_MSGLEVEL = 1,
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index a67d1ed..1540804 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -774,9 +774,6 @@ extern void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx,
/* Return pointer to interface name */
extern char *brcmf_ifname(struct brcmf_pub *drvr, int idx);
-/* Request scheduling of the bus dpc */
-extern void brcmf_sched_dpc(struct brcmf_pub *drvr);
-
/* Notify tx completion */
extern void brcmf_txcomplete(struct brcmf_pub *drvr, struct sk_buff *txp,
bool success);
@@ -793,12 +790,6 @@ extern int brcmf_os_ioctl_resp_wait(struct brcmf_pub *drvr, uint *condition,
extern int brcmf_os_ioctl_resp_wake(struct brcmf_pub *drvr);
extern unsigned int brcmf_os_get_ioctl_resp_timeout(void);
extern void brcmf_os_set_ioctl_resp_timeout(unsigned int timeout_msec);
-extern void brcmf_os_sdlock_sndup_rxq(struct brcmf_pub *drvr);
-extern void brcmf_customer_gpio_wlan_ctrl(int onoff);
-extern int brcmf_custom_get_mac_address(unsigned char *buf);
-extern void brcmf_os_sdunlock_sndup_rxq(struct brcmf_pub *drvr);
-extern void brcmf_os_sdlock_eventq(struct brcmf_pub *drvr);
-extern void brcmf_os_sdunlock_eventq(struct brcmf_pub *drvr);
#ifdef BCMDBG
extern int brcmf_write_to_file(struct brcmf_pub *drvr, u8 *buf, int size);
#endif /* BCMDBG */
@@ -817,14 +808,6 @@ extern int brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx, void *handle,
char *name, u8 *mac_addr, u32 flags, u8 bssidx);
extern void brcmf_del_if(struct brcmf_info *drvr_priv, int ifidx);
-extern void brcmf_vif_add(struct brcmf_info *drvr_priv, int ifidx, char *name);
-extern void brcmf_vif_del(struct brcmf_info *drvr_priv, int ifidx);
-
-extern void brcmf_event(struct brcmf_info *drvr_priv, char *evpkt, int evlen,
- int ifidx);
-extern void brcmf_vif_sendup(struct brcmf_info *drvr_priv, int ifidx,
- unsigned char *cp, int len);
-
/* Send packet to dongle via data channel */
extern int brcmf_sendpkt(struct brcmf_pub *drvr, int ifidx,\
struct sk_buff *pkt);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
index 50da972..a60aa41 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
@@ -54,9 +54,6 @@ brcmf_sdbrcm_bus_txctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen);
extern int
brcmf_sdbrcm_bus_rxctl(struct brcmf_bus *bus, unsigned char *msg, uint msglen);
-extern void dhd_bus_isr(bool *InterruptRecognized,
- bool *QueueMiniportHandleInterrupt, void *arg);
-
/* Check for and handle local prot-specific iovar commands */
extern int brcmf_sdbrcm_bus_iovar_op(struct brcmf_pub *drvr, const char *name,
void *params, int plen, void *arg, int len,
@@ -69,13 +66,6 @@ extern void brcmf_sdbrcm_bus_dump(struct brcmf_pub *drvr,
/* Clear any bus counters */
extern void brcmf_bus_clearcounts(struct brcmf_pub *drvr);
-/* return the dongle chipid */
-extern uint brcmf_bus_chip(struct brcmf_bus *bus);
-
-extern void *brcmf_bus_drvr(struct brcmf_bus *bus);
-extern void *brcmf_bus_txq(struct brcmf_bus *bus);
-extern uint brcmf_bus_hdrlen(struct brcmf_bus *bus);
-
extern void brcmf_sdbrcm_wd_timer(struct brcmf_bus *bus, uint wdtick);
#endif /* _dhd_bus_h_ */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index d07860b..a1902f2 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -352,16 +352,6 @@ done:
(((struct sk_buff *)(skb))->ip_summed = \
((x) ? CHECKSUM_UNNECESSARY : CHECKSUM_NONE))
-/* PKTSETSUMNEEDED and PKTSUMGOOD are not possible because
- skb->ip_summed is overloaded */
-
-int
-brcmf_proto_iovar_op(struct brcmf_pub *drvr, const char *name,
- void *params, int plen, void *arg, int len, bool set)
-{
- return -ENOTSUPP;
-}
-
void brcmf_proto_dump(struct brcmf_pub *drvr, struct brcmu_strbuf *strbuf)
{
brcmu_bprintf(strbuf, "Protocol CDC: reqid %d\n", drvr->prot->reqid);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index ddc2085..ec6093e 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -414,20 +414,6 @@ int brcmf_c_ioctl(struct brcmf_pub *drvr, struct brcmf_c_ioctl *ioc, void *buf,
if (bcmerror != -ENOTSUPP)
break;
- /* not in generic table, try protocol module */
- if (ioc->cmd == BRCMF_GET_VAR)
- bcmerror = brcmf_proto_iovar_op(drvr, buf,
- arg, arglen,
- buf, buflen,
- IOV_GET);
- else
- bcmerror = brcmf_proto_iovar_op(drvr, buf,
- NULL, 0, arg,
- arglen,
- IOV_SET);
- if (bcmerror != -ENOTSUPP)
- break;
-
/* if still not found, try bus module */
if (ioc->cmd == BRCMF_GET_VAR)
bcmerror = brcmf_sdbrcm_bus_iovar_op(drvr,
@@ -815,8 +801,6 @@ brcmf_c_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
}
/* send up the if event: btamp user needs it */
*ifidx = brcmf_ifname2idx(drvr_priv, event->ifname);
- /* push up to external supp/auth */
- brcmf_event(drvr_priv, (char *)pvt_data, evlen, *ifidx);
break;
/* These are what external supplicant/authenticator wants */
@@ -829,8 +813,6 @@ 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);
- /* push up to external supp/auth */
- brcmf_event(drvr_priv, (char *)pvt_data, evlen, *ifidx);
DHD_TRACE(("%s: MAC event %d, flags %x, status %x\n",
__func__, type, flags, status));
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index fc9abba..8db4609 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -188,24 +188,6 @@ static int brcmf_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktd
struct brcmf_event_msg *event_ptr,
void **data_ptr);
-static void brcmf_set_packet_filter(int value, struct brcmf_pub *drvr)
-{
- DHD_TRACE(("%s: %d\n", __func__, value));
- /* 1 - Enable packet filter, only allow unicast packet to send up */
- /* 0 - Disable packet filter */
- if (brcmf_pkt_filter_enable) {
- int i;
-
- for (i = 0; i < drvr->pktfilter_count; i++) {
- brcmf_c_pktfilter_offload_set(drvr, drvr->pktfilter[i]);
- brcmf_c_pktfilter_offload_enable(drvr,
- drvr->pktfilter[i],
- value,
- brcmf_master_mode);
- }
- }
-}
-
#if defined(CONFIG_HAS_EARLYSUSPEND)
static int brcmf_set_suspend(int value, struct brcmf_pub *drvr)
{
@@ -933,12 +915,6 @@ void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx, struct sk_buff *skb,
}
}
-void brcmf_event(struct brcmf_info *drvr_priv, char *evpkt, int evlen, int ifidx)
-{
- /* Linux version has nothing to do */
- return;
-}
-
void brcmf_txcomplete(struct brcmf_pub *drvr, struct sk_buff *txp, bool success)
{
uint ifidx;
@@ -1600,30 +1576,6 @@ int brcmf_bus_start(struct brcmf_pub *drvr)
return 0;
}
-int brcmf_iovar(struct brcmf_pub *drvr, int ifidx, char *name, char *cmd_buf,
- uint cmd_len, int set)
-{
- char buf[strlen(name) + 1 + cmd_len];
- int len = sizeof(buf);
- struct brcmf_ioctl ioc;
- int ret;
-
- len = brcmu_mkiovar(name, cmd_buf, cmd_len, buf, len);
-
- memset(&ioc, 0, sizeof(ioc));
-
- ioc.cmd = set ? BRCMF_C_SET_VAR : BRCMF_C_GET_VAR;
- ioc.buf = buf;
- ioc.len = len;
- ioc.set = set;
-
- ret = brcmf_proto_ioctl(drvr, ifidx, &ioc, ioc.buf, ioc.len);
- if (!set && ret >= 0)
- memcpy(cmd_buf, buf, cmd_len);
-
- return ret;
-}
-
static struct net_device_ops brcmf_netdev_ops_pri = {
.ndo_open = brcmf_netdev_open,
.ndo_stop = brcmf_netdev_stop,
@@ -1886,71 +1838,6 @@ int brcmf_netdev_reset(struct net_device *dev, u8 flag)
return 1;
}
-int brcmf_netdev_set_suspend_disable(struct net_device *dev, int val)
-{
- struct brcmf_info *drvr_priv = *(struct brcmf_info **)netdev_priv(dev);
- int ret = 0;
-
- if (drvr_priv) {
- ret = drvr_priv->pub.suspend_disable_flag;
- drvr_priv->pub.suspend_disable_flag = val;
- }
- return ret;
-}
-
-int brcmf_netdev_set_suspend(struct net_device *dev, int val)
-{
- int ret = 0;
-#if defined(CONFIG_HAS_EARLYSUSPEND)
- struct brcmf_info *drvr_priv = *(struct brcmf_info **)netdev_priv(dev);
-
- if (drvr_priv) {
- brcmf_os_proto_block(&drvr_priv->pub);
- ret = brcmf_set_suspend(val, &drvr_priv->pub);
- brcmf_os_proto_unblock(&drvr_priv->pub);
- }
-#endif /* defined(CONFIG_HAS_EARLYSUSPEND) */
- return ret;
-}
-
-int brcmf_netdev_set_dtim_skip(struct net_device *dev, int val)
-{
- struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(dev);
-
- if (drvr_priv)
- drvr_priv->pub.dtim_skip = val;
-
- return 0;
-}
-
-int brcmf_netdev_set_packet_filter(struct net_device *dev, int val)
-{
- struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(dev);
- int ret = 0;
-
- /* Packet filtering is set only if we still in early-suspend and
- * we need either to turn it ON or turn it OFF
- * We can always turn it OFF in case of early-suspend, but we turn it
- * back ON only if suspend_disable_flag was not set
- */
- if (drvr_priv && drvr_priv->pub.up) {
- brcmf_os_proto_block(&drvr_priv->pub);
- if (drvr_priv->pub.in_suspend) {
- if (!val || (val && !drvr_priv->pub.suspend_disable_flag))
- brcmf_set_packet_filter(val, &drvr_priv->pub);
- }
- brcmf_os_proto_unblock(&drvr_priv->pub);
- }
- return ret;
-}
-
-void brcmf_netdev_init_ioctl(struct net_device *dev)
-{
- struct brcmf_info *drvr_priv = *(struct brcmf_info **)netdev_priv(dev);
-
- brcmf_c_preinit_ioctls(&drvr_priv->pub);
-}
-
static int brcmf_get_pend_8021x_cnt(struct brcmf_info *drvr_priv)
{
return atomic_read(&drvr_priv->pend_8021x_cnt);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_proto.h b/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
index afec597..0a76216 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
@@ -57,11 +57,6 @@ extern int brcmf_proto_hdrpull(struct brcmf_pub *, int *ifidx,
extern int brcmf_proto_ioctl(struct brcmf_pub *dhd, int ifidx,
struct brcmf_ioctl *ioc, void *buf, int len);
-/* Check for and handle local prot-specific iovar commands */
-extern int brcmf_proto_iovar_op(struct brcmf_pub *dhdp, const char *name,
- void *params, int plen, void *arg, int len,
- bool set);
-
/* Add prot dump output to a buffer */
extern void brcmf_proto_dump(struct brcmf_pub *dhdp,
struct brcmu_strbuf *strbuf);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 3cbfacb..25c5e90 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -5565,8 +5565,6 @@ brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, void *card, void *regsva,
goto fail;
}
- brcmf_sdcard_chipinfo(card, bus->ci->chip, bus->ci->chiprev);
-
if (!brcmf_sdbrcm_chipmatch((u16) bus->ci->chip)) {
DHD_ERROR(("%s: unsupported chip: 0x%04x\n",
__func__, bus->ci->chip));
@@ -6046,27 +6044,6 @@ brcmf_sdbrcm_send_buf(struct brcmf_bus *bus, u32 addr, uint fn, uint flags,
handle);
}
-uint brcmf_bus_chip(struct brcmf_bus *bus)
-{
- ASSERT(bus->ci != NULL);
- return bus->ci->chip;
-}
-
-void *brcmf_bus_drvr(struct brcmf_bus *bus)
-{
- return bus->drvr;
-}
-
-void *brcmf_bus_txq(struct brcmf_bus *bus)
-{
- return &bus->txq;
-}
-
-uint brcmf_bus_hdrlen(struct brcmf_bus *bus)
-{
- return SDPCM_HDRLEN;
-}
-
int brcmf_bus_devreset(struct brcmf_pub *drvr, u8 flag)
{
int bcmerror = 0;
diff --git a/drivers/staging/brcm80211/brcmfmac/sdio_host.h b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
index 5d2178d..68a2a64 100644
--- a/drivers/staging/brcm80211/brcmfmac/sdio_host.h
+++ b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
@@ -58,9 +58,6 @@ extern struct brcmf_sdio_card *brcmf_sdcard_attach(void *cfghdl, void **regsva,
/* Detach - freeup resources allocated in attach */
extern int brcmf_sdcard_detach(struct brcmf_sdio_card *card);
-/* Query if SD device interrupts are enabled */
-extern bool brcmf_sdcard_intr_query(struct brcmf_sdio_card *card);
-
/* Enable/disable SD interrupt */
extern int brcmf_sdcard_intr_enable(struct brcmf_sdio_card *card);
extern int brcmf_sdcard_intr_disable(struct brcmf_sdio_card *card);
@@ -72,13 +69,6 @@ brcmf_sdcard_intr_reg(struct brcmf_sdio_card *card,
extern int brcmf_sdcard_intr_dereg(struct brcmf_sdio_card *card);
-/* Register a callback to be called on device removal.
- * No-op in the case of non-removable/hardwired devices.
- */
-extern int
-brcmf_sdcard_devremove_reg(struct brcmf_sdio_card *card,
- void (*fn)(void *), void *argh);
-
/* Access SDIO address space (e.g. CCCR) using CMD52 (single-byte interface).
* fn: function number
* addr: unmodified SDIO-space address
@@ -173,9 +163,6 @@ extern int brcmf_sdcard_abort(struct brcmf_sdio_card *card, uint fn);
/* Returns the "Device ID" of target device on the SDIO bus. */
extern int brcmf_sdcard_query_device(struct brcmf_sdio_card *card);
-/* Returns the number of IO functions reported by the device */
-extern uint brcmf_sdcard_query_iofnum(struct brcmf_sdio_card *card);
-
/* Miscellaneous knob tweaker. */
extern int brcmf_sdcard_iovar_op(struct brcmf_sdio_card *card, const char *name,
void *params, int plen, void *arg, int len,
@@ -183,8 +170,6 @@ extern int brcmf_sdcard_iovar_op(struct brcmf_sdio_card *card, const char *name,
/* helper functions */
-extern void *brcmf_sdcard_get_sdioh(struct brcmf_sdio_card *card);
-
/* callback functions */
struct brcmf_sdioh_driver {
/* attach to device */
@@ -200,19 +185,11 @@ struct sdioh_info;
extern int brcmf_sdio_function_init(void);
extern int brcmf_sdio_register(struct brcmf_sdioh_driver *driver);
extern void brcmf_sdio_unregister(void);
-extern bool brcmf_sdio_chipmatch(u16 vendor, u16 device);
extern void brcmf_sdio_function_cleanup(void);
extern int brcmf_sdio_probe(struct device *dev);
extern int brcmf_sdio_remove(struct device *dev);
-/* Function to pass device-status bits to DHD. */
-extern u32 brcmf_sdcard_get_dstatus(struct brcmf_sdio_card *card);
-
/* Function to return current window addr */
extern u32 brcmf_sdcard_cur_sbwad(struct brcmf_sdio_card *card);
-/* Function to pass chipid and rev to lower layers for controlling pr's */
-extern void brcmf_sdcard_chipinfo(struct brcmf_sdio_card *card, u32 chip,
- u32 chiprev);
-
#endif /* _BRCM_SDH_H_ */
--
1.7.1
From: Arend van Spriel <[email protected]>
Some code is conditionally compiled in upon defintion of PLATFORM_BUS
macro. This patch will have it compiled in unconditionally.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/Makefile | 1 -
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c | 9 ---------
2 files changed, 0 insertions(+), 10 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/Makefile b/drivers/staging/brcm80211/brcmfmac/Makefile
index f76e62a..0674a6a 100644
--- a/drivers/staging/brcm80211/brcmfmac/Makefile
+++ b/drivers/staging/brcm80211/brcmfmac/Makefile
@@ -16,7 +16,6 @@
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
ccflags-y := \
- -DBCMPLATFORM_BUS \
-DBCMSDIO \
-DBRCM_FULLMAC \
-DBRCMF_FIRSTREAD=64 \
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
index 5243f33..5194c59 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
@@ -36,9 +36,6 @@
extern void brcmf_sdbrcm_isr(void *args);
#endif /* defined(OOB_INTR_ONLY) */
#if defined(CONFIG_MACH_SANDGATE2G) || defined(CONFIG_MACH_LOGICPD_PXA270)
-#if !defined(BCMPLATFORM_BUS)
-#define BCMPLATFORM_BUS
-#endif /* !defined(BCMPLATFORM_BUS) */
#include <linux/platform_device.h>
#endif /* CONFIG_MACH_SANDGATE2G */
@@ -51,11 +48,7 @@ extern void brcmf_sdbrcm_isr(void *args);
*/
struct bcmsdh_hc {
struct bcmsdh_hc *next;
-#ifdef BCMPLATFORM_BUS
struct device *dev; /* platform device handle */
-#else
- struct pci_dev *dev; /* pci device handle */
-#endif /* BCMPLATFORM_BUS */
void *regs; /* SDIO Host Controller address */
struct brcmf_sdio *sdh; /* SDIO Host Controller handle */
void *ch;
@@ -120,7 +113,6 @@ bool brcmf_sdio_chipmatch(u16 vendor, u16 device)
return false;
}
-#if defined(BCMPLATFORM_BUS)
/* forward declarations */
int brcmf_sdio_probe(struct device *dev);
EXPORT_SYMBOL(brcmf_sdio_probe);
@@ -228,7 +220,6 @@ int brcmf_sdio_remove(struct device *dev)
kfree(sdhc);
return 0;
}
-#endif /* BCMPLATFORM_BUS */
extern int brcmf_sdio_function_init(void);
--
1.7.1
From: Roland Vossen <[email protected]>
Code cleanup. Fullmac contains macro's that access registers on the 32 bits
backplane bus. These registers should not be declared as pointers since
pointers can be 64 bits. The following patch series gets rid of these pointers
and ultimately of all compiler warning when compiling for amd64.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 77 ++++++++++++-------------
1 files changed, 38 insertions(+), 39 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 25c5e90..5a15002 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -37,38 +37,36 @@
/* register access macros */
#ifndef __BIG_ENDIAN
#ifndef __mips__
-#define R_REG(r) \
- brcmf_sdcard_reg_read(NULL, (unsigned long)(r), sizeof(*(r)))
+#define R_REG(r, typ) \
+ brcmf_sdcard_reg_read(NULL, (r), sizeof(typ))
#else /* __mips__ */
-#define R_REG(r) \
+#define R_REG(r, typ) \
({ \
__typeof(*(r)) __osl_v; \
__asm__ __volatile__("sync"); \
- __osl_v = brcmf_sdcard_reg_read(NULL, (unsigned long)(r),\
- sizeof(*(r))); \
+ __osl_v = brcmf_sdcard_reg_read(NULL, (r),\
+ sizeof(typ)); \
__asm__ __volatile__("sync"); \
__osl_v; \
})
#endif /* __mips__ */
-#define W_REG(r, v) do { \
- brcmf_sdcard_reg_write(NULL, (unsigned long)(r), sizeof(*(r)), \
- (v)); \
+#define W_REG(r, v, typ) do { \
+ brcmf_sdcard_reg_write(NULL, (r), sizeof(typ), (v)); \
} while (0)
#else /* __BIG_ENDIAN */
-#define R_REG(r) \
- brcmf_sdcard_reg_read(NULL, (unsigned long)(r), sizeof(*(r)))
-#define W_REG(r, v) do { \
- brcmf_sdcard_reg_write(NULL, (unsigned long)(r), sizeof(*(r)), \
- (v)); \
+#define R_REG(r, typ) \
+ brcmf_sdcard_reg_read(NULL, (r), sizeof(typ))
+#define W_REG(r, v, typ) do { \
+ brcmf_sdcard_reg_write(NULL, (r), sizeof(typ), (v)); \
} while (0)
#endif /* __BIG_ENDIAN */
-#define AND_REG(r, v) W_REG((r), R_REG(r) & (v))
-#define OR_REG(r, v) W_REG((r), R_REG(r) | (v))
+#define AND_REG(r, v, typ) W_REG((r), R_REG(r, typ) & (v), typ)
+#define OR_REG(r, v, typ) W_REG((r), R_REG(r, typ) | (v), typ)
-#define SET_REG(r, mask, val) \
- W_REG((r), ((R_REG(r) & ~(mask)) | (val)))
+#define SET_REG(r, mask, val, typ) \
+ W_REG((r), ((R_REG(r) & ~(mask)) | (val)), typ)
#ifdef BCMDBG
@@ -826,11 +824,11 @@ static bool brcmf_readahead;
/* Macros to get register read/write status */
/* NOTE: these assume a local dhdsdio_bus_t *bus! */
-#define R_SDREG(regvar, regaddr, retryvar) \
+#define R_SDREG(regvar, regaddr, retryvar, typ) \
do { \
retryvar = 0; \
do { \
- regvar = R_REG(regaddr); \
+ regvar = R_REG((u32)(regaddr), typ); \
} while (brcmf_sdcard_regfail(bus->card) && \
(++retryvar <= retry_limit)); \
if (retryvar) { \
@@ -843,11 +841,11 @@ do { \
} \
} while (0)
-#define W_SDREG(regval, regaddr, retryvar) \
+#define W_SDREG(regval, regaddr, retryvar, typ) \
do { \
retryvar = 0; \
do { \
- W_REG(regaddr, regval); \
+ W_REG((u32)(regaddr), regval, typ); \
} while (brcmf_sdcard_regfail(bus->card) && \
(++retryvar <= retry_limit)); \
if (retryvar) { \
@@ -994,7 +992,8 @@ static int brcmf_sdbrcm_htclk(struct brcmf_bus *bus, bool on, bool pendok)
if (pendok && ((bus->ci->buscoretype == PCMCIA_CORE_ID)
&& (bus->ci->buscorerev == 9))) {
u32 dummy, retries;
- R_SDREG(dummy, &bus->regs->clockctlstatus, retries);
+ R_SDREG(dummy, &bus->regs->clockctlstatus, retries,
+ u32);
}
/* Check current status */
@@ -1191,7 +1190,7 @@ int brcmf_sdbrcm_bussleep(struct brcmf_bus *bus, bool sleep)
brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
/* Tell device to start using OOB wakeup */
- W_SDREG(SMB_USE_OOB, ®s->tosbmailbox, retries);
+ W_SDREG(SMB_USE_OOB, ®s->tosbmailbox, retries, u32);
if (retries > retry_limit)
DHD_ERROR(("CANNOT SIGNAL CHIP, WILL NOT WAKE UP!!\n"));
@@ -1230,9 +1229,9 @@ int brcmf_sdbrcm_bussleep(struct brcmf_bus *bus, bool sleep)
brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
/* Send misc interrupt to indicate OOB not needed */
- W_SDREG(0, ®s->tosbmailboxdata, retries);
+ W_SDREG(0, ®s->tosbmailboxdata, retries, u32);
if (retries <= retry_limit)
- W_SDREG(SMB_DEV_INT, ®s->tosbmailbox, retries);
+ W_SDREG(SMB_DEV_INT, ®s->tosbmailbox, retries, u32);
if (retries > retry_limit)
DHD_ERROR(("CANNOT SIGNAL CHIP TO CLEAR OOB!!\n"));
@@ -1554,7 +1553,7 @@ static uint brcmf_sdbrcm_sendfromq(struct brcmf_bus *bus, uint maxframes)
/* In poll mode, need to check for other events */
if (!bus->intr && cnt) {
/* Check device status, signal pending interrupt */
- R_SDREG(intstatus, ®s->intstatus, retries);
+ R_SDREG(intstatus, ®s->intstatus, retries, u32);
bus->f2txdata++;
if (brcmf_sdcard_regfail(bus->card))
break;
@@ -3029,7 +3028,7 @@ static int brcmf_sdbrcm_download_state(struct brcmf_bus *bus, bool enter)
bcmerror = 0;
}
- W_SDREG(0xFFFFFFFF, &bus->regs->intstatus, retries);
+ W_SDREG(0xFFFFFFFF, &bus->regs->intstatus, retries, u32);
brcmf_sdbrcm_chip_resetcore(bus->card, bus->ci->armcorebase);
@@ -3162,7 +3161,7 @@ void brcmf_sdbrcm_bus_stop(struct brcmf_bus *bus, bool enforce_mutex)
tasklet_kill(&bus->tasklet);
/* Disable and clear interrupts at the chip level also */
- W_SDREG(0, &bus->regs->hostintmask, retries);
+ W_SDREG(0, &bus->regs->hostintmask, retries, u32);
local_hostintmask = bus->hostintmask;
bus->hostintmask = 0;
@@ -3189,7 +3188,7 @@ void brcmf_sdbrcm_bus_stop(struct brcmf_bus *bus, bool enforce_mutex)
SDIO_FUNC_ENABLE_1, NULL);
/* Clear any pending interrupts now that F2 is disabled */
- W_SDREG(local_hostintmask, &bus->regs->intstatus, retries);
+ W_SDREG(local_hostintmask, &bus->regs->intstatus, retries, u32);
/* Turn off the backplane clock (only) */
brcmf_sdbrcm_clkctl(bus, CLK_SDONLY, false);
@@ -3268,7 +3267,7 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex)
/* Enable function 2 (frame transfers) */
W_SDREG((SDPCM_PROT_VERSION << SMB_DATA_VERSION_SHIFT),
- &bus->regs->tosbmailboxdata, retries);
+ &bus->regs->tosbmailboxdata, retries, u32);
enable = (SDIO_FUNC_ENABLE_1 | SDIO_FUNC_ENABLE_2);
brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_0, SDIO_CCCR_IOEx, enable,
@@ -3291,7 +3290,7 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex)
bus->hostintmask = HOSTINTMASK;
W_SDREG(bus->hostintmask,
(unsigned int *)CORE_BUS_REG(bus->ci->buscorebase,
- hostintmask), retries);
+ hostintmask), retries, u32);
brcmf_sdcard_cfg_write(bus->card, SDIO_FUNC_1, SBSDIO_WATERMARK,
(u8) watermark, &err);
@@ -3395,7 +3394,7 @@ static void brcmf_sdbrcm_rxfail(struct brcmf_bus *bus, bool abort, bool rtx)
if (rtx) {
bus->rxrtx++;
- W_SDREG(SMB_NAK, ®s->tosbmailbox, retries);
+ W_SDREG(SMB_NAK, ®s->tosbmailbox, retries, u32);
bus->f1regdata++;
if (retries <= retry_limit)
bus->rxskip = true;
@@ -4525,9 +4524,9 @@ static u32 brcmf_sdbrcm_hostmail(struct brcmf_bus *bus)
DHD_TRACE(("%s: Enter\n", __func__));
/* Read mailbox data and ack that we did so */
- R_SDREG(hmb_data, ®s->tohostmailboxdata, retries);
+ R_SDREG(hmb_data, ®s->tohostmailboxdata, retries, u32);
if (retries <= retry_limit)
- W_SDREG(SMB_INT_ACK, ®s->tosbmailbox, retries);
+ W_SDREG(SMB_INT_ACK, ®s->tosbmailbox, retries, u32);
bus->f1regdata += 2;
/* Dongle recomposed rx frames, accept them again */
@@ -4669,14 +4668,14 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)
/* Pending interrupt indicates new device status */
if (bus->ipend) {
bus->ipend = false;
- R_SDREG(newstatus, ®s->intstatus, retries);
+ R_SDREG(newstatus, ®s->intstatus, retries, u32);
bus->f1regdata++;
if (brcmf_sdcard_regfail(bus->card))
newstatus = 0;
newstatus &= bus->hostintmask;
bus->fcstate = !!(newstatus & I_HMB_FC_STATE);
if (newstatus) {
- W_SDREG(newstatus, ®s->intstatus, retries);
+ W_SDREG(newstatus, ®s->intstatus, retries, u32);
bus->f1regdata++;
}
}
@@ -4691,8 +4690,8 @@ static bool brcmf_sdbrcm_dpc(struct brcmf_bus *bus)
*/
if (intstatus & I_HMB_FC_CHANGE) {
intstatus &= ~I_HMB_FC_CHANGE;
- W_SDREG(I_HMB_FC_CHANGE, ®s->intstatus, retries);
- R_SDREG(newstatus, ®s->intstatus, retries);
+ W_SDREG(I_HMB_FC_CHANGE, ®s->intstatus, retries, u32);
+ R_SDREG(newstatus, ®s->intstatus, retries, u32);
bus->f1regdata += 2;
bus->fcstate =
!!(newstatus & (I_HMB_FC_STATE | I_HMB_FC_CHANGE));
@@ -5594,7 +5593,7 @@ brcmf_sdbrcm_probe_attach(struct brcmf_bus *bus, void *card, void *regsva,
bus->regs = (void *)bus->ci->buscorebase;
/* Set core control so an SDIO reset does a backplane reset */
- OR_REG(&bus->regs->corecontrol, CC_BPRESEN);
+ OR_REG((u32)&bus->regs->corecontrol, CC_BPRESEN, u32);
brcmu_pktq_init(&bus->txq, (PRIOMASK + 1), TXQLEN);
--
1.7.1
From: Arend van Spriel <[email protected]>
renamed structures to consitent naming convention and removed the
structure type definitions.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 20 ++--
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 4 +-
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 140 +++++++++++-----------
3 files changed, 82 insertions(+), 82 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index d69cee1..196b372 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -524,14 +524,14 @@ struct brcmf_ioctl {
/* Forward decls for struct dhd_pub (see below) */
struct dhd_bus; /* device bus info */
struct brcmf_proto; /* device communication protocol info */
-struct dhd_info; /* device driver info */
+struct brcmf_info; /* device driver info */
/* Common structure for module and instance linkage */
typedef struct dhd_pub {
/* Linkage ponters */
struct dhd_bus *bus;
struct brcmf_proto *prot;
- struct dhd_info *info;
+ struct brcmf_info *info;
/* Internal dhd items */
bool up; /* Driver up/down (to OS) */
@@ -806,22 +806,22 @@ extern int brcmf_write_to_file(dhd_pub_t *dhd, u8 *buf, int size);
extern void brcmf_timeout_start(struct brcmf_timeout *tmo, uint usec);
extern int brcmf_timeout_expired(struct brcmf_timeout *tmo);
-extern int brcmf_ifname2idx(struct dhd_info *dhd, char *name);
-extern int brcmf_c_host_event(struct dhd_info *dhd, int *idx, void *pktdata,
+extern int brcmf_ifname2idx(struct brcmf_info *dhd, char *name);
+extern int brcmf_c_host_event(struct brcmf_info *dhd, int *idx, void *pktdata,
brcmf_event_msg_t *, void **data_ptr);
extern void brcmf_c_init(void);
-extern int brcmf_add_if(struct dhd_info *dhd, int ifidx, void *handle,
+extern int brcmf_add_if(struct brcmf_info *dhd, int ifidx, void *handle,
char *name, u8 *mac_addr, u32 flags, u8 bssidx);
-extern void brcmf_del_if(struct dhd_info *dhd, int ifidx);
+extern void brcmf_del_if(struct brcmf_info *dhd, int ifidx);
-extern void brcmf_vif_add(struct dhd_info *dhd, int ifidx, char *name);
-extern void brcmf_vif_del(struct dhd_info *dhd, int ifidx);
+extern void brcmf_vif_add(struct brcmf_info *dhd, int ifidx, char *name);
+extern void brcmf_vif_del(struct brcmf_info *dhd, int ifidx);
-extern void brcmf_event(struct dhd_info *dhd, char *evpkt, int evlen,
+extern void brcmf_event(struct brcmf_info *dhd, char *evpkt, int evlen,
int ifidx);
-extern void brcmf_vif_sendup(struct dhd_info *dhd, int ifidx,
+extern void brcmf_vif_sendup(struct brcmf_info *dhd, int ifidx,
unsigned char *cp, int len);
/* Send packet to dongle via data channel */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index de07526..5c3a5cf 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -755,8 +755,8 @@ static void brcmf_c_show_host_event(brcmf_event_msg_t *event, void *event_data)
#endif /* SHOW_EVENTS */
int
-brcmf_c_host_event(struct dhd_info *drvr_priv, int *ifidx, void *pktdata,
- brcmf_event_msg_t *event, void **data_ptr)
+brcmf_c_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
+ brcmf_event_msg_t *event, void **data_ptr)
{
/* check whether packet is a BRCM event pkt */
brcmf_event_t *pvt_data = (brcmf_event_t *) pktdata;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 2705ec0..86a6adb 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -60,8 +60,8 @@ MODULE_LICENSE("Dual BSD/GPL");
/* Interface control information */
-typedef struct dhd_if {
- struct dhd_info *info; /* back pointer to dhd_info */
+struct brcmf_if {
+ struct brcmf_info *info; /* back pointer to brcmf_info */
/* OS/stack specifics */
struct net_device *net;
struct net_device_stats stats;
@@ -72,14 +72,14 @@ typedef struct dhd_if {
bool attached; /* Delayed attachment when unset */
bool txflowcontrol; /* Per interface flow control indicator */
char name[IFNAMSIZ]; /* linux interface name */
-} dhd_if_t;
+};
/* Local private structure (extension of pub) */
-typedef struct dhd_info {
+struct brcmf_info {
dhd_pub_t pub;
/* OS/stack specifics */
- dhd_if_t *iflist[BRCMF_MAX_IFS];
+ struct brcmf_if *iflist[BRCMF_MAX_IFS];
struct semaphore proto_sem;
wait_queue_head_t ioctl_resp_wait;
@@ -95,7 +95,7 @@ typedef struct dhd_info {
#ifdef CONFIG_HAS_EARLYSUSPEND
struct early_suspend early_suspend;
#endif /* CONFIG_HAS_EARLYSUSPEND */
-} dhd_info_t;
+};
/* Error bits */
module_param(brcmf_msg_level, int, 0);
@@ -182,9 +182,9 @@ module_param(brcmf_pktgen_len, uint, 0);
#define DHD_COMPILED
#endif
-static int brcmf_toe_get(dhd_info_t *drvr_priv, int idx, u32 *toe_ol);
-static int brcmf_toe_set(dhd_info_t *drvr_priv, int idx, u32 toe_ol);
-static int brcmf_host_event(dhd_info_t *drvr_priv, int *ifidx, void *pktdata,
+static int brcmf_toe_get(struct brcmf_info *drvr_priv, int idx, u32 *toe_ol);
+static int brcmf_toe_set(struct brcmf_info *drvr_priv, int idx, u32 toe_ol);
+static int brcmf_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
brcmf_event_msg_t *event_ptr, void **data_ptr);
static void brcmf_set_packet_filter(int value, dhd_pub_t *drvr)
@@ -271,7 +271,7 @@ static int brcmf_set_suspend(int value, dhd_pub_t *drvr)
return 0;
}
-static void brcmf_suspend_resume_helper(struct dhd_info *drvr_priv, int val)
+static void brcmf_suspend_resume_helper(struct brcmf_info *drvr_priv, int val)
{
dhd_pub_t *drvr = &drvr_priv->pub;
@@ -285,8 +285,8 @@ static void brcmf_suspend_resume_helper(struct dhd_info *drvr_priv, int val)
static void brcmf_early_suspend(struct early_suspend *h)
{
- struct dhd_info *drvr_priv =
- container_of(h, struct dhd_info, early_suspend);
+ struct brcmf_info *drvr_priv =
+ container_of(h, struct brcmf_info, early_suspend);
DHD_TRACE(("%s: enter\n", __func__));
@@ -297,8 +297,8 @@ static void brcmf_early_suspend(struct early_suspend *h)
static void brcmf_late_resume(struct early_suspend *h)
{
- struct dhd_info *drvr_priv =
- container_of(h, struct dhd_info, early_suspend);
+ struct brcmf_info *drvr_priv =
+ container_of(h, struct brcmf_info, early_suspend);
DHD_TRACE(("%s: enter\n", __func__));
@@ -365,7 +365,7 @@ int brcmf_timeout_expired(struct brcmf_timeout *tmo)
return 0;
}
-static int brcmf_net2idx(dhd_info_t *drvr_priv, struct net_device *net)
+static int brcmf_net2idx(struct brcmf_info *drvr_priv, struct net_device *net)
{
int i = 0;
@@ -379,7 +379,7 @@ static int brcmf_net2idx(dhd_info_t *drvr_priv, struct net_device *net)
return BRCMF_BAD_IF;
}
-int brcmf_ifname2idx(dhd_info_t *drvr_priv, char *name)
+int brcmf_ifname2idx(struct brcmf_info *drvr_priv, char *name)
{
int i = BRCMF_MAX_IFS;
@@ -400,7 +400,7 @@ int brcmf_ifname2idx(dhd_info_t *drvr_priv, char *name)
char *brcmf_ifname(dhd_pub_t *drvr, int ifidx)
{
- dhd_info_t *drvr_priv = drvr->info;
+ struct brcmf_info *drvr_priv = drvr->info;
ASSERT(drvr_priv);
@@ -420,7 +420,7 @@ char *brcmf_ifname(dhd_pub_t *drvr, int ifidx)
return "<if_none>";
}
-static void _brcmf_set_multicast_list(dhd_info_t *drvr_priv, int ifidx)
+static void _brcmf_set_multicast_list(struct brcmf_info *drvr_priv, int ifidx)
{
struct net_device *dev;
struct netdev_hw_addr *ha;
@@ -536,7 +536,7 @@ static void _brcmf_set_multicast_list(dhd_info_t *drvr_priv, int ifidx)
}
}
-static int _brcmf_set_mac_address(dhd_info_t *drvr_priv, int ifidx, u8 *addr)
+static int _brcmf_set_mac_address(struct brcmf_info *drvr_priv, int ifidx, u8 *addr)
{
char buf[32];
struct brcmf_ioctl ioc;
@@ -570,9 +570,9 @@ static int _brcmf_set_mac_address(dhd_info_t *drvr_priv, int ifidx, u8 *addr)
extern struct net_device *ap_net_dev;
#endif
-static void brcmf_op_if(dhd_if_t *ifp)
+static void brcmf_op_if(struct brcmf_if *ifp)
{
- dhd_info_t *drvr_priv;
+ struct brcmf_info *drvr_priv;
int ret = 0, err = 0;
ASSERT(ifp && ifp->info && ifp->idx); /* Virtual interfaces only */
@@ -662,7 +662,7 @@ static void brcmf_op_if(dhd_if_t *ifp)
static int _brcmf_sysioc_thread(void *data)
{
- dhd_info_t *drvr_priv = (dhd_info_t *) data;
+ struct brcmf_info *drvr_priv = (struct brcmf_info *) data;
int i;
#ifdef SOFTAP
bool in_ap = false;
@@ -723,7 +723,7 @@ static int brcmf_netdev_set_mac_address(struct net_device *dev, void *addr)
{
int ret = 0;
- dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(dev);
+ struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(dev);
struct sockaddr *sa = (struct sockaddr *)addr;
int ifidx;
@@ -741,7 +741,7 @@ static int brcmf_netdev_set_mac_address(struct net_device *dev, void *addr)
static void brcmf_netdev_set_multicast_list(struct net_device *dev)
{
- dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(dev);
+ struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(dev);
int ifidx;
ifidx = brcmf_net2idx(drvr_priv, dev);
@@ -755,7 +755,7 @@ static void brcmf_netdev_set_multicast_list(struct net_device *dev)
int brcmf_sendpkt(dhd_pub_t *drvr, int ifidx, struct sk_buff *pktbuf)
{
- dhd_info_t *drvr_priv = drvr->info;
+ struct brcmf_info *drvr_priv = drvr->info;
/* Reject if down */
if (!drvr->up || (drvr->busstate == DHD_BUS_DOWN))
@@ -782,7 +782,7 @@ int brcmf_sendpkt(dhd_pub_t *drvr, int ifidx, struct sk_buff *pktbuf)
static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *net)
{
int ret;
- dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(net);
+ struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
int ifidx;
DHD_TRACE(("%s: Enter\n", __func__));
@@ -835,7 +835,7 @@ done:
void brcmf_txflowcontrol(dhd_pub_t *drvr, int ifidx, bool state)
{
struct net_device *net;
- dhd_info_t *drvr_priv = drvr->info;
+ struct brcmf_info *drvr_priv = drvr->info;
DHD_TRACE(("%s: Enter\n", __func__));
@@ -851,13 +851,13 @@ void brcmf_txflowcontrol(dhd_pub_t *drvr, int ifidx, bool state)
void brcmf_rx_frame(dhd_pub_t *drvr, int ifidx, struct sk_buff *skb,
int numpkt)
{
- dhd_info_t *drvr_priv = drvr->info;
+ struct brcmf_info *drvr_priv = drvr->info;
unsigned char *eth;
uint len;
void *data;
struct sk_buff *pnext, *save_pktbuf;
int i;
- dhd_if_t *ifp;
+ struct brcmf_if *ifp;
brcmf_event_msg_t event;
DHD_TRACE(("%s: Enter\n", __func__));
@@ -932,7 +932,7 @@ void brcmf_rx_frame(dhd_pub_t *drvr, int ifidx, struct sk_buff *skb,
}
}
-void brcmf_event(struct dhd_info *drvr_priv, char *evpkt, int evlen, int ifidx)
+void brcmf_event(struct brcmf_info *drvr_priv, char *evpkt, int evlen, int ifidx)
{
/* Linux version has nothing to do */
return;
@@ -941,7 +941,7 @@ void brcmf_event(struct dhd_info *drvr_priv, char *evpkt, int evlen, int ifidx)
void brcmf_txcomplete(dhd_pub_t *drvr, struct sk_buff *txp, bool success)
{
uint ifidx;
- dhd_info_t *drvr_priv = drvr->info;
+ struct brcmf_info *drvr_priv = drvr->info;
struct ethhdr *eh;
u16 type;
@@ -957,8 +957,8 @@ void brcmf_txcomplete(dhd_pub_t *drvr, struct sk_buff *txp, bool success)
static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net)
{
- dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(net);
- dhd_if_t *ifp;
+ struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
+ struct brcmf_if *ifp;
int ifidx;
DHD_TRACE(("%s: Enter\n", __func__));
@@ -991,7 +991,7 @@ static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net)
/* Retrieve current toe component enables, which are kept
as a bitmap in toe_ol iovar */
-static int brcmf_toe_get(dhd_info_t *drvr_priv, int ifidx, u32 *toe_ol)
+static int brcmf_toe_get(struct brcmf_info *drvr_priv, int ifidx, u32 *toe_ol)
{
struct brcmf_ioctl ioc;
char buf[32];
@@ -1025,7 +1025,7 @@ static int brcmf_toe_get(dhd_info_t *drvr_priv, int ifidx, u32 *toe_ol)
/* Set current toe component enables in toe_ol iovar,
and set toe global enable iovar */
-static int brcmf_toe_set(dhd_info_t *drvr_priv, int ifidx, u32 toe_ol)
+static int brcmf_toe_set(struct brcmf_info *drvr_priv, int ifidx, u32 toe_ol)
{
struct brcmf_ioctl ioc;
char buf[32];
@@ -1070,7 +1070,7 @@ static int brcmf_toe_set(dhd_info_t *drvr_priv, int ifidx, u32 toe_ol)
static void brcmf_ethtool_get_drvinfo(struct net_device *net,
struct ethtool_drvinfo *info)
{
- dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(net);
+ struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
sprintf(info->driver, KBUILD_MODNAME);
sprintf(info->version, "%lu", drvr_priv->pub.drv_version);
@@ -1082,7 +1082,7 @@ struct ethtool_ops brcmf_ethtool_ops = {
.get_drvinfo = brcmf_ethtool_get_drvinfo
};
-static int brcmf_ethtool(dhd_info_t *drvr_priv, void *uaddr)
+static int brcmf_ethtool(struct brcmf_info *drvr_priv, void *uaddr)
{
struct ethtool_drvinfo info;
char drvname[sizeof(info.driver)];
@@ -1196,7 +1196,7 @@ static int brcmf_ethtool(dhd_info_t *drvr_priv, void *uaddr)
static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
int cmd)
{
- dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(net);
+ struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
struct brcmf_c_ioctl ioc;
int bcmerror = 0;
int buflen = 0;
@@ -1312,7 +1312,7 @@ done:
static int brcmf_netdev_stop(struct net_device *net)
{
#if !defined(IGNORE_ETH0_DOWN)
- dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(net);
+ struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
DHD_TRACE(("%s: Enter\n", __func__));
wl_cfg80211_down();
@@ -1332,7 +1332,7 @@ static int brcmf_netdev_stop(struct net_device *net)
static int brcmf_netdev_open(struct net_device *net)
{
- dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(net);
+ struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(net);
u32 toe_ol;
int ifidx = brcmf_net2idx(drvr_priv, net);
s32 ret = 0;
@@ -1371,10 +1371,10 @@ static int brcmf_netdev_open(struct net_device *net)
}
int
-brcmf_add_if(dhd_info_t *drvr_priv, int ifidx, void *handle, char *name,
+brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx, void *handle, char *name,
u8 *mac_addr, u32 flags, u8 bssidx)
{
- dhd_if_t *ifp;
+ struct brcmf_if *ifp;
DHD_TRACE(("%s: idx %d, handle->%p\n", __func__, ifidx, handle));
@@ -1382,14 +1382,14 @@ brcmf_add_if(dhd_info_t *drvr_priv, int ifidx, void *handle, char *name,
ifp = drvr_priv->iflist[ifidx];
if (!ifp) {
- ifp = kmalloc(sizeof(dhd_if_t), GFP_ATOMIC);
+ ifp = kmalloc(sizeof(struct brcmf_if), GFP_ATOMIC);
if (!ifp) {
- DHD_ERROR(("%s: OOM - dhd_if_t\n", __func__));
+ DHD_ERROR(("%s: OOM - struct dhd_if\n", __func__));
return -ENOMEM;
}
}
- memset(ifp, 0, sizeof(dhd_if_t));
+ memset(ifp, 0, sizeof(struct brcmf_if));
ifp->info = drvr_priv;
drvr_priv->iflist[ifidx] = ifp;
strlcpy(ifp->name, name, IFNAMSIZ);
@@ -1407,9 +1407,9 @@ brcmf_add_if(dhd_info_t *drvr_priv, int ifidx, void *handle, char *name,
return 0;
}
-void brcmf_del_if(dhd_info_t *drvr_priv, int ifidx)
+void brcmf_del_if(struct brcmf_info *drvr_priv, int ifidx)
{
- dhd_if_t *ifp;
+ struct brcmf_if *ifp;
DHD_TRACE(("%s: idx %d\n", __func__, ifidx));
@@ -1428,7 +1428,7 @@ void brcmf_del_if(dhd_info_t *drvr_priv, int ifidx)
dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
{
- dhd_info_t *drvr_priv = NULL;
+ struct brcmf_info *drvr_priv = NULL;
struct net_device *net;
DHD_TRACE(("%s: Enter\n", __func__));
@@ -1440,15 +1440,15 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
goto fail;
}
- /* Allocate primary dhd_info */
- drvr_priv = kzalloc(sizeof(dhd_info_t), GFP_ATOMIC);
+ /* Allocate primary brcmf_info */
+ drvr_priv = kzalloc(sizeof(struct brcmf_info), GFP_ATOMIC);
if (!drvr_priv) {
DHD_ERROR(("%s: OOM - alloc dhd_info\n", __func__));
goto fail;
}
/*
- * Save the dhd_info into the priv
+ * Save the brcmf_info into the priv
*/
memcpy(netdev_priv(net), &drvr_priv, sizeof(drvr_priv));
@@ -1505,7 +1505,7 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
drvr_priv->sysioc_tsk = NULL;
/*
- * Save the dhd_info into the priv
+ * Save the brcmf_info into the priv
*/
memcpy(netdev_priv(net), &drvr_priv, sizeof(drvr_priv));
@@ -1538,7 +1538,7 @@ fail:
int brcmf_bus_start(dhd_pub_t *drvr)
{
int ret = -1;
- dhd_info_t *drvr_priv = drvr->info;
+ struct brcmf_info *drvr_priv = drvr->info;
/* Room for "event_msgs" + '\0' + bitvec */
char iovbuf[BRCMF_EVENTING_MASK_LEN + 12];
@@ -1635,7 +1635,7 @@ static struct net_device_ops brcmf_netdev_ops_pri = {
int brcmf_net_attach(dhd_pub_t *drvr, int ifidx)
{
- dhd_info_t *drvr_priv = drvr->info;
+ struct brcmf_info *drvr_priv = drvr->info;
struct net_device *net;
u8 temp_addr[ETH_ALEN] = {
0x00, 0x90, 0x4c, 0x11, 0x22, 0x33};
@@ -1691,7 +1691,7 @@ fail:
static void brcmf_bus_detach(dhd_pub_t *drvr)
{
- dhd_info_t *drvr_priv;
+ struct brcmf_info *drvr_priv;
DHD_TRACE(("%s: Enter\n", __func__));
@@ -1709,14 +1709,14 @@ static void brcmf_bus_detach(dhd_pub_t *drvr)
void brcmf_detach(dhd_pub_t *drvr)
{
- dhd_info_t *drvr_priv;
+ struct brcmf_info *drvr_priv;
DHD_TRACE(("%s: Enter\n", __func__));
if (drvr) {
drvr_priv = drvr->info;
if (drvr_priv) {
- dhd_if_t *ifp;
+ struct brcmf_if *ifp;
int i;
#if defined(CONFIG_HAS_EARLYSUSPEND)
@@ -1790,7 +1790,7 @@ module_exit(brcmf_module_cleanup);
*/
int brcmf_os_proto_block(dhd_pub_t *drvr)
{
- dhd_info_t *drvr_priv = drvr->info;
+ struct brcmf_info *drvr_priv = drvr->info;
if (drvr_priv) {
down(&drvr_priv->proto_sem);
@@ -1801,7 +1801,7 @@ int brcmf_os_proto_block(dhd_pub_t *drvr)
int brcmf_os_proto_unblock(dhd_pub_t *drvr)
{
- dhd_info_t *drvr_priv = drvr->info;
+ struct brcmf_info *drvr_priv = drvr->info;
if (drvr_priv) {
up(&drvr_priv->proto_sem);
@@ -1823,7 +1823,7 @@ void brcmf_os_set_ioctl_resp_timeout(unsigned int timeout_msec)
int brcmf_os_ioctl_resp_wait(dhd_pub_t *drvr, uint *condition, bool *pending)
{
- dhd_info_t *drvr_priv = drvr->info;
+ struct brcmf_info *drvr_priv = drvr->info;
DECLARE_WAITQUEUE(wait, current);
int timeout = brcmf_ioctl_timeout_msec;
@@ -1848,7 +1848,7 @@ int brcmf_os_ioctl_resp_wait(dhd_pub_t *drvr, uint *condition, bool *pending)
int brcmf_os_ioctl_resp_wake(dhd_pub_t *drvr)
{
- dhd_info_t *drvr_priv = drvr->info;
+ struct brcmf_info *drvr_priv = drvr->info;
if (waitqueue_active(&drvr_priv->ioctl_resp_wait))
wake_up_interruptible(&drvr_priv->ioctl_resp_wait);
@@ -1856,7 +1856,7 @@ int brcmf_os_ioctl_resp_wake(dhd_pub_t *drvr)
return 0;
}
-static int brcmf_host_event(dhd_info_t *drvr_priv, int *ifidx, void *pktdata,
+static int brcmf_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
brcmf_event_msg_t *event, void **data)
{
int bcmerror = 0;
@@ -1877,7 +1877,7 @@ static int brcmf_host_event(dhd_info_t *drvr_priv, int *ifidx, void *pktdata,
int brcmf_netdev_reset(struct net_device *dev, u8 flag)
{
- dhd_info_t *drvr_priv = *(dhd_info_t **)netdev_priv(dev);
+ struct brcmf_info *drvr_priv = *(struct brcmf_info **)netdev_priv(dev);
brcmf_bus_devreset(&drvr_priv->pub, flag);
@@ -1886,7 +1886,7 @@ int brcmf_netdev_reset(struct net_device *dev, u8 flag)
int brcmf_netdev_set_suspend_disable(struct net_device *dev, int val)
{
- dhd_info_t *drvr_priv = *(dhd_info_t **)netdev_priv(dev);
+ struct brcmf_info *drvr_priv = *(struct brcmf_info **)netdev_priv(dev);
int ret = 0;
if (drvr_priv) {
@@ -1900,7 +1900,7 @@ int brcmf_netdev_set_suspend(struct net_device *dev, int val)
{
int ret = 0;
#if defined(CONFIG_HAS_EARLYSUSPEND)
- dhd_info_t *drvr_priv = *(dhd_info_t **)netdev_priv(dev);
+ struct brcmf_info *drvr_priv = *(struct brcmf_info **)netdev_priv(dev);
if (drvr_priv) {
brcmf_os_proto_block(&drvr_priv->pub);
@@ -1913,7 +1913,7 @@ int brcmf_netdev_set_suspend(struct net_device *dev, int val)
int brcmf_netdev_set_dtim_skip(struct net_device *dev, int val)
{
- dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(dev);
+ struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(dev);
if (drvr_priv)
drvr_priv->pub.dtim_skip = val;
@@ -1923,7 +1923,7 @@ int brcmf_netdev_set_dtim_skip(struct net_device *dev, int val)
int brcmf_netdev_set_packet_filter(struct net_device *dev, int val)
{
- dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(dev);
+ struct brcmf_info *drvr_priv = *(struct brcmf_info **) netdev_priv(dev);
int ret = 0;
/* Packet filtering is set only if we still in early-suspend and
@@ -1944,12 +1944,12 @@ int brcmf_netdev_set_packet_filter(struct net_device *dev, int val)
void brcmf_netdev_init_ioctl(struct net_device *dev)
{
- dhd_info_t *drvr_priv = *(dhd_info_t **)netdev_priv(dev);
+ struct brcmf_info *drvr_priv = *(struct brcmf_info **)netdev_priv(dev);
brcmf_c_preinit_ioctls(&drvr_priv->pub);
}
-static int brcmf_get_pend_8021x_cnt(dhd_info_t *drvr_priv)
+static int brcmf_get_pend_8021x_cnt(struct brcmf_info *drvr_priv)
{
return atomic_read(&drvr_priv->pend_8021x_cnt);
}
@@ -1958,7 +1958,7 @@ static int brcmf_get_pend_8021x_cnt(dhd_info_t *drvr_priv)
int brcmf_netdev_wait_pend8021x(struct net_device *dev)
{
- dhd_info_t *drvr_priv = *(dhd_info_t **)netdev_priv(dev);
+ struct brcmf_info *drvr_priv = *(struct brcmf_info **)netdev_priv(dev);
int timeout = 10 * HZ / 1000;
int ntimes = MAX_WAIT_FOR_8021X_TX;
int pend = brcmf_get_pend_8021x_cnt(drvr_priv);
--
1.7.1
From: Arend van Spriel <[email protected]>
The structure dhd_pub has been renamed to have more consistent naming
in the fullmac driver. This also remove the type definition for this
structure.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 71 ++++++++++++-----------
drivers/staging/brcm80211/brcmfmac/dhd_bus.h | 9 ++-
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 34 ++++++-----
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 26 ++++----
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 41 +++++++------
drivers/staging/brcm80211/brcmfmac/dhd_proto.h | 35 ++++++-----
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 32 ++++++-----
7 files changed, 129 insertions(+), 119 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 196b372..d063afb 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -521,13 +521,13 @@ struct brcmf_ioctl {
uint needed; /* bytes needed (optional) */
};
-/* Forward decls for struct dhd_pub (see below) */
+/* Forward decls for struct brcmf_pub (see below) */
struct dhd_bus; /* device bus info */
struct brcmf_proto; /* device communication protocol info */
struct brcmf_info; /* device driver info */
/* Common structure for module and instance linkage */
-typedef struct dhd_pub {
+struct brcmf_pub {
/* Linkage ponters */
struct dhd_bus *bus;
struct brcmf_proto *prot;
@@ -593,7 +593,7 @@ typedef struct dhd_pub {
u8 country_code[WLC_CNTRY_BUF_SZ];
char eventmask[BRCMF_EVENTING_MASK_LEN];
-} dhd_pub_t;
+};
struct brcmf_if_event {
u8 ifidx;
@@ -708,27 +708,27 @@ extern const bcmevent_name_t bcmevent_names[];
extern const int bcmevent_names_size;
-static inline void MUTEX_LOCK_INIT(dhd_pub_t *dhdp)
+static inline void MUTEX_LOCK_INIT(struct brcmf_pub *dhdp)
{
}
-static inline void MUTEX_LOCK(dhd_pub_t *dhdp)
+static inline void MUTEX_LOCK(struct brcmf_pub *dhdp)
{
}
-static inline void MUTEX_UNLOCK(dhd_pub_t *dhdp)
+static inline void MUTEX_UNLOCK(struct brcmf_pub *dhdp)
{
}
-static inline void MUTEX_LOCK_SOFTAP_SET_INIT(dhd_pub_t *dhdp)
+static inline void MUTEX_LOCK_SOFTAP_SET_INIT(struct brcmf_pub *dhdp)
{
}
-static inline void MUTEX_LOCK_SOFTAP_SET(dhd_pub_t *dhdp)
+static inline void MUTEX_LOCK_SOFTAP_SET(struct brcmf_pub *dhdp)
{
}
-static inline void MUTEX_UNLOCK_SOFTAP_SET(dhd_pub_t *dhdp)
+static inline void MUTEX_UNLOCK_SOFTAP_SET(struct brcmf_pub *dhdp)
{
}
@@ -749,58 +749,58 @@ static inline void MUTEX_UNLOCK_WL_SCAN_SET(void)
*/
/* Indication from bus module regarding presence/insertion of dongle.
- * Return dhd_pub_t pointer, used as handle to OS module in later calls.
+ * Return struct brcmf_pub pointer, used as handle to OS module in later calls.
* Returned structure should have bus and prot pointers filled in.
* bus_hdrlen specifies required headroom for bus module header.
*/
-extern dhd_pub_t *brcmf_attach(struct dhd_bus *bus,
+extern struct brcmf_pub *brcmf_attach(struct dhd_bus *bus,
uint bus_hdrlen);
-extern int brcmf_net_attach(dhd_pub_t *dhdp, int idx);
+extern int brcmf_net_attach(struct brcmf_pub *dhdp, int idx);
extern int brcmf_netdev_wait_pend8021x(struct net_device *dev);
/* Indication from bus module regarding removal/absence of dongle */
-extern void brcmf_detach(dhd_pub_t *dhdp);
+extern void brcmf_detach(struct brcmf_pub *dhdp);
/* Indication from bus module to change flow-control state */
-extern void brcmf_txflowcontrol(dhd_pub_t *dhdp, int ifidx, bool on);
+extern void brcmf_txflowcontrol(struct brcmf_pub *dhdp, int ifidx, bool on);
-extern bool brcmf_c_prec_enq(dhd_pub_t *dhdp, struct pktq *q,
+extern bool brcmf_c_prec_enq(struct brcmf_pub *dhdp, struct pktq *q,
struct sk_buff *pkt, int prec);
/* Receive frame for delivery to OS. Callee disposes of rxp. */
-extern void brcmf_rx_frame(dhd_pub_t *dhdp, int ifidx,
+extern void brcmf_rx_frame(struct brcmf_pub *dhdp, int ifidx,
struct sk_buff *rxp, int numpkt);
/* Return pointer to interface name */
-extern char *brcmf_ifname(dhd_pub_t *dhdp, int idx);
+extern char *brcmf_ifname(struct brcmf_pub *dhdp, int idx);
/* Request scheduling of the bus dpc */
-extern void brcmf_sched_dpc(dhd_pub_t *dhdp);
+extern void brcmf_sched_dpc(struct brcmf_pub *dhdp);
/* Notify tx completion */
-extern void brcmf_txcomplete(dhd_pub_t *dhdp, struct sk_buff *txp,
+extern void brcmf_txcomplete(struct brcmf_pub *dhdp, struct sk_buff *txp,
bool success);
/* Query ioctl */
-extern int brcmf_proto_cdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd,
- void *buf, uint len);
+extern int brcmf_proto_cdc_query_ioctl(struct brcmf_pub *dhd, int ifidx,
+ uint cmd, void *buf, uint len);
/* OS independent layer functions */
-extern int brcmf_os_proto_block(dhd_pub_t *pub);
-extern int brcmf_os_proto_unblock(dhd_pub_t *pub);
-extern int brcmf_os_ioctl_resp_wait(dhd_pub_t *pub, uint *condition,
+extern int brcmf_os_proto_block(struct brcmf_pub *pub);
+extern int brcmf_os_proto_unblock(struct brcmf_pub *pub);
+extern int brcmf_os_ioctl_resp_wait(struct brcmf_pub *pub, uint *condition,
bool *pending);
-extern int brcmf_os_ioctl_resp_wake(dhd_pub_t *pub);
+extern int brcmf_os_ioctl_resp_wake(struct brcmf_pub *pub);
extern unsigned int brcmf_os_get_ioctl_resp_timeout(void);
extern void brcmf_os_set_ioctl_resp_timeout(unsigned int timeout_msec);
-extern void brcmf_os_sdlock_sndup_rxq(dhd_pub_t *pub);
+extern void brcmf_os_sdlock_sndup_rxq(struct brcmf_pub *pub);
extern void brcmf_customer_gpio_wlan_ctrl(int onoff);
extern int brcmf_custom_get_mac_address(unsigned char *buf);
-extern void brcmf_os_sdunlock_sndup_rxq(dhd_pub_t *pub);
-extern void brcmf_os_sdlock_eventq(dhd_pub_t *pub);
-extern void brcmf_os_sdunlock_eventq(dhd_pub_t *pub);
+extern void brcmf_os_sdunlock_sndup_rxq(struct brcmf_pub *pub);
+extern void brcmf_os_sdlock_eventq(struct brcmf_pub *pub);
+extern void brcmf_os_sdunlock_eventq(struct brcmf_pub *pub);
#ifdef BCMDBG
-extern int brcmf_write_to_file(dhd_pub_t *dhd, u8 *buf, int size);
+extern int brcmf_write_to_file(struct brcmf_pub *dhd, u8 *buf, int size);
#endif /* BCMDBG */
extern void brcmf_timeout_start(struct brcmf_timeout *tmo, uint usec);
@@ -825,13 +825,14 @@ extern void brcmf_vif_sendup(struct brcmf_info *dhd, int ifidx,
unsigned char *cp, int len);
/* Send packet to dongle via data channel */
-extern int brcmf_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pkt);
+extern int brcmf_sendpkt(struct brcmf_pub *dhdp, int ifidx,\
+ struct sk_buff *pkt);
-extern int brcmf_bus_devreset(dhd_pub_t *dhdp, u8 flag);
-extern int brcmf_bus_start(dhd_pub_t *dhdp);
+extern int brcmf_bus_devreset(struct brcmf_pub *dhdp, u8 flag);
+extern int brcmf_bus_start(struct brcmf_pub *dhdp);
-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,
+extern void brcmf_c_pktfilter_offload_set(struct brcmf_pub *dhd, char *arg);
+extern void brcmf_c_pktfilter_offload_enable(struct brcmf_pub *dhd, char *arg,
int enable, int master_mode);
#ifdef BCMDBG
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
index c895b81..95fcef4 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
@@ -40,7 +40,7 @@ extern void dhd_bus_unregister(void);
extern void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex);
/* Initialize bus module: prepare for communication w/dongle */
-extern int brcmf_sdbrcm_bus_init(dhd_pub_t *dhdp, bool enforce_mutex);
+extern int brcmf_sdbrcm_bus_init(struct brcmf_pub *dhdp, bool enforce_mutex);
/* Send a data frame to the dongle. Callee disposes of txp. */
extern int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *txp);
@@ -58,15 +58,16 @@ extern void dhd_bus_isr(bool *InterruptRecognized,
bool *QueueMiniportHandleInterrupt, void *arg);
/* Check for and handle local prot-specific iovar commands */
-extern int brcmf_sdbrcm_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
+extern int brcmf_sdbrcm_bus_iovar_op(struct brcmf_pub *dhdp, const char *name,
void *params, int plen, void *arg, int len,
bool set);
/* Add bus dump output to a buffer */
-extern void brcmf_sdbrcm_bus_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf);
+extern void brcmf_sdbrcm_bus_dump(struct brcmf_pub *dhdp,
+ struct brcmu_strbuf *strbuf);
/* Clear any bus counters */
-extern void dhd_bus_clearcounts(dhd_pub_t *dhdp);
+extern void dhd_bus_clearcounts(struct brcmf_pub *dhdp);
/* return the dongle chipid */
extern uint dhd_bus_chip(struct dhd_bus *bus);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index a336068..15c2904 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -100,7 +100,7 @@ struct brcmf_proto {
unsigned char buf[BRCMF_C_IOCTL_MAXLEN + ROUND_UP_MARGIN];
};
-static int brcmf_proto_cdc_msg(dhd_pub_t *dhd)
+static int brcmf_proto_cdc_msg(struct brcmf_pub *dhd)
{
struct brcmf_proto *prot = dhd->prot;
int len = le32_to_cpu(prot->msg.len) +
@@ -120,7 +120,7 @@ static int brcmf_proto_cdc_msg(dhd_pub_t *dhd)
len);
}
-static int brcmf_proto_cdc_cmplt(dhd_pub_t *dhd, u32 id, u32 len)
+static int brcmf_proto_cdc_cmplt(struct brcmf_pub *dhd, u32 id, u32 len)
{
int ret;
struct brcmf_proto *prot = dhd->prot;
@@ -139,8 +139,8 @@ static int brcmf_proto_cdc_cmplt(dhd_pub_t *dhd, u32 id, u32 len)
}
int
-brcmf_proto_cdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
- uint len)
+brcmf_proto_cdc_query_ioctl(struct brcmf_pub *dhd, int ifidx, uint cmd,
+ void *buf, uint len)
{
struct brcmf_proto *prot = dhd->prot;
struct brcmf_proto_cdc_ioctl *msg = &prot->msg;
@@ -221,7 +221,7 @@ done:
return ret;
}
-int brcmf_proto_cdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd,
+int brcmf_proto_cdc_set_ioctl(struct brcmf_pub *dhd, int ifidx, uint cmd,
void *buf, uint len)
{
struct brcmf_proto *prot = dhd->prot;
@@ -275,8 +275,8 @@ done:
extern int dhd_bus_interface(struct dhd_bus *bus, uint arg, void *arg2);
int
-brcmf_proto_ioctl(dhd_pub_t *dhd, int ifidx, struct brcmf_ioctl *ioc, void *buf,
- int len)
+brcmf_proto_ioctl(struct brcmf_pub *dhd, int ifidx, struct brcmf_ioctl *ioc,
+ void *buf, int len)
{
struct brcmf_proto *prot = dhd->prot;
int ret = -1;
@@ -356,18 +356,19 @@ done:
skb->ip_summed is overloaded */
int
-brcmf_proto_iovar_op(dhd_pub_t *dhdp, const char *name,
+brcmf_proto_iovar_op(struct brcmf_pub *dhdp, const char *name,
void *params, int plen, void *arg, int len, bool set)
{
return -ENOTSUPP;
}
-void brcmf_proto_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf)
+void brcmf_proto_dump(struct brcmf_pub *dhdp, struct brcmu_strbuf *strbuf)
{
brcmu_bprintf(strbuf, "Protocol CDC: reqid %d\n", dhdp->prot->reqid);
}
-void brcmf_proto_hdrpush(dhd_pub_t *dhd, int ifidx, struct sk_buff *pktbuf)
+void brcmf_proto_hdrpush(struct brcmf_pub *dhd, int ifidx,
+ struct sk_buff *pktbuf)
{
struct brcmf_proto_bdc_header *h;
@@ -389,7 +390,8 @@ void brcmf_proto_hdrpush(dhd_pub_t *dhd, int ifidx, struct sk_buff *pktbuf)
BDC_SET_IF_IDX(h, ifidx);
}
-int brcmf_proto_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
+int brcmf_proto_hdrpull(struct brcmf_pub *dhd, int *ifidx,
+ struct sk_buff *pktbuf)
{
struct brcmf_proto_bdc_header *h;
@@ -433,7 +435,7 @@ int brcmf_proto_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
return 0;
}
-int brcmf_proto_attach(dhd_pub_t *dhd)
+int brcmf_proto_attach(struct brcmf_pub *dhd)
{
struct brcmf_proto *cdc;
@@ -461,13 +463,13 @@ fail:
}
/* ~NOTE~ What if another thread is waiting on the semaphore? Holding it? */
-void brcmf_proto_detach(dhd_pub_t *dhd)
+void brcmf_proto_detach(struct brcmf_pub *dhd)
{
kfree(dhd->prot);
dhd->prot = NULL;
}
-void brcmf_proto_dstats(dhd_pub_t *dhd)
+void brcmf_proto_dstats(struct brcmf_pub *dhd)
{
/* No stats from dongle added yet, copy bus stats */
dhd->dstats.tx_packets = dhd->tx_packets;
@@ -479,7 +481,7 @@ void brcmf_proto_dstats(dhd_pub_t *dhd)
return;
}
-int brcmf_proto_init(dhd_pub_t *dhd)
+int brcmf_proto_init(struct brcmf_pub *dhd)
{
int ret = 0;
char buf[128];
@@ -508,7 +510,7 @@ int brcmf_proto_init(dhd_pub_t *dhd)
return ret;
}
-void brcmf_proto_stop(dhd_pub_t *dhd)
+void brcmf_proto_stop(struct brcmf_pub *dhd)
{
/* Nothing to do for CDC */
}
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 5c3a5cf..fc361d1 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -111,7 +111,7 @@ void brcmf_c_init(void)
brcmf_msg_level = BRCMF_ERROR_VAL;
}
-static int brcmf_c_dump(dhd_pub_t *drvr, char *buf, int buflen)
+static int brcmf_c_dump(struct brcmf_pub *drvr, char *buf, int buflen)
{
struct brcmu_strbuf b;
struct brcmu_strbuf *strbuf = &b;
@@ -169,9 +169,9 @@ static int brcmf_c_dump(dhd_pub_t *drvr, char *buf, int buflen)
}
static int
-brcmf_c_doiovar(dhd_pub_t *drvr, const struct brcmu_iovar *vi, u32 actionid,
- const char *name, void *params, int plen, void *arg, int len,
- int val_size)
+brcmf_c_doiovar(struct brcmf_pub *drvr, const struct brcmu_iovar *vi,
+ u32 actionid, const char *name, void *params, int plen,
+ void *arg, int len, int val_size)
{
int bcmerror = 0;
s32 int_val = 0;
@@ -252,8 +252,8 @@ exit:
return bcmerror;
}
-bool brcmf_c_prec_enq(dhd_pub_t *drvr, struct pktq *q, struct sk_buff *pkt,
- int prec)
+bool brcmf_c_prec_enq(struct brcmf_pub *drvr, struct pktq *q,
+ struct sk_buff *pkt, int prec)
{
struct sk_buff *p;
int eprec = -1; /* precedence to evict from */
@@ -307,7 +307,7 @@ bool brcmf_c_prec_enq(dhd_pub_t *drvr, struct pktq *q, struct sk_buff *pkt,
}
static int
-brcmf_c_iovar_op(dhd_pub_t *drvr, const char *name,
+brcmf_c_iovar_op(struct brcmf_pub *drvr, const char *name,
void *params, int plen, void *arg, int len, bool set)
{
int bcmerror = 0;
@@ -360,7 +360,7 @@ exit:
return bcmerror;
}
-int brcmf_c_ioctl(dhd_pub_t *drvr, struct brcmf_c_ioctl *ioc, void *buf,
+int brcmf_c_ioctl(struct brcmf_pub *drvr, struct brcmf_c_ioctl *ioc, void *buf,
uint buflen)
{
int bcmerror = 0;
@@ -877,7 +877,7 @@ static int brcmf_c_pattern_atoh(char *src, char *dst)
}
void
-brcmf_c_pktfilter_offload_enable(dhd_pub_t *drvr, char *arg, int enable,
+brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg, int enable,
int master_mode)
{
char *argv[8];
@@ -948,7 +948,7 @@ fail:
kfree(arg_org);
}
-void brcmf_c_pktfilter_offload_set(dhd_pub_t *drvr, char *arg)
+void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg)
{
const char *str;
struct brcmf_pkt_filter pkt_filter;
@@ -1084,7 +1084,7 @@ fail:
kfree(buf);
}
-void brcmf_c_arp_offload_set(dhd_pub_t *drvr, int arp_mode)
+void brcmf_c_arp_offload_set(struct brcmf_pub *drvr, int arp_mode)
{
char iovbuf[32];
int retcode;
@@ -1101,7 +1101,7 @@ void brcmf_c_arp_offload_set(dhd_pub_t *drvr, int arp_mode)
__func__, arp_mode));
}
-void brcmf_c_arp_offload_enable(dhd_pub_t *drvr, int arp_enable)
+void brcmf_c_arp_offload_enable(struct brcmf_pub *drvr, int arp_enable)
{
char iovbuf[32];
int retcode;
@@ -1118,7 +1118,7 @@ void brcmf_c_arp_offload_enable(dhd_pub_t *drvr, int arp_enable)
__func__, arp_enable));
}
-int brcmf_c_preinit_ioctls(dhd_pub_t *drvr)
+int brcmf_c_preinit_ioctls(struct brcmf_pub *drvr)
{
char iovbuf[BRCMF_EVENTING_MASK_LEN + 12]; /* Room for
"event_msgs" + '\0' + bitvec */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 86a6adb..29ed98a 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -76,7 +76,7 @@ struct brcmf_if {
/* Local private structure (extension of pub) */
struct brcmf_info {
- dhd_pub_t pub;
+ struct brcmf_pub pub;
/* OS/stack specifics */
struct brcmf_if *iflist[BRCMF_MAX_IFS];
@@ -187,7 +187,7 @@ static int brcmf_toe_set(struct brcmf_info *drvr_priv, int idx, u32 toe_ol);
static int brcmf_host_event(struct brcmf_info *drvr_priv, int *ifidx, void *pktdata,
brcmf_event_msg_t *event_ptr, void **data_ptr);
-static void brcmf_set_packet_filter(int value, dhd_pub_t *drvr)
+static void brcmf_set_packet_filter(int value, struct brcmf_pub *drvr)
{
DHD_TRACE(("%s: %d\n", __func__, value));
/* 1 - Enable packet filter, only allow unicast packet to send up */
@@ -206,7 +206,7 @@ static void brcmf_set_packet_filter(int value, dhd_pub_t *drvr)
}
#if defined(CONFIG_HAS_EARLYSUSPEND)
-static int brcmf_set_suspend(int value, dhd_pub_t *drvr)
+static int brcmf_set_suspend(int value, struct brcmf_pub *drvr)
{
int power_mode = PM_MAX;
/* struct wl_pkt_filter_enable enable_parm; */
@@ -273,7 +273,7 @@ static int brcmf_set_suspend(int value, dhd_pub_t *drvr)
static void brcmf_suspend_resume_helper(struct brcmf_info *drvr_priv, int val)
{
- dhd_pub_t *drvr = &drvr_priv->pub;
+ struct brcmf_pub *drvr = &drvr_priv->pub;
brcmf_os_proto_block(drvr);
/* Set flag when early suspend was called */
@@ -398,7 +398,7 @@ int brcmf_ifname2idx(struct brcmf_info *drvr_priv, char *name)
return i; /* default - the primary interface */
}
-char *brcmf_ifname(dhd_pub_t *drvr, int ifidx)
+char *brcmf_ifname(struct brcmf_pub *drvr, int ifidx)
{
struct brcmf_info *drvr_priv = drvr->info;
@@ -753,7 +753,7 @@ static void brcmf_netdev_set_multicast_list(struct net_device *dev)
up(&drvr_priv->sysioc_sem);
}
-int brcmf_sendpkt(dhd_pub_t *drvr, int ifidx, struct sk_buff *pktbuf)
+int brcmf_sendpkt(struct brcmf_pub *drvr, int ifidx, struct sk_buff *pktbuf)
{
struct brcmf_info *drvr_priv = drvr->info;
@@ -832,7 +832,7 @@ done:
return 0;
}
-void brcmf_txflowcontrol(dhd_pub_t *drvr, int ifidx, bool state)
+void brcmf_txflowcontrol(struct brcmf_pub *drvr, int ifidx, bool state)
{
struct net_device *net;
struct brcmf_info *drvr_priv = drvr->info;
@@ -848,7 +848,7 @@ void brcmf_txflowcontrol(dhd_pub_t *drvr, int ifidx, bool state)
netif_wake_queue(net);
}
-void brcmf_rx_frame(dhd_pub_t *drvr, int ifidx, struct sk_buff *skb,
+void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx, struct sk_buff *skb,
int numpkt)
{
struct brcmf_info *drvr_priv = drvr->info;
@@ -938,7 +938,7 @@ void brcmf_event(struct brcmf_info *drvr_priv, char *evpkt, int evlen, int ifidx
return;
}
-void brcmf_txcomplete(dhd_pub_t *drvr, struct sk_buff *txp, bool success)
+void brcmf_txcomplete(struct brcmf_pub *drvr, struct sk_buff *txp, bool success)
{
uint ifidx;
struct brcmf_info *drvr_priv = drvr->info;
@@ -1426,7 +1426,7 @@ void brcmf_del_if(struct brcmf_info *drvr_priv, int ifidx)
up(&drvr_priv->sysioc_sem);
}
-dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
+struct brcmf_pub *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
{
struct brcmf_info *drvr_priv = NULL;
struct net_device *net;
@@ -1535,7 +1535,7 @@ fail:
return NULL;
}
-int brcmf_bus_start(dhd_pub_t *drvr)
+int brcmf_bus_start(struct brcmf_pub *drvr)
{
int ret = -1;
struct brcmf_info *drvr_priv = drvr->info;
@@ -1599,7 +1599,7 @@ int brcmf_bus_start(dhd_pub_t *drvr)
return 0;
}
-int brcmf_iovar(dhd_pub_t *drvr, int ifidx, char *name, char *cmd_buf,
+int brcmf_iovar(struct brcmf_pub *drvr, int ifidx, char *name, char *cmd_buf,
uint cmd_len, int set)
{
char buf[strlen(name) + 1 + cmd_len];
@@ -1633,7 +1633,7 @@ static struct net_device_ops brcmf_netdev_ops_pri = {
.ndo_set_multicast_list = brcmf_netdev_set_multicast_list
};
-int brcmf_net_attach(dhd_pub_t *drvr, int ifidx)
+int brcmf_net_attach(struct brcmf_pub *drvr, int ifidx)
{
struct brcmf_info *drvr_priv = drvr->info;
struct net_device *net;
@@ -1689,7 +1689,7 @@ fail:
return -EBADE;
}
-static void brcmf_bus_detach(dhd_pub_t *drvr)
+static void brcmf_bus_detach(struct brcmf_pub *drvr)
{
struct brcmf_info *drvr_priv;
@@ -1707,7 +1707,7 @@ static void brcmf_bus_detach(dhd_pub_t *drvr)
}
}
-void brcmf_detach(dhd_pub_t *drvr)
+void brcmf_detach(struct brcmf_pub *drvr)
{
struct brcmf_info *drvr_priv;
@@ -1788,7 +1788,7 @@ module_exit(brcmf_module_cleanup);
/*
* OS specific functions required to implement DHD driver in OS independent way
*/
-int brcmf_os_proto_block(dhd_pub_t *drvr)
+int brcmf_os_proto_block(struct brcmf_pub *drvr)
{
struct brcmf_info *drvr_priv = drvr->info;
@@ -1799,7 +1799,7 @@ int brcmf_os_proto_block(dhd_pub_t *drvr)
return 0;
}
-int brcmf_os_proto_unblock(dhd_pub_t *drvr)
+int brcmf_os_proto_unblock(struct brcmf_pub *drvr)
{
struct brcmf_info *drvr_priv = drvr->info;
@@ -1821,7 +1821,8 @@ void brcmf_os_set_ioctl_resp_timeout(unsigned int timeout_msec)
brcmf_ioctl_timeout_msec = (int)timeout_msec;
}
-int brcmf_os_ioctl_resp_wait(dhd_pub_t *drvr, uint *condition, bool *pending)
+int brcmf_os_ioctl_resp_wait(struct brcmf_pub *drvr, uint *condition,
+ bool *pending)
{
struct brcmf_info *drvr_priv = drvr->info;
DECLARE_WAITQUEUE(wait, current);
@@ -1846,7 +1847,7 @@ int brcmf_os_ioctl_resp_wait(dhd_pub_t *drvr, uint *condition, bool *pending)
return timeout;
}
-int brcmf_os_ioctl_resp_wake(dhd_pub_t *drvr)
+int brcmf_os_ioctl_resp_wake(struct brcmf_pub *drvr)
{
struct brcmf_info *drvr_priv = drvr->info;
@@ -1976,7 +1977,7 @@ int brcmf_netdev_wait_pend8021x(struct net_device *dev)
}
#ifdef BCMDBG
-int brcmf_write_to_file(dhd_pub_t *drvr, u8 *buf, int size)
+int brcmf_write_to_file(struct brcmf_pub *drvr, u8 *buf, int size)
{
int ret = 0;
struct file *fp;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_proto.h b/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
index c78ae94..afec597 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
@@ -30,48 +30,51 @@
*/
/* Linkage, sets prot link and updates hdrlen in pub */
-extern int brcmf_proto_attach(dhd_pub_t *dhdp);
+extern int brcmf_proto_attach(struct brcmf_pub *dhdp);
/* Unlink, frees allocated protocol memory (including dhd_prot) */
-extern void brcmf_proto_detach(dhd_pub_t *dhdp);
+extern void brcmf_proto_detach(struct brcmf_pub *dhdp);
/* Initialize protocol: sync w/dongle state.
* Sets dongle media info (iswl, drv_version, mac address).
*/
-extern int brcmf_proto_init(dhd_pub_t *dhdp);
+extern int brcmf_proto_init(struct brcmf_pub *dhdp);
/* Stop protocol: sync w/dongle state. */
-extern void brcmf_proto_stop(dhd_pub_t *dhdp);
+extern void brcmf_proto_stop(struct brcmf_pub *dhdp);
/* Add any protocol-specific data header.
* Caller must reserve prot_hdrlen prepend space.
*/
-extern void brcmf_proto_hdrpush(dhd_pub_t *, int ifidx, struct sk_buff *txp);
+extern void brcmf_proto_hdrpush(struct brcmf_pub *, int ifidx,
+ struct sk_buff *txp);
/* Remove any protocol-specific data header. */
-extern int brcmf_proto_hdrpull(dhd_pub_t *, int *ifidx, struct sk_buff *rxp);
+extern int brcmf_proto_hdrpull(struct brcmf_pub *, int *ifidx,
+ struct sk_buff *rxp);
/* Use protocol to issue ioctl to dongle */
-extern int brcmf_proto_ioctl(dhd_pub_t *dhd, int ifidx, struct brcmf_ioctl *ioc,
- void *buf, int len);
+extern int brcmf_proto_ioctl(struct brcmf_pub *dhd, int ifidx,
+ struct brcmf_ioctl *ioc, void *buf, int len);
/* Check for and handle local prot-specific iovar commands */
-extern int brcmf_proto_iovar_op(dhd_pub_t *dhdp, const char *name,
- void *params, int plen, void *arg, int len,
- bool set);
+extern int brcmf_proto_iovar_op(struct brcmf_pub *dhdp, const char *name,
+ void *params, int plen, void *arg, int len,
+ bool set);
/* Add prot dump output to a buffer */
-extern void brcmf_proto_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf);
+extern void brcmf_proto_dump(struct brcmf_pub *dhdp,
+ struct brcmu_strbuf *strbuf);
/* Update local copy of dongle statistics */
-extern void brcmf_proto_dstats(dhd_pub_t *dhdp);
+extern void brcmf_proto_dstats(struct brcmf_pub *dhdp);
-extern int brcmf_c_ioctl(dhd_pub_t *dhd_pub, struct brcmf_c_ioctl *ioc,
+extern int brcmf_c_ioctl(struct brcmf_pub *dhd_pub, struct brcmf_c_ioctl *ioc,
void *buf, uint buflen);
-extern int brcmf_c_preinit_ioctls(dhd_pub_t *dhd);
+extern int brcmf_c_preinit_ioctls(struct brcmf_pub *dhd);
-extern int brcmf_proto_cdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd,
+extern int brcmf_proto_cdc_set_ioctl(struct brcmf_pub *dhd, int ifidx, uint cmd,
void *buf, uint len);
#endif /* _dhd_proto_h_ */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index ab96d37..da5a2ff 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -23,6 +23,7 @@
#include <linux/sched.h>
#include <linux/mmc/sdio.h>
#include <linux/mmc/sdio_func.h>
+#include <linux/semaphore.h>
#include <linux/firmware.h>
#include <asm/unaligned.h>
#include <defs.h>
@@ -455,7 +456,7 @@ struct chip_info {
/* Private data for SDIO bus interaction */
typedef struct dhd_bus {
- dhd_pub_t *dhd;
+ struct brcmf_pub *dhd;
struct brcmf_sdio *sdh; /* Handle for BCMSDH calls */
struct chip_info *ci; /* Chip info struct */
@@ -782,8 +783,8 @@ static void brcmf_sdbrcm_sdtest_set(dhd_bus_t *bus, bool start);
#endif
#ifdef BCMDBG
-static int brcmf_sdbrcm_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg,
- uint msglen);
+static int brcmf_sdbrcm_bus_console_in(struct brcmf_pub *drvr,
+ unsigned char *msg, uint msglen);
static int brcmf_sdbrcm_checkdied(dhd_bus_t *bus, u8 *data, uint size);
static int brcmf_sdbrcm_mem_dump(dhd_bus_t *bus);
#endif /* BCMDBG */
@@ -1425,7 +1426,7 @@ static uint brcmf_sdbrcm_sendfromq(dhd_bus_t *bus, uint maxframes)
uint datalen;
u8 tx_prec_map;
- dhd_pub_t *dhd = bus->dhd;
+ struct brcmf_pub *dhd = bus->dhd;
struct sdpcmd_regs *regs = bus->regs;
DHD_TRACE(("%s: Enter\n", __func__));
@@ -1792,7 +1793,7 @@ dhd_dump_pct(struct brcmu_strbuf *strbuf, char *desc, uint num, uint div)
}
}
-void brcmf_sdbrcm_bus_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf)
+void brcmf_sdbrcm_bus_dump(struct brcmf_pub *dhdp, struct brcmu_strbuf *strbuf)
{
dhd_bus_t *bus = dhdp->bus;
@@ -1893,7 +1894,7 @@ void brcmf_sdbrcm_bus_dump(dhd_pub_t *dhdp, struct brcmu_strbuf *strbuf)
bus->sleeping);
}
-void dhd_bus_clearcounts(dhd_pub_t *dhdp)
+void dhd_bus_clearcounts(struct brcmf_pub *dhdp)
{
dhd_bus_t *bus = (dhd_bus_t *) dhdp->bus;
@@ -2802,7 +2803,7 @@ exit:
brcmf_sdbrcm_sdunlock(bus);
if (actionid == IOV_SVAL(IOV_DEVRESET) && bool_val == false)
- brcmf_c_preinit_ioctls((dhd_pub_t *) bus->dhd);
+ brcmf_c_preinit_ioctls((struct brcmf_pub *) bus->dhd);
return bcmerror;
}
@@ -2948,7 +2949,7 @@ fail:
}
int
-brcmf_sdbrcm_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
+brcmf_sdbrcm_bus_iovar_op(struct brcmf_pub *dhdp, const char *name,
void *params, int plen, void *arg, int len, bool set)
{
dhd_bus_t *bus = dhdp->bus;
@@ -3127,7 +3128,7 @@ void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
#endif /* defined(OOB_INTR_ONLY) */
}
-int brcmf_sdbrcm_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
+int brcmf_sdbrcm_bus_init(struct brcmf_pub *dhdp, bool enforce_mutex)
{
dhd_bus_t *bus = dhdp->bus;
struct brcmf_timeout tmo;
@@ -5059,7 +5060,7 @@ brcmf_sdbrcm_checkdied(dhd_bus_t *bus, struct sk_buff *pkt, uint seq)
}
#endif /* SDTEST */
-extern bool brcmf_sdbrcm_bus_watchdog(dhd_pub_t *dhdp)
+extern bool brcmf_sdbrcm_bus_watchdog(struct brcmf_pub *dhdp)
{
dhd_bus_t *bus;
@@ -5157,10 +5158,10 @@ extern bool brcmf_sdbrcm_bus_watchdog(dhd_pub_t *dhdp)
}
#ifdef BCMDBG
-static int brcmf_sdbrcm_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg,
- uint msglen)
+static int brcmf_sdbrcm_bus_console_in(struct brcmf_pub *drvr,
+ unsigned char *msg, uint msglen)
{
- dhd_bus_t *bus = dhdp->bus;
+ dhd_bus_t *bus = drvr->bus;
u32 addr, val;
int rv;
struct sk_buff *pkt;
@@ -5973,7 +5974,7 @@ uint dhd_bus_hdrlen(struct dhd_bus *bus)
return SDPCM_HDRLEN;
}
-int brcmf_bus_devreset(dhd_pub_t *dhdp, u8 flag)
+int brcmf_bus_devreset(struct brcmf_pub *dhdp, u8 flag)
{
int bcmerror = 0;
dhd_bus_t *bus;
@@ -6017,7 +6018,8 @@ int brcmf_bus_devreset(dhd_pub_t *dhdp, u8 flag)
if (brcmf_sdbrcm_probe_init(bus, bus->sdh)) {
/* Re-init bus, enable F2 transfer */
brcmf_sdbrcm_bus_init(
- (dhd_pub_t *) bus->dhd, false);
+ (struct brcmf_pub *) bus->dhd,
+ false);
bus->dhd->dongle_reset = false;
bus->dhd->up = true;
--
1.7.1
Debug console functionality is provided by dhd_sdio.c. So the related
variables and iovars should go there as well.
Signed-off-by: Franky Lin <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 5 ---
drivers/staging/brcm80211/brcmfmac/dhd_bus.h | 6 ----
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 27 --------------------
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 6 ----
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 31 ++++++++++++++++++++++-
5 files changed, 30 insertions(+), 45 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 2c67df0..e7746f7 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -773,11 +773,6 @@ extern atomic_t brcmf_mmc_suspend;
* Insmod parameters for debug/test
*/
-#if defined(BCMDBG)
-/* Console output poll interval */
-extern uint brcmf_console_ms;
-#endif /* defined(BCMDBG) */
-
/* Use interrupts */
extern uint brcmf_intr;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
index 5bbe09d..eab5cdd 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
@@ -58,12 +58,6 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
extern int
brcmf_sdbrcm_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
-#ifdef BCMDBG
-/* Device console input function */
-extern int
-brcmf_sdbrcm_bus_console_in(dhd_pub_t *dhd, unsigned char *msg, uint msglen);
-#endif /* BCMDBG */
-
/* Deferred processing for the bus, return true requests reschedule */
extern bool dhd_bus_dpc(struct dhd_bus *bus);
extern void dhd_bus_isr(bool *InterruptRecognized,
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 38a3502..8a32e88 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -53,10 +53,6 @@ enum {
IOV_BCMERRORSTR,
IOV_BCMERROR,
IOV_DUMP,
-#ifdef BCMDBG
- IOV_CONS,
- IOV_DCONSOLE_POLL,
-#endif
IOV_CLEARCOUNTS,
IOV_LOGDUMP,
IOV_LOGCAL,
@@ -79,12 +75,6 @@ const struct brcmu_iovar brcmf_iovars[] = {
,
{"dump", IOV_DUMP, 0, IOVT_BUFFER, DHD_IOCTL_MAXLEN}
,
-#ifdef BCMDBG
- {"dconpoll", IOV_DCONSOLE_POLL, 0, IOVT_UINT32, 0}
- ,
- {"cons", IOV_CONS, 0, IOVT_BUFFER, 0}
- ,
-#endif
{"clearcounts", IOV_CLEARCOUNTS, 0, IOVT_VOID, 0}
,
{"gpioob", IOV_GPIOOB, 0, IOVT_UINT32, 0}
@@ -238,23 +228,6 @@ brcmf_c_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
bcmerror = brcmf_c_dump(dhd_pub, arg, len);
break;
-#ifdef BCMDBG
- case IOV_GVAL(IOV_DCONSOLE_POLL):
- int_val = (s32) brcmf_console_ms;
- memcpy(arg, &int_val, val_size);
- break;
-
- case IOV_SVAL(IOV_DCONSOLE_POLL):
- brcmf_console_ms = (uint) int_val;
- break;
-
- case IOV_SVAL(IOV_CONS):
- if (len > 0)
- bcmerror = brcmf_sdbrcm_bus_console_in(dhd_pub, arg,
- len - 1);
- break;
-#endif
-
case IOV_SVAL(IOV_CLEARCOUNTS):
dhd_pub->tx_packets = dhd_pub->rx_packets = 0;
dhd_pub->tx_errors = dhd_pub->rx_errors = 0;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index abd829d..8491b4e 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -124,12 +124,6 @@ module_param(brcmf_msg_level, int, 0);
uint brcmf_sysioc = true;
module_param(brcmf_sysioc, uint, 0);
-#ifdef BCMDBG
-/* Console poll interval */
-uint brcmf_console_ms;
-module_param(brcmf_console_ms, uint, 0);
-#endif /* BCMDBG */
-
/* ARP offload agent mode : Enable ARP Host Auto-Reply
and ARP Peer Auto-Reply */
uint brcmf_arp_mode = 0xb;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index aeef2dc..b79e5cd 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -659,6 +659,12 @@ module_param(brcmf_watchdog_prio, int, 0);
uint brcmf_watchdog_ms = 10;
module_param(brcmf_watchdog_ms, uint, 0);
+#ifdef BCMDBG
+/* Console poll interval */
+uint brcmf_console_ms;
+module_param(brcmf_console_ms, uint, 0);
+#endif /* DHD_DEBUG */
+
/* Tx/Rx bounds */
uint brcmf_txbound;
uint brcmf_rxbound;
@@ -757,6 +763,8 @@ static void brcmf_sdbrcm_sdtest_set(dhd_bus_t *bus, bool start);
#endif
#ifdef BCMDBG
+static int brcmf_sdbrcm_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg,
+ uint msglen);
static int brcmf_sdbrcm_checkdied(dhd_bus_t *bus, u8 *data, uint size);
static int brcmf_sdbrcm_mem_dump(dhd_bus_t *bus);
#endif /* BCMDBG */
@@ -1665,6 +1673,8 @@ enum {
IOV_MEMSIZE,
#ifdef BCMDBG
IOV_CHECKDIED,
+ IOV_CONS,
+ IOV_DCONSOLE_POLL,
#endif
IOV_DOWNLOAD,
IOV_FORCEEVEN,
@@ -1710,6 +1720,10 @@ const struct brcmu_iovar dhdsdio_iovars[] = {
{"devreset", IOV_DEVRESET, 0, IOVT_BOOL, 0},
{"wdtick", IOV_WDTICK, 0, IOVT_UINT32, 0},
#ifdef BCMDBG
+ {"cons", IOV_CONS, 0, IOVT_BUFFER, 0}
+ ,
+ {"dconpoll", IOV_DCONSOLE_POLL, 0, IOVT_UINT32, 0}
+ ,
{"sdreg", IOV_SDREG, 0, IOVT_BUFFER, sizeof(struct brcmf_sdreg)}
,
{"sbreg", IOV_SBREG, 0, IOVT_BUFFER, sizeof(struct brcmf_sdreg)}
@@ -2559,6 +2573,21 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
#endif /* BCMDBG */
#ifdef BCMDBG
+ case IOV_GVAL(IOV_DCONSOLE_POLL):
+ int_val = (s32) brcmf_console_ms;
+ memcpy(arg, &int_val, val_size);
+ break;
+
+ case IOV_SVAL(IOV_DCONSOLE_POLL):
+ brcmf_console_ms = (uint) int_val;
+ break;
+
+ case IOV_SVAL(IOV_CONS):
+ if (len > 0)
+ bcmerror = brcmf_sdbrcm_bus_console_in(bus->dhd,
+ arg, len - 1);
+ break;
+
case IOV_GVAL(IOV_SDREG):
{
struct brcmf_sdreg *sd_ptr;
@@ -5100,7 +5129,7 @@ extern bool brcmf_sdbrcm_bus_watchdog(dhd_pub_t *dhdp)
}
#ifdef BCMDBG
-extern int brcmf_sdbrcm_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg,
+static int brcmf_sdbrcm_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg,
uint msglen)
{
dhd_bus_t *bus = dhdp->bus;
--
1.7.1
From: Roland Vossen <[email protected]>
Code cleanup. Function declarations were moved to .h files.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c | 6 ------
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 9 +++------
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h | 10 +++++-----
.../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c | 8 --------
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 1 -
drivers/staging/brcm80211/brcmfmac/sdio_host.h | 9 +++++++++
6 files changed, 17 insertions(+), 26 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
index ce8323c..1198ee6 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
@@ -31,8 +31,6 @@
#include <brcmu_wifi.h>
#include "sdio_host.h"
-extern void brcmf_sdbrcm_isr(void *args);
-
#include "dngl_stats.h"
#include "dhd.h"
#include "dhd_bus.h"
@@ -195,8 +193,6 @@ int brcmf_sdio_remove(struct device *dev)
return 0;
}
-extern int brcmf_sdio_function_init(void);
-
int brcmf_sdio_register(struct brcmf_sdioh_driver *driver)
{
drvinfo = *driver;
@@ -205,8 +201,6 @@ int brcmf_sdio_register(struct brcmf_sdioh_driver *driver)
return brcmf_sdio_function_init();
}
-extern void brcmf_sdio_function_cleanup(void);
-
void brcmf_sdio_unregister(void)
{
brcmf_sdio_function_cleanup();
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 0413a59..b7726f2 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -33,13 +33,9 @@
#include "dhd.h"
#include "bcmsdh_sdmmc.h"
-extern int brcmf_sdio_function_init(void);
-extern void brcmf_sdio_function_cleanup(void);
-
static void brcmf_sdioh_irqhandler(struct sdio_func *func);
static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func);
static int brcmf_sdioh_get_cisaddr(struct sdioh_info *sd, u32 regaddr);
-extern int brcmf_sdioh_reset_comm(struct mmc_card *card);
uint sd_f2_blocksize = 512; /* Default blocksize */
@@ -51,8 +47,9 @@ BRCMF_PM_RESUME_WAIT_INIT(sdioh_request_buffer_wait);
#define DMA_ALIGN_MASK 0x03
-int brcmf_sdioh_card_regread(struct sdioh_info *sd, int func, u32 regaddr,
- int regsize, u32 *data);
+static int
+brcmf_sdioh_card_regread(struct sdioh_info *sd, int func, u32 regaddr,
+ int regsize, u32 *data);
static int brcmf_sdioh_enablefuncs(struct sdioh_info *sd)
{
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
index 9c5eee0..a0f985c 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h
@@ -61,10 +61,6 @@
#define sd_ctrl(x)
#endif
-/* Allocate/init/free per-OS private data */
-extern int brcmf_sdioh_osinit(struct sdioh_info *sd);
-extern void brcmf_sdioh_osfree(struct sdioh_info *sd);
-
#define BLOCK_SIZE_64 64
#define BLOCK_SIZE_512 512
#define BLOCK_SIZE_4318 64
@@ -108,6 +104,10 @@ struct sdioh_info {
/* Global message bits */
extern uint sd_msglevel;
+/* Allocate/init/free per-OS private data */
+extern int brcmf_sdioh_osinit(struct sdioh_info *sd);
+extern void brcmf_sdioh_osfree(struct sdioh_info *sd);
+
/* OS-independent interrupt handler */
extern bool brcmf_sdioh_check_client_intr(struct sdioh_info *sd);
@@ -124,7 +124,7 @@ extern u32 *brcmf_sdioh_reg_map(s32 addr, int size);
extern void brcmf_sdioh_reg_unmap(s32 addr, int size);
/* Interrupt (de)registration routines */
-extern int brcmf_sdioh_register_irq(struct sdioh_info *sd, uint irq);
+extern int brcmf_sdioh_register_irq(struct sdioh_info *sd, uint irq);
extern void brcmf_sdioh_free_irq(uint irq, struct sdioh_info *sd);
typedef struct _BCMSDH_SDMMC_INSTANCE {
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
index f10cddd..e5c3b25 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
@@ -56,12 +56,6 @@
#include "dhd_dbg.h"
#include "wl_cfg80211.h"
-extern void brcmf_sdioh_dev_intr_off(struct sdioh_info *sd);
-extern void brcmf_sdioh_dev_intr_on(struct sdioh_info *sd);
-
-int brcmf_sdio_function_init(void);
-void brcmf_sdio_function_cleanup(void);
-
/* module param defaults */
static int clockoverride;
@@ -73,8 +67,6 @@ PBCMSDH_SDMMC_INSTANCE gInstance;
/* Maximum number of bcmsdh_sdmmc devices supported by driver */
#define BCMSDH_SDMMC_MAX_DEVICES 1
-extern int brcmf_sdio_probe(struct device *dev);
-extern int brcmf_sdio_remove(struct device *dev);
struct device sdmmc_dev;
static int brcmf_ops_sdio_probe(struct sdio_func *func,
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index 15c2904..e28b727 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -273,7 +273,6 @@ done:
return ret;
}
-extern int dhd_bus_interface(struct dhd_bus *bus, uint arg, void *arg2);
int
brcmf_proto_ioctl(struct brcmf_pub *dhd, int ifidx, struct brcmf_ioctl *ioc,
void *buf, int len)
diff --git a/drivers/staging/brcm80211/brcmfmac/sdio_host.h b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
index 6938abc..85e3d6a 100644
--- a/drivers/staging/brcm80211/brcmfmac/sdio_host.h
+++ b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
@@ -209,11 +209,20 @@ struct brcmf_sdioh_driver {
void (*detach) (void *ch);
};
+struct sdioh_info;
+
/* platform specific/high level functions */
+extern int brcmf_sdio_function_init(void);
extern int brcmf_sdio_register(struct brcmf_sdioh_driver *driver);
extern void brcmf_sdio_unregister(void);
extern bool brcmf_sdio_chipmatch(u16 vendor, u16 device);
extern void brcmf_sdio_device_remove(void *sdh);
+extern void brcmf_sdio_function_cleanup(void);
+
+extern void brcmf_sdioh_dev_intr_off(struct sdioh_info *sd);
+extern void brcmf_sdioh_dev_intr_on(struct sdioh_info *sd);
+extern int brcmf_sdio_probe(struct device *dev);
+extern int brcmf_sdio_remove(struct device *dev);
/* Function to pass device-status bits to DHD. */
extern u32 brcmf_sdcard_get_dstatus(void *sdh);
--
1.7.1
From: Henry Ptasinski <[email protected]>
Debug printk() call was missing KERN_DEBUG facility level.
Signed-off-by: Henry Ptasinski <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/phy/phy_n.c | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
index 57fff0f..c79c047 100644
--- a/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
+++ b/drivers/staging/brcm80211/brcmsmac/phy/phy_n.c
@@ -24564,7 +24564,8 @@ static void wlc_phy_calc_rx_iq_comp_nphy(phy_info_t *pi, u8 core_mask)
}
if (bcmerror != 0) {
- printk("%s: Failed, cnt = %d\n", __func__, cal_retry);
+ printk(KERN_DEBUG "%s: Failed, cnt = %d\n", __func__,
+ cal_retry);
if (cal_retry < CAL_RETRY_CNT) {
cal_retry++;
--
1.7.1
From: Roland Vossen <[email protected]>
Code cleanup.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h | 2 +-
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 70 ++++++++++----------
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c | 4 +-
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 30 +++++-----
drivers/staging/brcm80211/brcmfmac/sdio_host.h | 10 ++--
5 files changed, 58 insertions(+), 58 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
index ffe258a..5d09076 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdbus.h
@@ -111,6 +111,6 @@ extern int brcmf_sdioh_stop(struct sdioh_info *si);
extern int brcmf_sdioh_reset(struct sdioh_info *si);
/* Helper function */
-void *brcmf_sdcard_get_sdioh(bcmsdh_info_t *sdh);
+void *brcmf_sdcard_get_sdioh(struct brcmf_sdio *sdh);
#endif /* _sdio_api_h_ */
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
index f41bb1e..0ebca53 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
@@ -33,7 +33,7 @@
#define SDIOH_API_ACCESS_RETRY_LIMIT 2
const uint bcmsdh_msglevel = BCMSDH_ERROR_VAL;
-struct bcmsdh_info {
+struct brcmf_sdio {
bool init_success; /* underlying driver successfully attached */
void *sdioh; /* handler for sdioh */
u32 vendevid; /* Target Vendor and Device ID on SD bus */
@@ -42,22 +42,22 @@ struct bcmsdh_info {
u32 sbwad; /* Save backplane window address */
};
/* local copy of bcm sd handler */
-bcmsdh_info_t *l_bcmsdh;
+struct brcmf_sdio *l_bcmsdh;
#if defined(OOB_INTR_ONLY) && defined(HW_OOB)
extern int brcmf_sdioh_enable_hw_oob_intr(void *sdioh, bool enable);
-void brcmf_sdcard_enable_hw_oob_intr(bcmsdh_info_t *sdh, bool enable)
+void brcmf_sdcard_enable_hw_oob_intr(struct brcmf_sdio *sdh, bool enable)
{
brcmf_sdioh_enable_hw_oob_intr(sdh->sdioh, enable);
}
#endif
-bcmsdh_info_t *brcmf_sdcard_attach(void *cfghdl, void **regsva, uint irq)
+struct brcmf_sdio *brcmf_sdcard_attach(void *cfghdl, void **regsva, uint irq)
{
- bcmsdh_info_t *bcmsdh;
+ struct brcmf_sdio *bcmsdh;
- bcmsdh = kzalloc(sizeof(bcmsdh_info_t), GFP_ATOMIC);
+ bcmsdh = kzalloc(sizeof(struct brcmf_sdio), GFP_ATOMIC);
if (bcmsdh == NULL) {
BCMSDH_ERROR(("bcmsdh_attach: out of memory"));
return NULL;
@@ -83,7 +83,7 @@ bcmsdh_info_t *brcmf_sdcard_attach(void *cfghdl, void **regsva, uint irq)
int brcmf_sdcard_detach(void *sdh)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
if (bcmsdh != NULL) {
if (bcmsdh->sdioh) {
@@ -101,14 +101,14 @@ int
brcmf_sdcard_iovar_op(void *sdh, const char *name,
void *params, int plen, void *arg, int len, bool set)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
return brcmf_sdioh_iovar_op(bcmsdh->sdioh, name, params, plen, arg,
len, set);
}
bool brcmf_sdcard_intr_query(void *sdh)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
bool on;
@@ -122,7 +122,7 @@ bool brcmf_sdcard_intr_query(void *sdh)
int brcmf_sdcard_intr_enable(void *sdh)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
ASSERT(bcmsdh);
@@ -132,7 +132,7 @@ int brcmf_sdcard_intr_enable(void *sdh)
int brcmf_sdcard_intr_disable(void *sdh)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
ASSERT(bcmsdh);
@@ -142,7 +142,7 @@ int brcmf_sdcard_intr_disable(void *sdh)
int brcmf_sdcard_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
ASSERT(bcmsdh);
@@ -152,7 +152,7 @@ int brcmf_sdcard_intr_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
int brcmf_sdcard_intr_dereg(void *sdh)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
ASSERT(bcmsdh);
@@ -163,7 +163,7 @@ int brcmf_sdcard_intr_dereg(void *sdh)
#if defined(DHD_DEBUG)
bool brcmf_sdcard_intr_pending(void *sdh)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
ASSERT(sdh);
return brcmf_sdioh_interrupt_pending(bcmsdh->sdioh);
@@ -180,7 +180,7 @@ int brcmf_sdcard_devremove_reg(void *sdh, bcmsdh_cb_fn_t fn, void *argh)
u8 brcmf_sdcard_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
s32 retry = 0;
@@ -216,7 +216,7 @@ u8 brcmf_sdcard_cfg_read(void *sdh, uint fnc_num, u32 addr, int *err)
void
brcmf_sdcard_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
#ifdef SDIOH_API_ACCESS_RETRY_LIMIT
s32 retry = 0;
@@ -248,7 +248,7 @@ brcmf_sdcard_cfg_write(void *sdh, uint fnc_num, u32 addr, u8 data, int *err)
u32 brcmf_sdcard_cfg_read_word(void *sdh, uint fnc_num, u32 addr, int *err)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
u32 data = 0;
@@ -273,7 +273,7 @@ void
brcmf_sdcard_cfg_write_word(void *sdh, uint fnc_num, u32 addr, u32 data,
int *err)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
if (!bcmsdh)
@@ -294,7 +294,7 @@ brcmf_sdcard_cfg_write_word(void *sdh, uint fnc_num, u32 addr, u32 data,
int brcmf_sdcard_cis_read(void *sdh, uint func, u8 * cis, uint length)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
u8 *tmp_buf, *tmp_ptr;
@@ -335,7 +335,7 @@ int brcmf_sdcard_cis_read(void *sdh, uint func, u8 * cis, uint length)
static int brcmf_sdcard_set_sbaddr_window(void *sdh, u32 address)
{
int err = 0;
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
brcmf_sdcard_cfg_write(bcmsdh, SDIO_FUNC_1, SBSDIO_FUNC1_SBADDRLOW,
(address >> 8) & SBSDIO_SBADDRLOW_MASK, &err);
if (!err)
@@ -354,7 +354,7 @@ static int brcmf_sdcard_set_sbaddr_window(void *sdh, u32 address)
u32 brcmf_sdcard_reg_read(void *sdh, u32 addr, uint size)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
u32 word = 0;
uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
@@ -407,7 +407,7 @@ u32 brcmf_sdcard_reg_read(void *sdh, u32 addr, uint size)
u32 brcmf_sdcard_reg_write(void *sdh, u32 addr, uint size, u32 data)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
uint bar0 = addr & ~SBSDIO_SB_OFT_ADDR_MASK;
int err = 0;
@@ -446,11 +446,11 @@ u32 brcmf_sdcard_reg_write(void *sdh, u32 addr, uint size, u32 data)
bool brcmf_sdcard_regfail(void *sdh)
{
- return ((bcmsdh_info_t *) sdh)->regfail;
+ return ((struct brcmf_sdio *) sdh)->regfail;
}
int
-brcmf_sdcard_recv_buf(bcmsdh_info_t *bcmsdh, u32 addr, uint fn, uint flags,
+brcmf_sdcard_recv_buf(struct brcmf_sdio *bcmsdh, u32 addr, uint fn, uint flags,
u8 *buf, uint nbytes, struct sk_buff *pkt,
bcmsdh_cmplt_fn_t complete, void *handle)
{
@@ -497,7 +497,7 @@ brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags,
u8 *buf, uint nbytes, void *pkt,
bcmsdh_cmplt_fn_t complete, void *handle)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
uint incr_fix;
uint width;
@@ -538,7 +538,7 @@ brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags,
int brcmf_sdcard_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
SDIOH_API_RC status;
ASSERT(bcmsdh);
@@ -557,35 +557,35 @@ int brcmf_sdcard_rwdata(void *sdh, uint rw, u32 addr, u8 *buf, uint nbytes)
int brcmf_sdcard_abort(void *sdh, uint fn)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
return brcmf_sdioh_abort(bcmsdh->sdioh, fn);
}
int brcmf_sdcard_start(void *sdh, int stage)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
return brcmf_sdioh_start(bcmsdh->sdioh, stage);
}
int brcmf_sdcard_stop(void *sdh)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
return brcmf_sdioh_stop(bcmsdh->sdioh);
}
int brcmf_sdcard_query_device(void *sdh)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
bcmsdh->vendevid = (PCI_VENDOR_ID_BROADCOM << 16) | 0;
return bcmsdh->vendevid;
}
uint brcmf_sdcard_query_iofnum(void *sdh)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
if (!bcmsdh)
bcmsdh = l_bcmsdh;
@@ -593,14 +593,14 @@ uint brcmf_sdcard_query_iofnum(void *sdh)
return brcmf_sdioh_query_iofnum(bcmsdh->sdioh);
}
-int brcmf_sdcard_reset(bcmsdh_info_t *sdh)
+int brcmf_sdcard_reset(struct brcmf_sdio *sdh)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
return brcmf_sdioh_reset(bcmsdh->sdioh);
}
-void *brcmf_sdcard_get_sdioh(bcmsdh_info_t *sdh)
+void *brcmf_sdcard_get_sdioh(struct brcmf_sdio *sdh)
{
ASSERT(sdh);
return sdh->sdioh;
@@ -614,7 +614,7 @@ u32 brcmf_sdcard_get_dstatus(void *sdh)
u32 brcmf_sdcard_cur_sbwad(void *sdh)
{
- bcmsdh_info_t *bcmsdh = (bcmsdh_info_t *) sdh;
+ struct brcmf_sdio *bcmsdh = (struct brcmf_sdio *) sdh;
if (!bcmsdh)
bcmsdh = l_bcmsdh;
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
index 3fabc08..66d81d1 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
@@ -59,7 +59,7 @@ struct bcmsdh_hc {
struct pci_dev *dev; /* pci device handle */
#endif /* BCMPLATFORM_BUS */
void *regs; /* SDIO Host Controller address */
- bcmsdh_info_t *sdh; /* SDIO Host Controller handle */
+ struct brcmf_sdio *sdh; /* SDIO Host Controller handle */
void *ch;
unsigned int oob_irq;
unsigned long oob_flags; /* OOB Host specifiction
@@ -144,7 +144,7 @@ int brcmf_sdio_probe(struct device *dev)
{
bcmsdh_hc_t *sdhc = NULL;
unsigned long regs = 0;
- bcmsdh_info_t *sdh = NULL;
+ struct brcmf_sdio *sdh = NULL;
#if !defined(BCMLXSDMMC) && defined(BCMPLATFORM_BUS)
struct platform_device *pdev;
struct resource *r;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 003f485..2ede425 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -460,7 +460,7 @@ struct chip_info {
typedef struct dhd_bus {
dhd_pub_t *dhd;
- bcmsdh_info_t *sdh; /* Handle for BCMSDH calls */
+ struct brcmf_sdio *sdh; /* Handle for BCMSDH calls */
struct chip_info *ci; /* Chip info struct */
char *vars; /* Variables (from CIS and/or other) */
uint varsz; /* Size of variables buffer */
@@ -786,9 +786,9 @@ static int _brcmf_sdbrcm_download_firmware(struct dhd_bus *bus);
static int
brcmf_sdbrcm_download_code_file(struct dhd_bus *bus, char *image_path);
static int brcmf_sdbrcm_download_nvram(struct dhd_bus *bus);
-static void brcmf_sdbrcm_chip_disablecore(bcmsdh_info_t *sdh, u32 corebase);
+static void brcmf_sdbrcm_chip_disablecore(struct brcmf_sdio *sdh, u32 corebase);
static int brcmf_sdbrcm_chip_attach(struct dhd_bus *bus, void *regs);
-static void brcmf_sdbrcm_chip_resetcore(bcmsdh_info_t *sdh, u32 corebase);
+static void brcmf_sdbrcm_chip_resetcore(struct brcmf_sdio *sdh, u32 corebase);
static void brcmf_sdbrcm_sdiod_drive_strength_init(struct dhd_bus *bus,
u32 drivestrength);
static void brcmf_sdbrcm_chip_detach(struct dhd_bus *bus);
@@ -835,7 +835,7 @@ static int brcmf_sdbrcm_htclk(dhd_bus_t *bus, bool on, bool pendok)
{
int err;
u8 clkctl, clkreq, devctl;
- bcmsdh_info_t *sdh;
+ struct brcmf_sdio *sdh;
DHD_TRACE(("%s: Enter\n", __func__));
@@ -1044,7 +1044,7 @@ static int brcmf_sdbrcm_clkctl(dhd_bus_t *bus, uint target, bool pendok)
int brcmf_sdbrcm_bussleep(dhd_bus_t *bus, bool sleep)
{
- bcmsdh_info_t *sdh = bus->sdh;
+ struct brcmf_sdio *sdh = bus->sdh;
struct sdpcmd_regs *regs = bus->regs;
uint retries = 0;
@@ -1177,7 +1177,7 @@ static int brcmf_sdbrcm_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
u16 len, pad = 0;
u32 swheader;
uint retries = 0;
- bcmsdh_info_t *sdh;
+ struct brcmf_sdio *sdh;
struct sk_buff *new;
int i;
@@ -1496,7 +1496,7 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
u16 len;
u32 swheader;
uint retries = 0;
- bcmsdh_info_t *sdh = bus->sdh;
+ struct brcmf_sdio *sdh = bus->sdh;
u8 doff = 0;
int ret = -1;
int i;
@@ -3199,7 +3199,7 @@ exit:
static void brcmf_sdbrcm_rxfail(dhd_bus_t *bus, bool abort, bool rtx)
{
- bcmsdh_info_t *sdh = bus->sdh;
+ struct brcmf_sdio *sdh = bus->sdh;
struct sdpcmd_regs *regs = bus->regs;
uint retries = 0;
u16 lastrbc;
@@ -3263,7 +3263,7 @@ static void brcmf_sdbrcm_rxfail(dhd_bus_t *bus, bool abort, bool rtx)
static void
brcmf_sdbrcm_read_control(dhd_bus_t *bus, u8 *hdr, uint len, uint doff)
{
- bcmsdh_info_t *sdh = bus->sdh;
+ struct brcmf_sdio *sdh = bus->sdh;
uint rdlen, pad;
int sdret;
@@ -3771,7 +3771,7 @@ static u8 brcmf_sdbrcm_rxglom(dhd_bus_t *bus, u8 rxseq)
static uint
brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
{
- bcmsdh_info_t *sdh = bus->sdh;
+ struct brcmf_sdio *sdh = bus->sdh;
u16 len, check; /* Extracted hardware header fields */
u8 chan, seq, doff; /* Extracted software header fields */
@@ -4439,7 +4439,7 @@ static u32 brcmf_sdbrcm_hostmail(dhd_bus_t *bus)
bool brcmf_sdbrcm_dpc(dhd_bus_t *bus)
{
- bcmsdh_info_t *sdh = bus->sdh;
+ struct brcmf_sdio *sdh = bus->sdh;
struct sdpcmd_regs *regs = bus->regs;
u32 intstatus, newstatus = 0;
uint retries = 0;
@@ -4706,7 +4706,7 @@ bool dhd_bus_dpc(struct dhd_bus *bus)
void brcmf_sdbrcm_isr(void *arg)
{
dhd_bus_t *bus = (dhd_bus_t *) arg;
- bcmsdh_info_t *sdh;
+ struct brcmf_sdio *sdh;
DHD_TRACE(("%s: Enter\n", __func__));
@@ -6000,7 +6000,7 @@ int brcmf_bus_devreset(dhd_pub_t *dhdp, u8 flag)
}
static int
-brcmf_sdbrcm_chip_recognition(bcmsdh_info_t *sdh, struct chip_info *ci,
+brcmf_sdbrcm_chip_recognition(struct brcmf_sdio *sdh, struct chip_info *ci,
void *regs)
{
u32 regdata;
@@ -6059,7 +6059,7 @@ brcmf_sdbrcm_chip_recognition(bcmsdh_info_t *sdh, struct chip_info *ci,
}
static void
-brcmf_sdbrcm_chip_disablecore(bcmsdh_info_t *sdh, u32 corebase)
+brcmf_sdbrcm_chip_disablecore(struct brcmf_sdio *sdh, u32 corebase)
{
u32 regdata;
@@ -6235,7 +6235,7 @@ fail:
}
static void
-brcmf_sdbrcm_chip_resetcore(bcmsdh_info_t *sdh, u32 corebase)
+brcmf_sdbrcm_chip_resetcore(struct brcmf_sdio *sdh, u32 corebase)
{
u32 regdata;
diff --git a/drivers/staging/brcm80211/brcmfmac/sdio_host.h b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
index 4063508..c7d60ca 100644
--- a/drivers/staging/brcm80211/brcmfmac/sdio_host.h
+++ b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
@@ -60,7 +60,7 @@ extern const uint bcmsdh_msglevel;
#define SDIOD_MAX_IOFUNCS 7
/* forward declarations */
-typedef struct bcmsdh_info bcmsdh_info_t;
+struct brcmf_sdio;
typedef void (*bcmsdh_cb_fn_t) (void *);
/* Attach and build an interface to the underlying SD host driver.
@@ -70,7 +70,7 @@ typedef void (*bcmsdh_cb_fn_t) (void *);
* implementation may maintain a single "default" handle (e.g. the first or
* most recent one) to enable single-instance implementations to pass NULL.
*/
-extern bcmsdh_info_t *brcmf_sdcard_attach(void *cfghdl, void **regsva,
+extern struct brcmf_sdio *brcmf_sdcard_attach(void *cfghdl, void **regsva,
uint irq);
/* Detach - freeup resources allocated in attach */
@@ -151,7 +151,7 @@ typedef void (*bcmsdh_cmplt_fn_t) (void *handle, int status, bool sync_waiting);
extern int brcmf_sdcard_send_buf(void *sdh, u32 addr, uint fn, uint flags,
u8 *buf, uint nbytes, void *pkt,
bcmsdh_cmplt_fn_t complete, void *handle);
-extern int brcmf_sdcard_recv_buf(bcmsdh_info_t *sdh, u32 addr, uint fn,
+extern int brcmf_sdcard_recv_buf(struct brcmf_sdio *sdh, u32 addr, uint fn,
uint flags, u8 *buf, uint nbytes, struct sk_buff *pkt,
bcmsdh_cmplt_fn_t complete, void *handle);
@@ -194,11 +194,11 @@ extern int brcmf_sdcard_iovar_op(void *sdh, const char *name,
bool set);
/* Reset and reinitialize the device */
-extern int brcmf_sdcard_reset(bcmsdh_info_t *sdh);
+extern int brcmf_sdcard_reset(struct brcmf_sdio *sdh);
/* helper functions */
-extern void *brcmf_sdcard_get_sdioh(bcmsdh_info_t *sdh);
+extern void *brcmf_sdcard_get_sdioh(struct brcmf_sdio *sdh);
/* callback functions */
typedef struct {
--
1.7.1
From: Arend van Spriel <[email protected]>
The code conditional by TOE macro is always needed so TOE macro
usage has been removed from the fullmac sources.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/Makefile | 3 +--
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 14 --------------
2 files changed, 1 insertions(+), 16 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/Makefile b/drivers/staging/brcm80211/brcmfmac/Makefile
index c97e5bb..7441649 100644
--- a/drivers/staging/brcm80211/brcmfmac/Makefile
+++ b/drivers/staging/brcm80211/brcmfmac/Makefile
@@ -21,8 +21,7 @@ ccflags-y := \
-DBRCMF_FIRSTREAD=64 \
-DBRCMF_SDALIGN=64 \
-DMAX_HDR_READ=64 \
- -DSHOW_EVENTS \
- -DTOE
+ -DSHOW_EVENTS
ccflags-$(CONFIG_BRCMDBG) += -DDHD_DEBUG
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 8a2c73d..0764d02 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -364,12 +364,8 @@ module_param(brcmf_pktgen_len, uint, 0);
#endif
static void brcmf_dpc(unsigned long data);
-
-#ifdef TOE
static int brcmf_toe_get(dhd_info_t *dhd, int idx, u32 *toe_ol);
static int brcmf_toe_set(dhd_info_t *dhd, int idx, u32 toe_ol);
-#endif /* TOE */
-
static int brcmf_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
brcmf_event_msg_t *event_ptr, void **data_ptr);
@@ -1315,7 +1311,6 @@ void brcmf_sched_dpc(dhd_pub_t *dhdp)
tasklet_schedule(&dhd->tasklet);
}
-#ifdef TOE
/* Retrieve current toe component enables, which are kept
as a bitmap in toe_ol iovar */
static int brcmf_toe_get(dhd_info_t *dhd, int ifidx, u32 *toe_ol)
@@ -1393,7 +1388,6 @@ static int brcmf_toe_set(dhd_info_t *dhd, int ifidx, u32 toe_ol)
return 0;
}
-#endif /* TOE */
static void brcmf_ethtool_get_drvinfo(struct net_device *net,
struct ethtool_drvinfo *info)
@@ -1415,11 +1409,9 @@ static int brcmf_ethtool(dhd_info_t *dhd, void *uaddr)
struct ethtool_drvinfo info;
char drvname[sizeof(info.driver)];
u32 cmd;
-#ifdef TOE
struct ethtool_value edata;
u32 toe_cmpnt, csum_dir;
int ret;
-#endif
DHD_TRACE(("%s: Enter\n", __func__));
@@ -1464,7 +1456,6 @@ static int brcmf_ethtool(dhd_info_t *dhd, void *uaddr)
(int)sizeof(drvname), drvname, info.driver));
break;
-#ifdef TOE
/* Get toe offload components from dongle */
case ETHTOOL_GRXCSUM:
case ETHTOOL_GTXCSUM:
@@ -1516,7 +1507,6 @@ static int brcmf_ethtool(dhd_info_t *dhd, void *uaddr)
}
break;
-#endif /* TOE */
default:
return -EOPNOTSUPP;
@@ -1665,9 +1655,7 @@ static int brcmf_netdev_stop(struct net_device *net)
static int brcmf_netdev_open(struct net_device *net)
{
dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
-#ifdef TOE
u32 toe_ol;
-#endif
int ifidx = brcmf_net2idx(dhd, net);
s32 ret = 0;
@@ -1685,14 +1673,12 @@ static int brcmf_netdev_open(struct net_device *net)
memcpy(net->dev_addr, dhd->pub.mac, ETH_ALEN);
-#ifdef TOE
/* Get current TOE mode from dongle */
if (brcmf_toe_get(dhd, ifidx, &toe_ol) >= 0
&& (toe_ol & TOE_TX_CSUM_OL) != 0)
dhd->iflist[ifidx]->net->features |= NETIF_F_IP_CSUM;
else
dhd->iflist[ifidx]->net->features &= ~NETIF_F_IP_CSUM;
-#endif
}
/* Allow transmit calls */
netif_start_queue(net);
--
1.7.1
From: Arend van Spriel <[email protected]>
The conditional code depending on BCMLXSDMMC macro definition is
always compiled into the fullmac driver.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/Makefile | 1 -
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c | 39 +-------------------
.../staging/brcm80211/brcmfmac/dhd_custom_gpio.c | 2 -
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 9 +----
4 files changed, 2 insertions(+), 49 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/Makefile b/drivers/staging/brcm80211/brcmfmac/Makefile
index 95d3147..f76e62a 100644
--- a/drivers/staging/brcm80211/brcmfmac/Makefile
+++ b/drivers/staging/brcm80211/brcmfmac/Makefile
@@ -16,7 +16,6 @@
# CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
ccflags-y := \
- -DBCMLXSDMMC \
-DBCMPLATFORM_BUS \
-DBCMSDIO \
-DBRCM_FULLMAC \
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
index a2408ec..5243f33 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
@@ -121,7 +121,6 @@ bool brcmf_sdio_chipmatch(u16 vendor, u16 device)
}
#if defined(BCMPLATFORM_BUS)
-#if defined(BCMLXSDMMC)
/* forward declarations */
int brcmf_sdio_probe(struct device *dev);
EXPORT_SYMBOL(brcmf_sdio_probe);
@@ -129,36 +128,15 @@ EXPORT_SYMBOL(brcmf_sdio_probe);
int brcmf_sdio_remove(struct device *dev);
EXPORT_SYMBOL(brcmf_sdio_remove);
-#else
-/* forward declarations */
-static int __devinit brcmf_sdio_probe(struct device *dev);
-static int __devexit brcmf_sdio_remove(struct device *dev);
-#endif /* BCMLXSDMMC */
-
-#ifndef BCMLXSDMMC
-static
-#endif /* BCMLXSDMMC */
int brcmf_sdio_probe(struct device *dev)
{
struct bcmsdh_hc *sdhc = NULL;
unsigned long regs = 0;
struct brcmf_sdio *sdh = NULL;
-#if !defined(BCMLXSDMMC) && defined(BCMPLATFORM_BUS)
- struct platform_device *pdev;
- struct resource *r;
-#endif /* BCMLXSDMMC */
int irq = 0;
u32 vendevid;
unsigned long irq_flags = 0;
-#if !defined(BCMLXSDMMC) && defined(BCMPLATFORM_BUS)
- pdev = to_platform_device(dev);
- r = platform_get_resource(pdev, IORESOURCE_MEM, 0);
- irq = platform_get_irq(pdev, 0);
- if (!r || irq == NO_IRQ)
- return -ENXIO;
-#endif /* BCMLXSDMMC */
-
#if defined(OOB_INTR_ONLY)
#ifdef HW_OOB
irq_flags =
@@ -181,19 +159,12 @@ int brcmf_sdio_probe(struct device *dev)
}
sdhc->dev = (void *)dev;
-#ifdef BCMLXSDMMC
sdh = brcmf_sdcard_attach((void *)0, (void **)®s, irq);
if (!sdh) {
SDLX_MSG(("%s: bcmsdh_attach failed\n", __func__));
goto err;
}
-#else
- sdh = brcmf_sdcard_attach((void *)r->start, (void **)®s, irq);
- if (!sdh) {
- SDLX_MSG(("%s: bcmsdh_attach failed\n", __func__));
- goto err;
- }
-#endif /* BCMLXSDMMC */
+
sdhc->sdh = sdh;
sdhc->oob_irq = irq;
sdhc->oob_flags = irq_flags;
@@ -229,9 +200,6 @@ err:
return -ENODEV;
}
-#ifndef BCMLXSDMMC
-static
-#endif /* BCMLXSDMMC */
int brcmf_sdio_remove(struct device *dev)
{
struct bcmsdh_hc *sdhc, *prev;
@@ -258,11 +226,6 @@ int brcmf_sdio_remove(struct device *dev)
/* release SDIO Host Controller info */
kfree(sdhc);
-
-#if !defined(BCMLXSDMMC)
- dev_set_drvdata(dev, NULL);
-#endif /* !defined(BCMLXSDMMC) */
-
return 0;
}
#endif /* BCMPLATFORM_BUS */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c b/drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c
index a60caea..6fd1072 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c
@@ -38,9 +38,7 @@ int wifi_get_irq_number(unsigned long *irq_flags_ptr);
#if defined(OOB_INTR_ONLY)
-#if defined(BCMLXSDMMC)
extern int sdioh_mmc_irq(int irq);
-#endif /* (BCMLXSDMMC) */
#ifdef CUSTOMER_HW3
#include <mach/gpio.h>
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 2b1762e..afb840a 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -923,14 +923,7 @@ static int brcmf_sdbrcm_htclk(dhd_bus_t *bus, bool on, bool pendok)
DHD_INFO(("CLKCTL: turned ON\n"));
#if defined(DHD_DEBUG)
- if (bus->alp_only == true) {
-#if !defined(BCMLXSDMMC)
- if (!SBSDIO_ALPONLY(clkctl)) {
- DHD_ERROR(("%s: HT Clock, when ALP Only\n",
- __func__));
- }
-#endif /* !defined(BCMLXSDMMC) */
- } else {
+ if (bus->alp_only != true) {
if (SBSDIO_ALPONLY(clkctl)) {
DHD_ERROR(("%s: HT Clock should be on.\n",
__func__));
--
1.7.1
From: Arend van Spriel <[email protected]>
The brcmfmac driver contained functions for wireless extensions
support. However, brcmfmac is intended to be a cfg80211 driver
so all the entire source file is obsolete.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/Makefile | 1 -
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 29 -
drivers/staging/brcm80211/brcmfmac/wl_iw.c | 3660 ------------------------
drivers/staging/brcm80211/brcmfmac/wl_iw.h | 138 -
4 files changed, 0 insertions(+), 3828 deletions(-)
delete mode 100644 drivers/staging/brcm80211/brcmfmac/wl_iw.c
delete mode 100644 drivers/staging/brcm80211/brcmfmac/wl_iw.h
diff --git a/drivers/staging/brcm80211/brcmfmac/Makefile b/drivers/staging/brcm80211/brcmfmac/Makefile
index c5ec562..d907cae 100644
--- a/drivers/staging/brcm80211/brcmfmac/Makefile
+++ b/drivers/staging/brcm80211/brcmfmac/Makefile
@@ -40,7 +40,6 @@ ccflags-y += \
DHDOFILES = \
wl_cfg80211.o \
- wl_iw.o \
dhd_cdc.o \
dhd_common.o \
dhd_custom_gpio.o \
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index c556191..48859cd 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -183,12 +183,6 @@ MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN fullmac driver.");
MODULE_SUPPORTED_DEVICE("Broadcom 802.11n WLAN fullmac cards");
MODULE_LICENSE("Dual BSD/GPL");
-/* Linux wireless extension support */
-#if defined(CONFIG_WIRELESS_EXT)
-#include <wl_iw.h>
-extern wl_iw_extra_params_t g_wl_iw_params;
-#endif /* defined(CONFIG_WIRELESS_EXT) */
-
#if defined(CONFIG_HAS_EARLYSUSPEND)
#include <linux/earlysuspend.h>
extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
@@ -218,10 +212,6 @@ typedef struct dhd_if {
/* Local private structure (extension of pub) */
typedef struct dhd_info {
-#if defined(CONFIG_WIRELESS_EXT)
- wl_iw_t iw; /* wireless extensions state (must be first) */
-#endif /* defined(CONFIG_WIRELESS_EXT) */
-
dhd_pub_t pub;
/* OS/stack specifics */
@@ -1602,14 +1592,6 @@ static int dhd_ioctl_entry(struct net_device *net, struct ifreq *ifr, int cmd)
if (ifidx == DHD_BAD_IF)
return -1;
-#if defined(CONFIG_WIRELESS_EXT)
- /* linux wireless extensions */
- if ((cmd >= SIOCIWFIRST) && (cmd <= SIOCIWLAST)) {
- /* may recurse, do NOT lock */
- return wl_iw_ioctl(net, ifr, cmd);
- }
-#endif /* defined(CONFIG_WIRELESS_EXT) */
-
if (cmd == SIOCETHTOOL)
return dhd_ethtool(dhd, (void *)ifr->ifr_data);
@@ -1896,13 +1878,6 @@ dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen)
DHD_ERROR(("dhd_prot_attach failed\n"));
goto fail;
}
-#if defined(CONFIG_WIRELESS_EXT)
- /* Attach and link in the iw */
- if (wl_iw_attach(net, (void *)&dhd->pub) != 0) {
- DHD_ERROR(("wl_iw_attach failed\n"));
- goto fail;
- }
-#endif /* defined(CONFIG_WIRELESS_EXT) */
/* Attach and link in the cfg80211 */
if (unlikely(wl_cfg80211_attach(net, &dhd->pub))) {
@@ -2262,10 +2237,6 @@ void dhd_detach(dhd_pub_t *dhdp)
if (dhdp->prot)
dhd_prot_detach(dhdp);
-#if defined(CONFIG_WIRELESS_EXT)
- wl_iw_detach();
-#endif /* (CONFIG_WIRELESS_EXT) */
-
wl_cfg80211_detach();
/* && defined(DHD_GPL) */
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_iw.c b/drivers/staging/brcm80211/brcmfmac/wl_iw.c
deleted file mode 100644
index ef407ec..0000000
--- a/drivers/staging/brcm80211/brcmfmac/wl_iw.c
+++ /dev/null
@@ -1,3660 +0,0 @@
-/*
- * Copyright (c) 2010 Broadcom Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-#include <linux/kthread.h>
-#include <linux/semaphore.h>
-#include <linux/ieee80211.h>
-#include <linux/netdevice.h>
-#include <linux/etherdevice.h>
-#include <linux/wireless.h>
-#include <linux/if_arp.h>
-#include <linux/uaccess.h>
-
-#include <brcmu_utils.h>
-#include <brcmu_wifi.h>
-#include <defs.h>
-#include "dngl_stats.h"
-#include "dhd.h"
-
-#define WPA_OUI "\x00\x50\xF2"
-#define DOT11_MNG_RSN_ID 48
-#define DOT11_MNG_WPA_ID 221
-
-#define WL_ERROR(fmt, args...) printk(fmt, ##args)
-#define WL_TRACE(fmt, args...) no_printk(fmt, ##args)
-#define WL_INFORM(fmt, args...) no_printk(fmt, ##args)
-#define WL_WSEC(fmt, args...) no_printk(fmt, ##args)
-#define WL_SCAN(fmt, args...) no_printk(fmt, ##args)
-
-#include <wl_iw.h>
-
-#define IW_WSEC_ENABLED(wsec) ((wsec) & (WEP_ENABLED | \
- TKIP_ENABLED | AES_ENABLED))
-
-#include <linux/rtnetlink.h>
-
-#define WL_IW_USE_ISCAN 1
-#define ENABLE_ACTIVE_PASSIVE_SCAN_SUPPRESS 1
-
-bool g_set_essid_before_scan = true;
-
-#define WL_IW_IOCTL_CALL(func_call) \
- do { \
- func_call; \
- } while (0)
-
-static int g_onoff = G_WLAN_SET_ON;
-wl_iw_extra_params_t g_wl_iw_params;
-
-extern bool wl_iw_conn_status_str(u32 event_type, u32 status,
- u32 reason, char *stringBuf, uint buflen);
-
-#define MAX_WLIW_IOCTL_LEN 1024
-
-#ifdef CONFIG_WIRELESS_EXT
-extern int dhd_wait_pend8021x(struct net_device *dev);
-#endif
-
-#if WIRELESS_EXT < 19
-#define IW_IOCTL_IDX(cmd) ((cmd) - SIOCIWFIRST)
-#define IW_EVENT_IDX(cmd) ((cmd) - IWEVFIRST)
-#endif
-
-static void *g_scan;
-static volatile uint g_scan_specified_ssid;
-static wlc_ssid_t g_specific_ssid;
-
-static wlc_ssid_t g_ssid;
-
-#if defined(WL_IW_USE_ISCAN)
-#define ISCAN_STATE_IDLE 0
-#define ISCAN_STATE_SCANING 1
-
-#define WLC_IW_ISCAN_MAXLEN 2048
-typedef struct iscan_buf {
- struct iscan_buf *next;
- char iscan_buf[WLC_IW_ISCAN_MAXLEN];
-} iscan_buf_t;
-
-typedef struct iscan_info {
- struct net_device *dev;
- struct timer_list timer;
- u32 timer_ms;
- u32 timer_on;
- int iscan_state;
- iscan_buf_t *list_hdr;
- iscan_buf_t *list_cur;
-
- struct task_struct *sysioc_tsk;
- struct semaphore sysioc_sem;
-
-#if defined CSCAN
- char ioctlbuf[WLC_IOCTL_MEDLEN];
-#else
- char ioctlbuf[WLC_IOCTL_SMLEN];
-#endif
- wl_iscan_params_t *iscan_ex_params_p;
- int iscan_ex_param_size;
-} iscan_info_t;
-iscan_info_t *g_iscan;
-
-typedef enum sup_auth_status {
- WLC_SUP_DISCONNECTED = 0,
- WLC_SUP_CONNECTING,
- WLC_SUP_IDREQUIRED,
- WLC_SUP_AUTHENTICATING,
- WLC_SUP_AUTHENTICATED,
- WLC_SUP_KEYXCHANGE,
- WLC_SUP_KEYED,
- WLC_SUP_TIMEOUT,
- WLC_SUP_LAST_BASIC_STATE,
- WLC_SUP_KEYXCHANGE_WAIT_M1 = WLC_SUP_AUTHENTICATED,
- WLC_SUP_KEYXCHANGE_PREP_M2 = WLC_SUP_KEYXCHANGE,
- WLC_SUP_KEYXCHANGE_WAIT_M3 = WLC_SUP_LAST_BASIC_STATE,
- WLC_SUP_KEYXCHANGE_PREP_M4,
- WLC_SUP_KEYXCHANGE_WAIT_G1,
- WLC_SUP_KEYXCHANGE_PREP_G2
-} sup_auth_status_t;
-
-static const u8 ether_bcast[ETH_ALEN] = {255, 255, 255, 255, 255, 255};
-
-static void wl_iw_timerfunc(unsigned long data);
-static void wl_iw_set_event_mask(struct net_device *dev);
-static int wl_iw_iscan(iscan_info_t *iscan, wlc_ssid_t *ssid, u16 action);
-#endif /* defined(WL_IW_USE_ISCAN) */
-
-static int
-wl_iw_set_scan(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra);
-
-static int
-wl_iw_get_scan(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *dwrq, char *extra);
-
-static uint
-wl_iw_get_scan_prep(wl_scan_results_t *list,
- struct iw_request_info *info, char *extra, short max_size);
-
-static void swap_key_from_BE(wl_wsec_key_t *key)
-{
- key->index = cpu_to_le32(key->index);
- key->len = cpu_to_le32(key->len);
- key->algo = cpu_to_le32(key->algo);
- key->flags = cpu_to_le32(key->flags);
- key->rxiv.hi = cpu_to_le32(key->rxiv.hi);
- key->rxiv.lo = cpu_to_le16(key->rxiv.lo);
- key->iv_initialized = cpu_to_le32(key->iv_initialized);
-}
-
-static void swap_key_to_BE(wl_wsec_key_t *key)
-{
- key->index = le32_to_cpu(key->index);
- key->len = le32_to_cpu(key->len);
- key->algo = le32_to_cpu(key->algo);
- key->flags = le32_to_cpu(key->flags);
- key->rxiv.hi = le32_to_cpu(key->rxiv.hi);
- key->rxiv.lo = le16_to_cpu(key->rxiv.lo);
- key->iv_initialized = le32_to_cpu(key->iv_initialized);
-}
-
-static int dev_wlc_ioctl(struct net_device *dev, int cmd, void *arg, int len)
-{
- struct ifreq ifr;
- wl_ioctl_t ioc;
- mm_segment_t fs;
- int ret = -EINVAL;
-
- if (!dev) {
- WL_ERROR("%s: dev is null\n", __func__);
- return ret;
- }
-
- WL_INFORM("\n%s, PID:%x: send Local IOCTL -> dhd: cmd:0x%x, buf:%p, len:%d\n",
- __func__, current->pid, cmd, arg, len);
-
- if (g_onoff == G_WLAN_SET_ON) {
- memset(&ioc, 0, sizeof(ioc));
- ioc.cmd = cmd;
- ioc.buf = arg;
- ioc.len = len;
-
- strcpy(ifr.ifr_name, dev->name);
- ifr.ifr_data = (caddr_t)&ioc;
-
- ret = dev_open(dev);
- if (ret) {
- WL_ERROR("%s: Error dev_open: %d\n", __func__, ret);
- return ret;
- }
-
- fs = get_fs();
- set_fs(get_ds());
- ret = dev->netdev_ops->ndo_do_ioctl(dev, &ifr, SIOCDEVPRIVATE);
- set_fs(fs);
- } else {
- WL_TRACE("%s: call after driver stop : ignored\n", __func__);
- }
- return ret;
-}
-
-static int dev_wlc_intvar_set(struct net_device *dev, char *name, int val)
-{
- char buf[WLC_IOCTL_SMLEN];
- uint len;
-
- val = cpu_to_le32(val);
- len = brcmu_mkiovar(name, (char *)(&val), sizeof(val), buf,
- sizeof(buf));
- ASSERT(len);
-
- return dev_wlc_ioctl(dev, WLC_SET_VAR, buf, len);
-}
-
-#if defined(WL_IW_USE_ISCAN)
-static int
-dev_iw_iovar_setbuf(struct net_device *dev,
- char *iovar,
- void *param, int paramlen, void *bufptr, int buflen)
-{
- int iolen;
-
- iolen = brcmu_mkiovar(iovar, param, paramlen, bufptr, buflen);
- ASSERT(iolen);
-
- if (iolen == 0)
- return 0;
-
- return dev_wlc_ioctl(dev, WLC_SET_VAR, bufptr, iolen);
-}
-
-static int
-dev_iw_iovar_getbuf(struct net_device *dev,
- char *iovar,
- void *param, int paramlen, void *bufptr, int buflen)
-{
- int iolen;
-
- iolen = brcmu_mkiovar(iovar, param, paramlen, bufptr, buflen);
- ASSERT(iolen);
-
- return dev_wlc_ioctl(dev, WLC_GET_VAR, bufptr, buflen);
-}
-#endif /* defined(WL_IW_USE_ISCAN) */
-
-#if WIRELESS_EXT > 17
-static int
-dev_wlc_bufvar_set(struct net_device *dev, char *name, char *buf, int len)
-{
- static char ioctlbuf[MAX_WLIW_IOCTL_LEN];
- uint buflen;
-
- buflen = brcmu_mkiovar(name, buf, len, ioctlbuf, sizeof(ioctlbuf));
- ASSERT(buflen);
-
- return dev_wlc_ioctl(dev, WLC_SET_VAR, ioctlbuf, buflen);
-}
-#endif /* WIRELESS_EXT > 17 */
-
-static int
-dev_wlc_bufvar_get(struct net_device *dev, char *name, char *buf, int buflen)
-{
- static char ioctlbuf[MAX_WLIW_IOCTL_LEN];
- int error;
- uint len;
-
- len = brcmu_mkiovar(name, NULL, 0, ioctlbuf, sizeof(ioctlbuf));
- ASSERT(len);
- error =
- dev_wlc_ioctl(dev, WLC_GET_VAR, (void *)ioctlbuf,
- MAX_WLIW_IOCTL_LEN);
- if (!error)
- memcpy(buf, ioctlbuf, buflen);
-
- return error;
-}
-
-static int dev_wlc_intvar_get(struct net_device *dev, char *name, int *retval)
-{
- union {
- char buf[WLC_IOCTL_SMLEN];
- int val;
- } var;
- int error;
-
- uint len;
- uint data_null;
-
- len =
- brcmu_mkiovar(name, (char *)(&data_null), 0, (char *)(&var),
- sizeof(var.buf));
- ASSERT(len);
- error = dev_wlc_ioctl(dev, WLC_GET_VAR, (void *)&var, len);
-
- *retval = le32_to_cpu(var.val);
-
- return error;
-}
-
-#if WIRELESS_EXT < 13
-struct iw_request_info {
- __u16 cmd;
- __u16 flags;
-};
-
-typedef int (*iw_handler) (struct net_device *dev,
- struct iw_request_info *info,
- void *wrqu, char *extra);
-#endif
-
-static int
-wl_iw_config_commit(struct net_device *dev,
- struct iw_request_info *info, void *zwrq, char *extra)
-{
- wlc_ssid_t ssid;
- int error;
- struct sockaddr bssid;
-
- WL_TRACE("%s: SIOCSIWCOMMIT\n", dev->name);
-
- error = dev_wlc_ioctl(dev, WLC_GET_SSID, &ssid, sizeof(ssid));
- if (error)
- return error;
-
- ssid.SSID_len = le32_to_cpu(ssid.SSID_len);
-
- if (!ssid.SSID_len)
- return 0;
-
- memset(&bssid, 0, sizeof(struct sockaddr));
- error = dev_wlc_ioctl(dev, WLC_REASSOC, &bssid, ETH_ALEN);
- if (error) {
- WL_ERROR("%s: WLC_REASSOC to %s failed\n",
- __func__, ssid.SSID);
- return error;
- }
-
- return 0;
-}
-
-static int
-wl_iw_get_name(struct net_device *dev,
- struct iw_request_info *info, char *cwrq, char *extra)
-{
- WL_TRACE("%s: SIOCGIWNAME\n", dev->name);
-
- strcpy(cwrq, "IEEE 802.11-DS");
-
- return 0;
-}
-
-static int
-wl_iw_set_freq(struct net_device *dev,
- struct iw_request_info *info, struct iw_freq *fwrq, char *extra)
-{
- int error, chan;
- uint sf = 0;
-
- WL_TRACE("\n %s %s: SIOCSIWFREQ\n", __func__, dev->name);
-
- if (fwrq->e == 0 && fwrq->m < MAXCHANNEL) {
- chan = fwrq->m;
- } else {
- if (fwrq->e >= 6) {
- fwrq->e -= 6;
- while (fwrq->e--)
- fwrq->m *= 10;
- } else if (fwrq->e < 6) {
- while (fwrq->e++ < 6)
- fwrq->m /= 10;
- }
- if (fwrq->m > 4000 && fwrq->m < 5000)
- sf = WF_CHAN_FACTOR_4_G;
-
- chan = brcmu_mhz2channel(fwrq->m, sf);
- }
- chan = cpu_to_le32(chan);
-
- error = dev_wlc_ioctl(dev, WLC_SET_CHANNEL, &chan, sizeof(chan));
- if (error)
- return error;
-
- g_wl_iw_params.target_channel = chan;
- return -EINPROGRESS;
-}
-
-static int
-wl_iw_get_freq(struct net_device *dev,
- struct iw_request_info *info, struct iw_freq *fwrq, char *extra)
-{
- channel_info_t ci;
- int error;
-
- WL_TRACE("%s: SIOCGIWFREQ\n", dev->name);
-
- error = dev_wlc_ioctl(dev, WLC_GET_CHANNEL, &ci, sizeof(ci));
- if (error)
- return error;
-
- fwrq->m = le32_to_cpu(ci.hw_channel);
- fwrq->e = le32_to_cpu(0);
- return 0;
-}
-
-static int
-wl_iw_set_mode(struct net_device *dev,
- struct iw_request_info *info, __u32 *uwrq, char *extra)
-{
- int infra = 0, ap = 0, error = 0;
-
- WL_TRACE("%s: SIOCSIWMODE\n", dev->name);
-
- switch (*uwrq) {
- case IW_MODE_MASTER:
- infra = ap = 1;
- break;
- case IW_MODE_ADHOC:
- case IW_MODE_AUTO:
- break;
- case IW_MODE_INFRA:
- infra = 1;
- break;
- default:
- return -EINVAL;
- }
- infra = cpu_to_le32(infra);
- ap = cpu_to_le32(ap);
-
- error = dev_wlc_ioctl(dev, WLC_SET_INFRA, &infra, sizeof(infra));
- if (error)
- return error;
-
- error = dev_wlc_ioctl(dev, WLC_SET_AP, &ap, sizeof(ap));
- if (error)
- return error;
-
- return -EINPROGRESS;
-}
-
-static int
-wl_iw_get_mode(struct net_device *dev,
- struct iw_request_info *info, __u32 *uwrq, char *extra)
-{
- int error, infra = 0, ap = 0;
-
- WL_TRACE("%s: SIOCGIWMODE\n", dev->name);
-
- error = dev_wlc_ioctl(dev, WLC_GET_INFRA, &infra, sizeof(infra));
- if (error)
- return error;
-
- error = dev_wlc_ioctl(dev, WLC_GET_AP, &ap, sizeof(ap));
- if (error)
- return error;
-
- infra = le32_to_cpu(infra);
- ap = le32_to_cpu(ap);
- *uwrq = infra ? ap ? IW_MODE_MASTER : IW_MODE_INFRA : IW_MODE_ADHOC;
-
- return 0;
-}
-
-static int
-wl_iw_get_range(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *dwrq, char *extra)
-{
- struct iw_range *range = (struct iw_range *)extra;
- wl_u32_list_t *list;
- wl_rateset_t rateset;
- s8 *channels;
- int error, i, k;
- uint ch;
-
- int phytype;
- int bw_cap = 0, sgi_tx = 0, nmode = 0;
- channel_info_t ci;
- u8 nrate_list2copy = 0;
- u16 nrate_list[4][8] = { {13, 26, 39, 52, 78, 104, 117, 130},
- {14, 29, 43, 58, 87, 116, 130, 144},
- {27, 54, 81, 108, 162, 216, 243, 270},
- {30, 60, 90, 120, 180, 240, 270, 300}
- };
-
- WL_TRACE("%s: SIOCGIWRANGE\n", dev->name);
-
- if (!extra)
- return -EINVAL;
-
- channels = kmalloc((MAXCHANNEL + 1) * 4, GFP_KERNEL);
- if (!channels) {
- WL_ERROR("Could not alloc channels\n");
- return -ENOMEM;
- }
- list = (wl_u32_list_t *) channels;
-
- dwrq->length = sizeof(struct iw_range);
- memset(range, 0, sizeof(*range));
-
- list->count = cpu_to_le32(MAXCHANNEL);
- error = dev_wlc_ioctl(dev, WLC_GET_VALID_CHANNELS, channels,
- (MAXCHANNEL + 1) * 4);
- if (error) {
- kfree(channels);
- return error;
- }
- for (i = 0; i < le32_to_cpu(list->count) && i < IW_MAX_FREQUENCIES;
- i++) {
- range->freq[i].i = le32_to_cpu(list->element[i]);
-
- ch = le32_to_cpu(list->element[i]);
- if (ch <= CH_MAX_2G_CHANNEL) {
- range->freq[i].m = ieee80211_dsss_chan_to_freq(ch);
- } else {
- range->freq[i].m = ieee80211_ofdm_chan_to_freq(
- WF_CHAN_FACTOR_5_G/2, ch);
- }
- range->freq[i].e = 6;
- }
- range->num_frequency = range->num_channels = i;
-
- range->max_qual.qual = 5;
- range->max_qual.level = 0x100 - 200;
- range->max_qual.noise = 0x100 - 200;
- range->sensitivity = 65535;
-
-#if WIRELESS_EXT > 11
- range->avg_qual.qual = 3;
- range->avg_qual.level = 0x100 + WL_IW_RSSI_GOOD;
- range->avg_qual.noise = 0x100 - 75;
-#endif
-
- error = dev_wlc_ioctl(dev, WLC_GET_CURR_RATESET, &rateset,
- sizeof(rateset));
- if (error) {
- kfree(channels);
- return error;
- }
- rateset.count = le32_to_cpu(rateset.count);
- range->num_bitrates = rateset.count;
- for (i = 0; i < rateset.count && i < IW_MAX_BITRATES; i++)
- range->bitrate[i] = (rateset.rates[i] & 0x7f) * 500000;
- dev_wlc_intvar_get(dev, "nmode", &nmode);
- dev_wlc_ioctl(dev, WLC_GET_PHYTYPE, &phytype, sizeof(phytype));
-
- if (nmode == 1 && phytype == WLC_PHY_TYPE_SSN) {
- dev_wlc_intvar_get(dev, "mimo_bw_cap", &bw_cap);
- dev_wlc_intvar_get(dev, "sgi_tx", &sgi_tx);
- dev_wlc_ioctl(dev, WLC_GET_CHANNEL, &ci,
- sizeof(channel_info_t));
- ci.hw_channel = le32_to_cpu(ci.hw_channel);
-
- if (bw_cap == 0 || (bw_cap == 2 && ci.hw_channel <= 14)) {
- if (sgi_tx == 0)
- nrate_list2copy = 0;
- else
- nrate_list2copy = 1;
- }
- if (bw_cap == 1 || (bw_cap == 2 && ci.hw_channel >= 36)) {
- if (sgi_tx == 0)
- nrate_list2copy = 2;
- else
- nrate_list2copy = 3;
- }
- range->num_bitrates += 8;
- for (k = 0; i < range->num_bitrates; k++, i++) {
- range->bitrate[i] =
- (nrate_list[nrate_list2copy][k]) * 500000;
- }
- }
-
- error = dev_wlc_ioctl(dev, WLC_GET_PHYTYPE, &i, sizeof(i));
- if (error) {
- kfree(channels);
- return error;
- }
- i = le32_to_cpu(i);
- if (i == WLC_PHY_TYPE_A)
- range->throughput = 24000000;
- else
- range->throughput = 1500000;
-
- range->min_rts = 0;
- range->max_rts = 2347;
- range->min_frag = 256;
- range->max_frag = 2346;
-
- range->max_encoding_tokens = DOT11_MAX_DEFAULT_KEYS;
- range->num_encoding_sizes = 4;
- range->encoding_size[0] = WLAN_KEY_LEN_WEP40;
- range->encoding_size[1] = WLAN_KEY_LEN_WEP104;
-#if WIRELESS_EXT > 17
- range->encoding_size[2] = WLAN_KEY_LEN_TKIP;
-#else
- range->encoding_size[2] = 0;
-#endif
- range->encoding_size[3] = WLAN_KEY_LEN_AES_CMAC;
-
- range->min_pmp = 0;
- range->max_pmp = 0;
- range->min_pmt = 0;
- range->max_pmt = 0;
- range->pmp_flags = 0;
- range->pm_capa = 0;
-
- range->num_txpower = 2;
- range->txpower[0] = 1;
- range->txpower[1] = 255;
- range->txpower_capa = IW_TXPOW_MWATT;
-
-#if WIRELESS_EXT > 10
- range->we_version_compiled = WIRELESS_EXT;
- range->we_version_source = 19;
-
- range->retry_capa = IW_RETRY_LIMIT;
- range->retry_flags = IW_RETRY_LIMIT;
- range->r_time_flags = 0;
- range->min_retry = 1;
- range->max_retry = 255;
- range->min_r_time = 0;
- range->max_r_time = 0;
-#endif
-
-#if WIRELESS_EXT > 17
- range->enc_capa = IW_ENC_CAPA_WPA;
- range->enc_capa |= IW_ENC_CAPA_CIPHER_TKIP;
- range->enc_capa |= IW_ENC_CAPA_CIPHER_CCMP;
- range->enc_capa |= IW_ENC_CAPA_WPA2;
-
- IW_EVENT_CAPA_SET_KERNEL(range->event_capa);
- IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWAP);
- IW_EVENT_CAPA_SET(range->event_capa, SIOCGIWSCAN);
- IW_EVENT_CAPA_SET(range->event_capa, IWEVTXDROP);
- IW_EVENT_CAPA_SET(range->event_capa, IWEVMICHAELMICFAILURE);
- IW_EVENT_CAPA_SET(range->event_capa, IWEVPMKIDCAND);
-#endif /* WIRELESS_EXT > 17 */
-
- kfree(channels);
-
- return 0;
-}
-
-static int rssi_to_qual(int rssi)
-{
- if (rssi <= WL_IW_RSSI_NO_SIGNAL)
- return 0;
- else if (rssi <= WL_IW_RSSI_VERY_LOW)
- return 1;
- else if (rssi <= WL_IW_RSSI_LOW)
- return 2;
- else if (rssi <= WL_IW_RSSI_GOOD)
- return 3;
- else if (rssi <= WL_IW_RSSI_VERY_GOOD)
- return 4;
- else
- return 5;
-}
-
-static int
-wl_iw_set_spy(struct net_device *dev,
- struct iw_request_info *info, struct iw_point *dwrq, char *extra)
-{
- wl_iw_t *iw = *(wl_iw_t **) netdev_priv(dev);
- struct sockaddr *addr = (struct sockaddr *)extra;
- int i;
-
- WL_TRACE("%s: SIOCSIWSPY\n", dev->name);
-
- if (!extra)
- return -EINVAL;
-
- iw->spy_num = min_t(int, ARRAY_SIZE(iw->spy_addr), dwrq->length);
- for (i = 0; i < iw->spy_num; i++)
- memcpy(iw->spy_addr[i], addr[i].sa_data, ETH_ALEN);
- memset(iw->spy_qual, 0, sizeof(iw->spy_qual));
-
- return 0;
-}
-
-static int
-wl_iw_get_spy(struct net_device *dev,
- struct iw_request_info *info, struct iw_point *dwrq, char *extra)
-{
- wl_iw_t *iw = *(wl_iw_t **) netdev_priv(dev);
- struct sockaddr *addr = (struct sockaddr *)extra;
- struct iw_quality *qual = (struct iw_quality *)&addr[iw->spy_num];
- int i;
-
- WL_TRACE("%s: SIOCGIWSPY\n", dev->name);
-
- if (!extra)
- return -EINVAL;
-
- dwrq->length = iw->spy_num;
- for (i = 0; i < iw->spy_num; i++) {
- memcpy(addr[i].sa_data, iw->spy_addr[i], ETH_ALEN);
- addr[i].sa_family = AF_UNIX;
- memcpy(&qual[i], &iw->spy_qual[i], sizeof(struct iw_quality));
- iw->spy_qual[i].updated = 0;
- }
-
- return 0;
-}
-
-static int
-wl_iw_ch_to_chanspec(int ch, wl_join_params_t *join_params,
- int *join_params_size)
-{
- chanspec_t chanspec = 0;
-
- if (ch != 0) {
- join_params->params.chanspec_num = 1;
- join_params->params.chanspec_list[0] = ch;
-
- if (join_params->params.chanspec_list[0])
- chanspec |= WL_CHANSPEC_BAND_2G;
- else
- chanspec |= WL_CHANSPEC_BAND_5G;
-
- chanspec |= WL_CHANSPEC_BW_20;
- chanspec |= WL_CHANSPEC_CTL_SB_NONE;
-
- *join_params_size += WL_ASSOC_PARAMS_FIXED_SIZE +
- join_params->params.chanspec_num * sizeof(chanspec_t);
-
- join_params->params.chanspec_list[0] &= WL_CHANSPEC_CHAN_MASK;
- join_params->params.chanspec_list[0] |= chanspec;
- join_params->params.chanspec_list[0] =
- cpu_to_le16(join_params->params.chanspec_list[0]);
-
- join_params->params.chanspec_num =
- cpu_to_le32(join_params->params.chanspec_num);
-
- WL_TRACE("%s join_params->params.chanspec_list[0]= %X\n",
- __func__, join_params->params.chanspec_list[0]);
- }
- return 1;
-}
-
-static int
-wl_iw_set_wap(struct net_device *dev,
- struct iw_request_info *info, struct sockaddr *awrq, char *extra)
-{
- int error = -EINVAL;
- wl_join_params_t join_params;
- int join_params_size;
-
- WL_TRACE("%s: SIOCSIWAP\n", dev->name);
-
- if (awrq->sa_family != ARPHRD_ETHER) {
- WL_ERROR("Invalid Header...sa_family\n");
- return -EINVAL;
- }
-
- if (is_broadcast_ether_addr(awrq->sa_data) ||
- is_zero_ether_addr(awrq->sa_data)) {
- scb_val_t scbval;
- memset(&scbval, 0, sizeof(scb_val_t));
- (void)dev_wlc_ioctl(dev, WLC_DISASSOC, &scbval,
- sizeof(scb_val_t));
- return 0;
- }
-
- memset(&join_params, 0, sizeof(join_params));
- join_params_size = sizeof(join_params.ssid);
-
- memcpy(join_params.ssid.SSID, g_ssid.SSID, g_ssid.SSID_len);
- join_params.ssid.SSID_len = cpu_to_le32(g_ssid.SSID_len);
- memcpy(&join_params.params.bssid, awrq->sa_data, ETH_ALEN);
-
- WL_TRACE("%s target_channel=%d\n",
- __func__, g_wl_iw_params.target_channel);
- wl_iw_ch_to_chanspec(g_wl_iw_params.target_channel, &join_params,
- &join_params_size);
-
- error = dev_wlc_ioctl(dev, WLC_SET_SSID, &join_params,
- join_params_size);
- if (error) {
- WL_ERROR("%s Invalid ioctl data=%d\n", __func__, error);
- }
-
- if (g_ssid.SSID_len) {
- WL_TRACE("%s: join SSID=%s BSSID=%pM ch=%d\n",
- __func__, g_ssid.SSID, awrq->sa_data,
- g_wl_iw_params.target_channel);
- }
-
- memset(&g_ssid, 0, sizeof(g_ssid));
- return 0;
-}
-
-static int
-wl_iw_get_wap(struct net_device *dev,
- struct iw_request_info *info, struct sockaddr *awrq, char *extra)
-{
- WL_TRACE("%s: SIOCGIWAP\n", dev->name);
-
- awrq->sa_family = ARPHRD_ETHER;
- memset(awrq->sa_data, 0, ETH_ALEN);
-
- (void)dev_wlc_ioctl(dev, WLC_GET_BSSID, awrq->sa_data, ETH_ALEN);
-
- return 0;
-}
-
-#if WIRELESS_EXT > 17
-static int
-wl_iw_mlme(struct net_device *dev,
- struct iw_request_info *info, struct sockaddr *awrq, char *extra)
-{
- struct iw_mlme *mlme;
- scb_val_t scbval;
- int error = -EINVAL;
-
- WL_TRACE("%s: SIOCSIWMLME DISASSOC/DEAUTH\n", dev->name);
-
- mlme = (struct iw_mlme *)extra;
- if (mlme == NULL) {
- WL_ERROR("Invalid ioctl data\n");
- return error;
- }
-
- scbval.val = mlme->reason_code;
- memcpy(&scbval.ea, &mlme->addr.sa_data, ETH_ALEN);
-
- if (mlme->cmd == IW_MLME_DISASSOC) {
- scbval.val = cpu_to_le32(scbval.val);
- error =
- dev_wlc_ioctl(dev, WLC_DISASSOC, &scbval,
- sizeof(scb_val_t));
- } else if (mlme->cmd == IW_MLME_DEAUTH) {
- scbval.val = cpu_to_le32(scbval.val);
- error =
- dev_wlc_ioctl(dev, WLC_SCB_DEAUTHENTICATE_FOR_REASON,
- &scbval, sizeof(scb_val_t));
- } else {
- WL_ERROR("Invalid ioctl data\n");
- return error;
- }
-
- return error;
-}
-#endif /* WIRELESS_EXT > 17 */
-
-#ifndef WL_IW_USE_ISCAN
-static int
-wl_iw_get_aplist(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *dwrq, char *extra)
-{
- wl_scan_results_t *list;
- struct sockaddr *addr = (struct sockaddr *)extra;
- struct iw_quality qual[IW_MAX_AP];
- wl_bss_info_t *bi = NULL;
- int error, i;
- uint buflen = dwrq->length;
-
- WL_TRACE("%s: SIOCGIWAPLIST\n", dev->name);
-
- if (!extra)
- return -EINVAL;
-
- list = kzalloc(buflen, GFP_KERNEL);
- if (!list)
- return -ENOMEM;
- list->buflen = cpu_to_le32(buflen);
- error = dev_wlc_ioctl(dev, WLC_SCAN_RESULTS, list, buflen);
- if (error) {
- WL_ERROR("%d: Scan results error %d\n", __LINE__, error);
- kfree(list);
- return error;
- }
- list->buflen = le32_to_cpu(list->buflen);
- list->version = le32_to_cpu(list->version);
- list->count = le32_to_cpu(list->count);
- if (list->version != WL_BSS_INFO_VERSION) {
- WL_ERROR("%s : list->version %d != WL_BSS_INFO_VERSION\n",
- __func__, list->version);
- kfree(list);
- return -EINVAL;
- }
-
- for (i = 0, dwrq->length = 0;
- i < list->count && dwrq->length < IW_MAX_AP; i++) {
- bi = bi ? (wl_bss_info_t *) ((unsigned long)bi +
- le32_to_cpu(bi->length)) : list->
- bss_info;
- ASSERT(((unsigned long)bi + le32_to_cpu(bi->length)) <=
- ((unsigned long)list + buflen));
-
- if (!(le16_to_cpu(bi->capability) & WLAN_CAPABILITY_ESS))
- continue;
-
- memcpy(addr[dwrq->length].sa_data, &bi->BSSID, ETH_ALEN);
- addr[dwrq->length].sa_family = ARPHRD_ETHER;
- qual[dwrq->length].qual = rssi_to_qual(le16_to_cpu(bi->RSSI));
- qual[dwrq->length].level = 0x100 + le16_to_cpu(bi->RSSI);
- qual[dwrq->length].noise = 0x100 + bi->phy_noise;
-
-#if WIRELESS_EXT > 18
- qual[dwrq->length].updated = IW_QUAL_ALL_UPDATED | IW_QUAL_DBM;
-#else
- qual[dwrq->length].updated = 7;
-#endif
- dwrq->length++;
- }
-
- kfree(list);
-
- if (dwrq->length) {
- memcpy(&addr[dwrq->length], qual,
- sizeof(struct iw_quality) * dwrq->length);
- dwrq->flags = 1;
- }
-
- return 0;
-}
-#endif /* WL_IW_USE_ISCAN */
-
-#ifdef WL_IW_USE_ISCAN
-static int
-wl_iw_iscan_get_aplist(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *dwrq, char *extra)
-{
- wl_scan_results_t *list;
- iscan_buf_t *buf;
- iscan_info_t *iscan = g_iscan;
-
- struct sockaddr *addr = (struct sockaddr *)extra;
- struct iw_quality qual[IW_MAX_AP];
- wl_bss_info_t *bi = NULL;
- int i;
-
- WL_TRACE("%s: SIOCGIWAPLIST\n", dev->name);
-
- if (!extra)
- return -EINVAL;
-
- if ((!iscan) || (!iscan->sysioc_tsk)) {
- WL_ERROR("%s error\n", __func__);
- return 0;
- }
-
- buf = iscan->list_hdr;
- while (buf) {
- list = &((wl_iscan_results_t *) buf->iscan_buf)->results;
- if (list->version != WL_BSS_INFO_VERSION) {
- WL_ERROR("%s : list->version %d != WL_BSS_INFO_VERSION\n",
- __func__, list->version);
- return -EINVAL;
- }
-
- bi = NULL;
- for (i = 0, dwrq->length = 0;
- i < list->count && dwrq->length < IW_MAX_AP; i++) {
- bi = bi ? (wl_bss_info_t *) ((unsigned long)bi +
- le32_to_cpu(bi->length)) :
- list->bss_info;
- ASSERT(((unsigned long)bi + le32_to_cpu(bi->length)) <=
- ((unsigned long)list + WLC_IW_ISCAN_MAXLEN));
-
- if (!(le16_to_cpu(bi->capability) &
- WLAN_CAPABILITY_ESS))
- continue;
-
- memcpy(addr[dwrq->length].sa_data, &bi->BSSID,
- ETH_ALEN);
- addr[dwrq->length].sa_family = ARPHRD_ETHER;
- qual[dwrq->length].qual =
- rssi_to_qual(le16_to_cpu(bi->RSSI));
- qual[dwrq->length].level = 0x100 +
- le16_to_cpu(bi->RSSI);
- qual[dwrq->length].noise = 0x100 + bi->phy_noise;
-
-#if WIRELESS_EXT > 18
- qual[dwrq->length].updated =
- IW_QUAL_ALL_UPDATED | IW_QUAL_DBM;
-#else
- qual[dwrq->length].updated = 7;
-#endif
-
- dwrq->length++;
- }
- buf = buf->next;
- }
- if (dwrq->length) {
- memcpy(&addr[dwrq->length], qual,
- sizeof(struct iw_quality) * dwrq->length);
- dwrq->flags = 1;
- }
-
- return 0;
-}
-
-static int wl_iw_iscan_prep(wl_scan_params_t *params, wlc_ssid_t *ssid)
-{
- int err = 0;
-
- memcpy(params->bssid, ether_bcast, ETH_ALEN);
- params->bss_type = DOT11_BSSTYPE_ANY;
- params->scan_type = 0;
- params->nprobes = -1;
- params->active_time = -1;
- params->passive_time = -1;
- params->home_time = -1;
- params->channel_num = 0;
-
- params->nprobes = cpu_to_le32(params->nprobes);
- params->active_time = cpu_to_le32(params->active_time);
- params->passive_time = cpu_to_le32(params->passive_time);
- params->home_time = cpu_to_le32(params->home_time);
- if (ssid && ssid->SSID_len)
- memcpy(¶ms->ssid, ssid, sizeof(wlc_ssid_t));
-
- return err;
-}
-
-static int wl_iw_iscan(iscan_info_t *iscan, wlc_ssid_t *ssid, u16 action)
-{
- int err = 0;
-
- iscan->iscan_ex_params_p->version = cpu_to_le32(ISCAN_REQ_VERSION);
- iscan->iscan_ex_params_p->action = cpu_to_le16(action);
- iscan->iscan_ex_params_p->scan_duration = cpu_to_le16(0);
-
- WL_SCAN("%s : nprobes=%d\n",
- __func__, iscan->iscan_ex_params_p->params.nprobes);
- WL_SCAN("active_time=%d\n",
- iscan->iscan_ex_params_p->params.active_time);
- WL_SCAN("passive_time=%d\n",
- iscan->iscan_ex_params_p->params.passive_time);
- WL_SCAN("home_time=%d\n", iscan->iscan_ex_params_p->params.home_time);
- WL_SCAN("scan_type=%d\n", iscan->iscan_ex_params_p->params.scan_type);
- WL_SCAN("bss_type=%d\n", iscan->iscan_ex_params_p->params.bss_type);
-
- (void)dev_iw_iovar_setbuf(iscan->dev, "iscan", iscan->iscan_ex_params_p,
- iscan->iscan_ex_param_size, iscan->ioctlbuf,
- sizeof(iscan->ioctlbuf));
-
- return err;
-}
-
-static void wl_iw_timerfunc(unsigned long data)
-{
- iscan_info_t *iscan = (iscan_info_t *) data;
- if (iscan) {
- iscan->timer_on = 0;
- if (iscan->iscan_state != ISCAN_STATE_IDLE) {
- WL_TRACE("timer trigger\n");
- up(&iscan->sysioc_sem);
- }
- }
-}
-
-static void wl_iw_set_event_mask(struct net_device *dev)
-{
- char eventmask[WL_EVENTING_MASK_LEN];
- char iovbuf[WL_EVENTING_MASK_LEN + 12];
-
- dev_iw_iovar_getbuf(dev, "event_msgs", "", 0, iovbuf, sizeof(iovbuf));
- memcpy(eventmask, iovbuf, WL_EVENTING_MASK_LEN);
- setbit(eventmask, WLC_E_SCAN_COMPLETE);
- dev_iw_iovar_setbuf(dev, "event_msgs", eventmask, WL_EVENTING_MASK_LEN,
- iovbuf, sizeof(iovbuf));
-}
-
-static u32 wl_iw_iscan_get(iscan_info_t *iscan)
-{
- iscan_buf_t *buf;
- iscan_buf_t *ptr;
- wl_iscan_results_t *list_buf;
- wl_iscan_results_t list;
- wl_scan_results_t *results;
- u32 status;
- int res = 0;
-
- MUTEX_LOCK_WL_SCAN_SET();
- if (iscan->list_cur) {
- buf = iscan->list_cur;
- iscan->list_cur = buf->next;
- } else {
- buf = kmalloc(sizeof(iscan_buf_t), GFP_KERNEL);
- if (!buf) {
- WL_ERROR("%s can't alloc iscan_buf_t : going to abort current iscan\n",
- __func__);
- MUTEX_UNLOCK_WL_SCAN_SET();
- return WL_SCAN_RESULTS_NO_MEM;
- }
- buf->next = NULL;
- if (!iscan->list_hdr)
- iscan->list_hdr = buf;
- else {
- ptr = iscan->list_hdr;
- while (ptr->next) {
- ptr = ptr->next;
- }
- ptr->next = buf;
- }
- }
- memset(buf->iscan_buf, 0, WLC_IW_ISCAN_MAXLEN);
- list_buf = (wl_iscan_results_t *) buf->iscan_buf;
- results = &list_buf->results;
- results->buflen = WL_ISCAN_RESULTS_FIXED_SIZE;
- results->version = 0;
- results->count = 0;
-
- memset(&list, 0, sizeof(list));
- list.results.buflen = cpu_to_le32(WLC_IW_ISCAN_MAXLEN);
- res = dev_iw_iovar_getbuf(iscan->dev,
- "iscanresults",
- &list,
- WL_ISCAN_RESULTS_FIXED_SIZE,
- buf->iscan_buf, WLC_IW_ISCAN_MAXLEN);
- if (res == 0) {
- results->buflen = le32_to_cpu(results->buflen);
- results->version = le32_to_cpu(results->version);
- results->count = le32_to_cpu(results->count);
- WL_TRACE("results->count = %d\n", results->count);
- WL_TRACE("results->buflen = %d\n", results->buflen);
- status = le32_to_cpu(list_buf->status);
- } else {
- WL_ERROR("%s returns error %d\n", __func__, res);
- status = WL_SCAN_RESULTS_NO_MEM;
- }
- MUTEX_UNLOCK_WL_SCAN_SET();
- return status;
-}
-
-static void wl_iw_force_specific_scan(iscan_info_t *iscan)
-{
- WL_TRACE("%s force Specific SCAN for %s\n",
- __func__, g_specific_ssid.SSID);
- rtnl_lock();
-
- (void)dev_wlc_ioctl(iscan->dev, WLC_SCAN, &g_specific_ssid,
- sizeof(g_specific_ssid));
-
- rtnl_unlock();
-}
-
-static void wl_iw_send_scan_complete(iscan_info_t *iscan)
-{
-#ifndef SANDGATE2G
- union iwreq_data wrqu;
-
- memset(&wrqu, 0, sizeof(wrqu));
-
- wireless_send_event(iscan->dev, SIOCGIWSCAN, &wrqu, NULL);
- WL_TRACE("Send Event ISCAN complete\n");
-#endif
-}
-
-static int _iscan_sysioc_thread(void *data)
-{
- u32 status;
- iscan_info_t *iscan = (iscan_info_t *) data;
- static bool iscan_pass_abort;
-
- allow_signal(SIGTERM);
- status = WL_SCAN_RESULTS_PARTIAL;
- while (down_interruptible(&iscan->sysioc_sem) == 0) {
- if (kthread_should_stop())
- break;
-
- if (iscan->timer_on) {
- del_timer_sync(&iscan->timer);
- iscan->timer_on = 0;
- }
- rtnl_lock();
- status = wl_iw_iscan_get(iscan);
- rtnl_unlock();
- if (g_scan_specified_ssid && (iscan_pass_abort == true)) {
- WL_TRACE("%s Get results from specific scan status = %d\n",
- __func__, status);
- wl_iw_send_scan_complete(iscan);
- iscan_pass_abort = false;
- status = -1;
- }
-
- switch (status) {
- case WL_SCAN_RESULTS_PARTIAL:
- WL_TRACE("iscanresults incomplete\n");
- rtnl_lock();
- wl_iw_iscan(iscan, NULL, WL_SCAN_ACTION_CONTINUE);
- rtnl_unlock();
- mod_timer(&iscan->timer,
- jiffies + iscan->timer_ms * HZ / 1000);
- iscan->timer_on = 1;
- break;
- case WL_SCAN_RESULTS_SUCCESS:
- WL_TRACE("iscanresults complete\n");
- iscan->iscan_state = ISCAN_STATE_IDLE;
- wl_iw_send_scan_complete(iscan);
- break;
- case WL_SCAN_RESULTS_PENDING:
- WL_TRACE("iscanresults pending\n");
- mod_timer(&iscan->timer,
- jiffies + iscan->timer_ms * HZ / 1000);
- iscan->timer_on = 1;
- break;
- case WL_SCAN_RESULTS_ABORTED:
- WL_TRACE("iscanresults aborted\n");
- iscan->iscan_state = ISCAN_STATE_IDLE;
- if (g_scan_specified_ssid == 0)
- wl_iw_send_scan_complete(iscan);
- else {
- iscan_pass_abort = true;
- wl_iw_force_specific_scan(iscan);
- }
- break;
- case WL_SCAN_RESULTS_NO_MEM:
- WL_TRACE("iscanresults can't alloc memory: skip\n");
- iscan->iscan_state = ISCAN_STATE_IDLE;
- break;
- default:
- WL_TRACE("iscanresults returned unknown status %d\n",
- status);
- break;
- }
- }
-
- if (iscan->timer_on) {
- del_timer_sync(&iscan->timer);
- iscan->timer_on = 0;
- }
- return 0;
-}
-#endif /* WL_IW_USE_ISCAN */
-
-static int
-wl_iw_set_scan(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- int error;
- WL_TRACE("\n:%s dev:%s: SIOCSIWSCAN : SCAN\n", __func__, dev->name);
-
- g_set_essid_before_scan = false;
-#if defined(CSCAN)
- WL_ERROR("%s: Scan from SIOCGIWSCAN not supported\n", __func__);
- return -EINVAL;
-#endif
-
- if (g_onoff == G_WLAN_SET_OFF)
- return 0;
-
- memset(&g_specific_ssid, 0, sizeof(g_specific_ssid));
-#ifndef WL_IW_USE_ISCAN
- g_scan_specified_ssid = 0;
-#endif
-
-#if WIRELESS_EXT > 17
- if (wrqu->data.length == sizeof(struct iw_scan_req)) {
- if (wrqu->data.flags & IW_SCAN_THIS_ESSID) {
- struct iw_scan_req *req = (struct iw_scan_req *)extra;
- if (g_scan_specified_ssid) {
- WL_TRACE("%s Specific SCAN is not done ignore scan for = %s\n",
- __func__, req->essid);
- return -EBUSY;
- } else {
- g_specific_ssid.SSID_len = min_t(size_t,
- sizeof(g_specific_ssid.SSID),
- req->essid_len);
- memcpy(g_specific_ssid.SSID, req->essid,
- g_specific_ssid.SSID_len);
- g_specific_ssid.SSID_len =
- cpu_to_le32(g_specific_ssid.SSID_len);
- g_scan_specified_ssid = 1;
- WL_TRACE("### Specific scan ssid=%s len=%d\n",
- g_specific_ssid.SSID,
- g_specific_ssid.SSID_len);
- }
- }
- }
-#endif /* WIRELESS_EXT > 17 */
- error = dev_wlc_ioctl(dev, WLC_SCAN, &g_specific_ssid,
- sizeof(g_specific_ssid));
- if (error) {
- WL_TRACE("#### Set SCAN for %s failed with %d\n",
- g_specific_ssid.SSID, error);
- g_scan_specified_ssid = 0;
- return -EBUSY;
- }
-
- return 0;
-}
-
-#ifdef WL_IW_USE_ISCAN
-int wl_iw_iscan_set_scan_broadcast_prep(struct net_device *dev, uint flag)
-{
- wlc_ssid_t ssid;
- iscan_info_t *iscan = g_iscan;
-
- if (flag)
- rtnl_lock();
-
- wl_iw_set_event_mask(dev);
-
- WL_TRACE("+++: Set Broadcast ISCAN\n");
- memset(&ssid, 0, sizeof(ssid));
-
- iscan->list_cur = iscan->list_hdr;
- iscan->iscan_state = ISCAN_STATE_SCANING;
-
- memset(&iscan->iscan_ex_params_p->params, 0,
- iscan->iscan_ex_param_size);
- wl_iw_iscan_prep(&iscan->iscan_ex_params_p->params, &ssid);
- wl_iw_iscan(iscan, &ssid, WL_SCAN_ACTION_START);
-
- if (flag)
- rtnl_unlock();
-
- mod_timer(&iscan->timer, jiffies + iscan->timer_ms * HZ / 1000);
-
- iscan->timer_on = 1;
-
- return 0;
-}
-
-static int
-wl_iw_iscan_set_scan(struct net_device *dev,
- struct iw_request_info *info,
- union iwreq_data *wrqu, char *extra)
-{
- wlc_ssid_t ssid;
- iscan_info_t *iscan = g_iscan;
-
- WL_TRACE("%s: SIOCSIWSCAN : ISCAN\n", dev->name);
-
-#if defined(CSCAN)
- WL_ERROR("%s: Scan from SIOCGIWSCAN not supported\n", __func__);
- return -EINVAL;
-#endif
-
- if (g_onoff == G_WLAN_SET_OFF) {
- WL_TRACE("%s: driver is not up yet after START\n", __func__);
- return 0;
- }
-#ifdef PNO_SUPPORT
- if (dhd_dev_get_pno_status(dev)) {
- WL_ERROR("%s: Scan called when PNO is active\n", __func__);
- }
-#endif
-
- if ((!iscan) || (!iscan->sysioc_tsk))
- return wl_iw_set_scan(dev, info, wrqu, extra);
-
- if (g_scan_specified_ssid) {
- WL_TRACE("%s Specific SCAN already running ignoring BC scan\n",
- __func__);
- return -EBUSY;
- }
-
- memset(&ssid, 0, sizeof(ssid));
-
-#if WIRELESS_EXT > 17
- if (wrqu->data.length == sizeof(struct iw_scan_req)) {
- if (wrqu->data.flags & IW_SCAN_THIS_ESSID) {
- struct iw_scan_req *req = (struct iw_scan_req *)extra;
- ssid.SSID_len = min_t(size_t, sizeof(ssid.SSID),
- req->essid_len);
- memcpy(ssid.SSID, req->essid, ssid.SSID_len);
- ssid.SSID_len = cpu_to_le32(ssid.SSID_len);
- } else {
- g_scan_specified_ssid = 0;
-
- if (iscan->iscan_state == ISCAN_STATE_SCANING) {
- WL_TRACE("%s ISCAN already in progress\n",
- __func__);
- return 0;
- }
- }
- }
-#endif /* WIRELESS_EXT > 17 */
- wl_iw_iscan_set_scan_broadcast_prep(dev, 0);
-
- return 0;
-}
-#endif /* WL_IW_USE_ISCAN */
-
-#if WIRELESS_EXT > 17
-static bool ie_is_wpa_ie(u8 **wpaie, u8 **tlvs, int *tlvs_len)
-{
-
- u8 *ie = *wpaie;
-
- if ((ie[1] >= 6) &&
- !memcmp((const void *)&ie[2], (const void *)(WPA_OUI "\x01"), 4)) {
- return true;
- }
-
- ie += ie[1] + 2;
- *tlvs_len -= (int)(ie - *tlvs);
- *tlvs = ie;
- return false;
-}
-
-static bool ie_is_wps_ie(u8 **wpsie, u8 **tlvs, int *tlvs_len)
-{
-
- u8 *ie = *wpsie;
-
- if ((ie[1] >= 4) &&
- !memcmp((const void *)&ie[2], (const void *)(WPA_OUI "\x04"), 4)) {
- return true;
- }
-
- ie += ie[1] + 2;
- *tlvs_len -= (int)(ie - *tlvs);
- *tlvs = ie;
- return false;
-}
-#endif /* WIRELESS_EXT > 17 */
-
-static int
-wl_iw_handle_scanresults_ies(char **event_p, char *end,
- struct iw_request_info *info, wl_bss_info_t *bi)
-{
-#if WIRELESS_EXT > 17
- struct iw_event iwe;
- char *event;
-
- event = *event_p;
- if (bi->ie_length) {
- struct brcmu_tlv *ie;
- u8 *ptr = ((u8 *) bi) + sizeof(wl_bss_info_t);
- int ptr_len = bi->ie_length;
-
- ie = brcmu_parse_tlvs(ptr, ptr_len, DOT11_MNG_RSN_ID);
- if (ie) {
- iwe.cmd = IWEVGENIE;
- iwe.u.data.length = ie->len + 2;
- event =
- IWE_STREAM_ADD_POINT(info, event, end, &iwe,
- (char *)ie);
- }
- ptr = ((u8 *) bi) + sizeof(wl_bss_info_t);
-
- while ((ie = brcmu_parse_tlvs(
- ptr, ptr_len, DOT11_MNG_WPA_ID))) {
- if (ie_is_wps_ie(((u8 **)&ie), &ptr, &ptr_len)) {
- iwe.cmd = IWEVGENIE;
- iwe.u.data.length = ie->len + 2;
- event =
- IWE_STREAM_ADD_POINT(info, event, end, &iwe,
- (char *)ie);
- break;
- }
- }
-
- ptr = ((u8 *) bi) + sizeof(wl_bss_info_t);
- ptr_len = bi->ie_length;
- while ((ie = brcmu_parse_tlvs(
- ptr, ptr_len, DOT11_MNG_WPA_ID))) {
- if (ie_is_wpa_ie(((u8 **)&ie), &ptr, &ptr_len)) {
- iwe.cmd = IWEVGENIE;
- iwe.u.data.length = ie->len + 2;
- event =
- IWE_STREAM_ADD_POINT(info, event, end, &iwe,
- (char *)ie);
- break;
- }
- }
-
- *event_p = event;
- }
-#endif /* WIRELESS_EXT > 17 */
- return 0;
-}
-
-static uint
-wl_iw_get_scan_prep(wl_scan_results_t *list,
- struct iw_request_info *info, char *extra, short max_size)
-{
- int i, j;
- struct iw_event iwe;
- wl_bss_info_t *bi = NULL;
- char *event = extra, *end = extra + max_size - WE_ADD_EVENT_FIX, *value;
- int ret = 0;
-
- ASSERT(list);
-
- for (i = 0; i < list->count && i < IW_MAX_AP; i++) {
- if (list->version != WL_BSS_INFO_VERSION) {
- WL_ERROR("%s : list->version %d != WL_BSS_INFO_VERSION\n",
- __func__, list->version);
- return ret;
- }
-
- bi = bi ? (wl_bss_info_t *)((unsigned long)bi +
- le32_to_cpu(bi->length)) : list->
- bss_info;
-
- WL_TRACE("%s : %s\n", __func__, bi->SSID);
-
- iwe.cmd = SIOCGIWAP;
- iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
- memcpy(iwe.u.ap_addr.sa_data, &bi->BSSID, ETH_ALEN);
- event =
- IWE_STREAM_ADD_EVENT(info, event, end, &iwe,
- IW_EV_ADDR_LEN);
- iwe.u.data.length = le32_to_cpu(bi->SSID_len);
- iwe.cmd = SIOCGIWESSID;
- iwe.u.data.flags = 1;
- event = IWE_STREAM_ADD_POINT(info, event, end, &iwe, bi->SSID);
-
- if (le16_to_cpu(bi->capability) & (WLAN_CAPABILITY_ESS |
- WLAN_CAPABILITY_IBSS)) {
- iwe.cmd = SIOCGIWMODE;
- if (le16_to_cpu(bi->capability) & WLAN_CAPABILITY_ESS)
- iwe.u.mode = IW_MODE_INFRA;
- else
- iwe.u.mode = IW_MODE_ADHOC;
- event =
- IWE_STREAM_ADD_EVENT(info, event, end, &iwe,
- IW_EV_UINT_LEN);
- }
-
- iwe.cmd = SIOCGIWFREQ;
-
- if (CHSPEC_CHANNEL(bi->chanspec) <= CH_MAX_2G_CHANNEL)
- iwe.u.freq.m = ieee80211_dsss_chan_to_freq(
- CHSPEC_CHANNEL(bi->chanspec));
- else
- iwe.u.freq.m = ieee80211_ofdm_chan_to_freq(
- WF_CHAN_FACTOR_5_G/2,
- CHSPEC_CHANNEL(bi->chanspec));
-
- iwe.u.freq.e = 6;
- event =
- IWE_STREAM_ADD_EVENT(info, event, end, &iwe,
- IW_EV_FREQ_LEN);
-
- iwe.cmd = IWEVQUAL;
- iwe.u.qual.qual = rssi_to_qual(le16_to_cpu(bi->RSSI));
- iwe.u.qual.level = 0x100 + le16_to_cpu(bi->RSSI);
- iwe.u.qual.noise = 0x100 + bi->phy_noise;
- event =
- IWE_STREAM_ADD_EVENT(info, event, end, &iwe,
- IW_EV_QUAL_LEN);
-
- wl_iw_handle_scanresults_ies(&event, end, info, bi);
-
- iwe.cmd = SIOCGIWENCODE;
- if (le16_to_cpu(bi->capability) & WLAN_CAPABILITY_PRIVACY)
- iwe.u.data.flags = IW_ENCODE_ENABLED | IW_ENCODE_NOKEY;
- else
- iwe.u.data.flags = IW_ENCODE_DISABLED;
- iwe.u.data.length = 0;
- event =
- IWE_STREAM_ADD_POINT(info, event, end, &iwe, (char *)event);
-
- if (bi->rateset.count) {
- if (((event - extra) +
- IW_EV_LCP_LEN) <= (unsigned long)end) {
- value = event + IW_EV_LCP_LEN;
- iwe.cmd = SIOCGIWRATE;
- iwe.u.bitrate.fixed = iwe.u.bitrate.disabled =
- 0;
- for (j = 0;
- j < bi->rateset.count
- && j < IW_MAX_BITRATES; j++) {
- iwe.u.bitrate.value =
- (bi->rateset.rates[j] & 0x7f) *
- 500000;
- value =
- IWE_STREAM_ADD_VALUE(info, event,
- value, end, &iwe,
- IW_EV_PARAM_LEN);
- }
- event = value;
- }
- }
- }
-
- ret = event - extra;
- if (ret < 0) {
- WL_ERROR("==> Wrong size\n");
- ret = 0;
- }
- WL_TRACE("%s: size=%d bytes prepared\n",
- __func__, (unsigned int)(event - extra));
- return (uint)ret;
-}
-
-static int
-wl_iw_get_scan(struct net_device *dev,
- struct iw_request_info *info, struct iw_point *dwrq, char *extra)
-{
- channel_info_t ci;
- wl_scan_results_t *list_merge;
- wl_scan_results_t *list = (wl_scan_results_t *) g_scan;
- int error;
- uint buflen_from_user = dwrq->length;
- uint len = G_SCAN_RESULTS;
- __u16 len_ret = 0;
-#if defined(WL_IW_USE_ISCAN)
- iscan_info_t *iscan = g_iscan;
- iscan_buf_t *p_buf;
-#endif
-
- WL_TRACE("%s: buflen_from_user %d:\n", dev->name, buflen_from_user);
-
- if (!extra) {
- WL_TRACE("%s: wl_iw_get_scan return -EINVAL\n", dev->name);
- return -EINVAL;
- }
-
- error = dev_wlc_ioctl(dev, WLC_GET_CHANNEL, &ci, sizeof(ci));
- if (error)
- return error;
- ci.scan_channel = le32_to_cpu(ci.scan_channel);
- if (ci.scan_channel)
- return -EAGAIN;
-
- if (g_scan_specified_ssid) {
- list = kmalloc(len, GFP_KERNEL);
- if (!list) {
- WL_TRACE("%s: wl_iw_get_scan return -ENOMEM\n",
- dev->name);
- g_scan_specified_ssid = 0;
- return -ENOMEM;
- }
- }
-
- memset(list, 0, len);
- list->buflen = cpu_to_le32(len);
- error = dev_wlc_ioctl(dev, WLC_SCAN_RESULTS, list, len);
- if (error) {
- WL_ERROR("%s: %s : Scan_results ERROR %d\n",
- dev->name, __func__, error);
- dwrq->length = len;
- if (g_scan_specified_ssid) {
- g_scan_specified_ssid = 0;
- kfree(list);
- }
- return 0;
- }
- list->buflen = le32_to_cpu(list->buflen);
- list->version = le32_to_cpu(list->version);
- list->count = le32_to_cpu(list->count);
-
- if (list->version != WL_BSS_INFO_VERSION) {
- WL_ERROR("%s : list->version %d != WL_BSS_INFO_VERSION\n",
- __func__, list->version);
- if (g_scan_specified_ssid) {
- g_scan_specified_ssid = 0;
- kfree(list);
- }
- return -EINVAL;
- }
-
- if (g_scan_specified_ssid) {
- WL_TRACE("%s: Specified scan APs in the list =%d\n",
- __func__, list->count);
- len_ret =
- (__u16) wl_iw_get_scan_prep(list, info, extra,
- buflen_from_user);
- kfree(list);
-
-#if defined(WL_IW_USE_ISCAN)
- p_buf = iscan->list_hdr;
- while (p_buf != iscan->list_cur) {
- list_merge =
- &((wl_iscan_results_t *) p_buf->iscan_buf)->results;
- WL_TRACE("%s: Bcast APs list=%d\n",
- __func__, list_merge->count);
- if (list_merge->count > 0)
- len_ret +=
- (__u16) wl_iw_get_scan_prep(list_merge,
- info, extra + len_ret,
- buflen_from_user - len_ret);
- p_buf = p_buf->next;
- }
-#else
- list_merge = (wl_scan_results_t *) g_scan;
- WL_TRACE("%s: Bcast APs list=%d\n",
- __func__, list_merge->count);
- if (list_merge->count > 0)
- len_ret +=
- (__u16) wl_iw_get_scan_prep(list_merge, info,
- extra + len_ret,
- buflen_from_user -
- len_ret);
-#endif /* defined(WL_IW_USE_ISCAN) */
- } else {
- list = (wl_scan_results_t *) g_scan;
- len_ret =
- (__u16) wl_iw_get_scan_prep(list, info, extra,
- buflen_from_user);
- }
-
-#if defined(WL_IW_USE_ISCAN)
- g_scan_specified_ssid = 0;
-#endif
- if ((len_ret + WE_ADD_EVENT_FIX) < buflen_from_user)
- len = len_ret;
-
- dwrq->length = len;
- dwrq->flags = 0;
-
- WL_TRACE("%s return to WE %d bytes APs=%d\n",
- __func__, dwrq->length, list->count);
- return 0;
-}
-
-#if defined(WL_IW_USE_ISCAN)
-static int
-wl_iw_iscan_get_scan(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *dwrq, char *extra)
-{
- wl_scan_results_t *list;
- struct iw_event iwe;
- wl_bss_info_t *bi = NULL;
- int ii, j;
- int apcnt;
- char *event = extra, *end = extra + dwrq->length, *value;
- iscan_info_t *iscan = g_iscan;
- iscan_buf_t *p_buf;
- u32 counter = 0;
- u8 channel;
-
- WL_TRACE("%s %s buflen_from_user %d:\n",
- dev->name, __func__, dwrq->length);
-
- if (!extra) {
- WL_TRACE("%s: INVALID SIOCGIWSCAN GET bad parameter\n",
- dev->name);
- return -EINVAL;
- }
-
- if ((!iscan) || (!iscan->sysioc_tsk)) {
- WL_ERROR("%ssysioc_tsk\n", __func__);
- return wl_iw_get_scan(dev, info, dwrq, extra);
- }
-
- if (iscan->iscan_state == ISCAN_STATE_SCANING) {
- WL_TRACE("%s: SIOCGIWSCAN GET still scanning\n", dev->name);
- return -EAGAIN;
- }
-
- WL_TRACE("%s: SIOCGIWSCAN GET broadcast results\n", dev->name);
- apcnt = 0;
- p_buf = iscan->list_hdr;
- while (p_buf != iscan->list_cur) {
- list = &((wl_iscan_results_t *) p_buf->iscan_buf)->results;
-
- counter += list->count;
-
- if (list->version != WL_BSS_INFO_VERSION) {
- WL_ERROR("%s : list->version %d != WL_BSS_INFO_VERSION\n",
- __func__, list->version);
- return -EINVAL;
- }
-
- bi = NULL;
- for (ii = 0; ii < list->count && apcnt < IW_MAX_AP;
- apcnt++, ii++) {
- bi = bi ? (wl_bss_info_t *)((unsigned long)bi +
- le32_to_cpu(bi->length)) :
- list->bss_info;
- ASSERT(((unsigned long)bi + le32_to_cpu(bi->length)) <=
- ((unsigned long)list + WLC_IW_ISCAN_MAXLEN));
-
- if (event + ETH_ALEN + bi->SSID_len +
- IW_EV_UINT_LEN + IW_EV_FREQ_LEN + IW_EV_QUAL_LEN >=
- end)
- return -E2BIG;
- iwe.cmd = SIOCGIWAP;
- iwe.u.ap_addr.sa_family = ARPHRD_ETHER;
- memcpy(iwe.u.ap_addr.sa_data, &bi->BSSID,
- ETH_ALEN);
- event =
- IWE_STREAM_ADD_EVENT(info, event, end, &iwe,
- IW_EV_ADDR_LEN);
-
- iwe.u.data.length = le32_to_cpu(bi->SSID_len);
- iwe.cmd = SIOCGIWESSID;
- iwe.u.data.flags = 1;
- event =
- IWE_STREAM_ADD_POINT(info, event, end, &iwe,
- bi->SSID);
-
- if (le16_to_cpu(bi->capability) &
- (WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_IBSS)) {
- iwe.cmd = SIOCGIWMODE;
- if (le16_to_cpu(bi->capability) &
- WLAN_CAPABILITY_ESS)
- iwe.u.mode = IW_MODE_INFRA;
- else
- iwe.u.mode = IW_MODE_ADHOC;
- event =
- IWE_STREAM_ADD_EVENT(info, event, end, &iwe,
- IW_EV_UINT_LEN);
- }
-
- iwe.cmd = SIOCGIWFREQ;
- channel =
- (bi->ctl_ch ==
- 0) ? CHSPEC_CHANNEL(bi->chanspec) : bi->ctl_ch;
-
- if (channel <= CH_MAX_2G_CHANNEL)
- iwe.u.freq.m =
- ieee80211_dsss_chan_to_freq(channel);
- else
- iwe.u.freq.m = ieee80211_ofdm_chan_to_freq(
- WF_CHAN_FACTOR_5_G/2,
- channel);
-
- iwe.u.freq.e = 6;
- event =
- IWE_STREAM_ADD_EVENT(info, event, end, &iwe,
- IW_EV_FREQ_LEN);
-
- iwe.cmd = IWEVQUAL;
- iwe.u.qual.qual = rssi_to_qual(le16_to_cpu(bi->RSSI));
- iwe.u.qual.level = 0x100 + le16_to_cpu(bi->RSSI);
- iwe.u.qual.noise = 0x100 + bi->phy_noise;
- event =
- IWE_STREAM_ADD_EVENT(info, event, end, &iwe,
- IW_EV_QUAL_LEN);
-
- wl_iw_handle_scanresults_ies(&event, end, info, bi);
-
- iwe.cmd = SIOCGIWENCODE;
- if (le16_to_cpu(bi->capability) &
- WLAN_CAPABILITY_PRIVACY)
- iwe.u.data.flags =
- IW_ENCODE_ENABLED | IW_ENCODE_NOKEY;
- else
- iwe.u.data.flags = IW_ENCODE_DISABLED;
- iwe.u.data.length = 0;
- event =
- IWE_STREAM_ADD_POINT(info, event, end, &iwe,
- (char *)event);
-
- if (bi->rateset.count) {
- if (event + IW_MAX_BITRATES * IW_EV_PARAM_LEN >=
- end)
- return -E2BIG;
-
- value = event + IW_EV_LCP_LEN;
- iwe.cmd = SIOCGIWRATE;
- iwe.u.bitrate.fixed = iwe.u.bitrate.disabled =
- 0;
- for (j = 0;
- j < bi->rateset.count
- && j < IW_MAX_BITRATES; j++) {
- iwe.u.bitrate.value =
- (bi->rateset.rates[j] & 0x7f) *
- 500000;
- value =
- IWE_STREAM_ADD_VALUE(info, event,
- value, end,
- &iwe,
- IW_EV_PARAM_LEN);
- }
- event = value;
- }
- }
- p_buf = p_buf->next;
- }
-
- dwrq->length = event - extra;
- dwrq->flags = 0;
-
- WL_TRACE("%s return to WE %d bytes APs=%d\n",
- __func__, dwrq->length, counter);
-
- if (!dwrq->length)
- return -EAGAIN;
-
- return 0;
-}
-#endif /* defined(WL_IW_USE_ISCAN) */
-
-static int
-wl_iw_set_essid(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *dwrq, char *extra)
-{
- int error;
- wl_join_params_t join_params;
- int join_params_size;
-
- WL_TRACE("%s: SIOCSIWESSID\n", dev->name);
-
- if (g_set_essid_before_scan)
- return -EAGAIN;
-
- memset(&g_ssid, 0, sizeof(g_ssid));
-
- CHECK_EXTRA_FOR_NULL(extra);
-
- if (dwrq->length && extra) {
-#if WIRELESS_EXT > 20
- g_ssid.SSID_len = min_t(size_t, sizeof(g_ssid.SSID),
- dwrq->length);
-#else
- g_ssid.SSID_len = min_t(size_t, sizeof(g_ssid.SSID),
- dwrq->length - 1);
-#endif
- memcpy(g_ssid.SSID, extra, g_ssid.SSID_len);
- } else {
- g_ssid.SSID_len = 0;
- }
- g_ssid.SSID_len = cpu_to_le32(g_ssid.SSID_len);
-
- memset(&join_params, 0, sizeof(join_params));
- join_params_size = sizeof(join_params.ssid);
-
- memcpy(&join_params.ssid.SSID, g_ssid.SSID, g_ssid.SSID_len);
- join_params.ssid.SSID_len = cpu_to_le32(g_ssid.SSID_len);
- memcpy(join_params.params.bssid, ether_bcast, ETH_ALEN);
-
- wl_iw_ch_to_chanspec(g_wl_iw_params.target_channel, &join_params,
- &join_params_size);
-
- error = dev_wlc_ioctl(dev, WLC_SET_SSID, &join_params,
- join_params_size);
- if (error)
- WL_ERROR("Invalid ioctl data=%d\n", error);
-
- if (g_ssid.SSID_len) {
- WL_TRACE("%s: join SSID=%s ch=%d\n",
- __func__, g_ssid.SSID, g_wl_iw_params.target_channel);
- }
- return 0;
-}
-
-static int
-wl_iw_get_essid(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *dwrq, char *extra)
-{
- wlc_ssid_t ssid;
- int error;
-
- WL_TRACE("%s: SIOCGIWESSID\n", dev->name);
-
- if (!extra)
- return -EINVAL;
-
- error = dev_wlc_ioctl(dev, WLC_GET_SSID, &ssid, sizeof(ssid));
- if (error) {
- WL_ERROR("Error getting the SSID\n");
- return error;
- }
-
- ssid.SSID_len = le32_to_cpu(ssid.SSID_len);
-
- memcpy(extra, ssid.SSID, ssid.SSID_len);
-
- dwrq->length = ssid.SSID_len;
-
- dwrq->flags = 1;
-
- return 0;
-}
-
-static int
-wl_iw_set_nick(struct net_device *dev,
- struct iw_request_info *info, struct iw_point *dwrq, char *extra)
-{
- wl_iw_t *iw = *(wl_iw_t **) netdev_priv(dev);
-
- WL_TRACE("%s: SIOCSIWNICKN\n", dev->name);
-
- if (!extra)
- return -EINVAL;
-
- if (dwrq->length > sizeof(iw->nickname))
- return -E2BIG;
-
- memcpy(iw->nickname, extra, dwrq->length);
- iw->nickname[dwrq->length - 1] = '\0';
-
- return 0;
-}
-
-static int
-wl_iw_get_nick(struct net_device *dev,
- struct iw_request_info *info, struct iw_point *dwrq, char *extra)
-{
- wl_iw_t *iw = *(wl_iw_t **) netdev_priv(dev);
-
- WL_TRACE("%s: SIOCGIWNICKN\n", dev->name);
-
- if (!extra)
- return -EINVAL;
-
- strcpy(extra, iw->nickname);
- dwrq->length = strlen(extra) + 1;
-
- return 0;
-}
-
-static int
-wl_iw_set_rate(struct net_device *dev,
- struct iw_request_info *info, struct iw_param *vwrq, char *extra)
-{
- wl_rateset_t rateset;
- int error, rate, i, error_bg, error_a;
-
- WL_TRACE("%s: SIOCSIWRATE\n", dev->name);
-
- error = dev_wlc_ioctl(dev, WLC_GET_CURR_RATESET, &rateset,
- sizeof(rateset));
- if (error)
- return error;
-
- rateset.count = le32_to_cpu(rateset.count);
-
- if (vwrq->value < 0)
- rate = rateset.rates[rateset.count - 1] & 0x7f;
- else if (vwrq->value < rateset.count)
- rate = rateset.rates[vwrq->value] & 0x7f;
- else
- rate = vwrq->value / 500000;
-
- if (vwrq->fixed) {
- error_bg = dev_wlc_intvar_set(dev, "bg_rate", rate);
- error_a = dev_wlc_intvar_set(dev, "a_rate", rate);
-
- if (error_bg && error_a)
- return error_bg | error_a;
- } else {
- error_bg = dev_wlc_intvar_set(dev, "bg_rate", 0);
- error_a = dev_wlc_intvar_set(dev, "a_rate", 0);
-
- if (error_bg && error_a)
- return error_bg | error_a;
-
- for (i = 0; i < rateset.count; i++)
- if ((rateset.rates[i] & 0x7f) > rate)
- break;
- rateset.count = cpu_to_le32(i);
-
- error = dev_wlc_ioctl(dev, WLC_SET_RATESET, &rateset,
- sizeof(rateset));
- if (error)
- return error;
- }
-
- return 0;
-}
-
-static int
-wl_iw_get_rate(struct net_device *dev,
- struct iw_request_info *info, struct iw_param *vwrq, char *extra)
-{
- int error, rate;
-
- WL_TRACE("%s: SIOCGIWRATE\n", dev->name);
-
- error = dev_wlc_ioctl(dev, WLC_GET_RATE, &rate, sizeof(rate));
- if (error)
- return error;
- rate = le32_to_cpu(rate);
- vwrq->value = rate * 500000;
-
- return 0;
-}
-
-static int
-wl_iw_set_rts(struct net_device *dev,
- struct iw_request_info *info, struct iw_param *vwrq, char *extra)
-{
- int error, rts;
-
- WL_TRACE("%s: SIOCSIWRTS\n", dev->name);
-
- if (vwrq->disabled)
- rts = DOT11_DEFAULT_RTS_LEN;
- else if (vwrq->value < 0 || vwrq->value > DOT11_DEFAULT_RTS_LEN)
- return -EINVAL;
- else
- rts = vwrq->value;
-
- error = dev_wlc_intvar_set(dev, "rtsthresh", rts);
- if (error)
- return error;
-
- return 0;
-}
-
-static int
-wl_iw_get_rts(struct net_device *dev,
- struct iw_request_info *info, struct iw_param *vwrq, char *extra)
-{
- int error, rts;
-
- WL_TRACE("%s: SIOCGIWRTS\n", dev->name);
-
- error = dev_wlc_intvar_get(dev, "rtsthresh", &rts);
- if (error)
- return error;
-
- vwrq->value = rts;
- vwrq->disabled = (rts >= DOT11_DEFAULT_RTS_LEN);
- vwrq->fixed = 1;
-
- return 0;
-}
-
-static int
-wl_iw_set_frag(struct net_device *dev,
- struct iw_request_info *info, struct iw_param *vwrq, char *extra)
-{
- int error, frag;
-
- WL_TRACE("%s: SIOCSIWFRAG\n", dev->name);
-
- if (vwrq->disabled)
- frag = DOT11_DEFAULT_FRAG_LEN;
- else if (vwrq->value < 0 || vwrq->value > DOT11_DEFAULT_FRAG_LEN)
- return -EINVAL;
- else
- frag = vwrq->value;
-
- error = dev_wlc_intvar_set(dev, "fragthresh", frag);
- if (error)
- return error;
-
- return 0;
-}
-
-static int
-wl_iw_get_frag(struct net_device *dev,
- struct iw_request_info *info, struct iw_param *vwrq, char *extra)
-{
- int error, fragthreshold;
-
- WL_TRACE("%s: SIOCGIWFRAG\n", dev->name);
-
- error = dev_wlc_intvar_get(dev, "fragthresh", &fragthreshold);
- if (error)
- return error;
-
- vwrq->value = fragthreshold;
- vwrq->disabled = (fragthreshold >= DOT11_DEFAULT_FRAG_LEN);
- vwrq->fixed = 1;
-
- return 0;
-}
-
-static int
-wl_iw_set_txpow(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *vwrq, char *extra)
-{
- int error, disable;
- u16 txpwrmw;
- WL_TRACE("%s: SIOCSIWTXPOW\n", dev->name);
-
- disable = vwrq->disabled ? WL_RADIO_SW_DISABLE : 0;
- disable += WL_RADIO_SW_DISABLE << 16;
-
- disable = cpu_to_le32(disable);
- error = dev_wlc_ioctl(dev, WLC_SET_RADIO, &disable, sizeof(disable));
- if (error)
- return error;
-
- if (disable & WL_RADIO_SW_DISABLE)
- return 0;
-
- if (!(vwrq->flags & IW_TXPOW_MWATT))
- return -EINVAL;
-
- if (vwrq->value < 0)
- return 0;
-
- if (vwrq->value > 0xffff)
- txpwrmw = 0xffff;
- else
- txpwrmw = (u16) vwrq->value;
-
- error = dev_wlc_intvar_set(dev, "qtxpower",
- (int)(brcmu_mw_to_qdbm(txpwrmw)));
- return error;
-}
-
-static int
-wl_iw_get_txpow(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *vwrq, char *extra)
-{
- int error, disable, txpwrdbm;
- u8 result;
-
- WL_TRACE("%s: SIOCGIWTXPOW\n", dev->name);
-
- error = dev_wlc_ioctl(dev, WLC_GET_RADIO, &disable, sizeof(disable));
- if (error)
- return error;
-
- error = dev_wlc_intvar_get(dev, "qtxpower", &txpwrdbm);
- if (error)
- return error;
-
- disable = le32_to_cpu(disable);
- result = (u8) (txpwrdbm & ~WL_TXPWR_OVERRIDE);
- vwrq->value = (s32) brcmu_qdbm_to_mw(result);
- vwrq->fixed = 0;
- vwrq->disabled =
- (disable & (WL_RADIO_SW_DISABLE | WL_RADIO_HW_DISABLE)) ? 1 : 0;
- vwrq->flags = IW_TXPOW_MWATT;
-
- return 0;
-}
-
-#if WIRELESS_EXT > 10
-static int
-wl_iw_set_retry(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *vwrq, char *extra)
-{
- int error, lrl, srl;
-
- WL_TRACE("%s: SIOCSIWRETRY\n", dev->name);
-
- if (vwrq->disabled || (vwrq->flags & IW_RETRY_LIFETIME))
- return -EINVAL;
-
- if (vwrq->flags & IW_RETRY_LIMIT) {
-
-#if WIRELESS_EXT > 20
- if ((vwrq->flags & IW_RETRY_LONG)
- || (vwrq->flags & IW_RETRY_MAX)
- || !((vwrq->flags & IW_RETRY_SHORT)
- || (vwrq->flags & IW_RETRY_MIN))) {
-#else
- if ((vwrq->flags & IW_RETRY_MAX)
- || !(vwrq->flags & IW_RETRY_MIN)) {
-#endif
- lrl = cpu_to_le32(vwrq->value);
- error = dev_wlc_ioctl(dev, WLC_SET_LRL, &lrl,
- sizeof(lrl));
- if (error)
- return error;
- }
-#if WIRELESS_EXT > 20
- if ((vwrq->flags & IW_RETRY_SHORT)
- || (vwrq->flags & IW_RETRY_MIN)
- || !((vwrq->flags & IW_RETRY_LONG)
- || (vwrq->flags & IW_RETRY_MAX))) {
-#else
- if ((vwrq->flags & IW_RETRY_MIN)
- || !(vwrq->flags & IW_RETRY_MAX)) {
-#endif
- srl = cpu_to_le32(vwrq->value);
- error = dev_wlc_ioctl(dev, WLC_SET_SRL, &srl,
- sizeof(srl));
- if (error)
- return error;
- }
- }
- return 0;
-}
-
-static int
-wl_iw_get_retry(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *vwrq, char *extra)
-{
- int error, lrl, srl;
-
- WL_TRACE("%s: SIOCGIWRETRY\n", dev->name);
-
- vwrq->disabled = 0;
-
- if ((vwrq->flags & IW_RETRY_TYPE) == IW_RETRY_LIFETIME)
- return -EINVAL;
-
- error = dev_wlc_ioctl(dev, WLC_GET_LRL, &lrl, sizeof(lrl));
- if (error)
- return error;
-
- error = dev_wlc_ioctl(dev, WLC_GET_SRL, &srl, sizeof(srl));
- if (error)
- return error;
-
- lrl = le32_to_cpu(lrl);
- srl = le32_to_cpu(srl);
-
- if (vwrq->flags & IW_RETRY_MAX) {
- vwrq->flags = IW_RETRY_LIMIT | IW_RETRY_MAX;
- vwrq->value = lrl;
- } else {
- vwrq->flags = IW_RETRY_LIMIT;
- vwrq->value = srl;
- if (srl != lrl)
- vwrq->flags |= IW_RETRY_MIN;
- }
-
- return 0;
-}
-#endif /* WIRELESS_EXT > 10 */
-
-static int
-wl_iw_set_encode(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *dwrq, char *extra)
-{
- wl_wsec_key_t key;
- int error, val, wsec;
-
- WL_TRACE("%s: SIOCSIWENCODE\n", dev->name);
-
- memset(&key, 0, sizeof(key));
-
- if ((dwrq->flags & IW_ENCODE_INDEX) == 0) {
- for (key.index = 0; key.index < DOT11_MAX_DEFAULT_KEYS;
- key.index++) {
- val = cpu_to_le32(key.index);
- error = dev_wlc_ioctl(dev, WLC_GET_KEY_PRIMARY, &val,
- sizeof(val));
- if (error)
- return error;
- val = le32_to_cpu(val);
- if (val)
- break;
- }
- if (key.index == DOT11_MAX_DEFAULT_KEYS)
- key.index = 0;
- } else {
- key.index = (dwrq->flags & IW_ENCODE_INDEX) - 1;
- if (key.index >= DOT11_MAX_DEFAULT_KEYS)
- return -EINVAL;
- }
-
- if (!extra || !dwrq->length || (dwrq->flags & IW_ENCODE_NOKEY)) {
- val = cpu_to_le32(key.index);
- error = dev_wlc_ioctl(dev, WLC_SET_KEY_PRIMARY, &val,
- sizeof(val));
- if (error)
- return error;
- } else {
- key.len = dwrq->length;
-
- if (dwrq->length > sizeof(key.data))
- return -EINVAL;
-
- memcpy(key.data, extra, dwrq->length);
-
- key.flags = WL_PRIMARY_KEY;
- switch (key.len) {
- case WLAN_KEY_LEN_WEP40:
- key.algo = CRYPTO_ALGO_WEP1;
- break;
- case WLAN_KEY_LEN_WEP104:
- key.algo = CRYPTO_ALGO_WEP128;
- break;
- case WLAN_KEY_LEN_TKIP:
- key.algo = CRYPTO_ALGO_TKIP;
- break;
- case WLAN_KEY_LEN_AES_CMAC:
- key.algo = CRYPTO_ALGO_AES_CCM;
- break;
- default:
- return -EINVAL;
- }
-
- swap_key_from_BE(&key);
- error = dev_wlc_ioctl(dev, WLC_SET_KEY, &key, sizeof(key));
- if (error)
- return error;
- }
-
- val = (dwrq->flags & IW_ENCODE_DISABLED) ? 0 : WEP_ENABLED;
-
- error = dev_wlc_intvar_get(dev, "wsec", &wsec);
- if (error)
- return error;
-
- wsec &= ~(WEP_ENABLED);
- wsec |= val;
-
- error = dev_wlc_intvar_set(dev, "wsec", wsec);
- if (error)
- return error;
-
- val = (dwrq->flags & IW_ENCODE_RESTRICTED) ? 1 : 0;
- val = cpu_to_le32(val);
- error = dev_wlc_ioctl(dev, WLC_SET_AUTH, &val, sizeof(val));
- if (error)
- return error;
-
- return 0;
-}
-
-static int
-wl_iw_get_encode(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *dwrq, char *extra)
-{
- wl_wsec_key_t key;
- int error, val, wsec, auth;
-
- WL_TRACE("%s: SIOCGIWENCODE\n", dev->name);
-
- memset(&key, 0, sizeof(wl_wsec_key_t));
-
- if ((dwrq->flags & IW_ENCODE_INDEX) == 0) {
- for (key.index = 0; key.index < DOT11_MAX_DEFAULT_KEYS;
- key.index++) {
- val = key.index;
- error = dev_wlc_ioctl(dev, WLC_GET_KEY_PRIMARY, &val,
- sizeof(val));
- if (error)
- return error;
- val = le32_to_cpu(val);
- if (val)
- break;
- }
- } else
- key.index = (dwrq->flags & IW_ENCODE_INDEX) - 1;
-
- if (key.index >= DOT11_MAX_DEFAULT_KEYS)
- key.index = 0;
-
- error = dev_wlc_ioctl(dev, WLC_GET_WSEC, &wsec, sizeof(wsec));
- if (error)
- return error;
-
- error = dev_wlc_ioctl(dev, WLC_GET_AUTH, &auth, sizeof(auth));
- if (error)
- return error;
-
- swap_key_to_BE(&key);
-
- wsec = le32_to_cpu(wsec);
- auth = le32_to_cpu(auth);
- dwrq->length = min_t(u16, WLAN_MAX_KEY_LEN, key.len);
-
- dwrq->flags = key.index + 1;
- if (!(wsec & (WEP_ENABLED | TKIP_ENABLED | AES_ENABLED)))
- dwrq->flags |= IW_ENCODE_DISABLED;
-
- if (auth)
- dwrq->flags |= IW_ENCODE_RESTRICTED;
-
- if (dwrq->length && extra)
- memcpy(extra, key.data, dwrq->length);
-
- return 0;
-}
-
-static int
-wl_iw_set_power(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *vwrq, char *extra)
-{
- int error, pm;
-
- WL_TRACE("%s: SIOCSIWPOWER\n", dev->name);
-
- pm = vwrq->disabled ? PM_OFF : PM_MAX;
-
- pm = cpu_to_le32(pm);
- error = dev_wlc_ioctl(dev, WLC_SET_PM, &pm, sizeof(pm));
- if (error)
- return error;
-
- return 0;
-}
-
-static int
-wl_iw_get_power(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *vwrq, char *extra)
-{
- int error, pm;
-
- WL_TRACE("%s: SIOCGIWPOWER\n", dev->name);
-
- error = dev_wlc_ioctl(dev, WLC_GET_PM, &pm, sizeof(pm));
- if (error)
- return error;
-
- pm = le32_to_cpu(pm);
- vwrq->disabled = pm ? 0 : 1;
- vwrq->flags = IW_POWER_ALL_R;
-
- return 0;
-}
-
-#if WIRELESS_EXT > 17
-static int
-wl_iw_set_wpaie(struct net_device *dev,
- struct iw_request_info *info, struct iw_point *iwp, char *extra)
-{
-
- WL_TRACE("%s: SIOCSIWGENIE\n", dev->name);
-
- CHECK_EXTRA_FOR_NULL(extra);
-
- dev_wlc_bufvar_set(dev, "wpaie", extra, iwp->length);
-
- return 0;
-}
-
-static int
-wl_iw_get_wpaie(struct net_device *dev,
- struct iw_request_info *info, struct iw_point *iwp, char *extra)
-{
- WL_TRACE("%s: SIOCGIWGENIE\n", dev->name);
- iwp->length = 64;
- dev_wlc_bufvar_get(dev, "wpaie", extra, iwp->length);
- return 0;
-}
-
-static int
-wl_iw_set_encodeext(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_point *dwrq, char *extra)
-{
- wl_wsec_key_t key;
- int error;
- struct iw_encode_ext *iwe;
-
- WL_TRACE("%s: SIOCSIWENCODEEXT\n", dev->name);
-
- CHECK_EXTRA_FOR_NULL(extra);
-
- memset(&key, 0, sizeof(key));
- iwe = (struct iw_encode_ext *)extra;
-
- if (dwrq->flags & IW_ENCODE_DISABLED) {
-
- }
-
- key.index = 0;
- if (dwrq->flags & IW_ENCODE_INDEX)
- key.index = (dwrq->flags & IW_ENCODE_INDEX) - 1;
-
- key.len = iwe->key_len;
-
- if (!is_multicast_ether_addr(iwe->addr.sa_data))
- memcpy(&key.ea, &iwe->addr.sa_data, ETH_ALEN);
-
- if (key.len == 0) {
- if (iwe->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
- WL_WSEC("Changing the the primary Key to %d\n",
- key.index);
- key.index = cpu_to_le32(key.index);
- error = dev_wlc_ioctl(dev, WLC_SET_KEY_PRIMARY,
- &key.index, sizeof(key.index));
- if (error)
- return error;
- } else {
- swap_key_from_BE(&key);
- dev_wlc_ioctl(dev, WLC_SET_KEY, &key, sizeof(key));
- }
- } else {
- if (iwe->key_len > sizeof(key.data))
- return -EINVAL;
-
- WL_WSEC("Setting the key index %d\n", key.index);
- if (iwe->ext_flags & IW_ENCODE_EXT_SET_TX_KEY) {
- WL_WSEC("key is a Primary Key\n");
- key.flags = WL_PRIMARY_KEY;
- }
-
- memcpy(key.data, iwe->key, iwe->key_len);
-
- if (iwe->alg == IW_ENCODE_ALG_TKIP) {
- u8 keybuf[8];
- memcpy(keybuf, &key.data[24], sizeof(keybuf));
- memcpy(&key.data[24], &key.data[16], sizeof(keybuf));
- memcpy(&key.data[16], keybuf, sizeof(keybuf));
- }
-
- if (iwe->ext_flags & IW_ENCODE_EXT_RX_SEQ_VALID) {
- unsigned char *ivptr;
- ivptr = (unsigned char *) iwe->rx_seq;
- key.rxiv.hi = (ivptr[5] << 24) | (ivptr[4] << 16) |
- (ivptr[3] << 8) | ivptr[2];
- key.rxiv.lo = (ivptr[1] << 8) | ivptr[0];
- key.iv_initialized = true;
- }
-
- switch (iwe->alg) {
- case IW_ENCODE_ALG_NONE:
- key.algo = CRYPTO_ALGO_OFF;
- break;
- case IW_ENCODE_ALG_WEP:
- if (iwe->key_len == WLAN_KEY_LEN_WEP40)
- key.algo = CRYPTO_ALGO_WEP1;
- else
- key.algo = CRYPTO_ALGO_WEP128;
- break;
- case IW_ENCODE_ALG_TKIP:
- key.algo = CRYPTO_ALGO_TKIP;
- break;
- case IW_ENCODE_ALG_CCMP:
- key.algo = CRYPTO_ALGO_AES_CCM;
- break;
- default:
- break;
- }
- swap_key_from_BE(&key);
-
- dhd_wait_pend8021x(dev);
-
- error = dev_wlc_ioctl(dev, WLC_SET_KEY, &key, sizeof(key));
- if (error)
- return error;
- }
- return 0;
-}
-
-#if WIRELESS_EXT > 17
-struct {
- pmkid_list_t pmkids;
- pmkid_t foo[MAXPMKID - 1];
-} pmkid_list;
-
-static int
-wl_iw_set_pmksa(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *vwrq, char *extra)
-{
- struct iw_pmksa *iwpmksa;
- uint i;
- int ret = 0;
-
- WL_WSEC("%s: SIOCSIWPMKSA\n", dev->name);
-
- CHECK_EXTRA_FOR_NULL(extra);
-
- iwpmksa = (struct iw_pmksa *)extra;
-
- if (iwpmksa->cmd == IW_PMKSA_FLUSH) {
- WL_WSEC("wl_iw_set_pmksa - IW_PMKSA_FLUSH\n");
- memset((char *)&pmkid_list, 0, sizeof(pmkid_list));
- }
-
- else if (iwpmksa->cmd == IW_PMKSA_REMOVE) {
- {
- pmkid_list_t pmkid, *pmkidptr;
- uint j;
- pmkidptr = &pmkid;
-
- memcpy(&pmkidptr->pmkid[0].BSSID,
- &iwpmksa->bssid.sa_data[0],
- ETH_ALEN);
- memcpy(&pmkidptr->pmkid[0].PMKID,
- &iwpmksa->pmkid[0],
- WLAN_PMKID_LEN);
-
- WL_WSEC("wl_iw_set_pmksa:IW_PMKSA_REMOVE:PMKID: "
- "%pM = ", &pmkidptr->pmkid[0].BSSID);
- for (j = 0; j < WLAN_PMKID_LEN; j++)
- WL_WSEC("%02x ", pmkidptr->pmkid[0].PMKID[j]);
- WL_WSEC("\n");
- }
-
- for (i = 0; i < pmkid_list.pmkids.npmkid; i++)
- if (!memcmp
- (&iwpmksa->bssid.sa_data[0],
- &pmkid_list.pmkids.pmkid[i].BSSID, ETH_ALEN))
- break;
-
- if ((pmkid_list.pmkids.npmkid > 0)
- && (i < pmkid_list.pmkids.npmkid)) {
- memset(&pmkid_list.pmkids.pmkid[i], 0, sizeof(pmkid_t));
- for (; i < (pmkid_list.pmkids.npmkid - 1); i++) {
- memcpy(&pmkid_list.pmkids.pmkid[i].BSSID,
- &pmkid_list.pmkids.pmkid[i + 1].BSSID,
- ETH_ALEN);
- memcpy(&pmkid_list.pmkids.pmkid[i].PMKID,
- &pmkid_list.pmkids.pmkid[i + 1].PMKID,
- WLAN_PMKID_LEN);
- }
- pmkid_list.pmkids.npmkid--;
- } else
- ret = -EINVAL;
- }
-
- else if (iwpmksa->cmd == IW_PMKSA_ADD) {
- for (i = 0; i < pmkid_list.pmkids.npmkid; i++)
- if (!memcmp
- (&iwpmksa->bssid.sa_data[0],
- &pmkid_list.pmkids.pmkid[i].BSSID, ETH_ALEN))
- break;
- if (i < MAXPMKID) {
- memcpy(&pmkid_list.pmkids.pmkid[i].BSSID,
- &iwpmksa->bssid.sa_data[0],
- ETH_ALEN);
- memcpy(&pmkid_list.pmkids.pmkid[i].PMKID,
- &iwpmksa->pmkid[0],
- WLAN_PMKID_LEN);
- if (i == pmkid_list.pmkids.npmkid)
- pmkid_list.pmkids.npmkid++;
- } else
- ret = -EINVAL;
- {
- uint j;
- uint k;
- k = pmkid_list.pmkids.npmkid;
- WL_WSEC("wl_iw_set_pmksa,IW_PMKSA_ADD - PMKID: %pM = ",
- &pmkid_list.pmkids.pmkid[k].BSSID);
- for (j = 0; j < WLAN_PMKID_LEN; j++)
- WL_WSEC("%02x ",
- pmkid_list.pmkids.pmkid[k].PMKID[j]);
- WL_WSEC("\n");
- }
- }
- WL_WSEC("PRINTING pmkid LIST - No of elements %d\n",
- pmkid_list.pmkids.npmkid);
- for (i = 0; i < pmkid_list.pmkids.npmkid; i++) {
- uint j;
- WL_WSEC("PMKID[%d]: %pM = ",
- i, &pmkid_list.pmkids.pmkid[i].BSSID);
- for (j = 0; j < WLAN_PMKID_LEN; j++)
- WL_WSEC("%02x ", pmkid_list.pmkids.pmkid[i].PMKID[j]);
- WL_WSEC("\n");
- }
- WL_WSEC("\n");
-
- if (!ret)
- ret = dev_wlc_bufvar_set(dev, "pmkid_info", (char *)&pmkid_list,
- sizeof(pmkid_list));
- return ret;
-}
-#endif /* WIRELESS_EXT > 17 */
-
-static int
-wl_iw_get_encodeext(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *vwrq, char *extra)
-{
- WL_TRACE("%s: SIOCGIWENCODEEXT\n", dev->name);
- return 0;
-}
-
-static int
-wl_iw_set_wpaauth(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *vwrq, char *extra)
-{
- int error = 0;
- int paramid;
- int paramval;
- int val = 0;
- wl_iw_t *iw = *(wl_iw_t **) netdev_priv(dev);
-
- WL_TRACE("%s: SIOCSIWAUTH\n", dev->name);
-
- paramid = vwrq->flags & IW_AUTH_INDEX;
- paramval = vwrq->value;
-
- WL_TRACE("%s: SIOCSIWAUTH, paramid = 0x%0x, paramval = 0x%0x\n",
- dev->name, paramid, paramval);
-
- switch (paramid) {
- case IW_AUTH_WPA_VERSION:
- if (paramval & IW_AUTH_WPA_VERSION_DISABLED)
- val = WPA_AUTH_DISABLED;
- else if (paramval & (IW_AUTH_WPA_VERSION_WPA))
- val = WPA_AUTH_PSK | WPA_AUTH_UNSPECIFIED;
- else if (paramval & IW_AUTH_WPA_VERSION_WPA2)
- val = WPA2_AUTH_PSK | WPA2_AUTH_UNSPECIFIED;
- WL_INFORM("%s: %d: setting wpa_auth to 0x%0x\n",
- __func__, __LINE__, val);
- error = dev_wlc_intvar_set(dev, "wpa_auth", val);
- if (error)
- return error;
- break;
- case IW_AUTH_CIPHER_PAIRWISE:
- case IW_AUTH_CIPHER_GROUP:
- if (paramval & (IW_AUTH_CIPHER_WEP40 | IW_AUTH_CIPHER_WEP104))
- val = WEP_ENABLED;
- if (paramval & IW_AUTH_CIPHER_TKIP)
- val = TKIP_ENABLED;
- if (paramval & IW_AUTH_CIPHER_CCMP)
- val = AES_ENABLED;
-
- if (paramid == IW_AUTH_CIPHER_PAIRWISE) {
- iw->pwsec = val;
- val |= iw->gwsec;
- } else {
- iw->gwsec = val;
- val |= iw->pwsec;
- }
-
- if (iw->privacy_invoked && !val) {
- WL_WSEC("%s: %s: 'Privacy invoked' true but clearing wsec, assuming we're a WPS enrollee\n",
- dev->name, __func__);
- error = dev_wlc_intvar_set(dev, "is_WPS_enrollee",
- true);
- if (error) {
- WL_WSEC("Failed to set is_WPS_enrollee\n");
- return error;
- }
- } else if (val) {
- error = dev_wlc_intvar_set(dev, "is_WPS_enrollee",
- false);
- if (error) {
- WL_WSEC("Failed to clear is_WPS_enrollee\n");
- return error;
- }
- }
-
- error = dev_wlc_intvar_set(dev, "wsec", val);
- if (error)
- return error;
-
- break;
-
- case IW_AUTH_KEY_MGMT:
- error = dev_wlc_intvar_get(dev, "wpa_auth", &val);
- if (error)
- return error;
-
- if (val & (WPA_AUTH_PSK | WPA_AUTH_UNSPECIFIED)) {
- if (paramval & IW_AUTH_KEY_MGMT_PSK)
- val = WPA_AUTH_PSK;
- else
- val = WPA_AUTH_UNSPECIFIED;
- } else if (val & (WPA2_AUTH_PSK | WPA2_AUTH_UNSPECIFIED)) {
- if (paramval & IW_AUTH_KEY_MGMT_PSK)
- val = WPA2_AUTH_PSK;
- else
- val = WPA2_AUTH_UNSPECIFIED;
- }
- WL_INFORM("%s: %d: setting wpa_auth to %d\n",
- __func__, __LINE__, val);
- error = dev_wlc_intvar_set(dev, "wpa_auth", val);
- if (error)
- return error;
-
- break;
- case IW_AUTH_TKIP_COUNTERMEASURES:
- dev_wlc_bufvar_set(dev, "tkip_countermeasures",
- (char *)¶mval, 1);
- break;
-
- case IW_AUTH_80211_AUTH_ALG:
- WL_INFORM("Setting the D11auth %d\n", paramval);
- if (paramval == IW_AUTH_ALG_OPEN_SYSTEM)
- val = 0;
- else if (paramval == IW_AUTH_ALG_SHARED_KEY)
- val = 1;
- else if (paramval ==
- (IW_AUTH_ALG_OPEN_SYSTEM | IW_AUTH_ALG_SHARED_KEY))
- val = 2;
- else
- error = 1;
- if (!error) {
- error = dev_wlc_intvar_set(dev, "auth", val);
- if (error)
- return error;
- }
- break;
-
- case IW_AUTH_WPA_ENABLED:
- if (paramval == 0) {
- iw->pwsec = 0;
- iw->gwsec = 0;
- error = dev_wlc_intvar_get(dev, "wsec", &val);
- if (error)
- return error;
- if (val & (TKIP_ENABLED | AES_ENABLED)) {
- val &= ~(TKIP_ENABLED | AES_ENABLED);
- dev_wlc_intvar_set(dev, "wsec", val);
- }
- val = 0;
- WL_INFORM("%s: %d: setting wpa_auth to %d\n",
- __func__, __LINE__, val);
- dev_wlc_intvar_set(dev, "wpa_auth", 0);
- return error;
- }
- break;
-
- case IW_AUTH_DROP_UNENCRYPTED:
- dev_wlc_bufvar_set(dev, "wsec_restrict", (char *)¶mval, 1);
- break;
-
- case IW_AUTH_RX_UNENCRYPTED_EAPOL:
- dev_wlc_bufvar_set(dev, "rx_unencrypted_eapol",
- (char *)¶mval, 1);
- break;
-
-#if WIRELESS_EXT > 17
- case IW_AUTH_ROAMING_CONTROL:
- WL_INFORM("%s: IW_AUTH_ROAMING_CONTROL\n", __func__);
- break;
- case IW_AUTH_PRIVACY_INVOKED:
- {
- int wsec;
-
- if (paramval == 0) {
- iw->privacy_invoked = false;
- error = dev_wlc_intvar_set(dev,
- "is_WPS_enrollee", false);
- if (error) {
- WL_WSEC("Failed to clear iovar is_WPS_enrollee\n");
- return error;
- }
- } else {
- iw->privacy_invoked = true;
- error = dev_wlc_intvar_get(dev, "wsec", &wsec);
- if (error)
- return error;
-
- if (!(IW_WSEC_ENABLED(wsec))) {
- error = dev_wlc_intvar_set(dev,
- "is_WPS_enrollee",
- true);
- if (error) {
- WL_WSEC("Failed to set iovar is_WPS_enrollee\n");
- return error;
- }
- } else {
- error = dev_wlc_intvar_set(dev,
- "is_WPS_enrollee",
- false);
- if (error) {
- WL_WSEC("Failed to clear is_WPS_enrollee\n");
- return error;
- }
- }
- }
- break;
- }
-#endif /* WIRELESS_EXT > 17 */
- default:
- break;
- }
- return 0;
-}
-
-#define VAL_PSK(_val) (((_val) & WPA_AUTH_PSK) || ((_val) & WPA2_AUTH_PSK))
-
-static int
-wl_iw_get_wpaauth(struct net_device *dev,
- struct iw_request_info *info,
- struct iw_param *vwrq, char *extra)
-{
- int error;
- int paramid;
- int paramval = 0;
- int val;
- wl_iw_t *iw = *(wl_iw_t **) netdev_priv(dev);
-
- WL_TRACE("%s: SIOCGIWAUTH\n", dev->name);
-
- paramid = vwrq->flags & IW_AUTH_INDEX;
-
- switch (paramid) {
- case IW_AUTH_WPA_VERSION:
- error = dev_wlc_intvar_get(dev, "wpa_auth", &val);
- if (error)
- return error;
- if (val & (WPA_AUTH_NONE | WPA_AUTH_DISABLED))
- paramval = IW_AUTH_WPA_VERSION_DISABLED;
- else if (val & (WPA_AUTH_PSK | WPA_AUTH_UNSPECIFIED))
- paramval = IW_AUTH_WPA_VERSION_WPA;
- else if (val & (WPA2_AUTH_PSK | WPA2_AUTH_UNSPECIFIED))
- paramval = IW_AUTH_WPA_VERSION_WPA2;
- break;
- case IW_AUTH_CIPHER_PAIRWISE:
- case IW_AUTH_CIPHER_GROUP:
- if (paramid == IW_AUTH_CIPHER_PAIRWISE)
- val = iw->pwsec;
- else
- val = iw->gwsec;
-
- paramval = 0;
- if (val) {
- if (val & WEP_ENABLED)
- paramval |=
- (IW_AUTH_CIPHER_WEP40 |
- IW_AUTH_CIPHER_WEP104);
- if (val & TKIP_ENABLED)
- paramval |= (IW_AUTH_CIPHER_TKIP);
- if (val & AES_ENABLED)
- paramval |= (IW_AUTH_CIPHER_CCMP);
- } else
- paramval = IW_AUTH_CIPHER_NONE;
- break;
- case IW_AUTH_KEY_MGMT:
- error = dev_wlc_intvar_get(dev, "wpa_auth", &val);
- if (error)
- return error;
- if (VAL_PSK(val))
- paramval = IW_AUTH_KEY_MGMT_PSK;
- else
- paramval = IW_AUTH_KEY_MGMT_802_1X;
-
- break;
- case IW_AUTH_TKIP_COUNTERMEASURES:
- dev_wlc_bufvar_get(dev, "tkip_countermeasures",
- (char *)¶mval, 1);
- break;
-
- case IW_AUTH_DROP_UNENCRYPTED:
- dev_wlc_bufvar_get(dev, "wsec_restrict", (char *)¶mval, 1);
- break;
-
- case IW_AUTH_RX_UNENCRYPTED_EAPOL:
- dev_wlc_bufvar_get(dev, "rx_unencrypted_eapol",
- (char *)¶mval, 1);
- break;
-
- case IW_AUTH_80211_AUTH_ALG:
- error = dev_wlc_intvar_get(dev, "auth", &val);
- if (error)
- return error;
- if (!val)
- paramval = IW_AUTH_ALG_OPEN_SYSTEM;
- else
- paramval = IW_AUTH_ALG_SHARED_KEY;
- break;
- case IW_AUTH_WPA_ENABLED:
- error = dev_wlc_intvar_get(dev, "wpa_auth", &val);
- if (error)
- return error;
- if (val)
- paramval = true;
- else
- paramval = false;
- break;
-#if WIRELESS_EXT > 17
- case IW_AUTH_ROAMING_CONTROL:
- WL_ERROR("%s: IW_AUTH_ROAMING_CONTROL\n", __func__);
- break;
- case IW_AUTH_PRIVACY_INVOKED:
- paramval = iw->privacy_invoked;
- break;
-
-#endif
- }
- vwrq->value = paramval;
- return 0;
-}
-#endif /* WIRELESS_EXT > 17 */
-
-static const iw_handler wl_iw_handler[] = {
- (iw_handler) wl_iw_config_commit,
- (iw_handler) wl_iw_get_name,
- (iw_handler) NULL,
- (iw_handler) NULL,
- (iw_handler) wl_iw_set_freq,
- (iw_handler) wl_iw_get_freq,
- (iw_handler) wl_iw_set_mode,
- (iw_handler) wl_iw_get_mode,
- (iw_handler) NULL,
- (iw_handler) NULL,
- (iw_handler) NULL,
- (iw_handler) wl_iw_get_range,
- (iw_handler) NULL,
- (iw_handler) NULL,
- (iw_handler) NULL,
- (iw_handler) NULL,
- (iw_handler) wl_iw_set_spy,
- (iw_handler) wl_iw_get_spy,
- (iw_handler) NULL,
- (iw_handler) NULL,
- (iw_handler) wl_iw_set_wap,
- (iw_handler) wl_iw_get_wap,
-#if WIRELESS_EXT > 17
- (iw_handler) wl_iw_mlme,
-#else
- (iw_handler) NULL,
-#endif
-#if defined(WL_IW_USE_ISCAN)
- (iw_handler) wl_iw_iscan_get_aplist,
-#else
- (iw_handler) wl_iw_get_aplist,
-#endif
-#if WIRELESS_EXT > 13
-#if defined(WL_IW_USE_ISCAN)
- (iw_handler) wl_iw_iscan_set_scan,
- (iw_handler) wl_iw_iscan_get_scan,
-#else
- (iw_handler) wl_iw_set_scan,
- (iw_handler) wl_iw_get_scan,
-#endif
-#else
- (iw_handler) NULL,
- (iw_handler) NULL,
-#endif /* WIRELESS_EXT > 13 */
- (iw_handler) wl_iw_set_essid,
- (iw_handler) wl_iw_get_essid,
- (iw_handler) wl_iw_set_nick,
- (iw_handler) wl_iw_get_nick,
- (iw_handler) NULL,
- (iw_handler) NULL,
- (iw_handler) wl_iw_set_rate,
- (iw_handler) wl_iw_get_rate,
- (iw_handler) wl_iw_set_rts,
- (iw_handler) wl_iw_get_rts,
- (iw_handler) wl_iw_set_frag,
- (iw_handler) wl_iw_get_frag,
- (iw_handler) wl_iw_set_txpow,
- (iw_handler) wl_iw_get_txpow,
-#if WIRELESS_EXT > 10
- (iw_handler) wl_iw_set_retry,
- (iw_handler) wl_iw_get_retry,
-#endif
- (iw_handler) wl_iw_set_encode,
- (iw_handler) wl_iw_get_encode,
- (iw_handler) wl_iw_set_power,
- (iw_handler) wl_iw_get_power,
-#if WIRELESS_EXT > 17
- (iw_handler) NULL,
- (iw_handler) NULL,
- (iw_handler) wl_iw_set_wpaie,
- (iw_handler) wl_iw_get_wpaie,
- (iw_handler) wl_iw_set_wpaauth,
- (iw_handler) wl_iw_get_wpaauth,
- (iw_handler) wl_iw_set_encodeext,
- (iw_handler) wl_iw_get_encodeext,
- (iw_handler) wl_iw_set_pmksa,
-#endif /* WIRELESS_EXT > 17 */
-};
-
-#if WIRELESS_EXT > 12
-
-const struct iw_handler_def wl_iw_handler_def = {
- .num_standard = ARRAY_SIZE(wl_iw_handler),
- .standard = (iw_handler *) wl_iw_handler,
- .num_private = 0,
- .num_private_args = 0,
- .private = 0,
- .private_args = 0,
-
-#if WIRELESS_EXT >= 19
- .get_wireless_stats = NULL,
-#endif
-};
-#endif /* WIRELESS_EXT > 12 */
-
-int wl_iw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
-{
- struct iwreq *wrq = (struct iwreq *)rq;
- struct iw_request_info info;
- iw_handler handler;
- char *extra = NULL;
- int token_size = 1, max_tokens = 0, ret = 0;
-
- WL_TRACE("\n%s, cmd:%x alled via dhd->do_ioctl()entry point\n",
- __func__, cmd);
- if (cmd < SIOCIWFIRST ||
- IW_IOCTL_IDX(cmd) >= ARRAY_SIZE(wl_iw_handler)) {
- WL_ERROR("%s: error in cmd=%x : out of range\n",
- __func__, cmd);
- return -EOPNOTSUPP;
- }
-
- handler = wl_iw_handler[IW_IOCTL_IDX(cmd)];
- if (!handler) {
- WL_ERROR("%s: error in cmd=%x : not supported\n",
- __func__, cmd);
- return -EOPNOTSUPP;
- }
-
- switch (cmd) {
-
- case SIOCSIWESSID:
- case SIOCGIWESSID:
- case SIOCSIWNICKN:
- case SIOCGIWNICKN:
- max_tokens = IW_ESSID_MAX_SIZE + 1;
- break;
-
- case SIOCSIWENCODE:
- case SIOCGIWENCODE:
-#if WIRELESS_EXT > 17
- case SIOCSIWENCODEEXT:
- case SIOCGIWENCODEEXT:
-#endif
- max_tokens = wrq->u.data.length;
- break;
-
- case SIOCGIWRANGE:
- max_tokens = sizeof(struct iw_range) + 500;
- break;
-
- case SIOCGIWAPLIST:
- token_size =
- sizeof(struct sockaddr) + sizeof(struct iw_quality);
- max_tokens = IW_MAX_AP;
- break;
-
-#if WIRELESS_EXT > 13
- case SIOCGIWSCAN:
-#if defined(WL_IW_USE_ISCAN)
- if (g_iscan)
- max_tokens = wrq->u.data.length;
- else
-#endif
- max_tokens = IW_SCAN_MAX_DATA;
- break;
-#endif /* WIRELESS_EXT > 13 */
-
- case SIOCSIWSPY:
- token_size = sizeof(struct sockaddr);
- max_tokens = IW_MAX_SPY;
- break;
-
- case SIOCGIWSPY:
- token_size =
- sizeof(struct sockaddr) + sizeof(struct iw_quality);
- max_tokens = IW_MAX_SPY;
- break;
-
-#if WIRELESS_EXT > 17
- case SIOCSIWPMKSA:
- case SIOCSIWGENIE:
-#endif
- case SIOCSIWPRIV:
- max_tokens = wrq->u.data.length;
- break;
- }
-
- if (max_tokens && wrq->u.data.pointer) {
- if (wrq->u.data.length > max_tokens) {
- WL_ERROR("%s: error in cmd=%x wrq->u.data.length=%d > max_tokens=%d\n",
- __func__, cmd, wrq->u.data.length, max_tokens);
- return -E2BIG;
- }
- extra = kmalloc(max_tokens * token_size, GFP_KERNEL);
- if (!extra)
- return -ENOMEM;
-
- if (copy_from_user
- (extra, wrq->u.data.pointer,
- wrq->u.data.length * token_size)) {
- kfree(extra);
- return -EFAULT;
- }
- }
-
- info.cmd = cmd;
- info.flags = 0;
-
- ret = handler(dev, &info, &wrq->u, extra);
-
- if (extra) {
- if (copy_to_user
- (wrq->u.data.pointer, extra,
- wrq->u.data.length * token_size)) {
- kfree(extra);
- return -EFAULT;
- }
-
- kfree(extra);
- }
-
- return ret;
-}
-
-bool
-wl_iw_conn_status_str(u32 event_type, u32 status, u32 reason,
- char *stringBuf, uint buflen)
-{
- typedef struct conn_fail_event_map_t {
- u32 inEvent;
- u32 inStatus;
- u32 inReason;
- const char *outName;
- const char *outCause;
- } conn_fail_event_map_t;
-
-#define WL_IW_DONT_CARE 9999
- const conn_fail_event_map_t event_map[] = {
- {WLC_E_SET_SSID, WLC_E_STATUS_SUCCESS, WL_IW_DONT_CARE,
- "Conn", "Success"},
- {WLC_E_SET_SSID, WLC_E_STATUS_NO_NETWORKS, WL_IW_DONT_CARE,
- "Conn", "NoNetworks"},
- {WLC_E_SET_SSID, WLC_E_STATUS_FAIL, WL_IW_DONT_CARE,
- "Conn", "ConfigMismatch"},
- {WLC_E_PRUNE, WL_IW_DONT_CARE, WLC_E_PRUNE_ENCR_MISMATCH,
- "Conn", "EncrypMismatch"},
- {WLC_E_PRUNE, WL_IW_DONT_CARE, WLC_E_RSN_MISMATCH,
- "Conn", "RsnMismatch"},
- {WLC_E_AUTH, WLC_E_STATUS_TIMEOUT, WL_IW_DONT_CARE,
- "Conn", "AuthTimeout"},
- {WLC_E_AUTH, WLC_E_STATUS_FAIL, WL_IW_DONT_CARE,
- "Conn", "AuthFail"},
- {WLC_E_AUTH, WLC_E_STATUS_NO_ACK, WL_IW_DONT_CARE,
- "Conn", "AuthNoAck"},
- {WLC_E_REASSOC, WLC_E_STATUS_FAIL, WL_IW_DONT_CARE,
- "Conn", "ReassocFail"},
- {WLC_E_REASSOC, WLC_E_STATUS_TIMEOUT, WL_IW_DONT_CARE,
- "Conn", "ReassocTimeout"},
- {WLC_E_REASSOC, WLC_E_STATUS_ABORT, WL_IW_DONT_CARE,
- "Conn", "ReassocAbort"},
- {WLC_E_PSK_SUP, WLC_SUP_KEYED, WL_IW_DONT_CARE,
- "Sup", "ConnSuccess"},
- {WLC_E_PSK_SUP, WL_IW_DONT_CARE, WL_IW_DONT_CARE,
- "Sup", "WpaHandshakeFail"},
- {WLC_E_DEAUTH_IND, WL_IW_DONT_CARE, WL_IW_DONT_CARE,
- "Conn", "Deauth"},
- {WLC_E_DISASSOC_IND, WL_IW_DONT_CARE, WL_IW_DONT_CARE,
- "Conn", "DisassocInd"},
- {WLC_E_DISASSOC, WL_IW_DONT_CARE, WL_IW_DONT_CARE,
- "Conn", "Disassoc"}
- };
-
- const char *name = "";
- const char *cause = NULL;
- int i;
-
- for (i = 0; i < sizeof(event_map) / sizeof(event_map[0]); i++) {
- const conn_fail_event_map_t *row = &event_map[i];
- if (row->inEvent == event_type &&
- (row->inStatus == status
- || row->inStatus == WL_IW_DONT_CARE)
- && (row->inReason == reason
- || row->inReason == WL_IW_DONT_CARE)) {
- name = row->outName;
- cause = row->outCause;
- break;
- }
- }
-
- if (cause) {
- memset(stringBuf, 0, buflen);
- snprintf(stringBuf, buflen, "%s %s %02d %02d",
- name, cause, status, reason);
- WL_INFORM("Connection status: %s\n", stringBuf);
- return true;
- } else {
- return false;
- }
-}
-
-#if WIRELESS_EXT > 14
-
-static bool
-wl_iw_check_conn_fail(wl_event_msg_t *e, char *stringBuf, uint buflen)
-{
- u32 event = be32_to_cpu(e->event_type);
- u32 status = be32_to_cpu(e->status);
- u32 reason = be32_to_cpu(e->reason);
-
- if (wl_iw_conn_status_str(event, status, reason, stringBuf, buflen)) {
- return true;
- } else
- return false;
-}
-#endif
-
-#ifndef IW_CUSTOM_MAX
-#define IW_CUSTOM_MAX 256
-#endif
-
-void wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void *data)
-{
-#if WIRELESS_EXT > 13
- union iwreq_data wrqu;
- char extra[IW_CUSTOM_MAX + 1];
- int cmd = 0;
- u32 event_type = be32_to_cpu(e->event_type);
- u16 flags = be16_to_cpu(e->flags);
- u32 datalen = be32_to_cpu(e->datalen);
- u32 status = be32_to_cpu(e->status);
- wl_iw_t *iw;
- u32 toto;
- memset(&wrqu, 0, sizeof(wrqu));
- memset(extra, 0, sizeof(extra));
- iw = 0;
-
- if (!dev) {
- WL_ERROR("%s: dev is null\n", __func__);
- return;
- }
-
- iw = *(wl_iw_t **) netdev_priv(dev);
-
- WL_TRACE("%s: dev=%s event=%d\n", __func__, dev->name, event_type);
-
- switch (event_type) {
- case WLC_E_TXFAIL:
- cmd = IWEVTXDROP;
- memcpy(wrqu.addr.sa_data, &e->addr, ETH_ALEN);
- wrqu.addr.sa_family = ARPHRD_ETHER;
- break;
-#if WIRELESS_EXT > 14
- case WLC_E_JOIN:
- case WLC_E_ASSOC_IND:
- case WLC_E_REASSOC_IND:
- memcpy(wrqu.addr.sa_data, &e->addr, ETH_ALEN);
- wrqu.addr.sa_family = ARPHRD_ETHER;
- cmd = IWEVREGISTERED;
- break;
- case WLC_E_DEAUTH_IND:
- case WLC_E_DISASSOC_IND:
- cmd = SIOCGIWAP;
- memset(wrqu.addr.sa_data, 0, ETH_ALEN);
- wrqu.addr.sa_family = ARPHRD_ETHER;
- memset(&extra, 0, ETH_ALEN);
- break;
- case WLC_E_LINK:
- case WLC_E_NDIS_LINK:
- cmd = SIOCGIWAP;
- if (!(flags & WLC_EVENT_MSG_LINK)) {
- memset(wrqu.addr.sa_data, 0, ETH_ALEN);
- memset(&extra, 0, ETH_ALEN);
- } else {
- memcpy(wrqu.addr.sa_data, &e->addr, ETH_ALEN);
- WL_TRACE("Link UP\n");
-
- }
- wrqu.addr.sa_family = ARPHRD_ETHER;
- break;
- case WLC_E_ACTION_FRAME:
- cmd = IWEVCUSTOM;
- if (datalen + 1 <= sizeof(extra)) {
- wrqu.data.length = datalen + 1;
- extra[0] = WLC_E_ACTION_FRAME;
- memcpy(&extra[1], data, datalen);
- WL_TRACE("WLC_E_ACTION_FRAME len %d\n",
- wrqu.data.length);
- }
- break;
-
- case WLC_E_ACTION_FRAME_COMPLETE:
- cmd = IWEVCUSTOM;
- memcpy(&toto, data, 4);
- if (sizeof(status) + 1 <= sizeof(extra)) {
- wrqu.data.length = sizeof(status) + 1;
- extra[0] = WLC_E_ACTION_FRAME_COMPLETE;
- memcpy(&extra[1], &status, sizeof(status));
- WL_TRACE("wl_iw_event status %d PacketId %d\n", status,
- toto);
- WL_TRACE("WLC_E_ACTION_FRAME_COMPLETE len %d\n",
- wrqu.data.length);
- }
- break;
-#endif /* WIRELESS_EXT > 14 */
-#if WIRELESS_EXT > 17
- case WLC_E_MIC_ERROR:
- {
- struct iw_michaelmicfailure *micerrevt =
- (struct iw_michaelmicfailure *)&extra;
- cmd = IWEVMICHAELMICFAILURE;
- wrqu.data.length = sizeof(struct iw_michaelmicfailure);
- if (flags & WLC_EVENT_MSG_GROUP)
- micerrevt->flags |= IW_MICFAILURE_GROUP;
- else
- micerrevt->flags |= IW_MICFAILURE_PAIRWISE;
- memcpy(micerrevt->src_addr.sa_data, &e->addr,
- ETH_ALEN);
- micerrevt->src_addr.sa_family = ARPHRD_ETHER;
-
- break;
- }
- case WLC_E_PMKID_CACHE:
- {
- if (data) {
- struct iw_pmkid_cand *iwpmkidcand =
- (struct iw_pmkid_cand *)&extra;
- pmkid_cand_list_t *pmkcandlist;
- pmkid_cand_t *pmkidcand;
- int count;
-
- cmd = IWEVPMKIDCAND;
- pmkcandlist = data;
- count = get_unaligned_be32(&pmkcandlist->
- npmkid_cand);
- ASSERT(count >= 0);
- wrqu.data.length = sizeof(struct iw_pmkid_cand);
- pmkidcand = pmkcandlist->pmkid_cand;
- while (count) {
- memset(iwpmkidcand, 0,
- sizeof(struct iw_pmkid_cand));
- if (pmkidcand->preauth)
- iwpmkidcand->flags |=
- IW_PMKID_CAND_PREAUTH;
- memcpy(&iwpmkidcand->bssid.sa_data,
- &pmkidcand->BSSID,
- ETH_ALEN);
-#ifndef SANDGATE2G
- wireless_send_event(dev, cmd, &wrqu,
- extra);
-#endif
- pmkidcand++;
- count--;
- }
- }
- return;
- }
-#endif /* WIRELESS_EXT > 17 */
-
- case WLC_E_SCAN_COMPLETE:
-#if defined(WL_IW_USE_ISCAN)
- if ((g_iscan) && (g_iscan->sysioc_tsk) &&
- (g_iscan->iscan_state != ISCAN_STATE_IDLE)) {
- up(&g_iscan->sysioc_sem);
- } else {
- cmd = SIOCGIWSCAN;
- wrqu.data.length = strlen(extra);
- WL_TRACE("Event WLC_E_SCAN_COMPLETE from specific scan %d\n",
- g_iscan->iscan_state);
- }
-#else
- cmd = SIOCGIWSCAN;
- wrqu.data.length = strlen(extra);
- WL_TRACE("Event WLC_E_SCAN_COMPLETE\n");
-#endif
- break;
-
- case WLC_E_PFN_NET_FOUND:
- {
- wlc_ssid_t *ssid;
- ssid = (wlc_ssid_t *) data;
- WL_ERROR("%s Event WLC_E_PFN_NET_FOUND, send %s up : find %s len=%d\n",
- __func__, PNO_EVENT_UP,
- ssid->SSID, ssid->SSID_len);
- cmd = IWEVCUSTOM;
- memset(&wrqu, 0, sizeof(wrqu));
- strcpy(extra, PNO_EVENT_UP);
- wrqu.data.length = strlen(extra);
- }
- break;
-
- default:
- WL_TRACE("Unknown Event %d: ignoring\n", event_type);
- break;
- }
-#ifndef SANDGATE2G
- if (cmd) {
- if (cmd == SIOCGIWSCAN)
- wireless_send_event(dev, cmd, &wrqu, NULL);
- else
- wireless_send_event(dev, cmd, &wrqu, extra);
- }
-#endif
-
-#if WIRELESS_EXT > 14
- memset(extra, 0, sizeof(extra));
- if (wl_iw_check_conn_fail(e, extra, sizeof(extra))) {
- cmd = IWEVCUSTOM;
- wrqu.data.length = strlen(extra);
-#ifndef SANDGATE2G
- wireless_send_event(dev, cmd, &wrqu, extra);
-#endif
- }
-#endif /* WIRELESS_EXT > 14 */
-#endif /* WIRELESS_EXT > 13 */
-}
-
-int wl_iw_attach(struct net_device *dev, void *dhdp)
-{
- int params_size;
- wl_iw_t *iw;
-#if defined(WL_IW_USE_ISCAN)
- iscan_info_t *iscan = NULL;
-
- if (!dev)
- return 0;
-
- memset(&g_wl_iw_params, 0, sizeof(wl_iw_extra_params_t));
-
-#ifdef CSCAN
- params_size =
- (WL_SCAN_PARAMS_FIXED_SIZE + offsetof(wl_iscan_params_t, params)) +
- (WL_NUMCHANNELS * sizeof(u16)) +
- WL_SCAN_PARAMS_SSID_MAX * sizeof(wlc_ssid_t);
-#else
- params_size =
- (WL_SCAN_PARAMS_FIXED_SIZE + offsetof(wl_iscan_params_t, params));
-#endif
- iscan = kzalloc(sizeof(iscan_info_t), GFP_KERNEL);
-
- if (!iscan)
- return -ENOMEM;
-
- iscan->iscan_ex_params_p = kmalloc(params_size, GFP_KERNEL);
- if (!iscan->iscan_ex_params_p) {
- kfree(iscan);
- return -ENOMEM;
- }
- iscan->iscan_ex_param_size = params_size;
- iscan->sysioc_tsk = NULL;
-
- g_iscan = iscan;
- iscan->dev = dev;
- iscan->iscan_state = ISCAN_STATE_IDLE;
-
- iscan->timer_ms = 3000;
- init_timer(&iscan->timer);
- iscan->timer.data = (unsigned long) iscan;
- iscan->timer.function = wl_iw_timerfunc;
-
- sema_init(&iscan->sysioc_sem, 0);
- iscan->sysioc_tsk = kthread_run(_iscan_sysioc_thread, iscan,
- "_iscan_sysioc");
- if (IS_ERR(iscan->sysioc_tsk)) {
- iscan->sysioc_tsk = NULL;
- return -ENOMEM;
- }
-#endif /* defined(WL_IW_USE_ISCAN) */
-
- iw = *(wl_iw_t **) netdev_priv(dev);
- iw->pub = (dhd_pub_t *) dhdp;
- MUTEX_LOCK_INIT(iw->pub);
- MUTEX_LOCK_WL_SCAN_SET_INIT();
-#ifdef SOFTAP
- priv_dev = dev;
- MUTEX_LOCK_SOFTAP_SET_INIT(iw->pub);
-#endif
- g_scan = kzalloc(G_SCAN_RESULTS, GFP_KERNEL);
- if (!g_scan)
- return -ENOMEM;
-
- g_scan_specified_ssid = 0;
-
- return 0;
-}
-
-void wl_iw_detach(void)
-{
-#if defined(WL_IW_USE_ISCAN)
- iscan_buf_t *buf;
- iscan_info_t *iscan = g_iscan;
-
- if (!iscan)
- return;
- if (iscan->sysioc_tsk) {
- send_sig(SIGTERM, iscan->sysioc_tsk, 1);
- kthread_stop(iscan->sysioc_tsk);
- iscan->sysioc_tsk = NULL;
- }
-
- MUTEX_LOCK_WL_SCAN_SET();
- while (iscan->list_hdr) {
- buf = iscan->list_hdr->next;
- kfree(iscan->list_hdr);
- iscan->list_hdr = buf;
- }
- MUTEX_UNLOCK_WL_SCAN_SET();
- kfree(iscan->iscan_ex_params_p);
- kfree(iscan);
- g_iscan = NULL;
-#endif /* WL_IW_USE_ISCAN */
-
- kfree(g_scan);
- g_scan = NULL;
-}
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_iw.h b/drivers/staging/brcm80211/brcmfmac/wl_iw.h
deleted file mode 100644
index bfd8172..0000000
--- a/drivers/staging/brcm80211/brcmfmac/wl_iw.h
+++ /dev/null
@@ -1,138 +0,0 @@
-/*
- * Copyright (c) 2010 Broadcom Corporation
- *
- * Permission to use, copy, modify, and/or distribute this software for any
- * purpose with or without fee is hereby granted, provided that the above
- * copyright notice and this permission notice appear in all copies.
- *
- * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
- * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
- * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
- * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
- * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
- * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
- * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
- */
-
-#ifndef _wl_iw_h_
-#define _wl_iw_h_
-
-#define WL_SCAN_PARAMS_SSID_MAX 10
-#define GET_SSID "SSID="
-#define GET_CHANNEL "CH="
-#define GET_NPROBE "NPROBE="
-#define GET_ACTIVE_ASSOC_DWELL "ACTIVE="
-#define GET_PASSIVE_ASSOC_DWELL "PASSIVE="
-#define GET_HOME_DWELL "HOME="
-#define GET_SCAN_TYPE "TYPE="
-
-#define BAND_GET_CMD "BANDGET"
-#define BAND_SET_CMD "BANDSET"
-#define DTIM_SKIP_GET_CMD "DTIMSKIPGET"
-#define DTIM_SKIP_SET_CMD "DTIMSKIPSET"
-#define SETSUSPEND_CMD "SETSUSPENDOPT"
-#define PNOSSIDCLR_SET_CMD "PNOSSIDCLR"
-#define PNOSETUP_SET_CMD "PNOSETUP"
-#define PNOENABLE_SET_CMD "PNOFORCE"
-#define PNODEBUG_SET_CMD "PNODEBUG"
-
-typedef struct wl_iw_extra_params {
- int target_channel;
-} wl_iw_extra_params_t;
-
-#define WL_IW_RSSI_MINVAL -200
-#define WL_IW_RSSI_NO_SIGNAL -91
-#define WL_IW_RSSI_VERY_LOW -80
-#define WL_IW_RSSI_LOW -70
-#define WL_IW_RSSI_GOOD -68
-#define WL_IW_RSSI_VERY_GOOD -58
-#define WL_IW_RSSI_EXCELLENT -57
-#define WL_IW_RSSI_INVALID 0
-#define MAX_WX_STRING 80
-#define WL_IW_SET_ACTIVE_SCAN (SIOCIWFIRSTPRIV+1)
-#define WL_IW_GET_RSSI (SIOCIWFIRSTPRIV+3)
-#define WL_IW_SET_PASSIVE_SCAN (SIOCIWFIRSTPRIV+5)
-#define WL_IW_GET_LINK_SPEED (SIOCIWFIRSTPRIV+7)
-#define WL_IW_GET_CURR_MACADDR (SIOCIWFIRSTPRIV+9)
-#define WL_IW_SET_STOP (SIOCIWFIRSTPRIV+11)
-#define WL_IW_SET_START (SIOCIWFIRSTPRIV+13)
-
-#define WL_SET_AP_CFG (SIOCIWFIRSTPRIV+15)
-#define WL_AP_STA_LIST (SIOCIWFIRSTPRIV+17)
-#define WL_AP_MAC_FLTR (SIOCIWFIRSTPRIV+19)
-#define WL_AP_BSS_START (SIOCIWFIRSTPRIV+21)
-#define AP_LPB_CMD (SIOCIWFIRSTPRIV+23)
-#define WL_AP_STOP (SIOCIWFIRSTPRIV+25)
-#define WL_FW_RELOAD (SIOCIWFIRSTPRIV+27)
-#define WL_COMBO_SCAN (SIOCIWFIRSTPRIV+29)
-#define WL_AP_SPARE3 (SIOCIWFIRSTPRIV+31)
-#define G_SCAN_RESULTS (8*1024)
-#define WE_ADD_EVENT_FIX 0x80
-#define G_WLAN_SET_ON 0
-#define G_WLAN_SET_OFF 1
-
-#define CHECK_EXTRA_FOR_NULL(extra) \
-if (!extra) { \
- WL_ERROR("%s: error : extra is null pointer\n", __func__); \
- return -EINVAL; \
-}
-
-typedef struct wl_iw {
- char nickname[IW_ESSID_MAX_SIZE];
-
- struct iw_statistics wstats;
-
- int spy_num;
- u32 pwsec;
- u32 gwsec;
- bool privacy_invoked;
-
- u8 spy_addr[IW_MAX_SPY][ETH_ALEN];
- struct iw_quality spy_qual[IW_MAX_SPY];
- void *wlinfo;
- dhd_pub_t *pub;
-} wl_iw_t;
-
-#if WIRELESS_EXT > 12
-#include <net/iw_handler.h>
-extern const struct iw_handler_def wl_iw_handler_def;
-#endif
-
-extern int wl_iw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
-extern void wl_iw_event(struct net_device *dev, wl_event_msg_t *e, void *data);
-extern int wl_iw_get_wireless_stats(struct net_device *dev,
- struct iw_statistics *wstats);
-int wl_iw_attach(struct net_device *dev, void *dhdp);
-void wl_iw_detach(void);
-extern int net_os_set_suspend_disable(struct net_device *dev, int val);
-extern int net_os_set_suspend(struct net_device *dev, int val);
-extern int net_os_set_dtim_skip(struct net_device *dev, int val);
-extern int net_os_set_packet_filter(struct net_device *dev, int val);
-
-#define IWE_STREAM_ADD_EVENT(info, stream, ends, iwe, extra) \
- iwe_stream_add_event(info, stream, ends, iwe, extra)
-#define IWE_STREAM_ADD_VALUE(info, event, value, ends, iwe, event_len) \
- iwe_stream_add_value(info, event, value, ends, iwe, event_len)
-#define IWE_STREAM_ADD_POINT(info, stream, ends, iwe, extra) \
- iwe_stream_add_point(info, stream, ends, iwe, extra)
-
-extern int dhd_pno_enable(dhd_pub_t *dhd, int pfn_enabled);
-extern int dhd_pno_clean(dhd_pub_t *dhd);
-extern int dhd_pno_set(dhd_pub_t *dhd, wlc_ssid_t *ssids_local, int nssid,
- unsigned char scan_fr);
-extern int dhd_pno_get_status(dhd_pub_t *dhd);
-extern int dhd_dev_pno_reset(struct net_device *dev);
-extern int dhd_dev_pno_set(struct net_device *dev, wlc_ssid_t *ssids_local,
- int nssid, unsigned char scan_fr);
-extern int dhd_dev_pno_enable(struct net_device *dev, int pfn_enabled);
-extern int dhd_dev_get_pno_status(struct net_device *dev);
-
-#define PNO_TLV_PREFIX 'S'
-#define PNO_TLV_VERSION 1
-#define PNO_TLV_SUBVERSION 0
-#define PNO_TLV_RESERVED 0
-#define PNO_TLV_TYPE_SSID_IE 'S'
-#define PNO_TLV_TYPE_TIME 'T'
-#define PNO_EVENT_UP "PNO_EVENT"
-
-#endif /* _wl_iw_h_ */
--
1.7.1
From: Henry Ptasinski <[email protected]>
Updated TODO file to reflect current driver state, results of recent
cleanup and fixes.
Signed-off-by: Henry Ptasinski <[email protected]>
---
drivers/staging/brcm80211/TODO | 12 +-----------
1 files changed, 1 insertions(+), 11 deletions(-)
diff --git a/drivers/staging/brcm80211/TODO b/drivers/staging/brcm80211/TODO
index 94c792b..e2e2ef9 100644
--- a/drivers/staging/brcm80211/TODO
+++ b/drivers/staging/brcm80211/TODO
@@ -4,19 +4,9 @@ Bugs
====
- none known at this moment
-brcmfmac and brcmsmac
-=====================
-- replace company specific acronym wlc_
-- Resolve all XXX, TODO, FIXME in code
-
brcmfmac
=====================
-- Remove unnecessary includes, move #includes from .h files into .c files.
-- Absorb and delete header files that are included in only one .c file
-- ASSERTS not allowed in mainline, replace by warning + error handling
-- Replace printk and WL_ERROR() with proper routines
-- Replace driver's proprietary ssb interface with generic kernel ssb module
-- Build and test on 64 bit linux kernel
+- ASSERTS deprecated in mainline, replace by warning + error handling
brcm80211 info page
=====================
--
1.7.1
From: Arend van Spriel <[email protected]>
In dhd.h the macro BCM_MSG_IFNAME_MAX was defined and used. As this
is used to carry the interface name we might as well use IFNAMSIZ
which results in the same size.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 4 +---
1 files changed, 1 insertions(+), 3 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 9b27982..55cbd8a 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -136,8 +136,6 @@ struct dhd_info;
#define DOT11_BSSTYPE_ANY 2
#define DOT11_MAX_DEFAULT_KEYS 4
-#define BCM_MSG_IFNAME_MAX 16
-
#define WLC_EVENT_MSG_LINK 0x01
#define WLC_EVENT_MSG_FLUSHTXQ 0x02
#define WLC_EVENT_MSG_GROUP 0x04
@@ -151,7 +149,7 @@ typedef struct {
u32 auth_type;
u32 datalen;
u8 addr[ETH_ALEN];
- char ifname[BCM_MSG_IFNAME_MAX];
+ char ifname[IFNAMSIZ];
} __attribute__((packed)) wl_event_msg_t;
typedef struct bcmeth_hdr {
--
1.7.1
From: Arend van Spriel <[email protected]>
The fullmac sources contained a lot of conditional code sections that
are never to be enabled for the fullmac driver. These have been removed.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdh.c | 9 -
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c | 101 ---------
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 135 +-----------
.../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c | 2 -
drivers/staging/brcm80211/brcmfmac/dhd.h | 6 -
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 4 -
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 200 -----------------
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 236 +-------------------
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 58 -----
9 files changed, 4 insertions(+), 747 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
index 72a91bd..c8e84d3 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh.c
@@ -44,15 +44,6 @@ struct brcmf_sdio {
/* local copy of bcm sd handler */
struct brcmf_sdio *l_bcmsdh;
-#if defined(OOB_INTR_ONLY) && defined(HW_OOB)
-extern int brcmf_sdioh_enable_hw_oob_intr(void *sdioh, bool enable);
-
-void brcmf_sdcard_enable_hw_oob_intr(struct brcmf_sdio *sdh, bool enable)
-{
- brcmf_sdioh_enable_hw_oob_intr(sdh->sdioh, enable);
-}
-#endif
-
struct brcmf_sdio *brcmf_sdcard_attach(void *cfghdl, void **regsva, uint irq)
{
struct brcmf_sdio *bcmsdh;
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
index 5194c59..c4b74ab 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
@@ -31,14 +31,7 @@
#include <brcmu_wifi.h>
#include "sdio_host.h"
-#if defined(OOB_INTR_ONLY)
-#include <linux/irq.h>
extern void brcmf_sdbrcm_isr(void *args);
-#endif /* defined(OOB_INTR_ONLY) */
-#if defined(CONFIG_MACH_SANDGATE2G) || defined(CONFIG_MACH_LOGICPD_PXA270)
-
-#include <linux/platform_device.h>
-#endif /* CONFIG_MACH_SANDGATE2G */
#include "dngl_stats.h"
#include "dhd.h"
@@ -56,9 +49,6 @@ struct bcmsdh_hc {
unsigned long oob_flags; /* OOB Host specifiction
as edge and etc */
bool oob_irq_registered;
-#if defined(OOB_INTR_ONLY)
- spinlock_t irq_lock;
-#endif
};
static struct bcmsdh_hc *sdhcinfo;
@@ -129,20 +119,6 @@ int brcmf_sdio_probe(struct device *dev)
u32 vendevid;
unsigned long irq_flags = 0;
-#if defined(OOB_INTR_ONLY)
-#ifdef HW_OOB
- irq_flags =
- IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL |
- IORESOURCE_IRQ_SHAREABLE;
-#else
- irq_flags = IRQF_TRIGGER_FALLING;
-#endif /* HW_OOB */
- irq = brcmf_customer_oob_irq_map(&irq_flags);
- if (irq < 0) {
- SDLX_MSG(("%s: Host irq is not defined\n", __func__));
- return 1;
- }
-#endif /* defined(OOB_INTR_ONLY) */
/* allocate SDIO Host Controller state info */
sdhc = kzalloc(sizeof(struct bcmsdh_hc), GFP_ATOMIC);
if (!sdhc) {
@@ -161,9 +137,6 @@ int brcmf_sdio_probe(struct device *dev)
sdhc->oob_irq = irq;
sdhc->oob_flags = irq_flags;
sdhc->oob_irq_registered = false; /* to make sure.. */
-#if defined(OOB_INTR_ONLY)
- spin_lock_init(&sdhc->irq_lock);
-#endif
/* chain SDIO Host Controller info together */
sdhc->next = sdhcinfo;
@@ -238,80 +211,6 @@ void brcmf_sdio_unregister(void)
brcmf_sdio_function_cleanup();
}
-#if defined(OOB_INTR_ONLY)
-void brcmf_sdio_oob_intr_set(bool enable)
-{
- static bool curstate = 1;
- unsigned long flags;
-
- spin_lock_irqsave(&sdhcinfo->irq_lock, flags);
- if (curstate != enable) {
- if (enable)
- enable_irq(sdhcinfo->oob_irq);
- else
- disable_irq_nosync(sdhcinfo->oob_irq);
- curstate = enable;
- }
- spin_unlock_irqrestore(&sdhcinfo->irq_lock, flags);
-}
-
-static irqreturn_t brcmf_sdio_oob_irq(int irq, void *dev_id)
-{
- dhd_pub_t *dhdp;
-
- dhdp = (dhd_pub_t *) dev_get_drvdata(sdhcinfo->dev);
-
- brcmf_sdio_oob_intr_set(0);
-
- if (dhdp == NULL) {
- SDLX_MSG(("Out of band GPIO interrupt fired way too early\n"));
- return IRQ_HANDLED;
- }
-
- brcmf_sdbrcm_isr((void *)dhdp->bus);
-
- return IRQ_HANDLED;
-}
-
-int brcmf_sdio_register_oob_intr(void *dhdp)
-{
- int error = 0;
-
- SDLX_MSG(("%s Enter\n", __func__));
-
- sdhcinfo->oob_flags =
- IORESOURCE_IRQ | IORESOURCE_IRQ_HIGHLEVEL |
- IORESOURCE_IRQ_SHAREABLE;
- dev_set_drvdata(sdhcinfo->dev, dhdp);
-
- if (!sdhcinfo->oob_irq_registered) {
- SDLX_MSG(("%s IRQ=%d Type=%X\n", __func__,
- (int)sdhcinfo->oob_irq, (int)sdhcinfo->oob_flags));
- /* Refer to customer Host IRQ docs about
- proper irqflags definition */
- error =
- request_irq(sdhcinfo->oob_irq, brcmf_sdio_oob_irq,
- sdhcinfo->oob_flags, "bcmsdh_sdmmc", NULL);
- if (error)
- return -ENODEV;
-
- irq_set_irq_wake(sdhcinfo->oob_irq, 1);
- sdhcinfo->oob_irq_registered = true;
- }
-
- return 0;
-}
-
-void brcmf_sdio_unregister_oob_intr(void)
-{
- SDLX_MSG(("%s: Enter\n", __func__));
-
- irq_set_irq_wake(sdhcinfo->oob_irq, 0);
- disable_irq(sdhcinfo->oob_irq); /* just in case.. */
- free_irq(sdhcinfo->oob_irq, NULL);
- sdhcinfo->oob_irq_registered = false;
-}
-#endif /* defined(OOB_INTR_ONLY) */
/* Module parameters specific to each host-controller driver */
extern uint sd_msglevel; /* Debug message level */
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index 335da48..c1de2cd 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -35,10 +35,8 @@
extern int brcmf_sdio_function_init(void);
extern void brcmf_sdio_function_cleanup(void);
-#if !defined(OOB_INTR_ONLY)
static void brcmf_sdioh_irqhandler(struct sdio_func *func);
static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func);
-#endif /* !defined(OOB_INTR_ONLY) */
static int brcmf_sdioh_get_cisaddr(struct sdioh_info *sd, u32 regaddr);
extern int brcmf_sdioh_reset_comm(struct mmc_card *card);
@@ -191,74 +189,6 @@ extern int brcmf_sdioh_detach(struct sdioh_info *sd)
return SDIOH_API_RC_SUCCESS;
}
-#if defined(OOB_INTR_ONLY) && defined(HW_OOB)
-
-extern int brcmf_sdioh_enable_func_intr(void)
-{
- u8 reg;
- int err;
-
- if (gInstance->func[0]) {
- sdio_claim_host(gInstance->func[0]);
-
- reg = sdio_readb(gInstance->func[0], SDIOD_CCCR_INTEN, &err);
- if (err) {
- sd_err(("%s: error for read SDIO_CCCR_IENx : 0x%x\n",
- __func__, err));
- sdio_release_host(gInstance->func[0]);
- return SDIOH_API_RC_FAIL;
- }
-
- /* Enable F1 and F2 interrupts, set master enable */
- reg |=
- (INTR_CTL_FUNC1_EN | INTR_CTL_FUNC2_EN |
- INTR_CTL_MASTER_EN);
-
- sdio_writeb(gInstance->func[0], reg, SDIOD_CCCR_INTEN, &err);
- sdio_release_host(gInstance->func[0]);
-
- if (err) {
- sd_err(("%s: error for write SDIO_CCCR_IENx : 0x%x\n",
- __func__, err));
- return SDIOH_API_RC_FAIL;
- }
- }
-
- return SDIOH_API_RC_SUCCESS;
-}
-
-extern int brcmf_sdioh_disable_func_intr(void)
-{
- u8 reg;
- int err;
-
- if (gInstance->func[0]) {
- sdio_claim_host(gInstance->func[0]);
- reg = sdio_readb(gInstance->func[0], SDIOD_CCCR_INTEN, &err);
- if (err) {
- sd_err(("%s: error for read SDIO_CCCR_IENx : 0x%x\n",
- __func__, err));
- sdio_release_host(gInstance->func[0]);
- return SDIOH_API_RC_FAIL;
- }
-
- reg &= ~(INTR_CTL_FUNC1_EN | INTR_CTL_FUNC2_EN);
- /* Disable master interrupt with the last function interrupt */
- if (!(reg & 0xFE))
- reg = 0;
- sdio_writeb(gInstance->func[0], reg, SDIOD_CCCR_INTEN, &err);
-
- sdio_release_host(gInstance->func[0]);
- if (err) {
- sd_err(("%s: error for write SDIO_CCCR_IENx : 0x%x\n",
- __func__, err));
- return SDIOH_API_RC_FAIL;
- }
- }
- return SDIOH_API_RC_SUCCESS;
-}
-#endif /* defined(OOB_INTR_ONLY) && defined(HW_OOB) */
-
/* Configure callback to client when we receive client interrupt */
extern int
brcmf_sdioh_interrupt_register(struct sdioh_info *sd, sdioh_cb_fn_t fn,
@@ -270,7 +200,7 @@ brcmf_sdioh_interrupt_register(struct sdioh_info *sd, sdioh_cb_fn_t fn,
__func__));
return SDIOH_API_RC_FAIL;
}
-#if !defined(OOB_INTR_ONLY)
+
sd->intr_handler = fn;
sd->intr_handler_arg = argh;
sd->intr_handler_valid = true;
@@ -287,9 +217,7 @@ brcmf_sdioh_interrupt_register(struct sdioh_info *sd, sdioh_cb_fn_t fn,
sdio_claim_irq(gInstance->func[1], brcmf_sdioh_irqhandler);
sdio_release_host(gInstance->func[1]);
}
-#elif defined(HW_OOB)
- brcmf_sdioh_enable_func_intr();
-#endif /* defined(OOB_INTR_ONLY) */
+
return SDIOH_API_RC_SUCCESS;
}
@@ -297,7 +225,6 @@ extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd)
{
sd_trace(("%s: Entering\n", __func__));
-#if !defined(OOB_INTR_ONLY)
if (gInstance->func[1]) {
/* register and unmask irq */
sdio_claim_host(gInstance->func[1]);
@@ -316,9 +243,7 @@ extern int brcmf_sdioh_interrupt_deregister(struct sdioh_info *sd)
sd->intr_handler_valid = false;
sd->intr_handler = NULL;
sd->intr_handler_arg = NULL;
-#elif defined(HW_OOB)
- brcmf_sdioh_disable_func_intr();
-#endif /* !defined(OOB_INTR_ONLY) */
+
return SDIOH_API_RC_SUCCESS;
}
@@ -536,24 +461,6 @@ exit:
return bcmerror;
}
-#if defined(OOB_INTR_ONLY) && defined(HW_OOB)
-
-int brcmf_sdioh_enable_hw_oob_intr(struct sdioh_info *sd, bool enable)
-{
- int status;
- u8 data;
-
- if (enable)
- data = 3; /* enable hw oob interrupt */
- else
- data = 4; /* disable hw oob interrupt */
- data |= 4; /* Active HIGH */
-
- status = brcmf_sdioh_request_byte(sd, SDIOH_WRITE, 0, 0xf2, &data);
- return status;
-}
-#endif /* defined(OOB_INTR_ONLY) && defined(HW_OOB) */
-
extern int
brcmf_sdioh_cfg_read(struct sdioh_info *sd, uint fnc_num, u32 addr, u8 *data)
{
@@ -800,13 +707,6 @@ brcmf_sdioh_request_packet(struct sdioh_info *sd, uint fix_inc, uint write,
pkt_len += 3;
pkt_len &= 0xFFFFFFFC;
-#ifdef CONFIG_MMC_MSM7X00A
- if ((pkt_len % 64) == 32) {
- sd_trace(("%s: Rounding up TX packet +=32\n",
- __func__));
- pkt_len += 32;
- }
-#endif /* CONFIG_MMC_MSM7X00A */
/* Make sure the packet is aligned properly.
* If it isn't, then this
* is the fault of brcmf_sdioh_request_buffer() which
@@ -1007,7 +907,6 @@ brcmf_sdioh_card_regread(struct sdioh_info *sd, int func, u32 regaddr,
return SUCCESS;
}
-#if !defined(OOB_INTR_ONLY)
/* bcmsdh_sdmmc interrupt handler */
static void brcmf_sdioh_irqhandler(struct sdio_func *func)
{
@@ -1045,34 +944,6 @@ static void brcmf_sdioh_irqhandler_f2(struct sdio_func *func)
ASSERT(sd != NULL);
}
-#endif /* !defined(OOB_INTR_ONLY) */
-
-#ifdef NOTUSED
-/* Write client card reg */
-static int
-brcmf_sdioh_card_regwrite(struct sdioh_info *sd, int func, u32 regaddr,
- int regsize, u32 data)
-{
-
- if ((func == 0) || (regsize == 1)) {
- u8 temp;
-
- temp = data & 0xff;
- brcmf_sdioh_request_byte(sd, SDIOH_READ, func, regaddr, &temp);
- sd_data(("%s: byte write data=0x%02x\n", __func__, data));
- } else {
- if (regsize == 2)
- data &= 0xffff;
-
- brcmf_sdioh_request_word(sd, 0, SDIOH_READ, func, regaddr,
- &data, regsize);
-
- sd_data(("%s: word write data=0x%08x\n", __func__, data));
- }
-
- return SUCCESS;
-}
-#endif /* NOTUSED */
int brcmf_sdioh_start(struct sdioh_info *si, int stage)
{
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
index c95112e..6abd9c0 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
@@ -182,13 +182,11 @@ int brcmf_sdioh_interrupt_set(struct sdioh_info *sd, bool enable)
sdos = (struct sdos_info *)sd->sdos_info;
ASSERT(sdos);
-#if !defined(OOB_INTR_ONLY)
if (enable && !(sd->intr_handler && sd->intr_handler_arg)) {
sd_err(("%s: no handler registered, will not enable\n",
__func__));
return SDIOH_API_RC_FAIL;
}
-#endif /* !defined(OOB_INTR_ONLY) */
/* Ensure atomicity for enable/disable calls */
spin_lock_irqsave(&sdos->lock, flags);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index b7ed29c..87c65f1 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -691,9 +691,6 @@ typedef struct dhd_pub {
int suspend_disable_flag; /* "1" to disable all extra powersaving
during suspend */
int in_suspend; /* flag set to 1 when early suspend called */
-#ifdef PNO_SUPPORT
- int pno_enable; /* pno status : "1" is pno enable */
-#endif /* PNO_SUPPORT */
int dtim_skip; /* dtim skip , default 0 means wake each dtim */
/* Pkt filter defination */
@@ -936,9 +933,6 @@ extern void brcmf_os_sdunlock_eventq(dhd_pub_t *pub);
#ifdef BCMDBG
extern int brcmf_write_to_file(dhd_pub_t *dhd, u8 *buf, int size);
#endif /* BCMDBG */
-#if defined(OOB_INTR_ONLY)
-extern int brcmf_customer_oob_irq_map(unsigned long *irq_flags_ptr);
-#endif /* defined(OOB_INTR_ONLY) */
extern void brcmf_timeout_start(dhd_timeout_t *tmo, uint usec);
extern int brcmf_timeout_expired(dhd_timeout_t *tmo);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index a766707..471869f 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -80,10 +80,6 @@ struct brcmf_proto_bdc_header {
};
-#ifdef CUSTOMER_HW2
-int wifi_get_mac_addr(unsigned char *buf);
-#endif
-
#define RETRIES 2 /* # of retries to retrieve matching ioctl response */
#define BUS_HEADER_LEN (16+BRCMF_SDALIGN) /* Must be atleast SDPCM_RESERVE
* defined in dhd_sdio.c
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 6c41088..22739f0 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -872,11 +872,6 @@ brcmf_c_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
brcmf_event(dhd, (char *)pvt_data, evlen, *ifidx);
break;
-#ifdef P2P
- case BRCMF_E_NDIS_LINK:
- break;
-#endif
- /* fall through */
/* These are what external supplicant/authenticator wants */
case BRCMF_E_LINK:
case BRCMF_E_ASSOC_IND:
@@ -1191,35 +1186,9 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
int scan_assoc_time = 40;
int scan_unassoc_time = 40;
int i;
-#ifdef GET_CUSTOM_MAC_ENABLE
- int ret = 0;
- u8 ea_addr[ETH_ALEN];
-#endif /* GET_CUSTOM_MAC_ENABLE */
brcmf_os_proto_block(dhd);
-#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 = brcmf_custom_get_mac_address(ea_addr);
- if (!ret) {
- brcmu_mkiovar("cur_etheraddr", (void *)ea_addr, ETH_ALEN,
- buf, sizeof(buf));
- ret = brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
- buf, sizeof(buf));
- if (ret < 0) {
- DHD_ERROR(("%s: can't set MAC address , error=%d\n",
- __func__, ret));
- } else
- memcpy(dhd->mac.octet, (void *)&ea_addr,
- ETH_ALEN);
- }
-#endif /* GET_CUSTOM_MAC_ENABLE */
-
/* Set Country code */
if (dhd->country_code[0] != 0) {
if (brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_COUNTRY,
@@ -1305,172 +1274,3 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
return 0;
}
-
-#ifdef PNO_SUPPORT
-int dhd_pno_clean(dhd_pub_t *dhd)
-{
- char iovbuf[128];
- int pfn_enabled = 0;
- int iov_len = 0;
- int ret;
-
- /* Disable pfn */
- iov_len = brcmu_mkiovar("pfn", (char *)&pfn_enabled, 4, iovbuf,
- sizeof(iovbuf));
- ret = brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
- sizeof(iovbuf));
- if (ret >= 0) {
- /* clear pfn */
- iov_len = brcmu_mkiovar("pfnclear", 0, 0, iovbuf,
- sizeof(iovbuf));
- if (iov_len) {
- ret = brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
- iovbuf, iov_len);
- if (ret < 0) {
- DHD_ERROR(("%s failed code %d\n", __func__,
- ret));
- }
- } else {
- ret = -1;
- DHD_ERROR(("%s failed code %d\n", __func__, iov_len));
- }
- } else
- DHD_ERROR(("%s failed code %d\n", __func__, ret));
-
- return ret;
-}
-
-int dhd_pno_enable(dhd_pub_t *dhd, int pfn_enabled)
-{
- char iovbuf[128];
- int ret = -1;
-
- if ((!dhd) && ((pfn_enabled != 0) || (pfn_enabled != 1))) {
- DHD_ERROR(("%s error exit\n", __func__));
- return ret;
- }
-
- /* Enable/disable PNO */
- ret = brcmu_mkiovar("pfn", (char *)&pfn_enabled, 4, iovbuf,
- sizeof(iovbuf));
- if (ret > 0) {
- ret = brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
- sizeof(iovbuf));
- if (ret < 0) {
- DHD_ERROR(("%s failed for error=%d\n", __func__, ret));
- return ret;
- } else {
- dhd->pno_enable = pfn_enabled;
- DHD_TRACE(("%s set pno as %d\n", __func__,
- dhd->pno_enable));
- }
- } else
- DHD_ERROR(("%s failed err=%d\n", __func__, ret));
-
- return ret;
-}
-
-/* Function to execute combined scan */
-int
-dhd_pno_set(dhd_pub_t *dhd, wlc_ssid_t *ssids_local, int nssid, unsigned char scan_fr)
-{
- int err = -1;
- char iovbuf[128];
- int k, i;
- wl_pfn_param_t pfn_param;
- wl_pfn_t pfn_element;
-
- DHD_TRACE(("%s nssid=%d nchan=%d\n", __func__, nssid, scan_fr));
-
- if ((!dhd) && (!ssids_local)) {
- DHD_ERROR(("%s error exit\n", __func__));
- err = -1;
- }
-
- /* Check for broadcast ssid */
- for (k = 0; k < nssid; k++) {
- if (!ssids_local[k].SSID_len) {
- DHD_ERROR(("%d: Broadcast SSID is ilegal for PNO "
- "setting\n", k));
- return err;
- }
- }
-/* #define PNO_DUMP 1 */
-#ifdef PNO_DUMP
- {
- int j;
- for (j = 0; j < nssid; j++) {
- DHD_ERROR(("%d: scan for %s size =%d\n", j,
- ssids_local[j].SSID,
- ssids_local[j].SSID_len));
- }
- }
-#endif /* PNO_DUMP */
-
- /* clean up everything */
- err = dhd_pno_clean(dhd);
- if (err < 0) {
- DHD_ERROR(("%s failed error=%d\n", __func__, err));
- return err;
- }
- memset(&pfn_param, 0, sizeof(pfn_param));
- memset(&pfn_element, 0, sizeof(pfn_element));
-
- /* set pfn parameters */
- pfn_param.version = PFN_VERSION;
- pfn_param.flags = (PFN_LIST_ORDER << SORT_CRITERIA_BIT);
-
- /* set up pno scan fr */
- if (scan_fr != 0)
- pfn_param.scan_freq = scan_fr;
-
- brcmu_mkiovar("pfn_set", (char *)&pfn_param, sizeof(pfn_param), iovbuf,
- sizeof(iovbuf));
- brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
- sizeof(iovbuf));
-
- /* set all pfn ssid */
- for (i = 0; i < nssid; i++) {
-
- pfn_element.bss_type = DOT11_BSSTYPE_INFRASTRUCTURE;
- pfn_element.auth = WLAN_AUTH_OPEN;
- pfn_element.wpa_auth = WPA_AUTH_PFN_ANY;
- pfn_element.wsec = 0;
- pfn_element.infra = 1;
-
- memcpy((char *)pfn_element.ssid.SSID, ssids_local[i].SSID,
- ssids_local[i].SSID_len);
- pfn_element.ssid.SSID_len = ssids_local[i].SSID_len;
-
- err = brcmu_mkiovar("pfn_add", (char *)&pfn_element,
- sizeof(pfn_element), iovbuf, sizeof(iovbuf));
- if (err > 0) {
- err = brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
- iovbuf, sizeof(iovbuf));
- if (err < 0) {
- DHD_ERROR(("%s failed for i=%d error=%d\n",
- __func__, i, err));
- return err;
- }
- } else
- DHD_ERROR(("%s failed err=%d\n", __func__, err));
- }
-
- /* Enable PNO */
- /* dhd_pno_enable(dhd, 1); */
- return err;
-}
-
-int dhd_pno_get_status(dhd_pub_t *dhd)
-{
- int ret = -1;
-
- if (!dhd)
- return ret;
- else
- return dhd->pno_enable;
-}
-
-#endif /* PNO_SUPPORT */
-
-/* Androd ComboSCAN support */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 5a0bcb2..5327941 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -14,9 +14,6 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
-#ifdef CONFIG_WIFI_CONTROL_FUNC
-#include <linux/platform_device.h>
-#endif
#include <linux/init.h>
#include <linux/kernel.h>
#include <linux/kthread.h>
@@ -52,135 +49,12 @@
/* Global ASSERT type flag */
u32 g_assert_type;
-#if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC)
-#include <linux/wifi_tiwlan.h>
-
-struct semaphore wifi_control_sem;
-
-struct dhd_bus *g_bus;
-
-static struct wifi_platform_data *wifi_control_data;
-static struct resource *wifi_irqres;
-
-int wifi_get_irq_number(unsigned long *irq_flags_ptr)
-{
- if (wifi_irqres) {
- *irq_flags_ptr = wifi_irqres->flags & IRQF_TRIGGER_MASK;
- return (int)wifi_irqres->start;
- }
-#ifdef CUSTOM_OOB_GPIO_NUM
- return CUSTOM_OOB_GPIO_NUM;
-#else
- return -1;
-#endif
-}
-
-int wifi_set_carddetect(int on)
-{
- printk(KERN_ERR "%s = %d\n", __func__, on);
- if (wifi_control_data && wifi_control_data->set_carddetect)
- wifi_control_data->set_carddetect(on);
- return 0;
-}
-
-int wifi_set_power(int on, unsigned long msec)
-{
- printk(KERN_ERR "%s = %d\n", __func__, on);
- if (wifi_control_data && wifi_control_data->set_power)
- wifi_control_data->set_power(on);
- if (msec)
- mdelay(msec);
- return 0;
-}
-
-int wifi_set_reset(int on, unsigned long msec)
-{
- printk(KERN_ERR "%s = %d\n", __func__, on);
- if (wifi_control_data && wifi_control_data->set_reset)
- wifi_control_data->set_reset(on);
- if (msec)
- mdelay(msec);
- return 0;
-}
-
-static int wifi_probe(struct platform_device *pdev)
-{
- struct wifi_platform_data *wifi_ctrl =
- (struct wifi_platform_data *)(pdev->dev.platform_data);
-
- printk(KERN_ERR "## %s\n", __func__);
- wifi_irqres =
- platform_get_resource_byname(pdev, IORESOURCE_IRQ,
- "bcm4329_wlan_irq");
- wifi_control_data = wifi_ctrl;
-
- wifi_set_power(1, 0); /* Power On */
- wifi_set_carddetect(1); /* CardDetect (0->1) */
-
- up(&wifi_control_sem);
- return 0;
-}
-
-static int wifi_remove(struct platform_device *pdev)
-{
- struct wifi_platform_data *wifi_ctrl =
- (struct wifi_platform_data *)(pdev->dev.platform_data);
-
- printk(KERN_ERR "## %s\n", __func__);
- wifi_control_data = wifi_ctrl;
-
- wifi_set_carddetect(0); /* CardDetect (1->0) */
- wifi_set_power(0, 0); /* Power Off */
-
- up(&wifi_control_sem);
- return 0;
-}
-
-static int wifi_suspend(struct platform_device *pdev, pm_message_t state)
-{
- DHD_TRACE(("##> %s\n", __func__));
- return 0;
-}
-
-static int wifi_resume(struct platform_device *pdev)
-{
- DHD_TRACE(("##> %s\n", __func__));
- return 0;
-}
-
-static struct platform_driver wifi_device = {
- .probe = wifi_probe,
- .remove = wifi_remove,
- .suspend = wifi_suspend,
- .resume = wifi_resume,
- .driver = {
- .name = KBUILD_MODNAME,
- }
-};
-
-int wifi_add_dev(void)
-{
- DHD_TRACE(("## Calling platform_driver_register\n"));
- return platform_driver_register(&wifi_device);
-}
-
-void wifi_del_dev(void)
-{
- DHD_TRACE(("## Unregister platform_driver_register\n"));
- platform_driver_unregister(&wifi_device);
-}
-#endif /* defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC) */
-
#if defined(CONFIG_PM_SLEEP)
#include <linux/suspend.h>
atomic_t brcmf_mmc_suspend;
DECLARE_WAIT_QUEUE_HEAD(dhd_dpc_wait);
#endif /* defined(CONFIG_PM_SLEEP) */
-#if defined(OOB_INTR_ONLY)
-extern void brcmf_sdbrcm_enable_oob_intr(struct dhd_bus *bus, bool enable);
-#endif /* defined(OOB_INTR_ONLY) */
-
MODULE_AUTHOR("Broadcom Corporation");
MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN fullmac driver.");
MODULE_SUPPORTED_DEVICE("Broadcom 802.11n WLAN fullmac cards");
@@ -302,11 +176,7 @@ extern int brcmf_dongle_memsize;
module_param(brcmf_dongle_memsize, int, 0);
/* Contorl fw roaming */
-#ifdef CUSTOMER_HW2
-uint brcmf_roam;
-#else
uint brcmf_roam = 1;
-#endif
/* Control radio state */
uint brcmf_radio_up = 1;
@@ -392,9 +262,6 @@ static int brcmf_set_suspend(int value, dhd_pub_t *dhd)
/* wl_pkt_filter_enable_t enable_parm; */
char iovbuf[32];
int bcn_li_dtim = 3;
-#ifdef CUSTOMER_HW2
- uint roamvar = 1;
-#endif /* CUSTOMER_HW2 */
DHD_TRACE(("%s: enter, value = %d in_suspend=%d\n",
__func__, value, dhd->in_suspend));
@@ -428,15 +295,6 @@ static int brcmf_set_suspend(int value, dhd_pub_t *dhd)
4, iovbuf, sizeof(iovbuf));
brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
iovbuf, sizeof(iovbuf));
-#ifdef CUSTOMER_HW2
- /* Disable build-in roaming to allowed \
- * supplicant to take of romaing
- */
- brcmu_mkiovar("roam_off", (char *)&roamvar, 4,
- iovbuf, sizeof(iovbuf));
- brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
- iovbuf, sizeof(iovbuf));
-#endif /* CUSTOMER_HW2 */
} else {
/* Kernel resumed */
@@ -457,13 +315,6 @@ static int brcmf_set_suspend(int value, dhd_pub_t *dhd)
brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
iovbuf, sizeof(iovbuf));
-#ifdef CUSTOMER_HW2
- roamvar = 0;
- brcmu_mkiovar("roam_off", (char *)&roamvar, 4, iovbuf,
- sizeof(iovbuf));
- brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
- iovbuf, sizeof(iovbuf));
-#endif /* CUSTOMER_HW2 */
}
}
@@ -950,7 +801,6 @@ static void brcmf_netdev_set_multicast_list(struct net_device *dev)
int brcmf_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf)
{
- int ret;
dhd_info_t *dhd = (dhd_info_t *) (dhdp->info);
/* Reject if down */
@@ -972,13 +822,7 @@ int brcmf_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf)
brcmf_proto_hdrpush(dhdp, ifidx, pktbuf);
/* Use bus module to send data frame */
-#ifdef BCMDBUS
- ret = dbus_send_pkt(dhdp->dbus, pktbuf, NULL /* pktinfo */);
-#else
- ret = brcmf_sdbrcm_bus_txdata(dhdp->bus, pktbuf);
-#endif /* BCMDBUS */
-
- return ret;
+ return brcmf_sdbrcm_bus_txdata(dhdp->bus, pktbuf);
}
static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *net)
@@ -1945,18 +1789,6 @@ int brcmf_bus_start(dhd_pub_t *dhdp)
ret));
return ret;
}
-#if defined(OOB_INTR_ONLY)
- /* Host registration for OOB interrupt */
- if (brcmf_sdio_register_oob_intr(dhdp)) {
- del_timer_sync(&dhd->timer);
- dhd->wd_timer_valid = false;
- DHD_ERROR(("%s Host failed to resgister for OOB\n", __func__));
- return -ENODEV;
- }
-
- /* Enable oob at firmware */
- brcmf_sdbrcm_enable_oob_intr(dhd->pub.bus, true);
-#endif /* defined(OOB_INTR_ONLY) */
/* If bus is not ready, can't come up */
if (dhd->pub.busstate != DHD_BUS_DATA) {
@@ -1990,9 +1822,6 @@ int brcmf_bus_start(dhd_pub_t *dhdp)
setbit(dhdp->eventmask, BRCMF_E_TXFAIL);
setbit(dhdp->eventmask, BRCMF_E_JOIN_START);
setbit(dhdp->eventmask, BRCMF_E_SCAN_COMPLETE);
-#ifdef PNO_SUPPORT
- setbit(dhdp->eventmask, BRCMF_E_PFN_NET_FOUND);
-#endif /* PNO_SUPPORT */
/* enable dongle roaming event */
@@ -2111,9 +1940,6 @@ static void brcmf_bus_detach(dhd_pub_t *dhdp)
/* Stop the bus module */
brcmf_sdbrcm_bus_stop(dhd->pub.bus, true);
-#if defined(OOB_INTR_ONLY)
- brcmf_sdio_unregister_oob_intr();
-#endif /* defined(OOB_INTR_ONLY) */
/* Clear the watchdog timer */
del_timer_sync(&dhd->timer);
@@ -2189,9 +2015,6 @@ static void __exit brcmf_module_cleanup(void)
DHD_TRACE(("%s: Enter\n", __func__));
dhd_bus_unregister();
-#if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC)
- wifi_del_dev();
-#endif
}
static int __init brcmf_module_init(void)
@@ -2215,26 +2038,6 @@ static int __init brcmf_module_init(void)
return -EINVAL;
} while (0);
-#if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC)
- sema_init(&wifi_control_sem, 0);
-
- error = wifi_add_dev();
- if (error) {
- DHD_ERROR(("%s: platform_driver_register failed\n", __func__));
- goto failed;
- }
-
- /* Waiting callback after platform_driver_register is done or
- exit with error */
- if (down_timeout(&wifi_control_sem, msecs_to_jiffies(1000)) != 0) {
- printk(KERN_ERR "%s: platform_driver_register timeout\n",
- __func__);
- /* remove device */
- wifi_del_dev();
- goto failed;
- }
-#endif /* #if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC) */
-
error = dhd_bus_register();
if (error) {
@@ -2556,43 +2359,6 @@ void brcmf_netdev_init_ioctl(struct net_device *dev)
brcmf_c_preinit_ioctls(&dhd->pub);
}
-#ifdef PNO_SUPPORT
-/* Linux wrapper to call common dhd_pno_clean */
-int brcmf_netdev_pno_reset(struct net_device *dev)
-{
- dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
-
- return dhd_pno_clean(&dhd->pub);
-}
-
-/* Linux wrapper to call common dhd_pno_enable */
-int brcmf_netdev_pno_enable(struct net_device *dev, int pfn_enabled)
-{
- dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
-
- return dhd_pno_enable(&dhd->pub, pfn_enabled);
-}
-
-/* Linux wrapper to call common dhd_pno_set */
-int
-brcmf_netdev_pno_set(struct net_device *dev, wlc_ssid_t *ssids_local, int nssid,
- unsigned char scan_fr)
-{
- dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
-
- return dhd_pno_set(&dhd->pub, ssids_local, nssid, scan_fr);
-}
-
-/* Linux wrapper to get pno status */
-int brcmf_netdev_get_pno_status(struct net_device *dev)
-{
- dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
-
- return dhd_pno_get_status(&dhd->pub);
-}
-
-#endif /* PNO_SUPPORT */
-
static int brcmf_get_pend_8021x_cnt(dhd_info_t *dhd)
{
return atomic_read(&dhd->pend_8021x_cnt);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 54a0e80..a97fd7c 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -673,13 +673,6 @@ static bool forcealign;
#define ALIGNMENT 4
-#if defined(OOB_INTR_ONLY) && defined(HW_OOB)
-extern void brcmf_sdcard_enable_hw_oob_intr(void *sdh, bool enable);
-#endif
-
-#if defined(OOB_INTR_ONLY) && defined(SDIO_ISR_THREAD)
-#error OOB_INTR_ONLY is NOT working with SDIO_ISR_THREAD
-#endif /* defined(OOB_INTR_ONLY) && defined(SDIO_ISR_THREAD) */
#define PKTALIGN(_p, _len, _align) \
do { \
uint datalign; \
@@ -831,9 +824,6 @@ static int brcmf_sdbrcm_htclk(dhd_bus_t *bus, bool on, bool pendok)
DHD_TRACE(("%s: Enter\n", __func__));
-#if defined(OOB_INTR_ONLY)
- pendok = false;
-#endif
clkctl = 0;
sdh = bus->sdh;
@@ -1116,36 +1106,6 @@ int brcmf_sdbrcm_bussleep(dhd_bus_t *bus, bool sleep)
return 0;
}
-#if defined(OOB_INTR_ONLY)
-void brcmf_sdbrcm_enable_oob_intr(struct dhd_bus *bus, bool enable)
-{
-#if defined(HW_OOB)
- brcmf_sdcard_enable_hw_oob_intr(bus->sdh, enable);
-#else
- sdpcmd_regs_t *regs = bus->regs;
- uint retries = 0;
-
- brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
- if (enable == true) {
-
- /* Tell device to start using OOB wakeup */
- W_SDREG(SMB_USE_OOB, ®s->tosbmailbox, retries);
- if (retries > retry_limit)
- DHD_ERROR(("CANNOT SIGNAL CHIP, WILL NOT WAKE UP!!\n"));
-
- } else {
- /* Send misc interrupt to indicate OOB not needed */
- W_SDREG(0, ®s->tosbmailboxdata, retries);
- if (retries <= retry_limit)
- W_SDREG(SMB_DEV_INT, ®s->tosbmailbox, retries);
- }
-
- /* Turn off our contribution to the HT clock request */
- brcmf_sdbrcm_clkctl(bus, CLK_SDONLY, false);
-#endif /* !defined(HW_OOB) */
-}
-#endif /* defined(OOB_INTR_ONLY) */
-
#define BUS_WAKE(bus) \
do { \
if ((bus)->sleeping) \
@@ -1245,9 +1205,6 @@ static int brcmf_sdbrcm_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
if (bus->roundup && bus->blocksize && (len > bus->blocksize)) {
u16 pad = bus->blocksize - (len % bus->blocksize);
if ((pad <= bus->roundup) && (pad < bus->blocksize))
-#ifdef NOTUSED
- if (pad <= skb_tailroom(pkt))
-#endif /* NOTUSED */
len += pad;
} else if (len % BRCMF_SDALIGN) {
len += BRCMF_SDALIGN - (len % BRCMF_SDALIGN);
@@ -1255,15 +1212,7 @@ static int brcmf_sdbrcm_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
/* Some controllers have trouble with odd bytes -- round to even */
if (forcealign && (len & (ALIGNMENT - 1))) {
-#ifdef NOTUSED
- if (skb_tailroom(pkt))
-#endif
len = roundup(len, ALIGNMENT);
-#ifdef NOTUSED
- else
- DHD_ERROR(("%s: sending unrounded %d-byte packet\n",
- __func__, len));
-#endif
}
do {
@@ -4575,9 +4524,6 @@ bool brcmf_sdbrcm_dpc(dhd_bus_t *bus)
bus->intstatus = intstatus;
clkwait:
-#if defined(OOB_INTR_ONLY)
- brcmf_sdio_oob_intr_set(1);
-#endif /* (OOB_INTR_ONLY) */
/* Re-enable interrupts to detect new device events (mailbox, rx frame)
* or clock availability. (Allows tx loop to check ipend if desired.)
* (Unless register access seems hosed, as we may not be able to ACK...)
@@ -5959,10 +5905,6 @@ int brcmf_bus_devreset(dhd_pub_t *dhdp, u8 flag)
brcmf_sdbrcm_bus_init(
(dhd_pub_t *) bus->dhd, false);
-#if defined(OOB_INTR_ONLY)
- brcmf_sdbrcm_enable_oob_intr(bus, true);
-#endif /* defined(OOB_INTR_ONLY) */
-
bus->dhd->dongle_reset = false;
bus->dhd->up = true;
--
1.7.1
From: Henry Ptasinski <[email protected]>
brcm80211/brcmfmac/README contents were move to brcm80211/README previously,
but this empty file is still around.
Signed-off-by: Henry Ptasinski <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/README | 2 --
1 files changed, 0 insertions(+), 2 deletions(-)
delete mode 100644 drivers/staging/brcm80211/brcmfmac/README
diff --git a/drivers/staging/brcm80211/brcmfmac/README b/drivers/staging/brcm80211/brcmfmac/README
deleted file mode 100644
index 139597f..0000000
--- a/drivers/staging/brcm80211/brcmfmac/README
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
--
1.7.1
From: Arend van Spriel <[email protected]>
The fullmac driver now always uses scheduler functionality.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/Makefile | 1 -
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 4 ----
2 files changed, 0 insertions(+), 5 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/Makefile b/drivers/staging/brcm80211/brcmfmac/Makefile
index 0674a6a..1444fd4 100644
--- a/drivers/staging/brcm80211/brcmfmac/Makefile
+++ b/drivers/staging/brcm80211/brcmfmac/Makefile
@@ -19,7 +19,6 @@ ccflags-y := \
-DBCMSDIO \
-DBRCM_FULLMAC \
-DBRCMF_FIRSTREAD=64 \
- -DDHD_SCHED \
-DBRCMF_SDALIGN=64 \
-DEMBEDDED_PLATFORM \
-DMAX_HDR_READ=64 \
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index c3a0e94..593d180 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -1201,14 +1201,12 @@ static int brcmf_watchdog_thread(void *data)
/* This thread doesn't need any user-level access,
* so get rid of all our resources
*/
-#ifdef DHD_SCHED
if (brcmf_watchdog_prio > 0) {
struct sched_param param;
param.sched_priority = (brcmf_watchdog_prio < MAX_RT_PRIO) ?
brcmf_watchdog_prio : (MAX_RT_PRIO - 1);
sched_setscheduler(current, SCHED_FIFO, ¶m);
}
-#endif /* DHD_SCHED */
allow_signal(SIGTERM);
/* Run until signal received */
@@ -1261,7 +1259,6 @@ static int brcmf_dpc_thread(void *data)
/* This thread doesn't need any user-level access,
* so get rid of all our resources
*/
-#ifdef DHD_SCHED
if (brcmf_dpc_prio > 0) {
struct sched_param param;
param.sched_priority =
@@ -1269,7 +1266,6 @@ static int brcmf_dpc_thread(void *data)
MAX_RT_PRIO) ? brcmf_dpc_prio : (MAX_RT_PRIO - 1);
sched_setscheduler(current, SCHED_FIFO, ¶m);
}
-#endif /* DHD_SCHED */
allow_signal(SIGTERM);
/* Run until signal received */
--
1.7.1
From: Arend van Spriel <[email protected]>
Code between #ifdef SIMPLE_ISCAN is not enabled and unnecessary.
It has been removed from the fullmac driver.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 391 -----------------------
1 files changed, 0 insertions(+), 391 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 70d2591..a255d3d 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -35,11 +35,6 @@ int brcmf_msg_level;
char brcmf_fw_path[MOD_PARAM_PATHLEN];
char brcmf_nv_path[MOD_PARAM_PATHLEN];
-extern void dhd_ind_scan_confirm(void *h, bool status);
-extern int dhd_wl_ioctl(dhd_pub_t *dhd, uint cmd, char *buf, uint buflen);
-void dhd_iscan_lock(void);
-void dhd_iscan_unlock(void);
-
/* Packet alignment for most efficient SDIO (can change based on platform) */
#ifndef DHD_SDALIGN
#define DHD_SDALIGN 32
@@ -1325,392 +1320,6 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
return 0;
}
-#ifdef SIMPLE_ISCAN
-uint iscan_thread_id;
-iscan_buf_t *iscan_chain;
-
-iscan_buf_t *dhd_iscan_allocate_buf(dhd_pub_t *dhd, iscan_buf_t **iscanbuf)
-{
- iscan_buf_t *iscanbuf_alloc = 0;
- iscan_buf_t *iscanbuf_head;
-
- dhd_iscan_lock();
-
- iscanbuf_alloc = kmalloc(sizeof(iscan_buf_t), GFP_ATOMIC);
- if (iscanbuf_alloc == NULL)
- goto fail;
-
- iscanbuf_alloc->next = NULL;
- iscanbuf_head = *iscanbuf;
-
- DHD_ISCAN(("%s: addr of allocated node = 0x%X"
- "addr of iscanbuf_head = 0x%X dhd = 0x%X\n",
- __func__, iscanbuf_alloc, iscanbuf_head, dhd));
-
- if (iscanbuf_head == NULL) {
- *iscanbuf = iscanbuf_alloc;
- DHD_ISCAN(("%s: Head is allocated\n", __func__));
- goto fail;
- }
-
- while (iscanbuf_head->next)
- iscanbuf_head = iscanbuf_head->next;
-
- iscanbuf_head->next = iscanbuf_alloc;
-
-fail:
- dhd_iscan_unlock();
- return iscanbuf_alloc;
-}
-
-void dhd_iscan_free_buf(void *dhdp, iscan_buf_t *iscan_delete)
-{
- iscan_buf_t *iscanbuf_free = 0;
- iscan_buf_t *iscanbuf_prv = 0;
- iscan_buf_t *iscanbuf_cur = iscan_chain;
- dhd_pub_t *dhd = dhd_bus_pub(dhdp);
-
- dhd_iscan_lock();
- /* If iscan_delete is null then delete the entire
- * chain or else delete specific one provided
- */
- if (!iscan_delete) {
- while (iscanbuf_cur) {
- iscanbuf_free = iscanbuf_cur;
- iscanbuf_cur = iscanbuf_cur->next;
- iscanbuf_free->next = 0;
- kfree(iscanbuf_free);
- }
- iscan_chain = 0;
- } else {
- while (iscanbuf_cur) {
- if (iscanbuf_cur == iscan_delete)
- break;
- iscanbuf_prv = iscanbuf_cur;
- iscanbuf_cur = iscanbuf_cur->next;
- }
- if (iscanbuf_prv)
- iscanbuf_prv->next = iscan_delete->next;
-
- iscan_delete->next = 0;
- kfree(iscan_delete);
-
- if (!iscanbuf_prv)
- iscan_chain = 0;
- }
- dhd_iscan_unlock();
-}
-
-iscan_buf_t *dhd_iscan_result_buf(void)
-{
- return iscan_chain;
-}
-
-/*
-* print scan cache
-* print partial iscan_skip list differently
-*/
-int dhd_iscan_print_cache(iscan_buf_t *iscan_skip)
-{
- int i = 0, l = 0;
- iscan_buf_t *iscan_cur;
- wl_iscan_results_t *list;
- wl_scan_results_t *results;
- wl_bss_info_t UNALIGNED *bi;
-
- dhd_iscan_lock();
-
- iscan_cur = dhd_iscan_result_buf();
-
- while (iscan_cur) {
- list = (wl_iscan_results_t *)iscan_cur->iscan_buf;
- if (!list)
- break;
-
- results = (wl_scan_results_t *)&list->results;
- if (!results)
- break;
-
- if (results->version != WL_BSS_INFO_VERSION) {
- DHD_ISCAN(("%s: results->version %d != "
- "WL_BSS_INFO_VERSION\n",
- __func__, results->version));
- goto done;
- }
-
- bi = results->bss_info;
- for (i = 0; i < results->count; i++) {
- if (!bi)
- break;
-
- DHD_ISCAN(("%s[%2.2d:%2.2d] %X:%X:%X:%X:%X:%X\n",
- iscan_cur != iscan_skip ? "BSS" : "bss", l,
- i, bi->BSSID.octet[0], bi->BSSID.octet[1],
- bi->BSSID.octet[2], bi->BSSID.octet[3],
- bi->BSSID.octet[4], bi->BSSID.octet[5]));
-
- bi = (wl_bss_info_t *)((unsigned long)bi + bi->length);
- }
- iscan_cur = iscan_cur->next;
- l++;
- }
-
-done:
- dhd_iscan_unlock();
- return 0;
-}
-
-/*
-* delete disappeared AP from specific scan cache but skip partial
-* list in iscan_skip
-*/
-int dhd_iscan_delete_bss(void *dhdp, void *addr, iscan_buf_t *iscan_skip)
-{
- int i = 0, j = 0, l = 0;
- iscan_buf_t *iscan_cur;
- wl_iscan_results_t *list;
- wl_scan_results_t *results;
- wl_bss_info_t UNALIGNED *bi, *bi_new, *bi_next;
-
- unsigned char *s_addr = addr;
-
- dhd_iscan_lock();
- DHD_ISCAN(("%s: BSS to remove %X:%X:%X:%X:%X:%X\n",
- __func__, s_addr[0], s_addr[1], s_addr[2],
- s_addr[3], s_addr[4], s_addr[5]));
-
- iscan_cur = dhd_iscan_result_buf();
-
- while (iscan_cur) {
- if (iscan_cur != iscan_skip) {
- list = (wl_iscan_results_t *)iscan_cur->iscan_buf;
- if (!list)
- break;
-
- results = (wl_scan_results_t *)&list->results;
- if (!results)
- break;
-
- if (results->version != WL_BSS_INFO_VERSION) {
- DHD_ERROR(("%s: results->version %d != "
- "WL_BSS_INFO_VERSION\n",
- __func__, results->version));
- goto done;
- }
-
- bi = results->bss_info;
- for (i = 0; i < results->count; i++) {
- if (!bi)
- break;
-
- if (!memcmp
- (bi->BSSID.octet, addr, ETH_ALEN)) {
- DHD_ISCAN(("%s: Del BSS[%2.2d:%2.2d] "
- "%X:%X:%X:%X:%X:%X\n",
- __func__, l, i, bi->BSSID.octet[0],
- bi->BSSID.octet[1], bi->BSSID.octet[2],
- bi->BSSID.octet[3], bi->BSSID.octet[4],
- bi->BSSID.octet[5]));
-
- bi_new = bi;
- bi = (wl_bss_info_t *)((unsigned long)
- bi + bi->length);
-/*
- if(bi && bi_new) {
- memcpy(bi_new, bi, results->buflen -
- bi_new->length);
- results->buflen -= bi_new->length;
- }
-*/
- results->buflen -= bi_new->length;
- results->count--;
-
- for (j = i; j < results->count; j++) {
- if (bi && bi_new) {
- DHD_ISCAN(("%s: Moved up BSS[%2.2d:%2.2d]" "%X:%X:%X:%X:%X:%X\n",
- __func__, l, j,
- bi->BSSID.octet[0],
- bi->BSSID.octet[1],
- bi->BSSID.octet[2],
- bi->BSSID.octet[3],
- bi->BSSID.octet[4],
- bi->BSSID.octet[5]));
-
- bi_next =
- (wl_bss_info_t *)((unsigned long)bi +
- bi->length);
- memcpy(bi_new, bi,
- bi->length);
- bi_new =
- (wl_bss_info_t *)((unsigned long)bi_new +
- bi_new->
- length);
- bi = bi_next;
- }
- }
-
- if (results->count == 0) {
- /* Prune now empty partial
- scan list */
- dhd_iscan_free_buf(dhdp,
- iscan_cur);
- goto done;
- }
- break;
- }
- bi = (wl_bss_info_t *)((unsigned long)bi +
- bi->length);
- }
- }
- iscan_cur = iscan_cur->next;
- l++;
- }
-
-done:
- dhd_iscan_unlock();
- return 0;
-}
-
-int dhd_iscan_remove_duplicates(void *dhdp, iscan_buf_t *iscan_cur)
-{
- int i = 0;
- wl_iscan_results_t *list;
- wl_scan_results_t *results;
- wl_bss_info_t UNALIGNED *bi, *bi_new, *bi_next;
-
- dhd_iscan_lock();
-
- DHD_ISCAN(("%s: Scan cache before delete\n", __func__));
- dhd_iscan_print_cache(iscan_cur);
-
- if (!iscan_cur)
- goto done;
-
- list = (wl_iscan_results_t *)iscan_cur->iscan_buf;
- if (!list)
- goto done;
-
- results = (wl_scan_results_t *)&list->results;
- if (!results)
- goto done;
-
- if (results->version != WL_BSS_INFO_VERSION) {
- DHD_ERROR(("%s: results->version %d != WL_BSS_INFO_VERSION\n",
- __func__, results->version));
- goto done;
- }
-
- bi = results->bss_info;
- for (i = 0; i < results->count; i++) {
- if (!bi)
- break;
-
- DHD_ISCAN(("%s: Find dups for BSS[%2.2d] %X:%X:%X:%X:%X:%X\n",
- __func__, i, bi->BSSID.octet[0],
- bi->BSSID.octet[1], bi->BSSID.octet[2],
- bi->BSSID.octet[3], bi->BSSID.octet[4],
- bi->BSSID.octet[5]));
-
- dhd_iscan_delete_bss(dhdp, bi->BSSID.octet, iscan_cur);
-
- bi = (wl_bss_info_t *)((unsigned long)bi + bi->length);
- }
-
-done:
- DHD_ISCAN(("%s: Scan cache after delete\n", __func__));
- dhd_iscan_print_cache(iscan_cur);
- dhd_iscan_unlock();
- return 0;
-}
-
-void dhd_iscan_ind_scan_confirm(void *dhdp, bool status)
-{
-
- dhd_ind_scan_confirm(dhdp, status);
-}
-
-int dhd_iscan_request(void *dhdp, u16 action)
-{
- int rc;
- wl_iscan_params_t params;
- dhd_pub_t *dhd = dhd_bus_pub(dhdp);
- char buf[BRCMF_C_IOCTL_SMLEN];
-
- memset(¶ms, 0, sizeof(wl_iscan_params_t));
- memcpy(¶ms.params.bssid, ðer_bcast, ETH_ALEN);
-
- params.params.bss_type = DOT11_BSSTYPE_ANY;
- params.params.scan_type = DOT11_SCANTYPE_ACTIVE;
-
- params.params.nprobes = -1;
- params.params.active_time = -1;
- params.params.passive_time = -1;
- params.params.home_time = -1;
- params.params.channel_num = 0;
-
- params.version = ISCAN_REQ_VERSION;
- params.action = action;
- params.scan_duration = 0;
-
- brcmu_mkiovar("iscan", (char *)¶ms, sizeof(wl_iscan_params_t), buf,
- BRCMF_C_IOCTL_SMLEN);
- rc = dhd_wl_ioctl(dhdp, BRCMF_C_SET_VAR, buf, BRCMF_C_IOCTL_SMLEN);
-
- return rc;
-}
-
-static int dhd_iscan_get_partial_result(void *dhdp, uint *scan_count)
-{
- wl_iscan_results_t *list_buf;
- wl_iscan_results_t list;
- wl_scan_results_t *results;
- iscan_buf_t *iscan_cur;
- int status = -1;
- dhd_pub_t *dhd = dhd_bus_pub(dhdp);
- int rc;
-
- iscan_cur = dhd_iscan_allocate_buf(dhd, &iscan_chain);
- if (!iscan_cur) {
- DHD_ERROR(("%s: Failed to allocate node\n", __func__));
- dhd_iscan_free_buf(dhdp, 0);
- dhd_iscan_request(dhdp, WL_SCAN_ACTION_ABORT);
- goto fail;
- }
-
- dhd_iscan_lock();
-
- memset(iscan_cur->iscan_buf, 0, WLC_IW_ISCAN_MAXLEN);
- list_buf = (wl_iscan_results_t *) iscan_cur->iscan_buf;
- results = &list_buf->results;
- results->buflen = WL_ISCAN_RESULTS_FIXED_SIZE;
- results->version = 0;
- results->count = 0;
-
- memset(&list, 0, sizeof(list));
- list.results.buflen = WLC_IW_ISCAN_MAXLEN;
- brcmu_mkiovar("iscanresults", (char *)&list,
- WL_ISCAN_RESULTS_FIXED_SIZE,
- iscan_cur->iscan_buf, WLC_IW_ISCAN_MAXLEN);
- rc = dhd_wl_ioctl(dhdp, BRCMF_C_GET_VAR, iscan_cur->iscan_buf,
- WLC_IW_ISCAN_MAXLEN);
-
- results->buflen = results->buflen;
- results->version = results->version;
- *scan_count = results->count = results->count;
- status = list_buf->status;
-
- dhd_iscan_unlock();
-
- if (!(*scan_count))
- dhd_iscan_free_buf(dhdp, iscan_cur);
- else
- dhd_iscan_remove_duplicates(dhdp, iscan_cur);
-
-fail:
- return status;
-}
-#endif /* SIMPLE_ISCAN */
-
#ifdef PNO_SUPPORT
int dhd_pno_clean(dhd_pub_t *dhd)
{
--
1.7.1
From: Arend van Spriel <[email protected]>
Fullmac source is renamed to be consistent throughout the driver. This
commit renames the modules parameters for module loading.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 40 ++++++------
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 23 ++++---
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 78 +++++++++++-----------
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 49 +++++++-------
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 2 +-
5 files changed, 97 insertions(+), 95 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 1145e5b..46381bb 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -775,57 +775,57 @@ extern atomic_t dhd_mmc_suspend;
*/
/* Watchdog timer interval */
-extern uint dhd_watchdog_ms;
+extern uint brcmf_watchdog_ms;
#if defined(DHD_DEBUG)
/* Console output poll interval */
-extern uint dhd_console_ms;
+extern uint brcmf_console_ms;
#endif /* defined(DHD_DEBUG) */
/* Use interrupts */
-extern uint dhd_intr;
+extern uint brcmf_intr;
/* Use polling */
-extern uint dhd_poll;
+extern uint brcmf_poll;
/* ARP offload agent mode */
-extern uint dhd_arp_mode;
+extern uint brcmf_arp_mode;
/* ARP offload enable */
-extern uint dhd_arp_enable;
+extern uint brcmf_arp_enable;
/* Pkt filte enable control */
-extern uint dhd_pkt_filter_enable;
+extern uint brcmf_pkt_filter_enable;
/* Pkt filter init setup */
-extern uint dhd_pkt_filter_init;
+extern uint brcmf_pkt_filter_init;
/* Pkt filter mode control */
-extern uint dhd_master_mode;
+extern uint brcmf_master_mode;
/* Roaming mode control */
-extern uint dhd_roam;
+extern uint brcmf_roam;
/* Roaming mode control */
-extern uint dhd_radio_up;
+extern uint brcmf_radio_up;
/* Initial idletime ticks (may be -1 for immediate idle, 0 for no idle) */
-extern int dhd_idletime;
-#define DHD_IDLETIME_TICKS 1
+extern int brcmf_idletime;
+#define BRCMF_IDLETIME_TICKS 1
/* SDIO Drive Strength */
-extern uint dhd_sdiod_drive_strength;
+extern uint brcmf_sdiod_drive_strength;
/* Override to force tx queueing all the time */
-extern uint dhd_force_tx_queueing;
+extern uint brcmf_force_tx_queueing;
#ifdef SDTEST
/* Echo packet generator (SDIO), pkts/s */
-extern uint dhd_pktgen;
+extern uint brcmf_pktgen;
/* Echo packet len (0 => sawtooth, max 1800) */
-extern uint dhd_pktgen_len;
-#define MAX_PKTGEN_LEN 1800
+extern uint brcmf_pktgen_len;
+#define BRCMF_MAX_PKTGEN_LEN 1800
#endif
extern char brcmf_fw_path[MOD_PARAM_PATHLEN];
@@ -1032,7 +1032,7 @@ typedef struct dhd_ioctl {
#ifdef SDTEST
/* For pktgen iovar */
-typedef struct dhd_pktgen {
+typedef struct brcmf_pktgen {
uint version; /* To allow structure change tracking */
uint freq; /* Max ticks between tx/rx attempts */
uint count; /* Test packets to send/rcv each attempt */
@@ -1045,7 +1045,7 @@ typedef struct dhd_pktgen {
uint numfail; /* Count of test send failures */
uint mode; /* Test mode (type of test packets) */
uint stop; /* Stop after this many tx failures */
-} dhd_pktgen_t;
+} brcmf_pktgen_t;
/* Version in case structure changes */
#define DHD_PKTGEN_VERSION 2
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index b06d7e0..9d604a6 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -253,7 +253,7 @@ brcmf_c_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
break;
case IOV_GVAL(IOV_WDTICK):
- int_val = (s32) dhd_watchdog_ms;
+ int_val = (s32) brcmf_watchdog_ms;
memcpy(arg, &int_val, val_size);
break;
@@ -271,12 +271,12 @@ brcmf_c_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
#ifdef DHD_DEBUG
case IOV_GVAL(IOV_DCONSOLE_POLL):
- int_val = (s32) dhd_console_ms;
+ int_val = (s32) brcmf_console_ms;
memcpy(arg, &int_val, val_size);
break;
case IOV_SVAL(IOV_DCONSOLE_POLL):
- dhd_console_ms = (uint) int_val;
+ brcmf_console_ms = (uint) int_val;
break;
case IOV_SVAL(IOV_CONS):
@@ -1271,11 +1271,12 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
/* Enable/Disable build-in roaming to allowed ext supplicant to take
of romaing */
- brcmu_mkiovar("roam_off", (char *)&dhd_roam, 4, iovbuf, sizeof(iovbuf));
+ brcmu_mkiovar("roam_off", (char *)&brcmf_roam, 4,
+ iovbuf, sizeof(iovbuf));
dhdcdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf, sizeof(iovbuf));
/* Force STA UP */
- if (dhd_radio_up)
+ if (brcmf_radio_up)
dhdcdc_set_ioctl(dhd, 0, BRCMF_C_UP, (char *)&up, sizeof(up));
/* Setup event_msgs */
@@ -1290,23 +1291,23 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
#ifdef ARP_OFFLOAD_SUPPORT
/* Set and enable ARP offload feature */
- if (dhd_arp_enable)
- brcmf_c_arp_offload_set(dhd, dhd_arp_mode);
- brcmf_c_arp_offload_enable(dhd, dhd_arp_enable);
+ if (brcmf_arp_enable)
+ brcmf_c_arp_offload_set(dhd, brcmf_arp_mode);
+ brcmf_c_arp_offload_enable(dhd, brcmf_arp_enable);
#endif /* ARP_OFFLOAD_SUPPORT */
#ifdef PKT_FILTER_SUPPORT
{
int i;
/* Set up pkt filter */
- if (dhd_pkt_filter_enable) {
+ if (brcmf_pkt_filter_enable) {
for (i = 0; i < dhd->pktfilter_count; i++) {
brcmf_c_pktfilter_offload_set(dhd,
dhd->pktfilter[i]);
brcmf_c_pktfilter_offload_enable(dhd,
dhd->pktfilter[i],
- dhd_pkt_filter_init,
- dhd_master_mode);
+ brcmf_pkt_filter_init,
+ brcmf_master_mode);
}
}
}
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index c6cae48..2d4e2c7 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -259,35 +259,35 @@ uint dhd_sysioc = true;
module_param(dhd_sysioc, uint, 0);
/* Watchdog interval */
-uint dhd_watchdog_ms = 10;
-module_param(dhd_watchdog_ms, uint, 0);
+uint brcmf_watchdog_ms = 10;
+module_param(brcmf_watchdog_ms, uint, 0);
#ifdef DHD_DEBUG
/* Console poll interval */
-uint dhd_console_ms;
-module_param(dhd_console_ms, uint, 0);
+uint brcmf_console_ms;
+module_param(brcmf_console_ms, uint, 0);
#endif /* DHD_DEBUG */
/* ARP offload agent mode : Enable ARP Host Auto-Reply
and ARP Peer Auto-Reply */
-uint dhd_arp_mode = 0xb;
-module_param(dhd_arp_mode, uint, 0);
+uint brcmf_arp_mode = 0xb;
+module_param(brcmf_arp_mode, uint, 0);
/* ARP offload enable */
-uint dhd_arp_enable = true;
-module_param(dhd_arp_enable, uint, 0);
+uint brcmf_arp_enable = true;
+module_param(brcmf_arp_enable, uint, 0);
/* Global Pkt filter enable control */
-uint dhd_pkt_filter_enable = true;
-module_param(dhd_pkt_filter_enable, uint, 0);
+uint brcmf_pkt_filter_enable = true;
+module_param(brcmf_pkt_filter_enable, uint, 0);
/* Pkt filter init setup */
-uint dhd_pkt_filter_init;
-module_param(dhd_pkt_filter_init, uint, 0);
+uint brcmf_pkt_filter_init;
+module_param(brcmf_pkt_filter_init, uint, 0);
/* Pkt filter mode control */
-uint dhd_master_mode = true;
-module_param(dhd_master_mode, uint, 1);
+uint brcmf_master_mode = true;
+module_param(brcmf_master_mode, uint, 1);
/* Watchdog thread priority, -1 to use kernel timer */
int dhd_watchdog_prio = 97;
@@ -303,13 +303,13 @@ module_param(dhd_dongle_memsize, int, 0);
/* Contorl fw roaming */
#ifdef CUSTOMER_HW2
-uint dhd_roam;
+uint brcmf_roam;
#else
-uint dhd_roam = 1;
+uint brcmf_roam = 1;
#endif
/* Control radio state */
-uint dhd_radio_up = 1;
+uint brcmf_radio_up = 1;
/* Network inteface name */
char iface_name[IFNAMSIZ] = "wlan";
@@ -321,20 +321,20 @@ module_param_string(iface_name, iface_name, IFNAMSIZ, 0);
int dhd_ioctl_timeout_msec = IOCTL_RESP_TIMEOUT;
/* Idle timeout for backplane clock */
-int dhd_idletime = DHD_IDLETIME_TICKS;
-module_param(dhd_idletime, int, 0);
+int brcmf_idletime = BRCMF_IDLETIME_TICKS;
+module_param(brcmf_idletime, int, 0);
/* Use polling */
-uint dhd_poll;
-module_param(dhd_poll, uint, 0);
+uint brcmf_poll;
+module_param(brcmf_poll, uint, 0);
/* Use interrupts */
-uint dhd_intr = true;
-module_param(dhd_intr, uint, 0);
+uint brcmf_intr = true;
+module_param(brcmf_intr, uint, 0);
/* SDIO Drive Strength (in milliamps) */
-uint dhd_sdiod_drive_strength = 6;
-module_param(dhd_sdiod_drive_strength, uint, 0);
+uint brcmf_sdiod_drive_strength = 6;
+module_param(brcmf_sdiod_drive_strength, uint, 0);
/* Tx/Rx bounds */
extern uint dhd_txbound;
@@ -348,12 +348,12 @@ module_param(dhd_deferred_tx, uint, 0);
#ifdef SDTEST
/* Echo packet generator (pkts/s) */
-uint dhd_pktgen;
-module_param(dhd_pktgen, uint, 0);
+uint brcmf_pktgen;
+module_param(brcmf_pktgen, uint, 0);
/* Echo packet len (0 => sawtooth, max 2040) */
-uint dhd_pktgen_len;
-module_param(dhd_pktgen_len, uint, 0);
+uint brcmf_pktgen_len;
+module_param(brcmf_pktgen_len, uint, 0);
#endif
/* Version string to report */
@@ -384,13 +384,13 @@ static void dhd_set_packet_filter(int value, dhd_pub_t *dhd)
DHD_TRACE(("%s: %d\n", __func__, value));
/* 1 - Enable packet filter, only allow unicast packet to send up */
/* 0 - Disable packet filter */
- if (dhd_pkt_filter_enable) {
+ if (brcmf_pkt_filter_enable) {
int i;
for (i = 0; i < dhd->pktfilter_count; i++) {
brcmf_c_pktfilter_offload_set(dhd, dhd->pktfilter[i]);
brcmf_c_pktfilter_offload_enable(dhd, dhd->pktfilter[i],
- value, dhd_master_mode);
+ value, brcmf_master_mode);
}
}
#endif
@@ -1276,7 +1276,7 @@ static void dhd_watchdog(unsigned long data)
/* Reschedule the watchdog */
if (dhd->wd_timer_valid) {
mod_timer(&dhd->timer,
- jiffies + dhd_watchdog_ms * HZ / 1000);
+ jiffies + brcmf_watchdog_ms * HZ / 1000);
}
return;
}
@@ -1289,7 +1289,7 @@ static void dhd_watchdog(unsigned long data)
/* Reschedule the watchdog */
if (dhd->wd_timer_valid)
- mod_timer(&dhd->timer, jiffies + dhd_watchdog_ms * HZ / 1000);
+ mod_timer(&dhd->timer, jiffies + brcmf_watchdog_ms * HZ / 1000);
}
static int dhd_dpc_thread(void *data)
@@ -1992,7 +1992,7 @@ int dhd_bus_start(dhd_pub_t *dhdp)
/* Start the watchdog timer */
dhd->pub.tickcnt = 0;
- dhd_os_wd_timer(&dhd->pub, dhd_watchdog_ms);
+ dhd_os_wd_timer(&dhd->pub, brcmf_watchdog_ms);
/* Bring up the bus */
ret = brcmf_sdbrcm_bus_init(&dhd->pub, true);
@@ -2403,9 +2403,9 @@ void dhd_os_wd_timer(void *bus, uint wdtick)
}
if (wdtick) {
- dhd_watchdog_ms = (uint) wdtick;
+ brcmf_watchdog_ms = (uint) wdtick;
- if (save_dhd_watchdog_ms != dhd_watchdog_ms) {
+ if (save_dhd_watchdog_ms != brcmf_watchdog_ms) {
if (dhd->wd_timer_valid == true)
/* Stop timer and restart at new value */
@@ -2415,13 +2415,13 @@ void dhd_os_wd_timer(void *bus, uint wdtick)
dynamically changed or in the first instance
*/
dhd->timer.expires =
- jiffies + dhd_watchdog_ms * HZ / 1000;
+ jiffies + brcmf_watchdog_ms * HZ / 1000;
add_timer(&dhd->timer);
} else {
/* Re arm the timer, at last watchdog period */
mod_timer(&dhd->timer,
- jiffies + dhd_watchdog_ms * HZ / 1000);
+ jiffies + brcmf_watchdog_ms * HZ / 1000);
}
dhd->wd_timer_valid = true;
@@ -2558,7 +2558,7 @@ int dhd_dev_reset(struct net_device *dev, u8 flag)
/* Turning on watchdog back */
if (!flag)
- dhd_os_wd_timer(&dhd->pub, dhd_watchdog_ms);
+ dhd_os_wd_timer(&dhd->pub, brcmf_watchdog_ms);
DHD_ERROR(("%s: WLAN OFF DONE\n", __func__));
return 1;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 7e7d288..5ce62fe 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -999,7 +999,7 @@ static int brcmf_sdbrcm_clkctl(dhd_bus_t *bus, uint target, bool pendok)
/* Early exit if we're already there */
if (bus->clkstate == target) {
if (target == CLK_AVAIL) {
- dhd_os_wd_timer(bus->dhd, dhd_watchdog_ms);
+ dhd_os_wd_timer(bus->dhd, brcmf_watchdog_ms);
bus->activity = true;
}
return 0;
@@ -1012,7 +1012,7 @@ static int brcmf_sdbrcm_clkctl(dhd_bus_t *bus, uint target, bool pendok)
brcmf_sdbrcm_sdclk(bus, true);
/* Now request HT Avail on the backplane */
brcmf_sdbrcm_htclk(bus, true, pendok);
- dhd_os_wd_timer(bus->dhd, dhd_watchdog_ms);
+ dhd_os_wd_timer(bus->dhd, brcmf_watchdog_ms);
bus->activity = true;
break;
@@ -1025,7 +1025,7 @@ static int brcmf_sdbrcm_clkctl(dhd_bus_t *bus, uint target, bool pendok)
else
DHD_ERROR(("brcmf_sdbrcm_clkctl: request for %d -> %d"
"\n", bus->clkstate, target));
- dhd_os_wd_timer(bus->dhd, dhd_watchdog_ms);
+ dhd_os_wd_timer(bus->dhd, brcmf_watchdog_ms);
break;
case CLK_NONE:
@@ -1781,7 +1781,7 @@ const struct brcmu_iovar dhdsdio_iovars[] = {
#ifdef SDTEST
{"extloop", IOV_EXTLOOP, 0, IOVT_BOOL, 0}
,
- {"pktgen", IOV_PKTGEN, 0, IOVT_BUFFER, sizeof(dhd_pktgen_t)}
+ {"pktgen", IOV_PKTGEN, 0, IOVT_BUFFER, sizeof(brcmf_pktgen_t)}
,
#endif /* SDTEST */
@@ -1918,7 +1918,7 @@ void dhd_bus_clearcounts(dhd_pub_t *dhdp)
#ifdef SDTEST
static int brcmf_sdbrcm_pktgen_get(dhd_bus_t *bus, u8 *arg)
{
- dhd_pktgen_t pktgen;
+ brcmf_pktgen_t pktgen;
pktgen.version = DHD_PKTGEN_VERSION;
pktgen.freq = bus->pktgen_freq;
@@ -1940,7 +1940,7 @@ static int brcmf_sdbrcm_pktgen_get(dhd_bus_t *bus, u8 *arg)
static int brcmf_sdbrcm_pktgen_set(dhd_bus_t *bus, u8 *arg)
{
- dhd_pktgen_t pktgen;
+ brcmf_pktgen_t pktgen;
uint oldcnt, oldmode;
memcpy(&pktgen, arg, sizeof(pktgen));
@@ -2544,14 +2544,14 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
break;
case IOV_GVAL(IOV_SDIOD_DRIVE):
- int_val = (s32) dhd_sdiod_drive_strength;
+ int_val = (s32) brcmf_sdiod_drive_strength;
memcpy(arg, &int_val, val_size);
break;
case IOV_SVAL(IOV_SDIOD_DRIVE):
- dhd_sdiod_drive_strength = int_val;
+ brcmf_sdiod_drive_strength = int_val;
brcmf_sdbrcm_sdiod_drive_strength_init(bus,
- dhd_sdiod_drive_strength);
+ brcmf_sdiod_drive_strength);
break;
case IOV_SVAL(IOV_DOWNLOAD):
@@ -4757,19 +4757,20 @@ void brcmf_sdbrcm_isr(void *arg)
static void brcmf_sdbrcm_pktgen_init(dhd_bus_t *bus)
{
/* Default to specified length, or full range */
- if (dhd_pktgen_len) {
- bus->pktgen_maxlen = min(dhd_pktgen_len, MAX_PKTGEN_LEN);
+ if (brcmf_pktgen_len) {
+ bus->pktgen_maxlen = min(brcmf_pktgen_len,
+ BRCMF_MAX_PKTGEN_LEN);
bus->pktgen_minlen = bus->pktgen_maxlen;
} else {
- bus->pktgen_maxlen = MAX_PKTGEN_LEN;
+ bus->pktgen_maxlen = BRCMF_MAX_PKTGEN_LEN;
bus->pktgen_minlen = 0;
}
bus->pktgen_len = (u16) bus->pktgen_minlen;
/* Default to per-watchdog burst with 10s print time */
bus->pktgen_freq = 1;
- bus->pktgen_print = 10000 / dhd_watchdog_ms;
- bus->pktgen_count = (dhd_pktgen * dhd_watchdog_ms + 999) / 1000;
+ bus->pktgen_print = 10000 / brcmf_watchdog_ms;
+ bus->pktgen_count = (brcmf_pktgen * brcmf_watchdog_ms + 999) / 1000;
/* Default to echo mode */
bus->pktgen_mode = DHD_PKTGEN_ECHO;
@@ -5069,14 +5070,14 @@ extern bool brcmf_sdbrcm_bus_watchdog(dhd_pub_t *dhdp)
}
#ifdef DHD_DEBUG
/* Poll for console output periodically */
- if (dhdp->busstate == DHD_BUS_DATA && dhd_console_ms != 0) {
- bus->console.count += dhd_watchdog_ms;
- if (bus->console.count >= dhd_console_ms) {
- bus->console.count -= dhd_console_ms;
+ if (dhdp->busstate == DHD_BUS_DATA && brcmf_console_ms != 0) {
+ bus->console.count += brcmf_watchdog_ms;
+ if (bus->console.count >= brcmf_console_ms) {
+ bus->console.count -= brcmf_console_ms;
/* Make sure backplane clock is on */
brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
if (brcmf_sdbrcm_readconsole(bus) < 0)
- dhd_console_ms = 0; /* On error,
+ brcmf_console_ms = 0; /* On error,
stop trying */
}
}
@@ -5098,7 +5099,7 @@ extern bool brcmf_sdbrcm_bus_watchdog(dhd_pub_t *dhdp)
bus->idlecount = 0;
if (bus->activity) {
bus->activity = false;
- dhd_os_wd_timer(bus->dhd, dhd_watchdog_ms);
+ dhd_os_wd_timer(bus->dhd, brcmf_watchdog_ms);
} else {
brcmf_sdbrcm_clkctl(bus, CLK_NONE, false);
}
@@ -5390,7 +5391,7 @@ brcmf_sdbrcm_probe_attach(struct dhd_bus *bus, void *sdh, void *regsva,
goto fail;
}
- brcmf_sdbrcm_sdiod_drive_strength_init(bus, dhd_sdiod_drive_strength);
+ brcmf_sdbrcm_sdiod_drive_strength_init(bus, brcmf_sdiod_drive_strength);
/* Get info on the ARM and SOCRAM cores... */
if (!DHD_NOPMU(bus)) {
@@ -5421,8 +5422,8 @@ brcmf_sdbrcm_probe_attach(struct dhd_bus *bus, void *sdh, void *regsva,
bus->rxhdr = (u8 *) roundup((unsigned long)&bus->hdrbuf[0], DHD_SDALIGN);
/* Set the poll and/or interrupt flags */
- bus->intr = (bool) dhd_intr;
- bus->poll = (bool) dhd_poll;
+ bus->intr = (bool) brcmf_intr;
+ bus->poll = (bool) brcmf_poll;
if (bus->poll)
bus->pollrate = 1;
@@ -5498,7 +5499,7 @@ static bool brcmf_sdbrcm_probe_init(dhd_bus_t *bus, void *sdh)
/* ...and initialize clock/power states */
bus->clkstate = CLK_SDONLY;
- bus->idletime = (s32) dhd_idletime;
+ bus->idletime = (s32) brcmf_idletime;
bus->idleclock = DHD_IDLE_ACTIVE;
/* Query the F2 block size, set roundup accordingly */
diff --git a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
index b30ae73..dd47451 100644
--- a/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
+++ b/drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c
@@ -2101,7 +2101,7 @@ static s32 wl_cfg80211_resume(struct wiphy *wiphy)
if (test_bit(WL_STATUS_READY, &wl->status)) {
/* Turn on Watchdog timer */
- wl_os_wd_timer(ndev, dhd_watchdog_ms);
+ wl_os_wd_timer(ndev, brcmf_watchdog_ms);
wl_invoke_iscan(wiphy_to_wl(wiphy));
}
--
1.7.1
In fullmac waitqueue for tx control is used by bus interface layer
only. So move the related code to dhd_sdio.c
Signed-off-by: Franky Lin <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 3 --
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 20 ------------------
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 26 ++++++++++++++++++++++-
3 files changed, 24 insertions(+), 25 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 7e19d80..ffdee84 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -963,9 +963,6 @@ extern int brcmf_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pkt);
extern int brcmf_bus_devreset(dhd_pub_t *dhdp, u8 flag);
extern int brcmf_bus_start(dhd_pub_t *dhdp);
-extern void brcmf_wait_for_event(dhd_pub_t *dhd, bool * lockvar);
-extern void brcmf_wait_event_wakeup(dhd_pub_t *dhd);
-
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);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 6f351eb..6516cc6 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -100,7 +100,6 @@ typedef struct dhd_info {
bool set_multicast;
bool set_macaddress;
u8 macvalue[ETH_ALEN];
- wait_queue_head_t ctrl_wait;
atomic_t pend_8021x_cnt;
#ifdef CONFIG_HAS_EARLYSUSPEND
@@ -1641,7 +1640,6 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
sema_init(&dhd->proto_sem, 1);
/* Initialize other structure content */
init_waitqueue_head(&dhd->ioctl_resp_wait);
- init_waitqueue_head(&dhd->ctrl_wait);
/* Initialize the spinlocks */
spin_lock_init(&dhd->sdlock);
@@ -2255,24 +2253,6 @@ static int brcmf_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
return bcmerror;
}
-void brcmf_wait_for_event(dhd_pub_t *dhd, bool *lockvar)
-{
- struct dhd_info *dhdinfo = dhd->info;
- brcmf_os_sdunlock(dhd);
- wait_event_interruptible_timeout(dhdinfo->ctrl_wait,
- (*lockvar == false), HZ * 2);
- brcmf_os_sdlock(dhd);
- return;
-}
-
-void brcmf_wait_event_wakeup(dhd_pub_t *dhd)
-{
- struct dhd_info *dhdinfo = dhd->info;
- if (waitqueue_active(&dhdinfo->ctrl_wait))
- wake_up_interruptible(&dhdinfo->ctrl_wait);
- return;
-}
-
int brcmf_netdev_reset(struct net_device *dev, u8 flag)
{
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index a97fd7c..ec2c744 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -586,6 +586,7 @@ typedef struct dhd_bus {
bool ctrl_frame_stat;
spinlock_t txqlock;
+ wait_queue_head_t ctrl_wait;
} dhd_bus_t;
typedef volatile struct _sbconfig {
@@ -777,6 +778,8 @@ static void brcmf_sdbrcm_chip_resetcore(struct brcmf_sdio *sdh, u32 corebase);
static void brcmf_sdbrcm_sdiod_drive_strength_init(struct dhd_bus *bus,
u32 drivestrength);
static void brcmf_sdbrcm_chip_detach(struct dhd_bus *bus);
+static void brcmf_sdbrcm_wait_for_event(dhd_pub_t *dhd, bool *lockvar);
+static void brcmf_sdbrcm_wait_event_wakeup(dhd_bus_t *bus);
/* Packet free applicable unconditionally for sdio and sdspi.
* Conditional if bufpool was present for gspi bus.
@@ -1501,7 +1504,7 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
bus->ctrl_frame_buf = frame;
bus->ctrl_frame_len = len;
- brcmf_wait_for_event(bus->dhd, &bus->ctrl_frame_stat);
+ brcmf_sdbrcm_wait_for_event(bus->dhd, &bus->ctrl_frame_stat);
if (bus->ctrl_frame_stat == false) {
DHD_INFO(("%s: ctrl_frame_stat == false\n", __func__));
@@ -4577,7 +4580,7 @@ clkwait:
DHD_INFO(("Return_dpc value is : %d\n", ret));
bus->ctrl_frame_stat = false;
- brcmf_wait_event_wakeup(bus->dhd);
+ brcmf_sdbrcm_wait_event_wakeup(bus);
}
/* Send queued frames (limit 1 if rx may still be pending) */
else if ((bus->clkstate == CLK_AVAIL) && !bus->fcstate &&
@@ -5213,6 +5216,7 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
}
spin_lock_init(&bus->txqlock);
+ init_waitqueue_head(&bus->ctrl_wait);
/* Attach to the dhd/OS/network interface */
bus->dhd = brcmf_attach(bus, SDPCM_RESERVE);
@@ -6317,3 +6321,21 @@ brcmf_sdbrcm_chip_detach(struct dhd_bus *bus)
kfree(bus->ci);
bus->ci = NULL;
}
+
+static void
+brcmf_sdbrcm_wait_for_event(dhd_pub_t *dhd, bool *lockvar)
+{
+ brcmf_os_sdunlock(dhd);
+ wait_event_interruptible_timeout(dhd->bus->ctrl_wait,
+ (*lockvar == false), HZ * 2);
+ brcmf_os_sdlock(dhd);
+ return;
+}
+
+static void
+brcmf_sdbrcm_wait_event_wakeup(dhd_bus_t *bus)
+{
+ if (waitqueue_active(&bus->ctrl_wait))
+ wake_up_interruptible(&bus->ctrl_wait);
+ return;
+}
--
1.7.1
On 06/29/2011 11:29 PM, Rafał Miłecki wrote:
> 2011/6/30 Franky Lin<[email protected]>:
>> Most of these patches are brcmfmac cleanup.
>
>
> Hm, interesting improvement in your "Release early, release often" strategy.
>
Yea, we were waiting for the previous series to get applied. Not sure
how to make this work better. Any process suggestions would be appreciated.
- Henry
From: Arend van Spriel <[email protected]>
It is not recommended to specify function prototypes in c sources
using the extern keyword. Several occurrences have been removed or
placed in a header file or simply removed as it was already present
in a header file.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 6 ++++++
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 2 --
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 14 +++-----------
drivers/staging/brcm80211/brcmfmac/dhd_proto.h | 5 +++++
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 3 ---
5 files changed, 14 insertions(+), 16 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index 4bedf41..4fcdf9d 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -1021,6 +1021,12 @@ extern int dhd_bus_start(dhd_pub_t *dhdp);
extern void dhd_wait_for_event(dhd_pub_t *dhd, bool * lockvar);
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);
+#endif
+
#ifdef BCMDBG
#define ASSERT(exp) \
do { if (!(exp)) osl_assert(#exp, __FILE__, __LINE__); } while (0)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index c77c86c..1d94438 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -84,8 +84,6 @@ struct bdc_header {
int wifi_get_mac_addr(unsigned char *buf);
#endif
-extern int dhd_preinit_ioctls(dhd_pub_t *dhd);
-
/* Packet alignment for most efficient SDIO (can change based on platform) */
#ifndef DHD_SDALIGN
#define DHD_SDALIGN 32
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index f80295e..ed4a296 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -32,6 +32,9 @@
#include <linux/fs.h>
#include <linux/uaccess.h>
#include <net/cfg80211.h>
+#if defined(CONFIG_HAS_EARLYSUSPEND)
+#include <linux/earlysuspend.h>
+#endif
#include <defs.h>
#include <brcmu_utils.h>
#include <brcmu_wifi.h>
@@ -183,17 +186,6 @@ MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN fullmac driver.");
MODULE_SUPPORTED_DEVICE("Broadcom 802.11n WLAN fullmac cards");
MODULE_LICENSE("Dual BSD/GPL");
-#if defined(CONFIG_HAS_EARLYSUSPEND)
-#include <linux/earlysuspend.h>
-extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
- uint len);
-#endif /* defined(CONFIG_HAS_EARLYSUSPEND) */
-
-#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);
-#endif
/* Interface control information */
typedef struct dhd_if {
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_proto.h b/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
index 188b588..f75eb1c 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_proto.h
@@ -71,6 +71,11 @@ extern int dhd_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf,
extern int dhd_preinit_ioctls(dhd_pub_t *dhd);
+#if defined(CONFIG_HAS_EARLYSUSPEND)
+extern int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
+ uint len);
+#endif /* defined(CONFIG_HAS_EARLYSUSPEND) */
+
/********************************
* For version-string expansion *
*/
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index e253cb5..19ac421 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -654,9 +654,6 @@ static int tx_packets[NUMPRIO];
/* Deferred transmit */
const uint dhd_deferred_tx = 1;
-extern uint dhd_watchdog_ms;
-extern void dhd_os_wd_timer(void *bus, uint wdtick);
-
/* Tx/Rx bounds */
uint dhd_txbound;
uint dhd_rxbound;
--
1.7.1
From: Arend van Spriel <[email protected]>
The fullmac driver uses dhd as variable name for the driver instance
in a number of functions. This has been changed to a more generic name
as the dhd is not meaningful (broadcom internal name).
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 172 +++---
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 713 ++++++++++++-----------
2 files changed, 447 insertions(+), 438 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 44b8a25..244ea72 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -111,7 +111,7 @@ void brcmf_c_init(void)
brcmf_msg_level = DHD_ERROR_VAL;
}
-static int brcmf_c_dump(dhd_pub_t *dhdp, char *buf, int buflen)
+static int brcmf_c_dump(dhd_pub_t *drvr, char *buf, int buflen)
{
struct brcmu_strbuf b;
struct brcmu_strbuf *strbuf = &b;
@@ -122,54 +122,54 @@ static int brcmf_c_dump(dhd_pub_t *dhdp, char *buf, int buflen)
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);
+ drvr->up, drvr->txoff, drvr->busstate);
brcmu_bprintf(strbuf, "pub.hdrlen %d pub.maxctl %d pub.rxsz %d\n",
- dhdp->hdrlen, dhdp->maxctl, dhdp->rxsz);
+ drvr->hdrlen, drvr->maxctl, drvr->rxsz);
brcmu_bprintf(strbuf, "pub.iswl %d pub.drv_version %ld pub.mac %pM\n",
- dhdp->iswl, dhdp->drv_version, &dhdp->mac);
- brcmu_bprintf(strbuf, "pub.bcmerror %d tickcnt %d\n", dhdp->bcmerror,
- dhdp->tickcnt);
+ drvr->iswl, drvr->drv_version, &drvr->mac);
+ brcmu_bprintf(strbuf, "pub.bcmerror %d tickcnt %d\n", drvr->bcmerror,
+ drvr->tickcnt);
brcmu_bprintf(strbuf, "dongle stats:\n");
brcmu_bprintf(strbuf,
"tx_packets %ld tx_bytes %ld tx_errors %ld tx_dropped %ld\n",
- dhdp->dstats.tx_packets, dhdp->dstats.tx_bytes,
- dhdp->dstats.tx_errors, dhdp->dstats.tx_dropped);
+ drvr->dstats.tx_packets, drvr->dstats.tx_bytes,
+ drvr->dstats.tx_errors, drvr->dstats.tx_dropped);
brcmu_bprintf(strbuf,
"rx_packets %ld rx_bytes %ld rx_errors %ld rx_dropped %ld\n",
- dhdp->dstats.rx_packets, dhdp->dstats.rx_bytes,
- dhdp->dstats.rx_errors, dhdp->dstats.rx_dropped);
- brcmu_bprintf(strbuf, "multicast %ld\n", dhdp->dstats.multicast);
+ drvr->dstats.rx_packets, drvr->dstats.rx_bytes,
+ drvr->dstats.rx_errors, drvr->dstats.rx_dropped);
+ brcmu_bprintf(strbuf, "multicast %ld\n", drvr->dstats.multicast);
brcmu_bprintf(strbuf, "bus stats:\n");
brcmu_bprintf(strbuf, "tx_packets %ld tx_multicast %ld tx_errors %ld\n",
- dhdp->tx_packets, dhdp->tx_multicast, dhdp->tx_errors);
+ drvr->tx_packets, drvr->tx_multicast, drvr->tx_errors);
brcmu_bprintf(strbuf, "tx_ctlpkts %ld tx_ctlerrs %ld\n",
- dhdp->tx_ctlpkts, dhdp->tx_ctlerrs);
+ drvr->tx_ctlpkts, drvr->tx_ctlerrs);
brcmu_bprintf(strbuf, "rx_packets %ld rx_multicast %ld rx_errors %ld\n",
- dhdp->rx_packets, dhdp->rx_multicast, dhdp->rx_errors);
+ drvr->rx_packets, drvr->rx_multicast, drvr->rx_errors);
brcmu_bprintf(strbuf,
"rx_ctlpkts %ld rx_ctlerrs %ld rx_dropped %ld rx_flushed %ld\n",
- dhdp->rx_ctlpkts, dhdp->rx_ctlerrs, dhdp->rx_dropped,
- dhdp->rx_flushed);
+ drvr->rx_ctlpkts, drvr->rx_ctlerrs, drvr->rx_dropped,
+ drvr->rx_flushed);
brcmu_bprintf(strbuf,
"rx_readahead_cnt %ld tx_realloc %ld fc_packets %ld\n",
- dhdp->rx_readahead_cnt, dhdp->tx_realloc, dhdp->fc_packets);
- brcmu_bprintf(strbuf, "wd_dpc_sched %ld\n", dhdp->wd_dpc_sched);
+ drvr->rx_readahead_cnt, drvr->tx_realloc, drvr->fc_packets);
+ brcmu_bprintf(strbuf, "wd_dpc_sched %ld\n", drvr->wd_dpc_sched);
brcmu_bprintf(strbuf, "\n");
/* Add any prot info */
- brcmf_proto_dump(dhdp, strbuf);
+ brcmf_proto_dump(drvr, strbuf);
brcmu_bprintf(strbuf, "\n");
/* Add any bus info */
- brcmf_sdbrcm_bus_dump(dhdp, strbuf);
+ brcmf_sdbrcm_bus_dump(drvr, strbuf);
return !strbuf->size ? -EOVERFLOW : 0;
}
static int
-brcmf_c_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
+brcmf_c_doiovar(dhd_pub_t *drvr, const struct brcmu_iovar *vi, u32 actionid,
const char *name, void *params, int plen, void *arg, int len,
int val_size)
{
@@ -207,25 +207,25 @@ brcmf_c_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
break;
case IOV_GVAL(IOV_BCMERROR):
- int_val = (s32) dhd_pub->bcmerror;
+ int_val = (s32) drvr->bcmerror;
memcpy(arg, &int_val, val_size);
break;
case IOV_GVAL(IOV_DUMP):
- bcmerror = brcmf_c_dump(dhd_pub, arg, len);
+ bcmerror = brcmf_c_dump(drvr, arg, len);
break;
case IOV_SVAL(IOV_CLEARCOUNTS):
- dhd_pub->tx_packets = dhd_pub->rx_packets = 0;
- dhd_pub->tx_errors = dhd_pub->rx_errors = 0;
- dhd_pub->tx_ctlpkts = dhd_pub->rx_ctlpkts = 0;
- dhd_pub->tx_ctlerrs = dhd_pub->rx_ctlerrs = 0;
- dhd_pub->rx_dropped = 0;
- dhd_pub->rx_readahead_cnt = 0;
- dhd_pub->tx_realloc = 0;
- dhd_pub->wd_dpc_sched = 0;
- memset(&dhd_pub->dstats, 0, sizeof(dhd_pub->dstats));
- dhd_bus_clearcounts(dhd_pub);
+ drvr->tx_packets = drvr->rx_packets = 0;
+ drvr->tx_errors = drvr->rx_errors = 0;
+ drvr->tx_ctlpkts = drvr->rx_ctlpkts = 0;
+ drvr->tx_ctlerrs = drvr->rx_ctlerrs = 0;
+ drvr->rx_dropped = 0;
+ drvr->rx_readahead_cnt = 0;
+ drvr->tx_realloc = 0;
+ drvr->wd_dpc_sched = 0;
+ memset(&drvr->dstats, 0, sizeof(drvr->dstats));
+ dhd_bus_clearcounts(drvr);
break;
case IOV_GVAL(IOV_IOCTLTIMEOUT):{
@@ -252,7 +252,7 @@ exit:
return bcmerror;
}
-bool brcmf_c_prec_enq(dhd_pub_t *dhdp, struct pktq *q, struct sk_buff *pkt,
+bool brcmf_c_prec_enq(dhd_pub_t *drvr, struct pktq *q, struct sk_buff *pkt,
int prec)
{
struct sk_buff *p;
@@ -281,7 +281,7 @@ bool brcmf_c_prec_enq(dhd_pub_t *dhdp, struct pktq *q, struct sk_buff *pkt,
if (eprec >= 0) {
/* Detect queueing to unconfigured precedence */
ASSERT(!pktq_pempty(q, eprec));
- discard_oldest = AC_BITMAP_TST(dhdp->wme_dp, eprec);
+ discard_oldest = AC_BITMAP_TST(drvr->wme_dp, eprec);
if (eprec == prec && !discard_oldest)
return false; /* refuse newer (incoming) packet */
/* Evict packet according to discard policy */
@@ -307,7 +307,7 @@ bool brcmf_c_prec_enq(dhd_pub_t *dhdp, struct pktq *q, struct sk_buff *pkt,
}
static int
-brcmf_c_iovar_op(dhd_pub_t *dhd_pub, const char *name,
+brcmf_c_iovar_op(dhd_pub_t *drvr, const char *name,
void *params, int plen, void *arg, int len, bool set)
{
int bcmerror = 0;
@@ -353,14 +353,14 @@ brcmf_c_iovar_op(dhd_pub_t *dhd_pub, const char *name,
actionid = set ? IOV_SVAL(vi->varid) : IOV_GVAL(vi->varid);
bcmerror =
- brcmf_c_doiovar(dhd_pub, vi, actionid, name, params, plen, arg, len,
+ brcmf_c_doiovar(drvr, vi, actionid, name, params, plen, arg, len,
val_size);
exit:
return bcmerror;
}
-int brcmf_c_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf, uint buflen)
+int brcmf_c_ioctl(dhd_pub_t *drvr, dhd_ioctl_t *ioc, void *buf, uint buflen)
{
int bcmerror = 0;
@@ -404,23 +404,23 @@ int brcmf_c_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf, uint buflen)
/* call with the appropriate arguments */
if (ioc->cmd == DHD_GET_VAR)
- bcmerror = brcmf_c_iovar_op(dhd_pub, buf, arg,
+ bcmerror = brcmf_c_iovar_op(drvr, buf, arg,
arglen, buf, buflen, IOV_GET);
else
bcmerror =
- brcmf_c_iovar_op(dhd_pub, buf, NULL, 0, arg,
+ brcmf_c_iovar_op(drvr, buf, NULL, 0, arg,
arglen, IOV_SET);
if (bcmerror != -ENOTSUPP)
break;
/* not in generic table, try protocol module */
if (ioc->cmd == DHD_GET_VAR)
- bcmerror = brcmf_proto_iovar_op(dhd_pub, buf,
+ bcmerror = brcmf_proto_iovar_op(drvr, buf,
arg, arglen,
buf, buflen,
IOV_GET);
else
- bcmerror = brcmf_proto_iovar_op(dhd_pub, buf,
+ bcmerror = brcmf_proto_iovar_op(drvr, buf,
NULL, 0, arg,
arglen,
IOV_SET);
@@ -429,11 +429,11 @@ int brcmf_c_ioctl(dhd_pub_t *dhd_pub, dhd_ioctl_t *ioc, void *buf, uint buflen)
/* if still not found, try bus module */
if (ioc->cmd == DHD_GET_VAR)
- bcmerror = brcmf_sdbrcm_bus_iovar_op(dhd_pub,
+ bcmerror = brcmf_sdbrcm_bus_iovar_op(drvr,
buf, arg, arglen, buf, buflen,
IOV_GET);
else
- bcmerror = brcmf_sdbrcm_bus_iovar_op(dhd_pub,
+ bcmerror = brcmf_sdbrcm_bus_iovar_op(drvr,
buf, NULL, 0, arg, arglen,
IOV_SET);
@@ -754,8 +754,8 @@ static void brcmf_c_show_host_event(brcmf_event_msg_t *event, void *event_data)
#endif /* SHOW_EVENTS */
int
-brcmf_c_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
- brcmf_event_msg_t *event, void **data_ptr)
+brcmf_c_host_event(struct dhd_info *drvr_priv, int *ifidx, void *pktdata,
+ brcmf_event_msg_t *event, void **data_ptr)
{
/* check whether packet is a BRCM event pkt */
brcmf_event_t *pvt_data = (brcmf_event_t *) pktdata;
@@ -796,13 +796,13 @@ brcmf_c_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
if (ifevent->ifidx > 0 &&
ifevent->ifidx < DHD_MAX_IFS) {
if (ifevent->action == BRCMF_E_IF_ADD)
- brcmf_add_if(dhd, ifevent->ifidx,
+ brcmf_add_if(drvr_priv, ifevent->ifidx,
NULL, event->ifname,
pvt_data->eth.h_dest,
ifevent->flags,
ifevent->bssidx);
else
- brcmf_del_if(dhd, ifevent->ifidx);
+ brcmf_del_if(drvr_priv, ifevent->ifidx);
} else {
DHD_ERROR(("%s: Invalid ifidx %d for %s\n",
__func__, ifevent->ifidx,
@@ -810,9 +810,9 @@ brcmf_c_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
}
}
/* send up the if event: btamp user needs it */
- *ifidx = brcmf_ifname2idx(dhd, event->ifname);
+ *ifidx = brcmf_ifname2idx(drvr_priv, event->ifname);
/* push up to external supp/auth */
- brcmf_event(dhd, (char *)pvt_data, evlen, *ifidx);
+ brcmf_event(drvr_priv, (char *)pvt_data, evlen, *ifidx);
break;
/* These are what external supplicant/authenticator wants */
@@ -824,9 +824,9 @@ brcmf_c_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
default:
/* Fall through: this should get _everything_ */
- *ifidx = brcmf_ifname2idx(dhd, event->ifname);
+ *ifidx = brcmf_ifname2idx(drvr_priv, event->ifname);
/* push up to external supp/auth */
- brcmf_event(dhd, (char *)pvt_data, evlen, *ifidx);
+ brcmf_event(drvr_priv, (char *)pvt_data, evlen, *ifidx);
DHD_TRACE(("%s: MAC event %d, flags %x, status %x\n",
__func__, type, flags, status));
@@ -875,7 +875,7 @@ static int brcmf_c_pattern_atoh(char *src, char *dst)
}
void
-brcmf_c_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg, int enable,
+brcmf_c_pktfilter_offload_enable(dhd_pub_t *drvr, char *arg, int enable,
int master_mode)
{
char *argv[8];
@@ -923,7 +923,7 @@ brcmf_c_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg, int enable,
memcpy((char *)pkt_filterp, &enable_parm, sizeof(enable_parm));
/* Enable/disable the specified filter. */
- rc = brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, buf, buf_len);
+ 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",
@@ -935,7 +935,7 @@ brcmf_c_pktfilter_offload_enable(dhd_pub_t *dhd, char *arg, int enable,
/* Contorl the master mode */
brcmu_mkiovar("pkt_filter_mode", (char *)&master_mode, 4, buf,
sizeof(buf));
- rc = brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, buf,
+ rc = brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR, buf,
sizeof(buf));
rc = rc >= 0 ? 0 : rc;
if (rc)
@@ -946,7 +946,7 @@ fail:
kfree(arg_org);
}
-void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg)
+void brcmf_c_pktfilter_offload_set(dhd_pub_t *drvr, char *arg)
{
const char *str;
wl_pkt_filter_t pkt_filter;
@@ -1066,7 +1066,7 @@ void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg)
&pkt_filter,
WL_PKT_FILTER_FIXED_LEN + WL_PKT_FILTER_PATTERN_FIXED_LEN);
- rc = brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, buf, buf_len);
+ rc = brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR, buf, buf_len);
rc = rc >= 0 ? 0 : rc;
if (rc)
@@ -1082,13 +1082,13 @@ fail:
kfree(buf);
}
-void brcmf_c_arp_offload_set(dhd_pub_t *dhd, int arp_mode)
+void brcmf_c_arp_offload_set(dhd_pub_t *drvr, int arp_mode)
{
char iovbuf[32];
int retcode;
brcmu_mkiovar("arp_ol", (char *)&arp_mode, 4, iovbuf, sizeof(iovbuf));
- retcode = brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
+ retcode = brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR,
iovbuf, sizeof(iovbuf));
retcode = retcode >= 0 ? 0 : retcode;
if (retcode)
@@ -1099,13 +1099,13 @@ void brcmf_c_arp_offload_set(dhd_pub_t *dhd, int arp_mode)
__func__, arp_mode));
}
-void brcmf_c_arp_offload_enable(dhd_pub_t *dhd, int arp_enable)
+void brcmf_c_arp_offload_enable(dhd_pub_t *drvr, int arp_enable)
{
char iovbuf[32];
int retcode;
brcmu_mkiovar("arpoe", (char *)&arp_enable, 4, iovbuf, sizeof(iovbuf));
- retcode = brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
+ retcode = brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR,
iovbuf, sizeof(iovbuf));
retcode = retcode >= 0 ? 0 : retcode;
if (retcode)
@@ -1116,7 +1116,7 @@ void brcmf_c_arp_offload_enable(dhd_pub_t *dhd, int arp_enable)
__func__, arp_enable));
}
-int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
+int brcmf_c_preinit_ioctls(dhd_pub_t *drvr)
{
char iovbuf[WL_EVENTING_MASK_LEN + 12]; /* Room for
"event_msgs" + '\0' + bitvec */
@@ -1130,13 +1130,13 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
int scan_unassoc_time = 40;
int i;
- brcmf_os_proto_block(dhd);
+ brcmf_os_proto_block(drvr);
/* Set Country code */
- if (dhd->country_code[0] != 0) {
- if (brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_COUNTRY,
- dhd->country_code,
- sizeof(dhd->country_code)) < 0) {
+ if (drvr->country_code[0] != 0) {
+ 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__));
}
@@ -1146,74 +1146,74 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
memset(buf, 0, sizeof(buf));
ptr = buf;
brcmu_mkiovar("ver", 0, 0, buf, sizeof(buf));
- brcmf_proto_cdc_query_ioctl(dhd, 0, BRCMF_C_GET_VAR, buf, sizeof(buf));
+ 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));
/* Set PowerSave mode */
- brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_PM, (char *)&power_mode,
+ brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_PM, (char *)&power_mode,
sizeof(power_mode));
/* Match Host and Dongle rx alignment */
brcmu_mkiovar("bus:txglomalign", (char *)&dongle_align, 4, iovbuf,
sizeof(iovbuf));
- brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
+ brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR, iovbuf,
sizeof(iovbuf));
/* disable glom option per default */
brcmu_mkiovar("bus:txglom", (char *)&glom, 4, iovbuf, sizeof(iovbuf));
- brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
+ brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR, iovbuf,
sizeof(iovbuf));
/* Setup timeout if Beacons are lost and roam is off to report
link down */
brcmu_mkiovar("bcn_timeout", (char *)&bcn_timeout, 4, iovbuf,
sizeof(iovbuf));
- brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
+ brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR, iovbuf,
sizeof(iovbuf));
/* Enable/Disable build-in roaming to allowed ext supplicant to take
of romaing */
brcmu_mkiovar("roam_off", (char *)&brcmf_roam, 4,
iovbuf, sizeof(iovbuf));
- brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
+ brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR, iovbuf,
sizeof(iovbuf));
/* Force STA UP */
if (brcmf_radio_up)
- brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_UP, (char *)&up,
+ brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_UP, (char *)&up,
sizeof(up));
/* Setup event_msgs */
- brcmu_mkiovar("event_msgs", dhd->eventmask, WL_EVENTING_MASK_LEN,
+ brcmu_mkiovar("event_msgs", drvr->eventmask, WL_EVENTING_MASK_LEN,
iovbuf, sizeof(iovbuf));
- brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR, iovbuf,
+ brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR, iovbuf,
sizeof(iovbuf));
- brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_SCAN_CHANNEL_TIME,
+ brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_SCAN_CHANNEL_TIME,
(char *)&scan_assoc_time, sizeof(scan_assoc_time));
- brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_SCAN_UNASSOC_TIME,
+ brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_SCAN_UNASSOC_TIME,
(char *)&scan_unassoc_time, sizeof(scan_unassoc_time));
/* Set and enable ARP offload feature */
if (brcmf_arp_enable)
- brcmf_c_arp_offload_set(dhd, brcmf_arp_mode);
- brcmf_c_arp_offload_enable(dhd, brcmf_arp_enable);
+ brcmf_c_arp_offload_set(drvr, brcmf_arp_mode);
+ brcmf_c_arp_offload_enable(drvr, brcmf_arp_enable);
/* Set up pkt filter */
if (brcmf_pkt_filter_enable) {
- for (i = 0; i < dhd->pktfilter_count; i++) {
- brcmf_c_pktfilter_offload_set(dhd,
- dhd->pktfilter[i]);
- brcmf_c_pktfilter_offload_enable(dhd,
- dhd->pktfilter[i],
+ for (i = 0; i < drvr->pktfilter_count; i++) {
+ brcmf_c_pktfilter_offload_set(drvr,
+ drvr->pktfilter[i]);
+ brcmf_c_pktfilter_offload_enable(drvr,
+ drvr->pktfilter[i],
brcmf_pkt_filter_init,
brcmf_master_mode);
}
}
- brcmf_os_proto_unblock(dhd);
+ brcmf_os_proto_unblock(drvr);
return 0;
}
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 4724414..04b4511 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -182,12 +182,12 @@ module_param(brcmf_pktgen_len, uint, 0);
#define DHD_COMPILED
#endif
-static int brcmf_toe_get(dhd_info_t *dhd, int idx, u32 *toe_ol);
-static int brcmf_toe_set(dhd_info_t *dhd, int idx, u32 toe_ol);
-static int brcmf_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
+static int brcmf_toe_get(dhd_info_t *drvr_priv, int idx, u32 *toe_ol);
+static int brcmf_toe_set(dhd_info_t *drvr_priv, int idx, u32 toe_ol);
+static int brcmf_host_event(dhd_info_t *drvr_priv, int *ifidx, void *pktdata,
brcmf_event_msg_t *event_ptr, void **data_ptr);
-static void brcmf_set_packet_filter(int value, dhd_pub_t *dhd)
+static void brcmf_set_packet_filter(int value, dhd_pub_t *drvr)
{
DHD_TRACE(("%s: %d\n", __func__, value));
/* 1 - Enable packet filter, only allow unicast packet to send up */
@@ -195,16 +195,18 @@ static void brcmf_set_packet_filter(int value, dhd_pub_t *dhd)
if (brcmf_pkt_filter_enable) {
int i;
- for (i = 0; i < dhd->pktfilter_count; i++) {
- brcmf_c_pktfilter_offload_set(dhd, dhd->pktfilter[i]);
- brcmf_c_pktfilter_offload_enable(dhd, dhd->pktfilter[i],
- value, brcmf_master_mode);
+ for (i = 0; i < drvr->pktfilter_count; i++) {
+ brcmf_c_pktfilter_offload_set(drvr, drvr->pktfilter[i]);
+ brcmf_c_pktfilter_offload_enable(drvr,
+ drvr->pktfilter[i],
+ value,
+ brcmf_master_mode);
}
}
}
#if defined(CONFIG_HAS_EARLYSUSPEND)
-static int brcmf_set_suspend(int value, dhd_pub_t *dhd)
+static int brcmf_set_suspend(int value, dhd_pub_t *drvr)
{
int power_mode = PM_MAX;
/* wl_pkt_filter_enable_t enable_parm; */
@@ -212,22 +214,22 @@ static int brcmf_set_suspend(int value, dhd_pub_t *dhd)
int bcn_li_dtim = 3;
DHD_TRACE(("%s: enter, value = %d in_suspend=%d\n",
- __func__, value, dhd->in_suspend));
+ __func__, value, drvr->in_suspend));
- if (dhd && dhd->up) {
- if (value && dhd->in_suspend) {
+ if (drvr && drvr->up) {
+ if (value && drvr->in_suspend) {
/* Kernel suspended */
DHD_TRACE(("%s: force extra Suspend setting\n",
__func__));
- brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_PM,
+ brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_PM,
(char *)&power_mode,
sizeof(power_mode));
/* Enable packet filter, only allow unicast
packet to send up */
- brcmf_set_packet_filter(1, dhd);
+ brcmf_set_packet_filter(1, drvr);
/* if dtim skip setup as default force it
* to wake each third dtim
@@ -235,13 +237,13 @@ static int brcmf_set_suspend(int value, dhd_pub_t *dhd)
* Note that side effect is chance to miss BC/MC
* packet
*/
- if ((dhd->dtim_skip == 0) || (dhd->dtim_skip == 1))
+ if ((drvr->dtim_skip == 0) || (drvr->dtim_skip == 1))
bcn_li_dtim = 3;
else
- bcn_li_dtim = dhd->dtim_skip;
+ bcn_li_dtim = drvr->dtim_skip;
brcmu_mkiovar("bcn_li_dtim", (char *)&bcn_li_dtim,
4, iovbuf, sizeof(iovbuf));
- brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
+ brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR,
iovbuf, sizeof(iovbuf));
} else {
@@ -250,18 +252,18 @@ static int brcmf_set_suspend(int value, dhd_pub_t *dhd)
__func__));
power_mode = PM_FAST;
- brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_PM,
- (char *)&power_mode,
- sizeof(power_mode));
+ brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_PM,
+ (char *)&power_mode,
+ sizeof(power_mode));
/* disable pkt filter */
- brcmf_set_packet_filter(0, dhd);
+ brcmf_set_packet_filter(0, drvr);
/* restore pre-suspend setting for dtim_skip */
- brcmu_mkiovar("bcn_li_dtim", (char *)&dhd->dtim_skip,
+ brcmu_mkiovar("bcn_li_dtim", (char *)&drvr->dtim_skip,
4, iovbuf, sizeof(iovbuf));
- brcmf_proto_cdc_set_ioctl(dhd, 0, BRCMF_C_SET_VAR,
+ brcmf_proto_cdc_set_ioctl(drvr, 0, BRCMF_C_SET_VAR,
iovbuf, sizeof(iovbuf));
}
}
@@ -269,37 +271,39 @@ static int brcmf_set_suspend(int value, dhd_pub_t *dhd)
return 0;
}
-static void brcmf_suspend_resume_helper(struct dhd_info *dhd, int val)
+static void brcmf_suspend_resume_helper(struct dhd_info *drvr_priv, int val)
{
- dhd_pub_t *dhdp = &dhd->pub;
+ dhd_pub_t *drvr = &drvr_priv->pub;
- brcmf_os_proto_block(dhdp);
+ brcmf_os_proto_block(drvr);
/* Set flag when early suspend was called */
- dhdp->in_suspend = val;
- if (!dhdp->suspend_disable_flag)
- brcmf_set_suspend(val, dhdp);
- brcmf_os_proto_unblock(dhdp);
+ drvr->in_suspend = val;
+ if (!drvr->suspend_disable_flag)
+ brcmf_set_suspend(val, drvr);
+ brcmf_os_proto_unblock(drvr);
}
static void brcmf_early_suspend(struct early_suspend *h)
{
- struct dhd_info *dhd = container_of(h, struct dhd_info, early_suspend);
+ struct dhd_info *drvr_priv =
+ container_of(h, struct dhd_info, early_suspend);
DHD_TRACE(("%s: enter\n", __func__));
- if (dhd)
- dhd_suspend_resume_helper(dhd, 1);
+ if (drvr_priv)
+ dhd_suspend_resume_helper(drvr_priv, 1);
}
static void brcmf_late_resume(struct early_suspend *h)
{
- struct dhd_info *dhd = container_of(h, struct dhd_info, early_suspend);
+ struct dhd_info *drvr_priv =
+ container_of(h, struct dhd_info, early_suspend);
DHD_TRACE(("%s: enter\n", __func__));
- if (dhd)
- dhd_suspend_resume_helper(dhd, 0);
+ if (drvr_priv)
+ dhd_suspend_resume_helper(drvr_priv, 0);
}
#endif /* defined(CONFIG_HAS_EARLYSUSPEND) */
@@ -361,13 +365,13 @@ int brcmf_timeout_expired(dhd_timeout_t *tmo)
return 0;
}
-static int brcmf_net2idx(dhd_info_t *dhd, struct net_device *net)
+static int brcmf_net2idx(dhd_info_t *drvr_priv, struct net_device *net)
{
int i = 0;
- ASSERT(dhd);
+ ASSERT(drvr_priv);
while (i < DHD_MAX_IFS) {
- if (dhd->iflist[i] && (dhd->iflist[i]->net == net))
+ if (drvr_priv->iflist[i] && (drvr_priv->iflist[i]->net == net))
return i;
i++;
}
@@ -375,18 +379,18 @@ static int brcmf_net2idx(dhd_info_t *dhd, struct net_device *net)
return DHD_BAD_IF;
}
-int brcmf_ifname2idx(dhd_info_t *dhd, char *name)
+int brcmf_ifname2idx(dhd_info_t *drvr_priv, char *name)
{
int i = DHD_MAX_IFS;
- ASSERT(dhd);
+ ASSERT(drvr_priv);
if (name == NULL || *name == '\0')
return 0;
while (--i > 0)
- if (dhd->iflist[i]
- && !strncmp(dhd->iflist[i]->name, name, IFNAMSIZ))
+ if (drvr_priv->iflist[i]
+ && !strncmp(drvr_priv->iflist[i]->name, name, IFNAMSIZ))
break;
DHD_TRACE(("%s: return idx %d for \"%s\"\n", __func__, i, name));
@@ -394,29 +398,29 @@ int brcmf_ifname2idx(dhd_info_t *dhd, char *name)
return i; /* default - the primary interface */
}
-char *brcmf_ifname(dhd_pub_t *dhdp, int ifidx)
+char *brcmf_ifname(dhd_pub_t *drvr, int ifidx)
{
- dhd_info_t *dhd = (dhd_info_t *) dhdp->info;
+ dhd_info_t *drvr_priv = drvr->info;
- ASSERT(dhd);
+ ASSERT(drvr_priv);
if (ifidx < 0 || ifidx >= DHD_MAX_IFS) {
DHD_ERROR(("%s: ifidx %d out of range\n", __func__, ifidx));
return "<if_bad>";
}
- if (dhd->iflist[ifidx] == NULL) {
+ if (drvr_priv->iflist[ifidx] == NULL) {
DHD_ERROR(("%s: null i/f %d\n", __func__, ifidx));
return "<if_null>";
}
- if (dhd->iflist[ifidx]->net)
- return dhd->iflist[ifidx]->net->name;
+ if (drvr_priv->iflist[ifidx]->net)
+ return drvr_priv->iflist[ifidx]->net->name;
return "<if_none>";
}
-static void _brcmf_set_multicast_list(dhd_info_t *dhd, int ifidx)
+static void _brcmf_set_multicast_list(dhd_info_t *drvr_priv, int ifidx)
{
struct net_device *dev;
struct netdev_hw_addr *ha;
@@ -427,8 +431,8 @@ static void _brcmf_set_multicast_list(dhd_info_t *dhd, int ifidx)
uint buflen;
int ret;
- ASSERT(dhd && dhd->iflist[ifidx]);
- dev = dhd->iflist[ifidx]->net;
+ ASSERT(drvr_priv && drvr_priv->iflist[ifidx]);
+ dev = drvr_priv->iflist[ifidx]->net;
cnt = netdev_mc_count(dev);
/* Determine initial value of allmulti flag */
@@ -440,7 +444,7 @@ static void _brcmf_set_multicast_list(dhd_info_t *dhd, int ifidx)
bufp = buf = kmalloc(buflen, GFP_ATOMIC);
if (!bufp) {
DHD_ERROR(("%s: out of memory for mcast_list, cnt %d\n",
- brcmf_ifname(&dhd->pub, ifidx), cnt));
+ brcmf_ifname(&drvr_priv->pub, ifidx), cnt));
return;
}
@@ -465,10 +469,10 @@ static void _brcmf_set_multicast_list(dhd_info_t *dhd, int ifidx)
ioc.len = buflen;
ioc.set = true;
- ret = brcmf_proto_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
+ 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(&dhd->pub, ifidx), cnt));
+ brcmf_ifname(&drvr_priv->pub, ifidx), cnt));
allmulti = cnt ? true : allmulti;
}
@@ -483,7 +487,7 @@ static void _brcmf_set_multicast_list(dhd_info_t *dhd, int ifidx)
buf = kmalloc(buflen, GFP_ATOMIC);
if (!buf) {
DHD_ERROR(("%s: out of memory for allmulti\n",
- brcmf_ifname(&dhd->pub, ifidx)));
+ brcmf_ifname(&drvr_priv->pub, ifidx)));
return;
}
allmulti = cpu_to_le32(allmulti);
@@ -491,7 +495,7 @@ static void _brcmf_set_multicast_list(dhd_info_t *dhd, int ifidx)
if (!brcmu_mkiovar
("allmulti", (void *)&allmulti, sizeof(allmulti), buf, buflen)) {
DHD_ERROR(("%s: mkiovar failed for allmulti, datalen %d "
- "buflen %u\n", brcmf_ifname(&dhd->pub, ifidx),
+ "buflen %u\n", brcmf_ifname(&drvr_priv->pub, ifidx),
(int)sizeof(allmulti), buflen));
kfree(buf);
return;
@@ -503,10 +507,10 @@ static void _brcmf_set_multicast_list(dhd_info_t *dhd, int ifidx)
ioc.len = buflen;
ioc.set = true;
- ret = brcmf_proto_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
+ 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(&dhd->pub, ifidx),
+ brcmf_ifname(&drvr_priv->pub, ifidx),
le32_to_cpu(allmulti)));
}
@@ -524,15 +528,15 @@ static void _brcmf_set_multicast_list(dhd_info_t *dhd, int ifidx)
ioc.len = sizeof(allmulti);
ioc.set = true;
- ret = brcmf_proto_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
+ 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(&dhd->pub, ifidx),
+ brcmf_ifname(&drvr_priv->pub, ifidx),
le32_to_cpu(allmulti)));
}
}
-static int _brcmf_set_mac_address(dhd_info_t *dhd, int ifidx, u8 *addr)
+static int _brcmf_set_mac_address(dhd_info_t *drvr_priv, int ifidx, u8 *addr)
{
char buf[32];
wl_ioctl_t ioc;
@@ -542,7 +546,7 @@ static int _brcmf_set_mac_address(dhd_info_t *dhd, int ifidx, u8 *addr)
if (!brcmu_mkiovar
("cur_etheraddr", (char *)addr, ETH_ALEN, buf, 32)) {
DHD_ERROR(("%s: mkiovar failed for cur_etheraddr\n",
- brcmf_ifname(&dhd->pub, ifidx)));
+ brcmf_ifname(&drvr_priv->pub, ifidx)));
return -1;
}
memset(&ioc, 0, sizeof(ioc));
@@ -551,12 +555,12 @@ static int _brcmf_set_mac_address(dhd_info_t *dhd, int ifidx, u8 *addr)
ioc.len = 32;
ioc.set = true;
- ret = brcmf_proto_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
+ 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(&dhd->pub, ifidx)));
+ brcmf_ifname(&drvr_priv->pub, ifidx)));
} else {
- memcpy(dhd->iflist[ifidx]->net->dev_addr, addr, ETH_ALEN);
+ memcpy(drvr_priv->iflist[ifidx]->net->dev_addr, addr, ETH_ALEN);
}
return ret;
@@ -568,12 +572,12 @@ extern struct net_device *ap_net_dev;
static void brcmf_op_if(dhd_if_t *ifp)
{
- dhd_info_t *dhd;
+ dhd_info_t *drvr_priv;
int ret = 0, err = 0;
ASSERT(ifp && ifp->info && ifp->idx); /* Virtual interfaces only */
- dhd = ifp->info;
+ drvr_priv = ifp->info;
DHD_TRACE(("%s: idx %d, state %d\n", __func__, ifp->idx, ifp->state));
@@ -592,15 +596,15 @@ static void brcmf_op_if(dhd_if_t *ifp)
free_netdev(ifp->net);
}
/* Allocate etherdev, including space for private structure */
- ifp->net = alloc_etherdev(sizeof(dhd));
+ ifp->net = alloc_etherdev(sizeof(drvr_priv));
if (!ifp->net) {
DHD_ERROR(("%s: OOM - alloc_etherdev\n", __func__));
ret = -ENOMEM;
}
if (ret == 0) {
strcpy(ifp->net->name, ifp->name);
- memcpy(netdev_priv(ifp->net), &dhd, sizeof(dhd));
- err = brcmf_net_attach(&dhd->pub, ifp->idx);
+ 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: dhd_net_attach failed, "
"err %d\n",
@@ -646,7 +650,7 @@ static void brcmf_op_if(dhd_if_t *ifp)
if (ifp->net)
free_netdev(ifp->net);
- dhd->iflist[ifp->idx] = NULL;
+ drvr_priv->iflist[ifp->idx] = NULL;
kfree(ifp);
#ifdef SOFTAP
if (ifp->net == ap_net_dev)
@@ -658,7 +662,7 @@ static void brcmf_op_if(dhd_if_t *ifp)
static int _brcmf_sysioc_thread(void *data)
{
- dhd_info_t *dhd = (dhd_info_t *) data;
+ dhd_info_t *drvr_priv = (dhd_info_t *) data;
int i;
#ifdef SOFTAP
bool in_ap = false;
@@ -666,46 +670,48 @@ static int _brcmf_sysioc_thread(void *data)
allow_signal(SIGTERM);
- while (down_interruptible(&dhd->sysioc_sem) == 0) {
+ while (down_interruptible(&drvr_priv->sysioc_sem) == 0) {
if (kthread_should_stop())
break;
for (i = 0; i < DHD_MAX_IFS; i++) {
- if (dhd->iflist[i]) {
+ if (drvr_priv->iflist[i]) {
#ifdef SOFTAP
in_ap = (ap_net_dev != NULL);
#endif /* SOFTAP */
- if (dhd->iflist[i]->state)
- brcmf_op_if(dhd->iflist[i]);
+ if (drvr_priv->iflist[i]->state)
+ brcmf_op_if(drvr_priv->iflist[i]);
#ifdef SOFTAP
- if (dhd->iflist[i] == NULL) {
+ if (drvr_priv->iflist[i] == NULL) {
DHD_TRACE(("\n\n %s: interface %d "
"removed!\n", __func__, i));
continue;
}
- if (in_ap && dhd->set_macaddress) {
+ if (in_ap && drvr_priv->set_macaddress) {
DHD_TRACE(("attempt to set MAC for %s "
"in AP Mode," "blocked.\n",
- dhd->iflist[i]->net->name));
- dhd->set_macaddress = false;
+ drvr_priv->iflist[i]->net->name));
+ drvr_priv->set_macaddress = false;
continue;
}
- if (in_ap && dhd->set_multicast) {
- DHD_TRACE(("attempt to set MULTICAST list for %s" "in AP Mode, blocked.\n",
- dhd->iflist[i]->net->name));
- dhd->set_multicast = false;
+ 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));
+ drvr_priv->set_multicast = false;
continue;
}
#endif /* SOFTAP */
- if (dhd->set_multicast) {
- dhd->set_multicast = false;
- _brcmf_set_multicast_list(dhd, i);
+ if (drvr_priv->set_multicast) {
+ drvr_priv->set_multicast = false;
+ _brcmf_set_multicast_list(drvr_priv, i);
}
- if (dhd->set_macaddress) {
- dhd->set_macaddress = false;
- _brcmf_set_mac_address(dhd, i,
- dhd->macvalue);
+ if (drvr_priv->set_macaddress) {
+ drvr_priv->set_macaddress = false;
+ _brcmf_set_mac_address(drvr_priv, i,
+ drvr_priv->macvalue);
}
}
}
@@ -717,42 +723,42 @@ static int brcmf_netdev_set_mac_address(struct net_device *dev, void *addr)
{
int ret = 0;
- dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(dev);
+ dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(dev);
struct sockaddr *sa = (struct sockaddr *)addr;
int ifidx;
- ifidx = brcmf_net2idx(dhd, dev);
+ ifidx = brcmf_net2idx(drvr_priv, dev);
if (ifidx == DHD_BAD_IF)
return -1;
- ASSERT(dhd->sysioc_tsk);
- memcpy(&dhd->macvalue, sa->sa_data, ETH_ALEN);
- dhd->set_macaddress = true;
- up(&dhd->sysioc_sem);
+ ASSERT(drvr_priv->sysioc_tsk);
+ memcpy(&drvr_priv->macvalue, sa->sa_data, ETH_ALEN);
+ drvr_priv->set_macaddress = true;
+ up(&drvr_priv->sysioc_sem);
return ret;
}
static void brcmf_netdev_set_multicast_list(struct net_device *dev)
{
- dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(dev);
+ dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(dev);
int ifidx;
- ifidx = brcmf_net2idx(dhd, dev);
+ ifidx = brcmf_net2idx(drvr_priv, dev);
if (ifidx == DHD_BAD_IF)
return;
- ASSERT(dhd->sysioc_tsk);
- dhd->set_multicast = true;
- up(&dhd->sysioc_sem);
+ ASSERT(drvr_priv->sysioc_tsk);
+ drvr_priv->set_multicast = true;
+ up(&drvr_priv->sysioc_sem);
}
-int brcmf_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf)
+int brcmf_sendpkt(dhd_pub_t *drvr, int ifidx, struct sk_buff *pktbuf)
{
- dhd_info_t *dhd = (dhd_info_t *) (dhdp->info);
+ dhd_info_t *drvr_priv = drvr->info;
/* Reject if down */
- if (!dhdp->up || (dhdp->busstate == DHD_BUS_DOWN))
+ if (!drvr->up || (drvr->busstate == DHD_BUS_DOWN))
return -ENODEV;
/* Update multicast statistic */
@@ -761,35 +767,35 @@ int brcmf_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf)
struct ethhdr *eh = (struct ethhdr *)pktdata;
if (is_multicast_ether_addr(eh->h_dest))
- dhdp->tx_multicast++;
+ drvr->tx_multicast++;
if (ntohs(eh->h_proto) == ETH_P_PAE)
- atomic_inc(&dhd->pend_8021x_cnt);
+ atomic_inc(&drvr_priv->pend_8021x_cnt);
}
/* If the protocol uses a data header, apply it */
- brcmf_proto_hdrpush(dhdp, ifidx, pktbuf);
+ brcmf_proto_hdrpush(drvr, ifidx, pktbuf);
/* Use bus module to send data frame */
- return brcmf_sdbrcm_bus_txdata(dhdp->bus, pktbuf);
+ return brcmf_sdbrcm_bus_txdata(drvr->bus, pktbuf);
}
static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *net)
{
int ret;
- dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
+ dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(net);
int ifidx;
DHD_TRACE(("%s: Enter\n", __func__));
/* Reject if down */
- if (!dhd->pub.up || (dhd->pub.busstate == DHD_BUS_DOWN)) {
+ if (!drvr_priv->pub.up || (drvr_priv->pub.busstate == DHD_BUS_DOWN)) {
DHD_ERROR(("%s: xmit rejected pub.up=%d busstate=%d\n",
- __func__, dhd->pub.up, dhd->pub.busstate));
+ __func__, drvr_priv->pub.up, drvr_priv->pub.busstate));
netif_stop_queue(net);
return -ENODEV;
}
- ifidx = brcmf_net2idx(dhd, net);
+ ifidx = brcmf_net2idx(drvr_priv, net);
if (ifidx == DHD_BAD_IF) {
DHD_ERROR(("%s: bad ifidx %d\n", __func__, ifidx));
netif_stop_queue(net);
@@ -797,55 +803,55 @@ static int brcmf_netdev_start_xmit(struct sk_buff *skb, struct net_device *net)
}
/* Make sure there's enough room for any header */
- if (skb_headroom(skb) < dhd->pub.hdrlen) {
+ if (skb_headroom(skb) < drvr_priv->pub.hdrlen) {
struct sk_buff *skb2;
DHD_INFO(("%s: insufficient headroom\n",
- brcmf_ifname(&dhd->pub, ifidx)));
- dhd->pub.tx_realloc++;
- skb2 = skb_realloc_headroom(skb, dhd->pub.hdrlen);
+ 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(&dhd->pub, ifidx)));
+ brcmf_ifname(&drvr_priv->pub, ifidx)));
ret = -ENOMEM;
goto done;
}
}
- ret = brcmf_sendpkt(&dhd->pub, ifidx, skb);
+ ret = brcmf_sendpkt(&drvr_priv->pub, ifidx, skb);
done:
if (ret)
- dhd->pub.dstats.tx_dropped++;
+ drvr_priv->pub.dstats.tx_dropped++;
else
- dhd->pub.tx_packets++;
+ drvr_priv->pub.tx_packets++;
/* Return ok: we always eat the packet */
return 0;
}
-void brcmf_txflowcontrol(dhd_pub_t *dhdp, int ifidx, bool state)
+void brcmf_txflowcontrol(dhd_pub_t *drvr, int ifidx, bool state)
{
struct net_device *net;
- dhd_info_t *dhd = dhdp->info;
+ dhd_info_t *drvr_priv = drvr->info;
DHD_TRACE(("%s: Enter\n", __func__));
- dhdp->txoff = state;
- ASSERT(dhd && dhd->iflist[ifidx]);
- net = dhd->iflist[ifidx]->net;
+ drvr->txoff = state;
+ ASSERT(drvr_priv && drvr_priv->iflist[ifidx]);
+ net = drvr_priv->iflist[ifidx]->net;
if (state == ON)
netif_stop_queue(net);
else
netif_wake_queue(net);
}
-void brcmf_rx_frame(dhd_pub_t *dhdp, int ifidx, struct sk_buff *skb,
+void brcmf_rx_frame(dhd_pub_t *drvr, int ifidx, struct sk_buff *skb,
int numpkt)
{
- dhd_info_t *dhd = (dhd_info_t *) dhdp->info;
+ dhd_info_t *drvr_priv = drvr->info;
unsigned char *eth;
uint len;
void *data;
@@ -878,16 +884,16 @@ void brcmf_rx_frame(dhd_pub_t *dhdp, int ifidx, struct sk_buff *skb,
eth = skb->data;
len = skb->len;
- ifp = dhd->iflist[ifidx];
+ ifp = drvr_priv->iflist[ifidx];
if (ifp == NULL)
- ifp = dhd->iflist[0];
+ ifp = drvr_priv->iflist[0];
ASSERT(ifp);
skb->dev = ifp->net;
skb->protocol = eth_type_trans(skb, skb->dev);
if (skb->pkt_type == PACKET_MULTICAST)
- dhd->pub.rx_multicast++;
+ drvr_priv->pub.rx_multicast++;
skb->data = eth;
skb->len = len;
@@ -897,19 +903,20 @@ void brcmf_rx_frame(dhd_pub_t *dhdp, int ifidx, struct sk_buff *skb,
/* Process special event packets and then discard them */
if (ntohs(skb->protocol) == ETH_P_LINK_CTL)
- brcmf_host_event(dhd, &ifidx,
+ brcmf_host_event(drvr_priv, &ifidx,
skb_mac_header(skb),
&event, &data);
- ASSERT(ifidx < DHD_MAX_IFS && dhd->iflist[ifidx]);
- if (dhd->iflist[ifidx] && !dhd->iflist[ifidx]->state)
- ifp = dhd->iflist[ifidx];
+ ASSERT(ifidx < DHD_MAX_IFS && drvr_priv->iflist[ifidx]);
+ if (drvr_priv->iflist[ifidx] &&
+ !drvr_priv->iflist[ifidx]->state)
+ ifp = drvr_priv->iflist[ifidx];
if (ifp->net)
ifp->net->last_rx = jiffies;
- dhdp->dstats.rx_bytes += skb->len;
- dhdp->rx_packets++; /* Local count */
+ drvr->dstats.rx_bytes += skb->len;
+ drvr->rx_packets++; /* Local count */
if (in_interrupt()) {
netif_rx(skb);
@@ -925,66 +932,66 @@ void brcmf_rx_frame(dhd_pub_t *dhdp, int ifidx, struct sk_buff *skb,
}
}
-void brcmf_event(struct dhd_info *dhd, char *evpkt, int evlen, int ifidx)
+void brcmf_event(struct dhd_info *drvr_priv, char *evpkt, int evlen, int ifidx)
{
/* Linux version has nothing to do */
return;
}
-void brcmf_txcomplete(dhd_pub_t *dhdp, struct sk_buff *txp, bool success)
+void brcmf_txcomplete(dhd_pub_t *drvr, struct sk_buff *txp, bool success)
{
uint ifidx;
- dhd_info_t *dhd = (dhd_info_t *) (dhdp->info);
+ dhd_info_t *drvr_priv = drvr->info;
struct ethhdr *eh;
u16 type;
- brcmf_proto_hdrpull(dhdp, &ifidx, txp);
+ brcmf_proto_hdrpull(drvr, &ifidx, txp);
eh = (struct ethhdr *)(txp->data);
type = ntohs(eh->h_proto);
if (type == ETH_P_PAE)
- atomic_dec(&dhd->pend_8021x_cnt);
+ atomic_dec(&drvr_priv->pend_8021x_cnt);
}
static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net)
{
- dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
+ dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(net);
dhd_if_t *ifp;
int ifidx;
DHD_TRACE(("%s: Enter\n", __func__));
- ifidx = brcmf_net2idx(dhd, net);
+ ifidx = brcmf_net2idx(drvr_priv, net);
if (ifidx == DHD_BAD_IF)
return NULL;
- ifp = dhd->iflist[ifidx];
- ASSERT(dhd && ifp);
+ ifp = drvr_priv->iflist[ifidx];
+ ASSERT(drvr_priv && ifp);
- if (dhd->pub.up) {
+ if (drvr_priv->pub.up) {
/* Use the protocol to get dongle stats */
- brcmf_proto_dstats(&dhd->pub);
+ brcmf_proto_dstats(&drvr_priv->pub);
}
/* Copy dongle stats to net device stats */
- ifp->stats.rx_packets = dhd->pub.dstats.rx_packets;
- ifp->stats.tx_packets = dhd->pub.dstats.tx_packets;
- ifp->stats.rx_bytes = dhd->pub.dstats.rx_bytes;
- ifp->stats.tx_bytes = dhd->pub.dstats.tx_bytes;
- ifp->stats.rx_errors = dhd->pub.dstats.rx_errors;
- ifp->stats.tx_errors = dhd->pub.dstats.tx_errors;
- ifp->stats.rx_dropped = dhd->pub.dstats.rx_dropped;
- ifp->stats.tx_dropped = dhd->pub.dstats.tx_dropped;
- ifp->stats.multicast = dhd->pub.dstats.multicast;
+ ifp->stats.rx_packets = drvr_priv->pub.dstats.rx_packets;
+ ifp->stats.tx_packets = drvr_priv->pub.dstats.tx_packets;
+ ifp->stats.rx_bytes = drvr_priv->pub.dstats.rx_bytes;
+ ifp->stats.tx_bytes = drvr_priv->pub.dstats.tx_bytes;
+ ifp->stats.rx_errors = drvr_priv->pub.dstats.rx_errors;
+ ifp->stats.tx_errors = drvr_priv->pub.dstats.tx_errors;
+ ifp->stats.rx_dropped = drvr_priv->pub.dstats.rx_dropped;
+ ifp->stats.tx_dropped = drvr_priv->pub.dstats.tx_dropped;
+ ifp->stats.multicast = drvr_priv->pub.dstats.multicast;
return &ifp->stats;
}
/* Retrieve current toe component enables, which are kept
as a bitmap in toe_ol iovar */
-static int brcmf_toe_get(dhd_info_t *dhd, int ifidx, u32 *toe_ol)
+static int brcmf_toe_get(dhd_info_t *drvr_priv, int ifidx, u32 *toe_ol)
{
wl_ioctl_t ioc;
char buf[32];
@@ -998,17 +1005,17 @@ static int brcmf_toe_get(dhd_info_t *dhd, int ifidx, u32 *toe_ol)
ioc.set = false;
strcpy(buf, "toe_ol");
- ret = brcmf_proto_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
+ ret = brcmf_proto_ioctl(&drvr_priv->pub, ifidx, &ioc, ioc.buf, ioc.len);
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(&dhd->pub, ifidx)));
+ brcmf_ifname(&drvr_priv->pub, ifidx)));
return -EOPNOTSUPP;
}
DHD_INFO(("%s: could not get toe_ol: ret=%d\n",
- brcmf_ifname(&dhd->pub, ifidx), ret));
+ brcmf_ifname(&drvr_priv->pub, ifidx), ret));
return ret;
}
@@ -1018,7 +1025,7 @@ static int brcmf_toe_get(dhd_info_t *dhd, int ifidx, u32 *toe_ol)
/* Set current toe component enables in toe_ol iovar,
and set toe global enable iovar */
-static int brcmf_toe_set(dhd_info_t *dhd, int ifidx, u32 toe_ol)
+static int brcmf_toe_set(dhd_info_t *drvr_priv, int ifidx, u32 toe_ol)
{
wl_ioctl_t ioc;
char buf[32];
@@ -1036,10 +1043,10 @@ static int brcmf_toe_set(dhd_info_t *dhd, int ifidx, u32 toe_ol)
strcpy(buf, "toe_ol");
memcpy(&buf[sizeof("toe_ol")], &toe_ol, sizeof(u32));
- ret = brcmf_proto_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
+ 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(&dhd->pub, ifidx), ret));
+ brcmf_ifname(&drvr_priv->pub, ifidx), ret));
return ret;
}
@@ -1050,10 +1057,10 @@ static int brcmf_toe_set(dhd_info_t *dhd, int ifidx, u32 toe_ol)
strcpy(buf, "toe");
memcpy(&buf[sizeof("toe")], &toe, sizeof(u32));
- ret = brcmf_proto_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
+ 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(&dhd->pub, ifidx), ret));
+ brcmf_ifname(&drvr_priv->pub, ifidx), ret));
return ret;
}
@@ -1063,10 +1070,10 @@ static int brcmf_toe_set(dhd_info_t *dhd, int ifidx, u32 toe_ol)
static void brcmf_ethtool_get_drvinfo(struct net_device *net,
struct ethtool_drvinfo *info)
{
- dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
+ dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(net);
sprintf(info->driver, KBUILD_MODNAME);
- sprintf(info->version, "%lu", dhd->pub.drv_version);
+ sprintf(info->version, "%lu", drvr_priv->pub.drv_version);
sprintf(info->fw_version, "%s", BCM4329_FW_NAME);
sprintf(info->bus_info, "%s", dev_name(&wl_cfg80211_get_sdio_func()->dev));
}
@@ -1075,7 +1082,7 @@ struct ethtool_ops brcmf_ethtool_ops = {
.get_drvinfo = brcmf_ethtool_get_drvinfo
};
-static int brcmf_ethtool(dhd_info_t *dhd, void *uaddr)
+static int brcmf_ethtool(dhd_info_t *drvr_priv, void *uaddr)
{
struct ethtool_drvinfo info;
char drvname[sizeof(info.driver)];
@@ -1109,18 +1116,18 @@ static int brcmf_ethtool(dhd_info_t *dhd, void *uaddr)
}
/* otherwise, require dongle to be up */
- else if (!dhd->pub.up) {
+ else if (!drvr_priv->pub.up) {
DHD_ERROR(("%s: dongle is not up\n", __func__));
return -ENODEV;
}
/* finally, report dongle driver type */
- else if (dhd->pub.iswl)
+ else if (drvr_priv->pub.iswl)
sprintf(info.driver, "wl");
else
sprintf(info.driver, "xx");
- sprintf(info.version, "%lu", dhd->pub.drv_version);
+ 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__,
@@ -1130,7 +1137,7 @@ static int brcmf_ethtool(dhd_info_t *dhd, void *uaddr)
/* Get toe offload components from dongle */
case ETHTOOL_GRXCSUM:
case ETHTOOL_GTXCSUM:
- ret = brcmf_toe_get(dhd, 0, &toe_cmpnt);
+ ret = brcmf_toe_get(drvr_priv, 0, &toe_cmpnt);
if (ret < 0)
return ret;
@@ -1151,7 +1158,7 @@ static int brcmf_ethtool(dhd_info_t *dhd, void *uaddr)
return -EFAULT;
/* Read the current settings, update and write back */
- ret = brcmf_toe_get(dhd, 0, &toe_cmpnt);
+ ret = brcmf_toe_get(drvr_priv, 0, &toe_cmpnt);
if (ret < 0)
return ret;
@@ -1163,17 +1170,17 @@ static int brcmf_ethtool(dhd_info_t *dhd, void *uaddr)
else
toe_cmpnt &= ~csum_dir;
- ret = brcmf_toe_set(dhd, 0, toe_cmpnt);
+ ret = brcmf_toe_set(drvr_priv, 0, toe_cmpnt);
if (ret < 0)
return ret;
/* If setting TX checksum mode, tell Linux the new mode */
if (cmd == ETHTOOL_STXCSUM) {
if (edata.data)
- dhd->iflist[0]->net->features |=
+ drvr_priv->iflist[0]->net->features |=
NETIF_F_IP_CSUM;
else
- dhd->iflist[0]->net->features &=
+ drvr_priv->iflist[0]->net->features &=
~NETIF_F_IP_CSUM;
}
@@ -1189,7 +1196,7 @@ static int brcmf_ethtool(dhd_info_t *dhd, void *uaddr)
static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
int cmd)
{
- dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
+ dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(net);
dhd_ioctl_t ioc;
int bcmerror = 0;
int buflen = 0;
@@ -1198,14 +1205,14 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
int ifidx;
bool is_set_key_cmd;
- ifidx = brcmf_net2idx(dhd, net);
+ ifidx = brcmf_net2idx(drvr_priv, net);
DHD_TRACE(("%s: ifidx %d, cmd 0x%04x\n", __func__, ifidx, cmd));
if (ifidx == DHD_BAD_IF)
return -1;
if (cmd == SIOCETHTOOL)
- return brcmf_ethtool(dhd, (void *)ifr->ifr_data);
+ return brcmf_ethtool(drvr_priv, (void *)ifr->ifr_data);
if (cmd != SIOCDEVPRIVATE)
return -EOPNOTSUPP;
@@ -1254,20 +1261,20 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
/* check for local dhd ioctl and handle it */
if (driver == DHD_IOCTL_MAGIC) {
- bcmerror = brcmf_c_ioctl((void *)&dhd->pub, &ioc, buf, buflen);
+ bcmerror = brcmf_c_ioctl((void *)&drvr_priv->pub, &ioc, buf, buflen);
if (bcmerror)
- dhd->pub.bcmerror = bcmerror;
+ drvr_priv->pub.bcmerror = bcmerror;
goto done;
}
/* send to dongle (must be up, and wl) */
- if ((dhd->pub.busstate != DHD_BUS_DATA)) {
+ if ((drvr_priv->pub.busstate != DHD_BUS_DATA)) {
DHD_ERROR(("%s DONGLE_DOWN,__func__\n", __func__));
bcmerror = -EIO;
goto done;
}
- if (!dhd->pub.iswl) {
+ if (!drvr_priv->pub.iswl) {
bcmerror = -EIO;
goto done;
}
@@ -1285,7 +1292,7 @@ static int brcmf_netdev_ioctl_entry(struct net_device *net, struct ifreq *ifr,
brcmf_netdev_wait_pend8021x(net);
bcmerror =
- brcmf_proto_ioctl(&dhd->pub, ifidx, (wl_ioctl_t *)&ioc, buf,
+ brcmf_proto_ioctl(&drvr_priv->pub, ifidx, (wl_ioctl_t *)&ioc, buf,
buflen);
done:
@@ -1305,15 +1312,15 @@ done:
static int brcmf_netdev_stop(struct net_device *net)
{
#if !defined(IGNORE_ETH0_DOWN)
- dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
+ dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(net);
DHD_TRACE(("%s: Enter\n", __func__));
wl_cfg80211_down();
- if (dhd->pub.up == 0)
+ if (drvr_priv->pub.up == 0)
return 0;
/* Set state and stop OS transmissions */
- dhd->pub.up = 0;
+ drvr_priv->pub.up = 0;
netif_stop_queue(net);
#else
DHD_ERROR(("BYPASS %s:due to BRCM compilation : under investigation\n",
@@ -1325,9 +1332,9 @@ static int brcmf_netdev_stop(struct net_device *net)
static int brcmf_netdev_open(struct net_device *net)
{
- dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(net);
+ dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(net);
u32 toe_ol;
- int ifidx = brcmf_net2idx(dhd, net);
+ int ifidx = brcmf_net2idx(drvr_priv, net);
s32 ret = 0;
DHD_TRACE(("%s: ifidx %d\n", __func__, ifidx));
@@ -1335,25 +1342,25 @@ static int brcmf_netdev_open(struct net_device *net)
if (ifidx == 0) { /* do it only for primary eth0 */
/* try to bring up bus */
- ret = brcmf_bus_start(&dhd->pub);
+ ret = brcmf_bus_start(&drvr_priv->pub);
if (ret != 0) {
DHD_ERROR(("%s: failed with code %d\n", __func__, ret));
return -1;
}
- atomic_set(&dhd->pend_8021x_cnt, 0);
+ atomic_set(&drvr_priv->pend_8021x_cnt, 0);
- memcpy(net->dev_addr, dhd->pub.mac, ETH_ALEN);
+ memcpy(net->dev_addr, drvr_priv->pub.mac, ETH_ALEN);
/* Get current TOE mode from dongle */
- if (brcmf_toe_get(dhd, ifidx, &toe_ol) >= 0
+ if (brcmf_toe_get(drvr_priv, ifidx, &toe_ol) >= 0
&& (toe_ol & TOE_TX_CSUM_OL) != 0)
- dhd->iflist[ifidx]->net->features |= NETIF_F_IP_CSUM;
+ drvr_priv->iflist[ifidx]->net->features |= NETIF_F_IP_CSUM;
else
- dhd->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);
- dhd->pub.up = 1;
+ drvr_priv->pub.up = 1;
if (unlikely(wl_cfg80211_up())) {
DHD_ERROR(("%s: failed to bring up cfg80211\n",
__func__));
@@ -1364,16 +1371,16 @@ static int brcmf_netdev_open(struct net_device *net)
}
int
-brcmf_add_if(dhd_info_t *dhd, int ifidx, void *handle, char *name,
+brcmf_add_if(dhd_info_t *drvr_priv, int ifidx, void *handle, char *name,
u8 *mac_addr, u32 flags, u8 bssidx)
{
dhd_if_t *ifp;
DHD_TRACE(("%s: idx %d, handle->%p\n", __func__, ifidx, handle));
- ASSERT(dhd && (ifidx < DHD_MAX_IFS));
+ ASSERT(drvr_priv && (ifidx < DHD_MAX_IFS));
- ifp = dhd->iflist[ifidx];
+ ifp = drvr_priv->iflist[ifidx];
if (!ifp) {
ifp = kmalloc(sizeof(dhd_if_t), GFP_ATOMIC);
if (!ifp) {
@@ -1383,8 +1390,8 @@ brcmf_add_if(dhd_info_t *dhd, int ifidx, void *handle, char *name,
}
memset(ifp, 0, sizeof(dhd_if_t));
- ifp->info = dhd;
- dhd->iflist[ifidx] = ifp;
+ ifp->info = drvr_priv;
+ drvr_priv->iflist[ifidx] = ifp;
strlcpy(ifp->name, name, IFNAMSIZ);
if (mac_addr != NULL)
memcpy(&ifp->mac_addr, mac_addr, ETH_ALEN);
@@ -1392,22 +1399,22 @@ brcmf_add_if(dhd_info_t *dhd, int ifidx, void *handle, char *name,
if (handle == NULL) {
ifp->state = BRCMF_E_IF_ADD;
ifp->idx = ifidx;
- ASSERT(dhd->sysioc_tsk);
- up(&dhd->sysioc_sem);
+ ASSERT(drvr_priv->sysioc_tsk);
+ up(&drvr_priv->sysioc_sem);
} else
ifp->net = (struct net_device *)handle;
return 0;
}
-void brcmf_del_if(dhd_info_t *dhd, int ifidx)
+void brcmf_del_if(dhd_info_t *drvr_priv, int ifidx)
{
dhd_if_t *ifp;
DHD_TRACE(("%s: idx %d\n", __func__, ifidx));
- ASSERT(dhd && ifidx && (ifidx < DHD_MAX_IFS));
- ifp = dhd->iflist[ifidx];
+ ASSERT(drvr_priv && ifidx && (ifidx < DHD_MAX_IFS));
+ ifp = drvr_priv->iflist[ifidx];
if (!ifp) {
DHD_ERROR(("%s: Null interface\n", __func__));
return;
@@ -1415,27 +1422,27 @@ void brcmf_del_if(dhd_info_t *dhd, int ifidx)
ifp->state = BRCMF_E_IF_DEL;
ifp->idx = ifidx;
- ASSERT(dhd->sysioc_tsk);
- up(&dhd->sysioc_sem);
+ ASSERT(drvr_priv->sysioc_tsk);
+ up(&drvr_priv->sysioc_sem);
}
dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
{
- dhd_info_t *dhd = NULL;
+ dhd_info_t *drvr_priv = NULL;
struct net_device *net;
DHD_TRACE(("%s: Enter\n", __func__));
/* Allocate etherdev, including space for private structure */
- net = alloc_etherdev(sizeof(dhd));
+ net = alloc_etherdev(sizeof(drvr_priv));
if (!net) {
DHD_ERROR(("%s: OOM - alloc_etherdev\n", __func__));
goto fail;
}
/* Allocate primary dhd_info */
- dhd = kzalloc(sizeof(dhd_info_t), GFP_ATOMIC);
- if (!dhd) {
+ drvr_priv = kzalloc(sizeof(dhd_info_t), GFP_ATOMIC);
+ if (!drvr_priv) {
DHD_ERROR(("%s: OOM - alloc dhd_info\n", __func__));
goto fail;
}
@@ -1443,7 +1450,7 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
/*
* Save the dhd_info into the priv
*/
- memcpy(netdev_priv(net), &dhd, sizeof(dhd));
+ memcpy(netdev_priv(net), &drvr_priv, sizeof(drvr_priv));
/* Set network interface name if it was provided as module parameter */
if (iface_name[0]) {
@@ -1457,50 +1464,50 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
strcat(net->name, "%d");
}
- if (brcmf_add_if(dhd, 0, (void *)net, net->name, NULL, 0, 0) ==
+ if (brcmf_add_if(drvr_priv, 0, (void *)net, net->name, NULL, 0, 0) ==
DHD_BAD_IF)
goto fail;
net->netdev_ops = NULL;
- sema_init(&dhd->proto_sem, 1);
+ sema_init(&drvr_priv->proto_sem, 1);
/* Initialize other structure content */
- init_waitqueue_head(&dhd->ioctl_resp_wait);
+ init_waitqueue_head(&drvr_priv->ioctl_resp_wait);
/* Link to info module */
- dhd->pub.info = dhd;
+ drvr_priv->pub.info = drvr_priv;
/* Link to bus module */
- dhd->pub.bus = bus;
- dhd->pub.hdrlen = bus_hdrlen;
+ drvr_priv->pub.bus = bus;
+ drvr_priv->pub.hdrlen = bus_hdrlen;
/* Attach and link in the protocol */
- if (brcmf_proto_attach(&dhd->pub) != 0) {
+ if (brcmf_proto_attach(&drvr_priv->pub) != 0) {
DHD_ERROR(("dhd_prot_attach failed\n"));
goto fail;
}
/* Attach and link in the cfg80211 */
- if (unlikely(wl_cfg80211_attach(net, &dhd->pub))) {
+ if (unlikely(wl_cfg80211_attach(net, &drvr_priv->pub))) {
DHD_ERROR(("wl_cfg80211_attach failed\n"));
goto fail;
}
if (brcmf_sysioc) {
- sema_init(&dhd->sysioc_sem, 0);
- dhd->sysioc_tsk = kthread_run(_brcmf_sysioc_thread, dhd,
+ sema_init(&drvr_priv->sysioc_sem, 0);
+ drvr_priv->sysioc_tsk = kthread_run(_brcmf_sysioc_thread, drvr_priv,
"_dhd_sysioc");
- if (IS_ERR(dhd->sysioc_tsk)) {
+ if (IS_ERR(drvr_priv->sysioc_tsk)) {
printk(KERN_WARNING
"_dhd_sysioc thread failed to start\n");
- dhd->sysioc_tsk = NULL;
+ drvr_priv->sysioc_tsk = NULL;
}
} else
- dhd->sysioc_tsk = NULL;
+ drvr_priv->sysioc_tsk = NULL;
/*
* Save the dhd_info into the priv
*/
- memcpy(netdev_priv(net), &dhd, sizeof(dhd));
+ memcpy(netdev_priv(net), &drvr_priv, sizeof(drvr_priv));
#if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC)
g_bus = bus;
@@ -1511,36 +1518,36 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
/* && defined(DHD_GPL) */
/* Init lock suspend to prevent kernel going to suspend */
#ifdef CONFIG_HAS_EARLYSUSPEND
- dhd->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 20;
- dhd->early_suspend.suspend = brcmf_early_suspend;
- dhd->early_suspend.resume = brcmf_late_resume;
- register_early_suspend(&dhd->early_suspend);
+ drvr_priv->early_suspend.level = EARLY_SUSPEND_LEVEL_BLANK_SCREEN + 20;
+ drvr_priv->early_suspend.suspend = brcmf_early_suspend;
+ drvr_priv->early_suspend.resume = brcmf_late_resume;
+ register_early_suspend(&drvr_priv->early_suspend);
#endif
- return &dhd->pub;
+ return &drvr_priv->pub;
fail:
if (net)
free_netdev(net);
- if (dhd)
- brcmf_detach(&dhd->pub);
+ if (drvr_priv)
+ brcmf_detach(&drvr_priv->pub);
return NULL;
}
-int brcmf_bus_start(dhd_pub_t *dhdp)
+int brcmf_bus_start(dhd_pub_t *drvr)
{
int ret = -1;
- dhd_info_t *dhd = (dhd_info_t *) dhdp->info;
+ dhd_info_t *drvr_priv = drvr->info;
char iovbuf[WL_EVENTING_MASK_LEN + 12]; /* Room for "event_msgs" +
'\0' + bitvec */
- ASSERT(dhd);
+ ASSERT(drvr_priv);
DHD_TRACE(("%s:\n", __func__));
/* Bring up the bus */
- ret = brcmf_sdbrcm_bus_init(&dhd->pub, true);
+ ret = brcmf_sdbrcm_bus_init(&drvr_priv->pub, true);
if (ret != 0) {
DHD_ERROR(("%s, brcmf_sdbrcm_bus_init failed %d\n", __func__,
ret));
@@ -1548,51 +1555,51 @@ int brcmf_bus_start(dhd_pub_t *dhdp)
}
/* If bus is not ready, can't come up */
- if (dhd->pub.busstate != DHD_BUS_DATA) {
+ if (drvr_priv->pub.busstate != DHD_BUS_DATA) {
DHD_ERROR(("%s failed bus is not ready\n", __func__));
return -ENODEV;
}
- brcmu_mkiovar("event_msgs", dhdp->eventmask, WL_EVENTING_MASK_LEN,
+ brcmu_mkiovar("event_msgs", drvr->eventmask, WL_EVENTING_MASK_LEN,
iovbuf, sizeof(iovbuf));
- brcmf_proto_cdc_query_ioctl(dhdp, 0, BRCMF_C_GET_VAR, iovbuf,
+ brcmf_proto_cdc_query_ioctl(drvr, 0, BRCMF_C_GET_VAR, iovbuf,
sizeof(iovbuf));
- memcpy(dhdp->eventmask, iovbuf, WL_EVENTING_MASK_LEN);
-
- setbit(dhdp->eventmask, BRCMF_E_SET_SSID);
- setbit(dhdp->eventmask, BRCMF_E_PRUNE);
- setbit(dhdp->eventmask, BRCMF_E_AUTH);
- setbit(dhdp->eventmask, BRCMF_E_REASSOC);
- setbit(dhdp->eventmask, BRCMF_E_REASSOC_IND);
- setbit(dhdp->eventmask, BRCMF_E_DEAUTH_IND);
- setbit(dhdp->eventmask, BRCMF_E_DISASSOC_IND);
- setbit(dhdp->eventmask, BRCMF_E_DISASSOC);
- setbit(dhdp->eventmask, BRCMF_E_JOIN);
- setbit(dhdp->eventmask, BRCMF_E_ASSOC_IND);
- setbit(dhdp->eventmask, BRCMF_E_PSK_SUP);
- setbit(dhdp->eventmask, BRCMF_E_LINK);
- setbit(dhdp->eventmask, BRCMF_E_NDIS_LINK);
- setbit(dhdp->eventmask, BRCMF_E_MIC_ERROR);
- setbit(dhdp->eventmask, BRCMF_E_PMKID_CACHE);
- setbit(dhdp->eventmask, BRCMF_E_TXFAIL);
- setbit(dhdp->eventmask, BRCMF_E_JOIN_START);
- setbit(dhdp->eventmask, BRCMF_E_SCAN_COMPLETE);
+ memcpy(drvr->eventmask, iovbuf, WL_EVENTING_MASK_LEN);
+
+ setbit(drvr->eventmask, BRCMF_E_SET_SSID);
+ setbit(drvr->eventmask, BRCMF_E_PRUNE);
+ setbit(drvr->eventmask, BRCMF_E_AUTH);
+ setbit(drvr->eventmask, BRCMF_E_REASSOC);
+ setbit(drvr->eventmask, BRCMF_E_REASSOC_IND);
+ setbit(drvr->eventmask, BRCMF_E_DEAUTH_IND);
+ setbit(drvr->eventmask, BRCMF_E_DISASSOC_IND);
+ setbit(drvr->eventmask, BRCMF_E_DISASSOC);
+ setbit(drvr->eventmask, BRCMF_E_JOIN);
+ setbit(drvr->eventmask, BRCMF_E_ASSOC_IND);
+ setbit(drvr->eventmask, BRCMF_E_PSK_SUP);
+ setbit(drvr->eventmask, BRCMF_E_LINK);
+ setbit(drvr->eventmask, BRCMF_E_NDIS_LINK);
+ setbit(drvr->eventmask, BRCMF_E_MIC_ERROR);
+ setbit(drvr->eventmask, BRCMF_E_PMKID_CACHE);
+ setbit(drvr->eventmask, BRCMF_E_TXFAIL);
+ setbit(drvr->eventmask, BRCMF_E_JOIN_START);
+ setbit(drvr->eventmask, BRCMF_E_SCAN_COMPLETE);
/* enable dongle roaming event */
- dhdp->pktfilter_count = 1;
+ drvr->pktfilter_count = 1;
/* Setup filter to allow only unicast */
- dhdp->pktfilter[0] = "100 0 0 0 0x01 0x00";
+ drvr->pktfilter[0] = "100 0 0 0 0x01 0x00";
/* Bus is ready, do any protocol initialization */
- ret = brcmf_proto_init(&dhd->pub);
+ ret = brcmf_proto_init(&drvr_priv->pub);
if (ret < 0)
return ret;
return 0;
}
-int brcmf_iovar(dhd_pub_t *pub, int ifidx, char *name, char *cmd_buf,
+int brcmf_iovar(dhd_pub_t *drvr, int ifidx, char *name, char *cmd_buf,
uint cmd_len, int set)
{
char buf[strlen(name) + 1 + cmd_len];
@@ -1609,7 +1616,7 @@ int brcmf_iovar(dhd_pub_t *pub, int ifidx, char *name, char *cmd_buf,
ioc.len = len;
ioc.set = set;
- ret = brcmf_proto_ioctl(pub, ifidx, &ioc, ioc.buf, ioc.len);
+ ret = brcmf_proto_ioctl(drvr, ifidx, &ioc, ioc.buf, ioc.len);
if (!set && ret >= 0)
memcpy(cmd_buf, buf, cmd_len);
@@ -1626,18 +1633,18 @@ static struct net_device_ops brcmf_netdev_ops_pri = {
.ndo_set_multicast_list = brcmf_netdev_set_multicast_list
};
-int brcmf_net_attach(dhd_pub_t *dhdp, int ifidx)
+int brcmf_net_attach(dhd_pub_t *drvr, int ifidx)
{
- dhd_info_t *dhd = (dhd_info_t *) dhdp->info;
+ dhd_info_t *drvr_priv = drvr->info;
struct net_device *net;
u8 temp_addr[ETH_ALEN] = {
0x00, 0x90, 0x4c, 0x11, 0x22, 0x33};
DHD_TRACE(("%s: ifidx %d\n", __func__, ifidx));
- ASSERT(dhd && dhd->iflist[ifidx]);
+ ASSERT(drvr_priv && drvr_priv->iflist[ifidx]);
- net = dhd->iflist[ifidx]->net;
+ net = drvr_priv->iflist[ifidx]->net;
ASSERT(net);
ASSERT(!net->netdev_ops);
@@ -1648,7 +1655,7 @@ int brcmf_net_attach(dhd_pub_t *dhdp, int ifidx)
*/
if (ifidx != 0) {
/* for virtual interfaces use the primary MAC */
- memcpy(temp_addr, dhd->pub.mac, ETH_ALEN);
+ memcpy(temp_addr, drvr_priv->pub.mac, ETH_ALEN);
}
@@ -1659,10 +1666,11 @@ int brcmf_net_attach(dhd_pub_t *dhdp, int ifidx)
- Locally Administered address */
}
- net->hard_header_len = ETH_HLEN + dhd->pub.hdrlen;
+ net->hard_header_len = ETH_HLEN + drvr_priv->pub.hdrlen;
net->ethtool_ops = &brcmf_ethtool_ops;
- dhd->pub.rxsz = net->mtu + net->hard_header_len + dhd->pub.hdrlen;
+ drvr_priv->pub.rxsz = net->mtu + net->hard_header_len +
+ drvr_priv->pub.hdrlen;
memcpy(net->dev_addr, temp_addr, ETH_ALEN);
@@ -1681,69 +1689,70 @@ fail:
return -EBADE;
}
-static void brcmf_bus_detach(dhd_pub_t *dhdp)
+static void brcmf_bus_detach(dhd_pub_t *drvr)
{
- dhd_info_t *dhd;
+ dhd_info_t *drvr_priv;
DHD_TRACE(("%s: Enter\n", __func__));
- if (dhdp) {
- dhd = (dhd_info_t *) dhdp->info;
- if (dhd) {
+ if (drvr) {
+ drvr_priv = drvr->info;
+ if (drvr_priv) {
/* Stop the protocol module */
- brcmf_proto_stop(&dhd->pub);
+ brcmf_proto_stop(&drvr_priv->pub);
/* Stop the bus module */
- brcmf_sdbrcm_bus_stop(dhd->pub.bus, true);
+ brcmf_sdbrcm_bus_stop(drvr_priv->pub.bus, true);
}
}
}
-void brcmf_detach(dhd_pub_t *dhdp)
+void brcmf_detach(dhd_pub_t *drvr)
{
- dhd_info_t *dhd;
+ dhd_info_t *drvr_priv;
DHD_TRACE(("%s: Enter\n", __func__));
- if (dhdp) {
- dhd = (dhd_info_t *) dhdp->info;
- if (dhd) {
+ if (drvr) {
+ drvr_priv = drvr->info;
+ if (drvr_priv) {
dhd_if_t *ifp;
int i;
#if defined(CONFIG_HAS_EARLYSUSPEND)
- if (dhd->early_suspend.suspend)
- unregister_early_suspend(&dhd->early_suspend);
+ if (drvr_priv->early_suspend.suspend)
+ unregister_early_suspend(
+ &drvr_priv->early_suspend);
#endif /* defined(CONFIG_HAS_EARLYSUSPEND) */
for (i = 1; i < DHD_MAX_IFS; i++)
- if (dhd->iflist[i])
- brcmf_del_if(dhd, i);
+ if (drvr_priv->iflist[i])
+ brcmf_del_if(drvr_priv, i);
- ifp = dhd->iflist[0];
+ ifp = drvr_priv->iflist[0];
ASSERT(ifp);
if (ifp->net->netdev_ops == &brcmf_netdev_ops_pri) {
brcmf_netdev_stop(ifp->net);
unregister_netdev(ifp->net);
}
- if (dhd->sysioc_tsk) {
- send_sig(SIGTERM, dhd->sysioc_tsk, 1);
- kthread_stop(dhd->sysioc_tsk);
- dhd->sysioc_tsk = NULL;
+ if (drvr_priv->sysioc_tsk) {
+ send_sig(SIGTERM, drvr_priv->sysioc_tsk, 1);
+ kthread_stop(drvr_priv->sysioc_tsk);
+ drvr_priv->sysioc_tsk = NULL;
}
- brcmf_bus_detach(dhdp);
+ brcmf_bus_detach(drvr);
- if (dhdp->prot)
- brcmf_proto_detach(dhdp);
+ if (drvr->prot)
+ brcmf_proto_detach(drvr);
wl_cfg80211_detach();
/* && defined(DHD_GPL) */
free_netdev(ifp->net);
kfree(ifp);
- kfree(dhd);
+ kfree(drvr_priv);
}
}
}
@@ -1779,23 +1788,23 @@ module_exit(brcmf_module_cleanup);
/*
* OS specific functions required to implement DHD driver in OS independent way
*/
-int brcmf_os_proto_block(dhd_pub_t *pub)
+int brcmf_os_proto_block(dhd_pub_t *drvr)
{
- dhd_info_t *dhd = (dhd_info_t *) (pub->info);
+ dhd_info_t *drvr_priv = drvr->info;
- if (dhd) {
- down(&dhd->proto_sem);
+ if (drvr_priv) {
+ down(&drvr_priv->proto_sem);
return 1;
}
return 0;
}
-int brcmf_os_proto_unblock(dhd_pub_t *pub)
+int brcmf_os_proto_unblock(dhd_pub_t *drvr)
{
- dhd_info_t *dhd = (dhd_info_t *) (pub->info);
+ dhd_info_t *drvr_priv = drvr->info;
- if (dhd) {
- up(&dhd->proto_sem);
+ if (drvr_priv) {
+ up(&drvr_priv->proto_sem);
return 1;
}
@@ -1812,9 +1821,9 @@ void brcmf_os_set_ioctl_resp_timeout(unsigned int timeout_msec)
brcmf_ioctl_timeout_msec = (int)timeout_msec;
}
-int brcmf_os_ioctl_resp_wait(dhd_pub_t *pub, uint *condition, bool *pending)
+int brcmf_os_ioctl_resp_wait(dhd_pub_t *drvr, uint *condition, bool *pending)
{
- dhd_info_t *dhd = (dhd_info_t *) (pub->info);
+ dhd_info_t *drvr_priv = drvr->info;
DECLARE_WAITQUEUE(wait, current);
int timeout = brcmf_ioctl_timeout_msec;
@@ -1822,7 +1831,7 @@ int brcmf_os_ioctl_resp_wait(dhd_pub_t *pub, uint *condition, bool *pending)
timeout = timeout * HZ / 1000;
/* Wait until control frame is available */
- add_wait_queue(&dhd->ioctl_resp_wait, &wait);
+ add_wait_queue(&drvr_priv->ioctl_resp_wait, &wait);
set_current_state(TASK_INTERRUPTIBLE);
while (!(*condition) && (!signal_pending(current) && timeout))
@@ -1832,57 +1841,57 @@ int brcmf_os_ioctl_resp_wait(dhd_pub_t *pub, uint *condition, bool *pending)
*pending = true;
set_current_state(TASK_RUNNING);
- remove_wait_queue(&dhd->ioctl_resp_wait, &wait);
+ remove_wait_queue(&drvr_priv->ioctl_resp_wait, &wait);
return timeout;
}
-int brcmf_os_ioctl_resp_wake(dhd_pub_t *pub)
+int brcmf_os_ioctl_resp_wake(dhd_pub_t *drvr)
{
- dhd_info_t *dhd = (dhd_info_t *) (pub->info);
+ dhd_info_t *drvr_priv = drvr->info;
- if (waitqueue_active(&dhd->ioctl_resp_wait))
- wake_up_interruptible(&dhd->ioctl_resp_wait);
+ if (waitqueue_active(&drvr_priv->ioctl_resp_wait))
+ wake_up_interruptible(&drvr_priv->ioctl_resp_wait);
return 0;
}
-static int brcmf_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata,
+static int brcmf_host_event(dhd_info_t *drvr_priv, int *ifidx, void *pktdata,
brcmf_event_msg_t *event, void **data)
{
int bcmerror = 0;
- ASSERT(dhd != NULL);
+ ASSERT(drvr_priv != NULL);
- bcmerror = brcmf_c_host_event(dhd, ifidx, pktdata, event, data);
+ bcmerror = brcmf_c_host_event(drvr_priv, ifidx, pktdata, event, data);
if (bcmerror != 0)
return bcmerror;
- ASSERT(dhd->iflist[*ifidx] != NULL);
- ASSERT(dhd->iflist[*ifidx]->net != NULL);
- if (dhd->iflist[*ifidx]->net)
- wl_cfg80211_event(dhd->iflist[*ifidx]->net, event, *data);
+ ASSERT(drvr_priv->iflist[*ifidx] != NULL);
+ ASSERT(drvr_priv->iflist[*ifidx]->net != NULL);
+ if (drvr_priv->iflist[*ifidx]->net)
+ wl_cfg80211_event(drvr_priv->iflist[*ifidx]->net, event, *data);
return bcmerror;
}
int brcmf_netdev_reset(struct net_device *dev, u8 flag)
{
- dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
+ dhd_info_t *drvr_priv = *(dhd_info_t **)netdev_priv(dev);
- brcmf_bus_devreset(&dhd->pub, flag);
+ brcmf_bus_devreset(&drvr_priv->pub, flag);
return 1;
}
int brcmf_netdev_set_suspend_disable(struct net_device *dev, int val)
{
- dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
+ dhd_info_t *drvr_priv = *(dhd_info_t **)netdev_priv(dev);
int ret = 0;
- if (dhd) {
- ret = dhd->pub.suspend_disable_flag;
- dhd->pub.suspend_disable_flag = val;
+ if (drvr_priv) {
+ ret = drvr_priv->pub.suspend_disable_flag;
+ drvr_priv->pub.suspend_disable_flag = val;
}
return ret;
}
@@ -1891,12 +1900,12 @@ int brcmf_netdev_set_suspend(struct net_device *dev, int val)
{
int ret = 0;
#if defined(CONFIG_HAS_EARLYSUSPEND)
- dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
+ dhd_info_t *drvr_priv = *(dhd_info_t **)netdev_priv(dev);
- if (dhd) {
- brcmf_os_proto_block(&dhd->pub);
- ret = brcmf_set_suspend(val, &dhd->pub);
- brcmf_os_proto_unblock(&dhd->pub);
+ if (drvr_priv) {
+ brcmf_os_proto_block(&drvr_priv->pub);
+ ret = brcmf_set_suspend(val, &drvr_priv->pub);
+ brcmf_os_proto_unblock(&drvr_priv->pub);
}
#endif /* defined(CONFIG_HAS_EARLYSUSPEND) */
return ret;
@@ -1904,17 +1913,17 @@ int brcmf_netdev_set_suspend(struct net_device *dev, int val)
int brcmf_netdev_set_dtim_skip(struct net_device *dev, int val)
{
- dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(dev);
+ dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(dev);
- if (dhd)
- dhd->pub.dtim_skip = val;
+ if (drvr_priv)
+ drvr_priv->pub.dtim_skip = val;
return 0;
}
int brcmf_netdev_set_packet_filter(struct net_device *dev, int val)
{
- dhd_info_t *dhd = *(dhd_info_t **) netdev_priv(dev);
+ dhd_info_t *drvr_priv = *(dhd_info_t **) netdev_priv(dev);
int ret = 0;
/* Packet filtering is set only if we still in early-suspend and
@@ -1922,37 +1931,37 @@ int brcmf_netdev_set_packet_filter(struct net_device *dev, int val)
* We can always turn it OFF in case of early-suspend, but we turn it
* back ON only if suspend_disable_flag was not set
*/
- if (dhd && dhd->pub.up) {
- brcmf_os_proto_block(&dhd->pub);
- if (dhd->pub.in_suspend) {
- if (!val || (val && !dhd->pub.suspend_disable_flag))
- brcmf_set_packet_filter(val, &dhd->pub);
+ if (drvr_priv && drvr_priv->pub.up) {
+ brcmf_os_proto_block(&drvr_priv->pub);
+ if (drvr_priv->pub.in_suspend) {
+ if (!val || (val && !drvr_priv->pub.suspend_disable_flag))
+ brcmf_set_packet_filter(val, &drvr_priv->pub);
}
- brcmf_os_proto_unblock(&dhd->pub);
+ brcmf_os_proto_unblock(&drvr_priv->pub);
}
return ret;
}
void brcmf_netdev_init_ioctl(struct net_device *dev)
{
- dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
+ dhd_info_t *drvr_priv = *(dhd_info_t **)netdev_priv(dev);
- brcmf_c_preinit_ioctls(&dhd->pub);
+ brcmf_c_preinit_ioctls(&drvr_priv->pub);
}
-static int brcmf_get_pend_8021x_cnt(dhd_info_t *dhd)
+static int brcmf_get_pend_8021x_cnt(dhd_info_t *drvr_priv)
{
- return atomic_read(&dhd->pend_8021x_cnt);
+ return atomic_read(&drvr_priv->pend_8021x_cnt);
}
#define MAX_WAIT_FOR_8021X_TX 10
int brcmf_netdev_wait_pend8021x(struct net_device *dev)
{
- dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
+ dhd_info_t *drvr_priv = *(dhd_info_t **)netdev_priv(dev);
int timeout = 10 * HZ / 1000;
int ntimes = MAX_WAIT_FOR_8021X_TX;
- int pend = brcmf_get_pend_8021x_cnt(dhd);
+ int pend = brcmf_get_pend_8021x_cnt(drvr_priv);
while (ntimes && pend) {
if (pend) {
@@ -1961,13 +1970,13 @@ int brcmf_netdev_wait_pend8021x(struct net_device *dev)
set_current_state(TASK_RUNNING);
ntimes--;
}
- pend = brcmf_get_pend_8021x_cnt(dhd);
+ pend = brcmf_get_pend_8021x_cnt(drvr_priv);
}
return pend;
}
#ifdef BCMDBG
-int brcmf_write_to_file(dhd_pub_t *dhd, u8 *buf, int size)
+int brcmf_write_to_file(dhd_pub_t *drvr, u8 *buf, int size)
{
int ret = 0;
struct file *fp;
--
1.7.1
2011/6/30 Franky Lin <[email protected]>:
> Most of these patches are brcmfmac cleanup.
Hm, interesting improvement in your "Release early, release often" strategy.
---------- Wiadomość przekazana dalej ----------
Od: Henry Ptasinski <[email protected]>
Data: 1 czerwca 2011 18:23
Temat: Re: [PATCH 01/83] staging: brcm80211: removed unused Broadcom
specific ioctls codes
On 06/01/2011 04:59 AM, Rafał Miłecki wrote:
>
> 2011/6/1 Roland Vossen<[email protected]>:
>>
>> Code cleanup. Removal of code that is not invoked.
>
> Have you heard of "Release early, release often"? It's something, we
> like here...
These are all changes that piled up during the merge window.
We had some issues previously with patch dependencies when sending
patches out early and often, so we're trying to organize the patches a
little better. Perhaps we went a little to far with this set. We'll
try to find a better balance in the future.
From: Arend van Spriel <[email protected]>
Renamed remaining brcmfmac module parameters to more consistent
naming convention.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 74 ++++++++++++------------
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 42 +++++++-------
2 files changed, 58 insertions(+), 58 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index fb5bef0..5aa4492 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -248,15 +248,15 @@ module_param_string(firmware_path, firmware_path, MOD_PARAM_PATHLEN, 0);
module_param_string(nvram_path, nvram_path, MOD_PARAM_PATHLEN, 0);
/* No firmware required */
-bool dhd_no_fw_req;
-module_param(dhd_no_fw_req, bool, 0);
+bool brcmf_no_fw_req;
+module_param(brcmf_no_fw_req, bool, 0);
/* Error bits */
module_param(brcmf_msg_level, int, 0);
/* Spawn a thread for system ioctls (set mac, set mcast) */
-uint dhd_sysioc = true;
-module_param(dhd_sysioc, uint, 0);
+uint brcmf_sysioc = true;
+module_param(brcmf_sysioc, uint, 0);
/* Watchdog interval */
uint brcmf_watchdog_ms = 10;
@@ -290,16 +290,16 @@ uint brcmf_master_mode = true;
module_param(brcmf_master_mode, uint, 1);
/* Watchdog thread priority, -1 to use kernel timer */
-int dhd_watchdog_prio = 97;
-module_param(dhd_watchdog_prio, int, 0);
+int brcmf_watchdog_prio = 97;
+module_param(brcmf_watchdog_prio, int, 0);
/* DPC thread priority, -1 to use tasklet */
-int dhd_dpc_prio = 98;
-module_param(dhd_dpc_prio, int, 0);
+int brcmf_dpc_prio = 98;
+module_param(brcmf_dpc_prio, int, 0);
/* DPC thread priority, -1 to use tasklet */
-extern int dhd_dongle_memsize;
-module_param(dhd_dongle_memsize, int, 0);
+extern int brcmf_dongle_memsize;
+module_param(brcmf_dongle_memsize, int, 0);
/* Contorl fw roaming */
#ifdef CUSTOMER_HW2
@@ -318,7 +318,7 @@ module_param_string(iface_name, iface_name, IFNAMSIZ, 0);
/* The following are specific to the SDIO dongle */
/* IOCTL response timeout */
-int dhd_ioctl_timeout_msec = IOCTL_RESP_TIMEOUT;
+int brcmf_ioctl_timeout_msec = IOCTL_RESP_TIMEOUT;
/* Idle timeout for backplane clock */
int brcmf_idletime = BRCMF_IDLETIME_TICKS;
@@ -337,14 +337,14 @@ uint brcmf_sdiod_drive_strength = 6;
module_param(brcmf_sdiod_drive_strength, uint, 0);
/* Tx/Rx bounds */
-extern uint dhd_txbound;
-extern uint dhd_rxbound;
-module_param(dhd_txbound, uint, 0);
-module_param(dhd_rxbound, uint, 0);
+extern uint brcmf_txbound;
+extern uint brcmf_rxbound;
+module_param(brcmf_txbound, uint, 0);
+module_param(brcmf_rxbound, uint, 0);
/* Deferred transmits */
-extern uint dhd_deferred_tx;
-module_param(dhd_deferred_tx, uint, 0);
+extern uint brcmf_deferred_tx;
+module_param(brcmf_deferred_tx, uint, 0);
#ifdef SDTEST
/* Echo packet generator (pkts/s) */
@@ -1204,10 +1204,10 @@ static int brcmf_watchdog_thread(void *data)
* so get rid of all our resources
*/
#ifdef DHD_SCHED
- if (dhd_watchdog_prio > 0) {
+ if (brcmf_watchdog_prio > 0) {
struct sched_param param;
- param.sched_priority = (dhd_watchdog_prio < MAX_RT_PRIO) ?
- dhd_watchdog_prio : (MAX_RT_PRIO - 1);
+ param.sched_priority = (brcmf_watchdog_prio < MAX_RT_PRIO) ?
+ brcmf_watchdog_prio : (MAX_RT_PRIO - 1);
sched_setscheduler(current, SCHED_FIFO, ¶m);
}
#endif /* DHD_SCHED */
@@ -1264,11 +1264,11 @@ static int brcmf_dpc_thread(void *data)
* so get rid of all our resources
*/
#ifdef DHD_SCHED
- if (dhd_dpc_prio > 0) {
+ if (brcmf_dpc_prio > 0) {
struct sched_param param;
param.sched_priority =
- (dhd_dpc_prio <
- MAX_RT_PRIO) ? dhd_dpc_prio : (MAX_RT_PRIO - 1);
+ (brcmf_dpc_prio <
+ MAX_RT_PRIO) ? brcmf_dpc_prio : (MAX_RT_PRIO - 1);
sched_setscheduler(current, SCHED_FIFO, ¶m);
}
#endif /* DHD_SCHED */
@@ -1843,7 +1843,7 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
DHD_ERROR(("wl_cfg80211_attach failed\n"));
goto fail;
}
- if (!dhd_no_fw_req) {
+ if (!brcmf_no_fw_req) {
strcpy(brcmf_fw_path, wl_cfg80211_get_fwname());
strcpy(brcmf_nv_path, wl_cfg80211_get_nvramname());
}
@@ -1855,12 +1855,12 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
/* Initialize thread based operation and lock */
sema_init(&dhd->sdsem, 1);
- if ((dhd_watchdog_prio >= 0) && (dhd_dpc_prio >= 0))
+ if ((brcmf_watchdog_prio >= 0) && (brcmf_dpc_prio >= 0))
dhd->threads_only = true;
else
dhd->threads_only = false;
- if (dhd_dpc_prio >= 0) {
+ if (brcmf_dpc_prio >= 0) {
/* Initialize watchdog thread */
sema_init(&dhd->watchdog_sem, 0);
dhd->watchdog_tsk = kthread_run(brcmf_watchdog_thread, dhd,
@@ -1875,7 +1875,7 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
}
/* Set up the bottom half handler */
- if (dhd_dpc_prio >= 0) {
+ if (brcmf_dpc_prio >= 0) {
/* Initialize DPC thread */
sema_init(&dhd->dpc_sem, 0);
dhd->dpc_tsk = kthread_run(brcmf_dpc_thread, dhd, "dhd_dpc");
@@ -1889,7 +1889,7 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
dhd->dpc_tsk = NULL;
}
- if (dhd_sysioc) {
+ if (brcmf_sysioc) {
sema_init(&dhd->sysioc_sem, 0);
dhd->sysioc_tsk = kthread_run(_brcmf_sysioc_thread, dhd,
"_dhd_sysioc");
@@ -2228,12 +2228,12 @@ static int __init brcmf_module_init(void)
/* Sanity check on the module parameters */
do {
/* Both watchdog and DPC as tasklets are ok */
- if ((dhd_watchdog_prio < 0) && (dhd_dpc_prio < 0))
+ if ((brcmf_watchdog_prio < 0) && (brcmf_dpc_prio < 0))
break;
/* If both watchdog and DPC are threads, TX must be deferred */
- if ((dhd_watchdog_prio >= 0) && (dhd_dpc_prio >= 0)
- && dhd_deferred_tx)
+ if ((brcmf_watchdog_prio >= 0) && (brcmf_dpc_prio >= 0)
+ && brcmf_deferred_tx)
break;
DHD_ERROR(("Invalid module parameters.\n"));
@@ -2307,19 +2307,19 @@ int brcmf_os_proto_unblock(dhd_pub_t *pub)
unsigned int brcmf_os_get_ioctl_resp_timeout(void)
{
- return (unsigned int)dhd_ioctl_timeout_msec;
+ return (unsigned int)brcmf_ioctl_timeout_msec;
}
void brcmf_os_set_ioctl_resp_timeout(unsigned int timeout_msec)
{
- dhd_ioctl_timeout_msec = (int)timeout_msec;
+ brcmf_ioctl_timeout_msec = (int)timeout_msec;
}
int brcmf_os_ioctl_resp_wait(dhd_pub_t *pub, uint *condition, bool *pending)
{
dhd_info_t *dhd = (dhd_info_t *) (pub->info);
DECLARE_WAITQUEUE(wait, current);
- int timeout = dhd_ioctl_timeout_msec;
+ int timeout = brcmf_ioctl_timeout_msec;
/* Convert timeout in millsecond to jiffies */
timeout = timeout * HZ / 1000;
@@ -2399,7 +2399,7 @@ void *brcmf_os_open_image(char *filename)
{
struct file *fp;
- if (!dhd_no_fw_req)
+ if (!brcmf_no_fw_req)
return wl_cfg80211_request_fw(filename);
fp = filp_open(filename, O_RDONLY, 0);
@@ -2420,7 +2420,7 @@ int brcmf_os_get_image_block(char *buf, int len, void *image)
struct file *fp = (struct file *)image;
int rdlen;
- if (!dhd_no_fw_req)
+ if (!brcmf_no_fw_req)
return wl_cfg80211_read_fw(buf, len);
if (!image)
@@ -2435,7 +2435,7 @@ int brcmf_os_get_image_block(char *buf, int len, void *image)
void brcmf_os_close_image(void *image)
{
- if (!dhd_no_fw_req)
+ if (!brcmf_no_fw_req)
return wl_cfg80211_release_fw();
if (image)
filp_close((struct file *)image, NULL);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 905afbc..003f485 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -650,16 +650,16 @@ static int tx_packets[NUMPRIO];
#endif /* DHD_DEBUG */
/* Deferred transmit */
-const uint dhd_deferred_tx = 1;
+const uint brcmf_deferred_tx = 1;
/* Tx/Rx bounds */
-uint dhd_txbound;
-uint dhd_rxbound;
+uint brcmf_txbound;
+uint brcmf_rxbound;
uint dhd_txminmax;
/* override the RAM size if possible */
#define DONGLE_MIN_MEMSIZE (128 * 1024)
-int dhd_dongle_memsize;
+int brcmf_dongle_memsize;
static bool dhd_alignctl;
@@ -807,10 +807,10 @@ static void brcmf_sdbrcm_setmemsize(struct dhd_bus *bus, int mem_size)
s32 min_size = DONGLE_MIN_MEMSIZE;
/* Restrict the memsize to user specified limit */
DHD_ERROR(("user: Restrict the dongle ram size to %d, min %d\n",
- dhd_dongle_memsize, min_size));
- if ((dhd_dongle_memsize > min_size) &&
- (dhd_dongle_memsize < (s32) bus->orig_ramsize))
- bus->ramsize = dhd_dongle_memsize;
+ brcmf_dongle_memsize, min_size));
+ if ((brcmf_dongle_memsize > min_size) &&
+ (brcmf_dongle_memsize < (s32) bus->orig_ramsize))
+ bus->ramsize = brcmf_dongle_memsize;
}
static int brcmf_sdbrcm_set_siaddr_window(dhd_bus_t *bus, u32 address)
@@ -1363,7 +1363,7 @@ int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
/* Check for existing queue, current flow-control,
pending event, or pending clock */
- if (dhd_deferred_tx || bus->fcstate || pktq_len(&bus->txq)
+ if (brcmf_deferred_tx || bus->fcstate || pktq_len(&bus->txq)
|| bus->dpc_sched || (!DATAOK(bus))
|| (bus->flowcontrol & NBITVAL(prec))
|| (bus->clkstate != CLK_AVAIL)) {
@@ -1392,7 +1392,7 @@ int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
qcount[prec] = pktq_plen(&bus->txq, prec);
#endif
/* Schedule DPC if needed to send queued packet(s) */
- if (dhd_deferred_tx && !bus->dpc_sched) {
+ if (brcmf_deferred_tx && !bus->dpc_sched) {
bus->dpc_sched = true;
brcmf_sched_dpc(bus->dhd);
}
@@ -2703,21 +2703,21 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
break;
case IOV_GVAL(IOV_TXBOUND):
- int_val = (s32) dhd_txbound;
+ int_val = (s32) brcmf_txbound;
memcpy(arg, &int_val, val_size);
break;
case IOV_SVAL(IOV_TXBOUND):
- dhd_txbound = (uint) int_val;
+ brcmf_txbound = (uint) int_val;
break;
case IOV_GVAL(IOV_RXBOUND):
- int_val = (s32) dhd_rxbound;
+ int_val = (s32) brcmf_rxbound;
memcpy(arg, &int_val, val_size);
break;
case IOV_SVAL(IOV_RXBOUND):
- dhd_rxbound = (uint) int_val;
+ brcmf_rxbound = (uint) int_val;
break;
case IOV_GVAL(IOV_TXMINMAX):
@@ -4443,8 +4443,8 @@ bool brcmf_sdbrcm_dpc(dhd_bus_t *bus)
struct sdpcmd_regs *regs = bus->regs;
u32 intstatus, newstatus = 0;
uint retries = 0;
- uint rxlimit = dhd_rxbound; /* Rx frames to read before resched */
- uint txlimit = dhd_txbound; /* Tx frames to send before resched */
+ uint rxlimit = brcmf_rxbound; /* Rx frames to read before resched */
+ uint txlimit = brcmf_txbound; /* Tx frames to send before resched */
uint framecnt = 0; /* Temporary counter of tx/rx frames */
bool rxdone = true; /* Flag for no more read data */
bool resched = false; /* Flag indicating resched wanted */
@@ -5201,13 +5201,13 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
* first time that the driver is initialized vs subsequent
* initializations.
*/
- dhd_txbound = DHD_TXBOUND;
- dhd_rxbound = DHD_RXBOUND;
+ brcmf_txbound = DHD_TXBOUND;
+ brcmf_rxbound = DHD_RXBOUND;
dhd_alignctl = true;
sd1idle = true;
dhd_readahead = true;
retrydata = false;
- dhd_dongle_memsize = 0;
+ brcmf_dongle_memsize = 0;
dhd_txminmax = DHD_TXMINMAX;
forcealign = true;
@@ -5402,8 +5402,8 @@ brcmf_sdbrcm_probe_attach(struct dhd_bus *bus, void *sdh, void *regsva,
goto fail;
}
bus->ramsize = bus->orig_ramsize;
- if (dhd_dongle_memsize)
- brcmf_sdbrcm_setmemsize(bus, dhd_dongle_memsize);
+ if (brcmf_dongle_memsize)
+ brcmf_sdbrcm_setmemsize(bus, brcmf_dongle_memsize);
DHD_ERROR(("DHD: dongle ram size is set to %d(orig %d)\n",
bus->ramsize, bus->orig_ramsize));
--
1.7.1
From: Roland Vossen <[email protected]>
Code cleanup.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
.../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c | 1 -
1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
index 0a632f5..cdaa042 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c
@@ -252,7 +252,6 @@ int brcmf_sdio_function_init(void)
/*
* module cleanup
*/
-extern int brcmf_sdio_remove(struct device *dev);
void brcmf_sdio_function_cleanup(void)
{
sd_trace(("%s Enter\n", __func__));
--
1.7.1
From: Arend van Spriel <[email protected]>
This commit gets rid of variables whose name is a broadcom specific
acronym and not very meaningful.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/dhd.h | 79 ++++----
drivers/staging/brcm80211/brcmfmac/dhd_bus.h | 8 +-
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 115 +++++-----
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 294 ++++++++++++-------------
4 files changed, 246 insertions(+), 250 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index d063afb..9f627e5 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -708,27 +708,27 @@ extern const bcmevent_name_t bcmevent_names[];
extern const int bcmevent_names_size;
-static inline void MUTEX_LOCK_INIT(struct brcmf_pub *dhdp)
+static inline void MUTEX_LOCK_INIT(struct brcmf_pub *drvr)
{
}
-static inline void MUTEX_LOCK(struct brcmf_pub *dhdp)
+static inline void MUTEX_LOCK(struct brcmf_pub *drvr)
{
}
-static inline void MUTEX_UNLOCK(struct brcmf_pub *dhdp)
+static inline void MUTEX_UNLOCK(struct brcmf_pub *drvr)
{
}
-static inline void MUTEX_LOCK_SOFTAP_SET_INIT(struct brcmf_pub *dhdp)
+static inline void MUTEX_LOCK_SOFTAP_SET_INIT(struct brcmf_pub *drvr)
{
}
-static inline void MUTEX_LOCK_SOFTAP_SET(struct brcmf_pub *dhdp)
+static inline void MUTEX_LOCK_SOFTAP_SET(struct brcmf_pub *drvr)
{
}
-static inline void MUTEX_UNLOCK_SOFTAP_SET(struct brcmf_pub *dhdp)
+static inline void MUTEX_UNLOCK_SOFTAP_SET(struct brcmf_pub *drvr)
{
}
@@ -754,85 +754,86 @@ static inline void MUTEX_UNLOCK_WL_SCAN_SET(void)
* bus_hdrlen specifies required headroom for bus module header.
*/
extern struct brcmf_pub *brcmf_attach(struct dhd_bus *bus,
- uint bus_hdrlen);
-extern int brcmf_net_attach(struct brcmf_pub *dhdp, int idx);
+ uint bus_hdrlen);
+extern int brcmf_net_attach(struct brcmf_pub *drvr, int idx);
extern int brcmf_netdev_wait_pend8021x(struct net_device *dev);
/* Indication from bus module regarding removal/absence of dongle */
-extern void brcmf_detach(struct brcmf_pub *dhdp);
+extern void brcmf_detach(struct brcmf_pub *drvr);
/* Indication from bus module to change flow-control state */
-extern void brcmf_txflowcontrol(struct brcmf_pub *dhdp, int ifidx, bool on);
+extern void brcmf_txflowcontrol(struct brcmf_pub *drvr, int ifidx, bool on);
-extern bool brcmf_c_prec_enq(struct brcmf_pub *dhdp, struct pktq *q,
+extern bool brcmf_c_prec_enq(struct brcmf_pub *drvr, struct pktq *q,
struct sk_buff *pkt, int prec);
/* Receive frame for delivery to OS. Callee disposes of rxp. */
-extern void brcmf_rx_frame(struct brcmf_pub *dhdp, int ifidx,
+extern void brcmf_rx_frame(struct brcmf_pub *drvr, int ifidx,
struct sk_buff *rxp, int numpkt);
/* Return pointer to interface name */
-extern char *brcmf_ifname(struct brcmf_pub *dhdp, int idx);
+extern char *brcmf_ifname(struct brcmf_pub *drvr, int idx);
/* Request scheduling of the bus dpc */
-extern void brcmf_sched_dpc(struct brcmf_pub *dhdp);
+extern void brcmf_sched_dpc(struct brcmf_pub *drvr);
/* Notify tx completion */
-extern void brcmf_txcomplete(struct brcmf_pub *dhdp, struct sk_buff *txp,
+extern void brcmf_txcomplete(struct brcmf_pub *drvr, struct sk_buff *txp,
bool success);
/* Query ioctl */
-extern int brcmf_proto_cdc_query_ioctl(struct brcmf_pub *dhd, int ifidx,
+extern int brcmf_proto_cdc_query_ioctl(struct brcmf_pub *drvr, int ifidx,
uint cmd, void *buf, uint len);
/* OS independent layer functions */
-extern int brcmf_os_proto_block(struct brcmf_pub *pub);
-extern int brcmf_os_proto_unblock(struct brcmf_pub *pub);
-extern int brcmf_os_ioctl_resp_wait(struct brcmf_pub *pub, uint *condition,
+extern int brcmf_os_proto_block(struct brcmf_pub *drvr);
+extern int brcmf_os_proto_unblock(struct brcmf_pub *drvr);
+extern int brcmf_os_ioctl_resp_wait(struct brcmf_pub *drvr, uint *condition,
bool *pending);
-extern int brcmf_os_ioctl_resp_wake(struct brcmf_pub *pub);
+extern int brcmf_os_ioctl_resp_wake(struct brcmf_pub *drvr);
extern unsigned int brcmf_os_get_ioctl_resp_timeout(void);
extern void brcmf_os_set_ioctl_resp_timeout(unsigned int timeout_msec);
-extern void brcmf_os_sdlock_sndup_rxq(struct brcmf_pub *pub);
+extern void brcmf_os_sdlock_sndup_rxq(struct brcmf_pub *drvr);
extern void brcmf_customer_gpio_wlan_ctrl(int onoff);
extern int brcmf_custom_get_mac_address(unsigned char *buf);
-extern void brcmf_os_sdunlock_sndup_rxq(struct brcmf_pub *pub);
-extern void brcmf_os_sdlock_eventq(struct brcmf_pub *pub);
-extern void brcmf_os_sdunlock_eventq(struct brcmf_pub *pub);
+extern void brcmf_os_sdunlock_sndup_rxq(struct brcmf_pub *drvr);
+extern void brcmf_os_sdlock_eventq(struct brcmf_pub *drvr);
+extern void brcmf_os_sdunlock_eventq(struct brcmf_pub *drvr);
#ifdef BCMDBG
-extern int brcmf_write_to_file(struct brcmf_pub *dhd, u8 *buf, int size);
+extern int brcmf_write_to_file(struct brcmf_pub *drvr, u8 *buf, int size);
#endif /* BCMDBG */
extern void brcmf_timeout_start(struct brcmf_timeout *tmo, uint usec);
extern int brcmf_timeout_expired(struct brcmf_timeout *tmo);
-extern int brcmf_ifname2idx(struct brcmf_info *dhd, char *name);
-extern int brcmf_c_host_event(struct brcmf_info *dhd, int *idx, void *pktdata,
- brcmf_event_msg_t *, void **data_ptr);
+extern int brcmf_ifname2idx(struct brcmf_info *drvr_priv, char *name);
+extern int brcmf_c_host_event(struct brcmf_info *drvr_priv, int *idx,
+ void *pktdata, brcmf_event_msg_t *,
+ void **data_ptr);
extern void brcmf_c_init(void);
-extern int brcmf_add_if(struct brcmf_info *dhd, int ifidx, void *handle,
+extern int brcmf_add_if(struct brcmf_info *drvr_priv, int ifidx, void *handle,
char *name, u8 *mac_addr, u32 flags, u8 bssidx);
-extern void brcmf_del_if(struct brcmf_info *dhd, int ifidx);
+extern void brcmf_del_if(struct brcmf_info *drvr_priv, int ifidx);
-extern void brcmf_vif_add(struct brcmf_info *dhd, int ifidx, char *name);
-extern void brcmf_vif_del(struct brcmf_info *dhd, int ifidx);
+extern void brcmf_vif_add(struct brcmf_info *drvr_priv, int ifidx, char *name);
+extern void brcmf_vif_del(struct brcmf_info *drvr_priv, int ifidx);
-extern void brcmf_event(struct brcmf_info *dhd, char *evpkt, int evlen,
+extern void brcmf_event(struct brcmf_info *drvr_priv, char *evpkt, int evlen,
int ifidx);
-extern void brcmf_vif_sendup(struct brcmf_info *dhd, int ifidx,
+extern void brcmf_vif_sendup(struct brcmf_info *drvr_priv, int ifidx,
unsigned char *cp, int len);
/* Send packet to dongle via data channel */
-extern int brcmf_sendpkt(struct brcmf_pub *dhdp, int ifidx,\
+extern int brcmf_sendpkt(struct brcmf_pub *drvr, int ifidx,\
struct sk_buff *pkt);
-extern int brcmf_bus_devreset(struct brcmf_pub *dhdp, u8 flag);
-extern int brcmf_bus_start(struct brcmf_pub *dhdp);
+extern int brcmf_bus_devreset(struct brcmf_pub *drvr, u8 flag);
+extern int brcmf_bus_start(struct brcmf_pub *drvr);
-extern void brcmf_c_pktfilter_offload_set(struct brcmf_pub *dhd, char *arg);
-extern void brcmf_c_pktfilter_offload_enable(struct brcmf_pub *dhd, char *arg,
+extern void brcmf_c_pktfilter_offload_set(struct brcmf_pub *drvr, char *arg);
+extern void brcmf_c_pktfilter_offload_enable(struct brcmf_pub *drvr, char *arg,
int enable, int master_mode);
#ifdef BCMDBG
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
index 95fcef4..096d73c 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
@@ -40,7 +40,7 @@ extern void dhd_bus_unregister(void);
extern void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex);
/* Initialize bus module: prepare for communication w/dongle */
-extern int brcmf_sdbrcm_bus_init(struct brcmf_pub *dhdp, bool enforce_mutex);
+extern int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex);
/* Send a data frame to the dongle. Callee disposes of txp. */
extern int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *txp);
@@ -58,16 +58,16 @@ extern void dhd_bus_isr(bool *InterruptRecognized,
bool *QueueMiniportHandleInterrupt, void *arg);
/* Check for and handle local prot-specific iovar commands */
-extern int brcmf_sdbrcm_bus_iovar_op(struct brcmf_pub *dhdp, const char *name,
+extern int brcmf_sdbrcm_bus_iovar_op(struct brcmf_pub *drvr, const char *name,
void *params, int plen, void *arg, int len,
bool set);
/* Add bus dump output to a buffer */
-extern void brcmf_sdbrcm_bus_dump(struct brcmf_pub *dhdp,
+extern void brcmf_sdbrcm_bus_dump(struct brcmf_pub *drvr,
struct brcmu_strbuf *strbuf);
/* Clear any bus counters */
-extern void dhd_bus_clearcounts(struct brcmf_pub *dhdp);
+extern void dhd_bus_clearcounts(struct brcmf_pub *drvr);
/* return the dongle chipid */
extern uint dhd_bus_chip(struct dhd_bus *bus);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index e28b727..d07860b 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -100,9 +100,9 @@ struct brcmf_proto {
unsigned char buf[BRCMF_C_IOCTL_MAXLEN + ROUND_UP_MARGIN];
};
-static int brcmf_proto_cdc_msg(struct brcmf_pub *dhd)
+static int brcmf_proto_cdc_msg(struct brcmf_pub *drvr)
{
- struct brcmf_proto *prot = dhd->prot;
+ struct brcmf_proto *prot = drvr->prot;
int len = le32_to_cpu(prot->msg.len) +
sizeof(struct brcmf_proto_cdc_ioctl);
@@ -116,19 +116,19 @@ static int brcmf_proto_cdc_msg(struct brcmf_pub *dhd)
len = CDC_MAX_MSG_SIZE;
/* Send request */
- return brcmf_sdbrcm_bus_txctl(dhd->bus, (unsigned char *)&prot->msg,
+ return brcmf_sdbrcm_bus_txctl(drvr->bus, (unsigned char *)&prot->msg,
len);
}
-static int brcmf_proto_cdc_cmplt(struct brcmf_pub *dhd, u32 id, u32 len)
+static int brcmf_proto_cdc_cmplt(struct brcmf_pub *drvr, u32 id, u32 len)
{
int ret;
- struct brcmf_proto *prot = dhd->prot;
+ struct brcmf_proto *prot = drvr->prot;
DHD_TRACE(("%s: Enter\n", __func__));
do {
- ret = brcmf_sdbrcm_bus_rxctl(dhd->bus,
+ ret = brcmf_sdbrcm_bus_rxctl(drvr->bus,
(unsigned char *)&prot->msg,
len + sizeof(struct brcmf_proto_cdc_ioctl));
if (ret < 0)
@@ -139,10 +139,10 @@ static int brcmf_proto_cdc_cmplt(struct brcmf_pub *dhd, u32 id, u32 len)
}
int
-brcmf_proto_cdc_query_ioctl(struct brcmf_pub *dhd, int ifidx, uint cmd,
+brcmf_proto_cdc_query_ioctl(struct brcmf_pub *drvr, int ifidx, uint cmd,
void *buf, uint len)
{
- struct brcmf_proto *prot = dhd->prot;
+ struct brcmf_proto *prot = drvr->prot;
struct brcmf_proto_cdc_ioctl *msg = &prot->msg;
void *info;
int ret = 0, retries = 0;
@@ -158,7 +158,7 @@ brcmf_proto_cdc_query_ioctl(struct brcmf_pub *dhd, int ifidx, uint cmd,
BCME_STRLEN);
goto done;
} else if (!strcmp((char *)buf, "bcmerror")) {
- *(int *)buf = dhd->dongle_error;
+ *(int *)buf = drvr->dongle_error;
goto done;
}
}
@@ -174,7 +174,7 @@ brcmf_proto_cdc_query_ioctl(struct brcmf_pub *dhd, int ifidx, uint cmd,
if (buf)
memcpy(prot->buf, buf, len);
- ret = brcmf_proto_cdc_msg(dhd);
+ ret = brcmf_proto_cdc_msg(drvr);
if (ret < 0) {
DHD_ERROR(("dhdcdc_query_ioctl: dhdcdc_msg failed w/status "
"%d\n", ret));
@@ -183,7 +183,7 @@ brcmf_proto_cdc_query_ioctl(struct brcmf_pub *dhd, int ifidx, uint cmd,
retry:
/* wait for interrupt and get first fragment */
- ret = brcmf_proto_cdc_cmplt(dhd, prot->reqid, len);
+ ret = brcmf_proto_cdc_cmplt(drvr, prot->reqid, len);
if (ret < 0)
goto done;
@@ -194,7 +194,7 @@ retry:
goto retry;
if (id != prot->reqid) {
DHD_ERROR(("%s: %s: unexpected request id %d (expected %d)\n",
- brcmf_ifname(dhd, ifidx), __func__, id,
+ brcmf_ifname(drvr, ifidx), __func__, id,
prot->reqid));
ret = -EINVAL;
goto done;
@@ -214,17 +214,17 @@ retry:
if (flags & CDCF_IOC_ERROR) {
ret = le32_to_cpu(msg->status);
/* Cache error from dongle */
- dhd->dongle_error = ret;
+ drvr->dongle_error = ret;
}
done:
return ret;
}
-int brcmf_proto_cdc_set_ioctl(struct brcmf_pub *dhd, int ifidx, uint cmd,
+int brcmf_proto_cdc_set_ioctl(struct brcmf_pub *drvr, int ifidx, uint cmd,
void *buf, uint len)
{
- struct brcmf_proto *prot = dhd->prot;
+ struct brcmf_proto *prot = drvr->prot;
struct brcmf_proto_cdc_ioctl *msg = &prot->msg;
int ret = 0;
u32 flags, id;
@@ -243,11 +243,11 @@ int brcmf_proto_cdc_set_ioctl(struct brcmf_pub *dhd, int ifidx, uint cmd,
if (buf)
memcpy(prot->buf, buf, len);
- ret = brcmf_proto_cdc_msg(dhd);
+ ret = brcmf_proto_cdc_msg(drvr);
if (ret < 0)
goto done;
- ret = brcmf_proto_cdc_cmplt(dhd, prot->reqid, len);
+ ret = brcmf_proto_cdc_cmplt(drvr, prot->reqid, len);
if (ret < 0)
goto done;
@@ -256,7 +256,7 @@ int brcmf_proto_cdc_set_ioctl(struct brcmf_pub *dhd, int ifidx, uint cmd,
if (id != prot->reqid) {
DHD_ERROR(("%s: %s: unexpected request id %d (expected %d)\n",
- brcmf_ifname(dhd, ifidx), __func__, id,
+ brcmf_ifname(drvr, ifidx), __func__, id,
prot->reqid));
ret = -EINVAL;
goto done;
@@ -266,7 +266,7 @@ int brcmf_proto_cdc_set_ioctl(struct brcmf_pub *dhd, int ifidx, uint cmd,
if (flags & CDCF_IOC_ERROR) {
ret = le32_to_cpu(msg->status);
/* Cache error from dongle */
- dhd->dongle_error = ret;
+ drvr->dongle_error = ret;
}
done:
@@ -274,18 +274,18 @@ done:
}
int
-brcmf_proto_ioctl(struct brcmf_pub *dhd, int ifidx, struct brcmf_ioctl *ioc,
+brcmf_proto_ioctl(struct brcmf_pub *drvr, int ifidx, struct brcmf_ioctl *ioc,
void *buf, int len)
{
- struct brcmf_proto *prot = dhd->prot;
+ struct brcmf_proto *prot = drvr->prot;
int ret = -1;
- if (dhd->busstate == DHD_BUS_DOWN) {
+ if (drvr->busstate == DHD_BUS_DOWN) {
DHD_ERROR(("%s : bus is down. we have nothing to do\n",
__func__));
return ret;
}
- brcmf_os_proto_block(dhd);
+ brcmf_os_proto_block(drvr);
DHD_TRACE(("%s: Enter\n", __func__));
@@ -309,9 +309,10 @@ brcmf_proto_ioctl(struct brcmf_pub *dhd, int ifidx, struct brcmf_ioctl *ioc,
prot->pending = true;
prot->lastcmd = ioc->cmd;
if (ioc->set)
- ret = brcmf_proto_cdc_set_ioctl(dhd, ifidx, ioc->cmd, buf, len);
+ ret = brcmf_proto_cdc_set_ioctl(drvr, ifidx, ioc->cmd,
+ buf, len);
else {
- ret = brcmf_proto_cdc_query_ioctl(dhd, ifidx, ioc->cmd,
+ ret = brcmf_proto_cdc_query_ioctl(drvr, ifidx, ioc->cmd,
buf, len);
if (ret > 0)
ioc->used = ret - sizeof(struct brcmf_proto_cdc_ioctl);
@@ -334,13 +335,13 @@ brcmf_proto_ioctl(struct brcmf_pub *dhd, int ifidx, struct brcmf_ioctl *ioc,
slen = strlen("wme_dp") + 1;
if (len >= (int)(slen + sizeof(int)))
memcpy(&val, (char *)buf + slen, sizeof(int));
- dhd->wme_dp = (u8) le32_to_cpu(val);
+ drvr->wme_dp = (u8) le32_to_cpu(val);
}
prot->pending = false;
done:
- brcmf_os_proto_unblock(dhd);
+ brcmf_os_proto_unblock(drvr);
return ret;
}
@@ -355,18 +356,18 @@ done:
skb->ip_summed is overloaded */
int
-brcmf_proto_iovar_op(struct brcmf_pub *dhdp, const char *name,
+brcmf_proto_iovar_op(struct brcmf_pub *drvr, const char *name,
void *params, int plen, void *arg, int len, bool set)
{
return -ENOTSUPP;
}
-void brcmf_proto_dump(struct brcmf_pub *dhdp, struct brcmu_strbuf *strbuf)
+void brcmf_proto_dump(struct brcmf_pub *drvr, struct brcmu_strbuf *strbuf)
{
- brcmu_bprintf(strbuf, "Protocol CDC: reqid %d\n", dhdp->prot->reqid);
+ brcmu_bprintf(strbuf, "Protocol CDC: reqid %d\n", drvr->prot->reqid);
}
-void brcmf_proto_hdrpush(struct brcmf_pub *dhd, int ifidx,
+void brcmf_proto_hdrpush(struct brcmf_pub *drvr, int ifidx,
struct sk_buff *pktbuf)
{
struct brcmf_proto_bdc_header *h;
@@ -389,7 +390,7 @@ void brcmf_proto_hdrpush(struct brcmf_pub *dhd, int ifidx,
BDC_SET_IF_IDX(h, ifidx);
}
-int brcmf_proto_hdrpull(struct brcmf_pub *dhd, int *ifidx,
+int brcmf_proto_hdrpull(struct brcmf_pub *drvr, int *ifidx,
struct sk_buff *pktbuf)
{
struct brcmf_proto_bdc_header *h;
@@ -416,14 +417,14 @@ int brcmf_proto_hdrpull(struct brcmf_pub *dhd, int *ifidx,
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(dhd, *ifidx), h->flags));
+ 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(dhd, *ifidx), h->flags));
+ brcmf_ifname(drvr, *ifidx), h->flags));
PKTSETSUMGOOD(pktbuf, true);
}
@@ -434,7 +435,7 @@ int brcmf_proto_hdrpull(struct brcmf_pub *dhd, int *ifidx,
return 0;
}
-int brcmf_proto_attach(struct brcmf_pub *dhd)
+int brcmf_proto_attach(struct brcmf_pub *drvr)
{
struct brcmf_proto *cdc;
@@ -450,9 +451,9 @@ int brcmf_proto_attach(struct brcmf_pub *dhd)
goto fail;
}
- dhd->prot = cdc;
- dhd->hdrlen += BDC_HEADER_LEN;
- dhd->maxctl = BRCMF_C_IOCTL_MAXLEN +
+ drvr->prot = cdc;
+ drvr->hdrlen += BDC_HEADER_LEN;
+ drvr->maxctl = BRCMF_C_IOCTL_MAXLEN +
sizeof(struct brcmf_proto_cdc_ioctl) + ROUND_UP_MARGIN;
return 0;
@@ -462,54 +463,54 @@ fail:
}
/* ~NOTE~ What if another thread is waiting on the semaphore? Holding it? */
-void brcmf_proto_detach(struct brcmf_pub *dhd)
+void brcmf_proto_detach(struct brcmf_pub *drvr)
{
- kfree(dhd->prot);
- dhd->prot = NULL;
+ kfree(drvr->prot);
+ drvr->prot = NULL;
}
-void brcmf_proto_dstats(struct brcmf_pub *dhd)
+void brcmf_proto_dstats(struct brcmf_pub *drvr)
{
/* No stats from dongle added yet, copy bus stats */
- dhd->dstats.tx_packets = dhd->tx_packets;
- dhd->dstats.tx_errors = dhd->tx_errors;
- dhd->dstats.rx_packets = dhd->rx_packets;
- dhd->dstats.rx_errors = dhd->rx_errors;
- dhd->dstats.rx_dropped = dhd->rx_dropped;
- dhd->dstats.multicast = dhd->rx_multicast;
+ drvr->dstats.tx_packets = drvr->tx_packets;
+ drvr->dstats.tx_errors = drvr->tx_errors;
+ drvr->dstats.rx_packets = drvr->rx_packets;
+ drvr->dstats.rx_errors = drvr->rx_errors;
+ drvr->dstats.rx_dropped = drvr->rx_dropped;
+ drvr->dstats.multicast = drvr->rx_multicast;
return;
}
-int brcmf_proto_init(struct brcmf_pub *dhd)
+int brcmf_proto_init(struct brcmf_pub *drvr)
{
int ret = 0;
char buf[128];
DHD_TRACE(("%s: Enter\n", __func__));
- brcmf_os_proto_block(dhd);
+ brcmf_os_proto_block(drvr);
/* Get the device MAC address */
strcpy(buf, "cur_etheraddr");
- ret = brcmf_proto_cdc_query_ioctl(dhd, 0, BRCMF_C_GET_VAR,
+ ret = brcmf_proto_cdc_query_ioctl(drvr, 0, BRCMF_C_GET_VAR,
buf, sizeof(buf));
if (ret < 0) {
- brcmf_os_proto_unblock(dhd);
+ brcmf_os_proto_unblock(drvr);
return ret;
}
- memcpy(dhd->mac, buf, ETH_ALEN);
+ memcpy(drvr->mac, buf, ETH_ALEN);
- brcmf_os_proto_unblock(dhd);
+ brcmf_os_proto_unblock(drvr);
- ret = brcmf_c_preinit_ioctls(dhd);
+ ret = brcmf_c_preinit_ioctls(drvr);
/* Always assumes wl for now */
- dhd->iswl = true;
+ drvr->iswl = true;
return ret;
}
-void brcmf_proto_stop(struct brcmf_pub *dhd)
+void brcmf_proto_stop(struct brcmf_pub *drvr)
{
/* Nothing to do for CDC */
}
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index c9ec69b..a69791e 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -543,7 +543,7 @@ struct chip_info {
/* Private data for SDIO bus interaction */
typedef struct dhd_bus {
- struct brcmf_pub *dhd;
+ struct brcmf_pub *drvr;
struct brcmf_sdio_card *card; /* Handle for sdio card calls */
struct chip_info *ci; /* Chip info struct */
@@ -781,7 +781,7 @@ uint dhd_txminmax;
#define DONGLE_MIN_MEMSIZE (128 * 1024)
int brcmf_dongle_memsize;
-static bool dhd_alignctl;
+static bool brcmf_alignctl;
static bool sd1idle;
@@ -817,7 +817,7 @@ static bool forcealign;
static const uint max_roundup = 512;
/* Try doing readahead */
-static bool dhd_readahead;
+static bool brcmf_readahead;
/* To check if there's window offered */
#define DATAOK(bus) \
@@ -1242,7 +1242,7 @@ int brcmf_sdbrcm_bussleep(dhd_bus_t *bus, bool sleep)
bus->sleeping = false;
/* Enable interrupts again */
- if (bus->intr && (bus->dhd->busstate == DHD_BUS_DATA)) {
+ if (bus->intr && (bus->drvr->busstate == DHD_BUS_DATA)) {
bus->intdis = false;
brcmf_sdcard_intr_enable(bus->card);
}
@@ -1275,7 +1275,7 @@ static int brcmf_sdbrcm_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
card = bus->card;
- if (bus->dhd->dongle_reset) {
+ if (bus->drvr->dongle_reset) {
ret = -EPERM;
goto done;
}
@@ -1288,7 +1288,7 @@ static int brcmf_sdbrcm_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
if (skb_headroom(pkt) < pad) {
DHD_INFO(("%s: insufficient headroom %d for %d pad\n",
__func__, skb_headroom(pkt), pad));
- bus->dhd->tx_realloc++;
+ bus->drvr->tx_realloc++;
new = brcmu_pkt_buf_get_skb(pkt->len + BRCMF_SDALIGN);
if (!new) {
DHD_ERROR(("%s: couldn't allocate new %d-byte "
@@ -1402,7 +1402,7 @@ done:
/* restore pkt buffer pointer before calling tx complete routine */
skb_pull(pkt, SDPCM_HDRLEN + pad);
brcmf_sdbrcm_sdunlock(bus);
- brcmf_txcomplete(bus->dhd, pkt, ret != 0);
+ brcmf_txcomplete(bus->drvr, pkt, ret != 0);
brcmf_sdbrcm_sdlock(bus);
if (free_pkt)
@@ -1452,9 +1452,9 @@ int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
/* Priority based enq */
spin_lock_bh(&bus->txqlock);
- if (brcmf_c_prec_enq(bus->dhd, &bus->txq, pkt, prec) == false) {
+ if (brcmf_c_prec_enq(bus->drvr, &bus->txq, pkt, prec) == false) {
skb_pull(pkt, SDPCM_HDRLEN);
- brcmf_txcomplete(bus->dhd, pkt, false);
+ brcmf_txcomplete(bus->drvr, pkt, false);
brcmu_pkt_buf_free_skb(pkt);
DHD_ERROR(("%s: out of bus->txq !!!\n", __func__));
ret = -ENOSR;
@@ -1464,7 +1464,7 @@ int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
spin_unlock_bh(&bus->txqlock);
if (pktq_len(&bus->txq) >= TXHI)
- brcmf_txflowcontrol(bus->dhd, 0, ON);
+ brcmf_txflowcontrol(bus->drvr, 0, ON);
#ifdef BCMDBG
if (pktq_plen(&bus->txq, prec) > qcount[prec])
@@ -1493,9 +1493,9 @@ int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
SDPCM_DATA_CHANNEL), true);
#endif
if (ret)
- bus->dhd->tx_errors++;
+ bus->drvr->tx_errors++;
else
- bus->dhd->dstats.tx_bytes += datalen;
+ bus->drvr->dstats.tx_bytes += datalen;
if (bus->idletime == BRCMF_IDLE_IMMEDIATE &&
!bus->dpc_sched) {
@@ -1519,7 +1519,7 @@ static uint brcmf_sdbrcm_sendfromq(dhd_bus_t *bus, uint maxframes)
uint datalen;
u8 tx_prec_map;
- struct brcmf_pub *dhd = bus->dhd;
+ struct brcmf_pub *drvr = bus->drvr;
struct sdpcmd_regs *regs = bus->regs;
DHD_TRACE(("%s: Enter\n", __func__));
@@ -1545,9 +1545,9 @@ static uint brcmf_sdbrcm_sendfromq(dhd_bus_t *bus, uint maxframes)
SDPCM_DATA_CHANNEL), true);
#endif
if (ret)
- bus->dhd->tx_errors++;
+ bus->drvr->tx_errors++;
else
- bus->dhd->dstats.tx_bytes += datalen;
+ bus->drvr->dstats.tx_bytes += datalen;
/* In poll mode, need to check for other events */
if (!bus->intr && cnt) {
@@ -1562,9 +1562,9 @@ static uint brcmf_sdbrcm_sendfromq(dhd_bus_t *bus, uint maxframes)
}
/* Deflow-control stack if needed */
- if (dhd->up && (dhd->busstate == DHD_BUS_DATA) &&
- dhd->txoff && (pktq_len(&bus->txq) < TXLOW))
- brcmf_txflowcontrol(dhd, 0, OFF);
+ if (drvr->up && (drvr->busstate == DHD_BUS_DATA) &&
+ drvr->txoff && (pktq_len(&bus->txq) < TXLOW))
+ brcmf_txflowcontrol(drvr, 0, OFF);
return cnt;
}
@@ -1583,7 +1583,7 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
DHD_TRACE(("%s: Enter\n", __func__));
- if (bus->dhd->dongle_reset)
+ if (bus->drvr->dongle_reset)
return -EIO;
/* Back the pointer to make a room for bus header */
@@ -1591,7 +1591,7 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
len = (msglen += SDPCM_HDRLEN);
/* Add alignment padding (optional for ctl frames) */
- if (dhd_alignctl) {
+ if (brcmf_alignctl) {
doff = ((unsigned long)frame % BRCMF_SDALIGN);
if (doff) {
frame -= doff;
@@ -1724,9 +1724,9 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
brcmf_sdbrcm_sdunlock(bus);
if (ret)
- bus->dhd->tx_ctlerrs++;
+ bus->drvr->tx_ctlerrs++;
else
- bus->dhd->tx_ctlpkts++;
+ bus->drvr->tx_ctlpkts++;
return ret ? -EIO : 0;
}
@@ -1739,11 +1739,11 @@ int brcmf_sdbrcm_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
DHD_TRACE(("%s: Enter\n", __func__));
- if (bus->dhd->dongle_reset)
+ if (bus->drvr->dongle_reset)
return -EIO;
/* Wait until control frame is available */
- timeleft = brcmf_os_ioctl_resp_wait(bus->dhd, &bus->rxlen, &pending);
+ timeleft = brcmf_os_ioctl_resp_wait(bus->drvr, &bus->rxlen, &pending);
brcmf_sdbrcm_sdlock(bus);
rxlen = bus->rxlen;
@@ -1774,9 +1774,9 @@ int brcmf_sdbrcm_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
}
if (rxlen)
- bus->dhd->rx_ctlpkts++;
+ bus->drvr->rx_ctlpkts++;
else
- bus->dhd->rx_ctlerrs++;
+ bus->drvr->rx_ctlerrs++;
return rxlen ? (int)rxlen : -ETIMEDOUT;
}
@@ -1886,9 +1886,9 @@ dhd_dump_pct(struct brcmu_strbuf *strbuf, char *desc, uint num, uint div)
}
}
-void brcmf_sdbrcm_bus_dump(struct brcmf_pub *dhdp, struct brcmu_strbuf *strbuf)
+void brcmf_sdbrcm_bus_dump(struct brcmf_pub *drvr, struct brcmu_strbuf *strbuf)
{
- dhd_bus_t *bus = dhdp->bus;
+ dhd_bus_t *bus = drvr->bus;
brcmu_bprintf(strbuf, "Bus SDIO structure:\n");
brcmu_bprintf(strbuf,
@@ -1919,44 +1919,44 @@ void brcmf_sdbrcm_bus_dump(struct brcmf_pub *dhdp, struct brcmu_strbuf *strbuf)
(bus->f2rxhdrs + bus->f2rxdata), bus->f2rxhdrs,
bus->f2rxdata, bus->f2txdata, bus->f1regdata);
{
- dhd_dump_pct(strbuf, "\nRx: pkts/f2rd", bus->dhd->rx_packets,
+ dhd_dump_pct(strbuf, "\nRx: pkts/f2rd", bus->drvr->rx_packets,
(bus->f2rxhdrs + bus->f2rxdata));
- dhd_dump_pct(strbuf, ", pkts/f1sd", bus->dhd->rx_packets,
+ dhd_dump_pct(strbuf, ", pkts/f1sd", bus->drvr->rx_packets,
bus->f1regdata);
- dhd_dump_pct(strbuf, ", pkts/sd", bus->dhd->rx_packets,
+ dhd_dump_pct(strbuf, ", pkts/sd", bus->drvr->rx_packets,
(bus->f2rxhdrs + bus->f2rxdata + bus->f1regdata));
- dhd_dump_pct(strbuf, ", pkts/int", bus->dhd->rx_packets,
+ dhd_dump_pct(strbuf, ", pkts/int", bus->drvr->rx_packets,
bus->intrcount);
brcmu_bprintf(strbuf, "\n");
dhd_dump_pct(strbuf, "Rx: glom pct", (100 * bus->rxglompkts),
- bus->dhd->rx_packets);
+ bus->drvr->rx_packets);
dhd_dump_pct(strbuf, ", pkts/glom", bus->rxglompkts,
bus->rxglomframes);
brcmu_bprintf(strbuf, "\n");
- dhd_dump_pct(strbuf, "Tx: pkts/f2wr", bus->dhd->tx_packets,
+ dhd_dump_pct(strbuf, "Tx: pkts/f2wr", bus->drvr->tx_packets,
bus->f2txdata);
- dhd_dump_pct(strbuf, ", pkts/f1sd", bus->dhd->tx_packets,
+ dhd_dump_pct(strbuf, ", pkts/f1sd", bus->drvr->tx_packets,
bus->f1regdata);
- dhd_dump_pct(strbuf, ", pkts/sd", bus->dhd->tx_packets,
+ dhd_dump_pct(strbuf, ", pkts/sd", bus->drvr->tx_packets,
(bus->f2txdata + bus->f1regdata));
- dhd_dump_pct(strbuf, ", pkts/int", bus->dhd->tx_packets,
+ dhd_dump_pct(strbuf, ", pkts/int", bus->drvr->tx_packets,
bus->intrcount);
brcmu_bprintf(strbuf, "\n");
dhd_dump_pct(strbuf, "Total: pkts/f2rw",
- (bus->dhd->tx_packets + bus->dhd->rx_packets),
+ (bus->drvr->tx_packets + bus->drvr->rx_packets),
(bus->f2txdata + bus->f2rxhdrs + bus->f2rxdata));
dhd_dump_pct(strbuf, ", pkts/f1sd",
- (bus->dhd->tx_packets + bus->dhd->rx_packets),
+ (bus->drvr->tx_packets + bus->drvr->rx_packets),
bus->f1regdata);
dhd_dump_pct(strbuf, ", pkts/sd",
- (bus->dhd->tx_packets + bus->dhd->rx_packets),
+ (bus->drvr->tx_packets + bus->drvr->rx_packets),
(bus->f2txdata + bus->f2rxhdrs + bus->f2rxdata +
bus->f1regdata));
dhd_dump_pct(strbuf, ", pkts/int",
- (bus->dhd->tx_packets + bus->dhd->rx_packets),
+ (bus->drvr->tx_packets + bus->drvr->rx_packets),
bus->intrcount);
brcmu_bprintf(strbuf, "\n\n");
}
@@ -1986,9 +1986,9 @@ void brcmf_sdbrcm_bus_dump(struct brcmf_pub *dhdp, struct brcmu_strbuf *strbuf)
bus->sleeping);
}
-void dhd_bus_clearcounts(struct brcmf_pub *dhdp)
+void dhd_bus_clearcounts(struct brcmf_pub *drvr)
{
- dhd_bus_t *bus = (dhd_bus_t *) dhdp->bus;
+ dhd_bus_t *bus = (dhd_bus_t *) drvr->bus;
bus->intrcount = bus->lastintrs = bus->spurious = bus->regfails = 0;
bus->rxrtx = bus->rx_toolong = bus->rxc_errors = 0;
@@ -2335,7 +2335,7 @@ static int brcmf_sdbrcm_mem_dump(dhd_bus_t *bus)
printk(KERN_DEBUG "Done\n");
/* free buf before return !!! */
- if (brcmf_write_to_file(bus->dhd, buf, bus->ramsize)) {
+ if (brcmf_write_to_file(bus->drvr, buf, bus->ramsize)) {
DHD_ERROR(("%s: Error writing to files\n", __func__));
return -1;
}
@@ -2430,7 +2430,7 @@ int brcmf_sdbrcm_downloadvars(dhd_bus_t *bus, void *arg, int len)
DHD_TRACE(("%s: Enter\n", __func__));
/* Basic sanity checks */
- if (bus->dhd->up) {
+ if (bus->drvr->up) {
bcmerror = -EISCONN;
goto err;
}
@@ -2482,7 +2482,7 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
brcmf_sdbrcm_sdlock(bus);
/* Check if dongle is in reset. If so, only allow DEVRESET iovars */
- if (bus->dhd->dongle_reset && !(actionid == IOV_SVAL(IOV_DEVRESET) ||
+ if (bus->drvr->dongle_reset && !(actionid == IOV_SVAL(IOV_DEVRESET) ||
actionid == IOV_GVAL(IOV_DEVRESET))) {
bcmerror = -EPERM;
goto exit;
@@ -2500,7 +2500,7 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
}
/* Request clock to allow SDIO accesses */
- if (!bus->dhd->dongle_reset) {
+ if (!bus->drvr->dongle_reset) {
BUS_WAKE(bus);
brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
}
@@ -2514,7 +2514,7 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
case IOV_SVAL(IOV_INTR):
bus->intr = bool_val;
bus->intdis = false;
- if (bus->dhd->up) {
+ if (bus->drvr->up) {
if (bus->intr) {
DHD_INTR(("%s: enable SDIO device interrupts\n",
__func__));
@@ -2646,14 +2646,14 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
break;
case IOV_GVAL(IOV_READAHEAD):
- int_val = (s32) dhd_readahead;
+ int_val = (s32) brcmf_readahead;
memcpy(arg, &int_val, val_size);
break;
case IOV_SVAL(IOV_READAHEAD):
- if (bool_val && !dhd_readahead)
+ if (bool_val && !brcmf_readahead)
bus->nextlen = 0;
- dhd_readahead = bool_val;
+ brcmf_readahead = bool_val;
break;
case IOV_GVAL(IOV_SDRXCHAIN):
@@ -2668,12 +2668,12 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
bus->use_rxchain = bool_val;
break;
case IOV_GVAL(IOV_ALIGNCTL):
- int_val = (s32) dhd_alignctl;
+ int_val = (s32) brcmf_alignctl;
memcpy(arg, &int_val, val_size);
break;
case IOV_SVAL(IOV_ALIGNCTL):
- dhd_alignctl = bool_val;
+ brcmf_alignctl = bool_val;
break;
case IOV_GVAL(IOV_SDALIGN):
@@ -2702,7 +2702,7 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
case IOV_SVAL(IOV_CONS):
if (len > 0)
- bcmerror = brcmf_sdbrcm_bus_console_in(bus->dhd,
+ bcmerror = brcmf_sdbrcm_bus_console_in(bus->drvr,
arg, len - 1);
break;
@@ -2852,10 +2852,10 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
case IOV_SVAL(IOV_DEVRESET):
DHD_TRACE(("%s: Called set IOV_DEVRESET=%d dongle_reset=%d "
"busstate=%d\n",
- __func__, bool_val, bus->dhd->dongle_reset,
- bus->dhd->busstate));
+ __func__, bool_val, bus->drvr->dongle_reset,
+ bus->drvr->busstate));
- brcmf_bus_devreset(bus->dhd, (u8) bool_val);
+ brcmf_bus_devreset(bus->drvr, (u8) bool_val);
break;
@@ -2863,7 +2863,7 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
DHD_TRACE(("%s: Called get IOV_DEVRESET\n", __func__));
/* Get its status */
- int_val = (bool) bus->dhd->dongle_reset;
+ int_val = (bool) bus->drvr->dongle_reset;
memcpy(arg, &int_val, val_size);
break;
@@ -2874,7 +2874,7 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
break;
case IOV_SVAL(IOV_WDTICK):
- if (!bus->dhd->up) {
+ if (!bus->drvr->up) {
bcmerror = -ENOLINK;
break;
}
@@ -2895,7 +2895,7 @@ exit:
brcmf_sdbrcm_sdunlock(bus);
if (actionid == IOV_SVAL(IOV_DEVRESET) && bool_val == false)
- brcmf_c_preinit_ioctls((struct brcmf_pub *) bus->dhd);
+ brcmf_c_preinit_ioctls(bus->drvr);
return bcmerror;
}
@@ -3034,17 +3034,17 @@ static int brcmf_sdbrcm_download_state(dhd_bus_t *bus, bool enter)
/* Allow HT Clock now that the ARM is running. */
bus->alp_only = false;
- bus->dhd->busstate = DHD_BUS_LOAD;
+ bus->drvr->busstate = DHD_BUS_LOAD;
}
fail:
return bcmerror;
}
int
-brcmf_sdbrcm_bus_iovar_op(struct brcmf_pub *dhdp, const char *name,
+brcmf_sdbrcm_bus_iovar_op(struct brcmf_pub *drvr, const char *name,
void *params, int plen, void *arg, int len, bool set)
{
- dhd_bus_t *bus = dhdp->bus;
+ dhd_bus_t *bus = drvr->bus;
const struct brcmu_iovar *vi = NULL;
int bcmerror = 0;
int val_size;
@@ -3165,7 +3165,7 @@ void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
bus->hostintmask = 0;
/* Change our idea of bus state */
- bus->dhd->busstate = DHD_BUS_DOWN;
+ bus->drvr->busstate = DHD_BUS_DOWN;
/* Force clocks on backplane to be sure F2 interrupt propagates */
saveclk = brcmf_sdcard_cfg_read(bus->card, SDIO_FUNC_1,
@@ -3206,7 +3206,7 @@ void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
/* Clear rx control and wake any waiters */
bus->rxlen = 0;
- brcmf_os_ioctl_resp_wake(bus->dhd);
+ brcmf_os_ioctl_resp_wake(bus->drvr);
/* Reset some F2 state stuff */
bus->rxskip = false;
@@ -3214,15 +3214,11 @@ void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
if (enforce_mutex)
brcmf_sdbrcm_sdunlock(bus);
-
-#if defined(OOB_INTR_ONLY)
- brcmf_sdio_unregister_oob_intr();
-#endif /* defined(OOB_INTR_ONLY) */
}
-int brcmf_sdbrcm_bus_init(struct brcmf_pub *dhdp, bool enforce_mutex)
+int brcmf_sdbrcm_bus_init(struct brcmf_pub *drvr, bool enforce_mutex)
{
- dhd_bus_t *bus = dhdp->bus;
+ dhd_bus_t *bus = drvr->bus;
struct brcmf_timeout tmo;
uint retries = 0;
u8 ready, enable;
@@ -3232,17 +3228,17 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *dhdp, bool enforce_mutex)
DHD_TRACE(("%s: Enter\n", __func__));
/* try to download image and nvram to the dongle */
- if (dhdp->busstate == DHD_BUS_DOWN) {
+ if (drvr->busstate == DHD_BUS_DOWN) {
if (!(brcmf_sdbrcm_download_firmware(bus, bus->card)))
return -1;
}
- ASSERT(bus->dhd);
- if (!bus->dhd)
+ ASSERT(bus->drvr);
+ if (!bus->drvr)
return 0;
/* Start the watchdog timer */
- bus->dhd->tickcnt = 0;
+ bus->drvr->tickcnt = 0;
brcmf_sdbrcm_wd_timer(bus, brcmf_watchdog_ms);
if (enforce_mutex)
@@ -3299,7 +3295,7 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *dhdp, bool enforce_mutex)
(u8) watermark, &err);
/* Set bus state according to enable result */
- dhdp->busstate = DHD_BUS_DATA;
+ drvr->busstate = DHD_BUS_DATA;
bus->intdis = false;
if (bus->intr) {
@@ -3338,7 +3334,7 @@ int brcmf_sdbrcm_bus_init(struct brcmf_pub *dhdp, bool enforce_mutex)
#endif /* defined(OOB_INTR_ONLY) */
/* If we didn't come up, turn off backplane clock */
- if (dhdp->busstate != DHD_BUS_DATA)
+ if (drvr->busstate != DHD_BUS_DATA)
brcmf_sdbrcm_clkctl(bus, CLK_NONE, false);
exit:
@@ -3408,7 +3404,7 @@ static void brcmf_sdbrcm_rxfail(dhd_bus_t *bus, bool abort, bool rtx)
/* If we can't reach the device, signal failure */
if (err || brcmf_sdcard_regfail(card))
- bus->dhd->busstate = DHD_BUS_DOWN;
+ bus->drvr->busstate = DHD_BUS_DOWN;
}
static void
@@ -3428,7 +3424,7 @@ brcmf_sdbrcm_read_control(dhd_bus_t *bus, u8 *hdr, uint len, uint doff)
ASSERT(bus->rxbuf);
/* Set rxctl for frame (w/optional alignment) */
bus->rxctl = bus->rxbuf;
- if (dhd_alignctl) {
+ if (brcmf_alignctl) {
bus->rxctl += firstread;
pad = ((unsigned long)bus->rxctl % BRCMF_SDALIGN);
if (pad)
@@ -3453,7 +3449,7 @@ brcmf_sdbrcm_read_control(dhd_bus_t *bus, u8 *hdr, uint len, uint doff)
if (bus->roundup && bus->blocksize && (rdlen > bus->blocksize)) {
pad = bus->blocksize - (rdlen % bus->blocksize);
if ((pad <= bus->roundup) && (pad < bus->blocksize) &&
- ((len + pad) < bus->dhd->maxctl))
+ ((len + pad) < bus->drvr->maxctl))
rdlen += pad;
} else if (rdlen % BRCMF_SDALIGN) {
rdlen += BRCMF_SDALIGN - (rdlen % BRCMF_SDALIGN);
@@ -3464,19 +3460,19 @@ brcmf_sdbrcm_read_control(dhd_bus_t *bus, u8 *hdr, uint len, uint doff)
rdlen = roundup(rdlen, ALIGNMENT);
/* Drop if the read is too big or it exceeds our maximum */
- if ((rdlen + firstread) > bus->dhd->maxctl) {
+ if ((rdlen + firstread) > bus->drvr->maxctl) {
DHD_ERROR(("%s: %d-byte control read exceeds %d-byte buffer\n",
- __func__, rdlen, bus->dhd->maxctl));
- bus->dhd->rx_errors++;
+ __func__, rdlen, bus->drvr->maxctl));
+ bus->drvr->rx_errors++;
brcmf_sdbrcm_rxfail(bus, false, false);
goto done;
}
- if ((len - doff) > bus->dhd->maxctl) {
+ if ((len - doff) > bus->drvr->maxctl) {
DHD_ERROR(("%s: %d-byte ctl frame (%d-byte ctl data) exceeds "
"%d-byte limit\n",
- __func__, len, (len - doff), bus->dhd->maxctl));
- bus->dhd->rx_errors++;
+ __func__, len, (len - doff), bus->drvr->maxctl));
+ bus->drvr->rx_errors++;
bus->rx_toolong++;
brcmf_sdbrcm_rxfail(bus, false, false);
goto done;
@@ -3514,7 +3510,7 @@ gotpkt:
done:
/* Awake any waiters */
- brcmf_os_ioctl_resp_wake(bus->dhd);
+ brcmf_os_ioctl_resp_wake(bus->drvr);
}
static u8 brcmf_sdbrcm_rxglom(dhd_bus_t *bus, u8 rxseq)
@@ -3677,7 +3673,7 @@ static u8 brcmf_sdbrcm_rxglom(dhd_bus_t *bus, u8 rxseq)
if (errcode < 0) {
DHD_ERROR(("%s: glom read of %d bytes failed: %d\n",
__func__, dlen, errcode));
- bus->dhd->rx_errors++;
+ bus->drvr->rx_errors++;
if (bus->glomerr++ < 3) {
brcmf_sdbrcm_rxfail(bus, true, true);
@@ -3872,11 +3868,11 @@ static u8 brcmf_sdbrcm_rxglom(dhd_bus_t *bus, u8 rxseq)
save_pfirst = pnext;
}
continue;
- } else if (brcmf_proto_hdrpull(bus->dhd, &ifidx, pfirst)
+ } else if (brcmf_proto_hdrpull(bus->drvr, &ifidx, pfirst)
!= 0) {
DHD_ERROR(("%s: rx protocol error\n",
__func__));
- bus->dhd->rx_errors++;
+ bus->drvr->rx_errors++;
brcmu_pkt_buf_free_skb(pfirst);
if (plast) {
plast->next = pnext;
@@ -3908,7 +3904,7 @@ static u8 brcmf_sdbrcm_rxglom(dhd_bus_t *bus, u8 rxseq)
}
if (num) {
brcmf_sdbrcm_sdunlock(bus);
- brcmf_rx_frame(bus->dhd, ifidx, save_pfirst, num);
+ brcmf_rx_frame(bus->drvr, ifidx, save_pfirst, num);
brcmf_sdbrcm_sdlock(bus);
}
@@ -3961,7 +3957,7 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
*finished = false;
for (rxseq = bus->rx_seq, rxleft = maxframes;
- !bus->rxskip && rxleft && bus->dhd->busstate != DHD_BUS_DOWN;
+ !bus->rxskip && rxleft && bus->drvr->busstate != DHD_BUS_DOWN;
rxseq++, rxleft--) {
/* Handle glomming separately */
@@ -3977,7 +3973,7 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
}
/* Try doing single read if we can */
- if (dhd_readahead && bus->nextlen) {
+ if (brcmf_readahead && bus->nextlen) {
u16 nextlen = bus->nextlen;
bus->nextlen = 0;
@@ -4019,7 +4015,7 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
if (bus->bus == SPI_BUS) {
bus->usebufpool = false;
bus->rxctl = bus->rxbuf;
- if (dhd_alignctl) {
+ if (brcmf_alignctl) {
bus->rxctl += firstread;
pad = ((unsigned long)bus->rxctl %
BRCMF_SDALIGN);
@@ -4084,7 +4080,7 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
DHD_ERROR(("%s (nextlen): read %d bytes failed: %d\n",
__func__, rdlen, sdret));
brcmu_pkt_buf_free_skb(pkt);
- bus->dhd->rx_errors++;
+ bus->drvr->rx_errors++;
/* Force retry w/normal header read.
* Don't attempt NAK for
* gSPI
@@ -4167,7 +4163,7 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
bus->nextlen = 0;
}
- bus->dhd->rx_readahead_cnt++;
+ bus->drvr->rx_readahead_cnt++;
/* Handle Flow Control */
fcbits = SDPCM_FCMASK_VALUE(
@@ -4389,7 +4385,7 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
/* Too long -- skip this frame */
DHD_ERROR(("%s: too long: len %d rdlen %d\n",
__func__, len, rdlen));
- bus->dhd->rx_errors++;
+ bus->drvr->rx_errors++;
bus->rx_toolong++;
brcmf_sdbrcm_rxfail(bus, false, false);
continue;
@@ -4400,7 +4396,7 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
/* Give up on data, request rtx of events */
DHD_ERROR(("%s: brcmu_pkt_buf_get_skb failed: rdlen %d"
" chan %d\n", __func__, rdlen, chan));
- bus->dhd->rx_dropped++;
+ bus->drvr->rx_dropped++;
brcmf_sdbrcm_rxfail(bus, false, RETRYCHAN(chan));
continue;
}
@@ -4429,7 +4425,7 @@ brcmf_sdbrcm_readframes(dhd_bus_t *bus, uint maxframes, bool *finished)
? "data" : "test")),
sdret));
brcmu_pkt_buf_free_skb(pkt);
- bus->dhd->rx_errors++;
+ bus->drvr->rx_errors++;
brcmf_sdbrcm_rxfail(bus, true, RETRYCHAN(chan));
continue;
}
@@ -4487,16 +4483,16 @@ deliver:
if (pkt->len == 0) {
brcmu_pkt_buf_free_skb(pkt);
continue;
- } else if (brcmf_proto_hdrpull(bus->dhd, &ifidx, pkt) != 0) {
+ } else if (brcmf_proto_hdrpull(bus->drvr, &ifidx, pkt) != 0) {
DHD_ERROR(("%s: rx protocol error\n", __func__));
brcmu_pkt_buf_free_skb(pkt);
- bus->dhd->rx_errors++;
+ bus->drvr->rx_errors++;
continue;
}
/* Unlock during rx call */
brcmf_sdbrcm_sdunlock(bus);
- brcmf_rx_frame(bus->dhd, ifidx, pkt, 1);
+ brcmf_rx_frame(bus->drvr, ifidx, pkt, 1);
brcmf_sdbrcm_sdlock(bus);
}
rxcount = maxframes - rxleft;
@@ -4621,7 +4617,7 @@ static bool brcmf_sdbrcm_dpc(dhd_bus_t *bus)
if (err) {
DHD_ERROR(("%s: error reading DEVCTL: %d\n",
__func__, err));
- bus->dhd->busstate = DHD_BUS_DOWN;
+ bus->drvr->busstate = DHD_BUS_DOWN;
} else {
ASSERT(devctl & SBSDIO_DEVCTL_CA_INT_ONLY);
}
@@ -4633,7 +4629,7 @@ static bool brcmf_sdbrcm_dpc(dhd_bus_t *bus)
if (err) {
DHD_ERROR(("%s: error reading CSR: %d\n", __func__,
err));
- bus->dhd->busstate = DHD_BUS_DOWN;
+ bus->drvr->busstate = DHD_BUS_DOWN;
}
DHD_INFO(("DPC: PENDING, devctl 0x%02x clkctl 0x%02x\n", devctl,
@@ -4645,7 +4641,7 @@ static bool brcmf_sdbrcm_dpc(dhd_bus_t *bus)
if (err) {
DHD_ERROR(("%s: error reading DEVCTL: %d\n",
__func__, err));
- bus->dhd->busstate = DHD_BUS_DOWN;
+ bus->drvr->busstate = DHD_BUS_DOWN;
}
devctl &= ~SBSDIO_DEVCTL_CA_INT_ONLY;
brcmf_sdcard_cfg_write(card, SDIO_FUNC_1,
@@ -4653,7 +4649,7 @@ static bool brcmf_sdbrcm_dpc(dhd_bus_t *bus)
if (err) {
DHD_ERROR(("%s: error writing DEVCTL: %d\n",
__func__, err));
- bus->dhd->busstate = DHD_BUS_DOWN;
+ bus->drvr->busstate = DHD_BUS_DOWN;
}
bus->clkstate = CLK_AVAIL;
} else {
@@ -4813,12 +4809,12 @@ clkwait:
else await next interrupt */
/* On failed register access, all bets are off:
no resched or interrupts */
- if ((bus->dhd->busstate == DHD_BUS_DOWN) ||
- brcmf_sdcard_regfail(card)) {
+ if ((bus->drvr->busstate == DHD_BUS_DOWN) ||
+ brcmf_sdcard_regfail(card)) {
DHD_ERROR(("%s: failed backplane access over SDIO, halting "
"operation %d\n", __func__,
brcmf_sdcard_regfail(card)));
- bus->dhd->busstate = DHD_BUS_DOWN;
+ bus->drvr->busstate = DHD_BUS_DOWN;
bus->intstatus = 0;
} else if (bus->clkstate == CLK_PENDING) {
DHD_INFO(("%s: rescheduled due to CLK_PENDING awaiting "
@@ -4857,7 +4853,7 @@ void brcmf_sdbrcm_isr(void *arg)
}
card = bus->card;
- if (bus->dhd->busstate == DHD_BUS_DOWN) {
+ if (bus->drvr->busstate == DHD_BUS_DOWN) {
DHD_ERROR(("%s : bus is down. we have nothing to do\n",
__func__));
return;
@@ -5153,15 +5149,15 @@ brcmf_sdbrcm_checkdied(dhd_bus_t *bus, struct sk_buff *pkt, uint seq)
}
#endif /* SDTEST */
-extern bool brcmf_sdbrcm_bus_watchdog(struct brcmf_pub *dhdp)
+extern bool brcmf_sdbrcm_bus_watchdog(struct brcmf_pub *drvr)
{
dhd_bus_t *bus;
DHD_TIMER(("%s: Enter\n", __func__));
- bus = dhdp->bus;
+ bus = drvr->bus;
- if (bus->dhd->dongle_reset)
+ if (bus->drvr->dongle_reset)
return false;
/* Ignore the timer if simulating bus down */
@@ -5209,7 +5205,7 @@ extern bool brcmf_sdbrcm_bus_watchdog(struct brcmf_pub *dhdp)
}
#ifdef BCMDBG
/* Poll for console output periodically */
- if (dhdp->busstate == DHD_BUS_DATA && brcmf_console_ms != 0) {
+ if (drvr->busstate == DHD_BUS_DATA && brcmf_console_ms != 0) {
bus->console.count += brcmf_watchdog_ms;
if (bus->console.count >= brcmf_console_ms) {
bus->console.count -= brcmf_console_ms;
@@ -5267,7 +5263,7 @@ static int brcmf_sdbrcm_bus_console_in(struct brcmf_pub *drvr,
brcmf_sdbrcm_sdlock(bus);
/* Don't allow input if dongle is in reset */
- if (bus->dhd->dongle_reset) {
+ if (bus->drvr->dongle_reset) {
brcmf_sdbrcm_sdunlock(bus);
return -EPERM;
}
@@ -5344,9 +5340,9 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
*/
brcmf_txbound = DHD_TXBOUND;
brcmf_rxbound = DHD_RXBOUND;
- dhd_alignctl = true;
+ brcmf_alignctl = true;
sd1idle = true;
- dhd_readahead = true;
+ brcmf_readahead = true;
retrydata = false;
brcmf_dongle_memsize = 0;
dhd_txminmax = DHD_TXMINMAX;
@@ -5472,8 +5468,8 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
}
/* Attach to the dhd/OS/network interface */
- bus->dhd = brcmf_attach(bus, SDPCM_RESERVE);
- if (!bus->dhd) {
+ bus->drvr = brcmf_attach(bus, SDPCM_RESERVE);
+ if (!bus->drvr) {
DHD_ERROR(("%s: dhd_attach failed\n", __func__));
goto fail;
}
@@ -5504,7 +5500,7 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
DHD_INFO(("%s: completed!!\n", __func__));
/* if firmware path present try to download and bring up bus */
- ret = brcmf_bus_start(bus->dhd);
+ ret = brcmf_bus_start(bus->drvr);
if (ret != 0) {
if (ret == -ENOLINK) {
DHD_ERROR(("%s: dongle is not responding\n", __func__));
@@ -5512,7 +5508,7 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
}
}
/* Ok, have the per-port tell the stack we're open for business */
- if (brcmf_net_attach(bus->dhd, 0) != 0) {
+ if (brcmf_net_attach(bus->drvr, 0) != 0) {
DHD_ERROR(("%s: Net attach failed!!\n", __func__));
goto fail;
}
@@ -5622,9 +5618,9 @@ static bool brcmf_sdbrcm_probe_malloc(dhd_bus_t *bus, void *card)
{
DHD_TRACE(("%s: Enter\n", __func__));
- if (bus->dhd->maxctl) {
+ if (bus->drvr->maxctl) {
bus->rxblen =
- roundup((bus->dhd->maxctl + SDPCM_HDRLEN),
+ roundup((bus->drvr->maxctl + SDPCM_HDRLEN),
ALIGNMENT) + BRCMF_SDALIGN;
bus->rxbuf = kmalloc(bus->rxblen, GFP_ATOMIC);
if (!(bus->rxbuf)) {
@@ -5672,7 +5668,7 @@ static bool brcmf_sdbrcm_probe_init(dhd_bus_t *bus, void *card)
brcmf_sdcard_cfg_write(card, SDIO_FUNC_0, SDIO_CCCR_IOEx,
SDIO_FUNC_ENABLE_1, NULL);
- bus->dhd->busstate = DHD_BUS_DOWN;
+ bus->drvr->busstate = DHD_BUS_DOWN;
bus->sleeping = false;
bus->rxflow = false;
bus->prev_rxlim_hit = 0;
@@ -5739,10 +5735,10 @@ static void brcmf_sdbrcm_release(dhd_bus_t *bus)
brcmf_sdcard_intr_disable(bus->card);
brcmf_sdcard_intr_dereg(bus->card);
- if (bus->dhd) {
- brcmf_detach(bus->dhd);
+ if (bus->drvr) {
+ brcmf_detach(bus->drvr);
brcmf_sdbrcm_release_dongle(bus);
- bus->dhd = NULL;
+ bus->drvr = NULL;
}
brcmf_sdbrcm_release_malloc(bus);
@@ -5757,7 +5753,7 @@ static void brcmf_sdbrcm_release_malloc(dhd_bus_t *bus)
{
DHD_TRACE(("%s: Enter\n", __func__));
- if (bus->dhd && bus->dhd->dongle_reset)
+ if (bus->drvr && bus->drvr->dongle_reset)
return;
kfree(bus->rxbuf);
@@ -5772,7 +5768,7 @@ static void brcmf_sdbrcm_release_dongle(dhd_bus_t *bus)
{
DHD_TRACE(("%s: Enter\n", __func__));
- if (bus->dhd && bus->dhd->dongle_reset)
+ if (bus->drvr && bus->drvr->dongle_reset)
return;
if (bus->ci) {
@@ -5794,7 +5790,7 @@ static void brcmf_sdbrcm_disconnect(void *ptr)
DHD_TRACE(("%s: Enter\n", __func__));
if (bus) {
- ASSERT(bus->dhd);
+ ASSERT(bus->drvr);
brcmf_sdbrcm_release(bus);
}
@@ -6054,7 +6050,7 @@ uint dhd_bus_chip(struct dhd_bus *bus)
void *dhd_bus_pub(struct dhd_bus *bus)
{
- return bus->dhd;
+ return bus->drvr;
}
void *dhd_bus_txq(struct dhd_bus *bus)
@@ -6067,16 +6063,16 @@ uint dhd_bus_hdrlen(struct dhd_bus *bus)
return SDPCM_HDRLEN;
}
-int brcmf_bus_devreset(struct brcmf_pub *dhdp, u8 flag)
+int brcmf_bus_devreset(struct brcmf_pub *drvr, u8 flag)
{
int bcmerror = 0;
dhd_bus_t *bus;
- bus = dhdp->bus;
+ bus = drvr->bus;
if (flag == true) {
brcmf_sdbrcm_wd_timer(bus, 0);
- if (!bus->dhd->dongle_reset) {
+ if (!bus->drvr->dongle_reset) {
/* Expect app to have torn down any
connection before calling */
/* Stop the bus, disable F2 */
@@ -6086,8 +6082,8 @@ int brcmf_bus_devreset(struct brcmf_pub *dhdp, u8 flag)
detach from the dongle */
brcmf_sdbrcm_release_dongle(bus);
- bus->dhd->dongle_reset = true;
- bus->dhd->up = false;
+ bus->drvr->dongle_reset = true;
+ bus->drvr->up = false;
DHD_TRACE(("%s: WLAN OFF DONE\n", __func__));
/* App can now remove power from device */
@@ -6098,7 +6094,7 @@ int brcmf_bus_devreset(struct brcmf_pub *dhdp, u8 flag)
DHD_TRACE(("\n\n%s: == WLAN ON ==\n", __func__));
- if (bus->dhd->dongle_reset) {
+ if (bus->drvr->dongle_reset) {
/* Turn on WLAN */
/* Attempt to re-attach & download */
@@ -6108,12 +6104,10 @@ int brcmf_bus_devreset(struct brcmf_pub *dhdp, u8 flag)
/* Attempt to download binary to the dongle */
if (brcmf_sdbrcm_probe_init(bus, bus->card)) {
/* Re-init bus, enable F2 transfer */
- brcmf_sdbrcm_bus_init(
- (struct brcmf_pub *) bus->dhd,
- false);
+ brcmf_sdbrcm_bus_init(bus->drvr, false);
- bus->dhd->dongle_reset = false;
- bus->dhd->up = true;
+ bus->drvr->dongle_reset = false;
+ bus->drvr->up = true;
DHD_TRACE(("%s: WLAN ON DONE\n",
__func__));
@@ -6565,10 +6559,10 @@ brcmf_sdbrcm_watchdog_thread(void *data)
if (kthread_should_stop())
break;
if (!wait_for_completion_interruptible(&bus->watchdog_wait)) {
- if (bus->dhd->dongle_reset == false)
- brcmf_sdbrcm_bus_watchdog(bus->dhd);
+ if (bus->drvr->dongle_reset == false)
+ brcmf_sdbrcm_bus_watchdog(bus->drvr);
/* Count the tick for reference */
- bus->dhd->tickcnt++;
+ bus->drvr->tickcnt++;
} else
break;
}
@@ -6586,10 +6580,10 @@ brcmf_sdbrcm_watchdog(unsigned long data)
else
return;
} else {
- brcmf_sdbrcm_bus_watchdog(bus->dhd);
+ brcmf_sdbrcm_bus_watchdog(bus->drvr);
/* Count the tick for reference */
- bus->dhd->tickcnt++;
+ bus->drvr->tickcnt++;
}
/* Reschedule the watchdog */
@@ -6603,7 +6597,7 @@ brcmf_sdbrcm_wd_timer(struct dhd_bus *bus, uint wdtick)
static uint save_ms;
/* don't start the wd until fw is loaded */
- if (bus->dhd->busstate == DHD_BUS_DOWN)
+ if (bus->drvr->busstate == DHD_BUS_DOWN)
return;
/* Totally stop the timer */
@@ -6662,7 +6656,7 @@ static int brcmf_sdbrcm_dpc_thread(void *data)
if (!wait_for_completion_interruptible(&bus->dpc_wait)) {
/* Call bus dpc unless it indicated down
(then clean stop) */
- if (bus->dhd->busstate != DHD_BUS_DOWN) {
+ if (bus->drvr->busstate != DHD_BUS_DOWN) {
if (brcmf_sdbrcm_dpc(bus))
complete(&bus->dpc_wait);
} else {
@@ -6679,7 +6673,7 @@ static void brcmf_sdbrcm_dpc_tasklet(unsigned long data)
dhd_bus_t *bus = (dhd_bus_t *) data;
/* Call bus dpc unless it indicated down (then clean stop) */
- if (bus->dhd->busstate != DHD_BUS_DOWN) {
+ if (bus->drvr->busstate != DHD_BUS_DOWN) {
if (brcmf_sdbrcm_dpc(bus))
tasklet_schedule(&bus->tasklet);
} else
--
1.7.1
From: Arend van Spriel <[email protected]>
For the devices supported by brcmsmac driver the OTP device is always
powered. Functions for reading power status and changing it are not
needed.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/aiutils.c | 14 --------------
drivers/staging/brcm80211/brcmsmac/aiutils.h | 2 --
drivers/staging/brcm80211/brcmsmac/otp.c | 15 ++-------------
3 files changed, 2 insertions(+), 29 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/aiutils.c b/drivers/staging/brcm80211/brcmsmac/aiutils.c
index d41104f..2018664 100644
--- a/drivers/staging/brcm80211/brcmsmac/aiutils.c
+++ b/drivers/staging/brcm80211/brcmsmac/aiutils.c
@@ -2277,17 +2277,3 @@ bool ai_is_otp_disabled(struct si_pub *sih)
return false;
}
}
-
-bool ai_is_otp_powered(struct si_pub *sih)
-{
- if (PMUCTL_ENAB(sih))
- return si_pmu_is_otp_powered(sih);
- return true;
-}
-
-void ai_otp_power(struct si_pub *sih, bool on)
-{
- if (PMUCTL_ENAB(sih))
- si_pmu_otp_power(sih, on);
- udelay(1000);
-}
diff --git a/drivers/staging/brcm80211/brcmsmac/aiutils.h b/drivers/staging/brcm80211/brcmsmac/aiutils.h
index 66d9471..965eb94 100644
--- a/drivers/staging/brcm80211/brcmsmac/aiutils.h
+++ b/drivers/staging/brcm80211/brcmsmac/aiutils.h
@@ -558,8 +558,6 @@ extern u32 ai_gpiocontrol(struct si_pub *sih, u32 mask, u32 val,
/* OTP status */
extern bool ai_is_otp_disabled(struct si_pub *sih);
-extern bool ai_is_otp_powered(struct si_pub *sih);
-extern void ai_otp_power(struct si_pub *sih, bool on);
/* SPROM availability */
extern bool ai_is_sprom_available(struct si_pub *sih);
diff --git a/drivers/staging/brcm80211/brcmsmac/otp.c b/drivers/staging/brcm80211/brcmsmac/otp.c
index 2cda60f..4e19b35 100644
--- a/drivers/staging/brcm80211/brcmsmac/otp.c
+++ b/drivers/staging/brcm80211/brcmsmac/otp.c
@@ -310,10 +310,7 @@ static void *ipxotp_init(struct si_pub *sih)
if (ai_is_otp_disabled(sih))
return NULL;
- /* Make sure OTP is powered up */
- if (!ai_is_otp_powered(sih))
- return NULL;
-
+ /* OTP is always powered */
oi = &otpinfo;
/* Check for otp size */
@@ -518,15 +515,10 @@ void *otp_init(struct si_pub *sih)
int
otp_read_region(struct si_pub *sih, int region, u16 *data,
uint *wlen) {
- bool wasup = false;
void *oh;
int err = 0;
- wasup = ai_is_otp_powered(sih);
- if (!wasup)
- ai_otp_power(sih, true);
-
- if (!ai_is_otp_powered(sih) || ai_is_otp_disabled(sih)) {
+ if (ai_is_otp_disabled(sih)) {
err = -EPERM;
goto out;
}
@@ -540,9 +532,6 @@ otp_read_region(struct si_pub *sih, int region, u16 *data,
err = (((otpinfo_t *) oh)->fn->read_region) (oh, region, data, wlen);
out:
- if (!wasup)
- ai_otp_power(sih, false);
-
return err;
}
--
1.7.1
From: Arend van Spriel <[email protected]>
The fullmac driver is always needing the code conditionalized with
MMC_SDIO_ABORT macro so the macro has been removed and the code
is always compiled in.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/Makefile | 1 -
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 6 ------
2 files changed, 0 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/Makefile b/drivers/staging/brcm80211/brcmfmac/Makefile
index 2ccfa1f..c97e5bb 100644
--- a/drivers/staging/brcm80211/brcmfmac/Makefile
+++ b/drivers/staging/brcm80211/brcmfmac/Makefile
@@ -21,7 +21,6 @@ ccflags-y := \
-DBRCMF_FIRSTREAD=64 \
-DBRCMF_SDALIGN=64 \
-DMAX_HDR_READ=64 \
- -DMMC_SDIO_ABORT \
-DSHOW_EVENTS \
-DTOE
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
index c814701..5e52813 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c
@@ -667,7 +667,6 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
sdio_release_host(gInstance->func[2]);
}
}
-#if defined(MMC_SDIO_ABORT)
/* to allow abort command through F1 */
else if (regaddr == SDIO_CCCR_ABORT) {
sdio_claim_host(gInstance->func[func]);
@@ -681,7 +680,6 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
regaddr, &err_ret);
sdio_release_host(gInstance->func[func]);
}
-#endif /* MMC_SDIO_ABORT */
else if (regaddr < 0xF0) {
sd_err(("bcmsdh_sdmmc: F0 Wr:0x%02x: write "
"disallowed\n", regaddr));
@@ -951,16 +949,12 @@ brcmf_sdioh_request_buffer(struct sdioh_info *sd, uint pio_dma, uint fix_inc,
/* this function performs "abort" for both of host & device */
extern int brcmf_sdioh_abort(struct sdioh_info *sd, uint func)
{
-#if defined(MMC_SDIO_ABORT)
char t_func = (char)func;
-#endif /* defined(MMC_SDIO_ABORT) */
sd_trace(("%s: Enter\n", __func__));
-#if defined(MMC_SDIO_ABORT)
/* issue abort cmd52 command through F0 */
brcmf_sdioh_request_byte(sd, SDIOH_WRITE, SDIO_FUNC_0, SDIO_CCCR_ABORT,
&t_func);
-#endif /* defined(MMC_SDIO_ABORT) */
sd_trace(("%s: Exit\n", __func__));
return SDIOH_API_RC_SUCCESS;
--
1.7.1
The watchdog timer is used in bus interface layer in fullmac. Move
related code to dhd_sdio.c for clean up.
Signed-off-by: Franky Lin <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c | 5 +-
drivers/staging/brcm80211/brcmfmac/dhd.h | 8 +-
drivers/staging/brcm80211/brcmfmac/dhd_bus.h | 8 +-
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 16 --
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 159 ------------------
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 184 ++++++++++++++++++++-
6 files changed, 191 insertions(+), 189 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
index d0be99f..ce8323c 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
@@ -35,6 +35,7 @@ extern void brcmf_sdbrcm_isr(void *args);
#include "dngl_stats.h"
#include "dhd.h"
+#include "dhd_bus.h"
/**
* SDIO Host Controller info
@@ -222,7 +223,7 @@ module_param(sd_f2_blocksize, int, 0);
void brcmf_sdio_wdtmr_enable(bool enable)
{
if (enable)
- brcmf_os_wd_timer(sdhcinfo->ch, brcmf_watchdog_ms);
+ brcmf_sdbrcm_wd_timer(sdhcinfo->ch, brcmf_watchdog_ms);
else
- brcmf_os_wd_timer(sdhcinfo->ch, 0);
+ brcmf_sdbrcm_wd_timer(sdhcinfo->ch, 0);
}
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index ffdee84..2c67df0 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -773,9 +773,6 @@ extern atomic_t brcmf_mmc_suspend;
* Insmod parameters for debug/test
*/
-/* Watchdog timer interval */
-extern uint brcmf_watchdog_ms;
-
#if defined(BCMDBG)
/* Console output poll interval */
extern uint brcmf_console_ms;
@@ -818,6 +815,10 @@ extern uint brcmf_sdiod_drive_strength;
/* Override to force tx queueing all the time */
extern uint brcmf_force_tx_queueing;
+/* thread priority for watchdog and dpc */
+extern int brcmf_watchdog_prio;
+extern int brcmf_dpc_prio;
+
#ifdef SDTEST
/* Echo packet generator (SDIO), pkts/s */
extern uint brcmf_pktgen;
@@ -923,7 +924,6 @@ extern void brcmf_os_set_ioctl_resp_timeout(unsigned int timeout_msec);
extern void *brcmf_os_open_image(char *filename);
extern int brcmf_os_get_image_block(char *buf, int len, void *image);
extern void brcmf_os_close_image(void *image);
-extern void brcmf_os_wd_timer(void *bus, uint wdtick);
extern void brcmf_os_sdlock(dhd_pub_t *pub);
extern void brcmf_os_sdunlock(dhd_pub_t *pub);
extern void brcmf_os_sdlock_sndup_rxq(dhd_pub_t *pub);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
index 722dbb4..5bbe09d 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_bus.h
@@ -29,6 +29,9 @@
* Exported from dhd bus module (dhd_usb, dhd_sdio)
*/
+/* Watchdog timer interval */
+extern uint brcmf_watchdog_ms;
+
/* Indicate (dis)interest in finding dongles. */
extern int dhd_bus_register(void);
extern void dhd_bus_unregister(void);
@@ -55,9 +58,6 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
extern int
brcmf_sdbrcm_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen);
-/* Watchdog timer function */
-extern bool brcmf_sdbrcm_bus_watchdog(dhd_pub_t *dhd);
-
#ifdef BCMDBG
/* Device console input function */
extern int
@@ -91,4 +91,6 @@ extern void *dhd_bus_pub(struct dhd_bus *bus);
extern void *dhd_bus_txq(struct dhd_bus *bus);
extern uint dhd_bus_hdrlen(struct dhd_bus *bus);
+extern void brcmf_sdbrcm_wd_timer(struct dhd_bus *bus, uint wdtick);
+
#endif /* _dhd_bus_h_ */
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 5207fa9..38a3502 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -52,7 +52,6 @@ enum {
IOV_MSGLEVEL,
IOV_BCMERRORSTR,
IOV_BCMERROR,
- IOV_WDTICK,
IOV_DUMP,
#ifdef BCMDBG
IOV_CONS,
@@ -78,8 +77,6 @@ const struct brcmu_iovar brcmf_iovars[] = {
,
{"bcmerror", IOV_BCMERROR, 0, IOVT_INT8, 0}
,
- {"wdtick", IOV_WDTICK, 0, IOVT_UINT32, 0}
- ,
{"dump", IOV_DUMP, 0, IOVT_BUFFER, DHD_IOCTL_MAXLEN}
,
#ifdef BCMDBG
@@ -237,19 +234,6 @@ brcmf_c_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
memcpy(arg, &int_val, val_size);
break;
- case IOV_GVAL(IOV_WDTICK):
- int_val = (s32) brcmf_watchdog_ms;
- memcpy(arg, &int_val, val_size);
- break;
-
- case IOV_SVAL(IOV_WDTICK):
- if (!dhd_pub->up) {
- bcmerror = -ENOLINK;
- break;
- }
- brcmf_os_wd_timer(dhd_pub, (uint) int_val);
- break;
-
case IOV_GVAL(IOV_DUMP):
bcmerror = brcmf_c_dump(dhd_pub, arg, len);
break;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index 6516cc6..abd829d 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -82,15 +82,11 @@ typedef struct dhd_info {
struct semaphore proto_sem;
wait_queue_head_t ioctl_resp_wait;
- struct timer_list timer;
- bool wd_timer_valid;
struct tasklet_struct tasklet;
spinlock_t sdlock;
/* Thread based operation */
bool threads_only;
struct semaphore sdsem;
- struct task_struct *watchdog_tsk;
- struct semaphore watchdog_sem;
struct task_struct *dpc_tsk;
struct semaphore dpc_sem;
@@ -128,10 +124,6 @@ module_param(brcmf_msg_level, int, 0);
uint brcmf_sysioc = true;
module_param(brcmf_sysioc, uint, 0);
-/* Watchdog interval */
-uint brcmf_watchdog_ms = 10;
-module_param(brcmf_watchdog_ms, uint, 0);
-
#ifdef BCMDBG
/* Console poll interval */
uint brcmf_console_ms;
@@ -159,10 +151,6 @@ module_param(brcmf_pkt_filter_init, uint, 0);
uint brcmf_master_mode = true;
module_param(brcmf_master_mode, uint, 1);
-/* Watchdog thread priority, -1 to use kernel timer */
-int brcmf_watchdog_prio = 97;
-module_param(brcmf_watchdog_prio, int, 0);
-
/* DPC thread priority, -1 to use tasklet */
int brcmf_dpc_prio = 98;
module_param(brcmf_dpc_prio, int, 0);
@@ -1030,64 +1018,6 @@ static struct net_device_stats *brcmf_netdev_get_stats(struct net_device *net)
return &ifp->stats;
}
-static int brcmf_watchdog_thread(void *data)
-{
- dhd_info_t *dhd = (dhd_info_t *) data;
-
- /* This thread doesn't need any user-level access,
- * so get rid of all our resources
- */
- if (brcmf_watchdog_prio > 0) {
- struct sched_param param;
- param.sched_priority = (brcmf_watchdog_prio < MAX_RT_PRIO) ?
- brcmf_watchdog_prio : (MAX_RT_PRIO - 1);
- sched_setscheduler(current, SCHED_FIFO, ¶m);
- }
-
- allow_signal(SIGTERM);
- /* Run until signal received */
- while (1) {
- if (kthread_should_stop())
- break;
- if (down_interruptible(&dhd->watchdog_sem) == 0) {
- if (dhd->pub.dongle_reset == false) {
- /* Call the bus module watchdog */
- brcmf_sdbrcm_bus_watchdog(&dhd->pub);
- }
- /* Count the tick for reference */
- dhd->pub.tickcnt++;
- } else
- break;
- }
- return 0;
-}
-
-static void brcmf_watchdog(unsigned long data)
-{
- dhd_info_t *dhd = (dhd_info_t *) data;
-
- if (dhd->watchdog_tsk) {
- up(&dhd->watchdog_sem);
-
- /* Reschedule the watchdog */
- if (dhd->wd_timer_valid) {
- mod_timer(&dhd->timer,
- jiffies + brcmf_watchdog_ms * HZ / 1000);
- }
- return;
- }
-
- /* Call the bus module watchdog */
- brcmf_sdbrcm_bus_watchdog(&dhd->pub);
-
- /* Count the tick for reference */
- dhd->pub.tickcnt++;
-
- /* Reschedule the watchdog */
- if (dhd->wd_timer_valid)
- mod_timer(&dhd->timer, jiffies + brcmf_watchdog_ms * HZ / 1000);
-}
-
static int brcmf_dpc_thread(void *data)
{
dhd_info_t *dhd = (dhd_info_t *) data;
@@ -1667,11 +1597,6 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
strcpy(brcmf_nv_path, wl_cfg80211_get_nvramname());
}
- /* Set up the watchdog timer */
- init_timer(&dhd->timer);
- dhd->timer.data = (unsigned long) dhd;
- dhd->timer.function = brcmf_watchdog;
-
/* Initialize thread based operation and lock */
sema_init(&dhd->sdsem, 1);
if ((brcmf_watchdog_prio >= 0) && (brcmf_dpc_prio >= 0))
@@ -1679,20 +1604,6 @@ dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
else
dhd->threads_only = false;
- if (brcmf_dpc_prio >= 0) {
- /* Initialize watchdog thread */
- sema_init(&dhd->watchdog_sem, 0);
- dhd->watchdog_tsk = kthread_run(brcmf_watchdog_thread, dhd,
- "dhd_watchdog");
- if (IS_ERR(dhd->watchdog_tsk)) {
- printk(KERN_WARNING
- "dhd_watchdog thread failed to start\n");
- dhd->watchdog_tsk = NULL;
- }
- } else {
- dhd->watchdog_tsk = NULL;
- }
-
/* Set up the bottom half handler */
if (brcmf_dpc_prio >= 0) {
/* Initialize DPC thread */
@@ -1773,10 +1684,6 @@ int brcmf_bus_start(dhd_pub_t *dhdp)
}
}
- /* Start the watchdog timer */
- dhd->pub.tickcnt = 0;
- brcmf_os_wd_timer(&dhd->pub, brcmf_watchdog_ms);
-
/* Bring up the bus */
ret = brcmf_sdbrcm_bus_init(&dhd->pub, true);
if (ret != 0) {
@@ -1787,8 +1694,6 @@ int brcmf_bus_start(dhd_pub_t *dhdp)
/* If bus is not ready, can't come up */
if (dhd->pub.busstate != DHD_BUS_DATA) {
- del_timer_sync(&dhd->timer);
- dhd->wd_timer_valid = false;
DHD_ERROR(("%s failed bus is not ready\n", __func__));
return -ENODEV;
}
@@ -1935,10 +1840,6 @@ static void brcmf_bus_detach(dhd_pub_t *dhdp)
/* Stop the bus module */
brcmf_sdbrcm_bus_stop(dhd->pub.bus, true);
-
- /* Clear the watchdog timer */
- del_timer_sync(&dhd->timer);
- dhd->wd_timer_valid = false;
}
}
}
@@ -1971,12 +1872,6 @@ void brcmf_detach(dhd_pub_t *dhdp)
unregister_netdev(ifp->net);
}
- if (dhd->watchdog_tsk) {
- send_sig(SIGTERM, dhd->watchdog_tsk, 1);
- kthread_stop(dhd->watchdog_tsk);
- dhd->watchdog_tsk = NULL;
- }
-
if (dhd->dpc_tsk) {
send_sig(SIGTERM, dhd->dpc_tsk, 1);
kthread_stop(dhd->dpc_tsk);
@@ -2119,51 +2014,6 @@ int brcmf_os_ioctl_resp_wake(dhd_pub_t *pub)
return 0;
}
-void brcmf_os_wd_timer(void *bus, uint wdtick)
-{
- dhd_pub_t *pub = bus;
- static uint save_dhd_watchdog_ms;
- dhd_info_t *dhd = (dhd_info_t *) pub->info;
-
- /* don't start the wd until fw is loaded */
- if (pub->busstate == DHD_BUS_DOWN)
- return;
-
- /* Totally stop the timer */
- if (!wdtick && dhd->wd_timer_valid == true) {
- del_timer_sync(&dhd->timer);
- dhd->wd_timer_valid = false;
- save_dhd_watchdog_ms = wdtick;
- return;
- }
-
- if (wdtick) {
- brcmf_watchdog_ms = (uint) wdtick;
-
- if (save_dhd_watchdog_ms != brcmf_watchdog_ms) {
-
- if (dhd->wd_timer_valid == true)
- /* Stop timer and restart at new value */
- del_timer_sync(&dhd->timer);
-
- /* Create timer again when watchdog period is
- dynamically changed or in the first instance
- */
- dhd->timer.expires =
- jiffies + brcmf_watchdog_ms * HZ / 1000;
- add_timer(&dhd->timer);
-
- } else {
- /* Re arm the timer, at last watchdog period */
- mod_timer(&dhd->timer,
- jiffies + brcmf_watchdog_ms * HZ / 1000);
- }
-
- dhd->wd_timer_valid = true;
- save_dhd_watchdog_ms = wdtick;
- }
-}
-
void *brcmf_os_open_image(char *filename)
{
struct file *fp;
@@ -2257,17 +2107,8 @@ int brcmf_netdev_reset(struct net_device *dev, u8 flag)
{
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
- /* Turning off watchdog */
- if (flag)
- brcmf_os_wd_timer(&dhd->pub, 0);
-
brcmf_bus_devreset(&dhd->pub, flag);
- /* Turning on watchdog back */
- if (!flag)
- brcmf_os_wd_timer(&dhd->pub, brcmf_watchdog_ms);
- DHD_ERROR(("%s: WLAN OFF DONE\n", __func__));
-
return 1;
}
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index ec2c744..aeef2dc 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -16,6 +16,7 @@
#include <linux/types.h>
#include <linux/kernel.h>
+#include <linux/kthread.h>
#include <linux/printk.h>
#include <linux/pci_ids.h>
#include <linux/netdevice.h>
@@ -587,6 +588,11 @@ typedef struct dhd_bus {
spinlock_t txqlock;
wait_queue_head_t ctrl_wait;
+
+ struct timer_list timer;
+ struct completion watchdog_wait;
+ struct task_struct *watchdog_tsk;
+ bool wd_timer_valid;
} dhd_bus_t;
typedef volatile struct _sbconfig {
@@ -645,6 +651,14 @@ static int tx_packets[NUMPRIO];
/* Deferred transmit */
const uint brcmf_deferred_tx = 1;
+/* Watchdog thread priority, -1 to use kernel timer */
+int brcmf_watchdog_prio = 97;
+module_param(brcmf_watchdog_prio, int, 0);
+
+/* Watchdog interval */
+uint brcmf_watchdog_ms = 10;
+module_param(brcmf_watchdog_ms, uint, 0);
+
/* Tx/Rx bounds */
uint brcmf_txbound;
uint brcmf_rxbound;
@@ -780,6 +794,8 @@ static void brcmf_sdbrcm_sdiod_drive_strength_init(struct dhd_bus *bus,
static void brcmf_sdbrcm_chip_detach(struct dhd_bus *bus);
static void brcmf_sdbrcm_wait_for_event(dhd_pub_t *dhd, bool *lockvar);
static void brcmf_sdbrcm_wait_event_wakeup(dhd_bus_t *bus);
+static void brcmf_sdbrcm_watchdog(unsigned long data);
+static int brcmf_sdbrcm_watchdog_thread(void *data);
/* Packet free applicable unconditionally for sdio and sdspi.
* Conditional if bufpool was present for gspi bus.
@@ -975,7 +991,7 @@ static int brcmf_sdbrcm_clkctl(dhd_bus_t *bus, uint target, bool pendok)
/* Early exit if we're already there */
if (bus->clkstate == target) {
if (target == CLK_AVAIL) {
- brcmf_os_wd_timer(bus->dhd, brcmf_watchdog_ms);
+ brcmf_sdbrcm_wd_timer(bus, brcmf_watchdog_ms);
bus->activity = true;
}
return 0;
@@ -988,7 +1004,7 @@ static int brcmf_sdbrcm_clkctl(dhd_bus_t *bus, uint target, bool pendok)
brcmf_sdbrcm_sdclk(bus, true);
/* Now request HT Avail on the backplane */
brcmf_sdbrcm_htclk(bus, true, pendok);
- brcmf_os_wd_timer(bus->dhd, brcmf_watchdog_ms);
+ brcmf_sdbrcm_wd_timer(bus, brcmf_watchdog_ms);
bus->activity = true;
break;
@@ -1001,7 +1017,7 @@ static int brcmf_sdbrcm_clkctl(dhd_bus_t *bus, uint target, bool pendok)
else
DHD_ERROR(("brcmf_sdbrcm_clkctl: request for %d -> %d"
"\n", bus->clkstate, target));
- brcmf_os_wd_timer(bus->dhd, brcmf_watchdog_ms);
+ brcmf_sdbrcm_wd_timer(bus, brcmf_watchdog_ms);
break;
case CLK_NONE:
@@ -1010,7 +1026,7 @@ static int brcmf_sdbrcm_clkctl(dhd_bus_t *bus, uint target, bool pendok)
brcmf_sdbrcm_htclk(bus, false, false);
/* Now remove the SD clock */
brcmf_sdbrcm_sdclk(bus, false);
- brcmf_os_wd_timer(bus->dhd, 0);
+ brcmf_sdbrcm_wd_timer(bus, 0);
break;
}
#ifdef BCMDBG
@@ -1671,6 +1687,7 @@ enum {
IOV_IDLECLOCK,
IOV_SD1IDLE,
IOV_SLEEP,
+ IOV_WDTICK,
IOV_VARS
};
@@ -1691,6 +1708,7 @@ const struct brcmu_iovar dhdsdio_iovars[] = {
{"alignctl", IOV_ALIGNCTL, 0, IOVT_BOOL, 0},
{"sdalign", IOV_SDALIGN, 0, IOVT_BOOL, 0},
{"devreset", IOV_DEVRESET, 0, IOVT_BOOL, 0},
+ {"wdtick", IOV_WDTICK, 0, IOVT_UINT32, 0},
#ifdef BCMDBG
{"sdreg", IOV_SDREG, 0, IOVT_BUFFER, sizeof(struct brcmf_sdreg)}
,
@@ -2703,6 +2721,19 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
break;
+ case IOV_GVAL(IOV_WDTICK):
+ int_val = (s32) brcmf_watchdog_ms;
+ memcpy(arg, &int_val, val_size);
+ break;
+
+ case IOV_SVAL(IOV_WDTICK):
+ if (!bus->dhd->up) {
+ bcmerror = -ENOLINK;
+ break;
+ }
+ brcmf_sdbrcm_wd_timer(bus, (uint) int_val);
+ break;
+
default:
bcmerror = -ENOTSUPP;
break;
@@ -2967,6 +2998,12 @@ void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
/* Enable clock for device interrupts */
brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
+ if (bus->watchdog_tsk) {
+ send_sig(SIGTERM, bus->watchdog_tsk, 1);
+ kthread_stop(bus->watchdog_tsk);
+ bus->watchdog_tsk = NULL;
+ }
+
/* Disable and clear interrupts at the chip level also */
W_SDREG(0, &bus->regs->hostintmask, retries);
local_hostintmask = bus->hostintmask;
@@ -3022,6 +3059,10 @@ void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
if (enforce_mutex)
brcmf_os_sdunlock(bus->dhd);
+
+#if defined(OOB_INTR_ONLY)
+ brcmf_sdio_unregister_oob_intr();
+#endif /* defined(OOB_INTR_ONLY) */
}
int brcmf_sdbrcm_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
@@ -3039,6 +3080,10 @@ int brcmf_sdbrcm_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
if (!bus->dhd)
return 0;
+ /* Start the watchdog timer */
+ bus->dhd->tickcnt = 0;
+ brcmf_sdbrcm_wd_timer(bus, brcmf_watchdog_ms);
+
if (enforce_mutex)
brcmf_os_sdlock(bus->dhd);
@@ -3121,6 +3166,19 @@ int brcmf_sdbrcm_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
brcmf_sdcard_cfg_write(bus->sdh, SDIO_FUNC_1, SBSDIO_FUNC1_CHIPCLKCSR,
saveclk, &err);
+#if defined(OOB_INTR_ONLY)
+ /* Host registration for OOB interrupt */
+ if (brcmf_sdio_register_oob_intr(bus->dhd)) {
+ brcmf_sdbrcm_wd_timer(bus, 0);
+ DHD_ERROR(("%s Host failed to resgister for OOB\n", __func__));
+ ret = -ENODEV;
+ goto exit;
+ }
+
+ /* Enable oob at firmware */
+ brcmf_sdbrcm_enable_oob_intr(bus, true);
+#endif /* defined(OOB_INTR_ONLY) */
+
/* If we didn't come up, turn off backplane clock */
if (dhdp->busstate != DHD_BUS_DATA)
brcmf_sdbrcm_clkctl(bus, CLK_NONE, false);
@@ -5029,7 +5087,7 @@ extern bool brcmf_sdbrcm_bus_watchdog(dhd_pub_t *dhdp)
bus->idlecount = 0;
if (bus->activity) {
bus->activity = false;
- brcmf_os_wd_timer(bus->dhd, brcmf_watchdog_ms);
+ brcmf_sdbrcm_wd_timer(bus, brcmf_watchdog_ms);
} else {
brcmf_sdbrcm_clkctl(bus, CLK_NONE, false);
}
@@ -5218,6 +5276,24 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
spin_lock_init(&bus->txqlock);
init_waitqueue_head(&bus->ctrl_wait);
+ /* Set up the watchdog timer */
+ init_timer(&bus->timer);
+ bus->timer.data = (unsigned long)bus;
+ bus->timer.function = brcmf_sdbrcm_watchdog;
+
+ if (brcmf_dpc_prio >= 0) {
+ /* Initialize watchdog thread */
+ init_completion(&bus->watchdog_wait);
+ bus->watchdog_tsk = kthread_run(brcmf_sdbrcm_watchdog_thread,
+ bus, "brcmf_watchdog");
+ if (IS_ERR(bus->watchdog_tsk)) {
+ printk(KERN_WARNING
+ "brcmf_watchdog thread failed to start\n");
+ bus->watchdog_tsk = NULL;
+ }
+ } else
+ bus->watchdog_tsk = NULL;
+
/* Attach to the dhd/OS/network interface */
bus->dhd = brcmf_attach(bus, SDPCM_RESERVE);
if (!bus->dhd) {
@@ -5868,6 +5944,7 @@ int brcmf_bus_devreset(dhd_pub_t *dhdp, u8 flag)
bus = dhdp->bus;
if (flag == true) {
+ brcmf_sdbrcm_wd_timer(bus, 0);
if (!bus->dhd->dongle_reset) {
/* Expect app to have torn down any
connection before calling */
@@ -5924,6 +6001,7 @@ int brcmf_bus_devreset(dhd_pub_t *dhdp, u8 flag)
"is on\n", __func__));
bcmerror = -EIO;
}
+ brcmf_sdbrcm_wd_timer(bus, brcmf_watchdog_ms);
}
return bcmerror;
}
@@ -6339,3 +6417,99 @@ brcmf_sdbrcm_wait_event_wakeup(dhd_bus_t *bus)
wake_up_interruptible(&bus->ctrl_wait);
return;
}
+
+static int
+brcmf_sdbrcm_watchdog_thread(void *data)
+{
+ dhd_bus_t *bus = (dhd_bus_t *)data;
+
+ /* This thread doesn't need any user-level access,
+ * so get rid of all our resources
+ */
+ if (brcmf_watchdog_prio > 0) {
+ struct sched_param param;
+ param.sched_priority = (brcmf_watchdog_prio < MAX_RT_PRIO) ?
+ brcmf_watchdog_prio : (MAX_RT_PRIO - 1);
+ sched_setscheduler(current, SCHED_FIFO, ¶m);
+ }
+
+ allow_signal(SIGTERM);
+ /* Run until signal received */
+ while (1) {
+ if (kthread_should_stop())
+ break;
+ if (!wait_for_completion_interruptible(&bus->watchdog_wait)) {
+ if (bus->dhd->dongle_reset == false)
+ brcmf_sdbrcm_bus_watchdog(bus->dhd);
+ /* Count the tick for reference */
+ bus->dhd->tickcnt++;
+ } else
+ break;
+ }
+ return 0;
+}
+
+static void
+brcmf_sdbrcm_watchdog(unsigned long data)
+{
+ dhd_bus_t *bus = (dhd_bus_t *)data;
+
+ if (brcmf_watchdog_prio >= 0) {
+ if (bus->watchdog_tsk)
+ complete(&bus->watchdog_wait);
+ else
+ return;
+ } else {
+ brcmf_sdbrcm_bus_watchdog(bus->dhd);
+
+ /* Count the tick for reference */
+ bus->dhd->tickcnt++;
+ }
+
+ /* Reschedule the watchdog */
+ if (bus->wd_timer_valid)
+ mod_timer(&bus->timer, jiffies + brcmf_watchdog_ms * HZ / 1000);
+}
+
+void
+brcmf_sdbrcm_wd_timer(struct dhd_bus *bus, uint wdtick)
+{
+ static uint save_ms;
+
+ /* don't start the wd until fw is loaded */
+ if (bus->dhd->busstate == DHD_BUS_DOWN)
+ return;
+
+ /* Totally stop the timer */
+ if (!wdtick && bus->wd_timer_valid == true) {
+ del_timer_sync(&bus->timer);
+ bus->wd_timer_valid = false;
+ save_ms = wdtick;
+ return;
+ }
+
+ if (wdtick) {
+ brcmf_watchdog_ms = (uint) wdtick;
+
+ if (save_ms != brcmf_watchdog_ms) {
+ if (bus->wd_timer_valid == true)
+ /* Stop timer and restart at new value */
+ del_timer_sync(&bus->timer);
+
+ /* Create timer again when watchdog period is
+ dynamically changed or in the first instance
+ */
+ bus->timer.expires =
+ jiffies + brcmf_watchdog_ms * HZ / 1000;
+ add_timer(&bus->timer);
+
+ } else {
+ /* Re arm the timer, at last watchdog period */
+ mod_timer(&bus->timer,
+ jiffies + brcmf_watchdog_ms * HZ / 1000);
+ }
+
+ bus->wd_timer_valid = true;
+ save_ms = wdtick;
+ }
+}
--
1.7.1
From: Roland Vossen <[email protected]>
Code cleanup.
Signed-off-by: Roland Vossen <[email protected]>
Reviewed-by: Arend van Spriel <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c | 16 +++++++---------
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 2 +-
drivers/staging/brcm80211/brcmfmac/sdio_host.h | 6 +++---
3 files changed, 11 insertions(+), 13 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
index 66d81d1..a2408ec 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
@@ -49,10 +49,8 @@ extern void brcmf_sdbrcm_isr(void *args);
/**
* SDIO Host Controller info
*/
-typedef struct bcmsdh_hc bcmsdh_hc_t;
-
struct bcmsdh_hc {
- bcmsdh_hc_t *next;
+ struct bcmsdh_hc *next;
#ifdef BCMPLATFORM_BUS
struct device *dev; /* platform device handle */
#else
@@ -69,10 +67,10 @@ struct bcmsdh_hc {
spinlock_t irq_lock;
#endif
};
-static bcmsdh_hc_t *sdhcinfo;
+static struct bcmsdh_hc *sdhcinfo;
/* driver info, initialized when brcmf_sdio_register is called */
-static bcmsdh_driver_t drvinfo = { NULL, NULL };
+static struct brcmf_sdioh_driver drvinfo = { NULL, NULL };
/* debugging macros */
#define SDLX_MSG(x)
@@ -142,7 +140,7 @@ static
#endif /* BCMLXSDMMC */
int brcmf_sdio_probe(struct device *dev)
{
- bcmsdh_hc_t *sdhc = NULL;
+ struct bcmsdh_hc *sdhc = NULL;
unsigned long regs = 0;
struct brcmf_sdio *sdh = NULL;
#if !defined(BCMLXSDMMC) && defined(BCMPLATFORM_BUS)
@@ -176,7 +174,7 @@ int brcmf_sdio_probe(struct device *dev)
}
#endif /* defined(OOB_INTR_ONLY) */
/* allocate SDIO Host Controller state info */
- sdhc = kzalloc(sizeof(bcmsdh_hc_t), GFP_ATOMIC);
+ sdhc = kzalloc(sizeof(struct bcmsdh_hc), GFP_ATOMIC);
if (!sdhc) {
SDLX_MSG(("%s: out of memory\n", __func__));
goto err;
@@ -236,7 +234,7 @@ static
#endif /* BCMLXSDMMC */
int brcmf_sdio_remove(struct device *dev)
{
- bcmsdh_hc_t *sdhc, *prev;
+ struct bcmsdh_hc *sdhc, *prev;
sdhc = sdhcinfo;
drvinfo.detach(sdhc->ch);
@@ -271,7 +269,7 @@ int brcmf_sdio_remove(struct device *dev)
extern int brcmf_sdio_function_init(void);
-int brcmf_sdio_register(bcmsdh_driver_t *driver)
+int brcmf_sdio_register(struct brcmf_sdioh_driver *driver)
{
drvinfo = *driver;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 2ede425..c00f0f2 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -5632,7 +5632,7 @@ static void brcmf_sdbrcm_disconnect(void *ptr)
* order to look for or await the device.
*/
-static bcmsdh_driver_t dhd_sdio = {
+static struct brcmf_sdioh_driver dhd_sdio = {
brcmf_sdbrcm_probe,
brcmf_sdbrcm_disconnect
};
diff --git a/drivers/staging/brcm80211/brcmfmac/sdio_host.h b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
index c7d60ca..b7e0754 100644
--- a/drivers/staging/brcm80211/brcmfmac/sdio_host.h
+++ b/drivers/staging/brcm80211/brcmfmac/sdio_host.h
@@ -201,16 +201,16 @@ extern int brcmf_sdcard_reset(struct brcmf_sdio *sdh);
extern void *brcmf_sdcard_get_sdioh(struct brcmf_sdio *sdh);
/* callback functions */
-typedef struct {
+struct brcmf_sdioh_driver {
/* attach to device */
void *(*attach) (u16 vend_id, u16 dev_id, u16 bus, u16 slot,
u16 func, uint bustype, void *regsva, void *param);
/* detach from device */
void (*detach) (void *ch);
-} bcmsdh_driver_t;
+};
/* platform specific/high level functions */
-extern int brcmf_sdio_register(bcmsdh_driver_t *driver);
+extern int brcmf_sdio_register(struct brcmf_sdioh_driver *driver);
extern void brcmf_sdio_unregister(void);
extern bool brcmf_sdio_chipmatch(u16 vendor, u16 device);
extern void brcmf_sdio_device_remove(void *sdh);
--
1.7.1
From: Arend van Spriel <[email protected]>
The macro FOREACH_BSS did an assignment inside the if condition. The
macro has been modified to get rid of the error.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
---
drivers/staging/brcm80211/brcmsmac/main.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmsmac/main.c b/drivers/staging/brcm80211/brcmsmac/main.c
index f7ebaf1..9aa74df 100644
--- a/drivers/staging/brcm80211/brcmsmac/main.c
+++ b/drivers/staging/brcm80211/brcmsmac/main.c
@@ -254,8 +254,9 @@ const u8 wlc_prio2prec_map[] = {
/* As above for all non-NULL BSS configs */
#define FOREACH_BSS(wlc, idx, cfg) \
- for (idx = 0; (int) idx < WLC_MAXBSSCFG; idx++) \
- if ((cfg = (wlc)->bsscfg[idx]))
+ for (idx = 0, cfg = (wlc)->bsscfg[idx]; \
+ idx < WLC_MAXBSSCFG; cfg = (wlc)->bsscfg[++idx]) \
+ if (cfg)
/* Sanity check for tx_prec_map and fifo synchup
* Either there are some packets pending for the fifo, else if fifo is empty then
--
1.7.1
From: Arend van Spriel <[email protected]>
The function provided by dhd_linux.c have been renamed to make
the naming throughout the driver more consistent and remove
Broadcom specific acronyms which are not meaningful.
Signed-off-by: Arend van Spriel <[email protected]>
Reviewed-by: Roland Vossen <[email protected]>
Reviewed-by: Franky Lin <[email protected]>
---
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c | 2 +-
drivers/staging/brcm80211/brcmfmac/dhd.h | 88 ++++++------
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c | 20 ++--
drivers/staging/brcm80211/brcmfmac/dhd_common.c | 24 ++--
.../staging/brcm80211/brcmfmac/dhd_custom_gpio.c | 6 +-
drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 142 ++++++++++----------
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 132 +++++++++---------
7 files changed, 209 insertions(+), 205 deletions(-)
diff --git a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
index 8007e90..3fabc08 100644
--- a/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c
@@ -169,7 +169,7 @@ int brcmf_sdio_probe(struct device *dev)
#else
irq_flags = IRQF_TRIGGER_FALLING;
#endif /* HW_OOB */
- irq = dhd_customer_oob_irq_map(&irq_flags);
+ irq = brcmf_customer_oob_irq_map(&irq_flags);
if (irq < 0) {
SDLX_MSG(("%s: Host irq is not defined\n", __func__));
return 1;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd.h b/drivers/staging/brcm80211/brcmfmac/dhd.h
index bccda7f..d19d091 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd.h
+++ b/drivers/staging/brcm80211/brcmfmac/dhd.h
@@ -881,96 +881,98 @@ static inline void MUTEX_UNLOCK_WL_SCAN_SET(void)
* Returned structure should have bus and prot pointers filled in.
* bus_hdrlen specifies required headroom for bus module header.
*/
-extern dhd_pub_t *dhd_attach(struct dhd_bus *bus,
+extern dhd_pub_t *brcmf_attach(struct dhd_bus *bus,
uint bus_hdrlen);
-extern int dhd_net_attach(dhd_pub_t *dhdp, int idx);
+extern int brcmf_net_attach(dhd_pub_t *dhdp, int idx);
/* Indication from bus module regarding removal/absence of dongle */
-extern void dhd_detach(dhd_pub_t *dhdp);
+extern void brcmf_detach(dhd_pub_t *dhdp);
/* Indication from bus module to change flow-control state */
-extern void dhd_txflowcontrol(dhd_pub_t *dhdp, int ifidx, bool on);
+extern void brcmf_txflowcontrol(dhd_pub_t *dhdp, int ifidx, bool on);
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 void dhd_rx_frame(dhd_pub_t *dhdp, int ifidx,
+extern void brcmf_rx_frame(dhd_pub_t *dhdp, int ifidx,
struct sk_buff *rxp, int numpkt);
/* Return pointer to interface name */
-extern char *dhd_ifname(dhd_pub_t *dhdp, int idx);
+extern char *brcmf_ifname(dhd_pub_t *dhdp, int idx);
/* Request scheduling of the bus dpc */
-extern void dhd_sched_dpc(dhd_pub_t *dhdp);
+extern void brcmf_sched_dpc(dhd_pub_t *dhdp);
/* Notify tx completion */
-extern void dhd_txcomplete(dhd_pub_t *dhdp, struct sk_buff *txp, bool success);
+extern void brcmf_txcomplete(dhd_pub_t *dhdp, struct sk_buff *txp,
+ bool success);
/* Query ioctl */
extern int dhdcdc_query_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf,
uint len);
/* OS independent layer functions */
-extern int dhd_os_proto_block(dhd_pub_t *pub);
-extern int dhd_os_proto_unblock(dhd_pub_t *pub);
-extern int dhd_os_ioctl_resp_wait(dhd_pub_t *pub, uint *condition,
+extern int brcmf_os_proto_block(dhd_pub_t *pub);
+extern int brcmf_os_proto_unblock(dhd_pub_t *pub);
+extern int brcmf_os_ioctl_resp_wait(dhd_pub_t *pub, uint *condition,
bool *pending);
-extern int dhd_os_ioctl_resp_wake(dhd_pub_t *pub);
-extern unsigned int dhd_os_get_ioctl_resp_timeout(void);
-extern void dhd_os_set_ioctl_resp_timeout(unsigned int timeout_msec);
-extern void *dhd_os_open_image(char *filename);
-extern int dhd_os_get_image_block(char *buf, int len, void *image);
-extern void dhd_os_close_image(void *image);
-extern void dhd_os_wd_timer(void *bus, uint wdtick);
-extern void dhd_os_sdlock(dhd_pub_t *pub);
-extern void dhd_os_sdunlock(dhd_pub_t *pub);
-extern void dhd_os_sdlock_sndup_rxq(dhd_pub_t *pub);
-extern void dhd_customer_gpio_wlan_ctrl(int onoff);
-extern int dhd_custom_get_mac_address(unsigned char *buf);
-extern void dhd_os_sdunlock_sndup_rxq(dhd_pub_t *pub);
-extern void dhd_os_sdlock_eventq(dhd_pub_t *pub);
-extern void dhd_os_sdunlock_eventq(dhd_pub_t *pub);
+extern int brcmf_os_ioctl_resp_wake(dhd_pub_t *pub);
+extern unsigned int brcmf_os_get_ioctl_resp_timeout(void);
+extern void brcmf_os_set_ioctl_resp_timeout(unsigned int timeout_msec);
+extern void *brcmf_os_open_image(char *filename);
+extern int brcmf_os_get_image_block(char *buf, int len, void *image);
+extern void brcmf_os_close_image(void *image);
+extern void brcmf_os_wd_timer(void *bus, uint wdtick);
+extern void brcmf_os_sdlock(dhd_pub_t *pub);
+extern void brcmf_os_sdunlock(dhd_pub_t *pub);
+extern void brcmf_os_sdlock_sndup_rxq(dhd_pub_t *pub);
+extern void brcmf_customer_gpio_wlan_ctrl(int onoff);
+extern int brcmf_custom_get_mac_address(unsigned char *buf);
+extern void brcmf_os_sdunlock_sndup_rxq(dhd_pub_t *pub);
+extern void brcmf_os_sdlock_eventq(dhd_pub_t *pub);
+extern void brcmf_os_sdunlock_eventq(dhd_pub_t *pub);
#ifdef DHD_DEBUG
-extern int write_to_file(dhd_pub_t *dhd, u8 *buf, int size);
+extern int brcmf_write_to_file(dhd_pub_t *dhd, u8 *buf, int size);
#endif /* DHD_DEBUG */
#if defined(OOB_INTR_ONLY)
-extern int dhd_customer_oob_irq_map(unsigned long *irq_flags_ptr);
+extern int brcmf_customer_oob_irq_map(unsigned long *irq_flags_ptr);
#endif /* defined(OOB_INTR_ONLY) */
-extern void dhd_timeout_start(dhd_timeout_t *tmo, uint usec);
-extern int dhd_timeout_expired(dhd_timeout_t *tmo);
+extern void brcmf_timeout_start(dhd_timeout_t *tmo, uint usec);
+extern int brcmf_timeout_expired(dhd_timeout_t *tmo);
-extern int dhd_ifname2idx(struct dhd_info *dhd, char *name);
+extern int brcmf_ifname2idx(struct dhd_info *dhd, char *name);
extern u8 *dhd_bssidx2bssid(dhd_pub_t *dhd, int idx);
extern int brcmf_c_host_event(struct dhd_info *dhd, int *idx, void *pktdata,
brcmf_event_msg_t *, void **data_ptr);
extern void brcmf_c_init(void);
-extern int dhd_add_if(struct dhd_info *dhd, int ifidx, void *handle,
+extern int brcmf_add_if(struct dhd_info *dhd, int ifidx, void *handle,
char *name, u8 *mac_addr, u32 flags, u8 bssidx);
-extern void dhd_del_if(struct dhd_info *dhd, int ifidx);
+extern void brcmf_del_if(struct dhd_info *dhd, int ifidx);
-extern void dhd_vif_add(struct dhd_info *dhd, int ifidx, char *name);
-extern void dhd_vif_del(struct dhd_info *dhd, int ifidx);
+extern void brcmf_vif_add(struct dhd_info *dhd, int ifidx, char *name);
+extern void brcmf_vif_del(struct dhd_info *dhd, int ifidx);
-extern void dhd_event(struct dhd_info *dhd, char *evpkt, int evlen, int ifidx);
-extern void dhd_vif_sendup(struct dhd_info *dhd, int ifidx, unsigned char * cp,
- int len);
+extern void brcmf_event(struct dhd_info *dhd, char *evpkt, int evlen,
+ int ifidx);
+extern void brcmf_vif_sendup(struct dhd_info *dhd, int ifidx,
+ unsigned char *cp, int len);
/* Send packet to dongle via data channel */
-extern int dhd_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pkt);
+extern int brcmf_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pkt);
/* Send event to host */
extern void dhd_sendup_event(dhd_pub_t *dhdp, brcmf_event_msg_t *event,
void *data);
-extern int dhd_bus_devreset(dhd_pub_t *dhdp, u8 flag);
+extern int brcmf_bus_devreset(dhd_pub_t *dhdp, u8 flag);
extern uint dhd_bus_status(dhd_pub_t *dhdp);
-extern int dhd_bus_start(dhd_pub_t *dhdp);
+extern int brcmf_bus_start(dhd_pub_t *dhdp);
-extern void dhd_wait_for_event(dhd_pub_t *dhd, bool * lockvar);
-extern void dhd_wait_event_wakeup(dhd_pub_t *dhd);
+extern void brcmf_wait_for_event(dhd_pub_t *dhd, bool * lockvar);
+extern void brcmf_wait_event_wakeup(dhd_pub_t *dhd);
#ifdef PKT_FILTER_SUPPORT
extern void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
index 0ed62a0..b229e05 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_cdc.c
@@ -204,7 +204,8 @@ retry:
goto retry;
if (id != prot->reqid) {
DHD_ERROR(("%s: %s: unexpected request id %d (expected %d)\n",
- dhd_ifname(dhd, ifidx), __func__, id, prot->reqid));
+ brcmf_ifname(dhd, ifidx), __func__, id,
+ prot->reqid));
ret = -EINVAL;
goto done;
}
@@ -264,7 +265,8 @@ int dhdcdc_set_ioctl(dhd_pub_t *dhd, int ifidx, uint cmd, void *buf, uint len)
if (id != prot->reqid) {
DHD_ERROR(("%s: %s: unexpected request id %d (expected %d)\n",
- dhd_ifname(dhd, ifidx), __func__, id, prot->reqid));
+ brcmf_ifname(dhd, ifidx), __func__, id,
+ prot->reqid));
ret = -EINVAL;
goto done;
}
@@ -292,7 +294,7 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len)
__func__));
return ret;
}
- dhd_os_proto_block(dhd);
+ brcmf_os_proto_block(dhd);
DHD_TRACE(("%s: Enter\n", __func__));
@@ -346,7 +348,7 @@ dhd_prot_ioctl(dhd_pub_t *dhd, int ifidx, wl_ioctl_t *ioc, void *buf, int len)
prot->pending = false;
done:
- dhd_os_proto_unblock(dhd);
+ brcmf_os_proto_unblock(dhd);
return ret;
}
@@ -427,14 +429,14 @@ int dhd_prot_hdrpull(dhd_pub_t *dhd, int *ifidx, struct sk_buff *pktbuf)
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",
- dhd_ifname(dhd, *ifidx), h->flags));
+ brcmf_ifname(dhd, *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",
- dhd_ifname(dhd, *ifidx), h->flags));
+ brcmf_ifname(dhd, *ifidx), h->flags));
PKTSETSUMGOOD(pktbuf, true);
}
@@ -501,18 +503,18 @@ int dhd_prot_init(dhd_pub_t *dhd)
DHD_TRACE(("%s: Enter\n", __func__));
- dhd_os_proto_block(dhd);
+ brcmf_os_proto_block(dhd);
/* Get the device MAC address */
strcpy(buf, "cur_etheraddr");
ret = dhdcdc_query_ioctl(dhd, 0, BRCMF_C_GET_VAR, buf, sizeof(buf));
if (ret < 0) {
- dhd_os_proto_unblock(dhd);
+ brcmf_os_proto_unblock(dhd);
return ret;
}
memcpy(dhd->mac, buf, ETH_ALEN);
- dhd_os_proto_unblock(dhd);
+ brcmf_os_proto_unblock(dhd);
#ifdef EMBEDDED_PLATFORM
ret = brcmf_c_preinit_ioctls(dhd);
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_common.c b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
index 9d604a6..e4680fb 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_common.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_common.c
@@ -262,7 +262,7 @@ brcmf_c_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
bcmerror = -ENOLINK;
break;
}
- dhd_os_wd_timer(dhd_pub, (uint) int_val);
+ brcmf_os_wd_timer(dhd_pub, (uint) int_val);
break;
case IOV_GVAL(IOV_DUMP):
@@ -300,7 +300,7 @@ brcmf_c_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
break;
case IOV_GVAL(IOV_IOCTLTIMEOUT):{
- int_val = (s32) dhd_os_get_ioctl_resp_timeout();
+ int_val = (s32) brcmf_os_get_ioctl_resp_timeout();
memcpy(arg, &int_val, sizeof(int_val));
break;
}
@@ -309,7 +309,7 @@ brcmf_c_doiovar(dhd_pub_t *dhd_pub, const struct brcmu_iovar *vi, u32 actionid,
if (int_val <= 0)
bcmerror = -EINVAL;
else
- dhd_os_set_ioctl_resp_timeout((unsigned int)
+ brcmf_os_set_ioctl_resp_timeout((unsigned int)
int_val);
break;
}
@@ -865,13 +865,13 @@ brcmf_c_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
if (ifevent->ifidx > 0 &&
ifevent->ifidx < DHD_MAX_IFS) {
if (ifevent->action == BRCMF_E_IF_ADD)
- dhd_add_if(dhd, ifevent->ifidx,
+ brcmf_add_if(dhd, ifevent->ifidx,
NULL, event->ifname,
pvt_data->eth.h_dest,
ifevent->flags,
ifevent->bssidx);
else
- dhd_del_if(dhd, ifevent->ifidx);
+ brcmf_del_if(dhd, ifevent->ifidx);
} else {
DHD_ERROR(("%s: Invalid ifidx %d for %s\n",
__func__, ifevent->ifidx,
@@ -879,9 +879,9 @@ brcmf_c_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
}
}
/* send up the if event: btamp user needs it */
- *ifidx = dhd_ifname2idx(dhd, event->ifname);
+ *ifidx = brcmf_ifname2idx(dhd, event->ifname);
/* push up to external supp/auth */
- dhd_event(dhd, (char *)pvt_data, evlen, *ifidx);
+ brcmf_event(dhd, (char *)pvt_data, evlen, *ifidx);
break;
#ifdef P2P
@@ -898,9 +898,9 @@ brcmf_c_host_event(struct dhd_info *dhd, int *ifidx, void *pktdata,
default:
/* Fall through: this should get _everything_ */
- *ifidx = dhd_ifname2idx(dhd, event->ifname);
+ *ifidx = brcmf_ifname2idx(dhd, event->ifname);
/* push up to external supp/auth */
- dhd_event(dhd, (char *)pvt_data, evlen, *ifidx);
+ brcmf_event(dhd, (char *)pvt_data, evlen, *ifidx);
DHD_TRACE(("%s: MAC event %d, flags %x, status %x\n",
__func__, type, flags, status));
@@ -1207,7 +1207,7 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
u8 ea_addr[ETH_ALEN];
#endif /* GET_CUSTOM_MAC_ENABLE */
- dhd_os_proto_block(dhd);
+ brcmf_os_proto_block(dhd);
#ifdef GET_CUSTOM_MAC_ENABLE
/* Read MAC address from external customer place
@@ -1216,7 +1216,7 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
** firmware but unique per board mac address maybe provided by
** customer code
*/
- ret = dhd_custom_get_mac_address(ea_addr);
+ ret = brcmf_custom_get_mac_address(ea_addr);
if (!ret) {
brcmu_mkiovar("cur_etheraddr", (void *)ea_addr, ETH_ALEN,
buf, sizeof(buf));
@@ -1313,7 +1313,7 @@ int brcmf_c_preinit_ioctls(dhd_pub_t *dhd)
}
#endif /* PKT_FILTER_SUPPORT */
- dhd_os_proto_unblock(dhd);
+ brcmf_os_proto_unblock(dhd);
return 0;
}
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c b/drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c
index defc009..a60caea 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c
@@ -52,7 +52,7 @@ static int dhd_oob_gpio_num = -1; /* GG 19 */
module_param(dhd_oob_gpio_num, int, 0644);
MODULE_PARM_DESC(dhd_oob_gpio_num, "DHD oob gpio number");
-int dhd_customer_oob_irq_map(unsigned long *irq_flags_ptr)
+int brcmf_customer_oob_irq_map(unsigned long *irq_flags_ptr)
{
int host_oob_irq = 0;
@@ -88,7 +88,7 @@ int dhd_customer_oob_irq_map(unsigned long *irq_flags_ptr)
#endif /* defined(OOB_INTR_ONLY) */
/* Customer function to control hw specific wlan gpios */
-void dhd_customer_gpio_wlan_ctrl(int onoff)
+void brcmf_customer_gpio_wlan_ctrl(int onoff)
{
switch (onoff) {
case WLAN_RESET_OFF:
@@ -137,7 +137,7 @@ void dhd_customer_gpio_wlan_ctrl(int onoff)
#ifdef GET_CUSTOM_MAC_ENABLE
/* Function to get custom MAC address */
-int dhd_custom_get_mac_address(unsigned char *buf)
+int brcmf_custom_get_mac_address(unsigned char *buf)
{
WL_TRACE("%s Enter\n", __func__);
if (!buf)
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
index bebdd4d..928220c 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_linux.c
@@ -485,12 +485,12 @@ static void dhd_suspend_resume_helper(struct dhd_info *dhd, int val)
{
dhd_pub_t *dhdp = &dhd->pub;
- dhd_os_proto_block(dhdp);
+ brcmf_os_proto_block(dhdp);
/* Set flag when early suspend was called */
dhdp->in_suspend = val;
if (!dhdp->suspend_disable_flag)
dhd_set_suspend(val, dhdp);
- dhd_os_proto_unblock(dhdp);
+ brcmf_os_proto_unblock(dhdp);
}
static void dhd_early_suspend(struct early_suspend *h)
@@ -520,15 +520,15 @@ static void dhd_late_resume(struct early_suspend *h)
* back-off until
* the sleep time reaches one jiffy, then switches over to task delay. Usage:
*
- * dhd_timeout_start(&tmo, usec);
- * while (!dhd_timeout_expired(&tmo))
+ * brcmf_timeout_start(&tmo, usec);
+ * while (!brcmf_timeout_expired(&tmo))
* if (poll_something())
* break;
- * if (dhd_timeout_expired(&tmo))
+ * if (brcmf_timeout_expired(&tmo))
* fatal();
*/
-void dhd_timeout_start(dhd_timeout_t *tmo, uint usec)
+void brcmf_timeout_start(dhd_timeout_t *tmo, uint usec)
{
tmo->limit = usec;
tmo->increment = 0;
@@ -536,7 +536,7 @@ void dhd_timeout_start(dhd_timeout_t *tmo, uint usec)
tmo->tick = 1000000 / HZ;
}
-int dhd_timeout_expired(dhd_timeout_t *tmo)
+int brcmf_timeout_expired(dhd_timeout_t *tmo)
{
/* Does nothing the first call */
if (tmo->increment == 0) {
@@ -587,7 +587,7 @@ static int dhd_net2idx(dhd_info_t *dhd, struct net_device *net)
return DHD_BAD_IF;
}
-int dhd_ifname2idx(dhd_info_t *dhd, char *name)
+int brcmf_ifname2idx(dhd_info_t *dhd, char *name)
{
int i = DHD_MAX_IFS;
@@ -606,7 +606,7 @@ int dhd_ifname2idx(dhd_info_t *dhd, char *name)
return i; /* default - the primary interface */
}
-char *dhd_ifname(dhd_pub_t *dhdp, int ifidx)
+char *brcmf_ifname(dhd_pub_t *dhdp, int ifidx)
{
dhd_info_t *dhd = (dhd_info_t *) dhdp->info;
@@ -652,7 +652,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
bufp = buf = kmalloc(buflen, GFP_ATOMIC);
if (!bufp) {
DHD_ERROR(("%s: out of memory for mcast_list, cnt %d\n",
- dhd_ifname(&dhd->pub, ifidx), cnt));
+ brcmf_ifname(&dhd->pub, ifidx), cnt));
return;
}
@@ -680,7 +680,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
ret = dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
if (ret < 0) {
DHD_ERROR(("%s: set mcast_list failed, cnt %d\n",
- dhd_ifname(&dhd->pub, ifidx), cnt));
+ brcmf_ifname(&dhd->pub, ifidx), cnt));
allmulti = cnt ? true : allmulti;
}
@@ -695,7 +695,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
buf = kmalloc(buflen, GFP_ATOMIC);
if (!buf) {
DHD_ERROR(("%s: out of memory for allmulti\n",
- dhd_ifname(&dhd->pub, ifidx)));
+ brcmf_ifname(&dhd->pub, ifidx)));
return;
}
allmulti = cpu_to_le32(allmulti);
@@ -703,7 +703,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
if (!brcmu_mkiovar
("allmulti", (void *)&allmulti, sizeof(allmulti), buf, buflen)) {
DHD_ERROR(("%s: mkiovar failed for allmulti, datalen %d "
- "buflen %u\n", dhd_ifname(&dhd->pub, ifidx),
+ "buflen %u\n", brcmf_ifname(&dhd->pub, ifidx),
(int)sizeof(allmulti), buflen));
kfree(buf);
return;
@@ -718,7 +718,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
ret = dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
if (ret < 0) {
DHD_ERROR(("%s: set allmulti %d failed\n",
- dhd_ifname(&dhd->pub, ifidx),
+ brcmf_ifname(&dhd->pub, ifidx),
le32_to_cpu(allmulti)));
}
@@ -739,7 +739,7 @@ static void _dhd_set_multicast_list(dhd_info_t *dhd, int ifidx)
ret = dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
if (ret < 0) {
DHD_ERROR(("%s: set promisc %d failed\n",
- dhd_ifname(&dhd->pub, ifidx),
+ brcmf_ifname(&dhd->pub, ifidx),
le32_to_cpu(allmulti)));
}
}
@@ -755,7 +755,7 @@ _dhd_set_mac_address(dhd_info_t *dhd, int ifidx, u8 *addr)
if (!brcmu_mkiovar
("cur_etheraddr", (char *)addr, ETH_ALEN, buf, 32)) {
DHD_ERROR(("%s: mkiovar failed for cur_etheraddr\n",
- dhd_ifname(&dhd->pub, ifidx)));
+ brcmf_ifname(&dhd->pub, ifidx)));
return -1;
}
memset(&ioc, 0, sizeof(ioc));
@@ -767,7 +767,7 @@ _dhd_set_mac_address(dhd_info_t *dhd, int ifidx, u8 *addr)
ret = dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
if (ret < 0) {
DHD_ERROR(("%s: set cur_etheraddr failed\n",
- dhd_ifname(&dhd->pub, ifidx)));
+ brcmf_ifname(&dhd->pub, ifidx)));
} else {
memcpy(dhd->iflist[ifidx]->net->dev_addr, addr, ETH_ALEN);
}
@@ -813,7 +813,7 @@ static void dhd_op_if(dhd_if_t *ifp)
if (ret == 0) {
strcpy(ifp->net->name, ifp->name);
memcpy(netdev_priv(ifp->net), &dhd, sizeof(dhd));
- err = dhd_net_attach(&dhd->pub, ifp->idx);
+ err = brcmf_net_attach(&dhd->pub, ifp->idx);
if (err != 0) {
DHD_ERROR(("%s: dhd_net_attach failed, "
"err %d\n",
@@ -960,7 +960,7 @@ static void dhd_set_multicast_list(struct net_device *dev)
up(&dhd->sysioc_sem);
}
-int dhd_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf)
+int brcmf_sendpkt(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf)
{
int ret;
dhd_info_t *dhd = (dhd_info_t *) (dhdp->info);
@@ -1038,14 +1038,14 @@ static int dhd_start_xmit(struct sk_buff *skb, struct net_device *net)
struct sk_buff *skb2;
DHD_INFO(("%s: insufficient headroom\n",
- dhd_ifname(&dhd->pub, ifidx)));
+ brcmf_ifname(&dhd->pub, ifidx)));
dhd->pub.tx_realloc++;
skb2 = skb_realloc_headroom(skb, dhd->pub.hdrlen);
dev_kfree_skb(skb);
skb = skb2;
if (skb == NULL) {
DHD_ERROR(("%s: skb_realloc_headroom failed\n",
- dhd_ifname(&dhd->pub, ifidx)));
+ brcmf_ifname(&dhd->pub, ifidx)));
ret = -ENOMEM;
goto done;
}
@@ -1055,13 +1055,13 @@ static int dhd_start_xmit(struct sk_buff *skb, struct net_device *net)
pktbuf = PKTFRMNATIVE(dhd->pub.osh, skb);
if (!pktbuf) {
DHD_ERROR(("%s: PKTFRMNATIVE failed\n",
- dhd_ifname(&dhd->pub, ifidx)));
+ brcmf_ifname(&dhd->pub, ifidx)));
dev_kfree_skb_any(skb);
ret = -ENOMEM;
goto done;
}
- ret = dhd_sendpkt(&dhd->pub, ifidx, pktbuf);
+ ret = brcmf_sendpkt(&dhd->pub, ifidx, pktbuf);
done:
if (ret)
@@ -1073,7 +1073,7 @@ done:
return 0;
}
-void dhd_txflowcontrol(dhd_pub_t *dhdp, int ifidx, bool state)
+void brcmf_txflowcontrol(dhd_pub_t *dhdp, int ifidx, bool state)
{
struct net_device *net;
dhd_info_t *dhd = dhdp->info;
@@ -1089,7 +1089,7 @@ void dhd_txflowcontrol(dhd_pub_t *dhdp, int ifidx, bool state)
netif_wake_queue(net);
}
-void dhd_rx_frame(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf,
+void brcmf_rx_frame(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf,
int numpkt)
{
dhd_info_t *dhd = (dhd_info_t *) dhdp->info;
@@ -1175,13 +1175,13 @@ void dhd_rx_frame(dhd_pub_t *dhdp, int ifidx, struct sk_buff *pktbuf,
}
}
-void dhd_event(struct dhd_info *dhd, char *evpkt, int evlen, int ifidx)
+void brcmf_event(struct dhd_info *dhd, char *evpkt, int evlen, int ifidx)
{
/* Linux version has nothing to do */
return;
}
-void dhd_txcomplete(dhd_pub_t *dhdp, struct sk_buff *txp, bool success)
+void brcmf_txcomplete(dhd_pub_t *dhdp, struct sk_buff *txp, bool success)
{
uint ifidx;
dhd_info_t *dhd = (dhd_info_t *) (dhdp->info);
@@ -1345,7 +1345,7 @@ static void dhd_dpc(unsigned long data)
}
}
-void dhd_sched_dpc(dhd_pub_t *dhdp)
+void brcmf_sched_dpc(dhd_pub_t *dhdp)
{
dhd_info_t *dhd = (dhd_info_t *) dhdp->info;
@@ -1379,12 +1379,12 @@ static int dhd_toe_get(dhd_info_t *dhd, int ifidx, u32 *toe_ol)
/* Check for older dongle image that doesn't support toe_ol */
if (ret == -EIO) {
DHD_ERROR(("%s: toe not supported by device\n",
- dhd_ifname(&dhd->pub, ifidx)));
+ brcmf_ifname(&dhd->pub, ifidx)));
return -EOPNOTSUPP;
}
DHD_INFO(("%s: could not get toe_ol: ret=%d\n",
- dhd_ifname(&dhd->pub, ifidx), ret));
+ brcmf_ifname(&dhd->pub, ifidx), ret));
return ret;
}
@@ -1415,7 +1415,7 @@ static int dhd_toe_set(dhd_info_t *dhd, int ifidx, u32 toe_ol)
ret = dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
if (ret < 0) {
DHD_ERROR(("%s: could not set toe_ol: ret=%d\n",
- dhd_ifname(&dhd->pub, ifidx), ret));
+ brcmf_ifname(&dhd->pub, ifidx), ret));
return ret;
}
@@ -1429,7 +1429,7 @@ static int dhd_toe_set(dhd_info_t *dhd, int ifidx, u32 toe_ol)
ret = dhd_prot_ioctl(&dhd->pub, ifidx, &ioc, ioc.buf, ioc.len);
if (ret < 0) {
DHD_ERROR(("%s: could not set toe: ret=%d\n",
- dhd_ifname(&dhd->pub, ifidx), ret));
+ brcmf_ifname(&dhd->pub, ifidx), ret));
return ret;
}
@@ -1716,7 +1716,7 @@ static int dhd_open(struct net_device *net)
if (ifidx == 0) { /* do it only for primary eth0 */
/* try to bring up bus */
- ret = dhd_bus_start(&dhd->pub);
+ ret = brcmf_bus_start(&dhd->pub);
if (ret != 0) {
DHD_ERROR(("%s: failed with code %d\n", __func__, ret));
return -1;
@@ -1747,7 +1747,7 @@ static int dhd_open(struct net_device *net)
}
int
-dhd_add_if(dhd_info_t *dhd, int ifidx, void *handle, char *name,
+brcmf_add_if(dhd_info_t *dhd, int ifidx, void *handle, char *name,
u8 *mac_addr, u32 flags, u8 bssidx)
{
dhd_if_t *ifp;
@@ -1783,7 +1783,7 @@ dhd_add_if(dhd_info_t *dhd, int ifidx, void *handle, char *name,
return 0;
}
-void dhd_del_if(dhd_info_t *dhd, int ifidx)
+void brcmf_del_if(dhd_info_t *dhd, int ifidx)
{
dhd_if_t *ifp;
@@ -1802,7 +1802,7 @@ void dhd_del_if(dhd_info_t *dhd, int ifidx)
up(&dhd->sysioc_sem);
}
-dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen)
+dhd_pub_t *brcmf_attach(struct dhd_bus *bus, uint bus_hdrlen)
{
dhd_info_t *dhd = NULL;
struct net_device *net;
@@ -1846,7 +1846,7 @@ dhd_pub_t *dhd_attach(struct dhd_bus *bus, uint bus_hdrlen)
strcat(net->name, "%d");
}
- if (dhd_add_if(dhd, 0, (void *)net, net->name, NULL, 0, 0) ==
+ if (brcmf_add_if(dhd, 0, (void *)net, net->name, NULL, 0, 0) ==
DHD_BAD_IF)
goto fail;
@@ -1961,12 +1961,12 @@ fail:
if (net)
free_netdev(net);
if (dhd)
- dhd_detach(&dhd->pub);
+ brcmf_detach(&dhd->pub);
return NULL;
}
-int dhd_bus_start(dhd_pub_t *dhdp)
+int brcmf_bus_start(dhd_pub_t *dhdp)
{
int ret = -1;
dhd_info_t *dhd = (dhd_info_t *) dhdp->info;
@@ -1992,7 +1992,7 @@ int dhd_bus_start(dhd_pub_t *dhdp)
/* Start the watchdog timer */
dhd->pub.tickcnt = 0;
- dhd_os_wd_timer(&dhd->pub, brcmf_watchdog_ms);
+ brcmf_os_wd_timer(&dhd->pub, brcmf_watchdog_ms);
/* Bring up the bus */
ret = brcmf_sdbrcm_bus_init(&dhd->pub, true);
@@ -2099,7 +2099,7 @@ static struct net_device_ops dhd_ops_pri = {
.ndo_set_multicast_list = dhd_set_multicast_list
};
-int dhd_net_attach(dhd_pub_t *dhdp, int ifidx)
+int brcmf_net_attach(dhd_pub_t *dhdp, int ifidx)
{
dhd_info_t *dhd = (dhd_info_t *) dhdp->info;
struct net_device *net;
@@ -2179,7 +2179,7 @@ void dhd_bus_detach(dhd_pub_t *dhdp)
}
}
-void dhd_detach(dhd_pub_t *dhdp)
+void brcmf_detach(dhd_pub_t *dhdp)
{
dhd_info_t *dhd;
@@ -2198,7 +2198,7 @@ void dhd_detach(dhd_pub_t *dhdp)
for (i = 1; i < DHD_MAX_IFS; i++)
if (dhd->iflist[i])
- dhd_del_if(dhd, i);
+ brcmf_del_if(dhd, i);
ifp = dhd->iflist[0];
ASSERT(ifp);
@@ -2250,7 +2250,7 @@ static void __exit dhd_module_cleanup(void)
wifi_del_dev();
#endif
/* Call customer gpio to turn off power with WL_REG_ON signal */
- dhd_customer_gpio_wlan_ctrl(WLAN_POWER_OFF);
+ brcmf_customer_gpio_wlan_ctrl(WLAN_POWER_OFF);
}
static int __init dhd_module_init(void)
@@ -2274,7 +2274,7 @@ static int __init dhd_module_init(void)
return -EINVAL;
} while (0);
/* Call customer gpio to turn on power with WL_REG_ON signal */
- dhd_customer_gpio_wlan_ctrl(WLAN_POWER_ON);
+ brcmf_customer_gpio_wlan_ctrl(WLAN_POWER_ON);
#if defined(CUSTOMER_HW2) && defined(CONFIG_WIFI_CONTROL_FUNC)
sema_init(&wifi_control_sem, 0);
@@ -2306,7 +2306,7 @@ static int __init dhd_module_init(void)
failed:
/* turn off power and exit */
- dhd_customer_gpio_wlan_ctrl(WLAN_POWER_OFF);
+ brcmf_customer_gpio_wlan_ctrl(WLAN_POWER_OFF);
return -EINVAL;
}
@@ -2316,7 +2316,7 @@ module_exit(dhd_module_cleanup);
/*
* OS specific functions required to implement DHD driver in OS independent way
*/
-int dhd_os_proto_block(dhd_pub_t *pub)
+int brcmf_os_proto_block(dhd_pub_t *pub)
{
dhd_info_t *dhd = (dhd_info_t *) (pub->info);
@@ -2327,7 +2327,7 @@ int dhd_os_proto_block(dhd_pub_t *pub)
return 0;
}
-int dhd_os_proto_unblock(dhd_pub_t *pub)
+int brcmf_os_proto_unblock(dhd_pub_t *pub)
{
dhd_info_t *dhd = (dhd_info_t *) (pub->info);
@@ -2339,17 +2339,17 @@ int dhd_os_proto_unblock(dhd_pub_t *pub)
return 0;
}
-unsigned int dhd_os_get_ioctl_resp_timeout(void)
+unsigned int brcmf_os_get_ioctl_resp_timeout(void)
{
return (unsigned int)dhd_ioctl_timeout_msec;
}
-void dhd_os_set_ioctl_resp_timeout(unsigned int timeout_msec)
+void brcmf_os_set_ioctl_resp_timeout(unsigned int timeout_msec)
{
dhd_ioctl_timeout_msec = (int)timeout_msec;
}
-int dhd_os_ioctl_resp_wait(dhd_pub_t *pub, uint *condition, bool *pending)
+int brcmf_os_ioctl_resp_wait(dhd_pub_t *pub, uint *condition, bool *pending)
{
dhd_info_t *dhd = (dhd_info_t *) (pub->info);
DECLARE_WAITQUEUE(wait, current);
@@ -2374,7 +2374,7 @@ int dhd_os_ioctl_resp_wait(dhd_pub_t *pub, uint *condition, bool *pending)
return timeout;
}
-int dhd_os_ioctl_resp_wake(dhd_pub_t *pub)
+int brcmf_os_ioctl_resp_wake(dhd_pub_t *pub)
{
dhd_info_t *dhd = (dhd_info_t *) (pub->info);
@@ -2384,7 +2384,7 @@ int dhd_os_ioctl_resp_wake(dhd_pub_t *pub)
return 0;
}
-void dhd_os_wd_timer(void *bus, uint wdtick)
+void brcmf_os_wd_timer(void *bus, uint wdtick)
{
dhd_pub_t *pub = bus;
static uint save_dhd_watchdog_ms;
@@ -2429,7 +2429,7 @@ void dhd_os_wd_timer(void *bus, uint wdtick)
}
}
-void *dhd_os_open_image(char *filename)
+void *brcmf_os_open_image(char *filename)
{
struct file *fp;
@@ -2449,7 +2449,7 @@ void *dhd_os_open_image(char *filename)
return fp;
}
-int dhd_os_get_image_block(char *buf, int len, void *image)
+int brcmf_os_get_image_block(char *buf, int len, void *image)
{
struct file *fp = (struct file *)image;
int rdlen;
@@ -2467,7 +2467,7 @@ int dhd_os_get_image_block(char *buf, int len, void *image)
return rdlen;
}
-void dhd_os_close_image(void *image)
+void brcmf_os_close_image(void *image)
{
if (!dhd_no_fw_req)
return wl_cfg80211_release_fw();
@@ -2475,7 +2475,7 @@ void dhd_os_close_image(void *image)
filp_close((struct file *)image, NULL);
}
-void dhd_os_sdlock(dhd_pub_t *pub)
+void brcmf_os_sdlock(dhd_pub_t *pub)
{
dhd_info_t *dhd;
@@ -2487,7 +2487,7 @@ void dhd_os_sdlock(dhd_pub_t *pub)
spin_lock_bh(&dhd->sdlock);
}
-void dhd_os_sdunlock(dhd_pub_t *pub)
+void brcmf_os_sdunlock(dhd_pub_t *pub)
{
dhd_info_t *dhd;
@@ -2528,17 +2528,17 @@ void dhd_sendup_event(dhd_pub_t *dhdp, brcmf_event_msg_t *event, void *data)
}
}
-void dhd_wait_for_event(dhd_pub_t *dhd, bool *lockvar)
+void brcmf_wait_for_event(dhd_pub_t *dhd, bool *lockvar)
{
struct dhd_info *dhdinfo = dhd->info;
- dhd_os_sdunlock(dhd);
+ brcmf_os_sdunlock(dhd);
wait_event_interruptible_timeout(dhdinfo->ctrl_wait,
(*lockvar == false), HZ * 2);
- dhd_os_sdlock(dhd);
+ brcmf_os_sdlock(dhd);
return;
}
-void dhd_wait_event_wakeup(dhd_pub_t *dhd)
+void brcmf_wait_event_wakeup(dhd_pub_t *dhd)
{
struct dhd_info *dhdinfo = dhd->info;
if (waitqueue_active(&dhdinfo->ctrl_wait))
@@ -2552,13 +2552,13 @@ int dhd_dev_reset(struct net_device *dev, u8 flag)
/* Turning off watchdog */
if (flag)
- dhd_os_wd_timer(&dhd->pub, 0);
+ brcmf_os_wd_timer(&dhd->pub, 0);
- dhd_bus_devreset(&dhd->pub, flag);
+ brcmf_bus_devreset(&dhd->pub, flag);
/* Turning on watchdog back */
if (!flag)
- dhd_os_wd_timer(&dhd->pub, brcmf_watchdog_ms);
+ brcmf_os_wd_timer(&dhd->pub, brcmf_watchdog_ms);
DHD_ERROR(("%s: WLAN OFF DONE\n", __func__));
return 1;
@@ -2583,9 +2583,9 @@ int net_os_set_suspend(struct net_device *dev, int val)
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
if (dhd) {
- dhd_os_proto_block(&dhd->pub);
+ brcmf_os_proto_block(&dhd->pub);
ret = dhd_set_suspend(val, &dhd->pub);
- dhd_os_proto_unblock(&dhd->pub);
+ brcmf_os_proto_unblock(&dhd->pub);
}
#endif /* defined(CONFIG_HAS_EARLYSUSPEND) */
return ret;
@@ -2612,12 +2612,12 @@ int net_os_set_packet_filter(struct net_device *dev, int val)
* back ON only if suspend_disable_flag was not set
*/
if (dhd && dhd->pub.up) {
- dhd_os_proto_block(&dhd->pub);
+ brcmf_os_proto_block(&dhd->pub);
if (dhd->pub.in_suspend) {
if (!val || (val && !dhd->pub.suspend_disable_flag))
dhd_set_packet_filter(val, &dhd->pub);
}
- dhd_os_proto_unblock(&dhd->pub);
+ brcmf_os_proto_unblock(&dhd->pub);
}
return ret;
}
@@ -2696,11 +2696,11 @@ void wl_os_wd_timer(struct net_device *ndev, uint wdtick)
{
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(ndev);
- dhd_os_wd_timer(&dhd->pub, wdtick);
+ brcmf_os_wd_timer(&dhd->pub, wdtick);
}
#ifdef DHD_DEBUG
-int write_to_file(dhd_pub_t *dhd, u8 *buf, int size)
+int brcmf_write_to_file(dhd_pub_t *dhd, u8 *buf, int size)
{
int ret = 0;
struct file *fp;
diff --git a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
index 5ce62fe..cb389ae 100644
--- a/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/staging/brcm80211/brcmfmac/dhd_sdio.c
@@ -999,7 +999,7 @@ static int brcmf_sdbrcm_clkctl(dhd_bus_t *bus, uint target, bool pendok)
/* Early exit if we're already there */
if (bus->clkstate == target) {
if (target == CLK_AVAIL) {
- dhd_os_wd_timer(bus->dhd, brcmf_watchdog_ms);
+ brcmf_os_wd_timer(bus->dhd, brcmf_watchdog_ms);
bus->activity = true;
}
return 0;
@@ -1012,7 +1012,7 @@ static int brcmf_sdbrcm_clkctl(dhd_bus_t *bus, uint target, bool pendok)
brcmf_sdbrcm_sdclk(bus, true);
/* Now request HT Avail on the backplane */
brcmf_sdbrcm_htclk(bus, true, pendok);
- dhd_os_wd_timer(bus->dhd, brcmf_watchdog_ms);
+ brcmf_os_wd_timer(bus->dhd, brcmf_watchdog_ms);
bus->activity = true;
break;
@@ -1025,7 +1025,7 @@ static int brcmf_sdbrcm_clkctl(dhd_bus_t *bus, uint target, bool pendok)
else
DHD_ERROR(("brcmf_sdbrcm_clkctl: request for %d -> %d"
"\n", bus->clkstate, target));
- dhd_os_wd_timer(bus->dhd, brcmf_watchdog_ms);
+ brcmf_os_wd_timer(bus->dhd, brcmf_watchdog_ms);
break;
case CLK_NONE:
@@ -1034,7 +1034,7 @@ static int brcmf_sdbrcm_clkctl(dhd_bus_t *bus, uint target, bool pendok)
brcmf_sdbrcm_htclk(bus, false, false);
/* Now remove the SD clock */
brcmf_sdbrcm_sdclk(bus, false);
- dhd_os_wd_timer(bus->dhd, 0);
+ brcmf_os_wd_timer(bus->dhd, 0);
break;
}
#ifdef DHD_DEBUG
@@ -1324,9 +1324,9 @@ static int brcmf_sdbrcm_txpkt(dhd_bus_t *bus, struct sk_buff *pkt, uint chan,
done:
/* restore pkt buffer pointer before calling tx complete routine */
skb_pull(pkt, SDPCM_HDRLEN + pad);
- dhd_os_sdunlock(bus->dhd);
- dhd_txcomplete(bus->dhd, pkt, ret != 0);
- dhd_os_sdlock(bus->dhd);
+ brcmf_os_sdunlock(bus->dhd);
+ brcmf_txcomplete(bus->dhd, pkt, ret != 0);
+ brcmf_os_sdlock(bus->dhd);
if (free_pkt)
brcmu_pkt_buf_free_skb(pkt);
@@ -1377,7 +1377,7 @@ int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
spin_lock_bh(&bus->txqlock);
if (brcmf_c_prec_enq(bus->dhd, &bus->txq, pkt, prec) == false) {
skb_pull(pkt, SDPCM_HDRLEN);
- dhd_txcomplete(bus->dhd, pkt, false);
+ brcmf_txcomplete(bus->dhd, pkt, false);
brcmu_pkt_buf_free_skb(pkt);
DHD_ERROR(("%s: out of bus->txq !!!\n", __func__));
ret = -ENOSR;
@@ -1387,7 +1387,7 @@ int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
spin_unlock_bh(&bus->txqlock);
if (pktq_len(&bus->txq) >= TXHI)
- dhd_txflowcontrol(bus->dhd, 0, ON);
+ brcmf_txflowcontrol(bus->dhd, 0, ON);
#ifdef DHD_DEBUG
if (pktq_plen(&bus->txq, prec) > qcount[prec])
@@ -1396,11 +1396,11 @@ int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
/* Schedule DPC if needed to send queued packet(s) */
if (dhd_deferred_tx && !bus->dpc_sched) {
bus->dpc_sched = true;
- dhd_sched_dpc(bus->dhd);
+ brcmf_sched_dpc(bus->dhd);
}
} else {
/* Lock: we're about to use shared data/code (and SDIO) */
- dhd_os_sdlock(bus->dhd);
+ brcmf_os_sdlock(bus->dhd);
/* Otherwise, send it now */
BUS_WAKE(bus);
@@ -1425,7 +1425,7 @@ int brcmf_sdbrcm_bus_txdata(struct dhd_bus *bus, struct sk_buff *pkt)
brcmf_sdbrcm_clkctl(bus, CLK_NONE, true);
}
- dhd_os_sdunlock(bus->dhd);
+ brcmf_os_sdunlock(bus->dhd);
}
return ret;
@@ -1486,7 +1486,7 @@ static uint brcmf_sdbrcm_sendfromq(dhd_bus_t *bus, uint maxframes)
/* Deflow-control stack if needed */
if (dhd->up && (dhd->busstate == DHD_BUS_DATA) &&
dhd->txoff && (pktq_len(&bus->txq) < TXLOW))
- dhd_txflowcontrol(dhd, 0, OFF);
+ brcmf_txflowcontrol(dhd, 0, OFF);
return cnt;
}
@@ -1541,7 +1541,7 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
ASSERT(IS_ALIGNED((unsigned long)frame, 2));
/* Need to lock here to protect txseq and SDIO tx calls */
- dhd_os_sdlock(bus->dhd);
+ brcmf_os_sdlock(bus->dhd);
BUS_WAKE(bus);
@@ -1569,7 +1569,7 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
bus->ctrl_frame_buf = frame;
bus->ctrl_frame_len = len;
- dhd_wait_for_event(bus->dhd, &bus->ctrl_frame_stat);
+ brcmf_wait_for_event(bus->dhd, &bus->ctrl_frame_stat);
if (bus->ctrl_frame_stat == false) {
DHD_INFO(("%s: ctrl_frame_stat == false\n", __func__));
@@ -1643,7 +1643,7 @@ brcmf_sdbrcm_bus_txctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
brcmf_sdbrcm_clkctl(bus, CLK_NONE, true);
}
- dhd_os_sdunlock(bus->dhd);
+ brcmf_os_sdunlock(bus->dhd);
if (ret)
bus->dhd->tx_ctlerrs++;
@@ -1665,13 +1665,13 @@ int brcmf_sdbrcm_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
return -EIO;
/* Wait until control frame is available */
- timeleft = dhd_os_ioctl_resp_wait(bus->dhd, &bus->rxlen, &pending);
+ timeleft = brcmf_os_ioctl_resp_wait(bus->dhd, &bus->rxlen, &pending);
- dhd_os_sdlock(bus->dhd);
+ brcmf_os_sdlock(bus->dhd);
rxlen = bus->rxlen;
memcpy(msg, bus->rxctl, min(msglen, rxlen));
bus->rxlen = 0;
- dhd_os_sdunlock(bus->dhd);
+ brcmf_os_sdunlock(bus->dhd);
if (rxlen) {
DHD_CTL(("%s: resumed on rxctl frame, got %d expected %d\n",
@@ -1679,9 +1679,9 @@ int brcmf_sdbrcm_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
} else if (timeleft == 0) {
DHD_ERROR(("%s: resumed on timeout\n", __func__));
#ifdef DHD_DEBUG
- dhd_os_sdlock(bus->dhd);
+ brcmf_os_sdlock(bus->dhd);
brcmf_sdbrcm_checkdied(bus, NULL, 0);
- dhd_os_sdunlock(bus->dhd);
+ brcmf_os_sdunlock(bus->dhd);
#endif /* DHD_DEBUG */
} else if (pending == true) {
DHD_CTL(("%s: cancelled\n", __func__));
@@ -1689,9 +1689,9 @@ int brcmf_sdbrcm_bus_rxctl(struct dhd_bus *bus, unsigned char *msg, uint msglen)
} else {
DHD_CTL(("%s: resumed for unknown reason?\n", __func__));
#ifdef DHD_DEBUG
- dhd_os_sdlock(bus->dhd);
+ brcmf_os_sdlock(bus->dhd);
brcmf_sdbrcm_checkdied(bus, NULL, 0);
- dhd_os_sdunlock(bus->dhd);
+ brcmf_os_sdunlock(bus->dhd);
#endif /* DHD_DEBUG */
}
@@ -2252,12 +2252,12 @@ static int brcmf_sdbrcm_mem_dump(dhd_bus_t *bus)
printk(KERN_DEBUG "Done\n");
/* free buf before return !!! */
- if (write_to_file(bus->dhd, buf, bus->ramsize)) {
+ if (brcmf_write_to_file(bus->dhd, buf, bus->ramsize)) {
DHD_ERROR(("%s: Error writing to files\n", __func__));
return -1;
}
- /* buf free handled in write_to_file, not here */
+ /* buf free handled in brcmf_write_to_file, not here */
return 0;
}
@@ -2396,7 +2396,7 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
bool_val = (int_val != 0) ? true : false;
/* Some ioctls use the bus */
- dhd_os_sdlock(bus->dhd);
+ brcmf_os_sdlock(bus->dhd);
/* Check if dongle is in reset. If so, only allow DEVRESET iovars */
if (bus->dhd->dongle_reset && !(actionid == IOV_SVAL(IOV_DEVRESET) ||
@@ -2757,7 +2757,7 @@ brcmf_sdbrcm_doiovar(dhd_bus_t *bus, const struct brcmu_iovar *vi, u32 actionid,
__func__, bool_val, bus->dhd->dongle_reset,
bus->dhd->busstate));
- dhd_bus_devreset(bus->dhd, (u8) bool_val);
+ brcmf_bus_devreset(bus->dhd, (u8) bool_val);
break;
@@ -2781,7 +2781,7 @@ exit:
brcmf_sdbrcm_clkctl(bus, CLK_NONE, true);
}
- dhd_os_sdunlock(bus->dhd);
+ brcmf_os_sdunlock(bus->dhd);
if (actionid == IOV_SVAL(IOV_DEVRESET) && bool_val == false)
brcmf_c_preinit_ioctls((dhd_pub_t *) bus->dhd);
@@ -2953,7 +2953,7 @@ brcmf_sdbrcm_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
/* Look up var locally; if not found pass to host driver */
vi = brcmu_iovar_lookup(dhdsdio_iovars, name);
if (vi == NULL) {
- dhd_os_sdlock(bus->dhd);
+ brcmf_os_sdlock(bus->dhd);
BUS_WAKE(bus);
@@ -2986,7 +2986,7 @@ brcmf_sdbrcm_bus_iovar_op(dhd_pub_t *dhdp, const char *name,
brcmf_sdbrcm_clkctl(bus, CLK_NONE, true);
}
- dhd_os_sdunlock(bus->dhd);
+ brcmf_os_sdunlock(bus->dhd);
goto exit;
}
@@ -3027,7 +3027,7 @@ void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
DHD_TRACE(("%s: Enter\n", __func__));
if (enforce_mutex)
- dhd_os_sdlock(bus->dhd);
+ brcmf_os_sdlock(bus->dhd);
BUS_WAKE(bus);
@@ -3081,14 +3081,14 @@ void brcmf_sdbrcm_bus_stop(struct dhd_bus *bus, bool enforce_mutex)
/* Clear rx control and wake any waiters */
bus->rxlen = 0;
- dhd_os_ioctl_resp_wake(bus->dhd);
+ brcmf_os_ioctl_resp_wake(bus->dhd);
/* Reset some F2 state stuff */
bus->rxskip = false;
bus->tx_seq = bus->rx_seq = 0;
if (enforce_mutex)
- dhd_os_sdunlock(bus->dhd);
+ brcmf_os_sdunlock(bus->dhd);
}
int brcmf_sdbrcm_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
@@ -3107,7 +3107,7 @@ int brcmf_sdbrcm_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
return 0;
if (enforce_mutex)
- dhd_os_sdlock(bus->dhd);
+ brcmf_os_sdlock(bus->dhd);
/* Make sure backplane clock is on, needed to generate F2 interrupt */
brcmf_sdbrcm_clkctl(bus, CLK_AVAIL, false);
@@ -3138,10 +3138,10 @@ int brcmf_sdbrcm_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
NULL);
/* Give the dongle some time to do its thing and set IOR2 */
- dhd_timeout_start(&tmo, DHD_WAIT_F2RDY * 1000);
+ brcmf_timeout_start(&tmo, DHD_WAIT_F2RDY * 1000);
ready = 0;
- while (ready != enable && !dhd_timeout_expired(&tmo))
+ while (ready != enable && !brcmf_timeout_expired(&tmo))
ready =
brcmf_sdcard_cfg_read(bus->sdh, SDIO_FUNC_0, SDIO_CCCR_IORx,
NULL);
@@ -3194,7 +3194,7 @@ int brcmf_sdbrcm_bus_init(dhd_pub_t *dhdp, bool enforce_mutex)
exit:
if (enforce_mutex)
- dhd_os_sdunlock(bus->dhd);
+ brcmf_os_sdunlock(bus->dhd);
return ret;
}
@@ -3365,7 +3365,7 @@ gotpkt:
done:
/* Awake any waiters */
- dhd_os_ioctl_resp_wake(bus->dhd);
+ brcmf_os_ioctl_resp_wake(bus->dhd);
}
static u8 brcmf_sdbrcm_rxglom(dhd_bus_t *bus, u8 rxseq)
@@ -3758,9 +3758,9 @@ static u8 brcmf_sdbrcm_rxglom(dhd_bus_t *bus, u8 rxseq)
#endif /* DHD_DEBUG */
}
if (num) {
- dhd_os_sdunlock(bus->dhd);
- dhd_rx_frame(bus->dhd, ifidx, save_pfirst, num);
- dhd_os_sdlock(bus->dhd);
+ brcmf_os_sdunlock(bus->dhd);
+ brcmf_rx_frame(bus->dhd, ifidx, save_pfirst, num);
+ brcmf_os_sdlock(bus->dhd);
}
bus->rxglomframes++;
@@ -4344,9 +4344,9 @@ deliver:
}
/* Unlock during rx call */
- dhd_os_sdunlock(bus->dhd);
- dhd_rx_frame(bus->dhd, ifidx, pkt, 1);
- dhd_os_sdlock(bus->dhd);
+ brcmf_os_sdunlock(bus->dhd);
+ brcmf_rx_frame(bus->dhd, ifidx, pkt, 1);
+ brcmf_os_sdlock(bus->dhd);
}
rxcount = maxframes - rxleft;
#ifdef DHD_DEBUG
@@ -4456,7 +4456,7 @@ bool brcmf_sdbrcm_dpc(dhd_bus_t *bus)
/* Start with leftover status bits */
intstatus = bus->intstatus;
- dhd_os_sdlock(bus->dhd);
+ brcmf_os_sdlock(bus->dhd);
/* If waiting for HTAVAIL, check status */
if (bus->clkstate == CLK_PENDING) {
@@ -4650,7 +4650,7 @@ clkwait:
DHD_INFO(("Return_dpc value is : %d\n", ret));
bus->ctrl_frame_stat = false;
- dhd_wait_event_wakeup(bus->dhd);
+ brcmf_wait_event_wakeup(bus->dhd);
}
/* Send queued frames (limit 1 if rx may still be pending) */
else if ((bus->clkstate == CLK_AVAIL) && !bus->fcstate &&
@@ -4689,7 +4689,7 @@ clkwait:
brcmf_sdbrcm_clkctl(bus, CLK_NONE, false);
}
- dhd_os_sdunlock(bus->dhd);
+ brcmf_os_sdunlock(bus->dhd);
return resched;
}
@@ -4748,7 +4748,7 @@ void brcmf_sdbrcm_isr(void *arg)
;
#else
bus->dpc_sched = true;
- dhd_sched_dpc(bus->dhd);
+ brcmf_sched_dpc(bus->dhd);
#endif
}
@@ -5029,7 +5029,7 @@ extern bool brcmf_sdbrcm_bus_watchdog(dhd_pub_t *dhdp)
if (bus->sleeping)
return false;
- dhd_os_sdlock(bus->dhd);
+ brcmf_os_sdlock(bus->dhd);
/* Poll period: check device if appropriate. */
if (bus->poll && (++bus->polltick >= bus->pollrate)) {
@@ -5060,7 +5060,7 @@ extern bool brcmf_sdbrcm_bus_watchdog(dhd_pub_t *dhdp)
brcmf_sdcard_intr_disable(bus->sdh);
bus->dpc_sched = true;
- dhd_sched_dpc(bus->dhd);
+ brcmf_sched_dpc(bus->dhd);
}
}
@@ -5099,14 +5099,14 @@ extern bool brcmf_sdbrcm_bus_watchdog(dhd_pub_t *dhdp)
bus->idlecount = 0;
if (bus->activity) {
bus->activity = false;
- dhd_os_wd_timer(bus->dhd, brcmf_watchdog_ms);
+ brcmf_os_wd_timer(bus->dhd, brcmf_watchdog_ms);
} else {
brcmf_sdbrcm_clkctl(bus, CLK_NONE, false);
}
}
}
- dhd_os_sdunlock(bus->dhd);
+ brcmf_os_sdunlock(bus->dhd);
return bus->ipend;
}
@@ -5125,11 +5125,11 @@ extern int brcmf_sdbrcm_bus_console_in(dhd_pub_t *dhdp, unsigned char *msg,
return -ENOTSUPP;
/* Exclusive bus access */
- dhd_os_sdlock(bus->dhd);
+ brcmf_os_sdlock(bus->dhd);
/* Don't allow input if dongle is in reset */
if (bus->dhd->dongle_reset) {
- dhd_os_sdunlock(bus->dhd);
+ brcmf_os_sdunlock(bus->dhd);
return -EPERM;
}
@@ -5171,7 +5171,7 @@ done:
brcmf_sdbrcm_clkctl(bus, CLK_NONE, true);
}
- dhd_os_sdunlock(bus->dhd);
+ brcmf_os_sdunlock(bus->dhd);
return rv;
}
@@ -5288,7 +5288,7 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
spin_lock_init(&bus->txqlock);
/* Attach to the dhd/OS/network interface */
- bus->dhd = dhd_attach(bus, SDPCM_RESERVE);
+ bus->dhd = brcmf_attach(bus, SDPCM_RESERVE);
if (!bus->dhd) {
DHD_ERROR(("%s: dhd_attach failed\n", __func__));
goto fail;
@@ -5320,7 +5320,7 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
DHD_INFO(("%s: completed!!\n", __func__));
/* if firmware path present try to download and bring up bus */
- ret = dhd_bus_start(bus->dhd);
+ ret = brcmf_bus_start(bus->dhd);
if (ret != 0) {
if (ret == -ENOLINK) {
DHD_ERROR(("%s: dongle is not responding\n", __func__));
@@ -5328,7 +5328,7 @@ static void *brcmf_sdbrcm_probe(u16 venid, u16 devid, u16 bus_no,
}
}
/* Ok, have the per-port tell the stack we're open for business */
- if (dhd_net_attach(bus->dhd, 0) != 0) {
+ if (brcmf_net_attach(bus->dhd, 0) != 0) {
DHD_ERROR(("%s: Net attach failed!!\n", __func__));
goto fail;
}
@@ -5568,7 +5568,7 @@ static void brcmf_sdbrcm_release(dhd_bus_t *bus)
brcmf_sdcard_intr_dereg(bus->sdh);
if (bus->dhd) {
- dhd_detach(bus->dhd);
+ brcmf_detach(bus->dhd);
brcmf_sdbrcm_release_dongle(bus);
bus->dhd = NULL;
}
@@ -5663,7 +5663,7 @@ static int brcmf_sdbrcm_download_code_file(struct dhd_bus *bus, char *fw_path)
DHD_INFO(("%s: download firmware %s\n", __func__, brcmf_fw_path));
- image = dhd_os_open_image(fw_path);
+ image = brcmf_os_open_image(fw_path);
if (image == NULL)
goto err;
@@ -5679,7 +5679,7 @@ static int brcmf_sdbrcm_download_code_file(struct dhd_bus *bus, char *fw_path)
/* Download image */
while ((len =
- dhd_os_get_image_block((char *)memptr, MEMBLOCK, image))) {
+ brcmf_os_get_image_block((char *)memptr, MEMBLOCK, image))) {
bcmerror = brcmf_sdbrcm_membytes(bus, true, offset, memptr,
len);
if (bcmerror) {
@@ -5695,7 +5695,7 @@ err:
kfree(memblock);
if (image)
- dhd_os_close_image(image);
+ brcmf_os_close_image(image);
return bcmerror;
}
@@ -5789,7 +5789,7 @@ static int brcmf_sdbrcm_download_nvram(struct dhd_bus *bus)
return 0;
if (nvram_file_exists) {
- image = dhd_os_open_image(nv_path);
+ image = brcmf_os_open_image(nv_path);
if (image == NULL)
goto err;
}
@@ -5803,7 +5803,7 @@ static int brcmf_sdbrcm_download_nvram(struct dhd_bus *bus)
/* Download variables */
if (nvram_file_exists) {
- len = dhd_os_get_image_block(memblock, MEMBLOCK, image);
+ len = brcmf_os_get_image_block(memblock, MEMBLOCK, image);
} else {
len = strlen(bus->nvram_params);
ASSERT(len <= MEMBLOCK);
@@ -5835,7 +5835,7 @@ err:
kfree(memblock);
if (image)
- dhd_os_close_image(image);
+ brcmf_os_close_image(image);
return bcmerror;
}
@@ -5929,7 +5929,7 @@ uint dhd_bus_hdrlen(struct dhd_bus *bus)
return SDPCM_HDRLEN;
}
-int dhd_bus_devreset(dhd_pub_t *dhdp, u8 flag)
+int brcmf_bus_devreset(dhd_pub_t *dhdp, u8 flag)
{
int bcmerror = 0;
dhd_bus_t *bus;
--
1.7.1
On 07/05/2011 06:59 PM, Greg KH wrote:
> On Wed, Jun 29, 2011 at 04:46:24PM -0700, Franky Lin wrote:
>> Most of these patches are brcmfmac cleanup.
> Not all of them applied, care to redo the ones that didn't and resend
> them?
>
> thanks,
>
> greg k-h
Will do when I figured out which ones are not applying. Franky, as are
all valley broadcom folks, is not in today (fourth of july aftermath).
Here in Holland we have other days to celebrate so taking over from him.
Can you provide me the info about the not applying patches. I applied
them all on top of staging-next as it was this morning and that went
fine. Did we miss some brcm80211 patches not coming from us? I will
start digging here to find out, but you are more than welcome to provide
any info.
Gr. AvS
--
Almost nobody dances sober, unless they happen to be insane.
-- H.P. Lovecraft --
Hello Dan,
I will create a patch (in the short term, couple of days) to address the
issues you detected below. Since this patch [061/119] does not regress
behavior, is it ok with you to *not* drop it ?
>> @@ -1046,7 +1038,7 @@ void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg)
>>
>> memcpy(arg_save, arg, strlen(arg) + 1);
>>
>> - if (strlen(arg)> BUF_SIZE) {
>> + if (strlen(arg)> PKTFILTER_BUF_SIZE) {
>
> strlen() doesn't include the NULL terminator so probably this test
> is off by one. I didn't actually follow the code through to see
> where the buffer overflow happens. The arg_save buffer is
> dynamically allocated to the correct size... buf was the only
> buffer that is PKTFILTER_BUF_SIZE and it stores a different string.
>
> (maybe the test can just be removed?).
I agree, the test is useless. So I will remove it.
> This whole function could be cleaned up with regards to string
> handling.
>
> For example:
> str = "pkt_filter_add";
> str_len = strlen(str);
> strncpy(buf, str, str_len);
> buf[str_len] = '\0';
>
> could be replaced with:
> strcpy(buf, "pkt_filter_add");
>
>> DHD_ERROR(("Not enough buffer %d< %d\n", (int)strlen(arg),
>> (int)sizeof(buf)));
>> goto fail;
Not completely, since variable 'str_len' is used in subsequent code. But
this code snippet can be simplified. Will work on it.
Thanks for the feedback,
Roland.
On 07/05/2011 09:15 PM, Arend van Spriel wrote:
> On 07/05/2011 06:59 PM, Greg KH wrote:
>> On Wed, Jun 29, 2011 at 04:46:24PM -0700, Franky Lin wrote:
>>> Most of these patches are brcmfmac cleanup.
>> Not all of them applied, care to redo the ones that didn't and resend
>> them?
>>
>> thanks,
>>
>> greg k-h
> Will do when I figured out which ones are not applying. Franky, as are
> all valley broadcom folks, is not in today (fourth of july aftermath).
> Here in Holland we have other days to celebrate so taking over from him.
> Can you provide me the info about the not applying patches. I applied
> them all on top of staging-next as it was this morning and that went
> fine. Did we miss some brcm80211 patches not coming from us? I will
> start digging here to find out, but you are more than welcome to provide
> any info.
>
> Gr. AvS
Hi Greg,
This is what I excavated so far. Looking at git.kernel.org it seems like
patch 92 in the series got applied at the end of the series. Up to patch
92 it went fine, but it started to derail from there. I have clear
picture which patches are missing and will resend them.
Gr. AvS
--
Almost nobody dances sober, unless they happen to be insane.
-- H.P. Lovecraft --
On Wed, Jun 29, 2011 at 04:47:25PM -0700, Franky Lin wrote:
> @@ -1046,7 +1038,7 @@ void brcmf_c_pktfilter_offload_set(dhd_pub_t *dhd, char *arg)
>
> memcpy(arg_save, arg, strlen(arg) + 1);
>
> - if (strlen(arg) > BUF_SIZE) {
> + if (strlen(arg) > PKTFILTER_BUF_SIZE) {
strlen() doesn't include the NULL terminator so probably this test
is off by one. I didn't actually follow the code through to see
where the buffer overflow happens. The arg_save buffer is
dynamically allocated to the correct size... buf was the only
buffer that is PKTFILTER_BUF_SIZE and it stores a different string.
(maybe the test can just be removed?).
This whole function could be cleaned up with regards to string
handling.
For example:
str = "pkt_filter_add";
str_len = strlen(str);
strncpy(buf, str, str_len);
buf[str_len] = '\0';
could be replaced with:
strcpy(buf, "pkt_filter_add");
> DHD_ERROR(("Not enough buffer %d < %d\n", (int)strlen(arg),
> (int)sizeof(buf)));
> goto fail;
regards,
dan carpenter
On Tue, Jul 05, 2011 at 09:46:47PM +0200, Arend van Spriel wrote:
> On 07/05/2011 09:15 PM, Arend van Spriel wrote:
> >On 07/05/2011 06:59 PM, Greg KH wrote:
> >>On Wed, Jun 29, 2011 at 04:46:24PM -0700, Franky Lin wrote:
> >>>Most of these patches are brcmfmac cleanup.
> >>Not all of them applied, care to redo the ones that didn't and resend
> >>them?
> >>
> >>thanks,
> >>
> >>greg k-h
> >Will do when I figured out which ones are not applying. Franky, as are
> >all valley broadcom folks, is not in today (fourth of july aftermath).
> >Here in Holland we have other days to celebrate so taking over from him.
> >Can you provide me the info about the not applying patches. I applied
> >them all on top of staging-next as it was this morning and that went
> >fine. Did we miss some brcm80211 patches not coming from us? I will
> >start digging here to find out, but you are more than welcome to provide
> >any info.
> >
> >Gr. AvS
>
> Hi Greg,
>
> This is what I excavated so far. Looking at git.kernel.org it seems
> like patch 92 in the series got applied at the end of the series. Up
> to patch 92 it went fine, but it started to derail from there. I
> have clear picture which patches are missing and will resend them.
Yes, I messed up. I sorted by "brcm" and applied the patches there,
missing the fact that patch 92 was spelled wrong, so I missed it.
Then I went back and applied that one after figuring it out, but you did
at the same time.
I'll queue these up in a bit after I get the kids to bed, thanks for
resending them and sorry for the mixup, it was my fault.
greg k-h
On Thu, Jun 30, 2011 at 02:40:19PM -0700, Henry Ptasinski wrote:
> So there are two suggestions here:
>
> 1. post patches in smaller bunches, and include dependency info in
> the 0/X patch. Presumably, if one of the dependencies is dropped,
> then people will know to drop this series as well, and we would have
> to repost everything that was dropped once we fix the identified
> issues.
>
> 2. maintain a public git tree that people can pull from. If we do
> (1), is this needed and/or still useful?
Yes. Patches hiding in git trees never get reviewed. They just
pile up until there too many to review.
> Do community folks that
> want to contribute changes send them to us or Greg/John/whoever is
> upstream? Pros/cons?
That stuff is between you and Greg. The rest of us don't care.
But what I'm saying is don't delay sending these patches because
you're not sure if the other patches were going to go in or not.
It's not an unpredictable thing. Everyone is supposed to CC you
along with Greg, linux-wireless and driver-devel. You're the
maintainer. If you ack a patch or nack it, then 99% of the time
Greg is going to go along with your decision.
It's not like Greg is going to complain if you start recording which
patches have to go in next and deal with any merge conflicts...
regards,
dan carpenter
On 07/05/2011 11:59 AM, Dan Carpenter wrote:
> On Wed, Jun 29, 2011 at 04:47:58PM -0700, Franky Lin wrote:
>> @@ -549,7 +549,9 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
>> sdio_enable_func
>> (gInstance->func[2]);
>> if (err_ret)
>> - sd_err(("bcmsdh_sdmmc: enable F2 failed:%d",
>> + sd_err(("request_byte: "
>> + "enable F2 "
>> + "failed:%d",
> ^^^
> Newline needed here.
>> err_ret));
>> } else {
>> /* Disable Function 2 */
>> @@ -557,7 +559,9 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
>> sdio_disable_func
>> (gInstance->func[2]);
>> if (err_ret)
>> - sd_err(("bcmsdh_sdmmc: Disab F2 failed:%d",
>> + sd_err(("request_byte: "
>> + "Disab F2 "
>> + "failed:%d",
> ^^^
> Same.
>
>
>> err_ret));
>> }
>> sdio_release_host(gInstance->func[2]);
> regards,
> dan carpenter
Hi Dan,
First of all, thanks for milling through this list of patches. As you
can see the code before the patch was also missing the \n character. I
looked in the brcmfmac code and there are several other sd_*() macros
missing it. So I will fix all with a separate patch.
Gr. AvS
--
Almost nobody dances sober, unless they happen to be insane.
-- H.P. Lovecraft --
On Tue, Jul 05, 2011 at 04:11:18PM +0200, Arend van Spriel wrote:
> On 06/30/2011 12:19 PM, Arend van Spriel wrote:
> >On 06/30/2011 10:37 AM, Dan Carpenter wrote:
> >>That's pretty ugly. Better to leave the original in and ignore the
> >>checkpatch warning. Or maybe do something like this:
> >>
> >> for (idx = 0; (int) idx< WLC_MAXBSSCFG; idx++) { \
> >> cfg = (wlc)->bsscfg[idx]; \
> >> if (!cfg) \
> >> continue; \
> >>
> >>Then #define END_FOREACH_BSS() }
> >Hi Dan,
> >
> >I agree this is not the nicest solution. It was a checkpatch error so we
> >felt an urge to fix it. A warning would have been easier to ignore. I
> >will have a look and see whether the patch can be dropped without
> >issues. Your feedback is noted so I will look for a better iteration
> >solution to replace this.
>
> Hi Greg,
>
> Can you please drop this patch from the series? There are no
> dependencies with the other patches.
Now dropped.
On Wed, Jun 29, 2011 at 04:47:58PM -0700, Franky Lin wrote:
> @@ -549,7 +549,9 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
> sdio_enable_func
> (gInstance->func[2]);
> if (err_ret)
> - sd_err(("bcmsdh_sdmmc: enable F2 failed:%d",
> + sd_err(("request_byte: "
> + "enable F2 "
> + "failed:%d",
^^^
Newline needed here.
> err_ret));
> } else {
> /* Disable Function 2 */
> @@ -557,7 +559,9 @@ brcmf_sdioh_request_byte(struct sdioh_info *sd, uint rw, uint func,
> sdio_disable_func
> (gInstance->func[2]);
> if (err_ret)
> - sd_err(("bcmsdh_sdmmc: Disab F2 failed:%d",
> + sd_err(("request_byte: "
> + "Disab F2 "
> + "failed:%d",
^^^
Same.
> err_ret));
> }
> sdio_release_host(gInstance->func[2]);
regards,
dan carpenter
On Tue, Jul 05, 2011 at 04:15:14PM +0200, Roland Vossen wrote:
> Hello Dan,
>
> I will create a patch (in the short term, couple of days) to address
> the issues you detected below. Since this patch [061/119] does not
> regress behavior, is it ok with you to *not* drop it ?
>
Yeah. I said that earlier, that we should just apply the whole
series as is.
These were all in the original code etc, but I there can't be a
hundred patches in a row without some complaints or it looks like
no one is reviewing. :)
The whole series looks good by the way.
regards,
dan carpenter
On Wed, Jun 29, 2011 at 04:46:24PM -0700, Franky Lin wrote:
> Most of these patches are brcmfmac cleanup.
Not all of them applied, care to redo the ones that didn't and resend
them?
thanks,
greg k-h
On Fri, Jul 01, 2011 at 03:05:26AM +0300, Dan Carpenter wrote:
> On Thu, Jun 30, 2011 at 02:40:19PM -0700, Henry Ptasinski wrote:
> > So there are two suggestions here:
> >
> > 1. post patches in smaller bunches, and include dependency info in
> > the 0/X patch. Presumably, if one of the dependencies is dropped,
> > then people will know to drop this series as well, and we would have
> > to repost everything that was dropped once we fix the identified
> > issues.
> >
> > 2. maintain a public git tree that people can pull from. If we do
> > (1), is this needed and/or still useful?
>
> Yes. Patches hiding in git trees never get reviewed. They just
> pile up until there too many to review.
>
> > Do community folks that
> > want to contribute changes send them to us or Greg/John/whoever is
> > upstream? Pros/cons?
>
> That stuff is between you and Greg. The rest of us don't care.
>
> But what I'm saying is don't delay sending these patches because
> you're not sure if the other patches were going to go in or not.
> It's not an unpredictable thing. Everyone is supposed to CC you
> along with Greg, linux-wireless and driver-devel. You're the
> maintainer. If you ack a patch or nack it, then 99% of the time
> Greg is going to go along with your decision.
>
> It's not like Greg is going to complain if you start recording which
> patches have to go in next and deal with any merge conflicts...
Nope, Greg would be very happy and hopefully have to stop referring to
himself in the third person if people were so kind.
thanks,
greg 'sorry, it's been a long day staring at usb 3.0 patches...' k-h
On 06/30/2011 12:19 PM, Arend van Spriel wrote:
> On 06/30/2011 10:37 AM, Dan Carpenter wrote:
>> That's pretty ugly. Better to leave the original in and ignore the
>> checkpatch warning. Or maybe do something like this:
>>
>> for (idx = 0; (int) idx< WLC_MAXBSSCFG; idx++) { \
>> cfg = (wlc)->bsscfg[idx]; \
>> if (!cfg) \
>> continue; \
>>
>> Then #define END_FOREACH_BSS() }
> Hi Dan,
>
> I agree this is not the nicest solution. It was a checkpatch error so we
> felt an urge to fix it. A warning would have been easier to ignore. I
> will have a look and see whether the patch can be dropped without
> issues. Your feedback is noted so I will look for a better iteration
> solution to replace this.
Hi Greg,
Can you please drop this patch from the series? There are no
dependencies with the other patches.
Gr. AvS
--
Almost nobody dances sober, unless they happen to be insane.
-- H.P. Lovecraft --