Commit a89a2558 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.3.41

parent c6545c79
VERSION = 1
PATCHLEVEL = 3
SUBLEVEL = 40
SUBLEVEL = 41
ARCH = i386
......@@ -323,5 +323,5 @@ include Rules.make
.hdepend: dummy
rm -f $@
$(AWK) -f scripts/depend.awk `find $(HPATH) -name \*.h -print` > .$@
$(AWK) -f scripts/depend.awk `find $(HPATH) -name \*.h ! -name modversions.h -print` > .$@
mv .$@ $@
......@@ -6,10 +6,19 @@
# General setup
#
CONFIG_NATIVE=y
# CONFIG_ALPHA_AVANTI is not set
# CONFIG_ALPHA_JENSEN is not set
# CONFIG_ALPHA_NONAME is not set
CONFIG_ALPHA_CABRIOLET=y
# CONFIG_ALPHA_EB66 is not set
# CONFIG_ALPHA_EB66P is not set
# CONFIG_ALPHA_EB64 is not set
# CONFIG_ALPHA_EB64P is not set
# CONFIG_ALPHA_SRM is not set
CONFIG_PCI=y
CONFIG_ALPHA_APECS=y
# CONFIG_SERIAL_ECHO is not set
# CONFIG_TGA_CONSOLE is not set
CONFIG_PCI_OPTIMIZE=y
CONFIG_NET=y
CONFIG_SYSVIPC=y
......@@ -31,8 +40,8 @@ CONFIG_ST506=y
#
# CONFIG_BLK_DEV_HD is not set
CONFIG_BLK_DEV_IDE=y
# CONFIG_BLK_DEV_TRITON is not set
# CONFIG_BLK_DEV_IDECD is not set
# CONFIG_BLK_DEV_TRITON is not set
# CONFIG_BLK_DEV_XD is not set
#
......@@ -43,7 +52,6 @@ CONFIG_INET=y
# CONFIG_IP_FORWARD is not set
# CONFIG_IP_MULTICAST is not set
# CONFIG_IP_ACCT is not set
# CONFIG_NET_IPIP is not set
#
# (it is safe to leave these untouched)
......@@ -120,6 +128,7 @@ CONFIG_DUMMY=m
CONFIG_NET_EISA=y
# CONFIG_APRICOT is not set
CONFIG_DE4X5=y
# CONFIG_ETH16 is not set
# CONFIG_ZNET is not set
# CONFIG_NET_POCKET is not set
# CONFIG_TR is not set
......
......@@ -9,7 +9,6 @@
#define __ASSEMBLY__
#include <asm/system.h>
#include <linux/fd.h>
#define halt .long PAL_halt
......
......@@ -21,6 +21,7 @@
#include <linux/a.out.h>
#include <linux/tty.h>
#include <linux/delay.h>
#include <linux/config.h> /* CONFIG_ALPHA_LCA etc */
#include <asm/segment.h>
#include <asm/system.h>
......@@ -66,24 +67,6 @@ struct screen_info screen_info = {
16 /* orig-video-points */
};
/*
* Initialize Programmable Interval Timers with standard values. Some
* drivers depend on them being initialized (e.g., joystick driver).
*/
static void init_pit (void)
{
outb(0x54, 0x43); /* counter 1: refresh timer */
outb(0x18, 0x41);
outb(0x36, 0x43); /* counter 0: system timer */
outb(0x00, 0x40);
outb(0x00, 0x40);
outb(0xb6, 0x43); /* counter 2: speaker */
outb(0x31, 0x42);
outb(0x13, 0x42);
}
static unsigned long find_end_memory(void)
{
int i;
......@@ -110,8 +93,6 @@ void setup_arch(char **cmdline_p,
{
extern int _end;
init_pit();
hwrpb = (struct hwrpb_struct*)(IDENT_ADDR + INIT_HWRPB->phys_addr);
set_hae(hae.cache); /* sync HAE register w/hae_cache */
......
......@@ -4,7 +4,6 @@
* Copyright (C) 1995 Linus Torvalds
*/
#include <linux/config.h>
#include <linux/signal.h>
#include <linux/sched.h>
#include <linux/head.h>
......
......@@ -3015,7 +3015,7 @@ static inline void clear_write_error(int drive)
CLEARSTRUCT(UDRWE);
}
static inline int set_geometry(int cmd, struct floppy_struct *g,
static inline int set_geometry(unsigned int cmd, struct floppy_struct *g,
int drive, int type, int device)
{
int cnt;
......@@ -3114,14 +3114,14 @@ static inline int normalize_0x02xx_ioctl(int *cmd, int *size)
{
int i, orig_size, ocmd;
orig_size = IOC_SIZE(*cmd);
orig_size = _IOC_SIZE(*cmd);
ocmd = *cmd;
for (i=0; i < ARRAY_SIZE(translation_table); i++) {
if ((*cmd & 0xff3f) == (translation_table[i].newcmd & 0xff3f)){
*cmd = translation_table[i].newcmd;
if (!orig_size && IOC_SIZE(*cmd)) {
/* kernels 1.3.34 to 1.3.37 : */
*size = IOC_SIZE(*cmd);
if (!orig_size && _IOC_SIZE(*cmd)) {
/* kernels 1.3.34 to 1.3.39 : */
*size = _IOC_SIZE(*cmd);
DPRINT1("warning: obsolete ioctl 0x%x\n",ocmd);
DPRINT("please recompile your program\n");
/* these ioctls only existed
......@@ -3132,7 +3132,7 @@ static inline int normalize_0x02xx_ioctl(int *cmd, int *size)
*/
} else {
*size = orig_size;
if (*size > IOC_SIZE(*cmd)) {
if (*size > _IOC_SIZE(*cmd)) {
printk("ioctl not yet supported\n");
return -EFAULT;
}
......@@ -3261,7 +3261,7 @@ static int fd_ioctl(struct inode *inode, struct file *filp, unsigned int cmd,
case FDGETDRVTYP:
outparam = drive_name(type,drive);
SUPBOUND(size,strlen(outparam));
SUPBOUND(size,strlen(outparam)+1);
break;
IN(FDSETDRVPRM, UDP, dp);
......
......@@ -59,21 +59,26 @@
DOS DRIVERS .... Accuracy counts... speed is secondary ;)
17 June 95 Modifications By Andrew J. Kroll <ag784@freenet.buffalo.edu>
07 July 1995 Modifications by Andrew J. Kroll
0.6
8 November 95 More Modifications By Andrew J. Kroll
Media change detect now works :) That means that SuperMount and
other programs that depend on this will now work!
You are welcome in advance! You will notice, however that you don't
always get the kernel message saying "VFS: Disk change detected on
device", so I'm not sure that it's *PERFECT* but it does seem to
actually work! What else should I add?
*/
#include <linux/config.h>
#ifdef MODULE
# include <linux/module.h>
#endif
#include <linux/version.h>
#include <linux/module.h>
#ifdef MODULE
# ifndef CONFIG_MODVERSIONS
char kernel_version[]= UTS_RELEASE;
# endif
#define mcd_init init_module
#else
# define MOD_INC_USE_COUNT
# define MOD_DEC_USE_COUNT
#endif
#include <linux/errno.h>
#include <linux/signal.h>
......@@ -138,28 +143,30 @@ static int mcdPresent = 0;
#endif
/* #define DOUBLE_QUICK_ONLY */
#define CURRENT_VALID \
(CURRENT && MAJOR(CURRENT -> rq_dev) == MAJOR_NR && CURRENT -> cmd == READ \
&& CURRENT -> sector != -1)
#if LINUX_VERSION_CODE < 66338
#define CURRENT_VALID \
(CURRENT && MAJOR(CURRENT -> dev) == MAJOR_NR && CURRENT -> cmd == READ \
&& CURRENT -> sector != -1)
#else
#define CURRENT_VALID \
(CURRENT && MAJOR(CURRENT -> rq_dev) == MAJOR_NR && CURRENT -> cmd == READ \
&& CURRENT -> sector != -1)
#endif
#define MFL_STATUSorDATA (MFL_STATUS | MFL_DATA)
#define MCD_BUF_SIZ 16
static volatile int mcd_transfer_is_active;
/* Are you sleeping, Are you sleeping, Brother John, Brother John? ;) */
static volatile int sleeping_for_status;
static char mcd_buf[2048*MCD_BUF_SIZ]; /* buffer for block size conversion */
static volatile int mcd_buf_bn[MCD_BUF_SIZ], mcd_next_bn;
static volatile int mcd_buf_in, mcd_buf_out = -1;
static volatile int mcd_error;
static int mcd_open_count;
enum mcd_state_e {
MCD_S_IDLE, /* 0 */
MCD_S_START, /* 1 */
MCD_S_MODE, /* 2 */
MCD_S_READ, /* 3 */
MCD_S_DATA, /* 4 */
MCD_S_STOP, /* 5 */
MCD_S_IDLE, /* 0 */
MCD_S_START, /* 1 */
MCD_S_MODE, /* 2 */
MCD_S_READ, /* 3 */
MCD_S_DATA, /* 4 */
MCD_S_STOP, /* 5 */
MCD_S_STOPPING /* 6 */
};
static volatile enum mcd_state_e mcd_state = MCD_S_IDLE;
......@@ -214,7 +221,35 @@ void mcd_setup(char *str, int *ints)
mitsumi_bug_93_wait = ints[3];
#endif /* WORK_AROUND_MITSUMI_BUG_93 */
}
static int
#if LINUX_VERSION_CODE < 66338
check_mcd_change(dev_t full_dev)
#else
check_mcd_change(kdev_t full_dev)
#endif
{
int retval, target;
#if 1 /* the below is not reliable */
return 0;
#endif
target = MINOR(full_dev);
if (target > 0) {
printk("mcd: Mitsumi CD-ROM request error: invalid device.\n");
return 0;
}
retval = mcdDiskChanged;
mcdDiskChanged = 0;
return retval;
}
/*
* Do a 'get status' command and get the result. Only use from the top half
* because it calls 'getMcdStatus' which sleeps.
......@@ -237,69 +272,6 @@ statusCmd(void)
return st;
}
/*
* This detects a media change on the CD ROM.
* We need to grab the status right off the drive in here.
* Before, it ALWAYS returned a value of 0, which was not right!
*/
static int
check_mcd_change(dev_t full_dev)
{
int retval, target, st, count;
st = -1;
target = MINOR(full_dev);
if (target > 0)
{
printk("mcd: Mitsumi CD-ROM request error: invalid device.\n");
return 0;
}
/*
* SOMETIMES it changes, sometimes not! Well, here we FIX that little nasty!
* All we need to do is read the status from the drive without spamming the
* kernel! In other words, this routine CANNOT sleep!
* The kernel will automagically picks up on this now.
* Devilishly sneaky it is! 8) -- AJK
*/
if ((!mcd_transfer_is_active) &&
(!sleeping_for_status) &&
(mcd_state == MCD_S_IDLE)) /* YES I'm paraniod! :) */
{
outb(MCMD_GET_STATUS, MCDPORT(0)); /* send get-status cmd */
for (count = 0; count < 3000; count++) /* wait for the status */
{
if (!(inb(MCDPORT(1)) & MFL_STATUS))
break;
}
if (count >= 3000) /* Did we time out? */
{
retval = mcdDiskChanged; /* We can just jump out of here */
mcdDiskChanged = 0; /* as it's not needed all the time. */
return retval; /* So we pretend nothing happened here! ;) */
}
st=inb(MCDPORT(0)) & 0xFF ; /* Read the status in... */
/* okay... here's that magic part! Muhuhuhuh...*/
if (st & MST_DSK_CHG) /* Devil made me do it! O];) */
{
mcdDiskChanged = 1; /* Show a change. */
audioStatus = CDROM_AUDIO_NO_STATUS; /* just incase... */
tocUpToDate = 0; /* Frantic laughing continues... */
mcd_invalidate_buffers(); /* 666 wins! */
} /* Stupid comments are fun! */
}
retval = mcdDiskChanged; /* Indicate status. */
mcdDiskChanged = 0; /* Go, now. Enjoy a good beer! */
return retval; /* The End. */
}
/*
* Send a 'Play' command and get the status. Use only from the top half.
......@@ -1217,7 +1189,7 @@ mcd_init(void)
{
int count;
unsigned char result[3];
sleeping_for_status = 0;
if (mcd_port <= 0 || mcd_irq <= 0) {
printk("skip mcd_init\n");
return -EIO;
......@@ -1419,14 +1391,10 @@ getMcdStatus(int timeout)
McdTimeout = timeout;
SET_TIMER(mcdStatTimer, 1);
sleeping_for_status = 1;
sleep_on(&mcd_waitq);
sleep_on(&mcd_waitq);
if (McdTimeout <= 0)
{
sleeping_for_status = 0;
return -1;
}
sleeping_for_status = 0;
return -1;
st = inb(MCDPORT(0)) & 0xFF;
if (st == 0xFF)
return -1;
......@@ -1662,13 +1630,11 @@ Toc[i].diskTime.min, Toc[i].diskTime.sec, Toc[i].diskTime.frame);
}
#ifdef MODULE
int init_module(void)
{
return mcd_init();
}
void cleanup_module(void)
{
{ if (MOD_IN_USE)
{ printk("mcd module in use - can't remove it.\n");
return;
}
if ((unregister_blkdev(MAJOR_NR, "mcd") == -EINVAL))
{ printk("What's that: can't unregister mcd\n");
return;
......
This diff is collapsed.
......@@ -4,7 +4,7 @@
mainmenu_option next_comment
comment 'character devices'
bool 'Cyclades async mux support' CONFIG_CYCLADES
tristate 'Cyclades async mux support' CONFIG_CYCLADES
bool 'Stallion multiport serial support' CONFIG_STALDRV
if [ "$CONFIG_STALDRV" = "y" ]; then
tristate ' Stallion EasyIO or EC8/32 support' CONFIG_STALLION
......
......@@ -20,8 +20,12 @@ L_OBJS := tty_io.o n_tty.o console.o keyboard.o serial.o \
tty_ioctl.o pty.o vt.o mem.o vc_screen.o random.o \
defkeymap.o consolemap.o selection.o
ifdef CONFIG_CYCLADES
ifeq ($(CONFIG_CYCLADES),y)
L_OBJS += cyclades.o
else
ifeq ($(CONFIG_CYCLADES),m)
M_OBJS += cyclades.o
endif
endif
ifeq ($(CONFIG_STALLION),y)
......
......@@ -223,6 +223,8 @@ static char rcsid[] =
*
*/
#include <linux/module.h>
#include <linux/errno.h>
#include <linux/signal.h>
#include <linux/sched.h>
......@@ -404,7 +406,6 @@ static int startup (struct cyclades_port *);
static void cy_throttle(struct tty_struct *);
static void cy_unthrottle(struct tty_struct *);
static void config_setup(struct cyclades_port *);
extern void console_print(const char *);
#ifdef CYCLOM_SHOW_STATUS
static void show_status(int);
#endif
......@@ -466,7 +467,6 @@ void CP2(int data) { CP1((data>>4) & 0x0f); CP1( data & 0x0f); }/* CP2 */
void CP4(int data) { CP2((data>>8) & 0xff); CP2(data & 0xff); }/* CP4 */
void CP8(long data) { CP4((data>>16) & 0xffff); CP4(data & 0xffff); }/* CP8 */
/* This routine waits up to 1000 micro-seconds for the previous
command to the Cirrus chip to complete and then issues the
new command. An error is returned if the previous command
......@@ -583,6 +583,7 @@ cy_sched_event(struct cyclades_port *info, int event)
} /* cy_sched_event */
static int probe_ready;
/*
* This interrupt routine is used
......@@ -594,6 +595,9 @@ cy_probe(int irq, struct pt_regs *regs)
int save_xir, save_car;
int index = 0; /* probing interrupts is only for ISA */
if (!probe_ready)
return;
cy_irq_triggered = irq;
cy_triggered |= 1 << irq;
......@@ -1107,6 +1111,7 @@ get_auto_irq(unsigned char *address)
base_addr[CyCAR<<index] = 0;
write_cy_cmd(base_addr,CyCHAN_CTL|CyENB_XMTR,index);
base_addr[CySRER<<index] |= CyTxMpty;
probe_ready = 1;
sti();
timeout = jiffies+2;
......@@ -1114,6 +1119,7 @@ get_auto_irq(unsigned char *address)
if (cy_irq_triggered)
break;
}
probe_ready = 0;
return(cy_irq_triggered);
} /* get_auto_irq */
......@@ -1132,6 +1138,8 @@ do_auto_irq(unsigned char *address)
/* Turn on interrupts (they may be off) */
save_flags(flags); sti();
probe_ready = 0;
cy_wild_int_mask = check_wild_interrupts();
irq_lines = grab_all_interrupts(cy_wild_int_mask);
......@@ -2286,6 +2294,7 @@ static void
cy_close(struct tty_struct * tty, struct file * filp)
{
struct cyclades_port * info = (struct cyclades_port *)tty->driver_data;
unsigned long flags;
/* CP('C'); */
#ifdef SERIAL_DEBUG_OTHER
......@@ -2300,6 +2309,14 @@ cy_close(struct tty_struct * tty, struct file * filp)
printk("cy_close ttyC%d, count = %d\n", info->line, info->count);
#endif
save_flags(flags); cli();
/* If the TTY is being hung up, nothing to do */
if (tty_hung_up_p(filp)) {
restore_flags(flags);
return;
}
if ((tty->count == 1) && (info->count != 1)) {
/*
* Uh, oh. tty->count is 1, which means that the tty
......@@ -2313,7 +2330,7 @@ cy_close(struct tty_struct * tty, struct file * filp)
info->count = 1;
}
#ifdef SERIAL_DEBUG_COUNT
printk("cyc: %d: decrementing count to %d\n", __LINE__, info->count - 1);
printk("cyc: %d(%d): decrementing count to %d\n", __LINE__, current->pid, info->count - 1);
#endif
if (--info->count < 0) {
#ifdef SERIAL_DEBUG_COUNT
......@@ -2322,7 +2339,11 @@ cy_close(struct tty_struct * tty, struct file * filp)
info->count = 0;
}
if (info->count)
{
MOD_DEC_USE_COUNT;
restore_flags(flags);
return;
}
info->flags |= ASYNC_CLOSING;
/*
* Save the termios structure, since this port may have
......@@ -2341,14 +2362,6 @@ cy_close(struct tty_struct * tty, struct file * filp)
tty->ldisc.flush_buffer(tty);
info->event = 0;
info->tty = 0;
if (tty->ldisc.num != ldiscs[N_TTY].num) {
if (tty->ldisc.close)
(tty->ldisc.close)(tty);
tty->ldisc = ldiscs[N_TTY];
tty->termios->c_line = N_TTY;
if (tty->ldisc.open)
(tty->ldisc.open)(tty);
}
if (info->blocked_open) {
if (info->close_delay) {
current->state = TASK_INTERRUPTIBLE;
......@@ -2365,6 +2378,8 @@ cy_close(struct tty_struct * tty, struct file * filp)
printk("cy_close done\n");
#endif
MOD_DEC_USE_COUNT;
restore_flags(flags);
return;
} /* cy_close */
......@@ -2384,14 +2399,12 @@ cy_hangup(struct tty_struct *tty)
return;
shutdown(info);
#if 0
info->event = 0;
info->count = 0;
#ifdef SERIAL_DEBUG_COUNT
printk("cyc: %d: setting count to 0\n", __LINE__);
printk("cyc: %d(%d): setting count to 0\n", __LINE__, current->pid);
#endif
info->tty = 0;
#endif
info->flags &= ~(ASYNC_NORMAL_ACTIVE|ASYNC_CALLOUT_ACTIVE);
wake_up_interruptible(&info->open_wait);
} /* cy_hangup */
......@@ -2477,7 +2490,7 @@ block_til_ready(struct tty_struct *tty, struct file * filp,
#endif
info->count--;
#ifdef SERIAL_DEBUG_COUNT
printk("cyc: %d: decrementing count to %d\n", __LINE__, info->count);
printk("cyc: %d(%d): decrementing count to %d\n", __LINE__, current->pid, info->count);
#endif
info->blocked_open++;
......@@ -2537,7 +2550,7 @@ block_til_ready(struct tty_struct *tty, struct file * filp,
if (!tty_hung_up_p(filp)){
info->count++;
#ifdef SERIAL_DEBUG_COUNT
printk("cyc: %d: incrementing count to %d\n", __LINE__, info->count);
printk("cyc: %d(%d): incrementing count to %d\n", __LINE__, current->pid, info->count);
#endif
}
info->blocked_open--;
......@@ -2581,7 +2594,7 @@ cy_open(struct tty_struct *tty, struct file * filp)
#endif
info->count++;
#ifdef SERIAL_DEBUG_COUNT
printk("cyc: %d: incrementing count to %d\n", __LINE__, info->count);
printk("cyc: %d(%d): incrementing count to %d\n", __LINE__, current->pid, info->count);
#endif
tty->driver_data = info;
info->tty = tty;
......@@ -2622,6 +2635,7 @@ cy_open(struct tty_struct *tty, struct file * filp)
#ifdef SERIAL_DEBUG_OPEN
printk("cy_open done\n");/**/
#endif
MOD_INC_USE_COUNT;
return 0;
} /* cy_open */
......@@ -2736,7 +2750,6 @@ cy_init(void)
struct cyclades_card *cinfo;
int board,port,i;
scrn[1] = '\0';
show_version();
/* Initialize the tty_driver structure */
......@@ -2877,6 +2890,33 @@ scrn[1] = '\0';
} /* cy_init */
#ifdef MODULE
int
init_module(void)
{
return(cy_init());
}
void
cleanup_module(void)
{
int i;
if (tty_unregister_driver(&cy_callout_driver))
printk("Couldn't unregister Cyclom callout driver\n");
if (tty_unregister_driver(&cy_serial_driver))
printk("Couldn't unregister Cyclom serial driver\n");
for (i = 0; i < NR_CARDS; i++) {
if (cy_card[i].base_addr != 0)
{
free_irq(cy_card[i].irq);
}
}
}
#endif
/*
* ---------------------------------------------------------------------
* cy_detect_isa() - Probe for Cyclom-Y/ISA boards.
......
......@@ -10,7 +10,7 @@
* be here without 3C505 technical reference provided by
* 3Com.
*
* Version: @(#)3c505.c 0.8.1 26-Jun-95
* Version: @(#)3c505.c 0.8.3 12-Nov-95
*
* Authors: Linux 3c505 device driver by
* Craig Southeren, <craigs@ineluki.apana.org.au>
......@@ -103,7 +103,7 @@ static int elp_debug = 0;
* 3 = messages when interrupts received
*/
#define ELP_VERSION "0.8.1"
#define ELP_VERSION "0.8.3"
/*****************************************************************
*
......@@ -473,9 +473,13 @@ static void
adapter_hard_reset (struct device * dev)
{
int timeout;
long flags;
CHECK_NULL(dev);
save_flags(flags);
sti();
if (elp_debug > 0)
printk("%s: Resetting the adapter, please wait (approx 20 s)\n",
dev->name);
......@@ -507,6 +511,7 @@ adapter_hard_reset (struct device * dev)
for (timeout = jiffies + (100 * 15); jiffies <= timeout; )
if (GET_ASF(dev->base_addr) != ASF_PCB_END)
break;
restore_flags(flags);
}
/******************************************************
......@@ -1272,6 +1277,7 @@ elp_sense (struct device * dev)
int timeout;
int addr=dev->base_addr;
const char *name=dev->name;
long flags;
byte orig_HCR=inb_control(addr),
orig_HSR=inb_status(addr);
......@@ -1286,6 +1292,10 @@ elp_sense (struct device * dev)
return -1; /* It can't be 3c505 if HCR.DIR != HSR.DIR */
}
/* Enable interrupts - we need timers! */
save_flags(flags);
sti();
/* Wait for a while; the adapter may still be booting up */
if (elp_debug > 0)
printk(stilllooking_msg);
......@@ -1299,6 +1309,7 @@ elp_sense (struct device * dev)
timeout = jiffies+30;
while (jiffies < timeout)
;
restore_flags(flags);
if (inb_status(addr) & DIR) {
outb_control(orig_HCR,addr);
if (elp_debug > 0)
......@@ -1311,6 +1322,7 @@ elp_sense (struct device * dev)
timeout = jiffies+300;
while (jiffies < timeout)
;
restore_flags(flags);
if (!(inb_status(addr) & DIR)) {
outb_control(orig_HCR,addr);
if (elp_debug > 0)
......@@ -1462,8 +1474,8 @@ static struct device dev_3c505 = {
0, 0,
0, 0, 0, NULL, elplus_probe };
static int io = 0x300;
static int irq = 0;
int io = 0x300;
int irq = 0;
int init_module(void)
{
......
This diff is collapsed.
......@@ -1170,7 +1170,6 @@ static void eth16i_select_regbank(unsigned char banknbr, short ioaddr)
}
#ifdef MODULE
char kernel_version[] = UTS_RELEASE;
static char devicename[9] = { 0, };
static struct device dev_eth16i = {
devicename,
......
......@@ -168,8 +168,9 @@ struct pci_dev_info dev_info[] = {
DEVICE( ADAPTEC, ADAPTEC_7870, "AIC-7870"),
DEVICE( ADAPTEC, ADAPTEC_7871, "AIC-7871"),
DEVICE( ADAPTEC, ADAPTEC_7872, "AIC-7872"),
DEVICE( ADAPTEC, ADAPTEC_7880, "AIC-7880"),
DEVICE( ADAPTEC, ADAPTEC_7881, "AIC-7881"),
DEVICE( ADAPTEC, ADAPTEC_7880, "AIC-7880U"),
DEVICE( ADAPTEC, ADAPTEC_7881, "AIC-7881U"),
DEVICE( ADAPTEC, ADAPTEC_7882, "AIC-7882U"),
DEVICE( ATRONICS, ATRONICS_2015, "IDE-2015PL"),
DEVICE( HER, HER_STING, "Stingray"),
DEVICE( HER, HER_STINGARK, "Stingray ARK 2000PV")
......
This diff is collapsed.
......@@ -25,13 +25,14 @@
# optimizations provided by Justin T. Gibbs (gibbs@FreeBSD.org)
##-M#########################################################################
VERSION AIC7XXX_SEQ_VER "$Id: aic7xxx.seq,v 2.1 1995/08/30 07:47:07 deang Exp $"
VERSION AIC7XXX_SEQ_VER "$Id: aic7xxx.seq,v 2.3 1995/11/10 10:51:22 deang Exp $"
SCBMASK = 0xff
SCSISEQ = 0x00
ENRSELI = 0x10
SXFRCTL0 = 0x01
ULTRAEN = 0x20
SXFRCTL1 = 0x02
SCSISIGI = 0x03
SCSISIGO = 0x03
......@@ -229,7 +230,6 @@ ACTIVE_B = 0x55
SAVED_TCL = 0x56 # Temporary storage for the
# target/channel/lun of a
# reconnecting target
# After starting the selection hardware, we return to the "poll_for_work"
# loop so that we can check for reconnecting targets as well as for our
# selection to complete just in case the reselection wins bus arbitration.
......@@ -444,6 +444,7 @@ ITloop:
and A,0xe0,SCSISIGI # CDI|IOI|MSGI
mov A call scsisig
cmp ALLZEROS,A je p_dataout
cmp A,0x40 je p_datain
cmp A,0x80 je p_command
......@@ -454,7 +455,6 @@ ITloop:
mvi INTSTAT,BAD_PHASE # unknown - signal driver
p_dataout:
mvi 0 call scsisig # !CDO|!IOO|!MSGO
mvi DMAPARAMS,0x7d # WIDEODD|SCSIEN|SDMAEN|HDMAEN|
# DIRECTION|FIFORESET
jmp data_phase_init
......@@ -469,8 +469,7 @@ data_phase_reinit:
# Reads should not use WIDEODD since it may make the last byte for a SG segment
# go to the next segment.
p_datain:
mvi 0x40 call scsisig # !CDO|IOO|!MSGO
mvi DMAPARAMS,0x39 # SCSIEN|SDMAEN|HDMAEN|
mvi DMAPARAMS,0x79 # WIDEODD|SCSIEN|SDMAEN|HDMAEN|
# !DIRECTION|FIFORESET
data_phase_init:
call assert
......@@ -574,7 +573,6 @@ data_phase_finish:
# so we can copy those three bytes directly into HCNT.
#
p_command:
mvi 0x80 call scsisig # CDO|!IOO|!MSGO
call assert
# Load HADDR and HCNT. We can do this in one bcopy since they are neighbors
......@@ -592,7 +590,6 @@ p_command:
# and store it into the SCB.
#
p_status:
mvi 0xc0 call scsisig # CDO|IOO|!MSGO
mvi SCBARRAY+14 call inb_first
jmp mesgin_done
......@@ -601,7 +598,6 @@ p_status:
# took us into this phase anyway, build a no-op message and send it.
#
p_mesgout:
mvi 0xa0 call scsisig # CDO|!IOO|MSGO
mvi 0x8 call mk_mesg # build NOP message
clr STCNT+2
......@@ -661,7 +657,8 @@ p_mesgout5:
and A,0xe0,SCSISIGI # CDI|IOI|MSGI
cmp A,0xa0 jne p_mesgout6
mvi 0x10 call scsisig # ATNO - re-assert ATN
or SINDEX,0x10,SIGSTATE # turn on ATNO
call scsisig # ATNO - re-assert ATN
jmp ITloop
......@@ -679,7 +676,6 @@ p_mesgout6:
# to a data I/O phase.
#
p_mesgin:
mvi 0xe0 call scsisig # CDO|IOO|MSGO
mvi A call inb_first # read the 1st message byte
mvi REJBYTE,A # save it for the driver
......@@ -742,11 +738,12 @@ status_ok:
mov A,FUNCTION1
test SCBARRAY+1,0x88 jz clear_a
xor ACTIVE_B,A
jmp complete
jmp immediate
clear_a:
xor ACTIVE_A,A
immediate:
test SCBARRAY+11,0xff jnz complete # Immediate message complete
# Pause the sequencer until the driver gets around to handling the command
# complete. This is so that any action that might require carefull timing
......@@ -1011,7 +1008,8 @@ dma4:
# actually off first lest we get an ILLSADDR.
#
dma5:
clr DFCNTRL # disable DMA
and DFCNTRL, 0x40, SINDEX # disable DMA, but maintain
# WIDEODD
dma6:
test DFCNTRL,0x38 jnz dma6 # SCSIENACK|SDMAENACK|HDMAENACK
......@@ -1044,7 +1042,7 @@ initialize_for_target:
#
clr SIGSTATE
mvi SXFRCTL0,0x8a # DFON|SPIOEN|CLRCHN
or SXFRCTL0,0x8a # DFON|SPIOEN|CLRCHN
# Make sure that the system knows we have not been through a DATA
# phase.
......@@ -1205,7 +1203,8 @@ sdtr_to_rate_loop:
jmp sdtr_to_rate_loop
sdtr_to_rate_done:
shr RETURN_1,0x2
add RETURN_1,0x18 ret
add RETURN_1,0x18
test SXFRCTL0,ULTRAEN jz return
shr RETURN_1,0x1
return:
ret
......@@ -796,6 +796,7 @@ static void scsi_times_out (Scsi_Cmnd * SCpnt, int pid)
*/
printk("Unable to reset scsi host %d - ", SCpnt->host->host_no);
printk("probably a SCSI bus hang.\n");
SCpnt->internal_timeout &= ~IN_RESET;
scsi_reset (SCpnt, TRUE);
return;
......@@ -1834,6 +1835,26 @@ int scsi_abort (Scsi_Cmnd * SCpnt, int why, int pid)
}
}
/* Mark a single SCSI Device as having been reset. */
static inline void scsi_mark_device_reset(Scsi_Device *Device)
{
Device->was_reset = 1;
Device->expecting_cc_ua = 1;
}
/* Mark all SCSI Devices on a specific Host as having been reset. */
void scsi_mark_host_bus_reset(struct Scsi_Host *Host)
{
Scsi_Cmnd *SCpnt;
for(SCpnt = Host->host_queue; SCpnt; SCpnt = SCpnt->next)
scsi_mark_device_reset(SCpnt->device);
}
int scsi_reset (Scsi_Cmnd * SCpnt, int bus_reset_flag)
{
int temp, oldto;
......@@ -1934,28 +1955,21 @@ int scsi_reset (Scsi_Cmnd * SCpnt, int bus_reset_flag)
#ifdef DEBUG
printk("scsi reset function returned %d\n", temp);
#endif
if( temp & SCSI_RESET_BUS_RESET )
{
/*
* The low level driver did a bus reset, so we should
* go through and mark all of the devices on that bus
* as having been reset.
*/
SCpnt1 = host->host_queue;
while(SCpnt1) {
SCpnt1->device->was_reset = 1;
SCpnt1->device->expecting_cc_ua = 1;
SCpnt1 = SCpnt1->next;
}
}
/*
* Now figure out what we need to do, based upon
* what the low level driver said that it did.
* If the result is SCSI_RESET_SUCCESS, SCSI_RESET_PENDING,
* or SCSI_RESET_WAKEUP, then the low level driver did a
* bus device reset or bus reset, so we should go through
* and mark one or all of the devices on that bus
* as having been reset.
*/
switch(temp & SCSI_RESET_ACTION) {
case SCSI_RESET_SUCCESS:
if (temp & SCSI_RESET_BUS_RESET)
scsi_mark_host_bus_reset(host);
else scsi_mark_device_reset(SCpnt->device);
save_flags(flags);
cli();
SCpnt->internal_timeout &= ~IN_RESET;
......@@ -1963,12 +1977,18 @@ int scsi_reset (Scsi_Cmnd * SCpnt, int bus_reset_flag)
restore_flags(flags);
return 0;
case SCSI_RESET_PENDING:
if (temp & SCSI_RESET_BUS_RESET)
scsi_mark_host_bus_reset(host);
else scsi_mark_device_reset(SCpnt->device);
return 0;
case SCSI_RESET_PUNT:
SCpnt->internal_timeout &= ~IN_RESET;
scsi_request_sense (SCpnt);
return 0;
case SCSI_RESET_WAKEUP:
if (temp & SCSI_RESET_BUS_RESET)
scsi_mark_host_bus_reset(host);
else scsi_mark_device_reset(SCpnt->device);
SCpnt->internal_timeout &= ~IN_RESET;
scsi_request_sense (SCpnt);
/*
......
......@@ -449,6 +449,7 @@ extern void proc_print_scsidevice(Scsi_Device *, char *, int *, int);
extern void print_command(unsigned char *);
extern void print_sense(const char *, Scsi_Cmnd *);
extern void scsi_mark_host_bus_reset(struct Scsi_Host *Host);
#if defined(MAJOR_NR) && (MAJOR_NR != SCSI_TAPE_MAJOR)
#include "hosts.h"
......
......@@ -1133,6 +1133,12 @@ static int sd_init_onedisk(int i)
rscsi_disks[i].sector_size = (buffer[4] << 24) |
(buffer[5] << 16) | (buffer[6] << 8) | buffer[7];
if (rscsi_disks[i].sector_size == 0) {
rscsi_disks[i].sector_size = 512;
printk("sd%c : sector size 0 reported, assuming 512.\n", 'a' + i);
}
if (rscsi_disks[i].sector_size != 512 &&
rscsi_disks[i].sector_size != 1024 &&
......
......@@ -157,9 +157,9 @@ static int parse_options (char * options, unsigned long * sb_block,
clear_opt (*mount_options, CHECK_NORMAL);
clear_opt (*mount_options, CHECK_STRICT);
}
else if (strcmp (value, "normal"))
else if (!strcmp (value, "normal"))
set_opt (*mount_options, CHECK_NORMAL);
else if (strcmp (value, "strict")) {
else if (!strcmp (value, "strict")) {
set_opt (*mount_options, CHECK_NORMAL);
set_opt (*mount_options, CHECK_STRICT);
}
......
......@@ -81,7 +81,7 @@ static int parse_options(char *options,char *check,char *conversion,uid_t *uid,
*check = 'n';
*conversion = 'b';
*dotsOK =1;
*dotsOK =0;
*uid = current->uid;
*gid = current->gid;
*umask = current->fs->umask;
......
......@@ -100,37 +100,39 @@ __old_ipl; })
/*
* Give prototypes to shut up gcc.
*/
extern inline unsigned long xchg_u32 (volatile int * m, unsigned long new_val);
extern inline unsigned long xchg_u64 (volatile long * m, unsigned long new_val);
extern inline unsigned long xchg_u32 (volatile int * m, unsigned long val);
extern inline unsigned long xchg_u64 (volatile long * m, unsigned long val);
extern inline unsigned long xchg_u32(volatile int * m, unsigned long new_val)
extern inline unsigned long xchg_u32(volatile int * m, unsigned long val)
{
unsigned long old_val;
__asm__ __volatile__("\n1:\t"
"ldl_l %0,%2\n\t"
"bis %3,%3,$25\n\t"
"stl_c $25,%1\n\t"
"beq $25,1b\n"
: "=r"(old_val), "=m"(*m)
: "m"(*m), "r"(new_val)
: "$25");
return old_val;
unsigned long dummy, dummy2;
__asm__ __volatile__(
"\n1:\t"
"ldl_l %0,0(%1)\n\t"
"bis %2,%2,%3\n\t"
"stl_c %3,0(%1)\n\t"
"beq %3,1b\n"
: "=r" (val), "=r" (m), "=r" (dummy), "=r" (dummy2)
: "1" (m), "2" (val)
: "memory");
return val;
}
extern inline unsigned long xchg_u64(volatile long * m, unsigned long new_val)
extern inline unsigned long xchg_u64(volatile long * m, unsigned long val)
{
unsigned long old_val;
__asm__ __volatile__("\n1:\t"
"ldq_l %0,%2\n\t"
"bis %3,%3,$25\n\t"
"stq_c $25,%1\n\t"
"beq $25,1b\n"
: "=r"(old_val), "=m"(*m)
: "m"(*m), "r"(new_val)
: "$25");
return old_val;
unsigned long dummy, dummy2;
__asm__ __volatile__(
"\n1:\t"
"ldq_l %0,0(%1)\n\t"
"bis %2,%2,%3\n\t"
"stq_c %3,0(%1)\n\t"
"beq %3,1b\n"
: "=r" (val), "=r" (m), "=r" (dummy), "=r" (dummy2)
: "1" (m), "2" (val)
: "memory");
return val;
}
#define xchg(ptr,x) ((__typeof__(*(ptr)))__xchg((unsigned long)(x),(ptr),sizeof(*(ptr))))
......
......@@ -6,8 +6,6 @@
#ifndef _ASMI386_IOCTL_H
#define _ASMI386_IOCTL_H
#include <asm/page.h> /* for PAGE_SIZE */
/* ioctl command encoding: 32 bits total, command in lower 16 bits,
* size of the parameter structure in the lower 14 bits of the
* upper 16 bits.
......@@ -18,38 +16,6 @@
* NOTE: This limits the max parameter size to 16kB -1 !
*/
#define IOC_VOID 0x00000000 /* param in size field */
#define IOC_IN 0x40000000 /* user --> kernel */
#define IOC_OUT 0x80000000 /* kernel --> user */
#define IOC_INOUT (IOC_IN | IOC_OUT) /* both */
#define IOCSIZE_MASK 0x3fff0000 /* size (max 16k-1 bytes) */
#define IOCSIZE_SHIFT 16 /* how to get the size */
#define IOCSIZE_MAX ((PAGE_SIZE-1)&(IOCSIZE_MASK >> IOCSIZE_SHIFT))
#define IOCCMD_MASK 0x0000ffff /* command code */
#define IOCCMD_SHIFT 0
#define IOCPARM_MASK IOCCMD_MASK
#define IOCPARM_SHIFT IOCCMD_SHIFT
#define IOC_SIZE(cmd) (((cmd) & IOCSIZE_MASK) >> IOCSIZE_SHIFT)
#define IOCBASECMD(cmd) ((cmd) & ~IOCPARM_MASK)
#define IOCGROUP(cmd) (((cmd) >> 8) & 0xFF)
/* _IO(magic, subcode); size field is zero and the
* subcode determines the command.
*/
#define _IO(c,d) (IOC_VOID | ((c)<<8) | (d)) /* param encoded */
/* _IOXX(magic, subcode, arg_t); where arg_t is the type of the
* (last) argument field in the ioctl call, if present.
*/
#define _IOW(c,d,t) (IOC_IN | ((sizeof(t)<<16) & IOCSIZE_MASK) | \
((c)<<8) | (d))
#define _IOR(c,d,t) (IOC_OUT | ((sizeof(t)<<16) & IOCSIZE_MASK) | \
((c)<<8) | (d))
/* WR rather than RW to avoid conflict with stdio.h */
#define _IOWR(c,d,t) (IOC_INOUT | ((sizeof(t)<<16) & IOCSIZE_MASK) | \
((c)<<8) | (d))
/*
* The following is for compatibility across the various Linux
* platforms. The i386 ioctl numbering scheme doesn't really enforce
......@@ -80,10 +46,30 @@
#define _IOC_READ 1U
#define _IOC_WRITE 2U
#define _IOC(dir,type,nr,size) \
(((dir) << _IOC_DIRSHIFT) | \
((type) << _IOC_TYPESHIFT) | \
((nr) << _IOC_NRSHIFT) | \
((size) << _IOC_SIZESHIFT))
/* used to create numbers */
#define _IO(type,nr) _IOC(_IOC_NONE,(type),(nr),0)
#define _IOR(type,nr,size) _IOC(_IOC_READ,(type),(nr),sizeof(size))
#define _IOW(type,nr,size) _IOC(_IOC_WRITE,(type),(nr),sizeof(size))
#define _IOWR(type,nr,size) _IOC(_IOC_READ|_IOC_WRITE,(type),(nr),sizeof(size))
/* used to decode ioctl numbers.. */
#define _IOC_DIR(nr) (((nr) >> _IOC_DIRSHIFT) & _IOC_DIRMASK)
#define _IOC_TYPE(nr) (((nr) >> _IOC_TYPESHIFT) & _IOC_TYPEMASK)
#define _IOC_NR(nr) (((nr) >> _IOC_NRSHIFT) & _IOC_NRMASK)
#define _IOC_SIZE(nr) (((nr) >> _IOC_SIZESHIFT) & _IOC_SIZEMASK)
/* ...and for the drivers/sound files... */
#define IOC_IN (_IOC_WRITE << _IOC_DIRSHIFT)
#define IOC_OUT (_IOC_READ << _IOC_DIRSHIFT)
#define IOC_INOUT ((_IOC_WRITE|_IOC_READ) << _IOC_DIRSHIFT)
#define IOCSIZE_MASK (_IOC_SIZEMASK << _IOC_SIZESHIFT)
#define IOCSIZE_SHIFT (_IOC_SIZESHIFT)
#endif /* _ASMI386_IOCTL_H */
......@@ -127,7 +127,7 @@ extern void enable_irq(unsigned int);
#define FAST_IRQ_NAME(nr) IRQ_NAME2(fast_IRQ##nr)
#define BAD_IRQ_NAME(nr) IRQ_NAME2(bad_IRQ##nr)
#ifdef ___SMP__
#ifdef __SMP__
#define GET_PROCESSOR_ID \
"movl "SYMBOL_NAME_STR(apic_reg)", %edx\n\t" \
......
......@@ -110,8 +110,7 @@ struct mcd_Toc {
struct msf diskTime;
};
#if 0
#ifndef I_WAS_HERE
#error Please edit this file first.
#endif
#warning You have not edited mcd.h
#warning Perhaps irq and i/o settings are wrong.
#endif
/*
* Definitions for the Mitsumi CDROM interface
* Copyright (C) 1995 Heiko Schlittermann
* VERSION: 1.0a
* Copyright (C) 1995 Heiko Schlittermann <heiko@lotte.sax.de>
* VERSION: 1.3
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
......@@ -92,10 +92,16 @@
#define INIT 0
#define MALLOC 0
#define IOCTL 0
#define PLAYTRK 0
#define SUBCHNL 0
#define TOCHDR 0
#define MS 0
#define PLAYMSF 0
#define READTOC 0
#define OPENCLOSE 0
#define HW 0
#define TALK 0
#define IRQ 0
#define IRQ 1
#define TRANSFER 0
#define REQUEST 0
#else
......@@ -173,8 +179,7 @@
#define MCDX_E 1 /* unspec error */
#define MCDX_EOM 2 /* end of media */
#if 0
#ifndef I_WAS_HERE
#error Please edit this file first.
#endif
#warning You have not edited mcdx.h
#warning Perhaps irq and i/o settings are wrong.
#endif
......@@ -454,6 +454,7 @@
#define PCI_DEVICE_ID_ADAPTEC_7872 0x7278
#define PCI_DEVICE_ID_ADAPTEC_7880 0x8078
#define PCI_DEVICE_ID_ADAPTEC_7881 0x8178
#define PCI_DEVICE_ID_ADAPTEC_7882 0x8278
#define PCI_VENDOR_ID_ATRONICS 0x907f
#define PCI_DEVICE_ID_ATRONICS_2015 0x2015
......
......@@ -328,6 +328,7 @@ extern int pty_open(struct tty_struct * tty, struct file * filp);
extern int con_open(struct tty_struct * tty, struct file * filp);
extern void update_screen(int new_console);
extern void console_print(const char *);
/* vt.c */
......
......@@ -266,6 +266,8 @@ struct symbol_table symbol_table = {
X(tty_wait_until_sent),
X(tty_check_change),
X(tty_hung_up_p),
X(do_SAK),
X(console_print),
/* filesystem registration */
X(register_filesystem),
......
......@@ -111,8 +111,8 @@ get__netinfo(struct proto *pro, char *buffer, int format, char **start, off_t of
}
len += sprintf(buffer+len, "%2d: %08lX:%04X %08lX:%04X %02X %08lX:%08lX %02X:%08lX %08X %d %d\n",
i, src, srcp, dest, destp, sp->state,
format==0?sp->write_seq-sp->rcv_ack_seq:sp->rmem_alloc,
format==0?sp->acked_seq-sp->copied_seq:sp->wmem_alloc,
format==0?sp->write_seq-sp->rcv_ack_seq:sp->wmem_alloc,
format==0?sp->acked_seq-sp->copied_seq:sp->rmem_alloc,
timer_active, timer_expires-jiffies, (unsigned) sp->retransmits,
(sp->socket&&SOCK_INODE(sp->socket))?SOCK_INODE(sp->socket)->i_uid:0,
timer_active?sp->timeout:0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment