]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/staging/vt6655/wpactl.c
Merge tag 'arm64-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas...
[karo-tx-linux.git] / drivers / staging / vt6655 / wpactl.c
index eda17051297d9e43ac6b2c48696c9b869fd869a7..869f62c678e60c1e67f4d624fc5a724fe733be1e 100644 (file)
@@ -44,8 +44,6 @@
 
 #define VIAWGET_WPA_MAX_BUF_SIZE 1024
 
-
-
 static const int frequency_list[] = {
        2412, 2417, 2422, 2427, 2432, 2437, 2442,
        2447, 2452, 2457, 2462, 2467, 2472, 2484
@@ -58,9 +56,6 @@ static int msglevel = MSG_LEVEL_INFO;
 
 /*---------------------  Static Functions  --------------------------*/
 
-
-
-
 /*---------------------  Export Variables  --------------------------*/
 static void wpadev_setup(struct net_device *dev)
 {
@@ -126,7 +121,6 @@ static int wpa_init_wpadev(PSDevice pDevice)
        return 0;
 }
 
-
 /*
  * Description:
  *      unregister net_device (wpadev)
@@ -158,10 +152,6 @@ static int wpa_release_wpadev(PSDevice pDevice)
        return 0;
 }
 
-
-
-
-
 /*
  * Description:
  *      Set enable/disable dev for wpa supplicant daemon
@@ -184,7 +174,6 @@ int wpa_set_wpadev(PSDevice pDevice, int val)
                return wpa_release_wpadev(pDevice);
 }
 
-
 /*
  * Description:
  *      Set WPA algorithm & keys
@@ -212,7 +201,6 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel)
        int ret = 0;
        int uu, ii;
 
-
        if (param->u.wpa_key.alg_name > WPA_ALG_CCMP ||
            param->u.wpa_key.key_len >= MAX_KEY_LEN ||
            param->u.wpa_key.seq_len >= MAX_KEY_LEN)
@@ -234,8 +222,7 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel)
        //spin_unlock_irq(&pDevice->lock);
        if (param->u.wpa_key.key && fcpfkernel) {
                memcpy(&abyKey[0], param->u.wpa_key.key, param->u.wpa_key.key_len);
-       }
-       else {
+       } else {
                spin_unlock_irq(&pDevice->lock);
                if (param->u.wpa_key.key &&
                    copy_from_user(&abyKey[0], param->u.wpa_key.key, param->u.wpa_key.key_len)) {
@@ -250,8 +237,7 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel)
        if (param->u.wpa_key.alg_name == WPA_ALG_WEP) {
                if (dwKeyIndex > 3) {
                        return -EINVAL;
-               }
-               else {
+               } else {
                        if (param->u.wpa_key.set_tx) {
                                pDevice->byKeyIndex = (unsigned char)dwKeyIndex;
                                pDevice->bTransmitKey = true;
@@ -275,8 +261,7 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel)
        //spin_unlock_irq(&pDevice->lock);
        if (param->u.wpa_key.seq && fcpfkernel) {
                memcpy(&abySeq[0], param->u.wpa_key.seq, param->u.wpa_key.seq_len);
-       }
-       else {
+       } else {
                spin_unlock_irq(&pDevice->lock);
                if (param->u.wpa_key.seq &&
                    copy_from_user(&abySeq[0], param->u.wpa_key.seq, param->u.wpa_key.seq_len)) {
@@ -313,7 +298,6 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel)
        if (param->u.wpa_key.set_tx)
                dwKeyIndex |= (1 << 31);
 
-
        if (pDevice->eEncryptionStatus == Ndis802_11Encryption3Enabled)
                byKeyDecMode = KEY_CTL_CCMP;
        else if (pDevice->eEncryptionStatus == Ndis802_11Encryption2Enabled)
@@ -441,10 +425,8 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel)
 */
 
        return ret;
-
 }
 
-
 /*
  * Description:
  *      enable wpa auth & mode
@@ -462,7 +444,6 @@ int wpa_set_keys(PSDevice pDevice, void *ctx, bool fcpfkernel)
 static int wpa_set_wpa(PSDevice pDevice,
                       struct viawget_wpa_param *param)
 {
-
        PSMgmtObject    pMgmt = pDevice->pMgmt;
        int ret = 0;
 
@@ -472,9 +453,6 @@ static int wpa_set_wpa(PSDevice pDevice,
        return ret;
 }
 
-
-
-
 /*
  * Description:
  *      set disassociate
@@ -505,8 +483,6 @@ static int wpa_set_disassociate(PSDevice pDevice,
        return ret;
 }
 
-
-
 /*
  * Description:
  *      enable scan process
@@ -534,8 +510,6 @@ static int wpa_set_scan(PSDevice pDevice,
        return ret;
 }
 
-
-
 /*
  * Description:
  *      get bssid
@@ -559,10 +533,8 @@ static int wpa_get_bssid(PSDevice pDevice,
        memcpy(param->u.wpa_associate.bssid, pMgmt->abyCurrBSSID , 6);
 
        return ret;
-
 }
 
-
 /*
  * Description:
  *      get bssid
@@ -592,8 +564,6 @@ static int wpa_get_ssid(PSDevice pDevice,
        return ret;
 }
 
-
-
 /*
  * Description:
  *      get scan results
@@ -623,12 +593,9 @@ static int wpa_get_scan(PSDevice pDevice,
 
        unsigned char *ptempBSS;
 
-
-
        ptempBSS = kmalloc(sizeof(KnownBSS), (int)GFP_ATOMIC);
 
        if (ptempBSS == NULL) {
-
                printk("bubble sort kmalloc memory fail@@@\n");
 
                ret = -ENOMEM;
@@ -638,13 +605,10 @@ static int wpa_get_scan(PSDevice pDevice,
        }
 
        for (ii = 0; ii < MAX_BSS_NUM; ii++) {
-
                for (jj = 0; jj < MAX_BSS_NUM - ii - 1; jj++) {
-
                        if ((pMgmt->sBSSList[jj].bActive != true) ||
 
                            ((pMgmt->sBSSList[jj].uRSSI > pMgmt->sBSSList[jj + 1].uRSSI) && (pMgmt->sBSSList[jj + 1].bActive != false))) {
-
                                memcpy(ptempBSS, &pMgmt->sBSSList[jj], sizeof(KnownBSS));
 
                                memcpy(&pMgmt->sBSSList[jj], &pMgmt->sBSSList[jj + 1], sizeof(KnownBSS));
@@ -658,22 +622,10 @@ static int wpa_get_scan(PSDevice pDevice,
        }
 
        kfree(ptempBSS);
-
-       // printk("bubble sort result:\n");
-
-       //for (ii = 0; ii < MAX_BSS_NUM; ii++)
-
-       //    printk("%d [%s]:RSSI=%d\n",ii,((PWLAN_IE_SSID)(pMgmt->sBSSList[ii].abySSID))->abySSID,
-
-       //                                                                 pMgmt->sBSSList[ii].uRSSI);
-
 #endif
 
 //******mike:bubble sort by stronger RSSI*****//
 
-
-
-
        count = 0;
        pBSS = &(pMgmt->sBSSList[0]);
        for (ii = 0; ii < MAX_BSS_NUM; ii++) {
@@ -733,8 +685,6 @@ static int wpa_get_scan(PSDevice pDevice,
        return ret;
 }
 
-
-
 /*
  * Description:
  *      set associate with AP
@@ -767,7 +717,6 @@ static int wpa_set_associate(PSDevice pDevice,
        DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "mode = %d\n", param->u.wpa_associate.mode);
        DBG_PRT(MSG_LEVEL_DEBUG, KERN_INFO "wpa_ie_len = %d\n", param->u.wpa_associate.wpa_ie_len);
 
-
        if (param->u.wpa_associate.wpa_ie_len) {
                if (!param->u.wpa_associate.wpa_ie)
                        return -EINVAL;
@@ -790,8 +739,7 @@ static int wpa_set_associate(PSDevice pDevice,
        // set bssid
        if (memcmp(param->u.wpa_associate.bssid, &abyNullAddr[0], 6) != 0)
                memcpy(pMgmt->abyDesireBSSID, param->u.wpa_associate.bssid, 6);
-       else
-       {
+       else {
                bScheduleCommand((void *)pDevice, WLAN_CMD_BSSID_SCAN, pItemSSID->abySSID);
        }
 
@@ -842,8 +790,7 @@ static int wpa_set_associate(PSDevice pDevice,
                pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled;
                //pMgmt->eAuthenMode = WMAC_AUTH_SHAREKEY;
                pMgmt->bShareKeyAlgorithm = true;
-       }
-       else if (pMgmt->eAuthenMode == WMAC_AUTH_OPEN) {
+       } else if (pMgmt->eAuthenMode == WMAC_AUTH_OPEN) {
                if (!bWepEnabled)  pDevice->eEncryptionStatus = Ndis802_11EncryptionDisabled;
                else pDevice->eEncryptionStatus = Ndis802_11Encryption1Enabled;
                //pMgmt->eAuthenMode = WMAC_AUTH_OPEN;
@@ -886,7 +833,6 @@ static int wpa_set_associate(PSDevice pDevice,
        return ret;
 }
 
-
 /*
  * Description:
  *      wpa_ioctl main function supported for wpa supplicant
@@ -993,4 +939,3 @@ out:
 
        return ret;
 }
-