Commit 9e860947 authored by Vijay Khemka's avatar Vijay Khemka Committed by David S. Miller

net/ncsi: Fix gma flag setting after response

gma_flag was set at the time of GMA command request but it should
only be set after getting successful response. Movinng this flag
setting in GMA response handler.

This flag is used mainly for not repeating GMA command once
received MAC address.
Signed-off-by: default avatarVijay Khemka <vijaykhemka@fb.com>
Reviewed-by: default avatarSamuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent f398efc1
...@@ -764,9 +764,6 @@ static int ncsi_gma_handler(struct ncsi_cmd_arg *nca, unsigned int mf_id) ...@@ -764,9 +764,6 @@ static int ncsi_gma_handler(struct ncsi_cmd_arg *nca, unsigned int mf_id)
return -1; return -1;
} }
/* Set the flag for GMA command which should only be called once */
nca->ndp->gma_flag = 1;
/* Get Mac address from NCSI device */ /* Get Mac address from NCSI device */
return nch->handler(nca); return nch->handler(nca);
} }
......
...@@ -627,6 +627,9 @@ static int ncsi_rsp_handler_oem_mlx_gma(struct ncsi_request *nr) ...@@ -627,6 +627,9 @@ static int ncsi_rsp_handler_oem_mlx_gma(struct ncsi_request *nr)
saddr.sa_family = ndev->type; saddr.sa_family = ndev->type;
ndev->priv_flags |= IFF_LIVE_ADDR_CHANGE; ndev->priv_flags |= IFF_LIVE_ADDR_CHANGE;
memcpy(saddr.sa_data, &rsp->data[MLX_MAC_ADDR_OFFSET], ETH_ALEN); memcpy(saddr.sa_data, &rsp->data[MLX_MAC_ADDR_OFFSET], ETH_ALEN);
/* Set the flag for GMA command which should only be called once */
ndp->gma_flag = 1;
ret = ops->ndo_set_mac_address(ndev, &saddr); ret = ops->ndo_set_mac_address(ndev, &saddr);
if (ret < 0) if (ret < 0)
netdev_warn(ndev, "NCSI: 'Writing mac address to device failed\n"); netdev_warn(ndev, "NCSI: 'Writing mac address to device failed\n");
...@@ -671,6 +674,9 @@ static int ncsi_rsp_handler_oem_bcm_gma(struct ncsi_request *nr) ...@@ -671,6 +674,9 @@ static int ncsi_rsp_handler_oem_bcm_gma(struct ncsi_request *nr)
if (!is_valid_ether_addr((const u8 *)saddr.sa_data)) if (!is_valid_ether_addr((const u8 *)saddr.sa_data))
return -ENXIO; return -ENXIO;
/* Set the flag for GMA command which should only be called once */
ndp->gma_flag = 1;
ret = ops->ndo_set_mac_address(ndev, &saddr); ret = ops->ndo_set_mac_address(ndev, &saddr);
if (ret < 0) if (ret < 0)
netdev_warn(ndev, "NCSI: 'Writing mac address to device failed\n"); netdev_warn(ndev, "NCSI: 'Writing mac address to device failed\n");
......
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