diff options
| author | Ravi Joshi <ravij@qca.qualcomm.com> | 2016-03-23 18:28:50 -0700 |
|---|---|---|
| committer | Anjaneedevi Kapparapu <akappa@codeaurora.org> | 2016-04-13 10:15:12 +0530 |
| commit | 9d8ea02422acfb169149a9e6c726331e4f7f4e4b (patch) | |
| tree | 99399c31f39131cbdfb7c1cbbd74c56cf2dc45e0 | |
| parent | d4a94014d2257434d72ac011160c4d465b8f21db (diff) | |
qcacld-2.0: Enable ipv4/ipv6 address notification for NDI
NAN Data Interface also supports ipv4 and ipv6 address notification
like any other netdev. Enable ipv4/ipv6 notifications for NDI mode.
Change-Id: I6ad281d9b3dce66db7bbfd198296d0d086ccf4fb
CRs-Fixed: 962367
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_assoc.h | 35 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_early_suspend.c | 38 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_nan_datapath.h | 11 |
3 files changed, 56 insertions, 28 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_assoc.h b/CORE/HDD/inc/wlan_hdd_assoc.h index 8a500506fe30..1c2f01018dbb 100644 --- a/CORE/HDD/inc/wlan_hdd_assoc.h +++ b/CORE/HDD/inc/wlan_hdd_assoc.h @@ -49,28 +49,31 @@ /* Timeout in ms for peer info request completion */ #define IBSS_PEER_INFO_REQ_TIMOEUT 1000 -typedef enum -{ - /** Not associated in Infra or participating in an IBSS / Ad-hoc network.*/ +/** + * enum eConnectionState - connection state values at HDD + * @eConnectionState_NotConnected: Not associated in Infra or participating in + * an IBSS / Ad-hoc network + * @eConnectionState_Connecting: While connection in progress + * @eConnectionState_Associated: Associated in an Infrastructure network + * @eConnectionState_IbssDisconnected: Participating in an IBSS network though + * disconnected (no partner STA in IBSS) + * @eConnectionState_IbssConnected: Participating in an IBSS network with + * partner stations also present + * @eConnectionState_Disconnecting: Disconnecting in an Infrastructure network. + * @eConnectionState_NdiDisconnected: NDI in disconnected state - no peers + * @eConnectionState_NdiConnected: NDI in connected state - at least one peer + */ +typedef enum { eConnectionState_NotConnected, - - /** While connection in progress */ eConnectionState_Connecting, - - /** Associated in an Infrastructure network.*/ eConnectionState_Associated, - - /** Participating in an IBSS network though disconnected (no partner stations - in the IBSS).*/ eConnectionState_IbssDisconnected, - - /** Participating in an IBSS network with partner stations also present*/ eConnectionState_IbssConnected, - - /** Disconnecting in an Infrastructure network.*/ - eConnectionState_Disconnecting - + eConnectionState_Disconnecting, + eConnectionState_NdiDisconnected, + eConnectionState_NdiConnected, }eConnectionState; + /**This structure stores the connection information */ typedef struct connection_info_s { diff --git a/CORE/HDD/src/wlan_hdd_early_suspend.c b/CORE/HDD/src/wlan_hdd_early_suspend.c index 6b7cf69fda6e..88c27af4ddc4 100644 --- a/CORE/HDD/src/wlan_hdd_early_suspend.c +++ b/CORE/HDD/src/wlan_hdd_early_suspend.c @@ -593,7 +593,8 @@ static int __wlan_hdd_ipv6_changed(struct notifier_block *nb, if (WLAN_HDD_GET_CTX(adapter) != hdd_ctx) return NOTIFY_DONE; if (adapter->device_mode == WLAN_HDD_INFRA_STATION || - (adapter->device_mode == WLAN_HDD_P2P_CLIENT)) { + adapter->device_mode == WLAN_HDD_P2P_CLIENT || + adapter->device_mode == WLAN_HDD_NDI) { if (hdd_ctx->cfg_ini->nEnableSuspend == WLAN_MAP_SUSPEND_TO_MCAST_BCAST_FILTER && hdd_ctx->ns_offload_enable) @@ -881,6 +882,7 @@ static void __hdd_ipv6_notifier_work_queue(struct work_struct *work) container_of(work, hdd_adapter_t, ipv6NotifierWorkQueue); hdd_context_t *pHddCtx; int status; + bool ndi_connected = false; ENTER(); @@ -896,9 +898,14 @@ static void __hdd_ipv6_notifier_work_queue(struct work_struct *work) pHddCtx->sus_res_mcastbcast_filter_valid = VOS_TRUE; } + /* check if the device is in NAN data mode */ + if (WLAN_HDD_IS_NDI(pAdapter)) + ndi_connected = WLAN_HDD_IS_NDI_CONNECTED(pAdapter); + if ((eConnectionState_Associated == - (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.connState) - && (pHddCtx->hdd_wlan_suspended)) + (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.connState || + ndi_connected) && + pHddCtx->hdd_wlan_suspended) { /* * This invocation being part of the IPv6 registration callback, @@ -1075,6 +1082,7 @@ static void __hdd_ipv4_notifier_work_queue(struct work_struct *work) container_of(work, hdd_adapter_t, ipv4NotifierWorkQueue); hdd_context_t *pHddCtx; int status; + bool ndi_connected = false; hddLog(LOG1, FL("Reconfiguring ARP Offload")); pHddCtx = WLAN_HDD_GET_CTX(pAdapter); @@ -1082,20 +1090,25 @@ static void __hdd_ipv4_notifier_work_queue(struct work_struct *work) if (0 != status) return; - if ( VOS_FALSE == pHddCtx->sus_res_mcastbcast_filter_valid) - { + if (VOS_FALSE == pHddCtx->sus_res_mcastbcast_filter_valid) { pHddCtx->sus_res_mcastbcast_filter = pHddCtx->configuredMcastBcastFilter; pHddCtx->sus_res_mcastbcast_filter_valid = VOS_TRUE; } + /* check if the device is in NAN data mode */ + if (WLAN_HDD_IS_NDI(pAdapter)) + ndi_connected = WLAN_HDD_IS_NDI_CONNECTED(pAdapter); + if ((eConnectionState_Associated == - (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.connState) - && (pHddCtx->hdd_wlan_suspended)) - { - // This invocation being part of the IPv4 registration callback, - // we are passing second parameter as 2 to avoid registration - // of IPv4 notifier again. + (WLAN_HDD_GET_STATION_CTX_PTR(pAdapter))->conn_info.connState || + ndi_connected) && + pHddCtx->hdd_wlan_suspended) { + /* + * This invocation being part of the IPv4 registration callback, + * we are passing second parameter as 2 to avoid registration + * of IPv4 notifier again. + */ hdd_conf_arp_offload(pAdapter, 2); } } @@ -1135,7 +1148,8 @@ static int __wlan_hdd_ipv4_changed(struct notifier_block *nb, if (adapter->dev != ndev) return NOTIFY_DONE; if (WLAN_HDD_GET_CTX(adapter) != hdd_ctx) return NOTIFY_DONE; if (!(adapter->device_mode == WLAN_HDD_INFRA_STATION || - adapter->device_mode == WLAN_HDD_P2P_CLIENT)) + adapter->device_mode == WLAN_HDD_P2P_CLIENT || + adapter->device_mode == WLAN_HDD_NDI)) return NOTIFY_DONE; if ((hdd_ctx->cfg_ini->nEnableSuspend != diff --git a/CORE/HDD/src/wlan_hdd_nan_datapath.h b/CORE/HDD/src/wlan_hdd_nan_datapath.h index f989b5a2b0e7..a74327689e94 100644 --- a/CORE/HDD/src/wlan_hdd_nan_datapath.h +++ b/CORE/HDD/src/wlan_hdd_nan_datapath.h @@ -40,6 +40,17 @@ struct wireless_dev; #define NDP_APP_INFO_LEN 255 #define NDP_QOS_INFO_LEN 255 +#ifdef WLAN_FEATURE_NAN_DATAPATH +#define WLAN_HDD_IS_NDI(adapter) ((adapter)->device_mode == WLAN_HDD_NDI) + +#define WLAN_HDD_IS_NDI_CONNECTED(adapter) ( \ + eConnectionState_NdiConnected ==\ + (adapter)->sessionCtx.station.conn_info.connState) +#else +#define WLAN_HDD_IS_NDI(adapter) (false) +#define WLAN_HDD_IS_NDI_CONNECTED(adapter) (false) +#endif /* WLAN_FEATURE_NAN_DATAPATH */ + /** * enum qca_wlan_vendor_attr_ndp_params - vendor attribute parameters * @QCA_WLAN_VENDOR_ATTR_NDP_SUBCMD: NDP Sub command |
