aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/staging/brcm80211/brcmsmac/wl_export.h3
-rw-r--r--drivers/staging/brcm80211/brcmsmac/wl_mac80211.c16
-rw-r--r--drivers/staging/brcm80211/brcmsmac/wl_mac80211.h17
-rw-r--r--drivers/staging/brcm80211/brcmsmac/wlc_alloc.c6
-rw-r--r--drivers/staging/brcm80211/brcmsmac/wlc_alloc.h4
-rw-r--r--drivers/staging/brcm80211/brcmsmac/wlc_ampdu.c6
-rw-r--r--drivers/staging/brcm80211/brcmsmac/wlc_ampdu.h4
-rw-r--r--drivers/staging/brcm80211/brcmsmac/wlc_bmac.c28
-rw-r--r--drivers/staging/brcm80211/brcmsmac/wlc_bmac.h42
-rw-r--r--drivers/staging/brcm80211/brcmsmac/wlc_channel.c47
-rw-r--r--drivers/staging/brcm80211/brcmsmac/wlc_channel.h29
-rw-r--r--drivers/staging/brcm80211/brcmsmac/wlc_mac80211.c3
-rw-r--r--drivers/staging/brcm80211/brcmsmac/wlc_pub.h25
-rw-r--r--drivers/staging/brcm80211/brcmsmac/wlc_stf.c3
-rw-r--r--drivers/staging/brcm80211/brcmsmac/wlc_stf.h6
15 files changed, 84 insertions, 155 deletions
diff --git a/drivers/staging/brcm80211/brcmsmac/wl_export.h b/drivers/staging/brcm80211/brcmsmac/wl_export.h
index 16c626a8458..03585745c49 100644
--- a/drivers/staging/brcm80211/brcmsmac/wl_export.h
+++ b/drivers/staging/brcm80211/brcmsmac/wl_export.h
@@ -26,9 +26,6 @@ extern uint wl_reset(struct wl_info *wl);
26extern void wl_intrson(struct wl_info *wl); 26extern void wl_intrson(struct wl_info *wl);
27extern u32 wl_intrsoff(struct wl_info *wl); 27extern u32 wl_intrsoff(struct wl_info *wl);
28extern void wl_intrsrestore(struct wl_info *wl, u32 macintmask); 28extern void wl_intrsrestore(struct wl_info *wl, u32 macintmask);
29extern void wl_event(struct wl_info *wl, char *ifname, wlc_event_t *e);
30extern void wl_event_sendup(struct wl_info *wl, const wlc_event_t *e,
31 u8 *data, u32 len);
32extern int wl_up(struct wl_info *wl); 29extern int wl_up(struct wl_info *wl);
33extern void wl_down(struct wl_info *wl); 30extern void wl_down(struct wl_info *wl);
34extern void wl_txflowcontrol(struct wl_info *wl, struct wl_if *wlif, bool state, 31extern void wl_txflowcontrol(struct wl_info *wl, struct wl_if *wlif, bool state,
diff --git a/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c b/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c
index ac9edae3a22..6e421b94727 100644
--- a/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c
+++ b/drivers/staging/brcm80211/brcmsmac/wl_mac80211.c
@@ -78,6 +78,12 @@ static int wl_start(struct sk_buff *skb, struct wl_info *wl);
78static int wl_start_int(struct wl_info *wl, struct ieee80211_hw *hw, 78static int wl_start_int(struct wl_info *wl, struct ieee80211_hw *hw,
79 struct sk_buff *skb); 79 struct sk_buff *skb);
80static void wl_dpc(unsigned long data); 80static void wl_dpc(unsigned long data);
81static irqreturn_t wl_isr(int irq, void *dev_id);
82
83static int __devinit wl_pci_probe(struct pci_dev *pdev,
84 const struct pci_device_id *ent);
85static void wl_remove(struct pci_dev *pdev);
86static void wl_free(struct wl_info *wl);
81 87
82MODULE_AUTHOR("Broadcom Corporation"); 88MODULE_AUTHOR("Broadcom Corporation");
83MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN driver."); 89MODULE_DESCRIPTION("Broadcom 802.11n wireless LAN driver.");
@@ -93,8 +99,6 @@ static struct pci_device_id wl_id_table[] = {
93}; 99};
94 100
95MODULE_DEVICE_TABLE(pci, wl_id_table); 101MODULE_DEVICE_TABLE(pci, wl_id_table);
96static void wl_remove(struct pci_dev *pdev);
97
98 102
99#ifdef BCMDBG 103#ifdef BCMDBG
100static int msglevel = 0xdeadbeef; 104static int msglevel = 0xdeadbeef;
@@ -105,6 +109,8 @@ module_param(phymsglevel, int, 0);
105 109
106#define HW_TO_WL(hw) (hw->priv) 110#define HW_TO_WL(hw) (hw->priv)
107#define WL_TO_HW(wl) (wl->pub->ieee_hw) 111#define WL_TO_HW(wl) (wl->pub->ieee_hw)
112
113/* MAC80211 callback functions */
108static int wl_ops_tx(struct ieee80211_hw *hw, struct sk_buff *skb); 114static int wl_ops_tx(struct ieee80211_hw *hw, struct sk_buff *skb);
109static int wl_ops_start(struct ieee80211_hw *hw); 115static int wl_ops_start(struct ieee80211_hw *hw);
110static void wl_ops_stop(struct ieee80211_hw *hw); 116static void wl_ops_stop(struct ieee80211_hw *hw);
@@ -1096,7 +1102,7 @@ static int ieee_hw_init(struct ieee80211_hw *hw)
1096 * 1102 *
1097 * Perimeter lock is initialized in the course of this function. 1103 * Perimeter lock is initialized in the course of this function.
1098 */ 1104 */
1099int __devinit 1105static int __devinit
1100wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 1106wl_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
1101{ 1107{
1102 int rc; 1108 int rc;
@@ -1334,7 +1340,7 @@ module_exit(wl_module_exit);
1334 * precondition: can both be called locked and unlocked 1340 * precondition: can both be called locked and unlocked
1335 * 1341 *
1336 */ 1342 */
1337void wl_free(struct wl_info *wl) 1343static void wl_free(struct wl_info *wl)
1338{ 1344{
1339 wl_timer_t *t, *next; 1345 wl_timer_t *t, *next;
1340 struct osl_info *osh; 1346 struct osl_info *osh;
@@ -1525,7 +1531,7 @@ void wl_down(struct wl_info *wl)
1525 WL_LOCK(wl); 1531 WL_LOCK(wl);
1526} 1532}
1527 1533
1528irqreturn_t BCMFASTPATH wl_isr(int irq, void *dev_id) 1534static irqreturn_t BCMFASTPATH wl_isr(int irq, void *dev_id)
1529{ 1535{
1530 struct wl_info *wl; 1536 struct wl_info *wl;
1531 bool ours, wantdpc; 1537 bool ours, wantdpc;
diff --git a/drivers/staging/brcm80211/brcmsmac/wl_mac80211.h b/drivers/staging/brcm80211/brcmsmac/wl_mac80211.h
index 070fa94d942..b7407caa4db 100644
--- a/drivers/staging/brcm80211/brcmsmac/wl_mac80211.h
+++ b/drivers/staging/brcm80211/brcmsmac/wl_mac80211.h
@@ -88,21 +88,4 @@ struct wl_info {
88#define INT_LOCK(wl, flags) spin_lock_irqsave(&(wl)->isr_lock, flags) 88#define INT_LOCK(wl, flags) spin_lock_irqsave(&(wl)->isr_lock, flags)
89#define INT_UNLOCK(wl, flags) spin_unlock_irqrestore(&(wl)->isr_lock, flags) 89#define INT_UNLOCK(wl, flags) spin_unlock_irqrestore(&(wl)->isr_lock, flags)
90 90
91#ifndef PCI_D0
92#define PCI_D0 0
93#endif
94
95#ifndef PCI_D3hot
96#define PCI_D3hot 3
97#endif
98
99/* exported functions */
100
101extern irqreturn_t wl_isr(int irq, void *dev_id);
102
103extern int __devinit wl_pci_probe(struct pci_dev *pdev,
104 const struct pci_device_id *ent);
105extern void wl_free(struct wl_info *wl);
106extern int wl_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd);
107
108#endif /* _wl_mac80211_h_ */ 91#endif /* _wl_mac80211_h_ */
diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_alloc.c b/drivers/staging/brcm80211/brcmsmac/wlc_alloc.c
index 064a3ffe5d8..a4555f74512 100644
--- a/drivers/staging/brcm80211/brcmsmac/wlc_alloc.c
+++ b/drivers/staging/brcm80211/brcmsmac/wlc_alloc.c
@@ -31,6 +31,8 @@
31#include <wlc_alloc.h> 31#include <wlc_alloc.h>
32#include <wl_dbg.h> 32#include <wl_dbg.h>
33 33
34static struct wlc_bsscfg *wlc_bsscfg_malloc(struct osl_info *osh, uint unit);
35static void wlc_bsscfg_mfree(struct osl_info *osh, struct wlc_bsscfg *cfg);
34static struct wlc_pub *wlc_pub_malloc(struct osl_info *osh, uint unit, 36static struct wlc_pub *wlc_pub_malloc(struct osl_info *osh, uint unit,
35 uint *err, uint devid); 37 uint *err, uint devid);
36static void wlc_pub_mfree(struct osl_info *osh, struct wlc_pub *pub); 38static void wlc_pub_mfree(struct osl_info *osh, struct wlc_pub *pub);
@@ -114,7 +116,7 @@ static void wlc_pub_mfree(struct osl_info *osh, struct wlc_pub *pub)
114 kfree(pub); 116 kfree(pub);
115} 117}
116 118
117wlc_bsscfg_t *wlc_bsscfg_malloc(struct osl_info *osh, uint unit) 119static wlc_bsscfg_t *wlc_bsscfg_malloc(struct osl_info *osh, uint unit)
118{ 120{
119 wlc_bsscfg_t *cfg; 121 wlc_bsscfg_t *cfg;
120 122
@@ -134,7 +136,7 @@ wlc_bsscfg_t *wlc_bsscfg_malloc(struct osl_info *osh, uint unit)
134 return NULL; 136 return NULL;
135} 137}
136 138
137void wlc_bsscfg_mfree(struct osl_info *osh, wlc_bsscfg_t *cfg) 139static void wlc_bsscfg_mfree(struct osl_info *osh, wlc_bsscfg_t *cfg)
138{ 140{
139 if (cfg == NULL) 141 if (cfg == NULL)
140 return; 142 return;
diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_alloc.h b/drivers/staging/brcm80211/brcmsmac/wlc_alloc.h
index ac34f782b40..86bfdded909 100644
--- a/drivers/staging/brcm80211/brcmsmac/wlc_alloc.h
+++ b/drivers/staging/brcm80211/brcmsmac/wlc_alloc.h
@@ -19,7 +19,3 @@ extern void *wlc_calloc(struct osl_info *osh, uint unit, uint size);
19extern struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit, 19extern struct wlc_info *wlc_attach_malloc(struct osl_info *osh, uint unit,
20 uint *err, uint devid); 20 uint *err, uint devid);
21extern void wlc_detach_mfree(struct wlc_info *wlc, struct osl_info *osh); 21extern void wlc_detach_mfree(struct wlc_info *wlc, struct osl_info *osh);
22
23struct wlc_bsscfg;
24extern struct wlc_bsscfg *wlc_bsscfg_malloc(struct osl_info *osh, uint unit);
25extern void wlc_bsscfg_mfree(struct osl_info *osh, struct wlc_bsscfg *cfg);
diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_ampdu.c b/drivers/staging/brcm80211/brcmsmac/wlc_ampdu.c
index 699890ba190..d6475af0f7e 100644
--- a/drivers/staging/brcm80211/brcmsmac/wlc_ampdu.c
+++ b/drivers/staging/brcm80211/brcmsmac/wlc_ampdu.c
@@ -154,6 +154,8 @@ static void wlc_ampdu_dotxstatus_complete(struct ampdu_info *ampdu,
154 struct scb *scb, 154 struct scb *scb,
155 struct sk_buff *p, tx_status_t *txs, 155 struct sk_buff *p, tx_status_t *txs,
156 u32 frmtxstatus, u32 frmtxstatus2); 156 u32 frmtxstatus, u32 frmtxstatus2);
157static bool wlc_ampdu_cap(struct ampdu_info *ampdu);
158static int wlc_ampdu_set(struct ampdu_info *ampdu, bool on);
157 159
158struct ampdu_info *wlc_ampdu_attach(struct wlc_info *wlc) 160struct ampdu_info *wlc_ampdu_attach(struct wlc_info *wlc)
159{ 161{
@@ -1227,7 +1229,7 @@ static scb_ampdu_tid_ini_t *wlc_ampdu_init_tid_ini(struct ampdu_info *ampdu,
1227 return ini; 1229 return ini;
1228} 1230}
1229 1231
1230int wlc_ampdu_set(struct ampdu_info *ampdu, bool on) 1232static int wlc_ampdu_set(struct ampdu_info *ampdu, bool on)
1231{ 1233{
1232 struct wlc_info *wlc = ampdu->wlc; 1234 struct wlc_info *wlc = ampdu->wlc;
1233 1235
@@ -1250,7 +1252,7 @@ int wlc_ampdu_set(struct ampdu_info *ampdu, bool on)
1250 return 0; 1252 return 0;
1251} 1253}
1252 1254
1253bool wlc_ampdu_cap(struct ampdu_info *ampdu) 1255static bool wlc_ampdu_cap(struct ampdu_info *ampdu)
1254{ 1256{
1255 if (WLC_PHY_11N_CAP(ampdu->wlc->band)) 1257 if (WLC_PHY_11N_CAP(ampdu->wlc->band))
1256 return true; 1258 return true;
diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_ampdu.h b/drivers/staging/brcm80211/brcmsmac/wlc_ampdu.h
index 03457f63f2a..33f315c2eb3 100644
--- a/drivers/staging/brcm80211/brcmsmac/wlc_ampdu.h
+++ b/drivers/staging/brcm80211/brcmsmac/wlc_ampdu.h
@@ -19,8 +19,6 @@
19 19
20extern struct ampdu_info *wlc_ampdu_attach(struct wlc_info *wlc); 20extern struct ampdu_info *wlc_ampdu_attach(struct wlc_info *wlc);
21extern void wlc_ampdu_detach(struct ampdu_info *ampdu); 21extern void wlc_ampdu_detach(struct ampdu_info *ampdu);
22extern bool wlc_ampdu_cap(struct ampdu_info *ampdu);
23extern int wlc_ampdu_set(struct ampdu_info *ampdu, bool on);
24extern int wlc_sendampdu(struct ampdu_info *ampdu, wlc_txq_info_t *qi, 22extern int wlc_sendampdu(struct ampdu_info *ampdu, wlc_txq_info_t *qi,
25 struct sk_buff **aggp, int prec); 23 struct sk_buff **aggp, int prec);
26extern void wlc_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb, 24extern void wlc_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
@@ -28,9 +26,7 @@ extern void wlc_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
28extern void wlc_ampdu_reset(struct ampdu_info *ampdu); 26extern void wlc_ampdu_reset(struct ampdu_info *ampdu);
29extern void wlc_ampdu_macaddr_upd(struct wlc_info *wlc); 27extern void wlc_ampdu_macaddr_upd(struct wlc_info *wlc);
30extern void wlc_ampdu_shm_upd(struct ampdu_info *ampdu); 28extern void wlc_ampdu_shm_upd(struct ampdu_info *ampdu);
31
32extern u8 wlc_ampdu_null_delim_cnt(struct ampdu_info *ampdu, struct scb *scb, 29extern u8 wlc_ampdu_null_delim_cnt(struct ampdu_info *ampdu, struct scb *scb,
33 ratespec_t rspec, int phylen); 30 ratespec_t rspec, int phylen);
34extern void scb_ampdu_cleanup(struct ampdu_info *ampdu, struct scb *scb);
35 31
36#endif /* _wlc_ampdu_h_ */ 32#endif /* _wlc_ampdu_h_ */
diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_bmac.c b/drivers/staging/brcm80211/brcmsmac/wlc_bmac.c
index b40ca62b689..20ce4c3777e 100644
--- a/drivers/staging/brcm80211/brcmsmac/wlc_bmac.c
+++ b/drivers/staging/brcm80211/brcmsmac/wlc_bmac.c
@@ -130,20 +130,30 @@ static void wlc_flushqueues(struct wlc_info *wlc);
130static void wlc_write_mhf(struct wlc_hw_info *wlc_hw, u16 *mhfs); 130static void wlc_write_mhf(struct wlc_hw_info *wlc_hw, u16 *mhfs);
131static void wlc_mctrl_reset(struct wlc_hw_info *wlc_hw); 131static void wlc_mctrl_reset(struct wlc_hw_info *wlc_hw);
132static void wlc_corerev_fifofixup(struct wlc_hw_info *wlc_hw); 132static void wlc_corerev_fifofixup(struct wlc_hw_info *wlc_hw);
133static bool wlc_bmac_tx_fifo_suspended(struct wlc_hw_info *wlc_hw,
134 uint tx_fifo);
135static void wlc_bmac_tx_fifo_suspend(struct wlc_hw_info *wlc_hw, uint tx_fifo);
136static void wlc_bmac_tx_fifo_resume(struct wlc_hw_info *wlc_hw, uint tx_fifo);
133 137
134/* Low Level Prototypes */ 138/* Low Level Prototypes */
139static int wlc_bmac_bandtype(struct wlc_hw_info *wlc_hw);
140static void wlc_bmac_info_init(struct wlc_hw_info *wlc_hw);
141static void wlc_bmac_xtal(struct wlc_hw_info *wlc_hw, bool want);
135static u16 wlc_bmac_read_objmem(struct wlc_hw_info *wlc_hw, uint offset, 142static u16 wlc_bmac_read_objmem(struct wlc_hw_info *wlc_hw, uint offset,
136 u32 sel); 143 u32 sel);
137static void wlc_bmac_write_objmem(struct wlc_hw_info *wlc_hw, uint offset, 144static void wlc_bmac_write_objmem(struct wlc_hw_info *wlc_hw, uint offset,
138 u16 v, u32 sel); 145 u16 v, u32 sel);
146static void wlc_bmac_core_phy_clk(struct wlc_hw_info *wlc_hw, bool clk);
139static bool wlc_bmac_attach_dmapio(struct wlc_info *wlc, uint j, bool wme); 147static bool wlc_bmac_attach_dmapio(struct wlc_info *wlc, uint j, bool wme);
140static void wlc_bmac_detach_dmapio(struct wlc_hw_info *wlc_hw); 148static void wlc_bmac_detach_dmapio(struct wlc_hw_info *wlc_hw);
141static void wlc_ucode_bsinit(struct wlc_hw_info *wlc_hw); 149static void wlc_ucode_bsinit(struct wlc_hw_info *wlc_hw);
142static bool wlc_validboardtype(struct wlc_hw_info *wlc); 150static bool wlc_validboardtype(struct wlc_hw_info *wlc);
143static bool wlc_isgoodchip(struct wlc_hw_info *wlc_hw); 151static bool wlc_isgoodchip(struct wlc_hw_info *wlc_hw);
152static bool wlc_bmac_validate_chip_access(struct wlc_hw_info *wlc_hw);
144static char *wlc_get_macaddr(struct wlc_hw_info *wlc_hw); 153static char *wlc_get_macaddr(struct wlc_hw_info *wlc_hw);
145static void wlc_mhfdef(struct wlc_info *wlc, u16 *mhfs, u16 mhf2_init); 154static void wlc_mhfdef(struct wlc_info *wlc, u16 *mhfs, u16 mhf2_init);
146static void wlc_mctrl_write(struct wlc_hw_info *wlc_hw); 155static void wlc_mctrl_write(struct wlc_hw_info *wlc_hw);
156static void wlc_bmac_mute(struct wlc_hw_info *wlc_hw, bool want, mbool flags);
147static void wlc_ucode_mute_override_set(struct wlc_hw_info *wlc_hw); 157static void wlc_ucode_mute_override_set(struct wlc_hw_info *wlc_hw);
148static void wlc_ucode_mute_override_clear(struct wlc_hw_info *wlc_hw); 158static void wlc_ucode_mute_override_clear(struct wlc_hw_info *wlc_hw);
149static u32 wlc_wlintrsoff(struct wlc_info *wlc); 159static u32 wlc_wlintrsoff(struct wlc_info *wlc);
@@ -984,7 +994,7 @@ int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, uint unit,
984 * may get overrides later in this function 994 * may get overrides later in this function
985 * BMAC_NOTES, move low out and resolve the dangling ones 995 * BMAC_NOTES, move low out and resolve the dangling ones
986 */ 996 */
987void wlc_bmac_info_init(struct wlc_hw_info *wlc_hw) 997static void wlc_bmac_info_init(struct wlc_hw_info *wlc_hw)
988{ 998{
989 struct wlc_info *wlc = wlc_hw->wlc; 999 struct wlc_info *wlc = wlc_hw->wlc;
990 1000
@@ -1276,7 +1286,7 @@ void wlc_bmac_hw_etheraddr(struct wlc_hw_info *wlc_hw, u8 *ea)
1276 memcpy(ea, wlc_hw->etheraddr, ETH_ALEN); 1286 memcpy(ea, wlc_hw->etheraddr, ETH_ALEN);
1277} 1287}
1278 1288
1279int wlc_bmac_bandtype(struct wlc_hw_info *wlc_hw) 1289static int wlc_bmac_bandtype(struct wlc_hw_info *wlc_hw)
1280{ 1290{
1281 return wlc_hw->band->bandtype; 1291 return wlc_hw->band->bandtype;
1282} 1292}
@@ -1864,7 +1874,7 @@ WLBANDINITFN(wlc_bmac_bsinit) (struct wlc_info *wlc, chanspec_t chanspec)
1864 wlc_bmac_upd_synthpu(wlc_hw); 1874 wlc_bmac_upd_synthpu(wlc_hw);
1865} 1875}
1866 1876
1867void wlc_bmac_core_phy_clk(struct wlc_hw_info *wlc_hw, bool clk) 1877static void wlc_bmac_core_phy_clk(struct wlc_hw_info *wlc_hw, bool clk)
1868{ 1878{
1869 WL_TRACE("wl%d: wlc_bmac_core_phy_clk: clk %d\n", wlc_hw->unit, clk); 1879 WL_TRACE("wl%d: wlc_bmac_core_phy_clk: clk %d\n", wlc_hw->unit, clk);
1870 1880
@@ -2863,7 +2873,7 @@ void wlc_intrsrestore(struct wlc_info *wlc, u32 macintmask)
2863 W_REG(wlc_hw->osh, &wlc_hw->regs->macintmask, wlc->macintmask); 2873 W_REG(wlc_hw->osh, &wlc_hw->regs->macintmask, wlc->macintmask);
2864} 2874}
2865 2875
2866void wlc_bmac_mute(struct wlc_hw_info *wlc_hw, bool on, mbool flags) 2876static void wlc_bmac_mute(struct wlc_hw_info *wlc_hw, bool on, mbool flags)
2867{ 2877{
2868 u8 null_ether_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0}; 2878 u8 null_ether_addr[ETH_ALEN] = {0, 0, 0, 0, 0, 0};
2869 2879
@@ -2918,7 +2928,7 @@ int wlc_bmac_xmtfifo_sz_get(struct wlc_hw_info *wlc_hw, uint fifo, uint *blocks)
2918 * be pulling data into a tx fifo, by the time the MAC acks the suspend 2928 * be pulling data into a tx fifo, by the time the MAC acks the suspend
2919 * request. 2929 * request.
2920 */ 2930 */
2921bool wlc_bmac_tx_fifo_suspended(struct wlc_hw_info *wlc_hw, uint tx_fifo) 2931static bool wlc_bmac_tx_fifo_suspended(struct wlc_hw_info *wlc_hw, uint tx_fifo)
2922{ 2932{
2923 /* check that a suspend has been requested and is no longer pending */ 2933 /* check that a suspend has been requested and is no longer pending */
2924 2934
@@ -2937,7 +2947,7 @@ bool wlc_bmac_tx_fifo_suspended(struct wlc_hw_info *wlc_hw, uint tx_fifo)
2937 return false; 2947 return false;
2938} 2948}
2939 2949
2940void wlc_bmac_tx_fifo_suspend(struct wlc_hw_info *wlc_hw, uint tx_fifo) 2950static void wlc_bmac_tx_fifo_suspend(struct wlc_hw_info *wlc_hw, uint tx_fifo)
2941{ 2951{
2942 u8 fifo = 1 << tx_fifo; 2952 u8 fifo = 1 << tx_fifo;
2943 2953
@@ -2968,7 +2978,7 @@ void wlc_bmac_tx_fifo_suspend(struct wlc_hw_info *wlc_hw, uint tx_fifo)
2968 } 2978 }
2969} 2979}
2970 2980
2971void wlc_bmac_tx_fifo_resume(struct wlc_hw_info *wlc_hw, uint tx_fifo) 2981static void wlc_bmac_tx_fifo_resume(struct wlc_hw_info *wlc_hw, uint tx_fifo)
2972{ 2982{
2973 /* BMAC_NOTE: WLC_TX_FIFO_ENAB is done in wlc_dpc() for DMA case but need to be done 2983 /* BMAC_NOTE: WLC_TX_FIFO_ENAB is done in wlc_dpc() for DMA case but need to be done
2974 * here for PIO otherwise the watchdog will catch the inconsistency and fire 2984 * here for PIO otherwise the watchdog will catch the inconsistency and fire
@@ -3380,7 +3390,7 @@ wlc_bmac_read_tsf(struct wlc_hw_info *wlc_hw, u32 *tsf_l_ptr,
3380 return; 3390 return;
3381} 3391}
3382 3392
3383bool wlc_bmac_validate_chip_access(struct wlc_hw_info *wlc_hw) 3393static bool wlc_bmac_validate_chip_access(struct wlc_hw_info *wlc_hw)
3384{ 3394{
3385 d11regs_t *regs; 3395 d11regs_t *regs;
3386 u32 w, val; 3396 u32 w, val;
@@ -3542,7 +3552,7 @@ void wlc_coredisable(struct wlc_hw_info *wlc_hw)
3542} 3552}
3543 3553
3544/* power both the pll and external oscillator on/off */ 3554/* power both the pll and external oscillator on/off */
3545void wlc_bmac_xtal(struct wlc_hw_info *wlc_hw, bool want) 3555static void wlc_bmac_xtal(struct wlc_hw_info *wlc_hw, bool want)
3546{ 3556{
3547 WL_TRACE("wl%d: wlc_bmac_xtal: want %d\n", wlc_hw->unit, want); 3557 WL_TRACE("wl%d: wlc_bmac_xtal: want %d\n", wlc_hw->unit, want);
3548 3558
diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_bmac.h b/drivers/staging/brcm80211/brcmsmac/wlc_bmac.h
index 5eabb8e0860..21c9747a53d 100644
--- a/drivers/staging/brcm80211/brcmsmac/wlc_bmac.h
+++ b/drivers/staging/brcm80211/brcmsmac/wlc_bmac.h
@@ -13,6 +13,8 @@
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN 13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */ 15 */
16#ifndef _wlc_bmac_h_
17#define _wlc_bmac_h_
16 18
17/* XXXXX this interface is under wlc.c by design 19/* XXXXX this interface is under wlc.c by design
18 * http://hwnbu-twiki.broadcom.com/bin/view/Mwgroup/WlBmacDesign 20 * http://hwnbu-twiki.broadcom.com/bin/view/Mwgroup/WlBmacDesign
@@ -77,30 +79,13 @@ enum {
77 IOV_BMAC_LAST 79 IOV_BMAC_LAST
78}; 80};
79 81
80typedef enum {
81 BMAC_DUMP_GPIO_ID,
82 BMAC_DUMP_SI_ID,
83 BMAC_DUMP_SIREG_ID,
84 BMAC_DUMP_SICLK_ID,
85 BMAC_DUMP_CCREG_ID,
86 BMAC_DUMP_PCIEREG_ID,
87 BMAC_DUMP_PHYREG_ID,
88 BMAC_DUMP_PHYTBL_ID,
89 BMAC_DUMP_PHYTBL2_ID,
90 BMAC_DUMP_PHY_RADIOREG_ID,
91 BMAC_DUMP_LAST
92} wlc_bmac_dump_id_t;
93
94extern int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device, 82extern int wlc_bmac_attach(struct wlc_info *wlc, u16 vendor, u16 device,
95 uint unit, bool piomode, struct osl_info *osh, 83 uint unit, bool piomode, struct osl_info *osh,
96 void *regsva, uint bustype, void *btparam); 84 void *regsva, uint bustype, void *btparam);
97extern int wlc_bmac_detach(struct wlc_info *wlc); 85extern int wlc_bmac_detach(struct wlc_info *wlc);
98extern void wlc_bmac_watchdog(void *arg); 86extern void wlc_bmac_watchdog(void *arg);
99extern void wlc_bmac_info_init(struct wlc_hw_info *wlc_hw);
100 87
101/* up/down, reset, clk */ 88/* up/down, reset, clk */
102extern void wlc_bmac_xtal(struct wlc_hw_info *wlc_hw, bool want);
103
104extern void wlc_bmac_copyto_objmem(struct wlc_hw_info *wlc_hw, 89extern void wlc_bmac_copyto_objmem(struct wlc_hw_info *wlc_hw,
105 uint offset, const void *buf, int len, 90 uint offset, const void *buf, int len,
106 u32 sel); 91 u32 sel);
@@ -111,7 +96,6 @@ extern void wlc_bmac_copyfrom_objmem(struct wlc_hw_info *wlc_hw, uint offset,
111#define wlc_bmac_copyto_shm(wlc_hw, offset, buf, len) \ 96#define wlc_bmac_copyto_shm(wlc_hw, offset, buf, len) \
112 wlc_bmac_copyto_objmem(wlc_hw, offset, buf, len, OBJADDR_SHM_SEL) 97 wlc_bmac_copyto_objmem(wlc_hw, offset, buf, len, OBJADDR_SHM_SEL)
113 98
114extern void wlc_bmac_core_phy_clk(struct wlc_hw_info *wlc_hw, bool clk);
115extern void wlc_bmac_core_phypll_reset(struct wlc_hw_info *wlc_hw); 99extern void wlc_bmac_core_phypll_reset(struct wlc_hw_info *wlc_hw);
116extern void wlc_bmac_core_phypll_ctl(struct wlc_hw_info *wlc_hw, bool on); 100extern void wlc_bmac_core_phypll_ctl(struct wlc_hw_info *wlc_hw, bool on);
117extern void wlc_bmac_phyclk_fgc(struct wlc_hw_info *wlc_hw, bool clk); 101extern void wlc_bmac_phyclk_fgc(struct wlc_hw_info *wlc_hw, bool clk);
@@ -125,17 +109,13 @@ extern int wlc_bmac_up_prep(struct wlc_hw_info *wlc_hw);
125extern int wlc_bmac_up_finish(struct wlc_hw_info *wlc_hw); 109extern int wlc_bmac_up_finish(struct wlc_hw_info *wlc_hw);
126extern int wlc_bmac_down_prep(struct wlc_hw_info *wlc_hw); 110extern int wlc_bmac_down_prep(struct wlc_hw_info *wlc_hw);
127extern int wlc_bmac_down_finish(struct wlc_hw_info *wlc_hw); 111extern int wlc_bmac_down_finish(struct wlc_hw_info *wlc_hw);
128extern void wlc_bmac_corereset(struct wlc_hw_info *wlc_hw, u32 flags);
129extern void wlc_bmac_switch_macfreq(struct wlc_hw_info *wlc_hw, u8 spurmode); 112extern void wlc_bmac_switch_macfreq(struct wlc_hw_info *wlc_hw, u8 spurmode);
130 113
131/* chanspec, ucode interface */ 114/* chanspec, ucode interface */
132extern int wlc_bmac_bandtype(struct wlc_hw_info *wlc_hw);
133extern void wlc_bmac_set_chanspec(struct wlc_hw_info *wlc_hw, 115extern void wlc_bmac_set_chanspec(struct wlc_hw_info *wlc_hw,
134 chanspec_t chanspec, 116 chanspec_t chanspec,
135 bool mute, struct txpwr_limits *txpwr); 117 bool mute, struct txpwr_limits *txpwr);
136 118
137extern void wlc_bmac_txfifo(struct wlc_hw_info *wlc_hw, uint fifo, void *p,
138 bool commit, u16 frameid, u8 txpktpend);
139extern int wlc_bmac_xmtfifo_sz_get(struct wlc_hw_info *wlc_hw, uint fifo, 119extern int wlc_bmac_xmtfifo_sz_get(struct wlc_hw_info *wlc_hw, uint fifo,
140 uint *blocks); 120 uint *blocks);
141extern void wlc_bmac_mhf(struct wlc_hw_info *wlc_hw, u8 idx, u16 mask, 121extern void wlc_bmac_mhf(struct wlc_hw_info *wlc_hw, u8 idx, u16 mask,
@@ -157,22 +137,14 @@ extern void wlc_bmac_write_template_ram(struct wlc_hw_info *wlc_hw, int offset,
157extern void wlc_bmac_copyfrom_vars(struct wlc_hw_info *wlc_hw, char **buf, 137extern void wlc_bmac_copyfrom_vars(struct wlc_hw_info *wlc_hw, char **buf,
158 uint *len); 138 uint *len);
159 139
160extern void wlc_bmac_process_ps_switch(struct wlc_hw_info *wlc,
161 struct ether_addr *ea, s8 ps_on);
162extern void wlc_bmac_hw_etheraddr(struct wlc_hw_info *wlc_hw, 140extern void wlc_bmac_hw_etheraddr(struct wlc_hw_info *wlc_hw,
163 u8 *ea); 141 u8 *ea);
164extern bool wlc_bmac_validate_chip_access(struct wlc_hw_info *wlc_hw);
165 142
166extern bool wlc_bmac_radio_read_hwdisabled(struct wlc_hw_info *wlc_hw); 143extern bool wlc_bmac_radio_read_hwdisabled(struct wlc_hw_info *wlc_hw);
167extern void wlc_bmac_set_shortslot(struct wlc_hw_info *wlc_hw, bool shortslot); 144extern void wlc_bmac_set_shortslot(struct wlc_hw_info *wlc_hw, bool shortslot);
168extern void wlc_bmac_mute(struct wlc_hw_info *wlc_hw, bool want, mbool flags);
169extern void wlc_bmac_band_stf_ss_set(struct wlc_hw_info *wlc_hw, u8 stf_mode); 145extern void wlc_bmac_band_stf_ss_set(struct wlc_hw_info *wlc_hw, u8 stf_mode);
170 146
171extern void wlc_bmac_wait_for_wake(struct wlc_hw_info *wlc_hw); 147extern void wlc_bmac_wait_for_wake(struct wlc_hw_info *wlc_hw);
172extern bool wlc_bmac_tx_fifo_suspended(struct wlc_hw_info *wlc_hw,
173 uint tx_fifo);
174extern void wlc_bmac_tx_fifo_suspend(struct wlc_hw_info *wlc_hw, uint tx_fifo);
175extern void wlc_bmac_tx_fifo_resume(struct wlc_hw_info *wlc_hw, uint tx_fifo);
176 148
177extern void wlc_ucode_wake_override_set(struct wlc_hw_info *wlc_hw, 149extern void wlc_ucode_wake_override_set(struct wlc_hw_info *wlc_hw,
178 u32 override_bit); 150 u32 override_bit);
@@ -206,13 +178,7 @@ extern void wlc_bmac_pllreq(struct wlc_hw_info *wlc_hw, bool set,
206 mbool req_bit); 178 mbool req_bit);
207extern bool wlc_bmac_taclear(struct wlc_hw_info *wlc_hw, bool ta_ok); 179extern bool wlc_bmac_taclear(struct wlc_hw_info *wlc_hw, bool ta_ok);
208extern void wlc_bmac_hw_up(struct wlc_hw_info *wlc_hw); 180extern void wlc_bmac_hw_up(struct wlc_hw_info *wlc_hw);
209
210extern void wlc_bmac_dump(struct wlc_hw_info *wlc_hw, struct bcmstrbuf *b,
211 wlc_bmac_dump_id_t dump_id);
212
213extern u16 wlc_bmac_rate_shm_offset(struct wlc_hw_info *wlc_hw, u8 rate); 181extern u16 wlc_bmac_rate_shm_offset(struct wlc_hw_info *wlc_hw, u8 rate);
214
215extern void wlc_bmac_assert_type_set(struct wlc_hw_info *wlc_hw, u32 type);
216extern void wlc_bmac_blink_sync(struct wlc_hw_info *wlc_hw, u32 led_pins);
217
218extern void wlc_bmac_antsel_set(struct wlc_hw_info *wlc_hw, u32 antsel_avail); 182extern void wlc_bmac_antsel_set(struct wlc_hw_info *wlc_hw, u32 antsel_avail);
183
184#endif /* _wlc_bmac_h_ */
diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_channel.c b/drivers/staging/brcm80211/brcmsmac/wlc_channel.c
index ea23728a772..d53a9587589 100644
--- a/drivers/staging/brcm80211/brcmsmac/wlc_channel.c
+++ b/drivers/staging/brcm80211/brcmsmac/wlc_channel.c
@@ -34,6 +34,11 @@
34#include <wlc_channel.h> 34#include <wlc_channel.h>
35#include <wl_dbg.h> 35#include <wl_dbg.h>
36 36
37#define VALID_CHANNEL20_DB(wlc, val) wlc_valid_channel20_db((wlc)->cmi, val)
38#define VALID_CHANNEL20_IN_BAND(wlc, bandunit, val) \
39 wlc_valid_channel20_in_band((wlc)->cmi, bandunit, val)
40#define VALID_CHANNEL20(wlc, val) wlc_valid_channel20((wlc)->cmi, val)
41
37typedef struct wlc_cm_band { 42typedef struct wlc_cm_band {
38 u8 locale_flags; /* locale_info_t flags */ 43 u8 locale_flags; /* locale_info_t flags */
39 chanvec_t valid_channels; /* List of valid channels in the country */ 44 chanvec_t valid_channels; /* List of valid channels in the country */
@@ -62,6 +67,10 @@ static void wlc_set_country_common(wlc_cm_info_t *wlc_cm,
62 const char *country_abbrev, 67 const char *country_abbrev,
63 const char *ccode, uint regrev, 68 const char *ccode, uint regrev,
64 const country_info_t *country); 69 const country_info_t *country);
70static int wlc_set_countrycode(wlc_cm_info_t *wlc_cm, const char *ccode);
71static int wlc_set_countrycode_rev(wlc_cm_info_t *wlc_cm,
72 const char *country_abbrev,
73 const char *ccode, int regrev);
65static int wlc_country_aggregate_map(wlc_cm_info_t *wlc_cm, const char *ccode, 74static int wlc_country_aggregate_map(wlc_cm_info_t *wlc_cm, const char *ccode,
66 char *mapped_ccode, uint *mapped_regrev); 75 char *mapped_ccode, uint *mapped_regrev);
67static const country_info_t *wlc_country_lookup_direct(const char *ccode, 76static const country_info_t *wlc_country_lookup_direct(const char *ccode,
@@ -71,6 +80,19 @@ static const country_info_t *wlc_countrycode_map(wlc_cm_info_t *wlc_cm,
71 char *mapped_ccode, 80 char *mapped_ccode,
72 uint *mapped_regrev); 81 uint *mapped_regrev);
73static void wlc_channels_commit(wlc_cm_info_t *wlc_cm); 82static void wlc_channels_commit(wlc_cm_info_t *wlc_cm);
83static void wlc_quiet_channels_reset(wlc_cm_info_t *wlc_cm);
84static bool wlc_quiet_chanspec(wlc_cm_info_t *wlc_cm, chanspec_t chspec);
85static bool wlc_valid_channel20_db(wlc_cm_info_t *wlc_cm, uint val);
86static bool wlc_valid_channel20_in_band(wlc_cm_info_t *wlc_cm, uint bandunit,
87 uint val);
88static bool wlc_valid_channel20(wlc_cm_info_t *wlc_cm, uint val);
89static const country_info_t *wlc_country_lookup(struct wlc_info *wlc,
90 const char *ccode);
91static void wlc_locale_get_channels(const locale_info_t *locale,
92 chanvec_t *valid_channels);
93static const locale_info_t *wlc_get_locale_2g(u8 locale_idx);
94static const locale_info_t *wlc_get_locale_5g(u8 locale_idx);
95static bool wlc_japan(struct wlc_info *wlc);
74static bool wlc_japan_ccode(const char *ccode); 96static bool wlc_japan_ccode(const char *ccode);
75static void wlc_channel_min_txpower_limits_with_local_constraint(wlc_cm_info_t * 97static void wlc_channel_min_txpower_limits_with_local_constraint(wlc_cm_info_t *
76 wlc_cm, 98 wlc_cm,
@@ -377,7 +399,8 @@ void wlc_locale_add_channels(chanvec_t *target, const chanvec_t *channels)
377 } 399 }
378} 400}
379 401
380void wlc_locale_get_channels(const locale_info_t *locale, chanvec_t *channels) 402static void wlc_locale_get_channels(const locale_info_t *locale,
403 chanvec_t *channels)
381{ 404{
382 u8 i; 405 u8 i;
383 406
@@ -563,7 +586,7 @@ struct chan20_info chan20_info[] = {
563}; 586};
564#endif /* SUPPORT_40MHZ */ 587#endif /* SUPPORT_40MHZ */
565 588
566const locale_info_t *wlc_get_locale_2g(u8 locale_idx) 589static const locale_info_t *wlc_get_locale_2g(u8 locale_idx)
567{ 590{
568 if (locale_idx >= ARRAY_SIZE(g_locale_2g_table)) { 591 if (locale_idx >= ARRAY_SIZE(g_locale_2g_table)) {
569 WL_ERROR("%s: locale 2g index size out of range %d\n", 592 WL_ERROR("%s: locale 2g index size out of range %d\n",
@@ -574,7 +597,7 @@ const locale_info_t *wlc_get_locale_2g(u8 locale_idx)
574 return g_locale_2g_table[locale_idx]; 597 return g_locale_2g_table[locale_idx];
575} 598}
576 599
577const locale_info_t *wlc_get_locale_5g(u8 locale_idx) 600static const locale_info_t *wlc_get_locale_5g(u8 locale_idx)
578{ 601{
579 if (locale_idx >= ARRAY_SIZE(g_locale_5g_table)) { 602 if (locale_idx >= ARRAY_SIZE(g_locale_5g_table)) {
580 WL_ERROR("%s: locale 5g index size out of range %d\n", 603 WL_ERROR("%s: locale 5g index size out of range %d\n",
@@ -665,14 +688,14 @@ u8 wlc_channel_locale_flags_in_band(wlc_cm_info_t *wlc_cm, uint bandunit)
665/* set the driver's current country and regulatory information using a country code 688/* set the driver's current country and regulatory information using a country code
666 * as the source. Lookup built in country information found with the country code. 689 * as the source. Lookup built in country information found with the country code.
667 */ 690 */
668int wlc_set_countrycode(wlc_cm_info_t *wlc_cm, const char *ccode) 691static int wlc_set_countrycode(wlc_cm_info_t *wlc_cm, const char *ccode)
669{ 692{
670 char country_abbrev[WLC_CNTRY_BUF_SZ]; 693 char country_abbrev[WLC_CNTRY_BUF_SZ];
671 strncpy(country_abbrev, ccode, WLC_CNTRY_BUF_SZ); 694 strncpy(country_abbrev, ccode, WLC_CNTRY_BUF_SZ);
672 return wlc_set_countrycode_rev(wlc_cm, country_abbrev, ccode, -1); 695 return wlc_set_countrycode_rev(wlc_cm, country_abbrev, ccode, -1);
673} 696}
674 697
675int 698static int
676wlc_set_countrycode_rev(wlc_cm_info_t *wlc_cm, 699wlc_set_countrycode_rev(wlc_cm_info_t *wlc_cm,
677 const char *country_abbrev, 700 const char *country_abbrev,
678 const char *ccode, int regrev) 701 const char *ccode, int regrev)
@@ -767,7 +790,7 @@ wlc_set_country_common(wlc_cm_info_t *wlc_cm,
767/* Lookup a country info structure from a null terminated country code 790/* Lookup a country info structure from a null terminated country code
768 * The lookup is case sensitive. 791 * The lookup is case sensitive.
769 */ 792 */
770const country_info_t *wlc_country_lookup(struct wlc_info *wlc, 793static const country_info_t *wlc_country_lookup(struct wlc_info *wlc,
771 const char *ccode) 794 const char *ccode)
772{ 795{
773 const country_info_t *country; 796 const country_info_t *country;
@@ -970,7 +993,7 @@ static void wlc_channels_commit(wlc_cm_info_t *wlc_cm)
970} 993}
971 994
972/* reset the quiet channels vector to the union of the restricted and radar channel sets */ 995/* reset the quiet channels vector to the union of the restricted and radar channel sets */
973void wlc_quiet_channels_reset(wlc_cm_info_t *wlc_cm) 996static void wlc_quiet_channels_reset(wlc_cm_info_t *wlc_cm)
974{ 997{
975 struct wlc_info *wlc = wlc_cm->wlc; 998 struct wlc_info *wlc = wlc_cm->wlc;
976 uint i, j; 999 uint i, j;
@@ -991,7 +1014,7 @@ void wlc_quiet_channels_reset(wlc_cm_info_t *wlc_cm)
991 } 1014 }
992} 1015}
993 1016
994bool wlc_quiet_chanspec(wlc_cm_info_t *wlc_cm, chanspec_t chspec) 1017static bool wlc_quiet_chanspec(wlc_cm_info_t *wlc_cm, chanspec_t chspec)
995{ 1018{
996 return N_ENAB(wlc_cm->wlc->pub) && CHSPEC_IS40(chspec) ? 1019 return N_ENAB(wlc_cm->wlc->pub) && CHSPEC_IS40(chspec) ?
997 (isset 1020 (isset
@@ -1008,7 +1031,7 @@ bool wlc_quiet_chanspec(wlc_cm_info_t *wlc_cm, chanspec_t chspec)
1008/* Is the channel valid for the current locale? (but don't consider channels not 1031/* Is the channel valid for the current locale? (but don't consider channels not
1009 * available due to bandlocking) 1032 * available due to bandlocking)
1010 */ 1033 */
1011bool wlc_valid_channel20_db(wlc_cm_info_t *wlc_cm, uint val) 1034static bool wlc_valid_channel20_db(wlc_cm_info_t *wlc_cm, uint val)
1012{ 1035{
1013 struct wlc_info *wlc = wlc_cm->wlc; 1036 struct wlc_info *wlc = wlc_cm->wlc;
1014 1037
@@ -1018,7 +1041,7 @@ bool wlc_valid_channel20_db(wlc_cm_info_t *wlc_cm, uint val)
1018} 1041}
1019 1042
1020/* Is the channel valid for the current locale and specified band? */ 1043/* Is the channel valid for the current locale and specified band? */
1021bool 1044static bool
1022wlc_valid_channel20_in_band(wlc_cm_info_t *wlc_cm, uint bandunit, uint val) 1045wlc_valid_channel20_in_band(wlc_cm_info_t *wlc_cm, uint bandunit, uint val)
1023{ 1046{
1024 return ((val < MAXCHANNEL) 1047 return ((val < MAXCHANNEL)
@@ -1026,7 +1049,7 @@ wlc_valid_channel20_in_band(wlc_cm_info_t *wlc_cm, uint bandunit, uint val)
1026} 1049}
1027 1050
1028/* Is the channel valid for the current locale and current band? */ 1051/* Is the channel valid for the current locale and current band? */
1029bool wlc_valid_channel20(wlc_cm_info_t *wlc_cm, uint val) 1052static bool wlc_valid_channel20(wlc_cm_info_t *wlc_cm, uint val)
1030{ 1053{
1031 struct wlc_info *wlc = wlc_cm->wlc; 1054 struct wlc_info *wlc = wlc_cm->wlc;
1032 1055
@@ -1470,7 +1493,7 @@ wlc_channel_reg_limits(wlc_cm_info_t *wlc_cm, chanspec_t chanspec,
1470} 1493}
1471 1494
1472/* Returns true if currently set country is Japan or variant */ 1495/* Returns true if currently set country is Japan or variant */
1473bool wlc_japan(struct wlc_info *wlc) 1496static bool wlc_japan(struct wlc_info *wlc)
1474{ 1497{
1475 return wlc_japan_ccode(wlc->cmi->country_abbrev); 1498 return wlc_japan_ccode(wlc->cmi->country_abbrev);
1476} 1499}
diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_channel.h b/drivers/staging/brcm80211/brcmsmac/wlc_channel.h
index d569ec45267..9b3bf11d445 100644
--- a/drivers/staging/brcm80211/brcmsmac/wlc_channel.h
+++ b/drivers/staging/brcm80211/brcmsmac/wlc_channel.h
@@ -107,27 +107,10 @@ typedef struct wlc_cm_info wlc_cm_info_t;
107extern wlc_cm_info_t *wlc_channel_mgr_attach(struct wlc_info *wlc); 107extern wlc_cm_info_t *wlc_channel_mgr_attach(struct wlc_info *wlc);
108extern void wlc_channel_mgr_detach(wlc_cm_info_t *wlc_cm); 108extern void wlc_channel_mgr_detach(wlc_cm_info_t *wlc_cm);
109 109
110extern int wlc_set_countrycode(wlc_cm_info_t *wlc_cm, const char *ccode);
111extern int wlc_set_countrycode_rev(wlc_cm_info_t *wlc_cm,
112 const char *country_abbrev,
113 const char *ccode, int regrev);
114
115extern u8 wlc_channel_locale_flags_in_band(wlc_cm_info_t *wlc_cm, 110extern u8 wlc_channel_locale_flags_in_band(wlc_cm_info_t *wlc_cm,
116 uint bandunit); 111 uint bandunit);
117
118extern void wlc_quiet_channels_reset(wlc_cm_info_t *wlc_cm);
119extern bool wlc_quiet_chanspec(wlc_cm_info_t *wlc_cm, chanspec_t chspec);
120
121#define VALID_CHANNEL20_DB(wlc, val) wlc_valid_channel20_db((wlc)->cmi, val)
122#define VALID_CHANNEL20_IN_BAND(wlc, bandunit, val) \
123 wlc_valid_channel20_in_band((wlc)->cmi, bandunit, val)
124#define VALID_CHANNEL20(wlc, val) wlc_valid_channel20((wlc)->cmi, val)
125 112
126extern bool wlc_valid_chanspec_db(wlc_cm_info_t *wlc_cm, chanspec_t chspec); 113extern bool wlc_valid_chanspec_db(wlc_cm_info_t *wlc_cm, chanspec_t chspec);
127extern bool wlc_valid_channel20_db(wlc_cm_info_t *wlc_cm, uint val);
128extern bool wlc_valid_channel20_in_band(wlc_cm_info_t *wlc_cm, uint bandunit,
129 uint val);
130extern bool wlc_valid_channel20(wlc_cm_info_t *wlc_cm, uint val);
131 114
132extern void wlc_channel_reg_limits(wlc_cm_info_t *wlc_cm, 115extern void wlc_channel_reg_limits(wlc_cm_info_t *wlc_cm,
133 chanspec_t chanspec, 116 chanspec_t chanspec,
@@ -136,14 +119,4 @@ extern void wlc_channel_set_chanspec(wlc_cm_info_t *wlc_cm,
136 chanspec_t chanspec, 119 chanspec_t chanspec,
137 u8 local_constraint_qdbm); 120 u8 local_constraint_qdbm);
138 121
139extern const country_info_t *wlc_country_lookup(struct wlc_info *wlc,
140 const char *ccode);
141extern void wlc_locale_get_channels(const locale_info_t *locale,
142 chanvec_t *valid_channels);
143extern const locale_info_t *wlc_get_locale_2g(u8 locale_idx);
144extern const locale_info_t *wlc_get_locale_5g(u8 locale_idx);
145extern bool wlc_japan(struct wlc_info *wlc);
146
147extern u8 wlc_get_regclass(wlc_cm_info_t *wlc_cm, chanspec_t chanspec);
148
149#endif /* _WLC_CHANNEL_H */ 122#endif /* _WLC_CHANNEL_H */
diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_mac80211.c b/drivers/staging/brcm80211/brcmsmac/wlc_mac80211.c
index 26d40aa818a..77cd2c9f1dd 100644
--- a/drivers/staging/brcm80211/brcmsmac/wlc_mac80211.c
+++ b/drivers/staging/brcm80211/brcmsmac/wlc_mac80211.c
@@ -253,6 +253,7 @@ static ratespec_t mac80211_wlc_set_nrate(struct wlc_info *wlc,
253static void wlc_tx_prec_map_init(struct wlc_info *wlc); 253static void wlc_tx_prec_map_init(struct wlc_info *wlc);
254static void wlc_watchdog(void *arg); 254static void wlc_watchdog(void *arg);
255static void wlc_watchdog_by_timer(void *arg); 255static void wlc_watchdog_by_timer(void *arg);
256static u16 wlc_rate_shm_offset(struct wlc_info *wlc, u8 rate);
256static int wlc_set_rateset(struct wlc_info *wlc, wlc_rateset_t *rs_arg); 257static int wlc_set_rateset(struct wlc_info *wlc, wlc_rateset_t *rs_arg);
257static int wlc_iovar_rangecheck(struct wlc_info *wlc, u32 val, 258static int wlc_iovar_rangecheck(struct wlc_info *wlc, u32 val,
258 const bcm_iovar_t *vi); 259 const bcm_iovar_t *vi);
@@ -5051,7 +5052,7 @@ int wlc_format_ssid(char *buf, const unsigned char ssid[], uint ssid_len)
5051} 5052}
5052#endif /* defined(BCMDBG) */ 5053#endif /* defined(BCMDBG) */
5053 5054
5054u16 wlc_rate_shm_offset(struct wlc_info *wlc, u8 rate) 5055static u16 wlc_rate_shm_offset(struct wlc_info *wlc, u8 rate)
5055{ 5056{
5056 return wlc_bmac_rate_shm_offset(wlc->hw, rate); 5057 return wlc_bmac_rate_shm_offset(wlc->hw, rate);
5057} 5058}
diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_pub.h b/drivers/staging/brcm80211/brcmsmac/wlc_pub.h
index ded018adda6..d4d3cd21f80 100644
--- a/drivers/staging/brcm80211/brcmsmac/wlc_pub.h
+++ b/drivers/staging/brcm80211/brcmsmac/wlc_pub.h
@@ -150,18 +150,6 @@ struct rsn_parms {
150 IEEE80211_HT_CAP_SUP_WIDTH_20_40 | IEEE80211_HT_CAP_GRN_FLD |\ 150 IEEE80211_HT_CAP_SUP_WIDTH_20_40 | IEEE80211_HT_CAP_GRN_FLD |\
151 HT_CAP_MAX_AMSDU | IEEE80211_HT_CAP_DSSSCCK40) 151 HT_CAP_MAX_AMSDU | IEEE80211_HT_CAP_DSSSCCK40)
152 152
153/* Event data type */
154typedef struct wlc_event {
155 wl_event_msg_t event; /* encapsulated event */
156 struct ether_addr *addr; /* used to keep a trace of the potential present of
157 * an address in wlc_event_msg_t
158 */
159 int bsscfgidx; /* BSS config when needed */
160 struct wl_if *wlif; /* pointer to wlif */
161 void *data; /* used to hang additional data on an event */
162 struct wlc_event *next; /* enables ordered list of pending events */
163} wlc_event_t;
164
165/* wlc internal bss_info, wl external one is in wlioctl.h */ 153/* wlc internal bss_info, wl external one is in wlioctl.h */
166typedef struct wlc_bss_info { 154typedef struct wlc_bss_info {
167 u8 BSSID[ETH_ALEN]; /* network BSSID */ 155 u8 BSSID[ETH_ALEN]; /* network BSSID */
@@ -570,13 +558,8 @@ extern int wlc_module_register(struct wlc_pub *pub, const bcm_iovar_t *iovars,
570 watchdog_fn_t watchdog_fn, down_fn_t down_fn); 558 watchdog_fn_t watchdog_fn, down_fn_t down_fn);
571extern int wlc_module_unregister(struct wlc_pub *pub, const char *name, 559extern int wlc_module_unregister(struct wlc_pub *pub, const char *name,
572 void *hdl); 560 void *hdl);
573extern void wlc_event_if(struct wlc_info *wlc, struct wlc_bsscfg *cfg,
574 wlc_event_t *e, const struct ether_addr *addr);
575extern void wlc_suspend_mac_and_wait(struct wlc_info *wlc); 561extern void wlc_suspend_mac_and_wait(struct wlc_info *wlc);
576extern void wlc_enable_mac(struct wlc_info *wlc); 562extern void wlc_enable_mac(struct wlc_info *wlc);
577extern u16 wlc_rate_shm_offset(struct wlc_info *wlc, u8 rate);
578extern u32 wlc_get_rspec_history(struct wlc_bsscfg *cfg);
579extern u32 wlc_get_current_highest_rate(struct wlc_bsscfg *cfg);
580extern void wlc_associate_upd(struct wlc_info *wlc, bool state); 563extern void wlc_associate_upd(struct wlc_info *wlc, bool state);
581extern void wlc_scan_start(struct wlc_info *wlc); 564extern void wlc_scan_start(struct wlc_info *wlc);
582extern void wlc_scan_stop(struct wlc_info *wlc); 565extern void wlc_scan_stop(struct wlc_info *wlc);
@@ -607,11 +590,6 @@ extern int wlc_iocpichk(struct wlc_info *wlc, uint phytype);
607#endif 590#endif
608 591
609/* helper functions */ 592/* helper functions */
610extern void wlc_getrand(struct wlc_info *wlc, u8 *buf, int len);
611
612struct scb;
613extern void wlc_ps_on(struct wlc_info *wlc, struct scb *scb);
614extern void wlc_ps_off(struct wlc_info *wlc, struct scb *scb, bool discard);
615extern bool wlc_check_radio_disabled(struct wlc_info *wlc); 593extern bool wlc_check_radio_disabled(struct wlc_info *wlc);
616extern bool wlc_radio_monitor_stop(struct wlc_info *wlc); 594extern bool wlc_radio_monitor_stop(struct wlc_info *wlc);
617 595
@@ -619,9 +597,6 @@ extern bool wlc_radio_monitor_stop(struct wlc_info *wlc);
619extern int wlc_format_ssid(char *buf, const unsigned char ssid[], uint ssid_len); 597extern int wlc_format_ssid(char *buf, const unsigned char ssid[], uint ssid_len);
620#endif 598#endif
621 599
622extern void wlc_pmkid_build_cand_list(struct wlc_bsscfg *cfg, bool check_SSID);
623extern void wlc_pmkid_event(struct wlc_bsscfg *cfg);
624
625#define MAXBANDS 2 /* Maximum #of bands */ 600#define MAXBANDS 2 /* Maximum #of bands */
626/* bandstate array indices */ 601/* bandstate array indices */
627#define BAND_2G_INDEX 0 /* wlc->bandstate[x] index */ 602#define BAND_2G_INDEX 0 /* wlc->bandstate[x] index */
diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_stf.c b/drivers/staging/brcm80211/brcmsmac/wlc_stf.c
index d5b0f780ef2..46556ead78c 100644
--- a/drivers/staging/brcm80211/brcmsmac/wlc_stf.c
+++ b/drivers/staging/brcm80211/brcmsmac/wlc_stf.c
@@ -39,6 +39,9 @@
39#include <wlc_stf.h> 39#include <wlc_stf.h>
40#include <wl_dbg.h> 40#include <wl_dbg.h>
41 41
42#define MIN_SPATIAL_EXPANSION 0
43#define MAX_SPATIAL_EXPANSION 1
44
42#define WLC_STF_SS_STBC_RX(wlc) (WLCISNPHY(wlc->band) && \ 45#define WLC_STF_SS_STBC_RX(wlc) (WLCISNPHY(wlc->band) && \
43 NREV_GT(wlc->band->phyrev, 3) && NREV_LE(wlc->band->phyrev, 6)) 46 NREV_GT(wlc->band->phyrev, 3) && NREV_LE(wlc->band->phyrev, 6))
44 47
diff --git a/drivers/staging/brcm80211/brcmsmac/wlc_stf.h b/drivers/staging/brcm80211/brcmsmac/wlc_stf.h
index e127862c444..2b1180b128a 100644
--- a/drivers/staging/brcm80211/brcmsmac/wlc_stf.h
+++ b/drivers/staging/brcm80211/brcmsmac/wlc_stf.h
@@ -17,9 +17,6 @@
17#ifndef _wlc_stf_h_ 17#ifndef _wlc_stf_h_
18#define _wlc_stf_h_ 18#define _wlc_stf_h_
19 19
20#define MIN_SPATIAL_EXPANSION 0
21#define MAX_SPATIAL_EXPANSION 1
22
23extern int wlc_stf_attach(struct wlc_info *wlc); 20extern int wlc_stf_attach(struct wlc_info *wlc);
24extern void wlc_stf_detach(struct wlc_info *wlc); 21extern void wlc_stf_detach(struct wlc_info *wlc);
25 22
@@ -37,6 +34,5 @@ extern void wlc_stf_phy_txant_upd(struct wlc_info *wlc);
37extern void wlc_stf_phy_chain_calc(struct wlc_info *wlc); 34extern void wlc_stf_phy_chain_calc(struct wlc_info *wlc);
38extern u16 wlc_stf_phytxchain_sel(struct wlc_info *wlc, ratespec_t rspec); 35extern u16 wlc_stf_phytxchain_sel(struct wlc_info *wlc, ratespec_t rspec);
39extern u16 wlc_stf_d11hdrs_phyctl_txant(struct wlc_info *wlc, ratespec_t rspec); 36extern u16 wlc_stf_d11hdrs_phyctl_txant(struct wlc_info *wlc, ratespec_t rspec);
40extern u16 wlc_stf_spatial_expansion_get(struct wlc_info *wlc, 37
41 ratespec_t rspec);
42#endif /* _wlc_stf_h_ */ 38#endif /* _wlc_stf_h_ */