summaryrefslogtreecommitdiffstats
path: root/drivers/staging/rt2860/chip/mac_usb.h
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-12-11 12:23:14 -0800
committerGreg Kroah-Hartman <gregkh@suse.de>2009-12-11 12:23:14 -0800
commit52b81c89e564cdde8f2b4ccd0e314f04f8f23ab9 (patch)
treea748b608d37aed19749ab3b815b03e4806fed561 /drivers/staging/rt2860/chip/mac_usb.h
parent0f65bec15b2184dcf98dbdbf03187057de842eb5 (diff)
Staging: rt28x0: run *.h files through Lindent
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/rt2860/chip/mac_usb.h')
-rw-r--r--drivers/staging/rt2860/chip/mac_usb.h252
1 files changed, 117 insertions, 135 deletions
diff --git a/drivers/staging/rt2860/chip/mac_usb.h b/drivers/staging/rt2860/chip/mac_usb.h
index 5a858837742..8ce69697492 100644
--- a/drivers/staging/rt2860/chip/mac_usb.h
+++ b/drivers/staging/rt2860/chip/mac_usb.h
@@ -43,13 +43,12 @@
#include "../rtmp_iface.h"
#include "../rtmp_dot11.h"
-
#define USB_CYC_CFG 0x02a4
#define BEACON_RING_SIZE 2
#define MGMTPIPEIDX 0 // EP6 is highest priority
-#define RTMP_PKT_TAIL_PADDING 11 // 3(max 4 byte padding) + 4 (last packet padding) + 4 (MaxBulkOutsize align padding)
+#define RTMP_PKT_TAIL_PADDING 11 // 3(max 4 byte padding) + 4 (last packet padding) + 4 (MaxBulkOutsize align padding)
#define fRTMP_ADAPTER_NEED_STOP_TX \
(fRTMP_ADAPTER_NIC_NOT_EXIST | fRTMP_ADAPTER_HALT_IN_PROGRESS | \
@@ -62,157 +61,146 @@
#define RXINFO_SIZE 4
#define RT2870_RXDMALEN_FIELD_SIZE 4
-typedef struct PACKED _RXINFO_STRUC {
- UINT32 BA:1;
- UINT32 DATA:1;
- UINT32 NULLDATA:1;
- UINT32 FRAG:1;
- UINT32 U2M:1; // 1: this RX frame is unicast to me
- UINT32 Mcast:1; // 1: this is a multicast frame
- UINT32 Bcast:1; // 1: this is a broadcast frame
- UINT32 MyBss:1; // 1: this frame belongs to the same BSSID
- UINT32 Crc:1; // 1: CRC error
- UINT32 CipherErr:2; // 0: decryption okay, 1:ICV error, 2:MIC error, 3:KEY not valid
- UINT32 AMSDU:1; // rx with 802.3 header, not 802.11 header.
- UINT32 HTC:1;
- UINT32 RSSI:1;
- UINT32 L2PAD:1;
- UINT32 AMPDU:1; // To be moved
- UINT32 Decrypted:1;
- UINT32 PlcpRssil:1;
- UINT32 CipherAlg:1;
- UINT32 LastAMSDU:1;
- UINT32 PlcpSignal:12;
-} RXINFO_STRUC, *PRXINFO_STRUC, RT28XX_RXD_STRUC, *PRT28XX_RXD_STRUC;
-
+typedef struct PACKED _RXINFO_STRUC {
+ UINT32 BA:1;
+ UINT32 DATA:1;
+ UINT32 NULLDATA:1;
+ UINT32 FRAG:1;
+ UINT32 U2M:1; // 1: this RX frame is unicast to me
+ UINT32 Mcast:1; // 1: this is a multicast frame
+ UINT32 Bcast:1; // 1: this is a broadcast frame
+ UINT32 MyBss:1; // 1: this frame belongs to the same BSSID
+ UINT32 Crc:1; // 1: CRC error
+ UINT32 CipherErr:2; // 0: decryption okay, 1:ICV error, 2:MIC error, 3:KEY not valid
+ UINT32 AMSDU:1; // rx with 802.3 header, not 802.11 header.
+ UINT32 HTC:1;
+ UINT32 RSSI:1;
+ UINT32 L2PAD:1;
+ UINT32 AMPDU:1; // To be moved
+ UINT32 Decrypted:1;
+ UINT32 PlcpRssil:1;
+ UINT32 CipherAlg:1;
+ UINT32 LastAMSDU:1;
+ UINT32 PlcpSignal:12;
+} RXINFO_STRUC, *PRXINFO_STRUC, RT28XX_RXD_STRUC, *PRT28XX_RXD_STRUC;
//
// TXINFO
//
#define TXINFO_SIZE 4
-typedef struct _TXINFO_STRUC {
- // Word 0
- UINT32 USBDMATxPktLen:16; //used ONLY in USB bulk Aggregation, Total byte counts of all sub-frame.
- UINT32 rsv:8;
- UINT32 WIV:1; // Wireless Info Valid. 1 if Driver already fill WI, o if DMA needs to copy WI to correctposition
- UINT32 QSEL:2; // select on-chip FIFO ID for 2nd-stage output scheduler.0:MGMT, 1:HCCA 2:EDCA
- UINT32 SwUseLastRound:1; // Software use.
- UINT32 rsv2:2; // Software use.
- UINT32 USBDMANextVLD:1; //used ONLY in USB bulk Aggregation, NextValid
- UINT32 USBDMATxburst:1;//used ONLY in USB bulk Aggre. Force USB DMA transmit frame from current selected endpoint
-} TXINFO_STRUC, *PTXINFO_STRUC;
-
+typedef struct _TXINFO_STRUC {
+ // Word 0
+ UINT32 USBDMATxPktLen:16; //used ONLY in USB bulk Aggregation, Total byte counts of all sub-frame.
+ UINT32 rsv:8;
+ UINT32 WIV:1; // Wireless Info Valid. 1 if Driver already fill WI, o if DMA needs to copy WI to correctposition
+ UINT32 QSEL:2; // select on-chip FIFO ID for 2nd-stage output scheduler.0:MGMT, 1:HCCA 2:EDCA
+ UINT32 SwUseLastRound:1; // Software use.
+ UINT32 rsv2:2; // Software use.
+ UINT32 USBDMANextVLD:1; //used ONLY in USB bulk Aggregation, NextValid
+ UINT32 USBDMATxburst:1; //used ONLY in USB bulk Aggre. Force USB DMA transmit frame from current selected endpoint
+} TXINFO_STRUC, *PTXINFO_STRUC;
//
// Management ring buffer format
//
-typedef struct _MGMT_STRUC {
- BOOLEAN Valid;
- PUCHAR pBuffer;
- ULONG Length;
-} MGMT_STRUC, *PMGMT_STRUC;
-
+typedef struct _MGMT_STRUC {
+ BOOLEAN Valid;
+ PUCHAR pBuffer;
+ ULONG Length;
+} MGMT_STRUC, *PMGMT_STRUC;
////////////////////////////////////////////////////////////////////////////
// The TX_BUFFER structure forms the transmitted USB packet to the device
////////////////////////////////////////////////////////////////////////////
-typedef struct __TX_BUFFER{
- union{
- UCHAR WirelessPacket[TX_BUFFER_NORMSIZE];
- HEADER_802_11 NullFrame;
- PSPOLL_FRAME PsPollPacket;
- RTS_FRAME RTSFrame;
- }field;
- UCHAR Aggregation[4]; //Buffer for save Aggregation size.
+typedef struct __TX_BUFFER {
+ union {
+ UCHAR WirelessPacket[TX_BUFFER_NORMSIZE];
+ HEADER_802_11 NullFrame;
+ PSPOLL_FRAME PsPollPacket;
+ RTS_FRAME RTSFrame;
+ } field;
+ UCHAR Aggregation[4]; //Buffer for save Aggregation size.
} TX_BUFFER, *PTX_BUFFER;
-typedef struct __HTTX_BUFFER{
- union{
- UCHAR WirelessPacket[MAX_TXBULK_SIZE];
- HEADER_802_11 NullFrame;
- PSPOLL_FRAME PsPollPacket;
- RTS_FRAME RTSFrame;
- }field;
- UCHAR Aggregation[4]; //Buffer for save Aggregation size.
+typedef struct __HTTX_BUFFER {
+ union {
+ UCHAR WirelessPacket[MAX_TXBULK_SIZE];
+ HEADER_802_11 NullFrame;
+ PSPOLL_FRAME PsPollPacket;
+ RTS_FRAME RTSFrame;
+ } field;
+ UCHAR Aggregation[4]; //Buffer for save Aggregation size.
} HTTX_BUFFER, *PHTTX_BUFFER;
-
// used to track driver-generated write irps
-typedef struct _TX_CONTEXT
-{
- PVOID pAd; //Initialized in MiniportInitialize
- PURB pUrb; //Initialized in MiniportInitialize
- PIRP pIrp; //used to cancel pending bulk out.
- //Initialized in MiniportInitialize
- PTX_BUFFER TransferBuffer; //Initialized in MiniportInitialize
- ULONG BulkOutSize;
- UCHAR BulkOutPipeId;
- UCHAR SelfIdx;
- BOOLEAN InUse;
- BOOLEAN bWaitingBulkOut; // at least one packet is in this TxContext, ready for making IRP anytime.
- BOOLEAN bFullForBulkOut; // all tx buffer are full , so waiting for tx bulkout.
- BOOLEAN IRPPending;
- BOOLEAN LastOne;
- BOOLEAN bAggregatible;
- UCHAR Header_802_3[LENGTH_802_3];
- UCHAR Rsv[2];
- ULONG DataOffset;
- UINT TxRate;
- dma_addr_t data_dma; // urb dma on linux
-
-} TX_CONTEXT, *PTX_CONTEXT, **PPTX_CONTEXT;
-
+typedef struct _TX_CONTEXT {
+ PVOID pAd; //Initialized in MiniportInitialize
+ PURB pUrb; //Initialized in MiniportInitialize
+ PIRP pIrp; //used to cancel pending bulk out.
+ //Initialized in MiniportInitialize
+ PTX_BUFFER TransferBuffer; //Initialized in MiniportInitialize
+ ULONG BulkOutSize;
+ UCHAR BulkOutPipeId;
+ UCHAR SelfIdx;
+ BOOLEAN InUse;
+ BOOLEAN bWaitingBulkOut; // at least one packet is in this TxContext, ready for making IRP anytime.
+ BOOLEAN bFullForBulkOut; // all tx buffer are full , so waiting for tx bulkout.
+ BOOLEAN IRPPending;
+ BOOLEAN LastOne;
+ BOOLEAN bAggregatible;
+ UCHAR Header_802_3[LENGTH_802_3];
+ UCHAR Rsv[2];
+ ULONG DataOffset;
+ UINT TxRate;
+ dma_addr_t data_dma; // urb dma on linux
+
+} TX_CONTEXT, *PTX_CONTEXT, **PPTX_CONTEXT;
// used to track driver-generated write irps
-typedef struct _HT_TX_CONTEXT
-{
- PVOID pAd; //Initialized in MiniportInitialize
- PURB pUrb; //Initialized in MiniportInitialize
- PIRP pIrp; //used to cancel pending bulk out.
- //Initialized in MiniportInitialize
- PHTTX_BUFFER TransferBuffer; //Initialized in MiniportInitialize
- ULONG BulkOutSize; // Indicate the total bulk-out size in bytes in one bulk-transmission
- UCHAR BulkOutPipeId;
- BOOLEAN IRPPending;
- BOOLEAN LastOne;
- BOOLEAN bCurWriting;
- BOOLEAN bRingEmpty;
- BOOLEAN bCopySavePad;
- UCHAR SavedPad[8];
- UCHAR Header_802_3[LENGTH_802_3];
- ULONG CurWritePosition; // Indicate the buffer offset which packet will be inserted start from.
- ULONG CurWriteRealPos; // Indicate the buffer offset which packet now are writing to.
- ULONG NextBulkOutPosition; // Indicate the buffer start offset of a bulk-transmission
- ULONG ENextBulkOutPosition; // Indicate the buffer end offset of a bulk-transmission
- UINT TxRate;
- dma_addr_t data_dma; // urb dma on linux
-} HT_TX_CONTEXT, *PHT_TX_CONTEXT, **PPHT_TX_CONTEXT;
-
+typedef struct _HT_TX_CONTEXT {
+ PVOID pAd; //Initialized in MiniportInitialize
+ PURB pUrb; //Initialized in MiniportInitialize
+ PIRP pIrp; //used to cancel pending bulk out.
+ //Initialized in MiniportInitialize
+ PHTTX_BUFFER TransferBuffer; //Initialized in MiniportInitialize
+ ULONG BulkOutSize; // Indicate the total bulk-out size in bytes in one bulk-transmission
+ UCHAR BulkOutPipeId;
+ BOOLEAN IRPPending;
+ BOOLEAN LastOne;
+ BOOLEAN bCurWriting;
+ BOOLEAN bRingEmpty;
+ BOOLEAN bCopySavePad;
+ UCHAR SavedPad[8];
+ UCHAR Header_802_3[LENGTH_802_3];
+ ULONG CurWritePosition; // Indicate the buffer offset which packet will be inserted start from.
+ ULONG CurWriteRealPos; // Indicate the buffer offset which packet now are writing to.
+ ULONG NextBulkOutPosition; // Indicate the buffer start offset of a bulk-transmission
+ ULONG ENextBulkOutPosition; // Indicate the buffer end offset of a bulk-transmission
+ UINT TxRate;
+ dma_addr_t data_dma; // urb dma on linux
+} HT_TX_CONTEXT, *PHT_TX_CONTEXT, **PPHT_TX_CONTEXT;
//
// Structure to keep track of receive packets and buffers to indicate
// receive data to the protocol.
//
-typedef struct _RX_CONTEXT
-{
- PUCHAR TransferBuffer;
- PVOID pAd;
- PIRP pIrp;//used to cancel pending bulk in.
- PURB pUrb;
+typedef struct _RX_CONTEXT {
+ PUCHAR TransferBuffer;
+ PVOID pAd;
+ PIRP pIrp; //used to cancel pending bulk in.
+ PURB pUrb;
//These 2 Boolean shouldn't both be 1 at the same time.
- ULONG BulkInOffset; // number of packets waiting for reordering .
-// BOOLEAN ReorderInUse; // At least one packet in this buffer are in reordering buffer and wait for receive indication
- BOOLEAN bRxHandling; // Notify this packet is being process now.
- BOOLEAN InUse; // USB Hardware Occupied. Wait for USB HW to put packet.
- 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;
- dma_addr_t data_dma; // urb dma on linux
-} RX_CONTEXT, *PRX_CONTEXT;
-
-
+ ULONG BulkInOffset; // number of packets waiting for reordering .
+// BOOLEAN ReorderInUse; // At least one packet in this buffer are in reordering buffer and wait for receive indication
+ BOOLEAN bRxHandling; // Notify this packet is being process now.
+ BOOLEAN InUse; // USB Hardware Occupied. Wait for USB HW to put packet.
+ 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;
+ dma_addr_t data_dma; // urb dma on linux
+} RX_CONTEXT, *PRX_CONTEXT;
/******************************************************************************
@@ -221,13 +209,11 @@ typedef struct _RX_CONTEXT
******************************************************************************/
// 8051 firmware image for usb - use last-half base address = 0x3000
#define FIRMWARE_IMAGE_BASE 0x3000
-#define MAX_FIRMWARE_IMAGE_SIZE 0x1000 // 4kbyte
+#define MAX_FIRMWARE_IMAGE_SIZE 0x1000 // 4kbyte
#define RTMP_WRITE_FIRMWARE(_pAd, _pFwImage, _FwLen) \
RTUSBFirmwareWrite(_pAd, _pFwImage, _FwLen)
-
-
/******************************************************************************
USB TX Related MACRO
@@ -281,7 +267,7 @@ typedef struct _RX_CONTEXT
RtmpUSB_FinalWriteTxResource(pAd, pTxBlk, totalMPDUSize, TxIdx)
#define HAL_LastTxIdx(pAd, QueIdx,TxIdx) \
- /*RtmpUSBDataLastTxIdx(pAd, QueIdx,TxIdx)*/
+ /*RtmpUSBDataLastTxIdx(pAd, QueIdx,TxIdx) */
#define HAL_KickOutTx(pAd, pTxBlk, QueIdx) \
RtmpUSBDataKickOut(pAd, pTxBlk, QueIdx)
@@ -292,20 +278,17 @@ typedef struct _RX_CONTEXT
#define HAL_KickOutNullFrameTx(_pAd, _QueIdx, _pNullFrame, _frameLen) \
RtmpUSBNullFrameKickOut(_pAd, _QueIdx, _pNullFrame, _frameLen)
-#define GET_TXRING_FREENO(_pAd, _QueIdx) (_QueIdx) //(_pAd->TxRing[_QueIdx].TxSwFreeIdx)
+#define GET_TXRING_FREENO(_pAd, _QueIdx) (_QueIdx) //(_pAd->TxRing[_QueIdx].TxSwFreeIdx)
#define GET_MGMTRING_FREENO(_pAd) (_pAd->MgmtRing.TxSwFreeIdx)
-
/* ----------------- RX Related MACRO ----------------- */
-
/*
* Device Hardware Interface Related MACRO
*/
#define RTMP_IRQ_INIT(pAd) do{}while(0)
#define RTMP_IRQ_ENABLE(pAd) do{}while(0)
-
/*
* MLME Related MACRO
*/
@@ -330,7 +313,6 @@ typedef struct _RX_CONTEXT
RTUSBMlmeUp(_pAd); \
}
-
/*
* Power Save Related MACRO
*/