Commit 636b3843 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.3.43

parent b8c4da2a
......@@ -2621,6 +2621,13 @@ D: CMI8330 support is sb_card.c
D: ISAPnP fixes in sb_card.c
S: Italy
N: Alessandro Zummo
E: azummo@ita.flashnet.it
W: http://freepage.logicom.it/azummo/
D: CMI8330 support is sb_card.c
D: ISAPnP fixes in sb_card.c
S: Italy
N: Marc Zyngier
E: maz@wild-wind.fr.eu.org
D: MD driver
......
......@@ -2347,6 +2347,14 @@ CONFIG_FB_VESA
You will get a boot time penguin logo at no additional cost. Please
read Documentation/fb/vesafb.txt. If unsure, say Y.
VGA 16-color planar support
CONFIG_FBCON_VGA_PLANES
This low level frame buffer console driver enable the kernel to use
the 16-color planar modes of the old VGA cards where the bits of each
pixel are separated into 4 plans.
Only answer Y here if you have an (very old) VGA card that isn't
VESA 2 compatible.
VGA 16-color graphics console
CONFIG_FB_VGA16
This is the frame buffer device driver for VGA 16 color graphic
......@@ -2357,6 +2365,25 @@ CONFIG_FB_VGA16
running kernel whenever you want), say M here and read
Documentation/modules.txt. The module will be called vga16fb.o.
VGA 8x16 font
CONFIG_FONT_8x16
This is the "high resolution" font for the VGA frame buffer (the one
provided by the text console 80x25 mode.
Support only 8 pixels wide fonts
CONFIG_FBCON_FONTWIDTH8_ONLY
Answer Y here will make the kernel provide only the 8x8 fonts (these
are the less readable).
VGA 8x8 font
CONFIG_FONT_8x8
This is the "high resolution" font for the VGA frame buffer (the one
provided by the text console 80x50 (and higher) modes.
Note this is a poor quality font. The VGA 8x16 font is quite a lot
more readable.
Given the resolution provided by the frame buffer device, anwser N
here is safe.
Backward compatibility mode for Xpmac
CONFIG_FB_COMPAT_XPMAC
If you use the Xpmac X server (common with mklinux), you'll need to
......@@ -2650,6 +2677,12 @@ CONFIG_PARPORT_AX
Ultra/AX machines. This code is also available as a module (say M),
called parport_ax.o. If in doubt, saying N is the safe plan.
Support IEEE1284 status readback
CONFIG_PRINTER_READBACK
If you have a device on your parrallel port that support this protocol,
this option'll enable it to report its status.
It is safe to say Y.
IEEE1284 transfer modes
CONFIG_PARPORT_1284
If you have a printer that supports status readback or device ID, or
......@@ -7362,7 +7395,7 @@ CONFIG_DE4X5
Documentation/networking/net-modules.txt.
DECchip Tulip (dc21x4x) PCI support
CONFIG_DEC_ELCP
CONFIG_TULIP
This driver is developed for the SMC EtherPower series Ethernet
cards and also works with cards based on the DECchip
21040/21041/21140 (Tulip series) chips. Some LinkSys PCI cards are
......@@ -9495,9 +9528,9 @@ CONFIG_NLS_ISO8859_14
from the Microsoft fat filesystem family or from JOLIET CDROMs
correctly on the screen, you need to include the appropriate
input/output character sets. Say Y here for the Latin 8 character
set, which adds the last accented vowels for Welsh (and Manx Gaelic)
that were missing in Latin 1. http://linux.speech.cymru.org/
has further information.
set, which adds the last accented vowels for Welsh (aka Cymraeg)
(and Manx Gaelic) hat were missing in Latin 1.
http://linux.speech.cymru.org/ has further information.
nls iso8859-15
CONFIG_NLS_ISO8859_15
......@@ -10454,6 +10487,11 @@ CONFIG_APPLICOM
If unsure, say N.
Enter S1 for sleep (EXPERIMENTAL)
CONFIG_ACPI_S1_SLEEP
This enable ACPI compliant devices to enter level 1 of ACPI saving
power levels. Basically, this will let them entering in sleep mode.
Advanced Power Management
CONFIG_APM
APM is a BIOS specification for saving power using several different
......@@ -13055,7 +13093,84 @@ CONFIG_PHONE_IXJ
If you do not have any Quicknet telephony cards, you can safely
ignore this option.
/dev/agpgart (AGP Support) (EXPERIMENTAL)
CONFIG_AGP
The agpgart kernel module is necessary to use the AGP features
of your 3D rendering video card. It acts as a sort of "AGP
driver" for the motherboard's chipset.
Loading this module into the kernel will allow the glx module to
program the GART (graphics aperture relocation table) registers
with appropriate values to transfer commands to the card.
If you need more texture memory than you can get with the AGP GART
(theoretically up to 256 megs, but in practice usually 64 or 128
megs due to kernel allocation issues), you could use PCI accesses
and have up to a couple gigs of texture space.
Note that this is the only meas to have get XFree4/GLX use
write-combining with MTRR support on AGP bus. Without, OpenGL
direct rendering will be a lot slower but still faster than PIO.
For the moment, most people should say no, unless you want to
test the GLX component which can be downloaded from
http://glx.on.openprojects.net/
or need to use the 810 Xserver in XFree 3.3.6
Intel 440LX/BX/GX support
CONFIG_AGP_INTEL
This option give you AGP support for the GLX component of the
"soon to be released" XFree86-4 on Intel 440LX/BX/GX chipsets.
For the moment, most people should say no, unless you want to
test the GLX component which can be downloaded from
http://glx.on.openprojects.net/
Intel I810/I810 DC100/I810e support
CONFIG_AGP_I810
This option give you AGP support for the Xserver for the intel
810 chipset boards. This is required to do any useful video
modes.
VIA VP3/MVP3/Apollo Pro support
CONFIG_AGP_VIA
This option give you AGP support for the GLX component of the
"soon to be released" XFree86-4 on VIA MPV3/Apollo Pro chipsets.
For the moment, most people should say no, unless you want to
test the GLX component which can be downloaded from
http://glx.on.openprojects.net/
AMD Irongate support
CONFIG_AGP_AMD
This option give you AGP support for the GLX component of the
"soon to be released" XFree86-4 on Intel AMD Irongate chipset.
For the moment, most people should say no, unless you want to
test the GLX component which can be downloaded from
http://glx.on.openprojects.net/
Generic SiS support
CONFIG_AGP_SIS
This option give you AGP support for the GLX component of the
"soon to be released" XFree86-4 on Silicon Integrated Systems [SiS]
chipsets.
Note than 5591/5592 AGP chipsets are NOT supported.
For the moment, most people should say no, unless you want to
test the GLX component which can be downloaded from
http://glx.on.openprojects.net/
ALI M1541 support
CONFIG_AGP_ALI
This option give you AGP support for the GLX component of the
"soon to be released" XFree86-4 on ALI M1541 chipset.
For the moment, most people should say no, unless you want to
test the GLX component which can be downloaded from
http://glx.on.openprojects.net/
#
# ARM options
......@@ -13584,7 +13699,6 @@ CONFIG_KHTTPD
The kHTTPd is experimental. Be careful when using it on a production
machine. Also note that kHTTPd doesn't support virtual servers yet.
#
I2C support
CONFIG_I2C
I2C (pronounce: I-square-C) is a slow bus protocol developed by
......@@ -13637,6 +13751,7 @@ CONFIG_I2C_CHARDEV
files, usually found in the /dev directory on your system. They
make it possible to have user-space programs use the I2C bus.
#
# A couple of things I keep forgetting:
# capitalize: AppleTalk, Ethernet, DOS, DMA, FAT, FTP, Internet,
# Intel, IRQ, Linux, MSDOS, NetWare, NetWinder, NFS,
......
......@@ -275,7 +275,7 @@ CONFIG_NET_EISA=y
# CONFIG_APRICOT is not set
# CONFIG_CS89x0 is not set
# CONFIG_DE4X5 is not set
# CONFIG_DEC_ELCP is not set
# CONFIG_TULIP is not set
# CONFIG_DGRS is not set
CONFIG_EEXPRESS_PRO100=y
# CONFIG_NE2K_PCI is not set
......
......@@ -40,14 +40,6 @@ else
endif
endif
ifdef CONFIG_ACPI
OX_OBJS += pm.o
else
ifdef CONFIG_APM
OX_OBJS += pm.o
endif
endif
ifeq ($(CONFIG_ACPI),y)
O_OBJS += acpi.o
else
......
......@@ -939,12 +939,26 @@ static void __init pci_fixup_ide_bases(struct pci_dev *d)
}
}
static void __init pci_fixup_ide_trash(struct pci_dev *d)
{
int i;
/*
* There exist PCI IDE controllers which have utter garbage
* in first four base registers. Ignore that.
*/
DBG("PCI: IDE base address trash cleared for %s\n", d->slot_name);
for(i=0; i<4; i++)
d->resource[i].start = d->resource[i].end = d->resource[i].flags = 0;
}
struct pci_fixup pcibios_fixups[] = {
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82451NX, pci_fixup_i450nx },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_RCC, PCI_DEVICE_ID_RCC_HE, pci_fixup_rcc },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_RCC, PCI_DEVICE_ID_RCC_LE, pci_fixup_rcc },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_COMPAQ, PCI_DEVICE_ID_COMPAQ_6010, pci_fixup_compaq },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_UMC, PCI_DEVICE_ID_UMC_UM8886BF, pci_fixup_umc_ide },
{ PCI_FIXUP_HEADER, PCI_VENDOR_ID_SI, PCI_DEVICE_ID_SI_5513, pci_fixup_ide_trash },
{ PCI_FIXUP_HEADER, PCI_ANY_ID, PCI_ANY_ID, pci_fixup_ide_bases },
{ 0 }
};
......
......@@ -13,6 +13,7 @@
* responsibility of the caller). Added spinlocks.
*
*/
#include <linux/config.h>
#include <linux/types.h>
#include <linux/init.h>
#include <linux/delay.h>
......
This diff is collapsed.
......@@ -8,6 +8,7 @@
* for more details.
*/
#include <linux/config.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/sched.h>
......
This diff is collapsed.
......@@ -43,206 +43,6 @@ extern unsigned long walnut_get_rtc_time(void);
extern void walnut_calibrate_decr(void);
#ifdef __cplusplus
}
#endif
#endif /* __WALNUT_SETUP_H__ */
/*
*
* Copyright (c) 1999-2000 Grant Erickson <grant@lcse.umn.edu>
*
* Module name: walnut_setup.c
*
* Description:
* Architecture- / platform-specific boot-time initialization code for
* the IBM PowerPC 405GP "Walnut" evaluation board. Adapted from original
* code by Gary Thomas, Cort Dougan <cort@cs.nmt.edu>, and Dan Malek
* <dan@netx4.com>.
*
*/
#ifndef __WALNUT_SETUP_H__
#define __WALNUT_SETUP_H__
#include <asm/ptrace.h>
#include <asm/board.h>
#ifdef __cplusplus
extern "C" {
#endif
extern unsigned char __res[sizeof(bd_t)];
extern void walnut_init(unsigned long r3,
unsigned long ird_start,
unsigned long ird_end,
unsigned long cline_start,
unsigned long cline_end);
extern void walnut_setup_arch(void);
extern int walnut_setup_residual(char *buffer);
extern void walnut_init_IRQ(void);
extern int walnut_get_irq(struct pt_regs *regs);
extern void walnut_restart(char *cmd);
extern void walnut_power_off(void);
extern void walnut_halt(void);
extern void walnut_time_init(void);
extern int walnut_set_rtc_time(unsigned long now);
extern unsigned long walnut_get_rtc_time(void);
extern void walnut_calibrate_decr(void);
#ifdef __cplusplus
}
#endif
#endif /* __WALNUT_SETUP_H__ */
/*
*
* Copyright (c) 1999-2000 Grant Erickson <grant@lcse.umn.edu>
*
* Module name: walnut_setup.c
*
* Description:
* Architecture- / platform-specific boot-time initialization code for
* the IBM PowerPC 405GP "Walnut" evaluation board. Adapted from original
* code by Gary Thomas, Cort Dougan <cort@cs.nmt.edu>, and Dan Malek
* <dan@netx4.com>.
*
*/
#ifndef __WALNUT_SETUP_H__
#define __WALNUT_SETUP_H__
#include <asm/ptrace.h>
#include <asm/board.h>
#ifdef __cplusplus
extern "C" {
#endif
extern unsigned char __res[sizeof(bd_t)];
extern void walnut_init(unsigned long r3,
unsigned long ird_start,
unsigned long ird_end,
unsigned long cline_start,
unsigned long cline_end);
extern void walnut_setup_arch(void);
extern int walnut_setup_residual(char *buffer);
extern void walnut_init_IRQ(void);
extern int walnut_get_irq(struct pt_regs *regs);
extern void walnut_restart(char *cmd);
extern void walnut_power_off(void);
extern void walnut_halt(void);
extern void walnut_time_init(void);
extern int walnut_set_rtc_time(unsigned long now);
extern unsigned long walnut_get_rtc_time(void);
extern void walnut_calibrate_decr(void);
#ifdef __cplusplus
}
#endif
#endif /* __WALNUT_SETUP_H__ */
/*
*
* Copyright (c) 1999-2000 Grant Erickson <grant@lcse.umn.edu>
*
* Module name: walnut_setup.c
*
* Description:
* Architecture- / platform-specific boot-time initialization code for
* the IBM PowerPC 405GP "Walnut" evaluation board. Adapted from original
* code by Gary Thomas, Cort Dougan <cort@cs.nmt.edu>, and Dan Malek
* <dan@netx4.com>.
*
*/
#ifndef __WALNUT_SETUP_H__
#define __WALNUT_SETUP_H__
#include <asm/ptrace.h>
#include <asm/board.h>
#ifdef __cplusplus
extern "C" {
#endif
extern unsigned char __res[sizeof(bd_t)];
extern void walnut_init(unsigned long r3,
unsigned long ird_start,
unsigned long ird_end,
unsigned long cline_start,
unsigned long cline_end);
extern void walnut_setup_arch(void);
extern int walnut_setup_residual(char *buffer);
extern void walnut_init_IRQ(void);
extern int walnut_get_irq(struct pt_regs *regs);
extern void walnut_restart(char *cmd);
extern void walnut_power_off(void);
extern void walnut_halt(void);
extern void walnut_time_init(void);
extern int walnut_set_rtc_time(unsigned long now);
extern unsigned long walnut_get_rtc_time(void);
extern void walnut_calibrate_decr(void);
#ifdef __cplusplus
}
#endif
#endif /* __WALNUT_SETUP_H__ */
/*
*
* Copyright (c) 1999-2000 Grant Erickson <grant@lcse.umn.edu>
*
* Module name: walnut_setup.c
*
* Description:
* Architecture- / platform-specific boot-time initialization code for
* the IBM PowerPC 405GP "Walnut" evaluation board. Adapted from original
* code by Gary Thomas, Cort Dougan <cort@cs.nmt.edu>, and Dan Malek
* <dan@netx4.com>.
*
*/
#ifndef __WALNUT_SETUP_H__
#define __WALNUT_SETUP_H__
#include <asm/ptrace.h>
#include <asm/board.h>
#ifdef __cplusplus
extern "C" {
#endif
extern unsigned char __res[sizeof(bd_t)];
extern void walnut_init(unsigned long r3,
unsigned long ird_start,
unsigned long ird_end,
unsigned long cline_start,
unsigned long cline_end);
extern void walnut_setup_arch(void);
extern int walnut_setup_residual(char *buffer);
extern void walnut_init_IRQ(void);
extern int walnut_get_irq(struct pt_regs *regs);
extern void walnut_restart(char *cmd);
extern void walnut_power_off(void);
extern void walnut_halt(void);
extern void walnut_time_init(void);
extern int walnut_set_rtc_time(unsigned long now);
extern unsigned long walnut_get_rtc_time(void);
extern void walnut_calibrate_decr(void);
#ifdef __cplusplus
}
#endif
......
# $Id: config.in,v 1.85 2000/02/08 08:57:45 jj Exp $
# $Id: config.in,v 1.86 2000/02/10 02:51:10 davem Exp $
# For a description of the syntax of this configuration file,
# see the Configure script.
#
......@@ -118,11 +118,24 @@ if [ "$CONFIG_SCSI" != "n" ]; then
comment 'SCSI support type (disk, tape, CDrom)'
dep_tristate ' SCSI disk support' CONFIG_BLK_DEV_SD $CONFIG_SCSI
if [ "$CONFIG_BLK_DEV_SD" != "n" ]; then
int 'Maximum number of SCSI disks that can be loaded as modules' CONFIG_SD_EXTRA_DEVS 40
fi
dep_tristate ' SCSI tape support' CONFIG_CHR_DEV_ST $CONFIG_SCSI
if [ "$CONFIG_BLK_DEV_ST" != "n" ]; then
int 'Maximum number of SCSI tapes that can be loaded as modules' CONFIG_ST_EXTRA_DEVS 2
fi
dep_tristate ' SCSI CDROM support' CONFIG_BLK_DEV_SR $CONFIG_SCSI
if [ "$CONFIG_BLK_DEV_SR" != "n" ]; then
bool ' Enable vendor-specific extensions (for SCSI CDROM)' CONFIG_BLK_DEV_SR_VENDOR
int 'Maximum number of CDROM devices that can be loaded as modules' CONFIG_SR_EXTRA_DEVS 2
fi
dep_tristate ' SCSI generic support' CONFIG_CHR_DEV_SG $CONFIG_SCSI
comment 'Some SCSI devices (e.g. CD jukebox) support multiple LUNs'
......@@ -130,6 +143,7 @@ if [ "$CONFIG_SCSI" != "n" ]; then
bool ' Probe all LUNs on each SCSI device' CONFIG_SCSI_MULTI_LUN
bool ' Verbose SCSI error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS
bool ' SCSI logging facility' CONFIG_SCSI_LOGGING
mainmenu_option next_comment
comment 'SCSI low-level drivers'
......
......@@ -175,9 +175,12 @@ CONFIG_SCSI=y
# SCSI support type (disk, tape, CDrom)
#
CONFIG_BLK_DEV_SD=y
CONFIG_SD_EXTRA_DEVS=40
CONFIG_CHR_DEV_ST=y
CONFIG_ST_EXTRA_DEVS=2
CONFIG_BLK_DEV_SR=y
CONFIG_BLK_DEV_SR_VENDOR=y
CONFIG_SR_EXTRA_DEVS=2
CONFIG_CHR_DEV_SG=m
#
......@@ -185,6 +188,7 @@ CONFIG_CHR_DEV_SG=m
#
CONFIG_SCSI_MULTI_LUN=y
CONFIG_SCSI_CONSTANTS=y
# CONFIG_SCSI_LOGGING is not set
#
# SCSI low-level drivers
......
# $Id: config.in,v 1.94 2000/02/08 08:57:50 jj Exp $
# $Id: config.in,v 1.95 2000/02/10 02:51:12 davem Exp $
# For a description of the syntax of this configuration file,
# see the Configure script.
#
......@@ -130,11 +130,24 @@ if [ "$CONFIG_SCSI" != "n" ]; then
comment 'SCSI support type (disk, tape, CDrom)'
dep_tristate ' SCSI disk support' CONFIG_BLK_DEV_SD $CONFIG_SCSI
if [ "$CONFIG_BLK_DEV_SD" != "n" ]; then
int 'Maximum number of SCSI disks that can be loaded as modules' CONFIG_SD_EXTRA_DEVS 40
fi
dep_tristate ' SCSI tape support' CONFIG_CHR_DEV_ST $CONFIG_SCSI
if [ "$CONFIG_BLK_DEV_ST" != "n" ]; then
int 'Maximum number of SCSI tapes that can be loaded as modules' CONFIG_ST_EXTRA_DEVS 2
fi
dep_tristate ' SCSI CDROM support' CONFIG_BLK_DEV_SR $CONFIG_SCSI
if [ "$CONFIG_BLK_DEV_SR" != "n" ]; then
bool ' Enable vendor-specific extensions (for SCSI CDROM)' CONFIG_BLK_DEV_SR_VENDOR
int 'Maximum number of CDROM devices that can be loaded as modules' CONFIG_SR_EXTRA_DEVS 2
fi
dep_tristate ' SCSI generic support' CONFIG_CHR_DEV_SG $CONFIG_SCSI
comment 'Some SCSI devices (e.g. CD jukebox) support multiple LUNs'
......@@ -142,6 +155,7 @@ if [ "$CONFIG_SCSI" != "n" ]; then
bool ' Probe all LUNs on each SCSI device' CONFIG_SCSI_MULTI_LUN
bool ' Verbose SCSI error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS
bool ' SCSI logging facility' CONFIG_SCSI_LOGGING
mainmenu_option next_comment
comment 'SCSI low-level drivers'
......
......@@ -199,9 +199,12 @@ CONFIG_SCSI=y
# SCSI support type (disk, tape, CDrom)
#
CONFIG_BLK_DEV_SD=y
CONFIG_SD_EXTRA_DEVS=40
CONFIG_CHR_DEV_ST=y
CONFIG_ST_EXTRA_DEVS=2
CONFIG_BLK_DEV_SR=y
CONFIG_BLK_DEV_SR_VENDOR=y
CONFIG_SR_EXTRA_DEVS=2
CONFIG_CHR_DEV_SG=m
#
......@@ -209,6 +212,7 @@ CONFIG_CHR_DEV_SG=m
#
CONFIG_SCSI_MULTI_LUN=y
CONFIG_SCSI_CONSTANTS=y
# CONFIG_SCSI_LOGGING is not set
#
# SCSI low-level drivers
......
......@@ -10,6 +10,7 @@
* development and support.
*/
#include <linux/config.h>
#include <linux/types.h>
#include <linux/kernel.h>
#include <linux/delay.h>
......
......@@ -386,7 +386,11 @@ static int loop_set_fd(struct loop_device *lo, kdev_t dev, unsigned int arg)
a file structure */
lo->lo_backing_file = NULL;
} else if (S_ISREG(inode->i_mode)) {
if (!inode->i_op->get_block) {
/*
* Total crap. We should just use pagecache instead of trying
* to redirect on block level.
*/
if (!inode->i_mapping->a_ops->bmap) {
printk(KERN_ERR "loop: device has no block access/not implemented\n");
goto out_putf;
}
......
......@@ -112,26 +112,6 @@ struct agp_bridge_data {
int (*remove_memory) (agp_memory *, off_t, int);
agp_memory *(*alloc_by_type) (size_t, int);
void (*free_by_type) (agp_memory *);
/* Links to vendor/device specific setup functions */
#ifdef CONFIG_AGP_INTEL
void (*intel_generic_setup) (void);
#endif
#ifdef CONFIG_AGP_I810
void (*intel_i810_setup) (struct pci_dev *);
#endif
#ifdef CONFIG_AGP_VIA
void (*via_generic_setup) (void);
#endif
#ifdef CONFIG_AGP_SIS
void (*sis_generic_setup) (void);
#endif
#ifdef CONFIG_AGP_AMD
void (*amd_irongate_setup) (void);
#endif
#ifdef CONFIG_AGP_ALI
void (*ali_generic_setup) (void);
#endif
};
#define OUTREG32(mmap, addr, val) __raw_writel((val), (mmap)+(addr))
......@@ -157,6 +137,11 @@ struct agp_bridge_data {
#define min(a,b) (((a)<(b))?(a):(b))
#endif
#define arraysize(x) (sizeof(x)/sizeof(*(x)))
#define AGPGART_MODULE_NAME "agpgart"
#define PFX AGPGART_MODULE_NAME ": "
#define PGE_EMPTY(p) (!(p) || (p) == (unsigned long) agp_bridge.scratch_page)
#ifndef PCI_DEVICE_ID_VIA_82C691_0
......
This diff is collapsed.
......@@ -47,6 +47,8 @@
#include <asm/page.h>
#include <asm/mman.h>
#include "agp.h"
static struct agp_front_data agp_fe;
static agp_memory *agp_find_mem_by_key(int key)
......@@ -298,7 +300,7 @@ static agp_memory *agp_allocate_memory_wrap(size_t pg_count, u32 type)
agp_memory *memory;
memory = agp_allocate_memory(pg_count, type);
printk("memory : %p\n", memory);
printk(KERN_DEBUG "memory : %p\n", memory);
if (memory == NULL) {
return NULL;
}
......@@ -969,95 +971,90 @@ static int agp_ioctl(struct inode *inode, struct file *file,
unsigned int cmd, unsigned long arg)
{
agp_file_private *curr_priv = (agp_file_private *) file->private_data;
int ret_val;
int ret_val = -ENOTTY;
AGP_LOCK();
if ((agp_fe.current_controller == NULL) &&
(cmd != AGPIOC_ACQUIRE)) {
return -EINVAL;
ret_val = -EINVAL;
goto ioctl_out;
}
if ((agp_fe.backend_acquired != TRUE) &&
(cmd != AGPIOC_ACQUIRE)) {
return -EBUSY;
ret_val = -EBUSY;
goto ioctl_out;
}
if (cmd != AGPIOC_ACQUIRE) {
if (!(test_bit(AGP_FF_IS_CONTROLLER,
&curr_priv->access_flags))) {
return -EPERM;
ret_val = -EPERM;
goto ioctl_out;
}
/* Use the original pid of the controller,
* in case it's threaded */
if (agp_fe.current_controller->pid != curr_priv->my_pid) {
return -EBUSY;
ret_val = -EBUSY;
goto ioctl_out;
}
}
switch (cmd) {
case AGPIOC_INFO:
{
ret_val = agpioc_info_wrap(curr_priv, arg);
AGP_UNLOCK();
return ret_val;
goto ioctl_out;
}
case AGPIOC_ACQUIRE:
{
ret_val = agpioc_acquire_wrap(curr_priv, arg);
AGP_UNLOCK();
return ret_val;
goto ioctl_out;
}
case AGPIOC_RELEASE:
{
ret_val = agpioc_release_wrap(curr_priv, arg);
AGP_UNLOCK();
return ret_val;
goto ioctl_out;
}
case AGPIOC_SETUP:
{
ret_val = agpioc_setup_wrap(curr_priv, arg);
AGP_UNLOCK();
return ret_val;
goto ioctl_out;
}
case AGPIOC_RESERVE:
{
ret_val = agpioc_reserve_wrap(curr_priv, arg);
AGP_UNLOCK();
return ret_val;
goto ioctl_out;
}
case AGPIOC_PROTECT:
{
ret_val = agpioc_protect_wrap(curr_priv, arg);
AGP_UNLOCK();
return ret_val;
goto ioctl_out;
}
case AGPIOC_ALLOCATE:
{
ret_val = agpioc_allocate_wrap(curr_priv, arg);
AGP_UNLOCK();
return ret_val;
goto ioctl_out;
}
case AGPIOC_DEALLOCATE:
{
ret_val = agpioc_deallocate_wrap(curr_priv, arg);
AGP_UNLOCK();
return ret_val;
goto ioctl_out;
}
case AGPIOC_BIND:
{
ret_val = agpioc_bind_wrap(curr_priv, arg);
AGP_UNLOCK();
return ret_val;
goto ioctl_out;
}
case AGPIOC_UNBIND:
{
ret_val = agpioc_unbind_wrap(curr_priv, arg);
AGP_UNLOCK();
return ret_val;
goto ioctl_out;
}
}
ioctl_out:
AGP_UNLOCK();
return -ENOTTY;
return ret_val;
}
static struct file_operations agp_fops =
......@@ -1074,24 +1071,23 @@ static struct file_operations agp_fops =
static struct miscdevice agp_miscdev =
{
AGPGART_MINOR,
"agpgart",
AGPGART_MODULE_NAME,
&agp_fops
};
int agp_frontend_initialize(void)
int __init agp_frontend_initialize(void)
{
memset(&agp_fe, 0, sizeof(struct agp_front_data));
AGP_LOCK_INIT();
if (misc_register(&agp_miscdev)) {
printk("agpgart: unable to get minor: %d\n", AGPGART_MINOR);
printk(KERN_ERR PFX "unable to get minor: %d\n", AGPGART_MINOR);
return -EIO;
}
return 0;
}
void agp_frontend_cleanup(void)
void __exit agp_frontend_cleanup(void)
{
misc_deregister(&agp_miscdev);
return;
}
......@@ -235,16 +235,9 @@ efi_rtc_close(struct inode *inode, struct file *file)
*/
static struct file_operations efi_rtc_fops = {
NULL,
NULL, /* no read */
NULL, /* No write */
NULL, /* No readdir */
NULL,
efi_rtc_ioctl,
NULL, /* No mmap */
efi_rtc_open,
NULL, /* flush */
efi_rtc_close
ioctl: efi_rtc_ioctl,
open: efi_rtc_open,
release: efi_rtc_close,
};
static struct miscdevice efi_rtc_dev=
......
This diff is collapsed.
......@@ -62,8 +62,13 @@ static int irq=11;
#ifndef MODULE
/*
* Setup options
/**
* wdt_setup:
* @str: command line string
*
* Setup options. The board isn't really probe-able so we have to
* get the user to tell us the configuration. Sane people build it
* modular but the others come here.
*/
static int __init wdt_setup(char *str)
......@@ -108,6 +113,17 @@ static void wdt_ctr_load(int ctr, int val)
* Kernel methods.
*/
/**
* wdt_status:
*
* Extract the status information from a WDT watchdog device. There are
* several board variants so we have to know which bits are valid. Some
* bits default to one and some to zero in order to be maximally painful.
*
* we then map the bits onto the status ioctl flags.
*/
static int wdt_status(void)
{
/*
......@@ -134,11 +150,26 @@ static int wdt_status(void)
return flag;
}
/**
* wdt_interrupt:
* @irq: Interrupt number
* @dev_id: Unused as we don't allow multiple devices.
* @regs: Unused.
*
* Handle an interrupt from the board. These are raised when the status
* map changes in what the board considers an interesting way. That means
* a failure condition occuring.
*
* FIXME: We need to pass a dev_id as the PCI card can share irqs
* although its arguably a _very_ dumb idea to share watchdog
* irq lines
*/
void wdt_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
/*
* Read the status register see what is up and
* then printk it.
* then printk it.
*/
unsigned char status=inb_p(WDT_SR);
......@@ -175,6 +206,13 @@ static long long wdt_llseek(struct file *file, long long offset, int origin)
return -ESPIPE;
}
/**
* wdt_ping:
*
* Reload counter one with the watchdog timeout. We don't bother reloading
* the cascade counter.
*/
static void wdt_ping(void)
{
/* Write a watchdog value */
......@@ -184,6 +222,17 @@ static void wdt_ping(void)
outb_p(0, WDT_DC);
}
/**
* wdt_write:
* @file: file handle to the watchdog
* @buf: buffer to write (unused as data does not matter here
* @count: count of bytes
* @ppos: pointer to the position to write. No seeks allowed
*
* A write to a watchdog device is defined as a keepalive signal. Any
* write of data will do, as we we don't define content meaning.
*/
static ssize_t wdt_write(struct file *file, const char *buf, size_t count, loff_t *ppos)
{
/* Can't seek (pwrite) on this device */
......@@ -198,8 +247,15 @@ static ssize_t wdt_write(struct file *file, const char *buf, size_t count, loff_
return 0;
}
/*
* Read reports the temperature in degrees Fahrenheit.
/**
* wdt_read:
* @file: file handle to the watchdog board
* @buf: buffer to write 1 byte into
* @count: length of buffer
* @ptr: offset (no seek allowed)
*
* Read reports the temperature in degrees Fahrenheit. The API is in
* farenheit. It was designed by an imperial measurement luddite.
*/
static ssize_t wdt_read(struct file *file, char *buf, size_t count, loff_t *ptr)
......@@ -225,6 +281,18 @@ static ssize_t wdt_read(struct file *file, char *buf, size_t count, loff_t *ptr)
}
}
/**
* wdt_ioctl:
* @inode: inode of the device
* @file: file handle to the device
* @cmd: watchdog command
* @arg: argument pointer
*
* The watchdog API defines a common set of functions for all watchdogs
* according to their available features. We only actually usefully support
* querying capabilities and current status.
*/
static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
unsigned long arg)
{
......@@ -254,6 +322,18 @@ static int wdt_ioctl(struct inode *inode, struct file *file, unsigned int cmd,
}
}
/**
* wdt_open:
* @inode: inode of device
* @file: file handle to device
*
* One of our two misc devices has been opened. The watchdog device is
* single open and on opening we load the counters. Counter zero is a
* 100Hz cascade, into counter 1 which downcounts to reboot. When the
* counter triggers counter 2 downcounts the length of the reset pulse
* which set set to be as long as possible.
*/
static int wdt_open(struct inode *inode, struct file *file)
{
switch(MINOR(inode->i_rdev))
......@@ -284,6 +364,18 @@ static int wdt_open(struct inode *inode, struct file *file)
}
}
/**
* wdt_close:
* @inode: inode to board
* @file: file handle to board
*
* The watchdog has a configurable API. There is a religious dispute
* between people who want their watchdog to be able to shut down and
* those who want to be sure if the watchdog manager dies the machine
* reboots. In the former case we disable the counters, in the latter
* case you have to open it again very soon.
*/
static int wdt_release(struct inode *inode, struct file *file)
{
if(MINOR(inode->i_rdev)==WATCHDOG_MINOR)
......@@ -298,8 +390,16 @@ static int wdt_release(struct inode *inode, struct file *file)
return 0;
}
/*
* Notifier for system down
/**
* notify_sys:
* @this: our notifier block
* @code: the event being reported
* @unused: unused
*
* Our notifier is called on system shutdowns. We want to turn the card
* off at reboot otherwise the machine will reboot again during memory
* test or worse yet during the following fsck. This would suck, in fact
* trust me - if it happens it does suck.
*/
static int wdt_notify_sys(struct notifier_block *this, unsigned long code,
......@@ -360,6 +460,16 @@ static struct notifier_block wdt_notifier=
#define wdt_init init_module
/**
* cleanup_module:
*
* Unload the watchdog. You cannot do this with any file handles open.
* If your watchdog is set to continue ticking on close and you unload
* it, well it keeps ticking. We won't get the interrupt but the board
* will not touch PC memory so all is fine. You just have to load a new
* module in 60 seconds or reboot.
*/
void cleanup_module(void)
{
misc_deregister(&wdt_miscdev);
......@@ -373,6 +483,14 @@ void cleanup_module(void)
#endif
/**
* wdt_init:
*
* Set up the WDT watchdog board. All we have to do is grab the
* resources we require and bitch if anyone beat us to them.
* The open() function will actually kick the board off.
*/
int __init wdt_init(void)
{
printk(KERN_INFO "WDT500/501-P driver 0.07 at %X (Interrupt %d)\n", io,irq);
......
......@@ -58,7 +58,7 @@
* packet to arrive. When one arrives it is copied out of the buffer
* and delivered to the kernel. The card is reloaded and off we go.
*
* When transmitting dev->tbusy is set and the card is reset (from
* When transmitting lp->txing is set and the card is reset (from
* receive mode) [possibly losing a packet just received] to command
* mode. A packet is loaded and transmit mode triggered. The interrupt
* handler runs different code for transmit interrupts and can handle
......@@ -129,6 +129,7 @@ static unsigned int netcard_portlist[] __initdata = {
int el1_probe(struct net_device *dev);
static int el1_probe1(struct net_device *dev, int ioaddr);
static int el_open(struct net_device *dev);
static void el_timeout(struct net_device *dev);
static int el_start_xmit(struct sk_buff *skb, struct net_device *dev);
static void el_interrupt(int irq, void *dev_id, struct pt_regs *regs);
static void el_receive(struct net_device *dev);
......@@ -154,6 +155,7 @@ struct net_local
int tx_pkt_start; /* The length of the current Tx packet. */
int collisions; /* Tx collisions this packet */
int loading; /* Spot buffer load collisions */
int txing; /* True if card is in TX mode */
spinlock_t lock; /* Serializing lock */
};
......@@ -370,6 +372,8 @@ static int __init el1_probe1(struct net_device *dev, int ioaddr)
dev->open = &el_open;
dev->hard_start_xmit = &el_start_xmit;
dev->tx_timeout = &el_timeout;
dev->watchdog_timeo = HZ;
dev->stop = &el1_close;
dev->get_stats = &el1_get_stats;
dev->set_multicast_list = &set_multicast_list;
......@@ -412,15 +416,42 @@ static int el_open(struct net_device *dev)
el_reset(dev);
spin_unlock_irqrestore(&lp->lock, flags);
dev->start = 1;
lp->txing = 0; /* Board in RX mode */
outb(AX_RX, AX_CMD); /* Aux control, irq and receive enabled */
netif_start_queue(dev);
MOD_INC_USE_COUNT;
return 0;
}
/**
* e1_start_xmit:
* el_timeout:
* @dev: The 3c501 card that has timed out
*
* Attempt to restart the board. This is basically a mixture of extreme
* violence and prayer
*
*/
static void el_timeout(struct net_device *dev)
{
struct net_local *lp = (struct net_local *)dev->priv;
int ioaddr = dev->base_addr;
if (el_debug)
printk (KERN_DEBUG "%s: transmit timed out, txsr %#2x axsr=%02x rxsr=%02x.\n",
dev->name, inb(TX_STATUS), inb(AX_STATUS), inb(RX_STATUS));
lp->stats.tx_errors++;
outb(TX_NORM, TX_CMD);
outb(RX_NORM, RX_CMD);
outb(AX_OFF, AX_CMD); /* Just trigger a false interrupt. */
outb(AX_RX, AX_CMD); /* Aux control, irq and receive enabled */
lp->txing = 0; /* Ripped back in to RX */
netif_wake_queue(dev);
}
/**
* el_start_xmit:
* @skb: The packet that is queued to be sent
* @dev: The 3c501 card we want to throw it down
*
......@@ -447,32 +478,9 @@ static int el_start_xmit(struct sk_buff *skb, struct net_device *dev)
int ioaddr = dev->base_addr;
unsigned long flags;
if(dev->interrupt) /* May be unloading, don't stamp on */
return 1; /* the packet buffer this time */
if (dev->tbusy)
{
if (jiffies - dev->trans_start < HZ)
{
if (el_debug > 2)
printk(" transmitter busy, deferred.\n");
return 1;
}
if (el_debug)
printk ("%s: transmit timed out, txsr %#2x axsr=%02x rxsr=%02x.\n",
dev->name, inb(TX_STATUS), inb(AX_STATUS), inb(RX_STATUS));
lp->stats.tx_errors++;
outb(TX_NORM, TX_CMD);
outb(RX_NORM, RX_CMD);
outb(AX_OFF, AX_CMD); /* Just trigger a false interrupt. */
outb(AX_RX, AX_CMD); /* Aux control, irq and receive enabled */
dev->tbusy = 0;
dev->trans_start = jiffies;
}
/*
* Avoid incoming interrupts between us flipping tbusy and flipping
* mode as the driver assumes tbusy is a faithful indicator of card
* Avoid incoming interrupts between us flipping txing and flipping
* mode as the driver assumes txing is a faithful indicator of card
* state
*/
......@@ -482,17 +490,13 @@ static int el_start_xmit(struct sk_buff *skb, struct net_device *dev)
* Avoid timer-based retransmission conflicts.
*/
if (test_and_set_bit(0, (void*)&dev->tbusy) != 0)
{
spin_unlock_irqrestore(&lp->lock, flags);
printk(KERN_WARNING "%s: Transmitter access conflict.\n", dev->name);
}
else
netif_stop_queue(dev);
do
{
int gp_start = 0x800 - (ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN);
unsigned char *buf = skb->data;
load_it_again_sam:
lp->tx_pkt_start = gp_start;
lp->collisions = 0;
......@@ -507,7 +511,8 @@ static int el_start_xmit(struct sk_buff *skb, struct net_device *dev)
inb_p(RX_STATUS);
inb_p(TX_STATUS);
lp->loading=1;
lp->loading = 1;
lp->txing = 1;
/*
* Turn interrupts back on while we spend a pleasant afternoon
......@@ -520,23 +525,24 @@ static int el_start_xmit(struct sk_buff *skb, struct net_device *dev)
outw(gp_start, GP_LOW); /* aim - packet will be loaded into buffer start */
outsb(DATAPORT,buf,skb->len); /* load buffer (usual thing each byte increments the pointer) */
outw(gp_start, GP_LOW); /* the board reuses the same register */
if(lp->loading==2) /* A receive upset our load, despite our best efforts */
if(lp->loading != 2)
{
if(el_debug>2)
printk("%s: burped during tx load.\n", dev->name);
spin_lock_irqsave(&lp->lock, flags);
goto load_it_again_sam; /* Sigh... */
outb(AX_XMIT, AX_CMD); /* fire ... Trigger xmit. */
lp->loading=0;
dev->trans_start = jiffies;
if (el_debug > 2)
printk(" queued xmit.\n");
dev_kfree_skb (skb);
return 0;
}
outb(AX_XMIT, AX_CMD); /* fire ... Trigger xmit. */
lp->loading=0;
dev->trans_start = jiffies;
/* A receive upset our load, despite our best efforts */
if(el_debug>2)
printk("%s: burped during tx load.\n", dev->name);
spin_lock_irqsave(&lp->lock, flags);
}
while(1);
if (el_debug > 2)
printk(" queued xmit.\n");
dev_kfree_skb (skb);
return 0;
}
......@@ -570,12 +576,6 @@ static void el_interrupt(int irq, void *dev_id, struct pt_regs *regs)
int ioaddr;
int axsr; /* Aux. status reg. */
if (dev == NULL || dev->irq != irq)
{
printk (KERN_ERR "3c501 driver: irq %d for unknown device.\n", irq);
return;
}
ioaddr = dev->base_addr;
lp = (struct net_local *)dev->priv;
......@@ -593,14 +593,12 @@ static void el_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if (el_debug > 3)
printk(KERN_DEBUG "%s: el_interrupt() aux=%#02x", dev->name, axsr);
if (dev->interrupt)
printk(KERN_WARNING "%s: Reentering the interrupt driver!\n", dev->name);
dev->interrupt = 1;
if(lp->loading==1 && !dev->tbusy)
if(lp->loading==1 && !lp->txing)
printk(KERN_WARNING "%s: Inconsistent state loading while not in tx\n",
dev->name);
if (dev->tbusy)
if (lp->txing)
{
/*
......@@ -618,7 +616,6 @@ static void el_interrupt(int irq, void *dev_id, struct pt_regs *regs)
printk(" txsr=%02x gp=%04x rp=%04x]\n", txsr, inw(GP_LOW),inw(RX_LOW));
}
lp->loading=2; /* Force a reload */
dev->interrupt = 0;
spin_unlock(&lp->lock);
return;
}
......@@ -636,8 +633,8 @@ static void el_interrupt(int irq, void *dev_id, struct pt_regs *regs)
printk("%s: Unusual interrupt during Tx, txsr=%02x axsr=%02x"
" gp=%03x rp=%03x.\n", dev->name, txsr, axsr,
inw(ioaddr + EL1_DATAPTR), inw(ioaddr + EL1_RXPTR));
dev->tbusy = 0;
mark_bh(NET_BH);
lp->txing = 0;
netif_wake_queue(dev);
}
else if (txsr & TX_16COLLISIONS)
{
......@@ -647,7 +644,9 @@ static void el_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if (el_debug)
printk("%s: Transmit failed 16 times, Ethernet jammed?\n",dev->name);
outb(AX_SYS, AX_CMD);
lp->txing = 0;
lp->stats.tx_aborted_errors++;
netif_wake_queue(dev);
}
else if (txsr & TX_COLLISION)
{
......@@ -665,7 +664,6 @@ static void el_interrupt(int irq, void *dev_id, struct pt_regs *regs)
outw(lp->tx_pkt_start, GP_LOW);
outb(AX_XMIT, AX_CMD);
lp->stats.collisions++;
dev->interrupt = 0;
spin_unlock(&lp->lock);
return;
}
......@@ -682,8 +680,8 @@ static void el_interrupt(int irq, void *dev_id, struct pt_regs *regs)
* This is safe the interrupt is atomic WRT itself.
*/
dev->tbusy = 0;
mark_bh(NET_BH); /* In case more to transmit */
lp->txing = 0;
netif_wake_queue(dev); /* In case more to transmit */
}
}
else
......@@ -735,7 +733,6 @@ static void el_interrupt(int irq, void *dev_id, struct pt_regs *regs)
outw(0x00, RX_BUF_CLR);
inb(RX_STATUS); /* Be certain that interrupts are cleared. */
inb(TX_STATUS);
dev->interrupt = 0;
spin_unlock(&lp->lock);
return;
}
......@@ -818,6 +815,7 @@ static void el_receive(struct net_device *dev)
static void el_reset(struct net_device *dev)
{
struct net_local *lp = (struct net_local *)dev->priv;
int ioaddr = dev->base_addr;
if (el_debug> 2)
......@@ -835,8 +833,7 @@ static void el_reset(struct net_device *dev)
outb(RX_NORM, RX_CMD); /* Set Rx commands. */
inb(RX_STATUS); /* Clear status. */
inb(TX_STATUS);
dev->interrupt = 0;
dev->tbusy = 0;
lp->txing = 0;
}
/**
......@@ -857,8 +854,7 @@ static int el1_close(struct net_device *dev)
if (el_debug > 2)
printk("%s: Shutting down Ethernet card at %#x.\n", dev->name, ioaddr);
dev->tbusy = 1;
dev->start = 0;
netif_stop_queue(dev);
/*
* Free and disable the IRQ.
......
......@@ -314,7 +314,6 @@ el2_probe1(struct net_device *dev, int ioaddr)
ei_status.saved_irq = dev->irq;
dev->start = 0;
dev->open = &el2_open;
dev->stop = &el2_close;
......
......@@ -40,7 +40,6 @@ static const char *version =
info that the casual reader might think that it documents the i82586 :-<.
*/
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/types.h>
......@@ -437,9 +436,7 @@ static int el16_open(struct net_device *dev)
/* Initialize the 82586 memory and start it. */
init_82586_mem(dev);
dev->tbusy = 0;
dev->interrupt = 0;
dev->start = 1;
netif_start_queue(dev);
MOD_INC_USE_COUNT;
......@@ -453,7 +450,8 @@ static int el16_send_packet(struct sk_buff *skb, struct net_device *dev)
unsigned long shmem = dev->mem_start;
unsigned long flags;
if (dev->tbusy)
#if 0 /* LINK_STATE_XOFF is never set when we reach here */
if (test_bit(LINK_STATE_XOFF, &dev->flags))
{
/* If we get here, some higher level has decided we are broken.
There should really be a "kick me" function call instead. */
......@@ -476,31 +474,30 @@ static int el16_send_packet(struct sk_buff *skb, struct net_device *dev)
outb(0, ioaddr + SIGNAL_CA); /* Issue channel-attn. */
lp->last_restart = lp->stats.tx_packets;
}
dev->tbusy=0;
netif_start_queue(dev);
dev->trans_start = jiffies;
}
#endif
/* Block a timer-based transmit from overlapping. */
if (test_and_set_bit(0, (void*)&dev->tbusy) != 0)
printk("%s: Transmitter access conflict.\n", dev->name);
else
{
short length = ETH_ZLEN < skb->len ? skb->len : ETH_ZLEN;
unsigned char *buf = skb->data;
spin_lock_irqsave(&lp->lock, flags);
lp->stats.tx_bytes+=length;
/* Disable the 82586's input to the interrupt line. */
outb(0x80, ioaddr + MISC_CTRL);
#ifdef CONFIG_SMP
spin_lock_irqsave(&lp->lock, flags);
hardware_send_packet(dev, buf, length);
spin_unlock_irqrestore(&lp->lock, flags);
#else
hardware_send_packet(dev, buf, length);
#endif
dev->trans_start = jiffies;
/* Enable the 82586 interrupt input. */
outb(0x84, ioaddr + MISC_CTRL);
spin_unlock_irqrestore(&lp->lock, flags);
netif_stop_queue(dev);
}
dev_kfree_skb (skb);
......@@ -524,8 +521,6 @@ static void el16_interrupt(int irq, void *dev_id, struct pt_regs *regs)
printk ("net_interrupt(): irq %d for unknown device.\n", irq);
return;
}
dev->interrupt = 1;
ioaddr = dev->base_addr;
lp = (struct net_local *)dev->priv;
......@@ -553,8 +548,7 @@ static void el16_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if (tx_status & 0x2000) {
lp->stats.tx_packets++;
lp->stats.collisions += tx_status & 0xf;
dev->tbusy = 0;
mark_bh(NET_BH); /* Inform upper layers. */
netif_wake_queue(dev);
} else {
lp->stats.tx_errors++;
if (tx_status & 0x0600) lp->stats.tx_carrier_errors++;
......@@ -580,7 +574,8 @@ static void el16_interrupt(int irq, void *dev_id, struct pt_regs *regs)
/* Acknowledge the interrupt sources. */
ack_cmd = status & 0xf000;
if ((status & 0x0700) != 0x0200 && dev->start) {
if ((status & 0x0700) != 0x0200 &&
(test_bit(LINK_STATE_START, &dev->state))) {
if (net_debug)
printk("%s: Command unit stopped, status %04x, restarting.\n",
dev->name, status);
......@@ -590,7 +585,8 @@ static void el16_interrupt(int irq, void *dev_id, struct pt_regs *regs)
ack_cmd |= CUC_RESUME;
}
if ((status & 0x0070) != 0x0040 && dev->start)
if ((status & 0x0070) != 0x0040 &&
(test_bit(LINK_STATE_START, &dev->state)))
{
static void init_rx_bufs(struct net_device *);
/* The Rx unit is not ready, it must be hung. Restart the receiver by
......@@ -612,8 +608,6 @@ static void el16_interrupt(int irq, void *dev_id, struct pt_regs *regs)
/* Enable the 82586's interrupt input. */
outb(0x84, ioaddr + MISC_CTRL);
spin_unlock(&lp->lock);
return;
}
static int el16_close(struct net_device *dev)
......@@ -621,8 +615,7 @@ static int el16_close(struct net_device *dev)
int ioaddr = dev->base_addr;
unsigned long shmem = dev->mem_start;
dev->tbusy = 1;
dev->start = 0;
netif_stop_queue(dev);
/* Flush the Tx and disable Rx. */
isa_writew(RX_SUSPEND | CUC_SUSPEND,shmem+iSCB_CMD);
......@@ -795,7 +788,7 @@ static void hardware_send_packet(struct net_device *dev, void *buf, short length
}
if (lp->tx_head != lp->tx_reap)
dev->tbusy = 0;
netif_start_queue(dev);
}
static void el16_rx(struct net_device *dev)
......
This diff is collapsed.
This diff is collapsed.
......@@ -157,6 +157,7 @@ extern int mc32_probe(struct net_device *dev);
static int mc32_probe1(struct net_device *dev, int ioaddr);
static int mc32_open(struct net_device *dev);
static void mc32_timeout(struct net_device *dev);
static int mc32_send_packet(struct sk_buff *skb, struct net_device *dev);
static void mc32_interrupt(int irq, void *dev_id, struct pt_regs *regs);
static int mc32_close(struct net_device *dev);
......@@ -456,6 +457,8 @@ static int __init mc32_probe1(struct net_device *dev, int slot)
dev->hard_start_xmit = mc32_send_packet;
dev->get_stats = mc32_get_stats;
dev->set_multicast_list = mc32_set_multicast_list;
dev->tx_timeout = mc32_timeout;
dev->watchdog_timeo = HZ*5; /* Board does all the work */
lp->rx_halted = 1;
lp->tx_halted = 1;
......@@ -850,10 +853,6 @@ static int mc32_open(struct net_device *dev)
u8 one=1;
u8 regs;
dev->tbusy = 0;
dev->interrupt = 0;
dev->start = 1;
/*
* Interrupts enabled
*/
......@@ -902,12 +901,30 @@ static int mc32_open(struct net_device *dev)
mc32_rx_begin(dev);
mc32_tx_begin(dev);
netif_wake_queue(dev);
MOD_INC_USE_COUNT;
return 0;
}
/**
* mc32_timeout:
* @dev: 3c527 that timed out
*
* Handle a timeout on transmit from the 3c527. This normally means
* bad things as the hardware handles cable timeouts and mess for
* us.
*
*/
static void mc32_timeout(struct net_device *dev)
{
printk(KERN_WARNING "%s: transmit timed out?\n", dev->name);
/* Try to restart the adaptor. */
netif_wake_queue(dev);
}
/**
* mc32_send_packet:
* @skb: buffer to transmit
......@@ -927,83 +944,56 @@ static int mc32_open(struct net_device *dev)
static int mc32_send_packet(struct sk_buff *skb, struct net_device *dev)
{
struct mc32_local *lp = (struct mc32_local *)dev->priv;
if (dev->tbusy) {
/*
* If we get here, some higher level has decided we are broken.
* There should really be a "kick me" function call instead.
*/
int tickssofar = jiffies - dev->trans_start;
if (tickssofar < HZ/20)
return 1;
printk(KERN_WARNING "%s: transmit timed out?\n", dev->name);
/* Try to restart the adaptor. */
dev->tbusy=0;
dev->trans_start = jiffies;
}
/*
* Block a timer-based transmit from overlapping. This could better be
* done with atomic_swap(1, dev->tbusy), but set_bit() works as well.
*/
if (test_and_set_bit(0, (void*)&dev->tbusy) != 0)
{
printk(KERN_WARNING "%s: Transmitter access conflict.\n", dev->name);
dev_kfree_skb(skb);
}
else
{
unsigned long flags;
unsigned long flags;
u16 tx_head;
volatile struct skb_header *p, *np;
u16 tx_head;
volatile struct skb_header *p, *np;
save_flags(flags);
cli();
netif_stop_queue(dev);
save_flags(flags);
cli();
if(atomic_read(&lp->tx_count)==0)
{
dev->tbusy=1;
restore_flags(flags);
return 1;
}
tx_head = lp->tx_box->data[0];
atomic_dec(&lp->tx_count);
if(atomic_read(&lp->tx_count)==0)
{
restore_flags(flags);
return 1;
}
/* We will need this to flush the buffer out */
lp->tx_skb[lp->tx_skb_end] = skb;
lp->tx_skb_end++;
lp->tx_skb_end&=(TX_RING_MAX-1);
/* P is the last sending/sent buffer as a pointer */
p=(struct skb_header *)bus_to_virt(lp->base+tx_head);
/* NP is the buffer we will be loading */
np=(struct skb_header *)bus_to_virt(lp->base+p->next);
tx_head = lp->tx_box->data[0];
atomic_dec(&lp->tx_count);
/* We will need this to flush the buffer out */
lp->tx_skb[lp->tx_skb_end] = skb;
lp->tx_skb_end++;
lp->tx_skb_end&=(TX_RING_MAX-1);
/* P is the last sending/sent buffer as a pointer */
p=(struct skb_header *)bus_to_virt(lp->base+tx_head);
/* NP is the buffer we will be loading */
np=(struct skb_header *)bus_to_virt(lp->base+p->next);
np->control |= (1<<6); /* EOL */
wmb();
np->control |= (1<<6); /* EOL */
wmb();
np->length = skb->len;
np->length = skb->len;
if(np->length < 60)
np->length = 60;
if(np->length < 60)
np->length = 60;
np->data = virt_to_bus(skb->data);
np->status = 0;
np->control = (1<<7)|(1<<6); /* EOP EOL */
wmb();
np->data = virt_to_bus(skb->data);
np->status = 0;
np->control = (1<<7)|(1<<6); /* EOP EOL */
wmb();
p->status = 0;
p->control &= ~(1<<6);
dev->tbusy = 0; /* Keep feeding me */
lp->tx_box->mbox=0;
restore_flags(flags);
}
p->status = 0;
p->control &= ~(1<<6);
lp->tx_box->mbox=0;
restore_flags(flags);
netif_wake_queue(dev);
return 0;
}
......@@ -1139,8 +1129,6 @@ static void mc32_interrupt(int irq, void *dev_id, struct pt_regs * regs)
printk(KERN_WARNING "%s: irq %d for unknown device.\n", cardname, irq);
return;
}
dev->interrupt = 1;
ioaddr = dev->base_addr;
lp = (struct mc32_local *)dev->priv;
......@@ -1173,8 +1161,7 @@ static void mc32_interrupt(int irq, void *dev_id, struct pt_regs * regs)
lp->tx_skb_top++;
lp->tx_skb_top&=(TX_RING_MAX-1);
atomic_inc(&lp->tx_count);
dev->tbusy=0;
mark_bh(NET_BH);
netif_wake_queue(dev);
break;
case 3: /* Halt */
case 4: /* Abort */
......@@ -1249,7 +1236,6 @@ static void mc32_interrupt(int irq, void *dev_id, struct pt_regs * regs)
if(rx_event)
mc32_rx_ring(dev);
dev->interrupt = 0;
return;
}
......@@ -1278,6 +1264,8 @@ static int mc32_close(struct net_device *dev)
u8 regs;
u16 one=1;
netif_stop_queue(dev);
/*
* Send the indications on command (handy debug check)
*/
......@@ -1303,9 +1291,6 @@ static int mc32_close(struct net_device *dev)
mc32_flush_rx_ring(lp);
mc32_flush_tx_ring(lp);
dev->tbusy = 1;
dev->start = 0;
/* Update the statistics here. */
MOD_DEC_USE_COUNT;
......
This diff is collapsed.
......@@ -127,7 +127,7 @@ if [ "$CONFIG_NET_ETHERNET" = "y" ]; then
tristate ' Apricot Xen-II on board Ethernet' CONFIG_APRICOT
tristate ' CS89x0 support' CONFIG_CS89x0
tristate ' Generic DECchip & DIGITAL EtherWORKS PCI/EISA' CONFIG_DE4X5
tristate ' DECchip Tulip (dc21x4x) PCI support' CONFIG_DEC_ELCP
tristate ' DECchip Tulip (dc21x4x) PCI support' CONFIG_TULIP
tristate ' Digi Intl. RightSwitch SE-X support' CONFIG_DGRS
tristate ' EtherExpressPro/100 support' CONFIG_EEXPRESS_PRO100
if [ "$CONFIG_EXPERIMENTAL" = "y" ]; then
......
This diff is collapsed.
......@@ -326,9 +326,6 @@ static void ac_block_output(struct net_device *dev, int count,
static int ac_close_card(struct net_device *dev)
{
dev->start = 0;
dev->tbusy = 1;
if (ei_debug > 1)
printk("%s: Shutting down ethercard.\n", dev->name);
......
......@@ -27,7 +27,6 @@
#include <linux/config.h>
#include <linux/module.h>
#include <linux/version.h>
#include <linux/types.h>
#include <linux/errno.h>
#include <linux/ioport.h>
......@@ -86,10 +85,6 @@
#define wmb() mb()
#endif
#if (LINUX_VERSION_CODE < 0x02030e)
#define net_device device
#endif
#include "acenic.h"
/*
......@@ -393,7 +388,7 @@ int ace_allocate_descriptors(struct net_device *dev)
return 1;
}
int __init acenic_probe(void)
static int __init acenic_probe(void)
{
int boards_found = 0;
int version_disp;
......@@ -487,11 +482,7 @@ int __init acenic_probe(void)
* dev->base_addr since it was means for I/O port
* addresses but who gives a damn.
*/
#if (LINUX_VERSION_CODE < 0x02030d)
dev->base_addr = pdev->base_address[0];
#else
dev->base_addr = pdev->resource[0].start;
#endif
ap->regs = (struct ace_regs *)ioremap(dev->base_addr, 0x4000);
if (!ap->regs){
......@@ -575,8 +566,6 @@ int __init acenic_probe(void)
}
#ifdef MODULE
#if LINUX_VERSION_CODE > 0x20118
MODULE_AUTHOR("Jes Sorensen <Jes.Sorensen@cern.ch>");
MODULE_DESCRIPTION("AceNIC/3C985 Gigabit Ethernet driver");
MODULE_PARM(link, "1-" __MODULE_STRING(8) "i");
......@@ -585,10 +574,9 @@ MODULE_PARM(tx_coal_tick, "1-" __MODULE_STRING(8) "i");
MODULE_PARM(max_tx_desc, "1-" __MODULE_STRING(8) "i");
MODULE_PARM(rx_coal_tick, "1-" __MODULE_STRING(8) "i");
MODULE_PARM(max_rx_desc, "1-" __MODULE_STRING(8) "i");
#endif
int init_module(void)
static int __init acenic_init_module (void)
{
int cards;
......@@ -599,7 +587,7 @@ int init_module(void)
}
void cleanup_module(void)
static void __exit acenic_cleanup_module (void)
{
struct ace_private *ap;
struct ace_regs *regs;
......@@ -681,7 +669,9 @@ void cleanup_module(void)
root_dev = next;
}
}
#endif
module_init(acenic_init_module);
module_exit(acenic_cleanup_module);
/*
......
......@@ -16,6 +16,7 @@
#include <linux/string.h>
#include <linux/timer.h>
#include <linux/proc_fs.h>
#include <linux/init.h>
#include <asm/prom.h>
#include <asm/dbdma.h>
#include <asm/io.h>
......@@ -1256,7 +1257,7 @@ static int bmac_reset_and_enable(struct net_device *dev, int enable)
return 1;
}
int bmac_probe(void)
static int __init bmac_probe (void)
{
int j, rev;
struct bmac_data *bp;
......@@ -1265,6 +1266,11 @@ int bmac_probe(void)
static struct device_node *all_bmacs = NULL, *next_bmac;
struct net_device *dev = NULL;
#ifdef MODULE
if(bmac_devs != NULL)
return -EBUSY;
#endif
if (all_bmacs == NULL) {
all_bmacs = find_devices("bmac");
is_bmac_plus = 0;
......@@ -1593,23 +1599,14 @@ bmac_proc_info(char *buffer, char **start, off_t offset, int length)
return len;
}
#ifdef MODULE
MODULE_AUTHOR("Randy Gobbel/Paul Mackerras");
MODULE_DESCRIPTION("PowerMac BMAC ethernet driver.");
int init_module(void)
{
int res;
if(bmac_devs != NULL)
return -EBUSY;
res = bmac_probe();
return res;
}
void cleanup_module(void)
static void __exit bmac_cleanup (void)
{
#ifdef MODULE
struct bmac_data *bp;
if (bmac_devs == 0)
......@@ -1628,6 +1625,8 @@ void cleanup_module(void)
#endif
kfree(bmac_devs);
bmac_devs = NULL;
#endif
}
#endif
module_init(bmac_probe);
module_exit(bmac_cleanup);
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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