software/drivers/sd8887/src/wlan/mlan/mlan_meas.c
/**
 *  @brief Send the input measurement request to the firmware.
 *
 *  If the dialog token in the measurement request is set to 0, the function
 *    will use an local static auto-incremented token in the measurement
 *    request.  This ensures the dialog token is always set.
 *
 *  If wait_for_resp_timeout is set, the function will block its return on
 *     a timeout or returned measurement report that matches the requests
 *     dialog token.
 *
 *  @param pmpriv                  Private driver information structure
 *  @param pmeas_req               Pointer to the measurement request to send
 *  @param wait_for_resp_timeout   Timeout value of the measurement request
 *                                 in ms.
 *  @param pioctl_req              Pointer to IOCTL request buffer
 *  @param pmeas_rpt               Output parameter: Pointer for the resulting
 *                                 measurement report
 *
 *  @return
 *    - 0 for success
 *    - -ETIMEDOUT if the measurement report does not return before
 *      the timeout expires
 *    - Error return from wlan_prepare_cmd routine otherwise
 */
@brief Send the input measurement request to the firmware.
If the dialog token in the measurement request is set to 0, the function
will use an local static auto-incremented token in the measurement
request.  This ensures the dialog token is always set.

If wait_for_resp_timeout is set, the function will block its return on
a timeout or returned measurement report that matches the requests
dialog token.

@param pmpriv                  Private driver information structure
@param pmeas_req               Pointer to the measurement request to send
@param wait_for_resp_timeout   Timeout value of the measurement request
in ms.
@param pioctl_req              Pointer to IOCTL request buffer
@param pmeas_rpt               Output parameter: Pointer for the resulting
measurement report

@return
- 0 for success
- -ETIMEDOUT if the measurement report does not return before
the timeout expires
- Error return from wlan_prepare_cmd routine otherwise
@brief Send the input measurement request to the firmware . If the dialog token in the measurement request is set to 0 the function will use an local static auto - incremented token in the measurement request . This ensures the dialog token is always set . If wait_for_resp_timeout is set the function will block its return on a timeout or returned measurement report that matches the requests dialog token . @param pmpriv Private driver information structure @param pmeas_req Pointer to the measurement request to send @param wait_for_resp_timeout Timeout value of the measurement request in ms . @param pioctl_req Pointer to IOCTL request buffer @param pmeas_rpt Output parameter : Pointer for the resulting measurement report @return - 0 for success - - ETIMEDOUT if the measurement report does not return before the timeout expires - Error return from wlan_prepare_cmd routine otherwise
int
wlan_meas_util_send_req(mlan_private *pmpriv,
			HostCmd_DS_MEASUREMENT_REQUEST *pmeas_req,
			t_u32 wait_for_resp_timeout, pmlan_ioctl_req pioctl_req,
			HostCmd_DS_MEASUREMENT_REPORT *pmeas_rpt)
{
	static t_u8 auto_dialog_tok;
	wlan_meas_state_t *pmeas_state = &pmpriv->adapter->state_meas;
	int ret;
	ENTER();
	pmeas_req->dialog_token = (pmeas_req->dialog_token ?
				   pmeas_req->dialog_token : ++auto_dialog_tok);
	pmeas_req->dialog_token = (pmeas_req->dialog_token ?
				   pmeas_req->dialog_token : 1);
	if (wait_for_resp_timeout) {
		pmeas_state->meas_rpt_pend_on = pmeas_req->dialog_token;
		PRINTM(MINFO, "Meas: Req: START Pend on meas #%d\n",
		       pmeas_req->dialog_token);
	}
	ret = wlan_prepare_cmd(pmpriv, HostCmd_CMD_MEASUREMENT_REQUEST,
			       HostCmd_ACT_GEN_SET,
			       0, (t_void *)pioctl_req, (void *)pmeas_req);
	LEAVE();
	return ret;
}
int wlan_meas_util_send_req ( mlan_private * pmpriv , HostCmd_DS_MEASUREMENT_REQUEST * pmeas_req , t_u32 wait_for_resp_timeout , pmlan_ioctl_req pioctl_req , HostCmd_DS_MEASUREMENT_REPORT * pmeas_rpt ) { static t_u8 auto_dialog_tok ; wlan_meas_state_t * pmeas_state = & pmpriv -> adapter -> state_meas ; int ret ; ENTER ( ) ; pmeas_req -> dialog_token = ( pmeas_req -> dialog_token ? pmeas_req -> dialog_token : ++ auto_dialog_tok ) ; pmeas_req -> dialog_token = ( pmeas_req -> dialog_token ? pmeas_req -> dialog_token : 1 ) ; if ( wait_for_resp_timeout ) { pmeas_state -> meas_rpt_pend_on = pmeas_req -> dialog_token ; PRINTM ( MINFO , " \n " , pmeas_req -> dialog_token ) ; } ret = wlan_prepare_cmd ( pmpriv , HostCmd_CMD_MEASUREMENT_REQUEST , HostCmd_ACT_GEN_SET , 0 , ( t_void * ) pioctl_req , ( void * ) pmeas_req ) ; LEAVE ( ) ; return ret ; }
@brief Send the input measurement request to the firmware.
@brief Send the input measurement request to the firmware .
/* If dialogTok was set to 0 or not provided, autoset */ /* Check for rollover of the dialog token.  Avoid using 0 as a token */ /*
	 * If the request is to pend waiting for the result, set the dialog token
	 * of this measurement request in the state structure.  The measurement
	 * report handling routines can then check the incoming measurement
	 * reports for a match with this dialog token.
	 */ /* Send the measurement request to the firmware */