00001
00013 #ifndef _ME_H_
00014 #define _ME_H_
00015
00033
00034
00035
00036
00037 #include "rwnx_config.h"
00038 #include "scanu_task.h"
00039 #include "me_task.h"
00040 #include "mac.h"
00041 #include "txl_frame.h"
00042
00043
00044
00045
00046
00047
00049 #define DEFAULT_ASSOCRSP_TIMEOUT (200 * TU_DURATION)
00051 #define DEFAULT_AUTHRSP_TIMEOUT (200 * TU_DURATION)
00052
00054 enum
00055 {
00057 ME_HT_CAPA = CO_BIT(0),
00059 ME_VHT_CAPA = CO_BIT(1),
00061 ME_HE_CAPA = CO_BIT(2),
00063 ME_OFDMA_UL_CAPA = CO_BIT(3),
00064 };
00065
00067 enum
00068 {
00070 BSS_QOS_CAPA = CO_BIT(0),
00072 BSS_HT_CAPA = CO_BIT(1),
00074 BSS_VHT_CAPA = CO_BIT(2),
00076 BSS_HE_CAPA = CO_BIT(3),
00078 BSS_VALID_CAPA = CO_BIT(31),
00079 };
00080
00081
00082
00083
00084
00086 struct me_env_tag
00087 {
00089 uint32_t active_vifs;
00091 uint32_t ps_disable_vifs;
00093 ke_task_id_t requester_id;
00095 struct mac_htcapability ht_cap;
00097 uint16_t tx_lft;
00098 #if NX_VHT
00100 struct mac_vhtcapability vht_cap;
00101 #endif
00102 #if NX_HE
00104 struct mac_hecapability he_cap;
00106 uint8_t he_stbc_nss;
00107 #endif
00109 struct me_chan_config_req chan;
00111 uint8_t stbc_nss;
00113 uint8_t phy_bw_max;
00115 uint8_t capa_flags;
00116 #if NX_POWERSAVE
00118 bool ps_on;
00120 uint8_t ps_mode;
00121 #endif
00122 };
00123
00125 struct mobility_domain
00126 {
00128 uint16_t mdid;
00130 uint8_t ft_capability_policy;
00131 };
00132
00134 struct me_bss_info
00135 {
00137 struct mac_htcapability ht_cap;
00138 #if NX_VHT
00140 struct mac_vhtcapability vht_cap;
00141 #endif
00142 #if NX_HE
00144 struct mac_hecapability he_cap;
00146 struct mac_mu_edca_param_set mu_edca_param;
00147 #endif
00149 struct mac_addr bssid;
00151 struct mac_ssid ssid;
00154 uint8_t bssid_index;
00157 uint8_t max_bssid_ind;
00159 uint16_t bsstype;
00161 struct mac_chan_op chan;
00163 uint16_t beacon_period;
00165 struct mac_rateset rate_set;
00167 struct mac_edca_param_set edca_param;
00169 int8_t rssi;
00171 uint8_t high_11b_rate;
00173 uint16_t prot_status;
00175 uint8_t power_constraint;
00176 #if NX_HE
00178 uint32_t he_oper;
00179 #endif
00181 uint32_t capa_flags;
00183 struct mobility_domain mde;
00184 };
00185
00186
00187
00188
00189
00191 extern struct me_env_tag me_env;
00192
00193
00194
00195
00196
00204 #define LOCAL_CAPA(type) ((me_env.capa_flags & ME_##type##_CAPA) != 0)
00205
00212 #define LOCAL_CAPA_SET(type) (me_env.capa_flags |= ME_##type##_CAPA)
00213
00220 #define LOCAL_CAPA_CLR(type) (me_env.capa_flags &= ~ME_##type##_CAPA)
00221
00230 #define BSS_CAPA(bss, type) (((bss)->capa_flags & BSS_##type##_CAPA) != 0)
00231
00239 #define BSS_CAPA_SET(bss, type) ((bss)->capa_flags |= BSS_##type##_CAPA)
00240
00248 #define BSS_CAPA_CLR(bss, type) ((bss)->capa_flags &= ~BSS_##type##_CAPA)
00249
00256 #define BSS_CAPA_RESET(bss) ((bss)->capa_flags = 0)
00257
00258
00259
00260
00261
00262
00263
00271 __INLINE uint16_t me_tx_lft_get(void)
00272 {
00273 return me_env.tx_lft;
00274 }
00275
00286 __INLINE void me_credits_update_ind(uint8_t sta_idx, uint8_t tid, int8_t credits)
00287 {
00288 struct me_tx_credits_update_ind *ind = KE_MSG_ALLOC(ME_TX_CREDITS_UPDATE_IND, TASK_API,
00289 TASK_ME, me_tx_credits_update_ind);
00290
00291
00292 ind->sta_idx = sta_idx;
00293 ind->tid = tid;
00294 ind->credits = credits;
00295
00296
00297 ke_msg_send(ind);
00298 }
00299
00305 void me_init(void);
00306
00318 struct mac_chan_def *me_freq_to_chan_ptr(uint8_t band, uint16_t freq);
00319
00331 void me_init_chan(struct mac_chan_op *chan);
00332
00334
00335 #endif // _ME_INIT_H_