Commit b872e060 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Import 1.3.11

parent bb9c5bf1
......@@ -688,7 +688,9 @@ S: United Kingdom
N: Michael Neuffer
E: neuffer@goofy.zdv.uni-mainz.de
D: developer and maintainer of the eata_dma SCSI driver
D: Developer and maintainer of the EATA-DMA SCSI driver
D: Co-developer EATA-PIO SCSI driver
D: Assorted other snippets
S: Zum Schiersteiner Grund 2
S: 55127 Mainz
S: Germany
......
VERSION = 1
PATCHLEVEL = 3
SUBLEVEL = 10
SUBLEVEL = 11
ARCH = i386
......
......@@ -9,7 +9,7 @@
#define halt .long PAL_halt
#define rti .long PAL_rti
#define NR_SYSCALLS 310
#define NR_SYSCALLS 320
#define osf_vfork sys_fork
/*
......@@ -565,3 +565,6 @@ sys_call_table:
/* linux-specific system calls start at 300 */
/*300*/ .quad sys_bdflush, sys_sethae, sys_mount, sys_adjtimex, sys_swapoff
.quad sys_getdents, sys_create_module, sys_init_module, sys_delete_module, sys_get_kernel_syms
.quad sys_syslog, do_entSys, do_entSys, do_entSys, do_entSys
.quad do_entSys, do_entSys, do_entSys, do_entSys, do_entSys
......@@ -693,7 +693,7 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data, int a4,
else
child->flags &= ~PF_TRACESYS;
child->exit_code = data;
child->state = TASK_RUNNING;
wake_up_process(child);
ptrace_cancel_bpt(child);
set_success(&regs,data);
return 0;
......@@ -705,7 +705,7 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data, int a4,
* exit.
*/
case PTRACE_KILL: {
child->state = TASK_RUNNING;
wake_up_process(child);
child->exit_code = SIGKILL;
ptrace_cancel_bpt(child);
return 0;
......@@ -721,7 +721,7 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data, int a4,
return res;
}
child->flags &= ~PF_TRACESYS;
child->state = TASK_RUNNING;
wake_up_process(child);
child->exit_code = data;
/* give it a chance to run. */
return 0;
......@@ -733,7 +733,7 @@ asmlinkage long sys_ptrace(long request, long pid, long addr, long data, int a4,
return -EIO;
}
child->flags &= ~(PF_PTRACED|PF_TRACESYS);
child->state = TASK_RUNNING;
wake_up_process(child);
child->exit_code = data;
REMOVE_LINKS(child);
child->p_pptr = child->p_opptr;
......
......@@ -8,7 +8,7 @@
$(CC) $(CFLAGS) -c $<
OBJS = __divqu.o __remqu.o __divlu.o __remlu.o memset.o memcpy.o io.o \
checksum.o
checksum.o strlen.o
lib.a: $(OBJS)
$(AR) rcs lib.a $(OBJS)
......
/*
* strlen.S (c) 1995 David Mosberger (davidm@cs.arizona.edu)
*
* Finds length of a 0-terminated string. Optimized for the
* Alpha architecture:
*
* - memory accessed as aligned quadwords only
* - uses bcmpge to compare 8 bytes in parallel
* - does binary search to find 0 byte in last
* quadword (HAKMEM needed 12 instructions to
* do this instead of the 9 instructions that
* binary search needs).
*/
.set noreorder
.set noat
.align 3
.globl strlen
.ent strlen
strlen:
ldq_u $1, 0($16) # load first quadword ($16 may be misaligned)
lda $2, -1($31)
insqh $2, $16, $2
andnot $16, 7, $0
or $2, $1, $1
cmpbge $31, $1, $2 # $2 <- bitmask: bit i == 1 <==> i-th byte == 0
bne $2, found
loop: ldq $1, 8($0)
addq $0, 8, $0 # addr += 8
nop # helps dual issue last two insns
cmpbge $31, $1, $2
beq $2, loop
found: blbs $2, done # make aligned case fast
negq $2, $3
and $2, $3, $2
and $2, 0x0f, $1
addq $0, 4, $3
cmoveq $1, $3, $0
and $2, 0x33, $1
addq $0, 2, $3
cmoveq $1, $3, $0
and $2, 0x55, $1
addq $0, 1, $3
cmoveq $1, $3, $0
done: subq $0, $16, $0
ret $31, ($26)
.end strlen
......@@ -466,7 +466,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
else
child->flags &= ~PF_TRACESYS;
child->exit_code = data;
child->state = TASK_RUNNING;
wake_up_process(child);
/* make sure the single step bit is not set. */
tmp = get_stack_long(child, sizeof(long)*EFL-MAGICNUMBER) & ~TRAP_FLAG;
put_stack_long(child, sizeof(long)*EFL-MAGICNUMBER,tmp);
......@@ -481,7 +481,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
case PTRACE_KILL: {
long tmp;
child->state = TASK_RUNNING;
wake_up_process(child);
child->exit_code = SIGKILL;
/* make sure the single step bit is not set. */
tmp = get_stack_long(child, sizeof(long)*EFL-MAGICNUMBER) & ~TRAP_FLAG;
......@@ -497,7 +497,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
child->flags &= ~PF_TRACESYS;
tmp = get_stack_long(child, sizeof(long)*EFL-MAGICNUMBER) | TRAP_FLAG;
put_stack_long(child, sizeof(long)*EFL-MAGICNUMBER,tmp);
child->state = TASK_RUNNING;
wake_up_process(child);
child->exit_code = data;
/* give it a chance to run. */
return 0;
......@@ -509,7 +509,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
if ((unsigned long) data > NSIG)
return -EIO;
child->flags &= ~(PF_PTRACED|PF_TRACESYS);
child->state = TASK_RUNNING;
wake_up_process(child);
child->exit_code = data;
REMOVE_LINKS(child);
child->p_pptr = child->p_opptr;
......
......@@ -448,7 +448,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
else
child->flags &= ~PF_TRACESYS;
child->exit_code = data;
child->state = TASK_RUNNING;
wake_up_process(child);
/* make sure the single step bit is not set. */
tmp = get_stack_long(child, sizeof(long)*EFL-MAGICNUMBER) & ~TRAP_FLAG;
put_stack_long(child, sizeof(long)*EFL-MAGICNUMBER,tmp);
......@@ -463,7 +463,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
case PTRACE_KILL: {
long tmp;
child->state = TASK_RUNNING;
wake_up_process(child);
child->exit_code = SIGKILL;
/* make sure the single step bit is not set. */
tmp = get_stack_long(child, sizeof(long)*EFL-MAGICNUMBER) & ~TRAP_FLAG;
......@@ -479,7 +479,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
child->flags &= ~PF_TRACESYS;
tmp = get_stack_long(child, sizeof(long)*EFL-MAGICNUMBER) | TRAP_FLAG;
put_stack_long(child, sizeof(long)*EFL-MAGICNUMBER,tmp);
child->state = TASK_RUNNING;
wake_up_process(child);
child->exit_code = data;
/* give it a chance to run. */
return 0;
......@@ -491,7 +491,7 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
if ((unsigned long) data > NSIG)
return -EIO;
child->flags &= ~(PF_PTRACED|PF_TRACESYS);
child->state = TASK_RUNNING;
wake_up_process(child);
child->exit_code = data;
REMOVE_LINKS(child);
child->p_pptr = child->p_opptr;
......
......@@ -15,7 +15,6 @@
$(CC) $(CFLAGS) -c $<
SUBDIRS = block char net #streams
ALL_SUBDIRS = block char net scsi #streams
ifdef CONFIG_PCI
SUBDIRS := $(SUBDIRS) pci
......@@ -35,9 +34,9 @@ driversubdirs: dummy
set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i; done
modules: dummy
set -e; for i in $(ALL_SUBDIRS); do $(MAKE) -C $$i modules; done
set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i modules; done
dep:
set -e; for i in $(ALL_SUBDIRS); do $(MAKE) -C $$i dep; done
set -e; for i in $(SUBDIRS); do $(MAKE) -C $$i dep; done
include $(TOPDIR)/Rules.make
-- README.sjcd
80% of the work takes 20% of the time,
20% of the work takes 80% of the time...
(Murphy law)
......@@ -5,21 +6,36 @@
Once started, training can not be stopped...
(StarWars)
This is the README for the sjcd cdrom driver, version 1.3.
This file is meant as a tips & tricks edge for the usage of the SANYO CDR-H94A
cdrom drive. It will grow as the questions arise. ;-)
Since the drive often comes with an ISP16 soundcard, which can be used
as cdrom interface, this is also the place for ISP16 related issues.
The driver should work with any SoundBlaster/Panasonic style CDROM interface,
including the "soft configurable" MediaMagic sound card.
To make this sound card (and others like "Mozart") working, it has to get
"configured" by software.
So, you should boot DOS once (and by this, run the "configuration driver")
The suggestion to configure the ISP16 soundcard by booting DOS and
a warm reboot to boot Linux somehow doesn't work, at least not
on Eric's machine (IPC P90), with the version of the ISP16
card he has (there appear to be at least two versions: Eric's card with
no jumpered IDE support and Vadim's version with a jumper to enable
IDE support).
Therefore detection and configuration of the ISP16 interfaces is included
in the driver.
If we should support any other interfaces (which cannot be configured
through DOS) or if there are any more ISP16 types, please let us
know (maarel@marin.nl) and we'll see.
Otherwise, you should boot DOS once (and by this, run the "configuration driver")
and then switch to Linux by use of CTL-ALT-DEL. Each use of the RESET
button or the power switch makes this procedure necessary again.
If no ISP16 is detected, there's no harm done; a card configured trough DOS
may still work as expected.
Vadim has implemented a Linux "configuration driver" to set up the
registers of the MediaMagic (ISP-16) sound card. These routines have to get
integrated into the related CDROM and sound drivers directly at a later
time. Currently, they reside at Vadim's server
ISP16 configuration routines reside at Vadim's server
rbrf.msk.su:/linux/mediamagic/
and at Eberhard's mirror
ftp.gwdg.de:/pub/linux/cdrom/drivers/sanyo/
......@@ -29,6 +45,26 @@ Leo Spiekman's configuration routines for the ISP-16 card can get found at
and at Eberhard's mirror
ftp.gwdg.de:/pub/linux/cdrom/drivers/optics/
Eric van der Maarel's routines are included in sjcd.c.
This, and any related stuff may be found by anonymous ftp at
ftp.gwdg.de:/pub/linux/cdrom/drivers/sanyo/
The device major for sjcd is 18, and minor is 0. Create a block special
file in your /dev directory (e.g., /dev/sjcd) with these numbers.
(For those who don't know, being root and the following should do the trick:
mknod -m 644 /dev/sjcd b 18 0
and mount the cdrom by /dev/sjcd).
The default configuration parameters are:
base address 0x340
irq 10
no dma
As of version 1.2, setting base address, irq and dma at boot time is supported
through the use of command line options: type at the "boot:" prompt:
linux sjcd=<base address>,<irq>,<dma>
(where your kernel is assumed to be called by saying "linux" to
the boot manager).
If something is wrong, e-mail to vadim@rbrf.msk.su
or vadim@ipsun.ras.ru
or model@cecmow.enet.dec.com
......
......@@ -1358,7 +1358,7 @@ static int ide_open(struct inode * inode, struct file * filp)
sleep_on(&dev->wqueue);
dev->usage++;
restore_flags(flags);
if (dev->id->config & (1<<7)) /* for removeable disks */
if (dev->id && (dev->id->config & (1<<7))) /* for removeable disks */
check_disk_change(inode->i_rdev);
#ifdef CONFIG_BLK_DEV_IDECD
if (dev->type == cdrom)
......@@ -1654,7 +1654,7 @@ static int ide_check_media_change (dev_t full_dev)
if (dev->type == cdrom)
return cdrom_check_media_change (dev);
#endif /* CONFIG_BLK_DEV_IDECD */
if (dev->id->config & (1<<7)) /* for removeable disks */
if (dev->id && (dev->id->config & (1<<7))) /* for removeable disks */
return 1; /* always assume it was changed */
return 0;
}
......
/*
* Sanyo CD-ROM device driver implementation.
/* -- sjcd.c
*
* Sanyo CD-ROM device driver implementation, Version 1.3
* Copyright (C) 1995 Vadim V. Model
*
* model@cecmow.enet.dec.com
* vadim@rbrf.msk.su
* vadim@ipsun.ras.ru
*
* ISP16 detection and configuration.
* Copyright (C) 1995 Eric van der Maarel (maarel@marin.nl)
*
*
* This driver is based on pre-works by Eberhard Moenkeberg (emoenke@gwdg.de);
* it was developed under use of mcd.c from Martin Harriss, with help of
* E. van der Maarel (maarel@marin.nl).
* Eric van der Maarel (maarel@marin.nl).
*
* ISP16 detection and configuration by Eric van der Maarel (maarel@marin.nl),
* with some data communicated by Vadim V. Model (vadim@rbrf.msk.su)
* and Leo Spiekman (spiekman@et.tudelft.nl)
*
*
* It is planned to include these routines into sbpcd.c later - to make
* a "mixed use" on one cable possible for all kinds of drives which use
......@@ -29,6 +38,15 @@
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*
* History:
* 1.1 First public release with kernel version 1.3.7.
* Written by Vadim Model.
* 1.2 Added detection and configuration of cdrom interface
* on ISP16 soundcard.
* Allow for command line options: sjcd=<io_base>,<irq>,<dma>
* 1.3 Some minor changes to README.sjcd.
*
*/
#include <linux/errno.h>
......@@ -49,11 +67,60 @@
#define MAJOR_NR SANYO_CDROM_MAJOR
#include "blk.h"
#ifdef CONFIG_ISP_16
#include <linux/isp16.h>
#endif
#include <linux/sjcd.h>
/* Some (Media)Magic */
/* define types of drive the interface on an ISP16 card may be looking at */
#define ISP16_DRIVE_X 0x00
#define ISP16_SONY 0x02
#define ISP16_PANASONIC0 0x02
#define ISP16_SANYO0 0x02
#define ISP16_MITSUMI 0x04
#define ISP16_PANASONIC1 0x06
#define ISP16_SANYO1 0x06
#define ISP16_DRIVE_NOT_USED 0x08 /* not used */
#define ISP16_DRIVE_SET_MASK 0xF1 /* don't change 0-bit or 4-7-bits*/
/* ...for port */
#define ISP16_DRIVE_SET_PORT 0xF8D
/* set io parameters */
#define ISP16_BASE_340 0x00
#define ISP16_BASE_330 0x40
#define ISP16_BASE_360 0x80
#define ISP16_BASE_320 0xC0
#define ISP16_IRQ_X 0x00
#define ISP16_IRQ_5 0x04 /* shouldn't be used due to soundcard conflicts */
#define ISP16_IRQ_7 0x08 /* shouldn't be used due to soundcard conflicts */
#define ISP16_IRQ_3 0x0C
#define ISP16_IRQ_9 0x10
#define ISP16_IRQ_10 0x14
#define ISP16_IRQ_11 0x18
#define ISP16_DMA_X 0x03
#define ISP16_DMA_3 0x00
#define ISP16_DMA_5 0x00
#define ISP16_DMA_6 0x01
#define ISP16_DMA_7 0x02
#define ISP16_IO_SET_MASK 0x20 /* don't change 5-bit */
/* ...for port */
#define ISP16_IO_SET_PORT 0xF8E
/* enable the drive */
#define ISP16_NO_IDE__ENABLE_CDROM_PORT 0xF90 /* ISP16 without IDE interface */
#define ISP16_IDE__ENABLE_CDROM_PORT 0xF91 /* ISP16 with IDE interface */
#define ISP16_ENABLE_CDROM 0x80 /* seven bit */
/* the magic stuff */
#define ISP16_CTRL_PORT 0xF8F
#define ISP16_NO_IDE__CTRL 0xE2 /* ISP16 without IDE interface */
#define ISP16_IDE__CTRL 0xE3 /* ISP16 with IDE interface */
static short isp16_detect(void);
static short isp16_no_ide__detect(void);
static short isp16_with_ide__detect(void);
static short isp16_config( int base, u_char drive_type, int irq, int dma );
static short isp16_type; /* dependent on type of interface card */
static u_char isp16_ctrl;
static u_short isp16_enable_cdrom_port;
static int sjcd_present = 0;
#define SJCD_BUF_SIZ 32 /* cdr-h94a has internal 64K buffer */
......@@ -86,6 +153,7 @@ static struct sjcd_play_msf sjcd_playing;
static short sjcd_port = SJCD_BASE_ADDR;
static int sjcd_irq = SJCD_INTR_NR;
static int sjcd_dma = SJCD_DMA;
static struct wait_queue *sjcd_waitq = NULL;
......@@ -131,10 +199,17 @@ static struct timer_list sjcd_delay_timer = { NULL, NULL, 0, 0, NULL };
#define CLEAR_TIMER del_timer( &sjcd_delay_timer )
/*
* Set up device. Not yet implemented.
* Set up device, i.e., use command line data to set
* base address, irq and dma.
*/
void sjcd_setup( char *str, int *ints ){
printk( "Sanyo CDR-H94A device driver setup is called (%s).\n", str );
if (ints[0] > 0)
sjcd_port = ints[1];
if (ints[0] > 1)
sjcd_irq = ints[2];
if (ints[0] > 2)
sjcd_dma = ints[3];
}
/*
......@@ -1266,7 +1341,7 @@ static struct file_operations sjcd_fops = {
};
/*
* Following staff is intended for initialization of the cdrom. It
* Following stuff is intended for initialization of the cdrom. It
* first looks for presence of device. If the device is present, it
* will be reset. Then read the version of the drive and load status.
*/
......@@ -1281,22 +1356,21 @@ static struct {
unsigned long sjcd_init( unsigned long mem_start, unsigned long mem_end ){
int i;
if( sjcd_port != 0x340 || sjcd_irq != 0x0A /* 10 */ ){
printk( "skip sjcd_init\n" );
return( mem_start );
}
#ifdef CONFIG_ISP_16
/*
* Initialize the CDROM interface of the card.
*/
isp16_cdi_setup( ISP_CDROM_SANYO, ISP_CDROM_IRQ_10,
ISP_CDROM_DMA_DISABLED, ISP_CDROM_PORT_340 );
#endif
if ( (isp16_type=isp16_detect()) < 0 )
printk( "No ISP16 cdrom interface found.\n" );
else {
u_char expected_drive;
#if 0
printk( "sjcd=0x%x,%d: ", sjcd_port, sjcd_irq );
#endif
printk( "ISP16 cdrom interface (%s optional IDE) detected.\n",
(isp16_type==2)?"with":"without" );
expected_drive = (isp16_type?ISP16_SANYO1:ISP16_SANYO0);
if ( isp16_config( sjcd_port, expected_drive, sjcd_irq, sjcd_dma ) < 0 ) {
printk( "ISP16 cdrom interface has not been properly configured.\n" );
return(mem_start);
}
}
if( register_blkdev( MAJOR_NR, "sjcd", &sjcd_fops ) != 0 ){
printk( "Unable to get major %d for Sanyo CD-ROM\n", MAJOR_NR );
......@@ -1356,3 +1430,189 @@ unsigned long sjcd_init( unsigned long mem_start, unsigned long mem_end ){
return( mem_start );
}
/*
* -- ISP16 detection and configuration
*
* Copyright (c) 1995, Eric van der Maarel <maarel@marin.nl>
*
* Version 0.5
*
* Detect cdrom interface on ISP16 soundcard.
* Configure cdrom interface.
*
* Algorithm for the card with no IDE support option taken
* from the CDSETUP.SYS driver for MSDOS,
* by OPTi Computers, version 2.03.
* Algorithm for the IDE supporting ISP16 as communicated
* to me by Vadim Model and Leo Spiekman.
*
* Use, modifification or redistribution of this software is
* allowed under the terms of the GPL.
*
*/
#define ISP16_IN(p) (outb(isp16_ctrl,ISP16_CTRL_PORT), inb(p))
#define ISP16_OUT(p,b) (outb(isp16_ctrl,ISP16_CTRL_PORT), outb(b,p))
static short
isp16_detect(void)
{
if ( !( isp16_with_ide__detect() < 0 ) )
return(2);
else
return( isp16_no_ide__detect() );
}
static short
isp16_no_ide__detect(void)
{
u_char ctrl;
u_char enable_cdrom;
u_char io;
short i = -1;
isp16_ctrl = ISP16_NO_IDE__CTRL;
isp16_enable_cdrom_port = ISP16_NO_IDE__ENABLE_CDROM_PORT;
/* read' and write' are a special read and write, respectively */
/* read' ISP16_CTRL_PORT, clear last two bits and write' back the result */
ctrl = ISP16_IN( ISP16_CTRL_PORT ) & 0xFC;
ISP16_OUT( ISP16_CTRL_PORT, ctrl );
/* read' 3,4 and 5-bit from the cdrom enable port */
enable_cdrom = ISP16_IN( ISP16_NO_IDE__ENABLE_CDROM_PORT ) & 0x38;
if ( !(enable_cdrom & 0x20) ) { /* 5-bit not set */
/* read' last 2 bits of ISP16_IO_SET_PORT */
io = ISP16_IN( ISP16_IO_SET_PORT ) & 0x03;
if ( ((io&0x01)<<1) == (io&0x02) ) { /* bits are the same */
if ( io == 0 ) { /* ...the same and 0 */
i = 0;
enable_cdrom |= 0x20;
}
else { /* ...the same and 1 */ /* my card, first time 'round */
i = 1;
enable_cdrom |= 0x28;
}
ISP16_OUT( ISP16_NO_IDE__ENABLE_CDROM_PORT, enable_cdrom );
}
else { /* bits are not the same */
ISP16_OUT( ISP16_CTRL_PORT, ctrl );
return(i); /* -> not detected: possibly incorrect conclusion */
}
}
else if ( enable_cdrom == 0x20 )
i = 0;
else if ( enable_cdrom == 0x28 ) /* my card, already initialised */
i = 1;
ISP16_OUT( ISP16_CTRL_PORT, ctrl );
return(i);
}
static short
isp16_with_ide__detect(void)
{
u_char ctrl;
u_char tmp;
isp16_ctrl = ISP16_IDE__CTRL;
isp16_enable_cdrom_port = ISP16_IDE__ENABLE_CDROM_PORT;
/* read' and write' are a special read and write, respectively */
/* read' ISP16_CTRL_PORT and save */
ctrl = ISP16_IN( ISP16_CTRL_PORT );
/* write' zero to the ctrl port and get response */
ISP16_OUT( ISP16_CTRL_PORT, 0 );
tmp = ISP16_IN( ISP16_CTRL_PORT );
if ( tmp != 2 ) /* isp16 with ide option not detected */
return(-1);
/* restore ctrl port value */
ISP16_OUT( ISP16_CTRL_PORT, ctrl );
return(2);
}
static short
isp16_config( int base, u_char drive_type, int irq, int dma )
{
u_char base_code;
u_char irq_code;
u_char dma_code;
u_char i;
if ( (drive_type == ISP16_MITSUMI) && (dma != 0) )
printk( "Mitsumi cdrom drive has no dma support.\n" );
switch (base) {
case 0x340: base_code = ISP16_BASE_340; break;
case 0x330: base_code = ISP16_BASE_330; break;
case 0x360: base_code = ISP16_BASE_360; break;
case 0x320: base_code = ISP16_BASE_320; break;
default:
printk( "Base address 0x%03X not supported by cdrom interface on ISP16.\n", base );
return(-1);
}
switch (irq) {
case 0: irq_code = ISP16_IRQ_X; break; /* disable irq */
case 5: irq_code = ISP16_IRQ_5;
printk( "Irq 5 shouldn't be used by cdrom interface on ISP16,"
" due to possible conflicts with the soundcard.\n");
break;
case 7: irq_code = ISP16_IRQ_7;
printk( "Irq 7 shouldn't be used by cdrom interface on ISP16,"
" due to possible conflicts with the soundcard.\n");
break;
case 3: irq_code = ISP16_IRQ_3; break;
case 9: irq_code = ISP16_IRQ_9; break;
case 10: irq_code = ISP16_IRQ_10; break;
case 11: irq_code = ISP16_IRQ_11; break;
default:
printk( "Irq %d not supported by cdrom interface on ISP16.\n", irq );
return(-1);
}
switch (dma) {
case 0: dma_code = ISP16_DMA_X; break; /* disable dma */
case 1: printk( "Dma 1 cannot be used by cdrom interface on ISP16,"
" due to conflict with the soundcard.\n");
return(-1); break;
case 3: dma_code = ISP16_DMA_3; break;
case 5: dma_code = ISP16_DMA_5; break;
case 6: dma_code = ISP16_DMA_6; break;
case 7: dma_code = ISP16_DMA_7; break;
default:
printk( "Dma %d not supported by cdrom interface on ISP16.\n", dma );
return(-1);
}
if ( drive_type != ISP16_SONY && drive_type != ISP16_PANASONIC0 &&
drive_type != ISP16_PANASONIC1 && drive_type != ISP16_SANYO0 &&
drive_type != ISP16_SANYO1 && drive_type != ISP16_MITSUMI &&
drive_type != ISP16_DRIVE_X ) {
printk( "Drive type (code 0x%02X) not supported by cdrom"
" interface on ISP16.\n", drive_type );
return(-1);
}
/* set type of interface */
i = ISP16_IN(ISP16_DRIVE_SET_PORT) & ISP16_DRIVE_SET_MASK; /* clear some bits */
ISP16_OUT( ISP16_DRIVE_SET_PORT, i|drive_type );
/* enable cdrom on interface with ide support */
if ( isp16_type > 1 )
ISP16_OUT( isp16_enable_cdrom_port, ISP16_ENABLE_CDROM );
/* set base address, irq and dma */
i = ISP16_IN(ISP16_IO_SET_PORT) & ISP16_IO_SET_MASK; /* keep some bits */
ISP16_OUT( ISP16_IO_SET_PORT, i|base_code|irq_code|dma_code );
return(0);
}
This diff is collapsed.
......@@ -42,6 +42,8 @@ endif
ifdef CONFIG_HP100
NETDRV_OBJS := $(NETDRV_OBJS) hp100.o
else
MODULES := $(MODULES) hp100.o
endif
ifdef CONFIG_WD80x3
......
......@@ -65,6 +65,7 @@
* 0.11 14-Jun-95 Reset interface bug fixed?
* Little bug in hp100_close function fixed.
* 100Mb/s connection debugged.
* 0.12 14-Jul-95 Link down is now handled better.
*
*/
......@@ -350,12 +351,6 @@ static int hp100_open( struct device *dev )
int ioaddr = dev -> base_addr;
struct hp100_private *lp = (struct hp100_private *)dev -> priv;
if ( ( lp -> lan_type = hp100_sense_lan( dev ) ) < 0 )
{
printk( "%s: no connection found - check wire\n", dev -> name );
return -EIO;
}
if ( request_irq( dev -> irq, hp100_interrupt, SA_INTERRUPT, lp -> id -> name ) )
{
printk( "%s: unable to get IRQ %d\n", dev -> name, dev -> irq );
......@@ -372,6 +367,7 @@ static int hp100_open( struct device *dev )
dev -> interrupt = 0;
dev -> start = 1;
lp -> lan_type = hp100_sense_lan( dev );
lp -> mac1_mode = HP100_MAC1MODE3;
lp -> mac2_mode = HP100_MAC2MODE3;
......@@ -424,11 +420,11 @@ static int hp100_close( struct device *dev )
struct hp100_private *lp = (struct hp100_private *)dev -> priv;
hp100_page( PERFORMANCE );
hp100_outw( 0xfefe, IRQ_MASK ); /* mask off all ints */
hp100_outw( 0xfefe, IRQ_MASK ); /* mask off all IRQs */
hp100_stop_interface( dev ); /* relogin */
hp100_stop_interface( dev );
if ( lp -> lan_type == HP100_LAN_100 )
if ( lp -> lan_type == HP100_LAN_100 ) /* relogin */
hp100_login_to_vg_hub( dev );
dev -> tbusy = 1;
......@@ -452,6 +448,20 @@ static int hp100_start_xmit( struct sk_buff *skb, struct device *dev )
int ioaddr = dev -> base_addr;
u_short val;
struct hp100_private *lp = (struct hp100_private *)dev -> priv;
if ( lp -> lan_type < 0 )
{
hp100_stop_interface( dev );
if ( ( lp -> lan_type = hp100_sense_lan( dev ) ) < 0 )
{
printk( "%s: no connection found - check wire\n", dev -> name );
hp100_start_interface( dev ); /* 10Mb/s RX packets maybe handled */
return -EIO;
}
if ( lp -> lan_type == HP100_LAN_100 )
lp -> hub_status = hp100_login_to_vg_hub( dev );
hp100_start_interface( dev );
}
if ( ( i = ( hp100_inl( TX_MEM_FREE ) & ~0x7fffffff ) ) < skb -> len + 16 )
{
......@@ -463,11 +473,9 @@ static int hp100_start_xmit( struct sk_buff *skb, struct device *dev )
/* 100Mb/s adapter isn't connected to hub */
{
printk( "%s: login to 100Mb/s hub retry\n", dev -> name );
hp100_ints_off();
hp100_stop_interface( dev );
lp -> hub_status = hp100_login_to_vg_hub( dev );
hp100_start_interface( dev );
hp100_ints_on();
}
else
{
......@@ -483,20 +491,16 @@ static int hp100_start_xmit( struct sk_buff *skb, struct device *dev )
/* it's very heavy - all network setting must be changed!!! */
printk( "%s: cable change 10Mb/s <-> 100Mb/s detected\n", dev -> name );
lp -> lan_type = i;
hp100_ints_off();
hp100_stop_interface( dev );
if ( lp -> lan_type == HP100_LAN_100 )
lp -> hub_status = hp100_login_to_vg_hub( dev );
hp100_start_interface( dev );
hp100_ints_on();
}
else
{
printk( "%s: interface reset\n", dev -> name );
hp100_ints_off();
hp100_stop_interface( dev );
hp100_start_interface( dev );
hp100_ints_on();
}
}
dev -> trans_start = jiffies;
......@@ -566,6 +570,15 @@ static void hp100_rx( struct device *dev )
u_int header;
struct sk_buff *skb;
#if 0
if ( lp -> lan_type < 0 )
{
if ( ( lp -> lan_type = hp100_sense_lan( dev ) ) == HP100_LAN_100 )
lp -> hub_status = hp100_login_to_vg_hub( dev );
hp100_page( PERFORMANCE );
}
#endif
packets = hp100_inb( RX_PKT_CNT );
#ifdef HP100_DEBUG
if ( packets > 1 )
......@@ -730,6 +743,7 @@ static void hp100_interrupt( int irq )
printk( "%s: re-entering the interrupt handler\n", dev -> name );
hp100_ints_off();
dev -> interrupt = 1;
hp100_page( PERFORMANCE );
val = hp100_inw( IRQ_STATUS );
#ifdef HP100_DEBUG_IRQ
printk( "hp100_interrupt: irq_status = 0x%x\n", val );
......
......@@ -49,6 +49,7 @@
April 23, 1995 (dp) Fixed ioctl so it works properly with piconfig program
when changing the baud rate or clock mode.
version 0.8 ALPHA
July 17, 1995 (ac) Finally polishing of AX25.030+ support
*/
......@@ -59,7 +60,7 @@
of each transmitted packet. If this causes you to lose sleep, #undefine it.
*/
#define STUFF2 1
/*#define STUFF2 1*/
/* The default configuration */
#define PI_DMA 3
......@@ -1429,10 +1430,10 @@ static int pi_probe(struct device *dev, int card_type)
dev->rebuild_header = pi_rebuild_header;
dev->set_mac_address = pi_set_mac_address;
dev->type = ARPHRD_AX25; /* AF_AX25 device */
dev->hard_header_len = 17; /* We don't do digipeaters */
dev->mtu = 1500; /* eth_mtu is the default */
dev->addr_len = 7; /* sizeof an ax.25 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);
......
......@@ -36,6 +36,7 @@
* statistics. Include CSLIP code only
* if it really needed.
* Alan Cox : Free slhc buffers in the right place.
* Alan Cox : Allow for digipeated IP over AX.25
*
*
*
......@@ -1014,7 +1015,7 @@ slip_ioctl(struct tty_struct *tty, void *file, int cmd, void *arg)
#else
if ((tmp & SL_MODE_AX25) || (tmp & SL_MODE_AX25VC)) {
sl->dev->addr_len=AX25_ADDR_LEN; /* sizeof an AX.25 addr */
sl->dev->hard_header_len=AX25_HEADER_LEN; /* We don't do digipeaters */
sl->dev->hard_header_len=73; /* We don't do digipeaters */
} else {
sl->dev->addr_len=0; /* No mac addr in slip mode */
sl->dev->hard_header_len=0;
......
......@@ -3,36 +3,24 @@
*
* Copyright (c) 1994 John Aycock
* The University of Calgary Department of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of Calgary
* Department of Computer Science and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
* An alternate version of this driver with a BSD-style copyright can
* be found on XXX.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* Sources include the Adaptec 1740 driver (aha1740.c), the Ultrastor 24F
* driver (ultrastor.c), various Linux kernel source, the Adaptec EISA
* config file (!adp7771.cfg), the Adaptec AHA-2740A Series User's Guide,
......
......@@ -3,36 +3,24 @@
*
* Copyright (c) 1994 John Aycock
* The University of Calgary Department of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of Calgary
* Department of Computer Science and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
* An alternate version of this driver with a BSD-style copyright can
* be found on XXX.
*
* $Id: aic7xxx.h,v 1.18 1995/06/22 04:17:56 deang Exp $
*-M*************************************************************************/
#ifndef _aic7xxx_h
......
......@@ -3,35 +3,23 @@
*
* Copyright (c) 1994 John Aycock
* The University of Calgary Department of Computer Science.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of Calgary
* Department of Computer Science and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; see the file COPYING. If not, write to
* the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
*
* An alternate version of this driver with a BSD-style copyright can
* be found on XXX.
*
* Comments are started by `#' and continue to the end of the line; lines
* may be of the form:
......
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