hal/rtl8192e/pci/pci_ops_linux.c
u32
rtl8192ee_wait_rxrdy(
	_adapter			*padapter,
	u8				*rx_desc,		/* rx_buf_desc */
	u16				rx_queue_idx
)
{

	struct recv_priv	*precvpriv = &padapter->recvpriv;
	u8 first_seg = 0, last_seg = 0;
	u16 total_len = 0, read_cnt = 0;
	static BOOLEAN	start_rx = _FALSE;
	u16 status = _SUCCESS;
	HAL_DATA_TYPE	*pHalData = GET_HAL_DATA(padapter);

	if (rx_desc == NULL)
		return _FAIL;

	total_len = (u2Byte)GET_RX_BUFFER_DESC_TOTAL_LENGTH_92E(rx_desc);
	first_seg = (u1Byte)GET_RX_BUFFER_DESC_FS_92E(rx_desc);
	last_seg = (u1Byte)GET_RX_BUFFER_DESC_LS_92E(rx_desc);

	buf_desc_debug("RX:%s enter: rx_buf_desc addr = %p, total_len=%d, first_seg=%d, last_seg=%d, read_cnt %d, index %d, address %p\n", \
		__FUNCTION__, (u8 *)&precvpriv->rx_ring[rx_queue_idx].desc[precvpriv->rx_ring[rx_queue_idx].idx], total_len, first_seg, last_seg, read_cnt,
		       precvpriv->rx_ring[rx_queue_idx].idx, rx_desc);

#if defined(USING_RX_TAG)
	/* Rx Tag not ported */
	if (!start_rx) {
		start_rx = _TRUE;
		pHalData->RxTag = 1;
	} else {
		while (total_len != (pHalData->RxTag + 1)) {

			read_cnt++;

			total_len = (u2Byte)GET_RX_BUFFER_DESC_TOTAL_LENGTH_92E(rx_desc);

			first_seg = (u1Byte)GET_RX_BUFFER_DESC_FS_92E(rx_desc);

			last_seg = (u1Byte)GET_RX_BUFFER_DESC_LS_92E(rx_desc);


			if (read_cnt > 10000) {
				pHalData->RxTag = total_len;
				break;
			}

			if (total_len == 0 && pHalData->RxTag == 0x1fff)
				break;
		}
		pHalData->RxTag = total_len;
	}
#else
	while (total_len == 0 && first_seg == 0 && last_seg == 0) {

		read_cnt++;

		total_len = (u2Byte)GET_RX_BUFFER_DESC_TOTAL_LENGTH_92E(rx_desc);

		first_seg = (u1Byte)GET_RX_BUFFER_DESC_FS_92E(rx_desc);

		last_seg = (u1Byte)GET_RX_BUFFER_DESC_LS_92E(rx_desc);

		if (read_cnt > 20) {
			status = _FAIL;
			break;
		}
	}
#endif

	buf_desc_debug("RX:%s exit total_len=%d, rx_tag = %d, first_seg=%d, last_seg=%d, read_cnt %d\n", \
		__FUNCTION__, total_len, pHalData->RxTag, first_seg, last_seg, read_cnt);

	return status;

}
/*
  * Wait until rx data is ready
  *	return value: _SUCCESS if Rx packet is ready, _FAIL if not ready
  */
Wait until rx data is ready
return value: _SUCCESS if Rx packet is ready, _FAIL if not ready
Wait until rx data is ready return value : _SUCCESS if Rx packet is ready _FAIL if not ready
u32
rtl8192ee_wait_rxrdy(
	_adapter			*padapter,
	u8				*rx_desc,		
	u16				rx_queue_idx
)
{
	struct recv_priv	*precvpriv = &padapter->recvpriv;
	u8 first_seg = 0, last_seg = 0;
	u16 total_len = 0, read_cnt = 0;
	static BOOLEAN	start_rx = _FALSE;
	u16 status = _SUCCESS;
	HAL_DATA_TYPE	*pHalData = GET_HAL_DATA(padapter);
	if (rx_desc == NULL)
		return _FAIL;
	total_len = (u2Byte)GET_RX_BUFFER_DESC_TOTAL_LENGTH_92E(rx_desc);
	first_seg = (u1Byte)GET_RX_BUFFER_DESC_FS_92E(rx_desc);
	last_seg = (u1Byte)GET_RX_BUFFER_DESC_LS_92E(rx_desc);
	buf_desc_debug("RX:%s enter: rx_buf_desc addr = %p, total_len=%d, first_seg=%d, last_seg=%d, read_cnt %d, index %d, address %p\n", \
		__FUNCTION__, (u8 *)&precvpriv->rx_ring[rx_queue_idx].desc[precvpriv->rx_ring[rx_queue_idx].idx], total_len, first_seg, last_seg, read_cnt,
		       precvpriv->rx_ring[rx_queue_idx].idx, rx_desc);
#if defined(USING_RX_TAG)
	if (!start_rx) {
		start_rx = _TRUE;
		pHalData->RxTag = 1;
	} else {
		while (total_len != (pHalData->RxTag + 1)) {
			read_cnt++;
			total_len = (u2Byte)GET_RX_BUFFER_DESC_TOTAL_LENGTH_92E(rx_desc);
			first_seg = (u1Byte)GET_RX_BUFFER_DESC_FS_92E(rx_desc);
			last_seg = (u1Byte)GET_RX_BUFFER_DESC_LS_92E(rx_desc);
			if (read_cnt > 10000) {
				pHalData->RxTag = total_len;
				break;
			}
			if (total_len == 0 && pHalData->RxTag == 0x1fff)
				break;
		}
		pHalData->RxTag = total_len;
	}
#else
	while (total_len == 0 && first_seg == 0 && last_seg == 0) {
		read_cnt++;
		total_len = (u2Byte)GET_RX_BUFFER_DESC_TOTAL_LENGTH_92E(rx_desc);
		first_seg = (u1Byte)GET_RX_BUFFER_DESC_FS_92E(rx_desc);
		last_seg = (u1Byte)GET_RX_BUFFER_DESC_LS_92E(rx_desc);
		if (read_cnt > 20) {
			status = _FAIL;
			break;
		}
	}
#endif
	buf_desc_debug("RX:%s exit total_len=%d, rx_tag = %d, first_seg=%d, last_seg=%d, read_cnt %d\n", \
		__FUNCTION__, total_len, pHalData->RxTag, first_seg, last_seg, read_cnt);
	return status;
}
u32 rtl8192ee_wait_rxrdy ( _adapter * padapter , u8 * rx_desc , u16 rx_queue_idx ) { struct recv_priv * precvpriv = & padapter -> recvpriv ; u8 first_seg = 0 , last_seg = 0 ; u16 total_len = 0 , read_cnt = 0 ; static BOOLEAN start_rx = _FALSE ; u16 status = _SUCCESS ; HAL_DATA_TYPE * pHalData = GET_HAL_DATA ( padapter ) ; if ( rx_desc == NULL ) return _FAIL ; total_len = ( u2Byte ) GET_RX_BUFFER_DESC_TOTAL_LENGTH_92E ( rx_desc ) ; first_seg = ( u1Byte ) GET_RX_BUFFER_DESC_FS_92E ( rx_desc ) ; last_seg = ( u1Byte ) GET_RX_BUFFER_DESC_LS_92E ( rx_desc ) ; buf_desc_debug ( " \n " , __FUNCTION__ , ( u8 * ) & precvpriv -> rx_ring [ rx_queue_idx ] . desc [ precvpriv -> rx_ring [ rx_queue_idx ] . idx ] , total_len , first_seg , last_seg , read_cnt , precvpriv -> rx_ring [ rx_queue_idx ] . idx , rx_desc ) ; #if defined ( USING_RX_TAG ) if ( ! start_rx ) { start_rx = _TRUE ; pHalData -> RxTag = 1 ; } else { while ( total_len != ( pHalData -> RxTag + 1 ) ) { read_cnt ++ ; total_len = ( u2Byte ) GET_RX_BUFFER_DESC_TOTAL_LENGTH_92E ( rx_desc ) ; first_seg = ( u1Byte ) GET_RX_BUFFER_DESC_FS_92E ( rx_desc ) ; last_seg = ( u1Byte ) GET_RX_BUFFER_DESC_LS_92E ( rx_desc ) ; if ( read_cnt > 10000 ) { pHalData -> RxTag = total_len ; break ; } if ( total_len == 0 && pHalData -> RxTag == 0x1fff ) break ; } pHalData -> RxTag = total_len ; } #else while ( total_len == 0 && first_seg == 0 && last_seg == 0 ) { read_cnt ++ ; total_len = ( u2Byte ) GET_RX_BUFFER_DESC_TOTAL_LENGTH_92E ( rx_desc ) ; first_seg = ( u1Byte ) GET_RX_BUFFER_DESC_FS_92E ( rx_desc ) ; last_seg = ( u1Byte ) GET_RX_BUFFER_DESC_LS_92E ( rx_desc ) ; if ( read_cnt > 20 ) { status = _FAIL ; break ; } } #endif buf_desc_debug ( " \n " , __FUNCTION__ , total_len , pHalData -> RxTag , first_seg , last_seg , read_cnt ) ; return status ; }
Wait until rx data is ready
     return value: _SUCCESS if Rx packet is ready, _FAIL if not ready
Wait until rx data is ready return value : _SUCCESS if Rx packet is ready _FAIL if not ready
/* rx_buf_desc */ /* Rx Tag not ported */