Commit 496d46a0 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.1.68pre1

parent c5a4ebcd
......@@ -190,6 +190,19 @@ parallel port may no longer be where you expect it; for example, LPT1
/dev/lp0 with the new Plug-and-Play driver. If printing breaks with
the new driver, try checking your lpd configuration.
pppd
====
This kernel version needs a minor bugfix to pppd. See
Documentation/networking/ppp.txt for more information.
Syncookies
==========
When you build your kernel with Syncookie support (CONFIG_SYN_COOKIES)
the syncookie code still defaults to off (unlike the 2.0.30+ behaviour).
You have to explicitely enable it by add a line like
echo 1 >/proc/sys/net/ipv4/tcp_syncookies
to one of your startup scripts (e.g. /etc/rc.d/rc.local on a redhat system)
Bash
====
......
......@@ -2781,18 +2781,51 @@ CONFIG_SCC
running kernel whenever you want), say M here and read
Documentation/modules.txt. The module will be called scc.o.
BAYCOM ser12 and par96 driver for AX.25
CONFIG_BAYCOM
This is an experimental driver for Baycom style simple amateur radio
modems that connect to either a serial interface or a parallel
interface. The driver supports the ser12 and par96 designs. To
configure the driver, use the sethdlc utility available in the
standard ax25 utilities package. For information on the modems, see
BAYCOM picpar and par96 driver for AX.25
CONFIG_BAYCOM_PAR
This is a driver for Baycom style simple amateur radio
modems that connect to a parallel interface. The driver
supports the picpar and par96 designs. To configure the
driver, use the sethdlc utility available in the standard
ax25 utilities package. For information on the modems, see
http://www.baycom.de and Documentation/networking/baycom.txt. If you
want to compile this driver as a module ( = code which can be
inserted in and removed from the running kernel whenever you want),
say M here and read Documentation/modules.txt. This is
recommended. The module will be called baycom.o.
recommended. The module will be called baycom_par.o.
BAYCOM ser12 full duplex driver for AX.25
CONFIG_BAYCOM_SER_FDX
This is one of two drivers for Baycom style simple amateur radio
modems that connect to a serial interface. The driver supports
the ser12 design in full duplex mode. In addition, it allows the
baudrate to be set between 300 and 4800 baud (however not all modems
support all baudrates). This is the preferred driver. baycom_ser_hdx.o
is the old driver and still provided in case this driver does not work
with your serial interface chip. To configure the driver, use the
sethdlc utility available in the standard ax25 utilities package.
For information on the modems, see http://www.baycom.de and
Documentation/networking/baycom.txt. If you want to compile
this driver as a module ( = code which can be inserted in
and removed from the running kernel whenever you want),
say M here and read Documentation/modules.txt. This is
recommended. The module will be called baycom_ser_fdx.o.
BAYCOM ser12 half duplex driver for AX.25
CONFIG_BAYCOM_SER_HDX
This is one of two drivers for Baycom style simple amateur radio
modems that connect to a serial interface. The driver supports
the ser12 design in full duplex mode. This is the old driver.
It is still provided in case your serial interface chip does
not work with the full duplex driver. This driver is depreciated.
To configure the driver, use the sethdlc utility available
in the standard ax25 utilities package. For information
on the modems, see http://www.baycom.de and
Documentation/networking/baycom.txt. If you want to compile
this driver as a module ( = code which can be inserted in
and removed from the running kernel whenever you want),
say M here and read Documentation/modules.txt. This is
recommended. The module will be called baycom_ser_hdx.o.
Soundcard modem driver for AX.25
CONFIG_SOUNDMODEM
......@@ -5917,9 +5950,9 @@ CONFIG_MAGIC_SYSRQ
flush the disks, reboot the system immediately or dump some status
information). This is accomplished by pressing various keys while
holding SysRq (Alt+PrintScreen). As you are expected to be a kernel
hacker to use this, the simple rule about learning what do the keys
hacker to use this, the simple rule about learning what the keys
mean is "Use the source, Luke!" -- read drivers/char/sysrq.c.
Don't say Y unless you really know what does this hack do.
Don't say Y unless you really know what this hack does.
ISDN subsystem
CONFIG_ISDN
......
*NEWSFLASH*
This kernel release needs a minor bug fix for pppd to run properly with
the new routing code. When your pppd doesn't work apply the following
patch to pppd-2.2.0f or install updated RPMs.
Updated RPMs for libc5 machines (build on RedHat 4.0):
ftp://ftp.firstfloor.org/pub/ak/ppp-2.2.0f-4.src.rpm
ftp://ftp.firstfloor.org/pub/ak/ppp-2.2.0f-4.i386.rpm
Patch:
--- ppp-2.2.0f/pppd/sys-linux.c-o Wed Sep 17 00:23:01 1997
+++ ppp-2.2.0f/pppd/sys-linux.c Wed Sep 17 00:23:11 1997
@@ -927,8 +927,11 @@
if (ioctl(sockfd, SIOCADDRT, &rt) < 0)
{
+/* The new linux routing code doesn't like routes on down devices. */
+#if 0
syslog (LOG_ERR, "ioctl(SIOCADDRT) device route: %m");
return (0);
+#endif
}
return 1;
}
-Andi Kleen
--------------------------------------------------------------------
The PPP support for this kernel requires the 2.2.0 version of the
pppd daemon. You will find the current version of the daemon on
sunsite.unc.edu in the /pub/Linux/system/Network/serial directory.
......
......@@ -4,14 +4,18 @@ full package from:
Internet:
=========
1. db0bm.automation.fh-aachen.de/incoming/dl1bke/z8530drv-utils-3.0.tar.gz
1. ftp://db0bm.automation.fh-aachen.de/incoming/z8530drv/z8530drv-utils-3.0.tar.gz
2. ftp.ucsd.edu:/hamradio/packet/tcpip/incoming/z8530drv-utils-3.0.tar.gz
If you can't find it there, try .../tcpip/linux/z8530drv-utils-3.0.tar.gz
2. ftp://ftp.pspt.fi/pub/ham/linux/ax25/z8530drv-utils-3.0.tar.gz
and various mirrors (i.e. nic.switch.ch)
3. ftp://ftp.ucsd.edu/hamradio/packet/tcpip/incoming/z8530drv-utils-3.0.tar.gz
If you can't find it there, try .../tcpip/linux/z8530drv-utils-3.0.tar.gz
Please note that the information in this document may be hopelessly outdated.
A new version of the documentation, along with links to other important
Linux Kernel AX.25 documentation and programs, is available on
http://www.rat.de/jr
-----------------------------------------------------------------------------
......@@ -19,7 +23,7 @@ Please note that the information in this document may be hopelessly outdated.
********************************************************************
(c) 1993,1996 by Joerg Reuter DL1BKE <jreuter@lykos.oche.de>
(c) 1993,1997 by Joerg Reuter DL1BKE <jreuter@poboxes.com>
portions (c) 1993 Guido ten Dolle PE1NNZ
......@@ -134,7 +138,7 @@ just change
to a higher value.
Example for the BayCom USCC:
Example for the BAYCOM USCC:
----------------------------
chip 1
......@@ -228,7 +232,7 @@ will print a skeleton z8530drv.conf for the OptoSCC to stdout.
gencfg 2 0x300 2 4 5 -4 0 7 4915200 0x10
does the same for the BayCom USCC card. I my opinion it is much easier
does the same for the BAYCOM USCC card. I my opinion it is much easier
to edit scc_config.h...
......@@ -332,7 +336,7 @@ You can now axattach a pseudo-TTY:
and start your NOS and attach /dev/ptys0 there. The problem is that
NOS is reachable only via digipeating through the kernel AX.25
(disasterous on a DAMA controlled channel). To solve this problem,
(disastrous on a DAMA controlled channel). To solve this problem,
configure "rxecho" to echo the incoming frames from "9k6" to "axlink"
and outgoing frames from "axlink" to "9k6" and start:
......@@ -605,8 +609,9 @@ instead to the data port, but this won't work with the ESCC chips.
A very common problem is that the PTT locks until the maxkeyup timer
expires, although interrupts and clock source are correct. In most
cases #define SCC_DELAY solves the problems. For more hints read
the (pseudo) FAQ and the documentation coming with z8530drv-utils.
cases compiling the driver with CONFIG_SCC_DELAY (set with
make config) solves the problems. For more hints read the (pseudo) FAQ
and the documentation coming with z8530drv-utils.
I got reports that the driver has problems on some 386-based systems.
(i.e. Amstrad) Those systems have a bogus AT bus timing which will
......@@ -624,7 +629,7 @@ Delayed processing of received data: This depends on
- a high load of the machine --- running X, Xmorph, XV and Povray,
while compiling the kernel... hmm ... even with 32 MB RAM ... ;-)
Or running a named for the whole .ampr.org. domain on an 8 MB
Or running a named for the whole .ampr.org domain on an 8 MB
box...
- using information from rxecho or kissbridge.
......@@ -651,4 +656,5 @@ in the Linux standard distribution and their support.
Joerg Reuter ampr-net: dl1bke@db0pra.ampr.org
AX-25 : DL1BKE @ DB0ACH.#NRW.DEU.EU
Internet: jreuter@lykos.oche.de
Internet: jreuter@poboxes.com
WWW : http://www.rat.de/jr/
VERSION = 2
PATCHLEVEL = 1
SUBLEVEL = 67
SUBLEVEL = 68
ARCH := $(shell uname -m | sed -e s/i.86/i386/ -e s/sun4u/sparc64/)
......
......@@ -94,7 +94,7 @@ EXPORT_SYMBOL(csum_partial_copy);
* The following are specially called from the uaccess assembly stubs.
*/
EXPORT_SYMBOL_NOVERS(__copy_user);
EXPORT_SYMBOL_NOVERS(__clear_user);
EXPORT_SYMBOL_NOVERS(__do_clear_user);
EXPORT_SYMBOL(__strncpy_from_user);
EXPORT_SYMBOL(__strlen_user);
......
This diff is collapsed.
......@@ -574,7 +574,7 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data,
(return from) syscall */
case PTRACE_CONT: { /* restart after signal. */
ret = -EIO;
if ((unsigned long) data > NSIG)
if ((unsigned long) data > _NSIG)
goto out;
if (request == PTRACE_SYSCALL)
child->flags |= PF_TRACESYS;
......@@ -606,7 +606,7 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data,
case PTRACE_SINGLESTEP: { /* execute single instruction. */
ret = -EIO;
if ((unsigned long) data > NSIG)
if ((unsigned long) data > _NSIG)
goto out;
child->debugreg[4] = -1; /* mark single-stepping */
child->flags &= ~PF_TRACESYS;
......@@ -619,7 +619,7 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data,
case PTRACE_DETACH: { /* detach a process that was attached. */
ret = -EIO;
if ((unsigned long) data > NSIG)
if ((unsigned long) data > _NSIG)
goto out;
child->flags &= ~(PF_PTRACED|PF_TRACESYS);
wake_up_process(child);
......@@ -627,7 +627,7 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data,
REMOVE_LINKS(child);
child->p_pptr = child->p_opptr;
SET_LINKS(child);
/* make sure single-step breakpoint is gone. */
/* make sure single-step breakpoint is gone. */
ptrace_cancel_bpt(child);
ret = 0;
goto out;
......@@ -644,22 +644,20 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data,
asmlinkage void syscall_trace(void)
{
lock_kernel();
if ((current->flags & (PF_PTRACED|PF_TRACESYS))
!= (PF_PTRACED|PF_TRACESYS))
goto out;
return;
current->exit_code = SIGTRAP;
current->state = TASK_STOPPED;
notify_parent(current, SIGCHLD);
schedule();
/*
* this isn't the same as continuing with a signal, but it will do
* This isn't the same as continuing with a signal, but it will do
* for normal use. strace only continues with a signal if the
* stopping signal is not SIGTRAP. -brl
*/
if (current->exit_code)
current->signal |= (1 << (current->exit_code - 1));
current->exit_code = 0;
out:
unlock_kernel();
if (current->exit_code) {
send_sig(current->exit_code, current, 1);
current->exit_code = 0;
}
}
This diff is collapsed.
......@@ -17,17 +17,18 @@
* (round system clock to nearest tick instead of truncating)
* fixed algorithm in time_init for getting time from CMOS clock
*/
#include <linux/config.h>
#include <linux/errno.h>
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/param.h>
#include <linux/string.h>
#include <linux/mm.h>
#include <linux/delay.h>
#include <asm/uaccess.h>
#include <asm/io.h>
#include <asm/hwrpb.h>
#include <asm/delay.h>
#include <linux/mc146818rtc.h>
#include <linux/timex.h>
......@@ -52,16 +53,18 @@ static int set_rtc_mmss(unsigned long);
/* lump static variables together for more efficient access: */
static struct {
__u32 last_time; /* cycle counter last time it got invoked */
unsigned long scaled_ticks_per_cycle; /* ticks/cycle * 2^48 */
long last_rtc_update; /* last time the cmos clock got updated */
/* cycle counter last time it got invoked */
__u32 last_time;
/* ticks/cycle * 2^48 */
unsigned long scaled_ticks_per_cycle;
/* last time the cmos clock got updated */
time_t last_rtc_update;
} state;
static inline __u32 rpcc(void)
{
__u32 result;
asm volatile ("rpcc %0" : "r="(result));
return result;
}
......@@ -73,37 +76,46 @@ static inline __u32 rpcc(void)
*/
void timer_interrupt(int irq, void *dev, struct pt_regs * regs)
{
__u32 delta, now;
int i, nticks;
const unsigned long half = 1UL << (FIX_SHIFT - 1);
const unsigned long mask = (1UL << (FIX_SHIFT + 1)) - 1;
unsigned long delta;
__u32 now;
long nticks;
/*
* Estimate how many ticks have passed since the last update.
* Round the result, .5 to even. When we loose ticks due to
* say using IDE, the clock has been seen to run up to 15% slow
* if we truncate.
*/
now = rpcc();
delta = now - state.last_time;
state.last_time = now;
if(hwrpb->cycle_freq) {
nticks = (delta * state.scaled_ticks_per_cycle) >> (FIX_SHIFT-1);
nticks = (nticks+1) >> 1;
}
else nticks=1; /* No way to estimate lost ticks if we don't know
the cycle frequency. */
for (i = 0; i < nticks; ++i) {
delta = delta * state.scaled_ticks_per_cycle;
if ((delta & mask) != half)
delta += half;
nticks = delta >> FIX_SHIFT;
do {
do_timer(regs);
}
} while (--nticks > 0);
/*
* If we have an externally synchronized Linux clock, then update
* CMOS clock accordingly every ~11 minutes. Set_rtc_mmss() has to be
* called as close as possible to 500 ms before the new second starts.
*/
if (time_state != TIME_BAD && xtime.tv_sec > state.last_rtc_update + 660 &&
xtime.tv_usec > 500000 - (tick >> 1) &&
xtime.tv_usec < 500000 + (tick >> 1))
if (set_rtc_mmss(xtime.tv_sec) == 0)
state.last_rtc_update = xtime.tv_sec;
else
state.last_rtc_update = xtime.tv_sec - 600; /* do it again in 60 s */
if (time_state != TIME_BAD
&& xtime.tv_sec > state.last_rtc_update + 660
&& xtime.tv_usec >= 500000 - (tick >> 1)
&& xtime.tv_usec <= 500000 + (tick >> 1)) {
int tmp = set_rtc_mmss(xtime.tv_sec);
state.last_rtc_update = xtime.tv_sec - (tmp ? 600 : 0);
}
}
/* Converts Gregorian date to seconds since 1970-01-01 00:00:00.
/*
* Converts Gregorian date to seconds since 1970-01-01 00:00:00.
* Assumes input in normal date format, i.e. 1980-12-31 23:59:59
* => year=1980, mon=12, day=31, hour=23, min=59, sec=59.
*
......@@ -140,25 +152,40 @@ void time_init(void)
unsigned char save_control;
#endif
void (*irq_handler)(int, void *, struct pt_regs *);
unsigned int year, mon, day, hour, min, sec;
unsigned int year, mon, day, hour, min, sec, cc1, cc2;
/* The Linux interpretation of the CMOS clock register contents:
/*
* The Linux interpretation of the CMOS clock register contents:
* When the Update-In-Progress (UIP) flag goes from 1 to 0, the
* RTC registers show the second which has precisely just started.
* Let's hope other operating systems interpret the RTC the same way.
*/
/* read RTC exactly on falling edge of update flag */
/* Wait for rise.... (may take up to 1 second) */
do {} while(!(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP));
/* Jay Estabook <jestabro@amt.tay1.dec.com>:
* Wait for the Update Done Interrupt bit (0x10) in reg C (12) to be set,
* which (hopefully) indicates that the update is really done.
*/
do {} while(!CMOS_READ(RTC_REG_C) & RTC_UIP);
do { } while (!(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP));
do { } while (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP);
/* Read cycle counter exactly on falling edge of update flag */
cc1 = rpcc();
/* If our cycle frequency isn't valid, go another round and give
a guess at what it should be. */
if (hwrpb->cycle_freq == 0) {
printk("HWPRB cycle frequency bogus. Estimating... ");
do { } while (!(CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP));
do { } while (CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP);
cc2 = rpcc();
hwrpb->cycle_freq = cc2 - cc1;
cc1 = cc2;
printk("%lu Hz\n", hwrpb->cycle_freq);
}
/* From John Bowman <bowman@math.ualberta.ca>: allow the values
to settle, as the Update-In-Progress bit going low isn't good
enough on some hardware. 2ms is our guess; we havn't found
bogomips yet, but this is close on a 500Mhz box. */
__delay(1000000);
sec = CMOS_READ(RTC_SECONDS);
min = CMOS_READ(RTC_MINUTES);
hour = CMOS_READ(RTC_HOURS);
......@@ -167,14 +194,14 @@ void time_init(void)
year = CMOS_READ(RTC_YEAR);
if (!(CMOS_READ(RTC_CONTROL) & RTC_DM_BINARY) || RTC_ALWAYS_BCD)
{
BCD_TO_BIN(sec);
BCD_TO_BIN(min);
BCD_TO_BIN(hour);
BCD_TO_BIN(day);
BCD_TO_BIN(mon);
BCD_TO_BIN(year);
}
{
BCD_TO_BIN(sec);
BCD_TO_BIN(min);
BCD_TO_BIN(hour);
BCD_TO_BIN(day);
BCD_TO_BIN(mon);
BCD_TO_BIN(year);
}
#ifdef ALPHA_PRE_V1_2_SRM_CONSOLE
/*
* The meaning of life, the universe, and everything. Plus
......@@ -192,9 +219,10 @@ void time_init(void)
extern void __you_loose (void);
__you_loose();
}
state.last_time = rpcc();
if(hwrpb->cycle_freq)
state.scaled_ticks_per_cycle = ((unsigned long) HZ << FIX_SHIFT) / hwrpb->cycle_freq;
state.last_time = cc1;
state.scaled_ticks_per_cycle
= ((unsigned long) HZ << FIX_SHIFT) / hwrpb->cycle_freq;
state.last_rtc_update = 0;
#ifdef CONFIG_RTC
......@@ -210,22 +238,52 @@ void time_init(void)
/* setup timer */
irq_handler = timer_interrupt;
if (request_irq(TIMER_IRQ, irq_handler, 0, "timer", NULL))
panic("Could not allocate timer IRQ!");
panic("Could not allocate timer IRQ!");
}
/*
* We could get better timer accuracy by using the alpha
* time counters or something. Now this is limited to
* the HZ clock frequency.
* Use the cycle counter to estimate an displacement from the last time
* tick. Unfortunately the Alpha designers made only the low 32-bits of
* the cycle counter active, so we overflow on 8.2 seconds on a 500MHz
* part. So we can't do the "find absolute time in terms of cycles" thing
* that the other ports do.
*/
void do_gettimeofday(struct timeval *tv)
{
unsigned long flags;
unsigned long flags, now, delta_cycles, delta_usec;
unsigned long sec, usec;
save_flags(flags);
cli();
*tv = xtime;
now = rpcc();
save_and_cli(flags);
sec = xtime.tv_sec;
usec = xtime.tv_usec;
delta_cycles = now - state.last_time;
restore_flags(flags);
/*
* usec = cycles * ticks_per_cycle * 2**48 * 1e6 / (2**48 * ticks)
* = cycles * (s_t_p_c) * 1e6 / (2**48 * ticks)
* = cycles * (s_t_p_c) * 15625 / (2**42 * ticks)
*
* which, given a 600MHz cycle and a 1024Hz tick, has a
* dynamic range of about 1.7e17, which is less than the
* 1.8e19 in an unsigned long, so we are safe from overflow.
*
* Round, but with .5 up always, since .5 to even is harder
* with no clear gain.
*/
delta_usec = delta_cycles * state.scaled_ticks_per_cycle * 15625;
delta_usec = ((delta_usec / ((1UL << (FIX_SHIFT-6)) * HZ)) + 1) / 2;
usec += delta_usec;
if (usec >= 1000000) {
sec += 1;
usec -= 1000000;
}
tv->tv_sec = sec;
tv->tv_usec = usec;
}
void do_settimeofday(struct timeval *tv)
......@@ -252,10 +310,12 @@ static int set_rtc_mmss(unsigned long nowtime)
int real_seconds, real_minutes, cmos_minutes;
unsigned char save_control, save_freq_select;
save_control = CMOS_READ(RTC_CONTROL); /* tell the clock it's being set */
/* Tell the clock it's being set */
save_control = CMOS_READ(RTC_CONTROL);
CMOS_WRITE((save_control|RTC_SET), RTC_CONTROL);
save_freq_select = CMOS_READ(RTC_FREQ_SELECT); /* stop and reset prescaler */
/* Stop and reset prescaler */
save_freq_select = CMOS_READ(RTC_FREQ_SELECT);
CMOS_WRITE((save_freq_select|RTC_DIV_RESET2), RTC_FREQ_SELECT);
cmos_minutes = CMOS_READ(RTC_MINUTES);
......@@ -270,8 +330,10 @@ static int set_rtc_mmss(unsigned long nowtime)
*/
real_seconds = nowtime % 60;
real_minutes = nowtime / 60;
if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1)
real_minutes += 30; /* correct for half hour time zone */
if (((abs(real_minutes - cmos_minutes) + 15)/30) & 1) {
/* correct for half hour time zone */
real_minutes += 30;
}
real_minutes %= 60;
if (abs(real_minutes - cmos_minutes) < 30) {
......
......@@ -12,6 +12,7 @@
#include <linux/mm.h>
#include <linux/sched.h>
#include <linux/tty.h>
#include <linux/delay.h>
#include <asm/gentrap.h>
#include <asm/uaccess.h>
......@@ -20,45 +21,41 @@
#include <asm/smp_lock.h>
void die_if_kernel(char * str, struct pt_regs * regs, long err,
unsigned long *r9_15)
static void dik_show_regs(struct pt_regs *regs, unsigned long *r9_15)
{
long i;
unsigned long ra;
unsigned int * pc;
unsigned long * sp;
if (regs->ps & 8)
return;
printk("%s(%d): %s %ld\n", current->comm, current->pid, str, err);
sp = (unsigned long *) (regs+1);
__get_user(ra, (unsigned long *)sp);
printk("pc = [<%016lx>] ps = %04lx\n", regs->pc, regs->ps);
printk("rp = [<%016lx>] ra = [<%016lx>]\n", regs->r26, ra);
printk("r0 = %016lx r1 = %016lx\n", regs->r0, regs->r1);
printk("r2 = %016lx r3 = %016lx\n", regs->r2, regs->r3);
printk("r4 = %016lx r5 = %016lx\n", regs->r4, regs->r5);
printk("r6 = %016lx r7 = %016lx\n", regs->r6, regs->r7);
printk("pc = [<%016lx>] ra = [<%016lx>] ps = %04lx\n",
regs->pc, regs->r26, regs->ps);
printk("r0 = %016lx r1 = %016lx r2 = %016lx\n",
regs->r0, regs->r1, regs->r2);
printk("r3 = %016lx r4 = %016lx r5 = %016lx\n",
regs->r3, regs->r4, regs->r5);
printk("r6 = %016lx r7 = %016lx r8 = %016lx\n",
regs->r6, regs->r7, regs->r8);
if (r9_15) {
printk("r8 = %016lx r9 = %016lx\n", regs->r8, r9_15[9]);
printk("r10= %016lx r11= %016lx\n", r9_15[10], r9_15[11]);
printk("r12= %016lx r13= %016lx\n", r9_15[12], r9_15[13]);
printk("r14= %016lx r15= %016lx\n", r9_15[14], r9_15[15]);
} else {
printk("r8 = %016lx\n", regs->r8);
printk("r9 = %016lx r10= %016lx r11= %016lx\n",
r9_15[9], r9_15[10], r9_15[11]);
printk("r12= %016lx r13= %016lx r14= %016lx\n",
r9_15[12], r9_15[13], r9_15[14]);
printk("r15= %016lx\n", r9_15[15]);
}
printk("r16= %016lx r17= %016lx\n", regs->r16, regs->r17);
printk("r18= %016lx r19= %016lx\n", regs->r18, regs->r19);
printk("r20= %016lx r21= %016lx\n", regs->r20, regs->r21);
printk("r22= %016lx r23= %016lx\n", regs->r22, regs->r23);
printk("r24= %016lx r25= %016lx\n", regs->r24, regs->r25);
printk("r27= %016lx r28= %016lx\n", regs->r27, regs->r28);
printk("gp = %016lx sp = %p\n", regs->gp, sp);
printk("r16= %016lx r17= %016lx r18= %016lx\n",
regs->r16, regs->r17, regs->r18);
printk("r19= %016lx r20= %016lx r21= %016lx\n",
regs->r19, regs->r20, regs->r21);
printk("r22= %016lx r23= %016lx r24= %016lx\n",
regs->r22, regs->r23, regs->r24);
printk("r25= %016lx r27= %016lx r28= %016lx\n",
regs->r25, regs->r27, regs->r28);
printk("gp = %016lx sp = %p\n", regs->gp, regs+1);
}
static void dik_show_code(unsigned int *pc)
{
long i;
printk("Code:");
pc = (unsigned int *) regs->pc;
for (i = -3; i < 6; i++) {
unsigned int insn;
if (__get_user(insn, pc+i))
......@@ -66,6 +63,11 @@ void die_if_kernel(char * str, struct pt_regs * regs, long err,
printk("%c%08x%c",i?' ':'<',insn,i?' ':'>');
}
printk("\n");
}
static void dik_show_trace(unsigned long *sp)
{
long i = 0;
printk("Trace:");
while (0x1ff8 & (unsigned long) sp) {
extern unsigned long _stext, _etext;
......@@ -76,9 +78,30 @@ void die_if_kernel(char * str, struct pt_regs * regs, long err,
if (tmp >= (unsigned long) &_etext)
continue;
printk(" [<%lx>]", tmp);
if (++i > 40) {
printk(" ...");
break;
}
}
printk("\n");
}
void die_if_kernel(char * str, struct pt_regs *regs, long err,
unsigned long *r9_15)
{
if (regs->ps & 8)
return;
printk("%s(%d): %s %ld\n", current->comm, current->pid, str, err);
dik_show_regs(regs, r9_15);
dik_show_code((unsigned int *)regs->pc);
dik_show_trace((unsigned long *)(regs+1));
if (current->tss.flags & (1UL << 63)) {
printk("die_if_kernel recursion detected.\n");
sti();
while (1);
}
current->tss.flags |= (1UL << 63);
do_exit(SIGSEGV);
}
......@@ -397,8 +420,6 @@ asmlinkage void do_entUna(void * va, unsigned long opcode, unsigned long reg,
printk("Bad unaligned kernel access at %016lx: %p %lx %ld\n",
pc, va, opcode, reg);
do_exit(SIGSEGV);
unlock_kernel();
return;
got_exception:
/* Ok, we caught the exception, but we don't want it. Is there
......@@ -416,13 +437,48 @@ asmlinkage void do_entUna(void * va, unsigned long opcode, unsigned long reg,
return;
}
/* Yikes! No one to forward the exception to. */
/*
* Yikes! No one to forward the exception to.
* Since the registers are in a weird format, dump them ourselves.
*/
lock_kernel();
printk("%s: unhandled unaligned exception at pc=%lx ra=%lx"
" (bad address = %p)\n", current->comm,
pc, una_reg(26), va);
printk("%s(%d): unhandled unaligned exception\n",
current->comm, current->pid);
printk("pc = [<%016lx>] ra = [<%016lx>] ps = %04lx\n",
pc, una_reg(26), regs.ps);
printk("r0 = %016lx r1 = %016lx r2 = %016lx\n",
una_reg(0), una_reg(1), una_reg(2));
printk("r3 = %016lx r4 = %016lx r5 = %016lx\n",
una_reg(3), una_reg(4), una_reg(5));
printk("r6 = %016lx r7 = %016lx r8 = %016lx\n",
una_reg(6), una_reg(7), una_reg(8));
printk("r9 = %016lx r10= %016lx r11= %016lx\n",
una_reg(9), una_reg(10), una_reg(11));
printk("r12= %016lx r13= %016lx r14= %016lx\n",
una_reg(12), una_reg(13), una_reg(14));
printk("r15= %016lx\n", una_reg(15));
printk("r16= %016lx r17= %016lx r18= %016lx\n",
una_reg(16), una_reg(17), una_reg(18));
printk("r19= %016lx r20= %016lx r21= %016lx\n",
una_reg(19), una_reg(20), una_reg(21));
printk("r22= %016lx r23= %016lx r24= %016lx\n",
una_reg(22), una_reg(23), una_reg(24));
printk("r25= %016lx r27= %016lx r28= %016lx\n",
una_reg(25), una_reg(27), una_reg(28));
printk("gp = %016lx sp = %p\n", regs.gp, &regs+1);
dik_show_code((unsigned int *)pc);
dik_show_trace((unsigned long *)(&regs+1));
if (current->tss.flags & (1UL << 63)) {
printk("die_if_kernel recursion detected.\n");
sti();
while (1);
}
current->tss.flags |= (1UL << 63);
do_exit(SIGSEGV);
unlock_kernel();
}
/*
......@@ -800,26 +856,17 @@ asmlinkage void do_entUnaUser(void * va, unsigned long opcode,
}
/*
* DEC means people to use the "retsys" instruction for return from
* a system call, but they are clearly misguided about this. We use
* "rti" in all cases, and fill in the stack with the return values.
* That should make signal handling etc much cleaner.
*
* Even more horribly, DEC doesn't allow system calls from kernel mode.
* "Security" features letting the user do something the kernel can't
* are a thinko. DEC palcode is strange. The PAL-code designers probably
* got terminally tainted by VMS at some point.
* Unimplemented system calls.
*/
asmlinkage long do_entSys(unsigned long a0, unsigned long a1, unsigned long a2,
unsigned long a3, unsigned long a4, unsigned long a5,
struct pt_regs regs)
asmlinkage long alpha_ni_syscall(unsigned long a0, unsigned long a1,
unsigned long a2, unsigned long a3,
unsigned long a4, unsigned long a5,
struct pt_regs regs)
{
lock_kernel();
/* Only report OSF system calls. */
if (regs.r0 != 112 && regs.r0 < 300)
printk("<sc %ld(%lx,%lx,%lx)>", regs.r0, a0, a1, a2);
unlock_kernel();
return -1;
return -ENOSYS;
}
extern asmlinkage void entMM(void);
......
......@@ -19,9 +19,6 @@ endif
lib.a: $(OBJS)
$(AR) rcs lib.a $(OBJS)
memset.o: memset.S
$(CC) -c -o memset.o memset.S
__divqu.o: divide.S
$(CC) -DDIV -c -o __divqu.o divide.S
......
......@@ -37,8 +37,8 @@
.set noreorder
.align 4
.globl __clear_user
.ent __clear_user
.globl __do_clear_user
.ent __do_clear_user
.frame $30, 0, $28
.prologue 0
......@@ -79,7 +79,7 @@ $tail:
EX( stq_u $5, 0($6) ) # e0 :
ret $31, ($28), 1 # .. e1 :
__clear_user:
__do_clear_user:
and $6, 7, $4 # e0 : find dest misalignment
beq $0, $zerolength # .. e1 :
addq $0, $4, $1 # e0 : bias counter
......@@ -110,4 +110,4 @@ $zerolength:
$exception:
ret $31, ($28), 1 # .. e1 :
.end __clear_user
.end __do_clear_user
......@@ -8,7 +8,7 @@
*/
#include <linux/types.h>
#include <asm/string.h>
#include <linux/string.h>
#include <asm/uaccess.h>
......
......@@ -73,15 +73,14 @@ VM_MASK = 0x00020000
state = 0
counter = 4
priority = 8
signal = 12
blocked = 16
flags = 20
dbgreg6 = 52
dbgreg7 = 56
exec_domain = 60
flags = 12
dbgreg6 = 44
dbgreg7 = 48
exec_domain = 52
ENOSYS = 38
#define SAVE_ALL \
cld; \
push %es; \
......@@ -170,10 +169,7 @@ ret_from_sys_call:
ret_with_reschedule:
cmpl $0,SYMBOL_NAME(need_resched)
jne reschedule
movl blocked(%ebx),%eax
movl %eax,%esi # save blocked in %esi for signal handling
notl %eax
andl signal(%ebx),%eax
testb $0x8,flags(%ebx) # PF_SIGPENDING
jne signal_return
RESTORE_ALL
ALIGN
......@@ -181,7 +177,7 @@ signal_return:
testl $(VM_MASK),EFLAGS(%esp)
pushl %esp
jne v86_signal_return
pushl %esi
pushl $0
call SYMBOL_NAME(do_signal)
addl $8,%esp
RESTORE_ALL
......@@ -190,7 +186,7 @@ v86_signal_return:
call SYMBOL_NAME(save_v86_state)
movl %eax,%esp
pushl %eax
pushl %esi
pushl $0
call SYMBOL_NAME(do_signal)
addl $8,%esp
RESTORE_ALL
......@@ -529,6 +525,13 @@ ENTRY(sys_call_table)
.long SYMBOL_NAME(sys_setresgid) /* 170 */
.long SYMBOL_NAME(sys_getresgid)
.long SYMBOL_NAME(sys_prctl)
.rept NR_syscalls-172
.long SYMBOL_NAME(sys_rt_sigreturn)
.long SYMBOL_NAME(sys_rt_sigaction)
.long SYMBOL_NAME(sys_rt_sigprocmask) /* 175 */
.long SYMBOL_NAME(sys_rt_sigpending)
.long SYMBOL_NAME(sys_rt_sigtimedwait)
.long SYMBOL_NAME(sys_rt_sigqueueinfo)
.long SYMBOL_NAME(sys_rt_sigsuspend)
.rept NR_syscalls-179
.long SYMBOL_NAME(sys_ni_syscall)
.endr
......@@ -492,7 +492,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
long tmp;
ret = -EIO;
if ((unsigned long) data > NSIG)
if ((unsigned long) data > _NSIG)
goto out;
if (request == PTRACE_SYSCALL)
child->flags |= PF_TRACESYS;
......@@ -530,7 +530,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
long tmp;
ret = -EIO;
if ((unsigned long) data > NSIG)
if ((unsigned long) data > _NSIG)
goto out;
child->flags &= ~PF_TRACESYS;
tmp = get_stack_long(child, EFL_OFFSET) | TRAP_FLAG;
......@@ -546,7 +546,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
long tmp;
ret = -EIO;
if ((unsigned long) data > NSIG)
if ((unsigned long) data > _NSIG)
goto out;
child->flags &= ~(PF_PTRACED|PF_TRACESYS);
wake_up_process(child);
......@@ -585,9 +585,7 @@ asmlinkage void syscall_trace(void)
* stopping signal is not SIGTRAP. -brl
*/
if (current->exit_code) {
spin_lock_irq(&current->sigmask_lock);
current->signal |= (1 << (current->exit_code - 1));
spin_unlock_irq(&current->sigmask_lock);
send_sig(current->exit_code, current, 1);
current->exit_code = 0;
}
current->exit_code = 0;
}
This diff is collapsed.
......@@ -438,8 +438,13 @@ int handle_vm86_trap(struct kernel_vm86_regs * regs, long error_code, int trapno
}
if (trapno !=1)
return 1; /* we let this handle by the calling routine */
if (current->flags & PF_PTRACED)
current->blocked &= ~(1 << (SIGTRAP-1));
if (current->flags & PF_PTRACED) {
unsigned long flags;
spin_lock_irqsave(&current->sigmask_lock, flags);
sigdelset(&current->blocked, SIGTRAP);
recalc_sigpending(current);
spin_unlock_irqrestore(&current->sigmask_lock, flags);
}
send_sig(SIGTRAP, current, 1);
current->tss.trap_no = trapno;
current->tss.error_code = error_code;
......
......@@ -9,7 +9,7 @@
*/
#include <linux/sched.h>
#include <asm/delay.h>
#include <linux/delay.h>
#ifdef __SMP__
#include <asm/smp.h>
......
......@@ -136,8 +136,6 @@ struct hfmodem_state hfmodem_state[NR_DEVICE];
#define LPT_CONTROL(iobase) (iobase+2)
#define LPT_IRQ_ENABLE 0x10
#define LPT_EXTENT 3
#define MIDI_DATA(iobase) (iobase)
#define MIDI_STATUS(iobase) (iobase+1)
#define MIDI_READ_FULL 0x80 /* attention: negative logic!! */
......@@ -150,33 +148,37 @@ struct hfmodem_state hfmodem_state[NR_DEVICE];
#define SP_MIDI 4
/* ---------------------------------------------------------------------- */
/*
* returns 0 if ok and != 0 on error;
* the same behaviour as par96_check_lpt in baycom.c
*/
__initfunc(static int check_lpt(unsigned int iobase))
static int parptt_preempt(void *handle)
{
unsigned char b1,b2;
int i;
/* we cannot relinquish the port in the middle of an operation */
return 1;
}
if (iobase <= 0 || iobase > 0x1000-LPT_EXTENT)
return 0;
if (check_region(iobase, LPT_EXTENT))
return 0;
b1 = inb(LPT_DATA(iobase));
b2 = inb(LPT_CONTROL(iobase));
outb(0xaa, LPT_DATA(iobase));
i = inb(LPT_DATA(iobase)) == 0xaa;
outb(0x55, LPT_DATA(iobase));
i &= inb(LPT_DATA(iobase)) == 0x55;
outb(0x0a, LPT_CONTROL(iobase));
i &= (inb(LPT_CONTROL(iobase)) & 0xf) == 0x0a;
outb(0x05, LPT_CONTROL(iobase));
i &= (inb(LPT_CONTROL(iobase)) & 0xf) == 0x05;
outb(b1, LPT_DATA(iobase));
outb(b2, LPT_CONTROL(iobase));
return !i;
/* --------------------------------------------------------------------- */
static void parptt_wakeup(void *handle)
{
struct hfmodem_state *dev = (struct hfmodem_state *)handle;
printk(KERN_DEBUG "%s: parptt: why am I being woken up?\n", hfmodem_drvname);
if (!parport_claim(dev->ptt_out.pardev))
printk(KERN_DEBUG "%s: parptt: I'm broken.\n", hfmodem_drvname);
}
/* --------------------------------------------------------------------- */
__initfunc(static int check_lpt(struct hfmodem_state *dev, unsigned int iobase))
{
struct parport *pp = parport_enumerate();
while (pp && pp->base != iobase)
pp = pp->next;
if (!pp)
return 0;
if (!(dev->ptt_out.pardev = parport_register_device(pp, hfmodem_drvname, parptt_preempt, parptt_wakeup,
NULL, PARPORT_DEV_LURK, dev)))
return 0;
return 1;
}
/* --------------------------------------------------------------------- */
......@@ -272,8 +274,7 @@ __initfunc(static void output_check(struct hfmodem_state *dev))
{
enum uart u = c_uart_unknown;
if (dev->ptt_out.seriobase > 0 && dev->ptt_out.seriobase <= 0x1000-SER_EXTENT &&
((u = check_uart(dev->ptt_out.seriobase))) != c_uart_unknown)
if (((u = check_uart(dev->ptt_out.seriobase))) != c_uart_unknown)
printk(KERN_INFO "%s: PTT output: uart found at address 0x%x type %s\n",
hfmodem_drvname, dev->ptt_out.seriobase, uart_str[u]);
else {
......@@ -282,8 +283,7 @@ __initfunc(static void output_check(struct hfmodem_state *dev))
hfmodem_drvname, dev->ptt_out.seriobase);
dev->ptt_out.seriobase = 0;
}
if (dev->ptt_out.pariobase > 0 && dev->ptt_out.pariobase <= 0x1000-LPT_EXTENT &&
!check_lpt(dev->ptt_out.pariobase))
if (check_lpt(dev, dev->ptt_out.pariobase))
printk(KERN_INFO "%s: PTT output: parallel port found at address 0x%x\n",
hfmodem_drvname, dev->ptt_out.pariobase);
else {
......@@ -291,6 +291,7 @@ __initfunc(static void output_check(struct hfmodem_state *dev))
printk(KERN_WARNING "%s: PTT output: no parallel port found at address 0x%x\n",
hfmodem_drvname, dev->ptt_out.pariobase);
dev->ptt_out.pariobase = 0;
dev->ptt_out.pardev = NULL;
}
if (dev->ptt_out.midiiobase > 0 && dev->ptt_out.midiiobase <= 0x1000-MIDI_EXTENT &&
check_midi(dev->ptt_out.midiiobase))
......@@ -324,12 +325,11 @@ static void output_open(struct hfmodem_state *dev)
hfmodem_drvname, dev->ptt_out.seriobase);
}
if (dev->ptt_out.pariobase > 0) {
if (!check_region(dev->ptt_out.pariobase, LPT_EXTENT)) {
request_region(dev->ptt_out.pariobase, LPT_EXTENT, "hfmodem par ptt");
dev->ptt_out.flags |= SP_PAR;
} else
if (parport_claim(dev->ptt_out.pardev))
printk(KERN_WARNING "%s: PTT output: parallel port at 0x%x busy\n",
hfmodem_drvname, dev->ptt_out.pariobase);
else
dev->ptt_out.flags |= SP_PAR;
}
if (dev->ptt_out.midiiobase > 0) {
if (!check_region(dev->ptt_out.midiiobase, MIDI_EXTENT)) {
......@@ -361,7 +361,7 @@ static void output_close(struct hfmodem_state *dev)
if (dev->ptt_out.flags & SP_SER)
release_region(dev->ptt_out.seriobase, SER_EXTENT);
if (dev->ptt_out.flags & SP_PAR)
release_region(dev->ptt_out.pariobase, LPT_EXTENT);
parport_release(dev->ptt_out.pardev);
if (dev->ptt_out.flags & SP_MIDI)
release_region(dev->ptt_out.midiiobase, MIDI_EXTENT);
dev->ptt_out.flags = 0;
......@@ -671,6 +671,10 @@ __initfunc(int init_module(void))
void cleanup_module(void)
{
struct hfmodem_state *dev = &hfmodem_state[0];
if (dev->ptt_out.pariobase > 0)
parport_unregister_device(dev->ptt_out.pardev);
misc_deregister(&hfmodem_device);
}
......@@ -733,4 +737,3 @@ __initfunc(void hfmodem_init(void))
/* --------------------------------------------------------------------- */
#endif /* MODULE */
......@@ -64,6 +64,11 @@ static char *dev_name = "lp";
#undef LP_DEBUG
#undef LP_READ_DEBUG
/* Magic numbers */
#define AUTO -3
#define OFF -2
#define UNSPEC -1
static inline void lp_parport_release (int minor)
{
parport_release (lp_table[minor].dev);
......@@ -123,7 +128,7 @@ static inline int lp_char(char lpchar, int minor, int use_polling)
do {
status = r_str(minor);
count++;
if (need_resched)
if (resched_needed())
lp_schedule (minor);
} while (((use_polling && !LP_READY(minor, status)) ||
(!use_polling && !(status & LP_PBUSY))) &&
......@@ -163,9 +168,7 @@ static inline int lp_char(char lpchar, int minor, int use_polling)
static void lp_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
struct parport *pb = (struct parport *) dev_id;
struct pardevice *pd = pb->cad;
struct lp_struct *lp_dev = (struct lp_struct *) pd->private;
struct lp_struct *lp_dev = (struct lp_struct *) dev_id;
if (waitqueue_active (&lp_dev->lp_wait_q))
wake_up(&lp_dev->lp_wait_q);
......@@ -272,11 +275,11 @@ static inline int lp_write_buf(unsigned int minor, const char *buf, int count)
return total_bytes_written;
}
static ssize_t lp_write(struct file * file, const char * buf, size_t count, loff_t *ppos)
static ssize_t lp_write(struct file * file, const char * buf,
size_t count, loff_t *ppos)
{
struct inode *inode = file->f_dentry->d_inode;
unsigned int minor = MINOR(inode->i_rdev);
int retv;
unsigned int minor = MINOR(file->f_dentry->d_inode->i_rdev);
ssize_t retv;
if (jiffies-lp_table[minor].lastcall > LP_TIME(minor))
lp_table[minor].runchars = 0;
......@@ -288,7 +291,7 @@ static ssize_t lp_write(struct file * file, const char * buf, size_t count, loff
*/
lp_parport_claim (minor);
retv = lp_write_buf(minor, buf, count);
retv = lp_write_buf(minor, buf, count);
lp_parport_release (minor);
return retv;
......@@ -315,15 +318,15 @@ static void lp_select_in_high(int minor) {
}
/* Status readback confirming to ieee1284 */
static ssize_t lp_read(struct file * file, char * buf, size_t count, loff_t *ppos)
static ssize_t lp_read(struct file * file, char * buf,
size_t count, loff_t *ppos)
{
struct inode *inode = file->f_dentry->d_inode;
unsigned char z=0, Byte=0, status;
char *temp;
int retval;
ssize_t retval;
unsigned int counter=0;
unsigned int i;
unsigned int minor=MINOR(inode->i_rdev);
unsigned int minor=MINOR(file->f_dentry->d_inode->i_rdev);
/* Claim Parport or sleep until it becomes available
* (see lp_wakeup() for details)
......@@ -353,7 +356,7 @@ static ssize_t lp_read(struct file * file, char * buf, size_t count, loff_t *ppo
status=(r_str(minor) & 0x40);
udelay(50);
counter++;
if (need_resched)
if (resched_needed())
schedule ();
} while ( (status == 0x40) && (counter < 20) );
if ( counter == 20 ) { /* Timeout */
......@@ -372,7 +375,7 @@ static ssize_t lp_read(struct file * file, char * buf, size_t count, loff_t *ppo
status=(r_str(minor) & 0x40);
udelay(20);
counter++;
if (need_resched)
if (resched_needed())
schedule ();
} while ( (status == 0) && (counter < 20) );
if (counter == 20) { /* Timeout */
......@@ -568,7 +571,7 @@ static struct file_operations lp_fops = {
lp_release
};
static int parport[LP_NO] = { -1, };
static int parport[LP_NO] = { UNSPEC, };
#ifdef MODULE
#define lp_init init_module
......@@ -589,11 +592,11 @@ void lp_setup(char *str, int *ints)
printk(KERN_INFO "lp: too many ports, %s ignored.\n",
str);
} else if (!strcmp(str, "auto")) {
parport[0] = -3;
parport[0] = AUTO;
} else {
if (ints[0] == 0 || ints[1] == 0) {
/* disable driver on "lp=" or "lp=0" */
parport[0] = -2;
parport[0] = OFF;
} else {
printk(KERN_WARNING "warning: 'lp=0x%x' is deprecated, ignored\n", ints[1]);
}
......@@ -619,7 +622,7 @@ void lp_wakeup(void *ref)
static int inline lp_searchfor(int list[], int a)
{
int i;
for (i = 0; i < LP_NO && list[i] != -1; i++) {
for (i = 0; i < LP_NO && list[i] != UNSPEC; i++) {
if (list[i] == a) return 1;
}
return 0;
......@@ -630,15 +633,16 @@ int lp_init(void)
int count = 0;
struct parport *pb;
if (parport[0] == -2) return 0;
if (parport[0] == OFF) return 0;
pb = parport_enumerate();
while (pb) {
/* We only understand PC-style ports. */
if (pb->modes & PARPORT_MODE_PCSPP) {
if (parport[0] == -1 || lp_searchfor(parport, count) ||
(parport[0] == -3 &&
if (parport[0] == UNSPEC ||
lp_searchfor(parport, count) ||
(parport[0] == AUTO &&
pb->probe_info.class == PARPORT_CLASS_PRINTER)) {
lp_table[count].dev =
parport_register_device(pb, dev_name,
......@@ -646,6 +650,10 @@ int lp_init(void)
lp_interrupt, PARPORT_DEV_TRAN,
(void *) &lp_table[count]);
lp_table[count].flags |= LP_EXIST;
init_waitqueue (&lp_table[count].lp_wait_q);
lp_parport_claim (count);
lp_reset (count);
lp_parport_release (count);
printk(KERN_INFO "lp%d: using %s (%s).\n",
count, pb->name, (pb->irq == PARPORT_IRQ_NONE)?"polling":"interrupt-driven");
}
......
......@@ -539,7 +539,7 @@ __initfunc(int chr_dev_init(void))
* Some joysticks only appear when the soundcard they are
* connected too is confgured. Keep the sound/joystick ordering.
*/
joystick_init();
js_init();
#endif
#if CONFIG_QIC02_TAPE
qic02_tape_init();
......
......@@ -695,8 +695,8 @@ static int n_tty_receive_room(struct tty_struct *tty)
int is_ignored(int sig)
{
return ((current->blocked & (1<<(sig-1))) ||
(current->sig->action[sig-1].sa_handler == SIG_IGN));
return (sigismember(&current->blocked, sig) ||
current->sig->action[sig-1].sa.sa_handler == SIG_IGN);
}
static void n_tty_set_termios(struct tty_struct *tty, struct termios * old)
......
......@@ -29,6 +29,7 @@
* 961118 Changed some verbiage on some of the output, tidied up
* code bits, and added compatibility to 2.1.x.
* 970912 Enabled board on open and disable on close.
* 971107 Took account of recent VFS changes (broke read).
*/
#include <linux/module.h>
......@@ -222,7 +223,7 @@ static void pcwd_send_heartbeat(void)
}
static int pcwd_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
unsigned int cmd, unsigned long arg)
{
int i, cdat, rv;
static struct watchdog_info ident=
......@@ -359,8 +360,13 @@ static int pcwd_ioctl(struct inode *inode, struct file *file,
return 0;
}
static long pcwd_write(struct inode *inode, struct file *file, const char *buf, unsigned long len)
static ssize_t pcwd_write(struct file *file, const char *buf, size_t len,
loff_t *ppos)
{
/* Can't seek (pwrite) on this device */
if (ppos != &file->f_pos)
return -ESPIPE;
if (len)
{
pcwd_send_heartbeat();
......@@ -381,11 +387,15 @@ static int pcwd_open(struct inode *ino, struct file *filep)
return(0);
}
static ssize_t pcwd_read(struct file *file, char *buf, size_t count, loff_t *ppos)
static ssize_t pcwd_read(struct file *file, char *buf, size_t count,
loff_t *ppos)
{
unsigned short c = inb(current_readport);
unsigned char cp;
/* Can't seek (pread) on this device */
if (ppos != &file->f_pos)
return -ESPIPE;
switch(MINOR(file->f_dentry->d_inode->i_rdev))
{
case TEMP_MINOR:
......@@ -488,11 +498,16 @@ static struct file_operations pcwd_fops = {
pcwd_read, /* Read */
pcwd_write, /* Write */
NULL, /* Readdir */
NULL, /* Select */
NULL, /* Poll */
pcwd_ioctl, /* IOctl */
NULL, /* MMAP */
pcwd_open, /* Open */
pcwd_close /* Close */
pcwd_close, /* Release */
NULL, /* Fsync */
NULL, /* Fasync */
NULL, /* CheckMediaChange */
NULL, /* Revalidate */
NULL, /* Lock */
};
static struct miscdevice pcwd_miscdev = {
......
......@@ -725,7 +725,7 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
extern int spawnpid, spawnsig;
if (!perm)
return -EPERM;
if (arg < 1 || arg > NSIG || arg == SIGKILL)
if (arg < 1 || arg > _NSIG || arg == SIGKILL)
return -EINVAL;
spawnpid = current->pid;
spawnsig = arg;
......
......@@ -30,6 +30,13 @@ ifeq ($(CONFIG_PARPORT),y)
M_OBJS += parport_pc.o
endif
endif
ifeq ($(CONFIG_PARPORT_AX),y)
LX_OBJS += parport_ax.o
else
ifeq ($(CONFIG_PARPORT_AX),m)
M_OBJS += parport_ax.o
endif
endif
LX_OBJS += parport_init.o
else
ifeq ($(CONFIG_PARPORT),m)
......@@ -43,6 +50,9 @@ else
ifeq ($(CONFIG_PARPORT_PC),m)
MX_OBJS += parport_pc.o
endif
ifeq ($(CONFIG_PARPORT_AX),m)
MX_OBJS += parport_ax.o
endif
endif
include $(TOPDIR)/Rules.make
......
This diff is collapsed.
/* IEEE-1284 implementation for parport.
/* $Id: parport_ieee1284.c,v 1.4 1997/10/19 21:37:21 philip Exp $
* IEEE-1284 implementation for parport.
*
* Authors: Phil Blundell <Philip.Blundell@pobox.com>
* Carsten Gross <carsten@sol.wohnheim.uni-ulm.de>
......@@ -6,83 +7,63 @@
*/
#include <linux/tasks.h>
#include <linux/parport.h>
#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/interrupt.h>
#include <linux/ioport.h>
#include <linux/kernel.h>
#include <linux/malloc.h>
/* The following read functions are an implementation of a status readback
* and device id request confirming to IEEE1284-1994.
*
* These probably ought to go in some seperate file, so people like the SPARC
* don't have to pull them in.
*/
/* Wait for Status line(s) to change in 35 ms - see IEEE1284-1994 page 24 to
* 25 for this. After this time we can create a timeout because the
* peripheral doesn't conform to IEEE1284. We want to save CPU time: we are
* waiting a maximum time of 500 us busy (this is for speed). If there is
* peripheral doesn't conform to IEEE1284. We want to save CPU time: we are
* waiting a maximum time of 500 us busy (this is for speed). If there is
* not the right answer in this time, we call schedule and other processes
* are able "to eat" the time up to 30ms. So the maximum load avarage can't
* get above 5% for a read even if the peripheral is really slow. (but your
* read gets very slow then - only about 10 characters per second. This
* should be tuneable). Thanks to Andreas who pointed me to this and ordered
* the documentation.
* are able to eat the time up to 40ms.
*/
int parport_wait_peripheral(struct parport *port, unsigned char mask,
unsigned char result)
{
int counter=0;
int counter;
unsigned char status;
do {
for (counter = 0; counter < 20; counter++) {
status = parport_read_status(port);
if ((status & mask) == result)
return 0;
udelay(25);
counter++;
if (need_resched)
if (resched_needed())
schedule();
} while ( ((status & mask) != result) && (counter < 20) );
if ( (counter == 20) && ((status & mask) != result) ) {
current->state=TASK_INTERRUPTIBLE;
current->timeout=jiffies+4;
schedule(); /* wait for 4 scheduler runs (40ms) */
status = parport_read_status(port);
if ((status & mask) != result) return 1; /* timeout */
}
return 0; /* okay right response from device */
current->state = TASK_INTERRUPTIBLE;
current->timeout = jiffies+4;
schedule(); /* wait for 40ms */
status = parport_read_status(port);
return ((status & mask) == result)?0:1;
}
/* Test if nibble mode for status readback is okay. Returns the value false
* if the printer doesn't support readback at all. If it supports readbacks
* and printer data is available the function returns 1, otherwise 2. The
* only valid values for "mode" are 0 and 4. 0 requests normal nibble mode,
* 4 is for "request device id using nibble mode". The request for the
* device id is best done in an ioctl (or at bootup time). There is no
* check for an invalid value, the only function using this call at the
* moment is lp_read and the ioctl LPGETDEVICEID both fixed calls from
* trusted kernel.
/* Test if the peripheral is IEEE 1284 compliant.
* return values are:
* 0 - handshake failed; peripheral is not compliant (or none present)
* 1 - handshake OK; IEEE1284 peripheral present but no data available
* 2 - handshake OK; IEEE1284 peripheral and data available
*/
int parport_ieee1284_nibble_mode_ok(struct parport *port, unsigned char mode)
{
parport_write_data(port, mode);
udelay(5);
parport_write_control(port, parport_read_control(port) & ~8); /* SelectIN low */
parport_write_control(port, parport_read_control(port) | 2); /* AutoFeed high */
if (parport_wait_peripheral(port, 0x78, 0x38)) { /* timeout? */
parport_write_control(port, (parport_read_control(port) & ~2) | 8);
return 0; /* first stage of negotiation failed,
* no IEEE1284 compliant device on this port
*/
udelay(500);
/* nSelectIn high, nAutoFd low */
parport_write_control(port, (parport_read_control(port) & ~8) | 2);
if (parport_wait_peripheral(port, 0x78, 0x38)) {
parport_write_control(port,
(parport_read_control(port) & ~2) | 8);
return 0;
}
parport_write_control(port, parport_read_control(port) | 1); /* Strobe high */
/* nStrobe low */
parport_write_control(port, parport_read_control(port) | 1);
udelay(5); /* Strobe wait */
parport_write_control(port, parport_read_control(port) & ~1); /* Strobe low */
/* nStrobe high */
parport_write_control(port, parport_read_control(port) & ~1);
udelay(5);
parport_write_control(port, parport_read_control(port) & ~2); /* AutoFeed low */
/* nAutoFd low */
parport_write_control(port, parport_read_control(port) & ~2);
return (parport_wait_peripheral(port, 0x20, 0))?2:1;
}
......@@ -17,13 +17,15 @@
#include <linux/kernel.h>
#include <linux/malloc.h>
#include <linux/init.h>
#include <linux/kerneld.h>
#ifndef MODULE
static int io[PARPORT_MAX+1] __initdata = { 0, };
static int irq[PARPORT_MAX] __initdata = { PARPORT_IRQ_NONE, };
static int dma[PARPORT_MAX] __initdata = { PARPORT_DMA_NONE, };
static int io[PARPORT_MAX+1] __initdata = { [0 ... PARPORT_MAX] = 0 };
static int irq[PARPORT_MAX] __initdata = { [0 ... PARPORT_MAX-1] = PARPORT_IRQ_NONE };
static int dma[PARPORT_MAX] __initdata = { [0 ... PARPORT_MAX-1] = PARPORT_DMA_NONE };
extern int parport_pc_init(int *io, int *irq, int *dma);
extern int parport_ax_init(void);
static int parport_setup_ptr __initdata = 0;
......@@ -68,10 +70,18 @@ __initfunc(int parport_init(void))
{
struct parport *pb;
if (io[0] == PARPORT_DISABLE) return 1;
if (io[0] == PARPORT_DISABLE)
return 1;
#ifdef CONFIG_PNP_PARPORT
parport_probe_hook = &parport_probe_one;
#endif
parport_proc_init();
#ifdef CONFIG_PARPORT_PC
parport_pc_init(io, irq, dma);
#endif
#ifdef CONFIG_PARPORT_AX
parport_ax_init();
#endif
return 0;
}
......@@ -91,6 +101,7 @@ EXPORT_SYMBOL(parport_ieee1284_nibble_mode_ok);
EXPORT_SYMBOL(parport_wait_peripheral);
EXPORT_SYMBOL(parport_proc_register);
EXPORT_SYMBOL(parport_proc_unregister);
EXPORT_SYMBOL(parport_probe_hook);
void inc_parport_count(void)
{
......
......@@ -837,7 +837,7 @@ static int probe_one_port(unsigned long int base, int irq, int dma)
}
p->size = (p->modes & (PARPORT_MODE_PCEPP
| PARPORT_MODE_PCECPEPP))?8:3;
printk(KERN_INFO "%s: PC-style at 0x%x", p->name, p->base);
printk(KERN_INFO "%s: PC-style at 0x%lx", p->name, p->base);
if (p->irq == PARPORT_IRQ_AUTO) {
p->irq = PARPORT_IRQ_NONE;
parport_irq_probe(p);
......@@ -868,6 +868,10 @@ static int probe_one_port(unsigned long int base, int irq, int dma)
/* Done probing. Now put the port into a sensible start-up state. */
pc_write_control(p, 0xc);
pc_write_data(p, 0);
if (parport_probe_hook)
(*parport_probe_hook)(p);
return 1;
}
......
......@@ -125,7 +125,7 @@ static int hardware_read_proc(char *page, char **start, off_t off,
struct parport *pp = (struct parport *)data;
int len=0;
len += sprintf(page+len, "base:\t0x%x\n",pp->base);
len += sprintf(page+len, "base:\t0x%lx\n",pp->base);
if (pp->irq == PARPORT_IRQ_NONE)
len += sprintf(page+len, "irq:\tnone\n");
else
......
/* Parallel-port resource manager code.
/* $Id: parport_share.c,v 1.8 1997/11/08 18:55:29 philip Exp $
* Parallel-port resource manager code.
*
* Authors: David Campbell <campbell@tirian.che.curtin.edu.au>
* Tim Waugh <tim@cyberelk.demon.co.uk>
......@@ -29,6 +30,8 @@
static struct parport *portlist = NULL, *portlist_tail = NULL;
static int portcount = 0;
void (*parport_probe_hook)(struct parport *port) = NULL;
/* Return a list of all the ports we know about. */
struct parport *parport_enumerate(void)
{
......@@ -275,11 +278,11 @@ int parport_claim(struct pardevice *dev)
dev->port->cad = dev;
/* Swap the IRQ handlers. */
if (dev->port->irq >= 0) {
if (dev->port->irq != PARPORT_IRQ_NONE) {
free_irq(dev->port->irq, dev->port);
request_irq(dev->port->irq, dev->irq_func ? dev->irq_func :
parport_null_intr_func, SA_INTERRUPT, dev->name,
dev->port);
dev->private);
}
/* Restore control registers */
......@@ -303,10 +306,10 @@ void parport_release(struct pardevice *dev)
dev->port->ops->save_state(dev->port, dev->state);
/* Point IRQs somewhere harmless. */
if (dev->port->irq >= 0) {
if (dev->port->irq != PARPORT_IRQ_NONE) {
free_irq(dev->port->irq, dev->port);
request_irq(dev->port->irq, parport_null_intr_func,
SA_INTERRUPT, dev->port->name, dev->port);
SA_INTERRUPT, dev->port->name, NULL);
}
/* Walk the list, offering a wakeup callback to everybody other
......
......@@ -38,6 +38,8 @@ static char *version = "3c59x.c:v0.25 5/17/96 becker@cesdis.gsfc.nasa.gov\n";
#include <linux/interrupt.h>
#include <linux/init.h>
#include <linux/delay.h>
#ifdef CONFIG_PCI
#include <linux/pci.h>
#include <linux/bios32.h>
......@@ -498,7 +500,7 @@ __initfunc(static int vortex_probe1(struct device *dev))
outw(EEPROM_Read + PhysAddr01 + i, ioaddr + Wn0EepromCmd);
/* Pause for at least 162 us. for the read to take place. */
for (timer = 162*4 + 400; timer >= 0; timer--) {
SLOW_DOWN_IO;
udelay(1);
if ((inw(ioaddr + Wn0EepromCmd) & 0x8000) == 0)
break;
}
......
......@@ -157,9 +157,15 @@ if [ "$CONFIG_NET_RADIO" != "n" ]; then
tristate 'Gracilis PackeTwin driver for AX.25' CONFIG_PT
tristate 'Ottawa PI and PI2 driver for AX.25' CONFIG_PI
tristate 'Z8530 SCC driver for AX.25' CONFIG_SCC
if [ "$CONFIG_SCC" != "n" ]; then
bool ' additional delay for PA0HZP OptoSCC compatible boards' CONFIG_SCC_DELAY
bool ' support for TRX that feedback the tx signal to rx' CONFIG_SCC_TRXECHO
fi
fi
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
tristate 'BAYCOM ser12 and par96 driver for AX.25' CONFIG_BAYCOM
tristate 'BAYCOM ser12 fullduplex driver for AX.25' CONFIG_BAYCOM_SER_FDX
tristate 'BAYCOM ser12 halfduplex driver for AX.25' CONFIG_BAYCOM_SER_HDX
tristate 'BAYCOM picpar and par96 driver for AX.25' CONFIG_BAYCOM_PAR
tristate 'Soundcard modem driver for AX.25' CONFIG_SOUNDMODEM
if [ "$CONFIG_SOUNDMODEM" != "n" ]; then
bool 'Soundmodem support for Soundblaster and compatible cards' CONFIG_SOUNDMODEM_SBC
......
......@@ -73,13 +73,6 @@ ifeq ($(CONFIG_SK_G16),y)
L_OBJS += sk_g16.o
endif
ifeq ($(CONFIG_NET_IPIP),y)
L_OBJS += tunnel.o
else
ifeq ($(CONFIG_NET_IPIP),m)
M_OBJS += tunnel.o
endif
endif
ifeq ($(CONFIG_HP100),y)
L_OBJS += hp100.o
......@@ -735,13 +728,33 @@ else
endif
endif
ifeq ($(CONFIG_BAYCOM),y)
L_OBJS += baycom.o
ifeq ($(CONFIG_BAYCOM_SER_FDX),y)
L_OBJS += baycom_ser_fdx.o
CONFIG_HDLCDRV_BUILTIN = y
else
ifeq ($(CONFIG_BAYCOM_SER_FDX),m)
CONFIG_HDLCDRV_MODULE = y
M_OBJS += baycom_ser_fdx.o
endif
endif
ifeq ($(CONFIG_BAYCOM_SER_HDX),y)
L_OBJS += baycom_ser_hdx.o
CONFIG_HDLCDRV_BUILTIN = y
else
ifeq ($(CONFIG_BAYCOM_SER_HDX),m)
CONFIG_HDLCDRV_MODULE = y
M_OBJS += baycom_ser_hdx.o
endif
endif
ifeq ($(CONFIG_BAYCOM_PAR),y)
L_OBJS += baycom_par.o
CONFIG_HDLCDRV_BUILTIN = y
else
ifeq ($(CONFIG_BAYCOM),m)
ifeq ($(CONFIG_BAYCOM_PAR),m)
CONFIG_HDLCDRV_MODULE = y
M_OBJS += baycom.o
M_OBJS += baycom_par.o
endif
endif
......
......@@ -102,7 +102,7 @@ struct net_local {
#define EE_DATA_READ 0x80 /* EEPROM chip data out, in reg. 17. */
/* Delay between EEPROM clock transitions. */
#define eeprom_delay() do { int _i = 40; while (--_i > 0) { __SLOW_DOWN_IO; }} while (0)
#define eeprom_delay() do { int _i = 40; while (--_i > 0) { inb(0x80); }} while (0)
/* The EEPROM commands include the alway-set leading bit. */
#define EE_WRITE_CMD (5 << 6)
......
This diff is collapsed.
This diff is collapsed.
......@@ -39,8 +39,8 @@ static const char *version =
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
**************************************************************/
/* Add another "; SLOW_DOWN_IO" here if your adapter won't work OK: */
#define DE600_SLOW_DOWN SLOW_DOWN_IO; SLOW_DOWN_IO; SLOW_DOWN_IO
/* Add more time here if your adapter won't work OK: */
#define DE600_SLOW_DOWN udelay(delay_time)
/*
* If you still have trouble reading/writing to the adapter,
......@@ -104,6 +104,7 @@ static const char *version =
#include <asm/system.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/inet.h>
#include <linux/netdevice.h>
......@@ -113,6 +114,9 @@ static const char *version =
static unsigned int de600_debug = DE600_DEBUG;
MODULE_PARM(de600_debug, "i");
static unsigned int delay_time = 10;
MODULE_PARM(delay_time, "i");
#ifdef FAKE_SMALL_MAX
static unsigned long de600_rspace(struct sock *sk);
#include <net/sock.h>
......
......@@ -150,7 +150,7 @@ __initfunc(int e21_probe1(struct device *dev, int ioaddr))
/* Verify by making certain that there is a 8390 at there. */
outb(E8390_NODMA + E8390_STOP, ioaddr);
SLOW_DOWN_IO;
udelay(1); /* we want to delay one I/O cycle - which is 2MHz */
status = inb(ioaddr);
if (status != 0x21 && status != 0x23)
return ENODEV;
......
......@@ -102,6 +102,7 @@ static const char *version =
#include <asm/dma.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
......@@ -652,8 +653,8 @@ eepro_open(struct device *dev)
outb(SEL_RESET_CMD, ioaddr);
/* We are supposed to wait for 2 us after a SEL_RESET */
SLOW_DOWN_IO;
SLOW_DOWN_IO;
udelay(2);
lp->tx_start = lp->tx_end = XMT_LOWER_LIMIT << 8; /* or = RCV_RAM */
lp->tx_last = 0;
......@@ -695,8 +696,7 @@ eepro_send_packet(struct sk_buff *skb, struct device *dev)
/* Try to restart the adaptor. */
outb(SEL_RESET_CMD, ioaddr);
/* We are supposed to wait for 2 us after a SEL_RESET */
SLOW_DOWN_IO;
SLOW_DOWN_IO;
udelay(2);
/* Do I also need to flush the transmit buffers here? YES? */
lp->tx_start = lp->tx_end = rcv_ram;
......@@ -824,9 +824,9 @@ eepro_close(struct device *dev)
/* Update the statistics here. What statistics? */
/* We are supposed to wait for 200 us after a RESET */
SLOW_DOWN_IO;
SLOW_DOWN_IO; /* May not be enough? */
udelay(200);
MOD_DEC_USE_COUNT;
return 0;
}
......@@ -933,8 +933,7 @@ set_multicast_list(struct device *dev)
/* Acknowledge that the MC setup is done */
do { /* We should be doing this in the eepro_interrupt()! */
SLOW_DOWN_IO;
SLOW_DOWN_IO;
udelay(2);
if (inb(ioaddr + STATUS_REG) & 0x08)
{
i = inb(ioaddr);
......@@ -962,7 +961,7 @@ set_multicast_list(struct device *dev)
/* IMPORTANT - the 82595 will be set to Bank 0 after the eeprom is read */
/* The delay between EEPROM clock transitions. */
#define eeprom_delay() { int _i = 40; while (--_i > 0) { __SLOW_DOWN_IO; }}
#define eeprom_delay() { udelay(40); }
#define EE_READ_CMD (6 << 6)
int
......
......@@ -61,6 +61,7 @@ static int max_interrupt_work = 20;
#include <linux/interrupt.h>
#include <linux/pci.h>
#include <linux/bios32.h>
#include <linux/delay.h>
#include <asm/processor.h> /* Processor type for cache alignment. */
#include <asm/bitops.h>
#include <asm/io.h>
......
......@@ -37,7 +37,7 @@
#define ASIC_RST 0x40
#define i586_RST 0x80
#define eeprom_delay() { int _i = 40; while (--_i>0) { __SLOW_DOWN_IO; }}
#define eeprom_delay() { udelay(40); }
/*
* i82586 Memory Configuration
......
......@@ -143,9 +143,9 @@ extern __inline__ void dev_init_buffers(struct device *dev)
* io regions, irqs and dma channels
*/
static char ax25_bcast[7] =
static char ax25_bcast[AX25_ADDR_LEN] =
{'Q' << 1, 'S' << 1, 'T' << 1, ' ' << 1, ' ' << 1, ' ' << 1, '0' << 1};
static char ax25_test[7] =
static char ax25_nocall[AX25_ADDR_LEN] =
{'L' << 1, 'I' << 1, 'N' << 1, 'U' << 1, 'X' << 1, ' ' << 1, '1' << 1};
/* --------------------------------------------------------------------- */
......@@ -890,11 +890,11 @@ static int hdlcdrv_probe(struct device *dev)
dev->set_mac_address = hdlcdrv_set_mac_address;
dev->type = ARPHRD_AX25; /* AF_AX25 device */
dev->hard_header_len = 73; /* We do digipeaters now */
dev->mtu = 1500; /* eth_mtu is the default */
dev->addr_len = 7; /* sizeof an ax.25 address */
memcpy(dev->broadcast, ax25_bcast, 7);
memcpy(dev->dev_addr, ax25_test, 7);
dev->hard_header_len = AX25_MAX_HEADER_LEN + AX25_BPQ_HEADER_LEN;
dev->mtu = AX25_DEF_PACLEN; /* eth_mtu is the default */
dev->addr_len = AX25_ADDR_LEN; /* sizeof an ax.25 address */
memcpy(dev->broadcast, ax25_bcast, AX25_ADDR_LEN);
memcpy(dev->dev_addr, ax25_nocall, AX25_ADDR_LEN);
/* New style flags */
dev->flags = 0;
......
......@@ -31,6 +31,7 @@ static const char *version =
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <asm/system.h>
#include <asm/io.h>
......@@ -266,7 +267,7 @@ hpp_open(struct device *dev)
/* Reset the 8390 and HP chip. */
option_reg = inw(ioaddr + HPP_OPTION);
outw(option_reg & ~(NICReset + ChipReset), ioaddr + HPP_OPTION);
SLOW_DOWN_IO; SLOW_DOWN_IO;
udelay(5);
/* Unreset the board and enable interrupts. */
outw(option_reg | (EnableIRQ + NICReset + ChipReset), ioaddr + HPP_OPTION);
......@@ -307,12 +308,11 @@ hpp_reset_8390(struct device *dev)
outw(option_reg & ~(NICReset + ChipReset), ioaddr + HPP_OPTION);
/* Pause a few cycles for the hardware reset to take place. */
SLOW_DOWN_IO;
SLOW_DOWN_IO;
udelay(5);
ei_status.txing = 0;
outw(option_reg | (EnableIRQ + NICReset + ChipReset), ioaddr + HPP_OPTION);
SLOW_DOWN_IO; SLOW_DOWN_IO;
udelay(5);
if ((inb_p(ioaddr+NIC_OFFSET+EN0_ISR) & ENISR_RESET) == 0)
......
......@@ -233,11 +233,10 @@ hp_reset_8390(struct device *dev)
outb_p(0x00, hp_base + HP_CONFIGURE);
ei_status.txing = 0;
/* Pause just a few cycles for the hardware reset to take place. */
SLOW_DOWN_IO;
SLOW_DOWN_IO;
udelay(5);
outb_p(saved_config, hp_base + HP_CONFIGURE);
SLOW_DOWN_IO; SLOW_DOWN_IO;
udelay(5);
if ((inb_p(hp_base+NIC_OFFSET+EN0_ISR) & ENISR_RESET) == 0)
printk("%s: hp_reset_8390() did not complete.\n", dev->name);
......
#define RCS_ID "$Id: scc.c,v 1.69 1997/04/06 19:22:45 jreuter Exp jreuter $"
#define RCS_ID "$Id: scc.c,v 1.71 1997/11/29 19:59:20 jreuter Exp jreuter $"
#define VERSION "3.0"
#define BANNER "Z8530 SCC driver version "VERSION".dl1bke (experimental) by DL1BKE\n"
......@@ -89,6 +89,7 @@
970108 - Fixed the remaining problems.
970402 - Hopefully fixed the problems with the new *_timer()
routines, added calibration code.
971012 - made SCC_DELAY a CONFIG option, added CONFIG_SCC_TRXECHO
Thanks to all who contributed to this driver with ideas and bug
reports!
......@@ -113,14 +114,14 @@
vy 73,
Joerg Reuter ampr-net: dl1bke@db0pra.ampr.org
AX-25 : DL1BKE @ DB0ACH.#NRW.DEU.EU
Internet: jreuter@lykos.oche.de
Internet: jreuter@poboxes.com
www : http://www.rat.de/jr
*/
/* ----------------------------------------------------------------------- */
#undef SCC_DELAY /* perhaps your ISA bus is a *bit* too fast? */
#undef SCC_LDELAY 1 /* slow it even a bit more down */
#undef DONT_CHECK /* don't look if the SCCs you specified are available */
#undef SCC_LDELAY 1 /* slow it even a bit more down */
#undef DONT_CHECK /* don't look if the SCCs you specified are available */
#define MAXSCC 4 /* number of max. supported chips */
#define BUFSIZE 384 /* must not exceed 4096 */
......@@ -224,7 +225,7 @@ static unsigned char Driver_Initialized = 0;
static int Nchips = 0;
static io_port Vector_Latch = 0;
MODULE_AUTHOR("Joerg Reuter <jreuter@lykos.oche.de>");
MODULE_AUTHOR("Joerg Reuter <jreuter@poboxes.com>");
MODULE_DESCRIPTION("Network Device Driver for Z8530 based HDLC cards for Amateur Packet Radio");
MODULE_SUPPORTED_DEVICE("scc");
......@@ -936,8 +937,10 @@ static void scc_key_trx(struct scc_channel *scc, char tx)
{ /* force simplex operation */
if (tx)
{
#ifdef CONFIG_SCC_TRXECHO
cl(scc, R3, RxENABLE|ENT_HM); /* switch off receiver */
cl(scc, R15, DCDIE); /* No DCD changes, please */
#endif
set_brg(scc, time_const); /* reprogram baudrate generator */
/* DPLL -> Rx clk, BRG -> Tx CLK, TRxC mode output, TRxC = BRG */
......@@ -951,29 +954,34 @@ static void scc_key_trx(struct scc_channel *scc, char tx)
/* DPLL -> Rx clk, DPLL -> Tx CLK, TRxC mode output, TRxC = DPLL */
wr(scc, R11, RCDPLL|TCDPLL|TRxCOI|TRxCDP);
#ifdef CONFIG_SCC_TRXECHO
or(scc,R3,RxENABLE|ENT_HM);
or(scc,R15, DCDIE);
#endif
}
} else {
if (tx)
{
#ifdef CONFIG_SCC_TRXECHO
if (scc->kiss.fulldup == KISS_DUPLEX_HALF)
{
cl(scc, R3, RxENABLE);
cl(scc, R15, DCDIE);
}
#endif
or(scc,R5,RTS|TxENAB); /* enable tx */
} else {
cl(scc,R5,RTS|TxENAB); /* disable tx */
#ifdef CONFIG_SCC_TRXECHO
if (scc->kiss.fulldup == KISS_DUPLEX_HALF)
{
or(scc, R3, RxENABLE|ENT_HM);
or(scc, R15, DCDIE);
}
#endif
}
}
......@@ -2198,7 +2206,7 @@ int init_module(void)
result = scc_init();
if (result == 0)
printk(KERN_INFO "Copyright 1993,1997 Joerg Reuter DL1BKE (jreuter@lykos.tng.oche.de)\n");
printk(KERN_INFO "Copyright 1993,1997 Joerg Reuter DL1BKE (jreuter@poboxes.com)\n");
return result;
}
......
This diff is collapsed.
......@@ -483,26 +483,19 @@ inline u32 xor( u32 a, u32 b )
{
return ( ( a && ! b ) || ( ! a && b ) );
}
#define XOR8( a, b, c, d, e, f, g, h ) xor( a, xor( b, xor( c, xor( d, xor( e, x
or( f, xor( g, h ) ) ) ) ) ) )
#define XOR8( a, b, c, d, e, f, g, h ) xor( a, xor( b, xor( c, xor( d, xor( e, xor( f, xor( g, h ) ) ) ) ) ) )
#define DA( a, bit ) ( ( (u8) a[bit/8] ) & ( (u8) ( 1 << bit%8 ) ) )
inline u32 TLan_HashFunc( u8 *a )
{
u32 hash;
hash = XOR8( DA(a,0), DA(a, 6), DA(a,12), DA(a,18), DA(a,24), DA(a,30), DA(a,3
6), DA(a,42) );
hash |= XOR8( DA(a,1), DA(a, 7), DA(a,13), DA(a,19), DA(a,25), DA(a,31), DA(a,3
7), DA(a,43) ) << 1;
hash |= XOR8( DA(a,2), DA(a, 8), DA(a,14), DA(a,20), DA(a,26), DA(a,32), DA(a,3
8), DA(a,44) ) << 2;
hash |= XOR8( DA(a,3), DA(a, 9), DA(a,15), DA(a,21), DA(a,27), DA(a,33), DA(a,3
9), DA(a,45) ) << 3;
hash |= XOR8( DA(a,4), DA(a,10), DA(a,16), DA(a,22), DA(a,28), DA(a,34), DA(a,4
0), DA(a,46) ) << 4;
hash |= XOR8( DA(a,5), DA(a,11), DA(a,17), DA(a,23), DA(a,29), DA(a,35), DA(a,4
1), DA(a,47) ) << 5;
hash = XOR8( DA(a,0), DA(a, 6), DA(a,12), DA(a,18), DA(a,24), DA(a,30), DA(a,36), DA(a,42) );
hash |= XOR8( DA(a,1), DA(a, 7), DA(a,13), DA(a,19), DA(a,25), DA(a,31), DA(a,37), DA(a,43) ) << 1;
hash |= XOR8( DA(a,2), DA(a, 8), DA(a,14), DA(a,20), DA(a,26), DA(a,32), DA(a,38), DA(a,44) ) << 2;
hash |= XOR8( DA(a,3), DA(a, 9), DA(a,15), DA(a,21), DA(a,27), DA(a,33), DA(a,39), DA(a,45) ) << 3;
hash |= XOR8( DA(a,4), DA(a,10), DA(a,16), DA(a,22), DA(a,28), DA(a,34), DA(a,40), DA(a,46) ) << 4;
hash |= XOR8( DA(a,5), DA(a,11), DA(a,17), DA(a,23), DA(a,29), DA(a,35), DA(a,41), DA(a,47) ) << 5;
return hash;
......
......@@ -1526,15 +1526,11 @@ void BusLogic_StartMailboxCommand(BusLogic_HostAdapter_T *HostAdapter)
static inline void BusLogic_Delay(int Seconds)
{
int Milliseconds = 1000 * Seconds;
unsigned long ProcessorFlags;
save_flags(ProcessorFlags);
sti();
while (--Seconds >= 0) {
int i = 1000;
do {
udelay(1000);
} while (--i);
}
while (--Milliseconds >= 0) udelay(1000);
restore_flags(ProcessorFlags);
}
......
......@@ -85,7 +85,7 @@ fi
if [ "$CONFIG_MCA" = "y" ]; then
dep_tristate 'IBMMCA SCSI support' CONFIG_SCSI_IBMMCA $CONFIG_SCSI
if [ "$CONFIG_SCSI_IBMMCA" != "n" ]; then
bool ' reset SCSI-devices while booting' SCSI_IBMMCA_DEV_RESET
bool ' reset SCSI-devices while booting' CONFIG_SCSI_IBMMCA_DEV_RESET
fi
fi
if [ "$CONFIG_PARPORT" != "n" ]; then
......
......@@ -199,11 +199,10 @@
5) Magneto-Optical drives and medium-changers are also recognized, now.
Therefore, we have a completely gapfree recognition of all SCSI-
device-types, that are known by Linux up to kernel 2.1.31.
6) The flag SCSI_IBMMCA_DEV_RESET has been inserted. If it is set within
the configuration, each connected SCSI-device will get a reset command
during boottime. This can be necessary for some special SCSI-devices.
This flag should be included in Config.in.
(See also the new Config.in file.)
6) The flag CONFIG_SCSI_IBMMCA_DEV_RESET has been inserted. If it is set
within the configuration, each connected SCSI-device will get a reset
command during boottime. This can be necessary for some special
SCSI-devices. (See also the new Config.in file.)
Probable next improvement: bad disk handler.
- Michael Lang
......@@ -1164,7 +1163,7 @@ static void check_devices (struct Scsi_Host *shpnt)
if (device_exists (shpnt, ldn, &ld[ldn].block_length,
&ld[ldn].device_type))
{
#ifdef SCSI_IBMMCA_DEV_RESET
#ifdef CONFIG_SCSI_IBMMCA_DEV_RESET
int ticks;
printk("(resetting)");
ticks = IM_RESET_DELAY*HZ;
......
......@@ -109,10 +109,10 @@ else
endif
endif
ifeq ($(CONFIG_ADLIB),y)
ifeq ($(CONFIG_MSS),y)
LX_OBJS += ad1848.o
else
ifeq ($(CONFIG_ADLIB),m)
ifeq ($(CONFIG_MSS),m)
MX_OBJS += ad1848.o
endif
endif
......
......@@ -1539,10 +1539,11 @@ DMAbuf_deinit(int dev)
{
/* This routine is called when driver is being unloaded */
#ifdef RUNTIME_DMA_ALLOC
sound_free_dmap (dev, audio_devs[dev]->dmap_out,
audio_devs[dev]->dmap_out->dma);
if (audio_devs[dev])
sound_free_dmap (dev, audio_devs[dev]->dmap_out,
audio_devs[dev]->dmap_out->dma);
if (audio_devs[dev]->flags & DMA_DUPLEX)
if (audio_devs[dev] && audio_devs[dev]->flags & DMA_DUPLEX)
sound_free_dmap (dev, audio_devs[dev]->dmap_in,
audio_devs[dev]->dmap_in->dma);
#endif
......
......@@ -116,17 +116,15 @@ probe_pss(struct address_info *hw_config)
if (devc->base != 0x230 && devc->base != 0x250) /* Some cards use these */
return 0;
if (check_region(devc->base, 16))
{
printk("PSS: I/O port conflict\n");
return 0;
}
if (check_region(devc->base, 16)) {
printk(KERN_ERR "PSS: I/O port conflict\n");
return 0;
}
id = inw(REG(PSS_ID));
if ((id >> 8) != 'E')
{
/* printk( "No PSS signature detected at 0x%x (0x%x)\n", devc->base, id); */
return 0;
}
if ((id >> 8) != 'E') {
printk(KERN_ERR "No PSS signature detected at 0x%x (0x%x)\n", devc->base, id);
return 0;
}
return 1;
}
......@@ -855,14 +853,28 @@ unload_pss_mss(struct address_info *hw_config)
#ifdef MODULE
int io = -1;
int irq = -1;
int dma = -1;
int pss_io = 0x220;
int mss_io = 0x530;
int mss_irq = 11;
int mss_dma = 1;
int pssmpu, pssmss;
struct address_info cfg;
int mpu_io = 0x330;
int mpu_irq = -1;
struct address_info cfgpss = { 0 /* pss_io */, 0, -1, -1 };
struct address_info cfgmpu = { 0 /* mpu_io */, 0 /* mpu_irq */, 0, -1 };
struct address_info cfgmss = { 0 /* mss_io */, 0 /* mss_irq */, 0 /* mss_dma */, -1 };
MODULE_PARM(pss_io, "i");
MODULE_PARM(mss_io, "i");
MODULE_PARM(mss_irq, "i");
MODULE_PARM(mss_dma, "i");
MODULE_PARM(mpu_io, "i");
MODULE_PARM(mpu_irq, "i");
static int fw_load = 0;
static int pssmpu = 0, pssmss = 0;
/*
* Load a PSS sound card module
......@@ -871,34 +883,39 @@ static int fw_load = 0;
int
init_module(void)
{
if (io == -1 || irq == -1 || dma == -1)
{
#if 0
if (pss_io == -1 || irq == -1 || dma == -1) {
printk("pss: dma, irq and io must be set.\n");
return -EINVAL;
}
cfg.io_base = io;
cfg.irq = irq;
}
#endif
cfgpss.io_base = pss_io;
if (!pss_synth)
{
fw_load = 1;
pss_synthLen = mod_firmware_load("/etc/sound/pss_synth", (void *) &pss_synth);
}
if (probe_pss(&cfg))
cfgmss.io_base = mss_io;
cfgmss.irq = mss_irq;
cfgmss.dma = mss_dma;
cfgmpu.io_base = mpu_io;
cfgmpu.irq = mpu_irq;
if (!pss_synth) {
fw_load = 1;
pss_synthLen = mod_firmware_load("/etc/sound/pss_synth", (void *) &pss_synth);
}
if (!probe_pss(&cfgpss))
return -ENODEV;
attach_pss(&cfgpss);
/*
* Attach stuff
*/
if (probe_pss_mpu(&cfg))
{
pssmpu = 1;
attach_pss_mpu(&cfg);
}
if (probe_pss_mss(&cfg))
{
pssmss = 1;
attach_pss_mss(&cfg);
}
if (probe_pss_mpu(&cfgmpu)) {
pssmpu = 1;
attach_pss_mpu(&cfgmpu);
}
if (probe_pss_mss(&cfgmss)) {
pssmss = 1;
attach_pss_mss(&cfgmss);
}
SOUND_LOCK;
return 0;
}
......@@ -909,10 +926,10 @@ cleanup_module(void)
if (fw_load && pss_synth)
kfree(pss_synth);
if (pssmss)
unload_pss_mss(&cfg);
unload_pss_mss(&cfgmss);
if (pssmpu)
unload_pss_mpu(&cfg);
unload_pss(&cfg);
unload_pss_mpu(&cfgmpu);
unload_pss(&cfgpss);
SOUND_LOCK_END;
}
#endif
......
......@@ -42,31 +42,35 @@ void autofs_catatonic_mode(struct autofs_sb_info *sbi)
static int autofs_write(struct file *file, const void *addr, int bytes)
{
unsigned long fs;
unsigned long old_signal;
unsigned long fs, sigpipe, flags;
const char *data = (const char *)addr;
int written = 0;
ssize_t wr = 0;
/** WARNING: this is not safe for writing more than PIPE_BUF bytes! **/
sigpipe = sigismember(&current->signal, SIGPIPE);
/* Save pointer to user space and point back to kernel space */
fs = get_fs();
set_fs(KERNEL_DS);
old_signal = current->signal;
while ( bytes && (written = file->f_op->write(file,data,bytes,&file->f_pos)) > 0 ) {
data += written;
bytes -= written;
while (bytes &&
(wr = file->f_op->write(file,data,bytes,&file->f_pos)) > 0) {
data += wr;
bytes -= wr;
}
if ( written == -EPIPE && !(old_signal & (1 << (SIGPIPE-1))) ) {
/* Keep the currently executing process from receiving a
SIGPIPE unless it was already supposed to get one */
current->signal &= ~(1 << (SIGPIPE-1));
}
set_fs(fs);
/* Keep the currently executing process from receiving a
SIGPIPE unless it was already supposed to get one */
if (wr == -EPIPE && !sigpipe) {
spin_lock_irqsave(&current->sigmask_lock, flags);
sigdelset(&current->signal, SIGPIPE);
recalc_sigpending(current);
spin_unlock_irqrestore(&current->sigmask_lock, flags);
}
return (bytes > 0);
}
......
......@@ -1944,7 +1944,10 @@ int bdflush(void * unused)
/* If there are still a lot of dirty buffers around, skip the sleep
and flush some more */
if(ndirty == 0 || nr_buffers_type[BUF_DIRTY] <= nr_buffers * bdf_prm.b_un.nfract/100) {
current->signal = 0;
spin_lock_irq(&current->sigmask_lock);
flush_signals(current);
spin_unlock_irq(&current->sigmask_lock);
interruptible_sleep_on(&bdflush_wait);
}
}
......
......@@ -129,7 +129,7 @@ void dput(struct dentry *dentry)
return;
}
printk("Negative d_count (%d) for %s/%s\n",
printk(KERN_CRIT "Negative d_count (%d) for %s/%s\n",
count,
dentry->d_parent->d_name.name,
dentry->d_name.name);
......@@ -378,7 +378,7 @@ static int select_parent(struct dentry * parent)
if (!list_empty(&dentry->d_subdirs)) {
this_parent = dentry;
#ifdef DCACHE_DEBUG
printk("select_parent: descending to %s/%s, found=%d\n",
printk(KERN_DEBUG "select_parent: descending to %s/%s, found=%d\n",
dentry->d_parent->d_name.name, dentry->d_name.name, found);
#endif
goto repeat;
......@@ -391,7 +391,7 @@ dentry->d_parent->d_name.name, dentry->d_name.name, found);
next = this_parent->d_child.next;
this_parent = this_parent->d_parent;
#ifdef DCACHE_DEBUG
printk("select_parent: ascending to %s/%s, found=%d\n",
printk(KERN_DEBUG "select_parent: ascending to %s/%s, found=%d\n",
this_parent->d_parent->d_name.name, this_parent->d_name.name, found);
#endif
goto resume;
......@@ -439,7 +439,7 @@ void check_dcache_memory()
goal = 50;
count = select_dcache(32, goal);
#ifdef DCACHE_DEBUG
printk("check_dcache_memory: goal=%d, count=%d\n", goal, count);
printk(KERN_DEBUG "check_dcache_memory: goal=%d, count=%d\n", goal, count);
#endif
if (count) {
prune_dcache(count);
......@@ -678,7 +678,7 @@ void d_add(struct dentry * entry, struct inode * inode)
void d_move(struct dentry * dentry, struct dentry * target)
{
if (!dentry->d_inode)
printk("VFS: moving negative dcache entry\n");
printk(KERN_WARNING "VFS: moving negative dcache entry\n");
/* Move the dentry to the target hash queue */
list_del(&dentry->d_hash);
......
......@@ -459,18 +459,10 @@ static inline int make_private_signals(void)
* so that a new one can be started
*/
static inline void flush_old_signals(struct signal_struct *sig)
static inline void flush_old_signals(struct task_struct *t)
{
int i;
struct sigaction * sa = sig->action;
for (i=32 ; i != 0 ; i--) {
sa->sa_mask = 0;
sa->sa_flags = 0;
if (sa->sa_handler != SIG_IGN)
sa->sa_handler = NULL;
sa++;
}
flush_signals(t);
flush_signal_handlers(t);
}
static inline void flush_old_files(struct files_struct * files)
......@@ -531,7 +523,7 @@ int flush_old_exec(struct linux_binprm * bprm)
permission(bprm->dentry->d_inode,MAY_READ))
current->dumpable = 0;
flush_old_signals(current->sig);
flush_old_signals(current);
flush_old_files(current->files);
return 0;
......
......@@ -178,7 +178,7 @@ static void send_sigio(int pid, uid_t uid, uid_t euid)
(euid ^ p->suid) && (euid ^ p->uid) &&
(uid ^ p->suid) && (uid ^ p->uid))
continue;
p->signal |= 1 << (SIGIO-1);
send_sig(SIGIO, p, 1);
if (p->state == TASK_INTERRUPTIBLE && signal_pending(p))
wake_up_process(p);
}
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -44,6 +44,7 @@ struct thread_struct {
/* bit 1..5: IEEE_TRAP_ENABLE bits (see fpu.h) */
/* bit 6..8: UAC bits (see sysinfo.h) */
/* bit 17..21: IEEE_STATUS_MASK bits (see fpu.h) */
/* bit 63: die_if_kernel recursion lock */
unsigned long flags;
/* perform syscall argument validation (get/set_fs) */
unsigned long fs;
......
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