Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F151986065
D30853.id91187.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D30853.id91187.diff
View Options
Index: sys/cam/cam_xpt.h
===================================================================
--- sys/cam/cam_xpt.h
+++ sys/cam/cam_xpt.h
@@ -113,6 +113,7 @@
lun_id_t xpt_path_lun_id(struct cam_path *path);
struct cam_sim *xpt_path_sim(struct cam_path *path);
struct cam_periph *xpt_path_periph(struct cam_path *path);
+device_t xpt_path_device(const struct cam_path *path);
void xpt_print_path(struct cam_path *path);
void xpt_print_device(struct cam_ed *device);
void xpt_print(struct cam_path *path, const char *fmt, ...);
Index: sys/cam/cam_xpt.c
===================================================================
--- sys/cam/cam_xpt.c
+++ sys/cam/cam_xpt.c
@@ -5574,6 +5574,22 @@
}
}
+/**
+ * @brief Return the device_t associated with the path
+ *
+ * When a SIM is created, it registers a bus with a NEWBUS device_t. This is
+ * stored in the internal cam_eb bus structure. There is no guarnatee any given
+ * path will have a @c device_t associated with it (it's legal to call @c
+ * xpt_bus_register with a @c NULL @c device_t.
+ *
+ * @param path Path to return the device_t for.
+ */
+device_t
+xpt_path_device(const struct cam_path *path)
+{
+ return (path->bus->parent_dev);
+}
+
struct kv
{
uint32_t v;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Apr 12, 10:54 PM (13 h, 33 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31377828
Default Alt Text
D30853.id91187.diff (1 KB)
Attached To
Mode
D30853: cam: add xpt_path_device to return device_t associated with a path
Attached
Detach File
Event Timeline
Log In to Comment