Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place. Commercial Alternative to JupyterHub.
Path: blob/next/external/cache/sources/wl/include/bcmwifi.h
Views: 3959
/*1* Misc utility routines for WL and Apps2* This header file housing the define and function prototype use by3* both the wl driver, tools & Apps.4*5* $Copyright Open Broadcom Corporation$6*7* $Id: bcmwifi.h 374015 2012-12-11 08:55:11Z maheshd $8*/910#ifndef _bcmwifi_h_11#define _bcmwifi_h_12131415typedef uint16 chanspec_t;161718#define CH_UPPER_SB 0x0119#define CH_LOWER_SB 0x0220#define CH_EWA_VALID 0x0421#define CH_20MHZ_APART 422#define CH_10MHZ_APART 223#define CH_5MHZ_APART 124#define CH_MAX_2G_CHANNEL 1425#define WLC_MAX_2G_CHANNEL CH_MAX_2G_CHANNEL26#define MAXCHANNEL 22427#define CHSPEC_CTLOVLP(sp1, sp2, sep) \28(ABS(wf_chspec_ctlchan(sp1) - wf_chspec_ctlchan(sp2)) < (sep))2930#define WL_CHANSPEC_CHAN_MASK 0x00ff31#define WL_CHANSPEC_CHAN_SHIFT 03233#define WL_CHANSPEC_CTL_SB_MASK 0x030034#define WL_CHANSPEC_CTL_SB_SHIFT 835#define WL_CHANSPEC_CTL_SB_LOWER 0x010036#define WL_CHANSPEC_CTL_SB_UPPER 0x020037#define WL_CHANSPEC_CTL_SB_NONE 0x03003839#define WL_CHANSPEC_BW_MASK 0x0C0040#define WL_CHANSPEC_BW_SHIFT 1041#define WL_CHANSPEC_BW_10 0x040042#define WL_CHANSPEC_BW_20 0x080043#define WL_CHANSPEC_BW_40 0x0C004445#define WL_CHANSPEC_BAND_MASK 0xf00046#define WL_CHANSPEC_BAND_SHIFT 1247#define WL_CHANSPEC_BAND_5G 0x100048#define WL_CHANSPEC_BAND_2G 0x200049#define INVCHANSPEC 255505152#define WF_CHAN_FACTOR_2_4_G 481453#define WF_CHAN_FACTOR_5_G 1000054#define WF_CHAN_FACTOR_4_G 8000555657#define LOWER_20_SB(channel) (((channel) > CH_10MHZ_APART) ? ((channel) - CH_10MHZ_APART) : 0)58#define UPPER_20_SB(channel) (((channel) < (MAXCHANNEL - CH_10MHZ_APART)) ? \59((channel) + CH_10MHZ_APART) : 0)60#define CHSPEC_WLCBANDUNIT(chspec) (CHSPEC_IS5G(chspec) ? BAND_5G_INDEX : BAND_2G_INDEX)61#define CH20MHZ_CHSPEC(channel) (chanspec_t)((chanspec_t)(channel) | WL_CHANSPEC_BW_20 | \62WL_CHANSPEC_CTL_SB_NONE | (((channel) <= CH_MAX_2G_CHANNEL) ? \63WL_CHANSPEC_BAND_2G : WL_CHANSPEC_BAND_5G))64#define NEXT_20MHZ_CHAN(channel) (((channel) < (MAXCHANNEL - CH_20MHZ_APART)) ? \65((channel) + CH_20MHZ_APART) : 0)66#define CH40MHZ_CHSPEC(channel, ctlsb) (chanspec_t) \67((channel) | (ctlsb) | WL_CHANSPEC_BW_40 | \68((channel) <= CH_MAX_2G_CHANNEL ? WL_CHANSPEC_BAND_2G : \69WL_CHANSPEC_BAND_5G))70#define CHSPEC_CHANNEL(chspec) ((uint8)((chspec) & WL_CHANSPEC_CHAN_MASK))71#define CHSPEC_BAND(chspec) ((chspec) & WL_CHANSPEC_BAND_MASK)727374#define CHSPEC_CTL_SB(chspec) ((chspec) & WL_CHANSPEC_CTL_SB_MASK)75#define CHSPEC_BW(chspec) ((chspec) & WL_CHANSPEC_BW_MASK)7677#ifdef WL11N_20MHZONLY7879#define CHSPEC_IS10(chspec) 080#define CHSPEC_IS20(chspec) 181#ifndef CHSPEC_IS4082#define CHSPEC_IS40(chspec) 083#endif8485#else8687#define CHSPEC_IS10(chspec) (((chspec) & WL_CHANSPEC_BW_MASK) == WL_CHANSPEC_BW_10)88#define CHSPEC_IS20(chspec) (((chspec) & WL_CHANSPEC_BW_MASK) == WL_CHANSPEC_BW_20)89#ifndef CHSPEC_IS4090#define CHSPEC_IS40(chspec) (((chspec) & WL_CHANSPEC_BW_MASK) == WL_CHANSPEC_BW_40)91#endif9293#endif9495#define CHSPEC_IS5G(chspec) (((chspec) & WL_CHANSPEC_BAND_MASK) == WL_CHANSPEC_BAND_5G)96#define CHSPEC_IS2G(chspec) (((chspec) & WL_CHANSPEC_BAND_MASK) == WL_CHANSPEC_BAND_2G)97#define CHSPEC_SB_NONE(chspec) (((chspec) & WL_CHANSPEC_CTL_SB_MASK) == WL_CHANSPEC_CTL_SB_NONE)98#define CHSPEC_SB_UPPER(chspec) (((chspec) & WL_CHANSPEC_CTL_SB_MASK) == WL_CHANSPEC_CTL_SB_UPPER)99#define CHSPEC_SB_LOWER(chspec) (((chspec) & WL_CHANSPEC_CTL_SB_MASK) == WL_CHANSPEC_CTL_SB_LOWER)100#define CHSPEC_CTL_CHAN(chspec) ((CHSPEC_SB_LOWER(chspec)) ? \101(LOWER_20_SB(((chspec) & WL_CHANSPEC_CHAN_MASK))) : \102(UPPER_20_SB(((chspec) & WL_CHANSPEC_CHAN_MASK))))103#define CHSPEC2WLC_BAND(chspec) (CHSPEC_IS5G(chspec) ? WLC_BAND_5G : WLC_BAND_2G)104105#define CHANSPEC_STR_LEN 8106107108#define WLC_MAXRATE 108109#define WLC_RATE_1M 2110#define WLC_RATE_2M 4111#define WLC_RATE_5M5 11112#define WLC_RATE_11M 22113#define WLC_RATE_6M 12114#define WLC_RATE_9M 18115#define WLC_RATE_12M 24116#define WLC_RATE_18M 36117#define WLC_RATE_24M 48118#define WLC_RATE_36M 72119#define WLC_RATE_48M 96120#define WLC_RATE_54M 108121122#define WLC_2G_25MHZ_OFFSET 5123124125extern char * wf_chspec_ntoa(chanspec_t chspec, char *buf);126127128extern chanspec_t wf_chspec_aton(char *a);129130131extern bool wf_chspec_malformed(chanspec_t chanspec);132133134extern uint8 wf_chspec_ctlchan(chanspec_t chspec);135136137extern chanspec_t wf_chspec_ctlchspec(chanspec_t chspec);138139140extern int wf_mhz2channel(uint freq, uint start_factor);141142143extern int wf_channel2mhz(uint channel, uint start_factor);144145#endif146147148