Deleted Added
full compact
e1000_82542.c (169589) e1000_82542.c (173788)
1/*******************************************************************************
2
3 Copyright (c) 2001-2007, Intel Corporation
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8

--- 16 unchanged lines hidden (view full) ---

25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
31
32*******************************************************************************/
1/*******************************************************************************
2
3 Copyright (c) 2001-2007, Intel Corporation
4 All rights reserved.
5
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are met:
8

--- 16 unchanged lines hidden (view full) ---

25 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 POSSIBILITY OF SUCH DAMAGE.
31
32*******************************************************************************/
33/*$FreeBSD: head/sys/dev/em/e1000_82542.c 169589 2007-05-16 00:14:23Z jfv $*/
33/* $FreeBSD: head/sys/dev/em/e1000_82542.c 173788 2007-11-20 21:41:22Z jfv $ */
34
35
36/* e1000_82542 (rev 1 & 2)
37 */
38
39#include "e1000_api.h"
40
41void e1000_init_function_pointers_82542(struct e1000_hw *hw);

--- 5 unchanged lines hidden (view full) ---

47STATIC s32 e1000_reset_hw_82542(struct e1000_hw *hw);
48STATIC s32 e1000_init_hw_82542(struct e1000_hw *hw);
49STATIC s32 e1000_setup_link_82542(struct e1000_hw *hw);
50STATIC s32 e1000_led_on_82542(struct e1000_hw *hw);
51STATIC s32 e1000_led_off_82542(struct e1000_hw *hw);
52STATIC void e1000_clear_hw_cntrs_82542(struct e1000_hw *hw);
53
54struct e1000_dev_spec_82542 {
34
35
36/* e1000_82542 (rev 1 & 2)
37 */
38
39#include "e1000_api.h"
40
41void e1000_init_function_pointers_82542(struct e1000_hw *hw);

--- 5 unchanged lines hidden (view full) ---

47STATIC s32 e1000_reset_hw_82542(struct e1000_hw *hw);
48STATIC s32 e1000_init_hw_82542(struct e1000_hw *hw);
49STATIC s32 e1000_setup_link_82542(struct e1000_hw *hw);
50STATIC s32 e1000_led_on_82542(struct e1000_hw *hw);
51STATIC s32 e1000_led_off_82542(struct e1000_hw *hw);
52STATIC void e1000_clear_hw_cntrs_82542(struct e1000_hw *hw);
53
54struct e1000_dev_spec_82542 {
55 boolean_t dma_fairness;
55 bool dma_fairness;
56};
57
58/**
59 * e1000_init_phy_params_82542 - Init PHY func ptrs.
60 * @hw: pointer to the HW structure
61 *
62 * This is a function pointer entry point called by the api module.
63 **/
56};
57
58/**
59 * e1000_init_phy_params_82542 - Init PHY func ptrs.
60 * @hw: pointer to the HW structure
61 *
62 * This is a function pointer entry point called by the api module.
63 **/
64STATIC s32
65e1000_init_phy_params_82542(struct e1000_hw *hw)
64STATIC s32 e1000_init_phy_params_82542(struct e1000_hw *hw)
66{
67 struct e1000_phy_info *phy = &hw->phy;
68 s32 ret_val = E1000_SUCCESS;
69
70 DEBUGFUNC("e1000_init_phy_params_82542");
71
72 phy->type = e1000_phy_none;
73
74 return ret_val;
75}
76
77/**
78 * e1000_init_nvm_params_82542 - Init NVM func ptrs.
79 * @hw: pointer to the HW structure
80 *
81 * This is a function pointer entry point called by the api module.
82 **/
65{
66 struct e1000_phy_info *phy = &hw->phy;
67 s32 ret_val = E1000_SUCCESS;
68
69 DEBUGFUNC("e1000_init_phy_params_82542");
70
71 phy->type = e1000_phy_none;
72
73 return ret_val;
74}
75
76/**
77 * e1000_init_nvm_params_82542 - Init NVM func ptrs.
78 * @hw: pointer to the HW structure
79 *
80 * This is a function pointer entry point called by the api module.
81 **/
83STATIC s32
84e1000_init_nvm_params_82542(struct e1000_hw *hw)
82STATIC s32 e1000_init_nvm_params_82542(struct e1000_hw *hw)
85{
86 struct e1000_nvm_info *nvm = &hw->nvm;
87 struct e1000_functions *func = &hw->func;
88
89 DEBUGFUNC("e1000_init_nvm_params_82542");
90
91 nvm->address_bits = 6;
92 nvm->delay_usec = 50;

--- 12 unchanged lines hidden (view full) ---

105}
106
107/**
108 * e1000_init_mac_params_82542 - Init MAC func ptrs.
109 * @hw: pointer to the HW structure
110 *
111 * This is a function pointer entry point called by the api module.
112 **/
83{
84 struct e1000_nvm_info *nvm = &hw->nvm;
85 struct e1000_functions *func = &hw->func;
86
87 DEBUGFUNC("e1000_init_nvm_params_82542");
88
89 nvm->address_bits = 6;
90 nvm->delay_usec = 50;

--- 12 unchanged lines hidden (view full) ---

103}
104
105/**
106 * e1000_init_mac_params_82542 - Init MAC func ptrs.
107 * @hw: pointer to the HW structure
108 *
109 * This is a function pointer entry point called by the api module.
110 **/
113STATIC s32
114e1000_init_mac_params_82542(struct e1000_hw *hw)
111STATIC s32 e1000_init_mac_params_82542(struct e1000_hw *hw)
115{
116 struct e1000_mac_info *mac = &hw->mac;
117 struct e1000_functions *func = &hw->func;
118 s32 ret_val = E1000_SUCCESS;
119
120 DEBUGFUNC("e1000_init_mac_params_82542");
121
122 /* Set media type */
112{
113 struct e1000_mac_info *mac = &hw->mac;
114 struct e1000_functions *func = &hw->func;
115 s32 ret_val = E1000_SUCCESS;
116
117 DEBUGFUNC("e1000_init_mac_params_82542");
118
119 /* Set media type */
123 hw->media_type = e1000_media_type_fiber;
120 hw->phy.media_type = e1000_media_type_fiber;
124
125 /* Set mta register count */
126 mac->mta_reg_count = 128;
127 /* Set rar entry count */
128 mac->rar_entry_count = E1000_RAR_ENTRIES;
129
130 /* Function pointers */
131

--- 5 unchanged lines hidden (view full) ---

137 func->init_hw = e1000_init_hw_82542;
138 /* link setup */
139 func->setup_link = e1000_setup_link_82542;
140 /* phy/fiber/serdes setup */
141 func->setup_physical_interface = e1000_setup_fiber_serdes_link_generic;
142 /* check for link */
143 func->check_for_link = e1000_check_for_fiber_link_generic;
144 /* multicast address update */
121
122 /* Set mta register count */
123 mac->mta_reg_count = 128;
124 /* Set rar entry count */
125 mac->rar_entry_count = E1000_RAR_ENTRIES;
126
127 /* Function pointers */
128

--- 5 unchanged lines hidden (view full) ---

134 func->init_hw = e1000_init_hw_82542;
135 /* link setup */
136 func->setup_link = e1000_setup_link_82542;
137 /* phy/fiber/serdes setup */
138 func->setup_physical_interface = e1000_setup_fiber_serdes_link_generic;
139 /* check for link */
140 func->check_for_link = e1000_check_for_fiber_link_generic;
141 /* multicast address update */
145 func->mc_addr_list_update = e1000_mc_addr_list_update_generic;
142 func->update_mc_addr_list = e1000_update_mc_addr_list_generic;
146 /* writing VFTA */
147 func->write_vfta = e1000_write_vfta_generic;
148 /* clearing VFTA */
149 func->clear_vfta = e1000_clear_vfta_generic;
150 /* setting MTA */
151 func->mta_set = e1000_mta_set_generic;
152 /* turn on/off LED */
153 func->led_on = e1000_led_on_82542;

--- 15 unchanged lines hidden (view full) ---

169
170/**
171 * e1000_init_function_pointers_82542 - Init func ptrs.
172 * @hw: pointer to the HW structure
173 *
174 * The only function explicitly called by the api module to initialize
175 * all function pointers and parameters.
176 **/
143 /* writing VFTA */
144 func->write_vfta = e1000_write_vfta_generic;
145 /* clearing VFTA */
146 func->clear_vfta = e1000_clear_vfta_generic;
147 /* setting MTA */
148 func->mta_set = e1000_mta_set_generic;
149 /* turn on/off LED */
150 func->led_on = e1000_led_on_82542;

--- 15 unchanged lines hidden (view full) ---

166
167/**
168 * e1000_init_function_pointers_82542 - Init func ptrs.
169 * @hw: pointer to the HW structure
170 *
171 * The only function explicitly called by the api module to initialize
172 * all function pointers and parameters.
173 **/
177void
178e1000_init_function_pointers_82542(struct e1000_hw *hw)
174void e1000_init_function_pointers_82542(struct e1000_hw *hw)
179{
180 DEBUGFUNC("e1000_init_function_pointers_82542");
181
182 hw->func.init_mac_params = e1000_init_mac_params_82542;
183 hw->func.init_nvm_params = e1000_init_nvm_params_82542;
184 hw->func.init_phy_params = e1000_init_phy_params_82542;
185}
186
187/**
188 * e1000_get_bus_info_82542 - Obtain bus information for adapter
189 * @hw: pointer to the HW structure
190 *
191 * This will obtain information about the HW bus for which the
192 * adaper is attached and stores it in the hw structure. This is a function
193 * pointer entry point called by the api module.
194 **/
175{
176 DEBUGFUNC("e1000_init_function_pointers_82542");
177
178 hw->func.init_mac_params = e1000_init_mac_params_82542;
179 hw->func.init_nvm_params = e1000_init_nvm_params_82542;
180 hw->func.init_phy_params = e1000_init_phy_params_82542;
181}
182
183/**
184 * e1000_get_bus_info_82542 - Obtain bus information for adapter
185 * @hw: pointer to the HW structure
186 *
187 * This will obtain information about the HW bus for which the
188 * adaper is attached and stores it in the hw structure. This is a function
189 * pointer entry point called by the api module.
190 **/
195STATIC s32
196e1000_get_bus_info_82542(struct e1000_hw *hw)
191STATIC s32 e1000_get_bus_info_82542(struct e1000_hw *hw)
197{
198 DEBUGFUNC("e1000_get_bus_info_82542");
199
200 hw->bus.type = e1000_bus_type_pci;
201 hw->bus.speed = e1000_bus_speed_unknown;
202 hw->bus.width = e1000_bus_width_unknown;
203
204 return E1000_SUCCESS;
205}
206
207/**
208 * e1000_reset_hw_82542 - Reset hardware
209 * @hw: pointer to the HW structure
210 *
211 * This resets the hardware into a known state. This is a
212 * function pointer entry point called by the api module.
213 **/
192{
193 DEBUGFUNC("e1000_get_bus_info_82542");
194
195 hw->bus.type = e1000_bus_type_pci;
196 hw->bus.speed = e1000_bus_speed_unknown;
197 hw->bus.width = e1000_bus_width_unknown;
198
199 return E1000_SUCCESS;
200}
201
202/**
203 * e1000_reset_hw_82542 - Reset hardware
204 * @hw: pointer to the HW structure
205 *
206 * This resets the hardware into a known state. This is a
207 * function pointer entry point called by the api module.
208 **/
214STATIC s32
215e1000_reset_hw_82542(struct e1000_hw *hw)
209STATIC s32 e1000_reset_hw_82542(struct e1000_hw *hw)
216{
217 struct e1000_bus_info *bus = &hw->bus;
218 s32 ret_val = E1000_SUCCESS;
219 u32 ctrl, icr;
220
221 DEBUGFUNC("e1000_reset_hw_82542");
222
223 if (hw->revision_id == E1000_REVISION_2) {
224 DEBUGOUT("Disabling MWI on 82542 rev 2\n");
225 e1000_pci_clear_mwi(hw);
226 }
227
228 DEBUGOUT("Masking off all interrupts\n");
229 E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
230
231 E1000_WRITE_REG(hw, E1000_RCTL, 0);
232 E1000_WRITE_REG(hw, E1000_TCTL, E1000_TCTL_PSP);
233 E1000_WRITE_FLUSH(hw);
234
210{
211 struct e1000_bus_info *bus = &hw->bus;
212 s32 ret_val = E1000_SUCCESS;
213 u32 ctrl, icr;
214
215 DEBUGFUNC("e1000_reset_hw_82542");
216
217 if (hw->revision_id == E1000_REVISION_2) {
218 DEBUGOUT("Disabling MWI on 82542 rev 2\n");
219 e1000_pci_clear_mwi(hw);
220 }
221
222 DEBUGOUT("Masking off all interrupts\n");
223 E1000_WRITE_REG(hw, E1000_IMC, 0xffffffff);
224
225 E1000_WRITE_REG(hw, E1000_RCTL, 0);
226 E1000_WRITE_REG(hw, E1000_TCTL, E1000_TCTL_PSP);
227 E1000_WRITE_FLUSH(hw);
228
235 /* Delay to allow any outstanding PCI transactions to complete before
229 /*
230 * Delay to allow any outstanding PCI transactions to complete before
236 * resetting the device
237 */
238 msec_delay(10);
239
240 ctrl = E1000_READ_REG(hw, E1000_CTRL);
241
242 DEBUGOUT("Issuing a global reset to 82542/82543 MAC\n");
243 E1000_WRITE_REG(hw, E1000_CTRL, ctrl | E1000_CTRL_RST);

--- 14 unchanged lines hidden (view full) ---

258
259/**
260 * e1000_init_hw_82542 - Initialize hardware
261 * @hw: pointer to the HW structure
262 *
263 * This inits the hardware readying it for operation. This is a
264 * function pointer entry point called by the api module.
265 **/
231 * resetting the device
232 */
233 msec_delay(10);
234
235 ctrl = E1000_READ_REG(hw, E1000_CTRL);
236
237 DEBUGOUT("Issuing a global reset to 82542/82543 MAC\n");
238 E1000_WRITE_REG(hw, E1000_CTRL, ctrl | E1000_CTRL_RST);

--- 14 unchanged lines hidden (view full) ---

253
254/**
255 * e1000_init_hw_82542 - Initialize hardware
256 * @hw: pointer to the HW structure
257 *
258 * This inits the hardware readying it for operation. This is a
259 * function pointer entry point called by the api module.
260 **/
266STATIC s32
267e1000_init_hw_82542(struct e1000_hw *hw)
261STATIC s32 e1000_init_hw_82542(struct e1000_hw *hw)
268{
269 struct e1000_mac_info *mac = &hw->mac;
270 struct e1000_dev_spec_82542 *dev_spec;
271 s32 ret_val = E1000_SUCCESS;
272 u32 ctrl;
273 u16 i;
274
275 DEBUGFUNC("e1000_init_hw_82542");

--- 25 unchanged lines hidden (view full) ---

301 e1000_pci_set_mwi(hw);
302 }
303
304 /* Zero out the Multicast HASH table */
305 DEBUGOUT("Zeroing the MTA\n");
306 for (i = 0; i < mac->mta_reg_count; i++)
307 E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0);
308
262{
263 struct e1000_mac_info *mac = &hw->mac;
264 struct e1000_dev_spec_82542 *dev_spec;
265 s32 ret_val = E1000_SUCCESS;
266 u32 ctrl;
267 u16 i;
268
269 DEBUGFUNC("e1000_init_hw_82542");

--- 25 unchanged lines hidden (view full) ---

295 e1000_pci_set_mwi(hw);
296 }
297
298 /* Zero out the Multicast HASH table */
299 DEBUGOUT("Zeroing the MTA\n");
300 for (i = 0; i < mac->mta_reg_count; i++)
301 E1000_WRITE_REG_ARRAY(hw, E1000_MTA, i, 0);
302
309 /* Set the PCI priority bit correctly in the CTRL register. This
303 /*
304 * Set the PCI priority bit correctly in the CTRL register. This
310 * determines if the adapter gives priority to receives, or if it
311 * gives equal priority to transmits and receives.
312 */
313 if (dev_spec->dma_fairness) {
314 ctrl = E1000_READ_REG(hw, E1000_CTRL);
315 E1000_WRITE_REG(hw, E1000_CTRL, ctrl | E1000_CTRL_PRIOR);
316 }
317
318 /* Setup link and flow control */
319 ret_val = e1000_setup_link_82542(hw);
320
305 * determines if the adapter gives priority to receives, or if it
306 * gives equal priority to transmits and receives.
307 */
308 if (dev_spec->dma_fairness) {
309 ctrl = E1000_READ_REG(hw, E1000_CTRL);
310 E1000_WRITE_REG(hw, E1000_CTRL, ctrl | E1000_CTRL_PRIOR);
311 }
312
313 /* Setup link and flow control */
314 ret_val = e1000_setup_link_82542(hw);
315
321 /* Clear all of the statistics registers (clear on read). It is
316 /*
317 * Clear all of the statistics registers (clear on read). It is
322 * important that we do this after we have tried to establish link
323 * because the symbol error count will increment wildly if there
324 * is no link.
325 */
326 e1000_clear_hw_cntrs_82542(hw);
327
328 return ret_val;
329}

--- 4 unchanged lines hidden (view full) ---

334 *
335 * Determines which flow control settings to use, then configures flow
336 * control. Calls the appropriate media-specific link configuration
337 * function. Assuming the adapter has a valid link partner, a valid link
338 * should be established. Assumes the hardware has previously been reset
339 * and the transmitter and receiver are not enabled. This is a function
340 * pointer entry point called by the api module.
341 **/
318 * important that we do this after we have tried to establish link
319 * because the symbol error count will increment wildly if there
320 * is no link.
321 */
322 e1000_clear_hw_cntrs_82542(hw);
323
324 return ret_val;
325}

--- 4 unchanged lines hidden (view full) ---

330 *
331 * Determines which flow control settings to use, then configures flow
332 * control. Calls the appropriate media-specific link configuration
333 * function. Assuming the adapter has a valid link partner, a valid link
334 * should be established. Assumes the hardware has previously been reset
335 * and the transmitter and receiver are not enabled. This is a function
336 * pointer entry point called by the api module.
337 **/
342STATIC s32
343e1000_setup_link_82542(struct e1000_hw *hw)
338STATIC s32 e1000_setup_link_82542(struct e1000_hw *hw)
344{
345 struct e1000_mac_info *mac = &hw->mac;
346 struct e1000_functions *func = &hw->func;
347 s32 ret_val = E1000_SUCCESS;
348
349 DEBUGFUNC("e1000_setup_link_82542");
350
351 ret_val = e1000_set_default_fc_generic(hw);
352 if (ret_val)
353 goto out;
354
339{
340 struct e1000_mac_info *mac = &hw->mac;
341 struct e1000_functions *func = &hw->func;
342 s32 ret_val = E1000_SUCCESS;
343
344 DEBUGFUNC("e1000_setup_link_82542");
345
346 ret_val = e1000_set_default_fc_generic(hw);
347 if (ret_val)
348 goto out;
349
355 mac->fc &= ~e1000_fc_tx_pause;
350 hw->fc.type &= ~e1000_fc_tx_pause;
356
357 if (mac->report_tx_early == 1)
351
352 if (mac->report_tx_early == 1)
358 mac->fc &= ~e1000_fc_rx_pause;
353 hw->fc.type &= ~e1000_fc_rx_pause;
359
354
360 /* We want to save off the original Flow Control configuration just in
355 /*
356 * We want to save off the original Flow Control configuration just in
361 * case we get disconnected and then reconnected into a different hub
362 * or switch with different Flow Control capabilities.
363 */
357 * case we get disconnected and then reconnected into a different hub
358 * or switch with different Flow Control capabilities.
359 */
364 mac->original_fc = mac->fc;
360 hw->fc.original_type = hw->fc.type;
365
361
366 DEBUGOUT1("After fix-ups FlowControl is now = %x\n", mac->fc);
362 DEBUGOUT1("After fix-ups FlowControl is now = %x\n", hw->fc.type);
367
368 /* Call the necessary subroutine to configure the link. */
369 ret_val = func->setup_physical_interface(hw);
370 if (ret_val)
371 goto out;
372
363
364 /* Call the necessary subroutine to configure the link. */
365 ret_val = func->setup_physical_interface(hw);
366 if (ret_val)
367 goto out;
368
373 /* Initialize the flow control address, type, and PAUSE timer
369 /*
370 * Initialize the flow control address, type, and PAUSE timer
374 * registers to their default values. This is done even if flow
375 * control is disabled, because it does not hurt anything to
376 * initialize these registers.
377 */
378 DEBUGOUT("Initializing Flow Control address, type and timer regs\n");
379
380 E1000_WRITE_REG(hw, E1000_FCAL, FLOW_CONTROL_ADDRESS_LOW);
381 E1000_WRITE_REG(hw, E1000_FCAH, FLOW_CONTROL_ADDRESS_HIGH);
382 E1000_WRITE_REG(hw, E1000_FCT, FLOW_CONTROL_TYPE);
383
371 * registers to their default values. This is done even if flow
372 * control is disabled, because it does not hurt anything to
373 * initialize these registers.
374 */
375 DEBUGOUT("Initializing Flow Control address, type and timer regs\n");
376
377 E1000_WRITE_REG(hw, E1000_FCAL, FLOW_CONTROL_ADDRESS_LOW);
378 E1000_WRITE_REG(hw, E1000_FCAH, FLOW_CONTROL_ADDRESS_HIGH);
379 E1000_WRITE_REG(hw, E1000_FCT, FLOW_CONTROL_TYPE);
380
384 E1000_WRITE_REG(hw, E1000_FCTTV, mac->fc_pause_time);
381 E1000_WRITE_REG(hw, E1000_FCTTV, hw->fc.pause_time);
385
386 ret_val = e1000_set_fc_watermarks_generic(hw);
387
388out:
389 return ret_val;
390}
391
392/**
393 * e1000_led_on_82542 - Turn on SW controllable LED
394 * @hw: pointer to the HW structure
395 *
396 * Turns the SW defined LED on. This is a function pointer entry point
397 * called by the api module.
398 **/
382
383 ret_val = e1000_set_fc_watermarks_generic(hw);
384
385out:
386 return ret_val;
387}
388
389/**
390 * e1000_led_on_82542 - Turn on SW controllable LED
391 * @hw: pointer to the HW structure
392 *
393 * Turns the SW defined LED on. This is a function pointer entry point
394 * called by the api module.
395 **/
399STATIC s32
400e1000_led_on_82542(struct e1000_hw *hw)
396STATIC s32 e1000_led_on_82542(struct e1000_hw *hw)
401{
402 u32 ctrl = E1000_READ_REG(hw, E1000_CTRL);
403
404 DEBUGFUNC("e1000_led_on_82542");
405
406 ctrl |= E1000_CTRL_SWDPIN0;
407 ctrl |= E1000_CTRL_SWDPIO0;
408 E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
409
410 return E1000_SUCCESS;
411}
412
413/**
414 * e1000_led_off_82542 - Turn off SW controllable LED
415 * @hw: pointer to the HW structure
416 *
417 * Turns the SW defined LED off. This is a function pointer entry point
418 * called by the api module.
419 **/
397{
398 u32 ctrl = E1000_READ_REG(hw, E1000_CTRL);
399
400 DEBUGFUNC("e1000_led_on_82542");
401
402 ctrl |= E1000_CTRL_SWDPIN0;
403 ctrl |= E1000_CTRL_SWDPIO0;
404 E1000_WRITE_REG(hw, E1000_CTRL, ctrl);
405
406 return E1000_SUCCESS;
407}
408
409/**
410 * e1000_led_off_82542 - Turn off SW controllable LED
411 * @hw: pointer to the HW structure
412 *
413 * Turns the SW defined LED off. This is a function pointer entry point
414 * called by the api module.
415 **/
420STATIC s32
421e1000_led_off_82542(struct e1000_hw *hw)
416STATIC s32 e1000_led_off_82542(struct e1000_hw *hw)
422{
423 u32 ctrl = E1000_READ_REG(hw, E1000_CTRL);
424
425 DEBUGFUNC("e1000_led_off_82542");
426
427 ctrl &= ~E1000_CTRL_SWDPIN0;
428 ctrl |= E1000_CTRL_SWDPIO0;
429 E1000_WRITE_REG(hw, E1000_CTRL, ctrl);

--- 5 unchanged lines hidden (view full) ---

435 * e1000_translate_register_82542 - Translate the proper regiser offset
436 * @reg: e1000 register to be read
437 *
438 * Registers in 82542 are located in different offsets than other adapters
439 * even though they function in the same manner. This function takes in
440 * the name of the register to read and returns the correct offset for
441 * 82542 silicon.
442 **/
417{
418 u32 ctrl = E1000_READ_REG(hw, E1000_CTRL);
419
420 DEBUGFUNC("e1000_led_off_82542");
421
422 ctrl &= ~E1000_CTRL_SWDPIN0;
423 ctrl |= E1000_CTRL_SWDPIO0;
424 E1000_WRITE_REG(hw, E1000_CTRL, ctrl);

--- 5 unchanged lines hidden (view full) ---

430 * e1000_translate_register_82542 - Translate the proper regiser offset
431 * @reg: e1000 register to be read
432 *
433 * Registers in 82542 are located in different offsets than other adapters
434 * even though they function in the same manner. This function takes in
435 * the name of the register to read and returns the correct offset for
436 * 82542 silicon.
437 **/
443u32
444e1000_translate_register_82542(u32 reg)
438u32 e1000_translate_register_82542(u32 reg)
445{
439{
446 /* Some of the 82542 registers are located at different
440 /*
441 * Some of the 82542 registers are located at different
447 * offsets than they are in newer adapters.
448 * Despite the difference in location, the registers
449 * function in the same manner.
450 */
451 switch (reg) {
452 case E1000_RA:
453 reg = 0x00040;
454 break;
455 case E1000_RDTR:
456 reg = 0x00108;
457 break;
442 * offsets than they are in newer adapters.
443 * Despite the difference in location, the registers
444 * function in the same manner.
445 */
446 switch (reg) {
447 case E1000_RA:
448 reg = 0x00040;
449 break;
450 case E1000_RDTR:
451 reg = 0x00108;
452 break;
458 case E1000_RDBAL:
453 case E1000_RDBAL(0):
459 reg = 0x00110;
460 break;
454 reg = 0x00110;
455 break;
461 case E1000_RDBAH:
456 case E1000_RDBAH(0):
462 reg = 0x00114;
463 break;
457 reg = 0x00114;
458 break;
464 case E1000_RDLEN:
459 case E1000_RDLEN(0):
465 reg = 0x00118;
466 break;
460 reg = 0x00118;
461 break;
467 case E1000_RDH:
462 case E1000_RDH(0):
468 reg = 0x00120;
469 break;
463 reg = 0x00120;
464 break;
470 case E1000_RDT:
465 case E1000_RDT(0):
471 reg = 0x00128;
472 break;
466 reg = 0x00128;
467 break;
473 case E1000_RDBAL1:
468 case E1000_RDBAL(1):
474 reg = 0x00138;
475 break;
469 reg = 0x00138;
470 break;
476 case E1000_RDBAH1:
471 case E1000_RDBAH(1):
477 reg = 0x0013C;
478 break;
472 reg = 0x0013C;
473 break;
479 case E1000_RDLEN1:
474 case E1000_RDLEN(1):
480 reg = 0x00140;
481 break;
475 reg = 0x00140;
476 break;
482 case E1000_RDH1:
477 case E1000_RDH(1):
483 reg = 0x00148;
484 break;
478 reg = 0x00148;
479 break;
485 case E1000_RDT1:
480 case E1000_RDT(1):
486 reg = 0x00150;
487 break;
488 case E1000_FCRTH:
489 reg = 0x00160;
490 break;
491 case E1000_FCRTL:
492 reg = 0x00168;
493 break;
494 case E1000_MTA:
495 reg = 0x00200;
496 break;
481 reg = 0x00150;
482 break;
483 case E1000_FCRTH:
484 reg = 0x00160;
485 break;
486 case E1000_FCRTL:
487 reg = 0x00168;
488 break;
489 case E1000_MTA:
490 reg = 0x00200;
491 break;
497 case E1000_TDBAL:
492 case E1000_TDBAL(0):
498 reg = 0x00420;
499 break;
493 reg = 0x00420;
494 break;
500 case E1000_TDBAH:
495 case E1000_TDBAH(0):
501 reg = 0x00424;
502 break;
496 reg = 0x00424;
497 break;
503 case E1000_TDLEN:
498 case E1000_TDLEN(0):
504 reg = 0x00428;
505 break;
499 reg = 0x00428;
500 break;
506 case E1000_TDH:
501 case E1000_TDH(0):
507 reg = 0x00430;
508 break;
502 reg = 0x00430;
503 break;
509 case E1000_TDT:
504 case E1000_TDT(0):
510 reg = 0x00438;
511 break;
512 case E1000_TIDV:
513 reg = 0x00440;
514 break;
515 case E1000_VFTA:
516 reg = 0x00600;
517 break;

--- 11 unchanged lines hidden (view full) ---

529}
530
531/**
532 * e1000_clear_hw_cntrs_82542 - Clear device specific hardware counters
533 * @hw: pointer to the HW structure
534 *
535 * Clears the hardware counters by reading the counter registers.
536 **/
505 reg = 0x00438;
506 break;
507 case E1000_TIDV:
508 reg = 0x00440;
509 break;
510 case E1000_VFTA:
511 reg = 0x00600;
512 break;

--- 11 unchanged lines hidden (view full) ---

524}
525
526/**
527 * e1000_clear_hw_cntrs_82542 - Clear device specific hardware counters
528 * @hw: pointer to the HW structure
529 *
530 * Clears the hardware counters by reading the counter registers.
531 **/
537STATIC void
538e1000_clear_hw_cntrs_82542(struct e1000_hw *hw)
532STATIC void e1000_clear_hw_cntrs_82542(struct e1000_hw *hw)
539{
540 volatile u32 temp;
541
542 DEBUGFUNC("e1000_clear_hw_cntrs_82542");
543
544 e1000_clear_hw_cntrs_base_generic(hw);
545
546 temp = E1000_READ_REG(hw, E1000_PRC64);

--- 12 unchanged lines hidden ---
533{
534 volatile u32 temp;
535
536 DEBUGFUNC("e1000_clear_hw_cntrs_82542");
537
538 e1000_clear_hw_cntrs_base_generic(hw);
539
540 temp = E1000_READ_REG(hw, E1000_PRC64);

--- 12 unchanged lines hidden ---