From 005bbf20350954d05c8a111d3f487d6fddb049bb Mon Sep 17 00:00:00 2001 From: Dmitry Shmidt Date: Wed, 10 Mar 2010 16:24:37 -0800 Subject: wl1271: Sync with Moto drop Change-Id: If1cb49c1b8ac4cc1fc63eba70928484d31065b08 Signed-off-by: Dmitry Shmidt --- wl1271/platforms/os/common/build/linux/common.inc | 10 ++++ wl1271/platforms/os/common/src/osRgstry.c | 6 ++- wl1271/platforms/os/linux/build/common.inc | 10 ++++ wl1271/platforms/os/linux/src/CmdInterpretWext.c | 55 +++++++++++++++++-- wl1271/platforms/os/linux/src/RxBuf.c | 2 + wl1271/platforms/os/linux/src/WlanDrvIf.c | 66 ++++++++++++----------- 6 files changed, 113 insertions(+), 36 deletions(-) (limited to 'wl1271/platforms') diff --git a/wl1271/platforms/os/common/build/linux/common.inc b/wl1271/platforms/os/common/build/linux/common.inc index 305e864..86e9235 100644 --- a/wl1271/platforms/os/common/build/linux/common.inc +++ b/wl1271/platforms/os/common/build/linux/common.inc @@ -33,6 +33,12 @@ FW ?= 1273 # XCC ?= n + +# +# Compile with GEM support or not +# +GEM ?= n + # # Choose the bus type (n for SDIO, y for WSPI) # @@ -84,6 +90,10 @@ ifeq ($(XCC),y) DK_DEFINES += -D XCC_MODULE_INCLUDED endif +ifeq ($(GEM),y) + DK_DEFINES += -D GEM_SUPPORTED +endif + ifeq ($(INTR),n) DK_DEFINES += -D PRIODIC_INTERRUPT endif diff --git a/wl1271/platforms/os/common/src/osRgstry.c b/wl1271/platforms/os/common/src/osRgstry.c index 736d872..f2cc731 100644 --- a/wl1271/platforms/os/common/src/osRgstry.c +++ b/wl1271/platforms/os/common/src/osRgstry.c @@ -161,8 +161,10 @@ NDIS_STRING STRdot11BasicRateMask_A = NDIS_STRING_CONST( "dot11BasicRa NDIS_STRING STRdot11SupportedRateMask_A = NDIS_STRING_CONST( "dot11SupportedRateMaskA"); NDIS_STRING STRdot11BasicRateMask_AG = NDIS_STRING_CONST( "dot11BasicRateMaskAG"); NDIS_STRING STRdot11SupportedRateMask_AG = NDIS_STRING_CONST( "dot11SupportedRateMaskAG"); -NDIS_STRING STRdot11BasicRateMask_N = NDIS_STRING_CONST( "STRdot11BasicRateMask_N"); -NDIS_STRING STRdot11SupportedRateMask_N = NDIS_STRING_CONST( "STRdot11SupportedRateMask_N"); +/*** MODS_BEGIN_FOR_11N_RATE_REPORTING ***/ +NDIS_STRING STRdot11BasicRateMask_N = NDIS_STRING_CONST( "dot11BasicRateMask_N"); +NDIS_STRING STRdot11SupportedRateMask_N = NDIS_STRING_CONST( "dot11SupportedRateMask_N"); +/*** MODS_END_FOR_11N_RATE_REPORTING ***/ NDIS_STRING STRRadio11_RxLevel = NDIS_STRING_CONST( "Radio11_RxLevel"); NDIS_STRING STRRadio11_LNA = NDIS_STRING_CONST( "Radio11_LNA"); diff --git a/wl1271/platforms/os/linux/build/common.inc b/wl1271/platforms/os/linux/build/common.inc index 544a854..407c2ca 100644 --- a/wl1271/platforms/os/linux/build/common.inc +++ b/wl1271/platforms/os/linux/build/common.inc @@ -32,6 +32,12 @@ FW ?= 1273 # XCC ?= n + +# +# Compile with GEM support or not +# +GEM ?= n + # # Choose the bus type (n for SDIO, y for WSPI) # @@ -83,6 +89,10 @@ ifeq ($(XCC),y) DK_DEFINES += -D XCC_MODULE_INCLUDED endif +ifeq ($(GEM),y) + DK_DEFINES += -D GEM_SUPPORTED +endif + ifeq ($(INTR),n) DK_DEFINES += -D PRIODIC_INTERRUPT endif diff --git a/wl1271/platforms/os/linux/src/CmdInterpretWext.c b/wl1271/platforms/os/linux/src/CmdInterpretWext.c index 656626f..01e4451 100644 --- a/wl1271/platforms/os/linux/src/CmdInterpretWext.c +++ b/wl1271/platforms/os/linux/src/CmdInterpretWext.c @@ -300,6 +300,10 @@ int cmdInterpret_convertAndExecute(TI_HANDLE hCmdInterpret, TConfigCommand *cmdO struct iw_point *data = (struct iw_point *) cmdObj->buffer1; struct iw_range *range = (struct iw_range *) cmdObj->buffer2; int i; +/* MODS_BEGIN_FOR_11N_RATE_REPORTING */ + ScanBssType_e smeDesiredBssType = BSS_ANY; + paramInfo_t *pParam2; +/* MODS_END_FOR_11N_RATE_REPORTING */ /* Reset structure */ data->length = sizeof(struct iw_range); @@ -333,12 +337,45 @@ int cmdInterpret_convertAndExecute(TI_HANDLE hCmdInterpret, TConfigCommand *cmdO res = cmdDispatch_GetParam (pCmdInterpret->hCmdDispatch, pParam ); CHECK_PENDING_RESULT(res,pParam) +/* MODS_BEGIN_FOR_11N_RATE_REPORTING */ + pParam2 = (paramInfo_t *)os_memoryAlloc(pCmdInterpret->hOs, sizeof(paramInfo_t)); + if (pParam2) + { + pParam2->paramType = SME_DESIRED_BSS_TYPE_PARAM; + pParam2->paramLength = sizeof(ScanBssType_e); + res = cmdDispatch_GetParam(pCmdInterpret->hCmdDispatch, pParam2); + CHECK_PENDING_RESULT(res,pParam2) + smeDesiredBssType = pParam2->content.smeDesiredBSSType; + os_memoryFree(pCmdInterpret->hOs, pParam2, sizeof(paramInfo_t)); + } +/* MODS_END_FOR_11N_RATE_REPORTING */ /* Number of entries in the rates list */ range->num_bitrates = pParam->content.siteMgrDesiredSupportedRateSet.len; for (i=0; icontent.siteMgrDesiredSupportedRateSet.len; i++) { - range->bitrate[i] = ((pParam->content.siteMgrDesiredSupportedRateSet.ratesString[i] & 0x7F) * 500000); +/* MODS_BEGIN_FOR_11N_RATE_REPORTING */ + switch(pParam->content.siteMgrDesiredSupportedRateSet.ratesString[i] & 0x7F) + { + case NET_RATE_MCS0: + case NET_RATE_MCS1: + case NET_RATE_MCS2: + case NET_RATE_MCS3: + case NET_RATE_MCS4: + case NET_RATE_MCS5: + case NET_RATE_MCS6: + case NET_RATE_MCS7: + if (BSS_INDEPENDENT == smeDesiredBssType) + continue; + default: + range->bitrate[i] = ((pParam->content.siteMgrDesiredSupportedRateSet.ratesString[i] & 0x7F) * 500000); + if (63500000 == range->bitrate[i]) + { + range->bitrate[i] = 65000000; /* convert special code 0x7F to 65Mbps */ + } + break; + } +/* MODS_END_FOR_11N_RATE_REPORTING */ } /* RTS threshold */ @@ -709,11 +746,21 @@ int cmdInterpret_convertAndExecute(TI_HANDLE hCmdInterpret, TConfigCommand *cmdO os_memorySet (pCmdInterpret->hOs, &iwe, 0, sizeof(iwe)); iwe.cmd = SIOCGIWRATE; current_val = event + IW_EV_LCP_LEN; - for (j=0; j<16; j++) - { +/* MODS_BEGIN_FOR_11N_RATE_REPORTING */ + for (j=0; j<32; j++) + { if (my_current->SupportedRates[j]) { - iwe.u.bitrate.value = ((my_current->SupportedRates[j] & 0x7f) * 500000); + if ((my_current->SupportedRates[j] & 0x7f) == NET_RATE_MCS7) + { + iwe.u.bitrate.value = 65000000; /* convert the special code 0x7f to 65Mbps */ + } + else + { + iwe.u.bitrate.value = ((my_current->SupportedRates[j] & 0x7f) * 500000); + } + /* printk("Supported Rates [%d] = %d\n", j, iwe.u.bitrate.value); */ +/* MODS_END_FOR_11N_RATE_REPORTING */ #if LINUX_VERSION_CODE < KERNEL_VERSION(2,6,27) current_val = iwe_stream_add_value(event, current_val, end_buf, &iwe,IW_EV_PARAM_LEN); #else diff --git a/wl1271/platforms/os/linux/src/RxBuf.c b/wl1271/platforms/os/linux/src/RxBuf.c index 6197292..4a18acf 100644 --- a/wl1271/platforms/os/linux/src/RxBuf.c +++ b/wl1271/platforms/os/linux/src/RxBuf.c @@ -54,7 +54,9 @@ void *RxBufAlloc(TI_HANDLE hOs, TI_UINT32 len,PacketClassTag_e ePacketClassTag) skb = alloc_skb(alloc_len, GFP_ATOMIC); if (!skb) + { return NULL; + } rx_head = (rx_head_t *)skb->head; rx_head->skb = skb; skb_reserve(skb, RX_HEAD_LEN_ALIGNED + WSPI_PAD_BYTES); diff --git a/wl1271/platforms/os/linux/src/WlanDrvIf.c b/wl1271/platforms/os/linux/src/WlanDrvIf.c index 7f5368e..7985384 100644 --- a/wl1271/platforms/os/linux/src/WlanDrvIf.c +++ b/wl1271/platforms/os/linux/src/WlanDrvIf.c @@ -636,7 +636,8 @@ int wlanDrvIf_Start (struct net_device *dev) ti_dprintf (TIWLAN_LOG_OTHER, "wlanDrvIf_Start()\n"); printk("%s\n", __func__); - if (!drv->tCommon.hDrvMain) { + if (!drv->tCommon.hDrvMain) + { ti_dprintf (TIWLAN_LOG_ERROR, "wlanDrvIf_Start() Driver not created!\n"); return -ENODEV; } @@ -771,7 +772,8 @@ static int wlanDrvIf_SetupNetif (TWlanDrvIfObj *drv) /* Allocate network interface structure for the driver */ dev = alloc_etherdev (0); - if (dev == NULL) { + if (dev == NULL) + { ti_dprintf (TIWLAN_LOG_ERROR, "alloc_etherdev() failed\n"); return -ENOMEM; } @@ -804,7 +806,8 @@ static int wlanDrvIf_SetupNetif (TWlanDrvIfObj *drv) wlanDrvWext_Init (dev); res = register_netdev (dev); - if (res != 0) { + if (res != 0) + { ti_dprintf (TIWLAN_LOG_ERROR, "register_netdev() failed : %d\n", res); kfree (dev); return res; @@ -859,7 +862,8 @@ static int wlanDrvIf_Create (void) /* Allocate driver's structure */ drv = kmalloc (sizeof(TWlanDrvIfObj), GFP_KERNEL); - if (!drv) { + if (!drv) + { return -ENOMEM; } #ifdef TI_DBG @@ -1014,14 +1018,16 @@ static void wlanDrvIf_Destroy (TWlanDrvIfObj *drv) } /* close the ipc_kernel socket*/ - if (drv && drv->wl_sock) { + if (drv && drv->wl_sock) + { sock_release (drv->wl_sock->sk_socket); } /* Release the driver interrupt (or polling timer) */ #ifdef PRIODIC_INTERRUPT os_timerDestroy (drv, drv->hPollTimer); #else - if (drv->irq) { + if (drv->irq) + { hPlatform_freeInterrupt(drv); } #endif @@ -1035,30 +1041,30 @@ static void wlanDrvIf_Destroy (TWlanDrvIfObj *drv) /* * Free init files memory */ - if (drv->tCommon.tFwImage.pImage) { - os_memoryFree (drv, drv->tCommon.tFwImage.pImage, drv->tCommon.tFwImage.uSize); -#ifdef TI_MEM_ALLOC_TRACE - os_printf ("MTT:%s:%d ::kfree(0x%p) : %d\n", - __FUNCTION__, __LINE__, drv->tCommon.tFwImage.uSize, - -drv->tCommon.tFwImage.uSize); -#endif - } - if (drv->tCommon.tNvsImage.pImage) { - kfree (drv->tCommon.tNvsImage.pImage); -#ifdef TI_MEM_ALLOC_TRACE - os_printf ("MTT:%s:%d ::kfree(0x%p) : %d\n", - __FUNCTION__, __LINE__, drv->tCommon.tNvsImage.uSize, - -drv->tCommon.tNvsImage.uSize); -#endif - } - if (drv->tCommon.tIniFile.pImage) { - kfree (drv->tCommon.tIniFile.pImage); -#ifdef TI_MEM_ALLOC_TRACE - os_printf ("MTT:%s:%d ::kfree(0x%p) : %d\n", - __FUNCTION__, __LINE__, drv->tCommon.tIniFile.uSize, - -drv->tCommon.tIniFile.uSize); -#endif - } + if (drv->tCommon.tFwImage.pImage) + { + os_memoryFree (drv, drv->tCommon.tFwImage.pImage, drv->tCommon.tFwImage.uSize); + #ifdef TI_MEM_ALLOC_TRACE + os_printf ("MTT:%s:%d ::kfree(0x%p) : %d\n", + __FUNCTION__, __LINE__, drv->tCommon.tFwImage.uSize, -drv->tCommon.tFwImage.uSize); + #endif + } + if (drv->tCommon.tNvsImage.pImage) + { + kfree (drv->tCommon.tNvsImage.pImage); + #ifdef TI_MEM_ALLOC_TRACE + os_printf ("MTT:%s:%d ::kfree(0x%p) : %d\n", + __FUNCTION__, __LINE__, drv->tCommon.tNvsImage.uSize, -drv->tCommon.tNvsImage.uSize); + #endif + } + if (drv->tCommon.tIniFile.pImage) + { + kfree (drv->tCommon.tIniFile.pImage); + #ifdef TI_MEM_ALLOC_TRACE + os_printf ("MTT:%s:%d ::kfree(0x%p) : %d\n", + __FUNCTION__, __LINE__, drv->tCommon.tIniFile.uSize, -drv->tCommon.tIniFile.uSize); + #endif + } /* Free the driver object */ #ifdef TI_DBG -- cgit v1.2.3