diff --git a/desmume/src/wifi.cpp b/desmume/src/wifi.cpp index eb1735bd8..07eebd479 100644 --- a/desmume/src/wifi.cpp +++ b/desmume/src/wifi.cpp @@ -741,8 +741,8 @@ INLINE void WIFI_MakeRXHeader(u8* buf, u16 flags, u16 xferRate, u16 len, u8 maxR *(u16*)&buf[8] = len; - buf[10] = maxRSSI; - buf[11] = minRSSI; + buf[10] = 253;//maxRSSI; + buf[11] = 255;//minRSSI; } #ifdef EXPERIMENTAL_WIFI_COMM @@ -1324,7 +1324,7 @@ void WIFI_write16(u32 address, u16 val) wifiMac.aid = val & 0x07FF; break; case 0xD0: - //printf("wifi: rxfilter=%04X\n", val); + // printf("wifi: rxfilter=%04X\n", val); break; case 0x0E0: // printf("wifi: rxfilter2=%04X\n", val); @@ -2027,8 +2027,6 @@ static bool SoftAP_IsDNSRequestToWFC(u16 ethertype, u8* body) strcat(domainname, "."); } - WIFI_LOG(1, "SoftAP: detected DNS request to %s\n", domainname); - // if the domain name contains nintendowifi.net // it is most likely a WFC server // (note, conntest.nintendowifi.net just contains a dummy HTML page and @@ -2166,20 +2164,10 @@ void SoftAP_SendPacket(u8 *packet, u32 len) if (SoftAP.status != APStatus_Associated) return; - if (!bWFCUserWarned && SoftAP_IsDNSRequestToWFC(*(u16*)&packet[30], &packet[32])) + if (SoftAP_IsDNSRequestToWFC(*(u16*)&packet[30], &packet[32])) { - // if the user chose not to connect to WFC - // disconnect them, and do not send the DNS packet - // otherwise just stop bothering them - if (driver->WIFI_WFCWarning()) - { - bWFCUserWarned = true; - } - else - { - SoftAP_Deauthenticate(); - return; - } + SoftAP_Deauthenticate(); + return; } u32 epacketLen = ((len - 30 - 4) + 14); @@ -2245,6 +2233,11 @@ static void SoftAP_RXHandler(u_char* user, const struct pcap_pkthdr* h, const u_ if (WIFI_compareMAC(&data[6], wifiMac.mac.bytes)) return; + if (SoftAP.curPacketSending) + { + printf("crap we're gonna nuke a packet at %i/%i (%04X) (%04X)\n", SoftAP.curPacketPos, SoftAP.curPacketSize, *(u16*)&SoftAP.curPacket[12], wifiMac.RXWriteCursor<<1); + } + // The packet was for us. Let's process it then. WIFI_triggerIRQ(WIFI_IRQ_RXSTART); @@ -2296,7 +2289,7 @@ void SoftAP_usTrigger() // other packets will have priority over beacons // 'cause they might be only once of them // whereas there will be sooo much beacons - if(!SoftAP.curPacketSending) + if(!SoftAP.curPacketSending) // && SoftAP.status != APStatus_Associated) { //if(wifiMac.ioMem[0xD0 >> 1] & 0x0400) { diff --git a/desmume/src/windows/main.cpp b/desmume/src/windows/main.cpp index 81ba24429..9d947fde2 100644 --- a/desmume/src/windows/main.cpp +++ b/desmume/src/windows/main.cpp @@ -2241,7 +2241,7 @@ class WinDriver : public BaseDriver return _pcap_setnonblock(dev, nonblock, errbuf); } virtual int PCAP_sendpacket(pcap_t* dev, const u_char* data, int len) { - return _pcap_send(dev, data, len); } + return _pcap_sendpacket(dev, data, len); } virtual int PCAP_dispatch(pcap_t* dev, int num, pcap_handler callback, u_char* userdata) { return _pcap_dispatch(dev, num, callback, userdata); } @@ -2864,7 +2864,6 @@ int _main() MainWindow->Show(SW_NORMAL); - //DEBUG TEST HACK //driver->VIEW3D_Init(); //driver->view3d->Launch(); diff --git a/desmume/src/windows/winpcap.h b/desmume/src/windows/winpcap.h index 6b7297072..cd3b62384 100644 --- a/desmume/src/windows/winpcap.h +++ b/desmume/src/windows/winpcap.h @@ -34,7 +34,7 @@ typedef void (__cdecl *T_pcap_freealldevs)(pcap_if_t* alldevs); typedef pcap_t* (__cdecl *T_pcap_open_live)(const char* source, int snaplen, int flags, int readtimeout, char* errbuf); typedef void (__cdecl *T_pcap_close)(pcap_t* dev); typedef int (__cdecl *T_pcap_setnonblock)(pcap_t* dev, int nonblock, char* errbuf); -typedef int (__cdecl *T_pcap_send)(pcap_t* dev, const u_char* data, int len); +typedef int (__cdecl *T_pcap_sendpacket)(pcap_t* dev, const u_char* data, int len); typedef int (__cdecl *T_pcap_dispatch)(pcap_t* dev, int num, pcap_handler callback, u_char* userdata); T_pcap_findalldevs _pcap_findalldevs = NULL; @@ -42,7 +42,7 @@ T_pcap_freealldevs _pcap_freealldevs = NULL; T_pcap_open_live _pcap_open_live = NULL; T_pcap_close _pcap_close = NULL; T_pcap_setnonblock _pcap_setnonblock = NULL; -T_pcap_send _pcap_send = NULL; +T_pcap_sendpacket _pcap_sendpacket = NULL; T_pcap_dispatch _pcap_dispatch = NULL; @@ -62,7 +62,7 @@ static void LoadWinPCap() LOADSYMBOL(pcap_open_live); LOADSYMBOL(pcap_close); LOADSYMBOL(pcap_setnonblock); - LOADSYMBOL(pcap_send); + LOADSYMBOL(pcap_sendpacket); LOADSYMBOL(pcap_dispatch); bWinPCapAvailable = true;