u3g.c (292080) | u3g.c (298300) |
---|---|
1/* 2 * Copyright (c) 2008 AnyWi Technologies 3 * Author: Andrea Guzzo <aguzzo@anywi.com> 4 * * based on uark.c 1.1 2006/08/14 08:30:22 jsg * 5 * * parts from ubsa.c 183348 2008-09-25 12:00:56Z phk * 6 * 7 * Permission to use, copy, modify, and distribute this software for any 8 * purpose with or without fee is hereby granted, provided that the above 9 * copyright notice and this permission notice appear in all copies. 10 * 11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 * | 1/* 2 * Copyright (c) 2008 AnyWi Technologies 3 * Author: Andrea Guzzo <aguzzo@anywi.com> 4 * * based on uark.c 1.1 2006/08/14 08:30:22 jsg * 5 * * parts from ubsa.c 183348 2008-09-25 12:00:56Z phk * 6 * 7 * Permission to use, copy, modify, and distribute this software for any 8 * purpose with or without fee is hereby granted, provided that the above 9 * copyright notice and this permission notice appear in all copies. 10 * 11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES 12 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF 13 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR 14 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES 15 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 16 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 17 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 18 * |
19 * $FreeBSD: head/sys/dev/usb/serial/u3g.c 292080 2015-12-11 05:28:00Z imp $ | 19 * $FreeBSD: head/sys/dev/usb/serial/u3g.c 298300 2016-04-19 22:07:36Z pfg $ |
20 */ 21 22/* 23 * NOTE: 24 * 25 * - The detour through the tty layer is ridiculously expensive wrt 26 * buffering due to the high speeds. 27 * --- 637 unchanged lines hidden (view full) --- 665 666 DPRINTFN(1, "\n"); 667 668 if (usbd_req_set_alt_interface_no(udev, NULL, 0, 0)) { 669 DPRINTFN(0, "Alt setting 0 failed\n"); 670 return; 671 } 672 | 20 */ 21 22/* 23 * NOTE: 24 * 25 * - The detour through the tty layer is ridiculously expensive wrt 26 * buffering due to the high speeds. 27 * --- 637 unchanged lines hidden (view full) --- 665 666 DPRINTFN(1, "\n"); 667 668 if (usbd_req_set_alt_interface_no(udev, NULL, 0, 0)) { 669 DPRINTFN(0, "Alt setting 0 failed\n"); 670 return; 671 } 672 |
673 for (n = 0; n != (sizeof(setup)/sizeof(setup[0])); n++) { | 673 for (n = 0; n != nitems(setup); n++) { |
674 675 memcpy(&req, setup[n], sizeof(req)); 676 677 len = UGETW(req.wLength); 678 if (req.bmRequestType & UE_DIR_IN) { 679 if (len > sizeof(buf)) { 680 DPRINTFN(0, "too small buffer\n"); 681 continue; --- 546 unchanged lines hidden --- | 674 675 memcpy(&req, setup[n], sizeof(req)); 676 677 len = UGETW(req.wLength); 678 if (req.bmRequestType & UE_DIR_IN) { 679 if (len > sizeof(buf)) { 680 DPRINTFN(0, "too small buffer\n"); 681 continue; --- 546 unchanged lines hidden --- |