Skip to contentSkip to conversation

What's in linux1394-2.6.git?

DISCUSSION Stefan Richter 1 participant 6 messages Jun 14, 2009 – Jun 17, 2009 Firewire

lore
Share & tools
lore
#0 lore raw

There are two batches in the FireWire/ IEEE 1394 repo, one to be merged soon, and another one which I'm not entirely sure of yet. Both batches deal with the newer firewire drivers only, the older ieee1394 stack is left untouched this time.

As usual, the updates can be fetched from

    git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394-2.6.git
or browsed at
    http://git.kernel.org/?p=linux/kernel/git/ieee1394/linux1394-2.6.git

I will send a pull request for the 1st batch in the next few days.

Batch 1: origin..for-linus
==========================

This contains (1.) a few small fixes, (2.) a small addition to firewire-core's sysfs ABI in order to considerably simplify udev rules to set /dev/fw* ownership and ACLs, and (3.) preparations to add more drivers. Of these preparations, the bigger functional enhancements were actually already merged in 2.6.30-rc1; the remaining ones are small functional additions and a total reorganization of files, as you can see in the diffstat.

After the udev related change went into mainline, I will send the respective udev rules update to linux-hotplug for inclusion into mainline udev.

Stefan Richter (14):
firewire: core: improve check for local node
firewire: core: check for missing struct update at build time, not run time
firewire: core: add sysfs attribute for easier udev rules
firewire: share device ID table type with ieee1394
firewire: also use vendor ID in root directory for driver matches
firewire: ohci: access bus_seconds atomically
firewire: clean up includes
firewire: reorganize header files
firewire: rename source files
firewire: add parent-of-unit accessor
firewire: core: include linux/uaccess.h instead of asm/uaccess.h
firewire: core: prepare for non-core children of card devices
firewire: core: don't update Broadcast_Channel if RFC 2734 conditions aren't met
firewire: core: use more outbound tlabels

 drivers/firewire/Makefile                          |    8 +-
 drivers/firewire/{fw-card.c => core-card.c}        |   25 +-
 drivers/firewire/{fw-cdev.c => core-cdev.c}        |   13 +-
 drivers/firewire/{fw-device.c => core-device.c}    |  154 ++++-
 drivers/firewire/{fw-iso.c => core-iso.c}          |    6 +-
 .../firewire/{fw-topology.c => core-topology.c}    |   24 +-
 .../{fw-transaction.c => core-transaction.c}       |   36 +-
 drivers/firewire/core.h                            |  293 ++++++++
 drivers/firewire/fw-device.h                       |  202 -----
 drivers/firewire/fw-topology.h                     |   77 --
 drivers/firewire/fw-transaction.h                  |  446 ------------
 drivers/firewire/{fw-ohci.c => ohci.c}             |   19 +-
 drivers/firewire/{fw-ohci.h => ohci.h}             |    6 +-
 drivers/firewire/{fw-sbp2.c => sbp2.c}             |   58 +-
 include/linux/firewire.h                           |  357 +++++++++
 15 files changed, 898 insertions(+), 826 deletions(-)
 rename drivers/firewire/{fw-card.c => core-card.c} (97%)
 rename drivers/firewire/{fw-cdev.c => core-cdev.c} (99%)
 rename drivers/firewire/{fw-device.c => core-device.c} (88%)
 rename drivers/firewire/{fw-iso.c => core-iso.c} (99%)
 rename drivers/firewire/{fw-topology.c => core-topology.c} (97%)
 rename drivers/firewire/{fw-transaction.c => core-transaction.c} (98%)
 create mode 100644 drivers/firewire/core.h
 delete mode 100644 drivers/firewire/fw-device.h
 delete mode 100644 drivers/firewire/fw-topology.h
 delete mode 100644 drivers/firewire/fw-transaction.h
 rename drivers/firewire/{fw-ohci.c => ohci.c} (99%)
 rename drivers/firewire/{fw-ohci.h => ohci.h} (98%)
 rename drivers/firewire/{fw-sbp2.c => sbp2.c} (97%)
 create mode 100644 include/linux/firewire.h

Batch 2: for-linus..for-next
============================

This contains Jay Fenlason's IPv4-over-1394 driver, which is one of the last two or so bigger steps to make drivers/firewire/ a functional superset of drivers/ieee1394/. Alas, the code in here has not been seen on LKML yet, and I recently encountered some stability issues in stress tests of the driver.

Jay Fenlason (1):
firewire: add IPv4 support

Stefan Richter (5):
firewire: net: add Kconfig item, rename driver
firewire: net: style changes
firewire: net: allow for unordered unit discovery
firewire: net: remove unused code
firewire: net: adjust net_device ops

 drivers/firewire/Kconfig     |   12 +
 drivers/firewire/Makefile    |    4 +-
 drivers/firewire/core-card.c |    2 +
 drivers/firewire/core-iso.c  |    7 +
 drivers/firewire/core.h      |   87 --
 drivers/firewire/net.c       | 1655 ++++++++++++++++++++++++++++++++++
 drivers/ieee1394/Kconfig     |    2 +-
 include/linux/firewire.h     |   87 ++
 8 files changed, 1767 insertions(+), 89 deletions(-)
 create mode 100644 drivers/firewire/net.c
Signature · 3 lines
Stefan Richter
-=====-==--= -==- -===-
http://arcgraph.de/sr/
#1 lore raw
Quoted 4 lines · I wrote:

Batch 2: for-linus..for-next
============================

This contains Jay Fenlason's IPv4-over-1394 driver,

A note to those who pulled linux1394-2.6.git's "net" branch in the last few days: I deleted this branch, and for-next is not an ancestor of it requeued the IPv4 patches to after the latest firewire-core updates.

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

What's in linux1394-2.6.git? -- Part II.0/3

In reply to Stefan Richter

There is some more in linux1394's for-next branch for which I plan to send a pull request on Monday. There is Jay Fenlason's IPv4 over FireWire implementation for the newer firewire stack in it (May 18), trivial stylistic changes by me (June 07; sorry for being slow with integration), small fixes to the new driver and to newly discovered bugs of firewire-core (June 14..16).

This code has not been seen on LKML yet, hence I will post the combined diff in replies to this message.

Repo URL:

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

Gitweb:

    http://git.kernel.org/?p=linux/kernel/git/ieee1394/linux1394-2.6.git

Shortlog and diffstat:

Jay Fenlason (1):
firewire: add IPv4 support

Stefan Richter (9):
firewire: net: add Kconfig item, rename driver
firewire: net: style changes
firewire: net: allow for unordered unit discovery
firewire: net: remove unused code
firewire: net: adjust net_device ops
firewire: core: fix DMA unmapping in iso buffer removal
firewire: core: fix iso context shutdown on card removal
firewire: net: fix card driver reloading
firewire: net: better FIFO address range check and rcodes

 drivers/firewire/Kconfig     |   12 +
 drivers/firewire/Makefile    |    4 +-
 drivers/firewire/core-card.c |   20 +-
 drivers/firewire/core-iso.c  |   11 +-
 drivers/firewire/core.h      |   87 ---
 drivers/firewire/net.c       | 1655 ++++++++++++++++++++++++++++++++++++++++++
 drivers/ieee1394/Kconfig     |    2 +-
 include/linux/firewire.h     |   87 +++
 8 files changed, 1780 insertions(+), 98 deletions(-)
 create mode 100644 drivers/firewire/net.c
Signature · 3 lines
Stefan Richter
-=====-==--= -==- =---=
http://arcgraph.de/sr/
#3 lore raw

What's in linux1394-2.6.git? -- Part II.1/3

This is the part of linux1394-2.6.git's current for-linus..for-next combined diff which affects firewire-core: Bug fixes and preparation to add firewire-net.

---
 drivers/firewire/core-card.c |   20 +++++---
 drivers/firewire/core-iso.c  |   11 +++-
 drivers/firewire/core.h      |   87 -----------------------------------
 include/linux/firewire.h     |   87 +++++++++++++++++++++++++++++++++++
 4 files changed, 109 insertions(+), 96 deletions(-)
drivers/firewire/core-card.c +13 -7
Index: b/drivers/firewire/core-card.c
===================================================================
@@ -176,6 +176,7 @@ int fw_core_add_descriptor(struct fw_des
 
 	return 0;
 }
+EXPORT_SYMBOL(fw_core_add_descriptor);
 
 void fw_core_remove_descriptor(struct fw_descriptor *desc)
 {
@@ -189,6 +190,7 @@ void fw_core_remove_descriptor(struct fw
 
 	mutex_unlock(&card_mutex);
 }
+EXPORT_SYMBOL(fw_core_remove_descriptor);
 
 static void allocate_broadcast_channel(struct fw_card *card, int generation)
 {
@@ -459,11 +461,11 @@ EXPORT_SYMBOL(fw_card_add);
 
 
 /*
- * The next few functions implements a dummy driver that use once a
- * card driver shuts down an fw_card.  This allows the driver to
- * cleanly unload, as all IO to the card will be handled by the dummy
- * driver instead of calling into the (possibly) unloaded module.  The
- * dummy driver just fails all IO.
+ * The next few functions implement a dummy driver that is used once a card
+ * driver shuts down an fw_card.  This allows the driver to cleanly unload,
+ * as all IO to the card will be handled (and failed) by the dummy driver
+ * instead of calling into the module.  Only functions for iso context
+ * shutdown still need to be provided by the card driver.
  */
 
 static int dummy_enable(struct fw_card *card, u32 *config_rom, size_t length)
@@ -510,7 +512,7 @@ static int dummy_enable_phys_dma(struct 
 	return -ENODEV;
 }
 
-static struct fw_card_driver dummy_driver = {
+static const struct fw_card_driver dummy_driver_template = {
 	.enable          = dummy_enable,
 	.update_phy_reg  = dummy_update_phy_reg,
 	.set_config_rom  = dummy_set_config_rom,
@@ -529,6 +531,8 @@ void fw_card_release(struct kref *kref)
 
 void fw_core_remove_card(struct fw_card *card)
 {
+	struct fw_card_driver dummy_driver = dummy_driver_template;
+
 	card->driver->update_phy_reg(card, 4,
 				     PHY_LINK_ACTIVE | PHY_CONTENDER, 0);
 	fw_core_initiate_bus_reset(card, 1);
@@ -537,7 +541,9 @@ void fw_core_remove_card(struct fw_card 
 	list_del_init(&card->link);
 	mutex_unlock(&card_mutex);
 
-	/* Set up the dummy driver. */
+	/* Switch off most of the card driver interface. */
+	dummy_driver.free_iso_context	= card->driver->free_iso_context;
+	dummy_driver.stop_iso		= card->driver->stop_iso;
 	card->driver = &dummy_driver;
 
 	fw_destroy_nodes(card);
drivers/firewire/core-iso.c +9 -2
Index: b/drivers/firewire/core-iso.c
===================================================================
@@ -71,7 +71,7 @@ int fw_iso_buffer_init(struct fw_iso_buf
 	for (j = 0; j < i; j++) {
 		address = page_private(buffer->pages[j]);
 		dma_unmap_page(card->device, address,
-			       PAGE_SIZE, DMA_TO_DEVICE);
+			       PAGE_SIZE, direction);
 		__free_page(buffer->pages[j]);
 	}
 	kfree(buffer->pages);
@@ -80,6 +80,7 @@ int fw_iso_buffer_init(struct fw_iso_buf
 
 	return -ENOMEM;
 }
+EXPORT_SYMBOL(fw_iso_buffer_init);
 
 int fw_iso_buffer_map(struct fw_iso_buffer *buffer, struct vm_area_struct *vma)
 {
@@ -107,13 +108,14 @@ void fw_iso_buffer_destroy(struct fw_iso
 	for (i = 0; i < buffer->page_count; i++) {
 		address = page_private(buffer->pages[i]);
 		dma_unmap_page(card->device, address,
-			       PAGE_SIZE, DMA_TO_DEVICE);
+			       PAGE_SIZE, buffer->direction);
 		__free_page(buffer->pages[i]);
 	}
 
 	kfree(buffer->pages);
 	buffer->pages = NULL;
 }
+EXPORT_SYMBOL(fw_iso_buffer_destroy);
 
 struct fw_iso_context *fw_iso_context_create(struct fw_card *card,
 		int type, int channel, int speed, size_t header_size,
@@ -136,6 +138,7 @@ struct fw_iso_context *fw_iso_context_cr
 
 	return ctx;
 }
+EXPORT_SYMBOL(fw_iso_context_create);
 
 void fw_iso_context_destroy(struct fw_iso_context *ctx)
 {
@@ -143,12 +146,14 @@ void fw_iso_context_destroy(struct fw_is
 
 	card->driver->free_iso_context(ctx);
 }
+EXPORT_SYMBOL(fw_iso_context_destroy);
 
 int fw_iso_context_start(struct fw_iso_context *ctx,
 			 int cycle, int sync, int tags)
 {
 	return ctx->card->driver->start_iso(ctx, cycle, sync, tags);
 }
+EXPORT_SYMBOL(fw_iso_context_start);
 
 int fw_iso_context_queue(struct fw_iso_context *ctx,
 			 struct fw_iso_packet *packet,
@@ -159,11 +164,13 @@ int fw_iso_context_queue(struct fw_iso_c
 
 	return card->driver->queue_iso(ctx, packet, buffer, payload);
 }
+EXPORT_SYMBOL(fw_iso_context_queue);
 
 int fw_iso_context_stop(struct fw_iso_context *ctx)
 {
 	return ctx->card->driver->stop_iso(ctx);
 }
+EXPORT_SYMBOL(fw_iso_context_stop);
 
 /*
  * Isochronous bus resource management (channels, bandwidth), client side
drivers/firewire/core.h +0 -87

110 lines not on this page · raw message

include/linux/firewire.h +87 -0

97 lines not on this page · raw message

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

What's in linux1394-2.6.git? -- Part II.2/3

This part of linux1394-2.6.git's current for-linus..for-next combined diff adds firewire-net.

---
 drivers/firewire/Kconfig  |   12 +
 drivers/firewire/Makefile |    4 +
 drivers/firewire/net.c    | 1655 ++++++++++++++++++++++++++++++++++++++
 drivers/ieee1394/Kconfig  |    2 
 4 files changed, 1671 insertions(+), 2 deletions(-)
drivers/firewire/Kconfig +12 -0
Index: b/drivers/firewire/Kconfig
===================================================================
@@ -77,3 +77,15 @@ config FIREWIRE_SBP2
 
 	  You should also enable support for disks, CD-ROMs, etc. in the SCSI
 	  configuration section.
+
+config FIREWIRE_NET
+	tristate "IP networking over 1394"
+	depends on FIREWIRE && INET
+	help
+	  This enables IPv4 over IEEE 1394, providing IP connectivity with
+	  other implementations of RFC 2734 as found on several operating
+	  systems.  Multicast support is currently limited.
+
+	  To compile this driver as a module, say M here:  The module will be
+	  called firewire-net.  It replaces eth1394 of the classic IEEE 1394
+	  stack.
drivers/firewire/Makefile +3 -1
Index: b/drivers/firewire/Makefile
===================================================================
@@ -6,7 +6,9 @@ firewire-core-y += core-card.o core-cdev
                    core-iso.o core-topology.o core-transaction.o
 firewire-ohci-y += ohci.o
 firewire-sbp2-y += sbp2.o
+firewire-net-y  += net.o
 
-obj-$(CONFIG_FIREWIRE) += firewire-core.o
+obj-$(CONFIG_FIREWIRE)      += firewire-core.o
 obj-$(CONFIG_FIREWIRE_OHCI) += firewire-ohci.o
 obj-$(CONFIG_FIREWIRE_SBP2) += firewire-sbp2.o
+obj-$(CONFIG_FIREWIRE_NET)  += firewire-net.o
drivers/firewire/net.c new file +1655 -0

1,655 lines not on this page · raw message

drivers/ieee1394/Kconfig +1 -1
Index: b/drivers/ieee1394/Kconfig
===================================================================
@@ -105,7 +105,7 @@ config IEEE1394_ETH1394_ROM_ENTRY
 	default n
 
 config IEEE1394_ETH1394
-	tristate "IP over 1394"
+	tristate "IP networking over 1394"
 	depends on IEEE1394 && EXPERIMENTAL && INET
 	select IEEE1394_ETH1394_ROM_ENTRY
 	help
Signature · 3 lines
Stefan Richter
-=====-==--= -==- =---=
http://arcgraph.de/sr/
#5 lore raw

What's in linux1394-2.6.git? -- Part II.3/3

The following patch was actually /not/ yet committed to linux1394-2.6.git but probably will be committed on Monday.

Date: Tue, 16 Jun 2009 22:36:34 +0200 (CEST)
From: Stefan Richter <[email protected]>
Subject: firewire: new stack is no longer experimental

The new stack is now recommended over the old one if used for industrial video (IIDC/DCAM) or for storage devices (SBP-2) due to better performance, improved compatibility, added features, and security. It should also be functionally on par with and is more secure than the old ieee1394 stack in the use case of consumer video devices.

IP-over-1394 support for the new stack is currently emerging, and a backend of the firedtv DVB driver to the new stack should be available soon.

The one remaining area where the old stack is still required are audio devices, as the new stack is not yet able to support the FFADO FireWire audio framework.

---
 drivers/firewire/Kconfig |   52 ++++++++++++++++++---------------------
 drivers/ieee1394/Kconfig |   19 ++++----------
 2 files changed, 30 insertions(+), 41 deletions(-)
drivers/firewire/Kconfig +24 -28
Index: b/drivers/firewire/Kconfig
===================================================================
@@ -1,28 +1,29 @@
-comment "A new alternative FireWire stack is available with EXPERIMENTAL=y"
-	depends on EXPERIMENTAL=n
-
-comment "Enable only one of the two stacks, unless you know what you are doing"
-	depends on EXPERIMENTAL
+comment "You can enable one or both FireWire driver stacks."
+comment "See the help texts for more information."
 
 config FIREWIRE
-	tristate "New FireWire stack, EXPERIMENTAL"
-	depends on EXPERIMENTAL
+	tristate "FireWire driver stack"
 	select CRC_ITU_T
 	help
-	  This is the "Juju" FireWire stack, a new alternative implementation
-	  designed for robustness and simplicity.  You can build either this
-	  stack, or the old stack (the ieee1394 driver, ohci1394 etc.) or both.
-	  Please read http://ieee1394.wiki.kernel.org/index.php/Juju_Migration
-	  before you enable the new stack.
+	  This is the new-generation IEEE 1394 (FireWire) driver stack
+	  a.k.a. Juju, a new implementation designed for robustness and
+	  simplicity.
+	  See http://ieee1394.wiki.kernel.org/index.php/Juju_Migration
+	  for information about migration from the older Linux 1394 stack
+	  to the new driver stack.
 
 	  To compile this driver as a module, say M here: the module will be
 	  called firewire-core.
 
 	  This module functionally replaces ieee1394, raw1394, and video1394.
 	  To access it from application programs, you generally need at least
-	  libraw1394 version 2.  IIDC/DCAM applications also need libdc1394
-	  version 2.  No libraries are required to access storage devices
-	  through the firewire-sbp2 driver.
+	  libraw1394 v2.  IIDC/DCAM applications need libdc1394 v2.
+	  No libraries are required to access storage devices through the
+	  firewire-sbp2 driver.
+
+	  NOTE:
+	  FireWire audio devices currently require the old drivers (ieee1394,
+	  ohci1394, raw1394).
 
 config FIREWIRE_OHCI
 	tristate "OHCI-1394 controllers"
@@ -37,11 +38,9 @@ config FIREWIRE_OHCI
 	  stack.
 
 	  NOTE:
-
-	  You should only build either firewire-ohci or the old ohci1394 driver,
-	  but not both.  If you nevertheless want to install both, you should
-	  configure them only as modules and blacklist the driver(s) which you
-	  don't want to have auto-loaded.  Add either
+	  If you want to install firewire-ohci and ohci1394 together, you
+	  should configure them only as modules and blacklist the driver(s)
+	  which you don't want to have auto-loaded.  Add either
 
 	      blacklist firewire-ohci
 	  or
@@ -50,12 +49,7 @@ config FIREWIRE_OHCI
 	      blacklist dv1394
 
 	  to /etc/modprobe.conf or /etc/modprobe.d/* and update modprobe.conf
-	  depending on your distribution.  The latter two modules should be
-	  blacklisted together with ohci1394 because they depend on ohci1394.
-
-	  If you have an old modprobe which doesn't implement the blacklist
-	  directive, use "install modulename /bin/true" for the modules to be
-	  blacklisted.
+	  depending on your distribution.
 
 config FIREWIRE_OHCI_DEBUG
 	bool
@@ -79,13 +73,15 @@ config FIREWIRE_SBP2
 	  configuration section.
 
 config FIREWIRE_NET
-	tristate "IP networking over 1394"
-	depends on FIREWIRE && INET
+	tristate "IP networking over 1394 (EXPERIMENTAL)"
+	depends on FIREWIRE && INET && EXPERIMENTAL
 	help
 	  This enables IPv4 over IEEE 1394, providing IP connectivity with
 	  other implementations of RFC 2734 as found on several operating
 	  systems.  Multicast support is currently limited.
 
+	  NOTE, this driver is not stable yet!
+
 	  To compile this driver as a module, say M here:  The module will be
 	  called firewire-net.  It replaces eth1394 of the classic IEEE 1394
 	  stack.
drivers/ieee1394/Kconfig +6 -13
Index: b/drivers/ieee1394/Kconfig
===================================================================
@@ -4,7 +4,7 @@ menu "IEEE 1394 (FireWire) support"
 source "drivers/firewire/Kconfig"
 
 config IEEE1394
-	tristate "Stable FireWire stack"
+	tristate "Legacy alternative FireWire driver stack"
 	depends on PCI || BROKEN
 	help
 	  IEEE 1394 describes a high performance serial bus, which is also
@@ -33,11 +33,9 @@ config IEEE1394_OHCI1394
 	  module will be called ohci1394.
 
 	  NOTE:
-
-	  You should only build either ohci1394 or the new firewire-ohci driver,
-	  but not both.  If you nevertheless want to install both, you should
-	  configure them only as modules and blacklist the driver(s) which you
-	  don't want to have auto-loaded.  Add either
+	  If you want to install firewire-ohci and ohci1394 together, you
+	  should configure them only as modules and blacklist the driver(s)
+	  which you don't want to have auto-loaded.  Add either
 
 	      blacklist firewire-ohci
 	  or
@@ -46,12 +44,7 @@ config IEEE1394_OHCI1394
 	      blacklist dv1394
 
 	  to /etc/modprobe.conf or /etc/modprobe.d/* and update modprobe.conf
-	  depending on your distribution.  The latter two modules should be
-	  blacklisted together with ohci1394 because they depend on ohci1394.
-
-	  If you have an old modprobe which doesn't implement the blacklist
-	  directive, use "install modulename /bin/true" for the modules to be
-	  blacklisted.
+	  depending on your distribution.
 
 comment "PCILynx controller requires I2C"
 	depends on IEEE1394 && I2C=n
@@ -105,7 +98,7 @@ config IEEE1394_ETH1394_ROM_ENTRY
 	default n
 
 config IEEE1394_ETH1394
-	tristate "IP networking over 1394"
+	tristate "IP networking over 1394 (experimental)"
 	depends on IEEE1394 && EXPERIMENTAL && INET
 	select IEEE1394_ETH1394_ROM_ENTRY
 	help
Signature · 3 lines
Stefan Richter
-=====-==--= -==- =---=
http://arcgraph.de/sr/