linux/drivers/char/applicom.c

// SPDX-License-Identifier: GPL-2.0-only
/* Derived from Applicom driver ac.c for SCO Unix                            */
/* Ported by David Woodhouse, Axiom (Cambridge) Ltd.                         */
/* [email protected] 30/8/98                                               */
/* $Id: ac.c,v 1.30 2000/03/22 16:03:57 dwmw2 Exp $			     */
/* This module is for Linux 2.1 and 2.2 series kernels.                      */
/*****************************************************************************/
/* J PAGET 18/02/94 passage V2.4.2 ioctl avec code 2 reset to les interrupt  */
/* ceci pour reseter correctement apres une sortie sauvage                   */
/* J PAGET 02/05/94 passage V2.4.3 dans le traitement de d'interruption,     */
/* LoopCount n'etait pas initialise a 0.                                     */
/* F LAFORSE 04/07/95 version V2.6.0 lecture bidon apres acces a une carte   */
/*           pour liberer le bus                                             */
/* J.PAGET 19/11/95 version V2.6.1 Nombre, addresse,irq n'est plus configure */
/* et passe en argument a acinit, mais est scrute sur le bus pour s'adapter  */
/* au nombre de cartes presentes sur le bus. IOCL code 6 affichait V2.4.3    */
/* F.LAFORSE 28/11/95 creation de fichiers acXX.o avec les differentes       */
/* addresses de base des cartes, IOCTL 6 plus complet                         */
/* J.PAGET le 19/08/96 copie de la version V2.6 en V2.8.0 sans modification  */
/* de code autre que le texte V2.6.1 en V2.8.0                               */
/*****************************************************************************/


#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/interrupt.h>
#include <linux/sched/signal.h>
#include <linux/slab.h>
#include <linux/errno.h>
#include <linux/mutex.h>
#include <linux/miscdevice.h>
#include <linux/pci.h>
#include <linux/wait.h>
#include <linux/init.h>
#include <linux/fs.h>
#include <linux/nospec.h>

#include <asm/io.h>
#include <linux/uaccess.h>

#include "applicom.h"


/* NOTE: We use for loops with {write,read}b() instead of 
   memcpy_{from,to}io throughout this driver. This is because
   the board doesn't correctly handle word accesses - only
   bytes. 
*/


#undef DEBUG

#define MAX_BOARD
#define MAX_ISA_BOARD
#define LEN_RAM_IO

#ifndef PCI_VENDOR_ID_APPLICOM
#define PCI_VENDOR_ID_APPLICOM
#define PCI_DEVICE_ID_APPLICOM_PCIGENERIC
#define PCI_DEVICE_ID_APPLICOM_PCI2000IBS_CAN
#define PCI_DEVICE_ID_APPLICOM_PCI2000PFB
#endif

static DEFINE_MUTEX(ac_mutex);
static char *applicom_pci_devnames[] =;

static const struct pci_device_id applicom_pci_tbl[] =;
MODULE_DEVICE_TABLE(pci, applicom_pci_tbl);

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

static struct applicom_board {} apbs[MAX_BOARD];

static unsigned int irq;	/* interrupt number IRQ       */
static unsigned long mem;	/* physical segment of board  */

module_param_hw(irq, uint, irq, 0);
MODULE_PARM_DESC();
module_param_hw(mem, ulong, iomem, 0);
MODULE_PARM_DESC();

static unsigned int numboards;	/* number of installed boards */
static volatile unsigned char Dummy;
static DECLARE_WAIT_QUEUE_HEAD(FlagSleepRec);
static unsigned int WriteErrorCount;	/* number of write error      */
static unsigned int ReadErrorCount;	/* number of read error       */
static unsigned int DeviceErrorCount;	/* number of device error     */

static ssize_t ac_read (struct file *, char __user *, size_t, loff_t *);
static ssize_t ac_write (struct file *, const char __user *, size_t, loff_t *);
static long ac_ioctl(struct file *, unsigned int, unsigned long);
static irqreturn_t ac_interrupt(int, void *);

static const struct file_operations ac_fops =;

static struct miscdevice ac_miscdev =;

static int dummy;	/* dev_id for request_irq() */

static int ac_register_board(unsigned long physloc, void __iomem *loc, 
		      unsigned char boardno)
{}

static void __exit applicom_exit(void)
{}

static int __init applicom_init(void)
{}

module_init();
module_exit(applicom_exit);


static ssize_t ac_write(struct file *file, const char __user *buf, size_t count, loff_t * ppos)
{}

static int do_ac_read(int IndexCard, char __user *buf,
		struct st_ram_io *st_loc, struct mailbox *mailbox)
{}

static ssize_t ac_read (struct file *filp, char __user *buf, size_t count, loff_t *ptr)
{}

static irqreturn_t ac_interrupt(int vec, void *dev_instance)
{}



static long ac_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
     
{}