Commit 73d540f2 authored by Sathya Perla's avatar Sathya Perla Committed by David S. Miller

be2net: fix promiscuous and multicast promiscuous modes being enabled always

Signed-off-by: default avatarSathya Perla <sathyap@serverengines.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 8f7e524c
...@@ -729,8 +729,8 @@ int be_cmd_q_destroy(struct be_adapter *adapter, struct be_queue_info *q, ...@@ -729,8 +729,8 @@ int be_cmd_q_destroy(struct be_adapter *adapter, struct be_queue_info *q,
/* Create an rx filtering policy configuration on an i/f /* Create an rx filtering policy configuration on an i/f
* Uses mbox * Uses mbox
*/ */
int be_cmd_if_create(struct be_adapter *adapter, u32 flags, u8 *mac, int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags, u32 en_flags,
bool pmac_invalid, u32 *if_handle, u32 *pmac_id) u8 *mac, bool pmac_invalid, u32 *if_handle, u32 *pmac_id)
{ {
struct be_mcc_wrb *wrb; struct be_mcc_wrb *wrb;
struct be_cmd_req_if_create *req; struct be_cmd_req_if_create *req;
...@@ -746,8 +746,8 @@ int be_cmd_if_create(struct be_adapter *adapter, u32 flags, u8 *mac, ...@@ -746,8 +746,8 @@ int be_cmd_if_create(struct be_adapter *adapter, u32 flags, u8 *mac,
be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON, be_cmd_hdr_prepare(&req->hdr, CMD_SUBSYSTEM_COMMON,
OPCODE_COMMON_NTWK_INTERFACE_CREATE, sizeof(*req)); OPCODE_COMMON_NTWK_INTERFACE_CREATE, sizeof(*req));
req->capability_flags = cpu_to_le32(flags); req->capability_flags = cpu_to_le32(cap_flags);
req->enable_flags = cpu_to_le32(flags); req->enable_flags = cpu_to_le32(en_flags);
req->pmac_invalid = pmac_invalid; req->pmac_invalid = pmac_invalid;
if (!pmac_invalid) if (!pmac_invalid)
memcpy(req->mac_addr, mac, ETH_ALEN); memcpy(req->mac_addr, mac, ETH_ALEN);
......
...@@ -720,8 +720,9 @@ extern int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr, ...@@ -720,8 +720,9 @@ extern int be_cmd_mac_addr_query(struct be_adapter *adapter, u8 *mac_addr,
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);
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);
extern int be_cmd_if_create(struct be_adapter *adapter, u32 if_flags, u8 *mac, extern int be_cmd_if_create(struct be_adapter *adapter, u32 cap_flags,
bool pmac_invalid, u32 *if_handle, u32 *pmac_id); u32 en_flags, u8 *mac, bool pmac_invalid,
u32 *if_handle, u32 *pmac_id);
extern int be_cmd_if_destroy(struct be_adapter *adapter, u32 if_handle); extern int be_cmd_if_destroy(struct be_adapter *adapter, u32 if_handle);
extern int be_cmd_eq_create(struct be_adapter *adapter, extern int be_cmd_eq_create(struct be_adapter *adapter,
struct be_queue_info *eq, int eq_delay); struct be_queue_info *eq, int eq_delay);
......
...@@ -1620,19 +1620,22 @@ static int be_open(struct net_device *netdev) ...@@ -1620,19 +1620,22 @@ static int be_open(struct net_device *netdev)
static int be_setup(struct be_adapter *adapter) static int be_setup(struct be_adapter *adapter)
{ {
struct net_device *netdev = adapter->netdev; struct net_device *netdev = adapter->netdev;
u32 if_flags; u32 cap_flags, en_flags;
int status; int status;
if_flags = BE_IF_FLAGS_BROADCAST | BE_IF_FLAGS_PROMISCUOUS | cap_flags = BE_IF_FLAGS_UNTAGGED | BE_IF_FLAGS_BROADCAST |
BE_IF_FLAGS_MCAST_PROMISCUOUS | BE_IF_FLAGS_UNTAGGED | BE_IF_FLAGS_MCAST_PROMISCUOUS |
BE_IF_FLAGS_PASS_L3L4_ERRORS; BE_IF_FLAGS_PROMISCUOUS |
status = be_cmd_if_create(adapter, if_flags, netdev->dev_addr, BE_IF_FLAGS_PASS_L3L4_ERRORS;
false/* pmac_invalid */, &adapter->if_handle, en_flags = BE_IF_FLAGS_UNTAGGED | BE_IF_FLAGS_BROADCAST |
&adapter->pmac_id); BE_IF_FLAGS_PASS_L3L4_ERRORS;
status = be_cmd_if_create(adapter, cap_flags, en_flags,
netdev->dev_addr, false/* pmac_invalid */,
&adapter->if_handle, &adapter->pmac_id);
if (status != 0) if (status != 0)
goto do_none; goto do_none;
status = be_tx_queues_create(adapter); status = be_tx_queues_create(adapter);
if (status != 0) if (status != 0)
goto if_destroy; goto if_destroy;
......
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