aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/usb/serial.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/usb/serial.h')
-rw-r--r--include/linux/usb/serial.h34
1 files changed, 21 insertions, 13 deletions
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index 474283888233..86c0b451745d 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * USB Serial Converter stuff 2 * USB Serial Converter stuff
3 * 3 *
4 * Copyright (C) 1999 - 2005 4 * Copyright (C) 1999 - 2012
5 * Greg Kroah-Hartman (greg@kroah.com) 5 * Greg Kroah-Hartman (greg@kroah.com)
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
@@ -249,6 +249,7 @@ struct usb_serial_driver {
249 249
250 int (*suspend)(struct usb_serial *serial, pm_message_t message); 250 int (*suspend)(struct usb_serial *serial, pm_message_t message);
251 int (*resume)(struct usb_serial *serial); 251 int (*resume)(struct usb_serial *serial);
252 int (*reset_resume)(struct usb_serial *serial);
252 253
253 /* serial function calls */ 254 /* serial function calls */
254 /* Called by console and by the tty layer */ 255 /* Called by console and by the tty layer */
@@ -292,16 +293,11 @@ struct usb_serial_driver {
292#define to_usb_serial_driver(d) \ 293#define to_usb_serial_driver(d) \
293 container_of(d, struct usb_serial_driver, driver) 294 container_of(d, struct usb_serial_driver, driver)
294 295
295extern int usb_serial_register_drivers(struct usb_driver *udriver, 296extern int usb_serial_register_drivers(struct usb_serial_driver *const serial_drivers[],
296 struct usb_serial_driver * const serial_drivers[]); 297 const char *name, const struct usb_device_id *id_table);
297extern void usb_serial_deregister_drivers(struct usb_driver *udriver, 298extern void usb_serial_deregister_drivers(struct usb_serial_driver *const serial_drivers[]);
298 struct usb_serial_driver * const serial_drivers[]);
299extern void usb_serial_port_softint(struct usb_serial_port *port); 299extern void usb_serial_port_softint(struct usb_serial_port *port);
300 300
301extern int usb_serial_probe(struct usb_interface *iface,
302 const struct usb_device_id *id);
303extern void usb_serial_disconnect(struct usb_interface *iface);
304
305extern int usb_serial_suspend(struct usb_interface *intf, pm_message_t message); 301extern int usb_serial_suspend(struct usb_interface *intf, pm_message_t message);
306extern int usb_serial_resume(struct usb_interface *intf); 302extern int usb_serial_resume(struct usb_interface *intf);
307 303
@@ -400,8 +396,8 @@ do { \
400 396
401/* 397/*
402 * module_usb_serial_driver() - Helper macro for registering a USB Serial driver 398 * module_usb_serial_driver() - Helper macro for registering a USB Serial driver
403 * @__usb_driver: usb_driver struct to register
404 * @__serial_drivers: list of usb_serial drivers to register 399 * @__serial_drivers: list of usb_serial drivers to register
400 * @__ids: all device ids that @__serial_drivers bind to
405 * 401 *
406 * Helper macro for USB serial drivers which do not do anything special 402 * Helper macro for USB serial drivers which do not do anything special
407 * in module init/exit. This eliminates a lot of boilerplate. Each 403 * in module init/exit. This eliminates a lot of boilerplate. Each
@@ -409,9 +405,21 @@ do { \
409 * module_init() and module_exit() 405 * module_init() and module_exit()
410 * 406 *
411 */ 407 */
412#define module_usb_serial_driver(__usb_driver, __serial_drivers) \ 408#define usb_serial_module_driver(__name, __serial_drivers, __ids) \
413 module_driver(__usb_driver, usb_serial_register_drivers, \ 409static int __init usb_serial_module_init(void) \
414 usb_serial_deregister_drivers, __serial_drivers) 410{ \
411 return usb_serial_register_drivers(__serial_drivers, \
412 __name, __ids); \
413} \
414module_init(usb_serial_module_init); \
415static void __exit usb_serial_module_exit(void) \
416{ \
417 usb_serial_deregister_drivers(__serial_drivers); \
418} \
419module_exit(usb_serial_module_exit);
420
421#define module_usb_serial_driver(__serial_drivers, __ids) \
422 usb_serial_module_driver(KBUILD_MODNAME, __serial_drivers, __ids)
415 423
416#endif /* __LINUX_USB_SERIAL_H */ 424#endif /* __LINUX_USB_SERIAL_H */
417 425