Deleted Added
full compact
usb_device.c (250204) usb_device.c (250207)
1/* $FreeBSD: head/sys/dev/usb/usb_device.c 250204 2013-05-03 09:23:06Z hselasky $ */
1/* $FreeBSD: head/sys/dev/usb/usb_device.c 250207 2013-05-03 11:10:04Z hselasky $ */
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.

--- 478 unchanged lines hidden (view full) ---

488 }
489#endif
490
491 usb_config_parse(udev, USB_IFACE_INDEX_ANY, USB_CFG_FREE);
492
493 /* free "cdesc" after "ifaces" and "endpoints", if any */
494 if (udev->cdesc != NULL) {
495 if (udev->flags.usb_mode != USB_MODE_DEVICE)
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.

--- 478 unchanged lines hidden (view full) ---

488 }
489#endif
490
491 usb_config_parse(udev, USB_IFACE_INDEX_ANY, USB_CFG_FREE);
492
493 /* free "cdesc" after "ifaces" and "endpoints", if any */
494 if (udev->cdesc != NULL) {
495 if (udev->flags.usb_mode != USB_MODE_DEVICE)
496 free(udev->cdesc, M_USB);
496 usbd_free_config_desc(udev, udev->cdesc);
497 udev->cdesc = NULL;
498 }
499 /* set unconfigured state */
500 udev->curr_config_no = USB_UNCONFIG_NO;
501 udev->curr_config_index = USB_UNCONFIG_INDEX;
502
503 if (do_unlock)
504 usbd_enum_unlock(udev);

--- 42 unchanged lines hidden (view full) ---

547 /* get the full config descriptor */
548 if (udev->flags.usb_mode == USB_MODE_DEVICE) {
549 /* save some memory */
550 err = usbd_req_get_descriptor_ptr(udev, &cdp,
551 (UDESC_CONFIG << 8) | index);
552 } else {
553 /* normal request */
554 err = usbd_req_get_config_desc_full(udev,
497 udev->cdesc = NULL;
498 }
499 /* set unconfigured state */
500 udev->curr_config_no = USB_UNCONFIG_NO;
501 udev->curr_config_index = USB_UNCONFIG_INDEX;
502
503 if (do_unlock)
504 usbd_enum_unlock(udev);

--- 42 unchanged lines hidden (view full) ---

547 /* get the full config descriptor */
548 if (udev->flags.usb_mode == USB_MODE_DEVICE) {
549 /* save some memory */
550 err = usbd_req_get_descriptor_ptr(udev, &cdp,
551 (UDESC_CONFIG << 8) | index);
552 } else {
553 /* normal request */
554 err = usbd_req_get_config_desc_full(udev,
555 NULL, &cdp, M_USB, index);
555 NULL, &cdp, index);
556 }
557 if (err) {
558 goto done;
559 }
560 /* set the new config descriptor */
561
562 udev->cdesc = cdp;
563

--- 2259 unchanged lines hidden ---
556 }
557 if (err) {
558 goto done;
559 }
560 /* set the new config descriptor */
561
562 udev->cdesc = cdp;
563

--- 2259 unchanged lines hidden ---