[openib-general] [PATCH] use addr on vanilla 2.6.15

Michael S. Tsirkin mst at mellanox.co.il
Thu Jan 19 10:21:10 PST 2006


I find the following useful: it lets me load ib_at on 2.6.14
without kernel patches.

---

ip_dev_find isnt exported to modules starting with 2.6.14

Signed-off-by: Michael S. Tsirkin <mst at mellanox.co.il>

Index: linux-kernel/drivers/infiniband/core/at.c
===================================================================
--- linux-kernel/drivers/infiniband/core/at.c	(revision 5066)
+++ linux-kernel/drivers/infiniband/core/at.c	(working copy)
@@ -60,6 +60,30 @@ MODULE_AUTHOR("Shahar Frank");
 MODULE_DESCRIPTION("InfiniBand address translation");
 MODULE_LICENSE("Dual BSD/GPL");
 
+static int xxx_ip_dev_find(u32 addr)
+{
+	struct net_device *dev;
+	struct in_ifaddr **ifap;
+	struct in_ifaddr *ifa;
+	struct in_device *in_dev;
+
+	read_lock(&dev_base_lock);
+	for (dev = dev_base; dev; dev = dev->next) {
+		for (ifap = &in_dev->ifa_list; (ifa = *ifap);
+		     ifap = &ifa->ifa_next) {
+			if (addr == ifa->ifa_address) {
+				dev_hold(dev);
+				goto found;
+			}
+		}
+	}
+found:
+	read_unlock(&dev_base_lock);
+	return dev;
+}
+
+#define ip_dev_find xxx_ip_dev_find
+
 static struct ib_at_dev ib_at_devs[IB_AT_MAX_DEV];
 
 static void free_ats_req(void *async);

-- 
MST



More information about the general mailing list