Lines Matching defs:sp

64      isc_session_t *sp = cam_sim_softc(sim);
67 debug(3, "sid=%d target=%d lun=%jx", sp->sid, ccb->ccb_h.target_id, (uintmax_t)ccb->ccb_h.target_lun);
76 cpi->max_lun = sp->opt.maxluns - 1;
98 isc_session_t *sp = cam_sim_softc(sim);
100 mtx_unlock(&sp->cam_mtx);
102 mtx_lock(&sp->cam_mtx);
108 ic_lost_target(isc_session_t *sp, int target)
113 if(sp->cam_path != NULL) {
114 mtx_lock(&sp->cam_mtx);
115 xpt_async(AC_LOST_DEVICE, sp->cam_path, NULL);
116 xpt_free_path(sp->cam_path);
117 mtx_unlock(&sp->cam_mtx);
118 sp->cam_path = 0; // XXX
125 isc_session_t *sp = (isc_session_t *)ccb->ccb_h.spriv_ptr0;
131 if(sp->flags & ISC_SCANWAIT) {
132 sp->flags &= ~ISC_SCANWAIT;
133 wakeup(sp);
138 ic_scan(isc_session_t *sp)
143 sdebug(2, "scanning sid=%d", sp->sid);
145 sp->flags &= ~ISC_CAMDEVS;
146 sp->flags |= ISC_SCANWAIT;
149 ccb->ccb_h.path = sp->cam_path;
151 ccb->ccb_h.spriv_ptr0 = sp;
155 while(sp->flags & ISC_SCANWAIT)
156 tsleep(sp, PRIBIO, "ffp", 5*hz); // the timeout time should
158 sdebug(2, "# of luns=%d", sp->target_nluns);
160 if(sp->target_nluns > 0) {
161 sp->flags |= ISC_CAMDEVS;
171 isc_session_t *sp = cam_sim_softc(sim);
176 ccb_h->spriv_ptr0 = sp;
181 if(sp == NULL) {
182 xdebug("sp == NULL! cannot happen");
204 if(sp == NULL) {
225 sp->sid, ccb->ccb_h.target_id, (uintmax_t)ccb->ccb_h.target_lun,
242 off = &sp->target_lun[lun / (sizeof(int)*8)];
244 debug(4, "sp->target_nluns=%d *off=%x boff=%x",
245 sp->target_nluns, *off, boff);
248 sp->target_nluns++;
262 XPT_DONE(sp, ccb);
277 ic_getCamVals(isc_session_t *sp, iscsi_cam_t *cp)
281 if(sp && sp->cam_sim) {
282 cp->path_id = cam_sim_path(sp->cam_sim);
291 ic_destroy(isc_session_t *sp )
295 if(sp->cam_path != NULL) {
297 cam_sim_name(sp->cam_sim), cam_sim_unit(sp->cam_sim));
298 CAM_LOCK(sp);
300 xpt_async(AC_LOST_DEVICE, sp->cam_path, NULL);
302 xpt_async(XPT_RESET_BUS, sp->cam_path, NULL);
304 xpt_free_path(sp->cam_path);
305 xpt_bus_deregister(cam_sim_path(sp->cam_sim));
306 cam_sim_free(sp->cam_sim, TRUE /*free_devq*/);
308 CAM_UNLOCK(sp);
314 ic_init(isc_session_t *sp)
325 mtx_init(&sp->cam_mtx, "isc-cam", NULL, MTX_DEF);
332 sp,
333 sp->sid, // unit
335 &sp->cam_mtx,
343 mtx_destroy(&sp->cam_mtx);
348 CAM_LOCK(sp);
356 CAM_UNLOCK(sp);
358 mtx_destroy(&sp->cam_mtx);
362 sp->cam_sim = sim;
363 if(xpt_create_path(&sp->cam_path, NULL, cam_sim_path(sp->cam_sim),
365 xpt_bus_deregister(cam_sim_path(sp->cam_sim));
367 CAM_UNLOCK(sp);
369 mtx_destroy(&sp->cam_mtx);
373 CAM_UNLOCK(sp);
377 ic_scan(sp);