View | Details | Raw Unified | Return to bug 232040 | Differences between
and this patch

Collapse All | Expand All

(-)b/sys/dev/usb/input/uhid.c (+6 lines)
Lines 124-129 struct uhid_softc { Link Here
124
static const uint8_t uhid_xb360gp_report_descr[] = {UHID_XB360GP_REPORT_DESCR()};
124
static const uint8_t uhid_xb360gp_report_descr[] = {UHID_XB360GP_REPORT_DESCR()};
125
static const uint8_t uhid_graphire_report_descr[] = {UHID_GRAPHIRE_REPORT_DESCR()};
125
static const uint8_t uhid_graphire_report_descr[] = {UHID_GRAPHIRE_REPORT_DESCR()};
126
static const uint8_t uhid_graphire3_4x5_report_descr[] = {UHID_GRAPHIRE3_4X5_REPORT_DESCR()};
126
static const uint8_t uhid_graphire3_4x5_report_descr[] = {UHID_GRAPHIRE3_4X5_REPORT_DESCR()};
127
static const uint8_t uhid_touchdigi_v04_report_descr[] = {UHID_TOUCHDIGI_V04_REPORT_DESCR()};
127
128
128
/* prototypes */
129
/* prototypes */
129
130
Lines 802-807 uhid_attach(device_t dev) Link Here
802
		sc->sc_repdesc_size = sizeof(uhid_xb360gp_report_descr);
803
		sc->sc_repdesc_size = sizeof(uhid_xb360gp_report_descr);
803
		sc->sc_repdesc_ptr = __DECONST(void *, &uhid_xb360gp_report_descr);
804
		sc->sc_repdesc_ptr = __DECONST(void *, &uhid_xb360gp_report_descr);
804
		sc->sc_flags |= UHID_FLAG_STATIC_DESC;
805
		sc->sc_flags |= UHID_FLAG_STATIC_DESC;
806
	} else if (uaa->info.idVendor == USB_VENDOR_SYNAPTICS &&
807
		   uaa->info.idProduct == USB_PRODUCT_SYNAPTICS_TOUCHDIGI_V04) {
808
		sc->sc_repdesc_size = sizeof(uhid_touchdigi_v04_report_descr);
809
		sc->sc_repdesc_ptr = __DECONST(void *, &uhid_touchdigi_v04_report_descr);
810
		sc->sc_flags |= UHID_FLAG_STATIC_DESC;
805
	}
811
	}
806
	if (sc->sc_repdesc_ptr == NULL) {
812
	if (sc->sc_repdesc_ptr == NULL) {
807
813
(-)b/sys/dev/usb/input/usb_rdesc.h (+280 lines)
Lines 304-306 Link Here
304
    0x81, 0x01,         /*          Input (Constant),       */\
304
    0x81, 0x01,         /*          Input (Constant),       */\
305
    0xC0,               /*      End Collection,             */\
305
    0xC0,               /*      End Collection,             */\
306
    0xC0                /*  End Collection                  */
306
    0xC0                /*  End Collection                  */
307
308
/* Fixed report descriptor for Synaptics Touch Digitizer V04 */
309
#define UHID_TOUCHDIGI_V04_REPORT_DESCR(...) \
310
    0x05, 0x01,		/* Usage Page (Generic Desktop Ctrls)		*/\
311
    0x09, 0x02,		/* Usage (Mouse)				*/\
312
    0xA1, 0x01,		/* Collection (Application)			*/\
313
    0x85, 0x02,		/*   Report ID (2)				*/\
314
    0x09, 0x01,		/*   Usage (Pointer)				*/\
315
    0xA1, 0x00,		/*   Collection (Physical)			*/\
316
    0x05, 0x09,		/*     Usage Page (Button)			*/\
317
    0x19, 0x01,		/*     Usage Minimum (0x01)			*/\
318
    0x29, 0x02,		/*     Usage Maximum (0x02)			*/\
319
    0x15, 0x00,		/*     Logical Minimum (0)			*/\
320
    0x25, 0x01,		/*     Logical Maximum (1)			*/\
321
    0x75, 0x01,		/*     Report Size (1)				*/\
322
    0x95, 0x02,		/*     Report Count (2)				*/\
323
    0x81, 0x02,		/*     Input (Data,Var,Abs)			*/\
324
    0x95, 0x06,		/*     Report Count (6)				*/\
325
    0x81, 0x03,		/*     Input (Const,Var,Abs)			*/\
326
    0x05, 0x01,		/*     Usage Page (Generic Desktop Ctrls)	*/\
327
    0x09, 0x30,		/*     Usage (X)				*/\
328
    0x09, 0x31,		/*     Usage (Y)				*/\
329
    0x15, 0x81,		/*     Logical Minimum (-127)			*/\
330
    0x25, 0x7F,		/*     Logical Maximum (127)			*/\
331
    0x75, 0x08,		/*     Report Size (8)				*/\
332
    0x95, 0x02,		/*     Report Count (2)				*/\
333
    0x81, 0x06,		/*     Input (Data,Var,Rel)			*/\
334
    0xC0,		/*   End Collection				*/\
335
    0xC0,		/* End Collection				*/\
336
    0x05, 0x0D,		/* Usage Page (Digitizer)			*/\
337
    0x09, 0x04,		/* Usage (Touch Screen)				*/\
338
    0xA1, 0x01,		/* Collection (Application)			*/\
339
    0x85, 0x01,		/*   Report ID (1)				*/\
340
    0x09, 0x22,		/*   Usage (Finger)				*/\
341
    0xA1, 0x02,		/*   Collection (Logical)			*/\
342
    0x09, 0x42,		/*     Usage (Tip Switch)			*/\
343
    0x15, 0x00,		/*     Logical Minimum (0)			*/\
344
    0x25, 0x01,		/*     Logical Maximum (1)			*/\
345
    0x75, 0x01,		/*     Report Size (1)				*/\
346
    0x95, 0x01,		/*     Report Count (1)				*/\
347
    0x81, 0x02,		/*     Input (Data,Var,Abs)			*/\
348
    0x95, 0x07,		/*     Report Count (7)				*/\
349
    0x81, 0x03,		/*     Input (Const,Var,Abs)			*/\
350
    0x75, 0x08,		/*     Report Size (8)				*/\
351
    0x09, 0x51,		/*     Usage (0x51)				*/\
352
    0x15, 0x01,		/*     Logical Minimum (1)			*/\
353
    0x26, 0xFF, 0x00,	/*     Logical Maximum (255)			*/\
354
    0x95, 0x01,		/*     Report Count (1)				*/\
355
    0x81, 0x42,		/*     Input (Data,Var,Abs)			*/\
356
    0x05, 0x01,		/*     Usage Page (Generic Desktop Ctrls)	*/\
357
    0x15, 0x00,		/*     Logical Minimum (0)			*/\
358
    0x26, 0xE2, 0x0A,	/*     Logical Maximum (2786)			*/\
359
    0x75, 0x10,		/*     Report Size (16)				*/\
360
    0x55, 0x0E,		/*     Unit Exponent (-2)			*/\
361
    0x65, 0x11,		/*     Unit (System: SI Linear, Length: Centimeter) */\
362
    0x09, 0x30,		/*     Usage (X)				*/\
363
    0x35, 0x0F,		/*     Physical Minimum (15)			*/\
364
    0x46, 0xD3, 0x0A,	/*     Physical Maximum (2771)			*/\
365
    0x81, 0x02,		/*     Input (Data,Var,Abs)			*/\
366
    0x09, 0x31,		/*     Usage (Y)				*/\
367
    0x15, 0x00,		/*     Logical Minimum (0)			*/\
368
    0x26, 0x2B, 0x06,	/*     Logical Maximum (1579)			*/\
369
    0x35, 0x0F,		/*     Physical Minimum (15)			*/\
370
    0x46, 0x1C, 0x06,	/*     Physical Maximum (1564)			*/\
371
    0x81, 0x02,		/*     Input (Data,Var,Abs)			*/\
372
    0xC0,		/*   End Collection				*/\
373
    0x05, 0x0D,		/*   Usage Page (Digitizer)			*/\
374
    0x09, 0x22,		/*   Usage (Finger)				*/\
375
    0xA1, 0x02,		/*   Collection (Logical)			*/\
376
    0x09, 0x42,		/*     Usage (Tip Switch)			*/\
377
    0x15, 0x00,		/*     Logical Minimum (0)			*/\
378
    0x25, 0x01,		/*     Logical Maximum (1)			*/\
379
    0x75, 0x01,		/*     Report Size (1)				*/\
380
    0x95, 0x01,		/*     Report Count (1)				*/\
381
    0x81, 0x02,		/*     Input (Data,Var,Abs)			*/\
382
    0x95, 0x07,		/*     Report Count (7)				*/\
383
    0x81, 0x03,		/*     Input (Const,Var,Abs)			*/\
384
    0x75, 0x08,		/*     Report Size (8)				*/\
385
    0x09, 0x51,		/*     Usage (0x51)				*/\
386
    0x15, 0x01,		/*     Logical Minimum (1)			*/\
387
    0x26, 0xFF, 0x00,	/*     Logical Maximum (255)			*/\
388
    0x95, 0x01,		/*     Report Count (1)				*/\
389
    0x81, 0x42,		/*     Input (Data,Var,Abs)			*/\
390
    0x05, 0x01,		/*     Usage Page (Generic Desktop Ctrls)	*/\
391
    0x15, 0x00,		/*     Logical Minimum (0)			*/\
392
    0x26, 0xE2, 0x0A,	/*     Logical Maximum (2786)			*/\
393
    0x75, 0x10,		/*     Report Size (16)				*/\
394
    0x55, 0x0E,		/*     Unit Exponent (-2)			*/\
395
    0x65, 0x11,		/*     Unit (System: SI Linear, Length: Centimeter) */\
396
    0x09, 0x30,		/*     Usage (X)				*/\
397
    0x35, 0x0F,		/*     Physical Minimum (15)			*/\
398
    0x46, 0xD3, 0x0A,	/*     Physical Maximum (2771)			*/\
399
    0x81, 0x02,		/*     Input (Data,Var,Abs)			*/\
400
    0x09, 0x31,		/*     Usage (Y)				*/\
401
    0x15, 0x00,		/*     Logical Minimum (0)			*/\
402
    0x26, 0x2B, 0x06,	/*     Logical Maximum (1579)			*/\
403
    0x35, 0x0F,		/*     Physical Minimum (15)			*/\
404
    0x46, 0x1C, 0x06,	/*     Physical Maximum (1564)			*/\
405
    0x81, 0x02,		/*     Input (Data,Var,Abs)			*/\
406
    0xC0,		/*   End Collection				*/\
407
    0x05, 0x0D,		/*   Usage Page (Digitizer)			*/\
408
    0x09, 0x22,		/*   Usage (Finger)				*/\
409
    0xA1, 0x02,		/*   Collection (Logical)			*/\
410
    0x09, 0x42,		/*     Usage (Tip Switch)			*/\
411
    0x15, 0x00,		/*     Logical Minimum (0)			*/\
412
    0x25, 0x01,		/*     Logical Maximum (1)			*/\
413
    0x75, 0x01,		/*     Report Size (1)				*/\
414
    0x95, 0x01,		/*     Report Count (1)				*/\
415
    0x81, 0x02,		/*     Input (Data,Var,Abs)			*/\
416
    0x95, 0x07,		/*     Report Count (7)				*/\
417
    0x81, 0x03,		/*     Input (Const,Var,Abs)			*/\
418
    0x75, 0x08,		/*     Report Size (8)				*/\
419
    0x09, 0x51,		/*     Usage (0x51)				*/\
420
    0x15, 0x01,		/*     Logical Minimum (1)			*/\
421
    0x26, 0xFF, 0x00,	/*     Logical Maximum (255)			*/\
422
    0x95, 0x01,		/*     Report Count (1)				*/\
423
    0x81, 0x42,		/*     Input (Data,Var,Abs)			*/\
424
    0x05, 0x01,		/*     Usage Page (Generic Desktop Ctrls)	*/\
425
    0x15, 0x00,		/*     Logical Minimum (0)			*/\
426
    0x26, 0xE2, 0x0A,	/*     Logical Maximum (2786)			*/\
427
    0x75, 0x10,		/*     Report Size (16)				*/\
428
    0x55, 0x0E,		/*     Unit Exponent (-2)			*/\
429
    0x65, 0x11,		/*     Unit (System: SI Linear, Length: Centimeter) */\
430
    0x09, 0x30,		/*     Usage (X)				*/\
431
    0x35, 0x0F,		/*     Physical Minimum (15)			*/\
432
    0x46, 0xD3, 0x0A,	/*     Physical Maximum (2771)			*/\
433
    0x81, 0x02,		/*     Input (Data,Var,Abs)			*/\
434
    0x09, 0x31,		/*     Usage (Y)				*/\
435
    0x15, 0x00,		/*     Logical Minimum (0)			*/\
436
    0x26, 0x2B, 0x06,	/*     Logical Maximum (1579)			*/\
437
    0x35, 0x0F,		/*     Physical Minimum (15)			*/\
438
    0x46, 0x1C, 0x06,	/*     Physical Maximum (1564)			*/\
439
    0x81, 0x02,		/*     Input (Data,Var,Abs)			*/\
440
    0xC0,		/*   End Collection				*/\
441
    0x05, 0x0D,		/*   Usage Page (Digitizer)			*/\
442
    0x09, 0x22,		/*   Usage (Finger)				*/\
443
    0xA1, 0x02,		/*   Collection (Logical)			*/\
444
    0x09, 0x42,		/*     Usage (Tip Switch)			*/\
445
    0x15, 0x00,		/*     Logical Minimum (0)			*/\
446
    0x25, 0x01,		/*     Logical Maximum (1)			*/\
447
    0x75, 0x01,		/*     Report Size (1)				*/\
448
    0x95, 0x01,		/*     Report Count (1)				*/\
449
    0x81, 0x02,		/*     Input (Data,Var,Abs)			*/\
450
    0x95, 0x07,		/*     Report Count (7)				*/\
451
    0x81, 0x03,		/*     Input (Const,Var,Abs)			*/\
452
    0x75, 0x08,		/*     Report Size (8)				*/\
453
    0x09, 0x51,		/*     Usage (0x51)				*/\
454
    0x15, 0x01,		/*     Logical Minimum (1)			*/\
455
    0x26, 0xFF, 0x00,	/*     Logical Maximum (255)			*/\
456
    0x95, 0x01,		/*     Report Count (1)				*/\
457
    0x81, 0x42,		/*     Input (Data,Var,Abs)			*/\
458
    0x05, 0x01,		/*     Usage Page (Generic Desktop Ctrls)	*/\
459
    0x15, 0x00,		/*     Logical Minimum (0)			*/\
460
    0x26, 0xE2, 0x0A,	/*     Logical Maximum (2786)			*/\
461
    0x75, 0x10,		/*     Report Size (16)				*/\
462
    0x55, 0x0E,		/*     Unit Exponent (-2)			*/\
463
    0x65, 0x11,		/*     Unit (System: SI Linear, Length: Centimeter) */\
464
    0x09, 0x30,		/*     Usage (X)				*/\
465
    0x35, 0x0F,		/*     Physical Minimum (15)			*/\
466
    0x46, 0xD3, 0x0A,	/*     Physical Maximum (2771)			*/\
467
    0x81, 0x02,		/*     Input (Data,Var,Abs)			*/\
468
    0x09, 0x31,		/*     Usage (Y)				*/\
469
    0x15, 0x00,		/*     Logical Minimum (0)			*/\
470
    0x26, 0x2B, 0x06,	/*     Logical Maximum (1579)			*/\
471
    0x35, 0x0F,		/*     Physical Minimum (15)			*/\
472
    0x46, 0x1C, 0x06,	/*     Physical Maximum (1564)			*/\
473
    0x81, 0x02,		/*     Input (Data,Var,Abs)			*/\
474
    0xC0,		/*   End Collection				*/\
475
    0x05, 0x0D,		/*   Usage Page (Digitizer)			*/\
476
    0x09, 0x22,		/*   Usage (Finger)				*/\
477
    0xA1, 0x02,		/*   Collection (Logical)			*/\
478
    0x09, 0x42,		/*     Usage (Tip Switch)			*/\
479
    0x15, 0x00,		/*     Logical Minimum (0)			*/\
480
    0x25, 0x01,		/*     Logical Maximum (1)			*/\
481
    0x75, 0x01,		/*     Report Size (1)				*/\
482
    0x95, 0x01,		/*     Report Count (1)				*/\
483
    0x81, 0x02,		/*     Input (Data,Var,Abs)			*/\
484
    0x95, 0x07,		/*     Report Count (7)				*/\
485
    0x81, 0x03,		/*     Input (Const,Var,Abs)			*/\
486
    0x75, 0x08,		/*     Report Size (8)				*/\
487
    0x09, 0x51,		/*     Usage (0x51)				*/\
488
    0x15, 0x01,		/*     Logical Minimum (1)			*/\
489
    0x26, 0xFF, 0x00,	/*     Logical Maximum (255)			*/\
490
    0x95, 0x01,		/*     Report Count (1)				*/\
491
    0x81, 0x42,		/*     Input (Data,Var,Abs)			*/\
492
    0x05, 0x01,		/*     Usage Page (Generic Desktop Ctrls)	*/\
493
    0x15, 0x00,		/*     Logical Minimum (0)			*/\
494
    0x26, 0xE2, 0x0A,	/*     Logical Maximum (2786)			*/\
495
    0x75, 0x10,		/*     Report Size (16)				*/\
496
    0x55, 0x0E,		/*     Unit Exponent (-2)			*/\
497
    0x65, 0x11,		/*     Unit (System: SI Linear, Length: Centimeter) */\
498
    0x09, 0x30,		/*     Usage (X)				*/\
499
    0x35, 0x0F,		/*     Physical Minimum (15)			*/\
500
    0x46, 0xD3, 0x0A,	/*     Physical Maximum (2771)			*/\
501
    0x81, 0x02,		/*     Input (Data,Var,Abs)			*/\
502
    0x09, 0x31,		/*     Usage (Y)				*/\
503
    0x15, 0x00,		/*     Logical Minimum (0)			*/\
504
    0x26, 0x2B, 0x06,	/*     Logical Maximum (1579)			*/\
505
    0x35, 0x0F,		/*     Physical Minimum (15)			*/\
506
    0x46, 0x1C, 0x06,	/*     Physical Maximum (1564)			*/\
507
    0x81, 0x02,		/*     Input (Data,Var,Abs)			*/\
508
    0xC0,		/*   End Collection				*/\
509
    0x05, 0x0D,		/*   Usage Page (Digitizer)			*/\
510
    0x05, 0x0D,		/*   Usage Page (Digitizer)			*/\
511
    0x55, 0x0C,		/*   Unit Exponent (-4)				*/\
512
    0x66, 0x01, 0x10,	/*   Unit (System: SI Linear, Time: Seconds)	*/\
513
    0x47, 0xFF, 0xFF, 0x00, 0x00,	/*   Physical Maximum (65534)	*/\
514
    0x27, 0xFF, 0xFF, 0x00, 0x00,	/*   Logical Maximum (65534)	*/\
515
    0x75, 0x10,		/*   Report Size (16)				*/\
516
    0x95, 0x01,		/*   Report Count (1)				*/\
517
    0x09, 0x56,		/*   Usage (0x56)				*/\
518
    0x81, 0x02,		/*   Input (Data,Var,Abs)			*/\
519
    0x09, 0x54,		/*   Usage (0x54)				*/\
520
    0x95, 0x01,		/*   Report Count (1)				*/\
521
    0x75, 0x08,		/*   Report Size (8)				*/\
522
    0x15, 0x00,		/*   Logical Minimum (0)			*/\
523
    0x25, 0x0F,		/*   Logical Maximum (15)			*/\
524
    0x81, 0x02,		/*   Input (Data,Var,Abs)			*/\
525
    0x85, 0x08,		/*   Report ID (8)				*/\
526
    0x09, 0x55,		/*   Usage (0x55)				*/\
527
    0xB1, 0x02,		/*   Feature (Data,Var,Abs)			*/\
528
    0x85, 0x07,		/*   Report ID (7)				*/\
529
    0x06, 0x00, 0xFF,	/*   Usage Page (Vendor Defined 0xFF00)		*/\
530
    0x09, 0xC5,		/*   Usage (0xC5)				*/\
531
    0x15, 0x00,		/*   Logical Minimum (0)			*/\
532
    0x26, 0xFF, 0x00,	/*   Logical Maximum (255)			*/\
533
    0x26, 0xFF, 0x00,	/*   Logical Maximum (255)			*/\
534
    0x75, 0x08,		/*   Report Size (8)				*/\
535
    0x96, 0x00, 0x01,	/*   Report Count (256)				*/\
536
    0xB1, 0x02,		/*   Feature (Data,Var,Abs)			*/\
537
    0xC0,		/* End Collection				*/\
538
    0x06, 0x00, 0xFF,	/* Usage Page (Vendor Defined 0xFF00)		*/\
539
    0x09, 0x01,		/* Usage (0x01)					*/\
540
    0xA1, 0x01,		/* Collection (Application)			*/\
541
    0x85, 0x09,		/*   Report ID (9)				*/\
542
    0x09, 0x02,		/*   Usage (0x02)				*/\
543
    0x15, 0x00,		/*   Logical Minimum (0)			*/\
544
    0x26, 0xFF, 0x00,	/*   Logical Maximum (255)			*/\
545
    0x26, 0xFF, 0x00,	/*   Logical Maximum (255)			*/\
546
    0x75, 0x08,		/*   Report Size (8)				*/\
547
    0x95, 0x3F,		/*   Report Count (63)				*/\
548
    0x91, 0x02,		/*   Output (Data,Var,Abs)			*/\
549
    0x85, 0x0A,		/*   Report ID (10)				*/\
550
    0x09, 0x03,		/*   Usage (0x03)				*/\
551
    0x15, 0x00,		/*   Logical Minimum (0)			*/\
552
    0x26, 0xFF, 0x00,	/*   Logical Maximum (255)			*/\
553
    0x75, 0x08,		/*   Report Size (8)				*/\
554
    0x95, 0x05,		/*   Report Count (5)				*/\
555
    0x91, 0x02,		/*   Output (Data,Var,Abs)			*/\
556
    0x85, 0x0B,		/*   Report ID (11)				*/\
557
    0x09, 0x04,		/*   Usage (0x04)				*/\
558
    0x15, 0x00,		/*   Logical Minimum (0)			*/\
559
    0x26, 0xFF, 0x00,	/*   Logical Maximum (255)			*/\
560
    0x75, 0x08,		/*   Report Size (8)				*/\
561
    0x95, 0x3D,		/*   Report Count (61)				*/\
562
    0x81, 0x02,		/*   Input (Data,Var,Abs)			*/\
563
    0x85, 0x0C,		/*   Report ID (12)				*/\
564
    0x09, 0x05,		/*   Usage (0x05)				*/\
565
    0x15, 0x00,		/*   Logical Minimum (0)			*/\
566
    0x26, 0xFF, 0x00,	/*   Logical Maximum (255)			*/\
567
    0x75, 0x08,		/*   Report Size (8)				*/\
568
    0x95, 0x01,		/*   Report Count (1)				*/\
569
    0x81, 0x02,		/*   Input (Data,Var,Abs)			*/\
570
    0x85, 0xDB,		/*   Report ID (-37)				*/\
571
    0x09, 0x06,		/*   Usage (0x06)				*/\
572
    0x15, 0x00,		/*   Logical Minimum (0)			*/\
573
    0x26, 0xFF, 0x00,	/*   Logical Maximum (255)			*/\
574
    0x35, 0x00,		/*   Physical Minimum (0)			*/\
575
    0x46, 0xFF, 0x00,	/*   Physical Maximum (255)			*/\
576
    0x75, 0x08,		/*   Report Size (8)				*/\
577
    0x95, 0x3D,		/*   Report Count (61)				*/\
578
    0x81, 0x02,		/*   Input (Data,Var,Abs)			*/\
579
    0x85, 0x0F,		/*   Report ID (15)				*/\
580
    0x09, 0x06,		/*   Usage (0x06)				*/\
581
    0x15, 0x00,		/*   Logical Minimum (0)			*/\
582
    0x26, 0xFF, 0x00,	/*   Logical Maximum (255)			*/\
583
    0x75, 0x08,		/*   Report Size (8)				*/\
584
    0x95, 0x03,		/*   Report Count (3)				*/\
585
    0xB1, 0x02,		/*   Feature (Data,Var,Abs)			*/\
586
    0xC0		/* End Collection				*/
(-)b/sys/dev/usb/input/wmt.c (-12 / +35 lines)
Lines 51-56 __FBSDID("$FreeBSD$"); Link Here
51
#include <dev/usb/usbdi_util.h>
51
#include <dev/usb/usbdi_util.h>
52
#include <dev/usb/usbhid.h>
52
#include <dev/usb/usbhid.h>
53
53
54
#include <dev/usb/input/usb_rdesc.h>
54
#include <dev/usb/quirk/usb_quirk.h>
55
#include <dev/usb/quirk/usb_quirk.h>
55
56
56
#include <dev/evdev/evdev.h>
57
#include <dev/evdev/evdev.h>
Lines 217-222 struct wmt_softc Link Here
217
	for ((usage) = 0; (usage) < WMT_N_USAGES; ++(usage))	\
218
	for ((usage) = 0; (usage) < WMT_N_USAGES; ++(usage))	\
218
		if (USAGE_SUPPORTED((caps), (usage)))
219
		if (USAGE_SUPPORTED((caps), (usage)))
219
220
221
static const uint8_t uhid_touchdigi_v04_report_descr[] =
222
    { UHID_TOUCHDIGI_V04_REPORT_DESCR() };
223
220
static bool wmt_hid_parse(struct wmt_softc *, const void *, uint16_t);
224
static bool wmt_hid_parse(struct wmt_softc *, const void *, uint16_t);
221
static void wmt_cont_max_parse(struct wmt_softc *, const void *, uint16_t);
225
static void wmt_cont_max_parse(struct wmt_softc *, const void *, uint16_t);
222
226
Lines 262-267 wmt_probe(device_t dev) Link Here
262
	struct usb_attach_arg *uaa = device_get_ivars(dev);
266
	struct usb_attach_arg *uaa = device_get_ivars(dev);
263
	void *d_ptr;
267
	void *d_ptr;
264
	uint16_t d_len;
268
	uint16_t d_len;
269
	bool d_static = false;
265
	int err;
270
	int err;
266
271
267
	if (uaa->usb_mode != USB_MODE_HOST)
272
	if (uaa->usb_mode != USB_MODE_HOST)
Lines 273-289 wmt_probe(device_t dev) Link Here
273
	if (usb_test_quirk(uaa, UQ_WMT_IGNORE))
278
	if (usb_test_quirk(uaa, UQ_WMT_IGNORE))
274
		return (ENXIO);
279
		return (ENXIO);
275
280
276
	err = usbd_req_get_hid_desc(uaa->device, NULL,
281
	if (uaa->info.idVendor == USB_VENDOR_SYNAPTICS &&
277
	    &d_ptr, &d_len, M_TEMP, uaa->info.bIfaceIndex);
282
	    uaa->info.idProduct == USB_PRODUCT_SYNAPTICS_TOUCHDIGI_V04) {
278
	if (err)
283
		d_len = sizeof(uhid_touchdigi_v04_report_descr);
279
		return (ENXIO);
284
		d_ptr = __DECONST(void *, &uhid_touchdigi_v04_report_descr);
285
		d_static = true;
286
	} else {
287
		err = usbd_req_get_hid_desc(uaa->device, NULL,
288
		    &d_ptr, &d_len, M_TEMP, uaa->info.bIfaceIndex);
289
		if (err)
290
			return (ENXIO);
291
	}
280
292
281
	if (wmt_hid_parse(NULL, d_ptr, d_len))
293
	if (wmt_hid_parse(NULL, d_ptr, d_len))
282
		err = BUS_PROBE_DEFAULT;
294
		err = BUS_PROBE_DEFAULT;
283
	else
295
	else
284
		err = ENXIO;
296
		err = ENXIO;
285
297
286
	free(d_ptr, M_TEMP);
298
	if (!d_static)
299
		free(d_ptr, M_TEMP);
300
287
	return (err);
301
	return (err);
288
}
302
}
289
303
Lines 296-316 wmt_attach(device_t dev) Link Here
296
	uint16_t d_len;
310
	uint16_t d_len;
297
	size_t i;
311
	size_t i;
298
	int err;
312
	int err;
299
	bool hid_ok;
313
	bool hid_ok, d_static = false;
300
314
301
	device_set_usb_desc(dev);
315
	device_set_usb_desc(dev);
302
	sc->dev = dev;
316
	sc->dev = dev;
303
317
304
	/* Get HID descriptor */
318
	/* Get HID descriptor */
305
	err = usbd_req_get_hid_desc(uaa->device, NULL,
319
	if (uaa->info.idVendor == USB_VENDOR_SYNAPTICS &&
306
	    &d_ptr, &d_len, M_TEMP, uaa->info.bIfaceIndex);
320
	    uaa->info.idProduct == USB_PRODUCT_SYNAPTICS_TOUCHDIGI_V04) {
307
	if (err) {
321
		d_len = sizeof(uhid_touchdigi_v04_report_descr);
308
		DPRINTF("usbd_req_get_hid_desc error=%s\n", usbd_errstr(err));
322
		d_ptr = __DECONST(void *, &uhid_touchdigi_v04_report_descr);
309
		return (ENXIO);
323
		d_static = true;
324
	} else {
325
		err = usbd_req_get_hid_desc(uaa->device, NULL,
326
		    &d_ptr, &d_len, M_TEMP, uaa->info.bIfaceIndex);
327
		if (err) {
328
			DPRINTF("usbd_req_get_hid_desc error=%s\n",
329
			    usbd_errstr(err));
330
			return (ENXIO);
331
		}
310
	}
332
	}
311
333
312
	hid_ok = wmt_hid_parse(sc, d_ptr, d_len);
334
	hid_ok = wmt_hid_parse(sc, d_ptr, d_len);
313
	free(d_ptr, M_TEMP);
335
	if (!d_static)
336
		free(d_ptr, M_TEMP);
314
	if (!hid_ok) {
337
	if (!hid_ok) {
315
		DPRINTF("multi-touch HID descriptor not found\n");
338
		DPRINTF("multi-touch HID descriptor not found\n");
316
		return (ENXIO);
339
		return (ENXIO);
(-)b/sys/dev/usb/usbdevs (+3 lines)
Lines 4549-4554 product SUPERTOP FLASHDRIVE 0x121c extrememory Snippy Link Here
4549
product SYNTECH CPT8001C	0x0001	CPT-8001C Barcode scanner
4549
product SYNTECH CPT8001C	0x0001	CPT-8001C Barcode scanner
4550
product	SYNTECH CYPHERLAB100	0x1000	CipherLab USB Barcode Scanner
4550
product	SYNTECH CYPHERLAB100	0x1000	CipherLab USB Barcode Scanner
4551
4551
4552
/* Synaptics products */
4553
product	SYNAPTICS TOUCHDIGI_V04	0x7244	Touch Digitizer V04
4554
4552
/* Teclast products */
4555
/* Teclast products */
4553
product TECLAST TLC300		0x3203	USB Media Player
4556
product TECLAST TLC300		0x3203	USB Media Player
4554
4557

Return to bug 232040