aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wan
diff options
context:
space:
mode:
authorBen Hutchings <ben@decadent.org.uk>2014-06-08 18:49:34 -0400
committerDavid S. Miller <davem@davemloft.net>2014-06-11 03:45:29 -0400
commit581d9baa21dbd69b5b02cd654d858d064c400769 (patch)
tree512c8c36b9d5735553817e7aae5d4c80d9dd9be4 /drivers/net/wan
parent7e1a61b6c14e7b0816b800038781b9572d5154d4 (diff)
farsync: Fix confusion about DMA address and buffer offset types
Use dma_addr_t for DMA address parameters and u32 for shared memory offset parameters. Do not assume that dma_addr_t is the same as unsigned long; it will not be in PAE configurations. Truncate DMA addresses to 32 bits when printing them. This is OK because the DMA mask for this device is 32-bit (per default). Also rename the DMA address parameters from 'skb' to 'dma'. Compile-tested only. Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/wan')
-rw-r--r--drivers/net/wan/farsync.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/drivers/net/wan/farsync.c b/drivers/net/wan/farsync.c
index 02f6d1cebc15..93ace042d0aa 100644
--- a/drivers/net/wan/farsync.c
+++ b/drivers/net/wan/farsync.c
@@ -882,20 +882,18 @@ fst_rx_dma_complete(struct fst_card_info *card, struct fst_port_info *port,
882 * Receive a frame through the DMA 882 * Receive a frame through the DMA
883 */ 883 */
884static inline void 884static inline void
885fst_rx_dma(struct fst_card_info *card, dma_addr_t skb, 885fst_rx_dma(struct fst_card_info *card, dma_addr_t dma, u32 mem, int len)
886 dma_addr_t mem, int len)
887{ 886{
888 /* 887 /*
889 * This routine will setup the DMA and start it 888 * This routine will setup the DMA and start it
890 */ 889 */
891 890
892 dbg(DBG_RX, "In fst_rx_dma %lx %lx %d\n", 891 dbg(DBG_RX, "In fst_rx_dma %x %x %d\n", (u32)dma, mem, len);
893 (unsigned long) skb, (unsigned long) mem, len);
894 if (card->dmarx_in_progress) { 892 if (card->dmarx_in_progress) {
895 dbg(DBG_ASS, "In fst_rx_dma while dma in progress\n"); 893 dbg(DBG_ASS, "In fst_rx_dma while dma in progress\n");
896 } 894 }
897 895
898 outl(skb, card->pci_conf + DMAPADR0); /* Copy to here */ 896 outl(dma, card->pci_conf + DMAPADR0); /* Copy to here */
899 outl(mem, card->pci_conf + DMALADR0); /* from here */ 897 outl(mem, card->pci_conf + DMALADR0); /* from here */
900 outl(len, card->pci_conf + DMASIZ0); /* for this length */ 898 outl(len, card->pci_conf + DMASIZ0); /* for this length */
901 outl(0x00000000c, card->pci_conf + DMADPR0); /* In this direction */ 899 outl(0x00000000c, card->pci_conf + DMADPR0); /* In this direction */
@@ -911,20 +909,19 @@ fst_rx_dma(struct fst_card_info *card, dma_addr_t skb,
911 * Send a frame through the DMA 909 * Send a frame through the DMA
912 */ 910 */
913static inline void 911static inline void
914fst_tx_dma(struct fst_card_info *card, unsigned char *skb, 912fst_tx_dma(struct fst_card_info *card, dma_addr_t dma, u32 mem, int len)
915 unsigned char *mem, int len)
916{ 913{
917 /* 914 /*
918 * This routine will setup the DMA and start it. 915 * This routine will setup the DMA and start it.
919 */ 916 */
920 917
921 dbg(DBG_TX, "In fst_tx_dma %p %p %d\n", skb, mem, len); 918 dbg(DBG_TX, "In fst_tx_dma %x %x %d\n", (u32)dma, mem, len);
922 if (card->dmatx_in_progress) { 919 if (card->dmatx_in_progress) {
923 dbg(DBG_ASS, "In fst_tx_dma while dma in progress\n"); 920 dbg(DBG_ASS, "In fst_tx_dma while dma in progress\n");
924 } 921 }
925 922
926 outl((unsigned long) skb, card->pci_conf + DMAPADR1); /* Copy from here */ 923 outl(dma, card->pci_conf + DMAPADR1); /* Copy from here */
927 outl((unsigned long) mem, card->pci_conf + DMALADR1); /* to here */ 924 outl(mem, card->pci_conf + DMALADR1); /* to here */
928 outl(len, card->pci_conf + DMASIZ1); /* for this length */ 925 outl(len, card->pci_conf + DMASIZ1); /* for this length */
929 outl(0x000000004, card->pci_conf + DMADPR1); /* In this direction */ 926 outl(0x000000004, card->pci_conf + DMADPR1); /* In this direction */
930 927
@@ -1401,9 +1398,7 @@ do_bottom_half_tx(struct fst_card_info *card)
1401 card->dma_len_tx = skb->len; 1398 card->dma_len_tx = skb->len;
1402 card->dma_txpos = port->txpos; 1399 card->dma_txpos = port->txpos;
1403 fst_tx_dma(card, 1400 fst_tx_dma(card,
1404 (char *) card-> 1401 card->tx_dma_handle_card,
1405 tx_dma_handle_card,
1406 (char *)
1407 BUF_OFFSET(txBuffer[pi] 1402 BUF_OFFSET(txBuffer[pi]
1408 [port->txpos][0]), 1403 [port->txpos][0]),
1409 skb->len); 1404 skb->len);