Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/pci/ixgbe Add some forgotten files in last commit.



details:   https://anonhg.NetBSD.org/src/rev/0f2e2354501e
branches:  trunk
changeset: 807052:0f2e2354501e
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Mar 27 06:04:42 2015 +0000

description:
Add some forgotten files in last commit.

diffstat:

 sys/dev/pci/ixgbe/ixgbe_82598.h |   52 ++
 sys/dev/pci/ixgbe/ixgbe_82599.h |   65 ++
 sys/dev/pci/ixgbe/ixgbe_x540.c  |  971 ++++++++++++++++++++++++++++++++++++++++
 sys/dev/pci/ixgbe/ixgbe_x540.h  |   65 ++
 4 files changed, 1153 insertions(+), 0 deletions(-)

diffs (truncated from 1169 to 300 lines):

diff -r 4e5d59dcddb0 -r 0f2e2354501e sys/dev/pci/ixgbe/ixgbe_82598.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_82598.h   Fri Mar 27 06:04:42 2015 +0000
@@ -0,0 +1,52 @@
+/******************************************************************************
+
+  Copyright (c) 2001-2012, Intel Corporation 
+  All rights reserved.
+  
+  Redistribution and use in source and binary forms, with or without 
+  modification, are permitted provided that the following conditions are met:
+  
+   1. Redistributions of source code must retain the above copyright notice, 
+      this list of conditions and the following disclaimer.
+  
+   2. Redistributions in binary form must reproduce the above copyright 
+      notice, this list of conditions and the following disclaimer in the 
+      documentation and/or other materials provided with the distribution.
+  
+   3. Neither the name of the Intel Corporation nor the names of its 
+      contributors may be used to endorse or promote products derived from 
+      this software without specific prior written permission.
+  
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
+  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
+  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+  POSSIBILITY OF SUCH DAMAGE.
+
+******************************************************************************/
+/*$FreeBSD$*/
+
+#ifndef _IXGBE_82598_H_
+#define _IXGBE_82598_H_
+
+u32 ixgbe_get_pcie_msix_count_82598(struct ixgbe_hw *hw);
+s32 ixgbe_fc_enable_82598(struct ixgbe_hw *hw, s32 packetbuf_num);
+s32 ixgbe_start_hw_82598(struct ixgbe_hw *hw);
+void ixgbe_enable_relaxed_ordering_82598(struct ixgbe_hw *hw);
+s32 ixgbe_set_vmdq_82598(struct ixgbe_hw *hw, u32 rar, u32 vmdq);
+s32 ixgbe_set_vfta_82598(struct ixgbe_hw *hw, u32 vlan, u32 vind, bool vlan_on);
+s32 ixgbe_read_analog_reg8_82598(struct ixgbe_hw *hw, u32 reg, u8 *val);
+s32 ixgbe_write_analog_reg8_82598(struct ixgbe_hw *hw, u32 reg, u8 val);
+s32 ixgbe_read_i2c_eeprom_82598(struct ixgbe_hw *hw, u8 byte_offset,
+                               u8 *eeprom_data);
+u32 ixgbe_get_supported_physical_layer_82598(struct ixgbe_hw *hw);
+s32 ixgbe_init_phy_ops_82598(struct ixgbe_hw *hw);
+void ixgbe_set_lan_id_multi_port_pcie_82598(struct ixgbe_hw *hw);
+void ixgbe_set_pcie_completion_timeout(struct ixgbe_hw *hw);
+#endif /* _IXGBE_82598_H_ */
diff -r 4e5d59dcddb0 -r 0f2e2354501e sys/dev/pci/ixgbe/ixgbe_82599.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_82599.h   Fri Mar 27 06:04:42 2015 +0000
@@ -0,0 +1,65 @@
+/******************************************************************************
+
+  Copyright (c) 2001-2012, Intel Corporation 
+  All rights reserved.
+  
+  Redistribution and use in source and binary forms, with or without 
+  modification, are permitted provided that the following conditions are met:
+  
+   1. Redistributions of source code must retain the above copyright notice, 
+      this list of conditions and the following disclaimer.
+  
+   2. Redistributions in binary form must reproduce the above copyright 
+      notice, this list of conditions and the following disclaimer in the 
+      documentation and/or other materials provided with the distribution.
+  
+   3. Neither the name of the Intel Corporation nor the names of its 
+      contributors may be used to endorse or promote products derived from 
+      this software without specific prior written permission.
+  
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
+  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
+  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+  POSSIBILITY OF SUCH DAMAGE.
+
+******************************************************************************/
+/*$FreeBSD$*/
+
+#ifndef _IXGBE_82599_H_
+#define _IXGBE_82599_H_
+
+s32 ixgbe_get_link_capabilities_82599(struct ixgbe_hw *hw,
+                                     ixgbe_link_speed *speed, bool *autoneg);
+enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw);
+void ixgbe_disable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw);
+void ixgbe_enable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw);
+void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw);
+s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw,
+                                         ixgbe_link_speed speed, bool autoneg,
+                                         bool autoneg_wait_to_complete);
+s32 ixgbe_setup_mac_link_smartspeed(struct ixgbe_hw *hw,
+                                   ixgbe_link_speed speed, bool autoneg,
+                                   bool autoneg_wait_to_complete);
+s32 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw,
+                              bool autoneg_wait_to_complete);
+s32 ixgbe_setup_mac_link_82599(struct ixgbe_hw *hw, ixgbe_link_speed speed,
+                              bool autoneg, bool autoneg_wait_to_complete);
+s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw);
+void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw);
+s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw);
+s32 ixgbe_read_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 *val);
+s32 ixgbe_write_analog_reg8_82599(struct ixgbe_hw *hw, u32 reg, u8 val);
+s32 ixgbe_start_hw_82599(struct ixgbe_hw *hw);
+s32 ixgbe_identify_phy_82599(struct ixgbe_hw *hw);
+s32 ixgbe_init_phy_ops_82599(struct ixgbe_hw *hw);
+u32 ixgbe_get_supported_physical_layer_82599(struct ixgbe_hw *hw);
+s32 ixgbe_enable_rx_dma_82599(struct ixgbe_hw *hw, u32 regval);
+bool ixgbe_verify_lesm_fw_enabled_82599(struct ixgbe_hw *hw);
+#endif /* _IXGBE_82599_H_ */
diff -r 4e5d59dcddb0 -r 0f2e2354501e sys/dev/pci/ixgbe/ixgbe_x540.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/dev/pci/ixgbe/ixgbe_x540.c    Fri Mar 27 06:04:42 2015 +0000
@@ -0,0 +1,971 @@
+/******************************************************************************
+
+  Copyright (c) 2001-2012, Intel Corporation 
+  All rights reserved.
+  
+  Redistribution and use in source and binary forms, with or without 
+  modification, are permitted provided that the following conditions are met:
+  
+   1. Redistributions of source code must retain the above copyright notice, 
+      this list of conditions and the following disclaimer.
+  
+   2. Redistributions in binary form must reproduce the above copyright 
+      notice, this list of conditions and the following disclaimer in the 
+      documentation and/or other materials provided with the distribution.
+  
+   3. Neither the name of the Intel Corporation nor the names of its 
+      contributors may be used to endorse or promote products derived from 
+      this software without specific prior written permission.
+  
+  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+  AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 
+  IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 
+  ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 
+  LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
+  CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 
+  SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
+  INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
+  CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
+  ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+  POSSIBILITY OF SUCH DAMAGE.
+
+******************************************************************************/
+/*$FreeBSD$*/
+
+#include "ixgbe_x540.h"
+#include "ixgbe_type.h"
+#include "ixgbe_api.h"
+#include "ixgbe_common.h"
+#include "ixgbe_phy.h"
+
+static s32 ixgbe_update_flash_X540(struct ixgbe_hw *hw);
+static s32 ixgbe_poll_flash_update_done_X540(struct ixgbe_hw *hw);
+static s32 ixgbe_get_swfw_sync_semaphore(struct ixgbe_hw *hw);
+static void ixgbe_release_swfw_sync_semaphore(struct ixgbe_hw *hw);
+
+/**
+ *  ixgbe_init_ops_X540 - Inits func ptrs and MAC type
+ *  @hw: pointer to hardware structure
+ *
+ *  Initialize the function pointers and assign the MAC type for X540.
+ *  Does not touch the hardware.
+ **/
+s32 ixgbe_init_ops_X540(struct ixgbe_hw *hw)
+{
+       struct ixgbe_mac_info *mac = &hw->mac;
+       struct ixgbe_phy_info *phy = &hw->phy;
+       struct ixgbe_eeprom_info *eeprom = &hw->eeprom;
+       s32 ret_val;
+
+       DEBUGFUNC("ixgbe_init_ops_X540");
+
+       ret_val = ixgbe_init_phy_ops_generic(hw);
+       ret_val = ixgbe_init_ops_generic(hw);
+
+
+       /* EEPROM */
+       eeprom->ops.init_params = &ixgbe_init_eeprom_params_X540;
+       eeprom->ops.read = &ixgbe_read_eerd_X540;
+       eeprom->ops.read_buffer = &ixgbe_read_eerd_buffer_X540;
+       eeprom->ops.write = &ixgbe_write_eewr_X540;
+       eeprom->ops.write_buffer = &ixgbe_write_eewr_buffer_X540;
+       eeprom->ops.update_checksum = &ixgbe_update_eeprom_checksum_X540;
+       eeprom->ops.validate_checksum = &ixgbe_validate_eeprom_checksum_X540;
+       eeprom->ops.calc_checksum = &ixgbe_calc_eeprom_checksum_X540;
+
+       /* PHY */
+       phy->ops.init = &ixgbe_init_phy_ops_generic;
+       phy->ops.reset = NULL;
+
+       /* MAC */
+       mac->ops.reset_hw = &ixgbe_reset_hw_X540;
+       mac->ops.enable_relaxed_ordering = &ixgbe_enable_relaxed_ordering_gen2;
+       mac->ops.get_media_type = &ixgbe_get_media_type_X540;
+       mac->ops.get_supported_physical_layer =
+                                   &ixgbe_get_supported_physical_layer_X540;
+       mac->ops.read_analog_reg8 = NULL;
+       mac->ops.write_analog_reg8 = NULL;
+       mac->ops.start_hw = &ixgbe_start_hw_X540;
+       mac->ops.get_san_mac_addr = &ixgbe_get_san_mac_addr_generic;
+       mac->ops.set_san_mac_addr = &ixgbe_set_san_mac_addr_generic;
+       mac->ops.get_device_caps = &ixgbe_get_device_caps_generic;
+       mac->ops.get_wwn_prefix = &ixgbe_get_wwn_prefix_generic;
+       mac->ops.get_fcoe_boot_status = &ixgbe_get_fcoe_boot_status_generic;
+       mac->ops.acquire_swfw_sync = &ixgbe_acquire_swfw_sync_X540;
+       mac->ops.release_swfw_sync = &ixgbe_release_swfw_sync_X540;
+       mac->ops.disable_sec_rx_path = &ixgbe_disable_sec_rx_path_generic;
+       mac->ops.enable_sec_rx_path = &ixgbe_enable_sec_rx_path_generic;
+
+       /* RAR, Multicast, VLAN */
+       mac->ops.set_vmdq = &ixgbe_set_vmdq_generic;
+       mac->ops.clear_vmdq = &ixgbe_clear_vmdq_generic;
+       mac->ops.insert_mac_addr = &ixgbe_insert_mac_addr_generic;
+       mac->rar_highwater = 1;
+       mac->ops.set_vfta = &ixgbe_set_vfta_generic;
+       mac->ops.set_vlvf = &ixgbe_set_vlvf_generic;
+       mac->ops.clear_vfta = &ixgbe_clear_vfta_generic;
+       mac->ops.init_uta_tables = &ixgbe_init_uta_tables_generic;
+       mac->ops.set_mac_anti_spoofing = &ixgbe_set_mac_anti_spoofing;
+       mac->ops.set_vlan_anti_spoofing = &ixgbe_set_vlan_anti_spoofing;
+
+       /* Link */
+       mac->ops.get_link_capabilities =
+                               &ixgbe_get_copper_link_capabilities_generic;
+       mac->ops.setup_link = &ixgbe_setup_mac_link_X540;
+       mac->ops.setup_rxpba = &ixgbe_set_rxpba_generic;
+       mac->ops.check_link = &ixgbe_check_mac_link_generic;
+
+       mac->mcft_size          = 128;
+       mac->vft_size           = 128;
+       mac->num_rar_entries    = 128;
+       mac->rx_pb_size         = 384;
+       mac->max_tx_queues      = 128;
+       mac->max_rx_queues      = 128;
+       mac->max_msix_vectors   = ixgbe_get_pcie_msix_count_generic(hw);
+
+       /*
+        * FWSM register
+        * ARC supported; valid only if manageability features are
+        * enabled.
+        */
+       mac->arc_subsystem_valid = (IXGBE_READ_REG(hw, IXGBE_FWSM) &
+                                  IXGBE_FWSM_MODE_MASK) ? TRUE : FALSE;
+
+       hw->mbx.ops.init_params = ixgbe_init_mbx_params_pf;
+
+       /* LEDs */
+       mac->ops.blink_led_start = ixgbe_blink_led_start_X540;
+       mac->ops.blink_led_stop = ixgbe_blink_led_stop_X540;
+
+       /* Manageability interface */
+       mac->ops.set_fw_drv_ver = &ixgbe_set_fw_drv_ver_generic;
+
+       return ret_val;
+}
+
+/**
+ *  ixgbe_get_link_capabilities_X540 - Determines link capabilities
+ *  @hw: pointer to hardware structure
+ *  @speed: pointer to link speed
+ *  @autoneg: TRUE when autoneg or autotry is enabled
+ *
+ *  Determines the link capabilities by reading the AUTOC register.
+ **/
+s32 ixgbe_get_link_capabilities_X540(struct ixgbe_hw *hw,
+                                    ixgbe_link_speed *speed,
+                                    bool *autoneg)
+{
+       ixgbe_get_copper_link_capabilities_generic(hw, speed, autoneg);
+
+       return IXGBE_SUCCESS;
+}
+
+/**
+ *  ixgbe_get_media_type_X540 - Get media type
+ *  @hw: pointer to hardware structure
+ *
+ *  Returns the media type (fiber, copper, backplane)
+ **/
+enum ixgbe_media_type ixgbe_get_media_type_X540(struct ixgbe_hw *hw)
+{
+       UNREFERENCED_1PARAMETER(hw);



Home | Main Index | Thread Index | Old Index