diff options
author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-06 10:31:35 -0700 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-06-17 13:34:15 -0700 |
commit | 455b4f7e18e741c0603f9030f9a1897f4c5150c1 (patch) | |
tree | 73e4ebe545f7b660afe800599eaf3334bf656c81 /drivers/usb/serial/usb-serial.c | |
parent | e5b1e2062e0535e8ffef79bb34d857e21380d101 (diff) | |
download | op-kernel-dev-455b4f7e18e741c0603f9030f9a1897f4c5150c1.zip op-kernel-dev-455b4f7e18e741c0603f9030f9a1897f4c5150c1.tar.gz |
USB: serial: increase the number of devices we support
We had the limit of 255 USB to serial devices on one system for almost
15 years, with no complaints. But now it's time to move on from these
tiny "baby" systems, and bump the number up to 512, which should last
us a few more years:
"512 is a nice number" -- Tobias Winter
Note, this is still a static value, and uses up tty core memory with
this many tty devices allocated. Converting the driver to use
TTY_DRIVER_DYNAMIC_DEV is the next thing to do in order to remove this
limitation.
Reported-by: Tobias Winter <tobias@linuxdingsda.de>
Tested-by: Tobias Winter <tobias@linuxdingsda.de>
Reviewed-by: Johan Hovold <jhovold@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/usb/serial/usb-serial.c')
-rw-r--r-- | drivers/usb/serial/usb-serial.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/usb/serial/usb-serial.c b/drivers/usb/serial/usb-serial.c index e2e131f..cb27fcb 100644 --- a/drivers/usb/serial/usb-serial.c +++ b/drivers/usb/serial/usb-serial.c @@ -43,6 +43,9 @@ #define DRIVER_AUTHOR "Greg Kroah-Hartman <gregkh@linuxfoundation.org>" #define DRIVER_DESC "USB Serial Driver core" +#define USB_SERIAL_TTY_MAJOR 188 +#define USB_SERIAL_TTY_MINORS 512 /* should be enough for a while */ + /* There is no MODULE_DEVICE_TABLE for usbserial.c. Instead the MODULE_DEVICE_TABLE declarations in each serial driver cause the "hotplug" program to pull in whatever module is necessary @@ -449,7 +452,7 @@ static int serial_proc_show(struct seq_file *m, void *v) char tmp[40]; seq_puts(m, "usbserinfo:1.0 driver:2.0\n"); - for (i = 0; i < SERIAL_TTY_MINORS; ++i) { + for (i = 0; i < USB_SERIAL_TTY_MINORS; ++i) { port = usb_serial_port_get_by_minor(i); if (port == NULL) continue; @@ -1217,7 +1220,7 @@ static int __init usb_serial_init(void) { int result; - usb_serial_tty_driver = alloc_tty_driver(SERIAL_TTY_MINORS); + usb_serial_tty_driver = alloc_tty_driver(USB_SERIAL_TTY_MINORS); if (!usb_serial_tty_driver) return -ENOMEM; @@ -1230,7 +1233,7 @@ static int __init usb_serial_init(void) usb_serial_tty_driver->driver_name = "usbserial"; usb_serial_tty_driver->name = "ttyUSB"; - usb_serial_tty_driver->major = SERIAL_TTY_MAJOR; + usb_serial_tty_driver->major = USB_SERIAL_TTY_MAJOR; usb_serial_tty_driver->minor_start = 0; usb_serial_tty_driver->type = TTY_DRIVER_TYPE_SERIAL; usb_serial_tty_driver->subtype = SERIAL_TYPE_NORMAL; |