![Jonathan Cameron](/assets/img/avatar_default.png)
Issue brought up by Lars-Peter Clausen. This is a varient of what he suggested. io/iio.h for driver stuff (has to include types.h) Sub files for the bits drivers may or may not use iio/sysfs.h iio/buffer.h (contents of current buffer_generic.h) (obviously anything offering events will need events.h as well) iio/types.h for the enums that matter to both iio_chan_type, iio_modifier iio/events.h for the event code stuff IIO_EVENT_CODE and friends. + everything in chrdev.h So this is the stuff that userspace cares about. Also include iio_event_type, iio_event_direction Thus iio drivers include iio.h + as required events.h sysfs.h buffer.h in kernel users (once that interface is merged) will need inkern.h which will pull in types.h Userspace will need just events.h (which pulls in types.h) to get everything they need to know about. Buffer userspace access doesn't currently need any core defines. All information about the data format is passed through sysfs. Signed-off-by: Jonathan Cameron <jic23@cam.ac.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
36 lines
1.4 KiB
C
36 lines
1.4 KiB
C
/* The industrial I/O simple minimally locked ring buffer.
|
|
*
|
|
* Copyright (c) 2008 Jonathan Cameron
|
|
*
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
* under the terms of the GNU General Public License version 2 as published by
|
|
* the Free Software Foundation.
|
|
*
|
|
* This code is deliberately kept separate from the main industrialio I/O core
|
|
* as it is intended that in the future a number of different software ring
|
|
* buffer implementations will exist with different characteristics to suit
|
|
* different applications.
|
|
*
|
|
* This particular one was designed for a data capture application where it was
|
|
* particularly important that no userspace reads would interrupt the capture
|
|
* process. To this end the ring is not locked during a read.
|
|
*
|
|
* Comments on this buffer design welcomed. It's far from efficient and some of
|
|
* my understanding of the effects of scheduling on this are somewhat limited.
|
|
* Frankly, to my mind, this is the current weak point in the industrial I/O
|
|
* patch set.
|
|
*/
|
|
|
|
#ifndef _IIO_RING_SW_H_
|
|
#define _IIO_RING_SW_H_
|
|
#include "buffer.h"
|
|
|
|
/**
|
|
* ring_sw_access_funcs - access functions for a software ring buffer
|
|
**/
|
|
extern const struct iio_buffer_access_funcs ring_sw_access_funcs;
|
|
|
|
struct iio_buffer *iio_sw_rb_allocate(struct iio_dev *indio_dev);
|
|
void iio_sw_rb_free(struct iio_buffer *ring);
|
|
#endif /* _IIO_RING_SW_H_ */
|