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

Import 1.1.63

parent 1b7a152c
......@@ -11,6 +11,16 @@ N: Werner Almesberger
E: almesber@bernina.ethz.ch
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
E: aycock@cpsc.ucalgary.ca
D: Adaptec 274x driver
......@@ -148,6 +158,12 @@ N: Wayne Davison
E: davison@borland.com
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
E: tjd@cs.pitt.edu
D: maintainer of dual-monitor patches for 1.0+
......@@ -296,13 +312,14 @@ S: Dulles, Virginia 20166
S: USA
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: Makedev
S: Department of Computer Science
S: University of Warwick
D: MAKEDEV
S: 15 Duke Street
S: Chapelfields
S: Coventry
S: CV4 7AL
S: CV5 8BZ
S: United Kingdom
N: Ron Holt
......@@ -391,6 +408,13 @@ S: 11, rue General Mangin
S: 38100 Grenoble
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
E: rfkoenig@immd4.informatik.uni-erlangen.de
D: The Linux Support Team Erlangen
......@@ -409,6 +433,13 @@ S: 18 Board Street
S: Doncaster VIC 3108
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
E: mlord@bnr.ca
E: mlord@achilles.net
......@@ -819,7 +850,6 @@ S: USA
N: Eric Youngdale
E: eric@aib.com
E: ericy@cais.com
D: General kernel hacker
D: SCSI iso9660 and ELF
S: 17 Canterbury Square #101
......
VERSION = 1
PATCHLEVEL = 1
SUBLEVEL = 62
SUBLEVEL = 63
ARCH = i386
......@@ -132,7 +132,11 @@ tools/./version.h: tools/version.h
tools/version.h: $(CONFIGURE) Makefile
@./makever.sh
@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_BY \"`whoami`\" >> tools/version.h
@echo \#define LINUX_COMPILE_HOST \"`hostname`\" >> tools/version.h
......
......@@ -12,7 +12,7 @@ AS86 =as86 -0 -a
LD86 =ld86 -0
AS =as
LD =ld
HOSTCC =gcc
HOSTCC =gcc -I$(TOPDIR)/include
CC =gcc -D__KERNEL__ -I$(TOPDIR)/include
MAKE =make
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.
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,
Kotobuki, Panasonic drives, sometimes labelled as "CreativeLabs". The
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
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
......@@ -20,21 +23,22 @@ interfaces does NOT make the drives compatible. :-)
It will work with the soundcard interfaces (SB Pro, SB 16, Galaxy, SoundFX,
...) 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",
which is found on the Spea Media FX sound card. I still need feedback about
this.
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,
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).
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
hard-wired to drive ID 0. The drives have to use different drive IDs, and each
drive has to get a unique minor number (0...3), corresponding to it's drive ID.
CR-52x ("old"), CR-56x ("new") and LCS drives can be mixed, but the CR-521
ones are hard-wired to drive ID 0. The drives have to use different drive IDs,
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
consecutive order.
......
This diff is collapsed.
......@@ -741,23 +741,29 @@ static void scrdown(int currcons, unsigned int t, unsigned int b)
static void lf(int currcons)
{
if (y+1<bottom) {
y++;
pos += video_size_row;
return;
} else
/* don't scroll if above bottom of scrolling region, or
* if below scrolling region
*/
if (y+1 == bottom)
scrup(currcons,top,bottom);
else if (y < video_num_lines-1) {
y++;
pos += video_size_row;
}
need_wrap = 0;
}
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--;
pos -= video_size_row;
return;
} else
scrdown(currcons,top,bottom);
}
need_wrap = 0;
}
......
......@@ -193,38 +193,100 @@ void to_utf8(ushort c) {
}
/*
* Translation of escaped scancodes to keysyms.
* This should be user-settable.
* Translation of escaped scancodes to keycodes.
* 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 (E0_BASE+0)
#define E0_RCTRL (E0_BASE+1)
#define E0_KPSLASH (E0_BASE+2)
#define E0_PRSCR (E0_BASE+3)
#define E0_RALT (E0_BASE+4)
#define E0_BREAK (E0_BASE+5) /* (control-pause) */
#define E0_HOME (E0_BASE+6)
#define E0_UP (E0_BASE+7)
#define E0_PGUP (E0_BASE+8)
#define E0_LEFT (E0_BASE+9)
#define E0_RIGHT (E0_BASE+10)
#define E0_END (E0_BASE+11)
#define E0_DOWN (E0_BASE+12)
#define E0_PGDN (E0_BASE+13)
#define E0_INS (E0_BASE+14)
#define E0_DEL (E0_BASE+15)
#define E0_KPENTER 96
#define E0_RCTRL 97
#define E0_KPSLASH 98
#define E0_PRSCR 99
#define E0_RALT 100
#define E0_BREAK 101 /* (control-pause) */
#define E0_HOME 102
#define E0_UP 103
#define E0_PGUP 104
#define E0_LEFT 105
#define E0_RIGHT 106
#define E0_END 107
#define E0_DOWN 108
#define E0_PGDN 109
#define E0_INS 110
#define E0_DEL 111
#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 */
#define E0_MACRO (E0_BASE+16)
#define E0_MACRO 112
/* LK450 */
#define E0_F13 (E0_BASE+17)
#define E0_F14 (E0_BASE+18)
#define E0_HELP (E0_BASE+19)
#define E0_DO (E0_BASE+20)
#define E0_F17 (E0_BASE+21)
#define E0_KPMINPLUS (E0_BASE+22)
#define E1_PAUSE (E0_BASE+23) /* 119 */
#define E0_F13 113
#define E0_F14 114
#define E0_HELP 115
#define E0_DO 116
#define E0_F17 117
#define E0_KPMINPLUS 118
/*
* 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] = {
0, 0, 0, 0, 0, 0, 0, 0, /* 0x00-0x07 */
......@@ -236,47 +298,33 @@ static unsigned char e0_keys[128] = {
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_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 */
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, E0_MACRO, /* 0x68-0x6f */
0, 0, 0, 0, 0, 0, 0, 0, /* 0x70-0x77 */
0, 0, 0, 0, 0, 0, 0, 0 /* 0x78-0x7f */
};
/* kludge to stay below 128 - next time someone comes with a strange
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 */
/* Owners of a certain Japanese keyboard can use 89 and 124 */
/* Owners of a certain Brazilian keyboard can use 89 and 121 */
/* Note: MEDIUMRAW mode will change, and all keycodes above 89 will change;
this is only a temporary solution */
#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 (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 */
int setkeycode(unsigned int scancode, unsigned int keycode)
{
if (scancode < SC_LIM || scancode > 255 || keycode > 127)
return -EINVAL;
if (scancode < 128)
high_keys[scancode - SC_LIM] = keycode;
else
e0_keys[scancode - 128] = keycode;
return 0;
}
static unsigned char high_keys[128 - SC_LIM] = {
0, 0, 0, 0, 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 */
};
int getkeycode(unsigned int scancode)
{
return
(scancode < SC_LIM || scancode > 255) ? -EINVAL :
(scancode < 128) ? high_keys[scancode - SC_LIM] :
e0_keys[scancode - 128];
}
static void keyboard_interrupt(int int_pt_regs)
{
......
......@@ -46,6 +46,8 @@ struct vt_struct *vt_cons[MAX_NR_CONSOLES];
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 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,
}
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:
{
struct kbentry * const a = (struct kbentry *)arg;
......
......@@ -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. */
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
......
......@@ -1010,12 +1010,12 @@ slip_init(struct device *dev)
if (already++ == 0) {
printk("SLIP: version %s (%d channels)\n",
SLIP_VERSION, SL_NRUNIT);
#ifdef CONFIG_INET
#ifdef SL_COMPRESSED
printk("CSLIP: code copyright 1989 Regents of the University of California\n");
#endif
#endif
#ifdef CONFIG_AX25
printk("AX25: KISS encapsulation enabled\n");
#endif
#endif
/* Fill in our LDISC request block. */
memset(&sl_ldisc, 0, sizeof(sl_ldisc));
sl_ldisc.magic = TTY_LDISC_MAGIC;
......
......@@ -196,6 +196,12 @@ void aha1740_intr_handle(int foo)
((ulong) inb(MBOXIN2) <<16) +
((ulong) inb(MBOXIN3) <<24) );
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;
if (SCtmp->host_scribble)
scsi_free(SCtmp->host_scribble, 512);
......
......@@ -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);
#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 */
retval->this_id = tpnt->this_id;
retval->can_queue = tpnt->can_queue;
retval->sg_tablesize = tpnt->sg_tablesize;
retval->unchecked_isa_dma = tpnt->unchecked_isa_dma;
......
......@@ -243,6 +243,7 @@ struct Scsi_Host
*/
int this_id;
int can_queue;
short unsigned int sg_tablesize;
unsigned unchecked_isa_dma:1;
/*
......
......@@ -580,8 +580,8 @@ Scsi_Cmnd * request_queueable (struct request * req, Scsi_Device * device)
if (!SCpnt) return NULL;
if (device->host->hostt->can_queue
&& device->host->host_busy >= device->host->hostt->can_queue) return NULL;
if (device->host->can_queue
&& device->host->host_busy >= device->host->can_queue) return NULL;
if (req) {
memcpy(&SCpnt->request, req, sizeof(struct request));
......@@ -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);
#endif
if (host->hostt->can_queue)
if (host->can_queue)
{
#ifdef DEBUG
printk("queuecommand : routine at %08x\n",
......@@ -860,7 +860,7 @@ void scsi_do_cmd (Scsi_Cmnd * SCpnt, const void *cmnd ,
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 ,
while (1==1){
cli();
if (host->hostt->can_queue
&& host->host_busy >= host->hostt->can_queue)
if (host->can_queue
&& host->host_busy >= host->can_queue)
{
sti();
SCSI_SLEEP(&host->host_wait,
(host->host_busy >= host->hostt->can_queue));
(host->host_busy >= host->can_queue));
} else {
host->host_busy++;
sti();
......
......@@ -41,7 +41,7 @@ int scsicam_bios_param (Disk *disk, /* SCSI disk */
int ret_code;
int size = disk->capacity;
if (!(bh = bread(dev,0,1024)))
if (!(bh = bread(dev & ~0xf,0,1024)))
return -1;
#ifdef DEBUG
......
......@@ -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);
#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)
{
case WRITE :
......
......@@ -56,7 +56,6 @@ int buffers_lav[NR_SIZES] = {0,}; /* Load average of buffer usage */
int nr_free[NR_SIZES] = {0,};
int buffermem = 0;
int nr_buffer_heads = 0;
static int min_free_pages = 20; /* nr free pages needed before buffer grows */
extern int *blksize_size[];
/* Here is the parameter block for the bdflush process. */
......@@ -518,7 +517,7 @@ void refill_freelist(int size)
/* We are going to try and locate this much memory */
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)) {
needed -= PAGE_SIZE;
}
......@@ -1572,7 +1571,7 @@ unsigned long generate_cluster(dev_t dev, int b[], int size)
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);
else
return reassign_cluster(dev, b[0], size);
......@@ -1591,13 +1590,11 @@ void buffer_init(void)
int isize = BUFSIZE_INDEX(BLOCK_SIZE);
if (high_memory >= 4*1024*1024) {
min_free_pages = 200;
if(high_memory >= 16*1024*1024)
nr_hash = 16381;
else
nr_hash = 4093;
} else {
min_free_pages = 20;
nr_hash = 997;
};
......
......@@ -365,16 +365,26 @@ unsigned long * create_tables(char * p,int argc,int envc,int ibcs)
/*
* 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)
{
int i=0;
char ** tmp;
int error, i = 0;
char ** tmp, *p;
if ((tmp = argv) != 0)
while (get_fs_long((unsigned long *) (tmp++)))
error = verify_area(VERIFY_READ, argv, sizeof(char *));
if (error)
return error;
if ((tmp = argv) != 0) {
while ((p = (char *) get_fs_long((unsigned long *) (tmp++))) != NULL) {
i++;
error = verify_area(VERIFY_READ, p, 1);
if (error)
return error;
}
}
return i;
}
......@@ -601,8 +611,10 @@ int do_execve(char * filename, char ** argv, char ** envp, struct pt_regs * regs
if (retval)
return retval;
bprm.filename = filename;
bprm.argc = count(argv);
bprm.envc = count(envp);
if ((bprm.argc = count(argv)) < 0)
return bprm.argc;
if ((bprm.envc = count(envp)) < 0)
return bprm.envc;
restart_interp:
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)
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;
}
......
......@@ -72,6 +72,7 @@ static int isofs_readdir(struct inode * inode, struct file * filp,
void * cpnt = NULL;
unsigned int old_offset;
int dlen, rrflag;
int high_sierra = 0;
char * dpnt, *dpnt1;
struct iso_directory_record * de;
......@@ -125,6 +126,7 @@ static int isofs_readdir(struct inode * inode, struct file * filp,
unsigned int frag1;
frag1 = bufsize - old_offset;
cpnt = kmalloc(*((unsigned char *) de),GFP_KERNEL);
if (!cpnt) return 0;
memcpy(cpnt, bh->b_data + old_offset, frag1);
de = (struct iso_directory_record *) ((char *)cpnt);
brelse(bh);
......@@ -156,8 +158,7 @@ static int isofs_readdir(struct inode * inode, struct file * filp,
put_fs_byte('.',dirent->d_name+1);
i = 2;
dpnt = "..";
if((inode->i_sb->u.isofs_sb.s_firstdatazone
<< bufbits) != inode->i_ino)
if((inode->i_sb->u.isofs_sb.s_firstdatazone) != inode->i_ino)
inode_number = inode->u.isofs_i.i_backlink;
else
inode_number = inode->i_ino;
......@@ -178,6 +179,15 @@ static int isofs_readdir(struct inode * inode, struct file * filp,
is no Rock Ridge NM field. */
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];
dpnt = de->name;
i = dlen;
......@@ -196,6 +206,7 @@ static int isofs_readdir(struct inode * inode, struct file * filp,
if(inode->i_sb->u.isofs_sb.s_mapping == 'n') {
dpnt1 = dpnt;
dpnt = kmalloc(dlen, GFP_KERNEL);
if (!dpnt) goto out;
for (i = 0; i < dlen && i < NAME_MAX; i++) {
if (!(c = dpnt1[i])) break;
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,
return 0;
read = 0;
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);
bhb = bhe = buflist;
......
......@@ -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_firstdatazone = isonum_733( rootp->extent) <<
(ISOFS_BLOCK_BITS - blocksize_bits);
/* RDE: convert log zone size to bit shift */
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;
/* 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,
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);
printk("Max size:%ld Log zone size:%ld\n",
s->u.isofs_sb.s_max_size,
s->u.isofs_sb.s_log_zone_size);
printk("First datazone:%ld Root inode number %d\n",
s->u.isofs_sb.s_firstdatazone,
isonum_733 (rootp->extent) << ISOFS_BLOCK_BITS);
s->u.isofs_sb.s_firstdatazone >> s -> u.isofs_sb.s_log_zone_size,
isonum_733 (rootp->extent) << s -> u.isofs_sb.s_log_zone_size);
if(high_sierra) printk("Disc in High Sierra format.\n");
unlock_super(s);
/* 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,
s->u.isofs_sb.s_gid = opt.gid;
s->s_blocksize = opt.blocksize;
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);
if (!(s->s_mounted)) {
......@@ -320,7 +329,7 @@ int isofs_bmap(struct inode * inode,int block)
printk("_isofs_bmap: block<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)
......@@ -425,10 +434,12 @@ void isofs_read_inode(struct inode * inode)
/* I have no idea what other flag bits are used for, so
we will flag it for now */
#ifdef DEBUG
if((raw_inode->flags[-high_sierra] & ~2)!= 0){
printk("Unusual flag settings for ISO file (%ld %x).\n",
inode->i_ino, raw_inode->flags[-high_sierra]);
}
#endif
#ifdef DEBUG
printk("Get inode %d: %d %d: %d\n",inode->i_ino, block,
......@@ -438,10 +449,9 @@ void isofs_read_inode(struct inode * inode)
inode->i_mtime = inode->i_atime = inode->i_ctime =
iso_date(raw_inode->date, high_sierra);
inode->u.isofs_i.i_first_extent =
(isonum_733 (raw_inode->extent) +
isonum_711 (raw_inode->ext_attr_length)) <<
(ISOFS_BLOCK_BITS - ISOFS_BUFFER_BITS(inode));
inode->u.isofs_i.i_first_extent = (isonum_733 (raw_inode->extent) +
isonum_711 (raw_inode->ext_attr_length))
<< inode -> i_sb -> u.isofs_sb.s_log_zone_size;
inode->u.isofs_i.i_backlink = 0xffffffff; /* Will be used for previous directory */
switch (inode->i_sb->u.isofs_sb.s_conversion){
......@@ -625,6 +635,7 @@ int isofs_lookup_grandparent(struct inode * parent, int extent)
unsigned int frag1;
frag1 = bufsize - old_offset;
cpnt = kmalloc(*((unsigned char *) de),GFP_KERNEL);
if (!cpnt) return -1;
memcpy(cpnt, bh->b_data + old_offset, frag1);
de = (struct iso_directory_record *) ((char *)cpnt);
brelse(bh);
......
......@@ -69,6 +69,7 @@ static struct buffer_head * isofs_find_entry(struct inode * dir,
unsigned int old_offset;
unsigned int backlink;
int dlen, rrflag, match;
int high_sierra = 0;
char * dpnt;
struct iso_directory_record * de;
char c;
......@@ -114,6 +115,7 @@ static struct buffer_head * isofs_find_entry(struct inode * dir,
unsigned int frag1;
frag1 = bufsize - old_offset;
cpnt = kmalloc(*((unsigned char *) de),GFP_KERNEL);
if (!cpnt) return 0;
memcpy(cpnt, bh->b_data + old_offset, frag1);
de = (struct iso_directory_record *) cpnt;
......@@ -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 0
printk("Doing .. (%d %d)",
dir->i_sb->s_firstdatazone << bufbits,
dir->i_sb->s_firstdatazone,
dir->i_ino);
#endif
if((dir->i_sb->u.isofs_sb.s_firstdatazone
<< bufbits) != dir->i_ino)
inode_number = dir->u.isofs_i.i_backlink;
if((dir->i_sb->u.isofs_sb.s_firstdatazone) != dir->i_ino)
inode_number = dir->u.isofs_i.i_backlink;
else
inode_number = dir->i_ino;
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];
dpnt = de->name;
/* Now convert the filename in the buffer to lower case */
......
......@@ -56,6 +56,7 @@
int block, offset, offset1; \
struct buffer_head * bh; \
buffer = kmalloc(cont_size,GFP_KERNEL); \
if (!buffer) goto out; \
block = cont_extent; \
offset = cont_offset; \
offset1 = 0; \
......@@ -214,6 +215,7 @@ int get_rock_ridge_filename(struct iso_directory_record * de,
deallocate the mem fairly soon
after control is returned */
if (!retname) goto out;
*retname = 0; /* Zero length string */
retnamlen = 0;
};
......@@ -467,6 +469,7 @@ char * get_rock_ridge_symlink(struct inode * inode)
while (slen > 1){
if (!rpnt){
rpnt = (char *) kmalloc (inode->i_size +1, GFP_KERNEL);
if (!rpnt) goto out;
*rpnt = 0;
};
rootflag = 0;
......
......@@ -56,6 +56,44 @@ struct inode_operations msdos_file_inode_operations = {
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
*/
......@@ -66,17 +104,9 @@ int msdos_file_read(
int count)
{
char *start;
int left,offset,size,cnt;
#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 left;
int i;
struct msdos_pre pre;
if (!inode) {
......@@ -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));
{
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
take in account the offset in the first block.
......@@ -112,53 +139,36 @@ int msdos_file_read(
pre.file_sector = filp->f_pos >> SECTOR_BITS;
to_reada = count_max / SECTOR_SIZE;
if (count_max & (SECTOR_SIZE-1)) to_reada++;
if (filp->f_reada){
int min_read = read_ahead[MAJOR(inode->i_dev)];
if (min_read > to_reada) to_reada = min_read;
if (filp->f_reada || !MSDOS_I(inode)->i_binary){
/* Doing a read ahead on ascii file make sure we always */
/* 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;
nbreq = pre.nblist = 0;
for (i=0; i<to_reada; i++){
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);
pre.nblist = 0;
msdos_prefetch (inode,&pre,to_reada);
}
start = buf;
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){
struct buffer_head *bh = pre.bhlist[pre.nolist];
char *data;
int size,offset;
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;
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++;
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);
if (!bh->b_uptodate){
/* read error ? */
......@@ -167,31 +177,28 @@ int msdos_file_read(
}
offset = filp->f_pos & (SECTOR_SIZE-1);
filp->f_pos += (size = MIN(SECTOR_SIZE-offset,left));
data = bh->b_data;
data = bh->b_data + offset;
if (MSDOS_I(inode)->i_binary) {
memcpy_tofs(buf,data+offset,size);
memcpy_tofs(buf,data,size);
buf += size;
}
else for (cnt = size; cnt; cnt--) {
char ch;
if ((ch = *((char *) data+offset++)) == '\r')
size--;
else {
if (ch != 26) put_fs_byte(ch,buf++);
else {
filp->f_pos = inode->i_size;
brelse(bh);
break;
}
}else{
int cnt;
for (cnt = size; cnt; cnt--) {
char ch = *data++;
if (ch == 26){
filp->f_pos = inode->i_size;
break;
}else if (ch != '\r'){
put_fs_byte(ch,buf++);
}
}
}
brelse(bh);
}
PRINTK (("--- %d -> %d\n",count,(int)(buf-start)));
for (i=0; i<pre.nblist; i++) brelse (pre.bhlist[i]);
if (start == buf) return -EIO;
if (!IS_RDONLY(inode))
inode->i_atime = CURRENT_TIME;
if (!IS_RDONLY(inode)) inode->i_atime = CURRENT_TIME;
PRINTK (("file_read ret %d\n",(buf-start)));
filp->f_reada = 1; /* Will be reset if a lseek is done */
return buf-start;
......
......@@ -135,6 +135,7 @@ asmlinkage int sys_utime(char * filename, struct utimbuf * times)
struct inode * inode;
long actime,modtime;
int error;
unsigned int flags = 0;
struct iattr newattrs;
error = namei(filename,&inode);
......@@ -144,17 +145,14 @@ asmlinkage int sys_utime(char * filename, struct utimbuf * times)
iput(inode);
return -EROFS;
}
/* Don't worry, the checks are done in inode_change_ok() */
if (times) {
if ((current->fsuid != inode->i_uid) && !fsuser()) {
iput(inode);
return -EPERM;
}
actime = get_fs_long((unsigned long *) &times->actime);
modtime = get_fs_long((unsigned long *) &times->modtime);
newattrs.ia_ctime = CURRENT_TIME;
flags = ATTR_ATIME_SET | ATTR_MTIME_SET;
} else {
if ((current->fsuid != inode->i_uid) &&
!permission(inode,MAY_WRITE)) {
if (!permission(inode,MAY_WRITE)) {
iput(inode);
return -EACCES;
}
......@@ -162,7 +160,7 @@ asmlinkage int sys_utime(char * filename, struct utimbuf * times)
}
newattrs.ia_atime = actime;
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;
error = notify_change(inode, &newattrs);
iput(inode);
......
......@@ -26,6 +26,8 @@ static void cp_old_stat(struct inode * inode, struct old_stat * statbuf)
tmp.st_gid = inode->i_gid;
tmp.st_rdev = inode->i_rdev;
tmp.st_size = inode->i_size;
if (inode->i_pipe)
tmp.st_size = PIPE_SIZE(*inode);
tmp.st_atime = inode->i_atime;
tmp.st_mtime = inode->i_mtime;
tmp.st_ctime = inode->i_ctime;
......@@ -46,6 +48,8 @@ static void cp_new_stat(struct inode * inode, struct new_stat * statbuf)
tmp.st_gid = inode->i_gid;
tmp.st_rdev = inode->i_rdev;
tmp.st_size = inode->i_size;
if (inode->i_pipe)
tmp.st_size = PIPE_SIZE(*inode);
tmp.st_atime = inode->i_atime;
tmp.st_mtime = inode->i_mtime;
tmp.st_ctime = inode->i_ctime;
......
......@@ -178,6 +178,8 @@ struct buffer_head {
#define ATTR_ATIME 16
#define ATTR_MTIME 32
#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
......
......@@ -23,9 +23,15 @@
#define IOC_INOUT (IOC_IN | IOC_OUT) /* both */
#define IOCSIZE_MASK 0x3fff0000 /* size (max 16k-1 bytes) */
#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_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
* subcode determines the command.
......
#ifndef _LINUX_KD_H
#define _LINUX_KD_H
#include <linux/types.h>
/* 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 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 KDMKTONE 0x4B30 /* generate tone */
......@@ -116,7 +18,7 @@ struct kd_disparam {
#define KDGKBTYPE 0x4B33 /* get keyboard type */
#define KB_84 0x01
#define KB_101 0x02
#define KB_101 0x02 /* this is what we always answer */
#define KB_OTHER 0x03
#define KDADDIO 0x4B34 /* add i/o port as valid */
......@@ -124,42 +26,37 @@ struct kd_disparam {
#define KDENABIO 0x4B36 /* enable 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 KD_TEXT 0x00
#define KD_GRAPHICS 0x01
#define KD_TEXT0 0x02 /* ? */
#define KD_TEXT1 0x03 /* ? */
#define KD_TEXT0 0x02 /* obsolete */
#define KD_TEXT1 0x03 /* obsolete */
#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 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;
#define E_TABSZ 256
#define GIO_SCRNMAP 0x4B40 /* get screen mapping from kernel */
#define PIO_SCRNMAP 0x4B41 /* put screen mapping table in kernel */
#define GIO_ATTR 0x4B42 /* get screen attributes */
#define GIO_COLOR 0x4B43 /* return nonzero if display is color */
#define GIO_UNIMAP 0x4B66 /* get unicode-to-font mapping from kernel */
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_XLATE 0x01
......@@ -209,7 +106,14 @@ struct kbdiacrs {
#define KDGKBDIACR 0x4B4A /* read kernel accent table */
#define KDSKBDIACR 0x4B4B /* write kernel accent table */
/* note: 0x4B60 and 0x4B61 used above for GIO_FONT and PIO_FONT
0x4B62 and 0x4B63 used above for KDGKBMETA and KDSKBMETA */
struct kbkeycode {
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 */
......@@ -116,6 +116,7 @@ struct page_info {
extern int nr_swap_pages;
extern int nr_free_pages;
extern int min_free_pages;
#define NR_MEM_LISTS 6
......
......@@ -120,6 +120,9 @@
#define PCI_DEVICE_ID_NCR_53C820 0x0002
#define PCI_DEVICE_ID_NCR_53C825 0x0003
#define PCI_VENDOR_ID_ADAPTEC 0x9004
#define PCI_DEVICE_ID_ADAPTEC_2940 0x7178
/* PCI BIOS */
extern int pcibios_present (void);
......
......@@ -135,7 +135,6 @@
#define upc_bit 0x40
#define volume_bit 0x20
#define toc_bit 0x10
#define multisession_bit 0x08
#define cd_size_bit 0x04
#define subq_bit 0x02
#define frame_size_bit 0x01
......@@ -146,7 +145,6 @@
#define upc_valid (DriveStruct[d].diskstate_flags&upc_bit)
#define volume_valid (DriveStruct[d].diskstate_flags&volume_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 subq_valid (DriveStruct[d].diskstate_flags&subq_bit)
#define frame_size_valid (DriveStruct[d].diskstate_flags&frame_size_bit)
......@@ -197,21 +195,24 @@
/*
* drive types (firmware versions):
*/
#define drv_199 0 /* <200 */
#define drv_200 1 /* <201 */
#define drv_201 2 /* <210 */
#define drv_210 3 /* <211 */
#define drv_211 4 /* <300 */
#define drv_300 5 /* else */
#define drv_099 0x10 /* new, <100 */
#define drv_100 0x11 /* new, >=100 */
#define drv_new 0x10 /* all new drives have that bit set */
#define drv_old 0x00 /* */
#define drv_old 0x10 /* CR-52x family */
#define drv_199 0x11 /* <200 */
#define drv_200 0x12 /* <201 */
#define drv_201 0x13 /* <210 */
#define drv_210 0x14 /* <211 */
#define drv_211 0x15 /* <300 */
#define drv_300 0x16 /* >=300 */
/*
* drv_099 and drv_100 are the "new" drives
*/
#define new_drive (DriveStruct[d].drv_type&0x10)
#define drv_lcs 0x20 /* Longshine family */
#define drv_260 0x21 /* LCS-7260 */
#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:
......@@ -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
Read XA-Data:
read: 03 ll-bb-aa nn-nn 00. (??) read nn-nn blocks of 2340 bytes,
starting at block ll-bb-aa
read: 03 xx-xx-xx nn-nn fl. (??) read nn-nn blocks of 2340 bytes,
starting at block xx-xx-xx
fl=0: "lba"-, =2:"msf-bcd"-coded xx-xx-xx
Read SUB_Q:
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);
#endif CONFIG_SBPCD
#ifdef CONFIG_CDU31A
extern void cdu31a_setup(char *str, int *ints);
#endif CONFIG_SBPCD
#endif CONFIG_CDU31A
void ramdisk_setup(char *str, int *ints);
#ifdef CONFIG_SYSVIPC
......@@ -328,7 +328,7 @@ static void parse_options(char *line)
for (n = 0 ; devnames[n] ; n++) {
int len = strlen(devnames[n]);
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;
}
}
......
......@@ -160,6 +160,7 @@ struct symbol_table symbol_table = { 0, 0, 0, /* for stacked module support */
X(jiffies),
X(xtime),
X(loops_per_sec),
X(need_resched),
X(kill_proc),
X(kill_pg),
X(kill_sl),
......
......@@ -31,7 +31,7 @@
#define SWP_OFFSET(entry) ((entry) >> 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 struct wait_queue * lock_queue = NULL;
......@@ -586,8 +586,7 @@ do { struct mem_list * queue = free_area_list+order; \
unsigned long new_order = order; \
do { struct mem_list *next = queue->next; \
if (queue != next) { \
queue->next = next->next; \
next->next->prev = queue; \
(queue->next = next->next)->prev = queue; \
mark_used((unsigned long) next, new_order); \
nr_free_pages -= 1 << order; \
restore_flags(flags); \
......
......@@ -24,6 +24,8 @@
* Alan Cox : Fixed the ICMP error status of net/host unreachable
* Gerhard Koerting : Fixed broadcast ping properly
* 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
/*
* 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
......@@ -498,7 +500,7 @@ static void icmp_timestamp(struct icmphdr *icmph, struct sk_buff *skb, struct de
* 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++;
kfree_skb(skb, FREE_READ);
}
......@@ -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);
/* 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;
kfree_skb(skb, FREE_READ);
......
......@@ -93,6 +93,7 @@
* fix a race and a signal problem with
* accept() and async I/O.
* Alan Cox : Relaxed the rules on tcp_sendto().
* Yury Shevchuk : Really fixed accept() blocking problem.
*
*
* To Fix:
......@@ -244,7 +245,7 @@ static struct sk_buff *tcp_find_established(struct sock *s)
return NULL;
do
{
if(p->sk->state>=TCP_ESTABLISHED)
if(p->sk->state == TCP_ESTABLISHED || p->sk->state >= TCP_FIN_WAIT1)
return p;
p=p->next;
}
......@@ -1885,7 +1886,7 @@ static void tcp_reset(unsigned long saddr, unsigned long daddr, struct tcphdr *t
t1->psh = 0;
t1->doff = sizeof(*t1)/4;
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++;
}
......@@ -2211,7 +2212,7 @@ static void tcp_conn_request(struct sock *sk, struct sk_buff *skb,
ptr[3] =(newsk->mtu) & 0xff;
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);
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