Deleted Added
full compact
dwc_otg.c (246122) dwc_otg.c (246123)
1/* $FreeBSD: head/sys/dev/usb/controller/dwc_otg.c 246122 2013-01-30 15:26:04Z hselasky $ */
1/* $FreeBSD: head/sys/dev/usb/controller/dwc_otg.c 246123 2013-01-30 15:46:26Z hselasky $ */
2/*-
3 * Copyright (c) 2012 Hans Petter Selasky. All rights reserved.
4 * Copyright (c) 2010-2011 Aleksandr Rybalko. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright

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

3486 .bDescriptorType = UDESC_HUB,
3487 .bNbrPorts = 1,
3488 HSETW(.wHubCharacteristics, (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL)),
3489 .bPwrOn2PwrGood = 50,
3490 .bHubContrCurrent = 0,
3491 .DeviceRemovable = {0}, /* port is removable */
3492};
3493
2/*-
3 * Copyright (c) 2012 Hans Petter Selasky. All rights reserved.
4 * Copyright (c) 2010-2011 Aleksandr Rybalko. All rights reserved.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright

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

3486 .bDescriptorType = UDESC_HUB,
3487 .bNbrPorts = 1,
3488 HSETW(.wHubCharacteristics, (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL)),
3489 .bPwrOn2PwrGood = 50,
3490 .bHubContrCurrent = 0,
3491 .DeviceRemovable = {0}, /* port is removable */
3492};
3493
3494#define STRING_LANG \
3495 0x09, 0x04, /* American English */
3496
3497#define STRING_VENDOR \
3498 'D', 0, 'W', 0, 'C', 0, 'O', 0, 'T', 0, 'G', 0
3499
3500#define STRING_PRODUCT \
3501 'O', 0, 'T', 0, 'G', 0, ' ', 0, 'R', 0, \
3502 'o', 0, 'o', 0, 't', 0, ' ', 0, 'H', 0, \
3503 'U', 0, 'B', 0,
3504
3494#define STRING_VENDOR \
3495 'D', 0, 'W', 0, 'C', 0, 'O', 0, 'T', 0, 'G', 0
3496
3497#define STRING_PRODUCT \
3498 'O', 0, 'T', 0, 'G', 0, ' ', 0, 'R', 0, \
3499 'o', 0, 'o', 0, 't', 0, ' ', 0, 'H', 0, \
3500 'U', 0, 'B', 0,
3501
3505USB_MAKE_STRING_DESC(STRING_LANG, dwc_otg_langtab);
3506USB_MAKE_STRING_DESC(STRING_VENDOR, dwc_otg_vendor);
3507USB_MAKE_STRING_DESC(STRING_PRODUCT, dwc_otg_product);
3508
3509static usb_error_t
3510dwc_otg_roothub_exec(struct usb_device *udev,
3511 struct usb_device_request *req, const void **pptr, uint16_t *plength)
3512{
3513 struct dwc_otg_softc *sc = DWC_OTG_BUS2SC(udev->bus);

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

3699 goto tr_stalled;
3700 }
3701 len = sizeof(dwc_otg_confd);
3702 ptr = (const void *)&dwc_otg_confd;
3703 goto tr_valid;
3704 case UDESC_STRING:
3705 switch (value & 0xff) {
3706 case 0: /* Language table */
3502USB_MAKE_STRING_DESC(STRING_VENDOR, dwc_otg_vendor);
3503USB_MAKE_STRING_DESC(STRING_PRODUCT, dwc_otg_product);
3504
3505static usb_error_t
3506dwc_otg_roothub_exec(struct usb_device *udev,
3507 struct usb_device_request *req, const void **pptr, uint16_t *plength)
3508{
3509 struct dwc_otg_softc *sc = DWC_OTG_BUS2SC(udev->bus);

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

3695 goto tr_stalled;
3696 }
3697 len = sizeof(dwc_otg_confd);
3698 ptr = (const void *)&dwc_otg_confd;
3699 goto tr_valid;
3700 case UDESC_STRING:
3701 switch (value & 0xff) {
3702 case 0: /* Language table */
3707 len = sizeof(dwc_otg_langtab);
3708 ptr = (const void *)&dwc_otg_langtab;
3703 len = sizeof(usb_string_lang_en);
3704 ptr = (const void *)&usb_string_lang_en;
3709 goto tr_valid;
3710
3711 case 1: /* Vendor */
3712 len = sizeof(dwc_otg_vendor);
3713 ptr = (const void *)&dwc_otg_vendor;
3714 goto tr_valid;
3715
3716 case 2: /* Product */

--- 506 unchanged lines hidden ---
3705 goto tr_valid;
3706
3707 case 1: /* Vendor */
3708 len = sizeof(dwc_otg_vendor);
3709 ptr = (const void *)&dwc_otg_vendor;
3710 goto tr_valid;
3711
3712 case 2: /* Product */

--- 506 unchanged lines hidden ---