Skip to content

Commit 4d469ec

Browse files
committed
Merge branch '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue
Tony Nguyen says: ==================== 1GbE Intel Wired LAN Driver Updates 2021-02-03 This series contains updates to igc, igb, e1000e, and e1000 drivers. Sasha adds counting of good transmit packets and reporting of NVM version and gPHY version in ethtool firmware version. Replaces the use of strlcpy to the preferred strscpy. Fixes a typo that caused the wrong register to be output. He also removes an unused function pointer, some unneeded defines, and a non-applicable comment. All changes for igc. Gal Hammer fixes a typo which caused the RDBAL register values to be shown instead of TDBAL for igb. Nick Lowe enables RSS support for i211 devices for igb. Tom Rix fixes checkpatch warning by removing h from printk format specifier for igb. Kaixu Xia removes setting of a variable that is overwritten before next use for e1000e. Sudip Mukherjee removes an unneeded assignment for e1000. * '1GbE' of git://git.kernel.org/pub/scm/linux/kernel/git/tnguy/next-queue: e1000: drop unneeded assignment in e1000_set_itr() e1000e: remove the redundant value assignment in e1000_update_nvm_checksum_spt igb: remove h from printk format specifier igb: Enable RSS for Intel I211 Ethernet Controller igb: fix TDBAL register show incorrect value igc: Fix TDBAL register show incorrect value igc: Remove unused FUNC_1 mask igc: Remove unused local receiver mask igc: Prefer strscpy over strlcpy igc: Expose the gPHY firmware version igc: Expose the NVM version igc: Add Host Good Packets Transmitted Count igc: Remove MULR mask define igc: Remove igc_set_fw_version comment igc: Clean up nvm_operations structure ==================== Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents 8ae90b7 + 5a04b95 commit 4d469ec

File tree

12 files changed

+48
-21
lines changed

12 files changed

+48
-21
lines changed

drivers/net/ethernet/intel/e1000/e1000_main.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2632,7 +2632,6 @@ static void e1000_set_itr(struct e1000_adapter *adapter)
26322632

26332633
/* for non-gigabit speeds, just fix the interrupt rate at 4000 */
26342634
if (unlikely(adapter->link_speed != SPEED_1000)) {
2635-
current_itr = 0;
26362635
new_itr = 4000;
26372636
goto set_itr_now;
26382637
}

drivers/net/ethernet/intel/e1000e/ich8lan.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3886,13 +3886,6 @@ static s32 e1000_update_nvm_checksum_spt(struct e1000_hw *hw)
38863886
if (ret_val)
38873887
goto release;
38883888

3889-
/* And invalidate the previously valid segment by setting
3890-
* its signature word (0x13) high_byte to 0b. This can be
3891-
* done without an erase because flash erase sets all bits
3892-
* to 1's. We can write 1's to 0's without an erase
3893-
*/
3894-
act_offset = (old_bank_offset + E1000_ICH_NVM_SIG_WORD) * 2 + 1;
3895-
38963889
/* offset in words but we read dword */
38973890
act_offset = old_bank_offset + E1000_ICH_NVM_SIG_WORD - 1;
38983891
ret_val = e1000_read_flash_dword_ich8lan(hw, act_offset, &dword);

drivers/net/ethernet/intel/igb/igb_main.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ static void igb_regdump(struct e1000_hw *hw, struct igb_reg_info *reginfo)
316316
break;
317317
case E1000_TDBAL(0):
318318
for (n = 0; n < 4; n++)
319-
regs[n] = rd32(E1000_RDBAL(n));
319+
regs[n] = rd32(E1000_TDBAL(n));
320320
break;
321321
case E1000_TDBAH(0):
322322
for (n = 0; n < 4; n++)
@@ -3156,7 +3156,7 @@ static int igb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
31563156
* the PCIe SR-IOV capability.
31573157
*/
31583158
if (pdev->is_virtfn) {
3159-
WARN(1, KERN_ERR "%s (%hx:%hx) should not be a VF!\n",
3159+
WARN(1, KERN_ERR "%s (%x:%x) should not be a VF!\n",
31603160
pci_name(pdev), pdev->vendor, pdev->device);
31613161
return -EINVAL;
31623162
}
@@ -4482,8 +4482,7 @@ static void igb_setup_mrqc(struct igb_adapter *adapter)
44824482
else
44834483
mrqc |= E1000_MRQC_ENABLE_VMDQ;
44844484
} else {
4485-
if (hw->mac.type != e1000_i211)
4486-
mrqc |= E1000_MRQC_ENABLE_RSS_MQ;
4485+
mrqc |= E1000_MRQC_ENABLE_RSS_MQ;
44874486
}
44884487
igb_vmm_control(adapter);
44894488

drivers/net/ethernet/intel/igc/igc.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,8 @@ struct igc_adapter {
217217
struct timecounter tc;
218218
struct timespec64 prev_ptp_time; /* Pre-reset PTP clock */
219219
ktime_t ptp_reset_start; /* Reset time in clock mono */
220+
221+
char fw_version[32];
220222
};
221223

222224
void igc_up(struct igc_adapter *adapter);

drivers/net/ethernet/intel/igc/igc_defines.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,6 @@
129129

130130
/* 1000BASE-T Status Register */
131131
#define SR_1000T_REMOTE_RX_STATUS 0x1000 /* Remote receiver OK */
132-
#define SR_1000T_LOCAL_RX_STATUS 0x2000 /* Local receiver OK */
133132

134133
/* PHY GPY 211 registers */
135134
#define STANDARD_AN_REG_MASK 0x0007 /* MMD */
@@ -160,6 +159,7 @@
160159
#define IGC_NVM_RW_REG_START 1 /* Start operation */
161160
#define IGC_NVM_RW_ADDR_SHIFT 2 /* Shift to the address bits */
162161
#define IGC_NVM_POLL_READ 0 /* Flag for polling for read complete */
162+
#define IGC_NVM_DEV_STARTER 5 /* Dev_starter Version */
163163

164164
/* NVM Word Offsets */
165165
#define NVM_CHECKSUM_REG 0x003F
@@ -179,7 +179,6 @@
179179
#define IGC_STATUS_LU 0x00000002 /* Link up.0=no,1=link */
180180
#define IGC_STATUS_FUNC_MASK 0x0000000C /* PCI Function Mask */
181181
#define IGC_STATUS_FUNC_SHIFT 2
182-
#define IGC_STATUS_FUNC_1 0x00000004 /* Function 1 */
183182
#define IGC_STATUS_TXOFF 0x00000010 /* transmission paused */
184183
#define IGC_STATUS_SPEED_100 0x00000040 /* Speed 100Mb/s */
185184
#define IGC_STATUS_SPEED_1000 0x00000080 /* Speed 1000Mb/s */
@@ -284,7 +283,6 @@
284283
#define IGC_TCTL_CT 0x00000ff0 /* collision threshold */
285284
#define IGC_TCTL_COLD 0x003ff000 /* collision distance */
286285
#define IGC_TCTL_RTLC 0x01000000 /* Re-transmit on late collision */
287-
#define IGC_TCTL_MULR 0x10000000 /* Multiple request support */
288286

289287
/* Flow Control Constants */
290288
#define FLOW_CONTROL_ADDRESS_LOW 0x00C28001

drivers/net/ethernet/intel/igc/igc_dump.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ static void igc_regdump(struct igc_hw *hw, struct igc_reg_info *reginfo)
7575
break;
7676
case IGC_TDBAL(0):
7777
for (n = 0; n < 4; n++)
78-
regs[n] = rd32(IGC_RDBAL(n));
78+
regs[n] = rd32(IGC_TDBAL(n));
7979
break;
8080
case IGC_TDBAH(0):
8181
for (n = 0; n < 4; n++)

drivers/net/ethernet/intel/igc/igc_ethtool.c

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,11 +129,28 @@ static void igc_ethtool_get_drvinfo(struct net_device *netdev,
129129
struct ethtool_drvinfo *drvinfo)
130130
{
131131
struct igc_adapter *adapter = netdev_priv(netdev);
132+
struct igc_hw *hw = &adapter->hw;
133+
u16 nvm_version = 0;
134+
u16 gphy_version;
135+
136+
strscpy(drvinfo->driver, igc_driver_name, sizeof(drvinfo->driver));
137+
138+
/* NVM image version is reported as firmware version for i225 device */
139+
hw->nvm.ops.read(hw, IGC_NVM_DEV_STARTER, 1, &nvm_version);
140+
141+
/* gPHY firmware version is reported as PHY FW version */
142+
gphy_version = igc_read_phy_fw_version(hw);
143+
144+
scnprintf(adapter->fw_version,
145+
sizeof(adapter->fw_version),
146+
"%x:%x",
147+
nvm_version,
148+
gphy_version);
132149

133-
strlcpy(drvinfo->driver, igc_driver_name, sizeof(drvinfo->driver));
150+
strscpy(drvinfo->fw_version, adapter->fw_version,
151+
sizeof(drvinfo->fw_version));
134152

135-
/* add fw_version here */
136-
strlcpy(drvinfo->bus_info, pci_name(adapter->pdev),
153+
strscpy(drvinfo->bus_info, pci_name(adapter->pdev),
137154
sizeof(drvinfo->bus_info));
138155

139156
drvinfo->n_priv_flags = IGC_PRIV_FLAGS_STR_LEN;
@@ -544,7 +561,6 @@ static int igc_ethtool_set_eeprom(struct net_device *netdev,
544561
if (ret_val == 0)
545562
hw->nvm.ops.update(hw);
546563

547-
/* check if need: igc_set_fw_version(adapter); */
548564
kfree(eeprom_buff);
549565
return ret_val;
550566
}

drivers/net/ethernet/intel/igc/igc_hw.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ struct igc_nvm_operations {
113113
s32 (*write)(struct igc_hw *hw, u16 offset, u16 i, u16 *data);
114114
s32 (*update)(struct igc_hw *hw);
115115
s32 (*validate)(struct igc_hw *hw);
116-
s32 (*valid_led_default)(struct igc_hw *hw, u16 *data);
117116
};
118117

119118
struct igc_phy_operations {

drivers/net/ethernet/intel/igc/igc_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3669,6 +3669,7 @@ void igc_update_stats(struct igc_adapter *adapter)
36693669
adapter->stats.prc1522 += rd32(IGC_PRC1522);
36703670
adapter->stats.tlpic += rd32(IGC_TLPIC);
36713671
adapter->stats.rlpic += rd32(IGC_RLPIC);
3672+
adapter->stats.hgptc += rd32(IGC_HGPTC);
36723673

36733674
mpc = rd32(IGC_MPC);
36743675
adapter->stats.mpc += mpc;

drivers/net/ethernet/intel/igc/igc_phy.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -791,3 +791,21 @@ s32 igc_read_phy_reg_gpy(struct igc_hw *hw, u32 offset, u16 *data)
791791

792792
return ret_val;
793793
}
794+
795+
/**
796+
* igc_read_phy_fw_version - Read gPHY firmware version
797+
* @hw: pointer to the HW structure
798+
*/
799+
u16 igc_read_phy_fw_version(struct igc_hw *hw)
800+
{
801+
struct igc_phy_info *phy = &hw->phy;
802+
u16 gphy_version = 0;
803+
u16 ret_val;
804+
805+
/* NVM image version is reported as firmware version for i225 device */
806+
ret_val = phy->ops.read_reg(hw, IGC_GPHY_VERSION, &gphy_version);
807+
if (ret_val)
808+
hw_dbg("igc_phy: read wrong gphy version\n");
809+
810+
return gphy_version;
811+
}

drivers/net/ethernet/intel/igc/igc_phy.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,6 @@ void igc_power_up_phy_copper(struct igc_hw *hw);
1717
void igc_power_down_phy_copper(struct igc_hw *hw);
1818
s32 igc_write_phy_reg_gpy(struct igc_hw *hw, u32 offset, u16 data);
1919
s32 igc_read_phy_reg_gpy(struct igc_hw *hw, u32 offset, u16 *data);
20+
u16 igc_read_phy_fw_version(struct igc_hw *hw);
2021

2122
#endif

drivers/net/ethernet/intel/igc/igc_regs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
#define IGC_MDICNFG 0x00E04 /* MDC/MDIO Configuration - RW */
1414
#define IGC_CONNSW 0x00034 /* Copper/Fiber switch control - RW */
1515
#define IGC_I225_PHPM 0x00E14 /* I225 PHY Power Management */
16+
#define IGC_GPHY_VERSION 0x0001E /* I225 gPHY Firmware Version */
1617

1718
/* Internal Packet Buffer Size Registers */
1819
#define IGC_RXPBS 0x02404 /* Rx Packet Buffer Size - RW */

0 commit comments

Comments
 (0)