diff options
Diffstat (limited to 'drivers/net/e1000/e1000.h')
-rw-r--r-- | drivers/net/e1000/e1000.h | 67 |
1 files changed, 56 insertions, 11 deletions
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h index 092757bc721f..9b7274b111f3 100644 --- a/drivers/net/e1000/e1000.h +++ b/drivers/net/e1000/e1000.h | |||
@@ -72,6 +72,10 @@ | |||
72 | #include <linux/mii.h> | 72 | #include <linux/mii.h> |
73 | #include <linux/ethtool.h> | 73 | #include <linux/ethtool.h> |
74 | #include <linux/if_vlan.h> | 74 | #include <linux/if_vlan.h> |
75 | #ifdef CONFIG_E1000_MQ | ||
76 | #include <linux/cpu.h> | ||
77 | #include <linux/smp.h> | ||
78 | #endif | ||
75 | 79 | ||
76 | #define BAR_0 0 | 80 | #define BAR_0 0 |
77 | #define BAR_1 1 | 81 | #define BAR_1 1 |
@@ -168,7 +172,30 @@ struct e1000_buffer { | |||
168 | struct e1000_ps_page { struct page *ps_page[MAX_PS_BUFFERS]; }; | 172 | struct e1000_ps_page { struct page *ps_page[MAX_PS_BUFFERS]; }; |
169 | struct e1000_ps_page_dma { uint64_t ps_page_dma[MAX_PS_BUFFERS]; }; | 173 | struct e1000_ps_page_dma { uint64_t ps_page_dma[MAX_PS_BUFFERS]; }; |
170 | 174 | ||
171 | struct e1000_desc_ring { | 175 | struct e1000_tx_ring { |
176 | /* pointer to the descriptor ring memory */ | ||
177 | void *desc; | ||
178 | /* physical address of the descriptor ring */ | ||
179 | dma_addr_t dma; | ||
180 | /* length of descriptor ring in bytes */ | ||
181 | unsigned int size; | ||
182 | /* number of descriptors in the ring */ | ||
183 | unsigned int count; | ||
184 | /* next descriptor to associate a buffer with */ | ||
185 | unsigned int next_to_use; | ||
186 | /* next descriptor to check for DD status bit */ | ||
187 | unsigned int next_to_clean; | ||
188 | /* array of buffer information structs */ | ||
189 | struct e1000_buffer *buffer_info; | ||
190 | |||
191 | struct e1000_buffer previous_buffer_info; | ||
192 | spinlock_t tx_lock; | ||
193 | uint16_t tdh; | ||
194 | uint16_t tdt; | ||
195 | uint64_t pkt; | ||
196 | }; | ||
197 | |||
198 | struct e1000_rx_ring { | ||
172 | /* pointer to the descriptor ring memory */ | 199 | /* pointer to the descriptor ring memory */ |
173 | void *desc; | 200 | void *desc; |
174 | /* physical address of the descriptor ring */ | 201 | /* physical address of the descriptor ring */ |
@@ -186,6 +213,10 @@ struct e1000_desc_ring { | |||
186 | /* arrays of page information for packet split */ | 213 | /* arrays of page information for packet split */ |
187 | struct e1000_ps_page *ps_page; | 214 | struct e1000_ps_page *ps_page; |
188 | struct e1000_ps_page_dma *ps_page_dma; | 215 | struct e1000_ps_page_dma *ps_page_dma; |
216 | |||
217 | uint16_t rdh; | ||
218 | uint16_t rdt; | ||
219 | uint64_t pkt; | ||
189 | }; | 220 | }; |
190 | 221 | ||
191 | #define E1000_DESC_UNUSED(R) \ | 222 | #define E1000_DESC_UNUSED(R) \ |
@@ -227,9 +258,10 @@ struct e1000_adapter { | |||
227 | unsigned long led_status; | 258 | unsigned long led_status; |
228 | 259 | ||
229 | /* TX */ | 260 | /* TX */ |
230 | struct e1000_desc_ring tx_ring; | 261 | struct e1000_tx_ring *tx_ring; /* One per active queue */ |
231 | struct e1000_buffer previous_buffer_info; | 262 | #ifdef CONFIG_E1000_MQ |
232 | spinlock_t tx_lock; | 263 | struct e1000_tx_ring **cpu_tx_ring; /* per-cpu */ |
264 | #endif | ||
233 | uint32_t txd_cmd; | 265 | uint32_t txd_cmd; |
234 | uint32_t tx_int_delay; | 266 | uint32_t tx_int_delay; |
235 | uint32_t tx_abs_int_delay; | 267 | uint32_t tx_abs_int_delay; |
@@ -246,13 +278,26 @@ struct e1000_adapter { | |||
246 | 278 | ||
247 | /* RX */ | 279 | /* RX */ |
248 | #ifdef CONFIG_E1000_NAPI | 280 | #ifdef CONFIG_E1000_NAPI |
249 | boolean_t (*clean_rx) (struct e1000_adapter *adapter, int *work_done, | 281 | boolean_t (*clean_rx) (struct e1000_adapter *adapter, |
250 | int work_to_do); | 282 | struct e1000_rx_ring *rx_ring, |
283 | int *work_done, int work_to_do); | ||
251 | #else | 284 | #else |
252 | boolean_t (*clean_rx) (struct e1000_adapter *adapter); | 285 | boolean_t (*clean_rx) (struct e1000_adapter *adapter, |
286 | struct e1000_rx_ring *rx_ring); | ||
253 | #endif | 287 | #endif |
254 | void (*alloc_rx_buf) (struct e1000_adapter *adapter); | 288 | void (*alloc_rx_buf) (struct e1000_adapter *adapter, |
255 | struct e1000_desc_ring rx_ring; | 289 | struct e1000_rx_ring *rx_ring); |
290 | struct e1000_rx_ring *rx_ring; /* One per active queue */ | ||
291 | #ifdef CONFIG_E1000_NAPI | ||
292 | struct net_device *polling_netdev; /* One per active queue */ | ||
293 | #endif | ||
294 | #ifdef CONFIG_E1000_MQ | ||
295 | struct net_device **cpu_netdev; /* per-cpu */ | ||
296 | struct call_async_data_struct rx_sched_call_data; | ||
297 | int cpu_for_queue[4]; | ||
298 | #endif | ||
299 | int num_queues; | ||
300 | |||
256 | uint64_t hw_csum_err; | 301 | uint64_t hw_csum_err; |
257 | uint64_t hw_csum_good; | 302 | uint64_t hw_csum_good; |
258 | uint32_t rx_int_delay; | 303 | uint32_t rx_int_delay; |
@@ -278,8 +323,8 @@ struct e1000_adapter { | |||
278 | struct e1000_phy_stats phy_stats; | 323 | struct e1000_phy_stats phy_stats; |
279 | 324 | ||
280 | uint32_t test_icr; | 325 | uint32_t test_icr; |
281 | struct e1000_desc_ring test_tx_ring; | 326 | struct e1000_tx_ring test_tx_ring; |
282 | struct e1000_desc_ring test_rx_ring; | 327 | struct e1000_rx_ring test_rx_ring; |
283 | 328 | ||
284 | 329 | ||
285 | int msg_enable; | 330 | int msg_enable; |