Commit 4d178ac9 authored by Linus Torvalds's avatar Linus Torvalds

Linux 2.2.4

As of 2.2.4, I should be synchronized with the Sparc[64] and PPC ports,
which is the major reason why the patch is pretty huge. Apart from the
architecture synchronizations, 2.2.4 does:

 - dumping core over NFS could do bad things. Core-dumping cleaned up and
   fixed.

 - various small TCP/IP buglets fixed. Linux got confused by hosts that
   didn't report any mss, and had problems with zero-sized fragments, etc.

 - various small, often silly bugs fixed (PC BIOS PCI buglet, alpha
   semaphores, bottom half interrupts, fork() returns wrong error code).

 - tons of driver updates

 - updated net scheduling code (CONFIG_NET_SCHED)

Most of the fixes aren't all that noticeable, but some of them can be
showstoppers depending on whether you've ever seen them.
parent 7d4fc34b
......@@ -1769,7 +1769,7 @@ S: USA
N: Jaspreet Singh
E: jaspreet@sangoma.com
W: www.sangoma.com
D: WANPIPE driver for Sangoma S508/FT1 cards
D: WANPIPE drivers & API Support for Sangoma S508/FT1 cards
S: Sangoma Technologies Inc.,
S: 1001 Denison Street
S: Suite 101
......
This diff is collapsed.
......@@ -229,8 +229,8 @@ S: Maintained
DIGI INTL. EPCA DRIVER
P: Daniel Taylor
M: support@dgii.com
M: digilnux@dgii.com
L: digiboard@list.fuller.edu
M: danielt@dgii.com
L: digilnux@dgii.com
S: Maintained
DIGI RIGHTSWITCH NETWORK DRIVER
......@@ -719,10 +719,8 @@ W: http://www.stallion.com
S: Supported
STARMODE RADIO IP (STRIP) PROTOCOL DRIVER
P: Stuart Cheshire
M: cheshire@cs.stanford.edu
W: http://mosquitonet.Stanford.EDU/strip.html
S: Maintained
S: Unsupported ?
SVGA HANDLING
P: Martin Mares
......@@ -819,4 +817,4 @@ S: Maintained
THE REST
P: Linus Torvalds
S: Buried alive in diapers
S: Buried alive in reporters
......@@ -37,6 +37,7 @@
#include <asm/uaccess.h>
#include <asm/system.h>
#include <asm/sysinfo.h>
#include <asm/hwrpb.h>
extern int do_mount(kdev_t, const char *, const char *, char *, int, void *);
extern int do_pipe(int *);
......@@ -762,14 +763,10 @@ asmlinkage long osf_proplist_syscall(enum pl_code code, union pl_args *args)
asmlinkage int osf_sigstack(struct sigstack *uss, struct sigstack *uoss)
{
unsigned long usp = rdusp();
unsigned long oss_sp, oss_os;
unsigned long oss_sp = current->sas_ss_sp + current->sas_ss_size;
unsigned long oss_os = on_sig_stack(usp);
int error;
if (uoss) {
oss_sp = current->sas_ss_sp + current->sas_ss_size;
oss_os = on_sig_stack(usp);
}
if (uss) {
void *ss_sp;
......@@ -880,10 +877,12 @@ asmlinkage unsigned long osf_getsysinfo(unsigned long op, void *buffer,
int *start, void *arg)
{
unsigned long w;
struct percpu_struct *cpu;
switch (op) {
case GSI_IEEE_FP_CONTROL:
/* Return current software fp control & status bits. */
/* Note that DU doesn't verify available space here. */
w = current->tss.flags & IEEE_SW_MASK;
if (put_user(w, (unsigned long *) buffer))
return -EFAULT;
......@@ -898,10 +897,28 @@ asmlinkage unsigned long osf_getsysinfo(unsigned long op, void *buffer,
break;
case GSI_UACPROC:
if (nbytes < sizeof(unsigned int))
return -EINVAL;
w = (current->tss.flags >> UAC_SHIFT) & UAC_BITMASK;
if (put_user(w, (unsigned int *)buffer))
return -EFAULT;
return 0;
return 1;
case GSI_PROC_TYPE:
if (nbytes < sizeof(unsigned long))
return -EINVAL;
cpu = (struct percpu_struct*)
((char*)hwrpb + hwrpb->processor_offset);
if (put_user(w, (unsigned long *)buffer))
return -EFAULT;
return 1;
case GSI_GET_HWRPB:
if (nbytes < sizeof(*hwrpb))
return -EINVAL;
if (copy_to_user(buffer, hwrpb, nbytes) != 0)
return -EFAULT;
return 1;
default:
break;
......
......@@ -464,8 +464,7 @@ __initfunc(static int amd_model(struct cpuinfo_x86 *c))
rdmsr(0xC0000082, l, h);
if((l&0xFFFF0000)==0)
{
mbytes>>=2;
l=(mbytes<<22)|(1<<16);
l=((mbytes>>2)<<22)|(1<<16);
save_flags(flags);
__cli();
__asm__ __volatile__ ("wbinvd": : :"memory");
......
......@@ -161,7 +161,7 @@ do_aout32_core_dump(long signr, struct pt_regs * regs)
set_fs(KERNEL_DS);
DUMP_WRITE(current,sizeof(*current));
close_coredump:
close_fp(file, NULL);
filp_close(file, NULL);
end_coredump:
set_fs(fs);
return has_dumped;
......
......@@ -900,7 +900,7 @@ amiga_partition(struct gendisk *hd, kdev_t dev, unsigned long first_sector)
continue;
}
printk("Warning: Trashed word at 0xd0 in block %d "
"ignored in checksum calculation\n",kdevname(dev),blk);
"ignored in checksum calculation\n",blk);
}
printk(" RDSK");
blk = htonl(rdb->rdb_PartitionList);
......
......@@ -43,33 +43,6 @@
#include "ide.h"
/*
* CompactFlash cards and their brethern pretend to be removable hard disks, except:
* (1) they never have a slave unit, and
* (2) they don't have doorlock mechanisms.
* This test catches them, and is invoked elsewhere when setting appropriate config bits.
*
* FIXME: This treatment is probably applicable for *all* PCMCIA (PC CARD) devices,
* so in linux 2.3.x we should change this to just treat all PCMCIA drives this way,
* and get rid of the model-name tests below (too big of an interface change for 2.2.x).
* At that time, we might also consider parameterizing the timeouts and retries,
* since these are MUCH faster than mechanical drives. -M.Lord
*/
int drive_is_flashcard (ide_drive_t *drive)
{
struct hd_driveid *id = drive->id;
if (drive->removable && id != NULL) {
if (!strncmp(id->model, "KODAK ATA_FLASH", 15) /* Kodak */
|| !strncmp(id->model, "Hitachi CV", 10) /* Hitachi */
|| !strncmp(id->model, "SunDisk SDCFB", 13)) /* SunDisk */
{
return 1; /* yes, it is a flash memory card */
}
}
return 0; /* no, it is not a flash memory card */
}
static inline void do_identify (ide_drive_t *drive, byte cmd)
{
int bswap = 1;
......
......@@ -253,6 +253,33 @@ static void init_ide_data (void)
system_bus_speed = 0;
}
/*
* CompactFlash cards and their brethern pretend to be removable hard disks, except:
* (1) they never have a slave unit, and
* (2) they don't have doorlock mechanisms.
* This test catches them, and is invoked elsewhere when setting appropriate config bits.
*
* FIXME: This treatment is probably applicable for *all* PCMCIA (PC CARD) devices,
* so in linux 2.3.x we should change this to just treat all PCMCIA drives this way,
* and get rid of the model-name tests below (too big of an interface change for 2.2.x).
* At that time, we might also consider parameterizing the timeouts and retries,
* since these are MUCH faster than mechanical drives. -M.Lord
*/
int drive_is_flashcard (ide_drive_t *drive)
{
struct hd_driveid *id = drive->id;
if (drive->removable && id != NULL) {
if (!strncmp(id->model, "KODAK ATA_FLASH", 15) /* Kodak */
|| !strncmp(id->model, "Hitachi CV", 10) /* Hitachi */
|| !strncmp(id->model, "SunDisk SDCFB", 13)) /* SunDisk */
{
return 1; /* yes, it is a flash memory card */
}
}
return 0; /* no, it is not a flash memory card */
}
/*
* ide_system_bus_speed() returns what we think is the system VESA/PCI
* bus speed (in MHz). This is used for calculating interface PIO timings.
......
......@@ -771,7 +771,7 @@ static void rs_interrupt_multi(int irq, void *dev_id, struct pt_regs * regs)
continue;
if (!multi->port4)
break;
if ((inb(multi->port4) & multi->mask4) == multi->match4)
if ((inb(multi->port4) & multi->mask4) != multi->match4)
continue;
break;
}
......@@ -1274,6 +1274,8 @@ static void change_speed(struct async_struct *info,
/* Determine divisor based on baud rate */
baud = tty_get_baud_rate(info->tty);
if (!baud)
baud = 9600; /* B0 transition handled in rs_set_termios */
baud_base = info->state->baud_base;
if (baud == 38400 &&
((info->flags & ASYNC_SPD_MASK) == ASYNC_SPD_CUST))
......@@ -1740,7 +1742,7 @@ static int set_serial_info(struct async_struct * info,
check_and_exit:
if (!state->port || !state->type)
return 0;
if (state->flags & ASYNC_INITIALIZED) {
if (info->flags & ASYNC_INITIALIZED) {
if (((old_state.flags & ASYNC_SPD_MASK) !=
(state->flags & ASYNC_SPD_MASK)) ||
(old_state.custom_divisor != state->custom_divisor)) {
......@@ -2162,8 +2164,9 @@ static void rs_set_termios(struct tty_struct *tty, struct termios *old_termios)
{
struct async_struct *info = (struct async_struct *)tty->driver_data;
unsigned long flags;
unsigned int cflag = tty->termios->c_cflag;
if ( (tty->termios->c_cflag == old_termios->c_cflag)
if ( (cflag == old_termios->c_cflag)
&& ( RELEVANT_IFLAG(tty->termios->c_iflag)
== RELEVANT_IFLAG(old_termios->c_iflag)))
return;
......@@ -2172,7 +2175,7 @@ static void rs_set_termios(struct tty_struct *tty, struct termios *old_termios)
/* Handle transition to B0 status */
if ((old_termios->c_cflag & CBAUD) &&
!(tty->termios->c_cflag & CBAUD)) {
!(cflag & CBAUD)) {
info->MCR &= ~(UART_MCR_DTR|UART_MCR_RTS);
save_flags(flags); cli();
serial_out(info, UART_MCR, info->MCR);
......@@ -2181,7 +2184,7 @@ static void rs_set_termios(struct tty_struct *tty, struct termios *old_termios)
/* Handle transition away from B0 status */
if (!(old_termios->c_cflag & CBAUD) &&
(tty->termios->c_cflag & CBAUD)) {
(cflag & CBAUD)) {
info->MCR |= UART_MCR_DTR;
if (!(tty->termios->c_cflag & CRTSCTS) ||
!test_bit(TTY_THROTTLED, &tty->flags)) {
......
......@@ -1143,7 +1143,7 @@ static void release_dev(struct file * filp)
/*
* We've decremented tty->count, so we should zero out
* filp->private_data, to break the link between the tty and
* the file descriptor. Otherwise if close_fp() blocks before
* the file descriptor. Otherwise if filp_close() blocks before
* the the file descriptor is removed from the inuse_filp
* list, check_tty_count() could observe a discrepancy and
* printk a warning message to the user.
......
......@@ -831,7 +831,10 @@ el3_rx(struct device *dev)
static void
set_multicast_list(struct device *dev)
{
unsigned long flags;
struct el3_private *lp = (struct el3_private *)dev->priv;
int ioaddr = dev->base_addr;
if (el3_debug > 1) {
static int old = 0;
if (old != dev->mc_count) {
......@@ -839,6 +842,7 @@ set_multicast_list(struct device *dev)
printk("%s: Setting Rx mode to %d addresses.\n", dev->name, dev->mc_count);
}
}
spin_lock_irqsave(&lp->lock, flags);
if (dev->flags&IFF_PROMISC) {
outw(SetRxFilter | RxStation | RxMulticast | RxBroadcast | RxProm,
ioaddr + EL3_CMD);
......@@ -848,6 +852,7 @@ set_multicast_list(struct device *dev)
}
else
outw(SetRxFilter | RxStation | RxBroadcast, ioaddr + EL3_CMD);
spin_unlock_irqrestore(&lp->lock, flags);
}
static int
......
......@@ -82,7 +82,7 @@ if [ "$CONFIG_NET_ETHERNET" = "y" ]; then
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
tristate 'RealTek 8129/8139 (not 8019/8029!) support' CONFIG_RTL8139
tristate 'Packet Engines Yellowfin Gigabit-NIC support' CONFIG_YELLOWFIN
tristate 'Alteon AceNIC & 3Com 3C985 Gigabit support' CONFIG_ACENIC
tristate 'Alteon AceNIC/3Com 3C985/NetGear GA620 Gigabit support' CONFIG_ACENIC
fi
bool 'Other ISA cards' CONFIG_NET_ISA
if [ "$CONFIG_NET_ISA" = "y" ]; then
......
This diff is collapsed.
#ifndef _ACENIC_H_
#define _ACENIC_H_
#if ((BITS_PER_LONG != 32) && (BITS_PER_LONG != 64))
#error "BITS_PER_LONG not defined or not valid"
/*
* Addressing:
*
* The Tigon uses 64-bit host addresses, regardless of their actual
* length, and it expects a big-endian format. For 32 bit systems the
* upper 32 bits of the address are simply ignored (zero), however for
* little endian 64 bit systems (Alpha) this looks strange with the
* two parts of the address word being swapped.
*
* The addresses are split in two 32 bit words for all architectures
* as some of them are in PCI shared memory and it is necessary to use
* readl/writel to access them.
*
* The addressing code is derived from Pete Beckman's work, but
* modified to deal properly with readl/writel usage.
*/
typedef struct {
u32 addrhi;
u32 addrlo;
} aceaddr;
static inline void set_aceaddr(aceaddr *aa, volatile void *addr)
{
unsigned long baddr = virt_to_bus((void *)addr);
#if (BITS_PER_LONG == 64)
aa->addrlo = baddr & 0xffffffff;
aa->addrhi = baddr >> 32;
#else
/* Don't bother setting zero every time */
aa->addrlo = baddr;
#endif
mb();
}
struct ace_regs {
static inline void set_aceaddr_bus(aceaddr *aa, volatile void *addr)
{
unsigned long baddr = (unsigned long)addr;
#if (BITS_PER_LONG == 64)
aa->addrlo = baddr & 0xffffffff;
aa->addrhi = baddr >> 32;
#else
/* Don't bother setting zero every time */
aa->addrlo = baddr;
#endif
mb();
}
static inline void *get_aceaddr(aceaddr *aa)
{
unsigned long addr;
mb();
#if (BITS_PER_LONG == 64)
addr = (u64)aa->addrhi << 32 | aa->addrlo;
#else
addr = aa->addrlo;
#endif
return bus_to_virt(addr);
}
static inline void *get_aceaddr_bus(aceaddr *aa)
{
unsigned long addr;
mb();
#if (BITS_PER_LONG == 64)
addr = (u64)aa->addrhi << 32 | aa->addrlo;
#else
addr = aa->addrlo;
#endif
return (void *)addr;
}
struct ace_regs {
u32 pad0[16]; /* PCI control registers */
u32 HostCtrl; /* 0x40 */
......@@ -109,7 +180,7 @@ struct ace_regs {
u32 ModeStat;
u32 DmaReadCfg;
u32 DmaWriteCfg; /* 0x620 */
u32 pad15;
u32 TxBufRat;
u32 EvtCsm;
u32 CmdCsm;
u32 TuneRxCoalTicks;/* 0x630 */
......@@ -220,6 +291,7 @@ struct ace_regs {
#define ACE_BYTE_SWAP_DATA 0x10
#define ACE_WARN 0x08
#define ACE_WORD_SWAP 0x04
#define ACE_NO_JUMBO_FRAG 0x200
#define ACE_FATAL 0x40000000
......@@ -227,7 +299,7 @@ struct ace_regs {
* DMA config
*/
#define DMA_THRESH_8W 0x80;
#define DMA_THRESH_8W 0x80
/*
......@@ -366,19 +438,19 @@ struct cmd {
#define DESC_MORE 0x08
/*
* RX control block flags
* Control block flags
*/
#define RX_TCP_UDP_SUM 0x01
#define RX_IP_SUM 0x02
#define RX_SPLIT_HDRS 0x04
#define RX_NO_PSEUDO_HDR_SUM 0x08
#define FLG_RX_TCP_UDP_SUM 0x01
#define FLG_RX_IP_SUM 0x02
#define FLG_RX_SPLIT_HDRS 0x04
#define FLG_RX_NO_PSDO_HDR_SUM 0x08
#define FLG_RNG_DISABLED 0x200
/*
* Descriptor flags
*/
#define JUMBO_FLAG 0x10
#define DFLG_RX_JUMBO 0x10
/*
* TX ring
......@@ -389,18 +461,20 @@ struct cmd {
#define TX_RING_BASE 0x3800
struct tx_desc{
#if (BITS_PER_LONG == 64)
u64 addr;
#else
u32 zero;
u32 addr;
#endif
aceaddr addr;
u32 flagsize;
#if 0
/*
* This is in PCI shared mem and must be accessed with readl/writel
* real layout is:
*/
#if __LITTLE_ENDIAN
u16 flags;
u16 size;
#else
u16 size;
u16 flags;
#endif
#endif
u32 nic_addr;
};
......@@ -412,19 +486,18 @@ struct tx_desc{
#define RX_JUMBO_RING_ENTRIES 256
#define RX_JUMBO_RING_SIZE (RX_JUMBO_RING_ENTRIES *sizeof(struct rx_desc))
#define RX_RETURN_RING_ENTRIES (2 * RX_STD_RING_ENTRIES)
#define RX_RETURN_RING_SIZE (RX_RETURN_RING_ENTRIES * \
#define RX_MINI_RING_ENTRIES 1024
#define RX_MINI_RING_SIZE (RX_MINI_RING_ENTRIES *sizeof(struct rx_desc))
#define RX_RETURN_RING_ENTRIES 2048
#define RX_RETURN_RING_SIZE (RX_MAX_RETURN_RING_ENTRIES * \
sizeof(struct rx_desc))
#define RX_RING_THRESH 32
#define RX_RING_THRESH 64
#define RX_RING_JUMBO_THRESH 48
struct rx_desc{
#if (BITS_PER_LONG == 64)
u64 addr;
#else
u32 zero;
u32 addr;
#endif
aceaddr addr;
#ifdef __LITTLE_ENDIAN
u16 size;
u16 idx;
......@@ -462,12 +535,7 @@ struct rx_desc{
* This struct is shared with the NIC firmware.
*/
struct ring_ctrl {
#if (BITS_PER_LONG == 64)
u64 rngptr;
#else
u32 zero;
u32 rngptr;
#endif
aceaddr rngptr;
#ifdef __LITTLE_ENDIAN
u16 flags;
u16 max_len;
......@@ -522,22 +590,12 @@ struct ace_info {
struct ring_ctrl tx_ctrl;
struct ring_ctrl rx_std_ctrl;
struct ring_ctrl rx_jumbo_ctrl;
struct ring_ctrl rx_mini_ctrl;
struct ring_ctrl rx_return_ctrl;
#if (BITS_PER_LONG == 64)
u64 evt_prd_ptr;
u64 rx_ret_prd_ptr;
u64 tx_csm_ptr;
u64 stats2_ptr;
#else
u32 evt_prd_ptr_hi;
u32 evt_prd_ptr;
u32 rx_ret_prd_ptr_hi;
u32 rx_ret_prd_ptr;
u32 tx_csm_ptr_hi;
u32 tx_csm_ptr;
u32 stats2_ptr_hi;
u32 stats2_ptr;
#endif
aceaddr evt_prd_ptr;
aceaddr rx_ret_prd_ptr;
aceaddr tx_csm_ptr;
aceaddr stats2_ptr;
};
/*
......@@ -555,6 +613,9 @@ struct ace_private
struct tx_desc *tx_ring;
struct rx_desc rx_std_ring[RX_STD_RING_ENTRIES];
struct rx_desc rx_jumbo_ring[RX_JUMBO_RING_ENTRIES];
#if 0
struct rx_desc rx_mini_ring[RX_MINI_RING_ENTRIES];
#endif
struct rx_desc rx_return_ring[RX_RETURN_RING_ENTRIES];
struct event evt_ring[EVT_RING_ENTRIES];
struct ace_info *info;
......@@ -576,7 +637,7 @@ struct ace_private
struct device *next
__attribute__ ((aligned (L1_CACHE_BYTES)));
unsigned char *trace_buf;
int fw_running, fw_up, jumbo, promisc;
int fw_running, fw_up, jumbo, promisc, mcast_all;
int version;
int flags;
u16 vendor;
......@@ -598,7 +659,7 @@ static int ace_load_std_rx_ring(struct device *dev);
static int ace_load_jumbo_rx_ring(struct device *dev);
static int ace_flush_jumbo_rx_ring(struct device *dev);
static void ace_interrupt(int irq, void *dev_id, struct pt_regs *regs);
static int ace_load_firmware(struct device *dev);
static int ace_open(struct device *dev);
static int ace_start_xmit(struct sk_buff *skb, struct device *dev);
static int ace_close(struct device *dev);
......
This diff is collapsed.
/*+M*************************************************************************
* Perceptive Solutions, Inc. PCI-2000 device driver proc support for Linux.
*
* Copyright (c) 1997 Perceptive Solutions, Inc.
* Copyright (c) 1999 Perceptive Solutions, Inc.
*
* 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
......@@ -20,13 +20,24 @@
*
* File Name: pci2000i.c
*
* Revisions 1.10 Jan-21-1999
* - Fixed sign on message to reflect proper controller name.
* - Added support for RAID status monitoring and control.
*
* Revisions 1.11 Mar-22-1999
* - Fixed control timeout to not lock up the entire system if
* controller goes offline completely.
*
*-M*************************************************************************/
#define PCI2000_VERSION "1.11"
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/head.h>
#include <linux/types.h>
#include <linux/string.h>
#include <linux/bios32.h>
#include <linux/pci.h>
#include <linux/ioport.h>
#include <linux/delay.h>
......@@ -34,7 +45,6 @@
#include <linux/proc_fs.h>
#include <asm/dma.h>
#include <asm/system.h>
#include <asm/spinlock.h>
#include <asm/io.h>
#include <linux/blk.h>
#include "scsi.h"
......@@ -89,7 +99,6 @@ typedef struct
static struct Scsi_Host *PsiHost[MAXADAPTER] = {NULL,}; // One for each adapter
static int NumAdapters = 0;
/****************************************************************
* Name: WaitReady :LOCAL
*
......@@ -102,13 +111,14 @@ static int NumAdapters = 0;
****************************************************************/
static int WaitReady (PADAPTER2000 padapter)
{
ULONG timer;
ULONG z;
timer = jiffies + TIMEOUT_COMMAND; // calculate the timeout value
do {
for ( z = 0; z < (TIMEOUT_COMMAND * 4); z++ )
{
if ( !inb_p (padapter->cmd) )
return FALSE;
} while ( timer > jiffies ); // test for timeout
udelay (250);
};
return TRUE;
}
/****************************************************************
......@@ -180,6 +190,26 @@ static int BuildSgList (Scsi_Cmnd *SCpnt, PADAPTER2000 padapter, PDEV2000 pdev)
outl (SCpnt->request_bufflen, padapter->mb3);
return TRUE;
}
/*********************************************************************
* Name: PsiRaidCmd
*
* Description: Execute a simple command.
*
* Parameters: padapter - Pointer to adapter control structure.
* cmd - Roy command byte.
*
* Returns: Return error status.
*
********************************************************************/
static int PsiRaidCmd (PADAPTER2000 padapter, char cmd)
{
if ( WaitReady (padapter) ) // test for command register ready
return DID_TIME_OUT;
outb_p (cmd, padapter->cmd); // issue command
if ( WaitReady (padapter) ) // wait for adapter ready
return DID_TIME_OUT;
return DID_OK;
}
/****************************************************************
* Name: Irq_Handler :LOCAL
*
......@@ -366,7 +396,35 @@ int Pci2000_QueueCommand (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
switch ( *cdb )
{
case SCSIOP_INQUIRY: // inquiry CDB
if ( cdb[2] == SC_MY_RAID )
{
switch ( cdb[3] )
{
case MY_SCSI_REBUILD:
OpDone (SCpnt, PsiRaidCmd (padapter, CMD_RAID_REBUILD) << 16);
return 0;
case MY_SCSI_ALARMMUTE:
OpDone (SCpnt, PsiRaidCmd (padapter, CMD_RAID_MUTE) << 16);
return 0;
case MY_SCSI_DEMOFAIL:
OpDone (SCpnt, PsiRaidCmd (padapter, CMD_RAID_FAIL) << 16);
return 0;
default:
if ( SCpnt->use_sg )
{
rc = DID_ERROR;
goto finished;
}
else
outl (virt_to_bus (SCpnt->request_buffer), padapter->mb2);
outl (cdb[5], padapter->mb0);
outl (cdb[3], padapter->mb3);
cmd = CMD_DASD_RAID_RQ;
break;
}
break;
}
if ( SCpnt->use_sg )
{
outl (virt_to_bus (((struct scatterlist *)(SCpnt->request_buffer))->address), padapter->mb2);
......@@ -378,7 +436,6 @@ int Pci2000_QueueCommand (Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
outl (SCpnt->request_bufflen, padapter->mb3);
cmd = CMD_DASD_SCSI_INQ;
break;
}
case SCSIOP_TEST_UNIT_READY: // test unit ready CDB
outl (virt_to_bus (SCpnt->sense_buffer), padapter->mb2);
......@@ -466,14 +523,6 @@ finished:;
OpDone (SCpnt, rc << 16);
return 0;
}
static void do_Irq_Handler (int irq, void *dev_id, struct pt_regs *regs)
{
unsigned long flags;
spin_lock_irqsave(&io_request_lock, flags);
Irq_Handler(irq, dev_id, regs);
spin_unlock_irqrestore(&io_request_lock, flags);
}
/****************************************************************
* Name: internal_done :LOCAL
*
......@@ -524,17 +573,23 @@ int Pci2000_Detect (Scsi_Host_Template *tpnt)
int pci_index = 0;
struct Scsi_Host *pshost;
PADAPTER2000 padapter;
int z;
int z, zz;
int setirq;
struct pci_dev *pdev = NULL;
if ( pci_present () )
while ((pdev = pci_find_device(VENDOR_PSI, DEVICE_ROY_1, pdev)))
if ( pcibios_present () )
{
for ( pci_index = 0; pci_index <= MAXADAPTER; ++pci_index )
{
UCHAR pci_bus, pci_device_fn;
if ( pcibios_find_device (VENDOR_PSI, DEVICE_ROY_1, pci_index, &pci_bus, &pci_device_fn) != 0 )
break;
pshost = scsi_register (tpnt, sizeof(ADAPTER2000));
padapter = HOSTDATA(pshost);
padapter->basePort = pdev->base_address[1] & PCI_BASE_ADDRESS_IO_MASK;
pcibios_read_config_word (pci_bus, pci_device_fn, PCI_BASE_ADDRESS_1, &padapter->basePort);
padapter->basePort &= 0xFFFE;
DEB (printk ("\nBase Regs = %#04X", padapter->basePort)); // get the base I/O port address
padapter->mb0 = padapter->basePort + RTR_MAILBOX; // get the 32 bit mail boxes
padapter->mb1 = padapter->basePort + RTR_MAILBOX + 4;
......@@ -551,7 +606,7 @@ int Pci2000_Detect (Scsi_Host_Template *tpnt)
if ( WaitReady (padapter) )
goto unregister;
pshost->irq = pdev->irq;
pcibios_read_config_byte (pci_bus, pci_device_fn, PCI_INTERRUPT_LINE, &pshost->irq);
setirq = 1;
for ( z = 0; z < pci_index; z++ ) // scan for shared interrupts
{
......@@ -560,7 +615,7 @@ int Pci2000_Detect (Scsi_Host_Template *tpnt)
}
if ( setirq ) // if not shared, posses
{
if ( request_irq (pshost->irq, do_Irq_Handler, 0, "pci2000", NULL) )
if ( request_irq (pshost->irq, Irq_Handler, 0, "pci2000", NULL) )
{
printk ("Unable to allocate IRQ for PSI-2000 controller.\n");
goto unregister;
......@@ -572,14 +627,19 @@ int Pci2000_Detect (Scsi_Host_Template *tpnt)
pshost->max_id = 16;
pshost->max_channel = 1;
printk("\nPSI-2000 EIDE CONTROLLER: at I/O = %X IRQ = %d\n", padapter->basePort, pshost->irq);
printk("(C) 1997 Perceptive Solutions, Inc. All rights reserved\n\n");
NumAdapters++;
for ( zz = 0; zz < MAX_BUS; zz++ )
for ( z = 0; z < MAX_UNITS; z++ )
padapter->dev[zz][z].tag = 0;
printk("\nPSI-2000 Intelligent Storage SCSI CONTROLLER: at I/O = %X IRQ = %d\n", padapter->basePort, pshost->irq);
printk("Version %s, Compiled %s %s\n\n", PCI2000_VERSION, __DATE__, __TIME__);
continue;
unregister:;
scsi_unregister (pshost);
}
return NumAdapters;
}
NumAdapters = pci_index;
return pci_index;
}
/****************************************************************
* Name: Pci2220i_Abort
......@@ -653,7 +713,7 @@ int Pci2000_BiosParam (Scsi_Disk *disk, kdev_t dev, int geom[])
#ifdef MODULE
/* Eventually this will go into an include file, but this will be later */
Scsi_Host_Template driver_template = PCI2000;
Scsi_Host_Template driver_template = PCI2220I;
#include "scsi_module.c"
#endif
......
......@@ -202,18 +202,25 @@ int Pci2000_BiosParam (Disk *disk, kdev_t dev, int geom[]);
extern struct proc_dir_entry Proc_Scsi_Pci2000;
#define PCI2000 { proc_dir: &Proc_Scsi_Pci2000,/* proc_dir_entry */ \
name: "PCI-2000 SCSI Intelligent Disk Controller",\
detect: Pci2000_Detect, \
command: Pci2000_Command, \
queuecommand: Pci2000_QueueCommand, \
abort: Pci2000_Abort, \
reset: Pci2000_Reset, \
bios_param: Pci2000_BiosParam, \
can_queue: 16, \
this_id: -1, \
sg_tablesize: 16, \
cmd_per_lun: 1, \
use_clustering: DISABLE_CLUSTERING }
#define PCI2000 { NULL, NULL, \
&Proc_Scsi_Pci2000,/* proc_dir_entry */ \
NULL, \
"PCI-2000 SCSI Intelligent Disk Controller",\
Pci2000_Detect, \
NULL, \
NULL, \
Pci2000_Command, \
Pci2000_QueueCommand, \
Pci2000_Abort, \
Pci2000_Reset, \
NULL, \
Pci2000_BiosParam, \
16, \
-1, \
16, \
1, \
0, \
0, \
DISABLE_CLUSTERING }
#endif
This diff is collapsed.
/*+M*************************************************************************
* Perceptive Solutions, Inc. PCI-2000 device driver proc support for Linux.
*
* Copyright (c) 1997 Perceptive Solutions, Inc.
* Copyright (c) 1999 Perceptive Solutions, Inc.
*
* 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
......@@ -25,12 +25,6 @@
*
*-M*************************************************************************/
#ifndef _PCI2220I_H
#define _PCI2220I_H
#include <linux/types.h>
#include <linux/kdev_t.h>
#ifndef PSI_EIDE_SCSIOP
#define PSI_EIDE_SCSIOP 1
......@@ -46,11 +40,14 @@
#define ULONG unsigned long
#define VOID void
#include "psi_dale.h"
/************************************************/
/* Timeout konstants */
/************************************************/
#define TIMEOUT_READY 10 // 100 mSec
#define TIMEOUT_DRQ 40 // 400 mSec
#define TIMEOUT_READY 100 // 100 mSec
#define TIMEOUT_DRQ 300 // 300 mSec
#define TIMEOUT_DATA (3 * HZ) // 3 seconds
/************************************************/
/* Misc. macros */
......@@ -76,6 +73,9 @@
+ (((long)(((UCHAR *)up)[2])) << 8) \
+ ((long)(((UCHAR *)up)[3])) )
#define SelectSpigot(padapter,spigot) outb_p (spigot, padapter->regStatSel)
#define WriteCommand(padapter,cmd) outb_p (cmd, padapter->regStatCmd)
/************************************************/
/* SCSI CDB operation codes */
/************************************************/
......@@ -163,8 +163,6 @@
#define IDE_CMD_READ_MULTIPLE 0xC4
#define IDE_CMD_WRITE_MULTIPLE 0xC5
#define IDE_CMD_SET_MULTIPLE 0xC6
#define IDE_COMMAND_WRITE_DMA 0xCA
#define IDE_COMMAND_READ_DMA 0xC8
#define IDE_COMMAND_IDENTIFY 0xEC
// IDE status definitions
......@@ -187,23 +185,6 @@
#define IDE_ERROR_UNC 0x40
#define IDE_ERROR_BBK 0x80
// IDE interface structure
typedef struct _IDE_STRUCT
{
union
{
UCHAR ide[9];
struct
{
USHORT data;
UCHAR sectors;
UCHAR lba[4];
UCHAR cmd;
UCHAR spigot;
} ides;
} ide;
} IDE_STRUCT;
// SCSI read capacity structure
typedef struct _READ_CAPACITY_DATA
{
......@@ -238,73 +219,64 @@ typedef struct _INQUIRYDATA
} INQUIRYDATA, *PINQUIRYDATA;
// IDE IDENTIFY data
#pragma pack (1)
#pragma align 1
typedef struct _IDENTIFY_DATA
{
USHORT GeneralConfiguration; // 00
USHORT NumberOfCylinders; // 02
USHORT Reserved1; // 04
USHORT NumberOfHeads; // 06
USHORT UnformattedBytesPerTrack; // 08
USHORT UnformattedBytesPerSector; // 0A
USHORT SectorsPerTrack; // 0C
USHORT VendorUnique1[3]; // 0E
USHORT SerialNumber[10]; // 14
USHORT BufferType; // 28
USHORT BufferSectorSize; // 2A
USHORT NumberOfEccBytes; // 2C
USHORT FirmwareRevision[4]; // 2E
USHORT ModelNumber[20]; // 36
UCHAR MaximumBlockTransfer; // 5E
UCHAR VendorUnique2; // 5F
USHORT DoubleWordIo; // 60
USHORT Capabilities; // 62
USHORT Reserved2; // 64
UCHAR VendorUnique3; // 66
UCHAR PioCycleTimingMode; // 67
UCHAR VendorUnique4; // 68
UCHAR DmaCycleTimingMode; // 69
USHORT TranslationFieldsValid:1; // 6A
USHORT Reserved3:15;
USHORT NumberOfCurrentCylinders; // 6C
USHORT NumberOfCurrentHeads; // 6E
USHORT CurrentSectorsPerTrack; // 70
ULONG CurrentSectorCapacity; // 72
USHORT Reserved4[197]; // 76
USHORT GeneralConfiguration; // 0
USHORT NumberOfCylinders; // 1
USHORT Reserved1; // 2
USHORT NumberOfHeads; // 3
USHORT UnformattedBytesPerTrack; // 4
USHORT UnformattedBytesPerSector; // 5
USHORT SectorsPerTrack; // 6
USHORT NumBytesISG; // 7 Byte Len - inter-sector gap
USHORT NumBytesSync; // 8 - sync field
USHORT NumWordsVUS; // 9 Len - Vendor Unique Info
USHORT SerialNumber[10]; // 10
USHORT BufferType; // 20
USHORT BufferSectorSize; // 21
USHORT NumberOfEccBytes; // 22
USHORT FirmwareRevision[4]; // 23
USHORT ModelNumber[20]; // 27
USHORT NumSectorsPerInt :8; // 47 Multiple Mode - Sec/Blk
USHORT Reserved2 :8; // 47
USHORT DoubleWordMode; // 48 flag for double word mode capable
USHORT VendorUnique1 :8; // 49
USHORT SupportDMA :1; // 49 DMA supported
USHORT SupportLBA :1; // 49 LBA supported
USHORT SupportIORDYDisable :1; // 49 IORDY can be disabled
USHORT SupportIORDY :1; // 49 IORDY supported
USHORT ReservedPsuedoDMA :1; // 49 reserved for pseudo DMA mode support
USHORT Reserved3 :3; // 49
USHORT Reserved4; // 50
USHORT Reserved5 :8; // 51 Transfer Cycle Timing - PIO
USHORT PIOCycleTime :8; // 51 Transfer Cycle Timing - PIO
USHORT Reserved6 :8; // 52 - DMA
USHORT DMACycleTime :8; // 52 - DMA
USHORT Valid_54_58 :1; // 53 words 54 - 58 are vaild
USHORT Valid_64_70 :1; // 53 words 64 - 70 are valid
USHORT Reserved7 :14; // 53
USHORT LogNumCyl; // 54 Current Translation - Num Cyl
USHORT LogNumHeads; // 55 Num Heads
USHORT LogSectorsPerTrack; // 56 Sec/Trk
ULONG LogTotalSectors; // 57 Total Sec
USHORT CurrentNumSecPerInt :8; // 59 current setting for number of sectors per interrupt
USHORT ValidNumSecPerInt :1; // 59 Current setting is valid for number of sectors per interrupt
USHORT Reserved8 :7; // 59
ULONG LBATotalSectors; // 60 LBA Mode - Sectors
USHORT DMASWordFlags; // 62
USHORT DMAMWordFlags; // 63
USHORT AdvancedPIOSupport :8; // 64 Flow control PIO transfer modes supported
USHORT Reserved9 :8; // 64
USHORT MinMultiDMACycle; // 65 minimum multiword DMA transfer cycle time per word
USHORT RecomendDMACycle; // 66 Manufacturer's recommende multiword DMA transfer cycle time
USHORT MinPIOCycleWithoutFlow; // 67 Minimum PIO transfer cycle time without flow control
USHORT MinPIOCylceWithFlow; // 68 Minimum PIO transfer cycle time with IORDY flow control
USHORT ReservedSpace[256-69]; // 69
} IDENTIFY_DATA, *PIDENTIFY_DATA;
// Identify data without the Reserved4.
typedef struct _IDENTIFY_DATA2 {
USHORT GeneralConfiguration; // 00
USHORT NumberOfCylinders; // 02
USHORT Reserved1; // 04
USHORT NumberOfHeads; // 06
USHORT UnformattedBytesPerTrack; // 08
USHORT UnformattedBytesPerSector; // 0A
USHORT SectorsPerTrack; // 0C
USHORT VendorUnique1[3]; // 0E
USHORT SerialNumber[10]; // 14
USHORT BufferType; // 28
USHORT BufferSectorSize; // 2A
USHORT NumberOfEccBytes; // 2C
USHORT FirmwareRevision[4]; // 2E
USHORT ModelNumber[20]; // 36
UCHAR MaximumBlockTransfer; // 5E
UCHAR VendorUnique2; // 5F
USHORT DoubleWordIo; // 60
USHORT Capabilities; // 62
USHORT Reserved2; // 64
UCHAR VendorUnique3; // 66
UCHAR PioCycleTimingMode; // 67
UCHAR VendorUnique4; // 68
UCHAR DmaCycleTimingMode; // 69
USHORT TranslationFieldsValid:1; // 6A
USHORT Reserved3:15;
USHORT NumberOfCurrentCylinders; // 6C
USHORT NumberOfCurrentHeads; // 6E
USHORT CurrentSectorsPerTrack; // 70
ULONG CurrentSectorCapacity; // 72
} IDENTIFY_DATA2, *PIDENTIFY_DATA2;
#pragma pack ()
#pragma align 0
#endif // PSI_EIDE_SCSIOP
// function prototypes
......@@ -321,18 +293,24 @@ int Pci2220i_BiosParam (Disk *disk, kdev_t dev, int geom[]);
extern struct proc_dir_entry Proc_Scsi_Pci2220i;
#define PCI2220I { proc_dir: &Proc_Scsi_Pci2220i,/* proc_dir_entry */ \
name: "PCI-2220I EIDE Disk Controller",\
detect: Pci2220i_Detect, \
command: Pci2220i_Command, \
queuecommand: Pci2220i_QueueCommand, \
abort: Pci2220i_Abort, \
reset: Pci2220i_Reset, \
bios_param: Pci2220i_BiosParam, \
can_queue: 1, \
this_id: -1, \
sg_tablesize: SG_NONE, \
cmd_per_lun: 1, \
use_clustering: DISABLE_CLUSTERING }
#define PCI2220I { NULL, NULL, \
&Proc_Scsi_Pci2220i,/* proc_dir_entry */\
NULL, \
"PCI-2220I EIDE Disk Controller", \
Pci2220i_Detect, \
NULL, \
NULL, \
Pci2220i_Command, \
Pci2220i_QueueCommand, \
Pci2220i_Abort, \
Pci2220i_Reset, \
NULL, \
Pci2220i_BiosParam, \
1, \
-1, \
SG_NONE, \
1, \
0, \
0, \
DISABLE_CLUSTERING }
#endif
/*+M*************************************************************************
* Perceptive Solutions, Inc. PCI-2000 device driver proc support for Linux.
*
* Copyright (c) 1997 Perceptive Solutions, Inc.
* Copyright (c) 1999 Perceptive Solutions, Inc.
*
* 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
......@@ -25,9 +25,6 @@
*
*-M*************************************************************************/
#ifndef PSI_DALE
#define PSI_DALE
/************************************************/
/* Dale PCI setup */
/************************************************/
......@@ -184,4 +181,38 @@ typedef struct // master setup structure
SETUP_DEVICE setupDevice[4];
} SETUP, *PSETUP;
#endif
/************************************************/
/* RAID Structure Definitions */
/************************************************/
typedef struct
{
UCHAR signature; // 0x55 our mirror signature
UCHAR status; // current status bits
UCHAR pairIdentifier; // unique identifier for pair
ULONG reconstructPoint; // recontruction point for hot reconstruct
} DISK_MIRROR;
typedef struct DEVICE_RAID1
{
long TotalSectors;
DISK_MIRROR DiskRaid1;
} DEVICE_RAID1, *PDEVICE_RAID1;
#define DISK_MIRROR_POSITION 0x01A8
#define SIGNATURE 0x55
#define MASK_SERIAL_NUMBER 0x0FFE // mask for serial number matching
#define MASK_SERIAL_UNIT 0x0001 // mask for unit portion of serial number
// Status bits
#define UCBF_MIRRORED 0x0010 // drive has a pair
#define UCBF_MATCHED 0x0020 // drive pair is matched
#define UCBF_SURVIVOR 0x0040 // this unit is a survivor of a pair
#define UCBF_REBUILD 0x0080 // rebuild in progress on this device
// SCSI controls for RAID
#define SC_MY_RAID 0xBF // our special CDB command byte for Win95... interface
#define MY_SCSI_QUERY1 0x32 // byte 1 subcommand to query driver for RAID 1 informatation
#define MY_SCSI_REBUILD 0x40 // byte 1 subcommand to reconstruct a mirrored pair
#define MY_SCSI_DEMOFAIL 0x54 // byte 1 subcommand for RAID failure demonstration
#define MY_SCSI_ALARMMUTE 0x60 // byte 1 subcommand to mute any alarm currently on
......@@ -40,7 +40,7 @@
#define MAXADAPTER 4 // Increase this and the sizes of the arrays below, if you need more.
#define MAX_BUS 2
#define MAX_UNITS 16
#define TIMEOUT_COMMAND 30 // number of jiffies for command busy timeout
#define TIMEOUT_COMMAND 400 // number of milliSecondos for command busy timeout
/************************************************/
/* I/O address offsets */
......@@ -64,6 +64,8 @@
#define CMD_WRITE_CHS_SG 0x08 /* write sectors using scatter/gather list (CHS mode) */
#define CMD_VERIFY_CHS 0x09 /* verify data on sectors as specified (CHS mode) */
#define CMD_VERIFY 0x0A /* verify data on sectors as specified (RBA mode) */
#define CMD_DASD_CDB 0x0B /* process CDB for a DASD device */
#define CMD_DASD_CDB_SG 0x0C /* process CDB for a DASD device with scatter/gather */
#define CMD_READ_ABS 0x10 /* read absolute disk */
#define CMD_WRITE_ABS 0x11 /* write absolute disk */
......@@ -80,9 +82,14 @@
#define CMD_SCSI_THRU_SG 0x31 /* SCSI pass through CDB with scatter/gather */
#define CMD_SCSI_REQ_SENSE 0x32 /* SCSI pass through request sense after check condition */
#define CMD_DASD_SCSI_INQ 0x36 /* to DASD inquire for DASD info in SCSI inquiry format */
#define CMD_DASD_RAID_RQ 0x35 /* request DASD RAID drive data */
#define CMD_DASD_RAID_RQ0 0x31 /* byte 1 subcommand to query for RAID 0 informatation */
#define CMD_DASD_RAID_RQ1 0x32 /* byte 1 subcommand to query for RAID 1 informatation */
#define CMD_DASD_RAID_RQ5 0x33 /* byte 1 subcommand to query for RAID 5 informatation */
#define CMD_DASD_SCSI_INQ 0x36 /* do DASD inquire and return in SCSI format */
#define CMD_DASD_CAP 0x37 /* read DASD capacity */
#define CMD_DASD_INQ 0x38 /* do DASD inquire for type data */
#define CMD_DASD_INQ 0x38 /* do DASD inquire for type data and return SCSI/EIDE inquiry */
#define CMD_SCSI_INQ 0x39 /* do SCSI inquire */
#define CMD_READ_SETUP 0x3A /* Get setup structures from controller */
#define CMD_WRITE_SETUP 0x3B /* Put setup structures in controller and burn in flash */
......@@ -121,6 +128,12 @@
#define CMD_RAID_STATUS 0x57 /* get status of RAID pair */
#define CMD_RAID_STOP 0x58 /* stop any reconstruct in progress */
#define CMD_RAID_START 0x59 /* start reconstruct */
#define CMD_RAID0_READ 0x5A /* read RAID 0 parameter block */
#define CMD_RAID0_WRITE 0x5B /* write RAID 0 parameter block */
#define CMD_RAID5_READ 0x5C /* read RAID 5 parameter block */
#define CMD_RAID5_WRITE 0x5D /* write RAID 5 parameter block */
#define CMD_ERASE_TABLES 0x5F /* erase partition table and RAID signatutures */
#define CMD_SCSI_GET 0x60 /* get SCSI pass through devices */
#define CMD_SCSI_TIMEOUT 0x61 /* set SCSI pass through timeout */
......@@ -223,13 +236,13 @@
/* Host Operating System specification codes */
/* */
/************************************************/
#define SPEC_INTERRUPT 0x80 /* specification requires host interrupt */
#define SPEC_BACKWARD_SG 0x40 /* specification requires scatter/gather items reversed */
#define SPEC_DOS_BLOCK 0x01 /* DOS DASD blocking on pass through */
#define SPEC_OS2_V3 0x02 /* OS/2 Warp */
#define SPCE_SCO_3242 0x04 /* SCO 3.4.2.2 */
#define SPEC_QNX_4X 0x05 /* QNX 4.XX */
#define SPEC_NOVELL_NWPA 0x08 /* Novell NWPA scatter/gather support */
/************************************************/
/* */
......@@ -310,5 +323,15 @@ typedef struct _DASD_INQUIRE
#define DEVC_DASD_REMOVABLE 0x80 /* Direct-access storage device, Removable */
#define DEVC_NONE 0xFF /* no device */
// SCSI controls for RAID
#define SC_MY_RAID 0xBF // our special CDB command byte for Win95... interface
#define MY_SCSI_QUERY0 0x31 // byte 1 subcommand to query driver for RAID 0 informatation
#define MY_SCSI_QUERY1 0x32 // byte 1 subcommand to query driver for RAID 1 informatation
#define MY_SCSI_QUERY5 0x33 // byte 1 subcommand to query driver for RAID 5 informatation
#define MY_SCSI_REBUILD 0x40 // byte 1 subcommand to reconstruct a mirrored pair
#define MY_SCSI_DEMOFAIL 0x54 // byte 1 subcommand for RAID failure demonstration
#define MY_SCSI_ALARMMUTE 0x60 // byte 1 subcommand to mute any alarm currently on
#endif
......@@ -206,7 +206,7 @@ do_aout_core_dump(long signr, struct pt_regs * regs)
set_fs(KERNEL_DS);
DUMP_WRITE(current,sizeof(*current));
close_coredump:
close_fp(file, NULL);
filp_close(file, NULL);
end_coredump:
set_fs(fs);
return has_dumped;
......@@ -318,6 +318,8 @@ static inline int do_load_aout_binary(struct linux_binprm * bprm, struct pt_regs
}
if (N_MAGIC(ex) == ZMAGIC && ex.a_text &&
bprm->dentry->d_inode->i_op &&
bprm->dentry->d_inode->i_op->bmap &&
(fd_offset < bprm->dentry->d_inode->i_sb->s_blocksize)) {
printk(KERN_NOTICE "N_TXTOFF < BLOCK_SIZE. Please convert binary.\n");
return -ENOEXEC;
......
......@@ -1324,7 +1324,7 @@ static int elf_core_dump(long signr, struct pt_regs * regs)
}
close_coredump:
close_fp(file, NULL);
filp_close(file, NULL);
end_coredump:
set_fs(fs);
......
......@@ -759,7 +759,7 @@ int bmap(struct inode * inode, int block)
* Initialize the hash tables and default
* value for max inodes
*/
#define MAX_INODE (8192)
#define MAX_INODE (12288)
void __init inode_init(void)
{
......
......@@ -776,7 +776,7 @@ void __fput(struct file *filp)
* "id" is the POSIX thread ID. We use the
* files pointer for this..
*/
int close_fp(struct file *filp, fl_owner_t id)
int filp_close(struct file *filp, fl_owner_t id)
{
int retval;
struct dentry *dentry = filp->f_dentry;
......@@ -812,7 +812,7 @@ asmlinkage int sys_close(unsigned int fd)
files->fd[fd] = NULL;
put_unused_fd(fd);
FD_CLR(fd, &files->close_on_exec);
error = close_fp(filp, files);
error = filp_close(filp, files);
}
unlock_kernel();
return error;
......
......@@ -576,7 +576,7 @@ int sysv_link(struct dentry * old_dentry, struct inode * dir,
oldinode->i_nlink++;
oldinode->i_ctime = CURRENT_TIME;
mark_inode_dirty(oldinode);
inode->i_count++;
oldinode->i_count++;
d_instantiate(dentry, oldinode);
return 0;
}
......
......@@ -141,8 +141,8 @@ extern inline int down_trylock(struct semaphore * sem)
" subq %1,1,%1\n"
" blt %2,2f\n"
" blt %1,2f\n"
" ldah %1,0x8000(%1)\n"
" ldah %1,0x8000(%1)\n"
" ldah %1,-32768(%1)\n"
" ldah %1,-32768(%1)\n"
" lda %0,1\n"
" stq_c %1,%3\n"
" beq %1,3f\n"
......
......@@ -11,6 +11,8 @@
#define GSI_UACPROC 8
#define GSI_IEEE_FP_CONTROL 45
#define GSI_IEEE_STATE_AT_SIGNAL 46
#define GSI_PROC_TYPE 60
#define GSI_GET_HWRPB 101
#define SSI_NVPAIRS 1
#define SSI_IEEE_FP_CONTROL 14
......
......@@ -112,7 +112,7 @@ do { unsigned long flags; \
_do_read_unlock(lock, "read_unlock"); \
__restore_flags(flags); \
} while(0)
#define read_unlock_irq(lock) do { _do_read_unlock(lock, "read_unlock_irq"); __sti() } while(0)
#define read_unlock_irq(lock) do { _do_read_unlock(lock, "read_unlock_irq"); __sti(); } while(0)
#define read_unlock_irqrestore(lock, flags) do { _do_read_unlock(lock, "read_unlock_irqrestore"); __restore_flags(flags); } while(0)
#define write_lock(lock) \
......
......@@ -695,8 +695,9 @@ asmlinkage int sys_close(unsigned int); /* yes, it's really unsigned */
extern int do_truncate(struct dentry *, unsigned long);
extern int get_unused_fd(void);
extern void put_unused_fd(unsigned int);
extern int close_fp(struct file *, fl_owner_t id);
extern struct file *filp_open(const char *, int, int);
extern int filp_close(struct file *, fl_owner_t id);
extern char * getname(const char * filename);
#define __getname() ((char *) __get_free_page(GFP_KERNEL))
......
......@@ -55,7 +55,7 @@ extern __inline__ int DQUOT_PREALLOC_BLOCK(struct super_block *sb, const struct
{
if (sb->dq_op) {
if (sb->dq_op->alloc_block(inode, fs_to_dq_blocks(nr, sb->s_blocksize),
current->euid, 0) == NO_QUOTA)
current->fsuid, 0) == NO_QUOTA)
return 1;
}
return 0;
......@@ -65,7 +65,7 @@ extern __inline__ int DQUOT_ALLOC_BLOCK(struct super_block *sb, const struct ino
{
if (sb->dq_op) {
if (sb->dq_op->alloc_block(inode, fs_to_dq_blocks(nr, sb->s_blocksize),
current->euid, 1) == NO_QUOTA)
current->fsuid, 1) == NO_QUOTA)
return 1;
}
return 0;
......@@ -75,7 +75,7 @@ extern __inline__ int DQUOT_ALLOC_INODE(struct super_block *sb, struct inode *in
{
if (sb->dq_op) {
sb->dq_op->initialize (inode, -1);
if (sb->dq_op->alloc_inode (inode, 1, current->euid))
if (sb->dq_op->alloc_inode (inode, 1, current->fsuid))
return 1;
}
inode->i_flags |= S_QUOTA;
......@@ -101,11 +101,11 @@ extern __inline__ int DQUOT_TRANSFER(struct dentry *dentry, struct iattr *iattr)
if (dentry->d_inode->i_sb->dq_op) {
if (IS_QUOTAINIT(dentry->d_inode) == 0)
dentry->d_inode->i_sb->dq_op->initialize(dentry->d_inode, -1);
if (dentry->d_inode->i_sb->dq_op->transfer(dentry->d_inode, iattr, 0, current->euid))
if (dentry->d_inode->i_sb->dq_op->transfer(dentry->d_inode, iattr, 0, current->fsuid))
goto out;
error = notify_change(dentry, iattr);
if (error)
dentry->d_inode->i_sb->dq_op->transfer(dentry->d_inode, iattr, 1, current->euid);
dentry->d_inode->i_sb->dq_op->transfer(dentry->d_inode, iattr, 1, current->fsuid);
} else {
error = notify_change(dentry, iattr);
}
......
......@@ -59,7 +59,7 @@ extern task_queue tq_timer, tq_immediate, tq_scheduler, tq_disk;
*
* struct tq_struct *my_bh = NULL;
* struct tq_struct run_my_bh = {
* 0, 0, (void *)(void *) run_task_queue, &my_bh
* 0, 0, (void (*)(void *)) run_task_queue, &my_bh
* };
*
* To activate a bottom half on your list, use:
......
......@@ -194,13 +194,13 @@ asmlinkage int sys_acct(const char *name)
}
if (old_acct) {
do_acct_process(0,old_acct);
fput(old_acct);
filp_close(old_acct);
}
out:
unlock_kernel();
return error;
out_err:
fput(file);
filp_close(file);
goto out;
}
......
......@@ -169,7 +169,7 @@ static inline void close_files(struct files_struct * files)
struct file * file = files->fd[i];
if (file) {
files->fd[i] = NULL;
close_fp(file, files);
filp_close(file, files);
}
}
i++;
......
......@@ -136,6 +136,7 @@ EXPORT_SYMBOL(__mark_inode_dirty);
EXPORT_SYMBOL(get_empty_filp);
EXPORT_SYMBOL(init_private_file);
EXPORT_SYMBOL(filp_open);
EXPORT_SYMBOL(filp_close);
EXPORT_SYMBOL(fput);
EXPORT_SYMBOL(put_filp);
EXPORT_SYMBOL(check_disk_change);
......
......@@ -1326,7 +1326,8 @@ int generic_file_mmap(struct file * file, struct vm_area_struct * vma)
return -EINVAL;
} else {
ops = &file_private_mmap;
if (vma->vm_offset & (inode->i_sb->s_blocksize - 1))
if (inode->i_op && inode->i_op->bmap &&
(vma->vm_offset & (inode->i_sb->s_blocksize - 1)))
return -EINVAL;
}
if (!inode->i_sb || !S_ISREG(inode->i_mode))
......
......@@ -63,6 +63,8 @@ endif
ifeq ($(CONFIG_IPX),y)
SUB_DIRS += ipx
# SPX can be still a module
MOD_SUB_DIRS += ipx
else
ifeq ($(CONFIG_IPX),m)
MOD_SUB_DIRS += ipx
......
......@@ -5,7 +5,7 @@
*
* ROUTE - implementation of the IP router.
*
* Version: $Id: route.c,v 1.63 1999/03/21 05:22:45 davem Exp $
* Version: $Id: route.c,v 1.64 1999/03/23 21:21:13 davem Exp $
*
* Authors: Ross Biro, <bir7@leland.Stanford.Edu>
* Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
......@@ -1187,7 +1187,7 @@ int ip_route_input_slow(struct sk_buff *skb, u32 daddr, u32 saddr,
if (err)
flags |= RTCF_DIRECTSRC;
if (out_dev == in_dev && err && !(flags&RTCF_NAT) &&
if (out_dev == in_dev && err && !(flags&(RTCF_NAT|RTCF_MASQ)) &&
(IN_DEV_SHARED_MEDIA(out_dev)
|| inet_addr_onlink(out_dev, saddr, FIB_RES_GW(res))))
flags |= RTCF_DOREDIRECT;
......
......@@ -5,7 +5,7 @@
*
* Implementation of the Transmission Control Protocol(TCP).
*
* Version: $Id: tcp_timer.c,v 1.58 1999/03/14 19:48:30 davem Exp $
* Version: $Id: tcp_timer.c,v 1.59 1999/03/23 21:21:09 davem Exp $
*
* Authors: Ross Biro, <bir7@leland.Stanford.Edu>
* Fred N. van Kempen, <waltje@uWalt.NL.Mugnet.ORG>
......@@ -403,7 +403,7 @@ static void tcp_keepalive(unsigned long data)
for(i = chain_start; i < (chain_start + ((TCP_HTABLE_SIZE/2) >> 2)); i++) {
struct sock *sk = tcp_established_hash[i];
while(sk) {
if(sk->keepopen) {
if(!atomic_read(&sk->sock_readers) && sk->keepopen) {
count += tcp_keepopen_proc(sk);
if(count == sysctl_tcp_max_ka_probes)
goto out;
......
......@@ -10,8 +10,12 @@
# We only get in/to here if CONFIG_IPX = 'y' or 'm'
O_TARGET := ipx.o
M_OBJS := $(O_TARGET)
OX_OBJS += af_ipx.o
M_OBJS :=
OX_OBJS := af_ipx.o
ifeq ($(CONFIG_IPX),m)
M_OBJS += $(O_TARGET)
endif
ifeq ($(CONFIG_SYSCTL),y)
O_OBJS += sysctl_net_ipx.o
......
......@@ -12,6 +12,7 @@
#include <linux/net.h>
#include <linux/in.h>
#include <linux/netdevice.h>
#include <linux/inetdevice.h>
#include <linux/fddidevice.h>
#include <linux/trdevice.h>
#include <linux/ioport.h>
......@@ -239,6 +240,10 @@ EXPORT_SYMBOL(inet_dgram_ops);
EXPORT_SYMBOL(ip_cmsg_recv);
EXPORT_SYMBOL(__release_sock);
/* Route manipulation */
EXPORT_SYMBOL(ip_rt_ioctl);
EXPORT_SYMBOL(devinet_ioctl);
/* needed for ip_gre -cw */
EXPORT_SYMBOL(ip_statistics);
......@@ -435,6 +440,7 @@ EXPORT_SYMBOL(dev_get_by_index);
EXPORT_SYMBOL(eth_type_trans);
#ifdef CONFIG_FDDI
EXPORT_SYMBOL(fddi_type_trans);
EXPORT_SYMBOL(fddi_setup);
#endif /* CONFIG_FDDI */
EXPORT_SYMBOL(eth_copy_and_sum);
EXPORT_SYMBOL(alloc_skb);
......
......@@ -175,6 +175,7 @@ rpcauth_lookup_credcache(struct rpc_task *task)
if (!cred)
cred = auth->au_ops->crcreate(task);
if (cred)
rpcauth_insert_credcache(auth, cred);
return (struct rpc_cred *) cred;
......
......@@ -49,8 +49,11 @@ nul_create_cred(struct rpc_task *task)
{
struct rpc_cred *cred;
if (!(cred = (struct rpc_cred *) rpc_malloc(task, sizeof(*cred))))
if (!(cred = (struct rpc_cred *) rpc_malloc(task, sizeof(*cred)))) {
task->tk_status = -ENOMEM;
return NULL;
}
cred->cr_count = 0;
cred->cr_flags = RPCAUTH_CRED_UPTODATE;
......
......@@ -68,8 +68,10 @@ unx_create_cred(struct rpc_task *task)
dprintk("RPC: allocating UNIX cred for uid %d gid %d\n",
current->uid, current->gid);
if (!(cred = (struct unx_cred *) rpc_malloc(task, sizeof(*cred))))
if (!(cred = (struct unx_cred *) rpc_malloc(task, sizeof(*cred)))) {
task->tk_status = -ENOMEM;
return NULL;
}
cred->uc_count = 0;
cred->uc_flags = RPCAUTH_CRED_UPTODATE;
......
......@@ -1197,7 +1197,7 @@ xprt_request_init(struct rpc_task *task, struct rpc_xprt *xprt)
static u32 xid = 0;
if (!xid)
xid = jiffies;
xid = CURRENT_TIME << 12;
dprintk("RPC: %4d reserved req %p xid %08x\n", task->tk_pid, req, xid);
task->tk_status = 0;
......@@ -1206,6 +1206,8 @@ xprt_request_init(struct rpc_task *task, struct rpc_xprt *xprt)
req->rq_task = task;
req->rq_xprt = xprt;
req->rq_xid = xid++;
if (!xid)
xid++;
}
/*
......
......@@ -49,8 +49,8 @@
* such socket and closed it (descriptor). That would happen on
* each unix_gc() until the accept(). Since the struct file in
* question would go to the free list and might be reused...
* That might be the reason of random oopses on close_fp() in
* unrelated processes.
* That might be the reason of random oopses on filp_close()
* in unrelated processes.
*
* AV 28 Feb 1999
* Kill the explicit allocation of stack. Now we keep the tree
......
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