wifi improvements:

* implement channels
* rework power-down support, fixing bugs
* fix bug when W_BeaconInterval is zero
* fix potential missing IRQs when writing to W_IE
This commit is contained in:
Arisotura
2024-04-12 17:28:51 +02:00
parent 0b87dd5fa6
commit 111dc7a563
6 changed files with 344 additions and 134 deletions

View File

@ -52,11 +52,12 @@ public:
W_RXCnt = 0x030,
W_WEPCnt = 0x032,
W_TRXPower = 0x034,
W_PowerUS = 0x036,
W_PowerTX = 0x038,
W_PowerState = 0x03C,
W_PowerForce = 0x040,
W_PowerUnk = 0x48,
W_PowerDownCtrl = 0x48,
W_Random = 0x044,
@ -206,6 +207,10 @@ private:
u8 RFVersion;
u32 RFRegs[0x40];
u32 RFChannelIndex[2];
u32 RFChannelData[14][2];
int CurChannel;
struct TXSlot
{
bool Valid;
@ -240,7 +245,6 @@ private:
bool LANInited;
int USUntilPowerOn;
bool ForcePowerOn;
// MULTIPLAYER SYNC APPARATUS
bool IsMP;
@ -253,13 +257,15 @@ private:
void ScheduleTimer(bool first);
void UpdatePowerOn();
void CheckIRQ(u16 oldflags);
void SetIRQ(u32 irq);
void SetIRQ13();
void SetIRQ14(int source);
void SetIRQ15();
void SetStatus(u32 status);
void PowerDown();
void UpdatePowerStatus(int power);
int PreambleLen(int rate) const;
u32 NumClients(u16 bitmask) const;
@ -284,6 +290,8 @@ private:
void MSTimer();
void ChangeChannel();
void RFTransfer_Type2();
void RFTransfer_Type3();
};