1 /******************************************************************************
3 * Copyright(c) 2007 - 2012 Realtek Corporation. All rights reserved.
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of version 2 of the GNU General Public License as
7 * published by the Free Software Foundation.
9 * This program is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110, USA
19 ******************************************************************************/
24 #ifdef CONFIG_SDIO_HCI
25 #define NR_RECVBUFF 1024/* 512 */ /* 128 */
27 #define NR_RECVBUFF (16)
29 #elif defined(PLATFORM_OS_CE)
30 #ifdef CONFIG_SDIO_HCI
31 #define NR_RECVBUFF (128)
33 #define NR_RECVBUFF (4)
35 #else /* PLATFORM_LINUX /PLATFORM_BSD */
37 #ifdef CONFIG_SINGLE_RECV_BUF
38 #define NR_RECVBUFF (1)
40 #if defined(CONFIG_GSPI_HCI)
41 #define NR_RECVBUFF (32)
42 #elif defined(CONFIG_SDIO_HCI)
43 #define NR_RECVBUFF (8)
45 #define NR_RECVBUFF (8)
47 #endif /* CONFIG_SINGLE_RECV_BUF */
48 #ifdef CONFIG_PREALLOC_RX_SKB_BUFFER
49 #define NR_PREALLOC_RECV_SKB (rtw_rtkm_get_nr_recv_skb()>>1)
50 #else /*!CONFIG_PREALLOC_RX_SKB_BUFFER */
51 #define NR_PREALLOC_RECV_SKB 8
52 #endif /* CONFIG_PREALLOC_RX_SKB_BUFFER */
54 #ifdef CONFIG_RTW_NAPI
55 #define RTL_NAPI_WEIGHT (32)
59 #define NR_RECVFRAME 256
61 #define RXFRAME_ALIGN 8
62 #define RXFRAME_ALIGN_SZ (1<<RXFRAME_ALIGN)
64 #define DRVINFO_SZ 4 /* unit is 8bytes */
66 #define MAX_RXFRAME_CNT 512
67 #define MAX_RX_NUMBLKS (32)
68 #define RECVFRAME_HDR_ALIGN 128
69 #define MAX_CONTINUAL_NORXPACKET_COUNT 4 /* In MAX_CONTINUAL_NORXPACKET_COUNT*2 sec , no rx traffict would issue DELBA*/
71 #define PHY_RSSI_SLID_WIN_MAX 100
72 #define PHY_LINKQUALITY_SLID_WIN_MAX 20
75 #define SNAP_SIZE sizeof(struct ieee80211_snap_hdr)
77 #define RX_MPDU_QUEUE 0
78 #define RX_CMD_QUEUE 1
79 #define RX_MAX_QUEUE 2
81 static u8 SNAP_ETH_TYPE_IPX[2] = {0x81, 0x37};
83 static u8 SNAP_ETH_TYPE_APPLETALK_AARP[2] = {0x80, 0xf3};
84 static u8 SNAP_ETH_TYPE_APPLETALK_DDP[2] = {0x80, 0x9b};
85 static u8 SNAP_ETH_TYPE_TDLS[2] = {0x89, 0x0d};
86 static u8 SNAP_HDR_APPLETALK_DDP[3] = {0x08, 0x00, 0x07}; /* Datagram Delivery Protocol */
88 static u8 oui_8021h[] = {0x00, 0x00, 0xf8};
89 static u8 oui_rfc1042[] = {0x00, 0x00, 0x00};
91 #define MAX_SUBFRAME_COUNT 64
92 static u8 rtw_rfc1042_header[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0x00 };
93 /* Bridge-Tunnel header (for EtherTypes ETH_P_AARP and ETH_P_IPX) */
94 static u8 rtw_bridge_tunnel_header[] = { 0xaa, 0xaa, 0x03, 0x00, 0x00, 0xf8 };
96 /* for Rx reordering buffer control */
97 struct recv_reorder_ctrl {
100 u16 indicate_seq;/* =wstart_b, init_value=0xffff */
104 _queue pending_recvframe_queue;
105 _timer reordering_ctrl_timer;
109 struct stainfo_rxcache {
112 unsigned short tid0_rxseq;
113 unsigned short tid1_rxseq;
114 unsigned short tid2_rxseq;
115 unsigned short tid3_rxseq;
116 unsigned short tid4_rxseq;
117 unsigned short tid5_rxseq;
118 unsigned short tid6_rxseq;
119 unsigned short tid7_rxseq;
120 unsigned short tid8_rxseq;
121 unsigned short tid9_rxseq;
122 unsigned short tid10_rxseq;
123 unsigned short tid11_rxseq;
124 unsigned short tid12_rxseq;
125 unsigned short tid13_rxseq;
126 unsigned short tid14_rxseq;
127 unsigned short tid15_rxseq;
132 struct smooth_rssi_data {
133 u32 elements[100]; /* array to store values */
134 u32 index; /* index to current array to store */
135 u32 total_num; /* num of valid elements */
136 u32 total_val; /* sum of valid elements */
140 u8 update_req; /* used to indicate */
141 u8 avg_val; /* avg of valid elements */
142 u32 total_num; /* num of valid elements */
143 u32 total_val; /* sum of valid elements */
146 typedef struct _ODM_Phy_Status_Info_ {
148 /* Be care, if you want to add any element please insert between */
149 /* RxPWDBAll & SignalStrength. */
151 #if (DM_ODM_SUPPORT_TYPE & (ODM_WIN))
157 u1Byte SignalQuality; /* in 0-100 index. */
158 s1Byte RxMIMOSignalQuality[4]; /* per-path's EVM */
159 u1Byte RxMIMOEVMdbm[4]; /* per-path's EVM dbm */
161 u1Byte RxMIMOSignalStrength[4];/* in 0~100 index */
163 u2Byte Cfo_short[4]; /* per-path's Cfo_short */
164 u2Byte Cfo_tail[4]; /* per-path's Cfo_tail */
166 #if (DM_ODM_SUPPORT_TYPE & (ODM_WIN|ODM_CE))
167 s1Byte RxPower; /* in dBm Translate from PWdB */
168 s1Byte RecvSignalPower; /* Real power in dBm for this packet, no beautification and aggregation. Keep this raw info to be used for the other procedures. */
169 u1Byte BTRxRSSIPercentage;
170 u1Byte SignalStrength; /* in 0-100 index. */
172 u1Byte RxPwr[4]; /* per-path's pwdb */
174 u1Byte RxSNR[4]; /* per-path's SNR */
176 u1Byte btCoexPwrAdjust;
177 } ODM_PHY_INFO_T, *PODM_PHY_INFO_T;
182 u8 SignalQuality; /* in 0-100 index. */
183 s8 RxMIMOSignalQuality[4]; /* per-path's EVM */
184 u8 RxMIMOEVMdbm[4]; /* per-path's EVM dbm */
185 u8 RxMIMOSignalStrength[4]; /* in 0~100 index */
186 s16 Cfo_short[4]; /* per-path's Cfo_short */
187 s16 Cfo_tail[4]; /* per-path's Cfo_tail */
188 s8 RxPower; /* in dBm Translate from PWdB */
189 s8 RecvSignalPower; /* Real power in dBm for this packet, no beautification and aggregation. Keep this raw info to be used for the other procedures. */
190 u8 BTRxRSSIPercentage;
191 u8 SignalStrength; /* in 0-100 index. */
192 s8 RxPwr[4]; /* per-path's pwdb */
194 #if ((RTL8822B_SUPPORT == 1) || (RTL8723D_SUPPORT == 1) || (RTL8821C_SUPPORT == 1))
202 #if ((RTL8822B_SUPPORT == 1) || (RTL8723D_SUPPORT == 1) || (RTL8821C_SUPPORT == 1))
203 u8 channel; /* channel number---*/
204 BOOLEAN bMuPacket; /* is MU packet or not---*/
214 u8 mimo_signal_strength[4];/* in 0~100 index */
215 u8 mimo_signal_quality[4];
222 struct rx_pkt_attrib {
227 u8 hdrlen; /* the WLAN Header Len */
238 u8 privacy; /* in frame_ctrl field */
240 u8 encrypt; /* when 0 indicate no encrypt. when non-zero, indicate the encrypt algorith */
256 /* #ifdef CONFIG_TCP_CSUM_OFFLOAD_RX */
257 u8 tcpchk_valid; /* 0: invalid, 1: valid */
258 u8 ip_chkrpt; /* 0: incorrect, 1: correct */
259 u8 tcp_chkrpt; /* 0: incorrect, 1: correct */
264 u8 ch; /* RX channel */
271 u32 MacIDValidEntry[2]; /* 64 bits present 64 entry. */
275 s8 rx_mimo_signal_qual[2];
280 struct phy_info phy_info;
284 /* These definition is used for Rx packet reordering. */
285 #define SN_LESS(a, b) (((a-b) & 0x800) != 0)
286 #define SN_EQUAL(a, b) (a == b)
287 /* #define REORDER_WIN_SIZE 128 */
288 /* #define REORDER_ENTRY_NUM 128 */
289 #define REORDER_WAIT_TIME (50) /* (ms) */
291 #define RECVBUFF_ALIGN_SZ 8
293 #ifdef CONFIG_TRX_BD_ARCH
294 #define RX_WIFI_INFO_SIZE 24
295 #elif (defined(CONFIG_RTL8192E) || defined(CONFIG_RTL8814A) || defined(CONFIG_RTL8822B)) && defined(CONFIG_PCI_HCI)
296 #define RXBD_SIZE sizeof(struct recv_stat)
299 #define RXDESC_SIZE 24
300 #define RXDESC_OFFSET RXDESC_SIZE
302 #ifdef CONFIG_TRX_BD_ARCH
304 /* RX has exactly one segment */
305 #ifdef CONFIG_64BIT_DMA
306 unsigned int dword[4];
308 unsigned int dword[2];
313 unsigned int rxdw[8];
321 #if !((defined(CONFIG_RTL8192E) || defined(CONFIG_RTL8814A) || defined(CONFIG_RTL8822B) || defined(CONFIG_RTL8821C)) && defined(CONFIG_PCI_HCI)) /* exclude 8192ee, 8814ae, 8822be, 8821ce */
327 #ifndef BUF_DESC_ARCH
332 #ifdef CONFIG_PCI_HCI
337 #endif /* if BUF_DESC_ARCH is defined, rx_buf_desc occupy 4 double words */
343 #ifdef CONFIG_PCI_HCI
344 #define PCI_MAX_RX_QUEUE 1/* MSDU packet queue, Rx Command Queue */
345 #define PCI_MAX_RX_COUNT 128
346 #ifdef CONFIG_TRX_BD_ARCH
347 #define RX_BD_NUM PCI_MAX_RX_COUNT /* alias */
351 #ifdef CONFIG_TRX_BD_ARCH
352 struct rx_buf_desc *buf_desc;
354 struct recv_stat *desc;
358 struct sk_buff *rx_buf[PCI_MAX_RX_COUNT];
365 accesser of recv_priv: rtw_recv_entry(dispatch / passive level); recv_thread(passive) ; returnpkt(dispatch)
368 using enter_critical section to protect
373 #ifdef CONFIG_RECV_THREAD_MODE
375 _sema terminate_recvthread_sema;
378 /* _queue blk_strms[MAX_RX_NUMBLKS]; */ /* keeping the block ack frame until return ack */
379 _queue free_recv_queue;
380 _queue recv_pending_queue;
381 _queue uc_swdec_pending_queue;
384 u8 *pallocated_frame_buf;
387 uint free_recvframe_cnt;
391 #ifdef PLATFORM_WINDOWS
392 _nic_hdl RxPktPoolHdl;
393 _nic_hdl RxBufPoolHdl;
395 #ifdef PLATFORM_OS_XP
398 uint counter; /* record the number that up-layer will return to drv; only when counter==0 can we release recv_priv */
399 NDIS_EVENT recv_resource_evt ;
403 u32 is_any_non_be_pkts;
410 uint rx_largepacket_crcerr;
411 uint rx_smallpacket_crcerr;
412 uint rx_middlepacket_crcerr;
414 #ifdef CONFIG_USB_HCI
415 /* u8 *pallocated_urb_buf; */
416 _sema allrxreturnevt;
418 ATOMIC_T rx_pending_cnt;
420 #ifdef CONFIG_USB_INTERRUPT_IN_PIPE
421 #ifdef PLATFORM_LINUX
426 #endif /* CONFIG_USB_INTERRUPT_IN_PIPE */
429 #if defined(PLATFORM_LINUX) || defined(PLATFORM_FREEBSD)
430 #ifdef PLATFORM_FREEBSD
431 struct task irq_prepare_beacon_tasklet;
432 struct task recv_tasklet;
433 #else /* PLATFORM_FREEBSD */
434 struct tasklet_struct irq_prepare_beacon_tasklet;
435 struct tasklet_struct recv_tasklet;
436 #endif /* PLATFORM_FREEBSD */
437 struct sk_buff_head free_recv_skb_queue;
438 struct sk_buff_head rx_skb_queue;
439 #ifdef CONFIG_RTW_NAPI
440 struct sk_buff_head rx_napi_skb_queue;
442 #ifdef CONFIG_RX_INDICATE_QUEUE
443 struct task rx_indicate_tasklet;
444 struct ifqueue rx_indicate_queue;
445 #endif /* CONFIG_RX_INDICATE_QUEUE */
447 #endif /* defined(PLATFORM_LINUX) || defined(PLATFORM_FREEBSD) */
449 u8 *pallocated_recv_buf;
450 u8 *precv_buf; /* 4 alignment */
451 _queue free_recv_buf_queue;
452 u32 free_recv_buf_queue_cnt;
454 #if defined(CONFIG_SDIO_HCI) || defined(CONFIG_GSPI_HCI) || defined(CONFIG_USB_HCI)
455 _queue recv_buf_pending_queue;
458 #ifdef CONFIG_PCI_HCI
460 struct rtw_rx_ring rx_ring[PCI_MAX_RX_QUEUE];
461 int rxringcount; /* size should be PCI_MAX_RX_QUEUE */
465 /* For display the phy informatiom */
466 u8 is_signal_dbg; /* for debug */
467 u8 signal_strength_dbg; /* for debug */
471 s8 rssi; /* translate_percentage_to_dbm(ptarget_wlan->network.PhyInfo.SignalStrength); */
472 struct rx_raw_rssi raw_rssi_info;
475 /* int RxSNRdB[2]; */
477 /* int FalseAlmCnt_all; */
480 #ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
481 _timer signal_stat_timer;
482 u32 signal_stat_sampling_interval;
483 /* u32 signal_stat_converging_constant; */
484 struct signal_stat signal_qual_data;
485 struct signal_stat signal_strength_data;
486 #else /* CONFIG_NEW_SIGNAL_STAT_PROCESS */
487 struct smooth_rssi_data signal_qual_data;
488 struct smooth_rssi_data signal_strength_data;
489 #endif /* CONFIG_NEW_SIGNAL_STAT_PROCESS */
490 u16 sink_udpport, pre_rtp_rxseq, cur_rtp_rxseq;
492 BOOLEAN store_law_data_flag;
495 #ifdef CONFIG_NEW_SIGNAL_STAT_PROCESS
496 #define rtw_set_signal_stat_timer(recvpriv) _set_timer(&(recvpriv)->signal_stat_timer, (recvpriv)->signal_stat_sampling_interval)
497 #endif /* CONFIG_NEW_SIGNAL_STAT_PROCESS */
499 struct sta_recv_priv {
504 /* _queue blk_strms[MAX_RX_NUMBLKS]; */
505 _queue defrag_q; /* keeping the fragment frame until defrag */
507 struct stainfo_rxcache rxcache;
509 /* uint sta_rx_bytes; */
510 /* uint sta_rx_pkts; */
511 /* uint sta_rx_fail; */
534 #ifdef CONFIG_USB_HCI
536 #if defined(PLATFORM_OS_XP) || defined(PLATFORM_LINUX) || defined(PLATFORM_FREEBSD)
538 dma_addr_t dma_transfer_addr; /* (in) dma addr for transfer_buffer */
542 #ifdef PLATFORM_OS_XP
546 #ifdef PLATFORM_OS_CE
547 USB_TRANSFER usb_transfer_read_port;
555 #ifdef PLATFORM_LINUX
558 #ifdef PLATFORM_FREEBSD /* skb solution */
559 struct sk_buff *pskb;
560 #endif /* PLATFORM_FREEBSD */ /* skb solution */
576 len = (unsigned int )(tail - data);
579 struct recv_frame_hdr {
581 #ifndef CONFIG_BSD_RX_USE_MBUF
583 struct sk_buff *pkt_newalloc;
584 #else /* CONFIG_BSD_RX_USE_MBUF */
587 #endif /* CONFIG_BSD_RX_USE_MBUF */
595 struct rx_pkt_attrib attrib;
607 struct sta_info *psta;
609 /* for A-MPDU Rx reordering buffer control */
610 struct recv_reorder_ctrl *preorder_ctrl;
612 #ifdef CONFIG_WAPI_SUPPORT
616 u8 bWapiCheckPNInDecrypt;
627 struct recv_frame_hdr hdr;
628 uint mem[RECVFRAME_HDR_ALIGN >> 2];
631 /* uint mem[MAX_RXSZ>>2]; */
635 bool rtw_rframe_del_wfd_ie(union recv_frame *rframe, u8 ies_offset);
637 typedef enum _RX_PACKET_TYPE {
638 NORMAL_RX,/* Normal rx packet */
640 TX_REPORT2,/* TX RPT */
641 HIS_REPORT,/* USB HISR RPT */
643 } RX_PACKET_TYPE, *PRX_PACKET_TYPE;
645 extern union recv_frame *_rtw_alloc_recvframe(_queue *pfree_recv_queue); /* get a free recv_frame from pfree_recv_queue */
646 extern union recv_frame *rtw_alloc_recvframe(_queue *pfree_recv_queue); /* get a free recv_frame from pfree_recv_queue */
647 extern void rtw_init_recvframe(union recv_frame *precvframe , struct recv_priv *precvpriv);
648 extern int rtw_free_recvframe(union recv_frame *precvframe, _queue *pfree_recv_queue);
650 #define rtw_dequeue_recvframe(queue) rtw_alloc_recvframe(queue)
651 extern int _rtw_enqueue_recvframe(union recv_frame *precvframe, _queue *queue);
652 extern int rtw_enqueue_recvframe(union recv_frame *precvframe, _queue *queue);
654 extern void rtw_free_recvframe_queue(_queue *pframequeue, _queue *pfree_recv_queue);
655 u32 rtw_free_uc_swdec_pending_queue(_adapter *adapter);
657 sint rtw_enqueue_recvbuf_to_head(struct recv_buf *precvbuf, _queue *queue);
658 sint rtw_enqueue_recvbuf(struct recv_buf *precvbuf, _queue *queue);
659 struct recv_buf *rtw_dequeue_recvbuf(_queue *queue);
661 void rtw_reordering_ctrl_timeout_handler(void *pcontext);
663 void rx_query_phy_status(union recv_frame *rframe, u8 *phy_stat);
664 int rtw_inc_and_chk_continual_no_rx_packet(struct sta_info *sta, int tid_index);
665 void rtw_reset_continual_no_rx_packet(struct sta_info *sta, int tid_index);
667 #ifdef CONFIG_RECV_THREAD_MODE
668 thread_return rtw_recv_thread(thread_context context);
671 __inline static u8 *get_rxmem(union recv_frame *precvframe)
673 /* always return rx_head... */
674 if (precvframe == NULL)
677 return precvframe->u.hdr.rx_head;
680 __inline static u8 *get_rx_status(union recv_frame *precvframe)
683 return get_rxmem(precvframe);
687 __inline static u8 *get_recvframe_data(union recv_frame *precvframe)
690 /* alwasy return rx_data */
691 if (precvframe == NULL)
694 return precvframe->u.hdr.rx_data;
698 __inline static u8 *recvframe_push(union recv_frame *precvframe, sint sz)
700 /* append data before rx_data */
702 /* add data to the start of recv_frame
704 * This function extends the used data area of the recv_frame at the buffer
705 * start. rx_data must be still larger than rx_head, after pushing.
708 if (precvframe == NULL)
712 precvframe->u.hdr.rx_data -= sz ;
713 if (precvframe->u.hdr.rx_data < precvframe->u.hdr.rx_head) {
714 precvframe->u.hdr.rx_data += sz ;
718 precvframe->u.hdr.len += sz;
720 return precvframe->u.hdr.rx_data;
725 __inline static u8 *recvframe_pull(union recv_frame *precvframe, sint sz)
727 /* rx_data += sz; move rx_data sz bytes hereafter */
729 /* used for extract sz bytes from rx_data, update rx_data and return the updated rx_data to the caller */
732 if (precvframe == NULL)
736 precvframe->u.hdr.rx_data += sz;
738 if (precvframe->u.hdr.rx_data > precvframe->u.hdr.rx_tail) {
739 precvframe->u.hdr.rx_data -= sz;
743 precvframe->u.hdr.len -= sz;
745 return precvframe->u.hdr.rx_data;
749 __inline static u8 *recvframe_put(union recv_frame *precvframe, sint sz)
751 /* rx_tai += sz; move rx_tail sz bytes hereafter */
753 /* used for append sz bytes from ptr to rx_tail, update rx_tail and return the updated rx_tail to the caller */
754 /* after putting, rx_tail must be still larger than rx_end. */
755 unsigned char *prev_rx_tail;
757 /* RTW_INFO("recvframe_put: len=%d\n", sz); */
759 if (precvframe == NULL)
762 prev_rx_tail = precvframe->u.hdr.rx_tail;
764 precvframe->u.hdr.rx_tail += sz;
766 if (precvframe->u.hdr.rx_tail > precvframe->u.hdr.rx_end) {
767 precvframe->u.hdr.rx_tail -= sz;
771 precvframe->u.hdr.len += sz;
773 return precvframe->u.hdr.rx_tail;
779 __inline static u8 *recvframe_pull_tail(union recv_frame *precvframe, sint sz)
781 /* rmv data from rx_tail (by yitsen) */
783 /* used for extract sz bytes from rx_end, update rx_end and return the updated rx_end to the caller */
784 /* after pulling, rx_end must be still larger than rx_data. */
786 if (precvframe == NULL)
789 precvframe->u.hdr.rx_tail -= sz;
791 if (precvframe->u.hdr.rx_tail < precvframe->u.hdr.rx_data) {
792 precvframe->u.hdr.rx_tail += sz;
796 precvframe->u.hdr.len -= sz;
798 return precvframe->u.hdr.rx_tail;
804 __inline static _buffer *get_rxbuf_desc(union recv_frame *precvframe)
808 if (precvframe == NULL)
810 #ifdef PLATFORM_WINDOWS
811 NdisQueryPacket(precvframe->u.hdr.pkt, NULL, NULL, &buf_desc, NULL);
818 __inline static union recv_frame *rxmem_to_recvframe(u8 *rxmem)
820 /* due to the design of 2048 bytes alignment of recv_frame, we can reference the union recv_frame */
821 /* from any given member of recv_frame. */
822 /* rxmem indicates the any member/address in recv_frame */
824 return (union recv_frame *)(((SIZE_PTR)rxmem >> RXFRAME_ALIGN) << RXFRAME_ALIGN);
828 __inline static union recv_frame *pkt_to_recvframe(_pkt *pkt)
832 union recv_frame *precv_frame;
833 #ifdef PLATFORM_WINDOWS
837 NdisQueryPacket(pkt, NULL, NULL, &buf_desc, &len);
838 NdisQueryBufferSafe(buf_desc, &buf_star, &len, HighPagePriority);
840 precv_frame = rxmem_to_recvframe((unsigned char *)buf_star);
845 __inline static u8 *pkt_to_recvmem(_pkt *pkt)
847 /* return the rx_head */
849 union recv_frame *precv_frame = pkt_to_recvframe(pkt);
851 return precv_frame->u.hdr.rx_head;
855 __inline static u8 *pkt_to_recvdata(_pkt *pkt)
857 /* return the rx_data */
859 union recv_frame *precv_frame = pkt_to_recvframe(pkt);
861 return precv_frame->u.hdr.rx_data;
866 __inline static sint get_recvframe_len(union recv_frame *precvframe)
868 return precvframe->u.hdr.len;
872 __inline static s32 translate_percentage_to_dbm(u32 SignalStrengthIndex)
874 s32 SignalPower; /* in dBm. */
876 #ifdef CONFIG_SIGNAL_SCALE_MAPPING
877 /* Translate to dBm (x=0.5y-95). */
878 SignalPower = (s32)((SignalStrengthIndex + 1) >> 1);
881 /* Translate to dBm (x=y-100) */
882 SignalPower = SignalStrengthIndex - 100;
891 extern void _rtw_init_sta_recv_priv(struct sta_recv_priv *psta_recvpriv);
893 extern void mgt_dispatcher(_adapter *padapter, union recv_frame *precv_frame);
895 s32 pre_recv_entry(union recv_frame *precvframe, u8 *pphy_status);