Commit 008dda0c authored by Linus Torvalds's avatar Linus Torvalds

Import 1.1.29

parent 379932d2
VERSION = 1
PATCHLEVEL = 1
SUBLEVEL = 28
SUBLEVEL = 29
all: Version zImage
......
This README belongs to release 2.2 of the SoundBlaster Pro (Matsushita,
This README belongs to release 2.3 of the SoundBlaster Pro (Matsushita,
Kotobuki, Panasonic, CreativeLabs) CD-ROM driver for Linux.
The driver is able to drive the whole family of IDE-style
......@@ -48,12 +48,16 @@ CDplayer and WorkBone - tell me if it is not compatible with other software.
With the "new" drive family CR-562 and CR-563, the reading of audio frames is
possible. This is currently implemented by an IOCTL function which reads only
up to 4 frames of 2352 bytes at once. Reading more than 1 frame at once gives
very poor quality. Reading the same frame a second time gives different data;
it seems that the drive is out-of-sync at the beginning. See the program
example below. This lack has to get corrected by higher level software.
up to 4 frames of 2352 bytes at once. Reading more than 1 frame at once misses
some chunks at each frame boundary. Reading the same frame a second time gives
different data; the frame data start at a different position. But all read
bytes are valid, and we always read 98 consecutive chunks (of 24 Bytes) as a
frame. This lack has to get corrected by higher level software which reads the
same frame again and tries to find and eliminate overlapping chunks
(24-byte-pieces).
The transfer rate with reading audio (1-frame-pieces) is as slow as 32 kB/sec.
This could be better reading bigger chunks, but the out-of-sync parts occur at
This could be better reading bigger chunks, but the "missing" chunks occur at
the beginning of each single frame.
The software interface possibly may change a bit the day the SCSI driver
supports it too.
......@@ -234,15 +238,20 @@ The following little program will copy track 2 of an audio CD into the file
* (c) 1994 Eberhard Moenkeberg <emoenke@gwdg.de>
* may be used & enhanced freely
*
* Due to non-existent sync bytes at the beginning of each audio frame,
* it is currently a kind of fortune if two consecutive frames fit together.
* Usually, they overlap, or a little piece is missing. This has to get
* fixed by higher-level software (reading until an overlap occurs, and then
* eliminate the overlapping bytes). Possibly the first read bytes of each
* frame must get discarded because they are read before we got synchronized.
*
* Due to non-existent sync bytes at the beginning of each audio frame (or due
* to a firmware bug within all known drives?), it is currently a kind of
* fortune if two consecutive frames fit together.
* Usually, they overlap, or a little piece is missing. This happens in units
* of 24-byte chunks. It has to get fixed by higher-level software (reading
* until an overlap occurs, and then eliminate the overlapping chunks).
* ftp.gwdg.de:/pub/linux/misc/cdda2wav-sbpcd.*.tar.gz holds an example of
* such an algorithm.
* This example program further is missing to obtain the SubChannel data
* which belong to each frame.
*
* This is only an example of the low-level access routine. The read data are
* pure 16-bit CDDA values; they have to get converted to make sound out of
* them.
*/
#include <stdio.h>
#include <sys/ioctl.h>
......@@ -283,9 +292,10 @@ main(int argc, char *argv[])
* get and display all TocEntries
*/
fprintf(stdout, "getting TocEntries...\n");
for (i=1;i<=hdr.cdth_trk1;i++)
for (i=1;i<=hdr.cdth_trk1+1;i++)
{
entry[i].cdte_track = i;
if (i!=hdr.cdth_trk1+1) entry[i].cdte_track = i;
else entry[i].cdte_track = CDROM_LEADOUT;
entry[i].cdte_format = CDROM_LBA;
err=ioctl(drive, CDROMREADTOCENTRY, &entry[i]);
if (err!=0)
......@@ -323,7 +333,7 @@ entry[track+1].cdte_addr.lba=190;
exit (-1);
}
arg.addr.lba=entry[track].cdte_addr.lba;
arg.addr_format=CDROM_LBA; /* CDROM_MSF is still buggy, I know that */
arg.addr_format=CDROM_LBA; /* CDROM_MSF would be possible here, too. */
arg.nframes=1;
arg.buf=&buffer[0];
limit=entry[track+1].cdte_addr.lba;
......@@ -347,7 +357,7 @@ entry[track+1].cdte_addr.lba=190;
}
/*===================== end program ========================================*/
At ftp.gwdg.de:/pub/linux/misc/cdda2wav-sbpcd.tar.gz is an adapted version of
At ftp.gwdg.de:/pub/linux/misc/cdda2wav-sbpcd.*.tar.gz is an adapted version of
Heiko Eissfeldt's digital-audio to .WAV converter (the original is there, too).
This is preliminary, as Heiko himself will care about it.
......@@ -355,11 +365,7 @@ This is preliminary, as Heiko himself will care about it.
Known problems:
---------------
Currently, the detection of disk change or removal does not work as good as it
should.
The "door (un)lock" commands get done at every "(u)mount" (only the "new"
drives support it), but after an unlock, locking again does not work properly.
Currently, the detection of disk change or removal is actively disabled.
All attempts to read the UPC/EAN code result in a stream of zeroes. All my
drives are telling there is no UPC/EAN code on disk or there is, but it is an
......
......@@ -304,6 +304,7 @@ static void end_request(int uptodate)
CURRENT = req->next;
if ((p = req->waiting) != NULL) {
req->waiting = NULL;
p->swapping = 0;
p->state = TASK_RUNNING;
if (p->counter > current->counter)
need_resched = 1;
......
......@@ -184,8 +184,11 @@ static void hd_out(unsigned int drive,unsigned int nsect,unsigned int sect,
{
unsigned short port;
if (drive>1 || head>15)
panic("Trying to write bad sector");
if (drive>1 || head>15) {
printk("bad drive mapping, trying to access drive=%d, cyl=%d, head=%d, sect=%d\n",
drive, cyl, head, sect);
panic("harddisk driver problem");
}
#if (HD_DELAY > 0)
while (read_timer() - last_req < HD_DELAY)
/* nothing */;
......
......@@ -327,8 +327,12 @@ void ll_rw_page(int rw, int dev, int page, char * buffer)
req->waiting = current;
req->bh = NULL;
req->next = NULL;
current->swapping = 1;
current->state = TASK_SWAPPING;
add_request(major+blk_dev,req);
/* The I/O may have inadvertently chagned the task state.
Make sure we really wait until the I/O is done */
if (current->swapping) current->state = TASK_SWAPPING;
schedule();
}
......@@ -462,8 +466,12 @@ void ll_rw_swap_file(int rw, int dev, unsigned int *b, int nb, char *buf)
req->waiting = current;
req->bh = NULL;
req->next = NULL;
current->swapping = 1;
current->state = TASK_UNINTERRUPTIBLE;
add_request(major+blk_dev,req);
/* The I/O may have inadvertently chagned the task state.
Make sure we really wait until the I/O is done */
if (current->swapping) current->state = TASK_UNINTERRUPTIBLE;
schedule();
}
}
......
......@@ -5,7 +5,7 @@
* and for "no-sound" interfaces like Lasermate and the
* Panasonic CI-101P.
*
* NOTE: This is release 2.2.
* NOTE: This is release 2.3.
* It works with my SbPro & drive CR-521 V2.11 from 2/92
* and with the new CR-562-B V0.75 on a "naked" Panasonic
* CI-101P interface. And vice versa.
......@@ -108,10 +108,14 @@
*
* 2.1 Found bug with multisession CDs (accessing frame 16).
* "read audio" works now with address type CDROM_MSF, too.
* Bigger audio frame buffer: allows reading max. 4 frames at time; but
* reading more than one frame at once gives poor quality.
* Bigger audio frame buffer: allows reading max. 4 frames at time; this
* gives a significant speedup, but reading more than one frame at once
* gives missing chunks at each single frame boundary.
*
* 2.2
* 2.2 Kernel interface cleanups: timers, init, setup, media check.
*
* 2.3 Let "door lock" and "eject" live together.
* Implemented "close tray" (done automatically during open).
*
* TODO
*
......@@ -188,7 +192,7 @@
#include "blk.h"
#define VERSION "2.2 Eberhard Moenkeberg <emoenke@gwdg.de>"
#define VERSION "2.3 Eberhard Moenkeberg <emoenke@gwdg.de>"
#define SBPCD_DEBUG
......@@ -224,22 +228,18 @@
*/
#if !(SBPCD_ISSUE-1)
#define DO_SBPCD_REQUEST(a) do_sbpcd_request(a)
#define SBPCD_SETUP(a,b) sbpcd_setup(a,b)
#define SBPCD_INIT(a,b) sbpcd_init(a,b)
#endif
#if !(SBPCD_ISSUE-2)
#define DO_SBPCD_REQUEST(a) do_sbpcd2_request(a)
#define SBPCD_SETUP(a,b) sbpcd2_setup(a,b)
#define SBPCD_INIT(a,b) sbpcd2_init(a,b)
#endif
#if !(SBPCD_ISSUE-3)
#define DO_SBPCD_REQUEST(a) do_sbpcd3_request(a)
#define SBPCD_SETUP(a,b) sbpcd3_setup(a,b)
#define SBPCD_INIT(a,b) sbpcd3_init(a,b)
#endif
#if !(SBPCD_ISSUE-4)
#define DO_SBPCD_REQUEST(a) do_sbpcd4_request(a)
#define SBPCD_SETUP(a,b) sbpcd4_setup(a,b)
#define SBPCD_INIT(a,b) sbpcd4_init(a,b)
#endif
/*==========================================================================*/
......@@ -1269,9 +1269,14 @@ static int DriveReset(void)
if (!st_caddy_in) break;
}
while (!st_diskok);
#if 000
DriveStruct[d].CD_changed=1;
#endif
if ((st_door_closed) && (st_caddy_in))
{
i=DiskInfo();
if (i<0) return (-2);
}
return (0);
}
/*==========================================================================*/
......@@ -1311,6 +1316,21 @@ static int yy_LockDoor(char lock)
return (i);
}
/*==========================================================================*/
static int yy_CloseTray(void)
{
int i;
if (!new_drive) return (0);
DPRINTF((DBG_LCK,"SBPCD: yy_CloseTray (drive %d)\n", d));
clr_cmdbuf();
drvcmd[0]=0x07;
flags_cmd_out=f_putcmd|f_respo2|f_ResponseStatus|f_obey_p_check;
response_count=0;
i=cmd_out();
return (i);
}
/*==========================================================================*/
static int xx_ReadSubQ(void)
{
int i,j;
......@@ -1608,10 +1628,12 @@ static int xx_ReadTocEntry(int num)
DriveStruct[d].TocEnt_format=infobuf[3];
if (new_drive) i=4;
else i=5;
DriveStruct[d].TocEnt_address=make32(make16(0,infobuf[i]),make16(infobuf[i+1],infobuf[i+2]));
DriveStruct[d].TocEnt_address=make32(make16(0,infobuf[i]),
make16(infobuf[i+1],infobuf[i+2]));
DPRINTF((DBG_TOC,"SBPCD: TocEntry: %02X %02X %02X %02X %08X\n",
DriveStruct[d].TocEnt_nixbyte,DriveStruct[d].TocEnt_ctl_adr,DriveStruct[d].TocEnt_number,
DriveStruct[d].TocEnt_format,DriveStruct[d].TocEnt_address));
DriveStruct[d].TocEnt_nixbyte, DriveStruct[d].TocEnt_ctl_adr,
DriveStruct[d].TocEnt_number, DriveStruct[d].TocEnt_format,
DriveStruct[d].TocEnt_address));
return (0);
}
/*==========================================================================*/
......@@ -2527,7 +2549,11 @@ static int sbpcd_ioctl(struct inode *inode, struct file *file, u_int cmd,
DriveStruct[d].CD_changed=0xFF;
DriveStruct[d].diskstate_flags=0;
#endif WORKMAN
do i=yy_LockDoor(0);
while (i!=0);
DriveStruct[d].open_count=0; /* to get it locked next time again */
i=yy_SpinDown();
DPRINTF((DBG_IOX,"SBPCD: ioctl: yy_SpinDown returned %d.\n", i));
if (i<0) return (-EIO);
DriveStruct[d].audio_state=0;
return (0);
......@@ -3193,6 +3219,10 @@ static int sbpcd_open(struct inode *ip, struct file *fp)
}
switch_drive(i);
flags_cmd_out |= f_respo2;
xx_ReadStatus(); /* command: give 1-byte status */
i=ResponseStatus();
if (!st_door_closed) yy_CloseTray();
if (!st_spinning) xx_SpinUp();
flags_cmd_out |= f_respo2;
......@@ -3207,7 +3237,7 @@ static int sbpcd_open(struct inode *ip, struct file *fp)
if (!st_door_closed||!st_caddy_in)
{
printk("SBPCD: sbpcd_open: no disk in drive\n");
return (-EIO);
return (-ENXIO);
}
/*
......@@ -3245,7 +3275,7 @@ static void sbpcd_release(struct inode * ip, struct file * file)
switch_drive(i);
DriveStruct[d].sbp_first_frame=DriveStruct[d].sbp_last_frame=-1;
fsync_dev(ip->i_rdev); /* nonsense if read only device? */
sync_dev(ip->i_rdev); /* nonsense if read only device? */
invalidate_buffers(ip->i_rdev);
DriveStruct[d].diskstate_flags &= ~cd_size_bit;
......@@ -3254,12 +3284,15 @@ static void sbpcd_release(struct inode * ip, struct file * file)
*/
DPRINTF((DBG_LCK,"SBPCD: open_count: %d -> %d\n",
DriveStruct[d].open_count,DriveStruct[d].open_count-1));
if (DriveStruct[d].open_count!=0) /* CDROMEJECT may have been done */
{
if (--DriveStruct[d].open_count==0)
{
do
i=yy_LockDoor(0);
while (i!=0);
}
}
}
/*==========================================================================*/
/*
......@@ -3305,7 +3338,7 @@ static struct file_operations sbpcd_fops =
#if (SBPCD_ISSUE-1)
static
#endif
void SBPCD_SETUP(char *s, int *p)
void sbpcd_setup(char *s, int *p)
{
DPRINTF((DBG_INI,"SBPCD: sbpcd_setup called with %04X,%s\n",p[1], s));
sbpro_type=0;
......@@ -3422,7 +3455,7 @@ unsigned long SBPCD_INIT(u_long mem_start, u_long mem_end)
if (autoprobe[port_index+1]==0) type=str_lm;
else if (autoprobe[port_index+1]==1) type=str_sb;
else type=str_sp;
SBPCD_SETUP(type, addr);
sbpcd_setup(type, addr);
DPRINTF((DBG_INF,"SBPCD: Trying to detect a %s CD-ROM drive at 0x%X.\n",
type, CDo_command));
......
/* 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 Supercomputing Research Ctr., 17100 Science Dr., Bowie MD 20715
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:v0.03 2/6/94 Donald Becker (becker@super.org)\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 at %#x-%#x.\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=%d...", 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.
......@@ -220,7 +220,7 @@ static void scan_scsis (struct Scsi_Host * shpnt)
int dev, lun, type;
unsigned char scsi_cmd [12];
unsigned char scsi_result [256];
Scsi_Device * SDpnt;
Scsi_Device * SDpnt, *SDtail;
Scsi_Cmnd SCmd;
++in_scan;
......@@ -229,6 +229,10 @@ static void scan_scsis (struct Scsi_Host * shpnt)
SCmd.next = NULL;
SCmd.prev = NULL;
SDpnt = (Scsi_Device *) scsi_init_malloc(sizeof (Scsi_Device));
SDtail = scsi_devices;
if(scsi_devices) {
while(SDtail->next) SDtail = SDtail->next;
}
shpnt->host_queue = &SCmd; /* We need this so that
commands can time out */
......@@ -465,8 +469,13 @@ static void scan_scsis (struct Scsi_Host * shpnt)
while (SCmd.request.dev != 0xfffe);
};
SDpnt->next = scsi_devices;
/* Add this device to the linked list at the end */
if(SDtail)
SDtail->next = SDpnt;
else
scsi_devices = SDpnt;
SDtail = SDpnt;
++NR_SCSI_DEVICES;
SDpnt = (Scsi_Device *) scsi_init_malloc(sizeof (Scsi_Device));
/* Some scsi devices cannot be polled for lun != 0
......
......@@ -556,6 +556,7 @@ static void end_scsi_request(Scsi_Cmnd * SCpnt, int uptodate, int sectors)
DEVICE_OFF(req->dev);
if ((p = req->waiting) != NULL) {
req->waiting = NULL;
p->swapping = 0;
p->state = TASK_RUNNING;
if (p->counter > current->counter)
need_resched = 1;
......@@ -585,20 +586,17 @@ static void end_scsi_request(Scsi_Cmnd * SCpnt, int uptodate, int sectors)
#endif
#define SCSI_SLEEP(QUEUE, CONDITION) { \
long old_state; \
if (CONDITION) { \
struct wait_queue wait = { current, NULL}; \
add_wait_queue(QUEUE, &wait); \
sleep_repeat: \
old_state = current->state; \
current->state = TASK_UNINTERRUPTIBLE; \
if (CONDITION) { \
schedule(); \
goto sleep_repeat; \
} \
remove_wait_queue(QUEUE, &wait); \
if (current->state == TASK_UNINTERRUPTIBLE) \
current->state = old_state; \
current->state = TASK_RUNNING; \
}; }
#endif
......@@ -17,7 +17,10 @@
#define CD_MINS 74 /* max. minutes per CD */
#define CD_SECS 60 /* seconds per minute */
#define CD_FRAMES 75 /* frames per second */
#define CD_CHUNK_SIZE 24 /* lowest-level "data bytes piece" */
#define CD_NUM_OF_CHUNKS 98 /* chunks per frame */
#define CD_FRAMESIZE 2048 /* bytes per frame, cooked mode */
#define CD_FRAMESIZE_RAW0 2336 /* bytes per frame, "raw" mode */
#define CD_FRAMESIZE_XA 2340 /* bytes per frame, "xa" mode */
#define CD_FRAMESIZE_RAW 2352 /* bytes per frame, "raw" mode */
#define CD_FRAMESIZE_SUB 96 /* subchannel data size */
......
......@@ -264,6 +264,7 @@ struct task_struct {
unsigned long personality;
int dumpable:1;
int did_exec:1;
volatile int swapping:1;
int pid,pgrp,session,leader;
int groups[NGROUPS];
/*
......@@ -331,7 +332,7 @@ struct task_struct {
/* schedlink */ &init_task,&init_task, \
/* signals */ {{ 0, },}, \
/* stack */ 0,(unsigned long) &init_kernel_stack, \
/* ec,brk... */ 0,0,0,0,0, \
/* ec,brk... */ 0,0,0,0,0,0, \
/* pid etc.. */ 0,0,0,0, \
/* suppl grps*/ {NOGROUP,}, \
/* proc links*/ &init_task,&init_task,NULL,NULL,NULL,NULL, \
......
......@@ -188,6 +188,7 @@ asmlinkage int sys_fork(struct pt_regs regs)
(*p->binfmt->use_count)++;
p->did_exec = 0;
p->swapping = 0;
p->kernel_stack_page = 0;
p->state = TASK_UNINTERRUPTIBLE;
p->flags &= ~(PF_PTRACED|PF_TRACESYS);
......
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