rtl8188eu: Fix checkpatch errors in include/*.h - part 1

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2013-08-13 21:01:38 -05:00
parent f9d86b986b
commit 9dd1827027
45 changed files with 4057 additions and 4114 deletions

View file

@ -40,21 +40,23 @@ static u8 SNAP_ETH_TYPE_IPX[2] = {0x81, 0x37};
static u8 SNAP_ETH_TYPE_APPLETALK_AARP[2] = {0x80, 0xf3};
static u8 SNAP_ETH_TYPE_APPLETALK_DDP[2] = {0x80, 0x9b};
static u8 SNAP_ETH_TYPE_TDLS[2] = {0x89, 0x0d};
static u8 SNAP_HDR_APPLETALK_DDP[3] = {0x08, 0x00, 0x07}; /* Datagram Delivery Protocol */
/* Datagram Delivery Protocol */
static u8 SNAP_HDR_APPLETALK_DDP[3] = {0x08, 0x00, 0x07};
static u8 oui_8021h[] = {0x00, 0x00, 0xf8};
static u8 oui_rfc1042[]= {0x00,0x00,0x00};
static u8 oui_rfc1042[] = {0x00,0x00,0x00};
#define MAX_SUBFRAME_COUNT 64
static u8 rtw_rfc1042_header[] =
{ 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 };
static u8 rtw_rfc1042_header[] = {
0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00
};
/* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */
static u8 rtw_bridge_tunnel_header[] =
{ 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 };
static u8 rtw_bridge_tunnel_header[] = {
0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8
};
/* for Rx reordering buffer control */
struct recv_reorder_ctrl
{
struct recv_reorder_ctrl {
struct adapter *padapter;
u8 enable;
u16 indicate_seq;/* wstart_b, init_value=0xffff */
@ -86,7 +88,6 @@ struct stainfo_rxcache {
*/
};
struct smooth_rssi_data {
u32 elements[100]; /* array to store values */
u32 index; /* index to current array to store */
@ -107,7 +108,9 @@ struct phy_info {
u8 RxMIMOSignalQuality[MAX_PATH_NUM_92CS]; /* EVM */
u8 RxMIMOSignalStrength[MAX_PATH_NUM_92CS];/* in 0~100 index */
s8 RxPower; /* in dBm Translate from PWdB */
s8 RecvSignalPower;/* Real power in dBm for this packet, no beautification and aggregation. Keep this raw info to be used for the other procedures. */
/* Real power in dBm for this packet, no beautification and aggregation.
* Keep this raw info to be used for the other procedures. */
s8 recvpower;
u8 BTRxRSSIPercentage;
u8 SignalStrength; /* in 0-100 index. */
u8 RxPwr[MAX_PATH_NUM_92CS];/* per-path's pwdb */
@ -132,7 +135,8 @@ struct rx_pkt_attrib {
u8 order;
u8 privacy; /* in frame_ctrl field */
u8 bdecrypted;
u8 encrypt; /* when 0 indicate no encrypt. when non-zero, indicate the encrypt algorith */
u8 encrypt; /* when 0 indicate no encrypt. when non-zero,
* indicate the encrypt algorith */
u8 iv_len;
u8 icv_len;
u8 crc_err;
@ -184,13 +188,13 @@ struct recv_stat {
#define EOR BIT(30)
/*
accesser of recv_priv: rtw_recv_entry(dispatch / passive level); recv_thread(passive) ; returnpkt(dispatch)
accesser of recv_priv: rtw_recv_entry(dispatch / passive level);
recv_thread(passive) ; returnpkt(dispatch)
; halt(passive) ;
using enter_critical section to protect
*/
struct recv_priv
{
struct recv_priv {
spinlock_t lock;
struct __queue free_recv_queue;
struct __queue recv_pending_queue;
@ -239,45 +243,38 @@ struct recv_priv
struct signal_stat signal_strength_data;
};
#define rtw_set_signal_stat_timer(recvpriv) _set_timer(&(recvpriv)->signal_stat_timer, (recvpriv)->signal_stat_sampling_interval)
#define rtw_set_signal_stat_timer(recvpriv) \
_set_timer(&(recvpriv)->signal_stat_timer, \
(recvpriv)->signal_stat_sampling_interval)
struct sta_recv_priv {
spinlock_t lock;
int option;
struct __queue defrag_q; /* keeping the fragment frame until defrag */
struct __queue defrag_q; /* keeping the fragment frame until defrag */
struct stainfo_rxcache rxcache;
};
struct recv_buf
{
struct recv_buf {
struct list_head list;
spinlock_t recvbuf_lock;
u32 ref_cnt;
struct adapter * adapter;
struct adapter *adapter;
u8 *pbuf;
u8 *pallocated_buf;
u32 len;
u8 *phead;
u8 *pdata;
u8 *ptail;
u8 *pend;
struct urb * purb;
struct urb *purb;
dma_addr_t dma_transfer_addr; /* (in) dma addr for transfer_buffer */
u32 alloc_sz;
u8 irp_pending;
int transfer_len;
struct sk_buff *pskb;
u8 reuse;
};
/*
head ----->
@ -293,95 +290,74 @@ struct recv_buf
len = (unsigned int )(tail - data);
*/
struct recv_frame_hdr
{
struct recv_frame_hdr {
struct list_head list;
struct sk_buff *pkt;
struct sk_buff *pkt_newalloc;
struct adapter *adapter;
u8 fragcnt;
int frame_tag;
struct rx_pkt_attrib attrib;
uint len;
u8 *rx_head;
u8 *rx_data;
u8 *rx_tail;
u8 *rx_end;
void *precvbuf;
/* */
struct sta_info *psta;
/* for A-MPDU Rx reordering buffer control */
struct recv_reorder_ctrl *preorder_ctrl;
};
union recv_frame{
union{
union recv_frame {
union {
struct list_head list;
struct recv_frame_hdr hdr;
uint mem[RECVFRAME_HDR_ALIGN>>2];
}u;
/* uint mem[MAX_RXSZ>>2]; */
} u;
};
extern union recv_frame *_rtw_alloc_recvframe (struct __queue *pfree_recv_queue); /* get a free recv_frame from pfree_recv_queue */
extern union recv_frame *rtw_alloc_recvframe (struct __queue *pfree_recv_queue); /* get a free recv_frame from pfree_recv_queue */
extern void rtw_init_recvframe(union recv_frame *precvframe ,struct recv_priv *precvpriv);
extern int rtw_free_recvframe(union recv_frame *precvframe, struct __queue *pfree_recv_queue);
union recv_frame *_rtw_alloc_recvframe (struct __queue *pfree_recv_queue);
union recv_frame *rtw_alloc_recvframe (struct __queue *pfree_recv_queue);
void rtw_init_recvframe(union recv_frame *precvframe,
struct recv_priv *precvpriv);
int rtw_free_recvframe(union recv_frame *precvframe,
struct __queue *pfree_recv_queue);
#define rtw_dequeue_recvframe(queue) rtw_alloc_recvframe(queue)
extern int _rtw_enqueue_recvframe(union recv_frame *precvframe, struct __queue *queue);
extern int rtw_enqueue_recvframe(union recv_frame *precvframe, struct __queue *queue);
extern void rtw_free_recvframe_queue(struct __queue *pframequeue, struct __queue *pfree_recv_queue);
int _rtw_enqueue_recvframe(union recv_frame *precvframe, struct __queue *queue);
int rtw_enqueue_recvframe(union recv_frame *precvframe, struct __queue *queue);
void rtw_free_recvframe_queue(struct __queue *pframequeue,
struct __queue *pfree_recv_queue);
u32 rtw_free_uc_swdec_pending_queue(struct adapter *adapter);
int rtw_enqueue_recvbuf_to_head(struct recv_buf *precvbuf, struct __queue *queue);
int rtw_enqueue_recvbuf(struct recv_buf *precvbuf, struct __queue *queue);
struct recv_buf *rtw_dequeue_recvbuf (struct __queue *queue);
void rtw_reordering_ctrl_timeout_handler(void *pcontext);
__inline static u8 *get_rxmem(union recv_frame *precvframe)
static inline u8 *get_rxmem(union recv_frame *precvframe)
{
/* always return rx_head... */
if (precvframe==NULL)
if (precvframe == NULL)
return NULL;
return precvframe->u.hdr.rx_head;
}
__inline static u8 *get_rx_status(union recv_frame *precvframe)
static inline u8 *get_rx_status(union recv_frame *precvframe)
{
return get_rxmem(precvframe);
}
__inline static u8 *get_recvframe_data(union recv_frame *precvframe)
static inline u8 *get_recvframe_data(union recv_frame *precvframe)
{
/* alwasy return rx_data */
if (precvframe==NULL)
/* always return rx_data */
if (precvframe == NULL)
return NULL;
return precvframe->u.hdr.rx_data;
}
__inline static u8 *recvframe_push(union recv_frame *precvframe, int sz)
static inline u8 *recvframe_push(union recv_frame *precvframe, int sz)
{
/* append data before rx_data */
@ -390,56 +366,42 @@ __inline static u8 *recvframe_push(union recv_frame *precvframe, int sz)
* This function extends the used data area of the recv_frame at the buffer
* start. rx_data must be still larger than rx_head, after pushing.
*/
if (precvframe==NULL)
if (precvframe == NULL)
return NULL;
precvframe->u.hdr.rx_data -= sz ;
if ( precvframe->u.hdr.rx_data < precvframe->u.hdr.rx_head )
{
if ( precvframe->u.hdr.rx_data < precvframe->u.hdr.rx_head) {
precvframe->u.hdr.rx_data += sz ;
return NULL;
}
precvframe->u.hdr.len +=sz;
return precvframe->u.hdr.rx_data;
}
__inline static u8 *recvframe_pull(union recv_frame *precvframe, int sz)
static inline u8 *recvframe_pull(union recv_frame *precvframe, int sz)
{
/* rx_data += sz; move rx_data sz bytes hereafter */
/* used for extract sz bytes from rx_data, update rx_data and return the updated rx_data to the caller */
/* used for extract sz bytes from rx_data, update rx_data and return
* the updated rx_data to the caller */
if (precvframe==NULL)
if (precvframe == NULL)
return NULL;
precvframe->u.hdr.rx_data += sz;
if (precvframe->u.hdr.rx_data > precvframe->u.hdr.rx_tail)
{
if (precvframe->u.hdr.rx_data > precvframe->u.hdr.rx_tail) {
precvframe->u.hdr.rx_data -= sz;
return NULL;
}
precvframe->u.hdr.len -=sz;
precvframe->u.hdr.len -= sz;
return precvframe->u.hdr.rx_data;
}
__inline static u8 *recvframe_put(union recv_frame *precvframe, int sz)
static inline u8 *recvframe_put(union recv_frame *precvframe, int sz)
{
/* used for append sz bytes from ptr to rx_tail, update rx_tail and return the updated rx_tail to the caller */
/* used for append sz bytes from ptr to rx_tail, update rx_tail
* and return the updated rx_tail to the caller */
/* after putting, rx_tail must be still larger than rx_end. */
if (precvframe==NULL)
if (precvframe == NULL)
return NULL;
precvframe->u.hdr.rx_tail += sz;
@ -452,105 +414,91 @@ __inline static u8 *recvframe_put(union recv_frame *precvframe, int sz)
return precvframe->u.hdr.rx_tail;
}
__inline static u8 *recvframe_pull_tail(union recv_frame *precvframe, int sz)
static inline u8 *recvframe_pull_tail(union recv_frame *precvframe, int sz)
{
/* rmv data from rx_tail (by yitsen) */
/* used for extract sz bytes from rx_end, update rx_end and return the updated rx_end to the caller */
/* used for extract sz bytes from rx_end, update rx_end and return
* the updated rx_end to the caller */
/* after pulling, rx_end must be still larger than rx_data. */
if (precvframe==NULL)
if (precvframe == NULL)
return NULL;
precvframe->u.hdr.rx_tail -= sz;
if (precvframe->u.hdr.rx_tail < precvframe->u.hdr.rx_data)
{
if (precvframe->u.hdr.rx_tail < precvframe->u.hdr.rx_data) {
precvframe->u.hdr.rx_tail += sz;
return NULL;
}
precvframe->u.hdr.len -=sz;
precvframe->u.hdr.len -= sz;
return precvframe->u.hdr.rx_tail;
}
__inline static unsigned char *get_rxbuf_desc(union recv_frame *precvframe)
static inline unsigned char *get_rxbuf_desc(union recv_frame *precvframe)
{
unsigned char *buf_desc;
if (precvframe==NULL)
if (precvframe == NULL)
return NULL;
return buf_desc;
}
__inline static union recv_frame *rxmem_to_recvframe(u8 *rxmem)
static inline union recv_frame *rxmem_to_recvframe(u8 *rxmem)
{
/* due to the design of 2048 bytes alignment of recv_frame, we can reference the union recv_frame */
/* from any given member of recv_frame. */
/* rxmem indicates the any member/address in recv_frame */
return (union recv_frame*)(((size_t)rxmem >> RXFRAME_ALIGN) << RXFRAME_ALIGN);
return (union recv_frame *)(((size_t)rxmem >> RXFRAME_ALIGN) << RXFRAME_ALIGN);
}
__inline static union recv_frame *pkt_to_recvframe(struct sk_buff *pkt)
static inline union recv_frame *pkt_to_recvframe(struct sk_buff *pkt)
{
u8 * buf_star;
union recv_frame * precv_frame;
precv_frame = rxmem_to_recvframe((unsigned char*)buf_star);
u8 *buf_star;
union recv_frame *precv_frame;
precv_frame = rxmem_to_recvframe((unsigned char *)buf_star);
return precv_frame;
}
__inline static u8 *pkt_to_recvmem(struct sk_buff *pkt)
static inline u8 *pkt_to_recvmem(struct sk_buff *pkt)
{
/* return the rx_head */
union recv_frame * precv_frame = pkt_to_recvframe(pkt);
union recv_frame *precv_frame = pkt_to_recvframe(pkt);
return precv_frame->u.hdr.rx_head;
}
__inline static u8 *pkt_to_recvdata(struct sk_buff *pkt)
static inline u8 *pkt_to_recvdata(struct sk_buff *pkt)
{
/* return the rx_data */
union recv_frame * precv_frame =pkt_to_recvframe(pkt);
union recv_frame *precv_frame =pkt_to_recvframe(pkt);
return precv_frame->u.hdr.rx_data;
}
__inline static int get_recvframe_len(union recv_frame *precvframe)
static inline int get_recvframe_len(union recv_frame *precvframe)
{
return precvframe->u.hdr.len;
}
__inline static s32 translate_percentage_to_dbm(u32 SignalStrengthIndex)
static inline s32 translate_percentage_to_dbm(u32 sig_stren_index)
{
s32 SignalPower; /* in dBm. */
s32 power; /* in dBm. */
/* Translate to dBm (x=0.5y-95). */
SignalPower = (s32)((SignalStrengthIndex + 1) >> 1);
SignalPower -= 95;
power = (s32)((sig_stren_index + 1) >> 1);
power -= 95;
return SignalPower;
return power;
}
struct sta_info;
extern void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv);
void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv);
extern void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame);
void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame);
#endif