Back to home page

OSCL-LXR

 
 

    


0001 /* SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause */
0002 /* Copyright(c) 2018-2019  Realtek Corporation
0003  */
0004 
0005 #ifndef __RTW_MAC_H__
0006 #define __RTW_MAC_H__
0007 
0008 #define RTW_HW_PORT_NUM     5
0009 #define cut_version_to_mask(cut) (0x1 << ((cut) + 1))
0010 #define SDIO_LOCAL_OFFSET   0x10250000
0011 #define DDMA_POLLING_COUNT  1000
0012 #define C2H_PKT_BUF     256
0013 #define REPORT_BUF      128
0014 #define PHY_STATUS_SIZE     4
0015 #define ILLEGAL_KEY_GROUP   0xFAAAAA00
0016 
0017 /* HW memory address */
0018 #define OCPBASE_RXBUF_FW_88XX       0x18680000
0019 #define OCPBASE_TXBUF_88XX      0x18780000
0020 #define OCPBASE_ROM_88XX        0x00000000
0021 #define OCPBASE_IMEM_88XX       0x00030000
0022 #define OCPBASE_DMEM_88XX       0x00200000
0023 #define OCPBASE_EMEM_88XX       0x00100000
0024 
0025 #define RSVD_PG_DRV_NUM         16
0026 #define RSVD_PG_H2C_EXTRAINFO_NUM   24
0027 #define RSVD_PG_H2C_STATICINFO_NUM  8
0028 #define RSVD_PG_H2CQ_NUM        8
0029 #define RSVD_PG_CPU_INSTRUCTION_NUM 0
0030 #define RSVD_PG_FW_TXBUF_NUM        4
0031 
0032 void rtw_set_channel_mac(struct rtw_dev *rtwdev, u8 channel, u8 bw,
0033              u8 primary_ch_idx);
0034 int rtw_mac_power_on(struct rtw_dev *rtwdev);
0035 void rtw_mac_power_off(struct rtw_dev *rtwdev);
0036 int rtw_download_firmware(struct rtw_dev *rtwdev, struct rtw_fw_state *fw);
0037 int rtw_mac_init(struct rtw_dev *rtwdev);
0038 void rtw_mac_flush_queues(struct rtw_dev *rtwdev, u32 queues, bool drop);
0039 int rtw_ddma_to_fw_fifo(struct rtw_dev *rtwdev, u32 ocp_src, u32 size);
0040 
0041 static inline void rtw_mac_flush_all_queues(struct rtw_dev *rtwdev, bool drop)
0042 {
0043     rtw_mac_flush_queues(rtwdev, BIT(rtwdev->hw->queues) - 1, drop);
0044 }
0045 
0046 #endif