ESXi-6.0-U1a

This commit is contained in:
unknown 2015-10-23 18:44:50 -04:00
parent bd21c8aa72
commit 2ee8c8344c
51 changed files with 4144 additions and 3381 deletions

View file

@ -416,6 +416,9 @@
/** \brief Logical unit is not configured (array only). */ /** \brief Logical unit is not configured (array only). */
#define VMK_SCSI_ASC_LU_NOT_CONFIGURED 0x68 #define VMK_SCSI_ASC_LU_NOT_CONFIGURED 0x68
#define VMK_SCSI_ASC_ATA_PASSTHROUGH_INFO_AVAILABLE 0x00
#define VMK_SCSI_ASCQ_ATA_PASSTHROUGH_INFO_AVAILABLE 0x1d
/* /*
* Inquiry data. * Inquiry data.
*/ */

View file

@ -186,6 +186,16 @@ typedef struct vmk_ScsiSenseDataSimple {
} format; } format;
} vmk_ScsiSenseDataSimple; } vmk_ScsiSenseDataSimple;
/**
* \brief Description Type field
* SPC 4 r33, Section 4.5.2.1 table 27
*/
#define VMK_SCSI_SENSE_DESCRIPTOR_TYPE_INFORMATION 0x0
#define VMK_SCSI_SENSE_DESCRIPTOR_TYPE_COMMAND_SPECIFIC_INFIRMATION 0x1
#define VMK_SCSI_SENSE_DESCRIPTOR_TYPE_SENSE_KEY_SPECIFIC 0x2
#define VMK_SCSI_SENSE_DESCRIPTOR_TYPE_FIELD_REPLACABLE_UNIT 0x3
#define VMK_SCSI_SENSE_DESCRIPTOR_TYPE_ATA_STATUS_RETURN 0x9
/** /**
* \brief SCSI Device event handler callback entry * \brief SCSI Device event handler callback entry
* *

View file

@ -416,6 +416,9 @@
/** \brief Logical unit is not configured (array only). */ /** \brief Logical unit is not configured (array only). */
#define VMK_SCSI_ASC_LU_NOT_CONFIGURED 0x68 #define VMK_SCSI_ASC_LU_NOT_CONFIGURED 0x68
#define VMK_SCSI_ASC_ATA_PASSTHROUGH_INFO_AVAILABLE 0x00
#define VMK_SCSI_ASCQ_ATA_PASSTHROUGH_INFO_AVAILABLE 0x1d
/* /*
* Inquiry data. * Inquiry data.
*/ */

View file

@ -186,6 +186,16 @@ typedef struct vmk_ScsiSenseDataSimple {
} format; } format;
} vmk_ScsiSenseDataSimple; } vmk_ScsiSenseDataSimple;
/**
* \brief Description Type field
* SPC 4 r33, Section 4.5.2.1 table 27
*/
#define VMK_SCSI_SENSE_DESCRIPTOR_TYPE_INFORMATION 0x0
#define VMK_SCSI_SENSE_DESCRIPTOR_TYPE_COMMAND_SPECIFIC_INFIRMATION 0x1
#define VMK_SCSI_SENSE_DESCRIPTOR_TYPE_SENSE_KEY_SPECIFIC 0x2
#define VMK_SCSI_SENSE_DESCRIPTOR_TYPE_FIELD_REPLACABLE_UNIT 0x3
#define VMK_SCSI_SENSE_DESCRIPTOR_TYPE_ATA_STATUS_RETURN 0x9
/** /**
* \brief SCSI Device event handler callback entry * \brief SCSI Device event handler callback entry
* *

View file

@ -1,6 +1,6 @@
#define BUILD_NUMBER "build-2809209" #define BUILD_NUMBER "build-5966297"
#define BUILD_NUMBER_NUMERIC 2809209 #define BUILD_NUMBER_NUMERIC 5966297
#define BUILD_NUMBER_NUMERIC_STRING "2809209" #define BUILD_NUMBER_NUMERIC_STRING "5966297"
#define PRODUCT_BUILD_NUMBER "product-build-28864" #define PRODUCT_BUILD_NUMBER "product-build-26992"
#define PRODUCT_BUILD_NUMBER_NUMERIC 28864 #define PRODUCT_BUILD_NUMBER_NUMERIC 26992
#define PRODUCT_BUILD_NUMBER_NUMERIC_STRING "28864" #define PRODUCT_BUILD_NUMBER_NUMERIC_STRING "26992"

File diff suppressed because one or more lines are too long

View file

@ -54,7 +54,7 @@
#endif #endif
#define DRV_NAME "ahci" #define DRV_NAME "ahci"
#define DRV_VERSION "3.0-21vmw" #define DRV_VERSION "3.0-22vmw"
#if defined(__VMKLNX__) #if defined(__VMKLNX__)
static int ahci_skip_host_reset = 0; static int ahci_skip_host_reset = 0;
@ -652,6 +652,15 @@ static const struct pci_device_id ahci_pci_tbl[] = {
{ PCI_VDEVICE(INTEL, 0x8d66), board_ahci }, /* Wellsburg RAID */ { PCI_VDEVICE(INTEL, 0x8d66), board_ahci }, /* Wellsburg RAID */
{ PCI_VDEVICE(INTEL, 0x8d6e), board_ahci }, /* Wellsburg RAID */ { PCI_VDEVICE(INTEL, 0x8d6e), board_ahci }, /* Wellsburg RAID */
{ PCI_VDEVICE(INTEL, 0x23a3), board_ahci }, /* Coleto Creek AHCI */ { PCI_VDEVICE(INTEL, 0x23a3), board_ahci }, /* Coleto Creek AHCI */
{ PCI_VDEVICE(INTEL, 0x9d03), board_ahci }, /* Sunrise Point-LP AHCI */
{ PCI_VDEVICE(INTEL, 0x9d05), board_ahci }, /* Sunrise Point-LP RAID */
{ PCI_VDEVICE(INTEL, 0x9d07), board_ahci }, /* Sunrise Point-LP RAID */
{ PCI_VDEVICE(INTEL, 0xa102), board_ahci }, /* Sunrise Point-H AHCI */
{ PCI_VDEVICE(INTEL, 0xa103), board_ahci }, /* Sunrise Point-H AHCI */
{ PCI_VDEVICE(INTEL, 0xa105), board_ahci }, /* Sunrise Point-H RAID */
{ PCI_VDEVICE(INTEL, 0xa106), board_ahci }, /* Sunrise Point-H RAID */
{ PCI_VDEVICE(INTEL, 0xa107), board_ahci }, /* Sunrise Point-H RAID */
{ PCI_VDEVICE(INTEL, 0xa10f), board_ahci }, /* Sunrise Point-H RAID */
#endif /* defined(__VMKLNX__) */ #endif /* defined(__VMKLNX__) */
/* JMicron 360/1/3/5/6, match class to avoid IDE function */ /* JMicron 360/1/3/5/6, match class to avoid IDE function */

View file

@ -1,30 +1,24 @@
/******************************************************************************* /*
* Intel PRO/1000 Linux driver
Intel PRO/1000 Linux driver * Copyright(c) 1999 - 2014 Intel Corporation.
Copyright(c) 1999 - 2013 Intel Corporation. *
* This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License,
under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation.
version 2, as published by the Free Software Foundation. *
* This program is distributed in the hope it will be useful, but WITHOUT
This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details.
more details. *
* The full GNU General Public License is included in this distribution in
You should have received a copy of the GNU General Public License along with * the file called "COPYING".
this program; if not, write to the Free Software Foundation, Inc., *
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * Contact Information:
* Linux NICS <linux.nics@intel.com>
The full GNU General Public License is included in this distribution in * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
the file called "COPYING". * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*/
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
/* 80003ES2LAN Gigabit Ethernet Controller (Copper) /* 80003ES2LAN Gigabit Ethernet Controller (Copper)
* 80003ES2LAN Gigabit Ethernet Controller (Serdes) * 80003ES2LAN Gigabit Ethernet Controller (Serdes)
@ -719,11 +713,18 @@ static s32 e1000_reset_hw_80003es2lan(struct e1000_hw *hw)
e1000_release_phy_80003es2lan(hw); e1000_release_phy_80003es2lan(hw);
/* Disable IBIST slave mode (far-end loopback) */ /* Disable IBIST slave mode (far-end loopback) */
e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, ret_val = e1000_read_kmrn_reg_80003es2lan(hw,
E1000_KMRNCTRLSTA_INBAND_PARAM,
&kum_reg_data); &kum_reg_data);
if (!ret_val) {
kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE; kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE;
e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
E1000_KMRNCTRLSTA_INBAND_PARAM,
kum_reg_data); kum_reg_data);
if (ret_val)
e_dbg("Error disabling far-end loopback\n");
} else
e_dbg("Error disabling far-end loopback\n");
ret_val = e1000e_get_auto_rd_done(hw); ret_val = e1000e_get_auto_rd_done(hw);
if (ret_val) if (ret_val)
@ -777,11 +778,18 @@ static s32 e1000_init_hw_80003es2lan(struct e1000_hw *hw)
return ret_val; return ret_val;
/* Disable IBIST slave mode (far-end loopback) */ /* Disable IBIST slave mode (far-end loopback) */
ret_val =
e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, e1000_read_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM,
&kum_reg_data); &kum_reg_data);
if (!ret_val) {
kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE; kum_reg_data |= E1000_KMRNCTRLSTA_IBIST_DISABLE;
e1000_write_kmrn_reg_80003es2lan(hw, E1000_KMRNCTRLSTA_INBAND_PARAM, ret_val = e1000_write_kmrn_reg_80003es2lan(hw,
E1000_KMRNCTRLSTA_INBAND_PARAM,
kum_reg_data); kum_reg_data);
if (ret_val)
e_dbg("Error disabling far-end loopback\n");
} else
e_dbg("Error disabling far-end loopback\n");
/* Set the transmit descriptor write-back policy */ /* Set the transmit descriptor write-back policy */
reg_data = er32(TXDCTL(0)); reg_data = er32(TXDCTL(0));
@ -1370,6 +1378,7 @@ static const struct e1000_mac_operations es2_mac_ops = {
.setup_led = e1000e_setup_led_generic, .setup_led = e1000e_setup_led_generic,
.config_collision_dist = e1000e_config_collision_dist_generic, .config_collision_dist = e1000e_config_collision_dist_generic,
.rar_set = e1000e_rar_set_generic, .rar_set = e1000e_rar_set_generic,
.rar_get_count = e1000e_rar_get_count_generic,
.validate_mdi_setting = e1000e_validate_mdi_setting_generic, .validate_mdi_setting = e1000e_validate_mdi_setting_generic,
}; };

View file

@ -1,30 +1,24 @@
/******************************************************************************* /*
* Intel PRO/1000 Linux driver
Intel PRO/1000 Linux driver * Copyright(c) 1999 - 2014 Intel Corporation.
Copyright(c) 1999 - 2013 Intel Corporation. *
* This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License,
under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation.
version 2, as published by the Free Software Foundation. *
* This program is distributed in the hope it will be useful, but WITHOUT
This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details.
more details. *
* The full GNU General Public License is included in this distribution in
You should have received a copy of the GNU General Public License along with * the file called "COPYING".
this program; if not, write to the Free Software Foundation, Inc., *
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * Contact Information:
* Linux NICS <linux.nics@intel.com>
The full GNU General Public License is included in this distribution in * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
the file called "COPYING". * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*/
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
#ifndef _E1000E_80003ES2LAN_H_ #ifndef _E1000E_80003ES2LAN_H_
#define _E1000E_80003ES2LAN_H_ #define _E1000E_80003ES2LAN_H_

View file

@ -1,30 +1,24 @@
/******************************************************************************* /*
* Intel PRO/1000 Linux driver
Intel PRO/1000 Linux driver * Copyright(c) 1999 - 2014 Intel Corporation.
Copyright(c) 1999 - 2013 Intel Corporation. *
* This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License,
under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation.
version 2, as published by the Free Software Foundation. *
* This program is distributed in the hope it will be useful, but WITHOUT
This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details.
more details. *
* The full GNU General Public License is included in this distribution in
You should have received a copy of the GNU General Public License along with * the file called "COPYING".
this program; if not, write to the Free Software Foundation, Inc., *
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * Contact Information:
* Linux NICS <linux.nics@intel.com>
The full GNU General Public License is included in this distribution in * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
the file called "COPYING". * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*/
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
/* 82571EB Gigabit Ethernet Controller /* 82571EB Gigabit Ethernet Controller
* 82571EB Gigabit Ethernet Controller (Copper) * 82571EB Gigabit Ethernet Controller (Copper)
@ -1011,6 +1005,11 @@ static s32 e1000_reset_hw_82571(struct e1000_hw *hw)
/* Must release MDIO ownership and mutex after MAC reset. */ /* Must release MDIO ownership and mutex after MAC reset. */
switch (hw->mac.type) { switch (hw->mac.type) {
case e1000_82573:
/* Release mutex only if the hw semaphore is acquired */
if (!ret_val)
e1000_put_hw_semaphore_82573(hw);
break;
case e1000_82574: case e1000_82574:
case e1000_82583: case e1000_82583:
/* Release mutex only if the hw semaphore is acquired */ /* Release mutex only if the hw semaphore is acquired */
@ -1341,8 +1340,12 @@ static void e1000_clear_vfta_82571(struct e1000_hw *hw)
static bool e1000_check_mng_mode_82574(struct e1000_hw *hw) static bool e1000_check_mng_mode_82574(struct e1000_hw *hw)
{ {
u16 data; u16 data;
s32 ret_val;
ret_val = e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &data);
if (ret_val)
return false;
e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &data);
return (data & E1000_NVM_INIT_CTRL2_MNGM) != 0; return (data & E1000_NVM_INIT_CTRL2_MNGM) != 0;
} }
@ -1898,6 +1901,7 @@ static const struct e1000_mac_operations e82571_mac_ops = {
.config_collision_dist = e1000e_config_collision_dist_generic, .config_collision_dist = e1000e_config_collision_dist_generic,
.read_mac_addr = e1000_read_mac_addr_82571, .read_mac_addr = e1000_read_mac_addr_82571,
.rar_set = e1000e_rar_set_generic, .rar_set = e1000e_rar_set_generic,
.rar_get_count = e1000e_rar_get_count_generic,
.validate_mdi_setting = e1000e_validate_mdi_setting_generic, .validate_mdi_setting = e1000e_validate_mdi_setting_generic,
}; };

View file

@ -1,30 +1,24 @@
/******************************************************************************* /*
* Intel PRO/1000 Linux driver
Intel PRO/1000 Linux driver * Copyright(c) 1999 - 2014 Intel Corporation.
Copyright(c) 1999 - 2013 Intel Corporation. *
* This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License,
under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation.
version 2, as published by the Free Software Foundation. *
* This program is distributed in the hope it will be useful, but WITHOUT
This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details.
more details. *
* The full GNU General Public License is included in this distribution in
You should have received a copy of the GNU General Public License along with * the file called "COPYING".
this program; if not, write to the Free Software Foundation, Inc., *
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * Contact Information:
* Linux NICS <linux.nics@intel.com>
The full GNU General Public License is included in this distribution in * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
the file called "COPYING". * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*/
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
#ifndef _E1000E_82571_H_ #ifndef _E1000E_82571_H_
#define _E1000E_82571_H_ #define _E1000E_82571_H_

View file

@ -1,30 +1,24 @@
/******************************************************************************* /*
* Intel PRO/1000 Linux driver
Intel PRO/1000 Linux driver * Copyright(c) 1999 - 2014 Intel Corporation.
Copyright(c) 1999 - 2013 Intel Corporation. *
* This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License,
under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation.
version 2, as published by the Free Software Foundation. *
* This program is distributed in the hope it will be useful, but WITHOUT
This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details.
more details. *
* The full GNU General Public License is included in this distribution in
You should have received a copy of the GNU General Public License along with * the file called "COPYING".
this program; if not, write to the Free Software Foundation, Inc., *
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * Contact Information:
* Linux NICS <linux.nics@intel.com>
The full GNU General Public License is included in this distribution in * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
the file called "COPYING". * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*/
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
#ifndef _E1000E_DEFINES_H_ #ifndef _E1000E_DEFINES_H_
#define _E1000E_DEFINES_H_ #define _E1000E_DEFINES_H_
@ -148,6 +142,7 @@
#define E1000_RCTL_LBM_TCVR 0x000000C0 /* tcvr loopback mode */ #define E1000_RCTL_LBM_TCVR 0x000000C0 /* tcvr loopback mode */
#define E1000_RCTL_DTYP_PS 0x00000400 /* Packet Split descriptor */ #define E1000_RCTL_DTYP_PS 0x00000400 /* Packet Split descriptor */
#define E1000_RCTL_RDMTS_HALF 0x00000000 /* Rx desc min thresh size */ #define E1000_RCTL_RDMTS_HALF 0x00000000 /* Rx desc min thresh size */
#define E1000_RCTL_RDMTS_HEX 0x00010000
#define E1000_RCTL_MO_SHIFT 12 /* multicast offset shift */ #define E1000_RCTL_MO_SHIFT 12 /* multicast offset shift */
#define E1000_RCTL_MO_3 0x00003000 /* multicast offset 15:4 */ #define E1000_RCTL_MO_3 0x00003000 /* multicast offset 15:4 */
#define E1000_RCTL_BAM 0x00008000 /* broadcast enable */ #define E1000_RCTL_BAM 0x00008000 /* broadcast enable */
@ -349,6 +344,7 @@
#define E1000_TIPG_IPGR2_SHIFT 20 #define E1000_TIPG_IPGR2_SHIFT 20
#define MAX_JUMBO_FRAME_SIZE 0x3F00 #define MAX_JUMBO_FRAME_SIZE 0x3F00
#define E1000_TX_PTR_GAP 0x1F
/* Extended Configuration Control and Size */ /* Extended Configuration Control and Size */
#define E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP 0x00000020 #define E1000_EXTCNF_CTRL_MDIO_SW_OWNERSHIP 0x00000020
@ -535,6 +531,12 @@
#define E1000_TSYNCTXCTL_VALID 0x00000001 /* Tx timestamp valid */ #define E1000_TSYNCTXCTL_VALID 0x00000001 /* Tx timestamp valid */
#define E1000_TSYNCTXCTL_ENABLED 0x00000010 /* enable Tx timestamping */ #define E1000_TSYNCTXCTL_ENABLED 0x00000010 /* enable Tx timestamping */
/* HH Time Sync */
#define E1000_TSYNCTXCTL_MAX_ALLOWED_DLY_MASK 0x0000F000 /* max delay */
#define E1000_TSYNCTXCTL_SYNC_COMP_ERR 0x20000000 /* sync err */
#define E1000_TSYNCTXCTL_SYNC_COMP 0x40000000 /* sync complete */
#define E1000_TSYNCTXCTL_START_SYNC 0x80000000 /* initiate sync */
#define E1000_TSYNCRXCTL_VALID 0x00000001 /* Rx timestamp valid */ #define E1000_TSYNCRXCTL_VALID 0x00000001 /* Rx timestamp valid */
#define E1000_TSYNCRXCTL_TYPE_MASK 0x0000000E /* Rx type mask */ #define E1000_TSYNCRXCTL_TYPE_MASK 0x0000000E /* Rx type mask */
#define E1000_TSYNCRXCTL_TYPE_L2_V2 0x00 #define E1000_TSYNCRXCTL_TYPE_L2_V2 0x00

View file

@ -1,30 +1,24 @@
/******************************************************************************* /*
* Intel PRO/1000 Linux driver
Intel PRO/1000 Linux driver * Copyright(c) 1999 - 2014 Intel Corporation.
Copyright(c) 1999 - 2013 Intel Corporation. *
* This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License,
under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation.
version 2, as published by the Free Software Foundation. *
* This program is distributed in the hope it will be useful, but WITHOUT
This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details.
more details. *
* The full GNU General Public License is included in this distribution in
You should have received a copy of the GNU General Public License along with * the file called "COPYING".
this program; if not, write to the Free Software Foundation, Inc., *
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * Contact Information:
* Linux NICS <linux.nics@intel.com>
The full GNU General Public License is included in this distribution in * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
the file called "COPYING". * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*/
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
/* Linux PRO/1000 Ethernet Driver main header file */ /* Linux PRO/1000 Ethernet Driver main header file */
@ -96,9 +90,6 @@ struct e1000_info;
#define E1000_MNG_VLAN_NONE (-1) #define E1000_MNG_VLAN_NONE (-1)
/* Number of packet split data buffers (not including the header buffer) */
#define PS_PAGE_BUFFERS (MAX_PS_BUFFERS - 1)
#define DEFAULT_JUMBO 9234 #define DEFAULT_JUMBO 9234
/* Time to wait before putting the device into D3 if there's no link (in ms). */ /* Time to wait before putting the device into D3 if there's no link (in ms). */
@ -148,6 +139,7 @@ enum e1000_boards {
board_pchlan, board_pchlan,
board_pch2lan, board_pch2lan,
board_pch_lpt, board_pch_lpt,
board_pch_spt
}; };
struct e1000_ps_page { struct e1000_ps_page {
@ -286,15 +278,16 @@ struct e1000_adapter {
u32 tx_head_addr; u32 tx_head_addr;
u32 tx_fifo_size; u32 tx_fifo_size;
u32 tx_dma_failed; u32 tx_dma_failed;
u32 tx_hwtstamp_timeouts;
/* Rx */ /* Rx */
#ifdef CONFIG_E1000E_NAPI #ifdef CONFIG_E1000E_NAPI
bool (*clean_rx) (struct e1000_ring *ring, int *work_done, bool (*clean_rx)(struct e1000_ring *ring, int *work_done,
int work_to_do) ____cacheline_aligned_in_smp; int work_to_do) ____cacheline_aligned_in_smp;
#else #else
bool (*clean_rx) (struct e1000_ring *ring) ____cacheline_aligned_in_smp; bool (*clean_rx)(struct e1000_ring *ring) ____cacheline_aligned_in_smp;
#endif #endif
void (*alloc_rx_buf) (struct e1000_ring *ring, int cleaned_count, void (*alloc_rx_buf)(struct e1000_ring *ring, int cleaned_count,
gfp_t gfp); gfp_t gfp);
struct e1000_ring *rx_ring; struct e1000_ring *rx_ring;
@ -312,6 +305,12 @@ struct e1000_adapter {
#ifdef HAVE_HW_TIME_STAMP #ifdef HAVE_HW_TIME_STAMP
u32 rx_hwtstamp_cleared; u32 rx_hwtstamp_cleared;
#endif #endif
#ifdef DYNAMIC_LTR_SUPPORT
u64 c10_mpc_count; /* frequently updated MPC count */
u64 c10_rx_bytes; /* frequently updated RX bytes count */
u32 c10_pba_bytes; /* current PBA RXA converted to bytes*/
bool c10_demote_ltr; /* is/should LTR be demoted */
#endif /* DYNAMIC_LTR_SUPPORT */
unsigned int rx_ps_pages; unsigned int rx_ps_pages;
u16 rx_ps_bsize0; u16 rx_ps_bsize0;
@ -365,6 +364,7 @@ struct e1000_adapter {
#endif #endif
unsigned int flags; unsigned int flags;
#if defined(__VMKLNX__) #if defined(__VMKLNX__)
unsigned int flags1; unsigned int flags1;
enum { enum {
@ -372,6 +372,7 @@ struct e1000_adapter {
hw_hang_on_tso hw_hang_on_tso
} hw_hang_reason; } hw_hang_reason;
#endif /* defined(__VMKLNX__) */ #endif /* defined(__VMKLNX__) */
unsigned int flags2; unsigned int flags2;
struct work_struct downshift_task; struct work_struct downshift_task;
struct work_struct update_phy_task; struct work_struct update_phy_task;
@ -392,6 +393,7 @@ struct e1000_adapter {
struct hwtstamp_config hwtstamp_config; struct hwtstamp_config hwtstamp_config;
struct delayed_work systim_overflow_work; struct delayed_work systim_overflow_work;
struct sk_buff *tx_hwtstamp_skb; struct sk_buff *tx_hwtstamp_skb;
unsigned long tx_hwtstamp_start;
struct work_struct tx_hwtstamp_work; struct work_struct tx_hwtstamp_work;
spinlock_t systim_lock; /* protects SYSTIML/H regsters */ spinlock_t systim_lock; /* protects SYSTIML/H regsters */
struct cyclecounter cc; struct cyclecounter cc;
@ -453,6 +455,8 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca);
* 25MHz 46-bit 2^46 / 10^9 / 3600 = 19.55 hours * 25MHz 46-bit 2^46 / 10^9 / 3600 = 19.55 hours
*/ */
#define E1000_SYSTIM_OVERFLOW_PERIOD (HZ * 60 * 60 * 4) #define E1000_SYSTIM_OVERFLOW_PERIOD (HZ * 60 * 60 * 4)
#define E1000_MAX_82574_SYSTIM_REREADS 50
#define E1000_82574_SYSTIM_EPSILON (1ULL << 35ULL)
#endif /* HAVE_HW_TIME_STAMP */ #endif /* HAVE_HW_TIME_STAMP */
/* hardware capability, feature, and workaround flags */ /* hardware capability, feature, and workaround flags */
@ -496,6 +500,7 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca);
#if defined(__VMKLNX__) #if defined(__VMKLNX__)
#define FLAG_READ_ONLY_NVM (1 << 0) #define FLAG_READ_ONLY_NVM (1 << 0)
#endif /* defined(__VMKLNX__) */ #endif /* defined(__VMKLNX__) */
#define FLAG2_CRC_STRIPPING (1 << 0) #define FLAG2_CRC_STRIPPING (1 << 0)
#define FLAG2_HAS_PHY_WAKEUP (1 << 1) #define FLAG2_HAS_PHY_WAKEUP (1 << 1)
#define FLAG2_IS_DISCARDING (1 << 2) #define FLAG2_IS_DISCARDING (1 << 2)
@ -529,7 +534,6 @@ s32 e1000e_get_base_timinca(struct e1000_adapter *adapter, u32 *timinca);
enum e1000_state_t { enum e1000_state_t {
__E1000_OBFF_DISABLED, __E1000_OBFF_DISABLED,
__E1000_SHUTDOWN,
__E1000_TESTING, __E1000_TESTING,
__E1000_RESETTING, __E1000_RESETTING,
__E1000_ACCESS_SHARED_RESOURCE, __E1000_ACCESS_SHARED_RESOURCE,
@ -577,9 +581,9 @@ extern void e1000e_get_hw_control(struct e1000_adapter *adapter);
extern void e1000e_release_hw_control(struct e1000_adapter *adapter); extern void e1000e_release_hw_control(struct e1000_adapter *adapter);
extern void e1000e_write_itr(struct e1000_adapter *adapter, u32 itr); extern void e1000e_write_itr(struct e1000_adapter *adapter, u32 itr);
#if defined(__VMKLNX__) #ifdef __VMKLNX__
extern void e1000e_write_protect_nvm_ich8lan(struct e1000_hw *hw); extern void e1000e_write_protect_nvm_ich8lan(struct e1000_hw *hw);
#endif /* defined(__VMKLNX__) */ #endif /* __VMKLNX__ */
extern unsigned int copybreak; extern unsigned int copybreak;
extern const struct e1000_info e1000_82571_info; extern const struct e1000_info e1000_82571_info;
@ -593,6 +597,7 @@ extern const struct e1000_info e1000_ich10_info;
extern const struct e1000_info e1000_pch_info; extern const struct e1000_info e1000_pch_info;
extern const struct e1000_info e1000_pch2_info; extern const struct e1000_info e1000_pch2_info;
extern const struct e1000_info e1000_pch_lpt_info; extern const struct e1000_info e1000_pch_lpt_info;
extern const struct e1000_info e1000_pch_spt_info;
extern const struct e1000_info e1000_es2_info; extern const struct e1000_info e1000_es2_info;
#ifdef HAVE_PTP_1588_CLOCK #ifdef HAVE_PTP_1588_CLOCK

View file

@ -1,30 +1,24 @@
/******************************************************************************* /*
* Intel PRO/1000 Linux driver
Intel PRO/1000 Linux driver * Copyright(c) 1999 - 2014 Intel Corporation.
Copyright(c) 1999 - 2013 Intel Corporation. *
* This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License,
under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation.
version 2, as published by the Free Software Foundation. *
* This program is distributed in the hope it will be useful, but WITHOUT
This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details.
more details. *
* The full GNU General Public License is included in this distribution in
You should have received a copy of the GNU General Public License along with * the file called "COPYING".
this program; if not, write to the Free Software Foundation, Inc., *
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * Contact Information:
* Linux NICS <linux.nics@intel.com>
The full GNU General Public License is included in this distribution in * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
the file called "COPYING". * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*/
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
/* ethtool support for e1000 */ /* ethtool support for e1000 */
@ -152,6 +146,7 @@ static const struct e1000_stats e1000_gstrings_stats[] = {
E1000_STAT("tx_dma_failed", tx_dma_failed), E1000_STAT("tx_dma_failed", tx_dma_failed),
#ifdef HAVE_HW_TIME_STAMP #ifdef HAVE_HW_TIME_STAMP
E1000_STAT("rx_hwtstamp_cleared", rx_hwtstamp_cleared), E1000_STAT("rx_hwtstamp_cleared", rx_hwtstamp_cleared),
E1000_STAT("tx_hwtstamp_timeouts", tx_hwtstamp_timeouts),
#endif #endif
E1000_STAT("uncorr_ecc_errors", uncorr_errors), E1000_STAT("uncorr_ecc_errors", uncorr_errors),
E1000_STAT("corr_ecc_errors", corr_errors), E1000_STAT("corr_ecc_errors", corr_errors),
@ -746,10 +741,11 @@ static int e1000_set_eeprom(struct net_device *netdev,
if (eeprom->magic != if (eeprom->magic !=
(adapter->pdev->vendor | (adapter->pdev->device << 16))) (adapter->pdev->vendor | (adapter->pdev->device << 16)))
return -EFAULT; return -EFAULT;
#if defined(__VMKLNX__)
#ifdef __VMKLNX__
if (adapter->flags1 & FLAG_READ_ONLY_NVM) if (adapter->flags1 & FLAG_READ_ONLY_NVM)
return -EINVAL; return -EINVAL;
#endif /* defined(__VMKLNX__) */ #endif /* __VMKLNX__ */
max_len = hw->nvm.word_size * 2; max_len = hw->nvm.word_size * 2;
@ -964,10 +960,10 @@ static bool reg_pattern_test(struct e1000_adapter *adapter, u64 *data,
reg + (offset << 2), val, reg + (offset << 2), val,
(test[pat] & write & mask)); (test[pat] & write & mask));
*data = reg; *data = reg;
return 1; return true;
} }
} }
return 0; return false;
} }
static bool reg_set_and_check(struct e1000_adapter *adapter, u64 *data, static bool reg_set_and_check(struct e1000_adapter *adapter, u64 *data,
@ -980,9 +976,9 @@ static bool reg_set_and_check(struct e1000_adapter *adapter, u64 *data,
e_err("set/check test failed (reg 0x%05X): got 0x%08X expected 0x%08X\n", e_err("set/check test failed (reg 0x%05X): got 0x%08X expected 0x%08X\n",
reg, (val & mask), (write & mask)); reg, (val & mask), (write & mask));
*data = reg; *data = reg;
return 1; return true;
} }
return 0; return false;
} }
#define REG_PATTERN_TEST_ARRAY(reg, offset, mask, write) \ #define REG_PATTERN_TEST_ARRAY(reg, offset, mask, write) \
@ -1075,18 +1071,20 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)
case e1000_pchlan: case e1000_pchlan:
case e1000_pch2lan: case e1000_pch2lan:
case e1000_pch_lpt: case e1000_pch_lpt:
case e1000_pch_spt:
mask |= (1 << 18); mask |= (1 << 18);
break; break;
default: default:
break; break;
} }
if (mac->type == e1000_pch_lpt) if ((mac->type == e1000_pch_lpt) || (mac->type == e1000_pch_spt))
wlock_mac = (er32(FWSM) & E1000_FWSM_WLOCK_MAC_MASK) >> wlock_mac = (er32(FWSM) & E1000_FWSM_WLOCK_MAC_MASK) >>
E1000_FWSM_WLOCK_MAC_SHIFT; E1000_FWSM_WLOCK_MAC_SHIFT;
for (i = 0; i < mac->rar_entry_count; i++) { for (i = 0; i < mac->rar_entry_count; i++) {
if (mac->type == e1000_pch_lpt) { if ((mac->type == e1000_pch_lpt) ||
(mac->type == e1000_pch_spt)) {
/* Cannot test write-protected SHRAL[n] registers */ /* Cannot test write-protected SHRAL[n] registers */
if ((wlock_mac == 1) || (wlock_mac && (i > wlock_mac))) if ((wlock_mac == 1) || (wlock_mac && (i > wlock_mac)))
continue; continue;
@ -1097,18 +1095,23 @@ static int e1000_reg_test(struct e1000_adapter *adapter, u64 *data)
else else
mask &= ~(1 << 30); mask &= ~(1 << 30);
} }
if (mac->type == e1000_pch2lan) { if (mac->type == e1000_pch2lan) {
/* SHRAH[0,1,2] different than previous */ /* SHRAH[0,1,2] different than previous */
if (i == 7) if (i == 1)
mask &= 0xFFF4FFFF; mask &= 0xFFF4FFFF;
/* SHRAH[3] different than SHRAH[0,1,2] */ /* SHRAH[3] different than SHRAH[0,1,2] */
if (i == 10) if (i == 4)
mask |= (1 << 30); mask |= (1 << 30);
/* RAR[1-6] owned by management engine - skipping */
if (i > 0)
i += 6;
} }
REG_PATTERN_TEST_ARRAY(E1000_RA, ((i << 1) + 1), mask, REG_PATTERN_TEST_ARRAY(E1000_RA, ((i << 1) + 1), mask,
0xFFFFFFFF); 0xFFFFFFFF);
/* reset index to actual value */
if ((mac->type == e1000_pch2lan) && (i > 6))
i -= 6;
} }
for (i = 0; i < mac->mta_reg_count; i++) for (i = 0; i < mac->mta_reg_count; i++)
@ -1431,7 +1434,7 @@ static int e1000_setup_desc_rings(struct e1000_adapter *adapter)
rctl = er32(RCTL); rctl = er32(RCTL);
#ifndef __VMKLNX__ #ifndef __VMKLNX__
if (!(adapter->flags2 & FLAG2_NO_DISABLE_RX)) if (!(adapter->flags2 & FLAG2_NO_DISABLE_RX))
#endif #endif /* !__VMKLNX__ */
ew32(RCTL, rctl & ~E1000_RCTL_EN); ew32(RCTL, rctl & ~E1000_RCTL_EN);
ew32(RDBAL(0), ((u64)rx_ring->dma & 0xFFFFFFFF)); ew32(RDBAL(0), ((u64)rx_ring->dma & 0xFFFFFFFF));
ew32(RDBAH(0), ((u64)rx_ring->dma >> 32)); ew32(RDBAH(0), ((u64)rx_ring->dma >> 32));
@ -2062,15 +2065,14 @@ static void e1000_get_wol(struct net_device *netdev,
* Comment out that check for now until support for can/should wakeup * Comment out that check for now until support for can/should wakeup
* is added as part of Power Management features. * is added as part of Power Management features.
*/ */
#if !defined(__VMKLNX__) #ifndef __VMKLNX__
if (!(adapter->flags & FLAG_HAS_WOL) || if (!(adapter->flags & FLAG_HAS_WOL) ||
!device_can_wakeup(pci_dev_to_dev(adapter->pdev))) !device_can_wakeup(pci_dev_to_dev(adapter->pdev)))
return; return;
#else /* defined(__VMKLNX__) */ #else /* !__VMKLNX__ */
if (!(adapter->flags & FLAG_HAS_WOL)) if (!(adapter->flags & FLAG_HAS_WOL))
return; return;
#endif /* !defined(__VMKLNX__) */ #endif /* !__VMKLNX__ */
wol->supported = WAKE_UCAST | WAKE_MCAST | wol->supported = WAKE_UCAST | WAKE_MCAST |
WAKE_BCAST | WAKE_MAGIC | WAKE_PHY; WAKE_BCAST | WAKE_MAGIC | WAKE_PHY;
@ -2105,18 +2107,18 @@ static int e1000_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
* Comment out that check for now until support for can/should wakeup * Comment out that check for now until support for can/should wakeup
* is added as part of Power Management features. * is added as part of Power Management features.
*/ */
#if !defined(__VMKLNX__) #ifndef __VMKLNX__
if (!(adapter->flags & FLAG_HAS_WOL) || if (!(adapter->flags & FLAG_HAS_WOL) ||
!device_can_wakeup(pci_dev_to_dev(adapter->pdev)) || !device_can_wakeup(pci_dev_to_dev(adapter->pdev)) ||
(wol->wolopts & ~(WAKE_UCAST | WAKE_MCAST | WAKE_BCAST | (wol->wolopts & ~(WAKE_UCAST | WAKE_MCAST | WAKE_BCAST |
WAKE_MAGIC | WAKE_PHY))) WAKE_MAGIC | WAKE_PHY)))
return -EOPNOTSUPP; return -EOPNOTSUPP;
#else /* defined(__VMKLNX__) */ #else /* !__VMKLNX__ */
if (!(adapter->flags & FLAG_HAS_WOL) || if (!(adapter->flags & FLAG_HAS_WOL) ||
(wol->wolopts & ~(WAKE_UCAST | WAKE_MCAST | WAKE_BCAST | (wol->wolopts & ~(WAKE_UCAST | WAKE_MCAST | WAKE_BCAST |
WAKE_MAGIC | WAKE_PHY))) WAKE_MAGIC | WAKE_PHY)))
return -EOPNOTSUPP; return -EOPNOTSUPP;
#endif /* defined(__VMKLNX__) */ #endif /* !__VMKLNX__ */
/* these settings will always override what we currently have */ /* these settings will always override what we currently have */
adapter->wol = 0; adapter->wol = 0;
@ -2212,6 +2214,7 @@ static int e1000_phys_id(struct net_device *netdev, u32 data)
(hw->mac.type == e1000_pchlan) || (hw->mac.type == e1000_pchlan) ||
(hw->mac.type == e1000_pch2lan) || (hw->mac.type == e1000_pch2lan) ||
(hw->mac.type == e1000_pch_lpt) || (hw->mac.type == e1000_pch_lpt) ||
(hw->mac.type == e1000_pch_spt) ||
(hw->mac.type == e1000_82583) || (hw->mac.type == e1000_82574)) { (hw->mac.type == e1000_82583) || (hw->mac.type == e1000_82574)) {
if (!adapter->blink_timer.function) { if (!adapter->blink_timer.function) {
init_timer(&adapter->blink_timer); init_timer(&adapter->blink_timer);
@ -2678,7 +2681,7 @@ static const struct ethtool_ops_ext e1000e_ethtool_ops_ext = {
void e1000e_set_ethtool_ops(struct net_device *netdev) void e1000e_set_ethtool_ops(struct net_device *netdev)
{ {
/* have to "undeclare" const on this struct to remove warnings */ /* have to "undeclare" const on this struct to remove warnings */
SET_ETHTOOL_OPS(netdev, (struct ethtool_ops *)&e1000_ethtool_ops); netdev->ethtool_ops = (struct ethtool_ops *)&e1000_ethtool_ops;
#ifdef HAVE_RHEL6_ETHTOOL_OPS_EXT_STRUCT #ifdef HAVE_RHEL6_ETHTOOL_OPS_EXT_STRUCT
set_ethtool_ops_ext(netdev, &e1000e_ethtool_ops_ext); set_ethtool_ops_ext(netdev, &e1000e_ethtool_ops_ext);
#endif /* HAVE_RHEL6_ETHTOOL_OPS_EXT_STRUCT */ #endif /* HAVE_RHEL6_ETHTOOL_OPS_EXT_STRUCT */

View file

@ -1,30 +1,24 @@
/******************************************************************************* /*
* Intel PRO/1000 Linux driver
Intel PRO/1000 Linux driver * Copyright(c) 1999 - 2014 Intel Corporation.
Copyright(c) 1999 - 2013 Intel Corporation. *
* This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License,
under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation.
version 2, as published by the Free Software Foundation. *
* This program is distributed in the hope it will be useful, but WITHOUT
This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details.
more details. *
* The full GNU General Public License is included in this distribution in
You should have received a copy of the GNU General Public License along with * the file called "COPYING".
this program; if not, write to the Free Software Foundation, Inc., *
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * Contact Information:
* Linux NICS <linux.nics@intel.com>
The full GNU General Public License is included in this distribution in * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
the file called "COPYING". * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*/
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
#ifndef _E1000E_HW_H_ #ifndef _E1000E_HW_H_
#define _E1000E_HW_H_ #define _E1000E_HW_H_
@ -94,7 +88,10 @@ struct e1000_hw;
#define E1000_DEV_ID_PCH_I218_V2 0x15A1 #define E1000_DEV_ID_PCH_I218_V2 0x15A1
#define E1000_DEV_ID_PCH_I218_LM3 0x15A2 /* Wildcat Point PCH */ #define E1000_DEV_ID_PCH_I218_LM3 0x15A2 /* Wildcat Point PCH */
#define E1000_DEV_ID_PCH_I218_V3 0x15A3 /* Wildcat Point PCH */ #define E1000_DEV_ID_PCH_I218_V3 0x15A3 /* Wildcat Point PCH */
#define E1000_DEV_ID_PCH_SPT_I219_LM 0x156F /* Sunrise Point PCH */
#define E1000_DEV_ID_PCH_SPT_I219_V 0x1570 /* Sunrise Point PCH */
#define E1000_DEV_ID_PCH_SPT_I219_LM2 0x15B8 /* Sunrise Point-H PCH */
#define E1000_DEV_ID_PCH_SPT_I219_V2 0x15B7 /* Sunrise Point-H PCH */
#define E1000_REVISION_4 4 #define E1000_REVISION_4 4
@ -116,6 +113,7 @@ enum e1000_mac_type {
e1000_pchlan, e1000_pchlan,
e1000_pch2lan, e1000_pch2lan,
e1000_pch_lpt, e1000_pch_lpt,
e1000_pch_spt,
}; };
enum e1000_media_type { enum e1000_media_type {
@ -467,29 +465,30 @@ struct e1000_host_mng_command_info {
/* Function pointers for the MAC. */ /* Function pointers for the MAC. */
struct e1000_mac_operations { struct e1000_mac_operations {
s32(*id_led_init) (struct e1000_hw *); s32 (*id_led_init) (struct e1000_hw *);
s32(*blink_led) (struct e1000_hw *); s32 (*blink_led) (struct e1000_hw *);
bool (*check_mng_mode) (struct e1000_hw *); bool (*check_mng_mode) (struct e1000_hw *);
s32(*check_for_link) (struct e1000_hw *); s32 (*check_for_link) (struct e1000_hw *);
s32(*cleanup_led) (struct e1000_hw *); s32 (*cleanup_led) (struct e1000_hw *);
void (*clear_hw_cntrs) (struct e1000_hw *); void (*clear_hw_cntrs) (struct e1000_hw *);
void (*clear_vfta) (struct e1000_hw *); void (*clear_vfta) (struct e1000_hw *);
s32(*get_bus_info) (struct e1000_hw *); s32 (*get_bus_info) (struct e1000_hw *);
void (*set_lan_id) (struct e1000_hw *); void (*set_lan_id) (struct e1000_hw *);
s32(*get_link_up_info) (struct e1000_hw *, u16 *, u16 *); s32 (*get_link_up_info) (struct e1000_hw *, u16 *, u16 *);
s32(*led_on) (struct e1000_hw *); s32 (*led_on) (struct e1000_hw *);
s32(*led_off) (struct e1000_hw *); s32 (*led_off) (struct e1000_hw *);
void (*update_mc_addr_list) (struct e1000_hw *, u8 *, u32); void (*update_mc_addr_list) (struct e1000_hw *, u8 *, u32);
s32(*reset_hw) (struct e1000_hw *); s32 (*reset_hw) (struct e1000_hw *);
s32(*init_hw) (struct e1000_hw *); s32 (*init_hw) (struct e1000_hw *);
s32(*setup_link) (struct e1000_hw *); s32 (*setup_link) (struct e1000_hw *);
s32(*setup_physical_interface) (struct e1000_hw *); s32 (*setup_physical_interface) (struct e1000_hw *);
s32(*setup_led) (struct e1000_hw *); s32 (*setup_led) (struct e1000_hw *);
void (*write_vfta) (struct e1000_hw *, u32, u32); void (*write_vfta) (struct e1000_hw *, u32, u32);
void (*config_collision_dist) (struct e1000_hw *); void (*config_collision_dist) (struct e1000_hw *);
void (*rar_set) (struct e1000_hw *, u8 *, u32); int (*rar_set) (struct e1000_hw *, u8 *, u32);
s32(*read_mac_addr) (struct e1000_hw *); u32 (*rar_get_count) (struct e1000_hw *);
s32(*validate_mdi_setting) (struct e1000_hw *); s32 (*read_mac_addr) (struct e1000_hw *);
s32 (*validate_mdi_setting) (struct e1000_hw *);
}; };
/* When to use various PHY register access functions: /* When to use various PHY register access functions:
@ -507,40 +506,40 @@ struct e1000_mac_operations {
* *
*/ */
struct e1000_phy_operations { struct e1000_phy_operations {
s32(*acquire) (struct e1000_hw *); s32 (*acquire) (struct e1000_hw *);
s32(*cfg_on_link_up) (struct e1000_hw *); s32 (*cfg_on_link_up) (struct e1000_hw *);
s32(*check_polarity) (struct e1000_hw *); s32 (*check_polarity) (struct e1000_hw *);
s32(*check_reset_block) (struct e1000_hw *); s32 (*check_reset_block) (struct e1000_hw *);
s32(*commit) (struct e1000_hw *); s32 (*commit) (struct e1000_hw *);
s32(*force_speed_duplex) (struct e1000_hw *); s32 (*force_speed_duplex) (struct e1000_hw *);
s32(*get_cfg_done) (struct e1000_hw *hw); s32 (*get_cfg_done) (struct e1000_hw *hw);
s32(*get_cable_length) (struct e1000_hw *); s32 (*get_cable_length) (struct e1000_hw *);
s32(*get_info) (struct e1000_hw *); s32 (*get_info) (struct e1000_hw *);
s32(*set_page) (struct e1000_hw *, u16); s32 (*set_page) (struct e1000_hw *, u16);
s32(*read_reg) (struct e1000_hw *, u32, u16 *); s32 (*read_reg) (struct e1000_hw *, u32, u16 *);
s32(*read_reg_locked) (struct e1000_hw *, u32, u16 *); s32 (*read_reg_locked) (struct e1000_hw *, u32, u16 *);
s32(*read_reg_page) (struct e1000_hw *, u32, u16 *); s32 (*read_reg_page) (struct e1000_hw *, u32, u16 *);
void (*release) (struct e1000_hw *); void (*release) (struct e1000_hw *);
s32(*reset) (struct e1000_hw *); s32 (*reset) (struct e1000_hw *);
s32(*set_d0_lplu_state) (struct e1000_hw *, bool); s32 (*set_d0_lplu_state) (struct e1000_hw *, bool);
s32(*set_d3_lplu_state) (struct e1000_hw *, bool); s32 (*set_d3_lplu_state) (struct e1000_hw *, bool);
s32(*write_reg) (struct e1000_hw *, u32, u16); s32 (*write_reg) (struct e1000_hw *, u32, u16);
s32(*write_reg_locked) (struct e1000_hw *, u32, u16); s32 (*write_reg_locked) (struct e1000_hw *, u32, u16);
s32(*write_reg_page) (struct e1000_hw *, u32, u16); s32 (*write_reg_page) (struct e1000_hw *, u32, u16);
void (*power_up) (struct e1000_hw *); void (*power_up) (struct e1000_hw *);
void (*power_down) (struct e1000_hw *); void (*power_down) (struct e1000_hw *);
}; };
/* Function pointers for the NVM. */ /* Function pointers for the NVM. */
struct e1000_nvm_operations { struct e1000_nvm_operations {
s32(*acquire) (struct e1000_hw *); s32 (*acquire) (struct e1000_hw *);
s32(*read) (struct e1000_hw *, u16, u16, u16 *); s32 (*read) (struct e1000_hw *, u16, u16, u16 *);
void (*release) (struct e1000_hw *); void (*release) (struct e1000_hw *);
void (*reload) (struct e1000_hw *); void (*reload) (struct e1000_hw *);
s32(*update) (struct e1000_hw *); s32 (*update) (struct e1000_hw *);
s32(*valid_led_default) (struct e1000_hw *, u16 *); s32 (*valid_led_default) (struct e1000_hw *, u16 *);
s32(*validate) (struct e1000_hw *); s32 (*validate) (struct e1000_hw *);
s32(*write) (struct e1000_hw *, u16, u16, u16 *); s32 (*write) (struct e1000_hw *, u16, u16, u16 *);
}; };
struct e1000_mac_info { struct e1000_mac_info {
@ -681,6 +680,10 @@ struct e1000_dev_spec_ich8lan {
bool eee_disable; bool eee_disable;
u16 eee_lp_ability; u16 eee_lp_ability;
enum e1000_ulp_state ulp_state; enum e1000_ulp_state ulp_state;
#ifdef DYNAMIC_LTR_SUPPORT
u16 lat_enc;
u16 max_ltr_enc;
#endif
}; };
struct e1000_hw { struct e1000_hw {

File diff suppressed because it is too large Load diff

View file

@ -1,30 +1,24 @@
/******************************************************************************* /*
* Intel PRO/1000 Linux driver
Intel PRO/1000 Linux driver * Copyright(c) 1999 - 2014 Intel Corporation.
Copyright(c) 1999 - 2013 Intel Corporation. *
* This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License,
under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation.
version 2, as published by the Free Software Foundation. *
* This program is distributed in the hope it will be useful, but WITHOUT
This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details.
more details. *
* The full GNU General Public License is included in this distribution in
You should have received a copy of the GNU General Public License along with * the file called "COPYING".
this program; if not, write to the Free Software Foundation, Inc., *
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * Contact Information:
* Linux NICS <linux.nics@intel.com>
The full GNU General Public License is included in this distribution in * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
the file called "COPYING". * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*/
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
#ifndef _E1000E_ICH8LAN_H_ #ifndef _E1000E_ICH8LAN_H_
#define _E1000E_ICH8LAN_H_ #define _E1000E_ICH8LAN_H_
@ -35,9 +29,9 @@
#define ICH_FLASH_FADDR 0x0008 #define ICH_FLASH_FADDR 0x0008
#define ICH_FLASH_FDATA0 0x0010 #define ICH_FLASH_FDATA0 0x0010
#if defined(__VMKLNX__) #ifdef __VMKLNX__
#define ICH_FLASH_PR0 0x0074 #define ICH_FLASH_PR0 0x0074
#endif /* defined(__VMKLNX__) */ #endif /* __VMKLNX__ */
/* Requires up to 10 seconds when MNG might be accessing part. */ /* Requires up to 10 seconds when MNG might be accessing part. */
#define ICH_FLASH_READ_COMMAND_TIMEOUT 10000000 #define ICH_FLASH_READ_COMMAND_TIMEOUT 10000000
@ -108,10 +102,14 @@
#define E1000_FEXTNVM7_DISABLE_SMB_PERST 0x00000020 #define E1000_FEXTNVM7_DISABLE_SMB_PERST 0x00000020
#define NVM_SIZE_MULTIPLIER 4096 /*multiplier for NVMS field */
#define E1000_FLASH_BASE_ADDR 0xE000 /*offset of NVM access regs */
#define E1000_CTRL_EXT_NVMVS 0x3 /*NVM valid sector */
#define PCIE_ICH8_SNOOP_ALL PCIE_NO_SNOOP_ALL #define PCIE_ICH8_SNOOP_ALL PCIE_NO_SNOOP_ALL
#define E1000_ICH_RAR_ENTRIES 7 #define E1000_ICH_RAR_ENTRIES 7
#define E1000_PCH2_RAR_ENTRIES 11 /* RAR[0-6], SHRA[0-3] */ #define E1000_PCH2_RAR_ENTRIES 5 /* RAR[0], SHRA[0-3] */
#define E1000_PCH_LPT_RAR_ENTRIES 12 /* RAR[0], SHRA[0-10] */ #define E1000_PCH_LPT_RAR_ENTRIES 12 /* RAR[0], SHRA[0-10] */
#define PHY_PAGE_SHIFT 5 #define PHY_PAGE_SHIFT 5
@ -236,7 +234,6 @@
#define I82579_LPI_CTRL_100_ENABLE 0x2000 #define I82579_LPI_CTRL_100_ENABLE 0x2000
#define I82579_LPI_CTRL_1000_ENABLE 0x4000 #define I82579_LPI_CTRL_1000_ENABLE 0x4000
#define I82579_LPI_CTRL_ENABLE_MASK 0x6000 #define I82579_LPI_CTRL_ENABLE_MASK 0x6000
#define I82579_LPI_CTRL_FORCE_PLL_LOCK_COUNT 0x80
/* 82579 DFT Control */ /* 82579 DFT Control */
#define I82579_DFT_CTRL PHY_REG(769, 20) #define I82579_DFT_CTRL PHY_REG(769, 20)
@ -250,16 +247,19 @@
#define I82577_MSE_THRESHOLD 0x0887 /* 82577 Mean Square Error Threshold */ #define I82577_MSE_THRESHOLD 0x0887 /* 82577 Mean Square Error Threshold */
#define I82579_MSE_LINK_DOWN 0x2411 /* MSE count before dropping link */ #define I82579_MSE_LINK_DOWN 0x2411 /* MSE count before dropping link */
#define I82579_RX_CONFIG 0x3412 /* Receive configuration */ #define I82579_RX_CONFIG 0x3412 /* Receive configuration */
#define I82579_LPI_PLL_SHUT 0x4412 /* LPI PLL Shut Enable */
#define I82579_EEE_PCS_STATUS 0x182E /* IEEE MMD Register 3.1 >> 8 */ #define I82579_EEE_PCS_STATUS 0x182E /* IEEE MMD Register 3.1 >> 8 */
#define I82579_EEE_CAPABILITY 0x0410 /* IEEE MMD Register 3.20 */ #define I82579_EEE_CAPABILITY 0x0410 /* IEEE MMD Register 3.20 */
#define I82579_EEE_ADVERTISEMENT 0x040E /* IEEE MMD Register 7.60 */ #define I82579_EEE_ADVERTISEMENT 0x040E /* IEEE MMD Register 7.60 */
#define I82579_EEE_LP_ABILITY 0x040F /* IEEE MMD Register 7.61 */ #define I82579_EEE_LP_ABILITY 0x040F /* IEEE MMD Register 7.61 */
#define I82579_EEE_100_SUPPORTED (1 << 1) /* 100BaseTx EEE */ #define I82579_EEE_100_SUPPORTED (1 << 1) /* 100BaseTx EEE */
#define I82579_EEE_1000_SUPPORTED (1 << 2) /* 1000BaseTx EEE */ #define I82579_EEE_1000_SUPPORTED (1 << 2) /* 1000BaseTx EEE */
#define I82579_LPI_100_PLL_SHUT (1 << 2) /* 100M LPI PLL Shut Enabled */
#define I217_EEE_PCS_STATUS 0x9401 /* IEEE MMD Register 3.1 */ #define I217_EEE_PCS_STATUS 0x9401 /* IEEE MMD Register 3.1 */
#define I217_EEE_CAPABILITY 0x8000 /* IEEE MMD Register 3.20 */ #define I217_EEE_CAPABILITY 0x8000 /* IEEE MMD Register 3.20 */
#define I217_EEE_ADVERTISEMENT 0x8001 /* IEEE MMD Register 7.60 */ #define I217_EEE_ADVERTISEMENT 0x8001 /* IEEE MMD Register 7.60 */
#define I217_EEE_LP_ABILITY 0x8002 /* IEEE MMD Register 7.61 */ #define I217_EEE_LP_ABILITY 0x8002 /* IEEE MMD Register 7.61 */
#define I217_RX_CONFIG 0xB20C /* Receive configuration */
#define E1000_EEE_RX_LPI_RCVD 0x0400 /* Tx LP idle received */ #define E1000_EEE_RX_LPI_RCVD 0x0400 /* Tx LP idle received */
#define E1000_EEE_TX_LPI_RCVD 0x0800 /* Rx LP idle received */ #define E1000_EEE_TX_LPI_RCVD 0x0800 /* Rx LP idle received */
@ -302,5 +302,7 @@ s32 e1000_read_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 *data);
s32 e1000_write_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 data); s32 e1000_write_emi_reg_locked(struct e1000_hw *hw, u16 addr, u16 data);
s32 e1000_set_eee_pchlan(struct e1000_hw *hw); s32 e1000_set_eee_pchlan(struct e1000_hw *hw);
s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx); s32 e1000_enable_ulp_lpt_lp(struct e1000_hw *hw, bool to_sx);
s32 e1000_disable_ulp_lpt_lp(struct e1000_hw *hw, bool force);
#endif /* _E1000E_ICH8LAN_H_ */ #endif /* _E1000E_ICH8LAN_H_ */
#ifdef DYNAMIC_LTR_SUPPORT
void e1000_demote_ltr(struct e1000_hw *hw, bool demote, bool link);
#endif /* DYNAMIC_LTR_SUPPORT */

View file

@ -1,30 +1,24 @@
/******************************************************************************* /*
* Intel PRO/1000 Linux driver
Intel PRO/1000 Linux driver * Copyright(c) 1999 - 2014 Intel Corporation.
Copyright(c) 1999 - 2013 Intel Corporation. *
* This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License,
under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation.
version 2, as published by the Free Software Foundation. *
* This program is distributed in the hope it will be useful, but WITHOUT
This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details.
more details. *
* The full GNU General Public License is included in this distribution in
You should have received a copy of the GNU General Public License along with * the file called "COPYING".
this program; if not, write to the Free Software Foundation, Inc., *
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * Contact Information:
* Linux NICS <linux.nics@intel.com>
The full GNU General Public License is included in this distribution in * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
the file called "COPYING". * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*/
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
#include "e1000.h" #include "e1000.h"
#include "kcompat.h" #include "kcompat.h"
@ -768,8 +762,12 @@ int _kc_pci_save_state(struct pci_dev *pdev)
void _kc_pci_restore_state(struct pci_dev *pdev) void _kc_pci_restore_state(struct pci_dev *pdev)
{ {
#if defined(DRIVER_IXGBE) || defined(DRIVER_I40E) || defined(DRIVER_IXGBEVF)
struct adapter_struct *adapter = pci_get_drvdata(pdev);
#else
struct net_device *netdev = pci_get_drvdata(pdev); struct net_device *netdev = pci_get_drvdata(pdev);
struct adapter_struct *adapter = netdev_priv(netdev); struct adapter_struct *adapter = netdev_priv(netdev);
#endif
int size = PCI_CONFIG_SPACE_LEN, i; int size = PCI_CONFIG_SPACE_LEN, i;
u16 pcie_cap_offset; u16 pcie_cap_offset;
u16 pcie_link_status; u16 pcie_link_status;
@ -825,7 +823,7 @@ void *_kc_kmemdup(const void *src, size_t len, unsigned gfp)
return p; return p;
} }
#endif /* <= 2.6.19 */ #endif /* <= 2.6.19 */
#endif /* ifndef __VMKLNX__ */ #endif /* !__VMKLNX__ */
/*****************************************************************************/ /*****************************************************************************/
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21) ) #if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,21) )
@ -962,13 +960,30 @@ void _kc_print_hex_dump(const char *level,
/*****************************************************************************/ /*****************************************************************************/
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) ) #if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,24) )
#ifdef NAPI #ifdef NAPI
#if defined(DRIVER_IXGBE) || defined(DRIVER_IGB) || defined(DRIVER_I40E) || \
defined(DRIVER_IXGBEVF)
struct net_device *napi_to_poll_dev(const struct napi_struct *napi)
{
struct adapter_q_vector *q_vector = container_of(napi,
struct
adapter_q_vector,
napi);
return &q_vector->poll_dev;
}
#endif
int __kc_adapter_clean(struct net_device *netdev, int *budget) int __kc_adapter_clean(struct net_device *netdev, int *budget)
{ {
int work_done; int work_done;
int work_to_do = min(*budget, netdev->quota); int work_to_do = min(*budget, netdev->quota);
#if defined(DRIVER_IXGBE) || defined(DRIVER_IGB) || defined(DRIVER_I40E) || \
defined(E1000E_MQ) || defined(DRIVER_IXGBEVF)
/* kcompat.h netif_napi_add puts napi struct in "fake netdev->priv" */
struct napi_struct *napi = netdev->priv;
#else
struct adapter_struct *adapter = netdev_priv(netdev); struct adapter_struct *adapter = netdev_priv(netdev);
struct napi_struct *napi = &adapter->napi; struct napi_struct *napi = &adapter->napi;
#endif
work_done = napi->poll(napi, work_to_do); work_done = napi->poll(napi, work_to_do);
*budget -= work_done; *budget -= work_done;
netdev->quota -= work_done; netdev->quota -= work_done;
@ -1049,7 +1064,7 @@ void __kc_warn_slowpath(const char *file, int line, const char *fmt, ...)
} }
#endif /* __WARN_printf */ #endif /* __WARN_printf */
#endif /* < 2.6.27 */ #endif /* < 2.6.27 */
#endif /* ifndef __VMKLNX */ #endif /* !__VMKLNX__ */
/*****************************************************************************/ /*****************************************************************************/
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) ) #if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,28) )
@ -1086,8 +1101,6 @@ out:
} }
#endif /* < 2.6.28 */ #endif /* < 2.6.28 */
#ifdef __VMKLNX__
/*****************************************************************************/ /*****************************************************************************/
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) ) #if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,29) )
static void __kc_pci_set_master(struct pci_dev *pdev, bool enable) static void __kc_pci_set_master(struct pci_dev *pdev, bool enable)
@ -1117,7 +1130,7 @@ void _kc_pci_clear_master(struct pci_dev *dev)
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34) ) #if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,34) )
#if (RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(6,0)) #if (RHEL_RELEASE_CODE < RHEL_RELEASE_VERSION(6,0))
int _kc_pci_num_vf(struct pci_dev *dev) int _kc_pci_num_vf(struct pci_dev __maybe_unused * dev)
{ {
int num_vf = 0; int num_vf = 0;
#ifdef CONFIG_PCI_IOV #ifdef CONFIG_PCI_IOV
@ -1137,9 +1150,59 @@ int _kc_pci_num_vf(struct pci_dev *dev)
} }
#endif /* RHEL_RELEASE_CODE */ #endif /* RHEL_RELEASE_CODE */
#endif /* < 2.6.34 */ #endif /* < 2.6.34 */
#endif /* ifndef __VMKLNX */
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35) ) #if ( LINUX_VERSION_CODE < KERNEL_VERSION(2,6,35) )
#if defined(DRIVER_IXGBE) || defined(DRIVER_IGB) || defined(DRIVER_I40E) || \
defined(DRIVER_IXGBEVF) || defined(DRIVER_FM10K)
#ifdef HAVE_TX_MQ
#if (!(RHEL_RELEASE_CODE && RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,0)))
#ifndef CONFIG_NETDEVICES_MULTIQUEUE
void _kc_netif_set_real_num_tx_queues(struct net_device *dev, unsigned int txq)
{
unsigned int real_num = dev->real_num_tx_queues;
struct Qdisc *qdisc;
int i;
if (unlikely(txq > dev->num_tx_queues)) ;
else if (txq > real_num)
dev->real_num_tx_queues = txq;
else if (txq < real_num) {
dev->real_num_tx_queues = txq;
for (i = txq; i < dev->num_tx_queues; i++) {
qdisc = netdev_get_tx_queue(dev, i)->qdisc;
if (qdisc) {
spin_lock_bh(qdisc_lock(qdisc));
qdisc_reset(qdisc);
spin_unlock_bh(qdisc_lock(qdisc));
}
}
}
}
#endif /* CONFIG_NETDEVICES_MULTIQUEUE */
#endif /* !(RHEL_RELEASE_CODE >= RHEL_RELEASE_VERSION(6,0)) */
#endif /* HAVE_TX_MQ */
ssize_t _kc_simple_write_to_buffer(void *to, size_t available, loff_t * ppos,
const void __user * from, size_t count)
{
loff_t pos = *ppos;
size_t res;
if (pos < 0)
return -EINVAL;
if (pos >= available || !count)
return 0;
if (count > available - pos)
count = available - pos;
res = copy_from_user(to + pos, from, count);
if (res == count)
return -EFAULT;
count -= res;
*ppos = pos + count;
return count;
}
#endif /* defined(DRIVER_IXGBE) || defined(DRIVER_IGB) || defined(DRIVER_I40E) */
#endif /* < 2.6.35 */ #endif /* < 2.6.35 */
/*****************************************************************************/ /*****************************************************************************/
@ -1181,11 +1244,21 @@ void _kc_skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page,
skb->truesize += truesize; skb->truesize += truesize;
} }
#ifndef __VMKLNX__
#if !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0))
int _kc_simple_open(struct inode *inode, struct file *file)
{
if (inode->i_private)
file->private_data = inode->i_private;
return 0;
}
#endif /* SLE_VERSION < 11,3,0 */
#endif /* !__VMKLNX__ */
#endif /* < 3.4.0 */ #endif /* < 3.4.0 */
/******************************************************************************/ /******************************************************************************/
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) ) #if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,7,0) )
#if !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0))
static inline int __kc_pcie_cap_version(struct pci_dev *dev) static inline int __kc_pcie_cap_version(struct pci_dev *dev)
{ {
int pos; int pos;
@ -1221,7 +1294,7 @@ static inline bool __kc_pcie_cap_has_sltctl(struct pci_dev *dev)
pos = pci_find_capability(dev, PCI_CAP_ID_EXP); pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
if (!pos) if (!pos)
return 0; return false;
pci_read_config_word(dev, pos + PCI_EXP_FLAGS, &pcie_flags_reg); pci_read_config_word(dev, pos + PCI_EXP_FLAGS, &pcie_flags_reg);
return __kc_pcie_cap_version(dev) > 1 || return __kc_pcie_cap_version(dev) > 1 ||
@ -1339,7 +1412,11 @@ int __kc_pcie_capability_clear_and_set_word(struct pci_dev *dev, int pos,
return ret; return ret;
} }
#endif /* !(SLE_VERSION_CODE && SLE_VERSION_CODE >= SLE_VERSION(11,3,0)) */
int __kc_pcie_capability_clear_word(struct pci_dev *dev, int pos, u16 clear)
{
return __kc_pcie_capability_clear_and_set_word(dev, pos, clear, 0);
}
#endif /* < 3.7.0 */ #endif /* < 3.7.0 */
/******************************************************************************/ /******************************************************************************/
@ -1349,3 +1426,196 @@ int __kc_pcie_capability_clear_and_set_word(struct pci_dev *dev, int pos,
/*****************************************************************************/ /*****************************************************************************/
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) ) #if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) )
#endif /* 3.10.0 */ #endif /* 3.10.0 */
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,13,0) )
int __kc_dma_set_mask_and_coherent(struct device *dev, u64 mask)
{
int err = dma_set_mask(dev, mask);
if (!err)
/* coherent mask for the same size will always succeed if
* dma_set_mask does. However we store the error anyways, due
* to some kernels which use gcc's warn_unused_result on their
* definition of dma_set_coherent_mask.
*/
err = dma_set_coherent_mask(dev, mask);
return err;
}
#endif /* 3.13.0 */
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,14,0) )
int __kc_pci_enable_msix_range(struct pci_dev *dev, struct msix_entry *entries,
int minvec, int maxvec)
{
int nvec = maxvec;
int rc;
if (maxvec < minvec)
return -ERANGE;
do {
rc = pci_enable_msix(dev, entries, nvec);
if (rc < 0) {
return rc;
} else if (rc > 0) {
if (rc < minvec)
return -ENOSPC;
nvec = rc;
}
} while (rc);
return nvec;
}
#endif /* 3.14.0 */
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,16,0) )
#ifdef HAVE_SET_RX_MODE
#ifdef NETDEV_HW_ADDR_T_UNICAST
int __kc_hw_addr_sync_dev(struct netdev_hw_addr_list *list,
struct net_device *dev,
int (*sync) (struct net_device *,
const unsigned char *),
int (*unsync) (struct net_device *,
const unsigned char *))
{
struct netdev_hw_addr *ha, *tmp;
int err;
/* first go through and flush out any stale entries */
list_for_each_entry_safe(ha, tmp, &list->list, list) {
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) )
if (!ha->synced || ha->refcount != 1)
#else
if (!ha->sync_cnt || ha->refcount != 1)
#endif
continue;
if (unsync && unsync(dev, ha->addr))
continue;
list_del_rcu(&ha->list);
kfree_rcu(ha, rcu_head);
list->count--;
}
/* go through and sync new entries to the list */
list_for_each_entry_safe(ha, tmp, &list->list, list) {
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) )
if (ha->synced)
#else
if (ha->sync_cnt)
#endif
continue;
err = sync(dev, ha->addr);
if (err)
return err;
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) )
ha->synced = true;
#else
ha->sync_cnt++;
#endif
ha->refcount++;
}
return 0;
}
void __kc_hw_addr_unsync_dev(struct netdev_hw_addr_list *list,
struct net_device *dev,
int (*unsync) (struct net_device *,
const unsigned char *))
{
struct netdev_hw_addr *ha, *tmp;
list_for_each_entry_safe(ha, tmp, &list->list, list) {
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) )
if (!ha->synced)
#else
if (!ha->sync_cnt)
#endif
continue;
if (unsync && unsync(dev, ha->addr))
continue;
#if ( LINUX_VERSION_CODE < KERNEL_VERSION(3,10,0) )
ha->synced = false;
#else
ha->sync_cnt--;
#endif
if (--ha->refcount)
continue;
list_del_rcu(&ha->list);
kfree_rcu(ha, rcu_head);
list->count--;
}
}
#endif /* NETDEV_HW_ADDR_T_UNICAST */
#ifndef NETDEV_HW_ADDR_T_MULTICAST
int __kc_dev_addr_sync_dev(struct dev_addr_list **list, int *count,
struct net_device *dev,
int (*sync) (struct net_device *,
const unsigned char *),
int (*unsync) (struct net_device *,
const unsigned char *))
{
struct dev_addr_list *da, **next = list;
int err;
/* first go through and flush out any stale entries */
while ((da = *next) != NULL) {
if (da->da_synced && da->da_users == 1) {
if (!unsync || !unsync(dev, da->da_addr)) {
*next = da->next;
kfree(da);
(*count)--;
continue;
}
}
next = &da->next;
}
/* go through and sync new entries to the list */
for (da = *list; da != NULL; da = da->next) {
if (da->da_synced)
continue;
err = sync(dev, da->da_addr);
if (err)
return err;
da->da_synced++;
da->da_users++;
}
return 0;
}
void __kc_dev_addr_unsync_dev(struct dev_addr_list **list, int *count,
struct net_device *dev,
int (*unsync) (struct net_device *,
const unsigned char *))
{
struct dev_addr_list *da;
while ((da = *list) != NULL) {
if (da->da_synced) {
if (!unsync || !unsync(dev, da->da_addr)) {
da->da_synced--;
if (--da->da_users == 0) {
*list = da->next;
kfree(da);
(*count)--;
continue;
}
}
}
list = &da->next;
}
}
#endif /* NETDEV_HW_ADDR_T_MULTICAST */
#endif /* HAVE_SET_RX_MODE */
#endif /* 3.16.0 */

File diff suppressed because it is too large Load diff

View file

@ -1,30 +1,24 @@
/******************************************************************************* /*
* Intel PRO/1000 Linux driver
Intel PRO/1000 Linux driver * Copyright(c) 1999 - 2014 Intel Corporation.
Copyright(c) 1999 - 2013 Intel Corporation. *
* This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License,
under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation.
version 2, as published by the Free Software Foundation. *
* This program is distributed in the hope it will be useful, but WITHOUT
This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details.
more details. *
* The full GNU General Public License is included in this distribution in
You should have received a copy of the GNU General Public License along with * the file called "COPYING".
this program; if not, write to the Free Software Foundation, Inc., *
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * Contact Information:
* Linux NICS <linux.nics@intel.com>
The full GNU General Public License is included in this distribution in * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
the file called "COPYING". * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*/
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
/* /*
* net/core/ethtool.c - Ethtool ioctl handler * net/core/ethtool.c - Ethtool ioctl handler

View file

@ -1,30 +1,24 @@
/******************************************************************************* /*
* Intel PRO/1000 Linux driver
Intel PRO/1000 Linux driver * Copyright(c) 1999 - 2014 Intel Corporation.
Copyright(c) 1999 - 2013 Intel Corporation. *
* This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License,
under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation.
version 2, as published by the Free Software Foundation. *
* This program is distributed in the hope it will be useful, but WITHOUT
This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details.
more details. *
* The full GNU General Public License is included in this distribution in
You should have received a copy of the GNU General Public License along with * the file called "COPYING".
this program; if not, write to the Free Software Foundation, Inc., *
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * Contact Information:
* Linux NICS <linux.nics@intel.com>
The full GNU General Public License is included in this distribution in * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
the file called "COPYING". * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*/
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
#include "e1000.h" #include "e1000.h"
@ -218,6 +212,11 @@ s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw)
return 0; return 0;
} }
u32 e1000e_rar_get_count_generic(struct e1000_hw *hw)
{
return hw->mac.rar_entry_count;
}
/** /**
* e1000e_rar_set_generic - Set receive address register * e1000e_rar_set_generic - Set receive address register
* @hw: pointer to the HW structure * @hw: pointer to the HW structure
@ -227,7 +226,7 @@ s32 e1000_check_alt_mac_addr_generic(struct e1000_hw *hw)
* Sets the receive address array register at index to the address passed * Sets the receive address array register at index to the address passed
* in by addr. * in by addr.
**/ **/
void e1000e_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index) int e1000e_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index)
{ {
u32 rar_low, rar_high; u32 rar_low, rar_high;
@ -251,6 +250,8 @@ void e1000e_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index)
e1e_flush(); e1e_flush();
ew32(RAH(index), rar_high); ew32(RAH(index), rar_high);
e1e_flush(); e1e_flush();
return 0;
} }
/** /**

View file

@ -1,30 +1,24 @@
/******************************************************************************* /*
* Intel PRO/1000 Linux driver
Intel PRO/1000 Linux driver * Copyright(c) 1999 - 2014 Intel Corporation.
Copyright(c) 1999 - 2013 Intel Corporation. *
* This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License,
under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation.
version 2, as published by the Free Software Foundation. *
* This program is distributed in the hope it will be useful, but WITHOUT
This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details.
more details. *
* The full GNU General Public License is included in this distribution in
You should have received a copy of the GNU General Public License along with * the file called "COPYING".
this program; if not, write to the Free Software Foundation, Inc., *
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * Contact Information:
* Linux NICS <linux.nics@intel.com>
The full GNU General Public License is included in this distribution in * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
the file called "COPYING". * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*/
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
#ifndef _E1000E_MAC_H_ #ifndef _E1000E_MAC_H_
#define _E1000E_MAC_H_ #define _E1000E_MAC_H_
@ -68,7 +62,8 @@ void e1000e_update_adaptive(struct e1000_hw *hw);
void e1000_write_vfta_generic(struct e1000_hw *hw, u32 offset, u32 value); void e1000_write_vfta_generic(struct e1000_hw *hw, u32 offset, u32 value);
void e1000_set_lan_id_multi_port_pcie(struct e1000_hw *hw); void e1000_set_lan_id_multi_port_pcie(struct e1000_hw *hw);
void e1000e_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index); int e1000e_rar_set_generic(struct e1000_hw *hw, u8 *addr, u32 index);
u32 e1000e_rar_get_count_generic(struct e1000_hw *hw);
void e1000e_config_collision_dist_generic(struct e1000_hw *hw); void e1000e_config_collision_dist_generic(struct e1000_hw *hw);
#endif #endif

View file

@ -1,30 +1,24 @@
/******************************************************************************* /*
* Intel PRO/1000 Linux driver
Intel PRO/1000 Linux driver * Copyright(c) 1999 - 2014 Intel Corporation.
Copyright(c) 1999 - 2013 Intel Corporation. *
* This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License,
under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation.
version 2, as published by the Free Software Foundation. *
* This program is distributed in the hope it will be useful, but WITHOUT
This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details.
more details. *
* The full GNU General Public License is included in this distribution in
You should have received a copy of the GNU General Public License along with * the file called "COPYING".
this program; if not, write to the Free Software Foundation, Inc., *
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * Contact Information:
* Linux NICS <linux.nics@intel.com>
The full GNU General Public License is included in this distribution in * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
the file called "COPYING". * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*/
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
#include "e1000.h" #include "e1000.h"
@ -333,9 +327,12 @@ bool e1000e_enable_mng_pass_thru(struct e1000_hw *hw)
} else if ((hw->mac.type == e1000_82574) || } else if ((hw->mac.type == e1000_82574) ||
(hw->mac.type == e1000_82583)) { (hw->mac.type == e1000_82583)) {
u16 data; u16 data;
s32 ret_val;
factps = er32(FACTPS); factps = er32(FACTPS);
e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &data); ret_val = e1000_read_nvm(hw, NVM_INIT_CONTROL2_REG, 1, &data);
if (ret_val)
return false;
if (!(factps & E1000_FACTPS_MNGCG) && if (!(factps & E1000_FACTPS_MNGCG) &&
((data & E1000_NVM_INIT_CTRL2_MNGM) == ((data & E1000_NVM_INIT_CTRL2_MNGM) ==

View file

@ -1,30 +1,24 @@
/******************************************************************************* /*
* Intel PRO/1000 Linux driver
Intel PRO/1000 Linux driver * Copyright(c) 1999 - 2014 Intel Corporation.
Copyright(c) 1999 - 2013 Intel Corporation. *
* This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License,
under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation.
version 2, as published by the Free Software Foundation. *
* This program is distributed in the hope it will be useful, but WITHOUT
This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details.
more details. *
* The full GNU General Public License is included in this distribution in
You should have received a copy of the GNU General Public License along with * the file called "COPYING".
this program; if not, write to the Free Software Foundation, Inc., *
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * Contact Information:
* Linux NICS <linux.nics@intel.com>
The full GNU General Public License is included in this distribution in * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
the file called "COPYING". * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*/
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
#ifndef _E1000E_MANAGE_H_ #ifndef _E1000E_MANAGE_H_
#define _E1000E_MANAGE_H_ #define _E1000E_MANAGE_H_

File diff suppressed because it is too large Load diff

View file

@ -1,30 +1,24 @@
/******************************************************************************* /*
* Intel PRO/1000 Linux driver
Intel PRO/1000 Linux driver * Copyright(c) 1999 - 2014 Intel Corporation.
Copyright(c) 1999 - 2013 Intel Corporation. *
* This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License,
under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation.
version 2, as published by the Free Software Foundation. *
* This program is distributed in the hope it will be useful, but WITHOUT
This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details.
more details. *
* The full GNU General Public License is included in this distribution in
You should have received a copy of the GNU General Public License along with * the file called "COPYING".
this program; if not, write to the Free Software Foundation, Inc., *
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * Contact Information:
* Linux NICS <linux.nics@intel.com>
The full GNU General Public License is included in this distribution in * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
the file called "COPYING". * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*/
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
#include "e1000.h" #include "e1000.h"
@ -339,6 +333,9 @@ s32 e1000e_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
data[i] = (er32(EERD) >> E1000_NVM_RW_REG_DATA); data[i] = (er32(EERD) >> E1000_NVM_RW_REG_DATA);
} }
if (ret_val)
e_dbg("NVM read error: %d\n", ret_val);
return ret_val; return ret_val;
} }

View file

@ -1,30 +1,24 @@
/******************************************************************************* /*
* Intel PRO/1000 Linux driver
Intel PRO/1000 Linux driver * Copyright(c) 1999 - 2014 Intel Corporation.
Copyright(c) 1999 - 2013 Intel Corporation. *
* This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License,
under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation.
version 2, as published by the Free Software Foundation. *
* This program is distributed in the hope it will be useful, but WITHOUT
This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details.
more details. *
* The full GNU General Public License is included in this distribution in
You should have received a copy of the GNU General Public License along with * the file called "COPYING".
this program; if not, write to the Free Software Foundation, Inc., *
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * Contact Information:
* Linux NICS <linux.nics@intel.com>
The full GNU General Public License is included in this distribution in * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
the file called "COPYING". * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*/
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
#ifndef _E1000E_NVM_H_ #ifndef _E1000E_NVM_H_
#define _E1000E_NVM_H_ #define _E1000E_NVM_H_

View file

@ -1,30 +1,24 @@
/******************************************************************************* /*
* Intel PRO/1000 Linux driver
Intel PRO/1000 Linux driver * Copyright(c) 1999 - 2014 Intel Corporation.
Copyright(c) 1999 - 2013 Intel Corporation. *
* This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License,
under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation.
version 2, as published by the Free Software Foundation. *
* This program is distributed in the hope it will be useful, but WITHOUT
This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details.
more details. *
* The full GNU General Public License is included in this distribution in
You should have received a copy of the GNU General Public License along with * the file called "COPYING".
this program; if not, write to the Free Software Foundation, Inc., *
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * Contact Information:
* Linux NICS <linux.nics@intel.com>
The full GNU General Public License is included in this distribution in * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
the file called "COPYING". * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*/
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/module.h> #include <linux/module.h>
@ -63,13 +57,13 @@ MODULE_PARM_DESC(copybreak,
* "Extensions to the C Language Family" of the GCC documentation. * "Extensions to the C Language Family" of the GCC documentation.
*/ */
#define E1000_PARAM(X, desc) \ #define E1000_PARAM(X, desc) \
static const int __devinitdata X[E1000_MAX_NIC+1] = E1000_PARAM_INIT; \ static const int X[E1000_MAX_NIC+1] __devinitconst = E1000_PARAM_INIT; \
static unsigned int num_##X; \ static unsigned int num_##X; \
MODULE_PARM(X, "1-" __MODULE_STRING(E1000_MAX_NIC) "i"); \ MODULE_PARM(X, "1-" __MODULE_STRING(E1000_MAX_NIC) "i"); \
MODULE_PARM_DESC(X, desc); MODULE_PARM_DESC(X, desc);
#elif defined(HAVE_CONFIG_HOTPLUG) #elif defined(HAVE_CONFIG_HOTPLUG)
#define E1000_PARAM(X, desc) \ #define E1000_PARAM(X, desc) \
static int __devinitdata X[E1000_MAX_NIC+1] \ static int X[E1000_MAX_NIC+1] __devinitdata \
= E1000_PARAM_INIT; \ = E1000_PARAM_INIT; \
static unsigned int num_##X; \ static unsigned int num_##X; \
module_param_array_named(X, X, int, &num_##X, 0); \ module_param_array_named(X, X, int, &num_##X, 0); \
@ -170,7 +164,7 @@ E1000_PARAM(KumeranLockLoss, "Enable Kumeran lock loss workaround");
E1000_PARAM(CrcStripping, E1000_PARAM(CrcStripping,
"Enable CRC Stripping, disable if your BMC needs the CRC"); "Enable CRC Stripping, disable if your BMC needs the CRC");
#if defined(__VMKLNX__) #ifdef __VMKLNX__
/* /*
* Write Protect NVM * Write Protect NVM
* *
@ -179,7 +173,7 @@ E1000_PARAM(CrcStripping,
* Default Value: 1 (enabled) * Default Value: 1 (enabled)
*/ */
E1000_PARAM(WriteProtectNVM, "Write-protect NVM [WARNING: disabling this can lead to corrupted NVM]"); E1000_PARAM(WriteProtectNVM, "Write-protect NVM [WARNING: disabling this can lead to corrupted NVM]");
#endif /* defined(__VMKLNX__) */ #endif /* __VMKLNX__ */
/* Enable/disable EEE (a.k.a. IEEE802.3az) /* Enable/disable EEE (a.k.a. IEEE802.3az)
* *
@ -629,7 +623,7 @@ void e1000e_check_options(struct e1000_adapter *adapter)
adapter->node = node; adapter->node = node;
} }
#if defined(__VMKLNX__) #ifdef __VMKLNX__
{ /* Write-protect NVM */ { /* Write-protect NVM */
const struct e1000_option opt = { const struct e1000_option opt = {
.type = enable_option, .type = enable_option,
@ -651,5 +645,5 @@ void e1000e_check_options(struct e1000_adapter *adapter)
} }
} }
} }
#endif /* defined(__VMKLNX__) */ #endif /* __VMKLNX__ */
} }

View file

@ -1,30 +1,24 @@
/******************************************************************************* /*
* Intel PRO/1000 Linux driver
Intel PRO/1000 Linux driver * Copyright(c) 1999 - 2014 Intel Corporation.
Copyright(c) 1999 - 2013 Intel Corporation. *
* This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License,
under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation.
version 2, as published by the Free Software Foundation. *
* This program is distributed in the hope it will be useful, but WITHOUT
This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details.
more details. *
* The full GNU General Public License is included in this distribution in
You should have received a copy of the GNU General Public License along with * the file called "COPYING".
this program; if not, write to the Free Software Foundation, Inc., *
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * Contact Information:
* Linux NICS <linux.nics@intel.com>
The full GNU General Public License is included in this distribution in * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
the file called "COPYING". * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*/
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
#include "e1000.h" #include "e1000.h"
@ -1760,19 +1754,23 @@ s32 e1000e_phy_has_link_generic(struct e1000_hw *hw, u32 iterations,
* it across the board. * it across the board.
*/ */
ret_val = e1e_rphy(hw, MII_BMSR, &phy_status); ret_val = e1e_rphy(hw, MII_BMSR, &phy_status);
if (ret_val) if (ret_val) {
/* If the first read fails, another entity may have /* If the first read fails, another entity may have
* ownership of the resources, wait and try again to * ownership of the resources, wait and try again to
* see if they have relinquished the resources yet. * see if they have relinquished the resources yet.
*/ */
if (usec_interval >= 1000)
msleep(usec_interval / 1000);
else
udelay(usec_interval); udelay(usec_interval);
}
ret_val = e1e_rphy(hw, MII_BMSR, &phy_status); ret_val = e1e_rphy(hw, MII_BMSR, &phy_status);
if (ret_val) if (ret_val)
break; break;
if (phy_status & BMSR_LSTATUS) if (phy_status & BMSR_LSTATUS)
break; break;
if (usec_interval >= 1000) if (usec_interval >= 1000)
mdelay(usec_interval / 1000); msleep(usec_interval / 1000);
else else
udelay(usec_interval); udelay(usec_interval);
} }

View file

@ -1,30 +1,24 @@
/******************************************************************************* /*
* Intel PRO/1000 Linux driver
Intel PRO/1000 Linux driver * Copyright(c) 1999 - 2014 Intel Corporation.
Copyright(c) 1999 - 2013 Intel Corporation. *
* This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License,
under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation.
version 2, as published by the Free Software Foundation. *
* This program is distributed in the hope it will be useful, but WITHOUT
This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details.
more details. *
* The full GNU General Public License is included in this distribution in
You should have received a copy of the GNU General Public License along with * the file called "COPYING".
this program; if not, write to the Free Software Foundation, Inc., *
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * Contact Information:
* Linux NICS <linux.nics@intel.com>
The full GNU General Public License is included in this distribution in * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
the file called "COPYING". * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*/
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
#ifndef _E1000E_PHY_H_ #ifndef _E1000E_PHY_H_
#define _E1000E_PHY_H_ #define _E1000E_PHY_H_
@ -171,6 +165,7 @@ s32 e1000_get_cable_length_82577(struct e1000_hw *hw);
#define HV_M_STATUS_AUTONEG_COMPLETE 0x1000 #define HV_M_STATUS_AUTONEG_COMPLETE 0x1000
#define HV_M_STATUS_SPEED_MASK 0x0300 #define HV_M_STATUS_SPEED_MASK 0x0300
#define HV_M_STATUS_SPEED_1000 0x0200 #define HV_M_STATUS_SPEED_1000 0x0200
#define HV_M_STATUS_SPEED_100 0x0100
#define HV_M_STATUS_LINK_UP 0x0040 #define HV_M_STATUS_LINK_UP 0x0040
#define IGP01E1000_PHY_PCS_INIT_REG 0x00B4 #define IGP01E1000_PHY_PCS_INIT_REG 0x00B4

View file

@ -1,30 +1,24 @@
/******************************************************************************* /*
* Intel PRO/1000 Linux driver
Intel PRO/1000 Linux driver * Copyright(c) 1999 - 2014 Intel Corporation.
Copyright(c) 1999 - 2013 Intel Corporation. *
* This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License,
under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation.
version 2, as published by the Free Software Foundation. *
* This program is distributed in the hope it will be useful, but WITHOUT
This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details.
more details. *
* The full GNU General Public License is included in this distribution in
You should have received a copy of the GNU General Public License along with * the file called "COPYING".
this program; if not, write to the Free Software Foundation, Inc., *
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * Contact Information:
* Linux NICS <linux.nics@intel.com>
The full GNU General Public License is included in this distribution in * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
the file called "COPYING". * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*/
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
/* PTP 1588 Hardware Clock (PHC) /* PTP 1588 Hardware Clock (PHC)
* Derived from PTP Hardware Clock driver for Intel 82576 and 82580 (igb) * Derived from PTP Hardware Clock driver for Intel 82576 and 82580 (igb)
@ -47,6 +41,7 @@ static int e1000e_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta)
ptp_clock_info); ptp_clock_info);
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
bool neg_adj = false; bool neg_adj = false;
unsigned long flags;
u64 adjustment; u64 adjustment;
u32 timinca, incvalue; u32 timinca, incvalue;
s32 ret_val; s32 ret_val;
@ -64,6 +59,8 @@ static int e1000e_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta)
if (ret_val) if (ret_val)
return ret_val; return ret_val;
spin_lock_irqsave(&adapter->systim_lock, flags);
incvalue = timinca & E1000_TIMINCA_INCVALUE_MASK; incvalue = timinca & E1000_TIMINCA_INCVALUE_MASK;
adjustment = incvalue; adjustment = incvalue;
@ -77,6 +74,8 @@ static int e1000e_phc_adjfreq(struct ptp_clock_info *ptp, s32 delta)
ew32(TIMINCA, timinca); ew32(TIMINCA, timinca);
spin_unlock_irqrestore(&adapter->systim_lock, flags);
return 0; return 0;
} }
@ -225,7 +224,9 @@ void e1000e_ptp_init(struct e1000_adapter *adapter)
switch (hw->mac.type) { switch (hw->mac.type) {
case e1000_pch2lan: case e1000_pch2lan:
case e1000_pch_lpt: case e1000_pch_lpt:
if ((hw->mac.type != e1000_pch_lpt) || case e1000_pch_spt:
if (((hw->mac.type != e1000_pch_lpt) &&
(hw->mac.type != e1000_pch_spt)) ||
(er32(TSYNCRXCTL) & E1000_TSYNCRXCTL_SYSCFI)) { (er32(TSYNCRXCTL) & E1000_TSYNCRXCTL_SYSCFI)) {
adapter->ptp_clock_info.max_adj = 24000000 - 1; adapter->ptp_clock_info.max_adj = 24000000 - 1;
break; break;

View file

@ -1,30 +1,24 @@
/******************************************************************************* /*
* Intel PRO/1000 Linux driver
Intel PRO/1000 Linux driver * Copyright(c) 1999 - 2014 Intel Corporation.
Copyright(c) 1999 - 2013 Intel Corporation. *
* This program is free software; you can redistribute it and/or modify it
This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License,
under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation.
version 2, as published by the Free Software Foundation. *
* This program is distributed in the hope it will be useful, but WITHOUT
This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details.
more details. *
* The full GNU General Public License is included in this distribution in
You should have received a copy of the GNU General Public License along with * the file called "COPYING".
this program; if not, write to the Free Software Foundation, Inc., *
51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * Contact Information:
* Linux NICS <linux.nics@intel.com>
The full GNU General Public License is included in this distribution in * e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
the file called "COPYING". * Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*/
Contact Information:
Linux NICS <linux.nics@intel.com>
e1000-devel Mailing List <e1000-devel@lists.sourceforge.net>
Intel Corporation, 5200 N.E. Elam Young Parkway, Hillsboro, OR 97124-6497
*******************************************************************************/
#ifndef _E1000E_REGS_H_ #ifndef _E1000E_REGS_H_
#define _E1000E_REGS_H_ #define _E1000E_REGS_H_
@ -74,6 +68,7 @@
#define E1000_PBA 0x01000 /* Packet Buffer Allocation - RW */ #define E1000_PBA 0x01000 /* Packet Buffer Allocation - RW */
#define E1000_PBS 0x01008 /* Packet Buffer Size */ #define E1000_PBS 0x01008 /* Packet Buffer Size */
#define E1000_PBECCSTS 0x0100C /* Packet Buffer ECC Status - RW */ #define E1000_PBECCSTS 0x0100C /* Packet Buffer ECC Status - RW */
#define E1000_IOSFPC 0x00F28 /* TX corrupted data */
#define E1000_EEMNGCTL 0x01010 /* MNG EEprom Control */ #define E1000_EEMNGCTL 0x01010 /* MNG EEprom Control */
#define E1000_EEWR 0x0102C /* EEPROM Write Register - RW */ #define E1000_EEWR 0x0102C /* EEPROM Write Register - RW */
#define E1000_FLOP 0x0103C /* FLASH Opcode Register */ #define E1000_FLOP 0x0103C /* FLASH Opcode Register */
@ -128,6 +123,7 @@
(0x054E4 + ((_i - 16) * 8))) (0x054E4 + ((_i - 16) * 8)))
#define E1000_SHRAL(_i) (0x05438 + ((_i) * 8)) #define E1000_SHRAL(_i) (0x05438 + ((_i) * 8))
#define E1000_SHRAH(_i) (0x0543C + ((_i) * 8)) #define E1000_SHRAH(_i) (0x0543C + ((_i) * 8))
#define E1000_TARC0_CB_MULTIQ_3_REQ (1 << 28 | 1 << 29)
#define E1000_TDFH 0x03410 /* Tx Data FIFO Head - RW */ #define E1000_TDFH 0x03410 /* Tx Data FIFO Head - RW */
#define E1000_TDFT 0x03418 /* Tx Data FIFO Tail - RW */ #define E1000_TDFT 0x03418 /* Tx Data FIFO Tail - RW */
#define E1000_TDFHS 0x03420 /* Tx Data FIFO Head Saved - RW */ #define E1000_TDFHS 0x03420 /* Tx Data FIFO Head Saved - RW */
@ -248,6 +244,10 @@
#define E1000_SYSTIML 0x0B600 /* System time register Low - RO */ #define E1000_SYSTIML 0x0B600 /* System time register Low - RO */
#define E1000_SYSTIMH 0x0B604 /* System time register High - RO */ #define E1000_SYSTIMH 0x0B604 /* System time register High - RO */
#define E1000_TIMINCA 0x0B608 /* Increment attributes register - RW */ #define E1000_TIMINCA 0x0B608 /* Increment attributes register - RW */
#define E1000_SYSSTMPL 0x0B648 /* HH Timesync system stamp low register */
#define E1000_SYSSTMPH 0x0B64C /* HH Timesync system stamp hi register */
#define E1000_PLTSTMPL 0x0B640 /* HH Timesync platform stamp low register */
#define E1000_PLTSTMPH 0x0B644 /* HH Timesync platform stamp hi register */
#define E1000_RXMTRL 0x0B634 /* Time sync Rx EtherType and Msg Type - RW */ #define E1000_RXMTRL 0x0B634 /* Time sync Rx EtherType and Msg Type - RW */
#define E1000_RXUDP 0x0B638 /* Time Sync Rx UDP Port - RW */ #define E1000_RXUDP 0x0B638 /* Time Sync Rx UDP Port - RW */

View file

@ -34,6 +34,7 @@
#ifndef _MLNX_COMPAT_H #ifndef _MLNX_COMPAT_H
#define _MLNX_COMPAT_H #define _MLNX_COMPAT_H
#if !defined(__VMKLNX__) || !defined(__LINUX_XHCI_HCD_H)
#include <linux/gfp.h> #include <linux/gfp.h>
#include <linux/workqueue.h> #include <linux/workqueue.h>
@ -46,7 +47,9 @@
/************************************************************************/ /************************************************************************/
#endif /* !defined(__VMKLNX__) || !defined(__LINUX_XHCI_HCD_H) */
#include "hash.h" #include "hash.h"
#if !defined(__VMKLNX__) || !defined(__LINUX_XHCI_HCD_H)
/************************************************************************/ /************************************************************************/
@ -312,6 +315,7 @@ void bitmap_clear(unsigned long *map, int start, int nr);
/************************************************************************/ /************************************************************************/
#endif /* !defined(__VMKLNX__) || !defined(__LINUX_XHCI_HCD_H) */
/* Radix tree */ /* Radix tree */
#define radix_tree_root hash_table #define radix_tree_root hash_table
#define radix_tree_lookup mlnx_radix_tree_lookup #define radix_tree_lookup mlnx_radix_tree_lookup
@ -343,6 +347,7 @@ static inline void * mlnx_radix_tree_delete(struct radix_tree_root *p_tree,
return hash_delete(p_tree, index); return hash_delete(p_tree, index);
} }
#if !defined(__VMKLNX__) || !defined(__LINUX_XHCI_HCD_H)
/************************************************************************/ /************************************************************************/
/* Ethtool */ /* Ethtool */
@ -391,4 +396,5 @@ void *kmemdup(const void *src, size_t len, gfp_t gfp);
int nonseekable_open(struct inode *inode, struct file *filp); int nonseekable_open(struct inode *inode, struct file *filp);
#endif /* !defined(__VMKLNX__) || !defined(__LINUX_XHCI_HCD_H) */
#endif /* _MLNX_COMPAT_H */ #endif /* _MLNX_COMPAT_H */

View file

@ -25,7 +25,7 @@
/* /*
* Source file for NIC routines to access the Phantom hardware * Source file for NIC routines to access the Phantom hardware
* *
* $Id: //depot/vmkdrivers/vsphere60p01/src_9/drivers/net/nx_nic/unm_nic_hw.c#1 $ * $Id: //depot/vmkdrivers/vsphere60u1/src_9/drivers/net/nx_nic/unm_nic_hw.c#1 $
* *
*/ */
#include <linux/delay.h> #include <linux/delay.h>

View file

@ -55,9 +55,10 @@ MODULE_PARM_DESC(psod_on_tx_timeout, "For debugging purposes, crash the system "
#define TG3_OPTION_UNSET -1 #define TG3_OPTION_UNSET -1
/* PR 1392928. Disable netq on tg3 by default */
static unsigned int __devinitdata tg3_netq_index; static unsigned int __devinitdata tg3_netq_index;
static int __devinitdata tg3_netq_force[TG3_MAX_NIC+1] = static int __devinitdata tg3_netq_force[TG3_MAX_NIC+1] =
{ [0 ... TG3_MAX_NIC] = TG3_OPTION_UNSET }; { [0 ... TG3_MAX_NIC] = 0 };
module_param_array_named(force_netq, tg3_netq_force, int, NULL, 0); module_param_array_named(force_netq, tg3_netq_force, int, NULL, 0);
MODULE_PARM_DESC(force_netq, MODULE_PARM_DESC(force_netq,

View file

@ -891,7 +891,7 @@ static void fcoe_ctlr_age_fcfs(struct fcoe_ctlr *fip)
fip->lp->host->host_no, fcf->fabric_name, fip->lp->host->host_no, fcf->fabric_name,
stats->MissDiscAdvCount); stats->MissDiscAdvCount);
} }
if (time_after(jiffies, fcf->time + fcf->fka_period * 3 + if (time_after_eq(jiffies, fcf->time + fcf->fka_period * 3 +
msecs_to_jiffies(FIP_FCF_FUZZ * 3))) { msecs_to_jiffies(FIP_FCF_FUZZ * 3))) {
if (fip->sel_fcf == fcf) if (fip->sel_fcf == fcf)
fip->sel_fcf = NULL; fip->sel_fcf = NULL;
@ -913,13 +913,11 @@ static void fcoe_ctlr_age_fcfs(struct fcoe_ctlr *fip)
sel_time = fcf->time; sel_time = fcf->time;
} }
} }
if (sel_time) { if (sel_time && !fip->sel_fcf && !fip->sel_time) {
sel_time += msecs_to_jiffies(FCOE_CTLR_START_DELAY); sel_time += msecs_to_jiffies(FCOE_CTLR_START_DELAY);
fip->sel_time = sel_time; fip->sel_time = sel_time;
if (time_before(sel_time, fip->timer.expires)) if (time_before(sel_time, fip->timer.expires))
mod_timer(&fip->timer, sel_time); mod_timer(&fip->timer, sel_time);
} else {
fip->sel_time = 0;
} }
} }
@ -1040,10 +1038,10 @@ static void fcoe_ctlr_recv_adv(struct fcoe_ctlr *fip, struct sk_buff *skb)
{ {
struct fcoe_fcf *fcf; struct fcoe_fcf *fcf;
struct fcoe_fcf new; struct fcoe_fcf new;
struct fcoe_fcf *found;
unsigned long sol_tov = msecs_to_jiffies(FCOE_CTRL_SOL_TOV); unsigned long sol_tov = msecs_to_jiffies(FCOE_CTRL_SOL_TOV);
int first = 0; int first = 0;
int mtu_valid; int mtu_valid;
int found = 0;
if (fcoe_ctlr_parse_adv(fip, skb, &new)) if (fcoe_ctlr_parse_adv(fip, skb, &new))
return; return;
@ -1054,13 +1052,12 @@ static void fcoe_ctlr_recv_adv(struct fcoe_ctlr *fip, struct sk_buff *skb)
mutex_lock(&fip->ctlr_mutex); mutex_lock(&fip->ctlr_mutex);
#endif // defined(__VMKLNX__) #endif // defined(__VMKLNX__)
first = list_empty(&fip->fcfs); first = list_empty(&fip->fcfs);
found = NULL;
list_for_each_entry(fcf, &fip->fcfs, list) { list_for_each_entry(fcf, &fip->fcfs, list) {
if (fcf->switch_name == new.switch_name && if (fcf->switch_name == new.switch_name &&
fcf->fabric_name == new.fabric_name && fcf->fabric_name == new.fabric_name &&
fcf->fc_map == new.fc_map && fcf->fc_map == new.fc_map &&
compare_ether_addr(fcf->fcf_mac, new.fcf_mac) == 0) { compare_ether_addr(fcf->fcf_mac, new.fcf_mac) == 0) {
found = fcf; found = 1;
break; break;
} }
} }
@ -1082,22 +1079,29 @@ static void fcoe_ctlr_recv_adv(struct fcoe_ctlr *fip, struct sk_buff *skb)
* ignored after a usable solicited advertisement * ignored after a usable solicited advertisement
* has been received. * has been received.
*/ */
if (fcf == fip->sel_fcf) { fcf->fd_flags = new.fd_flags;
if (!fcoe_ctlr_fcf_usable(fcf))
fcf->flags = new.flags;
if (fcf == fip->sel_fcf && !fcf->fd_flags) {
fip->ctlr_ka_time -= fcf->fka_period; fip->ctlr_ka_time -= fcf->fka_period;
fip->ctlr_ka_time += new.fka_period; fip->ctlr_ka_time += new.fka_period;
if (time_before(fip->ctlr_ka_time, fip->timer.expires)) if (time_before(fip->ctlr_ka_time, fip->timer.expires))
mod_timer(&fip->timer, fip->ctlr_ka_time); mod_timer(&fip->timer, fip->ctlr_ka_time);
} else if (!fcoe_ctlr_fcf_usable(fcf)) }
fcf->flags = new.flags;
fcf->fka_period = new.fka_period; fcf->fka_period = new.fka_period;
memcpy(fcf->fcf_mac, new.fcf_mac, ETH_ALEN); memcpy(fcf->fcf_mac, new.fcf_mac, ETH_ALEN);
} }
mtu_valid = fcoe_ctlr_mtu_valid(fcf); mtu_valid = fcoe_ctlr_mtu_valid(fcf);
fcf->time = jiffies; fcf->time = jiffies;
if (!found) { if (!found) {
LIBFCOE_FIP_DBG(fip, "New FCF for fab %16.16llx " LIBFCOE_FIP_DBG(fip, "New FCF for fab %16.16llx "
"map %x val %d\n", "map %x val %d mac %02x:%02x:%02x:%02x:%02x:%02x\n",
fcf->fabric_name, fcf->fc_map, mtu_valid); fcf->fabric_name, fcf->fc_map, mtu_valid,
fcf->fcf_mac[0], fcf->fcf_mac[1],
fcf->fcf_mac[2], fcf->fcf_mac[3],
fcf->fcf_mac[4], fcf->fcf_mac[5]);
} }
/* /*
@ -1123,17 +1127,22 @@ static void fcoe_ctlr_recv_adv(struct fcoe_ctlr *fip, struct sk_buff *skb)
* are sending periodic multicast advertisements. * are sending periodic multicast advertisements.
*/ */
if (mtu_valid) { if (mtu_valid) {
list_del(&fcf->list); list_move(&fcf->list, &fip->fcfs);
list_add(&fcf->list, &fip->fcfs);
} }
/* /*
* If this is the first validated FCF, note the time and * If this is the first validated FCF, note the time and
* set a timer to trigger selection. * set a timer to trigger selection.
*
* Update FCF sel_time on new FCF aka FCF that is not in list
* and FCF selection has not happened yet.
*/ */
if (mtu_valid && !fip->sel_time && fcoe_ctlr_fcf_usable(fcf)) { if (mtu_valid && !fip->sel_fcf && fcoe_ctlr_fcf_usable(fcf)) {
if (!found) {
fip->sel_time = jiffies + fip->sel_time = jiffies +
msecs_to_jiffies(FCOE_CTLR_START_DELAY); msecs_to_jiffies(FCOE_CTLR_START_DELAY);
}
if (!timer_pending(&fip->timer) || if (!timer_pending(&fip->timer) ||
time_before(fip->sel_time, fip->timer.expires)) time_before(fip->sel_time, fip->timer.expires))
mod_timer(&fip->timer, fip->sel_time); mod_timer(&fip->timer, fip->sel_time);
@ -1641,6 +1650,8 @@ static void fcoe_ctlr_timeout(unsigned long arg)
fip->port_ka_time = jiffies + fip->port_ka_time = jiffies +
msecs_to_jiffies(FIP_VN_KA_PERIOD); msecs_to_jiffies(FIP_VN_KA_PERIOD);
fip->ctlr_ka_time = jiffies + sel->fka_period; fip->ctlr_ka_time = jiffies + sel->fka_period;
if (time_after(next_timer, fip->ctlr_ka_time))
next_timer = fip->ctlr_ka_time;
} else { } else {
printk(KERN_NOTICE "libfcoe: host%d: " printk(KERN_NOTICE "libfcoe: host%d: "
"FIP Fibre-Channel Forwarder timed out. " "FIP Fibre-Channel Forwarder timed out. "

View file

@ -194,7 +194,10 @@ int usb_hcd_pci_probe(struct pci_dev *dev, const struct pci_device_id *id)
return -ENODEV; return -ENODEV;
dev->current_state = PCI_D0; dev->current_state = PCI_D0;
if (!dev->irq) { /* The xHCI driver supports MSI and MSI-X,
* so don't fail if the BIOS doesn't provide a legacy IRQ.
*/
if (!dev->irq && (driver->flags & HCD_MASK) != HCD_USB3) {
dev_err(&dev->dev, dev_err(&dev->dev,
"Found HC with no IRQ. Check BIOS/PCI %s setup!\n", "Found HC with no IRQ. Check BIOS/PCI %s setup!\n",
pci_name(dev)); pci_name(dev));

View file

@ -2622,8 +2622,10 @@ int usb_add_hcd(struct usb_hcd *hcd,
&& device_can_wakeup(&hcd->self.root_hub->dev)) && device_can_wakeup(&hcd->self.root_hub->dev))
dev_dbg(hcd->self.controller, "supports USB remote wakeup\n"); dev_dbg(hcd->self.controller, "supports USB remote wakeup\n");
/* enable irqs just before we start the controller */ /* enable irqs just before we start the controller,
if (usb_hcd_is_primary_hcd(hcd)) { * if the BIOS provides legacy PCI irqs.
*/
if (usb_hcd_is_primary_hcd(hcd) && irqnum) {
retval = usb_hcd_request_irqs(hcd, irqnum, irqflags); retval = usb_hcd_request_irqs(hcd, irqnum, irqflags);
if (retval) if (retval)
goto err_request_irq; goto err_request_irq;

View file

@ -0,0 +1,276 @@
/*
* Copyright (c) 2011-2012 Mellanox Technologies. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the file
* COPYING in the main directory of this source tree, or the
* OpenIB.org BSD license below:
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* - Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer.
*
* - 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.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include <linux/slab.h>
#include <linux/errno.h>
#include "hash.h"
/************************************************************************/
struct hash_node {
unsigned long key; // key for lookup
void *p_data; // pointer to stored data
struct hash_node *p_next; // pointer to next node
};
/************************************************************************/
#define MINIMUM_HASH_TABLE_SIZE 512
/* TODO: Need to fix expand latter */
#ifdef __VMKERNEL_HASH_EXPAND_ENABLE__
#define EXPAND_HASH_TABLE_LIMIT_ORDER 1
#endif /* __VMKERNEL_HASH_EXPAND_ENABLE__ */
/************************************************************************/
static unsigned long hash(hdl_hash_t p_table, unsigned long key)
{
return (key & p_table->mask);
}
/************/
void hash_print(hdl_hash_t p_table)
{
hash_node_t *p_node;
unsigned long i;
printk("HASH ID=%p\n", p_table);
// if empty
if (p_table->size == 0) {
printk("HASH is EMPTY!\n");
return;
}
printk("HASH size=%lu\n", p_table->size);
printk("HASH mask=%lu\n", p_table->mask);
printk("HASH entries=%lu\n", p_table->entries);
printk("HASH bucket:\n");
for (i = 0; i < p_table->size; ++i) {
p_node = p_table->bucket[i];
printk("[%lu] ", i);
while (p_node) {
printk("Key=0x%lx --> ", p_node->key);
p_node = p_node->p_next;
}
printk("\n");
}
}
/************/
int hash_init(hdl_hash_t p_table, unsigned long table_size)
{
p_table->entries = 0;
p_table->size = 2;
p_table->mask = p_table->size - 1;
// round to power of 2
while (p_table->size < table_size)
p_table->size <<= 1;
p_table->mask = p_table->size - 1;
// allocate
p_table->bucket = (hash_node_t **)kcalloc(p_table->size,
sizeof(hash_node_t *), GFP_KERNEL);
if (!p_table->bucket)
return -ENOMEM;
return 0;
}
/************/
void hash_destroy(hdl_hash_t p_table)
{
hash_node_t *p_node, *p_prev_node;
unsigned long i;
for (i = 0; i < p_table->size; ++i) {
p_node = p_table->bucket[i];
while (p_node) {
p_prev_node = p_node;
p_node = p_node->p_next;
kfree(p_prev_node);
}
}
kfree(p_table->bucket);
memset(p_table, 0, sizeof(struct hash_table));
}
/************/
#ifdef __VMKERNEL_HASH_EXPAND_ENABLE__
static int hash_expand(hdl_hash_t p_table)
{
hash_node_t **prev_bucket;
hash_node_t *p_prev_node, *p_tmp_node;
unsigned long prev_size, hash_entry, i;
int rc = 0;
prev_bucket = p_table->bucket;
prev_size = p_table->size;
if ((rc = hash_init(p_table, (prev_size << 1))) != 0);
return rc;
for (i = 0; i < prev_size; ++i) {
p_prev_node = prev_bucket[i];
// we have several nodes in this hash entry
while (p_prev_node) {
p_tmp_node = p_prev_node;
p_prev_node = p_prev_node->p_next;
hash_entry = hash(p_table, p_tmp_node->key);
p_tmp_node->p_next = p_table->bucket[hash_entry];
p_table->bucket[hash_entry] = p_tmp_node;
++p_table->entries;
}
}
// free only the previous bucket array, not the nodes
// because we will use the nodes pointers in new large hash
kfree(prev_bucket);
return 0;
}
#endif /* __VMKERNEL_HASH_EXPAND_ENABLE__ */
/************/
void * hash_lookup(hdl_hash_t p_table, unsigned long key)
{
hash_node_t *p_node;
unsigned long hash_entry;
// if empty
if (p_table->size == 0)
return NULL;
hash_entry = hash(p_table, key);
for (p_node = p_table->bucket[hash_entry]; p_node;
p_node = p_node->p_next) {
if (key == p_node->key)
break;
}
return (p_node ? p_node->p_data : NULL);
}
/************/
int hash_insert(hdl_hash_t p_table, unsigned long key, void *p_data)
{
void *p_tmp_data;
hash_node_t *p_node;
unsigned long hash_entry;
int rc = 0;
// if empty
if (!p_table->size) {
rc = hash_init(p_table, MINIMUM_HASH_TABLE_SIZE);
if (rc)
return rc;
}
// if data not valid
if (!p_data)
return -EINVAL;
// maybe already exists
p_tmp_data = hash_lookup(p_table, key);
if (p_tmp_data)
return -EEXIST;
#ifdef __VMKERNEL_HASH_EXPAND_ENABLE__
// maybe we need to expand
while (p_table->entries >= (p_table->size >> EXPAND_HASH_TABLE_LIMIT_ORDER)) {
if ((rc = hash_expand(p_table)) != 0)
return rc;
}
#endif /* __VMKERNEL_HASH_EXPAND_ENABLE__ */
// allocate memory for new entry
p_node = (hash_node_t *)kmalloc(sizeof(hash_node_t), GFP_KERNEL);
if (!p_node)
return -ENOMEM;
// insert the new entry
p_node->p_data = p_data;
p_node->key = key;
hash_entry = hash(p_table, key);
p_node->p_next = p_table->bucket[hash_entry];
p_table->bucket[hash_entry] = p_node;
++p_table->entries;
return 0;
}
/************/
void * hash_delete(hdl_hash_t p_table, unsigned long key)
{
hash_node_t *p_node, *p_prev_node;
void *p_data;
unsigned long hash_entry;
// if empty
if (!p_table->size) {
return NULL;
}
// find what to remove
hash_entry = hash(p_table, key);
for (p_node = p_table->bucket[hash_entry]; p_node;
p_node = p_node->p_next) {
if (key == p_node->key)
break;
}
if (!p_node)
return NULL; // nothing to remove
// remove the selected node
if (p_node == p_table->bucket[hash_entry]) {
p_table->bucket[hash_entry] = p_node->p_next;
goto free_node;
}
for (p_prev_node = p_table->bucket[hash_entry];
p_prev_node && p_prev_node->p_next;
p_prev_node = p_prev_node->p_next) {
if (p_prev_node->p_next == p_node)
break;
}
p_prev_node->p_next = p_node->p_next;
free_node:
p_data = p_node->p_data;
kfree(p_node);
/*
* TODO: maybe we will want to implement shrink of the hash
*/
// if empty
if (--p_table->entries == 0)
hash_destroy(p_table);
return p_data;
}

View file

@ -0,0 +1,60 @@
/*
* Copyright (c) 2011-2012 Mellanox Technologies. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the file
* COPYING in the main directory of this source tree, or the
* OpenIB.org BSD license below:
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* - Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer.
*
* - 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.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef _MLNX_HASH_H
#define _MLNX_HASH_H
/************************************************************************/
typedef struct hash_node hash_node_t;
struct hash_table {
hash_node_t **bucket; // the hash array
unsigned long size; // size of the array
unsigned long entries; // number of used entries in hash
unsigned long mask; // used to select bits for hashing
};
typedef struct hash_table * hdl_hash_t;
/************************************************************************/
void hash_print(hdl_hash_t p_table);
int hash_init(hdl_hash_t p_table, unsigned long table_size);
void hash_destroy(hdl_hash_t p_table);
void * hash_lookup(hdl_hash_t p_table, unsigned long key);
int hash_insert(hdl_hash_t p_table, unsigned long key, void *p_data);
void * hash_delete(hdl_hash_t p_table, unsigned long key);
#endif /* _MLNX_HASH_H */

View file

@ -0,0 +1,44 @@
/*
* Copyright (c) 2015 VMware, Inc.
*
* Copyright (c) 2011-2012 Mellanox Technologies. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the file
* COPYING in the main directory of this source tree, or the
* OpenIB.org BSD license below:
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* - Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer.
*
* - 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.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#include "xhci_compat.h"
/************************************************************************/
#include "hash.c"
/************************************************************************/

View file

@ -0,0 +1,400 @@
/*
* Copyright (c) 2011-2013 Mellanox Technologies. All rights reserved.
*
* This software is available to you under a choice of one of two
* licenses. You may choose to be licensed under the terms of the GNU
* General Public License (GPL) Version 2, available from the file
* COPYING in the main directory of this source tree, or the
* OpenIB.org BSD license below:
*
* Redistribution and use in source and binary forms, with or
* without modification, are permitted provided that the following
* conditions are met:
*
* - Redistributions of source code must retain the above
* copyright notice, this list of conditions and the following
* disclaimer.
*
* - 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.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
#ifndef _MLNX_COMPAT_H
#define _MLNX_COMPAT_H
#if !defined(__VMKLNX__) || !defined(__LINUX_XHCI_HCD_H)
#include <linux/gfp.h>
#include <linux/workqueue.h>
#include <linux/if_vlan.h>
#include <linux/ethtool.h>
#include <linux/pci.h>
#include <linux/bitmap.h>
#include <linux/rbtree.h>
#include <linux/fs.h>
/************************************************************************/
#endif /* !defined(__VMKLNX__) || !defined(__LINUX_XHCI_HCD_H) */
#include "hash.h"
#if !defined(__VMKLNX__) || !defined(__LINUX_XHCI_HCD_H)
/************************************************************************/
/*
#define __VMKERNEL_BF_ENABLE__
#define __VMKERNEL_SYSFS_SUPPORT__
#define __VMKERNEL_LARGE_DMA_SEG_ENABLE__
#define __VMKERNEL_MLNX_SENSNE_ENABLE__
#define __VMKERNEL_HASH_EXPAND_ENABLE__
#define __VMKERNEL_NETLINK_SUPPORT__
#define __VMKERNEL_IPOIB_PACKET_DEBUG__
#define __VMKERNEL_MLX4_EN_SUPPORT__
#define __VMKERNEL_ETHTOOL_RSS_NUM_RINGS_SUPPORT__
#define __VMKERNEL_ETHTOOL_SELF_TEST_SUPPORT__
#define __VMKERNEL_TX_INLINE_WQE_ENABLE__
#define __VMKERNEL_NETDEV_SELECT_QUEUE_SUPPORT__
#define __VMKERNEL_NETDEV_ADVANCE_FEATURES_SUPPORT__
#define __VMKERNEL_NETDEV_GRO_FEATURE_SUPPORT__
#define __VMKERNEL_NETDEV_OPS_SET_FEATURES_SUPPORT__
#define __VMKERNEL_NETDEV_OPS_VALIDATE_ADDR_SUPPORT__
#define __MLNX_VMKERNEL_40G_SPEED_SUPPORT__
*/
/*
#define __MEMTRACK__
#define IPOIB_SHOW_ARP_DBG
*/
#ifndef CONFIG_MLX4_DEBUG
#define CONFIG_MLX4_DEBUG
#endif
#define __VMKERNEL_MLX4_EN_TX_HASH__
#define __VMKERNEL_KOBJECT_FIX_BUG__
/*
* Pseudo device defines -
* In old DDKs NETIF_F_PSEUDO_REG not exists and
* we try to workaround this.
* In this case we also define __VMKERNEL_PSEUDO_OLD_API__
* so we will know we are using old DDK
*/
#ifndef NETIF_F_PSEUDO_REG
#define NETIF_F_PSEUDO_REG 0x10000000000
#define __VMKERNEL_PSEUDO_OLD_API__
#endif /* NETIF_F_PSEUDO_REG */
/*
* Netqueue RSS for VXLAN defines
* If vmkapi support RSS for VXLAN than we enable
* this feature in netqueue code
*/
#if (VMKAPI_REVISION >= VMK_REVISION_FROM_NUMBERS(2, 1, 0, 0))
#define __VMKERNEL_RSS_NETQ_SUPPORT__
#endif
#if (VMKAPI_REVISION >= VMK_REVISION_FROM_NUMBERS(2, 2, 0, 0))
#define __MLNX_VMKERNEL_40G_SPEED_SUPPORT__
#endif
/************************************************************************/
/* Prints */
#ifndef KERN_ERR
#define KERN_ERR ""
#endif
#ifndef KERN_WARNING
#define KERN_WARNING ""
#endif
#ifndef KERN_CONT
#define KERN_CONT ""
#endif
#define pr_err(fmt, ...) \
printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
#define pr_warning(fmt, ...) \
printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
#define pr_cont(fmt, ...) \
printk(KERN_CONT fmt, ##__VA_ARGS__)
#define printk_once(fmt, ...) \
({ \
static bool __print_once; \
\
if (!__print_once) { \
__print_once = true; \
printk(fmt, ##__VA_ARGS__); \
} \
})
#define pr_fmt(fmt) fmt
/************************************************************************/
/* Networking */
/* Netdev */
#define for_each_netdev_rcu(net, d) \
for ((d) = dev_base; (d); \
(d) = rcu_dereference(d)->next)
typedef int netdev_tx_t;
/* if_vlan.h */
#ifndef VLAN_N_VID
#define VLAN_N_VID 4096
#endif /* VLAN_N_VID */
/* if_ether.h */
#ifndef ETH_FCS_LEN
#define ETH_FCS_LEN 4
#endif /* NOT ETH_FCS_LEN */
/* skbuff.h */
static inline unsigned int skb_frag_size(const skb_frag_t *frag)
{
return frag->size;
}
static inline void skb_frag_size_set(skb_frag_t *frag, unsigned int size)
{
frag->size = size;
}
static inline void skb_frag_size_sub(skb_frag_t *frag, int delta)
{
frag->size -= delta;
}
static inline struct page *skb_frag_page(const skb_frag_t *frag)
{
#ifdef __VMKERNEL_MODULE__
return frag->page;
#else
return frag->page.p;
#endif /* __VMKERNEL_MODULE__ */
}
static inline void __skb_frag_set_page(skb_frag_t *frag, struct page *page)
{
#ifdef __VMKERNEL_MODULE__
frag->page = page;
#else
frag->page.p = page;
#endif /* __VMKERNEL_MODULE__ */
}
static inline void skb_frag_set_page(struct sk_buff *skb, int f,
struct page *page)
{
__skb_frag_set_page(&skb_shinfo(skb)->frags[f], page);
}
static inline dma_addr_t skb_frag_dma_map(struct device *dev,
const skb_frag_t *frag,
size_t offset, size_t size,
enum dma_data_direction dir)
{
return dma_map_page(dev, skb_frag_page(frag),
frag->page_offset + offset, size, dir);
}
static inline void __skb_frag_unref(skb_frag_t *frag)
{
put_page(skb_frag_page(frag));
}
static inline void skb_frag_unref(struct sk_buff *skb, int f)
{
__skb_frag_unref(&skb_shinfo(skb)->frags[f]);
}
static inline void skb_record_rx_queue(struct sk_buff *skb, u16 rx_queue)
{
vmknetddi_queueops_set_skb_queueid(skb,
VMKNETDDI_QUEUEOPS_MK_RX_QUEUEID(rx_queue));
}
/************************************************************************/
/* Some defines and types */
typedef unsigned long phys_addr_t;
#define num_possible_cpus() smp_num_cpus
#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
#define __ALIGN_MASK(x, mask) __ALIGN_KERNEL_MASK((x), (mask))
#define for_each_set_bit(bit, addr, size) \
for ((bit) = find_first_bit((addr), (size)); \
(bit) < (size); \
(bit) = find_next_bit((addr), (size), (bit) + 1))
#define __packed __attribute__((packed))
#define uninitialized_var(x) x = x
#define iowrite32(v, addr) writel((v), (addr))
#define iowrite32be(v, addr) iowrite32(be32_to_cpu(v), (addr))
/************************************************************************/
/* VLANs */
#define vlan_dev_vlan_id(netdev) (VLAN_DEV_INFO(netdev)->vlan_id)
#define vlan_dev_real_dev(netdev) (VLAN_DEV_INFO(netdev)->real_dev)
/************************************************************************/
/* DMA */
/* In vmkernel we don't support dma attributes */
struct dma_attrs;
#define dma_map_single_attrs(dev, cpu_addr, size, dir, attrs) \
dma_map_single(dev, cpu_addr, size, dir)
#define dma_unmap_single_attrs(dev, dma_addr, size, dir, attrs) \
dma_unmap_single(dev, dma_addr, size, dir)
#define dma_map_sg_attrs(dev, sgl, nents, dir, attrs) \
dma_map_sg(dev, sgl, nents, dir)
#define dma_unmap_sg_attrs(dev, sgl, nents, dir, attrs) \
dma_unmap_sg(dev, sgl, nents, dir)
/************************************************************************/
/* PCI */
static inline int pci_pcie_cap(struct pci_dev *pdev)
{
return pci_find_capability(pdev, PCI_CAP_ID_EXP);
}
/*
* DEFINE_PCI_DEVICE_TABLE - macro used to describe a pci device table
* @_table: device table name
*
* This macro is used to create a struct pci_device_id array (a device table)
* in a generic manner.
*/
#define DEFINE_PCI_DEVICE_TABLE(_table) \
const struct pci_device_id _table[]
/*
* PCI_VDEVICE - macro used to describe a specific pci device in short form
* @vendor: the vendor name
* @device: the 16 bit PCI Device ID
*
* This macro is used to create a struct pci_device_id that matches a
* specific PCI device. The subvendor, and subdevice fields will be set
* to PCI_ANY_ID. The macro allows the next field to follow as the device
* private data.
*/
#define PCI_VDEVICE(vendor, device) \
PCI_VENDOR_ID_##vendor, (device), \
PCI_ANY_ID, PCI_ANY_ID, 0, 0
/************************************************************************/
/* Bitmap */
#define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) % BITS_PER_LONG))
unsigned long bitmap_find_next_zero_area(unsigned long *map,
unsigned long size,
unsigned long start,
unsigned int nr,
unsigned long align_mask);
void bitmap_set(unsigned long *map, int start, int nr);
void bitmap_clear(unsigned long *map, int start, int nr);
/************************************************************************/
#endif /* !defined(__VMKLNX__) || !defined(__LINUX_XHCI_HCD_H) */
/* Radix tree */
#define radix_tree_root hash_table
#define radix_tree_lookup mlnx_radix_tree_lookup
#define radix_tree_insert mlnx_radix_tree_insert
#define radix_tree_delete mlnx_radix_tree_delete
#ifdef INIT_RADIX_TREE
#undef INIT_RADIX_TREE
#endif
#define INIT_RADIX_TREE(p_tree, flags) do { \
memset((p_tree), 0, sizeof(struct hash_table)); \
} while (0);
static inline void * mlnx_radix_tree_lookup(struct radix_tree_root *p_tree,
unsigned long index) {
return hash_lookup(p_tree, index);
}
static inline int mlnx_radix_tree_insert(struct radix_tree_root *p_tree,
unsigned long index,
void *p_data) {
return hash_insert(p_tree, index, p_data);
}
static inline void * mlnx_radix_tree_delete(struct radix_tree_root *p_tree,
unsigned long index) {
return hash_delete(p_tree, index);
}
#if !defined(__VMKLNX__) || !defined(__LINUX_XHCI_HCD_H)
/************************************************************************/
/* Ethtool */
int __ethtool_get_settings(struct net_device *dev, struct ethtool_cmd *p_cmd);
void ethtool_cmd_speed_set(struct ethtool_cmd *ep, __u32 speed);
__u32 ethtool_cmd_speed(const struct ethtool_cmd *ep);
/************************************************************************/
/* Hex dump */
int hex_to_bin(char ch);
/************************************************************************/
/* Pages */
unsigned long get_zeroed_page(gfp_t gfp_mask);
/************************************************************************/
/* Work Queues */
#define alloc_workqueue(name, flags, max_active) \
__create_workqueue((name), (max_active))
int __cancel_delayed_work(struct delayed_work *dwork);
static inline struct delayed_work *to_delayed_work(struct work_struct *work)
{
return container_of(work, struct delayed_work, work);
}
/************************************************************************/
/* Mem */
/*
* kmemdup - duplicate region of memory
*
* @src: memory region to duplicate
* @len: memory region length
* @gfp: GFP mask to use
*/
void *kmemdup(const void *src, size_t len, gfp_t gfp);
/************************************************************************/
/* File */
int nonseekable_open(struct inode *inode, struct file *filp);
#endif /* !defined(__VMKLNX__) || !defined(__LINUX_XHCI_HCD_H) */
#endif /* _MLNX_COMPAT_H */

View file

@ -1,6 +1,8 @@
/* /*
* xHCI host controller driver * xHCI host controller driver
* *
* Copyright (c) 2015 VMware, Inc.
*
* Copyright (C) 2008 Intel Corp. * Copyright (C) 2008 Intel Corp.
* *
* Author: Sarah Sharp * Author: Sarah Sharp
@ -461,8 +463,20 @@ struct xhci_ring *xhci_dma_to_transfer_ring(
u64 address) u64 address)
{ {
if (ep->ep_state & EP_HAS_STREAMS) if (ep->ep_state & EP_HAS_STREAMS)
#if defined(__VMKLNX__)
{
struct xhci_ring *ret_ring;
spin_lock_irq(&ep->stream_info->lock);
ret_ring = radix_tree_lookup(&ep->stream_info->trb_address_map,
address >> SEGMENT_SHIFT);
spin_unlock_irq(&ep->stream_info->lock);
return ret_ring;
}
#else
return radix_tree_lookup(&ep->stream_info->trb_address_map, return radix_tree_lookup(&ep->stream_info->trb_address_map,
address >> SEGMENT_SHIFT); address >> SEGMENT_SHIFT);
#endif /* __VMKLNX__ */
return ep->ring; return ep->ring;
} }
@ -472,8 +486,18 @@ static struct xhci_ring *dma_to_stream_ring(
struct xhci_stream_info *stream_info, struct xhci_stream_info *stream_info,
u64 address) u64 address)
{ {
#if defined(__VMKLNX__)
struct xhci_ring *ret_ring;
spin_lock_irq(&stream_info->lock);
ret_ring = radix_tree_lookup(&stream_info->trb_address_map,
address >> SEGMENT_SHIFT);
spin_unlock_irq(&stream_info->lock);
return ret_ring;
#else
return radix_tree_lookup(&stream_info->trb_address_map, return radix_tree_lookup(&stream_info->trb_address_map,
address >> SEGMENT_SHIFT); address >> SEGMENT_SHIFT);
#endif /* __VMKLNX__ */
} }
#endif /* CONFIG_USB_XHCI_HCD_DEBUGGING */ #endif /* CONFIG_USB_XHCI_HCD_DEBUGGING */
@ -503,6 +527,10 @@ static int xhci_test_radix_tree(struct xhci_hcd *xhci,
struct xhci_ring *cur_ring; struct xhci_ring *cur_ring;
u64 addr; u64 addr;
// XXX Grab lock here and hold until we return or call xhci_warn()
#if defined(__VMKLNX__)
spin_lock_irq(&stream_info->lock);
#endif /* __VMKLNX__ */
for (cur_stream = 1; cur_stream < num_streams; cur_stream++) { for (cur_stream = 1; cur_stream < num_streams; cur_stream++) {
struct xhci_ring *mapped_ring; struct xhci_ring *mapped_ring;
int trb_size = sizeof(union xhci_trb); int trb_size = sizeof(union xhci_trb);
@ -513,6 +541,9 @@ static int xhci_test_radix_tree(struct xhci_hcd *xhci,
addr += trb_size) { addr += trb_size) {
mapped_ring = dma_to_stream_ring(stream_info, addr); mapped_ring = dma_to_stream_ring(stream_info, addr);
if (cur_ring != mapped_ring) { if (cur_ring != mapped_ring) {
#if defined(__VMKLNX__)
spin_unlock_irq(&stream_info->lock);
#endif /* __VMKLNX__ */
xhci_warn(xhci, "WARN: DMA address 0x%08llx " xhci_warn(xhci, "WARN: DMA address 0x%08llx "
"didn't map to stream ID %u; " "didn't map to stream ID %u; "
"mapped to ring %p\n", "mapped to ring %p\n",
@ -533,6 +564,9 @@ static int xhci_test_radix_tree(struct xhci_hcd *xhci,
mapped_ring = dma_to_stream_ring(stream_info, addr); mapped_ring = dma_to_stream_ring(stream_info, addr);
} }
if (mapped_ring == cur_ring) { if (mapped_ring == cur_ring) {
#if defined(__VMKLNX__)
spin_unlock_irq(&stream_info->lock);
#endif /* __VMKLNX__ */
xhci_warn(xhci, "WARN: Bad DMA address 0x%08llx " xhci_warn(xhci, "WARN: Bad DMA address 0x%08llx "
"mapped to valid stream ID %u; " "mapped to valid stream ID %u; "
"mapped ring = %p\n", "mapped ring = %p\n",
@ -542,6 +576,9 @@ static int xhci_test_radix_tree(struct xhci_hcd *xhci,
return -EINVAL; return -EINVAL;
} }
} }
#if defined(__VMKLNX__)
spin_unlock_irq(&stream_info->lock);
#endif /* __VMKLNX__ */
return 0; return 0;
} }
#endif /* CONFIG_USB_XHCI_HCD_DEBUGGING */ #endif /* CONFIG_USB_XHCI_HCD_DEBUGGING */
@ -634,6 +671,9 @@ struct xhci_stream_info *xhci_alloc_stream_info(struct xhci_hcd *xhci,
if (!stream_info->free_streams_command) if (!stream_info->free_streams_command)
goto cleanup_ctx; goto cleanup_ctx;
#if defined(__VMKLNX__)
spin_lock_init(&stream_info->lock);
#endif /* __VMKLNX__ */
INIT_RADIX_TREE(&stream_info->trb_address_map, GFP_ATOMIC); INIT_RADIX_TREE(&stream_info->trb_address_map, GFP_ATOMIC);
/* Allocate rings for all the streams that the driver will use, /* Allocate rings for all the streams that the driver will use,
@ -658,8 +698,14 @@ struct xhci_stream_info *xhci_alloc_stream_info(struct xhci_hcd *xhci,
key = (unsigned long) key = (unsigned long)
(cur_ring->first_seg->dma >> SEGMENT_SHIFT); (cur_ring->first_seg->dma >> SEGMENT_SHIFT);
#if defined(__VMKLNX__)
spin_lock_irq(&stream_info->lock);
#endif /* __VMKLNX__ */
ret = radix_tree_insert(&stream_info->trb_address_map, ret = radix_tree_insert(&stream_info->trb_address_map,
key, cur_ring); key, cur_ring);
#if defined(__VMKLNX__)
spin_unlock_irq(&stream_info->lock);
#endif /* __VMKLNX__ */
if (ret) { if (ret) {
xhci_ring_free(xhci, cur_ring); xhci_ring_free(xhci, cur_ring);
stream_info->stream_rings[cur_stream] = NULL; stream_info->stream_rings[cur_stream] = NULL;
@ -687,8 +733,14 @@ cleanup_rings:
cur_ring = stream_info->stream_rings[cur_stream]; cur_ring = stream_info->stream_rings[cur_stream];
if (cur_ring) { if (cur_ring) {
addr = cur_ring->first_seg->dma; addr = cur_ring->first_seg->dma;
#if defined(__VMKLNX__)
spin_lock_irq(&stream_info->lock);
#endif /* __VMKLNX__ */
radix_tree_delete(&stream_info->trb_address_map, radix_tree_delete(&stream_info->trb_address_map,
addr >> SEGMENT_SHIFT); addr >> SEGMENT_SHIFT);
#if defined(__VMKLNX__)
spin_unlock_irq(&stream_info->lock);
#endif /* __VMKLNX__ */
xhci_ring_free(xhci, cur_ring); xhci_ring_free(xhci, cur_ring);
stream_info->stream_rings[cur_stream] = NULL; stream_info->stream_rings[cur_stream] = NULL;
} }
@ -758,8 +810,14 @@ void xhci_free_stream_info(struct xhci_hcd *xhci,
cur_ring = stream_info->stream_rings[cur_stream]; cur_ring = stream_info->stream_rings[cur_stream];
if (cur_ring) { if (cur_ring) {
addr = cur_ring->first_seg->dma; addr = cur_ring->first_seg->dma;
#if defined(__VMKLNX__)
spin_lock_irq(&stream_info->lock);
#endif /* __VMKLNX__ */
radix_tree_delete(&stream_info->trb_address_map, radix_tree_delete(&stream_info->trb_address_map,
addr >> SEGMENT_SHIFT); addr >> SEGMENT_SHIFT);
#if defined(__VMKLNX__)
spin_unlock_irq(&stream_info->lock);
#endif /* __VMKLNX__ */
xhci_ring_free(xhci, cur_ring); xhci_ring_free(xhci, cur_ring);
stream_info->stream_rings[cur_stream] = NULL; stream_info->stream_rings[cur_stream] = NULL;
} }
@ -800,7 +858,7 @@ static void xhci_free_tt_info(struct xhci_hcd *xhci,
struct xhci_tt_bw_info *tt_info = NULL; struct xhci_tt_bw_info *tt_info = NULL;
#else #else
struct xhci_tt_bw_info *tt_info; struct xhci_tt_bw_info *tt_info;
#endif #endif /* __VMKLNX__ */
/* If the device never made it past the Set Address stage, /* If the device never made it past the Set Address stage,
* it may not have the real_port set correctly. * it may not have the real_port set correctly.
@ -1357,7 +1415,7 @@ static u32 xhci_get_endpoint_type(struct usb_device *udev,
u32 type = 0; /* quiet down the compiler */ u32 type = 0; /* quiet down the compiler */
#else #else
u32 type; u32 type;
#endif #endif /* __VMKLNX__ */
in = usb_endpoint_dir_in(&ep->desc); in = usb_endpoint_dir_in(&ep->desc);
if (usb_endpoint_xfer_control(&ep->desc)) { if (usb_endpoint_xfer_control(&ep->desc)) {
@ -2267,10 +2325,6 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
u32 page_size, temp; u32 page_size, temp;
int i; int i;
#if defined(__VMKLNX__)
radix_tree_init();
#endif
page_size = xhci_readl(xhci, &xhci->op_regs->page_size); page_size = xhci_readl(xhci, &xhci->op_regs->page_size);
xhci_dbg(xhci, "Supported page size register = 0x%x\n", page_size); xhci_dbg(xhci, "Supported page size register = 0x%x\n", page_size);
for (i = 0; i < 16; i++) { for (i = 0; i < 16; i++) {

View file

@ -1,6 +1,8 @@
/* /*
* xHCI host controller driver * xHCI host controller driver
* *
* Copyright (c) 2015 VMware, Inc.
*
* Copyright (C) 2008 Intel Corp. * Copyright (C) 2008 Intel Corp.
* *
* Author: Sarah Sharp * Author: Sarah Sharp
@ -32,6 +34,10 @@
#include "xhci-ext-caps.h" #include "xhci-ext-caps.h"
#include "pci-quirks.h" #include "pci-quirks.h"
#if defined(__VMKLNX__)
#include "compat/xhci_compat.h"
#endif /* __VMKLNX__ */
/* xHCI PCI Configuration Registers */ /* xHCI PCI Configuration Registers */
#define XHCI_SBRN_OFFSET (0x60) #define XHCI_SBRN_OFFSET (0x60)
@ -746,6 +752,9 @@ struct xhci_stream_info {
/* For mapping physical TRB addresses to segments in stream rings */ /* For mapping physical TRB addresses to segments in stream rings */
struct radix_tree_root trb_address_map; struct radix_tree_root trb_address_map;
struct xhci_command *free_streams_command; struct xhci_command *free_streams_command;
#if defined(__VMKLNX__)
spinlock_t lock;
#endif /* __VMKLNX__ */
}; };
#define SMALL_STREAM_ARRAY_SIZE 256 #define SMALL_STREAM_ARRAY_SIZE 256

View file

@ -279,7 +279,9 @@ extern int dir_notify_enable;
#include <linux/cache.h> #include <linux/cache.h>
#include <linux/kobject.h> #include <linux/kobject.h>
#include <linux/list.h> #include <linux/list.h>
#if !defined(__VMKLNX__)
#include <linux/radix-tree.h> #include <linux/radix-tree.h>
#endif /* defined(__VMKLNX__) */
#include <linux/prio_tree.h> #include <linux/prio_tree.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/sched.h> #include <linux/sched.h>
@ -435,7 +437,9 @@ struct address_space_operations {
struct backing_dev_info; struct backing_dev_info;
struct address_space { struct address_space {
struct inode *host; /* owner: inode, block_device */ struct inode *host; /* owner: inode, block_device */
#if !defined(__VMKLNX__)
struct radix_tree_root page_tree; /* radix tree of all pages */ struct radix_tree_root page_tree; /* radix tree of all pages */
#endif /* defined(__VMKLNX__) */
rwlock_t tree_lock; /* and rwlock protecting it */ rwlock_t tree_lock; /* and rwlock protecting it */
unsigned int i_mmap_writable;/* count VM_SHARED mappings */ unsigned int i_mmap_writable;/* count VM_SHARED mappings */
struct prio_tree_root i_mmap; /* tree of private and shared mappings */ struct prio_tree_root i_mmap; /* tree of private and shared mappings */

View file

@ -1,267 +0,0 @@
/*
* Copyright (C) 2001 Momchil Velikov
* Portions Copyright (C) 2001 Christoph Hellwig
* Copyright (C) 2006 Nick Piggin
*
* 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, 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., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#ifndef _LINUX_RADIX_TREE_H
#define _LINUX_RADIX_TREE_H
#include <linux/preempt.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/rcupdate.h>
/*
* An indirect pointer (root->rnode pointing to a radix_tree_node, rather
* than a data item) is signalled by the low bit set in the root->rnode
* pointer.
*
* In this case root->height is > 0, but the indirect pointer tests are
* needed for RCU lookups (because root->height is unreliable). The only
* time callers need worry about this is when doing a lookup_slot under
* RCU.
*
* Indirect pointer in fact is also used to tag the last pointer of a node
* when it is shrunk, before we rcu free the node. See shrink code for
* details.
*/
#define RADIX_TREE_INDIRECT_PTR 1
/*
* A common use of the radix tree is to store pointers to struct pages;
* but shmem/tmpfs needs also to store swap entries in the same tree:
* those are marked as exceptional entries to distinguish them.
* EXCEPTIONAL_ENTRY tests the bit, EXCEPTIONAL_SHIFT shifts content past it.
*/
#define RADIX_TREE_EXCEPTIONAL_ENTRY 2
#define RADIX_TREE_EXCEPTIONAL_SHIFT 2
static inline int radix_tree_is_indirect_ptr(void *ptr)
{
return (int)((unsigned long)ptr & RADIX_TREE_INDIRECT_PTR);
}
/*** radix-tree API starts here ***/
#define RADIX_TREE_MAX_TAGS 3
/* root tags are stored in gfp_mask, shifted by __GFP_BITS_SHIFT */
struct radix_tree_root {
unsigned int height;
gfp_t gfp_mask;
struct radix_tree_node __rcu *rnode;
};
#define RADIX_TREE_INIT(mask) { \
.height = 0, \
.gfp_mask = (mask), \
.rnode = NULL, \
}
#define RADIX_TREE(name, mask) \
struct radix_tree_root name = RADIX_TREE_INIT(mask)
#define INIT_RADIX_TREE(root, mask) \
do { \
(root)->height = 0; \
(root)->gfp_mask = (mask); \
(root)->rnode = NULL; \
} while (0)
/**
* Radix-tree synchronization
*
* The radix-tree API requires that users provide all synchronisation (with
* specific exceptions, noted below).
*
* Synchronization of access to the data items being stored in the tree, and
* management of their lifetimes must be completely managed by API users.
*
* For API usage, in general,
* - any function _modifying_ the tree or tags (inserting or deleting
* items, setting or clearing tags) must exclude other modifications, and
* exclude any functions reading the tree.
* - any function _reading_ the tree or tags (looking up items or tags,
* gang lookups) must exclude modifications to the tree, but may occur
* concurrently with other readers.
*
* The notable exceptions to this rule are the following functions:
* radix_tree_lookup
* radix_tree_lookup_slot
* radix_tree_tag_get
* radix_tree_gang_lookup
* radix_tree_gang_lookup_slot
* radix_tree_gang_lookup_tag
* radix_tree_gang_lookup_tag_slot
* radix_tree_tagged
*
* The first 7 functions are able to be called locklessly, using RCU. The
* caller must ensure calls to these functions are made within rcu_read_lock()
* regions. Other readers (lock-free or otherwise) and modifications may be
* running concurrently.
*
* It is still required that the caller manage the synchronization and lifetimes
* of the items. So if RCU lock-free lookups are used, typically this would mean
* that the items have their own locks, or are amenable to lock-free access; and
* that the items are freed by RCU (or only freed after having been deleted from
* the radix tree *and* a synchronize_rcu() grace period).
*
* (Note, rcu_assign_pointer and rcu_dereference are not needed to control
* access to data items when inserting into or looking up from the radix tree)
*
* Note that the value returned by radix_tree_tag_get() may not be relied upon
* if only the RCU read lock is held. Functions to set/clear tags and to
* delete nodes running concurrently with it may affect its result such that
* two consecutive reads in the same locked section may return different
* values. If reliability is required, modification functions must also be
* excluded from concurrency.
*
* radix_tree_tagged is able to be called without locking or RCU.
*/
/**
* radix_tree_deref_slot - dereference a slot
* @pslot: pointer to slot, returned by radix_tree_lookup_slot
* Returns: item that was stored in that slot with any direct pointer flag
* removed.
*
* For use with radix_tree_lookup_slot(). Caller must hold tree at least read
* locked across slot lookup and dereference. Not required if write lock is
* held (ie. items cannot be concurrently inserted).
*
* radix_tree_deref_retry must be used to confirm validity of the pointer if
* only the read lock is held.
*/
static inline void *radix_tree_deref_slot(void **pslot)
{
return rcu_dereference(*pslot);
}
/**
* radix_tree_deref_slot_protected - dereference a slot without RCU lock but with tree lock held
* @pslot: pointer to slot, returned by radix_tree_lookup_slot
* Returns: item that was stored in that slot with any direct pointer flag
* removed.
*
* Similar to radix_tree_deref_slot but only used during migration when a pages
* mapping is being moved. The caller does not hold the RCU read lock but it
* must hold the tree lock to prevent parallel updates.
*/
static inline void *radix_tree_deref_slot_protected(void **pslot,
spinlock_t *treelock)
{
return rcu_dereference_protected(*pslot, lockdep_is_held(treelock));
}
/**
* radix_tree_deref_retry - check radix_tree_deref_slot
* @arg: pointer returned by radix_tree_deref_slot
* Returns: 0 if retry is not required, otherwise retry is required
*
* radix_tree_deref_retry must be used with radix_tree_deref_slot.
*/
static inline int radix_tree_deref_retry(void *arg)
{
return unlikely((unsigned long)arg & RADIX_TREE_INDIRECT_PTR);
}
/**
* radix_tree_exceptional_entry - radix_tree_deref_slot gave exceptional entry?
* @arg: value returned by radix_tree_deref_slot
* Returns: 0 if well-aligned pointer, non-0 if exceptional entry.
*/
static inline int radix_tree_exceptional_entry(void *arg)
{
/* Not unlikely because radix_tree_exception often tested first */
return (unsigned long)arg & RADIX_TREE_EXCEPTIONAL_ENTRY;
}
/**
* radix_tree_exception - radix_tree_deref_slot returned either exception?
* @arg: value returned by radix_tree_deref_slot
* Returns: 0 if well-aligned pointer, non-0 if either kind of exception.
*/
static inline int radix_tree_exception(void *arg)
{
return unlikely((unsigned long)arg &
(RADIX_TREE_INDIRECT_PTR | RADIX_TREE_EXCEPTIONAL_ENTRY));
}
/**
* radix_tree_replace_slot - replace item in a slot
* @pslot: pointer to slot, returned by radix_tree_lookup_slot
* @item: new item to store in the slot.
*
* For use with radix_tree_lookup_slot(). Caller must hold tree write locked
* across slot lookup and replacement.
*/
static inline void radix_tree_replace_slot(void **pslot, void *item)
{
BUG_ON(radix_tree_is_indirect_ptr(item));
rcu_assign_pointer(*pslot, item);
}
int radix_tree_insert(struct radix_tree_root *, unsigned long, void *);
void *radix_tree_lookup(struct radix_tree_root *, unsigned long);
void **radix_tree_lookup_slot(struct radix_tree_root *, unsigned long);
void *radix_tree_delete(struct radix_tree_root *, unsigned long);
unsigned int
radix_tree_gang_lookup(struct radix_tree_root *root, void **results,
unsigned long first_index, unsigned int max_items);
unsigned int radix_tree_gang_lookup_slot(struct radix_tree_root *root,
void ***results, unsigned long *indices,
unsigned long first_index, unsigned int max_items);
unsigned long radix_tree_next_hole(struct radix_tree_root *root,
unsigned long index, unsigned long max_scan);
unsigned long radix_tree_prev_hole(struct radix_tree_root *root,
unsigned long index, unsigned long max_scan);
#if !defined(__VMKLNX__)
int radix_tree_preload(gfp_t gfp_mask);
#endif
void radix_tree_init(void);
void *radix_tree_tag_set(struct radix_tree_root *root,
unsigned long index, unsigned int tag);
void *radix_tree_tag_clear(struct radix_tree_root *root,
unsigned long index, unsigned int tag);
int radix_tree_tag_get(struct radix_tree_root *root,
unsigned long index, unsigned int tag);
unsigned int
radix_tree_gang_lookup_tag(struct radix_tree_root *root, void **results,
unsigned long first_index, unsigned int max_items,
unsigned int tag);
unsigned int
radix_tree_gang_lookup_tag_slot(struct radix_tree_root *root, void ***results,
unsigned long first_index, unsigned int max_items,
unsigned int tag);
unsigned long radix_tree_range_tag_if_tagged(struct radix_tree_root *root,
unsigned long *first_indexp, unsigned long last_index,
unsigned long nr_to_tag,
unsigned int fromtag, unsigned int totag);
int radix_tree_tagged(struct radix_tree_root *root, unsigned int tag);
unsigned long radix_tree_locate_item(struct radix_tree_root *root, void *item);
#if !defined(__VMKLNX__)
static inline void radix_tree_preload_end(void)
{
preempt_enable();
}
#endif
#if defined(__VMKLNX__)
void radix_tree_init_maxindex(void);
#endif
#endif /* _LINUX_RADIX_TREE_H */

File diff suppressed because it is too large Load diff

View file

@ -870,10 +870,41 @@ LinuxPCI_EnableMSIX(struct pci_dev* dev, struct msix_entry *entries,
return status; return status;
} }
for (i = 0; i < *nvecs_alloced; i++) {
irq = LinuxIRQ_AllocIRQ(pciDevExt, intrArray[i + prev_vecs]);
if (likely(irq && irq < NR_IRQS)) {
vectors[i + prev_vecs] = irq;
} else {
*nvecs_alloced = i;
/* /*
* The function will execute successfully now. Go ahead and update * Free previously allocated IRQs.
* intrVectors and numIntrVectors in pciDevExt.
*/ */
for (i--; i >= 0; i--) {
LinuxIRQ_FreeIRQ(pciDevExt, vectors[prev_vecs + i]);
}
status = vmk_PCIFreeIntrCookie(vmklinuxModID, pciDevExt->vmkDev);
if (status == VMK_OK) {
/*
* Restore the legacy default PCI interrupt vector.
*/
LinuxPCILegacyIntrVectorSet(pciDevExt);
}
vmk_HeapFree(VMK_MODULE_HEAP_ID, intrArray);
vmk_HeapFree(VMK_MODULE_HEAP_ID, vectors);
return VMK_NO_RESOURCES;
}
}
/* Good to go, fill previously allocated vectors, update entries[],
* and free pciDevExt->intrVectors, pciDevExt->intrArray
* if necessary (prev_vecs > 0) */
for (i = 0; i < *nvecs_alloced; i++) {
entries[i].vector = vectors[i + prev_vecs];
}
if (prev_vecs > 0) { if (prev_vecs > 0) {
for (i = 0; i < prev_vecs; i++) { for (i = 0; i < prev_vecs; i++) {
vectors[i] = pciDevExt->intrVectors[i]; vectors[i] = pciDevExt->intrVectors[i];
@ -883,13 +914,6 @@ LinuxPCI_EnableMSIX(struct pci_dev* dev, struct msix_entry *entries,
vmk_HeapFree(VMK_MODULE_HEAP_ID, pciDevExt->intrArray); vmk_HeapFree(VMK_MODULE_HEAP_ID, pciDevExt->intrArray);
} }
for (i = 0; i < *nvecs_alloced; i++) {
irq = LinuxIRQ_AllocIRQ(pciDevExt, intrArray[i + prev_vecs]);
VMK_ASSERT(irq && irq < NR_IRQS);
vectors[i + prev_vecs] = irq;
entries[i].vector = irq;
}
pciDevExt->intrArray = intrArray; pciDevExt->intrArray = intrArray;
pciDevExt->intrVectors = vectors; pciDevExt->intrVectors = vectors;

View file

@ -635,6 +635,50 @@ SCSILinuxGetModuleID(struct Scsi_Host *sh, struct pci_dev *pdev)
return(moduleID); return(moduleID);
} }
/*
*-----------------------------------------------------------------------------
*
* SCSILinuxATASenseDescriptorToFixed --
*
* Convert ATA status return encapsulated in descriptor format sense
* data to fixed format. See sec 12.2.2.6 in sat3r05b.pdf
*
* Results:
* returns VMK_TRUE if buffer is modified.
*
* Side effects:
*
*-----------------------------------------------------------------------------
*/
static vmk_Bool
SCSILinuxATASenseDescriptorToFixed(unsigned char *buffer)
{
if (buffer[0] == 0x72) {
vmk_ScsiSenseDataSimple *senseData = (vmk_ScsiSenseDataSimple *)buffer;
if (senseData->format.descriptor.key == VMK_SCSI_SENSE_KEY_RECOVERED_ERROR &&
senseData->format.descriptor.asc == VMK_SCSI_ASC_ATA_PASSTHROUGH_INFO_AVAILABLE &&
senseData->format.descriptor.ascq == VMK_SCSI_ASCQ_ATA_PASSTHROUGH_INFO_AVAILABLE &&
senseData->format.descriptor.optLen == 0xe &&
senseData->format.descriptor.additional[0] == VMK_SCSI_SENSE_DESCRIPTOR_TYPE_ATA_STATUS_RETURN) {
vmk_ScsiSenseData fixed = {0};
fixed.error = VMK_SCSI_SENSE_ERROR_CURCMD;
fixed.key = VMK_SCSI_SENSE_KEY_NONE;
fixed.asc = senseData->format.descriptor.asc;
fixed.ascq = senseData->format.descriptor.ascq;
fixed.optLen = 24;
vmk_Memcpy(&fixed.additional[0],
&senseData->format.descriptor.additional[0],
senseData->format.descriptor.optLen);
vmk_Memcpy(buffer, &fixed, sizeof(fixed));
return VMK_TRUE;
}
}
return VMK_FALSE;
}
/* /*
*----------------------------------------------------------------------------- *-----------------------------------------------------------------------------
@ -814,6 +858,7 @@ SCSILinuxProcessCompletions(scsiLinuxTLS_t *tls, // IN
} }
VMK_ASSERT(deviceStatus != VMK_SCSI_DEVICE_CHECK_CONDITION || VMK_ASSERT(deviceStatus != VMK_SCSI_DEVICE_CHECK_CONDITION ||
scmd->sense_buffer[0] != 0); scmd->sense_buffer[0] != 0);
SCSILinuxATASenseDescriptorToFixed(scmd->sense_buffer);
size = vmk_ScsiGetSupportedCmdSenseDataSize(); size = vmk_ScsiGetSupportedCmdSenseDataSize();
/* Use the additional sense length field for sense data length */ /* Use the additional sense length field for sense data length */
size = min(size, (vmk_ByteCount)(scmd->sense_buffer[7] + 8)); size = min(size, (vmk_ByteCount)(scmd->sense_buffer[7] + 8));

View file

@ -1,5 +1,5 @@
/* **************************************************************** /* ****************************************************************
* Copyright 2010-2013 VMware, Inc. * Copyright 2010-2015 VMware, Inc.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -477,10 +477,6 @@ VMK_MODULE_EXPORT_ALIAS(put_disk);
VMK_MODULE_EXPORT_ALIAS(put_driver); VMK_MODULE_EXPORT_ALIAS(put_driver);
VMK_MODULE_EXPORT_ALIAS(queue_delayed_work); VMK_MODULE_EXPORT_ALIAS(queue_delayed_work);
VMK_MODULE_EXPORT_ALIAS(queue_work); VMK_MODULE_EXPORT_ALIAS(queue_work);
VMK_MODULE_EXPORT_ALIAS(radix_tree_delete);
VMK_MODULE_EXPORT_ALIAS(radix_tree_init);
VMK_MODULE_EXPORT_ALIAS(radix_tree_insert);
VMK_MODULE_EXPORT_ALIAS(radix_tree_lookup);
VMK_MODULE_EXPORT_ALIAS(raw_smp_processor_id); VMK_MODULE_EXPORT_ALIAS(raw_smp_processor_id);
VMK_MODULE_EXPORT_ALIAS(__read_lock_failed); VMK_MODULE_EXPORT_ALIAS(__read_lock_failed);
VMK_MODULE_EXPORT_ALIAS(register_chrdev); VMK_MODULE_EXPORT_ALIAS(register_chrdev);

View file

@ -1,5 +1,5 @@
/* **************************************************************** /* ****************************************************************
* Copyright 2013 VMware, Inc. * Copyright 2013-2015 VMware, Inc.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
@ -481,10 +481,6 @@ VMK_MODULE_EXPORT_ALIAS(put_disk);
VMK_MODULE_EXPORT_ALIAS(put_driver); VMK_MODULE_EXPORT_ALIAS(put_driver);
VMK_MODULE_EXPORT_ALIAS(queue_delayed_work); VMK_MODULE_EXPORT_ALIAS(queue_delayed_work);
VMK_MODULE_EXPORT_ALIAS(queue_work); VMK_MODULE_EXPORT_ALIAS(queue_work);
VMK_MODULE_EXPORT_ALIAS(radix_tree_delete);
VMK_MODULE_EXPORT_ALIAS(radix_tree_init);
VMK_MODULE_EXPORT_ALIAS(radix_tree_insert);
VMK_MODULE_EXPORT_ALIAS(radix_tree_lookup);
VMK_MODULE_EXPORT_ALIAS(raw_smp_processor_id); VMK_MODULE_EXPORT_ALIAS(raw_smp_processor_id);
VMK_MODULE_EXPORT_ALIAS(__read_lock_failed); VMK_MODULE_EXPORT_ALIAS(__read_lock_failed);
VMK_MODULE_EXPORT_ALIAS(register_chrdev); VMK_MODULE_EXPORT_ALIAS(register_chrdev);