diff options
author | Michael Brown <mcb30@etherboot.org> | 2007-07-03 00:57:04 +0100 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2007-07-03 00:57:04 +0100 |
commit | a2a0c2eace7d4d25f6ac5cac90a1e02c205f212c (patch) | |
tree | f395e73b3ee34a1dc69c5448a2dcc6890c262ea3 /src | |
parent | 4968caab8288664d4fd21417f312f3c5a05df155 (diff) | |
download | ipxe-a2a0c2eace7d4d25f6ac5cac90a1e02c205f212c.zip ipxe-a2a0c2eace7d4d25f6ac5cac90a1e02c205f212c.tar.gz ipxe-a2a0c2eace7d4d25f6ac5cac90a1e02c205f212c.tar.bz2 |
Enable/disable interrupts on open/close.
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/net/pnic.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/drivers/net/pnic.c b/src/drivers/net/pnic.c index 5d6b90c..63b4195 100644 --- a/src/drivers/net/pnic.c +++ b/src/drivers/net/pnic.c @@ -41,7 +41,7 @@ struct pnic { */ static uint16_t pnic_command_quiet ( struct pnic *pnic, uint16_t command, - void *input, uint16_t input_length, + const void *input, uint16_t input_length, void *output, uint16_t output_max_length, uint16_t *output_length ) { uint16_t status; @@ -82,7 +82,7 @@ static uint16_t pnic_command_quiet ( struct pnic *pnic, uint16_t command, } static uint16_t pnic_command ( struct pnic *pnic, uint16_t command, - void *input, uint16_t input_length, + const void *input, uint16_t input_length, void *output, uint16_t output_max_length, uint16_t *output_length ) { uint16_t status = pnic_command_quiet ( pnic, command, @@ -186,15 +186,27 @@ static void pnic_irq ( struct net_device *netdev, irq_action_t action ) { /************************************************************************** OPEN - Open network device ***************************************************************************/ -static int pnic_open ( struct net_device *netdev __unused ) { +static int pnic_open ( struct net_device *netdev ) { + struct pnic *pnic = netdev->priv; + static const uint8_t enable = 1; + + /* Enable interrupts */ + pnic_command ( pnic, PNIC_CMD_MASK_IRQ, &enable, + sizeof ( enable ), NULL, 0, NULL ); + return 0; } /************************************************************************** CLOSE - Close network device ***************************************************************************/ -static void pnic_close ( struct net_device *netdev __unused ) { - /* Nothing to do */ +static void pnic_close ( struct net_device *netdev ) { + struct pnic *pnic = netdev->priv; + static const uint8_t disable = 0; + + /* Disable interrupts */ + pnic_command ( pnic, PNIC_CMD_MASK_IRQ, &disable, + sizeof ( disable ), NULL, 0, NULL ); } /************************************************************************** |