forked from ni/usb3vision
-
Notifications
You must be signed in to change notification settings - Fork 0
/
u3v_control.h
68 lines (57 loc) · 2.32 KB
/
u3v_control.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/*
* u3v_control.h: Driver for USB3 Vision(TM) class devices
*
* (C) Copyright 2014 National Instruments Corp.
* Authors: Katie Ensign <[email protected]>,
* Jared Jenson <[email protected]>
*
* The "USB3 Vision" name and logo are trademarks of the AIA and may not
* be used without the authorization of the AIA <www.visiononline.org>
*
* Anyone wishing to develop, manufacture, or sell private labeled
* compliant product for commercial purposes or to develop compliant
* software for distribution must obtain a license to use the USB3
* Vision standard and the USB3 Vision name and logo from the AIA.
* All products (including software) must be registered with the AIA and
* must be tested for compliancy with the standard.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2
* of the License, or (at your option) any later version.
*
* 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, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef _U3V_CONTROL_H_
#define _U3V_CONTROL_H_
#include <linux/mutex.h>
/* Structs */
struct u3v_control {
struct u3v_device *u3v_dev;
struct mutex read_write_lock;
u8 *ack_buffer;
u32 max_ack_transfer_size;
u8 *cmd_buffer;
u32 max_cmd_transfer_size;
u16 request_id;
u32 u3v_timeout; /* Maximum device response time in ms */
};
/* Functions */
int u3v_create_control(struct u3v_device *u3v);
int u3v_read_memory(struct u3v_control *ctrl, __u32 transfer_size,
__u32 *bytes_read, __u64 address, void *kernel_buffer,
void *user_buffer);
int u3v_write_memory(struct u3v_control *ctrl, __u32 transfer_size,
__u32 *bytes_written, __u64 address, const void *kernel_buffer,
const void *user_buffer);
int u3v_control_msg(struct usb_device *udev, __u8 request, __u8 requesttype,
__u16 value, __u16 index, void *data, __u16 size);
void u3v_destroy_control(struct u3v_device *u3v);
#endif