usb_generic.c (188942) | usb_generic.c (188986) |
---|---|
1/* $FreeBSD: head/sys/dev/usb/usb_generic.c 188942 2009-02-23 18:31:00Z thompsa $ */ | 1/* $FreeBSD: head/sys/dev/usb/usb_generic.c 188986 2009-02-24 03:41:52Z thompsa $ */ |
2/*- 3 * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. --- 649 unchanged lines hidden (view full) --- 659 cdesc = usb2_get_config_descriptor(udev); 660 if (cdesc == NULL) { 661 return (ENXIO); 662 } 663 free_data = 0; 664 665 } else { 666 if (usb2_req_get_config_desc_full(udev, | 2/*- 3 * Copyright (c) 2008 Hans Petter Selasky. All rights reserved. 4 * 5 * Redistribution and use in source and binary forms, with or without 6 * modification, are permitted provided that the following conditions 7 * are met: 8 * 1. Redistributions of source code must retain the above copyright 9 * notice, this list of conditions and the following disclaimer. --- 649 unchanged lines hidden (view full) --- 659 cdesc = usb2_get_config_descriptor(udev); 660 if (cdesc == NULL) { 661 return (ENXIO); 662 } 663 free_data = 0; 664 665 } else { 666 if (usb2_req_get_config_desc_full(udev, |
667 &Giant, &cdesc, M_USBDEV, | 667 NULL, &cdesc, M_USBDEV, |
668 ugd->ugd_config_index)) { 669 return (ENXIO); 670 } 671 free_data = 1; 672 } 673 674 len = UGETW(cdesc->wTotalLength); 675 if (len > ugd->ugd_maxlen) { --- 14 unchanged lines hidden (view full) --- 690 691static int 692ugen_get_sdesc(struct usb2_fifo *f, struct usb2_gen_descriptor *ugd) 693{ 694 void *ptr = f->udev->bus->scratch[0].data; 695 uint16_t size = sizeof(f->udev->bus->scratch[0].data); 696 int error; 697 | 668 ugd->ugd_config_index)) { 669 return (ENXIO); 670 } 671 free_data = 1; 672 } 673 674 len = UGETW(cdesc->wTotalLength); 675 if (len > ugd->ugd_maxlen) { --- 14 unchanged lines hidden (view full) --- 690 691static int 692ugen_get_sdesc(struct usb2_fifo *f, struct usb2_gen_descriptor *ugd) 693{ 694 void *ptr = f->udev->bus->scratch[0].data; 695 uint16_t size = sizeof(f->udev->bus->scratch[0].data); 696 int error; 697 |
698 if (usb2_req_get_string_desc(f->udev, &Giant, ptr, | 698 if (usb2_req_get_string_desc(f->udev, NULL, ptr, |
699 size, ugd->ugd_lang_id, ugd->ugd_string_index)) { 700 error = EINVAL; 701 } else { 702 703 if (size > ((uint8_t *)ptr)[0]) { 704 size = ((uint8_t *)ptr)[0]; 705 } 706 if (size > ugd->ugd_maxlen) { --- 1489 unchanged lines hidden --- | 699 size, ugd->ugd_lang_id, ugd->ugd_string_index)) { 700 error = EINVAL; 701 } else { 702 703 if (size > ((uint8_t *)ptr)[0]) { 704 size = ((uint8_t *)ptr)[0]; 705 } 706 if (size > ugd->ugd_maxlen) { --- 1489 unchanged lines hidden --- |