aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArisotura <thetotalworm@gmail.com>2023-07-25 20:50:07 +0200
committerArisotura <thetotalworm@gmail.com>2023-07-25 20:50:07 +0200
commita87dc83279ddacc6c7b2d6b68c3782a42501e2fd (patch)
tree165570a9b64750df555f326b3917ee5ccf3c28b6
parentc7afa8d3f65f8d4e8cd44ec029fe1a1c06985536 (diff)
wifi: mystery ack value is CMD_COUNT
-rw-r--r--src/Wifi.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Wifi.cpp b/src/Wifi.cpp
index c57388a..bf8d2dc 100644
--- a/src/Wifi.cpp
+++ b/src/Wifi.cpp
@@ -740,7 +740,7 @@ void SendMPReply(u16 clienttime, u16 clientmask)
IOPORT(W_TXBusy) |= 0x0080;
}
-void SendMPAck(u16 clientfail)
+void SendMPAck(u16 cmdcount, u16 clientfail)
{
u8 ack[12 + 32];
@@ -762,7 +762,7 @@ void SendMPAck(u16 clientfail)
*(u16*)&ack[0xC + 0x12] = IOPORT(W_MACAddr1);
*(u16*)&ack[0xC + 0x14] = IOPORT(W_MACAddr2);
*(u16*)&ack[0xC + 0x16] = IOPORT(W_TXSeqNo) << 4;
- *(u16*)&ack[0xC + 0x18] = 0x0033; // ???
+ *(u16*)&ack[0xC + 0x18] = cmdcount;
*(u16*)&ack[0xC + 0x1A] = clientfail;
*(u32*)&ack[0xC + 0x1C] = 0;
@@ -1044,7 +1044,8 @@ bool ProcessTX(TXSlot* slot, int num)
ReportMPReplyErrors(MPClientFail);
// send
- SendMPAck(MPClientFail);
+ u16 cmdcount = (CmdCounter + 9) / 10;
+ SendMPAck(cmdcount-3, MPClientFail);
slot->CurPhase = 3;
}