linux/drivers/usb/atm/cxacru.c

// SPDX-License-Identifier: GPL-2.0+
/******************************************************************************
 *  cxacru.c  -  driver for USB ADSL modems based on
 *               Conexant AccessRunner chipset
 *
 *  Copyright (C) 2004 David Woodhouse, Duncan Sands, Roman Kagan
 *  Copyright (C) 2005 Duncan Sands, Roman Kagan (rkagan % mail ! ru)
 *  Copyright (C) 2007 Simon Arlott
 *  Copyright (C) 2009 Simon Arlott
 ******************************************************************************/

/*
 *  Credit is due for Josep Comas, who created the original patch to speedtch.c
 *  to support the different padding used by the AccessRunner (now generalized
 *  into usbatm), and the userspace firmware loading utility.
 */

#include <linux/module.h>
#include <linux/moduleparam.h>
#include <linux/kernel.h>
#include <linux/timer.h>
#include <linux/errno.h>
#include <linux/slab.h>
#include <linux/device.h>
#include <linux/firmware.h>
#include <linux/mutex.h>
#include <asm/unaligned.h>

#include "usbatm.h"

#define DRIVER_AUTHOR
#define DRIVER_DESC

static const char cxacru_driver_name[] =;

#define CXACRU_EP_CMD
#define CXACRU_EP_DATA

#define CMD_PACKET_SIZE
#define CMD_MAX_CONFIG

/* Addresses */
#define PLLFCLK_ADDR
#define PLLBCLK_ADDR
#define SDRAMEN_ADDR
#define FW_ADDR
#define BR_ADDR
#define SIG_ADDR
#define BR_STACK_ADDR

/* Values */
#define SDRAM_ENA

#define CMD_TIMEOUT
#define POLL_INTERVAL

/* commands for interaction with the modem through the control channel before
 * firmware is loaded  */
enum cxacru_fw_request {};

/* commands for interaction with the modem through the control channel once
 * firmware is loaded  */
enum cxacru_cm_request {};

/* commands for interaction with the flash memory
 *
 * read:  response is the contents of the first 60 bytes of flash memory
 * write: request contains the 60 bytes of data to write to flash memory
 *        response is the contents of the first 60 bytes of flash memory
 *
 * layout: PP PP VV VV  MM MM MM MM  MM MM ?? ??  SS SS SS SS  SS SS SS SS
 *         SS SS SS SS  SS SS SS SS  00 00 00 00  00 00 00 00  00 00 00 00
 *         00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00  00 00 00 00
 *
 *   P: le16  USB Product ID
 *   V: le16  USB Vendor ID
 *   M: be48  MAC Address
 *   S: le16  ASCII Serial Number
 */
enum cxacru_cm_flash {};

/* reply codes to the commands above */
enum cxacru_cm_status {};

/* indices into CARD_INFO_GET return array */
enum cxacru_info_idx {};

enum cxacru_poll_state {};

struct cxacru_modem_type {};

struct cxacru_data {};

static int cxacru_cm(struct cxacru_data *instance, enum cxacru_cm_request cm,
	u8 *wdata, int wsize, u8 *rdata, int rsize);
static void cxacru_poll_status(struct work_struct *work);

/* Card info exported through sysfs */
#define CXACRU__ATTR_INIT(_name)

#define CXACRU_CMD_INIT(_name)

#define CXACRU_SET_INIT(_name)

#define CXACRU_ATTR_INIT(_value, _type, _name)

#define CXACRU_ATTR_CREATE(_v, _t, _name)
#define CXACRU_CMD_CREATE(_name)
#define CXACRU_SET_CREATE(_name)
#define CXACRU__ATTR_CREATE(_name)

#define CXACRU_ATTR_REMOVE(_v, _t, _name)
#define CXACRU_CMD_REMOVE(_name)
#define CXACRU_SET_REMOVE(_name)
#define CXACRU__ATTR_REMOVE(_name)

static ssize_t cxacru_sysfs_showattr_u32(u32 value, char *buf)
{}

static ssize_t cxacru_sysfs_showattr_s8(s8 value, char *buf)
{}

static ssize_t cxacru_sysfs_showattr_dB(s16 value, char *buf)
{}

static ssize_t cxacru_sysfs_showattr_bool(u32 value, char *buf)
{}

static ssize_t cxacru_sysfs_showattr_LINK(u32 value, char *buf)
{}

static ssize_t cxacru_sysfs_showattr_LINE(u32 value, char *buf)
{}

static ssize_t cxacru_sysfs_showattr_MODU(u32 value, char *buf)
{}

/*
 * This could use MAC_ADDRESS_HIGH and MAC_ADDRESS_LOW, but since
 * this data is already in atm_dev there's no point.
 *
 * MAC_ADDRESS_HIGH = 0x????5544
 * MAC_ADDRESS_LOW  = 0x33221100
 * Where 00-55 are bytes 0-5 of the MAC.
 */
static ssize_t mac_address_show(struct device *dev,
	struct device_attribute *attr, char *buf)
{}

static ssize_t adsl_state_show(struct device *dev,
	struct device_attribute *attr, char *buf)
{}

static ssize_t adsl_state_store(struct device *dev,
	struct device_attribute *attr, const char *buf, size_t count)
{}

/* CM_REQUEST_CARD_DATA_GET times out, so no show attribute */

static ssize_t adsl_config_store(struct device *dev,
	struct device_attribute *attr, const char *buf, size_t count)
{}

/*
 * All device attributes are included in CXACRU_ALL_FILES
 * so that the same list can be used multiple times:
 *     INIT   (define the device attributes)
 *     CREATE (create all the device files)
 *     REMOVE (remove all the device files)
 *
 * With the last two being defined as needed in the functions
 * they are used in before calling CXACRU_ALL_FILES()
 */
#define CXACRU_ALL_FILES(_action)

CXACRU_ALL_FILES(INIT);

static struct attribute *cxacru_attrs[] =;
ATTRIBUTE_GROUPS();

/* the following three functions are stolen from drivers/usb/core/message.c */
static void cxacru_blocking_completion(struct urb *urb)
{}

struct cxacru_timer {};

static void cxacru_timeout_kill(struct timer_list *t)
{}

static int cxacru_start_wait_urb(struct urb *urb, struct completion *done,
				 int *actual_length)
{}

static int cxacru_cm(struct cxacru_data *instance, enum cxacru_cm_request cm,
		     u8 *wdata, int wsize, u8 *rdata, int rsize)
{}

static int cxacru_cm_get_array(struct cxacru_data *instance, enum cxacru_cm_request cm,
			       u32 *data, int size)
{}

static int cxacru_card_status(struct cxacru_data *instance)
{}

static int cxacru_atm_start(struct usbatm_data *usbatm_instance,
		struct atm_dev *atm_dev)
{}

static void cxacru_poll_status(struct work_struct *work)
{}

static int cxacru_fw(struct usb_device *usb_dev, enum cxacru_fw_request fw,
		     u8 code1, u8 code2, u32 addr, const u8 *data, int size)
{}

static void cxacru_upload_firmware(struct cxacru_data *instance,
				   const struct firmware *fw,
				   const struct firmware *bp)
{}

static int cxacru_find_firmware(struct cxacru_data *instance,
				char *phase, const struct firmware **fw_p)
{}

static int cxacru_heavy_init(struct usbatm_data *usbatm_instance,
			     struct usb_interface *usb_intf)
{}

static int cxacru_bind(struct usbatm_data *usbatm_instance,
		       struct usb_interface *intf, const struct usb_device_id *id)
{}

static void cxacru_unbind(struct usbatm_data *usbatm_instance,
		struct usb_interface *intf)
{}

static const struct cxacru_modem_type cxacru_cafe =;

static const struct cxacru_modem_type cxacru_cb00 =;

static const struct usb_device_id cxacru_usb_ids[] =;

MODULE_DEVICE_TABLE(usb, cxacru_usb_ids);

static struct usbatm_driver cxacru_driver =;

static int cxacru_usb_probe(struct usb_interface *intf,
		const struct usb_device_id *id)
{}

static struct usb_driver cxacru_usb_driver =;

module_usb_driver();

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