cassini.c (5d6bcdfe38ce883946aebf751a64695471ce1ab5) | cassini.c (9e903e085262ffbf1fc44a17ac06058aca03524a) |
---|---|
1/* cassini.c: Sun Microsystems Cassini(+) ethernet driver. 2 * 3 * Copyright (C) 2004 Sun Microsystems Inc. 4 * Copyright (C) 2003 Adrian Sun (asun@darksunrising.com) 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License as 8 * published by the Free Software Foundation; either version 2 of the --- 2037 unchanged lines hidden (view full) --- 2046 skb_shinfo(skb)->nr_frags++; 2047 skb->data_len += hlen - swivel; 2048 skb->truesize += hlen - swivel; 2049 skb->len += hlen - swivel; 2050 2051 __skb_frag_set_page(frag, page->buffer); 2052 __skb_frag_ref(frag); 2053 frag->page_offset = off; | 1/* cassini.c: Sun Microsystems Cassini(+) ethernet driver. 2 * 3 * Copyright (C) 2004 Sun Microsystems Inc. 4 * Copyright (C) 2003 Adrian Sun (asun@darksunrising.com) 5 * 6 * This program is free software; you can redistribute it and/or 7 * modify it under the terms of the GNU General Public License as 8 * published by the Free Software Foundation; either version 2 of the --- 2037 unchanged lines hidden (view full) --- 2046 skb_shinfo(skb)->nr_frags++; 2047 skb->data_len += hlen - swivel; 2048 skb->truesize += hlen - swivel; 2049 skb->len += hlen - swivel; 2050 2051 __skb_frag_set_page(frag, page->buffer); 2052 __skb_frag_ref(frag); 2053 frag->page_offset = off; |
2054 frag->size = hlen - swivel; | 2054 skb_frag_size_set(frag, hlen - swivel); |
2055 2056 /* any more data? */ 2057 if ((words[0] & RX_COMP1_SPLIT_PKT) && ((dlen -= hlen) > 0)) { 2058 hlen = dlen; 2059 off = 0; 2060 2061 i = CAS_VAL(RX_COMP2_NEXT_INDEX, words[1]); 2062 page = cp->rx_pages[CAS_VAL(RX_INDEX_RING, i)][CAS_VAL(RX_INDEX_NUM, i)]; --- 7 unchanged lines hidden (view full) --- 2070 skb_shinfo(skb)->nr_frags++; 2071 skb->data_len += hlen; 2072 skb->len += hlen; 2073 frag++; 2074 2075 __skb_frag_set_page(frag, page->buffer); 2076 __skb_frag_ref(frag); 2077 frag->page_offset = 0; | 2055 2056 /* any more data? */ 2057 if ((words[0] & RX_COMP1_SPLIT_PKT) && ((dlen -= hlen) > 0)) { 2058 hlen = dlen; 2059 off = 0; 2060 2061 i = CAS_VAL(RX_COMP2_NEXT_INDEX, words[1]); 2062 page = cp->rx_pages[CAS_VAL(RX_INDEX_RING, i)][CAS_VAL(RX_INDEX_NUM, i)]; --- 7 unchanged lines hidden (view full) --- 2070 skb_shinfo(skb)->nr_frags++; 2071 skb->data_len += hlen; 2072 skb->len += hlen; 2073 frag++; 2074 2075 __skb_frag_set_page(frag, page->buffer); 2076 __skb_frag_ref(frag); 2077 frag->page_offset = 0; |
2078 frag->size = hlen; | 2078 skb_frag_size_set(frag, hlen); |
2079 RX_USED_ADD(page, hlen + cp->crc_size); 2080 } 2081 2082 if (cp->crc_size) { 2083 addr = cas_page_map(page->buffer); 2084 crcaddr = addr + off + hlen; 2085 } 2086 --- 734 unchanged lines hidden (view full) --- 2821 (nr_frags == 0)); 2822 } else { 2823 cas_write_txd(cp, ring, entry, mapping, len, ctrl | 2824 TX_DESC_SOF, (nr_frags == 0)); 2825 } 2826 entry = TX_DESC_NEXT(ring, entry); 2827 2828 for (frag = 0; frag < nr_frags; frag++) { | 2079 RX_USED_ADD(page, hlen + cp->crc_size); 2080 } 2081 2082 if (cp->crc_size) { 2083 addr = cas_page_map(page->buffer); 2084 crcaddr = addr + off + hlen; 2085 } 2086 --- 734 unchanged lines hidden (view full) --- 2821 (nr_frags == 0)); 2822 } else { 2823 cas_write_txd(cp, ring, entry, mapping, len, ctrl | 2824 TX_DESC_SOF, (nr_frags == 0)); 2825 } 2826 entry = TX_DESC_NEXT(ring, entry); 2827 2828 for (frag = 0; frag < nr_frags; frag++) { |
2829 skb_frag_t *fragp = &skb_shinfo(skb)->frags[frag]; | 2829 const skb_frag_t *fragp = &skb_shinfo(skb)->frags[frag]; |
2830 | 2830 |
2831 len = fragp->size; | 2831 len = skb_frag_size(fragp); |
2832 mapping = skb_frag_dma_map(&cp->pdev->dev, fragp, 0, len, 2833 DMA_TO_DEVICE); 2834 2835 tabort = cas_calc_tabort(cp, fragp->page_offset, len); 2836 if (unlikely(tabort)) { 2837 void *addr; 2838 2839 /* NOTE: len is always > tabort */ --- 2464 unchanged lines hidden --- | 2832 mapping = skb_frag_dma_map(&cp->pdev->dev, fragp, 0, len, 2833 DMA_TO_DEVICE); 2834 2835 tabort = cas_calc_tabort(cp, fragp->page_offset, len); 2836 if (unlikely(tabort)) { 2837 void *addr; 2838 2839 /* NOTE: len is always > tabort */ --- 2464 unchanged lines hidden --- |