Lines Matching refs:descr

279 	struct spider_net_descr *descr;  in spider_net_free_chain()  local
281 descr = chain->ring; in spider_net_free_chain()
283 descr->bus_addr = 0; in spider_net_free_chain()
284 descr->hwdescr->next_descr_addr = 0; in spider_net_free_chain()
285 descr = descr->next; in spider_net_free_chain()
286 } while (descr != chain->ring); in spider_net_free_chain()
307 struct spider_net_descr *descr; in spider_net_init_chain() local
320 descr = chain->ring; in spider_net_init_chain()
323 for (i=0; i < chain->num_desc; i++, descr++, hwdescr++) { in spider_net_init_chain()
327 descr->hwdescr = hwdescr; in spider_net_init_chain()
328 descr->bus_addr = buf; in spider_net_init_chain()
329 descr->next = descr + 1; in spider_net_init_chain()
330 descr->prev = descr - 1; in spider_net_init_chain()
335 (descr-1)->next = chain->ring; in spider_net_init_chain()
336 chain->ring->prev = descr-1; in spider_net_init_chain()
353 struct spider_net_descr *descr; in spider_net_free_rx_chain_contents() local
355 descr = card->rx_chain.head; in spider_net_free_rx_chain_contents()
357 if (descr->skb) { in spider_net_free_rx_chain_contents()
359 descr->hwdescr->buf_addr, in spider_net_free_rx_chain_contents()
362 dev_kfree_skb(descr->skb); in spider_net_free_rx_chain_contents()
363 descr->skb = NULL; in spider_net_free_rx_chain_contents()
365 descr = descr->next; in spider_net_free_rx_chain_contents()
366 } while (descr != card->rx_chain.head); in spider_net_free_rx_chain_contents()
381 struct spider_net_descr *descr) in spider_net_prepare_rx_descr() argument
383 struct spider_net_hw_descr *hwdescr = descr->hwdescr; in spider_net_prepare_rx_descr()
396 descr->skb = netdev_alloc_skb(card->netdev, in spider_net_prepare_rx_descr()
398 if (!descr->skb) { in spider_net_prepare_rx_descr()
411 offset = ((unsigned long)descr->skb->data) & in spider_net_prepare_rx_descr()
414 skb_reserve(descr->skb, SPIDER_NET_RXBUF_ALIGN - offset); in spider_net_prepare_rx_descr()
416 buf = dma_map_single(&card->pdev->dev, descr->skb->data, in spider_net_prepare_rx_descr()
419 dev_kfree_skb_any(descr->skb); in spider_net_prepare_rx_descr()
420 descr->skb = NULL; in spider_net_prepare_rx_descr()
521 struct spider_net_descr *descr = start; in spider_net_alloc_rx_skbs() local
525 descr->prev->hwdescr->next_descr_addr = descr->bus_addr; in spider_net_alloc_rx_skbs()
526 descr = descr->next; in spider_net_alloc_rx_skbs()
527 } while (descr != start); in spider_net_alloc_rx_skbs()
653 struct spider_net_descr *descr; in spider_net_prepare_tx_descr() local
669 descr = card->tx_chain.head; in spider_net_prepare_tx_descr()
670 if (descr->next == chain->tail->prev) { in spider_net_prepare_tx_descr()
676 hwdescr = descr->hwdescr; in spider_net_prepare_tx_descr()
677 chain->head = descr->next; in spider_net_prepare_tx_descr()
679 descr->skb = skb; in spider_net_prepare_tx_descr()
701 descr->prev->hwdescr->next_descr_addr = descr->bus_addr; in spider_net_prepare_tx_descr()
710 struct spider_net_descr *descr = card->tx_chain.tail; in spider_net_set_low_watermark() local
720 while (descr != card->tx_chain.head) { in spider_net_set_low_watermark()
721 status = descr->hwdescr->dmac_cmd_status & SPIDER_NET_DESCR_NOT_IN_USE; in spider_net_set_low_watermark()
724 descr = descr->next; in spider_net_set_low_watermark()
733 descr = card->tx_chain.tail; in spider_net_set_low_watermark()
736 descr = descr->next; in spider_net_set_low_watermark()
740 descr->hwdescr->dmac_cmd_status |= SPIDER_NET_DESCR_TXDESFLG; in spider_net_set_low_watermark()
741 if (card->low_watermark && card->low_watermark != descr) { in spider_net_set_low_watermark()
746 card->low_watermark = descr; in spider_net_set_low_watermark()
768 struct spider_net_descr *descr; in spider_net_release_tx_chain() local
781 descr = chain->tail; in spider_net_release_tx_chain()
782 hwdescr = descr->hwdescr; in spider_net_release_tx_chain()
788 dev->stats.tx_bytes += descr->skb->len; in spider_net_release_tx_chain()
820 chain->tail = descr->next; in spider_net_release_tx_chain()
822 skb = descr->skb; in spider_net_release_tx_chain()
823 descr->skb = NULL; in spider_net_release_tx_chain()
851 struct spider_net_descr *descr; in spider_net_kick_tx_dma() local
857 descr = card->tx_chain.tail; in spider_net_kick_tx_dma()
859 if (spider_net_get_descr_status(descr->hwdescr) == in spider_net_kick_tx_dma()
862 descr->bus_addr); in spider_net_kick_tx_dma()
867 if (descr == card->tx_chain.head) in spider_net_kick_tx_dma()
869 descr = descr->next; in spider_net_kick_tx_dma()
950 spider_net_pass_skb_up(struct spider_net_descr *descr, in spider_net_pass_skb_up() argument
953 struct spider_net_hw_descr *hwdescr = descr->hwdescr; in spider_net_pass_skb_up()
954 struct sk_buff *skb = descr->skb; in spider_net_pass_skb_up()
993 struct spider_net_descr *descr= start; in show_rx_chain() local
1015 hwd = descr->hwdescr; in show_rx_chain()
1016 off = descr - chain->ring; in show_rx_chain()
1019 if (descr == chain->head) in show_rx_chain()
1023 if (curr_desc == descr->bus_addr) in show_rx_chain()
1027 if (next_desc == descr->bus_addr) in show_rx_chain()
1045 descr = descr->next; in show_rx_chain()
1046 } while (descr != start); in show_rx_chain()
1053 descr = start; in show_rx_chain()
1056 struct spider_net_hw_descr *hwd = descr->hwdescr; in show_rx_chain()
1058 cnt = descr - chain->ring; in show_rx_chain()
1060 cnt, status, descr->skb); in show_rx_chain()
1062 descr->bus_addr, hwd->buf_addr, hwd->buf_size); in show_rx_chain()
1071 descr = descr->next; in show_rx_chain()
1072 } while (descr != start); in show_rx_chain()
1091 struct spider_net_descr *descr; in spider_net_resync_head_ptr() local
1095 descr = chain->head; in spider_net_resync_head_ptr()
1096 status = spider_net_get_descr_status(descr->hwdescr); in spider_net_resync_head_ptr()
1103 descr = chain->head; in spider_net_resync_head_ptr()
1104 status = spider_net_get_descr_status(descr->hwdescr); in spider_net_resync_head_ptr()
1107 descr = descr->next; in spider_net_resync_head_ptr()
1108 status = spider_net_get_descr_status(descr->hwdescr); in spider_net_resync_head_ptr()
1110 chain->head = descr; in spider_net_resync_head_ptr()
1118 struct spider_net_descr *descr; in spider_net_resync_tail_ptr() local
1122 descr = chain->tail; in spider_net_resync_tail_ptr()
1123 status = spider_net_get_descr_status(descr->hwdescr); in spider_net_resync_tail_ptr()
1128 descr = descr->next; in spider_net_resync_tail_ptr()
1129 status = spider_net_get_descr_status(descr->hwdescr); in spider_net_resync_tail_ptr()
1131 chain->tail = descr; in spider_net_resync_tail_ptr()
1154 struct spider_net_descr *descr = chain->tail; in spider_net_decode_one_descr() local
1155 struct spider_net_hw_descr *hwdescr = descr->hwdescr; in spider_net_decode_one_descr()
1167 chain->tail = descr->next; in spider_net_decode_one_descr()
1214 pr_err("which=%ld\n", descr - card->rx_chain.ring); in spider_net_decode_one_descr()
1221 spider_net_pass_skb_up(descr, card); in spider_net_decode_one_descr()
1222 descr->skb = NULL; in spider_net_decode_one_descr()
1229 dev_kfree_skb_irq(descr->skb); in spider_net_decode_one_descr()
1230 descr->skb = NULL; in spider_net_decode_one_descr()