1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17#ifndef _wlc_h_
18#define _wlc_h_
19
20#define MA_WINDOW_SZ 8
21#define WL_HWRXOFF 38
22#define INVCHANNEL 255
23#define MAXCOREREV 28
24#define WLC_MAXMODULES 22
25
26#define WLC_BITSCNT(x) bcm_bitcount((u8 *)&(x), sizeof(u8))
27
28
29#define WLC_MAX_MAC_SUSPEND 83000
30
31
32
33#define WLC_PRB_RESP_TIMEOUT 0
34
35
36#define TXOFF (D11_TXH_LEN + D11_PHY_HDR_LEN)
37
38
39struct wlc_bss_list {
40 uint count;
41 bool beacon;
42 wlc_bss_info_t *ptrs[MAXBSS];
43};
44
45#define SW_TIMER_MAC_STAT_UPD 30
46
47
48#if CONF_MSK(D11CONF, 0x4f) || CONF_GE(D11CONF, MAXCOREREV)
49#error "Configuration for D11CONF includes unsupported versions."
50#endif
51
52#define VALID_COREREV(corerev) CONF_HAS(D11CONF, corerev)
53
54
55#define WLC_SHORTSLOT_AUTO -1
56#define WLC_SHORTSLOT_OFF 0
57#define WLC_SHORTSLOT_ON 1
58
59
60
61#define WLC_LONG_PREAMBLE (0)
62#define WLC_SHORT_PREAMBLE (1 << 0)
63#define WLC_GF_PREAMBLE (1 << 1)
64#define WLC_MM_PREAMBLE (1 << 2)
65#define WLC_IS_MIMO_PREAMBLE(_pre) (((_pre) == WLC_GF_PREAMBLE) || ((_pre) == WLC_MM_PREAMBLE))
66
67
68#define WLC_BARKER_SHORT_ALLOWED 0
69
70
71#define WLC_TX_FIFO_CLEAR(wlc, fifo) ((wlc)->tx_prec_map &= ~(wlc)->fifo2prec_map[fifo])
72
73
74#define WLC_TX_FIFO_ENAB(wlc, fifo) ((wlc)->tx_prec_map |= (wlc)->fifo2prec_map[fifo])
75
76
77
78
79#define TXFID_QUEUE_MASK 0x0007
80#define TXFID_SEQ_MASK 0x7FE0
81#define TXFID_SEQ_SHIFT 5
82#define TXFID_RATE_PROBE_MASK 0x8000
83#define TXFID_RATE_MASK 0x0018
84#define TXFID_RATE_SHIFT 3
85
86
87#define BOARDREV_PROMOTABLE 0xFF
88#define BOARDREV_PROMOTED 1
89
90
91
92#define WSEC_ENABLED(wsec) ((wsec) & (WEP_ENABLED | TKIP_ENABLED | AES_ENABLED))
93#define WLC_SW_KEYS(wlc, bsscfg) ((((wlc)->wsec_swkeys) || \
94 ((bsscfg)->wsec & WSEC_SWFLAG)))
95
96#define WLC_PORTOPEN(cfg) \
97 (((cfg)->WPA_auth != WPA_AUTH_DISABLED && WSEC_ENABLED((cfg)->wsec)) ? \
98 (cfg)->wsec_portopen : true)
99
100#define PS_ALLOWED(wlc) wlc_ps_allowed(wlc)
101
102#define DATA_BLOCK_TX_SUPR (1 << 4)
103
104
105extern const u8 prio2fifo[];
106
107
108#define WLC_WAKE_OVERRIDE_CLKCTL 0x01
109#define WLC_WAKE_OVERRIDE_PHYREG 0x02
110#define WLC_WAKE_OVERRIDE_MACSUSPEND 0x04
111#define WLC_WAKE_OVERRIDE_TXFIFO 0x08
112#define WLC_WAKE_OVERRIDE_FORCEFAST 0x10
113
114
115
116
117
118
119
120#define I_ERRORS (I_PC | I_PD | I_DE | I_RO | I_XU)
121
122#define DEF_RXINTMASK (I_RI)
123#define DEF_MACINTMASK (MI_TXSTOP | MI_TBTT | MI_ATIMWINEND | MI_PMQ | \
124 MI_PHYTXERR | MI_DMAINT | MI_TFS | MI_BG_NOISE | \
125 MI_CCA | MI_TO | MI_GP0 | MI_RFDISABLE | MI_PWRUP)
126
127#define RETRY_SHORT_DEF 7
128#define RETRY_SHORT_MAX 255
129#define RETRY_LONG_DEF 4
130#define RETRY_SHORT_FB 3
131#define RETRY_LONG_FB 2
132
133#define MAXTXPKTS 6
134
135
136#define MAXTXFRAMEBURST 8
137#define MAXFRAMEBURST_TXOP 10000
138
139
140#define EDCF_SHORT_S 0
141#define EDCF_SFB_S 4
142#define EDCF_LONG_S 8
143#define EDCF_LFB_S 12
144#define EDCF_SHORT_M BITFIELD_MASK(4)
145#define EDCF_SFB_M BITFIELD_MASK(4)
146#define EDCF_LONG_M BITFIELD_MASK(4)
147#define EDCF_LFB_M BITFIELD_MASK(4)
148
149#define WLC_WME_RETRY_SHORT_GET(wlc, ac) GFIELD(wlc->wme_retries[ac], EDCF_SHORT)
150#define WLC_WME_RETRY_SFB_GET(wlc, ac) GFIELD(wlc->wme_retries[ac], EDCF_SFB)
151#define WLC_WME_RETRY_LONG_GET(wlc, ac) GFIELD(wlc->wme_retries[ac], EDCF_LONG)
152#define WLC_WME_RETRY_LFB_GET(wlc, ac) GFIELD(wlc->wme_retries[ac], EDCF_LFB)
153
154#define WLC_WME_RETRY_SHORT_SET(wlc, ac, val) \
155 (wlc->wme_retries[ac] = SFIELD(wlc->wme_retries[ac], EDCF_SHORT, val))
156#define WLC_WME_RETRY_SFB_SET(wlc, ac, val) \
157 (wlc->wme_retries[ac] = SFIELD(wlc->wme_retries[ac], EDCF_SFB, val))
158#define WLC_WME_RETRY_LONG_SET(wlc, ac, val) \
159 (wlc->wme_retries[ac] = SFIELD(wlc->wme_retries[ac], EDCF_LONG, val))
160#define WLC_WME_RETRY_LFB_SET(wlc, ac, val) \
161 (wlc->wme_retries[ac] = SFIELD(wlc->wme_retries[ac], EDCF_LFB, val))
162
163
164#define WLC_PLLREQ_SHARED 0x1
165#define WLC_PLLREQ_RADIO_MON 0x2
166#define WLC_PLLREQ_FLIP 0x4
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181#define AP_ACTIVE(wlc) (0)
182
183
184
185
186
187
188
189
190
191#define DEVICEREMOVED(wlc) \
192 ((wlc->hw->clk) ? \
193 ((R_REG(&wlc->hw->regs->maccontrol) & \
194 (MCTL_PSM_JMP_0 | MCTL_IHR_EN)) != MCTL_IHR_EN) : \
195 (ai_deviceremoved(wlc->hw->sih)))
196
197#define WLCWLUNIT(wlc) ((wlc)->pub->unit)
198
199struct wlc_protection {
200 bool _g;
201 s8 g_override;
202 u8 gmode_user;
203 s8 overlap;
204 s8 nmode_user;
205 s8 n_cfg;
206 s8 n_cfg_override;
207 bool nongf;
208 s8 nongf_override;
209 s8 n_pam_override;
210 bool n_obss;
211
212 uint longpre_detect_timeout;
213 uint barker_detect_timeout;
214
215 uint ofdm_ibss_timeout;
216 uint ofdm_ovlp_timeout;
217 uint nonerp_ibss_timeout;
218 uint nonerp_ovlp_timeout;
219 uint g_ibss_timeout;
220 uint n_ibss_timeout;
221 uint ht20in40_ovlp_timeout;
222 uint ht20in40_ibss_timeout;
223 uint non_gf_ibss_timeout;
224};
225
226
227struct wlc_stf {
228 u8 hw_txchain;
229 u8 txchain;
230 u8 txstreams;
231
232 u8 hw_rxchain;
233 u8 rxchain;
234 u8 rxstreams;
235
236 u8 ant_rx_ovr;
237 s8 txant;
238 u16 phytxant;
239
240 u8 ss_opmode;
241 bool ss_algosel_auto;
242
243 u16 ss_algo_channel;
244 u8 no_cddstbc;
245
246 u8 rxchain_restore_delay;
247
248 s8 ldpc;
249 u8 txcore[MAX_STREAMS_SUPPORTED + 1];
250 s8 spatial_policy;
251};
252
253#define WLC_STF_SS_STBC_TX(wlc, scb) \
254 (((wlc)->stf->txstreams > 1) && (((wlc)->band->band_stf_stbc_tx == ON) || \
255 (SCB_STBC_CAP((scb)) && \
256 (wlc)->band->band_stf_stbc_tx == AUTO && \
257 isset(&((wlc)->stf->ss_algo_channel), PHY_TXC1_MODE_STBC))))
258
259#define WLC_STBC_CAP_PHY(wlc) (WLCISNPHY(wlc->band) && NREV_GE(wlc->band->phyrev, 3))
260
261#define WLC_SGI_CAP_PHY(wlc) ((WLCISNPHY(wlc->band) && NREV_GE(wlc->band->phyrev, 3)) || \
262 WLCISLCNPHY(wlc->band))
263
264#define WLC_CHAN_PHYTYPE(x) (((x) & RXS_CHAN_PHYTYPE_MASK) >> RXS_CHAN_PHYTYPE_SHIFT)
265#define WLC_CHAN_CHANNEL(x) (((x) & RXS_CHAN_ID_MASK) >> RXS_CHAN_ID_SHIFT)
266#define WLC_RX_CHANNEL(rxh) (WLC_CHAN_CHANNEL((rxh)->RxChan))
267
268
269#define WLC_BSS_HT 0x0020
270
271
272#define TXQ_STOP_FOR_PRIOFC_MASK 0x000000FF
273#define TXQ_STOP_FOR_PKT_DRAIN 0x00000100
274#define TXQ_STOP_FOR_AMPDU_FLOW_CNTRL 0x00000200
275
276#define WLC_HT_WEP_RESTRICT 0x01
277#define WLC_HT_TKIP_RESTRICT 0x02
278
279
280
281
282struct wlccore {
283 uint coreidx;
284
285
286 uint *txavail[NFIFO];
287 s16 txpktpend[NFIFO];
288
289 macstat_t *macstat_snapshot;
290};
291
292
293
294
295struct wlcband {
296 int bandtype;
297 uint bandunit;
298
299 u16 phytype;
300 u16 phyrev;
301 u16 radioid;
302 u16 radiorev;
303 wlc_phy_t *pi;
304 bool abgphy_encore;
305
306 u8 gmode;
307
308 struct scb *hwrs_scb;
309
310 wlc_rateset_t defrateset;
311
312 ratespec_t rspec_override;
313 ratespec_t mrspec_override;
314 u8 band_stf_ss_mode;
315 s8 band_stf_stbc_tx;
316 wlc_rateset_t hw_rateset;
317 u8 basic_rate[WLC_MAXRATE + 1];
318 bool mimo_cap_40;
319 s8 antgain;
320
321 u16 CWmin;
322 u16 CWmax;
323 u16 bcntsfoff;
324};
325
326
327typedef void (*pkcb_fn_t) (struct wlc_info *wlc, uint txstatus, void *arg);
328
329struct pkt_cb {
330 pkcb_fn_t fn;
331 void *arg;
332 u8 nextidx;
333 bool entered;
334};
335
336
337struct modulecb {
338 char name[32];
339 const bcm_iovar_t *iovars;
340 void *hdl;
341 watchdog_fn_t watchdog_fn;
342 iovar_fn_t iovar_fn;
343 down_fn_t down_fn;
344
345
346
347
348};
349
350
351struct dumpcb_s {
352 const char *name;
353 dump_fn_t dump_fn;
354 void *dump_fn_arg;
355 struct dumpcb_s *next;
356};
357
358
359struct wlc_if {
360 struct wlc_if *next;
361 u8 type;
362 u8 index;
363
364
365
366 u8 flags;
367 struct wl_if *wlif;
368 struct wlc_txq_info *qi;
369 union {
370 struct scb *scb;
371 struct wlc_bsscfg *bsscfg;
372 } u;
373};
374
375
376#define WLC_IF_LINKED 0x02
377
378struct wlc_hwband {
379 int bandtype;
380 uint bandunit;
381 u16 mhfs[MHFMAX];
382 u8 bandhw_stf_ss_mode;
383 u16 CWmin;
384 u16 CWmax;
385 u32 core_flags;
386
387 u16 phytype;
388 u16 phyrev;
389 u16 radioid;
390 u16 radiorev;
391 wlc_phy_t *pi;
392 bool abgphy_encore;
393};
394
395struct wlc_hw_info {
396 bool _piomode;
397 struct wlc_info *wlc;
398
399
400 struct hnddma_pub *di[NFIFO];
401
402 uint unit;
403
404
405 u16 vendorid;
406 u16 deviceid;
407 uint corerev;
408 u8 sromrev;
409 u16 boardrev;
410 u32 boardflags;
411 u32 boardflags2;
412 u32 machwcap;
413 u32 machwcap_backup;
414 u16 ucode_dbgsel;
415
416 si_t *sih;
417 char *vars;
418 uint vars_size;
419 d11regs_t *regs;
420 void *physhim;
421 void *phy_sh;
422 struct wlc_hwband *band;
423 struct wlc_hwband *bandstate[MAXBANDS];
424 u16 bmac_phytxant;
425 bool shortslot;
426 u16 SRL;
427 u16 LRL;
428 u16 SFBL;
429 u16 LFBL;
430
431 bool up;
432 uint now;
433 uint _nbands;
434 chanspec_t chanspec;
435
436 uint *txavail[NFIFO];
437 u16 *xmtfifo_sz;
438
439 mbool pllreq;
440
441 u8 suspended_fifos;
442 u32 maccontrol;
443 uint mac_suspend_depth;
444 u32 wake_override;
445 u32 mute_override;
446 u8 etheraddr[ETH_ALEN];
447 u32 led_gpio_mask;
448 bool noreset;
449 bool forcefastclk;
450 bool clk;
451 bool sbclk;
452 struct bmac_pmq *bmac_pmq;
453 bool phyclk;
454 bool dma_lpbk;
455
456 bool ucode_loaded;
457
458
459 u8 hw_stf_ss_opmode;
460 u8 antsel_type;
461
462
463 u32 antsel_avail;
464
465
466
467};
468
469
470
471
472
473
474
475
476struct wlc_txq_info {
477 struct wlc_txq_info *next;
478 struct pktq q;
479 uint stopped;
480};
481
482
483
484
485struct wlc_info {
486 struct wlc_pub *pub;
487 struct wl_info *wl;
488 d11regs_t *regs;
489
490 struct wlc_hw_info *hw;
491
492
493 int clkreq_override;
494 u16 fastpwrup_dly;
495
496
497 u32 macintstatus;
498 u32 macintmask;
499 u32 defmacintmask;
500
501
502 bool device_present;
503
504 bool clk;
505
506
507 struct wlccore *core;
508 struct wlcband *band;
509 struct wlccore *corestate;
510
511 struct wlcband *bandstate[MAXBANDS];
512
513 bool war16165;
514
515 bool tx_suspended;
516
517 uint txpend16165war;
518
519
520 uint qvalid;
521
522
523 s8 txpwr_local_max;
524 u8 txpwr_local_constraint;
525
526
527 struct ampdu_info *ampdu;
528 struct antsel_info *asi;
529 wlc_cm_info_t *cmi;
530
531 void *btparam;
532
533 uint vars_size;
534
535 u16 vendorid;
536 u16 deviceid;
537 uint ucode_rev;
538
539 u32 machwcap;
540
541 u8 perm_etheraddr[ETH_ALEN];
542
543 bool bandlocked;
544 bool bandinit_pending;
545
546 bool radio_monitor;
547 bool down_override;
548 bool going_down;
549
550 bool mpc;
551 u8 mpc_dlycnt;
552 u8 mpc_offcnt;
553 u8 mpc_delay_off;
554 u8 prev_non_delay_mpc;
555
556
557 struct wl_timer *wdtimer;
558 uint fast_timer;
559 uint slow_timer;
560 uint glacial_timer;
561 uint phycal_mlo;
562 uint phycal_txpower;
563
564 struct wl_timer *radio_timer;
565 struct wl_timer *pspoll_timer;
566
567
568 bool monitor;
569 bool bcnmisc_ibss;
570 bool bcnmisc_scan;
571 bool bcnmisc_monitor;
572
573 u8 bcn_wait_prd;
574
575
576 bool _rifs;
577 s32 rifs_advert;
578 s8 sgi_tx;
579 bool wet;
580
581
582 bool check_for_unaligned_tbtt;
583 bool PM_override;
584 bool PMenabled;
585 bool PMpending;
586 bool PMblocked;
587
588
589
590 bool PSpoll;
591 u8 PM;
592 bool PMawakebcn;
593
594 bool WME_PM_blocked;
595 bool wake;
596 u8 pspoll_prd;
597 u8 bcn_li_bcn;
598 u8 bcn_li_dtim;
599
600 bool WDarmed;
601 u32 WDlast;
602
603
604 ac_bitmap_t wme_dp;
605 bool wme_apsd;
606 ac_bitmap_t wme_admctl;
607 u16 edcf_txop[AC_COUNT];
608 wme_param_ie_t wme_param_ie;
609
610
611
612
613 bool wme_prec_queuing;
614 u16 wme_retries[AC_COUNT];
615
616 int vlan_mode;
617 u16 tx_prec_map;
618 u16 fifo2prec_map[NFIFO];
619
620
621
622
623
624 struct wlc_bsscfg *bsscfg[WLC_MAXBSSCFG];
625 struct wlc_bsscfg *cfg;
626 u8 stas_associated;
627 u8 aps_associated;
628 u8 block_datafifo;
629 bool bcmcfifo_drain;
630
631
632 struct wlc_txq_info *tx_queues;
633
634
635 wsec_key_t *wsec_keys[WSEC_MAX_KEYS];
636 wsec_key_t *wsec_def_keys[WLC_DEFAULT_KEYS];
637 bool wsec_swkeys;
638
639
640 struct modulecb *modulecb;
641 struct dumpcb_s *dumpcb_head;
642
643 u8 mimoft;
644 u8 mimo_band_bwcap;
645 s8 txburst_limit_override;
646 u16 txburst_limit;
647 s8 cck_40txbw;
648 s8 ofdm_40txbw;
649 s8 mimo_40txbw;
650
651 struct ieee80211_ht_cap ht_cap;
652
653 uint seckeys;
654 uint tkmickeys;
655
656 wlc_bss_info_t *default_bss;
657
658 u16 AID;
659 u16 counter;
660 u16 mc_fid_counter;
661
662 bool ibss_allowed;
663
664
665
666 bool ibss_coalesce_allowed;
667
668 char country_default[WLC_CNTRY_BUF_SZ];
669
670
671 char autocountry_default[WLC_CNTRY_BUF_SZ];
672
673
674#ifdef BCMDBG
675 bcm_tlv_t *country_ie_override;
676#endif
677
678 u16 prb_resp_timeout;
679
680
681
682 wlc_rateset_t sup_rates_override;
683
684
685
686 chanspec_t home_chanspec;
687
688
689 chanspec_t chanspec;
690 u16 usr_fragthresh;
691 u16 fragthresh[NFIFO];
692 u16 RTSThresh;
693 u16 SRL;
694 u16 LRL;
695 u16 SFBL;
696 u16 LFBL;
697
698
699 bool shortpreamble;
700 bool shortslot;
701 s8 barker_preamble;
702 s8 shortslot_override;
703 bool include_legacy_erp;
704 bool barker_overlap_control;
705 bool ignore_bcns;
706 bool legacy_probe;
707
708 struct wlc_protection *protection;
709 s8 PLCPHdr_override;
710
711 struct wlc_stf *stf;
712
713 struct pkt_cb *pkt_callback;
714
715 u32 txretried;
716
717 ratespec_t bcn_rspec;
718
719 bool apsd_sta_usp;
720 struct wl_timer *apsd_trigger_timer;
721 u32 apsd_trigger_timeout;
722
723
724 ac_bitmap_t apsd_trigger_ac;
725
726
727 u8 htphy_membership;
728
729 bool _regulatory_domain;
730
731 u8 mimops_PM;
732
733 u8 txpwr_percent;
734
735 u8 ht_wsec_restriction;
736
737 uint tempsense_lasttime;
738
739 u16 tx_duty_cycle_ofdm;
740 u16 tx_duty_cycle_cck;
741
742 u16 next_bsscfg_ID;
743
744 struct wlc_if *wlcif_list;
745 struct wlc_txq_info *pkt_queue;
746 u32 mpc_dur;
747
748
749 u32 mpc_laston_ts;
750
751
752 bool pr80838_war;
753 uint hwrxoff;
754 struct wiphy *wiphy;
755};
756
757
758struct antsel_info {
759 struct wlc_info *wlc;
760 struct wlc_pub *pub;
761 u8 antsel_type;
762
763
764 u8 antsel_antswitch;
765 bool antsel_avail;
766 wlc_antselcfg_t antcfg_11n;
767 wlc_antselcfg_t antcfg_cur;
768};
769
770#define CHANNEL_BANDUNIT(wlc, ch) (((ch) <= CH_MAX_2G_CHANNEL) ? BAND_2G_INDEX : BAND_5G_INDEX)
771#define OTHERBANDUNIT(wlc) ((uint)((wlc)->band->bandunit ? BAND_2G_INDEX : BAND_5G_INDEX))
772
773#define IS_MBAND_UNLOCKED(wlc) \
774 ((NBANDS(wlc) > 1) && !(wlc)->bandlocked)
775
776#define WLC_BAND_PI_RADIO_CHANSPEC wlc_phy_chanspec_get(wlc->band->pi)
777
778
779#define TXPKTPENDTOT(wlc) ((wlc)->core->txpktpend[0] + (wlc)->core->txpktpend[1] + \
780 (wlc)->core->txpktpend[2] + (wlc)->core->txpktpend[3])
781#define TXPKTPENDGET(wlc, fifo) ((wlc)->core->txpktpend[(fifo)])
782#define TXPKTPENDINC(wlc, fifo, val) ((wlc)->core->txpktpend[(fifo)] += (val))
783#define TXPKTPENDDEC(wlc, fifo, val) ((wlc)->core->txpktpend[(fifo)] -= (val))
784#define TXPKTPENDCLR(wlc, fifo) ((wlc)->core->txpktpend[(fifo)] = 0)
785#define TXAVAIL(wlc, fifo) (*(wlc)->core->txavail[(fifo)])
786#define GETNEXTTXP(wlc, _queue) \
787 dma_getnexttxp((wlc)->hw->di[(_queue)], HNDDMA_RANGE_TRANSMITTED)
788
789#define WLC_IS_MATCH_SSID(wlc, ssid1, ssid2, len1, len2) \
790 ((len1 == len2) && !memcmp(ssid1, ssid2, len1))
791
792extern void wlc_fatal_error(struct wlc_info *wlc);
793extern void wlc_bmac_rpc_watchdog(struct wlc_info *wlc);
794extern void wlc_recv(struct wlc_info *wlc, struct sk_buff *p);
795extern bool wlc_dotxstatus(struct wlc_info *wlc, tx_status_t *txs, u32 frm_tx2);
796extern void wlc_txfifo(struct wlc_info *wlc, uint fifo, struct sk_buff *p,
797 bool commit, s8 txpktpend);
798extern void wlc_txfifo_complete(struct wlc_info *wlc, uint fifo, s8 txpktpend);
799extern void wlc_txq_enq(void *ctx, struct scb *scb, struct sk_buff *sdu,
800 uint prec);
801extern void wlc_info_init(struct wlc_info *wlc, int unit);
802extern void wlc_print_txstatus(tx_status_t *txs);
803extern int wlc_xmtfifo_sz_get(struct wlc_info *wlc, uint fifo, uint *blocks);
804extern void wlc_write_template_ram(struct wlc_info *wlc, int offset, int len,
805 void *buf);
806extern void wlc_write_hw_bcntemplates(struct wlc_info *wlc, void *bcn, int len,
807 bool both);
808extern void wlc_set_cwmin(struct wlc_info *wlc, u16 newmin);
809extern void wlc_set_cwmax(struct wlc_info *wlc, u16 newmax);
810extern void wlc_pllreq(struct wlc_info *wlc, bool set, mbool req_bit);
811extern void wlc_reset_bmac_done(struct wlc_info *wlc);
812
813#if defined(BCMDBG)
814extern void wlc_print_rxh(d11rxhdr_t *rxh);
815extern void wlc_print_hdrs(struct wlc_info *wlc, const char *prefix, u8 *frame,
816 d11txh_t *txh, d11rxhdr_t *rxh, uint len);
817extern void wlc_print_txdesc(d11txh_t *txh);
818#else
819#define wlc_print_txdesc(a)
820#endif
821#if defined(BCMDBG)
822extern void wlc_print_dot11_mac_hdr(u8 *buf, int len);
823#endif
824
825extern void wlc_setxband(struct wlc_hw_info *wlc_hw, uint bandunit);
826extern void wlc_coredisable(struct wlc_hw_info *wlc_hw);
827
828extern bool wlc_valid_rate(struct wlc_info *wlc, ratespec_t rate, int band,
829 bool verbose);
830extern void wlc_ap_upd(struct wlc_info *wlc);
831
832
833extern void wlc_shm_ssid_upd(struct wlc_info *wlc, struct wlc_bsscfg *cfg);
834extern int wlc_set_gmode(struct wlc_info *wlc, u8 gmode, bool config);
835
836extern void wlc_mac_bcn_promisc_change(struct wlc_info *wlc, bool promisc);
837extern void wlc_mac_bcn_promisc(struct wlc_info *wlc);
838extern void wlc_mac_promisc(struct wlc_info *wlc);
839extern void wlc_txflowcontrol(struct wlc_info *wlc, struct wlc_txq_info *qi,
840 bool on, int prio);
841extern void wlc_txflowcontrol_override(struct wlc_info *wlc,
842 struct wlc_txq_info *qi,
843 bool on, uint override);
844extern bool wlc_txflowcontrol_prio_isset(struct wlc_info *wlc,
845 struct wlc_txq_info *qi, int prio);
846extern void wlc_send_q(struct wlc_info *wlc);
847extern int wlc_prep_pdu(struct wlc_info *wlc, struct sk_buff *pdu, uint *fifo);
848
849extern u16 wlc_calc_lsig_len(struct wlc_info *wlc, ratespec_t ratespec,
850 uint mac_len);
851extern ratespec_t wlc_rspec_to_rts_rspec(struct wlc_info *wlc, ratespec_t rspec,
852 bool use_rspec, u16 mimo_ctlchbw);
853extern u16 wlc_compute_rtscts_dur(struct wlc_info *wlc, bool cts_only,
854 ratespec_t rts_rate, ratespec_t frame_rate,
855 u8 rts_preamble_type,
856 u8 frame_preamble_type, uint frame_len,
857 bool ba);
858
859extern void wlc_tbtt(struct wlc_info *wlc, d11regs_t *regs);
860extern void wlc_inval_dma_pkts(struct wlc_hw_info *hw,
861 struct ieee80211_sta *sta,
862 void (*dma_callback_fn));
863
864#if defined(BCMDBG)
865extern void wlc_dump_ie(struct wlc_info *wlc, bcm_tlv_t *ie,
866 struct bcmstrbuf *b);
867#endif
868
869extern void wlc_reprate_init(struct wlc_info *wlc);
870extern void wlc_bsscfg_reprate_init(struct wlc_bsscfg *bsscfg);
871
872
873extern void wlc_write_shm(struct wlc_info *wlc, uint offset, u16 v);
874extern u16 wlc_read_shm(struct wlc_info *wlc, uint offset);
875extern void wlc_copyto_shm(struct wlc_info *wlc, uint offset, const void *buf,
876 int len);
877
878extern void wlc_update_beacon(struct wlc_info *wlc);
879extern void wlc_bss_update_beacon(struct wlc_info *wlc,
880 struct wlc_bsscfg *bsscfg);
881
882extern void wlc_update_probe_resp(struct wlc_info *wlc, bool suspend);
883extern void wlc_bss_update_probe_resp(struct wlc_info *wlc,
884 struct wlc_bsscfg *cfg, bool suspend);
885
886extern bool wlc_ismpc(struct wlc_info *wlc);
887extern bool wlc_is_non_delay_mpc(struct wlc_info *wlc);
888extern void wlc_radio_mpc_upd(struct wlc_info *wlc);
889extern bool wlc_prec_enq(struct wlc_info *wlc, struct pktq *q, void *pkt,
890 int prec);
891extern bool wlc_prec_enq_head(struct wlc_info *wlc, struct pktq *q,
892 struct sk_buff *pkt, int prec, bool head);
893extern u16 wlc_phytxctl1_calc(struct wlc_info *wlc, ratespec_t rspec);
894extern void wlc_compute_plcp(struct wlc_info *wlc, ratespec_t rate, uint length,
895 u8 *plcp);
896extern uint wlc_calc_frame_time(struct wlc_info *wlc, ratespec_t ratespec,
897 u8 preamble_type, uint mac_len);
898
899extern void wlc_set_chanspec(struct wlc_info *wlc, chanspec_t chanspec);
900
901extern bool wlc_timers_init(struct wlc_info *wlc, int unit);
902
903extern const bcm_iovar_t wlc_iovars[];
904
905extern int wlc_doiovar(void *hdl, const bcm_iovar_t *vi, u32 actionid,
906 const char *name, void *params, uint p_len, void *arg,
907 int len, int val_size, struct wlc_if *wlcif);
908
909#if defined(BCMDBG)
910extern void wlc_print_ies(struct wlc_info *wlc, u8 *ies, uint ies_len);
911#endif
912
913extern int wlc_set_nmode(struct wlc_info *wlc, s32 nmode);
914extern void wlc_mimops_action_ht_send(struct wlc_info *wlc,
915 struct wlc_bsscfg *bsscfg,
916 u8 mimops_mode);
917
918extern void wlc_switch_shortslot(struct wlc_info *wlc, bool shortslot);
919extern void wlc_set_bssid(struct wlc_bsscfg *cfg);
920extern void wlc_edcf_setparams(struct wlc_info *wlc, bool suspend);
921
922extern void wlc_set_ratetable(struct wlc_info *wlc);
923extern int wlc_set_mac(struct wlc_bsscfg *cfg);
924extern void wlc_beacon_phytxctl_txant_upd(struct wlc_info *wlc,
925 ratespec_t bcn_rate);
926extern void wlc_mod_prb_rsp_rate_table(struct wlc_info *wlc, uint frame_len);
927extern ratespec_t wlc_lowest_basic_rspec(struct wlc_info *wlc,
928 wlc_rateset_t *rs);
929extern void wlc_radio_disable(struct wlc_info *wlc);
930extern void wlc_bcn_li_upd(struct wlc_info *wlc);
931
932extern int wlc_get_revision_info(struct wlc_info *wlc, void *buf, uint len);
933extern void wlc_set_home_chanspec(struct wlc_info *wlc, chanspec_t chanspec);
934extern void wlc_watchdog_upd(struct wlc_info *wlc, bool tbtt);
935extern bool wlc_ps_allowed(struct wlc_info *wlc);
936extern bool wlc_stay_awake(struct wlc_info *wlc);
937extern void wlc_wme_initparams_sta(struct wlc_info *wlc, wme_param_ie_t *pe);
938
939#endif
940