Commit a94cd705 authored by Kumar Sanghvi's avatar Kumar Sanghvi Committed by David S. Miller

cxgb4: Print adapter VPD Part Number instead of Engineering Change field

When we attach to adapter, print VPD Part Number instead of Engineering Change field.
Based on original work by Casey Leedom <leedom@chelsio.com>
Signed-off-by: default avatarKumar Sanghvi <kumaras@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 72aca4bf
...@@ -66,6 +66,7 @@ enum { ...@@ -66,6 +66,7 @@ enum {
SERNUM_LEN = 24, /* Serial # length */ SERNUM_LEN = 24, /* Serial # length */
EC_LEN = 16, /* E/C length */ EC_LEN = 16, /* E/C length */
ID_LEN = 16, /* ID length */ ID_LEN = 16, /* ID length */
PN_LEN = 16, /* Part Number length */
}; };
enum { enum {
...@@ -254,6 +255,7 @@ struct vpd_params { ...@@ -254,6 +255,7 @@ struct vpd_params {
u8 ec[EC_LEN + 1]; u8 ec[EC_LEN + 1];
u8 sn[SERNUM_LEN + 1]; u8 sn[SERNUM_LEN + 1];
u8 id[ID_LEN + 1]; u8 id[ID_LEN + 1];
u8 pn[PN_LEN + 1];
}; };
struct pci_params { struct pci_params {
......
...@@ -5839,8 +5839,8 @@ static void print_port_info(const struct net_device *dev) ...@@ -5839,8 +5839,8 @@ static void print_port_info(const struct net_device *dev)
is_offload(adap) ? "R" : "", adap->params.pci.width, spd, is_offload(adap) ? "R" : "", adap->params.pci.width, spd,
(adap->flags & USING_MSIX) ? " MSI-X" : (adap->flags & USING_MSIX) ? " MSI-X" :
(adap->flags & USING_MSI) ? " MSI" : ""); (adap->flags & USING_MSI) ? " MSI" : "");
netdev_info(dev, "S/N: %s, E/C: %s\n", netdev_info(dev, "S/N: %s, P/N: %s\n",
adap->params.vpd.sn, adap->params.vpd.ec); adap->params.vpd.sn, adap->params.vpd.pn);
} }
static void enable_pcie_relaxed_ordering(struct pci_dev *dev) static void enable_pcie_relaxed_ordering(struct pci_dev *dev)
......
...@@ -573,7 +573,7 @@ int get_vpd_params(struct adapter *adapter, struct vpd_params *p) ...@@ -573,7 +573,7 @@ int get_vpd_params(struct adapter *adapter, struct vpd_params *p)
{ {
u32 cclk_param, cclk_val; u32 cclk_param, cclk_val;
int i, ret, addr; int i, ret, addr;
int ec, sn; int ec, sn, pn;
u8 *vpd, csum; u8 *vpd, csum;
unsigned int vpdr_len, kw_offset, id_len; unsigned int vpdr_len, kw_offset, id_len;
...@@ -638,6 +638,7 @@ int get_vpd_params(struct adapter *adapter, struct vpd_params *p) ...@@ -638,6 +638,7 @@ int get_vpd_params(struct adapter *adapter, struct vpd_params *p)
FIND_VPD_KW(ec, "EC"); FIND_VPD_KW(ec, "EC");
FIND_VPD_KW(sn, "SN"); FIND_VPD_KW(sn, "SN");
FIND_VPD_KW(pn, "PN");
#undef FIND_VPD_KW #undef FIND_VPD_KW
memcpy(p->id, vpd + PCI_VPD_LRDT_TAG_SIZE, id_len); memcpy(p->id, vpd + PCI_VPD_LRDT_TAG_SIZE, id_len);
...@@ -647,6 +648,8 @@ int get_vpd_params(struct adapter *adapter, struct vpd_params *p) ...@@ -647,6 +648,8 @@ int get_vpd_params(struct adapter *adapter, struct vpd_params *p)
i = pci_vpd_info_field_size(vpd + sn - PCI_VPD_INFO_FLD_HDR_SIZE); i = pci_vpd_info_field_size(vpd + sn - PCI_VPD_INFO_FLD_HDR_SIZE);
memcpy(p->sn, vpd + sn, min(i, SERNUM_LEN)); memcpy(p->sn, vpd + sn, min(i, SERNUM_LEN));
strim(p->sn); strim(p->sn);
memcpy(p->pn, vpd + pn, min(i, PN_LEN));
strim(p->pn);
/* /*
* Ask firmware for the Core Clock since it knows how to translate the * Ask firmware for the Core Clock since it knows how to translate the
......
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