N: Al Borchers
E: alborchers@steinerpoint.com
D: Author/maintainer of Digi AccelePort USB driver
+D: work on usbserial and keyspan_pda drivers
S: 4912 Zenith Ave. S.
S: Minneapolis, MN 55410
S: USA
parallel port on the USB 2 appears as a third serial port on Linux.
The Digi Acceleport USB 8 is not yet supported by this driver.
+ This driver works under SMP with the usb-uhci driver. It does not
+ work under SMP with the uhci driver.
+
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 digi_acceleport.o. If you want to compile
(plus a parallel port) and 4 port USB serial converters. The driver
does NOT yet support the Digi AccelePort USB 8.
+ This driver works under SMP with the usb-uhci driver. It does not work
+ under SMP with the uhci driver.
+
The driver is generally working, though we still have a few more ioctls
to implement and final testing and debugging to do. The paralled port
on the USB 2 is supported as a serial to parallel converter; in other
M: alborchers@steinerpoint.com
L: linux-usb-users@lists.sourceforge.net
L: linux-usb-devel@lists.sourceforge.net
-S: Supported
+S: Maintained
USB SERIAL KEYSPAN DRIVER
P: Hugh Blemings
VERSION = 2
PATCHLEVEL = 2
SUBLEVEL = 18
-EXTRAVERSION = pre24
+EXTRAVERSION = pre25
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
MODLIB=$(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE); \
mkdir -p $$MODLIB; \
rm -f $$MODLIB/build; \
- [ `/sbin/insmod -V 2>&1 | head -1 | awk '/^insmod version /{split("$3", a, /\./); printf "%d%03d%03d\n", a[1], a[2], a[3];}'`0 -ge 20030140 ] && \
+ [ `/sbin/insmod -V 2>&1 | head -1 | awk '/^insmod version /{split($$3, a, /\./); printf "%d%03d%03d\n", a[1], a[2], a[3];}'`0 -ge 20030140 ] && \
ln -s `pwd` $$MODLIB/build; \
cd modules; \
MODULES=""; \
static int __init dmi_table(u32 base, int len, int num, void (*decode)(struct dmi_header *))
{
- char *buf;
+ u8 *buf;
struct dmi_header *dm;
u8 *data;
int i=1;
-
+ int last = 0;
buf = ioremap(base, len);
if(buf==NULL)
return -1;
data = buf;
- while(i<num)
+ while(i<num && (data-buf) < len)
{
dm=(struct dmi_header *)data;
+ if(dm->type < last)
+ break;
+ last = dm->type;
decode(dm);
data+=dm->length;
while(*data || data[1])
u16 num=buf[13]<<8|buf[12];
u16 len=buf[7]<<8|buf[6];
u32 base=buf[11]<<24|buf[10]<<16|buf[9]<<8|buf[8];
-
+#ifdef DUMP_DMI
printk(KERN_INFO "DMI %d.%d present.\n",
buf[14]>>4, buf[14]&0x0F);
printk(KERN_INFO "%d structures occupying %d bytes.\n",
buf[7]<<8|buf[6]);
printk(KERN_INFO "DMI table at 0x%08X.\n",
buf[11]<<24|buf[10]<<16|buf[9]<<8|buf[8]);
+#endif
if(dmi_table(base,len, num, decode)==0)
return 0;
}
switch(dm->type)
{
- case 0:
+ case 0:
+#ifdef DUMP_DMI
p=dmi_string(dm,data[4]);
-
if(*p && *p!=' ')
{
printk("BIOS Vendor: %s\n", p);
printk("BIOS Release: %s\n",
dmi_string(dm, data[8]));
}
-
+#endif
/*
* Check for clue free BIOS implementations who use
* the following QA technique
#endif
}
break;
+#ifdef DUMP_DMI
case 1:
p=dmi_string(dm,data[4]);
if(*p && *p!=' ')
printk("Asset Tag: %s.\n", p);
break;
+#endif
}
}
temp_addr = __va(phys_addr);
temp_end = temp_addr + (size - 1);
- for(i = MAP_NR(temp_addr); i < MAP_NR(temp_end); i++) {
+ for(i = MAP_NR(temp_addr); i <= MAP_NR(temp_end); i++) {
if(!PageReserved(mem_map + i))
return NULL;
}
.long sys_pciconfig_write /* 199 */
.long sys_pciconfig_iobase /* 200 */
.long sys_ni_syscall /* 201 - reserved - MacOnLinux - new */
- .space (NR_syscalls-201)*4
+ .rept NR_syscalls-201
+ .long sys_ni_syscall
+ .endr
static spinlock_t mchchk_queue_lock = SPIN_LOCK_UNLOCKED;
static spinlock_t crw_queue_lock = SPIN_LOCK_UNLOCKED;
-static inline void init_MUTEX (struct semaphore *sem)
-{
- sema_init(sem, 1);
-}
-
-static inline void init_MUTEX_LOCKED (struct semaphore *sem)
-{
- sema_init(sem, 0);
-}
-
/*
* s390_init_machine_check
*
p += sprintf(p,"vendor_id : IBM/S390\n"
"# processors : %i\n"
"bogomips per cpu: %lu.%02lu\n",
- smp_num_cpus, loops_per_sec/500000,
- (loops_per_sec/5000)%100);
+ smp_num_cpus, loops_per_jiffy/(500000/HZ),
+ (loops_per_jiffy/(5000/HZ)) % 100);
for (i = 0; i < smp_num_cpus; i++) {
cpuinfo = &safe_get_cpu_lowcore(i).cpu_data;
p += sprintf(p,"processor %i: "
SUB_DIRS :=
MOD_SUB_DIRS := $(SUB_DIRS)
-ALL_SUB_DIRS := $(SUB_DIRS) rio ftape joystick
+ALL_SUB_DIRS := $(SUB_DIRS) rio ftape hfmodem joystick agp drm
#
# This file contains the font map for the default (hardware) font
ifeq ($(CONFIG_AGP),y)
O_OBJS += agp/agp.o
-ALL_SUB_DIRS += agp
SUB_DIRS += agp
else
ifeq ($(CONFIG_AGP),m)
- ALL_SUB_DIRS += agp
MOD_SUB_DIRS += agp
endif
endif
ifeq ($(CONFIG_DRM),y)
O_OBJS += drm/drm.o
-ALL_SUB_DIRS += drm
MOD_SUB_DIRS += drm
SUB_DIRS += drm
else
ifeq ($(CONFIG_DRM),m)
- ALL_SUB_DIRS += drm
MOD_SUB_DIRS += drm
endif
endif
ifeq ($(CONFIG_HFMODEM),y)
-ALL_SUB_DIRS += hfmodem
SUB_DIRS += hfmodem
O_OBJS += hfmodem/hfmodem.o
else
ifeq ($(CONFIG_HFMODEM),m)
- ALL_SUB_DIRS += hfmodem
MOD_SUB_DIRS += hfmodem
endif
-
endif
ifeq ($(CONFIG_DZ),y)
#include <linux/sched.h>
#include <linux/smp_lock.h> /* For (un)lock_kernel */
#include <linux/mm.h>
-#ifdef __alpha__
#include <asm/pgtable.h> /* For pte_wrprotect */
-#endif
#include <asm/io.h>
#include <asm/mman.h>
#include <asm/uaccess.h>
#include <linux/compatmac.h>
#include <linux/generic_serial.h>
-#define DEBUG
+#define DEBUG 1
static char * tmp_buf;
static DECLARE_MUTEX(tmp_buf_sem);
port->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CALLOUT_ACTIVE |GS_ACTIVE);
port->tty = NULL;
port->count = 0;
-
+ port->event = 0;
wake_up_interruptible(&port->open_wait);
func_exit ();
}
if (!port) return;
if (!port->tty) {
+ port->rd->hungup (port);
+ return;
+#if 0
/* This seems to happen when this is called from vhangup. */
gs_dprintk (GS_DEBUG_CLOSE, "gs: Odd: port->tty is NULL\n");
port->tty = tty;
+#endif
}
save_flags(flags); cli();
/* startuptime */ HZ*2, /* how long to wait for card to run */
/* slowcook */ 0, /* TRUE -> always use line disc. */
/* intrpolltime */ 1, /* The frequency of OUR polls */
- /* breakinterval */ 25, /* x10 mS */
+ /* breakinterval */ 25, /* x10 mS XXX: units seem to be 1ms not 10! -- REW*/
/* timer */ 10, /* mS */
/* RtaLoadBase */ 0x7000,
/* HostLoadBase */ 0x7C00,
static INT rio_fw_release(struct inode *inode, struct file *filp);
static int rio_init_drivers(void);
+int RIOShortCommand(struct rio_info *p, struct Port *PortP,
+ int command, int len, int arg);
void my_hd (void *addr, int len);
-
-
static struct tty_driver rio_driver, rio_callout_driver;
static struct tty_driver rio_driver2, rio_callout_driver2;
func_enter ();
HostP = (struct Host*)ptr; /* &p->RIOHosts[(long)ptr]; */
-
rio_dprintk (RIO_DEBUG_IFLOW, "rio: enter rio_interrupt (%d/%d)\n",
irq, HostP->Ivec);
RIOServiceHost(p, HostP, irq);
- rio_dprintk ( RIO_DEBUG_IFLOW, "riointr() doing host %d type %d\n",
- (int) ptr, HostP->Type);
+ rio_dprintk ( RIO_DEBUG_IFLOW, "riointr() doing host %p type %d\n",
+ ptr, HostP->Type);
clear_bit (RIO_BOARD_INTR_LOCK, &HostP->locks);
rio_dprintk (RIO_DEBUG_IFLOW, "rio: exit rio_interrupt (%d/%d)\n",
/* Nothing special here... */
static void rio_shutdown_port (void * ptr)
{
+ struct Port *PortP;
+
func_enter();
+ PortP = (struct Port *)ptr;
+ PortP->gs.tty = NULL;
#if 0
port->gs.flags &= ~ GS_ACTIVE;
if (!port->gs.tty) {
PortP->gs.count = 0;
}
-
+ PortP->gs.tty = NULL;
rio_dec_mod_count ();
-
func_exit ();
}
(ival ? CLOCAL : 0);
}
break;
+
case TIOCGSERIAL:
if ((rc = verify_area(VERIFY_WRITE, (void *) arg,
sizeof(struct serial_struct))) == 0)
gs_getserial(&PortP->gs, (struct serial_struct *) arg);
break;
+ case TCSBRK:
+ if ( PortP->State & RIO_DELETED ) {
+ rio_dprintk (RIO_DEBUG_TTY, "BREAK on deleted RTA\n");
+ rc = -EIO;
+ } else {
+ if (RIOShortCommand(p, PortP, SBREAK, 2, 250) == RIO_FAIL) {
+ rio_dprintk (RIO_DEBUG_INTR, "SBREAK RIOShortCommand failed\n");
+ rc = -EIO;
+ }
+ }
+ break;
+ case TCSBRKP:
+ if ( PortP->State & RIO_DELETED ) {
+ rio_dprintk (RIO_DEBUG_TTY, "BREAK on deleted RTA\n");
+ rc = -EIO;
+ } else {
+ int l;
+ l = arg?arg*100:250;
+ if (l > 255) l = 255;
+ if (RIOShortCommand(p, PortP, SBREAK, 2, arg?arg*100:250) == RIO_FAIL) {
+ rio_dprintk (RIO_DEBUG_INTR, "SBREAK RIOShortCommand failed\n");
+ rc = -EIO;
+ }
+ }
+ break;
case TIOCSSERIAL:
if ((rc = verify_area(VERIFY_READ, (void *) arg,
sizeof(struct serial_struct))) == 0)
#define rio_memcpy_fromio memcpy_fromio
#endif
-#define DEBUG
+#define DEBUG 1
/*
PortP->ModemState, ReportedModemStatus);
PortP->ModemState = ReportedModemStatus;
#ifdef MODEM_SUPPORT
- if ( PortP->Mapped ) {
+ if ( PortP->Mapped && (PortP->PortState & PORT_ISOPEN) && !(PortP->PortState & RIO_CLOSING)) {
/***********************************************************\
*************************************************************
*** ***
** If the device is a modem, then check the modem
** carrier.
*/
+
if (PortP->gs.tty == NULL)
break;
-
- if (!(PortP->gs.tty->termios->c_cflag & CLOCAL) &&
- ((PortP->State & (RIO_MOPEN|RIO_WOPEN)))) {
+ if (PortP->gs.tty->termios == NULL)
+ break;
+
+ if (!(PortP->gs.tty->termios->c_cflag & CLOCAL) &&
+ ((PortP->State & (RIO_MOPEN|RIO_WOPEN)))) {
rio_dprintk (RIO_DEBUG_CMD, "Is there a Carrier?\n");
/*
** Is there a carrier?
** Has carrier just dropped?
*/
if (PortP->State & RIO_CARR_ON) {
- if (PortP->State & (PORT_ISOPEN|RIO_WOPEN|RIO_MOPEN))
- tty_hangup (PortP->gs.tty);
+ if (PortP->State & (PORT_ISOPEN|RIO_WOPEN|RIO_MOPEN))
+ tty_hangup (PortP->gs.tty);
+
PortP->State &= ~RIO_CARR_ON;
rio_dprintk (RIO_DEBUG_CMD, "Carrirer just went down\n");
#ifdef STATS
#endif
static void RIOClearUp(struct Port *PortP);
-static int RIOShortCommand(struct rio_info *p, struct Port *PortP,
+int RIOShortCommand(struct rio_info *p, struct Port *PortP,
int command, int len, int arg);
** Other values of len aren't allowed, and will cause
** a panic.
*/
-static int RIOShortCommand(struct rio_info *p, struct Port *PortP,
+int RIOShortCommand(struct rio_info *p, struct Port *PortP,
int command, int len, int arg)
{
PKT *PacketP;
- In vortex_open(), set vp->tx_full to zero (else we get errors if the device was
closed with a full Tx ring).
+ 15Sep00 <2.2.18-pre3> andrewm
+ - Added support for the 3c556B Laptop Hurricane (Louis Gerbarg)
+
- See http://www.uow.edu.au/~andrewm/linux/#3c59x-2.2 for more details.
*/
static char version[] =
-"3c59x.c 16Aug00 Donald Becker and others http://www.scyld.com/network/vortex.html\n";
+"3c59x.c 15Sep00 Donald Becker and others http://www.scyld.com/network/vortex.html\n";
/* "Knobs" that adjust features and parameters. */
/* Set the copy breakpoint for the copy-only-tiny-frames scheme.
PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE, 128, vortex_probe1},
{"3c556 10/100 Mini PCI Adapter", 0x10B7, 0x6055, 0xffff,
PCI_USES_IO|PCI_USES_MASTER, IS_CYCLONE|HAS_CB_FNS, 128, vortex_probe1},
+ {"3c556B Laptop Hurricane", 0x10B7, 0x6056, 0xffff,
+ PCI_USES_IO|PCI_USES_MASTER, IS_TORNADO|HAS_CB_FNS, 128, vortex_probe1},
{"3c575 Boomerang CardBus", 0x10B7, 0x5057, 0xffff,
PCI_USES_IO|PCI_USES_MASTER, IS_BOOMERANG|HAS_MII, 64, vortex_probe1},
{"3CCFE575 Cyclone CardBus", 0x10B7, 0x5157, 0xffff,
#else
if (pci_tbl[chip_idx].device_id == 0x6055) {
outw(0x230 + i, ioaddr + Wn0EepromCmd);
+ } else if (pci_tbl[chip_idx].device_id == 0x6056) {
+ outw(EEPROM_Read + 0x30 + i, ioaddr + Wn0EepromCmd);
} else {
outw(EEPROM_Read + i, ioaddr + Wn0EepromCmd);
}
typedef struct net_device net_device;
#else
typedef struct device net_device;
-typedef struct wait_queue* wait_queue_head_t;
-#define init_waitqueue_head(nothing)
#endif
struct adapterlist{
unsigned char r;
k = PPA_SPIN_TMO;
- /* Wait for bit 6 and 7 - PJC */
- for (r = r_str (ppb); ((r & 0xc0)!=0xc0) && (k); k--) {
- udelay (1);
- r = r_str (ppb);
+ do {
+ r = r_str(ppb);
+ k--;
+ udelay(1);
}
+ while (!(r & 0x80) && (k));
/*
* return some status information.
(v == WRITE_6) ||
(v == WRITE_10));
- r = ppa_wait(host_no); /* Need a ppa_wait() - PJC */
+ /*
+ * We only get here if the drive is ready to communicate,
+ * hence no need for a full ppa_wait.
+ */
+ r = (r_str(ppb) & 0xf0);
while (r != (unsigned char) 0xf0) {
/*
}
}
/* Now check to see if the drive is ready to comunicate */
- r = ppa_wait(host_no); /* need ppa_wait() - PJC */
+ r = (r_str(ppb) & 0xf0);
/* If not, drop back down to the scheduler and wait a timer tick */
if (!(r & 0x80))
return 0;
#ifndef _PPA_H
#define _PPA_H
-#define PPA_VERSION "2.05 (for Linux 2.2.x)"
+#define PPA_VERSION "2.03 (for Linux 2.2.x)"
/*
* this driver has been hacked by Matteo Frigo (athena@theory.lcs.mit.edu)
* CONFIG_SCSI_PPA_HAVE_PEDANTIC => CONFIG_SCSI_IZIP_EPP16
* added CONFIG_SCSI_IZIP_SLOW_CTR option
* [2.03]
- *
- * Use ppa_wait() to check for ready AND connected status bits
- * Add ppa_wait() calls to ppa_completion()
- * by Peter Cherriman <pjc@ecs.soton.ac.uk> and
- * Tim Waugh <twaugh@redhat.com>
- * [2.04]
- * Fix kernel panic on scsi timeout, 2000-08-18 [2.05]
*/
/* ------ END OF USER CONFIGURABLE PARAMETERS ----- */
eh_device_reset_handler: NULL, \
eh_bus_reset_handler: ppa_reset, \
eh_host_reset_handler: ppa_reset, \
- use_new_eh_code: 1, \
bios_param: ppa_biosparam, \
this_id: -1, \
sg_tablesize: SG_ALL, \
** a SDTR or WDTR message is appended.
**----------------------------------------------------------------
*/
- u_char scsi_smsg [8];
- u_char scsi_smsg2[8];
+ u_char scsi_smsg [12];
+ u_char scsi_smsg2[12];
/*----------------------------------------------------------------
** Miscellaneous status'.
if [ "$CONFIG_USB_SERIAL" != "n" ]; then
bool ' USB Generic Serial Driver' CONFIG_USB_SERIAL_GENERIC $CONFIG_USB_SERIAL
dep_tristate ' USB Handspring Visor Driver' CONFIG_USB_SERIAL_VISOR $CONFIG_USB_SERIAL
+ dep_tristate ' USB Digi International AccelePort USB Serial Driver' CONFIG_USB_SERIAL_DIGI_ACCELEPORT $CONFIG_USB_SERIAL
if [ "$CONFIG_EXPERIMENTAL" != "n" ]; then
dep_tristate ' USB ConnectTech WhiteHEAT Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_WHITEHEAT $CONFIG_USB_SERIAL
dep_tristate ' USB FTDI Single Port Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_FTDI_SIO $CONFIG_USB_SERIAL
bool ' USB Keyspan USA-18X Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA18X
bool ' USB Keyspan USA-19W Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA19W
fi
- dep_tristate ' USB Digi International AccelePort USB Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_DIGI_ACCELEPORT $CONFIG_USB_SERIAL
dep_tristate ' USB ZyXEL omni.net LCD Plus Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_OMNINET $CONFIG_USB_SERIAL
dep_tristate ' USB Belkin and Peracom Single Port Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_BELKIN $CONFIG_USB_SERIAL
fi
* Somewhat peculiar due to OSS interface limitations. Only works
* for channels where a "slider" is already in front of it (i.e.
* a MIXER unit or a FEATURE unit with volume capability).
+ * 2000-11-26: Thomas Sailer
+ * Workaround for Dallas DS4201. The DS4201 uses PCM8 as format tag for
+ * its 8 bit modes, but expects signed data (and should therefore have used PCM).
*
*/
dev->devnum, u->interface, fmt->altsetting, d->srate, data[0] | (data[1] << 8) | (data[2] << 16)));
d->srate = data[0] | (data[1] << 8) | (data[2] << 16);
}
+ dprintk((KERN_DEBUG "usbaudio: set_format_in: USB format 0x%x, DMA format 0x%x srate %u\n", u->format, d->format, d->srate));
return 0;
}
dev->devnum, u->interface, fmt->altsetting, d->srate, data[0] | (data[1] << 8) | (data[2] << 16)));
d->srate = data[0] | (data[1] << 8) | (data[2] << 16);
}
+ dprintk((KERN_DEBUG "usbaudio: set_format_out: USB format 0x%x, DMA format 0x%x srate %u\n", u->format, d->format, d->srate));
return 0;
}
continue;
}
format = (fmt[5] == 2) ? (AFMT_U16_LE | AFMT_U8) : (AFMT_S16_LE | AFMT_S8);
+ /* Dallas DS4201 workaround */
+ if (dev->descriptor.idVendor == 0x04fa && dev->descriptor.idProduct == 0x4201)
+ format = (AFMT_S16_LE | AFMT_S8);
fmt = find_csinterface_descriptor(buffer, buflen, NULL, FORMAT_TYPE, asifout, i);
if (!fmt) {
printk(KERN_ERR "usbaudio: device %u interface %u altsetting %u FORMAT_TYPE descriptor not found\n",
i = my_usb_control_msg(dev, usb_rcvctrlpipe(dev, 0), ctrl.request, ctrl.requesttype,
ctrl.value, ctrl.index, tbuf, ctrl.length, tmo);
if ((i > 0) && ctrl.length) {
- if (copy_to_user(ctrl.data, tbuf, ctrl.length))
+ if (copy_to_user(ctrl.data, tbuf, ctrl.length)) {
+ free_page((unsigned long)tbuf);
return -EFAULT;
+ }
}
} else {
if (ctrl.length) {
- if (copy_from_user(tbuf, ctrl.data, ctrl.length))
+ if (copy_from_user(tbuf, ctrl.data, ctrl.length)) {
+ free_page((unsigned long)tbuf);
return -EFAULT;
+ }
}
i = my_usb_control_msg(dev, usb_sndctrlpipe(dev, 0), ctrl.request, ctrl.requesttype,
ctrl.value, ctrl.index, tbuf, ctrl.length, tmo);
}
i = my_usb_bulk_msg(dev, pipe, tbuf, len1, &len2, tmo);
if (!i && len2) {
- if (copy_to_user(bulk.data, tbuf, len2))
+ if (copy_to_user(bulk.data, tbuf, len2)) {
+ free_page((unsigned long)tbuf);
return -EFAULT;
+ }
}
} else {
if (len1) {
- if (copy_from_user(tbuf, bulk.data, len1))
+ if (copy_from_user(tbuf, bulk.data, len1)) {
+ free_page((unsigned long)tbuf);
return -EFAULT;
+ }
}
i = my_usb_bulk_msg(dev, pipe, tbuf, len1, &len2, tmo);
}
/*
-* Digi AccelePort USB-4 Serial Converter
+* Digi AccelePort USB-4 and USB-2 Serial Converters
*
* Copyright 2000 by Digi International
*
* Peter Berger (pberger@brimson.com)
* Al Borchers (borchers@steinerpoint.com)
*
+* (11/01/2000) pberger and borchers
+* -- Turned off the USB_DISABLE_SPD flag for write bulk urbs--it caused
+* USB 4 ports to hang on startup.
+* -- Serialized access to write urbs by adding the dp_write_urb_in_use
+* flag; otherwise, the driver caused SMP system hangs. Watching the
+* urb status is not sufficient.
+*
+* (10/05/2000) gkh
+* -- Fixed bug with urb->dev not being set properly, now that the usb
+* core needs it.
+*
* (8/8/2000) pberger and borchers
* -- Fixed close so that
* - it can timeout while waiting for transmit idle, if needed;
* - Following Documentation/DocBook/kernel-locking.pdf no spin locks
* are held when calling copy_to/from_user or printk.
*
-* $Id: digi_acceleport.c,v 1.80 2000/08/09 06:36:18 root Exp $
+* $Id: digi_acceleport.c,v 1.80.1.2 2000/11/02 05:45:08 root Exp $
*/
#include <linux/config.h>
int dp_in_buf_len;
unsigned char dp_in_buf[DIGI_IN_BUF_SIZE];
unsigned char dp_in_flag_buf[DIGI_IN_BUF_SIZE];
+ int dp_write_urb_in_use;
unsigned int dp_modem_signals;
wait_queue_head_t dp_modem_change_wait;
int dp_open_count; /* inc on open, dec on close */
/* wake up other tty processes */
wake_up_interruptible( &tty->write_wait );
- /* For 2.2.16 backport -- wake_up_interruptible( &tty->poll_wait ); */
+ wake_up_interruptible( &tty->poll_wait ); /* For 2.2.x backport */
}
while( count > 0 ) {
- while( oob_port->write_urb->status == -EINPROGRESS ) {
+ while( oob_port->write_urb->status == -EINPROGRESS
+ || oob_priv->dp_write_urb_in_use ) {
cond_wait_interruptible_timeout_irqrestore(
&oob_port->write_wait, DIGI_RETRY_TIMEOUT,
&oob_priv->dp_port_lock, flags );
memcpy( oob_port->write_urb->transfer_buffer, buf, len );
oob_port->write_urb->transfer_buffer_length = len;
+ oob_port->write_urb->dev = port->serial->dev;
if( (ret=usb_submit_urb(oob_port->write_urb)) == 0 ) {
+ oob_priv->dp_write_urb_in_use = 1;
count -= len;
buf += len;
}
while( count > 0 && ret == 0 ) {
- while( port->write_urb->status == -EINPROGRESS
- && jiffies < timeout ) {
+ while( (port->write_urb->status == -EINPROGRESS
+ || priv->dp_write_urb_in_use) && jiffies < timeout ) {
cond_wait_interruptible_timeout_irqrestore(
&port->write_wait, DIGI_RETRY_TIMEOUT,
&priv->dp_port_lock, flags );
memcpy( data, buf, len );
port->write_urb->transfer_buffer_length = len;
}
+ port->write_urb->dev = port->serial->dev;
if( (ret=usb_submit_urb(port->write_urb)) == 0 ) {
+ priv->dp_write_urb_in_use = 1;
priv->dp_out_buf_len = 0;
count -= len;
buf += len;
spin_lock_irqsave( &oob_priv->dp_port_lock, flags );
spin_lock( &port_priv->dp_port_lock );
- while( oob_port->write_urb->status == -EINPROGRESS ) {
+ while( oob_port->write_urb->status == -EINPROGRESS
+ || oob_priv->dp_write_urb_in_use ) {
spin_unlock( &port_priv->dp_port_lock );
cond_wait_interruptible_timeout_irqrestore(
&oob_port->write_wait, DIGI_RETRY_TIMEOUT,
data[7] = 0;
oob_port->write_urb->transfer_buffer_length = 8;
+ oob_port->write_urb->dev = port->serial->dev;
if( (ret=usb_submit_urb(oob_port->write_urb)) == 0 ) {
+ oob_priv->dp_write_urb_in_use = 1;
port_priv->dp_modem_signals =
(port_priv->dp_modem_signals&~(TIOCM_DTR|TIOCM_RTS))
| (modem_signals&(TIOCM_DTR|TIOCM_RTS));
}
/* restart read chain */
- if( priv->dp_throttle_restart )
+ if( priv->dp_throttle_restart ) {
+ port->read_urb->dev = port->serial->dev;
ret = usb_submit_urb( port->read_urb );
+ }
/* turn throttle off */
priv->dp_throttled = 0;
spin_lock_irqsave( &priv->dp_port_lock, flags );
/* wait for urb status clear to submit another urb */
- if( port->write_urb->status == -EINPROGRESS ) {
+ if( port->write_urb->status == -EINPROGRESS
+ || priv->dp_write_urb_in_use ) {
/* buffer data if count is 1 (probably put_char) if possible */
if( count == 1 ) {
}
port->write_urb->transfer_buffer_length = data_len+2;
+ port->write_urb->dev = port->serial->dev;
*data++ = DIGI_CMD_SEND_DATA;
*data++ = data_len;
memcpy( data, from_user ? user_buf : buf, new_len );
if( (ret=usb_submit_urb(port->write_urb)) == 0 ) {
+ priv->dp_write_urb_in_use = 1;
ret = new_len;
priv->dp_out_buf_len = 0;
}
== ((digi_serial_t *)(serial->private))->ds_oob_port_num ) {
dbg( "digi_write_bulk_callback: oob callback" );
spin_lock( &priv->dp_port_lock );
+ priv->dp_write_urb_in_use = 0;
wake_up_interruptible( &port->write_wait );
spin_unlock( &priv->dp_port_lock );
return;
/* try to send any buffered data on this port, if it is open */
spin_lock( &priv->dp_port_lock );
+ priv->dp_write_urb_in_use = 0;
if( priv->dp_open_count && port->write_urb->status != -EINPROGRESS
&& priv->dp_out_buf_len > 0 ) {
port->write_urb->transfer_buffer_length
= priv->dp_out_buf_len+2;
+ port->write_urb->dev = serial->dev;
memcpy( port->write_urb->transfer_buffer+2, priv->dp_out_buf,
priv->dp_out_buf_len );
if( (ret=usb_submit_urb(port->write_urb)) == 0 ) {
+ priv->dp_write_urb_in_use = 1;
priv->dp_out_buf_len = 0;
}
spin_lock_irqsave( &priv->dp_port_lock, flags );
- if( port->write_urb->status == -EINPROGRESS )
+ if( port->write_urb->status == -EINPROGRESS
+ || priv->dp_write_urb_in_use )
room = 0;
else
room = port->bulk_out_size - 2 - priv->dp_out_buf_len;
digi_port_t *priv = (digi_port_t *)(port->private);
- if( port->write_urb->status == -EINPROGRESS ) {
+ if( port->write_urb->status == -EINPROGRESS
+ || priv->dp_write_urb_in_use ) {
dbg( "digi_chars_in_buffer: port=%d, chars=%d", priv->dp_port_num, port->bulk_out_size - 2 );
/* return( port->bulk_out_size - 2 ); */
return( 256 );
spin_lock_irqsave( &priv->dp_port_lock, flags );
port->active = 0;
+ priv->dp_write_urb_in_use = 0;
priv->dp_in_close = 0;
--priv->dp_open_count;
MOD_DEC_USE_COUNT;
port = &serial->port[i];
- port->write_urb->transfer_flags |= USB_DISABLE_SPD;
+ port->write_urb->dev = port->serial->dev;
if( (ret=usb_submit_urb(port->read_urb)) != 0 ) {
err(
priv->dp_port_num = i;
priv->dp_out_buf_len = 0;
priv->dp_in_buf_len = 0;
+ priv->dp_write_urb_in_use = 0;
priv->dp_modem_signals = 0;
init_waitqueue_head( &priv->dp_modem_change_wait );
priv->dp_open_count = 0;
}
/* continue read */
+ urb->dev = port->serial->dev;
if( (ret=usb_submit_urb(urb)) != 0 ) {
err( __FUNCTION__ ": failed resubmitting urb, ret=%d, port=%d",
ret, priv->dp_port_num );
MODULE_AUTHOR("Peter Berger <pberger@brimson.com>, Al Borchers <borchers@steinerpoint.com>");
-MODULE_DESCRIPTION("Digi AccelePort USB-4 Serial Converter driver");
+MODULE_DESCRIPTION("Digi AccelePort USB-2/USB-4 Serial Converter driver");
if (pci_enable_device(dev) < 0)
return -1;
+ pci_set_master(dev);
+
if (!dev->irq) {
err("found UHCI device with no IRQ assigned. check BIOS settings!");
return -1;
if (pci_enable_device (dev) < 0)
continue;
+ pci_set_master(dev);
+
if(!dev->irq)
{
err("Found UHCI device with no IRQ assigned. Check BIOS settings!");
+++ /dev/null
---- i810_rng.c_orig Sun Nov 26 18:58:26 2000
-+++ i810_rng.c Sun Nov 26 18:59:27 2000
-@@ -439,6 +439,8 @@
- if (!pdev)
- pdev = pci_find_device (0x8086, 0x2428, NULL);
- if (!pdev)
-+ pdev = pci_find_device (0x8086, 0x1130, NULL);
-+ if (!pdev)
- return -ENODEV;
-
- DPRINTK ("ENTER\n");
{
if (prof_buffer && current->pid) {
addr &= 0x7fffffff;
- addr -= (unsigned long)&_stext[0];
+ addr -= (unsigned long)&_stext;
addr >>= prof_shift;
/*
* Don't ignore out-of-bounds EIP values silently,
cpuid_t cpu_id;
__u16 cpu_addr;
__u16 cpu_nr;
- unsigned long loops_per_sec;
+ unsigned long loops_per_jiffy;
unsigned long *pgd_quick;
unsigned long *pte_quick;
unsigned long pgtable_cache_sz;
enum {
DEV_CDROM=1,
DEV_HWMON=2,
- DEV_MAC_HID=3
+ DEV_MAC_HID=5
};
/* /proc/sys/dev/cdrom */
EXPORT_SYMBOL(init_task_union);
/* Support for external backtracer */
-extern char _stext[], _etext[];
+extern char _stext, _etext;
EXPORT_SYMBOL(_stext);
EXPORT_SYMBOL(_etext);
EXPORT_SYMBOL(module_list);
* throttling.
*/
- if (!try_to_free_buffers(page, wait))
+ if (!try_to_free_buffers(page, wait)) {
+ if(--count < 0) break;
goto refresh_clock;
+ }
return 1;
}