#define DRIVER_AUTHOR …
#define DRIVER_DESC …
#include <linux/kernel.h>
#include <linux/jiffies.h>
#include <linux/errno.h>
#include <linux/tty.h>
#include <linux/slab.h>
#include <linux/tty_flip.h>
#include <linux/module.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>
#define SWIMS_USB_REQUEST_SetPower …
#define SWIMS_USB_REQUEST_SetNmea …
#define N_IN_URB_HM …
#define N_OUT_URB_HM …
#define N_IN_URB …
#define N_OUT_URB …
#define IN_BUFLEN …
#define MAX_TRANSFER …
static bool nmea;
struct sierra_iface_list { … };
struct sierra_intf_private { … };
static int sierra_set_power_state(struct usb_device *udev, __u16 swiState)
{ … }
static int sierra_vsc_set_nmea(struct usb_device *udev, __u16 enable)
{ … }
static int sierra_calc_num_ports(struct usb_serial *serial,
struct usb_serial_endpoints *epds)
{ … }
static bool is_listed(const u8 ifnum, const struct sierra_iface_list *list)
{ … }
static u8 sierra_interface_num(struct usb_serial *serial)
{ … }
static int sierra_probe(struct usb_serial *serial,
const struct usb_device_id *id)
{ … }
static const u8 hi_memory_typeA_ifaces[] = …;
static const struct sierra_iface_list typeA_interface_list = …;
static const u8 hi_memory_typeB_ifaces[] = …;
static const struct sierra_iface_list typeB_interface_list = …;
static const u8 direct_ip_non_serial_ifaces[] = …;
static const struct sierra_iface_list direct_ip_interface_ignore = …;
static const struct usb_device_id id_table[] = …;
MODULE_DEVICE_TABLE(usb, id_table);
struct sierra_port_private { … };
static int sierra_send_setup(struct usb_serial_port *port)
{ … }
static int sierra_tiocmget(struct tty_struct *tty)
{ … }
static int sierra_tiocmset(struct tty_struct *tty,
unsigned int set, unsigned int clear)
{ … }
static void sierra_release_urb(struct urb *urb)
{ … }
static void sierra_outdat_callback(struct urb *urb)
{ … }
static int sierra_write(struct tty_struct *tty, struct usb_serial_port *port,
const unsigned char *buf, int count)
{ … }
static void sierra_indat_callback(struct urb *urb)
{ … }
static void sierra_instat_callback(struct urb *urb)
{ … }
static unsigned int sierra_write_room(struct tty_struct *tty)
{ … }
static unsigned int sierra_chars_in_buffer(struct tty_struct *tty)
{ … }
static void sierra_stop_rx_urbs(struct usb_serial_port *port)
{ … }
static int sierra_submit_rx_urbs(struct usb_serial_port *port, gfp_t mem_flags)
{ … }
static struct urb *sierra_setup_urb(struct usb_serial *serial, int endpoint,
int dir, void *ctx, int len,
gfp_t mem_flags,
usb_complete_t callback)
{ … }
static void sierra_close(struct usb_serial_port *port)
{ … }
static int sierra_open(struct tty_struct *tty, struct usb_serial_port *port)
{ … }
static void sierra_dtr_rts(struct usb_serial_port *port, int on)
{ … }
static int sierra_startup(struct usb_serial *serial)
{ … }
static void sierra_release(struct usb_serial *serial)
{ … }
static int sierra_port_probe(struct usb_serial_port *port)
{ … }
static void sierra_port_remove(struct usb_serial_port *port)
{ … }
#ifdef CONFIG_PM
static void stop_read_write_urbs(struct usb_serial *serial)
{ … }
static int sierra_suspend(struct usb_serial *serial, pm_message_t message)
{ … }
static int sierra_submit_delayed_urbs(struct usb_serial_port *port)
{ … }
static int sierra_resume(struct usb_serial *serial)
{ … }
#else
#define sierra_suspend …
#define sierra_resume …
#endif
static struct usb_serial_driver sierra_device = …;
static struct usb_serial_driver * const serial_drivers[] = …;
module_usb_serial_driver(…);
MODULE_AUTHOR(…);
MODULE_DESCRIPTION(…);
MODULE_LICENSE(…) …;
module_param(nmea, bool, 0644);
MODULE_PARM_DESC(…) …;