cxgbe/cxgbei: There is no need for multiple modules in the KLD.

Sponsored by:	Chelsio Communications
This commit is contained in:
np 2016-08-26 01:28:31 +00:00
parent 33af5bbb36
commit 89af59a65f
3 changed files with 16 additions and 33 deletions

View File

@ -1117,10 +1117,14 @@ cxgbei_modevent(module_t mod, int cmd, void *arg)
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:

View File

@ -167,4 +167,8 @@ int t4_ddp_set_map(struct cxgbei_data *, void *,
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

View File

@ -877,10 +877,10 @@ icl_cxgbei_limits(struct icl_drv_limits *idl)
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