diff options
author | Marvin Borner | 2020-11-21 13:13:00 +0100 |
---|---|---|
committer | Marvin Borner | 2020-11-21 13:13:00 +0100 |
commit | 5c0ab661d3af07186c1fb1c8a8b22d3a894b1be1 (patch) | |
tree | 2cc01ae6c1ba47b77bb49a7d403fbb0c8dd9b957 /kernel/drivers | |
parent | ad5f905cd32af320fcf6e1bb2db0f18959e924e5 (diff) |
Added net_installed check
Diffstat (limited to 'kernel/drivers')
-rw-r--r-- | kernel/drivers/rtl8139.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/kernel/drivers/rtl8139.c b/kernel/drivers/rtl8139.c index fb60865..9317d7b 100644 --- a/kernel/drivers/rtl8139.c +++ b/kernel/drivers/rtl8139.c @@ -19,7 +19,7 @@ static u32 rtl_device_pci = 0; static u32 rtl_iobase = 0; static u32 cur_rx = 0; -u8 *rtl8139_get_mac() +u8 *rtl8139_get_mac(void) { if (!rtl_device_pci) return NULL; @@ -27,7 +27,7 @@ u8 *rtl8139_get_mac() return mac; } -void rtl8139_receive_packet() +void rtl8139_receive_packet(void) { while ((inb(rtl_iobase + RTL_PORT_CMD) & 0x01) == 0) { int offset = cur_rx % 0x2000; @@ -93,7 +93,7 @@ void rtl8139_irq_handler() rtl8139_receive_packet(); } -void rtl8139_init() +void rtl8139_init(void) { if (!rtl_device_pci) return; @@ -160,7 +160,12 @@ void rtl8139_init() outl(rtl_iobase + RTL_PORT_RXMISS, 0); } -int rtl8139_install() +int rtl8139_installed(void) +{ + return rtl_device_pci != 0; +} + +int rtl8139_install(void) { pci_scan(&rtl8139_find, -1, &rtl_device_pci); |