[PATCH 6/8] firewire: expose extended tcode of incoming lock requests to (userspace) drivers

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Stefan Richter
Date: Sunday, June 20, 2010 - 1:53 pm

Date: Tue, 18 May 2010 10:57:33 -0400
From: Jay Fenlason <fenlason@redhat.com>

When a remote device does a LOCK_REQUEST, the core does not pass
the extended tcode to userspace.  This patch makes it use the
juju-specific tcodes listed in firewire-constants.h for incoming
requests.

Signed-off-by: Jay Fenlason <fenlason@redhat.com>

This matches how tcode in the API for outbound requests is treated.
Affects kernelspace and userspace drivers alike, but at the moment there
are no kernespace drivers that receive lock requests.

Split out from a combo patch, slightly reordered, changelog reworded.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
---
 drivers/firewire/core-transaction.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Index: b/drivers/firewire/core-transaction.c
===================================================================
--- a/drivers/firewire/core-transaction.c
+++ b/drivers/firewire/core-transaction.c
@@ -780,9 +780,11 @@ static void handle_exclusive_region_requ
 	unsigned long flags;
 	int tcode, destination, source;
 
-	tcode       = HEADER_GET_TCODE(p->header[0]);
 	destination = HEADER_GET_DESTINATION(p->header[0]);
 	source      = HEADER_GET_SOURCE(p->header[1]);
+	tcode       = HEADER_GET_TCODE(p->header[0]);
+	if (tcode == TCODE_LOCK_REQUEST)
+		tcode = 0x10 + HEADER_GET_EXTENDED_TCODE(p->header[3]);
 
 	spin_lock_irqsave(&address_handler_lock, flags);
 	handler = lookup_enclosing_address_handler(&address_handler_list,

-- 
Stefan Richter
-=====-==-=- -==- =-=--
http://arcgraph.de/sr/

--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/8] firewire: cdev ABI updates, Stefan Richter, (Sun Jun 20, 1:49 pm)
[PATCH 1/8] firewire: remove an unused function argument, Stefan Richter, (Sun Jun 20, 1:50 pm)
[PATCH 6/8] firewire: expose extended tcode of incoming lo ..., Stefan Richter, (Sun Jun 20, 1:53 pm)
Re: [PATCH 0/8] firewire: cdev ABI updates, Stefan Richter, (Sun Jun 20, 2:48 pm)