/** * as10x_cmd_turn_on - send turn on command to AS10x * @adap: pointer to AS10x bus adapter * * Return 0 when no error, < 0 in case of error.
*/ int as10x_cmd_turn_on(struct as10x_bus_adapter_t *adap)
{ int error = AS10X_CMD_ERROR; struct as10x_cmd_t *pcmd, *prsp;
/** * as10x_cmd_turn_off - send turn off command to AS10x * @adap: pointer to AS10x bus adapter * * Return 0 on success or negative value in case of error.
*/ int as10x_cmd_turn_off(struct as10x_bus_adapter_t *adap)
{ int error = AS10X_CMD_ERROR; struct as10x_cmd_t *pcmd, *prsp;
/** * as10x_cmd_set_tune - send set tune command to AS10x * @adap: pointer to AS10x bus adapter * @ptune: tune parameters * * Return 0 on success or negative value in case of error.
*/ int as10x_cmd_set_tune(struct as10x_bus_adapter_t *adap, struct as10x_tune_args *ptune)
{ int error = AS10X_CMD_ERROR; struct as10x_cmd_t *preq, *prsp;
/** * as10x_cmd_get_tune_status - send get tune status command to AS10x * @adap: pointer to AS10x bus adapter * @pstatus: pointer to updated status structure of the current tune * * Return 0 on success or negative value in case of error.
*/ int as10x_cmd_get_tune_status(struct as10x_bus_adapter_t *adap, struct as10x_tune_status *pstatus)
{ int error = AS10X_CMD_ERROR; struct as10x_cmd_t *preq, *prsp;
/* Response OK -> get response data */
pstatus->tune_state = prsp->body.get_tune_status.rsp.sts.tune_state;
pstatus->signal_strength =
le16_to_cpu((__force __le16)prsp->body.get_tune_status.rsp.sts.signal_strength);
pstatus->PER = le16_to_cpu((__force __le16)prsp->body.get_tune_status.rsp.sts.PER);
pstatus->BER = le16_to_cpu((__force __le16)prsp->body.get_tune_status.rsp.sts.BER);
out: return error;
}
/** * as10x_cmd_get_tps - send get TPS command to AS10x * @adap: pointer to AS10x handle * @ptps: pointer to TPS parameters structure * * Return 0 on success or negative value in case of error.
*/ int as10x_cmd_get_tps(struct as10x_bus_adapter_t *adap, struct as10x_tps *ptps)
{ int error = AS10X_CMD_ERROR; struct as10x_cmd_t *pcmd, *prsp;
/** * as10x_cmd_get_demod_stats - send get demod stats command to AS10x * @adap: pointer to AS10x bus adapter * @pdemod_stats: pointer to demod stats parameters structure * * Return 0 on success or negative value in case of error.
*/ int as10x_cmd_get_demod_stats(struct as10x_bus_adapter_t *adap, struct as10x_demod_stats *pdemod_stats)
{ int error = AS10X_CMD_ERROR; struct as10x_cmd_t *pcmd, *prsp;
/* Response OK -> get response data */
pdemod_stats->frame_count =
le32_to_cpu((__force __le32)prsp->body.get_demod_stats.rsp.stats.frame_count);
pdemod_stats->bad_frame_count =
le32_to_cpu((__force __le32)prsp->body.get_demod_stats.rsp.stats.bad_frame_count);
pdemod_stats->bytes_fixed_by_rs =
le32_to_cpu((__force __le32)prsp->body.get_demod_stats.rsp.stats.bytes_fixed_by_rs);
pdemod_stats->mer =
le16_to_cpu((__force __le16)prsp->body.get_demod_stats.rsp.stats.mer);
pdemod_stats->has_started =
prsp->body.get_demod_stats.rsp.stats.has_started;
out: return error;
}
/** * as10x_cmd_get_impulse_resp - send get impulse response command to AS10x * @adap: pointer to AS10x bus adapter * @is_ready: pointer to value indicating when impulse * response data is ready * * Return 0 on success or negative value in case of error.
*/ int as10x_cmd_get_impulse_resp(struct as10x_bus_adapter_t *adap,
uint8_t *is_ready)
{ int error = AS10X_CMD_ERROR; struct as10x_cmd_t *pcmd, *prsp;
/* Response OK -> get response data */
*is_ready = prsp->body.get_impulse_rsp.rsp.is_ready;
out: return error;
}
/** * as10x_cmd_build - build AS10x command header * @pcmd: pointer to AS10x command buffer * @xid: sequence id of the command * @cmd_len: length of the command
*/ void as10x_cmd_build(struct as10x_cmd_t *pcmd,
uint16_t xid, uint16_t cmd_len)
{
pcmd->header.req_id = cpu_to_le16(xid);
pcmd->header.prog = cpu_to_le16(SERVICE_PROG_ID);
pcmd->header.version = cpu_to_le16(SERVICE_PROG_VERSION);
pcmd->header.data_len = cpu_to_le16(cmd_len);
}
/** * as10x_rsp_parse - Parse command response * @prsp: pointer to AS10x command buffer * @proc_id: id of the command * * Return 0 on success or negative value in case of error.
*/ int as10x_rsp_parse(struct as10x_cmd_t *prsp, uint16_t proc_id)
{ int error;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.