Deleted Added
full compact
musb_otg.c (246122) musb_otg.c (246123)
1/* $FreeBSD: head/sys/dev/usb/controller/musb_otg.c 246122 2013-01-30 15:26:04Z hselasky $ */
1/* $FreeBSD: head/sys/dev/usb/controller/musb_otg.c 246123 2013-01-30 15:46:26Z 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.

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

2206 .bDescriptorType = UDESC_HUB,
2207 .bNbrPorts = 1,
2208 HSETW(.wHubCharacteristics, (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL)),
2209 .bPwrOn2PwrGood = 50,
2210 .bHubContrCurrent = 0,
2211 .DeviceRemovable = {0}, /* port is removable */
2212};
2213
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.

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

2206 .bDescriptorType = UDESC_HUB,
2207 .bNbrPorts = 1,
2208 HSETW(.wHubCharacteristics, (UHD_PWR_NO_SWITCH | UHD_OC_INDIVIDUAL)),
2209 .bPwrOn2PwrGood = 50,
2210 .bHubContrCurrent = 0,
2211 .DeviceRemovable = {0}, /* port is removable */
2212};
2213
2214#define STRING_LANG \
2215 0x09, 0x04, /* American English */
2216
2217#define STRING_VENDOR \
2218 'M', 0, 'e', 0, 'n', 0, 't', 0, 'o', 0, 'r', 0, ' ', 0, \
2219 'G', 0, 'r', 0, 'a', 0, 'p', 0, 'h', 0, 'i', 0, 'c', 0, 's', 0
2220
2221#define STRING_PRODUCT \
2222 'O', 0, 'T', 0, 'G', 0, ' ', 0, 'R', 0, \
2223 'o', 0, 'o', 0, 't', 0, ' ', 0, 'H', 0, \
2224 'U', 0, 'B', 0,
2225
2214#define STRING_VENDOR \
2215 'M', 0, 'e', 0, 'n', 0, 't', 0, 'o', 0, 'r', 0, ' ', 0, \
2216 'G', 0, 'r', 0, 'a', 0, 'p', 0, 'h', 0, 'i', 0, 'c', 0, 's', 0
2217
2218#define STRING_PRODUCT \
2219 'O', 0, 'T', 0, 'G', 0, ' ', 0, 'R', 0, \
2220 'o', 0, 'o', 0, 't', 0, ' ', 0, 'H', 0, \
2221 'U', 0, 'B', 0,
2222
2226USB_MAKE_STRING_DESC(STRING_LANG, musbotg_langtab);
2227USB_MAKE_STRING_DESC(STRING_VENDOR, musbotg_vendor);
2228USB_MAKE_STRING_DESC(STRING_PRODUCT, musbotg_product);
2229
2230static usb_error_t
2231musbotg_roothub_exec(struct usb_device *udev,
2232 struct usb_device_request *req, const void **pptr, uint16_t *plength)
2233{
2234 struct musbotg_softc *sc = MUSBOTG_BUS2SC(udev->bus);

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

2420 goto tr_stalled;
2421 }
2422 len = sizeof(musbotg_confd);
2423 ptr = (const void *)&musbotg_confd;
2424 goto tr_valid;
2425 case UDESC_STRING:
2426 switch (value & 0xff) {
2427 case 0: /* Language table */
2223USB_MAKE_STRING_DESC(STRING_VENDOR, musbotg_vendor);
2224USB_MAKE_STRING_DESC(STRING_PRODUCT, musbotg_product);
2225
2226static usb_error_t
2227musbotg_roothub_exec(struct usb_device *udev,
2228 struct usb_device_request *req, const void **pptr, uint16_t *plength)
2229{
2230 struct musbotg_softc *sc = MUSBOTG_BUS2SC(udev->bus);

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

2416 goto tr_stalled;
2417 }
2418 len = sizeof(musbotg_confd);
2419 ptr = (const void *)&musbotg_confd;
2420 goto tr_valid;
2421 case UDESC_STRING:
2422 switch (value & 0xff) {
2423 case 0: /* Language table */
2428 len = sizeof(musbotg_langtab);
2429 ptr = (const void *)&musbotg_langtab;
2424 len = sizeof(usb_string_lang_en);
2425 ptr = (const void *)&usb_string_lang_en;
2430 goto tr_valid;
2431
2432 case 1: /* Vendor */
2433 len = sizeof(musbotg_vendor);
2434 ptr = (const void *)&musbotg_vendor;
2435 goto tr_valid;
2436
2437 case 2: /* Product */

--- 376 unchanged lines hidden ---
2426 goto tr_valid;
2427
2428 case 1: /* Vendor */
2429 len = sizeof(musbotg_vendor);
2430 ptr = (const void *)&musbotg_vendor;
2431 goto tr_valid;
2432
2433 case 2: /* Product */

--- 376 unchanged lines hidden ---