]> err.no Git - linux-2.6/commitdiff
sungem endianness annotations\e
authorAl Viro <viro@ftp.linux.org.uk>
Mon, 17 Dec 2007 06:48:04 +0000 (06:48 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 28 Jan 2008 23:07:10 +0000 (15:07 -0800)
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
drivers/net/sungem.c
drivers/net/sungem.h

index 68872142530b5e5a7807157c0b8e539494e62a1b..467d80dc3b335590549978861fc15156a6e99ab7 100644 (file)
@@ -758,6 +758,7 @@ static int gem_rx(struct gem *gp, int work_to_do)
 {
        int entry, drops, work_done = 0;
        u32 done;
+       __sum16 csum;
 
        if (netif_msg_rx_status(gp))
                printk(KERN_DEBUG "%s: rx interrupt, done: %d, rx_new: %d\n",
@@ -769,7 +770,7 @@ static int gem_rx(struct gem *gp, int work_to_do)
        for (;;) {
                struct gem_rxd *rxd = &gp->init_block->rxd[entry];
                struct sk_buff *skb;
-               u64 status = cpu_to_le64(rxd->status_word);
+               u64 status = le64_to_cpu(rxd->status_word);
                dma_addr_t dma_addr;
                int len;
 
@@ -811,7 +812,7 @@ static int gem_rx(struct gem *gp, int work_to_do)
                        goto next;
                }
 
-               dma_addr = cpu_to_le64(rxd->buffer);
+               dma_addr = le64_to_cpu(rxd->buffer);
                if (len > RX_COPY_THRESHOLD) {
                        struct sk_buff *new_skb;
 
@@ -853,7 +854,8 @@ static int gem_rx(struct gem *gp, int work_to_do)
                        skb = copy_skb;
                }
 
-               skb->csum = ntohs((status & RXDCTRL_TCPCSUM) ^ 0xffff);
+               csum = (__force __sum16)htons((status & RXDCTRL_TCPCSUM) ^ 0xffff);
+               skb->csum = csum_unfold(csum);
                skb->ip_summed = CHECKSUM_COMPLETE;
                skb->protocol = eth_type_trans(skb, gp->dev);
 
index 76d760acc9e27e737bb9ed6a2f887e1e42005bc3..f7a02917ce5ec31fb1735c144cb30a48665e7615 100644 (file)
  * DMA mappings for a transmitted packet.
  */
 struct gem_txd {
-       u64     control_word;
-       u64     buffer;
+       __le64  control_word;
+       __le64  buffer;
 };
 
 #define TXDCTRL_BUFSZ  0x0000000000007fffULL   /* Buffer Size          */
@@ -863,8 +863,8 @@ struct gem_txd {
  * by the host driver just as in the TX descriptor case above.
  */
 struct gem_rxd {
-       u64     status_word;
-       u64     buffer;
+       __le64  status_word;
+       __le64  buffer;
 };
 
 #define RXDCTRL_TCPCSUM        0x000000000000ffffULL   /* TCP Pseudo-CSUM      */