Commit c482e28f authored by Linus Torvalds's avatar Linus Torvalds

Merge bk://linux-input.bkbits.net/linux-input

into home.transmeta.com:/home/torvalds/v2.5/linux
parents 3fc985a6 839d71d7
...@@ -177,16 +177,12 @@ struct seq_operations partitions_op = { ...@@ -177,16 +177,12 @@ struct seq_operations partitions_op = {
extern int blk_dev_init(void); extern int blk_dev_init(void);
extern int soc_probe(void); extern int soc_probe(void);
extern int atmdev_init(void); extern int atmdev_init(void);
extern int i2o_init(void);
extern int cpqarray_init(void); extern int cpqarray_init(void);
int __init device_init(void) int __init device_init(void)
{ {
rwlock_init(&gendisk_lock); rwlock_init(&gendisk_lock);
blk_dev_init(); blk_dev_init();
#ifdef CONFIG_I2O
i2o_init();
#endif
#ifdef CONFIG_FC4_SOC #ifdef CONFIG_FC4_SOC
/* This has to be done before scsi_dev_init */ /* This has to be done before scsi_dev_init */
soc_probe(); soc_probe();
......
...@@ -724,4 +724,3 @@ static void ppc6_close(PPC *ppc) ...@@ -724,4 +724,3 @@ static void ppc6_close(PPC *ppc)
//*************************************************************************** //***************************************************************************
MODULE_LICENSE("GPL");
...@@ -819,7 +819,7 @@ static void del_battery_timer(void) ...@@ -819,7 +819,7 @@ static void del_battery_timer(void)
static int mm_revalidate(kdev_t i_rdev) static int mm_revalidate(kdev_t i_rdev)
{ {
int card_number = DEVICE_NR(i_rdev); int card_number = DEVICE_NR(i_rdev);
kdev_t device = mk_mdev(MAJOR_NR, card_number << MM_SHIFT); kdev_t device = mk_kdev(MAJOR_NR, card_number << MM_SHIFT);
int res = dev_lock_part(device); int res = dev_lock_part(device);
if (res < 0) if (res < 0)
return res; return res;
...@@ -862,7 +862,7 @@ static int mm_ioctl(struct inode *i, struct file *f, unsigned int cmd, unsigned ...@@ -862,7 +862,7 @@ static int mm_ioctl(struct inode *i, struct file *f, unsigned int cmd, unsigned
size = cards[card_number].mm_size * (1024 / MM_HARDSECT); size = cards[card_number].mm_size * (1024 / MM_HARDSECT);
geo.heads = 64; geo.heads = 64;
geo.sectors = 32; geo.sectors = 32;
geo.start = get_start_sect(inode->i_bdev); geo.start = get_start_sect(i->i_bdev);
geo.cylinders = size / (geo.heads * geo.sectors); geo.cylinders = size / (geo.heads * geo.sectors);
if (copy_to_user((void *) arg, &geo, sizeof(geo))) if (copy_to_user((void *) arg, &geo, sizeof(geo)))
......
...@@ -121,7 +121,7 @@ struct channel ...@@ -121,7 +121,7 @@ struct channel
int close_delay; int close_delay;
int count; int count;
int blocked_open; int blocked_open;
int event; ulong event;
int asyncflags; int asyncflags;
uint dev; uint dev;
long session; long session;
......
...@@ -110,7 +110,7 @@ struct specialix_port { ...@@ -110,7 +110,7 @@ struct specialix_port {
struct tty_struct * tty; struct tty_struct * tty;
int count; int count;
int blocked_open; int blocked_open;
int event; ulong event;
int timeout; int timeout;
int close_delay; int close_delay;
long session; long session;
......
...@@ -109,7 +109,6 @@ calibrate_xor_block(void) ...@@ -109,7 +109,6 @@ calibrate_xor_block(void)
b2 = b1 + 2*PAGE_SIZE + BENCH_SIZE; b2 = b1 + 2*PAGE_SIZE + BENCH_SIZE;
printk(KERN_INFO "raid5: measuring checksumming speed\n"); printk(KERN_INFO "raid5: measuring checksumming speed\n");
sti();
#define xor_speed(templ) do_xor_speed((templ), b1, b2) #define xor_speed(templ) do_xor_speed((templ), b1, b2)
......
...@@ -15,8 +15,9 @@ ...@@ -15,8 +15,9 @@
#define _NO_VERSION_ #define _NO_VERSION_
/* #include <linux/kernel.h> */
#include <linux/module.h> #include <linux/module.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <asm/semaphore.h> #include <asm/semaphore.h>
......
...@@ -5,7 +5,6 @@ mainmenu_option next_comment ...@@ -5,7 +5,6 @@ mainmenu_option next_comment
comment 'Video For Linux' comment 'Video For Linux'
bool ' V4L information in proc filesystem' CONFIG_VIDEO_PROC_FS bool ' V4L information in proc filesystem' CONFIG_VIDEO_PROC_FS
dep_tristate ' I2C on parallel port' CONFIG_I2C_PARPORT $CONFIG_PARPORT $CONFIG_I2C
comment 'Video Adapters' comment 'Video Adapters'
if [ "$CONFIG_I2C_ALGOBIT" = "y" -o "$CONFIG_I2C_ALGOBIT" = "m" ]; then if [ "$CONFIG_I2C_ALGOBIT" = "y" -o "$CONFIG_I2C_ALGOBIT" = "m" ]; then
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
# All of the (potential) objects that export symbols. # All of the (potential) objects that export symbols.
# This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'. # This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'.
export-objs := i2c-old.o videodev.o bttv-if.o cpia.o video-buf.o export-objs := videodev.o bttv-if.o cpia.o video-buf.o
bttv-objs := bttv-driver.o bttv-cards.o bttv-if.o \ bttv-objs := bttv-driver.o bttv-cards.o bttv-if.o \
bttv-risc.o bttv-vbi.o bttv-risc.o bttv-vbi.o
...@@ -13,21 +13,19 @@ zoran-objs := zr36120.o zr36120_i2c.o zr36120_mem.o ...@@ -13,21 +13,19 @@ zoran-objs := zr36120.o zr36120_i2c.o zr36120_mem.o
obj-$(CONFIG_VIDEO_DEV) += videodev.o obj-$(CONFIG_VIDEO_DEV) += videodev.o
obj-$(CONFIG_BUS_I2C) += i2c-old.o
obj-$(CONFIG_VIDEO_BT848) += bttv.o msp3400.o tvaudio.o \ obj-$(CONFIG_VIDEO_BT848) += bttv.o msp3400.o tvaudio.o \
tda7432.o tda9875.o tuner.o video-buf.o tda7432.o tda9875.o tuner.o video-buf.o
obj-$(CONFIG_SOUND_TVMIXER) += tvmixer.o obj-$(CONFIG_SOUND_TVMIXER) += tvmixer.o
obj-$(CONFIG_VIDEO_ZR36120) += zoran.o obj-$(CONFIG_VIDEO_ZR36120) += zoran.o
obj-$(CONFIG_I2C_PARPORT) += i2c-parport.o i2c-old.o obj-$(CONFIG_VIDEO_SAA5249) += saa5249.o
obj-$(CONFIG_VIDEO_SAA5249) += saa5249.o i2c-old.o
obj-$(CONFIG_VIDEO_CQCAM) += c-qcam.o obj-$(CONFIG_VIDEO_CQCAM) += c-qcam.o
obj-$(CONFIG_VIDEO_BWQCAM) += bw-qcam.o obj-$(CONFIG_VIDEO_BWQCAM) += bw-qcam.o
obj-$(CONFIG_VIDEO_W9966) += w9966.o obj-$(CONFIG_VIDEO_W9966) += w9966.o
obj-$(CONFIG_VIDEO_ZORAN_BUZ) += saa7111.o saa7185.o obj-$(CONFIG_VIDEO_ZORAN_BUZ) += saa7111.o saa7185.o
obj-$(CONFIG_VIDEO_ZORAN_DC10) += saa7110.o adv7175.o obj-$(CONFIG_VIDEO_ZORAN_DC10) += saa7110.o adv7175.o
obj-$(CONFIG_VIDEO_ZORAN_LML33) += bt819.o bt856.o obj-$(CONFIG_VIDEO_ZORAN_LML33) += bt819.o bt856.o
obj-$(CONFIG_VIDEO_ZORAN) += zr36067.o i2c-old.o obj-$(CONFIG_VIDEO_ZORAN) += zr36067.o
obj-$(CONFIG_VIDEO_PMS) += pms.o obj-$(CONFIG_VIDEO_PMS) += pms.o
obj-$(CONFIG_VIDEO_PLANB) += planb.o obj-$(CONFIG_VIDEO_PLANB) += planb.o
obj-$(CONFIG_VIDEO_VINO) += vino.o obj-$(CONFIG_VIDEO_VINO) += vino.o
......
/*
* Generic i2c interface for linux
*
* (c) 1998 Gerd Knorr <kraxel@cs.tu-berlin.de>
*
*/
#include <linux/config.h>
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/errno.h>
#include <linux/types.h>
#include <linux/string.h>
#include <linux/delay.h>
#include <linux/sched.h>
#include <linux/slab.h>
#include <linux/i2c-old.h>
#define REGPRINT(x) if (verbose) (x)
#define I2C_DEBUG(x) if (i2c_debug) (x)
static int scan = 0;
static int verbose = 0;
static int i2c_debug = 0;
#if LINUX_VERSION_CODE >= 0x020117
MODULE_PARM(scan,"i");
MODULE_PARM(verbose,"i");
MODULE_PARM(i2c_debug,"i");
#endif
/* ----------------------------------------------------------------------- */
static struct i2c_bus *busses[I2C_BUS_MAX];
static struct i2c_driver *drivers[I2C_DRIVER_MAX];
static int bus_count = 0, driver_count = 0;
#ifdef CONFIG_VIDEO_BUZ
extern int saa7111_init(void);
extern int saa7185_init(void);
#endif
#ifdef CONFIG_VIDEO_LML33
extern int bt819_init(void);
extern int bt856_init(void);
#endif
int i2c_init(void)
{
printk(KERN_INFO "i2c: initialized%s\n",
scan ? " (i2c bus scan enabled)" : "");
/* anything to do here ? */
#ifdef CONFIG_VIDEO_BUZ
saa7111_init();
saa7185_init();
#endif
#ifdef CONFIG_VIDEO_LML33
bt819_init();
bt856_init();
#endif
return 0;
}
/* ----------------------------------------------------------------------- */
static void i2c_attach_device(struct i2c_bus *bus, struct i2c_driver *driver)
{
struct i2c_device *device;
int i,j,ack=1;
unsigned char addr;
LOCK_FLAGS;
/* probe for device */
LOCK_I2C_BUS(bus);
for (addr = driver->addr_l; addr <= driver->addr_h; addr += 2)
{
i2c_start(bus);
ack = i2c_sendbyte(bus,addr,0);
i2c_stop(bus);
if (!ack)
break;
}
UNLOCK_I2C_BUS(bus);
if (ack)
return;
/* got answer */
for (i = 0; i < I2C_DEVICE_MAX; i++)
if (NULL == driver->devices[i])
break;
if (I2C_DEVICE_MAX == i)
return;
for (j = 0; j < I2C_DEVICE_MAX; j++)
if (NULL == bus->devices[j])
break;
if (I2C_DEVICE_MAX == j)
return;
if (NULL == (device = kmalloc(sizeof(struct i2c_device),GFP_KERNEL)))
return;
device->bus = bus;
device->driver = driver;
device->addr = addr;
/* Attach */
if (driver->attach(device)!=0)
{
kfree(device);
return;
}
driver->devices[i] = device;
driver->devcount++;
bus->devices[j] = device;
bus->devcount++;
if (bus->attach_inform)
bus->attach_inform(bus,driver->id);
REGPRINT(printk("i2c: device attached: %s (addr=0x%02x, bus=%s, driver=%s)\n",device->name,addr,bus->name,driver->name));
}
static void i2c_detach_device(struct i2c_device *device)
{
int i;
if (device->bus->detach_inform)
device->bus->detach_inform(device->bus,device->driver->id);
device->driver->detach(device);
for (i = 0; i < I2C_DEVICE_MAX; i++)
if (device == device->driver->devices[i])
break;
if (I2C_DEVICE_MAX == i)
{
printk(KERN_WARNING "i2c: detach_device #1: device not found: %s\n",
device->name);
return;
}
device->driver->devices[i] = NULL;
device->driver->devcount--;
for (i = 0; i < I2C_DEVICE_MAX; i++)
if (device == device->bus->devices[i])
break;
if (I2C_DEVICE_MAX == i)
{
printk(KERN_WARNING "i2c: detach_device #2: device not found: %s\n",
device->name);
return;
}
device->bus->devices[i] = NULL;
device->bus->devcount--;
REGPRINT(printk("i2c: device detached: %s (addr=0x%02x, bus=%s, driver=%s)\n",device->name,device->addr,device->bus->name,device->driver->name));
kfree(device);
}
/* ----------------------------------------------------------------------- */
int i2c_register_bus(struct i2c_bus *bus)
{
int i,ack;
LOCK_FLAGS;
memset(bus->devices,0,sizeof(bus->devices));
bus->devcount = 0;
for (i = 0; i < I2C_BUS_MAX; i++)
if (NULL == busses[i])
break;
if (I2C_BUS_MAX == i)
return -ENOMEM;
busses[i] = bus;
bus_count++;
REGPRINT(printk("i2c: bus registered: %s\n",bus->name));
MOD_INC_USE_COUNT;
if (scan)
{
/* scan whole i2c bus */
LOCK_I2C_BUS(bus);
for (i = 0; i < 256; i+=2)
{
i2c_start(bus);
ack = i2c_sendbyte(bus,i,0);
i2c_stop(bus);
if (!ack)
{
printk(KERN_INFO "i2c: scanning bus %s: found device at addr=0x%02x\n",
bus->name,i);
}
}
UNLOCK_I2C_BUS(bus);
}
/* probe available drivers */
for (i = 0; i < I2C_DRIVER_MAX; i++)
if (drivers[i])
i2c_attach_device(bus,drivers[i]);
return 0;
}
int i2c_unregister_bus(struct i2c_bus *bus)
{
int i;
/* detach devices */
for (i = 0; i < I2C_DEVICE_MAX; i++)
if (bus->devices[i])
i2c_detach_device(bus->devices[i]);
for (i = 0; i < I2C_BUS_MAX; i++)
if (bus == busses[i])
break;
if (I2C_BUS_MAX == i)
{
printk(KERN_WARNING "i2c: unregister_bus #1: bus not found: %s\n",
bus->name);
return -ENODEV;
}
MOD_DEC_USE_COUNT;
busses[i] = NULL;
bus_count--;
REGPRINT(printk("i2c: bus unregistered: %s\n",bus->name));
return 0;
}
/* ----------------------------------------------------------------------- */
int i2c_register_driver(struct i2c_driver *driver)
{
int i;
memset(driver->devices,0,sizeof(driver->devices));
driver->devcount = 0;
for (i = 0; i < I2C_DRIVER_MAX; i++)
if (NULL == drivers[i])
break;
if (I2C_DRIVER_MAX == i)
return -ENOMEM;
drivers[i] = driver;
driver_count++;
MOD_INC_USE_COUNT;
REGPRINT(printk("i2c: driver registered: %s\n",driver->name));
/* Probe available busses */
for (i = 0; i < I2C_BUS_MAX; i++)
if (busses[i])
i2c_attach_device(busses[i],driver);
return 0;
}
int i2c_unregister_driver(struct i2c_driver *driver)
{
int i;
/* detach devices */
for (i = 0; i < I2C_DEVICE_MAX; i++)
if (driver->devices[i])
i2c_detach_device(driver->devices[i]);
for (i = 0; i < I2C_DRIVER_MAX; i++)
if (driver == drivers[i])
break;
if (I2C_DRIVER_MAX == i)
{
printk(KERN_WARNING "i2c: unregister_driver: driver not found: %s\n",
driver->name);
return -ENODEV;
}
MOD_DEC_USE_COUNT;
drivers[i] = NULL;
driver_count--;
REGPRINT(printk("i2c: driver unregistered: %s\n",driver->name));
return 0;
}
/* ----------------------------------------------------------------------- */
int i2c_control_device(struct i2c_bus *bus, int id,
unsigned int cmd, void *arg)
{
int i;
for (i = 0; i < I2C_DEVICE_MAX; i++)
if (bus->devices[i] && bus->devices[i]->driver->id == id)
break;
if (i == I2C_DEVICE_MAX)
return -ENODEV;
if (NULL == bus->devices[i]->driver->command)
return -ENODEV;
return bus->devices[i]->driver->command(bus->devices[i],cmd,arg);
}
/* ----------------------------------------------------------------------- */
#define I2C_SET(bus,ctrl,data) (bus->i2c_setlines(bus,ctrl,data))
#define I2C_GET(bus) (bus->i2c_getdataline(bus))
void i2c_start(struct i2c_bus *bus)
{
I2C_SET(bus,0,1);
I2C_SET(bus,1,1);
I2C_SET(bus,1,0);
I2C_SET(bus,0,0);
I2C_DEBUG(printk("%s: < ",bus->name));
}
void i2c_stop(struct i2c_bus *bus)
{
I2C_SET(bus,0,0);
I2C_SET(bus,1,0);
I2C_SET(bus,1,1);
I2C_DEBUG(printk(">\n"));
}
void i2c_one(struct i2c_bus *bus)
{
I2C_SET(bus,0,1);
I2C_SET(bus,1,1);
I2C_SET(bus,0,1);
}
void i2c_zero(struct i2c_bus *bus)
{
I2C_SET(bus,0,0);
I2C_SET(bus,1,0);
I2C_SET(bus,0,0);
}
int i2c_ack(struct i2c_bus *bus)
{
int ack;
I2C_SET(bus,0,1);
I2C_SET(bus,1,1);
ack = I2C_GET(bus);
I2C_SET(bus,0,1);
return ack;
}
int i2c_sendbyte(struct i2c_bus *bus,unsigned char data,int wait_for_ack)
{
int i, ack;
I2C_SET(bus,0,0);
for (i=7; i>=0; i--)
(data&(1<<i)) ? i2c_one(bus) : i2c_zero(bus);
if (wait_for_ack)
udelay(wait_for_ack);
ack=i2c_ack(bus);
I2C_DEBUG(printk("%02x%c ",(int)data,ack?'-':'+'));
return ack;
}
unsigned char i2c_readbyte(struct i2c_bus *bus,int last)
{
int i;
unsigned char data=0;
I2C_SET(bus,0,1);
for (i=7; i>=0; i--)
{
I2C_SET(bus,1,1);
if (I2C_GET(bus))
data |= (1<<i);
I2C_SET(bus,0,1);
}
last ? i2c_one(bus) : i2c_zero(bus);
I2C_DEBUG(printk("=%02x%c ",(int)data,last?'-':'+'));
return data;
}
/* ----------------------------------------------------------------------- */
int i2c_read(struct i2c_bus *bus, unsigned char addr)
{
int ret;
if (bus->i2c_read)
return bus->i2c_read(bus, addr);
i2c_start(bus);
i2c_sendbyte(bus,addr,0);
ret = i2c_readbyte(bus,1);
i2c_stop(bus);
return ret;
}
int i2c_write(struct i2c_bus *bus, unsigned char addr,
unsigned char data1, unsigned char data2, int both)
{
int ack;
if (bus->i2c_write)
return bus->i2c_write(bus, addr, data1, data2, both);
i2c_start(bus);
i2c_sendbyte(bus,addr,0);
ack = i2c_sendbyte(bus,data1,0);
if (both)
ack = i2c_sendbyte(bus,data2,0);
i2c_stop(bus);
return ack ? -1 : 0 ;
}
/* ----------------------------------------------------------------------- */
#ifdef MODULE
#if LINUX_VERSION_CODE >= 0x020100
EXPORT_SYMBOL(i2c_register_bus);
EXPORT_SYMBOL(i2c_unregister_bus);
EXPORT_SYMBOL(i2c_register_driver);
EXPORT_SYMBOL(i2c_unregister_driver);
EXPORT_SYMBOL(i2c_control_device);
EXPORT_SYMBOL(i2c_start);
EXPORT_SYMBOL(i2c_stop);
EXPORT_SYMBOL(i2c_one);
EXPORT_SYMBOL(i2c_zero);
EXPORT_SYMBOL(i2c_ack);
EXPORT_SYMBOL(i2c_sendbyte);
EXPORT_SYMBOL(i2c_readbyte);
EXPORT_SYMBOL(i2c_read);
EXPORT_SYMBOL(i2c_write);
#endif
int init_module(void)
{
return i2c_init();
}
void cleanup_module(void)
{
}
#endif
MODULE_LICENSE("GPL");
/*
* I2C driver for parallel port
*
* Author: Phil Blundell <philb@gnu.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version.
*
* This driver implements a simple I2C protocol by bit-twiddling some
* signals on the parallel port. Since the outputs on the parallel port
* aren't open collector, three lines rather than two are used:
*
* D0 clock out
* D1 data out
* BUSY data in
*/
#include <linux/parport.h>
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/i2c-old.h>
#include <linux/init.h>
#include <linux/spinlock.h>
#define I2C_DELAY 10
static int debug = 0;
struct parport_i2c_bus
{
struct i2c_bus i2c;
struct parport_i2c_bus *next;
};
static struct parport_i2c_bus *bus_list;
static spinlock_t bus_list_lock = SPIN_LOCK_UNLOCKED;
/* software I2C functions */
static void i2c_setlines(struct i2c_bus *bus, int clk, int data)
{
struct parport *p = bus->data;
parport_write_data(p, (clk?1:0) | (data?2:0));
udelay(I2C_DELAY);
}
static int i2c_getdataline(struct i2c_bus *bus)
{
struct parport *p = bus->data;
return (parport_read_status(p) & PARPORT_STATUS_BUSY) ? 0 : 1;
}
static struct i2c_bus parport_i2c_bus_template =
{
"...",
I2C_BUSID_PARPORT,
NULL,
SPIN_LOCK_UNLOCKED,
NULL,
NULL,
i2c_setlines,
i2c_getdataline,
NULL,
NULL,
};
static void i2c_parport_attach(struct parport *port)
{
struct parport_i2c_bus *b = kmalloc(sizeof(struct parport_i2c_bus),
GFP_KERNEL);
if (!b) {
printk(KERN_ERR "i2c_parport: Memory allocation failed. Not attaching.\n");
return;
}
b->i2c = parport_i2c_bus_template;
b->i2c.data = parport_get_port (port);
strncpy(b->i2c.name, port->name, 32);
spin_lock(&bus_list_lock);
b->next = bus_list;
bus_list = b;
spin_unlock(&bus_list_lock);
i2c_register_bus(&b->i2c);
if (debug)
printk(KERN_DEBUG "i2c: attached to %s\n", port->name);
}
static void i2c_parport_detach(struct parport *port)
{
struct parport_i2c_bus *b, *old_b = NULL;
spin_lock(&bus_list_lock);
b = bus_list;
while (b)
{
if (b->i2c.data == port)
{
if (old_b)
old_b->next = b->next;
else
bus_list = b->next;
i2c_unregister_bus(&b->i2c);
kfree(b);
break;
}
old_b = b;
b = b->next;
}
spin_unlock(&bus_list_lock);
if (debug)
printk(KERN_DEBUG "i2c: detached from %s\n", port->name);
}
static struct parport_driver parport_i2c_driver =
{
"i2c",
i2c_parport_attach,
i2c_parport_detach
};
#ifdef MODULE
int init_module(void)
#else
int __init i2c_parport_init(void)
#endif
{
printk("I2C: driver for parallel port v0.1 philb@gnu.org\n");
parport_register_driver(&parport_i2c_driver);
return 0;
}
#ifdef MODULE
MODULE_PARM(debug, "i");
void cleanup_module(void)
{
struct parport_i2c_bus *b = bus_list;
while (b)
{
struct parport_i2c_bus *next = b->next;
i2c_unregister_bus(&b->i2c);
kfree(b);
b = next;
}
parport_unregister_driver(&parport_i2c_driver);
}
#endif
MODULE_LICENSE("GPL");
/* /*
* I2O Configuration Interface Driver * I2O Configuration Interface Driver
* *
* (C) Copyright 1999 Red Hat Software * (C) Copyright 1999-2002 Red Hat
* *
* Written by Alan Cox, Building Number Three Ltd * Written by Alan Cox, Building Number Three Ltd
* *
...@@ -16,17 +16,17 @@ ...@@ -16,17 +16,17 @@
* - Fixed ioctl_swdl() * - Fixed ioctl_swdl()
* Modified 10/04/1999 by Taneli Vhkangas * Modified 10/04/1999 by Taneli Vhkangas
* - Changed ioctl_swdl(), implemented ioctl_swul() and ioctl_swdel() * - Changed ioctl_swdl(), implemented ioctl_swul() and ioctl_swdel()
* Modified 11/18/199 by Deepak Saxena * Modified 11/18/1999 by Deepak Saxena
* - Added event managmenet support * - Added event managmenet support
* *
* 2.4 rewrite ported to 2.5 - Alan Cox <alan@redhat.com>
*
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version * as published by the Free Software Foundation; either version
* 2 of the License, or (at your option) any later version. * 2 of the License, or (at your option) any later version.
*/ */
#error Please convert me to Documentation/DMA-mapping.txt
#include <linux/module.h> #include <linux/module.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/pci.h> #include <linux/pci.h>
...@@ -47,7 +47,7 @@ static void *page_buf; ...@@ -47,7 +47,7 @@ static void *page_buf;
static spinlock_t i2o_config_lock = SPIN_LOCK_UNLOCKED; static spinlock_t i2o_config_lock = SPIN_LOCK_UNLOCKED;
struct wait_queue *i2o_wait_queue; struct wait_queue *i2o_wait_queue;
#define MODINC(x,y) (x = x++ % y) #define MODINC(x,y) ((x) = ((x) + 1) % (y))
struct i2o_cfg_info struct i2o_cfg_info
{ {
...@@ -279,7 +279,14 @@ int ioctl_getiops(unsigned long arg) ...@@ -279,7 +279,14 @@ int ioctl_getiops(unsigned long arg)
if(c) if(c)
{ {
foo[i] = 1; foo[i] = 1;
i2o_unlock_controller(c); if(pci_set_dma_mask(c->pdev, 0xffffffff))
{
printk(KERN_WARNING "i2o_config : No suitable DMA available on controller %d\n", i);
i2o_unlock_controller(c);
continue;
}
i2o_unlock_controller(c);
} }
else else
{ {
...@@ -445,11 +452,12 @@ int ioctl_html(unsigned long arg) ...@@ -445,11 +452,12 @@ int ioctl_html(unsigned long arg)
struct i2o_controller *c; struct i2o_controller *c;
u8 *res = NULL; u8 *res = NULL;
void *query = NULL; void *query = NULL;
dma_addr_t query_phys, res_phys;
int ret = 0; int ret = 0;
int token; int token;
u32 len; u32 len;
u32 reslen; u32 reslen;
u32 msg[MSG_FRAME_SIZE/4]; u32 msg[MSG_FRAME_SIZE];
if(copy_from_user(&kcmd, cmd, sizeof(struct i2o_html))) if(copy_from_user(&kcmd, cmd, sizeof(struct i2o_html)))
{ {
...@@ -475,7 +483,7 @@ int ioctl_html(unsigned long arg) ...@@ -475,7 +483,7 @@ int ioctl_html(unsigned long arg)
if(kcmd.qlen) /* Check for post data */ if(kcmd.qlen) /* Check for post data */
{ {
query = kmalloc(kcmd.qlen, GFP_KERNEL); query = pci_alloc_consistent(c->pdev, kcmd.qlen, &query_phys);
if(!query) if(!query)
{ {
i2o_unlock_controller(c); i2o_unlock_controller(c);
...@@ -485,16 +493,16 @@ int ioctl_html(unsigned long arg) ...@@ -485,16 +493,16 @@ int ioctl_html(unsigned long arg)
{ {
i2o_unlock_controller(c); i2o_unlock_controller(c);
printk(KERN_INFO "i2o_config: could not get query\n"); printk(KERN_INFO "i2o_config: could not get query\n");
kfree(query); pci_free_consistent(c->pdev, kcmd.qlen, query, query_phys);
return -EFAULT; return -EFAULT;
} }
} }
res = kmalloc(65536, GFP_KERNEL); res = pci_alloc_consistent(c->pdev, 65536, &res_phys);
if(!res) if(!res)
{ {
i2o_unlock_controller(c); i2o_unlock_controller(c);
kfree(query); pci_free_consistent(c->pdev, kcmd.qlen, query, query_phys);
return -ENOMEM; return -ENOMEM;
} }
...@@ -503,7 +511,7 @@ int ioctl_html(unsigned long arg) ...@@ -503,7 +511,7 @@ int ioctl_html(unsigned long arg)
msg[3] = 0; msg[3] = 0;
msg[4] = kcmd.page; msg[4] = kcmd.page;
msg[5] = 0xD0000000|65536; msg[5] = 0xD0000000|65536;
msg[6] = virt_to_bus(res); msg[6] = res_phys;
if(!kcmd.qlen) /* Check for post data */ if(!kcmd.qlen) /* Check for post data */
msg[0] = SEVEN_WORD_MSG_SIZE|SGL_OFFSET_5; msg[0] = SEVEN_WORD_MSG_SIZE|SGL_OFFSET_5;
else else
...@@ -511,7 +519,7 @@ int ioctl_html(unsigned long arg) ...@@ -511,7 +519,7 @@ int ioctl_html(unsigned long arg)
msg[0] = NINE_WORD_MSG_SIZE|SGL_OFFSET_5; msg[0] = NINE_WORD_MSG_SIZE|SGL_OFFSET_5;
msg[5] = 0x50000000|65536; msg[5] = 0x50000000|65536;
msg[7] = 0xD4000000|(kcmd.qlen); msg[7] = 0xD4000000|(kcmd.qlen);
msg[8] = virt_to_bus(query); msg[8] = query_phys;
} }
/* /*
Wait for a considerable time till the Controller Wait for a considerable time till the Controller
...@@ -519,7 +527,7 @@ int ioctl_html(unsigned long arg) ...@@ -519,7 +527,7 @@ int ioctl_html(unsigned long arg)
take more time to process this request if there are take more time to process this request if there are
many devices connected to it. many devices connected to it.
*/ */
token = i2o_post_wait_mem(c, msg, 9*4, 400, query, res); token = i2o_post_wait_mem(c, msg, 9*4, 400, query, res, query_phys, res_phys, kcmd.qlen, 65536);
if(token < 0) if(token < 0)
{ {
printk(KERN_DEBUG "token = %#10x\n", token); printk(KERN_DEBUG "token = %#10x\n", token);
...@@ -527,10 +535,10 @@ int ioctl_html(unsigned long arg) ...@@ -527,10 +535,10 @@ int ioctl_html(unsigned long arg)
if(token != -ETIMEDOUT) if(token != -ETIMEDOUT)
{ {
kfree(res); pci_free_consistent(c->pdev, 65536, res, res_phys);
if(kcmd.qlen) kfree(query); if(kcmd.qlen)
pci_free_consistent(c->pdev, kcmd.qlen, query, query_phys);
} }
return token; return token;
} }
i2o_unlock_controller(c); i2o_unlock_controller(c);
...@@ -542,9 +550,9 @@ int ioctl_html(unsigned long arg) ...@@ -542,9 +550,9 @@ int ioctl_html(unsigned long arg)
if(copy_to_user(kcmd.resbuf, res, len)) if(copy_to_user(kcmd.resbuf, res, len))
ret = -EFAULT; ret = -EFAULT;
kfree(res); pci_free_consistent(c->pdev, 65536, res, res_phys);
if(kcmd.qlen) if(kcmd.qlen)
kfree(query); pci_free_consistent(c->pdev, kcmd.qlen, query, query_phys);
return ret; return ret;
} }
...@@ -558,6 +566,7 @@ int ioctl_swdl(unsigned long arg) ...@@ -558,6 +566,7 @@ int ioctl_swdl(unsigned long arg)
u32 msg[9]; u32 msg[9];
unsigned int status = 0, swlen = 0, fragsize = 8192; unsigned int status = 0, swlen = 0, fragsize = 8192;
struct i2o_controller *c; struct i2o_controller *c;
dma_addr_t buffer_phys;
if(copy_from_user(&kxfer, pxfer, sizeof(struct i2o_sw_xfer))) if(copy_from_user(&kxfer, pxfer, sizeof(struct i2o_sw_xfer)))
return -EFAULT; return -EFAULT;
...@@ -580,7 +589,7 @@ int ioctl_swdl(unsigned long arg) ...@@ -580,7 +589,7 @@ int ioctl_swdl(unsigned long arg)
if(!c) if(!c)
return -ENXIO; return -ENXIO;
buffer=kmalloc(fragsize, GFP_KERNEL); buffer=pci_alloc_consistent(c->pdev, fragsize, &buffer_phys);
if (buffer==NULL) if (buffer==NULL)
{ {
i2o_unlock_controller(c); i2o_unlock_controller(c);
...@@ -597,14 +606,14 @@ int ioctl_swdl(unsigned long arg) ...@@ -597,14 +606,14 @@ int ioctl_swdl(unsigned long arg)
msg[5]= swlen; msg[5]= swlen;
msg[6]= kxfer.sw_id; msg[6]= kxfer.sw_id;
msg[7]= (0xD0000000 | fragsize); msg[7]= (0xD0000000 | fragsize);
msg[8]= virt_to_bus(buffer); msg[8]= buffer_phys;
// printk("i2o_config: swdl frag %d/%d (size %d)\n", curfrag, maxfrag, fragsize); // printk("i2o_config: swdl frag %d/%d (size %d)\n", curfrag, maxfrag, fragsize);
status = i2o_post_wait_mem(c, msg, sizeof(msg), 60, buffer, NULL); status = i2o_post_wait_mem(c, msg, sizeof(msg), 60, buffer, NULL, buffer_phys, 0, fragsize, 0);
i2o_unlock_controller(c); i2o_unlock_controller(c);
if(status != -ETIMEDOUT) if(status != -ETIMEDOUT)
kfree(buffer); pci_free_consistent(c->pdev, fragsize, buffer, buffer_phys);
if (status != I2O_POST_WAIT_OK) if (status != I2O_POST_WAIT_OK)
{ {
...@@ -626,7 +635,8 @@ int ioctl_swul(unsigned long arg) ...@@ -626,7 +635,8 @@ int ioctl_swul(unsigned long arg)
u32 msg[9]; u32 msg[9];
unsigned int status = 0, swlen = 0, fragsize = 8192; unsigned int status = 0, swlen = 0, fragsize = 8192;
struct i2o_controller *c; struct i2o_controller *c;
dma_addr_t buffer_phys;
if(copy_from_user(&kxfer, pxfer, sizeof(struct i2o_sw_xfer))) if(copy_from_user(&kxfer, pxfer, sizeof(struct i2o_sw_xfer)))
return -EFAULT; return -EFAULT;
...@@ -648,7 +658,7 @@ int ioctl_swul(unsigned long arg) ...@@ -648,7 +658,7 @@ int ioctl_swul(unsigned long arg)
if(!c) if(!c)
return -ENXIO; return -ENXIO;
buffer=kmalloc(fragsize, GFP_KERNEL); buffer=pci_alloc_consistent(c->pdev, fragsize, &buffer_phys);
if (buffer==NULL) if (buffer==NULL)
{ {
i2o_unlock_controller(c); i2o_unlock_controller(c);
...@@ -663,22 +673,22 @@ int ioctl_swul(unsigned long arg) ...@@ -663,22 +673,22 @@ int ioctl_swul(unsigned long arg)
msg[5]= swlen; msg[5]= swlen;
msg[6]= kxfer.sw_id; msg[6]= kxfer.sw_id;
msg[7]= (0xD0000000 | fragsize); msg[7]= (0xD0000000 | fragsize);
msg[8]= virt_to_bus(buffer); msg[8]= buffer_phys;
// printk("i2o_config: swul frag %d/%d (size %d)\n", curfrag, maxfrag, fragsize); // printk("i2o_config: swul frag %d/%d (size %d)\n", curfrag, maxfrag, fragsize);
status = i2o_post_wait_mem(c, msg, sizeof(msg), 60, buffer, NULL); status = i2o_post_wait_mem(c, msg, sizeof(msg), 60, buffer, NULL, buffer_phys, 0, fragsize, 0);
i2o_unlock_controller(c); i2o_unlock_controller(c);
if (status != I2O_POST_WAIT_OK) if (status != I2O_POST_WAIT_OK)
{ {
if(status != -ETIMEDOUT) if(status != -ETIMEDOUT)
kfree(buffer); pci_free_consistent(c->pdev, fragsize, buffer, buffer_phys);
printk(KERN_INFO "i2o_config: swul failed, DetailedStatus = %d\n", status); printk(KERN_INFO "i2o_config: swul failed, DetailedStatus = %d\n", status);
return status; return status;
} }
__copy_to_user(kxfer.buf, buffer, fragsize); __copy_to_user(kxfer.buf, buffer, fragsize);
kfree(buffer); pci_free_consistent(c->pdev, fragsize, buffer, buffer_phys);
return 0; return 0;
} }
...@@ -849,6 +859,7 @@ static int cfg_release(struct inode *inode, struct file *file) ...@@ -849,6 +859,7 @@ static int cfg_release(struct inode *inode, struct file *file)
struct i2o_cfg_info *p1, *p2; struct i2o_cfg_info *p1, *p2;
unsigned long flags; unsigned long flags;
lock_kernel();
p1 = p2 = NULL; p1 = p2 = NULL;
spin_lock_irqsave(&i2o_config_lock, flags); spin_lock_irqsave(&i2o_config_lock, flags);
...@@ -871,6 +882,7 @@ static int cfg_release(struct inode *inode, struct file *file) ...@@ -871,6 +882,7 @@ static int cfg_release(struct inode *inode, struct file *file)
p1 = p1->next; p1 = p1->next;
} }
spin_unlock_irqrestore(&i2o_config_lock, flags); spin_unlock_irqrestore(&i2o_config_lock, flags);
unlock_kernel();
return 0; return 0;
} }
...@@ -908,11 +920,7 @@ static struct miscdevice i2o_miscdev = { ...@@ -908,11 +920,7 @@ static struct miscdevice i2o_miscdev = {
&config_fops &config_fops
}; };
#ifdef MODULE static int __init i2o_config_init(void)
int init_module(void)
#else
int __init i2o_config_init(void)
#endif
{ {
printk(KERN_INFO "I2O configuration manager v 0.04.\n"); printk(KERN_INFO "I2O configuration manager v 0.04.\n");
printk(KERN_INFO " (C) Copyright 1999 Red Hat Software\n"); printk(KERN_INFO " (C) Copyright 1999 Red Hat Software\n");
...@@ -946,9 +954,7 @@ int __init i2o_config_init(void) ...@@ -946,9 +954,7 @@ int __init i2o_config_init(void)
return 0; return 0;
} }
#ifdef MODULE static void i2o_config_exit(void)
void cleanup_module(void)
{ {
misc_deregister(&i2o_miscdev); misc_deregister(&i2o_miscdev);
...@@ -958,8 +964,10 @@ void cleanup_module(void) ...@@ -958,8 +964,10 @@ void cleanup_module(void)
i2o_remove_handler(&cfg_handler); i2o_remove_handler(&cfg_handler);
} }
EXPORT_NO_SYMBOLS;
MODULE_AUTHOR("Red Hat Software"); MODULE_AUTHOR("Red Hat Software");
MODULE_DESCRIPTION("I2O Configuration"); MODULE_DESCRIPTION("I2O Configuration");
MODULE_LICENSE("GPL"); MODULE_LICENSE("GPL");
#endif module_init(i2o_config_init);
module_exit(i2o_config_exit);
This diff is collapsed.
This diff is collapsed.
...@@ -45,6 +45,7 @@ ...@@ -45,6 +45,7 @@
#include <linux/proc_fs.h> #include <linux/proc_fs.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/tqueue.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
......
...@@ -22,6 +22,7 @@ static const char *awc_version = ...@@ -22,6 +22,7 @@ static const char *awc_version =
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/tqueue.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/string.h> #include <linux/string.h>
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/config.h> #include <linux/config.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/tqueue.h>
#include <linux/netdevice.h> #include <linux/netdevice.h>
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/skbuff.h> #include <linux/skbuff.h>
......
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
#include <linux/version.h> #include <linux/version.h>
#include <linux/sched.h> #include <linux/sched.h>
#include <linux/tqueue.h>
#include <linux/ptrace.h> #include <linux/ptrace.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/string.h> #include <linux/string.h>
......
This diff is collapsed.
...@@ -169,15 +169,22 @@ typedef u8 TLanBuffer[TLAN_MAX_FRAME_SIZE]; ...@@ -169,15 +169,22 @@ typedef u8 TLanBuffer[TLAN_MAX_FRAME_SIZE];
typedef struct tlan_private_tag { typedef struct tlan_private_tag {
struct net_device *nextDevice; struct net_device *nextDevice;
struct pci_dev *pciDev;
void *dmaStorage; void *dmaStorage;
dma_addr_t dmaStorageDMA;
unsigned int dmaSize;
u8 *padBuffer; u8 *padBuffer;
TLanList *rxList; TLanList *rxList;
dma_addr_t rxListDMA;
u8 *rxBuffer; u8 *rxBuffer;
dma_addr_t rxBufferDMA;
u32 rxHead; u32 rxHead;
u32 rxTail; u32 rxTail;
u32 rxEocCount; u32 rxEocCount;
TLanList *txList; TLanList *txList;
dma_addr_t txListDMA;
u8 *txBuffer; u8 *txBuffer;
dma_addr_t txBufferDMA;
u32 txHead; u32 txHead;
u32 txInProgress; u32 txInProgress;
u32 txTail; u32 txTail;
......
...@@ -2178,7 +2178,7 @@ static int de_suspend (struct pci_dev *pdev, u32 state) ...@@ -2178,7 +2178,7 @@ static int de_suspend (struct pci_dev *pdev, u32 state)
/* Update the error counts. */ /* Update the error counts. */
__de_get_stats(de); __de_get_stats(de);
synchronize_irq(); synchronize_irq(dev->irq);
de_clean_rings(de); de_clean_rings(de);
de_adapter_sleep(de); de_adapter_sleep(de);
......
...@@ -1522,7 +1522,7 @@ de4x5_sw_reset(struct net_device *dev) ...@@ -1522,7 +1522,7 @@ de4x5_sw_reset(struct net_device *dev)
outl(omr|OMR_ST, DE4X5_OMR); outl(omr|OMR_ST, DE4X5_OMR);
/* Poll for setup frame completion (adapter interrupts are disabled now) */ /* Poll for setup frame completion (adapter interrupts are disabled now) */
sti(); /* Ensure timer interrupts */
for (j=0, i=0;(i<500) && (j==0);i++) { /* Upto 500ms delay */ for (j=0, i=0;(i<500) && (j==0);i++) { /* Upto 500ms delay */
mdelay(1); mdelay(1);
if ((s32)le32_to_cpu(lp->tx_ring[lp->tx_new].status) >= 0) j=1; if ((s32)le32_to_cpu(lp->tx_ring[lp->tx_new].status) >= 0) j=1;
...@@ -1644,7 +1644,7 @@ de4x5_interrupt(int irq, void *dev_id, struct pt_regs *regs) ...@@ -1644,7 +1644,7 @@ de4x5_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if (test_and_set_bit(MASK_INTERRUPTS, (void*) &lp->interrupt)) if (test_and_set_bit(MASK_INTERRUPTS, (void*) &lp->interrupt))
printk("%s: Re-entering the interrupt handler.\n", dev->name); printk("%s: Re-entering the interrupt handler.\n", dev->name);
synchronize_irq(); synchronize_irq(dev->irq);
for (limit=0; limit<8; limit++) { for (limit=0; limit<8; limit++) {
sts = inl(DE4X5_STS); /* Read IRQ status */ sts = inl(DE4X5_STS); /* Read IRQ status */
......
...@@ -1674,7 +1674,7 @@ static int w840_suspend (struct pci_dev *pdev, u32 state) ...@@ -1674,7 +1674,7 @@ static int w840_suspend (struct pci_dev *pdev, u32 state)
spin_unlock_irq(&np->lock); spin_unlock_irq(&np->lock);
spin_unlock_wait(&dev->xmit_lock); spin_unlock_wait(&dev->xmit_lock);
synchronize_irq(); synchronize_irq(dev->irq);
np->stats.rx_missed_errors += readl(ioaddr + RxMissed) & 0xffff; np->stats.rx_missed_errors += readl(ioaddr + RxMissed) & 0xffff;
......
...@@ -33,7 +33,7 @@ if [ "$CONFIG_PCMCIA" != "n" ]; then ...@@ -33,7 +33,7 @@ if [ "$CONFIG_PCMCIA" != "n" ]; then
# 802.11b cards # 802.11b cards
dep_tristate ' Hermes PCMCIA card support' CONFIG_PCMCIA_HERMES $CONFIG_HERMES dep_tristate ' Hermes PCMCIA card support' CONFIG_PCMCIA_HERMES $CONFIG_HERMES
tristate ' Cisco/Aironet 34X/35X/4500/4800 PCMCIA cards' CONFIG_AIRO_CS dep_tristate ' Cisco/Aironet 34X/35X/4500/4800 PCMCIA cards' CONFIG_AIRO_CS $CONFIG_PCMCIA
fi fi
# yes, this works even when no drivers are selected # yes, this works even when no drivers are selected
......
...@@ -456,11 +456,27 @@ static void __init quirk_amd_ordering(struct pci_dev *dev) ...@@ -456,11 +456,27 @@ static void __init quirk_amd_ordering(struct pci_dev *dev)
} }
} }
/*
* DreamWorks provided workaround for Dunord I-3000 problem
*
* This card decodes and responds to addresses not apparently
* assigned to it. We force a larger allocation to ensure that
* nothing gets put too close to it.
*/
static void __init quirk_dunord ( struct pci_dev * dev )
{
struct resource * r = & dev -> resource [ 1 ];
r -> start = 0;
r -> end = 0xffffff;
}
/* /*
* The main table of quirks. * The main table of quirks.
*/ */
static struct pci_fixup pci_fixups[] __initdata = { static struct pci_fixup pci_fixups[] __initdata = {
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_DUNORD, PCI_DEVICE_ID_DUNORD_I3000, quirk_dunord },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82441, quirk_passive_release }, { PCI_FIXUP_FINAL, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82441, quirk_passive_release },
{ PCI_FIXUP_FINAL, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82441, quirk_passive_release }, { PCI_FIXUP_FINAL, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82441, quirk_passive_release },
/* /*
......
This diff is collapsed.
...@@ -17,14 +17,12 @@ ...@@ -17,14 +17,12 @@
#define MAX_CDB 12 #define MAX_CDB 12
#define MAX_SENSE 14 #define MAX_SENSE 14
int atp870u_detect(Scsi_Host_Template *); static int atp870u_detect(Scsi_Host_Template *);
int atp870u_command(Scsi_Cmnd *); static int atp870u_command(Scsi_Cmnd *);
int atp870u_queuecommand(Scsi_Cmnd *, void (*done) (Scsi_Cmnd *)); static int atp870u_queuecommand(Scsi_Cmnd *, void (*done) (Scsi_Cmnd *));
int atp870u_abort(Scsi_Cmnd *); static int atp870u_abort(Scsi_Cmnd *);
int atp870u_reset(Scsi_Cmnd *, unsigned int); static int atp870u_biosparam(Disk *, struct block_device *, int *);
int atp870u_biosparam(Disk *, struct block_device *, int *); static int atp870u_release(struct Scsi_Host *);
int atp870u_release(struct Scsi_Host *);
void send_s870(unsigned char);
#define qcnt 32 #define qcnt 32
#define ATP870U_SCATTER 128 #define ATP870U_SCATTER 128
...@@ -49,12 +47,7 @@ extern int atp870u_proc_info(char *, char **, off_t, int, int, int); ...@@ -49,12 +47,7 @@ extern int atp870u_proc_info(char *, char **, off_t, int, int, int);
command: atp870u_command, \ command: atp870u_command, \
queuecommand: atp870u_queuecommand, \ queuecommand: atp870u_queuecommand, \
eh_strategy_handler: NULL, \ eh_strategy_handler: NULL, \
eh_abort_handler: NULL, \ eh_abort_handler: atp870u_abort, \
eh_device_reset_handler: NULL, \
eh_bus_reset_handler: NULL, \
eh_host_reset_handler: NULL, \
abort: atp870u_abort, \
reset: atp870u_reset, \
slave_attach: NULL, \ slave_attach: NULL, \
bios_param: atp870u_biosparam, \ bios_param: atp870u_biosparam, \
can_queue: qcnt, /* max simultaneous cmds */\ can_queue: qcnt, /* max simultaneous cmds */\
......
...@@ -301,17 +301,23 @@ static ssize_t do_readv_writev(int type, struct file *file, ...@@ -301,17 +301,23 @@ static ssize_t do_readv_writev(int type, struct file *file,
if (copy_from_user(iov, vector, count*sizeof(*vector))) if (copy_from_user(iov, vector, count*sizeof(*vector)))
goto out; goto out;
/* BSD readv/writev returns EINVAL if one of the iov_len /*
values < 0 or tot_len overflowed a 32-bit integer. -ink */ * Single unix specification:
* We should -EINVAL if an element length is not >= 0 and fitting an ssize_t
* The total length is fitting an ssize_t
*
* Be careful here because iov_len is a size_t not an ssize_t
*/
tot_len = 0; tot_len = 0;
ret = -EINVAL; ret = -EINVAL;
for (i = 0 ; i < count ; i++) { for (i = 0 ; i < count ; i++) {
size_t tmp = tot_len; ssize_t tmp = tot_len;
int len = iov[i].iov_len; ssize_t len = (ssize_t)iov[i].iov_len;
if (len < 0) if (len < 0) /* size_t not fitting an ssize_t .. */
goto out; goto out;
(u32)tot_len += len; tot_len += len;
if (tot_len < tmp || tot_len < (u32)len) if (tot_len < tmp) /* maths overflow on the ssize_t */
goto out; goto out;
} }
......
...@@ -81,9 +81,9 @@ struct i2o_device ...@@ -81,9 +81,9 @@ struct i2o_device
struct i2o_pci struct i2o_pci
{ {
int irq; int irq;
int queue_buggy:3; /* Don't send a lot of messages */
int short_req:1; /* Use small block sizes */ int short_req:1; /* Use small block sizes */
int dpt:1; /* Don't quiesce */ int dpt:1; /* Don't quiesce */
int promise:1; /* Promise controller */
#ifdef CONFIG_MTRR #ifdef CONFIG_MTRR
int mtrr_reg0; int mtrr_reg0;
int mtrr_reg1; int mtrr_reg1;
...@@ -112,9 +112,9 @@ struct i2o_controller ...@@ -112,9 +112,9 @@ struct i2o_controller
atomic_t users; atomic_t users;
struct i2o_device *devices; /* I2O device chain */ struct i2o_device *devices; /* I2O device chain */
struct i2o_controller *next; /* Controller chain */ struct i2o_controller *next; /* Controller chain */
volatile u32 *post_port; /* Inbout port */ unsigned long post_port; /* Inbout port address */
volatile u32 *reply_port; /* Outbound port */ unsigned long reply_port; /* Outbound port address */
volatile u32 *irq_mask; /* Interrupt register */ unsigned long irq_mask; /* Interrupt register address */
/* Dynamic LCT related data */ /* Dynamic LCT related data */
struct semaphore lct_sem; struct semaphore lct_sem;
...@@ -122,12 +122,17 @@ struct i2o_controller ...@@ -122,12 +122,17 @@ struct i2o_controller
int lct_running; int lct_running;
i2o_status_block *status_block; /* IOP status block */ i2o_status_block *status_block; /* IOP status block */
dma_addr_t status_block_phys;
i2o_lct *lct; /* Logical Config Table */ i2o_lct *lct; /* Logical Config Table */
dma_addr_t lct_phys;
i2o_lct *dlct; /* Temp LCT */ i2o_lct *dlct; /* Temp LCT */
dma_addr_t dlct_phys;
i2o_hrt *hrt; /* HW Resource Table */ i2o_hrt *hrt; /* HW Resource Table */
dma_addr_t hrt_phys;
u32 hrt_len;
u32 mem_offset; /* MFA offset */ unsigned long mem_offset; /* MFA offset */
u32 mem_phys; /* MFA physical */ unsigned long mem_phys; /* MFA physical */
int battery:1; /* Has a battery backup */ int battery:1; /* Has a battery backup */
int io_alloc:1; /* An I/O resource was allocated */ int io_alloc:1; /* An I/O resource was allocated */
...@@ -252,34 +257,34 @@ struct i2o_sys_tbl ...@@ -252,34 +257,34 @@ struct i2o_sys_tbl
*/ */
static inline u32 I2O_POST_READ32(struct i2o_controller *c) static inline u32 I2O_POST_READ32(struct i2o_controller *c)
{ {
return *c->post_port; return readl(c->post_port);
} }
static inline void I2O_POST_WRITE32(struct i2o_controller *c, u32 Val) static inline void I2O_POST_WRITE32(struct i2o_controller *c, u32 val)
{ {
*c->post_port = Val; writel(val, c->post_port);
} }
static inline u32 I2O_REPLY_READ32(struct i2o_controller *c) static inline u32 I2O_REPLY_READ32(struct i2o_controller *c)
{ {
return *c->reply_port; return readl(c->reply_port);
} }
static inline void I2O_REPLY_WRITE32(struct i2o_controller *c, u32 Val) static inline void I2O_REPLY_WRITE32(struct i2o_controller *c, u32 val)
{ {
*c->reply_port = Val; writel(val, c->reply_port);
} }
static inline u32 I2O_IRQ_READ32(struct i2o_controller *c) static inline u32 I2O_IRQ_READ32(struct i2o_controller *c)
{ {
return *c->irq_mask; return readl(c->irq_mask);
} }
static inline void I2O_IRQ_WRITE32(struct i2o_controller *c, u32 Val) static inline void I2O_IRQ_WRITE32(struct i2o_controller *c, u32 val)
{ {
*c->irq_mask = Val; writel(val, c->irq_mask);
} }
...@@ -295,6 +300,13 @@ static inline void i2o_flush_reply(struct i2o_controller *c, u32 m) ...@@ -295,6 +300,13 @@ static inline void i2o_flush_reply(struct i2o_controller *c, u32 m)
I2O_REPLY_WRITE32(c, m); I2O_REPLY_WRITE32(c, m);
} }
/*
* Endian handling wrapped into the macro - keeps the core code
* cleaner.
*/
#define i2o_raw_writel(val, mem) __raw_writel(cpu_to_le32(val), mem)
extern struct i2o_controller *i2o_find_controller(int); extern struct i2o_controller *i2o_find_controller(int);
extern void i2o_unlock_controller(struct i2o_controller *); extern void i2o_unlock_controller(struct i2o_controller *);
extern struct i2o_controller *i2o_controller_chain; extern struct i2o_controller *i2o_controller_chain;
...@@ -313,7 +325,7 @@ extern int i2o_device_notify_off(struct i2o_device *, ...@@ -313,7 +325,7 @@ extern int i2o_device_notify_off(struct i2o_device *,
extern int i2o_post_this(struct i2o_controller *, u32 *, int); extern int i2o_post_this(struct i2o_controller *, u32 *, int);
extern int i2o_post_wait(struct i2o_controller *, u32 *, int, int); extern int i2o_post_wait(struct i2o_controller *, u32 *, int, int);
extern int i2o_post_wait_mem(struct i2o_controller *, u32 *, int, int, extern int i2o_post_wait_mem(struct i2o_controller *, u32 *, int, int,
void *, void *); void *, void *, dma_addr_t, dma_addr_t, int, int);
extern int i2o_query_scalar(struct i2o_controller *, int, int, int, void *, extern int i2o_query_scalar(struct i2o_controller *, int, int, int, void *,
int); int);
...@@ -339,13 +351,66 @@ extern int i2o_activate_controller(struct i2o_controller *); ...@@ -339,13 +351,66 @@ extern int i2o_activate_controller(struct i2o_controller *);
extern void i2o_run_queue(struct i2o_controller *); extern void i2o_run_queue(struct i2o_controller *);
extern int i2o_delete_controller(struct i2o_controller *); extern int i2o_delete_controller(struct i2o_controller *);
/*
* Cache strategies
*/
/* The NULL strategy leaves everything up to the controller. This tends to be a
* pessimal but functional choice.
*/
#define CACHE_NULL 0
/* Prefetch data when reading. We continually attempt to load the next 32 sectors
* into the controller cache.
*/
#define CACHE_PREFETCH 1
/* Prefetch data when reading. We sometimes attempt to load the next 32 sectors
* into the controller cache. When an I/O is less <= 8K we assume its probably
* not sequential and don't prefetch (default)
*/
#define CACHE_SMARTFETCH 2
/* Data is written to the cache and then out on to the disk. The I/O must be
* physically on the medium before the write is acknowledged (default without
* NVRAM)
*/
#define CACHE_WRITETHROUGH 17
/* Data is written to the cache and then out on to the disk. The controller
* is permitted to write back the cache any way it wants. (default if battery
* backed NVRAM is present). It can be useful to set this for swap regardless of
* battery state.
*/
#define CACHE_WRITEBACK 18
/* Optimise for under powered controllers, especially on RAID1 and RAID0. We
* write large I/O's directly to disk bypassing the cache to avoid the extra
* memory copy hits. Small writes are writeback cached
*/
#define CACHE_SMARTBACK 19
/* Optimise for under powered controllers, especially on RAID1 and RAID0. We
* write large I/O's directly to disk bypassing the cache to avoid the extra
* memory copy hits. Small writes are writethrough cached. Suitable for devices
* lacking battery backup
*/
#define CACHE_SMARTTHROUGH 20
/*
* Ioctl structures
*/
#define BLKI2OGRSTRAT _IOR('2', 1, int)
#define BLKI2OGWSTRAT _IOR('2', 2, int)
#define BLKI2OSRSTRAT _IOW('2', 3, int)
#define BLKI2OSWSTRAT _IOW('2', 4, int)
/* /*
* I2O Function codes * I2O Function codes
*/ */
/* /*
* Executive Class * Executive Class
*/ */
#define I2O_CMD_ADAPTER_ASSIGN 0xB3 #define I2O_CMD_ADAPTER_ASSIGN 0xB3
#define I2O_CMD_ADAPTER_READ 0xB2 #define I2O_CMD_ADAPTER_READ 0xB2
...@@ -416,6 +481,7 @@ extern int i2o_delete_controller(struct i2o_controller *); ...@@ -416,6 +481,7 @@ extern int i2o_delete_controller(struct i2o_controller *);
#define I2O_CMD_BLOCK_MUNLOCK 0x4B #define I2O_CMD_BLOCK_MUNLOCK 0x4B
#define I2O_CMD_BLOCK_MMOUNT 0x41 #define I2O_CMD_BLOCK_MMOUNT 0x41
#define I2O_CMD_BLOCK_MEJECT 0x43 #define I2O_CMD_BLOCK_MEJECT 0x43
#define I2O_CMD_BLOCK_POWER 0x70
#define I2O_PRIVATE_MSG 0xFF #define I2O_PRIVATE_MSG 0xFF
...@@ -574,6 +640,7 @@ extern int i2o_delete_controller(struct i2o_controller *); ...@@ -574,6 +640,7 @@ extern int i2o_delete_controller(struct i2o_controller *);
#define EIGHT_WORD_MSG_SIZE 0x00080000 #define EIGHT_WORD_MSG_SIZE 0x00080000
#define NINE_WORD_MSG_SIZE 0x00090000 #define NINE_WORD_MSG_SIZE 0x00090000
#define TEN_WORD_MSG_SIZE 0x000A0000 #define TEN_WORD_MSG_SIZE 0x000A0000
#define ELEVEN_WORD_MSG_SIZE 0x000B0000
#define I2O_MESSAGE_SIZE(x) ((x)<<16) #define I2O_MESSAGE_SIZE(x) ((x)<<16)
...@@ -582,10 +649,10 @@ extern int i2o_delete_controller(struct i2o_controller *); ...@@ -582,10 +649,10 @@ extern int i2o_delete_controller(struct i2o_controller *);
#define ADAPTER_TID 0 #define ADAPTER_TID 0
#define HOST_TID 1 #define HOST_TID 1
#define MSG_FRAME_SIZE 128 #define MSG_FRAME_SIZE 64 /* i2o_scsi assumes >= 32 */
#define NMBR_MSG_FRAMES 128 #define NMBR_MSG_FRAMES 128
#define MSG_POOL_SIZE 16384 #define MSG_POOL_SIZE (MSG_FRAME_SIZE*NMBR_MSG_FRAMES*sizeof(u32))
#define I2O_POST_WAIT_OK 0 #define I2O_POST_WAIT_OK 0
#define I2O_POST_WAIT_TIMEOUT -ETIMEDOUT #define I2O_POST_WAIT_TIMEOUT -ETIMEDOUT
......
...@@ -1612,6 +1612,9 @@ ...@@ -1612,6 +1612,9 @@
#define PCI_DEVICE_ID_DCI_PCCOM4 0x0001 #define PCI_DEVICE_ID_DCI_PCCOM4 0x0001
#define PCI_DEVICE_ID_DCI_PCCOM8 0x0002 #define PCI_DEVICE_ID_DCI_PCCOM8 0x0002
#define PCI_VENDOR_ID_DUNORD 0x5544
#define PCI_DEVICE_ID_DUNORD_I3000 0x0001
#define PCI_VENDOR_ID_GENROCO 0x5555 #define PCI_VENDOR_ID_GENROCO 0x5555
#define PCI_DEVICE_ID_GENROCO_HFP832 0x0003 #define PCI_DEVICE_ID_GENROCO_HFP832 0x0003
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
#include <linux/delay.h> #include <linux/delay.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/ioport.h> #include <linux/ioport.h>
#include <linux/init.h>
#include <sound/core.h> #include <sound/core.h>
#include <sound/ad1848.h> #include <sound/ad1848.h>
......
...@@ -1733,7 +1733,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd, ...@@ -1733,7 +1733,7 @@ static int i810_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
} }
spin_unlock_irqrestore(&state->card->lock, flags); spin_unlock_irqrestore(&state->card->lock, flags);
synchronize_irq(); synchronize_irq(state->card->irq);
dmabuf->ready = 0; dmabuf->ready = 0;
dmabuf->swptr = dmabuf->hwptr = 0; dmabuf->swptr = dmabuf->hwptr = 0;
dmabuf->count = dmabuf->total_bytes = 0; dmabuf->count = dmabuf->total_bytes = 0;
...@@ -2814,15 +2814,14 @@ static void __init i810_configure_clocking (void) ...@@ -2814,15 +2814,14 @@ static void __init i810_configure_clocking (void)
} }
dmabuf->count = dmabuf->dmasize; dmabuf->count = dmabuf->dmasize;
outb(31,card->iobase+dmabuf->write_channel->port+OFF_LVI); outb(31,card->iobase+dmabuf->write_channel->port+OFF_LVI);
save_flags(flags); local_irq_save(flags);
cli();
start_dac(state); start_dac(state);
offset = i810_get_dma_addr(state, 0); offset = i810_get_dma_addr(state, 0);
mdelay(50); mdelay(50);
new_offset = i810_get_dma_addr(state, 0); new_offset = i810_get_dma_addr(state, 0);
stop_dac(state); stop_dac(state);
outb(2,card->iobase+dmabuf->write_channel->port+OFF_CR); outb(2,card->iobase+dmabuf->write_channel->port+OFF_CR);
restore_flags(flags); local_irq_restore(flags);
i = new_offset - offset; i = new_offset - offset;
#ifdef DEBUG #ifdef DEBUG
printk("i810_audio: %d bytes in 50 milliseconds\n", i); printk("i810_audio: %d bytes in 50 milliseconds\n", i);
......
...@@ -8,6 +8,7 @@ dep_tristate 'Cirrus Logic (Sound Fusion) CS4280/CS461x/CS462x/CS463x' CONFIG_SN ...@@ -8,6 +8,7 @@ dep_tristate 'Cirrus Logic (Sound Fusion) CS4280/CS461x/CS462x/CS463x' CONFIG_SN
if [ "$CONFIG_SND_CS46XX" != "n" ]; then if [ "$CONFIG_SND_CS46XX" != "n" ]; then
bool ' Cirrus Logic (Sound Fusion) MMAP support for OSS' CONFIG_SND_CS46XX_ACCEPT_VALID bool ' Cirrus Logic (Sound Fusion) MMAP support for OSS' CONFIG_SND_CS46XX_ACCEPT_VALID
fi fi
dep_tristate 'Cirrus Logic (Sound Fusion) CS4281' CONFIG_SND_CS4281 $CONFIG_SND
dep_tristate 'EMU10K1 (SB Live!, E-mu APS)' CONFIG_SND_EMU10K1 $CONFIG_SND dep_tristate 'EMU10K1 (SB Live!, E-mu APS)' CONFIG_SND_EMU10K1 $CONFIG_SND
dep_tristate 'Korg 1212 IO' CONFIG_SND_KORG1212 $CONFIG_SND dep_tristate 'Korg 1212 IO' CONFIG_SND_KORG1212 $CONFIG_SND
dep_tristate 'NeoMagic NM256AV/ZX' CONFIG_SND_NM256 $CONFIG_SND dep_tristate 'NeoMagic NM256AV/ZX' CONFIG_SND_NM256 $CONFIG_SND
......
...@@ -1968,7 +1968,7 @@ static void snd_ali_resume(struct pci_dev *dev) ...@@ -1968,7 +1968,7 @@ static void snd_ali_resume(struct pci_dev *dev)
static int snd_ali_free(ali_t * codec) static int snd_ali_free(ali_t * codec)
{ {
snd_ali_disable_address_interrupt(codec); snd_ali_disable_address_interrupt(codec);
synchronize_irq(); synchronize_irq(codec->irq);
if (codec->irq >=0) if (codec->irq >=0)
free_irq(codec->irq, (void *)codec); free_irq(codec->irq, (void *)codec);
if (codec->res_port) { if (codec->res_port) {
...@@ -2116,7 +2116,7 @@ static int __devinit snd_ali_create(snd_card_t * card, ...@@ -2116,7 +2116,7 @@ static int __devinit snd_ali_create(snd_card_t * card,
return -EBUSY; return -EBUSY;
} }
synchronize_irq(); synchronize_irq(pci->irq);
codec->synth.chmap = 0; codec->synth.chmap = 0;
codec->synth.chcnt = 0; codec->synth.chcnt = 0;
......
...@@ -2479,7 +2479,7 @@ static int snd_cmipci_free(cmipci_t *cm) ...@@ -2479,7 +2479,7 @@ static int snd_cmipci_free(cmipci_t *cm)
/* reset mixer */ /* reset mixer */
snd_cmipci_mixer_write(cm, 0, 0); snd_cmipci_mixer_write(cm, 0, 0);
synchronize_irq(); synchronize_irq(cm->irq);
free_irq(cm->irq, (void *)cm); free_irq(cm->irq, (void *)cm);
} }
......
...@@ -1300,7 +1300,8 @@ static int snd_cs4281_free(cs4281_t *chip) ...@@ -1300,7 +1300,8 @@ static int snd_cs4281_free(cs4281_t *chip)
} }
#endif #endif
snd_cs4281_proc_done(chip); snd_cs4281_proc_done(chip);
synchronize_irq(); if(chip->irq >= 0)
synchronize_irq(chip->irq);
/* Mask interrupts */ /* Mask interrupts */
snd_cs4281_pokeBA0(chip, BA0_HIMR, 0x7fffffff); snd_cs4281_pokeBA0(chip, BA0_HIMR, 0x7fffffff);
...@@ -1603,7 +1604,7 @@ static int __devinit snd_cs4281_create(snd_card_t * card, ...@@ -1603,7 +1604,7 @@ static int __devinit snd_cs4281_create(snd_card_t * card,
BA0_HISR_DMA(1) | BA0_HISR_DMA(1) |
BA0_HISR_DMA(2) | BA0_HISR_DMA(2) |
BA0_HISR_DMA(3))); BA0_HISR_DMA(3)));
synchronize_irq(); synchronize_irq(chip->irq);
if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) { if ((err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops)) < 0) {
snd_cs4281_free(chip); snd_cs4281_free(chip);
......
...@@ -1532,7 +1532,8 @@ static int snd_ensoniq_free(ensoniq_t *ensoniq) ...@@ -1532,7 +1532,8 @@ static int snd_ensoniq_free(ensoniq_t *ensoniq)
outl(0, ES_REG(ensoniq, CONTROL)); /* switch everything off */ outl(0, ES_REG(ensoniq, CONTROL)); /* switch everything off */
outl(0, ES_REG(ensoniq, SERIAL)); /* clear serial interface */ outl(0, ES_REG(ensoniq, SERIAL)); /* clear serial interface */
#endif #endif
synchronize_irq(ensoniq->irq); if(ensoniq->irq >= 0)
synchronize_irq(ensoniq->irq);
pci_set_power_state(ensoniq->pci, 3); pci_set_power_state(ensoniq->pci, 3);
__hw_end: __hw_end:
#ifdef CHIP1370 #ifdef CHIP1370
......
...@@ -4070,9 +4070,10 @@ static int snd_ice1712_free(ice1712_t *ice) ...@@ -4070,9 +4070,10 @@ static int snd_ice1712_free(ice1712_t *ice)
/* --- */ /* --- */
__hw_end: __hw_end:
snd_ice1712_proc_done(ice); snd_ice1712_proc_done(ice);
synchronize_irq(); if (ice->irq) {
if (ice->irq) synchronize_irq(ice->irq);
free_irq(ice->irq, (void *) ice); free_irq(ice->irq, (void *) ice);
}
if (ice->res_port) { if (ice->res_port) {
release_resource(ice->res_port); release_resource(ice->res_port);
kfree_nocheck(ice->res_port); kfree_nocheck(ice->res_port);
...@@ -4143,7 +4144,7 @@ static int __devinit snd_ice1712_create(snd_card_t * card, ...@@ -4143,7 +4144,7 @@ static int __devinit snd_ice1712_create(snd_card_t * card,
pci_write_config_word(ice->pci, 0x40, 0x807f); pci_write_config_word(ice->pci, 0x40, 0x807f);
pci_write_config_word(ice->pci, 0x42, 0x0006); pci_write_config_word(ice->pci, 0x42, 0x0006);
snd_ice1712_proc_init(ice); snd_ice1712_proc_init(ice);
synchronize_irq(); synchronize_irq(ice->irq);
if ((ice->res_port = request_region(ice->port, 32, "ICE1712 - Controller")) == NULL) { if ((ice->res_port = request_region(ice->port, 32, "ICE1712 - Controller")) == NULL) {
snd_ice1712_free(ice); snd_ice1712_free(ice);
......
...@@ -1104,7 +1104,8 @@ static int snd_intel8x0_free(intel8x0_t *chip) ...@@ -1104,7 +1104,8 @@ static int snd_intel8x0_free(intel8x0_t *chip)
outb(ICH_RESETREGS, ICHREG(chip, PO_CR)); outb(ICH_RESETREGS, ICHREG(chip, PO_CR));
outb(ICH_RESETREGS, ICHREG(chip, MC_CR)); outb(ICH_RESETREGS, ICHREG(chip, MC_CR));
/* --- */ /* --- */
synchronize_irq(chip->irq); if(chip->irq >= 0)
synchronize_irq(chip->irq);
__hw_end: __hw_end:
if (chip->bdbars) if (chip->bdbars)
snd_free_pci_pages(chip->pci, 3 * sizeof(u32) * ICH_MAX_FRAGS * 2, chip->bdbars, chip->bdbars_addr); snd_free_pci_pages(chip->pci, 3 * sizeof(u32) * ICH_MAX_FRAGS * 2, chip->bdbars, chip->bdbars_addr);
......
...@@ -2310,7 +2310,8 @@ static int snd_m3_free(m3_t *chip) ...@@ -2310,7 +2310,8 @@ static int snd_m3_free(m3_t *chip)
vfree(chip->suspend_mem); vfree(chip->suspend_mem);
#endif #endif
synchronize_irq(); if(chip->irq >= 0)
synchronize_irq(chip->irq);
if (chip->iobase_res) { if (chip->iobase_res) {
release_resource(chip->iobase_res); release_resource(chip->iobase_res);
......
...@@ -1346,7 +1346,8 @@ static int snd_nm256_free(nm256_t *chip) ...@@ -1346,7 +1346,8 @@ static int snd_nm256_free(nm256_t *chip)
if (chip->streams[SNDRV_PCM_STREAM_CAPTURE].running) if (chip->streams[SNDRV_PCM_STREAM_CAPTURE].running)
snd_nm256_capture_stop(chip); snd_nm256_capture_stop(chip);
synchronize_irq(); if(chip->irq >= 0)
synchronize_irq(chip->irq);
if (chip->cport) if (chip->cport)
iounmap((void *) chip->cport); iounmap((void *) chip->cport);
......
...@@ -993,7 +993,8 @@ static int snd_via686a_free(via686a_t *chip) ...@@ -993,7 +993,8 @@ static int snd_via686a_free(via686a_t *chip)
snd_via686a_channel_reset(chip, &chip->playback_fm); snd_via686a_channel_reset(chip, &chip->playback_fm);
/* --- */ /* --- */
__end_hw: __end_hw:
synchronize_irq(); if(chip->irq >= 0)
synchronize_irq(chip->irq);
if (chip->tables) if (chip->tables)
snd_free_pci_pages(chip->pci, 3 * sizeof(unsigned int) * VIA_MAX_FRAGS * 2, chip->tables, chip->tables_addr); snd_free_pci_pages(chip->pci, 3 * sizeof(unsigned int) * VIA_MAX_FRAGS * 2, chip->tables, chip->tables_addr);
if (chip->res_port) { if (chip->res_port) {
...@@ -1055,7 +1056,7 @@ static int __devinit snd_via686a_create(snd_card_t * card, ...@@ -1055,7 +1056,7 @@ static int __devinit snd_via686a_create(snd_card_t * card,
if (ac97_clock >= 8000 && ac97_clock <= 48000) if (ac97_clock >= 8000 && ac97_clock <= 48000)
chip->ac97_clock = ac97_clock; chip->ac97_clock = ac97_clock;
pci_read_config_byte(pci, PCI_REVISION_ID, &chip->revision); pci_read_config_byte(pci, PCI_REVISION_ID, &chip->revision);
synchronize_irq(); synchronize_irq(pci->irq);
/* initialize offsets */ /* initialize offsets */
chip->playback.reg_offset = VIA_REG_PLAYBACK_STATUS; chip->playback.reg_offset = VIA_REG_PLAYBACK_STATUS;
......
...@@ -759,7 +759,8 @@ static int snd_via8233_free(via8233_t *chip) ...@@ -759,7 +759,8 @@ static int snd_via8233_free(via8233_t *chip)
snd_via8233_channel_reset(chip, &chip->capture); snd_via8233_channel_reset(chip, &chip->capture);
/* --- */ /* --- */
__end_hw: __end_hw:
synchronize_irq(); if (chip->irq)
synchronize_irq(chip->irq);
if (chip->tables) if (chip->tables)
snd_free_pci_pages(chip->pci, snd_free_pci_pages(chip->pci,
VIA_NUM_OF_DMA_CHANNELS * sizeof(unsigned int) * VIA_MAX_FRAGS * 2, VIA_NUM_OF_DMA_CHANNELS * sizeof(unsigned int) * VIA_MAX_FRAGS * 2,
...@@ -817,7 +818,7 @@ static int __devinit snd_via8233_create(snd_card_t * card, ...@@ -817,7 +818,7 @@ static int __devinit snd_via8233_create(snd_card_t * card,
if (ac97_clock >= 8000 && ac97_clock <= 48000) if (ac97_clock >= 8000 && ac97_clock <= 48000)
chip->ac97_clock = ac97_clock; chip->ac97_clock = ac97_clock;
pci_read_config_byte(pci, PCI_REVISION_ID, &chip->revision); pci_read_config_byte(pci, PCI_REVISION_ID, &chip->revision);
synchronize_irq(); synchronize_irq(chip->irq);
/* initialize offsets */ /* initialize offsets */
#if 0 #if 0
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment