diff options
Diffstat (limited to 'drivers/net/e1000/e1000.h')
-rw-r--r-- | drivers/net/e1000/e1000.h | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/drivers/net/e1000/e1000.h b/drivers/net/e1000/e1000.h index 148930d4e9bd..af1e82c5b808 100644 --- a/drivers/net/e1000/e1000.h +++ b/drivers/net/e1000/e1000.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | 3 | ||
4 | Copyright(c) 1999 - 2004 Intel Corporation. All rights reserved. | 4 | Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved. |
5 | 5 | ||
6 | This program is free software; you can redistribute it and/or modify it | 6 | This program is free software; you can redistribute it and/or modify it |
7 | under the terms of the GNU General Public License as published by the Free | 7 | under the terms of the GNU General Public License as published by the Free |
@@ -112,6 +112,8 @@ struct e1000_adapter; | |||
112 | #define E1000_MAX_82544_RXD 4096 | 112 | #define E1000_MAX_82544_RXD 4096 |
113 | 113 | ||
114 | /* Supported Rx Buffer Sizes */ | 114 | /* Supported Rx Buffer Sizes */ |
115 | #define E1000_RXBUFFER_128 128 /* Used for packet split */ | ||
116 | #define E1000_RXBUFFER_256 256 /* Used for packet split */ | ||
115 | #define E1000_RXBUFFER_2048 2048 | 117 | #define E1000_RXBUFFER_2048 2048 |
116 | #define E1000_RXBUFFER_4096 4096 | 118 | #define E1000_RXBUFFER_4096 4096 |
117 | #define E1000_RXBUFFER_8192 8192 | 119 | #define E1000_RXBUFFER_8192 8192 |
@@ -137,15 +139,19 @@ struct e1000_adapter; | |||
137 | /* How many Rx Buffers do we bundle into one write to the hardware ? */ | 139 | /* How many Rx Buffers do we bundle into one write to the hardware ? */ |
138 | #define E1000_RX_BUFFER_WRITE 16 /* Must be power of 2 */ | 140 | #define E1000_RX_BUFFER_WRITE 16 /* Must be power of 2 */ |
139 | 141 | ||
140 | #define AUTO_ALL_MODES 0 | 142 | #define AUTO_ALL_MODES 0 |
141 | #define E1000_EEPROM_82544_APM 0x0004 | 143 | #define E1000_EEPROM_82544_APM 0x0400 |
142 | #define E1000_EEPROM_APME 0x0400 | 144 | #define E1000_EEPROM_APME 0x0400 |
143 | 145 | ||
144 | #ifndef E1000_MASTER_SLAVE | 146 | #ifndef E1000_MASTER_SLAVE |
145 | /* Switch to override PHY master/slave setting */ | 147 | /* Switch to override PHY master/slave setting */ |
146 | #define E1000_MASTER_SLAVE e1000_ms_hw_default | 148 | #define E1000_MASTER_SLAVE e1000_ms_hw_default |
147 | #endif | 149 | #endif |
148 | 150 | ||
151 | #define E1000_MNG_VLAN_NONE -1 | ||
152 | /* Number of packet split data buffers (not including the header buffer) */ | ||
153 | #define PS_PAGE_BUFFERS MAX_PS_BUFFERS-1 | ||
154 | |||
149 | /* only works for sizes that are powers of 2 */ | 155 | /* only works for sizes that are powers of 2 */ |
150 | #define E1000_ROUNDUP(i, size) ((i) = (((i) + (size) - 1) & ~((size) - 1))) | 156 | #define E1000_ROUNDUP(i, size) ((i) = (((i) + (size) - 1) & ~((size) - 1))) |
151 | 157 | ||
@@ -159,6 +165,9 @@ struct e1000_buffer { | |||
159 | uint16_t next_to_watch; | 165 | uint16_t next_to_watch; |
160 | }; | 166 | }; |
161 | 167 | ||
168 | 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]; }; | ||
170 | |||
162 | struct e1000_desc_ring { | 171 | struct e1000_desc_ring { |
163 | /* pointer to the descriptor ring memory */ | 172 | /* pointer to the descriptor ring memory */ |
164 | void *desc; | 173 | void *desc; |
@@ -174,12 +183,19 @@ struct e1000_desc_ring { | |||
174 | unsigned int next_to_clean; | 183 | unsigned int next_to_clean; |
175 | /* array of buffer information structs */ | 184 | /* array of buffer information structs */ |
176 | struct e1000_buffer *buffer_info; | 185 | struct e1000_buffer *buffer_info; |
186 | /* arrays of page information for packet split */ | ||
187 | struct e1000_ps_page *ps_page; | ||
188 | struct e1000_ps_page_dma *ps_page_dma; | ||
177 | }; | 189 | }; |
178 | 190 | ||
179 | #define E1000_DESC_UNUSED(R) \ | 191 | #define E1000_DESC_UNUSED(R) \ |
180 | ((((R)->next_to_clean > (R)->next_to_use) ? 0 : (R)->count) + \ | 192 | ((((R)->next_to_clean > (R)->next_to_use) ? 0 : (R)->count) + \ |
181 | (R)->next_to_clean - (R)->next_to_use - 1) | 193 | (R)->next_to_clean - (R)->next_to_use - 1) |
182 | 194 | ||
195 | #define E1000_RX_DESC_PS(R, i) \ | ||
196 | (&(((union e1000_rx_desc_packet_split *)((R).desc))[i])) | ||
197 | #define E1000_RX_DESC_EXT(R, i) \ | ||
198 | (&(((union e1000_rx_desc_extended *)((R).desc))[i])) | ||
183 | #define E1000_GET_DESC(R, i, type) (&(((struct type *)((R).desc))[i])) | 199 | #define E1000_GET_DESC(R, i, type) (&(((struct type *)((R).desc))[i])) |
184 | #define E1000_RX_DESC(R, i) E1000_GET_DESC(R, i, e1000_rx_desc) | 200 | #define E1000_RX_DESC(R, i) E1000_GET_DESC(R, i, e1000_rx_desc) |
185 | #define E1000_TX_DESC(R, i) E1000_GET_DESC(R, i, e1000_tx_desc) | 201 | #define E1000_TX_DESC(R, i) E1000_GET_DESC(R, i, e1000_tx_desc) |
@@ -192,6 +208,7 @@ struct e1000_adapter { | |||
192 | struct timer_list watchdog_timer; | 208 | struct timer_list watchdog_timer; |
193 | struct timer_list phy_info_timer; | 209 | struct timer_list phy_info_timer; |
194 | struct vlan_group *vlgrp; | 210 | struct vlan_group *vlgrp; |
211 | uint16_t mng_vlan_id; | ||
195 | uint32_t bd_number; | 212 | uint32_t bd_number; |
196 | uint32_t rx_buffer_len; | 213 | uint32_t rx_buffer_len; |
197 | uint32_t part_num; | 214 | uint32_t part_num; |
@@ -228,14 +245,23 @@ struct e1000_adapter { | |||
228 | boolean_t detect_tx_hung; | 245 | boolean_t detect_tx_hung; |
229 | 246 | ||
230 | /* RX */ | 247 | /* RX */ |
248 | #ifdef CONFIG_E1000_NAPI | ||
249 | boolean_t (*clean_rx) (struct e1000_adapter *adapter, int *work_done, | ||
250 | int work_to_do); | ||
251 | #else | ||
252 | boolean_t (*clean_rx) (struct e1000_adapter *adapter); | ||
253 | #endif | ||
254 | void (*alloc_rx_buf) (struct e1000_adapter *adapter); | ||
231 | struct e1000_desc_ring rx_ring; | 255 | struct e1000_desc_ring rx_ring; |
232 | uint64_t hw_csum_err; | 256 | uint64_t hw_csum_err; |
233 | uint64_t hw_csum_good; | 257 | uint64_t hw_csum_good; |
234 | uint32_t rx_int_delay; | 258 | uint32_t rx_int_delay; |
235 | uint32_t rx_abs_int_delay; | 259 | uint32_t rx_abs_int_delay; |
236 | boolean_t rx_csum; | 260 | boolean_t rx_csum; |
261 | boolean_t rx_ps; | ||
237 | uint32_t gorcl; | 262 | uint32_t gorcl; |
238 | uint64_t gorcl_old; | 263 | uint64_t gorcl_old; |
264 | uint16_t rx_ps_bsize0; | ||
239 | 265 | ||
240 | /* Interrupt Throttle Rate */ | 266 | /* Interrupt Throttle Rate */ |
241 | uint32_t itr; | 267 | uint32_t itr; |
@@ -257,5 +283,8 @@ struct e1000_adapter { | |||
257 | 283 | ||
258 | 284 | ||
259 | int msg_enable; | 285 | int msg_enable; |
286 | #ifdef CONFIG_PCI_MSI | ||
287 | boolean_t have_msi; | ||
288 | #endif | ||
260 | }; | 289 | }; |
261 | #endif /* _E1000_H_ */ | 290 | #endif /* _E1000_H_ */ |