software/drivers/sd8887/src/wlan/mlan/mlan_init.c
/**
 *  @brief This function adds a BSS priority table
 *
 *  @param priv     A pointer to mlan_private structure
 *
 *  @return         MLAN_STATUS_SUCCESS or MLAN_STATUS_FAILURE
 */
@brief This function adds a BSS priority table
@param priv     A pointer to mlan_private structure


@brief This function adds a BSS priority table @param priv A pointer to mlan_private structure
static mlan_status
wlan_add_bsspriotbl(pmlan_private priv)
{
	pmlan_adapter pmadapter = priv->adapter;
	mlan_bssprio_node *pbssprio = MNULL;
	mlan_status status = MLAN_STATUS_SUCCESS;
	ENTER();
	status = pmadapter->callbacks.moal_malloc(pmadapter->pmoal_handle,
						  sizeof(mlan_bssprio_node),
						  MLAN_MEM_DEF,
						  (t_u8 **)&pbssprio);
	if (status) {
		PRINTM(MERROR, "Failed to allocate bsspriotbl\n");
		LEAVE();
		return status;
	}
	pbssprio->priv = priv;
	util_init_list((pmlan_linked_list)pbssprio);
	if (!pmadapter->bssprio_tbl[priv->bss_priority].bssprio_cur)
		pmadapter->bssprio_tbl[priv->bss_priority].bssprio_cur
			= pbssprio;
	util_enqueue_list_tail(pmadapter->pmoal_handle,
			       &pmadapter->bssprio_tbl[priv->bss_priority].
			       bssprio_head, (pmlan_linked_list)pbssprio,
			       pmadapter->callbacks.moal_spin_lock,
			       pmadapter->callbacks.moal_spin_unlock);
	LEAVE();
	return status;
}
static mlan_status wlan_add_bsspriotbl ( pmlan_private priv ) { pmlan_adapter pmadapter = priv -> adapter ; mlan_bssprio_node * pbssprio = MNULL ; mlan_status status = MLAN_STATUS_SUCCESS ; ENTER ( ) ; status = pmadapter -> callbacks . moal_malloc ( pmadapter -> pmoal_handle , sizeof ( mlan_bssprio_node ) , MLAN_MEM_DEF , ( t_u8 * * ) & pbssprio ) ; if ( status ) { PRINTM ( MERROR , " \n " ) ; LEAVE ( ) ; return status ; } pbssprio -> priv = priv ; util_init_list ( ( pmlan_linked_list ) pbssprio ) ; if ( ! pmadapter -> bssprio_tbl [ priv -> bss_priority ] . bssprio_cur ) pmadapter -> bssprio_tbl [ priv -> bss_priority ] . bssprio_cur = pbssprio ; util_enqueue_list_tail ( pmadapter -> pmoal_handle , & pmadapter -> bssprio_tbl [ priv -> bss_priority ] . bssprio_head , ( pmlan_linked_list ) pbssprio , pmadapter -> callbacks . moal_spin_lock , pmadapter -> callbacks . moal_spin_unlock ) ; LEAVE ( ) ; return status ; }
@brief This function adds a BSS priority table
  @param priv     A pointer to mlan_private structure
@brief This function adds a BSS priority table @param priv A pointer to mlan_private structure