23#include "pedigree/kernel/Atomic.h"
24#include "pedigree/kernel/Spinlock.h"
25#include "pedigree/kernel/compiler.h"
26#include "pedigree/kernel/machine/Network.h"
27#include "pedigree/kernel/process/Mutex.h"
28#include "pedigree/kernel/process/OperationBarrier.h"
29#include "pedigree/kernel/process/OwnedThread.h"
30#include "pedigree/kernel/process/Semaphore.h"
31#include "pedigree/kernel/processor/types.h"
32#include "pedigree/kernel/utilities/String.h"
33#include "pedigree/kernel/utilities/new"
35#include "modules/system/usb/UsbDevice.h"
46 str.assign(
"DM9601", 7);
49 virtual bool send(
size_t nBytes, uintptr_t buffer);
56 static int recvTrampoline(
void* p);
58 static int trampoline(
void* p);
84 BackPressThreshold = 8,
93 MulticastAddress = 22,
94 GeneralPurposeCtl = 30,
96 TxWriteAddressLo = 32,
97 TxWriteAddressHi = 33,
100 RxWriteAddressLo = 36,
101 RxWriteAddressHi = 37,
102 RxReadAddressLo = 38,
103 RxReadAddressHi = 39,
116 uint8_t networkStatus;
120 uint8_t rxOverflowCounter;
127 bool readRegister(uint8_t reg, uintptr_t buffer,
size_t nBytes);
130 bool writeRegister(uint8_t reg, uintptr_t buffer,
size_t nBytes);
136 bool readMemory(uint16_t offset, uintptr_t buffer,
size_t nBytes);
139 bool writeMemory(uint16_t offset, uintptr_t buffer,
size_t nBytes);
145 bool readEeprom(uint8_t offset, uint16_t& value);
151 bool readMii(uint8_t offset, uint16_t& value);
154 bool writeMii(uint8_t offset, uint16_t data);
156 bool readSharedWord(
bool phy, uint8_t offset, uint16_t& value);
157 bool writeSharedWord(
bool phy, uint8_t offset, uint16_t value);
158 bool waitForSharedOperation();
161 bool waitForTxReady();
199 void operator=(
const Dm9601&);
bool writeMemory(uint16_t offset, uintptr_t buffer, size_t nBytes)
Writes data from a buffer into device memory.
bool writeRegister(uint8_t reg, uintptr_t buffer, size_t nBytes)
Writes data from a buffer to a register.
bool writeMii(uint8_t offset, uint16_t data)
Writes a 16-bit value to the external MII.
Mutex m_SharedRegisterLock
Endpoint * m_pOutEndpoint
virtual void initialiseDriver()
Implemented by the driver class, initialises driver-specific stuff.
virtual bool send(size_t nBytes, uintptr_t buffer)
bool writeEeprom(uint8_t offset, uint16_t data)
Writes a 16-bit value to the device EEPROM.
bool readRegister(uint8_t reg, uintptr_t buffer, size_t nBytes)
Reads data from a register into a buffer.
bool readMemory(uint16_t offset, uintptr_t buffer, size_t nBytes)
Reads data from device memory into a buffer.
bool readMii(uint8_t offset, uint16_t &value)
Reads a 16-bit value from the external MII.
Semaphore m_IncomingPackets
virtual bool setStationInfo(const StationInfo &info)
virtual const StationInfo & getStationInfo()
virtual void getName(String &str)
bool readEeprom(uint8_t offset, uint16_t &value)
Reads a 16-bit value from the device EEPROM.