Lines Matching refs:lp

412 static inline int wait_istat(struct net_device *dev, struct i596_private *lp, int delcnt, char *str)  in wait_istat()  argument
414 while (--delcnt && lp->iscp.stat) in wait_istat()
418 dev->name, str, lp->scb.status, lp->scb.command); in wait_istat()
426 static inline int wait_cmd(struct net_device *dev, struct i596_private *lp, int delcnt, char *str) in wait_cmd() argument
428 while (--delcnt && lp->scb.command) in wait_cmd()
432 dev->name, str, lp->scb.status, lp->scb.command); in wait_cmd()
457 struct i596_private *lp = dev->ml_priv; in i596_display_data() local
463 &lp->scp, lp->scp.sysbus, lp->scp.iscp); in i596_display_data()
465 &lp->iscp, lp->iscp.stat, lp->iscp.scb); in i596_display_data()
468 &lp->scb, lp->scb.status, lp->scb.command, in i596_display_data()
469 lp->scb.cmd, lp->scb.rfd); in i596_display_data()
472 lp->scb.crc_err, lp->scb.align_err, lp->scb.resource_err, in i596_display_data()
473 lp->scb.over_err, lp->scb.rcvdt_err, lp->scb.short_err); in i596_display_data()
474 cmd = lp->cmd_head; in i596_display_data()
480 rfd = lp->rfd_head; in i596_display_data()
488 } while (rfd != lp->rfd_head); in i596_display_data()
489 rbd = lp->rbd_head; in i596_display_data()
495 } while (rbd != lp->rbd_head); in i596_display_data()
527 struct i596_private *lp = dev->ml_priv; in remove_rx_bufs() local
531 for (i = 0, rbd = lp->rbds; i < rx_ring_size; i++, rbd++) { in remove_rx_bufs()
541 struct i596_private *lp = dev->ml_priv; in init_rx_bufs() local
548 for (i = 0, rbd = lp->rbds; i < rx_ring_size; i++, rbd++) { in init_rx_bufs()
567 lp->rbd_head = lp->rbds; in init_rx_bufs()
568 rbd = lp->rbds + rx_ring_size - 1; in init_rx_bufs()
569 rbd->v_next = lp->rbds; in init_rx_bufs()
570 rbd->b_next = WSWAPrbd(virt_to_bus(lp->rbds)); in init_rx_bufs()
574 for (i = 0, rfd = lp->rfds; i < rx_ring_size; i++, rfd++) { in init_rx_bufs()
581 lp->rfd_head = lp->rfds; in init_rx_bufs()
582 lp->scb.rfd = WSWAPrfd(virt_to_bus(lp->rfds)); in init_rx_bufs()
583 rfd = lp->rfds; in init_rx_bufs()
584 rfd->rbd = lp->rbd_head; in init_rx_bufs()
585 rfd->v_prev = lp->rfds + rx_ring_size - 1; in init_rx_bufs()
586 rfd = lp->rfds + rx_ring_size - 1; in init_rx_bufs()
587 rfd->v_next = lp->rfds; in init_rx_bufs()
588 rfd->b_next = WSWAPrfd(virt_to_bus(lp->rfds)); in init_rx_bufs()
597 struct i596_private *lp = dev->ml_priv; in rebuild_rx_bufs() local
603 lp->rfds[i].rbd = I596_NULL; in rebuild_rx_bufs()
604 lp->rfds[i].cmd = CMD_FLEX; in rebuild_rx_bufs()
606 lp->rfds[rx_ring_size-1].cmd = CMD_EOL|CMD_FLEX; in rebuild_rx_bufs()
607 lp->rfd_head = lp->rfds; in rebuild_rx_bufs()
608 lp->scb.rfd = WSWAPrfd(virt_to_bus(lp->rfds)); in rebuild_rx_bufs()
609 lp->rbd_head = lp->rbds; in rebuild_rx_bufs()
610 lp->rfds[0].rbd = WSWAPrbd(virt_to_bus(lp->rbds)); in rebuild_rx_bufs()
616 struct i596_private *lp = dev->ml_priv; in init_i596_mem() local
648 MPU_PORT(dev, PORT_ALTSCP, (void *)virt_to_bus((void *)&lp->scp)); in init_i596_mem()
652 lp->last_cmd = jiffies; in init_i596_mem()
656 lp->scp.sysbus = 0x00000054; in init_i596_mem()
660 lp->scp.sysbus = 0x0000004c; in init_i596_mem()
663 lp->scp.iscp = WSWAPiscp(virt_to_bus((void *)&lp->iscp)); in init_i596_mem()
664 lp->iscp.scb = WSWAPscb(virt_to_bus((void *)&lp->scb)); in init_i596_mem()
665 lp->iscp.stat = ISCP_BUSY; in init_i596_mem()
666 lp->cmd_backlog = 0; in init_i596_mem()
668 lp->cmd_head = lp->scb.cmd = I596_NULL; in init_i596_mem()
672 lp->scb.t_on = 7 * 25; in init_i596_mem()
673 lp->scb.t_off = 1 * 25; in init_i596_mem()
681 if (wait_istat(dev,lp,1000,"initialization timed out")) in init_i596_mem()
687 lp->scb.command = 0; in init_i596_mem()
708 memcpy(lp->cf_cmd.i596_config, init_setup, 14); in init_i596_mem()
709 lp->cf_cmd.cmd.command = CmdConfigure; in init_i596_mem()
710 i596_add_cmd(dev, &lp->cf_cmd.cmd); in init_i596_mem()
713 memcpy(lp->sa_cmd.eth_addr, dev->dev_addr, ETH_ALEN); in init_i596_mem()
714 lp->sa_cmd.cmd.command = CmdSASetup; in init_i596_mem()
715 i596_add_cmd(dev, &lp->sa_cmd.cmd); in init_i596_mem()
718 lp->tdr_cmd.cmd.command = CmdTDR; in init_i596_mem()
719 i596_add_cmd(dev, &lp->tdr_cmd.cmd); in init_i596_mem()
721 spin_lock_irqsave (&lp->lock, flags); in init_i596_mem()
723 if (wait_cmd(dev,lp,1000,"timed out waiting to issue RX_START")) { in init_i596_mem()
724 spin_unlock_irqrestore (&lp->lock, flags); in init_i596_mem()
728 lp->scb.command = RX_START; in init_i596_mem()
731 spin_unlock_irqrestore (&lp->lock, flags); in init_i596_mem()
733 if (wait_cmd(dev,lp,1000,"RX_START not processed")) in init_i596_mem()
746 struct i596_private *lp = dev->ml_priv; in i596_rx() local
752 lp->rfd_head, lp->rbd_head)); in i596_rx()
754 rfd = lp->rfd_head; /* Ref next frame to check */ in i596_rx()
759 else if (rfd->rbd == lp->rbd_head->b_addr) in i596_rx()
760 rbd = lp->rbd_head; in i596_rx()
849 lp->rbd_head = rbd->v_next; in i596_rx()
865 lp->scb.rfd = rfd->b_next; in i596_rx()
866 lp->rfd_head = rfd->v_next; in i596_rx()
867 rfd = lp->rfd_head; in i596_rx()
876 static void i596_cleanup_cmd(struct net_device *dev, struct i596_private *lp) in i596_cleanup_cmd() argument
880 while (lp->cmd_head != I596_NULL) { in i596_cleanup_cmd()
881 ptr = lp->cmd_head; in i596_cleanup_cmd()
882 lp->cmd_head = ptr->v_next; in i596_cleanup_cmd()
883 lp->cmd_backlog--; in i596_cleanup_cmd()
905 wait_cmd(dev,lp,100,"i596_cleanup_cmd timed out"); in i596_cleanup_cmd()
906 lp->scb.cmd = I596_NULL; in i596_cleanup_cmd()
909 static void i596_reset(struct net_device *dev, struct i596_private *lp, in i596_reset() argument
916 spin_lock_irqsave (&lp->lock, flags); in i596_reset()
918 wait_cmd(dev,lp,100,"i596_reset timed out"); in i596_reset()
922 lp->scb.command = CUC_ABORT | RX_ABORT; in i596_reset()
926 wait_cmd(dev,lp,1000,"i596_reset 2 timed out"); in i596_reset()
927 spin_unlock_irqrestore (&lp->lock, flags); in i596_reset()
929 i596_cleanup_cmd(dev,lp); in i596_reset()
938 struct i596_private *lp = dev->ml_priv; in i596_add_cmd() local
948 spin_lock_irqsave (&lp->lock, flags); in i596_add_cmd()
950 if (lp->cmd_head != I596_NULL) { in i596_add_cmd()
951 lp->cmd_tail->v_next = cmd; in i596_add_cmd()
952 lp->cmd_tail->b_next = WSWAPcmd(virt_to_bus(&cmd->status)); in i596_add_cmd()
954 lp->cmd_head = cmd; in i596_add_cmd()
955 wait_cmd(dev,lp,100,"i596_add_cmd timed out"); in i596_add_cmd()
956 lp->scb.cmd = WSWAPcmd(virt_to_bus(&cmd->status)); in i596_add_cmd()
957 lp->scb.command = CUC_START; in i596_add_cmd()
960 lp->cmd_tail = cmd; in i596_add_cmd()
961 lp->cmd_backlog++; in i596_add_cmd()
963 spin_unlock_irqrestore (&lp->lock, flags); in i596_add_cmd()
965 if (lp->cmd_backlog > max_cmd_backlog) { in i596_add_cmd()
966 unsigned long tickssofar = jiffies - lp->last_cmd; in i596_add_cmd()
973 i596_reset(dev, lp, ioaddr); in i596_add_cmd()
1023 struct i596_private *lp = dev->ml_priv; in i596_tx_timeout() local
1033 if (lp->last_restart == dev->stats.tx_packets) { in i596_tx_timeout()
1036 i596_reset (dev, lp, ioaddr); in i596_tx_timeout()
1040 lp->scb.command = CUC_START | RX_START; in i596_tx_timeout()
1042 lp->last_restart = dev->stats.tx_packets; in i596_tx_timeout()
1051 struct i596_private *lp = dev->ml_priv; in i596_start_xmit() local
1066 tx_cmd = lp->tx_cmds + lp->next_tx_cmd; in i596_start_xmit()
1067 tbd = lp->tbds + lp->next_tx_cmd; in i596_start_xmit()
1076 if (++lp->next_tx_cmd == TX_RING_SIZE) in i596_start_xmit()
1077 lp->next_tx_cmd = 0; in i596_start_xmit()
1126 struct i596_private *lp; in i82596_probe() local
1193 lp = dev->ml_priv; in i82596_probe()
1196 dev->name, (unsigned long)lp, in i82596_probe()
1197 sizeof(struct i596_private), (unsigned long)&lp->scb)); in i82596_probe()
1198 memset((void *) lp, 0, sizeof(struct i596_private)); in i82596_probe()
1205 lp->scb.command = 0; in i82596_probe()
1206 lp->scb.cmd = I596_NULL; in i82596_probe()
1207 lp->scb.rfd = I596_NULL; in i82596_probe()
1208 spin_lock_init(&lp->lock); in i82596_probe()
1232 struct i596_private *lp; in i596_interrupt() local
1251 lp = dev->ml_priv; in i596_interrupt()
1253 spin_lock (&lp->lock); in i596_interrupt()
1255 wait_cmd(dev,lp,100,"i596 interrupt, timeout"); in i596_interrupt()
1256 status = lp->scb.status; in i596_interrupt()
1272 while ((lp->cmd_head != I596_NULL) && (lp->cmd_head->status & STAT_C)) { in i596_interrupt()
1273 ptr = lp->cmd_head; in i596_interrupt()
1276 lp->cmd_head->status, lp->cmd_head->command)); in i596_interrupt()
1277 lp->cmd_head = ptr->v_next; in i596_interrupt()
1278 lp->cmd_backlog--; in i596_interrupt()
1332 lp->last_cmd = jiffies; in i596_interrupt()
1335 ptr = lp->cmd_head; in i596_interrupt()
1336 while ((ptr != I596_NULL) && (ptr != lp->cmd_tail)) { in i596_interrupt()
1341 if ((lp->cmd_head != I596_NULL)) in i596_interrupt()
1343 lp->scb.cmd = WSWAPcmd(virt_to_bus(&lp->cmd_head->status)); in i596_interrupt()
1360 wait_cmd(dev,lp,100,"i596 interrupt, timeout"); in i596_interrupt()
1361 lp->scb.command = ack_cmd; in i596_interrupt()
1384 spin_unlock (&lp->lock); in i596_interrupt()
1390 struct i596_private *lp = dev->ml_priv; in i596_close() local
1396 dev->name, lp->scb.status)); in i596_close()
1398 spin_lock_irqsave(&lp->lock, flags); in i596_close()
1400 wait_cmd(dev,lp,100,"close1 timed out"); in i596_close()
1401 lp->scb.command = CUC_ABORT | RX_ABORT; in i596_close()
1404 wait_cmd(dev,lp,100,"close2 timed out"); in i596_close()
1406 spin_unlock_irqrestore(&lp->lock, flags); in i596_close()
1408 i596_cleanup_cmd(dev,lp); in i596_close()
1443 struct i596_private *lp = dev->ml_priv; in set_multicast_list() local
1451 if (wait_cfg(dev, &lp->cf_cmd.cmd, 1000, "config change request timed out")) in set_multicast_list()
1454 if ((dev->flags & IFF_PROMISC) && !(lp->cf_cmd.i596_config[8] & 0x01)) { in set_multicast_list()
1455 lp->cf_cmd.i596_config[8] |= 0x01; in set_multicast_list()
1458 if (!(dev->flags & IFF_PROMISC) && (lp->cf_cmd.i596_config[8] & 0x01)) { in set_multicast_list()
1459 lp->cf_cmd.i596_config[8] &= ~0x01; in set_multicast_list()
1462 if ((dev->flags & IFF_ALLMULTI) && (lp->cf_cmd.i596_config[11] & 0x20)) { in set_multicast_list()
1463 lp->cf_cmd.i596_config[11] &= ~0x20; in set_multicast_list()
1466 if (!(dev->flags & IFF_ALLMULTI) && !(lp->cf_cmd.i596_config[11] & 0x20)) { in set_multicast_list()
1467 lp->cf_cmd.i596_config[11] |= 0x20; in set_multicast_list()
1471 lp->cf_cmd.cmd.command = CmdConfigure; in set_multicast_list()
1472 i596_add_cmd(dev, &lp->cf_cmd.cmd); in set_multicast_list()
1488 if (wait_cfg(dev, &lp->mc_cmd.cmd, 1000, "multicast list change request timed out")) in set_multicast_list()
1490 cmd = &lp->mc_cmd; in set_multicast_list()