Lines Matching refs:dev

356 static int fc_target_setup(struct transport_container *tc, struct device *dev,  in fc_target_setup()  argument
359 struct scsi_target *starget = to_scsi_target(dev); in fc_target_setup()
386 static int fc_host_setup(struct transport_container *tc, struct device *dev, in fc_host_setup() argument
389 struct Scsi_Host *shost = dev_to_shost(dev); in fc_host_setup()
468 static int fc_host_remove(struct transport_container *tc, struct device *dev, in fc_host_remove() argument
471 struct Scsi_Host *shost = dev_to_shost(dev); in fc_host_remove()
988 show_fc_rport_##field (struct device *dev, \
991 struct fc_rport *rport = transport_class_to_rport(dev); \
1004 store_fc_rport_##field(struct device *dev, \
1009 struct fc_rport *rport = transport_class_to_rport(dev); \
1044 show_fc_rport_##field (struct device *dev, \
1047 struct fc_rport *rport = transport_class_to_rport(dev); \
1064 show_fc_rport_##title (struct device *dev, \
1067 struct fc_rport *rport = transport_class_to_rport(dev); \
1118 show_fc_rport_supported_classes (struct device *dev, in show_fc_rport_supported_classes() argument
1121 struct fc_rport *rport = transport_class_to_rport(dev); in show_fc_rport_supported_classes()
1180 store_fc_rport_dev_loss_tmo(struct device *dev, struct device_attribute *attr, in store_fc_rport_dev_loss_tmo() argument
1183 struct fc_rport *rport = transport_class_to_rport(dev); in store_fc_rport_dev_loss_tmo()
1207 show_fc_rport_roles (struct device *dev, struct device_attribute *attr, in show_fc_rport_roles() argument
1210 struct fc_rport *rport = transport_class_to_rport(dev); in show_fc_rport_roles()
1239 static ssize_t fc_rport_set_marginal_state(struct device *dev, in fc_rport_set_marginal_state() argument
1243 struct fc_rport *rport = transport_class_to_rport(dev); in fc_rport_set_marginal_state()
1276 show_fc_rport_port_state(struct device *dev, in show_fc_rport_port_state() argument
1280 struct fc_rport *rport = transport_class_to_rport(dev); in show_fc_rport_port_state()
1298 show_fc_rport_fast_io_fail_tmo (struct device *dev, in show_fc_rport_fast_io_fail_tmo() argument
1301 struct fc_rport *rport = transport_class_to_rport(dev); in show_fc_rport_fast_io_fail_tmo()
1309 store_fc_rport_fast_io_fail_tmo(struct device *dev, in store_fc_rport_fast_io_fail_tmo() argument
1315 struct fc_rport *rport = transport_class_to_rport(dev); in store_fc_rport_fast_io_fail_tmo()
1416 show_fc_starget_##field (struct device *dev, \
1419 struct scsi_target *starget = transport_class_to_starget(dev); \
1420 struct Scsi_Host *shost = dev_to_shost(starget->dev.parent); \
1471 show_fc_vport_##field (struct device *dev, \
1474 struct fc_vport *vport = transport_class_to_vport(dev); \
1485 store_fc_vport_##field(struct device *dev, \
1490 struct fc_vport *vport = transport_class_to_vport(dev); \
1505 store_fc_vport_##field(struct device *dev, \
1509 struct fc_vport *vport = transport_class_to_vport(dev); \
1543 show_fc_vport_##field (struct device *dev, \
1546 struct fc_vport *vport = transport_class_to_vport(dev); \
1552 store_fc_vport_##field(struct device *dev, \
1557 struct fc_vport *vport = transport_class_to_vport(dev); \
1589 show_fc_vport_##title (struct device *dev, \
1593 struct fc_vport *vport = transport_class_to_vport(dev); \
1659 show_fc_vport_roles (struct device *dev, struct device_attribute *attr, in show_fc_vport_roles() argument
1662 struct fc_vport *vport = transport_class_to_vport(dev); in show_fc_vport_roles()
1679 store_fc_vport_delete(struct device *dev, struct device_attribute *attr, in store_fc_vport_delete() argument
1682 struct fc_vport *vport = transport_class_to_vport(dev); in store_fc_vport_delete()
1706 store_fc_vport_disable(struct device *dev, struct device_attribute *attr, in store_fc_vport_disable() argument
1710 struct fc_vport *vport = transport_class_to_vport(dev); in store_fc_vport_disable()
1740 show_fc_host_##field (struct device *dev, \
1743 struct Scsi_Host *shost = transport_class_to_shost(dev); \
1752 store_fc_host_##field(struct device *dev, \
1757 struct Scsi_Host *shost = transport_class_to_shost(dev); \
1770 store_fc_host_##field(struct device *dev, \
1774 struct Scsi_Host *shost = transport_class_to_shost(dev); \
1807 show_fc_host_##title (struct device *dev, \
1810 struct Scsi_Host *shost = transport_class_to_shost(dev); \
1850 show_fc_host_##field (struct device *dev, \
1853 struct Scsi_Host *shost = transport_class_to_shost(dev); \
1885 show_fc_host_supported_classes (struct device *dev, in show_fc_host_supported_classes() argument
1888 struct Scsi_Host *shost = transport_class_to_shost(dev); in show_fc_host_supported_classes()
1899 show_fc_host_supported_fc4s (struct device *dev, in show_fc_host_supported_fc4s() argument
1902 struct Scsi_Host *shost = transport_class_to_shost(dev); in show_fc_host_supported_fc4s()
1909 show_fc_host_supported_speeds (struct device *dev, in show_fc_host_supported_speeds() argument
1912 struct Scsi_Host *shost = transport_class_to_shost(dev); in show_fc_host_supported_speeds()
1942 show_fc_host_active_fc4s (struct device *dev, in show_fc_host_active_fc4s() argument
1945 struct Scsi_Host *shost = transport_class_to_shost(dev); in show_fc_host_active_fc4s()
1957 show_fc_host_speed (struct device *dev, in show_fc_host_speed() argument
1960 struct Scsi_Host *shost = transport_class_to_shost(dev); in show_fc_host_speed()
1991 show_fc_private_host_tgtid_bind_type(struct device *dev, in show_fc_private_host_tgtid_bind_type() argument
1994 struct Scsi_Host *shost = transport_class_to_shost(dev); in show_fc_private_host_tgtid_bind_type()
2007 store_fc_private_host_tgtid_bind_type(struct device *dev, in store_fc_private_host_tgtid_bind_type() argument
2010 struct Scsi_Host *shost = transport_class_to_shost(dev); in store_fc_private_host_tgtid_bind_type()
2040 store_fc_private_host_issue_lip(struct device *dev, in store_fc_private_host_issue_lip() argument
2043 struct Scsi_Host *shost = transport_class_to_shost(dev); in store_fc_private_host_issue_lip()
2060 store_fc_private_host_dev_loss_tmo(struct device *dev, in store_fc_private_host_dev_loss_tmo() argument
2064 struct Scsi_Host *shost = transport_class_to_shost(dev); in store_fc_private_host_dev_loss_tmo()
2095 fc_stat_show(const struct device *dev, char *buf, unsigned long offset) in fc_stat_show() argument
2097 struct Scsi_Host *shost = transport_class_to_shost(dev); in fc_stat_show()
2194 fc_reset_statistics(struct device *dev, struct device_attribute *attr, in fc_reset_statistics() argument
2197 struct Scsi_Host *shost = transport_class_to_shost(dev); in fc_reset_statistics()
2311 store_fc_host_vport_create(struct device *dev, struct device_attribute *attr, in store_fc_host_vport_create() argument
2314 struct Scsi_Host *shost = transport_class_to_shost(dev); in store_fc_host_vport_create()
2358 store_fc_host_vport_delete(struct device *dev, struct device_attribute *attr, in store_fc_host_vport_delete() argument
2361 struct Scsi_Host *shost = transport_class_to_shost(dev); in store_fc_host_vport_delete()
2411 struct device *dev) in fc_host_match() argument
2416 if (!scsi_is_host_device(dev)) in fc_host_match()
2419 shost = dev_to_shost(dev); in fc_host_match()
2430 struct device *dev) in fc_target_match() argument
2435 if (!scsi_is_target_device(dev)) in fc_target_match()
2438 shost = dev_to_shost(dev->parent); in fc_target_match()
2448 static void fc_rport_dev_release(struct device *dev) in fc_rport_dev_release() argument
2450 struct fc_rport *rport = dev_to_rport(dev); in fc_rport_dev_release()
2451 put_device(dev->parent); in fc_rport_dev_release()
2455 int scsi_is_fc_rport(const struct device *dev) in scsi_is_fc_rport() argument
2457 return dev->release == fc_rport_dev_release; in scsi_is_fc_rport()
2462 struct device *dev) in fc_rport_match() argument
2467 if (!scsi_is_fc_rport(dev)) in fc_rport_match()
2470 shost = dev_to_shost(dev->parent); in fc_rport_match()
2481 static void fc_vport_dev_release(struct device *dev) in fc_vport_dev_release() argument
2483 struct fc_vport *vport = dev_to_vport(dev); in fc_vport_dev_release()
2484 put_device(dev->parent); /* release kobj parent */ in fc_vport_dev_release()
2488 static int scsi_is_fc_vport(const struct device *dev) in scsi_is_fc_vport() argument
2490 return dev->release == fc_vport_dev_release; in scsi_is_fc_vport()
2494 struct device *dev) in fc_vport_match() argument
2500 if (!scsi_is_fc_vport(dev)) in fc_vport_match()
2502 vport = dev_to_vport(dev); in fc_vport_match()
2571 scsi_scan_target(&rport->dev, channel, id, lun, in fc_user_scan_tgt()
2943 scsi_target_unblock(&rport->dev, SDEV_TRANSPORT_OFFLINE); in fc_terminate_rport_io()
2959 scsi_remove_target(&rport->dev); in fc_starget_delete()
2972 struct device *dev = &rport->dev; in fc_rport_final_delete() local
3029 transport_remove_device(dev); in fc_rport_final_delete()
3030 device_del(dev); in fc_rport_final_delete()
3031 transport_destroy_device(dev); in fc_rport_final_delete()
3033 put_device(dev); /* for self-reference */ in fc_rport_final_delete()
3057 struct device *dev; in fc_remote_port_create() local
3101 dev = &rport->dev; in fc_remote_port_create()
3102 device_initialize(dev); /* takes self reference */ in fc_remote_port_create()
3103 dev->parent = get_device(&shost->shost_gendev); /* parent reference */ in fc_remote_port_create()
3104 dev->release = fc_rport_dev_release; in fc_remote_port_create()
3105 dev_set_name(dev, "rport-%d:%d-%d", in fc_remote_port_create()
3107 transport_setup_device(dev); in fc_remote_port_create()
3109 error = device_add(dev); in fc_remote_port_create()
3114 transport_add_device(dev); in fc_remote_port_create()
3115 transport_configure_device(dev); in fc_remote_port_create()
3129 transport_destroy_device(dev); in fc_remote_port_create()
3134 put_device(dev->parent); in fc_remote_port_create()
3277 scsi_target_unblock(&rport->dev, in fc_remote_port_add()
3454 scsi_block_targets(shost, &rport->dev); in fc_remote_port_delete()
3535 scsi_target_unblock(&rport->dev, SDEV_RUNNING); in fc_remote_port_rolechg()
3576 dev_printk(KERN_ERR, &rport->dev, in fc_timeout_deleted_rport()
3580 scsi_target_unblock(&rport->dev, SDEV_TRANSPORT_OFFLINE); in fc_timeout_deleted_rport()
3588 dev_printk(KERN_ERR, &rport->dev, in fc_timeout_deleted_rport()
3599 dev_printk(KERN_ERR, &rport->dev, in fc_timeout_deleted_rport()
3608 dev_printk(KERN_ERR, &rport->dev, in fc_timeout_deleted_rport()
3720 scsi_scan_target(&rport->dev, rport->channel, in fc_scsi_scan_rport()
3834 struct device *dev; in fc_vport_setup() local
3878 dev = &vport->dev; in fc_vport_setup()
3879 device_initialize(dev); /* takes self reference */ in fc_vport_setup()
3880 dev->parent = get_device(pdev); /* takes parent reference */ in fc_vport_setup()
3881 dev->release = fc_vport_dev_release; in fc_vport_setup()
3882 dev_set_name(dev, "vport-%d:%d-%d", in fc_vport_setup()
3884 transport_setup_device(dev); in fc_vport_setup()
3886 error = device_add(dev); in fc_vport_setup()
3891 transport_add_device(dev); in fc_vport_setup()
3892 transport_configure_device(dev); in fc_vport_setup()
3906 &dev->kobj, dev_name(dev)); in fc_vport_setup()
3911 __func__, dev_name(dev), error); in fc_vport_setup()
3918 "%s created via shost%d channel %d\n", dev_name(dev), in fc_vport_setup()
3926 transport_remove_device(dev); in fc_vport_setup()
3927 device_del(dev); in fc_vport_setup()
3929 transport_destroy_device(dev); in fc_vport_setup()
3935 put_device(dev->parent); in fc_vport_setup()
3980 struct device *dev = &vport->dev; in fc_vport_terminate() local
4002 if (dev->parent != &shost->shost_gendev) in fc_vport_terminate()
4003 sysfs_remove_link(&shost->shost_gendev.kobj, dev_name(dev)); in fc_vport_terminate()
4004 transport_remove_device(dev); in fc_vport_terminate()
4005 device_del(dev); in fc_vport_terminate()
4006 transport_destroy_device(dev); in fc_vport_terminate()
4013 put_device(dev); /* for self-reference */ in fc_vport_terminate()
4032 dev_printk(KERN_ERR, vport->dev.parent, in fc_vport_sched_delete()
4035 dev_name(&vport->dev), vport->shost->host_no, in fc_vport_sched_delete()
4231 if (scsi_is_fc_rport(job->dev)) in fc_bsg_dispatch()
4277 struct device *dev = &shost->shost_gendev; in fc_bsg_hostadd() local
4290 q = bsg_setup_queue(dev, bsg_name, fc_bsg_dispatch, fc_bsg_job_timeout, in fc_bsg_hostadd()
4293 dev_err(dev, in fc_bsg_hostadd()
4312 struct device *dev = &rport->dev; in fc_bsg_rportadd() local
4321 q = bsg_setup_queue(dev, dev_name(dev), fc_bsg_dispatch_prep, in fc_bsg_rportadd()
4324 dev_err(dev, "failed to setup bsg queue\n"); in fc_bsg_rportadd()