| 1 |
/* |
| 2 |
|
| 3 |
Copyright (c) 2005 Finger Lakes Instrumentation (FLI), L.L.C. |
| 4 |
All rights reserved. |
| 5 |
|
| 6 |
Redistribution and use in source and binary forms, with or without |
| 7 |
modification, are permitted provided that the following conditions |
| 8 |
are met: |
| 9 |
|
| 10 |
Redistributions of source code must retain the above copyright |
| 11 |
notice, this list of conditions and the following disclaimer. |
| 12 |
|
| 13 |
Redistributions in binary form must reproduce the above |
| 14 |
copyright notice, this list of conditions and the following |
| 15 |
disclaimer in the documentation and/or other materials |
| 16 |
provided with the distribution. |
| 17 |
|
| 18 |
Neither the name of Finger Lakes Instrumentation (FLI), L.L.C. |
| 19 |
nor the names of its contributors may be used to endorse or |
| 20 |
promote products derived from this software without specific |
| 21 |
prior written permission. |
| 22 |
|
| 23 |
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 24 |
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 25 |
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| 26 |
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
| 27 |
REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| 28 |
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| 29 |
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| 30 |
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| 31 |
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| 32 |
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
| 33 |
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| 34 |
POSSIBILITY OF SUCH DAMAGE. |
| 35 |
|
| 36 |
====================================================================== |
| 37 |
|
| 38 |
Finger Lakes Instrumentation, L.L.C. (FLI) |
| 39 |
web: http://www.fli-cam.com |
| 40 |
email: [email protected] |
| 41 |
|
| 42 |
*/ |
| 43 |
|
| 44 |
#ifndef _FLIUSB_IOCTL_H_ |
| 45 |
#define _FLIUSB_IOCTL_H_ |
| 46 |
|
| 47 |
#include <linux/ioctl.h> |
| 48 |
|
| 49 |
/* Structure to describe string descriptor transfers */ |
| 50 |
typedef struct { |
| 51 |
unsigned int index; |
| 52 |
unsigned char buf[64]; |
| 53 |
} fliusb_string_descriptor_t; |
| 54 |
|
| 55 |
/* Structure to describe bulk transfers */ |
| 56 |
typedef struct { |
| 57 |
u_int8_t ep; |
| 58 |
void *buf; |
| 59 |
size_t count; |
| 60 |
unsigned int timeout; /* in msec */ |
| 61 |
} fliusb_bulktransfer_t; |
| 62 |
|
| 63 |
/* 8-bit special value to identify ioctl 'type' */ |
| 64 |
#define FLIUSB_IOC_TYPE 0xf1 |
| 65 |
|
| 66 |
/* Recognized ioctl commands */ |
| 67 |
#define FLIUSB_GETRDEPADDR _IOR(FLIUSB_IOC_TYPE, 1, u_int8_t) |
| 68 |
#define FLIUSB_SETRDEPADDR _IOW(FLIUSB_IOC_TYPE, 2, u_int8_t) |
| 69 |
|
| 70 |
#define FLIUSB_GETWREPADDR _IOR(FLIUSB_IOC_TYPE, 3, u_int8_t) |
| 71 |
#define FLIUSB_SETWREPADDR _IOW(FLIUSB_IOC_TYPE, 4, u_int8_t) |
| 72 |
|
| 73 |
#define FLIUSB_GETBUFFERSIZE _IOR(FLIUSB_IOC_TYPE, 5, size_t) |
| 74 |
#define FLIUSB_SETBUFFERSIZE _IOW(FLIUSB_IOC_TYPE, 6, size_t) |
| 75 |
|
| 76 |
#define FLIUSB_GETTIMEOUT _IOR(FLIUSB_IOC_TYPE, 7, unsigned int) |
| 77 |
#define FLIUSB_SETTIMEOUT _IOW(FLIUSB_IOC_TYPE, 8, unsigned int) |
| 78 |
|
| 79 |
#define FLIUSB_BULKREAD _IOW(FLIUSB_IOC_TYPE, 9, fliusb_bulktransfer_t) |
| 80 |
#define FLIUSB_BULKWRITE _IOW(FLIUSB_IOC_TYPE, 10, fliusb_bulktransfer_t) |
| 81 |
|
| 82 |
#define FLIUSB_GET_DEVICE_DESCRIPTOR _IOR(FLIUSB_IOC_TYPE, 11, struct usb_device_descriptor) |
| 83 |
#define FLIUSB_GET_STRING_DESCRIPTOR _IOR(FLIUSB_IOC_TYPE, 12, struct usb_device_descriptor) |
| 84 |
|
| 85 |
#define FLIUSB_IOC_MAX 12 |
| 86 |
|
| 87 |
#endif /* _FLIUSB_IOCTL_H_ */ |