Commit f7f228f4 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.1.73

parent 66a2c418
VERSION = 1
PATCHLEVEL = 1
SUBLEVEL = 72
SUBLEVEL = 73
ARCH = i386
......
......@@ -122,9 +122,15 @@ isnew: pushl %ecx # restore original EFLAGS
/* get processor type */
movl $1, %eax # Use the CPUID instruction to
.byte 0x0f, 0xa2 # check the processor type
andl $0xf00, %eax # Set _x86 with the family
shrl $8, %eax # returned.
movl %eax, _x86
movb %al, %cl # save reg for future use
andb $0x0f,%ah # mask processor family
movb %ah, _x86
andb $0xf0, %eax # mask model
shrb $4, %al
movb %al, _x86_model
andb $0x0f, %cl # mask mask revision
movb %cl, _x86_mask
movl %edx, _x86_capability
/* get vendor info */
xorl %eax, %eax # call CPUID with 0 -> return vendor ID
.byte 0x0f, 0xa2 # CPUID
......@@ -174,7 +180,7 @@ L6:
* We depend on ET to be correct. This checks for 287/387.
*/
check_x87:
movl $0,_hard_math
movb $0,_hard_math
clts
fninit
fstsw %ax
......@@ -185,7 +191,7 @@ check_x87:
movl %eax,%cr0
ret
.align 2
1: movl $1,_hard_math
1: movb $1,_hard_math
.byte 0xDB,0xE4 /* fsetpm for 287, ignored by 387 */
ret
......
......@@ -19,13 +19,6 @@ bool 'Kernel support for ELF binaries' CONFIG_BINFMT_ELF y
bool 'Use -m486 flag for 486-specific optimizations' CONFIG_M486 y
#fi
comment 'Screen saver mode'
bool 'VESA Power Saving Protocol Support' CONFIG_VESA_PSPM n
if [ "$CONFIG_VESA_PSPM" = "y" ]; then
bool 'VESA PSPM Force Off' CONFIG_PSPM_FORCE_OFF n
fi
if [ "$CONFIG_NET" = "y" ]; then
comment 'Networking options'
bool 'TCP/IP networking' CONFIG_INET y
......@@ -212,6 +205,11 @@ fi
bool 'Microsoft busmouse support' CONFIG_MS_BUSMOUSE n
bool 'ATIXL busmouse support' CONFIG_ATIXL_BUSMOUSE n
bool 'Selection (cut and paste for virtual consoles)' CONFIG_SELECTION n
bool 'VESA Power Saving Protocol Support' CONFIG_VESA_PSPM n
if [ "$CONFIG_VESA_PSPM" = "y" ]; then
bool 'VESA PSPM Force Off' CONFIG_PSPM_FORCE_OFF n
fi
bool 'QIC-02 tape support' CONFIG_QIC02_TAPE n
if [ "$CONFIG_QIC02_TAPE" = "y" ]; then
......@@ -241,6 +239,9 @@ comment 'Kernel hacking'
#bool 'Debug kmalloc/kfree' CONFIG_DEBUG_MALLOC n
bool 'Kernel profiling support' CONFIG_PROFILE n
if [ "$CONFIG_PROFILE" = "y" ]; then
int ' Profile shift count' CONFIG_PROFILE_SHIFT 2
fi
if [ "$CONFIG_SCSI" = "y" ]; then
bool 'Verbose scsi error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS y
fi
......@@ -13,7 +13,7 @@
document those I have come across thus far. Upon bootup the boot
prom loads your a.out image into memory. This memory the prom has
already mapped for you, however as far as I can tell the virtual
adress cache is not turned on although the MMU is translating
address cache is not turned on although the MMU is translating
things. You get loaded at 0xf8004000 exactly. So, when you link
a boot-loadable object you want to do something like:
......@@ -27,7 +27,7 @@
the 'rom vector' in register %o0 right before it jumps to your
starting address. This is a pointer to a struct that is full of
pointer to functions (ie. printf, halt, reboot), pointers to
linked lists (ie. memory mappings), and pointer to imperical
linked lists (ie. memory mappings), and pointer to empirical
constants (ie. stdin and stdout magic cookies + rom version).
Starting with this piece of information you can figure out
just about anything you want about the machine you are on.
......@@ -62,6 +62,10 @@ _cputypval:
.asciz "sun4c"
.ascii " "
/*
* Sun people can't spell worth damn. "compatability" indeed.
* At least we *know* we can't spell, and use a spell-checker.
*/
_cputypvar:
.asciz "compatability"
......@@ -109,7 +113,7 @@ prom_revision: .skip 4 ! PROM revision (ie. 1.4)
prom_bootstr: .skip 4 ! what we are invoked with
prom_putchar: .skip 4 ! void putchar(int ch) BLOCKING.
prom_getchar: .skip 4 ! int getchar(void) BLOCKING.
prom_nputchar: .skip 4 ! int purchar(int ch) non-block
prom_nputchar: .skip 4 ! int putchar(int ch) non-block
prom_ngetchar: .skip 4 ! int getchar(void) non-block
prom_halt: .skip 4 ! void halt(void) solaris friend
prom_eval: .skip 4 ! void eval(int len, char* string)
......@@ -137,7 +141,7 @@ prom_ticks: .skip 4 ! number of ticks since reset
*/
prom_sync: .skip 4 ! hook in prom for "sync" func
prom_v0bootarg: .skip 4 ! v0 prom boot arguements
prom_v0bootarg: .skip 4 ! v0 prom boot arguments
prom_v2bootarg: .skip 4 ! same as above for v2 proms
prom_ethaddr_func: .skip 4 ! extract ethernet device address
prom_v2devfunc: .skip 4 ! ptr to v2 style device ops.
......@@ -244,7 +248,7 @@ whereis_prom_vector_p = _prom_vector_p-KERNBASE
or unimplemented) and 128 software traps (ditto).
One of the instructions must be a branch. More often than not this
will be to a trap handler entry point becuase it is completely
will be to a trap handler entry point because it is completely
impossible to handle any trap in 4 insns. I welcome anyone to
challenge this theory. :-)
......@@ -285,7 +289,7 @@ _msgbufmapped:
*/
.data
.skip 32 ! alignment byte & negative indicies
.skip 32 ! alignment byte & negative indices
lnx_uw: .skip 32 ! u_char uwtab[-31..31];
lnx_winmask: .skip 32 ! u_char wmask[0..31];
......@@ -347,7 +351,7 @@ not_v2:
set _cputypvar, %o1 ! first node has cpu-arch
set _cputypval, %o2 ! information, the string
ld [%g7 + 0x1c], %o4 ! 'compatability' tells
ld [%g7 + 0x1c], %o4 ! 'compatibility' tells
ld [%o4 + 0x0c], %o4 ! that we want 'sun4x' where
call %o4 ! x is one of '', 'c', 'm',
nop ! 'd' or 'e'. %o2 holds pointer
......@@ -476,7 +480,7 @@ _newline: set newline-KERNBASE, %o0
*/
/* Another Note:
The prom printf() function can take up to 5 arguements in registers
The prom printf() function can take up to 5 arguments in registers
%o1 -- %o5 , the format string goes in %o0. It is your usual libc
printf() believe it or not.
*/
......@@ -503,7 +507,7 @@ memloop:
be mv_to_vmprom ! is there more?
nop
ld [%l4 + 0x8], %l6 ! aparently so...
ld [%l4 + 0x8], %l6 ! apparently so...
add %o1, %l6, %o1
b memloop
ld [%l4], %l4
......@@ -524,7 +528,7 @@ memloop2:
cmp %l4, 0
be mv_to_vmprom2 ! is there more?
nop
ld [%l4 + 0x8], %l6 ! aparently so...
ld [%l4 + 0x8], %l6 ! apparently so...
add %o2, %l6, %o2
b memloop2
ld [%l4], %l4
......@@ -545,7 +549,7 @@ memloop3:
cmp %l4, 0
be mv_to_vmprom3 ! is there more?
nop
ld [%l4 + 0x8], %l6 ! aparently so...
ld [%l4 + 0x8], %l6 ! apparently so...
add %o3, %l6, %o3
b memloop3
ld [%l4], %l4
......@@ -668,7 +672,7 @@ no_sun4d_here:
halt_me:
ld [%g7 + 0x74], %o0
call %o0 ! get us out of here...
nop ! aparently solaris is better
nop ! apparently solaris is better
_strlen:
mov %o0, %l1
......
......@@ -16,7 +16,7 @@
.align 4
.globl _strlen
_strlen:
mov %o0, %g3 ! leaf-proceedure optimization, here
mov %o0, %g3 ! leaf-procedure optimization, here
ldsb [%g3], %g2 ! I only use the register sent to me
cmp %g2, 0 ! and the globals. Now, this routine
be 1f ! is callable from boot code.
......@@ -24,16 +24,16 @@ _strlen:
add %o0, 1, %o0
0: ldsb [%o0], %g2
cmp %g2, 0
bne,a 0b ! annuling branch, yuck
bne,a 0b ! annulling branch, yuck
add %o0, 1, %o0
1: retl
sub %o0, %g3, %o0 ! since %g3 holds the origional pointer
sub %o0, %g3, %o0 ! since %g3 holds the original pointer
! and %o0 is at the end byte, we can
! subtract and the result is strlen.
/* String concatenate function. I am too lazy to honor the third count
arguement at this time. Once again, this could be optimized so much
argument at this time. Once again, this could be optimized so much
more to use word accesses instead of slooow byte loads.
*/
.align 4
......@@ -112,4 +112,4 @@ _strcpy: ldub [%o1], %g3
1: retl
mov %g4, %o0
\ No newline at end of file
......@@ -3208,7 +3208,7 @@ void floppy_setup(char *str, int *ints)
return;
}
}
printk("unknown floppy paramter %s\n", str);
printk("unknown floppy parameter %s\n", str);
}
#endif
......
Thu Dec 8 14:52:11 1994 <tytso@rsx-11.mit.edu>
* serial.c (rs_ioctl): Don't allow most ioctl's if the serial port
isn't initialized.
* serial.c (rs_close): Don't clear the IER if the serial port
isn't initialized.
* serial.c (block_til_ready): Don't try to block on the dialin
port if the serial port isn't initialized.
Wed Dec 7 10:48:30 1994 Si Park (si@wimpol.demon.co.uk)
* tty_io.c (tty_register_driver): Fix bug when linking onto
the tty_drivers list. We now test that there are elements
already on the list before setting the back link from the
first element to the new driver.
* tty_io.c (tty_unregister_driver): Fix bug in unlinking the
specified driver from the tty_drivers list. We were not
setting the back link correctly. This used to result in
a dangling back link pointer and cause panics on the next
call to get_tty_driver().
Tue Nov 29 10:21:09 1994 Theodore Y. Ts'o (tytso@rt-11)
* tty_io.c (tty_unregister_driver): Fix bug in
......
......@@ -22,8 +22,8 @@
* 'void console_print(const char * b)'
* 'void update_screen(int new_console)'
*
* 'void blank_screen(void)'
* 'void unblank_screen(void)'
* 'void do_blank_screen(int)'
* 'void do_unblank_screen(void)'
* 'void poke_blanked_console(void)'
* 'void scrollback(int lines)'
* 'void scrollfront(int lines)'
......@@ -117,11 +117,11 @@ static void clear_selection(void);
static void highlight_pointer(const int currcons, const int where);
/* Variables for selection control. */
#define SEL_BUFFER_SIZE 4096
/* Use a dynamic buffer, instead of static (Dec 1994) */
static int sel_cons = 0;
static int sel_start = -1;
static int sel_end;
static char sel_buffer[SEL_BUFFER_SIZE] = { '\0' };
static char *sel_buffer = NULL;
#endif /* CONFIG_SELECTION */
#define NPAR 16
......@@ -132,6 +132,8 @@ static void vc_init(unsigned int console, unsigned long rows, unsigned long cols
static void get_scrmem(int currcons);
static void set_scrmem(int currcons, long offset);
static void set_origin(int currcons);
static void blank_screen(void);
static void unblank_screen(void);
static void gotoxy(int currcons, int new_x, int new_y);
static void save_cur(int currcons);
static inline void set_cursor(int currcons);
......@@ -160,9 +162,7 @@ static unsigned short *vc_scrbuf[MAX_NR_CONSOLES];
static int console_blanked = 0;
static int blankinterval = 10*60*HZ;
#ifndef CONFIG_VESA_PSPM
static long blank_origin, blank__origin, unblank_origin;
#endif
struct vc_data {
unsigned long vc_screenbuf_size;
......@@ -307,16 +307,16 @@ static struct vc {
* Huang shi chao, delivered together with many new monitor models *
* capable of the VESA Power Saving Protocol. *
* Adapted to Linux by Christoph Rimek (chrimek@toppoint.de) 15-may-94 *
* Re-Adapted by Nicholas Leon (nicholas@neko.binary9.com) 10/94 *
* (with minor reorganization/changes) *
* Re-Adapted by Nicholas Leon (nicholas@neko.binary9.com) 10/94 *
* (with minor reorganization/changes) *
*/
static void vesa_blank(void);
static void vesa_unblank(void);
#define seq_port_reg (0x3c4) /* Sequencer register select port */
#define seq_port_val (0x3c5) /* Sequencer register value port */
#define seq_port_reg (0x3c4) /* Sequencer register select port */
#define seq_port_val (0x3c5) /* Sequencer register value port */
#define video_misc_rd (0x3cc) /* Video misc. read port */
#define video_misc_wr (0x3c2) /* Video misc. write port */
......@@ -338,6 +338,8 @@ static struct {
unsigned char ClockingMode; /* Seq-Controller:01h */
} vga;
static int vesa_blanked = 0;
/* routine to blank a vesa screen */
static void vesa_blank(void)
{
......@@ -405,11 +407,15 @@ static void vesa_blank(void)
outb_p(vga.CrtCtrlIndex,video_port_reg);
sti();
vesa_blanked = 1;
}
/* routine to unblank a vesa screen */
static void vesa_unblank(void)
{
if (!vesa_blanked)
return;
/* restore original values of VGA controller registers */
cli();
outb_p(vga.CrtMiscIO,video_misc_wr);
......@@ -438,6 +444,8 @@ static void vesa_unblank(void)
outb_p(vga.SeqCtrlIndex,seq_port_reg);
outb_p(vga.CrtCtrlIndex,video_port_reg);
sti();
vesa_blanked = 0;
}
#endif /* CONFIG_VESA_PSPM */
......@@ -1426,7 +1434,7 @@ static void reset_terminal(int currcons, int do_clear)
utf = 0;
utf_count = 0;
disp_ctrl = 0;
disp_ctrl = 1;
toggle_meta = 0;
decscnm = 0;
......@@ -1925,9 +1933,11 @@ void console_print(const char * b)
{
int currcons = fg_console;
unsigned char c;
static int printing = 0;
if (!printable)
if (!printable || printing)
return; /* console not yet initialized */
printing = 1;
if (!vc_cons_allocated(currcons)) {
/* impossible */
......@@ -1952,16 +1962,8 @@ void console_print(const char * b)
pos+=2;
}
set_cursor(currcons);
if (vt_cons[fg_console]->vc_mode == KD_GRAPHICS)
return;
timer_active &= ~(1<<BLANK_TIMER);
if (console_blanked) {
timer_table[BLANK_TIMER].expires = 0;
timer_active |= 1<<BLANK_TIMER;
} else if (blankinterval) {
timer_table[BLANK_TIMER].expires = jiffies + blankinterval;
timer_active |= 1<<BLANK_TIMER;
}
poke_blanked_console();
printing = 0;
}
/*
......@@ -2185,24 +2187,16 @@ static void set_scrmem(int currcons, long offset)
pos = origin + y*video_size_row + (x<<1);
}
void blank_screen(void)
void do_blank_screen(int nopowersave)
{
#ifndef CONFIG_VESA_PSPM
int currcons;
#endif
if (console_blanked)
return;
if (!vc_cons_allocated(fg_console)) {
/* impossible */
printk("blank_screen: tty %d not allocated ??\n", fg_console+1);
return;
}
timer_active &= ~(1<<BLANK_TIMER);
timer_table[BLANK_TIMER].fn = unblank_screen;
#ifdef CONFIG_VESA_PSPM
vesa_blank();
#else
/* try not to lose information by blanking, and not to waste memory */
currcons = fg_console;
has_scrolled = 0;
......@@ -2213,17 +2207,19 @@ void blank_screen(void)
unblank_origin = origin;
memsetw((void *)blank_origin, BLANK, video_mem_term-blank_origin);
hide_cursor();
#endif
console_blanked = fg_console + 1;
#ifdef CONFIG_VESA_PSPM
if(!nopowersave)
vesa_blank();
#endif
}
void unblank_screen(void)
void do_unblank_screen(void)
{
int currcons;
#ifndef CONFIG_VESA_PSPM
int resetorg;
long offset;
#endif
if (!console_blanked)
return;
......@@ -2237,11 +2233,8 @@ void unblank_screen(void)
timer_table[BLANK_TIMER].expires = jiffies + blankinterval;
timer_active |= 1<<BLANK_TIMER;
}
currcons = fg_console;
#ifdef CONFIG_VESA_PSPM
vesa_unblank();
console_blanked=0;
#else
offset = 0;
resetorg = 0;
if (console_blanked == fg_console + 1 && origin == unblank_origin
......@@ -2258,9 +2251,25 @@ void unblank_screen(void)
set_cursor(fg_console);
if (resetorg)
__set_origin(blank__origin);
#ifdef CONFIG_VESA_PSPM
vesa_unblank();
#endif
}
/*
* If a blank_screen is due to a timer, then a power save is allowed.
* If it is related to console_switching, then avoid vesa_blank().
*/
static void blank_screen(void)
{
do_blank_screen(0);
}
static void unblank_screen(void)
{
do_unblank_screen();
}
void update_screen(int new_console)
{
static int lock = 0;
......@@ -2323,6 +2332,9 @@ int do_screendump(int arg, int mode)
put_fs_byte((char)(video_num_lines),buf++);
put_fs_byte((char)(video_num_columns),buf++);
}
#ifdef CONFIG_SELECTION
clear_selection();
#endif
switch(mode) {
case 0:
sptr = (char *) origin;
......@@ -2330,9 +2342,6 @@ int do_screendump(int arg, int mode)
put_fs_byte(*sptr++,buf++);
break;
case 1:
#ifdef CONFIG_SELECTION
clear_selection();
#endif
put_fs_byte((char)x,buf++); put_fs_byte((char)y,buf++);
memcpy_tofs(buf,(char *)origin,2*chcount);
break;
......@@ -2379,12 +2388,7 @@ static void highlight(const int currcons, const int s, const int e)
p1 = (unsigned char *)origin - hwscroll_offset + s + 1;
p2 = (unsigned char *)origin - hwscroll_offset + e + 1;
if (p1 > p2)
{
p = p1;
p1 = p2;
p2 = p;
}
for (p = p1; p <= p2; p += 2)
*p = (*p & 0x88) | ((*p << 4) & 0x70) | ((*p >> 4) & 0x07);
}
......@@ -2415,6 +2419,7 @@ static void highlight_pointer(const int currcons, const int where)
/*
* This function uses a 128-bit look up table
* WARNING: This depends on both endianness and the ascii code
*/
static unsigned long inwordLut[4]={
0x00000000, /* control chars */
......@@ -2439,10 +2444,10 @@ static inline int atedge(const int p)
return (!(p % video_size_row) || !((p + 2) % video_size_row));
}
/* constrain v such that l <= v <= u */
static inline short limit(const int v, const int l, const int u)
/* constrain v such that v <= u */
static inline short limit(const unsigned short v, const unsigned short u)
{
return (v < l) ? l : ((v > u) ? u : v);
return ((v > u) ? u : v);
}
/* invoked via ioctl(TIOCLINUX) */
......@@ -2471,10 +2476,10 @@ int set_selection(const int arg, struct tty_struct *tty)
ye = get_fs_word(args++) - 1;
sel_mode = get_fs_word(args);
xs = limit(xs, 0, video_num_columns - 1);
ys = limit(ys, 0, video_num_lines - 1);
xe = limit(xe, 0, video_num_columns - 1);
ye = limit(ye, 0, video_num_lines - 1);
xs = limit(xs, video_num_columns - 1);
ys = limit(ys, video_num_lines - 1);
xe = limit(xe, video_num_columns - 1);
ye = limit(ye, video_num_lines - 1);
ps = ys * video_size_row + (xs << 1);
pe = ye * video_size_row + (xe << 1);
......@@ -2578,6 +2583,16 @@ int set_selection(const int arg, struct tty_struct *tty)
}
sel_start = new_sel_start;
sel_end = new_sel_end;
/* realloc the buffer (it seems to be efficient, anyway) */
if (sel_buffer) kfree(sel_buffer);
sel_buffer = kmalloc((sel_end-sel_start)/2+2, GFP_KERNEL);
if (!sel_buffer)
{
printk("selection: kmalloc() failed\n");
clear_selection();
return (0); /* is it right? */
}
obp = bp = sel_buffer;
for (i = sel_start; i <= sel_end; i += 2)
{
......@@ -2596,10 +2611,6 @@ int set_selection(const int arg, struct tty_struct *tty)
}
obp = bp;
}
/* check for space, leaving room for next character, possible
newline, and null at end. */
if (bp - sel_buffer > SEL_BUFFER_SIZE - 3)
break;
}
*bp = '\0';
return 0;
......@@ -2614,7 +2625,7 @@ int paste_selection(struct tty_struct *tty)
int c, l;
struct vt_struct *vt = (struct vt_struct *) tty->driver_data;
if (!sel_buffer[0])
if (!bp || !bp[0])
return 0;
unblank_screen();
c = strlen(sel_buffer);
......
......@@ -1666,6 +1666,13 @@ static int rs_ioctl(struct tty_struct *tty, struct file * file,
if (serial_paranoia_check(info, tty->device, "rs_ioctl"))
return -ENODEV;
if ((cmd != TIOCGSERIAL) && (cmd != TIOCSSERIAL) &&
(cmd != TIOCSERCONFIG) && (cmd != TIOCSERGWILD) &&
(cmd != TIOCSERSWILD) && (cmd != TIOCSERGSTRUCT)) {
if (tty->flags & (1 << TTY_IO_ERROR))
return -EIO;
}
switch (cmd) {
case TCSBRK: /* SVID version: non-zero arg --> no break */
......@@ -1852,9 +1859,9 @@ static void rs_close(struct tty_struct *tty, struct file * filp)
* line status register.
*/
info->IER &= ~UART_IER_RLSI;
serial_out(info, UART_IER, info->IER);
info->read_status_mask &= ~UART_LSR_DR;
if (info->flags & ASYNC_INITIALIZED) {
serial_out(info, UART_IER, info->IER);
wait_until_sent(tty, 3000); /* 30 seconds timeout */
/*
* Before we drop DTR, make sure the UART transmitter
......@@ -1965,10 +1972,11 @@ static int block_til_ready(struct tty_struct *tty, struct file * filp,
}
/*
* If non-blocking mode is set, then make the check up front
* and then exit.
* If non-blocking mode is set, or the port is not enabled,
* then make the check up front and then exit.
*/
if (filp->f_flags & O_NONBLOCK) {
if ((filp->f_flags & O_NONBLOCK) ||
(tty->flags & (1 << TTY_IO_ERROR))) {
if (info->flags & ASYNC_CALLOUT_ACTIVE)
return -EBUSY;
info->flags |= ASYNC_NORMAL_ACTIVE;
......
......@@ -73,6 +73,8 @@ extern int mouse_reporting(void);
extern int shift_state;
#endif /* CONFIG_SELECTION */
extern int do_screendump(int arg, int mode);
extern void do_blank_screen(int nopowersave);
extern void do_unblank_screen(void);
struct termios tty_std_termios; /* for the benefit of tty drivers */
struct tty_driver *tty_drivers = NULL; /* linked list of tty drivers */
......@@ -513,11 +515,9 @@ void complete_change_console(unsigned int new_console)
if (old_vc_mode != vt_cons[new_console]->vc_mode)
{
if (vt_cons[new_console]->vc_mode == KD_TEXT)
unblank_screen();
else {
timer_active &= ~(1<<BLANK_TIMER);
blank_screen();
}
do_unblank_screen();
else
do_blank_screen(1);
}
/*
......@@ -1414,7 +1414,7 @@ static int tty_ioctl(struct inode * inode, struct file * file,
return paste_selection(tty);
#endif /* CONFIG_SELECTION */
case 4:
unblank_screen();
do_unblank_screen();
return 0;
#ifdef CONFIG_SELECTION
case 5:
......@@ -1596,7 +1596,7 @@ int tty_register_driver(struct tty_driver *driver)
driver->prev = 0;
driver->next = tty_drivers;
tty_drivers->prev = driver;
if (tty_drivers) tty_drivers->prev = driver;
tty_drivers = driver;
return error;
}
......@@ -1633,7 +1633,7 @@ int tty_unregister_driver(struct tty_driver *driver)
tty_drivers = driver->next;
if (driver->next)
driver->next = driver->next->prev;
driver->next->prev = driver->prev;
return 0;
}
......
......@@ -52,6 +52,8 @@ extern void compute_shiftstate(void);
extern void change_console(unsigned int new_console);
extern void complete_change_console(unsigned int new_console);
extern int vt_waitactive(void);
extern void do_blank_screen(int nopowersave);
extern void do_unblank_screen(void);
extern unsigned int keymap_count;
......@@ -208,11 +210,9 @@ int vt_ioctl(struct tty_struct *tty, struct file * file,
* explicitly blank/unblank the screen if switching modes
*/
if (arg == KD_TEXT)
unblank_screen();
else {
timer_active &= ~(1<<BLANK_TIMER);
blank_screen();
}
do_unblank_screen();
else
do_blank_screen(1);
return 0;
case KDGETMODE:
......
......@@ -6,4 +6,6 @@ MODULES = \
apricot.o \
eexpress.o \
plip.o \
8390.o
8390.o \
slip.o \
slhc.o
......@@ -307,7 +307,7 @@ init_i596_mem(struct device *dev)
while (lp->scb.status, lp->scb.command)
if (--boguscnt == 0)
{
printk("%s: recieve unit start timed out with status %4.4x, cmd %4.4x.\n",
printk("%s: receive unit start timed out with status %4.4x, cmd %4.4x.\n",
dev->name, lp->scb.status, lp->scb.command);
break;
}
......@@ -1016,7 +1016,7 @@ struct netdev_entry apricot_drv =
#ifdef MODULE
char kernel_version[] = UTS_RELEASE;
static struct device dev_apricot = {
" ", /* device name inservted by /linux/drivers/net/net_init.c */
" ", /* device name inserted by /linux/drivers/net/net_init.c */
0, 0, 0, 0,
0x300, 10,
0, 0, 0, NULL, apricot_probe };
......
......@@ -17,6 +17,7 @@
DEPCA (the original)
DE100
DE101
DE200 Turbo
DE201 Turbo
DE202 Turbo (TP BNC)
......@@ -147,26 +148,28 @@
Version Date Description
0.1 25-jan-94 Initial writing.
0.2 27-jan-94 Added LANCE TX hardware buffer chaining.
0.3 1-feb-94 Added multiple DEPCA support.
0.31 4-feb-94 Added DE202 recognition.
0.32 19-feb-94 Tidy up. Improve multi-DEPCA support.
0.33 25-feb-94 Fix DEPCA ethernet ROM counter enable.
0.1 25-jan-94 Initial writing.
0.2 27-jan-94 Added LANCE TX hardware buffer chaining.
0.3 1-feb-94 Added multiple DEPCA support.
0.31 4-feb-94 Added DE202 recognition.
0.32 19-feb-94 Tidy up. Improve multi-DEPCA support.
0.33 25-feb-94 Fix DEPCA ethernet ROM counter enable.
Add jabber packet fix from murf@perftech.com
and becker@super.org
0.34 7-mar-94 Fix DEPCA max network memory RAM & NICSR access.
0.35 8-mar-94 Added DE201 recognition. Tidied up.
0.351 30-apr-94 Added EISA support. Added DE422 recognition.
0.36 16-may-94 DE422 fix released.
0.37 22-jul-94 Added MODULE support
0.38 15-aug-94 Added DBR ROM switch in depca_close().
0.34 7-mar-94 Fix DEPCA max network memory RAM & NICSR access.
0.35 8-mar-94 Added DE201 recognition. Tidied up.
0.351 30-apr-94 Added EISA support. Added DE422 recognition.
0.36 16-may-94 DE422 fix released.
0.37 22-jul-94 Added MODULE support
0.38 15-aug-94 Added DBR ROM switch in depca_close().
Multi DEPCA bug fix.
0.38axp 15-sep-94 Special version for Alpha AXP Linux V1.0
0.381 12-dec-94 Added DE101 recognition, fix multicast bug
=========================================================================
*/
static char *version = "depca.c:v0.38 8/15/94 davies@wanton.lkg.dec.com\n";
static char *version = "depca.c:v0.381 12/12/94 davies@wanton.lkg.dec.com\n";
#include <stdarg.h>
#include <linux/config.h>
......@@ -208,8 +211,10 @@ static int depca_debug = 1;
#endif
#ifndef DEPCA_SIGNATURE
#define DEPCA_SIGNATURE {"DEPCA","DE100",\
"DE200","DE201","DE202","DE210",\
#define DEPCA_SIGNATURE {"DEPCA",\
"DE100","DE101",\
"DE200","DE201","DE202",\
"DE210",\
"DE422",\
""}
#define DEPCA_NAME_LENGTH 8
......@@ -1237,35 +1242,28 @@ depca_get_stats(struct device *dev)
** num_addrs > 0 Multicast mode, receive normal and MC packets, and do
** best-effort filtering.
*/
#define hash_filter lp->init_block.filter
static void
set_multicast_list(struct device *dev, int num_addrs, void *addrs)
{
short ioaddr = dev->base_addr;
struct depca_private *lp = (struct depca_private *)dev->priv;
/* We take the simple way out and always enable promiscuous mode. */
STOP_DEPCA; /* Temporarily stop the depca. */
lp->init_block.mode = PROM; /* Set promiscuous mode */
if (num_addrs >= 0) {
short multicast_table[4];
int i;
SetMulticastFilter(num_addrs, (char *)addrs, (char *)multicast_table);
if (irq2dev_map[dev->irq] != NULL) {
STOP_DEPCA; /* Temporarily stop the depca. */
depca_init_ring(dev); /* Initialize the descriptor rings */
/* We don't use the multicast table, but rely on upper-layer filtering. */
memset(multicast_table, (num_addrs==0) ? 0 : -1, sizeof(multicast_table));
for (i = 0; i < 4; i++) {
lp->init_block.filter[i] = multicast_table[i];
if (num_addrs >= 0) {
SetMulticastFilter(num_addrs, (char *)addrs, (char *)hash_filter);
lp->init_block.mode &= ~PROM; /* Unset promiscuous mode */
} else {
lp->init_block.mode |= PROM; /* Set promiscuous mode */
}
lp->init_block.mode &= ~PROM; /* Unset promiscuous mode */
} else {
lp->init_block.mode |= PROM; /* Set promiscuous mode */
}
outw(CSR0, DEPCA_ADDR);
outw(IDON|INEA|STRT, DEPCA_DATA); /* Resume normal operation. */
LoadCSRs(dev); /* Reload CSR3 */
InitRestartDepca(dev); /* Resume normal operation. */
}
}
/*
......
......@@ -118,11 +118,12 @@
0.23 21-sep-94 Added transmit cut through
0.24 31-oct-94 Added uid checks in some ioctls
0.30 1-nov-94 BETA code release
0.31 5-dec-94 Added check/snarf_region code.
=========================================================================
*/
static char *version = "ewrk3.c:v0.30 11/1/94 davies@wanton.lkg.dec.com\n";
static char *version = "ewrk3.c:v0.31 12/5/94 davies@wanton.lkg.dec.com\n";
#include <stdarg.h>
#include <linux/config.h>
......@@ -314,7 +315,7 @@ static struct device *isa_probe(struct device *dev);
static struct device *eisa_probe(struct device *dev);
static struct device *alloc_device(struct device *dev, int iobase);
static int num_ewrk3s = 0, num_eth = 0, autoprobed = 0;
static int num_ewrk3s = 0, num_eth = 0;
static unsigned char irq[] = {5,0,10,3,11,9,15,12};
#else
......@@ -323,6 +324,8 @@ void cleanup_module(void);
#endif /* MODULE */
static int autoprobed = 0;
/*
** Miscellaneous defines...
*/
......@@ -344,14 +347,23 @@ int ewrk3_probe(struct device *dev)
#endif
if (base_addr > 0x0ff) { /* Check a single specified location. */
if (((mem_chkd >> ((base_addr - EWRK3_IO_BASE)/ EWRK3_IOP_INC))&0x01)==0) {
if (DevicePresent(base_addr) == 0) { /* Is EWRK3 really here? */
status = ewrk3_hw_init(dev, base_addr);
if (!autoprobed) { /* Module or fixed location */
if (!check_region(base_addr, EWRK3_IOP_INC)) {
if (((mem_chkd >> ((base_addr - EWRK3_IO_BASE)/ EWRK3_IOP_INC))&0x01)==1) {
if (DevicePresent(base_addr) == 0) { /* Is EWRK3 really here? */
snarf_region(base_addr, EWRK3_IOP_INC); /* Register I/O region */
status = ewrk3_hw_init(dev, base_addr);
} else {
printk("ewrk3_probe(): No device found\n");
mem_chkd &= ~(0x01 << ((base_addr - EWRK3_IO_BASE)/EWRK3_IOP_INC));
}
}
} else {
printk("ewrk3_probe(): No device found\n");
printk("%s: ewrk3_probe(): Detected a device already registered at 0x%02x\n", dev->name, base_addr);
mem_chkd &= ~(0x01 << ((base_addr - EWRK3_IO_BASE)/EWRK3_IOP_INC));
}
} else {
status = ewrk3_hw_init(dev, base_addr); /* Yes there is h/w */
} else { /* already know what ewrk3 h/w is here */
status = ewrk3_hw_init(dev, base_addr);
}
} else if (base_addr > 0) { /* Don't probe at all. */
status = -ENXIO;
......@@ -1282,12 +1294,13 @@ static void SetMulticastFilter(struct device *dev, int num_addrs, char *addrs, c
}
}
}
hashcode = (crc & 0x01); /* hashcode is 9 LSb of CRC ... */
hashcode = ((crc >>= 23) & 0x01); /* hashcode is 9 MSb of CRC ... */
for (j=0;j<8;j++) { /* ... in reverse order. */
hashcode <<= 1;
crc >>= 1;
hashcode |= (crc & 0x01);
}
octet = hashcode >> 3; /* bit[3-8] -> octet in filter */
/* bit[0-2] -> bit in octet */
if (lp->shmem_length == IO_ONLY) {
......@@ -1323,20 +1336,27 @@ static struct device *isa_probe(struct device *dev)
i < 24;
iobase += EWRK3_IOP_INC, i++) {
if (tmp & 0x01) {
if (DevicePresent(iobase) == 0) {
/* Anything else registered here? */
if (!check_region(iobase, EWRK3_IOP_INC)) {
if (DevicePresent(iobase) == 0) {
/*
** Device found. Mark its (I/O) location for future reference. Only 24
** EtherWORKS devices can exist between 0x100 and 0x3e0.
*/
if (num_ewrk3s > 0) { /* only gets here in autoprobe */
dev = alloc_device(dev, iobase);
} else {
if ((status = ewrk3_hw_init(dev, iobase)) == 0) {
num_ewrk3s++;
snarf_region(iobase, EWRK3_IOP_INC);
if (num_ewrk3s > 0) { /* only gets here in autoprobe */
dev = alloc_device(dev, iobase);
} else {
if ((status = ewrk3_hw_init(dev, iobase)) == 0) {
num_ewrk3s++;
}
}
num_eth++;
} else {
mem_chkd &= ~(0x01 << ((iobase - EWRK3_IO_BASE)/EWRK3_IOP_INC));
}
num_eth++;
} else {
printk("%s: ewrk3_probe(): Detected a device already registered at 0x%02x\n", dev->name, iobase);
mem_chkd &= ~(0x01 << ((iobase - EWRK3_IO_BASE)/EWRK3_IOP_INC));
}
}
......@@ -1358,20 +1378,24 @@ static struct device *eisa_probe(struct device *dev)
iobase+=EISA_SLOT_INC; /* get the first slot address */
for (status = -ENODEV, i=1; i<MAX_EISA_SLOTS; i++, iobase+=EISA_SLOT_INC) {
if (DevicePresent(iobase) == 0) {
/* Anything else registered here? */
if (!check_region(iobase, EWRK3_IOP_INC)) {
if (DevicePresent(iobase) == 0) {
/*
** Device found. Mark its slot location for future reference. Only 7
** EtherWORKS devices can exist in EISA space....
*/
mem_chkd |= (0x01 << (i + 24));
if (num_ewrk3s > 0) { /* only gets here in autoprobe */
dev = alloc_device(dev, iobase);
} else {
if ((status = ewrk3_hw_init(dev, iobase)) == 0) {
num_ewrk3s++;
mem_chkd |= (0x01 << (i + 24));
snarf_region(iobase, EWRK3_IOP_INC);
if (num_ewrk3s > 0) { /* only gets here in autoprobe */
dev = alloc_device(dev, iobase);
} else {
if ((status = ewrk3_hw_init(dev, iobase)) == 0) {
num_ewrk3s++;
}
}
num_eth++;
}
num_eth++;
}
}
return dev;
......
......@@ -38,6 +38,8 @@
* status display
* - Jul 1994 Dmitry Gorodchanin
* Fixes for memory leaks.
* - Oct 1994 Dmitry Gorodchanin
* Modularization.
*
*
* This module is a difficult issue. Its clearly inet code but its also clearly
......@@ -71,6 +73,11 @@
#include <linux/mm.h>
#include "slhc.h"
#ifdef MODULE
#include <linux/module.h>
#include <linux/version.h>
#endif
int last_retran;
static unsigned char *encode(unsigned char *cp, unsigned short n);
......@@ -91,7 +98,7 @@ slhc_init(int rslots, int tslots)
register struct cstate *ts;
struct slcompress *comp;
comp = (struct slcompress *)kmalloc(sizeof(struct slcompress),
comp = (struct slcompress *)kmalloc(sizeof(struct slcompress),
GFP_KERNEL);
if (! comp)
return NULL;
......@@ -112,7 +119,7 @@ slhc_init(int rslots, int tslots)
}
if ( tslots > 0 && tslots < 256 ) {
comp->tstate =
comp->tstate =
(struct cstate *)kmalloc(tslots * sizeof(struct cstate),
GFP_KERNEL);
if (! comp->tstate)
......@@ -145,6 +152,9 @@ slhc_init(int rslots, int tslots)
ts[0].next = &(ts[comp->tslot_limit]);
ts[0].cs_this = 0;
}
#ifdef MODULE
MOD_INC_USE_COUNT;
#endif
return comp;
}
......@@ -162,6 +172,9 @@ slhc_free(struct slcompress *comp)
if ( comp->tstate != NULLSLSTATE )
kfree( comp->tstate );
#ifdef MODULE
MOD_DEC_USE_COUNT;
#endif
kfree( comp );
}
......@@ -216,7 +229,7 @@ decode(unsigned char **cpp)
}
}
/*
/*
* icp and isize are the original packet.
* ocp is a place to put a copy if necessary.
* cpp is initially a pointer to icp. If the copy is used,
......@@ -241,7 +254,7 @@ slhc_compress(struct slcompress *comp, unsigned char *icp, int isize,
ip = (struct iphdr *) icp;
/* Bail if this packet isn't TCP, or is an IP fragment */
if(ip->protocol != IPPROTO_TCP || (ntohs(ip->frag_off) & 0x1fff) ||
if(ip->protocol != IPPROTO_TCP || (ntohs(ip->frag_off) & 0x1fff) ||
(ip->frag_off & 32)){
/* Send as regular IP */
if(ip->protocol != IPPROTO_TCP)
......@@ -310,7 +323,7 @@ slhc_compress(struct slcompress *comp, unsigned char *icp, int isize,
* Found it -- move to the front on the connection list.
*/
if(lcs == ocs) {
/* found at most recently used */
/* found at most recently used */
} else if (cs == ocs) {
/* found at least recently used */
comp->xmit_oldest = lcs->cs_this;
......@@ -345,7 +358,7 @@ slhc_compress(struct slcompress *comp, unsigned char *icp, int isize,
|| (th->doff > 5 && memcmp(th+1,cs->cs_tcpopt,((th->doff)-5)*4 != 0))){
goto uncompressed;
}
/*
* Figure out which of the changing fields changed. The
* receiver expects changes in the order: urgent, window,
......@@ -379,7 +392,7 @@ slhc_compress(struct slcompress *comp, unsigned char *icp, int isize,
cp = encode(cp,deltaS);
changes |= NEW_S;
}
switch(changes){
case 0: /* Nothing changed. If this packet contains data and the
* last one didn't, this is probably a data packet following
......@@ -388,7 +401,7 @@ slhc_compress(struct slcompress *comp, unsigned char *icp, int isize,
* retransmitted ack or window probe. Send it uncompressed
* in case the other side missed the compressed version.
*/
if(ip->tot_len != cs->cs_ip.tot_len &&
if(ip->tot_len != cs->cs_ip.tot_len &&
ntohs(cs->cs_ip.tot_len) == hlen)
break;
goto uncompressed;
......@@ -522,7 +535,7 @@ slhc_uncompress(struct slcompress *comp, unsigned char *icp, int isize)
thp->check = htons(x);
thp->psh = (changes & TCP_PUSH_BIT) ? 1 : 0;
/*
/*
* we can use the same number for the length of the saved header and
* the current one, because the packet wouldn't have been sent
* as compressed unless the options were the same as the previous one
......@@ -557,7 +570,7 @@ slhc_uncompress(struct slcompress *comp, unsigned char *icp, int isize)
if(changes & NEW_W){
if((x = decode(&cp)) == -1) {
goto bad;
}
}
thp->window = htons( ntohs(thp->window) + x);
}
if(changes & NEW_A){
......@@ -715,4 +728,21 @@ void slhc_o_status(struct slcompress *comp)
}
}
#ifdef MODULE
char kernel_version[] = UTS_RELEASE;
int init_module(void)
{
printk("CSLIP: code copyright 1989 Regents of the University of California\n");
return 0;
}
void cleanup_module(void)
{
if (MOD_IN_USE) {
printk("CSLIP: module in use, remove delayed");
}
return;
}
#endif /* MODULE */
#endif /* CONFIG_INET */
This diff is collapsed.
......@@ -10,6 +10,7 @@
* Alan Cox : Added slip mtu field.
* Matt Dillon : Printable slip (borrowed from net2e)
* Alan Cox : Added SL_SLIP_LOTS
* Dmitry Gorodchanin : A lot of changes in the 'struct slip'
*
* Author: Fred N. van Kempen, <waltje@uwalt.nl.mugnet.org>
*/
......@@ -33,44 +34,44 @@
struct slip {
int magic;
/* Bitmapped flag fields. */
char inuse; /* are we allocated? */
char sending; /* "channel busy" indicator */
char escape; /* SLIP state machine */
char unused; /* fillers */
/* Various fields. */
int line; /* SLIP channel number */
struct tty_struct *tty; /* ptr to TTY structure */
struct device *dev; /* easy for intr handling */
#if defined(CONFIG_INET)
struct slcompress *slcomp; /* for header compression */
unsigned char *cbuff; /* compression buffer */
#endif
/* These are pointers to the malloc()ed frame buffers. */
unsigned char *rbuff; /* receiver buffer */
int rcount; /* received chars counter */
unsigned char *xbuff; /* transmitter buffer */
unsigned char *cbuff; /* compression buffer */
/* These are the various pointers into the buffers. */
unsigned char *rhead; /* RECV buffer pointer (head) */
unsigned char *rend; /* RECV buffer pointer (end) */
int rcount; /* SLIP receive counter */
unsigned char *xhead; /* XMIT buffer pointer (head) */
unsigned char *xtail; /* XMIT buffer pointer (tail) */
unsigned char *xhead; /* pointer to next byte to XMIT */
int xleft; /* bytes left in XMIT queue */
/* SLIP interface statistics. */
unsigned long rpacket; /* inbound frame counter */
unsigned long roverrun; /* "buffer overrun" counter */
unsigned long spacket; /* outbound frames counter */
unsigned long sbusy; /* "transmitter busy" counter */
unsigned long errors; /* error count */
unsigned long rx_packets; /* inbound frames counter */
unsigned long tx_packets; /* outbound frames counter */
unsigned long rx_errors; /* Parity, etc. errors */
unsigned long tx_errors; /* Palnned stuff */
unsigned long rx_dropped; /* No memory for skb */
unsigned long tx_dropped; /* When MTU change */
unsigned long rx_over_errors; /* Frame bigger then SLIP buf. */
/* Detailed SLIP statistics. */
int mtu; /* Our mtu (to spot changes!) */
int buffsize; /* Max buffers sizes */
#ifdef CONFIG_SLIP_MODE_SLIP6
int xdata, xbits; /* 6 bit slip controls */
#endif
unsigned char flags; /* Flag values/ mode etc */
#define SLF_ESCAPE 2
#define SLF_ERROR 4
#define SLF_COMP 16
#define SLF_EXPN 32
#define SLF_XMIT_BUSY 64
#define SLF_INUSE 0 /* Channel in use */
#define SLF_ESCAPE 1 /* ESC received */
#define SLF_ERROR 2 /* Parity, etc. error */
unsigned char mode; /* SLIP mode */
#define SL_MODE_SLIP 0
#define SL_MODE_CSLIP 1
......@@ -78,15 +79,25 @@ struct slip {
#define SL_MODE_CSLIP6 (SL_MODE_SLIP6|SL_MODE_CSLIP)
#define SL_MODE_AX25 4
#define SL_MODE_ADAPTIVE 8
int xdata,xbits; /* 6 bit slip controls */
};
#ifdef CONFIG_INET
#ifdef CONFIG_SLIP_ADAPTIVE
#define SL_MODE_DEFAULT SL_MODE_ADAPTIVE
#else /* !CONFIG_SLIP_ADAPTIVE */
#ifdef CONFIG_SLIP_COMPRESSED
#define SL_MODE_DEFAULT (SL_MODE_CSLIP | SL_MODE_ADAPTIVE)
#else /* !CONFIG_SLIP_COMPRESSED */
#define SL_MODE_DEFAULT SL_MODE_SLIP
#endif /* CONFIG_SLIP_COMPRESSED */
#endif /* CONFIG_SLIP_ADAPTIVE */
#else /* !CONFIG_INET */
#define SL_MODE_DEFAULT SL_MODE_SLIP
#endif /* CONFIG_INET */
#define SLIP_MAGIC 0x5302
extern int slip_init(struct device *dev);
extern int slip_esc(unsigned char *s, unsigned char *d, int len);
extern int slip_esc6(unsigned char *s, unsigned char *d, int len);
extern void slip_unesc(struct slip *sl, unsigned char s);
extern void slip_unesc6(struct slip *sl, unsigned char s);
extern int slip_init(struct device *dev);
#endif /* _LINUX_SLIP.H */
......@@ -17,7 +17,7 @@
*/
static char *version =
"smc-ultra.c:v1.10 9/23/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
"smc-ultra.c:v1.11 11/21/94 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
#include <linux/config.h>
#include <linux/kernel.h>
......@@ -226,16 +226,21 @@ ultra_block_input(struct device *dev, int count, char *buf, int ring_offset)
void *xfer_start = (void *)(dev->mem_start + ring_offset
- (START_PG<<8));
/* Enable shared memory. */
outb(ULTRA_MEMENB, dev->base_addr - ULTRA_NIC_OFFSET);
if (xfer_start + count > (void*) dev->rmem_end) {
/* We must wrap the input move. */
int semi_count = (void*)dev->rmem_end - xfer_start;
memcpy(buf, xfer_start, semi_count);
count -= semi_count;
memcpy(buf + semi_count, (char *)dev->rmem_start, count);
outb(0x00, dev->base_addr - ULTRA_NIC_OFFSET); /* Disable memory. */
return dev->rmem_start + count;
}
memcpy(buf, xfer_start, count);
outb(0x00, dev->base_addr - ULTRA_NIC_OFFSET); /* Disable memory. */
return ring_offset + count;
}
......@@ -246,8 +251,12 @@ ultra_block_output(struct device *dev, int count, const unsigned char *buf,
unsigned char *shmem
= (unsigned char *)dev->mem_start + ((start_page - START_PG)<<8);
/* Enable shared memory. */
outb(ULTRA_MEMENB, dev->base_addr - ULTRA_NIC_OFFSET);
memcpy(shmem, buf, count);
outb(0x00, dev->base_addr - ULTRA_NIC_OFFSET); /* Disable memory. */
}
static int
......
Tue Dec 6 12:34:20 1994 Eric Youngdale (eric@andante)
* Linux 1.1.72 released.
* sg.c: Bugfix - always use sg_free, since we might have big buff.
Fri Dec 2 11:24:53 1994 Eric Youngdale (eric@andante)
* Linux 1.1.71 released.
* sg.c: Clear buff field when not in use. Only call scsi_free if
non-null.
* scsi.h: Call wake_up(&wait_for_request) when done with a
command.
* scsi.c (scsi_times_out): Pass pid down so that we can protect
against race conditions.
* scsi.c (scsi_abort): Zero timeout field if we get the
NOT_RUNNING message back from low-level driver.
* scsi.c (scsi_done): Restore cmd_len, use_sg here.
* scsi.c (request_sense): Not here.
* hosts.h: Add new forbidden_addr, forbidden_size fields. Who
added these and why????
* hosts.c (scsi_mem_init): Mark pages as reserved if they fall in
the forbidden regions. I am not sure - I think this is so that
we can deal with boards that do incomplete decoding of their
address lines for the bios chips, but I am not entirely sure.
* buslogic.c: Set forbidden_addr stuff if using a buggy board.
* aha1740.c: Test for NULL pointer in SCtmp. This should not
occur, but a nice message is better than a kernel segfault.
* 53c7,8xx.c: Add new PCI chip ID for 815.
Fri Dec 2 11:24:53 1994 Eric Youngdale (eric@andante)
* Linux 1.1.70 released.
* ChangeLog, st.c: Spelling.
Tue Nov 29 18:48:42 1994 Eric Youngdale (eric@andante)
* Linux 1.1.69 released.
* u14-34f.h: Non-functional change. [Dario].
* u14-34f.c: Use block field in Scsi_Host to prevent commands from
being queued to more than one host at the same time (used when
motherboard does not deal with multiple bus-masters very well).
Only when SINGLE_HOST_OPERATIONS is defined.
Use new cmd_per_lun field. [Dario]
* eata.c: Likewise.
* st.c: More changes from Kai. Add ready flag to indicate drive
status.
* README.st: Document this.
* sr.c: Bugfix (do not subtract CD_BLOCK_OFFSET) for photo-cd
code.
* sg.c: Bugfix - fix problem where opcode is not correctly set up.
* seagate.[c,h]: Use #defines to set driver name.
* scsi_ioctl.c: Zero buffer before executing command.
* scsi.c: Use new cmd_per_lun field in Scsi_Hosts as appropriate.
Add Sony CDU55S to blacklist.
* hosts.h: Add new cmd_per_lun field to Scsi_Hosts.
* hosts.c: Initialize cmd_per_lun in Scsi_Hosts from template.
* buslogic.c: Use cmd_per_lun field - initialize to different
values depending upon bus type (i.e. use 1 if ISA, so we do not
hog memory). Use other patches which got lost from 1.1.68.
* aha1542.c: Spelling.
Tue Nov 29 15:43:50 1994 Eric Youngdale (eric@andante.aib.com)
* Linux 1.1.68 released.
......
This diff is collapsed.
/*
* buslogic.h (C) 1993 David B. Gentzel
* Low-level scsi driver for BusLogic adapters
* by David B. Gentzel, Whitfield Software Services, Carnegie, PA
* (gentzel@nova.enet.dec.com)
* Thanks to BusLogic for providing the necessary documentation
*
* The original version of this driver was derived from aha1542.[ch] which
* is Copyright (C) 1992 Tommy Thorn. Much has been reworked, but most of
* basic structure and substantial chunks of code still remain.
* buslogic.h Copyright (C) 1993, 1994 David B. Gentzel
* See buslogic.c for more information.
*/
#ifndef _BUSLOGIC_H
......
/* fdomain.c -- Future Domain TMC-16x0 SCSI driver
* Created: Sun May 3 18:53:19 1992 by faith@cs.unc.edu
* Revised: Wed Nov 2 16:37:58 1994 by faith@cs.unc.edu
* Revised: Wed Dec 7 09:36:57 1994 by faith@cs.unc.edu
* Author: Rickard E. Faith, faith@cs.unc.edu
* Copyright 1992, 1993, 1994 Rickard E. Faith
*
* $Id: fdomain.c,v 5.20 1994/11/02 21:38:33 root Exp $
* $Id: fdomain.c,v 5.22 1994/12/07 15:15:46 root Exp $
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
......@@ -40,7 +40,8 @@
The following BIOS versions are supported: 2.0, 3.0, 3.2, 3.4, and 3.5.
The following chips are supported: TMC-1800, TMC-18C50, TMC-18C30.
Reports suggest that the driver will also work with the 36C70 chip.
Reports suggest that the driver will also work with the 36C70 chip and
with the Quantum ISA-200S SCSI adapter.
Please note that the drive ordering that Future Domain implemented in BIOS
versions 3.4 and 3.5 is the opposite of the order (currently) used by the
......@@ -133,6 +134,9 @@
Thanks to Eric Kasten (tigger@petroglyph.cl.msu.edu) for providing the
patch for the version 3.5 BIOS.
Thanks for Stephen Henson (shenson@nyx10.cs.du.edu) for providing the
patch for the Quantum ISA-200S SCSI adapter.
All of the alpha testers deserve much thanks.
......@@ -182,7 +186,7 @@
#include <linux/string.h>
#include <linux/ioport.h>
#define VERSION "$Revision: 5.20 $"
#define VERSION "$Revision: 5.22 $"
/* START OF USER DEFINABLE OPTIONS */
......@@ -273,6 +277,7 @@ static void *bios_base = NULL;
static int bios_major = 0;
static int bios_minor = 0;
static int PCI_bus = 0;
static int ISA_200S = 0; /* Quantum ISA-200S */
static int interrupt_level = 0;
static volatile int in_command = 0;
static Scsi_Cmnd *current_SC = NULL;
......@@ -347,12 +352,13 @@ struct signature {
int sig_length;
int major_bios_version;
int minor_bios_version;
int PCI_bus;
int flag; /* 1 == PCI_bus, 2 == ISA_200S */
} signatures[] = {
/* 1 2 3 4 5 6 */
/* 123456789012345678901234567890123456789012345678901234567890 */
{ "FUTURE DOMAIN CORP. (C) 1986-1990 1800-V2.07/28/89", 5, 50, 2, 0, 0 },
{ "FUTURE DOMAIN CORP. (C) 1986-1990 1800-V1.07/28/89", 5, 50, 2, 0, 0 },
{ "FUTURE DOMAIN CORP. (C) 1986-1990 1800-V2.07/28/89", 72, 50, 2, 0, 2 },
{ "FUTURE DOMAIN CORP. (C) 1992 V3.00.004/02/92", 5, 44, 3, 0, 0 },
{ "FUTURE DOMAIN TMC-18XX (C) 1993 V3.203/12/93", 5, 44, 3, 2, 0 },
{ "Future Domain Corp. V1.0008/18/93", 5, 33, 3, 4, 0 },
......@@ -532,7 +538,8 @@ int fdomain_16x0_detect( Scsi_Host_Template *tpnt )
signatures[j].signature, signatures[j].sig_length )) {
bios_major = signatures[j].major_bios_version;
bios_minor = signatures[j].minor_bios_version;
PCI_bus = signatures[j].PCI_bus;
PCI_bus = (signatures[j].flag == 1);
ISA_200S = (signatures[j].flag == 2);
bios_base = addresses[i];
}
}
......@@ -554,8 +561,13 @@ int fdomain_16x0_detect( Scsi_Host_Template *tpnt )
DOS (this geometry has nothing to do with physical geometry).
*/
port_base = *((char *)bios_base + 0x1fcc)
+ (*((char *)bios_base + 0x1fcd) << 8);
if (ISA_200S) { /* The Quantum board is slightly different. */
port_base = *((char *)bios_base + 0x1fa2)
+ (*((char *)bios_base + 0x1fa3) << 8);
} else {
port_base = *((char *)bios_base + 0x1fcc)
+ (*((char *)bios_base + 0x1fcd) << 8);
}
#if DEBUG_DETECT
printk( " %x,", port_base );
......@@ -1540,6 +1552,17 @@ int fdomain_16x0_biosparam( Scsi_Disk *disk, int dev, int *info_array )
The table at 0x1fcc are I/O ports addresses for the various
operations. I calculate these by hand in this driver code.
For the ISA-200S version of BIOS Version 2.0:
The drive parameter table starts at 0x1f33.
WARNING: Assume that the table entry is 25 bytes long. Someone needs
to check this for the Quantum ISA-200S card.
For BIOS Version 3.2:
The drive parameter table starts at 0x1f70. Each entry is
......@@ -1549,7 +1572,11 @@ int fdomain_16x0_biosparam( Scsi_Disk *disk, int dev, int *info_array )
drive = MINOR(dev) / 16;
if (bios_major == 2) {
i = (struct drive_info *)( (char *)bios_base + 0x1f31 + drive * 25 );
if (ISA_200S) {
i = (struct drive_info *)( (char *)bios_base + 0x1f33 + drive * 25 );
} else {
i = (struct drive_info *)( (char *)bios_base + 0x1f31 + drive * 25 );
}
info_array[0] = i->heads;
info_array[1] = i->sectors;
info_array[2] = i->cylinders;
......
/*
* hosts.c Copyright (C) 1992 Drew Eckhardt
* hosts.c Copyright (C) 1992 Drew Eckhardt
* mid to lowlevel SCSI driver interface by
* Drew Eckhardt
* Drew Eckhardt
*
* <drew@colorado.edu>
*/
......@@ -10,7 +10,7 @@
/*
* This file contains the medium level SCSI
* host interface initialization, as well as the scsi_hosts array of SCSI
* hosts currently present in the system.
* hosts currently present in the system.
*/
#include <linux/config.h>
......@@ -19,7 +19,7 @@
#include <linux/string.h>
#include "scsi.h"
#ifndef NULL
#ifndef NULL
#define NULL 0L
#endif
......@@ -50,7 +50,7 @@
#ifdef CONFIG_SCSI_U14_34F
#include "u14-34f.h"
#endif
#ifdef CONFIG_SCSI_FUTURE_DOMAIN
#include "fdomain.h"
#endif
......@@ -94,7 +94,7 @@
#ifdef CONFIG_SCSI_EATA
#include "eata.h"
#endif
#ifdef CONFIG_SCSI_DEBUG
#include "scsi_debug.h"
#endif
......@@ -104,9 +104,9 @@ static const char RCSid[] = "$Header: /usr/src/linux/kernel/blk_drv/scsi/RCS/hos
*/
/*
* The scsi host entries should be in the order you wish the
* The scsi host entries should be in the order you wish the
* cards to be detected. A driver may appear more than once IFF
* it can deal with being detected (and therefore initialized)
* it can deal with being detected (and therefore initialized)
* with more than one simultaneous host number, can handle being
* reentrant, etc.
*
......@@ -122,9 +122,9 @@ static const char RCSid[] = "$Header: /usr/src/linux/kernel/blk_drv/scsi/RCS/hos
NULL, NULL, 0, 0, 0, 0, 0, 0}
/*
* When figure is run, we don't want to link to any object code. Since
* the macro for each host will contain function pointers, we cannot
* use it and instead must use a "blank" that does no such
* When figure is run, we don't want to link to any object code. Since
* the macro for each host will contain function pointers, we cannot
* use it and instead must use a "blank" that does no such
* idiocy.
*/
......@@ -161,7 +161,7 @@ static Scsi_Host_Template builtin_scsi_hosts[] =
IN2000,
#endif
#ifdef CONFIG_SCSI_GENERIC_NCR5380
GENERIC_NCR5380,
GENERIC_NCR5380,
#endif
#ifdef CONFIG_SCSI_QLOGIC
QLOGIC,
......@@ -173,7 +173,7 @@ static Scsi_Host_Template builtin_scsi_hosts[] =
SEAGATE_ST0X,
#endif
#ifdef CONFIG_SCSI_T128
TRANTOR_T128,
TRANTOR_T128,
#endif
#ifdef CONFIG_SCSI_NCR53C7xx
NCR53c7xx,
......@@ -192,7 +192,7 @@ static Scsi_Host_Template builtin_scsi_hosts[] =
#define MAX_SCSI_HOSTS (sizeof(builtin_scsi_hosts) / sizeof(Scsi_Host_Template))
/*
* Our semaphores and timeout counters, where size depends on MAX_SCSI_HOSTS here.
* Our semaphores and timeout counters, where size depends on MAX_SCSI_HOSTS here.
*/
struct Scsi_Host * scsi_hostlist = NULL;
......@@ -232,13 +232,13 @@ struct Scsi_Host * scsi_register(Scsi_Host_Template * tpnt, int j){
retval->extra_bytes = j;
retval->loaded_as_module = scsi_loadable_module_flag;
retval->host_no = next_host++;
retval->host_queue = NULL;
retval->host_wait = NULL;
retval->last_reset = 0;
retval->host_queue = NULL;
retval->host_wait = NULL;
retval->last_reset = 0;
retval->irq = 0;
retval->forbidden_addr = 0;
retval->forbidden_size = 0;
retval->hostt = tpnt;
retval->hostt = tpnt;
retval->next = NULL;
#ifdef DEBUG
printk("Register %x %x: %d\n", retval, retval->hostt, j);
......@@ -282,19 +282,19 @@ unsigned int scsi_init()
if(called) return 0;
called = 1;
called = 1;
for (tpnt = &builtin_scsi_hosts[0], i = 0; i < MAX_SCSI_HOSTS; ++i, tpnt++)
{
/*
* Initialize our semaphores. -1 is interpreted to mean
* Initialize our semaphores. -1 is interpreted to mean
* "inactive" - where as 0 will indicate a time out condition.
*/
*/
pcount = next_host;
if ((tpnt->detect) &&
(tpnt->present =
if ((tpnt->detect) &&
(tpnt->present =
tpnt->detect(tpnt)))
{
{
/* The only time this should come up is when people use
some kind of patched driver of some kind or another. */
if(pcount == next_host) {
......@@ -312,7 +312,7 @@ unsigned int scsi_init()
}
}
printk ("scsi : %d hosts.\n", count);
/* Now attach the high level drivers */
#ifdef CONFIG_BLK_DEV_SD
scsi_register_device(&sd_template);
......@@ -334,17 +334,21 @@ unsigned int scsi_init()
void scsi_mem_init(unsigned long memory_end)
{
struct Scsi_Host *Host;
long High8, Low24;
for (Host = scsi_hostlist; Host != NULL; Host = Host->next)
if (Host->forbidden_addr > 0 && Host->forbidden_size > 0)
for (High8 = 1<<24; High8 < memory_end; High8 += 1<<24)
for (Low24 = Host->forbidden_addr;
Low24 < Host->forbidden_addr + Host->forbidden_size;
Low24 += PAGE_SIZE)
{
unsigned long ForbiddenAddress = High8 + Low24;
if (ForbiddenAddress >= memory_end) break;
mem_map[MAP_NR(ForbiddenAddress)] = MAP_PAGE_RESERVED;
}
struct Scsi_Host *Host;
long High8, Low24;
for (Host = scsi_hostlist; Host != NULL; Host = Host->next) {
if (Host->forbidden_addr > 0 && Host->forbidden_size > 0) {
for (High8 = 1<<24; High8 < memory_end; High8 += 1<<24) {
for (Low24 = Host->forbidden_addr;
Low24 < Host->forbidden_addr + Host->forbidden_size;
Low24 += PAGE_SIZE) {
unsigned long ForbiddenAddress = High8 + Low24;
if (ForbiddenAddress >= memory_end) goto next_host;
mem_map[MAP_NR(ForbiddenAddress)] = MAP_PAGE_RESERVED;
}
}
}
next_host:
continue;
}
}
......@@ -14,19 +14,30 @@
Reference Qlogic FAS408 Technical Manual, 53408-510-00A, May 10, 1994
(you can reference it, but it is incomplete and inaccurate in places)
Version 0.37
Version 0.38a
This also works with loadable SCSI as a module. Check configuration
options QL_INT_ACTIVE_HIGH and QL_TURBO_PDMA for PCMCIA usage (which
also requires an enabler).
Redistributable under terms of the GNU Public License
*/
/*----------------------------------------------------------------*/
/* Configuration */
/* Set the following to 2 to use normal interrupt (active high/totempole-
tristate), otherwise use 0 (REQUIRED FOR PCMCIA) for active low, open
drain */
#define QL_INT_ACTIVE_HIGH 2
/* Set the following to 1 to enable the use of interrupts. Note that 0 tends
to be more stable, but slower (or ties up the system more) */
#define QL_USE_IRQ 1
/* Set the following to max out the speed of the PIO PseudoDMA transfers,
again, 0 tends to be slower, but more stable */
again, 0 tends to be slower, but more stable. THIS SHOULD BE ZERO FOR
PCMCIA */
#define QL_TURBO_PDMA 1
/* This will reset all devices when the driver is initialized (during bootup).
......@@ -64,6 +75,8 @@
#include "../block/blk.h" /* to get disk capacity */
#include <linux/kernel.h>
#include <linux/string.h>
#include <linux/ioport.h>
#include <linux/sched.h>
#include <unistd.h>
#include <asm/io.h>
#include <asm/irq.h>
......@@ -83,9 +96,9 @@ static Scsi_Cmnd *qlcmd; /* current command being processed */
/*----------------------------------------------------------------*/
#define REG0 ( outb( inb( qbase + 0xd ) & 0x7f , qbase + 0xd ), outb( 4 , qbase + 0xd ))
#define REG1 ( outb( inb( qbase + 0xd ) | 0x80 , qbase + 0xd ), outb( 0xb6 , qbase + 0xd ))
#define REG1 ( outb( inb( qbase + 0xd ) | 0x80 , qbase + 0xd ), outb( 0xb4 | QL_INT_ACTIVE_HIGH , qbase + 0xd ))
/* following is watchdog timeout - 0 is longest possible */
/* following is watchdog timeout */
#define WATCHDOG 5000000
/*----------------------------------------------------------------*/
......@@ -196,9 +209,9 @@ int j;
static int ql_wai(void)
{
int i,k;
i = WATCHDOG;
while (--i && !qabort && !((k = inb(qbase + 4)) & 0xe0));
if (!i)
i = jiffies + WATCHDOG;
while ( i > jiffies && !qabort && !((k = inb(qbase + 4)) & 0xe0));
if (i <= jiffies)
return (DID_TIME_OUT);
if (qabort)
return (qabort == 1 ? DID_ABORT : DID_RESET);
......@@ -291,7 +304,9 @@ unsigned int sgcount; /* sg counter */
j &= 7; /* j = inb( qbase + 7 ) >> 5; */
/* correct status is supposed to be step 4 */
/* it sometimes returns step 3 but with 0 bytes left to send */
if (j != 4 && (j != 3 || inb(qbase + 7) & 0x1f)) {
/* We can try stuffing the FIFO with the max each time, but we will get a
sequence of 3 if any bytes are left (but we do flush the FIFO anyway */
if(j != 3 && j != 4) {
printk("Ql:Bad sequence for command %d, int %02X, cmdleft = %d\n", j, i, inb( qbase+7 ) & 0x1f );
ql_zap();
return (DID_ERROR << 16);
......@@ -333,10 +348,10 @@ rtrc(2)
k = inb(qbase + 5); /* should be 0x10, bus service */
}
/*** Enter Status (and Message In) Phase ***/
k = WATCHDOG;
k = jiffies + WATCHDOG;
rtrc(4)
while (--k && !qabort && !(inb(qbase + 4) & 6)); /* wait for status phase */
if (!k) {
while ( k > jiffies && !qabort && !(inb(qbase + 4) & 6)); /* wait for status phase */
if ( k <= jiffies ) {
ql_zap();
return (DID_TIME_OUT << 16);
}
......@@ -465,6 +480,8 @@ struct Scsi_Host *hreg; /* registered host structure */
*/
for (qbase = 0x230; qbase < 0x430; qbase += 0x100) {
if( check_region( qbase , 0x10 ) )
continue;
REG1;
if ( ( (inb(qbase + 0xe) ^ inb(qbase + 0xe)) == 7 )
&& ( (inb(qbase + 0xe) ^ inb(qbase + 0xe)) == 7 ) )
......@@ -498,25 +515,30 @@ struct Scsi_Host *hreg; /* registered host structure */
outb(10, 0x20); /* access pending interrupt map */
outb(10, 0xa0);
while (j--) {
outb(0xb2, qbase + 0xd); /* int pin off */
outb(0xb0 | QL_INT_ACTIVE_HIGH , qbase + 0xd); /* int pin off */
i &= ~(inb(0x20) | (inb(0xa0) << 8)); /* find IRQ off */
outb(0xb6, qbase + 0xd); /* int pin on */
outb(0xb4 | QL_INT_ACTIVE_HIGH , qbase + 0xd); /* int pin on */
i &= inb(0x20) | (inb(0xa0) << 8); /* find IRQ on */
}
REG0;
while (inb(qbase + 5)); /* purge int */
while (i) /* find on bit */
i >>= 1, qlirq++; /* should check for exactly 1 on */
if (qlirq >= 0 && !request_irq(qlirq, ql_ihandl, 0, "qlogic"))
if (qlirq >= 0 && !request_irq(qlirq, ql_ihandl, SA_INTERRUPT, "qlogic"))
host->can_queue = 1;
sti();
#endif
snarf_region( qbase , 0x10 );
hreg = scsi_register( host , 0 ); /* no host data */
hreg->io_port = qbase;
hreg->irq = qlirq;
hreg->n_io_port = 16;
if( qlirq != -1 )
hreg->irq = qlirq;
sprintf(qinfo, "Qlogic Driver version 0.36, chip %02X at %03X, IRQ %d", qltyp, qbase, qlirq);
sprintf(qinfo, "Qlogic Driver version 0.38a, chip %02X at %03X, IRQ %d", qltyp, qbase, qlirq);
host->name = qinfo;
return 1;
}
......@@ -562,3 +584,10 @@ const char *qlogic_info(struct Scsi_Host * host)
{
return qinfo;
}
#ifdef MODULE
/* Eventually this will go into an include file, but this will be later */
Scsi_Host_Template driver_template = QLOGIC;
#include "scsi_module.c"
#endif
This diff is collapsed.
......@@ -3052,7 +3052,6 @@ do_loop_irq (int voice)
pcm_active = 0; /* Signal to the play_next_pcm_block routine */
case LMODE_PCM:
{
int orig_qlen = pcm_qlen;
int flag; /* 0 or 2 */
pcm_qlen--;
......@@ -3068,7 +3067,7 @@ do_loop_irq (int voice)
pcm_active = 0;
}
/*
/*
* If the queue was full before this interrupt, the DMA transfer was
* suspended. Let it continue now.
*/
......
......@@ -549,7 +549,7 @@ load_elf_binary(struct linux_binprm * bprm, struct pt_regs * regs)
elf_ppnt->p_vaddr & 0xfffff000,
elf_ppnt->p_filesz + (elf_ppnt->p_vaddr & 0xfff),
PROT_READ | PROT_WRITE | PROT_EXEC,
MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE,
MAP_FIXED | MAP_PRIVATE | MAP_DENYWRITE | MAP_EXECUTABLE,
elf_ppnt->p_offset & 0xfffff000);
#ifdef LOW_ELF_STACK
......
......@@ -777,7 +777,12 @@ void brelse(struct buffer_head * buf)
{
if (!buf)
return;
/*
* Hmm.. Leaving this in for now, as I'm a bit nervous about it..
*/
#if 0
wait_on_buffer(buf);
#endif
/* If dirty, mark the time this buffer should be written back */
set_writetime(buf, 0);
......
......@@ -418,8 +418,11 @@ int do_open(const char * filename,int flags,int mode)
if (flag & (O_TRUNC | O_CREAT))
flag |= 2;
error = open_namei(filename,flag,mode,&inode,NULL);
if (!error && (f->f_mode & 2))
if (!error && (f->f_mode & 2)) {
error = get_write_access(inode);
if (error)
iput(inode);
}
if (error) {
current->files->fd[fd]=NULL;
f->f_count--;
......
This diff is collapsed.
......@@ -16,6 +16,8 @@
#include <asm/system.h>
#include <asm/segment.h>
extern unsigned long prof_len;
void proc_put_inode(struct inode *inode)
{
if (inode->i_nlink)
......@@ -127,6 +129,13 @@ void proc_read_inode(struct inode * inode)
inode->i_op = &proc_kcore_inode_operations;
inode->i_size = high_memory + PAGE_SIZE;
break;
#ifdef CONFIG_PROFILE
case PROC_PROFILE:
inode->i_mode = S_IFREG | S_IRUGO | S_IWUSR;
inode->i_op = &proc_profile_inode_operations;
inode->i_size = (1+prof_len) * sizeof(unsigned long);
break;
#endif
default:
inode->i_mode = S_IFREG | S_IRUGO;
inode->i_op = &proc_array_inode_operations;
......
......@@ -74,6 +74,7 @@ static struct proc_dir_entry root_dir[] = {
{ PROC_KSYMS, 5, "ksyms" },
{ PROC_DMA, 3, "dma" },
{ PROC_IOPORTS, 7, "ioports"},
{ PROC_PROFILE, 7, "profile"},
};
#define NR_ROOT_DIRENTRY ((sizeof (root_dir))/(sizeof (root_dir[0])))
......
......@@ -32,10 +32,14 @@ int UMSDOS_dir_read(struct inode *inode,struct file *filp,char *buf,
{
return -EISDIR;
}
#define NAME_OFFSET(de) ((int) ((de)->d_name - (char *) (de)))
#define ROUND_UP(x) (((x)+3) & ~3)
/*
Read count directory entries from directory filp
Return a negative value from linux/errno.h.
Return > 0 if success (the length of the file name).
Return > 0 if success (The amount of byte written in
dirent round_up to a word size (32 bits).
This function is used by the normal readdir VFS entry point and by
some function who try to find out info on a file from a pure MSDOS
......@@ -72,7 +76,7 @@ static int umsdos_readdir_x(
put_fs_byte(0,dirent->d_name+3);
put_fs_word (3,&dirent->d_reclen);
if (u_entry != NULL) u_entry->flags = 0;
ret = 3;
ret = ROUND_UP(NAME_OFFSET(dirent) + 3 + 1);
filp->f_pos++;
}else if (filp->f_pos < 2
|| (dir != dir->i_sb->s_mounted && filp->f_pos == 32)){
......@@ -191,7 +195,7 @@ static int umsdos_readdir_x(
dirent->d_reclen = entry.name_len;
if (u_entry != NULL) *u_entry = entry;
}
ret = entry.name_len;
ret = ROUND_UP(NAME_OFFSET(dirent) + entry.name_len + 1);
iput (inode);
break;
}
......@@ -219,7 +223,7 @@ static int umsdos_readdir_x(
/*
Read count directory entries from directory filp
Return a negative value from linux/errno.h.
Return > 0 if success (the length of the file name).
Return > 0 if success (the amount of byte written to dirent)
*/
static int UMSDOS_readdir(
struct inode *dir, /* Point to a description of the super block */
......
......@@ -32,8 +32,10 @@ static int UMSDOS_rreaddir (
{
int ret = 0;
while (1){
int len = -1;
ret = msdos_readdir(dir,filp,dirent,count);
if (ret == 5
if (ret > 0) len = get_fs_word(&dirent->d_reclen);
if (len == 5
&& pseudo_root != NULL
&& dir->i_sb->s_mounted == pseudo_root->i_sb->s_mounted){
/*
......@@ -45,7 +47,7 @@ static int UMSDOS_rreaddir (
if (memcmp(name,UMSDOS_PSDROOT_NAME,UMSDOS_PSDROOT_LEN)!=0) break;
}else{
if (pseudo_root != NULL
&& ret == 2
&& len == 2
&& dir == dir->i_sb->s_mounted
&& dir == pseudo_root->i_sb->s_mounted){
char name[2];
......
......@@ -35,4 +35,13 @@ extern __inline__ void udelay(unsigned long usecs)
__delay(usecs);
}
/*
* 64-bit integers means we don't have to worry about overflow as
* on some other architectures..
*/
extern __inline__ unsigned long muldiv(unsigned long a, unsigned long b, unsigned long c)
{
return (a*b)/c;
}
#endif /* defined(__ALPHA_DELAY_H) */
......@@ -176,4 +176,7 @@ extern inline void writel(unsigned int b, unsigned long addr)
*(volatile unsigned int *) ((addr << 7) + EISA_MEM + 0x60) = b;
}
#define inb_p inb
#define outb_p outb
#endif
#ifndef _ALPHA_TYPES_H
#define _ALPHA_TYPES_H
#ifndef _SIZE_T
#define _SIZE_T
typedef unsigned long size_t;
#endif
#ifndef _SSIZE_T
#define _SSIZE_T
typedef long ssize_t;
#endif
#ifndef _PTRDIFF_T
#define _PTRDIFF_T
typedef long ptrdiff_t;
#endif
/*
* __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
* header files exported to user space
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
3c509.o de600.o de620.o 3c501.o apricot.o eexpress.o plip.o 8390.o
3c509.o de600.o de620.o 3c501.o apricot.o eexpress.o plip.o 8390.o slip.o slhc.o
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment