
Add RealyFS framework wrappers support to transfer large amount of data between kernel space and user space. Change-Id: Ic88848b003a2fc2c216b74a185f6bd46d5ddd1cd CRs-Fixed: 2327607
114 linhas
3.4 KiB
C
114 linhas
3.4 KiB
C
/*
|
|
* Copyright (c) 2018 The Linux Foundation. All rights reserved.
|
|
*
|
|
* Permission to use, copy, modify, and/or distribute this software for
|
|
* any purpose with or without fee is hereby granted, provided that the
|
|
* above copyright notice and this permission notice appear in all
|
|
* copies.
|
|
*
|
|
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
|
|
* WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
|
|
* WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
|
|
* AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL
|
|
* DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
|
|
* PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
|
|
* TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
* PERFORMANCE OF THIS SOFTWARE.
|
|
*/
|
|
|
|
/**
|
|
* DOC: qal_streamfs
|
|
* Qualcomm abstraction layer (QAL) stream file system APIs
|
|
*/
|
|
|
|
#if !defined(__QAL_STREAMFS_H)
|
|
#define _QAL_STREAMFS_H
|
|
|
|
/* Include Files */
|
|
#include <qdf_types.h>
|
|
|
|
struct qal_streamfs_chan;
|
|
struct qal_dentry_t;
|
|
struct qal_streamfs_chan_callbacks;
|
|
struct qal_streamfs_chan_buf;
|
|
|
|
/**
|
|
* qal_streamfs_open() - Create streamfs channel for data trasfer
|
|
* @base_filename: base name of files to create, %NULL for buffering only
|
|
* @parent: dentry of parent directory, %NULL for root directory
|
|
* @subbuf_size: size of sub-buffers
|
|
* @n_subbufs: number of sub-buffers
|
|
* @cb: streamfs channel callback functions
|
|
* @private_data: user-defined data
|
|
*
|
|
* Returns channel pointer if successful, %NULL otherwise.
|
|
*/
|
|
struct qal_streamfs_chan *
|
|
qal_streamfs_open(const char *base_filename,
|
|
struct qal_dentry_t *parent,
|
|
size_t subbuf_size, size_t n_subbufs,
|
|
struct qal_streamfs_chan_callbacks *cb,
|
|
void *private_data);
|
|
|
|
/**
|
|
* qal_streamfs_close() - Closes all channel buffers and frees the channel.
|
|
* @chan: pointer to qal_streamfs_chan.
|
|
*
|
|
* Returns NONE
|
|
*/
|
|
void qal_streamfs_close(struct qal_streamfs_chan *chan);
|
|
|
|
/**
|
|
* qal_streamfs_flush() - Flushes all channel buffers.
|
|
* @chan: pointer to qal_streamfs_chan.
|
|
*
|
|
* Returns NONE
|
|
*/
|
|
void qal_streamfs_flush(struct qal_streamfs_chan *chan);
|
|
|
|
/**
|
|
* qal_streamfs_reset - reset streamfs channel
|
|
* This erases data from all channel buffers and restarting the channel
|
|
* in its initial state.
|
|
* The buffers are not freed, so any mappings are still in effect.
|
|
* @chan: pointer to qal_streamfs_chan.
|
|
*
|
|
* Returns NONE
|
|
*/
|
|
void qal_streamfs_reset(struct qal_streamfs_chan *chan);
|
|
|
|
/**
|
|
* qal_streamfs_subbufs_consumed - update the buffer's sub-buffers-consumed
|
|
* count
|
|
* @chan: pointer to qal_streamfs_chan.
|
|
* @cpu: the cpu associated with the channel buffer to update
|
|
* @subbufs_consumed: number of sub-buffers to add to current buf's count
|
|
*
|
|
* Returns NONE
|
|
*/
|
|
void qal_streamfs_subbufs_consumed(struct qal_streamfs_chan *chan,
|
|
unsigned int cpu,
|
|
size_t consumed);
|
|
|
|
/**
|
|
* qal_streamfs_write - write data into the channel
|
|
* @chan: relay channel
|
|
* @data: data to be written
|
|
* @length: number of bytes to write
|
|
*
|
|
* Writes data into the current cpu's channel buffer.
|
|
*/
|
|
inline void qal_streamfs_write(struct qal_streamfs_chan *chan,
|
|
const void *data,
|
|
size_t length);
|
|
|
|
/**
|
|
* qal_streamfs_buf_full - boolean, is the channel buffer full?
|
|
* @buf: channel buffer
|
|
*
|
|
* Returns 1 if the buffer is full, 0 otherwise.
|
|
*/
|
|
int qal_streamfs_buf_full(struct qal_streamfs_chan_buf *buf);
|
|
|
|
#endif
|