Lines Matching refs:dev
64 &(_session)->dev, \
75 &(_conn)->dev, \
83 struct device dev; member
109 container_of(_dev, struct iscsi_internal, dev)
111 static void iscsi_transport_release(struct device *dev) in iscsi_transport_release() argument
113 struct iscsi_internal *priv = dev_to_iscsi_internal(dev); in iscsi_transport_release()
127 show_transport_handle(struct device *dev, struct device_attribute *attr, in show_transport_handle() argument
130 struct iscsi_internal *priv = dev_to_iscsi_internal(dev); in show_transport_handle()
141 show_transport_##name(struct device *dev, \
144 struct iscsi_internal *priv = dev_to_iscsi_internal(dev); \
165 container_of(_dev, struct iscsi_endpoint, dev)
171 static void iscsi_endpoint_release(struct device *dev) in iscsi_endpoint_release() argument
173 struct iscsi_endpoint *ep = iscsi_dev_to_endpoint(dev); in iscsi_endpoint_release()
188 show_ep_handle(struct device *dev, struct device_attribute *attr, char *buf) in show_ep_handle() argument
190 struct iscsi_endpoint *ep = iscsi_dev_to_endpoint(dev); in show_ep_handle()
230 ep->dev.class = &iscsi_endpoint_class; in iscsi_create_endpoint()
231 dev_set_name(&ep->dev, "ep-%d", id); in iscsi_create_endpoint()
232 err = device_register(&ep->dev); in iscsi_create_endpoint()
236 err = sysfs_create_group(&ep->dev.kobj, &iscsi_endpoint_group); in iscsi_create_endpoint()
245 device_unregister(&ep->dev); in iscsi_create_endpoint()
252 put_device(&ep->dev); in iscsi_create_endpoint()
262 sysfs_remove_group(&ep->dev.kobj, &iscsi_endpoint_group); in iscsi_destroy_endpoint()
263 device_unregister(&ep->dev); in iscsi_destroy_endpoint()
269 put_device(&ep->dev); in iscsi_put_endpoint()
288 get_device(&ep->dev); in iscsi_lookup_endpoint()
299 static void iscsi_iface_release(struct device *dev) in iscsi_iface_release() argument
301 struct iscsi_iface *iface = iscsi_dev_to_iface(dev); in iscsi_iface_release()
302 struct device *parent = iface->dev.parent; in iscsi_iface_release()
321 show_##type##_##name(struct device *dev, struct device_attribute *attr, \
324 struct iscsi_iface *iface = iscsi_dev_to_iface(dev); \
444 struct device *dev = container_of(kobj, struct device, kobj); in iscsi_iface_attr_is_visible() local
445 struct iscsi_iface *iface = iscsi_dev_to_iface(dev); in iscsi_iface_attr_is_visible()
758 iface->dev.release = iscsi_iface_release; in iscsi_create_iface()
759 iface->dev.class = &iscsi_iface_class; in iscsi_create_iface()
761 iface->dev.parent = get_device(&shost->shost_gendev); in iscsi_create_iface()
763 dev_set_name(&iface->dev, "ipv4-iface-%u-%u", shost->host_no, in iscsi_create_iface()
766 dev_set_name(&iface->dev, "ipv6-iface-%u-%u", shost->host_no, in iscsi_create_iface()
769 err = device_register(&iface->dev); in iscsi_create_iface()
773 err = sysfs_create_group(&iface->dev.kobj, &iscsi_iface_group); in iscsi_create_iface()
782 device_unregister(&iface->dev); in iscsi_create_iface()
786 put_device(&iface->dev); in iscsi_create_iface()
793 sysfs_remove_group(&iface->dev.kobj, &iscsi_iface_group); in iscsi_destroy_iface()
794 device_unregister(&iface->dev); in iscsi_destroy_iface()
809 show_##type##_##name(struct device *dev, struct device_attribute *attr, \
813 iscsi_dev_to_flash_session(dev);\
911 struct device *dev = container_of(kobj, struct device, kobj); in iscsi_flashnode_sess_attr_is_visible() local
913 iscsi_dev_to_flash_session(dev); in iscsi_flashnode_sess_attr_is_visible()
1001 static void iscsi_flashnode_sess_release(struct device *dev) in iscsi_flashnode_sess_release() argument
1004 iscsi_dev_to_flash_session(dev); in iscsi_flashnode_sess_release()
1021 show_##type##_##name(struct device *dev, struct device_attribute *attr, \
1024 struct iscsi_bus_flash_conn *fnode_conn = iscsi_dev_to_flash_conn(dev);\
1113 struct device *dev = container_of(kobj, struct device, kobj); in iscsi_flashnode_conn_attr_is_visible() local
1114 struct iscsi_bus_flash_conn *fnode_conn = iscsi_dev_to_flash_conn(dev); in iscsi_flashnode_conn_attr_is_visible()
1188 static void iscsi_flashnode_conn_release(struct device *dev) in iscsi_flashnode_conn_release() argument
1190 struct iscsi_bus_flash_conn *fnode_conn = iscsi_dev_to_flash_conn(dev); in iscsi_flashnode_conn_release()
1206 int iscsi_flashnode_bus_match(struct device *dev, in iscsi_flashnode_bus_match() argument
1209 if (dev->bus == &iscsi_flashnode_bus) in iscsi_flashnode_bus_match()
1247 fnode_sess->dev.type = &iscsi_flashnode_sess_dev_type; in iscsi_create_flashnode_sess()
1248 fnode_sess->dev.bus = &iscsi_flashnode_bus; in iscsi_create_flashnode_sess()
1249 fnode_sess->dev.parent = &shost->shost_gendev; in iscsi_create_flashnode_sess()
1250 dev_set_name(&fnode_sess->dev, "flashnode_sess-%u:%u", in iscsi_create_flashnode_sess()
1253 err = device_register(&fnode_sess->dev); in iscsi_create_flashnode_sess()
1263 put_device(&fnode_sess->dev); in iscsi_create_flashnode_sess()
1295 fnode_conn->dev.type = &iscsi_flashnode_conn_dev_type; in iscsi_create_flashnode_conn()
1296 fnode_conn->dev.bus = &iscsi_flashnode_bus; in iscsi_create_flashnode_conn()
1297 fnode_conn->dev.parent = &fnode_sess->dev; in iscsi_create_flashnode_conn()
1298 dev_set_name(&fnode_conn->dev, "flashnode_conn-%u:%u:0", in iscsi_create_flashnode_conn()
1301 err = device_register(&fnode_conn->dev); in iscsi_create_flashnode_conn()
1311 put_device(&fnode_conn->dev); in iscsi_create_flashnode_conn()
1327 static int iscsi_is_flashnode_conn_dev(struct device *dev, void *data) in iscsi_is_flashnode_conn_dev() argument
1329 return dev->bus == &iscsi_flashnode_bus; in iscsi_is_flashnode_conn_dev()
1334 device_unregister(&fnode_conn->dev); in iscsi_destroy_flashnode_conn()
1338 static int flashnode_match_index(struct device *dev, void *data) in flashnode_match_index() argument
1343 if (!iscsi_flashnode_bus_match(dev, NULL)) in flashnode_match_index()
1346 fnode_sess = iscsi_dev_to_flash_session(dev); in flashnode_match_index()
1368 struct device *dev; in iscsi_get_flashnode_by_index() local
1370 dev = device_find_child(&shost->shost_gendev, &idx, in iscsi_get_flashnode_by_index()
1372 if (dev) in iscsi_get_flashnode_by_index()
1373 fnode_sess = iscsi_dev_to_flash_session(dev); in iscsi_get_flashnode_by_index()
1393 int (*fn)(struct device *dev, void *data)) in iscsi_find_flashnode_sess() argument
1413 return device_find_child(&fnode_sess->dev, NULL, in iscsi_find_flashnode_conn()
1418 static int iscsi_iter_destroy_flashnode_conn_fn(struct device *dev, void *data) in iscsi_iter_destroy_flashnode_conn_fn() argument
1420 if (!iscsi_is_flashnode_conn_dev(dev, NULL)) in iscsi_iter_destroy_flashnode_conn_fn()
1423 return iscsi_destroy_flashnode_conn(iscsi_dev_to_flash_conn(dev)); in iscsi_iter_destroy_flashnode_conn_fn()
1437 err = device_for_each_child(&fnode_sess->dev, NULL, in iscsi_destroy_flashnode_sess()
1441 fnode_sess->dev.kobj.name, err); in iscsi_destroy_flashnode_sess()
1443 device_unregister(&fnode_sess->dev); in iscsi_destroy_flashnode_sess()
1447 static int iscsi_iter_destroy_flashnode_fn(struct device *dev, void *data) in iscsi_iter_destroy_flashnode_fn() argument
1449 if (!iscsi_flashnode_bus_match(dev, NULL)) in iscsi_iter_destroy_flashnode_fn()
1452 iscsi_destroy_flashnode_sess(iscsi_dev_to_flash_session(dev)); in iscsi_iter_destroy_flashnode_fn()
1536 struct device *dev = &shost->shost_gendev; in iscsi_bsg_host_add() local
1545 q = bsg_setup_queue(dev, bsg_name, iscsi_bsg_host_dispatch, NULL, 0); in iscsi_bsg_host_add()
1557 static int iscsi_setup_host(struct transport_container *tc, struct device *dev, in iscsi_setup_host() argument
1560 struct Scsi_Host *shost = dev_to_shost(dev); in iscsi_setup_host()
1573 struct device *dev, struct device *cdev) in iscsi_remove_host() argument
1575 struct Scsi_Host *shost = dev_to_shost(dev); in iscsi_remove_host()
1611 struct iscsi_cls_session *sess = iscsi_dev_to_session(conn->dev.parent); in iscsi_conn_get_sid()
1722 static void iscsi_session_release(struct device *dev) in iscsi_session_release() argument
1724 struct iscsi_cls_session *session = iscsi_dev_to_session(dev); in iscsi_session_release()
1733 int iscsi_is_session_dev(const struct device *dev) in iscsi_is_session_dev() argument
1735 return dev->release == iscsi_session_release; in iscsi_is_session_dev()
1739 static int iscsi_iter_session_fn(struct device *dev, void *data) in iscsi_iter_session_fn() argument
1743 if (!iscsi_is_session_dev(dev)) in iscsi_iter_session_fn()
1745 fn(iscsi_dev_to_session(dev)); in iscsi_iter_session_fn()
1764 static int iscsi_user_scan_session(struct device *dev, void *data) in iscsi_user_scan_session() argument
1773 if (!iscsi_is_session_dev(dev)) in iscsi_user_scan_session()
1776 session = iscsi_dev_to_session(dev); in iscsi_user_scan_session()
1797 scsi_scan_target(&session->dev, 0, id, in iscsi_user_scan_session()
1836 iscsi_user_scan_session(&session->dev, &scan_data); in iscsi_scan_session()
1895 scsi_target_unblock(&session->dev, SDEV_TRANSPORT_OFFLINE); in session_recovery_timedout()
1916 scsi_target_unblock(&session->dev, SDEV_RUNNING); in __iscsi_unblock_session()
1953 scsi_block_targets(shost, &session->dev); in __iscsi_block_session()
2000 scsi_remove_target(&session->dev); in __iscsi_unbind_session()
2048 session->dev.parent = &shost->shost_gendev; in iscsi_alloc_session()
2049 session->dev.release = iscsi_session_release; in iscsi_alloc_session()
2050 device_initialize(&session->dev); in iscsi_alloc_session()
2091 dev_set_name(&session->dev, "session%u", session->sid); in iscsi_add_session()
2092 err = device_add(&session->dev); in iscsi_add_session()
2098 err = transport_register_device(&session->dev); in iscsi_add_session()
2114 device_del(&session->dev); in iscsi_add_session()
2151 static void iscsi_conn_release(struct device *dev) in iscsi_conn_release() argument
2153 struct iscsi_cls_conn *conn = iscsi_dev_to_conn(dev); in iscsi_conn_release()
2154 struct device *parent = conn->dev.parent; in iscsi_conn_release()
2161 static int iscsi_is_conn_dev(const struct device *dev) in iscsi_is_conn_dev() argument
2163 return dev->release == iscsi_conn_release; in iscsi_is_conn_dev()
2166 static int iscsi_iter_destroy_conn_fn(struct device *dev, void *data) in iscsi_iter_destroy_conn_fn() argument
2168 if (!iscsi_is_conn_dev(dev)) in iscsi_iter_destroy_conn_fn()
2171 iscsi_remove_conn(iscsi_dev_to_conn(dev)); in iscsi_iter_destroy_conn_fn()
2200 scsi_target_unblock(&session->dev, SDEV_TRANSPORT_OFFLINE); in iscsi_remove_session()
2211 err = device_for_each_child(&session->dev, NULL, in iscsi_remove_session()
2218 transport_unregister_device(&session->dev); in iscsi_remove_session()
2223 device_del(&session->dev); in iscsi_remove_session()
2350 get_device(&conn->ep->dev); in iscsi_cleanup_conn_work_fn()
2368 static int iscsi_iter_force_destroy_conn_fn(struct device *dev, void *data) in iscsi_iter_force_destroy_conn_fn() argument
2373 if (!iscsi_is_conn_dev(dev)) in iscsi_iter_force_destroy_conn_fn()
2376 conn = iscsi_dev_to_conn(dev); in iscsi_iter_force_destroy_conn_fn()
2411 device_for_each_child(&session->dev, NULL, in iscsi_force_destroy_session()
2421 put_device(&session->dev); in iscsi_free_session()
2452 if (!get_device(&session->dev)) in iscsi_alloc_conn()
2455 dev_set_name(&conn->dev, "connection%d:%u", session->sid, cid); in iscsi_alloc_conn()
2456 device_initialize(&conn->dev); in iscsi_alloc_conn()
2457 conn->dev.parent = &session->dev; in iscsi_alloc_conn()
2458 conn->dev.release = iscsi_conn_release; in iscsi_alloc_conn()
2479 struct iscsi_cls_session *session = iscsi_dev_to_session(conn->dev.parent); in iscsi_add_conn()
2481 err = device_add(&conn->dev); in iscsi_add_conn()
2487 err = transport_register_device(&conn->dev); in iscsi_add_conn()
2491 device_del(&conn->dev); in iscsi_add_conn()
2518 transport_unregister_device(&conn->dev); in iscsi_remove_conn()
2519 device_del(&conn->dev); in iscsi_remove_conn()
2525 put_device(&conn->dev); in iscsi_put_conn()
2531 get_device(&conn->dev); in iscsi_get_conn()
3461 struct device *dev; in iscsi_set_flashnode_param() local
3487 dev = iscsi_find_flashnode_conn(fnode_sess); in iscsi_set_flashnode_param()
3488 if (!dev) { in iscsi_set_flashnode_param()
3493 fnode_conn = iscsi_dev_to_flash_conn(dev); in iscsi_set_flashnode_param()
3495 put_device(dev); in iscsi_set_flashnode_param()
3498 put_device(&fnode_sess->dev); in iscsi_set_flashnode_param()
3573 put_device(&fnode_sess->dev); in iscsi_del_flashnode()
3588 struct device *dev; in iscsi_login_flashnode() local
3614 dev = iscsi_find_flashnode_conn(fnode_sess); in iscsi_login_flashnode()
3615 if (!dev) { in iscsi_login_flashnode()
3620 fnode_conn = iscsi_dev_to_flash_conn(dev); in iscsi_login_flashnode()
3622 put_device(dev); in iscsi_login_flashnode()
3625 put_device(&fnode_sess->dev); in iscsi_login_flashnode()
3640 struct device *dev; in iscsi_logout_flashnode() local
3666 dev = iscsi_find_flashnode_conn(fnode_sess); in iscsi_logout_flashnode()
3667 if (!dev) { in iscsi_logout_flashnode()
3672 fnode_conn = iscsi_dev_to_flash_conn(dev); in iscsi_logout_flashnode()
3675 put_device(dev); in iscsi_logout_flashnode()
3678 put_device(&fnode_sess->dev); in iscsi_logout_flashnode()
4136 show_conn_param_##param(struct device *dev, \
4139 struct iscsi_cls_conn *conn = iscsi_dev_to_conn(dev->parent); \
4185 static ssize_t show_conn_state(struct device *dev, in show_conn_state() argument
4188 struct iscsi_cls_conn *conn = iscsi_dev_to_conn(dev->parent); in show_conn_state()
4202 static ssize_t show_conn_ep_param_##param(struct device *dev, \
4206 struct iscsi_cls_conn *conn = iscsi_dev_to_conn(dev->parent); \
4361 show_session_param_##param(struct device *dev, \
4365 iscsi_dev_to_session(dev->parent); \
4420 show_priv_session_target_state(struct device *dev, struct device_attribute *attr, in show_priv_session_target_state() argument
4423 struct iscsi_cls_session *session = iscsi_dev_to_session(dev->parent); in show_priv_session_target_state()
4433 show_priv_session_state(struct device *dev, struct device_attribute *attr, in show_priv_session_state() argument
4436 struct iscsi_cls_session *session = iscsi_dev_to_session(dev->parent); in show_priv_session_state()
4442 show_priv_session_creator(struct device *dev, struct device_attribute *attr, in show_priv_session_creator() argument
4445 struct iscsi_cls_session *session = iscsi_dev_to_session(dev->parent); in show_priv_session_creator()
4451 show_priv_session_target_id(struct device *dev, struct device_attribute *attr, in show_priv_session_target_id() argument
4454 struct iscsi_cls_session *session = iscsi_dev_to_session(dev->parent); in show_priv_session_target_id()
4462 show_priv_session_##field(struct device *dev, \
4466 iscsi_dev_to_session(dev->parent); \
4474 store_priv_session_##field(struct device *dev, \
4481 iscsi_dev_to_session(dev->parent); \
4672 show_host_param_##param(struct device *dev, \
4675 struct Scsi_Host *shost = transport_class_to_shost(dev); \
4793 struct device *dev) in iscsi_session_match() argument
4799 if (!iscsi_is_session_dev(dev)) in iscsi_session_match()
4802 session = iscsi_dev_to_session(dev); in iscsi_session_match()
4815 struct device *dev) in iscsi_conn_match() argument
4822 if (!iscsi_is_conn_dev(dev)) in iscsi_conn_match()
4825 conn = iscsi_dev_to_conn(dev); in iscsi_conn_match()
4826 session = iscsi_dev_to_session(conn->dev.parent); in iscsi_conn_match()
4840 struct device *dev) in iscsi_host_match() argument
4845 if (!scsi_is_host_device(dev)) in iscsi_host_match()
4848 shost = dev_to_shost(dev); in iscsi_host_match()
4878 priv->dev.class = &iscsi_transport_class; in iscsi_register_transport()
4879 dev_set_name(&priv->dev, "%s", tt->name); in iscsi_register_transport()
4880 err = device_register(&priv->dev); in iscsi_register_transport()
4884 err = sysfs_create_group(&priv->dev.kobj, &iscsi_transport_group); in iscsi_register_transport()
4915 device_unregister(&priv->dev); in iscsi_register_transport()
4918 put_device(&priv->dev); in iscsi_register_transport()
4943 sysfs_remove_group(&priv->dev.kobj, &iscsi_transport_group); in iscsi_unregister_transport()
4944 device_unregister(&priv->dev); in iscsi_unregister_transport()
4949 void iscsi_dbg_trace(void (*trace)(struct device *dev, struct va_format *), in iscsi_dbg_trace() argument
4950 struct device *dev, const char *fmt, ...) in iscsi_dbg_trace()
4958 trace(dev, &vaf); in iscsi_dbg_trace()