linux/drivers/usb/serial/ipw.c

// SPDX-License-Identifier: GPL-2.0+
/*
 * IPWireless 3G UMTS TDD Modem driver (USB connected)
 *
 *   Copyright (C) 2004 Roelf Diedericks <[email protected]>
 *   Copyright (C) 2004 Greg Kroah-Hartman <[email protected]>
 *
 * All information about the device was acquired using SnoopyPro
 * on MSFT's O/S, and examing the MSFT drivers' debug output
 * (insanely left _on_ in the enduser version)
 *
 * It was written out of frustration with the IPWireless USB modem
 * supplied by Axity3G/Sentech South Africa not supporting
 * Linux whatsoever.
 *
 * Nobody provided any proprietary information that was not already
 * available for this device.
 *
 * The modem adheres to the "3GPP TS  27.007 AT command set for 3G
 * User Equipment (UE)" standard, available from
 * http://www.3gpp.org/ftp/Specs/html-info/27007.htm
 *
 * The code was only tested the IPWireless handheld modem distributed
 * in South Africa by Sentech.
 *
 * It may work for Woosh Inc in .nz too, as it appears they use the
 * same kit.
 *
 * There is still some work to be done in terms of handling
 * DCD, DTR, RTS, CTS which are currently faked.
 * It's good enough for PPP at this point. It's based off all kinds of
 * code found in usb/serial and usb/class
 */

#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/tty.h>
#include <linux/tty_flip.h>
#include <linux/module.h>
#include <linux/spinlock.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>
#include <linux/uaccess.h>
#include "usb-wwan.h"

#define DRIVER_AUTHOR
#define DRIVER_DESC

#define IPW_TTY_MAJOR
#define IPW_TTY_MINORS

#define USB_IPW_MAGIC


/* Message sizes */
#define EVENT_BUFFER_SIZE
#define CHAR2INT16(c1, c0)

/* vendor/product pairs that are known work with this driver*/
#define IPW_VID
#define IPW_PID


/* Vendor commands: */

/* baud rates */
enum {};

/* data bits */
#define ipw_dtb_7
#define ipw_dtb_8
					/* I mean, is there a point to any other setting these days? :) */

/* usb control request types : */
#define IPW_SIO_RXCTL
#define IPW_SIO_SET_BAUD
#define IPW_SIO_SET_LINE
#define IPW_SIO_SET_PIN
#define IPW_SIO_POLL
#define IPW_SIO_INIT
#define IPW_SIO_PURGE
#define IPW_SIO_HANDFLOW
#define IPW_SIO_SETCHARS
					/* last 2 bytes contain flowcontrol chars e.g. 00 00 00 00 11 13 */

/* values used for request IPW_SIO_SET_PIN */
#define IPW_PIN_SETDTR
#define IPW_PIN_SETRTS
#define IPW_PIN_CLRDTR
#define IPW_PIN_CLRRTS

/* values used for request IPW_SIO_RXCTL */
#define IPW_RXBULK_ON
#define IPW_RXBULK_OFF

/* various 16 byte hardcoded transferbuffers used by flow control */
#define IPW_BYTES_FLOWINIT

/* Interpretation of modem status lines */
/* These need sorting out by individually connecting pins and checking
 * results. FIXME!
 * When data is being sent we see 0x30 in the lower byte; this must
 * contain DSR and CTS ...
 */
#define IPW_DSR
#define IPW_CTS

#define IPW_WANTS_TO_SEND

static const struct usb_device_id id_table[] =;
MODULE_DEVICE_TABLE(usb, id_table);

static int ipw_open(struct tty_struct *tty, struct usb_serial_port *port)
{}

static int ipw_attach(struct usb_serial *serial)
{}

static void ipw_release(struct usb_serial *serial)
{}

static void ipw_dtr_rts(struct usb_serial_port *port, int on)
{}

static void ipw_close(struct usb_serial_port *port)
{}

static struct usb_serial_driver ipw_device =;

static struct usb_serial_driver * const serial_drivers[] =;

module_usb_serial_driver();

/* Module information */
MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();