Introduction   Client Library API Reference   IDL Interface   File List   Index  

blk.h File Reference

DROPS Block Device Driver Interface, client API. More...

Go to the source code of this file.

Functions

L4_CV void l4blk_init (void)
 Setup block device driver client library.

Initialize the client library, this function must be called before any of the other functions is called.

L4_CV int l4blk_open_driver (const char *name, l4blk_driver_t *driver, l4blk_setup_notify_callback_fn_t cb)
 Open block device driver.
L4_CV int l4blk_close_driver (l4blk_driver_t driver)
 Close block device driver.
L4_CV l4_threadid_t l4blk_get_driver_thread (l4blk_driver_t driver)
 Return thread id of command thread.
L4_CV int l4blk_create_stream (l4blk_driver_t driver, l4_uint32_t device, l4_uint32_t bandwidth, l4_uint32_t period, l4_uint32_t blk_size, float q, l4_uint32_t meta_int, l4blk_stream_t *stream)
 Create real-time stream.
L4_CV int l4blk_close_stream (l4blk_driver_t driver, l4blk_stream_t stream)
 Close real-time stream.
L4_CV int l4blk_start_stream (l4blk_driver_t driver, l4blk_stream_t stream, l4_uint32_t time, l4_uint32_t request_no)
 Set start time of real-time stream.
L4_CV int l4blk_do_request (l4blk_request_t *request)
 Execute request (synchronously).
L4_CV int l4blk_put_request (l4blk_request_t *request)
 Send request to driver.
L4_CV int l4blk_get_status (l4blk_request_t *request)
 Check status of a request.
L4_CV int l4blk_get_error (l4blk_request_t *request)
 Return driver error code.
L4_CV int l4blk_ctrl (l4blk_driver_t driver, l4_uint32_t cmd, void *in, int in_size, void *out, int out_size)
 Generic driver control.
L4_CV int l4blk_ctrl_get_num_disks (l4blk_driver_t driver)
 Return number of disks.
L4_CV int l4blk_ctrl_get_disk_size (l4blk_driver_t driver, l4_uint32_t dev)
 Return disk size.
L4_CV int l4blk_ctrl_get_stream_period (l4blk_driver_t driver, l4blk_stream_t stream, l4_uint32_t *period_len, l4_uint32_t *period_offs)
 Return period for stream requests.


Detailed Description

DROPS Block Device Driver Interface, client API.

Date:
02/09/2001
Author:
Lars Reuther <reuther@os.inf.tu-dresden.de>

Definition in file blk.h.


Function Documentation

L4_CV int l4blk_open_driver ( const char *  name,
l4blk_driver_t driver,
l4blk_setup_notify_callback_fn_t  cb 
)

Open block device driver.

Parameters:
name Driver name
Return values:
driver Driver handle
Parameters:
cb Notification thread setup callback function, if set it will be called by created notification thread before it enters its work loop
Returns:
0 on success (driver contains a valid handle), error code otherwise:
  • -L4_EINVAL invalid name
  • -L4_ENOTFOUND driver not found
  • -L4_ENOMEM out of memory allocating driver descriptor
  • -L4_EIPC error calling driver
  • -L4_ENOTHREAD creation of notification thread failed
l4blk_open_driver does two things:
  • request the id of the driver at the DROPS nameserver using name
  • call the driver to open new instances of the command and wait threads


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