|
14 | 14 | #include <linux/interrupt.h>
|
15 | 15 | #include <linux/if_vlan.h>
|
16 | 16 | #include <linux/phylink.h>
|
| 17 | +#include <linux/skbuff.h> |
17 | 18 |
|
18 | 19 | /* Packet size info */
|
19 | 20 | #define XAE_HDR_SIZE 14 /* Size of Ethernet header */
|
@@ -378,6 +379,22 @@ struct axidma_bd {
|
378 | 379 |
|
379 | 380 | #define XAE_NUM_MISC_CLOCKS 3
|
380 | 381 |
|
| 382 | +/** |
| 383 | + * struct skbuf_dma_descriptor - skb for each dma descriptor |
| 384 | + * @sgl: Pointer for sglist. |
| 385 | + * @desc: Pointer to dma descriptor. |
| 386 | + * @dma_address: dma address of sglist. |
| 387 | + * @skb: Pointer to SKB transferred using DMA |
| 388 | + * @sg_len: number of entries in the sglist. |
| 389 | + */ |
| 390 | +struct skbuf_dma_descriptor { |
| 391 | + struct scatterlist sgl[MAX_SKB_FRAGS + 1]; |
| 392 | + struct dma_async_tx_descriptor *desc; |
| 393 | + dma_addr_t dma_address; |
| 394 | + struct sk_buff *skb; |
| 395 | + int sg_len; |
| 396 | +}; |
| 397 | + |
381 | 398 | /**
|
382 | 399 | * struct axienet_local - axienet private per device data
|
383 | 400 | * @ndev: Pointer for net_device to which it will be attached.
|
@@ -436,6 +453,14 @@ struct axidma_bd {
|
436 | 453 | * @coalesce_count_tx: Store the irq coalesce on TX side.
|
437 | 454 | * @coalesce_usec_tx: IRQ coalesce delay for TX
|
438 | 455 | * @use_dmaengine: flag to check dmaengine framework usage.
|
| 456 | + * @tx_chan: TX DMA channel. |
| 457 | + * @rx_chan: RX DMA channel. |
| 458 | + * @tx_skb_ring: Pointer to TX skb ring buffer array. |
| 459 | + * @rx_skb_ring: Pointer to RX skb ring buffer array. |
| 460 | + * @tx_ring_head: TX skb ring buffer head index. |
| 461 | + * @tx_ring_tail: TX skb ring buffer tail index. |
| 462 | + * @rx_ring_head: RX skb ring buffer head index. |
| 463 | + * @rx_ring_tail: RX skb ring buffer tail index. |
439 | 464 | */
|
440 | 465 | struct axienet_local {
|
441 | 466 | struct net_device *ndev;
|
@@ -501,6 +526,14 @@ struct axienet_local {
|
501 | 526 | u32 coalesce_count_tx;
|
502 | 527 | u32 coalesce_usec_tx;
|
503 | 528 | u8 use_dmaengine;
|
| 529 | + struct dma_chan *tx_chan; |
| 530 | + struct dma_chan *rx_chan; |
| 531 | + struct skbuf_dma_descriptor **tx_skb_ring; |
| 532 | + struct skbuf_dma_descriptor **rx_skb_ring; |
| 533 | + int tx_ring_head; |
| 534 | + int tx_ring_tail; |
| 535 | + int rx_ring_head; |
| 536 | + int rx_ring_tail; |
504 | 537 | };
|
505 | 538 |
|
506 | 539 | /**
|
|
0 commit comments