提交 bc36e655 编写于 作者: J J.R. Mauro 提交者: Greg Kroah-Hartman

Staging: Clean up sxg driver

Lindent the rest of the files in drivers/staging/sxg

Signed off by: J.R. Mauro <jrm8005@gmail.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 2ae5a6d2
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
#define FALSE (0) #define FALSE (0)
#define TRUE (1) #define TRUE (1)
typedef struct _LIST_ENTRY { typedef struct _LIST_ENTRY {
struct _LIST_ENTRY *nle_flink; struct _LIST_ENTRY *nle_flink;
struct _LIST_ENTRY *nle_blink; struct _LIST_ENTRY *nle_blink;
...@@ -69,8 +68,7 @@ typedef struct _LIST_ENTRY { ...@@ -69,8 +68,7 @@ typedef struct _LIST_ENTRY {
/* These two have to be inlined since they return things. */ /* These two have to be inlined since they return things. */
static __inline PLIST_ENTRY static __inline PLIST_ENTRY RemoveHeadList(list_entry * l)
RemoveHeadList(list_entry *l)
{ {
list_entry *f; list_entry *f;
list_entry *e; list_entry *e;
...@@ -83,8 +81,7 @@ RemoveHeadList(list_entry *l) ...@@ -83,8 +81,7 @@ RemoveHeadList(list_entry *l)
return (e); return (e);
} }
static __inline PLIST_ENTRY static __inline PLIST_ENTRY RemoveTailList(list_entry * l)
RemoveTailList(list_entry *l)
{ {
list_entry *b; list_entry *b;
list_entry *e; list_entry *e;
...@@ -97,7 +94,6 @@ RemoveTailList(list_entry *l) ...@@ -97,7 +94,6 @@ RemoveTailList(list_entry *l)
return (e); return (e);
} }
#define InsertTailList(l, e) \ #define InsertTailList(l, e) \
do { \ do { \
list_entry *b; \ list_entry *b; \
...@@ -120,7 +116,6 @@ RemoveTailList(list_entry *l) ...@@ -120,7 +116,6 @@ RemoveTailList(list_entry *l)
(l)->nle_flink = (e); \ (l)->nle_flink = (e); \
} while (0) } while (0)
#define ATK_DEBUG 1 #define ATK_DEBUG 1
#if ATK_DEBUG #if ATK_DEBUG
...@@ -133,7 +128,6 @@ RemoveTailList(list_entry *l) ...@@ -133,7 +128,6 @@ RemoveTailList(list_entry *l)
#define SLIC_TIMESTAMP(value) #define SLIC_TIMESTAMP(value)
#endif #endif
/****************** SXG DEFINES *****************************************/ /****************** SXG DEFINES *****************************************/
#ifdef ATKDBG #ifdef ATKDBG
...@@ -151,4 +145,3 @@ RemoveTailList(list_entry *l) ...@@ -151,4 +145,3 @@ RemoveTailList(list_entry *l)
#define READ_REG(reg,value) (value) = readl((void __iomem *)(&reg)) #define READ_REG(reg,value) (value) = readl((void __iomem *)(&reg))
#endif /* _SLIC_OS_SPECIFIC_H_ */ #endif /* _SLIC_OS_SPECIFIC_H_ */
...@@ -277,7 +277,7 @@ typedef struct _SXG_EVENT { ...@@ -277,7 +277,7 @@ typedef struct _SXG_EVENT {
u32 SndUna; // SndUna value u32 SndUna; // SndUna value
u32 Resid; // receive MDL resid u32 Resid; // receive MDL resid
union { union {
void * HostHandle; // Receive host handle void *HostHandle; // Receive host handle
u32 Rsvd1; // TOE NA u32 Rsvd1; // TOE NA
struct { struct {
u32 NotUsed; u32 NotUsed;
...@@ -323,7 +323,7 @@ typedef struct _SXG_EVENT { ...@@ -323,7 +323,7 @@ typedef struct _SXG_EVENT {
typedef struct _SXG_EVENT_RING { typedef struct _SXG_EVENT_RING {
SXG_EVENT Ring[EVENT_RING_SIZE]; SXG_EVENT Ring[EVENT_RING_SIZE];
}SXG_EVENT_RING, *PSXG_EVENT_RING; } SXG_EVENT_RING, *PSXG_EVENT_RING;
/*************************************************************************** /***************************************************************************
* *
...@@ -368,7 +368,6 @@ typedef struct _SXG_EVENT_RING { ...@@ -368,7 +368,6 @@ typedef struct _SXG_EVENT_RING {
&(_TcpObject)->CompBuffer->Frame.HasVlan.TcpIp6.Ip : \ &(_TcpObject)->CompBuffer->Frame.HasVlan.TcpIp6.Ip : \
&(_TcpObject)->CompBuffer->Frame.NoVlan.TcpIp6.Ip &(_TcpObject)->CompBuffer->Frame.NoVlan.TcpIp6.Ip
#if DBG #if DBG
// Horrible kludge to distinguish dumb-nic, slowpath, and // Horrible kludge to distinguish dumb-nic, slowpath, and
// fastpath traffic. Decrement the HopLimit by one // fastpath traffic. Decrement the HopLimit by one
...@@ -405,7 +404,7 @@ typedef struct _SXG_RING_INFO { ...@@ -405,7 +404,7 @@ typedef struct _SXG_RING_INFO {
unsigned char Head; // Where we add entries - Note unsigned char:RING_SIZE unsigned char Head; // Where we add entries - Note unsigned char:RING_SIZE
unsigned char Tail; // Where we pull off completed entries unsigned char Tail; // Where we pull off completed entries
ushort Size; // Ring size - Must be multiple of 2 ushort Size; // Ring size - Must be multiple of 2
void * Context[SXG_MAX_RING_SIZE]; // Shadow ring void *Context[SXG_MAX_RING_SIZE]; // Shadow ring
} SXG_RING_INFO, *PSXG_RING_INFO; } SXG_RING_INFO, *PSXG_RING_INFO;
#define SXG_INITIALIZE_RING(_ring, _size) { \ #define SXG_INITIALIZE_RING(_ring, _size) { \
...@@ -486,7 +485,7 @@ typedef struct _SXG_CMD { ...@@ -486,7 +485,7 @@ typedef struct _SXG_CMD {
dma_addr_t Sgl; // Physical address of SGL dma_addr_t Sgl; // Physical address of SGL
union { union {
struct { struct {
dma64_addr_t FirstSgeAddress;// Address of first SGE dma64_addr_t FirstSgeAddress; // Address of first SGE
u32 FirstSgeLength; // Length of first SGE u32 FirstSgeLength; // Length of first SGE
union { union {
u32 Rsvd1; // TOE NA u32 Rsvd1; // TOE NA
...@@ -682,7 +681,7 @@ typedef struct _SXG_RCV_DATA_BUFFER_HDR { ...@@ -682,7 +681,7 @@ typedef struct _SXG_RCV_DATA_BUFFER_HDR {
u32 ByteOffset; // See SXG_RESTORE_MDL_OFFSET u32 ByteOffset; // See SXG_RESTORE_MDL_OFFSET
unsigned char State; // See SXG_BUFFER state above unsigned char State; // See SXG_BUFFER state above
unsigned char Status; // Event status (to log PUSH) unsigned char Status; // Event status (to log PUSH)
struct sk_buff * skb; // Double mapped (nbl and pkt) struct sk_buff *skb; // Double mapped (nbl and pkt)
} SXG_RCV_DATA_BUFFER_HDR, *PSXG_RCV_DATA_BUFFER_HDR; } SXG_RCV_DATA_BUFFER_HDR, *PSXG_RCV_DATA_BUFFER_HDR;
// SxgSlowReceive uses the PACKET (skb) contained // SxgSlowReceive uses the PACKET (skb) contained
...@@ -696,7 +695,7 @@ typedef struct _SXG_RCV_DATA_BUFFER_HDR { ...@@ -696,7 +695,7 @@ typedef struct _SXG_RCV_DATA_BUFFER_HDR {
// Receive data descriptor // Receive data descriptor
typedef struct _SXG_RCV_DATA_DESCRIPTOR { typedef struct _SXG_RCV_DATA_DESCRIPTOR {
union { union {
struct sk_buff * VirtualAddress; // Host handle struct sk_buff *VirtualAddress; // Host handle
u64 ForceTo8Bytes; // Force x86 to 8-byte boundary u64 ForceTo8Bytes; // Force x86 to 8-byte boundary
}; };
dma_addr_t PhysicalAddress; dma_addr_t PhysicalAddress;
...@@ -711,7 +710,7 @@ typedef struct _SXG_RCV_DESCRIPTOR_BLOCK { ...@@ -711,7 +710,7 @@ typedef struct _SXG_RCV_DESCRIPTOR_BLOCK {
// Receive descriptor block header // Receive descriptor block header
typedef struct _SXG_RCV_DESCRIPTOR_BLOCK_HDR { typedef struct _SXG_RCV_DESCRIPTOR_BLOCK_HDR {
void * VirtualAddress; // Start of 2k buffer void *VirtualAddress; // Start of 2k buffer
dma_addr_t PhysicalAddress; // ..and it's physical address dma_addr_t PhysicalAddress; // ..and it's physical address
LIST_ENTRY FreeList; // Free queue of descriptor blocks LIST_ENTRY FreeList; // Free queue of descriptor blocks
unsigned char State; // See SXG_BUFFER state above unsigned char State; // See SXG_BUFFER state above
...@@ -719,7 +718,7 @@ typedef struct _SXG_RCV_DESCRIPTOR_BLOCK_HDR { ...@@ -719,7 +718,7 @@ typedef struct _SXG_RCV_DESCRIPTOR_BLOCK_HDR {
// Receive block header // Receive block header
typedef struct _SXG_RCV_BLOCK_HDR { typedef struct _SXG_RCV_BLOCK_HDR {
void * VirtualAddress; // Start of virtual memory void *VirtualAddress; // Start of virtual memory
dma_addr_t PhysicalAddress; // ..and it's physical address dma_addr_t PhysicalAddress; // ..and it's physical address
LIST_ENTRY AllList; // Queue of all SXG_RCV_BLOCKS LIST_ENTRY AllList; // Queue of all SXG_RCV_BLOCKS
} SXG_RCV_BLOCK_HDR, *PSXG_RCV_BLOCK_HDR; } SXG_RCV_BLOCK_HDR, *PSXG_RCV_BLOCK_HDR;
...@@ -748,7 +747,7 @@ typedef struct _SXG_RCV_BLOCK_HDR { ...@@ -748,7 +747,7 @@ typedef struct _SXG_RCV_BLOCK_HDR {
// our SXG_RCV_DATA_BUFFER_HDR structure. // our SXG_RCV_DATA_BUFFER_HDR structure.
typedef struct _SXG_RCV_NBL_RESERVED { typedef struct _SXG_RCV_NBL_RESERVED {
PSXG_RCV_DATA_BUFFER_HDR RcvDataBufferHdr; PSXG_RCV_DATA_BUFFER_HDR RcvDataBufferHdr;
void * Available; void *Available;
} SXG_RCV_NBL_RESERVED, *PSXG_RCV_NBL_RESERVED; } SXG_RCV_NBL_RESERVED, *PSXG_RCV_NBL_RESERVED;
#define SXG_RCV_NBL_BUFFER_HDR(_NBL) (((PSXG_RCV_NBL_RESERVED)NET_BUFFER_LIST_MINIPORT_RESERVED(_NBL))->RcvDataBufferHdr) #define SXG_RCV_NBL_BUFFER_HDR(_NBL) (((PSXG_RCV_NBL_RESERVED)NET_BUFFER_LIST_MINIPORT_RESERVED(_NBL))->RcvDataBufferHdr)
...@@ -760,7 +759,6 @@ typedef struct _SXG_RCV_NBL_RESERVED { ...@@ -760,7 +759,6 @@ typedef struct _SXG_RCV_NBL_RESERVED {
#define SXG_MIN_SGL_BUFFERS 2048 // Minimum amount and when to get more #define SXG_MIN_SGL_BUFFERS 2048 // Minimum amount and when to get more
#define SXG_MAX_SGL_BUFFERS 16384 // Maximum to allocate (note ADAPT:ushort) #define SXG_MAX_SGL_BUFFERS 16384 // Maximum to allocate (note ADAPT:ushort)
// Self identifying structure type // Self identifying structure type
typedef enum _SXG_SGL_TYPE { typedef enum _SXG_SGL_TYPE {
SXG_SGL_DUMB, // Dumb NIC SGL SXG_SGL_DUMB, // Dumb NIC SGL
...@@ -803,21 +801,20 @@ typedef enum _SXG_SGL_TYPE { ...@@ -803,21 +801,20 @@ typedef enum _SXG_SGL_TYPE {
typedef struct _SXG_X64_SGE { typedef struct _SXG_X64_SGE {
dma64_addr_t Address; // same as wdm.h dma64_addr_t Address; // same as wdm.h
u32 Length; // same as wdm.h u32 Length; // same as wdm.h
u32 CompilerPad;// The compiler pads to 8-bytes u32 CompilerPad; // The compiler pads to 8-bytes
u64 Reserved; // u32 * in wdm.h. Force to 8 bytes u64 Reserved; // u32 * in wdm.h. Force to 8 bytes
} SXG_X64_SGE, *PSXG_X64_SGE; } SXG_X64_SGE, *PSXG_X64_SGE;
typedef struct _SCATTER_GATHER_ELEMENT { typedef struct _SCATTER_GATHER_ELEMENT {
dma64_addr_t Address; // same as wdm.h dma64_addr_t Address; // same as wdm.h
u32 Length; // same as wdm.h u32 Length; // same as wdm.h
u32 CompilerPad;// The compiler pads to 8-bytes u32 CompilerPad; // The compiler pads to 8-bytes
u64 Reserved; // u32 * in wdm.h. Force to 8 bytes u64 Reserved; // u32 * in wdm.h. Force to 8 bytes
} SCATTER_GATHER_ELEMENT, *PSCATTER_GATHER_ELEMENT; } SCATTER_GATHER_ELEMENT, *PSCATTER_GATHER_ELEMENT;
typedef struct _SCATTER_GATHER_LIST { typedef struct _SCATTER_GATHER_LIST {
u32 NumberOfElements; u32 NumberOfElements;
u32 * Reserved; u32 *Reserved;
SCATTER_GATHER_ELEMENT Elements[]; SCATTER_GATHER_ELEMENT Elements[];
} SCATTER_GATHER_LIST, *PSCATTER_GATHER_LIST; } SCATTER_GATHER_LIST, *PSCATTER_GATHER_LIST;
...@@ -827,19 +824,19 @@ typedef struct _SCATTER_GATHER_LIST { ...@@ -827,19 +824,19 @@ typedef struct _SCATTER_GATHER_LIST {
// we can specify SXG_X64_SGE and define a fixed number of elements // we can specify SXG_X64_SGE and define a fixed number of elements
typedef struct _SXG_X64_SGL { typedef struct _SXG_X64_SGL {
u32 NumberOfElements; u32 NumberOfElements;
u32 * Reserved; u32 *Reserved;
SXG_X64_SGE Elements[SXG_SGL_ENTRIES]; SXG_X64_SGE Elements[SXG_SGL_ENTRIES];
} SXG_X64_SGL, *PSXG_X64_SGL; } SXG_X64_SGL, *PSXG_X64_SGL;
typedef struct _SXG_SCATTER_GATHER { typedef struct _SXG_SCATTER_GATHER {
SXG_SGL_TYPE Type; // FIRST! Dumb-nic or offload SXG_SGL_TYPE Type; // FIRST! Dumb-nic or offload
void * adapter; // Back pointer to adapter void *adapter; // Back pointer to adapter
LIST_ENTRY FreeList; // Free SXG_SCATTER_GATHER blocks LIST_ENTRY FreeList; // Free SXG_SCATTER_GATHER blocks
LIST_ENTRY AllList; // All SXG_SCATTER_GATHER blocks LIST_ENTRY AllList; // All SXG_SCATTER_GATHER blocks
dma_addr_t PhysicalAddress;// physical address dma_addr_t PhysicalAddress; // physical address
unsigned char State; // See SXG_BUFFER state above unsigned char State; // See SXG_BUFFER state above
unsigned char CmdIndex; // Command ring index unsigned char CmdIndex; // Command ring index
struct sk_buff * DumbPacket; // Associated Packet struct sk_buff *DumbPacket; // Associated Packet
u32 Direction; // For asynchronous completions u32 Direction; // For asynchronous completions
u32 CurOffset; // Current SGL offset u32 CurOffset; // Current SGL offset
u32 SglRef; // SGL reference count u32 SglRef; // SGL reference count
...@@ -856,6 +853,5 @@ typedef struct _SXG_SCATTER_GATHER { ...@@ -856,6 +853,5 @@ typedef struct _SXG_SCATTER_GATHER {
#define SXG_SGL_BUFFER(_SxgSgl) NULL #define SXG_SGL_BUFFER(_SxgSgl) NULL
#define SXG_SGL_BUF_SIZE 0 #define SXG_SGL_BUF_SIZE 0
#else #else
Stop Compilation; Stop Compilation;
#endif #endif
...@@ -53,7 +53,7 @@ static PHY_UCODE PhyUcode[] = { ...@@ -53,7 +53,7 @@ static PHY_UCODE PhyUcode[] = {
/* Transceiver-specific MDIO Patches: */ /* Transceiver-specific MDIO Patches: */
{0xc010, 0x448a}, /* (bit 14) mask out high BER input from the */ {0xc010, 0x448a}, /* (bit 14) mask out high BER input from the */
/* LOS signal in 1.000A */ /* LOS signal in 1.000A */
/* (mandatory patch for SR code)*/ /* (mandatory patch for SR code) */
{0xc003, 0x0181}, /* (bit 7) enable the CDR inc setting in */ {0xc003, 0x0181}, /* (bit 7) enable the CDR inc setting in */
/* 1.C005 (mandatory patch for SR code) */ /* 1.C005 (mandatory patch for SR code) */
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册