• Home
  • History
  • Annotate
  • Raw
  • Download
  • only in /netgear-R7000-V1.0.7.12_1.2.5/components/opensource/linux/linux-2.6.36/drivers/scsi/device_handler/

Lines Matching refs:scsi_dh

25 #include <scsi/scsi_dh.h>
74 static int scsi_dh_handler_lookup(struct scsi_device_handler *scsi_dh,
79 for(i = 0; scsi_dh->devlist[i].vendor; i++) {
80 if (!strncmp(sdev->vendor, scsi_dh->devlist[i].vendor,
81 strlen(scsi_dh->devlist[i].vendor)) &&
82 !strncmp(sdev->model, scsi_dh->devlist[i].model,
83 strlen(scsi_dh->devlist[i].model))) {
93 * @scsi_dh - The device handler to match against or NULL
94 * @sdev - SCSI device to be tested against @scsi_dh
96 * Tests @sdev against the device handler @scsi_dh or against
97 * all registered device_handler if @scsi_dh == NULL.
101 device_handler_match(struct scsi_device_handler *scsi_dh,
111 if (scsi_dh) {
112 if (scsi_dh_handler_lookup(scsi_dh, sdev))
113 found_dh = scsi_dh;
147 * @scsi_dh - The device handler to attach
150 struct scsi_device_handler *scsi_dh)
155 if (sdev->scsi_dh_data->scsi_dh != scsi_dh)
159 } else if (scsi_dh->attach) {
160 err = scsi_dh->attach(sdev);
172 scsi_dh_data->scsi_dh->detach(scsi_dh_data->sdev);
178 * @scsi_dh - Device handler to be detached
181 * only detach if the currently attached handler matches @scsi_dh.
184 struct scsi_device_handler *scsi_dh)
189 if (scsi_dh && scsi_dh != sdev->scsi_dh_data->scsi_dh)
192 if (!scsi_dh)
193 scsi_dh = sdev->scsi_dh_data->scsi_dh;
195 if (scsi_dh && scsi_dh->detach)
207 struct scsi_device_handler *scsi_dh;
214 if (!(scsi_dh = get_device_handler(buf)))
216 err = scsi_dh_handler_attach(sdev, scsi_dh);
218 scsi_dh = sdev->scsi_dh_data->scsi_dh;
223 scsi_dh_handler_detach(sdev, scsi_dh);
229 if (scsi_dh->activate)
230 err = scsi_dh->activate(sdev, NULL, NULL);
247 return snprintf(buf, 20, "%s\n", sdev->scsi_dh_data->scsi_dh->name);
325 struct scsi_device_handler *scsi_dh = data;
336 if (device_handler_match(scsi_dh, sdev))
337 scsi_dh_handler_attach(sdev, scsi_dh);
349 struct scsi_device_handler *scsi_dh = data;
360 scsi_dh_handler_detach(sdev, scsi_dh);
370 * @scsi_dh - device handler to be registered.
374 int scsi_register_device_handler(struct scsi_device_handler *scsi_dh)
376 if (get_device_handler(scsi_dh->name))
380 list_add(&scsi_dh->list, &scsi_dh_list);
382 bus_for_each_dev(&scsi_bus_type, NULL, scsi_dh, scsi_dh_notifier_add);
383 printk(KERN_INFO "%s: device handler registered\n", scsi_dh->name);
392 * @scsi_dh - device handler to be unregistered.
396 int scsi_unregister_device_handler(struct scsi_device_handler *scsi_dh)
400 if (!get_device_handler(scsi_dh->name))
403 bus_for_each_dev(&scsi_bus_type, NULL, scsi_dh,
407 list_del(&scsi_dh->list);
409 if (pos->handler == scsi_dh) {
415 printk(KERN_INFO "%s: device handler unregistered\n", scsi_dh->name);
439 struct scsi_device_handler *scsi_dh = NULL;
444 scsi_dh = sdev->scsi_dh_data->scsi_dh;
445 if (!scsi_dh || !get_device(&sdev->sdev_gendev))
452 if (scsi_dh->activate)
453 err = scsi_dh->activate(sdev, fn, data);
474 struct scsi_device_handler *scsi_dh = NULL;
479 scsi_dh = sdev->scsi_dh_data->scsi_dh;
480 if (scsi_dh && scsi_dh->set_params && get_device(&sdev->sdev_gendev))
486 err = scsi_dh->set_params(sdev, params);
512 struct scsi_device_handler *scsi_dh;
515 scsi_dh = get_device_handler(name);
516 if (!scsi_dh)
526 err = scsi_dh_handler_attach(sdev, scsi_dh);
545 struct scsi_device_handler *scsi_dh = NULL;
557 scsi_dh = sdev->scsi_dh_data->scsi_dh;
558 scsi_dh_handler_detach(sdev, scsi_dh);