diff options
Diffstat (limited to 'drivers/staging/rt2870/common')
-rw-r--r-- | drivers/staging/rt2870/common/rtusb_io.c | 29 |
1 files changed, 12 insertions, 17 deletions
diff --git a/drivers/staging/rt2870/common/rtusb_io.c b/drivers/staging/rt2870/common/rtusb_io.c index cf0d2f5..cde38fe 100644 --- a/drivers/staging/rt2870/common/rtusb_io.c +++ b/drivers/staging/rt2870/common/rtusb_io.c @@ -24,7 +24,7 @@ * * ************************************************************************* - Module Name: + Module Name: rtusb_io.c Abstract: @@ -400,8 +400,7 @@ int RTUSBWriteBBPRegister(struct rt_rtmp_adapter *pAd, ("RTUSBWriteBBPRegister(BBP_CSR_CFG):retry count=%d!\n", i)); i++; - } - while ((i < RETRY_LIMIT) + } while ((i < RETRY_LIMIT) && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))); if ((i == RETRY_LIMIT) @@ -455,8 +454,7 @@ int RTUSBWriteRFRegister(struct rt_rtmp_adapter *pAd, u32 Value) ("RTUSBWriteRFRegister(RF_CSR_CFG0):retry count=%d!\n", i)); i++; - } - while ((i < RETRY_LIMIT) + } while ((i < RETRY_LIMIT) && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))); if ((i == RETRY_LIMIT) @@ -652,11 +650,11 @@ int RTUSBEnqueueCmdFromNdis(struct rt_rtmp_adapter *pAd, } else #endif - return (NDIS_STATUS_RESOURCES); + return NDIS_STATUS_RESOURCES; status = os_alloc_mem(pAd, (u8 **) (&cmdqelmt), sizeof(struct rt_cmdqelmt)); if ((status != NDIS_STATUS_SUCCESS) || (cmdqelmt == NULL)) - return (NDIS_STATUS_RESOURCES); + return NDIS_STATUS_RESOURCES; cmdqelmt->buffer = NULL; if (pInformationBuffer != NULL) { @@ -666,7 +664,7 @@ int RTUSBEnqueueCmdFromNdis(struct rt_rtmp_adapter *pAd, if ((status != NDIS_STATUS_SUCCESS) || (cmdqelmt->buffer == NULL)) { kfree(cmdqelmt); - return (NDIS_STATUS_RESOURCES); + return NDIS_STATUS_RESOURCES; } else { NdisMoveMemory(cmdqelmt->buffer, pInformationBuffer, InformationBufferLength); @@ -698,7 +696,7 @@ int RTUSBEnqueueCmdFromNdis(struct rt_rtmp_adapter *pAd, } else RTUSBCMDUp(pAd); - return (NDIS_STATUS_SUCCESS); + return NDIS_STATUS_SUCCESS; } /* @@ -726,7 +724,7 @@ int RTUSBEnqueueInternalCmd(struct rt_rtmp_adapter *pAd, status = os_alloc_mem(pAd, (u8 **) & cmdqelmt, sizeof(struct rt_cmdqelmt)); if ((status != NDIS_STATUS_SUCCESS) || (cmdqelmt == NULL)) - return (NDIS_STATUS_RESOURCES); + return NDIS_STATUS_RESOURCES; NdisZeroMemory(cmdqelmt, sizeof(struct rt_cmdqelmt)); if (InformationBufferLength > 0) { @@ -736,7 +734,7 @@ int RTUSBEnqueueInternalCmd(struct rt_rtmp_adapter *pAd, if ((status != NDIS_STATUS_SUCCESS) || (cmdqelmt->buffer == NULL)) { os_free_mem(pAd, cmdqelmt); - return (NDIS_STATUS_RESOURCES); + return NDIS_STATUS_RESOURCES; } else { NdisMoveMemory(cmdqelmt->buffer, pInformationBuffer, InformationBufferLength); @@ -767,7 +765,7 @@ int RTUSBEnqueueInternalCmd(struct rt_rtmp_adapter *pAd, } else RTUSBCMDUp(pAd); } - return (NDIS_STATUS_SUCCESS); + return NDIS_STATUS_SUCCESS; } /* @@ -1071,7 +1069,7 @@ void CMDHandler(struct rt_rtmp_adapter *pAd) TXRXQ_PCNT, &MACValue); if ((MACValue & 0xf00000 - /*0x800000 */ ) == 0) + /*0x800000 */) == 0) break; Index++; RTMPusecDelay(10000); @@ -1406,15 +1404,13 @@ void CMDHandler(struct rt_rtmp_adapter *pAd) /* All transfers must be aborted or cancelled before attempting to reset the pipe. */ { u32 MACValue; - { /*while ((atomic_read(&pAd->PendingRx) > 0) && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))) */ if ((pAd->PendingRx > 0) && (!RTMP_TEST_FLAG (pAd, - fRTMP_ADAPTER_NIC_NOT_EXIST))) - { + fRTMP_ADAPTER_NIC_NOT_EXIST))) { DBGPRINT_RAW (RT_DEBUG_ERROR, ("BulkIn IRP Pending!!!\n")); @@ -1424,7 +1420,6 @@ void CMDHandler(struct rt_rtmp_adapter *pAd) pAd->PendingRx = 0; } } - /* Wait 10ms before reading register. */ RTMPusecDelay(10000); ntStatus = |