Commit 6ee080bb authored by Sriharsha Basavapatna's avatar Sriharsha Basavapatna Committed by David S. Miller

be2net: Provide an alternate way to read pf_num for BEx chips

The driver gets the pf_num for Skyhawk and Lancer using
GET_FUNC_CONFIG FW command. But since that command is not
supported in BEx, we need to get it from some other command.
Otherwise TPE recovery would fail since all NIC PFs would
end up with a func num of 0. There's a pci function number
field in the response  of GET_CNTL_ATTRIBUTES command that
can be read to get the same info for BEx adapters.
Signed-off-by: default avatarSriharsha Basavapatna <sriharsha.basavapatna@broadcom.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2f7c68d8
...@@ -3527,6 +3527,11 @@ int be_cmd_get_cntl_attributes(struct be_adapter *adapter) ...@@ -3527,6 +3527,11 @@ int be_cmd_get_cntl_attributes(struct be_adapter *adapter)
for (i = 0; i < CNTL_SERIAL_NUM_WORDS; i++) for (i = 0; i < CNTL_SERIAL_NUM_WORDS; i++)
adapter->serial_num[i] = le32_to_cpu(serial_num[i]) & adapter->serial_num[i] = le32_to_cpu(serial_num[i]) &
(BIT_MASK(16) - 1); (BIT_MASK(16) - 1);
/* For BEx, since GET_FUNC_CONFIG command is not
* supported, we read funcnum here as a workaround.
*/
if (BEx_chip(adapter))
adapter->pf_num = attribs->hba_attribs.pci_funcnum;
} }
err: err:
......
...@@ -1720,7 +1720,11 @@ struct mgmt_hba_attribs { ...@@ -1720,7 +1720,11 @@ struct mgmt_hba_attribs {
u32 rsvd2[55]; u32 rsvd2[55];
u8 rsvd3[3]; u8 rsvd3[3];
u8 phy_port; u8 phy_port;
u32 rsvd4[13]; u32 rsvd4[15];
u8 rsvd5[2];
u8 pci_funcnum;
u8 rsvd6;
u32 rsvd7[6];
} __packed; } __packed;
struct mgmt_controller_attrib { struct mgmt_controller_attrib {
......
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