Lines Matching refs:dma
315 struct i596_dma *dma; member
370 return lp->dma_addr + ((unsigned long)v - (unsigned long)lp->dma); in virt_to_dma()
400 static inline int wait_istat(struct net_device *dev, struct i596_dma *dma, int delcnt, char *str) in wait_istat() argument
402 dma_sync_cpu(dev, &(dma->iscp), sizeof(struct i596_iscp)); in wait_istat()
403 while (--delcnt && dma->iscp.stat) { in wait_istat()
405 dma_sync_cpu(dev, &(dma->iscp), sizeof(struct i596_iscp)); in wait_istat()
409 dev->name, str, SWAP16(dma->iscp.stat)); in wait_istat()
416 static inline int wait_cmd(struct net_device *dev, struct i596_dma *dma, int delcnt, char *str) in wait_cmd() argument
418 dma_sync_cpu(dev, &(dma->scb), sizeof(struct i596_scb)); in wait_cmd()
419 while (--delcnt && dma->scb.command) { in wait_cmd()
421 dma_sync_cpu(dev, &(dma->scb), sizeof(struct i596_scb)); in wait_cmd()
426 SWAP16(dma->scb.status), in wait_cmd()
427 SWAP16(dma->scb.command)); in wait_cmd()
437 struct i596_dma *dma = lp->dma; in i596_display_data() local
443 &dma->scp, dma->scp.sysbus, SWAP32(dma->scp.iscp)); in i596_display_data()
445 &dma->iscp, SWAP32(dma->iscp.stat), SWAP32(dma->iscp.scb)); in i596_display_data()
448 &dma->scb, SWAP16(dma->scb.status), SWAP16(dma->scb.command), in i596_display_data()
449 SWAP16(dma->scb.cmd), SWAP32(dma->scb.rfd)); in i596_display_data()
452 SWAP32(dma->scb.crc_err), SWAP32(dma->scb.align_err), in i596_display_data()
453 SWAP32(dma->scb.resource_err), SWAP32(dma->scb.over_err), in i596_display_data()
454 SWAP32(dma->scb.rcvdt_err), SWAP32(dma->scb.short_err)); in i596_display_data()
485 dma_sync_cpu(dev, dma, sizeof(struct i596_dma)); in i596_display_data()
491 struct i596_dma *dma = lp->dma; in init_rx_bufs() local
498 for (i = 0, rbd = dma->rbds; i < rx_ring_size; i++, rbd++) { in init_rx_bufs()
515 lp->rbd_head = dma->rbds; in init_rx_bufs()
516 rbd = dma->rbds + rx_ring_size - 1; in init_rx_bufs()
517 rbd->v_next = dma->rbds; in init_rx_bufs()
518 rbd->b_next = SWAP32(virt_to_dma(lp, dma->rbds)); in init_rx_bufs()
522 for (i = 0, rfd = dma->rfds; i < rx_ring_size; i++, rfd++) { in init_rx_bufs()
529 lp->rfd_head = dma->rfds; in init_rx_bufs()
530 dma->scb.rfd = SWAP32(virt_to_dma(lp, dma->rfds)); in init_rx_bufs()
531 rfd = dma->rfds; in init_rx_bufs()
533 rfd->v_prev = dma->rfds + rx_ring_size - 1; in init_rx_bufs()
534 rfd = dma->rfds + rx_ring_size - 1; in init_rx_bufs()
535 rfd->v_next = dma->rfds; in init_rx_bufs()
536 rfd->b_next = SWAP32(virt_to_dma(lp, dma->rfds)); in init_rx_bufs()
539 dma_sync_dev(dev, dma, sizeof(struct i596_dma)); in init_rx_bufs()
549 for (i = 0, rbd = lp->dma->rbds; i < rx_ring_size; i++, rbd++) { in remove_rx_bufs()
563 struct i596_dma *dma = lp->dma; in rebuild_rx_bufs() local
569 dma->rfds[i].rbd = I596_NULL; in rebuild_rx_bufs()
570 dma->rfds[i].cmd = SWAP16(CMD_FLEX); in rebuild_rx_bufs()
572 dma->rfds[rx_ring_size-1].cmd = SWAP16(CMD_EOL|CMD_FLEX); in rebuild_rx_bufs()
573 lp->rfd_head = dma->rfds; in rebuild_rx_bufs()
574 dma->scb.rfd = SWAP32(virt_to_dma(lp, dma->rfds)); in rebuild_rx_bufs()
575 lp->rbd_head = dma->rbds; in rebuild_rx_bufs()
576 dma->rfds[0].rbd = SWAP32(virt_to_dma(lp, dma->rbds)); in rebuild_rx_bufs()
578 dma_sync_dev(dev, dma, sizeof(struct i596_dma)); in rebuild_rx_bufs()
585 struct i596_dma *dma = lp->dma; in init_i596_mem() local
595 dma->scp.sysbus = SYSBUS; in init_i596_mem()
596 dma->scp.iscp = SWAP32(virt_to_dma(lp, &(dma->iscp))); in init_i596_mem()
597 dma->iscp.scb = SWAP32(virt_to_dma(lp, &(dma->scb))); in init_i596_mem()
598 dma->iscp.stat = SWAP32(ISCP_BUSY); in init_i596_mem()
602 dma->scb.cmd = I596_NULL; in init_i596_mem()
606 dma_sync_dev(dev, &(dma->scp), sizeof(struct i596_scp)); in init_i596_mem()
607 dma_sync_dev(dev, &(dma->iscp), sizeof(struct i596_iscp)); in init_i596_mem()
608 dma_sync_dev(dev, &(dma->scb), sizeof(struct i596_scb)); in init_i596_mem()
610 mpu_port(dev, PORT_ALTSCP, virt_to_dma(lp, &dma->scp)); in init_i596_mem()
612 if (wait_istat(dev, dma, 1000, "initialization timed out")) in init_i596_mem()
626 dma->scb.command = 0; in init_i596_mem()
627 dma_sync_dev(dev, &(dma->scb), sizeof(struct i596_scb)); in init_i596_mem()
631 memcpy(dma->cf_cmd.i596_config, init_setup, 14); in init_i596_mem()
632 dma->cf_cmd.cmd.command = SWAP16(CmdConfigure); in init_i596_mem()
633 dma_sync_dev(dev, &(dma->cf_cmd), sizeof(struct cf_cmd)); in init_i596_mem()
634 i596_add_cmd(dev, &dma->cf_cmd.cmd); in init_i596_mem()
637 memcpy(dma->sa_cmd.eth_addr, dev->dev_addr, ETH_ALEN); in init_i596_mem()
638 dma->sa_cmd.cmd.command = SWAP16(CmdSASetup); in init_i596_mem()
639 dma_sync_dev(dev, &(dma->sa_cmd), sizeof(struct sa_cmd)); in init_i596_mem()
640 i596_add_cmd(dev, &dma->sa_cmd.cmd); in init_i596_mem()
643 dma->tdr_cmd.cmd.command = SWAP16(CmdTDR); in init_i596_mem()
644 dma_sync_dev(dev, &(dma->tdr_cmd), sizeof(struct tdr_cmd)); in init_i596_mem()
645 i596_add_cmd(dev, &dma->tdr_cmd.cmd); in init_i596_mem()
649 if (wait_cmd(dev, dma, 1000, "timed out waiting to issue RX_START")) { in init_i596_mem()
654 dma->scb.command = SWAP16(RX_START); in init_i596_mem()
655 dma->scb.rfd = SWAP32(virt_to_dma(lp, dma->rfds)); in init_i596_mem()
656 dma_sync_dev(dev, &(dma->scb), sizeof(struct i596_scb)); in init_i596_mem()
661 if (wait_cmd(dev, dma, 1000, "RX_START not processed")) in init_i596_mem()
808 lp->dma->scb.rfd = rfd->b_next; in i596_rx()
861 wait_cmd(dev, lp->dma, 100, "i596_cleanup_cmd timed out"); in i596_cleanup_cmd()
862 lp->dma->scb.cmd = I596_NULL; in i596_cleanup_cmd()
863 dma_sync_dev(dev, &(lp->dma->scb), sizeof(struct i596_scb)); in i596_cleanup_cmd()
875 wait_cmd(dev, lp->dma, 100, "i596_reset timed out"); in i596_reset()
880 lp->dma->scb.command = SWAP16(CUC_ABORT | RX_ABORT); in i596_reset()
881 dma_sync_dev(dev, &(lp->dma->scb), sizeof(struct i596_scb)); in i596_reset()
885 wait_cmd(dev, lp->dma, 1000, "i596_reset 2 timed out"); in i596_reset()
899 struct i596_dma *dma = lp->dma; in i596_add_cmd() local
919 wait_cmd(dev, dma, 100, "i596_add_cmd timed out"); in i596_add_cmd()
920 dma->scb.cmd = SWAP32(virt_to_dma(lp, &cmd->status)); in i596_add_cmd()
921 dma->scb.command = SWAP16(CUC_START); in i596_add_cmd()
922 dma_sync_dev(dev, &(dma->scb), sizeof(struct i596_scb)); in i596_add_cmd()
986 lp->dma->scb.command = SWAP16(CUC_START | RX_START); in i596_tx_timeout()
987 dma_sync_dev(dev, &(lp->dma->scb), sizeof(struct i596_scb)); in i596_tx_timeout()
1016 tx_cmd = lp->dma->tx_cmds + lp->next_tx_cmd; in i596_start_xmit()
1017 tbd = lp->dma->tbds + lp->next_tx_cmd; in i596_start_xmit()
1096 memset(lp->dma, 0, sizeof(struct i596_dma)); in i82596_probe()
1097 lp->dma->scb.command = 0; in i82596_probe()
1098 lp->dma->scb.cmd = I596_NULL; in i82596_probe()
1099 lp->dma->scb.rfd = I596_NULL; in i82596_probe()
1102 dma_sync_dev(dev, lp->dma, sizeof(struct i596_dma)); in i82596_probe()
1113 dev->name, lp->dma, (int)sizeof(struct i596_dma), in i82596_probe()
1114 &lp->dma->scb)); in i82596_probe()
1132 struct i596_dma *dma; in i596_interrupt() local
1136 dma = lp->dma; in i596_interrupt()
1140 wait_cmd(dev, dma, 100, "i596 interrupt, timeout"); in i596_interrupt()
1141 status = SWAP16(dma->scb.status); in i596_interrupt()
1273 dma->scb.cmd = SWAP32(virt_to_dma(lp, &lp->cmd_head->status)); in i596_interrupt()
1274 dma_sync_dev(dev, &dma->scb, sizeof(struct i596_scb)); in i596_interrupt()
1297 wait_cmd(dev, dma, 100, "i596 interrupt, timeout"); in i596_interrupt()
1298 dma->scb.command = SWAP16(ack_cmd); in i596_interrupt()
1299 dma_sync_dev(dev, &dma->scb, sizeof(struct i596_scb)); in i596_interrupt()
1307 wait_cmd(dev, dma, 100, "i596 interrupt, exit timeout"); in i596_interrupt()
1324 dev->name, SWAP16(lp->dma->scb.status))); in i596_close()
1328 wait_cmd(dev, lp->dma, 100, "close1 timed out"); in i596_close()
1329 lp->dma->scb.command = SWAP16(CUC_ABORT | RX_ABORT); in i596_close()
1330 dma_sync_dev(dev, &lp->dma->scb, sizeof(struct i596_scb)); in i596_close()
1334 wait_cmd(dev, lp->dma, 100, "close2 timed out"); in i596_close()
1352 struct i596_dma *dma = lp->dma; in set_multicast_list() local
1363 !(dma->cf_cmd.i596_config[8] & 0x01)) { in set_multicast_list()
1364 dma->cf_cmd.i596_config[8] |= 0x01; in set_multicast_list()
1368 (dma->cf_cmd.i596_config[8] & 0x01)) { in set_multicast_list()
1369 dma->cf_cmd.i596_config[8] &= ~0x01; in set_multicast_list()
1373 (dma->cf_cmd.i596_config[11] & 0x20)) { in set_multicast_list()
1374 dma->cf_cmd.i596_config[11] &= ~0x20; in set_multicast_list()
1378 !(dma->cf_cmd.i596_config[11] & 0x20)) { in set_multicast_list()
1379 dma->cf_cmd.i596_config[11] |= 0x20; in set_multicast_list()
1383 if (dma->cf_cmd.cmd.command) in set_multicast_list()
1388 dma->cf_cmd.cmd.command = SWAP16(CmdConfigure); in set_multicast_list()
1389 dma_sync_dev(dev, &dma->cf_cmd, sizeof(struct cf_cmd)); in set_multicast_list()
1390 i596_add_cmd(dev, &dma->cf_cmd.cmd); in set_multicast_list()
1406 cmd = &dma->mc_cmd; in set_multicast_list()
1421 dma_sync_dev(dev, &dma->mc_cmd, sizeof(struct mc_cmd)); in set_multicast_list()