aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorStapleButter <thetotalworm@gmail.com>2017-06-22 16:38:35 +0200
committerStapleButter <thetotalworm@gmail.com>2017-06-22 16:38:35 +0200
commit6ba178d7cf8f1dd6726a666117453d01bf2138ad (patch)
tree2f961094476811efc1acd0ed4e9bc53ea454b735 /src
parent456fe238503d0416b2d52ee335a4f82a1c3a6fd9 (diff)
wifi: little fix related to replies (when the address isn't set, don't try to adjust the TX header)
Diffstat (limited to 'src')
-rw-r--r--src/Wifi.cpp19
1 files changed, 14 insertions, 5 deletions
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;