Lines Matching defs:sdev

71 scsi_dh_find_driver(struct scsi_device *sdev)
75 if (scsi_device_tpgs(sdev))
79 if (!strncmp(sdev->vendor, b->vendor, strlen(b->vendor)) &&
80 !strncmp(sdev->model, b->model, strlen(b->model))) {
121 * @sdev - SCSI device the device handler should attach to
124 static int scsi_dh_handler_attach(struct scsi_device *sdev,
132 error = scsi_dh->attach(sdev);
150 sdev_printk(KERN_ERR, sdev, "%s: Attach failed (%d)\n",
154 sdev->handler = scsi_dh;
161 * @sdev - SCSI device the device handler should be detached from
163 static void scsi_dh_handler_detach(struct scsi_device *sdev)
165 sdev->handler->detach(sdev);
166 sdev_printk(KERN_NOTICE, sdev, "%s: Detached\n", sdev->handler->name);
167 module_put(sdev->handler->module);
170 void scsi_dh_add_device(struct scsi_device *sdev)
175 drv = scsi_dh_find_driver(sdev);
183 (void)scsi_dh_handler_attach(sdev, devinfo);
186 void scsi_dh_release_device(struct scsi_device *sdev)
188 if (sdev->handler)
189 scsi_dh_handler_detach(sdev);
253 struct scsi_device *sdev;
256 sdev = scsi_device_from_queue(q);
257 if (!sdev) {
263 if (!sdev->handler)
266 if (sdev->sdev_state == SDEV_CANCEL ||
267 sdev->sdev_state == SDEV_DEL)
271 if (sdev->sdev_state == SDEV_OFFLINE)
274 if (sdev->handler->activate)
275 err = sdev->handler->activate(sdev, fn, data);
278 put_device(&sdev->sdev_gendev);
300 struct scsi_device *sdev;
303 sdev = scsi_device_from_queue(q);
304 if (!sdev)
307 if (sdev->handler && sdev->handler->set_params)
308 err = sdev->handler->set_params(sdev, params);
309 put_device(&sdev->sdev_gendev);
322 struct scsi_device *sdev;
326 sdev = scsi_device_from_queue(q);
327 if (!sdev)
336 if (sdev->handler) {
337 if (sdev->handler != scsi_dh)
342 err = scsi_dh_handler_attach(sdev, scsi_dh);
345 put_device(&sdev->sdev_gendev);
361 struct scsi_device *sdev;
364 sdev = scsi_device_from_queue(q);
365 if (!sdev)
368 if (sdev->handler)
369 handler_name = kstrdup(sdev->handler->name, gfp);
370 put_device(&sdev->sdev_gendev);