Merge branch 'linux-linaro-lsk-v4.4-android' of git://git.linaro.org/kernel/linux...
[firefly-linux-kernel-4.4.55.git] / drivers / net / wireless / rockchip_wlan / rkwifi / bcmdhd / dhd_config.h
1 \r
2 #ifndef _dhd_config_\r
3 #define _dhd_config_\r
4 \r
5 #include <bcmdevs.h>\r
6 #include <dngl_stats.h>\r
7 #include <dhd.h>\r
8 #include <wlioctl.h>\r
9 #include <proto/802.11.h>\r
10 \r
11 #define FW_PATH_AUTO_SELECT 1\r
12 //#define CONFIG_PATH_AUTO_SELECT\r
13 extern char firmware_path[MOD_PARAM_PATHLEN];\r
14 extern int disable_proptx;\r
15 extern uint dhd_rxbound;
16 extern uint dhd_txbound;
17 #define TXGLOM_RECV_OFFSET 8
18 #ifdef BCMSDIO\r
19 extern uint dhd_doflow;\r
20 extern uint dhd_slpauto;\r
21 \r
22 #define BCM43362A0_CHIP_REV     0\r
23 #define BCM43362A2_CHIP_REV     1\r
24 #define BCM43430A0_CHIP_REV     0\r
25 #define BCM43430A1_CHIP_REV     1\r
26 #define BCM4330B2_CHIP_REV      4\r
27 #define BCM4334B1_CHIP_REV      3\r
28 #define BCM43341B0_CHIP_REV     2\r
29 #define BCM43241B4_CHIP_REV     5\r
30 #define BCM4335A0_CHIP_REV      2\r
31 #define BCM4339A0_CHIP_REV      1\r
32 #define BCM43455C0_CHIP_REV     6\r
33 #define BCM4354A1_CHIP_REV      1\r
34 #define BCM4359B1_CHIP_REV      5\r
35 #endif\r
36 #define BCM4356A2_CHIP_REV      2\r
37 \r
38 /* mac range */\r
39 typedef struct wl_mac_range {\r
40         uint32 oui;\r
41         uint32 nic_start;\r
42         uint32 nic_end;\r
43 } wl_mac_range_t;\r
44 \r
45 /* mac list */\r
46 typedef struct wl_mac_list {\r
47         int count;\r
48         wl_mac_range_t *mac;\r
49         char name[MOD_PARAM_PATHLEN];           /* path */\r
50 } wl_mac_list_t;\r
51 \r
52 /* mac list head */\r
53 typedef struct wl_mac_list_ctrl {\r
54         int count;\r
55         struct wl_mac_list *m_mac_list_head;\r
56 } wl_mac_list_ctrl_t;\r
57 \r
58 /* chip_nv_path */\r
59 typedef struct wl_chip_nv_path {\r
60         uint chip;\r
61         uint chiprev;\r
62         char name[MOD_PARAM_PATHLEN];           /* path */\r
63 } wl_chip_nv_path_t;\r
64 \r
65 /* chip_nv_path list head */\r
66 typedef struct wl_chip_nv_path_list_ctrl {\r
67         int count;\r
68         struct wl_chip_nv_path *m_chip_nv_path_head;\r
69 } wl_chip_nv_path_list_ctrl_t;\r
70 \r
71 /* channel list */\r
72 typedef struct wl_channel_list {\r
73         /* in - # of channels, out - # of entries */\r
74         uint32 count;\r
75         /* variable length channel list */\r
76         uint32 channel[WL_NUMCHANNELS];\r
77 } wl_channel_list_t;\r
78 \r
79 typedef struct wmes_param {\r
80         int aifsn[AC_COUNT];\r
81         int cwmin[AC_COUNT];\r
82         int cwmax[AC_COUNT];\r
83 } wme_param_t;\r
84 \r
85 #ifdef PKT_FILTER_SUPPORT\r
86 #define DHD_CONF_FILTER_MAX     8\r
87 /* filter list */\r
88 #define PKT_FILTER_LEN 300\r
89 typedef struct conf_pkt_filter_add {\r
90         /* in - # of channels, out - # of entries */\r
91         uint32 count;\r
92         /* variable length filter list */\r
93         char filter[DHD_CONF_FILTER_MAX][PKT_FILTER_LEN];\r
94 } conf_pkt_filter_add_t;\r
95 \r
96 /* pkt_filter_del list */\r
97 typedef struct conf_pkt_filter_del {\r
98         /* in - # of channels, out - # of entries */\r
99         uint32 count;\r
100         /* variable length filter list */\r
101         uint32 id[DHD_CONF_FILTER_MAX];\r
102 } conf_pkt_filter_del_t;\r
103 #endif\r
104 \r
105 #define CONFIG_COUNTRY_LIST_SIZE 100\r
106 /* country list */\r
107 typedef struct conf_country_list {\r
108         uint32 count;\r
109         wl_country_t cspec[CONFIG_COUNTRY_LIST_SIZE];\r
110 } conf_country_list_t;\r
111 \r
112 typedef struct dhd_conf {\r
113         uint    chip;                   /* chip number */
114         uint    chiprev;                /* chip revision */\r
115         wl_mac_list_ctrl_t fw_by_mac;   /* Firmware auto selection by MAC */\r
116         wl_mac_list_ctrl_t nv_by_mac;   /* NVRAM auto selection by MAC */\r
117         wl_chip_nv_path_list_ctrl_t nv_by_chip; /* NVRAM auto selection by chip */\r
118         conf_country_list_t country_list; /* Country list */\r
119         int band;                       /* Band, b:2.4G only, otherwise for auto */\r
120         int mimo_bw_cap;                        /* Bandwidth, 0:HT20ALL, 1: HT40ALL, 2:HT20IN2G_HT40PIN5G */\r
121         wl_country_t cspec;             /* Country */\r
122         wl_channel_list_t channels;     /* Support channels */\r
123         uint roam_off;          /* Roaming, 0:enable, 1:disable */\r
124         uint roam_off_suspend;          /* Roaming in suspend, 0:enable, 1:disable */\r
125         int roam_trigger[2];            /* The RSSI threshold to trigger roaming */\r
126         int roam_scan_period[2];        /* Roaming scan period */\r
127         int roam_delta[2];                      /* Roaming candidate qualification delta */\r
128         int fullroamperiod;                     /* Full Roaming period */\r
129         uint keep_alive_period;         /* The perioid in ms to send keep alive packet */\r
130         int force_wme_ac;\r
131         wme_param_t wme;        /* WME parameters */\r
132         int stbc;                       /* STBC for Tx/Rx */\r
133         int phy_oclscdenable;           /* phy_oclscdenable */\r
134 #ifdef PKT_FILTER_SUPPORT\r
135         conf_pkt_filter_add_t pkt_filter_add;           /* Packet filter add */\r
136         conf_pkt_filter_del_t pkt_filter_del;           /* Packet filter add */\r
137         bool pkt_filter_magic;\r
138 #endif\r
139         int srl;        /* short retry limit */\r
140         int lrl;        /* long retry limit */\r
141         uint bcn_timeout;       /* beacon timeout */\r
142         bool kso_enable;\r
143         int spect;\r
144         int txbf;\r
145         int lpc;\r
146         int disable_proptx;\r
147         int bus_txglom; /* bus:txglom */\r
148         int use_rxchain;\r
149         bool bus_rxglom;        /* bus:rxglom */\r
150         uint txglomsize;\r
151         int ampdu_ba_wsize;\r
152         int dpc_cpucore;\r
153         int frameburst;\r
154         bool deepsleep;\r
155         int pm;\r
156         uint8 tcpack_sup_mode;\r
157         int dhd_poll;\r
158         uint deferred_tx_len;\r
159         int pktprio8021x;\r
160         bool txctl_tmo_fix;\r
161         bool swtxglom; /* SW TXGLOM */\r
162         bool txglom_ext; /* Only for 43362/4330/43340/43341/43241 */
163         /*txglom_bucket_size:
164          * 43362/4330: 1680
165          * 43340/43341/43241: 1684
166          */
167         int txglom_bucket_size;
168         int tx_max_offset;\r
169         bool tx_in_rx; // Skip tx before rx, in order to get more glomed in tx\r
170         int rsdb_mode;\r
171         bool txglom_mode;\r
172 } dhd_conf_t;\r
173 \r
174 #ifdef BCMSDIO\r
175 int dhd_conf_get_mac(dhd_pub_t *dhd, bcmsdh_info_t *sdh, uint8 *mac);\r
176 void dhd_conf_set_fw_name_by_mac(dhd_pub_t *dhd, bcmsdh_info_t *sdh, char *fw_path);\r
177 void dhd_conf_set_nv_name_by_mac(dhd_pub_t *dhd, bcmsdh_info_t *sdh, char *nv_path);\r
178 #if defined(HW_OOB) || defined(FORCE_WOWLAN)\r
179 void dhd_conf_set_hw_oob_intr(bcmsdh_info_t *sdh, uint chip);\r
180 #endif\r
181 #endif\r
182 void dhd_conf_set_fw_name_by_chip(dhd_pub_t *dhd, char *fw_path);\r
183 void dhd_conf_set_nv_name_by_chip(dhd_pub_t *dhd, char *nv_path);\r
184 void dhd_conf_set_conf_path_by_nv_path(dhd_pub_t *dhd, char *conf_path, char *nv_path);\r
185 #ifdef CONFIG_PATH_AUTO_SELECT\r
186 void dhd_conf_set_conf_name_by_chip(dhd_pub_t *dhd, char *conf_path);\r
187 #endif\r
188 int dhd_conf_set_fw_int_cmd(dhd_pub_t *dhd, char *name, uint cmd, int val, int def, bool down);\r
189 int dhd_conf_set_fw_string_cmd(dhd_pub_t *dhd, char *cmd, int val, int def, bool down);\r
190 uint dhd_conf_get_band(dhd_pub_t *dhd);\r
191 int dhd_conf_set_country(dhd_pub_t *dhd);\r
192 int dhd_conf_get_country(dhd_pub_t *dhd, wl_country_t *cspec);\r
193 int dhd_conf_get_country_from_config(dhd_pub_t *dhd, wl_country_t *cspec);\r
194 int dhd_conf_fix_country(dhd_pub_t *dhd);\r
195 bool dhd_conf_match_channel(dhd_pub_t *dhd, uint32 channel);\r
196 int dhd_conf_set_roam(dhd_pub_t *dhd);\r
197 void dhd_conf_get_wme(dhd_pub_t *dhd, edcf_acparam_t *acp);\r
198 void dhd_conf_set_wme(dhd_pub_t *dhd);\r
199 void dhd_conf_add_pkt_filter(dhd_pub_t *dhd);\r
200 bool dhd_conf_del_pkt_filter(dhd_pub_t *dhd, uint32 id);\r
201 void dhd_conf_discard_pkt_filter(dhd_pub_t *dhd);\r
202 void dhd_conf_set_disable_proptx(dhd_pub_t *dhd);\r
203 int dhd_conf_read_config(dhd_pub_t *dhd, char *conf_path);\r
204 int dhd_conf_set_chiprev(dhd_pub_t *dhd, uint chip, uint chiprev);\r
205 uint dhd_conf_get_chip(void *context);\r
206 uint dhd_conf_get_chiprev(void *context);\r
207 void dhd_conf_set_txglom_params(dhd_pub_t *dhd, bool enable);\r
208 int dhd_conf_get_pm(dhd_pub_t *dhd);\r
209 int dhd_conf_get_tcpack_sup_mode(dhd_pub_t *dhd);\r
210 int dhd_conf_preinit(dhd_pub_t *dhd);\r
211 int dhd_conf_reset(dhd_pub_t *dhd);\r
212 int dhd_conf_attach(dhd_pub_t *dhd);\r
213 void dhd_conf_detach(dhd_pub_t *dhd);\r
214 void *dhd_get_pub(struct net_device *dev);\r
215 \r
216 #endif /* _dhd_config_ */\r