svn commit: r277402 - in head/sys: contrib/rdma/krping dev/cxgb/ulp/iw_cxgb dev/cxgbe/iw_cxgbe ofed/drivers/infiniband/core ofed/drivers/infiniband/hw/mlx4 ofed/drivers/infiniband/hw/mthca ofed/dri...

Hans Petter Selasky hselasky at FreeBSD.org
Mon Jan 19 21:53:04 UTC 2015


Author: hselasky
Date: Mon Jan 19 21:53:00 2015
New Revision: 277402
URL: https://svnweb.freebsd.org/changeset/base/277402

Log:
  Add missing linuxapi module dependencies and always use the FreeBSD
  "MODULE_VERSION" macro definition. Remove the redefinition of the
  "MODULE_VERSION" macro from the Linux kernel compatibility API.
  
  MFC after:	1 month
  Reported by:	np@
  Sponsored by:	Mellanox Technologies

Modified:
  head/sys/contrib/rdma/krping/krping.c
  head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c
  head/sys/dev/cxgbe/iw_cxgbe/device.c
  head/sys/ofed/drivers/infiniband/core/device.c
  head/sys/ofed/drivers/infiniband/hw/mlx4/main.c
  head/sys/ofed/drivers/infiniband/hw/mthca/mthca_main.c
  head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c
  head/sys/ofed/drivers/net/mlx4/en_main.c
  head/sys/ofed/drivers/net/mlx4/main.c
  head/sys/ofed/include/linux/module.h

Modified: head/sys/contrib/rdma/krping/krping.c
==============================================================================
--- head/sys/contrib/rdma/krping/krping.c	Mon Jan 19 21:47:18 2015	(r277401)
+++ head/sys/contrib/rdma/krping/krping.c	Mon Jan 19 21:53:00 2015	(r277402)
@@ -60,6 +60,8 @@ extern int krping_debug;
 MODULE_AUTHOR("Steve Wise");
 MODULE_DESCRIPTION("RDMA ping client/server");
 MODULE_LICENSE("Dual BSD/GPL");
+MODULE_VERSION(krping, 1);
+MODULE_DEPEND(krping, linuxapi, 1, 1, 1);
 
 static __inline uint64_t
 get_cycles(void)

Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c
==============================================================================
--- head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c	Mon Jan 19 21:47:18 2015	(r277401)
+++ head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb.c	Mon Jan 19 21:53:00 2015	(r277402)
@@ -251,9 +251,6 @@ iwch_mod_unload(void)
 }
 #endif	/* TCP_OFFLOAD */
 
-#undef MODULE_VERSION
-#include <sys/module.h>
-
 static int
 iwch_modevent(module_t mod, int cmd, void *arg)
 {
@@ -299,3 +296,5 @@ MODULE_DEPEND(t3_tom, cxgbc, 1, 1, 1);
 MODULE_DEPEND(iw_cxgb, toecore, 1, 1, 1);
 MODULE_DEPEND(iw_cxgb, t3_tom, 1, 1, 1);
 MODULE_DEPEND(iw_cxgb, ibcore, 1, 1, 1);
+MODULE_DEPEND(iw_cxgb, linuxapi, 1, 1, 1);
+

Modified: head/sys/dev/cxgbe/iw_cxgbe/device.c
==============================================================================
--- head/sys/dev/cxgbe/iw_cxgbe/device.c	Mon Jan 19 21:47:18 2015	(r277401)
+++ head/sys/dev/cxgbe/iw_cxgbe/device.c	Mon Jan 19 21:53:00 2015	(r277402)
@@ -321,8 +321,6 @@ c4iw_mod_unload(void)
 }
 
 #endif
-#undef MODULE_VERSION
-#include <sys/module.h>
 
 /*
  * t4_tom won't load on kernels without TCP_OFFLOAD and this module's dependency
@@ -366,4 +364,5 @@ MODULE_VERSION(iw_cxgbe, 1);
 MODULE_DEPEND(iw_cxgbe, t4nex, 1, 1, 1);
 MODULE_DEPEND(iw_cxgbe, t4_tom, 1, 1, 1);
 MODULE_DEPEND(iw_cxgbe, ibcore, 1, 1, 1);
+MODULE_DEPEND(iw_cxgbe, linuxapi, 1, 1, 1);
 DECLARE_MODULE(iw_cxgbe, c4iw_mod_data, SI_SUB_EXEC, SI_ORDER_ANY);

Modified: head/sys/ofed/drivers/infiniband/core/device.c
==============================================================================
--- head/sys/ofed/drivers/infiniband/core/device.c	Mon Jan 19 21:47:18 2015	(r277401)
+++ head/sys/ofed/drivers/infiniband/core/device.c	Mon Jan 19 21:53:00 2015	(r277402)
@@ -754,8 +754,6 @@ static void __exit ib_core_cleanup(void)
 module_init(ib_core_init);
 module_exit(ib_core_cleanup);
 
-#undef MODULE_VERSION
-#include <sys/module.h>
 static int
 ibcore_evhand(module_t mod, int event, void *arg)
 {

Modified: head/sys/ofed/drivers/infiniband/hw/mlx4/main.c
==============================================================================
--- head/sys/ofed/drivers/infiniband/hw/mlx4/main.c	Mon Jan 19 21:47:18 2015	(r277401)
+++ head/sys/ofed/drivers/infiniband/hw/mlx4/main.c	Mon Jan 19 21:53:00 2015	(r277402)
@@ -67,7 +67,9 @@
 MODULE_AUTHOR("Roland Dreier");
 MODULE_DESCRIPTION("Mellanox ConnectX HCA InfiniBand driver");
 MODULE_LICENSE("Dual BSD/GPL");
+#ifdef __linux__
 MODULE_VERSION(DRV_VERSION);
+#endif
 
 int mlx4_ib_sm_guid_assign = 1;
 
@@ -2404,8 +2406,6 @@ static void __exit mlx4_ib_cleanup(void)
 module_init_order(mlx4_ib_init, SI_ORDER_MIDDLE);
 module_exit(mlx4_ib_cleanup);
 
-#undef MODULE_VERSION
-#include <sys/module.h>
 static int
 mlx4ib_evhand(module_t mod, int event, void *arg)
 {

Modified: head/sys/ofed/drivers/infiniband/hw/mthca/mthca_main.c
==============================================================================
--- head/sys/ofed/drivers/infiniband/hw/mthca/mthca_main.c	Mon Jan 19 21:47:18 2015	(r277401)
+++ head/sys/ofed/drivers/infiniband/hw/mthca/mthca_main.c	Mon Jan 19 21:53:00 2015	(r277402)
@@ -47,7 +47,9 @@
 MODULE_AUTHOR("Roland Dreier");
 MODULE_DESCRIPTION("Mellanox InfiniBand HCA low-level driver");
 MODULE_LICENSE("Dual BSD/GPL");
-MODULE_VERSION(DRV_VERSION);
+MODULE_VERSION(mthca, 1);
+MODULE_DEPEND(mthca, linuxapi, 1, 1, 1);
+MODULE_DEPEND(mthca, ibcore, 1, 1, 1);
 
 #ifdef CONFIG_INFINIBAND_MTHCA_DEBUG
 

Modified: head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c
==============================================================================
--- head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c	Mon Jan 19 21:47:18 2015	(r277401)
+++ head/sys/ofed/drivers/infiniband/ulp/ipoib/ipoib_main.c	Mon Jan 19 21:53:00 2015	(r277402)
@@ -1527,8 +1527,6 @@ ipoib_resolvemulti(struct ifnet *ifp, st
 module_init(ipoib_init_module);
 module_exit(ipoib_cleanup_module);
 
-#undef MODULE_VERSION
-#include <sys/module.h>
 static int
 ipoib_evhand(module_t mod, int event, void *arg)
 {

Modified: head/sys/ofed/drivers/net/mlx4/en_main.c
==============================================================================
--- head/sys/ofed/drivers/net/mlx4/en_main.c	Mon Jan 19 21:47:18 2015	(r277401)
+++ head/sys/ofed/drivers/net/mlx4/en_main.c	Mon Jan 19 21:53:00 2015	(r277402)
@@ -45,7 +45,9 @@
 MODULE_AUTHOR("Liran Liss, Yevgeny Petrilin");
 MODULE_DESCRIPTION("Mellanox ConnectX HCA Ethernet driver");
 MODULE_LICENSE("Dual BSD/GPL");
+#ifdef __linux__
 MODULE_VERSION(DRV_VERSION " ("DRV_RELDATE")");
+#endif
 
 static const char mlx4_en_version[] =
 	DRV_NAME ": Mellanox ConnectX HCA Ethernet driver v"
@@ -336,8 +338,6 @@ static void __exit mlx4_en_cleanup(void)
 module_init(mlx4_en_init);
 module_exit(mlx4_en_cleanup);
 
-#undef MODULE_VERSION
-#include <sys/module.h>
 static int
 mlxen_evhand(module_t mod, int event, void *arg)
 {

Modified: head/sys/ofed/drivers/net/mlx4/main.c
==============================================================================
--- head/sys/ofed/drivers/net/mlx4/main.c	Mon Jan 19 21:47:18 2015	(r277401)
+++ head/sys/ofed/drivers/net/mlx4/main.c	Mon Jan 19 21:53:00 2015	(r277402)
@@ -34,10 +34,6 @@
  */
 
 #include <linux/kmod.h> 
-/* 
- * kmod.h must be included before module.h since it includes (indirectly) sys/module.h
- * To use the FBSD macro sys/module.h should define MODULE_VERSION before linux/module does.
-*/
 #include <linux/module.h>
 #include <linux/errno.h>
 #include <linux/pci.h>
@@ -3783,7 +3779,6 @@ static void __exit mlx4_cleanup(void)
 module_init_order(mlx4_init, SI_ORDER_MIDDLE);
 module_exit(mlx4_cleanup);
 
-#include <sys/module.h>
 static int
 mlx4_evhand(module_t mod, int event, void *arg)
 {

Modified: head/sys/ofed/include/linux/module.h
==============================================================================
--- head/sys/ofed/include/linux/module.h	Mon Jan 19 21:47:18 2015	(r277401)
+++ head/sys/ofed/include/linux/module.h	Mon Jan 19 21:53:00 2015	(r277402)
@@ -29,6 +29,10 @@
 #ifndef	_LINUX_MODULE_H_
 #define	_LINUX_MODULE_H_
 
+#include <sys/cdefs.h>
+#include <sys/types.h>
+#include <sys/module.h>
+
 #include <linux/list.h>
 #include <linux/compiler.h>
 #include <linux/kobject.h>
@@ -39,10 +43,6 @@
 #define MODULE_DESCRIPTION(name)
 #define MODULE_LICENSE(name)
 
-#ifndef MODULE_VERSION
-#define MODULE_VERSION(name)
-#endif
-
 #define	THIS_MODULE	((struct module *)0)
 
 #define	EXPORT_SYMBOL(name)


More information about the svn-src-all mailing list