Lines Matching defs:nic
46 #include "nic.h"
310 static int mdio_read(struct nic *nic, int phy_id, unsigned int location);
311 static void mdio_write(struct nic *nic, int phy_id, unsigned int location,
313 static void set_rx_mode(struct nic *nic);
315 static void check_duplex(struct nic *nic)
317 int mii_lpa = mdio_read(nic, sdc->phys[0], MII_LPA);
346 static void init_ring(struct nic *nic __unused)
388 static void sundance_reset(struct nic *nic)
392 init_ring(nic);
402 addr16 = (nic->node_addr[0] | (nic->node_addr[1] << 8));
404 addr16 = (nic->node_addr[2] | (nic->node_addr[3] << 8));
406 addr16 = (nic->node_addr[4] | (nic->node_addr[5] << 8));
414 set_rx_mode(nic);
431 txb[0] = nic->node_addr[0];
432 txb[1] = nic->node_addr[1];
433 txb[2] = nic->node_addr[2];
434 txb[3] = nic->node_addr[3];
435 txb[4] = nic->node_addr[4];
436 txb[5] = nic->node_addr[5];
448 void sundance_irq ( struct nic *nic, irq_action_t action ) {
454 intr_status = inw(nic->ioaddr + IntrStatus);
458 outw(intr_status, nic->ioaddr + IntrEnable);
468 static int sundance_poll(struct nic *nic, int retreive)
471 /* nic->packet should contain data on return */
472 /* nic->packetlen should contain length of data */
485 intr_status = inw(nic->ioaddr + IntrStatus);
486 outw(intr_status, nic->ioaddr + IntrStatus);
497 nic->packetlen = pkt_len;
498 memcpy(nic->packet, rxb +
499 (sdc->cur_rx * PKT_BUF_SZ), nic->packetlen);
508 nic->ioaddr + IntrStatus);
515 static void sundance_transmit(struct nic *nic, const char *d, /* Destination */
527 memcpy(txb + ETH_ALEN, nic->node_addr, ETH_ALEN);
587 struct nic *nic = (struct nic *) dev;
606 /* Update the nic structure with the MAC Address */
608 nic->node_addr[i] = ee_data[i];
627 printf("%s: %! at ioaddr %hX, ", pci->name, nic->node_addr, BASE);
634 int mii_status = mdio_read(nic, phy, MII_BMSR);
638 mdio_read(nic, phy, MII_ADVERTISE);
698 mdio_write(nic, sdc->phys[0], MII_BMCR, mii_ctl);
709 sundance_reset(nic);
713 mdio_read(nic, sdc->phys[0], MII_ADVERTISE);
714 mii_lpa = mdio_read(nic, sdc->phys[0], MII_LPA);
725 mii_ctl = mdio_read(nic, sdc->phys[0], MII_BMCR);
732 check_duplex(nic);
743 nic->poll = sundance_poll;
744 nic->transmit = sundance_transmit;
745 nic->irqno = pci->irq;
746 nic->irq = sundance_irq;
747 nic->ioaddr = BASE;
805 mdio_read(struct nic *nic __unused, int phy_id, unsigned int location)
837 mdio_write(struct nic *nic __unused, int phy_id,
867 static void set_rx_mode(struct nic *nic __unused)