19 #define EXAMPLES_USE_BENCHMARK_CONFIGURE 1
23 #define EXAMPLE_VID 0x04D8
28 #define EXAMPLE_PID 0xFA2E
32 typedef enum _BM_COMMAND
34 BM_COMMAND_SET_TEST = 0x0E,
35 BM_COMMAND_GET_TEST = 0x0F,
36 BM_COMMAND_SET_VBUF = 0x10,
37 BM_COMMAND_GET_VBUF = 0x11,
41 typedef enum _BM_TEST_TYPE
43 BM_TEST_TYPE_NONE = 0x00,
44 BM_TEST_TYPE_READ = 0x01,
45 BM_TEST_TYPE_WRITE = 0x02,
46 BM_TEST_TYPE_LOOP = BM_TEST_TYPE_READ | BM_TEST_TYPE_WRITE,
76 BOOL Examples_GetTestDeviceEx(
KLST_HANDLE* DeviceList,
84 UCHAR InterfaceNumber,
86 PBM_TEST_TYPE TestType);
88 BOOL Examples_GetArgVal(
int argc,
char* argv[], LPCSTR argName, PUINT argValue, BOOL isHex);
89 BOOL Examples_GetArgStr(
int argc,
char* argv[], LPCSTR argName, LPSTR argValue, PUINT argValLength);
91 typedef struct _DATA_COUNTER_STATS
102 } DATA_COUNTER_STATS, *PDATA_COUNTER_STATS;
104 #define mDcs_Init(mDataCounterStats) do { \
105 memset((mDataCounterStats),0,sizeof(DATA_COUNTER_STATS)); \
106 QueryPerformanceFrequency(&((mDataCounterStats)->Freq)); \
107 (mDataCounterStats)->dFreq = 1.0/(double)(mDataCounterStats)->Freq.QuadPart; \
108 QueryPerformanceCounter(&((mDataCounterStats)->Start)); \
111 #define mDcs_MarkStop(mDataCounterStats,mAddTransferLength) do { \
112 QueryPerformanceCounter(&((mDataCounterStats)->Stop)); \
113 (mDataCounterStats)->TotalBytes+=(LONG)(mAddTransferLength); \
114 (mDataCounterStats)->Duration = \
115 ((mDataCounterStats)->dFreq) * \
116 ((double) ((mDataCounterStats)->Stop.QuadPart - (mDataCounterStats)->Start.QuadPart)); \
117 if ((mDataCounterStats)->Duration != 0.0) \
118 (mDataCounterStats)->Bps = ((double)(mDataCounterStats)->TotalBytes) / (mDataCounterStats)->Duration; \
211 #define DL_PREPEND(head,add) \
213 (add)->next = head; \
215 (add)->prev = (head)->prev; \
216 (head)->prev = (add); \
218 (add)->prev = (add); \
231 #define DL_APPEND(head,add) \
234 (add)->prev = (head)->prev; \
235 (head)->prev->next = (add); \
236 (head)->prev = (add); \
237 (add)->next = NULL; \
240 (head)->prev = (head); \
241 (head)->next = NULL; \
258 #define DL_DELETE(head,del) \
260 if ((del)->prev == (del)) { \
262 } else if ((del)==(head)) { \
263 (del)->next->prev = (del)->prev; \
264 (head) = (del)->next; \
266 (del)->prev->next = (del)->next; \
268 (del)->next->prev = (del)->prev; \
270 (head)->prev = (del)->prev; \
283 #define DL_FOREACH(head,el) \
284 for(el=head;el;el=el->next)
297 #define DL_FOREACH_SAFE(head,el,tmp) \
298 for((el)=(head);(el) && (tmp = (el)->next, 1); (el) = tmp)
316 #define DL_SEARCH_SCALAR(head,out,field,val) \
318 DL_FOREACH(head,out) { \
319 if ((out)->field == (val)) break; \
337 #define DL_SEARCH(head,out,elt,cmp) \
339 DL_FOREACH(head,out) { \
340 if ((cmp(out,elt))==0) break; \
functions for usb device communication.
KLIB_HANDLE KLST_HANDLE
Opaque LstK handle, see LstK_Init.
Definition: libusbk.h:131
BM_TEST_TYPE
Tests supported by the official benchmark firmware.
Definition: examples.h:41
KLST_FLAG
Device list initialization flags.
Definition: libusbk.h:350
Driver API function set structure.
Definition: libusbk.h:2045
BOOL Examples_GetTestDevice(KLST_HANDLE *DeviceList, KLST_DEVINFO_HANDLE *DeviceInfo, int argc, char *argv[])
Helper function for examples; searches a command line argument list for devices matching a specific v...
BM_COMMAND
Custom vendor requests that must be implemented in the benchmark firmware.
Definition: examples.h:32
Semi-opaque device information structure of a device list.
Definition: libusbk.h:284
KLIB_HANDLE KUSB_HANDLE
Opaque UsbK handle, see UsbK_Init.
Definition: libusbk.h:128