diff options
author | Ajit Khaparde <ajit.khaparde@emulex.com> | 2011-02-11 08:36:37 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-02-12 00:14:46 -0500 |
commit | f8617e0860f2b23797431b5ec3a46668eb0f7925 (patch) | |
tree | 38543c8ababc3d0bdce8e59da6a6ae15ce59d6af | |
parent | 7a2414a50b071d84dae8fbca51d10009e07e535f (diff) |
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: Ajit Khaparde <ajit.khaparde@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/benet/be_cmds.c | 6 | ||||
-rw-r--r-- | drivers/net/benet/be_cmds.h | 5 | ||||
-rw-r--r-- | drivers/net/benet/be_main.c | 14 |
3 files changed, 15 insertions, 10 deletions
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c index be2981aa5857..277982babc11 100644 --- a/drivers/net/benet/be_cmds.c +++ b/drivers/net/benet/be_cmds.c | |||
@@ -598,7 +598,7 @@ int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr, | |||
598 | 598 | ||
599 | /* Uses synchronous MCCQ */ | 599 | /* Uses synchronous MCCQ */ |
600 | int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr, | 600 | int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr, |
601 | u32 if_id, u32 *pmac_id) | 601 | u32 if_id, u32 *pmac_id, u32 domain) |
602 | { | 602 | { |
603 | struct be_mcc_wrb *wrb; | 603 | struct be_mcc_wrb *wrb; |
604 | struct be_cmd_req_pmac_add *req; | 604 | struct be_cmd_req_pmac_add *req; |
@@ -619,6 +619,7 @@ int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr, | |||
619 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, | 619 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, |
620 | OPCODE_COMMON_NTWK_PMAC_ADD, sizeof(*req)); | 620 | OPCODE_COMMON_NTWK_PMAC_ADD, sizeof(*req)); |
621 | 621 | ||
622 | req->hdr.domain = domain; | ||
622 | req->if_id = cpu_to_le32(if_id); | 623 | req->if_id = cpu_to_le32(if_id); |
623 | memcpy(req->mac_address, mac_addr, ETH_ALEN); | 624 | memcpy(req->mac_address, mac_addr, ETH_ALEN); |
624 | 625 | ||
@@ -634,7 +635,7 @@ err: | |||
634 | } | 635 | } |
635 | 636 | ||
636 | /* Uses synchronous MCCQ */ | 637 | /* Uses synchronous MCCQ */ |
637 | int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id, u32 pmac_id) | 638 | int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id, u32 pmac_id, u32 dom) |
638 | { | 639 | { |
639 | struct be_mcc_wrb *wrb; | 640 | struct be_mcc_wrb *wrb; |
640 | struct be_cmd_req_pmac_del *req; | 641 | 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 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, | 656 | be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, |
656 | OPCODE_COMMON_NTWK_PMAC_DEL, sizeof(*req)); | 657 | OPCODE_COMMON_NTWK_PMAC_DEL, sizeof(*req)); |
657 | 658 | ||
659 | req->hdr.domain = dom; | ||
658 | req->if_id = cpu_to_le32(if_id); | 660 | req->if_id = cpu_to_le32(if_id); |
659 | req->pmac_id = cpu_to_le32(pmac_id); | 661 | req->pmac_id = cpu_to_le32(pmac_id); |
660 | 662 | ||
diff --git a/drivers/net/benet/be_cmds.h b/drivers/net/benet/be_cmds.h index 02540bd9569d..91c5d2b09aa1 100644 --- a/drivers/net/benet/be_cmds.h +++ b/drivers/net/benet/be_cmds.h | |||
@@ -999,8 +999,9 @@ extern int be_cmd_POST(struct be_adapter *adapter); | |||
999 | extern int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr, | 999 | extern int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr, |
1000 | u8 type, bool permanent, u32 if_handle); | 1000 | u8 type, bool permanent, u32 if_handle); |
1001 | extern int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr, | 1001 | extern int be_cmd_pmac_add(struct be_adapter *adapter, u8 *mac_addr, |
1002 | u32 if_id, u32 *pmac_id); | 1002 | u32 if_id, u32 *pmac_id, u32 domain); |
1003 | extern int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id, u32 pmac_id); | 1003 | extern int be_cmd_pmac_del(struct be_adapter *adapter, u32 if_id, |
1004 | u32 pmac_id, u32 domain); | ||
1004 | extern int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags, | 1005 | extern int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags, |
1005 | u32 en_flags, u8 *mac, bool pmac_invalid, | 1006 | u32 en_flags, u8 *mac, bool pmac_invalid, |
1006 | u32 *if_handle, u32 *pmac_id, u32 domain); | 1007 | u32 *if_handle, u32 *pmac_id, u32 domain); |
diff --git a/drivers/net/benet/be_main.c b/drivers/net/benet/be_main.c index fc119d1f542b..f2d203637846 100644 --- a/drivers/net/benet/be_main.c +++ b/drivers/net/benet/be_main.c | |||
@@ -236,12 +236,13 @@ static int be_mac_addr_set(struct net_device *netdev, void *p) | |||
236 | if (!be_physfn(adapter)) | 236 | if (!be_physfn(adapter)) |
237 | goto netdev_addr; | 237 | goto netdev_addr; |
238 | 238 | ||
239 | status = be_cmd_pmac_del(adapter, adapter->if_handle, adapter->pmac_id); | 239 | status = be_cmd_pmac_del(adapter, adapter->if_handle, |
240 | adapter->pmac_id, 0); | ||
240 | if (status) | 241 | if (status) |
241 | return status; | 242 | return status; |
242 | 243 | ||
243 | status = be_cmd_pmac_add(adapter, (u8 *)addr->sa_data, | 244 | status = be_cmd_pmac_add(adapter, (u8 *)addr->sa_data, |
244 | adapter->if_handle, &adapter->pmac_id); | 245 | adapter->if_handle, &adapter->pmac_id, 0); |
245 | netdev_addr: | 246 | netdev_addr: |
246 | if (!status) | 247 | if (!status) |
247 | memcpy(netdev->dev_addr, addr->sa_data, netdev->addr_len); | 248 | 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 | if (adapter->vf_cfg[vf].vf_pmac_id != BE_INVALID_PMAC_ID) | 742 | if (adapter->vf_cfg[vf].vf_pmac_id != BE_INVALID_PMAC_ID) |
742 | status = be_cmd_pmac_del(adapter, | 743 | status = be_cmd_pmac_del(adapter, |
743 | adapter->vf_cfg[vf].vf_if_handle, | 744 | adapter->vf_cfg[vf].vf_if_handle, |
744 | adapter->vf_cfg[vf].vf_pmac_id); | 745 | adapter->vf_cfg[vf].vf_pmac_id, vf + 1); |
745 | 746 | ||
746 | status = be_cmd_pmac_add(adapter, mac, | 747 | status = be_cmd_pmac_add(adapter, mac, |
747 | adapter->vf_cfg[vf].vf_if_handle, | 748 | adapter->vf_cfg[vf].vf_if_handle, |
748 | &adapter->vf_cfg[vf].vf_pmac_id); | 749 | &adapter->vf_cfg[vf].vf_pmac_id, vf + 1); |
749 | 750 | ||
750 | if (status) | 751 | if (status) |
751 | dev_err(&adapter->pdev->dev, "MAC %pM set on VF %d Failed\n", | 752 | 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 | for (vf = 0; vf < num_vfs; vf++) { | 2226 | for (vf = 0; vf < num_vfs; vf++) { |
2226 | status = be_cmd_pmac_add(adapter, mac, | 2227 | status = be_cmd_pmac_add(adapter, mac, |
2227 | adapter->vf_cfg[vf].vf_if_handle, | 2228 | adapter->vf_cfg[vf].vf_if_handle, |
2228 | &adapter->vf_cfg[vf].vf_pmac_id); | 2229 | &adapter->vf_cfg[vf].vf_pmac_id, |
2230 | vf + 1); | ||
2229 | if (status) | 2231 | if (status) |
2230 | dev_err(&adapter->pdev->dev, | 2232 | dev_err(&adapter->pdev->dev, |
2231 | "Mac address add failed for VF %d\n", vf); | 2233 | "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 | if (adapter->vf_cfg[vf].vf_pmac_id != BE_INVALID_PMAC_ID) | 2247 | if (adapter->vf_cfg[vf].vf_pmac_id != BE_INVALID_PMAC_ID) |
2246 | be_cmd_pmac_del(adapter, | 2248 | be_cmd_pmac_del(adapter, |
2247 | adapter->vf_cfg[vf].vf_if_handle, | 2249 | adapter->vf_cfg[vf].vf_if_handle, |
2248 | adapter->vf_cfg[vf].vf_pmac_id); | 2250 | adapter->vf_cfg[vf].vf_pmac_id, vf + 1); |
2249 | } | 2251 | } |
2250 | } | 2252 | } |
2251 | 2253 | ||