Lines Matching refs:nic

18 #include "nic.h"
48 static uint16_t pnic_command_quiet ( struct nic *nic, uint16_t command,
58 outw ( input_length, nic->ioaddr + PNIC_REG_LEN );
61 outb( ((char*)input)[i], nic->ioaddr + PNIC_REG_DATA );
65 outw ( command, nic->ioaddr + PNIC_REG_CMD );
67 status = inw ( nic->ioaddr + PNIC_REG_STAT );
69 _output_length = inw ( nic->ioaddr + PNIC_REG_LEN );
89 inb ( nic->ioaddr + PNIC_REG_DATA );
95 static uint16_t pnic_command ( struct nic *nic, uint16_t command,
99 pnic_priv_data_t *priv = (pnic_priv_data_t*)nic->priv_data;
100 uint16_t status = pnic_command_quiet ( nic, command,
128 static int pnic_poll(struct nic *nic, int retrieve)
137 if ( pnic_command ( nic, PNIC_CMD_RECV_QLEN, NULL, 0,
146 if ( pnic_command ( nic, PNIC_CMD_RECV, NULL, 0,
147 nic->packet, ETH_FRAME_LEN, &length )
149 nic->packetlen = length;
157 struct nic *nic,
172 memcpy ( tx_buffer + ETH_ALEN, nic->node_addr, ETH_ALEN );
176 pnic_command ( nic, PNIC_CMD_XMIT, tx_buffer, ETH_HLEN + size,
185 struct nic *nic = (struct nic *)dev;
186 pnic_command ( nic, PNIC_CMD_RESET, NULL, 0, NULL, 0, NULL );
192 static void pnic_irq ( struct nic *nic, irq_action_t action )
200 pnic_command ( nic, PNIC_CMD_MASK_IRQ,
204 pnic_command ( nic, PNIC_CMD_FORCE_IRQ,
216 struct nic *nic = (struct nic *)dev;
224 nic->priv_data = &priv;
227 nic->ioaddr = pci->ioaddr & ~3;
228 nic->irqno = pci->irq;
232 status = pnic_command_quiet( nic, PNIC_CMD_API_VER, NULL, 0,
241 status = pnic_command ( nic, PNIC_CMD_READ_MAC, NULL, 0,
242 nic->node_addr, ETH_ALEN, NULL );
244 nic->node_addr, priv.api_version>>8, priv.api_version&0xff,
245 nic->ioaddr );
249 nic->poll = pnic_poll;
250 nic->transmit = pnic_transmit;
251 nic->irq = pnic_irq;