/** * fcp_avc_transaction - send an AV/C command and wait for its response * @unit: a unit on the target device * @command: a buffer containing the command frame; must be DMA-able * @command_size: the size of @command * @response: a buffer for the response frame * @response_size: the maximum size of @response * @response_match_bytes: a bitmap specifying the bytes used to detect the * correct response frame * * This function sends a FCP command frame to the target and waits for the * corresponding response frame to be returned. * * Because it is possible for multiple FCP transactions to be active at the * same time, the correct response frame is detected by the value of certain * bytes. These bytes must be set in @response before calling this function, * and the corresponding bits must be set in @response_match_bytes. * * @command and @response can point to the same buffer. * * Returns the actual size of the response frame, or a negative error code.
*/ int fcp_avc_transaction(struct fw_unit *unit, constvoid *command, unsignedint command_size, void *response, unsignedint response_size, unsignedint response_match_bytes)
{ struct fcp_transaction t; int tcode, ret, tries = 0;
if (t.state == STATE_DEFERRED) { /* * 'AV/C General Specification' define no time limit * on command completion once an INTERIM response has * been sent. but we promise to finish this function * for a caller. Here we use FCP_TIMEOUT_MS for next * interval. This is not in the specification.
*/
t.state = STATE_PENDING; goto deferred;
} elseif (t.state == STATE_COMPLETE) {
ret = t.response_size; break;
} elseif (t.state == STATE_BUS_RESET) {
msleep(ERROR_DELAY_MS);
} elseif (++tries >= ERROR_RETRIES) {
dev_err(&t.unit->device, "FCP command timed out\n");
ret = -EIO; break;
}
}
/** * fcp_bus_reset - inform the target handler about a bus reset * @unit: the unit that might be used by fcp_avc_transaction() * * This function must be called from the driver's .update handler to inform * the FCP transaction handler that a bus reset has happened. Any pending FCP * transactions are retried.
*/ void fcp_bus_reset(struct fw_unit *unit)
{ struct fcp_transaction *t;
¤ 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.0.12Bemerkung:
(vorverarbeitet)
¤
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.