mirror of
https://github.com/ipxe/ipxe
synced 2025-12-27 18:12:36 +03:00
Make open() and close() an official part of the netdevice API.
Call netdevice's poll() and transmit() methods only when device is open.
This commit is contained in:
@@ -542,8 +542,8 @@ static int rtl_probe ( struct pci_device *pci,
|
||||
nvs_read ( &rtl->eeprom.nvs, EE_MAC, netdev->ll_addr, ETH_ALEN );
|
||||
|
||||
/* Point to NIC specific routines */
|
||||
// netdev->open = rtl_open;
|
||||
// netdev->close = rtl_close;
|
||||
netdev->open = rtl_open;
|
||||
netdev->close = rtl_close;
|
||||
netdev->transmit = rtl_transmit;
|
||||
netdev->poll = rtl_poll;
|
||||
|
||||
@@ -558,10 +558,6 @@ static int rtl_probe ( struct pci_device *pci,
|
||||
goto err;
|
||||
}
|
||||
|
||||
#warning "Hack alert"
|
||||
rtl_open ( netdev );
|
||||
|
||||
|
||||
return 0;
|
||||
|
||||
err:
|
||||
@@ -584,10 +580,6 @@ static void rtl_remove ( struct pci_device *pci ) {
|
||||
struct net_device *netdev = pci_get_drvdata ( pci );
|
||||
struct rtl8139_nic *rtl = netdev->priv;
|
||||
|
||||
|
||||
#warning "Hack alert"
|
||||
rtl_close ( netdev );
|
||||
|
||||
if ( rtl->nvo.nvs )
|
||||
nvo_unregister ( &rtl->nvo );
|
||||
unregister_netdev ( netdev );
|
||||
|
||||
Reference in New Issue
Block a user