Commit b980ac18 authored by Jeff Kirsher's avatar Jeff Kirsher

igb: Fix code comments and whitespace

Aligns the multi-line code comments with the desired style for the
networking tree.  Also cleaned up whitespace issues found during the
cleanup of code comments (i.e. remove unnecessary blank lines,
use tabs where possible, properly wrap lines and keep strings on a
single line)
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
Tested-by: default avatarAaron Brown <aaron.f.brown@intel.com>
parent c8268921
...@@ -138,8 +138,7 @@ ...@@ -138,8 +138,7 @@
#define E1000_RCTL_PMCF 0x00800000 /* pass MAC control frames */ #define E1000_RCTL_PMCF 0x00800000 /* pass MAC control frames */
#define E1000_RCTL_SECRC 0x04000000 /* Strip Ethernet CRC */ #define E1000_RCTL_SECRC 0x04000000 /* Strip Ethernet CRC */
/* /* Use byte values for the following shift parameters
* Use byte values for the following shift parameters
* Usage: * Usage:
* psrctl |= (((ROUNDUP(value0, 128) >> E1000_PSRCTL_BSIZE0_SHIFT) & * psrctl |= (((ROUNDUP(value0, 128) >> E1000_PSRCTL_BSIZE0_SHIFT) &
* E1000_PSRCTL_BSIZE0_MASK) | * E1000_PSRCTL_BSIZE0_MASK) |
...@@ -382,8 +381,7 @@ ...@@ -382,8 +381,7 @@
#define E1000_EICR_OTHER 0x80000000 /* Interrupt Cause Active */ #define E1000_EICR_OTHER 0x80000000 /* Interrupt Cause Active */
/* TCP Timer */ /* TCP Timer */
/* /* This defines the bits that are set in the Interrupt Mask
* This defines the bits that are set in the Interrupt Mask
* Set/Read Register. Each bit is documented below: * Set/Read Register. Each bit is documented below:
* o RXT0 = Receiver Timer Interrupt (ring 0) * o RXT0 = Receiver Timer Interrupt (ring 0)
* o TXDW = Transmit Descriptor Written Back * o TXDW = Transmit Descriptor Written Back
...@@ -440,8 +438,7 @@ ...@@ -440,8 +438,7 @@
#define E1000_VLAN_FILTER_TBL_SIZE 128 /* VLAN Filter Table (4096 bits) */ #define E1000_VLAN_FILTER_TBL_SIZE 128 /* VLAN Filter Table (4096 bits) */
/* Receive Address */ /* Receive Address */
/* /* Number of high/low register pairs in the RAR. The RAR (Receive Address
* Number of high/low register pairs in the RAR. The RAR (Receive Address
* Registers) holds the directed and multicast addresses that we monitor. * Registers) holds the directed and multicast addresses that we monitor.
* Technically, we have 16 spots. However, we reserve one of these spots * Technically, we have 16 spots. However, we reserve one of these spots
* (RAR[15]) for our directed address used by controllers with * (RAR[15]) for our directed address used by controllers with
...@@ -760,8 +757,7 @@ ...@@ -760,8 +757,7 @@
#define MAX_PHY_MULTI_PAGE_REG 0xF #define MAX_PHY_MULTI_PAGE_REG 0xF
/* Bit definitions for valid PHY IDs. */ /* Bit definitions for valid PHY IDs. */
/* /* I = Integrated
* I = Integrated
* E = External * E = External
*/ */
#define M88E1111_I_PHY_ID 0x01410CC0 #define M88E1111_I_PHY_ID 0x01410CC0
...@@ -791,8 +787,7 @@ ...@@ -791,8 +787,7 @@
#define M88E1000_PSCR_AUTO_X_1000T 0x0040 #define M88E1000_PSCR_AUTO_X_1000T 0x0040
/* Auto crossover enabled all speeds */ /* Auto crossover enabled all speeds */
#define M88E1000_PSCR_AUTO_X_MODE 0x0060 #define M88E1000_PSCR_AUTO_X_MODE 0x0060
/* /* 1=Enable Extended 10BASE-T distance (Lower 10BASE-T Rx Threshold
* 1=Enable Extended 10BASE-T distance (Lower 10BASE-T Rx Threshold
* 0=Normal 10BASE-T Rx Threshold * 0=Normal 10BASE-T Rx Threshold
*/ */
/* 1=5-bit interface in 100BASE-TX, 0=MII interface in 100BASE-TX */ /* 1=5-bit interface in 100BASE-TX, 0=MII interface in 100BASE-TX */
...@@ -802,8 +797,7 @@ ...@@ -802,8 +797,7 @@
#define M88E1000_PSSR_REV_POLARITY 0x0002 /* 1=Polarity reversed */ #define M88E1000_PSSR_REV_POLARITY 0x0002 /* 1=Polarity reversed */
#define M88E1000_PSSR_DOWNSHIFT 0x0020 /* 1=Downshifted */ #define M88E1000_PSSR_DOWNSHIFT 0x0020 /* 1=Downshifted */
#define M88E1000_PSSR_MDIX 0x0040 /* 1=MDIX; 0=MDI */ #define M88E1000_PSSR_MDIX 0x0040 /* 1=MDIX; 0=MDI */
/* /* 0 = <50M
* 0 = <50M
* 1 = 50-80M * 1 = 50-80M
* 2 = 80-110M * 2 = 80-110M
* 3 = 110-140M * 3 = 110-140M
...@@ -816,20 +810,17 @@ ...@@ -816,20 +810,17 @@
#define M88E1000_PSSR_CABLE_LENGTH_SHIFT 7 #define M88E1000_PSSR_CABLE_LENGTH_SHIFT 7
/* M88E1000 Extended PHY Specific Control Register */ /* M88E1000 Extended PHY Specific Control Register */
/* /* 1 = Lost lock detect enabled.
* 1 = Lost lock detect enabled.
* Will assert lost lock and bring * Will assert lost lock and bring
* link down if idle not seen * link down if idle not seen
* within 1ms in 1000BASE-T * within 1ms in 1000BASE-T
*/ */
/* /* Number of times we will attempt to autonegotiate before downshifting if we
* Number of times we will attempt to autonegotiate before downshifting if we
* are the master * are the master
*/ */
#define M88E1000_EPSCR_MASTER_DOWNSHIFT_MASK 0x0C00 #define M88E1000_EPSCR_MASTER_DOWNSHIFT_MASK 0x0C00
#define M88E1000_EPSCR_MASTER_DOWNSHIFT_1X 0x0000 #define M88E1000_EPSCR_MASTER_DOWNSHIFT_1X 0x0000
/* /* Number of times we will attempt to autonegotiate before downshifting if we
* Number of times we will attempt to autonegotiate before downshifting if we
* are the slave * are the slave
*/ */
#define M88E1000_EPSCR_SLAVE_DOWNSHIFT_MASK 0x0300 #define M88E1000_EPSCR_SLAVE_DOWNSHIFT_MASK 0x0300
...@@ -844,8 +835,7 @@ ...@@ -844,8 +835,7 @@
/* i347-AT4 Extended PHY Specific Control Register */ /* i347-AT4 Extended PHY Specific Control Register */
/* /* Number of times we will attempt to autonegotiate before downshifting if we
* Number of times we will attempt to autonegotiate before downshifting if we
* are the master * are the master
*/ */
#define I347AT4_PSCR_DOWNSHIFT_ENABLE 0x0800 #define I347AT4_PSCR_DOWNSHIFT_ENABLE 0x0800
......
...@@ -103,7 +103,7 @@ void igb_release_nvm_i210(struct e1000_hw *hw) ...@@ -103,7 +103,7 @@ void igb_release_nvm_i210(struct e1000_hw *hw)
* @hw: pointer to the HW structure * @hw: pointer to the HW structure
* *
* Release hardware semaphore used to access the PHY or NVM * Release hardware semaphore used to access the PHY or NVM
*/ **/
static void igb_put_hw_semaphore_i210(struct e1000_hw *hw) static void igb_put_hw_semaphore_i210(struct e1000_hw *hw)
{ {
u32 swsm; u32 swsm;
...@@ -141,9 +141,7 @@ s32 igb_acquire_swfw_sync_i210(struct e1000_hw *hw, u16 mask) ...@@ -141,9 +141,7 @@ s32 igb_acquire_swfw_sync_i210(struct e1000_hw *hw, u16 mask)
if (!(swfw_sync & fwmask)) if (!(swfw_sync & fwmask))
break; break;
/* /* Firmware currently using resource (fwmask) */
* Firmware currently using resource (fwmask)
*/
igb_put_hw_semaphore_i210(hw); igb_put_hw_semaphore_i210(hw);
mdelay(5); mdelay(5);
i++; i++;
...@@ -203,7 +201,8 @@ s32 igb_read_nvm_srrd_i210(struct e1000_hw *hw, u16 offset, u16 words, ...@@ -203,7 +201,8 @@ s32 igb_read_nvm_srrd_i210(struct e1000_hw *hw, u16 offset, u16 words,
/* We cannot hold synchronization semaphores for too long, /* We cannot hold synchronization semaphores for too long,
* because of forceful takeover procedure. However it is more efficient * because of forceful takeover procedure. However it is more efficient
* to read in bursts than synchronizing access for each word. */ * to read in bursts than synchronizing access for each word.
*/
for (i = 0; i < words; i += E1000_EERD_EEWR_MAX_COUNT) { for (i = 0; i < words; i += E1000_EERD_EEWR_MAX_COUNT) {
count = (words - i) / E1000_EERD_EEWR_MAX_COUNT > 0 ? count = (words - i) / E1000_EERD_EEWR_MAX_COUNT > 0 ?
E1000_EERD_EEWR_MAX_COUNT : (words - i); E1000_EERD_EEWR_MAX_COUNT : (words - i);
...@@ -242,8 +241,7 @@ static s32 igb_write_nvm_srwr(struct e1000_hw *hw, u16 offset, u16 words, ...@@ -242,8 +241,7 @@ static s32 igb_write_nvm_srwr(struct e1000_hw *hw, u16 offset, u16 words,
u32 attempts = 100000; u32 attempts = 100000;
s32 ret_val = E1000_SUCCESS; s32 ret_val = E1000_SUCCESS;
/* /* A check for invalid values: offset too large, too many words,
* A check for invalid values: offset too large, too many words,
* too many words for the offset, and not enough words. * too many words for the offset, and not enough words.
*/ */
if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) || if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
...@@ -294,7 +292,7 @@ static s32 igb_write_nvm_srwr(struct e1000_hw *hw, u16 offset, u16 words, ...@@ -294,7 +292,7 @@ static s32 igb_write_nvm_srwr(struct e1000_hw *hw, u16 offset, u16 words,
* *
* If error code is returned, data and Shadow RAM may be inconsistent - buffer * If error code is returned, data and Shadow RAM may be inconsistent - buffer
* partially written. * partially written.
*/ **/
s32 igb_write_nvm_srwr_i210(struct e1000_hw *hw, u16 offset, u16 words, s32 igb_write_nvm_srwr_i210(struct e1000_hw *hw, u16 offset, u16 words,
u16 *data) u16 *data)
{ {
...@@ -549,8 +547,7 @@ s32 igb_validate_nvm_checksum_i210(struct e1000_hw *hw) ...@@ -549,8 +547,7 @@ s32 igb_validate_nvm_checksum_i210(struct e1000_hw *hw)
if (hw->nvm.ops.acquire(hw) == E1000_SUCCESS) { if (hw->nvm.ops.acquire(hw) == E1000_SUCCESS) {
/* /* Replace the read function with semaphore grabbing with
* Replace the read function with semaphore grabbing with
* the one that skips this for a while. * the one that skips this for a while.
* We have semaphore taken already here. * We have semaphore taken already here.
*/ */
...@@ -570,7 +567,6 @@ s32 igb_validate_nvm_checksum_i210(struct e1000_hw *hw) ...@@ -570,7 +567,6 @@ s32 igb_validate_nvm_checksum_i210(struct e1000_hw *hw)
return status; return status;
} }
/** /**
* igb_update_nvm_checksum_i210 - Update EEPROM checksum * igb_update_nvm_checksum_i210 - Update EEPROM checksum
* @hw: pointer to the HW structure * @hw: pointer to the HW structure
...@@ -585,8 +581,7 @@ s32 igb_update_nvm_checksum_i210(struct e1000_hw *hw) ...@@ -585,8 +581,7 @@ s32 igb_update_nvm_checksum_i210(struct e1000_hw *hw)
u16 checksum = 0; u16 checksum = 0;
u16 i, nvm_data; u16 i, nvm_data;
/* /* Read the first word from the EEPROM. If this times out or fails, do
* Read the first word from the EEPROM. If this times out or fails, do
* not continue or we could be in for a very long wait while every * not continue or we could be in for a very long wait while every
* EEPROM read fails * EEPROM read fails
*/ */
...@@ -597,8 +592,7 @@ s32 igb_update_nvm_checksum_i210(struct e1000_hw *hw) ...@@ -597,8 +592,7 @@ s32 igb_update_nvm_checksum_i210(struct e1000_hw *hw)
} }
if (hw->nvm.ops.acquire(hw) == E1000_SUCCESS) { if (hw->nvm.ops.acquire(hw) == E1000_SUCCESS) {
/* /* Do not use hw->nvm.ops.write, hw->nvm.ops.read
* Do not use hw->nvm.ops.write, hw->nvm.ops.read
* because we do not want to take the synchronization * because we do not want to take the synchronization
* semaphores twice here. * semaphores twice here.
*/ */
...@@ -635,7 +629,7 @@ s32 igb_update_nvm_checksum_i210(struct e1000_hw *hw) ...@@ -635,7 +629,7 @@ s32 igb_update_nvm_checksum_i210(struct e1000_hw *hw)
* igb_pool_flash_update_done_i210 - Pool FLUDONE status. * igb_pool_flash_update_done_i210 - Pool FLUDONE status.
* @hw: pointer to the HW structure * @hw: pointer to the HW structure
* *
*/ **/
static s32 igb_pool_flash_update_done_i210(struct e1000_hw *hw) static s32 igb_pool_flash_update_done_i210(struct e1000_hw *hw)
{ {
s32 ret_val = -E1000_ERR_NVM; s32 ret_val = -E1000_ERR_NVM;
......
This diff is collapsed.
...@@ -35,8 +35,7 @@ ...@@ -35,8 +35,7 @@
#include "e1000_defines.h" #include "e1000_defines.h"
#include "e1000_i210.h" #include "e1000_i210.h"
/* /* Functions that should not be called directly from drivers but can be used
* Functions that should not be called directly from drivers but can be used
* by other files in this 'shared code' * by other files in this 'shared code'
*/ */
s32 igb_blink_led(struct e1000_hw *hw); s32 igb_blink_led(struct e1000_hw *hw);
......
...@@ -196,7 +196,8 @@ static s32 igb_poll_for_ack(struct e1000_hw *hw, u16 mbx_id) ...@@ -196,7 +196,8 @@ static s32 igb_poll_for_ack(struct e1000_hw *hw, u16 mbx_id)
* returns SUCCESS if it successfully received a message notification and * returns SUCCESS if it successfully received a message notification and
* copied it into the receive buffer. * copied it into the receive buffer.
**/ **/
static s32 igb_read_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id) static s32 igb_read_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size,
u16 mbx_id)
{ {
struct e1000_mbx_info *mbx = &hw->mbx; struct e1000_mbx_info *mbx = &hw->mbx;
s32 ret_val = -E1000_ERR_MBX; s32 ret_val = -E1000_ERR_MBX;
...@@ -222,7 +223,8 @@ static s32 igb_read_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_ ...@@ -222,7 +223,8 @@ static s32 igb_read_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_
* returns SUCCESS if it successfully copied message into the buffer and * returns SUCCESS if it successfully copied message into the buffer and
* received an ack to that message within delay * timeout period * received an ack to that message within delay * timeout period
**/ **/
static s32 igb_write_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size, u16 mbx_id) static s32 igb_write_posted_mbx(struct e1000_hw *hw, u32 *msg, u16 size,
u16 mbx_id)
{ {
struct e1000_mbx_info *mbx = &hw->mbx; struct e1000_mbx_info *mbx = &hw->mbx;
s32 ret_val = -E1000_ERR_MBX; s32 ret_val = -E1000_ERR_MBX;
...@@ -325,7 +327,6 @@ static s32 igb_obtain_mbx_lock_pf(struct e1000_hw *hw, u16 vf_number) ...@@ -325,7 +327,6 @@ static s32 igb_obtain_mbx_lock_pf(struct e1000_hw *hw, u16 vf_number)
s32 ret_val = -E1000_ERR_MBX; s32 ret_val = -E1000_ERR_MBX;
u32 p2v_mailbox; u32 p2v_mailbox;
/* Take ownership of the buffer */ /* Take ownership of the buffer */
wr32(E1000_P2VMAILBOX(vf_number), E1000_P2VMAILBOX_PFU); wr32(E1000_P2VMAILBOX(vf_number), E1000_P2VMAILBOX_PFU);
......
...@@ -47,12 +47,12 @@ ...@@ -47,12 +47,12 @@
* PF. The reverse is true if it is E1000_PF_*. * PF. The reverse is true if it is E1000_PF_*.
* Message ACK's are the value or'd with 0xF0000000 * Message ACK's are the value or'd with 0xF0000000
*/ */
#define E1000_VT_MSGTYPE_ACK 0x80000000 /* Messages below or'd with /* Messages below or'd with this are the ACK */
* this are the ACK */ #define E1000_VT_MSGTYPE_ACK 0x80000000
#define E1000_VT_MSGTYPE_NACK 0x40000000 /* Messages below or'd with /* Messages below or'd with this are the NACK */
* this are the NACK */ #define E1000_VT_MSGTYPE_NACK 0x40000000
#define E1000_VT_MSGTYPE_CTS 0x20000000 /* Indicates that VF is still /* Indicates that VF is still clear to send requests */
clear to send requests */ #define E1000_VT_MSGTYPE_CTS 0x20000000
#define E1000_VT_MSGINFO_SHIFT 16 #define E1000_VT_MSGINFO_SHIFT 16
/* bits 23:16 are used for exra info for certain messages */ /* bits 23:16 are used for exra info for certain messages */
#define E1000_VT_MSGINFO_MASK (0xFF << E1000_VT_MSGINFO_SHIFT) #define E1000_VT_MSGINFO_MASK (0xFF << E1000_VT_MSGINFO_SHIFT)
......
...@@ -289,8 +289,7 @@ static s32 igb_ready_nvm_eeprom(struct e1000_hw *hw) ...@@ -289,8 +289,7 @@ static s32 igb_ready_nvm_eeprom(struct e1000_hw *hw)
udelay(1); udelay(1);
timeout = NVM_MAX_RETRY_SPI; timeout = NVM_MAX_RETRY_SPI;
/* /* Read "Status Register" repeatedly until the LSB is cleared.
* Read "Status Register" repeatedly until the LSB is cleared.
* The EEPROM will signal that the command has been completed * The EEPROM will signal that the command has been completed
* by clearing bit 0 of the internal status register. If it's * by clearing bit 0 of the internal status register. If it's
* not cleared within 'timeout', then error out. * not cleared within 'timeout', then error out.
...@@ -335,8 +334,7 @@ s32 igb_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) ...@@ -335,8 +334,7 @@ s32 igb_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
u16 word_in; u16 word_in;
u8 read_opcode = NVM_READ_OPCODE_SPI; u8 read_opcode = NVM_READ_OPCODE_SPI;
/* /* A check for invalid values: offset too large, too many words,
* A check for invalid values: offset too large, too many words,
* and not enough words. * and not enough words.
*/ */
if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) || if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
...@@ -363,8 +361,7 @@ s32 igb_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) ...@@ -363,8 +361,7 @@ s32 igb_read_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
igb_shift_out_eec_bits(hw, read_opcode, nvm->opcode_bits); igb_shift_out_eec_bits(hw, read_opcode, nvm->opcode_bits);
igb_shift_out_eec_bits(hw, (u16)(offset*2), nvm->address_bits); igb_shift_out_eec_bits(hw, (u16)(offset*2), nvm->address_bits);
/* /* Read the data. SPI NVMs increment the address with each byte
* Read the data. SPI NVMs increment the address with each byte
* read and will roll over if reading beyond the end. This allows * read and will roll over if reading beyond the end. This allows
* us to read the whole NVM from any offset * us to read the whole NVM from any offset
*/ */
...@@ -395,8 +392,7 @@ s32 igb_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) ...@@ -395,8 +392,7 @@ s32 igb_read_nvm_eerd(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
u32 i, eerd = 0; u32 i, eerd = 0;
s32 ret_val = 0; s32 ret_val = 0;
/* /* A check for invalid values: offset too large, too many words,
* A check for invalid values: offset too large, too many words,
* and not enough words. * and not enough words.
*/ */
if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) || if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
...@@ -441,8 +437,7 @@ s32 igb_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) ...@@ -441,8 +437,7 @@ s32 igb_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
s32 ret_val = -E1000_ERR_NVM; s32 ret_val = -E1000_ERR_NVM;
u16 widx = 0; u16 widx = 0;
/* /* A check for invalid values: offset too large, too many words,
* A check for invalid values: offset too large, too many words,
* and not enough words. * and not enough words.
*/ */
if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) || if ((offset >= nvm->word_size) || (words > (nvm->word_size - offset)) ||
...@@ -472,8 +467,7 @@ s32 igb_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data) ...@@ -472,8 +467,7 @@ s32 igb_write_nvm_spi(struct e1000_hw *hw, u16 offset, u16 words, u16 *data)
igb_standby_nvm(hw); igb_standby_nvm(hw);
/* /* Some SPI eeproms use the 8th address bit embedded in the
* Some SPI eeproms use the 8th address bit embedded in the
* opcode * opcode
*/ */
if ((nvm->address_bits == 8) && (offset >= 128)) if ((nvm->address_bits == 8) && (offset >= 128))
...@@ -538,8 +532,7 @@ s32 igb_read_part_string(struct e1000_hw *hw, u8 *part_num, u32 part_num_size) ...@@ -538,8 +532,7 @@ s32 igb_read_part_string(struct e1000_hw *hw, u8 *part_num, u32 part_num_size)
goto out; goto out;
} }
/* /* if nvm_data is not ptr guard the PBA must be in legacy format which
* if nvm_data is not ptr guard the PBA must be in legacy format which
* means pointer is actually our second data word for the PBA number * means pointer is actually our second data word for the PBA number
* and we can decode it into an ascii string * and we can decode it into an ascii string
*/ */
......
This diff is collapsed.
...@@ -140,8 +140,7 @@ ...@@ -140,8 +140,7 @@
#define E1000_THHIGHTC 0x0810C /* High Threshold Control */ #define E1000_THHIGHTC 0x0810C /* High Threshold Control */
#define E1000_THSTAT 0x08110 /* Thermal Sensor Status */ #define E1000_THSTAT 0x08110 /* Thermal Sensor Status */
/* /* Convenience macros
* Convenience macros
* *
* Note: "_n" is the queue number of the register to be written to. * Note: "_n" is the queue number of the register to be written to.
* *
...@@ -287,7 +286,7 @@ ...@@ -287,7 +286,7 @@
#define E1000_RFCTL 0x05008 /* Receive Filter Control*/ #define E1000_RFCTL 0x05008 /* Receive Filter Control*/
#define E1000_MTA 0x05200 /* Multicast Table Array - RW Array */ #define E1000_MTA 0x05200 /* Multicast Table Array - RW Array */
#define E1000_RA 0x05400 /* Receive Address - RW Array */ #define E1000_RA 0x05400 /* Receive Address - RW Array */
#define E1000_RA2 0x054E0 /* 2nd half of receive address array - RW Array */ #define E1000_RA2 0x054E0 /* 2nd half of Rx address array - RW Array */
#define E1000_PSRTYPE(_i) (0x05480 + ((_i) * 4)) #define E1000_PSRTYPE(_i) (0x05480 + ((_i) * 4))
#define E1000_RAL(_i) (((_i) <= 15) ? (0x05400 + ((_i) * 8)) : \ #define E1000_RAL(_i) (((_i) <= 15) ? (0x05400 + ((_i) * 8)) : \
(0x054E0 + ((_i - 16) * 8))) (0x054E0 + ((_i - 16) * 8)))
......
...@@ -167,8 +167,7 @@ enum igb_tx_flags { ...@@ -167,8 +167,7 @@ enum igb_tx_flags {
#define IGB_TX_FLAGS_VLAN_MASK 0xffff0000 #define IGB_TX_FLAGS_VLAN_MASK 0xffff0000
#define IGB_TX_FLAGS_VLAN_SHIFT 16 #define IGB_TX_FLAGS_VLAN_SHIFT 16
/* /* The largest size we can write to the descriptor is 65535. In order to
* The largest size we can write to the descriptor is 65535. In order to
* maintain a power of two alignment we have to limit ourselves to 32K. * maintain a power of two alignment we have to limit ourselves to 32K.
*/ */
#define IGB_MAX_TXD_PWR 15 #define IGB_MAX_TXD_PWR 15
...@@ -187,7 +186,8 @@ enum igb_tx_flags { ...@@ -187,7 +186,8 @@ enum igb_tx_flags {
#define IGB_SFF_8472_UNSUP 0x00 #define IGB_SFF_8472_UNSUP 0x00
/* wrapper around a pointer to a socket buffer, /* wrapper around a pointer to a socket buffer,
* so a DMA handle can be stored along with the buffer */ * so a DMA handle can be stored along with the buffer
*/
struct igb_tx_buffer { struct igb_tx_buffer {
union e1000_adv_tx_desc *next_to_watch; union e1000_adv_tx_desc *next_to_watch;
unsigned long time_stamp; unsigned long time_stamp;
......
...@@ -248,15 +248,15 @@ static int igb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) ...@@ -248,15 +248,15 @@ static int igb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
/* When SoL/IDER sessions are active, autoneg/speed/duplex /* When SoL/IDER sessions are active, autoneg/speed/duplex
* cannot be changed */ * cannot be changed
*/
if (igb_check_reset_block(hw)) { if (igb_check_reset_block(hw)) {
dev_err(&adapter->pdev->dev, dev_err(&adapter->pdev->dev,
"Cannot change link characteristics when SoL/IDER is active.\n"); "Cannot change link characteristics when SoL/IDER is active.\n");
return -EINVAL; return -EINVAL;
} }
/* /* MDI setting is only allowed when autoneg enabled because
* MDI setting is only allowed when autoneg enabled because
* some hardware doesn't allow MDI setting when speed or * some hardware doesn't allow MDI setting when speed or
* duplex is forced. * duplex is forced.
*/ */
...@@ -305,8 +305,7 @@ static int igb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd) ...@@ -305,8 +305,7 @@ static int igb_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
/* MDI-X => 2; MDI => 1; Auto => 3 */ /* MDI-X => 2; MDI => 1; Auto => 3 */
if (ecmd->eth_tp_mdix_ctrl) { if (ecmd->eth_tp_mdix_ctrl) {
/* /* fix up the value for auto (3 => 0) as zero is mapped
* fix up the value for auto (3 => 0) as zero is mapped
* internally to auto * internally to auto
*/ */
if (ecmd->eth_tp_mdix_ctrl == ETH_TP_MDI_AUTO) if (ecmd->eth_tp_mdix_ctrl == ETH_TP_MDI_AUTO)
...@@ -331,8 +330,7 @@ static u32 igb_get_link(struct net_device *netdev) ...@@ -331,8 +330,7 @@ static u32 igb_get_link(struct net_device *netdev)
struct igb_adapter *adapter = netdev_priv(netdev); struct igb_adapter *adapter = netdev_priv(netdev);
struct e1000_mac_info *mac = &adapter->hw.mac; struct e1000_mac_info *mac = &adapter->hw.mac;
/* /* If the link is not reported up to netdev, interrupts are disabled,
* If the link is not reported up to netdev, interrupts are disabled,
* and so the physical link state may have changed since we last * and so the physical link state may have changed since we last
* looked. Set get_link_status to make sure that the true link * looked. Set get_link_status to make sure that the true link
* state is interrogated, rather than pulling a cached and possibly * state is interrogated, rather than pulling a cached and possibly
...@@ -452,7 +450,8 @@ static void igb_get_regs(struct net_device *netdev, ...@@ -452,7 +450,8 @@ static void igb_get_regs(struct net_device *netdev,
/* Interrupt */ /* Interrupt */
/* Reading EICS for EICR because they read the /* Reading EICS for EICR because they read the
* same but EICS does not clear on read */ * same but EICS does not clear on read
*/
regs_buff[13] = rd32(E1000_EICS); regs_buff[13] = rd32(E1000_EICS);
regs_buff[14] = rd32(E1000_EICS); regs_buff[14] = rd32(E1000_EICS);
regs_buff[15] = rd32(E1000_EIMS); regs_buff[15] = rd32(E1000_EIMS);
...@@ -460,7 +459,8 @@ static void igb_get_regs(struct net_device *netdev, ...@@ -460,7 +459,8 @@ static void igb_get_regs(struct net_device *netdev,
regs_buff[17] = rd32(E1000_EIAC); regs_buff[17] = rd32(E1000_EIAC);
regs_buff[18] = rd32(E1000_EIAM); regs_buff[18] = rd32(E1000_EIAM);
/* Reading ICS for ICR because they read the /* Reading ICS for ICR because they read the
* same but ICS does not clear on read */ * same but ICS does not clear on read
*/
regs_buff[19] = rd32(E1000_ICS); regs_buff[19] = rd32(E1000_ICS);
regs_buff[20] = rd32(E1000_ICS); regs_buff[20] = rd32(E1000_ICS);
regs_buff[21] = rd32(E1000_IMS); regs_buff[21] = rd32(E1000_IMS);
...@@ -762,15 +762,17 @@ static int igb_set_eeprom(struct net_device *netdev, ...@@ -762,15 +762,17 @@ static int igb_set_eeprom(struct net_device *netdev,
ptr = (void *)eeprom_buff; ptr = (void *)eeprom_buff;
if (eeprom->offset & 1) { if (eeprom->offset & 1) {
/* need read/modify/write of first changed EEPROM word */ /* need read/modify/write of first changed EEPROM word
/* only the second byte of the word is being modified */ * only the second byte of the word is being modified
*/
ret_val = hw->nvm.ops.read(hw, first_word, 1, ret_val = hw->nvm.ops.read(hw, first_word, 1,
&eeprom_buff[0]); &eeprom_buff[0]);
ptr++; ptr++;
} }
if (((eeprom->offset + eeprom->len) & 1) && (ret_val == 0)) { if (((eeprom->offset + eeprom->len) & 1) && (ret_val == 0)) {
/* need read/modify/write of last changed EEPROM word */ /* need read/modify/write of last changed EEPROM word
/* only the first byte of the word is being modified */ * only the first byte of the word is being modified
*/
ret_val = hw->nvm.ops.read(hw, last_word, 1, ret_val = hw->nvm.ops.read(hw, last_word, 1,
&eeprom_buff[last_word - first_word]); &eeprom_buff[last_word - first_word]);
} }
...@@ -788,7 +790,8 @@ static int igb_set_eeprom(struct net_device *netdev, ...@@ -788,7 +790,8 @@ static int igb_set_eeprom(struct net_device *netdev,
last_word - first_word + 1, eeprom_buff); last_word - first_word + 1, eeprom_buff);
/* Update the checksum over the first part of the EEPROM if needed /* Update the checksum over the first part of the EEPROM if needed
* and flush shadow RAM for 82573 controllers */ * and flush shadow RAM for 82573 controllers
*/
if ((ret_val == 0) && ((first_word <= NVM_CHECKSUM_REG))) if ((ret_val == 0) && ((first_word <= NVM_CHECKSUM_REG)))
hw->nvm.ops.update(hw); hw->nvm.ops.update(hw);
...@@ -805,8 +808,7 @@ static void igb_get_drvinfo(struct net_device *netdev, ...@@ -805,8 +808,7 @@ static void igb_get_drvinfo(struct net_device *netdev,
strlcpy(drvinfo->driver, igb_driver_name, sizeof(drvinfo->driver)); strlcpy(drvinfo->driver, igb_driver_name, sizeof(drvinfo->driver));
strlcpy(drvinfo->version, igb_driver_version, sizeof(drvinfo->version)); strlcpy(drvinfo->version, igb_driver_version, sizeof(drvinfo->version));
/* /* EEPROM image version # is reported as firmware version # for
* EEPROM image version # is reported as firmware version # for
* 82575 controllers * 82575 controllers
*/ */
strlcpy(drvinfo->fw_version, adapter->fw_version, strlcpy(drvinfo->fw_version, adapter->fw_version,
...@@ -869,9 +871,11 @@ static int igb_set_ringparam(struct net_device *netdev, ...@@ -869,9 +871,11 @@ static int igb_set_ringparam(struct net_device *netdev,
} }
if (adapter->num_tx_queues > adapter->num_rx_queues) if (adapter->num_tx_queues > adapter->num_rx_queues)
temp_ring = vmalloc(adapter->num_tx_queues * sizeof(struct igb_ring)); temp_ring = vmalloc(adapter->num_tx_queues *
sizeof(struct igb_ring));
else else
temp_ring = vmalloc(adapter->num_rx_queues * sizeof(struct igb_ring)); temp_ring = vmalloc(adapter->num_rx_queues *
sizeof(struct igb_ring));
if (!temp_ring) { if (!temp_ring) {
err = -ENOMEM; err = -ENOMEM;
...@@ -880,10 +884,9 @@ static int igb_set_ringparam(struct net_device *netdev, ...@@ -880,10 +884,9 @@ static int igb_set_ringparam(struct net_device *netdev,
igb_down(adapter); igb_down(adapter);
/* /* We can't just free everything and then setup again,
* We can't just free everything and then setup again,
* because the ISRs in MSI-X mode get passed pointers * because the ISRs in MSI-X mode get passed pointers
* to the tx and rx ring structs. * to the Tx and Rx ring structs.
*/ */
if (new_tx_count != adapter->tx_ring_count) { if (new_tx_count != adapter->tx_ring_count) {
for (i = 0; i < adapter->num_tx_queues; i++) { for (i = 0; i < adapter->num_tx_queues; i++) {
...@@ -1759,7 +1762,7 @@ static int igb_clean_test_rings(struct igb_ring *rx_ring, ...@@ -1759,7 +1762,7 @@ static int igb_clean_test_rings(struct igb_ring *rx_ring,
rx_desc = IGB_RX_DESC(rx_ring, rx_ntc); rx_desc = IGB_RX_DESC(rx_ring, rx_ntc);
while (igb_test_staterr(rx_desc, E1000_RXD_STAT_DD)) { while (igb_test_staterr(rx_desc, E1000_RXD_STAT_DD)) {
/* check rx buffer */ /* check Rx buffer */
rx_buffer_info = &rx_ring->rx_buffer_info[rx_ntc]; rx_buffer_info = &rx_ring->rx_buffer_info[rx_ntc];
/* sync Rx buffer for CPU read */ /* sync Rx buffer for CPU read */
...@@ -1778,11 +1781,11 @@ static int igb_clean_test_rings(struct igb_ring *rx_ring, ...@@ -1778,11 +1781,11 @@ static int igb_clean_test_rings(struct igb_ring *rx_ring,
IGB_RX_BUFSZ, IGB_RX_BUFSZ,
DMA_FROM_DEVICE); DMA_FROM_DEVICE);
/* unmap buffer on tx side */ /* unmap buffer on Tx side */
tx_buffer_info = &tx_ring->tx_buffer_info[tx_ntc]; tx_buffer_info = &tx_ring->tx_buffer_info[tx_ntc];
igb_unmap_and_free_tx_resource(tx_ring, tx_buffer_info); igb_unmap_and_free_tx_resource(tx_ring, tx_buffer_info);
/* increment rx/tx next to clean counters */ /* increment Rx/Tx next to clean counters */
rx_ntc++; rx_ntc++;
if (rx_ntc == rx_ring->count) if (rx_ntc == rx_ring->count)
rx_ntc = 0; rx_ntc = 0;
...@@ -1823,8 +1826,7 @@ static int igb_run_loopback_test(struct igb_adapter *adapter) ...@@ -1823,8 +1826,7 @@ static int igb_run_loopback_test(struct igb_adapter *adapter)
igb_create_lbtest_frame(skb, size); igb_create_lbtest_frame(skb, size);
skb_put(skb, size); skb_put(skb, size);
/* /* Calculate the loop count based on the largest descriptor ring
* Calculate the loop count based on the largest descriptor ring
* The idea is to wrap the largest ring a number of times using 64 * The idea is to wrap the largest ring a number of times using 64
* send/receive pairs during each loop * send/receive pairs during each loop
*/ */
...@@ -1851,7 +1853,7 @@ static int igb_run_loopback_test(struct igb_adapter *adapter) ...@@ -1851,7 +1853,7 @@ static int igb_run_loopback_test(struct igb_adapter *adapter)
break; break;
} }
/* allow 200 milliseconds for packets to go from tx to rx */ /* allow 200 milliseconds for packets to go from Tx to Rx */
msleep(200); msleep(200);
good_cnt = igb_clean_test_rings(rx_ring, tx_ring, size); good_cnt = igb_clean_test_rings(rx_ring, tx_ring, size);
...@@ -1870,7 +1872,8 @@ static int igb_run_loopback_test(struct igb_adapter *adapter) ...@@ -1870,7 +1872,8 @@ static int igb_run_loopback_test(struct igb_adapter *adapter)
static int igb_loopback_test(struct igb_adapter *adapter, u64 *data) static int igb_loopback_test(struct igb_adapter *adapter, u64 *data)
{ {
/* PHY loopback cannot be performed if SoL/IDER /* PHY loopback cannot be performed if SoL/IDER
* sessions are active */ * sessions are active
*/
if (igb_check_reset_block(&adapter->hw)) { if (igb_check_reset_block(&adapter->hw)) {
dev_err(&adapter->pdev->dev, dev_err(&adapter->pdev->dev,
"Cannot do PHY loopback test when SoL/IDER is active.\n"); "Cannot do PHY loopback test when SoL/IDER is active.\n");
...@@ -1901,7 +1904,8 @@ static int igb_link_test(struct igb_adapter *adapter, u64 *data) ...@@ -1901,7 +1904,8 @@ static int igb_link_test(struct igb_adapter *adapter, u64 *data)
hw->mac.serdes_has_link = false; hw->mac.serdes_has_link = false;
/* On some blade server designs, link establishment /* On some blade server designs, link establishment
* could take as long as 2-3 minutes */ * could take as long as 2-3 minutes
*/
do { do {
hw->mac.ops.check_for_link(&adapter->hw); hw->mac.ops.check_for_link(&adapter->hw);
if (hw->mac.serdes_has_link) if (hw->mac.serdes_has_link)
...@@ -1944,7 +1948,8 @@ static void igb_diag_test(struct net_device *netdev, ...@@ -1944,7 +1948,8 @@ static void igb_diag_test(struct net_device *netdev,
igb_power_up_link(adapter); igb_power_up_link(adapter);
/* Link test performed before hardware reset so autoneg doesn't /* Link test performed before hardware reset so autoneg doesn't
* interfere with test result */ * interfere with test result
*/
if (igb_link_test(adapter, &data[4])) if (igb_link_test(adapter, &data[4]))
eth_test->flags |= ETH_TEST_FL_FAILED; eth_test->flags |= ETH_TEST_FL_FAILED;
...@@ -2285,7 +2290,7 @@ static void igb_get_strings(struct net_device *netdev, u32 stringset, u8 *data) ...@@ -2285,7 +2290,7 @@ static void igb_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
sprintf(p, "rx_queue_%u_alloc_failed", i); sprintf(p, "rx_queue_%u_alloc_failed", i);
p += ETH_GSTRING_LEN; p += ETH_GSTRING_LEN;
} }
/* BUG_ON(p - data != IGB_STATS_LEN * ETH_GSTRING_LEN); */ /* BUG_ON(p - data != IGB_STATS_LEN * ETH_GSTRING_LEN); */
break; break;
} }
} }
......
...@@ -111,7 +111,8 @@ static ssize_t igb_hwmon_show_maxopthresh(struct device *dev, ...@@ -111,7 +111,8 @@ static ssize_t igb_hwmon_show_maxopthresh(struct device *dev,
* the data structures we need to get the data to display. * the data structures we need to get the data to display.
*/ */
static int igb_add_hwmon_attr(struct igb_adapter *adapter, static int igb_add_hwmon_attr(struct igb_adapter *adapter,
unsigned int offset, int type) { unsigned int offset, int type)
{
int rc; int rc;
unsigned int n_attr; unsigned int n_attr;
struct hwmon_attr *igb_attr; struct hwmon_attr *igb_attr;
......
This diff is collapsed.
/* /* PTP Hardware Clock (PHC) driver for the Intel 82576 and 82580
* PTP Hardware Clock (PHC) driver for the Intel 82576 and 82580
* *
* Copyright (C) 2011 Richard Cochran <richardcochran@gmail.com> * Copyright (C) 2011 Richard Cochran <richardcochran@gmail.com>
* *
...@@ -27,8 +26,7 @@ ...@@ -27,8 +26,7 @@
#define INCVALUE_MASK 0x7fffffff #define INCVALUE_MASK 0x7fffffff
#define ISGN 0x80000000 #define ISGN 0x80000000
/* /* The 82580 timesync updates the system timer every 8ns by 8ns,
* The 82580 timesync updates the system timer every 8ns by 8ns,
* and this update value cannot be reprogrammed. * and this update value cannot be reprogrammed.
* *
* Neither the 82576 nor the 82580 offer registers wide enough to hold * Neither the 82576 nor the 82580 offer registers wide enough to hold
...@@ -77,10 +75,7 @@ ...@@ -77,10 +75,7 @@
#define INCVALUE_82576 (16 << IGB_82576_TSYNC_SHIFT) #define INCVALUE_82576 (16 << IGB_82576_TSYNC_SHIFT)
#define IGB_NBITS_82580 40 #define IGB_NBITS_82580 40
/* /* SYSTIM read access for the 82576 */
* SYSTIM read access for the 82576
*/
static cycle_t igb_ptp_read_82576(const struct cyclecounter *cc) static cycle_t igb_ptp_read_82576(const struct cyclecounter *cc)
{ {
struct igb_adapter *igb = container_of(cc, struct igb_adapter, cc); struct igb_adapter *igb = container_of(cc, struct igb_adapter, cc);
...@@ -97,10 +92,7 @@ static cycle_t igb_ptp_read_82576(const struct cyclecounter *cc) ...@@ -97,10 +92,7 @@ static cycle_t igb_ptp_read_82576(const struct cyclecounter *cc)
return val; return val;
} }
/* /* SYSTIM read access for the 82580 */
* SYSTIM read access for the 82580
*/
static cycle_t igb_ptp_read_82580(const struct cyclecounter *cc) static cycle_t igb_ptp_read_82580(const struct cyclecounter *cc)
{ {
struct igb_adapter *igb = container_of(cc, struct igb_adapter, cc); struct igb_adapter *igb = container_of(cc, struct igb_adapter, cc);
...@@ -108,8 +100,7 @@ static cycle_t igb_ptp_read_82580(const struct cyclecounter *cc) ...@@ -108,8 +100,7 @@ static cycle_t igb_ptp_read_82580(const struct cyclecounter *cc)
u64 val; u64 val;
u32 lo, hi, jk; u32 lo, hi, jk;
/* /* The timestamp latches on lowest register read. For the 82580
* The timestamp latches on lowest register read. For the 82580
* the lowest register is SYSTIMR instead of SYSTIML. However we only * the lowest register is SYSTIMR instead of SYSTIML. However we only
* need to provide nanosecond resolution, so we just ignore it. * need to provide nanosecond resolution, so we just ignore it.
*/ */
...@@ -123,17 +114,13 @@ static cycle_t igb_ptp_read_82580(const struct cyclecounter *cc) ...@@ -123,17 +114,13 @@ static cycle_t igb_ptp_read_82580(const struct cyclecounter *cc)
return val; return val;
} }
/* /* SYSTIM read access for I210/I211 */
* SYSTIM read access for I210/I211
*/
static void igb_ptp_read_i210(struct igb_adapter *adapter, struct timespec *ts) static void igb_ptp_read_i210(struct igb_adapter *adapter, struct timespec *ts)
{ {
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
u32 sec, nsec, jk; u32 sec, nsec, jk;
/* /* The timestamp latches on lowest register read. For I210/I211, the
* The timestamp latches on lowest register read. For I210/I211, the
* lowest register is SYSTIMR. Since we only need to provide nanosecond * lowest register is SYSTIMR. Since we only need to provide nanosecond
* resolution, we can ignore it. * resolution, we can ignore it.
*/ */
...@@ -150,8 +137,7 @@ static void igb_ptp_write_i210(struct igb_adapter *adapter, ...@@ -150,8 +137,7 @@ static void igb_ptp_write_i210(struct igb_adapter *adapter,
{ {
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
/* /* Writing the SYSTIMR register is not necessary as it only provides
* Writing the SYSTIMR register is not necessary as it only provides
* sub-nanosecond resolution. * sub-nanosecond resolution.
*/ */
wr32(E1000_SYSTIML, ts->tv_nsec); wr32(E1000_SYSTIML, ts->tv_nsec);
...@@ -207,10 +193,7 @@ static void igb_ptp_systim_to_hwtstamp(struct igb_adapter *adapter, ...@@ -207,10 +193,7 @@ static void igb_ptp_systim_to_hwtstamp(struct igb_adapter *adapter,
} }
} }
/* /* PTP clock operations */
* PTP clock operations
*/
static int igb_ptp_adjfreq_82576(struct ptp_clock_info *ptp, s32 ppb) static int igb_ptp_adjfreq_82576(struct ptp_clock_info *ptp, s32 ppb)
{ {
struct igb_adapter *igb = container_of(ptp, struct igb_adapter, struct igb_adapter *igb = container_of(ptp, struct igb_adapter,
...@@ -387,7 +370,7 @@ static int igb_ptp_enable(struct ptp_clock_info *ptp, ...@@ -387,7 +370,7 @@ static int igb_ptp_enable(struct ptp_clock_info *ptp,
* *
* This work function polls the TSYNCTXCTL valid bit to determine when a * This work function polls the TSYNCTXCTL valid bit to determine when a
* timestamp has been taken for the current stored skb. * timestamp has been taken for the current stored skb.
*/ **/
void igb_ptp_tx_work(struct work_struct *work) void igb_ptp_tx_work(struct work_struct *work)
{ {
struct igb_adapter *adapter = container_of(work, struct igb_adapter, struct igb_adapter *adapter = container_of(work, struct igb_adapter,
...@@ -437,7 +420,7 @@ static void igb_ptp_overflow_check(struct work_struct *work) ...@@ -437,7 +420,7 @@ static void igb_ptp_overflow_check(struct work_struct *work)
* dropped an Rx packet that was timestamped when the ring is full. The * dropped an Rx packet that was timestamped when the ring is full. The
* particular error is rare but leaves the device in a state unable to timestamp * particular error is rare but leaves the device in a state unable to timestamp
* any future packets. * any future packets.
*/ **/
void igb_ptp_rx_hang(struct igb_adapter *adapter) void igb_ptp_rx_hang(struct igb_adapter *adapter)
{ {
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
...@@ -481,7 +464,7 @@ void igb_ptp_rx_hang(struct igb_adapter *adapter) ...@@ -481,7 +464,7 @@ void igb_ptp_rx_hang(struct igb_adapter *adapter)
* If we were asked to do hardware stamping and such a time stamp is * If we were asked to do hardware stamping and such a time stamp is
* available, then it must have been for this skb here because we only * available, then it must have been for this skb here because we only
* allow only one such packet into the queue. * allow only one such packet into the queue.
*/ **/
void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter) void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter)
{ {
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
...@@ -506,15 +489,14 @@ void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter) ...@@ -506,15 +489,14 @@ void igb_ptp_tx_hwtstamp(struct igb_adapter *adapter)
* This function is meant to retrieve a timestamp from the first buffer of an * This function is meant to retrieve a timestamp from the first buffer of an
* incoming frame. The value is stored in little endian format starting on * incoming frame. The value is stored in little endian format starting on
* byte 8. * byte 8.
*/ **/
void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector,
unsigned char *va, unsigned char *va,
struct sk_buff *skb) struct sk_buff *skb)
{ {
__le64 *regval = (__le64 *)va; __le64 *regval = (__le64 *)va;
/* /* The timestamp is recorded in little endian format.
* The timestamp is recorded in little endian format.
* DWORD: 0 1 2 3 * DWORD: 0 1 2 3
* Field: Reserved Reserved SYSTIML SYSTIMH * Field: Reserved Reserved SYSTIML SYSTIMH
*/ */
...@@ -529,7 +511,7 @@ void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector, ...@@ -529,7 +511,7 @@ void igb_ptp_rx_pktstamp(struct igb_q_vector *q_vector,
* *
* This function is meant to retrieve a timestamp from the internal registers * This function is meant to retrieve a timestamp from the internal registers
* of the adapter and store it in the skb. * of the adapter and store it in the skb.
*/ **/
void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector, void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector,
struct sk_buff *skb) struct sk_buff *skb)
{ {
...@@ -537,8 +519,7 @@ void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector, ...@@ -537,8 +519,7 @@ void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector,
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
u64 regval; u64 regval;
/* /* If this bit is set, then the RX registers contain the time stamp. No
* If this bit is set, then the RX registers contain the time stamp. No
* other packet will be time stamped until we read these registers, so * other packet will be time stamped until we read these registers, so
* read the registers to make them available again. Because only one * read the registers to make them available again. Because only one
* packet can be time stamped at a time, we know that the register * packet can be time stamped at a time, we know that the register
...@@ -574,7 +555,6 @@ void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector, ...@@ -574,7 +555,6 @@ void igb_ptp_rx_rgtstamp(struct igb_q_vector *q_vector,
* type has to be specified. Matching the kind of event packet is * type has to be specified. Matching the kind of event packet is
* not supported, with the exception of "all V2 events regardless of * not supported, with the exception of "all V2 events regardless of
* level 2 or 4". * level 2 or 4".
*
**/ **/
int igb_ptp_hwtstamp_ioctl(struct net_device *netdev, int igb_ptp_hwtstamp_ioctl(struct net_device *netdev,
struct ifreq *ifr, int cmd) struct ifreq *ifr, int cmd)
...@@ -655,10 +635,9 @@ int igb_ptp_hwtstamp_ioctl(struct net_device *netdev, ...@@ -655,10 +635,9 @@ int igb_ptp_hwtstamp_ioctl(struct net_device *netdev,
return 0; return 0;
} }
/* /* Per-packet timestamping only works if all packets are
* Per-packet timestamping only works if all packets are
* timestamped, so enable timestamping in all packets as * timestamped, so enable timestamping in all packets as
* long as one rx filter was configured. * long as one Rx filter was configured.
*/ */
if ((hw->mac.type >= e1000_82580) && tsync_rx_ctl) { if ((hw->mac.type >= e1000_82580) && tsync_rx_ctl) {
tsync_rx_ctl = E1000_TSYNCRXCTL_ENABLED; tsync_rx_ctl = E1000_TSYNCRXCTL_ENABLED;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment