linux/drivers/usb/serial/sierra.c

// SPDX-License-Identifier: GPL-2.0
/*
  USB Driver for Sierra Wireless

  Copyright (C) 2006, 2007, 2008  Kevin Lloyd <[email protected]>,

  Copyright (C) 2008, 2009  Elina Pasheva, Matthew Safar, Rory Filer
			<[email protected]>

  IMPORTANT DISCLAIMER: This driver is not commercially supported by
  Sierra Wireless. Use at your own risk.

  Portions based on the option driver by Matthias Urlichs <[email protected]>
  Whom based his on the Keyspan driver by Hugh Blemings <[email protected]>
*/
/* Uncomment to log function calls */
/* #define DEBUG */

#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
/* MAX_TRANSFER is chosen so that the VM is not stressed by
   allocations > PAGE_SIZE and the number of packets in a page
   is an integer 512 is the largest possible packet on EHCI */

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)
{}

/* interfaces with higher memory requirements */
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 =;

/* 'ignorelist' of interfaces not served by this driver */
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)
{}

/* Write */
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)
{}

/* Caller must hold susp_lock. */
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();