- Main Page
- Modules
- Data Structures
- Files

- File List
- Globals

# /space/home/slher/rel/Beken/v6_4_5/macsw/ip/lmac/src/mm/mm_task.h

Go to the documentation of this file.

    00001
    00013 #ifndef _MM_TASK_H_
    00014 #define _MM_TASK_H_
    00015
    00025 /*
    00026  * INCLUDE FILES
    00027  ****************************************************************************************
    00028  */
    00029 #include "co_int.h"
    00030 #include "co_bool.h"
    00031
    00032 // inclusion to retrieve the task index
    00033 #include "ke_task.h"
    00034 // for MAC related elements (mac_addr, mac_ssid...)
    00035 #include "mac.h"
    00036 #include "phy.h"
    00037
    00038 /*
    00039  * DEFINES
    00040  ****************************************************************************************
    00041  */
    00043 #define MM_IDX_MAX 1
    00044
    00046 enum mm_state_tag
    00047 {
    00049     MM_IDLE,
    00051     MM_ACTIVE,
    00053     MM_GOING_TO_IDLE,
    00055     MM_HOST_BYPASSED,
    00057     MM_NO_IDLE,
    00059     MM_STATE_MAX
    00060 };
    00061
    00063 enum mm_remain_on_channel_op
    00064 {
    00065     MM_ROC_OP_START = 0,
    00066     MM_ROC_OP_CANCEL,
    00067
    00068     MM_ROC_OP_MAX,
    00069 };
    00070
    00072 enum mm_msg_tag
    00073 {
    00075     MM_RESET_REQ = KE_FIRST_MSG(TASK_MM),
    00077     MM_RESET_CFM,
    00079     MM_START_REQ,
    00081     MM_START_CFM,
    00083     MM_VERSION_REQ,
    00085     MM_VERSION_CFM,
    00087     MM_ADD_IF_REQ,
    00089     MM_ADD_IF_CFM,
    00091     MM_REMOVE_IF_REQ,
    00093     MM_REMOVE_IF_CFM,
    00095     MM_STA_ADD_REQ,
    00097     MM_STA_ADD_CFM,
    00099     MM_STA_DEL_REQ,
    00101     MM_STA_DEL_CFM,
    00103     MM_SET_FILTER_REQ,
    00105     MM_SET_FILTER_CFM,
    00107     MM_SET_CHANNEL_REQ,
    00109     MM_SET_CHANNEL_CFM,
    00111     MM_SET_DTIM_REQ,
    00113     MM_SET_DTIM_CFM,
    00115     MM_SET_BEACON_INT_REQ,
    00117     MM_SET_BEACON_INT_CFM,
    00119     MM_SET_BASIC_RATES_REQ,
    00121     MM_SET_BASIC_RATES_CFM,
    00123     MM_SET_BSSID_REQ,
    00125     MM_SET_BSSID_CFM,
    00127     MM_SET_EDCA_REQ,
    00129     MM_SET_EDCA_CFM,
    00131     MM_SET_MODE_REQ,
    00133     MM_SET_MODE_CFM,
    00135     MM_SET_VIF_STATE_REQ,
    00137     MM_SET_VIF_STATE_CFM,
    00139     MM_SET_SLOTTIME_REQ,
    00141     MM_SET_SLOTTIME_CFM,
    00143     MM_SET_IDLE_REQ,
    00145     MM_SET_IDLE_CFM,
    00147     MM_KEY_ADD_REQ,
    00149     MM_KEY_ADD_CFM,
    00151     MM_KEY_DEL_REQ,
    00153     MM_KEY_DEL_CFM,
    00155     MM_BA_ADD_REQ,
    00157     MM_BA_ADD_CFM,
    00159     MM_BA_DEL_REQ,
    00161     MM_BA_DEL_CFM,
    00164     MM_PRIMARY_TBTT_IND,
    00167     MM_SECONDARY_TBTT_IND,
    00169     MM_SET_POWER_REQ,
    00171     MM_SET_POWER_CFM,
    00174     MM_DBG_TRIGGER_REQ,
    00176     MM_SET_PS_MODE_REQ,
    00178     MM_SET_PS_MODE_CFM,
    00180     MM_CHAN_CTXT_ADD_REQ,
    00182     MM_CHAN_CTXT_ADD_CFM,
    00184     MM_CHAN_CTXT_DEL_REQ,
    00186     MM_CHAN_CTXT_DEL_CFM,
    00188     MM_CHAN_CTXT_LINK_REQ,
    00190     MM_CHAN_CTXT_LINK_CFM,
    00192     MM_CHAN_CTXT_UNLINK_REQ,
    00194     MM_CHAN_CTXT_UNLINK_CFM,
    00196     MM_CHAN_CTXT_UPDATE_REQ,
    00198     MM_CHAN_CTXT_UPDATE_CFM,
    00200     MM_CHAN_CTXT_SCHED_REQ,
    00202     MM_CHAN_CTXT_SCHED_CFM,
    00204     MM_BCN_CHANGE_REQ,
    00206     MM_BCN_CHANGE_CFM,
    00208     MM_TIM_UPDATE_REQ,
    00210     MM_TIM_UPDATE_CFM,
    00212     MM_CONNECTION_LOSS_IND,
    00214     MM_CHANNEL_SWITCH_IND,
    00216     MM_CHANNEL_PRE_SWITCH_IND,
    00218     MM_REMAIN_ON_CHANNEL_REQ,
    00220     MM_REMAIN_ON_CHANNEL_CFM,
    00222     MM_REMAIN_ON_CHANNEL_EXP_IND,
    00224     MM_PS_CHANGE_IND,
    00226     MM_TRAFFIC_REQ_IND,
    00228     MM_SET_PS_OPTIONS_REQ,
    00230     MM_SET_PS_OPTIONS_CFM,
    00232     MM_P2P_VIF_PS_CHANGE_IND,
    00234     MM_CSA_COUNTER_IND,
    00236     MM_CHANNEL_SURVEY_IND,
    00238     MM_BFMER_ENABLE_REQ,
    00240     MM_SET_P2P_NOA_REQ,
    00242     MM_SET_P2P_OPPPS_REQ,
    00244     MM_SET_P2P_NOA_CFM,
    00246     MM_SET_P2P_OPPPS_CFM,
    00248     MM_P2P_NOA_UPD_IND,
    00250     MM_CFG_RSSI_REQ,
    00252     MM_RSSI_STATUS_IND,
    00254     MM_CSA_FINISH_IND,
    00256     MM_CSA_TRAFFIC_IND,
    00258     MM_MU_GROUP_UPDATE_REQ,
    00260     MM_MU_GROUP_UPDATE_CFM,
    00262     MM_ANT_DIV_INIT_REQ,
    00264     MM_ANT_DIV_STOP_REQ,
    00266     MM_ANT_DIV_UPDATE_REQ,
    00268     MM_SWITCH_ANTENNA_REQ,
    00270     MM_PKTLOSS_IND,
    00272     MM_SET_MU_EDCA_REQ,
    00274     MM_SET_MU_EDCA_CFM,
    00276     MM_SET_UORA_REQ,
    00278     MM_SET_UORA_CFM,
    00280     MM_SET_TXOP_RTS_THRES_REQ,
    00282     MM_SET_TXOP_RTS_THRES_CFM,
    00284     MM_SET_BSS_COLOR_REQ,
    00286     MM_SET_BSS_COLOR_CFM,
    00287
    00288     /*
    00289      * Section of internal MM messages. No MM API messages should be defined below this point
    00290      */
    00292     MM_FORCE_IDLE_REQ,
    00294     MM_SCAN_CHANNEL_START_IND,
    00296     MM_SCAN_CHANNEL_END_IND,
    00298     MM_TBTT_MOVE_REQ,
    00299
    00301     MM_MAX,
    00302 };
    00303
    00305 struct mm_start_req
    00306 {
    00308     struct phy_cfg_tag phy_cfg;
    00310     uint32_t uapsd_timeout;
    00312     uint16_t lp_clk_accuracy;
    00313 };
    00314
    00316 struct mm_set_channel_req
    00317 {
    00319     struct mac_chan_op chan;
    00323     uint8_t index;
    00324 };
    00325
    00327 struct mm_set_channel_cfm
    00328 {
    00330     uint8_t radio_idx;
    00332     int8_t power;
    00333 };
    00334
    00336 struct mm_set_dtim_req
    00337 {
    00339     uint8_t dtim_period;
    00340 };
    00341
    00343 struct mm_set_power_req
    00344 {
    00346     uint8_t inst_nbr;
    00348     int8_t power;
    00349 };
    00350
    00352 struct mm_set_power_cfm
    00353 {
    00355     uint8_t radio_idx;
    00357     int8_t power;
    00358 };
    00359
    00361 struct mm_set_beacon_int_req
    00362 {
    00364     uint16_t beacon_int;
    00366     uint8_t inst_nbr;
    00367 };
    00368
    00370 struct mm_set_basic_rates_req
    00371 {
    00373     uint32_t rates;
    00375     uint8_t inst_nbr;
    00377     uint8_t band;
    00378 };
    00379
    00381 struct mm_set_bssid_req
    00382 {
    00384     struct mac_addr bssid;
    00386     uint8_t inst_nbr;
    00387 };
    00388
    00390 struct mm_set_filter_req
    00391 {
    00393     uint32_t filter;
    00394 };
    00395
    00397 struct mm_add_if_req
    00398 {
    00400     uint8_t type;
    00402     struct mac_addr addr;
    00404     bool p2p;
    00405 };
    00406
    00408 struct mm_set_edca_req
    00409 {
    00411     uint32_t ac_param;
    00413     bool uapsd;
    00415     uint8_t hw_queue;
    00417     uint8_t inst_nbr;
    00418 };
    00419
    00421 struct mm_set_mu_edca_req
    00422 {
    00424     uint32_t param[AC_MAX];
    00425 };
    00426
    00428 struct mm_set_uora_req
    00429 {
    00431     uint8_t eocw_min;
    00433     uint8_t eocw_max;
    00434 };
    00435
    00437 struct mm_set_txop_rts_thres_req
    00438 {
    00440     uint16_t txop_dur_rts_thres;
    00442     uint8_t inst_nbr;
    00443 };
    00444
    00446 struct mm_set_bss_color_req
    00447 {
    00449     uint32_t bss_color;
    00450 };
    00451
    00453 struct mm_set_slottime_req
    00454 {
    00456     uint8_t slottime;
    00457 };
    00458
    00460 struct mm_set_mode_req
    00461 {
    00463     uint8_t abgnmode;
    00464 };
    00465
    00467 struct mm_set_vif_state_req
    00468 {
    00470     uint16_t aid;
    00472     bool active;
    00474     uint8_t inst_nbr;
    00475 };
    00476
    00478 struct mm_add_if_cfm
    00479 {
    00481     uint8_t status;
    00483     uint8_t inst_nbr;
    00484 };
    00485
    00487 struct mm_remove_if_req
    00488 {
    00490     uint8_t inst_nbr;
    00491 };
    00492
    00494 struct mm_version_cfm
    00495 {
    00497     uint32_t version_lmac;
    00499     uint32_t version_machw_1;
    00501     uint32_t version_machw_2;
    00503     uint32_t version_phy_1;
    00505     uint32_t version_phy_2;
    00507     uint32_t features;
    00509     uint16_t max_sta_nb;
    00511     uint8_t max_vif_nb;
    00512 };
    00513
    00515 struct mm_sta_add_req
    00516 {
    00518     uint32_t ampdu_size_max_he;
    00520     uint32_t ampdu_size_max_vht;
    00522     uint32_t paid_gid;
    00524     uint16_t ampdu_size_max_ht;
    00526     struct mac_addr mac_addr;
    00528     uint8_t ampdu_spacing_min;
    00530     uint8_t inst_nbr;
    00532     bool tdls_sta;
    00534     bool tdls_initiator;
    00536     bool tdls_chsw_allowed;
    00539     uint8_t bssid_index;
    00542     uint8_t max_bssid_ind;
    00543 };
    00544
    00546 struct mm_sta_add_cfm
    00547 {
    00549     uint8_t status;
    00551     uint8_t sta_idx;
    00553     uint8_t hw_sta_idx;
    00554 };
    00555
    00557 struct mm_sta_del_req
    00558 {
    00560     uint8_t sta_idx;
    00561 };
    00562
    00564 struct mm_sta_del_cfm
    00565 {
    00567     uint8_t     status;
    00568 };
    00569
    00571 struct mm_set_idle_req
    00572 {
    00574     uint8_t hw_idle;
    00575 };
    00576
    00578 struct mm_key_add_req
    00579 {
    00581     uint8_t key_idx;
    00583     uint8_t sta_idx;
    00585     struct mac_sec_key  key;
    00587     uint8_t cipher_suite;
    00589     uint8_t inst_nbr;
    00591     uint8_t spp;
    00593     bool pairwise;
    00594 };
    00595
    00597 struct mm_key_add_cfm
    00598 {
    00600     uint8_t status;
    00602     uint8_t hw_key_idx;
    00603 };
    00604
    00606 struct mm_key_del_req
    00607 {
    00609     uint8_t hw_key_idx;
    00610 };
    00611
    00613 struct mm_ba_add_req
    00614 {
    00616     uint8_t  type;
    00618     uint8_t  sta_idx;
    00620     uint8_t  tid;
    00622     uint8_t  bufsz;
    00624     uint16_t ssn;
    00625 };
    00626
    00628 struct mm_ba_add_cfm
    00629 {
    00631     uint8_t sta_idx;
    00633     uint8_t tid;
    00635     uint8_t status;
    00636 };
    00637
    00638 #if (NX_AMPDU_TX || NX_REORD)
    00640 struct mm_ba_del_req
    00641 {
    00643     uint8_t type;
    00645     uint8_t sta_idx;
    00647     uint8_t tid;
    00648 };
    00649
    00651 struct mm_ba_del_cfm
    00652 {
    00654     uint8_t sta_idx;
    00656     uint8_t tid;
    00658     uint8_t status;
    00659 };
    00660 #endif //NX_AMPDU_TX || NX_REORD
    00661
    00663 struct mm_channel_switch_ind
    00664 {
    00666     uint8_t chan_index;
    00668     bool roc;
    00670     uint8_t vif_index;
    00672     bool roc_tdls;
    00673 };
    00674
    00676 struct mm_channel_pre_switch_ind
    00677 {
    00679     uint8_t chan_index;
    00680 };
    00681
    00683 struct mm_connection_loss_ind
    00684 {
    00686     uint8_t inst_nbr;
    00687 };
    00688
    00690 struct mm_dbg_trigger_req
    00691 {
    00693     char error[64];
    00694 };
    00695
    00696 #if NX_POWERSAVE
    00698 struct mm_set_ps_mode_req
    00699 {
    00701     uint8_t  new_state;
    00702 };
    00703 #endif
    00704
    00706 struct mm_chan_ctxt_add_req
    00707 {
    00709     struct mac_chan_op chan;
    00710 };
    00711
    00713 struct mm_chan_ctxt_add_cfm
    00714 {
    00716     uint8_t status;
    00718     uint8_t index;
    00719 };
    00720
    00721
    00723 struct mm_chan_ctxt_del_req
    00724 {
    00726     uint8_t index;
    00727 };
    00728
    00729
    00731 struct mm_chan_ctxt_link_req
    00732 {
    00734     uint8_t vif_index;
    00736     uint8_t chan_index;
    00738     uint8_t chan_switch;
    00739 };
    00740
    00742 struct mm_chan_ctxt_unlink_req
    00743 {
    00745     uint8_t vif_index;
    00746 };
    00747
    00749 struct mm_chan_ctxt_update_req
    00750 {
    00752     uint8_t chan_index;
    00754     struct mac_chan_op chan;
    00755 };
    00756
    00758 struct mm_chan_ctxt_sched_req
    00759 {
    00761     uint8_t vif_index;
    00763     uint8_t chan_index;
    00766     uint8_t type;
    00767 };
    00768
    00770 #define BCN_MAX_CSA_CPT 2
    00772 struct mm_bcn_change_req
    00773 {
    00775     uint32_t bcn_ptr;
    00777     uint16_t bcn_len;
    00779     uint16_t tim_oft;
    00781     uint8_t tim_len;
    00783     uint8_t inst_nbr;
    00785     uint8_t csa_oft[BCN_MAX_CSA_CPT];
    00786 };
    00787
    00789 struct mm_tim_update_req
    00790 {
    00792     uint16_t aid;
    00794     uint8_t tx_avail;
    00796     uint8_t inst_nbr;
    00797 };
    00798
    00800 struct mm_ps_change_ind
    00801 {
    00803     uint8_t sta_idx;
    00805     uint8_t ps_state;
    00806 };
    00807
    00809 struct mm_p2p_vif_ps_change_ind
    00810 {
    00812     uint8_t vif_index;
    00814     uint8_t ps_state;
    00815 };
    00816
    00818 struct mm_traffic_req_ind
    00819 {
    00821     uint8_t sta_idx;
    00824     uint8_t pkt_cnt;
    00826     bool uapsd;
    00827 };
    00828
    00829
    00831 struct mm_remain_on_channel_req
    00832 {
    00834     uint8_t op_code;
    00836     uint8_t vif_index;
    00838     struct mac_chan_op chan;
    00840     uint32_t duration_ms;
    00841 };
    00842
    00844 struct mm_remain_on_channel_cfm
    00845 {
    00847     uint8_t op_code;
    00849     uint8_t status;
    00851     uint8_t chan_ctxt_index;
    00852 };
    00853
    00855 struct mm_remain_on_channel_exp_ind
    00856 {
    00858     uint8_t vif_index;
    00860     uint8_t chan_ctxt_index;
    00861 };
    00862
    00864 struct mm_set_ps_options_req
    00865 {
    00867     uint8_t vif_index;
    00869     uint16_t listen_interval;
    00871     bool dont_listen_bc_mc;
    00872 };
    00873
    00875 struct mm_csa_counter_ind
    00876 {
    00878     uint8_t vif_index;
    00880     uint8_t csa_count;
    00881 };
    00882
    00884 struct mm_channel_survey_ind
    00885 {
    00887     uint16_t freq;
    00889     int8_t noise_dbm;
    00891     uint32_t chan_time_ms;
    00893     uint32_t chan_time_busy_ms;
    00894 };
    00895
    00897 struct mm_bfmer_enable_req
    00898 {
    00900     uint32_t host_bfr_addr;
    00905     uint16_t host_bfr_size;
    00907     uint16_t aid;
    00909     uint8_t sta_idx;
    00911     uint8_t rx_nss;
    00913     bool vht_mu_bfmee;
    00914 };
    00915
    00917 struct mm_cfg_rssi_req
    00918 {
    00920     uint8_t vif_index;
    00922     int8_t rssi_thold;
    00924     uint8_t rssi_hyst;
    00925 };
    00926
    00928 struct mm_rssi_status_ind
    00929 {
    00931     uint8_t vif_index;
    00933     bool rssi_status;
    00935     int8_t rssi;
    00936 };
    00937
    00939 struct mm_pktloss_ind
    00940 {
    00942     uint8_t vif_index;
    00944     struct mac_addr mac_addr;
    00946     uint32_t num_packets;
    00947 };
    00948
    00950 struct mm_csa_finish_ind
    00951 {
    00953     uint8_t vif_index;
    00955     uint8_t status;
    00957     uint8_t chan_idx;
    00958 };
    00959
    00961 struct mm_csa_traffic_ind
    00962 {
    00964     uint8_t vif_index;
    00966     bool enable;
    00967 };
    00968
    00970 typedef void (*cb_idle_func_ptr)(void);
    00971
    00973 struct mm_force_idle_req
    00974 {
    00976     cb_idle_func_ptr cb;
    00977 };
    00978
    00980 struct mm_tbtt_move_req
    00981 {
    00983     int32_t offset;
    00984 };
    00985
    00987 struct mm_set_p2p_noa_req
    00988 {
    00990     uint8_t vif_index;
    00992     uint8_t noa_inst_nb;
    00994     uint8_t count;
    00996     bool dyn_noa;
    00998     uint32_t duration_us;
    01000     uint32_t interval_us;
    01002     uint32_t start_offset;
    01003 };
    01004
    01006 struct mm_set_p2p_oppps_req
    01007 {
    01009     uint8_t vif_index;
    01011     uint8_t ctwindow;
    01012 };
    01013
    01015 struct mm_set_p2p_noa_cfm
    01016 {
    01018     uint8_t status;
    01019 };
    01020
    01022 struct mm_set_p2p_oppps_cfm
    01023 {
    01025     uint8_t status;
    01026 };
    01027
    01029 struct mm_p2p_noa_upd_ind
    01030 {
    01032     uint8_t vif_index;
    01034     uint8_t noa_inst_nb;
    01036     uint8_t noa_type;
    01038     uint8_t count;
    01040     uint32_t duration_us;
    01042     uint32_t interval_us;
    01044     uint32_t start_time;
    01045 };
    01046
    01048 struct mm_mu_group_update_req
    01049 {
    01051     uint8_t sta_idx;
    01053     uint8_t group_cnt;
    01055     struct
    01056     {
    01058         uint8_t group_id;
    01060         uint8_t user_pos;
    01061     } groups[0];
    01062 };
    01063
    01065 struct mm_ant_div_init_req
    01066 {
    01068     bool enable;
    01069 };
    01070
    01071 /*
    01072  * TASK DESCRIPTOR DECLARATIONS
    01073  ****************************************************************************************
    01074  */
    01075 extern const struct ke_state_handler mm_state_handler[MM_STATE_MAX];
    01076
    01077 extern const struct ke_state_handler mm_default_handler;
    01078
    01079 extern ke_state_t mm_state[MM_IDX_MAX];
    01080
    01082
    01083 #endif // _MM_TASK_H_