software/drivers/sd8887/src/wlan/mlinux/moal_priv.c
/**
 * @brief Set/Get reassociation settings
 *
 * @param priv     A pointer to moal_private structure
 * @param wrq      A pointer to iwreq structure
 *
 * @return         0 --success, otherwise fail
 */
@brief Set/Get reassociation settings
@param priv     A pointer to moal_private structure
@param wrq      A pointer to iwreq structure

@return         0 --success, otherwise fail
@brief Set / Get reassociation settings @param priv A pointer to moal_private structure @param wrq A pointer to iwreq structure @return 0 -- success otherwise fail
static int
woal_set_get_reassoc(moal_private *priv, struct iwreq *wrq)
{
	moal_handle *handle = priv->phandle;
	int ret = 0;
	int data = 0;
	ENTER();
	if (wrq->u.data.length) {
		if (copy_from_user(&data, wrq->u.data.pointer, sizeof(int))) {
			PRINTM(MERROR, "Copy from user failed\n");
			ret = -EFAULT;
			goto done;
		}
		if (data == 0) {
			handle->reassoc_on &= ~MBIT(priv->bss_index);
			priv->reassoc_on = MFALSE;
			priv->reassoc_required = MFALSE;
			if (!handle->reassoc_on &&
			    handle->is_reassoc_timer_set == MTRUE) {
				woal_cancel_timer(&handle->reassoc_timer);
				handle->is_reassoc_timer_set = MFALSE;
			}
		} else {
			handle->reassoc_on |= MBIT(priv->bss_index);
			priv->reassoc_on = MTRUE;
		}
	} else {
		data = (int)(priv->reassoc_on);
		if (copy_to_user(wrq->u.data.pointer, &data, sizeof(int))) {
			ret = -EFAULT;
			goto done;
		}
		wrq->u.data.length = 1;
	}
done:
	LEAVE();
	return ret;
}
static int woal_set_get_reassoc ( moal_private * priv , struct iwreq * wrq ) { moal_handle * handle = priv -> phandle ; int ret = 0 ; int data = 0 ; ENTER ( ) ; if ( wrq -> u . data . length ) { if ( copy_from_user ( & data , wrq -> u . data . pointer , sizeof ( int ) ) ) { PRINTM ( MERROR , " \n " ) ; ret = - EFAULT ; goto done ; } if ( data == 0 ) { handle -> reassoc_on &= ~ MBIT ( priv -> bss_index ) ; priv -> reassoc_on = MFALSE ; priv -> reassoc_required = MFALSE ; if ( ! handle -> reassoc_on && handle -> is_reassoc_timer_set == MTRUE ) { woal_cancel_timer ( & handle -> reassoc_timer ) ; handle -> is_reassoc_timer_set = MFALSE ; } } else { handle -> reassoc_on |= MBIT ( priv -> bss_index ) ; priv -> reassoc_on = MTRUE ; } } else { data = ( int ) ( priv -> reassoc_on ) ; if ( copy_to_user ( wrq -> u . data . pointer , & data , sizeof ( int ) ) ) { ret = - EFAULT ; goto done ; } wrq -> u . data . length = 1 ; } done : LEAVE ( ) ; return ret ; }
@brief Set/Get reassociation settings
 @param priv     A pointer to moal_private structure
 @param wrq      A pointer to iwreq structure
@brief Set / Get reassociation settings @param priv A pointer to moal_private structure @param wrq A pointer to iwreq structure