iPXE
blockdev.h
Go to the documentation of this file.
1#ifndef _IPXE_BLOCKDEV_H
2#define _IPXE_BLOCKDEV_H
3
4/**
5 * @file
6 *
7 * Block devices
8 *
9 */
10
11FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
12FILE_SECBOOT ( PERMITTED );
13
14#include <stdint.h>
15#include <ipxe/interface.h>
16
17/** Block device capacity */
19 /** Total number of blocks */
21 /** Block size */
22 size_t blksize;
23 /** Maximum number of blocks per single transfer */
24 unsigned int max_count;
25};
26
27extern int block_read ( struct interface *control, struct interface *data,
28 uint64_t lba, unsigned int count, void *buffer,
29 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 void *buffer, size_t len ) )
34
35extern int block_write ( struct interface *control, struct interface *data,
36 uint64_t lba, unsigned int count, void *buffer,
37 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 void *buffer, size_t len ) )
42
43extern 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 ) )
47
48extern 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 ) )
53
54
55#endif /* _IPXE_BLOCKDEV_H */
unsigned long long uint64_t
Definition stdint.h:13
int block_read_capacity(struct interface *control, struct interface *data)
Read block device capacity.
Definition blockdev.c:106
int block_write(struct interface *control, struct interface *data, uint64_t lba, unsigned int count, void *buffer, size_t len)
Write to block device.
Definition blockdev.c:79
int block_read(struct interface *control, struct interface *data, uint64_t lba, unsigned int count, void *buffer, size_t len)
Read from block device.
Definition blockdev.c:48
void block_capacity(struct interface *intf, struct block_device_capacity *capacity)
Report block device capacity.
Definition blockdev.c:130
ring len
Length.
Definition dwmac.h:226
uint8_t data[48]
Additional event data.
Definition ena.h:11
static unsigned int count
Number of entries.
Definition dwmac.h:220
uint32_t buffer
Buffer index (or NETVSC_RNDIS_NO_BUFFER)
Definition netvsc.h:5
uint64_t lba
Starting block number.
Definition int13.h:11
#define FILE_LICENCE(_licence)
Declare a particular licence as applying to a file.
Definition compiler.h:896
#define FILE_SECBOOT(_status)
Declare a file's UEFI Secure Boot permission status.
Definition compiler.h:926
Object interfaces.
uint32_t control
Control.
Definition myson.h:3
Block device capacity.
Definition blockdev.h:18
uint64_t blocks
Total number of blocks.
Definition blockdev.h:20
unsigned int max_count
Maximum number of blocks per single transfer.
Definition blockdev.h:24
size_t blksize
Block size.
Definition blockdev.h:22
An object interface.
Definition interface.h:125