Lines Matching refs:param
1035 struct usbtest_param *param; member
1116 for (i = 1; i < ctx->param->sglen; i++) { in ctrl_complete()
1119 % ctx->param->sglen]; in ctrl_complete()
1160 test_ctrl_queue(struct usbtest_dev *dev, struct usbtest_param *param) in test_ctrl_queue() argument
1167 if (param->sglen == 0 || param->iterations > UINT_MAX / param->sglen) in test_ctrl_queue()
1173 context.count = param->sglen * param->iterations; in test_ctrl_queue()
1176 context.param = param; in test_ctrl_queue()
1183 urb = kcalloc(param->sglen, sizeof(struct urb *), GFP_KERNEL); in test_ctrl_queue()
1186 for (i = 0; i < param->sglen; i++) { in test_ctrl_queue()
1347 for (i = 0; i < param->sglen; i++) { in test_ctrl_queue()
1366 for (i = 0; i < param->sglen; i++) { in test_ctrl_queue()
1935 test_queue(struct usbtest_dev *dev, struct usbtest_param *param, in test_queue() argument
1943 struct urb *urbs[param->sglen]; in test_queue()
1946 context.count = param->iterations * param->sglen; in test_queue()
1954 for (i = 0; i < param->sglen; i++) { in test_queue()
1957 param->length, offset); in test_queue()
1960 param->length, 0); in test_queue()
1969 packets *= param->iterations; in test_queue()
1987 for (i = 0; i < param->sglen; i++) { in test_queue()
2008 for (i = 0; i < param->sglen; i++) { in test_queue()
2027 for (i = 0; i < param->sglen; i++) { in test_queue()
2082 struct usbtest_param *param = buf; in usbtest_ioctl() local
2097 if (param->iterations <= 0) in usbtest_ioctl()
2100 if (param->sglen > MAX_SGLEN) in usbtest_ioctl()
2139 switch (param->test_num) { in usbtest_ioctl()
2152 param->length, param->iterations); in usbtest_ioctl()
2153 urb = simple_alloc_urb(udev, dev->out_pipe, param->length, 0); in usbtest_ioctl()
2159 retval = simple_io(dev, urb, param->iterations, 0, 0, "test1"); in usbtest_ioctl()
2167 param->length, param->iterations); in usbtest_ioctl()
2168 urb = simple_alloc_urb(udev, dev->in_pipe, param->length, 0); in usbtest_ioctl()
2174 retval = simple_io(dev, urb, param->iterations, 0, 0, "test2"); in usbtest_ioctl()
2178 if (dev->out_pipe == 0 || param->vary == 0) in usbtest_ioctl()
2182 param->vary, param->length, param->iterations); in usbtest_ioctl()
2183 urb = simple_alloc_urb(udev, dev->out_pipe, param->length, 0); in usbtest_ioctl()
2189 retval = simple_io(dev, urb, param->iterations, param->vary, in usbtest_ioctl()
2194 if (dev->in_pipe == 0 || param->vary == 0) in usbtest_ioctl()
2198 param->vary, param->length, param->iterations); in usbtest_ioctl()
2199 urb = simple_alloc_urb(udev, dev->in_pipe, param->length, 0); in usbtest_ioctl()
2205 retval = simple_io(dev, urb, param->iterations, param->vary, in usbtest_ioctl()
2212 if (dev->out_pipe == 0 || param->sglen == 0) in usbtest_ioctl()
2216 param->iterations, in usbtest_ioctl()
2217 param->sglen, param->length); in usbtest_ioctl()
2218 sg = alloc_sglist(param->sglen, param->length, in usbtest_ioctl()
2225 retval = perform_sglist(dev, param->iterations, dev->out_pipe, in usbtest_ioctl()
2226 &req, sg, param->sglen); in usbtest_ioctl()
2227 free_sglist(sg, param->sglen); in usbtest_ioctl()
2231 if (dev->in_pipe == 0 || param->sglen == 0) in usbtest_ioctl()
2235 param->iterations, in usbtest_ioctl()
2236 param->sglen, param->length); in usbtest_ioctl()
2237 sg = alloc_sglist(param->sglen, param->length, in usbtest_ioctl()
2244 retval = perform_sglist(dev, param->iterations, dev->in_pipe, in usbtest_ioctl()
2245 &req, sg, param->sglen); in usbtest_ioctl()
2246 free_sglist(sg, param->sglen); in usbtest_ioctl()
2249 if (dev->out_pipe == 0 || param->sglen == 0 || param->vary == 0) in usbtest_ioctl()
2253 param->vary, param->iterations, in usbtest_ioctl()
2254 param->sglen, param->length); in usbtest_ioctl()
2255 sg = alloc_sglist(param->sglen, param->length, in usbtest_ioctl()
2256 param->vary, dev, dev->out_pipe); in usbtest_ioctl()
2262 retval = perform_sglist(dev, param->iterations, dev->out_pipe, in usbtest_ioctl()
2263 &req, sg, param->sglen); in usbtest_ioctl()
2264 free_sglist(sg, param->sglen); in usbtest_ioctl()
2267 if (dev->in_pipe == 0 || param->sglen == 0 || param->vary == 0) in usbtest_ioctl()
2271 param->vary, param->iterations, in usbtest_ioctl()
2272 param->sglen, param->length); in usbtest_ioctl()
2273 sg = alloc_sglist(param->sglen, param->length, in usbtest_ioctl()
2274 param->vary, dev, dev->in_pipe); in usbtest_ioctl()
2280 retval = perform_sglist(dev, param->iterations, dev->in_pipe, in usbtest_ioctl()
2281 &req, sg, param->sglen); in usbtest_ioctl()
2282 free_sglist(sg, param->sglen); in usbtest_ioctl()
2290 param->iterations); in usbtest_ioctl()
2291 for (i = param->iterations; retval == 0 && i--; /* NOP */) in usbtest_ioctl()
2303 param->sglen, in usbtest_ioctl()
2304 param->iterations); in usbtest_ioctl()
2305 retval = test_ctrl_queue(dev, param); in usbtest_ioctl()
2310 if (dev->in_pipe == 0 || !param->length) in usbtest_ioctl()
2314 param->iterations, param->length); in usbtest_ioctl()
2315 for (i = param->iterations; retval == 0 && i--; /* NOP */) in usbtest_ioctl()
2317 param->length); in usbtest_ioctl()
2323 if (dev->out_pipe == 0 || !param->length) in usbtest_ioctl()
2327 param->iterations, param->length); in usbtest_ioctl()
2328 for (i = param->iterations; retval == 0 && i--; /* NOP */) in usbtest_ioctl()
2330 param->length); in usbtest_ioctl()
2342 param->iterations); in usbtest_ioctl()
2343 for (i = param->iterations; retval == 0 && i--; /* NOP */) in usbtest_ioctl()
2355 param->iterations, in usbtest_ioctl()
2356 realworld ? 1 : 0, param->length, in usbtest_ioctl()
2357 param->vary); in usbtest_ioctl()
2358 retval = ctrl_out(dev, param->iterations, in usbtest_ioctl()
2359 param->length, param->vary, 0); in usbtest_ioctl()
2364 if (dev->out_iso_pipe == 0 || param->sglen == 0) in usbtest_ioctl()
2368 param->iterations, in usbtest_ioctl()
2369 param->sglen, param->length); in usbtest_ioctl()
2371 retval = test_queue(dev, param, in usbtest_ioctl()
2377 if (dev->in_iso_pipe == 0 || param->sglen == 0) in usbtest_ioctl()
2381 param->iterations, in usbtest_ioctl()
2382 param->sglen, param->length); in usbtest_ioctl()
2384 retval = test_queue(dev, param, in usbtest_ioctl()
2396 param->length, param->iterations); in usbtest_ioctl()
2400 param->length, param->iterations, in usbtest_ioctl()
2409 param->length, param->iterations); in usbtest_ioctl()
2413 param->length, param->iterations, in usbtest_ioctl()
2423 param->length, param->iterations); in usbtest_ioctl()
2427 param->length, param->iterations, in usbtest_ioctl()
2436 param->length, param->iterations); in usbtest_ioctl()
2440 param->length, param->iterations, in usbtest_ioctl()
2450 param->iterations, in usbtest_ioctl()
2451 realworld ? 1 : 0, param->length, in usbtest_ioctl()
2452 param->vary); in usbtest_ioctl()
2453 retval = ctrl_out(dev, param->iterations, in usbtest_ioctl()
2454 param->length, param->vary, 1); in usbtest_ioctl()
2459 if (dev->out_iso_pipe == 0 || param->sglen == 0) in usbtest_ioctl()
2463 param->iterations, in usbtest_ioctl()
2464 param->sglen, param->length); in usbtest_ioctl()
2465 retval = test_queue(dev, param, in usbtest_ioctl()
2470 if (dev->in_iso_pipe == 0 || param->sglen == 0) in usbtest_ioctl()
2474 param->iterations, in usbtest_ioctl()
2475 param->sglen, param->length); in usbtest_ioctl()
2476 retval = test_queue(dev, param, in usbtest_ioctl()
2482 if (dev->out_pipe == 0 || !param->length || param->sglen < 4) in usbtest_ioctl()
2487 param->iterations, param->sglen, param->length); in usbtest_ioctl()
2488 for (i = param->iterations; retval == 0 && i > 0; --i) { in usbtest_ioctl()
2490 param->sglen, param->length); in usbtest_ioctl()
2506 param->length, param->iterations); in usbtest_ioctl()
2507 urb = simple_alloc_urb(udev, dev->out_int_pipe, param->length, in usbtest_ioctl()
2514 retval = simple_io(dev, urb, param->iterations, 0, 0, "test25"); in usbtest_ioctl()
2522 param->length, param->iterations); in usbtest_ioctl()
2523 urb = simple_alloc_urb(udev, dev->in_int_pipe, param->length, in usbtest_ioctl()
2530 retval = simple_io(dev, urb, param->iterations, 0, 0, "test26"); in usbtest_ioctl()
2535 if (dev->out_pipe == 0 || param->sglen == 0 || pattern != 0) in usbtest_ioctl()
2538 "TEST 27: bulk write %dMbytes\n", (param->iterations * in usbtest_ioctl()
2539 param->sglen * param->length) / (1024 * 1024)); in usbtest_ioctl()
2540 retval = test_queue(dev, param, in usbtest_ioctl()
2544 if (dev->in_pipe == 0 || param->sglen == 0 || pattern != 0) in usbtest_ioctl()
2547 "TEST 28: bulk read %dMbytes\n", (param->iterations * in usbtest_ioctl()
2548 param->sglen * param->length) / (1024 * 1024)); in usbtest_ioctl()
2549 retval = test_queue(dev, param, in usbtest_ioctl()
2553 do_gettimeofday(¶m->duration); in usbtest_ioctl()
2554 param->duration.tv_sec -= start.tv_sec; in usbtest_ioctl()
2555 param->duration.tv_usec -= start.tv_usec; in usbtest_ioctl()
2556 if (param->duration.tv_usec < 0) { in usbtest_ioctl()
2557 param->duration.tv_usec += 1000 * 1000; in usbtest_ioctl()
2558 param->duration.tv_sec -= 1; in usbtest_ioctl()