From 192d7355c2d87f26ec67f365dd86d15c0ae4a4a2 Mon Sep 17 00:00:00 2001 From: nawrhehe Date: Thu, 15 Oct 2026 21:24:38 +0200 Subject: [PATCH] feat(wifi): expand wireless capabilities and channel configuration --- QualcommWireless/QualcommWifi.cpp | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/QualcommWireless/QualcommWifi.cpp b/QualcommWireless/QualcommWifi.cpp index 729d918..7749f76 100644 --- a/QualcommWireless/QualcommWifi.cpp +++ b/QualcommWireless/QualcommWifi.cpp @@ -755,6 +755,11 @@ SInt32 QualcommWifi::apple80211Request(unsigned int req_type, int req_val, IO802 SET_CAP(APPLE80211_CAP_WPA); SET_CAP(APPLE80211_CAP_SHORT_GI_20MHZ); SET_CAP(APPLE80211_CAP_SHORT_GI_40MHZ); + SET_CAP(APPLE80211_CAP_BURST); + SET_CAP(APPLE80211_CAP_WME); + SET_CAP(APPLE80211_CAP_PMGT); + SET_CAP(APPLE80211_CAP_SHPREAMBLE); + SET_CAP(APPLE80211_CAP_SHSLOT); #undef SET_CAP return 0; } @@ -791,14 +796,33 @@ SInt32 QualcommWifi::apple80211Request(unsigned int req_type, int req_val, IO802 case APPLE80211_IOC_CHANNEL: { apple80211_channel_data *cd = (apple80211_channel_data *)req_data; if (cd) { + if (req_val == 1 && cd->channel.channel > 0) { + fCurrentChannel = cd->channel.channel; + IOLog("QualcommWifi: Changement de canal Wi-Fi vers %u\n", fCurrentChannel); + } cd->version = APPLE80211_VERSION; cd->channel.version = APPLE80211_VERSION; cd->channel.channel = fCurrentChannel > 0 ? fCurrentChannel : 1; - cd->channel.flags = APPLE80211_C_FLAG_2GHZ | APPLE80211_C_FLAG_20MHZ; + cd->channel.flags = (cd->channel.channel <= 14) ? (APPLE80211_C_FLAG_2GHZ | APPLE80211_C_FLAG_20MHZ) : (APPLE80211_C_FLAG_5GHZ | APPLE80211_C_FLAG_80MHZ); return 0; } break; } + case APPLE80211_IOC_TXPOWER: { + apple80211_txpower_data *tx = (apple80211_txpower_data *)req_data; + if (tx) { + tx->version = APPLE80211_VERSION; + tx->txpower_unit = APPLE80211_UNIT_DBM; + tx->txpower = 20; // 20 dBm (100 mW) + return 0; + } + break; + } + case APPLE80211_IOC_PROTMODE: + case APPLE80211_IOC_POWERSAVE: + case APPLE80211_IOC_SCANCACHE_CLEAR: { + return 0; + } case APPLE80211_IOC_RSSI: { apple80211_rssi_data *rd = (apple80211_rssi_data *)req_data; if (rd) {