Commit 0082f7ce authored by Linus Torvalds's avatar Linus Torvalds

Import 2.4.0-test3pre9

parent 462cf157
......@@ -9840,7 +9840,38 @@ CONFIG_USB_SERIAL_FTDI_SIO
USB Keyspan PDA Single Port Serial Driver
CONFIG_USB_SERIAL_KEYSPAN_PDA
Say Y here if you want to use a Keyspan PDA single port USB to
serial converter device.
serial converter device. This driver makes use of firmware
developed from scratch by Brian Warner.
USB Keyspan USA-xxx Serial Driver
CONFIG_USB_SERIAL_KEYSPAN
Say Y here if you want to use Keyspan USB to serial converter
devices. This driver makes use of Keyspan's official firmware
and was developed with their support. You must also include
firmware to support your particular device(s).
See http://www.linuxcare.com.au/hugh/keyspan.html for
more information.
USB Keyspan USA-28 Firmware
CONFIG_USB_SERIAL_KEYSPAN_USA28
Say Y here to include firmware for the USA-28 converter.
USB Keyspan USA-28X Firmware
CONFIG_USB_SERIAL_KEYSPAN_USA28X
Say Y here to include firmware for the USA-28X converter.
USB Keyspan USA-19 Firmware
CONFIG_USB_SERIAL_KEYSPAN_USA19
Say Y here to include firmware for the USA-19 converter.
USB Keyspan USA-18X Firmware
CONFIG_USB_SERIAL_KEYSPAN_USA18X
Say Y here to include firmware for the USA-18X converter.
USB Keyspan USA-19W Firmware
CONFIG_USB_SERIAL_KEYSPAN_USA19W
Say Y here to include firmware for the USA-19W converter.
USB ZyXEL omni.net LCD Plus Driver
CONFIG_USB_SERIAL_OMNINET
......
......@@ -16,7 +16,7 @@ HPATH = $(TOPDIR)/include
FINDHPATH = $(HPATH)/asm $(HPATH)/linux $(HPATH)/scsi $(HPATH)/net
HOSTCC = gcc
HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -Werror
HOSTCFLAGS = -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
CROSS_COMPILE =
......@@ -82,7 +82,7 @@ endif
CPPFLAGS := -D__KERNEL__ -I$(HPATH)
CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -Werror
CFLAGS := $(CPPFLAGS) -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer
AFLAGS := -D__ASSEMBLY__ $(CPPFLAGS)
#
......
......@@ -74,7 +74,7 @@ void
cpu_idle(void)
{
/* An endless idle loop with no priority at all. */
current->priority = 0;
current->nice = 20;
current->counter = -100;
while (1) {
......
......@@ -651,7 +651,7 @@ smp_percpu_timer_interrupt(struct pt_regs *regs)
}
if (user) {
if (current->priority < DEF_PRIORITY) {
if (current->nice > 0) {
kstat.cpu_nice++;
kstat.per_cpu_nice[cpu]++;
} else {
......
......@@ -75,7 +75,7 @@ void cpu_idle(void)
{
/* endless idle loop with no priority at all */
init_idle();
current->priority = 0;
current->nice = 20;
current->counter = -100;
while (1) {
......
......@@ -45,6 +45,7 @@ CONFIG_NOHIGHMEM=y
# CONFIG_MATH_EMULATION is not set
# CONFIG_MTRR is not set
CONFIG_SMP=y
CONFIG_HAVE_DEC_LOCK=y
#
# Loadable module support
......@@ -141,13 +142,9 @@ CONFIG_INET=y
# CONFIG_NET_IPIP is not set
# CONFIG_NET_IPGRE is not set
# CONFIG_IP_ALIAS is not set
# CONFIG_INET_ECN is not set
# CONFIG_SYN_COOKIES is not set
#
# (it is safe to leave these untouched)
#
CONFIG_SKB_LARGE=y
#
#
#
......
......@@ -589,7 +589,7 @@ static inline void handle_smp_time (int user, int cpu)
p->counter = 0;
p->need_resched = 1;
}
if (p->priority < DEF_PRIORITY) {
if (p->nice > 0) {
kstat.cpu_nice += user;
kstat.per_cpu_nice[cpu] += user;
} else {
......
......@@ -77,8 +77,8 @@ sigpending = 8
addr_limit = 12
exec_domain = 16
need_resched = 20
processor = 48
tsk_ptrace = 56
tsk_ptrace = 24
processor = 52
ENOSYS = 38
......
......@@ -123,7 +123,7 @@ void cpu_idle (void)
{
/* endless idle loop with no priority at all */
init_idle();
current->priority = 0;
current->nice = 20;
current->counter = -100;
while (1) {
......
......@@ -79,7 +79,7 @@ static unsigned long last_tsc_low; /* lsb 32 bits of Time Stamp Counter */
unsigned long fast_gettimeoffset_quotient=0;
extern rwlock_t xtime_lock;
extern volatile unsigned long lost_ticks;
extern unsigned long wall_jiffies;
spinlock_t rtc_lock = SPIN_LOCK_UNLOCKED;
......@@ -262,7 +262,7 @@ void do_gettimeofday(struct timeval *tv)
read_lock_irqsave(&xtime_lock, flags);
usec = do_gettimeoffset();
{
unsigned long lost = lost_ticks;
unsigned long lost = jiffies - wall_jiffies;
if (lost)
usec += lost * (1000000 / HZ);
}
......@@ -282,14 +282,14 @@ void do_gettimeofday(struct timeval *tv)
void do_settimeofday(struct timeval *tv)
{
write_lock_irq(&xtime_lock);
/* This is revolting. We need to set the xtime.tv_usec
* correctly. However, the value in this location is
* is value at the last tick.
* Discover what correction gettimeofday
* would have done, and then undo it!
/*
* This is revolting. We need to set "xtime" correctly. However, the
* value in this location is the value at the most recent update of
* wall time. Discover what correction gettimeofday() would have
* made, and then undo it!
*/
tv->tv_usec -= do_gettimeoffset();
tv->tv_usec -= lost_ticks * (1000000 / HZ);
tv->tv_usec -= (jiffies - wall_jiffies) * (1000000 / HZ);
while (tv->tv_usec < 0) {
tv->tv_usec += 1000000;
......
......@@ -114,7 +114,7 @@ cpu_idle (void *unused)
{
/* endless idle loop with no priority at all */
init_idle();
current->priority = 0;
current->nice = 20;
current->counter = -100;
#ifdef CONFIG_SMP
......
......@@ -412,7 +412,7 @@ smp_do_timer(struct pt_regs *regs)
}
if (user) {
if (current->priority < DEF_PRIORITY) {
if (current->nice > 0) {
kstat.cpu_nice++;
kstat.per_cpu_nice[cpu]++;
} else {
......
......@@ -81,7 +81,7 @@ void cpu_idle(void)
{
/* endless idle loop with no priority at all */
init_idle();
current->priority = 0;
current->nice = 20;
current->counter = -100;
idle();
}
......
......@@ -34,7 +34,7 @@
void cpu_idle(void)
{
/* endless idle loop with no priority at all */
current->priority = 0;
current->nice = 20;
current->counter = -100;
init_idle();
......
......@@ -35,7 +35,7 @@ asmlinkage int cpu_idle(void)
{
/* endless idle loop with no priority at all */
init_idle();
current->priority = 0;
current->nice = 20;
current->counter = -100;
while (1) {
while (!current->need_resched)
......
......@@ -120,7 +120,7 @@ void rt_timer_interrupt(struct pt_regs *regs)
}
if (user) {
if (current->priority < DEF_PRIORITY) {
if (current->nice > 0) {
inc = &kstat.cpu_nice;
inc2 = &kstat.per_cpu_nice[cpu];
} else {
......
......@@ -95,7 +95,7 @@ void smp_local_timer_interrupt(struct pt_regs * regs)
p->counter = 0;
current->need_resched = 1;
}
if (p->priority < DEF_PRIORITY) {
if (p->nice > 0) {
kstat.cpu_nice += user;
kstat.per_cpu_nice[cpu] += user;
} else {
......
......@@ -59,7 +59,7 @@ int cpu_idle(void *unused)
{
/* endless idle loop with no priority at all */
init_idle();
current->priority = 0;
current->nice = 20;
current->counter = -100;
wait_psw.mask = _WAIT_PSW_MASK;
wait_psw.addr = (unsigned long) &&idle_wakeup | 0x80000000L;
......
......@@ -712,7 +712,7 @@ void smp_local_timer_interrupt(struct pt_regs * regs)
p->counter = 0;
p->need_resched = 1;
}
if (p->priority < DEF_PRIORITY) {
if (p->nice > 0) {
kstat.cpu_nice += user;
kstat.per_cpu_nice[cpu] += user;
} else {
......
......@@ -63,7 +63,7 @@ void cpu_idle(void *unused)
{
/* endless idle loop with no priority at all */
init_idle();
current->priority = 0;
current->nice = 20;
current->counter = -100;
while (1) {
......
......@@ -60,7 +60,7 @@ int cpu_idle(void)
goto out;
/* endless idle loop with no priority at all */
current->priority = 0;
current->nice = 20;
current->counter = -100;
init_idle();
......
......@@ -484,7 +484,7 @@ void smp4d_percpu_timer_interrupt(struct pt_regs *regs)
}
if(user) {
if(current->priority < DEF_PRIORITY) {
if(current->nice > 0) {
kstat.cpu_nice++;
kstat.per_cpu_nice[cpu]++;
} else {
......
......@@ -471,7 +471,7 @@ void smp4m_percpu_timer_interrupt(struct pt_regs *regs)
}
if(user) {
if(current->priority < DEF_PRIORITY) {
if(current->nice > 0) {
kstat.cpu_nice++;
kstat.per_cpu_nice[cpu]++;
} else {
......
......@@ -53,7 +53,7 @@ int cpu_idle(void)
return -EPERM;
/* endless idle loop with no priority at all */
current->priority = 0;
current->nice = 20;
current->counter = -100;
init_idle();
......
......@@ -717,7 +717,7 @@ void smp_percpu_timer_interrupt(struct pt_regs *regs)
}
if (user) {
if (current->priority < DEF_PRIORITY) {
if (current->nice > 0) {
inc = &kstat.cpu_nice;
inc2 = &kstat.per_cpu_nice[cpu];
} else {
......
......@@ -544,7 +544,7 @@ int tdfx_lock(struct inode *inode, struct file *filp, unsigned int cmd,
if (lock.context != tdfx_res_ctx.handle) {
current->counter = 5;
current->priority = DEF_PRIORITY/4;
current->nice = 0;
}
DRM_DEBUG("%d %s\n", lock.context, ret ? "interrupted" : "has lock");
......@@ -589,7 +589,7 @@ int tdfx_unlock(struct inode *inode, struct file *filp, unsigned int cmd,
if (lock.context != tdfx_res_ctx.handle) {
current->counter = 5;
current->priority = DEF_PRIORITY;
current->nice = 0;
}
return 0;
......
......@@ -1082,8 +1082,8 @@ static int BusLogic_InitializeFlashPointProbeInfo(BusLogic_HostAdapter_T
#else
BusLogic_Error("BusLogic: FlashPoint Host Adapter detected at "
"PCI Bus %d Device %d\n", NULL, Bus, Device);
BusLogic_Error("BusLogic: I/O Address 0x%X PCI Address 0x%X, "
"but FlashPoint\n", NULL, IO_Address, PCI_Address);
BusLogic_Error("BusLogic: I/O Address 0x%X PCI Address 0x%X, irq %d, "
"but FlashPoint\n", NULL, IO_Address, PCI_Address, IRQ_Channel);
BusLogic_Error("BusLogic: support was omitted in this kernel "
"configuration.\n", NULL);
#endif
......
......@@ -38,6 +38,14 @@ comment 'USB Devices'
bool ' USB ConnectTech WhiteHEAT Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_WHITEHEAT
bool ' USB FTDI Single Port Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_FTDI_SIO
bool ' USB Keyspan PDA Single Port Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_KEYSPAN_PDA
bool ' USB Keyspan USA-xxx Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_KEYSPAN
if [ "$CONFIG_USB_SERIAL_KEYSPAN" != "n" ]; then
bool ' USB Keyspan USA-28 Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA28
bool ' USB Keyspan USA-28X Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA28X
bool ' USB Keyspan USA-19 Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA19
bool ' USB Keyspan USA-18X Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA18X
bool ' USB Keyspan USA-19W Firmware' CONFIG_USB_SERIAL_KEYSPAN_USA19W
fi
bool ' USB Digi International AccelePort USB Serial Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_DIGI_ACCELEPORT
bool ' USB ZyXEL omni.net LCD Plus Driver (EXPERIMENTAL)' CONFIG_USB_SERIAL_OMNINET
fi
......@@ -48,10 +56,10 @@ comment 'USB Devices'
dep_tristate ' USB Kodak DC-2xx Camera support' CONFIG_USB_DC2XX $CONFIG_USB
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
dep_tristate ' USB Mustek MDC800 Digital Camera support (EXPERIMENTAL)' CONFIG_USB_MDC800 $CONFIG_USB
fi
dep_tristate ' USB Mass Storage support' CONFIG_USB_STORAGE $CONFIG_USB $CONFIG_SCSI
if [ "$CONFIG_USB_STORAGE" != "n" ]; then
bool ' USB Mass Storage verbose debug' CONFIG_USB_STORAGE_DEBUG
dep_tristate ' USB Mass Storage support (EXPERIMENTAL)' CONFIG_USB_STORAGE $CONFIG_USB $CONFIG_SCSI
if [ "$CONFIG_USB_STORAGE" != "n" ]; then
bool ' USB Mass Storage verbose debug' CONFIG_USB_STORAGE_DEBUG
fi
fi
dep_tristate ' USS720 parport driver' CONFIG_USB_USS720 $CONFIG_USB $CONFIG_PARPORT
dep_tristate ' DABUSB driver' CONFIG_USB_DABUSB $CONFIG_USB
......@@ -60,7 +68,8 @@ comment 'USB Devices'
dep_tristate ' USB ADMtek Pegasus-based device support (EXPERIMENTAL)' CONFIG_USB_PEGASUS $CONFIG_USB $CONFIG_NET
dep_tristate ' USB Diamond Rio500 support (EXPERIMENTAL)' CONFIG_USB_RIO500 $CONFIG_USB
dep_tristate ' D-Link USB FM radio support (EXPERIMENTAL)' CONFIG_USB_DSBR $CONFIG_USB $CONFIG_VIDEO_DEV
dep_tristate ' Microtek X6USB scanner support (EXPERIMENTAL)' CONFIG_USB_MICROTEK $CONFIG_SCSI
dep_tristate ' Microtek X6USB scanner support (EXPERIMENTAL)' CONFIG_USB_MICROTEK $CONFIG_USB $CONFIG_SCSI
dep_tristate ' USB Bluetooth support (EXPERIMENTAL)' CONFIG_USB_BLUETOOTH $CONFIG_USB
fi
comment 'USB HID'
......
......@@ -91,6 +91,7 @@ obj-$(CONFIG_USB_PEGASUS) += pegasus.o
obj-$(CONFIG_USB_RIO500) += rio500.o
obj-$(CONFIG_USB_DSBR) += dsbr100.o
obj-$(CONFIG_USB_MICROTEK) += microtek.o
obj-$(CONFIG_USB_BLUETOOTH) += bluetooth.o
# Extract lists of the multi-part drivers.
# The 'int-*' lists are the intermediate files used to build the multi's.
......
This diff is collapsed.
......@@ -19,6 +19,9 @@ endif
ifeq ($(CONFIG_USB_SERIAL_KEYSPAN_PDA),y)
O_OBJS += keyspan_pda.o
endif
ifeq ($(CONFIG_USB_SERIAL_KEYSPAN),y)
O_OBJS += keyspan.o
endif
ifeq ($(CONFIG_USB_SERIAL_OMNINET),y)
O_OBJS += omninet.o
endif
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
usa26msg.h
Copyright (c) 1998-2000 InnoSys Incorporated. All Rights Reserved
This file is available under a BSD-style copyright
Keyspan USB Async Firmware to run on Anchor EZ-USB
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain this licence text
without modification, this list of conditions, and the following
disclaimer. The following copyright notice must appear immediately at
the beginning of all source files:
Copyright (c) 1998-2000 InnoSys Incorporated. All Rights Reserved
This file is available under a BSD-style copyright
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of InnoSys Incorprated may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY INNOSYS CORP. ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Third revision: USA28X version (aka USA26)
Buffer formats for RX/TX data messages are not defined by
a structure, but are described here:
USB OUT (host -> USA26, transmit) messages contain a
REQUEST_ACK indicator (set to 0xff to request an ACK at the
completion of transmit; 0x00 otherwise), followed by data:
RQSTACK DAT DAT DAT ...
with a total data length of 63.
USB IN (USA26 -> host, receive) messages contain either a zero
flag (indicating no error in any data bytes):
00 DAT DAT DAT ...
for a total of 63 data bytes, or a non-zero status flag (indicating
that all data bytes will be preceded by status flag):
STAT DAT STAT DAT STAT DAT ...
for a total of 32 data bytes. The valid bits in the STAT bytes are:
OVERRUN 0x02
PARITY 0x04
FRAMING 0x08
BREAK 0x10
Note: a "no status" RX data message (first byte zero) can serve as
a "break off" indicator.
revision history:
1999feb10 add reportHskiaChanges to allow us to ignore them
1999feb10 add txAckThreshold for fast+loose throughput enhancement
1999mar30 beef up support for RX error reporting
1999apr14 add resetDataToggle to control message
2000jan04 merge with usa17msg.h
2000jun01 add extended BSD-style copyright text
Note on shared names:
In the case of fields which have been merged between the USA17
and USA26 definitions, the USA26 definition is the first part
of the name and the USA17 definition is the second part of the
name; both meanings are described below.
*/
#ifndef __USA26MSG__
#define __USA26MSG__
#ifndef __stubs__
#include "datadefs.h"
#endif
typedef struct txAckMessage
{
u8 dummy;
} txAckMessage;
typedef struct portControlMessage
{
/*
there are three types of "commands" sent in the control message:
1. configuration changes which must be requested by setting
the corresponding "set" flag (and should only be requested
when necessary, to reduce overhead on the USA26):
*/
u8 setClocking, // BOTH: host requests baud rate be set
baudLo, // BOTH: host does baud divisor calculation
baudHi, // BOTH: baudHi is only used for first port (gives lower rates)
externalClock_txClocking,
// USA26: 0=internal, other=external
// USA17: 0=internal, other=external/RI
rxClocking, // USA17: 0=internal, 1=external/RI, other=external/DSR
setLcr, // BOTH: host requests lcr be set
lcr, // BOTH: use PARITY, STOPBITS, DATABITS below
setFlowControl, // BOTH: host requests flow control be set
ctsFlowControl, // BOTH: 1=use CTS flow control, 0=don't
xonFlowControl, // BOTH: 1=use XON/XOFF flow control, 0=don't
xonChar, // BOTH: specified in current character format
xoffChar, // BOTH: specified in current character format
setTxTriState_setRts,
// USA26: host requests TX tri-state be set
// USA17: host requests RTS output be set
txTriState_rts, // BOTH: 1=active (normal), 0=tristate (off)
setHskoa_setDtr,
// USA26: host requests HSKOA output be set
// USA17: host requests DTR output be set
hskoa_dtr, // BOTH: 1=on, 0=off
setPrescaler, // USA26: host requests prescalar be set (default: 13)
prescaler; // BOTH: specified as N/8; values 8-ff are valid
// must be set any time internal baud rate is set;
// must not be set when external clocking is used
// note: in USA17, prescaler is applied whenever
// setClocking is requested
/*
3. configuration data which is simply used as is (no overhead,
but must be specified correctly in every host message).
*/
u8 forwardingLength, // BOTH: forward when this number of chars available
reportHskiaChanges_dsrFlowControl,
// USA26: 1=normal; 0=ignore external clock
// USA17: 1=use DSR flow control, 0=don't
txAckThreshold, // BOTH: 0=not allowed, 1=normal, 2-255 deliver ACK faster
loopbackMode; // BOTH: 0=no loopback, 1=loopback enabled
/*
4. commands which are flags only; these are processed in order
(so that, e.g., if both _txOn and _txOff flags are set, the
port ends in a TX_OFF state); any non-zero value is respected
*/
u8 _txOn, // BOTH: enable transmitting (and continue if there's data)
_txOff, // BOTH: stop transmitting
txFlush, // BOTH: toss outbound data
txBreak, // BOTH: turn on break (cleared by _txOn)
rxOn, // BOTH: turn on receiver
rxOff, // BOTH: turn off receiver
rxFlush, // BOTH: toss inbound data
rxForward, // BOTH: forward all inbound data, NOW (as if fwdLen==1)
returnStatus, // BOTH: return current status (even if it hasn't changed)
resetDataToggle;// BOTH: reset data toggle state to DATA0
} portControlMessage;
// defines for bits in lcr
#define USA_DATABITS_5 0x00
#define USA_DATABITS_6 0x01
#define USA_DATABITS_7 0x02
#define USA_DATABITS_8 0x03
#define STOPBITS_5678_1 0x00 // 1 stop bit for all byte sizes
#define STOPBITS_5_1p5 0x04 // 1.5 stop bits for 5-bit byte
#define STOPBITS_678_2 0x04 // 2 stop bits for 6/7/8-bit byte
#define USA_PARITY_NONE 0x00
#define USA_PARITY_ODD 0x08
#define USA_PARITY_EVEN 0x18
#define PARITY_1 0x28
#define PARITY_0 0x38
// all things called "StatusMessage" are sent on the status endpoint
typedef struct portStatusMessage // one for each port
{
u8 port, // BOTH: 0=first, 1=second, other=see below
hskia_cts, // USA26: reports HSKIA pin
// USA17: reports CTS pin
gpia_dcd, // USA26: reports GPIA pin
// USA17: reports DCD pin
dsr, // USA17: reports DSR pin
ri, // USA17: reports RI pin
_txOff, // port has been disabled (by host)
_txXoff, // port is in XOFF state (either host or RX XOFF)
rxEnabled, // as configured by rxOn/rxOff 1=on, 0=off
controlResponse;// 1=a control message has been processed
} portStatusMessage;
// bits in RX data message when STAT byte is included
#define RXERROR_OVERRUN 0x02
#define RXERROR_PARITY 0x04
#define RXERROR_FRAMING 0x08
#define RXERROR_BREAK 0x10
typedef struct globalControlMessage
{
u8 sendGlobalStatus, // 2=request for two status responses
resetStatusToggle, // 1=reset global status toggle
resetStatusCount; // a cycling value
} globalControlMessage;
typedef struct globalStatusMessage
{
u8 port, // 3
sendGlobalStatus, // from request, decremented
resetStatusCount; // as in request
} globalStatusMessage;
typedef struct globalDebugMessage
{
u8 port, // 2
a,
b,
c,
d;
} globalDebugMessage;
// ie: the maximum length of an EZUSB endpoint buffer
#define MAX_DATA_LEN 64
// update status approx. 60 times a second (16.6666 ms)
#define STATUS_UPDATE_INTERVAL 16
// status rationing tuning value (each port gets checked each n ms)
#define STATUS_RATION 10
#endif
This diff is collapsed.
/*
usa28msg.h
Copyright (c) 1998-2000 InnoSys Incorporated. All Rights Reserved
This file is available under a BSD-style copyright
Keyspan USB Async Firmware to run on Anchor EZ-USB
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
1. Redistributions of source code must retain this licence text
without modification, this list of conditions, and the following
disclaimer. The following copyright notice must appear immediately at
the beginning of all source files:
Copyright (c) 1998-2000 InnoSys Incorporated. All Rights Reserved
This file is available under a BSD-style copyright
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
3. The name of InnoSys Incorprated may not be used to endorse or promote
products derived from this software without specific prior written
permission.
THIS SOFTWARE IS PROVIDED BY INNOSYS CORP. ``AS IS'' AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN
NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
SUCH DAMAGE.
Note: these message formats are common to USA18, USA19, and USA28;
(for USA28X, see usa26msg.h)
Buffer formats for RX/TX data messages are not defined by
a structure, but are described here:
USB OUT (host -> USA28, transmit) messages contain a
REQUEST_ACK indicator (set to 0xff to request an ACK at the
completion of transmit; 0x00 otherwise), followed by data.
If the port is configured for parity, the data will be an
alternating string of parity and data bytes, so the message
format will be:
RQSTACK PAR DAT PAR DAT ...
so the maximum length is 63 bytes (1 + 62, or 31 data bytes);
always an odd number for the total message length.
If there is no parity, the format is simply:
RQSTACK DAT DAT DAT ...
with a total data length of 63.
USB IN (USA28 -> host, receive) messages contain data and parity
if parity is configred, thusly:
DAT PAR DAT PAR DAT PAR ...
for a total of 32 data bytes;
If parity is not configured, the format is:
DAT DAT DAT ...
for a total of 64 data bytes.
In the TX messages (USB OUT), the 0x01 bit of the PARity byte is
the parity bit. In the RX messages (USB IN), the PARity byte is
the content of the 8051's status register; the parity bit
(RX_PARITY_BIT) is the 0x04 bit.
revision history:
1999may06 add resetDataToggle to control message
2000mar21 add rs232invalid to status response message
2000apr04 add 230.4Kb definition to setBaudRate
2000apr13 add/remove loopbackMode switch
2000apr13 change definition of setBaudRate to cover 115.2Kb, too
2000jun01 add extended BSD-style copyright text
*/
#ifndef __USA28MSG__
#define __USA28MSG__
#ifndef STUBS
#include "datadefs.h"
#endif
typedef struct txAckMessage
{
u8 dummy;
} txAckMessage;
typedef struct portControlMessage
{
/*
there are four types of "commands" sent in the control message:
1. configuration changes which must be requested by setting
the corresponding "set" flag (and should only be requested
when necessary, to reduce overhead on the USA28):
*/
u8 setBaudRate, // 0=don't set, 1=baudLo/Hi, 2=115.2K, 3=230.4K
baudLo, // host does baud divisor calculation
baudHi; // baudHi is only used for first port (gives lower rates)
/*
2. configuration changes which are done every time (because it's
hardly more trouble to do them than to check whether to do them):
*/
u8 parity, // 1=use parity, 0=don't
ctsFlowControl, // 1=use CTS flow control, 0=don't
xonFlowControl, // 1=use XON/XOFF flow control, 0=don't
rts, // 1=on, 0=off
dtr; // 1=on, 0=off
/*
3. configuration data which is simply used as is (no overhead,
but must be correct in every host message).
*/
u8 forwardingLength, // forward when this number of chars available
forwardMs, // forward this many ms after last rx data
breakThreshold, // specified in ms, 1-255 (see note below)
xonChar, // specified in current character format
xoffChar; // specified in current character format
/*
4. commands which are flags only; these are processed in order
(so that, e.g., if both _txOn and _txOff flags are set, the
port ends in a TX_OFF state); any non-zero value is respected
*/
u8 _txOn, // enable transmitting (and continue if there's data)
_txOff, // stop transmitting
txFlush, // toss outbound data
txForceXoff, // pretend we've received XOFF
txBreak, // turn on break (leave on until txOn clears it)
rxOn, // turn on receiver
rxOff, // turn off receiver
rxFlush, // toss inbound data
rxForward, // forward all inbound data, NOW
returnStatus, // return current status n times (1 or 2)
resetDataToggle;// reset data toggle state to DATA0
} portControlMessage;
typedef struct portStatusMessage
{
u8 port, // 0=first, 1=second, 2=global (see below)
cts,
dsr, // (not used in all products)
dcd,
ri, // (not used in all products)
_txOff, // port has been disabled (by host)
_txXoff, // port is in XOFF state (either host or RX XOFF)
dataLost, // count of lost chars; wraps; not guaranteed exact
rxEnabled, // as configured by rxOn/rxOff 1=on, 0=off
rxBreak, // 1=we're in break state
rs232invalid, // 1=no valid signals on rs-232 inputs
controlResponse;// 1=a control messages has been processed
} portStatusMessage;
// bit defines in txState
#define TX_OFF 0x01 // requested by host txOff command
#define TX_XOFF 0x02 // either real, or simulated by host
typedef struct globalControlMessage
{
u8 sendGlobalStatus, // 2=request for two status responses
resetStatusToggle, // 1=reset global status toggle
resetStatusCount; // a cycling value
} globalControlMessage;
typedef struct globalStatusMessage
{
u8 port, // 3
sendGlobalStatus, // from request, decremented
resetStatusCount; // as in request
} globalStatusMessage;
typedef struct globalDebugMessage
{
u8 port, // 2
n, // typically a count/status byte
b; // typically a data byte
} globalDebugMessage;
// ie: the maximum length of an EZUSB endpoint buffer
#define MAX_DATA_LEN 64
// the parity bytes have only one significant bit
#define RX_PARITY_BIT 0x04
#define TX_PARITY_BIT 0x01
// update status approx. 60 times a second (16.6666 ms)
#define STATUS_UPDATE_INTERVAL 16
#endif
This diff is collapsed.
......@@ -124,12 +124,22 @@ extern struct usb_serial_device_type whiteheat_device;
extern struct usb_serial_device_type ftdi_sio_device;
extern struct usb_serial_device_type keyspan_pda_fake_device;
extern struct usb_serial_device_type keyspan_pda_device;
extern struct usb_serial_device_type keyspan_usa18x_pre_device;
extern struct usb_serial_device_type keyspan_usa19_pre_device;
extern struct usb_serial_device_type keyspan_usa19w_pre_device;
extern struct usb_serial_device_type keyspan_usa28_pre_device;
extern struct usb_serial_device_type keyspan_usa28x_pre_device;
extern struct usb_serial_device_type keyspan_usa18x_device;
extern struct usb_serial_device_type keyspan_usa19_device;
extern struct usb_serial_device_type keyspan_usa19w_device;
extern struct usb_serial_device_type keyspan_usa28_device;
extern struct usb_serial_device_type keyspan_usa28x_device;
extern struct usb_serial_device_type zyxel_omninet_device;
extern struct usb_serial_device_type digi_acceleport_device;
/* determine if we should include the EzUSB loader functions */
#if defined(CONFIG_USB_SERIAL_KEYSPAN_PDA) || defined(CONFIG_USB_SERIAL_WHITEHEAT)
#if defined(CONFIG_USB_SERIAL_KEYSPAN_PDA) || defined(CONFIG_USB_SERIAL_WHITEHEAT) || defined(CONFIG_USB_SERIAL_KEYSPAN)
#define USES_EZUSB_FUNCTIONS
extern int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *data, int length, __u8 bRequest);
extern int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit);
......
......@@ -310,6 +310,18 @@ static struct usb_serial_device_type *usb_serial_devices[] = {
#endif
#ifdef CONFIG_USB_SERIAL_DIGI_ACCELEPORT
&digi_acceleport_device,
#endif
#ifdef CONFIG_USB_SERIAL_KEYSPAN
&keyspan_usa18x_pre_device,
&keyspan_usa19_pre_device,
&keyspan_usa19w_pre_device,
&keyspan_usa28_pre_device,
&keyspan_usa28x_pre_device,
&keyspan_usa18x_device,
&keyspan_usa19_device,
&keyspan_usa19w_device,
&keyspan_usa28_device,
&keyspan_usa28x_device,
#endif
NULL
};
......
......@@ -1097,7 +1097,7 @@ static int elf_core_dump(long signr, struct pt_regs * regs, struct file * file)
psinfo.pr_state = i;
psinfo.pr_sname = (i < 0 || i > 5) ? '.' : "RSDZTD"[i];
psinfo.pr_zomb = psinfo.pr_sname == 'Z';
psinfo.pr_nice = current->priority-15;
psinfo.pr_nice = current->nice;
psinfo.pr_flag = current->flags;
psinfo.pr_uid = NEW_TO_OLD_UID(current->uid);
psinfo.pr_gid = NEW_TO_OLD_GID(current->gid);
......
......@@ -344,9 +344,8 @@ int proc_pid_stat(struct task_struct *task, char * buffer)
/* scale priority and nice values from timeslices to -20..20 */
/* to make it look like a "normal" Unix priority/nice value */
priority = task->counter;
priority = 20 - (priority * 10 + DEF_PRIORITY / 2) / DEF_PRIORITY;
nice = task->priority;
nice = 20 - (nice * 20 + DEF_PRIORITY / 2) / DEF_PRIORITY;
priority = 20 - (priority * 10 + DEF_COUNTER / 2) / DEF_COUNTER;
nice = task->nice;
read_lock(&tasklist_lock);
ppid = task->p_opptr->pid;
......
......@@ -49,7 +49,7 @@ struct pt_regs {
#define __SIGNAL_FRAMESIZE 64
#define instruction_pointer(regs) ((regs)->nip)
#define user_mode(regs) ((regs)->msr & MSR_PR)
#define user_mode(regs) (((regs)->msr & MSR_PR) != 0)
/*
* Offsets used by 'ptrace' system call interface.
......
......@@ -141,7 +141,7 @@ typedef struct user_regs_struct user_regs_struct;
typedef struct pt_regs pt_regs;
#ifdef __KERNEL__
#define user_mode(regs) ((regs)->psw.mask & PSW_PROBLEM_STATE)
#define user_mode(regs) (((regs)->psw.mask & PSW_PROBLEM_STATE) != 0)
#define instruction_pointer(regs) ((regs)->psw.addr)
struct thread_struct;
......
......@@ -248,7 +248,9 @@ struct signal_struct {
struct user_struct;
struct task_struct {
/* these are hardcoded - don't touch */
/*
* offsets of these are hardcoded elsewhere - touch with care
*/
volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */
unsigned long flags; /* per process flags, defined below */
int sigpending;
......@@ -258,20 +260,29 @@ struct task_struct {
*/
struct exec_domain *exec_domain;
volatile long need_resched;
unsigned long ptrace;
int lock_depth; /* Lock depth. We can context switch in and out of holding a syscall kernel lock... */
/* begin intel cache line */
int lock_depth; /* Lock depth */
/*
* offset 32 begins here on 32-bit platforms. We keep
* all fields in a single cacheline that are needed for
* the goodness() loop in schedule().
*/
long counter;
long priority;
long nice;
unsigned long policy;
/* memory management info */
struct mm_struct *mm, *active_mm;
struct mm_struct *mm;
int has_cpu, processor;
unsigned long cpus_allowed;
unsigned long ptrace;
/*
* (only the 'next' pointer fits into the cacheline, but
* that's just fine.)
*/
struct list_head run_list;
struct task_struct *next_task, *prev_task;
int last_processor;
struct mm_struct *active_mm;
/* task state */
struct linux_binfmt *binfmt;
......@@ -379,7 +390,9 @@ struct task_struct {
*/
#define _STK_LIM (8*1024*1024)
#define DEF_PRIORITY (20*HZ/100) /* 200 ms time slices */
#define DEF_COUNTER (10*HZ/100) /* 100 ms time slice */
#define MAX_COUNTER (20*HZ/100)
#define DEF_NICE (0)
/*
* INIT_TASK is used to set up the first task table, touch at
......@@ -393,8 +406,8 @@ struct task_struct {
addr_limit: KERNEL_DS, \
exec_domain: &default_exec_domain, \
lock_depth: -1, \
counter: DEF_PRIORITY, \
priority: DEF_PRIORITY, \
counter: DEF_COUNTER, \
nice: DEF_NICE, \
policy: SCHED_OTHER, \
mm: NULL, \
active_mm: &init_mm, \
......
......@@ -55,8 +55,8 @@ static void release(struct task_struct * p)
* was given away by the parent in the first place.)
*/
current->counter += p->counter;
if (current->counter >= current->priority*2)
current->counter = current->priority*2-1;
if (current->counter >= MAX_COUNTER)
current->counter = MAX_COUNTER;
free_task_struct(p);
} else {
printk("task releasing itself\n");
......
......@@ -42,6 +42,31 @@ unsigned securebits = SECUREBITS_DEFAULT; /* systemwide security settings */
extern void mem_use(void);
/*
* Scheduling quanta.
*
* NOTE! The unix "nice" value influences how long a process
* gets. The nice value ranges from -20 to +19, where a -20
* is a "high-priority" task, and a "+10" is a low-priority
* task.
*
* We want the time-slice to be around 50ms or so, so this
* calculation depends on the value of HZ.
*/
#if HZ < 200
#define LOG2_HZ 7
#elif HZ < 400
#define LOG2_HZ 8
#elif HZ < 800
#define LOG2_HZ 9
#elif HZ < 1600
#define LOG2_HZ 10
#else
#define LOG2_HZ 11
#endif
#define NICE_TO_TICKS(nice) ((((20)-(nice)) >> (LOG2_HZ-5))+1)
/*
* Init task must be ok at boot for the ix86 as we will check its signals
* via the SMP irq return path.
......@@ -121,7 +146,7 @@ static inline int goodness(struct task_struct * p, int this_cpu, struct mm_struc
* into account).
*/
if (p->policy != SCHED_OTHER) {
weight = 1000 + 2*DEF_PRIORITY + p->rt_priority;
weight = 1000 + p->rt_priority;
goto out;
}
......@@ -146,7 +171,7 @@ static inline int goodness(struct task_struct * p, int this_cpu, struct mm_struc
/* .. and a slight advantage to the current MM */
if (p->mm == this_mm || !p->mm)
weight += 1;
weight += p->priority;
weight += 20 - p->nice;
out:
return weight;
......@@ -622,7 +647,7 @@ asmlinkage void schedule(void)
spin_unlock_irq(&runqueue_lock);
read_lock(&tasklist_lock);
for_each_task(p)
p->counter = (p->counter >> 1) + p->priority;
p->counter = (p->counter >> 1) + NICE_TO_TICKS(p->nice);
read_unlock(&tasklist_lock);
spin_lock_irq(&runqueue_lock);
}
......@@ -648,7 +673,7 @@ asmlinkage void schedule(void)
move_rr_last:
if (!prev->counter) {
prev->counter = prev->priority;
prev->counter = NICE_TO_TICKS(prev->nice);
move_last_runqueue(prev);
}
goto move_rr_back;
......@@ -821,50 +846,28 @@ void scheduling_functions_end_here(void) { }
asmlinkage long sys_nice(int increment)
{
unsigned long newprio;
int increase = 0;
long newprio;
/*
* Setpriority might change our priority at the same moment.
* We don't have to worry. Conceptually one call occurs first
* and we have a single winner.
*/
newprio = increment;
if (increment < 0) {
if (!capable(CAP_SYS_NICE))
return -EPERM;
newprio = -increment;
increase = 1;
if (increment < -40)
increment = -40;
}
if (newprio > 40)
newprio = 40;
/*
* do a "normalization" of the priority (traditionally
* Unix nice values are -20 to 20; Linux doesn't really
* use that kind of thing, but uses the length of the
* timeslice instead (default 200 ms). The rounding is
* why we want to avoid negative values.
*/
newprio = (newprio * DEF_PRIORITY + 10)/20;
increment = newprio;
if (increase)
increment = -increment;
/*
* Current->priority can change between this point
* and the assignment. We are assigning not doing add/subs
* so thats ok. Conceptually a process might just instantaneously
* read the value we stomp over. I don't think that is an issue
* unless posix makes it one. If so we can loop on changes
* to current->priority.
*/
newprio = current->priority - increment;
if ((signed) newprio < 1)
newprio = DEF_PRIORITY/20;
if (newprio > DEF_PRIORITY*2)
newprio = DEF_PRIORITY*2;
current->priority = newprio;
if (increment > 40)
increment = 40;
newprio = current->nice + increment;
if (newprio < -20)
newprio = -20;
if (newprio > 19)
newprio = 19;
current->nice = newprio;
return 0;
}
......@@ -1066,7 +1069,7 @@ asmlinkage long sys_sched_rr_get_interval(pid_t pid, struct timespec *interval)
read_lock(&tasklist_lock);
p = find_process_by_pid(pid);
if (p)
jiffies_to_timespec(p->policy & SCHED_FIFO ? 0 : p->priority,
jiffies_to_timespec(p->policy & SCHED_FIFO ? 0 : NICE_TO_TICKS(p->nice),
&t);
read_unlock(&tasklist_lock);
if (p)
......
......@@ -199,26 +199,17 @@ static int proc_sel(struct task_struct *p, int which, int who)
asmlinkage long sys_setpriority(int which, int who, int niceval)
{
struct task_struct *p;
unsigned int priority;
int error;
if (which > 2 || which < 0)
return -EINVAL;
/* normalize: avoid signed division (rounding problems) */
error = ESRCH;
priority = niceval;
if (niceval < 0)
priority = -niceval;
if (priority > 20)
priority = 20;
priority = (priority * DEF_PRIORITY + 10) / 20 + DEF_PRIORITY;
if (niceval >= 0) {
priority = 2*DEF_PRIORITY - priority;
if (!priority)
priority = 1;
}
error = -ESRCH;
if (niceval < -20)
niceval = -20;
if (niceval > 19)
niceval = 19;
read_lock(&tasklist_lock);
for_each_task(p) {
......@@ -226,47 +217,46 @@ asmlinkage long sys_setpriority(int which, int who, int niceval)
continue;
if (p->uid != current->euid &&
p->uid != current->uid && !capable(CAP_SYS_NICE)) {
error = EPERM;
error = -EPERM;
continue;
}
if (error == ESRCH)
if (error == -ESRCH)
error = 0;
if (priority > p->priority && !capable(CAP_SYS_NICE))
error = EACCES;
if (niceval < p->nice && !capable(CAP_SYS_NICE))
error = -EACCES;
else
p->priority = priority;
p->nice = niceval;
}
read_unlock(&tasklist_lock);
return -error;
return error;
}
/*
* Ugh. To avoid negative return values, "getpriority()" will
* not return the normal nice-value, but a value that has been
* offset by 20 (ie it returns 0..40 instead of -20..20)
* offset by 20 (ie it returns 0..39 instead of -20..19)
*/
asmlinkage long sys_getpriority(int which, int who)
{
struct task_struct *p;
long max_prio = -ESRCH;
long retval = -ESRCH;
if (which > 2 || which < 0)
return -EINVAL;
read_lock(&tasklist_lock);
for_each_task (p) {
unsigned niceval;
if (!proc_sel(p, which, who))
continue;
if (p->priority > max_prio)
max_prio = p->priority;
niceval = p->nice + 20;
if (niceval < (unsigned)retval)
retval = niceval;
}
read_unlock(&tasklist_lock);
/* scale the priority from timeslice to 0..40 */
if (max_prio > 0)
max_prio = (max_prio * 20 + DEF_PRIORITY/2) / DEF_PRIORITY;
return max_prio;
return retval;
}
......
......@@ -629,7 +629,8 @@ static inline void calc_load(unsigned long ticks)
}
}
volatile unsigned long lost_ticks;
/* jiffies at the most recent update of wall time */
unsigned long wall_jiffies;
/*
* This spinlock protect us from races in SMP while playing with xtime. -arca
......@@ -647,14 +648,13 @@ static inline void update_times(void)
*/
write_lock_irq(&xtime_lock);
ticks = lost_ticks;
lost_ticks = 0;
ticks = jiffies - wall_jiffies;
if (ticks) {
calc_load(ticks);
wall_jiffies += ticks;
update_wall_time(ticks);
}
write_unlock_irq(&xtime_lock);
calc_load(ticks);
}
void timer_bh(void)
......@@ -666,7 +666,6 @@ void timer_bh(void)
void do_timer(struct pt_regs *regs)
{
(*(unsigned long *)&jiffies)++;
lost_ticks++;
update_process_times(user_mode(regs));
mark_bh(TIMER_BH);
if (tq_timer)
......
......@@ -256,7 +256,7 @@ char * strsep(char **s, const char * ct)
#endif
#ifndef __HAVE_ARCH_MEMSET
void * memset(void * s,char c,size_t count)
void * memset(void * s,int c,size_t count)
{
char *xs = (char *) s;
......
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