27 #ifndef _nidas_usbtwod_h_
28 #define _nidas_usbtwod_h_
36 #include <sys/ioctl.h>
37 #include <sys/types.h>
112 #define USB2D_IOC_MAGIC 0x2d
114 #define USB2D_SET_TAS _IOW(USB2D_IOC_MAGIC,0,Tap2D)
115 #define USB2D_SET_SOR_RATE _IOW(USB2D_IOC_MAGIC,1,int)
116 #define USB2D_GET_STATUS _IOR(USB2D_IOC_MAGIC,2,struct usb_twod_stats)
124 #define TWOD_IMG_TYPE 0
125 #define TWOD_SOR_TYPE 1
126 #define TWOD_SORv3_TYPE 0x534f522c
127 #define TWOD_IMGv2_TYPE 2
128 #define TWOD_IMGv3_TYPE 3
131 #include <linux/module.h>
132 #include <linux/spinlock.h>
133 #include <linux/kref.h>
150 #define USB_TWOD_64_V3_MINOR_BASE 192
151 #define USB_TWOD_64_MINOR_BASE 192
152 #define USB_TWOD_32_MINOR_BASE 196
154 #define TWOD_IMG_BUFF_SIZE 4096
155 #define TWOD_SOR_BUFF_SIZE 128
156 #define TWOD_TAS_BUFF_SIZE 4
176 #define SAMPLE_QUEUE_SIZE 32
179 #define IMG_URB_QUEUE_SIZE 16
181 #define IMG_URBS_IN_FLIGHT (IMG_URB_QUEUE_SIZE-1)
183 #define SOR_URBS_IN_FLIGHT 4
185 #define TAS_URB_QUEUE_SIZE 4
196 #define THROTTLE_JIFFIES (HZ / 10)
198 struct twod_urb_sample
207 struct twod_house_urb_sample
219 struct sample_circ_buf
221 struct twod_urb_sample **buf;
239 struct twod_urb_sample *pendingSample;
242 enum twod_probe_type { TWOD_64_V3, TWOD_64, TWOD_32 };
247 struct usb_device *udev;
248 struct usb_interface *interface;
250 rwlock_t usb_iface_lock;
254 __u8 img_in_endpointAddr;
255 __u8 tas_out_endpointAddr;
256 __u8 sor_in_endpointAddr;
259 enum twod_probe_type ptype;
261 struct urb *img_urbs[IMG_URBS_IN_FLIGHT];
262 struct urb_circ_buf img_urb_q;
264 struct urb *sor_urbs[SOR_URBS_IN_FLIGHT];
266 struct sample_circ_buf sampleq;
267 spinlock_t sampqlock;
269 struct urb_circ_buf tas_urb_q;
271 wait_queue_head_t read_wait;
275 struct read_state readstate;
279 struct timer_list urbThrottle;
290 unsigned long lastWakeup;
292 struct timer_list sendTASTimer;
301 #endif // ifdef __KERNEL__
unsigned char ntap
which tap in the variable resistor (0-255)
Definition: usbtwod.h:72
struct _Tap2D_v1 Tap2Dv1
Struct to adjust probe slice rate for true airspeed.
struct _Tap2D_v2 Tap2D
This version is for rev2 of Spowarts USB board.
unsigned short probeResolution
which probe resolution
Definition: usbtwod.h:103
Struct to adjust probe slice rate for true airspeed.
Definition: usbtwod.h:69
unsigned short ntap
which tap in the variable resistor (0-255)
Definition: usbtwod.h:87
unsigned char cntr
counter from 1 to 10
Definition: usbtwod.h:92
unsigned int numSORs
Number of Shadow-ORs transfered from probe.
Definition: usbtwod.h:53
unsigned int lostTASs
Definition: usbtwod.h:55
unsigned char div10
boolean toggle for frequency divide by 10
Definition: usbtwod.h:74
unsigned char dummy
Definition: usbtwod.h:77
This version is for rev2 of Spowarts USB board.
Definition: usbtwod.h:84
unsigned int lostSORs
Definition: usbtwod.h:54
int dsm_sample_time_t
Depending on the module, either tenths of milliseconds, or milliseconds since 00:00 UTC today...
Definition: types.h:48
unsigned int urbErrors
Definition: usbtwod.h:56
unsigned int lostImages
Definition: usbtwod.h:51
unsigned int urbTimeouts
Definition: usbtwod.h:57
struct _Tap2D_v3 Tap2D_v3
unsigned short tas
sending tas*10, ntap calculation happens on probe
Definition: usbtwod.h:101
unsigned char div10
boolean toggle for frequency divide by 10
Definition: usbtwod.h:89
unsigned int numImages
Number of 4K buffers transfered from probe.
Definition: usbtwod.h:50
unsigned int dsm_sample_length_t
length of data portion of sample.
Definition: types.h:51
unsigned char cntr
counter from 1 to 10
Definition: usbtwod.h:76
Statistics gathered by the PMS2D USB driver.
Definition: usbtwod.h:47