Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d11efa48 authored by Pankaj Singh's avatar Pankaj Singh
Browse files

wlan: Send all assoc request IE to hostapd in SAP mode

Host driver packs only the RSN IE, WAP IE and additional IE
from association request to upper layers. With any new IE
support added on the driver, the driver has to add new structure
to csr_roam_info and pack that IE into the
tSap_StationAssocReassocCompleteEvent and pass it to higher
layers. This increases the redundancy with new IE introduced.

To facilitate hostapd to get information on all IE, pass all the
IE present in the assoc request to hostapd.

Change-Id: I1665a83de52bd67529ea026dc0c5e92cfbd51590
CRs-Fixed: 2734700
parent 45e66bba
Loading
Loading
Loading
Loading
+4 −10
Original line number Diff line number Diff line
@@ -1297,6 +1297,7 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa
    v_CONTEXT_t pVosContext = NULL;
    ptSapContext pSapCtx = NULL;
    hdd_config_t *cfg_param;
    tSap_StationAssocReassocCompleteEvent *event;

    dev = (struct net_device *)usrDataForCallback;
    pHostapdAdapter = netdev_priv(dev);
@@ -1467,6 +1468,7 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa
        
        case eSAP_STA_ASSOC_EVENT:
        case eSAP_STA_REASSOC_EVENT:
            event = &pSapEvent->sapevt.sapStationAssocReassocCompleteEvent;
            wrqu.addr.sa_family = ARPHRD_ETHER;
            memcpy(wrqu.addr.sa_data, &pSapEvent->sapevt.sapStationAssocReassocCompleteEvent.staMac, 
                sizeof(v_MACADDR_t));
@@ -1558,10 +1560,7 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa
                }

                memset(staInfo, 0, sizeof(*staInfo));
                if (iesLen <= MAX_ASSOC_IND_IE_LEN )
                {
                    staInfo->assoc_req_ies =
                        (const u8 *)&pSapEvent->sapevt.sapStationAssocReassocCompleteEvent.ies[0];
                staInfo->assoc_req_ies = event->ies;
                staInfo->assoc_req_ies_len = iesLen;
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,0,31)) && \
	((LINUX_VERSION_CODE < KERNEL_VERSION(4, 0, 0)) && \
@@ -1573,11 +1572,6 @@ VOS_STATUS hdd_hostapd_SAPEventCB( tpSap_Event pSapEvent, v_PVOID_t usrDataForCa
                                 staInfo, GFP_KERNEL);
                    vos_mem_free(staInfo);
             }
                else
                {
                    hddLog(LOGE, FL(" Assoc Ie length is too long"));
                }
             }
#endif
            hdd_manage_delack_timer(pHddCtx);

+3 −1
Original line number Diff line number Diff line
@@ -98,6 +98,8 @@ when who what, where, why
#define       MAX_ACL_MAC_ADDRESS          16
#define       AUTO_CHANNEL_SELECT          0
#define       MAX_ASSOC_IND_IE_LEN         255
#define       MAX_ASSOC_REQ_IE_LEN         2000
#define       ASSOC_REQ_IE_OFFSET          4

/* defines for WPS config states */
#define       SAP_WPS_DISABLED             0
@@ -276,7 +278,7 @@ typedef struct sap_StationAssocReassocCompleteEvent_s {
    v_MACADDR_t  staMac;
    v_U8_t       staId;
    v_U8_t       status;
    v_U8_t       ies[MAX_ASSOC_IND_IE_LEN];
    v_U8_t       *ies;
    v_U16_t      iesLen;
    v_U32_t      statusCode; 
    eSapAuthType SapAuthType;
+10 −10
Original line number Diff line number Diff line
@@ -817,6 +817,7 @@ sapSignalHDDevent
            break;

        case eSAP_STA_ASSOC_EVENT:
        case eSAP_STA_REASSOC_EVENT:
        {
            tSap_StationAssocReassocCompleteEvent *event =
                     &sapApAppEvent.sapevt.sapStationAssocReassocCompleteEvent;
@@ -840,20 +841,19 @@ sapSignalHDDevent
                         pCsrRoamInfo->peerMac,sizeof(tSirMacAddr));
            event->staId = pCsrRoamInfo->staId ;
            event->statusCode = pCsrRoamInfo->statusCode;
            event->iesLen = pCsrRoamInfo->rsnIELen;
            vos_mem_copy(event->ies, pCsrRoamInfo->prsnIE,
                        pCsrRoamInfo->rsnIELen);

            if(pCsrRoamInfo->addIELen)
            {
                v_U8_t  len = event->iesLen;
                event->iesLen += pCsrRoamInfo->addIELen;
                vos_mem_copy(&event->ies[len], pCsrRoamInfo->paddIE,
                            pCsrRoamInfo->addIELen);
            if (pCsrRoamInfo->assocReqLength < ASSOC_REQ_IE_OFFSET) {
                VOS_TRACE(VOS_MODULE_ID_SAP, VOS_TRACE_LEVEL_INFO_HIGH,
                            FL("Invalid assoc request length:%d"),
                            pCsrRoamInfo->assocReqLength);
                return VOS_STATUS_E_FAILURE;
            }
            event->iesLen = (pCsrRoamInfo->assocReqLength -
                                    ASSOC_REQ_IE_OFFSET);
            event->ies = (pCsrRoamInfo->assocReqPtr +
                                    ASSOC_REQ_IE_OFFSET);

            event->rate_flags = pCsrRoamInfo->maxRateFlags;

            event->wmmEnabled = pCsrRoamInfo->wmmEnabledSta;
            event->status = (eSapStatus )context;
            event->ch_width = pCsrRoamInfo->ch_width;
+2 −0
Original line number Diff line number Diff line
@@ -1403,6 +1403,8 @@ typedef struct sSirSmeAssocIndToUpperLayerCnf
    tSirMacHTChannelWidth ch_width;
    tDot11fIEHTCaps HTCaps;
    tDot11fIEVHTCaps VHTCaps;
    uint32_t             ies_len;
    uint8_t              *ies;
} tSirSmeAssocIndToUpperLayerCnf, *tpSirSmeAssocIndToUpperLayerCnf;

typedef struct tagCsrSummaryStatsInfo
+26 −0
Original line number Diff line number Diff line
@@ -9182,6 +9182,8 @@ void csrRoamJoinedStateMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf )
            if(!pSession)
            {
                smsLog(pMac, LOGE, FL("  session %d not found "), sessionId);
                if (pUpperLayerAssocCnf->ies)
                    vos_mem_free(pUpperLayerAssocCnf->ies);
                return;
            }
            
@@ -9213,6 +9215,14 @@ void csrRoamJoinedStateMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf )
            if(CSR_IS_INFRA_AP(pRoamInfo->u.pConnectedProfile) )
            {
                if (pUpperLayerAssocCnf->ies_len > 0) {
                    pRoamInfo->assocReqLength =
                        pUpperLayerAssocCnf->ies_len;
                    pRoamInfo->assocReqPtr =
                        pUpperLayerAssocCnf->ies;
                }
                pMac->roam.roamSession[sessionId].connectState = eCSR_ASSOC_STATE_TYPE_INFRA_CONNECTED;
                pRoamInfo->fReassocReq = pUpperLayerAssocCnf->reassocReq;
                status = csrRoamCallCallback(pMac, sessionId, pRoamInfo, 0, eCSR_ROAM_INFRA_IND, eCSR_ROAM_RESULT_INFRA_ASSOCIATION_CNF);
@@ -9224,6 +9234,8 @@ void csrRoamJoinedStateMsgProcessor( tpAniSirGlobal pMac, void *pMsgBuf )
                status = csrRoamCallCallback(pMac, sessionId, pRoamInfo, 0, eCSR_ROAM_WDS_IND, eCSR_ROAM_RESULT_WDS_ASSOCIATION_IND);//Sta
            }
            if (pUpperLayerAssocCnf->ies)
                vos_mem_free(pUpperLayerAssocCnf->ies);
        }
        break;
       default:
@@ -15745,6 +15757,20 @@ eHalStatus csrSendAssocIndToUpperLayerCnfMsg( tpAniSirGlobal pMac,
        vos_mem_copy(pBuf, &pAssocInd->VHTCaps, sizeof(pMsg->VHTCaps));
    }
    if (pAssocInd->assocReqPtr) {
        if (pAssocInd->assocReqLength < MAX_ASSOC_REQ_IE_LEN) {
            pMsg->ies = vos_mem_malloc(pAssocInd->assocReqLength);
            if (!pMsg->ies) {
                vos_mem_free(pMsg);
                return eHAL_STATUS_FAILED_ALLOC;
            }
            pMsg->ies_len = pAssocInd->assocReqLength;
            vos_mem_copy(pMsg->ies, pAssocInd->assocReqPtr, pMsg->ies_len);
        } else {
            smsLog(pMac, LOGE, FL("Assoc Ie length is too long"));
        }
    }
        msgQ.type = eWNI_SME_UPPER_LAYER_ASSOC_CNF;
        msgQ.bodyptr = pMsg;
        msgQ.bodyval = 0;