include/block/device.h File Reference

Block Device interface. More...

#include <buffer.h>
#include <slist.h>
#include <types.h>
#include <status_codes.h>

Go to the source code of this file.

Data Structures

struct  block_request
 A block device request. More...
struct  block_device
 A block device. More...

Typedefs

typedef uint32_t block_addr_t
 Type for holding a logical block address (LBA).
typedef uint32_t block_len_t
 Type for holding a block length (i.e. number of blocks).

Enumerations

enum  block_device_flag { BDEV_UNIT_ATTENTION, BDEV_PRESENT, BDEV_WRITEABLE }
 

Flags representing the state of a block device.

More...
enum  block_operation { BLK_OP_READ, BLK_OP_WRITE }
 

Block device operation codes.

More...

Functions

static uint16_t blkdev_get_block_size (struct block_device *bdev)
 Return the block size of bdev.
static void blkdev_set_block_size (struct block_device *bdev, uint16_t block_size)
 Set the block size of bdev.
struct block_requestblock_alloc_request (struct block_device *bdev)
 Allocate a block request.
void block_free_request (struct block_device *bdev, struct block_request *req)
 Free a block request previously allocated using block_alloc_request().
static void block_prepare_req (struct block_device *bdev, struct block_request *req, block_addr_t lba, block_len_t nr_blocks, enum block_operation operation)
 Prepare a block request.
static void block_submit_req (struct block_device *bdev, struct block_request *req)
 Submit a request for I/O.
static int block_submit_buf_list (struct block_device *bdev, struct block_request *breq, struct slist *buf_list)
 Submit a list of buffers for an already-queued request.
static block_len_t blk_req_get_blocks_xfered (struct block_device *bdev, struct block_request *breq)
 Get the number of blocks actually transfered for a request.
static block_len_t blk_req_get_bytes_xfered (struct block_device *bdev, struct block_request *breq)
 Get the number of bytes actually transfered for a request.
static void blk_req_add_buffer (struct block_request *req, struct buffer *buf)
 Associate the buffer buf with the block request req.
static void blk_req_add_buffer_list (struct block_request *req, struct slist *list)
 Associated the list of buffers list with the block request req.

Detailed Description

Block Device interface.

Copyright (C) 2009 Atmel Corporation. All rights reserved.

Definition in file device.h.

Generated on Thu Apr 29 14:09:58 2010 for display-demo by  doxygen 1.6.3