Skip to contentSkip to conversation

Add device probing and sysfs integration.

PATCH In review Kristian Høgsberg 1 participant 1 message Dec 20, 2006 Firewire

lore
Share & tools
lore
#0 lore raw

PATCH 2/4 Add device probing and sysfs integration.

---
 drivers/firewire/Makefile         |    3 
 drivers/firewire/fw-card.c        |   56 +++
 drivers/firewire/fw-device-cdev.c |  617 +++++++++++++++++++++++++++++++++++++
 drivers/firewire/fw-device-cdev.h |  146 +++++++++
 drivers/firewire/fw-device.c      |  613 +++++++++++++++++++++++++++++++++++++
 drivers/firewire/fw-device.h      |  127 ++++++++
 drivers/firewire/fw-iso.c         |    1 
 drivers/firewire/fw-topology.c    |   10 -
 drivers/firewire/fw-transaction.c |    5 
 drivers/firewire/fw-transaction.h |    4 
 10 files changed, 1573 insertions(+), 9 deletions(-)
drivers/firewire/Makefile +2 -1
index db7020d..da77bc0 100644
@@ -2,6 +2,7 @@ #
 # Makefile for the Linux IEEE 1394 implementation
 #
 
-fw-core-objs := fw-card.o fw-topology.o fw-transaction.o fw-iso.o
+fw-core-objs := fw-card.o fw-topology.o fw-transaction.o fw-iso.o \
+	fw-device.o fw-device-cdev.o
 
 obj-$(CONFIG_FW) += fw-core.o
drivers/firewire/fw-card.c +56 -0

74 lines not on this page · raw message

drivers/firewire/fw-device-cdev.c new file +617 -0

617 lines not on this page · raw message

drivers/firewire/fw-device-cdev.h new file +146 -0

146 lines not on this page · raw message

drivers/firewire/fw-device.c new file +613 -0

613 lines not on this page · raw message

drivers/firewire/fw-device.h new file +127 -0

127 lines not on this page · raw message

drivers/firewire/fw-iso.c +1 -0
index 61548c4..6b63856 100644
@@ -26,6 +26,7 @@ #include <linux/mm.h>
 
 #include "fw-transaction.h"
 #include "fw-topology.h"
+#include "fw-device.h"
 
 static int
 setup_iso_buffer(struct fw_iso_context *ctx, size_t size,
drivers/firewire/fw-topology.c +6 -4
index 2778aa3..e475025 100644
@@ -434,13 +434,15 @@ fw_core_handle_bus_reset(struct fw_card 
 		for_each_fw_node(card, local_node, report_found_node);
 	} else {
 		update_tree(card, local_node, &changed);
+		if (changed)
+			card->irm_retries = 0;
 	}
 
+	/* If we're not the root node, we may have to do some IRM work. */
+	if (card->local_node != card->root_node)
+		schedule_delayed_work(&card->work, 0);
+
 	spin_unlock_irqrestore(&card->lock, flags);
 }
 
 EXPORT_SYMBOL(fw_core_handle_bus_reset);
-
-void fw_node_event(struct fw_card *card, struct fw_node *node, int event)
-{
-}
drivers/firewire/fw-transaction.c +1 -4
index c3acf74..affd420 100644
@@ -33,6 +33,7 @@ #include <asm/semaphore.h>
 
 #include "fw-transaction.h"
 #include "fw-topology.h"
+#include "fw-device.h"
 
 #define header_pri(pri)			((pri) << 0)
 #define header_tcode(tcode)		((tcode) << 4)
@@ -702,10 +703,6 @@ static struct fw_descriptor vendor_textu
 	.data = vendor_textual_descriptor_data
 };
 
-struct bus_type fw_bus_type = {
-	.name = "fw",
-};
-
 static int __init fw_core_init(void)
 {
 	int retval;
drivers/firewire/fw-transaction.h +4 -0
index 149ef16..7f618f2 100644
@@ -265,6 +265,10 @@ struct fw_card {
 	struct device card_device;
 
 	struct list_head link;
+
+	/* Work struct for IRM duties. */
+	struct delayed_work work;
+	int irm_retries;
 };
 
 struct fw_card *fw_card_get(struct fw_card *card);
Signature · 1 line
1.4.2.4