cachepc-linux

Fork of AMDESE/linux with modifications for CachePC side-channel attack
git clone https://git.sinitax.com/sinitax/cachepc-linux
Log | Files | Refs | README | LICENSE | sfeed.txt

Hal8188ERateAdaptive.h (2085B)


      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
     26#define GET_TX_REPORT_TYPE1_RERTY_0(__paddr)			\
     27	le16_get_bits(*(__le16 *)__paddr, GENMASK(15, 0))
     28#define GET_TX_REPORT_TYPE1_RERTY_1(__paddr)			\
     29	LE_BITS_TO_1BYTE(__paddr + 2, 0, 8)
     30#define GET_TX_REPORT_TYPE1_RERTY_2(__paddr)			\
     31	LE_BITS_TO_1BYTE(__paddr + 3, 0, 8)
     32#define GET_TX_REPORT_TYPE1_RERTY_3(__paddr)			\
     33	LE_BITS_TO_1BYTE(__paddr + 4, 0, 8)
     34#define GET_TX_REPORT_TYPE1_RERTY_4(__paddr)			\
     35	LE_BITS_TO_1BYTE(__paddr + 5, 0, 8)
     36#define GET_TX_REPORT_TYPE1_DROP_0(__paddr)			\
     37	LE_BITS_TO_1BYTE(__paddr + 6, 0, 8)
     38/*  End rate adaptive define */
     39
     40int ODM_RAInfo_Init_all(struct odm_dm_struct *dm_odm);
     41
     42int ODM_RAInfo_Init(struct odm_dm_struct *dm_odm, u8 MacID);
     43
     44u8 ODM_RA_GetShortGI_8188E(struct odm_dm_struct *dm_odm, u8 MacID);
     45
     46u8 ODM_RA_GetDecisionRate_8188E(struct odm_dm_struct *dm_odm, u8 MacID);
     47
     48u8 ODM_RA_GetHwPwrStatus_8188E(struct odm_dm_struct *dm_odm, u8 MacID);
     49void ODM_RA_UpdateRateInfo_8188E(struct odm_dm_struct *dm_odm, u8 MacID,
     50				 u8 RateID, u32 RateMask,
     51				 u8 SGIEnable);
     52
     53void ODM_RA_SetRSSI_8188E(struct odm_dm_struct *dm_odm, u8 macid,
     54			  u8 rssi);
     55
     56void ODM_RA_TxRPT2Handle_8188E(struct odm_dm_struct *dm_odm,
     57			       u8 *txrpt_buf, u16 txrpt_len,
     58			       u32 validentry0, u32 validentry1);
     59
     60void ODM_RA_Set_TxRPT_Time(struct odm_dm_struct *dm_odm, u16 minRptTime);
     61
     62#endif