From 7e7d5b067fc882a9a5f324f95f729737573a3979 Mon Sep 17 00:00:00 2001 From: Ben Hutchings Date: Fri, 7 Sep 2012 00:58:10 +0100 Subject: [PATCH] --- yaml --- r: 328013 b: refs/heads/master c: bfeed902946a31692e7a24ed355b6d13ac37d014 h: refs/heads/master i: 328011: d2c4ba6e9574edb6a89a290de824f0b62fe36420 v: v3 --- [refs] | 2 +- trunk/drivers/net/ethernet/sfc/mcdi.c | 18 +++++++++++------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/[refs] b/[refs] index 18056ca43868..86a7a0b1c4c8 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 7c236c43b838221e17220bcb39e8e8d8c7123713 +refs/heads/master: bfeed902946a31692e7a24ed355b6d13ac37d014 diff --git a/trunk/drivers/net/ethernet/sfc/mcdi.c b/trunk/drivers/net/ethernet/sfc/mcdi.c index 294df4bca4a6..578e5f72aabe 100644 --- a/trunk/drivers/net/ethernet/sfc/mcdi.c +++ b/trunk/drivers/net/ethernet/sfc/mcdi.c @@ -661,9 +661,8 @@ int efx_mcdi_get_board_cfg(struct efx_nic *efx, u8 *mac_address, u16 *fw_subtype_list, u32 *capabilities) { uint8_t outbuf[MC_CMD_GET_BOARD_CFG_OUT_LENMIN]; - size_t outlen; + size_t outlen, offset, i; int port_num = efx_port_num(efx); - int offset; int rc; BUILD_BUG_ON(MC_CMD_GET_BOARD_CFG_IN_LEN != 0); @@ -683,11 +682,16 @@ int efx_mcdi_get_board_cfg(struct efx_nic *efx, u8 *mac_address, : MC_CMD_GET_BOARD_CFG_OUT_MAC_ADDR_BASE_PORT0_OFST; if (mac_address) memcpy(mac_address, outbuf + offset, ETH_ALEN); - if (fw_subtype_list) - memcpy(fw_subtype_list, - outbuf + MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_OFST, - MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_MINNUM * - sizeof(fw_subtype_list[0])); + if (fw_subtype_list) { + offset = MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_OFST; + for (i = 0; + i < MC_CMD_GET_BOARD_CFG_OUT_FW_SUBTYPE_LIST_MINNUM; + i++) { + fw_subtype_list[i] = + le16_to_cpup((__le16 *)(outbuf + offset)); + offset += 2; + } + } if (capabilities) { if (port_num) *capabilities = MCDI_DWORD(outbuf,