18c2ecf20Sopenharmony_ci/*
28c2ecf20Sopenharmony_ci * Copyright (c) 2010 Broadcom Corporation
38c2ecf20Sopenharmony_ci *
48c2ecf20Sopenharmony_ci * Permission to use, copy, modify, and/or distribute this software for any
58c2ecf20Sopenharmony_ci * purpose with or without fee is hereby granted, provided that the above
68c2ecf20Sopenharmony_ci * copyright notice and this permission notice appear in all copies.
78c2ecf20Sopenharmony_ci *
88c2ecf20Sopenharmony_ci * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
98c2ecf20Sopenharmony_ci * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
108c2ecf20Sopenharmony_ci * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
118c2ecf20Sopenharmony_ci * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
128c2ecf20Sopenharmony_ci * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
138c2ecf20Sopenharmony_ci * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
148c2ecf20Sopenharmony_ci * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
158c2ecf20Sopenharmony_ci */
168c2ecf20Sopenharmony_ci
178c2ecf20Sopenharmony_ci#ifndef _BRCM_MAIN_H_
188c2ecf20Sopenharmony_ci#define _BRCM_MAIN_H_
198c2ecf20Sopenharmony_ci
208c2ecf20Sopenharmony_ci#include <linux/etherdevice.h>
218c2ecf20Sopenharmony_ci
228c2ecf20Sopenharmony_ci#include <brcmu_utils.h>
238c2ecf20Sopenharmony_ci#include "types.h"
248c2ecf20Sopenharmony_ci#include "d11.h"
258c2ecf20Sopenharmony_ci#include "scb.h"
268c2ecf20Sopenharmony_ci
278c2ecf20Sopenharmony_ci#define	INVCHANNEL		255	/* invalid channel */
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci/* max # brcms_c_module_register() calls */
308c2ecf20Sopenharmony_ci#define BRCMS_MAXMODULES	22
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ci#define SEQNUM_SHIFT		4
338c2ecf20Sopenharmony_ci#define SEQNUM_MAX		0x1000
348c2ecf20Sopenharmony_ci
358c2ecf20Sopenharmony_ci#define NTXRATE			64	/* # tx MPDUs rate is reported for */
368c2ecf20Sopenharmony_ci
378c2ecf20Sopenharmony_ci/* Maximum wait time for a MAC suspend */
388c2ecf20Sopenharmony_ci/* uS: 83mS is max packet time (64KB ampdu @ 6Mbps) */
398c2ecf20Sopenharmony_ci#define	BRCMS_MAX_MAC_SUSPEND	83000
408c2ecf20Sopenharmony_ci
418c2ecf20Sopenharmony_ci/* responses for probe requests older that this are tossed, zero to disable */
428c2ecf20Sopenharmony_ci#define BRCMS_PRB_RESP_TIMEOUT	0	/* Disable probe response timeout */
438c2ecf20Sopenharmony_ci
448c2ecf20Sopenharmony_ci/* transmit buffer max headroom for protocol headers */
458c2ecf20Sopenharmony_ci#define TXOFF (D11_TXH_LEN + D11_PHY_HDR_LEN)
468c2ecf20Sopenharmony_ci
478c2ecf20Sopenharmony_ci/* Macros for doing definition and get/set of bitfields
488c2ecf20Sopenharmony_ci * Usage example, e.g. a three-bit field (bits 4-6):
498c2ecf20Sopenharmony_ci *    #define <NAME>_M	BITFIELD_MASK(3)
508c2ecf20Sopenharmony_ci *    #define <NAME>_S	4
518c2ecf20Sopenharmony_ci * ...
528c2ecf20Sopenharmony_ci *    regval = R_REG(osh, &regs->regfoo);
538c2ecf20Sopenharmony_ci *    field = GFIELD(regval, <NAME>);
548c2ecf20Sopenharmony_ci *    regval = SFIELD(regval, <NAME>, 1);
558c2ecf20Sopenharmony_ci *    W_REG(osh, &regs->regfoo, regval);
568c2ecf20Sopenharmony_ci */
578c2ecf20Sopenharmony_ci#define BITFIELD_MASK(width) \
588c2ecf20Sopenharmony_ci		(((unsigned)1 << (width)) - 1)
598c2ecf20Sopenharmony_ci#define GFIELD(val, field) \
608c2ecf20Sopenharmony_ci		(((val) >> field ## _S) & field ## _M)
618c2ecf20Sopenharmony_ci#define SFIELD(val, field, bits) \
628c2ecf20Sopenharmony_ci		(((val) & (~(field ## _M << field ## _S))) | \
638c2ecf20Sopenharmony_ci		 ((unsigned)(bits) << field ## _S))
648c2ecf20Sopenharmony_ci
658c2ecf20Sopenharmony_ci#define	SW_TIMER_MAC_STAT_UPD		30	/* periodic MAC stats update */
668c2ecf20Sopenharmony_ci
678c2ecf20Sopenharmony_ci/* max # supported core revisions (0 .. MAXCOREREV - 1) */
688c2ecf20Sopenharmony_ci#define	MAXCOREREV		28
698c2ecf20Sopenharmony_ci
708c2ecf20Sopenharmony_ci/* Double check that unsupported cores are not enabled */
718c2ecf20Sopenharmony_ci#if CONF_MSK(D11CONF, 0x4f) || CONF_GE(D11CONF, MAXCOREREV)
728c2ecf20Sopenharmony_ci#error "Configuration for D11CONF includes unsupported versions."
738c2ecf20Sopenharmony_ci#endif				/* Bad versions */
748c2ecf20Sopenharmony_ci
758c2ecf20Sopenharmony_ci/* values for shortslot_override */
768c2ecf20Sopenharmony_ci#define BRCMS_SHORTSLOT_AUTO	-1 /* Driver will manage Shortslot setting */
778c2ecf20Sopenharmony_ci#define BRCMS_SHORTSLOT_OFF	0  /* Turn off short slot */
788c2ecf20Sopenharmony_ci#define BRCMS_SHORTSLOT_ON	1  /* Turn on short slot */
798c2ecf20Sopenharmony_ci
808c2ecf20Sopenharmony_ci/* value for short/long and mixmode/greenfield preamble */
818c2ecf20Sopenharmony_ci#define BRCMS_LONG_PREAMBLE	(0)
828c2ecf20Sopenharmony_ci#define BRCMS_SHORT_PREAMBLE	(1 << 0)
838c2ecf20Sopenharmony_ci#define BRCMS_GF_PREAMBLE		(1 << 1)
848c2ecf20Sopenharmony_ci#define BRCMS_MM_PREAMBLE		(1 << 2)
858c2ecf20Sopenharmony_ci#define BRCMS_IS_MIMO_PREAMBLE(_pre) (((_pre) == BRCMS_GF_PREAMBLE) || \
868c2ecf20Sopenharmony_ci				      ((_pre) == BRCMS_MM_PREAMBLE))
878c2ecf20Sopenharmony_ci
888c2ecf20Sopenharmony_ci/* TxFrameID */
898c2ecf20Sopenharmony_ci/* seq and frag bits: SEQNUM_SHIFT, FRAGNUM_MASK (802.11.h) */
908c2ecf20Sopenharmony_ci/* rate epoch bits: TXFID_RATE_SHIFT, TXFID_RATE_MASK ((wlc_rate.c) */
918c2ecf20Sopenharmony_ci#define TXFID_QUEUE_MASK	0x0007	/* Bits 0-2 */
928c2ecf20Sopenharmony_ci#define TXFID_SEQ_MASK		0x7FE0	/* Bits 5-15 */
938c2ecf20Sopenharmony_ci#define TXFID_SEQ_SHIFT		5	/* Number of bit shifts */
948c2ecf20Sopenharmony_ci#define	TXFID_RATE_PROBE_MASK	0x8000	/* Bit 15 for rate probe */
958c2ecf20Sopenharmony_ci#define TXFID_RATE_MASK		0x0018	/* Mask for bits 3 and 4 */
968c2ecf20Sopenharmony_ci#define TXFID_RATE_SHIFT	3	/* Shift 3 bits for rate mask */
978c2ecf20Sopenharmony_ci
988c2ecf20Sopenharmony_ci/* promote boardrev */
998c2ecf20Sopenharmony_ci#define BOARDREV_PROMOTABLE	0xFF	/* from */
1008c2ecf20Sopenharmony_ci#define BOARDREV_PROMOTED	1	/* to */
1018c2ecf20Sopenharmony_ci
1028c2ecf20Sopenharmony_ci#define DATA_BLOCK_TX_SUPR	(1 << 4)
1038c2ecf20Sopenharmony_ci
1048c2ecf20Sopenharmony_ci/* Ucode MCTL_WAKE override bits */
1058c2ecf20Sopenharmony_ci#define BRCMS_WAKE_OVERRIDE_CLKCTL	0x01
1068c2ecf20Sopenharmony_ci#define BRCMS_WAKE_OVERRIDE_PHYREG	0x02
1078c2ecf20Sopenharmony_ci#define BRCMS_WAKE_OVERRIDE_MACSUSPEND	0x04
1088c2ecf20Sopenharmony_ci#define BRCMS_WAKE_OVERRIDE_TXFIFO	0x08
1098c2ecf20Sopenharmony_ci#define BRCMS_WAKE_OVERRIDE_FORCEFAST	0x10
1108c2ecf20Sopenharmony_ci
1118c2ecf20Sopenharmony_ci/* stuff pulled in from wlc.c */
1128c2ecf20Sopenharmony_ci
1138c2ecf20Sopenharmony_ci/* Interrupt bit error summary.  Don't include I_RU: we refill DMA at other
1148c2ecf20Sopenharmony_ci * times; and if we run out, constant I_RU interrupts may cause lockup.  We
1158c2ecf20Sopenharmony_ci * will still get error counts from rx0ovfl.
1168c2ecf20Sopenharmony_ci */
1178c2ecf20Sopenharmony_ci#define	I_ERRORS	(I_PC | I_PD | I_DE | I_RO | I_XU)
1188c2ecf20Sopenharmony_ci/* default software intmasks */
1198c2ecf20Sopenharmony_ci#define	DEF_RXINTMASK	(I_RI)	/* enable rx int on rxfifo only */
1208c2ecf20Sopenharmony_ci#define	DEF_MACINTMASK	(MI_TXSTOP | MI_TBTT | MI_ATIMWINEND | MI_PMQ | \
1218c2ecf20Sopenharmony_ci			 MI_PHYTXERR | MI_DMAINT | MI_TFS | MI_BG_NOISE | \
1228c2ecf20Sopenharmony_ci			 MI_CCA | MI_TO | MI_GP0 | MI_RFDISABLE | MI_PWRUP)
1238c2ecf20Sopenharmony_ci
1248c2ecf20Sopenharmony_ci#define	MAXTXPKTS		6	/* max # pkts pending */
1258c2ecf20Sopenharmony_ci
1268c2ecf20Sopenharmony_ci/* frameburst */
1278c2ecf20Sopenharmony_ci#define	MAXTXFRAMEBURST		8 /* vanilla xpress mode: max frames/burst */
1288c2ecf20Sopenharmony_ci#define	MAXFRAMEBURST_TXOP	10000	/* Frameburst TXOP in usec */
1298c2ecf20Sopenharmony_ci
1308c2ecf20Sopenharmony_ci#define	NFIFO			6	/* # tx/rx fifopairs */
1318c2ecf20Sopenharmony_ci
1328c2ecf20Sopenharmony_ci/* PLL requests */
1338c2ecf20Sopenharmony_ci
1348c2ecf20Sopenharmony_ci/* pll is shared on old chips */
1358c2ecf20Sopenharmony_ci#define BRCMS_PLLREQ_SHARED	0x1
1368c2ecf20Sopenharmony_ci/* hold pll for radio monitor register checking */
1378c2ecf20Sopenharmony_ci#define BRCMS_PLLREQ_RADIO_MON	0x2
1388c2ecf20Sopenharmony_ci/* hold/release pll for some short operation */
1398c2ecf20Sopenharmony_ci#define BRCMS_PLLREQ_FLIP		0x4
1408c2ecf20Sopenharmony_ci
1418c2ecf20Sopenharmony_ci#define	CHANNEL_BANDUNIT(wlc, ch) \
1428c2ecf20Sopenharmony_ci	(((ch) <= CH_MAX_2G_CHANNEL) ? BAND_2G_INDEX : BAND_5G_INDEX)
1438c2ecf20Sopenharmony_ci
1448c2ecf20Sopenharmony_ci#define	OTHERBANDUNIT(wlc) \
1458c2ecf20Sopenharmony_ci	((uint)((wlc)->band->bandunit ? BAND_2G_INDEX : BAND_5G_INDEX))
1468c2ecf20Sopenharmony_ci
1478c2ecf20Sopenharmony_ci/*
1488c2ecf20Sopenharmony_ci * 802.11 protection information
1498c2ecf20Sopenharmony_ci *
1508c2ecf20Sopenharmony_ci * _g: use g spec protection, driver internal.
1518c2ecf20Sopenharmony_ci * g_override: override for use of g spec protection.
1528c2ecf20Sopenharmony_ci * gmode_user: user config gmode, operating band->gmode is different.
1538c2ecf20Sopenharmony_ci * overlap: Overlap BSS/IBSS protection for both 11g and 11n.
1548c2ecf20Sopenharmony_ci * nmode_user: user config nmode, operating pub->nmode is different.
1558c2ecf20Sopenharmony_ci * n_cfg: use OFDM protection on MIMO frames.
1568c2ecf20Sopenharmony_ci * n_cfg_override: override for use of N protection.
1578c2ecf20Sopenharmony_ci * nongf: non-GF present protection.
1588c2ecf20Sopenharmony_ci * nongf_override: override for use of GF protection.
1598c2ecf20Sopenharmony_ci * n_pam_override: override for preamble: MM or GF.
1608c2ecf20Sopenharmony_ci * n_obss: indicated OBSS Non-HT STA present.
1618c2ecf20Sopenharmony_ci*/
1628c2ecf20Sopenharmony_cistruct brcms_protection {
1638c2ecf20Sopenharmony_ci	bool _g;
1648c2ecf20Sopenharmony_ci	s8 g_override;
1658c2ecf20Sopenharmony_ci	u8 gmode_user;
1668c2ecf20Sopenharmony_ci	s8 overlap;
1678c2ecf20Sopenharmony_ci	s8 nmode_user;
1688c2ecf20Sopenharmony_ci	s8 n_cfg;
1698c2ecf20Sopenharmony_ci	s8 n_cfg_override;
1708c2ecf20Sopenharmony_ci	bool nongf;
1718c2ecf20Sopenharmony_ci	s8 nongf_override;
1728c2ecf20Sopenharmony_ci	s8 n_pam_override;
1738c2ecf20Sopenharmony_ci	bool n_obss;
1748c2ecf20Sopenharmony_ci};
1758c2ecf20Sopenharmony_ci
1768c2ecf20Sopenharmony_ci/*
1778c2ecf20Sopenharmony_ci * anything affecting the single/dual streams/antenna operation
1788c2ecf20Sopenharmony_ci *
1798c2ecf20Sopenharmony_ci * hw_txchain: HW txchain bitmap cfg.
1808c2ecf20Sopenharmony_ci * txchain: txchain bitmap being used.
1818c2ecf20Sopenharmony_ci * txstreams: number of txchains being used.
1828c2ecf20Sopenharmony_ci * hw_rxchain: HW rxchain bitmap cfg.
1838c2ecf20Sopenharmony_ci * rxchain: rxchain bitmap being used.
1848c2ecf20Sopenharmony_ci * rxstreams: number of rxchains being used.
1858c2ecf20Sopenharmony_ci * ant_rx_ovr: rx antenna override.
1868c2ecf20Sopenharmony_ci * txant: userTx antenna setting.
1878c2ecf20Sopenharmony_ci * phytxant: phyTx antenna setting in txheader.
1888c2ecf20Sopenharmony_ci * ss_opmode: singlestream Operational mode, 0:siso; 1:cdd.
1898c2ecf20Sopenharmony_ci * ss_algosel_auto: if true, use wlc->stf->ss_algo_channel;
1908c2ecf20Sopenharmony_ci *			else use wlc->band->stf->ss_mode_band.
1918c2ecf20Sopenharmony_ci * ss_algo_channel: ss based on per-channel algo: 0: SISO, 1: CDD 2: STBC.
1928c2ecf20Sopenharmony_ci * rxchain_restore_delay: delay time to restore default rxchain.
1938c2ecf20Sopenharmony_ci * ldpc: AUTO/ON/OFF ldpc cap supported.
1948c2ecf20Sopenharmony_ci * txcore[MAX_STREAMS_SUPPORTED + 1]: bitmap of selected core for each Nsts.
1958c2ecf20Sopenharmony_ci * spatial_policy:
1968c2ecf20Sopenharmony_ci */
1978c2ecf20Sopenharmony_cistruct brcms_stf {
1988c2ecf20Sopenharmony_ci	u8 hw_txchain;
1998c2ecf20Sopenharmony_ci	u8 txchain;
2008c2ecf20Sopenharmony_ci	u8 txstreams;
2018c2ecf20Sopenharmony_ci	u8 hw_rxchain;
2028c2ecf20Sopenharmony_ci	u8 rxchain;
2038c2ecf20Sopenharmony_ci	u8 rxstreams;
2048c2ecf20Sopenharmony_ci	u8 ant_rx_ovr;
2058c2ecf20Sopenharmony_ci	s8 txant;
2068c2ecf20Sopenharmony_ci	u16 phytxant;
2078c2ecf20Sopenharmony_ci	u8 ss_opmode;
2088c2ecf20Sopenharmony_ci	bool ss_algosel_auto;
2098c2ecf20Sopenharmony_ci	u16 ss_algo_channel;
2108c2ecf20Sopenharmony_ci	u8 rxchain_restore_delay;
2118c2ecf20Sopenharmony_ci	s8 ldpc;
2128c2ecf20Sopenharmony_ci	u8 txcore[MAX_STREAMS_SUPPORTED + 1];
2138c2ecf20Sopenharmony_ci	s8 spatial_policy;
2148c2ecf20Sopenharmony_ci};
2158c2ecf20Sopenharmony_ci
2168c2ecf20Sopenharmony_ci#define BRCMS_STF_SS_STBC_TX(wlc, scb) \
2178c2ecf20Sopenharmony_ci	(((wlc)->stf->txstreams > 1) && (((wlc)->band->band_stf_stbc_tx == ON) \
2188c2ecf20Sopenharmony_ci	 || (((scb)->flags & SCB_STBCCAP) && \
2198c2ecf20Sopenharmony_ci	     (wlc)->band->band_stf_stbc_tx == AUTO && \
2208c2ecf20Sopenharmony_ci	     isset(&((wlc)->stf->ss_algo_channel), PHY_TXC1_MODE_STBC))))
2218c2ecf20Sopenharmony_ci
2228c2ecf20Sopenharmony_ci#define BRCMS_STBC_CAP_PHY(wlc) (BRCMS_ISNPHY(wlc->band) && \
2238c2ecf20Sopenharmony_ci				 NREV_GE(wlc->band->phyrev, 3))
2248c2ecf20Sopenharmony_ci
2258c2ecf20Sopenharmony_ci#define BRCMS_SGI_CAP_PHY(wlc) ((BRCMS_ISNPHY(wlc->band) && \
2268c2ecf20Sopenharmony_ci				 NREV_GE(wlc->band->phyrev, 3)) || \
2278c2ecf20Sopenharmony_ci				BRCMS_ISLCNPHY(wlc->band))
2288c2ecf20Sopenharmony_ci
2298c2ecf20Sopenharmony_ci#define BRCMS_CHAN_PHYTYPE(x)     (((x) & RXS_CHAN_PHYTYPE_MASK) \
2308c2ecf20Sopenharmony_ci				   >> RXS_CHAN_PHYTYPE_SHIFT)
2318c2ecf20Sopenharmony_ci#define BRCMS_CHAN_CHANNEL(x)     (((x) & RXS_CHAN_ID_MASK) \
2328c2ecf20Sopenharmony_ci				   >> RXS_CHAN_ID_SHIFT)
2338c2ecf20Sopenharmony_ci
2348c2ecf20Sopenharmony_ci/*
2358c2ecf20Sopenharmony_ci * core state (mac)
2368c2ecf20Sopenharmony_ci */
2378c2ecf20Sopenharmony_cistruct brcms_core {
2388c2ecf20Sopenharmony_ci	uint coreidx;		/* # sb enumerated core */
2398c2ecf20Sopenharmony_ci
2408c2ecf20Sopenharmony_ci	/* fifo */
2418c2ecf20Sopenharmony_ci	uint *txavail[NFIFO];	/* # tx descriptors available */
2428c2ecf20Sopenharmony_ci
2438c2ecf20Sopenharmony_ci	struct macstat *macstat_snapshot;	/* mac hw prev read values */
2448c2ecf20Sopenharmony_ci};
2458c2ecf20Sopenharmony_ci
2468c2ecf20Sopenharmony_ci/*
2478c2ecf20Sopenharmony_ci * band state (phy+ana+radio)
2488c2ecf20Sopenharmony_ci */
2498c2ecf20Sopenharmony_cistruct brcms_band {
2508c2ecf20Sopenharmony_ci	int bandtype;		/* BRCM_BAND_2G, BRCM_BAND_5G */
2518c2ecf20Sopenharmony_ci	uint bandunit;		/* bandstate[] index */
2528c2ecf20Sopenharmony_ci
2538c2ecf20Sopenharmony_ci	u16 phytype;		/* phytype */
2548c2ecf20Sopenharmony_ci	u16 phyrev;
2558c2ecf20Sopenharmony_ci	u16 radioid;
2568c2ecf20Sopenharmony_ci	u16 radiorev;
2578c2ecf20Sopenharmony_ci	struct brcms_phy_pub *pi; /* pointer to phy specific information */
2588c2ecf20Sopenharmony_ci	bool abgphy_encore;
2598c2ecf20Sopenharmony_ci
2608c2ecf20Sopenharmony_ci	u8 gmode;		/* currently active gmode */
2618c2ecf20Sopenharmony_ci
2628c2ecf20Sopenharmony_ci	struct scb *hwrs_scb;	/* permanent scb for hw rateset */
2638c2ecf20Sopenharmony_ci
2648c2ecf20Sopenharmony_ci	/* band-specific copy of default_bss.rateset */
2658c2ecf20Sopenharmony_ci	struct brcms_c_rateset defrateset;
2668c2ecf20Sopenharmony_ci
2678c2ecf20Sopenharmony_ci	u8 band_stf_ss_mode;	/* Configured STF type, 0:siso; 1:cdd */
2688c2ecf20Sopenharmony_ci	s8 band_stf_stbc_tx;	/* STBC TX 0:off; 1:force on; -1:auto */
2698c2ecf20Sopenharmony_ci	/* rates supported by chip (phy-specific) */
2708c2ecf20Sopenharmony_ci	struct brcms_c_rateset hw_rateset;
2718c2ecf20Sopenharmony_ci	u8 basic_rate[BRCM_MAXRATE + 1]; /* basic rates indexed by rate */
2728c2ecf20Sopenharmony_ci	bool mimo_cap_40;	/* 40 MHz cap enabled on this band */
2738c2ecf20Sopenharmony_ci	s8 antgain;		/* antenna gain from srom */
2748c2ecf20Sopenharmony_ci
2758c2ecf20Sopenharmony_ci	u16 CWmin; /* minimum size of contention window, in unit of aSlotTime */
2768c2ecf20Sopenharmony_ci	u16 CWmax; /* maximum size of contention window, in unit of aSlotTime */
2778c2ecf20Sopenharmony_ci	struct ieee80211_supported_band band;
2788c2ecf20Sopenharmony_ci};
2798c2ecf20Sopenharmony_ci
2808c2ecf20Sopenharmony_ci/* module control blocks */
2818c2ecf20Sopenharmony_cistruct modulecb {
2828c2ecf20Sopenharmony_ci	/* module name : NULL indicates empty array member */
2838c2ecf20Sopenharmony_ci	char name[32];
2848c2ecf20Sopenharmony_ci	/* handle passed when handler 'doiovar' is called */
2858c2ecf20Sopenharmony_ci	struct brcms_info *hdl;
2868c2ecf20Sopenharmony_ci
2878c2ecf20Sopenharmony_ci	int (*down_fn)(void *handle); /* down handler. Note: the int returned
2888c2ecf20Sopenharmony_ci				       * by the down function is a count of the
2898c2ecf20Sopenharmony_ci				       * number of timers that could not be
2908c2ecf20Sopenharmony_ci				       * freed.
2918c2ecf20Sopenharmony_ci				       */
2928c2ecf20Sopenharmony_ci
2938c2ecf20Sopenharmony_ci};
2948c2ecf20Sopenharmony_ci
2958c2ecf20Sopenharmony_cistruct brcms_hw_band {
2968c2ecf20Sopenharmony_ci	int bandtype;		/* BRCM_BAND_2G, BRCM_BAND_5G */
2978c2ecf20Sopenharmony_ci	uint bandunit;		/* bandstate[] index */
2988c2ecf20Sopenharmony_ci	u16 mhfs[MHFMAX];	/* MHF array shadow */
2998c2ecf20Sopenharmony_ci	u8 bandhw_stf_ss_mode;	/* HW configured STF type, 0:siso; 1:cdd */
3008c2ecf20Sopenharmony_ci	u16 CWmin;
3018c2ecf20Sopenharmony_ci	u16 CWmax;
3028c2ecf20Sopenharmony_ci	u32 core_flags;
3038c2ecf20Sopenharmony_ci
3048c2ecf20Sopenharmony_ci	u16 phytype;		/* phytype */
3058c2ecf20Sopenharmony_ci	u16 phyrev;
3068c2ecf20Sopenharmony_ci	u16 radioid;
3078c2ecf20Sopenharmony_ci	u16 radiorev;
3088c2ecf20Sopenharmony_ci	struct brcms_phy_pub *pi; /* pointer to phy specific information */
3098c2ecf20Sopenharmony_ci	bool abgphy_encore;
3108c2ecf20Sopenharmony_ci};
3118c2ecf20Sopenharmony_ci
3128c2ecf20Sopenharmony_cistruct brcms_hardware {
3138c2ecf20Sopenharmony_ci	bool _piomode;		/* true if pio mode */
3148c2ecf20Sopenharmony_ci	struct brcms_c_info *wlc;
3158c2ecf20Sopenharmony_ci
3168c2ecf20Sopenharmony_ci	/* fifo */
3178c2ecf20Sopenharmony_ci	struct dma_pub *di[NFIFO];	/* dma handles, per fifo */
3188c2ecf20Sopenharmony_ci
3198c2ecf20Sopenharmony_ci	uint unit;		/* device instance number */
3208c2ecf20Sopenharmony_ci
3218c2ecf20Sopenharmony_ci	/* version info */
3228c2ecf20Sopenharmony_ci	u16 vendorid;	/* PCI vendor id */
3238c2ecf20Sopenharmony_ci	u16 deviceid;	/* PCI device id */
3248c2ecf20Sopenharmony_ci	uint corerev;		/* core revision */
3258c2ecf20Sopenharmony_ci	u8 sromrev;		/* version # of the srom */
3268c2ecf20Sopenharmony_ci	u16 boardrev;	/* version # of particular board */
3278c2ecf20Sopenharmony_ci	u32 boardflags;	/* Board specific flags from srom */
3288c2ecf20Sopenharmony_ci	u32 boardflags2;	/* More board flags if sromrev >= 4 */
3298c2ecf20Sopenharmony_ci	u32 machwcap;	/* MAC capabilities */
3308c2ecf20Sopenharmony_ci	u32 machwcap_backup;	/* backup of machwcap */
3318c2ecf20Sopenharmony_ci
3328c2ecf20Sopenharmony_ci	struct si_pub *sih;	/* SI handle (cookie for siutils calls) */
3338c2ecf20Sopenharmony_ci	struct bcma_device *d11core;	/* pointer to 802.11 core */
3348c2ecf20Sopenharmony_ci	struct phy_shim_info *physhim; /* phy shim layer handler */
3358c2ecf20Sopenharmony_ci	struct shared_phy *phy_sh;	/* pointer to shared phy state */
3368c2ecf20Sopenharmony_ci	struct brcms_hw_band *band;/* pointer to active per-band state */
3378c2ecf20Sopenharmony_ci	/* band state per phy/radio */
3388c2ecf20Sopenharmony_ci	struct brcms_hw_band *bandstate[MAXBANDS];
3398c2ecf20Sopenharmony_ci	u16 bmac_phytxant;	/* cache of high phytxant state */
3408c2ecf20Sopenharmony_ci	bool shortslot;		/* currently using 11g ShortSlot timing */
3418c2ecf20Sopenharmony_ci	u16 SRL;		/* 802.11 dot11ShortRetryLimit */
3428c2ecf20Sopenharmony_ci	u16 LRL;		/* 802.11 dot11LongRetryLimit */
3438c2ecf20Sopenharmony_ci	u16 SFBL;		/* Short Frame Rate Fallback Limit */
3448c2ecf20Sopenharmony_ci	u16 LFBL;		/* Long Frame Rate Fallback Limit */
3458c2ecf20Sopenharmony_ci
3468c2ecf20Sopenharmony_ci	bool up;		/* d11 hardware up and running */
3478c2ecf20Sopenharmony_ci	uint now;		/* # elapsed seconds */
3488c2ecf20Sopenharmony_ci	uint _nbands;		/* # bands supported */
3498c2ecf20Sopenharmony_ci	u16 chanspec;	/* bmac chanspec shadow */
3508c2ecf20Sopenharmony_ci
3518c2ecf20Sopenharmony_ci	uint *txavail[NFIFO];	/* # tx descriptors available */
3528c2ecf20Sopenharmony_ci	const u16 *xmtfifo_sz;	/* fifo size in 256B for each xmt fifo */
3538c2ecf20Sopenharmony_ci
3548c2ecf20Sopenharmony_ci	u32 pllreq;		/* pll requests to keep PLL on */
3558c2ecf20Sopenharmony_ci
3568c2ecf20Sopenharmony_ci	u8 suspended_fifos;	/* Which TX fifo to remain awake for */
3578c2ecf20Sopenharmony_ci	u32 maccontrol;	/* Cached value of maccontrol */
3588c2ecf20Sopenharmony_ci	uint mac_suspend_depth;	/* current depth of mac_suspend levels */
3598c2ecf20Sopenharmony_ci	u32 wake_override;	/* bit flags to force MAC to WAKE mode */
3608c2ecf20Sopenharmony_ci	u32 mute_override;	/* Prevent ucode from sending beacons */
3618c2ecf20Sopenharmony_ci	u8 etheraddr[ETH_ALEN];	/* currently configured ethernet address */
3628c2ecf20Sopenharmony_ci	bool noreset;		/* true= do not reset hw, used by WLC_OUT */
3638c2ecf20Sopenharmony_ci	bool forcefastclk;	/* true if h/w is forcing to use fast clk */
3648c2ecf20Sopenharmony_ci	bool clk;		/* core is out of reset and has clock */
3658c2ecf20Sopenharmony_ci	bool sbclk;		/* sb has clock */
3668c2ecf20Sopenharmony_ci	bool phyclk;		/* phy is out of reset and has clock */
3678c2ecf20Sopenharmony_ci
3688c2ecf20Sopenharmony_ci	bool ucode_loaded;	/* true after ucode downloaded */
3698c2ecf20Sopenharmony_ci
3708c2ecf20Sopenharmony_ci
3718c2ecf20Sopenharmony_ci	u8 hw_stf_ss_opmode;	/* STF single stream operation mode */
3728c2ecf20Sopenharmony_ci	u8 antsel_type;	/* Type of boardlevel mimo antenna switch-logic
3738c2ecf20Sopenharmony_ci				 * 0 = N/A, 1 = 2x4 board, 2 = 2x3 CB2 board
3748c2ecf20Sopenharmony_ci				 */
3758c2ecf20Sopenharmony_ci	u32 antsel_avail;	/*
3768c2ecf20Sopenharmony_ci				 * put struct antsel_info here if more info is
3778c2ecf20Sopenharmony_ci				 * needed
3788c2ecf20Sopenharmony_ci				 */
3798c2ecf20Sopenharmony_ci};
3808c2ecf20Sopenharmony_ci
3818c2ecf20Sopenharmony_ci/*
3828c2ecf20Sopenharmony_ci * Principal common driver data structure.
3838c2ecf20Sopenharmony_ci *
3848c2ecf20Sopenharmony_ci * pub: pointer to driver public state.
3858c2ecf20Sopenharmony_ci * wl: pointer to specific private state.
3868c2ecf20Sopenharmony_ci * hw: HW related state.
3878c2ecf20Sopenharmony_ci * clkreq_override: setting for clkreq for PCIE : Auto, 0, 1.
3888c2ecf20Sopenharmony_ci * fastpwrup_dly: time in us needed to bring up d11 fast clock.
3898c2ecf20Sopenharmony_ci * macintstatus: bit channel between isr and dpc.
3908c2ecf20Sopenharmony_ci * macintmask: sw runtime master macintmask value.
3918c2ecf20Sopenharmony_ci * defmacintmask: default "on" macintmask value.
3928c2ecf20Sopenharmony_ci * clk: core is out of reset and has clock.
3938c2ecf20Sopenharmony_ci * core: pointer to active io core.
3948c2ecf20Sopenharmony_ci * band: pointer to active per-band state.
3958c2ecf20Sopenharmony_ci * corestate: per-core state (one per hw core).
3968c2ecf20Sopenharmony_ci * bandstate: per-band state (one per phy/radio).
3978c2ecf20Sopenharmony_ci * qvalid: DirFrmQValid and BcMcFrmQValid.
3988c2ecf20Sopenharmony_ci * ampdu: ampdu module handler.
3998c2ecf20Sopenharmony_ci * asi: antsel module handler.
4008c2ecf20Sopenharmony_ci * cmi: channel manager module handler.
4018c2ecf20Sopenharmony_ci * vendorid: PCI vendor id.
4028c2ecf20Sopenharmony_ci * deviceid: PCI device id.
4038c2ecf20Sopenharmony_ci * ucode_rev: microcode revision.
4048c2ecf20Sopenharmony_ci * machwcap: MAC capabilities, BMAC shadow.
4058c2ecf20Sopenharmony_ci * perm_etheraddr: original sprom local ethernet address.
4068c2ecf20Sopenharmony_ci * bandlocked: disable auto multi-band switching.
4078c2ecf20Sopenharmony_ci * bandinit_pending: track band init in auto band.
4088c2ecf20Sopenharmony_ci * radio_monitor: radio timer is running.
4098c2ecf20Sopenharmony_ci * going_down: down path intermediate variable.
4108c2ecf20Sopenharmony_ci * wdtimer: timer for watchdog routine.
4118c2ecf20Sopenharmony_ci * radio_timer: timer for hw radio button monitor routine.
4128c2ecf20Sopenharmony_ci * monitor: monitor (MPDU sniffing) mode.
4138c2ecf20Sopenharmony_ci * bcnmisc_monitor: bcns promisc mode override for monitor.
4148c2ecf20Sopenharmony_ci * _rifs: enable per-packet rifs.
4158c2ecf20Sopenharmony_ci * bcn_li_bcn: beacon listen interval in # beacons.
4168c2ecf20Sopenharmony_ci * bcn_li_dtim: beacon listen interval in # dtims.
4178c2ecf20Sopenharmony_ci * WDarmed: watchdog timer is armed.
4188c2ecf20Sopenharmony_ci * WDlast: last time wlc_watchdog() was called.
4198c2ecf20Sopenharmony_ci * edcf_txop[IEEE80211_NUM_ACS]: current txop for each ac.
4208c2ecf20Sopenharmony_ci * wme_retries: per-AC retry limits.
4218c2ecf20Sopenharmony_ci * bsscfg: set of BSS configurations, idx 0 is default and always valid.
4228c2ecf20Sopenharmony_ci * cfg: the primary bsscfg (can be AP or STA).
4238c2ecf20Sopenharmony_ci * modulecb:
4248c2ecf20Sopenharmony_ci * mimoft: SIGN or 11N.
4258c2ecf20Sopenharmony_ci * cck_40txbw: 11N, cck tx b/w override when in 40MHZ mode.
4268c2ecf20Sopenharmony_ci * ofdm_40txbw: 11N, ofdm tx b/w override when in 40MHZ mode.
4278c2ecf20Sopenharmony_ci * mimo_40txbw: 11N, mimo tx b/w override when in 40MHZ mode.
4288c2ecf20Sopenharmony_ci * default_bss: configured BSS parameters.
4298c2ecf20Sopenharmony_ci * mc_fid_counter: BC/MC FIFO frame ID counter.
4308c2ecf20Sopenharmony_ci * country_default: saved country for leaving 802.11d auto-country mode.
4318c2ecf20Sopenharmony_ci * autocountry_default: initial country for 802.11d auto-country mode.
4328c2ecf20Sopenharmony_ci * prb_resp_timeout: do not send prb resp if request older
4338c2ecf20Sopenharmony_ci *		     than this, 0 = disable.
4348c2ecf20Sopenharmony_ci * home_chanspec: shared home chanspec.
4358c2ecf20Sopenharmony_ci * chanspec: target operational channel.
4368c2ecf20Sopenharmony_ci * usr_fragthresh: user configured fragmentation threshold.
4378c2ecf20Sopenharmony_ci * fragthresh[NFIFO]: per-fifo fragmentation thresholds.
4388c2ecf20Sopenharmony_ci * RTSThresh: 802.11 dot11RTSThreshold.
4398c2ecf20Sopenharmony_ci * SRL: 802.11 dot11ShortRetryLimit.
4408c2ecf20Sopenharmony_ci * LRL: 802.11 dot11LongRetryLimit.
4418c2ecf20Sopenharmony_ci * SFBL: Short Frame Rate Fallback Limit.
4428c2ecf20Sopenharmony_ci * LFBL: Long Frame Rate Fallback Limit.
4438c2ecf20Sopenharmony_ci * shortslot: currently using 11g ShortSlot timing.
4448c2ecf20Sopenharmony_ci * shortslot_override: 11g ShortSlot override.
4458c2ecf20Sopenharmony_ci * include_legacy_erp: include Legacy ERP info elt ID 47 as well as g ID 42.
4468c2ecf20Sopenharmony_ci * PLCPHdr_override: 802.11b Preamble Type override.
4478c2ecf20Sopenharmony_ci * stf:
4488c2ecf20Sopenharmony_ci * bcn_rspec: save bcn ratespec purpose.
4498c2ecf20Sopenharmony_ci * tempsense_lasttime;
4508c2ecf20Sopenharmony_ci * tx_duty_cycle_ofdm: maximum allowed duty cycle for OFDM.
4518c2ecf20Sopenharmony_ci * tx_duty_cycle_cck: maximum allowed duty cycle for CCK.
4528c2ecf20Sopenharmony_ci * wiphy:
4538c2ecf20Sopenharmony_ci * pri_scb: primary Station Control Block
4548c2ecf20Sopenharmony_ci */
4558c2ecf20Sopenharmony_cistruct brcms_c_info {
4568c2ecf20Sopenharmony_ci	struct brcms_pub *pub;
4578c2ecf20Sopenharmony_ci	struct brcms_info *wl;
4588c2ecf20Sopenharmony_ci	struct brcms_hardware *hw;
4598c2ecf20Sopenharmony_ci
4608c2ecf20Sopenharmony_ci	/* clock */
4618c2ecf20Sopenharmony_ci	u16 fastpwrup_dly;
4628c2ecf20Sopenharmony_ci
4638c2ecf20Sopenharmony_ci	/* interrupt */
4648c2ecf20Sopenharmony_ci	u32 macintstatus;
4658c2ecf20Sopenharmony_ci	u32 macintmask;
4668c2ecf20Sopenharmony_ci	u32 defmacintmask;
4678c2ecf20Sopenharmony_ci
4688c2ecf20Sopenharmony_ci	bool clk;
4698c2ecf20Sopenharmony_ci
4708c2ecf20Sopenharmony_ci	/* multiband */
4718c2ecf20Sopenharmony_ci	struct brcms_core *core;
4728c2ecf20Sopenharmony_ci	struct brcms_band *band;
4738c2ecf20Sopenharmony_ci	struct brcms_core *corestate;
4748c2ecf20Sopenharmony_ci	struct brcms_band *bandstate[MAXBANDS];
4758c2ecf20Sopenharmony_ci
4768c2ecf20Sopenharmony_ci	/* packet queue */
4778c2ecf20Sopenharmony_ci	uint qvalid;
4788c2ecf20Sopenharmony_ci
4798c2ecf20Sopenharmony_ci	struct ampdu_info *ampdu;
4808c2ecf20Sopenharmony_ci	struct antsel_info *asi;
4818c2ecf20Sopenharmony_ci	struct brcms_cm_info *cmi;
4828c2ecf20Sopenharmony_ci
4838c2ecf20Sopenharmony_ci	u16 vendorid;
4848c2ecf20Sopenharmony_ci	u16 deviceid;
4858c2ecf20Sopenharmony_ci	uint ucode_rev;
4868c2ecf20Sopenharmony_ci
4878c2ecf20Sopenharmony_ci	u8 perm_etheraddr[ETH_ALEN];
4888c2ecf20Sopenharmony_ci
4898c2ecf20Sopenharmony_ci	bool bandlocked;
4908c2ecf20Sopenharmony_ci	bool bandinit_pending;
4918c2ecf20Sopenharmony_ci
4928c2ecf20Sopenharmony_ci	bool radio_monitor;
4938c2ecf20Sopenharmony_ci	bool going_down;
4948c2ecf20Sopenharmony_ci
4958c2ecf20Sopenharmony_ci	bool beacon_template_virgin;
4968c2ecf20Sopenharmony_ci
4978c2ecf20Sopenharmony_ci	struct brcms_timer *wdtimer;
4988c2ecf20Sopenharmony_ci	struct brcms_timer *radio_timer;
4998c2ecf20Sopenharmony_ci
5008c2ecf20Sopenharmony_ci	/* promiscuous */
5018c2ecf20Sopenharmony_ci	uint filter_flags;
5028c2ecf20Sopenharmony_ci
5038c2ecf20Sopenharmony_ci	/* driver feature */
5048c2ecf20Sopenharmony_ci	bool _rifs;
5058c2ecf20Sopenharmony_ci
5068c2ecf20Sopenharmony_ci	/* AP-STA synchronization, power save */
5078c2ecf20Sopenharmony_ci	u8 bcn_li_bcn;
5088c2ecf20Sopenharmony_ci	u8 bcn_li_dtim;
5098c2ecf20Sopenharmony_ci
5108c2ecf20Sopenharmony_ci	bool WDarmed;
5118c2ecf20Sopenharmony_ci	u32 WDlast;
5128c2ecf20Sopenharmony_ci
5138c2ecf20Sopenharmony_ci	/* WME */
5148c2ecf20Sopenharmony_ci	u16 edcf_txop[IEEE80211_NUM_ACS];
5158c2ecf20Sopenharmony_ci
5168c2ecf20Sopenharmony_ci	u16 wme_retries[IEEE80211_NUM_ACS];
5178c2ecf20Sopenharmony_ci
5188c2ecf20Sopenharmony_ci	struct brcms_bss_cfg *bsscfg;
5198c2ecf20Sopenharmony_ci
5208c2ecf20Sopenharmony_ci	struct modulecb *modulecb;
5218c2ecf20Sopenharmony_ci
5228c2ecf20Sopenharmony_ci	u8 mimoft;
5238c2ecf20Sopenharmony_ci	s8 cck_40txbw;
5248c2ecf20Sopenharmony_ci	s8 ofdm_40txbw;
5258c2ecf20Sopenharmony_ci	s8 mimo_40txbw;
5268c2ecf20Sopenharmony_ci
5278c2ecf20Sopenharmony_ci	struct brcms_bss_info *default_bss;
5288c2ecf20Sopenharmony_ci
5298c2ecf20Sopenharmony_ci	u16 mc_fid_counter;
5308c2ecf20Sopenharmony_ci
5318c2ecf20Sopenharmony_ci	char country_default[BRCM_CNTRY_BUF_SZ];
5328c2ecf20Sopenharmony_ci	char autocountry_default[BRCM_CNTRY_BUF_SZ];
5338c2ecf20Sopenharmony_ci	u16 prb_resp_timeout;
5348c2ecf20Sopenharmony_ci
5358c2ecf20Sopenharmony_ci	u16 home_chanspec;
5368c2ecf20Sopenharmony_ci
5378c2ecf20Sopenharmony_ci	/* PHY parameters */
5388c2ecf20Sopenharmony_ci	u16 chanspec;
5398c2ecf20Sopenharmony_ci	u16 usr_fragthresh;
5408c2ecf20Sopenharmony_ci	u16 fragthresh[NFIFO];
5418c2ecf20Sopenharmony_ci	u16 RTSThresh;
5428c2ecf20Sopenharmony_ci	u16 SRL;
5438c2ecf20Sopenharmony_ci	u16 LRL;
5448c2ecf20Sopenharmony_ci	u16 SFBL;
5458c2ecf20Sopenharmony_ci	u16 LFBL;
5468c2ecf20Sopenharmony_ci
5478c2ecf20Sopenharmony_ci	/* network config */
5488c2ecf20Sopenharmony_ci	bool shortslot;
5498c2ecf20Sopenharmony_ci	s8 shortslot_override;
5508c2ecf20Sopenharmony_ci	bool include_legacy_erp;
5518c2ecf20Sopenharmony_ci
5528c2ecf20Sopenharmony_ci	struct brcms_protection *protection;
5538c2ecf20Sopenharmony_ci	s8 PLCPHdr_override;
5548c2ecf20Sopenharmony_ci
5558c2ecf20Sopenharmony_ci	struct brcms_stf *stf;
5568c2ecf20Sopenharmony_ci
5578c2ecf20Sopenharmony_ci	u32 bcn_rspec;
5588c2ecf20Sopenharmony_ci
5598c2ecf20Sopenharmony_ci	uint tempsense_lasttime;
5608c2ecf20Sopenharmony_ci
5618c2ecf20Sopenharmony_ci	u16 tx_duty_cycle_ofdm;
5628c2ecf20Sopenharmony_ci	u16 tx_duty_cycle_cck;
5638c2ecf20Sopenharmony_ci
5648c2ecf20Sopenharmony_ci	struct wiphy *wiphy;
5658c2ecf20Sopenharmony_ci	struct scb pri_scb;
5668c2ecf20Sopenharmony_ci	struct ieee80211_vif *vif;
5678c2ecf20Sopenharmony_ci
5688c2ecf20Sopenharmony_ci	struct sk_buff *beacon;
5698c2ecf20Sopenharmony_ci	u16 beacon_tim_offset;
5708c2ecf20Sopenharmony_ci	u16 beacon_dtim_period;
5718c2ecf20Sopenharmony_ci	struct sk_buff *probe_resp;
5728c2ecf20Sopenharmony_ci};
5738c2ecf20Sopenharmony_ci
5748c2ecf20Sopenharmony_ci/* antsel module specific state */
5758c2ecf20Sopenharmony_cistruct antsel_info {
5768c2ecf20Sopenharmony_ci	struct brcms_c_info *wlc;	/* pointer to main wlc structure */
5778c2ecf20Sopenharmony_ci	struct brcms_pub *pub;		/* pointer to public fn */
5788c2ecf20Sopenharmony_ci	u8 antsel_type;	/* Type of boardlevel mimo antenna switch-logic
5798c2ecf20Sopenharmony_ci				 * 0 = N/A, 1 = 2x4 board, 2 = 2x3 CB2 board
5808c2ecf20Sopenharmony_ci				 */
5818c2ecf20Sopenharmony_ci	u8 antsel_antswitch;	/* board level antenna switch type */
5828c2ecf20Sopenharmony_ci	bool antsel_avail;	/* Ant selection availability (SROM based) */
5838c2ecf20Sopenharmony_ci	struct brcms_antselcfg antcfg_11n; /* antenna configuration */
5848c2ecf20Sopenharmony_ci	struct brcms_antselcfg antcfg_cur; /* current antenna config (auto) */
5858c2ecf20Sopenharmony_ci};
5868c2ecf20Sopenharmony_ci
5878c2ecf20Sopenharmony_cienum brcms_bss_type {
5888c2ecf20Sopenharmony_ci	BRCMS_TYPE_STATION,
5898c2ecf20Sopenharmony_ci	BRCMS_TYPE_AP,
5908c2ecf20Sopenharmony_ci	BRCMS_TYPE_ADHOC,
5918c2ecf20Sopenharmony_ci};
5928c2ecf20Sopenharmony_ci
5938c2ecf20Sopenharmony_ci/*
5948c2ecf20Sopenharmony_ci * BSS configuration state
5958c2ecf20Sopenharmony_ci *
5968c2ecf20Sopenharmony_ci * wlc: wlc to which this bsscfg belongs to.
5978c2ecf20Sopenharmony_ci * type: interface type
5988c2ecf20Sopenharmony_ci * SSID_len: the length of SSID
5998c2ecf20Sopenharmony_ci * SSID: SSID string
6008c2ecf20Sopenharmony_ci *
6018c2ecf20Sopenharmony_ci *
6028c2ecf20Sopenharmony_ci * BSSID: BSSID (associated)
6038c2ecf20Sopenharmony_ci * cur_etheraddr: h/w address
6048c2ecf20Sopenharmony_ci * flags: BSSCFG flags; see below
6058c2ecf20Sopenharmony_ci *
6068c2ecf20Sopenharmony_ci * current_bss: BSS parms in ASSOCIATED state
6078c2ecf20Sopenharmony_ci *
6088c2ecf20Sopenharmony_ci *
6098c2ecf20Sopenharmony_ci * ID: 'unique' ID of this bsscfg, assigned at bsscfg allocation
6108c2ecf20Sopenharmony_ci */
6118c2ecf20Sopenharmony_cistruct brcms_bss_cfg {
6128c2ecf20Sopenharmony_ci	struct brcms_c_info *wlc;
6138c2ecf20Sopenharmony_ci	enum brcms_bss_type type;
6148c2ecf20Sopenharmony_ci	u8 SSID_len;
6158c2ecf20Sopenharmony_ci	u8 SSID[IEEE80211_MAX_SSID_LEN];
6168c2ecf20Sopenharmony_ci	u8 BSSID[ETH_ALEN];
6178c2ecf20Sopenharmony_ci	struct brcms_bss_info *current_bss;
6188c2ecf20Sopenharmony_ci};
6198c2ecf20Sopenharmony_ci
6208c2ecf20Sopenharmony_ciint brcms_c_txfifo(struct brcms_c_info *wlc, uint fifo, struct sk_buff *p);
6218c2ecf20Sopenharmony_ciint brcms_b_xmtfifo_sz_get(struct brcms_hardware *wlc_hw, uint fifo,
6228c2ecf20Sopenharmony_ci			   uint *blocks);
6238c2ecf20Sopenharmony_ci
6248c2ecf20Sopenharmony_ciint brcms_c_set_gmode(struct brcms_c_info *wlc, u8 gmode, bool config);
6258c2ecf20Sopenharmony_civoid brcms_c_mac_promisc(struct brcms_c_info *wlc, uint filter_flags);
6268c2ecf20Sopenharmony_ciu16 brcms_c_calc_lsig_len(struct brcms_c_info *wlc, u32 ratespec, uint mac_len);
6278c2ecf20Sopenharmony_ciu32 brcms_c_rspec_to_rts_rspec(struct brcms_c_info *wlc, u32 rspec,
6288c2ecf20Sopenharmony_ci			       bool use_rspec, u16 mimo_ctlchbw);
6298c2ecf20Sopenharmony_ciu16 brcms_c_compute_rtscts_dur(struct brcms_c_info *wlc, bool cts_only,
6308c2ecf20Sopenharmony_ci			       u32 rts_rate, u32 frame_rate,
6318c2ecf20Sopenharmony_ci			       u8 rts_preamble_type, u8 frame_preamble_type,
6328c2ecf20Sopenharmony_ci			       uint frame_len, bool ba);
6338c2ecf20Sopenharmony_civoid brcms_c_inval_dma_pkts(struct brcms_hardware *hw,
6348c2ecf20Sopenharmony_ci			    struct ieee80211_sta *sta, void (*dma_callback_fn));
6358c2ecf20Sopenharmony_civoid brcms_c_update_probe_resp(struct brcms_c_info *wlc, bool suspend);
6368c2ecf20Sopenharmony_ciint brcms_c_set_nmode(struct brcms_c_info *wlc);
6378c2ecf20Sopenharmony_civoid brcms_c_beacon_phytxctl_txant_upd(struct brcms_c_info *wlc, u32 bcn_rate);
6388c2ecf20Sopenharmony_civoid brcms_b_antsel_type_set(struct brcms_hardware *wlc_hw, u8 antsel_type);
6398c2ecf20Sopenharmony_civoid brcms_b_set_chanspec(struct brcms_hardware *wlc_hw, u16 chanspec,
6408c2ecf20Sopenharmony_ci			  bool mute, struct txpwr_limits *txpwr);
6418c2ecf20Sopenharmony_civoid brcms_b_write_shm(struct brcms_hardware *wlc_hw, uint offset, u16 v);
6428c2ecf20Sopenharmony_ciu16 brcms_b_read_shm(struct brcms_hardware *wlc_hw, uint offset);
6438c2ecf20Sopenharmony_civoid brcms_b_mhf(struct brcms_hardware *wlc_hw, u8 idx, u16 mask, u16 val,
6448c2ecf20Sopenharmony_ci		 int bands);
6458c2ecf20Sopenharmony_civoid brcms_b_corereset(struct brcms_hardware *wlc_hw, u32 flags);
6468c2ecf20Sopenharmony_civoid brcms_b_mctrl(struct brcms_hardware *wlc_hw, u32 mask, u32 val);
6478c2ecf20Sopenharmony_civoid brcms_b_phy_reset(struct brcms_hardware *wlc_hw);
6488c2ecf20Sopenharmony_civoid brcms_b_bw_set(struct brcms_hardware *wlc_hw, u16 bw);
6498c2ecf20Sopenharmony_civoid brcms_b_core_phypll_reset(struct brcms_hardware *wlc_hw);
6508c2ecf20Sopenharmony_civoid brcms_c_ucode_wake_override_set(struct brcms_hardware *wlc_hw,
6518c2ecf20Sopenharmony_ci				     u32 override_bit);
6528c2ecf20Sopenharmony_civoid brcms_c_ucode_wake_override_clear(struct brcms_hardware *wlc_hw,
6538c2ecf20Sopenharmony_ci				       u32 override_bit);
6548c2ecf20Sopenharmony_civoid brcms_b_write_template_ram(struct brcms_hardware *wlc_hw, int offset,
6558c2ecf20Sopenharmony_ci				int len, void *buf);
6568c2ecf20Sopenharmony_ciu16 brcms_b_rate_shm_offset(struct brcms_hardware *wlc_hw, u8 rate);
6578c2ecf20Sopenharmony_civoid brcms_b_copyto_objmem(struct brcms_hardware *wlc_hw, uint offset,
6588c2ecf20Sopenharmony_ci			   const void *buf, int len, u32 sel);
6598c2ecf20Sopenharmony_civoid brcms_b_copyfrom_objmem(struct brcms_hardware *wlc_hw, uint offset,
6608c2ecf20Sopenharmony_ci			     void *buf, int len, u32 sel);
6618c2ecf20Sopenharmony_civoid brcms_b_switch_macfreq(struct brcms_hardware *wlc_hw, u8 spurmode);
6628c2ecf20Sopenharmony_ciu16 brcms_b_get_txant(struct brcms_hardware *wlc_hw);
6638c2ecf20Sopenharmony_civoid brcms_b_phyclk_fgc(struct brcms_hardware *wlc_hw, bool clk);
6648c2ecf20Sopenharmony_civoid brcms_b_macphyclk_set(struct brcms_hardware *wlc_hw, bool clk);
6658c2ecf20Sopenharmony_civoid brcms_b_core_phypll_ctl(struct brcms_hardware *wlc_hw, bool on);
6668c2ecf20Sopenharmony_civoid brcms_b_txant_set(struct brcms_hardware *wlc_hw, u16 phytxant);
6678c2ecf20Sopenharmony_civoid brcms_b_band_stf_ss_set(struct brcms_hardware *wlc_hw, u8 stf_mode);
6688c2ecf20Sopenharmony_civoid brcms_c_init_scb(struct scb *scb);
6698c2ecf20Sopenharmony_ci
6708c2ecf20Sopenharmony_ci#endif				/* _BRCM_MAIN_H_ */
671