Lines Matching refs:re
1165 struct rx_ring_info *re; in sky2_get_rx_data_size() local
1172 BUG_ON(sky2->rx_nfrags > ARRAY_SIZE(re->frag_addr)); in sky2_get_rx_data_size()
1206 const struct rx_ring_info *re) in sky2_rx_submit() argument
1210 sky2_rx_add(sky2, OP_PACKET, re->data_addr, sky2->rx_data_size); in sky2_rx_submit()
1212 for (i = 0; i < skb_shinfo(re->skb)->nr_frags; i++) in sky2_rx_submit()
1213 sky2_rx_add(sky2, OP_BUFFER, re->frag_addr[i], PAGE_SIZE); in sky2_rx_submit()
1217 static int sky2_rx_map_skb(struct pci_dev *pdev, struct rx_ring_info *re, in sky2_rx_map_skb() argument
1220 struct sk_buff *skb = re->skb; in sky2_rx_map_skb()
1223 re->data_addr = pci_map_single(pdev, skb->data, size, PCI_DMA_FROMDEVICE); in sky2_rx_map_skb()
1224 if (pci_dma_mapping_error(pdev, re->data_addr)) in sky2_rx_map_skb()
1227 dma_unmap_len_set(re, data_size, size); in sky2_rx_map_skb()
1232 re->frag_addr[i] = skb_frag_dma_map(&pdev->dev, frag, 0, in sky2_rx_map_skb()
1236 if (dma_mapping_error(&pdev->dev, re->frag_addr[i])) in sky2_rx_map_skb()
1243 pci_unmap_page(pdev, re->frag_addr[i], in sky2_rx_map_skb()
1248 pci_unmap_single(pdev, re->data_addr, dma_unmap_len(re, data_size), in sky2_rx_map_skb()
1258 static void sky2_rx_unmap_skb(struct pci_dev *pdev, struct rx_ring_info *re) in sky2_rx_unmap_skb() argument
1260 struct sk_buff *skb = re->skb; in sky2_rx_unmap_skb()
1263 pci_unmap_single(pdev, re->data_addr, dma_unmap_len(re, data_size), in sky2_rx_unmap_skb()
1267 pci_unmap_page(pdev, re->frag_addr[i], in sky2_rx_unmap_skb()
1368 struct rx_ring_info *re = sky2->rx_ring + i; in sky2_rx_clean() local
1370 if (re->skb) { in sky2_rx_clean()
1371 sky2_rx_unmap_skb(sky2->hw->pdev, re); in sky2_rx_clean()
1372 kfree_skb(re->skb); in sky2_rx_clean()
1373 re->skb = NULL; in sky2_rx_clean()
1507 struct rx_ring_info *re = sky2->rx_ring + i; in sky2_alloc_rx_skbs() local
1509 re->skb = sky2_rx_alloc(sky2, GFP_KERNEL); in sky2_alloc_rx_skbs()
1510 if (!re->skb) in sky2_alloc_rx_skbs()
1513 if (sky2_rx_map_skb(hw->pdev, re, sky2->rx_data_size)) { in sky2_alloc_rx_skbs()
1514 dev_kfree_skb(re->skb); in sky2_alloc_rx_skbs()
1515 re->skb = NULL; in sky2_alloc_rx_skbs()
1534 struct rx_ring_info *re; in sky2_rx_start() local
1561 re = sky2->rx_ring + i; in sky2_rx_start()
1562 sky2_rx_submit(sky2, re); in sky2_rx_start()
1822 static void sky2_tx_unmap(struct pci_dev *pdev, struct tx_ring_info *re) in sky2_tx_unmap() argument
1824 if (re->flags & TX_MAP_SINGLE) in sky2_tx_unmap()
1825 pci_unmap_single(pdev, dma_unmap_addr(re, mapaddr), in sky2_tx_unmap()
1826 dma_unmap_len(re, maplen), in sky2_tx_unmap()
1828 else if (re->flags & TX_MAP_PAGE) in sky2_tx_unmap()
1829 pci_unmap_page(pdev, dma_unmap_addr(re, mapaddr), in sky2_tx_unmap()
1830 dma_unmap_len(re, maplen), in sky2_tx_unmap()
1832 re->flags = 0; in sky2_tx_unmap()
1847 struct tx_ring_info *re; in sky2_xmit_frame() local
1938 re = sky2->tx_ring + slot; in sky2_xmit_frame()
1939 re->flags = TX_MAP_SINGLE; in sky2_xmit_frame()
1940 dma_unmap_addr_set(re, mapaddr, mapping); in sky2_xmit_frame()
1941 dma_unmap_len_set(re, maplen, len); in sky2_xmit_frame()
1967 re = sky2->tx_ring + slot; in sky2_xmit_frame()
1968 re->flags = TX_MAP_PAGE; in sky2_xmit_frame()
1969 dma_unmap_addr_set(re, mapaddr, mapping); in sky2_xmit_frame()
1970 dma_unmap_len_set(re, maplen, skb_frag_size(frag)); in sky2_xmit_frame()
1979 re->skb = skb; in sky2_xmit_frame()
1994 re = sky2->tx_ring + i; in sky2_xmit_frame()
1996 sky2_tx_unmap(hw->pdev, re); in sky2_xmit_frame()
2026 struct tx_ring_info *re = sky2->tx_ring + idx; in sky2_tx_complete() local
2027 struct sk_buff *skb = re->skb; in sky2_tx_complete()
2029 sky2_tx_unmap(sky2->hw->pdev, re); in sky2_tx_complete()
2038 re->skb = NULL; in sky2_tx_complete()
2472 static inline bool needs_copy(const struct rx_ring_info *re, in needs_copy() argument
2477 if (!IS_ALIGNED(re->data_addr + ETH_HLEN, sizeof(u32))) in needs_copy()
2485 const struct rx_ring_info *re, in receive_copy() argument
2492 pci_dma_sync_single_for_cpu(sky2->hw->pdev, re->data_addr, in receive_copy()
2494 skb_copy_from_linear_data(re->skb, skb->data, length); in receive_copy()
2495 skb->ip_summed = re->skb->ip_summed; in receive_copy()
2496 skb->csum = re->skb->csum; in receive_copy()
2497 skb->rxhash = re->skb->rxhash; in receive_copy()
2498 skb->vlan_tci = re->skb->vlan_tci; in receive_copy()
2500 pci_dma_sync_single_for_device(sky2->hw->pdev, re->data_addr, in receive_copy()
2502 re->skb->vlan_tci = 0; in receive_copy()
2503 re->skb->rxhash = 0; in receive_copy()
2504 re->skb->ip_summed = CHECKSUM_NONE; in receive_copy()
2545 struct rx_ring_info *re, in receive_new() argument
2559 skb = re->skb; in receive_new()
2560 sky2_rx_unmap_skb(sky2->hw->pdev, re); in receive_new()
2562 *re = nre; in receive_new()
2584 struct rx_ring_info *re = sky2->rx_ring + sky2->rx_next; in sky2_receive() local
2595 if (vlan_tx_tag_present(re->skb)) in sky2_receive()
2618 if (needs_copy(re, length)) in sky2_receive()
2619 skb = receive_copy(sky2, re, length); in sky2_receive()
2621 skb = receive_new(sky2, re, length); in sky2_receive()
2626 sky2_rx_submit(sky2, re); in sky2_receive()