Lines Matching refs:softc

171 	struct sg_softc *softc;  in sgdevgonecb()  local
179 softc = (struct sg_softc *)periph->softc; in sgdevgonecb()
180 KASSERT(softc->open_count >= 0, ("Negative open count %d", in sgdevgonecb()
181 softc->open_count)); in sgdevgonecb()
188 for (i = 0; i < softc->open_count; i++) in sgdevgonecb()
191 softc->open_count = 0; in sgdevgonecb()
211 struct sg_softc *softc; in sgoninvalidate() local
213 softc = (struct sg_softc *)periph->softc; in sgoninvalidate()
220 softc->flags |= SG_FLAG_INVALID; in sgoninvalidate()
226 destroy_dev_sched_cb(softc->dev, sgdevgonecb, periph); in sgoninvalidate()
239 struct sg_softc *softc; in sgcleanup() local
241 softc = (struct sg_softc *)periph->softc; in sgcleanup()
243 devstat_remove_entry(softc->device_stats); in sgcleanup()
245 free(softc, M_DEVBUF); in sgcleanup()
295 struct sg_softc *softc; in sgregister() local
307 softc = malloc(sizeof(*softc), M_DEVBUF, M_ZERO | M_NOWAIT); in sgregister()
308 if (softc == NULL) { in sgregister()
313 softc->state = SG_STATE_NORMAL; in sgregister()
314 softc->pd_type = SID_TYPE(&cgd->inq_data); in sgregister()
315 softc->sg_timeout = SG_DEFAULT_TIMEOUT / SG_DEFAULT_HZ * hz; in sgregister()
316 softc->sg_user_timeout = SG_DEFAULT_TIMEOUT; in sgregister()
317 TAILQ_INIT(&softc->rdwr_done); in sgregister()
318 periph->softc = softc; in sgregister()
323 softc->maxio = DFLTPHYS; /* traditional default */ in sgregister()
325 softc->maxio = maxphys; /* for safety */ in sgregister()
327 softc->maxio = cpi.maxio; /* real value */ in sgregister()
335 softc->device_stats = devstat_new_entry("sg", in sgregister()
339 softc->pd_type | in sgregister()
364 error = make_dev_s(&args, &softc->dev, "%s%d", in sgregister()
372 (void)make_dev_alias(softc->dev, "sg%c", in sgregister()
375 (void)make_dev_alias(softc->dev, "sg%c%c", in sgregister()
396 struct sg_softc *softc; in sgdone() local
399 softc = (struct sg_softc *)periph->softc; in sgdone()
406 devstat_end_transaction(softc->device_stats, in sgdone()
429 struct sg_softc *softc; in sgopen() local
447 softc = (struct sg_softc *)periph->softc; in sgopen()
448 if (softc->flags & SG_FLAG_INVALID) { in sgopen()
454 softc->open_count++; in sgopen()
465 struct sg_softc *softc; in sgclose() local
472 softc = periph->softc; in sgclose()
473 softc->open_count--; in sgclose()
500 struct sg_softc *softc; in sgioctl() local
507 softc = (struct sg_softc *)periph->softc; in sgioctl()
522 softc->sg_user_timeout = user_timeout; in sgioctl()
523 softc->sg_timeout = user_timeout / SG_DEFAULT_HZ * hz; in sgioctl()
530 td->td_retval[0] = softc->sg_user_timeout; in sgioctl()
623 id->scsi_type = softc->pd_type; in sgioctl()
752 sc = periph->softc; in sgwrite()
816 sc = periph->softc; in sgread()
883 struct sg_softc *softc; in sgsendccb() local
887 softc = periph->softc; in sgsendccb()
898 error = cam_periph_mapmem(ccb, &mapinfo, softc->maxio); in sgsendccb()
907 softc->device_stats); in sgsendccb()
921 struct sg_softc *softc; in sgsendrdwr() local
923 softc = periph->softc; in sgsendrdwr()
924 devstat_start_transaction(softc->device_stats, NULL); in sgsendrdwr()