.. | .. |
---|
351 | 351 | static irqreturn_t i596_interrupt(int irq, void *dev_id); |
---|
352 | 352 | static int i596_close(struct net_device *dev); |
---|
353 | 353 | static void i596_add_cmd(struct net_device *dev, struct i596_cmd *cmd); |
---|
354 | | -static void i596_tx_timeout (struct net_device *dev); |
---|
| 354 | +static void i596_tx_timeout (struct net_device *dev, unsigned int txqueue); |
---|
355 | 355 | static void print_eth(unsigned char *buf, char *str); |
---|
356 | 356 | static void set_multicast_list(struct net_device *dev); |
---|
357 | 357 | static inline void ca(struct net_device *dev); |
---|
.. | .. |
---|
365 | 365 | static void i596_poll_controller(struct net_device *dev); |
---|
366 | 366 | #endif |
---|
367 | 367 | |
---|
| 368 | +static inline dma_addr_t virt_to_dma(struct i596_private *lp, volatile void *v) |
---|
| 369 | +{ |
---|
| 370 | + return lp->dma_addr + ((unsigned long)v - (unsigned long)lp->dma); |
---|
| 371 | +} |
---|
| 372 | + |
---|
| 373 | +#ifdef NONCOHERENT_DMA |
---|
| 374 | +static inline void dma_sync_dev(struct net_device *ndev, volatile void *addr, |
---|
| 375 | + size_t len) |
---|
| 376 | +{ |
---|
| 377 | + dma_sync_single_for_device(ndev->dev.parent, |
---|
| 378 | + virt_to_dma(netdev_priv(ndev), addr), len, |
---|
| 379 | + DMA_BIDIRECTIONAL); |
---|
| 380 | +} |
---|
| 381 | + |
---|
| 382 | +static inline void dma_sync_cpu(struct net_device *ndev, volatile void *addr, |
---|
| 383 | + size_t len) |
---|
| 384 | +{ |
---|
| 385 | + dma_sync_single_for_cpu(ndev->dev.parent, |
---|
| 386 | + virt_to_dma(netdev_priv(ndev), addr), len, |
---|
| 387 | + DMA_BIDIRECTIONAL); |
---|
| 388 | +} |
---|
| 389 | +#else |
---|
| 390 | +static inline void dma_sync_dev(struct net_device *ndev, volatile void *addr, |
---|
| 391 | + size_t len) |
---|
| 392 | +{ |
---|
| 393 | +} |
---|
| 394 | +static inline void dma_sync_cpu(struct net_device *ndev, volatile void *addr, |
---|
| 395 | + size_t len) |
---|
| 396 | +{ |
---|
| 397 | +} |
---|
| 398 | +#endif /* NONCOHERENT_DMA */ |
---|
368 | 399 | |
---|
369 | 400 | static inline int wait_istat(struct net_device *dev, struct i596_dma *dma, int delcnt, char *str) |
---|
370 | 401 | { |
---|
371 | | - DMA_INV(dev, &(dma->iscp), sizeof(struct i596_iscp)); |
---|
| 402 | + dma_sync_cpu(dev, &(dma->iscp), sizeof(struct i596_iscp)); |
---|
372 | 403 | while (--delcnt && dma->iscp.stat) { |
---|
373 | 404 | udelay(10); |
---|
374 | | - DMA_INV(dev, &(dma->iscp), sizeof(struct i596_iscp)); |
---|
| 405 | + dma_sync_cpu(dev, &(dma->iscp), sizeof(struct i596_iscp)); |
---|
375 | 406 | } |
---|
376 | 407 | if (!delcnt) { |
---|
377 | 408 | printk(KERN_ERR "%s: %s, iscp.stat %04x, didn't clear\n", |
---|
.. | .. |
---|
384 | 415 | |
---|
385 | 416 | static inline int wait_cmd(struct net_device *dev, struct i596_dma *dma, int delcnt, char *str) |
---|
386 | 417 | { |
---|
387 | | - DMA_INV(dev, &(dma->scb), sizeof(struct i596_scb)); |
---|
| 418 | + dma_sync_cpu(dev, &(dma->scb), sizeof(struct i596_scb)); |
---|
388 | 419 | while (--delcnt && dma->scb.command) { |
---|
389 | 420 | udelay(10); |
---|
390 | | - DMA_INV(dev, &(dma->scb), sizeof(struct i596_scb)); |
---|
| 421 | + dma_sync_cpu(dev, &(dma->scb), sizeof(struct i596_scb)); |
---|
391 | 422 | } |
---|
392 | 423 | if (!delcnt) { |
---|
393 | 424 | printk(KERN_ERR "%s: %s, status %4.4x, cmd %4.4x.\n", |
---|
.. | .. |
---|
451 | 482 | SWAP32(rbd->b_data), SWAP16(rbd->size)); |
---|
452 | 483 | rbd = rbd->v_next; |
---|
453 | 484 | } while (rbd != lp->rbd_head); |
---|
454 | | - DMA_INV(dev, dma, sizeof(struct i596_dma)); |
---|
| 485 | + dma_sync_cpu(dev, dma, sizeof(struct i596_dma)); |
---|
455 | 486 | } |
---|
456 | | - |
---|
457 | | - |
---|
458 | | -#define virt_to_dma(lp, v) ((lp)->dma_addr + (dma_addr_t)((unsigned long)(v)-(unsigned long)((lp)->dma))) |
---|
459 | 487 | |
---|
460 | 488 | static inline int init_rx_bufs(struct net_device *dev) |
---|
461 | 489 | { |
---|
.. | .. |
---|
508 | 536 | rfd->b_next = SWAP32(virt_to_dma(lp, dma->rfds)); |
---|
509 | 537 | rfd->cmd = SWAP16(CMD_EOL|CMD_FLEX); |
---|
510 | 538 | |
---|
511 | | - DMA_WBACK_INV(dev, dma, sizeof(struct i596_dma)); |
---|
| 539 | + dma_sync_dev(dev, dma, sizeof(struct i596_dma)); |
---|
512 | 540 | return 0; |
---|
513 | 541 | } |
---|
514 | 542 | |
---|
.. | .. |
---|
547 | 575 | lp->rbd_head = dma->rbds; |
---|
548 | 576 | dma->rfds[0].rbd = SWAP32(virt_to_dma(lp, dma->rbds)); |
---|
549 | 577 | |
---|
550 | | - DMA_WBACK_INV(dev, dma, sizeof(struct i596_dma)); |
---|
| 578 | + dma_sync_dev(dev, dma, sizeof(struct i596_dma)); |
---|
551 | 579 | } |
---|
552 | 580 | |
---|
553 | 581 | |
---|
.. | .. |
---|
575 | 603 | |
---|
576 | 604 | DEB(DEB_INIT, printk(KERN_DEBUG "%s: starting i82596.\n", dev->name)); |
---|
577 | 605 | |
---|
578 | | - DMA_WBACK(dev, &(dma->scp), sizeof(struct i596_scp)); |
---|
579 | | - DMA_WBACK(dev, &(dma->iscp), sizeof(struct i596_iscp)); |
---|
580 | | - DMA_WBACK(dev, &(dma->scb), sizeof(struct i596_scb)); |
---|
| 606 | + dma_sync_dev(dev, &(dma->scp), sizeof(struct i596_scp)); |
---|
| 607 | + dma_sync_dev(dev, &(dma->iscp), sizeof(struct i596_iscp)); |
---|
| 608 | + dma_sync_dev(dev, &(dma->scb), sizeof(struct i596_scb)); |
---|
581 | 609 | |
---|
582 | 610 | mpu_port(dev, PORT_ALTSCP, virt_to_dma(lp, &dma->scp)); |
---|
583 | 611 | ca(dev); |
---|
.. | .. |
---|
596 | 624 | rebuild_rx_bufs(dev); |
---|
597 | 625 | |
---|
598 | 626 | dma->scb.command = 0; |
---|
599 | | - DMA_WBACK(dev, &(dma->scb), sizeof(struct i596_scb)); |
---|
| 627 | + dma_sync_dev(dev, &(dma->scb), sizeof(struct i596_scb)); |
---|
600 | 628 | |
---|
601 | 629 | DEB(DEB_INIT, printk(KERN_DEBUG |
---|
602 | 630 | "%s: queuing CmdConfigure\n", dev->name)); |
---|
603 | 631 | memcpy(dma->cf_cmd.i596_config, init_setup, 14); |
---|
604 | 632 | dma->cf_cmd.cmd.command = SWAP16(CmdConfigure); |
---|
605 | | - DMA_WBACK(dev, &(dma->cf_cmd), sizeof(struct cf_cmd)); |
---|
| 633 | + dma_sync_dev(dev, &(dma->cf_cmd), sizeof(struct cf_cmd)); |
---|
606 | 634 | i596_add_cmd(dev, &dma->cf_cmd.cmd); |
---|
607 | 635 | |
---|
608 | 636 | DEB(DEB_INIT, printk(KERN_DEBUG "%s: queuing CmdSASetup\n", dev->name)); |
---|
609 | 637 | memcpy(dma->sa_cmd.eth_addr, dev->dev_addr, ETH_ALEN); |
---|
610 | 638 | dma->sa_cmd.cmd.command = SWAP16(CmdSASetup); |
---|
611 | | - DMA_WBACK(dev, &(dma->sa_cmd), sizeof(struct sa_cmd)); |
---|
| 639 | + dma_sync_dev(dev, &(dma->sa_cmd), sizeof(struct sa_cmd)); |
---|
612 | 640 | i596_add_cmd(dev, &dma->sa_cmd.cmd); |
---|
613 | 641 | |
---|
614 | 642 | DEB(DEB_INIT, printk(KERN_DEBUG "%s: queuing CmdTDR\n", dev->name)); |
---|
615 | 643 | dma->tdr_cmd.cmd.command = SWAP16(CmdTDR); |
---|
616 | | - DMA_WBACK(dev, &(dma->tdr_cmd), sizeof(struct tdr_cmd)); |
---|
| 644 | + dma_sync_dev(dev, &(dma->tdr_cmd), sizeof(struct tdr_cmd)); |
---|
617 | 645 | i596_add_cmd(dev, &dma->tdr_cmd.cmd); |
---|
618 | 646 | |
---|
619 | 647 | spin_lock_irqsave (&lp->lock, flags); |
---|
.. | .. |
---|
625 | 653 | DEB(DEB_INIT, printk(KERN_DEBUG "%s: Issuing RX_START\n", dev->name)); |
---|
626 | 654 | dma->scb.command = SWAP16(RX_START); |
---|
627 | 655 | dma->scb.rfd = SWAP32(virt_to_dma(lp, dma->rfds)); |
---|
628 | | - DMA_WBACK(dev, &(dma->scb), sizeof(struct i596_scb)); |
---|
| 656 | + dma_sync_dev(dev, &(dma->scb), sizeof(struct i596_scb)); |
---|
629 | 657 | |
---|
630 | 658 | ca(dev); |
---|
631 | 659 | |
---|
.. | .. |
---|
659 | 687 | |
---|
660 | 688 | rfd = lp->rfd_head; /* Ref next frame to check */ |
---|
661 | 689 | |
---|
662 | | - DMA_INV(dev, rfd, sizeof(struct i596_rfd)); |
---|
| 690 | + dma_sync_cpu(dev, rfd, sizeof(struct i596_rfd)); |
---|
663 | 691 | while (rfd->stat & SWAP16(STAT_C)) { /* Loop while complete frames */ |
---|
664 | 692 | if (rfd->rbd == I596_NULL) |
---|
665 | 693 | rbd = NULL; |
---|
666 | 694 | else if (rfd->rbd == lp->rbd_head->b_addr) { |
---|
667 | 695 | rbd = lp->rbd_head; |
---|
668 | | - DMA_INV(dev, rbd, sizeof(struct i596_rbd)); |
---|
| 696 | + dma_sync_cpu(dev, rbd, sizeof(struct i596_rbd)); |
---|
669 | 697 | } else { |
---|
670 | 698 | printk(KERN_ERR "%s: rbd chain broken!\n", dev->name); |
---|
671 | 699 | /* XXX Now what? */ |
---|
.. | .. |
---|
713 | 741 | DMA_FROM_DEVICE); |
---|
714 | 742 | rbd->v_data = newskb->data; |
---|
715 | 743 | rbd->b_data = SWAP32(dma_addr); |
---|
716 | | - DMA_WBACK_INV(dev, rbd, sizeof(struct i596_rbd)); |
---|
| 744 | + dma_sync_dev(dev, rbd, sizeof(struct i596_rbd)); |
---|
717 | 745 | } else { |
---|
718 | 746 | skb = netdev_alloc_skb_ip_align(dev, pkt_len); |
---|
719 | 747 | } |
---|
.. | .. |
---|
765 | 793 | if (rbd != NULL && (rbd->count & SWAP16(0x4000))) { |
---|
766 | 794 | rbd->count = 0; |
---|
767 | 795 | lp->rbd_head = rbd->v_next; |
---|
768 | | - DMA_WBACK_INV(dev, rbd, sizeof(struct i596_rbd)); |
---|
| 796 | + dma_sync_dev(dev, rbd, sizeof(struct i596_rbd)); |
---|
769 | 797 | } |
---|
770 | 798 | |
---|
771 | 799 | /* Tidy the frame descriptor, marking it as end of list */ |
---|
.. | .. |
---|
779 | 807 | |
---|
780 | 808 | lp->dma->scb.rfd = rfd->b_next; |
---|
781 | 809 | lp->rfd_head = rfd->v_next; |
---|
782 | | - DMA_WBACK_INV(dev, rfd, sizeof(struct i596_rfd)); |
---|
| 810 | + dma_sync_dev(dev, rfd, sizeof(struct i596_rfd)); |
---|
783 | 811 | |
---|
784 | 812 | /* Remove end-of-list from old end descriptor */ |
---|
785 | 813 | |
---|
786 | 814 | rfd->v_prev->cmd = SWAP16(CMD_FLEX); |
---|
787 | | - DMA_WBACK_INV(dev, rfd->v_prev, sizeof(struct i596_rfd)); |
---|
| 815 | + dma_sync_dev(dev, rfd->v_prev, sizeof(struct i596_rfd)); |
---|
788 | 816 | rfd = lp->rfd_head; |
---|
789 | | - DMA_INV(dev, rfd, sizeof(struct i596_rfd)); |
---|
| 817 | + dma_sync_cpu(dev, rfd, sizeof(struct i596_rfd)); |
---|
790 | 818 | } |
---|
791 | 819 | |
---|
792 | 820 | DEB(DEB_RXFRAME, printk(KERN_DEBUG "frames %d\n", frames)); |
---|
.. | .. |
---|
827 | 855 | ptr->v_next = NULL; |
---|
828 | 856 | ptr->b_next = I596_NULL; |
---|
829 | 857 | } |
---|
830 | | - DMA_WBACK_INV(dev, ptr, sizeof(struct i596_cmd)); |
---|
| 858 | + dma_sync_dev(dev, ptr, sizeof(struct i596_cmd)); |
---|
831 | 859 | } |
---|
832 | 860 | |
---|
833 | 861 | wait_cmd(dev, lp->dma, 100, "i596_cleanup_cmd timed out"); |
---|
834 | 862 | lp->dma->scb.cmd = I596_NULL; |
---|
835 | | - DMA_WBACK(dev, &(lp->dma->scb), sizeof(struct i596_scb)); |
---|
| 863 | + dma_sync_dev(dev, &(lp->dma->scb), sizeof(struct i596_scb)); |
---|
836 | 864 | } |
---|
837 | 865 | |
---|
838 | 866 | |
---|
.. | .. |
---|
850 | 878 | |
---|
851 | 879 | /* FIXME: this command might cause an lpmc */ |
---|
852 | 880 | lp->dma->scb.command = SWAP16(CUC_ABORT | RX_ABORT); |
---|
853 | | - DMA_WBACK(dev, &(lp->dma->scb), sizeof(struct i596_scb)); |
---|
| 881 | + dma_sync_dev(dev, &(lp->dma->scb), sizeof(struct i596_scb)); |
---|
854 | 882 | ca(dev); |
---|
855 | 883 | |
---|
856 | 884 | /* wait for shutdown */ |
---|
.. | .. |
---|
878 | 906 | cmd->command |= SWAP16(CMD_EOL | CMD_INTR); |
---|
879 | 907 | cmd->v_next = NULL; |
---|
880 | 908 | cmd->b_next = I596_NULL; |
---|
881 | | - DMA_WBACK(dev, cmd, sizeof(struct i596_cmd)); |
---|
| 909 | + dma_sync_dev(dev, cmd, sizeof(struct i596_cmd)); |
---|
882 | 910 | |
---|
883 | 911 | spin_lock_irqsave (&lp->lock, flags); |
---|
884 | 912 | |
---|
885 | 913 | if (lp->cmd_head != NULL) { |
---|
886 | 914 | lp->cmd_tail->v_next = cmd; |
---|
887 | 915 | lp->cmd_tail->b_next = SWAP32(virt_to_dma(lp, &cmd->status)); |
---|
888 | | - DMA_WBACK(dev, lp->cmd_tail, sizeof(struct i596_cmd)); |
---|
| 916 | + dma_sync_dev(dev, lp->cmd_tail, sizeof(struct i596_cmd)); |
---|
889 | 917 | } else { |
---|
890 | 918 | lp->cmd_head = cmd; |
---|
891 | 919 | wait_cmd(dev, dma, 100, "i596_add_cmd timed out"); |
---|
892 | 920 | dma->scb.cmd = SWAP32(virt_to_dma(lp, &cmd->status)); |
---|
893 | 921 | dma->scb.command = SWAP16(CUC_START); |
---|
894 | | - DMA_WBACK(dev, &(dma->scb), sizeof(struct i596_scb)); |
---|
| 922 | + dma_sync_dev(dev, &(dma->scb), sizeof(struct i596_scb)); |
---|
895 | 923 | ca(dev); |
---|
896 | 924 | } |
---|
897 | 925 | lp->cmd_tail = cmd; |
---|
.. | .. |
---|
936 | 964 | return -EAGAIN; |
---|
937 | 965 | } |
---|
938 | 966 | |
---|
939 | | -static void i596_tx_timeout (struct net_device *dev) |
---|
| 967 | +static void i596_tx_timeout (struct net_device *dev, unsigned int txqueue) |
---|
940 | 968 | { |
---|
941 | 969 | struct i596_private *lp = netdev_priv(dev); |
---|
942 | 970 | |
---|
.. | .. |
---|
956 | 984 | /* Issue a channel attention signal */ |
---|
957 | 985 | DEB(DEB_ERRORS, printk(KERN_DEBUG "Kicking board.\n")); |
---|
958 | 986 | lp->dma->scb.command = SWAP16(CUC_START | RX_START); |
---|
959 | | - DMA_WBACK_INV(dev, &(lp->dma->scb), sizeof(struct i596_scb)); |
---|
| 987 | + dma_sync_dev(dev, &(lp->dma->scb), sizeof(struct i596_scb)); |
---|
960 | 988 | ca (dev); |
---|
961 | 989 | lp->last_restart = dev->stats.tx_packets; |
---|
962 | 990 | } |
---|
.. | .. |
---|
1014 | 1042 | tbd->data = SWAP32(tx_cmd->dma_addr); |
---|
1015 | 1043 | |
---|
1016 | 1044 | DEB(DEB_TXADDR, print_eth(skb->data, "tx-queued")); |
---|
1017 | | - DMA_WBACK_INV(dev, tx_cmd, sizeof(struct tx_cmd)); |
---|
1018 | | - DMA_WBACK_INV(dev, tbd, sizeof(struct i596_tbd)); |
---|
| 1045 | + dma_sync_dev(dev, tx_cmd, sizeof(struct tx_cmd)); |
---|
| 1046 | + dma_sync_dev(dev, tbd, sizeof(struct i596_tbd)); |
---|
1019 | 1047 | i596_add_cmd(dev, &tx_cmd->cmd); |
---|
1020 | 1048 | |
---|
1021 | 1049 | dev->stats.tx_packets++; |
---|
.. | .. |
---|
1047 | 1075 | |
---|
1048 | 1076 | static int i82596_probe(struct net_device *dev) |
---|
1049 | 1077 | { |
---|
1050 | | - int i; |
---|
1051 | 1078 | struct i596_private *lp = netdev_priv(dev); |
---|
1052 | | - struct i596_dma *dma; |
---|
| 1079 | + int ret; |
---|
1053 | 1080 | |
---|
1054 | 1081 | /* This lot is ensure things have been cache line aligned. */ |
---|
1055 | 1082 | BUILD_BUG_ON(sizeof(struct i596_rfd) != 32); |
---|
.. | .. |
---|
1063 | 1090 | if (!dev->base_addr || !dev->irq) |
---|
1064 | 1091 | return -ENODEV; |
---|
1065 | 1092 | |
---|
1066 | | - dma = dma_alloc_attrs(dev->dev.parent, sizeof(struct i596_dma), |
---|
1067 | | - &lp->dma_addr, GFP_KERNEL, |
---|
1068 | | - LIB82596_DMA_ATTR); |
---|
1069 | | - if (!dma) { |
---|
1070 | | - printk(KERN_ERR "%s: Couldn't get shared memory\n", __FILE__); |
---|
1071 | | - return -ENOMEM; |
---|
1072 | | - } |
---|
1073 | | - |
---|
1074 | 1093 | dev->netdev_ops = &i596_netdev_ops; |
---|
1075 | 1094 | dev->watchdog_timeo = TX_TIMEOUT; |
---|
1076 | 1095 | |
---|
1077 | | - memset(dma, 0, sizeof(struct i596_dma)); |
---|
1078 | | - lp->dma = dma; |
---|
1079 | | - |
---|
1080 | | - dma->scb.command = 0; |
---|
1081 | | - dma->scb.cmd = I596_NULL; |
---|
1082 | | - dma->scb.rfd = I596_NULL; |
---|
| 1096 | + memset(lp->dma, 0, sizeof(struct i596_dma)); |
---|
| 1097 | + lp->dma->scb.command = 0; |
---|
| 1098 | + lp->dma->scb.cmd = I596_NULL; |
---|
| 1099 | + lp->dma->scb.rfd = I596_NULL; |
---|
1083 | 1100 | spin_lock_init(&lp->lock); |
---|
1084 | 1101 | |
---|
1085 | | - DMA_WBACK_INV(dev, dma, sizeof(struct i596_dma)); |
---|
| 1102 | + dma_sync_dev(dev, lp->dma, sizeof(struct i596_dma)); |
---|
1086 | 1103 | |
---|
1087 | | - i = register_netdev(dev); |
---|
1088 | | - if (i) { |
---|
1089 | | - dma_free_attrs(dev->dev.parent, sizeof(struct i596_dma), |
---|
1090 | | - dma, lp->dma_addr, LIB82596_DMA_ATTR); |
---|
1091 | | - return i; |
---|
1092 | | - } |
---|
| 1104 | + ret = register_netdev(dev); |
---|
| 1105 | + if (ret) |
---|
| 1106 | + return ret; |
---|
1093 | 1107 | |
---|
1094 | 1108 | DEB(DEB_PROBE, printk(KERN_INFO "%s: 82596 at %#3lx, %pM IRQ %d.\n", |
---|
1095 | 1109 | dev->name, dev->base_addr, dev->dev_addr, |
---|
1096 | 1110 | dev->irq)); |
---|
1097 | 1111 | DEB(DEB_INIT, printk(KERN_INFO |
---|
1098 | 1112 | "%s: dma at 0x%p (%d bytes), lp->scb at 0x%p\n", |
---|
1099 | | - dev->name, dma, (int)sizeof(struct i596_dma), |
---|
1100 | | - &dma->scb)); |
---|
| 1113 | + dev->name, lp->dma, (int)sizeof(struct i596_dma), |
---|
| 1114 | + &lp->dma->scb)); |
---|
1101 | 1115 | |
---|
1102 | 1116 | return 0; |
---|
1103 | 1117 | } |
---|
.. | .. |
---|
1155 | 1169 | dev->name, status & 0x0700)); |
---|
1156 | 1170 | |
---|
1157 | 1171 | while (lp->cmd_head != NULL) { |
---|
1158 | | - DMA_INV(dev, lp->cmd_head, sizeof(struct i596_cmd)); |
---|
| 1172 | + dma_sync_cpu(dev, lp->cmd_head, sizeof(struct i596_cmd)); |
---|
1159 | 1173 | if (!(lp->cmd_head->status & SWAP16(STAT_C))) |
---|
1160 | 1174 | break; |
---|
1161 | 1175 | |
---|
.. | .. |
---|
1194 | 1208 | dma_unmap_single(dev->dev.parent, |
---|
1195 | 1209 | tx_cmd->dma_addr, |
---|
1196 | 1210 | skb->len, DMA_TO_DEVICE); |
---|
1197 | | - dev_kfree_skb_irq(skb); |
---|
| 1211 | + dev_consume_skb_irq(skb); |
---|
1198 | 1212 | |
---|
1199 | 1213 | tx_cmd->cmd.command = 0; /* Mark free */ |
---|
1200 | 1214 | break; |
---|
.. | .. |
---|
1237 | 1251 | } |
---|
1238 | 1252 | ptr->v_next = NULL; |
---|
1239 | 1253 | ptr->b_next = I596_NULL; |
---|
1240 | | - DMA_WBACK(dev, ptr, sizeof(struct i596_cmd)); |
---|
| 1254 | + dma_sync_dev(dev, ptr, sizeof(struct i596_cmd)); |
---|
1241 | 1255 | lp->last_cmd = jiffies; |
---|
1242 | 1256 | } |
---|
1243 | 1257 | |
---|
.. | .. |
---|
1251 | 1265 | |
---|
1252 | 1266 | ptr->command &= SWAP16(0x1fff); |
---|
1253 | 1267 | ptr = ptr->v_next; |
---|
1254 | | - DMA_WBACK_INV(dev, prev, sizeof(struct i596_cmd)); |
---|
| 1268 | + dma_sync_dev(dev, prev, sizeof(struct i596_cmd)); |
---|
1255 | 1269 | } |
---|
1256 | 1270 | |
---|
1257 | 1271 | if (lp->cmd_head != NULL) |
---|
1258 | 1272 | ack_cmd |= CUC_START; |
---|
1259 | 1273 | dma->scb.cmd = SWAP32(virt_to_dma(lp, &lp->cmd_head->status)); |
---|
1260 | | - DMA_WBACK_INV(dev, &dma->scb, sizeof(struct i596_scb)); |
---|
| 1274 | + dma_sync_dev(dev, &dma->scb, sizeof(struct i596_scb)); |
---|
1261 | 1275 | } |
---|
1262 | 1276 | if ((status & 0x1000) || (status & 0x4000)) { |
---|
1263 | 1277 | if ((status & 0x4000)) |
---|
.. | .. |
---|
1282 | 1296 | } |
---|
1283 | 1297 | wait_cmd(dev, dma, 100, "i596 interrupt, timeout"); |
---|
1284 | 1298 | dma->scb.command = SWAP16(ack_cmd); |
---|
1285 | | - DMA_WBACK(dev, &dma->scb, sizeof(struct i596_scb)); |
---|
| 1299 | + dma_sync_dev(dev, &dma->scb, sizeof(struct i596_scb)); |
---|
1286 | 1300 | |
---|
1287 | 1301 | /* DANGER: I suspect that some kind of interrupt |
---|
1288 | 1302 | acknowledgement aside from acking the 82596 might be needed |
---|
.. | .. |
---|
1313 | 1327 | |
---|
1314 | 1328 | wait_cmd(dev, lp->dma, 100, "close1 timed out"); |
---|
1315 | 1329 | lp->dma->scb.command = SWAP16(CUC_ABORT | RX_ABORT); |
---|
1316 | | - DMA_WBACK(dev, &lp->dma->scb, sizeof(struct i596_scb)); |
---|
| 1330 | + dma_sync_dev(dev, &lp->dma->scb, sizeof(struct i596_scb)); |
---|
1317 | 1331 | |
---|
1318 | 1332 | ca(dev); |
---|
1319 | 1333 | |
---|
.. | .. |
---|
1372 | 1386 | dev->name); |
---|
1373 | 1387 | else { |
---|
1374 | 1388 | dma->cf_cmd.cmd.command = SWAP16(CmdConfigure); |
---|
1375 | | - DMA_WBACK_INV(dev, &dma->cf_cmd, sizeof(struct cf_cmd)); |
---|
| 1389 | + dma_sync_dev(dev, &dma->cf_cmd, sizeof(struct cf_cmd)); |
---|
1376 | 1390 | i596_add_cmd(dev, &dma->cf_cmd.cmd); |
---|
1377 | 1391 | } |
---|
1378 | 1392 | } |
---|
.. | .. |
---|
1404 | 1418 | dev->name, cp)); |
---|
1405 | 1419 | cp += ETH_ALEN; |
---|
1406 | 1420 | } |
---|
1407 | | - DMA_WBACK_INV(dev, &dma->mc_cmd, sizeof(struct mc_cmd)); |
---|
| 1421 | + dma_sync_dev(dev, &dma->mc_cmd, sizeof(struct mc_cmd)); |
---|
1408 | 1422 | i596_add_cmd(dev, &cmd->cmd); |
---|
1409 | 1423 | } |
---|
1410 | 1424 | } |
---|