Commit cc6d9ed8 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.1.66

parent f40ed092
VERSION = 1
PATCHLEVEL = 1
SUBLEVEL = 65
SUBLEVEL = 66
ARCH = i386
......
......@@ -6,6 +6,7 @@
comment 'General setup'
bool 'Kernel math emulation' CONFIG_MATH_EMULATION n
bool 'Normal floppy disk support' CONFIG_BLK_DEV_FD y
bool 'Normal harddisk support' CONFIG_BLK_DEV_HD y
bool 'XT harddisk support' CONFIG_BLK_DEV_XD n
bool 'Networking support' CONFIG_NET y
......@@ -57,8 +58,9 @@ bool 'UltraStor 14F/34F support' CONFIG_SCSI_U14_34F n
bool 'Future Domain 16xx SCSI support' CONFIG_SCSI_FUTURE_DOMAIN n
bool 'Generic NCR5380 SCSI support' CONFIG_SCSI_GENERIC_NCR5380 n
bool 'NCR53c7,8xx SCSI support' CONFIG_SCSI_NCR53C7xx n
#bool 'Always IN2000 SCSI support' CONFIG_SCSI_IN2000 n
bool 'Always IN2000 SCSI support' CONFIG_SCSI_IN2000 n
bool 'PAS16 SCSI support' CONFIG_SCSI_PAS16 n
bool 'QLOGIC SCSI support' CONFIG_SCSI_QLOGIC n
bool 'Seagate ST-02 and Future Domain TMC-8xx SCSI support' CONFIG_SCSI_SEAGATE n
bool 'Trantor T128/T128F/T228 SCSI support' CONFIG_SCSI_T128 n
bool 'UltraStor SCSI support' CONFIG_SCSI_ULTRASTOR n
......@@ -116,6 +118,7 @@ if [ "$CONFIG_NET_ISA" = "y" ]; then
bool 'NI6510 support' CONFIG_NI65 n
fi
bool 'HP PCLAN support' CONFIG_HPLAN n
bool 'HP PCLAN PLUS support' CONFIG_HPLAN_PLUS n
bool 'NE2000/NE1000 support' CONFIG_NE2000 y
bool 'SK_G16 support' CONFIG_SK_G16 n
fi
......@@ -163,7 +166,11 @@ bool '/proc filesystem support' CONFIG_PROC_FS y
if [ "$CONFIG_INET" = "y" ]; then
bool 'NFS filesystem support' CONFIG_NFS_FS y
fi
bool 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS n
if [ "$CONFIG_BLK_DEV_SR" = "y" -o "$CONFIG_CDU31A" = "y" -o "$CONFIG_MCD" = "y" -o "$CONFIG_SBPCD" = "y" -o "$CONFIG_BLK_DEV_IDECD" = "y" ]; then
bool 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS y
else
bool 'ISO9660 cdrom filesystem support' CONFIG_ISO9660_FS n
fi
bool 'OS/2 HPFS filesystem support (read only)' CONFIG_HPFS_FS n
bool 'System V and Coherent filesystem support' CONFIG_SYSV_FS n
......
......@@ -45,6 +45,13 @@ extern unsigned long sbpcd_init(unsigned long, unsigned long);
#endif CONFIG_SBPCD
extern void set_device_ro(int dev,int flag);
extern void floppy_init(void);
#ifdef FD_MODULE
static
#else
extern
#endif
int new_floppy_init(void);
extern void rd_load(void);
extern long rd_init(long mem_start, int length);
extern int ramdisk_size;
......
......@@ -673,7 +673,7 @@ get_result(unsigned char *result_buffer,
*result_size = 2;
/*
* 0x20 means an error occured. Byte 2 will have the error code.
* 0x20 means an error occurred. Byte 2 will have the error code.
* Otherwise, the command succeeded, byte 2 will have the count of
* how many more status bytes are coming.
*
......@@ -2781,7 +2781,7 @@ cdu31a_setup(char *strings,
}
else
{
printk("CDU31A: Unknown interface type: %s\n", strings[3]);
printk("CDU31A: Unknown interface type: %s\n", strings);
}
}
}
......
This diff is collapsed.
......@@ -260,40 +260,29 @@ static unsigned int mult_req [MAX_HD] = {0,}; /* requested MultMode count
static unsigned int mult_count [MAX_HD] = {0,}; /* currently enabled MultMode count */
static struct request WCURRENT;
static void fixstring(unsigned char *s, int n)
static void fixstring (unsigned char *s, int bytecount)
{
int i;
unsigned short *ss = (unsigned short *) s;
unsigned char *p, *end = &s[bytecount &= ~1]; /* bytecount must be even */
/* convert from big-endian to little-endian */
for (i = n ; (i -= 2) >= 0 ; ss++)
*ss = (*ss >> 8) | (*ss << 8);
/* "strnlen()" */
for (i = 0 ; i < n ; i++) {
if (!s[i]) {
n = i;
break;
}
for (p = end ; p != s;) {
unsigned short *pp = (unsigned short *) (p -= 2);
*pp = (*pp >> 8) | (*pp << 8);
}
/* wipe out trailing spaces */
while (n > 0) {
if (s[n-1] != ' ')
break;
n--;
s[n] = '\0';
}
/* strip leading blanks */
while (s != end && *s == ' ')
++s;
/* wipe out leading spaces */
if (*s == ' ') {
unsigned char *t = s;
while (n-- && *++s == ' ');
while (n-- >= 0) {
*t++ = *s;
*s++ = '\0';
}
/* compress internal blanks and strip trailing blanks */
while (s != end && *s) {
if (*s++ != ' ' || (s != end && *s && *s != ' '))
*p++ = *(s-1);
}
/* wipe out trailing garbage */
while (p != end)
*p++ = '\0';
}
static void identify_intr(void)
......@@ -332,8 +321,8 @@ static void identify_intr(void)
fixstring (id->model, sizeof(id->model));
printk (" hd%c: %.40s, %dMB w/%dKB Cache, CHS=%d/%d/%d, MaxMult=%d\n",
dev+'a', id->model, id->cyls*id->heads*id->sectors/2048,
id->buf_size/2, hd_info[dev].cyl, hd_info[dev].head,
hd_info[dev].sect, id->max_multsect);
id->buf_size/2, bios_info[dev].cyl, bios_info[dev].head,
bios_info[dev].sect, id->max_multsect);
/*
* Early model Quantum drives go weird at this point,
* but doing a recalibrate seems to "fix" them.
......
......@@ -17,7 +17,7 @@
#include <linux/locks.h>
#include <asm/system.h>
#include <asm/io.h>
#include "blk.h"
/*
......@@ -507,6 +507,11 @@ long blk_dev_init(long mem_start, long mem_end)
#ifdef CONFIG_MCD
mem_start = mcd_init(mem_start,mem_end);
#endif
#ifdef CONFIG_BLK_DEV_FD
floppy_init();
#else
outb_p(0xc, 0x3f2);
#endif
#ifdef CONFIG_SBPCD
mem_start = sbpcd_init(mem_start, mem_end);
#endif CONFIG_SBPCD
......
......@@ -46,7 +46,8 @@
* Virtual Consoles, Screen Blanking, Screen Dumping, Color, Graphics
* Chars, and VT100 enhancements by Peter MacDonald.
*
* Copy and paste function by Andrew Haylett.
* Copy and paste function by Andrew Haylett,
* some enhancements by Alessandro Rubini.
*
* User definable mapping table and font loading by Eugene G. Crosser,
* <crosser@pccross.msk.su>
......@@ -2337,6 +2338,8 @@ int set_selection(const int arg, struct tty_struct *tty)
default:
return -EINVAL;
}
/* remove the pointer */
highlight_pointer(sel_cons,-1);
/* select to end of line if on trailing space */
if (new_sel_end > new_sel_start &&
!atedge(new_sel_end) && isspace(*(off + new_sel_end)))
......
......@@ -146,7 +146,7 @@ struct ei_device {
#define ENTSR_COL 0x04 /* The transmit collided at least once. */
#define ENTSR_ABT 0x08 /* The transmit collided 16 times, and was deferred. */
#define ENTSR_CRS 0x10 /* The carrier sense was lost. */
#define ENTSR_FU 0x20 /* A "FIFO underrun" occured during transmit. */
#define ENTSR_FU 0x20 /* A "FIFO underrun" occurred during transmit. */
#define ENTSR_CDH 0x40 /* The collision detect "heartbeat" signal was lost. */
#define ENTSR_OWC 0x80 /* There was an out-of-window collision. */
......
......@@ -652,7 +652,8 @@ unsigned long apricot_init(unsigned long mem_start, unsigned long mem_end)
int i;
int checksum = 0;
int ioaddr = 0x300;
char eth_addr[6];
/* this is easy the ethernet interface can only be at 0x300 */
/* first check nothing is already registered here */
......@@ -668,12 +669,21 @@ unsigned long apricot_init(unsigned long mem_start, unsigned long mem_end)
if (checksum % 0x100) return mem_start;
dev = init_etherdev(0, (sizeof (struct i596_private) + 0xf), &mem_start);
for(i = 0; i < 6 ; i++)
eth_addr[i] = inb(ioaddr +8 +i));
/* Some other boards trip the checksum.. but then appear as ether
address 0. Trap these - AC */
if(memcmp(eth_addr,"\x00\x00\x00\x00\x00\x00",6)==0)
return mem_addr;
dev = init_etherdev(0, (sizeof (struct i596_private) + 0xf), &mem_start);
printk("%s: Apricot 82596 at %#3x,", dev->name, ioaddr);
for (i = 0; i < 6; i++)
printk(" %2.2X", dev->dev_addr[i] = inb(ioaddr +8 + i));
printk(" %2.2X", dev->dev_addr[i] = eth_addr[i]);
dev->base_addr = ioaddr;
dev->irq = 10;
......
......@@ -291,7 +291,7 @@ static void ewrk3_interrupt(int reg_ptr);
static int ewrk3_close(struct device *dev);
static struct enet_statistics *ewrk3_get_stats(struct device *dev);
static void set_multicast_list(struct device *dev, int num_addrs, void *addrs);
static int ewrk3_ioctl(struct device *dev, struct ifreq *rq);
static int ewrk3_ioctl(struct device *dev, struct ifreq *rq, int cmd);
/*
** Private functions
......@@ -1580,7 +1580,7 @@ static unsigned char aprom_crc(struct device *dev, unsigned char *eeprom_image,
** Perform IOCTL call functions here. Some are privileged operations and the
** effective uid is checked in those cases.
*/
static int ewrk3_ioctl(struct device *dev, struct ifreq *rq)
static int ewrk3_ioctl(struct device *dev, struct ifreq *rq, int cmd)
{
struct ewrk3_private *lp = (struct ewrk3_private *)dev->priv;
struct ewrk3_ioctl *ioc = (struct ewrk3_ioctl *) &rq->ifr_data;
......
......@@ -275,7 +275,7 @@ hp_block_output(struct device *dev, int count,
outb_p(0xff, nic_base + EN0_RSARLO);
outb_p(0x00, nic_base + EN0_RSARHI);
outb_p(E8390_RREAD+E8390_START, EN_CMD);
/* Make certain that the dummy read has occured. */
/* Make certain that the dummy read has occurred. */
inb_p(0x61);
inb_p(0x61);
#endif
......
......@@ -402,7 +402,7 @@ ne_block_output(struct device *dev, int count,
outb_p(0x42, nic_base + EN0_RSARLO);
outb_p(0x00, nic_base + EN0_RSARHI);
outb_p(E8390_RREAD+E8390_START, nic_base + NE_CMD);
/* Make certain that the dummy read has occured. */
/* Make certain that the dummy read has occurred. */
SLOW_DOWN_IO;
SLOW_DOWN_IO;
SLOW_DOWN_IO;
......
......@@ -186,7 +186,7 @@ static void plip_interrupt(int reg_ptr);
static int plip_send(struct device *dev, enum plip_nibble_state *ns_p,
unsigned char data);
static void plip_send_packet(struct device *dev);
static int plip_ioctl(struct device *dev, struct ifreq *ifr);
static int plip_ioctl(struct device *dev, struct ifreq *ifr, int cmd);
static int plip_config(struct device *dev, struct ifmap *map);
......@@ -942,7 +942,7 @@ static int plip_config(struct device *dev, struct ifmap *map)
return 0;
}
static int plip_ioctl(struct device *dev, struct ifreq *rq)
static int plip_ioctl(struct device *dev, struct ifreq *rq, int cmd)
{
struct net_local *nl = (struct net_local *) dev->priv;
struct plipconf *pc = (struct plipconf *) &rq->ifr_data;
......
......@@ -94,7 +94,7 @@ static char ppp_warning[] = KERN_WARNING "PPP: ALERT! not INUSE! %d\n";
int ppp_init(struct device *);
static void ppp_init_ctrl_blk(struct ppp *);
static int ppp_dev_open(struct device *);
static int ppp_dev_ioctl(struct device *dev, struct ifreq *ifr);
static int ppp_dev_ioctl(struct device *dev, struct ifreq *ifr, int cmd);
static int ppp_dev_close(struct device *);
static void ppp_kick_tty(struct ppp *);
......@@ -607,7 +607,7 @@ ppp_dev_close(struct device *dev)
}
#ifndef NET02D
static int ppp_dev_ioctl(struct device *dev, struct ifreq *ifr)
static int ppp_dev_ioctl(struct device *dev, struct ifreq *ifr, int cmd)
{
struct ppp *ppp = &ppp_ctrl[dev->base_addr];
int error;
......
......@@ -232,8 +232,8 @@ static char *rcsid = "$Id: sk_g16.c,v 1.1 1994/06/30 16:25:15 root Exp $";
#define SK_IORUN 0x20
/*
* LANCE interrupt: 0 = LANCE interrupt occured
* 1 = no LANCE interrupt occured
* LANCE interrupt: 0 = LANCE interrupt occurred
* 1 = no LANCE interrupt occurred
*/
#define SK_IRQ 0x10
......@@ -1408,7 +1408,7 @@ static void SK_txintr(struct device *dev)
* We check status of transmitted packet.
* see LANCE data-sheet for error explanation
*/
if (tmdstat & TX_ERR) /* Error occured */
if (tmdstat & TX_ERR) /* Error occurred */
{
printk("%s: TX error: %04x %04x\n", dev->name, (int) tmdstat,
(int) tmdp->status2);
......@@ -1440,7 +1440,7 @@ static void SK_txintr(struct device *dev)
tmdp->status2 = 0; /* Clear error flags */
}
else if (tmdstat & TX_MORE) /* Collisions occured ? */
else if (tmdstat & TX_MORE) /* Collisions occurred ? */
{
/*
* Here I have a problem.
......
......@@ -166,7 +166,7 @@ static void sl_changedmtu(struct slip *sl)
int omtu=sl->mtu;
#ifdef CONFIG_AX25
sl->mtu=dev->mtu+73
sl->mtu=dev->mtu+73;
#else
sl->mtu=dev->mtu;
#endif
......@@ -572,7 +572,7 @@ sl_open(struct device *dev)
}
#ifdef CONFIG_AX25
sl->mtu = dev->mtu+73
sl->mtu = dev->mtu+73;
#else
sl->mtu = dev->mtu;
#endif
......
......@@ -3466,7 +3466,7 @@ static void intr_dma (struct Scsi_Host *host, struct NCR53c7x0_cmd *cmd) {
if (dstat & DSTAT_OPC) {
/*
* Ascertain if this IID interrupts occured before or after a STO
* Ascertain if this IID interrupts occurred before or after a STO
* interrupt. Since the interrupt handling code now leaves
* DSP unmodified until _after_ all stacked interrupts have been
* processed, reading the DSP returns the original DSP register.
......
......@@ -47,6 +47,11 @@ SCSI_OBJS := $(SCSI_OBJS) sg.o
SCSI_SRCS := $(SCSI_SRCS) sg.c
endif
ifdef CONFIG_SCSI_QLOGIC
SCSI_OBJS := $(SCSI_OBJS) qlogic.o
SCSI_SRCS := $(SCSI_SRCS) qlogic.c
endif
ifdef CONFIG_SCSI_AHA152X
SCSI_OBJS := $(SCSI_OBJS) aha152x.o
SCSI_SRCS := $(SCSI_SRCS) aha152x.c
......
......@@ -1647,7 +1647,7 @@ static int NCR5380_transfer_dma (struct Scsi_Host *instance,
NCR5380_write(MODE_REG, MR_BASE | MR_DMA_MODE);
#else
/*
* Note : on my sample board, watch-dog timeouts occured when interrupts
* Note : on my sample board, watch-dog timeouts occurred when interrupts
* were not disabled for the duration of a single DMA transfer, from
* before the setting of DMA mode to after transfer of the last byte.
*/
......@@ -1971,7 +1971,7 @@ static void NCR5380_information_transfer (struct Scsi_Host *instance) {
}
/*
* The prefered transfer method is going to be
* The preferred transfer method is going to be
* PSEUDO-DMA for systems that are strictly PIO,
* since we can let the hardware do the handshaking.
*
......
......@@ -56,7 +56,7 @@
/*
* The contents of the OUTPUT DATA register are asserted on the bus when
* either arbitration is occuring or the phase-indicating signals (
* either arbitration is occurring or the phase-indicating signals (
* IO, CD, MSG) in the TARGET COMMAND register and the ASSERT DATA
* bit in the INITIATOR COMMAND register is set.
*/
......
RANDOM NOTES ON THE QLOGIC SCSI DRIVER
This driver does NOT support the PCI version. It is a different chip.
It DOES support the ISA, VLB, and PCMCIA versions of the Qlogic FastSCSI!
cards as well as any other card based on the chip (including the Control
Concepts SCSI/IDE/SIO/PIO/FDC cards).
PCMCIA SUPPORT
This currently only works if the card is enabled first from DOS. This means
you will have to load your socket and card services, and QL41DOS.SYS and
QL40ENBL.SYS. These are a minimum, but loading the rest of the modules
won't interfere with the operation. The next thing to do is load the kernel
without resetting the hardware, which can be a simple ctrl-alt-delete with
a boot floppy, or by using loadlin with the kernel image accessable from
DOS. If you are using the Linux PCMCIA driver, you will have to adjust
it or otherwise stop it from configuring the card.
I am working with the PCMCIA group to make it more flexible, but that may
take a while.
ALL CARDS
The top of the qlogic.c file has a number of defines that controls
configuration. As shipped, it provides a balance between speed and
function. If there are any problems, try setting SLOW_CABLE to 1, and
then try changing USE_IRQ and TURBO_PDMA to zero. If you are familiar
with SCSI, there are other settings which can tune the bus.
It may be a good idea to enable RESET_AT_START, especially if the devices
may not have been just powered up, or if you are restarting after a crash,
since they may be busy trying to complete the last command or something.
It comes up faster if this is set to zero, and if you have reliable
hardware and connections it may be more useful to not reset things.
SOME TROUBLESHOOTING TIPS
Make sure it works properly under DOS. You should also do an inital FDISK
on a new drive if you want partitions.
Don't enable all the speedups first. If anything is wrong, they will make
any problem worse.
IMPORTANT
The best way to test if your cables, termination, etc. are good is to copy
a very big file (e.g. a doublespace container file, or a very large executable
or archive). It should be at least 5 megabytes, but you can do multiple tests
on smaller files. Then do a COMP to verify that the file copied properly.
(Turn off all caching when doing these tests, otherwise you will test your
RAM and not the files). Then do 10 COMPs, comparing the same file on the
SCSI hard drive, i.e. "COMP realbig.doc realbig.doc". Then do it after the
computer gets warm.
I noticed my system which seems to work 100% would fail this test if the
computer was left on for a few hours. It was worse with longer cables, and
more devices on the SCSI bus. What seems to happen is that it gets a false
ACK causing an extra byte to be inserted into the stream (and this is not
detected). This can be caused by bad termination (the ACK can be reflected),
or by noise when the chips work less well because of the heat, or when cables
get too long for the speed.
If it doesn't work under DOS, it won't work under Linux.
This diff is collapsed.
......@@ -2,12 +2,13 @@
#define _AHA152X_H
/*
* $Id: aha152x.h,v 1.4 1994/09/12 11:32:41 root Exp $
* $Id: aha152x.h,v 1.6 1994/11/24 21:35:38 root Exp root $
*/
#if defined(__KERNEL__)
#include "../block/blk.h"
#include "scsi.h"
#if defined(__KERNEL__)
#include <asm/io.h>
int aha152x_detect(Scsi_Host_Template *);
......@@ -22,7 +23,7 @@ int aha152x_biosparam(Disk *, int, int*);
(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.4 $"
#define AHA152X_REVID "Adaptec 152x SCSI driver; $Revision: 1.6 $"
/* Initial value of Scsi_Host entry */
#define AHA152X { /* next */ NULL, \
......@@ -336,4 +337,25 @@ typedef union {
#define TESTLO(PORT, BITS) \
((inb(PORT) & (BITS)) == 0)
#ifdef DEBUG_AHA152X
enum {
debug_skipports =0x0001,
debug_queue =0x0002,
debug_intr =0x0004,
debug_selection =0x0008,
debug_msgo =0x0010,
debug_msgi =0x0020,
debug_status =0x0040,
debug_cmd =0x0080,
debug_datai =0x0100,
debug_datao =0x0200,
debug_abort =0x0400,
debug_done =0x0800,
debug_biosparam =0x1000,
debug_phases =0x2000,
debug_queues =0x4000,
debug_reset =0x8000,
};
#endif
#endif /* _AHA152X_H */
......@@ -413,7 +413,7 @@ int eata_queuecommand (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) {
}
if (k == sh[j]->can_queue) {
printk("%s: qcomm, no free mailbox, reseting.\n", BN(j));
printk("%s: qcomm, no free mailbox, resetting.\n", BN(j));
if (HD(j)->in_reset)
printk("%s: qcomm, already in reset.\n", BN(j));
......
......@@ -150,7 +150,7 @@
18C30 chip have a 2k cache). When this many 512 byte blocks are filled by
the SCSI device, an interrupt will be raised. Therefore, this could be as
low as 0, or as high as 16. Note, however, that values which are too high
or too low seem to prevent any interrupts from occuring, and thereby lock
or too low seem to prevent any interrupts from occurring, and thereby lock
up the machine. I have found that 2 is a good number, but throughput may
be increased by changing this value to values which are close to 2.
Please let me know if you try any different values.
......
......@@ -67,6 +67,10 @@
#include "pas16.h"
#endif
#ifdef CONFIG_SCSI_QLOGIC
#include "qlogic.h"
#endif
#ifdef CONFIG_SCSI_SEAGATE
#include "seagate.h"
#endif
......@@ -159,6 +163,9 @@ static Scsi_Host_Template builtin_scsi_hosts[] =
#ifdef CONFIG_SCSI_GENERIC_NCR5380
GENERIC_NCR5380,
#endif
#ifdef CONFIG_SCSI_QLOGIC
QLOGIC,
#endif
#ifdef CONFIG_SCSI_PAS16
MV_PAS16,
#endif
......
This diff is collapsed.
#ifndef _IN2000_H
/* $Id: in2000.h,v 1.1 1994/03/14 06:27:38 root Exp root $
*
* Header file for the Always IN 2000 driver for Linux
*
*/
#include <linux/types.h>
#include <linux/ioport.h>
/* The IN-2000 is based on a WD33C93 */
#define INSTAT (base + 0x0) /* R: Auxiliary Status; W: register select */
#define INDATA (base + 0x1) /* R/W: Data port */
#define INFIFO (base + 0x2) /* R/W FIFO, Word access only */
#define INREST (base + 0x3) /* W: Reset everything */
#define INFCNT (base + 0x4) /* R: FIFO byte count */
#define INFRST (base + 0x5) /* W: Reset Fifo count and to write */
#define INFWRT (base + 0x7) /* W: Set FIFO to read */
#define INFLED (base + 0x8) /* W: Set LED; R: Dip Switch settings */
#define INNLED (base + 0x9) /* W: reset LED */
#define INVERS (base + 0xa) /* R: Read hw version, end-reset */
#define ININTR (base + 0xc) /* W: Interrupt Mask Port */
#define G2CNTRL_HRDY 0x20 /* Sets HOST ready */
/* WD33C93 defines */
#define OWNID 0
#define CONTROL 1
#define TIMEOUT 2
#define TOTSECT 3
#define TOTHEAD 4
#define TOTCYLH 5
#define TOTCYLL 6
#define LADRSHH 7
#define LADRSHL 8
#define LADRSLH 9
#define LADRSLL 10
#define SECTNUM 11
#define HEADNUM 12
#define CYLNUMH 13
#define CYLNUML 14
#define TARGETU 15
#define CMDPHAS 16
#define SYNCTXR 17
#define TXCNTH 18
#define TXCNTM 19
#define TXCNTL 20
#define DESTID 21
#define SRCID 22
#define SCSIST 23
#define COMMAND 24
#define WDDATA 25
#define AUXSTAT 31
/* OWNID Register Bits */
#define OWN_EAF 0x08
#define OWN_EHP 0x10
#define OWN_FS0 0x40
#define OWN_FS1 0x80
/* AUX Register Bits */
#define AUX_DBR 0
#define AUX_PE 1
#define AUX_CIP 0x10
#define AUX_BSY 0x20
#define AUX_LCI 0x40
#define AUX_INT 0x80
/* Select timeout const, 1 count = 8ms */
#define IN2000_TMOUT 0x1f
#if 0
/* This is used with scatter-gather */
struct in2000_chain {
ulong dataptr; /* Location of data */
ulong datalen; /* Size of this part of chain */
};
#endif
/* These belong in scsi.h also */
#define any2scsi(up, p) \
(up)[0] = (((unsigned long)(p)) >> 16); \
(up)[1] = (((unsigned long)(p)) >> 8); \
(up)[2] = ((unsigned long)(p));
#define scsi2int(up) ( ((((long)*(up))&0x1f) << 16) + (((long)(up)[1]) << 8) + ((long)(up)[2]) )
#define xany2scsi(up, p) \
(up)[0] = ((long)(p)) >> 24; \
(up)[1] = ((long)(p)) >> 16; \
(up)[2] = ((long)(p)) >> 8; \
(up)[3] = ((long)(p));
#define xscsi2int(up) ( (((long)(up)[0]) << 24) + (((long)(up)[1]) << 16) \
+ (((long)(up)[2]) << 8) + ((long)(up)[3]) )
#define MAX_CDB 12
#define MAX_SENSE 14
#define MAX_STATUS 32
static int in2000_detect(Scsi_Host_Template *);
static int in2000_command(Scsi_Cmnd *);
static int in2000_queuecommand(Scsi_Cmnd *, void (*done)(Scsi_Cmnd *));
static int in2000_abort(Scsi_Cmnd *);
static int in2000_reset(Scsi_Cmnd *);
static int in2000_biosparam(Disk *, int, int*);
#ifndef NULL
#define NULL 0
#endif
/* next may be "SG_NONE" or "SG_ALL" or nr. of (1k) blocks per R/W Cmd. */
#define IN2000_SG SG_ALL
#define IN2000 {NULL, "Always IN2000", in2000_detect, NULL, \
NULL, in2000_command, \
in2000_queuecommand, \
in2000_abort, \
in2000_reset, \
NULL, \
in2000_biosparam, \
1, 7, IN2000_SG, 1, 0, 0}
#endif
This diff is collapsed.
#ifndef _QLOGIC_H
#define _QLOGIC_H
int qlogic_detect(Scsi_Host_Template * );
const char * qlogic_info(void);
int qlogic_command(Scsi_Cmnd *);
int qlogic_queuecommand(Scsi_Cmnd *, void (* done)(Scsi_Cmnd *));
int qlogic_abort(Scsi_Cmnd *);
int qlogic_reset(Scsi_Cmnd *);
int qlogic_biosparam(Disk *,int,int[]);
#ifndef NULL
#define NULL (0)
#endif
#define QLOGIC { \
NULL, \
NULL, \
qlogic_detect, \
NULL, \
qlogic_info, \
qlogic_command, \
qlogic_queuecommand, \
qlogic_abort, \
qlogic_reset, \
NULL, \
qlogic_biosparam, \
0, \
-1, \
SG_ALL, \
1, \
0, \
0, \
DISABLE_CLUSTERING \
}
#endif /* _QLOGIC_H */
......@@ -346,6 +346,13 @@ static void scan_scsis (struct Scsi_Host * shpnt)
scsi_result[0] = TYPE_ROM;
scsi_result[1] |= 0x80; /* removable */
}
SDpnt->manufactor = SCSI_MAN_UNKNOWN;
if (!strncmp(scsi_result+8,"NEC",3))
SDpnt->manufactor = SCSI_MAN_NEC;
if (!strncmp(scsi_result+8,"TOSHIBA",7))
SDpnt->manufactor = SCSI_MAN_TOSHIBA;
SDpnt->removable = (0x80 &
scsi_result[1]) >> 7;
SDpnt->lockable = SDpnt->removable;
......@@ -532,7 +539,7 @@ static void scsi_times_out (Scsi_Cmnd * SCpnt)
if (!scsi_abort (SCpnt, DID_TIME_OUT))
return;
case IN_ABORT:
printk("SCSI host %d abort() timed out - reseting\n",
printk("SCSI host %d abort() timed out - resetting\n",
SCpnt->host->host_no);
if (!scsi_reset (SCpnt))
return;
......@@ -1297,7 +1304,7 @@ static void scsi_done (Scsi_Cmnd * SCpnt)
if ((SCpnt->retries >= (SCpnt->allowed >> 1))
&& !(SCpnt->flags & WAS_RESET))
{
printk("scsi%d : reseting for second half of retries.\n",
printk("scsi%d : resetting for second half of retries.\n",
SCpnt->host->host_no);
reset(SCpnt);
break;
......
......@@ -183,7 +183,7 @@ extern const unsigned char scsi_command_size[8];
#define DRIVER_OK 0x00
/*
These indicate the error that occured, and what is available.
These indicate the error that occurred, and what is available.
*/
#define DRIVER_BUSY 0x01
......@@ -259,6 +259,13 @@ extern const unsigned char scsi_command_size[8];
as the LUN.
*/
/*
Manufactors list
*/
#define SCSI_MAN_UNKNOWN 0
#define SCSI_MAN_NEC 1
#define SCSI_MAN_TOSHIBA 2
/*
The scsi_device struct contains what we know about each given scsi
......@@ -268,6 +275,7 @@ extern const unsigned char scsi_command_size[8];
typedef struct scsi_device {
struct scsi_device * next; /* Used for linked list */
unsigned char id, lun;
unsigned int manufactor; /* Manufactor of device, for using vendor-specific cmd's */
int attached; /* # of high level drivers attached to this */
int access_count; /* Count of open channels/mounts */
struct wait_queue * device_wait; /* Used to wait if device is busy */
......
......@@ -271,6 +271,122 @@ static void rw_intr (Scsi_Cmnd * SCpnt)
}
}
/*
* Here I tried to implement better support for PhotoCD's.
*
* Much of this has do be done with vendor-specific SCSI-commands.
* So I have to complete it step by step. Useful information is welcome.
*
* Actually works: (should work ;-)
* - NEC: Detection and support of multisession CD's. Special handling
* for XA-disks is not nessesary.
*
* - TOSHIBA: setting density is done here now, mounting PhotoCD's should
* work now without running the program "set_density"
* multisession-CD's are supported too.
*
* Gerd Knorr (mailto:kraxel@cs.tu-berlin.de,
* http://www.cs.tu-berlin.de/~kraxel/)
*/
static void sr_photocd_done(Scsi_Cmnd *SCpnt)
{
SCpnt->request.dev = 0xfffe;
}
static void sr_photocd(struct inode *inode)
{
unsigned long sector,min,sec,frame;
Scsi_Cmnd *SCpnt;
unsigned char scsi_cmd[10];
unsigned char *buffer;
int rc;
switch(scsi_CDs[MINOR(inode->i_rdev)].device->manufactor) {
case SCSI_MAN_NEC:
printk("sr_photocd: use NEC code\n");
SCpnt = allocate_device(NULL, scsi_CDs[MINOR(inode->i_rdev)].device,1);
memset(scsi_cmd,0,10);
scsi_cmd[0] = 0xde;
scsi_cmd[1] = ((scsi_CDs[MINOR(inode->i_rdev)].device->lun) << 5) | 0x03;
scsi_cmd[2] = 0xb0;
buffer = (unsigned char*) scsi_malloc(512);
scsi_do_cmd(SCpnt, scsi_cmd, buffer, 0x16,
sr_photocd_done, SR_TIMEOUT, MAX_RETRIES);
while (SCpnt->request.dev != 0xfffe);
rc = SCpnt->result;
if (driver_byte(rc) != 0) {
printk("sr_photocd: oops, CD-ROM reports an error.\n");
sector = 0; }
else {
min = (unsigned long)buffer[15]/16*10 + (unsigned long)buffer[15]%16;
sec = (unsigned long)buffer[16]/16*10 + (unsigned long)buffer[16]%16;
frame = (unsigned long)buffer[17]/16*10 + (unsigned long)buffer[17]%16;
sector = min*60*75 + sec*75 + frame;
if (sector) {
printk("sr_photocd: multisession PhotoCD detected\n"); }}
scsi_free(buffer,512);
SCpnt->request.dev = -1;
break;
case SCSI_MAN_TOSHIBA:
printk("sr_photocd: use TOSHIBA code\n");
/* first I do a set_density-call (for reading XA-sectors) ... */
SCpnt = allocate_device(NULL, scsi_CDs[MINOR(inode->i_rdev)].device,1);
memset(scsi_cmd,0,10);
scsi_cmd[0] = 0x15;
scsi_cmd[1] = ((scsi_CDs[MINOR(inode->i_rdev)].device->lun) << 5)|(1 << 4);
scsi_cmd[4] = 12;
buffer = (unsigned char*) scsi_malloc(512);
memset(buffer,0,512);
buffer[ 3] = 0x08;
buffer[ 4] = 0x83;
buffer[10] = 0x08;
scsi_do_cmd(SCpnt, scsi_cmd, buffer, 12,
sr_photocd_done, SR_TIMEOUT, MAX_RETRIES);
while (SCpnt->request.dev != 0xfffe);
rc = SCpnt->result;
if (driver_byte(rc) != 0) {
printk("sr_photocd: oops, CD-ROM reports an error.\n"); }
scsi_free(buffer,512);
SCpnt->request.dev = -1;
/* ... and then I ask, if there is a multisession-Disk */
SCpnt = allocate_device(NULL, scsi_CDs[MINOR(inode->i_rdev)].device,1);
memset(scsi_cmd,0,10);
scsi_cmd[0] = 0xc7;
scsi_cmd[1] = ((scsi_CDs[MINOR(inode->i_rdev)].device->lun) << 5) | 3;
buffer = (unsigned char*) scsi_malloc(512);
memset(buffer,0,512);
scsi_do_cmd(SCpnt, scsi_cmd, buffer, 4,
sr_photocd_done, SR_TIMEOUT, MAX_RETRIES);
while (SCpnt->request.dev != 0xfffe);
rc = SCpnt->result;
if (driver_byte(rc) != 0) {
printk("sr_photocd: oops, CD-ROM reports an error.\n");
sector = 0; }
else {
min = (unsigned long)buffer[1]/16*10 + (unsigned long)buffer[1]%16;
sec = (unsigned long)buffer[2]/16*10 + (unsigned long)buffer[2]%16;
frame = (unsigned long)buffer[3]/16*10 + (unsigned long)buffer[3]%16;
sector = min*60*75 + sec*75 + frame;
if (sector) {
printk("sr_photocd: multisession PhotoCD detected: %lu\n",sector); }}
scsi_free(buffer,512);
SCpnt->request.dev = -1;
break;
case SCSI_MAN_UNKNOWN:
default:
printk("sr_photocd: there is no special photocd-code for this drive\n");
sector = 0;
break; }
scsi_CDs[MINOR(inode->i_rdev)].mpcd_sector = sector;
return;
}
static int sr_open(struct inode * inode, struct file * filp)
{
if(MINOR(inode->i_rdev) >= sr_template.nr_dev ||
......@@ -292,6 +408,8 @@ static int sr_open(struct inode * inode, struct file * filp)
if(scsi_CDs[MINOR(inode->i_rdev)].needs_sector_size)
get_sectorsize(MINOR(inode->i_rdev));
sr_photocd(inode);
return 0;
}
......@@ -437,6 +555,10 @@ work around the fact that the buffer cache has a block size of 1024,
and we have 2048 byte sectors. This code should work for buffers that
are any multiple of 512 bytes long. */
/* this is for support of multisession-CD's */
if (block >= 64 && block < 68) {
block += scsi_CDs[dev].mpcd_sector*4; }
SCpnt->use_sg = 0;
if (SCpnt->host->sg_tablesize > 0 &&
......
......@@ -24,6 +24,7 @@ typedef struct
unsigned capacity; /* size in blocks */
unsigned sector_size; /* size in bytes */
Scsi_Device *device;
unsigned long mpcd_sector; /* for reading multisession-CD's */
unsigned char sector_bit_size; /* sector size = 2^sector_bit_size */
unsigned char sector_bit_shift; /* sectors/FS block = 2^sector_bit_shift*/
unsigned needs_sector_size:1; /* needs to get sector size */
......
......@@ -463,7 +463,7 @@ int u14_34f_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *)) {
}
if (k == sh[j]->can_queue) {
printk("%s: qcomm, no free mailbox, reseting.\n", BN(j));
printk("%s: qcomm, no free mailbox, resetting.\n", BN(j));
if (HD(j)->in_reset)
printk("%s: qcomm, already in reset.\n", BN(j));
......
......@@ -119,7 +119,7 @@ static void isofs_determine_filetype(struct inode * inode)
static int isofs_file_read(struct inode * inode, struct file * filp, char * buf, int count)
{
int read,left,chars;
int block, blocks, offset;
int block, blocks, offset, total_blocks;
int bhrequest;
int ra_blocks, max_block, nextblock;
struct buffer_head ** bhb, ** bhe;
......@@ -154,6 +154,17 @@ static int isofs_file_read(struct inode * inode, struct file * filp, char * buf,
ra_blocks = read_ahead[MAJOR(inode->i_dev)] / (BLOCK_SIZE >> 9);
if(ra_blocks > blocks) blocks = ra_blocks;
/*
* this is for stopping read ahead at EOF. It's important for
* reading PhotoCD's, becauce they have many small data tracks instead
* of one big. And between two data-tracks are some unreadable sectors.
* A read ahead after a EOF may try to read such an unreadable sector.
* kraxel@cs.tu-berlin.de (Gerd Knorr)
*/
total_blocks = inode->i_size >> ISOFS_BUFFER_BITS(inode);
if (inode->i_size & (ISOFS_BUFFER_BITS(inode)-1)) total_blocks++;
while (block + blocks > total_blocks) blocks--;
max_block = (inode->i_size + BLOCK_SIZE - 1)/BLOCK_SIZE;
nextblock = -1;
......
......@@ -641,10 +641,12 @@ void mount_root(void)
memset(super_blocks, 0, sizeof(super_blocks));
fcntl_init_locks();
#ifdef CONFIG_BLK_DEV_FD
if (MAJOR(ROOT_DEV) == FLOPPY_MAJOR) {
printk(KERN_NOTICE "VFS: Insert root floppy and press ENTER\n");
wait_for_keypress();
}
#endif
memset(&filp, 0, sizeof(filp));
memset(&d_inode, 0, sizeof(d_inode));
......
......@@ -546,7 +546,7 @@ load_object (struct linux_binprm * bprm, struct pt_regs *regs, int lib_ok)
}
}
/*
* Generate any needed trap for this process. If an error occured then
* Generate any needed trap for this process. If an error occurred then
* generate a segmentation violation. If the process is being debugged
* then generate the load trap. (Note: If this is a library load then
* do not generate the trap here. Pass the error to the caller who
......
This diff is collapsed.
This diff is collapsed.
......@@ -139,7 +139,7 @@ struct device
#define HAVE_SET_MAC_ADDR
int (*set_mac_address)(struct device *dev, void *addr);
#define HAVE_PRIVATE_IOCTL
int (*do_ioctl)(struct device *dev, struct ifreq *ifr);
int (*do_ioctl)(struct device *dev, struct ifreq *ifr, int cmd);
#define HAVE_SET_CONFIG
int (*set_config)(struct device *dev, struct ifmap *map);
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -151,7 +151,7 @@ int ip_chk_addr(unsigned long addr)
return IS_BROADCAST;
}
}
if(IN_MULTICAST(addr))
if(IN_MULTICAST(ntohl(addr)))
return IS_MULTICAST;
return 0; /* no match at all */
}
......
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