mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 06:14:58 +00:00
Kernel/Net: E1000ENetworkAdapter detect EEPROM
The presence of EEPROM is detected by reading the EE_PRES bit from the EECD register.
This commit is contained in:
parent
7945c9d808
commit
227aa8f2e4
1 changed files with 7 additions and 2 deletions
|
@ -13,8 +13,13 @@
|
|||
|
||||
namespace Kernel {
|
||||
|
||||
#define REG_EECD 0x0010
|
||||
#define REG_EEPROM 0x0014
|
||||
|
||||
// EECD Register
|
||||
|
||||
#define EECD_PRES 0x100
|
||||
|
||||
static bool is_valid_device_id(u16 device_id)
|
||||
{
|
||||
// Note: All ids listed here are valid, but only the ones that are verified working are set to 'true'
|
||||
|
@ -246,8 +251,8 @@ UNMAP_AFTER_INIT E1000ENetworkAdapter::~E1000ENetworkAdapter() = default;
|
|||
|
||||
UNMAP_AFTER_INIT void E1000ENetworkAdapter::detect_eeprom()
|
||||
{
|
||||
// FIXME: Try to find a way to detect if EEPROM exists instead of assuming it is
|
||||
m_has_eeprom = true;
|
||||
// Section 13.4.3 of https://www.intel.com/content/dam/doc/manual/pci-pci-x-family-gbe-controllers-software-dev-manual.pdf
|
||||
m_has_eeprom = in32(REG_EECD) & EECD_PRES;
|
||||
}
|
||||
|
||||
UNMAP_AFTER_INIT u32 E1000ENetworkAdapter::read_eeprom(u8 address)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue