1 #ifndef _IPXE_BLOCKDEV_H
2 #define _IPXE_BLOCKDEV_H
11 FILE_LICENCE ( GPL2_OR_LATER );
14 #include <ipxe/uaccess.h>
15 #include <ipxe/interface.h>
17 /** Block device capacity */
18 struct block_device_capacity {
19 /** Total number of blocks */
23 /** Maximum number of blocks per single transfer */
24 unsigned int max_count;
27 extern int block_read ( struct interface *control, struct interface *data,
28 uint64_t lba, unsigned int count,
29 userptr_t buffer, size_t len );
30 #define block_read_TYPE( object_type ) \
31 typeof ( int ( object_type, struct interface *data, \
32 uint64_t lba, unsigned int count, \
33 userptr_t buffer, size_t len ) )
35 extern int block_write ( struct interface *control, struct interface *data,
36 uint64_t lba, unsigned int count,
37 userptr_t buffer, size_t len );
38 #define block_write_TYPE( object_type ) \
39 typeof ( int ( object_type, struct interface *data, \
40 uint64_t lba, unsigned int count, \
41 userptr_t buffer, size_t len ) )
43 extern int block_read_capacity ( struct interface *control,
44 struct interface *data );
45 #define block_read_capacity_TYPE( object_type ) \
46 typeof ( int ( object_type, struct interface *data ) )
48 extern void block_capacity ( struct interface *intf,
49 struct block_device_capacity *capacity );
50 #define block_capacity_TYPE( object_type ) \
51 typeof ( void ( object_type, \
52 struct block_device_capacity *capacity ) )
55 #endif /* _IPXE_BLOCKDEV_H */