From 6ba178d7cf8f1dd6726a666117453d01bf2138ad Mon Sep 17 00:00:00 2001 From: StapleButter Date: Thu, 22 Jun 2017 16:38:35 +0200 Subject: wifi: little fix related to replies (when the address isn't set, don't try to adjust the TX header) --- src/Wifi.cpp | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/Wifi.cpp b/src/Wifi.cpp index 614a57f..94c4cb9 100644 --- a/src/Wifi.cpp +++ b/src/Wifi.cpp @@ -400,9 +400,12 @@ void SendMPReply(u16 clienttime, u16 clientmask) IOPORT(W_TXSlotReply1) = 0; // this seems to be set upon IRQ0 - // TODO: how does it behave if the packet addr is changed before it gets sent? - slot->Addr = (IOPORT(W_TXSlotReply2) & 0x0FFF) << 1; - *(u16*)&RAM[slot->Addr + 0x4] = 0x0001; + // TODO: how does it behave if the packet addr is changed before it gets sent? (maybe just not possible) + if (IOPORT(W_TXSlotReply2) & 0x8000) + { + slot->Addr = (IOPORT(W_TXSlotReply2) & 0x0FFF) << 1; + *(u16*)&RAM[slot->Addr + 0x4] = 0x0001; + } u16 clientnum = 0; for (int i = 1; i < IOPORT(W_AIDLow); i++) @@ -585,8 +588,14 @@ bool ProcessTX(TXSlot* slot, int num) *(u64*)&RAM[slot->Addr + 0xC + 24] = USCounter; } - *(u16*)&RAM[slot->Addr + 0xC + 22] = IOPORT(W_TXSeqNo) << 4; - IOPORT(W_TXSeqNo) = (IOPORT(W_TXSeqNo) + 1) & 0x0FFF; + //u32 noseqno = 0; + //if (num == 1) noseqno = (IOPORT(W_TXSlotCmd) & 0x4000); + + //if (!noseqno) + { + *(u16*)&RAM[slot->Addr + 0xC + 22] = IOPORT(W_TXSeqNo) << 4; + IOPORT(W_TXSeqNo) = (IOPORT(W_TXSeqNo) + 1) & 0x0FFF; + } // set TX addr IOPORT(W_RXTXAddr) = slot->Addr >> 1; -- cgit v1.2.3