linux/drivers/atm/solos-pci.c

// SPDX-License-Identifier: GPL-2.0-only
/*
 * Driver for the Solos PCI ADSL2+ card, designed to support Linux by
 *  Traverse Technologies -- https://www.traverse.com.au/
 *  Xrio Limited          -- http://www.xrio.com/
 *
 * Copyright © 2008 Traverse Technologies
 * Copyright © 2008 Intel Corporation
 *
 * Authors: Nathan Williams <[email protected]>
 *          David Woodhouse <[email protected]>
 *          Treker Chen <[email protected]>
 */

#define DEBUG
#define VERBOSE_DEBUG

#include <linux/interrupt.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/ioport.h>
#include <linux/types.h>
#include <linux/pci.h>
#include <linux/atm.h>
#include <linux/atmdev.h>
#include <linux/skbuff.h>
#include <linux/sysfs.h>
#include <linux/device.h>
#include <linux/kobject.h>
#include <linux/firmware.h>
#include <linux/ctype.h>
#include <linux/swab.h>
#include <linux/slab.h>

#define VERSION
#define DRIVER_VERSION
#define PTAG

#define CONFIG_RAM_SIZE
#define FLAGS_ADDR
#define IRQ_EN_ADDR
#define FPGA_VER
#define IRQ_CLEAR
#define WRITE_FLASH
#define PORTS
#define FLASH_BLOCK
#define FLASH_BUSY
#define FPGA_MODE
#define FLASH_MODE
#define GPIO_STATUS
#define DRIVER_VER
#define TX_DMA_ADDR(port)
#define RX_DMA_ADDR(port)

#define DATA_RAM_SIZE
#define BUF_SIZE
#define OLD_BUF_SIZE
/* Old boards use ATMEL AD45DB161D flash */
#define ATMEL_FPGA_PAGE
#define ATMEL_SOLOS_PAGE
#define ATMEL_FPGA_BLOCK
#define ATMEL_SOLOS_BLOCK
/* Current boards use M25P/M25PE SPI flash */
#define SPI_FLASH_BLOCK

#define RX_BUF(card, nr)
#define TX_BUF(card, nr)
#define FLASH_BUF

#define RX_DMA_SIZE

#define FPGA_VERSION(a,b)
#define LEGACY_BUFFERS
#define DMA_SUPPORTED

static int reset =;
static int atmdebug =;
static int firmware_upgrade =;
static int fpga_upgrade =;
static int db_firmware_upgrade =;
static int db_fpga_upgrade =;

struct pkt_hdr {};

struct solos_skb_cb {};


#define SKB_CB(skb)

#define PKT_DATA
#define PKT_COMMAND
#define PKT_POPEN
#define PKT_PCLOSE
#define PKT_STATUS

struct solos_card {};


struct solos_param {};

#define SOLOS_CHAN(atmdev)

MODULE_AUTHOR();
MODULE_DESCRIPTION();
MODULE_VERSION();
MODULE_LICENSE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_FIRMWARE();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
MODULE_PARM_DESC();
module_param(reset, int, 0444);
module_param(atmdebug, int, 0644);
module_param(firmware_upgrade, int, 0444);
module_param(fpga_upgrade, int, 0444);
module_param(db_firmware_upgrade, int, 0444);
module_param(db_fpga_upgrade, int, 0444);

static void fpga_queue(struct solos_card *card, int port, struct sk_buff *skb,
		       struct atm_vcc *vcc);
static uint32_t fpga_tx(struct solos_card *);
static irqreturn_t solos_irq(int irq, void *dev_id);
static struct atm_vcc* find_vcc(struct atm_dev *dev, short vpi, int vci);
static int atm_init(struct solos_card *, struct device *);
static void atm_remove(struct solos_card *);
static int send_command(struct solos_card *card, int dev, const char *buf, size_t size);
static void solos_bh(unsigned long);
static int print_buffer(struct sk_buff *buf);

static inline void solos_pop(struct atm_vcc *vcc, struct sk_buff *skb)
{}

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

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

static char *next_string(struct sk_buff *skb)
{}

/*
 * Status packet has fields separated by \n, starting with a version number
 * for the information therein. Fields are....
 *
 *     packet version
 *     RxBitRate	(version >= 1)
 *     TxBitRate	(version >= 1)
 *     State		(version >= 1)
 *     LocalSNRMargin	(version >= 1)
 *     LocalLineAttn	(version >= 1)
 */       
static int process_status(struct solos_card *card, int port, struct sk_buff *skb)
{}

static int process_command(struct solos_card *card, int port, struct sk_buff *skb)
{}

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

static int send_command(struct solos_card *card, int dev, const char *buf, size_t size)
{}

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

struct geos_gpio_attr {};

#define SOLOS_GPIO_ATTR(_name, _mode, _show, _store, _offset)

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

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

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

static DEVICE_ATTR_RW(console);


#define SOLOS_ATTR_RO(x)
#define SOLOS_ATTR_RW(x)

#include "solos-attrlist.c"

static SOLOS_GPIO_ATTR(GPIO1, 0644, geos_gpio_show, geos_gpio_store, 9);
static SOLOS_GPIO_ATTR(GPIO2, 0644, geos_gpio_show, geos_gpio_store, 10);
static SOLOS_GPIO_ATTR(GPIO3, 0644, geos_gpio_show, geos_gpio_store, 11);
static SOLOS_GPIO_ATTR(GPIO4, 0644, geos_gpio_show, geos_gpio_store, 12);
static SOLOS_GPIO_ATTR(GPIO5, 0644, geos_gpio_show, geos_gpio_store, 13);
static SOLOS_GPIO_ATTR(PushButton, 0444, geos_gpio_show, NULL, 14);
static SOLOS_GPIO_ATTR(HardwareVersion, 0444, hardware_show, NULL, 0);
static SOLOS_GPIO_ATTR(HardwareVariant, 0444, hardware_show, NULL, 1);
#undef SOLOS_ATTR_RO
#undef SOLOS_ATTR_RW

#define SOLOS_ATTR_RO(x)
#define SOLOS_ATTR_RW(x)

static struct attribute *solos_attrs[] =;

static const struct attribute_group solos_attr_group =;

static struct attribute *gpio_attrs[] =;

static const struct attribute_group gpio_attr_group =;

static int flash_upgrade(struct solos_card *card, int chip)
{}

static irqreturn_t solos_irq(int irq, void *dev_id)
{}

static void solos_bh(unsigned long card_arg)
{}

static struct atm_vcc *find_vcc(struct atm_dev *dev, short vpi, int vci)
{}

static int popen(struct atm_vcc *vcc)
{}

static void pclose(struct atm_vcc *vcc)
{}

static int print_buffer(struct sk_buff *buf)
{}

static void fpga_queue(struct solos_card *card, int port, struct sk_buff *skb,
		       struct atm_vcc *vcc)
{}

static uint32_t fpga_tx(struct solos_card *card)
{}

static int psend(struct atm_vcc *vcc, struct sk_buff *skb)
{}

static const struct atmdev_ops fpga_ops =;

static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id)
{}

static int atm_init(struct solos_card *card, struct device *parent)
{}

static void atm_remove(struct solos_card *card)
{}

static void fpga_remove(struct pci_dev *dev)
{}

static const struct pci_device_id fpga_pci_tbl[] =;

MODULE_DEVICE_TABLE(pci,fpga_pci_tbl);

static struct pci_driver fpga_driver =;


static int __init solos_pci_init(void)
{}

static void __exit solos_pci_exit(void)
{}

module_init();
module_exit(solos_pci_exit);