@@ -2116,6 +2116,7 @@ struct bnxt {
#define BNXT_PHY_FL_NO_FCS PORT_PHY_QCAPS_RESP_FLAGS_NO_FCS
#define BNXT_PHY_FL_NO_PAUSE (PORT_PHY_QCAPS_RESP_FLAGS2_PAUSE_UNSUPPORTED << 8)
#define BNXT_PHY_FL_NO_PFC (PORT_PHY_QCAPS_RESP_FLAGS2_PFC_UNSUPPORTED << 8)
+#define BNXT_PHY_FL_BANK_SEL (PORT_PHY_QCAPS_RESP_FLAGS2_BANK_ADDR_SUPPORTED << 8)
u8 num_tests;
struct bnxt_test_info *test_info;
@@ -3146,7 +3146,8 @@ static int bnxt_get_eee(struct net_device *dev, struct ethtool_eee *edata)
}
static int bnxt_read_sfp_module_eeprom_info(struct bnxt *bp, u16 i2c_addr,
- u16 page_number, u16 start_addr,
+ u16 page_number, u8 bank,
+ bool bank_sel_en, u16 start_addr,
u16 data_length, u8 *buf)
{
struct hwrm_port_phy_i2c_read_output *output;
@@ -3168,8 +3169,11 @@ static int bnxt_read_sfp_module_eeprom_info(struct bnxt *bp, u16 i2c_addr,
data_length -= xfer_size;
req->page_offset = cpu_to_le16(start_addr + byte_offset);
req->data_length = xfer_size;
- req->enables = cpu_to_le32(start_addr + byte_offset ?
- PORT_PHY_I2C_READ_REQ_ENABLES_PAGE_OFFSET : 0);
+ req->bank_number = bank;
+ req->enables = cpu_to_le32((start_addr + byte_offset ?
+ PORT_PHY_I2C_READ_REQ_ENABLES_PAGE_OFFSET : 0) |
+ (bank_sel_en ?
+ PORT_PHY_I2C_READ_REQ_ENABLES_BANK_NUMBER : 0));
rc = hwrm_req_send(bp, req);
if (!rc)
memcpy(buf + byte_offset, output->data, xfer_size);
@@ -3199,8 +3203,8 @@ static int bnxt_get_module_info(struct net_device *dev,
if (bp->hwrm_spec_code < 0x10202)
return -EOPNOTSUPP;
- rc = bnxt_read_sfp_module_eeprom_info(bp, I2C_DEV_ADDR_A0, 0, 0,
- SFF_DIAG_SUPPORT_OFFSET + 1,
+ rc = bnxt_read_sfp_module_eeprom_info(bp, I2C_DEV_ADDR_A0, 0, 0, false,
+ 0, SFF_DIAG_SUPPORT_OFFSET + 1,
data);
if (!rc) {
u8 module_id = data[0];
@@ -3244,8 +3248,8 @@ static int bnxt_get_module_eeprom(struct net_device *dev,
u8 max_pages = 2;
int rc = 0;
- rc = bnxt_read_sfp_module_eeprom_info(bp, I2C_DEV_ADDR_A0, 0, 0,
- SFF_DIAG_SUPPORT_OFFSET + 1,
+ rc = bnxt_read_sfp_module_eeprom_info(bp, I2C_DEV_ADDR_A0, 0, 0, false,
+ 0, SFF_DIAG_SUPPORT_OFFSET + 1,
module_info);
if (rc)
return rc;
@@ -3261,7 +3265,8 @@ static int bnxt_get_module_eeprom(struct net_device *dev,
case SFF_MODULE_ID_QSFP28: {
u8 opt_pages;
- rc = bnxt_read_sfp_module_eeprom_info(bp, I2C_DEV_ADDR_A0, 0,
+ rc = bnxt_read_sfp_module_eeprom_info(bp, I2C_DEV_ADDR_A0, 0, 0,
+ false,
SFF8636_OPT_PAGES_OFFSET,
1, &opt_pages);
if (rc)
@@ -3330,7 +3335,8 @@ static int bnxt_get_module_eeprom(struct net_device *dev,
if (pg_addr[page]) {
rc = bnxt_read_sfp_module_eeprom_info(bp, pg_addr[page],
- raw_page, offset,
+ raw_page, 0,
+ false, offset,
chunk, data);
if (rc)
return rc;