mirror of https://github.com/ipxe/ipxe.git
Enable/disable interrupts on open/close.
parent
4968caab82
commit
a2a0c2eace
|
@ -41,7 +41,7 @@ struct pnic {
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static uint16_t pnic_command_quiet ( struct pnic *pnic, uint16_t command,
|
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,
|
void *output, uint16_t output_max_length,
|
||||||
uint16_t *output_length ) {
|
uint16_t *output_length ) {
|
||||||
uint16_t status;
|
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,
|
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,
|
void *output, uint16_t output_max_length,
|
||||||
uint16_t *output_length ) {
|
uint16_t *output_length ) {
|
||||||
uint16_t status = pnic_command_quiet ( pnic, command,
|
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
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
CLOSE - Close network device
|
CLOSE - Close network device
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
static void pnic_close ( struct net_device *netdev __unused ) {
|
static void pnic_close ( struct net_device *netdev ) {
|
||||||
/* Nothing to do */
|
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 );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
|
Loading…
Reference in New Issue