patch-2.4.22 linux-2.4.22/drivers/ieee1394/highlevel.c

Next file: linux-2.4.22/drivers/ieee1394/highlevel.h
Previous file: linux-2.4.22/drivers/ieee1394/eth1394.h
Back to the patch index
Back to the overall index

diff -urN linux-2.4.21/drivers/ieee1394/highlevel.c linux-2.4.22/drivers/ieee1394/highlevel.c
@@ -205,6 +205,29 @@
 }
 
 
+struct hpsb_host *hpsb_get_host_bykey(struct hpsb_highlevel *hl, unsigned long key)
+{
+	struct list_head *lh;
+	struct hl_host_info *hi;
+	struct hpsb_host *host = NULL;
+
+	if (!hl)
+		return NULL;
+
+	read_lock(&hl->host_info_lock);
+	list_for_each (lh, &hl->host_info_list) {
+		hi = list_entry(lh, struct hl_host_info, list);
+		if (hi->key == key) {
+			host = hi->host;
+			break;
+		}
+	}
+	read_unlock(&hl->host_info_lock);
+
+	return host;
+}
+
+
 void hpsb_register_highlevel(struct hpsb_highlevel *hl)
 {
 	struct list_head *lh;

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