1 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */ 2 /* Copyright (c) 2011 Realtek Semiconductor Corp. */ 3 4 #ifndef __INC_RA_H 5 #define __INC_RA_H 6 /* Module Name: RateAdaptive.h 7 * Abstract: Prototype of RA and related data structure. 8 */ 9 10 #include <linux/bitfield.h> 11 12 /* Rate adaptive define */ 13 #define PERENTRY 23 14 #define RETRYSIZE 5 15 #define RATESIZE 28 16 #define TX_RPT2_ITEM_SIZE 8 17 18 /* TX report 2 format in Rx desc */ 19 #define GET_TX_RPT2_DESC_PKT_LEN_88E(__rxstatusdesc) \ 20 le32_get_bits(*(__le32 *)__rxstatusdesc, GENMASK(8, 0)) 21 #define GET_TX_RPT2_DESC_MACID_VALID_1_88E(__rxstatusdesc) \ 22 le32_to_cpu((*(__le32 *)(__rxstatusdesc + 16)) 23 #define GET_TX_RPT2_DESC_MACID_VALID_2_88E(__rxstatusdesc) \ 24 le32_to_cpu((*(__le32 *)(__rxstatusdesc + 20)) 25 /* End rate adaptive define */ 26 27 int ODM_RAInfo_Init_all(struct odm_dm_struct *dm_odm); 28 29 int ODM_RAInfo_Init(struct odm_dm_struct *dm_odm, u8 MacID); 30 31 u8 ODM_RA_GetShortGI_8188E(struct odm_dm_struct *dm_odm, u8 MacID); 32 33 u8 ODM_RA_GetDecisionRate_8188E(struct odm_dm_struct *dm_odm, u8 MacID); 34 35 u8 ODM_RA_GetHwPwrStatus_8188E(struct odm_dm_struct *dm_odm, u8 MacID); 36 void ODM_RA_UpdateRateInfo_8188E(struct odm_dm_struct *dm_odm, u8 MacID, 37 u8 RateID, u32 RateMask, 38 u8 SGIEnable); 39 40 void ODM_RA_SetRSSI_8188E(struct odm_dm_struct *dm_odm, u8 macid, 41 u8 rssi); 42 43 void ODM_RA_TxRPT2Handle_8188E(struct odm_dm_struct *dm_odm, 44 u8 *txrpt_buf, u16 txrpt_len, 45 u32 validentry0, u32 validentry1); 46 47 void ODM_RA_Set_TxRPT_Time(struct odm_dm_struct *dm_odm, u16 minRptTime); 48 49 #endif 50