patch-2.4.22 linux-2.4.22/drivers/ieee1394/nodemgr.h

Next file: linux-2.4.22/drivers/ieee1394/ohci1394.c
Previous file: linux-2.4.22/drivers/ieee1394/nodemgr.c
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/drivers/ieee1394/nodemgr.h linux-2.4.22/drivers/ieee1394/nodemgr.h
@@ -20,6 +20,9 @@
 #ifndef _IEEE1394_NODEMGR_H
 #define _IEEE1394_NODEMGR_H
 
+#include "ieee1394_core.h"
+#include "ieee1394_hotplug.h"
+
 #define CONFIG_ROM_BUS_INFO_LENGTH(q)		((q) >> 24)
 #define CONFIG_ROM_BUS_CRC_LENGTH(q)		(((q) >> 16) & 0xff)
 #define CONFIG_ROM_BUS_CRC(q)			((q) & 0xffff)
@@ -77,12 +80,14 @@
 	u16	max_rec;	/* Maximum packet size node can receive */
 };
 
-#define UNIT_DIRECTORY_VENDOR_ID	0x01
-#define UNIT_DIRECTORY_MODEL_ID		0x02
-#define UNIT_DIRECTORY_SPECIFIER_ID	0x04
-#define UNIT_DIRECTORY_VERSION		0x08
-#define UNIT_DIRECTORY_VENDOR_TEXT	0x10
-#define UNIT_DIRECTORY_MODEL_TEXT	0x20
+#define UNIT_DIRECTORY_VENDOR_ID		0x01
+#define UNIT_DIRECTORY_MODEL_ID			0x02
+#define UNIT_DIRECTORY_SPECIFIER_ID		0x04
+#define UNIT_DIRECTORY_VERSION			0x08
+#define UNIT_DIRECTORY_VENDOR_TEXT		0x10
+#define UNIT_DIRECTORY_MODEL_TEXT		0x20
+#define UNIT_DIRECTORY_HAS_LUN_DIRECTORY	0x40
+#define UNIT_DIRECTORY_LUN_DIRECTORY		0x80
 
 /*
  * A unit directory corresponds to a protocol supported by the
@@ -152,6 +157,58 @@
 	quadlet_t quadlets[0];
 };
 
+struct hpsb_protocol_driver {
+	/* The name of the driver, e.g. SBP2 or IP1394 */
+	const char *name;
+
+	/*
+	 * The device id table describing the protocols and/or devices
+	 * supported by this driver.  This is used by the nodemgr to
+	 * decide if a driver could support a given node, but the
+	 * probe function below can implement further protocol
+	 * dependent or vendor dependent checking.
+	 */
+	struct ieee1394_device_id *id_table;
+
+	/*
+	 * The probe function is called when a device is added to the
+	 * bus and the nodemgr finds a matching entry in the drivers
+	 * device id table or when registering this driver and a
+	 * previously unhandled device can be handled.  The driver may
+	 * decline to handle the device based on further investigation
+	 * of the device (or whatever reason) in which case a negative
+	 * error code should be returned, otherwise 0 should be
+	 * returned. The driver may use the driver_data field in the
+	 * unit directory to store per device driver specific data.
+	 */
+	int (*probe)(struct unit_directory *ud);
+
+	/*
+	 * The disconnect function is called when a device is removed
+	 * from the bus or if it wasn't possible to read the guid
+	 * after the last bus reset.
+	 */
+	void (*disconnect)(struct unit_directory *ud);
+
+	/*
+	 * The update function is called when the node has just
+	 * survived a bus reset, i.e. it is still present on the bus.
+	 * However, it may be necessary to reestablish the connection
+	 * or login into the node again, depending on the protocol.
+	 */
+	void (*update)(struct unit_directory *ud);
+
+	/* Driver in list of all registered drivers */
+	struct list_head list;
+
+	/* The list of unit directories managed by this driver */
+	struct list_head unit_directories;
+};
+
+int hpsb_register_protocol(struct hpsb_protocol_driver *driver);
+void hpsb_unregister_protocol(struct hpsb_protocol_driver *driver);
+void hpsb_release_unit_directory(struct unit_directory *ud);
+
 static inline int hpsb_node_entry_valid(struct node_entry *ne)
 {
 	return ne->generation == get_hpsb_generation(ne->host);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)