aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/benet/be_cmds.c
diff options
context:
space:
mode:
authorSathya Perla <sathyap@serverengines.com>2009-06-17 20:09:25 -0400
committerDavid S. Miller <davem@davemloft.net>2009-06-19 03:18:41 -0400
commit24307eef74bd38e3fc6a6df8f8a1bfc48967f9f6 (patch)
tree86583877a2178f8ea1baff35e2262a6b1de8bd58 /drivers/net/benet/be_cmds.c
parent6ac7b687cb3acc437a586794949a43f5249956bb (diff)
be2net: cleanup multicast_set cmd to avoid mc_list copy
Cleanup multicast_set method to avoid an extra copy of mc_list and unwanted promiscuos sets to BE. Signed-off-by: Sathya Perla <sathyap@serverengines.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/benet/be_cmds.c')
-rw-r--r--drivers/net/benet/be_cmds.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/drivers/net/benet/be_cmds.c b/drivers/net/benet/be_cmds.c
index e4ad5e67fde7..4a2e1f518f78 100644
--- a/drivers/net/benet/be_cmds.c
+++ b/drivers/net/benet/be_cmds.c
@@ -927,8 +927,8 @@ int be_cmd_promiscuous_config(struct be_ctrl_info *ctrl, u8 port_num, bool en)
927 * Use MCC for this command as it may be called in BH context 927 * Use MCC for this command as it may be called in BH context
928 * (mc == NULL) => multicast promiscous 928 * (mc == NULL) => multicast promiscous
929 */ 929 */
930int be_cmd_mcast_mac_set(struct be_ctrl_info *ctrl, u32 if_id, u8 *mac_table, 930int be_cmd_multicast_set(struct be_ctrl_info *ctrl, u32 if_id,
931 u32 num, bool promiscuous) 931 struct dev_mc_list *mc_list, u32 mc_count)
932{ 932{
933#define BE_MAX_MC 32 /* set mcast promisc if > 32 */ 933#define BE_MAX_MC 32 /* set mcast promisc if > 32 */
934 struct be_mcc_wrb *wrb; 934 struct be_mcc_wrb *wrb;
@@ -947,11 +947,16 @@ int be_cmd_mcast_mac_set(struct be_ctrl_info *ctrl, u32 if_id, u8 *mac_table,
947 OPCODE_COMMON_NTWK_MULTICAST_SET, sizeof(*req)); 947 OPCODE_COMMON_NTWK_MULTICAST_SET, sizeof(*req));
948 948
949 req->interface_id = if_id; 949 req->interface_id = if_id;
950 req->promiscuous = promiscuous; 950 if (mc_list && mc_count <= BE_MAX_MC) {
951 if (!promiscuous) { 951 int i;
952 req->num_mac = cpu_to_le16(num); 952 struct dev_mc_list *mc;
953 if (num) 953
954 memcpy(req->mac, mac_table, ETH_ALEN * num); 954 req->num_mac = cpu_to_le16(mc_count);
955
956 for (mc = mc_list, i = 0; mc; mc = mc->next, i++)
957 memcpy(req->mac[i].byte, mc->dmi_addr, ETH_ALEN);
958 } else {
959 req->promiscuous = 1;
955 } 960 }
956 961
957 be_mcc_notify_wait(ctrl); 962 be_mcc_notify_wait(ctrl);