diff options
| -rw-r--r-- | core/hdd/inc/wlan_hdd_power.h | 4 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_assoc.c | 3 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_main.c | 14 | ||||
| -rw-r--r-- | core/hdd/src/wlan_hdd_power.c | 21 |
4 files changed, 29 insertions, 13 deletions
diff --git a/core/hdd/inc/wlan_hdd_power.h b/core/hdd/inc/wlan_hdd_power.h index e9262637a513..749559551336 100644 --- a/core/hdd/inc/wlan_hdd_power.h +++ b/core/hdd/inc/wlan_hdd_power.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2012, 2014-2016 The Linux Foundation. All rights reserved. + * Copyright (c) 2012, 2014-2017 The Linux Foundation. All rights reserved. * * Previously licensed under the ISC license by Qualcomm Atheros, Inc. * @@ -152,7 +152,7 @@ QDF_STATUS hdd_conf_arp_offload(hdd_adapter_t *pAdapter, bool fenable); void hdd_conf_hostoffload(hdd_adapter_t *pAdapter, bool fenable); #ifdef WLAN_FEATURE_PACKET_FILTERING -void wlan_hdd_set_mc_addr_list(hdd_adapter_t *pAdapter, uint8_t set); +int wlan_hdd_set_mc_addr_list(hdd_adapter_t *pAdapter, uint8_t set); #else static inline void wlan_hdd_set_mc_addr_list(hdd_adapter_t *pAdapter, uint8_t set) diff --git a/core/hdd/src/wlan_hdd_assoc.c b/core/hdd/src/wlan_hdd_assoc.c index 4833b12a33f6..d996f2657f74 100644 --- a/core/hdd/src/wlan_hdd_assoc.c +++ b/core/hdd/src/wlan_hdd_assoc.c @@ -4698,7 +4698,8 @@ hdd_sme_roam_callback(void *pContext, tCsrRoamInfo *pRoamInfo, uint32_t roamId, /* Call to clear any MC Addr List filter applied after * successful connection. */ - wlan_hdd_set_mc_addr_list(pAdapter, false); + if (wlan_hdd_set_mc_addr_list(pAdapter, false)) + hdd_err("Failed: to clear mc addr list"); } break; case eCSR_ROAM_IBSS_LEAVE: diff --git a/core/hdd/src/wlan_hdd_main.c b/core/hdd/src/wlan_hdd_main.c index ff46d574d0ec..3e087ffebfb0 100644 --- a/core/hdd/src/wlan_hdd_main.c +++ b/core/hdd/src/wlan_hdd_main.c @@ -2234,6 +2234,12 @@ static void __hdd_set_multicast_list(struct net_device *dev) if (0 != status) return; + if (!hdd_ctx->config->fEnableMCAddrList) { + hdd_info("gMCAddrListEnable ini param not enabled"); + adapter->mc_addr_list.mc_cnt = 0; + return; + } + if (dev->flags & IFF_ALLMULTI) { hdd_notice("allow all multicast frames"); adapter->mc_addr_list.mc_cnt = 0; @@ -2244,7 +2250,10 @@ static void __hdd_set_multicast_list(struct net_device *dev) if (mc_count > WLAN_HDD_MAX_MC_ADDR_LIST) { hdd_notice("Exceeded max MC filter addresses (%d). Allowing all MC frames by disabling MC address filtering", WLAN_HDD_MAX_MC_ADDR_LIST); - wlan_hdd_set_mc_addr_list(adapter, false); + + if (wlan_hdd_set_mc_addr_list(adapter, false)) + hdd_info("failed to clear mc addr list"); + adapter->mc_addr_list.mc_cnt = 0; return; } @@ -2285,7 +2294,8 @@ static void __hdd_set_multicast_list(struct net_device *dev) } if (hdd_ctx->config->active_mode_offload) { hdd_info("enable mc filtering"); - wlan_hdd_set_mc_addr_list(adapter, true); + if (wlan_hdd_set_mc_addr_list(adapter, true)) + hdd_err("Failed: to set mc addr list"); } else { hdd_info("skip mc filtering enable it during cfg80211 suspend"); } diff --git a/core/hdd/src/wlan_hdd_power.c b/core/hdd/src/wlan_hdd_power.c index ff4a9ce98f33..296187326003 100644 --- a/core/hdd/src/wlan_hdd_power.c +++ b/core/hdd/src/wlan_hdd_power.c @@ -1027,10 +1027,13 @@ void hdd_conf_mcastbcast_filter(hdd_context_t *pHddCtx, bool setfilter) * wlan_hdd_set_mc_addr_list() - set MC address list in FW * @pAdapter: adapter whose MC list is being set * @set: flag which indicates if addresses are being set or cleared + * + * Returns: 0 on success, errno on failure */ -void wlan_hdd_set_mc_addr_list(hdd_adapter_t *pAdapter, uint8_t set) +int wlan_hdd_set_mc_addr_list(hdd_adapter_t *pAdapter, uint8_t set) { uint8_t i; + int ret = 0; tpSirRcvFltMcAddrList pMulticastAddrs = NULL; tHalHandle hHal = NULL; hdd_context_t *pHddCtx = (hdd_context_t *) pAdapter->pHddCtx; @@ -1038,30 +1041,31 @@ void wlan_hdd_set_mc_addr_list(hdd_adapter_t *pAdapter, uint8_t set) ENTER(); - if (wlan_hdd_validate_context(pHddCtx)) - return; + ret = wlan_hdd_validate_context(pHddCtx); + if (0 != ret) + return ret; hHal = pHddCtx->hHal; if (NULL == hHal) { hdd_err("HAL Handle is NULL"); - return; + return -EINVAL; } if (!sta_ctx) { hdd_err("sta_ctx is NULL"); - return; + return -EINVAL; } /* Check if INI is enabled or not, other wise just return */ if (!pHddCtx->config->fEnableMCAddrList) { hdd_notice("gMCAddrListEnable is not enabled in INI"); - return; + return -EINVAL; } pMulticastAddrs = qdf_mem_malloc(sizeof(tSirRcvFltMcAddrList)); if (NULL == pMulticastAddrs) { hdd_err("Could not allocate Memory"); - return; + return -EINVAL; } pMulticastAddrs->action = set; @@ -1121,7 +1125,8 @@ void wlan_hdd_set_mc_addr_list(hdd_adapter_t *pAdapter, uint8_t set) qdf_mem_free(pMulticastAddrs); EXIT(); - return; + + return ret; } #endif |
