26
26
27
27
static int stmmac_jumbo_frm (void * p , struct sk_buff * skb , int csum )
28
28
{
29
- struct stmmac_priv * priv = (struct stmmac_priv * )p ;
30
- unsigned int entry = priv -> cur_tx ;
31
- struct dma_desc * desc = priv -> dma_tx + entry ;
29
+ struct stmmac_tx_queue * tx_q = (struct stmmac_tx_queue * )p ;
32
30
unsigned int nopaged_len = skb_headlen (skb );
31
+ struct stmmac_priv * priv = tx_q -> priv_data ;
32
+ unsigned int entry = tx_q -> cur_tx ;
33
33
unsigned int bmax , des2 ;
34
34
unsigned int i = 1 , len ;
35
+ struct dma_desc * desc ;
36
+
37
+ desc = tx_q -> dma_tx + entry ;
35
38
36
39
if (priv -> plat -> enh_desc )
37
40
bmax = BUF_SIZE_8KiB ;
@@ -45,16 +48,16 @@ static int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum)
45
48
desc -> des2 = cpu_to_le32 (des2 );
46
49
if (dma_mapping_error (priv -> device , des2 ))
47
50
return -1 ;
48
- priv -> tx_skbuff_dma [entry ].buf = des2 ;
49
- priv -> tx_skbuff_dma [entry ].len = bmax ;
51
+ tx_q -> tx_skbuff_dma [entry ].buf = des2 ;
52
+ tx_q -> tx_skbuff_dma [entry ].len = bmax ;
50
53
/* do not close the descriptor and do not set own bit */
51
54
priv -> hw -> desc -> prepare_tx_desc (desc , 1 , bmax , csum , STMMAC_CHAIN_MODE ,
52
55
0 , false);
53
56
54
57
while (len != 0 ) {
55
- priv -> tx_skbuff [entry ] = NULL ;
58
+ tx_q -> tx_skbuff [entry ] = NULL ;
56
59
entry = STMMAC_GET_ENTRY (entry , DMA_TX_SIZE );
57
- desc = priv -> dma_tx + entry ;
60
+ desc = tx_q -> dma_tx + entry ;
58
61
59
62
if (len > bmax ) {
60
63
des2 = dma_map_single (priv -> device ,
@@ -63,8 +66,8 @@ static int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum)
63
66
desc -> des2 = cpu_to_le32 (des2 );
64
67
if (dma_mapping_error (priv -> device , des2 ))
65
68
return -1 ;
66
- priv -> tx_skbuff_dma [entry ].buf = des2 ;
67
- priv -> tx_skbuff_dma [entry ].len = bmax ;
69
+ tx_q -> tx_skbuff_dma [entry ].buf = des2 ;
70
+ tx_q -> tx_skbuff_dma [entry ].len = bmax ;
68
71
priv -> hw -> desc -> prepare_tx_desc (desc , 0 , bmax , csum ,
69
72
STMMAC_CHAIN_MODE , 1 ,
70
73
false);
@@ -77,8 +80,8 @@ static int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum)
77
80
desc -> des2 = cpu_to_le32 (des2 );
78
81
if (dma_mapping_error (priv -> device , des2 ))
79
82
return -1 ;
80
- priv -> tx_skbuff_dma [entry ].buf = des2 ;
81
- priv -> tx_skbuff_dma [entry ].len = len ;
83
+ tx_q -> tx_skbuff_dma [entry ].buf = des2 ;
84
+ tx_q -> tx_skbuff_dma [entry ].len = len ;
82
85
/* last descriptor can be set now */
83
86
priv -> hw -> desc -> prepare_tx_desc (desc , 0 , len , csum ,
84
87
STMMAC_CHAIN_MODE , 1 ,
@@ -87,7 +90,7 @@ static int stmmac_jumbo_frm(void *p, struct sk_buff *skb, int csum)
87
90
}
88
91
}
89
92
90
- priv -> cur_tx = entry ;
93
+ tx_q -> cur_tx = entry ;
91
94
92
95
return entry ;
93
96
}
@@ -136,32 +139,34 @@ static void stmmac_init_dma_chain(void *des, dma_addr_t phy_addr,
136
139
137
140
static void stmmac_refill_desc3 (void * priv_ptr , struct dma_desc * p )
138
141
{
139
- struct stmmac_priv * priv = (struct stmmac_priv * )priv_ptr ;
142
+ struct stmmac_rx_queue * rx_q = (struct stmmac_rx_queue * )priv_ptr ;
143
+ struct stmmac_priv * priv = rx_q -> priv_data ;
140
144
141
145
if (priv -> hwts_rx_en && !priv -> extend_desc )
142
146
/* NOTE: Device will overwrite des3 with timestamp value if
143
147
* 1588-2002 time stamping is enabled, hence reinitialize it
144
148
* to keep explicit chaining in the descriptor.
145
149
*/
146
- p -> des3 = cpu_to_le32 ((unsigned int )(priv -> dma_rx_phy +
147
- (((priv -> dirty_rx ) + 1 ) %
150
+ p -> des3 = cpu_to_le32 ((unsigned int )(rx_q -> dma_rx_phy +
151
+ (((rx_q -> dirty_rx ) + 1 ) %
148
152
DMA_RX_SIZE ) *
149
153
sizeof (struct dma_desc )));
150
154
}
151
155
152
156
static void stmmac_clean_desc3 (void * priv_ptr , struct dma_desc * p )
153
157
{
154
- struct stmmac_priv * priv = (struct stmmac_priv * )priv_ptr ;
155
- unsigned int entry = priv -> dirty_tx ;
158
+ struct stmmac_tx_queue * tx_q = (struct stmmac_tx_queue * )priv_ptr ;
159
+ struct stmmac_priv * priv = tx_q -> priv_data ;
160
+ unsigned int entry = tx_q -> dirty_tx ;
156
161
157
- if (priv -> tx_skbuff_dma [entry ].last_segment && !priv -> extend_desc &&
162
+ if (tx_q -> tx_skbuff_dma [entry ].last_segment && !priv -> extend_desc &&
158
163
priv -> hwts_tx_en )
159
164
/* NOTE: Device will overwrite des3 with timestamp value if
160
165
* 1588-2002 time stamping is enabled, hence reinitialize it
161
166
* to keep explicit chaining in the descriptor.
162
167
*/
163
- p -> des3 = cpu_to_le32 ((unsigned int )((priv -> dma_tx_phy +
164
- ((priv -> dirty_tx + 1 ) % DMA_TX_SIZE ))
168
+ p -> des3 = cpu_to_le32 ((unsigned int )((tx_q -> dma_tx_phy +
169
+ ((tx_q -> dirty_tx + 1 ) % DMA_TX_SIZE ))
165
170
* sizeof (struct dma_desc )));
166
171
}
167
172
0 commit comments