diff options
author | David Brownell <dbrownell@users.sourceforge.net> | 2008-08-06 21:49:57 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2008-08-13 20:32:57 -0400 |
commit | 1f1ba11b64947051fc32aa15fcccef6463b433f7 (patch) | |
tree | 546d99300dc56f4fe744385263eb3864e843f83e /drivers/usb/gadget/u_serial.h | |
parent | 630c7aa80152881980e45c11584f22476f71959b (diff) |
usb gadget: issue notifications from ACM function
Update the CDC-ACM gadget code to support the peripheral-to-host
notifications when the tty is opened or closed, or issues a BREAK.
The serial framework code calls new generic hooks; right now only
CDC-ACM uses those hooks. This resolves several REVISIT comments
in the code. (Based on a patch from Felipe Balbi.)
Note that this doesn't expose USB_CDC_CAP_BRK to the host, since
this code still rejects USB_CDC_REQ_SEND_BREAK control requests
for host-to-peripheral BREAK signaling (received via /dev/ttyGS*).
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Cc: Felipe Balbi <felipe.balbi@nokia.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb/gadget/u_serial.h')
-rw-r--r-- | drivers/usb/gadget/u_serial.h | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/usb/gadget/u_serial.h b/drivers/usb/gadget/u_serial.h index 7b561138f90e..af3910d01aea 100644 --- a/drivers/usb/gadget/u_serial.h +++ b/drivers/usb/gadget/u_serial.h | |||
@@ -23,8 +23,7 @@ | |||
23 | * style I/O using the USB peripheral endpoints listed here, including | 23 | * style I/O using the USB peripheral endpoints listed here, including |
24 | * hookups to sysfs and /dev for each logical "tty" device. | 24 | * hookups to sysfs and /dev for each logical "tty" device. |
25 | * | 25 | * |
26 | * REVISIT need TTY --> USB event flow too, so ACM can report open/close | 26 | * REVISIT at least ACM could support tiocmget() if needed. |
27 | * as carrier detect events. Model after ECM. There's more ACM state too. | ||
28 | * | 27 | * |
29 | * REVISIT someday, allow multiplexing several TTYs over these endpoints. | 28 | * REVISIT someday, allow multiplexing several TTYs over these endpoints. |
30 | */ | 29 | */ |
@@ -41,8 +40,17 @@ struct gserial { | |||
41 | 40 | ||
42 | /* REVISIT avoid this CDC-ACM support harder ... */ | 41 | /* REVISIT avoid this CDC-ACM support harder ... */ |
43 | struct usb_cdc_line_coding port_line_coding; /* 9600-8-N-1 etc */ | 42 | struct usb_cdc_line_coding port_line_coding; /* 9600-8-N-1 etc */ |
43 | |||
44 | /* notification callbacks */ | ||
45 | void (*connect)(struct gserial *p); | ||
46 | void (*disconnect)(struct gserial *p); | ||
47 | int (*send_break)(struct gserial *p, int duration); | ||
44 | }; | 48 | }; |
45 | 49 | ||
50 | /* utilities to allocate/free request and buffer */ | ||
51 | struct usb_request *gs_alloc_req(struct usb_ep *ep, unsigned len, gfp_t flags); | ||
52 | void gs_free_req(struct usb_ep *, struct usb_request *req); | ||
53 | |||
46 | /* port setup/teardown is handled by gadget driver */ | 54 | /* port setup/teardown is handled by gadget driver */ |
47 | int gserial_setup(struct usb_gadget *g, unsigned n_ports); | 55 | int gserial_setup(struct usb_gadget *g, unsigned n_ports); |
48 | void gserial_cleanup(void); | 56 | void gserial_cleanup(void); |