172172#define GEM_TBQP (hw_q ) (0x0440 + ((hw_q) << 2))
173173#define GEM_TBQPH (hw_q ) (0x04C8)
174174#define GEM_RBQP (hw_q ) (0x0480 + ((hw_q) << 2))
175+ #define GEM_RBQS (hw_q ) (0x04A0 + ((hw_q) << 2))
176+ #define GEM_RBQPH (hw_q ) (0x04D4)
175177#define GEM_IER (hw_q ) (0x0600 + ((hw_q) << 2))
176178#define GEM_IDR (hw_q ) (0x0620 + ((hw_q) << 2))
177179#define GEM_IMR (hw_q ) (0x0640 + ((hw_q) << 2))
@@ -921,12 +923,13 @@ static const struct gem_statistic gem_statistics[] = {
921923#define GEM_STATS_LEN ARRAY_SIZE(gem_statistics)
922924
923925struct macb ;
926+ struct macb_queue ;
924927
925928struct macb_or_gem_ops {
926929 int (* mog_alloc_rx_buffers )(struct macb * bp );
927930 void (* mog_free_rx_buffers )(struct macb * bp );
928931 void (* mog_init_rings )(struct macb * bp );
929- int (* mog_rx )(struct macb * bp , int budget );
932+ int (* mog_rx )(struct macb_queue * queue , int budget );
930933};
931934
932935/* MACB-PTP interface: adapt to platform needs. */
@@ -968,13 +971,25 @@ struct macb_queue {
968971 unsigned int IMR ;
969972 unsigned int TBQP ;
970973 unsigned int TBQPH ;
974+ unsigned int RBQS ;
975+ unsigned int RBQP ;
976+ unsigned int RBQPH ;
971977
972978 unsigned int tx_head , tx_tail ;
973979 struct macb_dma_desc * tx_ring ;
974980 struct macb_tx_skb * tx_skb ;
975981 dma_addr_t tx_ring_dma ;
976982 struct work_struct tx_error_task ;
977983
984+ dma_addr_t rx_ring_dma ;
985+ dma_addr_t rx_buffers_dma ;
986+ unsigned int rx_tail ;
987+ unsigned int rx_prepared_head ;
988+ struct macb_dma_desc * rx_ring ;
989+ struct sk_buff * * rx_skbuff ;
990+ void * rx_buffers ;
991+ struct napi_struct napi ;
992+
978993#ifdef CONFIG_MACB_USE_HWSTAMP
979994 struct work_struct tx_ts_task ;
980995 unsigned int tx_ts_head , tx_ts_tail ;
@@ -990,11 +1005,6 @@ struct macb {
9901005 u32 (* macb_reg_readl )(struct macb * bp , int offset );
9911006 void (* macb_reg_writel )(struct macb * bp , int offset , u32 value );
9921007
993- unsigned int rx_tail ;
994- unsigned int rx_prepared_head ;
995- struct macb_dma_desc * rx_ring ;
996- struct sk_buff * * rx_skbuff ;
997- void * rx_buffers ;
9981008 size_t rx_buffer_size ;
9991009
10001010 unsigned int rx_ring_size ;
@@ -1011,15 +1021,11 @@ struct macb {
10111021 struct clk * tx_clk ;
10121022 struct clk * rx_clk ;
10131023 struct net_device * dev ;
1014- struct napi_struct napi ;
10151024 union {
10161025 struct macb_stats macb ;
10171026 struct gem_stats gem ;
10181027 } hw_stats ;
10191028
1020- dma_addr_t rx_ring_dma ;
1021- dma_addr_t rx_buffers_dma ;
1022-
10231029 struct macb_or_gem_ops macbgem_ops ;
10241030
10251031 struct mii_bus * mii_bus ;
0 commit comments