Linux-libre 5.3.12-gnu
[librecmc/linux-libre.git] / drivers / net / wireless / broadcom / brcm80211 / include / defs.h
1 // SPDX-License-Identifier: ISC
2 /*
3  * Copyright (c) 2010 Broadcom Corporation
4  */
5
6 #ifndef _BRCM_DEFS_H_
7 #define _BRCM_DEFS_H_
8
9 #include <linux/types.h>
10
11 #define SI_BUS                  0
12 #define PCI_BUS                 1
13 #define PCMCIA_BUS              2
14 #define SDIO_BUS                3
15 #define JTAG_BUS                4
16 #define USB_BUS                 5
17 #define SPI_BUS                 6
18
19 #define OFF     0
20 #define ON      1               /* ON = 1 */
21 #define AUTO    (-1)            /* Auto = -1 */
22
23 /*
24  * Priority definitions according 802.1D
25  */
26 #define PRIO_8021D_NONE         2
27 #define PRIO_8021D_BK           1
28 #define PRIO_8021D_BE           0
29 #define PRIO_8021D_EE           3
30 #define PRIO_8021D_CL           4
31 #define PRIO_8021D_VI           5
32 #define PRIO_8021D_VO           6
33 #define PRIO_8021D_NC           7
34
35 #define MAXPRIO                 7
36 #define NUMPRIO                 (MAXPRIO + 1)
37
38 #define WL_NUMRATES             16      /* max # of rates in a rateset */
39
40 #define BRCM_CNTRY_BUF_SZ       4       /* Country string is 3 bytes + NUL */
41
42 #define BRCM_SET_CHANNEL        30
43 #define BRCM_SET_SRL            32
44 #define BRCM_SET_LRL            34
45 #define BRCM_SET_BCNPRD         76
46
47 #define BRCM_GET_CURR_RATESET   114     /* current rateset */
48 #define BRCM_GET_PHYLIST        180
49
50 /* Bit masks for radio disabled status - returned by WL_GET_RADIO */
51
52 #define WL_RADIO_SW_DISABLE             (1<<0)
53 #define WL_RADIO_HW_DISABLE             (1<<1)
54 /* some countries don't support any channel */
55 #define WL_RADIO_COUNTRY_DISABLE        (1<<3)
56
57 /* Override bit for SET_TXPWR.  if set, ignore other level limits */
58 #define WL_TXPWR_OVERRIDE       (1U<<31)
59
60 /* band types */
61 #define BRCM_BAND_AUTO          0       /* auto-select */
62 #define BRCM_BAND_5G            1       /* 5 Ghz */
63 #define BRCM_BAND_2G            2       /* 2.4 Ghz */
64 #define BRCM_BAND_ALL           3       /* all bands */
65
66 /* Debug levels */
67 #define BRCM_DL_INFO            0x00000001
68 #define BRCM_DL_MAC80211        0x00000002
69 #define BRCM_DL_RX              0x00000004
70 #define BRCM_DL_TX              0x00000008
71 #define BRCM_DL_INT             0x00000010
72 #define BRCM_DL_DMA             0x00000020
73 #define BRCM_DL_HT              0x00000040
74
75 /* Values for PM */
76 #define PM_OFF  0
77 #define PM_MAX  1
78 #define PM_FAST 2
79
80 /*
81  * Sonics Configuration Space Registers.
82  */
83
84 /* core sbconfig regs are top 256bytes of regs */
85 #define SBCONFIGOFF             0xf00
86
87 /* cpp contortions to concatenate w/arg prescan */
88 #ifndef PAD
89 #define _PADLINE(line)  pad ## line
90 #define _XSTR(line)     _PADLINE(line)
91 #define PAD             _XSTR(__LINE__)
92 #endif
93
94 #endif                          /* _BRCM_DEFS_H_ */