Lines Matching defs:nic

47 #include "nic.h"
107 * NVREG_POLL_DEFAULT is the interval length of the timer source on the nic
392 static int mii_rw(struct nic *nic __unused, int addr, int miireg,
451 static void start_rx(struct nic *nic __unused)
481 static void start_tx(struct nic *nic __unused)
505 static void txrx_reset(struct nic *nic __unused)
523 static int alloc_rx(struct nic *nic __unused)
545 static int update_linkspeed(struct nic *nic)
549 adv = mii_rw(nic, np->phyaddr, MII_ADVERTISE, MII_READ);
550 lpa = mii_rw(nic, np->phyaddr, MII_LPA, MII_READ);
583 static int init_ring(struct nic *nic)
597 return alloc_rx(nic);
600 static void set_multicast(struct nic *nic)
630 start_rx(nic);
636 static int forcedeth_reset(struct nic *nic)
653 txrx_reset(nic);
658 oom = init_ring(nic);
665 (nic->node_addr[0] << 0) + (nic->node_addr[1] << 8) +
666 (nic->node_addr[2] << 16) + (nic->node_addr[3] << 24);
668 (nic->node_addr[4] << 0) + (nic->node_addr[5] << 8);
693 id1 = mii_rw(nic, i, MII_PHYSID1, MII_READ);
696 id2 = mii_rw(nic, i, MII_PHYSID2, MII_READ);
703 update_linkspeed(nic);
780 set_multicast(nic);
781 //start_rx(nic);
782 start_tx(nic);
785 (mii_rw(nic, np->phyaddr, MII_BMSR, MII_READ) &
800 static int forcedeth_poll(struct nic *nic, int retrieve)
803 /* nic->packet should contain data on return */
804 /* nic->packetlen should contain length of data */
821 nic->packetlen = len;
823 memcpy(nic->packet, rxb +
824 (i * RX_NIC_BUFSIZE), nic->packetlen);
828 alloc_rx(nic);
836 static void forcedeth_transmit(struct nic *nic, const char *d, /* Destination */
854 memcpy(ptxb + ETH_ALEN, nic->node_addr, ETH_ALEN); /* src */
895 /* disable interrupts on the nic or we will lock up */
910 static void forcedeth_irq(struct nic *nic __unused, irq_action_t action __unused)
930 struct nic *nic = (struct nic *) dev;
941 nic->irqno = 0;
942 nic->ioaddr = pci->ioaddr & ~3;
964 nic->node_addr[0] = (np->orig_mac[1] >> 8) & 0xff;
965 nic->node_addr[1] = (np->orig_mac[1] >> 0) & 0xff;
966 nic->node_addr[2] = (np->orig_mac[0] >> 24) & 0xff;
967 nic->node_addr[3] = (np->orig_mac[0] >> 16) & 0xff;
968 nic->node_addr[4] = (np->orig_mac[0] >> 8) & 0xff;
969 nic->node_addr[5] = (np->orig_mac[0] >> 0) & 0xff;
990 printf("%s: MAC Address %!, ", pci->name, nic->node_addr);
1014 forcedeth_reset(nic);
1018 nic->poll = forcedeth_poll;
1019 nic->transmit = forcedeth_transmit;
1020 nic->irq = forcedeth_irq;