Commit 46810eb7 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.1.63

parent 1b7a152c
...@@ -11,6 +11,16 @@ N: Werner Almesberger ...@@ -11,6 +11,16 @@ N: Werner Almesberger
E: almesber@bernina.ethz.ch E: almesber@bernina.ethz.ch
D: dosfs, LILO, some fd features, various other hacks here and there D: dosfs, LILO, some fd features, various other hacks here and there
N: Derek Atkins
E: warlord@MIT.EDU
D: Linux-AFS Port, random kernel hacker,
D: VFS fixes (new notify_change in particular)
D: Moving all VFS access checks into the file systems
S: MIT Room E15-341
S: 20 Ames St.
S: Cambridge, Massachusetts 02139
S: USA
N: John Aycock N: John Aycock
E: aycock@cpsc.ucalgary.ca E: aycock@cpsc.ucalgary.ca
D: Adaptec 274x driver D: Adaptec 274x driver
...@@ -148,6 +158,12 @@ N: Wayne Davison ...@@ -148,6 +158,12 @@ N: Wayne Davison
E: davison@borland.com E: davison@borland.com
D: Second extended file system co-designer D: Second extended file system co-designer
N: Terry Dawson
E: terryd@extro.ucc.su.oz.au
E: vk2ktj@gw.vk2ktj.ampr.org (Amateur Radio use only)
D: NET-2-HOWTO author.
D: RADIOLINUX Amateur Radio software for Linux list collator.
N: Todd J. Derr N: Todd J. Derr
E: tjd@cs.pitt.edu E: tjd@cs.pitt.edu
D: maintainer of dual-monitor patches for 1.0+ D: maintainer of dual-monitor patches for 1.0+
...@@ -296,13 +312,14 @@ S: Dulles, Virginia 20166 ...@@ -296,13 +312,14 @@ S: Dulles, Virginia 20166
S: USA S: USA
N: Nick Holloway N: Nick Holloway
E: alfie@dcs.warwick.ac.uk E: Nick.Holloway@alfie.demon.co.uk
E: Nick.Holloway@parallax.co.uk
D: Small patches for kernel, libc D: Small patches for kernel, libc
D: Makedev D: MAKEDEV
S: Department of Computer Science S: 15 Duke Street
S: University of Warwick S: Chapelfields
S: Coventry S: Coventry
S: CV4 7AL S: CV5 8BZ
S: United Kingdom S: United Kingdom
N: Ron Holt N: Ron Holt
...@@ -391,6 +408,13 @@ S: 11, rue General Mangin ...@@ -391,6 +408,13 @@ S: 11, rue General Mangin
S: 38100 Grenoble S: 38100 Grenoble
S: France S: France
N: Harald Koenig
E: koenig@tat.physik.uni-tuebingen.de
D: XFree86 (S3), DCF77, some kernel hacks and fixes
S: Koenigsberger Str. 90
S: D-72336 Balingen
S: Germany
N: Rudolf Koenig N: Rudolf Koenig
E: rfkoenig@immd4.informatik.uni-erlangen.de E: rfkoenig@immd4.informatik.uni-erlangen.de
D: The Linux Support Team Erlangen D: The Linux Support Team Erlangen
...@@ -409,6 +433,13 @@ S: 18 Board Street ...@@ -409,6 +433,13 @@ S: 18 Board Street
S: Doncaster VIC 3108 S: Doncaster VIC 3108
S: Australia S: Australia
N: Hans Lermen
E: lermen@elserv.ffm.fgan.de
D: Author of the LOADLIN Linux loader
S: Am Muehlenweg 38
S: D53424 Remagen
S: Germany
N: Mark Lord N: Mark Lord
E: mlord@bnr.ca E: mlord@bnr.ca
E: mlord@achilles.net E: mlord@achilles.net
...@@ -819,7 +850,6 @@ S: USA ...@@ -819,7 +850,6 @@ S: USA
N: Eric Youngdale N: Eric Youngdale
E: eric@aib.com E: eric@aib.com
E: ericy@cais.com
D: General kernel hacker D: General kernel hacker
D: SCSI iso9660 and ELF D: SCSI iso9660 and ELF
S: 17 Canterbury Square #101 S: 17 Canterbury Square #101
......
VERSION = 1 VERSION = 1
PATCHLEVEL = 1 PATCHLEVEL = 1
SUBLEVEL = 62 SUBLEVEL = 63
ARCH = i386 ARCH = i386
...@@ -132,7 +132,11 @@ tools/./version.h: tools/version.h ...@@ -132,7 +132,11 @@ tools/./version.h: tools/version.h
tools/version.h: $(CONFIGURE) Makefile tools/version.h: $(CONFIGURE) Makefile
@./makever.sh @./makever.sh
@echo \#define UTS_RELEASE \"$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)\" > tools/version.h @echo \#define UTS_RELEASE \"$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)\" > tools/version.h
@echo \#define UTS_VERSION \"\#`cat .version` `date`\" >> tools/version.h @if [ -f .name ]; then \
echo \#define UTS_VERSION \"\#`cat .version`-`cat .name` `date`\"; \
else \
echo \#define UTS_VERSION \"\#`cat .version` `date`\"; \
fi >> tools/version.h
@echo \#define LINUX_COMPILE_TIME \"`date +%T`\" >> tools/version.h @echo \#define LINUX_COMPILE_TIME \"`date +%T`\" >> tools/version.h
@echo \#define LINUX_COMPILE_BY \"`whoami`\" >> tools/version.h @echo \#define LINUX_COMPILE_BY \"`whoami`\" >> tools/version.h
@echo \#define LINUX_COMPILE_HOST \"`hostname`\" >> tools/version.h @echo \#define LINUX_COMPILE_HOST \"`hostname`\" >> tools/version.h
......
...@@ -12,7 +12,7 @@ AS86 =as86 -0 -a ...@@ -12,7 +12,7 @@ AS86 =as86 -0 -a
LD86 =ld86 -0 LD86 =ld86 -0
AS =as AS =as
LD =ld LD =ld
HOSTCC =gcc HOSTCC =gcc -I$(TOPDIR)/include
CC =gcc -D__KERNEL__ -I$(TOPDIR)/include CC =gcc -D__KERNEL__ -I$(TOPDIR)/include
MAKE =make MAKE =make
CPP =$(CC) -E CPP =$(CC) -E
......
This README belongs to release 2.7 or newer of the SoundBlaster Pro This README belongs to release 2.8 or newer of the SoundBlaster Pro
(Matsushita, Kotobuki, Panasonic, CreativeLabs) CD-ROM driver for Linux. (Matsushita, Kotobuki, Panasonic, CreativeLabs) CD-ROM driver for Linux.
The driver is able to drive the whole family of "traditional" IDE-style (that The driver is able to drive the whole family of "traditional" IDE-style (that
...@@ -6,6 +6,9 @@ has nothing to do with the new "Enhanced IDE" drive standard) Matsushita, ...@@ -6,6 +6,9 @@ has nothing to do with the new "Enhanced IDE" drive standard) Matsushita,
Kotobuki, Panasonic drives, sometimes labelled as "CreativeLabs". The Kotobuki, Panasonic drives, sometimes labelled as "CreativeLabs". The
well-known drives are CR-521, CR-522, CR-523, CR-562, CR-563. well-known drives are CR-521, CR-522, CR-523, CR-562, CR-563.
The Longshine LCS-7260 is a double-speed drive which uses the "old"
Matsushita command set. It should be fully supported soon, too.
There exists an "IBM External ISA CD-ROM Drive" which in fact is a CR-562 There exists an "IBM External ISA CD-ROM Drive" which in fact is a CR-562
with a special controller board. This drive is supported (the interface is with a special controller board. This drive is supported (the interface is
of the "LaserMate" type), and it is possibly the best buy today (cheaper than of the "LaserMate" type), and it is possibly the best buy today (cheaper than
...@@ -20,21 +23,22 @@ interfaces does NOT make the drives compatible. :-) ...@@ -20,21 +23,22 @@ interfaces does NOT make the drives compatible. :-)
It will work with the soundcard interfaces (SB Pro, SB 16, Galaxy, SoundFX, It will work with the soundcard interfaces (SB Pro, SB 16, Galaxy, SoundFX,
...) and/or with the "no-sound" cards (Panasonic CI-101P, LaserMate, ...) and/or with the "no-sound" cards (Panasonic CI-101P, LaserMate,
WDH-7001C, older Aztech cards, ...). WDH-7001C, Longshine LCS-6853, older Aztech cards, ...).
It should work too now with the "configurable" interface "Sequoia S-1000", It should work too now with the "configurable" interface "Sequoia S-1000",
which is found on the Spea Media FX sound card. I still need feedback about which is found on the Spea Media FX sound card. I still need feedback about
this. this.
The interface type has to get configured in /usr/include/linux/sbpcd.h, The interface type has to get configured in /usr/include/linux/sbpcd.h,
because the behavior is different. because the behavior of some sound card interfaces is different.
The driver respects different drive firmware releases - my old drive is a 2.11, The driver respects different drive firmware releases - my old drive is a 2.11,
but it should work with "old" drives <2.01 ... >3.00 and with "new" drives but it should work with "old" drives <2.01 ... >3.00 and with "new" drives
(which count the releases around 0.75 or 1.00). (which count the releases around 0.75 or 1.00).
Up to 4 drives per interface card, and up to 4 interface cards are supported. Up to 4 drives per interface card, and up to 4 interface cards are supported.
CR-52x ("old") and CR-56x ("new") drives can be mixed, but the CR-521 ones are CR-52x ("old"), CR-56x ("new") and LCS drives can be mixed, but the CR-521
hard-wired to drive ID 0. The drives have to use different drive IDs, and each ones are hard-wired to drive ID 0. The drives have to use different drive IDs,
drive has to get a unique minor number (0...3), corresponding to it's drive ID. and each drive has to get a unique minor number (0...3), corresponding to it's
drive ID.
The drive IDs may be selected freely from 0 to 3 - they do not have to be in The drive IDs may be selected freely from 0 to 3 - they do not have to be in
consecutive order. consecutive order.
......
...@@ -4,8 +4,10 @@ ...@@ -4,8 +4,10 @@
* SoundBlaster ("Pro" or "16 ASP" or compatible) cards * SoundBlaster ("Pro" or "16 ASP" or compatible) cards
* and for "no-sound" interfaces like Lasermate and the * and for "no-sound" interfaces like Lasermate and the
* Panasonic CI-101P. * Panasonic CI-101P.
* Also for the Longshine LCS-7260 drive.
* Also for the IBM "External ISA CD-Rom" drive.
* *
* NOTE: This is release 2.7. * NOTE: This is release 2.8.
* It works with my SbPro & drive CR-521 V2.11 from 2/92 * 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 * and with the new CR-562-B V0.75 on a "naked" Panasonic
* CI-101P interface. And vice versa. * CI-101P interface. And vice versa.
...@@ -132,6 +134,19 @@ ...@@ -132,6 +134,19 @@
* 0 disables, 1 enables auto-ejecting. Useful to keep the tray in * 0 disables, 1 enables auto-ejecting. Useful to keep the tray in
* during shutdown. * during shutdown.
* *
* 2.8 Added first support (still BETA, I need feedback or a drive) for
* the Longshine LCS-7260 drives. They appear as double-speed drives
* using the "old" command scheme, extended by tray control and door
* lock functions.
* Found (and fixed preliminary) a flaw with some multisession CDs: we
* have to re-direct not only the accesses to frame 16 (the isofs
* routines drive it up to max. 100), but also those to the continuation
* (repetition) frames (as far as they exist - currently set fix as
* 16..20).
* Changed default of the "JUKEBOX" define. If you use this default,
* your tray will eject if you try to mount without a disk in. Next
* mount command will insert the tray - so, just insert a disk. ;-)
*
* TODO * TODO
* *
* disk change detection * disk change detection
...@@ -207,7 +222,7 @@ ...@@ -207,7 +222,7 @@
#include "blk.h" #include "blk.h"
#define VERSION "2.7 Eberhard Moenkeberg <emoenke@gwdg.de>" #define VERSION "2.8 Eberhard Moenkeberg <emoenke@gwdg.de>"
#define SBPCD_DEBUG #define SBPCD_DEBUG
...@@ -223,7 +238,7 @@ ...@@ -223,7 +238,7 @@
/* /*
* still testing around... * still testing around...
*/ */
#define JUKEBOX 0 /* tray control: eject tray if no disk is in */ #define JUKEBOX 1 /* tray control: eject tray if no disk is in */
#define EJECT 1 /* tray control: eject tray after last use */ #define EJECT 1 /* tray control: eject tray after last use */
#define LONG_TIMING 0 /* test against timeouts with "gold" CDs on CR-521 */ #define LONG_TIMING 0 /* test against timeouts with "gold" CDs on CR-521 */
#define MANY_SESSION 0 /* this will conflict with "true" multi-session! */ #define MANY_SESSION 0 /* this will conflict with "true" multi-session! */
...@@ -441,8 +456,9 @@ static struct wait_queue *sbp_waitq = NULL; ...@@ -441,8 +456,9 @@ static struct wait_queue *sbp_waitq = NULL;
/*==========================================================================*/ /*==========================================================================*/
static u_char drive_family[]="CR-5"; static u_char drive_family[]="CR-5"; /* Panasonic CR-56x */
static u_char drive_vendor[]="MATSHITA"; static u_char lcs_family[]="LCS-"; /* Longshine LCS-7260 */
static u_char drive_vendor[]="MATSHITA"; /* Matsushita CR-52x */
static u_int response_count=0; static u_int response_count=0;
static u_int flags_cmd_out; static u_int flags_cmd_out;
...@@ -509,6 +525,7 @@ static struct { ...@@ -509,6 +525,7 @@ static struct {
u_char f_multisession; u_char f_multisession;
u_int lba_multi; u_int lba_multi;
u_int last_redirect;
u_char audio_state; u_char audio_state;
u_int pos_audio_start; u_int pos_audio_start;
...@@ -1065,16 +1082,21 @@ static int xx_SpinUp(void) ...@@ -1065,16 +1082,21 @@ static int xx_SpinUp(void)
DPRINTF((DBG_SPI,"SBPCD: SpinUp.\n")); DPRINTF((DBG_SPI,"SBPCD: SpinUp.\n"));
DriveStruct[d].in_SpinUp = 1; DriveStruct[d].in_SpinUp = 1;
clr_cmdbuf(); clr_cmdbuf();
if (!new_drive) if (old_drive)
{ {
drvcmd[0]=0x05; drvcmd[0]=0x05;
flags_cmd_out=f_putcmd|f_respo2|f_lopsta|f_getsta|f_ResponseStatus|f_obey_p_check|f_bit1; flags_cmd_out=f_putcmd|f_respo2|f_lopsta|f_getsta|f_ResponseStatus|f_obey_p_check|f_bit1;
} }
else else if (new_drive)
{ {
drvcmd[0]=0x02; drvcmd[0]=0x02;
flags_cmd_out=f_putcmd|f_respo2|f_ResponseStatus|f_obey_p_check; flags_cmd_out=f_putcmd|f_respo2|f_ResponseStatus|f_obey_p_check;
} }
else /* lcs_drive */
{
drvcmd[0]=0x0D;
flags_cmd_out=f_putcmd|f_respo2|f_lopsta|f_getsta|f_ResponseStatus|f_obey_p_check|f_bit1;
}
response_count=0; response_count=0;
i=cmd_out(); i=cmd_out();
DriveStruct[d].in_SpinUp = 0; DriveStruct[d].in_SpinUp = 0;
...@@ -1085,11 +1107,21 @@ static int yy_SpinDown(void) ...@@ -1085,11 +1107,21 @@ static int yy_SpinDown(void)
{ {
int i; int i;
if (!new_drive) return (-3); if (old_drive) return (-3);
clr_cmdbuf(); clr_cmdbuf();
drvcmd[0]=0x06; if (new_drive)
flags_cmd_out=f_putcmd|f_respo2|f_ResponseStatus|f_obey_p_check; {
response_count=0; drvcmd[0]=0x06;
flags_cmd_out=f_putcmd|f_respo2|f_ResponseStatus|f_obey_p_check;
response_count=0;
}
else /* lcs_drive */
{
drvcmd[0]=0x0D;
drvcmd[1]=1;
flags_cmd_out=f_putcmd|f_respo2|f_ResponseStatus|f_obey_p_check;
response_count=0;
}
i=cmd_out(); i=cmd_out();
return (i); return (i);
} }
...@@ -1165,7 +1197,18 @@ static int xx_SetVolume(void) ...@@ -1165,7 +1197,18 @@ static int xx_SetVolume(void)
drvcmd[6]=value1; drvcmd[6]=value1;
flags_cmd_out=f_putcmd|f_ResponseStatus|f_obey_p_check; flags_cmd_out=f_putcmd|f_ResponseStatus|f_obey_p_check;
} }
else else if (lcs_drive)
{
if ((volume0==0)||(channel0!=0)) control0 |= 0x80;
if ((volume1==0)||(channel1!=1)) control0 |= 0x40;
if (volume0|volume1) value0=0x80;
drvcmd[0]=0x84;
drvcmd[1]=0x03;
drvcmd[4]=control0;
drvcmd[5]=value0;
flags_cmd_out=f_putcmd|f_getsta|f_ResponseStatus|f_obey_p_check;
}
else /* old_drive, different firmware levels */
{ {
if (DriveStruct[d].drv_type>=drv_300) if (DriveStruct[d].drv_type>=drv_300)
{ {
...@@ -1336,13 +1379,23 @@ static int yy_LockDoor(char lock) ...@@ -1336,13 +1379,23 @@ static int yy_LockDoor(char lock)
{ {
int i; int i;
if (!new_drive) return (0); if (old_drive) return (0);
DPRINTF((DBG_LCK,"SBPCD: yy_LockDoor: %d (drive %d)\n", lock, d)); DPRINTF((DBG_LCK,"SBPCD: yy_LockDoor: %d (drive %d)\n", lock, d));
clr_cmdbuf(); clr_cmdbuf();
drvcmd[0]=0x0C; if (new_drive)
if (lock==1) drvcmd[1]=0x01; {
flags_cmd_out=f_putcmd|f_ResponseStatus|f_obey_p_check; drvcmd[0]=0x0C;
response_count=0; if (lock==1) drvcmd[1]=0x01;
flags_cmd_out=f_putcmd|f_ResponseStatus|f_obey_p_check;
response_count=0;
}
else /* lcs_drive */
{
drvcmd[0]=0x0E;
if (lock==1) drvcmd[1]=0x01;
flags_cmd_out=f_putcmd|f_ResponseStatus|f_obey_p_check;
response_count=0;
}
i=cmd_out(); i=cmd_out();
return (i); return (i);
} }
...@@ -1533,7 +1586,16 @@ static int xx_TellVolume(void) ...@@ -1533,7 +1586,16 @@ static int xx_TellVolume(void)
chan0 >>= 1; chan0 >>= 1;
chan1 >>= 1; chan1 >>= 1;
} }
else else if (lcs_drive)
{
chan0=0;
chan1=1;
vol0=vol1=infobuf[1];
switches=infobuf[0];
if ((switches&0x80)!=0) chan0=1;
if ((switches&0x40)!=0) chan1=0;
}
else /* old_drive, different firmware levels */
{ {
chan0=0; chan0=0;
chan1=1; chan1=1;
...@@ -1783,7 +1845,6 @@ static int yy_CheckMultiSession(void) ...@@ -1783,7 +1845,6 @@ static int yy_CheckMultiSession(void)
{ {
int i; int i;
DriveStruct[d].diskstate_flags &= ~multisession_bit;
DriveStruct[d].f_multisession=0; DriveStruct[d].f_multisession=0;
clr_cmdbuf(); clr_cmdbuf();
if (new_drive) if (new_drive)
...@@ -1801,9 +1862,38 @@ static int yy_CheckMultiSession(void) ...@@ -1801,9 +1862,38 @@ static int yy_CheckMultiSession(void)
DriveStruct[d].f_multisession=1; DriveStruct[d].f_multisession=1;
DriveStruct[d].lba_multi=msf2blk(make32(make16(0,infobuf[1]), DriveStruct[d].lba_multi=msf2blk(make32(make16(0,infobuf[1]),
make16(infobuf[2],infobuf[3]))); make16(infobuf[2],infobuf[3])));
DriveStruct[d].last_redirect=20;
/* preliminary - has to get adjusted the following way:
* look at the first byte of frames 17 ff. until 0xFF is seen
* the frame before this one is the last continuation frame
*/
}
}
else if (lcs_drive)
{
drvcmd[0]=0x8C;
drvcmd[1]=3;
drvcmd[2]=1;
response_count=8;
flags_cmd_out=f_putcmd|f_ResponseStatus|f_obey_p_check;
i=cmd_out();
if (i<0) return (i);
DPRINTF((DBG_MUL,"SBPCD: MultiSession Info: %02X %02X %02X %02X %02X %02X %02X %02X\n",
infobuf[0], infobuf[1], infobuf[2], infobuf[3],
infobuf[4], infobuf[5], infobuf[6], infobuf[7]));
DriveStruct[d].lba_multi=msf2blk(make32(make16(0,infobuf[5]),
make16(infobuf[6],infobuf[7])));
if (DriveStruct[d].lba_multi>200)
{
DPRINTF((DBG_MUL,"SBPCD: MultiSession base: %06X\n", DriveStruct[d].lba_multi));
DriveStruct[d].f_multisession=1;
DriveStruct[d].last_redirect=20;
/* preliminary - has to get adjusted the following way:
* look at the first byte of frames 17 ff. until 0xFF is seen;
* the frame before this one is the last repetition frame.
*/
} }
} }
DriveStruct[d].diskstate_flags |= multisession_bit;
return (0); return (0);
} }
/*==========================================================================*/ /*==========================================================================*/
...@@ -1905,6 +1995,7 @@ static int check_version(void) ...@@ -1905,6 +1995,7 @@ static int check_version(void)
for (i=0;i<12;i++) DPRINTF((DBG_INI,"%c",infobuf[i])); for (i=0;i<12;i++) DPRINTF((DBG_INI,"%c",infobuf[i]));
DPRINTF((DBG_INI,"\"\n")); DPRINTF((DBG_INI,"\"\n"));
DriveStruct[d].drv_type=0;
for (i=0;i<4;i++) if (infobuf[i]!=drive_family[i]) break; for (i=0;i<4;i++) if (infobuf[i]!=drive_family[i]) break;
if (i==4) if (i==4)
{ {
...@@ -1914,35 +2005,54 @@ static int check_version(void) ...@@ -1914,35 +2005,54 @@ static int check_version(void)
DriveStruct[d].drive_model[3]='x'; DriveStruct[d].drive_model[3]='x';
DriveStruct[d].drv_type=drv_new; DriveStruct[d].drv_type=drv_new;
} }
else if (!DriveStruct[d].drv_type)
{ {
for (i=0;i<8;i++) if (infobuf[i]!=drive_vendor[i]) break; for (i=0;i<8;i++) if (infobuf[i]!=drive_vendor[i]) break;
if (i!=8) if (i==8)
{ {
DPRINTF((DBG_INI,"SBPCD: check_version: error.\n")); DriveStruct[d].drive_model[0]='2';
return (-1); DriveStruct[d].drive_model[1]='x';
DriveStruct[d].drive_model[2]='-';
DriveStruct[d].drive_model[3]='x';
DriveStruct[d].drv_type=drv_old;
} }
DriveStruct[d].drive_model[0]='2';
DriveStruct[d].drive_model[1]='x';
DriveStruct[d].drive_model[2]='-';
DriveStruct[d].drive_model[3]='x';
DriveStruct[d].drv_type=drv_old;
} }
for (j=0;j<4;j++) DriveStruct[d].firmware_version[j]=infobuf[i+j]; if (!DriveStruct[d].drv_type)
j = (DriveStruct[d].firmware_version[0] & 0x0F) * 100 + {
(DriveStruct[d].firmware_version[2] & 0x0F) *10 + for (i=0;i<4;i++) if (infobuf[i]!=lcs_family[i]) break;
(DriveStruct[d].firmware_version[3] & 0x0F); if (i==4)
if (new_drive) {
DriveStruct[d].drive_model[0]=infobuf[i++];
DriveStruct[d].drive_model[1]=infobuf[i++];
DriveStruct[d].drive_model[2]=infobuf[i++];
DriveStruct[d].drive_model[3]=infobuf[i++];
DriveStruct[d].drv_type=drv_lcs;
}
}
if (!DriveStruct[d].drv_type)
{
DPRINTF((DBG_INI,"SBPCD: check_version: error.\n"));
return (-1);
}
if (lcs_drive) DriveStruct[d].drv_type=drv_260; /* still needs a closer look */
else
{ {
if (j<100) DriveStruct[d].drv_type=drv_099; for (j=0;j<4;j++) DriveStruct[d].firmware_version[j]=infobuf[i+j];
else DriveStruct[d].drv_type=drv_100; j = (DriveStruct[d].firmware_version[0] & 0x0F) * 100 +
(DriveStruct[d].firmware_version[2] & 0x0F) *10 +
(DriveStruct[d].firmware_version[3] & 0x0F);
if (new_drive)
{
if (j<100) DriveStruct[d].drv_type=drv_099;
else DriveStruct[d].drv_type=drv_100;
}
else if (j<200) DriveStruct[d].drv_type=drv_199;
else if (j<201) DriveStruct[d].drv_type=drv_200;
else if (j<210) DriveStruct[d].drv_type=drv_201;
else if (j<211) DriveStruct[d].drv_type=drv_210;
else if (j<300) DriveStruct[d].drv_type=drv_211;
else DriveStruct[d].drv_type=drv_300;
} }
else if (j<200) DriveStruct[d].drv_type=drv_199;
else if (j<201) DriveStruct[d].drv_type=drv_200;
else if (j<210) DriveStruct[d].drv_type=drv_201;
else if (j<211) DriveStruct[d].drv_type=drv_210;
else if (j<300) DriveStruct[d].drv_type=drv_211;
else DriveStruct[d].drv_type=drv_300;
DPRINTF((DBG_INI,"SBPCD: check_version done.\n")); DPRINTF((DBG_INI,"SBPCD: check_version done.\n"));
return (0); return (0);
} }
...@@ -2317,30 +2427,47 @@ static int prepare(u_char func, u_char subfunc) ...@@ -2317,30 +2427,47 @@ static int prepare(u_char func, u_char subfunc)
return (0); return (0);
} }
/*==========================================================================*/ /*==========================================================================*/
static int xx_PlayAudioMSF(int pos_audio_start,int pos_audio_end) static int xx_PlayAudio(int pos_audio_start,int pos_audio_end)
{ {
int i; int i, n;
if (DriveStruct[d].audio_state==audio_playing) return (-EINVAL); if (DriveStruct[d].audio_state==audio_playing) return (-EINVAL);
clr_cmdbuf(); clr_cmdbuf();
if (new_drive) if (lcs_drive)
{ {
drvcmd[0]=0x0E; drvcmd[0]=0x0A;
flags_cmd_out = f_putcmd | f_respo2 | f_ResponseStatus | i=msf2blk(pos_audio_start);
f_obey_p_check | f_wait_if_busy; n=msf2blk(pos_audio_end)+1-i;
drvcmd[1]=(i>>16)&0x00FF;
drvcmd[2]=(i>>8)&0x00FF;
drvcmd[3]=i&0x00FF;
drvcmd[4]=(n>>16)&0x00FF;
drvcmd[5]=(n>>8)&0x00FF;
drvcmd[6]=n&0x00FF;
flags_cmd_out = f_putcmd | f_respo2 | f_lopsta | f_getsta |
f_ResponseStatus | f_obey_p_check | f_wait_if_busy;
} }
else else
{ {
drvcmd[0]=0x0B; if (new_drive)
flags_cmd_out = f_putcmd | f_respo2 | f_lopsta | f_getsta | {
f_ResponseStatus | f_obey_p_check | f_wait_if_busy; drvcmd[0]=0x0E;
} flags_cmd_out = f_putcmd | f_respo2 | f_ResponseStatus |
drvcmd[1]=(pos_audio_start>>16)&0x00FF; f_obey_p_check | f_wait_if_busy;
drvcmd[2]=(pos_audio_start>>8)&0x00FF; }
drvcmd[3]=pos_audio_start&0x00FF; else /* old_drive */
drvcmd[4]=(pos_audio_end>>16)&0x00FF; {
drvcmd[5]=(pos_audio_end>>8)&0x00FF; drvcmd[0]=0x0B;
drvcmd[6]=pos_audio_end&0x00FF; flags_cmd_out = f_putcmd | f_respo2 | f_lopsta | f_getsta |
f_ResponseStatus | f_obey_p_check | f_wait_if_busy;
}
drvcmd[1]=(pos_audio_start>>16)&0x00FF;
drvcmd[2]=(pos_audio_start>>8)&0x00FF;
drvcmd[3]=pos_audio_start&0x00FF;
drvcmd[4]=(pos_audio_end>>16)&0x00FF;
drvcmd[5]=(pos_audio_end>>8)&0x00FF;
drvcmd[6]=pos_audio_end&0x00FF;
}
response_count=0; response_count=0;
i=cmd_out(); i=cmd_out();
return (i); return (i);
...@@ -2490,8 +2617,8 @@ static int sbpcd_ioctl(struct inode *inode, struct file *file, u_int cmd, ...@@ -2490,8 +2617,8 @@ static int sbpcd_ioctl(struct inode *inode, struct file *file, u_int cmd,
msf.cdmsf_frame1; msf.cdmsf_frame1;
DPRINTF((DBG_IOX,"SBPCD: ioctl: CDROMPLAYMSF %08X %08X\n", DPRINTF((DBG_IOX,"SBPCD: ioctl: CDROMPLAYMSF %08X %08X\n",
DriveStruct[d].pos_audio_start,DriveStruct[d].pos_audio_end)); DriveStruct[d].pos_audio_start,DriveStruct[d].pos_audio_end));
i=xx_PlayAudioMSF(DriveStruct[d].pos_audio_start,DriveStruct[d].pos_audio_end); i=xx_PlayAudio(DriveStruct[d].pos_audio_start,DriveStruct[d].pos_audio_end);
DPRINTF((DBG_IOC,"SBPCD: ioctl: xx_PlayAudioMSF returns %d\n",i)); DPRINTF((DBG_IOC,"SBPCD: ioctl: xx_PlayAudio returns %d\n",i));
#if 0 #if 0
if (i<0) return (-EIO); if (i<0) return (-EIO);
#endif 0 #endif 0
...@@ -2521,7 +2648,7 @@ static int sbpcd_ioctl(struct inode *inode, struct file *file, u_int cmd, ...@@ -2521,7 +2648,7 @@ static int sbpcd_ioctl(struct inode *inode, struct file *file, u_int cmd,
if (ti.cdti_trk1>DriveStruct[d].n_last_track) ti.cdti_trk1=DriveStruct[d].n_last_track; if (ti.cdti_trk1>DriveStruct[d].n_last_track) ti.cdti_trk1=DriveStruct[d].n_last_track;
DriveStruct[d].pos_audio_start=DriveStruct[d].TocBuffer[ti.cdti_trk0].address; DriveStruct[d].pos_audio_start=DriveStruct[d].TocBuffer[ti.cdti_trk0].address;
DriveStruct[d].pos_audio_end=DriveStruct[d].TocBuffer[ti.cdti_trk1+1].address; DriveStruct[d].pos_audio_end=DriveStruct[d].TocBuffer[ti.cdti_trk1+1].address;
i=xx_PlayAudioMSF(DriveStruct[d].pos_audio_start,DriveStruct[d].pos_audio_end); i=xx_PlayAudio(DriveStruct[d].pos_audio_start,DriveStruct[d].pos_audio_end);
#if 0 #if 0
if (i<0) return (-EIO); if (i<0) return (-EIO);
#endif 0 #endif 0
...@@ -2575,17 +2702,15 @@ static int sbpcd_ioctl(struct inode *inode, struct file *file, u_int cmd, ...@@ -2575,17 +2702,15 @@ static int sbpcd_ioctl(struct inode *inode, struct file *file, u_int cmd,
case CDROMEJECT: case CDROMEJECT:
DPRINTF((DBG_IOC,"SBPCD: ioctl: CDROMEJECT entered.\n")); DPRINTF((DBG_IOC,"SBPCD: ioctl: CDROMEJECT entered.\n"));
if (!new_drive) return (0); if (old_drive) return (0);
#if WORKMAN
DriveStruct[d].CD_changed=0xFF;
DriveStruct[d].diskstate_flags=0;
#endif WORKMAN
do i=yy_LockDoor(0); do i=yy_LockDoor(0);
while (i!=0); while (i!=0);
DriveStruct[d].open_count=0; /* to get it locked next time again */ DriveStruct[d].open_count=0; /* to get it locked next time again */
i=yy_SpinDown(); i=yy_SpinDown();
DPRINTF((DBG_IOX,"SBPCD: ioctl: yy_SpinDown returned %d.\n", i)); DPRINTF((DBG_IOX,"SBPCD: ioctl: yy_SpinDown returned %d.\n", i));
if (i<0) return (-EIO); if (i<0) return (-EIO);
DriveStruct[d].CD_changed=0xFF;
DriveStruct[d].diskstate_flags=0;
DriveStruct[d].audio_state=0; DriveStruct[d].audio_state=0;
return (0); return (0);
...@@ -3008,7 +3133,7 @@ static void sbp_read_cmd(void) ...@@ -3008,7 +3133,7 @@ static void sbp_read_cmd(void)
{ {
#if MANY_SESSION #if MANY_SESSION
DPRINTF((DBG_MUL,"SBPCD: read MSF %08X\n", blk2msf(block))); DPRINTF((DBG_MUL,"SBPCD: read MSF %08X\n", blk2msf(block)));
if ( (DriveStruct[d].f_multisession) && (multisession_valid) ) if (DriveStruct[d].f_multisession)
{ {
DPRINTF((DBG_MUL,"SBPCD: ManySession: use %08X for %08X (msf)\n", DPRINTF((DBG_MUL,"SBPCD: ManySession: use %08X for %08X (msf)\n",
blk2msf(DriveStruct[d].lba_multi+block), blk2msf(DriveStruct[d].lba_multi+block),
...@@ -3016,13 +3141,14 @@ static void sbp_read_cmd(void) ...@@ -3016,13 +3141,14 @@ static void sbp_read_cmd(void)
block=DriveStruct[d].lba_multi+block; block=DriveStruct[d].lba_multi+block;
} }
#else #else
if ( (block==16) && (DriveStruct[d].f_multisession) && (multisession_valid) ) if ((block<=DriveStruct[d].last_redirect)
{ && (DriveStruct[d].f_multisession))
DPRINTF((DBG_MUL,"SBPCD: MultiSession: use %08X for %08X (msf)\n", {
blk2msf(DriveStruct[d].lba_multi+16), DPRINTF((DBG_MUL,"SBPCD: MultiSession: use %08X for %08X (msf)\n",
blk2msf(block))); blk2msf(DriveStruct[d].lba_multi+block),
block=DriveStruct[d].lba_multi+block; blk2msf(block)));
} block=DriveStruct[d].lba_multi+block;
}
#endif MANY_SESSION #endif MANY_SESSION
} }
......
...@@ -741,23 +741,29 @@ static void scrdown(int currcons, unsigned int t, unsigned int b) ...@@ -741,23 +741,29 @@ static void scrdown(int currcons, unsigned int t, unsigned int b)
static void lf(int currcons) static void lf(int currcons)
{ {
if (y+1<bottom) { /* don't scroll if above bottom of scrolling region, or
y++; * if below scrolling region
pos += video_size_row; */
return; if (y+1 == bottom)
} else
scrup(currcons,top,bottom); scrup(currcons,top,bottom);
else if (y < video_num_lines-1) {
y++;
pos += video_size_row;
}
need_wrap = 0; need_wrap = 0;
} }
static void ri(int currcons) static void ri(int currcons)
{ {
if (y>top) { /* don't scroll if below top of scrolling region, or
* if above scrolling region
*/
if (y == top)
scrdown(currcons,top,bottom);
else if (y > 0) {
y--; y--;
pos -= video_size_row; pos -= video_size_row;
return; }
} else
scrdown(currcons,top,bottom);
need_wrap = 0; need_wrap = 0;
} }
......
...@@ -193,38 +193,100 @@ void to_utf8(ushort c) { ...@@ -193,38 +193,100 @@ void to_utf8(ushort c) {
} }
/* /*
* Translation of escaped scancodes to keysyms. * Translation of escaped scancodes to keycodes.
* This should be user-settable. * This is now user-settable.
* The keycodes 1-88,96-111,119 are fairly standard, and
* should probably not be changed - changing might confuse X.
* X also interprets scancode 0x5d (KEY_Begin).
*
* For 1-88 keycode equals scancode.
*/ */
#define E0_BASE 96
#define E0_KPENTER 96
#define E0_KPENTER (E0_BASE+0) #define E0_RCTRL 97
#define E0_RCTRL (E0_BASE+1) #define E0_KPSLASH 98
#define E0_KPSLASH (E0_BASE+2) #define E0_PRSCR 99
#define E0_PRSCR (E0_BASE+3) #define E0_RALT 100
#define E0_RALT (E0_BASE+4) #define E0_BREAK 101 /* (control-pause) */
#define E0_BREAK (E0_BASE+5) /* (control-pause) */ #define E0_HOME 102
#define E0_HOME (E0_BASE+6) #define E0_UP 103
#define E0_UP (E0_BASE+7) #define E0_PGUP 104
#define E0_PGUP (E0_BASE+8) #define E0_LEFT 105
#define E0_LEFT (E0_BASE+9) #define E0_RIGHT 106
#define E0_RIGHT (E0_BASE+10) #define E0_END 107
#define E0_END (E0_BASE+11) #define E0_DOWN 108
#define E0_DOWN (E0_BASE+12) #define E0_PGDN 109
#define E0_PGDN (E0_BASE+13) #define E0_INS 110
#define E0_INS (E0_BASE+14) #define E0_DEL 111
#define E0_DEL (E0_BASE+15)
#define E1_PAUSE 119
/*
* The keycodes below are randomly located in 89-95,112-118,120-127.
* They could be thrown away (and all occurrences below replaced by 0),
* but that would force many users to use the `setkeycodes' utility, where
* they needed not before. It does not matter that there are duplicates, as
* long as no duplication occurs for any single keyboard.
*/
#define SC_LIM 89
#define FOCUS_PF1 85 /* actual code! */
#define FOCUS_PF2 89
#define FOCUS_PF3 90
#define FOCUS_PF4 91
#define FOCUS_PF5 92
#define FOCUS_PF6 93
#define FOCUS_PF7 94
#define FOCUS_PF8 95
#define FOCUS_PF9 120
#define FOCUS_PF10 121
#define FOCUS_PF11 122
#define FOCUS_PF12 123
#define JAP_86 124
/* tfj@olivia.ping.dk:
* The four keys are located over the numeric keypad, and are
* labelled A1-A4. It's an rc930 keyboard, from
* Regnecentralen/RC International, Now ICL.
* Scancodes: 59, 5a, 5b, 5c.
*/
#define RGN1 124
#define RGN2 125
#define RGN3 126
#define RGN4 127
static unsigned char high_keys[128 - SC_LIM] = {
RGN1, RGN2, RGN3, RGN4, 0, 0, 0, /* 0x59-0x5f */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60-0x67 */
0, 0, 0, 0, 0, FOCUS_PF11, 0, FOCUS_PF12, /* 0x68-0x6f */
0, 0, 0, FOCUS_PF2, FOCUS_PF9, 0, 0, FOCUS_PF3, /* 0x70-0x77 */
FOCUS_PF4, FOCUS_PF5, FOCUS_PF6, FOCUS_PF7, /* 0x78-0x7b */
FOCUS_PF8, JAP_86, FOCUS_PF10, 0 /* 0x7c-0x7f */
};
/* BTC */ /* BTC */
#define E0_MACRO (E0_BASE+16) #define E0_MACRO 112
/* LK450 */ /* LK450 */
#define E0_F13 (E0_BASE+17) #define E0_F13 113
#define E0_F14 (E0_BASE+18) #define E0_F14 114
#define E0_HELP (E0_BASE+19) #define E0_HELP 115
#define E0_DO (E0_BASE+20) #define E0_DO 116
#define E0_F17 (E0_BASE+21) #define E0_F17 117
#define E0_KPMINPLUS (E0_BASE+22) #define E0_KPMINPLUS 118
/*
#define E1_PAUSE (E0_BASE+23) /* 119 */ * My OmniKey generates e0 4c for the "OMNI" key and the
* right alt key does nada. [kkoller@nyx10.cs.du.edu]
*/
#define E0_OK 124
/*
* New microsoft keyboard is rumoured to have
* e0 5b (left window button), e0 5c (right window button),
* e0 5d (menu button). [or: LBANNER, RBANNER, RMENU]
* [or: Windows_L, Windows_R, TaskMan]
*/
#define E0_MSLW 125
#define E0_MSRW 126
#define E0_MSTM 127
static unsigned char e0_keys[128] = { static unsigned char e0_keys[128] = {
0, 0, 0, 0, 0, 0, 0, 0, /* 0x00-0x07 */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x00-0x07 */
...@@ -236,47 +298,33 @@ static unsigned char e0_keys[128] = { ...@@ -236,47 +298,33 @@ static unsigned char e0_keys[128] = {
0, 0, 0, 0, 0, E0_KPSLASH, 0, E0_PRSCR, /* 0x30-0x37 */ 0, 0, 0, 0, 0, E0_KPSLASH, 0, E0_PRSCR, /* 0x30-0x37 */
E0_RALT, 0, 0, 0, 0, E0_F13, E0_F14, E0_HELP, /* 0x38-0x3f */ E0_RALT, 0, 0, 0, 0, E0_F13, E0_F14, E0_HELP, /* 0x38-0x3f */
E0_DO, E0_F17, 0, 0, 0, 0, E0_BREAK, E0_HOME, /* 0x40-0x47 */ E0_DO, E0_F17, 0, 0, 0, 0, E0_BREAK, E0_HOME, /* 0x40-0x47 */
E0_UP, E0_PGUP, 0, E0_LEFT, 0, E0_RIGHT, E0_KPMINPLUS, E0_END,/* 0x48-0x4f */ E0_UP, E0_PGUP, 0, E0_LEFT, E0_OK, E0_RIGHT, E0_KPMINPLUS, E0_END,/* 0x48-0x4f */
E0_DOWN, E0_PGDN, E0_INS, E0_DEL, 0, 0, 0, 0, /* 0x50-0x57 */ E0_DOWN, E0_PGDN, E0_INS, E0_DEL, 0, 0, 0, 0, /* 0x50-0x57 */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x58-0x5f */ 0, 0, 0, E0_MSLW, E0_MSRW, E0_MSTM, 0, 0, /* 0x58-0x5f */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60-0x67 */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x60-0x67 */
0, 0, 0, 0, 0, 0, 0, E0_MACRO, /* 0x68-0x6f */ 0, 0, 0, 0, 0, 0, 0, E0_MACRO, /* 0x68-0x6f */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70-0x77 */ 0, 0, 0, 0, 0, 0, 0, 0, /* 0x70-0x77 */
0, 0, 0, 0, 0, 0, 0, 0 /* 0x78-0x7f */ 0, 0, 0, 0, 0, 0, 0, 0 /* 0x78-0x7f */
}; };
/* kludge to stay below 128 - next time someone comes with a strange int setkeycode(unsigned int scancode, unsigned int keycode)
keyboard, key codes will have to become 2 (or 4) bytes. */ {
/* Owners of a FOCUS 9000 can assign F1,F2-F8,F9-F12 to 85,89-95,120-123 */ if (scancode < SC_LIM || scancode > 255 || keycode > 127)
/* Owners of a certain Japanese keyboard can use 89 and 124 */ return -EINVAL;
/* Owners of a certain Brazilian keyboard can use 89 and 121 */ if (scancode < 128)
/* Note: MEDIUMRAW mode will change, and all keycodes above 89 will change; high_keys[scancode - SC_LIM] = keycode;
this is only a temporary solution */ else
e0_keys[scancode - 128] = keycode;
#define SC_LIM 89 return 0;
}
#define FOCUS_PF1 85 /* actual code! */
#define FOCUS_PF2 89
#define FOCUS_PF3 90
#define FOCUS_PF4 91
#define FOCUS_PF5 92
#define FOCUS_PF6 93
#define FOCUS_PF7 94
#define FOCUS_PF8 95
#define FOCUS_PF9 (E1_PAUSE + 1)
#define FOCUS_PF10 (E1_PAUSE + 2)
#define FOCUS_PF11 (E1_PAUSE + 3)
#define FOCUS_PF12 (E1_PAUSE + 4) /* 123 */
#define JAP_86 (E1_PAUSE + 5) /* 124 */
static unsigned char high_keys[128 - SC_LIM] = { int getkeycode(unsigned int scancode)
0, 0, 0, 0, 0, 0, 0, /* 0x59-0x5f */ {
0, 0, 0, 0, 0, 0, 0, 0, /* 0x60-0x67 */ return
0, 0, 0, 0, 0, FOCUS_PF11, 0, FOCUS_PF12, /* 0x68-0x6f */ (scancode < SC_LIM || scancode > 255) ? -EINVAL :
0, 0, 0, FOCUS_PF2, FOCUS_PF9, 0, 0, FOCUS_PF3, /* 0x70-0x77 */ (scancode < 128) ? high_keys[scancode - SC_LIM] :
FOCUS_PF4, FOCUS_PF5, FOCUS_PF6, FOCUS_PF7, /* 0x78-0x7b */ e0_keys[scancode - 128];
FOCUS_PF8, JAP_86, FOCUS_PF10, 0 /* 0x7c-0x7f */ }
};
static void keyboard_interrupt(int int_pt_regs) static void keyboard_interrupt(int int_pt_regs)
{ {
......
...@@ -46,6 +46,8 @@ struct vt_struct *vt_cons[MAX_NR_CONSOLES]; ...@@ -46,6 +46,8 @@ struct vt_struct *vt_cons[MAX_NR_CONSOLES];
asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on); asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on);
extern int getkeycode(unsigned int scancode);
extern int setkeycode(unsigned int scancode, unsigned int keycode);
extern void compute_shiftstate(void); extern void compute_shiftstate(void);
extern void change_console(unsigned int new_console); extern void change_console(unsigned int new_console);
extern void complete_change_console(unsigned int new_console); extern void complete_change_console(unsigned int new_console);
...@@ -285,6 +287,36 @@ int vt_ioctl(struct tty_struct *tty, struct file * file, ...@@ -285,6 +287,36 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
} }
return i; return i;
case KDGETKEYCODE:
{
struct kbkeycode * const a = (struct kbkeycode *)arg;
unsigned int sc;
int kc;
i = verify_area(VERIFY_WRITE, (void *)a, sizeof(struct kbkeycode));
if (i)
return i;
sc = get_fs_long((int *) &a->scancode);
kc = getkeycode(sc);
if (kc < 0)
return kc;
put_fs_long(kc, (int *) &a->keycode);
return 0;
}
case KDSETKEYCODE:
{
struct kbkeycode * const a = (struct kbkeycode *)arg;
unsigned int sc, kc;
i = verify_area(VERIFY_READ, (void *)a, sizeof(struct kbkeycode));
if (i)
return i;
sc = get_fs_long((int *) &a->scancode);
kc = get_fs_long((int *) &a->keycode);
return setkeycode(sc, kc);
}
case KDGKBENT: case KDGKBENT:
{ {
struct kbentry * const a = (struct kbentry *)arg; struct kbentry * const a = (struct kbentry *)arg;
......
...@@ -43,7 +43,7 @@ extern struct device *init_etherdev(struct device *dev, int sizeof_private, ...@@ -43,7 +43,7 @@ extern struct device *init_etherdev(struct device *dev, int sizeof_private,
/* A zero-terminated list of I/O addresses to be probed. */ /* A zero-terminated list of I/O addresses to be probed. */
static unsigned int hpplus_portlist[] = static unsigned int hpplus_portlist[] =
{0x200, 0x240, 0x280, 0x2C0, 0x300, 0x320, 0x340, 0} {0x200, 0x240, 0x280, 0x2C0, 0x300, 0x320, 0x340, 0};
/* /*
The HP EtherTwist chip implementation is a fairly routine DP8390 The HP EtherTwist chip implementation is a fairly routine DP8390
......
...@@ -1010,12 +1010,12 @@ slip_init(struct device *dev) ...@@ -1010,12 +1010,12 @@ slip_init(struct device *dev)
if (already++ == 0) { if (already++ == 0) {
printk("SLIP: version %s (%d channels)\n", printk("SLIP: version %s (%d channels)\n",
SLIP_VERSION, SL_NRUNIT); SLIP_VERSION, SL_NRUNIT);
#ifdef CONFIG_INET #ifdef SL_COMPRESSED
printk("CSLIP: code copyright 1989 Regents of the University of California\n"); printk("CSLIP: code copyright 1989 Regents of the University of California\n");
#endif #endif
#ifdef CONFIG_AX25 #ifdef CONFIG_AX25
printk("AX25: KISS encapsulation enabled\n"); printk("AX25: KISS encapsulation enabled\n");
#endif #endif
/* Fill in our LDISC request block. */ /* Fill in our LDISC request block. */
memset(&sl_ldisc, 0, sizeof(sl_ldisc)); memset(&sl_ldisc, 0, sizeof(sl_ldisc));
sl_ldisc.magic = TTY_LDISC_MAGIC; sl_ldisc.magic = TTY_LDISC_MAGIC;
......
...@@ -196,6 +196,12 @@ void aha1740_intr_handle(int foo) ...@@ -196,6 +196,12 @@ void aha1740_intr_handle(int foo)
((ulong) inb(MBOXIN2) <<16) + ((ulong) inb(MBOXIN2) <<16) +
((ulong) inb(MBOXIN3) <<24) ); ((ulong) inb(MBOXIN3) <<24) );
outb(G2CNTRL_HRDY,G2CNTRL); /* Host Ready -> Mailbox in complete */ outb(G2CNTRL_HRDY,G2CNTRL); /* Host Ready -> Mailbox in complete */
if (!ecbptr)
{
printk("Aha1740 null ecbptr in interrupt (%x,%x,%x,%d)\n",
inb(G2STAT),adapstat,inb(G2INTST),number_serviced++);
continue;
}
SCtmp = ecbptr->SCpnt; SCtmp = ecbptr->SCpnt;
if (SCtmp->host_scribble) if (SCtmp->host_scribble)
scsi_free(SCtmp->host_scribble, 512); scsi_free(SCtmp->host_scribble, 512);
......
...@@ -227,9 +227,10 @@ struct Scsi_Host * scsi_register(Scsi_Host_Template * tpnt, int j){ ...@@ -227,9 +227,10 @@ struct Scsi_Host * scsi_register(Scsi_Host_Template * tpnt, int j){
printk("Register %x %x: %d\n", retval, retval->hostt, j); printk("Register %x %x: %d\n", retval, retval->hostt, j);
#endif #endif
/* The next three are the default values which can be overridden /* The next four are the default values which can be overridden
if need be */ if need be */
retval->this_id = tpnt->this_id; retval->this_id = tpnt->this_id;
retval->can_queue = tpnt->can_queue;
retval->sg_tablesize = tpnt->sg_tablesize; retval->sg_tablesize = tpnt->sg_tablesize;
retval->unchecked_isa_dma = tpnt->unchecked_isa_dma; retval->unchecked_isa_dma = tpnt->unchecked_isa_dma;
......
...@@ -243,6 +243,7 @@ struct Scsi_Host ...@@ -243,6 +243,7 @@ struct Scsi_Host
*/ */
int this_id; int this_id;
int can_queue;
short unsigned int sg_tablesize; short unsigned int sg_tablesize;
unsigned unchecked_isa_dma:1; unsigned unchecked_isa_dma:1;
/* /*
......
...@@ -580,8 +580,8 @@ Scsi_Cmnd * request_queueable (struct request * req, Scsi_Device * device) ...@@ -580,8 +580,8 @@ Scsi_Cmnd * request_queueable (struct request * req, Scsi_Device * device)
if (!SCpnt) return NULL; if (!SCpnt) return NULL;
if (device->host->hostt->can_queue if (device->host->can_queue
&& device->host->host_busy >= device->host->hostt->can_queue) return NULL; && device->host->host_busy >= device->host->can_queue) return NULL;
if (req) { if (req) {
memcpy(&SCpnt->request, req, sizeof(struct request)); memcpy(&SCpnt->request, req, sizeof(struct request));
...@@ -766,7 +766,7 @@ update_timeout(SCpnt, SCpnt->timeout_per_command); ...@@ -766,7 +766,7 @@ update_timeout(SCpnt, SCpnt->timeout_per_command);
"bufflen = %d, done = %08x)\n", SCpnt->host->host_no, SCpnt->target, SCpnt->cmnd, SCpnt->buffer, SCpnt->bufflen, SCpnt->done); "bufflen = %d, done = %08x)\n", SCpnt->host->host_no, SCpnt->target, SCpnt->cmnd, SCpnt->buffer, SCpnt->bufflen, SCpnt->done);
#endif #endif
if (host->hostt->can_queue) if (host->can_queue)
{ {
#ifdef DEBUG #ifdef DEBUG
printk("queuecommand : routine at %08x\n", printk("queuecommand : routine at %08x\n",
...@@ -860,7 +860,7 @@ void scsi_do_cmd (Scsi_Cmnd * SCpnt, const void *cmnd , ...@@ -860,7 +860,7 @@ void scsi_do_cmd (Scsi_Cmnd * SCpnt, const void *cmnd ,
if (!host) if (!host)
{ {
panic ("Invalid or not present host. %d\n", host->host_no); panic ("Invalid or not present host.\n");
} }
...@@ -876,12 +876,12 @@ void scsi_do_cmd (Scsi_Cmnd * SCpnt, const void *cmnd , ...@@ -876,12 +876,12 @@ void scsi_do_cmd (Scsi_Cmnd * SCpnt, const void *cmnd ,
while (1==1){ while (1==1){
cli(); cli();
if (host->hostt->can_queue if (host->can_queue
&& host->host_busy >= host->hostt->can_queue) && host->host_busy >= host->can_queue)
{ {
sti(); sti();
SCSI_SLEEP(&host->host_wait, SCSI_SLEEP(&host->host_wait,
(host->host_busy >= host->hostt->can_queue)); (host->host_busy >= host->can_queue));
} else { } else {
host->host_busy++; host->host_busy++;
sti(); sti();
......
...@@ -41,7 +41,7 @@ int scsicam_bios_param (Disk *disk, /* SCSI disk */ ...@@ -41,7 +41,7 @@ int scsicam_bios_param (Disk *disk, /* SCSI disk */
int ret_code; int ret_code;
int size = disk->capacity; int size = disk->capacity;
if (!(bh = bread(dev,0,1024))) if (!(bh = bread(dev & ~0xf,0,1024)))
return -1; return -1;
#ifdef DEBUG #ifdef DEBUG
......
...@@ -444,6 +444,24 @@ static void requeue_sd_request (Scsi_Cmnd * SCpnt) ...@@ -444,6 +444,24 @@ static void requeue_sd_request (Scsi_Cmnd * SCpnt)
printk("sd%c : real dev = /dev/sd%c, block = %d\n", 'a' + MINOR(SCpnt->request.dev), dev, block); printk("sd%c : real dev = /dev/sd%c, block = %d\n", 'a' + MINOR(SCpnt->request.dev), dev, block);
#endif #endif
/*
* If we have a 1K hardware sectorsize, prevent access to single
* 512 byte sectors. In theory we could handle this - in fact
* the scsi cdrom driver must be able to handle this because
* we typically use 1K blocksizes, and cdroms typically have
* 2K hardware sectorsizes. Of course, things are simpler
* with the cdrom, since it is read-only. For performance
* reasons, the filesystems should be able to handle this
* and not force the scsi disk driver to use bounce buffers
* for this.
*/
if (rscsi_disks[dev].sector_size == 1024)
if((block & 1) || (SCpnt->request.nr_sectors & 1)) {
printk("sd.c:Bad block number requested");
SCpnt = end_scsi_request(SCpnt, 0, SCpnt->request.nr_sectors);
goto repeat;
}
switch (SCpnt->request.cmd) switch (SCpnt->request.cmd)
{ {
case WRITE : case WRITE :
......
...@@ -56,7 +56,6 @@ int buffers_lav[NR_SIZES] = {0,}; /* Load average of buffer usage */ ...@@ -56,7 +56,6 @@ int buffers_lav[NR_SIZES] = {0,}; /* Load average of buffer usage */
int nr_free[NR_SIZES] = {0,}; int nr_free[NR_SIZES] = {0,};
int buffermem = 0; int buffermem = 0;
int nr_buffer_heads = 0; int nr_buffer_heads = 0;
static int min_free_pages = 20; /* nr free pages needed before buffer grows */
extern int *blksize_size[]; extern int *blksize_size[];
/* Here is the parameter block for the bdflush process. */ /* Here is the parameter block for the bdflush process. */
...@@ -518,7 +517,7 @@ void refill_freelist(int size) ...@@ -518,7 +517,7 @@ void refill_freelist(int size)
/* We are going to try and locate this much memory */ /* We are going to try and locate this much memory */
needed =bdf_prm.b_un.nrefill * size; needed =bdf_prm.b_un.nrefill * size;
while (nr_free_pages > min_free_pages && needed > 0 && while (nr_free_pages > min_free_pages*2 && needed > 0 &&
grow_buffers(GFP_BUFFER, size)) { grow_buffers(GFP_BUFFER, size)) {
needed -= PAGE_SIZE; needed -= PAGE_SIZE;
} }
...@@ -1572,7 +1571,7 @@ unsigned long generate_cluster(dev_t dev, int b[], int size) ...@@ -1572,7 +1571,7 @@ unsigned long generate_cluster(dev_t dev, int b[], int size)
if(retval) return retval; if(retval) return retval;
}; };
if (nr_free_pages > min_free_pages) if (nr_free_pages > min_free_pages*2)
return try_to_generate_cluster(dev, b[0], size); return try_to_generate_cluster(dev, b[0], size);
else else
return reassign_cluster(dev, b[0], size); return reassign_cluster(dev, b[0], size);
...@@ -1591,13 +1590,11 @@ void buffer_init(void) ...@@ -1591,13 +1590,11 @@ void buffer_init(void)
int isize = BUFSIZE_INDEX(BLOCK_SIZE); int isize = BUFSIZE_INDEX(BLOCK_SIZE);
if (high_memory >= 4*1024*1024) { if (high_memory >= 4*1024*1024) {
min_free_pages = 200;
if(high_memory >= 16*1024*1024) if(high_memory >= 16*1024*1024)
nr_hash = 16381; nr_hash = 16381;
else else
nr_hash = 4093; nr_hash = 4093;
} else { } else {
min_free_pages = 20;
nr_hash = 997; nr_hash = 997;
}; };
......
...@@ -365,16 +365,26 @@ unsigned long * create_tables(char * p,int argc,int envc,int ibcs) ...@@ -365,16 +365,26 @@ unsigned long * create_tables(char * p,int argc,int envc,int ibcs)
/* /*
* count() counts the number of arguments/envelopes * count() counts the number of arguments/envelopes
*
* We also do some limited EFAULT checking: this isn't complete, but
* it does cover most cases. I'll have to do this correctly some day..
*/ */
static int count(char ** argv) static int count(char ** argv)
{ {
int i=0; int error, i = 0;
char ** tmp; char ** tmp, *p;
if ((tmp = argv) != 0) error = verify_area(VERIFY_READ, argv, sizeof(char *));
while (get_fs_long((unsigned long *) (tmp++))) if (error)
return error;
if ((tmp = argv) != 0) {
while ((p = (char *) get_fs_long((unsigned long *) (tmp++))) != NULL) {
i++; i++;
error = verify_area(VERIFY_READ, p, 1);
if (error)
return error;
}
}
return i; return i;
} }
...@@ -601,8 +611,10 @@ int do_execve(char * filename, char ** argv, char ** envp, struct pt_regs * regs ...@@ -601,8 +611,10 @@ int do_execve(char * filename, char ** argv, char ** envp, struct pt_regs * regs
if (retval) if (retval)
return retval; return retval;
bprm.filename = filename; bprm.filename = filename;
bprm.argc = count(argv); if ((bprm.argc = count(argv)) < 0)
bprm.envc = count(envp); return bprm.argc;
if ((bprm.envc = count(envp)) < 0)
return bprm.envc;
restart_interp: restart_interp:
if (!S_ISREG(bprm.inode->i_mode)) { /* must be regular file */ if (!S_ISREG(bprm.inode->i_mode)) { /* must be regular file */
......
...@@ -258,6 +258,15 @@ int inode_change_ok(struct inode *inode, struct iattr *attr) ...@@ -258,6 +258,15 @@ int inode_change_ok(struct inode *inode, struct iattr *attr)
attr->ia_mode &= ~S_ISGID; attr->ia_mode &= ~S_ISGID;
} }
/* Check for setting the inode time */
if ((attr->ia_valid & ATTR_ATIME_SET) &&
((current->fsuid != inode->i_uid) && !fsuser()))
return -EPERM;
if ((attr->ia_valid & ATTR_MTIME_SET) &&
((current->fsuid != inode->i_uid) && !fsuser()))
return -EPERM;
return 0; return 0;
} }
......
...@@ -72,6 +72,7 @@ static int isofs_readdir(struct inode * inode, struct file * filp, ...@@ -72,6 +72,7 @@ static int isofs_readdir(struct inode * inode, struct file * filp,
void * cpnt = NULL; void * cpnt = NULL;
unsigned int old_offset; unsigned int old_offset;
int dlen, rrflag; int dlen, rrflag;
int high_sierra = 0;
char * dpnt, *dpnt1; char * dpnt, *dpnt1;
struct iso_directory_record * de; struct iso_directory_record * de;
...@@ -125,6 +126,7 @@ static int isofs_readdir(struct inode * inode, struct file * filp, ...@@ -125,6 +126,7 @@ static int isofs_readdir(struct inode * inode, struct file * filp,
unsigned int frag1; unsigned int frag1;
frag1 = bufsize - old_offset; frag1 = bufsize - old_offset;
cpnt = kmalloc(*((unsigned char *) de),GFP_KERNEL); cpnt = kmalloc(*((unsigned char *) de),GFP_KERNEL);
if (!cpnt) return 0;
memcpy(cpnt, bh->b_data + old_offset, frag1); memcpy(cpnt, bh->b_data + old_offset, frag1);
de = (struct iso_directory_record *) ((char *)cpnt); de = (struct iso_directory_record *) ((char *)cpnt);
brelse(bh); brelse(bh);
...@@ -156,8 +158,7 @@ static int isofs_readdir(struct inode * inode, struct file * filp, ...@@ -156,8 +158,7 @@ static int isofs_readdir(struct inode * inode, struct file * filp,
put_fs_byte('.',dirent->d_name+1); put_fs_byte('.',dirent->d_name+1);
i = 2; i = 2;
dpnt = ".."; dpnt = "..";
if((inode->i_sb->u.isofs_sb.s_firstdatazone if((inode->i_sb->u.isofs_sb.s_firstdatazone) != inode->i_ino)
<< bufbits) != inode->i_ino)
inode_number = inode->u.isofs_i.i_backlink; inode_number = inode->u.isofs_i.i_backlink;
else else
inode_number = inode->i_ino; inode_number = inode->i_ino;
...@@ -178,6 +179,15 @@ static int isofs_readdir(struct inode * inode, struct file * filp, ...@@ -178,6 +179,15 @@ static int isofs_readdir(struct inode * inode, struct file * filp,
is no Rock Ridge NM field. */ is no Rock Ridge NM field. */
else { else {
/* Do not report hidden or associated files */
high_sierra = inode->i_sb->u.isofs_sb.s_high_sierra;
if (de->flags[-high_sierra] & 5) {
if (cpnt) {
kfree(cpnt);
cpnt = NULL;
};
continue;
}
dlen = de->name_len[0]; dlen = de->name_len[0];
dpnt = de->name; dpnt = de->name;
i = dlen; i = dlen;
...@@ -196,6 +206,7 @@ static int isofs_readdir(struct inode * inode, struct file * filp, ...@@ -196,6 +206,7 @@ static int isofs_readdir(struct inode * inode, struct file * filp,
if(inode->i_sb->u.isofs_sb.s_mapping == 'n') { if(inode->i_sb->u.isofs_sb.s_mapping == 'n') {
dpnt1 = dpnt; dpnt1 = dpnt;
dpnt = kmalloc(dlen, GFP_KERNEL); dpnt = kmalloc(dlen, GFP_KERNEL);
if (!dpnt) goto out;
for (i = 0; i < dlen && i < NAME_MAX; i++) { for (i = 0; i < dlen && i < NAME_MAX; i++) {
if (!(c = dpnt1[i])) break; if (!(c = dpnt1[i])) break;
if (c >= 'A' && c <= 'Z') c |= 0x20; /* lower case */ if (c >= 'A' && c <= 'Z') c |= 0x20; /* lower case */
......
...@@ -146,7 +146,8 @@ static int isofs_file_read(struct inode * inode, struct file * filp, char * buf, ...@@ -146,7 +146,8 @@ static int isofs_file_read(struct inode * inode, struct file * filp, char * buf,
return 0; return 0;
read = 0; read = 0;
block = filp->f_pos >> ISOFS_BUFFER_BITS(inode); block = filp->f_pos >> ISOFS_BUFFER_BITS(inode);
offset = filp->f_pos & (ISOFS_BUFFER_SIZE(inode)-1); offset = (inode->u.isofs_i.i_first_extent + filp->f_pos)
& (ISOFS_BUFFER_SIZE(inode)-1);
blocks = (left + offset + ISOFS_BUFFER_SIZE(inode) - 1) / ISOFS_BUFFER_SIZE(inode); blocks = (left + offset + ISOFS_BUFFER_SIZE(inode) - 1) / ISOFS_BUFFER_SIZE(inode);
bhb = bhe = buflist; bhb = bhe = buflist;
......
...@@ -245,8 +245,22 @@ struct super_block *isofs_read_super(struct super_block *s,void *data, ...@@ -245,8 +245,22 @@ struct super_block *isofs_read_super(struct super_block *s,void *data,
s->u.isofs_sb.s_ninodes = 0; /* No way to figure this out easily */ s->u.isofs_sb.s_ninodes = 0; /* No way to figure this out easily */
s->u.isofs_sb.s_firstdatazone = isonum_733( rootp->extent) << /* RDE: convert log zone size to bit shift */
(ISOFS_BLOCK_BITS - blocksize_bits);
switch (s -> u.isofs_sb.s_log_zone_size)
{ case 512: s -> u.isofs_sb.s_log_zone_size = 9; break;
case 1024: s -> u.isofs_sb.s_log_zone_size = 10; break;
case 2048: s -> u.isofs_sb.s_log_zone_size = 11; break;
default:
printk("Bad logical zone size %d\n", s -> u.isofs_sb.s_log_zone_size = 10);
goto out;
}
/* RDE: data zone now byte offset! */
s->u.isofs_sb.s_firstdatazone = (isonum_733( rootp->extent)
<< s -> u.isofs_sb.s_log_zone_size);
s->s_magic = ISOFS_SUPER_MAGIC; s->s_magic = ISOFS_SUPER_MAGIC;
/* The CDROM is read-only, has no nodes (devices) on it, and since /* The CDROM is read-only, has no nodes (devices) on it, and since
...@@ -256,19 +270,14 @@ struct super_block *isofs_read_super(struct super_block *s,void *data, ...@@ -256,19 +270,14 @@ struct super_block *isofs_read_super(struct super_block *s,void *data,
s->s_flags |= MS_RDONLY /* | MS_NODEV | MS_NOSUID */; s->s_flags |= MS_RDONLY /* | MS_NODEV | MS_NOSUID */;
if(s->u.isofs_sb.s_log_zone_size != (1 << ISOFS_BLOCK_BITS)) {
printk("1 <<Block bits != Block size\n");
goto out;
};
brelse(bh); brelse(bh);
printk("Max size:%ld Log zone size:%ld\n", printk("Max size:%ld Log zone size:%ld\n",
s->u.isofs_sb.s_max_size, s->u.isofs_sb.s_max_size,
s->u.isofs_sb.s_log_zone_size); s->u.isofs_sb.s_log_zone_size);
printk("First datazone:%ld Root inode number %d\n", printk("First datazone:%ld Root inode number %d\n",
s->u.isofs_sb.s_firstdatazone, s->u.isofs_sb.s_firstdatazone >> s -> u.isofs_sb.s_log_zone_size,
isonum_733 (rootp->extent) << ISOFS_BLOCK_BITS); isonum_733 (rootp->extent) << s -> u.isofs_sb.s_log_zone_size);
if(high_sierra) printk("Disc in High Sierra format.\n"); if(high_sierra) printk("Disc in High Sierra format.\n");
unlock_super(s); unlock_super(s);
/* set up enough so that it can read an inode */ /* set up enough so that it can read an inode */
...@@ -283,7 +292,7 @@ struct super_block *isofs_read_super(struct super_block *s,void *data, ...@@ -283,7 +292,7 @@ struct super_block *isofs_read_super(struct super_block *s,void *data,
s->u.isofs_sb.s_gid = opt.gid; s->u.isofs_sb.s_gid = opt.gid;
s->s_blocksize = opt.blocksize; s->s_blocksize = opt.blocksize;
s->s_blocksize_bits = blocksize_bits; s->s_blocksize_bits = blocksize_bits;
s->s_mounted = iget(s, isonum_733 (rootp->extent) << ISOFS_BLOCK_BITS); s->s_mounted = iget(s, isonum_733 (rootp->extent) << s -> u.isofs_sb.s_log_zone_size);
unlock_super(s); unlock_super(s);
if (!(s->s_mounted)) { if (!(s->s_mounted)) {
...@@ -320,7 +329,7 @@ int isofs_bmap(struct inode * inode,int block) ...@@ -320,7 +329,7 @@ int isofs_bmap(struct inode * inode,int block)
printk("_isofs_bmap: block<0"); printk("_isofs_bmap: block<0");
return 0; return 0;
} }
return inode->u.isofs_i.i_first_extent + block; return (inode->u.isofs_i.i_first_extent >> ISOFS_BUFFER_BITS(inode)) + block;
} }
void isofs_read_inode(struct inode * inode) void isofs_read_inode(struct inode * inode)
...@@ -425,10 +434,12 @@ void isofs_read_inode(struct inode * inode) ...@@ -425,10 +434,12 @@ void isofs_read_inode(struct inode * inode)
/* I have no idea what other flag bits are used for, so /* I have no idea what other flag bits are used for, so
we will flag it for now */ we will flag it for now */
#ifdef DEBUG
if((raw_inode->flags[-high_sierra] & ~2)!= 0){ if((raw_inode->flags[-high_sierra] & ~2)!= 0){
printk("Unusual flag settings for ISO file (%ld %x).\n", printk("Unusual flag settings for ISO file (%ld %x).\n",
inode->i_ino, raw_inode->flags[-high_sierra]); inode->i_ino, raw_inode->flags[-high_sierra]);
} }
#endif
#ifdef DEBUG #ifdef DEBUG
printk("Get inode %d: %d %d: %d\n",inode->i_ino, block, printk("Get inode %d: %d %d: %d\n",inode->i_ino, block,
...@@ -438,10 +449,9 @@ void isofs_read_inode(struct inode * inode) ...@@ -438,10 +449,9 @@ void isofs_read_inode(struct inode * inode)
inode->i_mtime = inode->i_atime = inode->i_ctime = inode->i_mtime = inode->i_atime = inode->i_ctime =
iso_date(raw_inode->date, high_sierra); iso_date(raw_inode->date, high_sierra);
inode->u.isofs_i.i_first_extent = inode->u.isofs_i.i_first_extent = (isonum_733 (raw_inode->extent) +
(isonum_733 (raw_inode->extent) + isonum_711 (raw_inode->ext_attr_length))
isonum_711 (raw_inode->ext_attr_length)) << << inode -> i_sb -> u.isofs_sb.s_log_zone_size;
(ISOFS_BLOCK_BITS - ISOFS_BUFFER_BITS(inode));
inode->u.isofs_i.i_backlink = 0xffffffff; /* Will be used for previous directory */ inode->u.isofs_i.i_backlink = 0xffffffff; /* Will be used for previous directory */
switch (inode->i_sb->u.isofs_sb.s_conversion){ switch (inode->i_sb->u.isofs_sb.s_conversion){
...@@ -625,6 +635,7 @@ int isofs_lookup_grandparent(struct inode * parent, int extent) ...@@ -625,6 +635,7 @@ int isofs_lookup_grandparent(struct inode * parent, int extent)
unsigned int frag1; unsigned int frag1;
frag1 = bufsize - old_offset; frag1 = bufsize - old_offset;
cpnt = kmalloc(*((unsigned char *) de),GFP_KERNEL); cpnt = kmalloc(*((unsigned char *) de),GFP_KERNEL);
if (!cpnt) return -1;
memcpy(cpnt, bh->b_data + old_offset, frag1); memcpy(cpnt, bh->b_data + old_offset, frag1);
de = (struct iso_directory_record *) ((char *)cpnt); de = (struct iso_directory_record *) ((char *)cpnt);
brelse(bh); brelse(bh);
......
...@@ -69,6 +69,7 @@ static struct buffer_head * isofs_find_entry(struct inode * dir, ...@@ -69,6 +69,7 @@ static struct buffer_head * isofs_find_entry(struct inode * dir,
unsigned int old_offset; unsigned int old_offset;
unsigned int backlink; unsigned int backlink;
int dlen, rrflag, match; int dlen, rrflag, match;
int high_sierra = 0;
char * dpnt; char * dpnt;
struct iso_directory_record * de; struct iso_directory_record * de;
char c; char c;
...@@ -114,6 +115,7 @@ static struct buffer_head * isofs_find_entry(struct inode * dir, ...@@ -114,6 +115,7 @@ static struct buffer_head * isofs_find_entry(struct inode * dir,
unsigned int frag1; unsigned int frag1;
frag1 = bufsize - old_offset; frag1 = bufsize - old_offset;
cpnt = kmalloc(*((unsigned char *) de),GFP_KERNEL); cpnt = kmalloc(*((unsigned char *) de),GFP_KERNEL);
if (!cpnt) return 0;
memcpy(cpnt, bh->b_data + old_offset, frag1); memcpy(cpnt, bh->b_data + old_offset, frag1);
de = (struct iso_directory_record *) cpnt; de = (struct iso_directory_record *) cpnt;
...@@ -139,17 +141,26 @@ static struct buffer_head * isofs_find_entry(struct inode * dir, ...@@ -139,17 +141,26 @@ static struct buffer_head * isofs_find_entry(struct inode * dir,
if (de->name[0]==1 && de->name_len[0]==1) { if (de->name[0]==1 && de->name_len[0]==1) {
#if 0 #if 0
printk("Doing .. (%d %d)", printk("Doing .. (%d %d)",
dir->i_sb->s_firstdatazone << bufbits, dir->i_sb->s_firstdatazone,
dir->i_ino); dir->i_ino);
#endif #endif
if((dir->i_sb->u.isofs_sb.s_firstdatazone if((dir->i_sb->u.isofs_sb.s_firstdatazone) != dir->i_ino)
<< bufbits) != dir->i_ino) inode_number = dir->u.isofs_i.i_backlink;
inode_number = dir->u.isofs_i.i_backlink;
else else
inode_number = dir->i_ino; inode_number = dir->i_ino;
backlink = 0; backlink = 0;
} }
/* Do not report hidden or associated files */
high_sierra = dir->i_sb->u.isofs_sb.s_high_sierra;
if (de->flags[-high_sierra] & 5) {
if (cpnt) {
kfree(cpnt);
cpnt = NULL;
};
continue;
}
dlen = de->name_len[0]; dlen = de->name_len[0];
dpnt = de->name; dpnt = de->name;
/* Now convert the filename in the buffer to lower case */ /* Now convert the filename in the buffer to lower case */
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
int block, offset, offset1; \ int block, offset, offset1; \
struct buffer_head * bh; \ struct buffer_head * bh; \
buffer = kmalloc(cont_size,GFP_KERNEL); \ buffer = kmalloc(cont_size,GFP_KERNEL); \
if (!buffer) goto out; \
block = cont_extent; \ block = cont_extent; \
offset = cont_offset; \ offset = cont_offset; \
offset1 = 0; \ offset1 = 0; \
...@@ -214,6 +215,7 @@ int get_rock_ridge_filename(struct iso_directory_record * de, ...@@ -214,6 +215,7 @@ int get_rock_ridge_filename(struct iso_directory_record * de,
deallocate the mem fairly soon deallocate the mem fairly soon
after control is returned */ after control is returned */
if (!retname) goto out;
*retname = 0; /* Zero length string */ *retname = 0; /* Zero length string */
retnamlen = 0; retnamlen = 0;
}; };
...@@ -467,6 +469,7 @@ char * get_rock_ridge_symlink(struct inode * inode) ...@@ -467,6 +469,7 @@ char * get_rock_ridge_symlink(struct inode * inode)
while (slen > 1){ while (slen > 1){
if (!rpnt){ if (!rpnt){
rpnt = (char *) kmalloc (inode->i_size +1, GFP_KERNEL); rpnt = (char *) kmalloc (inode->i_size +1, GFP_KERNEL);
if (!rpnt) goto out;
*rpnt = 0; *rpnt = 0;
}; };
rootflag = 0; rootflag = 0;
......
...@@ -56,6 +56,44 @@ struct inode_operations msdos_file_inode_operations = { ...@@ -56,6 +56,44 @@ struct inode_operations msdos_file_inode_operations = {
NULL /* smap */ NULL /* smap */
}; };
#define MSDOS_PREFETCH 32
struct msdos_pre {
int file_sector;/* Next sector to read in the prefetch table */
/* This is relative to the file, not the disk */
struct buffer_head *bhlist[MSDOS_PREFETCH]; /* All buffers needed */
int nblist; /* Number of buffers in bhlist */
int nolist; /* index in bhlist */
};
/*
Order the prefetch of more sectors.
*/
static void msdos_prefetch (
struct inode *inode,
struct msdos_pre *pre,
int nb) /* How many must be prefetch at once */
{
struct buffer_head *bhreq[MSDOS_PREFETCH]; /* Buffers not */
/* already read */
int nbreq=0; /* Number of buffers in bhreq */
int i;
for (i=0; i<nb; i++){
int sector = msdos_smap(inode,pre->file_sector);
if (sector != 0){
struct buffer_head *bh;
PRINTK (("fsector2 %d -> %d\n",pre->file_sector-1,sector));
pre->file_sector++;
bh = getblk(inode->i_dev,sector,SECTOR_SIZE);
if (bh == NULL) break;
pre->bhlist[pre->nblist++] = bh;
if (!bh->b_uptodate) bhreq[nbreq++] = bh;
}else{
break;
}
}
if (nbreq > 0) ll_rw_block (READ,nbreq,bhreq);
for (i=pre->nblist; i<MSDOS_PREFETCH; i++) pre->bhlist[i] = NULL;
}
/* /*
Read a file into user space Read a file into user space
*/ */
...@@ -66,17 +104,9 @@ int msdos_file_read( ...@@ -66,17 +104,9 @@ int msdos_file_read(
int count) int count)
{ {
char *start; char *start;
int left,offset,size,cnt; int left;
#define MSDOS_PREFETCH 48
struct {
int file_sector;/* Next sector to read in the prefetch table */
/* This is relative to the file, not the disk */
struct buffer_head *bhlist[MSDOS_PREFETCH]; /* All buffers needed */
int nblist; /* Number of buffers in bhlist */
int nolist; /* index in bhlist */
int fetched_max; /* End of pre fetch area */
}pre;
int i; int i;
struct msdos_pre pre;
if (!inode) { if (!inode) {
...@@ -100,9 +130,6 @@ int msdos_file_read( ...@@ -100,9 +130,6 @@ int msdos_file_read(
*/ */
PRINTK (("#### ino %ld pos %ld size %ld count %d\n",inode->i_ino,filp->f_pos,inode->i_size,count)); PRINTK (("#### ino %ld pos %ld size %ld count %d\n",inode->i_ino,filp->f_pos,inode->i_size,count));
{ {
struct buffer_head *bhreq[MSDOS_PREFETCH]; /* Buffers not */
/* already read */
int nbreq; /* Number of buffers in bhreq */
/* /*
We must prefetch complete block, so we must We must prefetch complete block, so we must
take in account the offset in the first block. take in account the offset in the first block.
...@@ -112,53 +139,36 @@ int msdos_file_read( ...@@ -112,53 +139,36 @@ int msdos_file_read(
pre.file_sector = filp->f_pos >> SECTOR_BITS; pre.file_sector = filp->f_pos >> SECTOR_BITS;
to_reada = count_max / SECTOR_SIZE; to_reada = count_max / SECTOR_SIZE;
if (count_max & (SECTOR_SIZE-1)) to_reada++; if (count_max & (SECTOR_SIZE-1)) to_reada++;
if (filp->f_reada){ if (filp->f_reada || !MSDOS_I(inode)->i_binary){
int min_read = read_ahead[MAJOR(inode->i_dev)]; /* Doing a read ahead on ascii file make sure we always */
if (min_read > to_reada) to_reada = min_read; /* pre read enough, since we don't know how many blocks */
/* we really need */
int ahead = read_ahead[MAJOR(inode->i_dev)];
if (ahead == 0) ahead = 8;
to_reada += ahead;
} }
if (to_reada > MSDOS_PREFETCH) to_reada = MSDOS_PREFETCH; if (to_reada > MSDOS_PREFETCH) to_reada = MSDOS_PREFETCH;
nbreq = pre.nblist = 0; pre.nblist = 0;
for (i=0; i<to_reada; i++){ msdos_prefetch (inode,&pre,to_reada);
int sector;
struct buffer_head *bh;
if (!(sector = msdos_smap(inode,pre.file_sector++))) break;
PRINTK (("fsector1 %d -> %d\n",pre.file_sector-1,sector));
bh = getblk(inode->i_dev,sector,SECTOR_SIZE);
if (bh == NULL) break;
pre.bhlist[pre.nblist++] = bh;
if (!bh->b_uptodate){
bhreq[nbreq++] = bh;
}
}
pre.fetched_max = pre.file_sector * SECTOR_SIZE;
if (nbreq > 0) ll_rw_block (READ,nbreq,bhreq);
} }
start = buf; start = buf;
pre.nolist = 0; pre.nolist = 0;
PRINTK (("count %d ahead %d nblist %d\n",count,read_ahead[MAJOR(inode->i_dev)],pre.nblist));
while ((left = MIN(inode->i_size-filp->f_pos,count-(buf-start))) > 0){ while ((left = MIN(inode->i_size-filp->f_pos,count-(buf-start))) > 0){
struct buffer_head *bh = pre.bhlist[pre.nolist]; struct buffer_head *bh = pre.bhlist[pre.nolist];
char *data; char *data;
int size,offset;
if (bh == NULL) break; if (bh == NULL) break;
PRINTK (("file_read pos %ld nblist %d %d %d\n",filp->f_pos,pre.nblist,pre.fetched,count));
pre.bhlist[pre.nolist] = NULL; pre.bhlist[pre.nolist] = NULL;
if (left + filp->f_pos > pre.fetched_max){
int sector;
if ((sector = msdos_smap(inode,pre.file_sector++))){
struct buffer_head *bhreq[1];
PRINTK (("fsector2 %d -> %d\n",pre.file_sector-1,sector));
bhreq[0] = getblk(inode->i_dev,sector,SECTOR_SIZE);
if (bhreq[0] == NULL) break;
pre.bhlist[pre.nolist] = bhreq[0];
if (!bhreq[0]->b_uptodate)
ll_rw_block (READ,1,bhreq);
pre.fetched_max += SECTOR_SIZE;
}else{
/* Stop prefetching further, we have reached eof */
pre.fetched_max = 2000000000l;
}
}
pre.nolist++; pre.nolist++;
if (pre.nolist >= pre.nblist) pre.nolist = 0; if (pre.nolist == MSDOS_PREFETCH/2){
memcpy (pre.bhlist,pre.bhlist+MSDOS_PREFETCH/2
,(MSDOS_PREFETCH/2)*sizeof(pre.bhlist[0]));
pre.nblist -= MSDOS_PREFETCH/2;
msdos_prefetch (inode,&pre,MSDOS_PREFETCH/2);
pre.nolist = 0;
}
PRINTK (("file_read pos %ld nblist %d %d %d\n",filp->f_pos,pre.nblist,pre.fetched,count));
wait_on_buffer(bh); wait_on_buffer(bh);
if (!bh->b_uptodate){ if (!bh->b_uptodate){
/* read error ? */ /* read error ? */
...@@ -167,31 +177,28 @@ int msdos_file_read( ...@@ -167,31 +177,28 @@ int msdos_file_read(
} }
offset = filp->f_pos & (SECTOR_SIZE-1); offset = filp->f_pos & (SECTOR_SIZE-1);
filp->f_pos += (size = MIN(SECTOR_SIZE-offset,left)); filp->f_pos += (size = MIN(SECTOR_SIZE-offset,left));
data = bh->b_data; data = bh->b_data + offset;
if (MSDOS_I(inode)->i_binary) { if (MSDOS_I(inode)->i_binary) {
memcpy_tofs(buf,data+offset,size); memcpy_tofs(buf,data,size);
buf += size; buf += size;
} }else{
else for (cnt = size; cnt; cnt--) { int cnt;
char ch; for (cnt = size; cnt; cnt--) {
if ((ch = *((char *) data+offset++)) == '\r') char ch = *data++;
size--; if (ch == 26){
else { filp->f_pos = inode->i_size;
if (ch != 26) put_fs_byte(ch,buf++); break;
else { }else if (ch != '\r'){
filp->f_pos = inode->i_size; put_fs_byte(ch,buf++);
brelse(bh);
break;
}
} }
} }
}
brelse(bh); brelse(bh);
} }
PRINTK (("--- %d -> %d\n",count,(int)(buf-start))); PRINTK (("--- %d -> %d\n",count,(int)(buf-start)));
for (i=0; i<pre.nblist; i++) brelse (pre.bhlist[i]); for (i=0; i<pre.nblist; i++) brelse (pre.bhlist[i]);
if (start == buf) return -EIO; if (start == buf) return -EIO;
if (!IS_RDONLY(inode)) if (!IS_RDONLY(inode)) inode->i_atime = CURRENT_TIME;
inode->i_atime = CURRENT_TIME;
PRINTK (("file_read ret %d\n",(buf-start))); PRINTK (("file_read ret %d\n",(buf-start)));
filp->f_reada = 1; /* Will be reset if a lseek is done */ filp->f_reada = 1; /* Will be reset if a lseek is done */
return buf-start; return buf-start;
......
...@@ -135,6 +135,7 @@ asmlinkage int sys_utime(char * filename, struct utimbuf * times) ...@@ -135,6 +135,7 @@ asmlinkage int sys_utime(char * filename, struct utimbuf * times)
struct inode * inode; struct inode * inode;
long actime,modtime; long actime,modtime;
int error; int error;
unsigned int flags = 0;
struct iattr newattrs; struct iattr newattrs;
error = namei(filename,&inode); error = namei(filename,&inode);
...@@ -144,17 +145,14 @@ asmlinkage int sys_utime(char * filename, struct utimbuf * times) ...@@ -144,17 +145,14 @@ asmlinkage int sys_utime(char * filename, struct utimbuf * times)
iput(inode); iput(inode);
return -EROFS; return -EROFS;
} }
/* Don't worry, the checks are done in inode_change_ok() */
if (times) { if (times) {
if ((current->fsuid != inode->i_uid) && !fsuser()) {
iput(inode);
return -EPERM;
}
actime = get_fs_long((unsigned long *) &times->actime); actime = get_fs_long((unsigned long *) &times->actime);
modtime = get_fs_long((unsigned long *) &times->modtime); modtime = get_fs_long((unsigned long *) &times->modtime);
newattrs.ia_ctime = CURRENT_TIME; newattrs.ia_ctime = CURRENT_TIME;
flags = ATTR_ATIME_SET | ATTR_MTIME_SET;
} else { } else {
if ((current->fsuid != inode->i_uid) && if (!permission(inode,MAY_WRITE)) {
!permission(inode,MAY_WRITE)) {
iput(inode); iput(inode);
return -EACCES; return -EACCES;
} }
...@@ -162,7 +160,7 @@ asmlinkage int sys_utime(char * filename, struct utimbuf * times) ...@@ -162,7 +160,7 @@ asmlinkage int sys_utime(char * filename, struct utimbuf * times)
} }
newattrs.ia_atime = actime; newattrs.ia_atime = actime;
newattrs.ia_mtime = modtime; newattrs.ia_mtime = modtime;
newattrs.ia_valid = ATTR_CTIME | ATTR_MTIME | ATTR_ATIME; newattrs.ia_valid = ATTR_CTIME | ATTR_MTIME | ATTR_ATIME | flags;
inode->i_dirt = 1; inode->i_dirt = 1;
error = notify_change(inode, &newattrs); error = notify_change(inode, &newattrs);
iput(inode); iput(inode);
......
...@@ -26,6 +26,8 @@ static void cp_old_stat(struct inode * inode, struct old_stat * statbuf) ...@@ -26,6 +26,8 @@ static void cp_old_stat(struct inode * inode, struct old_stat * statbuf)
tmp.st_gid = inode->i_gid; tmp.st_gid = inode->i_gid;
tmp.st_rdev = inode->i_rdev; tmp.st_rdev = inode->i_rdev;
tmp.st_size = inode->i_size; tmp.st_size = inode->i_size;
if (inode->i_pipe)
tmp.st_size = PIPE_SIZE(*inode);
tmp.st_atime = inode->i_atime; tmp.st_atime = inode->i_atime;
tmp.st_mtime = inode->i_mtime; tmp.st_mtime = inode->i_mtime;
tmp.st_ctime = inode->i_ctime; tmp.st_ctime = inode->i_ctime;
...@@ -46,6 +48,8 @@ static void cp_new_stat(struct inode * inode, struct new_stat * statbuf) ...@@ -46,6 +48,8 @@ static void cp_new_stat(struct inode * inode, struct new_stat * statbuf)
tmp.st_gid = inode->i_gid; tmp.st_gid = inode->i_gid;
tmp.st_rdev = inode->i_rdev; tmp.st_rdev = inode->i_rdev;
tmp.st_size = inode->i_size; tmp.st_size = inode->i_size;
if (inode->i_pipe)
tmp.st_size = PIPE_SIZE(*inode);
tmp.st_atime = inode->i_atime; tmp.st_atime = inode->i_atime;
tmp.st_mtime = inode->i_mtime; tmp.st_mtime = inode->i_mtime;
tmp.st_ctime = inode->i_ctime; tmp.st_ctime = inode->i_ctime;
......
...@@ -178,6 +178,8 @@ struct buffer_head { ...@@ -178,6 +178,8 @@ struct buffer_head {
#define ATTR_ATIME 16 #define ATTR_ATIME 16
#define ATTR_MTIME 32 #define ATTR_MTIME 32
#define ATTR_CTIME 64 #define ATTR_CTIME 64
#define ATTR_ATIME_SET 128
#define ATTR_MTIME_SET 256
/* /*
* This is the Inode Attributes structure, used for notify_change(). It * This is the Inode Attributes structure, used for notify_change(). It
......
...@@ -23,9 +23,15 @@ ...@@ -23,9 +23,15 @@
#define IOC_INOUT (IOC_IN | IOC_OUT) /* both */ #define IOC_INOUT (IOC_IN | IOC_OUT) /* both */
#define IOCSIZE_MASK 0x3fff0000 /* size (max 16k-1 bytes) */ #define IOCSIZE_MASK 0x3fff0000 /* size (max 16k-1 bytes) */
#define IOCSIZE_SHIFT 16 /* how to get the size */ #define IOCSIZE_SHIFT 16 /* how to get the size */
#define IOCSIZE_MAX ((PAGE_SIZE-1)&(IOCSIZE_MASK >> IOC_SHIFT))
#define IOCCMD_MASK 0x0000ffff /* command code */ #define IOCCMD_MASK 0x0000ffff /* command code */
#define IOCCMD_SHIFT 0 #define IOCCMD_SHIFT 0
#define IOCPARM_MASK IOCCMD_MASK
#define IOCPARM_SHIFT IOCCMD_SHIFT
#define IOC_SIZE(cmd) (((cmd) & IOCSIZE_MASK) >> IOCSIZE_SHIFT)
#define IOCBASECMD(cmd) ((cmd) & ~IOOCPARM_MASK
#define IOCGROUP(cmd) (((cmd) >> 8) & 0xFF)
/* _IO(magic, subcode); size field is zero and the /* _IO(magic, subcode); size field is zero and the
* subcode determines the command. * subcode determines the command.
......
#ifndef _LINUX_KD_H #ifndef _LINUX_KD_H
#define _LINUX_KD_H #define _LINUX_KD_H
#include <linux/types.h>
/* 0x4B is 'K', to avoid collision with termios and vt */ /* 0x4B is 'K', to avoid collision with termios and vt */
#define SWAPMONO 0x4B00 /* use mca as output device */
#define SWAPCGA 0x4B01 /* use cga as output device */
#define SWAPEGA 0x4B02 /* use ega as output device */
#define SWAPVGA 0x4B03 /* use vga as output device */
#define CONS_CURRENT 0x4B04 /* return current output device */
#define MONO 0x01
#define CGA 0x02
#define EGA 0x03
#define SW_B40x25 0x4B05 /* 40x25 mono text (cga/ega) */
#define SW_C40x25 0x4B06 /* 40x24 color text (cga/ega) */
#define SW_B80x25 0x4B07 /* 80x25 mono text (cga/ega) */
#define SW_C80x25 0x4B08 /* 80x25 color text (cga/ega) */
#define SW_BG320 0x4B09 /* 320x200 mono graphics (cga/ega) */
#define SW_CG320 0x4B0A /* 320x200 color graphics (cga/ega) */
#define SW_BG640 0x4B0B /* 640x200 mono graphics (cga/ega) */
#define SW_CG320_D 0x4B0C /* 320x200 graphics (ega mode d) */
#define SW_CG640_E 0x4B0D /* 640x200 graphics (ega mode e) */
#define SW_EGAMONOAPA 0x4B0E /* 640x350 graphics (ega mode f) */
#define SW_ENH_MONOAPA2 0x4B0F /* 640x350 graphics extd mem (ega mode f*) */
#define SW_CG640x350 0x4B10 /* 640x350 graphics (ega mode 10) */
#define SW_ENH_CG640 0x4B11 /* 640x350 graphics extd mem (ega mode 10*) */
#define SW_EGAMONO80x25 0x4B12 /* 80x25 mono text (ega mode 7) */
#define SW_ENHB40x25 0x4B13 /* enhanced 40x25 mono text (ega) */
#define SW_ENHC40x25 0x4B14 /* enhanced 40x25 color text (ega) */
#define SW_ENHB80x25 0x4B15 /* enhanced 80x25 mono text (ega) */
#define SW_ENHC80x25 0x4B16 /* enhanced 80x25 color text (ega) */
#define SW_ENHB80x43 0x4B17 /* enhanced 80x43 mono text (ega) */
#define SW_ENHC80x43 0x4B18 /* enhanced 80x43 color text (ega) */
#define SW_MCAMODE 0x4B19 /* reinit mca */
#define SW_ATT640 0x4B1A /* 640x400 16color */
/* should add more vga modes, etc */
#define CONS_GET 0x4B1B /* get current display mode */
#define M_B40x25 0 /* 40x25 mono (cga/ega) */
#define M_C40x25 1 /* 40x25 color (cga/ega) */
#define M_B80x25 2 /* 80x25 mono (cga/ega) */
#define M_C80x25 3 /* 80x25 color (cga/ega) */
#define M_BG320 4 /* 320x200 mono (cga/ega) */
#define M_CG320 5 /* 320x200 color (cga/ega) */
#define M_BG640 6 /* 640x200 mono (cga/ega) */
#define M_EGAMONO80x25 7 /* 80x25 mono (ega) */
#define M_CG320_D 13 /* ega mode d */
#define M_CG640_E 14 /* ega mode e */
#define M_EFAMONOAPA 15 /* ega mode f */
#define M_CG640x350 16 /* ega mode 10 */
#define M_ENHMONOAPA2 17 /* ega mode f with ext mem */
#define M_ENH_CG640 18 /* ega mode 10* */
#define M_ENH_B40x25 19 /* ega enh 40x25 mono */
#define M_ENH_C40x25 20 /* ega enh 40x25 color */
#define M_ENH_B80x25 21 /* ega enh 80x25 mono */
#define M_ENH_C80x25 22 /* ega enh 80x25 color */
#define M_ENH_B80x43 0x70 /* ega enh 80x43 mono */
#define M_ENH_C80x43 0x71 /* ega enh 80x43 color */
#define M_MCA_MODE 0xff /* monochrome adapter mode */
#define MCA_GET 0x4B1C /* get mca display mode */
#define CGA_GET 0x4B1D /* get cga display mode */
#define EGA_GET 0x4B1E /* get ega display mode */
#define MAPCONS 0x4B1F /* map current video mem into address space */
#define MAPMONO 0x4B20 /* map mca video mem into address space */
#define MAPCGA 0x4B21 /* map cga video mem into address space */
#define MAPEGA 0x4B22 /* map ega video mem into address space */
#define MAPVGA 0x4B23 /* map vga video mem into address space */
struct port_io_struc {
char dir; /* direction in vs out */
unsigned short port;
char data;
};
#define IN_ON_PORT 0x00
#define OUT_ON_PORT 0x01
struct port_io_arg {
struct port_io_struc args[4];
};
#define MCAIO 0x4B24 /* i/o to mca video board */
#define CGAIO 0x4B25 /* i/o to cga video board */
#define EGAIO 0x4B26 /* i/o to ega video board */
#define VGAIO 0x4B27 /* i/o to vga video board */
#define GIO_FONT8x8 0x4B28 /* gets current 8x8 font used */
#define PIO_FONT8x8 0x4B29 /* use supplied 8x8 font */
#define GIO_FONT8x14 0x4B2A /* gets current 8x14 font used */
#define PIO_FONT8x14 0x4B2B /* use supplied 8x14 font */
#define GIO_FONT8x16 0x4B2C /* gets current 8x16 font used */
#define PIO_FONT8x16 0x4B2D /* use supplied 8x16 font */
#define GIO_FONT 0x4B60 /* gets font in expanded form */ #define GIO_FONT 0x4B60 /* gets font in expanded form */
#define PIO_FONT 0x4B61 /* use font in expanded form */ #define PIO_FONT 0x4B61 /* use font in expanded form */
#define MKDIOADDR 32 /* io bitmap size from <linux/sched.h> */
struct kd_disparam {
long type; /* type of display */
char *addr; /* display mem address */
ushort ioaddr[MKDIOADDR]; /* valid i/o addresses */
};
#define KDDISPTYPE 0x4B2E /* gets display info */
#define KD_MONO 0x01
#define KD_HERCULES 0x02
#define KD_CGA 0x03
#define KD_EGA 0x04
#define KIOCSOUND 0x4B2F /* start sound generation (0 for off) */ #define KIOCSOUND 0x4B2F /* start sound generation (0 for off) */
#define KDMKTONE 0x4B30 /* generate tone */ #define KDMKTONE 0x4B30 /* generate tone */
...@@ -116,7 +18,7 @@ struct kd_disparam { ...@@ -116,7 +18,7 @@ struct kd_disparam {
#define KDGKBTYPE 0x4B33 /* get keyboard type */ #define KDGKBTYPE 0x4B33 /* get keyboard type */
#define KB_84 0x01 #define KB_84 0x01
#define KB_101 0x02 #define KB_101 0x02 /* this is what we always answer */
#define KB_OTHER 0x03 #define KB_OTHER 0x03
#define KDADDIO 0x4B34 /* add i/o port as valid */ #define KDADDIO 0x4B34 /* add i/o port as valid */
...@@ -124,42 +26,37 @@ struct kd_disparam { ...@@ -124,42 +26,37 @@ struct kd_disparam {
#define KDENABIO 0x4B36 /* enable i/o to video board */ #define KDENABIO 0x4B36 /* enable i/o to video board */
#define KDDISABIO 0x4B37 /* disable i/o to video board */ #define KDDISABIO 0x4B37 /* disable i/o to video board */
struct kd_quemode {
int qsize; /* desired # elem in queue */
int signo; /* signal to send when queue not empty */
char *qaddr; /* user virt addr of queue */
};
#define KDQUEMODE 0x4B38 /* enable/disable special queue mode */
#define KDSBORDER 0x4B39 /* set screen boarder in ega text mode */
#define KDSETMODE 0x4B3A /* set text/graphics mode */ #define KDSETMODE 0x4B3A /* set text/graphics mode */
#define KD_TEXT 0x00 #define KD_TEXT 0x00
#define KD_GRAPHICS 0x01 #define KD_GRAPHICS 0x01
#define KD_TEXT0 0x02 /* ? */ #define KD_TEXT0 0x02 /* obsolete */
#define KD_TEXT1 0x03 /* ? */ #define KD_TEXT1 0x03 /* obsolete */
#define KDGETMODE 0x4B3B /* get current mode */ #define KDGETMODE 0x4B3B /* get current mode */
struct kd_memloc {
char *vaddr; /* virt addr to map to */
char *physaddr; /* phys addr to map from */
long length; /* number of bytes */
long ioflg; /* enable i/o if set */
};
#define KDMAPDISP 0x4B3C /* map display into address space */ #define KDMAPDISP 0x4B3C /* map display into address space */
#define KDUNMAPDISP 0x4B3D /* unmap display from address space */ #define KDUNMAPDISP 0x4B3D /* unmap display from address space */
#define KDVDCTYPE 0x4B3E /* return vdc controller/display info */
#define KIOCINFO 0x4B3F /* tell what the device is */
typedef char scrnmap_t; typedef char scrnmap_t;
#define E_TABSZ 256 #define E_TABSZ 256
#define GIO_SCRNMAP 0x4B40 /* get screen mapping from kernel */ #define GIO_SCRNMAP 0x4B40 /* get screen mapping from kernel */
#define PIO_SCRNMAP 0x4B41 /* put screen mapping table in kernel */ #define PIO_SCRNMAP 0x4B41 /* put screen mapping table in kernel */
#define GIO_ATTR 0x4B42 /* get screen attributes */ #define GIO_UNIMAP 0x4B66 /* get unicode-to-font mapping from kernel */
#define GIO_COLOR 0x4B43 /* return nonzero if display is color */ struct unipair {
u_short unicode;
u_short fontpos;
};
struct unimapdesc {
u_short entry_ct;
struct unipair *entries;
};
#define PIO_UNIMAP 0x4B67 /* put unicode-to-font mapping in kernel */
#define PIO_UNIMAPCLR 0x4B68 /* clear table, possibly advise hashalgorithm */
struct unimapinit {
u_short advised_hashsize; /* 0 if no opinion */
u_short advised_hashstep; /* 0 if no opinion */
u_short advised_hashlevel; /* 0 if no opinion */
};
#define K_RAW 0x00 #define K_RAW 0x00
#define K_XLATE 0x01 #define K_XLATE 0x01
...@@ -209,7 +106,14 @@ struct kbdiacrs { ...@@ -209,7 +106,14 @@ struct kbdiacrs {
#define KDGKBDIACR 0x4B4A /* read kernel accent table */ #define KDGKBDIACR 0x4B4A /* read kernel accent table */
#define KDSKBDIACR 0x4B4B /* write kernel accent table */ #define KDSKBDIACR 0x4B4B /* write kernel accent table */
/* note: 0x4B60 and 0x4B61 used above for GIO_FONT and PIO_FONT struct kbkeycode {
0x4B62 and 0x4B63 used above for KDGKBMETA and KDSKBMETA */ unsigned int scancode, keycode;
};
#define KDGETKEYCODE 0x4B4C /* read kernel keycode table entry */
#define KDSETKEYCODE 0x4B4D /* write kernel keycode table entry */
/* note: 0x4B00-0x4B4D all have had a value at some time;
don't reuse for the time being */
/* note: 0x4B60-0x4B68 used above */
#endif /* _LINUX_KD_H */ #endif /* _LINUX_KD_H */
...@@ -116,6 +116,7 @@ struct page_info { ...@@ -116,6 +116,7 @@ struct page_info {
extern int nr_swap_pages; extern int nr_swap_pages;
extern int nr_free_pages; extern int nr_free_pages;
extern int min_free_pages;
#define NR_MEM_LISTS 6 #define NR_MEM_LISTS 6
......
...@@ -120,6 +120,9 @@ ...@@ -120,6 +120,9 @@
#define PCI_DEVICE_ID_NCR_53C820 0x0002 #define PCI_DEVICE_ID_NCR_53C820 0x0002
#define PCI_DEVICE_ID_NCR_53C825 0x0003 #define PCI_DEVICE_ID_NCR_53C825 0x0003
#define PCI_VENDOR_ID_ADAPTEC 0x9004
#define PCI_DEVICE_ID_ADAPTEC_2940 0x7178
/* PCI BIOS */ /* PCI BIOS */
extern int pcibios_present (void); extern int pcibios_present (void);
......
...@@ -135,7 +135,6 @@ ...@@ -135,7 +135,6 @@
#define upc_bit 0x40 #define upc_bit 0x40
#define volume_bit 0x20 #define volume_bit 0x20
#define toc_bit 0x10 #define toc_bit 0x10
#define multisession_bit 0x08
#define cd_size_bit 0x04 #define cd_size_bit 0x04
#define subq_bit 0x02 #define subq_bit 0x02
#define frame_size_bit 0x01 #define frame_size_bit 0x01
...@@ -146,7 +145,6 @@ ...@@ -146,7 +145,6 @@
#define upc_valid (DriveStruct[d].diskstate_flags&upc_bit) #define upc_valid (DriveStruct[d].diskstate_flags&upc_bit)
#define volume_valid (DriveStruct[d].diskstate_flags&volume_bit) #define volume_valid (DriveStruct[d].diskstate_flags&volume_bit)
#define toc_valid (DriveStruct[d].diskstate_flags&toc_bit) #define toc_valid (DriveStruct[d].diskstate_flags&toc_bit)
#define multisession_valid (DriveStruct[d].diskstate_flags&multisession_bit)
#define cd_size_valid (DriveStruct[d].diskstate_flags&cd_size_bit) #define cd_size_valid (DriveStruct[d].diskstate_flags&cd_size_bit)
#define subq_valid (DriveStruct[d].diskstate_flags&subq_bit) #define subq_valid (DriveStruct[d].diskstate_flags&subq_bit)
#define frame_size_valid (DriveStruct[d].diskstate_flags&frame_size_bit) #define frame_size_valid (DriveStruct[d].diskstate_flags&frame_size_bit)
...@@ -197,21 +195,24 @@ ...@@ -197,21 +195,24 @@
/* /*
* drive types (firmware versions): * drive types (firmware versions):
*/ */
#define drv_199 0 /* <200 */ #define drv_old 0x10 /* CR-52x family */
#define drv_200 1 /* <201 */ #define drv_199 0x11 /* <200 */
#define drv_201 2 /* <210 */ #define drv_200 0x12 /* <201 */
#define drv_210 3 /* <211 */ #define drv_201 0x13 /* <210 */
#define drv_211 4 /* <300 */ #define drv_210 0x14 /* <211 */
#define drv_300 5 /* else */ #define drv_211 0x15 /* <300 */
#define drv_099 0x10 /* new, <100 */ #define drv_300 0x16 /* >=300 */
#define drv_100 0x11 /* new, >=100 */
#define drv_new 0x10 /* all new drives have that bit set */
#define drv_old 0x00 /* */
/* #define drv_lcs 0x20 /* Longshine family */
* drv_099 and drv_100 are the "new" drives #define drv_260 0x21 /* LCS-7260 */
*/
#define new_drive (DriveStruct[d].drv_type&0x10) #define drv_new 0x40 /* CR-56x family */
#define drv_099 0x41 /* <100 */
#define drv_100 0x42 /* >=100 */
#define old_drive (DriveStruct[d].drv_type&drv_old)
#define lcs_drive (DriveStruct[d].drv_type&drv_lcs)
#define new_drive (DriveStruct[d].drv_type&drv_new)
/* /*
* audio states: * audio states:
...@@ -370,8 +371,9 @@ read: 02 xx-xx-xx nn-nn fl. (??) read nn-nn blocks of 2048 bytes, ...@@ -370,8 +371,9 @@ read: 02 xx-xx-xx nn-nn fl. (??) read nn-nn blocks of 2048 bytes,
fl=0: "lba"-, =2:"msf-bcd"-coded xx-xx-xx fl=0: "lba"-, =2:"msf-bcd"-coded xx-xx-xx
Read XA-Data: Read XA-Data:
read: 03 ll-bb-aa nn-nn 00. (??) read nn-nn blocks of 2340 bytes, read: 03 xx-xx-xx nn-nn fl. (??) read nn-nn blocks of 2340 bytes,
starting at block ll-bb-aa starting at block xx-xx-xx
fl=0: "lba"-, =2:"msf-bcd"-coded xx-xx-xx
Read SUB_Q: Read SUB_Q:
89 fl 00 00 00 00 00. (13) r0: audio status, r4-r7: lba/msf, 89 fl 00 00 00 00 00. (13) r0: audio status, r4-r7: lba/msf,
......
...@@ -101,7 +101,7 @@ extern void sbpcd_setup(char *str, int *ints); ...@@ -101,7 +101,7 @@ extern void sbpcd_setup(char *str, int *ints);
#endif CONFIG_SBPCD #endif CONFIG_SBPCD
#ifdef CONFIG_CDU31A #ifdef CONFIG_CDU31A
extern void cdu31a_setup(char *str, int *ints); extern void cdu31a_setup(char *str, int *ints);
#endif CONFIG_SBPCD #endif CONFIG_CDU31A
void ramdisk_setup(char *str, int *ints); void ramdisk_setup(char *str, int *ints);
#ifdef CONFIG_SYSVIPC #ifdef CONFIG_SYSVIPC
...@@ -328,7 +328,7 @@ static void parse_options(char *line) ...@@ -328,7 +328,7 @@ static void parse_options(char *line)
for (n = 0 ; devnames[n] ; n++) { for (n = 0 ; devnames[n] ; n++) {
int len = strlen(devnames[n]); int len = strlen(devnames[n]);
if (!strncmp(line,devnames[n],len)) { if (!strncmp(line,devnames[n],len)) {
ROOT_DEV = devnums[n]+simple_strtoul(line+len,NULL,16); ROOT_DEV = devnums[n]+simple_strtoul(line+len,NULL,0);
break; break;
} }
} }
......
...@@ -160,6 +160,7 @@ struct symbol_table symbol_table = { 0, 0, 0, /* for stacked module support */ ...@@ -160,6 +160,7 @@ struct symbol_table symbol_table = { 0, 0, 0, /* for stacked module support */
X(jiffies), X(jiffies),
X(xtime), X(xtime),
X(loops_per_sec), X(loops_per_sec),
X(need_resched),
X(kill_proc), X(kill_proc),
X(kill_pg), X(kill_pg),
X(kill_sl), X(kill_sl),
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
#define SWP_OFFSET(entry) ((entry) >> PAGE_SHIFT) #define SWP_OFFSET(entry) ((entry) >> PAGE_SHIFT)
#define SWP_ENTRY(type,offset) (((type) << 1) | ((offset) << PAGE_SHIFT)) #define SWP_ENTRY(type,offset) (((type) << 1) | ((offset) << PAGE_SHIFT))
static int min_free_pages = 20; int min_free_pages = 20;
static int nr_swapfiles = 0; static int nr_swapfiles = 0;
static struct wait_queue * lock_queue = NULL; static struct wait_queue * lock_queue = NULL;
...@@ -586,8 +586,7 @@ do { struct mem_list * queue = free_area_list+order; \ ...@@ -586,8 +586,7 @@ do { struct mem_list * queue = free_area_list+order; \
unsigned long new_order = order; \ unsigned long new_order = order; \
do { struct mem_list *next = queue->next; \ do { struct mem_list *next = queue->next; \
if (queue != next) { \ if (queue != next) { \
queue->next = next->next; \ (queue->next = next->next)->prev = queue; \
next->next->prev = queue; \
mark_used((unsigned long) next, new_order); \ mark_used((unsigned long) next, new_order); \
nr_free_pages -= 1 << order; \ nr_free_pages -= 1 << order; \
restore_flags(flags); \ restore_flags(flags); \
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
* Alan Cox : Fixed the ICMP error status of net/host unreachable * Alan Cox : Fixed the ICMP error status of net/host unreachable
* Gerhard Koerting : Fixed broadcast ping properly * Gerhard Koerting : Fixed broadcast ping properly
* Ulrich Kunitz : Fixed ICMP timestamp reply * Ulrich Kunitz : Fixed ICMP timestamp reply
* A.N.Kuznetsov : Multihoming fixes.
* Laco Rusnak : Multihoming fixes.
* *
* *
* *
...@@ -408,7 +410,7 @@ static void icmp_echo(struct icmphdr *icmph, struct sk_buff *skb, struct device ...@@ -408,7 +410,7 @@ static void icmp_echo(struct icmphdr *icmph, struct sk_buff *skb, struct device
/* /*
* Ship it out - free it when done * Ship it out - free it when done
*/ */
ip_queue_xmit((struct sock *)NULL, dev, skb2, 1); ip_queue_xmit((struct sock *)NULL, ndev, skb2, 1);
/* /*
* Free the received frame * Free the received frame
...@@ -498,7 +500,7 @@ static void icmp_timestamp(struct icmphdr *icmph, struct sk_buff *skb, struct de ...@@ -498,7 +500,7 @@ static void icmp_timestamp(struct icmphdr *icmph, struct sk_buff *skb, struct de
* Ship it out - free it when done * Ship it out - free it when done
*/ */
ip_queue_xmit((struct sock *) NULL, dev, skb2, 1); ip_queue_xmit((struct sock *) NULL, ndev, skb2, 1);
icmp_statistics.IcmpOutTimestampReps++; icmp_statistics.IcmpOutTimestampReps++;
kfree_skb(skb, FREE_READ); kfree_skb(skb, FREE_READ);
} }
...@@ -581,7 +583,7 @@ static void icmp_address(struct icmphdr *icmph, struct sk_buff *skb, struct devi ...@@ -581,7 +583,7 @@ static void icmp_address(struct icmphdr *icmph, struct sk_buff *skb, struct devi
icmphr->checksum = ip_compute_csum((unsigned char *)icmphr, len); icmphr->checksum = ip_compute_csum((unsigned char *)icmphr, len);
/* Ship it out - free it when done */ /* Ship it out - free it when done */
ip_queue_xmit((struct sock *)NULL, dev, skb2, 1); ip_queue_xmit((struct sock *)NULL, ndev, skb2, 1);
skb->sk = NULL; skb->sk = NULL;
kfree_skb(skb, FREE_READ); kfree_skb(skb, FREE_READ);
......
...@@ -93,6 +93,7 @@ ...@@ -93,6 +93,7 @@
* fix a race and a signal problem with * fix a race and a signal problem with
* accept() and async I/O. * accept() and async I/O.
* Alan Cox : Relaxed the rules on tcp_sendto(). * Alan Cox : Relaxed the rules on tcp_sendto().
* Yury Shevchuk : Really fixed accept() blocking problem.
* *
* *
* To Fix: * To Fix:
...@@ -244,7 +245,7 @@ static struct sk_buff *tcp_find_established(struct sock *s) ...@@ -244,7 +245,7 @@ static struct sk_buff *tcp_find_established(struct sock *s)
return NULL; return NULL;
do do
{ {
if(p->sk->state>=TCP_ESTABLISHED) if(p->sk->state == TCP_ESTABLISHED || p->sk->state >= TCP_FIN_WAIT1)
return p; return p;
p=p->next; p=p->next;
} }
...@@ -1885,7 +1886,7 @@ static void tcp_reset(unsigned long saddr, unsigned long daddr, struct tcphdr *t ...@@ -1885,7 +1886,7 @@ static void tcp_reset(unsigned long saddr, unsigned long daddr, struct tcphdr *t
t1->psh = 0; t1->psh = 0;
t1->doff = sizeof(*t1)/4; t1->doff = sizeof(*t1)/4;
tcp_send_check(t1, saddr, daddr, sizeof(*t1), NULL); tcp_send_check(t1, saddr, daddr, sizeof(*t1), NULL);
prot->queue_xmit(NULL, dev, buff, 1); prot->queue_xmit(NULL, ndev, buff, 1);
tcp_statistics.TcpOutSegs++; tcp_statistics.TcpOutSegs++;
} }
...@@ -2211,7 +2212,7 @@ static void tcp_conn_request(struct sock *sk, struct sk_buff *skb, ...@@ -2211,7 +2212,7 @@ static void tcp_conn_request(struct sock *sk, struct sk_buff *skb,
ptr[3] =(newsk->mtu) & 0xff; ptr[3] =(newsk->mtu) & 0xff;
tcp_send_check(t1, daddr, saddr, sizeof(*t1)+4, newsk); tcp_send_check(t1, daddr, saddr, sizeof(*t1)+4, newsk);
newsk->prot->queue_xmit(newsk, dev, buff, 0); newsk->prot->queue_xmit(newsk, ndev, buff, 0);
reset_timer(newsk, TIME_WRITE , TCP_TIMEOUT_INIT); reset_timer(newsk, TIME_WRITE , TCP_TIMEOUT_INIT);
skb->sk = newsk; skb->sk = newsk;
......
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