@@ -21729,7 +21729,7 @@ static bool cyw_wifi_connect(char *ssid, char *pass) {
2172921729 uint32_t data[64/4 + 1]; // max pass length: 64 for WPA, 128 for WPA3 SAE
2173021730 uint16_t *da = (uint16_t *) data;
2173121731 unsigned int len;
21732- uint32_t val;
21732+ uint32_t val;
2173321733 val = 4; // security type: 0 for none, 2 for WPA, 4 for WPA2/WPA3, 6 for mixed WPA/WPA2
2173421734 // sup_wpa[1] = 0 if not using security
2173521735 if (!(cyw_ioctl_set(134 /* SET_WSEC */, (uint8_t *)&val, sizeof(val))
@@ -21771,7 +21771,7 @@ static bool cyw_wifi_ap_start(char *ssid, char *pass, unsigned int channel) {
2177121771 uint32_t data[64/4 + 2]; // max pass length: 64 for WPA, 128 for WPA3 SAE
2177221772 uint16_t *da = (uint16_t *) data;
2177321773 unsigned int len;
21774- uint32_t val;
21774+ uint32_t val;
2177521775 // CHIP DEPENDENCY
2177621776 // RPi set the AMPDU parameter for AP (window size = 2) *****************
2177721777 // val = 2 ; cyw_ioctl_iovar_set_(0, "ampdu_ba_wsize", (uint8_t *)&val, sizeof(val));
@@ -21800,10 +21800,10 @@ static bool cyw_wifi_ap_start(char *ssid, char *pass, unsigned int channel) {
2180021800 da[1] = 1; // indicates wireless security key, skip for WPA3 SAE
2180121801 memcpy((uint8_t *)data + 2 * sizeof(uint16_t), pass, len); // skip for WPA3 SAE
2180221802 if (!cyw_ioctl_set_(1, 268 /* SET_WSEC_PMK */, data, sizeof(data))) return false; // skip for WPA3 SAE, sizeof/2 if supporting SAE but using WPA
21803- /* for WPA3 SAE:
21803+ /* for WPA3 SAE:
2180421804 memcpy((uint8_t *)data + sizeof(uint16_t), pass, len);
2180521805 cyw_ioctl_iovar_set_(1, "sae_password", data, sizeof(data)); */
21806- /* for WPA3 or mixed WPA2/WPA3:
21806+ /* for WPA3 or mixed WPA2/WPA3:
2180721807 val = 5 ; cyw_ioctl_iovar_set_(1, "sae_max_pwe_loop", (uint8_t *)&val, sizeof(val)); // Some chipsets do not support this */
2180821808 // resume if not using auth
2180921809
@@ -21949,7 +21949,7 @@ static void cyw_handle_scan_result(uint32_t status, struct scan_result *data, si
2194921949 bss.band = band & CYW_BSS_BAND2G ? MG_WIFI_BAND_2G : MG_WIFI_BAND_5G;
2195021950 bss.security = (sbss->capability & MG_BIT(4) /* CAP_PRIVACY */) ? MG_WIFI_SECURITY_WEP : MG_WIFI_SECURITY_OPEN;
2195121951 { // travel IEs (Information Elements) in search of security definitions
21952- const uint8_t wot1[4] = {0x00, 0x50, 0xf2, 0x01}; // WPA_OUI_TYPE1
21952+ const uint8_t wot1[4] = {0x00, 0x50, 0xf2, 0x01}; // WPA_OUI_TYPE1
2195321953 uint8_t *ie = (uint8_t *)sbss + sbss->ie_offset;
2195421954 int bytes = (int) sbss->ie_length;
2195521955 while (bytes > 0 && ie[1] + 2 < bytes) { // ie[0] -> type, ie[1] -> bytes from ie[2]
@@ -21960,11 +21960,11 @@ static void cyw_handle_scan_result(uint32_t status, struct scan_result *data, si
2196021960 bytes -= ie[1] + 2;
2196121961 }
2196221962 }
21963- MG_VERBOSE(("BSS: %.*s (%u) (%M) %d dBm %u", bss.SSID.len, bss.SSID.buf, bss.channel, mg_print_mac, bss.BSSID, (int) bss.RSSI, bss.security));
21963+ MG_VERBOSE(("BSS: %.*s (%u) (%M) %d dBm %u", bss.SSID.len, bss.SSID.buf, bss.channel, mg_print_mac, bss.BSSID, (int) bss.RSSI, bss.security));
2196421964 mg_tcpip_call(s_ifp, MG_TCPIP_EV_WIFI_SCAN_RESULT, &bss);
2196521965 } else {
2196621966 MG_ERROR(("scan error"));
21967- }
21967+ }
2196821968}
2196921969// clang-format on
2197021970
@@ -21986,7 +21986,7 @@ static void cyw_handle_cdc(struct cdc_hdr *cdc, size_t len) {
2198621986 return;
2198721987 }
2198821988 if (mg_log_level >= MG_LL_VERBOSE) mg_hexdump((void *) cdc, len);
21989- MG_DEBUG (("IOCTL result: %02x %02x %02x %02x . ..", r[0], r[1], r[2], r[3]));
21989+ MG_VERBOSE (("IOCTL result: %02x %02x %02x %02x ..", r[0], r[1], r[2], r[3]));
2199021990 s_ioctl_resp = r;
2199121991}
2199221992// NOTE(): alt no loop handler dispatching IOCTL response to current handler:
@@ -22156,7 +22156,7 @@ static bool cyw_init(uint8_t *mac) {
2215622156 // CHIP DEPENDENCY
2215722157 val = 8 ; cyw_ioctl_iovar_set("ampdu_ba_wsize", (uint8_t *)&val, sizeof(val));
2215822158 val = 4 ; cyw_ioctl_iovar_set("ampdu_mpdu", (uint8_t *)&val, sizeof(val));
22159- val = 0 /* 8K */; cyw_ioctl_iovar_set("ampdu_rx_factor", (uint8_t *)&val, sizeof(val));
22159+ val = 0 /* 8K */; cyw_ioctl_iovar_set("ampdu_rx_factor", (uint8_t *)&val, sizeof(val));
2216022160 //
2216122161 {
2216222162 struct cyw_country c;
@@ -22374,7 +22374,7 @@ static bool cyw_load_fwll(void *fwdata, size_t fwlen, void *nvramdata, size_t nv
2237422374 cyw_load_data(CYW_CHIP_ATCMRAM_BASE, fwdata, fwlen);
2237522375 mg_delayms(5); // TODO(scaprile): CHECK IF THIS IS ACTUALLY NEEDED
2237622376 // Load NVRAM and place 'length ~length' at the end; end of chip RAM
22377- {
22377+ {
2237822378 const uint32_t start = CYW_CHIP_RAM_SIZE - 4 - nvramlen;
2237922379 cyw_load_data(start, nvramdata, nvramlen); // nvramlen must be a multiple of 4
2238022380 // RAM_SIZE is a multiple of WINSZ, so the place for len ~len will be at the end of the window
@@ -22665,7 +22665,7 @@ static bool cyw_sdio_init() {
2266522665 struct mg_tcpip_sdio *s = (struct mg_tcpip_sdio *) d->bus;
2266622666 uint32_t val = 0;
2266722667 if (!mg_sdio_init(s)) return false;
22668- // no block transfers on F0. if (!mg_sdio_set_blksz(s, CYW_SDIO_FUNC_BUS, 32)) return false;
22668+ // no block transfers on F0. if (!mg_sdio_set_blksz(s, CYW_SDIO_FUNC_BUS, 32)) return false;
2266922669 if (!mg_sdio_set_blksz(s, CYW_SDIO_FUNC_CHIP, 64)) return false;
2267022670 if (!mg_sdio_set_blksz(s, CYW_SDIO_FUNC_WLAN, 64)) return false;
2267122671 // TODO(scaprile): we don't handle SDIO interrupts, study CCCR INTEN and SDIO support (SDIO 6.3, 8)
0 commit comments