27#ifndef _nidas_usbtwod_h_
28#define _nidas_usbtwod_h_
115#define USB2D_IOC_MAGIC 0x2d
117#define USB2D_SET_TAS _IOW(USB2D_IOC_MAGIC,0,Tap2D)
118#define USB2D_SET_SOR_RATE _IOW(USB2D_IOC_MAGIC,1,int)
119#define USB2D_GET_STATUS _IOR(USB2D_IOC_MAGIC,2,struct usb_twod_stats)
127#define TWOD_IMG_TYPE 0
128#define TWOD_SOR_TYPE 1
129#define TWOD_SORv3_TYPE 0x534f522c
130#define TWOD_IMGv2_TYPE 2
131#define TWOD_IMGv3_TYPE 3
134#include <linux/module.h>
135#include <linux/spinlock.h>
136#include <linux/kref.h>
153#define USB_TWOD_64_V3_MINOR_BASE 192
154#define USB_TWOD_64_MINOR_BASE 192
155#define USB_TWOD_32_MINOR_BASE 196
157#define TWOD_IMG_BUFF_SIZE 4096
158#define TWOD_SOR_BUFF_SIZE 128
159#define TWOD_TAS_BUFF_SIZE 4
186#define SAMPLE_QUEUE_SIZE 32
192#define IMG_URB_QUEUE_SIZE 32
202#define IMG_URBS_IN_FLIGHT 20
213#define MAX_THROTTLE_FUNC_RATE 10
221#define MAX_THROTTLE_RATE (MAX_THROTTLE_FUNC_RATE * IMG_URBS_IN_FLIGHT)
223#define SOR_URBS_IN_FLIGHT 4
225#define TAS_URB_QUEUE_SIZE 4
227struct twod_urb_sample
236struct twod_house_urb_sample
248struct sample_circ_buf
250 struct twod_urb_sample **buf;
268 struct twod_urb_sample *pendingSample;
271enum twod_probe_type { TWOD_64_V3, TWOD_64, TWOD_32 };
276 struct usb_device *udev;
277 struct usb_interface *interface;
279 rwlock_t usb_iface_lock;
283 __u8 img_in_endpointAddr;
284 __u8 tas_out_endpointAddr;
285 __u8 sor_in_endpointAddr;
288 enum twod_probe_type ptype;
290 struct urb *img_urbs[IMG_URBS_IN_FLIGHT];
291 struct urb_circ_buf img_urb_q;
293 struct urb *sor_urbs[SOR_URBS_IN_FLIGHT];
295 struct sample_circ_buf sampleq;
296 spinlock_t sampqlock;
298 struct urb_circ_buf tas_urb_q;
300 wait_queue_head_t read_wait;
304 struct read_state readstate;
308 struct timer_list urbThrottle;
319 unsigned long lastWakeup;
321 struct timer_list sendTASTimer;
330 int SORdebugmessages;
Struct to adjust probe slice rate for true airspeed.
Definition usbtwod.h:73
unsigned char div10
boolean toggle for frequency divide by 10
Definition usbtwod.h:77
unsigned char ntap
which tap in the variable resistor (0-255)
Definition usbtwod.h:75
unsigned char dummy
Definition usbtwod.h:80
unsigned char cntr
counter from 1 to 10
Definition usbtwod.h:79
This version is for rev2 of Spowarts USB board.
Definition usbtwod.h:88
unsigned short ntap
which tap in the variable resistor (0-255)
Definition usbtwod.h:90
unsigned char cntr
counter from 1 to 10
Definition usbtwod.h:95
unsigned char div10
boolean toggle for frequency divide by 10
Definition usbtwod.h:92
unsigned short probeResolution
which probe resolution
Definition usbtwod.h:106
unsigned short tas
sending tas*10, ntap calculation happens on probe
Definition usbtwod.h:104
Statistics gathered by the PMS2D USB driver.
Definition usbtwod.h:50
unsigned int shutdowns
Definition usbtwod.h:59
unsigned int numSORs
Number of Shadow-ORs transfered from probe.
Definition usbtwod.h:55
unsigned int lostTASs
Definition usbtwod.h:57
unsigned int lostSORs
Definition usbtwod.h:56
unsigned int urbErrors
Definition usbtwod.h:58
unsigned int numImages
Number of 4K buffers transfered from probe.
Definition usbtwod.h:52
unsigned int urbTimeouts
Definition usbtwod.h:60
unsigned int lostImages
Definition usbtwod.h:53
unsigned int dsm_sample_length_t
length of data portion of sample.
Definition types.h:51
int dsm_sample_time_t
Depending on the module, either tenths of milliseconds, or milliseconds since 00:00 UTC today.
Definition types.h:48
struct _Tap2D_v1 Tap2Dv1
Struct to adjust probe slice rate for true airspeed.
struct _Tap2D_v3 Tap2D_v3
struct _Tap2D_v2 Tap2D
This version is for rev2 of Spowarts USB board.