⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 e1000_hw.h

📁 linux-2.4.29操作系统的源码
💻 H
📖 第 1 页 / 共 5 页
字号:
/*******************************************************************************    Copyright(c) 1999 - 2004 Intel Corporation. All rights reserved.    This program is free software; you can redistribute it and/or modify it   under the terms of the GNU General Public License as published by the Free   Software Foundation; either version 2 of the License, or (at your option)   any later version.    This program is distributed in the hope that it will be useful, but WITHOUT   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for   more details.    You should have received a copy of the GNU General Public License along with  this program; if not, write to the Free Software Foundation, Inc., 59   Temple Place - Suite 330, Boston, MA  02111-1307, USA.    The full GNU General Public License is included in this distribution in the  file called LICENSE.    Contact Information:  Linux NICS <linux.nics@intel.com>  Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497*******************************************************************************//* e1000_hw.h * Structures, enums, and macros for the MAC */#ifndef _E1000_HW_H_#define _E1000_HW_H_#include "e1000_osdep.h"/* Forward declarations of structures used by the shared code */struct e1000_hw;struct e1000_hw_stats;/* Enumerated types specific to the e1000 hardware *//* Media Access Controlers */typedef enum {    e1000_undefined = 0,    e1000_82542_rev2_0,    e1000_82542_rev2_1,    e1000_82543,    e1000_82544,    e1000_82540,    e1000_82545,    e1000_82545_rev_3,    e1000_82546,    e1000_82546_rev_3,    e1000_82541,    e1000_82541_rev_2,    e1000_82547,    e1000_82547_rev_2,    e1000_num_macs} e1000_mac_type;typedef enum {    e1000_eeprom_uninitialized = 0,    e1000_eeprom_spi,    e1000_eeprom_microwire,    e1000_num_eeprom_types} e1000_eeprom_type;/* Media Types */typedef enum {    e1000_media_type_copper = 0,    e1000_media_type_fiber = 1,    e1000_media_type_internal_serdes = 2,    e1000_num_media_types} e1000_media_type;typedef enum {    e1000_10_half = 0,    e1000_10_full = 1,    e1000_100_half = 2,    e1000_100_full = 3} e1000_speed_duplex_type;/* Flow Control Settings */typedef enum {    e1000_fc_none = 0,    e1000_fc_rx_pause = 1,    e1000_fc_tx_pause = 2,    e1000_fc_full = 3,    e1000_fc_default = 0xFF} e1000_fc_type;/* PCI bus types */typedef enum {    e1000_bus_type_unknown = 0,    e1000_bus_type_pci,    e1000_bus_type_pcix,    e1000_bus_type_reserved} e1000_bus_type;/* PCI bus speeds */typedef enum {    e1000_bus_speed_unknown = 0,    e1000_bus_speed_33,    e1000_bus_speed_66,    e1000_bus_speed_100,    e1000_bus_speed_120,    e1000_bus_speed_133,    e1000_bus_speed_reserved} e1000_bus_speed;/* PCI bus widths */typedef enum {    e1000_bus_width_unknown = 0,    e1000_bus_width_32,    e1000_bus_width_64,    e1000_bus_width_reserved} e1000_bus_width;/* PHY status info structure and supporting enums */typedef enum {    e1000_cable_length_50 = 0,    e1000_cable_length_50_80,    e1000_cable_length_80_110,    e1000_cable_length_110_140,    e1000_cable_length_140,    e1000_cable_length_undefined = 0xFF} e1000_cable_length;typedef enum {    e1000_igp_cable_length_10  = 10,    e1000_igp_cable_length_20  = 20,    e1000_igp_cable_length_30  = 30,    e1000_igp_cable_length_40  = 40,    e1000_igp_cable_length_50  = 50,    e1000_igp_cable_length_60  = 60,    e1000_igp_cable_length_70  = 70,    e1000_igp_cable_length_80  = 80,    e1000_igp_cable_length_90  = 90,    e1000_igp_cable_length_100 = 100,    e1000_igp_cable_length_110 = 110,    e1000_igp_cable_length_120 = 120,    e1000_igp_cable_length_130 = 130,    e1000_igp_cable_length_140 = 140,    e1000_igp_cable_length_150 = 150,    e1000_igp_cable_length_160 = 160,    e1000_igp_cable_length_170 = 170,    e1000_igp_cable_length_180 = 180} e1000_igp_cable_length;typedef enum {    e1000_10bt_ext_dist_enable_normal = 0,    e1000_10bt_ext_dist_enable_lower,    e1000_10bt_ext_dist_enable_undefined = 0xFF} e1000_10bt_ext_dist_enable;typedef enum {    e1000_rev_polarity_normal = 0,    e1000_rev_polarity_reversed,    e1000_rev_polarity_undefined = 0xFF} e1000_rev_polarity;typedef enum {    e1000_downshift_normal = 0,    e1000_downshift_activated,    e1000_downshift_undefined = 0xFF} e1000_downshift;typedef enum {    e1000_smart_speed_default = 0,    e1000_smart_speed_on,    e1000_smart_speed_off} e1000_smart_speed;typedef enum {    e1000_polarity_reversal_enabled = 0,    e1000_polarity_reversal_disabled,    e1000_polarity_reversal_undefined = 0xFF} e1000_polarity_reversal;typedef enum {    e1000_auto_x_mode_manual_mdi = 0,    e1000_auto_x_mode_manual_mdix,    e1000_auto_x_mode_auto1,    e1000_auto_x_mode_auto2,    e1000_auto_x_mode_undefined = 0xFF} e1000_auto_x_mode;typedef enum {    e1000_1000t_rx_status_not_ok = 0,    e1000_1000t_rx_status_ok,    e1000_1000t_rx_status_undefined = 0xFF} e1000_1000t_rx_status;typedef enum {    e1000_phy_m88 = 0,    e1000_phy_igp,    e1000_phy_undefined = 0xFF} e1000_phy_type;typedef enum {    e1000_ms_hw_default = 0,    e1000_ms_force_master,    e1000_ms_force_slave,    e1000_ms_auto} e1000_ms_type;typedef enum {    e1000_ffe_config_enabled = 0,    e1000_ffe_config_active,    e1000_ffe_config_blocked} e1000_ffe_config;typedef enum {    e1000_dsp_config_disabled = 0,    e1000_dsp_config_enabled,    e1000_dsp_config_activated,    e1000_dsp_config_undefined = 0xFF} e1000_dsp_config;struct e1000_phy_info {    e1000_cable_length cable_length;    e1000_10bt_ext_dist_enable extended_10bt_distance;    e1000_rev_polarity cable_polarity;    e1000_downshift downshift;    e1000_polarity_reversal polarity_correction;    e1000_auto_x_mode mdix_mode;    e1000_1000t_rx_status local_rx;    e1000_1000t_rx_status remote_rx;};struct e1000_phy_stats {    uint32_t idle_errors;    uint32_t receive_errors;};struct e1000_eeprom_info {    e1000_eeprom_type type;    uint16_t word_size;    uint16_t opcode_bits;    uint16_t address_bits;    uint16_t delay_usec;    uint16_t page_size;};/* Error Codes */#define E1000_SUCCESS      0#define E1000_ERR_EEPROM   1#define E1000_ERR_PHY      2#define E1000_ERR_CONFIG   3#define E1000_ERR_PARAM    4#define E1000_ERR_MAC_TYPE 5#define E1000_ERR_PHY_TYPE 6/* Function prototypes *//* Initialization */int32_t e1000_reset_hw(struct e1000_hw *hw);int32_t e1000_init_hw(struct e1000_hw *hw);int32_t e1000_set_mac_type(struct e1000_hw *hw);void e1000_set_media_type(struct e1000_hw *hw);/* Link Configuration */int32_t e1000_setup_link(struct e1000_hw *hw);int32_t e1000_phy_setup_autoneg(struct e1000_hw *hw);void e1000_config_collision_dist(struct e1000_hw *hw);int32_t e1000_config_fc_after_link_up(struct e1000_hw *hw);int32_t e1000_check_for_link(struct e1000_hw *hw);int32_t e1000_get_speed_and_duplex(struct e1000_hw *hw, uint16_t * speed, uint16_t * duplex);int32_t e1000_wait_autoneg(struct e1000_hw *hw);int32_t e1000_force_mac_fc(struct e1000_hw *hw);/* PHY */int32_t e1000_read_phy_reg(struct e1000_hw *hw, uint32_t reg_addr, uint16_t *phy_data);int32_t e1000_write_phy_reg(struct e1000_hw *hw, uint32_t reg_addr, uint16_t data);void e1000_phy_hw_reset(struct e1000_hw *hw);int32_t e1000_phy_reset(struct e1000_hw *hw);int32_t e1000_detect_gig_phy(struct e1000_hw *hw);int32_t e1000_phy_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info);int32_t e1000_phy_m88_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info);int32_t e1000_phy_igp_get_info(struct e1000_hw *hw, struct e1000_phy_info *phy_info);int32_t e1000_get_cable_length(struct e1000_hw *hw, uint16_t *min_length, uint16_t *max_length);int32_t e1000_check_polarity(struct e1000_hw *hw, uint16_t *polarity);int32_t e1000_check_downshift(struct e1000_hw *hw);int32_t e1000_validate_mdi_setting(struct e1000_hw *hw);/* EEPROM Functions */void e1000_init_eeprom_params(struct e1000_hw *hw);int32_t e1000_read_eeprom(struct e1000_hw *hw, uint16_t reg, uint16_t words, uint16_t *data);int32_t e1000_validate_eeprom_checksum(struct e1000_hw *hw);int32_t e1000_update_eeprom_checksum(struct e1000_hw *hw);int32_t e1000_write_eeprom(struct e1000_hw *hw, uint16_t reg, uint16_t words, uint16_t *data);int32_t e1000_read_part_num(struct e1000_hw *hw, uint32_t * part_num);int32_t e1000_read_mac_addr(struct e1000_hw * hw);/* Filters (multicast, vlan, receive) */void e1000_init_rx_addrs(struct e1000_hw *hw);void e1000_mc_addr_list_update(struct e1000_hw *hw, uint8_t * mc_addr_list, uint32_t mc_addr_count, uint32_t pad, uint32_t rar_used_count);uint32_t e1000_hash_mc_addr(struct e1000_hw *hw, uint8_t * mc_addr);

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -