/* Derived from Applicom driver ac.c for SCO Unix */
/* Ported by David Woodhouse, Axiom (Cambridge) Ltd. */
-/* dwmw2@redhat.com 30/8/98 */
+/* dwmw2@infradead.org 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. */
/*****************************************************************************/
MODULE_AUTHOR("David Woodhouse & Applicom International");
MODULE_DESCRIPTION("Driver for Applicom Profibus card");
MODULE_LICENSE("GPL");
-MODULE_PARM(irq, "i");
-MODULE_PARM_DESC(irq, "IRQ of the Applicom board");
-MODULE_PARM(mem, "i");
-MODULE_PARM_DESC(mem, "Shared Memory Address of Applicom board");
MODULE_SUPPORTED_DEVICE("ac");
static struct applicom_board {
unsigned long PhysIO;
- unsigned long RamIO;
+ void __iomem *RamIO;
wait_queue_head_t FlagSleepSend;
long irq;
spinlock_t mutex;
static unsigned int irq = 0; /* interrupt number IRQ */
static unsigned long mem = 0; /* physical segment of board */
+module_param(irq, uint, 0);
+MODULE_PARM_DESC(irq, "IRQ of the Applicom board");
+module_param(mem, ulong, 0);
+MODULE_PARM_DESC(mem, "Shared Memory Address of Applicom board");
+
static unsigned int numboards; /* number of installed boards */
static volatile unsigned char Dummy;
static DECLARE_WAIT_QUEUE_HEAD(FlagSleepRec);
static int dummy; /* dev_id for request_irq() */
-static int ac_register_board(unsigned long physloc, unsigned long loc,
+static int ac_register_board(unsigned long physloc, void __iomem *loc,
unsigned char boardno)
{
volatile unsigned char byte_reset_it;
if (!apbs[i].RamIO)
continue;
-
- iounmap((void *) apbs[i].RamIO);
if (apbs[i].irq)
free_irq(apbs[i].irq, &dummy);
+
+ iounmap(apbs[i].RamIO);
}
}
{
int i, numisa = 0;
struct pci_dev *dev = NULL;
- void *RamIO;
+ void __iomem *RamIO;
int boardno;
printk(KERN_INFO "Applicom driver: $Id: ac.c,v 1.30 2000/03/22 16:03:57 dwmw2 Exp $\n");
/* No mem and irq given - check for a PCI card */
- while ( (dev = pci_find_class(PCI_CLASS_OTHERS << 16, dev))) {
+ while ( (dev = pci_get_class(PCI_CLASS_OTHERS << 16, dev))) {
if (dev->vendor != PCI_VENDOR_ID_APPLICOM)
continue;
applicom_pci_devnames[dev->device-1], dev->resource[0].start,
dev->irq);
- if (!(boardno = ac_register_board(dev->resource[0].start,
- (unsigned long)RamIO,0))) {
+ boardno = ac_register_board(dev->resource[0].start, RamIO,0);
+ if (!boardno) {
printk(KERN_INFO "ac.o: PCI Applicom device doesn't have correct signature.\n");
iounmap(RamIO);
pci_disable_device(dev);
printk(KERN_INFO "Could not allocate IRQ %d for PCI Applicom device.\n", dev->irq);
iounmap(RamIO);
pci_disable_device(dev);
- apbs[boardno - 1].RamIO = 0;
+ apbs[boardno - 1].RamIO = NULL;
continue;
}
}
if (!(boardno = ac_register_board((unsigned long)mem+ (LEN_RAM_IO*i),
- (unsigned long)RamIO,i+1))) {
+ RamIO,i+1))) {
iounmap(RamIO);
continue;
}
if (!numisa) {
if (request_irq(irq, &ac_interrupt, SA_SHIRQ, "Applicom ISA", &dummy)) {
printk(KERN_WARNING "Could not allocate IRQ %d for ISA Applicom device.\n", irq);
- iounmap((void *) RamIO);
- apbs[boardno - 1].RamIO = 0;
+ iounmap(RamIO);
+ apbs[boardno - 1].RamIO = NULL;
}
else
apbs[boardno - 1].irq = irq;
because it works with 2.2 still */
{
unsigned char *from = (unsigned char *) &tmpmailbox;
- unsigned long to = (unsigned long) apbs[IndexCard].RamIO + RAM_FROM_PC;
+ void __iomem *to = apbs[IndexCard].RamIO + RAM_FROM_PC;
int c;
for (c = 0; c < sizeof(struct mailbox); c++)
static int do_ac_read(int IndexCard, char __user *buf,
struct st_ram_io *st_loc, struct mailbox *mailbox)
{
- unsigned long from = (unsigned long)apbs[IndexCard].RamIO + RAM_TO_PC;
+ void __iomem *from = apbs[IndexCard].RamIO + RAM_TO_PC;
unsigned char *to = (unsigned char *)&mailbox;
#ifdef DEBUG
int c;
{ /* @ ADG ou ATO selon le cas */
int i;
unsigned char IndexCard;
- unsigned long pmem;
+ void __iomem *pmem;
int ret = 0;
volatile unsigned char byte_reset_it;
struct st_ram_io *adgl;