Commit f8617e08 authored by Ajit Khaparde's avatar Ajit Khaparde Committed by David S. Miller

be2net: pass domain numbers for pmac_add/del functions

be_cmd_pmac_add/del functions need to pass domain number to the firmware.
Signed-off-by: default avatarAjit Khaparde <ajit.khaparde@emulex.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7a2414a5
...@@ -598,7 +598,7 @@ int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr, ...@@ -598,7 +598,7 @@ int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr,
/* Uses synchronous MCCQ */ /* Uses synchronous MCCQ */
int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr, int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr,
u32 if_id, u32 *pmac_id) u32 if_id, u32 *pmac_id, u32 domain)
{ {
struct be_mcc_wrb *wrb; struct be_mcc_wrb *wrb;
struct be_cmd_req_pmac_add *req; struct be_cmd_req_pmac_add *req;
...@@ -619,6 +619,7 @@ int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr, ...@@ -619,6 +619,7 @@ int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr,
be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
OPCODE_COMMON_NTWK_PMAC_ADD, sizeof(*req)); OPCODE_COMMON_NTWK_PMAC_ADD, sizeof(*req));
req->hdr.domain = domain;
req->if_id = cpu_to_le32(if_id); req->if_id = cpu_to_le32(if_id);
memcpy(req->mac_address, mac_addr, ETH_ALEN); memcpy(req->mac_address, mac_addr, ETH_ALEN);
...@@ -634,7 +635,7 @@ int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr, ...@@ -634,7 +635,7 @@ int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr,
} }
/* Uses synchronous MCCQ */ /* Uses synchronous MCCQ */
int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id, u32 pmac_id) int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id, u32 pmac_id, u32 dom)
{ {
struct be_mcc_wrb *wrb; struct be_mcc_wrb *wrb;
struct be_cmd_req_pmac_del *req; struct be_cmd_req_pmac_del *req;
...@@ -655,6 +656,7 @@ int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id, u32 pmac_id) ...@@ -655,6 +656,7 @@ int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id, u32 pmac_id)
be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
OPCODE_COMMON_NTWK_PMAC_DEL, sizeof(*req)); OPCODE_COMMON_NTWK_PMAC_DEL, sizeof(*req));
req->hdr.domain = dom;
req->if_id = cpu_to_le32(if_id); req->if_id = cpu_to_le32(if_id);
req->pmac_id = cpu_to_le32(pmac_id); req->pmac_id = cpu_to_le32(pmac_id);
......
...@@ -999,8 +999,9 @@ extern int be_cmd_POST(struct be_adapter *adapter); ...@@ -999,8 +999,9 @@ extern int be_cmd_POST(struct be_adapter *adapter);
extern int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr, extern int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr,
u8 type, bool permanent, u32 if_handle); u8 type, bool permanent, u32 if_handle);
extern int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr, extern int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr,
u32 if_id, u32 *pmac_id); u32 if_id, u32 *pmac_id, u32 domain);
extern int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id, u32 pmac_id); extern int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id,
u32 pmac_id, u32 domain);
extern int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags, extern int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags,
u32 en_flags, u8 *mac, bool pmac_invalid, u32 en_flags, u8 *mac, bool pmac_invalid,
u32 *if_handle, u32 *pmac_id, u32 domain); u32 *if_handle, u32 *pmac_id, u32 domain);
......
...@@ -236,12 +236,13 @@ static int be_mac_addr_set(struct net_device *netdev, void *p) ...@@ -236,12 +236,13 @@ static int be_mac_addr_set(struct net_device *netdev, void *p)
if (!be_physfn(adapter)) if (!be_physfn(adapter))
goto netdev_addr; goto netdev_addr;
status = be_cmd_pmac_del(adapter, adapter->if_handle, adapter->pmac_id); status = be_cmd_pmac_del(adapter, adapter->if_handle,
adapter->pmac_id, 0);
if (status) if (status)
return status; return status;
status = be_cmd_pmac_add(adapter, (u8 *)addr->sa_data, status = be_cmd_pmac_add(adapter, (u8 *)addr->sa_data,
adapter->if_handle, &adapter->pmac_id); adapter->if_handle, &adapter->pmac_id, 0);
netdev_addr: netdev_addr:
if (!status) if (!status)
memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len);
...@@ -741,11 +742,11 @@ static int be_set_vf_mac(struct net_device *netdev, int vf, u8 *mac) ...@@ -741,11 +742,11 @@ static int be_set_vf_mac(struct net_device *netdev, int vf, u8 *mac)
if (adapter->vf_cfg[vf].vf_pmac_id != BE_INVALID_PMAC_ID) if (adapter->vf_cfg[vf].vf_pmac_id != BE_INVALID_PMAC_ID)
status = be_cmd_pmac_del(adapter, status = be_cmd_pmac_del(adapter,
adapter->vf_cfg[vf].vf_if_handle, adapter->vf_cfg[vf].vf_if_handle,
adapter->vf_cfg[vf].vf_pmac_id); adapter->vf_cfg[vf].vf_pmac_id, vf + 1);
status = be_cmd_pmac_add(adapter, mac, status = be_cmd_pmac_add(adapter, mac,
adapter->vf_cfg[vf].vf_if_handle, adapter->vf_cfg[vf].vf_if_handle,
&adapter->vf_cfg[vf].vf_pmac_id); &adapter->vf_cfg[vf].vf_pmac_id, vf + 1);
if (status) if (status)
dev_err(&adapter->pdev->dev, "MAC %pM set on VF %d Failed\n", dev_err(&adapter->pdev->dev, "MAC %pM set on VF %d Failed\n",
...@@ -2225,7 +2226,8 @@ static inline int be_vf_eth_addr_config(struct be_adapter *adapter) ...@@ -2225,7 +2226,8 @@ static inline int be_vf_eth_addr_config(struct be_adapter *adapter)
for (vf = 0; vf < num_vfs; vf++) { for (vf = 0; vf < num_vfs; vf++) {
status = be_cmd_pmac_add(adapter, mac, status = be_cmd_pmac_add(adapter, mac,
adapter->vf_cfg[vf].vf_if_handle, adapter->vf_cfg[vf].vf_if_handle,
&adapter->vf_cfg[vf].vf_pmac_id); &adapter->vf_cfg[vf].vf_pmac_id,
vf + 1);
if (status) if (status)
dev_err(&adapter->pdev->dev, dev_err(&adapter->pdev->dev,
"Mac address add failed for VF %d\n", vf); "Mac address add failed for VF %d\n", vf);
...@@ -2245,7 +2247,7 @@ static inline void be_vf_eth_addr_rem(struct be_adapter *adapter) ...@@ -2245,7 +2247,7 @@ static inline void be_vf_eth_addr_rem(struct be_adapter *adapter)
if (adapter->vf_cfg[vf].vf_pmac_id != BE_INVALID_PMAC_ID) if (adapter->vf_cfg[vf].vf_pmac_id != BE_INVALID_PMAC_ID)
be_cmd_pmac_del(adapter, be_cmd_pmac_del(adapter,
adapter->vf_cfg[vf].vf_if_handle, adapter->vf_cfg[vf].vf_if_handle,
adapter->vf_cfg[vf].vf_pmac_id); adapter->vf_cfg[vf].vf_pmac_id, vf + 1);
} }
} }
......
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