1 // Copyright (C) 2022 Beken Corporation 2 // 3 // Licensed under the Apache License, Version 2.0 (the "License"); 4 // you may not use this file except in compliance with the License. 5 // You may obtain a copy of the License at 6 // 7 // http://www.apache.org/licenses/LICENSE-2.0 8 // 9 // Unless required by applicable law or agreed to in writing, software 10 // distributed under the License is distributed on an "AS IS" BASIS, 11 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 // See the License for the specific language governing permissions and 13 // limitations under the License. 14 15 #pragma once 16 17 #ifdef __cplusplus 18 extern "C" { 19 #endif 20 21 #define MPB_DEV_NAME "mac_phy_bypass" 22 23 #define MPB_CMD_MAGIC (0xcbe0000) 24 enum 25 { 26 MCMD_RX_MODE_BYPASS_MAC = MPB_CMD_MAGIC + 0, 27 MCMD_TX_MODE_BYPASS_MAC = MPB_CMD_MAGIC + 1, 28 MCMD_TX_LEGACY_SET_LEN, 29 MCMD_TX_HT_VHT_SET_LEN, 30 MCMD_STOP_BYPASS_MAC, 31 MCMD_START_BYPASS_MAC, 32 MCMD_SET_BANDWIDTH, 33 MCMD_SET_GI, 34 MCMD_BYPASS_TX_SET_RATE_MFORMAT, 35 MCMD_SET_TXDELAY, 36 MCMD_INIT_BYPASS_MAC, 37 MCMD_BYPASS_MAC_SET_TX_PLD_TYPE, 38 MCMD_BYPASS_MAC_SET_TX_PKT_NUM, 39 MCMD_TX_HE_SET_LEN, 40 MCMD_ONLY_VHT_SET_LEN, 41 }; 42 43 #define TX_LEGACY_DATA_LEN_MASK (0xFFF) 44 #define TX_HT_VHT_DATA_LEN_MASK (0xFFFFF) 45 #define TX_HE_DATA_LEN_MASK (0xFFFFF) 46 47 /*MCMD_TX_BYPASS_MAC_RATE*/ 48 #define PPDU_RATE_POSI (4) 49 #define PPDU_RATE_MASK (0xF) 50 51 #define PPDU_BANDWIDTH_POSI (6) 52 #define PPDU_BANDWIDTH_MASK (0x1) 53 54 #define PPDU_LEG_RATE_1MBPS (0x00) 55 #define PPDU_LEG_RATE_2MBPS (0x01) 56 #define PPDU_LEG_RATE_5_5MBPS (0x02) 57 #define PPDU_LEG_RATE_11MBPS (0x03) 58 #define PPDU_LEG_RATE_6MBPS (0x0B) 59 #define PPDU_LEG_RATE_9MBPS (0x0F) 60 #define PPDU_LEG_RATE_12MBPS (0x0A) 61 #define PPDU_LEG_RATE_18MBPS (0x0E) 62 #define PPDU_LEG_RATE_24MBPS (0x09) 63 #define PPDU_LEG_RATE_36MBPS (0x0D) 64 #define PPDU_LEG_RATE_48MBPS (0x08) 65 #define PPDU_LEG_RATE_54MBPS (0x0C) 66 67 typedef struct mbps_txs_mfr_st { 68 UINT32 mod_format; 69 UINT32 rate; 70 }MBPS_TXS_MFR_ST, *MBPS_TXS_MFR_PTR; 71 72 void mpb_init(void); 73 void mpb_exit(void); 74 extern UINT32 mpb_ctrl(UINT32 cmd, void *param); 75 #ifdef __cplusplus 76 } 77 #endif 78