Skip to content

Commit 7355f27

Browse files
tkiskydavem330
authored andcommitted
net: fec: add struct bufdesc_prop
This reduces code and gains speed. Signed-off-by: Troy Kisky <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 93c595f commit 7355f27

File tree

2 files changed

+132
-185
lines changed

2 files changed

+132
-185
lines changed

drivers/net/ethernet/freescale/fec.h

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -448,33 +448,34 @@ struct bufdesc_ex {
448448
/* Controller supports RACC register */
449449
#define FEC_QUIRK_HAS_RACC (1 << 12)
450450

451+
struct bufdesc_prop {
452+
int qid;
453+
/* Address of Rx and Tx buffers */
454+
struct bufdesc *base;
455+
struct bufdesc *last;
456+
struct bufdesc *cur;
457+
dma_addr_t dma;
458+
unsigned short ring_size;
459+
unsigned char dsize;
460+
unsigned char dsize_log2;
461+
};
462+
451463
struct fec_enet_priv_tx_q {
452-
int index;
464+
struct bufdesc_prop bd;
453465
unsigned char *tx_bounce[TX_RING_SIZE];
454466
struct sk_buff *tx_skbuff[TX_RING_SIZE];
455467

456-
dma_addr_t bd_dma;
457-
struct bufdesc *tx_bd_base;
458-
uint tx_ring_size;
459-
460468
unsigned short tx_stop_threshold;
461469
unsigned short tx_wake_threshold;
462470

463-
struct bufdesc *cur_tx;
464471
struct bufdesc *dirty_tx;
465472
char *tso_hdrs;
466473
dma_addr_t tso_hdrs_dma;
467474
};
468475

469476
struct fec_enet_priv_rx_q {
470-
int index;
477+
struct bufdesc_prop bd;
471478
struct sk_buff *rx_skbuff[RX_RING_SIZE];
472-
473-
dma_addr_t bd_dma;
474-
struct bufdesc *rx_bd_base;
475-
uint rx_ring_size;
476-
477-
struct bufdesc *cur_rx;
478479
};
479480

480481
/* The FEC buffer descriptors track the ring buffers. The rx_bd_base and
@@ -514,8 +515,6 @@ struct fec_enet_private {
514515
unsigned long work_ts;
515516
unsigned long work_mdio;
516517

517-
unsigned short bufdesc_size;
518-
519518
struct platform_device *pdev;
520519

521520
int dev_id;

0 commit comments

Comments
 (0)