diff options
author | Michael Brown | 2007-01-04 05:20:08 +0100 |
---|---|---|
committer | Michael Brown | 2007-01-04 05:20:08 +0100 |
commit | 0c03bb5a9a0649ec7009e334c0e42290af330437 (patch) | |
tree | d523c7ba2ae84b0998b7e8121d70a603d6fd087a /src/drivers/net/pnic.c | |
parent | We *should* use the persistent reference API for our netdev reference, (diff) | |
download | ipxe-0c03bb5a9a0649ec7009e334c0e42290af330437.tar.gz ipxe-0c03bb5a9a0649ec7009e334c0e42290af330437.tar.xz ipxe-0c03bb5a9a0649ec7009e334c0e42290af330437.zip |
Make open() and close() an official part of the netdevice API.
Call netdevice's poll() and transmit() methods only when device is open.
Diffstat (limited to 'src/drivers/net/pnic.c')
-rw-r--r-- | src/drivers/net/pnic.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/src/drivers/net/pnic.c b/src/drivers/net/pnic.c index ad98c609..d8f2544e 100644 --- a/src/drivers/net/pnic.c +++ b/src/drivers/net/pnic.c @@ -186,6 +186,20 @@ static void pnic_irq ( struct net_device *netdev, irq_action_t action ) { #endif /************************************************************************** +OPEN - Open network device +***************************************************************************/ +static int pnic_open ( struct net_device *netdev __unused ) { + return 0; +} + +/************************************************************************** +CLOSE - Close network device +***************************************************************************/ +static void pnic_close ( struct net_device *netdev __unused ) { + /* Nothing to do */ +} + +/************************************************************************** DISABLE - Turn off ethernet interface ***************************************************************************/ static void pnic_remove ( struct pci_device *pci ) { @@ -238,6 +252,8 @@ static int pnic_probe ( struct pci_device *pci, netdev->ll_addr, ETH_ALEN, NULL ); /* Point to NIC specific routines */ + netdev->open = pnic_open; + netdev->close = pnic_close; netdev->poll = pnic_poll; netdev->transmit = pnic_transmit; |