aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/typhoon.c
diff options
context:
space:
mode:
authorAl Viro <viro@ftp.linux.org.uk>2007-12-21 01:21:14 -0500
committerJeff Garzik <jeff@garzik.org>2007-12-22 22:53:06 -0500
commit71f1bb1a8f17db3caba1237dfd478c2a13faf63e (patch)
tree75b0060d7c93e4438f9fe1098109dc94c517e48f /drivers/net/typhoon.c
parent8cc085c7aceb78d26d0a5355e111b2330f089161 (diff)
typhoon: trivial endianness annotations
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/net/typhoon.c')
-rw-r--r--drivers/net/typhoon.c31
1 files changed, 15 insertions, 16 deletions
diff --git a/drivers/net/typhoon.c b/drivers/net/typhoon.c
index 2550d4cf9609..f50cb520dffb 100644
--- a/drivers/net/typhoon.c
+++ b/drivers/net/typhoon.c
@@ -813,8 +813,7 @@ typhoon_start_tx(struct sk_buff *skb, struct net_device *dev)
813 first_txd->flags = TYPHOON_TX_DESC | TYPHOON_DESC_VALID; 813 first_txd->flags = TYPHOON_TX_DESC | TYPHOON_DESC_VALID;
814 first_txd->numDesc = 0; 814 first_txd->numDesc = 0;
815 first_txd->len = 0; 815 first_txd->len = 0;
816 first_txd->addr = (u64)((unsigned long) skb) & 0xffffffff; 816 first_txd->tx_addr = (u64)((unsigned long) skb);
817 first_txd->addrHi = (u64)((unsigned long) skb) >> 32;
818 first_txd->processFlags = 0; 817 first_txd->processFlags = 0;
819 818
820 if(skb->ip_summed == CHECKSUM_PARTIAL) { 819 if(skb->ip_summed == CHECKSUM_PARTIAL) {
@@ -850,8 +849,8 @@ typhoon_start_tx(struct sk_buff *skb, struct net_device *dev)
850 PCI_DMA_TODEVICE); 849 PCI_DMA_TODEVICE);
851 txd->flags = TYPHOON_FRAG_DESC | TYPHOON_DESC_VALID; 850 txd->flags = TYPHOON_FRAG_DESC | TYPHOON_DESC_VALID;
852 txd->len = cpu_to_le16(skb->len); 851 txd->len = cpu_to_le16(skb->len);
853 txd->addr = cpu_to_le32(skb_dma); 852 txd->frag.addr = cpu_to_le32(skb_dma);
854 txd->addrHi = 0; 853 txd->frag.addrHi = 0;
855 first_txd->numDesc++; 854 first_txd->numDesc++;
856 } else { 855 } else {
857 int i, len; 856 int i, len;
@@ -861,8 +860,8 @@ typhoon_start_tx(struct sk_buff *skb, struct net_device *dev)
861 PCI_DMA_TODEVICE); 860 PCI_DMA_TODEVICE);
862 txd->flags = TYPHOON_FRAG_DESC | TYPHOON_DESC_VALID; 861 txd->flags = TYPHOON_FRAG_DESC | TYPHOON_DESC_VALID;
863 txd->len = cpu_to_le16(len); 862 txd->len = cpu_to_le16(len);
864 txd->addr = cpu_to_le32(skb_dma); 863 txd->frag.addr = cpu_to_le32(skb_dma);
865 txd->addrHi = 0; 864 txd->frag.addrHi = 0;
866 first_txd->numDesc++; 865 first_txd->numDesc++;
867 866
868 for(i = 0; i < skb_shinfo(skb)->nr_frags; i++) { 867 for(i = 0; i < skb_shinfo(skb)->nr_frags; i++) {
@@ -880,8 +879,8 @@ typhoon_start_tx(struct sk_buff *skb, struct net_device *dev)
880 PCI_DMA_TODEVICE); 879 PCI_DMA_TODEVICE);
881 txd->flags = TYPHOON_FRAG_DESC | TYPHOON_DESC_VALID; 880 txd->flags = TYPHOON_FRAG_DESC | TYPHOON_DESC_VALID;
882 txd->len = cpu_to_le16(len); 881 txd->len = cpu_to_le16(len);
883 txd->addr = cpu_to_le32(skb_dma); 882 txd->frag.addr = cpu_to_le32(skb_dma);
884 txd->addrHi = 0; 883 txd->frag.addrHi = 0;
885 first_txd->numDesc++; 884 first_txd->numDesc++;
886 } 885 }
887 } 886 }
@@ -1358,7 +1357,7 @@ typhoon_download_firmware(struct typhoon *tp)
1358 u8 *image_data; 1357 u8 *image_data;
1359 void *dpage; 1358 void *dpage;
1360 dma_addr_t dpage_dma; 1359 dma_addr_t dpage_dma;
1361 unsigned int csum; 1360 __sum16 csum;
1362 u32 irqEnabled; 1361 u32 irqEnabled;
1363 u32 irqMasked; 1362 u32 irqMasked;
1364 u32 numSections; 1363 u32 numSections;
@@ -1450,13 +1449,13 @@ typhoon_download_firmware(struct typhoon *tp)
1450 * summing. Fortunately, due to the properties of 1449 * summing. Fortunately, due to the properties of
1451 * the checksum, we can do this once, at the end. 1450 * the checksum, we can do this once, at the end.
1452 */ 1451 */
1453 csum = csum_partial_copy_nocheck(image_data, dpage, 1452 csum = csum_fold(csum_partial_copy_nocheck(image_data,
1454 len, 0); 1453 dpage, len,
1455 csum = csum_fold(csum); 1454 0));
1456 csum = le16_to_cpu(csum);
1457 1455
1458 iowrite32(len, ioaddr + TYPHOON_REG_BOOT_LENGTH); 1456 iowrite32(len, ioaddr + TYPHOON_REG_BOOT_LENGTH);
1459 iowrite32(csum, ioaddr + TYPHOON_REG_BOOT_CHECKSUM); 1457 iowrite32(le16_to_cpu((__force __le16)csum),
1458 ioaddr + TYPHOON_REG_BOOT_CHECKSUM);
1460 iowrite32(load_addr, 1459 iowrite32(load_addr,
1461 ioaddr + TYPHOON_REG_BOOT_DEST_ADDR); 1460 ioaddr + TYPHOON_REG_BOOT_DEST_ADDR);
1462 iowrite32(0, ioaddr + TYPHOON_REG_BOOT_DATA_HI); 1461 iowrite32(0, ioaddr + TYPHOON_REG_BOOT_DATA_HI);
@@ -1551,13 +1550,13 @@ typhoon_clean_tx(struct typhoon *tp, struct transmit_ring *txRing,
1551 if(type == TYPHOON_TX_DESC) { 1550 if(type == TYPHOON_TX_DESC) {
1552 /* This tx_desc describes a packet. 1551 /* This tx_desc describes a packet.
1553 */ 1552 */
1554 unsigned long ptr = tx->addr | ((u64)tx->addrHi << 32); 1553 unsigned long ptr = tx->tx_addr;
1555 struct sk_buff *skb = (struct sk_buff *) ptr; 1554 struct sk_buff *skb = (struct sk_buff *) ptr;
1556 dev_kfree_skb_irq(skb); 1555 dev_kfree_skb_irq(skb);
1557 } else if(type == TYPHOON_FRAG_DESC) { 1556 } else if(type == TYPHOON_FRAG_DESC) {
1558 /* This tx_desc describes a memory mapping. Free it. 1557 /* This tx_desc describes a memory mapping. Free it.
1559 */ 1558 */
1560 skb_dma = (dma_addr_t) le32_to_cpu(tx->addr); 1559 skb_dma = (dma_addr_t) le32_to_cpu(tx->frag.addr);
1561 dma_len = le16_to_cpu(tx->len); 1560 dma_len = le16_to_cpu(tx->len);
1562 pci_unmap_single(tp->pdev, skb_dma, dma_len, 1561 pci_unmap_single(tp->pdev, skb_dma, dma_len,
1563 PCI_DMA_TODEVICE); 1562 PCI_DMA_TODEVICE);