|
@@ -239,12 +239,12 @@ uint8_t UHS_USB_HOST_BASE::Configuring(uint8_t parent, uint8_t port, uint8_t spe
|
239
|
239
|
// wrap in {} to throw away the 64 byte buffer when we are done with it
|
240
|
240
|
{
|
241
|
241
|
uint8_t buf[biggest];
|
242
|
|
- USB_DEVICE_DESCRIPTOR *udd = reinterpret_cast<USB_DEVICE_DESCRIPTOR *>(buf);
|
|
242
|
+ USB_FD_DEVICE_DESCRIPTOR *udd = reinterpret_cast<USB_FD_DEVICE_DESCRIPTOR *>(buf);
|
243
|
243
|
#else
|
244
|
244
|
const uint8_t biggest = 18;
|
245
|
245
|
uint8_t buf[biggest];
|
246
|
|
- USB_DEVICE_DESCRIPTOR *udd = reinterpret_cast<USB_DEVICE_DESCRIPTOR *>(buf);
|
247
|
|
- USB_CONFIGURATION_DESCRIPTOR *ucd = reinterpret_cast<USB_CONFIGURATION_DESCRIPTOR *>(buf);
|
|
246
|
+ USB_FD_DEVICE_DESCRIPTOR *udd = reinterpret_cast<USB_FD_DEVICE_DESCRIPTOR *>(buf);
|
|
247
|
+ USB_FD_CONFIGURATION_DESCRIPTOR *ucd = reinterpret_cast<USB_FD_CONFIGURATION_DESCRIPTOR *>(buf);
|
248
|
248
|
#endif
|
249
|
249
|
|
250
|
250
|
//for(devConfigIndex = 0; devConfigIndex < UHS_HOST_MAX_INTERFACE_DRIVERS; devConfigIndex++) {
|
|
@@ -309,7 +309,7 @@ again:
|
309
|
309
|
sof_delay(200);
|
310
|
310
|
goto again;
|
311
|
311
|
}
|
312
|
|
- HOST_DEBUG("Configuring error: 0x%2.2x Can't get USB_DEVICE_DESCRIPTOR\r\n", rcode);
|
|
312
|
+ HOST_DEBUG("Configuring error: 0x%2.2x Can't get USB_FD_DEVICE_DESCRIPTOR\r\n", rcode);
|
313
|
313
|
return rcode;
|
314
|
314
|
}
|
315
|
315
|
|
|
@@ -378,7 +378,7 @@ again:
|
378
|
378
|
} // unwrapped, old large buf now invalid and discarded.
|
379
|
379
|
|
380
|
380
|
uint8_t buf[18];
|
381
|
|
- USB_CONFIGURATION_DESCRIPTOR *ucd = reinterpret_cast<USB_CONFIGURATION_DESCRIPTOR *>(buf);
|
|
381
|
+ USB_FD_CONFIGURATION_DESCRIPTOR *ucd = reinterpret_cast<USB_FD_CONFIGURATION_DESCRIPTOR *>(buf);
|
382
|
382
|
#endif
|
383
|
383
|
|
384
|
384
|
ei.address = addrPool.AllocAddress(parent, IsHub(ei.klass), port);
|
|
@@ -415,9 +415,9 @@ again:
|
415
|
415
|
HOST_DEBUG("configs: %i\r\n", configs);
|
416
|
416
|
for(uint8_t conf = 0; (!rcode) && (conf < configs); conf++) {
|
417
|
417
|
// read the config descriptor into a buffer.
|
418
|
|
- rcode = getConfDescr(ei.address, sizeof (USB_CONFIGURATION_DESCRIPTOR), conf, buf);
|
|
418
|
+ rcode = getConfDescr(ei.address, sizeof (USB_FD_CONFIGURATION_DESCRIPTOR), conf, buf);
|
419
|
419
|
if(rcode) {
|
420
|
|
- HOST_DEBUG("Configuring error: %2.2x Can't get USB_INTERFACE_DESCRIPTOR\r\n", rcode);
|
|
420
|
+ HOST_DEBUG("Configuring error: %2.2x Can't get USB_FD_INTERFACE_DESCRIPTOR\r\n", rcode);
|
421
|
421
|
rcode = UHS_HOST_ERROR_FailGetConfDescr;
|
422
|
422
|
continue;
|
423
|
423
|
}
|
|
@@ -438,7 +438,7 @@ again:
|
438
|
438
|
uint8_t offset;
|
439
|
439
|
rcode = initDescrStream(&ei, ucd, pep, data, &left, &read, &offset);
|
440
|
440
|
if(rcode) {
|
441
|
|
- HOST_DEBUG("Configuring error: %2.2x Can't get USB_INTERFACE_DESCRIPTOR stream.\r\n", rcode);
|
|
441
|
+ HOST_DEBUG("Configuring error: %2.2x Can't get USB_FD_INTERFACE_DESCRIPTOR stream.\r\n", rcode);
|
442
|
442
|
break;
|
443
|
443
|
}
|
444
|
444
|
for(; (numinf) && (!rcode); inf++) {
|
|
@@ -451,7 +451,7 @@ again:
|
451
|
451
|
break;
|
452
|
452
|
}
|
453
|
453
|
if(rcode) {
|
454
|
|
- HOST_DEBUG("Configuring error: %2.2x Can't close USB_INTERFACE_DESCRIPTOR stream.\r\n", rcode);
|
|
454
|
+ HOST_DEBUG("Configuring error: %2.2x Can't close USB_FD_INTERFACE_DESCRIPTOR stream.\r\n", rcode);
|
455
|
455
|
continue;
|
456
|
456
|
}
|
457
|
457
|
rcode = TestInterface(&ei);
|
|
@@ -471,9 +471,9 @@ again:
|
471
|
471
|
if(!bestsuccess) rcode = UHS_HOST_ERROR_DEVICE_NOT_SUPPORTED;
|
472
|
472
|
}
|
473
|
473
|
if(!rcode) {
|
474
|
|
- rcode = getConfDescr(ei.address, sizeof (USB_CONFIGURATION_DESCRIPTOR), bestconf, buf);
|
|
474
|
+ rcode = getConfDescr(ei.address, sizeof (USB_FD_CONFIGURATION_DESCRIPTOR), bestconf, buf);
|
475
|
475
|
if(rcode) {
|
476
|
|
- HOST_DEBUG("Configuring error: %2.2x Can't get USB_INTERFACE_DESCRIPTOR\r\n", rcode);
|
|
476
|
+ HOST_DEBUG("Configuring error: %2.2x Can't get USB_FD_INTERFACE_DESCRIPTOR\r\n", rcode);
|
477
|
477
|
rcode = UHS_HOST_ERROR_FailGetConfDescr;
|
478
|
478
|
}
|
479
|
479
|
}
|
|
@@ -497,7 +497,7 @@ again:
|
497
|
497
|
uint8_t offset;
|
498
|
498
|
rcode = initDescrStream(&ei, ucd, pep, data, &left, &read, &offset);
|
499
|
499
|
if(rcode) {
|
500
|
|
- HOST_DEBUG("Configuring error: %2.2x Can't get USB_INTERFACE_DESCRIPTOR stream.\r\n", rcode);
|
|
500
|
+ HOST_DEBUG("Configuring error: %2.2x Can't get USB_FD_INTERFACE_DESCRIPTOR stream.\r\n", rcode);
|
501
|
501
|
} else {
|
502
|
502
|
for(; (numinf) && (!rcode); inf++) {
|
503
|
503
|
// iterate for each interface on this config
|
|
@@ -508,7 +508,7 @@ again:
|
508
|
508
|
break;
|
509
|
509
|
}
|
510
|
510
|
if(rcode) {
|
511
|
|
- HOST_DEBUG("Configuring error: %2.2x Can't close USB_INTERFACE_DESCRIPTOR stream.\r\n", rcode);
|
|
511
|
+ HOST_DEBUG("Configuring error: %2.2x Can't close USB_FD_INTERFACE_DESCRIPTOR stream.\r\n", rcode);
|
512
|
512
|
continue;
|
513
|
513
|
}
|
514
|
514
|
|
|
@@ -721,7 +721,7 @@ uint8_t UHS_USB_HOST_BASE::inTransfer(uint8_t addr, uint8_t ep, uint16_t *nbytes
|
721
|
721
|
* @param offset
|
722
|
722
|
* @return zero for success or error code
|
723
|
723
|
*/
|
724
|
|
-uint8_t UHS_USB_HOST_BASE::initDescrStream(ENUMERATION_INFO *ei, USB_CONFIGURATION_DESCRIPTOR *ucd, UHS_EpInfo *pep, uint8_t *data, uint16_t *left, uint16_t *read, uint8_t *offset) {
|
|
724
|
+uint8_t UHS_USB_HOST_BASE::initDescrStream(ENUMERATION_INFO *ei, USB_FD_CONFIGURATION_DESCRIPTOR *ucd, UHS_EpInfo *pep, uint8_t *data, uint16_t *left, uint16_t *read, uint8_t *offset) {
|
725
|
725
|
if(!ei || !ucd) return UHS_HOST_ERROR_BAD_ARGUMENT;
|
726
|
726
|
if(!pep) return UHS_HOST_ERROR_NULL_EPINFO;
|
727
|
727
|
*left = ucd->wTotalLength;
|
|
@@ -837,7 +837,7 @@ uint8_t UHS_USB_HOST_BASE::getNextInterface(ENUMERATION_INFO *ei, UHS_EpInfo *pe
|
837
|
837
|
return rcode;
|
838
|
838
|
}
|
839
|
839
|
|
840
|
|
-uint8_t UHS_USB_HOST_BASE::seekInterface(ENUMERATION_INFO *ei, uint16_t inf, USB_CONFIGURATION_DESCRIPTOR *ucd) {
|
|
840
|
+uint8_t UHS_USB_HOST_BASE::seekInterface(ENUMERATION_INFO *ei, uint16_t inf, USB_FD_CONFIGURATION_DESCRIPTOR *ucd) {
|
841
|
841
|
if(!ei || !ucd) return UHS_HOST_ERROR_BAD_ARGUMENT;
|
842
|
842
|
uint8_t data[ei->bMaxPacketSize0];
|
843
|
843
|
UHS_EpInfo *pep;
|