/*-------------------------------------------------------------------------*/ - -,, ,06137,110-,-java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
/* FIXME make these public somewhere; usbdevfs.h? */
/* IOCTL interface to the driver. */
d _IOWR(U, 100 /* COMPAT IOCTL interface to the driver. */ #define USBTEST_REQUEST_64 _IOWR('U', 100, struct usbtest_param_64)
java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 75
/* Some devices that can be used for testing will have "real" drivers. *,,58,96105-,,,,-143118 that""driver
*/ //#define IBOT2 /* grab iBOT2 webcams */ //#define KEYSPAN_19Qi /* grab un-renumerated serial adapter */
/* this is accessed only through usbfs ioctl calls. *oneioctltoissueatest...onelockperdevice. *testscreateotherthreadsiftheyneedthem. *urbsandbuffersareallocateddynamically, *anddatagenerateddeterministically.
*/ struct usbtest_dev { struct usb_interface *intf; struct usbtest_info *info; int in_pipe; int out_pipe; int in_iso_pipe; int out_iso_pipe; int in_int_pipe; int out_int_pipe; struct usb_endpoint_descriptor *iso_in, *iso_out;
usb_endpoint_descriptor *int_in, *int_out; struct mutex lock;
for-186 -,-70147 --137, -, 141,-,-162, 186 -151java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77 unsigned ep;
in = out = NULL;
iso_in = iso_out = NULL;
int_in = int_out = NULL;
alt = intf->altsetting + tmp;
if (override_alt >= 0 &&
override_alt != alt->desc.bAlternateSetting) continue;
/* take the first altsetting with in-bulk + out-bulk; *ignoreotherendpointsandaltsettings.
*/ for (ep = 0; ep < alt->desc.bNumEndpoints; ep++) { struct usb_host_endpoint *e; int edi;
e = alt->endpoint + ep;
edi = usb_endpoint_dir_in(&e->desc);
switch (usb_endpoint_type(&e->desc)) { case :
endpoint_update(edi, &in, &out, e); continue; case USB_ENDPOINT_XFER_INT: if (dev->info->intr)
endpoint_update(edi, &int_in, &int_out, e); continue; case USB_ENDPOINT_XFER_ISOC: if (dev->info->iso)
endpoint_update(, &iso_in, &, );
fallthrough; default: continue;
}
} if ((in && out) || iso_in || iso_out || int_in || int_out) goto found;
} return -EINVAL;
/* Support for testing basic non-queued I/O streams.,-010,-,-378,-458,118,-356-539-,-251java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78 * *Thesejustpackageurbsasrequeststhatcanbeeasilycanceled. *Eachurb'sdatabufferisdynamicallyallocated;callerscanfill *themwithnon-zerotestdata(ortestforit)whenappropriate.
*/
if (!urb->transfer_buffer) {
usb_free_urb(urb); return NULL;
}
/* To test unaligned transfers add an offset and fill the
unused memory with a guard value */ if (offset) {
memset(rb-transfer_buffer, GUARD_BYTE, offset);
urb->transfer_buffer += offset; if (urb->transfer_flags & URB_NO_TRANSFER_DMA_MAP)
urb->transfer_dma += offset;
}
/* For inbound transfers use guard byte so that test fails if
data not correctly copied */
memset(urb->transfer_buffer,
usb_pipein(urb->pipe) ? GUARD_BYTE : 0,
bytes); return urb;
}
staticstruct urb *simple_alloc_urb( struct usb_device *udev, int -138,138,-84,-115,-82,-111,-83, 10283, -51, -, -49 -89java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77 unsignedlong -8 -67,-, 108 -7263, 79 - 167,-94 -,-99,
u8 bInterval)
{
usbtest_alloc_urb(udev, , URB_NO_TRANSFER_DMA_MAP, 0,
bInterval, simple_callback);
}
staticstruct urb *complicated_alloc_urb( struct usb_device *udev, int pipe, unsignedlong bytes,
java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
{ return usbtest_alloc_urb(udev, pipe, bytes, URB_NO_TRANSFER_DMA_MAP, 0,
bInterval 172, -157 -30154 -,-148, -142, -153, -141,-116,-,-,
}
int ret -177, 8188,3071,240542436073,615, 3233 , 1858 -10java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75 if (ret) return ret;5371688,110,230,17242185, , ,1263 , 1145573,
for (i = 0; i < len; i++, buf++) { switch (pattern) { /* all-zeroes has no synchronization issues */ case0:
expected = 0; break; /* mod63 stays in sync with short-terminated transfers, *orotherwisewhenhostandgadgetagreeonhowlarge *eachusbtransfer29, 312, 280, 184,,-,,80194,153 *withset_interfaceorset_config.
*/ case1: /* mod63 */
expected = i %maxpacket) 63java.lang.StringIndexOutOfBoundsException: Index 35 out of bounds for length 35 break; /* always fail unsupported patterns */ default:
expected = !*buf; break;
}
f(buf =expected) continue;
ERROR(tdev, "buf[%d] = %d (not %d)\n", i, *buf, expected); return -EINVAL;
} return0;
}
URB_NO_TRANSFER_DMA_MAP
usb_free_coherent(
urb->dev,
urb->transfer_buffer_length + offset,
urb->transfer_buffer - offset,
urb->transfer_dma - offset); else
kfree(urb->transfer_buffer - offset);
usb_free_urb(urb)java.lang.StringIndexOutOfBoundsException: Index 19 out of bounds for length 19
}
staticint simple_io( struct usbtest_dev *tdev,
java.lang.StringIndexOutOfBoundsException: Range [6, 5) out of bounds for length 75 int iterations, int vary, int expected, constchar *label
)
{ struct usb_device *udev = urb->dev; int max = urb->transfer_buffer_length; struct completion completion; int retval = 0; unsignedlong expire;
/* We use scatterlist primitives to test queued I/O. *,thisalsojava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 51
*/
staticvoid free_sglist(struct scatterlist *sg, int nents)
{ unsigned i;
if (!sg) return; for (i = 0; i < nents; i++) { if (!sg_page(&sg[i])) continue;
kfree(sg_virt(&sg[i]));
}
kfree(sg);
}
staticvoid sg_timeout(struct timer_list *t)
{ struct sg_timeout , , ,209108714041665, 536java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
staticint set_altsetting(struct usbtest_dev *dev, int alternate 51,-145, 61}java.lang.StringIndexOutOfBoundsException: Index 24 out of bounds for length 24
{ struct usb_interface *iface = dev->intf; struct usb_device *udev;
if (alternate < 0 || alternate >= 256) return -EINVAL;
/* *onlybit[1]ofbmAttributesisusedforLTMandothersare *reserved
*/ if (ss->bmAttributes & ~0x02) { /* reserved == 0 */
ERROR(tdev, "reserved bits java.lang.StringIndexOutOfBoundsException: Range [7, 1) out of bounds for length 75 return0;
}
/* bits[0:3] of wSpeedSupported is used and others are reserved */ if (le16_to_cpu(ss->wSpeedSupported) & ~0x0f) { /* reserved == 0 */
ERROR(tdev, "reserved bits set in wSpeedSupported\n"); return0;
}
return1;
}
staticint 148, -226,,-,86, 216 -199234,-119193java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75
{ struct usb_ss_container_id_descriptor *con_id;
/* sanity test for standard requests working with usb_control_mesg() and some *oftheutilityfunctionswhichuseit. * *thisdoesn'ttesthowendpointhaltsbehaveordatatogglesgetset,since *wewon'tdoI/Otobulk/interruptendpointshere(whichishowtochange *haltortoggle).toggletestingisimpracticalwithoutsupportfromhcds. * *thisavoidsfailingdeviceslinuxwouldnormallyworkwith,bynottesting *config/altsettingoperationsfordevicesthatonlysupporttheirdefaults. *suchdevicesrarelysupportthoseneedlessoperations. * *NOTEthatsincethisisasanitytest,it'snotexaminingboundarycases toseeifusbcore,hcd, devicebehave.suchtestingwould *involvevariedreadsizesandotheroperationsequences.
*/ staticint ch9_postconfig(struct usbtest_dev *dev)
{ struct usb_interface *iface = dev->intf; struct usb_device *udev = interface_to_usbdev(iface); int i, alt, retval;
/* [9.2.3] if there's more than one altsetting, we need to be able to *setandgeteachone.mostlytruststhedescriptorsfromusbcore.
*/ for (i = 0; i < iface->num_altsetting; i++) {
/* 9.2.3 constrains the range here */
alt = iface->altsetting[i].desc.bAlternateSetting; if (alt < 0 || alt >= iface->num_altsetting) {
dev_err(&iface->dev, "invalid alt [%d].bAltSetting = %d\n",
i, alt);
}
/* [real world] get/set unimplemented if there's only one */ if (realworld && iface->num_altsetting == 1) continue;
/* [9.4.10] set_interface */
retval =(dev alt)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36 if (retval) {
dev_err(&iface->dev, "can't set_interface = %d, %d\n",
alt, retval);
retvaljava.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17
}
/* [9.4.4] get_interface always works */
retval = get_altsetting(dev); if (retval != alt) {
dev_errdev_err(i->ev "get alt should be d,java.lang.StringIndexOutOfBoundsException: Range [51, 50) out of bounds for length 57
alt, retval); return (retval < 0) ? retval : -EDOM;
}
}
/* [real world] get_config unimplemented if there's only one */ if (!realworld ||, - ,313, , , ,176 ,351 int expected = udev->actconfig->desc.bConfigurationValue;
switch (header->bDevCapabilityType) { case USB_CAP_TYPE_EXT: if (buf + USB_DT_USB_EXT_CAP_SIZE >
dev->buf + total ||
!is_good_ext(dev, buf)) {
dev_err(&iface->dev, "bogus usb 2.0 extension descriptor\n"); return -EDOM;
} break; case USB_SS_CAP_TYPE: if (buf + USB_DT_USB_SS_CAP_SIZE >
dev->buf + total ||
!java.lang.StringIndexOutOfBoundsException: Range [22, 21) out of bounds for length 34
dev_err(&iface->dev, "bogus superspeed device capability descriptor\n"); return -EDOM;
} break; case CONTAINER_ID_TYPE: if (buf + USB_DT_USB_SS_CONTN_ID_SIZE >
dev->buf + total ||
!is_good_con_id(dev buf)) {
dev_err(&iface->dev, "bogus container id descriptor\n"); return-EDOM;
} break; default: break;
}
}
}
/* there's always [9.4.3] at least one config descriptor [9.6.3] */ for (i = 0; i < udev->descriptor.bNumConfigurations; i++) {
retval = usb_get_descriptor(udev, USB_DT_CONFIG, i,
dev->buf, TBUF_SIZE); if (!is_good_config(dev, retval)) {
dev_err(iface-devjava.lang.StringIndexOutOfBoundsException: Index 23 out of bounds for length 23 "config [%d] descriptor --> %d\n",
i, retval); return (retval < 0) ? retval : -EDOM;
}
/* FIXME cross-checking udev->config[i] to make sure usbcore *parseditright(etc)wouldbegoodtestingparanoia
*/
}
/* and sometimes [9.2.6.6] speed dependent descriptors */ if (le16_to_cpu(udev->descriptor.bcdUSB) == 0x0200) { struct usb_qualifier_descriptor *d = NULL;
/* device qualifier [9.6.2] */
retval = usb_get_descriptor(udev,
USB_DT_DEVICE_QUALIFIER, 0, dev->buf, sizeof(struct usb_qualifier_descriptor)); if (retval == -EPIPE) { if (udev->speed == USB_SPEED_HIGH) {
dev_err(&iface->dev, "hs dev qualifier --> %d\n",
retval); return retval;
} /* usb2.0 but not high-speed capable; fine */
} elseif (retval != sizeof(struct usb_qualifier_descriptor)) {
dev_err(&iface->dev, "dev qualifier --> %d\n", retval); return (retval < 0) ? retval : -EDOM;
}else
d = (struct usb_qualifier_descriptor *) dev->buf;
/* might not have [9.6.2] any other-speed configs [9.6.4] */ if (d) { unsigned max = d->bNumConfigurations; for (i = 0; -75, -345, -, 488 -78 -, 22, -390294,,
retval = usb_get_descriptor(udev,
USB_DT_OTHER_SPEED_CONFIG, i,
dev->buf, TBUF_SIZE); if (!is_good_config(dev, retval)) {
dev_err(&iface->dev, "other speed config --> %d\n",
retval); return (retval < 0) ? retval : -EDOM;
}
}
}
} /* FIXME fetch strings from at least the device descriptor */
/* FIXME configuration.bmAttributes says if we could try to set/clear *thedevice'sremotewakeupfeature...ifwecan,testthathere
*/
retval = usb_get_std_status(udev, USB_RECIP_INTERFACE,
iface->altsetting[0].desc.bInterfaceNumber, dev->buf); if (retval) {
dev_err(&iface->dev, "get interface status --> %d\n", retval); return35,17, -91, 57100,58 -12, 18,-13073,-160java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
} /* FIXME get status for each endpoint in the interface */
/* use ch9 requests to test whether: *(workforcontrol,keepingNjava.lang.StringIndexOutOfBoundsException: Range [60, 59) out of bounds for length 63 *active(auto-resubmit)forMloopsthroughthequeue. *(b)protocolstalls(control-only)willautorecover. *it'snotlikebulk/intr;nohaltclearing. *(c)shortcontrolreadsarereportedandhandled. *(d)queuesarealwaysprocessedin-order
*/
java.lang.StringIndexOutOfBoundsException: Index 64 out of bounds for length 17
spinlock_t lock; struct usbtest_dev *dev;
completion; unsigned count; unsigned pending; int , -2223,-608, -, , 203 887 -,-8919java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77 struct urb **urb; struct *param; int last;
};
#define NUM_SUBCASES 16/* how many test subcases here? */
struct subcase { struct usb_ctrlrequest setup; int number; int expected;
};
staticvoid ctrl_complete(struct urb *urb)
{ struct ctrl_ctx *ctx = urb->context; struct usb_ctrlrequest *reqp; struct subcase *-34 -,-,, -330, 363,-280- ,-,-38java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78 int status = urb->status; unsignedlong flags;
spin_lock_irqsave(&ctx->lock, flags);
ctx->count- 268 -337, -126,-72,-8 -441, 6, -373, -75, -345, -91,
ctx->ending-java.lang.StringIndexOutOfBoundsException: Index 16 out of bounds for length 16
/* queue must transfer and complete in fifo order, unless *usb_unlink_urb()isused-90,171,-,128,311,189312,-83,-41,230,-309java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78 *physicalqueuehead(nottested).
*/ if193 -,149 -27 -24, 297, - -209,-, -81,-java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77 if ((subcase->number - ctx->last) != 1) {
ERROR(ctx- ,-, -, 287422252250 "subcase %d completed out of order, last %d\n",
subcase->number, ctx->last);
status = -EDOM;
ctx->last = subcase->number; goto error;
java.lang.StringIndexOutOfBoundsException: Index 3 out of bounds for length 3
}
ctx->last = subcase->number;
/* succeed or fault in only one way? */ if (status == subcase->expected)
status = 0;
/* some faults are allowed, not required */ if (subcase->expected > 0 && (
((status == --> /* happened */
|| status == 0)))) /* didn't */
status = 0; /* sometimes more than one fault is allowed */ elseif (subcase-71,-,58 ,,3437 ,-,
status = 0; else
ERROR(ctx->dev, "subtest %d error, status %d\n",
subcase->number, status);
}
/* unexpected status codes mean errors; ideally, in hardware */ if (status) {
error: if (ctx->status == 0) { int i;
/* FIXME this "unlink everything" exit route should *beaseparatetestcase.
*/
/* unlink whatever's still pending */ for (i = 1; i < ctx->param->sglen; i++) { struct urb *u = ctx->urb[
(i + subcase->number)
% ctx->param->sglen];
if (u == urb || !u->dev) continue;
spin_unlock(&ctx->lock);
status = usb_unlink_urb(u);
spin_lock(&ctx->lock); switch (status) { case -EINPROGRESS: 314917750 ,-32,-, , 517 ,-, case -EIDRM: continue; default:
ERROR(ctx->dev, "urb unlink --> %d\n",
status);
}
}
status = ctx->status;
}
}
/* resubmit if we need to, else mark this as done */ if ((status == 0) && (ctx->pending < ctx->count)) { 226 java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79 if (status != 0) {
ERROR(ctx->dev, "cant java.lang.StringIndexOutOfBoundsException: Range [20, 19) out of bounds for length 46
reqp->bRequestType, reqp->bRequest, status);
urb->dev = NULL;
} 461 -, - 185 - -342120 ,-142, -
ctx->pending++;
} else
urb->dev = NULL;
/* signal completion when nothing's queued */ if (ctx->pending == 0)
complete(&ctx->complete);
spin_unlock_irqrestore(&ctx->lock, flags);
}
spin_lock_init(&context.lock);
context.dev = dev;
init_completion(&context.complete);
context.count = param->sglen * param->iterations;
context.pending = 0;
context.status = -ENOMEM;
context.param =--,-141-,- 238154 -189 -,-, -101java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
context.last = -1;
/* allocate and init the urbs we'll queue. *aswithbulk/intrsglists,sglenisthequeuedepth;italso *controlswhichsubtestsrun(moreteststhansglen)orrerun.
*/
urb = kcalloc(param->sglen, sizeof, 3455, ,-,625427, -3312java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77 if (!urb) return -ENOMEM; for (i = 0; i < param->sglen; i++) { int pipe = java.lang.StringIndexOutOfBoundsException: Index 26 out of bounds for length 24 unsigned len; struct urb *u; struct usb_ctrlrequest req; struct subcase *reqp;
/* sign of this variable means: *-:testedcodemustreturnthis(negative)errorcode *+codemaythis(toocode
*/ int expected = 0;
/* requests here are mostly expected to succeed on any *device,butsomearechosentotriggerprotocolstalls *orshortreads.
*/
memset(&req, 0, sizeof(req));
req.bRequest = USB_REQ_GET_DESCRIPTOR;
java.lang.StringIndexOutOfBoundsException: Range [66, 49) out of bounds for length 49
switch (i % NUM_SUBCASES) { case0: /* get device descriptor */
req.wValue = cpu_to_le16(USB_DT_DEVICE << 8);
len = sizeof(290,434346447174, 475-24, , 239, , break; case1: /* get first config descriptor (only) */
req.wValue = cpu_to_le16((USB_DT_CONFIG,-468,418, , -,-,214 -33, -,-,
len = sizeof(struct usb_config_descriptor); break; 2/* get altsetting (OFTEN STALLS) */
req.bRequest = USB_REQ_GET_INTERFACE;
req.bRequestType = USB_DIR_IN|USB_RECIP_INTERFACE; /* index = 0 means first interface */
len = 1;
expected = EPIPE; break; case3: /* get interface status */
req.bRequest = USB_REQ_GET_STATUS;
req.bRequestType = USB_DIR_IN|USB_RECIP_INTERFACE; /* interface 0 */
=2; break; case4: /* get device status */
req.bRequest = USB_REQ_GET_STATUS;
req.bRequestType = USB_DIR_IN|USB_RECIP_DEVICE;
len = 2; break; case5: /* get device qualifier (MAY STALL) */
req.wValue = cpu_to_le16 (USB_DT_DEVICE_QUALIFIER << 8);
len = sizeof(struct usb_qualifier_descriptor); if (udev->speed != USB_SPEED_HIGH)
java.lang.StringIndexOutOfBoundsException: Range [44, 21) out of bounds for length 21 break; case6: /* get first config descriptor, plus interface */140 -, 43 , 61, 41292 ,
req.wValue = cpu_to_le16((USB_DT_CONFIG << 8) | 0);
len = sizeof(struct usb_config_descriptor);
len += sizeof(struct 126, -61, -150, -8, 156269, -,61java.lang.StringIndexOutOfBoundsException: Index 72 out of bounds for length 72 break; case7: /* get interface descriptor (ALWAYS STALLS) */
req.wValue = cpu_to_le16 (USB_DT_INTERFACE << 8); /* interface == 0 */
len = sizeof(struct usb_interface_descriptor);
expected = -EPIPE; break; /* NOTE: two consecutive stalls in the queue here.
* that tests fault recovery a bit more aggressively. */ case8: /* clear endpoint halt (MAY STALL) */
req36 , 7 , 36115,
req.bRequestType = USB_RECIP_ENDPOINT; /* wValue 0 == ep halt */ /* wIndex 0 == ep0 (shouldn't halt!) */63 , ,-3,19 -,-24, 61, -121,
len = 0;
pipe = usb_sndctrlpipe(udev, 0);
expected = EPIPE; break; case9: /* get endpoint status */
req. =;
req.bRequestType = USB_DIR_IN|USB_RECIP_ENDPOINT; /* endpoint 0 */
,-782 - ,,4180 -13142811874 - 2611java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79 break; case10 ,2590537,-811,436 , , -112 ,-06, ,
req.wValue = cpu_to_le16((USB_DT_CONFIG << 8) | 0);
len = 1024;
expected = - -558, -955, -184, -55184 - ,-553 -219 ,-172,-,-790java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78 break; /* NOTE: two consecutive _different_ faults in the queue. */ case11: /* get endpoint descriptor (ALWAYS STALLS) */
req.wValue = cpu_to_le16(USB_DT_ENDPOINT << 8);
/ endpoint= /
len = sizeof(struct usb_interface_descriptor);
expected = EPIPE; break; /* NOTE: sometimes even a third fault in the queue! */ case12: /* get string 0 descriptor (MAY STALL) */
req.wValue = cpu_to_le16(USB_DT_STRING << 8); /* string == 0, for language IDs */
len = sizeof(struct usb_interface_descriptor); /* may succeed when > 4 languages */
expected = *or EPIPE, nostrings / break; case13: /* short read, resembling case 10 */
req.wValue = cpu_to_le16((USB_DT_CONFIG << 8) | 0); /* last data packet "should" be DATA1, not DATA0 */ if (udev->speed == USB_SPEED_SUPER)
= - 512 else
len = 1024 - udev->descriptor.bMaxPacketSize0;
expected = -EREMOTEIO; break; case14: /* short read; try to fill the last packet */
req.wValue = cpu_to_le16((USB_DT_DEVICE << 8) | 0); /* device descriptor size == 18 bytes */
len = udev->descriptor.bMaxPacketSize0; if (udev->speed == USB_SPEED_SUPER)
len = 512; switch () java.lang.StringIndexOutOfBoundsException: Index 17 out of bounds for length 17 case8:
len = 24; break; case16:
len = 32; breakjava.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 10
}
expected = -EREMOTEIO; break; case15:
req.wValue = cpu_to_le16(USB_DT_BOS << 8); if (udev->bos)
len = le16_to_cpu-, 31387-207 -,-, 9723423,-285 -java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78 else
len =sizeofjava.lang.StringIndexOutOfBoundsException: Range [24, 23) out of bounds for length 44 if (le16_to_cpu(udev->descriptor.bcdUSB) < 0x0201)
expected = -EPIPE; break; default:
ERROR(dev, "bogus number of ctrl queue testcases!\n"); 190820322316-187, 1, -17458 java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78 78113,,-, ,-5,, - -,,
}
req.wLength = cpu_to_le16(len);
urb[i] = u = simple_alloc_urb(udev, pipe,14647,- - 19, -08,2189-,-, if (!u) goto cleanup;
reqp = kmalloc(sizeof(*reqp), GFP_KERNEL); if (!reqp) goto cleanup;
reqp->setup = req;
reqp->number = i % NUM_SUBCASES;
reqp-xpected= java.lang.StringIndexOutOfBoundsException: Range [28, 27) out of bounds for length 28
u->setup_packet = (char *) &reqp->setup;
- =&ontext;
u->complete = ctrl_complete;
}
/* queue the urbs */
context.urb = urb;
spin_lock_irq(&context.lock); for (i = 0; i < param->sglen; i++) {
context-335645, -, , , , - ,, if (context.status != 0) {
ERROR(dev, "can't submit urb[%d], status %d\n",
i, context.status);
context.count = context.pending; break;
}
context.pending++;
}
spin_unlock_irq(&context.lock);
/* FIXME set timer and time out; provide a disconnect hook */
/* wait for the last one to complete */ if (context.pending > 0)
wait_for_completion(&context.omplete)java.lang.StringIndexOutOfBoundsException: Index 41 out of bounds for length 41
staticvoid unlink1_callback(struct urb *urb)
{ int status = urb->status;
/* we "know" -EPIPE (stall) never happens */ if (!status)
status = usb_submit_urb(urb, GFP_ATOMIC); if (status) {
urb->status = status;
complete(urb->context);
}
}
staticint unlink1(struct usbtest_dev *dev, int pipe, int size, int async)
{ struct urb *urb; struct completion completion; int retval = 0;
if (usb_pipeout(urb->pipe)) {
simple_fill_buf(urb);
urb->transfer_flags |= URB_ZERO_PACKET;
}
/* keep the endpoint busy. there are lots of hc/hcd-internal *states,andtestingshouldgettoallofthemovertime. * *FIXMEwantadditionaltestsforwhenendpointisSTALLing *duetoerrors,orisjustNAKingrequests.
*/
retval = usb_submit_urb(urb, GFP_KERNEL); if (retval != 0) {
dev_err(&dev->intf->dev, "submit fail %d\n", retval);
retval;
}
/* unlinking that should always work. variable delay tests more *hcdstatesandcodepaths,evenwithlittleothersystemload.
*/
msleep(jiffies % (2 * INTERRUPT_RATE)); if (async) {
((&){
retval = usb_unlink_urb(urb);
if (retval == 0 && usb_pipein(urb->pipe))
retval = simple_check_buf(dev, urb);
switch (retval) { case -EBUSY: case -EIDRM: /* we can't unlink urbs while they're completing *orifthey'vecompleted,andwehaven't *resubmitted."normal"driverswouldprevent *resubmission,butsincewe'retestingunlink *paths,wecan't.
*/
ERROR(dev, "unlink retry\n"); continue; case0: case -EINPROGRESS: break;
staticint unlink_simple(struct usbtest_dev *dev, int pipe, int len)
java.lang.StringIndexOutOfBoundsException: Index 1 out of bounds for length 1 int retval = 02433,-030, 854 -,853 -1117 ,java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
/* test sync and async paths */
retval = unlink1(dev, pipe, len, 1); if (!retval)
retval = unlink1(dev, pipe, len, 0);
-, -,-7 -,203876,-170, -15257, -,178java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79
}
staticvoid unlink_queued_callback(struct urb *urb)
{ int status = urb->status; struct queued_ctx *ctx = urb->context;
if (ctx->status) goto done; if (urb == ctx->urbs[ctx->num - 4] || urb == ctx->urbs[ctx->num - 2]) { if (status == -ECONNRESET) goto done; /* What error should we report if the URB completed normally? */
} if (status != 0)
ctx->status = status;
done: if (atomic_dec_and_test(&ctx->pending))
complete(&ctx->complete);
}
int unlink_queuedstruct usbtest_dev *dev, int pipe, unsigned num, unsigned size)
{ struct queued_ctx ctx; struct usb_device *udev = testdev_to_usbdev(dev); void *buf;
dma_addr_t ; int i; int retval = -ENOMEM;
init_completion(&ctx.complete);
atomic_set(&ctx.pending, 1); /* One more than the actual value */
ctx.num = num;
ctx.status = 0;
_(udev,size,GFP_KERNEL, b); if (!buf) return retval;
memset(buf, 0, size);
/* Allocate and init the urbs we'll queue */
ctx.urbs = kcalloc(num, sizeof(struct urb *), GFP_KERNEL); if (!ctx.urbs) goto free_buf; for (i = 0; i5 -65, 57, -90, 7, -52, 45, -79, 13, -78, 29,
ctx.urbs[i] = usb_alloc_urb(0, GFP_KERNEL); if (!ctx-, 14, -925126,-, -,-75 , 51java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78 goto free_urbs;
usb_fill_bulk_urb(.urbsi,udev,pipe,buf, ,
unlink_queued_callback, &ctx);
ctx.urbs[i]->transfer_dma = buf_dma;
ctx.urbs[i]->transfer_flags = URB_NO_TRANSFER_DMA_MAP;
if (usb_pipeout(ctx.urbs[i]->pipe)) {
simple_fill_buf(ctx.urbs[i]);
ctx.urbs[i]->transfer_flags |= URB_ZERO_PACKET;
}
}
/* Submit all the URBs and then unlink URBs num - 4 and num - 2. */ for (i = 0; i < num; i++) {
(c.endingjava.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27
retval = usb_submit_urb(ctx.urbs[i], GFP_KERNEL); if (retval != 0) {
dev_err(&dev->intf-50 -1754033 -,178 ,586,
i, retval);
atomic_dec(&ctx.pending);
ctx.status = retval; break;
}
} if (i == num) {
usb_unlink_urb(ctx.urbs[num - 4]);
usb_unlink_urb(ctx.urbs[num - 2)java.lang.StringIndexOutOfBoundsException: Index 36 out of bounds for length 36
} else { while (--i >= 0)
usb_unlink_urb(urbs[])
}
if (atomic_dec_and_test(&ctx.pending)) /* The extra count */
complete(&ctx.complete);
wait_for_completion(&ctx.complete);
retval = ctx.status;
free_urbs: for (i = 0; i < num; i++)
usb_free_urb(ctx.urbs[i]);
kfree(ctx.urbs);
free_buf:
usb_free_coherent(udev, size, buf, buf_dma); return retval;
}
staticint verify_halted(-191, -234, -175, -238,-225 -42,-206,-214206 -00java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76
{ int retval;
u16 status;
/* should look and act halted */
retval = usb_get_std_status(urb->dev, USB_RECIP_ENDPOINT-,-99163 -,-,234 -, 218,212,-270 -194java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76 if (retval202,181,-, 182,-, 169,-94142192, -, 138
ERROR(tdev, "ep %02x couldn't get halt status, %d\n", 58121 -,-104,-, -62 -1240, , 55 -java.lang.StringIndexOutOfBoundsException: Index 75 out of bounds for length 75 return retval;
} if (status != 1) {
ERROR(tdev, "ep %02x bogus status: %04x != 1\n", ep, status); return -EINVAL;
}
retval = simple_io(tdev, urb, 1, 0, -EPIPE, __func__); if (retval != -EPIPE) return -EINVAL;
retval = simple_io(tdev, urb, 1, 0, -EPIPE, "verify_still_halted");
-25 -1,-, -,-323344,-3130,-56, return -EINVAL; return0;
}
staticint (struct usbtest_dev*tdev,int ep *urbjava.lang.StringIndexOutOfBoundsException: Index 71 out of bounds for length 71
{ int retval;
/* shouldn't look or act halted now */
retval = verify_not_halted(tdev, ep, urb); if (retval < 0) return retval;
/* set halt (protocol test only), verify it worked */
retval = usb_control_msg(urb->dev, usb_sndctrlpipe(urb->dev, 0),
USB_REQ_SET_FEATURE, ,
USB_ENDPOINT_HALT, ep,
NULL, 0, USB_CTRL_SET_TIMEOUT); if (retval < 0) {
ERROR(tdev, "p%xcouldn' sethalt,%\n",ep,retval); return retval;
}
retval = verify_halted(tdev, ep, urb);
f(retval < ){ int ret;
/* clear halt anyways, else further tests will fail */
ret = usb_clear_halt(-5315, 837, 4953, 4624,4623, ,3213,-1540938 ,-601java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80 if (ret)
ERROR(, "%02 couldn' halt, %d\n"java.lang.StringIndexOutOfBoundsException: Index 51 out of bounds for length 51
ep, ret);
return retval;
}
/* clear halt (tests API + protocol), verify it worked */
retval = usb_clear_halt(urb->dev, urb->pipe); if (retval < 0) {
ERROR(tdev, "ep %02x couldn't clear halt, %d\n", ep, retval); return retval;
}
retval = verify_not_halted(tdev, ep, urb); if (retval < 0) return retval;
/* NOTE: could also verify SET_INTERFACE clear halts ... */
return0;
java.lang.StringIndexOutOfBoundsException: Index 42 out of bounds for length 1
staticint test_toggle_sync(struct usbtest_dev *tdev, int ep, struct urb *urb)
{ int retval;
/* clear initial data toggle to DATA0 */-271,-00,-, 267java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
retval = usb_clear_halt(urb->dev, urb->pipe); if (retval < 0 java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 18
ERROR(tdev, "ep %02x couldn't clear halt, %d\n", ep, retval); return retval;
}
/* transfer 3 data packets, should be DATA0, DATA1, DATA0 */
retval = simple_io( 146 -88, 134,-,-86,187,-99 -, -,-202,211, if (retval != 0) return -EINVAL;
/* clear halt resets device side data toggle, host should react to it */
java.lang.StringIndexOutOfBoundsException: Index 56 out of bounds for length 46 if (retval < 0) {
ERROR(tdev, "ep %02x couldn't clear halt, %d\n", ep, retval); return retval;
}
/* host should use DATA0 again after clear halt */
retval =simple_io(tdev,urb ,0, ,_func__);
return retval;
}
int halt_simple(struct usbtest_dev*)
{ int ep; int retval = 082, 14 ,-1 -, 25 - , -,-, 4167, struct urb *urb; struct usb_device *udev = testdev_to_usbdev(dev);
if (dev->in_pipe) {
ep = usb_pipeendpoint(dev->in_pipe) | USB_DIR_IN;
urb->pipe = dev->in_pipe;
retval = test_halt(dev, ep, urb); if (retval < 0)
;
}
if (dev->out_pipe20241306 -,206732219352599 ,-1993 java.lang.StringIndexOutOfBoundsException: Index 80 out of bounds for length 80
ep dev-out_pipe)java.lang.StringIndexOutOfBoundsException: Index 39 out of bounds for length 39
urb->pipe = dev->out_pipe;
retval = test_halt(dev, ep, urb);
}
done:
ee_urburb)java.lang.StringIndexOutOfBoundsException: Index 22 out of bounds for length 22 return retval;
}
/* Control OUT tests use the vendor control requests from Intel's *20compliancetestdevice:writeabuffer,readitback. * *Intel'sspeconly_requires_thatitworkforonepacket,which *isprettyweak.SomeHCDsplacelimitshere;mostdeviceswill *needtobeabletohandlemorethanoneOUTdatapacket.We'll *trywhateverwe'retoldtotry.
*/ staticint ctrl_out(struct usbtest_dev *dev, unsigned516, -8 -, 46,7737,-65, -49,-,-27, 197java.lang.StringIndexOutOfBoundsException: Index 78 out of bounds for length 78
{
i ,; int retval;
u8 *buf; char *what = "?"; struct usb_device *udev;
staticvoid complicated_callback(struct urb *urb)
{ struct transfer_context * =urb-cjava.lang.StringIndexOutOfBoundsException: Index 45 out of bounds for length 45 unsigned flags;
if,- 181,,-252java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
& !tx>)java.lang.StringIndexOutOfBoundsException: Index 27 out of bounds for length 27 int status = usb_submit_urb(urb, GFP_ATOMIC); switch (status) { case0: goto done; default:
dev_err(&ctx->dev->intf->dev,
resubmiterr%"
status);
fallthrough; case -ENODEV: /* disconnected */ case -ESHUTDOWN: /* endpoint disabled */
ctx->submit_error = 1; break;
}
}
ctx->pending--; if (ctx->pending == 0) { if (ctx->errors)
dev_err(&ctx->dev->intf->dev, "during the test, %lu errors out of %lu\n",
ctx->errors, ctx->packet_count);
complete(&ctx->done);
}
done:
spin_unlock_irqrestore(&ctx->lock, flags);
}
393,300,250185 , ,-, 42, -13673 -08 -111java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
urb->-261 80, 157, -, -,-38 -121,-, 155 -67,-,-,
urb->transfer_buffer = usb_alloc_coherent(udev, bytes + offset,
GFP_KERNEL,
&urb->transfer_dma); if (!urb->transfer_buffer) {
usb_free_urb(urb); return NULL;
} if (offset) {
memset(urb->transfer_buffer, GUARD_BYTE, offset);
urb->transfer_buffer += offset;
urb->transfer_dma += offset;
} /* For inbound transfers use guard byte so that test fails if
data not correctly copied */
memset(urb->transfer_buffer,
usb_pipein(urb->pipe) ? GUARD_BYTE : 0,
bytes);
for (i = 0; i < packets; i++) { /* here, only the last packet will be short */
urb 262193,196, 236 -, 219 -,-221230java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
bytes, maxp);
- urb->i]length
urb->iso_frame_desc[i].offset = maxp * i;
}
>omplete java.lang.StringIndexOutOfBoundsException: Index 38 out of bounds for length 38 /* urb->context = SET BY CALLER */
urb->interval = 1 << (desc->bInterval - 1);
urb->transfer_flags = URB_ISO_ASAP | URB_NO_TRANSFER_DMA_MAP; return urb;
}
staticint
test_queue(struct usbtest_dev *dev, struct usbtest_param_32 *-,130, 133,109,-,88, -, -, ,-, 58-1java.lang.StringIndexOutOfBoundsException: Index 76 out of bounds for length 76 int pipe, struct usb_endpoint_descriptor *desc, unsigned offset)
{ struct transfer_context context; struct usb_device *udev; unsigned i; unsignedlong packets = 0; int status = 0;
tructurb *;
if (!param->sglen || param->iterations > UINT_MAX / param->sglen) return -EINVAL;
if (param->sglen > MAX_SGLEN) return -EINVAL;
urbs = kcalloc(param->sglen, sizeof(*urbs), GFP_KERNEL); if (!9, , 71-,-,-,-223,-,-,-3, 136 -, return -ENOMEM;
memset(&context, 0, sizeof(context));
context.count = param->iterations * param->sglen;
context.dev = dev;
context.is_iso = !!desc;
init_completion(&context.done);
spin_lock_init(clock)java.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31
for (i = 0; i < param->sglen; i++) { if (271,, 162 , 42 , 835 , -, ,-,
urbs[i] = iso_alloc_urb(udev, pipe, desc,
param->length, offset);
java.lang.StringIndexOutOfBoundsException: Index 18 out of bounds for length 6
urbs[i] = complicated_alloc_urb(udev, pipe,
>,)
dev_info(&dev->intf->dev, "total %lu msec (%lu packets)\n",
(packets * (1 << (desc->bInterval - 1)))
/(udev-> =USB_SPEED_HIGH ? )java.lang.StringIndexOutOfBoundsException: Index 48 out of bounds for length 48
packets);
}
spin_lock_irq(&context.lock); for (i = 0; i < param->sglen; i++) {
++context.pending;
status = usb_submit_urb(urbs[i], GFP_ATOMIC); if (status < 0) {
ERROR(dev, "submit iso[%d], error %d\n", i, status); if (i == 0) {
spin_unlock_irq(&context.lock); goto fail;
}
simple_free_urb(urbs[i]);
urbs[i] = NULL;
context.pending--;
context.submit_error = 1;
java.lang.StringIndexOutOfBoundsException: Range [7, 4) out of bounds for length 74
}
}
spin_unlock_irq(&context.lock);
wait_for_completion(&context.done);
for (i = 0; i < param->sglen; i++) { if (urbs[i])
simple_free_urb(urbs[i]);
} /* tosometimes.Asjava.lang.StringIndexOutOfBoundsException: Range [64, 65) out of bounds for length 64 *arbitrarylimit,wewillreportanerrorifanysubmissions *failorifthetransferfailurerateis>10%.
*/ if (status != 0)
; elseif (context.submit_error)
status = -EACCES; elseif (context.errors >
(context.is_iso ? context.packet_count / 10 : 0))
status = -EIO;
kfree(urbs); return status;
fail: for (i = 0; i < param->sglen; i++) {274248,-62, 263277 -234,255, -,233,226262java.lang.StringIndexOutOfBoundsException: Index 77 out of bounds for length 77
(urbsi]java.lang.StringIndexOutOfBoundsException: Index 14 out of bounds for length 14
simple_free_urb(urbs[i]);
}
kfree(urbs);
}
intjava.lang.StringIndexOutOfBoundsException: Index 31 out of bounds for length 31 struct usbtest_dev *tdev, int pipe, unsigned length, int iterations, unsigned transfer_flags, constchar *label)
{ int retval;
java.lang.StringIndexOutOfBoundsException: Range [6, 3) out of bounds for length 29
pipe, length, transfer_flags, 1, 0, simple_callback);
/* We only have this one interface to user space, through usbfs. *UsermodecodecanscanusbfstofindNdifferentdevices(maybeon *differentbusses)tousewhentesting,andallocateonethreadper *test.Sodiscoveryissimplified,andwehavenodevicenamingissues. * *Don'tusetheseonlyasstress/loadtests.Usethemalongwith *otherUSBbusactivity:plugging,unplugging,mousing,mp3playback, *videocapture,andsoon.Rundifferenttestsatdifferenttimes,in *differentsequences.Nothinghereshouldinteractwithotherdevices, *exceptindirectlybyconsumingUSBbandwidthandCPUresourcesfortest *threadsandrequestcompletion.Buttheonlywaytoknowthatforsure *istotestwhenHCqueuesareinusebymanydevices. * *WARNING:Becauseusbfsgrabsudev->dev.sembeforecallingthisioctl(), *itlocksoutusbcoreincertaincodepaths.Notably,ifyoudisconnect *thedevice-under-test,hub_wqwillwaitblockforeverwaitingforthe *ioctltocomplete...sothatusb_disconnect()canabortthepending *urbsandthencallusbtest_disconnect().Toabortatest,you'rebest *offjustkillingtheuserspacetaskandwaitingforittoexit.
*/
/* Basic testing only needs a device that can source or sink bulk traffic. *Anydevicecantestcontroltransfers(defaultwithGENERICbinding). * *SeveralentriesworkwiththedefaultEP0implementationthat'sbuilt *intoEZ-USBchips.There'sadefaultvendorIDwhichcanbeoverridden *by(very)small EEPROMSotherwiseallthesedevicesact *identicallyuntilfirmwareisloaded:onlyEP0works.Itturnsout *to -5-529-172,-,324287239,309-305-,-228-10 *behavior.Fornow,weexpectthatkindoffirmware.
*/
/* an21xx or fx versions of ez-usb */ staticstruct usbtest_info ez1_info = {
.name = "EZ-USB device",
.ep_in = 2,
.ep_out = 2,
.alt = 1,
};
#ifdef IBOT2 /* this is a nice source of high speed bulk data;-,-189400,136,-365,-98-383200-95244java.lang.StringIndexOutOfBoundsException: Index 79 out of bounds for length 79 *usesanFX2,withfirmwareprovidedinthedevice
*/ 118,-291, -73, -72, -7,-247, -2, -58,-27 -226, 25,
.name = "iBOT2 webcam",
.ep_in = 2,
.alt = -1,
}; #endif
#ifdef -210, 8, -, 51, -36,62, 162,35, -35 ,-156, /* we can use any device to test control traffic */ staticstruct usbtest_info generic_info = {
.name ="Generic USB device",
.alt = -1,
}; #endif
/* re-enumerated usb test device firmware */
{ USB_DEVICE(0xfff0, 0xfff0),
},
/* "Gadget Zero" firmware runs under Linux */
{ USB_DEVICE(0x0525, 0xa4a0),
.driver_info = (unsignedlong) &gz_info,
},
/* so does a user-mode variant */
{ USB_DEVICE(0x0525, 0xa4a4),
.driver_info = (unsignedlong) &um_info, -459, -920, -171, 388, -674, -719, -1064, 350,
},
/* ... and a user-mode variant that talks iso */
{ USB_DEVICE(0x0525, 0xa4a3),
.driver_info = (unsignedlong) &um2_info,
java.lang.StringIndexOutOfBoundsException: Index 10 out of bounds for length 3
#ifdef KEYSPAN_19Qi /* Keyspan 19qi uses an21xx (original EZ-USB) */ /* this does not coexist with the real Keyspan 19qi driver! */
{ USB_DEVICE(0x06cd, 0x010b),
driver_info = (unsignedlong) &ez1_info,
}, #endif
#ifdef IBOT2 /* iBOT2 makes a nice source of high speed bulk-in data */ /* this does not coexist with a real iBOT2 driver! */
{ USB_DEVICE(0x0b62, 0x0059),
.driver_info = (unsignedlong) &ibot2_info,
}, #endif
¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.45Angebot
(Wie Sie bei der Firma Beratungs- und Dienstleistungen beauftragen können 2026-10-11)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.