diff options
author | Jiukai Ma <jiukaim@nvidia.com> | 2013-11-20 04:49:10 +0000 |
---|---|---|
committer | Sachin Nikam <snikam@nvidia.com> | 2013-11-28 00:24:16 -0800 |
commit | dc5518569a597328a0ea1ce7baef897763111ae7 (patch) | |
tree | 64a641641d83c0717cff914f30e0c540d8b6059c /drivers/net/wireless/bcmdhd | |
parent | fe18e287b8ad690882616ab62e7667749d994182 (diff) |
wireless: enable rx filter once work mode set
Enable rx filter once the work mode set, only adding for active standby
feature
bug 1391929
Change-Id: I3f439b39d4c490bd94c63367dfc64155c7321573
Signed-off-by: Jiukai Ma <jiukaim@nvidia.com>
Reviewed-on: http://git-master/r/335979
GVS: Gerrit_Virtual_Submit
Reviewed-by: Narayan Reddy <narayanr@nvidia.com>
Reviewed-by: Rakesh Goyal <rgoyal@nvidia.com>
Reviewed-by: Sachin Nikam <snikam@nvidia.com>
Diffstat (limited to 'drivers/net/wireless/bcmdhd')
-rwxr-xr-x | drivers/net/wireless/bcmdhd/dhd_linux.c | 39 |
1 files changed, 25 insertions, 14 deletions
diff --git a/drivers/net/wireless/bcmdhd/dhd_linux.c b/drivers/net/wireless/bcmdhd/dhd_linux.c index c46b79ffd1f3..e00a791f703b 100755 --- a/drivers/net/wireless/bcmdhd/dhd_linux.c +++ b/drivers/net/wireless/bcmdhd/dhd_linux.c @@ -583,6 +583,7 @@ static int dhd_toe_set(dhd_info_t *dhd, int idx, uint32 toe_ol); static int dhd_wl_host_event(dhd_info_t *dhd, int *ifidx, void *pktdata, wl_event_msg_t *event_ptr, void **data_ptr); +void dhd_enable_packet_filter(int value, dhd_pub_t *dhd); #if (LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 27)) && (LINUX_VERSION_CODE <= \ KERNEL_VERSION(2, 6, 39)) && defined(CONFIG_PM_SLEEP) @@ -722,8 +723,10 @@ void dhd_set_packet_filter_mode(struct net_device *dev, char *command) { dhd_info_t *dhdi = *(dhd_info_t **)netdev_priv(dev); + dhd_pub_t *dhdp = &dhdi->pub; dhdi->pub.pkt_filter_mode = bcm_strtoul(command, &command, 0); + dhd_enable_packet_filter(1, dhdp); } int @@ -818,7 +821,7 @@ dhd_enable_packet_filter_ports(dhd_pub_t *dhd, bool enable) char pkt_filter_ports_buf[pkt_filter_ports_buf_len]; char iovbuf[pkt_filter_ports_buf_len]; - DHD_TRACE(("%s: enable %d, in_suspend %d, mode %d, port count %d\n", + DHD_ERROR(("%s: enable %d, in_suspend %d, mode %d, port count %d\n", __FUNCTION__, enable, dhd->in_suspend, dhd->pkt_filter_mode, dhd->pkt_filter_ports_count)); @@ -828,21 +831,29 @@ dhd_enable_packet_filter_ports(dhd_pub_t *dhd, bool enable) portlist->reserved = 0; if (enable) { - if (!(dhd->pkt_filter_mode & PKT_FILTER_MODE_PORTS_ONLY)) - return; - - /* enable port filter */ - dhd_master_mode |= PKT_FILTER_MODE_PORTS_ONLY; - if (dhd->pkt_filter_mode & PKT_FILTER_MODE_FORWARD_ON_MATCH) - /* whitelist mode: FORWARD_ON_MATCH */ + if (!(dhd->pkt_filter_mode & PKT_FILTER_MODE_PORTS_ONLY)) { + /* disable port filter */ + portlist->count = 0; + dhd_master_mode &= ~PKT_FILTER_MODE_PORTS_ONLY; dhd_master_mode |= PKT_FILTER_MODE_FORWARD_ON_MATCH; - else - /* blacklist mode: DISCARD_ON_MATCH */ - dhd_master_mode &= ~PKT_FILTER_MODE_FORWARD_ON_MATCH; + } else { + + /* enable port filter */ + dhd_master_mode |= PKT_FILTER_MODE_PORTS_ONLY; + if (dhd->pkt_filter_mode + & PKT_FILTER_MODE_FORWARD_ON_MATCH) + /* whitelist mode: FORWARD_ON_MATCH */ + dhd_master_mode |= + PKT_FILTER_MODE_FORWARD_ON_MATCH; + else + /* blacklist mode: DISCARD_ON_MATCH */ + dhd_master_mode &= + ~PKT_FILTER_MODE_FORWARD_ON_MATCH; - portlist->count = dhd->pkt_filter_ports_count; - bcopy(dhd->pkt_filter_ports, - portlist->ports, dhd->pkt_filter_ports_count * sizeof(uint16)); + portlist->count = dhd->pkt_filter_ports_count; + bcopy(dhd->pkt_filter_ports, portlist->ports, + dhd->pkt_filter_ports_count * sizeof(uint16)); + } } else { /* disable port filter */ portlist->count = 0; |