Commit 69651a92 authored by Linus Torvalds's avatar Linus Torvalds

Import 1.1.48

parent 74beaae0
......@@ -228,6 +228,13 @@ S: West Hanningfield Road
S: Great Baddow, Essex CM2 8HN
S: UK
N: Michael Hipp
E: mhipp@student.uni-tuebingen.de
D: drivers for the racal ni5210 & ni6510 ethernet-boards
S: Talstr. 1
S: D - 72072 Tuebingen
S: Germany
N: Dirk Hohndel
E: hohndel@informatik.uni-wuerzburg.de
D: XFree86
......
VERSION = 1
PATCHLEVEL = 1
SUBLEVEL = 47
SUBLEVEL = 48
ARCH = i386
......@@ -110,7 +110,10 @@ boot:
include/asm:
( cd include ; ln -sf asm-$(ARCH) asm)
symlinks: boot include/asm
kernel/entry.S:
ln -sf ../arch/$(ARCH)/entry.S kernel/entry.S
symlinks: boot include/asm kernel/entry.S
config.in: arch/$(ARCH)/config.in
cp $< $@
......@@ -183,7 +186,7 @@ mrproper: clean
rm -f include/linux/autoconf.h tools/version.h
rm -f drivers/sound/local.h
rm -f .version .config* config.in config.old
rm -f boot include/asm
rm -f boot include/asm kernel/entry.S
rm -f .depend `find . -name .depend -print`
distclean: mrproper
......
......@@ -108,6 +108,8 @@ if [ "$CONFIG_NET_ISA" = "y" ]; then
if [ "$CONFIG_NET_ALPHA" = "y" ]; then
bool 'EtherExpress support' CONFIG_EEXPRESS n
bool 'AT1700 support' CONFIG_AT1700 n
bool 'NI5210 support' CONFIG_NI52 n
bool 'NI6510 support' CONFIG_NI65 n
fi
bool 'HP PCLAN support' CONFIG_HPLAN n
bool 'NE2000/NE1000 support' CONFIG_NE2000 y
......@@ -118,8 +120,6 @@ bool 'EISA and on board controllers' CONFIG_NET_EISA n
bool 'Ansel Communications EISA 3200 support' CONFIG_AC3200 n
fi
bool 'Apricot Xen-II on board ethernet' CONFIG_APRICOT n
#bool 'NI52EE support' CONFIG_NI52 n
#bool 'NI65EE support' CONFIG_NI65 n
bool 'Pocket and portable adaptors' CONFIG_NET_POCKET n
if [ "$CONFIG_NET_POCKET" = "y" ]; then
bool 'D-Link DE600 pocket adaptor support' CONFIG_DE600 n
......
This diff is collapsed.
......@@ -2035,7 +2035,7 @@ cdu31a_init(unsigned long mem_start, unsigned long mem_end)
dma_channel = cdu31a_addresses[i].dma_num;
if (dma_channel > 0)
{
if (request_dma(dma_channel))
if (request_dma(dma_channel,"cdu31a"))
{
dma_channel = -1;
printk("Unable to grab DMA%d for the CDU31A driver\n",
......
......@@ -280,8 +280,8 @@ static struct floppy_struct floppy_type[32] = {
{ 3486,21,2,83,0,0x25,0x00,0xDF,0x0C,"H1743" }, /* 19 1.74 MB 3.5" */
{ 1760,11,2,80,0,0x1C,0x09,0xCF,0x6C,"d880" }, /* 20 880KB 5.25" */
{ 2080,13,2,80,0,0x1C,0x0A,0xCF,0x6C,"D1040" }, /* 21 1.04MB 3.5" */
{ 2240,14,2,80,0,0x1C,0x1A,0xCF,0x6C,"D1120" }, /* 22 1.12MB 3.5" */
{ 2080,13,2,80,0,0x1C,0x01,0xCF,0x6C,"D1040" }, /* 21 1.04MB 3.5" */
{ 2240,14,2,80,0,0x1C,0x19,0xCF,0x6C,"D1120" }, /* 22 1.12MB 3.5" */
{ 3200,20,2,80,0,0x1C,0x20,0xCF,0x6C,"h1600" }, /* 23 1.6MB 5.25" */
{ 3520,22,2,80,0,0x1C,0x08,0xCF,0x6C,"H1760" }, /* 24 1.76MB 3.5" */
{ 3840,24,2,80,0,0x1C,0x18,0xCF,0x6C,"H1920" }, /* 25 1.92MB 3.5" */
......@@ -290,7 +290,7 @@ static struct floppy_struct floppy_type[32] = {
{ 7680,48,2,80,0,0x25,0x63,0xCF,0x6C,"E3840" }, /* 28 3.84MB 3.5" */
{ 3680,23,2,80,0,0x1C,0x10,0xCF,0x6C,"H1840" }, /* 29 1.84MB 3.5" */
{ 1600,10,2,80,0,0x25,0x02,0xDF,0x2E,"H800" }, /* 30 800KB 3.5" */
{ 1600,10,2,80,0,0x25,0x02,0xDF,0x2E,"D800" }, /* 30 800KB 3.5" */
{ 3200,20,2,80,0,0x1C,0x00,0xCF,0x6C,"H1600" }, /* 31 1.6MB 3.5" */
};
......@@ -2923,7 +2923,8 @@ void floppy_init(void)
#if N_FDC > 1
fdc_state[1].address = 0x370;
#endif
for(fdc = 0 ; fdc < N_FDC; fdc++){
for (i = 0 ; i < N_FDC ; i++) {
fdc = i;
FDCS->dtr = -1;
FDCS->dor = 0;
FDCS->reset = 0;
......@@ -2932,8 +2933,9 @@ void floppy_init(void)
}
/* initialise drive state */
for ( current_drive=0; current_drive < N_DRIVE ; current_drive++){
DRS->flags = 0;
for (i = 0; i < N_DRIVE ; i++) {
current_drive = i;
DRS->flags = FD_VERIFY;
DRS->generation = 0;
DRS->keep_data = 0;
DRS->fd_ref = 0;
......@@ -2941,7 +2943,8 @@ void floppy_init(void)
}
floppy_grab_irq_and_dma();
for(fdc = 0 ; fdc < N_FDC; fdc++){
for (i = 0 ; i < N_FDC ; i++) {
fdc = i;
FDCS->rawcmd = 2;
if(user_reset_fdc(-1,FD_RESET_IF_NEEDED))
continue;
......@@ -2980,7 +2983,7 @@ int floppy_grab_irq_and_dma(void)
FLOPPY_IRQ);
return -1;
}
if (request_dma(FLOPPY_DMA)) {
if (request_dma(FLOPPY_DMA,"floppy")) {
printk(DEVICE_NAME
": Unable to grab DMA%d for the floppy driver\n",
FLOPPY_DMA);
......
......@@ -35,6 +35,7 @@
#include <linux/genhd.h>
#include <linux/config.h>
#include <linux/malloc.h>
#include <linux/string.h>
#define REALLY_SLOW_IO
#include <asm/system.h>
......@@ -234,16 +235,39 @@ static unsigned int mult_req [MAX_HD] = {0,}; /* requested MultMode count
static unsigned int mult_count [MAX_HD] = {0,}; /* currently enabled MultMode count */
static struct request WCURRENT;
static void rawstring (char *prefix, unsigned char *s, int n)
static void fixstring(unsigned char *s, int n)
{
if (prefix)
printk(prefix);
if (s && *s) {
int i;
for (i=0; i < n && s[i^1] == ' '; ++i); /* skip blanks */
for (; i < n && s[i^1]; ++i) /* flip bytes */
if (s[i^1] != ' ' || ((i+1) < n && s[(i+1)^1] != ' '))
printk("%c",s[i^1]);
int i;
unsigned short *ss = (unsigned short *) s;
/* convert from big-endian to little-endian */
for (i = n ; (i -= 2) >= 0 ; ss++)
*ss = (*ss >> 8) | (*ss << 8);
/* "strnlen()" */
for (i = 0 ; i < n ; i++) {
if (!s[i]) {
n = i;
break;
}
}
/* wipe out trailing spaces */
while (n > 0) {
if (s[n-1] != ' ')
break;
n--;
s[n] = '\0';
}
/* wipe out leading spaces */
if (*s == ' ') {
unsigned char *t = s;
while (n-- && *++s == ' ');
while (n-- >= 0) {
*t++ = *s;
*s++ = '\0';
}
}
}
......@@ -272,15 +296,21 @@ static void identify_intr(void)
hd_info[dev].head = id.cur_heads;
hd_info[dev].sect = id.cur_sectors;
}
printk (" hd%c: ", dev+'a');
rawstring(NULL, id.model, sizeof(id.model));
printk (", %dMB w/%dKB Cache, CHS=%d/%d/%d, MaxMult=%d\n",
id.cyls*id.heads*id.sectors/2048, id.buf_size/2,
hd_info[dev].cyl, hd_info[dev].head, hd_info[dev].sect, id.max_multsect);
fixstring (id.serial_no, sizeof(id.serial_no));
fixstring (id.fw_rev, sizeof(id.fw_rev));
fixstring (id.model, sizeof(id.model));
printk (" hd%c: %.40s, %dMB w/%dKB Cache, CHS=%d/%d/%d, MaxMult=%d\n",
dev+'a', id.model, id.cyls*id.heads*id.sectors/2048,
id.buf_size/2, hd_info[dev].cyl, hd_info[dev].head,
hd_info[dev].sect, id.max_multsect);
/* save drive info for later query via HDIO_GETIDENTITY */
if (NULL != (hd_ident_info[dev] = (struct hd_driveid *)kmalloc(sizeof(id),GFP_ATOMIC)))
*hd_ident_info[dev] = id;
/* Quantum drives go weird at this point, so reset them! In */
/* fact, do a reset in any case in case we changed the geometry */
special_op[dev] += reset = 1;
/* flush remaining 384 (reserved/undefined) ID bytes: */
insw(HD_DATA,(char *)&id,sizeof(id)/2);
insw(HD_DATA,(char *)&id,sizeof(id)/2);
......@@ -335,7 +365,6 @@ static void reset_controller(void)
{
int i;
printk(KERN_DEBUG "HD-controller reset\n");
outb_p(4,HD_CMD);
for(i = 0; i < 1000; i++) nop();
outb(hd_info[0].ctl & 0x0f ,HD_CMD);
......@@ -361,12 +390,15 @@ static void reset_hd(void)
}
if (++i < NR_HD) {
if (unmask_intr[i]) {
printk("hd%c: disabled irq-unmasking\n",i+'a');
unmask_intr[i] = 0;
unmask_intr[i] = DEFAULT_UNMASK_INTR;
printk("hd%c: reset irq-unmasking to %d\n",i+'a',
DEFAULT_UNMASK_INTR);
}
if (mult_req[i] || mult_count[i]) {
printk("hd%c: disabled multiple mode\n",i+'a');
mult_req[i] = mult_count[i] = 0;
mult_count[i] = 0;
mult_req[i] = DEFAULT_MULT_COUNT;
printk("hd%c: reset multiple mode to %d\n",i+'a',
DEFAULT_MULT_COUNT);
}
hd_out(i,hd_info[i].sect,hd_info[i].sect,hd_info[i].head-1,
hd_info[i].cyl,WIN_SPECIFY,&reset_hd);
......@@ -399,7 +431,7 @@ static void bad_rw_intr(void)
if (!CURRENT)
return;
dev = MINOR(CURRENT->dev) >> 6;
dev = DEVICE_NR(CURRENT->dev);
if (++CURRENT->errors >= MAX_ERRORS || (hd_error & BBD_ERR)) {
end_request(0);
special_op[dev] += recalibrate[dev] = 1;
......@@ -607,10 +639,9 @@ static void hd_times_out(void)
{
DEVICE_INTR = NULL;
sti();
reset = 1;
if (!CURRENT)
return;
special_op [DEVICE_NR(CURRENT->dev)] ++;
special_op [DEVICE_NR(CURRENT->dev)] += reset = 1;
printk(KERN_DEBUG "HD timeout\n");
cli();
if (++CURRENT->errors >= MAX_ERRORS) {
......@@ -761,7 +792,7 @@ static int hd_ioctl(struct inode * inode, struct file * file,
if ((!inode) || (!inode->i_rdev))
return -EINVAL;
dev = MINOR(inode->i_rdev) >> 6;
dev = DEVICE_NR(inode->i_rdev);
if (dev >= NR_HD)
return -EINVAL;
switch (cmd) {
......@@ -877,7 +908,7 @@ static int hd_ioctl(struct inode * inode, struct file * file,
static int hd_open(struct inode * inode, struct file * filp)
{
int target;
target = DEVICE_NR(MINOR(inode->i_rdev));
target = DEVICE_NR(inode->i_rdev);
while (busy[target])
sleep_on(&busy_wait);
......@@ -894,7 +925,7 @@ static void hd_release(struct inode * inode, struct file * file)
int target;
sync_dev(inode->i_rdev);
target = DEVICE_NR(MINOR(inode->i_rdev));
target = DEVICE_NR(inode->i_rdev);
access_count[target]--;
}
......@@ -1073,7 +1104,7 @@ static int revalidate_hddisk(int dev, int maxusage)
int i;
long flags;
target = DEVICE_NR(MINOR(dev));
target = DEVICE_NR(dev);
gdev = &GENDISK_STRUCT;
save_flags(flags);
......
......@@ -189,6 +189,7 @@ void rd_load(void)
printk("Unable to grab floppy IRQ/DMA for loading ramdisk image\n");
return;
}
check_disk_change(ROOT_DEV);
do_load();
floppy_release_irq_and_dma();
}
......@@ -167,7 +167,7 @@ static void xd_geninit (void)
printk("xd_geninit: drive %d geometry - heads = %d, cylinders = %d, sectors = %d\n",i,xd_info[i].heads,xd_info[i].cylinders,xd_info[i].sectors);
if (!request_irq(xd_irq,xd_interrupt_handler, 0, "XT harddisk")) {
if (request_dma(xd_dma)) {
if (request_dma(xd_dma,"xd")) {
printk("xd_geninit: unable to get DMA%d\n",xd_dma);
free_irq(xd_irq);
}
......
......@@ -2840,7 +2840,7 @@ static int qic02_get_resources(void)
}
/* After IRQ, allocate DMA channel */
if (request_dma(QIC02_TAPE_DMA)) {
if (request_dma(QIC02_TAPE_DMA,"QIC-02")) {
printk(TPQIC02_NAME ": can't allocate DMA%d for QIC-02 tape\n",
QIC02_TAPE_DMA);
free_irq(QIC02_TAPE_IRQ);
......
......@@ -371,7 +371,7 @@ lance_open(struct device *dev)
return -EAGAIN;
}
if (request_dma(dev->dma)) {
if (request_dma(dev->dma,"lance")) {
free_irq(dev->irq);
return -EAGAIN;
}
......
......@@ -101,7 +101,7 @@ init_etherdev(struct device *dev, int sizeof_private, unsigned long *mem_startp)
*mem_startp += alloc_size;
} else
dev = (struct device *)kmalloc(alloc_size, GFP_KERNEL);
memset(dev, 0, sizeof(alloc_size));
memset(dev, 0, alloc_size);
if (sizeof_private)
dev->priv = (void *) (dev + 1);
dev->name = sizeof_private + (char *)(dev + 1);
......
This diff is collapsed.
/*
* Intel i82586 Ethernet definitions
*
* This is an extension to the Linux operating system, and is covered by the
* same Gnu Public License that covers that work.
*
* copyrights (c) 1994 by Michael Hipp (mhipp@student.uni-tuebingen.de)
*
* I have done a look in the following sources:
* crynwr-packet-driver by Russ Nelson
* Garret A. Wollman's i82586-driver for BSD
*/
#define NI52_RESET 0 /* writing to this address, resets the i82586 */
#define NI52_ATTENTION 1 /* channel attention, kick the 586 */
#define NI52_TENA 3 /* 2-5 possibly wrong, Xmit enable */
#define NI52_TDIS 2 /* Xmit disable */
#define NI52_INTENA 5 /* Interrupt enable */
#define NI52_INTDIS 4 /* Interrupt disable */
#define NI52_MAGIC1 6 /* dunno exact function */
#define NI52_MAGIC2 7 /* dunno exact function */
#define NI52_MAGICVAL1 0x00 /* magic-values for ni5210 card */
#define NI52_MAGICVAL2 0x55
/*
* where to find the System Configuration Pointer (SCP)
*/
#define SCP_DEFAULT_ADDRESS 0xfffff4
/*
* System Configuration Pointer Struct
*/
struct scp_struct
{
unsigned short zero_dum0; /* has to be zero */
unsigned char sysbus; /* 0=16Bit,1=8Bit */
unsigned char zero_dum1; /* has to be zero for 586 */
unsigned short zero_dum2;
unsigned short zero_dum3;
char *iscp; /* pointer to the iscp-block */
};
/*
* Intermediate System Configuration Pointer (ISCP)
*/
struct iscp_struct
{
unsigned char busy; /* 586 clears after succesful init */
unsigned char zero_dummy; /* hast to be zero */
unsigned short scb_offset; /* pointeroffset to the scb_base */
char *scb_base; /* base-address of all 16-bit offsets */
};
/*
* System Control Block (SCB)
*/
struct scb_struct
{
unsigned short status; /* status word */
unsigned short cmd; /* command word */
unsigned short cbl_offset; /* pointeroffset, command block list */
unsigned short rfa_offset; /* pointeroffset, receive frame area */
unsigned short crc_errs; /* CRC-Error counter */
unsigned short aln_errs; /* allignmenterror counter */
unsigned short rsc_errs; /* Resourceerror counter */
unsigned short ovrn_errs; /* OVerrunerror counter */
};
/*
* possbile command values for the command word
*/
#define RUC_MASK 0x0070 /* mask for RU commands */
#define RUC_NOP 0x0000 /* NOP-command */
#define RUC_START 0x0010 /* start RU */
#define RUC_RESUME 0x0020 /* resume RU after suspend */
#define RUC_SUSPEND 0x0030 /* suspend RU */
#define RUC_ABORT 0x0040 /* abort receiver operation immediately */
#define CUC_MASK 0x0700 /* mask for CU command */
#define CUC_NOP 0x0000 /* NOP-command */
#define CUC_START 0x0100 /* start execution of 1. cmd on the CBL */
#define CUC_RESUME 0x0200 /* resume after suspend */
#define CUC_SUSPEND 0x0300 /* Suspend CU */
#define CUC_ABORT 0x0400 /* abort command operation immediately */
#define ACK_MASK 0xf000 /* mask for ACK command */
#define ACK_CX 0x8000 /* acknowledges STAT_CX */
#define ACK_FR 0x4000 /* ack. STAT_FR */
#define ACK_CNA 0x2000 /* ack. STAT_CNA */
#define ACK_RNR 0x1000 /* ack. STAT_RNR */
/*
* possbile status values for the status word
*/
#define STAT_MASK 0xf000 /* mask for cause of interrupt */
#define STAT_CX 0x8000 /* CU finished cmd with its I bit set */
#define STAT_FR 0x4000 /* RU finished receiveing a frame */
#define STAT_CNA 0x2000 /* CU left active state */
#define STAT_RNR 0x1000 /* RU left ready state */
#define CU_STATUS 0x700 /* CU status, 0=idle */
#define CU_SUSPEND 0x100 /* CU is suspended */
#define CU_ACTIVE 0x200 /* CU is active */
#define RU_STATUS 0x70 /* RU status, 0=idle */
#define RU_SUSPEND 0x10 /* RU suspended */
#define RU_NOSPACE 0x20 /* RU no resources */
#define RU_READY 0x40 /* RU is ready */
/*
* Receive Frame Descriptor (RFD)
*/
struct rfd_struct
{
unsigned short status; /* status word */
unsigned short last; /* Bit15,Last Frame on List / Bit14,suspend */
unsigned short next; /* linkoffset to next RFD */
unsigned short rbd_offset; /* pointeroffset to RBD-buffer */
unsigned char dest[6]; /* ethernet-address, destination */
unsigned char source[6]; /* ethernet-address, source */
unsigned short length; /* 802.3 frame-length */
unsigned short zero_dummy; /* dummy */
};
#define RFD_LAST 0x8000 /* last: last rfd in the list */
#define RFD_SUSP 0x4000 /* last: suspend RU after */
#define RFD_ERRMASK 0x0fe1 /* status: errormask */
#define RFD_MATCHADD 0x0002 /* status: Destinationaddress !matchs IA */
#define RFD_RNR 0x0200 /* status: receiver out of resources */
/*
* Receive Buffer Descriptor (RBD)
*/
struct rbd_struct
{
unsigned short status; /* status word,number of used bytes in buff */
unsigned short next; /* pointeroffset to next RBD */
char *buffer; /* recevie buffer address pointer */
unsigned short size; /* size of this buffer */
unsigned short zero_dummy; /* dummy */
};
#define RBD_LAST 0x8000 /* last buffer */
#define RBD_USED 0x4000 /* this buffer has data */
#define RBD_MASK 0x3fff /* size-mask for length */
/*
* Statusvalues for Commands/RFD
*/
#define STAT_COMPL 0x8000 /* status: frame/command is complete */
#define STAT_BUSY 0x4000 /* status: frame/command is busy */
#define STAT_OK 0x2000 /* status: frame/command is ok */
/*
* Action-Commands
*/
#define CMD_NOP 0x0000 /* NOP */
#define CMD_IASETUP 0x0001 /* initial address setup command */
#define CMD_CONFIGURE 0x0002 /* configure command */
#define CMD_MCSETUP 0x0003 /* MC setup command */
#define CMD_XMIT 0x0004 /* transmit command */
#define CMD_TDR 0x0005 /* time domain reflectometer (TDR) command */
#define CMD_DUMP 0x0006 /* dump command */
#define CMD_DIAGNOSE 0x0007 /* diagnose command */
/*
* Action command bits
*/
#define CMD_LAST 0x8000 /* indicates last command in the CBL */
#define CMD_SUSPEND 0x4000 /* suspend CU after this CB */
#define CMD_INT 0x2000 /* generate interrupt after execution */
/*
* NOP - command
*/
struct nop_cmd_struct
{
unsigned short cmd_status; /* statius of this command */
unsigned short cmd_cmd; /* the command itself (+bits) */
unsigned short cmd_link; /* offsetpointer to next command */
};
/*
* IA Setup command
*/
struct iasetup_cmd_struct
{
unsigned short cmd_status;
unsigned short cmd_cmd;
unsigned short cmd_link;
unsigned char iaddr[6];
};
/*
* Configure command
*/
struct configure_cmd_struct
{
unsigned short cmd_status;
unsigned short cmd_cmd;
unsigned short cmd_link;
unsigned char byte_cnt; /* size of the config-cmd */
unsigned char fifo; /* fifo/recv monitor */
unsigned char sav_bf; /* save bad frames (bit7=1)*/
unsigned char adr_len; /* adr_len(0-2),al_loc(3),pream(4-5),loopbak(6-7)*/
unsigned char priority; /* lin_prio(0-2),exp_prio(4-6),bof_metd(7) */
unsigned char ifs; /* inter frame spacing */
unsigned char time_low; /* slot time low */
unsigned char time_high; /* slot time high(0-2) and max. retries(4-7) */
unsigned char promisc; /* promisc-mode(0) , et al (1-7) */
unsigned char carr_coll; /* carrier(0-3)/collision(4-7) stuff */
unsigned char fram_len; /* minimal frame len */
unsigned char dummy; /* dummy */
};
/*
* Multicast Setup command
*/
struct mcsetup_cmd_struct
{
unsigned short cmd_status;
unsigned short cmd_cmd;
unsigned short cmd_link;
unsigned short mc_cnt; /* number of bytes in the MC-List */
unsigned char mc_list[16][6]; /* the list for 16 entries */
};
/*
* transmit command
*/
struct transmit_cmd_struct
{
unsigned short cmd_status;
unsigned short cmd_cmd;
unsigned short cmd_link;
unsigned short tbd_offset; /* pointeroffset to TBD */
unsigned char dest[6]; /* destination address of the frame */
unsigned short length; /* user defined: 802.3 length / Ether type */
};
#define TCMD_ERRMASK 0x0fa0
#define TCMD_MAXCOLLMASK 0x000f
#define TCMD_MAXCOLL 0x0020
#define TCMD_HEARTBEAT 0x0040
#define TCMD_DEFFERED 0x0080
#define TCMD_UNDERRUN 0x0100
#define TCMD_LOSTCTS 0x0200
#define TCMD_NOCARRIER 0x0400
#define TCMD_LATECOLL 0x0800
struct tdr_cmd_struct
{
unsigned short cmd_status;
unsigned short cmd_cmd;
unsigned short cmd_link;
unsigned short status;
};
#define TDR_LNK_OK 0x8000 /* No link problem identified */
#define TDR_XCVR_PRB 0x4000 /* indiactes a transceiver problem */
#define TDR_ET_OPN 0x2000 /* open, no correct termination */
#define TDR_ET_SRT 0x1000 /* TDR detected a short circuit */
#define TDR_TIMEMASK 0x07ff /* mask for the time field */
/*
* Transmit Buffer Descriptor (TBD)
*/
struct tbd_struct
{
unsigned short size; /* size + EOF-Flag(15) */
unsigned short next; /* pointeroffset to next TBD */
char *buffer; /* pointer to buffer */
};
#define TBD_LAST 0x8000 /* EOF-Flag, indicates last buffer in list */
This diff is collapsed.
/* am7990 (lance) definitions
*
* This is a extension to the Linux operating system, and is covered by
* same Gnu Public License that covers that work.
*
* Michael Hipp
* email: mhipp@student.uni-tuebingen.de
*
* sources: (mail me or ask archie if you need them)
* crynwr-packet-driver
*/
/*
* Control and Status Register 0 (CSR0) bit definitions
* (R=Readable) (W=Writeable) (S=Set on write) (C-Clear on write)
*
*/
#define CSR0_ERR 0x8000 /* Error summary (R) */
#define CSR0_BABL 0x4000 /* Babble transmitter timeout error (RC) */
#define CSR0_CERR 0x2000 /* Collision Error (RC) */
#define CSR0_MISS 0x1000 /* Missed packet (RC) */
#define CSR0_MERR 0x0800 /* Memory Error (RC) */
#define CSR0_RINT 0x0400 /* Reciever Interrupt (RC) */
#define CSR0_TINT 0x0200 /* Transmit Interrupt (RC) */
#define CSR0_IDON 0x0100 /* Initialization Done (RC) */
#define CSR0_INTR 0x0080 /* Interrupt Flag (R) */
#define CSR0_INEA 0x0040 /* Interrupt Enable (RW) */
#define CSR0_RXON 0x0020 /* Receiver on (R) */
#define CSR0_TXON 0x0010 /* Transmitter on (R) */
#define CSR0_TDMD 0x0008 /* Transmit Demand (RS) */
#define CSR0_STOP 0x0004 /* Stop (RS) */
#define CSR0_STRT 0x0002 /* Start (RS) */
#define CSR0_INIT 0x0001 /* Initialize (RS) */
#define CSR0_CLRALL 0x7f00 /* mask for all clearable bits */
/*
* Initialization Block Mode operation Bit Definitions.
*/
#define M_PROM 0x8000 /* Promiscuous Mode */
#define M_INTL 0x0040 /* Internal Loopback */
#define M_DRTY 0x0020 /* Disable Retry */
#define M_COLL 0x0010 /* Force Collision */
#define M_DTCR 0x0008 /* Disable Transmit CRC) */
#define M_LOOP 0x0004 /* Loopback */
#define M_DTX 0x0002 /* Disable the Transmitter */
#define M_DRX 0x0001 /* Disable the Reciever */
/*
* Receive message descriptor bit definitions.
*/
#define RCV_OWN 0x80 /* owner bit 0 = host, 1 = lance */
#define RCV_ERR 0x40 /* Error Summary */
#define RCV_FRAM 0x20 /* Framing Error */
#define RCV_OFLO 0x10 /* Overflow Error */
#define RCV_CRC 0x08 /* CRC Error */
#define RCV_BUF_ERR 0x04 /* Buffer Error */
#define RCV_START 0x02 /* Start of Packet */
#define RCV_END 0x01 /* End of Packet */
/*
* Transmit message descriptor bit definitions.
*/
#define XMIT_OWN 0x80 /* owner bit 0 = host, 1 = lance */
#define XMIT_ERR 0x40 /* Error Summary */
#define XMIT_RETRY 0x10 /* more the 1 retry needed to Xmit */
#define XMIT_1_RETRY 0x08 /* one retry needed to Xmit */
#define XMIT_DEF 0x04 /* Deferred */
#define XMIT_START 0x02 /* Start of Packet */
#define XMIT_END 0x01 /* End of Packet */
/*
* transmit status (2) (valid if XMIT_ERR == 1)
*/
#define XMIT_RTRY 0x0200 /* Failed after 16 retransmissions */
#define XMIT_LCAR 0x0400 /* Loss of Carrier */
#define XMIT_LCOL 0x1000 /* Late collision */
#define XMIT_RESERV 0x2000 /* Reserved */
#define XMIT_UFLO 0x4000 /* Underflow (late memory) */
#define XMIT_BUFF 0x8000 /* Buffering error (no ENP) */
#define XMIT_TDRMASK 0x003f /* time-domain-reflectometer-value */
struct init_block
{
unsigned short mode;
unsigned char eaddr[6];
unsigned char filter[8];
unsigned short rrplow; /* receive ring pointer (align 8) */
unsigned short rrphigh; /* bit 13-15: number of rmd's (power of 2) */
unsigned short trplow; /* transmit ring pointer (align 8) */
unsigned short trphigh; /* bit 13-15: number of tmd's (power of 2) */
};
struct rmd /* Receive Message Descriptor */
{
union
{
volatile unsigned long buffer;
struct
{
volatile unsigned char dummy[3];
volatile unsigned char status;
} s;
} u;
short blen;
volatile unsigned short mlen;
};
struct tmd
{
union
{
volatile unsigned long buffer;
struct
{
volatile unsigned char dummy[3];
volatile unsigned char status;
} s;
} u;
unsigned short blen;
volatile unsigned short status2;
};
......@@ -236,7 +236,7 @@ net_open(struct device *dev)
/* Always snarf a DMA channel after the IRQ. */
if (request_dma(dev->dma)) {
if (request_dma(dev->dma,"skeleton ethernet")) {
free_irq(dev->irq);
return -EAGAIN;
}
......
......@@ -248,8 +248,8 @@ int znet_probe(struct device *dev)
/* These should never fail. You can't add devices to a sealed box! */
if (request_irq(dev->irq, &znet_interrupt, 0, "ZNet")
|| request_dma(zn.rx_dma)
|| request_dma(zn.tx_dma)) {
|| request_dma(zn.rx_dma,"ZNet rx")
|| request_dma(zn.tx_dma,"ZNet tx")) {
printk(KERN_WARNING "%s: Not opened -- resource busy?!?\n", dev->name);
return EBUSY;
}
......
......@@ -876,7 +876,7 @@ int aha1542_detect(Scsi_Host_Template * tpnt)
}
if (dma_chan != 0xFF) {
if (request_dma(dma_chan)) {
if (request_dma(dma_chan,"aha1542")) {
printk("Unable to allocate DMA channel for Adaptec.\n");
free_irq(irq_level);
goto unregister;
......
......@@ -1082,7 +1082,7 @@ int buslogic_detect(Scsi_Host_Template *tpnt)
}
if (dma) {
if (request_dma(dma)) {
if (request_dma(dma,"buslogic")) {
buslogic_printk("Unable to allocate DMA channel for "
"BusLogic controller.\n");
free_irq(irq);
......
......@@ -654,7 +654,7 @@ static int sr_detect(Scsi_Device * SDp){
if(SDp->type != TYPE_ROM && SDp->type != TYPE_WORM) return 0;
printk("Detected scsi CD-ROM sr%d at scsi%d, id %d, lun %d\n",
++sr_template.dev_noticed,
sr_template.dev_noticed++,
SDp->host->host_no , SDp->id, SDp->lun);
return 1;
......
......@@ -498,7 +498,7 @@ static int ultrastor_14f_detect(Scsi_Host_Template * tpnt)
config.interrupt);
return FALSE;
}
if (config.dma_channel && request_dma(config.dma_channel)) {
if (config.dma_channel && request_dma(config.dma_channel,"Ultrastor")) {
printk("Unable to allocate DMA channel %u for UltraStor controller.\n",
config.dma_channel);
free_irq(config.interrupt);
......
......@@ -1047,7 +1047,7 @@ int wd7000_init( Adapter *host )
printk("wd7000_init: can't get IRQ %d.\n", host->irq);
return 0;
}
if (request_dma(host->dma)) {
if (request_dma(host->dma,"wd7000")) {
printk("wd7000_init: can't get DMA channel %d.\n", host->dma);
free_irq(host->irq);
return 0;
......
......@@ -259,7 +259,7 @@ static __inline__ int get_dma_residue(unsigned int dmanr)
/* These are in kernel/dma.c: */
extern int request_dma(unsigned int dmanr); /* reserve a DMA channel */
extern int request_dma(unsigned int dmanr,char * deviceID); /* reserve a DMA channel */
extern void free_dma(unsigned int dmanr); /* release it again */
......
......@@ -832,7 +832,7 @@ DMAbuf_open_dma (int dev)
unsigned long flags;
int chan = audio_devs[dev]->dmachan;
if (ALLOC_DMA_CHN (chan))
if (ALLOC_DMA_CHN (chan,"audio"))
{
printk ("Unable to grab DMA%d for the audio driver\n", chan);
return RET_ERROR (EBUSY);
......
......@@ -93,7 +93,7 @@ struct snd_wait {
#define SOMEONE_WAITING(q, f) (f.mode & WK_SLEEP)
#define WAKE_UP(q, f) {f.mode = WK_WAKEUP;wake_up(&q);}
#define ALLOC_DMA_CHN(chn) request_dma(chn)
#define ALLOC_DMA_CHN(chn,deviceID) request_dma(chn,deviceID)
#define RELEASE_DMA_CHN(chn) free_dma(chn)
#define GET_TIME() jiffies
......
......@@ -228,7 +228,7 @@ sb16_dsp_open (int dev, int mode)
sb_reset_dsp ();
if (ALLOC_DMA_CHN (dma8))
if (ALLOC_DMA_CHN (dma8,"sb16 8bit"))
{
printk ("SB16: Unable to grab DMA%d\n", dma8);
sb_free_irq ();
......@@ -236,7 +236,7 @@ sb16_dsp_open (int dev, int mode)
}
if (dma16 != dma8)
if (ALLOC_DMA_CHN (dma16))
if (ALLOC_DMA_CHN (dma16,"sb16 16bit"))
{
printk ("SB16: Unable to grab DMA%d\n", dma16);
sb_free_irq ();
......
......@@ -8,6 +8,7 @@
#include <linux/sched.h>
#include <linux/kernel.h>
#include <linux/locks.h>
#include <linux/fcntl.h>
#include <asm/segment.h>
#include <asm/system.h>
......@@ -117,6 +118,10 @@ int block_write(struct inode * inode, struct file * filp, char * buf, int count)
buf += chars;
bh->b_uptodate = 1;
mark_buffer_dirty(bh, 0);
if (filp->f_flags & O_SYNC) {
ll_rw_block(WRITE, 1, &bh);
wait_on_buffer(bh);
}
brelse(bh);
}
filp->f_reada = 1;
......
Changes from version 0.5 to version 0.5a
========================================
- Added a revision level in the superblock.
- Full support for O_SYNC flag of the open system call.
- New mount options: `bsddf' and `minixdf'. `bsddf' causes ext2fs
to remove the blocks used for FS structures from the total block
count in statfs. With `minixdf', ext2fs mimics Minix behavior
......
......@@ -258,6 +258,14 @@ static int ext2_file_write (struct inode * inode, struct file * filp,
pos = inode->i_size;
else
pos = filp->f_pos;
/*
* If a file has been opened in synchronous mode, we have to ensure
* that meta-data will also be written synchronously. Thus, we
* set the i_osync field. This field is tested by the allocation
* routines.
*/
if (filp->f_flags & O_SYNC)
inode->u.ext2_i.i_osync++;
written = 0;
while (written < count) {
bh = ext2_getblk (inode, pos / sb->s_blocksize, 1, &err);
......@@ -286,10 +294,16 @@ static int ext2_file_write (struct inode * inode, struct file * filp,
buf += c;
bh->b_uptodate = 1;
mark_buffer_dirty(bh, 0);
if (filp->f_flags & O_SYNC) {
ll_rw_block (WRITE, 1, &bh);
wait_on_buffer (bh);
}
brelse (bh);
}
if (pos > inode->i_size)
inode->i_size = pos;
if (filp->f_flags & O_SYNC)
inode->u.ext2_i.i_osync--;
up(&inode->i_sem);
inode->i_ctime = inode->i_mtime = CURRENT_TIME;
filp->f_pos = pos;
......
......@@ -236,7 +236,7 @@ static struct buffer_head * inode_getblk (struct inode * inode, int nr,
inode->u.ext2_i.i_next_alloc_goal = tmp;
inode->i_ctime = CURRENT_TIME;
inode->i_blocks += blocks;
if (IS_SYNC(inode))
if (IS_SYNC(inode) || inode->u.ext2_i.i_osync)
ext2_sync_inode (inode);
else
inode->i_dirt = 1;
......@@ -307,7 +307,7 @@ static struct buffer_head * block_getblk (struct inode * inode,
}
*p = tmp;
mark_buffer_dirty(bh, 1);
if (IS_SYNC(inode)) {
if (IS_SYNC(inode) || inode->u.ext2_i.i_osync) {
ll_rw_block (WRITE, 1, &bh);
wait_on_buffer (bh);
}
......@@ -535,6 +535,7 @@ void ext2_read_inode (struct inode * inode)
inode->u.ext2_i.i_faddr = raw_inode->i_faddr;
inode->u.ext2_i.i_frag_no = raw_inode->i_frag;
inode->u.ext2_i.i_frag_size = raw_inode->i_fsize;
inode->u.ext2_i.i_osync = 0;
inode->u.ext2_i.i_file_acl = raw_inode->i_file_acl;
inode->u.ext2_i.i_dir_acl = raw_inode->i_dir_acl;
inode->u.ext2_i.i_version = raw_inode->i_version;
......
......@@ -463,6 +463,7 @@ extern int get_device_list(char *);
extern int get_filesystem_list(char *);
extern int get_ksyms_list(char *);
extern int get_irq_list(char *);
extern int get_dma_list(char *);
static int get_root_array(char * page, int type)
{
......@@ -501,6 +502,9 @@ static int get_root_array(char * page, int type)
case PROC_KSYMS:
return get_ksyms_list(page);
case PROC_DMA:
return get_dma_list(page);
}
return -EBADF;
}
......
......@@ -71,6 +71,7 @@ static struct proc_dir_entry root_dir[] = {
{ PROC_INTERRUPTS, 10,"interrupts" },
{ PROC_FILESYSTEMS, 11,"filesystems" },
{ PROC_KSYMS, 5, "ksyms" },
{ PROC_DMA, 3, "dma" },
};
#define NR_ROOT_DIRENTRY ((sizeof (root_dir))/(sizeof (root_dir[0])))
......
......@@ -66,7 +66,7 @@ extern __inline__ int test_bit(int nr, void * addr)
/*
* Find-bit routines..
*/
extern inline int find_first_zero_bit (unsigned long * addr, unsigned size)
extern inline int find_first_zero_bit(void * addr, unsigned size)
{
int res;
......@@ -92,8 +92,7 @@ extern inline int find_first_zero_bit (unsigned long * addr, unsigned size)
return res;
}
extern inline int find_next_zero_bit (unsigned long * addr, int size,
int offset)
extern inline int find_next_zero_bit (void * addr, int size, int offset)
{
unsigned long * p = ((unsigned long *) addr) + (offset >> 5);
int set = 0, bit = offset & 31, res;
......@@ -117,7 +116,7 @@ extern inline int find_next_zero_bit (unsigned long * addr, int size,
/*
* No zero yet, search remaining full bytes for a zero
*/
res = find_first_zero_bit (p, size - 32 * (p - addr));
res = find_first_zero_bit (p, size - 32 * (p - (unsigned long *) addr));
return (offset + set + res);
}
......
......@@ -259,7 +259,7 @@ static __inline__ int get_dma_residue(unsigned int dmanr)
/* These are in kernel/dma.c: */
extern int request_dma(unsigned int dmanr); /* reserve a DMA channel */
extern int request_dma(unsigned int dmanr, char * deviceID); /* reserve a DMA channel */
extern void free_dma(unsigned int dmanr); /* release it again */
......
......@@ -447,7 +447,7 @@ extern inline void * __constant_c_and_count_memset(void * s, unsigned long patte
return s;
case 3:
*(unsigned short *)s = pattern;
*(2+(unsigned char *)s) = pattern >> 16;
*(2+(unsigned char *)s) = pattern;
return s;
case 4:
*(unsigned long *)s = pattern;
......
......@@ -47,7 +47,7 @@
/*
* The second extended file system version
*/
#define EXT2FS_DATE "94/08/12"
#define EXT2FS_DATE "94/08/24"
#define EXT2FS_VERSION "0.5a"
/*
......@@ -348,13 +348,16 @@ struct ext2_super_block {
unsigned long s_lastcheck; /* time of last check */
unsigned long s_checkinterval; /* max. time between checks */
unsigned long s_creator_os; /* OS */
unsigned long s_reserved[237]; /* Padding to the end of the block */
unsigned long s_rev_level; /* Revision level */
unsigned long s_reserved[236]; /* Padding to the end of the block */
};
#define EXT2_OS_LINUX 0
#define EXT2_OS_HURD 1
#define EXT2_OS_MASIX 2
#define EXT2_CURRENT_REV 0
/*
* Structure of a directory entry
*/
......
......@@ -24,7 +24,7 @@ struct ext2_inode_info {
unsigned long i_faddr;
unsigned char i_frag_no;
unsigned char i_frag_size;
unsigned short i_pad1;
unsigned short i_osync;
unsigned long i_file_acl;
unsigned long i_dir_acl;
unsigned long i_dtime;
......
#ifndef _LINUX_FCNTL_H
#define _LINUX_FCNTL_H
/* open/fcntl - O_SYNC isn't implemented yet */
/* open/fcntl - O_SYNC is only implemented on blocks devices and on files
located on an ext2 file system */
#define O_ACCMODE 0003
#define O_RDONLY 00
#define O_WRONLY 01
......
......@@ -87,12 +87,12 @@ struct hd_driveid {
unsigned short vendor0; /* vendor unique */
unsigned short vendor1; /* vendor unique */
unsigned short vendor2; /* vendor unique */
unsigned char serial_no[20]; /* big_endian; 0 = not_specified */
unsigned char serial_no[20]; /* 0 = not_specified */
unsigned short buf_type;
unsigned short buf_size; /* 512 byte increments; 0 = not_specified */
unsigned short ecc_bytes; /* for r/w long cmds; 0 = not_specified */
unsigned char fw_rev[8]; /* big_endian; 0 = not_specified */
unsigned char model[40]; /* big_endian; 0 = not_specified */
unsigned char fw_rev[8]; /* 0 = not_specified */
unsigned char model[40]; /* 0 = not_specified */
unsigned char max_multsect; /* 0=not_implemented */
unsigned char vendor3; /* vendor unique */
unsigned short dword_io; /* 0=not_implemented; 1=implemented */
......
......@@ -23,7 +23,8 @@ enum root_directory_inos {
PROC_DEVICES,
PROC_INTERRUPTS,
PROC_FILESYSTEMS,
PROC_KSYMS
PROC_KSYMS,
PROC_DMA
};
enum pid_directory_inos {
......
......@@ -20,7 +20,6 @@ struct linger {
#define SOCK_RAW 3 /* raw socket */
#define SOCK_RDM 4 /* reliably-delivered message */
#define SOCK_SEQPACKET 5 /* sequential packet socket */
#define SOCK_NCP 6 /* Novell NCP socket */
#define SOCK_PACKET 10 /* linux specific way of */
/* getting packets at the dev */
/* level. For writing rarp and */
......
......@@ -496,7 +496,7 @@ asmlinkage void start_kernel(void)
if (hlt_works_ok) {
printk("Checking 'hlt' instruction... ");
__asm__ __volatile__("hlt ; hlt ; hlt ; hlt");
printk(" Ok.\n");
printk("Ok.\n");
}
system_utsname.machine[1] = '0' + x86;
......
......@@ -16,7 +16,7 @@
.c.o:
$(CC) $(CFLAGS) -c $<
OBJS = sched.o sys_call.o traps.o irq.o dma.o fork.o exec_domain.o \
OBJS = sched.o entry.o traps.o irq.o dma.o fork.o exec_domain.o \
panic.o printk.o vsprintf.o sys.o module.o ksyms.o exit.o \
signal.o ptrace.o ioport.o itimer.o \
info.o ldt.o time.o tqueue.o vm86.o bios32.o splx.o
......@@ -27,9 +27,9 @@ kernel.o: $(OBJS)
$(LD) -r -o kernel.o $(OBJS)
sync
sys_call.s: sys_call.S
entry.s: entry.S
sys_call.o: sys_call.s
entry.o: entry.s
sched.o: sched.c
$(CC) $(CFLAGS) $(PROFILING) -fno-omit-frame-pointer -c $<
......
......@@ -29,11 +29,21 @@
* DMA0 used to be reserved for DRAM refresh, but apparently not any more...
* DMA4 is reserved for cascading.
*/
/*
static volatile unsigned int dma_chan_busy[MAX_DMA_CHANNELS] = {
0, 0, 0, 0, 1, 0, 0, 0
};
*/
static volatile char * dma_chan_busy[MAX_DMA_CHANNELS] = {
0,
0,
0,
0,
"cascade",
0,
0,
0
};
/* Atomically swap memory location [32 bits] with `newval'.
* This avoid the cli()/sti() junk and related problems.
......@@ -60,17 +70,30 @@ static __inline__ unsigned int mutex_atomic_swap(volatile unsigned int * p, unsi
} /* mutex_atomic_swap */
int get_dma_list(char *buf)
{
int i, len = 0;
for (i = 0 ; i < MAX_DMA_CHANNELS ; i++) {
if (dma_chan_busy[i]) {
len += sprintf(buf+len, "%2d: %s\n",
i,
dma_chan_busy[i]);
}
}
return len;
}
int request_dma(unsigned int dmanr)
int request_dma(unsigned int dmanr, char * deviceID)
{
if (dmanr >= MAX_DMA_CHANNELS)
return -EINVAL;
if (mutex_atomic_swap(&dma_chan_busy[dmanr], 1) != 0)
if (mutex_atomic_swap((unsigned int *) &dma_chan_busy[dmanr], (unsigned int) deviceID) != 0)
return -EBUSY;
else
/* old flag was 0, now contains 1 to indicate busy */
return 0;
/* old flag was 0, now contains 1 to indicate busy */
return 0;
} /* request_dma */
......@@ -81,7 +104,10 @@ void free_dma(unsigned int dmanr)
return;
}
if (mutex_atomic_swap(&dma_chan_busy[dmanr], 0) == 0)
if (mutex_atomic_swap((unsigned int *) &dma_chan_busy[dmanr], 0) == 0) {
printk("Trying to free free DMA%d\n", dmanr);
return;
}
} /* free_dma */
......@@ -41,7 +41,7 @@ extern char * ftape_big_buffer;
extern void (*do_floppy)(void);
#endif
extern int request_dma(unsigned int dmanr);
extern int request_dma(unsigned int dmanr, char * deviceID);
extern void free_dma(unsigned int dmanr);
extern int do_execve(char * filename, char ** argv, char ** envp,
......
......@@ -177,8 +177,7 @@ int datagram_select(struct sock *sk, int sel_type, select_table *wait)
switch(sel_type)
{
case SEL_IN:
if ((sk->type==SOCK_SEQPACKET || sk->type==SOCK_NCP)
&& sk->state==TCP_CLOSE)
if (sk->type==SOCK_SEQPACKET && sk->state==TCP_CLOSE)
{
/* Connection closed: Wake up */
return(1);
......
This diff is collapsed.
......@@ -41,7 +41,6 @@
#endif
#ifdef CONFIG_IPX
#include "ipx.h"
#include "ncp.h"
#endif
#define SOCK_ARRAY_SIZE 64
......@@ -138,7 +137,6 @@ struct sock {
#ifdef CONFIG_IPX
ipx_address ipx_source_addr,ipx_dest_addr;
unsigned short ipx_type;
struct ncp_info ncp;
#endif
#ifdef CONFIG_AX25
/* Really we want to add a per protocol private area */
......
......@@ -592,8 +592,7 @@ static int sock_socket(int family, int type, int protocol)
if ((type != SOCK_STREAM && type != SOCK_DGRAM &&
type != SOCK_SEQPACKET && type != SOCK_RAW &&
type != SOCK_PACKET && type != SOCK_NCP)
|| protocol < 0)
type != SOCK_PACKET) || protocol < 0)
return(-EINVAL);
/*
......
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