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>
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;
void Announce_Reordering_Packet(IN PRTMP_ADAPTER pAd,
IN struct reordering_mpdu *mpdu)
{
- PNDIS_PACKET pPacket;
+ void *pPacket;
pPacket = mpdu->pPacket;
u8
FromWhichBSSID)
{
- PNDIS_PACKET pRxPkt;
+ void *pRxPkt;
u8 Header802_3[LENGTH_802_3];
/* 1. get 802.3 Header */
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]; */
========================================================================
*/
int MlmeHardTransmit(IN PRTMP_ADAPTER pAd,
- u8 QueIdx, IN PNDIS_PACKET pPacket)
+ u8 QueIdx, void *pPacket)
{
PACKET_INFO PacketInfo;
u8 *pSrcBufVA;
}
int MlmeHardTransmitMgmtRing(IN PRTMP_ADAPTER pAd,
- u8 QueIdx, IN PNDIS_PACKET pPacket)
+ u8 QueIdx, void *pPacket)
{
PACKET_INFO PacketInfo;
u8 *pSrcBufVA;
(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;
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;
}
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)); */
u8 Max_Tx_Packets)
{
PQUEUE_ENTRY pEntry = NULL;
- PNDIS_PACKET pPacket;
+ void *pPacket;
int Status = NDIS_STATUS_SUCCESS;
u8 Count = 0;
PQUEUE_HEADER pQueue;
}
u32 deaggregate_AMSDU_announce(IN PRTMP_ADAPTER pAd,
- PNDIS_PACKET pPacket,
+ void *pPacket,
u8 *pData, unsigned long DataSize)
{
u16 PayloadSize;
u8 Header802_3[14];
u8 *pPayload, *pDA, *pSA, *pRemovedLLCSNAP;
- PNDIS_PACKET pClonePacket;
+ void *pClonePacket;
nMSDU = 0;
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;
========================================================================
*/
-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;
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;
*/
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);
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);
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 */
u16 Msdu2Size;
u16 Payload1Size, Payload2Size;
u8 *pData2;
- PNDIS_PACKET pPacket2 = NULL;
+ void *pPacket2 = NULL;
Msdu2Size = *(pRxBlk->pData) + (*(pRxBlk->pData + 1) << 8);
_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;
/* 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 =
*/
int RtmpPCIMgmtKickOut(IN RTMP_ADAPTER * pAd,
u8 QueIdx,
- IN PNDIS_PACKET pPacket,
+ void *pPacket,
u8 *pSrcBufVA, u32 SrcBufLen)
{
PTXD_STRUC pTxD;
{
PRTMP_TX_RING pTxRing;
PTXD_STRUC pTxD;
- PNDIS_PACKET pPacket;
+ void *pPacket;
u8 FREE = 0;
TXD_STRUC TxD, *pOriTxD;
/*unsigned long IrqFlags; */
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;
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;
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 */
}
int MlmeHardTransmitTxRing(IN PRTMP_ADAPTER pAd,
- u8 QueIdx, IN PNDIS_PACKET pPacket)
+ u8 QueIdx, void *pPacket)
{
PACKET_INFO PacketInfo;
u8 *pSrcBufVA;
}
int MlmeDataHardTransmit(IN PRTMP_ADAPTER pAd,
- u8 QueIdx, IN PNDIS_PACKET pPacket)
+ u8 QueIdx, void *pPacket)
{
if ((pAd->CommonCfg.RadarDetect.RDMode != RD_NORMAL_MODE)
) {
*/
int RtmpUSBMgmtKickOut(IN RTMP_ADAPTER * pAd,
u8 QueIdx,
- IN PNDIS_PACKET pPacket,
+ void *pPacket,
u8 *pSrcBufVA, u32 SrcBufLen)
{
PTXINFO_STRUC pTxInfo;
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;
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"));
PTXD_STRUC pTxD;
PRXD_STRUC pRxD;
PQUEUE_ENTRY pEntry;
- PNDIS_PACKET pPacket;
+ void *pPacket;
int i;
PRTMP_TX_RING pTxRing;
unsigned long IrqFlags;
{
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);
}
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);
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,
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,
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);
{
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;
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;
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"));
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
========================================================================
*/
void RTMPCalculateMICValue(IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket,
+ void *pPacket,
u8 *pEncap,
IN PCIPHER_KEY pKey, u8 apidx)
{
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:
u32 HdrLen,
u8 *pData, u32 DataLen, IN BOOLEAN bClearFrame)
{
- PNDIS_PACKET pPacket;
+ void *pPacket;
int Status;
if ((!pEntry) || ((!pEntry->ValidAsCLI) && (!pEntry->ValidAsApCli)))
========================================================================
*/
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));
}
/* 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;
#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
#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; \
#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];
#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
#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) \
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;
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();
}
/* 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"));
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)
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; */
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;
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;
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;
{
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;
{
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;
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",
};
/* 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);
/* 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);
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))
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)) {
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;
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)
*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)
{
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);
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
*/
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;
/* 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;
/*
========================================================================
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));
}
/* 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)
{
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);
*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);
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);
}
}
-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;
}
-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) {
}
#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;
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;
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;
}
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);
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;
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,
#endif
}
-int RtmpOSIRQRelease(IN PNET_DEV pNetDev)
+int RtmpOSIRQRelease(struct net_device *pNetDev)
{
struct net_device *net_dev = pNetDev;
PRTMP_ADAPTER pAd = NULL;
#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);
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;
-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) {
}
}
-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);
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;
* 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;
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;
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
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 */
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;
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)
/***********************************************************************************
* 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);
/***********************************************************************************
* OS file operation related data structure definitions
***********************************************************************************/
-typedef struct file *RTMP_OS_FD;
-
typedef struct _RTMP_OS_FS_INFO_ {
int fsuid;
int fsgid;
unsigned long flags;
};
-typedef spinlock_t NDIS_SPIN_LOCK;
-
/* */
/* spin_lock enhanced for Nested spin lock */
/* */
***********************************************************************************/
#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) \
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 */
int ioctl_if;
};
-typedef struct os_cookie *POS_COOKIE;
-
/***********************************************************************************
* OS debugging and printing related definitions and data structure
***********************************************************************************/
/*
* 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) \
/*
* void
* RTMP_SetPhysicalAddressHigh(
- * IN NDIS_PHYSICAL_ADDRESS PhysicalAddress,
+ * dma_addr_t PhysicalAddress,
* unsigned long Value);
*/
#define RTMP_SetPhysicalAddressHigh(PhysicalAddress, Value)
#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)
* 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)
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);
(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;
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);
.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;
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);
}
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:
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;
}
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 */
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,
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,
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,
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);
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,
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);
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,
* 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;
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),
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,
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);
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 */
(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;
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 */
(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);
{
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 */
(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);
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. */
(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;
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. */
(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;
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. */
(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;
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. */
(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;
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);
int sd_idx, int direction)
{
PRTMP_ADAPTER pAd;
- POS_COOKIE pObj;
+ struct os_cookie *pObj;
/*
------ Porting Information ------
*/
pAd = (PRTMP_ADAPTER) handle;
- pObj = (POS_COOKIE) pAd->OS_Cookie;
+ pObj = (struct os_cookie *)pAd->OS_Cookie;
if (sd_idx == 1) {
PTX_BLK pTxBlk;
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);
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 */
{
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;
{
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;
{
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;
*/
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;
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;
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;
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;
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;
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;
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);
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);
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;
* Fragment Frame structure
*/
typedef struct _FRAGMENT_FRAME {
- PNDIS_PACKET pFragPacket;
+ void *pFragPacket;
unsigned long RxSize;
u16 Sequence;
u16 LastFrag;
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;
/* */
unsigned long LastSendNULLpsmTime;
BOOLEAN bRunning;
- NDIS_SPIN_LOCK TaskLock;
+ spinlock_t TaskLock;
MLME_QUEUE Queue;
u32 ShiftReg;
**************************************************************************/
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;
};
struct reordering_mpdu_pool {
void *mem;
- NDIS_SPIN_LOCK lock;
+ spinlock_t lock;
struct reordering_list freelist;
};
/* 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;
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 */
/* */
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;
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
/*======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 // */
#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 // */
/* 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 */
/* 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 */
#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. */
/*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 */
RT28XX_RXD_STRUC RxD;
PRXWI_STRUC pRxWI;
PHEADER_802_11 pHeader;
- PNDIS_PACKET pRxPacket;
+ void *pRxPacket;
u8 *pData;
u16 DataSize;
u16 Flags;
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 */
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);
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,
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);
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 */
u8 UserPriority, u32 Len);
void RTMPCalculateMICValue(IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket,
+ void *pPacket,
u8 *pEncap,
IN PCIPHER_KEY pKey, u8 apidx);
/*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);
unsigned long Length,
IN BOOLEAN Cached,
void ** VirtualAddress,
- OUT PNDIS_PHYSICAL_ADDRESS PhysicalAddress);
+ dma_addr_t *PhysicalAddress);
void RTMPFreeTxRxRingMemory(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,
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,
}
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 */
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,
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);
int RtmpPCIMgmtKickOut(IN RTMP_ADAPTER * pAd,
u8 QueIdx,
- IN PNDIS_PACKET pPacket,
+ void *pPacket,
u8 *pSrcBufVA, u32 SrcBufLen);
int RTMPCheckRxError(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,
int RtmpUSBMgmtKickOut(IN RTMP_ADAPTER * pAd,
u8 QueIdx,
- IN PNDIS_PACKET pPacket,
+ void *pPacket,
u8 *pSrcBufVA, u32 SrcBufLen);
void RtmpUSBNullFrameKickOut(IN RTMP_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--)
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);
/*
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__ */
/*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;
#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__ // */
#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 */
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;
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 {
{
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:
RT28XX_RXD_STRUC *pRxD;
u8 *pData;
PRXWI_STRUC pRxWI;
- PNDIS_PACKET pRxPacket;
+ void *pRxPacket;
PHEADER_802_11 pHeader;
RX_BLK RxCell;
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:
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++) {
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;
{
u8 *pHeaderBufPtr;
HEADER_802_11 *pHeader_802_11;
- PNDIS_PACKET pNextPacket;
+ void *pNextPacket;
u32 nextBufLen;
PQUEUE_ENTRY pQEntry;
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:
int STAHardTransmit(IN PRTMP_ADAPTER pAd,
IN TX_BLK * pTxBlk, u8 QueIdx)
{
- NDIS_PACKET *pPacket;
+ char *pPacket;
PQUEUE_ENTRY pQEntry;
/* --------------------------------------------- */
}
void Sta_Announce_or_Forward_802_3_Packet(IN PRTMP_ADAPTER pAd,
- IN PNDIS_PACKET pPacket,
+ void *pPacket,
u8 FromWhichBSSID)
{
if (TRUE) {
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;
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)) {
("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) {
{
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);
{
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);
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;
}
-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;
}
/* 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);
}
/* 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;
}
/* 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);
}
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);
PTX_CONTEXT pRTSContext;
u32 i, Idx;
/* unsigned int IrqFlags; */
-/* NDIS_SPIN_LOCK *pLock; */
+/* spinlock_t *pLock; */
/* BOOLEAN *pPending; */
/* pLock = &pAd->BulkOutLock[MGMTPIPEIDX]; */
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 */
{
u8 Index;
PQUEUE_ENTRY pEntry;
- PNDIS_PACKET pPacket;
+ void *pPacket;
PQUEUE_HEADER pQueue;
for (Index = 0; Index < 4; Index++) {
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"));