aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/scsi/osd_initiator.h38
1 files changed, 34 insertions, 4 deletions
diff --git a/include/scsi/osd_initiator.h b/include/scsi/osd_initiator.h
index 589e5f0d67b1..3ec346e15dda 100644
--- a/include/scsi/osd_initiator.h
+++ b/include/scsi/osd_initiator.h
@@ -55,10 +55,24 @@ struct osd_dev {
55#endif 55#endif
56}; 56};
57 57
58/* Retrieve/return osd_dev(s) for use by Kernel clients */ 58/* Unique Identification of an OSD device */
59struct osd_dev *osduld_path_lookup(const char *dev_name); /*Use IS_ERR/ERR_PTR*/ 59struct osd_dev_info {
60 unsigned systemid_len;
61 u8 systemid[OSD_SYSTEMID_LEN];
62 unsigned osdname_len;
63 u8 *osdname;
64};
65
66/* Retrieve/return osd_dev(s) for use by Kernel clients
67 * Use IS_ERR/ERR_PTR on returned "osd_dev *".
68 */
69struct osd_dev *osduld_path_lookup(const char *dev_name);
70struct osd_dev *osduld_info_lookup(const struct osd_dev_info *odi);
60void osduld_put_device(struct osd_dev *od); 71void osduld_put_device(struct osd_dev *od);
61 72
73const struct osd_dev_info *osduld_device_info(struct osd_dev *od);
74bool osduld_device_same(struct osd_dev *od, const struct osd_dev_info *odi);
75
62/* Add/remove test ioctls from external modules */ 76/* Add/remove test ioctls from external modules */
63typedef int (do_test_fn)(struct osd_dev *od, unsigned cmd, unsigned long arg); 77typedef int (do_test_fn)(struct osd_dev *od, unsigned cmd, unsigned long arg);
64int osduld_register_test(unsigned ioctl, do_test_fn *do_test); 78int osduld_register_test(unsigned ioctl, do_test_fn *do_test);
@@ -68,8 +82,24 @@ void osduld_unregister_test(unsigned ioctl);
68void osd_dev_init(struct osd_dev *od, struct scsi_device *scsi_device); 82void osd_dev_init(struct osd_dev *od, struct scsi_device *scsi_device);
69void osd_dev_fini(struct osd_dev *od); 83void osd_dev_fini(struct osd_dev *od);
70 84
71/* some hi level device operations */ 85/**
72int osd_auto_detect_ver(struct osd_dev *od, void *caps); /* GFP_KERNEL */ 86 * osd_auto_detect_ver - Detect the OSD version, return Unique Identification
87 *
88 * @od: OSD target lun handle
89 * @caps: Capabilities authorizing OSD root read attributes access
90 * @odi: Retrieved information uniquely identifying the osd target lun
91 * Note: odi->osdname must be kfreed by caller.
92 *
93 * Auto detects the OSD version of the OSD target and sets the @od
94 * accordingly. Meanwhile also returns the "system id" and "osd name" root
95 * attributes which uniquely identify the OSD target. This member is usually
96 * called by the ULD. ULD users should call osduld_device_info().
97 * This rutine allocates osd requests and memory at GFP_KERNEL level and might
98 * sleep.
99 */
100int osd_auto_detect_ver(struct osd_dev *od,
101 void *caps, struct osd_dev_info *odi);
102
73static inline struct request_queue *osd_request_queue(struct osd_dev *od) 103static inline struct request_queue *osd_request_queue(struct osd_dev *od)
74{ 104{
75 return od->scsi_device->request_queue; 105 return od->scsi_device->request_queue;