mirror of
https://github.com/ipxe/ipxe
synced 2025-12-12 23:15:10 +03:00
[block] Add generic block device translator
Add a generic mechanism for providing block devices on top of a data transfer interface (such as HTTP). Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
38
src/include/ipxe/blocktrans.h
Normal file
38
src/include/ipxe/blocktrans.h
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef _IPXE_BLOCKTRANS_H
|
||||
#define _IPXE_BLOCKTRANS_H
|
||||
|
||||
/** @file
|
||||
*
|
||||
* Block device translator
|
||||
*
|
||||
*/
|
||||
|
||||
FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
|
||||
#include <stdint.h>
|
||||
#include <ipxe/refcnt.h>
|
||||
#include <ipxe/interface.h>
|
||||
#include <ipxe/xferbuf.h>
|
||||
#include <ipxe/uaccess.h>
|
||||
|
||||
/** A block device translator */
|
||||
struct block_translator {
|
||||
/** Reference count */
|
||||
struct refcnt refcnt;
|
||||
/** Block device interface */
|
||||
struct interface block;
|
||||
/** Data transfer interface */
|
||||
struct interface xfer;
|
||||
|
||||
/** Data transfer buffer */
|
||||
struct xfer_buffer xferbuf;
|
||||
/** Data buffer */
|
||||
userptr_t buffer;
|
||||
/** Block size */
|
||||
size_t blksize;
|
||||
};
|
||||
|
||||
extern int block_translate ( struct interface *block,
|
||||
userptr_t buffer, size_t size );
|
||||
|
||||
#endif /* _IPXE_BLOCKTRANS_H */
|
||||
@@ -69,6 +69,7 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
|
||||
#define ERRFILE_ansicol ( ERRFILE_CORE | 0x001d0000 )
|
||||
#define ERRFILE_ansicoldef ( ERRFILE_CORE | 0x001e0000 )
|
||||
#define ERRFILE_fault ( ERRFILE_CORE | 0x001f0000 )
|
||||
#define ERRFILE_blocktrans ( ERRFILE_CORE | 0x00200000 )
|
||||
|
||||
#define ERRFILE_eisa ( ERRFILE_DRIVER | 0x00000000 )
|
||||
#define ERRFILE_isa ( ERRFILE_DRIVER | 0x00010000 )
|
||||
|
||||
Reference in New Issue
Block a user