software/drivers/sd8887/src/wlan/mlinux/moal_ioctl.c
/**
 *  @brief set rssi low threshold
 *
 *  @param priv                 A pointer to moal_private structure
 *  @param rssi                 A pointer to low rssi
 *  @param wait_option          Wait option
 *
 *  @return                     MLAN_STATUS_SUCCESS -- success, otherwise fail
 */
@brief set rssi low threshold
@param priv                 A pointer to moal_private structure
@param rssi                 A pointer to low rssi
@param wait_option          Wait option

@return                     MLAN_STATUS_SUCCESS -- success, otherwise fail
@brief set rssi low threshold @param priv A pointer to moal_private structure @param rssi A pointer to low rssi @param wait_option Wait option @return MLAN_STATUS_SUCCESS -- success otherwise fail
mlan_status
woal_set_rssi_low_threshold(moal_private *priv, char *rssi, t_u8 wait_option)
{
	mlan_status ret = MLAN_STATUS_SUCCESS;
	mlan_ioctl_req *req = NULL;
	mlan_ds_misc_cfg *misc = NULL;
	int low_rssi = 0;
	ENTER();
	if (priv->media_connected == MFALSE)
		goto done;
	req = woal_alloc_mlan_ioctl_req(sizeof(mlan_ds_misc_cfg));
	if (req == NULL) {
		ret = MLAN_STATUS_FAILURE;
		goto done;
	}
	misc = (mlan_ds_misc_cfg *)req->pbuf;
	req->req_id = MLAN_IOCTL_MISC_CFG;
	misc->sub_command = MLAN_OID_MISC_SUBSCRIBE_EVENT;
	req->action = MLAN_ACT_SET;
	misc->param.subscribe_event.evt_action = SUBSCRIBE_EVT_ACT_BITWISE_SET;
	misc->param.subscribe_event.evt_bitmap = SUBSCRIBE_EVT_RSSI_LOW;
	misc->param.subscribe_event.evt_bitmap |= SUBSCRIBE_EVT_PRE_BEACON_LOST;
	misc->param.subscribe_event.pre_beacon_miss = DEFAULT_PRE_BEACON_MISS;
	if (MLAN_STATUS_SUCCESS != woal_atoi(&low_rssi, rssi)) {
		ret = MLAN_STATUS_FAILURE;
		goto done;
	}
#ifdef STA_CFG80211
	priv->mrvl_rssi_low = low_rssi;
#endif
	misc->param.subscribe_event.low_rssi = low_rssi;
	misc->param.subscribe_event.low_rssi_freq = 0;
	ret = woal_request_ioctl(priv, req, wait_option);
	if (ret == MLAN_STATUS_FAILURE) {
		PRINTM(MERROR, "request set rssi_low_threshold fail!\n");
		goto done;
	}
done:
	if (ret != MLAN_STATUS_PENDING)
		kfree(req);
	LEAVE();
	return ret;
}
mlan_status woal_set_rssi_low_threshold ( moal_private * priv , char * rssi , t_u8 wait_option ) { mlan_status ret = MLAN_STATUS_SUCCESS ; mlan_ioctl_req * req = NULL ; mlan_ds_misc_cfg * misc = NULL ; int low_rssi = 0 ; ENTER ( ) ; if ( priv -> media_connected == MFALSE ) goto done ; req = woal_alloc_mlan_ioctl_req ( sizeof ( mlan_ds_misc_cfg ) ) ; if ( req == NULL ) { ret = MLAN_STATUS_FAILURE ; goto done ; } misc = ( mlan_ds_misc_cfg * ) req -> pbuf ; req -> req_id = MLAN_IOCTL_MISC_CFG ; misc -> sub_command = MLAN_OID_MISC_SUBSCRIBE_EVENT ; req -> action = MLAN_ACT_SET ; misc -> param . subscribe_event . evt_action = SUBSCRIBE_EVT_ACT_BITWISE_SET ; misc -> param . subscribe_event . evt_bitmap = SUBSCRIBE_EVT_RSSI_LOW ; misc -> param . subscribe_event . evt_bitmap |= SUBSCRIBE_EVT_PRE_BEACON_LOST ; misc -> param . subscribe_event . pre_beacon_miss = DEFAULT_PRE_BEACON_MISS ; if ( MLAN_STATUS_SUCCESS != woal_atoi ( & low_rssi , rssi ) ) { ret = MLAN_STATUS_FAILURE ; goto done ; } #ifdef STA_CFG80211 priv -> mrvl_rssi_low = low_rssi ; #endif misc -> param . subscribe_event . low_rssi = low_rssi ; misc -> param . subscribe_event . low_rssi_freq = 0 ; ret = woal_request_ioctl ( priv , req , wait_option ) ; if ( ret == MLAN_STATUS_FAILURE ) { PRINTM ( MERROR , " \n " ) ; goto done ; } done : if ( ret != MLAN_STATUS_PENDING ) kfree ( req ) ; LEAVE ( ) ; return ret ; }
@brief set rssi low threshold
  @param priv                 A pointer to moal_private structure
  @param rssi                 A pointer to low rssi
  @param wait_option          Wait option
@brief set rssi low threshold @param priv A pointer to moal_private structure @param rssi A pointer to low rssi @param wait_option Wait option