Lines Matching refs:buffer_info
860 struct atl1c_buffer *buffer_info) in atl1c_clean_buffer() argument
863 if (buffer_info->flags & ATL1C_BUFFER_FREE) in atl1c_clean_buffer()
865 if (buffer_info->dma) { in atl1c_clean_buffer()
866 if (buffer_info->flags & ATL1C_PCIMAP_FROMDEVICE) in atl1c_clean_buffer()
871 if (buffer_info->flags & ATL1C_PCIMAP_SINGLE) in atl1c_clean_buffer()
872 dma_unmap_single(&pdev->dev, buffer_info->dma, in atl1c_clean_buffer()
873 buffer_info->length, pci_driection); in atl1c_clean_buffer()
874 else if (buffer_info->flags & ATL1C_PCIMAP_PAGE) in atl1c_clean_buffer()
875 dma_unmap_page(&pdev->dev, buffer_info->dma, in atl1c_clean_buffer()
876 buffer_info->length, pci_driection); in atl1c_clean_buffer()
878 if (buffer_info->skb) in atl1c_clean_buffer()
879 dev_consume_skb_any(buffer_info->skb); in atl1c_clean_buffer()
880 buffer_info->dma = 0; in atl1c_clean_buffer()
881 buffer_info->skb = NULL; in atl1c_clean_buffer()
882 ATL1C_SET_BUFFER_STATE(buffer_info, ATL1C_BUFFER_FREE); in atl1c_clean_buffer()
893 struct atl1c_buffer *buffer_info; in atl1c_clean_tx_ring() local
899 buffer_info = &tpd_ring->buffer_info[index]; in atl1c_clean_tx_ring()
900 atl1c_clean_buffer(pdev, buffer_info); in atl1c_clean_tx_ring()
921 struct atl1c_buffer *buffer_info; in atl1c_clean_rx_ring() local
926 buffer_info = &rfd_ring->buffer_info[j]; in atl1c_clean_rx_ring()
927 atl1c_clean_buffer(pdev, buffer_info); in atl1c_clean_rx_ring()
945 struct atl1c_buffer *buffer_info; in atl1c_init_ring_ptrs() local
951 buffer_info = tpd_ring[i].buffer_info; in atl1c_init_ring_ptrs()
953 ATL1C_SET_BUFFER_STATE(&buffer_info[i], in atl1c_init_ring_ptrs()
962 buffer_info = &rfd_ring[i].buffer_info[j]; in atl1c_init_ring_ptrs()
963 ATL1C_SET_BUFFER_STATE(buffer_info, ATL1C_BUFFER_FREE); in atl1c_init_ring_ptrs()
986 if (adapter->tpd_ring[0].buffer_info) { in atl1c_free_ring_resources()
987 kfree(adapter->tpd_ring[0].buffer_info); in atl1c_free_ring_resources()
988 adapter->tpd_ring[0].buffer_info = NULL; in atl1c_free_ring_resources()
1029 tpd_ring->buffer_info = kzalloc(size, GFP_KERNEL); in atl1c_setup_ring_resources()
1030 if (unlikely(!tpd_ring->buffer_info)) in atl1c_setup_ring_resources()
1036 tpd_ring[i].buffer_info = (tpd_ring->buffer_info + count); in atl1c_setup_ring_resources()
1045 rfd_ring[i].buffer_info = (tpd_ring->buffer_info + count); in atl1c_setup_ring_resources()
1096 kfree(tpd_ring->buffer_info); in atl1c_setup_ring_resources()
1616 struct atl1c_buffer *buffer_info; in atl1c_clean_tx() local
1627 buffer_info = &tpd_ring->buffer_info[next_to_clean]; in atl1c_clean_tx()
1628 if (buffer_info->skb) { in atl1c_clean_tx()
1629 total_bytes += buffer_info->skb->len; in atl1c_clean_tx()
1632 atl1c_clean_buffer(pdev, buffer_info); in atl1c_clean_tx()
1810 struct atl1c_buffer *buffer_info, *next_info; in atl1c_alloc_rx_buffer() local
1821 buffer_info = &rfd_ring->buffer_info[rfd_next_to_use]; in atl1c_alloc_rx_buffer()
1822 next_info = &rfd_ring->buffer_info[next_next]; in atl1c_alloc_rx_buffer()
1840 ATL1C_SET_BUFFER_STATE(buffer_info, ATL1C_BUFFER_BUSY); in atl1c_alloc_rx_buffer()
1841 buffer_info->skb = skb; in atl1c_alloc_rx_buffer()
1842 buffer_info->length = adapter->rx_buffer_len; in atl1c_alloc_rx_buffer()
1844 buffer_info->length, DMA_FROM_DEVICE); in atl1c_alloc_rx_buffer()
1847 buffer_info->skb = NULL; in atl1c_alloc_rx_buffer()
1848 buffer_info->length = 0; in atl1c_alloc_rx_buffer()
1849 ATL1C_SET_BUFFER_STATE(buffer_info, ATL1C_BUFFER_FREE); in atl1c_alloc_rx_buffer()
1853 buffer_info->dma = mapping; in atl1c_alloc_rx_buffer()
1854 ATL1C_SET_PCIMAP_TYPE(buffer_info, ATL1C_PCIMAP_SINGLE, in atl1c_alloc_rx_buffer()
1856 rfd_desc->buffer_addr = cpu_to_le64(buffer_info->dma); in atl1c_alloc_rx_buffer()
1860 buffer_info = &rfd_ring->buffer_info[rfd_next_to_use]; in atl1c_alloc_rx_buffer()
1861 next_info = &rfd_ring->buffer_info[next_next]; in atl1c_alloc_rx_buffer()
1894 struct atl1c_buffer *buffer_info = rfd_ring->buffer_info; in atl1c_clean_rfd() local
1899 buffer_info[rfd_index].skb = NULL; in atl1c_clean_rfd()
1900 ATL1C_SET_BUFFER_STATE(&buffer_info[rfd_index], in atl1c_clean_rfd()
1925 struct atl1c_buffer *buffer_info; in atl1c_clean_rx() local
1966 buffer_info = &rfd_ring->buffer_info[rfd_index]; in atl1c_clean_rx()
1967 dma_unmap_single(&pdev->dev, buffer_info->dma, in atl1c_clean_rx()
1968 buffer_info->length, DMA_FROM_DEVICE); in atl1c_clean_rx()
1969 skb = buffer_info->skb; in atl1c_clean_rx()
2062 return &tpd_ring->buffer_info[tpd - in atl1c_get_tx_buffer()
2187 struct atl1c_buffer *buffer_info; in atl1c_tx_rollback() local
2195 buffer_info = &tpd_ring->buffer_info[index]; in atl1c_tx_rollback()
2196 atl1c_clean_buffer(adpt->pdev, buffer_info); in atl1c_tx_rollback()
2209 struct atl1c_buffer *buffer_info = NULL; in atl1c_tx_map() local
2226 buffer_info = atl1c_get_tx_buffer(adapter, use_tpd); in atl1c_tx_map()
2227 buffer_info->length = map_len; in atl1c_tx_map()
2228 buffer_info->dma = dma_map_single(&adapter->pdev->dev, in atl1c_tx_map()
2231 if (unlikely(dma_mapping_error(&adapter->pdev->dev, buffer_info->dma))) in atl1c_tx_map()
2233 ATL1C_SET_BUFFER_STATE(buffer_info, ATL1C_BUFFER_BUSY); in atl1c_tx_map()
2234 ATL1C_SET_PCIMAP_TYPE(buffer_info, ATL1C_PCIMAP_SINGLE, in atl1c_tx_map()
2237 use_tpd->buffer_addr = cpu_to_le64(buffer_info->dma); in atl1c_tx_map()
2238 use_tpd->buffer_len = cpu_to_le16(buffer_info->length); in atl1c_tx_map()
2250 buffer_info = atl1c_get_tx_buffer(adapter, use_tpd); in atl1c_tx_map()
2251 buffer_info->length = buf_len - mapped_len; in atl1c_tx_map()
2252 buffer_info->dma = in atl1c_tx_map()
2255 buffer_info->length, DMA_TO_DEVICE); in atl1c_tx_map()
2256 if (unlikely(dma_mapping_error(&adapter->pdev->dev, buffer_info->dma))) in atl1c_tx_map()
2259 ATL1C_SET_BUFFER_STATE(buffer_info, ATL1C_BUFFER_BUSY); in atl1c_tx_map()
2260 ATL1C_SET_PCIMAP_TYPE(buffer_info, ATL1C_PCIMAP_SINGLE, in atl1c_tx_map()
2262 use_tpd->buffer_addr = cpu_to_le64(buffer_info->dma); in atl1c_tx_map()
2263 use_tpd->buffer_len = cpu_to_le16(buffer_info->length); in atl1c_tx_map()
2272 buffer_info = atl1c_get_tx_buffer(adapter, use_tpd); in atl1c_tx_map()
2273 buffer_info->length = skb_frag_size(frag); in atl1c_tx_map()
2274 buffer_info->dma = skb_frag_dma_map(&adapter->pdev->dev, in atl1c_tx_map()
2276 buffer_info->length, in atl1c_tx_map()
2278 if (dma_mapping_error(&adapter->pdev->dev, buffer_info->dma)) in atl1c_tx_map()
2281 ATL1C_SET_BUFFER_STATE(buffer_info, ATL1C_BUFFER_BUSY); in atl1c_tx_map()
2282 ATL1C_SET_PCIMAP_TYPE(buffer_info, ATL1C_PCIMAP_PAGE, in atl1c_tx_map()
2284 use_tpd->buffer_addr = cpu_to_le64(buffer_info->dma); in atl1c_tx_map()
2285 use_tpd->buffer_len = cpu_to_le16(buffer_info->length); in atl1c_tx_map()
2292 buffer_info->skb = skb; in atl1c_tx_map()
2297 buffer_info->dma = 0; in atl1c_tx_map()
2298 buffer_info->length = 0; in atl1c_tx_map()