software/drivers/sd8887/src/wlan/mlan/mlan_sdio.c
/**
 *  @brief This function receives single packet
 *
 *  @param pmadapter A pointer to mlan_adapter structure
 *  @return          MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
 */
@brief This function receives single packet
@param pmadapter A pointer to mlan_adapter structure
@return          MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
@brief This function receives single packet @param pmadapter A pointer to mlan_adapter structure @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
mlan_status
wlan_receive_single_packet(mlan_adapter *pmadapter)
{
	mlan_buffer *pmbuf;
	t_u8 port;
	t_u16 rx_len;
	t_u32 pkt_type = 0;
	mlan_status ret = MLAN_STATUS_SUCCESS;
	ENTER();
	pmbuf = pmadapter->mpa_rx.mbuf_arr[0];
	port = pmadapter->mpa_rx.start_port;
	rx_len = pmadapter->mpa_rx.len_arr[0];
	if (MLAN_STATUS_SUCCESS != wlan_sdio_card_to_host(pmadapter, &pkt_type,
							  (t_u32 *)&pmadapter->
							  upld_len, pmbuf,
							  rx_len,
							  pmadapter->ioport +
							  port)) {
		ret = MLAN_STATUS_FAILURE;
		goto done;
	}
	if (pkt_type != MLAN_TYPE_DATA && pkt_type != MLAN_TYPE_SPA_DATA) {
		PRINTM(MERROR,
		       "receive a wrong pkt from DATA PORT: type=%d, len=%dd\n",
		       pkt_type, pmbuf->data_len);
		pmbuf->status_code = MLAN_ERROR_DATA_RX_FAIL;
		ret = MLAN_STATUS_FAILURE;
		goto done;
	}
	pmadapter->mpa_rx_count[0]++;
	wlan_decode_rx_packet(pmadapter, pmbuf, pkt_type, MTRUE);
done:
	if (ret != MLAN_STATUS_SUCCESS)
		wlan_free_mlan_buffer(pmadapter, pmbuf);
	MP_RX_AGGR_BUF_RESET(pmadapter);
	LEAVE();
	return ret;
}
mlan_status wlan_receive_single_packet ( mlan_adapter * pmadapter ) { mlan_buffer * pmbuf ; t_u8 port ; t_u16 rx_len ; t_u32 pkt_type = 0 ; mlan_status ret = MLAN_STATUS_SUCCESS ; ENTER ( ) ; pmbuf = pmadapter -> mpa_rx . mbuf_arr [ 0 ] ; port = pmadapter -> mpa_rx . start_port ; rx_len = pmadapter -> mpa_rx . len_arr [ 0 ] ; if ( MLAN_STATUS_SUCCESS != wlan_sdio_card_to_host ( pmadapter , & pkt_type , ( t_u32 * ) & pmadapter -> upld_len , pmbuf , rx_len , pmadapter -> ioport + port ) ) { ret = MLAN_STATUS_FAILURE ; goto done ; } if ( pkt_type != MLAN_TYPE_DATA && pkt_type != MLAN_TYPE_SPA_DATA ) { PRINTM ( MERROR , " \n " , pkt_type , pmbuf -> data_len ) ; pmbuf -> status_code = MLAN_ERROR_DATA_RX_FAIL ; ret = MLAN_STATUS_FAILURE ; goto done ; } pmadapter -> mpa_rx_count [ 0 ] ++ ; wlan_decode_rx_packet ( pmadapter , pmbuf , pkt_type , MTRUE ) ; done : if ( ret != MLAN_STATUS_SUCCESS ) wlan_free_mlan_buffer ( pmadapter , pmbuf ) ; MP_RX_AGGR_BUF_RESET ( pmadapter ) ; LEAVE ( ) ; return ret ; }
@brief This function receives single packet
  @param pmadapter A pointer to mlan_adapter structure
  @return          MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
@brief This function receives single packet @param pmadapter A pointer to mlan_adapter structure @return MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE