diff options
author | Dmitry Shmidt <dimitrysh@google.com> | 2010-09-01 14:44:40 -0700 |
---|---|---|
committer | Dmitry Shmidt <dimitrysh@google.com> | 2010-09-01 14:44:40 -0700 |
commit | 566da93a1d2ebe1e0b7a556f61882b8b9dfe5c6d (patch) | |
tree | edddae479c9b937ec9fe4f99c527d78f65bffab7 | |
parent | 652eb8d0d0417993ad841e70260e62360ab19c15 (diff) | |
download | wlan-566da93a1d2ebe1e0b7a556f61882b8b9dfe5c6d.tar.gz |
wl1271: Froyo patches from Moto
* Increase max beacon body length
* Faster WiFi wakeup
* Fix SDIO failure
* WiFi data connectivity improvements
* WiFi IOT improvements
* WiFi stuck at high current drain
Change-Id: I9d9b6bfd2f3ae319231d2bc1abf2eb3e9053d56b
Signed-off-by: Dmitry Shmidt <dimitrysh@google.com>
-rw-r--r-- | wl1271/TWD/Data_Service/RxQueue.c | 2 | ||||
-rw-r--r-- | wl1271/TWD/FW_Transfer/HwInit.c | 2 | ||||
-rw-r--r-- | wl1271/config/tiwlan.ini | 11 | ||||
-rw-r--r-- | wl1271/external_drivers/sdio/linux/SdioDrv.c | 131 | ||||
-rw-r--r-- | wl1271/platforms/os/linux/src/CmdInterpretWext.c | 3 | ||||
-rw-r--r-- | wl1271/platforms/os/linux/wl_env.bash | 2 | ||||
-rw-r--r-- | wl1271/stad/src/Ctrl_Interface/DrvMain.c | 2 | ||||
-rw-r--r-- | wl1271/stad/src/Data_link/TrafficMonitor.c | 2 | ||||
-rw-r--r-- | wl1271/stad/src/Data_link/rx.c | 2 | ||||
-rw-r--r-- | wl1271/utils/802_11Defs.h | 5 |
10 files changed, 96 insertions, 66 deletions
diff --git a/wl1271/TWD/Data_Service/RxQueue.c b/wl1271/TWD/Data_Service/RxQueue.c index 67989a8..ec5ce9b 100644 --- a/wl1271/TWD/Data_Service/RxQueue.c +++ b/wl1271/TWD/Data_Service/RxQueue.c @@ -964,7 +964,7 @@ void RxQueue_ReceivePacket (TI_HANDLE hRxQueue, const void * pBuffer) } - TRACE1(pRxQueue->hReport, REPORT_SEVERITY_ERROR, "RxQueue_ReceivePacket: unknow type tag. tag = %d\n", pRxParams->packet_class_tag); + TRACE1(pRxQueue->hReport, REPORT_SEVERITY_INFORMATION, "RxQueue_ReceivePacket: unknow type tag. tag = %d\n", pRxParams->packet_class_tag); RxQueue_PassPacket (pRxQueue, tStatus, pBuffer); diff --git a/wl1271/TWD/FW_Transfer/HwInit.c b/wl1271/TWD/FW_Transfer/HwInit.c index 8e7b3dc..addca88 100644 --- a/wl1271/TWD/FW_Transfer/HwInit.c +++ b/wl1271/TWD/FW_Transfer/HwInit.c @@ -740,7 +740,7 @@ static TI_STATUS hwInit_BootSm (TI_HANDLE hHwInit) /* Then, move it 4 places to the right, to alter Fref relevant bits in register 0x2c */ clkVal = pHwInit->aHwInitTxn[pHwInit->uTxnIndex].uData; pHwInit->uTxnIndex = 0; /* Reset index only after getting the last read value! */ - clkVal |= (pGenParams->RefClk << 1) << 4; + clkVal |= ((pGenParams->RefClk & 0x3)<< 1) << 4; if ((pGenParams->GeneralSettings & DRPw_MASK_CHECK) > 0) { clkVal |= DRPw_MASK_SET; diff --git a/wl1271/config/tiwlan.ini b/wl1271/config/tiwlan.ini index 87bfbff..f959d86 100644 --- a/wl1271/config/tiwlan.ini +++ b/wl1271/config/tiwlan.ini @@ -28,7 +28,7 @@ PowerMgmtHangOverPeriod = 10 #in mSec units AutoPowerModeDozeMode = 3 #2 - Short Doze #3 - Long Doze -AutoPowerModeActiveTh = 8 #packets per second (default 15) +AutoPowerModeActiveTh = 2 #packets per second (default 15) AutoPowerModeDozeTh = 4 #packets per seconds - threshold for entering ELP in Auto mode (default 8) @@ -120,7 +120,10 @@ OsDbgState = 0x01e9003c # -1 or 0xffffffff -all (opens debug messages in # Byte #6: Console ############################################################# -ReportSeverityTable = 00001101 +# LAUNCH Logging Mask +ReportSeverityTable = 0000000 +# Default Logging Mask +# ReportSeverityTable = 0001101 BeaconReceiveTime = 50 @@ -204,7 +207,7 @@ BaPolicyTid_0 = 3 ############################################################################################################################## ################################ General parameters ################################ -STRFRefClock = 1 # Unit: Options 5'bXX000 : Bit 0,1,2 - (0: 19.2MHz; 1: 26MHz; 2: 38.4MHz (Default); 3: 52MHz; 4: 38.4MHz XTAL) ; +STRFRefClock = 9 # Unit: Options 5'bXX000 : Bit 0,1,2 - (0: 19.2MHz; 1: 26MHz; 2: 38.4MHz (Default); 3: 52MHz; 4: 38.4MHz XTAL) ; # 5'bX0XXX : Bit 3 - CLK_REQ type; 0 = wired-OR (Default) , 1= push-pull # 5'b0XXXX : Bit 4 - CLK_REQ polarity; 0 = Normal (Default) , 1=Inverted, Format: Unsigned, Source: Customer STRFRefClockSettingTime = 5 @@ -218,7 +221,7 @@ Settings = 65 # 0x41 Unit: Options (Bit0: NBI (0: Off; 1: On) # Bit6: LPD Low band, Bit7: LPD High band # Smart Reflex params -SRState = 1 # Unit: Options ( 1 - Enabled 0- Disabled) Format: Decimal, Source: TI +SRState = 0 # Unit: Options ( 1 - Enabled 0- Disabled) Format: Decimal, Source: TI SRF1 = 07,03,18,10,05,fb,f0,e8, 0,0,0,0,0,0,0f,3f # Unit: SRF1 values, Format: Signed, Source: TI SRF2 = 07,03,18,10,05,f6,f0,e8 # Unit: SRF2 values, Format: Signed, Source: TI SRF3 = 07,03,18,10,05,fb,f0,e8 # Unit: SRF3 values, Format: Signed, Source: TI diff --git a/wl1271/external_drivers/sdio/linux/SdioDrv.c b/wl1271/external_drivers/sdio/linux/SdioDrv.c index e3c9b55..171c0a6 100644 --- a/wl1271/external_drivers/sdio/linux/SdioDrv.c +++ b/wl1271/external_drivers/sdio/linux/SdioDrv.c @@ -594,8 +594,71 @@ static void sdiodrv_free_resources(void) int sdioDrv_InitHw(void) { + int rc; + u32 status; +#ifdef SDIO_1_BIT /* see also in SdioAdapter.c */ + unsigned long clock_rate = 6000000; +#else + unsigned long clock_rate = 24000000; +#endif + + printk(KERN_INFO "TIWLAN SDIO sdioDrv_InitHw()!!"); + + rc = sdioDrv_clk_enable(); + if (rc) { + PERR("sdioDrv_InitHw : sdioDrv_clk_enable FAILED !!!\n"); + goto err; + } + + OMAP3430_mmc_reset(); + + //obc - init sequence p. 3600,3617 + /* 1.8V */ + OMAP_HSMMC_WRITE(CAPA, OMAP_HSMMC_READ(CAPA) | VS18); + OMAP_HSMMC_WRITE(HCTL, OMAP_HSMMC_READ(HCTL) | SDVS18);//SDVS fits p. 3650 + /* clock gating */ + OMAP_HSMMC_WRITE(SYSCONFIG, OMAP_HSMMC_READ(SYSCONFIG) | AUTOIDLE); + + /* bus power */ + OMAP_HSMMC_WRITE(HCTL, OMAP_HSMMC_READ(HCTL) | SDBP);//SDBP fits p. 3650 + /* interrupts */ + OMAP_HSMMC_WRITE(ISE, 0); + OMAP_HSMMC_WRITE(IE, IE_EN_MASK); + + //p. 3601 suggests moving to the end + OMAP3430_mmc_set_clock(clock_rate, &g_drv); + printk("SDIO clock Configuration is now set to %dMhz\n",(int)clock_rate/1000000); + + /* Bus width */ +#ifdef SDIO_1_BIT /* see also in SdioAdapter.c */ + PDEBUG("%s() setting %d data lines\n",__FUNCTION__, 1); + OMAP_HSMMC_WRITE(HCTL, OMAP_HSMMC_READ(HCTL) & (ONE_BIT)); +#else + PDEBUG("%s() setting %d data lines\n",__FUNCTION__, 4); + OMAP_HSMMC_WRITE(HCTL, OMAP_HSMMC_READ(HCTL) | (1 << 1));//DTW 4 bits - p. 3650 +#endif + + /* send the init sequence. 80 clocks of synchronization in the SDIO */ + //doesn't match p. 3601,3617 - obc + OMAP_HSMMC_WRITE( CON, OMAP_HSMMC_READ(CON) | INIT_STREAM); + OMAP_HSMMC_SEND_COMMAND( 0, 0); + status = sdiodrv_poll_status(OMAP_HSMMC_STAT, CC, MMC_TIMEOUT_MS); + if (!(status & CC)) { + PERR("sdioDrv_InitHw() SDIO Command error status = 0x%x\n", status); + rc = status; + goto err; + } + OMAP_HSMMC_WRITE(CON, OMAP_HSMMC_READ(CON) & ~INIT_STREAM); + return 0; -} /* sdioDrv_InitHw */ + +err: + /* Disabling clocks for now */ + sdioDrv_clk_disable(); + + return rc; + +} /* sdiodrv_InitHw */ void sdiodrv_shutdown(void) { @@ -1070,12 +1133,6 @@ int sdioDrv_WriteSyncBytes (unsigned int uFunc, static int sdioDrv_probe(struct platform_device *pdev) { int rc; - u32 status; -#ifdef SDIO_1_BIT /* see also in SdioAdapter.c */ - unsigned long clock_rate = 6000000; -#else - unsigned long clock_rate = 24000000; -#endif printk(KERN_INFO "TIWLAN SDIO probe: initializing mmc%d device\n", pdev->id + 1); @@ -1087,7 +1144,7 @@ static int sdioDrv_probe(struct platform_device *pdev) rc= request_irq(OMAP_MMC_IRQ, sdiodrv_irq, 0, SDIO_DRIVER_NAME, &g_drv); if (rc != 0) { - PERR("sdioDrv_InitHw() - request_irq FAILED!!\n"); + PERR("sdioDrv_probe() - request_irq FAILED!!\n"); return rc; } sdiodrv_irq_requested = 1; @@ -1120,54 +1177,20 @@ static int sdioDrv_probe(struct platform_device *pdev) } sdiodrv_iclk_got = 1; - rc = sdioDrv_clk_enable(); - if (rc) { - PERR("sdioDrv_probe : clk_enable FAILED !!!\n"); - goto err; + printk("Configuring SDIO DMA registers!!!\n"); + printk("pdev->id is %d!!!\n", pdev->id); + if ( pdev->id == 1 ) { + /* MMC2 */ + TIWLAN_MMC_CONTROLLER_BASE_ADDR = OMAP_HSMMC2_BASE; + TIWLAN_MMC_DMA_TX = OMAP24XX_DMA_MMC2_TX; + TIWLAN_MMC_DMA_RX = OMAP24XX_DMA_MMC2_RX; } - - OMAP3430_mmc_reset(); - - //obc - init sequence p. 3600,3617 - /* 1.8V */ - OMAP_HSMMC_WRITE(CAPA, OMAP_HSMMC_READ(CAPA) | VS18); - OMAP_HSMMC_WRITE(HCTL, OMAP_HSMMC_READ(HCTL) | SDVS18);//SDVS fits p. 3650 - /* clock gating */ - OMAP_HSMMC_WRITE(SYSCONFIG, OMAP_HSMMC_READ(SYSCONFIG) | AUTOIDLE); - - /* bus power */ - OMAP_HSMMC_WRITE(HCTL, OMAP_HSMMC_READ(HCTL) | SDBP);//SDBP fits p. 3650 - /* interrupts */ - OMAP_HSMMC_WRITE(ISE, 0); - OMAP_HSMMC_WRITE(IE, IE_EN_MASK); - - //p. 3601 suggests moving to the end - OMAP3430_mmc_set_clock(clock_rate, &g_drv); - printk(KERN_INFO "SDIO clock Configuration is now set to %dMhz\n",(int)clock_rate/1000000); - - /* Bus width */ -#ifdef SDIO_1_BIT /* see also in SdioAdapter.c */ - PDEBUG("%s() setting %d data lines\n",__FUNCTION__, 1); - OMAP_HSMMC_WRITE(HCTL, OMAP_HSMMC_READ(HCTL) & (ONE_BIT)); -#else - PDEBUG("%s() setting %d data lines\n",__FUNCTION__, 4); - OMAP_HSMMC_WRITE(HCTL, OMAP_HSMMC_READ(HCTL) | (1 << 1));//DTW 4 bits - p. 3650 -#endif - - /* send the init sequence. 80 clocks of synchronization in the SDIO */ - //doesn't match p. 3601,3617 - obc - OMAP_HSMMC_WRITE( CON, OMAP_HSMMC_READ(CON) | INIT_STREAM); - OMAP_HSMMC_SEND_COMMAND( 0, 0); - status = sdiodrv_poll_status(OMAP_HSMMC_STAT, CC, MMC_TIMEOUT_MS); - if (!(status & CC)) { - PERR("sdioDrv_InitHw() SDIO Command error status = 0x%x\n", status); - rc = -1; - goto err; + else if ( pdev->id == 2 ) { + /* MMC3 */ + TIWLAN_MMC_CONTROLLER_BASE_ADDR = OMAP_HSMMC3_BASE; + TIWLAN_MMC_DMA_TX = OMAP34XX_DMA_MMC3_TX; + TIWLAN_MMC_DMA_RX = OMAP34XX_DMA_MMC3_RX; } - OMAP_HSMMC_WRITE(CON, OMAP_HSMMC_READ(CON) & ~INIT_STREAM); - - /* Disabling clocks for now */ - sdioDrv_clk_disable(); /* inactivity timer initialization*/ init_timer(&g_drv.inact_timer); diff --git a/wl1271/platforms/os/linux/src/CmdInterpretWext.c b/wl1271/platforms/os/linux/src/CmdInterpretWext.c index 08f6bb2..64e6d41 100644 --- a/wl1271/platforms/os/linux/src/CmdInterpretWext.c +++ b/wl1271/platforms/os/linux/src/CmdInterpretWext.c @@ -83,7 +83,8 @@ typedef struct } cckm_assocInformation_t; #define ASSOC_RESP_FIXED_DATA_LEN 6 -#define MAX_BEACON_BODY_LENGTH 350 +/* 1500 is the recommended size by the Motorola Standard team. TI recommendation is 700 */ +#define MAX_BEACON_BODY_LENGTH 1500 #define BEACON_HEADER_FIX_SIZE 12 #define CCKM_START_EVENT_SIZE 23 /* cckm-start string + timestamp + bssid + null */ #endif diff --git a/wl1271/platforms/os/linux/wl_env.bash b/wl1271/platforms/os/linux/wl_env.bash index 9bce082..234e0b3 100644 --- a/wl1271/platforms/os/linux/wl_env.bash +++ b/wl1271/platforms/os/linux/wl_env.bash @@ -2,5 +2,5 @@ export CROSS_COMPILE=arm-eabi- export ARCH=arm export HOST_PLATFORM=sholes -export KERNEL_DIR=/usr/local/google/android/froyo/kernel +export KERNEL_DIR=/usr/local/google/android/master/kernel diff --git a/wl1271/stad/src/Ctrl_Interface/DrvMain.c b/wl1271/stad/src/Ctrl_Interface/DrvMain.c index 1838493..3ce112d 100644 --- a/wl1271/stad/src/Ctrl_Interface/DrvMain.c +++ b/wl1271/stad/src/Ctrl_Interface/DrvMain.c @@ -1286,7 +1286,6 @@ TI_STATUS drvMain_Recovery (TI_HANDLE hDrvMain) { TDrvMain *pDrvMain = (TDrvMain *) hDrvMain; - pDrvMain->uNumOfRecoveryAttempts++; if (!pDrvMain->bRecovery) { TRACE1(pDrvMain->tStadHandles.hReport, REPORT_SEVERITY_CONSOLE,".....drvMain_Recovery, ts=%d\n", os_timeStampMs(pDrvMain->tStadHandles.hOs)); @@ -1731,6 +1730,7 @@ static void drvMain_Sm (TI_HANDLE hDrvMain, ESmEvent eEvent) } else if (pDrvMain->uNumOfRecoveryAttempts < MAX_NUM_OF_RECOVERY_TRIGGERS) { + pDrvMain->uNumOfRecoveryAttempts++; pDrvMain->eSmState = SM_STATE_STOPPING; eStatus = drvMain_StopActivities (pDrvMain); } diff --git a/wl1271/stad/src/Data_link/TrafficMonitor.c b/wl1271/stad/src/Data_link/TrafficMonitor.c index 501111c..08f7f46 100644 --- a/wl1271/stad/src/Data_link/TrafficMonitor.c +++ b/wl1271/stad/src/Data_link/TrafficMonitor.c @@ -1192,9 +1192,11 @@ static void TrafficMonitor_ChangeDownTimerStatus (TI_HANDLE hTrafficMonitor, TI_ { pTrafficMonitor->DownTimerEnabled = TI_FALSE; tmr_StopTimer (pTrafficMonitor->hTrafficMonTimer); + os_wake_unlock(pTrafficMonitor->hOs); } else if ((downEventsFound > 0) && (pTrafficMonitor->DownTimerEnabled == TI_FALSE)) { + os_wake_lock(pTrafficMonitor->hOs); pTrafficMonitor->DownTimerEnabled = TI_TRUE; /* Start the timer with user defined percentage of the the minimum interval discovered earlier */ tmr_StartTimer (pTrafficMonitor->hTrafficMonTimer, diff --git a/wl1271/stad/src/Data_link/rx.c b/wl1271/stad/src/Data_link/rx.c index 504387a..c197963 100644 --- a/wl1271/stad/src/Data_link/rx.c +++ b/wl1271/stad/src/Data_link/rx.c @@ -985,7 +985,7 @@ void rxData_receivePacketFromWlan (TI_HANDLE hRxData, void *pBuffer, TRxAttr* pR } default: - TRACE0(pRxData->hReport, REPORT_SEVERITY_ERROR, " rxData_receivePacketFromWlan(): Received unspecified packet type !!! \n"); + TRACE0(pRxData->hReport, REPORT_SEVERITY_INFORMATION, " rxData_receivePacketFromWlan(): Received unspecified packet type !!! \n"); RxBufFree(pRxData->hOs, pBuffer); break; } diff --git a/wl1271/utils/802_11Defs.h b/wl1271/utils/802_11Defs.h index 1895af0..d8109c3 100644 --- a/wl1271/utils/802_11Defs.h +++ b/wl1271/utils/802_11Defs.h @@ -345,8 +345,9 @@ NOTE: We only support packets coming from within the DS (i.e. From DS = 0) /* mgmt body max length */ #define MAX_MGMT_BODY_LENGTH 2312 /* maximal length of beacon body - note that actual beacons may actually be longer - than this size, at least according to the spec, but so far no larger beacon was seen */ -#define MAX_BEACON_BODY_LENGTH 350 + than this size, at least according to the spec, but so far no larger beacon was seen + Note: 1500 is the recommended size by the Motorola Standard team. TI recommendation is 700*/ +#define MAX_BEACON_BODY_LENGTH 1500 /* general mgmt frame structure */ typedef struct |