mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 03:23:53 -04:00
firewire: core: add tracepoints events for asynchronous outbound response
In a view of core transaction service, the asynchronous outbound response
consists of two stages; initiation and completion.
This commit adds a pair of events for the asynchronous outbound response.
The following example is for asynchronous write quadlet request as IEC
61883-1 FCP response to node 0xffc1.
async_response_outbound_initiate: \
transaction=0xffff89fa08cf16c0 generation=4 scode=2 dst_id=0xffc1 \
tlabel=25 tcode=2 src_id=0xffc0 rcode=0 \
header={0xffc16420,0xffc00000,0x0,0x0} data={}
async_response_outbound_complete: \
transaction=0xffff89fa08cf16c0 generation=4 scode=2 status=1 \
timestamp=0x0000
Link: https://lore.kernel.org/r/20240429043218.609398-6-o-takashi@sakamocchi.jp
Signed-off-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
This commit is contained in:
@@ -668,6 +668,9 @@ static void free_response_callback(struct fw_packet *packet,
|
||||
{
|
||||
struct fw_request *request = container_of(packet, struct fw_request, response);
|
||||
|
||||
trace_async_response_outbound_complete((uintptr_t)request, packet->generation,
|
||||
packet->speed, status, packet->timestamp);
|
||||
|
||||
// Decrease the reference count since not at in-flight.
|
||||
fw_request_put(request);
|
||||
|
||||
@@ -850,6 +853,9 @@ static struct fw_request *allocate_request(struct fw_card *card,
|
||||
void fw_send_response(struct fw_card *card,
|
||||
struct fw_request *request, int rcode)
|
||||
{
|
||||
u32 *data = NULL;
|
||||
unsigned int data_length = 0;
|
||||
|
||||
/* unified transaction or broadcast transaction: don't respond */
|
||||
if (request->ack != ACK_PENDING ||
|
||||
HEADER_DESTINATION_IS_BROADCAST(request->request_header)) {
|
||||
@@ -857,17 +863,20 @@ void fw_send_response(struct fw_card *card,
|
||||
return;
|
||||
}
|
||||
|
||||
if (rcode == RCODE_COMPLETE)
|
||||
fw_fill_response(&request->response, request->request_header,
|
||||
rcode, request->data,
|
||||
fw_get_response_length(request));
|
||||
else
|
||||
fw_fill_response(&request->response, request->request_header,
|
||||
rcode, NULL, 0);
|
||||
if (rcode == RCODE_COMPLETE) {
|
||||
data = request->data;
|
||||
data_length = fw_get_response_length(request);
|
||||
}
|
||||
|
||||
fw_fill_response(&request->response, request->request_header, rcode, data, data_length);
|
||||
|
||||
// Increase the reference count so that the object is kept during in-flight.
|
||||
fw_request_get(request);
|
||||
|
||||
trace_async_response_outbound_initiate((uintptr_t)request, request->response.generation,
|
||||
request->response.speed, request->response.header,
|
||||
data, data ? data_length / 4 : 0);
|
||||
|
||||
card->driver->send_response(card, &request->response);
|
||||
}
|
||||
EXPORT_SYMBOL(fw_send_response);
|
||||
|
||||
Reference in New Issue
Block a user