From 58d236151a77eb0e7645bbf449a43ac24ad044b5 Mon Sep 17 00:00:00 2001 From: luigi__ Date: Mon, 18 Jan 2010 21:19:41 +0000 Subject: [PATCH] Wifi: some bugxifing. After that I've been able to use ClIRC (IRC client for DS) and chat on #dolphin-emu! But I couldn't connect to freenode.net for some reason. Also, I readded the WFC profile for SoftAP, which would be needed by some homebrew. But I made the connection ID field empty. Anyway WFC doesn't work, remember. --- desmume/src/wifi.cpp | 33 +++++++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 6 deletions(-) diff --git a/desmume/src/wifi.cpp b/desmume/src/wifi.cpp index 93f16c54b..ebb5c10f7 100644 --- a/desmume/src/wifi.cpp +++ b/desmume/src/wifi.cpp @@ -156,7 +156,7 @@ const u8 FW_BBChannel[14] = { 0xb3, 0xb3, 0xb3, 0xb3, 0xb3, /* channel 1- 6 */ } ; /* Note : the values are inspired from what I found in a firmware image from my DS */ - +/* FW_WFCProfile FW_WFCProfile1 = {"", "", "", @@ -176,6 +176,26 @@ FW_WFCProfile FW_WFCProfile1 = {"", 0, {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, {0, 0} + } ;*/ +FW_WFCProfile FW_WFCProfile1 = {"SoftAP", + "", + "", + "", + "", + "", + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + {0, 0, 0, 0}, + 0, + "", + 0, + 0, + 0, + {0, 0, 0, 0, 0, 0, 0}, + 0, + {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, + {0, 0} } ; FW_WFCProfile FW_WFCProfile2 = {"", @@ -2240,8 +2260,8 @@ void SoftAP_usTrigger() if (memcmp(&frame[6], &wifiMac.mac.bytes[0], 6)) { if ((!memcmp(&frame[0], &BroadcastMAC[0], 6)) || - (!memcmp(&frame[0], &wifiMac.bss.bytes[0], 6)) || - (!memcmp(&wifiMac.bss.bytes[0], &BroadcastMAC[0], 6))) + (!memcmp(&frame[0], &wifiMac.mac.bytes[0], 6)) || + (!memcmp(&wifiMac.mac.bytes[0], &BroadcastMAC[0], 6))) { WIFI_triggerIRQ(WIFI_IRQ_RXSTART); @@ -2250,9 +2270,10 @@ void SoftAP_usTrigger() u8 packet[2048]; //if (hdr.len >= 0x11D) - //printf("RECEIVED DATA FRAME: len=%i, src=%02X:%02X:%02X:%02X:%02X:%02X, dst=%02X:%02X:%02X:%02X:%02X:%02X, ethertype=%04X, dhcptype=%02X\n", - // 24 + (hdr.len-12), frame[6], frame[7], frame[8], frame[9], frame[10], frame[11], - // frame[0], frame[1], frame[2], frame[3], frame[4], frame[5], *(u16*)&frame[12], frame[0x11C]); + if ((!memcmp(&frame[0], &wifiMac.mac.bytes[0], 6))) + printf("RECEIVED DATA FRAME: len=%i, src=%02X:%02X:%02X:%02X:%02X:%02X, dst=%02X:%02X:%02X:%02X:%02X:%02X, ethertype=%04X\n", + 24 + (hdr.len-12), frame[6], frame[7], frame[8], frame[9], frame[10], frame[11], + frame[0], frame[1], frame[2], frame[3], frame[4], frame[5], *(u16*)&frame[12]); WIFI_MakeRXHeader(packet, 0x0018, 20, packetLen, 0, 0); *(u16*)&packet[12+0] = 0x0208;