wifi: update mt5931 driver to 2.07
authorhwg <hwg@rock-chips.com>
Mon, 14 Jan 2013 15:06:29 +0000 (23:06 +0800)
committerhwg <hwg@rock-chips.com>
Mon, 14 Jan 2013 15:06:29 +0000 (23:06 +0800)
drivers/net/wireless/mt5931/Makefile
drivers/net/wireless/mt5931/common/wlan_oid.c
drivers/net/wireless/mt5931/include/wlan_oid.h
drivers/net/wireless/mt5931/nic/que_mgt.c
drivers/net/wireless/mt5931/os/wifi_version.h

index 413cc4a79cdfb094c64e0f55e46e440f606ddbe3..90833aa5bfaa17c138b87658bb5b05ce9b636cf8 100755 (executable)
@@ -33,6 +33,8 @@ MODULE_NAME := wlan  ##mark skynine modify MT6620-->MT5931
 
 ccflags-y += -D_HIF_SDIO=1
 
+ccflags-y += -DRSSI_ENHANCE=0
+
 ccflags-y += -DDBG=0
 ccflags-y += -I$(src)/os -I$(src)/os/linux/include -I$(src)/os/linux/hif/sdio/include
 ccflags-y += -I$(src)/include -I$(src)/include/nic -I$(src)/include/mgmt
index 22c77a495e8ad899d1ba9618e99e24890515a93f..e4b767bb923d67084d6767a8484027d84d133c63 100755 (executable)
@@ -1509,7 +1509,28 @@ wlanoidQueryBssidList (
             kalMemCopy(prBssidEx,
                     &(prAdapter->rWlanInfo.arScanResult[i]),
                     OFFSET_OF(PARAM_BSSID_EX_T, aucIEs));
+                       
+#if RSSI_ENHANCE
+            BOOLEAN bInitial = FALSE;
+            if (!(prBssidEx->AvgRssiX8 | prBssidEx->AvgRssi))
+            {
+                bInitial = TRUE;
+            }
+
+            if (bInitial)
+            {
+                prBssidEx->AvgRssiX8 = prBssidEx->rRssi << 3;
+                prBssidEx->AvgRssi  = prBssidEx->rRssi;
+            } else {
+                prBssidEx->AvgRssiX8 = (prBssidEx->AvgRssiX8 - prBssidEx->AvgRssi) + prBssidEx->rRssi;
+            //DBGLOG(REQ, WARN,  ("%s:: prBssidEx->AvgRssiX8 = %d, prBssidEx->AvgRssi = %d, prBssidEx->rRssi= %d\n", __func__, prBssidEx->AvgRssiX8, prBssidEx->AvgRssi, prBssidEx->rRssi));
+            }
 
+            prBssidEx->AvgRssi = prBssidEx->AvgRssiX8 >> 3;
+            prBssidEx->AvgRssi +=10;
+            prBssidEx->rRssi = prBssidEx->AvgRssi;                     
+#endif
             /*For WHQL test, Rssi should be in range -10 ~ -200 dBm*/
             if(prBssidEx->rRssi > PARAM_WHQL_RSSI_MAX_DBM) {
                 prBssidEx->rRssi = PARAM_WHQL_RSSI_MAX_DBM;
@@ -1816,6 +1837,9 @@ wlanoidSetBssidListScanExt (
 * \retval WLAN_STATUS_ADAPTER_NOT_READY
 */
 /*----------------------------------------------------------------------------*/
+#if RSSI_ENHANCE
+static int ORssi = 0;time = 2; // add by gwl 
+#endif
 WLAN_STATUS
 wlanoidSetBssid (
     IN  P_ADAPTER_T       prAdapter,
@@ -4388,7 +4412,23 @@ wlanoidQueryRssi (
         PARAM_RSSI rRssi;
 
         rRssi = (PARAM_RSSI)prAdapter->rLinkQuality.cRssi; // ranged from (-128 ~ 30) in unit of dBm
-
+#if RSSI_ENHANCE
+       // add by gwl   
+       rRssi += 10;
+       if (ORssi == 0) ORssi = rRssi;
+       else if ((ORssi - rRssi) > 8) {
+               if (time > 0) {
+                       rRssi = ORssi;
+                       time--;
+               } else {
+                       time = 2;
+                       ORssi = rRssi;
+               }
+       }else {
+               time = 2;
+               ORssi = rRssi;
+       }
+#endif                                         
         if(rRssi > PARAM_WHQL_RSSI_MAX_DBM)
             rRssi = PARAM_WHQL_RSSI_MAX_DBM;
         else if(rRssi < PARAM_WHQL_RSSI_MIN_DBM)
index ea28d126b9f11d6c20d6f356717d99bd8e927e8d..f5215298bf856008d8f8206f494cb47c1a0eaa19 100755 (executable)
@@ -468,6 +468,8 @@ typedef struct _PARAM_BSSID_EX_T {
     PARAM_SSID_T                    rSsid;               /*!< SSID */
     UINT_32                         u4Privacy;            /*!< Need WEP encryption */
     PARAM_RSSI                      rRssi;               /*!< in dBm */
+    PARAM_RSSI                      AvgRssiX8;
+    PARAM_RSSI                      AvgRssi;
     ENUM_PARAM_NETWORK_TYPE_T       eNetworkTypeInUse;
     PARAM_802_11_CONFIG_T           rConfiguration;
     ENUM_PARAM_OP_MODE_T            eOpMode;
index 799b077d45b69f503dddaea2f9709f39cf3ea30b..74ae5aba8126cce3ced92f74a25b117bd12f29f9 100755 (executable)
@@ -3131,10 +3131,11 @@ qmPopOutDueToFallWithin(
         else{
            if (TRUE == fgMissing &&
                CHECK_FOR_TIMEOUT(rCurrentTime, (*prMissTimeout), 
-                                  MSEC_TO_SEC(QM_RX_BA_ENTRY_MISS_TIMEOUT_MS))) {
-                //DBGLOG(QM, TRACE, ("RX BA timeout, next tid %d, SSN %d\n", 
-                //        prReorderQueParm->ucTid, prReorderedSwRfb->u2SSN));
-                fgDequeuHead == TRUE;
+                                  //MSEC_TO_SEC(QM_RX_BA_ENTRY_MISS_TIMEOUT_MS))) {
+                                  MSEC_TO_SYSTIME(QM_RX_BA_ENTRY_MISS_TIMEOUT_MS))) {
+                DBGLOG(QM, TRACE, ("RX BA timeout, next tid %d, SSN %d\n", 
+                        prReorderQueParm->ucTid, prReorderedSwRfb->u2SSN));
+                fgDequeuHead = TRUE;
                 prReorderQueParm->u2WinStart = (((prReorderedSwRfb->u2SSN) + 1) % MAX_SEQ_NO_COUNT);
                 fgMissing = FALSE;
              
@@ -4544,8 +4545,8 @@ qmHandleEventBssAbsencePresence(
     //DBGLOG(QM, TRACE, ("qmHandleEventBssAbsencePresence (ucNetTypeIdx=%d, fgIsAbsent=%d, FreeQuota=%d)\n",
     //    prEventBssStatus->ucNetTypeIdx, prBssInfo->fgIsNetAbsent, prBssInfo->ucBssFreeQuota));
 
-    //DBGLOG(QM, TRACE, ("NAF=%d,%d,%d\n",
-    //    prEventBssStatus->ucNetTypeIdx, prBssInfo->fgIsNetAbsent, prBssInfo->ucBssFreeQuota));
+    DBGLOG(QM, TRACE, ("NAF=%d,%d,%d\n",
+        prEventBssStatus->ucNetTypeIdx, prBssInfo->fgIsNetAbsent, prBssInfo->ucBssFreeQuota));
 
     if(!prBssInfo->fgIsNetAbsent) {
           QM_DBG_CNT_INC(&(prAdapter->rQM),QM_DBG_CNT_27);
index 0d587ce540fbc4e45913ccdc06e1613b3fcb46ef..38170497499a6a83669612e2f2980932829ea127 100755 (executable)
@@ -7,7 +7,7 @@
 /*
  * Marvell MV8686 driver version.
  */
-#define MT5931_DRV_VERSION "2.04"
+#define MT5931_DRV_VERSION "2.07"
 
 #endif /* WIFI_VERSION_H */