Introduction   Client Library API Reference   IDL Interface   File List   Index  

types.h

Go to the documentation of this file.
00001 /* $Id: types.h 31603 2008-05-12 06:54:17Z adam $ */
00002 /*****************************************************************************/
00010 /*****************************************************************************/
00011 #ifndef _GENERIC_BLK_TYPES_H
00012 #define _GENERIC_BLK_TYPES_H
00013 
00014 /* L4 includes */
00015 #include <l4/sys/types.h>
00016 #include <l4/semaphore/semaphore.h>
00017 #include <l4/dm_generic/types.h>
00018 
00019 /*****************************************************************************
00020  *** Types
00021  *****************************************************************************/
00022 
00028 typedef l4_uint32_t l4blk_driver_id_t;
00029 
00034 typedef l4_uint32_t l4blk_driver_t;
00035 
00040 typedef L4_CV void (* l4blk_setup_notify_callback_fn_t) (void);
00041 
00046 typedef l4_uint32_t l4blk_stream_t;
00047 
00052 typedef struct l4blk_request l4blk_request_t;
00053 
00062 typedef L4_CV void (* l4blk_callback_fn_t) (l4blk_request_t * request, 
00063                                             int status, 
00064                                             int error);
00065 
00070 typedef struct l4blk_sg_phys_elem
00071 {
00072   l4_addr_t addr;                  
00073   l4_size_t size;                  
00074 } l4blk_sg_phys_elem_t;
00075 
00080 typedef struct l4blk_sg_ds_elem
00081 {
00082   l4dm_dataspace_t ds;             
00083   l4_offs_t        offs;           
00084   l4_size_t        size;           
00085 } l4blk_sg_ds_elem_t;
00086 
00092 typedef struct l4blk_blk_request
00093 {
00094   l4_uint32_t         req_handle;  
00099   l4_uint32_t         cmd;         
00103   l4_uint32_t         device;      
00104   l4_uint32_t         block;       
00105   l4_uint32_t         count;       
00106 
00107   /* real-time requests */
00108   l4blk_stream_t      stream;      
00112   l4_uint32_t         req_no;      
00113   l4_uint32_t         flags;       
00116 } l4blk_blk_request_t;
00117 
00123 struct l4blk_request
00124 {
00125   l4blk_driver_t      driver;      
00126  
00127   l4blk_blk_request_t request;     
00128 
00129   /* buffer scatter-gather list */
00130   void *              sg_list;     
00140   int                 sg_num;      
00141   int                 sg_type;     
00146   /* client request handling */
00147   l4_uint32_t         status;      
00148   int                 error;       
00149   l4semaphore_t *     wait;        
00150   l4blk_callback_fn_t done;        
00151 
00152   /* client data */
00153   void *              data;        
00154 };
00155 
00156 /* request commands */
00157 #define L4BLK_REQUEST_READ      0x00000001  
00160 #define L4BLK_REQUEST_WRITE     0x00000002  
00164 /* block size in bytes */
00165 #define L4BLK_BLKSIZE           1024        
00166 
00167 /* request flags */
00168 #define L4BLK_REQUEST_METADATA  0x00000001  
00172 /* scatter-gather list types */
00173 #define L4BLK_SG_PHYS           0x00000001  
00178 #define L4BLK_SG_DS             0x00000002  
00183 /* request status */
00184 #define L4BLK_UNPROCESSED       0x00000000  
00187 #define L4BLK_DONE              0x00000001  
00190 #define L4BLK_ERROR             0x00000002  
00193 #define L4BLK_SKIPPED           0x00000003  
00197 /* misc. */
00198 #define L4BLK_INVALID_DRIVER    (-1)        
00199 #define L4BLK_INVALID_STREAM    (-1)        
00203 /* dafault ctrls */
00204 #define L4BLK_CTRL_NUM_DISKS     0x00000001 
00207 #define L4BLK_CTRL_DISK_SIZE     0x00000002 
00210 #define L4BLK_CTRL_DISK_GEOM     0x00000003 
00213 #define L4BLK_CTRL_RREAD_PART    0x00000004 
00216 #define L4BLK_CTRL_MAX_SG_LEN    0x00000005 
00220 #define L4BLK_CTRL_STREAM_PERIOD 0x00000006 
00224 /* ctrls needed by L4Linux stub */
00225 #define L4BLK_CTRL_DRV_IRQ       0x00008000 
00233 typedef struct l4blk_disk_geometry
00234 {
00235   l4_uint32_t heads;               
00236   l4_uint32_t cylinders;           
00237   l4_uint32_t sectors;             
00238   l4_uint32_t start;               
00241 } l4blk_disk_geometry_t;
00242 
00247 typedef struct l4blk_disk_period
00248 {
00249   l4_uint32_t period_len;          
00250   l4_uint32_t period_offs;         
00251 } l4blk_disk_period_t;
00252 
00253 #endif /* !_GENERIC_BLK_TYPES_H */

Generic Block Interface Reference Manual, written by Lars Reuther  © 2000-2003