forked from patjak/facetimehd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
fthd_ringbuf.h
54 lines (46 loc) · 1.81 KB
/
fthd_ringbuf.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
* Broadcom PCIe 1570 webcam driver
*
* Copyright (C) 2015 Sven Schnelle <[email protected]>
*
* 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 program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software Foundation.
*
*/
#ifndef _FTHD_RINGBUF_H
#define _FTHD_RINGBUF_H
#define FTHD_RINGBUF_ENTRY_SIZE 64
#define FTHD_RINGBUF_ADDRESS_FLAGS 0
#define FTHD_RINGBUF_REQUEST_SIZE 4
#define FTHD_RINGBUF_RESPONSE_SIZE 8
enum ringbuf_type_t {
RINGBUF_TYPE_H2T=0,
RINGBUF_TYPE_T2H=1,
RINGBUF_TYPE_UNIDIRECTIONAL,
};
struct fthd_ringbuf {
void *doorbell;
int idx;
};
struct fw_channel;
struct fthd_private;
extern void fthd_channel_ringbuf_dump(struct fthd_private *dev_priv, struct fw_channel *chan);
extern void fthd_channel_ringbuf_init(struct fthd_private *dev_priv, struct fw_channel *chan);
extern u32 fthd_channel_ringbuf_get_entry(struct fthd_private *, struct fw_channel *);
extern int fthd_channel_ringbuf_send(struct fthd_private *dev_priv, struct fw_channel *chan,
u32 data_offset, u32 request_size, u32 response_size, u32 *entry);
extern u32 fthd_channel_ringbuf_receive(struct fthd_private *dev_priv,
struct fw_channel *chan);
extern int fthd_channel_wait_ready(struct fthd_private *dev_priv, struct fw_channel *chan, u32 entry, int timeout);
extern u32 get_entry_addr(struct fthd_private *dev_priv,
struct fw_channel *chan, int num);
#endif