【openwrt-21.02】T750+MT7916 通过ioctl获取在线终端数量及WPS状态实现

时间:2024-10-30 08:16:34
  • ifndef __MTK_WIFI_WPS_H__
  • #define __MTK_WIFI_WPS_H__
  • //rtmp_type.h
  • typedef signed char INT8;
  • typedef unsigned char UINT8;
  • typedef signed short INT16;
  • typedef unsigned short UINT16;
  • typedef signed int INT32;
  • typedef unsigned int UINT32;
  • typedef signed long long INT64;
  • typedef unsigned long long UINT64;
  • typedef signed char CHAR;
  • typedef unsigned char UCHAR;
  • typedef signed short SHORT;
  • typedef unsigned short USHORT;
  • typedef signed int INT;
  • typedef unsigned int UINT;
  • typedef signed long LONG;
  • typedef unsigned long ULONG;
  • //
  • typedef union _HTTRANSMIT_SETTING {
  • #ifdef RT_BIG_ENDIAN
  • struct {
  • USHORT MODE:3; /* Use definition MODE_xxx. */
  • USHORT iTxBF:1;
  • USHORT eTxBF:1;
  • USHORT STBC:1; /* only support in HT/VHT mode with MCS0~7 */
  • USHORT ShortGI:1; /* TBD: need to extend to 2 bits for HE GI */
  • USHORT BW:2; /* channel bandwidth 20MHz/40/80 MHz */
  • USHORT ldpc:1;
  • USHORT MCS:6; /* MCS */
  • } field;
  • #else
  • struct {
  • USHORT MCS:6;
  • USHORT ldpc:1;
  • USHORT BW:2;
  • USHORT ShortGI:1;
  • USHORT STBC:1;
  • USHORT eTxBF:1;
  • USHORT iTxBF:1;
  • USHORT MODE:3;
  • } field;
  • #endif
  • USHORT word;
  • } HTTRANSMIT_SETTING, *PHTTRANSMIT_SETTING;
  • //rt_os.h
  • #ifndef SIOCDEVPRIVATE
  • #define SIOCDEVPRIVATE 0x8BE0
  • #endif
  • #define SIOCIWFIRSTPRIV SIOCDEVPRIVATE
  • #define RT_PRIV_IOCTL (SIOCIWFIRSTPRIV + 0x01)
  • //
  • #define RT_OID_WSC_QUERY_STATUS 0x0751
  • #define RTPRIV_IOCTL_GET_MAC_TABLE_STRUCT (SIOCIWFIRSTPRIV + 0x1F)
  • //mgmt_entrytb.h
  • #define MAX_NUMBER_OF_MAC 544
  • typedef struct _RT_802_11_MAC_ENTRY {
  • UCHAR ApIdx;
  • UCHAR Addr[6];
  • UINT16 Aid;
  • UCHAR Psm; /* 0:PWR_ACTIVE, 1:PWR_SAVE */
  • UCHAR MimoPs; /* 0:MMPS_STATIC, 1:MMPS_DYNAMIC, 3:MMPS_Enabled */
  • CHAR AvgRssi0;
  • CHAR AvgRssi1;
  • CHAR AvgRssi2;
  • CHAR AvgRssi3;
  • UINT32 ConnectedTime;
  • HTTRANSMIT_SETTING TxRate;
  • UINT32 LastRxRate;
  • /*
  • sync with WEB UI's structure for ioctl usage.
  • */
  • SHORT StreamSnr[3]; /* BF SNR from RXWI. Units=0.25 dB. 22 dB offset removed */
  • SHORT SoundingRespSnr[3]; /* SNR from Sounding Response. Units=0.25 dB. 22 dB offset removed */
  • /* SHORT TxPER; */ /* TX PER over the last second. Percent */
  • /* SHORT reserved;*/
  • } RT_802_11_MAC_ENTRY, *PRT_802_11_MAC_ENTRY;
  • typedef struct _RT_802_11_MAC_TABLE {
  • ULONG Num;
  • RT_802_11_MAC_ENTRY Entry[MAX_NUMBER_OF_MAC];
  • } RT_802_11_MAC_TABLE, *PRT_802_11_MAC_TABLE;
  • #endif