00001 00013 #ifndef _TX_SWDESC_H_ 00014 #define _TX_SWDESC_H_ 00015 00033 /* 00034 * INCLUDE FILES 00035 **************************************************************************************** 00036 */ 00037 #include "co_int.h" 00038 #include "co_bool.h" 00039 00040 #include "rwnx_config.h" 00041 #include "mac.h" 00042 #include "hal_desc.h" 00043 #if NX_UMAC_PRESENT 00044 #include "txu_cntrl.h" 00045 #endif 00046 00047 /* 00048 * DEFINES 00049 **************************************************************************************** 00050 */ 00051 00052 #if (NX_AMPDU_TX) 00054 #define DELIMITER_LEN 4 00055 #endif //(NX_AMPDU_TX) 00056 00057 enum tx_swdesc_umac_flags 00058 { 00060 TX_SWDESC_UMAC_BEAMFORM_BIT = CO_BIT(0), 00062 TX_SWDESC_UMAC_TRIAL_BEAMFORM_BIT = CO_BIT(1), 00064 TX_SWDESC_UMAC_TRIAL_STBC_BIT = CO_BIT(2), 00066 TX_SWDESC_UMAC_HTC_BIT = CO_BIT(3), 00068 TX_SWDESC_UMAC_TRIAL_HTC_BIT = CO_BIT(4) 00069 }; 00070 00071 /* 00072 * TYPE and STRUCT DEFINITIONS 00073 **************************************************************************************** 00074 */ 00075 00076 struct tx_agg_desc; 00077 struct txl_buffer_tag; 00078 struct tx_dmadesc; 00079 00082 struct txl_buffer_control 00083 { 00084 union 00085 { 00087 struct tx_policy_tbl policy_tbl; 00089 struct tx_compressed_policy_tbl comp_pol_tbl; 00090 }; 00092 uint32_t mac_control_info; 00094 uint32_t phy_control_info; 00095 #if NX_UMAC_PRESENT 00096 00100 uint32_t tx_flags; 00101 #endif // NX_UMAC_PRESENT 00102 #if !NX_UMAC_PRESENT 00104 uint32_t status; 00105 #endif 00106 }; 00107 00109 struct hostdesc 00110 { 00111 #if NX_FULLY_HOSTED 00113 void *buf; 00114 #endif 00115 #if NX_AMSDU_TX 00117 uint32_t packet_addr[NX_TX_PAYLOAD_MAX]; 00119 uint16_t packet_len[NX_TX_PAYLOAD_MAX]; 00121 uint8_t packet_cnt; 00122 #else 00124 uint32_t packet_addr; 00126 uint16_t packet_len; 00127 #endif //(NX_AMSDU_TX) 00128 00129 #if NX_UMAC_PRESENT 00130 #if !NX_FULLY_HOSTED 00132 uint32_t status_desc_addr; 00133 #endif 00134 00135 struct mac_addr eth_dest_addr; 00137 struct mac_addr eth_src_addr; 00139 uint16_t ethertype; 00141 uint16_t pn[4]; 00143 uint16_t sn; 00145 uint16_t timestamp; 00146 #else 00147 #if NX_AMPDU_TX 00149 uint16_t sn; 00150 #endif 00152 uint8_t padding; 00153 #endif 00155 uint8_t tid; 00157 uint8_t vif_idx; 00159 uint8_t staid; 00160 #if RW_MUMIMO_TX_EN 00164 uint8_t mumimo_info; 00165 #endif 00166 #if NX_UMAC_PRESENT 00168 uint16_t flags; 00169 #endif 00170 #if NX_FULLY_HOSTED 00172 void *cfm_cb; 00174 void *cfm_cb_arg; 00176 struct tx_cfm_tag cfm; 00177 #endif 00178 }; 00179 00181 struct umacdesc 00182 { 00183 #if !NX_UMAC_PRESENT 00184 00188 uint16_t tx_flags; 00189 #endif // !NX_UMAC_PRESENT 00190 #if NX_AMPDU_TX 00192 uint16_t sn_win; 00194 uint32_t flags; 00196 uint32_t phy_flags; 00197 #endif //(NX_AMPDU_TX) 00198 #if (NX_UMAC_PRESENT) 00200 struct txl_buffer_control *buf_control; 00202 uint16_t payl_len; 00204 uint8_t machead_len; 00206 uint8_t head_len; 00208 uint8_t hdr_len_802_2; 00210 uint8_t tail_len; 00212 uint8_t rc_control; 00213 #if (RW_MESH_EN) 00215 bool has_mesh_ctrl; 00217 uint8_t nb_ext_addr; 00219 uint8_t path_idx; 00221 uint8_t proxy_idx; 00222 #endif //(RW_MESH_EN) 00223 #endif //(NX_UMAC_PRESENT) 00224 }; 00225 00227 struct lmacdesc 00228 { 00230 struct tx_agg_desc *agg_desc; 00231 #if NX_AMSDU_TX 00233 struct txl_buffer_tag *buffer[NX_TX_PAYLOAD_MAX]; 00234 #else 00236 struct txl_buffer_tag *buffer; 00237 #endif //(NX_AMSDU_TX) 00238 #if (RW_BFMER_EN) 00240 struct bfr_mem_node *bfr_node; 00241 #endif //(RW_BFMER_EN) 00243 struct tx_hw_desc *hw_desc; 00244 }; 00245 00247 struct txdesc 00248 { 00250 struct co_list_hdr list_hdr; 00252 struct hostdesc host; 00254 struct umacdesc umac; 00256 struct lmacdesc lmac; 00257 }; 00258 00260 struct txdesc_api 00261 { 00263 struct hostdesc host; 00264 #if (!NX_UMAC_PRESENT) 00266 struct umacdesc umac; 00267 #endif 00268 }; 00269 00270 00272 struct txdesc_host 00273 { 00275 uint32_t ready; 00276 00278 struct txdesc_api api; 00279 }; 00280 00281 00282 #if NX_EMB 00283 // Prevent including the whole world in host case 00284 00285 /* 00286 * GLOBAL VARIABLES 00287 **************************************************************************************** 00288 */ 00289 #if !NX_FULLY_HOSTED 00291 extern struct txdesc *txdesc_array[NX_TXQ_CNT][RW_USER_MAX]; 00292 #endif 00293 00295 extern const int nx_txdesc_cnt[NX_TXQ_CNT]; 00296 00298 extern const int nx_txuser_cnt[NX_TXQ_CNT]; 00299 00300 /* 00301 * FUNCTION PROTOTYPES 00302 **************************************************************************************** 00303 */ 00304 00307 00314 void tx_txdesc_init(void); 00315 00324 __INLINE bool is_int_frame(struct txdesc *txdesc) 00325 { 00326 #if NX_AMSDU_TX 00327 return (txdesc->host.packet_addr[0] == 0); 00328 #else 00329 return (txdesc->host.packet_addr == 0); 00330 #endif 00331 } 00332 00333 #if NX_AMSDU_TX 00334 00342 __INLINE bool is_mpdu_split(struct txdesc *txdesc) 00343 { 00344 return (txdesc->host.packet_cnt > 1); 00345 } 00346 #endif 00347 00355 __INLINE bool is_qos_data(struct txdesc *txdesc) 00356 { 00357 return (txdesc->host.tid != 0xFF); 00358 } 00359 00369 __INLINE bool is_htc_sglt_allowed(struct txdesc *txdesc) 00370 { 00371 #if NX_UMAC_PRESENT 00372 // Check if the frame can be beamformed as a unicast 00373 if (txdesc->host.flags & TXU_CNTRL_RC_TRIAL) 00374 { 00375 return ((txdesc->umac.buf_control->tx_flags & TX_SWDESC_UMAC_TRIAL_HTC_BIT) != 0); 00376 } 00377 else 00378 { 00379 return ((txdesc->umac.buf_control->tx_flags & TX_SWDESC_UMAC_HTC_BIT) != 0); 00380 } 00381 #else 00382 return ((txdesc->umac.tx_flags & TX_SWDESC_UMAC_HTC_BIT) != 0); 00383 #endif 00384 } 00385 00393 __INLINE struct txdesc *tx_desc_next(struct txdesc *txdesc) 00394 { 00395 return (struct txdesc *)co_list_next(&txdesc->list_hdr); 00396 } 00397 00398 00399 #endif // NX_EMB 00402 00403 #endif // _CO_SWDESC_H_
1.6.1