PicoScenes API Docs
 
Loading...
Searching...
No Matches
MAC80211Utils.hxx
Go to the documentation of this file.
1//
2// Created by Zhiping Jiang on 12/27/19.
3//
4
5#ifndef PICOSCENES_PLATFORM_MAC80211UTILS_HXX
6#define PICOSCENES_PLATFORM_MAC80211UTILS_HXX
7
8#include "ModularPicoScenesFrame.hxx"
9#include "SystemTools.hxx"
10
15namespace MAC80211FrontEndUtils {
22 std::optional<std::string> path2Intel5300Debugfs(const std::string &phyId, const std::string &dest);
23
30 std::optional<std::string> path2IntelMVMDebugfs(const std::string &phyId, const std::string &dest);
31
38 std::optional<std::string> path2Ath9kDebugfs(const std::string &phyId, const std::string &dest);
39
45 uint32_t getIntelNewMVMRateNFlags4TxFrame(const ModularPicoScenesTxFrame &txframe);
46
52 uint32_t getIntelLegacyMVMRateNFlags4TxFrame(const ModularPicoScenesTxFrame &txframe);
53
59 uint32_t getIntelDVMRateNFlags4TxFrame(const ModularPicoScenesTxFrame &txframe);
60
66 bool isQCA9300NIC(const std::string &anyId);
67
73 bool isIWL5300NIC(const std::string &anyId);
74
80 bool isIntelMVMTypeNIC(const std::string &anyId);
81
87 bool isIntelAX200TypeNIC(const std::string &anyId);
88
94 bool isIntelAX210TypeNIC(const std::string &anyId);
95
101 bool isIntelAX211SubTypeNIC(const std::string &anyId);
102
108 bool isSupportedHardware(const std::string &anyId);
109
115
121 bool isIWLMVMUsingCSIFirmware(const std::string &anyId);
122
128
134
139 std::vector<std::string> searchAllCompatibleIntel5300Phys();
140
145 std::vector<std::string> searchAllCompatibleIntelMVMPhys();
146
151 std::vector<std::string> searchAllCompatibleAth9kPhys();
152
157 std::vector<std::string> searchAllCompatiblePhys();
158
164
170 std::optional<std::string> anyId2PhyId(const std::string &anyId);
171
177 std::optional<std::string> devId2PhyId(const std::string &devId);
178
184 std::optional<std::string> anyId2DevId(const std::string &anyId);
185
191 std::optional<std::string> anyId2MonId(const std::string &anyId);
192
198 std::optional<std::string> anyId2PhyPath(const std::string &anyId);
199
205 std::array<uint8_t, 6> MACAddress4PhyId(const std::string &phyId);
206
212 std::array<uint8_t, 6> MACAddress4DevId(const std::string &devId);
213
219 std::vector<std::string> searchNetworkInterfaces4PhyId(const std::string &phyId);
220
226 std::string searchMonId4PhyId(const std::string &phyId);
227
233 std::string searchDevId4PhyId(const std::string &phyId);
234
235 std::vector<double> systemSupportedChannelFrequencies(const std::string &phyId);
236
241 const std::vector<std::tuple<int, int, int>> &standard2_4_5GHzbandChannelsUpTo40MHzBW();
242
247 const std::vector<std::tuple<int, int, int>> &standard2_4_5GHzbandChannelsUpTo160MHzBW();
248
253 const std::vector<std::tuple<int, int, int>> &standardChannelsIn2_4_5_6GHzBandUpTo160MHzBW();
254
262 bool isSupportedChannelParametersBy2_4_5GBandHT40RateNIC(double controlFreq, double bw, double centerFreq);
263
271 bool isSupportedChannelParametersBy2_4_5GBandHE160RateNIC(double controlFreq, double bw, double centerFreq);
272
280 bool isSupportedChannelParametersBy2_4_5_6GBandHE160RateNIC(double controlFreq, double bw, double centerFreq);
281}
282
283
284#endif //PICOSCENES_PLATFORM_MAC80211UTILS_HXX
Namespace containing utility functions for MAC80211 frontend operations.
bool isIntelAX200TypeNIC(const std::string &anyId)
Check if device is an Intel AX200 type NIC.
bool isDeviceArrayPrepared()
Check if device array is prepared.
std::optional< std::string > devId2PhyId(const std::string &devId)
Convert device ID to physical interface ID.
bool isIWLMVMUsingCSIFirmware(const std::string &anyId)
Check if Intel MVM is using CSI firmware.
const std::vector< std::tuple< int, int, int > > & standard2_4_5GHzbandChannelsUpTo160MHzBW()
Get standard 2.4/5GHz band channels up to 160MHz bandwidth.
const std::vector< std::tuple< int, int, int > > & standardChannelsIn2_4_5_6GHzBandUpTo160MHzBW()
Get standard channels in 2.4/5/6GHz bands up to 160MHz bandwidth.
bool isIntelAX211SubTypeNIC(const std::string &anyId)
Check if device is an Intel AX211 subtype NIC.
std::vector< std::string > searchAllCompatibleAth9kPhys()
Search for all compatible Atheros 9k physical interfaces.
std::vector< std::string > searchAllCompatibleIntel5300Phys()
Search for all compatible Intel 5300 physical interfaces.
bool isIntelMVMTypeNIC(const std::string &anyId)
Check if device is an Intel MVM type NIC.
std::string searchMonId4PhyId(const std::string &phyId)
Search for monitor interface associated with physical interface.
bool isIWL5300NIC(const std::string &anyId)
Check if device is an IWL5300 NIC.
bool isIWLAX211PNVMFileCorrect()
Check if Intel AX211 PNVM file is correct.
std::string searchDevId4PhyId(const std::string &phyId)
Search for device interface associated with physical interface.
std::vector< std::string > searchAllCompatiblePhys()
Search for all compatible physical interfaces.
std::vector< double > systemSupportedChannelFrequencies(const std::string &phyId)
bool isSupportedHardware(const std::string &anyId)
Check if device is supported hardware.
std::optional< std::string > path2IntelMVMDebugfs(const std::string &phyId, const std::string &dest)
Get path to Intel MVM debugfs entry.
uint32_t getIntelDVMRateNFlags4TxFrame(const ModularPicoScenesTxFrame &txframe)
Get rate and flags for Intel DVM transmission frame.
bool isIntelAX210TypeNIC(const std::string &anyId)
Check if device is an Intel AX210 type NIC.
std::optional< std::string > path2Ath9kDebugfs(const std::string &phyId, const std::string &dest)
Get path to Atheros 9k debugfs entry.
std::optional< std::string > path2Intel5300Debugfs(const std::string &phyId, const std::string &dest)
Get path to Intel 5300 debugfs entry.
std::array< uint8_t, 6 > MACAddress4DevId(const std::string &devId)
Get MAC address for device interface.
bool isSupportedChannelParametersBy2_4_5GBandHT40RateNIC(double controlFreq, double bw, double centerFreq)
Check if channel parameters are supported by 2.4/5GHz band HT40 rate NIC.
std::optional< std::string > anyId2DevId(const std::string &anyId)
Convert any ID to device ID.
bool isIWL5300UsingCSIFirmware()
Check if IWL5300 is using CSI firmware.
std::vector< std::string > searchNetworkInterfaces4PhyId(const std::string &phyId)
Search for network interfaces associated with physical interface.
uint32_t getIntelLegacyMVMRateNFlags4TxFrame(const ModularPicoScenesTxFrame &txframe)
Get rate and flags for Intel legacy MVM transmission frame.
const std::vector< std::tuple< int, int, int > > & standard2_4_5GHzbandChannelsUpTo40MHzBW()
Get standard 2.4/5GHz band channels up to 40MHz bandwidth.
std::vector< std::string > searchAllCompatibleIntelMVMPhys()
Search for all compatible Intel MVM physical interfaces.
std::optional< std::string > anyId2PhyPath(const std::string &anyId)
Convert any ID to physical interface path.
bool isSupportedChannelParametersBy2_4_5GBandHE160RateNIC(double controlFreq, double bw, double centerFreq)
Check if channel parameters are supported by 2.4/5GHz band HE160 rate NIC.
std::optional< std::string > anyId2MonId(const std::string &anyId)
Convert any ID to monitor interface ID.
bool isQCA9300NIC(const std::string &anyId)
Check if device is a QCA9300 NIC.
uint32_t getIntelNewMVMRateNFlags4TxFrame(const ModularPicoScenesTxFrame &txframe)
Get rate and flags for Intel new MVM transmission frame.
std::array< uint8_t, 6 > MACAddress4PhyId(const std::string &phyId)
Get MAC address for physical interface.
bool isSupportedChannelParametersBy2_4_5_6GBandHE160RateNIC(double controlFreq, double bw, double centerFreq)
Check if channel parameters are supported by 2.4/5/6GHz band HE160 rate NIC.
bool isIWLAX210PNVMFileCorrect()
Check if Intel AX210 PNVM file is correct.
std::optional< std::string > anyId2PhyId(const std::string &anyId)
Convert any ID to physical interface ID.