X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=drivers%2Fstaging%2Frtl8723bs%2Finclude%2Frtw_recv.h;h=570a3c333aa09302f2c812acdde04d51dbaa6e89;hb=837bc3dc713b2a876445614333cf844d6a5c4303;hp=368c798fb71eaf84ea6a5412ae9c8c9d8d76d817;hpb=7e3f85d9883e7f4aa508db679bd215974d81138d;p=android-x86%2Fkernel.git diff --git a/drivers/staging/rtl8723bs/include/rtw_recv.h b/drivers/staging/rtl8723bs/include/rtw_recv.h index 368c798fb71e..570a3c333aa0 100644 --- a/drivers/staging/rtl8723bs/include/rtw_recv.h +++ b/drivers/staging/rtl8723bs/include/rtw_recv.h @@ -11,11 +11,6 @@ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * - * You should have received a copy of the GNU General Public License along with - * this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA - * - * ******************************************************************************/ #ifndef _RTW_RECV_H_ #define _RTW_RECV_H_ @@ -24,7 +19,7 @@ #define NR_RECVBUFF (1) #else #define NR_RECVBUFF (8) - #endif //CONFIG_SINGLE_RECV_BUF + #endif /* CONFIG_SINGLE_RECV_BUF */ #define NR_PREALLOC_RECV_SKB (8) @@ -33,7 +28,7 @@ #define RXFRAME_ALIGN 8 #define RXFRAME_ALIGN_SZ (1<network.PhyInfo.SignalStrength); + s8 rssi; /* translate_percentage_to_dbm(ptarget_wlan->network.PhyInfo.SignalStrength); */ #ifdef DBG_RX_SIGNAL_DISPLAY_RAW_DATA struct rx_raw_rssi raw_rssi_info; #endif - //s8 rxpwdb; + /* s8 rxpwdb; */ s16 noise; - //int RxSNRdB[2]; - //s8 RxRssi[2]; - //int FalseAlmCnt_all; + /* int RxSNRdB[2]; */ + /* s8 RxRssi[2]; */ + /* int FalseAlmCnt_all; */ _timer signal_stat_timer; u32 signal_stat_sampling_interval; - //u32 signal_stat_converging_constant; + /* u32 signal_stat_converging_constant; */ struct signal_stat signal_qual_data; struct signal_stat signal_strength_data; }; @@ -355,39 +290,39 @@ struct sta_recv_priv { _lock lock; sint option; - //_queue blk_strms[MAX_RX_NUMBLKS]; - _queue defrag_q; //keeping the fragment frame until defrag + /* struct __queue blk_strms[MAX_RX_NUMBLKS]; */ + struct __queue defrag_q; /* keeping the fragment frame until defrag */ struct stainfo_rxcache rxcache; - //uint sta_rx_bytes; - //uint sta_rx_pkts; - //uint sta_rx_fail; + /* uint sta_rx_bytes; */ + /* uint sta_rx_pkts; */ + /* uint sta_rx_fail; */ }; struct recv_buf { - _list list; + struct list_head list; _lock recvbuf_lock; - u32 ref_cnt; + u32 ref_cnt; - PADAPTER adapter; + struct adapter * adapter; - u8 *pbuf; - u8 *pallocated_buf; + u8 *pbuf; + u8 *pallocated_buf; - u32 len; - u8 *phead; - u8 *pdata; - u8 *ptail; - u8 *pend; + u32 len; + u8 *phead; + u8 *pdata; + u8 *ptail; + u8 *pend; _pkt *pskb; - u8 reuse; + u8 reuse; }; @@ -403,21 +338,21 @@ struct recv_buf end -----> - len = (unsigned int )(tail - data); + len = (unsigned int)(tail - data); */ struct recv_frame_hdr { - _list list; + struct list_head list; #ifndef CONFIG_BSD_RX_USE_MBUF struct sk_buff *pkt; struct sk_buff *pkt_newalloc; -#else // CONFIG_BSD_RX_USE_MBUF +#else /* CONFIG_BSD_RX_USE_MBUF */ _pkt *pkt; _pkt *pkt_newalloc; -#endif // CONFIG_BSD_RX_USE_MBUF +#endif /* CONFIG_BSD_RX_USE_MBUF */ - _adapter *adapter; + struct adapter *adapter; u8 fragcnt; @@ -434,55 +369,54 @@ struct recv_frame_hdr void *precvbuf; - // + /* */ struct sta_info *psta; - //for A-MPDU Rx reordering buffer control + /* for A-MPDU Rx reordering buffer control */ struct recv_reorder_ctrl *preorder_ctrl; }; union recv_frame{ - union{ - _list list; + struct list_head list; struct recv_frame_hdr hdr; uint mem[RECVFRAME_HDR_ALIGN>>2]; }u; - //uint mem[MAX_RXSZ>>2]; + /* uint mem[MAX_RXSZ>>2]; */ }; -typedef enum _RX_PACKET_TYPE{ - NORMAL_RX,//Normal rx packet - TX_REPORT1,//CCX - TX_REPORT2,//TX RPT - HIS_REPORT,// USB HISR RPT +enum RX_PACKET_TYPE { + NORMAL_RX,/* Normal rx packet */ + TX_REPORT1,/* CCX */ + TX_REPORT2,/* TX RPT */ + HIS_REPORT,/* USB HISR RPT */ C2H_PACKET -}RX_PACKET_TYPE, *PRX_PACKET_TYPE; +}; -extern union recv_frame *_rtw_alloc_recvframe (_queue *pfree_recv_queue); //get a free recv_frame from pfree_recv_queue -extern union recv_frame *rtw_alloc_recvframe (_queue *pfree_recv_queue); //get a free recv_frame from pfree_recv_queue -extern int rtw_free_recvframe(union recv_frame *precvframe, _queue *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 union recv_frame *rtw_alloc_recvframe (struct __queue *pfree_recv_queue); /* get a free recv_frame from pfree_recv_queue */ +extern 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, _queue *queue); -extern int rtw_enqueue_recvframe(union recv_frame *precvframe, _queue *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(_queue *pframequeue, _queue *pfree_recv_queue); -u32 rtw_free_uc_swdec_pending_queue(_adapter *adapter); +extern void rtw_free_recvframe_queue(struct __queue *pframequeue, struct __queue *pfree_recv_queue); +u32 rtw_free_uc_swdec_pending_queue(struct adapter *adapter); -sint rtw_enqueue_recvbuf_to_head(struct recv_buf *precvbuf, _queue *queue); -sint rtw_enqueue_recvbuf(struct recv_buf *precvbuf, _queue *queue); -struct recv_buf *rtw_dequeue_recvbuf (_queue *queue); +sint rtw_enqueue_recvbuf_to_head(struct recv_buf *precvbuf, struct __queue *queue); +sint 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) { - //always return rx_head... - if(precvframe==NULL) + /* always return rx_head... */ + if (precvframe == NULL) return NULL; return precvframe->u.hdr.rx_head; @@ -491,8 +425,8 @@ __inline static u8 *get_rxmem(union recv_frame *precvframe) __inline static u8 *get_recvframe_data(union recv_frame *precvframe) { - //alwasy return rx_data - if(precvframe==NULL) + /* alwasy return rx_data */ + if (precvframe == NULL) return NULL; return precvframe->u.hdr.rx_data; @@ -501,18 +435,18 @@ __inline static u8 *get_recvframe_data(union recv_frame *precvframe) __inline static u8 *recvframe_pull(union recv_frame *precvframe, sint sz) { - // rx_data += sz; move rx_data sz bytes hereafter + /* 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; @@ -526,22 +460,22 @@ __inline static u8 *recvframe_pull(union recv_frame *precvframe, sint sz) __inline static u8 *recvframe_put(union recv_frame *precvframe, sint sz) { - // rx_tai += sz; move rx_tail sz bytes hereafter + /* rx_tai += sz; move rx_tail sz bytes hereafter */ - //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. + /* 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. */ unsigned char * prev_rx_tail; - if(precvframe==NULL) + if (precvframe == NULL) return NULL; prev_rx_tail = precvframe->u.hdr.rx_tail; precvframe->u.hdr.rx_tail += sz; - if(precvframe->u.hdr.rx_tail > precvframe->u.hdr.rx_end) + if (precvframe->u.hdr.rx_tail > precvframe->u.hdr.rx_end) { - precvframe->u.hdr.rx_tail -= sz; + precvframe->u.hdr.rx_tail = prev_rx_tail; return NULL; } @@ -555,17 +489,17 @@ __inline static u8 *recvframe_put(union recv_frame *precvframe, sint sz) __inline static u8 *recvframe_pull_tail(union recv_frame *precvframe, sint sz) { - // rmv data from rx_tail (by yitsen) + /* 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 - //after pulling, rx_end must be still larger than rx_data. + /* 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; @@ -579,9 +513,9 @@ __inline static u8 *recvframe_pull_tail(union recv_frame *precvframe, sint sz) __inline static 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 + /* 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_PTR)rxmem >> RXFRAME_ALIGN) << RXFRAME_ALIGN); @@ -595,13 +529,13 @@ __inline static sint get_recvframe_len(union recv_frame *precvframe) __inline static s32 translate_percentage_to_dbm(u32 SignalStrengthIndex) { - s32 SignalPower; // in dBm. + s32 SignalPower; /* in dBm. */ #ifdef CONFIG_SKIP_SIGNAL_SCALE_MAPPING - // Translate to dBm (x=y-100) + /* Translate to dBm (x =y-100) */ SignalPower = SignalStrengthIndex - 100; #else - // Translate to dBm (x=0.5y-95). + /* Translate to dBm (x = 0.5y-95). */ SignalPower = (s32)((SignalStrengthIndex + 1) >> 1); SignalPower -= 95; #endif @@ -614,6 +548,6 @@ struct sta_info; extern void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv); -extern void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame); +extern void mgt_dispatcher(struct adapter *padapter, union recv_frame *precv_frame); #endif