aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Boot <bootc@bootc.net>2012-02-16 04:16:35 -0500
committerNicholas Bellinger <nab@linux-iscsi.org>2012-05-09 18:25:17 -0400
commit253d92371ca29a470b2bbf91fb9824a9fef05657 (patch)
tree69c778e3f21a88ce327cfa3d67e3a352074e48dc
parentd5dc28eb92f2a2305a02cb3a5f1ed36542d47512 (diff)
firewire: Add function to get speed from opaque struct fw_request
Sometimes it's useful to know the FireWire speed of the request that has just come in to a fw_address_handler callback. As struct fw_request is opaque we can't peek inside to get the speed out of the struct fw_packet that's just inside. For example, the SBP-2 spec says: "The speed at which the block write request to the MANAGEMENT_AGENT register is received shall determine the speed used by the target for all subsequent requests to read the initiator’s configuration ROM, fetch ORB’s from initiator memory or store status at the initiator’s status_FIFO. Command block ORB’s separately specify the speed for requests addressed to the data buffer or page table." [ ANSI T10/1155D Revision 4 page 53/54 ] Signed-off-by: Chris Boot <bootc@bootc.net> Acked-by: Stefan Richter <stefanr@s5r6.in-berlin.de> Cc: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Nicholas Bellinger <nab@linux-iscsi.org>
-rw-r--r--drivers/firewire/core-transaction.c9
-rw-r--r--include/linux/firewire.h1
2 files changed, 10 insertions, 0 deletions
diff --git a/drivers/firewire/core-transaction.c b/drivers/firewire/core-transaction.c
index dea2dcc9310d..db8a965cf712 100644
--- a/drivers/firewire/core-transaction.c
+++ b/drivers/firewire/core-transaction.c
@@ -820,6 +820,15 @@ void fw_send_response(struct fw_card *card,
820} 820}
821EXPORT_SYMBOL(fw_send_response); 821EXPORT_SYMBOL(fw_send_response);
822 822
823/**
824 * fw_get_request_speed() - returns speed at which the @request was received
825 */
826int fw_get_request_speed(struct fw_request *request)
827{
828 return request->response.speed;
829}
830EXPORT_SYMBOL(fw_get_request_speed);
831
823static void handle_exclusive_region_request(struct fw_card *card, 832static void handle_exclusive_region_request(struct fw_card *card,
824 struct fw_packet *p, 833 struct fw_packet *p,
825 struct fw_request *request, 834 struct fw_request *request,
diff --git a/include/linux/firewire.h b/include/linux/firewire.h
index cdc9b719e9c7..46831303b0b9 100644
--- a/include/linux/firewire.h
+++ b/include/linux/firewire.h
@@ -325,6 +325,7 @@ int fw_core_add_address_handler(struct fw_address_handler *handler,
325void fw_core_remove_address_handler(struct fw_address_handler *handler); 325void fw_core_remove_address_handler(struct fw_address_handler *handler);
326void fw_send_response(struct fw_card *card, 326void fw_send_response(struct fw_card *card,
327 struct fw_request *request, int rcode); 327 struct fw_request *request, int rcode);
328int fw_get_request_speed(struct fw_request *request);
328void fw_send_request(struct fw_card *card, struct fw_transaction *t, 329void fw_send_request(struct fw_card *card, struct fw_transaction *t,
329 int tcode, int destination_id, int generation, int speed, 330 int tcode, int destination_id, int generation, int speed,
330 unsigned long long offset, void *payload, size_t length, 331 unsigned long long offset, void *payload, size_t length,