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