cxgbe(4): Do not read MFG diags information from custom boards.

MFC after:	1 week
Sponsored by:	Chelsio Communications
This commit is contained in:
Navdeep Parhar 2018-03-22 04:42:29 +00:00
parent 9afece1e2f
commit 1b4df78b42

View File

@ -2960,7 +2960,7 @@ static int get_vpd_keyword_val(const u8 *vpd, const char *kw, int region)
* Reads card parameters stored in VPD EEPROM.
*/
static int get_vpd_params(struct adapter *adapter, struct vpd_params *p,
u32 *buf)
uint16_t device_id, u32 *buf)
{
int i, ret, addr;
int ec, sn, pn, na, md;
@ -3028,12 +3028,16 @@ static int get_vpd_params(struct adapter *adapter, struct vpd_params *p,
memcpy(p->na, vpd + na, min(i, MACADDR_LEN));
strstrip((char *)p->na);
if (device_id & 0x80)
return 0; /* Custom card */
md = get_vpd_keyword_val(vpd, "VF", 1);
if (md < 0) {
snprintf(p->md, sizeof(p->md), "unknown");
} else {
i = vpd[md - VPD_INFO_FLD_HDR_SIZE + 2];
memcpy(p->md, vpd + md, min(i, MD_LEN));
strstrip((char *)p->md);
}
return 0;
@ -8053,10 +8057,6 @@ int t4_prep_adapter(struct adapter *adapter, u32 *buf)
if (ret < 0)
return ret;
ret = get_vpd_params(adapter, &adapter->params.vpd, buf);
if (ret < 0)
return ret;
/* Cards with real ASICs have the chipid in the PCIe device id */
t4_os_pci_read_cfg2(adapter, PCI_DEVICE_ID, &device_id);
if (device_id >> 12 == chip_id(adapter))
@ -8067,6 +8067,10 @@ int t4_prep_adapter(struct adapter *adapter, u32 *buf)
adapter->params.cim_la_size = 2 * CIMLA_SIZE;
}
ret = get_vpd_params(adapter, &adapter->params.vpd, device_id, buf);
if (ret < 0)
return ret;
init_cong_ctrl(adapter->params.a_wnd, adapter->params.b_wnd);
/*