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

Commit 2555cd9f authored by Timofey Trofimov's avatar Timofey Trofimov Committed by Greg Kroah-Hartman
Browse files

Staging: vt6656: fix coding style issues in 80211mgr.c



This is a patch to the 80211mgr.c file that fixes up warnings
found by the checkpatch.pl tool

Signed-off-by: default avatarTimofey Trofimov <tumoxep@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent d500648e
Loading
Loading
Loading
Loading
+251 −263
Original line number Diff line number Diff line
@@ -68,7 +68,7 @@
/*---------------------  Static Variables  --------------------------*/

static int          msglevel                = MSG_LEVEL_INFO;
//static int          msglevel                =MSG_LEVEL_DEBUG;
/*static int          msglevel                =MSG_LEVEL_DEBUG;*/
/*---------------------  Static Functions  --------------------------*/


@@ -96,7 +96,7 @@ vMgrEncodeBeacon(
{
    pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;

    // Fixed Fields
    /* Fixed Fields */
    pFrame->pqwTimestamp = (PQWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                                    + WLAN_BEACON_OFF_TS);
    pFrame->pwBeaconInterval = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
@@ -130,7 +130,7 @@ vMgrDecodeBeacon(

    pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;

    // Fixed Fields
    /* Fixed Fields */
    pFrame->pqwTimestamp = (PQWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                                    + WLAN_BEACON_OFF_TS);
    pFrame->pwBeaconInterval = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
@@ -138,7 +138,7 @@ vMgrDecodeBeacon(
    pFrame->pwCapInfo = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                                + WLAN_BEACON_OFF_CAPINFO);

    // Information elements
    /* Information elements */
    pItem = (PWLAN_IE)((PBYTE)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)))
                       + WLAN_BEACON_OFF_SSID);
    while (((PBYTE)pItem) < (pFrame->pBuf + pFrame->len)) {
@@ -153,7 +153,7 @@ vMgrDecodeBeacon(
                pFrame->pSuppRates = (PWLAN_IE_SUPP_RATES)pItem;
            break;
        case WLAN_EID_FH_PARMS:
                //pFrame->pFHParms = (PWLAN_IE_FH_PARMS)pItem;
            /* pFrame->pFHParms = (PWLAN_IE_FH_PARMS)pItem; */
            break;
        case WLAN_EID_DS_PARMS:
            if (pFrame->pDSParms == NULL)
@@ -173,9 +173,8 @@ vMgrDecodeBeacon(
            break;

        case WLAN_EID_RSN:
                if (pFrame->pRSN == NULL) {
            if (pFrame->pRSN == NULL) 
                pFrame->pRSN = (PWLAN_IE_RSN)pItem;
                }
            break;
        case WLAN_EID_RSN_WPA:
            if (pFrame->pRSNWPA == NULL) {
@@ -193,22 +192,22 @@ vMgrDecodeBeacon(
                pFrame->pExtSuppRates = (PWLAN_IE_SUPP_RATES)pItem;
            break;

            case WLAN_EID_COUNTRY:      //7
        case WLAN_EID_COUNTRY:      /* 7 */
            if (pFrame->pIE_Country == NULL)
                pFrame->pIE_Country = (PWLAN_IE_COUNTRY)pItem;
            break;

            case WLAN_EID_PWR_CONSTRAINT:   //32
        case WLAN_EID_PWR_CONSTRAINT:   /* 32 */
            if (pFrame->pIE_PowerConstraint == NULL)
                pFrame->pIE_PowerConstraint = (PWLAN_IE_PW_CONST)pItem;
            break;

            case WLAN_EID_CH_SWITCH:    //37
        case WLAN_EID_CH_SWITCH:    /* 37 */
            if (pFrame->pIE_CHSW == NULL)
                pFrame->pIE_CHSW = (PWLAN_IE_CH_SW)pItem;
            break;

            case WLAN_EID_QUIET:        //40
        case WLAN_EID_QUIET:        /* 40 */
            if (pFrame->pIE_Quiet == NULL)
                pFrame->pIE_Quiet = (PWLAN_IE_QUIET)pItem;
            break;
@@ -295,7 +294,7 @@ vMgrEncodeDisassociation(
    pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;


    // Fixed Fields
    /* Fixed Fields */
    pFrame->pwReason = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                               + WLAN_DISASSOC_OFF_REASON);
    pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_DISASSOC_OFF_REASON + sizeof(*(pFrame->pwReason));
@@ -322,7 +321,7 @@ vMgrDecodeDisassociation(
{
    pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;

    // Fixed Fields
    /* Fixed Fields */
    pFrame->pwReason = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                               + WLAN_DISASSOC_OFF_REASON);

@@ -347,7 +346,7 @@ vMgrEncodeAssocRequest(
    )
{
    pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
    // Fixed Fields
    /* Fixed Fields */
    pFrame->pwCapInfo = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                                + WLAN_ASSOCREQ_OFF_CAP_INFO);
    pFrame->pwListenInterval = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
@@ -376,13 +375,13 @@ vMgrDecodeAssocRequest(
    PWLAN_IE   pItem;

    pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;
    // Fixed Fields
    /* Fixed Fields */
    pFrame->pwCapInfo = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                                + WLAN_ASSOCREQ_OFF_CAP_INFO);
    pFrame->pwListenInterval = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                                + WLAN_ASSOCREQ_OFF_LISTEN_INT);

    // Information elements
    /* Information elements */
    pItem = (PWLAN_IE)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                            + WLAN_ASSOCREQ_OFF_SSID);

@@ -398,9 +397,8 @@ vMgrDecodeAssocRequest(
            break;

        case WLAN_EID_RSN:
                if (pFrame->pRSN == NULL) {
            if (pFrame->pRSN == NULL)
                pFrame->pRSN = (PWLAN_IE_RSN)pItem;
                }
            break;
        case WLAN_EID_RSN_WPA:
            if (pFrame->pRSNWPA == NULL) {
@@ -441,7 +439,7 @@ vMgrEncodeAssocResponse(
{
    pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;

    // Fixed Fields
    /* Fixed Fields */
    pFrame->pwCapInfo = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                                + WLAN_ASSOCRESP_OFF_CAP_INFO);
    pFrame->pwStatus = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
@@ -475,7 +473,7 @@ vMgrDecodeAssocResponse(

    pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;

    // Fixed Fields
    /* Fixed Fields */
    pFrame->pwCapInfo = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                                + WLAN_ASSOCRESP_OFF_CAP_INFO);
    pFrame->pwStatus = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
@@ -483,7 +481,7 @@ vMgrDecodeAssocResponse(
    pFrame->pwAid = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                            + WLAN_ASSOCRESP_OFF_AID);

    // Information elements
    /* Information elements */
    pFrame->pSuppRates  = (PWLAN_IE_SUPP_RATES)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                           + WLAN_ASSOCRESP_OFF_SUPP_RATES);

@@ -493,8 +491,7 @@ vMgrDecodeAssocResponse(
    if ((((PBYTE)pItem) < (pFrame->pBuf + pFrame->len)) && (pItem->byElementID == WLAN_EID_EXTSUPP_RATES)) {
        pFrame->pExtSuppRates = (PWLAN_IE_SUPP_RATES)pItem;
        DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "pFrame->pExtSuppRates=[%p].\n", pItem);
    }
    else {
    } else {
        pFrame->pExtSuppRates = NULL;
    }
    return;
@@ -519,7 +516,7 @@ vMgrEncodeReassocRequest(
{
    pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;

    // Fixed Fields
    /* Fixed Fields */
    pFrame->pwCapInfo = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                                + WLAN_REASSOCREQ_OFF_CAP_INFO);
    pFrame->pwListenInterval = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
@@ -552,7 +549,7 @@ vMgrDecodeReassocRequest(
    PWLAN_IE   pItem;
    pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;

    // Fixed Fields
    /* Fixed Fields */
    pFrame->pwCapInfo = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                                + WLAN_REASSOCREQ_OFF_CAP_INFO);
    pFrame->pwListenInterval = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
@@ -560,7 +557,7 @@ vMgrDecodeReassocRequest(
    pFrame->pAddrCurrAP = (PIEEE_ADDR)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                                       + WLAN_REASSOCREQ_OFF_CURR_AP);

    // Information elements
    /* Information elements */
    pItem = (PWLAN_IE)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                       + WLAN_REASSOCREQ_OFF_SSID);

@@ -577,9 +574,8 @@ vMgrDecodeReassocRequest(
            break;

        case WLAN_EID_RSN:
                if (pFrame->pRSN == NULL) {
            if (pFrame->pRSN == NULL)
                pFrame->pRSN = (PWLAN_IE_RSN)pItem;
                }
            break;
        case WLAN_EID_RSN_WPA:
            if (pFrame->pRSNWPA == NULL) {
@@ -646,7 +642,7 @@ vMgrDecodeProbeRequest(

    pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;

    // Information elements
    /* Information elements */
    pItem = (PWLAN_IE)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3)));

    while (((PBYTE)pItem) < (pFrame->pBuf + pFrame->len)) {
@@ -697,7 +693,7 @@ vMgrEncodeProbeResponse(
{
    pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;

    // Fixed Fields
    /* Fixed Fields */
    pFrame->pqwTimestamp = (PQWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                                    + WLAN_PROBERESP_OFF_TS);
    pFrame->pwBeaconInterval = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
@@ -734,7 +730,7 @@ vMgrDecodeProbeResponse(

    pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;

    // Fixed Fields
    /* Fixed Fields */
    pFrame->pqwTimestamp = (PQWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                                    + WLAN_PROBERESP_OFF_TS);
    pFrame->pwBeaconInterval = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
@@ -742,7 +738,7 @@ vMgrDecodeProbeResponse(
    pFrame->pwCapInfo = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                                + WLAN_PROBERESP_OFF_CAP_INFO);

    // Information elements
    /* Information elements */
    pItem = (PWLAN_IE)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                       + WLAN_PROBERESP_OFF_SSID);

@@ -772,9 +768,8 @@ vMgrDecodeProbeResponse(
            break;

        case WLAN_EID_RSN:
                if (pFrame->pRSN == NULL) {
            if (pFrame->pRSN == NULL)
                pFrame->pRSN = (PWLAN_IE_RSN)pItem;
                }
            break;
        case WLAN_EID_RSN_WPA:
            if (pFrame->pRSNWPA == NULL) {
@@ -791,22 +786,22 @@ vMgrDecodeProbeResponse(
                pFrame->pExtSuppRates = (PWLAN_IE_SUPP_RATES)pItem;
            break;

            case WLAN_EID_COUNTRY:      //7
        case WLAN_EID_COUNTRY:      /* 7 */
            if (pFrame->pIE_Country == NULL)
                pFrame->pIE_Country = (PWLAN_IE_COUNTRY)pItem;
            break;

            case WLAN_EID_PWR_CONSTRAINT:   //32
        case WLAN_EID_PWR_CONSTRAINT:   /* 32 */
            if (pFrame->pIE_PowerConstraint == NULL)
                pFrame->pIE_PowerConstraint = (PWLAN_IE_PW_CONST)pItem;
            break;

            case WLAN_EID_CH_SWITCH:    //37
        case WLAN_EID_CH_SWITCH:    /* 37 */
            if (pFrame->pIE_CHSW == NULL)
                pFrame->pIE_CHSW = (PWLAN_IE_CH_SW)pItem;
            break;

            case WLAN_EID_QUIET:        //40
        case WLAN_EID_QUIET:        /* 40 */
            if (pFrame->pIE_Quiet == NULL)
                pFrame->pIE_Quiet = (PWLAN_IE_QUIET)pItem;
            break;
@@ -845,7 +840,7 @@ vMgrEncodeAuthen(
{
    pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;

    // Fixed Fields
    /* Fixed Fields */
    pFrame->pwAuthAlgorithm = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                                      + WLAN_AUTHEN_OFF_AUTH_ALG);
    pFrame->pwAuthSequence = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
@@ -853,7 +848,6 @@ vMgrEncodeAuthen(
    pFrame->pwStatus = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                               + WLAN_AUTHEN_OFF_STATUS);
    pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_AUTHEN_OFF_STATUS + sizeof(*(pFrame->pwStatus));

    return;
}

@@ -878,7 +872,7 @@ vMgrDecodeAuthen(

    pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;

    // Fixed Fields
    /* Fixed Fields */
    pFrame->pwAuthAlgorithm = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                                      + WLAN_AUTHEN_OFF_AUTH_ALG);
    pFrame->pwAuthSequence = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
@@ -886,14 +880,12 @@ vMgrDecodeAuthen(
    pFrame->pwStatus = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                               + WLAN_AUTHEN_OFF_STATUS);

    // Information elements
    /* Information elements */
    pItem = (PWLAN_IE)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                       + WLAN_AUTHEN_OFF_CHALLENGE);

    if ((((PBYTE)pItem) < (pFrame->pBuf + pFrame->len)) && (pItem->byElementID == WLAN_EID_CHALLENGE)) {
    if ((((PBYTE)pItem) < (pFrame->pBuf + pFrame->len)) && (pItem->byElementID == WLAN_EID_CHALLENGE))
        pFrame->pChallenge = (PWLAN_IE_CHALLENGE)pItem;
    }

    return;
}

@@ -916,11 +908,10 @@ vMgrEncodeDeauthen(
{
    pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;

    // Fixed Fields
    /* Fixed Fields */
    pFrame->pwReason = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                               + WLAN_DEAUTHEN_OFF_REASON);
    pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_DEAUTHEN_OFF_REASON + sizeof(*(pFrame->pwReason));

    return;
}

@@ -943,10 +934,9 @@ vMgrDecodeDeauthen(
{
    pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;

    // Fixed Fields
    /* Fixed Fields */
    pFrame->pwReason = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                               + WLAN_DEAUTHEN_OFF_REASON);

    return;
}

@@ -969,7 +959,7 @@ vMgrEncodeReassocResponse(
{
    pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;

    // Fixed Fields
    /* Fixed Fields */
    pFrame->pwCapInfo = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                                + WLAN_REASSOCRESP_OFF_CAP_INFO);
    pFrame->pwStatus = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
@@ -978,7 +968,6 @@ vMgrEncodeReassocResponse(
                            + WLAN_REASSOCRESP_OFF_AID);

    pFrame->len = WLAN_HDR_ADDR3_LEN + WLAN_REASSOCRESP_OFF_AID + sizeof(*(pFrame->pwAid));

    return;
}

@@ -1004,7 +993,7 @@ vMgrDecodeReassocResponse(

    pFrame->pHdr = (PUWLAN_80211HDR)pFrame->pBuf;

    // Fixed Fields
    /* Fixed Fields */
    pFrame->pwCapInfo = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                                + WLAN_REASSOCRESP_OFF_CAP_INFO);
    pFrame->pwStatus = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
@@ -1012,15 +1001,14 @@ vMgrDecodeReassocResponse(
    pFrame->pwAid = (PWORD)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                            + WLAN_REASSOCRESP_OFF_AID);

    //Information elements
    /* Information elements */
    pFrame->pSuppRates = (PWLAN_IE_SUPP_RATES)(WLAN_HDR_A3_DATA_PTR(&(pFrame->pHdr->sA3))
                                               + WLAN_REASSOCRESP_OFF_SUPP_RATES);

    pItem = (PWLAN_IE)(pFrame->pSuppRates);
    pItem = (PWLAN_IE)(((PBYTE)pItem) + 2 + pItem->len);

    if ((((PBYTE)pItem) < (pFrame->pBuf + pFrame->len)) && (pItem->byElementID == WLAN_EID_EXTSUPP_RATES)) {
    if ((((PBYTE)pItem) < (pFrame->pBuf + pFrame->len)) && (pItem->byElementID == WLAN_EID_EXTSUPP_RATES))
        pFrame->pExtSuppRates = (PWLAN_IE_SUPP_RATES)pItem;
    }
    return;
}