Deleted Added
full compact
isp_freebsd.c (316401) isp_freebsd.c (316403)
1/*-
2 * Copyright (c) 1997-2009 by Matthew Jacob
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 14 unchanged lines hidden (view full) ---

23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27/*
28 * Platform (FreeBSD) dependent common attachment code for Qlogic adapters.
29 */
30#include <sys/cdefs.h>
1/*-
2 * Copyright (c) 1997-2009 by Matthew Jacob
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * 1. Redistributions of source code must retain the above copyright

--- 14 unchanged lines hidden (view full) ---

23 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24 * SUCH DAMAGE.
25 */
26
27/*
28 * Platform (FreeBSD) dependent common attachment code for Qlogic adapters.
29 */
30#include <sys/cdefs.h>
31__FBSDID("$FreeBSD: stable/10/sys/dev/isp/isp_freebsd.c 316401 2017-04-02 10:53:37Z mav $");
31__FBSDID("$FreeBSD: stable/10/sys/dev/isp/isp_freebsd.c 316403 2017-04-02 10:54:58Z mav $");
32
33#include <dev/isp/isp_freebsd.h>
34#include <sys/unistd.h>
35#include <sys/kthread.h>
36#include <sys/conf.h>
37#include <sys/module.h>
38#include <sys/ioccom.h>
39#include <dev/isp/isp_ioctl.h>

--- 67 unchanged lines hidden (view full) ---

107{
108 struct ccb_setasync csa;
109 struct cam_sim *sim;
110 struct cam_path *path;
111#ifdef ISP_TARGET_MODE
112 int i;
113#endif
114
32
33#include <dev/isp/isp_freebsd.h>
34#include <sys/unistd.h>
35#include <sys/kthread.h>
36#include <sys/conf.h>
37#include <sys/module.h>
38#include <sys/ioccom.h>
39#include <dev/isp/isp_ioctl.h>

--- 67 unchanged lines hidden (view full) ---

107{
108 struct ccb_setasync csa;
109 struct cam_sim *sim;
110 struct cam_path *path;
111#ifdef ISP_TARGET_MODE
112 int i;
113#endif
114
115 /*
116 * Construct our SIM entry.
117 */
118 sim = cam_sim_alloc(isp_action, isp_poll, "isp", isp, device_get_unit(isp->isp_dev), &isp->isp_osinfo.lock, isp->isp_maxcmds, isp->isp_maxcmds, devq);
119
120 if (sim == NULL) {
115 sim = cam_sim_alloc(isp_action, isp_poll, "isp", isp,
116 device_get_unit(isp->isp_dev), &isp->isp_lock,
117 isp->isp_maxcmds, isp->isp_maxcmds, devq);
118 if (sim == NULL)
121 return (ENOMEM);
119 return (ENOMEM);
122 }
123
124 ISP_LOCK(isp);
125 if (xpt_bus_register(sim, isp->isp_dev, chan) != CAM_SUCCESS) {
126 ISP_UNLOCK(isp);
127 cam_sim_free(sim, FALSE);
128 return (EIO);
129 }
130 ISP_UNLOCK(isp);

--- 37 unchanged lines hidden (view full) ---

168 char name[16];
169
170 ISP_LOCK(isp);
171 fc->sim = sim;
172 fc->path = path;
173 fc->isp = isp;
174 fc->ready = 1;
175
120
121 ISP_LOCK(isp);
122 if (xpt_bus_register(sim, isp->isp_dev, chan) != CAM_SUCCESS) {
123 ISP_UNLOCK(isp);
124 cam_sim_free(sim, FALSE);
125 return (EIO);
126 }
127 ISP_UNLOCK(isp);

--- 37 unchanged lines hidden (view full) ---

165 char name[16];
166
167 ISP_LOCK(isp);
168 fc->sim = sim;
169 fc->path = path;
170 fc->isp = isp;
171 fc->ready = 1;
172
176 callout_init_mtx(&fc->gdt, &isp->isp_osinfo.lock, 0);
173 callout_init_mtx(&fc->gdt, &isp->isp_lock, 0);
177 TASK_INIT(&fc->gtask, 1, isp_gdt_task, fc);
178#ifdef ISP_TARGET_MODE
179 TAILQ_INIT(&fc->waitq);
180 STAILQ_INIT(&fc->ntfree);
181 for (i = 0; i < ATPDPSIZE; i++)
182 STAILQ_INSERT_TAIL(&fc->ntfree, &fc->ntpool[i], next);
183 LIST_INIT(&fc->atfree);
184 for (i = ATPDPSIZE-1; i >= 0; i--)

--- 77 unchanged lines hidden (view full) ---

262 xpt_action((union ccb *)&csa);
263 xpt_free_path(path);
264 xpt_bus_deregister(cam_sim_path(sim));
265 cam_sim_free(sim, FALSE);
266
267 /* Wait for the channel's spawned threads to exit. */
268 wakeup(isp->isp_osinfo.pc.ptr);
269 while (*num_threads != 0)
174 TASK_INIT(&fc->gtask, 1, isp_gdt_task, fc);
175#ifdef ISP_TARGET_MODE
176 TAILQ_INIT(&fc->waitq);
177 STAILQ_INIT(&fc->ntfree);
178 for (i = 0; i < ATPDPSIZE; i++)
179 STAILQ_INSERT_TAIL(&fc->ntfree, &fc->ntpool[i], next);
180 LIST_INIT(&fc->atfree);
181 for (i = ATPDPSIZE-1; i >= 0; i--)

--- 77 unchanged lines hidden (view full) ---

259 xpt_action((union ccb *)&csa);
260 xpt_free_path(path);
261 xpt_bus_deregister(cam_sim_path(sim));
262 cam_sim_free(sim, FALSE);
263
264 /* Wait for the channel's spawned threads to exit. */
265 wakeup(isp->isp_osinfo.pc.ptr);
266 while (*num_threads != 0)
270 mtx_sleep(isp, &isp->isp_osinfo.lock, PRIBIO, "isp_reap", 100);
267 mtx_sleep(isp, &isp->isp_lock, PRIBIO, "isp_reap", 100);
271}
272
273int
274isp_attach(ispsoftc_t *isp)
275{
276 const char *nu = device_get_nameunit(isp->isp_osinfo.dev);
277 int du = device_get_unit(isp->isp_dev);
278 int chan;

--- 7 unchanged lines hidden (view full) ---

286 }
287
288 for (chan = 0; chan < isp->isp_nchan; chan++) {
289 if (isp_attach_chan(isp, isp->isp_osinfo.devq, chan)) {
290 goto unwind;
291 }
292 }
293
268}
269
270int
271isp_attach(ispsoftc_t *isp)
272{
273 const char *nu = device_get_nameunit(isp->isp_osinfo.dev);
274 int du = device_get_unit(isp->isp_dev);
275 int chan;

--- 7 unchanged lines hidden (view full) ---

283 }
284
285 for (chan = 0; chan < isp->isp_nchan; chan++) {
286 if (isp_attach_chan(isp, isp->isp_osinfo.devq, chan)) {
287 goto unwind;
288 }
289 }
290
294 callout_init_mtx(&isp->isp_osinfo.tmo, &isp->isp_osinfo.lock, 0);
291 callout_init_mtx(&isp->isp_osinfo.tmo, &isp->isp_lock, 0);
295 isp_timer_count = hz >> 2;
296 callout_reset(&isp->isp_osinfo.tmo, isp_timer_count, isp_timer, isp);
297
298 isp->isp_osinfo.cdev = make_dev(&isp_cdevsw, du, UID_ROOT, GID_OPERATOR, 0600, "%s", nu);
299 if (isp->isp_osinfo.cdev) {
300 isp->isp_osinfo.cdev->si_drv1 = isp;
301 }
302 return (0);

--- 2497 unchanged lines hidden (view full) ---

2800isp_kthread(void *arg)
2801{
2802 struct isp_fc *fc = arg;
2803 ispsoftc_t *isp = fc->isp;
2804 int chan = fc - isp->isp_osinfo.pc.fc;
2805 int slp = 0, d;
2806 int lb, lim;
2807
292 isp_timer_count = hz >> 2;
293 callout_reset(&isp->isp_osinfo.tmo, isp_timer_count, isp_timer, isp);
294
295 isp->isp_osinfo.cdev = make_dev(&isp_cdevsw, du, UID_ROOT, GID_OPERATOR, 0600, "%s", nu);
296 if (isp->isp_osinfo.cdev) {
297 isp->isp_osinfo.cdev->si_drv1 = isp;
298 }
299 return (0);

--- 2497 unchanged lines hidden (view full) ---

2797isp_kthread(void *arg)
2798{
2799 struct isp_fc *fc = arg;
2800 ispsoftc_t *isp = fc->isp;
2801 int chan = fc - isp->isp_osinfo.pc.fc;
2802 int slp = 0, d;
2803 int lb, lim;
2804
2808 mtx_lock(&isp->isp_osinfo.lock);
2809
2805 ISP_LOCK(isp);
2810 while (isp->isp_osinfo.is_exiting == 0) {
2811 isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0,
2812 "Chan %d Checking FC state", chan);
2813 lb = isp_fc_runstate(isp, chan, 250000);
2814 isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0,
2815 "Chan %d FC got to %s state", chan,
2816 isp_fc_loop_statename(lb));
2817

--- 37 unchanged lines hidden (view full) ---

2855 if (lb == LOOP_READY)
2856 isp_loop_up(isp, chan);
2857 else
2858 isp_loop_dead(isp, chan);
2859 }
2860
2861 isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0,
2862 "Chan %d sleep for %d seconds", chan, slp);
2806 while (isp->isp_osinfo.is_exiting == 0) {
2807 isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0,
2808 "Chan %d Checking FC state", chan);
2809 lb = isp_fc_runstate(isp, chan, 250000);
2810 isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0,
2811 "Chan %d FC got to %s state", chan,
2812 isp_fc_loop_statename(lb));
2813

--- 37 unchanged lines hidden (view full) ---

2851 if (lb == LOOP_READY)
2852 isp_loop_up(isp, chan);
2853 else
2854 isp_loop_dead(isp, chan);
2855 }
2856
2857 isp_prt(isp, ISP_LOG_SANCFG|ISP_LOGDEBUG0,
2858 "Chan %d sleep for %d seconds", chan, slp);
2863 msleep(fc, &isp->isp_osinfo.lock, PRIBIO, "ispf", slp * hz);
2859 msleep(fc, &isp->isp_lock, PRIBIO, "ispf", slp * hz);
2864 }
2865 fc->num_threads -= 1;
2860 }
2861 fc->num_threads -= 1;
2866 mtx_unlock(&isp->isp_osinfo.lock);
2862 ISP_UNLOCK(isp);
2867 kthread_exit();
2868}
2869
2870#ifdef ISP_TARGET_MODE
2871static void
2872isp_abort_atio(ispsoftc_t *isp, union ccb *ccb)
2873{
2874 atio_private_data_t *atp;

--- 89 unchanged lines hidden (view full) ---

2964{
2965 int bus, tgt, ts, error;
2966 ispsoftc_t *isp;
2967 struct ccb_trans_settings *cts;
2968
2969 CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("isp_action\n"));
2970
2971 isp = (ispsoftc_t *)cam_sim_softc(sim);
2863 kthread_exit();
2864}
2865
2866#ifdef ISP_TARGET_MODE
2867static void
2868isp_abort_atio(ispsoftc_t *isp, union ccb *ccb)
2869{
2870 atio_private_data_t *atp;

--- 89 unchanged lines hidden (view full) ---

2960{
2961 int bus, tgt, ts, error;
2962 ispsoftc_t *isp;
2963 struct ccb_trans_settings *cts;
2964
2965 CAM_DEBUG(ccb->ccb_h.path, CAM_DEBUG_TRACE, ("isp_action\n"));
2966
2967 isp = (ispsoftc_t *)cam_sim_softc(sim);
2972 mtx_assert(&isp->isp_lock, MA_OWNED);
2968 ISP_ASSERT_LOCKED(isp);
2969 bus = cam_sim_bus(sim);
2973 isp_prt(isp, ISP_LOGDEBUG2, "isp_action code %x", ccb->ccb_h.func_code);
2974 ISP_PCMD(ccb) = NULL;
2975
2976 switch (ccb->ccb_h.func_code) {
2977 case XPT_SCSI_IO: /* Execute the requested I/O operation */
2970 isp_prt(isp, ISP_LOGDEBUG2, "isp_action code %x", ccb->ccb_h.func_code);
2971 ISP_PCMD(ccb) = NULL;
2972
2973 switch (ccb->ccb_h.func_code) {
2974 case XPT_SCSI_IO: /* Execute the requested I/O operation */
2978 bus = XS_CHANNEL(ccb);
2979 /*
2980 * Do a couple of preliminary checks...
2981 */
2982 if ((ccb->ccb_h.flags & CAM_CDB_POINTER) != 0) {
2983 if ((ccb->ccb_h.flags & CAM_CDB_PHYS) != 0) {
2984 ccb->ccb_h.status = CAM_REQ_INVALID;
2985 isp_done((struct ccb_scsiio *) ccb);
2986 break;

--- 141 unchanged lines hidden (view full) ---

3128 xpt_done(ccb);
3129 break;
3130 }
3131 case XPT_CONT_TARGET_IO:
3132 isp_target_start_ctio(isp, ccb, FROM_CAM);
3133 break;
3134#endif
3135 case XPT_RESET_DEV: /* BDR the specified SCSI device */
2975 /*
2976 * Do a couple of preliminary checks...
2977 */
2978 if ((ccb->ccb_h.flags & CAM_CDB_POINTER) != 0) {
2979 if ((ccb->ccb_h.flags & CAM_CDB_PHYS) != 0) {
2980 ccb->ccb_h.status = CAM_REQ_INVALID;
2981 isp_done((struct ccb_scsiio *) ccb);
2982 break;

--- 141 unchanged lines hidden (view full) ---

3124 xpt_done(ccb);
3125 break;
3126 }
3127 case XPT_CONT_TARGET_IO:
3128 isp_target_start_ctio(isp, ccb, FROM_CAM);
3129 break;
3130#endif
3131 case XPT_RESET_DEV: /* BDR the specified SCSI device */
3136 bus = cam_sim_bus(xpt_path_sim(ccb->ccb_h.path));
3137 tgt = ccb->ccb_h.target_id;
3138 tgt |= (bus << 16);
3139
3140 error = isp_control(isp, ISPCTL_RESET_DEV, bus, tgt);
3141 if (error) {
3142 ccb->ccb_h.status = CAM_REQ_CMP_ERR;
3143 } else {
3144 /*

--- 42 unchanged lines hidden (view full) ---

3187 case XPT_SET_TRAN_SETTINGS: /* Nexus Settings */
3188 cts = &ccb->cts;
3189 if (!IS_CURRENT_SETTINGS(cts)) {
3190 ccb->ccb_h.status = CAM_REQ_INVALID;
3191 xpt_done(ccb);
3192 break;
3193 }
3194 tgt = cts->ccb_h.target_id;
3132 tgt = ccb->ccb_h.target_id;
3133 tgt |= (bus << 16);
3134
3135 error = isp_control(isp, ISPCTL_RESET_DEV, bus, tgt);
3136 if (error) {
3137 ccb->ccb_h.status = CAM_REQ_CMP_ERR;
3138 } else {
3139 /*

--- 42 unchanged lines hidden (view full) ---

3182 case XPT_SET_TRAN_SETTINGS: /* Nexus Settings */
3183 cts = &ccb->cts;
3184 if (!IS_CURRENT_SETTINGS(cts)) {
3185 ccb->ccb_h.status = CAM_REQ_INVALID;
3186 xpt_done(ccb);
3187 break;
3188 }
3189 tgt = cts->ccb_h.target_id;
3195 bus = cam_sim_bus(xpt_path_sim(cts->ccb_h.path));
3196 if (IS_SCSI(isp)) {
3197 struct ccb_trans_settings_scsi *scsi = &cts->proto_specific.scsi;
3198 struct ccb_trans_settings_spi *spi = &cts->xport_specific.spi;
3199 sdparam *sdp = SDPARAM(isp, bus);
3200 uint16_t *dptr;
3201
3202 if (spi->valid == 0 && scsi->valid == 0) {
3203 ccb->ccb_h.status = CAM_REQ_CMP;

--- 48 unchanged lines hidden (view full) ---

3252 sdp->update = 1;
3253 }
3254 ccb->ccb_h.status = CAM_REQ_CMP;
3255 xpt_done(ccb);
3256 break;
3257 case XPT_GET_TRAN_SETTINGS:
3258 cts = &ccb->cts;
3259 tgt = cts->ccb_h.target_id;
3190 if (IS_SCSI(isp)) {
3191 struct ccb_trans_settings_scsi *scsi = &cts->proto_specific.scsi;
3192 struct ccb_trans_settings_spi *spi = &cts->xport_specific.spi;
3193 sdparam *sdp = SDPARAM(isp, bus);
3194 uint16_t *dptr;
3195
3196 if (spi->valid == 0 && scsi->valid == 0) {
3197 ccb->ccb_h.status = CAM_REQ_CMP;

--- 48 unchanged lines hidden (view full) ---

3246 sdp->update = 1;
3247 }
3248 ccb->ccb_h.status = CAM_REQ_CMP;
3249 xpt_done(ccb);
3250 break;
3251 case XPT_GET_TRAN_SETTINGS:
3252 cts = &ccb->cts;
3253 tgt = cts->ccb_h.target_id;
3260 bus = cam_sim_bus(xpt_path_sim(cts->ccb_h.path));
3261 if (IS_FC(isp)) {
3262 fcparam *fcp = FCPARAM(isp, bus);
3263 struct ccb_trans_settings_scsi *scsi = &cts->proto_specific.scsi;
3264 struct ccb_trans_settings_fc *fc = &cts->xport_specific.fc;
3265
3266 cts->protocol = PROTO_SCSI;
3267 cts->protocol_version = SCSI_REV_2;
3268 cts->transport = XPORT_FC;

--- 72 unchanged lines hidden (view full) ---

3341 break;
3342
3343 case XPT_CALC_GEOMETRY:
3344 cam_calc_geometry(&ccb->ccg, 1);
3345 xpt_done(ccb);
3346 break;
3347
3348 case XPT_RESET_BUS: /* Reset the specified bus */
3254 if (IS_FC(isp)) {
3255 fcparam *fcp = FCPARAM(isp, bus);
3256 struct ccb_trans_settings_scsi *scsi = &cts->proto_specific.scsi;
3257 struct ccb_trans_settings_fc *fc = &cts->xport_specific.fc;
3258
3259 cts->protocol = PROTO_SCSI;
3260 cts->protocol_version = SCSI_REV_2;
3261 cts->transport = XPORT_FC;

--- 72 unchanged lines hidden (view full) ---

3334 break;
3335
3336 case XPT_CALC_GEOMETRY:
3337 cam_calc_geometry(&ccb->ccg, 1);
3338 xpt_done(ccb);
3339 break;
3340
3341 case XPT_RESET_BUS: /* Reset the specified bus */
3349 bus = cam_sim_bus(sim);
3350 error = isp_control(isp, ISPCTL_RESET_BUS, bus);
3351 if (error) {
3352 ccb->ccb_h.status = CAM_REQ_CMP_ERR;
3353 xpt_done(ccb);
3354 break;
3355 }
3356 if (bootverbose) {
3357 xpt_print(ccb->ccb_h.path, "reset bus on channel %d\n", bus);

--- 18 unchanged lines hidden (view full) ---

3376 fcparam *fcp;
3377
3378 if (!IS_FC(isp)) {
3379 ccb->ccb_h.status = CAM_REQ_INVALID;
3380 xpt_done(ccb);
3381 break;
3382 }
3383
3342 error = isp_control(isp, ISPCTL_RESET_BUS, bus);
3343 if (error) {
3344 ccb->ccb_h.status = CAM_REQ_CMP_ERR;
3345 xpt_done(ccb);
3346 break;
3347 }
3348 if (bootverbose) {
3349 xpt_print(ccb->ccb_h.path, "reset bus on channel %d\n", bus);

--- 18 unchanged lines hidden (view full) ---

3368 fcparam *fcp;
3369
3370 if (!IS_FC(isp)) {
3371 ccb->ccb_h.status = CAM_REQ_INVALID;
3372 xpt_done(ccb);
3373 break;
3374 }
3375
3384 bus = cam_sim_bus(xpt_path_sim(kp->ccb_h.path));
3385 fcp = FCPARAM(isp, bus);
3386
3387 if (kp->xport_specific.fc.valid & KNOB_VALID_ADDRESS) {
3388 fcp->isp_wwnn = ISP_FC_PC(isp, bus)->def_wwnn = kp->xport_specific.fc.wwnn;
3389 fcp->isp_wwpn = ISP_FC_PC(isp, bus)->def_wwpn = kp->xport_specific.fc.wwpn;
3390 isp_prt(isp, ISP_LOGALL, "Setting Channel %d wwns to 0x%jx 0x%jx", bus, fcp->isp_wwnn, fcp->isp_wwpn);
3391 }
3392 ccb->ccb_h.status = CAM_REQ_CMP;

--- 42 unchanged lines hidden (view full) ---

3435 }
3436 case XPT_GET_SIM_KNOB: /* Get SIM knobs */
3437 {
3438 struct ccb_sim_knob *kp = &ccb->knob;
3439
3440 if (IS_FC(isp)) {
3441 fcparam *fcp;
3442
3376 fcp = FCPARAM(isp, bus);
3377
3378 if (kp->xport_specific.fc.valid & KNOB_VALID_ADDRESS) {
3379 fcp->isp_wwnn = ISP_FC_PC(isp, bus)->def_wwnn = kp->xport_specific.fc.wwnn;
3380 fcp->isp_wwpn = ISP_FC_PC(isp, bus)->def_wwpn = kp->xport_specific.fc.wwpn;
3381 isp_prt(isp, ISP_LOGALL, "Setting Channel %d wwns to 0x%jx 0x%jx", bus, fcp->isp_wwnn, fcp->isp_wwpn);
3382 }
3383 ccb->ccb_h.status = CAM_REQ_CMP;

--- 42 unchanged lines hidden (view full) ---

3426 }
3427 case XPT_GET_SIM_KNOB: /* Get SIM knobs */
3428 {
3429 struct ccb_sim_knob *kp = &ccb->knob;
3430
3431 if (IS_FC(isp)) {
3432 fcparam *fcp;
3433
3443 bus = cam_sim_bus(xpt_path_sim(kp->ccb_h.path));
3444 fcp = FCPARAM(isp, bus);
3445
3446 kp->xport_specific.fc.wwnn = fcp->isp_wwnn;
3447 kp->xport_specific.fc.wwpn = fcp->isp_wwpn;
3448 switch (fcp->role) {
3449 case ISP_ROLE_NONE:
3450 kp->xport_specific.fc.role = KNOB_ROLE_NONE;
3451 break;

--- 31 unchanged lines hidden (view full) ---

3483 cpi->max_lun = ISP_MAX_LUNS(isp) == 0 ?
3484 255 : ISP_MAX_LUNS(isp) - 1;
3485 cpi->bus_id = cam_sim_bus(sim);
3486 if (isp->isp_osinfo.sixtyfourbit)
3487 cpi->maxio = (ISP_NSEG64_MAX - 1) * PAGE_SIZE;
3488 else
3489 cpi->maxio = (ISP_NSEG_MAX - 1) * PAGE_SIZE;
3490
3434 fcp = FCPARAM(isp, bus);
3435
3436 kp->xport_specific.fc.wwnn = fcp->isp_wwnn;
3437 kp->xport_specific.fc.wwpn = fcp->isp_wwpn;
3438 switch (fcp->role) {
3439 case ISP_ROLE_NONE:
3440 kp->xport_specific.fc.role = KNOB_ROLE_NONE;
3441 break;

--- 31 unchanged lines hidden (view full) ---

3473 cpi->max_lun = ISP_MAX_LUNS(isp) == 0 ?
3474 255 : ISP_MAX_LUNS(isp) - 1;
3475 cpi->bus_id = cam_sim_bus(sim);
3476 if (isp->isp_osinfo.sixtyfourbit)
3477 cpi->maxio = (ISP_NSEG64_MAX - 1) * PAGE_SIZE;
3478 else
3479 cpi->maxio = (ISP_NSEG_MAX - 1) * PAGE_SIZE;
3480
3491 bus = cam_sim_bus(xpt_path_sim(cpi->ccb_h.path));
3492 if (IS_FC(isp)) {
3493 fcparam *fcp = FCPARAM(isp, bus);
3494
3495 cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED;
3496 cpi->hba_misc |= PIM_EXTLUNS | PIM_NOSCAN;
3497
3498 /*
3499 * Because our loop ID can shift from time to time,

--- 553 unchanged lines hidden (view full) ---

4053isp_mbox_wait_complete(ispsoftc_t *isp, mbreg_t *mbp)
4054{
4055 u_int t, to;
4056
4057 to = (mbp->timeout == 0) ? MBCMD_DEFAULT_TIMEOUT : mbp->timeout;
4058 if (isp->isp_osinfo.mbox_sleep_ok) {
4059 isp->isp_osinfo.mbox_sleep_ok = 0;
4060 isp->isp_osinfo.mbox_sleeping = 1;
3481 if (IS_FC(isp)) {
3482 fcparam *fcp = FCPARAM(isp, bus);
3483
3484 cpi->hba_misc = PIM_NOBUSRESET | PIM_UNMAPPED;
3485 cpi->hba_misc |= PIM_EXTLUNS | PIM_NOSCAN;
3486
3487 /*
3488 * Because our loop ID can shift from time to time,

--- 553 unchanged lines hidden (view full) ---

4042isp_mbox_wait_complete(ispsoftc_t *isp, mbreg_t *mbp)
4043{
4044 u_int t, to;
4045
4046 to = (mbp->timeout == 0) ? MBCMD_DEFAULT_TIMEOUT : mbp->timeout;
4047 if (isp->isp_osinfo.mbox_sleep_ok) {
4048 isp->isp_osinfo.mbox_sleep_ok = 0;
4049 isp->isp_osinfo.mbox_sleeping = 1;
4061 msleep_sbt(&isp->isp_osinfo.mboxcmd_done, &isp->isp_osinfo.lock,
4050 msleep_sbt(&isp->isp_osinfo.mboxcmd_done, &isp->isp_lock,
4062 PRIBIO, "ispmbx_sleep", to * SBT_1US, 0, 0);
4063 isp->isp_osinfo.mbox_sleep_ok = 1;
4064 isp->isp_osinfo.mbox_sleeping = 0;
4065 } else {
4066 for (t = 0; t < to; t += 100) {
4067 if (isp->isp_osinfo.mboxcmd_done)
4068 break;
4069 ISP_RUN_ISR(isp);

--- 208 unchanged lines hidden ---
4051 PRIBIO, "ispmbx_sleep", to * SBT_1US, 0, 0);
4052 isp->isp_osinfo.mbox_sleep_ok = 1;
4053 isp->isp_osinfo.mbox_sleeping = 0;
4054 } else {
4055 for (t = 0; t < to; t += 100) {
4056 if (isp->isp_osinfo.mboxcmd_done)
4057 break;
4058 ISP_RUN_ISR(isp);

--- 208 unchanged lines hidden ---