summaryrefslogtreecommitdiffstats
path: root/src/drivers/net/pnic.c
diff options
context:
space:
mode:
authorMichael Brown2007-07-03 01:57:04 +0200
committerMichael Brown2007-07-03 01:57:04 +0200
commita2a0c2eace7d4d25f6ac5cac90a1e02c205f212c (patch)
treef395e73b3ee34a1dc69c5448a2dcc6890c262ea3 /src/drivers/net/pnic.c
parentAdd trivial net device statistics (TX and RX packet count), reported (diff)
downloadipxe-a2a0c2eace7d4d25f6ac5cac90a1e02c205f212c.tar.gz
ipxe-a2a0c2eace7d4d25f6ac5cac90a1e02c205f212c.tar.xz
ipxe-a2a0c2eace7d4d25f6ac5cac90a1e02c205f212c.zip
Enable/disable interrupts on open/close.
Diffstat (limited to 'src/drivers/net/pnic.c')
-rw-r--r--src/drivers/net/pnic.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/src/drivers/net/pnic.c b/src/drivers/net/pnic.c
index 5d6b90c7..63b4195f 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 );
}
/**************************************************************************