Lines Matching refs:lp
415 static inline int wait_istat(struct net_device *dev, struct i596_private *lp, int delcnt, char *str) in wait_istat() argument
417 while (--delcnt && lp->iscp.stat) in wait_istat()
421 dev->name, str, lp->scb.status, lp->scb.command); in wait_istat()
429 static inline int wait_cmd(struct net_device *dev, struct i596_private *lp, int delcnt, char *str) in wait_cmd() argument
431 while (--delcnt && lp->scb.command) in wait_cmd()
435 dev->name, str, lp->scb.status, lp->scb.command); in wait_cmd()
460 struct i596_private *lp = dev->ml_priv; in i596_display_data() local
466 &lp->scp, lp->scp.sysbus, lp->scp.iscp); in i596_display_data()
468 &lp->iscp, lp->iscp.stat, lp->iscp.scb); in i596_display_data()
471 &lp->scb, lp->scb.status, lp->scb.command, in i596_display_data()
472 lp->scb.cmd, lp->scb.rfd); in i596_display_data()
475 lp->scb.crc_err, lp->scb.align_err, lp->scb.resource_err, in i596_display_data()
476 lp->scb.over_err, lp->scb.rcvdt_err, lp->scb.short_err); in i596_display_data()
477 cmd = lp->cmd_head; in i596_display_data()
483 rfd = lp->rfd_head; in i596_display_data()
491 } while (rfd != lp->rfd_head); in i596_display_data()
492 rbd = lp->rbd_head; in i596_display_data()
498 } while (rbd != lp->rbd_head); in i596_display_data()
530 struct i596_private *lp = dev->ml_priv; in init_rx_bufs() local
537 for (i = 0, rbd = lp->rbds; i < rx_ring_size; i++, rbd++) { in init_rx_bufs()
554 lp->rbd_head = lp->rbds; in init_rx_bufs()
555 rbd = lp->rbds + rx_ring_size - 1; in init_rx_bufs()
556 rbd->v_next = lp->rbds; in init_rx_bufs()
557 rbd->b_next = WSWAPrbd(virt_to_bus(lp->rbds)); in init_rx_bufs()
561 for (i = 0, rfd = lp->rfds; i < rx_ring_size; i++, rfd++) { in init_rx_bufs()
568 lp->rfd_head = lp->rfds; in init_rx_bufs()
569 lp->scb.rfd = WSWAPrfd(virt_to_bus(lp->rfds)); in init_rx_bufs()
570 rfd = lp->rfds; in init_rx_bufs()
571 rfd->rbd = lp->rbd_head; in init_rx_bufs()
572 rfd->v_prev = lp->rfds + rx_ring_size - 1; in init_rx_bufs()
573 rfd = lp->rfds + rx_ring_size - 1; in init_rx_bufs()
574 rfd->v_next = lp->rfds; in init_rx_bufs()
575 rfd->b_next = WSWAPrfd(virt_to_bus(lp->rfds)); in init_rx_bufs()
581 struct i596_private *lp = dev->ml_priv; in remove_rx_bufs() local
585 for (i = 0, rbd = lp->rbds; i < rx_ring_size; i++, rbd++) { in remove_rx_bufs()
595 struct i596_private *lp = dev->ml_priv; in rebuild_rx_bufs() local
601 lp->rfds[i].rbd = I596_NULL; in rebuild_rx_bufs()
602 lp->rfds[i].cmd = CMD_FLEX; in rebuild_rx_bufs()
604 lp->rfds[rx_ring_size-1].cmd = CMD_EOL|CMD_FLEX; in rebuild_rx_bufs()
605 lp->rfd_head = lp->rfds; in rebuild_rx_bufs()
606 lp->scb.rfd = WSWAPrfd(virt_to_bus(lp->rfds)); in rebuild_rx_bufs()
607 lp->rbd_head = lp->rbds; in rebuild_rx_bufs()
608 lp->rfds[0].rbd = WSWAPrbd(virt_to_bus(lp->rbds)); in rebuild_rx_bufs()
614 struct i596_private *lp = dev->ml_priv; in init_i596_mem() local
649 MPU_PORT(dev, PORT_ALTSCP, (void *)virt_to_bus((void *)&lp->scp)); in init_i596_mem()
654 u32 scp = virt_to_bus(&lp->scp); in init_i596_mem()
665 lp->last_cmd = jiffies; in init_i596_mem()
669 lp->scp.sysbus = 0x00000054; in init_i596_mem()
673 lp->scp.sysbus = 0x0000004c; in init_i596_mem()
677 lp->scp.sysbus = 0x00440000; in init_i596_mem()
680 lp->scp.iscp = WSWAPiscp(virt_to_bus((void *)&lp->iscp)); in init_i596_mem()
681 lp->iscp.scb = WSWAPscb(virt_to_bus((void *)&lp->scb)); in init_i596_mem()
682 lp->iscp.stat = ISCP_BUSY; in init_i596_mem()
683 lp->cmd_backlog = 0; in init_i596_mem()
685 lp->cmd_head = lp->scb.cmd = I596_NULL; in init_i596_mem()
689 lp->scb.t_on = 7 * 25; in init_i596_mem()
690 lp->scb.t_off = 1 * 25; in init_i596_mem()
702 if (wait_istat(dev,lp,1000,"initialization timed out")) in init_i596_mem()
708 lp->scb.command = 0; in init_i596_mem()
729 memcpy(lp->cf_cmd.i596_config, init_setup, 14); in init_i596_mem()
730 lp->cf_cmd.cmd.command = CmdConfigure; in init_i596_mem()
731 i596_add_cmd(dev, &lp->cf_cmd.cmd); in init_i596_mem()
734 memcpy(lp->sa_cmd.eth_addr, dev->dev_addr, 6); in init_i596_mem()
735 lp->sa_cmd.cmd.command = CmdSASetup; in init_i596_mem()
736 i596_add_cmd(dev, &lp->sa_cmd.cmd); in init_i596_mem()
739 lp->tdr_cmd.cmd.command = CmdTDR; in init_i596_mem()
740 i596_add_cmd(dev, &lp->tdr_cmd.cmd); in init_i596_mem()
742 spin_lock_irqsave (&lp->lock, flags); in init_i596_mem()
744 if (wait_cmd(dev,lp,1000,"timed out waiting to issue RX_START")) { in init_i596_mem()
745 spin_unlock_irqrestore (&lp->lock, flags); in init_i596_mem()
749 lp->scb.command = RX_START; in init_i596_mem()
752 spin_unlock_irqrestore (&lp->lock, flags); in init_i596_mem()
754 if (wait_cmd(dev,lp,1000,"RX_START not processed")) in init_i596_mem()
767 struct i596_private *lp = dev->ml_priv; in i596_rx() local
773 lp->rfd_head, lp->rbd_head)); in i596_rx()
775 rfd = lp->rfd_head; /* Ref next frame to check */ in i596_rx()
780 else if (rfd->rbd == lp->rbd_head->b_addr) in i596_rx()
781 rbd = lp->rbd_head; in i596_rx()
872 lp->rbd_head = rbd->v_next; in i596_rx()
888 lp->scb.rfd = rfd->b_next; in i596_rx()
889 lp->rfd_head = rfd->v_next; in i596_rx()
890 rfd = lp->rfd_head; in i596_rx()
899 static void i596_cleanup_cmd(struct net_device *dev, struct i596_private *lp) in i596_cleanup_cmd() argument
903 while (lp->cmd_head != I596_NULL) { in i596_cleanup_cmd()
904 ptr = lp->cmd_head; in i596_cleanup_cmd()
905 lp->cmd_head = ptr->v_next; in i596_cleanup_cmd()
906 lp->cmd_backlog--; in i596_cleanup_cmd()
928 wait_cmd(dev,lp,100,"i596_cleanup_cmd timed out"); in i596_cleanup_cmd()
929 lp->scb.cmd = I596_NULL; in i596_cleanup_cmd()
932 static void i596_reset(struct net_device *dev, struct i596_private *lp, in i596_reset() argument
939 spin_lock_irqsave (&lp->lock, flags); in i596_reset()
941 wait_cmd(dev,lp,100,"i596_reset timed out"); in i596_reset()
945 lp->scb.command = CUC_ABORT | RX_ABORT; in i596_reset()
949 wait_cmd(dev,lp,1000,"i596_reset 2 timed out"); in i596_reset()
950 spin_unlock_irqrestore (&lp->lock, flags); in i596_reset()
952 i596_cleanup_cmd(dev,lp); in i596_reset()
961 struct i596_private *lp = dev->ml_priv; in i596_add_cmd() local
971 spin_lock_irqsave (&lp->lock, flags); in i596_add_cmd()
973 if (lp->cmd_head != I596_NULL) { in i596_add_cmd()
974 lp->cmd_tail->v_next = cmd; in i596_add_cmd()
975 lp->cmd_tail->b_next = WSWAPcmd(virt_to_bus(&cmd->status)); in i596_add_cmd()
977 lp->cmd_head = cmd; in i596_add_cmd()
978 wait_cmd(dev,lp,100,"i596_add_cmd timed out"); in i596_add_cmd()
979 lp->scb.cmd = WSWAPcmd(virt_to_bus(&cmd->status)); in i596_add_cmd()
980 lp->scb.command = CUC_START; in i596_add_cmd()
983 lp->cmd_tail = cmd; in i596_add_cmd()
984 lp->cmd_backlog++; in i596_add_cmd()
986 spin_unlock_irqrestore (&lp->lock, flags); in i596_add_cmd()
988 if (lp->cmd_backlog > max_cmd_backlog) { in i596_add_cmd()
989 unsigned long tickssofar = jiffies - lp->last_cmd; in i596_add_cmd()
996 i596_reset(dev, lp, ioaddr); in i596_add_cmd()
1031 struct i596_private *lp = dev->ml_priv; in i596_tx_timeout() local
1041 if (lp->last_restart == dev->stats.tx_packets) { in i596_tx_timeout()
1044 i596_reset (dev, lp, ioaddr); in i596_tx_timeout()
1048 lp->scb.command = CUC_START | RX_START; in i596_tx_timeout()
1050 lp->last_restart = dev->stats.tx_packets; in i596_tx_timeout()
1060 struct i596_private *lp = dev->ml_priv; in i596_start_xmit() local
1076 tx_cmd = lp->tx_cmds + lp->next_tx_cmd; in i596_start_xmit()
1077 tbd = lp->tbds + lp->next_tx_cmd; in i596_start_xmit()
1086 if (++lp->next_tx_cmd == TX_RING_SIZE) in i596_start_xmit()
1087 lp->next_tx_cmd = 0; in i596_start_xmit()
1129 struct i596_private *lp; in i82596_probe() local
1244 lp = dev->ml_priv; in i82596_probe()
1247 dev->name, (unsigned long)lp, in i82596_probe()
1248 sizeof(struct i596_private), (unsigned long)&lp->scb)); in i82596_probe()
1249 memset((void *) lp, 0, sizeof(struct i596_private)); in i82596_probe()
1256 lp->scb.command = 0; in i82596_probe()
1257 lp->scb.cmd = I596_NULL; in i82596_probe()
1258 lp->scb.rfd = I596_NULL; in i82596_probe()
1259 spin_lock_init(&lp->lock); in i82596_probe()
1286 struct i596_private *lp; in i596_interrupt() local
1305 lp = dev->ml_priv; in i596_interrupt()
1307 spin_lock (&lp->lock); in i596_interrupt()
1309 wait_cmd(dev,lp,100,"i596 interrupt, timeout"); in i596_interrupt()
1310 status = lp->scb.status; in i596_interrupt()
1326 while ((lp->cmd_head != I596_NULL) && (lp->cmd_head->status & STAT_C)) { in i596_interrupt()
1327 ptr = lp->cmd_head; in i596_interrupt()
1330 lp->cmd_head->status, lp->cmd_head->command)); in i596_interrupt()
1331 lp->cmd_head = ptr->v_next; in i596_interrupt()
1332 lp->cmd_backlog--; in i596_interrupt()
1386 lp->last_cmd = jiffies; in i596_interrupt()
1389 ptr = lp->cmd_head; in i596_interrupt()
1390 while ((ptr != I596_NULL) && (ptr != lp->cmd_tail)) { in i596_interrupt()
1395 if ((lp->cmd_head != I596_NULL)) in i596_interrupt()
1397 lp->scb.cmd = WSWAPcmd(virt_to_bus(&lp->cmd_head->status)); in i596_interrupt()
1414 wait_cmd(dev,lp,100,"i596 interrupt, timeout"); in i596_interrupt()
1415 lp->scb.command = ack_cmd; in i596_interrupt()
1442 spin_unlock (&lp->lock); in i596_interrupt()
1448 struct i596_private *lp = dev->ml_priv; in i596_close() local
1454 dev->name, lp->scb.status)); in i596_close()
1456 spin_lock_irqsave(&lp->lock, flags); in i596_close()
1458 wait_cmd(dev,lp,100,"close1 timed out"); in i596_close()
1459 lp->scb.command = CUC_ABORT | RX_ABORT; in i596_close()
1462 wait_cmd(dev,lp,100,"close2 timed out"); in i596_close()
1464 spin_unlock_irqrestore(&lp->lock, flags); in i596_close()
1466 i596_cleanup_cmd(dev,lp); in i596_close()
1498 struct i596_private *lp = dev->ml_priv; in set_multicast_list() local
1506 if (wait_cfg(dev, &lp->cf_cmd.cmd, 1000, "config change request timed out")) in set_multicast_list()
1509 if ((dev->flags & IFF_PROMISC) && !(lp->cf_cmd.i596_config[8] & 0x01)) { in set_multicast_list()
1510 lp->cf_cmd.i596_config[8] |= 0x01; in set_multicast_list()
1513 if (!(dev->flags & IFF_PROMISC) && (lp->cf_cmd.i596_config[8] & 0x01)) { in set_multicast_list()
1514 lp->cf_cmd.i596_config[8] &= ~0x01; in set_multicast_list()
1517 if ((dev->flags & IFF_ALLMULTI) && (lp->cf_cmd.i596_config[11] & 0x20)) { in set_multicast_list()
1518 lp->cf_cmd.i596_config[11] &= ~0x20; in set_multicast_list()
1521 if (!(dev->flags & IFF_ALLMULTI) && !(lp->cf_cmd.i596_config[11] & 0x20)) { in set_multicast_list()
1522 lp->cf_cmd.i596_config[11] |= 0x20; in set_multicast_list()
1526 lp->cf_cmd.cmd.command = CmdConfigure; in set_multicast_list()
1527 i596_add_cmd(dev, &lp->cf_cmd.cmd); in set_multicast_list()
1543 if (wait_cfg(dev, &lp->mc_cmd.cmd, 1000, "multicast list change request timed out")) in set_multicast_list()
1545 cmd = &lp->mc_cmd; in set_multicast_list()