rtl8188eu: Change union recv_frame to struct

Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
This commit is contained in:
Larry Finger 2014-12-13 10:35:48 -06:00
parent 89efde68f8
commit 7fd86158bf
11 changed files with 377 additions and 381 deletions

View file

@ -26,18 +26,18 @@
int _rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter);
void _rtw_free_recv_priv(struct recv_priv *precvpriv);
s32 rtw_recv_entry(union recv_frame *precv_frame);
int rtw_recv_indicatepkt(struct adapter *adapter, union recv_frame *recv_frame);
s32 rtw_recv_entry(struct recv_frame *precv_frame);
int rtw_recv_indicatepkt(struct adapter *adapter, struct recv_frame *recv_frame);
void rtw_recv_returnpacket(struct net_device *cnxt, struct sk_buff *retpkt);
void rtw_hostapd_mlme_rx(struct adapter *padapter, union recv_frame *recv_fr);
void rtw_hostapd_mlme_rx(struct adapter *padapter, struct recv_frame *recv_fr);
void rtw_handle_tkip_mic_err(struct adapter *padapter, u8 bgroup);
int rtw_init_recv_priv(struct recv_priv *precvpriv, struct adapter *padapter);
void rtw_free_recv_priv(struct recv_priv *precvpriv);
int rtw_os_recv_resource_init(struct recv_priv *recvpr, struct adapter *adapt);
int rtw_os_recv_resource_alloc(struct adapter *adapt, union recv_frame *recvfr);
int rtw_os_recv_resource_alloc(struct adapter *adapt, struct recv_frame *recvfr);
void rtw_os_recv_resource_free(struct recv_priv *precvpriv);
int rtw_os_recvbuf_resource_alloc(struct adapter *adapt, struct recv_buf *buf);

View file

@ -61,9 +61,9 @@ s32 rtl8188eu_init_recv_priv(struct adapter *padapter);
void rtl8188eu_free_recv_priv(struct adapter * padapter);
void rtl8188eu_recv_hdl(struct adapter * padapter, struct recv_buf *precvbuf);
void rtl8188eu_recv_tasklet(void *priv);
void rtl8188e_query_rx_phy_status(union recv_frame *fr, struct phy_stat *phy);
void rtl8188e_query_rx_phy_status(struct recv_frame *fr, struct phy_stat *phy);
void rtl8188e_process_phy_info(struct adapter * padapter, void *prframe);
void update_recvframe_phyinfo_88e(union recv_frame *fra, struct phy_stat *phy);
void update_recvframe_attrib_88e(union recv_frame *fra, struct recv_stat *stat);
void update_recvframe_phyinfo_88e(struct recv_frame *fra, struct phy_stat *phy);
void update_recvframe_attrib_88e(struct recv_frame *fra, struct recv_stat *stat);
#endif

View file

@ -233,13 +233,13 @@ enum SCAN_STATE {
struct mlme_handler {
unsigned int num;
char *str;
unsigned int (*func)(struct adapter *adapt, union recv_frame *frame);
unsigned int (*func)(struct adapter *adapt, struct recv_frame *frame);
};
struct action_handler {
unsigned int num;
char* str;
unsigned int (*func)(struct adapter *adapt, union recv_frame *frame);
unsigned int (*func)(struct adapter *adapt, struct recv_frame *frame);
};
struct ss_res {
@ -487,7 +487,7 @@ int allocate_fw_sta_entry(struct adapter *padapter);
void flush_all_cam_entry(struct adapter *padapter);
void site_survey(struct adapter *padapter);
u8 collect_bss_info(struct adapter *padapter, union recv_frame *precv_frame,
u8 collect_bss_info(struct adapter *padapter, struct recv_frame *precv_frame,
struct wlan_bssid_ex *bssid);
void update_network(struct wlan_bssid_ex *dst, struct wlan_bssid_ex *src,
struct adapter *adapter, bool update_ie);
@ -541,7 +541,7 @@ unsigned int is_ap_in_wep(struct adapter *padapter);
unsigned int should_forbid_n_rate(struct adapter *padapter);
void report_join_res(struct adapter *padapter, int res);
void report_survey_event(struct adapter *padapter, union recv_frame *precv_frame);
void report_survey_event(struct adapter *padapter, struct recv_frame *precv_frame);
void report_surveydone_event(struct adapter *padapter);
void report_del_sta_event(struct adapter *padapter,
unsigned char *addr, unsigned short reason);
@ -606,46 +606,46 @@ void start_clnt_join(struct adapter *padapter);
void start_create_ibss(struct adapter *padapter);
unsigned int OnAssocReq(struct adapter *padapter,
union recv_frame *precv_frame);
struct recv_frame *precv_frame);
unsigned int OnAssocRsp(struct adapter *padapter,
union recv_frame *precv_frame);
struct recv_frame *precv_frame);
unsigned int OnProbeReq(struct adapter *padapter,
union recv_frame *precv_frame);
struct recv_frame *precv_frame);
unsigned int OnProbeRsp(struct adapter *padapter,
union recv_frame *precv_frame);
struct recv_frame *precv_frame);
unsigned int DoReserved(struct adapter *padapter,
union recv_frame *precv_frame);
struct recv_frame *precv_frame);
unsigned int OnBeacon(struct adapter *padapter,
union recv_frame *precv_frame);
struct recv_frame *precv_frame);
unsigned int OnAtim(struct adapter *padapter,
union recv_frame *precv_frame);
struct recv_frame *precv_frame);
unsigned int OnDisassoc(struct adapter *padapter,
union recv_frame *precv_frame);
struct recv_frame *precv_frame);
unsigned int OnAuth(struct adapter *padapter,
union recv_frame *precv_frame);
struct recv_frame *precv_frame);
unsigned int OnAuthClient(struct adapter *padapter,
union recv_frame *precv_frame);
struct recv_frame *precv_frame);
unsigned int OnDeAuth(struct adapter *padapter,
union recv_frame *precv_frame);
struct recv_frame *precv_frame);
unsigned int OnAction(struct adapter *padapter,
union recv_frame *precv_frame);
struct recv_frame *precv_frame);
unsigned int on_action_spct(struct adapter *padapter,
union recv_frame *precv_frame);
struct recv_frame *precv_frame);
unsigned int OnAction_qos(struct adapter *padapter,
union recv_frame *precv_frame);
struct recv_frame *precv_frame);
unsigned int OnAction_dls(struct adapter *padapter,
union recv_frame *precv_frame);
struct recv_frame *precv_frame);
unsigned int OnAction_back(struct adapter *padapter,
union recv_frame *precv_frame);
struct recv_frame *precv_frame);
unsigned int on_action_public(struct adapter *padapter,
union recv_frame *precv_frame);
struct recv_frame *precv_frame);
unsigned int OnAction_ht(struct adapter *padapter,
union recv_frame *precv_frame);
struct recv_frame *precv_frame);
unsigned int OnAction_wmm(struct adapter *padapter,
union recv_frame *precv_frame);
struct recv_frame *precv_frame);
unsigned int OnAction_p2p(struct adapter *padapter,
union recv_frame *precv_frame);
struct recv_frame *precv_frame);
void mlmeext_joinbss_event_callback(struct adapter *padapter, int join_res);
void mlmeext_sta_del_event_callback(struct adapter *padapter);

View file

@ -267,7 +267,7 @@ struct recv_buf {
len = (unsigned int )(tail - data);
*/
struct recv_frame_hdr {
struct recv_frame {
struct list_head list;
struct sk_buff *pkt;
struct sk_buff *pkt_newalloc;
@ -286,23 +286,15 @@ struct recv_frame_hdr {
struct recv_reorder_ctrl *preorder_ctrl;
};
union recv_frame {
union {
struct list_head list;
struct recv_frame_hdr hdr;
uint mem[RECVFRAME_HDR_ALIGN>>2];
} u;
};
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_frame *_rtw_alloc_recvframe(struct __queue *pfree_recv_queue);
struct recv_frame *rtw_alloc_recvframe(struct __queue *pfree_recv_queue);
void rtw_init_recvframe(struct recv_frame *precvframe,
struct recv_priv *precvpriv);
int rtw_free_recvframe(union recv_frame *precvframe,
int rtw_free_recvframe(struct recv_frame *precvframe,
struct __queue *pfree_recv_queue);
#define rtw_dequeue_recvframe(queue) rtw_alloc_recvframe(queue)
int _rtw_enqueue_recvframe(union recv_frame *precvframe, struct __queue *queue);
int rtw_enqueue_recvframe(union recv_frame *precvframe, struct __queue *queue);
int _rtw_enqueue_recvframe(struct recv_frame *precvframe, struct __queue *queue);
int rtw_enqueue_recvframe(struct 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);
@ -312,29 +304,29 @@ struct recv_buf *rtw_dequeue_recvbuf(struct __queue *queue);
void rtw_reordering_ctrl_timeout_handler(void *pcontext);
static inline u8 *get_rxmem(union recv_frame *precvframe)
static inline u8 *get_rxmem(struct recv_frame *precvframe)
{
/* always return rx_head... */
if (precvframe == NULL)
return NULL;
return precvframe->u.hdr.rx_head;
return precvframe->rx_head;
}
static inline u8 *get_rx_status(union recv_frame *precvframe)
static inline u8 *get_rx_status(struct recv_frame *precvframe)
{
return get_rxmem(precvframe);
}
static inline u8 *get_recvframe_data(union recv_frame *precvframe)
static inline u8 *get_recvframe_data(struct recv_frame *precvframe)
{
/* always return rx_data */
if (precvframe == NULL)
return NULL;
return precvframe->u.hdr.rx_data;
return precvframe->rx_data;
}
static inline u8 *recvframe_push(union recv_frame *precvframe, int sz)
static inline u8 *recvframe_push(struct recv_frame *precvframe, int sz)
{
/* append data before rx_data */
@ -345,16 +337,16 @@ static inline u8 *recvframe_push(union recv_frame *precvframe, int sz)
*/
if (precvframe == NULL)
return NULL;
precvframe->u.hdr.rx_data -= sz ;
if (precvframe->u.hdr.rx_data < precvframe->u.hdr.rx_head) {
precvframe->u.hdr.rx_data += sz;
precvframe->rx_data -= sz ;
if (precvframe->rx_data < precvframe->rx_head) {
precvframe->rx_data += sz;
return NULL;
}
precvframe->u.hdr.len += sz;
return precvframe->u.hdr.rx_data;
precvframe->len += sz;
return precvframe->rx_data;
}
static inline u8 *recvframe_pull(union recv_frame *precvframe, int sz)
static inline u8 *recvframe_pull(struct recv_frame *precvframe, int sz)
{
/* rx_data += sz; move rx_data sz bytes hereafter */
@ -363,16 +355,16 @@ static inline u8 *recvframe_pull(union recv_frame *precvframe, int sz)
if (precvframe == NULL)
return NULL;
precvframe->u.hdr.rx_data += sz;
if (precvframe->u.hdr.rx_data > precvframe->u.hdr.rx_tail) {
precvframe->u.hdr.rx_data -= sz;
precvframe->rx_data += sz;
if (precvframe->rx_data > precvframe->rx_tail) {
precvframe->rx_data -= sz;
return NULL;
}
precvframe->u.hdr.len -= sz;
return precvframe->u.hdr.rx_data;
precvframe->len -= sz;
return precvframe->rx_data;
}
static inline u8 *recvframe_put(union recv_frame *precvframe, int sz)
static inline u8 *recvframe_put(struct 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 */
@ -381,17 +373,17 @@ static inline u8 *recvframe_put(union recv_frame *precvframe, int sz)
if (precvframe == NULL)
return NULL;
precvframe->u.hdr.rx_tail += sz;
precvframe->rx_tail += sz;
if (precvframe->u.hdr.rx_tail > precvframe->u.hdr.rx_end) {
precvframe->u.hdr.rx_tail -= sz;
if (precvframe->rx_tail > precvframe->rx_end) {
precvframe->rx_tail -= sz;
return NULL;
}
precvframe->u.hdr.len += sz;
return precvframe->u.hdr.rx_tail;
precvframe->len += sz;
return precvframe->rx_tail;
}
static inline u8 *recvframe_pull_tail(union recv_frame *precvframe, int sz)
static inline u8 *recvframe_pull_tail(struct recv_frame *precvframe, int sz)
{
/* rmv data from rx_tail (by yitsen) */
@ -401,16 +393,16 @@ static inline u8 *recvframe_pull_tail(union recv_frame *precvframe, int sz)
if (precvframe == NULL)
return NULL;
precvframe->u.hdr.rx_tail -= sz;
if (precvframe->u.hdr.rx_tail < precvframe->u.hdr.rx_data) {
precvframe->u.hdr.rx_tail += sz;
precvframe->rx_tail -= sz;
if (precvframe->rx_tail < precvframe->rx_data) {
precvframe->rx_tail += sz;
return NULL;
}
precvframe->u.hdr.len -= sz;
return precvframe->u.hdr.rx_tail;
precvframe->len -= sz;
return precvframe->rx_tail;
}
static inline unsigned char *get_rxbuf_desc(union recv_frame *precvframe)
static inline unsigned char *get_rxbuf_desc(struct recv_frame *precvframe)
{
unsigned char *buf_desc;
@ -419,20 +411,20 @@ static inline unsigned char *get_rxbuf_desc(union recv_frame *precvframe)
return buf_desc;
}
static inline union recv_frame *rxmem_to_recvframe(u8 *rxmem)
static inline struct 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 */
* we can reference the struct 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 (struct recv_frame *)(((size_t)rxmem >> RXFRAME_ALIGN) << RXFRAME_ALIGN);
}
static inline union recv_frame *pkt_to_recvframe(struct sk_buff *pkt)
static inline struct recv_frame *pkt_to_recvframe(struct sk_buff *pkt)
{
u8 *buf_star;
union recv_frame *precv_frame;
struct recv_frame *precv_frame;
precv_frame = rxmem_to_recvframe((unsigned char *)buf_star);
return precv_frame;
@ -442,23 +434,23 @@ static inline u8 *pkt_to_recvmem(struct sk_buff *pkt)
{
/* return the rx_head */
union recv_frame *precv_frame = pkt_to_recvframe(pkt);
struct recv_frame *precv_frame = pkt_to_recvframe(pkt);
return precv_frame->u.hdr.rx_head;
return precv_frame->rx_head;
}
static inline u8 *pkt_to_recvdata(struct sk_buff *pkt)
{
/* return the rx_data */
union recv_frame *precv_frame = pkt_to_recvframe(pkt);
struct recv_frame *precv_frame = pkt_to_recvframe(pkt);
return precv_frame->u.hdr.rx_data;
return precv_frame->rx_data;
}
static inline int get_recvframe_len(union recv_frame *precvframe)
static inline int get_recvframe_len(struct recv_frame *precvframe)
{
return precvframe->u.hdr.len;
return precvframe->len;
}
static inline s32 translate_percentage_to_dbm(u32 sig_stren_index)
@ -476,6 +468,6 @@ struct sta_info;
void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv);
void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame);
void mgt_dispatcher(struct adapter *padapter, struct recv_frame *precv_frame);
#endif