From: Daniel Pieczko Date: Tue, 5 May 2015 23:56:55 +0000 (+0100) Subject: sfc: Record [rt]x_dpcpu_fw_id in EF10 nic_data X-Git-Tag: omap-for-v4.2/fixes-rc1^2~134^2~352^2~9 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8d9f9dd4487e4792601759b4376441bcc9e54f95;p=pandora-kernel.git sfc: Record [rt]x_dpcpu_fw_id in EF10 nic_data The (future) code to add/remove vswitches and vports will be dependent on the firmware variant. To simplify the checking of the firmware variant, record values for rx_dpcpu_fw_id and tx_dpcpu_fw_id in EF10 nic_data. There was only one place where this was previously used: efx_mcdi_print_fwver() in ethtool.c. The MC_CMD_GET_CAPABILITIES can be replaced and the values from nic_data used instead. Note that the printing of "?" if the MC command fails or if the outlength is incorrect no longer apply, because errors are returned in efx_ef10_init_datapath_caps() in both of these cases. Signed-off-by: Shradha Shah Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/sfc/ef10.c b/drivers/net/ethernet/sfc/ef10.c index ad2301861609..4f9775f6126a 100644 --- a/drivers/net/ethernet/sfc/ef10.c +++ b/drivers/net/ethernet/sfc/ef10.c @@ -118,6 +118,13 @@ static int efx_ef10_init_datapath_caps(struct efx_nic *efx) nic_data->datapath_caps = MCDI_DWORD(outbuf, GET_CAPABILITIES_OUT_FLAGS1); + /* record the DPCPU firmware IDs to determine VEB vswitching support. + */ + nic_data->rx_dpcpu_fw_id = + MCDI_WORD(outbuf, GET_CAPABILITIES_OUT_RX_DPCPU_FW_ID); + nic_data->tx_dpcpu_fw_id = + MCDI_WORD(outbuf, GET_CAPABILITIES_OUT_TX_DPCPU_FW_ID); + if (!(nic_data->datapath_caps & (1 << MC_CMD_GET_CAPABILITIES_OUT_TX_TSO_LBN))) { netif_err(efx, drv, efx->net_dev, Reading git-diff-tree failed