Commit 20734fca authored by Linus Torvalds's avatar Linus Torvalds

Import 1.1.25

parent 5e4a8497
VERSION = 1
PATCHLEVEL = 1
SUBLEVEL = 24
SUBLEVEL = 25
all: Version zImage
......@@ -38,6 +38,12 @@ endif
ROOT_DEV = CURRENT
#
# INSTALL_PATH specifies where to place the updated kernel and system map
# images. Uncomment if you want to place them anywhere other than root.
#INSTALL_PATH=/boot
#
# If you want to preset the SVGA mode, uncomment the next line and
# set SVGA_MODE to whatever number you want.
......@@ -188,10 +194,10 @@ zdisk: zImage
dd bs=8192 if=zImage of=/dev/fd0
zlilo: $(CONFIGURE) zImage
if [ -f /vmlinuz ]; then mv /vmlinuz /vmlinuz.old; fi
if [ -f /zSystem.map ]; then mv /zSystem.map /zSystem.old; fi
cat zImage > /vmlinuz
cp zSystem.map /
if [ -f $(INSTALL_PATH)/vmlinuz ]; then mv $(INSTALL_PATH)/vmlinuz $(INSTALL_PATH)/vmlinuz.old; fi
if [ -f $(INSTALL_PATH)/zSystem.map ]; then mv $(INSTALL_PATH)/zSystem.map $(INSTALL_PATH)/zSystem.old; fi
cat zImage > $(INSTALL_PATH)/vmlinuz
cp zSystem.map $(INSTALL_PATH)/
if [ -x /sbin/lilo ]; then /sbin/lilo; else /etc/lilo/install; fi
tools/zSystem: boot/head.o init/main.o tools/version.o linuxsubdirs
......
......@@ -80,6 +80,8 @@ if [ "$CONFIG_SLIP" = "y" ]; then
# bool ' SLIP debugging on' SL_DUMP y
fi
bool 'PPP (point-to-point) support' CONFIG_PPP n
bool 'PLIP (parallel port) support' CONFIG_PLIP n
bool 'SK_G16 support' CONFIG_SK_G16 n
bool 'Load balancing support (experimental)' CONFIG_SLAVE_BALANCING n
bool 'Do you want to be offered ALPHA test drivers' CONFIG_NET_ALPHA n
bool 'Western Digital/SMC cards' CONFIG_NET_VENDOR_SMC n
......@@ -104,15 +106,14 @@ if [ "$CONFIG_NET_ISA" = "y" ]; then
bool 'DEPCA support' CONFIG_DEPCA n
if [ "$CONFIG_NET_ALPHA" = "y" ]; then
bool 'EtherExpress support' CONFIG_EEXPRESS n
bool 'AT1700 support' CONFIG_AT1700 n
fi
bool 'HP PCLAN support' CONFIG_HPLAN n
bool 'NE2000/NE1000 support' CONFIG_NE2000 n
fi
bool 'PLIP (parallel port) support' CONFIG_PLIP n
bool 'EISA and on board controllers' CONFIG_NET_EISA n
if [ "$CONFIG_NET_ALPHA" = "y" ]; then
bool 'Ansel Communications EISA 3200 support' CONFIG_AC3200 n
bool 'AT1700 support' CONFIG_AT1700 n
fi
bool 'Apricot Xen-II on board ethernet' CONFIG_APRICOT n
#bool 'NI52EE support' CONFIG_NI52 n
......
......@@ -64,6 +64,58 @@
*
*/
/*
*
* Setting up the Sony CDU31A/CDU33A drive interface card. If
* You have another card, you are on your own.
*
* +----------+-----------------+----------------------+
* | JP1 | 34 Pin Conn | |
* | JP2 +-----------------+ |
* | JP3 |
* | JP4 |
* | +--+
* | | +-+
* | | | | External
* | | | | Connector
* | | | |
* | | +-+
* | +--+
* | |
* | +--------+
* | |
* +------------------------------------------+
*
* JP1 sets the Base Address, using the following settings:
*
* Address Pin 1 Pin 2
* ------- ----- -----
* 0x320 Short Short
* 0x330 Short Open
* 0x340 Open Short
* 0x360 Open Open
*
* JP2 and JP3 configure the DMA channel; they must be set the same.
*
* DMA Pin 1 Pin 2 Pin 3
* --- ----- ----- -----
* 1 On Off On
* 2 Off On Off
* 3 Off Off On
*
* JP4 Configures the IRQ:
*
* IRQ Pin 1 Pin 2 Pin 3 Pin 4
* --- ----- ----- ----- -----
* 3 Off Off On Off
* 4 Off Off* Off On
* 5 On Off Off Off
* 6 Off On Off Off
*
* * The documentation states to set this for interrupt
* 4, but I think that is a mistake.
*/
#include <linux/errno.h>
#include <linux/signal.h>
#include <linux/sched.h>
......@@ -110,6 +162,8 @@ static struct
{ 0x360, -1, 0 }, /* Secondary standard Sony Interface */
{ 0x320, -1, 0 }, /* Secondary standard Sony Interface */
{ 0x330, -1, 0 }, /* Secondary standard Sony Interface */
{ 0x634, -1, 0 }, /* Sound FX SC400 */
{ 0x654, -1, 0 }, /* Sound FX SC400 */
{ 0 }
};
......@@ -201,6 +255,8 @@ static struct wait_queue *cdu31a_irq_wait = NULL;
static int curr_control_reg = 0; /* Current value of the control register */
#if 1 /* This will go away as soon as the isofs code is fixed
to use the fops struct. */
/*
* This routine returns 1 if the disk has been changed since the last
* check or 0 if it hasn't. Setting flag to 0 resets the changed flag.
......@@ -226,6 +282,30 @@ check_cdu31a_media_change(int full_dev, int flag)
return retval;
}
#endif
/*
* This routine returns 1 if the disk has been changed since the last
* check or 0 if it hasn't. Setting flag to 0 resets the changed flag.
*/
static int
scd_disk_change(dev_t full_dev)
{
int retval, target;
target = MINOR(full_dev);
if (target > 0) {
printk("Sony CD-ROM request error: invalid device.\n");
return 0;
}
retval = sony_disc_changed;
sony_disc_changed = 0;
return retval;
}
static inline void
enable_interrupts(void)
......@@ -1823,7 +1903,10 @@ static struct file_operations scd_fops = {
NULL, /* mmap */
scd_open, /* open */
scd_release, /* release */
NULL /* fsync */
NULL, /* fsync */
NULL, /* fasync */
scd_disk_change, /* media_change */
NULL /* revalidate */
};
......
......@@ -74,6 +74,8 @@
#define FLOPPY_DMA 2
#define FDC_FIFO_UNTESTED /* -bb */
#define FDC_FIFO_BUG
#include <linux/sched.h>
#include <linux/fs.h>
#include <linux/kernel.h>
......@@ -287,8 +289,8 @@ static void redo_fd_request(void);
static void floppy_ready(void);
static void recalibrate_floppy(void);
static int floppy_grab_irq_and_dma(void);
static void floppy_release_irq_and_dma(void);
int floppy_grab_irq_and_dma(void);
void floppy_release_irq_and_dma(void);
/*
* These are global variables, as that's the easiest way to give
......@@ -506,6 +508,32 @@ static void output_byte(char byte)
printk("Unable to send byte to FDC\n");
}
#ifdef FDC_FIFO_BUG
static void output_byte_force(char byte)
{
int counter;
unsigned char status;
if (reset)
return;
for (counter = 0 ; counter < 10000 ; counter++) {
status = inb_p(FD_STATUS);
if ((status & (STATUS_READY | STATUS_DIR)) == STATUS_READY) {
outb(byte,FD_DATA);
return;
}
if ((status & (STATUS_READY | STATUS_BUSY)) == (STATUS_READY | STATUS_BUSY)) {
outb(byte,FD_DATA);
return;
}
}
current_track = NO_TRACK;
reset = 1;
printk("Unable to send byte to FDC\n");
}
#endif /* FDC_FIFO_BUG */
static int result(void)
{
int i = 0, counter, status;
......@@ -565,15 +593,27 @@ static inline void perpendicular_mode(unsigned char rate)
if (rate & 0x40) {
unsigned char r = rate & 0x03;
if (r == 0)
#ifndef FDC_FIFO_BUG
output_byte(2); /* perpendicular, 500 kbps */
#else
output_byte_force(2); /* perpendicular, 500 kbps */
#endif
else if (r == 3)
#ifndef FDC_FIFO_BUG
output_byte(3); /* perpendicular, 1Mbps */
#else
output_byte_force(3); /* perpendicular, 1Mbps */
#endif
else {
printk(DEVICE_NAME ": Invalid data rate for perpendicular mode!\n");
reset = 1;
}
} else
#ifndef FDC_FIFO_BUG
output_byte(0); /* conventional mode */
#else
output_byte_force(0); /* conventional mode */
#endif
} else {
if (rate & 0x40) {
printk(DEVICE_NAME ": perpendicular mode not supported by this FDC.\n");
......@@ -594,9 +634,17 @@ static void configure_fdc_mode(void)
if (need_configure && (fdc_version == FDC_TYPE_82077)) {
/* Enhanced version with FIFO & vertical recording. */
output_byte(FD_CONFIGURE);
#ifndef FDC_FIFO_BUG
output_byte(0);
#else
output_byte_force(0);
#endif
output_byte(0x1A); /* FIFO on, polling off, 10 byte threshold */
#ifndef FDC_FIFO_BUG
output_byte(0); /* precompensation from track 0 upwards */
#else
output_byte_force(0); /* precompensation from track 0 upwards */
#endif
need_configure = 0;
printk(DEVICE_NAME ": FIFO enabled\n");
}
......@@ -1403,7 +1451,7 @@ void floppy_init(void)
static int usage_count = 0;
static int floppy_grab_irq_and_dma(void)
int floppy_grab_irq_and_dma(void)
{
if (usage_count++)
return 0;
......@@ -1420,7 +1468,7 @@ static int floppy_grab_irq_and_dma(void)
return 0;
}
static void floppy_release_irq_and_dma(void)
void floppy_release_irq_and_dma(void)
{
if (--usage_count)
return;
......
This diff is collapsed.
......@@ -94,12 +94,7 @@ long rd_init(long mem_start, int length)
return(length);
}
/*
* If the root device is the RAM disk, try to load it.
* In order to do this, the root device is originally set to the
* floppy, and we later change it to be RAM disk.
*/
void rd_load(void)
static void do_load(void)
{
struct buffer_head *bh;
struct minix_super_block s;
......@@ -108,14 +103,6 @@ void rd_load(void)
int nblocks;
char *cp;
/* If no RAM disk specified, give up early. */
if (!rd_length) return;
printk("RAMDISK: %d bytes, starting at 0x%x\n",
rd_length, (int) rd_start);
/* If we are doing a diskette boot, we might have to pre-load it. */
if (MAJOR(ROOT_DEV) != FLOPPY_MAJOR) return;
/*
* Check for a super block on the diskette.
* The old-style boot/root diskettes had their RAM image
......@@ -176,3 +163,32 @@ void rd_load(void)
return;
}
}
int floppy_grab_irq_and_dma(void);
void floppy_release_irq_and_dma(void);
/*
* If the root device is the RAM disk, try to load it.
* In order to do this, the root device is originally set to the
* floppy, and we later change it to be RAM disk.
*/
void rd_load(void)
{
/* If no RAM disk specified, give up early. */
if (!rd_length)
return;
printk("RAMDISK: %d bytes, starting at 0x%x\n",
rd_length, (int) rd_start);
/* If we are doing a diskette boot, we might have to pre-load it. */
if (MAJOR(ROOT_DEV) != FLOPPY_MAJOR)
return;
/* ugly, ugly */
if (floppy_grab_irq_and_dma()) {
printk("Unable to gram floppy IRQ/DMA for loading ramdisk image\n");
return;
}
do_load();
floppy_release_irq_and_dma();
}
This diff is collapsed.
......@@ -72,7 +72,7 @@
*
*****************************************************************/
#define TIMEOUT 10000
#define TIMEOUT 300
/*****************************************************************
*
......@@ -101,6 +101,7 @@ enum {
CMD_SELF_TEST = 0x0f,
CMD_SET_STATION_ADDRESS = 0x10,
CMD_ADAPTER_INFO = 0x11,
NUM_TRANSMIT_CMDS,
/*
* adapter PCB commands
......
/* This header file defines some data structures used by the 3c505 driver */
/* Data units */
typedef unsigned char byte;
typedef unsigned short int word;
typedef unsigned long int dword;
/* Data structures */
struct Memconf {
word cmd_q,
rcv_q,
mcast,
frame,
rcv_b,
progs;
};
struct Rcv_pkt {
word buf_ofs,
buf_seg,
buf_len,
timeout;
};
struct Xmit_pkt {
word buf_ofs,
buf_seg,
pkt_len;
};
struct Rcv_resp {
word buf_ofs,
buf_seg,
buf_len,
pkt_len,
timeout,
status;
dword timetag;
};
struct Xmit_resp {
word buf_ofs,
buf_seg,
c_stat,
status;
};
struct Netstat {
dword tot_recv,
tot_xmit;
word err_CRC,
err_align,
err_res,
err_ovrrun;
};
struct Selftest {
word error;
union {
word ROM_cksum;
struct {
word ofs, seg;
} RAM;
word i82586;
} failure;
};
struct Info {
byte minor_vers,
major_vers;
word ROM_cksum,
RAM_sz,
free_ofs,
free_seg;
};
struct Memdump {
word size,
off,
seg;
};
/*
Primary Command Block. The most important data structure. All communication
between the host and the adapter is done with these. (Except for the ethernet
data, which has different packaging.)
*/
typedef struct {
byte command;
byte length;
union {
struct Memconf memconf;
word configure;
struct Rcv_pkt rcv_pkt;
struct Xmit_pkt xmit_pkt;
byte multicast[10][6];
byte eth_addr[6];
byte failed;
struct Rcv_resp rcv_resp;
struct Xmit_resp xmit_resp;
struct Netstat netstat;
struct Selftest selftest;
struct Info info;
struct Memdump memdump;
byte raw[62];
} data;
} pcb_struct;
/* These defines for 'configure' */
#define RECV_STATION 0x00
#define RECV_BROAD 0x01
#define RECV_MULTI 0x02
#define RECV_ALL 0x04
#define NO_LOOPBACK 0x00
#define INT_LOOPBACK 0x08
#define EXT_LOOPBACK 0x10
......@@ -20,6 +20,10 @@ Space.o: Space.c ../../include/linux/autoconf.h
net_init.o: ../../include/linux/autoconf.h
ifdef CONFIG_SK_G16
NETDRV_OBJS := $(NETDRV_OBJS) net.a(sk_g16.o)
endif
ifdef CONFIG_WD80x3
NETDRV_OBJS := $(NETDRV_OBJS) net.a(wd.o)
CONFIG_8390 = CONFIG_8390
......@@ -48,6 +52,11 @@ hp.o: hp.c CONFIG
$(CC) $(CPPFLAGS) $(CFLAGS) $(HP_OPTS) -c $<
endif
ifdef CONFIG_HPLAN_PLUS
NETDRV_OBJS := $(NETDRV_OBJS) net.a(hp-plus.o)
CONFIG_8390 = CONFIG_8390
endif
ifdef CONFIG_ULTRA
NETDRV_OBJS := $(NETDRV_OBJS) net.a(smc-ultra.o)
CONFIG_8390 = CONFIG_8390
......
The address and IRQ used by the 3c505 driver can be configured at boot
time by typing 'ether=eth0,15,0x300' (replace IRQ and base address with
ones that tell how your adapter is jumpered).
If no base address is given at the boot time, the driver will look for
a 3c505 adapter at addresses 0x300, 0x280 and 0x310 in this order,
possibly messing up any other hardware residing in these addresses.
If a base address is given, it will be verified.
There's two #defines one may need to change in the 3c505 driver:
ELP_KERNEL_TYPE
this exists just to adapt the driver with pretty wide range of kernels.
See 3c505.c for exact information.
ELP_NEED_HARD_RESET
some DOS drivers seem to get the adapter to some irrecoverable state
if the machine is "warm booted" from DOS to Linux. If you experience
problems when warm booting, but "cold boot" works, #defining this
to 1 may help.
Known problems:
when 'ifconfig up' is run for the first time after bootup, the driver
complains:
elp_interrupt(): irq 15 for unknown device.
^^
There should be the IRQ the ELPlus adapter is using. IF the IRQ doesn't
match, something is seriously wrong.
Authors:
The driver is mainly written by Craig Southeren, email c/o
<geoffw@extro.ucc.su.OZ.AU>.
Parts of the driver (adapting the driver to 1.1.4+ kernels,
IRQ/address detection, minor changes) and this (lousy) 'readme'
by Juha Laiho <jlaiho@ichaos.nullnet.fi>.
......@@ -42,6 +42,7 @@ extern int wd_probe(struct device *dev);
extern int el2_probe(struct device *dev);
extern int ne_probe(struct device *dev);
extern int hp_probe(struct device *dev);
extern int hp_plus_probe(struct device *dev);
extern int znet_probe(struct device *);
extern int express_probe(struct device *);
extern int el3_probe(struct device *);
......@@ -53,6 +54,7 @@ extern int el16_probe(struct device *);
extern int elplus_probe(struct device *);
extern int ac3200_probe(struct device *);
extern int e2100_probe(struct device *);
extern int SK_init(struct device *dev);
/* Detachable devices ("pocket adaptors" and special PCMCIA drivers). */
extern int atp_init(struct device *);
......@@ -83,6 +85,9 @@ ethif_probe(struct device *dev)
#if defined(CONFIG_HPLAN) || defined(HPLAN)
&& hp_probe(dev)
#endif
#if defined(CONFIG_HPLAN_PLUS)
&& hp_plus_probe(dev)
#endif
#ifdef CONFIG_AT1500
&& at1500_probe(dev)
#endif
......@@ -121,6 +126,9 @@ ethif_probe(struct device *dev)
#endif
#ifdef CONFIG_DE620 /* D-Link DE-620 adapter */
&& de620_probe(dev)
#endif
#if defined(CONFIG_SK_G16)
&& SK_init(dev)
#endif
&& 1 ) {
return 1; /* -ENODEV or -EAGAIN would be more accurate. */
......
/* ac3200.c: A driver for the Ansel Communications EISA ethernet adaptor. */
/*
Written 1993, 1994 by Donald Becker.
Copyright 1993 United States Government as represented by the Director,
National Security Agency. This software may only be used and distributed
according to the terms of the GNU Public License as modified by SRC,
incorporated herein by reference.
The author may be reached as becker@cesdis.gsfc.nasa.gov, or
C/O Code 930.5, Goddard Space Flight Center, Greenbelt MD 20771
This is driver for the Ansel Communications Model 3200 EISA Ethernet LAN
Adapter. The programming information is from the users manual, as related
by glee@ardnassak.math.clemson.edu.
*/
static char *version =
"ac3200.c:v1.01 7/1/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/errno.h>
#include <linux/string.h>
#include <asm/system.h>
#include <asm/io.h>
#include <linux/netdevice.h>
#include "8390.h"
/* Offsets from the base address. */
#define AC_NIC_BASE 0x00
#define AC_SA_PROM 0x16 /* The station address PROM. */
#define AC_ADDR0 0x00 /* Prefix station address values. */
#define AC_ADDR1 0x40 /* !!!!These are just guesses!!!! */
#define AC_ADDR2 0x90
#define AC_ID_PORT 0xC80
#define AC_EISA_ID 0x0110d305
#define AC_RESET_PORT 0xC84
#define AC_RESET 0x00
#define AC_ENABLE 0x01
#define AC_CONFIG 0xC90 /* The configuration port. */
/* Decoding of the configuration register. */
static unsigned char config2irqmap[8] = {15, 12, 11, 10, 9, 7, 5, 3};
static int addrmap[8] =
{0xFF0000, 0xFE0000, 0xFD0000, 0xFFF0000, 0xFFE0000, 0xFFC0000, 0xD0000, 0 };
static char *port_name[4] = { "10baseT", "invalid", "AUI", "10base2"};
#define config2irq(configval) config2irqmap[((configval) >> 3) & 7]
#define config2mem(configval) addrmap[(configval) & 7]
#define config2name(configval) port_name[((configval) >> 6) & 3]
/* First and last 8390 pages. */
#define AC_START_PG 0x00 /* First page of 8390 TX buffer */
#define AC_STOP_PG 0x80 /* Last page +1 of the 8390 RX ring */
int ac3200_probe(struct device *dev);
static int ac_probe1(int ioaddr, struct device *dev);
static int ac_open(struct device *dev);
static void ac_reset_8390(struct device *dev);
static int ac_block_input(struct device *dev, int count,
char *buf, int ring_offset);
static void ac_block_output(struct device *dev, const int count,
const unsigned char *buf, const int start_page);
static int ac_close_card(struct device *dev);
/* Probe for the AC3200.
The AC3200 can be identified by either the EISA configuration registers,
or the unique value in the station address PROM.
*/
int ac3200_probe(struct device *dev)
{
unsigned short ioaddr = dev->base_addr;
if (ioaddr > 0x1ff) /* Check a single specified location. */
return ac_probe1(ioaddr, dev);
else if (ioaddr > 0) /* Don't probe at all. */
return ENXIO;
/* If you have a pre-pl15 machine you should delete this line. */
if ( ! EISA_bus)
return ENXIO;
for (ioaddr = 0x1000; ioaddr < 0x9000; ioaddr += 0x1000)
if (ac_probe1(ioaddr, dev) == 0)
return 0;
return ENODEV;
}
static int ac_probe1(int ioaddr, struct device *dev)
{
int i;
#ifndef final_version
printk("AC3200 ethercard probe at %#3x:", ioaddr);
for(i = 0; i < 6; i++)
printk(" %02x", inb(ioaddr + AC_SA_PROM + i));
#endif
/* !!!!The values of AC_ADDRn (see above) should be corrected when we
find out the correct station address prefix!!!! */
if (inb(ioaddr + AC_SA_PROM + 0) != AC_ADDR0
|| inb(ioaddr + AC_SA_PROM + 1) != AC_ADDR1
|| inb(ioaddr + AC_SA_PROM + 2) != AC_ADDR2 ) {
#ifndef final_version
printk(" not found (invalid prefix).\n");
#endif
return ENODEV;
}
/* The correct probe method is to check the EISA ID. */
for (i = 0; i < 4; i++)
if (inl(ioaddr + AC_ID_PORT) != AC_EISA_ID) {
printk("EISA ID mismatch, %8x vs %8x.\n",
inl(ioaddr + AC_EISA_ID), AC_EISA_ID);
return ENODEV;
}
for(i = 0; i < ETHER_ADDR_LEN; i++)
dev->dev_addr[i] = inb(ioaddr + AC_SA_PROM + i);
#ifndef final_version
printk("\nAC3200 ethercard configuration register is %#02x,"
" EISA ID %02x %02x %02x %02x.\n", inb(ioaddr + AC_CONFIG),
inb(ioaddr + AC_ID_PORT + 0), inb(ioaddr + AC_ID_PORT + 1),
inb(ioaddr + AC_ID_PORT + 2), inb(ioaddr + AC_ID_PORT + 3));
#endif
/* Assign and snarf the interrupt now. */
if (dev->irq == 0)
dev->irq = config2irq(inb(ioaddr + AC_CONFIG));
else if (dev->irq == 2)
dev->irq = 9;
if (irqaction (dev->irq, &ei_sigaction)) {
printk (" unable to get IRQ %d.\n", dev->irq);
return 0;
}
dev->base_addr = ioaddr;
#ifdef notyet
if (dev->mem_start) { /* Override the value from the board. */
for (i = 0; i < 7; i++)
if (addrmap[i] == dev->mem_start)
break;
if (i >= 7)
i = 0;
outb((inb(ioaddr + AC_CONFIG) & ~7) | i, ioaddr + AC_CONFIG);
}
#endif
dev->if_port = inb(ioaddr + AC_CONFIG) >> 6;
dev->mem_start = config2mem(inb(ioaddr + AC_CONFIG));
dev->rmem_start = dev->mem_start + TX_PAGES*256;
dev->mem_end = dev->rmem_end = dev->mem_start
+ (AC_STOP_PG - AC_START_PG)*256;
ethdev_init(dev);
ei_status.name = "AC3200";
ei_status.tx_start_page = AC_START_PG;
ei_status.rx_start_page = AC_START_PG + TX_PAGES;
ei_status.stop_page = AC_STOP_PG;
ei_status.word16 = 1;
printk("\n%s: AC3200 at %#x, IRQ %d, %s port, shared memory %#lx-%#lx.\n",
dev->name, ioaddr, dev->irq, port_name[dev->if_port],
dev->mem_start, dev->mem_end-1);
if (ei_debug > 0)
printk(version);
ei_status.reset_8390 = &ac_reset_8390;
ei_status.block_input = &ac_block_input;
ei_status.block_output = &ac_block_output;
dev->open = &ac_open;
dev->stop = &ac_close_card;
NS8390_init(dev, 0);
return 0;
}
static int ac_open(struct device *dev)
{
#ifdef notyet
/* Someday we may enable the IRQ and shared memory here. */
int ioaddr = dev->base_addr;
if (irqaction(dev->irq, &ei_sigaction))
return -EAGAIN;
#endif
return ei_open(dev);
}
static void ac_reset_8390(struct device *dev)
{
ushort ioaddr = dev->base_addr;
outb(AC_RESET, ioaddr + AC_RESET_PORT);
if (ei_debug > 1) printk("resetting AC3200, t=%ld...", jiffies);
ei_status.txing = 0;
outb(AC_ENABLE, ioaddr + AC_RESET_PORT);
if (ei_debug > 1) printk("reset done\n");
return;
}
/* Block input and output are easy on shared memory ethercards, the only
complication is when the ring buffer wraps. */
static int ac_block_input(struct device *dev, int count, char *buf,
int ring_offset)
{
long xfer_start = dev->mem_start + ring_offset - (AC_START_PG<<8);
if (xfer_start + count > dev->rmem_end) {
/* We must wrap the input move. */
int semi_count = dev->rmem_end - xfer_start;
memcpy(buf, (char*)xfer_start, semi_count);
count -= semi_count;
memcpy(buf + semi_count, (char *)dev->rmem_start, count);
return dev->rmem_start + count;
}
memcpy(buf, (char*)xfer_start, count);
return ring_offset + count;
}
static void ac_block_output(struct device *dev, int count,
const unsigned char *buf, int start_page)
{
long shmem = dev->mem_start + ((start_page - AC_START_PG)<<8);
memcpy((unsigned char *)shmem, buf, count);
}
static int ac_close_card(struct device *dev)
{
dev->start = 0;
dev->tbusy = 1;
if (ei_debug > 1)
printk("%s: Shutting down ethercard.\n", dev->name);
#ifdef notyet
/* We should someday disable shared memory and interrupts. */
outb(0x00, ioaddr + 6); /* Disable interrupts. */
free_irq(dev->irq);
irq2dev_map[dev->irq] = 0;
#endif
NS8390_init(dev, 0);
return 0;
}
/*
* Local variables:
* compile-command: "gcc -D__KERNEL__ -I/usr/src/linux/net/inet -Wall -Wstrict-prototypes -O6 -m486 -c ac3200.c"
* version-control: t
* kept-new-versions: 5
* tab-width: 4
* End:
*/
This diff is collapsed.
This diff is collapsed.
/*-
*
* This software may be used and distributed according to the terms
* of the GNU Public License, incorporated herein by reference.
*
* Module : sk_g16.h
* Version : $Revision$
*
* Author : M.Hipp (mhipp@student.uni-tuebingen.de)
* changes by : Patrick J.D. Weichmann
*
* Date Created : 94/05/25
*
* Description : In here are all necessary definitions of
* the am7990 (LANCE) chip used for writing a
* network device driver which uses this chip
*
* $Log$
-*/
#ifndef SK_G16_H
#define SK_G16_H
/*
* Control and Status Register 0 (CSR0) bit definitions
*
* (R=Readable) (W=Writeable) (S=Set on write) (C-Clear on write)
*
*/
#define CSR0_ERR 0x8000 /* Error summary (R) */
#define CSR0_BABL 0x4000 /* Babble transmitter timeout error (RC) */
#define CSR0_CERR 0x2000 /* Collision Error (RC) */
#define CSR0_MISS 0x1000 /* Missed packet (RC) */
#define CSR0_MERR 0x0800 /* Memory Error (RC) */
#define CSR0_RINT 0x0400 /* Reciever Interrupt (RC) */
#define CSR0_TINT 0x0200 /* Transmit Interrupt (RC) */
#define CSR0_IDON 0x0100 /* Initialization Done (RC) */
#define CSR0_INTR 0x0080 /* Interrupt Flag (R) */
#define CSR0_INEA 0x0040 /* Interrupt Enable (RW) */
#define CSR0_RXON 0x0020 /* Receiver on (R) */
#define CSR0_TXON 0x0010 /* Transmitter on (R) */
#define CSR0_TDMD 0x0008 /* Transmit Demand (RS) */
#define CSR0_STOP 0x0004 /* Stop (RS) */
#define CSR0_STRT 0x0002 /* Start (RS) */
#define CSR0_INIT 0x0001 /* Initialize (RS) */
#define CSR0_CLRALL 0x7f00 /* mask for all clearable bits */
/*
* Control and Status Register 3 (CSR3) bit definitions
*
*/
#define CSR3_BSWAP 0x0004 /* Byte Swap (RW) */
#define CSR3_ACON 0x0002 /* ALE Control (RW) */
#define CSR3_BCON 0x0001 /* Byte Control (RW) */
/*
* Initialization Block Mode operation Bit Definitions.
*/
#define MODE_PROM 0x8000 /* Promiscuous Mode */
#define MODE_INTL 0x0040 /* Internal Loopback */
#define MODE_DRTY 0x0020 /* Disable Retry */
#define MODE_COLL 0x0010 /* Force Collision */
#define MODE_DTCR 0x0008 /* Disable Transmit CRC) */
#define MODE_LOOP 0x0004 /* Loopback */
#define MODE_DTX 0x0002 /* Disable the Transmitter */
#define MODE_DRX 0x0001 /* Disable the Reciever */
#define MODE_NORMAL 0x0000 /* Normal operation mode */
/*
* Receive message descriptor status bit definitions.
*/
#define RX_OWN 0x80 /* Owner bit 0 = host, 1 = lance */
#define RX_ERR 0x40 /* Error Summary */
#define RX_FRAM 0x20 /* Framing Error */
#define RX_OFLO 0x10 /* Overflow Error */
#define RX_CRC 0x08 /* CRC Error */
#define RX_BUFF 0x04 /* Buffer Error */
#define RX_STP 0x02 /* Start of Packet */
#define RX_ENP 0x01 /* End of Packet */
/*
* Transmit message descriptor status bit definitions.
*/
#define TX_OWN 0x80 /* Owner bit 0 = host, 1 = lance */
#define TX_ERR 0x40 /* Error Summary */
#define TX_MORE 0x10 /* More the 1 retry needed to Xmit */
#define TX_ONE 0x08 /* One retry needed to Xmit */
#define TX_DEF 0x04 /* Deferred */
#define TX_STP 0x02 /* Start of Packet */
#define TX_ENP 0x01 /* End of Packet */
/*
* Transmit status (2) (valid if TX_ERR == 1)
*/
#define TX_BUFF 0x8000 /* Buffering error (no ENP) */
#define TX_UFLO 0x4000 /* Underflow (late memory) */
#define TX_LCOL 0x1000 /* Late collision */
#define TX_LCAR 0x0400 /* Loss of Carrier */
#define TX_RTRY 0x0200 /* Failed after 16 retransmissions */
#define TX_TDR 0x003f /* Time-domain-reflectometer-value */
/*
* Structures used for Communication with the LANCE
*/
/* LANCE Initialize Block */
struct init_block
{
unsigned short mode; /* Mode Register */
unsigned char paddr[6]; /* Physical Address (MAC) */
unsigned char laddr[8]; /* Logical Filter Address (not used) */
unsigned int rdrp; /* Receive Descriptor Ring pointer */
unsigned int tdrp; /* Transmit Descriptor Ring pointer */
};
/* Receive Message Descriptor Entry */
struct rmd
{
union
{
unsigned long buffer; /* Address of buffer */
struct
{
unsigned char unused[3];
unsigned volatile char status; /* Status Bits */
} s;
} u;
volatile short blen; /* Buffer Length (two's complement) */
unsigned short mlen; /* Message Byte Count */
};
/* Transmit Message Descriptor Entry */
struct tmd
{
union
{
unsigned long buffer; /* Address of buffer */
struct
{
unsigned char unused[3];
unsigned volatile char status; /* Status Bits */
} s;
} u;
unsigned short blen; /* Buffer Length (two's complement) */
unsigned volatile short status2; /* Error Status Bits */
};
#endif /* End of SK_G16_H */
......@@ -36,6 +36,8 @@
* allow zero or one slots
* separate routines
* status display
* - Jul 1994 Dmitry Gorodchanin
* Fixes for memory leaks.
*
*
* This module is a difficult issue. Its clearly inet code but its also clearly
......@@ -101,7 +103,10 @@ slhc_init(int rslots, int tslots)
(struct cstate *)kmalloc(rslots * sizeof(struct cstate),
GFP_KERNEL);
if (! comp->rstate)
{
kfree((unsigned char *)comp);
return NULL;
}
memset(comp->rstate, 0, rslots * sizeof(struct cstate));
comp->rslot_limit = rslots - 1;
}
......@@ -111,7 +116,11 @@ slhc_init(int rslots, int tslots)
(struct cstate *)kmalloc(tslots * sizeof(struct cstate),
GFP_KERNEL);
if (! comp->tstate)
{
kfree((unsigned char *)comp->rstate);
kfree((unsigned char *)comp);
return NULL;
}
memset(comp->tstate, 0, rslots * sizeof(struct cstate));
comp->tslot_limit = tslots - 1;
}
......
......@@ -23,6 +23,8 @@
* Alan Cox : Corrected non-IP cases of the above.
* Alan Cox : Now uses hardware type as per FvK.
* Alan Cox : Default to 192.168.0.0 (RFC 1597)
* A.N.Kuznetsov : dev_tint() recursion fix.
* Dmitry Gorodchanin : SLIP memory leaks
*
*
* FIXME: This driver still makes some IP'ish assumptions. It should build cleanly KISS TNC only without
......@@ -379,7 +381,7 @@ sl_encaps(struct slip *sl, unsigned char *icp, int len)
actual = sl->tty->driver.write(sl->tty, 0, sl->xbuff, count);
if (actual == count) {
sl_unlock(sl);
dev_tint(sl->dev);
mark_bh(NET_BH);
} else {
sl->xhead = sl->xbuff + count;
sl->xtail = sl->xbuff + actual;
......@@ -420,7 +422,7 @@ static void slip_write_wakeup(struct tty_struct *tty)
tty->flags &= ~TTY_DO_WRITE_WAKEUP;
sl_unlock(sl);
dev_tint(sl->dev);
mark_bh(NET_BH);
} else {
sl->xtail += answer;
}
......@@ -566,7 +568,7 @@ sl_open(struct device *dev)
p = (unsigned char *) kmalloc(l + 4, GFP_KERNEL);
if (p == NULL) {
kfree_s((void *)sl->dev->mem_start,l+4);
kfree((unsigned char *)sl->dev->mem_start);
return(-ENOMEM);
}
sl->dev->rmem_start = (unsigned long) p;
......@@ -584,6 +586,7 @@ sl_open(struct device *dev)
p = (unsigned char *) kmalloc(l + 4, GFP_KERNEL);
if (p == NULL) {
kfree((unsigned char *)sl->dev->mem_start);
kfree((unsigned char *)sl->dev->rmem_start);
return(-ENOMEM);
}
sl->cbuff = p;
......@@ -592,7 +595,7 @@ sl_open(struct device *dev)
if (sl->slcomp == NULL) {
kfree((unsigned char *)sl->dev->mem_start);
kfree((unsigned char *)sl->dev->rmem_start);
kfree(sl->cbuff);
kfree((unsigned char *)sl->cbuff);
return(-ENOMEM);
}
#endif
......
This diff is collapsed.
Wed Jul 6 05:45:02 1994 Eric Youngdale (eric@esp22)
* Linux 1.1.25 released.
* sd.c, sr.c: Use new check_media_change and revalidate
file_operations fields.
* st.c, st.h: Add changes from Kai Makisara, dated Jun 22.
* hosts.h: Change SG_ALL back to 0xff. Apparently soft error
in /dev/brain resulted in having this bumped up.
Change first parameter in bios_param function to be Disk * instead
of index into rscsi_disks.
* sd_ioctl.c: Pass pointer to rscsi_disks element instead of index
to array.
* sd.h: Add struct name "scsi_disk" to typedef for Scsi_Disk.
* scsi.c: Remove redundant Maxtor XT8760S from blacklist.
In scsi_reset, add printk when DEBUG defined.
* All low level drivers: Modify definitions of bios_param in
appropriate way.
Thu Jun 16 10:31:59 1994 Eric Youngdale (eric@esp22)
* Linux 1.1.20 released.
* scsi_ioctl.c: Only pass down the actual number of characters
required to scsi_do_cmd, not the one rounded up to a even number
of sectors.
* ultrastor.c: Changes from Caleb Epstein for 24f cards. Support
larger SG lists.
* ultrastor.c: Changes from me - use scsi_register to register
host. Add some consistency checking,
Wed Jun 1 21:12:13 1994 Eric Youngdale (eric@esp22)
* Linux 1.1.19 released.
* scsi.h: Add new return code for reset() function:
SCSI_RESET_PUNT.
......
This file contains brief information about the SCSI tape driver.
Last modified: Thu May 5 00:13:24 1994 by root@kai.home
Last modified: Wed Jun 22 23:38:47 1994 by root@kai.home
BASICS
......@@ -10,6 +10,9 @@ variable block size (within buffer limits). Both the auto-rewind
(minor equals device number) and non-rewind devices (minor is 128 +
device number) are implemented.
By default the driver writes one filemark when the device is closed after
writing. Two filemarks can be optionally written. In both cases end
of data is signified by returning zero bytes for two consecutive reads.
BUFFERING
......@@ -78,12 +81,13 @@ MTBSR Space backward over count records.
MTWEOF Write count filemarks.
MTREW Rewind tape.
MTOFFL Set device off line (often rewind plus eject).
MTNOP Do nothing.
MTNOP Do nothing except flush the buffers.
MTRETEN Retension tape.
MTEOM Space to end of recorded data.
MTERASE Erase tape.
MTSEEK Seek to tape block count. Uses Tandberg-compatible seek (QFA)
for SCSI-1 drives and SCSI-2 seek for SCSI-2 drives.
for SCSI-1 drives and SCSI-2 seek for SCSI-2 drives. The file and
block numbers in the status are not valid after a seek.
MTSETBLK Set the drive block size. Setting to zero sets the drive into
variable block mode (if applicable).
MTSETDENSITY Sets the drive density code to arg. See drive
......@@ -99,8 +103,9 @@ MTSETDRVBUFFER
Sets the buffering options. The bits are the new states
(enabled/disabled) of the write buffering (MT_ST_BUFFER_WRITES),
asynchronous writes (MT_ST_ASYNC_WRITES), read ahead
(MT_ST_READ_AHEAD) and debugging (MT_ST_DEBUGGING;
(debugging must be compiled into the driver).
(MT_ST_READ_AHEAD), writing of two filemark (ST_TWO_FM), and
debugging (MT_ST_DEBUGGING ; debugging must be compiled into the
driver).
MT_ST_WRITE_THRESHOLD
Sets the write threshold for this device to kilobytes
specified by the lowest bits.
......@@ -120,6 +125,8 @@ MTIOCGET Returns some status information.
The current block size and the density code are stored in the field
mt_dsreg (shifts for the subfields are MT_ST_BLKSIZE_SHIFT and
MT_ST_DENSITY_SHIFT).
The write protect bit in mt_gstat is set if the tape is write
protected.
The other fields are empty.
......
......@@ -20,10 +20,19 @@
* General Public License for more details.
*
* $Id: aha152x.c,v 1.0 1994/03/25 12:52:00 root Exp $
* $Id: aha152x.c,v 1.2 1994/07/03 12:56:36 root Exp $
*
* $Log: aha152x.c,v $
* Revision 1.2 1994/07/03 12:56:36 root
* - cleaned up debugging code
* - more tweaking on reset delays
* - updated abort/reset code (pretty untested...)
*
* Revision 1.1 1994/05/28 21:18:49 root
* - update for mid-level interface change (abort-reset)
* - delays after resets adjusted for some slow devices
*
* Revision 1.0 1994/03/25 12:52:00 root
* - Fixed "more data than expected" problem
* - added new BIOS signatures
......@@ -162,12 +171,11 @@
**************************************************************************/
#include "aha152x.h"
#include <linux/sched.h>
#include <asm/io.h>
#include "../block/blk.h"
#include "scsi.h"
#include "sd.h" /* Reqd for biosparam definition */
#include "hosts.h"
#include "constants.h"
#include <asm/system.h>
......@@ -176,6 +184,8 @@
#include <linux/wait.h>
#include <linux/ioport.h>
#include "aha152x.h"
/* DEFINES */
......@@ -500,10 +510,6 @@ int aha152x_detect(int hostno)
struct sigaction sa;
int interrupt_level;
#if defined(DEBUG_RACE)
enter_driver("detect");
#endif
if(setup_called)
{
printk("aha152x: processing commandline: ");
......@@ -568,13 +574,8 @@ int aha152x_detect(int hostno)
(int) signatures[j].sig_length);
if(!ok)
{
#if defined(DEBUG_RACE)
leave_driver("(1) detect");
#endif
printk("failed\n");
return 0;
}
return 0;
printk("aha152x: BIOS test: passed, ");
#else
printk("aha152x: ");
......@@ -588,9 +589,6 @@ int aha152x_detect(int hostno)
if(i==PORT_COUNT)
{
printk("failed\n");
#if defined(DEBUG_RACE)
leave_driver("(2) detect");
#endif
return 0;
}
else
......@@ -662,9 +660,9 @@ int aha152x_detect(int hostno)
/* RESET OUT */
SETBITS(SCSISEQ, SCSIRSTO );
do_pause(5);
do_pause(30);
CLRBITS(SCSISEQ, SCSIRSTO );
do_pause(10);
do_pause(60);
aha152x_reset(NULL);
......@@ -677,10 +675,6 @@ int aha152x_detect(int hostno)
SETPORT(SIMODE0, 0);
SETPORT(SIMODE1, 0);
#if defined(DEBUG_RACE)
leave_driver("(3) detect");
#endif
SETBITS( DMACNTRL0, INTEN);
return 1;
}
......@@ -765,6 +759,10 @@ int aha152x_queue( Scsi_Cmnd * SCpnt, void (*done)(Scsi_Cmnd *))
}
sti();
#if defined(DEBUG_RACE)
leave_driver("queue");
#endif
return 0;
}
......@@ -791,7 +789,9 @@ int aha152x_abort( Scsi_Cmnd *SCpnt)
printk("aha152x: abort(), SCpnt=0x%08x, ", (unsigned int) SCpnt );
#endif
#if defined(DEBUG_ABORT)
show_queues();
#endif
/* look for command in issue queue */
for( ptr=issue_SC, prev=NULL;
......@@ -814,12 +814,21 @@ int aha152x_abort( Scsi_Cmnd *SCpnt)
return SCSI_ABORT_SUCCESS;
}
/* Fail abortion, if we're on the bus */
if (current_SC)
{
if( TESTLO(SSTAT1, BUSFREE) ) {
/* fail abortion, if current command is on the bus */
sti();
return SCSI_ABORT_BUSY;
}
else
{
/* target entered bus free before COMMAND COMPLETE, nothing to abort */
sti();
current_SC->result = DID_ERROR << 16;
current_SC->done(current_SC);
current_SC = (Scsi_Cmnd *) NULL;
return SCSI_ABORT_SUCCESS;
}
/* look for command in disconnected queue */
for( ptr=disconnected_SC, prev=NULL;
......@@ -836,7 +845,7 @@ int aha152x_abort( Scsi_Cmnd *SCpnt)
if(prev)
prev->host_scribble = ptr->host_scribble;
else
issue_SC = (Scsi_Cmnd *) ptr->host_scribble;
disconnected_SC = (Scsi_Cmnd *) ptr->host_scribble;
/* set command current and initiate selection,
let the interrupt routine take care of the abortion */
......@@ -903,11 +912,11 @@ static void aha152x_reset_ports(void)
/*
* Reset registers, reset a hanging bus and
* kill active and disconnected commands
* kill active and disconnected commands for target w/o soft reset
*/
int aha152x_reset(Scsi_Cmnd * __unused)
{
Scsi_Cmnd *ptr;
Scsi_Cmnd *ptr, *prev, *next;
aha152x_reset_ports();
......@@ -920,13 +929,11 @@ int aha152x_reset(Scsi_Cmnd * __unused)
printk("aha152x: reset(), bus not free: SCSI RESET OUT\n");
#endif
#if defined( DEBUG_RESET )
show_queues();
#endif
/* FIXME - if the device implements soft resets, the command will still
be running after the bus reset. In this case we should do nothing
and let the command continue. -ERY */
if(current_SC)
if(current_SC && !current_SC->device->soft_reset)
{
current_SC->host_scribble = NULL;
current_SC->result = DID_RESET << 16;
......@@ -934,22 +941,45 @@ int aha152x_reset(Scsi_Cmnd * __unused)
current_SC=NULL;
}
while(disconnected_SC)
{
ptr = disconnected_SC;
disconnected_SC = (Scsi_Cmnd *) ptr->host_scribble;
ptr->host_scribble = NULL;
ptr->result = DID_RESET << 16;
ptr->done(ptr);
}
cli();
prev=NULL; ptr=disconnected_SC;
while(ptr)
{
if(!ptr->device->soft_reset)
{
if(prev)
prev->host_scribble = ptr->host_scribble;
else
disconnected_SC = (Scsi_Cmnd *) ptr->host_scribble;
next = (Scsi_Cmnd *) ptr->host_scribble;
ptr->host_scribble = NULL;
ptr->result = DID_RESET << 16;
ptr->done(ptr);
ptr = next;
}
else
{
prev=ptr;
ptr = (Scsi_Cmnd *) ptr->host_scribble;
}
}
sti();
#if defined( DEBUG_RESET )
printk("commands on targets w/ soft-resets:\n");
show_queues();
#endif
/* RESET OUT */
SETPORT(SCSISEQ, SCSIRSTO);
do_pause(5);
do_pause(30);
SETPORT(SCSISEQ, 0);
do_pause(10);
do_pause(60);
SETPORT(SIMODE0, 0 );
SETPORT(SIMODE0, disconnected_SC ? ENSELDI : 0 );
SETPORT(SIMODE1, issue_SC ? ENBUSFREE : 0);
SETPORT( DMACNTRL0, INTEN );
......@@ -961,8 +991,9 @@ int aha152x_reset(Scsi_Cmnd * __unused)
/*
* Return the "logical geometry"
*/
int aha152x_biosparam( int size, int dev, int *info_array )
int aha152x_biosparam(Scsi_Disk * disk, int dev, int *info_array )
{
int size = disk->capacity;
#if defined(DEBUG_BIOSPARAM)
printk("aha152x_biosparam: dev=%x, size=%d, ", dev, size);
#endif
......
......@@ -2,7 +2,7 @@
#define _AHA152X_H
/*
* $Id: aha152x.h,v 1.0 1994/03/25 12:52:00 root Exp $
* $Id: aha152x.h,v 1.2 1994/07/03 13:01:47 root Exp $
*/
#include "../block/blk.h"
......@@ -16,13 +16,13 @@ int aha152x_command(Scsi_Cmnd *);
int aha152x_queue(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
int aha152x_abort(Scsi_Cmnd *);
int aha152x_reset(Scsi_Cmnd *);
int aha152x_biosparam(int, int, int*);
int aha152x_biosparam(Disk *, int, int*);
/* number of queueable commands
(unless we support more than 1 cmd_per_lun this should do) */
#define AHA152X_MAXQUEUE 7
#define AHA152X_REVID "Adaptec 152x SCSI driver; $Revision: 1.0 $"
#define AHA152X_REVID "Adaptec 152x SCSI driver; $Revision: 1.2 $"
/* Initial value of Scsi_Host entry */
#define AHA152X { /* name */ AHA152X_REVID, \
......
......@@ -17,7 +17,6 @@
#include <linux/types.h>
#include <linux/string.h>
#include <linux/ioport.h>
#include <linux/config.h>
#include <linux/sched.h>
#include <asm/dma.h>
......@@ -1063,18 +1062,14 @@ int aha1542_reset(Scsi_Cmnd * SCpnt)
return SCSI_RESET_PUNT;
}
#ifdef CONFIG_BLK_DEV_SD
#include "sd.h"
#endif
int aha1542_biosparam(int size, int dev, int * ip)
int aha1542_biosparam(Scsi_Disk * disk, int dev, int * ip)
{
int translation_algorithm;
#ifdef CONFIG_BLK_DEV_SD
Scsi_Device *disk;
int size = disk->capacity;
disk = rscsi_disks[MINOR(dev) >> 4].device;
translation_algorithm = HOSTDATA(disk->host)->bios_translation;
translation_algorithm = HOSTDATA(disk->device->host)->bios_translation;
/* Should this be > 1024, or >= 1024? Enquiring minds want to know. */
if((size>>11) > 1024 && translation_algorithm == 2) {
/* Please verify that this is the same as what DOS returns */
......@@ -1087,6 +1082,5 @@ int aha1542_biosparam(int size, int dev, int * ip)
ip[2] = size >> 11;
};
/* if (ip[2] >= 1024) ip[2] = 1024; */
#endif
return 0;
}
......@@ -134,7 +134,7 @@ int aha1542_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
int aha1542_abort(Scsi_Cmnd *);
const char *aha1542_info(void);
int aha1542_reset(Scsi_Cmnd *);
int aha1542_biosparam(int, int, int*);
int aha1542_biosparam(Disk *, int, int*);
#define AHA1542_MAILBOXES 8
#define AHA1542_SCATTER 16
......
......@@ -31,6 +31,7 @@
#include "../block/blk.h"
#include "scsi.h"
#include "hosts.h"
#include "sd.h"
#include "aha1740.h"
......@@ -489,8 +490,9 @@ int aha1740_reset(Scsi_Cmnd * SCpnt)
return SCSI_RESET_PUNT;
}
int aha1740_biosparam(int size, int dev, int* ip)
int aha1740_biosparam(Disk * disk, int dev, int* ip)
{
int size = disk->capacity;
DEB(printk("aha1740_biosparam\n"));
ip[0] = 64;
ip[1] = 32;
......
......@@ -158,7 +158,7 @@ int aha1740_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
int aha1740_abort(Scsi_Cmnd *);
const char *aha1740_info(void);
int aha1740_reset(Scsi_Cmnd *);
int aha1740_biosparam(int, int, int*);
int aha1740_biosparam(Disk *, int, int*);
#define AHA1740_ECBS 32
#define AHA1740_SCATTER 16
......
......@@ -59,7 +59,6 @@
* unfinished, questionable, or wrong.
*/
#include <linux/config.h>
#include <linux/string.h>
#include <linux/sched.h>
#include <linux/kernel.h>
......@@ -74,9 +73,7 @@
#include "../block/blk.h"
#include "scsi.h"
#include "hosts.h"
#ifdef CONFIG_BLK_DEV_SD
# include "sd.h"
#endif
#define BUSLOGIC_PRIVATE_H /* Get the "private" stuff */
#include "buslogic.h"
......@@ -1181,17 +1178,17 @@ int buslogic_reset(Scsi_Cmnd *SCpnt)
return SCSI_RESET_PUNT;
}
int buslogic_biosparam(int size, int dev, int *ip)
int buslogic_biosparam(Disk * disk, int dev, int *ip)
{
/* ??? This is wrong if disk is configured for > 1G mapping.
Unfortunately, unlike UltraStor, I see know way of determining whether
> 1G mapping has been enabled. */
#ifdef CONFIG_BLK_DEV_SD
int translation_algorithm;
Scsi_Device *disk;
disk = rscsi_disks[MINOR(dev) >> 4].device;
translation_algorithm = HOSTDATA(disk->host)->bios_translation;
int size = disk->capacity;
int translation_algorithm;
/* ??? This is wrong if disk is configured for > 1G mapping.
Unfortunately, unlike UltraStor, I see know way of determining whether
> 1G mapping has been enabled. */
translation_algorithm = HOSTDATA(disk->device->host)->bios_translation;
/* ??? Should this be > 1024, or >= 1024? Enquiring minds want to know. */
if ((size >> 11) > 1024
&& translation_algorithm == BIOS_TRANSLATION_25563) {
......@@ -1206,6 +1203,5 @@ int buslogic_biosparam(int size, int dev, int *ip)
}
/* if (ip[2] > 1024)
ip[2] = 1024; */
#endif
return 0;
}
......@@ -17,7 +17,7 @@ int buslogic_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
int buslogic_abort(Scsi_Cmnd *);
const char *buslogic_info(void);
int buslogic_reset(Scsi_Cmnd *);
int buslogic_biosparam(int, int, int *);
int buslogic_biosparam(Disk *, int, int *);
#define BUSLOGIC_CMDLUN 1 /* ??? */
......
This diff is collapsed.
......@@ -32,11 +32,7 @@ const char *fdomain_16x0_info( void );
int fdomain_16x0_reset( Scsi_Cmnd * );
int fdomain_16x0_queue( Scsi_Cmnd *, void (*done)(Scsi_Cmnd *) );
#ifdef CONFIG_BLK_DEV_SD
int fdomain_16x0_biosparam( int, int, int * );
#else
#define fdomain_16x0_biosparam NULL
#endif
int fdomain_16x0_biosparam(Disk *, int, int * );
#define FDOMAIN_16X0 { "Future Domain TMC-16x0", \
fdomain_16x0_detect, \
......
This diff is collapsed.
This diff is collapsed.
......@@ -115,7 +115,7 @@
#ifndef ASM
int pas16_abort(Scsi_Cmnd *);
int pas16_biosparam(int, int, int*);
int pas16_biosparam(Disk *, int, int*);
int pas16_detect(int);
const char *pas16_info(void);
int pas16_queue_command(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
......
This diff is collapsed.
This diff is collapsed.
......@@ -6,7 +6,7 @@ int scsi_debug_detect(int);
int scsi_debug_command(Scsi_Cmnd *);
int scsi_debug_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
int scsi_debug_abort(Scsi_Cmnd *, int);
int scsi_debug_biosparam(int, int, int[]);
int scsi_debug_biosparam(Disk *, int, int[]);
const char *scsi_debug_info(void);
int scsi_debug_reset(Scsi_Cmnd *);
......
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