/home/hillier_g/checkout/most4linux/most-kernel/most-sync.h File Reference

Declarations for the MOST Synchronous driver. More...

Go to the source code of this file.

Data Structures

struct  most_sync_dev
struct  most_sync_file

Defines

#define MOST_SYNC_IOCTL_MAGIC   'h'
#define MOST_SYNC_SETUP_RX   _IOW(MOST_SYNC_IOCTL_MAGIC, 0, struct frame_part)
#define MOST_SYNC_SETUP_TX   _IOW(MOST_SYNC_IOCTL_MAGIC, 1, struct frame_part)
#define MOST_SYNC_MAXIOCTL   1
#define MOST_SYNC_MINOR_OFFSET   8

Functions

ssize_t most_sync_read (struct file *filp, void *buff, size_t count, struct rtnrt_memcopy_desc *copy)
ssize_t most_sync_write (struct file *filp, void *buff, size_t count, struct rtnrt_memcopy_desc *copy)
int most_sync_setup_rx (struct file *filp, struct frame_part *frame_part)
int most_sync_setup_tx (struct file *filp, struct frame_part *frame_part)


Detailed Description

Declarations for the MOST Synchronous driver.

This header file can also be included in userspace. It contains the ioctl() definitions necessary to implement userspace programs.

Definition in file most-sync.h.


Define Documentation

#define MOST_SYNC_IOCTL_MAGIC   'h'

Magic number. Should be unique in the whole system to simplify debugging, but it is not a requirement.

Definition at line 53 of file most-sync.h.

Referenced by most_sync_do_ioctl().

#define MOST_SYNC_SETUP_RX   _IOW(MOST_SYNC_IOCTL_MAGIC, 0, struct frame_part)

Setup ioctl() call. Performs following tasks:

This stops ALL reception on this device. The function call make take some while because it has to wait until each other file has finished the current reading/writing system call.

The function does not allocate any synchronous channels nor does it modify the routing engine. This has to be done with MOST NetServices. The frame_part argument contains the frame part from the view of the MOST PCI card, i.e. it's not the position of the part in the MOST frame but of the routed frames. See the documentation of the routing engine of the OS 8104 for details or the example code which comes with this driver.

Returns 0 on success, a negative error value on failure.

Definition at line 75 of file most-sync.h.

Referenced by most_sync_do_ioctl().

#define MOST_SYNC_SETUP_TX   _IOW(MOST_SYNC_IOCTL_MAGIC, 1, struct frame_part)

Setup ioctl() call. Performs following tasks:

This stops ALL transmission on this device. The function call make take some while because it has to wait until each other file has finished the current reading/writing system call.

The function does not allocate any synchronous channels nor does it modify the routing engine. This has to be done with MOST NetServices. The frame_part argument contains the frame part from the view of the MOST PCI card, i.e. it's not the position of the part in the MOST frame but of the routed frames. See the documentation of the routing engine of the OS 8104 for details or the example code which comes with this driver.

Returns 0 on success, a negative error value on failure.

Definition at line 98 of file most-sync.h.

Referenced by most_sync_do_ioctl().

#define MOST_SYNC_MAXIOCTL   1

The maximum ioctl number. This value may change in future.

Definition at line 104 of file most-sync.h.

#define MOST_SYNC_MINOR_OFFSET   8

Offset for minor device numbers from zero.

Definition at line 116 of file most-sync.h.

Referenced by most_sync_probe().


Function Documentation

ssize_t most_sync_read ( struct file *  filp,
void *  buff,
size_t  count,
struct rtnrt_memcopy_desc copy 
)

Read implementation for a synchronous MOST device. Can be called from other kernel modules.

Parameters:
filp the file pointer of Linux, holds the private_data which is of type struct most_sync_file.
buff the userspace buffer that contains the destination
count the number of bytes allocated for buff
copy how the memory must be copied

Definition at line 497 of file most-sync-m.c.

References most_sync_dev::config_lock_rx, most_sync_file::part_rx, PR, pr_sync_debug, most_sync_file::reader_index, return_value_if_fails, rtnrt_err, most_sync_dev::rx_queue, most_sync_file::rx_running, rxbuf_get(), rxbuf_is_empty(), most_sync_dev::sw_receive_buf, and most_sync_file::sync_dev.

Referenced by most_sync_do_read(), and snd_most_capture_thread().

ssize_t most_sync_write ( struct file *  filp,
void *  buff,
size_t  count,
struct rtnrt_memcopy_desc copy 
)

Write implementation for a synchronous MOST device. Can be called from other kernel modules.

Parameters:
filp the file pointer of Linux, holds the private_data which is of type struct most_sync_file.
buff the userspace buffer that contains the destination
count the number of bytes allocated for buff
copy how the memory must be copied

Definition at line 570 of file most-sync-m.c.

References most_sync_dev::config_lock_tx, most_sync_file::part_tx, PR, pr_sync_debug, return_value_if_fails, rtnrt_err, most_sync_dev::sw_transmit_buf, most_sync_file::sync_dev, most_sync_dev::tx_queue, most_sync_file::tx_running, txbuf_is_full(), txbuf_put(), and most_sync_file::writer_index.

Referenced by most_sync_do_write(), and snd_most_playback_thread().

int most_sync_setup_rx ( struct file *  filp,
struct frame_part frame_part 
)

See documentation of MOST_SYNC_SETUP_RX. Can be called from other kernel modules.

Parameters:
filp the file pointer of Linux, holds the private_data which is of type struct most_sync_file.
frame_part the frame part for which the reader should be set up

Definition at line 699 of file most-sync-m.c.

References most_sync_dev::config_lock_rx, hw_rx_buffer_size, most_sync_setup_rx_common, most_sync_stop_rx(), most_sync_file::rx_running, sw_rx_buffer_size, and most_sync_file::sync_dev.

Referenced by most_sync_do_setup_rx(), and snd_most_capture_setup_sync_file().

int most_sync_setup_tx ( struct file *  filp,
struct frame_part frame_part 
)

See documentation of MOST_SYNC_SETUP_TX.

Parameters:
filp the file pointer of Linux, holds the private_data which is of type struct most_sync_file.
frame_part the frame part for which the writer should be set up

Definition at line 746 of file most-sync-m.c.

References most_sync_dev::config_lock_tx, hw_tx_buffer_size, most_sync_setup_tx_common, most_sync_stop_tx(), sw_tx_buffer_size, most_sync_file::sync_dev, and most_sync_file::tx_running.

Referenced by most_sync_do_setup_tx(), and snd_most_playback_setup_sync_file().


Generated on Fri Mar 9 14:48:58 2007 for MOST Linux Drivers (Linux and RTAI) by  doxygen 1.5.0