zero.c (4ba24fef3eb3b142197135223b90ced2f319cd53) zero.c (2c247804796bbcaa90087f2196f68fdc20a5fe04)
1/*
2 * zero.c -- Gadget Zero, for USB development
3 *
4 * Copyright (C) 2003-2008 David Brownell
5 * Copyright (C) 2008 by Nokia Corporation
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by

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

63static bool loopdefault = 0;
64module_param(loopdefault, bool, S_IRUGO|S_IWUSR);
65
66static struct usb_zero_options gzero_options = {
67 .isoc_interval = GZERO_ISOC_INTERVAL,
68 .isoc_maxpacket = GZERO_ISOC_MAXPACKET,
69 .bulk_buflen = GZERO_BULK_BUFLEN,
70 .qlen = GZERO_QLEN,
1/*
2 * zero.c -- Gadget Zero, for USB development
3 *
4 * Copyright (C) 2003-2008 David Brownell
5 * Copyright (C) 2008 by Nokia Corporation
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by

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

63static bool loopdefault = 0;
64module_param(loopdefault, bool, S_IRUGO|S_IWUSR);
65
66static struct usb_zero_options gzero_options = {
67 .isoc_interval = GZERO_ISOC_INTERVAL,
68 .isoc_maxpacket = GZERO_ISOC_MAXPACKET,
69 .bulk_buflen = GZERO_BULK_BUFLEN,
70 .qlen = GZERO_QLEN,
71 .int_interval = GZERO_INT_INTERVAL,
72 .int_maxpacket = GZERO_INT_MAXPACKET,
73};
74
75/*-------------------------------------------------------------------------*/
76
77/* Thanks to NetChip Technologies for donating this product ID.
78 *
79 * DO NOT REUSE THESE IDs with a protocol-incompatible driver!! Ever!!
80 * Instead: allocate your own, using normal USB-IF procedures.

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

263
264module_param_named(isoc_mult, gzero_options.isoc_mult, uint, S_IRUGO|S_IWUSR);
265MODULE_PARM_DESC(isoc_mult, "0 - 2 (hs/ss only)");
266
267module_param_named(isoc_maxburst, gzero_options.isoc_maxburst, uint,
268 S_IRUGO|S_IWUSR);
269MODULE_PARM_DESC(isoc_maxburst, "0 - 15 (ss only)");
270
71};
72
73/*-------------------------------------------------------------------------*/
74
75/* Thanks to NetChip Technologies for donating this product ID.
76 *
77 * DO NOT REUSE THESE IDs with a protocol-incompatible driver!! Ever!!
78 * Instead: allocate your own, using normal USB-IF procedures.

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

261
262module_param_named(isoc_mult, gzero_options.isoc_mult, uint, S_IRUGO|S_IWUSR);
263MODULE_PARM_DESC(isoc_mult, "0 - 2 (hs/ss only)");
264
265module_param_named(isoc_maxburst, gzero_options.isoc_maxburst, uint,
266 S_IRUGO|S_IWUSR);
267MODULE_PARM_DESC(isoc_maxburst, "0 - 15 (ss only)");
268
271module_param_named(int_interval, gzero_options.int_interval, uint,
272 S_IRUGO|S_IWUSR);
273MODULE_PARM_DESC(int_interval, "1 - 16");
274
275module_param_named(int_maxpacket, gzero_options.int_maxpacket, uint,
276 S_IRUGO|S_IWUSR);
277MODULE_PARM_DESC(int_maxpacket, "0 - 1023 (fs), 0 - 1024 (hs/ss)");
278
279module_param_named(int_mult, gzero_options.int_mult, uint, S_IRUGO|S_IWUSR);
280MODULE_PARM_DESC(int_mult, "0 - 2 (hs/ss only)");
281
282module_param_named(int_maxburst, gzero_options.int_maxburst, uint,
283 S_IRUGO|S_IWUSR);
284MODULE_PARM_DESC(int_maxburst, "0 - 15 (ss only)");
285
286static struct usb_function *func_lb;
287static struct usb_function_instance *func_inst_lb;
288
289module_param_named(qlen, gzero_options.qlen, uint, S_IRUGO|S_IWUSR);
290MODULE_PARM_DESC(qlen, "depth of loopback queue");
291
292static int __init zero_bind(struct usb_composite_dev *cdev)
293{

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

313 return PTR_ERR(func_inst_ss);
314
315 ss_opts = container_of(func_inst_ss, struct f_ss_opts, func_inst);
316 ss_opts->pattern = gzero_options.pattern;
317 ss_opts->isoc_interval = gzero_options.isoc_interval;
318 ss_opts->isoc_maxpacket = gzero_options.isoc_maxpacket;
319 ss_opts->isoc_mult = gzero_options.isoc_mult;
320 ss_opts->isoc_maxburst = gzero_options.isoc_maxburst;
269static struct usb_function *func_lb;
270static struct usb_function_instance *func_inst_lb;
271
272module_param_named(qlen, gzero_options.qlen, uint, S_IRUGO|S_IWUSR);
273MODULE_PARM_DESC(qlen, "depth of loopback queue");
274
275static int __init zero_bind(struct usb_composite_dev *cdev)
276{

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

296 return PTR_ERR(func_inst_ss);
297
298 ss_opts = container_of(func_inst_ss, struct f_ss_opts, func_inst);
299 ss_opts->pattern = gzero_options.pattern;
300 ss_opts->isoc_interval = gzero_options.isoc_interval;
301 ss_opts->isoc_maxpacket = gzero_options.isoc_maxpacket;
302 ss_opts->isoc_mult = gzero_options.isoc_mult;
303 ss_opts->isoc_maxburst = gzero_options.isoc_maxburst;
321 ss_opts->int_interval = gzero_options.int_interval;
322 ss_opts->int_maxpacket = gzero_options.int_maxpacket;
323 ss_opts->int_mult = gzero_options.int_mult;
324 ss_opts->int_maxburst = gzero_options.int_maxburst;
325 ss_opts->bulk_buflen = gzero_options.bulk_buflen;
326
327 func_ss = usb_get_function(func_inst_ss);
328 if (IS_ERR(func_ss)) {
329 status = PTR_ERR(func_ss);
330 goto err_put_func_inst_ss;
331 }
332

--- 106 unchanged lines hidden ---
304 ss_opts->bulk_buflen = gzero_options.bulk_buflen;
305
306 func_ss = usb_get_function(func_inst_ss);
307 if (IS_ERR(func_ss)) {
308 status = PTR_ERR(func_ss);
309 goto err_put_func_inst_ss;
310 }
311

--- 106 unchanged lines hidden ---