aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/brcm80211/brcmsmac
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmsmac')
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/aiutils.h18
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/ampdu.h22
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/antsel.h14
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/channel.h20
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h38
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/main.c8
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/main.h110
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/phy/phy_hal.h219
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h371
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/phy_shim.h91
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/pmu.h4
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/pub.h145
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/rate.h48
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/stf.h31
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/ucode_loader.h16
15 files changed, 539 insertions, 616 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
index a8a267b5b87a..2d08c155c23b 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
+++ b/drivers/net/wireless/brcm80211/brcmsmac/aiutils.h
@@ -172,19 +172,19 @@ struct si_info {
172 172
173 173
174/* AMBA Interconnect exported externs */ 174/* AMBA Interconnect exported externs */
175extern u32 ai_core_cflags(struct bcma_device *core, u32 mask, u32 val); 175u32 ai_core_cflags(struct bcma_device *core, u32 mask, u32 val);
176 176
177/* === exported functions === */ 177/* === exported functions === */
178extern struct si_pub *ai_attach(struct bcma_bus *pbus); 178struct si_pub *ai_attach(struct bcma_bus *pbus);
179extern void ai_detach(struct si_pub *sih); 179void ai_detach(struct si_pub *sih);
180extern uint ai_cc_reg(struct si_pub *sih, uint regoff, u32 mask, u32 val); 180uint ai_cc_reg(struct si_pub *sih, uint regoff, u32 mask, u32 val);
181extern void ai_clkctl_init(struct si_pub *sih); 181void ai_clkctl_init(struct si_pub *sih);
182extern u16 ai_clkctl_fast_pwrup_delay(struct si_pub *sih); 182u16 ai_clkctl_fast_pwrup_delay(struct si_pub *sih);
183extern bool ai_clkctl_cc(struct si_pub *sih, enum bcma_clkmode mode); 183bool ai_clkctl_cc(struct si_pub *sih, enum bcma_clkmode mode);
184extern bool ai_deviceremoved(struct si_pub *sih); 184bool ai_deviceremoved(struct si_pub *sih);
185 185
186/* Enable Ex-PA for 4313 */ 186/* Enable Ex-PA for 4313 */
187extern void ai_epa_4313war(struct si_pub *sih); 187void ai_epa_4313war(struct si_pub *sih);
188 188
189static inline u32 ai_get_cccaps(struct si_pub *sih) 189static inline u32 ai_get_cccaps(struct si_pub *sih)
190{ 190{
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/ampdu.h b/drivers/net/wireless/brcm80211/brcmsmac/ampdu.h
index 73d01e586109..03bdcf29bd50 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/ampdu.h
+++ b/drivers/net/wireless/brcm80211/brcmsmac/ampdu.h
@@ -37,17 +37,17 @@ struct brcms_ampdu_session {
37 u16 dma_len; 37 u16 dma_len;
38}; 38};
39 39
40extern void brcms_c_ampdu_reset_session(struct brcms_ampdu_session *session, 40void brcms_c_ampdu_reset_session(struct brcms_ampdu_session *session,
41 struct brcms_c_info *wlc); 41 struct brcms_c_info *wlc);
42extern int brcms_c_ampdu_add_frame(struct brcms_ampdu_session *session, 42int brcms_c_ampdu_add_frame(struct brcms_ampdu_session *session,
43 struct sk_buff *p); 43 struct sk_buff *p);
44extern void brcms_c_ampdu_finalize(struct brcms_ampdu_session *session); 44void brcms_c_ampdu_finalize(struct brcms_ampdu_session *session);
45 45
46extern struct ampdu_info *brcms_c_ampdu_attach(struct brcms_c_info *wlc); 46struct ampdu_info *brcms_c_ampdu_attach(struct brcms_c_info *wlc);
47extern void brcms_c_ampdu_detach(struct ampdu_info *ampdu); 47void brcms_c_ampdu_detach(struct ampdu_info *ampdu);
48extern void brcms_c_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb, 48void brcms_c_ampdu_dotxstatus(struct ampdu_info *ampdu, struct scb *scb,
49 struct sk_buff *p, struct tx_status *txs); 49 struct sk_buff *p, struct tx_status *txs);
50extern void brcms_c_ampdu_macaddr_upd(struct brcms_c_info *wlc); 50void brcms_c_ampdu_macaddr_upd(struct brcms_c_info *wlc);
51extern void brcms_c_ampdu_shm_upd(struct ampdu_info *ampdu); 51void brcms_c_ampdu_shm_upd(struct ampdu_info *ampdu);
52 52
53#endif /* _BRCM_AMPDU_H_ */ 53#endif /* _BRCM_AMPDU_H_ */
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/antsel.h b/drivers/net/wireless/brcm80211/brcmsmac/antsel.h
index 97ea3881a8ec..a3d487ab1964 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/antsel.h
+++ b/drivers/net/wireless/brcm80211/brcmsmac/antsel.h
@@ -17,13 +17,11 @@
17#ifndef _BRCM_ANTSEL_H_ 17#ifndef _BRCM_ANTSEL_H_
18#define _BRCM_ANTSEL_H_ 18#define _BRCM_ANTSEL_H_
19 19
20extern struct antsel_info *brcms_c_antsel_attach(struct brcms_c_info *wlc); 20struct antsel_info *brcms_c_antsel_attach(struct brcms_c_info *wlc);
21extern void brcms_c_antsel_detach(struct antsel_info *asi); 21void brcms_c_antsel_detach(struct antsel_info *asi);
22extern void brcms_c_antsel_init(struct antsel_info *asi); 22void brcms_c_antsel_init(struct antsel_info *asi);
23extern void brcms_c_antsel_antcfg_get(struct antsel_info *asi, bool usedef, 23void brcms_c_antsel_antcfg_get(struct antsel_info *asi, bool usedef, bool sel,
24 bool sel, 24 u8 id, u8 fbid, u8 *antcfg, u8 *fbantcfg);
25 u8 id, u8 fbid, u8 *antcfg, 25u8 brcms_c_antsel_antsel2id(struct antsel_info *asi, u16 antsel);
26 u8 *fbantcfg);
27extern u8 brcms_c_antsel_antsel2id(struct antsel_info *asi, u16 antsel);
28 26
29#endif /* _BRCM_ANTSEL_H_ */ 27#endif /* _BRCM_ANTSEL_H_ */
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/channel.h b/drivers/net/wireless/brcm80211/brcmsmac/channel.h
index 006483a0abe6..39dd3a5b2979 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/channel.h
+++ b/drivers/net/wireless/brcm80211/brcmsmac/channel.h
@@ -32,20 +32,16 @@
32 32
33#define BRCMS_DFS_EU (BRCMS_DFS_TPC | BRCMS_RADAR_TYPE_EU) /* Flag for DFS EU */ 33#define BRCMS_DFS_EU (BRCMS_DFS_TPC | BRCMS_RADAR_TYPE_EU) /* Flag for DFS EU */
34 34
35extern struct brcms_cm_info * 35struct brcms_cm_info *brcms_c_channel_mgr_attach(struct brcms_c_info *wlc);
36brcms_c_channel_mgr_attach(struct brcms_c_info *wlc);
37 36
38extern void brcms_c_channel_mgr_detach(struct brcms_cm_info *wlc_cm); 37void brcms_c_channel_mgr_detach(struct brcms_cm_info *wlc_cm);
39 38
40extern bool brcms_c_valid_chanspec_db(struct brcms_cm_info *wlc_cm, 39bool brcms_c_valid_chanspec_db(struct brcms_cm_info *wlc_cm, u16 chspec);
41 u16 chspec);
42 40
43extern void brcms_c_channel_reg_limits(struct brcms_cm_info *wlc_cm, 41void brcms_c_channel_reg_limits(struct brcms_cm_info *wlc_cm, u16 chanspec,
44 u16 chanspec, 42 struct txpwr_limits *txpwr);
45 struct txpwr_limits *txpwr); 43void brcms_c_channel_set_chanspec(struct brcms_cm_info *wlc_cm, u16 chanspec,
46extern void brcms_c_channel_set_chanspec(struct brcms_cm_info *wlc_cm, 44 u8 local_constraint_qdbm);
47 u16 chanspec, 45void brcms_c_regd_init(struct brcms_c_info *wlc);
48 u8 local_constraint_qdbm);
49extern void brcms_c_regd_init(struct brcms_c_info *wlc);
50 46
51#endif /* _WLC_CHANNEL_H */ 47#endif /* _WLC_CHANNEL_H */
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h
index 4090032e81a2..198053dfc310 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h
+++ b/drivers/net/wireless/brcm80211/brcmsmac/mac80211_if.h
@@ -88,26 +88,26 @@ struct brcms_info {
88}; 88};
89 89
90/* misc callbacks */ 90/* misc callbacks */
91extern void brcms_init(struct brcms_info *wl); 91void brcms_init(struct brcms_info *wl);
92extern uint brcms_reset(struct brcms_info *wl); 92uint brcms_reset(struct brcms_info *wl);
93extern void brcms_intrson(struct brcms_info *wl); 93void brcms_intrson(struct brcms_info *wl);
94extern u32 brcms_intrsoff(struct brcms_info *wl); 94u32 brcms_intrsoff(struct brcms_info *wl);
95extern void brcms_intrsrestore(struct brcms_info *wl, u32 macintmask); 95void brcms_intrsrestore(struct brcms_info *wl, u32 macintmask);
96extern int brcms_up(struct brcms_info *wl); 96int brcms_up(struct brcms_info *wl);
97extern void brcms_down(struct brcms_info *wl); 97void brcms_down(struct brcms_info *wl);
98extern void brcms_txflowcontrol(struct brcms_info *wl, struct brcms_if *wlif, 98void brcms_txflowcontrol(struct brcms_info *wl, struct brcms_if *wlif,
99 bool state, int prio); 99 bool state, int prio);
100extern bool brcms_rfkill_set_hw_state(struct brcms_info *wl); 100bool brcms_rfkill_set_hw_state(struct brcms_info *wl);
101 101
102/* timer functions */ 102/* timer functions */
103extern struct brcms_timer *brcms_init_timer(struct brcms_info *wl, 103struct brcms_timer *brcms_init_timer(struct brcms_info *wl,
104 void (*fn) (void *arg), void *arg, 104 void (*fn) (void *arg), void *arg,
105 const char *name); 105 const char *name);
106extern void brcms_free_timer(struct brcms_timer *timer); 106void brcms_free_timer(struct brcms_timer *timer);
107extern void brcms_add_timer(struct brcms_timer *timer, uint ms, int periodic); 107void brcms_add_timer(struct brcms_timer *timer, uint ms, int periodic);
108extern bool brcms_del_timer(struct brcms_timer *timer); 108bool brcms_del_timer(struct brcms_timer *timer);
109extern void brcms_dpc(unsigned long data); 109void brcms_dpc(unsigned long data);
110extern void brcms_timer(struct brcms_timer *t); 110void brcms_timer(struct brcms_timer *t);
111extern void brcms_fatal_error(struct brcms_info *wl); 111void brcms_fatal_error(struct brcms_info *wl);
112 112
113#endif /* _BRCM_MAC80211_IF_H_ */ 113#endif /* _BRCM_MAC80211_IF_H_ */
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index 4608e0eb1493..8138f1cff4e5 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -1906,14 +1906,14 @@ static void brcms_c_get_macaddr(struct brcms_hardware *wlc_hw, u8 etheraddr[ETH_
1906 1906
1907 /* If macaddr exists, use it (Sromrev4, CIS, ...). */ 1907 /* If macaddr exists, use it (Sromrev4, CIS, ...). */
1908 if (!is_zero_ether_addr(sprom->il0mac)) { 1908 if (!is_zero_ether_addr(sprom->il0mac)) {
1909 memcpy(etheraddr, sprom->il0mac, 6); 1909 memcpy(etheraddr, sprom->il0mac, ETH_ALEN);
1910 return; 1910 return;
1911 } 1911 }
1912 1912
1913 if (wlc_hw->_nbands > 1) 1913 if (wlc_hw->_nbands > 1)
1914 memcpy(etheraddr, sprom->et1mac, 6); 1914 memcpy(etheraddr, sprom->et1mac, ETH_ALEN);
1915 else 1915 else
1916 memcpy(etheraddr, sprom->il0mac, 6); 1916 memcpy(etheraddr, sprom->il0mac, ETH_ALEN);
1917} 1917}
1918 1918
1919/* power both the pll and external oscillator on/off */ 1919/* power both the pll and external oscillator on/off */
@@ -5695,7 +5695,7 @@ static bool brcms_c_chipmatch_pci(struct bcma_device *core)
5695 return true; 5695 return true;
5696 if ((device == BCM43224_D11N_ID) || (device == BCM43225_D11N2G_ID)) 5696 if ((device == BCM43224_D11N_ID) || (device == BCM43225_D11N2G_ID))
5697 return true; 5697 return true;
5698 if (device == BCM4313_D11N2G_ID) 5698 if (device == BCM4313_D11N2G_ID || device == BCM4313_CHIP_ID)
5699 return true; 5699 return true;
5700 if ((device == BCM43236_D11N_ID) || (device == BCM43236_D11N2G_ID)) 5700 if ((device == BCM43236_D11N_ID) || (device == BCM43236_D11N2G_ID))
5701 return true; 5701 return true;
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.h b/drivers/net/wireless/brcm80211/brcmsmac/main.h
index b5d7a38b53fe..c4d135cff04a 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.h
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.h
@@ -616,66 +616,54 @@ struct brcms_bss_cfg {
616 struct brcms_bss_info *current_bss; 616 struct brcms_bss_info *current_bss;
617}; 617};
618 618
619extern int brcms_c_txfifo(struct brcms_c_info *wlc, uint fifo, 619int brcms_c_txfifo(struct brcms_c_info *wlc, uint fifo, struct sk_buff *p);
620 struct sk_buff *p); 620int brcms_b_xmtfifo_sz_get(struct brcms_hardware *wlc_hw, uint fifo,
621extern int brcms_b_xmtfifo_sz_get(struct brcms_hardware *wlc_hw, uint fifo, 621 uint *blocks);
622 uint *blocks); 622
623 623int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config);
624extern int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config); 624void brcms_c_mac_promisc(struct brcms_c_info *wlc, uint filter_flags);
625extern void brcms_c_mac_promisc(struct brcms_c_info *wlc, uint filter_flags); 625u16 brcms_c_calc_lsig_len(struct brcms_c_info *wlc, u32 ratespec, uint mac_len);
626extern u16 brcms_c_calc_lsig_len(struct brcms_c_info *wlc, u32 ratespec, 626u32 brcms_c_rspec_to_rts_rspec(struct brcms_c_info *wlc, u32 rspec,
627 uint mac_len); 627 bool use_rspec, u16 mimo_ctlchbw);
628extern u32 brcms_c_rspec_to_rts_rspec(struct brcms_c_info *wlc, 628u16 brcms_c_compute_rtscts_dur(struct brcms_c_info *wlc, bool cts_only,
629 u32 rspec, 629 u32 rts_rate, u32 frame_rate,
630 bool use_rspec, u16 mimo_ctlchbw); 630 u8 rts_preamble_type, u8 frame_preamble_type,
631extern u16 brcms_c_compute_rtscts_dur(struct brcms_c_info *wlc, bool cts_only, 631 uint frame_len, bool ba);
632 u32 rts_rate, 632void brcms_c_inval_dma_pkts(struct brcms_hardware *hw,
633 u32 frame_rate, 633 struct ieee80211_sta *sta, void (*dma_callback_fn));
634 u8 rts_preamble_type, 634void brcms_c_update_probe_resp(struct brcms_c_info *wlc, bool suspend);
635 u8 frame_preamble_type, uint frame_len, 635int brcms_c_set_nmode(struct brcms_c_info *wlc);
636 bool ba); 636void brcms_c_beacon_phytxctl_txant_upd(struct brcms_c_info *wlc, u32 bcn_rate);
637extern void brcms_c_inval_dma_pkts(struct brcms_hardware *hw, 637void brcms_b_antsel_type_set(struct brcms_hardware *wlc_hw, u8 antsel_type);
638 struct ieee80211_sta *sta, 638void brcms_b_set_chanspec(struct brcms_hardware *wlc_hw, u16 chanspec,
639 void (*dma_callback_fn)); 639 bool mute, struct txpwr_limits *txpwr);
640extern void brcms_c_update_probe_resp(struct brcms_c_info *wlc, bool suspend); 640void brcms_b_write_shm(struct brcms_hardware *wlc_hw, uint offset, u16 v);
641extern int brcms_c_set_nmode(struct brcms_c_info *wlc); 641u16 brcms_b_read_shm(struct brcms_hardware *wlc_hw, uint offset);
642extern void brcms_c_beacon_phytxctl_txant_upd(struct brcms_c_info *wlc, 642void brcms_b_mhf(struct brcms_hardware *wlc_hw, u8 idx, u16 mask, u16 val,
643 u32 bcn_rate); 643 int bands);
644extern void brcms_b_antsel_type_set(struct brcms_hardware *wlc_hw, 644void brcms_b_corereset(struct brcms_hardware *wlc_hw, u32 flags);
645 u8 antsel_type); 645void brcms_b_mctrl(struct brcms_hardware *wlc_hw, u32 mask, u32 val);
646extern void brcms_b_set_chanspec(struct brcms_hardware *wlc_hw, 646void brcms_b_phy_reset(struct brcms_hardware *wlc_hw);
647 u16 chanspec, 647void brcms_b_bw_set(struct brcms_hardware *wlc_hw, u16 bw);
648 bool mute, struct txpwr_limits *txpwr); 648void brcms_b_core_phypll_reset(struct brcms_hardware *wlc_hw);
649extern void brcms_b_write_shm(struct brcms_hardware *wlc_hw, uint offset, 649void brcms_c_ucode_wake_override_set(struct brcms_hardware *wlc_hw,
650 u16 v); 650 u32 override_bit);
651extern u16 brcms_b_read_shm(struct brcms_hardware *wlc_hw, uint offset); 651void brcms_c_ucode_wake_override_clear(struct brcms_hardware *wlc_hw,
652extern void brcms_b_mhf(struct brcms_hardware *wlc_hw, u8 idx, u16 mask, 652 u32 override_bit);
653 u16 val, int bands); 653void brcms_b_write_template_ram(struct brcms_hardware *wlc_hw, int offset,
654extern void brcms_b_corereset(struct brcms_hardware *wlc_hw, u32 flags); 654 int len, void *buf);
655extern void brcms_b_mctrl(struct brcms_hardware *wlc_hw, u32 mask, u32 val); 655u16 brcms_b_rate_shm_offset(struct brcms_hardware *wlc_hw, u8 rate);
656extern void brcms_b_phy_reset(struct brcms_hardware *wlc_hw); 656void brcms_b_copyto_objmem(struct brcms_hardware *wlc_hw, uint offset,
657extern void brcms_b_bw_set(struct brcms_hardware *wlc_hw, u16 bw); 657 const void *buf, int len, u32 sel);
658extern void brcms_b_core_phypll_reset(struct brcms_hardware *wlc_hw); 658void brcms_b_copyfrom_objmem(struct brcms_hardware *wlc_hw, uint offset,
659extern void brcms_c_ucode_wake_override_set(struct brcms_hardware *wlc_hw, 659 void *buf, int len, u32 sel);
660 u32 override_bit); 660void brcms_b_switch_macfreq(struct brcms_hardware *wlc_hw, u8 spurmode);
661extern void brcms_c_ucode_wake_override_clear(struct brcms_hardware *wlc_hw, 661u16 brcms_b_get_txant(struct brcms_hardware *wlc_hw);
662 u32 override_bit); 662void brcms_b_phyclk_fgc(struct brcms_hardware *wlc_hw, bool clk);
663extern void brcms_b_write_template_ram(struct brcms_hardware *wlc_hw, 663void brcms_b_macphyclk_set(struct brcms_hardware *wlc_hw, bool clk);
664 int offset, int len, void *buf); 664void brcms_b_core_phypll_ctl(struct brcms_hardware *wlc_hw, bool on);
665extern u16 brcms_b_rate_shm_offset(struct brcms_hardware *wlc_hw, u8 rate); 665void brcms_b_txant_set(struct brcms_hardware *wlc_hw, u16 phytxant);
666extern void brcms_b_copyto_objmem(struct brcms_hardware *wlc_hw, 666void brcms_b_band_stf_ss_set(struct brcms_hardware *wlc_hw, u8 stf_mode);
667 uint offset, const void *buf, int len, 667void brcms_c_init_scb(struct scb *scb);
668 u32 sel);
669extern void brcms_b_copyfrom_objmem(struct brcms_hardware *wlc_hw, uint offset,
670 void *buf, int len, u32 sel);
671extern void brcms_b_switch_macfreq(struct brcms_hardware *wlc_hw, u8 spurmode);
672extern u16 brcms_b_get_txant(struct brcms_hardware *wlc_hw);
673extern void brcms_b_phyclk_fgc(struct brcms_hardware *wlc_hw, bool clk);
674extern void brcms_b_macphyclk_set(struct brcms_hardware *wlc_hw, bool clk);
675extern void brcms_b_core_phypll_ctl(struct brcms_hardware *wlc_hw, bool on);
676extern void brcms_b_txant_set(struct brcms_hardware *wlc_hw, u16 phytxant);
677extern void brcms_b_band_stf_ss_set(struct brcms_hardware *wlc_hw,
678 u8 stf_mode);
679extern void brcms_c_init_scb(struct scb *scb);
680 668
681#endif /* _BRCM_MAIN_H_ */ 669#endif /* _BRCM_MAIN_H_ */
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_hal.h b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_hal.h
index e34a71e7d242..4d3734f48d9c 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_hal.h
+++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_hal.h
@@ -179,121 +179,106 @@ struct shared_phy_params {
179}; 179};
180 180
181 181
182extern struct shared_phy *wlc_phy_shared_attach(struct shared_phy_params *shp); 182struct shared_phy *wlc_phy_shared_attach(struct shared_phy_params *shp);
183extern struct brcms_phy_pub *wlc_phy_attach(struct shared_phy *sh, 183struct brcms_phy_pub *wlc_phy_attach(struct shared_phy *sh,
184 struct bcma_device *d11core, 184 struct bcma_device *d11core, int bandtype,
185 int bandtype, struct wiphy *wiphy); 185 struct wiphy *wiphy);
186extern void wlc_phy_detach(struct brcms_phy_pub *ppi); 186void wlc_phy_detach(struct brcms_phy_pub *ppi);
187 187
188extern bool wlc_phy_get_phyversion(struct brcms_phy_pub *pih, u16 *phytype, 188bool wlc_phy_get_phyversion(struct brcms_phy_pub *pih, u16 *phytype,
189 u16 *phyrev, u16 *radioid, 189 u16 *phyrev, u16 *radioid, u16 *radiover);
190 u16 *radiover); 190bool wlc_phy_get_encore(struct brcms_phy_pub *pih);
191extern bool wlc_phy_get_encore(struct brcms_phy_pub *pih); 191u32 wlc_phy_get_coreflags(struct brcms_phy_pub *pih);
192extern u32 wlc_phy_get_coreflags(struct brcms_phy_pub *pih); 192
193 193void wlc_phy_hw_clk_state_upd(struct brcms_phy_pub *ppi, bool newstate);
194extern void wlc_phy_hw_clk_state_upd(struct brcms_phy_pub *ppi, bool newstate); 194void wlc_phy_hw_state_upd(struct brcms_phy_pub *ppi, bool newstate);
195extern void wlc_phy_hw_state_upd(struct brcms_phy_pub *ppi, bool newstate); 195void wlc_phy_init(struct brcms_phy_pub *ppi, u16 chanspec);
196extern void wlc_phy_init(struct brcms_phy_pub *ppi, u16 chanspec); 196void wlc_phy_watchdog(struct brcms_phy_pub *ppi);
197extern void wlc_phy_watchdog(struct brcms_phy_pub *ppi); 197int wlc_phy_down(struct brcms_phy_pub *ppi);
198extern int wlc_phy_down(struct brcms_phy_pub *ppi); 198u32 wlc_phy_clk_bwbits(struct brcms_phy_pub *pih);
199extern u32 wlc_phy_clk_bwbits(struct brcms_phy_pub *pih); 199void wlc_phy_cal_init(struct brcms_phy_pub *ppi);
200extern void wlc_phy_cal_init(struct brcms_phy_pub *ppi); 200void wlc_phy_antsel_init(struct brcms_phy_pub *ppi, bool lut_init);
201extern void wlc_phy_antsel_init(struct brcms_phy_pub *ppi, bool lut_init); 201
202 202void wlc_phy_chanspec_set(struct brcms_phy_pub *ppi, u16 chanspec);
203extern void wlc_phy_chanspec_set(struct brcms_phy_pub *ppi, 203u16 wlc_phy_chanspec_get(struct brcms_phy_pub *ppi);
204 u16 chanspec); 204void wlc_phy_chanspec_radio_set(struct brcms_phy_pub *ppi, u16 newch);
205extern u16 wlc_phy_chanspec_get(struct brcms_phy_pub *ppi); 205u16 wlc_phy_bw_state_get(struct brcms_phy_pub *ppi);
206extern void wlc_phy_chanspec_radio_set(struct brcms_phy_pub *ppi, 206void wlc_phy_bw_state_set(struct brcms_phy_pub *ppi, u16 bw);
207 u16 newch); 207
208extern u16 wlc_phy_bw_state_get(struct brcms_phy_pub *ppi); 208int wlc_phy_rssi_compute(struct brcms_phy_pub *pih, struct d11rxhdr *rxh);
209extern void wlc_phy_bw_state_set(struct brcms_phy_pub *ppi, u16 bw); 209void wlc_phy_por_inform(struct brcms_phy_pub *ppi);
210 210void wlc_phy_noise_sample_intr(struct brcms_phy_pub *ppi);
211extern int wlc_phy_rssi_compute(struct brcms_phy_pub *pih, 211bool wlc_phy_bist_check_phy(struct brcms_phy_pub *ppi);
212 struct d11rxhdr *rxh); 212
213extern void wlc_phy_por_inform(struct brcms_phy_pub *ppi); 213void wlc_phy_set_deaf(struct brcms_phy_pub *ppi, bool user_flag);
214extern void wlc_phy_noise_sample_intr(struct brcms_phy_pub *ppi); 214
215extern bool wlc_phy_bist_check_phy(struct brcms_phy_pub *ppi); 215void wlc_phy_switch_radio(struct brcms_phy_pub *ppi, bool on);
216 216void wlc_phy_anacore(struct brcms_phy_pub *ppi, bool on);
217extern void wlc_phy_set_deaf(struct brcms_phy_pub *ppi, bool user_flag); 217
218 218
219extern void wlc_phy_switch_radio(struct brcms_phy_pub *ppi, bool on); 219void wlc_phy_BSSinit(struct brcms_phy_pub *ppi, bool bonlyap, int rssi);
220extern void wlc_phy_anacore(struct brcms_phy_pub *ppi, bool on); 220
221 221void wlc_phy_chanspec_ch14_widefilter_set(struct brcms_phy_pub *ppi,
222 222 bool wide_filter);
223extern void wlc_phy_BSSinit(struct brcms_phy_pub *ppi, bool bonlyap, int rssi); 223void wlc_phy_chanspec_band_validch(struct brcms_phy_pub *ppi, uint band,
224 224 struct brcms_chanvec *channels);
225extern void wlc_phy_chanspec_ch14_widefilter_set(struct brcms_phy_pub *ppi, 225u16 wlc_phy_chanspec_band_firstch(struct brcms_phy_pub *ppi, uint band);
226 bool wide_filter); 226
227extern void wlc_phy_chanspec_band_validch(struct brcms_phy_pub *ppi, uint band, 227void wlc_phy_txpower_sromlimit(struct brcms_phy_pub *ppi, uint chan, u8 *_min_,
228 struct brcms_chanvec *channels); 228 u8 *_max_, int rate);
229extern u16 wlc_phy_chanspec_band_firstch(struct brcms_phy_pub *ppi, 229void wlc_phy_txpower_sromlimit_max_get(struct brcms_phy_pub *ppi, uint chan,
230 uint band); 230 u8 *_max_, u8 *_min_);
231 231void wlc_phy_txpower_boardlimit_band(struct brcms_phy_pub *ppi, uint band,
232extern void wlc_phy_txpower_sromlimit(struct brcms_phy_pub *ppi, uint chan, 232 s32 *, s32 *, u32 *);
233 u8 *_min_, u8 *_max_, int rate); 233void wlc_phy_txpower_limit_set(struct brcms_phy_pub *ppi, struct txpwr_limits *,
234extern void wlc_phy_txpower_sromlimit_max_get(struct brcms_phy_pub *ppi, 234 u16 chanspec);
235 uint chan, u8 *_max_, u8 *_min_); 235int wlc_phy_txpower_get(struct brcms_phy_pub *ppi, uint *qdbm, bool *override);
236extern void wlc_phy_txpower_boardlimit_band(struct brcms_phy_pub *ppi, 236int wlc_phy_txpower_set(struct brcms_phy_pub *ppi, uint qdbm, bool override);
237 uint band, s32 *, s32 *, u32 *); 237void wlc_phy_txpower_target_set(struct brcms_phy_pub *ppi,
238extern void wlc_phy_txpower_limit_set(struct brcms_phy_pub *ppi, 238 struct txpwr_limits *);
239 struct txpwr_limits *, 239bool wlc_phy_txpower_hw_ctrl_get(struct brcms_phy_pub *ppi);
240 u16 chanspec); 240void wlc_phy_txpower_hw_ctrl_set(struct brcms_phy_pub *ppi, bool hwpwrctrl);
241extern int wlc_phy_txpower_get(struct brcms_phy_pub *ppi, uint *qdbm, 241u8 wlc_phy_txpower_get_target_min(struct brcms_phy_pub *ppi);
242 bool *override); 242u8 wlc_phy_txpower_get_target_max(struct brcms_phy_pub *ppi);
243extern int wlc_phy_txpower_set(struct brcms_phy_pub *ppi, uint qdbm, 243bool wlc_phy_txpower_ipa_ison(struct brcms_phy_pub *pih);
244 bool override); 244
245extern void wlc_phy_txpower_target_set(struct brcms_phy_pub *ppi, 245void wlc_phy_stf_chain_init(struct brcms_phy_pub *pih, u8 txchain, u8 rxchain);
246 struct txpwr_limits *); 246void wlc_phy_stf_chain_set(struct brcms_phy_pub *pih, u8 txchain, u8 rxchain);
247extern bool wlc_phy_txpower_hw_ctrl_get(struct brcms_phy_pub *ppi); 247void wlc_phy_stf_chain_get(struct brcms_phy_pub *pih, u8 *txchain, u8 *rxchain);
248extern void wlc_phy_txpower_hw_ctrl_set(struct brcms_phy_pub *ppi, 248u8 wlc_phy_stf_chain_active_get(struct brcms_phy_pub *pih);
249 bool hwpwrctrl); 249s8 wlc_phy_stf_ssmode_get(struct brcms_phy_pub *pih, u16 chanspec);
250extern u8 wlc_phy_txpower_get_target_min(struct brcms_phy_pub *ppi); 250void wlc_phy_ldpc_override_set(struct brcms_phy_pub *ppi, bool val);
251extern u8 wlc_phy_txpower_get_target_max(struct brcms_phy_pub *ppi); 251
252extern bool wlc_phy_txpower_ipa_ison(struct brcms_phy_pub *pih); 252void wlc_phy_cal_perical(struct brcms_phy_pub *ppi, u8 reason);
253 253void wlc_phy_noise_sample_request_external(struct brcms_phy_pub *ppi);
254extern void wlc_phy_stf_chain_init(struct brcms_phy_pub *pih, u8 txchain, 254void wlc_phy_edcrs_lock(struct brcms_phy_pub *pih, bool lock);
255 u8 rxchain); 255void wlc_phy_cal_papd_recal(struct brcms_phy_pub *ppi);
256extern void wlc_phy_stf_chain_set(struct brcms_phy_pub *pih, u8 txchain, 256
257 u8 rxchain); 257void wlc_phy_ant_rxdiv_set(struct brcms_phy_pub *ppi, u8 val);
258extern void wlc_phy_stf_chain_get(struct brcms_phy_pub *pih, u8 *txchain, 258void wlc_phy_clear_tssi(struct brcms_phy_pub *ppi);
259 u8 *rxchain); 259void wlc_phy_hold_upd(struct brcms_phy_pub *ppi, u32 id, bool val);
260extern u8 wlc_phy_stf_chain_active_get(struct brcms_phy_pub *pih); 260void wlc_phy_mute_upd(struct brcms_phy_pub *ppi, bool val, u32 flags);
261extern s8 wlc_phy_stf_ssmode_get(struct brcms_phy_pub *pih, 261
262 u16 chanspec); 262void wlc_phy_antsel_type_set(struct brcms_phy_pub *ppi, u8 antsel_type);
263extern void wlc_phy_ldpc_override_set(struct brcms_phy_pub *ppi, bool val); 263
264 264void wlc_phy_txpower_get_current(struct brcms_phy_pub *ppi,
265extern void wlc_phy_cal_perical(struct brcms_phy_pub *ppi, u8 reason); 265 struct tx_power *power, uint channel);
266extern void wlc_phy_noise_sample_request_external(struct brcms_phy_pub *ppi); 266
267extern void wlc_phy_edcrs_lock(struct brcms_phy_pub *pih, bool lock); 267void wlc_phy_initcal_enable(struct brcms_phy_pub *pih, bool initcal);
268extern void wlc_phy_cal_papd_recal(struct brcms_phy_pub *ppi); 268bool wlc_phy_test_ison(struct brcms_phy_pub *ppi);
269 269void wlc_phy_txpwr_percent_set(struct brcms_phy_pub *ppi, u8 txpwr_percent);
270extern void wlc_phy_ant_rxdiv_set(struct brcms_phy_pub *ppi, u8 val); 270void wlc_phy_ofdm_rateset_war(struct brcms_phy_pub *pih, bool war);
271extern void wlc_phy_clear_tssi(struct brcms_phy_pub *ppi); 271void wlc_phy_bf_preempt_enable(struct brcms_phy_pub *pih, bool bf_preempt);
272extern void wlc_phy_hold_upd(struct brcms_phy_pub *ppi, u32 id, bool val); 272void wlc_phy_machwcap_set(struct brcms_phy_pub *ppi, u32 machwcap);
273extern void wlc_phy_mute_upd(struct brcms_phy_pub *ppi, bool val, u32 flags); 273
274 274void wlc_phy_runbist_config(struct brcms_phy_pub *ppi, bool start_end);
275extern void wlc_phy_antsel_type_set(struct brcms_phy_pub *ppi, u8 antsel_type); 275
276 276void wlc_phy_freqtrack_start(struct brcms_phy_pub *ppi);
277extern void wlc_phy_txpower_get_current(struct brcms_phy_pub *ppi, 277void wlc_phy_freqtrack_end(struct brcms_phy_pub *ppi);
278 struct tx_power *power, uint channel); 278
279 279const u8 *wlc_phy_get_ofdm_rate_lookup(void);
280extern void wlc_phy_initcal_enable(struct brcms_phy_pub *pih, bool initcal); 280
281extern bool wlc_phy_test_ison(struct brcms_phy_pub *ppi); 281s8 wlc_phy_get_tx_power_offset_by_mcs(struct brcms_phy_pub *ppi,
282extern void wlc_phy_txpwr_percent_set(struct brcms_phy_pub *ppi, 282 u8 mcs_offset);
283 u8 txpwr_percent); 283s8 wlc_phy_get_tx_power_offset(struct brcms_phy_pub *ppi, u8 tbl_offset);
284extern void wlc_phy_ofdm_rateset_war(struct brcms_phy_pub *pih, bool war);
285extern void wlc_phy_bf_preempt_enable(struct brcms_phy_pub *pih,
286 bool bf_preempt);
287extern void wlc_phy_machwcap_set(struct brcms_phy_pub *ppi, u32 machwcap);
288
289extern void wlc_phy_runbist_config(struct brcms_phy_pub *ppi, bool start_end);
290
291extern void wlc_phy_freqtrack_start(struct brcms_phy_pub *ppi);
292extern void wlc_phy_freqtrack_end(struct brcms_phy_pub *ppi);
293
294extern const u8 *wlc_phy_get_ofdm_rate_lookup(void);
295
296extern s8 wlc_phy_get_tx_power_offset_by_mcs(struct brcms_phy_pub *ppi,
297 u8 mcs_offset);
298extern s8 wlc_phy_get_tx_power_offset(struct brcms_phy_pub *ppi, u8 tbl_offset);
299#endif /* _BRCM_PHY_HAL_H_ */ 284#endif /* _BRCM_PHY_HAL_H_ */
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h
index 1dc767c31653..4960f7d26804 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h
+++ b/drivers/net/wireless/brcm80211/brcmsmac/phy/phy_int.h
@@ -910,113 +910,103 @@ struct lcnphy_radio_regs {
910 u8 do_init_g; 910 u8 do_init_g;
911}; 911};
912 912
913extern u16 read_phy_reg(struct brcms_phy *pi, u16 addr); 913u16 read_phy_reg(struct brcms_phy *pi, u16 addr);
914extern void write_phy_reg(struct brcms_phy *pi, u16 addr, u16 val); 914void write_phy_reg(struct brcms_phy *pi, u16 addr, u16 val);
915extern void and_phy_reg(struct brcms_phy *pi, u16 addr, u16 val); 915void and_phy_reg(struct brcms_phy *pi, u16 addr, u16 val);
916extern void or_phy_reg(struct brcms_phy *pi, u16 addr, u16 val); 916void or_phy_reg(struct brcms_phy *pi, u16 addr, u16 val);
917extern void mod_phy_reg(struct brcms_phy *pi, u16 addr, u16 mask, u16 val); 917void mod_phy_reg(struct brcms_phy *pi, u16 addr, u16 mask, u16 val);
918 918
919extern u16 read_radio_reg(struct brcms_phy *pi, u16 addr); 919u16 read_radio_reg(struct brcms_phy *pi, u16 addr);
920extern void or_radio_reg(struct brcms_phy *pi, u16 addr, u16 val); 920void or_radio_reg(struct brcms_phy *pi, u16 addr, u16 val);
921extern void and_radio_reg(struct brcms_phy *pi, u16 addr, u16 val); 921void and_radio_reg(struct brcms_phy *pi, u16 addr, u16 val);
922extern void mod_radio_reg(struct brcms_phy *pi, u16 addr, u16 mask, 922void mod_radio_reg(struct brcms_phy *pi, u16 addr, u16 mask, u16 val);
923 u16 val); 923void xor_radio_reg(struct brcms_phy *pi, u16 addr, u16 mask);
924extern void xor_radio_reg(struct brcms_phy *pi, u16 addr, u16 mask); 924
925 925void write_radio_reg(struct brcms_phy *pi, u16 addr, u16 val);
926extern void write_radio_reg(struct brcms_phy *pi, u16 addr, u16 val); 926
927 927void wlc_phyreg_enter(struct brcms_phy_pub *pih);
928extern void wlc_phyreg_enter(struct brcms_phy_pub *pih); 928void wlc_phyreg_exit(struct brcms_phy_pub *pih);
929extern void wlc_phyreg_exit(struct brcms_phy_pub *pih); 929void wlc_radioreg_enter(struct brcms_phy_pub *pih);
930extern void wlc_radioreg_enter(struct brcms_phy_pub *pih); 930void wlc_radioreg_exit(struct brcms_phy_pub *pih);
931extern void wlc_radioreg_exit(struct brcms_phy_pub *pih); 931
932 932void wlc_phy_read_table(struct brcms_phy *pi,
933extern void wlc_phy_read_table(struct brcms_phy *pi, 933 const struct phytbl_info *ptbl_info,
934 const struct phytbl_info *ptbl_info, 934 u16 tblAddr, u16 tblDataHi, u16 tblDatalo);
935 u16 tblAddr, u16 tblDataHi, 935void wlc_phy_write_table(struct brcms_phy *pi,
936 u16 tblDatalo); 936 const struct phytbl_info *ptbl_info,
937extern void wlc_phy_write_table(struct brcms_phy *pi, 937 u16 tblAddr, u16 tblDataHi, u16 tblDatalo);
938 const struct phytbl_info *ptbl_info, 938void wlc_phy_table_addr(struct brcms_phy *pi, uint tbl_id, uint tbl_offset,
939 u16 tblAddr, u16 tblDataHi, u16 tblDatalo); 939 u16 tblAddr, u16 tblDataHi, u16 tblDataLo);
940extern void wlc_phy_table_addr(struct brcms_phy *pi, uint tbl_id, 940void wlc_phy_table_data_write(struct brcms_phy *pi, uint width, u32 val);
941 uint tbl_offset, u16 tblAddr, u16 tblDataHi, 941
942 u16 tblDataLo); 942void write_phy_channel_reg(struct brcms_phy *pi, uint val);
943extern void wlc_phy_table_data_write(struct brcms_phy *pi, uint width, u32 val); 943void wlc_phy_txpower_update_shm(struct brcms_phy *pi);
944 944
945extern void write_phy_channel_reg(struct brcms_phy *pi, uint val); 945u8 wlc_phy_nbits(s32 value);
946extern void wlc_phy_txpower_update_shm(struct brcms_phy *pi); 946void wlc_phy_compute_dB(u32 *cmplx_pwr, s8 *p_dB, u8 core);
947 947
948extern u8 wlc_phy_nbits(s32 value); 948uint wlc_phy_init_radio_regs_allbands(struct brcms_phy *pi,
949extern void wlc_phy_compute_dB(u32 *cmplx_pwr, s8 *p_dB, u8 core); 949 struct radio_20xx_regs *radioregs);
950 950uint wlc_phy_init_radio_regs(struct brcms_phy *pi,
951extern uint wlc_phy_init_radio_regs_allbands(struct brcms_phy *pi, 951 const struct radio_regs *radioregs,
952 struct radio_20xx_regs *radioregs); 952 u16 core_offset);
953extern uint wlc_phy_init_radio_regs(struct brcms_phy *pi, 953
954 const struct radio_regs *radioregs, 954void wlc_phy_txpower_ipa_upd(struct brcms_phy *pi);
955 u16 core_offset); 955
956 956void wlc_phy_do_dummy_tx(struct brcms_phy *pi, bool ofdm, bool pa_on);
957extern void wlc_phy_txpower_ipa_upd(struct brcms_phy *pi); 957void wlc_phy_papd_decode_epsilon(u32 epsilon, s32 *eps_real, s32 *eps_imag);
958 958
959extern void wlc_phy_do_dummy_tx(struct brcms_phy *pi, bool ofdm, bool pa_on); 959void wlc_phy_cal_perical_mphase_reset(struct brcms_phy *pi);
960extern void wlc_phy_papd_decode_epsilon(u32 epsilon, s32 *eps_real, 960void wlc_phy_cal_perical_mphase_restart(struct brcms_phy *pi);
961 s32 *eps_imag); 961
962 962bool wlc_phy_attach_nphy(struct brcms_phy *pi);
963extern void wlc_phy_cal_perical_mphase_reset(struct brcms_phy *pi); 963bool wlc_phy_attach_lcnphy(struct brcms_phy *pi);
964extern void wlc_phy_cal_perical_mphase_restart(struct brcms_phy *pi); 964
965 965void wlc_phy_detach_lcnphy(struct brcms_phy *pi);
966extern bool wlc_phy_attach_nphy(struct brcms_phy *pi); 966
967extern bool wlc_phy_attach_lcnphy(struct brcms_phy *pi); 967void wlc_phy_init_nphy(struct brcms_phy *pi);
968 968void wlc_phy_init_lcnphy(struct brcms_phy *pi);
969extern void wlc_phy_detach_lcnphy(struct brcms_phy *pi); 969
970 970void wlc_phy_cal_init_nphy(struct brcms_phy *pi);
971extern void wlc_phy_init_nphy(struct brcms_phy *pi); 971void wlc_phy_cal_init_lcnphy(struct brcms_phy *pi);
972extern void wlc_phy_init_lcnphy(struct brcms_phy *pi); 972
973 973void wlc_phy_chanspec_set_nphy(struct brcms_phy *pi, u16 chanspec);
974extern void wlc_phy_cal_init_nphy(struct brcms_phy *pi); 974void wlc_phy_chanspec_set_lcnphy(struct brcms_phy *pi, u16 chanspec);
975extern void wlc_phy_cal_init_lcnphy(struct brcms_phy *pi); 975void wlc_phy_chanspec_set_fixup_lcnphy(struct brcms_phy *pi, u16 chanspec);
976 976int wlc_phy_channel2freq(uint channel);
977extern void wlc_phy_chanspec_set_nphy(struct brcms_phy *pi, 977int wlc_phy_chanspec_freq2bandrange_lpssn(uint);
978 u16 chanspec); 978int wlc_phy_chanspec_bandrange_get(struct brcms_phy *, u16 chanspec);
979extern void wlc_phy_chanspec_set_lcnphy(struct brcms_phy *pi, 979
980 u16 chanspec); 980void wlc_lcnphy_set_tx_pwr_ctrl(struct brcms_phy *pi, u16 mode);
981extern void wlc_phy_chanspec_set_fixup_lcnphy(struct brcms_phy *pi, 981s8 wlc_lcnphy_get_current_tx_pwr_idx(struct brcms_phy *pi);
982 u16 chanspec); 982
983extern int wlc_phy_channel2freq(uint channel); 983void wlc_phy_txpower_recalc_target_nphy(struct brcms_phy *pi);
984extern int wlc_phy_chanspec_freq2bandrange_lpssn(uint); 984void wlc_lcnphy_txpower_recalc_target(struct brcms_phy *pi);
985extern int wlc_phy_chanspec_bandrange_get(struct brcms_phy *, u16 chanspec); 985void wlc_phy_txpower_recalc_target_lcnphy(struct brcms_phy *pi);
986 986
987extern void wlc_lcnphy_set_tx_pwr_ctrl(struct brcms_phy *pi, u16 mode); 987void wlc_lcnphy_set_tx_pwr_by_index(struct brcms_phy *pi, int index);
988extern s8 wlc_lcnphy_get_current_tx_pwr_idx(struct brcms_phy *pi); 988void wlc_lcnphy_tx_pu(struct brcms_phy *pi, bool bEnable);
989 989void wlc_lcnphy_stop_tx_tone(struct brcms_phy *pi);
990extern void wlc_phy_txpower_recalc_target_nphy(struct brcms_phy *pi); 990void wlc_lcnphy_start_tx_tone(struct brcms_phy *pi, s32 f_kHz, u16 max_val,
991extern void wlc_lcnphy_txpower_recalc_target(struct brcms_phy *pi); 991 bool iqcalmode);
992extern void wlc_phy_txpower_recalc_target_lcnphy(struct brcms_phy *pi); 992
993 993void wlc_phy_txpower_sromlimit_get_nphy(struct brcms_phy *pi, uint chan,
994extern void wlc_lcnphy_set_tx_pwr_by_index(struct brcms_phy *pi, int index); 994 u8 *max_pwr, u8 rate_id);
995extern void wlc_lcnphy_tx_pu(struct brcms_phy *pi, bool bEnable); 995void wlc_phy_ofdm_to_mcs_powers_nphy(u8 *power, u8 rate_mcs_start,
996extern void wlc_lcnphy_stop_tx_tone(struct brcms_phy *pi); 996 u8 rate_mcs_end, u8 rate_ofdm_start);
997extern void wlc_lcnphy_start_tx_tone(struct brcms_phy *pi, s32 f_kHz, 997void wlc_phy_mcs_to_ofdm_powers_nphy(u8 *power, u8 rate_ofdm_start,
998 u16 max_val, bool iqcalmode); 998 u8 rate_ofdm_end, u8 rate_mcs_start);
999 999
1000extern void wlc_phy_txpower_sromlimit_get_nphy(struct brcms_phy *pi, uint chan, 1000u16 wlc_lcnphy_tempsense(struct brcms_phy *pi, bool mode);
1001 u8 *max_pwr, u8 rate_id); 1001s16 wlc_lcnphy_tempsense_new(struct brcms_phy *pi, bool mode);
1002extern void wlc_phy_ofdm_to_mcs_powers_nphy(u8 *power, u8 rate_mcs_start, 1002s8 wlc_lcnphy_tempsense_degree(struct brcms_phy *pi, bool mode);
1003 u8 rate_mcs_end, 1003s8 wlc_lcnphy_vbatsense(struct brcms_phy *pi, bool mode);
1004 u8 rate_ofdm_start); 1004void wlc_phy_carrier_suppress_lcnphy(struct brcms_phy *pi);
1005extern void wlc_phy_mcs_to_ofdm_powers_nphy(u8 *power, 1005void wlc_lcnphy_crsuprs(struct brcms_phy *pi, int channel);
1006 u8 rate_ofdm_start, 1006void wlc_lcnphy_epa_switch(struct brcms_phy *pi, bool mode);
1007 u8 rate_ofdm_end, 1007void wlc_2064_vco_cal(struct brcms_phy *pi);
1008 u8 rate_mcs_start); 1008
1009 1009void wlc_phy_txpower_recalc_target(struct brcms_phy *pi);
1010extern u16 wlc_lcnphy_tempsense(struct brcms_phy *pi, bool mode);
1011extern s16 wlc_lcnphy_tempsense_new(struct brcms_phy *pi, bool mode);
1012extern s8 wlc_lcnphy_tempsense_degree(struct brcms_phy *pi, bool mode);
1013extern s8 wlc_lcnphy_vbatsense(struct brcms_phy *pi, bool mode);
1014extern void wlc_phy_carrier_suppress_lcnphy(struct brcms_phy *pi);
1015extern void wlc_lcnphy_crsuprs(struct brcms_phy *pi, int channel);
1016extern void wlc_lcnphy_epa_switch(struct brcms_phy *pi, bool mode);
1017extern void wlc_2064_vco_cal(struct brcms_phy *pi);
1018
1019extern void wlc_phy_txpower_recalc_target(struct brcms_phy *pi);
1020 1010
1021#define LCNPHY_TBL_ID_PAPDCOMPDELTATBL 0x18 1011#define LCNPHY_TBL_ID_PAPDCOMPDELTATBL 0x18
1022#define LCNPHY_TX_POWER_TABLE_SIZE 128 1012#define LCNPHY_TX_POWER_TABLE_SIZE 128
@@ -1030,26 +1020,24 @@ extern void wlc_phy_txpower_recalc_target(struct brcms_phy *pi);
1030 1020
1031#define LCNPHY_TX_PWR_CTRL_TEMPBASED 0xE001 1021#define LCNPHY_TX_PWR_CTRL_TEMPBASED 0xE001
1032 1022
1033extern void wlc_lcnphy_write_table(struct brcms_phy *pi, 1023void wlc_lcnphy_write_table(struct brcms_phy *pi,
1034 const struct phytbl_info *pti); 1024 const struct phytbl_info *pti);
1035extern void wlc_lcnphy_read_table(struct brcms_phy *pi, 1025void wlc_lcnphy_read_table(struct brcms_phy *pi, struct phytbl_info *pti);
1036 struct phytbl_info *pti); 1026void wlc_lcnphy_set_tx_iqcc(struct brcms_phy *pi, u16 a, u16 b);
1037extern void wlc_lcnphy_set_tx_iqcc(struct brcms_phy *pi, u16 a, u16 b); 1027void wlc_lcnphy_set_tx_locc(struct brcms_phy *pi, u16 didq);
1038extern void wlc_lcnphy_set_tx_locc(struct brcms_phy *pi, u16 didq); 1028void wlc_lcnphy_get_tx_iqcc(struct brcms_phy *pi, u16 *a, u16 *b);
1039extern void wlc_lcnphy_get_tx_iqcc(struct brcms_phy *pi, u16 *a, u16 *b); 1029u16 wlc_lcnphy_get_tx_locc(struct brcms_phy *pi);
1040extern u16 wlc_lcnphy_get_tx_locc(struct brcms_phy *pi); 1030void wlc_lcnphy_get_radio_loft(struct brcms_phy *pi, u8 *ei0, u8 *eq0, u8 *fi0,
1041extern void wlc_lcnphy_get_radio_loft(struct brcms_phy *pi, u8 *ei0, 1031 u8 *fq0);
1042 u8 *eq0, u8 *fi0, u8 *fq0); 1032void wlc_lcnphy_calib_modes(struct brcms_phy *pi, uint mode);
1043extern void wlc_lcnphy_calib_modes(struct brcms_phy *pi, uint mode); 1033void wlc_lcnphy_deaf_mode(struct brcms_phy *pi, bool mode);
1044extern void wlc_lcnphy_deaf_mode(struct brcms_phy *pi, bool mode); 1034bool wlc_phy_tpc_isenabled_lcnphy(struct brcms_phy *pi);
1045extern bool wlc_phy_tpc_isenabled_lcnphy(struct brcms_phy *pi); 1035void wlc_lcnphy_tx_pwr_update_npt(struct brcms_phy *pi);
1046extern void wlc_lcnphy_tx_pwr_update_npt(struct brcms_phy *pi); 1036s32 wlc_lcnphy_tssi2dbm(s32 tssi, s32 a1, s32 b0, s32 b1);
1047extern s32 wlc_lcnphy_tssi2dbm(s32 tssi, s32 a1, s32 b0, s32 b1); 1037void wlc_lcnphy_get_tssi(struct brcms_phy *pi, s8 *ofdm_pwr, s8 *cck_pwr);
1048extern void wlc_lcnphy_get_tssi(struct brcms_phy *pi, s8 *ofdm_pwr, 1038void wlc_lcnphy_tx_power_adjustment(struct brcms_phy_pub *ppi);
1049 s8 *cck_pwr); 1039
1050extern void wlc_lcnphy_tx_power_adjustment(struct brcms_phy_pub *ppi); 1040s32 wlc_lcnphy_rx_signal_power(struct brcms_phy *pi, s32 gain_index);
1051
1052extern s32 wlc_lcnphy_rx_signal_power(struct brcms_phy *pi, s32 gain_index);
1053 1041
1054#define NPHY_MAX_HPVGA1_INDEX 10 1042#define NPHY_MAX_HPVGA1_INDEX 10
1055#define NPHY_DEF_HPVGA1_INDEXLIMIT 7 1043#define NPHY_DEF_HPVGA1_INDEXLIMIT 7
@@ -1060,9 +1048,8 @@ struct phy_iq_est {
1060 u32 q_pwr; 1048 u32 q_pwr;
1061}; 1049};
1062 1050
1063extern void wlc_phy_stay_in_carriersearch_nphy(struct brcms_phy *pi, 1051void wlc_phy_stay_in_carriersearch_nphy(struct brcms_phy *pi, bool enable);
1064 bool enable); 1052void wlc_nphy_deaf_mode(struct brcms_phy *pi, bool mode);
1065extern void wlc_nphy_deaf_mode(struct brcms_phy *pi, bool mode);
1066 1053
1067#define wlc_phy_write_table_nphy(pi, pti) \ 1054#define wlc_phy_write_table_nphy(pi, pti) \
1068 wlc_phy_write_table(pi, pti, 0x72, 0x74, 0x73) 1055 wlc_phy_write_table(pi, pti, 0x72, 0x74, 0x73)
@@ -1076,10 +1063,10 @@ extern void wlc_nphy_deaf_mode(struct brcms_phy *pi, bool mode);
1076#define wlc_nphy_table_data_write(pi, w, v) \ 1063#define wlc_nphy_table_data_write(pi, w, v) \
1077 wlc_phy_table_data_write((pi), (w), (v)) 1064 wlc_phy_table_data_write((pi), (w), (v))
1078 1065
1079extern void wlc_phy_table_read_nphy(struct brcms_phy *pi, u32, u32 l, u32 o, 1066void wlc_phy_table_read_nphy(struct brcms_phy *pi, u32, u32 l, u32 o, u32 w,
1080 u32 w, void *d); 1067 void *d);
1081extern void wlc_phy_table_write_nphy(struct brcms_phy *pi, u32, u32, u32, 1068void wlc_phy_table_write_nphy(struct brcms_phy *pi, u32, u32, u32, u32,
1082 u32, const void *); 1069 const void *);
1083 1070
1084#define PHY_IPA(pi) \ 1071#define PHY_IPA(pi) \
1085 ((pi->ipa2g_on && CHSPEC_IS2G(pi->radio_chanspec)) || \ 1072 ((pi->ipa2g_on && CHSPEC_IS2G(pi->radio_chanspec)) || \
@@ -1089,73 +1076,67 @@ extern void wlc_phy_table_write_nphy(struct brcms_phy *pi, u32, u32, u32,
1089 if (NREV_LT((pi)->pubpi.phy_rev, 3)) \ 1076 if (NREV_LT((pi)->pubpi.phy_rev, 3)) \
1090 (void)bcma_read32(pi->d11core, D11REGOFFS(maccontrol)) 1077 (void)bcma_read32(pi->d11core, D11REGOFFS(maccontrol))
1091 1078
1092extern void wlc_phy_cal_perical_nphy_run(struct brcms_phy *pi, u8 caltype); 1079void wlc_phy_cal_perical_nphy_run(struct brcms_phy *pi, u8 caltype);
1093extern void wlc_phy_aci_reset_nphy(struct brcms_phy *pi); 1080void wlc_phy_aci_reset_nphy(struct brcms_phy *pi);
1094extern void wlc_phy_pa_override_nphy(struct brcms_phy *pi, bool en); 1081void wlc_phy_pa_override_nphy(struct brcms_phy *pi, bool en);
1095 1082
1096extern u8 wlc_phy_get_chan_freq_range_nphy(struct brcms_phy *pi, uint chan); 1083u8 wlc_phy_get_chan_freq_range_nphy(struct brcms_phy *pi, uint chan);
1097extern void wlc_phy_switch_radio_nphy(struct brcms_phy *pi, bool on); 1084void wlc_phy_switch_radio_nphy(struct brcms_phy *pi, bool on);
1098 1085
1099extern void wlc_phy_stf_chain_upd_nphy(struct brcms_phy *pi); 1086void wlc_phy_stf_chain_upd_nphy(struct brcms_phy *pi);
1100 1087
1101extern void wlc_phy_force_rfseq_nphy(struct brcms_phy *pi, u8 cmd); 1088void wlc_phy_force_rfseq_nphy(struct brcms_phy *pi, u8 cmd);
1102extern s16 wlc_phy_tempsense_nphy(struct brcms_phy *pi); 1089s16 wlc_phy_tempsense_nphy(struct brcms_phy *pi);
1103 1090
1104extern u16 wlc_phy_classifier_nphy(struct brcms_phy *pi, u16 mask, u16 val); 1091u16 wlc_phy_classifier_nphy(struct brcms_phy *pi, u16 mask, u16 val);
1105 1092
1106extern void wlc_phy_rx_iq_est_nphy(struct brcms_phy *pi, struct phy_iq_est *est, 1093void wlc_phy_rx_iq_est_nphy(struct brcms_phy *pi, struct phy_iq_est *est,
1107 u16 num_samps, u8 wait_time, 1094 u16 num_samps, u8 wait_time, u8 wait_for_crs);
1108 u8 wait_for_crs); 1095
1109 1096void wlc_phy_rx_iq_coeffs_nphy(struct brcms_phy *pi, u8 write,
1110extern void wlc_phy_rx_iq_coeffs_nphy(struct brcms_phy *pi, u8 write, 1097 struct nphy_iq_comp *comp);
1111 struct nphy_iq_comp *comp); 1098void wlc_phy_aci_and_noise_reduction_nphy(struct brcms_phy *pi);
1112extern void wlc_phy_aci_and_noise_reduction_nphy(struct brcms_phy *pi); 1099
1113 1100void wlc_phy_rxcore_setstate_nphy(struct brcms_phy_pub *pih, u8 rxcore_bitmask);
1114extern void wlc_phy_rxcore_setstate_nphy(struct brcms_phy_pub *pih, 1101u8 wlc_phy_rxcore_getstate_nphy(struct brcms_phy_pub *pih);
1115 u8 rxcore_bitmask); 1102
1116extern u8 wlc_phy_rxcore_getstate_nphy(struct brcms_phy_pub *pih); 1103void wlc_phy_txpwrctrl_enable_nphy(struct brcms_phy *pi, u8 ctrl_type);
1117 1104void wlc_phy_txpwr_fixpower_nphy(struct brcms_phy *pi);
1118extern void wlc_phy_txpwrctrl_enable_nphy(struct brcms_phy *pi, u8 ctrl_type); 1105void wlc_phy_txpwr_apply_nphy(struct brcms_phy *pi);
1119extern void wlc_phy_txpwr_fixpower_nphy(struct brcms_phy *pi); 1106void wlc_phy_txpwr_papd_cal_nphy(struct brcms_phy *pi);
1120extern void wlc_phy_txpwr_apply_nphy(struct brcms_phy *pi); 1107u16 wlc_phy_txpwr_idx_get_nphy(struct brcms_phy *pi);
1121extern void wlc_phy_txpwr_papd_cal_nphy(struct brcms_phy *pi); 1108
1122extern u16 wlc_phy_txpwr_idx_get_nphy(struct brcms_phy *pi); 1109struct nphy_txgains wlc_phy_get_tx_gain_nphy(struct brcms_phy *pi);
1123 1110int wlc_phy_cal_txiqlo_nphy(struct brcms_phy *pi,
1124extern struct nphy_txgains wlc_phy_get_tx_gain_nphy(struct brcms_phy *pi); 1111 struct nphy_txgains target_gain, bool full, bool m);
1125extern int wlc_phy_cal_txiqlo_nphy(struct brcms_phy *pi, 1112int wlc_phy_cal_rxiq_nphy(struct brcms_phy *pi, struct nphy_txgains target_gain,
1126 struct nphy_txgains target_gain, 1113 u8 type, bool d);
1127 bool full, bool m); 1114void wlc_phy_txpwr_index_nphy(struct brcms_phy *pi, u8 core_mask,
1128extern int wlc_phy_cal_rxiq_nphy(struct brcms_phy *pi, 1115 s8 txpwrindex, bool res);
1129 struct nphy_txgains target_gain, 1116void wlc_phy_rssisel_nphy(struct brcms_phy *pi, u8 core, u8 rssi_type);
1130 u8 type, bool d); 1117int wlc_phy_poll_rssi_nphy(struct brcms_phy *pi, u8 rssi_type,
1131extern void wlc_phy_txpwr_index_nphy(struct brcms_phy *pi, u8 core_mask, 1118 s32 *rssi_buf, u8 nsamps);
1132 s8 txpwrindex, bool res); 1119void wlc_phy_rssi_cal_nphy(struct brcms_phy *pi);
1133extern void wlc_phy_rssisel_nphy(struct brcms_phy *pi, u8 core, u8 rssi_type); 1120int wlc_phy_aci_scan_nphy(struct brcms_phy *pi);
1134extern int wlc_phy_poll_rssi_nphy(struct brcms_phy *pi, u8 rssi_type, 1121void wlc_phy_cal_txgainctrl_nphy(struct brcms_phy *pi, s32 dBm_targetpower,
1135 s32 *rssi_buf, u8 nsamps); 1122 bool debug);
1136extern void wlc_phy_rssi_cal_nphy(struct brcms_phy *pi); 1123int wlc_phy_tx_tone_nphy(struct brcms_phy *pi, u32 f_kHz, u16 max_val, u8 mode,
1137extern int wlc_phy_aci_scan_nphy(struct brcms_phy *pi); 1124 u8, bool);
1138extern void wlc_phy_cal_txgainctrl_nphy(struct brcms_phy *pi, 1125void wlc_phy_stopplayback_nphy(struct brcms_phy *pi);
1139 s32 dBm_targetpower, bool debug); 1126void wlc_phy_est_tonepwr_nphy(struct brcms_phy *pi, s32 *qdBm_pwrbuf,
1140extern int wlc_phy_tx_tone_nphy(struct brcms_phy *pi, u32 f_kHz, u16 max_val, 1127 u8 num_samps);
1141 u8 mode, u8, bool); 1128void wlc_phy_radio205x_vcocal_nphy(struct brcms_phy *pi);
1142extern void wlc_phy_stopplayback_nphy(struct brcms_phy *pi); 1129
1143extern void wlc_phy_est_tonepwr_nphy(struct brcms_phy *pi, s32 *qdBm_pwrbuf, 1130int wlc_phy_rssi_compute_nphy(struct brcms_phy *pi, struct d11rxhdr *rxh);
1144 u8 num_samps);
1145extern void wlc_phy_radio205x_vcocal_nphy(struct brcms_phy *pi);
1146
1147extern int wlc_phy_rssi_compute_nphy(struct brcms_phy *pi,
1148 struct d11rxhdr *rxh);
1149 1131
1150#define NPHY_TESTPATTERN_BPHY_EVM 0 1132#define NPHY_TESTPATTERN_BPHY_EVM 0
1151#define NPHY_TESTPATTERN_BPHY_RFCS 1 1133#define NPHY_TESTPATTERN_BPHY_RFCS 1
1152 1134
1153extern void wlc_phy_nphy_tkip_rifs_war(struct brcms_phy *pi, u8 rifs); 1135void wlc_phy_nphy_tkip_rifs_war(struct brcms_phy *pi, u8 rifs);
1154 1136
1155void wlc_phy_get_pwrdet_offsets(struct brcms_phy *pi, s8 *cckoffset, 1137void wlc_phy_get_pwrdet_offsets(struct brcms_phy *pi, s8 *cckoffset,
1156 s8 *ofdmoffset); 1138 s8 *ofdmoffset);
1157extern s8 wlc_phy_upd_rssi_offset(struct brcms_phy *pi, s8 rssi, 1139s8 wlc_phy_upd_rssi_offset(struct brcms_phy *pi, s8 rssi, u16 chanspec);
1158 u16 chanspec);
1159 1140
1160extern bool wlc_phy_n_txpower_ipa_ison(struct brcms_phy *pih); 1141bool wlc_phy_n_txpower_ipa_ison(struct brcms_phy *pih);
1161#endif /* _BRCM_PHY_INT_H_ */ 1142#endif /* _BRCM_PHY_INT_H_ */
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/phy_shim.h b/drivers/net/wireless/brcm80211/brcmsmac/phy_shim.h
index 2c5b66b75970..dd8774717ade 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/phy_shim.h
+++ b/drivers/net/wireless/brcm80211/brcmsmac/phy_shim.h
@@ -124,56 +124,49 @@
124 124
125struct brcms_phy; 125struct brcms_phy;
126 126
127extern struct phy_shim_info *wlc_phy_shim_attach(struct brcms_hardware *wlc_hw, 127struct phy_shim_info *wlc_phy_shim_attach(struct brcms_hardware *wlc_hw,
128 struct brcms_info *wl, 128 struct brcms_info *wl,
129 struct brcms_c_info *wlc); 129 struct brcms_c_info *wlc);
130extern void wlc_phy_shim_detach(struct phy_shim_info *physhim); 130void wlc_phy_shim_detach(struct phy_shim_info *physhim);
131 131
132/* PHY to WL utility functions */ 132/* PHY to WL utility functions */
133extern struct wlapi_timer *wlapi_init_timer(struct phy_shim_info *physhim, 133struct wlapi_timer *wlapi_init_timer(struct phy_shim_info *physhim,
134 void (*fn) (struct brcms_phy *pi), 134 void (*fn)(struct brcms_phy *pi),
135 void *arg, const char *name); 135 void *arg, const char *name);
136extern void wlapi_free_timer(struct wlapi_timer *t); 136void wlapi_free_timer(struct wlapi_timer *t);
137extern void wlapi_add_timer(struct wlapi_timer *t, uint ms, int periodic); 137void wlapi_add_timer(struct wlapi_timer *t, uint ms, int periodic);
138extern bool wlapi_del_timer(struct wlapi_timer *t); 138bool wlapi_del_timer(struct wlapi_timer *t);
139extern void wlapi_intrson(struct phy_shim_info *physhim); 139void wlapi_intrson(struct phy_shim_info *physhim);
140extern u32 wlapi_intrsoff(struct phy_shim_info *physhim); 140u32 wlapi_intrsoff(struct phy_shim_info *physhim);
141extern void wlapi_intrsrestore(struct phy_shim_info *physhim, 141void wlapi_intrsrestore(struct phy_shim_info *physhim, u32 macintmask);
142 u32 macintmask); 142
143 143void wlapi_bmac_write_shm(struct phy_shim_info *physhim, uint offset, u16 v);
144extern void wlapi_bmac_write_shm(struct phy_shim_info *physhim, uint offset, 144u16 wlapi_bmac_read_shm(struct phy_shim_info *physhim, uint offset);
145 u16 v); 145void wlapi_bmac_mhf(struct phy_shim_info *physhim, u8 idx, u16 mask, u16 val,
146extern u16 wlapi_bmac_read_shm(struct phy_shim_info *physhim, uint offset); 146 int bands);
147extern void wlapi_bmac_mhf(struct phy_shim_info *physhim, u8 idx, 147void wlapi_bmac_corereset(struct phy_shim_info *physhim, u32 flags);
148 u16 mask, u16 val, int bands); 148void wlapi_suspend_mac_and_wait(struct phy_shim_info *physhim);
149extern void wlapi_bmac_corereset(struct phy_shim_info *physhim, u32 flags); 149void wlapi_switch_macfreq(struct phy_shim_info *physhim, u8 spurmode);
150extern void wlapi_suspend_mac_and_wait(struct phy_shim_info *physhim); 150void wlapi_enable_mac(struct phy_shim_info *physhim);
151extern void wlapi_switch_macfreq(struct phy_shim_info *physhim, u8 spurmode); 151void wlapi_bmac_mctrl(struct phy_shim_info *physhim, u32 mask, u32 val);
152extern void wlapi_enable_mac(struct phy_shim_info *physhim); 152void wlapi_bmac_phy_reset(struct phy_shim_info *physhim);
153extern void wlapi_bmac_mctrl(struct phy_shim_info *physhim, u32 mask, 153void wlapi_bmac_bw_set(struct phy_shim_info *physhim, u16 bw);
154 u32 val); 154void wlapi_bmac_phyclk_fgc(struct phy_shim_info *physhim, bool clk);
155extern void wlapi_bmac_phy_reset(struct phy_shim_info *physhim); 155void wlapi_bmac_macphyclk_set(struct phy_shim_info *physhim, bool clk);
156extern void wlapi_bmac_bw_set(struct phy_shim_info *physhim, u16 bw); 156void wlapi_bmac_core_phypll_ctl(struct phy_shim_info *physhim, bool on);
157extern void wlapi_bmac_phyclk_fgc(struct phy_shim_info *physhim, bool clk); 157void wlapi_bmac_core_phypll_reset(struct phy_shim_info *physhim);
158extern void wlapi_bmac_macphyclk_set(struct phy_shim_info *physhim, bool clk); 158void wlapi_bmac_ucode_wake_override_phyreg_set(struct phy_shim_info *physhim);
159extern void wlapi_bmac_core_phypll_ctl(struct phy_shim_info *physhim, bool on); 159void wlapi_bmac_ucode_wake_override_phyreg_clear(struct phy_shim_info *physhim);
160extern void wlapi_bmac_core_phypll_reset(struct phy_shim_info *physhim); 160void wlapi_bmac_write_template_ram(struct phy_shim_info *physhim, int o,
161extern void wlapi_bmac_ucode_wake_override_phyreg_set(struct phy_shim_info * 161 int len, void *buf);
162 physhim); 162u16 wlapi_bmac_rate_shm_offset(struct phy_shim_info *physhim, u8 rate);
163extern void wlapi_bmac_ucode_wake_override_phyreg_clear(struct phy_shim_info * 163void wlapi_ucode_sample_init(struct phy_shim_info *physhim);
164 physhim); 164void wlapi_copyfrom_objmem(struct phy_shim_info *physhim, uint, void *buf,
165extern void wlapi_bmac_write_template_ram(struct phy_shim_info *physhim, int o, 165 int, u32 sel);
166 int len, void *buf); 166void wlapi_copyto_objmem(struct phy_shim_info *physhim, uint, const void *buf,
167extern u16 wlapi_bmac_rate_shm_offset(struct phy_shim_info *physhim, 167 int, u32);
168 u8 rate); 168
169extern void wlapi_ucode_sample_init(struct phy_shim_info *physhim); 169void wlapi_high_update_phy_mode(struct phy_shim_info *physhim, u32 phy_mode);
170extern void wlapi_copyfrom_objmem(struct phy_shim_info *physhim, uint, 170u16 wlapi_bmac_get_txant(struct phy_shim_info *physhim);
171 void *buf, int, u32 sel);
172extern void wlapi_copyto_objmem(struct phy_shim_info *physhim, uint,
173 const void *buf, int, u32);
174
175extern void wlapi_high_update_phy_mode(struct phy_shim_info *physhim,
176 u32 phy_mode);
177extern u16 wlapi_bmac_get_txant(struct phy_shim_info *physhim);
178 171
179#endif /* _BRCM_PHY_SHIM_H_ */ 172#endif /* _BRCM_PHY_SHIM_H_ */
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/pmu.h b/drivers/net/wireless/brcm80211/brcmsmac/pmu.h
index 20e2012d5a3a..a014bbc4f935 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/pmu.h
+++ b/drivers/net/wireless/brcm80211/brcmsmac/pmu.h
@@ -20,7 +20,7 @@
20 20
21#include "types.h" 21#include "types.h"
22 22
23extern u16 si_pmu_fast_pwrup_delay(struct si_pub *sih); 23u16 si_pmu_fast_pwrup_delay(struct si_pub *sih);
24extern u32 si_pmu_measure_alpclk(struct si_pub *sih); 24u32 si_pmu_measure_alpclk(struct si_pub *sih);
25 25
26#endif /* _BRCM_PMU_H_ */ 26#endif /* _BRCM_PMU_H_ */
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/pub.h b/drivers/net/wireless/brcm80211/brcmsmac/pub.h
index d36ea5e1cc49..4da38cb4f318 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/pub.h
+++ b/drivers/net/wireless/brcm80211/brcmsmac/pub.h
@@ -266,83 +266,76 @@ struct brcms_antselcfg {
266}; 266};
267 267
268/* common functions for every port */ 268/* common functions for every port */
269extern struct brcms_c_info * 269struct brcms_c_info *brcms_c_attach(struct brcms_info *wl,
270brcms_c_attach(struct brcms_info *wl, struct bcma_device *core, uint unit, 270 struct bcma_device *core, uint unit,
271 bool piomode, uint *perr); 271 bool piomode, uint *perr);
272extern uint brcms_c_detach(struct brcms_c_info *wlc); 272uint brcms_c_detach(struct brcms_c_info *wlc);
273extern int brcms_c_up(struct brcms_c_info *wlc); 273int brcms_c_up(struct brcms_c_info *wlc);
274extern uint brcms_c_down(struct brcms_c_info *wlc); 274uint brcms_c_down(struct brcms_c_info *wlc);
275 275
276extern bool brcms_c_chipmatch(struct bcma_device *core); 276bool brcms_c_chipmatch(struct bcma_device *core);
277extern void brcms_c_init(struct brcms_c_info *wlc, bool mute_tx); 277void brcms_c_init(struct brcms_c_info *wlc, bool mute_tx);
278extern void brcms_c_reset(struct brcms_c_info *wlc); 278void brcms_c_reset(struct brcms_c_info *wlc);
279 279
280extern void brcms_c_intrson(struct brcms_c_info *wlc); 280void brcms_c_intrson(struct brcms_c_info *wlc);
281extern u32 brcms_c_intrsoff(struct brcms_c_info *wlc); 281u32 brcms_c_intrsoff(struct brcms_c_info *wlc);
282extern void brcms_c_intrsrestore(struct brcms_c_info *wlc, u32 macintmask); 282void brcms_c_intrsrestore(struct brcms_c_info *wlc, u32 macintmask);
283extern bool brcms_c_intrsupd(struct brcms_c_info *wlc); 283bool brcms_c_intrsupd(struct brcms_c_info *wlc);
284extern bool brcms_c_isr(struct brcms_c_info *wlc); 284bool brcms_c_isr(struct brcms_c_info *wlc);
285extern bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded); 285bool brcms_c_dpc(struct brcms_c_info *wlc, bool bounded);
286extern bool brcms_c_sendpkt_mac80211(struct brcms_c_info *wlc, 286bool brcms_c_sendpkt_mac80211(struct brcms_c_info *wlc, struct sk_buff *sdu,
287 struct sk_buff *sdu, 287 struct ieee80211_hw *hw);
288 struct ieee80211_hw *hw); 288bool brcms_c_aggregatable(struct brcms_c_info *wlc, u8 tid);
289extern bool brcms_c_aggregatable(struct brcms_c_info *wlc, u8 tid); 289void brcms_c_protection_upd(struct brcms_c_info *wlc, uint idx, int val);
290extern void brcms_c_protection_upd(struct brcms_c_info *wlc, uint idx, 290int brcms_c_get_header_len(void);
291 int val); 291void brcms_c_set_addrmatch(struct brcms_c_info *wlc, int match_reg_offset,
292extern int brcms_c_get_header_len(void); 292 const u8 *addr);
293extern void brcms_c_set_addrmatch(struct brcms_c_info *wlc, 293void brcms_c_wme_setparams(struct brcms_c_info *wlc, u16 aci,
294 int match_reg_offset, 294 const struct ieee80211_tx_queue_params *arg,
295 const u8 *addr); 295 bool suspend);
296extern void brcms_c_wme_setparams(struct brcms_c_info *wlc, u16 aci, 296struct brcms_pub *brcms_c_pub(struct brcms_c_info *wlc);
297 const struct ieee80211_tx_queue_params *arg, 297void brcms_c_ampdu_flush(struct brcms_c_info *wlc, struct ieee80211_sta *sta,
298 bool suspend); 298 u16 tid);
299extern struct brcms_pub *brcms_c_pub(struct brcms_c_info *wlc); 299void brcms_c_ampdu_tx_operational(struct brcms_c_info *wlc, u8 tid,
300extern void brcms_c_ampdu_flush(struct brcms_c_info *wlc, 300 u8 ba_wsize, uint max_rx_ampdu_bytes);
301 struct ieee80211_sta *sta, u16 tid); 301int brcms_c_module_register(struct brcms_pub *pub, const char *name,
302extern void brcms_c_ampdu_tx_operational(struct brcms_c_info *wlc, u8 tid, 302 struct brcms_info *hdl,
303 u8 ba_wsize, uint max_rx_ampdu_bytes); 303 int (*down_fn)(void *handle));
304extern int brcms_c_module_register(struct brcms_pub *pub, 304int brcms_c_module_unregister(struct brcms_pub *pub, const char *name,
305 const char *name, struct brcms_info *hdl, 305 struct brcms_info *hdl);
306 int (*down_fn)(void *handle)); 306void brcms_c_suspend_mac_and_wait(struct brcms_c_info *wlc);
307extern int brcms_c_module_unregister(struct brcms_pub *pub, const char *name, 307void brcms_c_enable_mac(struct brcms_c_info *wlc);
308 struct brcms_info *hdl); 308void brcms_c_associate_upd(struct brcms_c_info *wlc, bool state);
309extern void brcms_c_suspend_mac_and_wait(struct brcms_c_info *wlc); 309void brcms_c_scan_start(struct brcms_c_info *wlc);
310extern void brcms_c_enable_mac(struct brcms_c_info *wlc); 310void brcms_c_scan_stop(struct brcms_c_info *wlc);
311extern void brcms_c_associate_upd(struct brcms_c_info *wlc, bool state); 311int brcms_c_get_curband(struct brcms_c_info *wlc);
312extern void brcms_c_scan_start(struct brcms_c_info *wlc); 312int brcms_c_set_channel(struct brcms_c_info *wlc, u16 channel);
313extern void brcms_c_scan_stop(struct brcms_c_info *wlc); 313int brcms_c_set_rate_limit(struct brcms_c_info *wlc, u16 srl, u16 lrl);
314extern int brcms_c_get_curband(struct brcms_c_info *wlc); 314void brcms_c_get_current_rateset(struct brcms_c_info *wlc,
315extern int brcms_c_set_channel(struct brcms_c_info *wlc, u16 channel);
316extern int brcms_c_set_rate_limit(struct brcms_c_info *wlc, u16 srl, u16 lrl);
317extern void brcms_c_get_current_rateset(struct brcms_c_info *wlc,
318 struct brcm_rateset *currs); 315 struct brcm_rateset *currs);
319extern int brcms_c_set_rateset(struct brcms_c_info *wlc, 316int brcms_c_set_rateset(struct brcms_c_info *wlc, struct brcm_rateset *rs);
320 struct brcm_rateset *rs); 317int brcms_c_set_beacon_period(struct brcms_c_info *wlc, u16 period);
321extern int brcms_c_set_beacon_period(struct brcms_c_info *wlc, u16 period); 318u16 brcms_c_get_phy_type(struct brcms_c_info *wlc, int phyidx);
322extern u16 brcms_c_get_phy_type(struct brcms_c_info *wlc, int phyidx); 319void brcms_c_set_shortslot_override(struct brcms_c_info *wlc,
323extern void brcms_c_set_shortslot_override(struct brcms_c_info *wlc,
324 s8 sslot_override); 320 s8 sslot_override);
325extern void brcms_c_set_beacon_listen_interval(struct brcms_c_info *wlc, 321void brcms_c_set_beacon_listen_interval(struct brcms_c_info *wlc, u8 interval);
326 u8 interval); 322u64 brcms_c_tsf_get(struct brcms_c_info *wlc);
327extern u64 brcms_c_tsf_get(struct brcms_c_info *wlc); 323void brcms_c_tsf_set(struct brcms_c_info *wlc, u64 tsf);
328extern void brcms_c_tsf_set(struct brcms_c_info *wlc, u64 tsf); 324int brcms_c_set_tx_power(struct brcms_c_info *wlc, int txpwr);
329extern int brcms_c_set_tx_power(struct brcms_c_info *wlc, int txpwr); 325int brcms_c_get_tx_power(struct brcms_c_info *wlc);
330extern int brcms_c_get_tx_power(struct brcms_c_info *wlc); 326bool brcms_c_check_radio_disabled(struct brcms_c_info *wlc);
331extern bool brcms_c_check_radio_disabled(struct brcms_c_info *wlc); 327void brcms_c_mute(struct brcms_c_info *wlc, bool on);
332extern void brcms_c_mute(struct brcms_c_info *wlc, bool on); 328bool brcms_c_tx_flush_completed(struct brcms_c_info *wlc);
333extern bool brcms_c_tx_flush_completed(struct brcms_c_info *wlc); 329void brcms_c_start_station(struct brcms_c_info *wlc, u8 *addr);
334extern void brcms_c_start_station(struct brcms_c_info *wlc, u8 *addr); 330void brcms_c_start_ap(struct brcms_c_info *wlc, u8 *addr, const u8 *bssid,
335extern void brcms_c_start_ap(struct brcms_c_info *wlc, u8 *addr, 331 u8 *ssid, size_t ssid_len);
336 const u8 *bssid, u8 *ssid, size_t ssid_len); 332void brcms_c_start_adhoc(struct brcms_c_info *wlc, u8 *addr);
337extern void brcms_c_start_adhoc(struct brcms_c_info *wlc, u8 *addr); 333void brcms_c_update_beacon(struct brcms_c_info *wlc);
338extern void brcms_c_update_beacon(struct brcms_c_info *wlc); 334void brcms_c_set_new_beacon(struct brcms_c_info *wlc, struct sk_buff *beacon,
339extern void brcms_c_set_new_beacon(struct brcms_c_info *wlc, 335 u16 tim_offset, u16 dtim_period);
340 struct sk_buff *beacon, u16 tim_offset, 336void brcms_c_set_new_probe_resp(struct brcms_c_info *wlc,
341 u16 dtim_period); 337 struct sk_buff *probe_resp);
342extern void brcms_c_set_new_probe_resp(struct brcms_c_info *wlc, 338void brcms_c_enable_probe_resp(struct brcms_c_info *wlc, bool enable);
343 struct sk_buff *probe_resp); 339void brcms_c_set_ssid(struct brcms_c_info *wlc, u8 *ssid, size_t ssid_len);
344extern void brcms_c_enable_probe_resp(struct brcms_c_info *wlc, bool enable);
345extern void brcms_c_set_ssid(struct brcms_c_info *wlc, u8 *ssid,
346 size_t ssid_len);
347 340
348#endif /* _BRCM_PUB_H_ */ 341#endif /* _BRCM_PUB_H_ */
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/rate.h b/drivers/net/wireless/brcm80211/brcmsmac/rate.h
index 980d578825cc..5bb88b78ed64 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/rate.h
+++ b/drivers/net/wireless/brcm80211/brcmsmac/rate.h
@@ -216,34 +216,30 @@ static inline u8 cck_phy2mac_rate(u8 signal)
216 216
217/* sanitize, and sort a rateset with the basic bit(s) preserved, validate 217/* sanitize, and sort a rateset with the basic bit(s) preserved, validate
218 * rateset */ 218 * rateset */
219extern bool 219bool brcms_c_rate_hwrs_filter_sort_validate(struct brcms_c_rateset *rs,
220brcms_c_rate_hwrs_filter_sort_validate(struct brcms_c_rateset *rs, 220 const struct brcms_c_rateset *hw_rs,
221 const struct brcms_c_rateset *hw_rs, 221 bool check_brate, u8 txstreams);
222 bool check_brate, u8 txstreams);
223/* copy rateset src to dst as-is (no masking or sorting) */ 222/* copy rateset src to dst as-is (no masking or sorting) */
224extern void brcms_c_rateset_copy(const struct brcms_c_rateset *src, 223void brcms_c_rateset_copy(const struct brcms_c_rateset *src,
225 struct brcms_c_rateset *dst); 224 struct brcms_c_rateset *dst);
226 225
227/* would be nice to have these documented ... */ 226/* would be nice to have these documented ... */
228extern u32 brcms_c_compute_rspec(struct d11rxhdr *rxh, u8 *plcp); 227u32 brcms_c_compute_rspec(struct d11rxhdr *rxh, u8 *plcp);
229 228
230extern void brcms_c_rateset_filter(struct brcms_c_rateset *src, 229void brcms_c_rateset_filter(struct brcms_c_rateset *src,
231 struct brcms_c_rateset *dst, bool basic_only, u8 rates, uint xmask, 230 struct brcms_c_rateset *dst, bool basic_only,
232 bool mcsallow); 231 u8 rates, uint xmask, bool mcsallow);
233 232
234extern void 233void brcms_c_rateset_default(struct brcms_c_rateset *rs_tgt,
235brcms_c_rateset_default(struct brcms_c_rateset *rs_tgt, 234 const struct brcms_c_rateset *rs_hw, uint phy_type,
236 const struct brcms_c_rateset *rs_hw, uint phy_type, 235 int bandtype, bool cck_only, uint rate_mask,
237 int bandtype, bool cck_only, uint rate_mask, 236 bool mcsallow, u8 bw, u8 txstreams);
238 bool mcsallow, u8 bw, u8 txstreams); 237
239 238s16 brcms_c_rate_legacy_phyctl(uint rate);
240extern s16 brcms_c_rate_legacy_phyctl(uint rate); 239
241 240void brcms_c_rateset_mcs_upd(struct brcms_c_rateset *rs, u8 txstreams);
242extern void brcms_c_rateset_mcs_upd(struct brcms_c_rateset *rs, u8 txstreams); 241void brcms_c_rateset_mcs_clear(struct brcms_c_rateset *rateset);
243extern void brcms_c_rateset_mcs_clear(struct brcms_c_rateset *rateset); 242void brcms_c_rateset_mcs_build(struct brcms_c_rateset *rateset, u8 txstreams);
244extern void brcms_c_rateset_mcs_build(struct brcms_c_rateset *rateset, 243void brcms_c_rateset_bw_mcs_filter(struct brcms_c_rateset *rateset, u8 bw);
245 u8 txstreams);
246extern void brcms_c_rateset_bw_mcs_filter(struct brcms_c_rateset *rateset,
247 u8 bw);
248 244
249#endif /* _BRCM_RATE_H_ */ 245#endif /* _BRCM_RATE_H_ */
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/stf.h b/drivers/net/wireless/brcm80211/brcmsmac/stf.h
index 19f6580f69be..ba9493009a33 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/stf.h
+++ b/drivers/net/wireless/brcm80211/brcmsmac/stf.h
@@ -19,24 +19,19 @@
19 19
20#include "types.h" 20#include "types.h"
21 21
22extern int brcms_c_stf_attach(struct brcms_c_info *wlc); 22int brcms_c_stf_attach(struct brcms_c_info *wlc);
23extern void brcms_c_stf_detach(struct brcms_c_info *wlc); 23void brcms_c_stf_detach(struct brcms_c_info *wlc);
24 24
25extern void brcms_c_tempsense_upd(struct brcms_c_info *wlc); 25void brcms_c_tempsense_upd(struct brcms_c_info *wlc);
26extern void brcms_c_stf_ss_algo_channel_get(struct brcms_c_info *wlc, 26void brcms_c_stf_ss_algo_channel_get(struct brcms_c_info *wlc,
27 u16 *ss_algo_channel, 27 u16 *ss_algo_channel, u16 chanspec);
28 u16 chanspec); 28int brcms_c_stf_ss_update(struct brcms_c_info *wlc, struct brcms_band *band);
29extern int brcms_c_stf_ss_update(struct brcms_c_info *wlc, 29void brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc);
30 struct brcms_band *band); 30int brcms_c_stf_txchain_set(struct brcms_c_info *wlc, s32 int_val, bool force);
31extern void brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc); 31bool brcms_c_stf_stbc_rx_set(struct brcms_c_info *wlc, s32 int_val);
32extern int brcms_c_stf_txchain_set(struct brcms_c_info *wlc, s32 int_val, 32void brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc);
33 bool force); 33void brcms_c_stf_phy_chain_calc(struct brcms_c_info *wlc);
34extern bool brcms_c_stf_stbc_rx_set(struct brcms_c_info *wlc, s32 int_val); 34u16 brcms_c_stf_phytxchain_sel(struct brcms_c_info *wlc, u32 rspec);
35extern void brcms_c_stf_phy_txant_upd(struct brcms_c_info *wlc); 35u16 brcms_c_stf_d11hdrs_phyctl_txant(struct brcms_c_info *wlc, u32 rspec);
36extern void brcms_c_stf_phy_chain_calc(struct brcms_c_info *wlc);
37extern u16 brcms_c_stf_phytxchain_sel(struct brcms_c_info *wlc,
38 u32 rspec);
39extern u16 brcms_c_stf_d11hdrs_phyctl_txant(struct brcms_c_info *wlc,
40 u32 rspec);
41 36
42#endif /* _BRCM_STF_H_ */ 37#endif /* _BRCM_STF_H_ */
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/ucode_loader.h b/drivers/net/wireless/brcm80211/brcmsmac/ucode_loader.h
index 18750a814b4f..c87dd89bcb78 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/ucode_loader.h
+++ b/drivers/net/wireless/brcm80211/brcmsmac/ucode_loader.h
@@ -43,16 +43,14 @@ struct brcms_ucode {
43 u32 *bcm43xx_bomminor; 43 u32 *bcm43xx_bomminor;
44}; 44};
45 45
46extern int 46int brcms_ucode_data_init(struct brcms_info *wl, struct brcms_ucode *ucode);
47brcms_ucode_data_init(struct brcms_info *wl, struct brcms_ucode *ucode);
48 47
49extern void brcms_ucode_data_free(struct brcms_ucode *ucode); 48void brcms_ucode_data_free(struct brcms_ucode *ucode);
50 49
51extern int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf, 50int brcms_ucode_init_buf(struct brcms_info *wl, void **pbuf, unsigned int idx);
52 unsigned int idx); 51int brcms_ucode_init_uint(struct brcms_info *wl, size_t *n_bytes,
53extern int brcms_ucode_init_uint(struct brcms_info *wl, size_t *n_bytes, 52 unsigned int idx);
54 unsigned int idx); 53void brcms_ucode_free_buf(void *);
55extern void brcms_ucode_free_buf(void *); 54int brcms_check_firmwares(struct brcms_info *wl);
56extern int brcms_check_firmwares(struct brcms_info *wl);
57 55
58#endif /* _BRCM_UCODE_H_ */ 56#endif /* _BRCM_UCODE_H_ */