a9f95155449d9cf0c9151bfc2fb843693124cc56
[akaros.git] / kern / drivers / net / e1000 / e1000_api.h
1 /*******************************************************************************
2
3   Intel PRO/1000 Linux driver
4   Copyright(c) 1999 - 2008 Intel Corporation.
5
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,
8   version 2, as published by the Free Software Foundation.
9
10   This program is distributed in the hope it will be useful, but WITHOUT
11   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
12   FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
13   more details.
14
15   You should have received a copy of the GNU General Public License along with
16   this program; if not, write to the Free Software Foundation, Inc.,
17   51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
18
19   The full GNU General Public License is included in this distribution in
20   the file called "COPYING".
21
22   Contact Information:
23   Linux NICS <linux.nics@intel.com>
24   e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
25   Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
26
27 *******************************************************************************/
28
29 #ifndef _E1000_API_H_
30 #define _E1000_API_H_
31
32 #include "e1000_hw.h"
33
34 extern void e1000_init_function_pointers_82542(struct e1000_hw *hw)
35         __attribute__ ((weak));
36 extern void e1000_init_function_pointers_82543(struct e1000_hw *hw)
37         __attribute__ ((weak));
38 extern void e1000_init_function_pointers_82540(struct e1000_hw *hw)
39         __attribute__ ((weak));
40 extern void e1000_init_function_pointers_82541(struct e1000_hw *hw)
41         __attribute__ ((weak));
42
43 int32_t e1000_set_mac_type(struct e1000_hw *hw);
44 int32_t e1000_setup_init_funcs(struct e1000_hw *hw, bool init_device);
45 int32_t e1000_init_mac_params(struct e1000_hw *hw);
46 int32_t e1000_init_nvm_params(struct e1000_hw *hw);
47 int32_t e1000_init_phy_params(struct e1000_hw *hw);
48 int32_t e1000_get_bus_info(struct e1000_hw *hw);
49 void e1000_clear_vfta(struct e1000_hw *hw);
50 void e1000_write_vfta(struct e1000_hw *hw, uint32_t offset, uint32_t value);
51 int32_t e1000_force_mac_fc(struct e1000_hw *hw);
52 int32_t e1000_check_for_link(struct e1000_hw *hw);
53 int32_t e1000_reset_hw(struct e1000_hw *hw);
54 int32_t e1000_init_hw(struct e1000_hw *hw);
55 int32_t e1000_setup_link(struct e1000_hw *hw);
56 int32_t e1000_get_speed_and_duplex(struct e1000_hw *hw, uint16_t * speed,
57                                                                    uint16_t * duplex);
58 int32_t e1000_disable_pcie_master(struct e1000_hw *hw);
59 void e1000_config_collision_dist(struct e1000_hw *hw);
60 void e1000_rar_set(struct e1000_hw *hw, uint8_t * addr, uint32_t index);
61 void e1000_mta_set(struct e1000_hw *hw, uint32_t hash_value);
62 uint32_t e1000_hash_mc_addr(struct e1000_hw *hw, uint8_t * mc_addr);
63 void e1000_update_mc_addr_list(struct e1000_hw *hw,
64                                                            uint8_t * mc_addr_list, uint32_t mc_addr_count);
65 int32_t e1000_setup_led(struct e1000_hw *hw);
66 int32_t e1000_cleanup_led(struct e1000_hw *hw);
67 int32_t e1000_check_reset_block(struct e1000_hw *hw);
68 int32_t e1000_blink_led(struct e1000_hw *hw);
69 int32_t e1000_led_on(struct e1000_hw *hw);
70 int32_t e1000_led_off(struct e1000_hw *hw);
71 int32_t e1000_id_led_init(struct e1000_hw *hw);
72 void e1000_reset_adaptive(struct e1000_hw *hw);
73 void e1000_update_adaptive(struct e1000_hw *hw);
74 #if 0
75 s32 e1000_get_cable_length(struct e1000_hw *hw);
76 #endif
77 int32_t e1000_validate_mdi_setting(struct e1000_hw *hw);
78 int32_t e1000_read_phy_reg(struct e1000_hw *hw, uint32_t offset,
79                                                    uint16_t * data);
80 int32_t e1000_write_phy_reg(struct e1000_hw *hw, uint32_t offset,
81                                                         uint16_t data);
82 int32_t e1000_get_phy_info(struct e1000_hw *hw);
83 void e1000_release_phy(struct e1000_hw *hw);
84 int32_t e1000_acquire_phy(struct e1000_hw *hw);
85 int32_t e1000_phy_hw_reset(struct e1000_hw *hw);
86 int32_t e1000_phy_commit(struct e1000_hw *hw);
87 void e1000_power_up_phy(struct e1000_hw *hw);
88 void e1000_power_down_phy(struct e1000_hw *hw);
89 int32_t e1000_read_mac_addr(struct e1000_hw *hw);
90 int32_t e1000_read_pba_num(struct e1000_hw *hw, uint32_t * part_num);
91 void e1000_reload_nvm(struct e1000_hw *hw);
92 int32_t e1000_update_nvm_checksum(struct e1000_hw *hw);
93 int32_t e1000_validate_nvm_checksum(struct e1000_hw *hw);
94 int32_t e1000_read_nvm(struct e1000_hw *hw, uint16_t offset, uint16_t words,
95                                            uint16_t * data);
96 int32_t e1000_read_kmrn_reg(struct e1000_hw *hw, uint32_t offset,
97                                                         uint16_t * data);
98 int32_t e1000_write_kmrn_reg(struct e1000_hw *hw, uint32_t offset,
99                                                          uint16_t data);
100 int32_t e1000_write_nvm(struct e1000_hw *hw, uint16_t offset, uint16_t words,
101                                                 uint16_t * data);
102 int32_t e1000_wait_autoneg(struct e1000_hw *hw);
103 int32_t e1000_set_d3_lplu_state(struct e1000_hw *hw, bool active);
104 int32_t e1000_set_d0_lplu_state(struct e1000_hw *hw, bool active);
105 bool e1000_check_mng_mode(struct e1000_hw *hw);
106 bool e1000_enable_tx_pkt_filtering(struct e1000_hw *hw);
107 int32_t e1000_mng_enable_host_if(struct e1000_hw *hw);
108 int32_t e1000_mng_host_if_write(struct e1000_hw *hw,
109                                                                 uint8_t * buffer, uint16_t length,
110                                                                 uint16_t offset, uint8_t * sum);
111 int32_t e1000_mng_write_cmd_header(struct e1000_hw *hw,
112                                                                    struct e1000_host_mng_command_header *hdr);
113 int32_t e1000_mng_write_dhcp_info(struct e1000_hw *hw, uint8_t * buffer,
114                                                                   uint16_t length);
115 uint32_t e1000_translate_register_82542(uint32_t reg) __attribute__ ((weak));
116
117 //extern int e1000_probe(struct pci_device *pdev,
118 //             const struct pci_device_id *id );
119 extern void e1000_remove(struct pci_device *pdev);
120
121 #endif