diff options
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_assoc.h | 15 | ||||
| -rw-r--r-- | CORE/HDD/inc/wlan_hdd_oemdata.h | 48 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_assoc.c | 27 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_hostapd.c | 21 | ||||
| -rw-r--r-- | CORE/HDD/src/wlan_hdd_oemdata.c | 152 | ||||
| -rw-r--r-- | CORE/SVC/inc/wlan_ptt_sock_svc.h | 1 |
6 files changed, 247 insertions, 17 deletions
diff --git a/CORE/HDD/inc/wlan_hdd_assoc.h b/CORE/HDD/inc/wlan_hdd_assoc.h index 0abaa40c3fcd..c23fa9221f76 100644 --- a/CORE/HDD/inc/wlan_hdd_assoc.h +++ b/CORE/HDD/inc/wlan_hdd_assoc.h @@ -123,6 +123,13 @@ typedef struct hdd_station_ctx hdd_station_ctx_t; typedef struct hdd_ap_ctx_s hdd_ap_ctx_t; typedef struct hdd_mon_ctx_s hdd_mon_ctx_t; +#ifdef QCA_WIFI_2_0 +typedef enum +{ + ePeerConnected = 1, + ePeerDisconnected +}ePeerStatus; +#endif /* QCA_WIFI_2_0 */ extern v_BOOL_t hdd_connIsConnected( hdd_station_ctx_t *pHddStaCtx ); extern eHalStatus hdd_smeRoamCallback( void *pContext, tCsrRoamInfo *pRoamInfo, v_U32_t roamId, @@ -139,4 +146,12 @@ int hdd_set_csr_auth_type( hdd_adapter_t *pAdapter, eCsrAuthType RSNAuthType ); VOS_STATUS hdd_roamRegisterTDLSSTA( hdd_adapter_t *pAdapter, tANI_U8 *peerMac, tANI_U16 staId, tANI_U8 ucastSig); void hdd_PerformRoamSetKeyComplete(hdd_adapter_t *pAdapter); + +#ifdef QCA_WIFI_2_0 +void hdd_SendPeerStatusIndToOemApp(v_MACADDR_t *peerMac, + tANI_U8 peerStatus, + tANI_U8 peerTimingMeasCap, + tANI_U8 sessionId, + tANI_U8 chanId); +#endif /* QCA_WIFI_2_0 */ #endif diff --git a/CORE/HDD/inc/wlan_hdd_oemdata.h b/CORE/HDD/inc/wlan_hdd_oemdata.h index 2bc38737e9f3..dffc16556baa 100644 --- a/CORE/HDD/inc/wlan_hdd_oemdata.h +++ b/CORE/HDD/inc/wlan_hdd_oemdata.h @@ -112,6 +112,54 @@ typedef PACKED_PRE struct PACKED_POST tANI_U16 num_channels; /* Num of channels IDs to follow */ tANI_U8 channel_list[OEM_CAP_MAX_NUM_CHANNELS]; /* List of channel IDs */ } t_iw_oem_data_cap; + +typedef PACKED_PRE struct PACKED_POST +{ + /* channel id */ + tANI_U32 chan_id; + + /* reserved0 */ + tANI_U32 reserved0; + + /* primary 20 MHz channel frequency in mhz */ + tANI_U32 mhz; + + /* Center frequency 1 in MHz */ + tANI_U32 band_center_freq1; + + /* Center frequency 2 in MHz - valid only for 11acvht 80plus80 mode */ + tANI_U32 band_center_freq2; + + /* channel info described below */ + tANI_U32 info; + + /* contains min power, max power, reg power and reg class id */ + tANI_U32 reg_info_1; + + /* contains antennamax */ + tANI_U32 reg_info_2; +} tHddChannelInfo; + +typedef PACKED_PRE struct PACKED_POST +{ + /* peer mac address */ + tANI_U8 peer_mac_addr[6]; + + /* peer status: 1: CONNECTED, 2: DISCONNECTED */ + tANI_U8 peer_status; + + /* vdev_id for the peer mac */ + tANI_U8 vdev_id; + + /* peer capability: 0: RTT/RTT2, 1: RTT3. Default is 0 */ + tANI_U32 peer_capability; + + /* reserved0 */ + tANI_U32 reserved0; + + /* channel info on which peer is connected */ + tHddChannelInfo peer_chan_info; +} tPeerStatusInfo; #endif /* QCA_WIFI_2_0 */ struct iw_oem_data_req diff --git a/CORE/HDD/src/wlan_hdd_assoc.c b/CORE/HDD/src/wlan_hdd_assoc.c index be1a9f3f2b50..1431cb589e0c 100644 --- a/CORE/HDD/src/wlan_hdd_assoc.c +++ b/CORE/HDD/src/wlan_hdd_assoc.c @@ -602,6 +602,9 @@ static void hdd_SendAssociationEvent(struct net_device *dev,tCsrRoamInfo *pCsrRo int we_event; char *msg; int type = -1; +#ifdef QCA_WIFI_2_0 + v_MACADDR_t peerMacAddr; +#endif #if defined (WLAN_FEATURE_VOWIFI_11R) // Added to find the auth type on the fly at run time @@ -662,6 +665,18 @@ static void hdd_SendAssociationEvent(struct net_device *dev,tCsrRoamInfo *pCsrRo hdd_SendFTAssocResponse(dev, pAdapter, pCsrRoamInfo); } #endif +#ifdef QCA_WIFI_2_0 + if (pAdapter->device_mode == WLAN_HDD_P2P_CLIENT) + { + vos_mem_copy(peerMacAddr.bytes, pHddStaCtx->conn_info.bssId, + sizeof(pHddStaCtx->conn_info.bssId)); + + /* send peer status indication to oem app */ + hdd_SendPeerStatusIndToOemApp(&peerMacAddr, ePeerConnected, + 0, pAdapter->sessionId, + pHddStaCtx->conn_info.operationChannel); + } +#endif } else if (eConnectionState_IbssConnected == pHddStaCtx->conn_info.connState) // IBss Associated { @@ -680,6 +695,18 @@ static void hdd_SendAssociationEvent(struct net_device *dev,tCsrRoamInfo *pCsrRo pr_info("wlan: disconnected\n"); type = WLAN_STA_DISASSOC_DONE_IND; memset(wrqu.ap_addr.sa_data,'\0',ETH_ALEN); +#ifdef QCA_WIFI_2_0 + if (pAdapter->device_mode == WLAN_HDD_P2P_CLIENT) + { + vos_mem_copy(peerMacAddr.bytes, pHddStaCtx->conn_info.bssId, + sizeof(pHddStaCtx->conn_info.bssId)); + + /* send peer status indication to oem app */ + hdd_SendPeerStatusIndToOemApp(&peerMacAddr, ePeerDisconnected, + 0, pAdapter->sessionId, + pHddStaCtx->conn_info.operationChannel); + } +#endif } hdd_dump_concurrency_info(pHddCtx); diff --git a/CORE/HDD/src/wlan_hdd_hostapd.c b/CORE/HDD/src/wlan_hdd_hostapd.c index 2ae96c3601a5..95e5b7f535b3 100644 --- a/CORE/HDD/src/wlan_hdd_hostapd.c +++ b/CORE/HDD/src/wlan_hdd_hostapd.c @@ -715,7 +715,16 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa { hdd_abort_mac_scan(pHddCtx, pHostapdAdapter->sessionId); } - +#ifdef QCA_WIFI_2_0 + if (pHostapdAdapter->device_mode == WLAN_HDD_P2P_GO) + { + /* send peer status indication to oem app */ + hdd_SendPeerStatusIndToOemApp( + &pSapEvent->sapevt.sapStationAssocReassocCompleteEvent.staMac, + ePeerConnected, 0, + pHostapdAdapter->sessionId, pHddApCtx->operatingChannel); + } +#endif break; case eSAP_STA_DISASSOC_EVENT: memcpy(wrqu.addr.sa_data, &pSapEvent->sapevt.sapStationDisassocCompleteEvent.staMac, @@ -772,6 +781,16 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa #endif //Update the beacon Interval if it is P2P GO hdd_change_mcc_go_beacon_interval(pHostapdAdapter); +#ifdef QCA_WIFI_2_0 + if (pHostapdAdapter->device_mode == WLAN_HDD_P2P_GO) + { + /* send peer status indication to oem app */ + hdd_SendPeerStatusIndToOemApp( + &pSapEvent->sapevt.sapStationDisassocCompleteEvent.staMac, + ePeerDisconnected, 0, + pHostapdAdapter->sessionId, pHddApCtx->operatingChannel); + } +#endif break; case eSAP_WPS_PBC_PROBE_REQ_EVENT: { diff --git a/CORE/HDD/src/wlan_hdd_oemdata.c b/CORE/HDD/src/wlan_hdd_oemdata.c index ac0a9a2b7632..9ad0a6657499 100644 --- a/CORE/HDD/src/wlan_hdd_oemdata.c +++ b/CORE/HDD/src/wlan_hdd_oemdata.c @@ -646,8 +646,9 @@ int oem_process_channel_info_req_msg(int numOfChannels, char *chanList) struct sk_buff *skb; struct nlmsghdr *nlh; tAniMsgHdr *aniHdr; - tSmeChannelInfo *pChanInfo; - tSmeChannelInfo chanInfo; + tHddChannelInfo *pHddChanInfo; + tHddChannelInfo hddChanInfo; + tSmeChannelInfo smeChanInfo; tANI_U8 chanId; eHalStatus status = eHAL_STATUS_FAILURE; int i; @@ -662,7 +663,7 @@ int oem_process_channel_info_req_msg(int numOfChannels, char *chanList) } skb = alloc_skb(NLMSG_SPACE(sizeof(tAniMsgHdr) + sizeof(tANI_U8) + - numOfChannels * sizeof(tSmeChannelInfo)), GFP_KERNEL); + numOfChannels * sizeof(tHddChannelInfo)), GFP_KERNEL); if (skb == NULL) { VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, @@ -678,7 +679,7 @@ int oem_process_channel_info_req_msg(int numOfChannels, char *chanList) aniHdr = NLMSG_DATA(nlh); aniHdr->type = ANI_MSG_CHANNEL_INFO_RSP; - aniHdr->length = sizeof(tANI_U8) + numOfChannels * sizeof(tSmeChannelInfo); + aniHdr->length = sizeof(tANI_U8) + numOfChannels * sizeof(tHddChannelInfo); nlh->nlmsg_len = NLMSG_LENGTH((sizeof(tAniMsgHdr) + aniHdr->length)); /* First byte of message body will have num of channels */ @@ -691,12 +692,24 @@ int oem_process_channel_info_req_msg(int numOfChannels, char *chanList) */ for (i = 0 ; i < numOfChannels; i++) { - pChanInfo = (tSmeChannelInfo *) ((char *) buf + - i * sizeof(tSmeChannelInfo)); + pHddChanInfo = (tHddChannelInfo *) ((char *) buf + + i * sizeof(tHddChannelInfo)); chanId = chanList[i]; - status = sme_getChannelInfo(pHddCtx->hHal, chanId, &chanInfo); - if (eHAL_STATUS_SUCCESS != status) + status = sme_getChannelInfo(pHddCtx->hHal, chanId, &smeChanInfo); + if (eHAL_STATUS_SUCCESS == status) + { + /* copy into hdd chan info struct */ + hddChanInfo.chan_id = smeChanInfo.chan_id; + hddChanInfo.reserved0 = 0; + hddChanInfo.mhz = smeChanInfo.mhz; + hddChanInfo.band_center_freq1 = smeChanInfo.band_center_freq1; + hddChanInfo.band_center_freq2 = smeChanInfo.band_center_freq2; + hddChanInfo.info = smeChanInfo.info; + hddChanInfo.reg_info_1 = smeChanInfo.reg_info_1; + hddChanInfo.reg_info_2 = smeChanInfo.reg_info_2; + } + else { /* channel info is not returned, fill in zeros in channel * info struct @@ -704,15 +717,16 @@ int oem_process_channel_info_req_msg(int numOfChannels, char *chanList) VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO, "%s: sme_getChannelInfo failed for chan (%d), return info 0", __func__, chanId); - chanInfo.chan_id = chanId; - chanInfo.mhz = 0; - chanInfo.band_center_freq1 = 0; - chanInfo.band_center_freq2 = 0; - chanInfo.info = 0; - chanInfo.reg_info_1 = 0; - chanInfo.reg_info_2 = 0; + hddChanInfo.chan_id = chanId; + hddChanInfo.reserved0 = 0; + hddChanInfo.mhz = 0; + hddChanInfo.band_center_freq1 = 0; + hddChanInfo.band_center_freq2 = 0; + hddChanInfo.info = 0; + hddChanInfo.reg_info_1 = 0; + hddChanInfo.reg_info_2 = 0; } - vos_mem_copy(pChanInfo, &chanInfo, sizeof(tSmeChannelInfo)); + vos_mem_copy(pHddChanInfo, &hddChanInfo, sizeof(tHddChannelInfo)); } skb_put(skb, NLMSG_SPACE((sizeof(tAniMsgHdr) + aniHdr->length))); @@ -728,6 +742,112 @@ int oem_process_channel_info_req_msg(int numOfChannels, char *chanList) /**--------------------------------------------------------------------------- + \brief hdd_SendPeerStatusIndToOemApp() + + This function sends peer status indication to registered oem application + + \param - + - peerMac : MAC address of peer + - peerStatus : ePeerConnected or ePeerDisconnected + - peerTimingMeasCap : 0: RTT/RTT2, 1: RTT3. Default is 0 + - sessionId : SME session id, i.e. vdev_id + - chanId: operating channel id + + \return - None + + --------------------------------------------------------------------------*/ +void hdd_SendPeerStatusIndToOemApp(v_MACADDR_t *peerMac, + tANI_U8 peerStatus, + tANI_U8 peerTimingMeasCap, + tANI_U8 sessionId, + tANI_U8 chanId) +{ + struct sk_buff *skb; + struct nlmsghdr *nlh; + tAniMsgHdr *aniHdr; + tSmeChannelInfo smeChanInfo; + tPeerStatusInfo *pPeerInfo; + eHalStatus status = eHAL_STATUS_FAILURE; + + if (!pHddCtx || !pHddCtx->hHal) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: Either HDD Ctx is null or Hal Ctx is null", __func__); + return; + } + + /* check if oem app has registered and pid is valid */ + if ((!pHddCtx->oem_app_registered) || (pHddCtx->oem_pid == 0)) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: OEM app is not registered(%d) or pid is invalid(%d)", + __func__, pHddCtx->oem_app_registered, pHddCtx->oem_pid); + return; + } + + status = sme_getChannelInfo(pHddCtx->hHal, chanId, &smeChanInfo); + if (eHAL_STATUS_SUCCESS != status) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: sme_getChannelInfo failed for chan (%d)", + __func__, chanId); + return; + } + + skb = alloc_skb(NLMSG_SPACE(sizeof(tAniMsgHdr) + sizeof(tPeerStatusInfo)), + GFP_KERNEL); + if (skb == NULL) + { + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_ERROR, + "%s: alloc_skb failed", __func__); + return; + } + + nlh = (struct nlmsghdr *)skb->data; + nlh->nlmsg_pid = 0; /* from kernel */ + nlh->nlmsg_flags = 0; + nlh->nlmsg_seq = 0; + nlh->nlmsg_type = WLAN_NL_MSG_OEM; + aniHdr = NLMSG_DATA(nlh); + aniHdr->type = ANI_MSG_PEER_STATUS_IND; + + aniHdr->length = sizeof(tPeerStatusInfo); + nlh->nlmsg_len = NLMSG_LENGTH((sizeof(tAniMsgHdr) + aniHdr->length)); + + pPeerInfo = (tPeerStatusInfo *) ((char *)aniHdr + sizeof(tAniMsgHdr)); + + vos_mem_copy(pPeerInfo->peer_mac_addr, peerMac->bytes, + sizeof(peerMac->bytes)); + pPeerInfo->peer_status = peerStatus; + pPeerInfo->vdev_id = sessionId; + pPeerInfo->peer_capability = peerTimingMeasCap; + pPeerInfo->reserved0 = 0; + + pPeerInfo->peer_chan_info.chan_id = smeChanInfo.chan_id; + pPeerInfo->peer_chan_info.reserved0 = 0; + pPeerInfo->peer_chan_info.mhz = smeChanInfo.mhz; + pPeerInfo->peer_chan_info.band_center_freq1 = smeChanInfo.band_center_freq1; + pPeerInfo->peer_chan_info.band_center_freq2 = smeChanInfo.band_center_freq2; + pPeerInfo->peer_chan_info.info = smeChanInfo.info; + pPeerInfo->peer_chan_info.reg_info_1 = smeChanInfo.reg_info_1; + pPeerInfo->peer_chan_info.reg_info_2 = smeChanInfo.reg_info_2; + + skb_put(skb, NLMSG_SPACE((sizeof(tAniMsgHdr) + aniHdr->length))); + + VOS_TRACE(VOS_MODULE_ID_HDD, VOS_TRACE_LEVEL_INFO_HIGH, + "%s: sending peer "MAC_ADDRESS_STR + " status(%d), peerTimingMeasCap(%d), vdevId(%d), chanId(%d)" + " to oem app pid(%d)", + __func__, MAC_ADDR_ARRAY(peerMac->bytes), peerStatus, + peerTimingMeasCap, sessionId, chanId, pHddCtx->oem_pid); + + (void)nl_srv_ucast(skb, pHddCtx->oem_pid); + + return; +} + +/**--------------------------------------------------------------------------- + \brief oem_activate_service() - Activate oem message handler This function registers a handler to receive netlink message from diff --git a/CORE/SVC/inc/wlan_ptt_sock_svc.h b/CORE/SVC/inc/wlan_ptt_sock_svc.h index d77645f8c8b3..fdb46679d041 100644 --- a/CORE/SVC/inc/wlan_ptt_sock_svc.h +++ b/CORE/SVC/inc/wlan_ptt_sock_svc.h @@ -65,6 +65,7 @@ #define ANI_MSG_CHANNEL_INFO_REQ (ANI_DRIVER_MSG_START + 4) #define ANI_MSG_CHANNEL_INFO_RSP (ANI_DRIVER_MSG_START + 5) #define ANI_MSG_OEM_ERROR (ANI_DRIVER_MSG_START + 6) +#define ANI_MSG_PEER_STATUS_IND (ANI_DRIVER_MSG_START + 7) #define ANI_MAX_RADIOS 3 #define ANI_NL_MSG_OK 0 |
