diff options
author | Alexander Motin <mav@FreeBSD.org> | 2017-03-20 20:44:14 +0000 |
---|---|---|
committer | Alexander Motin <mav@FreeBSD.org> | 2017-03-20 20:44:14 +0000 |
commit | 98339da12a4e4255ea080b6a3913896c4587cebc (patch) | |
tree | c419e0bd5fb3be866e2072fe26f9749d75307e2a | |
parent | a668f3d89eb68745e90ccbd38b9f300ca16c4726 (diff) |
Notes
-rw-r--r-- | sys/dev/isp/isp_freebsd.c | 32 | ||||
-rw-r--r-- | sys/dev/isp/isp_freebsd.h | 11 | ||||
-rw-r--r-- | sys/dev/isp/ispvar.h | 3 |
3 files changed, 8 insertions, 38 deletions
diff --git a/sys/dev/isp/isp_freebsd.c b/sys/dev/isp/isp_freebsd.c index f742a8eb1af97..b4b32a6b635ba 100644 --- a/sys/dev/isp/isp_freebsd.c +++ b/sys/dev/isp/isp_freebsd.c @@ -294,7 +294,6 @@ isp_attach(ispsoftc_t *isp) callout_init_mtx(&isp->isp_osinfo.tmo, &isp->isp_osinfo.lock, 0); isp_timer_count = hz >> 2; callout_reset(&isp->isp_osinfo.tmo, isp_timer_count, isp_timer, isp); - isp->isp_osinfo.timer_active = 1; isp->isp_osinfo.cdev = make_dev(&isp_cdevsw, du, UID_ROOT, GID_OPERATOR, 0600, "%s", nu); if (isp->isp_osinfo.cdev) { @@ -315,10 +314,6 @@ unwind: ISP_UNLOCK(isp); cam_sim_free(sim, FALSE); } - if (isp->isp_osinfo.cdev) { - destroy_dev(isp->isp_osinfo.cdev); - isp->isp_osinfo.cdev = NULL; - } cam_simq_free(isp->isp_osinfo.devq); isp->isp_osinfo.devq = NULL; return (-1); @@ -327,35 +322,20 @@ unwind: int isp_detach(ispsoftc_t *isp) { - struct cam_sim *sim; int chan; - ISP_LOCK(isp); - for (chan = isp->isp_nchan - 1; chan >= 0; chan -= 1) { - ISP_GET_PC(isp, chan, sim, sim); - if (sim->refcount > 2) { - ISP_UNLOCK(isp); - return (EBUSY); - } + if (isp->isp_osinfo.cdev) { + destroy_dev(isp->isp_osinfo.cdev); + isp->isp_osinfo.cdev = NULL; } + ISP_LOCK(isp); /* Tell spawned threads that we're exiting. */ isp->isp_osinfo.is_exiting = 1; - if (isp->isp_osinfo.timer_active) { - callout_stop(&isp->isp_osinfo.tmo); - isp->isp_osinfo.timer_active = 0; - } for (chan = isp->isp_nchan - 1; chan >= 0; chan -= 1) isp_detach_chan(isp, chan); ISP_UNLOCK(isp); - - if (isp->isp_osinfo.cdev) { - destroy_dev(isp->isp_osinfo.cdev); - isp->isp_osinfo.cdev = NULL; - } - if (isp->isp_osinfo.devq != NULL) { - cam_simq_free(isp->isp_osinfo.devq); - isp->isp_osinfo.devq = NULL; - } + callout_drain(&isp->isp_osinfo.tmo); + cam_simq_free(isp->isp_osinfo.devq); return (0); } diff --git a/sys/dev/isp/isp_freebsd.h b/sys/dev/isp/isp_freebsd.h index 10a818e2053bf..65b18ae64363e 100644 --- a/sys/dev/isp/isp_freebsd.h +++ b/sys/dev/isp/isp_freebsd.h @@ -297,16 +297,7 @@ struct isposinfo { struct isp_pcmd * pcmd_pool; struct isp_pcmd * pcmd_free; - uint32_t -#ifdef ISP_TARGET_MODE - tmwanted : 1, - tmbusy : 1, -#else - : 2, -#endif - sixtyfourbit : 1, /* sixtyfour bit platform */ - timer_active : 1, - autoconf : 1; + int sixtyfourbit; /* sixtyfour bit platform */ int mbox_sleeping; int mbox_sleep_ok; int mboxbsy; diff --git a/sys/dev/isp/ispvar.h b/sys/dev/isp/ispvar.h index c189e2f35db4c..a5be98c0043e1 100644 --- a/sys/dev/isp/ispvar.h +++ b/sys/dev/isp/ispvar.h @@ -532,9 +532,8 @@ struct ispsoftc { uint32_t isp_maxluns; /* maximum luns supported */ uint32_t isp_clock : 8, /* input clock */ - : 4, + : 5, isp_port : 1, /* 23XX/24XX only */ - isp_open : 1, /* opened (ioctl) */ isp_bustype : 1, /* SBus or PCI */ isp_loaded_fw : 1, /* loaded firmware */ isp_dblev : 16; /* debug log mask */ |