linux/drivers/usb/serial/omninet.c

// SPDX-License-Identifier: GPL-2.0
/*
 * USB ZyXEL omni.net driver
 *
 * Copyright (C) 2013,2017 Johan Hovold <[email protected]>
 *
 * See Documentation/usb/usb-serial.rst for more information on using this
 * driver
 *
 * Please report both successes and troubles to the author at [email protected]
 */

#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/tty.h>
#include <linux/tty_driver.h>
#include <linux/tty_flip.h>
#include <linux/module.h>
#include <linux/uaccess.h>
#include <linux/usb.h>
#include <linux/usb/serial.h>

#define DRIVER_AUTHOR
#define DRIVER_DESC

#define ZYXEL_VENDOR_ID
#define ZYXEL_OMNINET_ID
#define ZYXEL_OMNI_56K_PLUS_ID
/* This one seems to be a re-branded ZyXEL device */
#define BT_IGNITIONPRO_ID

/* function prototypes */
static void omninet_process_read_urb(struct urb *urb);
static int omninet_prepare_write_buffer(struct usb_serial_port *port,
				void *buf, size_t count);
static int omninet_calc_num_ports(struct usb_serial *serial,
				struct usb_serial_endpoints *epds);
static int omninet_port_probe(struct usb_serial_port *port);
static void omninet_port_remove(struct usb_serial_port *port);

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

static struct usb_serial_driver zyxel_omninet_device =;

static struct usb_serial_driver * const serial_drivers[] =;


/*
 * The protocol.
 *
 * The omni.net always exchange 64 bytes of data with the host. The first
 * four bytes are the control header.
 *
 * oh_seq is a sequence number. Don't know if/how it's used.
 * oh_len is the length of the data bytes in the packet.
 * oh_xxx Bit-mapped, related to handshaking and status info.
 *	I normally set it to 0x03 in transmitted frames.
 *	7: Active when the TA is in a CONNECTed state.
 *	6: unknown
 *	5: handshaking, unknown
 *	4: handshaking, unknown
 *	3: unknown, usually 0
 *	2: unknown, usually 0
 *	1: handshaking, unknown, usually set to 1 in transmitted frames
 *	0: handshaking, unknown, usually set to 1 in transmitted frames
 * oh_pad Probably a pad byte.
 *
 * After the header you will find data bytes if oh_len was greater than zero.
 */
struct omninet_header {};

struct omninet_data {};

static int omninet_calc_num_ports(struct usb_serial *serial,
					struct usb_serial_endpoints *epds)
{}

static int omninet_port_probe(struct usb_serial_port *port)
{}

static void omninet_port_remove(struct usb_serial_port *port)
{}

#define OMNINET_HEADERLEN
#define OMNINET_BULKOUTSIZE
#define OMNINET_PAYLOADSIZE

static void omninet_process_read_urb(struct urb *urb)
{}

static int omninet_prepare_write_buffer(struct usb_serial_port *port,
					void *buf, size_t count)
{}

module_usb_serial_driver();

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_LICENSE();