LKML Archive on
help / color / mirror / Atom feed
From: Stefan Richter <>
To: Philipp Beyer <>
Subject: Re: ieee1394 feature needed: overwrite SPLIT_TIMEOUT from userspace
Date: Mon, 15 Jan 2007 19:30:02 +0100 (CET)	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <1168872870.5190.18.camel@ahr-pbe-lx.avtnet.local>

On 15 Jan, Philipp Beyer wrote:
> In fact steps 01-09 describe what I had in mind pretty well :-) 

Of course there are many more possibilities. In case of SBP-2 for
example, there are
 - huge command + data buffers on the PC (or a 3rd node),
 - a status register on the PC,
 - a notification register on the device (actually some more registers
   but that's not important).
The PC writes to the notification register of the device to inform it
about new a command and data. The device then fetches the command and,
depending on the command, fetches or sends data from/to the buffers on
the PC. When it is finished, it writes status to the PC's status
register. Between notification and status write, the device's fetch
agent may read/write commands and data in any order and with as many
transactions it likes.

Of course this isn't exactly the simplest protocol for your kind of

Anyway. Do you still want a patch like the following one? Should apply
to 2.6.20-rcX but you should have no difficulties to adapt it to 2.6.19
or older. (The first hunk won't apply before 2.6.20-rc1.)

From: Stefan Richter <>
Subject: ieee1394: allow nonstandard SPLIT_TIMEOUT

Relax the rule that SPLIT_TIMEOUT_HI cannot be bigger than 7 (seconds).
Longer split transaction timeouts are outside the IEEE 1394 spec but may
be useful with custom hardware.  Now we allow up to 255 (seconds, plus
the subseconds part in SPLIT_TIMEOUT_LO) but only if the local node was
writing to SPLIT_TIMEOUT_HI.

Any nonstandard contents of SPLIT_TIMEOUT_HI will be shown as-is to any
node which reads the register, e.g. a bus manager.

Signed-off-by: Stefan Richter <>

  Only compile-tested.

Index: linux/drivers/ieee1394/csr.c
--- linux.orig/drivers/ieee1394/csr.c
+++ linux/drivers/ieee1394/csr.c
@@ -158,7 +158,7 @@ static void host_reset(struct hpsb_host 
 static inline void calculate_expire(struct csr_control *csr)
-	unsigned int usecs = (csr->split_timeout_hi & 7) * 1000000 +
+	unsigned int usecs = csr->split_timeout_hi * 1000000 +
 			     (csr->split_timeout_lo >> 19) * 125;
 	csr->expire = usecs_to_jiffies(usecs > 100000 ? usecs : 100000);
@@ -480,8 +480,11 @@ static int write_regs(struct hpsb_host *
                 return RCODE_ADDRESS_ERROR;
         case CSR_SPLIT_TIMEOUT_HI:
-                host->csr.split_timeout_hi =
-                        be32_to_cpu(*(data++)) & 0x00000007;
+		/* We allow the local node to write up to 255 seconds as a
+		 * hack for custom purposes. This is OK with IEEE 1212 but
+		 * IEEE 1394 allows only 7 here. */
+                host->csr.split_timeout_hi = be32_to_cpu(*(data++)) &
+			(nodeid == host->node_id ? 0x000000ff : 0x00000007);
         case CSR_SPLIT_TIMEOUT_LO:

Stefan Richter
-=====-=-=== ---= -====

  reply	other threads:[~2007-01-15 18:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-01-12 11:42 Philipp Beyer
2007-01-13 18:15 ` Stefan Richter
2007-01-15 13:21   ` Philipp Beyer
2007-01-15 14:06     ` Stefan Richter
2007-01-15 14:54       ` Philipp Beyer
2007-01-15 18:30         ` Stefan Richter [this message]
2007-01-15 18:54     ` Kristian Høgsberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \ \
    --subject='Re: ieee1394 feature needed: overwrite SPLIT_TIMEOUT from userspace' \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).