113 * than the block size, then this will automatically be
114 * satisfied.
115 */
116 uint64_t m_nblks;
117 uint32_t m_blksize;
118 boolean_t m_readonly;
119 };
120
121 #define BD_INFO_FLAG_REMOVABLE (1U << 0)
122 #define BD_INFO_FLAG_HOTPLUGGABLE (1U << 1)
123 #define BD_INFO_FLAG_READ_ONLY (1U << 2)
124
125 struct bd_ops {
126 int o_version;
127 void (*o_drive_info)(void *, bd_drive_t *);
128 int (*o_media_info)(void *, bd_media_t *);
129 int (*o_devid_init)(void *, dev_info_t *, ddi_devid_t *);
130 int (*o_sync_cache)(void *, bd_xfer_t *);
131 int (*o_read)(void *, bd_xfer_t *);
132 int (*o_write)(void *, bd_xfer_t *);
133 };
134
135 #define BD_OPS_VERSION_0 0
136
137 /*
138 * Note, one handler *per* address. Drivers with multiple targets at
139 * different addresses must use separate handles.
140 */
141 bd_handle_t bd_alloc_handle(void *, bd_ops_t *, ddi_dma_attr_t *, int);
142 void bd_free_handle(bd_handle_t);
143 int bd_attach_handle(dev_info_t *, bd_handle_t);
144 int bd_detach_handle(bd_handle_t);
145 void bd_state_change(bd_handle_t);
146 void bd_xfer_done(bd_xfer_t *, int);
147 void bd_mod_init(struct dev_ops *);
148 void bd_mod_fini(struct dev_ops *);
149
150 #ifdef __cplusplus
151 }
152 #endif
153
154 #endif /* _SYS_BLKDEV_H */
|
113 * than the block size, then this will automatically be
114 * satisfied.
115 */
116 uint64_t m_nblks;
117 uint32_t m_blksize;
118 boolean_t m_readonly;
119 };
120
121 #define BD_INFO_FLAG_REMOVABLE (1U << 0)
122 #define BD_INFO_FLAG_HOTPLUGGABLE (1U << 1)
123 #define BD_INFO_FLAG_READ_ONLY (1U << 2)
124
125 struct bd_ops {
126 int o_version;
127 void (*o_drive_info)(void *, bd_drive_t *);
128 int (*o_media_info)(void *, bd_media_t *);
129 int (*o_devid_init)(void *, dev_info_t *, ddi_devid_t *);
130 int (*o_sync_cache)(void *, bd_xfer_t *);
131 int (*o_read)(void *, bd_xfer_t *);
132 int (*o_write)(void *, bd_xfer_t *);
133 int (*o_ioctl)(dev_t, int, intptr_t, int, cred_t *, int *);
134 };
135
136 #define BD_OPS_VERSION_0 0
137 #define BD_OPS_VERSION_1 1
138 #define BD_OPS_VERSION 1 /* Should be latest! */
139
140 /*
141 * Note, one handler *per* address. Drivers with multiple targets at
142 * different addresses must use separate handles.
143 */
144 bd_handle_t bd_alloc_handle(void *, bd_ops_t *, ddi_dma_attr_t *, int);
145 void bd_free_handle(bd_handle_t);
146 int bd_attach_handle(dev_info_t *, bd_handle_t);
147 int bd_detach_handle(bd_handle_t);
148 void bd_state_change(bd_handle_t);
149 void bd_xfer_done(bd_xfer_t *, int);
150 void bd_mod_init(struct dev_ops *);
151 void bd_mod_fini(struct dev_ops *);
152
153 #ifdef __cplusplus
154 }
155 #endif
156
157 #endif /* _SYS_BLKDEV_H */
|