diff options
Diffstat (limited to 'drivers/net/ethernet/intel/ice/ice_common.c')
-rw-r--r-- | drivers/net/ethernet/intel/ice/ice_common.c | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/drivers/net/ethernet/intel/ice/ice_common.c b/drivers/net/ethernet/intel/ice/ice_common.c index 21977ec984c4..71d032cc5fa7 100644 --- a/drivers/net/ethernet/intel/ice/ice_common.c +++ b/drivers/net/ethernet/intel/ice/ice_common.c | |||
@@ -78,6 +78,7 @@ ice_aq_manage_mac_read(struct ice_hw *hw, void *buf, u16 buf_size, | |||
78 | struct ice_aq_desc desc; | 78 | struct ice_aq_desc desc; |
79 | enum ice_status status; | 79 | enum ice_status status; |
80 | u16 flags; | 80 | u16 flags; |
81 | u8 i; | ||
81 | 82 | ||
82 | cmd = &desc.params.mac_read; | 83 | cmd = &desc.params.mac_read; |
83 | 84 | ||
@@ -98,8 +99,16 @@ ice_aq_manage_mac_read(struct ice_hw *hw, void *buf, u16 buf_size, | |||
98 | return ICE_ERR_CFG; | 99 | return ICE_ERR_CFG; |
99 | } | 100 | } |
100 | 101 | ||
101 | ether_addr_copy(hw->port_info->mac.lan_addr, resp->mac_addr); | 102 | /* A single port can report up to two (LAN and WoL) addresses */ |
102 | ether_addr_copy(hw->port_info->mac.perm_addr, resp->mac_addr); | 103 | for (i = 0; i < cmd->num_addr; i++) |
104 | if (resp[i].addr_type == ICE_AQC_MAN_MAC_ADDR_TYPE_LAN) { | ||
105 | ether_addr_copy(hw->port_info->mac.lan_addr, | ||
106 | resp[i].mac_addr); | ||
107 | ether_addr_copy(hw->port_info->mac.perm_addr, | ||
108 | resp[i].mac_addr); | ||
109 | break; | ||
110 | } | ||
111 | |||
103 | return 0; | 112 | return 0; |
104 | } | 113 | } |
105 | 114 | ||
@@ -464,9 +473,12 @@ enum ice_status ice_init_hw(struct ice_hw *hw) | |||
464 | if (status) | 473 | if (status) |
465 | goto err_unroll_sched; | 474 | goto err_unroll_sched; |
466 | 475 | ||
467 | /* Get port MAC information */ | 476 | /* Get MAC information */ |
468 | mac_buf_len = sizeof(struct ice_aqc_manage_mac_read_resp); | 477 | /* A single port can report up to two (LAN and WoL) addresses */ |
469 | mac_buf = devm_kzalloc(ice_hw_to_dev(hw), mac_buf_len, GFP_KERNEL); | 478 | mac_buf = devm_kcalloc(ice_hw_to_dev(hw), 2, |
479 | sizeof(struct ice_aqc_manage_mac_read_resp), | ||
480 | GFP_KERNEL); | ||
481 | mac_buf_len = 2 * sizeof(struct ice_aqc_manage_mac_read_resp); | ||
470 | 482 | ||
471 | if (!mac_buf) { | 483 | if (!mac_buf) { |
472 | status = ICE_ERR_NO_MEMORY; | 484 | status = ICE_ERR_NO_MEMORY; |