• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/net/

Lines Matching refs:dma

84 #include <linux/dma-mapping.h>
316 struct i596_dma *dma;
370 static inline int wait_istat(struct net_device *dev, struct i596_dma *dma, int delcnt, char *str)
372 DMA_INV(dev, &(dma->iscp), sizeof(struct i596_iscp));
373 while (--delcnt && dma->iscp.stat) {
375 DMA_INV(dev, &(dma->iscp), sizeof(struct i596_iscp));
379 dev->name, str, SWAP16(dma->iscp.stat));
386 static inline int wait_cmd(struct net_device *dev, struct i596_dma *dma, int delcnt, char *str)
388 DMA_INV(dev, &(dma->scb), sizeof(struct i596_scb));
389 while (--delcnt && dma->scb.command) {
391 DMA_INV(dev, &(dma->scb), sizeof(struct i596_scb));
396 SWAP16(dma->scb.status),
397 SWAP16(dma->scb.command));
407 struct i596_dma *dma = lp->dma;
413 &dma->scp, dma->scp.sysbus, SWAP32(dma->scp.iscp));
415 &dma->iscp, SWAP32(dma->iscp.stat), SWAP32(dma->iscp.scb));
418 &dma->scb, SWAP16(dma->scb.status), SWAP16(dma->scb.command),
419 SWAP16(dma->scb.cmd), SWAP32(dma->scb.rfd));
422 SWAP32(dma->scb.crc_err), SWAP32(dma->scb.align_err),
423 SWAP32(dma->scb.resource_err), SWAP32(dma->scb.over_err),
424 SWAP32(dma->scb.rcvdt_err), SWAP32(dma->scb.short_err));
455 DMA_INV(dev, dma, sizeof(struct i596_dma));
459 #define virt_to_dma(lp, v) ((lp)->dma_addr + (dma_addr_t)((unsigned long)(v)-(unsigned long)((lp)->dma)))
464 struct i596_dma *dma = lp->dma;
471 for (i = 0, rbd = dma->rbds; i < rx_ring_size; i++, rbd++) {
488 lp->rbd_head = dma->rbds;
489 rbd = dma->rbds + rx_ring_size - 1;
490 rbd->v_next = dma->rbds;
491 rbd->b_next = SWAP32(virt_to_dma(lp, dma->rbds));
495 for (i = 0, rfd = dma->rfds; i < rx_ring_size; i++, rfd++) {
502 lp->rfd_head = dma->rfds;
503 dma->scb.rfd = SWAP32(virt_to_dma(lp, dma->rfds));
504 rfd = dma->rfds;
506 rfd->v_prev = dma->rfds + rx_ring_size - 1;
507 rfd = dma->rfds + rx_ring_size - 1;
508 rfd->v_next = dma->rfds;
509 rfd->b_next = SWAP32(virt_to_dma(lp, dma->rfds));
512 DMA_WBACK_INV(dev, dma, sizeof(struct i596_dma));
522 for (i = 0, rbd = lp->dma->rbds; i < rx_ring_size; i++, rbd++) {
536 struct i596_dma *dma = lp->dma;
542 dma->rfds[i].rbd = I596_NULL;
543 dma->rfds[i].cmd = SWAP16(CMD_FLEX);
545 dma->rfds[rx_ring_size-1].cmd = SWAP16(CMD_EOL|CMD_FLEX);
546 lp->rfd_head = dma->rfds;
547 dma->scb.rfd = SWAP32(virt_to_dma(lp, dma->rfds));
548 lp->rbd_head = dma->rbds;
549 dma->rfds[0].rbd = SWAP32(virt_to_dma(lp, dma->rbds));
551 DMA_WBACK_INV(dev, dma, sizeof(struct i596_dma));
558 struct i596_dma *dma = lp->dma;
568 dma->scp.sysbus = SYSBUS;
569 dma->scp.iscp = SWAP32(virt_to_dma(lp, &(dma->iscp)));
570 dma->iscp.scb = SWAP32(virt_to_dma(lp, &(dma->scb)));
571 dma->iscp.stat = SWAP32(ISCP_BUSY);
575 dma->scb.cmd = I596_NULL;
579 DMA_WBACK(dev, &(dma->scp), sizeof(struct i596_scp));
580 DMA_WBACK(dev, &(dma->iscp), sizeof(struct i596_iscp));
581 DMA_WBACK(dev, &(dma->scb), sizeof(struct i596_scb));
583 mpu_port(dev, PORT_ALTSCP, virt_to_dma(lp, &dma->scp));
585 if (wait_istat(dev, dma, 1000, "initialization timed out"))
599 dma->scb.command = 0;
600 DMA_WBACK(dev, &(dma->scb), sizeof(struct i596_scb));
604 memcpy(dma->cf_cmd.i596_config, init_setup, 14);
605 dma->cf_cmd.cmd.command = SWAP16(CmdConfigure);
606 DMA_WBACK(dev, &(dma->cf_cmd), sizeof(struct cf_cmd));
607 i596_add_cmd(dev, &dma->cf_cmd.cmd);
610 memcpy(dma->sa_cmd.eth_addr, dev->dev_addr, 6);
611 dma->sa_cmd.cmd.command = SWAP16(CmdSASetup);
612 DMA_WBACK(dev, &(dma->sa_cmd), sizeof(struct sa_cmd));
613 i596_add_cmd(dev, &dma->sa_cmd.cmd);
616 dma->tdr_cmd.cmd.command = SWAP16(CmdTDR);
617 DMA_WBACK(dev, &(dma->tdr_cmd), sizeof(struct tdr_cmd));
618 i596_add_cmd(dev, &dma->tdr_cmd.cmd);
622 if (wait_cmd(dev, dma, 1000, "timed out waiting to issue RX_START")) {
627 dma->scb.command = SWAP16(RX_START);
628 dma->scb.rfd = SWAP32(virt_to_dma(lp, dma->rfds));
629 DMA_WBACK(dev, &(dma->scb), sizeof(struct i596_scb));
634 if (wait_cmd(dev, dma, 1000, "RX_START not processed"))
780 lp->dma->scb.rfd = rfd->b_next;
833 wait_cmd(dev, lp->dma, 100, "i596_cleanup_cmd timed out");
834 lp->dma->scb.cmd = I596_NULL;
835 DMA_WBACK(dev, &(lp->dma->scb), sizeof(struct i596_scb));
847 wait_cmd(dev, lp->dma, 100, "i596_reset timed out");
851 lp->dma->scb.command = SWAP16(CUC_ABORT | RX_ABORT);
852 DMA_WBACK(dev, &(lp->dma->scb), sizeof(struct i596_scb));
856 wait_cmd(dev, lp->dma, 1000, "i596_reset 2 timed out");
870 struct i596_dma *dma = lp->dma;
890 wait_cmd(dev, dma, 100, "i596_add_cmd timed out");
891 dma->scb.cmd = SWAP32(virt_to_dma(lp, &cmd->status));
892 dma->scb.command = SWAP16(CUC_START);
893 DMA_WBACK(dev, &(dma->scb), sizeof(struct i596_scb));
955 lp->dma->scb.command = SWAP16(CUC_START | RX_START);
956 DMA_WBACK_INV(dev, &(lp->dma->scb), sizeof(struct i596_scb));
985 tx_cmd = lp->dma->tx_cmds + lp->next_tx_cmd;
986 tbd = lp->dma->tbds + lp->next_tx_cmd;
1050 struct i596_dma *dma;
1064 dma = (struct i596_dma *) DMA_ALLOC(dev->dev.parent,
1066 if (!dma) {
1074 memset(dma, 0, sizeof(struct i596_dma));
1075 lp->dma = dma;
1077 dma->scb.command = 0;
1078 dma->scb.cmd = I596_NULL;
1079 dma->scb.rfd = I596_NULL;
1082 DMA_WBACK_INV(dev, dma, sizeof(struct i596_dma));
1087 (void *)dma, lp->dma_addr);
1095 "%s: dma at 0x%p (%d bytes), lp->scb at 0x%p\n",
1096 dev->name, dma, (int)sizeof(struct i596_dma),
1097 &dma->scb));
1115 struct i596_dma *dma;
1119 dma = lp->dma;
1123 wait_cmd(dev, dma, 100, "i596 interrupt, timeout");
1124 status = SWAP16(dma->scb.status);
1256 dma->scb.cmd = SWAP32(virt_to_dma(lp, &lp->cmd_head->status));
1257 DMA_WBACK_INV(dev, &dma->scb, sizeof(struct i596_scb));
1280 wait_cmd(dev, dma, 100, "i596 interrupt, timeout");
1281 dma->scb.command = SWAP16(ack_cmd);
1282 DMA_WBACK(dev, &dma->scb, sizeof(struct i596_scb));
1290 wait_cmd(dev, dma, 100, "i596 interrupt, exit timeout");
1307 dev->name, SWAP16(lp->dma->scb.status)));
1311 wait_cmd(dev, lp->dma, 100, "close1 timed out");
1312 lp->dma->scb.command = SWAP16(CUC_ABORT | RX_ABORT);
1313 DMA_WBACK(dev, &lp->dma->scb, sizeof(struct i596_scb));
1317 wait_cmd(dev, lp->dma, 100, "close2 timed out");
1335 struct i596_dma *dma = lp->dma;
1346 !(dma->cf_cmd.i596_config[8] & 0x01)) {
1347 dma->cf_cmd.i596_config[8] |= 0x01;
1351 (dma->cf_cmd.i596_config[8] & 0x01)) {
1352 dma->cf_cmd.i596_config[8] &= ~0x01;
1356 (dma->cf_cmd.i596_config[11] & 0x20)) {
1357 dma->cf_cmd.i596_config[11] &= ~0x20;
1361 !(dma->cf_cmd.i596_config[11] & 0x20)) {
1362 dma->cf_cmd.i596_config[11] |= 0x20;
1366 if (dma->cf_cmd.cmd.command)
1371 dma->cf_cmd.cmd.command = SWAP16(CmdConfigure);
1372 DMA_WBACK_INV(dev, &dma->cf_cmd, sizeof(struct cf_cmd));
1373 i596_add_cmd(dev, &dma->cf_cmd.cmd);
1389 cmd = &dma->mc_cmd;
1404 DMA_WBACK_INV(dev, &dma->mc_cmd, sizeof(struct mc_cmd));