Commit 3dd09e50 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.3.24pre2

parent 15305d2e
......@@ -5670,7 +5670,7 @@ CONFIG_EQUALIZER
module, say M here and read Documentation/modules.txt. If unsure,
say N.
Ethertap network tap
Ethertap network tap (EXPERIMENTAL)
CONFIG_ETHERTAP
If you say Y here (and have said Y to "Kernel/User network link
driver", above) and create a character special file /dev/tap0 with
......@@ -6185,7 +6185,7 @@ CONFIG_WANPIPE_PPP
you say N, the PPP support will not be included in the driver (saves
about 16 KB of kernel memory).
Cyclom 2X(tm) multiprotocol cards
Cyclom 2X(tm) multiprotocol cards (EXPERIMENTAL)
CONFIG_CYCLADES_SYNC
Cyclom 2X from Cyclades Corporation (http://www.cyclades.com and
http://www.cyclades.com.br ) is an intelligent multiprotocol WAN
......@@ -6378,7 +6378,7 @@ CONFIG_NET_VENDOR_RACAL
the questions about NI cards. If you say Y, you will be asked for
your specific card in the following questions.
NI5010 support
NI5010 support (EXPERIMENTAL)
CONFIG_NI5010
If you have a network (Ethernet) card of this type, say Y and read
the Ethernet-HOWTO, available from
......@@ -6983,7 +6983,7 @@ CONFIG_AC3200
module, say M here and read Documentation/modules.txt as well as
Documentation/networking/net-modules.txt.
Mylex EISA LNE390A/LNE390B support
Mylex EISA LNE390A/LNE390B support (EXPERIMENTAL)
CONFIG_LNE390
If you have a network (Ethernet) card of this type, say Y and read
the Ethernet-HOWTO, available from
......@@ -6995,7 +6995,7 @@ CONFIG_LNE390
module, say M here and read Documentation/modules.txt as well as
Documentation/networking/net-modules.txt.
Novell/Eagle/Microdyne NE3210 EISA support
Novell/Eagle/Microdyne NE3210 EISA support (EXPERIMENTAL)
CONFIG_NE3210
If you have a network (Ethernet) card of this type, say Y and read
the Ethernet-HOWTO, available from
......@@ -7080,7 +7080,7 @@ CONFIG_EEXPRESS_PRO100
module, say M here and read Documentation/modules.txt as well as
Documentation/networking/net-modules.txt.
ICL EtherTeam 16i/32 support
ICL EtherTeam 16i/32 support (EXPERIMENTAL)
CONFIG_ETH16I
If you have a network (Ethernet) card of this type, say Y and read
the Ethernet-HOWTO, available from
......@@ -7122,7 +7122,7 @@ CONFIG_VIA_RHINE
a module, say M here and read Documentation/modules.txt as well as
Documentation/networking/net-modules.txt.
Racal-Interlan EISA ES3210 support
Racal-Interlan EISA ES3210 support (EXPERIMENTAL)
CONFIG_ES3210
If you have a network (Ethernet) card of this type, say Y and read
the Ethernet-HOWTO, available from
......@@ -7151,7 +7151,7 @@ CONFIG_SGISEEQ
Say Y here if you have an Seeq based Ethernet network card. This is
used in many Silicon Graphics machines.
Zenith Z-Note support
Zenith Z-Note support (EXPERIMENTAL)
CONFIG_ZNET
The Zenith Z-Note notebook computer has a built-in network
(Ethernet) card, and this is the Linux driver for it. Note that the
......@@ -7650,7 +7650,7 @@ CONFIG_QUOTA
http://metalab.unc.edu/mdw/linux.html#howto . Probably the quota
support is only useful for multi user systems. If unsure, say N.
Support for USB (EXPERIMENTAL!)
Support for USB (EXPERIMENTAL)
CONFIG_USB
Universal Serial Bus (USB) is a specification for a serial bus
system which offers higher speeds and more features than the
......@@ -7802,6 +7802,16 @@ CONFIG_USB_ACM
The module will be called acm.o. If you want to compile it as a
module, say M here and read Documentation/modules.txt.
USB Belkin and Peracom serial support
CONFIG_USB_SERIAL
Say Y here if you want to connect a Belkin, Peracom, or eTek
single port USB to serial converter.
This code is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called usb-serial.o. If you want to compile it
as a module, say M here and read Documentation/modules.txt.
USB Printer support
CONFIG_USB_PRINTER
Say Y here if you want to connect a printer to your computer's USB
......@@ -8203,7 +8213,7 @@ CONFIG_NFSD_SUN
directories that are mount points on the local filesystem (this is
how nfsd behaves on Sun systems), say Y here. If unsure, say N.
OS/2 HPFS filesystem support (read only)
OS/2 HPFS filesystem support
CONFIG_HPFS_FS
OS/2 is IBM's operating system for PC's, the same as Warp, and HPFS
is the filesystem used for organizing files on OS/2 hard disk
......@@ -8230,7 +8240,7 @@ CONFIG_NTFS_FS
The module will be called ntfs.o. If you want to compile it as a
module, say M here and read Documentation/modules.txt.
NTFS read-write support (EXPERIMENTAL)
NTFS write support (DANGEROUS)
CONFIG_NTFS_RW
If you say Y here, you will (hopefully) be able to write to NTFS
file systems as well as read from them. The read-write support
......@@ -8265,7 +8275,7 @@ CONFIG_SYSV_FS
tar" or preferably "info tar"). Note also that this option has
nothing whatsoever to do with the option "System V IPC". Read about
the System V filesystem in Documentation/filesystems/sysv-fs.txt.
Saying Y here will enlarge your kernel by about 34 KB.
Saying Y here will enlarge your kernel by about 27 kB.
If you want to compile this as a module ( = code which can be
inserted in and removed from the running kernel whenever you want),
......@@ -8322,7 +8332,7 @@ CONFIG_ROMFS_FS
If you don't know whether you need it, then you don't need it:
answer N.
QNX filesystem support (EXPERIMENTAL)
QNX filesystem support (read only) (EXPERIMENTAL)
CONFIG_QNX4FS_FS
This is the filesystem used by the operating system QNX 4. Say Y if
you intend to mount QNX hard disks or floppies. Unless you say Y to
......@@ -8336,7 +8346,7 @@ CONFIG_QNX4FS_FS
If unsure, say N.
QNXFS read-write support (FOR TESTING ONLY)
QNXFS write support (DANGEROUS)
CONFIG_QNX4FS_RW
Say Y if you want to test write support for QNX filesystems.
......@@ -9289,7 +9299,7 @@ CONFIG_ESPSERIAL
and read Documentation/modules.txt. The module will be called esp.o.
If unsure, say N.
Multi-Tech multiport card support
Multi-Tech multiport card support (EXPERIMENTAL)
CONFIG_ISI
This is a driver for the Multi-Tech cards which provide several
serial ports. The driver is experimental and can currently only be
......@@ -9459,9 +9469,9 @@ CONFIG_82C710_MOUSE
PC110 digitizer pad support
CONFIG_PC110_PAD
This drives the digitizer pad on the IBM PC110 palmtop (see
http://toy.cabi.net ). It can turn the digitizer pad into a PS/2
mouse emulation with tap gestures or into an absolute pad.
This drives the digitizer pad on the IBM PC110 palmtop. It can turn
the digitizer pad into a PS/2 mouse emulation with tap gestures or
into an absolute pad.
If you want to compile this as a module ( = code which can be
inserted in and removed from the running kernel whenever you want),
......
......@@ -29,6 +29,8 @@
* Cleaned up cache-detection code
* Dave Jones <dave@powertweak.com>, October 1999
*
* Added proper L2 cache detection for Coppermine
* Dragan Stancevic <visitor@valinux.com>, October 1999
*/
/*
......@@ -1237,6 +1239,7 @@ void __init identify_cpu(struct cpuinfo_x86 *c)
break;
case 0x42:
case 0x82: /*Detect 256-Kbyte cache on Coppermine*/
c->x86_cache_size = 256;
break;
......
......@@ -34,6 +34,7 @@
#include <linux/blkpg.h>
#include <linux/timer.h>
#include <linux/proc_fs.h>
#include <linux/init.h>
#include <linux/hdreg.h>
#include <linux/spinlock.h>
#include <asm/uaccess.h>
......@@ -703,6 +704,26 @@ static ulong remap_pci_mem(ulong base, ulong size)
return (ulong) (page_remapped ? (page_remapped + page_offs) : 0UL);
}
#ifndef MODULE
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,3,13)
/*
* Config string is a comma seperated set of i/o addresses of EISA cards.
*/
static int cpqarray_setup(char *str)
{
int i, ints[9];
(void)get_options(str, ARRAY_SIZE(ints), ints);
for(i=0; i<ints[0] && i<8; i++)
eisa[i] = ints[i+1];
return 1;
}
__setup("smart2=", cpqarray_setup);
#else
/*
* Copy the contents of the ints[] array passed to us by init.
*/
......@@ -712,6 +733,8 @@ void cpqarray_setup(char *str, int *ints)
for(i=0; i<ints[0] && i<8; i++)
eisa[i] = ints[i+1];
}
#endif
#endif
/*
* Find an EISA controller's signature. Set up an hba if we find it.
......
......@@ -286,15 +286,39 @@ void set_device_ro(kdev_t dev,int flag)
else ro_bits[major][minor >> 5] &= ~(1 << (minor & 31));
}
static inline void drive_stat_acct(int cmd, unsigned long nr_sectors,
short disk_index)
static inline void drive_stat_acct(struct request *req,
unsigned long nr_sectors, int new_io)
{
kstat.dk_drive[disk_index]++;
if (cmd == READ) {
kstat.dk_drive_rio[disk_index]++;
int major = MAJOR(req->rq_dev);
int minor = MINOR(req->rq_dev);
unsigned int disk_index;
switch (major) {
case DAC960_MAJOR+0:
disk_index = (minor & 0x00f8) >> 3;
break;
case SCSI_DISK0_MAJOR:
disk_index = (minor & 0x00f0) >> 4;
break;
case IDE0_MAJOR: /* same as HD_MAJOR */
case XT_DISK_MAJOR:
disk_index = (minor & 0x0040) >> 6;
break;
case IDE1_MAJOR:
disk_index = ((minor & 0x0040) >> 6) + 2;
break;
default:
return;
}
if (disk_index >= DK_NDRIVE)
return;
kstat.dk_drive[disk_index] += new_io;
if (req->cmd == READ) {
kstat.dk_drive_rio[disk_index] += new_io;
kstat.dk_drive_rblk[disk_index] += nr_sectors;
} else if (cmd == WRITE) {
kstat.dk_drive_wio[disk_index]++;
} else if (req->cmd == WRITE) {
kstat.dk_drive_wio[disk_index] += new_io;
kstat.dk_drive_wblk[disk_index] += nr_sectors;
} else
printk(KERN_ERR "drive_stat_acct: cmd not R/W?\n");
......@@ -313,35 +337,11 @@ static inline void drive_stat_acct(int cmd, unsigned long nr_sectors,
void add_request(struct blk_dev_struct * dev, struct request * req)
{
int major = MAJOR(req->rq_dev);
int minor = MINOR(req->rq_dev);
struct request * tmp, **current_request;
short disk_index;
unsigned long flags;
int queue_new_request = 0;
switch (major) {
case DAC960_MAJOR+0:
disk_index = (minor & 0x00f8) >> 3;
if (disk_index < 4)
drive_stat_acct(req->cmd, req->nr_sectors, disk_index);
break;
case SCSI_DISK0_MAJOR:
disk_index = (minor & 0x00f0) >> 4;
if (disk_index < 4)
drive_stat_acct(req->cmd, req->nr_sectors, disk_index);
break;
case IDE0_MAJOR: /* same as HD_MAJOR */
case XT_DISK_MAJOR:
disk_index = (minor & 0x0040) >> 6;
drive_stat_acct(req->cmd, req->nr_sectors, disk_index);
break;
case IDE1_MAJOR:
disk_index = ((minor & 0x0040) >> 6) + 2;
drive_stat_acct(req->cmd, req->nr_sectors, disk_index);
default:
break;
}
drive_stat_acct(req, req->nr_sectors, 1);
req->next = NULL;
/*
......@@ -575,6 +575,7 @@ void make_request(int major,int rw, struct buffer_head * bh)
req->bhtail->b_reqnext = bh;
req->bhtail = bh;
req->nr_sectors += count;
drive_stat_acct(req, count, 0);
/* Can we now merge this req with the next? */
attempt_merge(req, max_sectors);
/* or to the beginning? */
......@@ -585,6 +586,7 @@ void make_request(int major,int rw, struct buffer_head * bh)
req->current_nr_sectors = count;
req->sector = sector;
req->nr_sectors += count;
drive_stat_acct(req, count, 0);
} else
continue;
......
......@@ -703,7 +703,7 @@ static int i2ob_release(struct inode *inode, struct file *file)
msg[2] = i2ob_context|0x80000000;
msg[3] = (u32)query_done;
msg[4] = 60<<16;
i2o_post_wait(dev->controller, dev->tid, msg, 20, query_done,2);
i2o_post_wait(dev->controller, msg, 20, 2);
/*
* Unlock the media
*/
......@@ -712,7 +712,7 @@ static int i2ob_release(struct inode *inode, struct file *file)
msg[2] = i2ob_context|0x80000000;
msg[3] = (u32)query_done;
msg[4] = -1;
i2o_post_wait(dev->controller, dev->tid, msg, 20, query_done,2);
i2o_post_wait(dev->controller, msg, 20, 2);
/*
* Now unclaim the device.
......@@ -766,7 +766,7 @@ static int i2ob_open(struct inode *inode, struct file *file)
msg[3] = (u32)query_done;
msg[4] = -1;
msg[5] = 0;
i2o_post_wait(dev->controller, dev->tid, msg, 24, query_done,2);
i2o_post_wait(dev->controller, msg, 24, 2);
/*
* Lock the media
*/
......@@ -775,7 +775,7 @@ static int i2ob_open(struct inode *inode, struct file *file)
msg[2] = i2ob_context|0x80000000;
msg[3] = (u32)query_done;
msg[4] = -1;
i2o_post_wait(dev->controller, dev->tid, msg, 20, query_done,2);
i2o_post_wait(dev->controller, msg, 20, 2);
}
MOD_INC_USE_COUNT;
return 0;
......@@ -788,8 +788,8 @@ static int i2ob_open(struct inode *inode, struct file *file)
static int i2ob_query_device(struct i2ob_device *dev, int table,
int field, void *buf, int buflen)
{
return i2o_query_scalar(dev->controller, dev->tid, i2ob_context,
table, field, buf, buflen, &dev->done_flag);
return i2o_query_scalar(dev->controller, dev->tid,
table, field, buf, buflen);
}
......@@ -891,7 +891,10 @@ static void i2ob_probe(void)
for(d=c->devices;d!=NULL;d=d->next)
{
if(d->class!=I2O_CLASS_RANDOM_BLOCK_STORAGE)
if(d->lct_data->class_id!=I2O_CLASS_RANDOM_BLOCK_STORAGE)
continue;
if(d->lct_data->user_tid != 0xFFF)
continue;
if(unit<MAX_I2OB<<4)
......@@ -903,7 +906,7 @@ static void i2ob_probe(void)
struct i2ob_device *dev=&i2ob_dev[unit];
dev->i2odev = d;
dev->controller = c;
dev->tid = d->id;
dev->tid = d->lct_data->tid;
/*
* Insure the device can be claimed
......@@ -930,9 +933,10 @@ static void i2ob_probe(void)
else
{
if(!warned++)
printk("i2o_block: too many controllers, registering only %d.\n", unit>>4);
printk("i2o_block: too many device, registering only %d.\n", unit>>4);
}
}
i2o_unlock_controller(c);
}
i2ob_devices = unit;
}
......@@ -981,7 +985,7 @@ static int i2ob_reboot_event(struct notifier_block *n, unsigned long code, void
msg[2] = i2ob_context|0x80000000;
msg[3] = (u32)query_done;
msg[4] = 60<<16;
i2o_post_wait(dev->controller, dev->tid, msg, 20, query_done,2);
i2o_post_wait(dev->controller, msg, 20, 2);
/*
* Unlock the media
*/
......@@ -990,7 +994,7 @@ static int i2ob_reboot_event(struct notifier_block *n, unsigned long code, void
msg[2] = i2ob_context|0x80000000;
msg[3] = (u32)query_done;
msg[4] = -1;
i2o_post_wait(dev->controller, dev->tid, msg, 20, query_done,2);
i2o_post_wait(dev->controller, msg, 20, 2);
}
}
return NOTIFY_DONE;
......@@ -1058,7 +1062,7 @@ int i2o_block_init(void)
{
int i;
printk(KERN_INFO "I2O block device OSM v0.07. (C) 1999 Red Hat Software.\n");
printk(KERN_INFO "I2O Block Storage OSM v0.07. (C) 1999 Red Hat Software.\n");
/*
* Register the block device interfaces
......
......@@ -317,14 +317,14 @@ static int ioctl_parms(unsigned long arg, unsigned int type)
return -ENOMEM;
}
len = i2o_issue_params(i2o_cmd, c, kcmd.tid, cfg_handler.context,
ops, kcmd.oplen, res, 65536, &i2o_cfg_token);
len = i2o_issue_params(i2o_cmd, c, kcmd.tid,
ops, kcmd.oplen, res, 65536);
i2o_unlock_controller(c);
kfree(ops);
if (len < 0) {
if (len) {
kfree(res);
return len; /* -DetailedStatus */
return len; /* -DetailedStatus || -ETIMEDOUT */
}
put_user(len, kcmd.reslen);
......@@ -413,8 +413,8 @@ int ioctl_html(unsigned long arg)
msg[8] = virt_to_phys(query);
}
token = i2o_post_wait(c, cmd->tid, msg, 9*4, &i2o_cfg_token, 10);
if(token != I2O_POST_WAIT_OK)
token = i2o_post_wait(c, msg, 9*4, 10);
if(token)
{
i2o_unlock_controller(c);
kfree(res);
......@@ -531,8 +531,8 @@ int ioctl_swdl(unsigned long arg)
// Yes...that's one minute, but the spec states that
// transfers take a long time, and I've seen just how
// long they can take.
token = i2o_post_wait(c, ADAPTER_TID, msg, sizeof(msg), &i2o_cfg_token,60);
if (token != I2O_POST_WAIT_OK ) // Something very wrong
token = i2o_post_wait(c, msg, sizeof(msg), 60);
if (token) // Something very wrong
{
i2o_unlock_controller(c);
printk("Timeout downloading software");
......@@ -547,8 +547,8 @@ int ioctl_swdl(unsigned long arg)
msg[4] |= (u32)maxfrag;
msg[7] = (0xD0000000 | diff);
__copy_from_user(buffer, kxfer.buf, 8192);
token = i2o_post_wait(c, ADAPTER_TID, msg, sizeof(msg), &i2o_cfg_token,60);
if( token != I2O_POST_WAIT_OK ) // Something very wrong
token = i2o_post_wait(c, msg, sizeof(msg), 60);
if(token) // Something very wrong
{
i2o_unlock_controller(c);
printk("Timeout downloading software");
......@@ -588,10 +588,10 @@ int ioctl_validate(unsigned long arg)
msg[2] = (u32)i2o_cfg_context;
msg[3] = 0;
token = i2o_post_wait(c, ADAPTER_TID, msg, sizeof(msg),&i2o_cfg_token, 10);
token = i2o_post_wait(c, msg, sizeof(msg), 10);
i2o_unlock_controller(c);
if (token != I2O_POST_WAIT_OK)
if (token)
{
printk("Can't validate configuration, ErrorStatus = %d\n",
token);
......
This diff is collapsed.
This diff is collapsed.
......@@ -25,6 +25,10 @@
#include <linux/malloc.h>
#include <asm/io.h>
#ifdef CONFIG_MTRR
#include <asm/mtrr.h>
#endif // CONFIG_MTRR
#ifdef MODULE
/*
* Core function table
......@@ -46,6 +50,11 @@ static void i2o_pci_dispose(struct i2o_controller *c)
if(c->bus.pci.irq > 0)
free_irq(c->bus.pci.irq, c);
iounmap(((u8 *)c->post_port)-0x40);
#ifdef CONFIG_MTRR
if(c->bus.pci.mtrr_reg > 0)
mtrr_del(c->bus.pci.mtrr_reg, 0, 0);
#endif
}
/*
......@@ -65,6 +74,19 @@ static int i2o_pci_unbind(struct i2o_controller *c, struct i2o_device *dev)
return 0;
}
/*
* Bus specific enable/disable functions
*/
static void i2o_pci_enable(struct i2o_controller *c)
{
I2O_IRQ_WRITE32(c, 0);
}
static void i2o_pci_disable(struct i2o_controller *c)
{
I2O_IRQ_WRITE32(c, 0xFFFFFFFF);
}
/*
* Bus specific interrupt handler
*/
......@@ -81,8 +103,9 @@ static void i2o_pci_interrupt(int irq, void *dev_id, struct pt_regs *r)
/*
* Install a PCI (or in theory AGP) i2o controller
*
* TODO: Add support for polled controllers
*/
int __init i2o_pci_install(struct pci_dev *dev)
{
struct i2o_controller *c=kmalloc(sizeof(struct i2o_controller),
......@@ -128,7 +151,7 @@ int __init i2o_pci_install(struct pci_dev *dev)
kfree(c);
return -EINVAL;
}
c->bus.pci.irq = -1;
c->irq_mask = (volatile u32 *)(mem+0x34);
......@@ -141,9 +164,19 @@ int __init i2o_pci_install(struct pci_dev *dev)
c->bind = i2o_pci_bind;
c->unbind = i2o_pci_unbind;
c->bus_enable = i2o_pci_enable;
c->bus_disable = i2o_pci_disable;
c->type = I2O_TYPE_PCI;
/*
* Enable Write Combining MTRR for IOP's memory region
*/
#ifdef CONFIG_MTRR
c->bus.pci.mtrr_reg =
mtrr_add(c->mem_phys, size, MTRR_TYPE_WRCOMB, 1);
#endif
I2O_IRQ_WRITE32(c,0xFFFFFFFF);
#ifdef MODULE
......@@ -180,6 +213,9 @@ int __init i2o_pci_install(struct pci_dev *dev)
return -EBUSY;
}
}
printk(KERN_INFO "Installed iop%d at IRQ%d\n", c->unit, dev->irq);
I2O_IRQ_WRITE32(c,0x0);
return 0;
}
......@@ -211,102 +247,54 @@ int __init i2o_pci_scan(void)
return count?count:-ENODEV;
}
static void i2o_pci_unload(void)
#ifdef I2O_HOTPLUG_SUPPORT
/*
* Activate a newly found PCI I2O controller
* Not used now, but will be needed in future for
* hot plug PCI support
*/
static void i2o_pci_activate(i2o_controller * c)
{
int i=0;
struct i2o_controller *c;
for(i = 0; i < MAX_I2O_CONTROLLERS; i++)
if(c->type == I2O_TYPE_PCI)
{
I2O_IRQ_WRITE32(c,0);
#ifdef MODULE
c=core->find(i);
if(core->activate(c))
#else
c=i2o_find_controller(i);
if(i2o_activate_controller(c))
#endif /* MODULE */
if(c==NULL)
continue;
#ifdef MODULE
core->unlock(c);
#else
i2o_unlock_controller(c);
#endif /* MODULE */
if(c->type == I2O_TYPE_PCI)
{
printk("I2O: Failed to initialize iop%d\n", c->unit);
#ifdef MODULE
core->unlock(c);
core->delete(c);
#else
i2o_unlock_controller(c);
i2o_delete_controller(c);
#endif /* MODULE */
}
}
static void i2o_pci_activate(void)
{
int i=0;
struct i2o_controller *c;
for(i = 0; i < MAX_I2O_CONTROLLERS; i++)
{
#ifdef MODULE
c=core->find(i);
#else
c=i2o_find_controller(i);
#endif /* MODULE */
if(c==NULL)
continue;
if(c->type == I2O_TYPE_PCI)
{
#ifdef MODULE
if(core->activate(c))
#else
if(i2o_activate_controller(c))
#endif /* MODULE */
{
printk("I2O: Failed to initialize iop%d\n", c->unit);
#ifdef MODULE
core->unlock(c);
core->delete(c);
#else
i2o_unlock_controller(c);
i2o_delete_controller(c);
#endif
continue;
}
I2O_IRQ_WRITE32(c,0);
continue;
}
#ifdef MODULE
core->unlock(c);
#else
i2o_unlock_controller(c);
#endif
}
}
#endif // I2O_HOTPLUG_SUPPORT
#ifdef MODULE
int i2o_pci_core_attach(struct i2o_core_func_table *table)
{
int i;
MOD_INC_USE_COUNT;
core = table;
if((i = i2o_pci_scan())<0)
return -ENODEV;
i2o_pci_activate();
return i;
return i2o_pci_scan();
}
void i2o_pci_core_detach(void)
{
i2o_pci_unload();
core = NULL;
MOD_DEC_USE_COUNT;
}
......@@ -314,16 +302,8 @@ void i2o_pci_core_detach(void)
int init_module(void)
{
printk(KERN_INFO "Linux I2O PCI support (c) 1999 Red Hat Software.\n");
/*
* Let the core call the scan function for module dependency
* reasons. See include/linux/i2o.h for the reason why this
* is done.
*
* if(i2o_pci_scan()<0)
* return -ENODEV;
* i2o_pci_activate();
*/
core = NULL;
return 0;
......@@ -343,9 +323,6 @@ MODULE_DESCRIPTION("I2O PCI Interface");
void __init i2o_pci_init(void)
{
printk(KERN_INFO "Linux I2O PCI support (c) 1999 Red Hat Software.\n");
if(i2o_pci_scan()>=0)
{
i2o_pci_activate();
}
i2o_pci_scan();
}
#endif
This diff is collapsed.
......@@ -301,14 +301,12 @@ static int i2o_find_lun(struct i2o_controller *c, struct i2o_device *d, int *tar
{
u8 reply[8];
if(i2o_query_scalar(c, d->id, scsi_context|0x40000000,
0, 3, reply, 4, &lun_done)<0)
if(i2o_query_scalar(c, d->lct_data->tid, 0, 3, reply, 4))
return -1;
*target=reply[0];
if(i2o_query_scalar(c, d->id, scsi_context|0x40000000,
0, 4, reply, 8, &lun_done)<0)
if(i2o_query_scalar(c, d->lct_data->tid, 0, 4, reply, 8))
return -1;
*lun=reply[1];
......@@ -325,7 +323,7 @@ void i2o_scsi_init(struct i2o_controller *c, struct i2o_device *d, struct Scsi_H
int target;
h->controller=c;
h->bus_task=d->id;
h->bus_task=d->lct_data->tid;
for(target=0;target<16;target++)
for(lun=0;lun<8;lun++)
......@@ -334,34 +332,33 @@ void i2o_scsi_init(struct i2o_controller *c, struct i2o_device *d, struct Scsi_H
for(unit=c->devices;unit!=NULL;unit=unit->next)
{
dprintk(("Class %03X, parent %d, want %d.\n",
unit->class, unit->parent, d->id));
unit->lct_data->class_id, unit->lct_data->parent, d->lct_data->tid));
/* Only look at scsi and fc devices */
if ( (unit->class != I2O_CLASS_SCSI_PERIPHERAL)
&& (unit->class != I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL)
if ( (unit->lct_data->class_id != I2O_CLASS_SCSI_PERIPHERAL)
&& (unit->lct_data->class_id != I2O_CLASS_FIBRE_CHANNEL_PERIPHERAL)
)
continue;
/* On our bus ? */
dprintk(("Found a disk.\n"));
if ( (unit->parent == d->id)
|| (unit->parent == d->parent)
if ((unit->lct_data->parent_tid == d->lct_data->tid)
|| (unit->lct_data->parent_tid == d->lct_data->parent_tid)
)
{
u16 limit;
dprintk(("Its ours.\n"));
if(i2o_find_lun(c, unit, &target, &lun)==-1)
{
printk(KERN_ERR "i2o_scsi: Unable to get lun for tid %d.\n", d->id);
printk(KERN_ERR "i2o_scsi: Unable to get lun for tid %d.\n", d->lct_data->tid);
continue;
}
dprintk(("Found disk %d %d.\n", target, lun));
h->task[target][lun]=unit->id;
h->task[target][lun]=unit->lct_data->tid;
h->tagclock[target][lun]=jiffies;
/* Get the max fragments/request */
i2o_query_scalar(c, d->id, scsi_context|0x40000000,
0xF103, 3, &limit, 2, &lun_done);
i2o_query_scalar(c, d->lct_data->tid, 0xF103, 3, &limit, 2);
/* sanity */
if ( limit == 0 )
......@@ -435,8 +432,8 @@ int i2o_scsi_detect(Scsi_Host_Template * tpnt)
/*
* bus_adapter, SCSI (obsolete), or FibreChannel busses only
*/
if( (d->class!=I2O_CLASS_BUS_ADAPTER_PORT) // bus_adapter
&& (d->class!=I2O_CLASS_FIBRE_CHANNEL_PORT) // FC_PORT
if( (d->lct_data->class_id!=I2O_CLASS_BUS_ADAPTER_PORT) // bus_adapter
&& (d->lct_data->class_id!=I2O_CLASS_FIBRE_CHANNEL_PORT) // FC_PORT
)
continue;
......
This diff is collapsed.
This diff is collapsed.
......@@ -7,7 +7,7 @@
* Status: Experimental.
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Wed Oct 21 20:02:35 1998
* Modified at: Sat Jun 26 16:57:57 1999
* Modified at: Mon Oct 18 23:37:06 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
*
* Copyright (c) 1998-1999 Dag Brattli, All Rights Reserved.
......@@ -32,33 +32,31 @@
#include <net/irda/irda.h>
#include <net/irda/irmod.h>
#include <net/irda/irda_device.h>
#include <net/irda/dongle.h>
static void actisys_reset(struct irda_device *dev);
static void actisys_open(struct irda_device *idev, int type);
static void actisys_close(struct irda_device *dev);
static void actisys_change_speed( struct irda_device *dev, __u32 speed);
static void actisys_init_qos(struct irda_device *idev, struct qos_info *qos);
static int actisys_change_speed(struct irda_task *task);
static int actisys_reset(struct irda_task *task);
static void actisys_open(dongle_t *self, struct qos_info *qos);
static void actisys_close(dongle_t *self);
/* These are the baudrates supported */
static __u32 baud_rates[] = { 9600, 19200, 57600, 115200, 38400};
static __u32 baud_rates[] = { 9600, 19200, 57600, 115200, 38400 };
static struct dongle dongle = {
ACTISYS_DONGLE,
static struct dongle_reg dongle = {
Q_NULL,
IRDA_ACTISYS_DONGLE,
actisys_open,
actisys_close,
actisys_reset,
actisys_change_speed,
actisys_init_qos,
};
static struct dongle dongle_plus = {
ACTISYS_PLUS_DONGLE,
static struct dongle_reg dongle_plus = {
Q_NULL,
IRDA_ACTISYS_PLUS_DONGLE,
actisys_open,
actisys_close,
actisys_reset,
actisys_change_speed,
actisys_init_qos,
};
int __init actisys_init(void)
......@@ -82,20 +80,23 @@ void actisys_cleanup(void)
irda_device_unregister_dongle(&dongle_plus);
}
static void actisys_open(struct irda_device *idev, int type)
static void actisys_open(dongle_t *self, struct qos_info *qos)
{
strcat(idev->description, " <-> actisys");
qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200;
idev->io.dongle_id = type;
idev->flags |= IFF_DONGLE;
/* Remove support for 38400 if this is not a 220L+ dongle */
if (self->issue->type == IRDA_ACTISYS_DONGLE)
qos->baud_rate.bits &= ~IR_38400;
qos->min_turn_time.bits &= 0x40; /* Needs 0.01 ms */
MOD_INC_USE_COUNT;
}
static void actisys_close(struct irda_device *idev)
static void actisys_close(dongle_t *self)
{
/* Power off dongle */
irda_device_set_dtr_rts(idev, FALSE, FALSE);
self->set_dtr_rts(self->dev, FALSE, FALSE);
MOD_DEC_USE_COUNT;
}
......@@ -107,52 +108,84 @@ static void actisys_close(struct irda_device *idev)
* To cycle through the available baud rates, pulse RTS low for a few
* ms.
*/
static void actisys_change_speed(struct irda_device *idev, __u32 speed)
static int actisys_change_speed(struct irda_task *task)
{
__u32 current_baudrate;
dongle_t *self = (dongle_t *) task->instance;
__u32 speed = (__u32) task->param;
__u32 current_speed;
int index = 0;
int ret = 0;
DEBUG(4, __FUNCTION__ "()\n");
IRDA_DEBUG(4, __FUNCTION__ "()\n");
ASSERT(idev != NULL, return;);
ASSERT(idev->magic == IRDA_DEVICE_MAGIC, return;);
current_baudrate = idev->qos.baud_rate.value;
current_speed = self->speed;
/* Find the correct baudrate index for the currently used baudrate */
while (current_baudrate != baud_rates[index])
while (current_speed != baud_rates[index])
index++;
DEBUG( 4, __FUNCTION__ "(), index=%d\n", index);
IRDA_DEBUG(4, __FUNCTION__ "(), index=%d\n", index);
/* Cycle through avaiable baudrates until we reach the correct one */
while (current_baudrate != speed) {
DEBUG(4, __FUNCTION__ "(), current baudrate = %d\n",
switch (task->state) {
case IRDA_TASK_INIT:
/* Lock dongle */
if (irda_lock((void *) &self->busy) == FALSE) {
IRDA_DEBUG(0, __FUNCTION__ "(), busy!\n");
ret = MSECS_TO_JIFFIES(100);
break;
}
IRDA_DEBUG(4, __FUNCTION__ "(), current baudrate = %d\n",
baud_rates[index]);
/* Set DTR, clear RTS */
irda_device_set_dtr_rts(idev, TRUE, FALSE);
self->set_dtr_rts(self->dev, TRUE, FALSE);
/* Wait at a few ms */
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(MSECS_TO_JIFFIES(20));
irda_task_next_state(task, IRDA_TASK_WAIT1);
/* Wait at a few ms */
ret = MSECS_TO_JIFFIES(20);
break;
case IRDA_TASK_WAIT1:
/* Set DTR, Set RTS */
irda_device_set_dtr_rts(idev, TRUE, TRUE);
self->set_dtr_rts(self->dev, TRUE, TRUE);
/* Wait at a few ms again */
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(MSECS_TO_JIFFIES(20));
irda_task_next_state(task, IRDA_TASK_WAIT2);
/* Wait at a few ms again */
ret = MSECS_TO_JIFFIES(20);
break;
case IRDA_TASK_WAIT2:
/* Go to next baudrate */
if (idev->io.dongle_id == ACTISYS_DONGLE)
if (self->issue->type == IRDA_ACTISYS_DONGLE)
index = (index+1) % 4; /* IR-220L */
else
index = (index+1) % 5; /* IR-220L+ */
current_baudrate = baud_rates[index];
current_speed = baud_rates[index];
/* Check if we need to go some more rounds */
if (current_speed != speed)
irda_task_next_state(task, IRDA_TASK_INIT);
else {
irda_task_next_state(task, IRDA_TASK_DONE);
self->busy = 0;
}
break;
default:
ERROR(__FUNCTION__ "(), unknown state %d\n", task->state);
irda_task_next_state(task, IRDA_TASK_DONE);
self->busy = 0;
ret = -1;
break;
}
DEBUG(4, __FUNCTION__ "(), current baudrate = %d\n", baud_rates[index]);
self->speed = speed;
IRDA_DEBUG(4, __FUNCTION__ "(), current baudrate = %d\n",
baud_rates[index]);
return ret;
}
/*
......@@ -162,45 +195,42 @@ static void actisys_change_speed(struct irda_device *idev, __u32 speed)
* called with a process context!
*
* 1. Clear DTR for a few ms.
*
*/
static void actisys_reset(struct irda_device *idev)
static int actisys_reset(struct irda_task *task)
{
ASSERT(idev != NULL, return;);
ASSERT(idev->magic == IRDA_DEVICE_MAGIC, return;);
/* Clear DTR */
irda_device_set_dtr_rts(idev, FALSE, TRUE);
dongle_t *self = (dongle_t *) task->instance;
int ret = 0;
/* Sleep 10-20 ms*/
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(MSECS_TO_JIFFIES(20));
/* Go back to normal mode */
irda_device_set_dtr_rts(idev, TRUE, TRUE);
idev->qos.baud_rate.value = 9600;
}
ASSERT(task != NULL, return -1;);
/*
* Function actisys_init_qos (qos)
*
* Initialize QoS capabilities
*
*/
static void actisys_init_qos(struct irda_device *idev, struct qos_info *qos)
{
qos->baud_rate.bits &= IR_9600|IR_19200|IR_38400|IR_57600|IR_115200;
switch (task->state) {
case IRDA_TASK_INIT:
/* Clear DTR */
self->set_dtr_rts(self->dev, FALSE, TRUE);
irda_task_next_state(task, IRDA_TASK_WAIT);
/* Remove support for 38400 if this is not a 220L+ dongle */
if (idev->io.dongle_id == ACTISYS_DONGLE)
qos->baud_rate.bits &= ~IR_38400;
/* Sleep 10-20 ms*/
ret = MSECS_TO_JIFFIES(20);
break;
case IRDA_TASK_WAIT:
/* Go back to normal mode */
self->set_dtr_rts(self->dev, TRUE, TRUE);
qos->min_turn_time.bits &= 0x40; /* Needs 0.01 ms */
irda_task_next_state(task, IRDA_TASK_DONE);
self->speed = 9600;
break;
default:
ERROR(__FUNCTION__ "(), unknown state %d\n", task->state);
irda_task_next_state(task, IRDA_TASK_DONE);
ret = -1;
break;
}
return ret;
}
#ifdef MODULE
MODULE_AUTHOR("Dag Brattli <dagb@cs.uit.no>");
MODULE_DESCRIPTION("ACTiSYS IR-220L and IR-220L+ dongle driver");
......@@ -225,5 +255,4 @@ void cleanup_module(void)
{
actisys_cleanup();
}
#endif
#endif /* MODULE */
......@@ -56,7 +56,7 @@ int __init airport_init(void)
{
int ret;
DEBUG(2, __FUNCTION__ "()\n");
IRDA_DEBUG(2, __FUNCTION__ "()\n");
ret = irda_device_register_dongle(&dongle);
if (ret < 0)
return ret;
......@@ -65,17 +65,17 @@ int __init airport_init(void)
void airport_cleanup(void)
{
DEBUG(2, __FUNCTION__ "()\n");
IRDA_DEBUG(2, __FUNCTION__ "()\n");
irda_device_unregister_dongle(&dongle);
}
static void airport_open(struct irda_device *idev, int type)
{
DEBUG(2, __FUNCTION__ "(,%d)\n", type);
IRDA_DEBUG(2, __FUNCTION__ "(,%d)\n", type);
if (strlen(idev->description) < sizeof(idev->description) - 13)
strcat(idev->description, " <-> airport");
else
DEBUG(0, __FUNCTION__ " description too long: %s\n",
IRDA_DEBUG(0, __FUNCTION__ " description too long: %s\n",
idev->description);
idev->io.dongle_id = type;
......@@ -86,7 +86,7 @@ static void airport_open(struct irda_device *idev, int type)
static void airport_close(struct irda_device *idev)
{
DEBUG(2, __FUNCTION__ "()\n");
IRDA_DEBUG(2, __FUNCTION__ "()\n");
/* Power off dongle */
irda_device_set_dtr_rts(idev, FALSE, FALSE);
......@@ -95,13 +95,13 @@ static void airport_close(struct irda_device *idev)
static void airport_set_command_mode(struct irda_device *idev)
{
DEBUG(2, __FUNCTION__ "()\n");
IRDA_DEBUG(2, __FUNCTION__ "()\n");
irda_device_set_dtr_rts(idev, FALSE, TRUE);
}
static void airport_set_normal_mode(struct irda_device *idev)
{
DEBUG(2, __FUNCTION__ "()\n");
IRDA_DEBUG(2, __FUNCTION__ "()\n");
irda_device_set_dtr_rts(idev, TRUE, TRUE);
}
......@@ -109,7 +109,7 @@ static void airport_set_normal_mode(struct irda_device *idev)
void airport_write_char(struct irda_device *idev, unsigned char c)
{
int actual;
DEBUG(2, __FUNCTION__ "(,0x%x)\n", c & 0xff);
IRDA_DEBUG(2, __FUNCTION__ "(,0x%x)\n", c & 0xff);
actual = idev->raw_write(idev, &c, 1);
ASSERT(actual == 1, return;);
}
......@@ -120,22 +120,22 @@ static int airport_waitfor_char(struct irda_device *idev, unsigned char c)
{
int i, found = FALSE;
int before;
DEBUG(2, __FUNCTION__ "(,0x%x)\n", c);
IRDA_DEBUG(2, __FUNCTION__ "(,0x%x)\n", c);
/* Sleep approx. 10 ms */
before = jiffies;
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(MSECS_TO_JIFFIES(20));
DEBUG(4, __FUNCTION__ " waited %ldms\n",
IRDA_DEBUG(4, __FUNCTION__ " waited %ldms\n",
JIFFIES_TO_MSECS(jiffies - before));
for ( i = 0 ; !found && i < idev->rx_buff.len ; i++ ) {
/* DEBUG(6, __FUNCTION__ " 0x02x\n", idev->rx_buff.data[i]); */
/* IRDA_DEBUG(6, __FUNCTION__ " 0x02x\n", idev->rx_buff.data[i]); */
found = c == idev->rx_buff.data[i];
}
idev->rx_buff.len = 0;
DEBUG(2, __FUNCTION__ " returns %s\n", (found ? "true" : "false"));
IRDA_DEBUG(2, __FUNCTION__ " returns %s\n", (found ? "true" : "false"));
return found;
}
......@@ -144,7 +144,7 @@ static int airport_check_command_mode(struct irda_device *idev)
int i;
int found = FALSE;
DEBUG(2, __FUNCTION__ "()\n");
IRDA_DEBUG(2, __FUNCTION__ "()\n");
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(MSECS_TO_JIFFIES(20));
airport_set_command_mode(idev);
......@@ -160,9 +160,9 @@ static int airport_check_command_mode(struct irda_device *idev)
}
if (found) {
DEBUG(2, __FUNCTION__ " OK. (%d)\n", i);
IRDA_DEBUG(2, __FUNCTION__ " OK. (%d)\n", i);
} else {
DEBUG(0, __FUNCTION__ " FAILED!\n");
IRDA_DEBUG(0, __FUNCTION__ " FAILED!\n");
}
return found;
}
......@@ -173,7 +173,7 @@ static int airport_write_register(struct irda_device *idev, unsigned char reg)
int ok = FALSE;
int i;
DEBUG(4, __FUNCTION__ "(,0x%x)\n", reg);
IRDA_DEBUG(4, __FUNCTION__ "(,0x%x)\n", reg);
airport_check_command_mode(idev);
for ( i = 0 ; i < 6 ; i++ ) {
......@@ -191,9 +191,9 @@ static int airport_write_register(struct irda_device *idev, unsigned char reg)
airport_set_normal_mode(idev);
if (ok) {
DEBUG(4, __FUNCTION__ "(,0x%x) returns OK\n", reg);
IRDA_DEBUG(4, __FUNCTION__ "(,0x%x) returns OK\n", reg);
} else {
DEBUG(0, __FUNCTION__ "(,0x%x) returns False!\n", reg);
IRDA_DEBUG(0, __FUNCTION__ "(,0x%x) returns False!\n", reg);
}
return ok;
}
......@@ -209,7 +209,7 @@ static void airport_change_speed(struct irda_device *idev, __u32 speed)
__u32 current_baudrate;
int baudcode;
DEBUG(4, __FUNCTION__ "(,%d)\n", speed);
IRDA_DEBUG(4, __FUNCTION__ "(,%d)\n", speed);
ASSERT(idev != NULL, return;);
ASSERT(idev->magic == IRDA_DEVICE_MAGIC, return;);
......@@ -224,16 +224,16 @@ static void airport_change_speed(struct irda_device *idev, __u32 speed)
case 57600: baudcode = 0x60; break;
case 115200: baudcode = 0x70; break;
default:
DEBUG(0, __FUNCTION__ " bad baud rate: %d\n", speed);
IRDA_DEBUG(0, __FUNCTION__ " bad baud rate: %d\n", speed);
return;
}
current_baudrate = idev->qos.baud_rate.value;
DEBUG(4, __FUNCTION__ " current baudrate: %d\n", current_baudrate);
IRDA_DEBUG(4, __FUNCTION__ " current baudrate: %d\n", current_baudrate);
/* The dongle falls back to 9600 baud */
if (current_baudrate != 9600) {
DEBUG(4, __FUNCTION__ " resetting speed to 9600 baud\n");
IRDA_DEBUG(4, __FUNCTION__ " resetting speed to 9600 baud\n");
ASSERT(idev->change_speed , return;);
idev->change_speed(idev, 9600);
idev->qos.baud_rate.value = 9600;
......@@ -247,11 +247,11 @@ static void airport_change_speed(struct irda_device *idev, __u32 speed)
if (airport_write_register(idev, baudcode|0x01)) {
/* ok */
} else {
DEBUG(0, __FUNCTION__
IRDA_DEBUG(0, __FUNCTION__
" Cannot set new speed in second register\n");
}
} else {
DEBUG(0, __FUNCTION__
IRDA_DEBUG(0, __FUNCTION__
" Cannot set new speed in first register\n");
}
......@@ -260,7 +260,7 @@ static void airport_change_speed(struct irda_device *idev, __u32 speed)
/* How do I signal an error in these functions? */
DEBUG(4, __FUNCTION__ " returning\n");
IRDA_DEBUG(4, __FUNCTION__ " returning\n");
}
......@@ -275,7 +275,7 @@ static void airport_reset(struct irda_device *idev)
{
int ok;
DEBUG(2, __FUNCTION__ "()\n");
IRDA_DEBUG(2, __FUNCTION__ "()\n");
ASSERT(idev != NULL, return;);
ASSERT(idev->magic == IRDA_DEVICE_MAGIC, return;);
ASSERT(idev->set_raw_mode /* The airport needs this */, return;);
......@@ -286,10 +286,10 @@ static void airport_reset(struct irda_device *idev)
airport_set_normal_mode(idev);
/* Sleep 2000 ms */
DEBUG(2, __FUNCTION__ " waiting for powerup\n");
IRDA_DEBUG(2, __FUNCTION__ " waiting for powerup\n");
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(MSECS_TO_JIFFIES(2000));
DEBUG(2, __FUNCTION__ " finished waiting for powerup\n");
IRDA_DEBUG(2, __FUNCTION__ " finished waiting for powerup\n");
/* set dongle speed to 9600 */
ok = TRUE;
......@@ -322,12 +322,12 @@ static void airport_reset(struct irda_device *idev)
current->state = TASK_INTERRUPTIBLE;
schedule_timeout(MSECS_TO_JIFFIES(20));
DEBUG(4, __FUNCTION__ " waited 20ms\n");
IRDA_DEBUG(4, __FUNCTION__ " waited 20ms\n");
idev->qos.baud_rate.value = 9600;
if (!ok)
MESSAGE(__FUNCTION__ "() failed.\n");
DEBUG(2, __FUNCTION__ " returning.\n");
IRDA_DEBUG(2, __FUNCTION__ " returning.\n");
}
/*
......
/*********************************************************************
*
* Filename: esi.c
* Version: 1.4
* Version: 1.5
* Description: Driver for the Extended Systems JetEye PC dongle
* Status: Experimental.
* Author: Thomas Davis, <ratbert@radiks.net>
* Author: Dag Brattli <dagb@cs.uit.no>
* Created at: Sat Feb 21 18:54:38 1998
* Modified at: Sat Jun 26 16:50:17 1999
* Modified at: Mon Oct 18 12:35:43 1999
* Modified by: Dag Brattli <dagb@cs.uit.no>
* Sources: esi.c
*
* Copyright (c) 1998-1999, Dag Brattli, <dagb@cs.uit.no>
* Copyright (c) 1998, Thomas Davis, <ratbert@radiks.net>,
*
* Copyright (c) 1999 Dag Brattli, <dagb@cs.uit.no>,
* Copyright (c) 1998 Thomas Davis, <ratbert@radiks.net>,
* All Rights Reserved.
*
* 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
*
* 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.
*
* I, Thomas Davis, provide no warranty for any of this software.
* This material is provided "AS-IS" and at no charge.
*
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston,
* MA 02111-1307 USA
*
********************************************************************/
#include <linux/module.h>
......@@ -34,22 +40,19 @@
#include <net/irda/irda.h>
#include <net/irda/irmod.h>
#include <net/irda/irda_device.h>
#include <net/irda/irtty.h>
#include <net/irda/dongle.h>
static void esi_open(struct irda_device *idev, int type);
static void esi_close(struct irda_device *driver);
static void esi_change_speed(struct irda_device *idev, __u32 speed);
static void esi_reset(struct irda_device *idev);
static void esi_qos_init(struct irda_device *idev, struct qos_info *qos);
static void esi_open(dongle_t *self, struct qos_info *qos);
static void esi_close(dongle_t *self);
static int esi_change_speed(struct irda_task *task);
static int esi_reset(struct irda_task *task);
static struct dongle dongle = {
ESI_DONGLE,
static struct dongle_reg dongle = {
Q_NULL,
IRDA_ESI_DONGLE,
esi_open,
esi_close,
esi_reset,
esi_change_speed,
esi_qos_init,
};
int __init esi_init(void)
......@@ -62,37 +65,40 @@ void esi_cleanup(void)
irda_device_unregister_dongle(&dongle);
}
static void esi_open(struct irda_device *idev, int type)
static void esi_open(dongle_t *self, struct qos_info *qos)
{
strcat(idev->description, " <-> esi");
idev->io.dongle_id = type;
idev->flags |= IFF_DONGLE;
qos->baud_rate.bits &= IR_9600|IR_19200|IR_115200;
qos->min_turn_time.bits &= 0x01; /* Needs at least 10 ms */
MOD_INC_USE_COUNT;
}
static void esi_close(struct irda_device *idev)
static void esi_close(dongle_t *dongle)
{
/* Power off dongle */
irda_device_set_dtr_rts(idev, FALSE, FALSE);
dongle->set_dtr_rts(dongle->dev, FALSE, FALSE);
MOD_DEC_USE_COUNT;
}
/*
* Function esi_change_speed (idev, speed)
* Function esi_change_speed (task)
*
* Set the speed for the Extended Systems JetEye PC ESI-9680 type dongle
*
*/
static void esi_change_speed(struct irda_device *idev, __u32 speed)
static int esi_change_speed(struct irda_task *task)
{
dongle_t *self = (dongle_t *) task->instance;
__u32 speed = (__u32) task->param;
int dtr, rts;
ASSERT(idev != NULL, return;);
ASSERT(idev->magic == IRDA_DEVICE_MAGIC, return;);
/* Lock dongle */
if (irda_lock((void *) &self->busy) == FALSE) {
IRDA_DEBUG(0, __FUNCTION__ "(), busy!\n");
return MSECS_TO_JIFFIES(100);
}
switch (speed) {
case 19200:
dtr = TRUE;
......@@ -109,28 +115,34 @@ static void esi_change_speed(struct irda_device *idev, __u32 speed)
}
/* Change speed of dongle */
irda_device_set_dtr_rts(idev, dtr, rts);
}
self->set_dtr_rts(self->dev, dtr, rts);
self->speed = speed;
static void esi_reset( struct irda_device *idev)
{
/* Empty */
irda_task_next_state(task, IRDA_TASK_DONE);
/* Unlock */
self->busy = 0;
return 0;
}
/*
* Function esi_qos_init (qos)
* Function esi_reset (task)
*
* Init QoS capabilities for the dongle
* Reset dongle;
*
*/
static void esi_qos_init(struct irda_device *idev, struct qos_info *qos)
static int esi_reset(struct irda_task *task)
{
qos->baud_rate.bits &= IR_9600|IR_19200|IR_115200;
qos->min_turn_time.bits &= 0x01; /* Needs at least 10 ms */
dongle_t *self = (dongle_t *) task->instance;
self->set_dtr_rts(self->dev, FALSE, FALSE);
irda_task_next_state(task, IRDA_TASK_DONE);
return 0;
}
#ifdef MODULE
MODULE_AUTHOR("Dag Brattli <dagb@cs.uit.no>");
MODULE_DESCRIPTION("Extended Systems JetEye PC dongle driver");
......@@ -155,6 +167,5 @@ void cleanup_module(void)
{
esi_cleanup();
}
#endif
#endif /* MODULE */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -19,6 +19,7 @@ EXPORT_SYMBOL(pci_write_config_word);
EXPORT_SYMBOL(pci_write_config_dword);
EXPORT_SYMBOL(pci_devices);
EXPORT_SYMBOL(pci_root);
EXPORT_SYMBOL(pci_enable_device);
EXPORT_SYMBOL(pci_find_class);
EXPORT_SYMBOL(pci_find_device);
EXPORT_SYMBOL(pci_find_slot);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
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