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

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

diff -u --recursive --new-file v2.4.8/linux/drivers/ieee1394/nodemgr.h linux/drivers/ieee1394/nodemgr.h
@@ -20,41 +20,76 @@
 #ifndef _IEEE1394_NODEMGR_H
 #define _IEEE1394_NODEMGR_H
 
+/* '1' '3' '9' '4' in ASCII */
+#define IEEE1394_BUSID_MAGIC	0x31333934
 
-/*
- * General information: Finding out which GUID belongs to which node is done by
- * sending packets and therefore waiting for the answers.  Wherever it is
- * mentioned that a node is inaccessible this could just as well mean that we
- * just don't know yet (usually, bus reset handlers can't rely on GUIDs being
- * associated with current nodes).
- */
-
-struct node_entry;
-typedef struct node_entry *hpsb_guid_t;
-
+/* This is the start of a Node entry structure. It should be a stable API
+ * for which to gather info from the Node Manager about devices attached
+ * to the bus.  */
+struct bus_options {
+	u8	irmc;		/* Iso Resource Manager Capable */
+	u8	cmc;		/* Cycle Master Capable */
+	u8	isc;		/* Iso Capable */
+	u8	bmc;		/* Bus Master Capable */
+	u8	pmc;		/* Power Manager Capable (PNP spec) */
+	u8	cyc_clk_acc;	/* Cycle clock accuracy */
+	u8	generation;	/* Incremented when configrom changes */
+	u8	lnkspd;		/* Link speed */
+	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
+
+struct unit_directory {
+	struct list_head list;
+	octlet_t address;	/* Address of the unit directory on the node */
+	u8 flags;		/* Indicates which entries were read */
+	quadlet_t vendor_id;
+	char *vendor_name;
+	quadlet_t model_id;
+	char *model_name;
+	quadlet_t specifier_id;
+	quadlet_t version;
+};
+
+struct node_entry {
+	struct list_head list;
+	u64 guid;			/* GUID of this node */
+	struct hpsb_host *host;		/* Host this node is attached to */
+	nodeid_t nodeid;		/* NodeID */
+	struct bus_options busopt;	/* Bus Options */
+	atomic_t generation;		/* Synced with hpsb generation */
+
+	/* The following is read from the config rom */
+	u32 vendor_id;
+	u32 capabilities;	
+	struct list_head unit_directories;
+};
 
 /*
- * Returns a guid handle (which has its reference count incremented) or NULL if
- * there is the GUID in question is not known of.  Getting a valid handle does
- * not mean that the node with this GUID is currently accessible (might not be
- * plugged in or powered down).
+ * Returns a node entry (which has its reference count incremented) or NULL if
+ * the GUID in question is not known.  Getting a valid entry does not mean that
+ * the node with this GUID is currently accessible (might be powered down).
  */
-hpsb_guid_t hpsb_guid_get_handle(u64 guid);
+struct node_entry *hpsb_guid_get_entry(u64 guid);
+
+/* Same as above, but use the nodeid to get an node entry. This is not
+ * fool-proof by itself, since the nodeid can change.  */
+struct node_entry *hpsb_nodeid_get_entry(nodeid_t nodeid);
 
 /*
- * If the handle refers to a local host, this function will return the pointer
+ * If the entry refers to a local host, this function will return the pointer
  * to the hpsb_host structure.  It will return NULL otherwise.  Once you have
  * established it is a local host, you can use that knowledge from then on (the
- * GUID won't wander to an external node).
- *
- * Note that the local GUID currently isn't collected, so this will always
- * return NULL.
- */
-struct hpsb_host *hpsb_get_host_by_ne(hpsb_guid_t handle);
+ * GUID won't wander to an external node).  */
+struct hpsb_host *hpsb_get_host_by_ne(struct node_entry *ne);
 
 /*
  * This will fill in the given, pre-initialised hpsb_packet with the current
- * information from the GUID handle (host, node ID, generation number).  It will
+ * information from the node entry (host, node ID, generation number).  It will
  * return false if the node owning the GUID is not accessible (and not modify the 
  * hpsb_packet) and return true otherwise.
  *
@@ -63,7 +98,7 @@
  * number).  It will at least reliably fail so that you don't accidentally and
  * unknowingly send your packet to the wrong node.
  */
-int hpsb_guid_fill_packet(hpsb_guid_t handle, struct hpsb_packet *pkt);
+int hpsb_guid_fill_packet(struct node_entry *ne, struct hpsb_packet *pkt);
 
 
 void init_ieee1394_nodemgr(void);

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