diff options
author | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
---|---|---|
committer | Andrea Bastoni <bastoni@cs.unc.edu> | 2010-05-30 19:16:45 -0400 |
commit | ada47b5fe13d89735805b566185f4885f5a3f750 (patch) | |
tree | 644b88f8a71896307d71438e9b3af49126ffb22b /drivers/net/e1000e/e1000.h | |
parent | 43e98717ad40a4ae64545b5ba047c7b86aa44f4f (diff) | |
parent | 3280f21d43ee541f97f8cda5792150d2dbec20d5 (diff) |
Merge branch 'wip-2.6.34' into old-private-masterarchived-private-master
Diffstat (limited to 'drivers/net/e1000e/e1000.h')
-rw-r--r-- | drivers/net/e1000e/e1000.h | 74 |
1 files changed, 49 insertions, 25 deletions
diff --git a/drivers/net/e1000e/e1000.h b/drivers/net/e1000e/e1000.h index 3e187b0e4203..ee32b9b27a9f 100644 --- a/drivers/net/e1000e/e1000.h +++ b/drivers/net/e1000e/e1000.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /******************************************************************************* | 1 | /******************************************************************************* |
2 | 2 | ||
3 | Intel PRO/1000 Linux driver | 3 | Intel PRO/1000 Linux driver |
4 | Copyright(c) 1999 - 2008 Intel Corporation. | 4 | Copyright(c) 1999 - 2009 Intel Corporation. |
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 and conditions of the GNU General Public License, | 7 | under the terms and conditions of the GNU General Public License, |
@@ -36,6 +36,8 @@ | |||
36 | #include <linux/workqueue.h> | 36 | #include <linux/workqueue.h> |
37 | #include <linux/io.h> | 37 | #include <linux/io.h> |
38 | #include <linux/netdevice.h> | 38 | #include <linux/netdevice.h> |
39 | #include <linux/pci.h> | ||
40 | #include <linux/pci-aspm.h> | ||
39 | 41 | ||
40 | #include "hw.h" | 42 | #include "hw.h" |
41 | 43 | ||
@@ -47,9 +49,9 @@ struct e1000_info; | |||
47 | 49 | ||
48 | #ifdef DEBUG | 50 | #ifdef DEBUG |
49 | #define e_dbg(format, arg...) \ | 51 | #define e_dbg(format, arg...) \ |
50 | e_printk(KERN_DEBUG , adapter, format, ## arg) | 52 | e_printk(KERN_DEBUG , hw->adapter, format, ## arg) |
51 | #else | 53 | #else |
52 | #define e_dbg(format, arg...) do { (void)(adapter); } while (0) | 54 | #define e_dbg(format, arg...) do { (void)(hw); } while (0) |
53 | #endif | 55 | #endif |
54 | 56 | ||
55 | #define e_err(format, arg...) \ | 57 | #define e_err(format, arg...) \ |
@@ -193,12 +195,15 @@ struct e1000_buffer { | |||
193 | unsigned long time_stamp; | 195 | unsigned long time_stamp; |
194 | u16 length; | 196 | u16 length; |
195 | u16 next_to_watch; | 197 | u16 next_to_watch; |
198 | u16 mapped_as_page; | ||
196 | }; | 199 | }; |
197 | /* Rx */ | 200 | /* Rx */ |
198 | /* arrays of page information for packet split */ | 201 | struct { |
199 | struct e1000_ps_page *ps_pages; | 202 | /* arrays of page information for packet split */ |
203 | struct e1000_ps_page *ps_pages; | ||
204 | struct page *page; | ||
205 | }; | ||
200 | }; | 206 | }; |
201 | struct page *page; | ||
202 | }; | 207 | }; |
203 | 208 | ||
204 | struct e1000_ring { | 209 | struct e1000_ring { |
@@ -275,7 +280,6 @@ struct e1000_adapter { | |||
275 | 280 | ||
276 | struct napi_struct napi; | 281 | struct napi_struct napi; |
277 | 282 | ||
278 | unsigned long tx_queue_len; | ||
279 | unsigned int restart_queue; | 283 | unsigned int restart_queue; |
280 | u32 txd_cmd; | 284 | u32 txd_cmd; |
281 | 285 | ||
@@ -331,7 +335,6 @@ struct e1000_adapter { | |||
331 | /* OS defined structs */ | 335 | /* OS defined structs */ |
332 | struct net_device *netdev; | 336 | struct net_device *netdev; |
333 | struct pci_dev *pdev; | 337 | struct pci_dev *pdev; |
334 | struct net_device_stats net_stats; | ||
335 | 338 | ||
336 | /* structs defined in e1000_hw.h */ | 339 | /* structs defined in e1000_hw.h */ |
337 | struct e1000_hw hw; | 340 | struct e1000_hw hw; |
@@ -366,12 +369,13 @@ struct e1000_adapter { | |||
366 | struct work_struct downshift_task; | 369 | struct work_struct downshift_task; |
367 | struct work_struct update_phy_task; | 370 | struct work_struct update_phy_task; |
368 | struct work_struct led_blink_task; | 371 | struct work_struct led_blink_task; |
372 | struct work_struct print_hang_task; | ||
369 | }; | 373 | }; |
370 | 374 | ||
371 | struct e1000_info { | 375 | struct e1000_info { |
372 | enum e1000_mac_type mac; | 376 | enum e1000_mac_type mac; |
373 | unsigned int flags; | 377 | unsigned int flags; |
374 | unsigned int flags2; | 378 | unsigned int flags2; |
375 | u32 pba; | 379 | u32 pba; |
376 | u32 max_hw_frame_size; | 380 | u32 max_hw_frame_size; |
377 | s32 (*get_variants)(struct e1000_adapter *); | 381 | s32 (*get_variants)(struct e1000_adapter *); |
@@ -417,6 +421,8 @@ struct e1000_info { | |||
417 | /* CRC Stripping defines */ | 421 | /* CRC Stripping defines */ |
418 | #define FLAG2_CRC_STRIPPING (1 << 0) | 422 | #define FLAG2_CRC_STRIPPING (1 << 0) |
419 | #define FLAG2_HAS_PHY_WAKEUP (1 << 1) | 423 | #define FLAG2_HAS_PHY_WAKEUP (1 << 1) |
424 | #define FLAG2_IS_DISCARDING (1 << 2) | ||
425 | #define FLAG2_DISABLE_ASPM_L1 (1 << 3) | ||
420 | 426 | ||
421 | #define E1000_RX_DESC_PS(R, i) \ | 427 | #define E1000_RX_DESC_PS(R, i) \ |
422 | (&(((union e1000_rx_desc_packet_split *)((R).desc))[i])) | 428 | (&(((union e1000_rx_desc_packet_split *)((R).desc))[i])) |
@@ -454,9 +460,10 @@ extern int e1000e_setup_tx_resources(struct e1000_adapter *adapter); | |||
454 | extern void e1000e_free_rx_resources(struct e1000_adapter *adapter); | 460 | extern void e1000e_free_rx_resources(struct e1000_adapter *adapter); |
455 | extern void e1000e_free_tx_resources(struct e1000_adapter *adapter); | 461 | extern void e1000e_free_tx_resources(struct e1000_adapter *adapter); |
456 | extern void e1000e_update_stats(struct e1000_adapter *adapter); | 462 | extern void e1000e_update_stats(struct e1000_adapter *adapter); |
457 | extern bool e1000_has_link(struct e1000_adapter *adapter); | 463 | extern bool e1000e_has_link(struct e1000_adapter *adapter); |
458 | extern void e1000e_set_interrupt_capability(struct e1000_adapter *adapter); | 464 | extern void e1000e_set_interrupt_capability(struct e1000_adapter *adapter); |
459 | extern void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter); | 465 | extern void e1000e_reset_interrupt_capability(struct e1000_adapter *adapter); |
466 | extern void e1000e_disable_aspm(struct pci_dev *pdev, u16 state); | ||
460 | 467 | ||
461 | extern unsigned int copybreak; | 468 | extern unsigned int copybreak; |
462 | 469 | ||
@@ -488,6 +495,7 @@ extern void e1000e_set_kmrn_lock_loss_workaround_ich8lan(struct e1000_hw *hw, | |||
488 | extern void e1000e_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw); | 495 | extern void e1000e_igp3_phy_powerdown_workaround_ich8lan(struct e1000_hw *hw); |
489 | extern void e1000e_gig_downshift_workaround_ich8lan(struct e1000_hw *hw); | 496 | extern void e1000e_gig_downshift_workaround_ich8lan(struct e1000_hw *hw); |
490 | extern void e1000e_disable_gig_wol_ich8lan(struct e1000_hw *hw); | 497 | extern void e1000e_disable_gig_wol_ich8lan(struct e1000_hw *hw); |
498 | extern s32 e1000_configure_k1_ich8lan(struct e1000_hw *hw, bool k1_enable); | ||
491 | 499 | ||
492 | extern s32 e1000e_check_for_copper_link(struct e1000_hw *hw); | 500 | extern s32 e1000e_check_for_copper_link(struct e1000_hw *hw); |
493 | extern s32 e1000e_check_for_fiber_link(struct e1000_hw *hw); | 501 | extern s32 e1000e_check_for_fiber_link(struct e1000_hw *hw); |
@@ -497,6 +505,8 @@ extern s32 e1000e_cleanup_led_generic(struct e1000_hw *hw); | |||
497 | extern s32 e1000e_led_on_generic(struct e1000_hw *hw); | 505 | extern s32 e1000e_led_on_generic(struct e1000_hw *hw); |
498 | extern s32 e1000e_led_off_generic(struct e1000_hw *hw); | 506 | extern s32 e1000e_led_off_generic(struct e1000_hw *hw); |
499 | extern s32 e1000e_get_bus_info_pcie(struct e1000_hw *hw); | 507 | extern s32 e1000e_get_bus_info_pcie(struct e1000_hw *hw); |
508 | extern void e1000_set_lan_id_multi_port_pcie(struct e1000_hw *hw); | ||
509 | extern void e1000_set_lan_id_single_port(struct e1000_hw *hw); | ||
500 | extern s32 e1000e_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed, u16 *duplex); | 510 | extern s32 e1000e_get_speed_and_duplex_copper(struct e1000_hw *hw, u16 *speed, u16 *duplex); |
501 | extern s32 e1000e_get_speed_and_duplex_fiber_serdes(struct e1000_hw *hw, u16 *speed, u16 *duplex); | 511 | extern s32 e1000e_get_speed_and_duplex_fiber_serdes(struct e1000_hw *hw, u16 *speed, u16 *duplex); |
502 | extern s32 e1000e_disable_pcie_master(struct e1000_hw *hw); | 512 | extern s32 e1000e_disable_pcie_master(struct e1000_hw *hw); |
@@ -507,13 +517,11 @@ extern s32 e1000e_setup_fiber_serdes_link(struct e1000_hw *hw); | |||
507 | extern s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw); | 517 | extern s32 e1000e_copper_link_setup_m88(struct e1000_hw *hw); |
508 | extern s32 e1000e_copper_link_setup_igp(struct e1000_hw *hw); | 518 | extern s32 e1000e_copper_link_setup_igp(struct e1000_hw *hw); |
509 | extern s32 e1000e_setup_link(struct e1000_hw *hw); | 519 | extern s32 e1000e_setup_link(struct e1000_hw *hw); |
510 | extern void e1000e_clear_vfta(struct e1000_hw *hw); | 520 | extern void e1000_clear_vfta_generic(struct e1000_hw *hw); |
511 | extern void e1000e_init_rx_addrs(struct e1000_hw *hw, u16 rar_count); | 521 | extern void e1000e_init_rx_addrs(struct e1000_hw *hw, u16 rar_count); |
512 | extern void e1000e_update_mc_addr_list_generic(struct e1000_hw *hw, | 522 | extern void e1000e_update_mc_addr_list_generic(struct e1000_hw *hw, |
513 | u8 *mc_addr_list, | 523 | u8 *mc_addr_list, |
514 | u32 mc_addr_count, | 524 | u32 mc_addr_count); |
515 | u32 rar_used_count, | ||
516 | u32 rar_count); | ||
517 | extern void e1000e_rar_set(struct e1000_hw *hw, u8 *addr, u32 index); | 525 | extern void e1000e_rar_set(struct e1000_hw *hw, u8 *addr, u32 index); |
518 | extern s32 e1000e_set_fc_watermarks(struct e1000_hw *hw); | 526 | extern s32 e1000e_set_fc_watermarks(struct e1000_hw *hw); |
519 | extern void e1000e_set_pcie_no_snoop(struct e1000_hw *hw, u32 no_snoop); | 527 | extern void e1000e_set_pcie_no_snoop(struct e1000_hw *hw, u32 no_snoop); |
@@ -523,7 +531,8 @@ extern void e1000e_config_collision_dist(struct e1000_hw *hw); | |||
523 | extern s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw); | 531 | extern s32 e1000e_config_fc_after_link_up(struct e1000_hw *hw); |
524 | extern s32 e1000e_force_mac_fc(struct e1000_hw *hw); | 532 | extern s32 e1000e_force_mac_fc(struct e1000_hw *hw); |
525 | extern s32 e1000e_blink_led(struct e1000_hw *hw); | 533 | extern s32 e1000e_blink_led(struct e1000_hw *hw); |
526 | extern void e1000e_write_vfta(struct e1000_hw *hw, u32 offset, u32 value); | 534 | extern void e1000_write_vfta_generic(struct e1000_hw *hw, u32 offset, u32 value); |
535 | extern s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw); | ||
527 | extern void e1000e_reset_adaptive(struct e1000_hw *hw); | 536 | extern void e1000e_reset_adaptive(struct e1000_hw *hw); |
528 | extern void e1000e_update_adaptive(struct e1000_hw *hw); | 537 | extern void e1000e_update_adaptive(struct e1000_hw *hw); |
529 | 538 | ||
@@ -566,6 +575,8 @@ extern s32 e1000e_read_kmrn_reg_locked(struct e1000_hw *hw, u32 offset, | |||
566 | extern s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations, | 575 | extern s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations, |
567 | u32 usec_interval, bool *success); | 576 | u32 usec_interval, bool *success); |
568 | extern s32 e1000e_phy_reset_dsp(struct e1000_hw *hw); | 577 | extern s32 e1000e_phy_reset_dsp(struct e1000_hw *hw); |
578 | extern void e1000_power_up_phy_copper(struct e1000_hw *hw); | ||
579 | extern void e1000_power_down_phy_copper(struct e1000_hw *hw); | ||
569 | extern s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data); | 580 | extern s32 e1000e_read_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 *data); |
570 | extern s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data); | 581 | extern s32 e1000e_write_phy_reg_mdic(struct e1000_hw *hw, u32 offset, u16 data); |
571 | extern s32 e1000e_check_downshift(struct e1000_hw *hw); | 582 | extern s32 e1000e_check_downshift(struct e1000_hw *hw); |
@@ -575,7 +586,6 @@ extern s32 e1000_read_phy_reg_hv_locked(struct e1000_hw *hw, u32 offset, | |||
575 | extern s32 e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data); | 586 | extern s32 e1000_write_phy_reg_hv(struct e1000_hw *hw, u32 offset, u16 data); |
576 | extern s32 e1000_write_phy_reg_hv_locked(struct e1000_hw *hw, u32 offset, | 587 | extern s32 e1000_write_phy_reg_hv_locked(struct e1000_hw *hw, u32 offset, |
577 | u16 data); | 588 | u16 data); |
578 | extern s32 e1000_set_mdio_slow_mode_hv(struct e1000_hw *hw, bool slow); | ||
579 | extern s32 e1000_link_stall_workaround_hv(struct e1000_hw *hw); | 589 | extern s32 e1000_link_stall_workaround_hv(struct e1000_hw *hw); |
580 | extern s32 e1000_copper_link_setup_82577(struct e1000_hw *hw); | 590 | extern s32 e1000_copper_link_setup_82577(struct e1000_hw *hw); |
581 | extern s32 e1000_check_polarity_82577(struct e1000_hw *hw); | 591 | extern s32 e1000_check_polarity_82577(struct e1000_hw *hw); |
@@ -583,9 +593,15 @@ extern s32 e1000_get_phy_info_82577(struct e1000_hw *hw); | |||
583 | extern s32 e1000_phy_force_speed_duplex_82577(struct e1000_hw *hw); | 593 | extern s32 e1000_phy_force_speed_duplex_82577(struct e1000_hw *hw); |
584 | extern s32 e1000_get_cable_length_82577(struct e1000_hw *hw); | 594 | extern s32 e1000_get_cable_length_82577(struct e1000_hw *hw); |
585 | 595 | ||
596 | extern s32 e1000_check_polarity_m88(struct e1000_hw *hw); | ||
597 | extern s32 e1000_get_phy_info_ife(struct e1000_hw *hw); | ||
598 | extern s32 e1000_check_polarity_ife(struct e1000_hw *hw); | ||
599 | extern s32 e1000_phy_force_speed_duplex_ife(struct e1000_hw *hw); | ||
600 | extern s32 e1000_check_polarity_igp(struct e1000_hw *hw); | ||
601 | |||
586 | static inline s32 e1000_phy_hw_reset(struct e1000_hw *hw) | 602 | static inline s32 e1000_phy_hw_reset(struct e1000_hw *hw) |
587 | { | 603 | { |
588 | return hw->phy.ops.reset_phy(hw); | 604 | return hw->phy.ops.reset(hw); |
589 | } | 605 | } |
590 | 606 | ||
591 | static inline s32 e1000_check_reset_block(struct e1000_hw *hw) | 607 | static inline s32 e1000_check_reset_block(struct e1000_hw *hw) |
@@ -595,12 +611,12 @@ static inline s32 e1000_check_reset_block(struct e1000_hw *hw) | |||
595 | 611 | ||
596 | static inline s32 e1e_rphy(struct e1000_hw *hw, u32 offset, u16 *data) | 612 | static inline s32 e1e_rphy(struct e1000_hw *hw, u32 offset, u16 *data) |
597 | { | 613 | { |
598 | return hw->phy.ops.read_phy_reg(hw, offset, data); | 614 | return hw->phy.ops.read_reg(hw, offset, data); |
599 | } | 615 | } |
600 | 616 | ||
601 | static inline s32 e1e_wphy(struct e1000_hw *hw, u32 offset, u16 data) | 617 | static inline s32 e1e_wphy(struct e1000_hw *hw, u32 offset, u16 data) |
602 | { | 618 | { |
603 | return hw->phy.ops.write_phy_reg(hw, offset, data); | 619 | return hw->phy.ops.write_reg(hw, offset, data); |
604 | } | 620 | } |
605 | 621 | ||
606 | static inline s32 e1000_get_cable_length(struct e1000_hw *hw) | 622 | static inline s32 e1000_get_cable_length(struct e1000_hw *hw) |
@@ -616,31 +632,39 @@ extern s32 e1000e_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 | |||
616 | extern s32 e1000e_validate_nvm_checksum_generic(struct e1000_hw *hw); | 632 | extern s32 e1000e_validate_nvm_checksum_generic(struct e1000_hw *hw); |
617 | extern void e1000e_release_nvm(struct e1000_hw *hw); | 633 | extern void e1000e_release_nvm(struct e1000_hw *hw); |
618 | extern void e1000e_reload_nvm(struct e1000_hw *hw); | 634 | extern void e1000e_reload_nvm(struct e1000_hw *hw); |
619 | extern s32 e1000e_read_mac_addr(struct e1000_hw *hw); | 635 | extern s32 e1000_read_mac_addr_generic(struct e1000_hw *hw); |
636 | |||
637 | static inline s32 e1000e_read_mac_addr(struct e1000_hw *hw) | ||
638 | { | ||
639 | if (hw->mac.ops.read_mac_addr) | ||
640 | return hw->mac.ops.read_mac_addr(hw); | ||
641 | |||
642 | return e1000_read_mac_addr_generic(hw); | ||
643 | } | ||
620 | 644 | ||
621 | static inline s32 e1000_validate_nvm_checksum(struct e1000_hw *hw) | 645 | static inline s32 e1000_validate_nvm_checksum(struct e1000_hw *hw) |
622 | { | 646 | { |
623 | return hw->nvm.ops.validate_nvm(hw); | 647 | return hw->nvm.ops.validate(hw); |
624 | } | 648 | } |
625 | 649 | ||
626 | static inline s32 e1000e_update_nvm_checksum(struct e1000_hw *hw) | 650 | static inline s32 e1000e_update_nvm_checksum(struct e1000_hw *hw) |
627 | { | 651 | { |
628 | return hw->nvm.ops.update_nvm(hw); | 652 | return hw->nvm.ops.update(hw); |
629 | } | 653 | } |
630 | 654 | ||
631 | static inline s32 e1000_read_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) | 655 | static inline s32 e1000_read_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) |
632 | { | 656 | { |
633 | return hw->nvm.ops.read_nvm(hw, offset, words, data); | 657 | return hw->nvm.ops.read(hw, offset, words, data); |
634 | } | 658 | } |
635 | 659 | ||
636 | static inline s32 e1000_write_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) | 660 | static inline s32 e1000_write_nvm(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) |
637 | { | 661 | { |
638 | return hw->nvm.ops.write_nvm(hw, offset, words, data); | 662 | return hw->nvm.ops.write(hw, offset, words, data); |
639 | } | 663 | } |
640 | 664 | ||
641 | static inline s32 e1000_get_phy_info(struct e1000_hw *hw) | 665 | static inline s32 e1000_get_phy_info(struct e1000_hw *hw) |
642 | { | 666 | { |
643 | return hw->phy.ops.get_phy_info(hw); | 667 | return hw->phy.ops.get_info(hw); |
644 | } | 668 | } |
645 | 669 | ||
646 | static inline s32 e1000e_check_mng_mode(struct e1000_hw *hw) | 670 | static inline s32 e1000e_check_mng_mode(struct e1000_hw *hw) |