diff options
author | Sathya Perla <sathya.perla@emulex.com> | 2013-07-23 15:25:02 +0530 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-07-24 15:41:52 -0700 |
commit | 95046b927a54f461766f83a212c6a93bc5fd2e67 (patch) | |
tree | 0d5518d5ca12bcd2d9a32740b42eac13049e7b9c /drivers/net/ethernet/emulex/benet/be_cmds.c | |
parent | b5bb9776b143dcf7931c6e00330bf8d518376760 (diff) | |
download | blackbird-op-linux-95046b927a54f461766f83a212c6a93bc5fd2e67.tar.gz blackbird-op-linux-95046b927a54f461766f83a212c6a93bc5fd2e67.zip |
be2net: refactor MAC-addr setup code
The code to configure the permanent MAC in be_setup() has become quite
complicated, with different FW cmds being used for BEx, SH-R and Lancer.
Simplify the logic by moving some of this complexity to be_cmds.c. This
makes the code in be_setup() a little more readable.
Signed-off-by: Sathya Perla <sathya.perla@emulex.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/emulex/benet/be_cmds.c')
-rw-r--r-- | drivers/net/ethernet/emulex/benet/be_cmds.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/ethernet/emulex/benet/be_cmds.c b/drivers/net/ethernet/emulex/benet/be_cmds.c index b384ae7c9da5..f4ee94eb0c19 100644 --- a/drivers/net/ethernet/emulex/benet/be_cmds.c +++ b/drivers/net/ethernet/emulex/benet/be_cmds.c @@ -2755,6 +2755,24 @@ int be_cmd_get_active_mac(struct be_adapter *adapter, u32 curr_pmac_id, u8 *mac) } } +int be_cmd_get_perm_mac(struct be_adapter *adapter, u8 *mac) +{ + int status; + bool pmac_valid = false; + + memset(mac, 0, ETH_ALEN); + + if (lancer_chip(adapter)) + status = be_cmd_get_mac_from_list(adapter, mac, &pmac_valid, + NULL, 0); + else if (be_physfn(adapter)) + status = be_cmd_mac_addr_query(adapter, mac, true, 0, 0); + else + status = be_cmd_mac_addr_query(adapter, mac, false, + adapter->if_handle, 0); + return status; +} + /* Uses synchronous MCCQ */ int be_cmd_set_mac_list(struct be_adapter *adapter, u8 *mac_array, u8 mac_count, u32 domain) |