Linux Audio

Check our new training course

Loading...
v3.1
 
 1/*
 2 * Definitions for USB serial mobile broadband cards
 3 */
 4
 5#ifndef __LINUX_USB_USB_WWAN
 6#define __LINUX_USB_USB_WWAN
 7
 8extern void usb_wwan_dtr_rts(struct usb_serial_port *port, int on);
 9extern int usb_wwan_open(struct tty_struct *tty, struct usb_serial_port *port);
10extern void usb_wwan_close(struct usb_serial_port *port);
11extern int usb_wwan_startup(struct usb_serial *serial);
12extern void usb_wwan_disconnect(struct usb_serial *serial);
13extern void usb_wwan_release(struct usb_serial *serial);
14extern int usb_wwan_write_room(struct tty_struct *tty);
15extern void usb_wwan_set_termios(struct tty_struct *tty,
16				 struct usb_serial_port *port,
17				 struct ktermios *old);
18extern int usb_wwan_tiocmget(struct tty_struct *tty);
19extern int usb_wwan_tiocmset(struct tty_struct *tty,
20			     unsigned int set, unsigned int clear);
21extern int usb_wwan_ioctl(struct tty_struct *tty,
22			  unsigned int cmd, unsigned long arg);
23extern int usb_wwan_send_setup(struct usb_serial_port *port);
24extern int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
25			  const unsigned char *buf, int count);
26extern int usb_wwan_chars_in_buffer(struct tty_struct *tty);
27#ifdef CONFIG_PM
28extern int usb_wwan_suspend(struct usb_serial *serial, pm_message_t message);
29extern int usb_wwan_resume(struct usb_serial *serial);
30#endif
31
32/* per port private data */
33
34#define N_IN_URB 4
35#define N_OUT_URB 4
36#define IN_BUFLEN 4096
37#define OUT_BUFLEN 4096
38
39struct usb_wwan_intf_private {
40	spinlock_t susp_lock;
41	unsigned int suspended:1;
 
 
42	int in_flight;
43	int (*send_setup) (struct usb_serial_port *port);
44	void *private;
45};
46
47struct usb_wwan_port_private {
48	/* Input endpoints and buffer for this port */
49	struct urb *in_urbs[N_IN_URB];
50	u8 *in_buffer[N_IN_URB];
51	/* Output endpoints and buffer for this port */
52	struct urb *out_urbs[N_OUT_URB];
53	u8 *out_buffer[N_OUT_URB];
54	unsigned long out_busy;	/* Bit vector of URBs in use */
55	int opened;
56	struct usb_anchor delayed;
57
58	/* Settings for the port */
59	int rts_state;		/* Handshaking pins (outputs) */
60	int dtr_state;
61	int cts_state;		/* Handshaking pins (inputs) */
62	int dsr_state;
63	int dcd_state;
64	int ri_state;
65
66	unsigned long tx_start_time[N_OUT_URB];
67};
68
69#endif /* __LINUX_USB_USB_WWAN */
v6.2
 1/* SPDX-License-Identifier: GPL-2.0 */
 2/*
 3 * Definitions for USB serial mobile broadband cards
 4 */
 5
 6#ifndef __LINUX_USB_USB_WWAN
 7#define __LINUX_USB_USB_WWAN
 8
 9extern void usb_wwan_dtr_rts(struct usb_serial_port *port, int on);
10extern int usb_wwan_open(struct tty_struct *tty, struct usb_serial_port *port);
11extern void usb_wwan_close(struct usb_serial_port *port);
12extern int usb_wwan_port_probe(struct usb_serial_port *port);
13extern void usb_wwan_port_remove(struct usb_serial_port *port);
14extern unsigned int usb_wwan_write_room(struct tty_struct *tty);
 
 
 
 
15extern int usb_wwan_tiocmget(struct tty_struct *tty);
16extern int usb_wwan_tiocmset(struct tty_struct *tty,
17			     unsigned int set, unsigned int clear);
 
 
 
18extern int usb_wwan_write(struct tty_struct *tty, struct usb_serial_port *port,
19			  const unsigned char *buf, int count);
20extern unsigned int usb_wwan_chars_in_buffer(struct tty_struct *tty);
21#ifdef CONFIG_PM
22extern int usb_wwan_suspend(struct usb_serial *serial, pm_message_t message);
23extern int usb_wwan_resume(struct usb_serial *serial);
24#endif
25
26/* per port private data */
27
28#define N_IN_URB 4
29#define N_OUT_URB 4
30#define IN_BUFLEN 4096
31#define OUT_BUFLEN 4096
32
33struct usb_wwan_intf_private {
34	spinlock_t susp_lock;
35	unsigned int suspended:1;
36	unsigned int use_send_setup:1;
37	unsigned int use_zlp:1;
38	int in_flight;
39	unsigned int open_ports;
40	void *private;
41};
42
43struct usb_wwan_port_private {
44	/* Input endpoints and buffer for this port */
45	struct urb *in_urbs[N_IN_URB];
46	u8 *in_buffer[N_IN_URB];
47	/* Output endpoints and buffer for this port */
48	struct urb *out_urbs[N_OUT_URB];
49	u8 *out_buffer[N_OUT_URB];
50	unsigned long out_busy;	/* Bit vector of URBs in use */
 
51	struct usb_anchor delayed;
52
53	/* Settings for the port */
54	int rts_state;		/* Handshaking pins (outputs) */
55	int dtr_state;
56	int cts_state;		/* Handshaking pins (inputs) */
57	int dsr_state;
58	int dcd_state;
59	int ri_state;
60
61	unsigned long tx_start_time[N_OUT_URB];
62};
63
64#endif /* __LINUX_USB_USB_WWAN */