diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-12-11 12:23:15 -0800 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-12-11 12:23:15 -0800 |
commit | 51126deb201c59cc8cdc4873e3d130d6bc60513d (patch) | |
tree | aae5d37bda36d40b6486021e5f2e4d8c7721dfba /drivers/staging/rt2870 | |
parent | cc27706961cbe2de1b2b1d1b498efa7b6f04a822 (diff) |
Staging: rt28x0: remove typedefs (part one)
Remove typedefs from rtmp_type.h.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/rt2870')
-rw-r--r-- | drivers/staging/rt2870/common/rtusb_bulk.c | 82 | ||||
-rw-r--r-- | drivers/staging/rt2870/common/rtusb_data.c | 38 | ||||
-rw-r--r-- | drivers/staging/rt2870/common/rtusb_io.c | 262 |
3 files changed, 191 insertions, 191 deletions
diff --git a/drivers/staging/rt2870/common/rtusb_bulk.c b/drivers/staging/rt2870/common/rtusb_bulk.c index a45f64810dc..b180f131442 100644 --- a/drivers/staging/rt2870/common/rtusb_bulk.c +++ b/drivers/staging/rt2870/common/rtusb_bulk.c @@ -41,7 +41,7 @@ #include "../rt_config.h" /* Match total 6 bulkout endpoint to corresponding queue. */ -UCHAR EpToQueue[6] = +u8 EpToQueue[6] = { FIFO_EDCA, FIFO_EDCA, FIFO_EDCA, FIFO_EDCA, FIFO_EDCA, FIFO_MGMT }; /*static BOOLEAN SingleBulkOut = FALSE; */ @@ -58,12 +58,12 @@ void RTUSB_FILL_BULK_URB(struct urb *pUrb, } -VOID RTUSBInitTxDesc(IN PRTMP_ADAPTER pAd, +void RTUSBInitTxDesc(IN PRTMP_ADAPTER pAd, IN PTX_CONTEXT pTxContext, - IN UCHAR BulkOutPipeId, IN usb_complete_t Func) + u8 BulkOutPipeId, IN usb_complete_t Func) { PURB pUrb; - PUCHAR pSrc = NULL; + u8 *pSrc = NULL; POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; pUrb = pTxContext->pUrb; @@ -76,7 +76,7 @@ VOID RTUSBInitTxDesc(IN PRTMP_ADAPTER pAd, pSrc = &pTxContext->TransferBuffer->Aggregation[2]; } else { pSrc = - (PUCHAR) pTxContext->TransferBuffer->field.WirelessPacket; + (u8 *)pTxContext->TransferBuffer->field.WirelessPacket; } /*Initialize a tx bulk urb */ @@ -96,13 +96,13 @@ VOID RTUSBInitTxDesc(IN PRTMP_ADAPTER pAd, } -VOID RTUSBInitHTTxDesc(IN PRTMP_ADAPTER pAd, +void RTUSBInitHTTxDesc(IN PRTMP_ADAPTER pAd, IN PHT_TX_CONTEXT pTxContext, - IN UCHAR BulkOutPipeId, - IN ULONG BulkOutSize, IN usb_complete_t Func) + u8 BulkOutPipeId, + unsigned long BulkOutSize, IN usb_complete_t Func) { PURB pUrb; - PUCHAR pSrc = NULL; + u8 *pSrc = NULL; POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; pUrb = pTxContext->pUrb; @@ -128,11 +128,11 @@ VOID RTUSBInitHTTxDesc(IN PRTMP_ADAPTER pAd, } -VOID RTUSBInitRxDesc(IN PRTMP_ADAPTER pAd, IN PRX_CONTEXT pRxContext) +void RTUSBInitRxDesc(IN PRTMP_ADAPTER pAd, IN PRX_CONTEXT pRxContext) { PURB pUrb; POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; - ULONG RX_bulk_size; + unsigned long RX_bulk_size; pUrb = pRxContext->pUrb; ASSERT(pUrb); @@ -179,8 +179,8 @@ VOID RTUSBInitRxDesc(IN PRTMP_ADAPTER pAd, IN PRX_CONTEXT pRxContext) if(1 /*!(in_interrupt() & 0xffff0000)*/) \ RTMP_IRQ_UNLOCK((pLock), IrqFlags); -VOID RTUSBBulkOutDataPacket(IN PRTMP_ADAPTER pAd, - IN UCHAR BulkOutPipeId, IN UCHAR Index) +void RTUSBBulkOutDataPacket(IN PRTMP_ADAPTER pAd, + u8 BulkOutPipeId, u8 Index) { PHT_TX_CONTEXT pHTTXContext; @@ -188,11 +188,11 @@ VOID RTUSBBulkOutDataPacket(IN PRTMP_ADAPTER pAd, int ret = 0; PTXINFO_STRUC pTxInfo, pLastTxInfo = NULL; PTXWI_STRUC pTxWI; - ULONG TmpBulkEndPos, ThisBulkSize; + unsigned long TmpBulkEndPos, ThisBulkSize; unsigned long IrqFlags = 0, IrqFlags2 = 0; - PUCHAR pWirelessPkt, pAppendant; + u8 *pWirelessPkt, *pAppendant; BOOLEAN bTxQLastRound = FALSE; - UCHAR allzero[4] = { 0x0, 0x0, 0x0, 0x0 }; + u8 allzero[4] = { 0x0, 0x0, 0x0, 0x0 }; BULK_OUT_LOCK(&pAd->BulkOutLock[BulkOutPipeId], IrqFlags); if ((pAd->BulkOutPending[BulkOutPipeId] == TRUE) @@ -334,7 +334,7 @@ VOID RTUSBBulkOutDataPacket(IN PRTMP_ADAPTER pAd, pHTTXContext->ENextBulkOutPosition, pHTTXContext->bCopySavePad)); hex_dump("Wrong QSel Pkt:", - (PUCHAR) & pWirelessPkt[TmpBulkEndPos], + (u8 *)& pWirelessPkt[TmpBulkEndPos], (pHTTXContext->CurWritePosition - pHTTXContext->NextBulkOutPosition)); } @@ -429,7 +429,7 @@ VOID RTUSBBulkOutDataPacket(IN PRTMP_ADAPTER pAd, ENextBulkOutPosition], 8); pHTTXContext->bCopySavePad = TRUE; if (RTMPEqualMemory(pHTTXContext->SavedPad, allzero, 4)) { - PUCHAR pBuf = &pHTTXContext->SavedPad[0]; + u8 *pBuf = &pHTTXContext->SavedPad[0]; DBGPRINT_RAW(RT_DEBUG_ERROR, ("WARNING-Zero-3:%02x%02x%02x%02x%02x%02x%02x%02x,CWPos=%ld, CWRPos=%ld, bCW=%d, NBPos=%ld, TBPos=%ld, TBSize=%ld\n", pBuf[0], pBuf[1], pBuf[2], pBuf[3], @@ -495,12 +495,12 @@ VOID RTUSBBulkOutDataPacket(IN PRTMP_ADAPTER pAd, } -VOID RTUSBBulkOutDataPacketComplete(purbb_t pUrb, struct pt_regs * pt_regs) +void RTUSBBulkOutDataPacketComplete(purbb_t pUrb, struct pt_regs * pt_regs) { PHT_TX_CONTEXT pHTTXContext; PRTMP_ADAPTER pAd; POS_COOKIE pObj; - UCHAR BulkOutPipeId; + u8 BulkOutPipeId; pHTTXContext = (PHT_TX_CONTEXT) pUrb->context; pAd = pHTTXContext->pAd; @@ -544,7 +544,7 @@ VOID RTUSBBulkOutDataPacketComplete(purbb_t pUrb, struct pt_regs * pt_regs) ======================================================================== */ -VOID RTUSBBulkOutNullFrame(IN PRTMP_ADAPTER pAd) +void RTUSBBulkOutNullFrame(IN PRTMP_ADAPTER pAd) { PTX_CONTEXT pNullContext = &(pAd->NullContext); PURB pUrb; @@ -589,11 +589,11 @@ VOID RTUSBBulkOutNullFrame(IN PRTMP_ADAPTER pAd) } /* NULL frame use BulkOutPipeId = 0 */ -VOID RTUSBBulkOutNullFrameComplete(purbb_t pUrb, struct pt_regs * pt_regs) +void RTUSBBulkOutNullFrameComplete(purbb_t pUrb, struct pt_regs * pt_regs) { PRTMP_ADAPTER pAd; PTX_CONTEXT pNullContext; - NTSTATUS Status; + int Status; POS_COOKIE pObj; pNullContext = (PTX_CONTEXT) pUrb->context; @@ -618,7 +618,7 @@ VOID RTUSBBulkOutNullFrameComplete(purbb_t pUrb, struct pt_regs * pt_regs) ======================================================================== */ -VOID RTUSBBulkOutMLMEPacket(IN PRTMP_ADAPTER pAd, IN UCHAR Index) +void RTUSBBulkOutMLMEPacket(IN PRTMP_ADAPTER pAd, u8 Index) { PTX_CONTEXT pMLMEContext; PURB pUrb; @@ -684,11 +684,11 @@ VOID RTUSBBulkOutMLMEPacket(IN PRTMP_ADAPTER pAd, IN UCHAR Index) /* printk("<---RTUSBBulkOutMLMEPacket,Cpu=%d!, Dma=%d, SwIdx=%d!\n", pAd->MgmtRing.TxCpuIdx, pAd->MgmtRing.TxDmaIdx, pAd->MgmtRing.TxSwFreeIdx); */ } -VOID RTUSBBulkOutMLMEPacketComplete(purbb_t pUrb, struct pt_regs * pt_regs) +void RTUSBBulkOutMLMEPacketComplete(purbb_t pUrb, struct pt_regs * pt_regs) { PTX_CONTEXT pMLMEContext; PRTMP_ADAPTER pAd; - NTSTATUS Status; + int Status; POS_COOKIE pObj; int index; @@ -716,7 +716,7 @@ VOID RTUSBBulkOutMLMEPacketComplete(purbb_t pUrb, struct pt_regs * pt_regs) ======================================================================== */ -VOID RTUSBBulkOutPsPoll(IN PRTMP_ADAPTER pAd) +void RTUSBBulkOutPsPoll(IN PRTMP_ADAPTER pAd) { PTX_CONTEXT pPsPollContext = &(pAd->PsPollContext); PURB pUrb; @@ -758,11 +758,11 @@ VOID RTUSBBulkOutPsPoll(IN PRTMP_ADAPTER pAd) } /* PS-Poll frame use BulkOutPipeId = 0 */ -VOID RTUSBBulkOutPsPollComplete(purbb_t pUrb, struct pt_regs * pt_regs) +void RTUSBBulkOutPsPollComplete(purbb_t pUrb, struct pt_regs * pt_regs) { PRTMP_ADAPTER pAd; PTX_CONTEXT pPsPollContext; - NTSTATUS Status; + int Status; POS_COOKIE pObj; pPsPollContext = (PTX_CONTEXT) pUrb->context; @@ -774,7 +774,7 @@ VOID RTUSBBulkOutPsPollComplete(purbb_t pUrb, struct pt_regs * pt_regs) tasklet_hi_schedule(&pObj->pspoll_frame_complete_task); } -VOID DoBulkIn(IN RTMP_ADAPTER * pAd) +void DoBulkIn(IN RTMP_ADAPTER * pAd) { PRX_CONTEXT pRxContext; PURB pUrb; @@ -845,7 +845,7 @@ VOID DoBulkIn(IN RTMP_ADAPTER * pAd) fRTMP_ADAPTER_RADIO_OFF | fRTMP_ADAPTER_RESET_IN_PROGRESS | \ fRTMP_ADAPTER_REMOVE_IN_PROGRESS) -VOID RTUSBBulkReceive(IN PRTMP_ADAPTER pAd) +void RTUSBBulkReceive(IN PRTMP_ADAPTER pAd) { PRX_CONTEXT pRxContext; unsigned long IrqFlags; @@ -912,7 +912,7 @@ VOID RTUSBBulkReceive(IN PRTMP_ADAPTER pAd) Always returns STATUS_MORE_PROCESSING_REQUIRED ======================================================================== */ -VOID RTUSBBulkRxComplete(purbb_t pUrb, struct pt_regs *pt_regs) +void RTUSBBulkRxComplete(purbb_t pUrb, struct pt_regs *pt_regs) { /* use a receive tasklet to handle received packets; */ /* or sometimes hardware IRQ will be disabled here, so we can not */ @@ -943,7 +943,7 @@ VOID RTUSBBulkRxComplete(purbb_t pUrb, struct pt_regs *pt_regs) ======================================================================== */ -VOID RTUSBKickBulkOut(IN PRTMP_ADAPTER pAd) +void RTUSBKickBulkOut(IN PRTMP_ADAPTER pAd) { /* BulkIn Reset will reset whole USB PHY. So we need to make sure fRTMP_ADAPTER_BULKIN_RESET not flaged. */ if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NEED_STOP_TX) @@ -1033,9 +1033,9 @@ VOID RTUSBKickBulkOut(IN PRTMP_ADAPTER pAd) ======================================================================== */ -VOID RTUSBCleanUpDataBulkOutQueue(IN PRTMP_ADAPTER pAd) +void RTUSBCleanUpDataBulkOutQueue(IN PRTMP_ADAPTER pAd) { - UCHAR Idx; + u8 Idx; PHT_TX_CONTEXT pTxContext; DBGPRINT(RT_DEBUG_TRACE, ("--->CleanUpDataBulkOutQueue\n")); @@ -1066,7 +1066,7 @@ VOID RTUSBCleanUpDataBulkOutQueue(IN PRTMP_ADAPTER pAd) ======================================================================== */ -VOID RTUSBCleanUpMLMEBulkOutQueue(IN PRTMP_ADAPTER pAd) +void RTUSBCleanUpMLMEBulkOutQueue(IN PRTMP_ADAPTER pAd) { DBGPRINT(RT_DEBUG_TRACE, ("--->CleanUpMLMEBulkOutQueue\n")); DBGPRINT(RT_DEBUG_TRACE, ("<---CleanUpMLMEBulkOutQueue\n")); @@ -1085,7 +1085,7 @@ VOID RTUSBCleanUpMLMEBulkOutQueue(IN PRTMP_ADAPTER pAd) ======================================================================== */ -VOID RTUSBCancelPendingIRPs(IN PRTMP_ADAPTER pAd) +void RTUSBCancelPendingIRPs(IN PRTMP_ADAPTER pAd) { RTUSBCancelPendingBulkInIRP(pAd); RTUSBCancelPendingBulkOutIRP(pAd); @@ -1104,10 +1104,10 @@ VOID RTUSBCancelPendingIRPs(IN PRTMP_ADAPTER pAd) ======================================================================== */ -VOID RTUSBCancelPendingBulkInIRP(IN PRTMP_ADAPTER pAd) +void RTUSBCancelPendingBulkInIRP(IN PRTMP_ADAPTER pAd) { PRX_CONTEXT pRxContext; - UINT i; + u32 i; DBGPRINT_RAW(RT_DEBUG_TRACE, ("--->RTUSBCancelPendingBulkInIRP\n")); for (i = 0; i < (RX_RING_SIZE); i++) { @@ -1136,7 +1136,7 @@ VOID RTUSBCancelPendingBulkInIRP(IN PRTMP_ADAPTER pAd) ======================================================================== */ -VOID RTUSBCancelPendingBulkOutIRP(IN PRTMP_ADAPTER pAd) +void RTUSBCancelPendingBulkOutIRP(IN PRTMP_ADAPTER pAd) { PHT_TX_CONTEXT pHTTXContext; PTX_CONTEXT pMLMEContext; @@ -1144,7 +1144,7 @@ VOID RTUSBCancelPendingBulkOutIRP(IN PRTMP_ADAPTER pAd) PTX_CONTEXT pNullContext; PTX_CONTEXT pPsPollContext; PTX_CONTEXT pRTSContext; - UINT i, Idx; + u32 i, Idx; /* unsigned int IrqFlags; */ /* NDIS_SPIN_LOCK *pLock; */ /* BOOLEAN *pPending; */ diff --git a/drivers/staging/rt2870/common/rtusb_data.c b/drivers/staging/rt2870/common/rtusb_data.c index e6b0afc817f..c58201ffde7 100644 --- a/drivers/staging/rt2870/common/rtusb_data.c +++ b/drivers/staging/rt2870/common/rtusb_data.c @@ -41,14 +41,14 @@ #include "../rt_config.h" -extern UCHAR Phy11BGNextRateUpward[]; /* defined in mlme.c */ -extern UCHAR EpToQueue[]; +extern u8 Phy11BGNextRateUpward[]; /* defined in mlme.c */ +extern u8 EpToQueue[]; -VOID REPORT_AMSDU_FRAMES_TO_LLC(IN PRTMP_ADAPTER pAd, - IN PUCHAR pData, IN ULONG DataSize) +void REPORT_AMSDU_FRAMES_TO_LLC(IN PRTMP_ADAPTER pAd, + u8 *pData, unsigned long DataSize) { PNDIS_PACKET pPacket; - UINT nMSDU; + u32 nMSDU; struct sk_buff *pSkb; nMSDU = 0; @@ -85,13 +85,13 @@ VOID REPORT_AMSDU_FRAMES_TO_LLC(IN PRTMP_ADAPTER pAd, ======================================================================== */ -NDIS_STATUS RTUSBFreeDescriptorRequest(IN PRTMP_ADAPTER pAd, - IN UCHAR BulkOutPipeId, - IN UINT32 NumberRequired) +int RTUSBFreeDescriptorRequest(IN PRTMP_ADAPTER pAd, + u8 BulkOutPipeId, + u32 NumberRequired) { -/* UCHAR FreeNumber = 0; */ -/* UINT Index; */ - NDIS_STATUS Status = NDIS_STATUS_FAILURE; +/* u8 FreeNumber = 0; */ +/* u32 Index; */ + int Status = NDIS_STATUS_FAILURE; unsigned long IrqFlags; HT_TX_CONTEXT *pHTTXContext; @@ -127,8 +127,8 @@ NDIS_STATUS RTUSBFreeDescriptorRequest(IN PRTMP_ADAPTER pAd, return (Status); } -NDIS_STATUS RTUSBFreeDescriptorRelease(IN RTMP_ADAPTER * pAd, - IN UCHAR BulkOutPipeId) +int RTUSBFreeDescriptorRelease(IN RTMP_ADAPTER * pAd, + u8 BulkOutPipeId) { unsigned long IrqFlags; HT_TX_CONTEXT *pHTTXContext; @@ -141,7 +141,7 @@ NDIS_STATUS RTUSBFreeDescriptorRelease(IN RTMP_ADAPTER * pAd, return (NDIS_STATUS_SUCCESS); } -BOOLEAN RTUSBNeedQueueBackForAgg(IN RTMP_ADAPTER * pAd, IN UCHAR BulkOutPipeId) +BOOLEAN RTUSBNeedQueueBackForAgg(IN RTMP_ADAPTER * pAd, u8 BulkOutPipeId) { unsigned long IrqFlags; HT_TX_CONTEXT *pHTTXContext; @@ -191,9 +191,9 @@ BOOLEAN RTUSBNeedQueueBackForAgg(IN RTMP_ADAPTER * pAd, IN UCHAR BulkOutPipeId) ======================================================================== */ -VOID RTUSBRejectPendingPackets(IN PRTMP_ADAPTER pAd) +void RTUSBRejectPendingPackets(IN PRTMP_ADAPTER pAd) { - UCHAR Index; + u8 Index; PQUEUE_ENTRY pEntry; PNDIS_PACKET pPacket; PQUEUE_HEADER pQueue; @@ -240,11 +240,11 @@ VOID RTUSBRejectPendingPackets(IN PRTMP_ADAPTER pAd) ======================================================================== */ -VOID RTMPWriteTxInfo(IN PRTMP_ADAPTER pAd, +void RTMPWriteTxInfo(IN PRTMP_ADAPTER pAd, IN PTXINFO_STRUC pTxInfo, - IN USHORT USBDMApktLen, + u16 USBDMApktLen, IN BOOLEAN bWiv, - IN UCHAR QueueSel, IN UCHAR NextValid, IN UCHAR TxBurst) + u8 QueueSel, u8 NextValid, u8 TxBurst) { pTxInfo->USBDMATxPktLen = USBDMApktLen; pTxInfo->QSEL = QueueSel; diff --git a/drivers/staging/rt2870/common/rtusb_io.c b/drivers/staging/rt2870/common/rtusb_io.c index dd2e0d05193..861b6b15b04 100644 --- a/drivers/staging/rt2870/common/rtusb_io.c +++ b/drivers/staging/rt2870/common/rtusb_io.c @@ -56,9 +56,9 @@ ======================================================================== */ -static NTSTATUS RTUSBFirmwareRun(IN PRTMP_ADAPTER pAd) +static int RTUSBFirmwareRun(IN PRTMP_ADAPTER pAd) { - NTSTATUS Status; + int Status; Status = RTUSB_VendorRequest(pAd, USBD_TRANSFER_DIRECTION_OUT, @@ -83,13 +83,13 @@ static NTSTATUS RTUSBFirmwareRun(IN PRTMP_ADAPTER pAd) ======================================================================== */ -NTSTATUS RTUSBFirmwareWrite(IN PRTMP_ADAPTER pAd, - IN PUCHAR pFwImage, IN ULONG FwLen) +int RTUSBFirmwareWrite(IN PRTMP_ADAPTER pAd, + u8 *pFwImage, unsigned long FwLen) { - UINT32 MacReg; - NTSTATUS Status; -/* ULONG i; */ - USHORT writeLen; + u32 MacReg; + int Status; +/* unsigned long i; */ + u16 writeLen; Status = RTUSBReadMACRegister(pAd, MAC_CSR0, &MacReg); @@ -109,9 +109,9 @@ NTSTATUS RTUSBFirmwareWrite(IN PRTMP_ADAPTER pAd, return Status; } -NTSTATUS RTUSBVenderReset(IN PRTMP_ADAPTER pAd) +int RTUSBVenderReset(IN PRTMP_ADAPTER pAd) { - NTSTATUS Status; + int Status; DBGPRINT_RAW(RT_DEBUG_ERROR, ("-->RTUSBVenderReset\n")); Status = RTUSB_VendorRequest(pAd, USBD_TRANSFER_DIRECTION_OUT, @@ -137,10 +137,10 @@ NTSTATUS RTUSBVenderReset(IN PRTMP_ADAPTER pAd) ======================================================================== */ -NTSTATUS RTUSBMultiRead(IN PRTMP_ADAPTER pAd, - IN USHORT Offset, OUT PUCHAR pData, IN USHORT length) +int RTUSBMultiRead(IN PRTMP_ADAPTER pAd, + u16 Offset, u8 *pData, u16 length) { - NTSTATUS Status; + int Status; Status = RTUSB_VendorRequest(pAd, (USBD_TRANSFER_DIRECTION_IN | @@ -166,10 +166,10 @@ NTSTATUS RTUSBMultiRead(IN PRTMP_ADAPTER pAd, ======================================================================== */ -NTSTATUS RTUSBMultiWrite_OneByte(IN PRTMP_ADAPTER pAd, - IN USHORT Offset, IN PUCHAR pData) +int RTUSBMultiWrite_OneByte(IN PRTMP_ADAPTER pAd, + u16 Offset, u8 *pData) { - NTSTATUS Status; + int Status; /* TODO: In 2870, use this funciton carefully cause it's not stable. */ Status = RTUSB_VendorRequest(pAd, @@ -180,19 +180,19 @@ NTSTATUS RTUSBMultiWrite_OneByte(IN PRTMP_ADAPTER pAd, return Status; } -NTSTATUS RTUSBMultiWrite(IN PRTMP_ADAPTER pAd, - IN USHORT Offset, IN PUCHAR pData, IN USHORT length) +int RTUSBMultiWrite(IN PRTMP_ADAPTER pAd, + u16 Offset, u8 *pData, u16 length) { - NTSTATUS Status; + int Status; - USHORT index = 0, Value; - PUCHAR pSrc = pData; - USHORT resude = 0; + u16 index = 0, Value; + u8 *pSrc = pData; + u16 resude = 0; resude = length % 2; length += resude; do { - Value = (USHORT) (*pSrc | (*(pSrc + 1) << 8)); + Value = (u16)(*pSrc | (*(pSrc + 1) << 8)); Status = RTUSBSingleWrite(pAd, Offset + index, Value); index += 2; length -= 2; @@ -202,10 +202,10 @@ NTSTATUS RTUSBMultiWrite(IN PRTMP_ADAPTER pAd, return Status; } -NTSTATUS RTUSBSingleWrite(IN RTMP_ADAPTER * pAd, - IN USHORT Offset, IN USHORT Value) +int RTUSBSingleWrite(IN RTMP_ADAPTER * pAd, + u16 Offset, u16 Value) { - NTSTATUS Status; + int Status; Status = RTUSB_VendorRequest(pAd, USBD_TRANSFER_DIRECTION_OUT, @@ -231,11 +231,11 @@ NTSTATUS RTUSBSingleWrite(IN RTMP_ADAPTER * pAd, ======================================================================== */ -NTSTATUS RTUSBReadMACRegister(IN PRTMP_ADAPTER pAd, - IN USHORT Offset, OUT PUINT32 pValue) +int RTUSBReadMACRegister(IN PRTMP_ADAPTER pAd, + u16 Offset, u32 *pValue) { - NTSTATUS Status = 0; - UINT32 localVal; + int Status = 0; + u32 localVal; Status = RTUSB_VendorRequest(pAd, (USBD_TRANSFER_DIRECTION_IN | @@ -266,18 +266,18 @@ NTSTATUS RTUSBReadMACRegister(IN PRTMP_ADAPTER pAd, ======================================================================== */ -NTSTATUS RTUSBWriteMACRegister(IN PRTMP_ADAPTER pAd, - IN USHORT Offset, IN UINT32 Value) +int RTUSBWriteMACRegister(IN PRTMP_ADAPTER pAd, + u16 Offset, u32 Value) { - NTSTATUS Status; - UINT32 localVal; + int Status; + u32 localVal; localVal = Value; - Status = RTUSBSingleWrite(pAd, Offset, (USHORT) (localVal & 0xffff)); + Status = RTUSBSingleWrite(pAd, Offset, (u16)(localVal & 0xffff)); Status = RTUSBSingleWrite(pAd, Offset + 2, - (USHORT) ((localVal & 0xffff0000) >> 16)); + (u16)((localVal & 0xffff0000) >> 16)); return Status; } @@ -297,12 +297,12 @@ NTSTATUS RTUSBWriteMACRegister(IN PRTMP_ADAPTER pAd, ======================================================================== */ -NTSTATUS RTUSBReadBBPRegister(IN PRTMP_ADAPTER pAd, - IN UCHAR Id, IN PUCHAR pValue) +int RTUSBReadBBPRegister(IN PRTMP_ADAPTER pAd, + u8 Id, u8 *pValue) { BBP_CSR_CFG_STRUC BbpCsr; - UINT i = 0; - NTSTATUS status; + u32 i = 0; + int status; /* Verify the busy condition */ do { @@ -342,7 +342,7 @@ NTSTATUS RTUSBReadBBPRegister(IN PRTMP_ADAPTER pAd, status = RTUSBReadMACRegister(pAd, BBP_CSR_CFG, &BbpCsr.word); if (status >= 0) { if (!(BbpCsr.field.Busy == BUSY)) { - *pValue = (UCHAR) BbpCsr.field.Value; + *pValue = (u8)BbpCsr.field.Value; break; } } @@ -383,12 +383,12 @@ NTSTATUS RTUSBReadBBPRegister(IN PRTMP_ADAPTER pAd, ======================================================================== */ -NTSTATUS RTUSBWriteBBPRegister(IN PRTMP_ADAPTER pAd, - IN UCHAR Id, IN UCHAR Value) +int RTUSBWriteBBPRegister(IN PRTMP_ADAPTER pAd, + u8 Id, u8 Value) { BBP_CSR_CFG_STRUC BbpCsr; - UINT i = 0; - NTSTATUS status; + u32 i = 0; + int status; /* Verify the busy condition */ do { status = RTUSBReadMACRegister(pAd, BBP_CSR_CFG, &BbpCsr.word); @@ -438,11 +438,11 @@ NTSTATUS RTUSBWriteBBPRegister(IN PRTMP_ADAPTER pAd, ======================================================================== */ -NTSTATUS RTUSBWriteRFRegister(IN PRTMP_ADAPTER pAd, IN UINT32 Value) +int RTUSBWriteRFRegister(IN PRTMP_ADAPTER pAd, u32 Value) { PHY_CSR4_STRUC PhyCsr4; - UINT i = 0; - NTSTATUS status; + u32 i = 0; + int status; NdisZeroMemory(&PhyCsr4, sizeof(PHY_CSR4_STRUC)); do { @@ -486,10 +486,10 @@ NTSTATUS RTUSBWriteRFRegister(IN PRTMP_ADAPTER pAd, IN UINT32 Value) ======================================================================== */ -NTSTATUS RTUSBReadEEPROM(IN PRTMP_ADAPTER pAd, - IN USHORT Offset, OUT PUCHAR pData, IN USHORT length) +int RTUSBReadEEPROM(IN PRTMP_ADAPTER pAd, + u16 Offset, u8 *pData, u16 length) { - NTSTATUS Status = STATUS_SUCCESS; + int Status = STATUS_SUCCESS; Status = RTUSB_VendorRequest(pAd, (USBD_TRANSFER_DIRECTION_IN | @@ -515,10 +515,10 @@ NTSTATUS RTUSBReadEEPROM(IN PRTMP_ADAPTER pAd, ======================================================================== */ -NTSTATUS RTUSBWriteEEPROM(IN PRTMP_ADAPTER pAd, - IN USHORT Offset, IN PUCHAR pData, IN USHORT length) +int RTUSBWriteEEPROM(IN PRTMP_ADAPTER pAd, + u16 Offset, u8 *pData, u16 length) { - NTSTATUS Status = STATUS_SUCCESS; + int Status = STATUS_SUCCESS; Status = RTUSB_VendorRequest(pAd, USBD_TRANSFER_DIRECTION_OUT, @@ -528,13 +528,13 @@ NTSTATUS RTUSBWriteEEPROM(IN PRTMP_ADAPTER pAd, return Status; } -NTSTATUS RTUSBReadEEPROM16(IN PRTMP_ADAPTER pAd, - IN USHORT offset, OUT PUSHORT pData) +int RTUSBReadEEPROM16(IN PRTMP_ADAPTER pAd, + u16 offset, u16 *pData) { - NTSTATUS status; - USHORT localData; + int status; + u16 localData; - status = RTUSBReadEEPROM(pAd, offset, (PUCHAR) (&localData), 2); + status = RTUSBReadEEPROM(pAd, offset, (u8 *)(&localData), 2); if (status == STATUS_SUCCESS) *pData = le2cpu16(localData); @@ -557,9 +557,9 @@ NTSTATUS RTUSBReadEEPROM16(IN PRTMP_ADAPTER pAd, ======================================================================== */ -VOID RTUSBPutToSleep(IN PRTMP_ADAPTER pAd) +void RTUSBPutToSleep(IN PRTMP_ADAPTER pAd) { - UINT32 value; + u32 value; /* Timeout 0x40 x 50us */ value = (SLEEPCID << 16) + (OWNERMCU << 24) + (0x40 << 8) + 1; @@ -585,9 +585,9 @@ VOID RTUSBPutToSleep(IN PRTMP_ADAPTER pAd) ======================================================================== */ -NTSTATUS RTUSBWakeUp(IN PRTMP_ADAPTER pAd) +int RTUSBWakeUp(IN PRTMP_ADAPTER pAd) { - NTSTATUS Status; + int Status; Status = RTUSB_VendorRequest(pAd, USBD_TRANSFER_DIRECTION_OUT, @@ -612,7 +612,7 @@ NTSTATUS RTUSBWakeUp(IN PRTMP_ADAPTER pAd) ======================================================================== */ -VOID RTUSBInitializeCmdQ(IN PCmdQ cmdq) +void RTUSBInitializeCmdQ(IN PCmdQ cmdq) { cmdq->head = NULL; cmdq->tail = NULL; @@ -635,13 +635,13 @@ VOID RTUSBInitializeCmdQ(IN PCmdQ cmdq) ======================================================================== */ -NDIS_STATUS RTUSBEnqueueCmdFromNdis(IN PRTMP_ADAPTER pAd, +int RTUSBEnqueueCmdFromNdis(IN PRTMP_ADAPTER pAd, IN NDIS_OID Oid, IN BOOLEAN SetInformation, - IN PVOID pInformationBuffer, - IN UINT32 InformationBufferLength) + void *pInformationBuffer, + u32 InformationBufferLength) { - NDIS_STATUS status; + int status; PCmdQElmt cmdqelmt = NULL; RTMP_OS_TASK *pTask = &pAd->cmdQTask; @@ -654,14 +654,14 @@ NDIS_STATUS RTUSBEnqueueCmdFromNdis(IN PRTMP_ADAPTER pAd, #endif return (NDIS_STATUS_RESOURCES); - status = os_alloc_mem(pAd, (PUCHAR *) (&cmdqelmt), sizeof(CmdQElmt)); + status = os_alloc_mem(pAd, (u8 **) (&cmdqelmt), sizeof(CmdQElmt)); if ((status != NDIS_STATUS_SUCCESS) || (cmdqelmt == NULL)) return (NDIS_STATUS_RESOURCES); cmdqelmt->buffer = NULL; if (pInformationBuffer != NULL) { status = - os_alloc_mem(pAd, (PUCHAR *) & cmdqelmt->buffer, + os_alloc_mem(pAd, (u8 **) & cmdqelmt->buffer, InformationBufferLength); if ((status != NDIS_STATUS_SUCCESS) || (cmdqelmt->buffer == NULL)) { @@ -716,22 +716,22 @@ NDIS_STATUS RTUSBEnqueueCmdFromNdis(IN PRTMP_ADAPTER pAd, ======================================================================== */ -NDIS_STATUS RTUSBEnqueueInternalCmd(IN PRTMP_ADAPTER pAd, +int RTUSBEnqueueInternalCmd(IN PRTMP_ADAPTER pAd, IN NDIS_OID Oid, - IN PVOID pInformationBuffer, - IN UINT32 InformationBufferLength) + void *pInformationBuffer, + u32 InformationBufferLength) { - NDIS_STATUS status; + int status; PCmdQElmt cmdqelmt = NULL; - status = os_alloc_mem(pAd, (PUCHAR *) & cmdqelmt, sizeof(CmdQElmt)); + status = os_alloc_mem(pAd, (u8 **) & cmdqelmt, sizeof(CmdQElmt)); if ((status != NDIS_STATUS_SUCCESS) || (cmdqelmt == NULL)) return (NDIS_STATUS_RESOURCES); NdisZeroMemory(cmdqelmt, sizeof(CmdQElmt)); if (InformationBufferLength > 0) { status = - os_alloc_mem(pAd, (PUCHAR *) & cmdqelmt->buffer, + os_alloc_mem(pAd, (u8 **) & cmdqelmt->buffer, InformationBufferLength); if ((status != NDIS_STATUS_SUCCESS) || (cmdqelmt->buffer == NULL)) { @@ -785,7 +785,7 @@ NDIS_STATUS RTUSBEnqueueInternalCmd(IN PRTMP_ADAPTER pAd, ======================================================================== */ -VOID RTUSBDequeueCmd(IN PCmdQ cmdq, OUT PCmdQElmt * pcmdqelmt) +void RTUSBDequeueCmd(IN PCmdQ cmdq, OUT PCmdQElmt * pcmdqelmt) { *pcmdqelmt = cmdq->head; @@ -833,14 +833,14 @@ VOID RTUSBDequeueCmd(IN PCmdQ cmdq, OUT PCmdQElmt * pcmdqelmt) ======================================================================== */ -NTSTATUS RTUSB_VendorRequest(IN PRTMP_ADAPTER pAd, - IN UINT32 TransferFlags, - IN UCHAR RequestType, - IN UCHAR Request, - IN USHORT Value, - IN USHORT Index, - IN PVOID TransferBuffer, - IN UINT32 TransferBufferLength) +int RTUSB_VendorRequest(IN PRTMP_ADAPTER pAd, + u32 TransferFlags, + u8 RequestType, + u8 Request, + u16 Value, + u16 Index, + void *TransferBuffer, + u32 TransferBufferLength) { int ret = 0; POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; @@ -954,22 +954,22 @@ NTSTATUS RTUSB_VendorRequest(IN PRTMP_ADAPTER pAd, ======================================================================== */ -NTSTATUS RTUSB_ResetDevice(IN PRTMP_ADAPTER pAd) +int RTUSB_ResetDevice(IN PRTMP_ADAPTER pAd) { - NTSTATUS Status = TRUE; + int Status = TRUE; DBGPRINT_RAW(RT_DEBUG_TRACE, ("--->USB_ResetDevice\n")); /*RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RESET_IN_PROGRESS); */ return Status; } -VOID CMDHandler(IN PRTMP_ADAPTER pAd) +void CMDHandler(IN PRTMP_ADAPTER pAd) { PCmdQElmt cmdqelmt; - PUCHAR pData; - NDIS_STATUS NdisStatus = NDIS_STATUS_SUCCESS; -/* ULONG Now = 0; */ - NTSTATUS ntStatus; + u8 *pData; + int NdisStatus = NDIS_STATUS_SUCCESS; +/* unsigned long Now = 0; */ + int ntStatus; /* unsigned long IrqFlags; */ while (pAd && pAd->CmdQ.size > 0) { @@ -990,7 +990,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd) switch (cmdqelmt->command) { case CMDTHREAD_CHECK_GPIO: { - UINT32 data; + u32 data; { /* Read GPIO pin2 as Hardware controlled radio state */ @@ -1052,8 +1052,8 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd) case CMDTHREAD_RESET_BULK_OUT: { - UINT32 MACValue; - UCHAR Index; + u32 MACValue; + u8 Index; int ret = 0; PHT_TX_CONTEXT pHTTXContext; /* RTMP_TX_RING *pTxRing; */ @@ -1273,7 +1273,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd) if (pAd-> bulkResetPipeid == 0) { - UCHAR + u8 pendingContext = 0; PHT_TX_CONTEXT @@ -1377,7 +1377,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd) if ((atomic_read(&pAd->PendingRx) == 0) && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS))) { - UCHAR i; + u8 i; RTUSBRxPacket(pAd); pAd->NextRxBulkInReadIndex = 0; // Next Rx Read index pAd->NextRxBulkInIndex = 0; // Rx Bulk pointer @@ -1405,7 +1405,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd) /* All transfers must be aborted or cancelled before attempting to reset the pipe. */ { - UINT32 MACValue; + u32 MACValue; { /*while ((atomic_read(&pAd->PendingRx) > 0) && (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST))) */ @@ -1440,7 +1440,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd) | fRTMP_ADAPTER_NIC_NOT_EXIST))))) { - UCHAR i; + u8 i; if (RTMP_TEST_FLAG (pAd, @@ -1607,8 +1607,8 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd) case CMDTHREAD_SET_ASIC_WCID: { RT_SET_ASIC_WCID SetAsicWcid; - USHORT offset; - UINT32 MACValue, MACRValue = 0; + u16 offset; + u32 MACValue, MACRValue = 0; SetAsicWcid = *((PRT_SET_ASIC_WCID) (pData)); @@ -1618,7 +1618,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd) offset = MAC_WCID_BASE + - ((UCHAR) SetAsicWcid.WCID) * + ((u8)SetAsicWcid.WCID) * HW_WCID_ENTRY_SIZE; DBGPRINT_RAW(RT_DEBUG_TRACE, @@ -1673,8 +1673,8 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd) case CMDTHREAD_SET_ASIC_WCID_CIPHER: { RT_SET_ASIC_WCID_ATTRI SetAsicWcidAttri; - USHORT offset; - UINT32 MACRValue = 0; + u16 offset; + u32 MACRValue = 0; SHAREDKEY_MODE_STRUC csr1; SetAsicWcidAttri = *((PRT_SET_ASIC_WCID_ATTRI) @@ -1686,7 +1686,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd) offset = MAC_WCID_ATTRIBUTE_BASE + - ((UCHAR) SetAsicWcidAttri.WCID) * + ((u8)SetAsicWcidAttri.WCID) * HW_WCID_ATTRI_SIZE; DBGPRINT_RAW(RT_DEBUG_TRACE, @@ -1698,7 +1698,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd) &MACRValue); MACRValue = 0; MACRValue |= - (((UCHAR) SetAsicWcidAttri. + (((u8)SetAsicWcidAttri. Cipher) << 1); RTUSBWriteMACRegister(pAd, offset, @@ -1709,7 +1709,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd) offset = PAIRWISE_IVEIV_TABLE_BASE + - ((UCHAR) SetAsicWcidAttri.WCID) * + ((u8)SetAsicWcidAttri.WCID) * HW_IVEIV_ENTRY_SIZE; MACRValue = 0; if ((SetAsicWcidAttri.Cipher <= @@ -1738,7 +1738,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd) &MACRValue); MACRValue &= (~0xe); MACRValue |= - (((UCHAR) SetAsicWcidAttri. + (((u8)SetAsicWcidAttri. Cipher) << 1); RTUSBWriteMACRegister(pAd, @@ -1779,7 +1779,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd) (pData)); AsicAddPairwiseKeyEntry(pAd, KeyInfo.MacAddr, - (UCHAR) KeyInfo. + (u8)KeyInfo. MacTabMatchWCID, &KeyInfo. CipherKey); @@ -1789,9 +1789,9 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd) case RT_CMD_SET_RX_WCID_TABLE: /*General call for RTMPAddWcidAttributeEntry() */ { PMAC_TABLE_ENTRY pEntry; - UCHAR KeyIdx = 0; - UCHAR CipherAlg = CIPHER_NONE; - UCHAR ApIdx = BSS0; + u8 KeyIdx = 0; + u8 CipherAlg = CIPHER_NONE; + u8 ApIdx = BSS0; pEntry = (PMAC_TABLE_ENTRY) (pData); @@ -1813,7 +1813,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd) AsicRemovePairwiseKeyEntry(pAd, pEntry-> apidx, - (UCHAR) + (u8) pEntry-> Aid); if ((pEntry->AuthMode <= @@ -1821,10 +1821,10 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd) && (pEntry->WepStatus == Ndis802_11Encryption1Enabled)) { - UINT32 uIV = 1; - PUCHAR ptr; + u32 uIV = 1; + u8 *ptr; - ptr = (PUCHAR) & uIV; + ptr = (u8 *)& uIV; *(ptr + 3) = (pAd->StaCfg. DefaultKeyId << 6); @@ -1844,10 +1844,10 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd) } else if (pEntry->AuthMode == Ndis802_11AuthModeWPANone) { - UINT32 uIV = 1; - PUCHAR ptr; + u32 uIV = 1; + u8 *ptr; - ptr = (PUCHAR) & uIV; + ptr = (u8 *)& uIV; *(ptr + 3) = (pAd->StaCfg. DefaultKeyId << 6); @@ -1869,7 +1869,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd) /* Other case, disable engine. */ /* Don't worry WPA key, we will add WPA Key after 4-Way handshaking. */ /* */ - USHORT offset; + u16 offset; offset = MAC_WCID_ATTRIBUTE_BASE + @@ -1906,8 +1906,8 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd) case OID_802_11_ADD_WEP: { - UINT i; - UINT32 KeyIdx; + u32 i; + u32 KeyIdx; PNDIS_802_11_WEP pWepKey; DBGPRINT(RT_DEBUG_TRACE, @@ -1926,10 +1926,10 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd) DBGPRINT(RT_DEBUG_ERROR, ("CmdThread::OID_802_11_ADD_WEP, INVALID_DATA!!\n")); } else { - UCHAR CipherAlg; + u8 CipherAlg; pAd->SharedKey[BSS0][KeyIdx]. KeyLen = - (UCHAR) pWepKey->KeyLength; + (u8)pWepKey->KeyLength; NdisMoveMemory(pAd-> SharedKey[BSS0] [KeyIdx].Key, @@ -1969,14 +1969,14 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd) if (pWepKey-> KeyIndex & 0x80000000) { /* Default key for tx (shared key) */ - UCHAR IVEIV[8]; - UINT32 WCIDAttri, Value; - USHORT offset, offset2; + u8 IVEIV[8]; + u32 WCIDAttri, Value; + u16 offset, offset2; NdisZeroMemory(IVEIV, 8); pAd->StaCfg. DefaultKeyId = - (UCHAR) KeyIdx; + (u8)KeyIdx; /* Add BSSID to WCTable. because this is Tx wep key. */ /* WCID Attribute UDF:3, BSSIdx:3, Alg:3, Keytable:1=PAIRWISE KEY, BSSIdx is 0 */ WCIDAttri = @@ -1993,7 +1993,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd) WCIDAttri); /* 1. IV/EIV */ /* Specify key index to find shared key. */ - IVEIV[3] = (UCHAR) (KeyIdx << 6); /*WEP Eiv bit off. groupkey index is not 0 */ + IVEIV[3] = (u8)(KeyIdx << 6); /*WEP Eiv bit off. groupkey index is not 0 */ offset = PAIRWISE_IVEIV_TABLE_BASE + @@ -2052,7 +2052,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd) } AsicAddSharedKeyEntry(pAd, BSS0, - (UCHAR) + (u8) KeyIdx, CipherAlg, pWepKey-> @@ -2080,7 +2080,7 @@ VOID CMDHandler(IN PRTMP_ADAPTER pAd) case CMDTHREAD_SET_PSM_BIT: { - USHORT *pPsm = (USHORT *) pData; + u16 *pPsm = (u16 *) pData; MlmeSetPsmBit(pAd, *pPsm); } break; |