software/drivers/sd8887/src/wlan/mlan/mlan_11n_rxreorder.c
/**
 *  @brief This function dispatches all the packets in the buffer.
 *         There could be holes in the buffer.
 *
 *  @param priv             A pointer to mlan_private
 *  @param rx_reor_tbl_ptr  A pointer to structure RxReorderTbl
 *  @param start_win        Start window
 *
 *  @return                 MLAN_STATUS_SUCCESS
 */
@brief This function dispatches all the packets in the buffer.
There could be holes in the buffer.

@param priv             A pointer to mlan_private
@param rx_reor_tbl_ptr  A pointer to structure RxReorderTbl
@param start_win        Start window


@brief This function dispatches all the packets in the buffer . There could be holes in the buffer . @param priv A pointer to mlan_private @param rx_reor_tbl_ptr A pointer to structure RxReorderTbl @param start_win Start window
static mlan_status
wlan_11n_dispatch_pkt_until_start_win(t_void *priv,
				      RxReorderTbl *rx_reor_tbl_ptr,
				      int start_win)
{
	int no_pkt_to_send, i, xchg;
	mlan_status ret = MLAN_STATUS_SUCCESS;
	void *rx_tmp_ptr = MNULL;
	mlan_private *pmpriv = (mlan_private *)priv;
	ENTER();
	no_pkt_to_send = (start_win > rx_reor_tbl_ptr->start_win) ?
		MIN((start_win - rx_reor_tbl_ptr->start_win),
		    rx_reor_tbl_ptr->win_size) : rx_reor_tbl_ptr->win_size;
	for (i = 0; i < no_pkt_to_send; ++i) {
		pmpriv->adapter->callbacks.moal_spin_lock(pmpriv->adapter->
							  pmoal_handle,
							  pmpriv->rx_pkt_lock);
		rx_tmp_ptr = MNULL;
		if (rx_reor_tbl_ptr->rx_reorder_ptr[i]) {
			rx_tmp_ptr = rx_reor_tbl_ptr->rx_reorder_ptr[i];
			rx_reor_tbl_ptr->rx_reorder_ptr[i] = MNULL;
		}
		pmpriv->adapter->callbacks.moal_spin_unlock(pmpriv->adapter->
							    pmoal_handle,
							    pmpriv->
							    rx_pkt_lock);
		if (rx_tmp_ptr)
			wlan_11n_dispatch_pkt(priv, rx_tmp_ptr,
					      rx_reor_tbl_ptr);
	}
	pmpriv->adapter->callbacks.moal_spin_lock(pmpriv->adapter->pmoal_handle,
						  pmpriv->rx_pkt_lock);
	xchg = rx_reor_tbl_ptr->win_size - no_pkt_to_send;
	for (i = 0; i < xchg; ++i) {
		rx_reor_tbl_ptr->rx_reorder_ptr[i] =
			rx_reor_tbl_ptr->rx_reorder_ptr[no_pkt_to_send + i];
		rx_reor_tbl_ptr->rx_reorder_ptr[no_pkt_to_send + i] = MNULL;
	}
	rx_reor_tbl_ptr->start_win = start_win;
	pmpriv->adapter->callbacks.moal_spin_unlock(pmpriv->adapter->
						    pmoal_handle,
						    pmpriv->rx_pkt_lock);
	LEAVE();
	return ret;
}
static mlan_status wlan_11n_dispatch_pkt_until_start_win ( t_void * priv , RxReorderTbl * rx_reor_tbl_ptr , int start_win ) { int no_pkt_to_send , i , xchg ; mlan_status ret = MLAN_STATUS_SUCCESS ; void * rx_tmp_ptr = MNULL ; mlan_private * pmpriv = ( mlan_private * ) priv ; ENTER ( ) ; no_pkt_to_send = ( start_win > rx_reor_tbl_ptr -> start_win ) ? MIN ( ( start_win - rx_reor_tbl_ptr -> start_win ) , rx_reor_tbl_ptr -> win_size ) : rx_reor_tbl_ptr -> win_size ; for ( i = 0 ; i < no_pkt_to_send ; ++ i ) { pmpriv -> adapter -> callbacks . moal_spin_lock ( pmpriv -> adapter -> pmoal_handle , pmpriv -> rx_pkt_lock ) ; rx_tmp_ptr = MNULL ; if ( rx_reor_tbl_ptr -> rx_reorder_ptr [ i ] ) { rx_tmp_ptr = rx_reor_tbl_ptr -> rx_reorder_ptr [ i ] ; rx_reor_tbl_ptr -> rx_reorder_ptr [ i ] = MNULL ; } pmpriv -> adapter -> callbacks . moal_spin_unlock ( pmpriv -> adapter -> pmoal_handle , pmpriv -> rx_pkt_lock ) ; if ( rx_tmp_ptr ) wlan_11n_dispatch_pkt ( priv , rx_tmp_ptr , rx_reor_tbl_ptr ) ; } pmpriv -> adapter -> callbacks . moal_spin_lock ( pmpriv -> adapter -> pmoal_handle , pmpriv -> rx_pkt_lock ) ; xchg = rx_reor_tbl_ptr -> win_size - no_pkt_to_send ; for ( i = 0 ; i < xchg ; ++ i ) { rx_reor_tbl_ptr -> rx_reorder_ptr [ i ] = rx_reor_tbl_ptr -> rx_reorder_ptr [ no_pkt_to_send + i ] ; rx_reor_tbl_ptr -> rx_reorder_ptr [ no_pkt_to_send + i ] = MNULL ; } rx_reor_tbl_ptr -> start_win = start_win ; pmpriv -> adapter -> callbacks . moal_spin_unlock ( pmpriv -> adapter -> pmoal_handle , pmpriv -> rx_pkt_lock ) ; LEAVE ( ) ; return ret ; }
@brief This function dispatches all the packets in the buffer.
@brief This function dispatches all the packets in the buffer .
/*
	 * We don't have a circular buffer, hence use rotation to simulate
	 * circular buffer
	 */