From owner-svn-src-all@freebsd.org Fri Aug 26 01:28:32 2016 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id E78FCBC5B4D; Fri, 26 Aug 2016 01:28:32 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id A8F7F1852; Fri, 26 Aug 2016 01:28:32 +0000 (UTC) (envelope-from np@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u7Q1SV72053422; Fri, 26 Aug 2016 01:28:31 GMT (envelope-from np@FreeBSD.org) Received: (from np@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u7Q1SVGA053419; Fri, 26 Aug 2016 01:28:31 GMT (envelope-from np@FreeBSD.org) Message-Id: <201608260128.u7Q1SVGA053419@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: np set sender to np@FreeBSD.org using -f From: Navdeep Parhar Date: Fri, 26 Aug 2016 01:28:31 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r304827 - head/sys/dev/cxgbe/cxgbei X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 26 Aug 2016 01:28:33 -0000 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