staging: brcm80211: more code cleanup and bug fixed
cover staging: brcm80211: more code cleanup and bug fixed
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
PATCH 2/119 staging:brcm80211:brcmfmac: CONNECTING status bit is set at appropriate location
From: Sukesh Srikakula <[email protected]>
'WL_STATUS_CONNECTING' status bit is set at appropriate step in bss/ibss connect requests.
--- drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 48 ++++++++++++++-------- 1 files changed, 31 insertions(+), 17 deletions(-)
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +31 -17
@@ -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; }
Signature · 1 line
1.7.1
PATCH 6/119 staging: brcm80211: remove unused sdtxlock from fullmac
In reply to Franky LinUnused sdtx lock functions are removed from dhd_linux.c
--- drivers/staging/brcm80211/brcmfmac/dhd.h | 2 -- drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 10 ---------- 2 files changed, 0 insertions(+), 12 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -2
@@ -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);
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +0 -10
@@ -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)
Signature · 1 line
1.7.1
PATCH 7/119 staging: brcm80211: remove empty sdrxqlock from fullmac
In reply to Franky LinRemove empty lock functions for sdio rx queue
--- 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(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -2
@@ -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);
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +0 -8
@@ -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)
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +0 -28
@@ -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 ; }
Signature · 1 line
1.7.1
PATCH 16/119 staging: brcm80211: remove macro FOREACH_AS_STA
In reply to Franky LinFrom: 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.
--- drivers/staging/brcm80211/brcmsmac/main.c | 31 +++++++++++++++------------- 1 files changed, 17 insertions(+), 14 deletions(-)
drivers/staging/brcm80211/brcmsmac/main.c +17 -14
@@ -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 */
Signature · 1 line
1.7.1
PATCH 37/119 staging: brcm80211: remove unused globals from dhd_common.c
In reply to Franky LinFrom: Arend van Spriel <[email protected]>
Three global variable were defined but never used and have been removed.
--- drivers/staging/brcm80211/brcmfmac/dhd_common.c | 5 ----- 1 files changed, 0 insertions(+), 5 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_common.c +0 -5
@@ -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);
Signature · 1 line
1.7.1
PATCH 13/119 staging: brcm80211: remove code from pmu.c related to unsupported chipsets
In reply to Franky LinFrom: 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.
--- drivers/staging/brcm80211/brcmsmac/pmu.c | 1424 ------------------------------ drivers/staging/brcm80211/brcmsmac/pmu.h | 3 - 2 files changed, 0 insertions(+), 1427 deletions(-)
drivers/staging/brcm80211/brcmsmac/pmu.c +0 -1424
@@ -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); -}
drivers/staging/brcm80211/brcmsmac/pmu.h +0 -3
@@ -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_ */
Signature · 1 line
1.7.1
PATCH 18/119 staging: brcm80211: remove macro definition DRV_MODULE_NAME
In reply to Franky LinFrom: Arend van Spriel <[email protected]>
The macro definition DRV_MODULE_NAME has exactly the same value as KBUILD_MODNAME so using that instead now.
--- drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +1 -3
@@ -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));
Signature · 1 line
1.7.1
PATCH 1/119 staging: brcm80211: fix checkpatch errors in types.h
In reply to Franky LinFrom: 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.
--- drivers/staging/brcm80211/brcmsmac/types.h | 30 ++++++++++++++-------------- 1 files changed, 15 insertions(+), 15 deletions(-)
drivers/staging/brcm80211/brcmsmac/types.h +15 -15
@@ -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 */
Signature · 1 line
1.7.1
PATCH 15/119 staging: brcm80211: remove chip simulation specific code
In reply to Franky LinFrom: 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.
--- 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(-)
drivers/staging/brcm80211/brcmsmac/aiutils.h +0 -2
@@ -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)
drivers/staging/brcm80211/brcmsmac/main.c +2 -4
@@ -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
drivers/staging/brcm80211/brcmsmac/nicpci.c +14 -19
@@ -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);
drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c +13 -25
@@ -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 );
drivers/staging/brcm80211/brcmsmac/phy/phy_n.c +1 -3
@@ -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 )) {
drivers/staging/brcm80211/brcmsmac/pmu.c +2 -8
@@ -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; }
drivers/staging/brcm80211/brcmsmac/srom.c +2 -59
81 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 9/119 staging: brcm80211: remove unused files from fullmac
In reply to Franky Linaiutils.c and pcicfg.h are no longer needed by fullmac
--- 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
drivers/staging/brcm80211/brcmfmac/aiutils.c deleted +0 -1
@@ -1 +0,0 @@ -#include "../util/aiutils.c"
drivers/staging/brcm80211/brcmfmac/pcicfg.h deleted +0 -50
50 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 17/119 staging: brcm80211: change FOREACH_BSS macro to remove checkpatch error
In reply to Franky LinFrom: 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.
--- drivers/staging/brcm80211/brcmsmac/main.c | 5 +++-- 1 files changed, 3 insertions(+), 2 deletions(-)
drivers/staging/brcm80211/brcmsmac/main.c +3 -2
@@ -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
Signature · 1 line
1.7.1
PATCH 20/119 staging: brcm80211: move assert function to dhd_linux.c
In reply to Franky LinFrom: 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.
--- drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 50 +++++++++++++++++++++++ drivers/staging/brcm80211/brcmfmac/wl_iw.c | 51 ------------------------ 2 files changed, 50 insertions(+), 51 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +50 -0
@@ -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) */
drivers/staging/brcm80211/brcmfmac/wl_iw.c +0 -51
62 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 31/119 staging: brcm80211: remove unnecessary null check
In reply to Franky LinFrom: 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.
--- drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 8 +++----- 1 files changed, 3 insertions(+), 5 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +3 -5
@@ -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 ;
Signature · 1 line
1.7.1
PATCH 33/119 staging: brcm80211: correct bcmsdh_recv_buf() calls
In reply to Franky LinFrom: 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.
--- 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(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +1 -2
@@ -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;
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +7 -7
@@ -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++;
drivers/staging/brcm80211/brcmfmac/sdio_host.h +1 -1
@@ -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);
Signature · 1 line
1.7.1
PATCH 36/119 staging: brcm80211: remove dhd_set_timer function prototype
In reply to Franky LinFrom: Arend van Spriel <[email protected]>
This function prototype is not implemented nor referenced in the brcmfmac driver so it has been removed.
--- drivers/staging/brcm80211/brcmfmac/dhd_common.c | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_common.c +0 -2
@@ -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 ,
Signature · 1 line
1.7.1
PATCH 59/119 staging: brcm80211: replaced typedef SDIOH_API_RC by int
In reply to Franky LinFrom: Roland Vossen <[email protected]>
Code cleanup.
--- 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(-)
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h +11 -13
@@ -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 */
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +15 -15
@@ -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);
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +18 -18
@@ -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__));
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c +1 -1
@@ -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;
Signature · 1 line
1.7.1
PATCH 101/119 staging: brcm80211: removed last global function declaration in .c file
In reply to Franky LinFrom: Roland Vossen <[email protected]>
Code cleanup.
--- .../brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c +0 -1
@@ -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__));
Signature · 1 line
1.7.1
PATCH 113/119 staging: brcm80211: W_REG macro cleanup in fullmac SDIO
In reply to Franky LinFrom: 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.
--- drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 18 +++++------------- 1 files changed, 5 insertions(+), 13 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +5 -13
@@ -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) {
Signature · 1 line
1.7.1
PATCH 116/119 staging: brcm80211: rename pointer conversion macros in wl_cfg80211.h
In reply to Franky LinFrom: 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.
--- drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 134 +++++++++++----------- drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h | 23 ++--- 2 files changed, 76 insertions(+), 81 deletions(-)
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +67 -67
@@ -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 *devstatic 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 *smstatic 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 *smestatic 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);
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +9 -14
@@ -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)
Signature · 1 line
1.7.1
PATCH 119/119 staging: brcm80211: updated TODO file
In reply to Franky LinFrom: Henry Ptasinski <[email protected]>
Updated TODO file to reflect current driver state, results of recent cleanup and fixes.
--- drivers/staging/brcm80211/TODO | 12 +----------- 1 files changed, 1 insertions(+), 11 deletions(-)
drivers/staging/brcm80211/TODO +1 -11
@@ -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 =====================
Signature · 1 line
1.7.1
PATCH 4/119 staging: brcm80211: minor cleanup in initvars_srom_pci()
In reply to Franky LinFrom: 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.
--- drivers/staging/brcm80211/brcmsmac/srom.c | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/staging/brcm80211/brcmsmac/srom.c +1 -3
@@ -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; }
Signature · 1 line
1.7.1
PATCH 29/119 staging: brcm80211: add missing KERN_ facility level to printk()
In reply to Franky LinFrom: Henry Ptasinski <[email protected]>
Debug printk() call was missing KERN_DEBUG facility level.
--- drivers/staging/brcm80211/brcmsmac/phy/phy_n.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
drivers/staging/brcm80211/brcmsmac/phy/phy_n.c +2 -1
@@ -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++;
Signature · 1 line
1.7.1
PATCH 96/119 staging: brcm80211: removed brcmf_sdioh_interrupt_pending()
In reply to Franky LinFrom: Roland Vossen <[email protected]>
Code cleanup. This function always returned 0.
--- 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(-)
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h +0 -4
@@ -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);
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +0 -8
@@ -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)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -7
@@ -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;
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +1 -2
@@ -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 */
drivers/staging/brcm80211/brcmfmac/sdio_host.h +0 -5
@@ -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. */
Signature · 1 line
1.7.1
PATCH 115/119 staging: brcm80211: rename structures and variables in wl_cfg80211.c
In reply to Franky LinFrom: Arend van Spriel <[email protected]>
Making an effort getting rid of the wl_ prefix from the fullmac source files.
--- drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c | 1246 +++++++++++---------- drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h | 103 +-- 2 files changed, 695 insertions(+), 654 deletions(-)
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +653 -593
@@ -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 actionreturn 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 *devstatic 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 *smWL_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 *smstatic 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 *smereturn 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 *smestatic 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 *wrtnl_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 *bireturn 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 *msgmemcpy (&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 *datswitch (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 *datreturn 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 ; }
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +42 -61
239 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 8/119 staging: brcm80211: move sdtxqlock codes to dhd_sdio.c
In reply to Franky LinMove sdio specific tx queue lock codes to dhd_sdio.c for fullmac
--- 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(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -2
@@ -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);
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +0 -18
@@ -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)
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +9 -5
@@ -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) {
Signature · 1 line
1.7.1
PATCH 10/119 staging: brcm80211: remove code for unsupported chipsets from brcmsmac
In reply to Franky LinFrom: 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.
--- 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(-)
drivers/staging/brcm80211/brcmsmac/aiutils.c +1 -51
@@ -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; }
drivers/staging/brcm80211/brcmsmac/bmac.c +2 -4
@@ -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 );
drivers/staging/brcm80211/brcmsmac/main.c +1 -9
@@ -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 ;
Signature · 1 line
1.7.1
PATCH 11/119 staging: brcm80211: remove unsupported chipset code from brcmsmac phy
In reply to Franky LinFrom: 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.
--- 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(-)
drivers/staging/brcm80211/brcmsmac/phy/phy_cmn.c +5 -9
@@ -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);
drivers/staging/brcm80211/brcmsmac/phy/phy_n.c +39 -121
245 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 14/119 staging: brcm80211: remove unused macro definitions from pmu.c
In reply to Franky LinFrom: 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.
--- drivers/staging/brcm80211/brcmsmac/pmu.c | 491 ------------------------------ 1 files changed, 0 insertions(+), 491 deletions(-)
drivers/staging/brcm80211/brcmsmac/pmu.c +0 -491
@@ -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) {
Signature · 1 line
1.7.1
PATCH 21/119 staging: brcm80211: parsed ADDBA response ack window parameter
In reply to Franky LinFrom: 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.
--- 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(-)
drivers/staging/brcm80211/brcmsmac/ampdu.c +18 -37
@@ -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;
drivers/staging/brcm80211/brcmsmac/mac80211_if.c +8 -1
@@ -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 :
drivers/staging/brcm80211/brcmsmac/pub.h +2 -0
@@ -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,
drivers/staging/brcm80211/brcmsmac/scb.h +1 -2
@@ -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 {
Signature · 1 line
1.7.1
PATCH 24/119 staging: brcm80211: Changed comments
In reply to Franky LinFrom: 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.
--- 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(-)
drivers/staging/brcm80211/brcmsmac/bmac.c +0 -1
@@ -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
drivers/staging/brcm80211/brcmsmac/mac80211_if.c +1 -6
@@ -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 */
drivers/staging/brcm80211/brcmsmac/main.c +1 -1
@@ -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);
Signature · 1 line
1.7.1
PATCH 25/119 staging: brcm80211: removed unneeded 'if' statement
In reply to Franky LinFrom: Henry Ptasinski <[email protected]>
The 'if' is unnecessary, since no action is taken as a result of the test.
--- drivers/staging/brcm80211/brcmsmac/bmac.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/staging/brcm80211/brcmsmac/bmac.c +1 -1
@@ -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 ) {
Signature · 1 line
1.7.1
PATCH 26/119 staging: brcm80211: delete empty brcmfmac/README file
In reply to Franky LinFrom: Henry Ptasinski <[email protected]>
brcm80211/brcmfmac/README contents were move to brcm80211/README previously, but this empty file is still around.
--- drivers/staging/brcm80211/brcmfmac/README | 2 -- 1 files changed, 0 insertions(+), 2 deletions(-) delete mode 100644 drivers/staging/brcm80211/brcmfmac/README
drivers/staging/brcm80211/brcmfmac/README deleted +0 -2
@@ -1,2 +0,0 @@ - -
Signature · 1 line
1.7.1
PATCH 40/119 staging: brcm80211: rename ioctl command codes in dhd.h
In reply to Franky LinFrom: 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.
--- 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(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +48 -48
@@ -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() */
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +11 -9
@@ -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;
drivers/staging/brcm80211/brcmfmac/dhd_common.c +29 -29
184 lines not on this page · raw message
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +20 -19
@@ -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;
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +61 -57
442 lines not on this page · raw message
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +2 -2
@@ -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 ]; };
Signature · 1 line
1.7.1
PATCH 42/119 staging: brcm80211: replace macro BCM_MSG_IFNAME_MAX with IFNAMSIZ
In reply to Franky LinFrom: 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.
--- drivers/staging/brcm80211/brcmfmac/dhd.h | 4 +--- 1 files changed, 1 insertions(+), 3 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +1 -3
@@ -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 {
Signature · 1 line
1.7.1
PATCH 46/119 staging: brcm80211: rename fullmac functions
In reply to Franky LinFrom: 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.
--- 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(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +1 -1
@@ -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 ;
drivers/staging/brcm80211/brcmfmac/dhd.h +45 -43
141 lines not on this page · raw message
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +11 -9
@@ -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);
drivers/staging/brcm80211/brcmfmac/dhd_common.c +12 -12
@@ -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 ; }
drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c +3 -3
@@ -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)
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +71 -71
514 lines not on this page · raw message
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +66 -66
462 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 47/119 staging: brcm80211: remove unused prototypes from dhd.h
In reply to Franky LinFrom: Arend van Spriel <[email protected]>
A couple of prototypes are not defined or not used and have been removed from the driver.
--- drivers/staging/brcm80211/brcmfmac/dhd.h | 5 ----- drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 9 --------- 2 files changed, 0 insertions(+), 14 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -5
@@ -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);
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +0 -9
@@ -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;
Signature · 1 line
1.7.1
PATCH 52/119 staging: brcm80211: remove conditional SIMPLE_ISCAN code
In reply to Franky LinFrom: Arend van Spriel <[email protected]>
Code between #ifdef SIMPLE_ISCAN is not enabled and unnecessary. It has been removed from the fullmac driver.
--- drivers/staging/brcm80211/brcmfmac/dhd_common.c | 391 ----------------------- 1 files changed, 0 insertions(+), 391 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_common.c +0 -391
@@ -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) {
Signature · 1 line
1.7.1
PATCH 70/119 staging: brcm80211: define SHOW_EVENTS macro only for debugging
In reply to Franky LinFrom: Arend van Spriel <[email protected]>
The macro SHOW_EVENTS will only be defined when Kconfig setting BRCMDBG is set.
--- drivers/staging/brcm80211/brcmfmac/Makefile | 5 ++--- 1 files changed, 2 insertions(+), 3 deletions(-)
drivers/staging/brcm80211/brcmfmac/Makefile +2 -3
@@ -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 \
Signature · 1 line
1.7.1
PATCH 77/119 staging: brcm80211: move sdio related suspend/resume code to bus interface layer
In reply to Franky LinIn 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.
--- 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(-)
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h +3 -0
@@ -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_ */
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +8 -0
@@ -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 ); +}
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -7
@@ -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;
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c +42 -0
53 lines not on this page · raw message
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +0 -7
@@ -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) {
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +2 -12
@@ -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 )
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +0 -2
@@ -404,6 +404,4 @@ extern s8 *wl_cfg80211_get_fwname(void); /* get firmware name forthe 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_ */
Signature · 1 line
1.7.1
PATCH 78/119 staging: brcm80211: move waitqueue code to dhd_sdio.c
In reply to Franky LinIn fullmac waitqueue for tx control is used by bus interface layer only. So move the related code to dhd_sdio.c
--- 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(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -3
@@ -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);
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +0 -20
@@ -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);
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +24 -2
@@ -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 ; +}
Signature · 1 line
1.7.1
PATCH 82/119 staging: brcm80211: move sdio resource lock to dhd_sdio.c
In reply to Franky LinIn fullmac the lock is for race condition for sdio interface. Move the code to dhd_sdio.c
--- 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(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -6
@@ -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);
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +0 -38
@@ -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) {
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +70 -39
305 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 87/119 staging: brcm80211: rename macro definitions in dhd.h
In reply to Franky LinFrom: Arend van Spriel <[email protected]>
The definitions in dhd.h have been renamed with consistent prefix BRCMF_.
--- 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(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +12 -12
@@ -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",
drivers/staging/brcm80211/brcmfmac/dhd.h +60 -60
218 lines not on this page · raw message
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +1 -1
@@ -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 ;
drivers/staging/brcm80211/brcmfmac/dhd_common.c +17 -17
@@ -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));
drivers/staging/brcm80211/brcmfmac/dhd_dbg.h +26 -26
72 lines not on this page · raw message
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +23 -23
172 lines not on this page · raw message
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +23 -21
166 lines not on this page · raw message
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +24 -24
149 lines not on this page · raw message
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +1 -1
@@ -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 */
Signature · 1 line
1.7.1
PATCH 88/119 staging: brcm80211: remove unused macro definitions from dhd.h
In reply to Franky LinFrom: Arend van Spriel <[email protected]>
Several unused macro definitions have been removed.
--- drivers/staging/brcm80211/brcmfmac/dhd.h | 12 ------------ 1 files changed, 0 insertions(+), 12 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -12
@@ -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_ */
Signature · 1 line
1.7.1
PATCH 100/119 staging: brcm80211: further cleaned fullmac header files
In reply to Franky LinFrom: 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.
--- 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
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h +106 -3
@@ -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_ */
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +22 -0
@@ -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 {
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +1 -1
@@ -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;
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +10 -1
@@ -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);
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h deleted +0 -140
140 lines not on this page · raw message
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c +0 -2
@@ -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"
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +89 -1
102 lines not on this page · raw message
drivers/staging/brcm80211/brcmfmac/sbsdio.h +0 -96
100 lines not on this page · raw message
drivers/staging/brcm80211/brcmfmac/sdio_host.h +0 -24
@@ -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);
Signature · 1 line
1.7.1
PATCH 103/119 staging: brcm80211: remove unused macros from dhd_dbg.h
In reply to Franky LinFrom: Arend van Spriel <[email protected]>
cleanup of some unused macros.
--- drivers/staging/brcm80211/brcmfmac/dhd_dbg.h | 26 +------------------------- 1 files changed, 1 insertions(+), 25 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_dbg.h +1 -25
@@ -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_ */
Signature · 1 line
1.7.1
PATCH 111/119 staging: brcm80211: got rid of redundant member 'regs' of struct dhd_bus
In reply to Franky LinFrom: Roland Vossen <[email protected]>
Code cleanup. Decreases amd64 compiler warnings.
--- drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 12 +++++------- 1 files changed, 5 insertions(+), 7 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +5 -7
@@ -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 );
Signature · 1 line
1.7.1
PATCH 64/119 staging: brcm80211: remove BCMLXSDMMC macro definition
In reply to Franky LinFrom: Arend van Spriel <[email protected]>
The conditional code depending on BCMLXSDMMC macro definition is always compiled into the fullmac driver.
--- 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(-)
drivers/staging/brcm80211/brcmfmac/Makefile +0 -1
@@ -16,7 +16,6 @@ # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ccflags-y := \ - -DBCMLXSDMMC \ -DBCMPLATFORM_BUS \ -DBCMSDIO \ -DBRCM_FULLMAC \
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +1 -38
@@ -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 */
drivers/staging/brcm80211/brcmfmac/dhd_custom_gpio.c +0 -2
@@ -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>
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +1 -8
@@ -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__));
Signature · 1 line
1.7.1
PATCH 62/119 staging: brcm80211: remove ARP_OFFLOAD_SUPPORT macro definition
In reply to Franky LinFrom: Arend van Spriel <[email protected]>
The conditional code for ARP offloading is now always enabled in the fullmac driver.
--- drivers/staging/brcm80211/brcmfmac/Makefile | 1 - drivers/staging/brcm80211/brcmfmac/dhd_common.c | 2 -- 2 files changed, 0 insertions(+), 3 deletions(-)
drivers/staging/brcm80211/brcmfmac/Makefile +0 -1
@@ -16,7 +16,6 @@ # CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. ccflags-y := \ - -DARP_OFFLOAD_SUPPORT \ -DBCMLXSDMMC \ -DBCMPLATFORM_BUS \ -DBCMSDIO \
drivers/staging/brcm80211/brcmfmac/dhd_common.c +0 -2
@@ -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 {
Signature · 1 line
1.7.1
PATCH 117/119 staging: brcm80211: rename external function in wl_cfg80211.c
In reply to Franky LinFrom: 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.
--- .../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(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc_linux.c +1 -1
@@ -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); }
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +8 -6
@@ -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 *pktdASSERT (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; }
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +9 -9
@@ -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 ;
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +9 -10
@@ -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_ */
Signature · 1 line
1.7.1
PATCH 3/119 staging: brcm80211: remove flash related code from initvars_srom_pci()
In reply to Franky LinFrom: 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.
--- drivers/staging/brcm80211/brcmsmac/srom.c | 67 ++++++++--------------------- 1 files changed, 18 insertions(+), 49 deletions(-)
drivers/staging/brcm80211/brcmsmac/srom.c +18 -49
@@ -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)
Signature · 1 line
1.7.1
PATCH 5/119 staging: brcm80211: make use of linux error codes in srom.c
In reply to Franky LinFrom: 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.
--- drivers/staging/brcm80211/brcmsmac/srom.c | 36 +++++++++++++---------------- 1 files changed, 16 insertions(+), 20 deletions(-)
drivers/staging/brcm80211/brcmsmac/srom.c +16 -20
@@ -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; }
Signature · 1 line
1.7.1
PATCH 27/119 staging: brcm80211: run scripts/cleanfile to remove whitespace errors
In reply to Franky LinFrom: Henry Ptasinski <[email protected]>
Used scripts/cleanfile to remove assorted whitespace errors.
--- 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(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.h +1 -1
@@ -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 */
drivers/staging/brcm80211/brcmfmac/dhd.h +6 -6
@@ -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))
drivers/staging/brcm80211/brcmfmac/sdio_host.h +1 -1
@@ -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
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +2 -2
@@ -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); \ })
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +3 -3
@@ -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 */
drivers/staging/brcm80211/brcmfmac/wl_iw.h +2 -2
@@ -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="
drivers/staging/brcm80211/brcmsmac/d11.h +15 -15
@@ -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
drivers/staging/brcm80211/brcmsmac/main.c +3 -3
@@ -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
drivers/staging/brcm80211/brcmsmac/nicpci.c +5 -5
@@ -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 */
drivers/staging/brcm80211/brcmsmac/otp.c +2 -2
@@ -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)
drivers/staging/brcm80211/brcmsmac/phy/phy_hal.h +3 -3
@@ -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
drivers/staging/brcm80211/brcmsmac/phy/phy_int.h +2 -2
@@ -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) | \
drivers/staging/brcm80211/brcmsmac/phy/phy_lcn.c +9 -9
@@ -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
drivers/staging/brcm80211/brcmsmac/phy/phyreg_n.h +7 -7
@@ -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
drivers/staging/brcm80211/brcmsmac/rate.h +3 -3
@@ -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 || \
drivers/staging/brcm80211/brcmsmac/scb.h +1 -1
@@ -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 {
drivers/staging/brcm80211/brcmsmac/types.h +1 -1
@@ -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
drivers/staging/brcm80211/brcmutil/utils.c +1 -1
@@ -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 ,
drivers/staging/brcm80211/brcmutil/wifi.c +0 -1
@@ -129,4 +129,3 @@ int brcmu_mhz2channel(uint freq, uint start_factor)return ch; }EXPORT_SYMBOL (brcmu_mhz2channel); -
drivers/staging/brcm80211/include/brcmu_utils.h +1 -1
@@ -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))
drivers/staging/brcm80211/include/soc.h +1 -1
@@ -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 */
Signature · 1 line
1.7.1
PATCH 32/119 staging: brcm80211: reorg brcms_c_validboardtype for clarity
In reply to Franky LinFrom: Henry Ptasinski <[email protected]>
The structure of the function made it difficult to understand, so reorganize it to make it clearer.
--- drivers/staging/brcm80211/brcmsmac/bmac.c | 35 ++++++++++++++++------------ 1 files changed, 20 insertions(+), 15 deletions(-)
drivers/staging/brcm80211/brcmsmac/bmac.c +19 -14
@@ -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)
Signature · 1 line
1.7.1
PATCH 45/119 staging: brcm80211: remove unnecessary abstraction for scheduler
In reply to Franky LinFrom: 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.
--- 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
drivers/staging/brcm80211/brcmfmac/Makefile +0 -1
@@ -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 \
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -2
@@ -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);
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +2 -2
@@ -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 */
drivers/staging/brcm80211/brcmfmac/dhd_linux_sched.c deleted +0 -25
@@ -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; -}
Signature · 1 line
1.7.1
PATCH 48/119 staging: brcm80211: removed BDC defines
In reply to Franky LinFrom: 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.
--- 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(-)
drivers/staging/brcm80211/brcmfmac/Makefile +0 -1
@@ -20,7 +20,6 @@ ccflags-y := \ -DBCMLXSDMMC \ -DBCMPLATFORM_BUS \ -DBCMSDIO \ - -DBDC \ -DBRCM_FULLMAC \ -DDHD_FIRSTREAD=64 \ -DDHD_SCHED \
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +0 -10
@@ -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 ;
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +0 -3
@@ -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 */
drivers/staging/brcm80211/brcmfmac/dhd_proto.h +0 -13
@@ -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_ */
Signature · 1 line
1.7.1
PATCH 55/119 staging: brcm80211: rename more brcmfmac module parameters
In reply to Franky LinFrom: Arend van Spriel <[email protected]>
Renamed remaining brcmfmac module parameters to more consistent naming convention.
--- drivers/staging/brcm80211/brcmfmac/dhd_linux.c | 74 ++++++++++++------------ drivers/staging/brcm80211/brcmfmac/dhd_sdio.c | 42 +++++++------- 2 files changed, 58 insertions(+), 58 deletions(-)
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +37 -37
@@ -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 );
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +21 -21
111 lines not on this page · raw message
Signature · 1 line
1.7.1
PATCH 61/119 staging: brcm80211: further renaming in fullmac sources
In reply to Franky LinFrom: Arend van Spriel <[email protected]>
couple of items needed renaming to more consistent naming convention.
--- 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(-)
drivers/staging/brcm80211/brcmfmac/Makefile +2 -2
@@ -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 \
drivers/staging/brcm80211/brcmfmac/dhd.h +4 -4
@@ -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)
drivers/staging/brcm80211/brcmfmac/dhd_bus.h +8 -0
@@ -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) */
drivers/staging/brcm80211/brcmfmac/dhd_cdc.c +1 -9
@@ -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
drivers/staging/brcm80211/brcmfmac/dhd_common.c +6 -14
@@ -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 2048int 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 ;
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +5 -5
@@ -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); }
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +51 -59
325 lines not on this page · raw message
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +3 -6
@@ -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;
Signature · 1 line
1.7.1
PATCH 68/119 staging: brcm80211: remove MMC_SDIO_ABORT macro definition
In reply to Franky LinFrom: 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.
--- drivers/staging/brcm80211/brcmfmac/Makefile | 1 - drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c | 6 ------ 2 files changed, 0 insertions(+), 7 deletions(-)
drivers/staging/brcm80211/brcmfmac/Makefile +0 -1
@@ -21,7 +21,6 @@ ccflags-y := \ -DBRCMF_FIRSTREAD=64 \ -DBRCMF_SDALIGN=64 \ -DMAX_HDR_READ=64 \ - -DMMC_SDIO_ABORT \ -DSHOW_EVENTS \ -DTOE
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +0 -6
@@ -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 ;
Signature · 1 line
1.7.1
PATCH 80/119 staging: brcm80211: move debug console related code to dhd_sdio.c
In reply to Franky LinDebug console functionality is provided by dhd_sdio.c. So the related variables and iovars should go there as well.
--- 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(-)
drivers/staging/brcm80211/brcmfmac/dhd.h +0 -5
@@ -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;
drivers/staging/brcm80211/brcmfmac/dhd_bus.h +0 -6
@@ -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,
drivers/staging/brcm80211/brcmfmac/dhd_common.c +0 -27
@@ -53,10 +53,6 @@ enum {IOV_BCMERRORSTR ,IOV_BCMERROR ,IOV_DUMP , -#ifdef BCMDBG -IOV_CONS , -IOV_DCONSOLE_POLL , -#endifIOV_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 ;
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +0 -6
@@ -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 ;
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +30 -1
@@ -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 , #endifIOV_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;
Signature · 1 line
1.7.1
PATCH 106/119 staging: brcm80211: removed last typedefs from fullmac
In reply to Franky LinFrom: Roland Vossen <[email protected]>
Code cleanup.
--- 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(-)
drivers/staging/brcm80211/brcmfmac/bcmsdbus.h +6 -6
@@ -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 */
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +8 -6
@@ -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;
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +1 -1
@@ -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__));
drivers/staging/brcm80211/brcmfmac/dhd.h +11 -11
@@ -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
drivers/staging/brcm80211/brcmfmac/dhd_common.c +7 -5
@@ -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 :
drivers/staging/brcm80211/brcmfmac/dhd_linux.c +4 -3
@@ -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 ;
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +12 -8
@@ -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,
drivers/staging/brcm80211/brcmfmac/dngl_stats.h +2 -2
@@ -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_ */
drivers/staging/brcm80211/brcmfmac/sdio_host.h +9 -9
@@ -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) */
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.c +33 -32
167 lines not on this page · raw message
drivers/staging/brcm80211/brcmfmac/wl_cfg80211.h +4 -3
@@ -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 */
Signature · 1 line
1.7.1
PATCH 112/119 staging: brcm80211: removed last amd64 compiler warnings
In reply to Franky LinFrom: 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.
--- 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(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh.c +2 -2
@@ -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 ;
drivers/staging/brcm80211/brcmfmac/bcmsdh_linux.c +3 -3
@@ -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;
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +2 -2
@@ -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. */
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +10 -10
@@ -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;
drivers/staging/brcm80211/brcmfmac/sdio_host.h +3 -3
@@ -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); };
Signature · 1 line
1.7.1
PATCH 60/119 staging: brcm80211: replaced more sdio related typedefs by structs
In reply to Franky LinFrom: Roland Vossen <[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(-)
drivers/staging/brcm80211/brcmfmac/bcmsdh_sdmmc.c +5 -3
@@ -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
drivers/staging/brcm80211/brcmfmac/dhd_sdio.c +27 -27
187 lines not on this page · raw message
drivers/staging/brcm80211/brcmfmac/sdiovar.h +2 -2
@@ -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 */
Signature · 1 line
1.7.1