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 | 8a10a54656aff69de3530efa793cbec8d2b51d02 (patch) | |
tree | 5c9937dd20f50b1f386ac48af7f30a2cc7b351a3 /drivers/staging | |
parent | 51126deb201c59cc8cdc4873e3d130d6bc60513d (diff) |
Staging: rt28x0: remove typedefs (part two)
Remove typedefs from rt_linux.h and rtmp_usb.h.
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging')
28 files changed, 394 insertions, 422 deletions
diff --git a/drivers/staging/rt2860/chip/mac_usb.h b/drivers/staging/rt2860/chip/mac_usb.h index b902074a41c..f146232bf15 100644 --- a/drivers/staging/rt2860/chip/mac_usb.h +++ b/drivers/staging/rt2860/chip/mac_usb.h @@ -198,7 +198,7 @@ typedef struct _RX_CONTEXT { BOOLEAN Readable; /* Receive Complete back. OK for driver to indicate receiving packet. */ BOOLEAN IRPPending; /* TODO: To be removed */ atomic_t IrpLock; - NDIS_SPIN_LOCK RxContextLock; + spinlock_t RxContextLock; dma_addr_t data_dma; /* urb dma on linux */ } RX_CONTEXT, *PRX_CONTEXT; diff --git a/drivers/staging/rt2860/common/ba_action.c b/drivers/staging/rt2860/common/ba_action.c index 1ffa176ce8a..f90d709bcf4 100644 --- a/drivers/staging/rt2860/common/ba_action.c +++ b/drivers/staging/rt2860/common/ba_action.c @@ -100,7 +100,7 @@ void BA_MaxWinSizeReasign(IN PRTMP_ADAPTER pAd, void Announce_Reordering_Packet(IN PRTMP_ADAPTER pAd, IN struct reordering_mpdu *mpdu) { - PNDIS_PACKET pPacket; + void *pPacket; pPacket = mpdu->pPacket; @@ -1388,7 +1388,7 @@ void convert_reordering_packet_to_preAMSDU_or_802_3_packet(IN PRTMP_ADAPTER pAd, u8 FromWhichBSSID) { - PNDIS_PACKET pRxPkt; + void *pRxPkt; u8 Header802_3[LENGTH_802_3]; /* 1. get 802.3 Header */ diff --git a/drivers/staging/rt2860/common/cmm_data.c b/drivers/staging/rt2860/common/cmm_data.c index cd000fb2be9..64b21771034 100644 --- a/drivers/staging/rt2860/common/cmm_data.c +++ b/drivers/staging/rt2860/common/cmm_data.c @@ -107,7 +107,7 @@ QID_AC_VO, QID_AC_VO }; int MiniportMMRequest(IN PRTMP_ADAPTER pAd, u8 QueIdx, u8 *pData, u32 Length) { - PNDIS_PACKET pPacket; + void *pPacket; int Status = NDIS_STATUS_SUCCESS; unsigned long FreeNum; u8 rtmpHwHdr[TXINFO_SIZE + TXWI_SIZE]; /*RTMP_HW_HDR_LEN]; */ @@ -243,7 +243,7 @@ int MiniportMMRequest(IN PRTMP_ADAPTER pAd, ======================================================================== */ int MlmeHardTransmit(IN PRTMP_ADAPTER pAd, - u8 QueIdx, IN PNDIS_PACKET pPacket) + u8 QueIdx, void *pPacket) { PACKET_INFO PacketInfo; u8 *pSrcBufVA; @@ -271,7 +271,7 @@ int MlmeHardTransmit(IN PRTMP_ADAPTER pAd, } int MlmeHardTransmitMgmtRing(IN PRTMP_ADAPTER pAd, - u8 QueIdx, IN PNDIS_PACKET pPacket) + u8 QueIdx, void *pPacket) { PACKET_INFO PacketInfo; u8 *pSrcBufVA; @@ -506,7 +506,7 @@ int MlmeHardTransmitMgmtRing(IN PRTMP_ADAPTER pAd, (2).Normal ======================================================================== */ -static u8 TxPktClassification(IN RTMP_ADAPTER * pAd, IN PNDIS_PACKET pPacket) +static u8 TxPktClassification(IN RTMP_ADAPTER * pAd, void *pPacket) { u8 TxFrameType = TX_UNKOWN_FRAME; u8 Wcid; @@ -557,7 +557,7 @@ static u8 TxPktClassification(IN RTMP_ADAPTER * pAd, IN PNDIS_PACKET pPacket) BOOLEAN RTMP_FillTxBlkInfo(IN RTMP_ADAPTER * pAd, IN TX_BLK * pTxBlk) { PACKET_INFO PacketInfo; - PNDIS_PACKET pPacket; + void *pPacket; PMAC_TABLE_ENTRY pMacEntry = NULL; pPacket = pTxBlk->pPacket; @@ -663,7 +663,7 @@ BOOLEAN RTMP_FillTxBlkInfo(IN RTMP_ADAPTER * pAd, IN TX_BLK * pTxBlk) } BOOLEAN CanDoAggregateTransmit(IN RTMP_ADAPTER * pAd, - IN NDIS_PACKET * pPacket, IN TX_BLK * pTxBlk) + char * pPacket, IN TX_BLK * pTxBlk) { /*DBGPRINT(RT_DEBUG_TRACE, ("Check if can do aggregation! TxFrameType=%d!\n", pTxBlk->TxFrameType)); */ @@ -716,7 +716,7 @@ void RTMPDeQueuePacket(IN PRTMP_ADAPTER pAd, IN BOOLEAN bIntContext, u8 QIdx, /* u8 Max_Tx_Packets) { PQUEUE_ENTRY pEntry = NULL; - PNDIS_PACKET pPacket; + void *pPacket; int Status = NDIS_STATUS_SUCCESS; u8 Count = 0; PQUEUE_HEADER pQueue; @@ -1380,7 +1380,7 @@ void RTMPResumeMsduTransmission(IN PRTMP_ADAPTER pAd) } u32 deaggregate_AMSDU_announce(IN PRTMP_ADAPTER pAd, - PNDIS_PACKET pPacket, + void *pPacket, u8 *pData, unsigned long DataSize) { u16 PayloadSize; @@ -1390,7 +1390,7 @@ u32 deaggregate_AMSDU_announce(IN PRTMP_ADAPTER pAd, u8 Header802_3[14]; u8 *pPayload, *pDA, *pSA, *pRemovedLLCSNAP; - PNDIS_PACKET pClonePacket; + void *pClonePacket; nMSDU = 0; @@ -1479,7 +1479,7 @@ u32 deaggregate_AMSDU_announce(IN PRTMP_ADAPTER pAd, return nMSDU; } -u32 BA_Reorder_AMSDU_Annnounce(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) +u32 BA_Reorder_AMSDU_Annnounce(IN PRTMP_ADAPTER pAd, void *pPacket) { u8 *pData; u16 DataSize; @@ -1853,7 +1853,7 @@ void DisassocParmFill(IN PRTMP_ADAPTER pAd, ======================================================================== */ -BOOLEAN RTMPCheckDHCPFrame(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) +BOOLEAN RTMPCheckDHCPFrame(IN PRTMP_ADAPTER pAd, void *pPacket) { PACKET_INFO PacketInfo; unsigned long NumberOfBytesRead = 0; @@ -1908,7 +1908,7 @@ BOOLEAN RTMPCheckDHCPFrame(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) return TRUE; } -BOOLEAN RTMPCheckEtherType(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) +BOOLEAN RTMPCheckEtherType(IN PRTMP_ADAPTER pAd, void *pPacket) { u16 TypeLen; u8 Byte0, Byte1; @@ -1938,7 +1938,7 @@ BOOLEAN RTMPCheckEtherType(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) */ if (pSrcBuf[0] == 0xAA && pSrcBuf[1] == 0xAA && pSrcBuf[2] == 0x03) { - Sniff2BytesFromNdisBuffer((PNDIS_BUFFER) pSrcBuf, 6, + Sniff2BytesFromNdisBuffer((char *)pSrcBuf, 6, &Byte0, &Byte1); RTMP_SET_PACKET_LLCSNAP(pPacket, 1); TypeLen = (u16)((Byte0 << 8) + Byte1); @@ -1961,7 +1961,7 @@ BOOLEAN RTMPCheckEtherType(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) Frame Check Sequence (4-bytes) */ RTMP_SET_PACKET_VLAN(pPacket, 1); - Sniff2BytesFromNdisBuffer((PNDIS_BUFFER) pSrcBuf, 2, &Byte0, + Sniff2BytesFromNdisBuffer((char *)pSrcBuf, 2, &Byte0, &Byte1); TypeLen = (u16)((Byte0 << 8) + Byte1); @@ -2043,7 +2043,7 @@ void Update_Rssi_Sample(IN PRTMP_ADAPTER pAd, void Indicate_Legacy_Packet(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk, u8 FromWhichBSSID) { - PNDIS_PACKET pRxPacket = pRxBlk->pRxPacket; + void *pRxPacket = pRxBlk->pRxPacket; u8 Header802_3[LENGTH_802_3]; /* 1. get 802.3 Header */ @@ -2135,7 +2135,7 @@ void CmmRxRalinkFrameIndicate(IN PRTMP_ADAPTER pAd, u16 Msdu2Size; u16 Payload1Size, Payload2Size; u8 *pData2; - PNDIS_PACKET pPacket2 = NULL; + void *pPacket2 = NULL; Msdu2Size = *(pRxBlk->pData) + (*(pRxBlk->pData + 1) << 8); @@ -2192,13 +2192,13 @@ void CmmRxRalinkFrameIndicate(IN PRTMP_ADAPTER pAd, _fragFrame.Flags = 0; \ } -PNDIS_PACKET RTMPDeFragmentDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk) +void *RTMPDeFragmentDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk) { PHEADER_802_11 pHeader = pRxBlk->pHeader; - PNDIS_PACKET pRxPacket = pRxBlk->pRxPacket; + void *pRxPacket = pRxBlk->pRxPacket; u8 *pData = pRxBlk->pData; u16 DataSize = pRxBlk->DataSize; - PNDIS_PACKET pRetPacket = NULL; + void *pRetPacket = NULL; u8 *pFragBuffer = NULL; BOOLEAN bReassDone = FALSE; u8 HeaderRoom = 0; @@ -2273,7 +2273,7 @@ done: /* return defragmented packet if packet is reassembled completely */ /* otherwise return NULL */ if (bReassDone) { - PNDIS_PACKET pNewFragPacket; + void *pNewFragPacket; /* allocate a new packet buffer for fragment */ pNewFragPacket = diff --git a/drivers/staging/rt2860/common/cmm_data_pci.c b/drivers/staging/rt2860/common/cmm_data_pci.c index 19eb9286135..b2549473fa8 100644 --- a/drivers/staging/rt2860/common/cmm_data_pci.c +++ b/drivers/staging/rt2860/common/cmm_data_pci.c @@ -343,7 +343,7 @@ u16 RtmpPCI_WriteFragTxResource(IN PRTMP_ADAPTER pAd, */ int RtmpPCIMgmtKickOut(IN RTMP_ADAPTER * pAd, u8 QueIdx, - IN PNDIS_PACKET pPacket, + void *pPacket, u8 *pSrcBufVA, u32 SrcBufLen) { PTXD_STRUC pTxD; @@ -520,7 +520,7 @@ BOOLEAN RTMPFreeTXDUponTxDmaDone(IN PRTMP_ADAPTER pAd, u8 QueIdx) { PRTMP_TX_RING pTxRing; PTXD_STRUC pTxD; - PNDIS_PACKET pPacket; + void *pPacket; u8 FREE = 0; TXD_STRUC TxD, *pOriTxD; /*unsigned long IrqFlags; */ @@ -664,7 +664,7 @@ BOOLEAN RTMPHandleTxRingDmaDoneInterrupt(IN PRTMP_ADAPTER pAd, void RTMPHandleMgmtRingDmaDoneInterrupt(IN PRTMP_ADAPTER pAd) { PTXD_STRUC pTxD; - PNDIS_PACKET pPacket; + void *pPacket; /* int i; */ u8 FREE = 0; PRTMP_MGMT_RING pMgmtRing = &pAd->MgmtRing; @@ -773,16 +773,16 @@ void RTMPHandleRxCoherentInterrupt(IN PRTMP_ADAPTER pAd) DBGPRINT(RT_DEBUG_TRACE, ("<== RTMPHandleRxCoherentInterrupt \n")); } -PNDIS_PACKET GetPacketFromRxRing(IN PRTMP_ADAPTER pAd, +void *GetPacketFromRxRing(IN PRTMP_ADAPTER pAd, OUT PRT28XX_RXD_STRUC pSaveRxD, OUT BOOLEAN * pbReschedule, IN u32 * pRxPending) { PRXD_STRUC pRxD; - PNDIS_PACKET pRxPacket = NULL; - PNDIS_PACKET pNewPacket; + void *pRxPacket = NULL; + void *pNewPacket; void *AllocVa; - NDIS_PHYSICAL_ADDRESS AllocPa; + dma_addr_t AllocPa; BOOLEAN bReschedule = FALSE; RTMP_DMACB *pRxCell; @@ -834,7 +834,7 @@ PNDIS_PACKET GetPacketFromRxRing(IN PRTMP_ADAPTER pAd, pRxPacket = pRxCell->pNdisPacket; pRxCell->DmaBuf.AllocSize = RX_BUFFER_AGGRESIZE; - pRxCell->pNdisPacket = (PNDIS_PACKET) pNewPacket; + pRxCell->pNdisPacket = (void *)pNewPacket; pRxCell->DmaBuf.AllocVa = AllocVa; pRxCell->DmaBuf.AllocPa = AllocPa; /* update SDP0 to new buffer of rx packet */ @@ -865,7 +865,7 @@ done: } int MlmeHardTransmitTxRing(IN PRTMP_ADAPTER pAd, - u8 QueIdx, IN PNDIS_PACKET pPacket) + u8 QueIdx, void *pPacket) { PACKET_INFO PacketInfo; u8 *pSrcBufVA; @@ -1041,7 +1041,7 @@ int MlmeHardTransmitTxRing(IN PRTMP_ADAPTER pAd, } int MlmeDataHardTransmit(IN PRTMP_ADAPTER pAd, - u8 QueIdx, IN PNDIS_PACKET pPacket) + u8 QueIdx, void *pPacket) { if ((pAd->CommonCfg.RadarDetect.RDMode != RD_NORMAL_MODE) ) { diff --git a/drivers/staging/rt2860/common/cmm_data_usb.c b/drivers/staging/rt2860/common/cmm_data_usb.c index 79067565936..f3a7208e043 100644 --- a/drivers/staging/rt2860/common/cmm_data_usb.c +++ b/drivers/staging/rt2860/common/cmm_data_usb.c @@ -575,7 +575,7 @@ void RtmpUSBDataKickOut(IN PRTMP_ADAPTER pAd, */ int RtmpUSBMgmtKickOut(IN RTMP_ADAPTER * pAd, u8 QueIdx, - IN PNDIS_PACKET pPacket, + void *pPacket, u8 *pSrcBufVA, u32 SrcBufLen) { PTXINFO_STRUC pTxInfo; @@ -707,13 +707,13 @@ Return Value: Note: ======================================================================== */ -PNDIS_PACKET GetPacketFromRxRing(IN PRTMP_ADAPTER pAd, +void *GetPacketFromRxRing(IN PRTMP_ADAPTER pAd, OUT PRT28XX_RXD_STRUC pSaveRxD, OUT BOOLEAN * pbReschedule, IN u32 * pRxPending) { PRX_CONTEXT pRxContext; - PNDIS_PACKET pSkb; + void *pSkb; u8 *pData; unsigned long ThisFrameLen; unsigned long RxBufferLength; diff --git a/drivers/staging/rt2860/common/cmm_mac_pci.c b/drivers/staging/rt2860/common/cmm_mac_pci.c index c7f4be1181c..f0053422056 100644 --- a/drivers/staging/rt2860/common/cmm_mac_pci.c +++ b/drivers/staging/rt2860/common/cmm_mac_pci.c @@ -60,7 +60,7 @@ int RTMPAllocTxRxRingMemory(IN PRTMP_ADAPTER pAd) unsigned long ErrorValue = 0; PRTMP_TX_RING pTxRing; PRTMP_DMABUF pDmaBuf; - PNDIS_PACKET pPacket; + void *pPacket; /* PRTMP_REORDERBUF pReorderBuf; */ DBGPRINT(RT_DEBUG_TRACE, ("--> RTMPAllocTxRxRingMemory\n")); @@ -405,7 +405,7 @@ void RTMPRingCleanUp(IN PRTMP_ADAPTER pAd, u8 RingType) PTXD_STRUC pTxD; PRXD_STRUC pRxD; PQUEUE_ENTRY pEntry; - PNDIS_PACKET pPacket; + void *pPacket; int i; PRTMP_TX_RING pTxRing; unsigned long IrqFlags; @@ -428,8 +428,8 @@ void RTMPRingCleanUp(IN PRTMP_ADAPTER pAd, u8 RingType) { pTxD = (PTXD_STRUC) pTxRing->Cell[i].AllocVa; - pPacket = (PNDIS_PACKET) pTxRing->Cell[i].pNdisPacket; - /* release scatter-and-gather NDIS_PACKET */ + pPacket = (void *)pTxRing->Cell[i].pNdisPacket; + /* release scatter-and-gather char */ if (pPacket) { RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE); @@ -437,8 +437,8 @@ void RTMPRingCleanUp(IN PRTMP_ADAPTER pAd, u8 RingType) } pPacket = - (PNDIS_PACKET) pTxRing->Cell[i].pNextNdisPacket; - /* release scatter-and-gather NDIS_PACKET */ + (void *)pTxRing->Cell[i].pNextNdisPacket; + /* release scatter-and-gather char */ if (pPacket) { RELEASE_NDIS_PACKET(pAd, pPacket, NDIS_STATUS_FAILURE); @@ -474,8 +474,8 @@ void RTMPRingCleanUp(IN PRTMP_ADAPTER pAd, u8 RingType) pTxD = (PTXD_STRUC) pAd->MgmtRing.Cell[i].AllocVa; pPacket = - (PNDIS_PACKET) pAd->MgmtRing.Cell[i].pNdisPacket; - /* rlease scatter-and-gather NDIS_PACKET */ + (void *)pAd->MgmtRing.Cell[i].pNdisPacket; + /* rlease scatter-and-gather char */ if (pPacket) { PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr0, pTxD->SDLen0, @@ -486,9 +486,9 @@ void RTMPRingCleanUp(IN PRTMP_ADAPTER pAd, u8 RingType) pAd->MgmtRing.Cell[i].pNdisPacket = NULL; pPacket = - (PNDIS_PACKET) pAd->MgmtRing.Cell[i]. + (void *)pAd->MgmtRing.Cell[i]. pNextNdisPacket; - /* release scatter-and-gather NDIS_PACKET */ + /* release scatter-and-gather char */ if (pPacket) { PCI_UNMAP_SINGLE(pAd, pTxD->SDPtr1, pTxD->SDLen1, @@ -538,17 +538,17 @@ void RTMPFreeTxRxRingMemory(IN PRTMP_ADAPTER pAd) int index, num, j; PRTMP_TX_RING pTxRing; PTXD_STRUC pTxD; - PNDIS_PACKET pPacket; + void *pPacket; unsigned int IrqFlags; - /*POS_COOKIE pObj =(POS_COOKIE) pAd->OS_Cookie; */ + /*struct os_cookie *pObj =(struct os_cookie *)pAd->OS_Cookie; */ DBGPRINT(RT_DEBUG_TRACE, ("--> RTMPFreeTxRxRingMemory\n")); /* Free TxSwQueue Packet */ for (index = 0; index < NUM_OF_TX_RING; index++) { PQUEUE_ENTRY pEntry; - PNDIS_PACKET pPacket; + void *pPacket; PQUEUE_HEADER pQueue; RTMP_IRQ_LOCK(&pAd->irq_lock, IrqFlags); diff --git a/drivers/staging/rt2860/common/cmm_mac_usb.c b/drivers/staging/rt2860/common/cmm_mac_usb.c index d5bc37d8279..251debb67d7 100644 --- a/drivers/staging/rt2860/common/cmm_mac_usb.c +++ b/drivers/staging/rt2860/common/cmm_mac_usb.c @@ -52,7 +52,7 @@ int NICInitRecv(IN PRTMP_ADAPTER pAd) { u8 i; int Status = NDIS_STATUS_SUCCESS; - POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; + struct os_cookie *pObj = (struct os_cookie *)pAd->OS_Cookie; DBGPRINT(RT_DEBUG_TRACE, ("--> NICInitRecv\n")); pObj = pObj; @@ -166,7 +166,7 @@ int NICInitTransmit(IN PRTMP_ADAPTER pAd) PTX_CONTEXT pRTSContext = &(pAd->RTSContext); PTX_CONTEXT pMLMEContext = NULL; /* PHT_TX_CONTEXT pHTTXContext = NULL; */ - POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; + struct os_cookie *pObj = (struct os_cookie *)pAd->OS_Cookie; void *RingBaseVa; /* RTMP_TX_RING *pTxRing; */ RTMP_MGMT_RING *pMgmtRing; @@ -538,7 +538,7 @@ void RTMPFreeTxRxRingMemory(IN PRTMP_ADAPTER pAd) PTX_CONTEXT pRTSContext = &pAd->RTSContext; /* PHT_TX_CONTEXT pHTTXContext; */ /*PRTMP_REORDERBUF pReorderBuf; */ - POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; + struct os_cookie *pObj = (struct os_cookie *)pAd->OS_Cookie; /* RTMP_TX_RING *pTxRing; */ DBGPRINT(RT_DEBUG_ERROR, ("---> RTMPFreeTxRxRingMemory\n")); diff --git a/drivers/staging/rt2860/common/cmm_tkip.c b/drivers/staging/rt2860/common/cmm_tkip.c index ab00a0c5e3e..0ac9d744a86 100644 --- a/drivers/staging/rt2860/common/cmm_tkip.c +++ b/drivers/staging/rt2860/common/cmm_tkip.c @@ -487,7 +487,7 @@ BOOLEAN RTMPTkipCompareMICValue(IN PRTMP_ADAPTER pAd, Arguments: pAd Pointer to our adapter - PNDIS_PACKET Pointer to Ndis Packet for MIC calculation + void * Pointer to Ndis Packet for MIC calculation pEncap Pointer to LLC encap data LenEncap Total encap length, might be 0 which indicates no encap @@ -501,7 +501,7 @@ BOOLEAN RTMPTkipCompareMICValue(IN PRTMP_ADAPTER pAd, ======================================================================== */ void RTMPCalculateMICValue(IN PRTMP_ADAPTER pAd, - IN PNDIS_PACKET pPacket, + void *pPacket, u8 *pEncap, IN PCIPHER_KEY pKey, u8 apidx) { diff --git a/drivers/staging/rt2860/common/cmm_wpa.c b/drivers/staging/rt2860/common/cmm_wpa.c index 3fce5a71719..6daccd94e1e 100644 --- a/drivers/staging/rt2860/common/cmm_wpa.c +++ b/drivers/staging/rt2860/common/cmm_wpa.c @@ -347,7 +347,7 @@ void WpaEAPOLKeyAction(IN PRTMP_ADAPTER pAd, IN MLME_QUEUE_ELEM * Elem) Arguments: pAd Pointer to our adapter - PNDIS_PACKET Pointer to outgoing Ndis frame + void * Pointer to outgoing Ndis frame NumberOfFrag Number of fragment required Return Value: @@ -363,7 +363,7 @@ void RTMPToWirelessSta(IN PRTMP_ADAPTER pAd, u32 HdrLen, u8 *pData, u32 DataLen, IN BOOLEAN bClearFrame) { - PNDIS_PACKET pPacket; + void *pPacket; int Status; if ((!pEntry) || ((!pEntry->ValidAsCLI) && (!pEntry->ValidAsApCli))) diff --git a/drivers/staging/rt2860/common/rtmp_init.c b/drivers/staging/rt2860/common/rtmp_init.c index 5735dd7c182..5cda0ea53f3 100644 --- a/drivers/staging/rt2860/common/rtmp_init.c +++ b/drivers/staging/rt2860/common/rtmp_init.c @@ -651,7 +651,7 @@ void RTMPReadChannelPwr(IN PRTMP_ADAPTER pAd) ======================================================================== */ int NICReadRegParameters(IN PRTMP_ADAPTER pAd, - IN NDIS_HANDLE WrapperConfigurationContext) + void *WrapperConfigurationContext) { int Status = NDIS_STATUS_SUCCESS; DBGPRINT_S(Status, ("<-- NICReadRegParameters, Status=%x\n", Status)); @@ -3544,9 +3544,9 @@ BOOLEAN RtmpRaDevCtrlExit(IN RTMP_ADAPTER * pAd) } /* not yet support MBSS */ -PNET_DEV get_netdev_from_bssid(IN PRTMP_ADAPTER pAd, u8 FromWhichBSSID) +struct net_device *get_netdev_from_bssid(IN PRTMP_ADAPTER pAd, u8 FromWhichBSSID) { - PNET_DEV dev_p = NULL; + struct net_device *dev_p = NULL; { dev_p = pAd->net_dev; diff --git a/drivers/staging/rt2860/iface/rtmp_pci.h b/drivers/staging/rt2860/iface/rtmp_pci.h index 4f42158321c..7759d56a304 100644 --- a/drivers/staging/rt2860/iface/rtmp_pci.h +++ b/drivers/staging/rt2860/iface/rtmp_pci.h @@ -29,7 +29,7 @@ #define __RTMP_PCI_H__ #define RT28XX_HANDLE_DEV_ASSIGN(handle, dev_p) \ - ((POS_COOKIE)handle)->pci_dev = dev_p; + ((struct os_cookie *)handle)->pci_dev = dev_p; #ifdef LINUX // set driver data @@ -41,12 +41,12 @@ #ifdef PCI_MSI_SUPPORT #define RTMP_MSI_ENABLE(_pAd) \ - { POS_COOKIE _pObj = (POS_COOKIE)(_pAd->OS_Cookie); \ + { struct os_cookie *_pObj = (struct os_cookie *)(_pAd->OS_Cookie); \ (_pAd)->HaveMsi = pci_enable_msi(_pObj->pci_dev) == 0 ? TRUE : FALSE; \ } #define RTMP_MSI_DISABLE(_pAd) \ - { POS_COOKIE _pObj = (POS_COOKIE)(_pAd->OS_Cookie); \ + { struct os_cookie *_pObj = (struct os_cookie *)(_pAd->OS_Cookie); \ if (_pAd->HaveMsi == TRUE) \ pci_disable_msi(_pObj->pci_dev); \ _pAd->HaveMsi = FALSE; \ diff --git a/drivers/staging/rt2860/iface/rtmp_usb.h b/drivers/staging/rt2860/iface/rtmp_usb.h index 40d7d01cfe8..f2955a2de02 100644 --- a/drivers/staging/rt2860/iface/rtmp_usb.h +++ b/drivers/staging/rt2860/iface/rtmp_usb.h @@ -32,10 +32,6 @@ #ifdef LINUX #include <linux/usb.h> - -typedef struct usb_device *PUSB_DEV; -typedef struct urb *purbb_t; -typedef struct usb_ctrlrequest devctrlrequest; #endif // LINUX // extern u8 EpToQueue[6]; @@ -108,7 +104,7 @@ extern void dump_urb(struct urb *purb); #define USBD_TRANSFER_DIRECTION_OUT 0 #define USBD_TRANSFER_DIRECTION_IN 0 #define USBD_SHORT_TRANSFER_OK 0 -#define PURB purbb_t +#define PURB struct urb * #define PIRP void * #define NDIS_OID u32 @@ -120,12 +116,12 @@ extern void dump_urb(struct urb *purb); #define CONTROL_TIMEOUT_JIFFIES ( (100 * OS_HZ) / 1000) #define UNLINK_TIMEOUT_MS 3 -void RTUSBBulkOutDataPacketComplete(purbb_t purb, struct pt_regs *pt_regs); -void RTUSBBulkOutMLMEPacketComplete(purbb_t pUrb, struct pt_regs *pt_regs); -void RTUSBBulkOutNullFrameComplete(purbb_t pUrb, struct pt_regs *pt_regs); -void RTUSBBulkOutRTSFrameComplete(purbb_t pUrb, struct pt_regs *pt_regs); -void RTUSBBulkOutPsPollComplete(purbb_t pUrb, struct pt_regs *pt_regs); -void RTUSBBulkRxComplete(purbb_t pUrb, struct pt_regs *pt_regs); +void RTUSBBulkOutDataPacketComplete(struct urb *purb, struct pt_regs *pt_regs); +void RTUSBBulkOutMLMEPacketComplete(struct urb *pUrb, struct pt_regs *pt_regs); +void RTUSBBulkOutNullFrameComplete(struct urb *pUrb, struct pt_regs *pt_regs); +void RTUSBBulkOutRTSFrameComplete(struct urb *pUrb, struct pt_regs *pt_regs); +void RTUSBBulkOutPsPollComplete(struct urb *pUrb, struct pt_regs *pt_regs); +void RTUSBBulkRxComplete(struct urb *pUrb, struct pt_regs *pt_regs); #ifdef KTHREAD_SUPPORT #define RTUSBMlmeUp(pAd) \ diff --git a/drivers/staging/rt2860/mlme.h b/drivers/staging/rt2860/mlme.h index 3be1bc89095..09e326ee85b 100644 --- a/drivers/staging/rt2860/mlme.h +++ b/drivers/staging/rt2860/mlme.h @@ -843,7 +843,7 @@ typedef struct _MLME_QUEUE { unsigned long Num; unsigned long Head; unsigned long Tail; - NDIS_SPIN_LOCK Lock; + spinlock_t Lock; MLME_QUEUE_ELEM Entry[MAX_LEN_OF_MLME_QUEUE]; } MLME_QUEUE, *PMLME_QUEUE; diff --git a/drivers/staging/rt2860/pci_main_dev.c b/drivers/staging/rt2860/pci_main_dev.c index 24f939ddd44..20db402b1d9 100644 --- a/drivers/staging/rt2860/pci_main_dev.c +++ b/drivers/staging/rt2860/pci_main_dev.c @@ -160,7 +160,7 @@ static int rt2860_suspend(struct pci_dev *pci_dev, pm_message_t state) RTMP_SET_FLAG(pAd, fRTMP_ADAPTER_RADIO_OFF); /* take down the device */ - rt28xx_close((PNET_DEV) net_dev); + rt28xx_close((struct net_device *)net_dev); RT_MOD_DEC_USE_COUNT(); } @@ -223,7 +223,7 @@ static int rt2860_resume(struct pci_dev *pci_dev) /* mark device as attached from system and restart if needed */ netif_device_attach(net_dev); - if (rt28xx_open((PNET_DEV) net_dev) != 0) { + if (rt28xx_open((struct net_device *)net_dev) != 0) { /* open fail */ DBGPRINT(RT_DEBUG_TRACE, ("<=== rt2860_resume()\n")); @@ -323,7 +323,7 @@ static int __devinit rt2860_probe(IN struct pci_dev *pci_dev, goto err_out_iounmap; } - ((POS_COOKIE) handle)->pci_dev = pci_dev; + ((struct os_cookie *)handle)->pci_dev = pci_dev; rv = RTMPAllocAdapterBlock(handle, &pAd); /*shiang: we may need the pci_dev for allocate structure of "RTMP_ADAPTER" */ if (rv != NDIS_STATUS_SUCCESS) @@ -391,7 +391,7 @@ err_out: static void __devexit rt2860_remove_one(IN struct pci_dev *pci_dev) { - PNET_DEV net_dev = pci_get_drvdata(pci_dev); + struct net_device *net_dev = pci_get_drvdata(pci_dev); RTMP_ADAPTER *pAd = NULL; unsigned long csr_addr = net_dev->base_addr; /* pAd->CSRBaseAddress; */ @@ -459,9 +459,9 @@ BOOLEAN RT28XXChipsetCheck(IN void *_dev_p) static void RTMPInitPCIeDevice(IN struct pci_dev *pci_dev, IN PRTMP_ADAPTER pAd) { u16 device_id; - POS_COOKIE pObj; + struct os_cookie *pObj; - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; pci_read_config_word(pci_dev, PCI_DEVICE_ID, &device_id); device_id = le2cpu16(device_id); pObj->DeviceID = device_id; @@ -501,9 +501,9 @@ void RTMPInitPCIeLinkCtrlValue(IN PRTMP_ADAPTER pAd) u16 reg16, data2, PCIePowerSaveLevel, Configuration; u32 MacValue; BOOLEAN bFindIntel = FALSE; - POS_COOKIE pObj; + struct os_cookie *pObj; - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE)) return; @@ -815,10 +815,10 @@ void RTMPFindHostPCIDev(IN PRTMP_ADAPTER pAd) u16 reg16; u8 reg8; u32 DevFn; - PPCI_DEV pPci_dev; - POS_COOKIE pObj; + struct pci_dev *pPci_dev; + struct os_cookie *pObj; - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE)) return; @@ -860,9 +860,9 @@ void RTMPPCIeLinkCtrlValueRestore(IN PRTMP_ADAPTER pAd, u8 Level) { u16 PCIePowerSaveLevel, reg16; u16 Configuration; - POS_COOKIE pObj; + struct os_cookie *pObj; - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE)) return; @@ -954,9 +954,9 @@ void RTMPPCIeLinkCtrlSetting(IN PRTMP_ADAPTER pAd, u16 Max) { u16 PCIePowerSaveLevel, reg16; u16 Configuration; - POS_COOKIE pObj; + struct os_cookie *pObj; - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; if (!OPSTATUS_TEST_FLAG(pAd, fOP_STATUS_PCIE_DEVICE)) return; @@ -1081,11 +1081,11 @@ void RTMPrt3xSetPCIePowerLinkCtrl(IN PRTMP_ADAPTER pAd) unsigned long HostConfiguration = 0; unsigned long Configuration; - POS_COOKIE pObj; + struct os_cookie *pObj; int pos; u16 reg16; - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; DBGPRINT(RT_DEBUG_INFO, ("RTMPrt3xSetPCIePowerLinkCtrl.===> %lx\n", diff --git a/drivers/staging/rt2860/rt_linux.c b/drivers/staging/rt2860/rt_linux.c index 5f781f53281..4c281179944 100644 --- a/drivers/staging/rt2860/rt_linux.c +++ b/drivers/staging/rt2860/rt_linux.c @@ -80,7 +80,7 @@ char const *pWirelessFloodEventText[IW_FLOOD_EVENT_TYPE_NUM] = { }; /* timeout -- ms */ -void RTMP_SetPeriodicTimer(IN NDIS_MINIPORT_TIMER * pTimer, +void RTMP_SetPeriodicTimer(struct timer_list * pTimer, IN unsigned long timeout) { timeout = ((timeout * OS_HZ) / 1000); @@ -90,7 +90,7 @@ void RTMP_SetPeriodicTimer(IN NDIS_MINIPORT_TIMER * pTimer, /* convert NdisMInitializeTimer --> RTMP_OS_Init_Timer */ void RTMP_OS_Init_Timer(IN PRTMP_ADAPTER pAd, - IN NDIS_MINIPORT_TIMER * pTimer, + struct timer_list * pTimer, IN TIMER_FUNCTION function, void *data) { init_timer(pTimer); @@ -98,7 +98,7 @@ void RTMP_OS_Init_Timer(IN PRTMP_ADAPTER pAd, pTimer->function = function; } -void RTMP_OS_Add_Timer(IN NDIS_MINIPORT_TIMER * pTimer, +void RTMP_OS_Add_Timer(struct timer_list * pTimer, IN unsigned long timeout) { if (timer_pending(pTimer)) @@ -109,14 +109,14 @@ void RTMP_OS_Add_Timer(IN NDIS_MINIPORT_TIMER * pTimer, add_timer(pTimer); } -void RTMP_OS_Mod_Timer(IN NDIS_MINIPORT_TIMER * pTimer, +void RTMP_OS_Mod_Timer(struct timer_list * pTimer, IN unsigned long timeout) { timeout = ((timeout * OS_HZ) / 1000); mod_timer(pTimer, jiffies + timeout); } -void RTMP_OS_Del_Timer(IN NDIS_MINIPORT_TIMER * pTimer, +void RTMP_OS_Del_Timer(struct timer_list * pTimer, OUT BOOLEAN * pCancelled) { if (timer_pending(pTimer)) { @@ -168,16 +168,16 @@ int os_free_mem(IN PRTMP_ADAPTER pAd, void *mem) return (NDIS_STATUS_SUCCESS); } -PNDIS_PACKET RtmpOSNetPktAlloc(IN RTMP_ADAPTER * pAd, IN int size) +void *RtmpOSNetPktAlloc(IN RTMP_ADAPTER * pAd, IN int size) { struct sk_buff *skb; /* Add 2 more bytes for ip header alignment */ skb = dev_alloc_skb(size + 2); - return ((PNDIS_PACKET) skb); + return ((void *)skb); } -PNDIS_PACKET RTMP_AllocateFragPacketBuffer(IN PRTMP_ADAPTER pAd, +void *RTMP_AllocateFragPacketBuffer(IN PRTMP_ADAPTER pAd, unsigned long Length) { struct sk_buff *pkt; @@ -193,10 +193,10 @@ PNDIS_PACKET RTMP_AllocateFragPacketBuffer(IN PRTMP_ADAPTER pAd, RTMP_SET_PACKET_SOURCE(OSPKT_TO_RTPKT(pkt), PKTSRC_NDIS); } - return (PNDIS_PACKET) pkt; + return (void *)pkt; } -PNDIS_PACKET RTMP_AllocateTxPacketBuffer(IN PRTMP_ADAPTER pAd, +void *RTMP_AllocateTxPacketBuffer(IN PRTMP_ADAPTER pAd, unsigned long Length, IN BOOLEAN Cached, void ** VirtualAddress) @@ -217,11 +217,11 @@ PNDIS_PACKET RTMP_AllocateTxPacketBuffer(IN PRTMP_ADAPTER pAd, *VirtualAddress = (void *)NULL; } - return (PNDIS_PACKET) pkt; + return (void *)pkt; } void build_tx_packet(IN PRTMP_ADAPTER pAd, - IN PNDIS_PACKET pPacket, + void *pPacket, u8 *pFrame, unsigned long FrameLen) { @@ -235,10 +235,10 @@ void build_tx_packet(IN PRTMP_ADAPTER pAd, void RTMPFreeAdapter(IN PRTMP_ADAPTER pAd) { - POS_COOKIE os_cookie; + struct os_cookie *os_cookie; int index; - os_cookie = (POS_COOKIE) pAd->OS_Cookie; + os_cookie = (struct os_cookie *)pAd->OS_Cookie; if (pAd->BeaconBuf) kfree(pAd->BeaconBuf); @@ -277,7 +277,7 @@ BOOLEAN OS_Need_Clone_Packet(void) clone an input NDIS PACKET to another one. The new internally created NDIS PACKET must have only one NDIS BUFFER return - byte copied. 0 means can't create NDIS PACKET - NOTE: internally created NDIS_PACKET should be destroyed by RTMPFreeNdisPacket + NOTE: internally created char should be destroyed by RTMPFreeNdisPacket Arguments: pAd Pointer to our adapter @@ -294,8 +294,8 @@ BOOLEAN OS_Need_Clone_Packet(void) */ int RTMPCloneNdisPacket(IN PRTMP_ADAPTER pAd, IN BOOLEAN pInsAMSDUHdr, - IN PNDIS_PACKET pInPacket, - OUT PNDIS_PACKET * ppOutPacket) + void *pInPacket, + void ** ppOutPacket) { struct sk_buff *pkt; @@ -324,18 +324,18 @@ int RTMPCloneNdisPacket(IN PRTMP_ADAPTER pAd, /* the allocated NDIS PACKET must be freed via RTMPFreeNdisPacket() */ int RTMPAllocateNdisPacket(IN PRTMP_ADAPTER pAd, - OUT PNDIS_PACKET * ppPacket, + void ** ppPacket, u8 *pHeader, u32 HeaderLen, u8 *pData, u32 DataLen) { - PNDIS_PACKET pPacket; + void *pPacket; ASSERT(pData); ASSERT(DataLen); /* 1. Allocate a packet */ pPacket = - (PNDIS_PACKET *) dev_alloc_skb(HeaderLen + DataLen + + (void **) dev_alloc_skb(HeaderLen + DataLen + RTMP_PKT_TAIL_PADDING); if (pPacket == NULL) { *ppPacket = NULL; @@ -363,11 +363,11 @@ int RTMPAllocateNdisPacket(IN PRTMP_ADAPTER pAd, /* ======================================================================== Description: - This routine frees a miniport internally allocated NDIS_PACKET and its + This routine frees a miniport internally allocated char and its corresponding NDIS_BUFFER and allocated memory. ======================================================================== */ -void RTMPFreeNdisPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) +void RTMPFreeNdisPacket(IN PRTMP_ADAPTER pAd, void *pPacket) { dev_kfree_skb_any(RTPKT_TO_OSPKT(pPacket)); } @@ -375,7 +375,7 @@ void RTMPFreeNdisPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) /* IRQL = DISPATCH_LEVEL */ /* NOTE: we do have an assumption here, that Byte0 and Byte1 always reasid at the same */ /* scatter gather buffer */ -int Sniff2BytesFromNdisBuffer(IN PNDIS_BUFFER pFirstBuffer, +int Sniff2BytesFromNdisBuffer(char *pFirstBuffer, u8 DesiredOffset, u8 *pByte0, u8 *pByte1) { @@ -385,12 +385,12 @@ int Sniff2BytesFromNdisBuffer(IN PNDIS_BUFFER pFirstBuffer, return NDIS_STATUS_SUCCESS; } -void RTMP_QueryPacketInfo(IN PNDIS_PACKET pPacket, +void RTMP_QueryPacketInfo(void *pPacket, OUT PACKET_INFO * pPacketInfo, u8 ** pSrcBufVA, u32 * pSrcBufLen) { pPacketInfo->BufferCount = 1; - pPacketInfo->pFirstBuffer = (PNDIS_BUFFER) GET_OS_PKT_DATAPTR(pPacket); + pPacketInfo->pFirstBuffer = (char *)GET_OS_PKT_DATAPTR(pPacket); pPacketInfo->PhysicalBufferCount = 1; pPacketInfo->TotalPacketLength = GET_OS_PKT_LEN(pPacket); @@ -398,11 +398,11 @@ void RTMP_QueryPacketInfo(IN PNDIS_PACKET pPacket, *pSrcBufLen = GET_OS_PKT_LEN(pPacket); } -void RTMP_QueryNextPacketInfo(IN PNDIS_PACKET * ppPacket, +void RTMP_QueryNextPacketInfo(void ** ppPacket, OUT PACKET_INFO * pPacketInfo, u8 ** pSrcBufVA, u32 * pSrcBufLen) { - PNDIS_PACKET pPacket = NULL; + void *pPacket = NULL; if (*ppPacket) pPacket = GET_OS_PKT_NEXT(*ppPacket); @@ -410,7 +410,7 @@ void RTMP_QueryNextPacketInfo(IN PNDIS_PACKET * ppPacket, if (pPacket) { pPacketInfo->BufferCount = 1; pPacketInfo->pFirstBuffer = - (PNDIS_BUFFER) GET_OS_PKT_DATAPTR(pPacket); + (char *)GET_OS_PKT_DATAPTR(pPacket); pPacketInfo->PhysicalBufferCount = 1; pPacketInfo->TotalPacketLength = GET_OS_PKT_LEN(pPacket); @@ -429,11 +429,11 @@ void RTMP_QueryNextPacketInfo(IN PNDIS_PACKET * ppPacket, } } -PNDIS_PACKET DuplicatePacket(IN PRTMP_ADAPTER pAd, - IN PNDIS_PACKET pPacket, u8 FromWhichBSSID) +void *DuplicatePacket(IN PRTMP_ADAPTER pAd, + void *pPacket, u8 FromWhichBSSID) { struct sk_buff *skb; - PNDIS_PACKET pRetPacket = NULL; + void *pRetPacket = NULL; u16 DataSize; u8 *pData; @@ -450,14 +450,14 @@ PNDIS_PACKET DuplicatePacket(IN PRTMP_ADAPTER pAd, } -PNDIS_PACKET duplicate_pkt(IN PRTMP_ADAPTER pAd, +void *duplicate_pkt(IN PRTMP_ADAPTER pAd, u8 *pHeader802_3, u32 HdrLen, u8 *pData, unsigned long DataSize, u8 FromWhichBSSID) { struct sk_buff *skb; - PNDIS_PACKET pPacket = NULL; + void *pPacket = NULL; if ((skb = __dev_alloc_skb(HdrLen + DataSize + 2, MEM_ALLOC_FLAG)) != NULL) { @@ -474,8 +474,8 @@ PNDIS_PACKET duplicate_pkt(IN PRTMP_ADAPTER pAd, } #define TKIP_TX_MIC_SIZE 8 -PNDIS_PACKET duplicate_pkt_with_TKIP_MIC(IN PRTMP_ADAPTER pAd, - IN PNDIS_PACKET pPacket) +void *duplicate_pkt_with_TKIP_MIC(IN PRTMP_ADAPTER pAd, + void *pPacket) { struct sk_buff *skb, *newskb; @@ -497,8 +497,8 @@ PNDIS_PACKET duplicate_pkt_with_TKIP_MIC(IN PRTMP_ADAPTER pAd, return OSPKT_TO_RTPKT(skb); } -PNDIS_PACKET ClonePacket(IN PRTMP_ADAPTER pAd, - IN PNDIS_PACKET pPacket, +void *ClonePacket(IN PRTMP_ADAPTER pAd, + void *pPacket, u8 *pData, unsigned long DataSize) { struct sk_buff *pRxPkt; @@ -564,7 +564,7 @@ void wlan_802_11_to_802_3_packet(IN PRTMP_ADAPTER pAd, LENGTH_802_3); } -void announce_802_3_packet(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) +void announce_802_3_packet(IN PRTMP_ADAPTER pAd, void *pPacket) { struct sk_buff *pRxPkt; @@ -580,7 +580,7 @@ void announce_802_3_packet(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) } PRTMP_SCATTER_GATHER_LIST -rt_get_sg_list_from_packet(PNDIS_PACKET pPacket, RTMP_SCATTER_GATHER_LIST * sg) +rt_get_sg_list_from_packet(void *pPacket, RTMP_SCATTER_GATHER_LIST * sg) { sg->NumberOfElements = 1; sg->Elements[0].Address = GET_OS_PKT_DATAPTR(pPacket); @@ -905,7 +905,7 @@ err_free_sk_buff: Device IRQ related functions. *******************************************************************************/ -int RtmpOSIRQRequest(IN PNET_DEV pNetDev) +int RtmpOSIRQRequest(struct net_device *pNetDev) { #ifdef RTMP_PCI_SUPPORT struct net_device *net_dev = pNetDev; @@ -917,7 +917,7 @@ int RtmpOSIRQRequest(IN PNET_DEV pNetDev) ASSERT(pAd); if (pAd->infType == RTMP_DEV_INF_PCI) { - POS_COOKIE _pObj = (POS_COOKIE) (pAd->OS_Cookie); + struct os_cookie *_pObj = (struct os_cookie *)(pAd->OS_Cookie); RTMP_MSI_ENABLE(pAd); retval = request_irq(_pObj->pci_dev->irq, rt2860_interrupt, SA_SHIRQ, @@ -932,7 +932,7 @@ int RtmpOSIRQRequest(IN PNET_DEV pNetDev) #endif } -int RtmpOSIRQRelease(IN PNET_DEV pNetDev) +int RtmpOSIRQRelease(struct net_device *pNetDev) { struct net_device *net_dev = pNetDev; PRTMP_ADAPTER pAd = NULL; @@ -943,7 +943,7 @@ int RtmpOSIRQRelease(IN PNET_DEV pNetDev) #ifdef RTMP_PCI_SUPPORT if (pAd->infType == RTMP_DEV_INF_PCI) { - POS_COOKIE pObj = (POS_COOKIE) (pAd->OS_Cookie); + struct os_cookie *pObj = (struct os_cookie *)(pAd->OS_Cookie); synchronize_irq(pObj->pci_dev->irq); free_irq(pObj->pci_dev->irq, (net_dev)); RTMP_MSI_DISABLE(pAd); @@ -958,7 +958,7 @@ int RtmpOSIRQRelease(IN PNET_DEV pNetDev) File open/close related functions. *******************************************************************************/ -RTMP_OS_FD RtmpOSFileOpen(char *pPath, int flag, int mode) +struct file *RtmpOSFileOpen(char *pPath, int flag, int mode) { struct file *filePtr; @@ -969,21 +969,21 @@ RTMP_OS_FD RtmpOSFileOpen(char *pPath, int flag, int mode) -PTR_ERR(filePtr), pPath)); } - return (RTMP_OS_FD) filePtr; + return (struct file *)filePtr; } -int RtmpOSFileClose(RTMP_OS_FD osfd) +int RtmpOSFileClose(struct file *osfd) { filp_close(osfd, NULL); return 0; } -void RtmpOSFileSeek(RTMP_OS_FD osfd, int offset) +void RtmpOSFileSeek(struct file *osfd, int offset) { osfd->f_pos = offset; } -int RtmpOSFileRead(RTMP_OS_FD osfd, char *pDataPtr, int readLen) +int RtmpOSFileRead(struct file *osfd, char *pDataPtr, int readLen) { /* The object must have a read method */ if (osfd->f_op && osfd->f_op->read) { @@ -994,7 +994,7 @@ int RtmpOSFileRead(RTMP_OS_FD osfd, char *pDataPtr, int readLen) } } -int RtmpOSFileWrite(RTMP_OS_FD osfd, char *pDataPtr, int writeLen) +int RtmpOSFileWrite(struct file *osfd, char *pDataPtr, int writeLen) { return osfd->f_op->write(osfd, pDataPtr, (size_t) writeLen, &osfd->f_pos); @@ -1164,7 +1164,7 @@ int RtmpOSWrielessEventSend(IN RTMP_ADAPTER * pAd, return 0; } -int RtmpOSNetDevAddrSet(IN PNET_DEV pNetDev, u8 *pMacAddr) +int RtmpOSNetDevAddrSet(struct net_device *pNetDev, u8 *pMacAddr) { struct net_device *net_dev; RTMP_ADAPTER *pAd; @@ -1188,10 +1188,10 @@ int RtmpOSNetDevAddrSet(IN PNET_DEV pNetDev, u8 *pMacAddr) * Assign the network dev name for created Ralink WiFi interface. */ static int RtmpOSNetDevRequestName(IN RTMP_ADAPTER * pAd, - IN PNET_DEV dev, + struct net_device *dev, char *pPrefixStr, int devIdx) { - PNET_DEV existNetDev; + struct net_device *existNetDev; char suffixName[IFNAMSIZ]; char desiredName[IFNAMSIZ]; int ifNameIdx, prefixLen, slotNameLen; @@ -1231,19 +1231,19 @@ static int RtmpOSNetDevRequestName(IN RTMP_ADAPTER * pAd, return Status; } -void RtmpOSNetDevClose(IN PNET_DEV pNetDev) +void RtmpOSNetDevClose(struct net_device *pNetDev) { dev_close(pNetDev); } -void RtmpOSNetDevFree(PNET_DEV pNetDev) +void RtmpOSNetDevFree(struct net_device *pNetDev) { ASSERT(pNetDev); free_netdev(pNetDev); } -int RtmpOSNetDevAlloc(IN PNET_DEV * new_dev_p, u32 privDataSize) +int RtmpOSNetDevAlloc(struct net_device ** new_dev_p, u32 privDataSize) { /* assign it as null first. */ *new_dev_p = NULL; @@ -1258,16 +1258,16 @@ int RtmpOSNetDevAlloc(IN PNET_DEV * new_dev_p, u32 privDataSize) return NDIS_STATUS_FAILURE; } -PNET_DEV RtmpOSNetDevGetByName(PNET_DEV pNetDev, char *pDevName) +struct net_device *RtmpOSNetDevGetByName(struct net_device *pNetDev, char *pDevName) { - PNET_DEV pTargetNetDev = NULL; + struct net_device *pTargetNetDev = NULL; pTargetNetDev = dev_get_by_name(dev_net(pNetDev), pDevName); return pTargetNetDev; } -void RtmpOSNetDeviceRefPut(PNET_DEV pNetDev) +void RtmpOSNetDeviceRefPut(struct net_device *pNetDev) { /* every time dev_get_by_name is called, and it has returned a valid struct @@ -1278,7 +1278,7 @@ void RtmpOSNetDeviceRefPut(PNET_DEV pNetDev) dev_put(pNetDev); } -int RtmpOSNetDevDestory(IN RTMP_ADAPTER * pAd, IN PNET_DEV pNetDev) +int RtmpOSNetDevDestory(IN RTMP_ADAPTER * pAd, struct net_device *pNetDev) { /* TODO: Need to fix this */ @@ -1286,12 +1286,12 @@ int RtmpOSNetDevDestory(IN RTMP_ADAPTER * pAd, IN PNET_DEV pNetDev) return 0; } -void RtmpOSNetDevDetach(PNET_DEV pNetDev) +void RtmpOSNetDevDetach(struct net_device *pNetDev) { unregister_netdev(pNetDev); } -int RtmpOSNetDevAttach(IN PNET_DEV pNetDev, +int RtmpOSNetDevAttach(struct net_device *pNetDev, IN RTMP_OS_NETDEV_OP_HOOK * pDevOpHook) { int ret, rtnl_locked = FALSE; @@ -1331,7 +1331,7 @@ int RtmpOSNetDevAttach(IN PNET_DEV pNetDev, return NDIS_STATUS_FAILURE; } -PNET_DEV RtmpOSNetDevCreate(IN RTMP_ADAPTER * pAd, +struct net_device *RtmpOSNetDevCreate(IN RTMP_ADAPTER * pAd, int devType, int devNum, int privMemSize, char *pNamePrefix) diff --git a/drivers/staging/rt2860/rt_linux.h b/drivers/staging/rt2860/rt_linux.h index 629310a2af9..d63ac7d3936 100644 --- a/drivers/staging/rt2860/rt_linux.h +++ b/drivers/staging/rt2860/rt_linux.h @@ -103,18 +103,6 @@ extern const struct iw_handler_def rt28xx_iw_handler_def; /*********************************************************************************** * OS Specific definitions and data structures ***********************************************************************************/ -typedef struct pci_dev *PPCI_DEV; -typedef struct net_device *PNET_DEV; -typedef void *PNDIS_PACKET; -typedef char NDIS_PACKET; -typedef PNDIS_PACKET *PPNDIS_PACKET; -typedef dma_addr_t NDIS_PHYSICAL_ADDRESS; -typedef dma_addr_t *PNDIS_PHYSICAL_ADDRESS; -typedef void *NDIS_HANDLE; -typedef char *PNDIS_BUFFER; -typedef struct pid *RTMP_OS_PID; -typedef struct semaphore RTMP_OS_SEM; - typedef int (*HARD_START_XMIT_FUNC) (struct sk_buff * skb, struct net_device * net_dev); @@ -196,8 +184,6 @@ struct iw_statistics *rt28xx_get_wireless_stats(IN struct net_device *net_dev); /*********************************************************************************** * OS file operation related data structure definitions ***********************************************************************************/ -typedef struct file *RTMP_OS_FD; - typedef struct _RTMP_OS_FS_INFO_ { int fsuid; int fsgid; @@ -214,8 +200,6 @@ struct os_lock { unsigned long flags; }; -typedef spinlock_t NDIS_SPIN_LOCK; - /* */ /* spin_lock enhanced for Nested spin lock */ /* */ @@ -349,23 +333,17 @@ do { \ ***********************************************************************************/ #define RTMP_OS_MGMT_TASK_FLAGS CLONE_VM -typedef struct pid *THREAD_PID; #define THREAD_PID_INIT_VALUE NULL #define GET_PID(_v) find_get_pid((_v)) #define GET_PID_NUMBER(_v) pid_nr((_v)) #define CHECK_PID_LEGALITY(_pid) if (pid_nr((_pid)) > 0) #define KILL_THREAD_PID(_A, _B, _C) kill_pid((_A), (_B), (_C)) -typedef struct tasklet_struct RTMP_NET_TASK_STRUCT; -typedef struct tasklet_struct *PRTMP_NET_TASK_STRUCT; - /*********************************************************************************** * Timer related definitions and data structures. **********************************************************************************/ #define OS_HZ HZ -typedef struct timer_list NDIS_MINIPORT_TIMER; -typedef struct timer_list RTMP_OS_TIMER; typedef void (*TIMER_FUNCTION) (unsigned long); #define OS_WAIT(_time) \ @@ -409,20 +387,20 @@ struct os_cookie { struct usb_device *pUsb_Dev; #endif /* RTMP_MAC_USB // */ - RTMP_NET_TASK_STRUCT rx_done_task; - RTMP_NET_TASK_STRUCT mgmt_dma_done_task; - RTMP_NET_TASK_STRUCT ac0_dma_done_task; - RTMP_NET_TASK_STRUCT ac1_dma_done_task; - RTMP_NET_TASK_STRUCT ac2_dma_done_task; - RTMP_NET_TASK_STRUCT ac3_dma_done_task; - RTMP_NET_TASK_STRUCT tbtt_task; + struct tasklet_struct rx_done_task; + struct tasklet_struct mgmt_dma_done_task; + struct tasklet_struct ac0_dma_done_task; + struct tasklet_struct ac1_dma_done_task; + struct tasklet_struct ac2_dma_done_task; + struct tasklet_struct ac3_dma_done_task; + struct tasklet_struct tbtt_task; #ifdef RTMP_MAC_PCI - RTMP_NET_TASK_STRUCT fifo_statistic_full_task; + struct tasklet_struct fifo_statistic_full_task; #endif /* RTMP_MAC_PCI // */ #ifdef RTMP_MAC_USB - RTMP_NET_TASK_STRUCT null_frame_complete_task; - RTMP_NET_TASK_STRUCT rts_frame_complete_task; - RTMP_NET_TASK_STRUCT pspoll_frame_complete_task; + struct tasklet_struct null_frame_complete_task; + struct tasklet_struct rts_frame_complete_task; + struct tasklet_struct pspoll_frame_complete_task; #endif /* RTMP_MAC_USB // */ unsigned long apd_pid; /*802.1x daemon pid */ @@ -430,8 +408,6 @@ struct os_cookie { int ioctl_if; }; -typedef struct os_cookie *POS_COOKIE; - /*********************************************************************************** * OS debugging and printing related definitions and data structure ***********************************************************************************/ @@ -510,21 +486,21 @@ void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size, /* * unsigned long * RTMP_GetPhysicalAddressLow( - * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress); + * dma_addr_t PhysicalAddress); */ #define RTMP_GetPhysicalAddressLow(PhysicalAddress) (PhysicalAddress) /* * unsigned long * RTMP_GetPhysicalAddressHigh( - * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress); + * dma_addr_t PhysicalAddress); */ #define RTMP_GetPhysicalAddressHigh(PhysicalAddress) (0) /* * void * RTMP_SetPhysicalAddressLow( - * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress, + * dma_addr_t PhysicalAddress, * unsigned long Value); */ #define RTMP_SetPhysicalAddressLow(PhysicalAddress, Value) \ @@ -533,7 +509,7 @@ void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size, /* * void * RTMP_SetPhysicalAddressHigh( - * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress, + * dma_addr_t PhysicalAddress, * unsigned long Value); */ #define RTMP_SetPhysicalAddressHigh(PhysicalAddress, Value) @@ -652,7 +628,7 @@ void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size, #define RTMP_OS_NETDEV_CARRIER_OFF(_pNetDev) netif_carrier_off((_pNetDev)) #define QUEUE_ENTRY_TO_PACKET(pEntry) \ - (PNDIS_PACKET)(pEntry) + (void *)(pEntry) #define PACKET_TO_QUEUE_ENTRY(pPacket) \ (PQUEUE_ENTRY)(pPacket) @@ -671,7 +647,7 @@ void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size, * os packet to rt packet */ #define RTPKT_TO_OSPKT(_p) ((struct sk_buff *)(_p)) -#define OSPKT_TO_RTPKT(_p) ((PNDIS_PACKET)(_p)) +#define OSPKT_TO_RTPKT(_p) ((void *)(_p)) #define GET_OS_PKT_DATAPTR(_pkt) \ (RTPKT_TO_OSPKT(_pkt)->data) @@ -861,7 +837,7 @@ int rt28xx_packet_xmit(struct sk_buff *skb); IRQ_HANDLE_TYPE rt2860_interrupt(int irq, void *dev_instance); #endif /* RTMP_MAC_PCI // */ -int rt28xx_sta_ioctl(IN PNET_DEV net_dev, IN OUT struct ifreq *rq, int cmd); +int rt28xx_sta_ioctl(struct net_device *net_dev, IN OUT struct ifreq *rq, int cmd); extern int ra_mtd_write(int num, loff_t to, size_t len, const u_char * buf); extern int ra_mtd_read(int num, loff_t from, size_t len, u_char * buf); diff --git a/drivers/staging/rt2860/rt_main_dev.c b/drivers/staging/rt2860/rt_main_dev.c index 21313ee596c..347279912e4 100644 --- a/drivers/staging/rt2860/rt_main_dev.c +++ b/drivers/staging/rt2860/rt_main_dev.c @@ -208,7 +208,7 @@ Note: (3) BA Reordering: ba_reordering_resource_release() ======================================================================== */ -int rt28xx_close(IN PNET_DEV dev) +int rt28xx_close(struct net_device *dev) { struct net_device *net_dev = (struct net_device *)dev; RTMP_ADAPTER *pAd = NULL; @@ -378,12 +378,12 @@ Return Value: Note: ======================================================================== */ -int rt28xx_open(IN PNET_DEV dev) +int rt28xx_open(struct net_device *dev) { struct net_device *net_dev = (struct net_device *)dev; PRTMP_ADAPTER pAd = NULL; int retval = 0; - /*POS_COOKIE pObj; */ + /*struct os_cookie *pObj; */ GET_PAD_FROM_NET_DEV(pAd, net_dev); @@ -459,7 +459,7 @@ static const struct net_device_ops rt2860_netdev_ops = { .ndo_start_xmit = rt28xx_send_packets, }; -PNET_DEV RtmpPhyNetDevInit(IN RTMP_ADAPTER * pAd, +struct net_device *RtmpPhyNetDevInit(IN RTMP_ADAPTER * pAd, IN RTMP_OS_NETDEV_OP_HOOK * pNetDevHook) { struct net_device *net_dev = NULL; @@ -511,7 +511,7 @@ int rt28xx_packet_xmit(struct sk_buff *skb) struct net_device *net_dev = skb->dev; PRTMP_ADAPTER pAd = NULL; int status = NETDEV_TX_OK; - PNDIS_PACKET pPacket = (PNDIS_PACKET) skb; + void *pPacket = (void *)skb; GET_PAD_FROM_NET_DEV(pAd, net_dev); @@ -534,7 +534,7 @@ int rt28xx_packet_xmit(struct sk_buff *skb) } RTMP_SET_PACKET_5VT(pPacket, 0); - STASendPackets((NDIS_HANDLE) pAd, (PPNDIS_PACKET) & pPacket, 1); + STASendPackets((void *)pAd, (void **)& pPacket, 1); status = NETDEV_TX_OK; done: @@ -566,7 +566,7 @@ static int rt28xx_send_packets(IN struct sk_buff *skb_p, GET_PAD_FROM_NET_DEV(pAd, net_dev); if (!(net_dev->flags & IFF_UP)) { - RELEASE_NDIS_PACKET(pAd, (PNDIS_PACKET) skb_p, + RELEASE_NDIS_PACKET(pAd, (void *)skb_p, NDIS_STATUS_FAILURE); return NETDEV_TX_OK; } @@ -690,7 +690,7 @@ static struct net_device_stats *RT28xx_get_ether_stats(IN struct net_device return NULL; } -BOOLEAN RtmpPhyNetDevExit(IN RTMP_ADAPTER * pAd, IN PNET_DEV net_dev) +BOOLEAN RtmpPhyNetDevExit(IN RTMP_ADAPTER * pAd, struct net_device *net_dev) { /* Unregister network device */ diff --git a/drivers/staging/rt2860/rt_pci_rbus.c b/drivers/staging/rt2860/rt_pci_rbus.c index 8df44ba436f..7494df4a7d6 100644 --- a/drivers/staging/rt2860/rt_pci_rbus.c +++ b/drivers/staging/rt2860/rt_pci_rbus.c @@ -82,9 +82,9 @@ void RTMP_AllocateTxDescMemory(IN PRTMP_ADAPTER pAd, unsigned long Length, IN BOOLEAN Cached, void ** VirtualAddress, - OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress) + dma_addr_t *PhysicalAddress) { - POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; + struct os_cookie *pObj = (struct os_cookie *)pAd->OS_Cookie; *VirtualAddress = (void *)pci_alloc_consistent(pObj->pci_dev, sizeof(char) * Length, @@ -97,9 +97,9 @@ void RTMP_AllocateMgmtDescMemory(IN PRTMP_ADAPTER pAd, unsigned long Length, IN BOOLEAN Cached, void ** VirtualAddress, - OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress) + dma_addr_t *PhysicalAddress) { - POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; + struct os_cookie *pObj = (struct os_cookie *)pAd->OS_Cookie; *VirtualAddress = (void *)pci_alloc_consistent(pObj->pci_dev, sizeof(char) * Length, @@ -112,9 +112,9 @@ void RTMP_AllocateRxDescMemory(IN PRTMP_ADAPTER pAd, unsigned long Length, IN BOOLEAN Cached, void ** VirtualAddress, - OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress) + dma_addr_t *PhysicalAddress) { - POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; + struct os_cookie *pObj = (struct os_cookie *)pAd->OS_Cookie; *VirtualAddress = (void *)pci_alloc_consistent(pObj->pci_dev, sizeof(char) * Length, @@ -126,9 +126,9 @@ void RTMP_AllocateRxDescMemory(IN PRTMP_ADAPTER pAd, void RTMP_FreeDescMemory(IN PRTMP_ADAPTER pAd, unsigned long Length, void *VirtualAddress, - IN NDIS_PHYSICAL_ADDRESS PhysicalAddress) + dma_addr_t PhysicalAddress) { - POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; + struct os_cookie *pObj = (struct os_cookie *)pAd->OS_Cookie; pci_free_consistent(pObj->pci_dev, Length, VirtualAddress, PhysicalAddress); @@ -140,9 +140,9 @@ void RTMP_AllocateFirstTxBuffer(IN PRTMP_ADAPTER pAd, unsigned long Length, IN BOOLEAN Cached, void ** VirtualAddress, - OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress) + dma_addr_t *PhysicalAddress) { - POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; + struct os_cookie *pObj = (struct os_cookie *)pAd->OS_Cookie; *VirtualAddress = (void *)pci_alloc_consistent(pObj->pci_dev, sizeof(char) * Length, @@ -153,9 +153,9 @@ void RTMP_FreeFirstTxBuffer(IN PRTMP_ADAPTER pAd, unsigned long Length, IN BOOLEAN Cached, void *VirtualAddress, - IN NDIS_PHYSICAL_ADDRESS PhysicalAddress) + dma_addr_t PhysicalAddress) { - POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; + struct os_cookie *pObj = (struct os_cookie *)pAd->OS_Cookie; pci_free_consistent(pObj->pci_dev, Length, VirtualAddress, PhysicalAddress); @@ -174,9 +174,9 @@ void RTMP_AllocateSharedMemory(IN PRTMP_ADAPTER pAd, unsigned long Length, IN BOOLEAN Cached, void ** VirtualAddress, - OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress) + dma_addr_t *PhysicalAddress) { - POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; + struct os_cookie *pObj = (struct os_cookie *)pAd->OS_Cookie; *VirtualAddress = (void *)pci_alloc_consistent(pObj->pci_dev, sizeof(char) * Length, @@ -194,11 +194,11 @@ void RTMP_AllocateSharedMemory(IN PRTMP_ADAPTER pAd, * Notes: * Cached is ignored: always cached memory */ -PNDIS_PACKET RTMP_AllocateRxPacketBuffer(IN PRTMP_ADAPTER pAd, +void *RTMP_AllocateRxPacketBuffer(IN PRTMP_ADAPTER pAd, unsigned long Length, IN BOOLEAN Cached, void ** VirtualAddress, - OUT PNDIS_PHYSICAL_ADDRESS + OUT dma_addr_t * PhysicalAddress) { struct sk_buff *pkt; @@ -218,15 +218,15 @@ PNDIS_PACKET RTMP_AllocateRxPacketBuffer(IN PRTMP_ADAPTER pAd, PCI_DMA_FROMDEVICE); } else { *VirtualAddress = (void *)NULL; - *PhysicalAddress = (NDIS_PHYSICAL_ADDRESS) NULL; + *PhysicalAddress = (dma_addr_t)NULL; } - return (PNDIS_PACKET) pkt; + return (void *)pkt; } void Invalid_Remaining_Packet(IN PRTMP_ADAPTER pAd, unsigned long VirtualAddress) { - NDIS_PHYSICAL_ADDRESS PhysicalAddress; + dma_addr_t PhysicalAddress; PhysicalAddress = PCI_MAP_SINGLE(pAd, (void *)(VirtualAddress + 1600), @@ -235,9 +235,9 @@ void Invalid_Remaining_Packet(IN PRTMP_ADAPTER pAd, unsigned long VirtualAddress int RtmpNetTaskInit(IN RTMP_ADAPTER * pAd) { - POS_COOKIE pObj; + struct os_cookie *pObj; - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; tasklet_init(&pObj->rx_done_task, rx_done_tasklet, (unsigned long)pAd); tasklet_init(&pObj->mgmt_dma_done_task, mgmt_dma_done_tasklet, @@ -259,9 +259,9 @@ int RtmpNetTaskInit(IN RTMP_ADAPTER * pAd) void RtmpNetTaskExit(IN RTMP_ADAPTER * pAd) { - POS_COOKIE pObj; + struct os_cookie *pObj; - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; tasklet_kill(&pObj->rx_done_task); tasklet_kill(&pObj->mgmt_dma_done_task); @@ -339,7 +339,7 @@ static void mgmt_dma_done_tasklet(unsigned long data) unsigned long flags; PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) data; INT_SOURCE_CSR_STRUC IntSource; - POS_COOKIE pObj; + struct os_cookie *pObj; /* Do nothing if the driver is starting halt state. */ /* This might happen when timer already been fired before cancel timer with mlmehalt */ @@ -347,7 +347,7 @@ static void mgmt_dma_done_tasklet(unsigned long data) (pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST)) return; - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; /* printk("mgmt_dma_done_process\n"); */ IntSource.word = 0; @@ -378,7 +378,7 @@ static void rx_done_tasklet(unsigned long data) unsigned long flags; PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) data; BOOLEAN bReschedule = 0; - POS_COOKIE pObj; + struct os_cookie *pObj; /* Do nothing if the driver is starting halt state. */ /* This might happen when timer already been fired before cancel timer with mlmehalt */ @@ -386,7 +386,7 @@ static void rx_done_tasklet(unsigned long data) (pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST)) return; - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; pAd->int_pending &= ~(INT_RX); bReschedule = STARxDoneInterruptHandle(pAd, 0); @@ -411,7 +411,7 @@ void fifo_statistic_full_tasklet(unsigned long data) { unsigned long flags; PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) data; - POS_COOKIE pObj; + struct os_cookie *pObj; /* Do nothing if the driver is starting halt state. */ /* This might happen when timer already been fired before cancel timer with mlmehalt */ @@ -419,7 +419,7 @@ void fifo_statistic_full_tasklet(unsigned long data) (pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST)) return; - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; pAd->int_pending &= ~(FifoStaFullInt); NICUpdateFifoStaCounters(pAd); @@ -446,7 +446,7 @@ static void ac3_dma_done_tasklet(unsigned long data) unsigned long flags; PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) data; INT_SOURCE_CSR_STRUC IntSource; - POS_COOKIE pObj; + struct os_cookie *pObj; BOOLEAN bReschedule = 0; /* Do nothing if the driver is starting halt state. */ @@ -455,7 +455,7 @@ static void ac3_dma_done_tasklet(unsigned long data) (pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST)) return; - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; /* printk("ac0_dma_done_process\n"); */ IntSource.word = 0; @@ -484,7 +484,7 @@ static void ac2_dma_done_tasklet(unsigned long data) unsigned long flags; PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) data; INT_SOURCE_CSR_STRUC IntSource; - POS_COOKIE pObj; + struct os_cookie *pObj; BOOLEAN bReschedule = 0; /* Do nothing if the driver is starting halt state. */ @@ -493,7 +493,7 @@ static void ac2_dma_done_tasklet(unsigned long data) (pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST)) return; - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; IntSource.word = 0; IntSource.field.Ac2DmaDone = 1; @@ -522,7 +522,7 @@ static void ac1_dma_done_tasklet(unsigned long data) unsigned long flags; PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) data; INT_SOURCE_CSR_STRUC IntSource; - POS_COOKIE pObj; + struct os_cookie *pObj; BOOLEAN bReschedule = 0; /* Do nothing if the driver is starting halt state. */ @@ -531,7 +531,7 @@ static void ac1_dma_done_tasklet(unsigned long data) (pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST)) return; - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; /* printk("ac0_dma_done_process\n"); */ IntSource.word = 0; @@ -560,7 +560,7 @@ static void ac0_dma_done_tasklet(unsigned long data) unsigned long flags; PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) data; INT_SOURCE_CSR_STRUC IntSource; - POS_COOKIE pObj; + struct os_cookie *pObj; BOOLEAN bReschedule = 0; /* Do nothing if the driver is starting halt state. */ @@ -569,7 +569,7 @@ static void ac0_dma_done_tasklet(unsigned long data) (pAd, fRTMP_ADAPTER_HALT_IN_PROGRESS | fRTMP_ADAPTER_NIC_NOT_EXIST)) return; - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; /* printk("ac0_dma_done_process\n"); */ IntSource.word = 0; @@ -606,11 +606,11 @@ IRQ_HANDLE_TYPE rt2860_interrupt(int irq, void *dev_instance) struct net_device *net_dev = (struct net_device *)dev_instance; PRTMP_ADAPTER pAd = NULL; INT_SOURCE_CSR_STRUC IntSource; - POS_COOKIE pObj; + struct os_cookie *pObj; GET_PAD_FROM_NET_DEV(pAd, net_dev); - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; /* Note 03312008: we can not return here before RTMP_IO_READ32(pAd, INT_SOURCE_CSR, &IntSource.word); @@ -794,7 +794,7 @@ dma_addr_t linux_pci_map_single(void *handle, void *ptr, size_t size, int sd_idx, int direction) { PRTMP_ADAPTER pAd; - POS_COOKIE pObj; + struct os_cookie *pObj; /* ------ Porting Information ------ @@ -813,7 +813,7 @@ dma_addr_t linux_pci_map_single(void *handle, void *ptr, size_t size, */ pAd = (PRTMP_ADAPTER) handle; - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; if (sd_idx == 1) { PTX_BLK pTxBlk; @@ -830,10 +830,10 @@ void linux_pci_unmap_single(void *handle, dma_addr_t dma_addr, size_t size, int direction) { PRTMP_ADAPTER pAd; - POS_COOKIE pObj; + struct os_cookie *pObj; pAd = (PRTMP_ADAPTER) handle; - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; pci_unmap_single(pObj->pci_dev, dma_addr, size, direction); diff --git a/drivers/staging/rt2860/rt_usb.c b/drivers/staging/rt2860/rt_usb.c index 2db7d6e1486..68f6f48f725 100644 --- a/drivers/staging/rt2860/rt_usb.c +++ b/drivers/staging/rt2860/rt_usb.c @@ -198,17 +198,17 @@ void RtmpMgmtTaskExit(IN RTMP_ADAPTER * pAd) static void rtusb_dataout_complete(unsigned long data) { PRTMP_ADAPTER pAd; - purbb_t pUrb; - POS_COOKIE pObj; + struct urb *pUrb; + struct os_cookie *pObj; PHT_TX_CONTEXT pHTTXContext; u8 BulkOutPipeId; int Status; unsigned long IrqFlags; - pUrb = (purbb_t) data; + pUrb = (struct urb *)data; pHTTXContext = (PHT_TX_CONTEXT) pUrb->context; pAd = pHTTXContext->pAd; - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; Status = pUrb->status; /* Store BulkOut PipeId */ @@ -296,11 +296,11 @@ static void rtusb_null_frame_done_tasklet(unsigned long data) { PRTMP_ADAPTER pAd; PTX_CONTEXT pNullContext; - purbb_t pUrb; + struct urb *pUrb; int Status; unsigned long irqFlag; - pUrb = (purbb_t) data; + pUrb = (struct urb *)data; pNullContext = (PTX_CONTEXT) pUrb->context; pAd = pNullContext->pAd; Status = pUrb->status; @@ -345,11 +345,11 @@ static void rtusb_rts_frame_done_tasklet(unsigned long data) { PRTMP_ADAPTER pAd; PTX_CONTEXT pRTSContext; - purbb_t pUrb; + struct urb *pUrb; int Status; unsigned long irqFlag; - pUrb = (purbb_t) data; + pUrb = (struct urb *)data; pRTSContext = (PTX_CONTEXT) pUrb->context; pAd = pRTSContext->pAd; Status = pUrb->status; @@ -395,10 +395,10 @@ static void rtusb_pspoll_frame_done_tasklet(unsigned long data) { PRTMP_ADAPTER pAd; PTX_CONTEXT pPsPollContext; - purbb_t pUrb; + struct urb *pUrb; int Status; - pUrb = (purbb_t) data; + pUrb = (struct urb *)data; pPsPollContext = (PTX_CONTEXT) pUrb->context; pAd = pPsPollContext->pAd; Status = pUrb->status; @@ -452,13 +452,13 @@ Note: */ static void rx_done_tasklet(unsigned long data) { - purbb_t pUrb; + struct urb *pUrb; PRX_CONTEXT pRxContext; PRTMP_ADAPTER pAd; int Status; unsigned int IrqFlags; - pUrb = (purbb_t) data; + pUrb = (struct urb *)data; pRxContext = (PRX_CONTEXT) pUrb->context; pAd = pRxContext->pAd; Status = pUrb->status; @@ -517,12 +517,12 @@ static void rtusb_mgmt_dma_done_tasklet(unsigned long data) PRTMP_ADAPTER pAd; PTX_CONTEXT pMLMEContext; int index; - PNDIS_PACKET pPacket; - purbb_t pUrb; + void *pPacket; + struct urb *pUrb; int Status; unsigned long IrqFlags; - pUrb = (purbb_t) data; + pUrb = (struct urb *)data; pMLMEContext = (PTX_CONTEXT) pUrb->context; pAd = pMLMEContext->pAd; Status = pUrb->status; @@ -598,9 +598,9 @@ static void rtusb_ac3_dma_done_tasklet(unsigned long data) PRTMP_ADAPTER pAd; PHT_TX_CONTEXT pHTTXContext; u8 BulkOutPipeId = 3; - purbb_t pUrb; + struct urb *pUrb; - pUrb = (purbb_t) data; + pUrb = (struct urb *)data; pHTTXContext = (PHT_TX_CONTEXT) pUrb->context; pAd = pHTTXContext->pAd; @@ -638,9 +638,9 @@ static void rtusb_ac2_dma_done_tasklet(unsigned long data) PRTMP_ADAPTER pAd; PHT_TX_CONTEXT pHTTXContext; u8 BulkOutPipeId = 2; - purbb_t pUrb; + struct urb *pUrb; - pUrb = (purbb_t) data; + pUrb = (struct urb *)data; pHTTXContext = (PHT_TX_CONTEXT) pUrb->context; pAd = pHTTXContext->pAd; @@ -678,9 +678,9 @@ static void rtusb_ac1_dma_done_tasklet(unsigned long data) PRTMP_ADAPTER pAd; PHT_TX_CONTEXT pHTTXContext; u8 BulkOutPipeId = 1; - purbb_t pUrb; + struct urb *pUrb; - pUrb = (purbb_t) data; + pUrb = (struct urb *)data; pHTTXContext = (PHT_TX_CONTEXT) pUrb->context; pAd = pHTTXContext->pAd; @@ -718,9 +718,9 @@ static void rtusb_ac0_dma_done_tasklet(unsigned long data) PRTMP_ADAPTER pAd; PHT_TX_CONTEXT pHTTXContext; u8 BulkOutPipeId = 0; - purbb_t pUrb; + struct urb *pUrb; - pUrb = (purbb_t) data; + pUrb = (struct urb *)data; pHTTXContext = (PHT_TX_CONTEXT) pUrb->context; pAd = pHTTXContext->pAd; @@ -755,7 +755,7 @@ static void rtusb_ac0_dma_done_tasklet(unsigned long data) int RtmpNetTaskInit(IN RTMP_ADAPTER * pAd) { - POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; + struct os_cookie *pObj = (struct os_cookie *)pAd->OS_Cookie; /* Create receive tasklet */ tasklet_init(&pObj->rx_done_task, rx_done_tasklet, (unsigned long)pAd); @@ -782,9 +782,9 @@ int RtmpNetTaskInit(IN RTMP_ADAPTER * pAd) void RtmpNetTaskExit(IN RTMP_ADAPTER * pAd) { - POS_COOKIE pObj; + struct os_cookie *pObj; - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; tasklet_kill(&pObj->rx_done_task); tasklet_kill(&pObj->mgmt_dma_done_task); diff --git a/drivers/staging/rt2860/rtmp.h b/drivers/staging/rt2860/rtmp.h index 6acd29f7312..8182b2aa456 100644 --- a/drivers/staging/rt2860/rtmp.h +++ b/drivers/staging/rt2860/rtmp.h @@ -479,23 +479,23 @@ typedef struct _RTMP_SCATTER_GATHER_LIST { typedef struct _RTMP_DMABUF { unsigned long AllocSize; void *AllocVa; /* TxBuf virtual address */ - NDIS_PHYSICAL_ADDRESS AllocPa; /* TxBuf physical address */ + dma_addr_t AllocPa; /* TxBuf physical address */ } RTMP_DMABUF, *PRTMP_DMABUF; /* */ /* Control block (Descriptor) for all ring descriptor DMA operation, buffer must be */ -/* contiguous physical memory. NDIS_PACKET stored the binding Rx packet descriptor */ +/* contiguous physical memory. char stored the binding Rx packet descriptor */ /* which won't be released, driver has to wait until upper layer return the packet */ /* before giveing up this rx ring descriptor to ASIC. NDIS_BUFFER is assocaited pair */ -/* to describe the packet buffer. For Tx, NDIS_PACKET stored the tx packet descriptor */ +/* to describe the packet buffer. For Tx, char stored the tx packet descriptor */ /* which driver should ACK upper layer when the tx is physically done or failed. */ /* */ typedef struct _RTMP_DMACB { unsigned long AllocSize; /* Control block size */ void *AllocVa; /* Control block virtual address */ - NDIS_PHYSICAL_ADDRESS AllocPa; /* Control block physical address */ - PNDIS_PACKET pNdisPacket; - PNDIS_PACKET pNextNdisPacket; + dma_addr_t AllocPa; /* Control block physical address */ + void *pNdisPacket; + void *pNextNdisPacket; RTMP_DMABUF DmaBuf; /* Associated DMA buffer structure */ } RTMP_DMACB, *PRTMP_DMACB; @@ -728,7 +728,7 @@ typedef struct _CISCO_IAPP_CONTENT_ { * Fragment Frame structure */ typedef struct _FRAGMENT_FRAME { - PNDIS_PACKET pFragPacket; + void *pFragPacket; unsigned long RxSize; u16 Sequence; u16 LastFrag; @@ -742,7 +742,7 @@ typedef struct _PACKET_INFO { u32 PhysicalBufferCount; /* Physical breaks of buffer descripor chained */ u32 BufferCount; /* Number of Buffer descriptor chained */ u32 TotalPacketLength; /* Self explained */ - PNDIS_BUFFER pFirstBuffer; /* Pointer to first buffer descriptor */ + char *pFirstBuffer; /* Pointer to first buffer descriptor */ } PACKET_INFO, *PPACKET_INFO; /* */ @@ -906,7 +906,7 @@ typedef struct _MLME_STRUCT { unsigned long LastSendNULLpsmTime; BOOLEAN bRunning; - NDIS_SPIN_LOCK TaskLock; + spinlock_t TaskLock; MLME_QUEUE Queue; u32 ShiftReg; @@ -944,7 +944,7 @@ typedef struct _MLME_STRUCT { **************************************************************************/ struct reordering_mpdu { struct reordering_mpdu *next; - PNDIS_PACKET pPacket; /* coverted to 802.3 frame */ + void *pPacket; /* coverted to 802.3 frame */ int Sequence; /* sequence number of MPDU */ BOOLEAN bAMSDU; }; @@ -956,7 +956,7 @@ struct reordering_list { struct reordering_mpdu_pool { void *mem; - NDIS_SPIN_LOCK lock; + spinlock_t lock; struct reordering_list freelist; }; @@ -1004,7 +1004,7 @@ typedef struct _BA_REC_ENTRY { /* u8 RxBufIdxUsed; */ /* corresponding virtual address for RX reordering packet storage. */ /*RTMP_REORDERDMABUF MAP_RXBuf[MAX_RX_REORDERBUF]; */ - NDIS_SPIN_LOCK RxReRingLock; /* Rx Ring spinlock */ + spinlock_t RxReRingLock; /* Rx Ring spinlock */ /* struct _BA_REC_ENTRY *pNext; */ void *pAdapter; struct reordering_list list; @@ -1327,10 +1327,10 @@ typedef struct _COMMON_CONFIG { u32 BeaconRemain; #endif /* RTMP_MAC_USB // */ - NDIS_SPIN_LOCK MeasureReqTabLock; + spinlock_t MeasureReqTabLock; PMEASURE_REQ_TAB pMeasureReqTab; - NDIS_SPIN_LOCK TpcReqTabLock; + spinlock_t TpcReqTabLock; PTPC_REQ_TAB pTpcReqTab; BOOLEAN PSPXlink; /* 0: Disable. 1: Enable */ @@ -1716,7 +1716,7 @@ struct _RTMP_CHIP_OP_ { /* */ struct _RTMP_ADAPTER { void *OS_Cookie; /* save specific structure relative to OS */ - PNET_DEV net_dev; + struct net_device *net_dev; unsigned long VirtualIfCnt; RTMP_CHIP_OP chipOps; @@ -1756,7 +1756,7 @@ struct _RTMP_ADAPTER { RTMP_TX_RING TxRing[NUM_OF_TX_RING]; /* AC0~4 + HCCA */ #endif /* RTMP_MAC_PCI // */ - NDIS_SPIN_LOCK irq_lock; + spinlock_t irq_lock; u8 irq_disabled; #ifdef RTMP_MAC_USB @@ -1778,11 +1778,11 @@ struct _RTMP_ADAPTER { /*======Cmd Thread */ CmdQ CmdQ; - NDIS_SPIN_LOCK CmdQLock; /* CmdQLock spinlock */ + spinlock_t CmdQLock; /* CmdQLock spinlock */ RTMP_OS_TASK cmdQTask; /*======Semaphores (event) */ - RTMP_OS_SEM UsbVendorReq_semaphore; + struct semaphore UsbVendorReq_semaphore; void *UsbVendorReqBuf; wait_queue_head_t *wait; #endif /* RTMP_MAC_USB // */ @@ -1804,7 +1804,7 @@ struct _RTMP_ADAPTER { #ifdef RTMP_TIMER_TASK_SUPPORT /* If you want use timer task to handle the timer related jobs, enable this. */ RTMP_TIMER_TASK_QUEUE TimerQ; - NDIS_SPIN_LOCK TimerQLock; + spinlock_t TimerQLock; RTMP_OS_TASK timerTask; #endif /* RTMP_TIMER_TASK_SUPPORT // */ @@ -1812,15 +1812,15 @@ struct _RTMP_ADAPTER { /* Tx related parameters */ /*****************************************************************************************/ BOOLEAN DeQueueRunning[NUM_OF_TX_RING]; /* for ensuring RTUSBDeQueuePacket get call once */ - NDIS_SPIN_LOCK DeQueueLock[NUM_OF_TX_RING]; + spinlock_t DeQueueLock[NUM_OF_TX_RING]; #ifdef RTMP_MAC_USB /* Data related context and AC specified, 4 AC supported */ - NDIS_SPIN_LOCK BulkOutLock[6]; /* BulkOut spinlock for 4 ACs */ - NDIS_SPIN_LOCK MLMEBulkOutLock; /* MLME BulkOut lock */ + spinlock_t BulkOutLock[6]; /* BulkOut spinlock for 4 ACs */ + spinlock_t MLMEBulkOutLock; /* MLME BulkOut lock */ HT_TX_CONTEXT TxContext[NUM_OF_TX_RING]; - NDIS_SPIN_LOCK TxContextQueueLock[NUM_OF_TX_RING]; /* TxContextQueue spinlock */ + spinlock_t TxContextQueueLock[NUM_OF_TX_RING]; /* TxContextQueue spinlock */ /* 4 sets of Bulk Out index and pending flag */ u8 NextBulkOutIndex[4]; /* only used for 4 EDCA bulkout pipe */ @@ -1833,11 +1833,11 @@ struct _RTMP_ADAPTER { /* resource for software backlog queues */ QUEUE_HEADER TxSwQueue[NUM_OF_TX_RING]; /* 4 AC + 1 HCCA */ - NDIS_SPIN_LOCK TxSwQueueLock[NUM_OF_TX_RING]; /* TxSwQueue spinlock */ + spinlock_t TxSwQueueLock[NUM_OF_TX_RING]; /* TxSwQueue spinlock */ RTMP_DMABUF MgmtDescRing; /* Shared memory for MGMT descriptors */ RTMP_MGMT_RING MgmtRing; - NDIS_SPIN_LOCK MgmtRingLock; /* Prio Ring spinlock */ + spinlock_t MgmtRingLock; /* Prio Ring spinlock */ /*****************************************************************************************/ /* Rx related parameters */ @@ -1845,14 +1845,14 @@ struct _RTMP_ADAPTER { #ifdef RTMP_MAC_PCI RTMP_RX_RING RxRing; - NDIS_SPIN_LOCK RxRingLock; /* Rx Ring spinlock */ + spinlock_t RxRingLock; /* Rx Ring spinlock */ #ifdef RT3090 - NDIS_SPIN_LOCK McuCmdLock; /*MCU Command Queue spinlock */ + spinlock_t McuCmdLock; /*MCU Command Queue spinlock */ #endif /* RT3090 // */ #endif /* RTMP_MAC_PCI // */ #ifdef RTMP_MAC_USB RX_CONTEXT RxContext[RX_RING_SIZE]; /* 1 for redundant multiple IRP bulk in. */ - NDIS_SPIN_LOCK BulkInLock; /* BulkIn spinlock for 4 ACs */ + spinlock_t BulkInLock; /* BulkIn spinlock for 4 ACs */ u8 PendingRx; /* The Maximum pending Rx value should be RX_RING_SIZE. */ u8 NextRxBulkInIndex; /* Indicate the current RxContext Index which hold by Host controller. */ u8 NextRxBulkInReadIndex; /* Indicate the current RxContext Index which driver can read & process it. */ @@ -2013,11 +2013,11 @@ struct _RTMP_ADAPTER { /*About MacTab, the sta driver will use #0 and #1 for multicast and AP. */ MAC_TABLE MacTab; /* ASIC on-chip WCID entry table. At TX, ASIC always use key according to this on-chip table. */ - NDIS_SPIN_LOCK MacTabLock; + spinlock_t MacTabLock; BA_TABLE BATable; - NDIS_SPIN_LOCK BATabLock; + spinlock_t BATabLock; RALINK_TIMER_STRUCT RECBATimer; /* encryption/decryption KEY tables */ @@ -2170,7 +2170,7 @@ typedef struct _RX_BLK_ { RT28XX_RXD_STRUC RxD; PRXWI_STRUC pRxWI; PHEADER_802_11 pHeader; - PNDIS_PACKET pRxPacket; + void *pRxPacket; u8 *pData; u16 DataSize; u16 Flags; @@ -2223,7 +2223,7 @@ typedef struct _TX_BLK_ { HTTRANSMIT_SETTING *pTransmit; /* Following structure used for the characteristics of a specific packet. */ - PNDIS_PACKET pPacket; + void *pPacket; u8 *pSrcBufHeader; /* Reference to the head of sk_buff->data */ u8 *pSrcBufData; /* Reference to the sk_buff->data, will changed depends on hanlding progresss */ u32 SrcBufLen; /* Length of packet payload which not including Layer 2 header */ @@ -2316,7 +2316,7 @@ int RTMPAllocTxRxRingMemory(IN PRTMP_ADAPTER pAd); void RTMPFreeAdapter(IN PRTMP_ADAPTER pAd); int NICReadRegParameters(IN PRTMP_ADAPTER pAd, - IN NDIS_HANDLE WrapperConfigurationContext); + void *WrapperConfigurationContext); #ifdef RTMP_RF_RW_SUPPORT void NICInitRFRegisters(IN PRTMP_ADAPTER pAd); @@ -2468,21 +2468,21 @@ BOOLEAN TxFrameIsAggregatible(IN PRTMP_ADAPTER pAd, BOOLEAN PeerIsAggreOn(IN PRTMP_ADAPTER pAd, unsigned long TxRate, IN PMAC_TABLE_ENTRY pMacEntry); -int Sniff2BytesFromNdisBuffer(IN PNDIS_BUFFER pFirstBuffer, +int Sniff2BytesFromNdisBuffer(char *pFirstBuffer, u8 DesiredOffset, u8 *pByte0, u8 *pByte1); -int STASendPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket); +int STASendPacket(IN PRTMP_ADAPTER pAd, void *pPacket); -void STASendPackets(IN NDIS_HANDLE MiniportAdapterContext, - IN PPNDIS_PACKET ppPacketArray, u32 NumberOfPackets); +void STASendPackets(void *MiniportAdapterContext, + void **ppPacketArray, u32 NumberOfPackets); void RTMPDeQueuePacket(IN PRTMP_ADAPTER pAd, IN BOOLEAN bIntContext, u8 QueIdx, u8 Max_Tx_Packets); int RTMPHardTransmit(IN PRTMP_ADAPTER pAd, - IN PNDIS_PACKET pPacket, + void *pPacket, u8 QueIdx, unsigned long *pFreeTXDLeft); int STAHardTransmit(IN PRTMP_ADAPTER pAd, @@ -2497,17 +2497,17 @@ int RTMPFreeTXDRequest(IN PRTMP_ADAPTER pAd, u8 NumberRequired, u8 *FreeNumberIs); int MlmeHardTransmit(IN PRTMP_ADAPTER pAd, - u8 QueIdx, IN PNDIS_PACKET pPacket); + u8 QueIdx, void *pPacket); int MlmeHardTransmitMgmtRing(IN PRTMP_ADAPTER pAd, - u8 QueIdx, IN PNDIS_PACKET pPacket); + u8 QueIdx, void *pPacket); #ifdef RTMP_MAC_PCI int MlmeHardTransmitTxRing(IN PRTMP_ADAPTER pAd, - u8 QueIdx, IN PNDIS_PACKET pPacket); + u8 QueIdx, void *pPacket); int MlmeDataHardTransmit(IN PRTMP_ADAPTER pAd, - u8 QueIdx, IN PNDIS_PACKET pPacket); + u8 QueIdx, void *pPacket); void RTMPWriteTxDescriptor(IN PRTMP_ADAPTER pAd, IN PTXD_STRUC pTxD, IN BOOLEAN bWIV, u8 QSEL); @@ -2571,22 +2571,22 @@ void WpaStaGroupKeySetting(IN PRTMP_ADAPTER pAd); int RTMPCloneNdisPacket(IN PRTMP_ADAPTER pAd, IN BOOLEAN pInsAMSDUHdr, - IN PNDIS_PACKET pInPacket, - OUT PNDIS_PACKET * ppOutPacket); + void *pInPacket, + void ** ppOutPacket); int RTMPAllocateNdisPacket(IN PRTMP_ADAPTER pAd, - IN PNDIS_PACKET * pPacket, + void ** pPacket, u8 *pHeader, u32 HeaderLen, u8 *pData, u32 DataLen); -void RTMPFreeNdisPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket); +void RTMPFreeNdisPacket(IN PRTMP_ADAPTER pAd, void *pPacket); BOOLEAN RTMPFreeTXDUponTxDmaDone(IN PRTMP_ADAPTER pAd, u8 QueIdx); -BOOLEAN RTMPCheckDHCPFrame(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket); +BOOLEAN RTMPCheckDHCPFrame(IN PRTMP_ADAPTER pAd, void *pPacket); -BOOLEAN RTMPCheckEtherType(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket); +BOOLEAN RTMPCheckEtherType(IN PRTMP_ADAPTER pAd, void *pPacket); /* */ /* Private routines in rtmp_wep.c */ @@ -3356,7 +3356,7 @@ BOOLEAN RTMPTkipCompareMICValue(IN PRTMP_ADAPTER pAd, u8 UserPriority, u32 Len); void RTMPCalculateMICValue(IN PRTMP_ADAPTER pAd, - IN PNDIS_PACKET pPacket, + void *pPacket, u8 *pEncap, IN PCIPHER_KEY pKey, u8 apidx); @@ -3527,20 +3527,20 @@ void AES_GTK_KEY_WRAP(u8 * key, /*typedef void (*TIMER_FUNCTION)(unsigned long); */ /* timeout -- ms */ -void RTMP_SetPeriodicTimer(IN NDIS_MINIPORT_TIMER * pTimer, +void RTMP_SetPeriodicTimer(struct timer_list * pTimer, IN unsigned long timeout); void RTMP_OS_Init_Timer(IN PRTMP_ADAPTER pAd, - IN NDIS_MINIPORT_TIMER * pTimer, + struct timer_list * pTimer, IN TIMER_FUNCTION function, void *data); -void RTMP_OS_Add_Timer(IN NDIS_MINIPORT_TIMER * pTimer, +void RTMP_OS_Add_Timer(struct timer_list * pTimer, IN unsigned long timeout); -void RTMP_OS_Mod_Timer(IN NDIS_MINIPORT_TIMER * pTimer, +void RTMP_OS_Mod_Timer(struct timer_list * pTimer, IN unsigned long timeout); -void RTMP_OS_Del_Timer(IN NDIS_MINIPORT_TIMER * pTimer, +void RTMP_OS_Del_Timer(struct timer_list * pTimer, OUT BOOLEAN * pCancelled); void RTMP_OS_Release_Packet(IN PRTMP_ADAPTER pAd, IN PQUEUE_ENTRY pEntry); @@ -3556,7 +3556,7 @@ void RTMP_AllocateSharedMemory(IN PRTMP_ADAPTER pAd, unsigned long Length, IN BOOLEAN Cached, void ** VirtualAddress, - OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress); + dma_addr_t *PhysicalAddress); void RTMPFreeTxRxRingMemory(IN PRTMP_ADAPTER pAd); @@ -3567,82 +3567,82 @@ void RTMP_AllocateTxDescMemory(IN PRTMP_ADAPTER pAd, unsigned long Length, IN BOOLEAN Cached, void ** VirtualAddress, - OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress); + dma_addr_t *PhysicalAddress); void RTMP_AllocateFirstTxBuffer(IN PRTMP_ADAPTER pAd, u32 Index, unsigned long Length, IN BOOLEAN Cached, void ** VirtualAddress, - OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress); + dma_addr_t *PhysicalAddress); void RTMP_FreeFirstTxBuffer(IN PRTMP_ADAPTER pAd, unsigned long Length, IN BOOLEAN Cached, void *VirtualAddress, - IN NDIS_PHYSICAL_ADDRESS PhysicalAddress); + dma_addr_t PhysicalAddress); void RTMP_AllocateMgmtDescMemory(IN PRTMP_ADAPTER pAd, unsigned long Length, IN BOOLEAN Cached, void ** VirtualAddress, - OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress); + dma_addr_t *PhysicalAddress); void RTMP_AllocateRxDescMemory(IN PRTMP_ADAPTER pAd, unsigned long Length, IN BOOLEAN Cached, void ** VirtualAddress, - OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress); + dma_addr_t *PhysicalAddress); void RTMP_FreeDescMemory(IN PRTMP_ADAPTER pAd, unsigned long Length, void *VirtualAddress, - IN NDIS_PHYSICAL_ADDRESS PhysicalAddress); + dma_addr_t PhysicalAddress); -PNDIS_PACKET RtmpOSNetPktAlloc(IN RTMP_ADAPTER * pAd, IN int size); +void *RtmpOSNetPktAlloc(IN RTMP_ADAPTER * pAd, IN int size); -PNDIS_PACKET RTMP_AllocateRxPacketBuffer(IN PRTMP_ADAPTER pAd, +void *RTMP_AllocateRxPacketBuffer(IN PRTMP_ADAPTER pAd, unsigned long Length, IN BOOLEAN Cached, void ** VirtualAddress, - OUT PNDIS_PHYSICAL_ADDRESS + OUT dma_addr_t * PhysicalAddress); -PNDIS_PACKET RTMP_AllocateTxPacketBuffer(IN PRTMP_ADAPTER pAd, +void *RTMP_AllocateTxPacketBuffer(IN PRTMP_ADAPTER pAd, unsigned long Length, IN BOOLEAN Cached, void ** VirtualAddress); -PNDIS_PACKET RTMP_AllocateFragPacketBuffer(IN PRTMP_ADAPTER pAd, +void *RTMP_AllocateFragPacketBuffer(IN PRTMP_ADAPTER pAd, unsigned long Length); -void RTMP_QueryPacketInfo(IN PNDIS_PACKET pPacket, +void RTMP_QueryPacketInfo(void *pPacket, OUT PACKET_INFO * pPacketInfo, u8 ** pSrcBufVA, u32 * pSrcBufLen); -void RTMP_QueryNextPacketInfo(IN PNDIS_PACKET * ppPacket, +void RTMP_QueryNextPacketInfo(void ** ppPacket, OUT PACKET_INFO * pPacketInfo, u8 ** pSrcBufVA, u32 * pSrcBufLen); BOOLEAN RTMP_FillTxBlkInfo(IN RTMP_ADAPTER * pAd, IN TX_BLK * pTxBlk); PRTMP_SCATTER_GATHER_LIST -rt_get_sg_list_from_packet(PNDIS_PACKET pPacket, RTMP_SCATTER_GATHER_LIST * sg); +rt_get_sg_list_from_packet(void *pPacket, RTMP_SCATTER_GATHER_LIST * sg); -void announce_802_3_packet(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket); +void announce_802_3_packet(IN PRTMP_ADAPTER pAd, void *pPacket); -u32 BA_Reorder_AMSDU_Annnounce(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket); +u32 BA_Reorder_AMSDU_Annnounce(IN PRTMP_ADAPTER pAd, void *pPacket); -PNET_DEV get_netdev_from_bssid(IN PRTMP_ADAPTER pAd, u8 FromWhichBSSID); +struct net_device *get_netdev_from_bssid(IN PRTMP_ADAPTER pAd, u8 FromWhichBSSID); -PNDIS_PACKET duplicate_pkt(IN PRTMP_ADAPTER pAd, +void *duplicate_pkt(IN PRTMP_ADAPTER pAd, u8 *pHeader802_3, u32 HdrLen, u8 *pData, unsigned long DataSize, u8 FromWhichBSSID); -PNDIS_PACKET duplicate_pkt_with_TKIP_MIC(IN PRTMP_ADAPTER pAd, - IN PNDIS_PACKET pOldPkt); +void *duplicate_pkt_with_TKIP_MIC(IN PRTMP_ADAPTER pAd, + void *pOldPkt); void ba_flush_reordering_timeout_mpdus(IN PRTMP_ADAPTER pAd, IN PBA_REC_ENTRY pBAEntry, @@ -3659,7 +3659,7 @@ void BASessionTearDownALL(IN OUT PRTMP_ADAPTER pAd, u8 Wcid); BOOLEAN OS_Need_Clone_Packet(void); void build_tx_packet(IN PRTMP_ADAPTER pAd, - IN PNDIS_PACKET pPacket, + void *pPacket, u8 *pFrame, unsigned long FrameLen); void BAOriSessionTearDown(IN OUT PRTMP_ADAPTER pAd, @@ -3743,18 +3743,18 @@ void wlan_802_11_to_802_3_packet(IN PRTMP_ADAPTER pAd, } void Sta_Announce_or_Forward_802_3_Packet(IN PRTMP_ADAPTER pAd, - IN PNDIS_PACKET pPacket, + void *pPacket, u8 FromWhichBSSID); #define ANNOUNCE_OR_FORWARD_802_3_PACKET(_pAd, _pPacket, _FromWhichBSS)\ Sta_Announce_or_Forward_802_3_Packet(_pAd, _pPacket, _FromWhichBSS); /*announce_802_3_packet(_pAd, _pPacket); */ -PNDIS_PACKET DuplicatePacket(IN PRTMP_ADAPTER pAd, - IN PNDIS_PACKET pPacket, u8 FromWhichBSSID); +void *DuplicatePacket(IN PRTMP_ADAPTER pAd, + void *pPacket, u8 FromWhichBSSID); -PNDIS_PACKET ClonePacket(IN PRTMP_ADAPTER pAd, - IN PNDIS_PACKET pPacket, +void *ClonePacket(IN PRTMP_ADAPTER pAd, + void *pPacket, u8 *pData, unsigned long DataSize); /* Normal, AMPDU or AMSDU */ @@ -3768,12 +3768,12 @@ void CmmRxRalinkFrameIndicate(IN PRTMP_ADAPTER pAd, void Update_Rssi_Sample(IN PRTMP_ADAPTER pAd, IN RSSI_SAMPLE * pRssi, IN PRXWI_STRUC pRxWI); -PNDIS_PACKET GetPacketFromRxRing(IN PRTMP_ADAPTER pAd, +void *GetPacketFromRxRing(IN PRTMP_ADAPTER pAd, OUT PRT28XX_RXD_STRUC pSaveRxD, OUT BOOLEAN * pbReschedule, IN u32 * pRxPending); -PNDIS_PACKET RTMPDeFragmentDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk); +void *RTMPDeFragmentDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk); enum { DIDmsg_lnxind_wlansniffrm = 0x00000044, @@ -3903,10 +3903,10 @@ void RtmpMgmtTaskExit(IN RTMP_ADAPTER * pAd); void tbtt_tasklet(unsigned long data); -PNET_DEV RtmpPhyNetDevInit(IN RTMP_ADAPTER * pAd, +struct net_device *RtmpPhyNetDevInit(IN RTMP_ADAPTER * pAd, IN RTMP_OS_NETDEV_OP_HOOK * pNetHook); -BOOLEAN RtmpPhyNetDevExit(IN RTMP_ADAPTER * pAd, IN PNET_DEV net_dev); +BOOLEAN RtmpPhyNetDevExit(IN RTMP_ADAPTER * pAd, struct net_device *net_dev); int RtmpRaDevCtrlInit(IN RTMP_ADAPTER * pAd, IN RTMP_INF_TYPE infType); @@ -3950,7 +3950,7 @@ void RtmpPCIDataKickOut(IN PRTMP_ADAPTER pAd, int RtmpPCIMgmtKickOut(IN RTMP_ADAPTER * pAd, u8 QueIdx, - IN PNDIS_PACKET pPacket, + void *pPacket, u8 *pSrcBufVA, u32 SrcBufLen); int RTMPCheckRxError(IN PRTMP_ADAPTER pAd, @@ -4137,10 +4137,10 @@ void append_pkt(IN PRTMP_ADAPTER pAd, u8 *pHeader802_3, u32 HdrLen, u8 *pData, - unsigned long DataSize, OUT PNDIS_PACKET * ppPacket); + unsigned long DataSize, void ** ppPacket); u32 deaggregate_AMSDU_announce(IN PRTMP_ADAPTER pAd, - PNDIS_PACKET pPacket, + void *pPacket, u8 *pData, unsigned long DataSize); int RTMPCheckRxError(IN PRTMP_ADAPTER pAd, @@ -4199,7 +4199,7 @@ void RtmpUSBDataKickOut(IN PRTMP_ADAPTER pAd, int RtmpUSBMgmtKickOut(IN RTMP_ADAPTER * pAd, u8 QueIdx, - IN PNDIS_PACKET pPacket, + void *pPacket, u8 *pSrcBufVA, u32 SrcBufLen); void RtmpUSBNullFrameKickOut(IN RTMP_ADAPTER * pAd, @@ -4262,8 +4262,8 @@ void ReSyncBeaconTime(IN PRTMP_ADAPTER pAd); void RTMPSetAGCInitValue(IN PRTMP_ADAPTER pAd, u8 BandWidth); -int rt28xx_close(IN PNET_DEV dev); -int rt28xx_open(IN PNET_DEV dev); +int rt28xx_close(struct net_device *dev); +int rt28xx_open(struct net_device *dev); #define VIRTUAL_IF_INC(__pAd) ((__pAd)->VirtualIfCnt++) #define VIRTUAL_IF_DEC(__pAd) ((__pAd)->VirtualIfCnt--) @@ -4303,24 +4303,24 @@ int RtmpOSWrielessEventSend(IN RTMP_ADAPTER * pAd, u8 *pSrcMac, u8 *pData, u32 dataLen); -int RtmpOSNetDevAddrSet(IN PNET_DEV pNetDev, u8 *pMacAddr); +int RtmpOSNetDevAddrSet(struct net_device *pNetDev, u8 *pMacAddr); -int RtmpOSNetDevAttach(IN PNET_DEV pNetDev, +int RtmpOSNetDevAttach(struct net_device *pNetDev, IN RTMP_OS_NETDEV_OP_HOOK * pDevOpHook); -void RtmpOSNetDevClose(IN PNET_DEV pNetDev); +void RtmpOSNetDevClose(struct net_device *pNetDev); -void RtmpOSNetDevDetach(IN PNET_DEV pNetDev); +void RtmpOSNetDevDetach(struct net_device *pNetDev); -int RtmpOSNetDevAlloc(IN PNET_DEV * pNewNetDev, u32 privDataSize); +int RtmpOSNetDevAlloc(struct net_device ** pNewNetDev, u32 privDataSize); -void RtmpOSNetDevFree(IN PNET_DEV pNetDev); +void RtmpOSNetDevFree(struct net_device *pNetDev); -PNET_DEV RtmpOSNetDevGetByName(IN PNET_DEV pNetDev, char *pDevName); +struct net_device *RtmpOSNetDevGetByName(struct net_device *pNetDev, char *pDevName); -void RtmpOSNetDeviceRefPut(IN PNET_DEV pNetDev); +void RtmpOSNetDeviceRefPut(struct net_device *pNetDev); -PNET_DEV RtmpOSNetDevCreate(IN RTMP_ADAPTER * pAd, +struct net_device *RtmpOSNetDevCreate(IN RTMP_ADAPTER * pAd, int devType, int devNum, int privMemSize, char *pNamePrefix); @@ -4343,14 +4343,14 @@ int RtmpOSTaskAttach(IN RTMP_OS_TASK * pTask, /* File operation related function prototypes */ -RTMP_OS_FD RtmpOSFileOpen(IN char *pPath, IN int flag, IN int mode); +struct file *RtmpOSFileOpen(IN char *pPath, IN int flag, IN int mode); -int RtmpOSFileClose(IN RTMP_OS_FD osfd); +int RtmpOSFileClose(struct file *osfd); -void RtmpOSFileSeek(IN RTMP_OS_FD osfd, IN int offset); +void RtmpOSFileSeek(struct file *osfd, IN int offset); -int RtmpOSFileRead(IN RTMP_OS_FD osfd, IN char *pDataPtr, IN int readLen); +int RtmpOSFileRead(struct file *osfd, IN char *pDataPtr, IN int readLen); -int RtmpOSFileWrite(IN RTMP_OS_FD osfd, IN char *pDataPtr, IN int writeLen); +int RtmpOSFileWrite(struct file *osfd, IN char *pDataPtr, IN int writeLen); #endif /* __RTMP_H__ */ diff --git a/drivers/staging/rt2860/rtmp_os.h b/drivers/staging/rt2860/rtmp_os.h index eb79e6feb66..cff01289de9 100644 --- a/drivers/staging/rt2860/rtmp_os.h +++ b/drivers/staging/rt2860/rtmp_os.h @@ -72,8 +72,8 @@ typedef struct _RTMP_OS_TASK_ { /*unsigned long taskFlags; */ RTMP_TASK_STATUS taskStatus; #ifndef KTHREAD_SUPPORT - RTMP_OS_SEM taskSema; - RTMP_OS_PID taskPID; + struct semaphore taskSema; + struct pid *taskPID; struct completion taskComplete; #endif unsigned char task_killed; @@ -84,7 +84,7 @@ typedef struct _RTMP_OS_TASK_ { #endif } RTMP_OS_TASK; -int RtmpOSIRQRequest(IN PNET_DEV pNetDev); -int RtmpOSIRQRelease(IN PNET_DEV pNetDev); +int RtmpOSIRQRequest(struct net_device *pNetDev); +int RtmpOSIRQRelease(struct net_device *pNetDev); #endif /* __RMTP_OS_H__ // */ diff --git a/drivers/staging/rt2860/rtmp_timer.h b/drivers/staging/rt2860/rtmp_timer.h index 441571dbaff..c81e507dbad 100644 --- a/drivers/staging/rt2860/rtmp_timer.h +++ b/drivers/staging/rt2860/rtmp_timer.h @@ -62,7 +62,7 @@ typedef void(*RTMP_TIMER_TASK_HANDLE) (void *SystemSpecific1, #endif /* RTMP_TIMER_TASK_SUPPORT // */ typedef struct _RALINK_TIMER_STRUCT { - RTMP_OS_TIMER TimerObj; /* Ndis Timer object */ + struct timer_list TimerObj; /* Ndis Timer object */ BOOLEAN Valid; /* Set to True when call RTMPInitTimer */ BOOLEAN State; /* True if timer cancelled */ BOOLEAN PeriodicType; /* True if timer is periodic timer */ diff --git a/drivers/staging/rt2860/sta/rtmp_data.c b/drivers/staging/rt2860/sta/rtmp_data.c index b40e511ea5b..3d2d6781776 100644 --- a/drivers/staging/rt2860/sta/rtmp_data.c +++ b/drivers/staging/rt2860/sta/rtmp_data.c @@ -323,7 +323,7 @@ void STAHandleRxDataFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk) PRT28XX_RXD_STRUC pRxD = &(pRxBlk->RxD); PRXWI_STRUC pRxWI = pRxBlk->pRxWI; PHEADER_802_11 pHeader = pRxBlk->pHeader; - PNDIS_PACKET pRxPacket = pRxBlk->pRxPacket; + void *pRxPacket = pRxBlk->pRxPacket; BOOLEAN bFragment = FALSE; MAC_TABLE_ENTRY *pEntry = NULL; u8 FromWhichBSSID = BSS0; @@ -615,7 +615,7 @@ void STAHandleRxMgmtFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk) PRT28XX_RXD_STRUC pRxD = &(pRxBlk->RxD); PRXWI_STRUC pRxWI = pRxBlk->pRxWI; PHEADER_802_11 pHeader = pRxBlk->pHeader; - PNDIS_PACKET pRxPacket = pRxBlk->pRxPacket; + void *pRxPacket = pRxBlk->pRxPacket; do { @@ -660,7 +660,7 @@ void STAHandleRxControlFrame(IN PRTMP_ADAPTER pAd, IN RX_BLK * pRxBlk) { PRXWI_STRUC pRxWI = pRxBlk->pRxWI; PHEADER_802_11 pHeader = pRxBlk->pHeader; - PNDIS_PACKET pRxPacket = pRxBlk->pRxPacket; + void *pRxPacket = pRxBlk->pRxPacket; switch (pHeader->FC.SubType) { case SUBTYPE_BLOCK_ACK_REQ: @@ -706,7 +706,7 @@ BOOLEAN STARxDoneInterruptHandle(IN PRTMP_ADAPTER pAd, IN BOOLEAN argc) RT28XX_RXD_STRUC *pRxD; u8 *pData; PRXWI_STRUC pRxWI; - PNDIS_PACKET pRxPacket; + void *pRxPacket; PHEADER_802_11 pHeader; RX_BLK RxCell; @@ -844,8 +844,8 @@ Routine Description: Early checking and OS-depened parsing for Tx packet send to our STA driver. Arguments: - NDIS_HANDLE MiniportAdapterContext Pointer refer to the device handle, i.e., the pAd. - PPNDIS_PACKET ppPacketArray The packet array need to do transmission. + void * MiniportAdapterContext Pointer refer to the device handle, i.e., the pAd. + void ** ppPacketArray The packet array need to do transmission. u32 NumberOfPackets Number of packet in packet array. Return Value: @@ -856,12 +856,12 @@ Note: You only can put OS-depened & STA related code in here. ======================================================================== */ -void STASendPackets(IN NDIS_HANDLE MiniportAdapterContext, - IN PPNDIS_PACKET ppPacketArray, u32 NumberOfPackets) +void STASendPackets(void *MiniportAdapterContext, + void **ppPacketArray, u32 NumberOfPackets) { u32 Index; PRTMP_ADAPTER pAd = (PRTMP_ADAPTER) MiniportAdapterContext; - PNDIS_PACKET pPacket; + void *pPacket; BOOLEAN allowToSend = FALSE; for (Index = 0; Index < NumberOfPackets; Index++) { @@ -920,7 +920,7 @@ Note: You only can put OS-indepened & STA related code in here. ======================================================================== */ -int STASendPacket(IN PRTMP_ADAPTER pAd, IN PNDIS_PACKET pPacket) +int STASendPacket(IN PRTMP_ADAPTER pAd, void *pPacket) { PACKET_INFO PacketInfo; u8 *pSrcBufVA; @@ -1561,7 +1561,7 @@ static inline u8 *STA_Build_ARalink_Frame_Header(IN RTMP_ADAPTER * pAd, { u8 *pHeaderBufPtr; HEADER_802_11 *pHeader_802_11; - PNDIS_PACKET pNextPacket; + void *pNextPacket; u32 nextBufLen; PQUEUE_ENTRY pQEntry; @@ -2422,7 +2422,7 @@ void STA_Fragment_Frame_Tx(IN RTMP_ADAPTER * pAd, IN TX_BLK * pTxBlk) Arguments: pAd Pointer to our adapter - PNDIS_PACKET Pointer to outgoing Ndis frame + void * Pointer to outgoing Ndis frame NumberOfFrag Number of fragment required Return Value: @@ -2437,7 +2437,7 @@ void STA_Fragment_Frame_Tx(IN RTMP_ADAPTER * pAd, IN TX_BLK * pTxBlk) int STAHardTransmit(IN PRTMP_ADAPTER pAd, IN TX_BLK * pTxBlk, u8 QueIdx) { - NDIS_PACKET *pPacket; + char *pPacket; PQUEUE_ENTRY pQEntry; /* --------------------------------------------- */ @@ -2538,7 +2538,7 @@ unsigned long HashBytesPolynomial(u8 * value, unsigned int len) } void Sta_Announce_or_Forward_802_3_Packet(IN PRTMP_ADAPTER pAd, - IN PNDIS_PACKET pPacket, + void *pPacket, u8 FromWhichBSSID) { if (TRUE) { diff --git a/drivers/staging/rt2860/sta_ioctl.c b/drivers/staging/rt2860/sta_ioctl.c index 88a792270e9..d542f4f5f6b 100644 --- a/drivers/staging/rt2860/sta_ioctl.c +++ b/drivers/staging/rt2860/sta_ioctl.c @@ -2450,7 +2450,7 @@ const struct iw_handler_def rt28xx_iw_handler_def = { int rt28xx_sta_ioctl(IN struct net_device *net_dev, IN OUT struct ifreq *rq, int cmd) { - POS_COOKIE pObj; + struct os_cookie *pObj; RTMP_ADAPTER *pAd = NULL; struct iwreq *wrq = (struct iwreq *)rq; BOOLEAN StateMachineTouched = FALSE; @@ -2458,7 +2458,7 @@ int rt28xx_sta_ioctl(IN struct net_device *net_dev, GET_PAD_FROM_NET_DEV(pAd, net_dev); - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; /*check if the interface is down */ if (!RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_INTERRUPT_IN_USE)) { diff --git a/drivers/staging/rt2860/usb_main_dev.c b/drivers/staging/rt2860/usb_main_dev.c index 4e387d57544..65b0fd71782 100644 --- a/drivers/staging/rt2860/usb_main_dev.c +++ b/drivers/staging/rt2860/usb_main_dev.c @@ -827,7 +827,7 @@ static int __devinit rt2870_probe(IN struct usb_interface *intf, ("rt2870_probe(): Allocate memory for os handle failed!\n"); return -ENOMEM; } - ((POS_COOKIE) handle)->pUsb_Dev = usb_dev; + ((struct os_cookie *)handle)->pUsb_Dev = usb_dev; rv = RTMPAllocAdapterBlock(handle, &pAd); if (rv != NDIS_STATUS_SUCCESS) { diff --git a/drivers/staging/rt2870/common/rtusb_bulk.c b/drivers/staging/rt2870/common/rtusb_bulk.c index b180f131442..d2e967b13a9 100644 --- a/drivers/staging/rt2870/common/rtusb_bulk.c +++ b/drivers/staging/rt2870/common/rtusb_bulk.c @@ -64,7 +64,7 @@ void RTUSBInitTxDesc(IN PRTMP_ADAPTER pAd, { PURB pUrb; u8 *pSrc = NULL; - POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; + struct os_cookie *pObj = (struct os_cookie *)pAd->OS_Cookie; pUrb = pTxContext->pUrb; ASSERT(pUrb); @@ -103,7 +103,7 @@ void RTUSBInitHTTxDesc(IN PRTMP_ADAPTER pAd, { PURB pUrb; u8 *pSrc = NULL; - POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; + struct os_cookie *pObj = (struct os_cookie *)pAd->OS_Cookie; pUrb = pTxContext->pUrb; ASSERT(pUrb); @@ -131,7 +131,7 @@ void RTUSBInitHTTxDesc(IN PRTMP_ADAPTER pAd, void RTUSBInitRxDesc(IN PRTMP_ADAPTER pAd, IN PRX_CONTEXT pRxContext) { PURB pUrb; - POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; + struct os_cookie *pObj = (struct os_cookie *)pAd->OS_Cookie; unsigned long RX_bulk_size; pUrb = pRxContext->pUrb; @@ -495,16 +495,16 @@ void RTUSBBulkOutDataPacket(IN PRTMP_ADAPTER pAd, } -void RTUSBBulkOutDataPacketComplete(purbb_t pUrb, struct pt_regs * pt_regs) +void RTUSBBulkOutDataPacketComplete(struct urb *pUrb, struct pt_regs * pt_regs) { PHT_TX_CONTEXT pHTTXContext; PRTMP_ADAPTER pAd; - POS_COOKIE pObj; + struct os_cookie *pObj; u8 BulkOutPipeId; pHTTXContext = (PHT_TX_CONTEXT) pUrb->context; pAd = pHTTXContext->pAd; - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; /* Store BulkOut PipeId */ BulkOutPipeId = pHTTXContext->BulkOutPipeId; @@ -589,18 +589,18 @@ void RTUSBBulkOutNullFrame(IN PRTMP_ADAPTER pAd) } /* NULL frame use BulkOutPipeId = 0 */ -void RTUSBBulkOutNullFrameComplete(purbb_t pUrb, struct pt_regs * pt_regs) +void RTUSBBulkOutNullFrameComplete(struct urb *pUrb, struct pt_regs * pt_regs) { PRTMP_ADAPTER pAd; PTX_CONTEXT pNullContext; int Status; - POS_COOKIE pObj; + struct os_cookie *pObj; pNullContext = (PTX_CONTEXT) pUrb->context; pAd = pNullContext->pAd; Status = pUrb->status; - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; pObj->null_frame_complete_task.data = (unsigned long)pUrb; tasklet_hi_schedule(&pObj->null_frame_complete_task); } @@ -684,18 +684,18 @@ void RTUSBBulkOutMLMEPacket(IN PRTMP_ADAPTER pAd, u8 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(struct urb *pUrb, struct pt_regs * pt_regs) { PTX_CONTEXT pMLMEContext; PRTMP_ADAPTER pAd; int Status; - POS_COOKIE pObj; + struct os_cookie *pObj; int index; /*DBGPRINT_RAW(RT_DEBUG_INFO, ("--->RTUSBBulkOutMLMEPacketComplete\n")); */ pMLMEContext = (PTX_CONTEXT) pUrb->context; pAd = pMLMEContext->pAd; - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; Status = pUrb->status; index = pMLMEContext->SelfIdx; @@ -758,18 +758,18 @@ void RTUSBBulkOutPsPoll(IN PRTMP_ADAPTER pAd) } /* PS-Poll frame use BulkOutPipeId = 0 */ -void RTUSBBulkOutPsPollComplete(purbb_t pUrb, struct pt_regs * pt_regs) +void RTUSBBulkOutPsPollComplete(struct urb *pUrb, struct pt_regs * pt_regs) { PRTMP_ADAPTER pAd; PTX_CONTEXT pPsPollContext; int Status; - POS_COOKIE pObj; + struct os_cookie *pObj; pPsPollContext = (PTX_CONTEXT) pUrb->context; pAd = pPsPollContext->pAd; Status = pUrb->status; - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; pObj->pspoll_frame_complete_task.data = (unsigned long)pUrb; tasklet_hi_schedule(&pObj->pspoll_frame_complete_task); } @@ -912,18 +912,18 @@ void RTUSBBulkReceive(IN PRTMP_ADAPTER pAd) Always returns STATUS_MORE_PROCESSING_REQUIRED ======================================================================== */ -void RTUSBBulkRxComplete(purbb_t pUrb, struct pt_regs *pt_regs) +void RTUSBBulkRxComplete(struct urb *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 */ /* use spin_lock_bh()/spin_unlock_bh() after IRQ is disabled. :< */ PRX_CONTEXT pRxContext; PRTMP_ADAPTER pAd; - POS_COOKIE pObj; + struct os_cookie *pObj; pRxContext = (PRX_CONTEXT) pUrb->context; pAd = pRxContext->pAd; - pObj = (POS_COOKIE) pAd->OS_Cookie; + pObj = (struct os_cookie *)pAd->OS_Cookie; pObj->rx_done_task.data = (unsigned long)pUrb; tasklet_hi_schedule(&pObj->rx_done_task); @@ -1146,7 +1146,7 @@ void RTUSBCancelPendingBulkOutIRP(IN PRTMP_ADAPTER pAd) PTX_CONTEXT pRTSContext; u32 i, Idx; /* unsigned int IrqFlags; */ -/* NDIS_SPIN_LOCK *pLock; */ +/* spinlock_t *pLock; */ /* BOOLEAN *pPending; */ /* pLock = &pAd->BulkOutLock[MGMTPIPEIDX]; */ diff --git a/drivers/staging/rt2870/common/rtusb_data.c b/drivers/staging/rt2870/common/rtusb_data.c index c58201ffde7..471fd4ead81 100644 --- a/drivers/staging/rt2870/common/rtusb_data.c +++ b/drivers/staging/rt2870/common/rtusb_data.c @@ -47,14 +47,14 @@ extern u8 EpToQueue[]; void REPORT_AMSDU_FRAMES_TO_LLC(IN PRTMP_ADAPTER pAd, u8 *pData, unsigned long DataSize) { - PNDIS_PACKET pPacket; + void *pPacket; u32 nMSDU; struct sk_buff *pSkb; nMSDU = 0; /* allocate a rx packet */ pSkb = dev_alloc_skb(RX_BUFFER_AGGRESIZE); - pPacket = (PNDIS_PACKET) OSPKT_TO_RTPKT(pSkb); + pPacket = (void *)OSPKT_TO_RTPKT(pSkb); if (pSkb) { /* convert 802.11 to 802.3 packet */ @@ -195,7 +195,7 @@ void RTUSBRejectPendingPackets(IN PRTMP_ADAPTER pAd) { u8 Index; PQUEUE_ENTRY pEntry; - PNDIS_PACKET pPacket; + void *pPacket; PQUEUE_HEADER pQueue; for (Index = 0; Index < 4; Index++) { diff --git a/drivers/staging/rt2870/common/rtusb_io.c b/drivers/staging/rt2870/common/rtusb_io.c index 861b6b15b04..d15a92eef04 100644 --- a/drivers/staging/rt2870/common/rtusb_io.c +++ b/drivers/staging/rt2870/common/rtusb_io.c @@ -843,7 +843,7 @@ int RTUSB_VendorRequest(IN PRTMP_ADAPTER pAd, u32 TransferBufferLength) { int ret = 0; - POS_COOKIE pObj = (POS_COOKIE) pAd->OS_Cookie; + struct os_cookie *pObj = (struct os_cookie *)pAd->OS_Cookie; if (RTMP_TEST_FLAG(pAd, fRTMP_ADAPTER_NIC_NOT_EXIST)) { DBGPRINT(RT_DEBUG_ERROR, ("device disconnected\n")); |