mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-10 12:57:06 +09:00
net: wireless: bcmdhd: Fix filtering setting in case of P2P
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
This commit is contained in:
@@ -449,6 +449,7 @@ extern int dhd_dev_get_pno_status(struct net_device *dev);
|
||||
#define DHD_MULTICAST4_FILTER_NUM 2
|
||||
#define DHD_MULTICAST6_FILTER_NUM 3
|
||||
#define DHD_MDNS_FILTER_NUM 4
|
||||
extern int dhd_os_set_packet_filter(dhd_pub_t *dhdp, int val);
|
||||
extern int net_os_set_packet_filter(struct net_device *dev, int val);
|
||||
extern int net_os_rxfilter_add_remove(struct net_device *dev, int val, int num);
|
||||
|
||||
|
||||
@@ -84,6 +84,8 @@ s32 dhd_cfg80211_set_p2p_info(struct wl_priv *wl, int val)
|
||||
dhd_arp_offload_enable(dhd, false);
|
||||
#endif /* ARP_OFFLOAD_SUPPORT */
|
||||
|
||||
dhd_os_set_packet_filter(dhd, 0);
|
||||
|
||||
/* Setup timeout if Beacons are lost and roam is off to report link down */
|
||||
bcm_mkiovar("bcn_timeout", (char *)&bcn_timeout, 4, iovbuf, sizeof(iovbuf));
|
||||
dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0);
|
||||
@@ -107,6 +109,8 @@ s32 dhd_cfg80211_clean_p2p_info(struct wl_priv *wl)
|
||||
dhd_arp_offload_enable(dhd, true);
|
||||
#endif /* ARP_OFFLOAD_SUPPORT */
|
||||
|
||||
dhd_os_set_packet_filter(dhd, 1);
|
||||
|
||||
/* Setup timeout if Beacons are lost and roam is off to report link down */
|
||||
bcm_mkiovar("bcn_timeout", (char *)&bcn_timeout, 4, iovbuf, sizeof(iovbuf));
|
||||
dhd_wl_ioctl_cmd(dhd, WLC_SET_VAR, iovbuf, sizeof(iovbuf), TRUE, 0);
|
||||
|
||||
@@ -512,7 +512,8 @@ static void dhd_set_packet_filter(int value, dhd_pub_t *dhd)
|
||||
DHD_TRACE(("%s: %d\n", __FUNCTION__, value));
|
||||
/* 1 - Enable packet filter, only allow unicast packet to send up */
|
||||
/* 0 - Disable packet filter */
|
||||
if (dhd_pkt_filter_enable) {
|
||||
if (dhd_pkt_filter_enable && (!value ||
|
||||
(dhd_check_ap_wfd_mode_set(dhd) == FALSE))) {
|
||||
int i;
|
||||
|
||||
for (i = 0; i < dhd->pktfilter_count; i++) {
|
||||
@@ -3057,7 +3058,6 @@ dhd_preinit_ioctls(dhd_pub_t *dhd)
|
||||
DHD_ERROR(("%s APSTA for WFD failed ret= %d\n", __FUNCTION__, ret));
|
||||
} else {
|
||||
dhd->op_mode |= WFD_MASK;
|
||||
dhd_pkt_filter_enable = FALSE;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -4400,9 +4400,8 @@ int net_os_rxfilter_add_remove(struct net_device *dev, int add_remove, int num)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int net_os_set_packet_filter(struct net_device *dev, int val)
|
||||
int dhd_os_set_packet_filter(dhd_pub_t *dhdp, int val)
|
||||
{
|
||||
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
|
||||
int ret = 0;
|
||||
|
||||
/* Packet filtering is set only if we still in early-suspend and
|
||||
@@ -4410,15 +4409,22 @@ int net_os_set_packet_filter(struct net_device *dev, int val)
|
||||
* We can always turn it OFF in case of early-suspend, but we turn it
|
||||
* back ON only if suspend_disable_flag was not set
|
||||
*/
|
||||
if (dhd && dhd->pub.up) {
|
||||
if (dhd->pub.in_suspend) {
|
||||
if (!val || (val && !dhd->pub.suspend_disable_flag))
|
||||
dhd_set_packet_filter(val, &dhd->pub);
|
||||
if (dhdp && dhdp->up) {
|
||||
if (dhdp->in_suspend) {
|
||||
if (!val || (val && !dhdp->suspend_disable_flag))
|
||||
dhd_set_packet_filter(val, dhdp);
|
||||
}
|
||||
}
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
int net_os_set_packet_filter(struct net_device *dev, int val)
|
||||
{
|
||||
dhd_info_t *dhd = *(dhd_info_t **)netdev_priv(dev);
|
||||
|
||||
return dhd_os_set_packet_filter(&dhd->pub, val);
|
||||
}
|
||||
|
||||
void
|
||||
dhd_dev_init_ioctl(struct net_device *dev)
|
||||
|
||||
Reference in New Issue
Block a user