2 * Copyright (c) 2010 Broadcom Corporation
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
20 #include <linux/etherdevice.h>
22 #include <brcmu_utils.h>
27 #define INVCHANNEL 255 /* invalid channel */
29 /* max # brcms_c_module_register() calls */
30 #define BRCMS_MAXMODULES 22
32 #define SEQNUM_SHIFT 4
33 #define SEQNUM_MAX 0x1000
35 #define NTXRATE 64 /* # tx MPDUs rate is reported for */
37 /* Maximum wait time for a MAC suspend */
38 /* uS: 83mS is max packet time (64KB ampdu @ 6Mbps) */
39 #define BRCMS_MAX_MAC_SUSPEND 83000
41 /* responses for probe requests older that this are tossed, zero to disable */
42 #define BRCMS_PRB_RESP_TIMEOUT 0 /* Disable probe response timeout */
44 /* transmit buffer max headroom for protocol headers */
45 #define TXOFF (D11_TXH_LEN + D11_PHY_HDR_LEN)
49 /* Macros for doing definition and get/set of bitfields
50 * Usage example, e.g. a three-bit field (bits 4-6):
51 * #define <NAME>_M BITFIELD_MASK(3)
54 * regval = R_REG(osh, ®s->regfoo);
55 * field = GFIELD(regval, <NAME>);
56 * regval = SFIELD(regval, <NAME>, 1);
57 * W_REG(osh, ®s->regfoo, regval);
59 #define BITFIELD_MASK(width) \
60 (((unsigned)1 << (width)) - 1)
61 #define GFIELD(val, field) \
62 (((val) >> field ## _S) & field ## _M)
63 #define SFIELD(val, field, bits) \
64 (((val) & (~(field ## _M << field ## _S))) | \
65 ((unsigned)(bits) << field ## _S))
67 #define SW_TIMER_MAC_STAT_UPD 30 /* periodic MAC stats update */
69 /* max # supported core revisions (0 .. MAXCOREREV - 1) */
72 /* Double check that unsupported cores are not enabled */
73 #if CONF_MSK(D11CONF, 0x4f) || CONF_GE(D11CONF, MAXCOREREV)
74 #error "Configuration for D11CONF includes unsupported versions."
75 #endif /* Bad versions */
77 /* values for shortslot_override */
78 #define BRCMS_SHORTSLOT_AUTO -1 /* Driver will manage Shortslot setting */
79 #define BRCMS_SHORTSLOT_OFF 0 /* Turn off short slot */
80 #define BRCMS_SHORTSLOT_ON 1 /* Turn on short slot */
82 /* value for short/long and mixmode/greenfield preamble */
83 #define BRCMS_LONG_PREAMBLE (0)
84 #define BRCMS_SHORT_PREAMBLE (1 << 0)
85 #define BRCMS_GF_PREAMBLE (1 << 1)
86 #define BRCMS_MM_PREAMBLE (1 << 2)
87 #define BRCMS_IS_MIMO_PREAMBLE(_pre) (((_pre) == BRCMS_GF_PREAMBLE) || \
88 ((_pre) == BRCMS_MM_PREAMBLE))
91 /* seq and frag bits: SEQNUM_SHIFT, FRAGNUM_MASK (802.11.h) */
92 /* rate epoch bits: TXFID_RATE_SHIFT, TXFID_RATE_MASK ((wlc_rate.c) */
93 #define TXFID_QUEUE_MASK 0x0007 /* Bits 0-2 */
94 #define TXFID_SEQ_MASK 0x7FE0 /* Bits 5-15 */
95 #define TXFID_SEQ_SHIFT 5 /* Number of bit shifts */
96 #define TXFID_RATE_PROBE_MASK 0x8000 /* Bit 15 for rate probe */
97 #define TXFID_RATE_MASK 0x0018 /* Mask for bits 3 and 4 */
98 #define TXFID_RATE_SHIFT 3 /* Shift 3 bits for rate mask */
100 /* promote boardrev */
101 #define BOARDREV_PROMOTABLE 0xFF /* from */
102 #define BOARDREV_PROMOTED 1 /* to */
104 #define DATA_BLOCK_TX_SUPR (1 << 4)
106 /* 802.1D Priority to TX FIFO number for wme */
107 extern const u8 prio2fifo[];
109 /* Ucode MCTL_WAKE override bits */
110 #define BRCMS_WAKE_OVERRIDE_CLKCTL 0x01
111 #define BRCMS_WAKE_OVERRIDE_PHYREG 0x02
112 #define BRCMS_WAKE_OVERRIDE_MACSUSPEND 0x04
113 #define BRCMS_WAKE_OVERRIDE_TXFIFO 0x08
114 #define BRCMS_WAKE_OVERRIDE_FORCEFAST 0x10
116 /* stuff pulled in from wlc.c */
118 /* Interrupt bit error summary. Don't include I_RU: we refill DMA at other
119 * times; and if we run out, constant I_RU interrupts may cause lockup. We
120 * will still get error counts from rx0ovfl.
122 #define I_ERRORS (I_PC | I_PD | I_DE | I_RO | I_XU)
123 /* default software intmasks */
124 #define DEF_RXINTMASK (I_RI) /* enable rx int on rxfifo only */
125 #define DEF_MACINTMASK (MI_TXSTOP | MI_TBTT | MI_ATIMWINEND | MI_PMQ | \
126 MI_PHYTXERR | MI_DMAINT | MI_TFS | MI_BG_NOISE | \
127 MI_CCA | MI_TO | MI_GP0 | MI_RFDISABLE | MI_PWRUP)
129 #define MAXTXPKTS 6 /* max # pkts pending */
132 #define MAXTXFRAMEBURST 8 /* vanilla xpress mode: max frames/burst */
133 #define MAXFRAMEBURST_TXOP 10000 /* Frameburst TXOP in usec */
135 #define NFIFO 6 /* # tx/rx fifopairs */
139 /* pll is shared on old chips */
140 #define BRCMS_PLLREQ_SHARED 0x1
141 /* hold pll for radio monitor register checking */
142 #define BRCMS_PLLREQ_RADIO_MON 0x2
143 /* hold/release pll for some short operation */
144 #define BRCMS_PLLREQ_FLIP 0x4
146 #define CHANNEL_BANDUNIT(wlc, ch) \
147 (((ch) <= CH_MAX_2G_CHANNEL) ? BAND_2G_INDEX : BAND_5G_INDEX)
149 #define OTHERBANDUNIT(wlc) \
150 ((uint)((wlc)->band->bandunit ? BAND_2G_INDEX : BAND_5G_INDEX))
153 * 802.11 protection information
155 * _g: use g spec protection, driver internal.
156 * g_override: override for use of g spec protection.
157 * gmode_user: user config gmode, operating band->gmode is different.
158 * overlap: Overlap BSS/IBSS protection for both 11g and 11n.
159 * nmode_user: user config nmode, operating pub->nmode is different.
160 * n_cfg: use OFDM protection on MIMO frames.
161 * n_cfg_override: override for use of N protection.
162 * nongf: non-GF present protection.
163 * nongf_override: override for use of GF protection.
164 * n_pam_override: override for preamble: MM or GF.
165 * n_obss: indicated OBSS Non-HT STA present.
167 struct brcms_protection {
182 * anything affecting the single/dual streams/antenna operation
184 * hw_txchain: HW txchain bitmap cfg.
185 * txchain: txchain bitmap being used.
186 * txstreams: number of txchains being used.
187 * hw_rxchain: HW rxchain bitmap cfg.
188 * rxchain: rxchain bitmap being used.
189 * rxstreams: number of rxchains being used.
190 * ant_rx_ovr: rx antenna override.
191 * txant: userTx antenna setting.
192 * phytxant: phyTx antenna setting in txheader.
193 * ss_opmode: singlestream Operational mode, 0:siso; 1:cdd.
194 * ss_algosel_auto: if true, use wlc->stf->ss_algo_channel;
195 * else use wlc->band->stf->ss_mode_band.
196 * ss_algo_channel: ss based on per-channel algo: 0: SISO, 1: CDD 2: STBC.
197 * rxchain_restore_delay: delay time to restore default rxchain.
198 * ldpc: AUTO/ON/OFF ldpc cap supported.
199 * txcore[MAX_STREAMS_SUPPORTED + 1]: bitmap of selected core for each Nsts.
213 bool ss_algosel_auto;
215 u8 rxchain_restore_delay;
217 u8 txcore[MAX_STREAMS_SUPPORTED + 1];
221 #define BRCMS_STF_SS_STBC_TX(wlc, scb) \
222 (((wlc)->stf->txstreams > 1) && (((wlc)->band->band_stf_stbc_tx == ON) \
223 || (((scb)->flags & SCB_STBCCAP) && \
224 (wlc)->band->band_stf_stbc_tx == AUTO && \
225 isset(&((wlc)->stf->ss_algo_channel), PHY_TXC1_MODE_STBC))))
227 #define BRCMS_STBC_CAP_PHY(wlc) (BRCMS_ISNPHY(wlc->band) && \
228 NREV_GE(wlc->band->phyrev, 3))
230 #define BRCMS_SGI_CAP_PHY(wlc) ((BRCMS_ISNPHY(wlc->band) && \
231 NREV_GE(wlc->band->phyrev, 3)) || \
232 BRCMS_ISLCNPHY(wlc->band))
234 #define BRCMS_CHAN_PHYTYPE(x) (((x) & RXS_CHAN_PHYTYPE_MASK) \
235 >> RXS_CHAN_PHYTYPE_SHIFT)
236 #define BRCMS_CHAN_CHANNEL(x) (((x) & RXS_CHAN_ID_MASK) \
237 >> RXS_CHAN_ID_SHIFT)
243 uint coreidx; /* # sb enumerated core */
246 uint *txavail[NFIFO]; /* # tx descriptors available */
247 s16 txpktpend[NFIFO]; /* tx admission control */
249 struct macstat *macstat_snapshot; /* mac hw prev read values */
253 * band state (phy+ana+radio)
256 int bandtype; /* BRCM_BAND_2G, BRCM_BAND_5G */
257 uint bandunit; /* bandstate[] index */
259 u16 phytype; /* phytype */
263 struct brcms_phy_pub *pi; /* pointer to phy specific information */
266 u8 gmode; /* currently active gmode */
268 struct scb *hwrs_scb; /* permanent scb for hw rateset */
270 /* band-specific copy of default_bss.rateset */
271 struct brcms_c_rateset defrateset;
273 u8 band_stf_ss_mode; /* Configured STF type, 0:siso; 1:cdd */
274 s8 band_stf_stbc_tx; /* STBC TX 0:off; 1:force on; -1:auto */
275 /* rates supported by chip (phy-specific) */
276 struct brcms_c_rateset hw_rateset;
277 u8 basic_rate[BRCM_MAXRATE + 1]; /* basic rates indexed by rate */
278 bool mimo_cap_40; /* 40 MHz cap enabled on this band */
279 s8 antgain; /* antenna gain from srom */
281 u16 CWmin; /* minimum size of contention window, in unit of aSlotTime */
282 u16 CWmax; /* maximum size of contention window, in unit of aSlotTime */
283 struct ieee80211_supported_band band;
286 /* module control blocks */
288 /* module name : NULL indicates empty array member */
290 /* handle passed when handler 'doiovar' is called */
291 struct brcms_info *hdl;
293 int (*down_fn)(void *handle); /* down handler. Note: the int returned
294 * by the down function is a count of the
295 * number of timers that could not be
301 struct brcms_hw_band {
302 int bandtype; /* BRCM_BAND_2G, BRCM_BAND_5G */
303 uint bandunit; /* bandstate[] index */
304 u16 mhfs[MHFMAX]; /* MHF array shadow */
305 u8 bandhw_stf_ss_mode; /* HW configured STF type, 0:siso; 1:cdd */
310 u16 phytype; /* phytype */
314 struct brcms_phy_pub *pi; /* pointer to phy specific information */
318 struct brcms_hardware {
319 bool _piomode; /* true if pio mode */
320 struct brcms_c_info *wlc;
323 struct dma_pub *di[NFIFO]; /* dma handles, per fifo */
325 uint unit; /* device instance number */
328 u16 vendorid; /* PCI vendor id */
329 u16 deviceid; /* PCI device id */
330 uint corerev; /* core revision */
331 u8 sromrev; /* version # of the srom */
332 u16 boardrev; /* version # of particular board */
333 u32 boardflags; /* Board specific flags from srom */
334 u32 boardflags2; /* More board flags if sromrev >= 4 */
335 u32 machwcap; /* MAC capabilities */
336 u32 machwcap_backup; /* backup of machwcap */
338 struct si_pub *sih; /* SI handle (cookie for siutils calls) */
339 struct d11regs __iomem *regs; /* pointer to device registers */
340 struct phy_shim_info *physhim; /* phy shim layer handler */
341 struct shared_phy *phy_sh; /* pointer to shared phy state */
342 struct brcms_hw_band *band;/* pointer to active per-band state */
343 /* band state per phy/radio */
344 struct brcms_hw_band *bandstate[MAXBANDS];
345 u16 bmac_phytxant; /* cache of high phytxant state */
346 bool shortslot; /* currently using 11g ShortSlot timing */
347 u16 SRL; /* 802.11 dot11ShortRetryLimit */
348 u16 LRL; /* 802.11 dot11LongRetryLimit */
349 u16 SFBL; /* Short Frame Rate Fallback Limit */
350 u16 LFBL; /* Long Frame Rate Fallback Limit */
352 bool up; /* d11 hardware up and running */
353 uint now; /* # elapsed seconds */
354 uint _nbands; /* # bands supported */
355 u16 chanspec; /* bmac chanspec shadow */
357 uint *txavail[NFIFO]; /* # tx descriptors available */
358 const u16 *xmtfifo_sz; /* fifo size in 256B for each xmt fifo */
360 u32 pllreq; /* pll requests to keep PLL on */
362 u8 suspended_fifos; /* Which TX fifo to remain awake for */
363 u32 maccontrol; /* Cached value of maccontrol */
364 uint mac_suspend_depth; /* current depth of mac_suspend levels */
365 u32 wake_override; /* bit flags to force MAC to WAKE mode */
366 u32 mute_override; /* Prevent ucode from sending beacons */
367 u8 etheraddr[ETH_ALEN]; /* currently configured ethernet address */
368 bool noreset; /* true= do not reset hw, used by WLC_OUT */
369 bool forcefastclk; /* true if h/w is forcing to use fast clk */
370 bool clk; /* core is out of reset and has clock */
371 bool sbclk; /* sb has clock */
372 bool phyclk; /* phy is out of reset and has clock */
374 bool ucode_loaded; /* true after ucode downloaded */
377 u8 hw_stf_ss_opmode; /* STF single stream operation mode */
378 u8 antsel_type; /* Type of boardlevel mimo antenna switch-logic
379 * 0 = N/A, 1 = 2x4 board, 2 = 2x3 CB2 board
382 * put struct antsel_info here if more info is
387 /* TX Queue information
389 * Each flow of traffic out of the device has a TX Queue with independent
390 * flow control. Several interfaces may be associated with a single TX Queue
391 * if they belong to the same flow of traffic from the device. For multi-channel
392 * operation there are independent TX Queues for each channel.
394 struct brcms_txq_info {
395 struct brcms_txq_info *next;
397 uint stopped; /* tx flow control bits */
401 * Principal common driver data structure.
403 * pub: pointer to driver public state.
404 * wl: pointer to specific private state.
405 * regs: pointer to device registers.
406 * hw: HW related state.
407 * clkreq_override: setting for clkreq for PCIE : Auto, 0, 1.
408 * fastpwrup_dly: time in us needed to bring up d11 fast clock.
409 * macintstatus: bit channel between isr and dpc.
410 * macintmask: sw runtime master macintmask value.
411 * defmacintmask: default "on" macintmask value.
412 * clk: core is out of reset and has clock.
413 * core: pointer to active io core.
414 * band: pointer to active per-band state.
415 * corestate: per-core state (one per hw core).
416 * bandstate: per-band state (one per phy/radio).
417 * qvalid: DirFrmQValid and BcMcFrmQValid.
418 * ampdu: ampdu module handler.
419 * asi: antsel module handler.
420 * cmi: channel manager module handler.
421 * vendorid: PCI vendor id.
422 * deviceid: PCI device id.
423 * ucode_rev: microcode revision.
424 * machwcap: MAC capabilities, BMAC shadow.
425 * perm_etheraddr: original sprom local ethernet address.
426 * bandlocked: disable auto multi-band switching.
427 * bandinit_pending: track band init in auto band.
428 * radio_monitor: radio timer is running.
429 * going_down: down path intermediate variable.
430 * mpc: enable minimum power consumption.
431 * mpc_dlycnt: # of watchdog cnt before turn disable radio.
432 * mpc_offcnt: # of watchdog cnt that radio is disabled.
433 * mpc_delay_off: delay radio disable by # of watchdog cnt.
434 * prev_non_delay_mpc: prev state brcms_c_is_non_delay_mpc.
435 * wdtimer: timer for watchdog routine.
436 * radio_timer: timer for hw radio button monitor routine.
437 * monitor: monitor (MPDU sniffing) mode.
438 * bcnmisc_monitor: bcns promisc mode override for monitor.
439 * _rifs: enable per-packet rifs.
440 * bcn_li_bcn: beacon listen interval in # beacons.
441 * bcn_li_dtim: beacon listen interval in # dtims.
442 * WDarmed: watchdog timer is armed.
443 * WDlast: last time wlc_watchdog() was called.
444 * edcf_txop[AC_COUNT]: current txop for each ac.
445 * wme_retries: per-AC retry limits.
446 * tx_prec_map: Precedence map based on HW FIFO space.
447 * fifo2prec_map[NFIFO]: pointer to fifo2_prec map based on WME.
448 * bsscfg: set of BSS configurations, idx 0 is default and always valid.
449 * cfg: the primary bsscfg (can be AP or STA).
450 * tx_queues: common TX Queue list.
452 * mimoft: SIGN or 11N.
453 * cck_40txbw: 11N, cck tx b/w override when in 40MHZ mode.
454 * ofdm_40txbw: 11N, ofdm tx b/w override when in 40MHZ mode.
455 * mimo_40txbw: 11N, mimo tx b/w override when in 40MHZ mode.
456 * default_bss: configured BSS parameters.
457 * mc_fid_counter: BC/MC FIFO frame ID counter.
458 * country_default: saved country for leaving 802.11d auto-country mode.
459 * autocountry_default: initial country for 802.11d auto-country mode.
460 * prb_resp_timeout: do not send prb resp if request older
461 * than this, 0 = disable.
462 * home_chanspec: shared home chanspec.
463 * chanspec: target operational channel.
464 * usr_fragthresh: user configured fragmentation threshold.
465 * fragthresh[NFIFO]: per-fifo fragmentation thresholds.
466 * RTSThresh: 802.11 dot11RTSThreshold.
467 * SRL: 802.11 dot11ShortRetryLimit.
468 * LRL: 802.11 dot11LongRetryLimit.
469 * SFBL: Short Frame Rate Fallback Limit.
470 * LFBL: Long Frame Rate Fallback Limit.
471 * shortslot: currently using 11g ShortSlot timing.
472 * shortslot_override: 11g ShortSlot override.
473 * include_legacy_erp: include Legacy ERP info elt ID 47 as well as g ID 42.
474 * PLCPHdr_override: 802.11b Preamble Type override.
476 * bcn_rspec: save bcn ratespec purpose.
477 * tempsense_lasttime;
478 * tx_duty_cycle_ofdm: maximum allowed duty cycle for OFDM.
479 * tx_duty_cycle_cck: maximum allowed duty cycle for CCK.
480 * pkt_queue: txq for transmit packets.
482 * pri_scb: primary Station Control Block
484 struct brcms_c_info {
485 struct brcms_pub *pub;
486 struct brcms_info *wl;
487 struct d11regs __iomem *regs;
488 struct brcms_hardware *hw;
501 struct brcms_core *core;
502 struct brcms_band *band;
503 struct brcms_core *corestate;
504 struct brcms_band *bandstate[MAXBANDS];
509 struct ampdu_info *ampdu;
510 struct antsel_info *asi;
511 struct brcms_cm_info *cmi;
517 u8 perm_etheraddr[ETH_ALEN];
520 bool bandinit_pending;
529 u8 prev_non_delay_mpc;
531 struct brcms_timer *wdtimer;
532 struct brcms_timer *radio_timer;
536 bool bcnmisc_monitor;
541 /* AP-STA synchronization, power save */
549 u16 edcf_txop[AC_COUNT];
551 u16 wme_retries[AC_COUNT];
553 u16 fifo2prec_map[NFIFO];
555 struct brcms_bss_cfg *bsscfg;
558 struct brcms_txq_info *tx_queues;
560 struct modulecb *modulecb;
567 struct brcms_bss_info *default_bss;
571 char country_default[BRCM_CNTRY_BUF_SZ];
572 char autocountry_default[BRCM_CNTRY_BUF_SZ];
573 u16 prb_resp_timeout;
580 u16 fragthresh[NFIFO];
589 s8 shortslot_override;
590 bool include_legacy_erp;
592 struct brcms_protection *protection;
595 struct brcms_stf *stf;
599 uint tempsense_lasttime;
601 u16 tx_duty_cycle_ofdm;
602 u16 tx_duty_cycle_cck;
604 struct brcms_txq_info *pkt_queue;
609 /* antsel module specific state */
611 struct brcms_c_info *wlc; /* pointer to main wlc structure */
612 struct brcms_pub *pub; /* pointer to public fn */
613 u8 antsel_type; /* Type of boardlevel mimo antenna switch-logic
614 * 0 = N/A, 1 = 2x4 board, 2 = 2x3 CB2 board
616 u8 antsel_antswitch; /* board level antenna switch type */
617 bool antsel_avail; /* Ant selection availability (SROM based) */
618 struct brcms_antselcfg antcfg_11n; /* antenna configuration */
619 struct brcms_antselcfg antcfg_cur; /* current antenna config (auto) */
623 * BSS configuration state
625 * wlc: wlc to which this bsscfg belongs to.
626 * up: is this configuration up operational
627 * enable: is this configuration enabled
628 * associated: is BSS in ASSOCIATED state
629 * BSS: infraustructure or adhoc
630 * SSID_len: the length of SSID
634 * BSSID: BSSID (associated)
635 * cur_etheraddr: h/w address
636 * flags: BSSCFG flags; see below
638 * current_bss: BSS parms in ASSOCIATED state
641 * ID: 'unique' ID of this bsscfg, assigned at bsscfg allocation
643 struct brcms_bss_cfg {
644 struct brcms_c_info *wlc;
650 u8 SSID[IEEE80211_MAX_SSID_LEN];
652 u8 cur_etheraddr[ETH_ALEN];
653 struct brcms_bss_info *current_bss;
656 extern void brcms_c_txfifo(struct brcms_c_info *wlc, uint fifo,
658 bool commit, s8 txpktpend);
659 extern void brcms_c_txfifo_complete(struct brcms_c_info *wlc, uint fifo,
661 extern void brcms_c_txq_enq(struct brcms_c_info *wlc, struct scb *scb,
662 struct sk_buff *sdu, uint prec);
663 extern void brcms_c_print_txstatus(struct tx_status *txs);
664 extern int brcms_b_xmtfifo_sz_get(struct brcms_hardware *wlc_hw, uint fifo,
668 extern void brcms_c_print_txdesc(struct d11txh *txh);
670 #define brcms_c_print_txdesc(a)
673 extern int brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config);
674 extern void brcms_c_mac_bcn_promisc_change(struct brcms_c_info *wlc,
676 extern void brcms_c_send_q(struct brcms_c_info *wlc);
677 extern int brcms_c_prep_pdu(struct brcms_c_info *wlc, struct sk_buff *pdu,
679 extern u16 brcms_c_calc_lsig_len(struct brcms_c_info *wlc, u32 ratespec,
681 extern u32 brcms_c_rspec_to_rts_rspec(struct brcms_c_info *wlc,
683 bool use_rspec, u16 mimo_ctlchbw);
684 extern u16 brcms_c_compute_rtscts_dur(struct brcms_c_info *wlc, bool cts_only,
687 u8 rts_preamble_type,
688 u8 frame_preamble_type, uint frame_len,
690 extern void brcms_c_inval_dma_pkts(struct brcms_hardware *hw,
691 struct ieee80211_sta *sta,
692 void (*dma_callback_fn));
693 extern void brcms_c_update_beacon(struct brcms_c_info *wlc);
694 extern void brcms_c_update_probe_resp(struct brcms_c_info *wlc, bool suspend);
695 extern int brcms_c_set_nmode(struct brcms_c_info *wlc);
696 extern void brcms_c_beacon_phytxctl_txant_upd(struct brcms_c_info *wlc,
698 extern void brcms_b_antsel_type_set(struct brcms_hardware *wlc_hw,
700 extern void brcms_b_set_chanspec(struct brcms_hardware *wlc_hw,
702 bool mute, struct txpwr_limits *txpwr);
703 extern void brcms_b_write_shm(struct brcms_hardware *wlc_hw, uint offset,
705 extern u16 brcms_b_read_shm(struct brcms_hardware *wlc_hw, uint offset);
706 extern void brcms_b_mhf(struct brcms_hardware *wlc_hw, u8 idx, u16 mask,
708 extern void brcms_b_corereset(struct brcms_hardware *wlc_hw, u32 flags);
709 extern void brcms_b_mctrl(struct brcms_hardware *wlc_hw, u32 mask, u32 val);
710 extern void brcms_b_phy_reset(struct brcms_hardware *wlc_hw);
711 extern void brcms_b_bw_set(struct brcms_hardware *wlc_hw, u16 bw);
712 extern void brcms_b_core_phypll_reset(struct brcms_hardware *wlc_hw);
713 extern void brcms_c_ucode_wake_override_set(struct brcms_hardware *wlc_hw,
715 extern void brcms_c_ucode_wake_override_clear(struct brcms_hardware *wlc_hw,
717 extern void brcms_b_write_template_ram(struct brcms_hardware *wlc_hw,
718 int offset, int len, void *buf);
719 extern u16 brcms_b_rate_shm_offset(struct brcms_hardware *wlc_hw, u8 rate);
720 extern void brcms_b_copyto_objmem(struct brcms_hardware *wlc_hw,
721 uint offset, const void *buf, int len,
723 extern void brcms_b_copyfrom_objmem(struct brcms_hardware *wlc_hw, uint offset,
724 void *buf, int len, u32 sel);
725 extern void brcms_b_switch_macfreq(struct brcms_hardware *wlc_hw, u8 spurmode);
726 extern u16 brcms_b_get_txant(struct brcms_hardware *wlc_hw);
727 extern void brcms_b_phyclk_fgc(struct brcms_hardware *wlc_hw, bool clk);
728 extern void brcms_b_macphyclk_set(struct brcms_hardware *wlc_hw, bool clk);
729 extern void brcms_b_core_phypll_ctl(struct brcms_hardware *wlc_hw, bool on);
730 extern void brcms_b_txant_set(struct brcms_hardware *wlc_hw, u16 phytxant);
731 extern void brcms_b_band_stf_ss_set(struct brcms_hardware *wlc_hw,
733 extern void brcms_c_init_scb(struct scb *scb);
735 #endif /* _BRCM_MAIN_H_ */