mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +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
Notes:
sideshowbarker
2024-07-17 08:55:54 +09:00
Author: https://github.com/TomFinet Commit: https://github.com/SerenityOS/serenity/commit/227aa8f2e4 Pull-request: https://github.com/SerenityOS/serenity/pull/22907 Reviewed-by: https://github.com/ADKaster ✅ Reviewed-by: https://github.com/LucasChollet ✅
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…
Reference in a new issue