xref: /onnv-gate/usr/src/uts/common/io/ixgbe/ixgbe_api.h (revision 10998:fa3b21f3b03c)
16621Sbt150084 /*
26621Sbt150084  * CDDL HEADER START
36621Sbt150084  *
49353SSamuel.Tu@Sun.COM  * Copyright(c) 2007-2009 Intel Corporation. All rights reserved.
56621Sbt150084  * The contents of this file are subject to the terms of the
66621Sbt150084  * Common Development and Distribution License (the "License").
76621Sbt150084  * You may not use this file except in compliance with the License.
86621Sbt150084  *
96621Sbt150084  * You can obtain a copy of the license at:
106621Sbt150084  *      http://www.opensolaris.org/os/licensing.
116621Sbt150084  * See the License for the specific language governing permissions
126621Sbt150084  * and limitations under the License.
136621Sbt150084  *
146621Sbt150084  * When using or redistributing this file, you may do so under the
156621Sbt150084  * License only. No other modification of this header is permitted.
166621Sbt150084  *
176621Sbt150084  * If applicable, add the following below this CDDL HEADER, with the
186621Sbt150084  * fields enclosed by brackets "[]" replaced with your own identifying
196621Sbt150084  * information: Portions Copyright [yyyy] [name of copyright owner]
206621Sbt150084  *
216621Sbt150084  * CDDL HEADER END
226621Sbt150084  */
236621Sbt150084 
246621Sbt150084 /*
258490SPaul.Guo@Sun.COM  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
269353SSamuel.Tu@Sun.COM  * Use is subject to license terms.
276621Sbt150084  */
286621Sbt150084 
29*10998SChenlu.Chen@Sun.COM /* IntelVersion: 1.77 scm_100309_002210 */
306621Sbt150084 
316621Sbt150084 #ifndef _IXGBE_API_H
326621Sbt150084 #define	_IXGBE_API_H
336621Sbt150084 
346621Sbt150084 #include "ixgbe_type.h"
356621Sbt150084 
366621Sbt150084 s32 ixgbe_init_shared_code(struct ixgbe_hw *hw);
376621Sbt150084 
386621Sbt150084 s32 ixgbe_set_mac_type(struct ixgbe_hw *hw);
396621Sbt150084 s32 ixgbe_init_hw(struct ixgbe_hw *hw);
406621Sbt150084 s32 ixgbe_reset_hw(struct ixgbe_hw *hw);
416621Sbt150084 s32 ixgbe_start_hw(struct ixgbe_hw *hw);
426621Sbt150084 s32 ixgbe_clear_hw_cntrs(struct ixgbe_hw *hw);
436621Sbt150084 enum ixgbe_media_type ixgbe_get_media_type(struct ixgbe_hw *hw);
446621Sbt150084 s32 ixgbe_get_mac_addr(struct ixgbe_hw *hw, u8 *mac_addr);
456621Sbt150084 s32 ixgbe_get_bus_info(struct ixgbe_hw *hw);
466621Sbt150084 u32 ixgbe_get_num_of_tx_queues(struct ixgbe_hw *hw);
476621Sbt150084 u32 ixgbe_get_num_of_rx_queues(struct ixgbe_hw *hw);
486621Sbt150084 s32 ixgbe_stop_adapter(struct ixgbe_hw *hw);
496621Sbt150084 s32 ixgbe_read_pba_num(struct ixgbe_hw *hw, u32 *pba_num);
506621Sbt150084 
516621Sbt150084 s32 ixgbe_identify_phy(struct ixgbe_hw *hw);
526621Sbt150084 s32 ixgbe_reset_phy(struct ixgbe_hw *hw);
536621Sbt150084 s32 ixgbe_read_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
546621Sbt150084     u16 *phy_data);
556621Sbt150084 s32 ixgbe_write_phy_reg(struct ixgbe_hw *hw, u32 reg_addr, u32 device_type,
566621Sbt150084     u16 phy_data);
576621Sbt150084 
586621Sbt150084 s32 ixgbe_setup_phy_link(struct ixgbe_hw *hw);
596621Sbt150084 s32 ixgbe_check_phy_link(struct ixgbe_hw *hw,
606621Sbt150084     ixgbe_link_speed *speed, bool *link_up);
616621Sbt150084 s32 ixgbe_setup_phy_link_speed(struct ixgbe_hw *hw, ixgbe_link_speed speed,
626621Sbt150084     bool autoneg, bool autoneg_wait_to_complete);
63*10998SChenlu.Chen@Sun.COM s32 ixgbe_setup_link(struct ixgbe_hw *hw, ixgbe_link_speed speed,
646621Sbt150084     bool autoneg, bool autoneg_wait_to_complete);
656621Sbt150084 s32 ixgbe_check_link(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
668490SPaul.Guo@Sun.COM     bool *link_up, bool link_up_wait_to_complete);
676621Sbt150084 s32 ixgbe_get_link_capabilities(struct ixgbe_hw *hw, ixgbe_link_speed *speed,
686621Sbt150084     bool *autoneg);
696621Sbt150084 s32 ixgbe_led_on(struct ixgbe_hw *hw, u32 index);
706621Sbt150084 s32 ixgbe_led_off(struct ixgbe_hw *hw, u32 index);
716621Sbt150084 s32 ixgbe_blink_led_start(struct ixgbe_hw *hw, u32 index);
726621Sbt150084 s32 ixgbe_blink_led_stop(struct ixgbe_hw *hw, u32 index);
736621Sbt150084 
746621Sbt150084 s32 ixgbe_init_eeprom_params(struct ixgbe_hw *hw);
756621Sbt150084 s32 ixgbe_write_eeprom(struct ixgbe_hw *hw, u16 offset, u16 data);
766621Sbt150084 s32 ixgbe_read_eeprom(struct ixgbe_hw *hw, u16 offset, u16 *data);
776621Sbt150084 s32 ixgbe_validate_eeprom_checksum(struct ixgbe_hw *hw, u16 *checksum_val);
786621Sbt150084 s32 ixgbe_update_eeprom_checksum(struct ixgbe_hw *hw);
796621Sbt150084 
809353SSamuel.Tu@Sun.COM s32 ixgbe_insert_mac_addr(struct ixgbe_hw *hw, u8 *addr, u32 vmdq);
816621Sbt150084 s32 ixgbe_set_rar(struct ixgbe_hw *hw, u32 index, u8 *addr, u32 vmdq,
826621Sbt150084     u32 enable_addr);
838490SPaul.Guo@Sun.COM s32 ixgbe_clear_rar(struct ixgbe_hw *hw, u32 index);
846621Sbt150084 s32 ixgbe_set_vmdq(struct ixgbe_hw *hw, u32 rar, u32 vmdq);
858490SPaul.Guo@Sun.COM s32 ixgbe_clear_vmdq(struct ixgbe_hw *hw, u32 rar, u32 vmdq);
866621Sbt150084 s32 ixgbe_init_rx_addrs(struct ixgbe_hw *hw);
876621Sbt150084 u32 ixgbe_get_num_rx_addrs(struct ixgbe_hw *hw);
886621Sbt150084 s32 ixgbe_update_uc_addr_list(struct ixgbe_hw *hw, u8 *addr_list,
896621Sbt150084     u32 addr_count, ixgbe_mc_addr_itr func);
906621Sbt150084 s32 ixgbe_update_mc_addr_list(struct ixgbe_hw *hw, u8 *mc_addr_list,
916621Sbt150084     u32 mc_addr_count, ixgbe_mc_addr_itr func);
92*10998SChenlu.Chen@Sun.COM void ixgbe_add_uc_addr(struct ixgbe_hw *hw, u8 *addr_list, u32 vmdq);
936621Sbt150084 s32 ixgbe_enable_mc(struct ixgbe_hw *hw);
946621Sbt150084 s32 ixgbe_disable_mc(struct ixgbe_hw *hw);
956621Sbt150084 s32 ixgbe_clear_vfta(struct ixgbe_hw *hw);
966621Sbt150084 s32 ixgbe_set_vfta(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on);
976621Sbt150084 
989353SSamuel.Tu@Sun.COM s32 ixgbe_fc_enable(struct ixgbe_hw *hw, s32 packetbuf_num);
996621Sbt150084 
1006621Sbt150084 void ixgbe_set_mta(struct ixgbe_hw *hw, u8 *mc_addr);
1016621Sbt150084 s32 ixgbe_get_phy_firmware_version(struct ixgbe_hw *hw,
1026621Sbt150084     u16 *firmware_version);
1036621Sbt150084 s32 ixgbe_read_analog_reg8(struct ixgbe_hw *hw, u32 reg, u8 *val);
1046621Sbt150084 s32 ixgbe_write_analog_reg8(struct ixgbe_hw *hw, u32 reg, u8 val);
1058490SPaul.Guo@Sun.COM s32 ixgbe_init_uta_tables(struct ixgbe_hw *hw);
1068490SPaul.Guo@Sun.COM s32 ixgbe_read_i2c_eeprom(struct ixgbe_hw *hw, u8 byte_offset, u8 *eeprom_data);
1079353SSamuel.Tu@Sun.COM u32 ixgbe_get_supported_physical_layer(struct ixgbe_hw *hw);
1089353SSamuel.Tu@Sun.COM s32 ixgbe_enable_rx_dma(struct ixgbe_hw *hw, u32 regval);
1099353SSamuel.Tu@Sun.COM s32 ixgbe_reinit_fdir_tables_82599(struct ixgbe_hw *hw);
1109353SSamuel.Tu@Sun.COM s32 ixgbe_init_fdir_signature_82599(struct ixgbe_hw *hw, u32 pballoc);
1119353SSamuel.Tu@Sun.COM s32 ixgbe_init_fdir_perfect_82599(struct ixgbe_hw *hw, u32 pballoc);
1129353SSamuel.Tu@Sun.COM s32 ixgbe_fdir_add_signature_filter_82599(struct ixgbe_hw *hw,
1139353SSamuel.Tu@Sun.COM     struct ixgbe_atr_input *input, u8 queue);
1149353SSamuel.Tu@Sun.COM s32 ixgbe_fdir_add_perfect_filter_82599(struct ixgbe_hw *hw,
1159353SSamuel.Tu@Sun.COM     struct ixgbe_atr_input *input, u16 soft_id, u8 queue);
1169353SSamuel.Tu@Sun.COM u16 ixgbe_atr_compute_hash_82599(struct ixgbe_atr_input *input, u32 key);
1179353SSamuel.Tu@Sun.COM s32 ixgbe_atr_set_vlan_id_82599(struct ixgbe_atr_input *input, u16 vlan_id);
1189353SSamuel.Tu@Sun.COM s32 ixgbe_atr_set_src_ipv4_82599(struct ixgbe_atr_input *input, u32 src_addr);
1199353SSamuel.Tu@Sun.COM s32 ixgbe_atr_set_dst_ipv4_82599(struct ixgbe_atr_input *input, u32 dst_addr);
1209353SSamuel.Tu@Sun.COM s32 ixgbe_atr_set_src_ipv6_82599(struct ixgbe_atr_input *input, u32 src_addr_1,
1219353SSamuel.Tu@Sun.COM     u32 src_addr_2, u32 src_addr_3, u32 src_addr_4);
1229353SSamuel.Tu@Sun.COM s32 ixgbe_atr_set_dst_ipv6_82599(struct ixgbe_atr_input *input, u32 dst_addr_1,
1239353SSamuel.Tu@Sun.COM     u32 dst_addr_2, u32 dst_addr_3, u32 dst_addr_4);
1249353SSamuel.Tu@Sun.COM s32 ixgbe_atr_set_src_port_82599(struct ixgbe_atr_input *input, u16 src_port);
1259353SSamuel.Tu@Sun.COM s32 ixgbe_atr_set_dst_port_82599(struct ixgbe_atr_input *input, u16 dst_port);
1269353SSamuel.Tu@Sun.COM s32 ixgbe_atr_set_flex_byte_82599(struct ixgbe_atr_input *input, u16 flex_byte);
1279353SSamuel.Tu@Sun.COM s32 ixgbe_atr_set_vm_pool_82599(struct ixgbe_atr_input *input, u8 vm_pool);
1289353SSamuel.Tu@Sun.COM s32 ixgbe_atr_set_l4type_82599(struct ixgbe_atr_input *input, u8 l4type);
1299353SSamuel.Tu@Sun.COM s32 ixgbe_atr_get_vlan_id_82599(struct ixgbe_atr_input *input, u16 *vlan_id);
1309353SSamuel.Tu@Sun.COM s32 ixgbe_atr_get_src_ipv4_82599(struct ixgbe_atr_input *input, u32 *src_addr);
1319353SSamuel.Tu@Sun.COM s32 ixgbe_atr_get_dst_ipv4_82599(struct ixgbe_atr_input *input, u32 *dst_addr);
1329353SSamuel.Tu@Sun.COM s32 ixgbe_atr_get_src_ipv6_82599(struct ixgbe_atr_input *input, u32 *src_addr_1,
1339353SSamuel.Tu@Sun.COM     u32 *src_addr_2, u32 *src_addr_3, u32 *src_addr_4);
1349353SSamuel.Tu@Sun.COM s32 ixgbe_atr_get_dst_ipv6_82599(struct ixgbe_atr_input *input, u32 *dst_addr_1,
1359353SSamuel.Tu@Sun.COM     u32 *dst_addr_2, u32 *dst_addr_3, u32 *dst_addr_4);
1369353SSamuel.Tu@Sun.COM s32 ixgbe_atr_get_src_port_82599(struct ixgbe_atr_input *input, u16 *src_port);
1379353SSamuel.Tu@Sun.COM s32 ixgbe_atr_get_dst_port_82599(struct ixgbe_atr_input *input, u16 *dst_port);
1389353SSamuel.Tu@Sun.COM s32 ixgbe_atr_get_flex_byte_82599(struct ixgbe_atr_input *input,
1399353SSamuel.Tu@Sun.COM     u16 *flex_byte);
1409353SSamuel.Tu@Sun.COM s32 ixgbe_atr_get_vm_pool_82599(struct ixgbe_atr_input *input, u8 *vm_pool);
1419353SSamuel.Tu@Sun.COM s32 ixgbe_atr_get_l4type_82599(struct ixgbe_atr_input *input, u8 *l4type);
1429353SSamuel.Tu@Sun.COM s32 ixgbe_read_i2c_byte(struct ixgbe_hw *hw, u8 byte_offset, u8 dev_addr,
1439353SSamuel.Tu@Sun.COM     u8 *data);
1449353SSamuel.Tu@Sun.COM s32 ixgbe_write_i2c_byte(struct ixgbe_hw *hw, u8 byte_offset, u8 dev_addr,
1459353SSamuel.Tu@Sun.COM     u8 data);
1469353SSamuel.Tu@Sun.COM s32 ixgbe_write_i2c_eeprom(struct ixgbe_hw *hw, u8 byte_offset, u8 eeprom_data);
1479353SSamuel.Tu@Sun.COM s32 ixgbe_get_san_mac_addr(struct ixgbe_hw *hw, u8 *san_mac_addr);
1489353SSamuel.Tu@Sun.COM s32 ixgbe_set_san_mac_addr(struct ixgbe_hw *hw, u8 *san_mac_addr);
1499353SSamuel.Tu@Sun.COM s32 ixgbe_get_device_caps(struct ixgbe_hw *hw, u16 *device_caps);
15010305SPaul.Guo@Sun.COM s32 ixgbe_acquire_swfw_semaphore(struct ixgbe_hw *hw, u16 mask);
15110305SPaul.Guo@Sun.COM void ixgbe_release_swfw_semaphore(struct ixgbe_hw *hw, u16 mask);
152*10998SChenlu.Chen@Sun.COM s32 ixgbe_get_wwn_prefix(struct ixgbe_hw *hw, u16 *wwnn_prefix,
153*10998SChenlu.Chen@Sun.COM     u16 *wwpn_prefix);
1546621Sbt150084 
1556621Sbt150084 #endif /* _IXGBE_API_H */
156