Lines Matching defs:scsi_dh

26 #include <scsi/scsi_dh.h>
72 * @scsi_dh - The device handler to match against or NULL
73 * @sdev - SCSI device to be tested against @scsi_dh
75 * Tests @sdev against the device handler @scsi_dh or against
76 * all registered device_handler if @scsi_dh == NULL.
80 device_handler_match(struct scsi_device_handler *scsi_dh,
87 if (scsi_dh && found_dh != scsi_dh)
96 * @scsi_dh - The device handler to attach
99 struct scsi_device_handler *scsi_dh)
104 if (sdev->scsi_dh_data->scsi_dh != scsi_dh)
108 } else if (scsi_dh->attach) {
109 err = scsi_dh->attach(sdev);
121 scsi_dh_data->scsi_dh->detach(scsi_dh_data->sdev);
127 * @scsi_dh - Device handler to be detached
130 * only detach if the currently attached handler matches @scsi_dh.
133 struct scsi_device_handler *scsi_dh)
138 if (scsi_dh && scsi_dh != sdev->scsi_dh_data->scsi_dh)
141 if (!scsi_dh)
142 scsi_dh = sdev->scsi_dh_data->scsi_dh;
144 if (scsi_dh && scsi_dh->detach)
156 struct scsi_device_handler *scsi_dh;
167 if (!(scsi_dh = get_device_handler(buf)))
169 err = scsi_dh_handler_attach(sdev, scsi_dh);
171 scsi_dh = sdev->scsi_dh_data->scsi_dh;
176 scsi_dh_handler_detach(sdev, scsi_dh);
182 if (scsi_dh->activate)
183 err = scsi_dh->activate(sdev, NULL, NULL);
200 return snprintf(buf, 20, "%s\n", sdev->scsi_dh_data->scsi_dh->name);
278 struct scsi_device_handler *scsi_dh = data;
289 if (device_handler_match(scsi_dh, sdev))
290 scsi_dh_handler_attach(sdev, scsi_dh);
302 struct scsi_device_handler *scsi_dh = data;
313 scsi_dh_handler_detach(sdev, scsi_dh);
323 * @scsi_dh - device handler to be registered.
327 int scsi_register_device_handler(struct scsi_device_handler *scsi_dh)
330 if (get_device_handler(scsi_dh->name))
334 list_add(&scsi_dh->list, &scsi_dh_list);
337 bus_for_each_dev(&scsi_bus_type, NULL, scsi_dh, scsi_dh_notifier_add);
338 printk(KERN_INFO "%s: device handler registered\n", scsi_dh->name);
347 * @scsi_dh - device handler to be unregistered.
351 int scsi_unregister_device_handler(struct scsi_device_handler *scsi_dh)
354 if (!get_device_handler(scsi_dh->name))
357 bus_for_each_dev(&scsi_bus_type, NULL, scsi_dh,
361 list_del(&scsi_dh->list);
363 printk(KERN_INFO "%s: device handler unregistered\n", scsi_dh->name);
387 struct scsi_device_handler *scsi_dh = NULL;
401 scsi_dh = sdev->scsi_dh_data->scsi_dh;
403 if (!scsi_dh || !dev ||
417 if (scsi_dh->activate)
418 err = scsi_dh->activate(sdev, fn, data);
440 struct scsi_device_handler *scsi_dh = NULL;
445 scsi_dh = sdev->scsi_dh_data->scsi_dh;
446 if (scsi_dh && scsi_dh->set_params && get_device(&sdev->sdev_gendev))
452 err = scsi_dh->set_params(sdev, params);
479 struct scsi_device_handler *scsi_dh;
482 scsi_dh = get_device_handler(name);
483 if (!scsi_dh)
493 err = scsi_dh_handler_attach(sdev, scsi_dh);
513 struct scsi_device_handler *scsi_dh = NULL;
525 scsi_dh = sdev->scsi_dh_data->scsi_dh;
526 scsi_dh_handler_detach(sdev, scsi_dh);
557 handler_name = kstrdup(sdev->scsi_dh_data->scsi_dh->name, gfp);