Skip to contentSkip to conversation

ieee1394 updates post 2.6.21

GIT PULL Stefan Richter 1 participant 5 messages Apr 29, 2007 – May 27, 2007 Firewire

lore
Share & tools
lore
#0 lore raw

Linus, please pull from the for-linus branch at

    git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git for-linus

to receive IEEE 1394 subsystem updates as listed further below. They are mostly cleanups in ieee1394 core and in eth1394 and two more or less visible bugfixes:

- eth1394 was always loaded by hotplug event as soon as a FireWire controller was initialized. This irritated and frustrated a lot of users and distributors, since it influenced the order in which networking interfaces were added, and since a few users had difficulties to capture video if eth1394 was loaded.

From now on, eth1394 is only loaded by hotplug if an external IP over 1394 capable device is plugged in. The old behaviour can be emulated by these lines in /etc/modprobe.conf:
install ohci1394 /sbin/modprobe eth1394; \
/sbin/modprobe --ignore-install ohci1394

- eth1394 did not work over S100B...S400B (as opposed to S100A...

    S400A and S800B)

All of the patches have been in -mm for a while, just this 2nd small bugfix and some trivial changes like in Kconfig help texts are quite new. All of the patches have been seen on the linux1394-devel mailinglist, some also on lkml or netdev or linux-scsi.

I built the for-linus branch upon commit b9099ff63c75216d6ca10bce5a1abcd9293c27e6 "Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6" from Sat, 28 Apr 2007 00:49:50 +0000 (17:49 -0700) to simplify the merge.

The stat and the shortlog:

 drivers/ieee1394/Kconfig                 |   52 +--
 drivers/ieee1394/config_roms.c           |   93 +---
 drivers/ieee1394/config_roms.h           |   20 +-
 drivers/ieee1394/csr1212.c               |  870 ++++++++++++------------------
 drivers/ieee1394/csr1212.h               |  483 +++--------------
 drivers/ieee1394/dma.c                   |   24 +
 drivers/ieee1394/dma.h                   |   22 +-
 drivers/ieee1394/eth1394.c               |  798 ++++++++++++---------------
 drivers/ieee1394/eth1394.h               |   25 +-
 drivers/ieee1394/highlevel.c             |   89 +++-
 drivers/ieee1394/highlevel.h             |   55 +--
 drivers/ieee1394/hosts.c                 |   23 +-
 drivers/ieee1394/hosts.h                 |   10 +-
 drivers/ieee1394/ieee1394_core.c         |  461 +++++++++-------
 drivers/ieee1394/ieee1394_core.h         |  100 +---
 drivers/ieee1394/ieee1394_transactions.c |   43 ++-
 drivers/ieee1394/ieee1394_transactions.h |   20 -
 drivers/ieee1394/iso.c                   |   85 +++-
 drivers/ieee1394/iso.h                   |   35 +--
 drivers/ieee1394/nodemgr.c               |   61 ++-
 drivers/ieee1394/nodemgr.h               |   24 +-
 drivers/ieee1394/ohci1394.c              |   12 +-
 drivers/ieee1394/ohci1394.h              |    4 +-
 drivers/ieee1394/raw1394.c               |    3 +-
 drivers/ieee1394/sbp2.c                  |   39 +-
 drivers/ieee1394/sbp2.h                  |    8 +-
 26 files changed, 1446 insertions(+), 2013 deletions(-)

Adrian Bunk (1):
ieee1394: unexport highlevel_host_reset

Akinobu Mita (1):
ieee1394: eth1394: fix error path in module_init

Andrew Morton (2):
ieee1394: sbp2: include fixes
ieee1394: iso.c needs sched.h

Bernhard Kauer (1):
ieee1394: ohci1394: remove unnecessary rcvPhyPkt bit flipping in LinkControl register

Jean Delvare (1):
ieee1394: eth1394: Move common recv_init code to helper function

Milind Arun Choudhary (1):
ieee1394: SPIN_LOCK_UNLOCKED cleanup

Randy Dunlap (1):

      ieee1394: ieee1394_core printk format

Simon Arlott (1):
ieee1394: ohci1394: Fix mistake in printk message.

Stefan Richter (46):
ieee1394: sbp2: remove unnecessary alignments of struct members
ieee1394: sbp2: enforce 32bit DMA mapping
ieee1394: sbp2: optimize DMA direction of s/g tables
ieee1394: sbp2: move some memory allocations into non-atomic context
ieee1394: remove declarations of nonexisting functions
ieee1394: move some comments from declaration to definition
ieee1394: small header cleanup
ieee1394: remove unused csr1212 code
ieee1394: drop csr1212's support for external compilation
ieee1394: csr1212: rename some types
ieee1394: stricter error checks in csr1212
ieee1394: de-inline some functions
ieee1394: replace vmalloc by kmalloc in csr1212
ieee1394: csr1212: coding style
ieee1394: shrink csr1212_new_string_descriptor_leaf
ieee1394: csr1212: warn on unreachable code
ieee1394: csr1212: more sensible names for jump targets
ieee1394: csr1212: log if devices have CRC errors in their ROM
ieee1394: remove usage of skb_queue as packet queue
ieee1394: some more includes
ieee1394: unroll a weird macro
ieee1394: nodemgr: less noise in dmesg
ieee1394: nodemgr: unify some error messages
ieee1394: send async streams at S100
ieee1394: eth1394: unregister address space in failure case
ieee1394: eth1394: clean up host removal
ieee1394: eth1394: reduce excessive function inlining
ieee1394: eth1394: don't autoload by hotplug when ohci1394 starts
ieee1394: eth1394: coding style
ieee1394: eth1394: .probe and .update may sleep
ieee1394: eth1394: refactor .probe and .update
ieee1394: eth1394: correct a memset argument
ieee1394: eth1394: shorter error messages
ieee1394: eth1394: contain host reset
ieee1394: eth1394: allow MTU bigger than 1500
ieee1394: eth1394: CONFIG_INET is always defined
ieee1394: eth1394: omit useless set_mac_address callback
ieee1394: eth1394: don't use alloc_etherdev
ieee1394: eth1394: clean up fragment_overlap
ieee1394: eth1394: some conditions are unlikely
ieee1394: eth1394: hard_start_xmit is called in atomic context
ieee1394: eth1394: correct return codes in hard_start_xmit
ieee1394: eth1394: send async streams at S100 on 1394b buses
ieee1394: ohci1394: fix cosmetic problem in error logging
ieee1394: more help in Kconfig
ieee1394: remove garbage from Kconfig

Torsten Kaiser (1):
ieee1394: ieee1394_transactions needs sched.h

Signature · 3 lines
Stefan Richter
-=====-=-=== -=-- ====-
http://arcgraph.de/sr/
#1 lore raw

[GIT PULL] ieee1394 fixes post 2.6.22-rc2

Linus, please pull from the for-linus branch at

    git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git for-linus

to receive the following IEEE 1394 subsystem updates:

- fix regression in 2.6.22-rc1:
raw1394 asynchronous transmit was broken

- fix old bug in raw1394:
32bit compat code for 64bit kernels was broken and incomplete

- fix old eth1394 bug:
packets were frequently dropped in transmit path
(This fixes only the most common type of failure, tlabel exhaustion.)

- trivial sbp2 fix

The 32bit compat code has been posted to LKML twice. The rest was only seen on linux1394-devel, hence I'll follow up with the combined diff.

 drivers/ieee1394/eth1394.c |   84 +++++++++++++-----
 drivers/ieee1394/eth1394.h |    4 +
 drivers/ieee1394/raw1394.c |  172 ++++++++++++++++++++++++++++--------
 drivers/ieee1394/sbp2.c    |    1 +
 4 files changed, 204 insertions(+), 57 deletions(-)

Petr Vandrovec (4):
ieee1394: raw1394: Fix async send
ieee1394: raw1394: Fix read() for 32bit userland on 64bit kernel
ieee1394: raw1394: Fix write() for 32bit userland on 64bit kernel
ieee1394: raw1394: Add ioctl() for 32bit userland on 64bit kernel

Stefan Richter (3):
ieee1394: sbp2: include workqueue.h
ieee1394: eth1394: remove bogus netif_wake_queue
ieee1394: eth1394: handle tlabel exhaustion

Signature · 3 lines
Stefan Richter
-=====-=-=== -=-= =--==
http://arcgraph.de/sr/
author Acked-by Dan Dennedy Acked-by Dan Dennedy Acked-by Dan Dennedy
#2 lore raw

Re: [GIT PULL] ieee1394 fixes post 2.6.22-rc2

Quoted 34 lines

Linus, please pull from the for-linus branch at

    git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git for-linus

to receive the following IEEE 1394 subsystem updates:

- fix regression in 2.6.22-rc1:
raw1394 asynchronous transmit was broken

- fix old bug in raw1394:
32bit compat code for 64bit kernels was broken and incomplete

- fix old eth1394 bug:
packets were frequently dropped in transmit path
(This fixes only the most common type of failure, tlabel exhaustion.)

- trivial sbp2 fix

The 32bit compat code has been posted to LKML twice. The rest was only seen on linux1394-devel, hence I'll follow up with the combined diff.

 drivers/ieee1394/eth1394.c |   84 +++++++++++++-----
 drivers/ieee1394/eth1394.h |    4 +
 drivers/ieee1394/raw1394.c |  172 ++++++++++++++++++++++++++++--------
 drivers/ieee1394/sbp2.c    |    1 +
 4 files changed, 204 insertions(+), 57 deletions(-)

Petr Vandrovec (4):
ieee1394: raw1394: Fix async send
ieee1394: raw1394: Fix read() for 32bit userland on 64bit kernel
ieee1394: raw1394: Fix write() for 32bit userland on 64bit kernel
ieee1394: raw1394: Add ioctl() for 32bit userland on 64bit kernel

Quoted 4 lines

Stefan Richter (3):
ieee1394: sbp2: include workqueue.h
ieee1394: eth1394: remove bogus netif_wake_queue
ieee1394: eth1394: handle tlabel exhaustion

commit b59f74e660f8064fceb733148aec76334108175c

Author: Petr Vandrovec <[email protected]>
Date:   Mon May 7 04:14:47 2007 +0200

ieee1394: raw1394: Add ioctl() for 32bit userland on 64bit kernel

Add compat_ioctl. Although all structures are more or less same, raw1394_iso_packets got pointer inside, and raw1394_cycle_timer got unwanted padding in the middle. I did not add any translation for ioctls passing array of integers around as integers seem to have same size (32 bits) on all architectures supported by Linux.

commit 44273c6a648a09570bc5a3258049c8079e3eb8b7

Author: Petr Vandrovec <[email protected]>
Date:   Mon May 7 04:14:47 2007 +0200

ieee1394: raw1394: Fix write() for 32bit userland on 64bit kernel

* write(fd, buf, 52) from 32bit app was returning 56. Most of callers did not care, but some (arm registration) did, and anyway it looks bad if request for writing 52 bytes returns 56. And returning sizeof anything in 'int' is not good as well. So all functions now return '0' instead of sizeof(struct raw1394_request) on success, and write() itself provides correct return value (it just returns value it was asked to write on success as raw1394 does not do any partial writes at all).

* Related to this was problem that write() could have returned 0 when kernel state would become corrupted and moved to different state than opened/initialized/connected. Now it returns -EBADFD which seemed appropriate.

commit 36354ea205745107709b012bc2350d9922ca3a58

Author: Petr Vandrovec <[email protected]>
Date:   Mon May 7 04:14:47 2007 +0200

ieee1394: raw1394: Fix read() for 32bit userland on 64bit kernel

read() always failed with -EFAULT. This was happening due to raw1394_compat_read copying data to wrong location - access_ok always failed as 'r' is kernel address, not user. Whole function just tried to copy data from 'r' to 'r', which is not good.

commit 95608355f5a36781d08757ecea209ce76b4eead0

Author: Petr Vandrovec <[email protected]>
Date:   Sun May 13 22:14:44 2007 -0700
    ieee1394: raw1394: Fix async send
    
    While playing with libiec61883 I've noticed that async_send is broken
    because it was doing copy_from_user(...., packet->data_size) before
    packet->data_size was set to any useful value.  It got broken when
    packet->allocated_data_size got introduced, as hpsb_alloc_packet does
    not set packet->data_size anymore.  (Regression in 2.6.22-rc1)
    
    Signed-off-by: Petr Vandrovec <[email protected]>
    Signed-off-by: Stefan Richter <[email protected]>

commit 60b27f38f3ff9a325fbc044ddfc869bdb46b59ea

Author: Stefan Richter <[email protected]>
Date:   Sat May 5 17:25:51 2007 +0200

ieee1394: eth1394: handle tlabel exhaustion

When eth1394 was unable to acquire a transaction label, it just dropped outgoing packets without attempt to resend them later.

The transmit queue is now halted if no tlabel is available to ->hard_start_xmit(). A workqueue job is then scheduled to catch the moment when ieee1394 recycled the next lot of tlabels.

Fixes http://bugzilla.kernel.org/show_bug.cgi?id=8402

commit 6527285b4eaf23e112e88220b3111827916a7dff

Author: Stefan Richter <[email protected]>
Date:   Sat May 5 17:19:09 2007 +0200

ieee1394: eth1394: remove bogus netif_wake_queue

When we are within hard_start_xmit, the queue is already awake.

commit 54b0b6c8bdda632b1556a99562e34d9bda64eec1

Author: Stefan Richter <[email protected]>
Date:   Sat May 5 17:18:12 2007 +0200

ieee1394: sbp2: include workqueue.h

drivers/ieee1394/eth1394.c +63 -21
index 2296d43..d6b19c2 100644
@@ -47,6 +47,7 @@
 #include <linux/types.h>
 #include <linux/delay.h>
 #include <linux/init.h>
+#include <linux/workqueue.h>
 
 #include <linux/netdevice.h>
 #include <linux/inetdevice.h>
@@ -235,6 +236,9 @@ static int ether1394_open(struct net_device *dev)
 /* This is called after an "ifdown" */
 static int ether1394_stop(struct net_device *dev)
 {
+	/* flush priv->wake */
+	flush_scheduled_work();
+
 	netif_stop_queue(dev);
 	return 0;
 }
@@ -531,6 +535,37 @@ static void ether1394_init_dev(struct net_device *dev)
 }
 
 /*
+ * Wake the queue up after commonly encountered transmit failure conditions are
+ * hopefully over.  Currently only tlabel exhaustion is accounted for.
+ */
+static void ether1394_wake_queue(struct work_struct *work)
+{
+	struct eth1394_priv *priv;
+	struct hpsb_packet *packet;
+
+	priv = container_of(work, struct eth1394_priv, wake);
+	packet = hpsb_alloc_packet(0);
+
+	/* This is really bad, but unjam the queue anyway. */
+	if (!packet)
+		goto out;
+
+	packet->host = priv->host;
+	packet->node_id = priv->wake_node;
+	/*
+	 * A transaction label is all we really want.  If we get one, it almost
+	 * always means we can get a lot more because the ieee1394 core recycled
+	 * a whole batch of tlabels, at last.
+	 */
+	if (hpsb_get_tlabel(packet) == 0)
+		hpsb_free_tlabel(packet);
+
+	hpsb_free_packet(packet);
+out:
+	netif_wake_queue(priv->wake_dev);
+}
+
+/*
  * This function is called every time a card is found. It is generally called
  * when the module is installed. This is where we add all of our ethernet
  * devices. One for each host.
@@ -574,6 +609,8 @@ static void ether1394_add_host(struct hpsb_host *host)
 	spin_lock_init(&priv->lock);
 	priv->host = host;
 	priv->local_fifo = fifo_addr;
+	INIT_WORK(&priv->wake, ether1394_wake_queue);
+	priv->wake_dev = dev;
 
 	hi = hpsb_create_hostinfo(&eth1394_highlevel, host, sizeof(*hi));
 	if (hi == NULL) {
@@ -1390,22 +1427,17 @@ static int ether1394_prep_write_packet(struct hpsb_packet *p,
 				       u64 addr, void *data, int tx_len)
 {
 	p->node_id = node;
-	p->data = NULL;
 
-	p->tcode = TCODE_WRITEB;
-	p->header[1] = host->node_id << 16 | addr >> 32;
-	p->header[2] = addr & 0xffffffff;
+	if (hpsb_get_tlabel(p))
+		return -EAGAIN;
 
+	p->tcode = TCODE_WRITEB;
 	p->header_size = 16;
 	p->expect_response = 1;
-
-	if (hpsb_get_tlabel(p)) {
-		ETH1394_PRINT_G(KERN_ERR, "Out of tlabels\n");
-		return -1;
-	}
 	p->header[0] =
 		p->node_id << 16 | p->tlabel << 10 | 1 << 8 | TCODE_WRITEB << 4;
-
+	p->header[1] = host->node_id << 16 | addr >> 32;
+	p->header[2] = addr & 0xffffffff;
 	p->header[3] = tx_len << 16;
 	p->data_size = (tx_len + 3) & ~3;
 	p->data = data;
@@ -1451,7 +1483,7 @@ static int ether1394_send_packet(struct packet_task *ptask, unsigned int tx_len)
 
 	packet = ether1394_alloc_common_packet(priv->host);
 	if (!packet)
-		return -1;
+		return -ENOMEM;
 
 	if (ptask->tx_type == ETH1394_GASP) {
 		int length = tx_len + 2 * sizeof(quadlet_t);
@@ -1462,7 +1494,7 @@ static int ether1394_send_packet(struct packet_task *ptask, unsigned int tx_len)
 					       ptask->addr, ptask->skb->data,
 					       tx_len)) {
 		hpsb_free_packet(packet);
-		return -1;
+		return -EAGAIN;
 	}
 
 	ptask->packet = packet;
@@ -1471,7 +1503,7 @@ static int ether1394_send_packet(struct packet_task *ptask, unsigned int tx_len)
 
 	if (hpsb_send_packet(packet) < 0) {
 		ether1394_free_packet(packet);
-		return -1;
+		return -EIO;
 	}
 
 	return 0;
@@ -1514,13 +1546,18 @@ static void ether1394_complete_cb(void *__ptask)
 
 	ptask->outstanding_pkts--;
 	if (ptask->outstanding_pkts > 0 && !fail) {
-		int tx_len;
+		int tx_len, err;
 
 		/* Add the encapsulation header to the fragment */
 		tx_len = ether1394_encapsulate(ptask->skb, ptask->max_payload,
 					       &ptask->hdr);
-		if (ether1394_send_packet(ptask, tx_len))
+		err = ether1394_send_packet(ptask, tx_len);
+		if (err) {
+			if (err == -EAGAIN)
+				ETH1394_PRINT_G(KERN_ERR, "Out of tlabels\n");
+
 			ether1394_dg_complete(ptask, 1);
+		}
 	} else {
 		ether1394_dg_complete(ptask, fail);
 	}
@@ -1633,10 +1670,18 @@ static int ether1394_tx(struct sk_buff *skb, struct net_device *dev)
 	/* Add the encapsulation header to the fragment */
 	tx_len = ether1394_encapsulate(skb, max_payload, &ptask->hdr);
 	dev->trans_start = jiffies;
-	if (ether1394_send_packet(ptask, tx_len))
-		goto fail;
+	if (ether1394_send_packet(ptask, tx_len)) {
+		if (dest_node == (LOCAL_BUS | ALL_NODES))
+			goto fail;
+
+		/* Most failures of ether1394_send_packet are recoverable. */
+		netif_stop_queue(dev);
+		priv->wake_node = dest_node;
+		schedule_work(&priv->wake);
+		kmem_cache_free(packet_task_cache, ptask);
+		return NETDEV_TX_BUSY;
+	}
 
-	netif_wake_queue(dev);
 	return NETDEV_TX_OK;
 fail:
 	if (ptask)
@@ -1650,9 +1695,6 @@ fail:
 	priv->stats.tx_errors++;
 	spin_unlock_irqrestore(&priv->lock, flags);
 
-	if (netif_queue_stopped(dev))
-		netif_wake_queue(dev);
-
 	/*
 	 * FIXME: According to a patch from 2003-02-26, "returning non-zero
 	 * causes serious problems" here, allegedly.  Before that patch,
drivers/ieee1394/eth1394.h +4 -0
index a3439ee..4f3e2dd 100644
@@ -66,6 +66,10 @@ struct eth1394_priv {
 	int bc_dgl;			/* Outgoing broadcast datagram label */
 	struct list_head ip_node_list;	/* List of IP capable nodes	 */
 	struct unit_directory *ud_list[ALL_NODES]; /* Cached unit dir list */
+
+	struct work_struct wake;	/* Wake up after xmit failure	 */
+	struct net_device *wake_dev;	/* Stupid backlink for .wake	 */
+	nodeid_t wake_node;		/* Destination of failed xmit	 */
 };
 
 
drivers/ieee1394/raw1394.c +136 -36

391 lines not on this page · raw message

drivers/ieee1394/sbp2.c +1 -0
index 4cb6fa2..875eadd 100644
@@ -70,6 +70,7 @@
 #include <linux/stringify.h>
 #include <linux/types.h>
 #include <linux/wait.h>
+#include <linux/workqueue.h>
 
 #include <asm/byteorder.h>
 #include <asm/errno.h>
Signature · 3 lines
Stefan Richter
-=====-=-=== -=-= =--==
http://arcgraph.de/sr/
#3 lore raw

Re: [GIT PULL] ieee1394 fixes post 2.6.22-rc2

In reply to Stefan Richter

I wrote on 2007-05-19:

Quoted 9 lines

Linus, please pull from the for-linus branch at

    git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git for-linus

to receive the following IEEE 1394 subsystem updates:

- fix regression in 2.6.22-rc1:
raw1394 asynchronous transmit was broken

Quoted 8 lines

- fix old bug in raw1394:
32bit compat code for 64bit kernels was broken and incomplete

- fix old eth1394 bug:
packets were frequently dropped in transmit path
(This fixes only the most common type of failure, tlabel exhaustion.)

- trivial sbp2 fix

Linus,

if you didn't pull already, please don't. Rather wait for my next batch of -rc fixes. At the moment it looks as if I should postpone raw1394's 32bit compat fixes (or call them feature addition) until after the release of 2.6.22 to ensure we get them right.

Thanks,

Signature · 3 lines
Stefan Richter
-=====-=-=== -=-= =-===
http://arcgraph.de/sr/
#4 lore raw

[GIT PULL] ieee1394 fixes post 2.6.22-rc3

Linus, please pull from the for-linus branch at

    git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git for-linus

to receive the following IEEE 1394 subsystem updates:

(old stack)
- fix regression in 2.6.22-rc1: raw1394 asynchronous transmit was broken,
- fix regression in 2.6.21: some distro's scripts for persistent naming of network interfaces were broken for eth1394,
- fix old eth1394 bug: packets were frequently dropped in transmit path,
- trivial sbp2 fix.

(new stack)
- fix for big endian CPUs,
- call new driver modules firewire-core.ko, firewire-ohci.ko, firewire-sbp2.ko.

The stat, log, and diff:

 drivers/firewire/Kconfig   |   14 +++---
 drivers/firewire/Makefile  |   12 +++--
 drivers/firewire/fw-cdev.c |    2 +-
 drivers/firewire/fw-ohci.c |    5 +-
 drivers/ieee1394/eth1394.c |   91 ++++++++++++++++++++++++++----------
 drivers/ieee1394/eth1394.h |    4 ++
 drivers/ieee1394/raw1394.c |    8 ++-
 drivers/ieee1394/sbp2.c    |    1 +
 8 files changed, 94 insertions(+), 43 deletions(-)

Jeff Garzik (1):
firewire: fix return code

Kristian Høgsberg (1):
firewire: Add missing byteswapping for receive DMA programs.

Petr Vandrovec (1):

      ieee1394: raw1394: Fix async send

Stefan Richter (5):
ieee1394: sbp2: include workqueue.h
ieee1394: eth1394: remove bogus netif_wake_queue
ieee1394: eth1394: handle tlabel exhaustion
ieee1394: eth1394: bring back a parent device
firewire: prefix modules with firewire- instead of fw-

drivers/firewire/Kconfig +7 -7
index 5932c72..396dade 100644
@@ -18,7 +18,7 @@ config FIREWIRE
 	  your IEEE 1394 adapter.
 
 	  To compile this driver as a module, say M here: the module will be
-	  called fw-core.
+	  called firewire-core.
 
 	  This is the "JUJU" FireWire stack, an alternative implementation
 	  designed for robustness and simplicity.  You can build either this
@@ -34,11 +34,11 @@ config FIREWIRE_OHCI
 	  is the only chipset in use, so say Y here.
 
 	  To compile this driver as a module, say M here:  The module will be
-	  called fw-ohci.
+	  called firewire-ohci.
 
 	  If you also build ohci1394 of the classic IEEE 1394 driver stack,
-	  blacklist either ohci1394 or fw-ohci to let hotplug load the desired
-	  driver.
+	  blacklist either ohci1394 or firewire-ohci to let hotplug load the
+	  desired driver.
 
 config FIREWIRE_SBP2
 	tristate "Support for storage devices (SBP-2 protocol driver)"
@@ -50,12 +50,12 @@ config FIREWIRE_SBP2
 	  like scanners.
 
 	  To compile this driver as a module, say M here:  The module will be
-	  called fw-sbp2.
+	  called firewire-sbp2.
 
 	  You should also enable support for disks, CD-ROMs, etc. in the SCSI
 	  configuration section.
 
 	  If you also build sbp2 of the classic IEEE 1394 driver stack,
-	  blacklist either sbp2 or fw-sbp2 to let hotplug load the desired
-	  driver.
+	  blacklist either sbp2 or firewire-sbp2 to let hotplug load the
+	  desired driver.
 
drivers/firewire/Makefile +7 -5
index fc7d59d..a7c31e9 100644
@@ -2,9 +2,11 @@
 # Makefile for the Linux IEEE 1394 implementation
 #
 
-fw-core-y += fw-card.o fw-topology.o fw-transaction.o fw-iso.o \
-	fw-device.o fw-cdev.o
+firewire-core-y += fw-card.o fw-topology.o fw-transaction.o fw-iso.o \
+                   fw-device.o fw-cdev.o
+firewire-ohci-y += fw-ohci.o
+firewire-sbp2-y += fw-sbp2.o
 
-obj-$(CONFIG_FIREWIRE) += fw-core.o
-obj-$(CONFIG_FIREWIRE_OHCI) += fw-ohci.o
-obj-$(CONFIG_FIREWIRE_SBP2) += fw-sbp2.o
+obj-$(CONFIG_FIREWIRE) += firewire-core.o
+obj-$(CONFIG_FIREWIRE_OHCI) += firewire-ohci.o
+obj-$(CONFIG_FIREWIRE_SBP2) += firewire-sbp2.o
drivers/firewire/fw-cdev.c +1 -1
index 0fa5bd5..3ab3585 100644
@@ -365,7 +365,7 @@ complete_transaction(struct fw_card *card, int rcode,
 		    response->response.data, response->response.length);
 }
 
-static ssize_t ioctl_send_request(struct client *client, void *buffer)
+static int ioctl_send_request(struct client *client, void *buffer)
 {
 	struct fw_device *device = client->device;
 	struct fw_cdev_send_request *request = buffer;
drivers/firewire/fw-ohci.c +3 -2
index c17342d..2e4cfa5 100644
@@ -268,7 +268,7 @@ static int ar_context_add_page(struct ar_context *ctx)
 
 	dma_sync_single_for_device(dev, ab_bus, PAGE_SIZE, DMA_BIDIRECTIONAL);
 
-	ctx->last_buffer->descriptor.branch_address = ab_bus | 1;
+	ctx->last_buffer->descriptor.branch_address = cpu_to_le32(ab_bus | 1);
 	ctx->last_buffer->next = ab;
 	ctx->last_buffer = ab;
 
@@ -417,7 +417,8 @@ ar_context_init(struct ar_context *ctx, struct fw_ohci *ohci, u32 regs)
 	ctx->current_buffer = ab.next;
 	ctx->pointer = ctx->current_buffer->data;
 
-	reg_write(ctx->ohci, COMMAND_PTR(ctx->regs), ab.descriptor.branch_address);
+	reg_write(ctx->ohci, COMMAND_PTR(ctx->regs),
+		  le32_to_cpu(ab.descriptor.branch_address));
 	reg_write(ctx->ohci, CONTROL_SET(ctx->regs), CONTEXT_RUN);
 	flush_writes(ctx->ohci);
 
drivers/ieee1394/eth1394.c +66 -25

175 lines not on this page · raw message

drivers/ieee1394/eth1394.h +4 -0
index a3439ee..4f3e2dd 100644
@@ -66,6 +66,10 @@ struct eth1394_priv {
 	int bc_dgl;			/* Outgoing broadcast datagram label */
 	struct list_head ip_node_list;	/* List of IP capable nodes	 */
 	struct unit_directory *ud_list[ALL_NODES]; /* Cached unit dir list */
+
+	struct work_struct wake;	/* Wake up after xmit failure	 */
+	struct net_device *wake_dev;	/* Stupid backlink for .wake	 */
+	nodeid_t wake_node;		/* Destination of failed xmit	 */
 };
 
 
drivers/ieee1394/raw1394.c +5 -3
index d382500..f1d05ee 100644
@@ -936,6 +936,7 @@ static int handle_async_send(struct file_info *fi, struct pending_request *req)
 	struct hpsb_packet *packet;
 	int header_length = req->req.misc & 0xffff;
 	int expect_response = req->req.misc >> 16;
+	size_t data_size;
 
 	if (header_length > req->req.length || header_length < 12 ||
 	    header_length > FIELD_SIZEOF(struct hpsb_packet, header)) {
@@ -945,7 +946,8 @@ static int handle_async_send(struct file_info *fi, struct pending_request *req)
 		return sizeof(struct raw1394_request);
 	}
 
-	packet = hpsb_alloc_packet(req->req.length - header_length);
+	data_size = req->req.length - header_length;
+	packet = hpsb_alloc_packet(data_size);
 	req->packet = packet;
 	if (!packet)
 		return -ENOMEM;
@@ -960,7 +962,7 @@ static int handle_async_send(struct file_info *fi, struct pending_request *req)
 
 	if (copy_from_user
 	    (packet->data, int2ptr(req->req.sendb) + header_length,
-	     packet->data_size)) {
+	     data_size)) {
 		req->req.error = RAW1394_ERROR_MEMFAULT;
 		req->req.length = 0;
 		queue_complete_req(req);
@@ -974,7 +976,7 @@ static int handle_async_send(struct file_info *fi, struct pending_request *req)
 	packet->host = fi->host;
 	packet->expect_response = expect_response;
 	packet->header_size = header_length;
-	packet->data_size = req->req.length - header_length;
+	packet->data_size = data_size;
 
 	req->req.length = 0;
 	hpsb_set_packet_complete_task(packet,
drivers/ieee1394/sbp2.c +1 -0
index 4cb6fa2..875eadd 100644
@@ -70,6 +70,7 @@
 #include <linux/stringify.h>
 #include <linux/types.h>
 #include <linux/wait.h>
+#include <linux/workqueue.h>
 
 #include <asm/byteorder.h>
 #include <asm/errno.h>
Signature · 3 lines
Stefan Richter
-=====-=-=== -=-= ==-==
http://arcgraph.de/sr/