Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Aug 2016 01:28:31 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r304827 - head/sys/dev/cxgbe/cxgbei
Message-ID:  <201608260128.u7Q1SVGA053419@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: np
Date: Fri Aug 26 01:28:31 2016
New Revision: 304827
URL: https://svnweb.freebsd.org/changeset/base/304827

Log:
  cxgbe/cxgbei: There is no need for multiple modules in the KLD.
  
  Sponsored by:	Chelsio Communications

Modified:
  head/sys/dev/cxgbe/cxgbei/cxgbei.c
  head/sys/dev/cxgbe/cxgbei/cxgbei.h
  head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c

Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.c
==============================================================================
--- head/sys/dev/cxgbe/cxgbei/cxgbei.c	Thu Aug 25 23:55:56 2016	(r304826)
+++ head/sys/dev/cxgbe/cxgbei/cxgbei.c	Fri Aug 26 01:28:31 2016	(r304827)
@@ -1117,10 +1117,14 @@ cxgbei_modevent(module_t mod, int cmd, v
 	switch (cmd) {
 	case MOD_LOAD:
 		rc = cxgbei_mod_load();
+		if (rc == 0)
+			rc = icl_cxgbei_mod_load();
 		break;
 
 	case MOD_UNLOAD:
-		rc = cxgbei_mod_unload();
+		rc = icl_cxgbei_mod_unload();
+		if (rc == 0)
+			rc = cxgbei_mod_unload();
 		break;
 
 	default:

Modified: head/sys/dev/cxgbe/cxgbei/cxgbei.h
==============================================================================
--- head/sys/dev/cxgbe/cxgbei/cxgbei.h	Thu Aug 25 23:55:56 2016	(r304826)
+++ head/sys/dev/cxgbe/cxgbei/cxgbei.h	Fri Aug 26 01:28:31 2016	(r304827)
@@ -167,4 +167,8 @@ int t4_ddp_set_map(struct cxgbei_data *,
     struct cxgbei_ulp2_gather_list *, int);
 void t4_ddp_clear_map(struct cxgbei_data *, struct cxgbei_ulp2_gather_list *,
     u_int, u_int, u_int, struct icl_cxgbei_conn *);
+
+/* icl_cxgbei.c */
+int icl_cxgbei_mod_load(void);
+int icl_cxgbei_mod_unload(void);
 #endif

Modified: head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c
==============================================================================
--- head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c	Thu Aug 25 23:55:56 2016	(r304826)
+++ head/sys/dev/cxgbe/cxgbei/icl_cxgbei.c	Fri Aug 26 01:28:31 2016	(r304827)
@@ -877,10 +877,10 @@ icl_cxgbei_limits(struct icl_drv_limits 
 	return (0);
 }
 
-static int
-icl_cxgbei_load(void)
+int
+icl_cxgbei_mod_load(void)
 {
-	int error;
+	int rc;
 
 	icl_transfer_zone = uma_zcreate("icl_transfer",
 	    16 * 1024, NULL, NULL, NULL, NULL,
@@ -888,15 +888,14 @@ icl_cxgbei_load(void)
 
 	refcount_init(&icl_cxgbei_ncons, 0);
 
-	error = icl_register("cxgbei", false, -100, icl_cxgbei_limits,
+	rc = icl_register("cxgbei", false, -100, icl_cxgbei_limits,
 	    icl_cxgbei_new_conn);
-	KASSERT(error == 0, ("failed to register"));
 
-	return (error);
+	return (rc);
 }
 
-static int
-icl_cxgbei_unload(void)
+int
+icl_cxgbei_mod_unload(void)
 {
 
 	if (icl_cxgbei_ncons != 0)
@@ -908,28 +907,4 @@ icl_cxgbei_unload(void)
 
 	return (0);
 }
-
-static int
-icl_cxgbei_modevent(module_t mod, int what, void *arg)
-{
-
-	switch (what) {
-	case MOD_LOAD:
-		return (icl_cxgbei_load());
-	case MOD_UNLOAD:
-		return (icl_cxgbei_unload());
-	default:
-		return (EINVAL);
-	}
-}
-
-moduledata_t icl_cxgbei_data = {
-	"icl_cxgbei",
-	icl_cxgbei_modevent,
-	0
-};
-
-DECLARE_MODULE(icl_cxgbei, icl_cxgbei_data, SI_SUB_DRIVERS, SI_ORDER_MIDDLE);
-MODULE_DEPEND(icl_cxgbei, icl, 1, 1, 1);
-MODULE_VERSION(icl_cxgbei, 1);
 #endif



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201608260128.u7Q1SVGA053419>