Commit f7bad91d authored by Linus Torvalds's avatar Linus Torvalds

v2.4.9 -> v2.4.9.1

  - Jeff Hartmann: DRM AGP/alpha cleanups
  - Ben LaHaise: highmem user pagecopy/clear optimization
  - Vojtech Pavlik: VIA IDE driver update
  - Herbert Xu: make cramfs work with HIGHMEM pages
  - David Fennell: awe32 ram size detection improvement
  - Istvan Varadi: umsdos EMD filename bug fix
  - Keith Owens: make min/max work for pointers too
  - Jan Kara: quota initialization fix
  - Brad Hards: Kaweth USB driver update (enable, and fix endianness)
  - Ralf Baechle: MIPS updates
  - David Gibson: airport driver update
  - Rogier Wolff: firestream ATM driver multi-phy support
  - Daniel Phillips: swap read page referenced set - avoid swap thrashing
parent bb5b6e6c
...@@ -5,6 +5,11 @@ alphabetical order as well, or risk being hunted down like a rabid dog. ...@@ -5,6 +5,11 @@ alphabetical order as well, or risk being hunted down like a rabid dog.
Please try and keep the descriptions small enough to fit on one line. Please try and keep the descriptions small enough to fit on one line.
Thanks -- Paul G. Thanks -- Paul G.
Following translations are available on the WWW:
- Japanese, maintained by the JF Project (JF@linux.or.jp), at
http://www.linux.or.jp/JF/
00-INDEX 00-INDEX
- this file. - this file.
BUG-HUNTING BUG-HUNTING
......
...@@ -1746,6 +1746,36 @@ CONFIG_CPU_R3000 ...@@ -1746,6 +1746,36 @@ CONFIG_CPU_R3000
similar) CPU, R4xx0 might be a safe bet. similar) CPU, R4xx0 might be a safe bet.
If the resulting Kernel does not work try to recompile with R3000. If the resulting Kernel does not work try to recompile with R3000.
CPU type
CONFIG_CPU_VR41XX
The options selects support for the NEC VR41xx series of processors.
Only choose this option if you have one of these processors as a
kernel built with this option will not run on any other type of
processor or vice versa.
CPU feature configuration
CONFIG_CPU_ADVANCED
Saying yes here allows you to select support for various features your
CPU may or may not have. Most people should say N here.
ll and sc instructions
CONFIG_CPU_HAS_LLSC
Say Y here if your CPU has the ll and sc instructions. Say Y here for
better performance, N if you don't know. You must say Y here for
multiprocessor machines.
lld and scd instructions
CONFIG_CPU_HAS_LLDSCD
Say Y here if your CPU has the lld and scd instructions, the 64-bit
equivalents of ll and sc. Say Y here for better performance, N if
you don't know. You must say Y here for multiprocessor machines.
Support for writebuffer flushing
CONFIG_CPU_HAS_WB
Say N here for slightly better performance. You must say Y here for
machines which require flushing of write buffers in software. Saying
Y is the safe option; N may result in kernel malfunction and crashes.
Support for large 64-bit configurations Support for large 64-bit configurations
CONFIG_MIPS_INSANE_LARGE CONFIG_MIPS_INSANE_LARGE
MIPS R10000 does support a 44 bit / 16TB address space as opposed to MIPS R10000 does support a 44 bit / 16TB address space as opposed to
...@@ -11478,6 +11508,45 @@ CONFIG_USB_PEGASUS ...@@ -11478,6 +11508,45 @@ CONFIG_USB_PEGASUS
The module will be called pegasus.o. If you want to compile it as a The module will be called pegasus.o. If you want to compile it as a
module, say M here and read Documentation/modules.txt. module, say M here and read Documentation/modules.txt.
CONFIG_USB_KAWETH
Say Y here if you want to use one of the following 10Mbps only
USB Ethernet adapters based on the KLSI KL5KUSB101B chipset:
3Com 3C19250
ADS USB-10BT
ATEN USB Ethernet
ASANTE USB To Ethernet Adapter
AOX Endpoints USB Ethernet
Correga K.K.
D-Link DSB-650C and DU-E10
Entrega / Portgear E45
I-O DATA USB-ET/T
Jaton USB Ethernet Device Adapter
Kingston Technology USB Ethernet Adapter
Linksys USB10T
Mobility USB-Ethernet Adapter
NetGear EA-101
Peracom Enet and Enet2
Portsmith Express Ethernet Adapter
Shark Pocket Adapter
SMC 2202USB
Sony Vaio port extender
This driver is likely to work with most 10Mbps only USB Ethernet
adapters, including some "no brand" devices. It does NOT work on
SmartBridges smartNIC or on Belkin F5U111 devices - you should use
the CATC NetMate driver for those. If you are not sure which one
you need, select both, and the correct one should be selected for
you.
This driver makes the adapter appear as a normal Ethernet interface,
typically on eth0, if it is the only ethernet device, or perhaps on
eth1, if you have a PCI or ISA ethernet card installed.
This code is also available as a module ( = code which can be
inserted in and removed from the running kernel whenever you want).
The module will be called kaweth.o. If you want to compile it as a
module, say M here and read <file:Documentation/modules.txt>.
USB CATC NetMate-based Ethernet device support USB CATC NetMate-based Ethernet device support
CONFIG_USB_CATC CONFIG_USB_CATC
Say Y if you want to use one of the following 10Mbps USB Ethernet Say Y if you want to use one of the following 10Mbps USB Ethernet
...@@ -15754,6 +15823,14 @@ CONFIG_REMOTE_DEBUG ...@@ -15754,6 +15823,14 @@ CONFIG_REMOTE_DEBUG
better 32 MB RAM to avoid excessive linking time. This is only better 32 MB RAM to avoid excessive linking time. This is only
useful for kernel hackers. If unsure, say N. useful for kernel hackers. If unsure, say N.
Run uncached
CONFIG_MIPS_UNCACHED
If you say Y here there kernel will disable all CPU caches. This will
reduce the system's performance dramatically but can help finding
otherwise hard to track bugs. It can also useful if you're doing
hardware debugging with a logic analyzer and need to see all traffic
on the bus.
Magic System Request Key support Magic System Request Key support
CONFIG_MAGIC_SYSRQ CONFIG_MAGIC_SYSRQ
If you say Y here, you will have some control over the system even If you say Y here, you will have some control over the system even
......
Pete Popov, ppopov@pacbell.net
07/11/2001
This README briefly explains how to use the pci and pci_auto
code in arch/mips/kernel. The code was ported from PowerPC and
modified slightly. It has been tested pretty well on PPC on some
rather complex systems with multiple bridges and devices behind
each bridge. However, at the time this README was written, the
mips port was tested only on boards with a single pci bus and
no P2P bridges. It's very possible that on boards with P2P
bridges some modifications have to be made. The code will
evolve, no doubt, but currently every single mips board
is doing its own pcibios thing and it has become a big
mess. This generic pci code is meant to clean up the mips
pci mess and make it easier to add pci support to new boards.
arch/mips/kernel/pci_auto.c has the pci bus enumeration code.
This code scans the pci bus(es) and assigns all of the resources.
Thus, you don't need the boot code to that, and many boot codes
don't do it correctly anyway. To enable the pci_auto code, add
define_bool CONFIG_PCI_AUTO y
inside the define for your board in arch/mips/config.in.
For example, the Galileo EV96100 board looks like this:
if [ "$CONFIG_MIPS_EV96100" = "y" ]; then
define_bool CONFIG_PCI y
define_bool CONFIG_MIPS_GT96100 y
define_bool CONFIG_NEW_PCI y
define_bool CONFIG_PCI_AUTO y
define_bool CONFIG_SWAP_IO_SPACE y
fi
Next, if you want to use the arch/mips/kernel/pci code, which has the
pcibios_init() function, add
define_bool CONFIG_NEW_PCI y
inside the define for your board. Again, the EV96100 example above
show NEW_PCI turned on.
Note that you can enable CONFIG_NEW_PCI code without enabling
CONFIG_PCI_AUTO. But you can't do the opposite because the pci_auto
routines are called from pcibios_init(), which is part of the
CONFIG_NEW_PCI code.
Now you need to add your files to hook in your pci configuration
cycles. Usually you'll need only a couple of files named something
like pci_fixups.c and pci_ops.c. You can copy the templates
provided and fill in the code.
The file pci_ops.c should contain the pci configuration cycles routines.
It also has the mips_pci_channels[] array which contains the descriptors
of each pci controller.
The file pci_fixups.c contains a few routines to do interrupt fixups,
resources fixups, and, if needed, pci bios fixups.
Usually you'll put your pci_fixups.c file in your board specific directory,
since the functions in that file are board specific. The functions in
pci_ops.c, on the other hand, are usually pci controller specific so that
file could be shared among a few different boards using the same
pci controller.
...@@ -689,8 +689,8 @@ L: linux1394-devel@lists.sourceforge.net ...@@ -689,8 +689,8 @@ L: linux1394-devel@lists.sourceforge.net
S: Orphan S: Orphan
IEEE 1394 OHCI DRIVER IEEE 1394 OHCI DRIVER
P: Sebastien Rougeaux P: Ben Collins
M: sebastien.rougeaux@anu.edu.au M: bcollins@debian.org
L: linux1394-devel@lists.sourceforge.net L: linux1394-devel@lists.sourceforge.net
S: Maintained S: Maintained
...@@ -902,9 +902,9 @@ S: Maintained ...@@ -902,9 +902,9 @@ S: Maintained
MIPS MIPS
P: Ralf Baechle P: Ralf Baechle
M: ralf@gnu.ai.mit.edu M: ralf@gnu.org
W: http://lena.fnet.fr/ W: http://oss.sgi.com/mips/mips-howto.html
L: linux-mips@fnet.fr L: linux-mips@oss.sgi.com
S: Maintained S: Maintained
MISCELLANEOUS MCA-SUPPORT MISCELLANEOUS MCA-SUPPORT
...@@ -1453,6 +1453,13 @@ L: linux-usb-users@lists.sourceforge.net ...@@ -1453,6 +1453,13 @@ L: linux-usb-users@lists.sourceforge.net
L: linux-usb-devel@lists.sourceforge.net L: linux-usb-devel@lists.sourceforge.net
S: Maintained S: Maintained
USB KAWASAKI LSI DRIVER
P: Brad Hards
M: bradh@frogmouth.net
L: linux-usb-users@lists.sourceforge.net
L: linux-usb-devel@lists.sourceforge.net
S: Maintained
USB OHCI DRIVER USB OHCI DRIVER
P: Roman Weissgaerber P: Roman Weissgaerber
M: weissg@vienna.at M: weissg@vienna.at
......
VERSION = 2 VERSION = 2
PATCHLEVEL = 4 PATCHLEVEL = 4
SUBLEVEL = 9 SUBLEVEL = 10
EXTRAVERSION = EXTRAVERSION =-pre1
KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION) KERNELRELEASE=$(VERSION).$(PATCHLEVEL).$(SUBLEVEL)$(EXTRAVERSION)
......
...@@ -77,6 +77,14 @@ EXPORT_SYMBOL(_readl); ...@@ -77,6 +77,14 @@ EXPORT_SYMBOL(_readl);
EXPORT_SYMBOL(_writeb); EXPORT_SYMBOL(_writeb);
EXPORT_SYMBOL(_writew); EXPORT_SYMBOL(_writew);
EXPORT_SYMBOL(_writel); EXPORT_SYMBOL(_writel);
EXPORT_SYMBOL(___raw_readb);
EXPORT_SYMBOL(___raw_readw);
EXPORT_SYMBOL(___raw_readl);
EXPORT_SYMBOL(___raw_readq);
EXPORT_SYMBOL(___raw_writeb);
EXPORT_SYMBOL(___raw_writew);
EXPORT_SYMBOL(___raw_writel);
EXPORT_SYMBOL(___raw_writeq);
EXPORT_SYMBOL(_memcpy_fromio); EXPORT_SYMBOL(_memcpy_fromio);
EXPORT_SYMBOL(_memcpy_toio); EXPORT_SYMBOL(_memcpy_toio);
EXPORT_SYMBOL(_memset_c_io); EXPORT_SYMBOL(_memset_c_io);
......
...@@ -741,6 +741,7 @@ CONFIG_USB_STORAGE=y ...@@ -741,6 +741,7 @@ CONFIG_USB_STORAGE=y
# CONFIG_USB_PLUSB is not set # CONFIG_USB_PLUSB is not set
# CONFIG_USB_PEGASUS is not set # CONFIG_USB_PEGASUS is not set
# CONFIG_USB_CATC is not set # CONFIG_USB_CATC is not set
# CONFIG_USB_KAWETH is not set
# CONFIG_USB_NET1080 is not set # CONFIG_USB_NET1080 is not set
# #
......
...@@ -25,6 +25,7 @@ obj-$(CONFIG_ATM_HORIZON) += horizon.o ...@@ -25,6 +25,7 @@ obj-$(CONFIG_ATM_HORIZON) += horizon.o
obj-$(CONFIG_ATM_AMBASSADOR) += ambassador.o obj-$(CONFIG_ATM_AMBASSADOR) += ambassador.o
obj-$(CONFIG_ATM_TCP) += atmtcp.o obj-$(CONFIG_ATM_TCP) += atmtcp.o
obj-$(CONFIG_ATM_IA) += iphase.o suni.o obj-$(CONFIG_ATM_IA) += iphase.o suni.o
obj-$(CONFIG_ATM_FIRESTREAM) += firestream.o
ifeq ($(CONFIG_ATM_FORE200E_PCA),y) ifeq ($(CONFIG_ATM_FORE200E_PCA),y)
FORE200E_FW_OBJS += fore200e_pca_fw.o FORE200E_FW_OBJS += fore200e_pca_fw.o
......
...@@ -295,6 +295,7 @@ struct reginit_item PHY_NTC_INIT[] __initdata = { ...@@ -295,6 +295,7 @@ struct reginit_item PHY_NTC_INIT[] __initdata = {
static int fs_keystream = 0; static int fs_keystream = 0;
static int fs_maxphy = 1;
#ifdef DEBUG #ifdef DEBUG
/* I didn't forget to set this to zero before shipping. Hit me with a stick /* I didn't forget to set this to zero before shipping. Hit me with a stick
...@@ -308,6 +309,7 @@ static int fs_debug = 0; ...@@ -308,6 +309,7 @@ static int fs_debug = 0;
#ifdef DEBUG #ifdef DEBUG
MODULE_PARM(fs_debug, "i"); MODULE_PARM(fs_debug, "i");
#endif #endif
MODULE_PARM(fs_maxphy, "i");
MODULE_PARM(loopback, "i"); MODULE_PARM(loopback, "i");
MODULE_PARM(num, "i"); MODULE_PARM(num, "i");
MODULE_PARM(fs_keystream, "i"); MODULE_PARM(fs_keystream, "i");
...@@ -866,6 +868,7 @@ static int fs_open(struct atm_vcc *atm_vcc, short vpi, int vci) ...@@ -866,6 +868,7 @@ static int fs_open(struct atm_vcc *atm_vcc, short vpi, int vci)
int bfp; int bfp;
int to; int to;
unsigned short tmc0; unsigned short tmc0;
int uaddr;
func_enter (); func_enter ();
...@@ -908,6 +911,9 @@ static int fs_open(struct atm_vcc *atm_vcc, short vpi, int vci) ...@@ -908,6 +911,9 @@ static int fs_open(struct atm_vcc *atm_vcc, short vpi, int vci)
txtp = &atm_vcc->qos.txtp; txtp = &atm_vcc->qos.txtp;
rxtp = &atm_vcc->qos.rxtp; rxtp = &atm_vcc->qos.rxtp;
/* XXX Use VPI? How many bits? Which bits? */
uaddr = atm_vcc->dev->number - dev->start_number;
if (!test_bit(ATM_VF_PARTIAL, &atm_vcc->flags)) { if (!test_bit(ATM_VF_PARTIAL, &atm_vcc->flags)) {
if (IS_FS50(dev)) { if (IS_FS50(dev)) {
/* Increment the channel numer: take a free one next time. */ /* Increment the channel numer: take a free one next time. */
...@@ -1012,7 +1018,7 @@ static int fs_open(struct atm_vcc *atm_vcc, short vpi, int vci) ...@@ -1012,7 +1018,7 @@ static int fs_open(struct atm_vcc *atm_vcc, short vpi, int vci)
tc->TMC[2] = 0; /* Unused */ tc->TMC[2] = 0; /* Unused */
tc->TMC[3] = 0; /* Unused */ tc->TMC[3] = 0; /* Unused */
tc->spec = 0; /* UTOPIA address, UDF, HEC: Unused -> 0 */ tc->spec = uaddr << 16; /* UTOPIA address, UDF, HEC: Unused -> 0 */
tc->rtag[0] = 0; /* What should I do with routing tags??? tc->rtag[0] = 0; /* What should I do with routing tags???
-- Not used -- AS -- Thanks -- REW*/ -- Not used -- AS -- Thanks -- REW*/
tc->rtag[1] = 0; tc->rtag[1] = 0;
...@@ -1081,7 +1087,7 @@ static int fs_open(struct atm_vcc *atm_vcc, short vpi, int vci) ...@@ -1081,7 +1087,7 @@ static int fs_open(struct atm_vcc *atm_vcc, short vpi, int vci)
submit_command (dev, &dev->hp_txq, submit_command (dev, &dev->hp_txq,
QE_CMD_REG_WR | QE_CMD_IMM_INQ, QE_CMD_REG_WR | QE_CMD_IMM_INQ,
0x80 + vcc->channo, 0x80 + vcc->channo,
(vpi << 16) | vci, 0 ); /* XXX -- Use defines. */ (uaddr << 28) | (vpi << 16) | vci, 0 ); /* XXX -- Use defines. */
} }
submit_command (dev, &dev->hp_txq, submit_command (dev, &dev->hp_txq,
QE_CMD_RX_EN | QE_CMD_IMM_INQ | vcc->channo, QE_CMD_RX_EN | QE_CMD_IMM_INQ | vcc->channo,
...@@ -1772,8 +1778,10 @@ static int __init fs_init (struct fs_dev *dev) ...@@ -1772,8 +1778,10 @@ static int __init fs_init (struct fs_dev *dev)
if (IS_FS50 (dev)) { if (IS_FS50 (dev)) {
write_fs (dev, RAS0, RAS0_DCD_XHLT); write_fs (dev, RAS0, RAS0_DCD_XHLT);
dev->atm_dev->ci_range.vpi_bits = 12; for (i=0;i<fs_maxphy;i++) {
dev->atm_dev->ci_range.vci_bits = 16; dev->atm_dev[i]->ci_range.vpi_bits = 12;
dev->atm_dev[i]->ci_range.vci_bits = 16;
}
dev->nchannels = FS50_NR_CHANNELS; dev->nchannels = FS50_NR_CHANNELS;
} else { } else {
write_fs (dev, RAS0, RAS0_DCD_XHLT write_fs (dev, RAS0, RAS0_DCD_XHLT
...@@ -1781,8 +1789,10 @@ static int __init fs_init (struct fs_dev *dev) ...@@ -1781,8 +1789,10 @@ static int __init fs_init (struct fs_dev *dev)
| (((1 << FS155_VCI_BITS) - 1) * RAS0_VCSEL)); | (((1 << FS155_VCI_BITS) - 1) * RAS0_VCSEL));
/* We can chose the split arbitarily. We might be able to /* We can chose the split arbitarily. We might be able to
support more. Whatever. This should do for now. */ support more. Whatever. This should do for now. */
dev->atm_dev->ci_range.vpi_bits = FS155_VPI_BITS; for (i=0;i<fs_maxphy;i++) {
dev->atm_dev->ci_range.vci_bits = FS155_VCI_BITS; dev->atm_dev[i]->ci_range.vpi_bits = FS155_VPI_BITS;
dev->atm_dev[i]->ci_range.vci_bits = FS155_VCI_BITS;
}
/* Address bits we can't use should be compared to 0. */ /* Address bits we can't use should be compared to 0. */
write_fs (dev, RAC, 0); write_fs (dev, RAC, 0);
...@@ -1817,9 +1827,14 @@ static int __init fs_init (struct fs_dev *dev) ...@@ -1817,9 +1827,14 @@ static int __init fs_init (struct fs_dev *dev)
} }
memset (dev->tx_inuse, 0, dev->nchannels / 8); memset (dev->tx_inuse, 0, dev->nchannels / 8);
/* -- RAS1 : FS155 and 50 differ. Default (0) should be OK for both */ if (IS_FS50 (dev)) {
/* -- RAS2 : FS50 only: Default is OK. */ /* -- RAS1 : FS155 and 50 differ. Default (0) should be OK for FS155, FS50/multiphy needs the maxPHY set... */
write_fs (dev, RAS1, (fs_maxphy - 1) * RAS1_UTREG);
/* -- RAS2 : FS50 only: Default is OK. */
/* Enable selecting for Utopia address for multiphy configs. */
write_fs (dev, RAS2, RAS2_USEL);
}
/* DMAMODE, default should be OK. -- REW */ /* DMAMODE, default should be OK. -- REW */
write_fs (dev, DMAMR, DMAMR_TX_MODE_FULL); write_fs (dev, DMAMR, DMAMR_TX_MODE_FULL);
...@@ -1888,7 +1903,8 @@ static int __init fs_init (struct fs_dev *dev) ...@@ -1888,7 +1903,8 @@ static int __init fs_init (struct fs_dev *dev)
add_timer (&dev->timer); add_timer (&dev->timer);
#endif #endif
dev->atm_dev->dev_data = dev; for (i=0;i<fs_maxphy;i++)
dev->atm_dev[i]->dev_data = dev;
func_exit (); func_exit ();
return 0; return 0;
...@@ -1897,9 +1913,9 @@ static int __init fs_init (struct fs_dev *dev) ...@@ -1897,9 +1913,9 @@ static int __init fs_init (struct fs_dev *dev)
static int __init firestream_init_one (struct pci_dev *pci_dev, static int __init firestream_init_one (struct pci_dev *pci_dev,
const struct pci_device_id *ent) const struct pci_device_id *ent)
{ {
struct atm_dev *atm_dev;
struct fs_dev *fs_dev; struct fs_dev *fs_dev;
int i;
if (pci_enable_device(pci_dev)) if (pci_enable_device(pci_dev))
goto err_out; goto err_out;
...@@ -1910,13 +1926,17 @@ static int __init firestream_init_one (struct pci_dev *pci_dev, ...@@ -1910,13 +1926,17 @@ static int __init firestream_init_one (struct pci_dev *pci_dev,
goto err_out; goto err_out;
memset (fs_dev, 0, sizeof (struct fs_dev)); memset (fs_dev, 0, sizeof (struct fs_dev));
atm_dev = atm_dev_register("fs", &ops, -1, NULL); for (i=0;i<fs_maxphy;i++) {
if (!atm_dev) fs_dev->atm_dev[i] = atm_dev_register("fs", &ops, -1, NULL);
goto err_out_free_fs_dev; if (!fs_dev->atm_dev[i])
goto err_out_free_atm_dev;
}
/* XXX if another device is registering atm devices at the same time
we get confusion. */
fs_dev->start_number = fs_dev->atm_dev[0]->number;
fs_dev->pci_dev = pci_dev; fs_dev->pci_dev = pci_dev;
fs_dev->atm_dev = atm_dev;
fs_dev->flags = ent->driver_data; fs_dev->flags = ent->driver_data;
if (fs_init(fs_dev)) if (fs_init(fs_dev))
...@@ -1927,7 +1947,8 @@ static int __init firestream_init_one (struct pci_dev *pci_dev, ...@@ -1927,7 +1947,8 @@ static int __init firestream_init_one (struct pci_dev *pci_dev,
return 0; return 0;
err_out_free_atm_dev: err_out_free_atm_dev:
atm_dev_deregister(atm_dev); for (i--;i >= 0;i--)
atm_dev_deregister(fs_dev->atm_dev[i]);
err_out_free_fs_dev: err_out_free_fs_dev:
kfree(fs_dev); kfree(fs_dev);
err_out: err_out:
...@@ -2002,7 +2023,9 @@ void __devexit firestream_remove_one (struct pci_dev *pdev) ...@@ -2002,7 +2023,9 @@ void __devexit firestream_remove_one (struct pci_dev *pdev)
free_irq (dev->irq, dev); free_irq (dev->irq, dev);
del_timer (&dev->timer); del_timer (&dev->timer);
atm_dev_deregister(dev->atm_dev); for (i=0;i<fs_maxphy;i++)
atm_dev_deregister(dev->atm_dev[i]);
free_queue (dev, &dev->hp_txq); free_queue (dev, &dev->hp_txq);
free_queue (dev, &dev->lp_txq); free_queue (dev, &dev->lp_txq);
free_queue (dev, &dev->tx_relq); free_queue (dev, &dev->tx_relq);
......
...@@ -345,13 +345,15 @@ struct FS_BPENTRY { ...@@ -345,13 +345,15 @@ struct FS_BPENTRY {
#define CELLOSCONF_COST (0x1 << 0) #define CELLOSCONF_COST (0x1 << 0)
/* Bits? */ /* Bits? */
#define RAS0 0x1bc #define RAS0 0x1bc
#define RAS0_DCD_XHLT (0x1 << 31) #define RAS0_DCD_XHLT (0x1 << 31)
#define RAS0_VPSEL (0x1 << 16) #define RAS0_VPSEL (0x1 << 16)
#define RAS0_VCSEL (0x1 << 0) #define RAS0_VCSEL (0x1 << 0)
#define RAS1 0x1c0
#define RAS1_UTREG (0x1 << 5)
#define DMAMR 0x1cc #define DMAMR 0x1cc
#define DMAMR_TX_MODE_FULL (0x0 << 0) #define DMAMR_TX_MODE_FULL (0x0 << 0)
...@@ -360,6 +362,14 @@ struct FS_BPENTRY { ...@@ -360,6 +362,14 @@ struct FS_BPENTRY {
#define RAS2 0x280
#define RAS2_NNI (0x1 << 0)
#define RAS2_USEL (0x1 << 1)
#define RAS2_UBS (0x1 << 2)
struct fs_transmit_config { struct fs_transmit_config {
u32 flags; u32 flags;
u32 atm_hdr; u32 atm_hdr;
...@@ -456,6 +466,7 @@ struct freepool { ...@@ -456,6 +466,7 @@ struct freepool {
int n; int n;
}; };
#define MAX_PHY 0x20
struct fs_dev { struct fs_dev {
struct fs_dev *next; /* other FS devices */ struct fs_dev *next; /* other FS devices */
...@@ -463,8 +474,9 @@ struct fs_dev { ...@@ -463,8 +474,9 @@ struct fs_dev {
unsigned char irq; /* IRQ */ unsigned char irq; /* IRQ */
struct pci_dev *pci_dev; /* PCI stuff */ struct pci_dev *pci_dev; /* PCI stuff */
struct atm_dev *atm_dev; struct atm_dev *atm_dev[MAX_PHY];
struct timer_list timer; struct timer_list timer;
int start_number;
unsigned long hw_base; /* mem base address */ unsigned long hw_base; /* mem base address */
unsigned long base; /* Mapping of base address */ unsigned long base; /* Mapping of base address */
......
...@@ -101,6 +101,7 @@ struct agp_bridge_data { ...@@ -101,6 +101,7 @@ struct agp_bridge_data {
int num_aperture_sizes; int num_aperture_sizes;
int num_of_masks; int num_of_masks;
int capndx; int capndx;
int cant_use_aperture;
/* Links to driver specific functions */ /* Links to driver specific functions */
......
...@@ -305,6 +305,9 @@ static int agp_return_size(void) ...@@ -305,6 +305,9 @@ static int agp_return_size(void)
void agp_copy_info(agp_kern_info * info) void agp_copy_info(agp_kern_info * info)
{ {
unsigned long page_mask = 0;
int i;
memset(info, 0, sizeof(agp_kern_info)); memset(info, 0, sizeof(agp_kern_info));
if (agp_bridge.type == NOT_SUPPORTED) { if (agp_bridge.type == NOT_SUPPORTED) {
info->chipset = agp_bridge.type; info->chipset = agp_bridge.type;
...@@ -319,6 +322,12 @@ void agp_copy_info(agp_kern_info * info) ...@@ -319,6 +322,12 @@ void agp_copy_info(agp_kern_info * info)
info->aper_size = agp_return_size(); info->aper_size = agp_return_size();
info->max_memory = agp_bridge.max_memory_agp; info->max_memory = agp_bridge.max_memory_agp;
info->current_memory = atomic_read(&agp_bridge.current_memory_agp); info->current_memory = atomic_read(&agp_bridge.current_memory_agp);
info->cant_use_aperture = agp_bridge.cant_use_aperture;
for(i = 0; i < agp_bridge.num_of_masks; i++)
page_mask |= agp_bridge.mask_memory(page_mask, i);
info->page_mask = ~page_mask;
} }
/* End - Routine to copy over information structure */ /* End - Routine to copy over information structure */
...@@ -1083,6 +1092,7 @@ static int __init intel_i810_setup(struct pci_dev *i810_dev) ...@@ -1083,6 +1092,7 @@ static int __init intel_i810_setup(struct pci_dev *i810_dev)
agp_bridge.free_by_type = intel_i810_free_by_type; agp_bridge.free_by_type = intel_i810_free_by_type;
agp_bridge.agp_alloc_page = agp_generic_alloc_page; agp_bridge.agp_alloc_page = agp_generic_alloc_page;
agp_bridge.agp_destroy_page = agp_generic_destroy_page; agp_bridge.agp_destroy_page = agp_generic_destroy_page;
agp_bridge.cant_use_aperture = 0;
return 0; return 0;
} }
...@@ -1275,6 +1285,7 @@ static int __init intel_generic_setup (struct pci_dev *pdev) ...@@ -1275,6 +1285,7 @@ static int __init intel_generic_setup (struct pci_dev *pdev)
agp_bridge.free_by_type = agp_generic_free_by_type; agp_bridge.free_by_type = agp_generic_free_by_type;
agp_bridge.agp_alloc_page = agp_generic_alloc_page; agp_bridge.agp_alloc_page = agp_generic_alloc_page;
agp_bridge.agp_destroy_page = agp_generic_destroy_page; agp_bridge.agp_destroy_page = agp_generic_destroy_page;
agp_bridge.cant_use_aperture = 0;
return 0; return 0;
...@@ -1305,6 +1316,7 @@ static int __init intel_840_setup (struct pci_dev *pdev) ...@@ -1305,6 +1316,7 @@ static int __init intel_840_setup (struct pci_dev *pdev)
agp_bridge.free_by_type = agp_generic_free_by_type; agp_bridge.free_by_type = agp_generic_free_by_type;
agp_bridge.agp_alloc_page = agp_generic_alloc_page; agp_bridge.agp_alloc_page = agp_generic_alloc_page;
agp_bridge.agp_destroy_page = agp_generic_destroy_page; agp_bridge.agp_destroy_page = agp_generic_destroy_page;
agp_bridge.cant_use_aperture = 0;
return 0; return 0;
...@@ -1335,6 +1347,7 @@ static int __init intel_850_setup (struct pci_dev *pdev) ...@@ -1335,6 +1347,7 @@ static int __init intel_850_setup (struct pci_dev *pdev)
agp_bridge.free_by_type = agp_generic_free_by_type; agp_bridge.free_by_type = agp_generic_free_by_type;
agp_bridge.agp_alloc_page = agp_generic_alloc_page; agp_bridge.agp_alloc_page = agp_generic_alloc_page;
agp_bridge.agp_destroy_page = agp_generic_destroy_page; agp_bridge.agp_destroy_page = agp_generic_destroy_page;
agp_bridge.cant_use_aperture = 0;
return 0; return 0;
...@@ -1452,6 +1465,7 @@ static int __init via_generic_setup (struct pci_dev *pdev) ...@@ -1452,6 +1465,7 @@ static int __init via_generic_setup (struct pci_dev *pdev)
agp_bridge.free_by_type = agp_generic_free_by_type; agp_bridge.free_by_type = agp_generic_free_by_type;
agp_bridge.agp_alloc_page = agp_generic_alloc_page; agp_bridge.agp_alloc_page = agp_generic_alloc_page;
agp_bridge.agp_destroy_page = agp_generic_destroy_page; agp_bridge.agp_destroy_page = agp_generic_destroy_page;
agp_bridge.cant_use_aperture = 0;
return 0; return 0;
...@@ -1563,6 +1577,7 @@ static int __init sis_generic_setup (struct pci_dev *pdev) ...@@ -1563,6 +1577,7 @@ static int __init sis_generic_setup (struct pci_dev *pdev)
agp_bridge.free_by_type = agp_generic_free_by_type; agp_bridge.free_by_type = agp_generic_free_by_type;
agp_bridge.agp_alloc_page = agp_generic_alloc_page; agp_bridge.agp_alloc_page = agp_generic_alloc_page;
agp_bridge.agp_destroy_page = agp_generic_destroy_page; agp_bridge.agp_destroy_page = agp_generic_destroy_page;
agp_bridge.cant_use_aperture = 0;
return 0; return 0;
} }
...@@ -1938,6 +1953,7 @@ static int __init amd_irongate_setup (struct pci_dev *pdev) ...@@ -1938,6 +1953,7 @@ static int __init amd_irongate_setup (struct pci_dev *pdev)
agp_bridge.free_by_type = agp_generic_free_by_type; agp_bridge.free_by_type = agp_generic_free_by_type;
agp_bridge.agp_alloc_page = agp_generic_alloc_page; agp_bridge.agp_alloc_page = agp_generic_alloc_page;
agp_bridge.agp_destroy_page = agp_generic_destroy_page; agp_bridge.agp_destroy_page = agp_generic_destroy_page;
agp_bridge.cant_use_aperture = 0;
return 0; return 0;
...@@ -2181,6 +2197,7 @@ static int __init ali_generic_setup (struct pci_dev *pdev) ...@@ -2181,6 +2197,7 @@ static int __init ali_generic_setup (struct pci_dev *pdev)
agp_bridge.free_by_type = agp_generic_free_by_type; agp_bridge.free_by_type = agp_generic_free_by_type;
agp_bridge.agp_alloc_page = ali_alloc_page; agp_bridge.agp_alloc_page = ali_alloc_page;
agp_bridge.agp_destroy_page = ali_destroy_page; agp_bridge.agp_destroy_page = ali_destroy_page;
agp_bridge.cant_use_aperture = 0;
return 0; return 0;
...@@ -2766,6 +2783,7 @@ static int __init serverworks_setup (struct pci_dev *pdev) ...@@ -2766,6 +2783,7 @@ static int __init serverworks_setup (struct pci_dev *pdev)
agp_bridge.free_by_type = agp_generic_free_by_type; agp_bridge.free_by_type = agp_generic_free_by_type;
agp_bridge.agp_alloc_page = agp_generic_alloc_page; agp_bridge.agp_alloc_page = agp_generic_alloc_page;
agp_bridge.agp_destroy_page = agp_generic_destroy_page; agp_bridge.agp_destroy_page = agp_generic_destroy_page;
agp_bridge.cant_use_aperture = 0;
pci_read_config_dword(agp_bridge.dev, pci_read_config_dword(agp_bridge.dev,
SVWRKS_APSIZE, SVWRKS_APSIZE,
......
...@@ -72,8 +72,6 @@ static void DRM(ati_free_pcigart_table)( unsigned long address ) ...@@ -72,8 +72,6 @@ static void DRM(ati_free_pcigart_table)( unsigned long address )
int i; int i;
DRM_DEBUG( "%s\n", __FUNCTION__ ); DRM_DEBUG( "%s\n", __FUNCTION__ );
if ( !address ) return;
page = virt_to_page( address ); page = virt_to_page( address );
for ( i = 0 ; i <= ATI_PCIGART_TABLE_PAGES ; i++, page++ ) { for ( i = 0 ; i <= ATI_PCIGART_TABLE_PAGES ; i++, page++ ) {
...@@ -84,23 +82,40 @@ static void DRM(ati_free_pcigart_table)( unsigned long address ) ...@@ -84,23 +82,40 @@ static void DRM(ati_free_pcigart_table)( unsigned long address )
free_pages( address, ATI_PCIGART_TABLE_ORDER ); free_pages( address, ATI_PCIGART_TABLE_ORDER );
} }
unsigned long DRM(ati_pcigart_init)( drm_device_t *dev ) int DRM(ati_pcigart_init)( drm_device_t *dev,
unsigned long *addr,
dma_addr_t *bus_addr)
{ {
drm_sg_mem_t *entry = dev->sg; drm_sg_mem_t *entry = dev->sg;
unsigned long address; unsigned long address = 0;
unsigned long pages; unsigned long pages;
u32 *pci_gart, page_base; u32 *pci_gart, page_base, bus_address = 0;
int i, j; int i, j, ret = 0;
if ( !entry ) { if ( !entry ) {
DRM_ERROR( "no scatter/gather memory!\n" ); DRM_ERROR( "no scatter/gather memory!\n" );
return 0; goto done;
} }
address = DRM(ati_alloc_pcigart_table)(); address = DRM(ati_alloc_pcigart_table)();
if ( !address ) { if ( !address ) {
DRM_ERROR( "cannot allocate PCI GART page!\n" ); DRM_ERROR( "cannot allocate PCI GART page!\n" );
return 0; goto done;
}
if ( !dev->pdev ) {
DRM_ERROR( "PCI device unknown!\n" );
goto done;
}
bus_address = pci_map_single(dev->pdev, (void *)address,
ATI_PCIGART_TABLE_PAGES * PAGE_SIZE,
PCI_DMA_TODEVICE);
if (bus_address == 0) {
DRM_ERROR( "unable to map PCIGART pages!\n" );
DRM(ati_free_pcigart_table)( address );
address = 0;
goto done;
} }
pci_gart = (u32 *)address; pci_gart = (u32 *)address;
...@@ -111,28 +126,72 @@ unsigned long DRM(ati_pcigart_init)( drm_device_t *dev ) ...@@ -111,28 +126,72 @@ unsigned long DRM(ati_pcigart_init)( drm_device_t *dev )
memset( pci_gart, 0, ATI_MAX_PCIGART_PAGES * sizeof(u32) ); memset( pci_gart, 0, ATI_MAX_PCIGART_PAGES * sizeof(u32) );
for ( i = 0 ; i < pages ; i++ ) { for ( i = 0 ; i < pages ; i++ ) {
page_base = page_to_bus( entry->pagelist[i] ); /* we need to support large memory configurations */
entry->busaddr[i] = pci_map_single(dev->pdev,
page_address( entry->pagelist[i] ),
PAGE_SIZE,
PCI_DMA_TODEVICE);
if (entry->busaddr[i] == 0) {
DRM_ERROR( "unable to map PCIGART pages!\n" );
DRM(ati_pcigart_cleanup)( dev, address, bus_address );
address = 0;
bus_address = 0;
goto done;
}
page_base = (u32) entry->busaddr[i];
for (j = 0; j < (PAGE_SIZE / ATI_PCIGART_PAGE_SIZE); j++) { for (j = 0; j < (PAGE_SIZE / ATI_PCIGART_PAGE_SIZE); j++) {
*pci_gart++ = cpu_to_le32( page_base ); *pci_gart++ = cpu_to_le32( page_base );
page_base += ATI_PCIGART_PAGE_SIZE; page_base += ATI_PCIGART_PAGE_SIZE;
} }
} }
ret = 1;
#if __i386__ #if __i386__
asm volatile ( "wbinvd" ::: "memory" ); asm volatile ( "wbinvd" ::: "memory" );
#else #else
mb(); mb();
#endif #endif
return address; done:
*addr = address;
*bus_addr = bus_address;
return ret;
} }
int DRM(ati_pcigart_cleanup)( unsigned long address ) int DRM(ati_pcigart_cleanup)( drm_device_t *dev,
unsigned long addr,
dma_addr_t bus_addr)
{ {
drm_sg_mem_t *entry = dev->sg;
unsigned long pages;
int i;
if ( address ) { /* we need to support large memory configurations */
DRM(ati_free_pcigart_table)( address ); if ( !entry ) {
DRM_ERROR( "no scatter/gather memory!\n" );
return 0;
}
if ( bus_addr ) {
pci_unmap_single(dev->pdev, bus_addr,
ATI_PCIGART_TABLE_PAGES * PAGE_SIZE,
PCI_DMA_TODEVICE);
pages = ( entry->pages <= ATI_MAX_PCIGART_PAGES )
? entry->pages : ATI_MAX_PCIGART_PAGES;
for ( i = 0 ; i < pages ; i++ ) {
if ( !entry->busaddr[i] ) break;
pci_unmap_single(dev->pdev, entry->busaddr[i],
PAGE_SIZE, PCI_DMA_TODEVICE);
}
}
if ( addr ) {
DRM(ati_free_pcigart_table)( addr );
} }
return 0; return 1;
} }
...@@ -76,6 +76,17 @@ ...@@ -76,6 +76,17 @@
#include <asm/pgalloc.h> #include <asm/pgalloc.h>
#include "drm.h" #include "drm.h"
/* page_to_bus for earlier kernels, not optimal in all cases */
#ifndef page_to_bus
#define page_to_bus(page) ((unsigned int)(virt_to_bus(page_address(page))))
#endif
/* We just use virt_to_bus for pci_map_single on older kernels */
#if LINUX_VERSION_CODE < 0x020400
#define pci_map_single(hwdev, ptr, size, direction) virt_to_bus(ptr)
#define pci_unmap_single(hwdev, dma_addr, size, direction)
#endif
/* DRM template customization defaults /* DRM template customization defaults
*/ */
#ifndef __HAVE_AGP #ifndef __HAVE_AGP
...@@ -616,6 +627,8 @@ typedef struct drm_agp_head { ...@@ -616,6 +627,8 @@ typedef struct drm_agp_head {
int acquired; int acquired;
unsigned long base; unsigned long base;
int agp_mtrr; int agp_mtrr;
int cant_use_aperture;
unsigned long page_mask;
} drm_agp_head_t; } drm_agp_head_t;
#endif #endif
...@@ -624,6 +637,7 @@ typedef struct drm_sg_mem { ...@@ -624,6 +637,7 @@ typedef struct drm_sg_mem {
void *virtual; void *virtual;
int pages; int pages;
struct page **pagelist; struct page **pagelist;
dma_addr_t *busaddr;
} drm_sg_mem_t; } drm_sg_mem_t;
typedef struct drm_sigdata { typedef struct drm_sigdata {
...@@ -714,6 +728,7 @@ typedef struct drm_device { ...@@ -714,6 +728,7 @@ typedef struct drm_device {
#if __REALLY_HAVE_AGP #if __REALLY_HAVE_AGP
drm_agp_head_t *agp; drm_agp_head_t *agp;
#endif #endif
struct pci_dev *pdev;
#ifdef __alpha__ #ifdef __alpha__
#if LINUX_VERSION_CODE < 0x020403 #if LINUX_VERSION_CODE < 0x020403
struct pci_controler *hose; struct pci_controler *hose;
...@@ -1018,8 +1033,12 @@ extern int DRM(sg_free)(struct inode *inode, struct file *filp, ...@@ -1018,8 +1033,12 @@ extern int DRM(sg_free)(struct inode *inode, struct file *filp,
#endif #endif
/* ATI PCIGART support (ati_pcigart.h) */ /* ATI PCIGART support (ati_pcigart.h) */
extern unsigned long DRM(ati_pcigart_init)(drm_device_t *dev); extern int DRM(ati_pcigart_init)(drm_device_t *dev,
extern int DRM(ati_pcigart_cleanup)(unsigned long address); unsigned long *addr,
dma_addr_t *bus_addr);
extern int DRM(ati_pcigart_cleanup)(drm_device_t *dev,
unsigned long addr,
dma_addr_t bus_addr);
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
#endif #endif
...@@ -316,6 +316,14 @@ drm_agp_head_t *DRM(agp_init)(void) ...@@ -316,6 +316,14 @@ drm_agp_head_t *DRM(agp_init)(void)
default: head->chipset = "Unknown"; break; default: head->chipset = "Unknown"; break;
} }
#if LINUX_VERSION_CODE <= 0x020408
head->cant_use_aperture = 0;
head->page_mask = ~(0xfff);
#else
head->cant_use_aperture = head->agp_info.cant_use_aperture;
head->page_mask = head->agp_info.page_mask;
#endif
DRM_INFO("AGP %d.%d on %s @ 0x%08lx %ZuMB\n", DRM_INFO("AGP %d.%d on %s @ 0x%08lx %ZuMB\n",
head->agp_info.version.major, head->agp_info.version.major,
head->agp_info.version.minor, head->agp_info.version.minor,
......
...@@ -98,7 +98,6 @@ int DRM(setunique)(struct inode *inode, struct file *filp, ...@@ -98,7 +98,6 @@ int DRM(setunique)(struct inode *inode, struct file *filp,
} }
sprintf(dev->devname, "%s@%s", dev->name, dev->unique); sprintf(dev->devname, "%s@%s", dev->name, dev->unique);
#ifdef __alpha__
do { do {
struct pci_dev *pci_dev; struct pci_dev *pci_dev;
int b, d, f; int b, d, f;
...@@ -114,10 +113,13 @@ int DRM(setunique)(struct inode *inode, struct file *filp, ...@@ -114,10 +113,13 @@ int DRM(setunique)(struct inode *inode, struct file *filp,
if (*p) break; if (*p) break;
pci_dev = pci_find_slot(b, PCI_DEVFN(d,f)); pci_dev = pci_find_slot(b, PCI_DEVFN(d,f));
if (pci_dev) if (pci_dev) {
dev->hose = pci_dev->sysdata; dev->pdev = pci_dev;
} while(0); #ifdef __alpha__
dev->hose = pci_dev->sysdata;
#endif #endif
}
} while(0);
return 0; return 0;
} }
......
...@@ -47,12 +47,15 @@ void DRM(sg_cleanup)( drm_sg_mem_t *entry ) ...@@ -47,12 +47,15 @@ void DRM(sg_cleanup)( drm_sg_mem_t *entry )
vfree( entry->virtual ); vfree( entry->virtual );
DRM(free)( entry->busaddr,
entry->pages * sizeof(*entry->busaddr),
DRM_MEM_PAGES );
DRM(free)( entry->pagelist, DRM(free)( entry->pagelist,
entry->pages * sizeof(*entry->pagelist), entry->pages * sizeof(*entry->pagelist),
DRM_MEM_PAGES ); DRM_MEM_PAGES );
DRM(free)( entry, DRM(free)( entry,
sizeof(*entry), sizeof(*entry),
DRM_MEM_SGLISTS ); DRM_MEM_SGLISTS );
} }
int DRM(sg_alloc)( struct inode *inode, struct file *filp, int DRM(sg_alloc)( struct inode *inode, struct file *filp,
...@@ -93,16 +96,31 @@ int DRM(sg_alloc)( struct inode *inode, struct file *filp, ...@@ -93,16 +96,31 @@ int DRM(sg_alloc)( struct inode *inode, struct file *filp,
DRM(free)( entry, sizeof(*entry), DRM_MEM_SGLISTS ); DRM(free)( entry, sizeof(*entry), DRM_MEM_SGLISTS );
return -ENOMEM; return -ENOMEM;
} }
memset(entry->pagelist, 0, pages * sizeof(*entry->pagelist));
entry->busaddr = DRM(alloc)( pages * sizeof(*entry->busaddr),
DRM_MEM_PAGES );
if ( !entry->busaddr ) {
DRM(free)( entry->pagelist,
entry->pages * sizeof(*entry->pagelist),
DRM_MEM_PAGES );
DRM(free)( entry,
sizeof(*entry),
DRM_MEM_SGLISTS );
return -ENOMEM;
}
memset( (void *)entry->busaddr, 0, pages * sizeof(*entry->busaddr) );
entry->virtual = vmalloc_32( pages << PAGE_SHIFT ); entry->virtual = vmalloc_32( pages << PAGE_SHIFT );
if ( !entry->virtual ) { if ( !entry->virtual ) {
DRM(free)( entry->busaddr,
entry->pages * sizeof(*entry->busaddr),
DRM_MEM_PAGES );
DRM(free)( entry->pagelist, DRM(free)( entry->pagelist,
entry->pages * sizeof(*entry->pagelist), entry->pages * sizeof(*entry->pagelist),
DRM_MEM_PAGES ); DRM_MEM_PAGES );
DRM(free)( entry, DRM(free)( entry,
sizeof(*entry), sizeof(*entry),
DRM_MEM_SGLISTS ); DRM_MEM_SGLISTS );
return -ENOMEM; return -ENOMEM;
} }
......
...@@ -67,6 +67,70 @@ struct page *DRM(vm_nopage)(struct vm_area_struct *vma, ...@@ -67,6 +67,70 @@ struct page *DRM(vm_nopage)(struct vm_area_struct *vma,
int write_access) int write_access)
#endif #endif
{ {
#if __REALLY_HAVE_AGP
drm_file_t *priv = vma->vm_file->private_data;
drm_device_t *dev = priv->dev;
drm_map_t *map = NULL;
drm_map_list_t *r_list;
struct list_head *list;
/*
* Find the right map
*/
if(!dev->agp->cant_use_aperture) goto vm_nopage_error;
list_for_each(list, &dev->maplist->head) {
r_list = (drm_map_list_t *)list;
map = r_list->map;
if (!map) continue;
if (map->offset == VM_OFFSET(vma)) break;
}
if (map && map->type == _DRM_AGP) {
unsigned long offset = address - vma->vm_start;
unsigned long baddr = VM_OFFSET(vma) + offset;
struct drm_agp_mem *agpmem;
struct page *page;
#if __alpha__
/*
* Adjust to a bus-relative address
*/
baddr -= dev->hose->mem_space->start;
#endif
/*
* It's AGP memory - find the real physical page to map
*/
for(agpmem = dev->agp->memory; agpmem; agpmem = agpmem->next) {
if (agpmem->bound <= baddr &&
agpmem->bound + agpmem->pages * PAGE_SIZE > baddr)
break;
}
if (!agpmem) goto vm_nopage_error;
/*
* Get the page, inc the use count, and return it
*/
offset = (baddr - agpmem->bound) >> PAGE_SHIFT;
agpmem->memory->memory[offset] &= dev->agp->page_mask;
page = virt_to_page(__va(agpmem->memory->memory[offset]));
get_page(page);
DRM_DEBUG("baddr = 0x%lx page = 0x%p, offset = 0x%lx\n",
baddr, __va(agpmem->memory->memory[offset]), offset);
#if LINUX_VERSION_CODE < 0x020317
return page_address(page);
#else
return page;
#endif
}
vm_nopage_error:
#endif /* __REALLY_HAVE_AGP */
return NOPAGE_SIGBUS; /* Disallow mremap */ return NOPAGE_SIGBUS; /* Disallow mremap */
} }
...@@ -220,24 +284,27 @@ struct page *DRM(vm_dma_nopage)(struct vm_area_struct *vma, ...@@ -220,24 +284,27 @@ struct page *DRM(vm_dma_nopage)(struct vm_area_struct *vma,
drm_file_t *priv = vma->vm_file->private_data; drm_file_t *priv = vma->vm_file->private_data;
drm_device_t *dev = priv->dev; drm_device_t *dev = priv->dev;
drm_device_dma_t *dma = dev->dma; drm_device_dma_t *dma = dev->dma;
unsigned long physical;
unsigned long offset; unsigned long offset;
unsigned long page; unsigned long page_nr;
struct page *page;
if (!dma) return NOPAGE_SIGBUS; /* Error */ if (!dma) return NOPAGE_SIGBUS; /* Error */
if (address > vma->vm_end) return NOPAGE_SIGBUS; /* Disallow mremap */ if (address > vma->vm_end) return NOPAGE_SIGBUS; /* Disallow mremap */
if (!dma->pagelist) return NOPAGE_OOM ; /* Nothing allocated */ if (!dma->pagelist) return NOPAGE_OOM ; /* Nothing allocated */
offset = address - vma->vm_start; /* vm_[pg]off[set] should be 0 */ offset = address - vma->vm_start; /* vm_[pg]off[set] should be 0 */
page = offset >> PAGE_SHIFT; page_nr = offset >> PAGE_SHIFT;
physical = dma->pagelist[page] + (offset & (~PAGE_MASK)); page = virt_to_page((dma->pagelist[page_nr] +
atomic_inc(&virt_to_page(physical)->count); /* Dec. by kernel */ (offset & (~PAGE_MASK))));
DRM_DEBUG("0x%08lx (page %lu) => 0x%08lx\n", address, page, physical); get_page(page);
DRM_DEBUG("0x%08lx (page %lu) => 0x%08x\n", address, page_nr,
page_to_bus(page));
#if LINUX_VERSION_CODE < 0x020317 #if LINUX_VERSION_CODE < 0x020317
return physical; return page_address(page);
#else #else
return virt_to_page(physical); return page;
#endif #endif
} }
...@@ -274,10 +341,10 @@ struct page *DRM(vm_sg_nopage)(struct vm_area_struct *vma, ...@@ -274,10 +341,10 @@ struct page *DRM(vm_sg_nopage)(struct vm_area_struct *vma,
map_offset = map->offset - dev->sg->handle; map_offset = map->offset - dev->sg->handle;
page_offset = (offset >> PAGE_SHIFT) + (map_offset >> PAGE_SHIFT); page_offset = (offset >> PAGE_SHIFT) + (map_offset >> PAGE_SHIFT);
page = entry->pagelist[page_offset]; page = entry->pagelist[page_offset];
atomic_inc(&page->count); /* Dec. by kernel */ get_page(page);
#if LINUX_VERSION_CODE < 0x020317 #if LINUX_VERSION_CODE < 0x020317
return (unsigned long)virt_to_phys(page->virtual); return page_address(page);
#else #else
return page; return page;
#endif #endif
...@@ -435,9 +502,20 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma) ...@@ -435,9 +502,20 @@ int DRM(mmap)(struct file *filp, struct vm_area_struct *vma)
} }
switch (map->type) { switch (map->type) {
case _DRM_AGP:
#if defined(__alpha__)
/*
* On Alpha we can't talk to bus dma address from the
* CPU, so for memory of type DRM_AGP, we'll deal with
* sorting out the real physical pages and mappings
* in nopage()
*/
vma->vm_ops = &DRM(vm_ops);
break;
#endif
/* fall through to _DRM_FRAME_BUFFER... */
case _DRM_FRAME_BUFFER: case _DRM_FRAME_BUFFER:
case _DRM_REGISTERS: case _DRM_REGISTERS:
case _DRM_AGP:
if (VM_OFFSET(vma) >= __pa(high_memory)) { if (VM_OFFSET(vma) >= __pa(high_memory)) {
#if defined(__i386__) #if defined(__i386__)
if (boot_cpu_data.x86 > 3 && map->type != _DRM_AGP) { if (boot_cpu_data.x86 > 3 && map->type != _DRM_AGP) {
......
...@@ -145,14 +145,28 @@ extern int mga_warp_init( drm_mga_private_t *dev_priv ); ...@@ -145,14 +145,28 @@ extern int mga_warp_init( drm_mga_private_t *dev_priv );
#define mga_flush_write_combine() mb() #define mga_flush_write_combine() mb()
#define MGA_BASE( reg ) ((u32)(dev_priv->mmio->handle)) #define MGA_BASE( reg ) ((unsigned long)(dev_priv->mmio->handle))
#define MGA_ADDR( reg ) (MGA_BASE(reg) + reg) #define MGA_ADDR( reg ) (MGA_BASE(reg) + reg)
#define MGA_DEREF( reg ) *(volatile u32 *)MGA_ADDR( reg ) #define MGA_DEREF( reg ) *(volatile u32 *)MGA_ADDR( reg )
#define MGA_DEREF8( reg ) *(volatile u8 *)MGA_ADDR( reg )
#ifdef __alpha__
#define MGA_READ( reg ) (_MGA_READ((u32 *)MGA_ADDR(reg)))
#define MGA_WRITE( reg, val ) do { wmb(); MGA_DEREF( reg ) = val; } while (0)
#define MGA_WRITE8( reg, val ) do { wmb(); MGA_DEREF8( reg ) = val; } while (0)
static inline u32 _MGA_READ(u32 *addr)
{
mb();
return *(volatile u32 *)addr;
}
#else
#define MGA_READ( reg ) MGA_DEREF( reg ) #define MGA_READ( reg ) MGA_DEREF( reg )
#define MGA_WRITE( reg, val ) do { MGA_DEREF( reg ) = val; } while (0) #define MGA_WRITE( reg, val ) do { MGA_DEREF( reg ) = val; } while (0)
#define MGA_DEREF8( reg ) *(volatile u8 *)MGA_ADDR( reg )
#define MGA_WRITE8( reg, val ) do { MGA_DEREF8( reg ) = val; } while (0) #define MGA_WRITE8( reg, val ) do { MGA_DEREF8( reg ) = val; } while (0)
#endif
#define DWGREG0 0x1c00 #define DWGREG0 0x1c00
#define DWGREG0_END 0x1dff #define DWGREG0_END 0x1dff
......
...@@ -351,11 +351,10 @@ static void r128_cce_init_ring_buffer( drm_device_t *dev, ...@@ -351,11 +351,10 @@ static void r128_cce_init_ring_buffer( drm_device_t *dev,
page_ofs = tmp_ofs >> PAGE_SHIFT; page_ofs = tmp_ofs >> PAGE_SHIFT;
R128_WRITE( R128_PM4_BUFFER_DL_RPTR_ADDR, R128_WRITE( R128_PM4_BUFFER_DL_RPTR_ADDR,
page_to_bus(entry->pagelist[page_ofs])); entry->busaddr[page_ofs]);
DRM_DEBUG( "ring rptr: offset=0x%08x handle=0x%08lx\n",
DRM_DEBUG( "ring rptr: offset=0x%08lx handle=0x%08lx\n", entry->busaddr[page_ofs],
page_to_bus(entry->pagelist[page_ofs]), entry->handle + tmp_ofs );
entry->handle + tmp_ofs );
} }
/* Set watermark control */ /* Set watermark control */
...@@ -599,15 +598,14 @@ static int r128_do_init_cce( drm_device_t *dev, drm_r128_init_t *init ) ...@@ -599,15 +598,14 @@ static int r128_do_init_cce( drm_device_t *dev, drm_r128_init_t *init )
dev_priv->sarea_priv->last_dispatch ); dev_priv->sarea_priv->last_dispatch );
if ( dev_priv->is_pci ) { if ( dev_priv->is_pci ) {
dev_priv->phys_pci_gart = DRM(ati_pcigart_init)( dev ); if (!DRM(ati_pcigart_init)( dev, &dev_priv->phys_pci_gart,
if ( !dev_priv->phys_pci_gart ) { &dev_priv->bus_pci_gart) ) {
DRM_ERROR( "failed to init PCI GART!\n" ); DRM_ERROR( "failed to init PCI GART!\n" );
dev->dev_private = (void *)dev_priv; dev->dev_private = (void *)dev_priv;
r128_do_cleanup_cce( dev ); r128_do_cleanup_cce( dev );
return -ENOMEM; return -ENOMEM;
} }
R128_WRITE( R128_PCI_GART_PAGE, R128_WRITE( R128_PCI_GART_PAGE, dev_priv->bus_pci_gart );
virt_to_bus( (void *)dev_priv->phys_pci_gart ) );
} }
r128_cce_init_ring_buffer( dev, dev_priv ); r128_cce_init_ring_buffer( dev, dev_priv );
...@@ -629,6 +627,11 @@ int r128_do_cleanup_cce( drm_device_t *dev ) ...@@ -629,6 +627,11 @@ int r128_do_cleanup_cce( drm_device_t *dev )
DRM_IOREMAPFREE( dev_priv->cce_ring ); DRM_IOREMAPFREE( dev_priv->cce_ring );
DRM_IOREMAPFREE( dev_priv->ring_rptr ); DRM_IOREMAPFREE( dev_priv->ring_rptr );
DRM_IOREMAPFREE( dev_priv->buffers ); DRM_IOREMAPFREE( dev_priv->buffers );
} else {
if (!DRM(ati_pcigart_cleanup)( dev,
dev_priv->phys_pci_gart,
dev_priv->bus_pci_gart ))
DRM_ERROR( "failed to cleanup PCI GART!\n" );
} }
DRM(free)( dev->dev_private, sizeof(drm_r128_private_t), DRM(free)( dev->dev_private, sizeof(drm_r128_private_t),
......
...@@ -72,6 +72,7 @@ typedef struct drm_r128_private { ...@@ -72,6 +72,7 @@ typedef struct drm_r128_private {
int usec_timeout; int usec_timeout;
int is_pci; int is_pci;
unsigned long phys_pci_gart; unsigned long phys_pci_gart;
dma_addr_t bus_pci_gart;
unsigned long cce_buffers_offset; unsigned long cce_buffers_offset;
atomic_t idle_count; atomic_t idle_count;
......
...@@ -624,10 +624,9 @@ static void radeon_cp_init_ring_buffer( drm_device_t *dev, ...@@ -624,10 +624,9 @@ static void radeon_cp_init_ring_buffer( drm_device_t *dev,
page_ofs = tmp_ofs >> PAGE_SHIFT; page_ofs = tmp_ofs >> PAGE_SHIFT;
RADEON_WRITE( RADEON_CP_RB_RPTR_ADDR, RADEON_WRITE( RADEON_CP_RB_RPTR_ADDR,
page_to_bus(entry->pagelist[page_ofs])); entry->busaddr[page_ofs]);
DRM_DEBUG( "ring rptr: offset=0x%08x handle=0x%08lx\n", DRM_DEBUG( "ring rptr: offset=0x%08x handle=0x%08lx\n",
page_to_bus(entry->pagelist[page_ofs]), entry->busaddr[page_ofs],
entry->handle + tmp_ofs ); entry->handle + tmp_ofs );
} }
...@@ -929,8 +928,8 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init ) ...@@ -929,8 +928,8 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init )
dev_priv->sarea_priv->last_clear ); dev_priv->sarea_priv->last_clear );
if ( dev_priv->is_pci ) { if ( dev_priv->is_pci ) {
dev_priv->phys_pci_gart = DRM(ati_pcigart_init)( dev ); if (!DRM(ati_pcigart_init)( dev, &dev_priv->phys_pci_gart,
if ( !dev_priv->phys_pci_gart ) { &dev_priv->bus_pci_gart)) {
DRM_ERROR( "failed to init PCI GART!\n" ); DRM_ERROR( "failed to init PCI GART!\n" );
dev->dev_private = (void *)dev_priv; dev->dev_private = (void *)dev_priv;
radeon_do_cleanup_cp(dev); radeon_do_cleanup_cp(dev);
...@@ -944,8 +943,7 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init ) ...@@ -944,8 +943,7 @@ static int radeon_do_init_cp( drm_device_t *dev, drm_radeon_init_t *init )
/* set PCI GART page-table base address /* set PCI GART page-table base address
*/ */
RADEON_WRITE( RADEON_AIC_PT_BASE, RADEON_WRITE( RADEON_AIC_PT_BASE, dev_priv->bus_pci_gart );
virt_to_bus( (void *)dev_priv->phys_pci_gart ) );
/* set address range for PCI address translate /* set address range for PCI address translate
*/ */
...@@ -990,6 +988,11 @@ int radeon_do_cleanup_cp( drm_device_t *dev ) ...@@ -990,6 +988,11 @@ int radeon_do_cleanup_cp( drm_device_t *dev )
DRM_IOREMAPFREE( dev_priv->cp_ring ); DRM_IOREMAPFREE( dev_priv->cp_ring );
DRM_IOREMAPFREE( dev_priv->ring_rptr ); DRM_IOREMAPFREE( dev_priv->ring_rptr );
DRM_IOREMAPFREE( dev_priv->buffers ); DRM_IOREMAPFREE( dev_priv->buffers );
} else {
if (!DRM(ati_pcigart_cleanup)( dev,
dev_priv->phys_pci_gart,
dev_priv->bus_pci_gart ))
DRM_ERROR( "failed to cleanup PCI GART!\n" );
} }
DRM(free)( dev->dev_private, sizeof(drm_radeon_private_t), DRM(free)( dev->dev_private, sizeof(drm_radeon_private_t),
......
...@@ -84,6 +84,7 @@ typedef struct drm_radeon_private { ...@@ -84,6 +84,7 @@ typedef struct drm_radeon_private {
int usec_timeout; int usec_timeout;
int is_pci; int is_pci;
unsigned long phys_pci_gart; unsigned long phys_pci_gart;
dma_addr_t bus_pci_gart;
atomic_t idle_count; atomic_t idle_count;
......
...@@ -44,13 +44,30 @@ ...@@ -44,13 +44,30 @@
#define DRIVER_MINOR 0 #define DRIVER_MINOR 0
#define DRIVER_PATCHLEVEL 0 #define DRIVER_PATCHLEVEL 0
#ifndef PCI_VENDOR_ID_3DFX
#define PCI_VENDOR_ID_3DFX 0x121A
#endif
#ifndef PCI_DEVICE_ID_3DFX_VOODOO5 #ifndef PCI_DEVICE_ID_3DFX_VOODOO5
#define PCI_DEVICE_ID_3DFX_VOODOO5 0x0009 #define PCI_DEVICE_ID_3DFX_VOODOO5 0x0009
#endif #endif
#ifndef PCI_DEVICE_ID_3DFX_VOODOO4
#define PCI_DEVICE_ID_3DFX_VOODOO4 0x0007
#endif
#ifndef PCI_DEVICE_ID_3DFX_VOODOO3_3000 /* Voodoo3 3000 */
#define PCI_DEVICE_ID_3DFX_VOODOO3_3000 0x0005
#endif
#ifndef PCI_DEVICE_ID_3DFX_VOODOO3_2000 /* Voodoo3 3000 */
#define PCI_DEVICE_ID_3DFX_VOODOO3_2000 0x0004
#endif
#ifndef PCI_DEVICE_ID_3DFX_BANSHEE
#define PCI_DEVICE_ID_3DFX_BANSHEE 0x0003
#endif
static drm_pci_list_t DRM(idlist)[] = { static drm_pci_list_t DRM(idlist)[] = {
{ PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_BANSHEE }, { PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_BANSHEE },
{ PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_VOODOO3 }, { PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_VOODOO3_2000 },
{ PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_VOODOO3_3000 },
{ PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_VOODOO4 },
{ PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_VOODOO5 }, { PCI_VENDOR_ID_3DFX, PCI_DEVICE_ID_3DFX_VOODOO5 },
{ 0, 0 } { 0, 0 }
}; };
......
/* /*
* $Id: via82cxxx.c,v 3.23 2001/03/09 09:30:00 vojtech Exp $ * $Id: via82cxxx.c,v 3.26 2001/08/17 12:03:00 vojtech Exp $
* *
* Copyright (c) 2000-2001 Vojtech Pavlik * Copyright (c) 2000-2001 Vojtech Pavlik
* *
...@@ -88,7 +88,6 @@ ...@@ -88,7 +88,6 @@
#define VIA_BAD_CLK66 0x020 /* 66 MHz clock doesn't work correctly */ #define VIA_BAD_CLK66 0x020 /* 66 MHz clock doesn't work correctly */
#define VIA_SET_FIFO 0x040 /* Needs to have FIFO split set */ #define VIA_SET_FIFO 0x040 /* Needs to have FIFO split set */
#define VIA_SET_THRESH 0x080 /* Needs to have FIFO thresholds set */ #define VIA_SET_THRESH 0x080 /* Needs to have FIFO thresholds set */
#define VIA_BAD_PIO 0x100 /* Always uses 26 PCICLK/xfer regardles of PIO mode */
/* /*
* VIA SouthBridge chips. * VIA SouthBridge chips.
...@@ -101,11 +100,9 @@ static struct via_isa_bridge { ...@@ -101,11 +100,9 @@ static struct via_isa_bridge {
unsigned char rev_max; unsigned char rev_max;
unsigned short flags; unsigned short flags;
} via_isa_bridges[] = { } via_isa_bridges[] = {
#ifdef VIA_NEW_BRIDGES_TESTED
{ "vt8233", PCI_DEVICE_ID_VIA_8233_0, 0x00, 0x2f, VIA_UDMA_100 }, { "vt8233", PCI_DEVICE_ID_VIA_8233_0, 0x00, 0x2f, VIA_UDMA_100 },
{ "vt8231", PCI_DEVICE_ID_VIA_8231, 0x00, 0x2f, VIA_UDMA_66 }, { "vt8231", PCI_DEVICE_ID_VIA_8231, 0x00, 0x2f, VIA_UDMA_100 },
#endif { "vt82c686b", PCI_DEVICE_ID_VIA_82C686, 0x40, 0x4f, VIA_UDMA_100 },
{ "vt82c686b", PCI_DEVICE_ID_VIA_82C686, 0x40, 0x4f, VIA_UDMA_100 | VIA_BAD_PIO },
{ "vt82c686a", PCI_DEVICE_ID_VIA_82C686, 0x10, 0x2f, VIA_UDMA_66 }, { "vt82c686a", PCI_DEVICE_ID_VIA_82C686, 0x10, 0x2f, VIA_UDMA_66 },
{ "vt82c686", PCI_DEVICE_ID_VIA_82C686, 0x00, 0x0f, VIA_UDMA_33 | VIA_BAD_CLK66 }, { "vt82c686", PCI_DEVICE_ID_VIA_82C686, 0x00, 0x0f, VIA_UDMA_33 | VIA_BAD_CLK66 },
{ "vt82c596b", PCI_DEVICE_ID_VIA_82C596, 0x10, 0x2f, VIA_UDMA_66 }, { "vt82c596b", PCI_DEVICE_ID_VIA_82C596, 0x10, 0x2f, VIA_UDMA_66 },
...@@ -154,7 +151,7 @@ static int via_get_info(char *buffer, char **addr, off_t offset, int count) ...@@ -154,7 +151,7 @@ static int via_get_info(char *buffer, char **addr, off_t offset, int count)
via_print("----------VIA BusMastering IDE Configuration----------------"); via_print("----------VIA BusMastering IDE Configuration----------------");
via_print("Driver Version: 3.23"); via_print("Driver Version: 3.26");
via_print("South Bridge: VIA %s", via_config->name); via_print("South Bridge: VIA %s", via_config->name);
pci_read_config_byte(isa_dev, PCI_REVISION_ID, &t); pci_read_config_byte(isa_dev, PCI_REVISION_ID, &t);
...@@ -220,8 +217,8 @@ static int via_get_info(char *buffer, char **addr, off_t offset, int count) ...@@ -220,8 +217,8 @@ static int via_get_info(char *buffer, char **addr, off_t offset, int count)
switch (via_config->flags & VIA_UDMA) { switch (via_config->flags & VIA_UDMA) {
case VIA_UDMA_100: case VIA_UDMA_100:
speed[i] = 2000 / udma[i]; speed[i] = 60 * via_clock / udma[i];
cycle[i] = 10 * udma[i]; cycle[i] = 333 / via_clock * udma[i];
break; break;
case VIA_UDMA_66: case VIA_UDMA_66:
...@@ -301,7 +298,7 @@ static int via_set_drive(ide_drive_t *drive, unsigned char speed) ...@@ -301,7 +298,7 @@ static int via_set_drive(ide_drive_t *drive, unsigned char speed)
switch (via_config->flags & VIA_UDMA) { switch (via_config->flags & VIA_UDMA) {
case VIA_UDMA_33: UT = T; break; case VIA_UDMA_33: UT = T; break;
case VIA_UDMA_66: UT = T/2; break; case VIA_UDMA_66: UT = T/2; break;
case VIA_UDMA_100: UT = 10; break; case VIA_UDMA_100: UT = T/3; break;
default: UT = T; break; default: UT = T; break;
} }
......
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
* *
* Copyright notice & release notes in file orinoco.c * Copyright notice & release notes in file orinoco.c
* *
* Note specific to airport stub:
*
* 0.05 : first version of the new split driver
* 0.06 : fix possible hang on powerup, add sleep support
*/ */
#include <linux/module.h> #include <linux/module.h>
...@@ -25,9 +29,12 @@ ...@@ -25,9 +29,12 @@
#include <linux/etherdevice.h> #include <linux/etherdevice.h>
#include <linux/wireless.h> #include <linux/wireless.h>
#include <linux/list.h> #include <linux/list.h>
#include <linux/adb.h>
#include <linux/pmu.h>
#include <asm/prom.h> #include <asm/prom.h>
#include <asm/feature.h> #include <asm/feature.h>
#include <asm/irq.h>
#include "hermes.h" #include "hermes.h"
#include "orinoco.h" #include "orinoco.h"
...@@ -40,10 +47,18 @@ typedef struct dldwd_card { ...@@ -40,10 +47,18 @@ typedef struct dldwd_card {
struct device_node* node; struct device_node* node;
int irq_requested; int irq_requested;
int ndev_registered; int ndev_registered;
int open;
/* Common structure (fully included), see orinoco.h */ /* Common structure (fully included), see orinoco.h */
struct dldwd_priv priv; struct dldwd_priv priv;
} dldwd_card_t; } dldwd_card_t;
#ifdef CONFIG_PMAC_PBOOK
static int airport_sleep_notify(struct pmu_sleep_notifier *self, int when);
static struct pmu_sleep_notifier airport_sleep_notifier = {
airport_sleep_notify, SLEEP_LEVEL_NET,
};
#endif
/* /*
* Function prototypes * Function prototypes
*/ */
...@@ -69,24 +84,15 @@ static dldwd_priv_t *airport_dev; ...@@ -69,24 +84,15 @@ static dldwd_priv_t *airport_dev;
static int airport_init(struct net_device *dev) static int airport_init(struct net_device *dev)
{ {
dldwd_priv_t *priv = dev->priv; dldwd_priv_t *priv = dev->priv;
dldwd_card_t* card = (dldwd_card_t *)priv->card;
int rc; int rc;
TRACE_ENTER(priv->ndev.name); TRACE_ENTER(priv->ndev.name);
MOD_INC_USE_COUNT; MOD_INC_USE_COUNT;
feature_set_airport_power(card->node, 1);
current->state = TASK_UNINTERRUPTIBLE;
schedule_timeout(HZ);
rc = dldwd_init(dev); rc = dldwd_init(dev);
if (rc) { if (!rc)
feature_set_airport_power(card->node, 0); priv->hw_ready = 1;
current->state = TASK_UNINTERRUPTIBLE;
schedule_timeout(HZ);
}
priv->hw_ready = 1;
MOD_DEC_USE_COUNT; MOD_DEC_USE_COUNT;
...@@ -97,18 +103,20 @@ static int ...@@ -97,18 +103,20 @@ static int
airport_open(struct net_device *dev) airport_open(struct net_device *dev)
{ {
dldwd_priv_t *priv = dev->priv; dldwd_priv_t *priv = dev->priv;
dldwd_card_t* card = (dldwd_card_t *)priv->card;
int rc; int rc;
TRACE_ENTER(priv->ndev.name); TRACE_ENTER(priv->ndev.name);
netif_device_attach(dev);
rc = dldwd_reset(priv); rc = dldwd_reset(priv);
if (rc) if (rc)
airport_stop(dev); airport_stop(dev);
else else {
netif_start_queue(dev); card->open = 1;
netif_device_attach(dev);
}
TRACE_EXIT(priv->ndev.name); // TRACE_EXIT(priv->ndev.name);
return rc; return rc;
} }
...@@ -117,18 +125,66 @@ static int ...@@ -117,18 +125,66 @@ static int
airport_stop(struct net_device *dev) airport_stop(struct net_device *dev)
{ {
dldwd_priv_t *priv = dev->priv; dldwd_priv_t *priv = dev->priv;
dldwd_card_t* card = (dldwd_card_t *)priv->card;
TRACE_ENTER(priv->ndev.name); TRACE_ENTER(priv->ndev.name);
netif_stop_queue(dev); netif_stop_queue(dev);
dldwd_shutdown(priv); dldwd_shutdown(priv);
card->open = 0;
TRACE_EXIT(priv->ndev.name); TRACE_EXIT(priv->ndev.name);
return 0; return 0;
} }
#ifdef CONFIG_PMAC_PBOOK
static int
airport_sleep_notify(struct pmu_sleep_notifier *self, int when)
{
dldwd_priv_t *priv;
struct net_device *ndev;
dldwd_card_t* card;
int rc;
if (!airport_dev)
return PBOOK_SLEEP_OK;
priv = airport_dev;
ndev = &priv->ndev;
card = (dldwd_card_t *)priv->card;
switch (when) {
case PBOOK_SLEEP_REQUEST:
break;
case PBOOK_SLEEP_REJECT:
break;
case PBOOK_SLEEP_NOW:
printk(KERN_INFO "%s: Airport entering sleep mode\n", ndev->name);
netif_device_detach(ndev);
if (card->open)
dldwd_shutdown(priv);
disable_irq(ndev->irq);
feature_set_airport_power(card->node, 0);
priv->hw_ready = 0;
break;
case PBOOK_WAKE:
printk(KERN_INFO "%s: Airport waking up\n", ndev->name);
feature_set_airport_power(card->node, 1);
mdelay(200);
hermes_reset(&priv->hw);
priv->hw_ready = 1;
rc = dldwd_reset(priv);
if (rc)
printk(KERN_ERR "airport: Error %d re-initing card !\n", rc);
else if (card->open)
netif_device_attach(ndev);
enable_irq(ndev->irq);
break;
}
return PBOOK_SLEEP_OK;
}
#endif /* CONFIG_PMAC_PBOOK */
static dldwd_priv_t* static dldwd_priv_t*
airport_attach(struct device_node* of_node) airport_attach(struct device_node* of_node)
{ {
...@@ -175,6 +231,14 @@ airport_attach(struct device_node* of_node) ...@@ -175,6 +231,14 @@ airport_attach(struct device_node* of_node)
hermes_struct_init(hw, ndev->base_addr); hermes_struct_init(hw, ndev->base_addr);
/* Power up card */
feature_set_airport_power(card->node, 1);
current->state = TASK_UNINTERRUPTIBLE;
schedule_timeout(HZ);
/* Reset it before we get the interrupt */
hermes_reset(hw);
if (request_irq(ndev->irq, dldwd_interrupt, 0, "Airport", (void *)priv)) { if (request_irq(ndev->irq, dldwd_interrupt, 0, "Airport", (void *)priv)) {
printk(KERN_ERR "airport: Couldn't get IRQ %d\n", ndev->irq); printk(KERN_ERR "airport: Couldn't get IRQ %d\n", ndev->irq);
goto failed; goto failed;
...@@ -198,6 +262,9 @@ airport_attach(struct device_node* of_node) ...@@ -198,6 +262,9 @@ airport_attach(struct device_node* of_node)
printk(KERN_ERR "airport: Failed to create /proc node for %s\n", printk(KERN_ERR "airport: Failed to create /proc node for %s\n",
ndev->name); ndev->name);
#ifdef CONFIG_PMAC_PBOOK
pmu_register_sleep_notifier(&airport_sleep_notifier);
#endif
return priv; return priv;
failed: failed:
...@@ -219,6 +286,9 @@ airport_detach(dldwd_priv_t *priv) ...@@ -219,6 +286,9 @@ airport_detach(dldwd_priv_t *priv)
/* Unregister proc entry */ /* Unregister proc entry */
dldwd_proc_dev_cleanup(priv); dldwd_proc_dev_cleanup(priv);
#ifdef CONFIG_PMAC_PBOOK
pmu_unregister_sleep_notifier(&airport_sleep_notifier);
#endif
if (card->ndev_registered) if (card->ndev_registered)
unregister_netdev(&priv->ndev); unregister_netdev(&priv->ndev);
card->ndev_registered = 0; card->ndev_registered = 0;
...@@ -266,7 +336,5 @@ exit_airport(void) ...@@ -266,7 +336,5 @@ exit_airport(void)
airport_dev = NULL; airport_dev = NULL;
} }
MODULE_DESCRIPTION("Apple Airport driver");
module_init(init_airport); module_init(init_airport);
module_exit(exit_airport); module_exit(exit_airport);
...@@ -32,9 +32,9 @@ struct pci_vendor_info { ...@@ -32,9 +32,9 @@ struct pci_vendor_info {
* real memory.. Parse the same file multiple times * real memory.. Parse the same file multiple times
* to get all the info. * to get all the info.
*/ */
#define VENDOR( vendor, name ) static const char __vendorstr_##vendor[] __initdata = name; #define VENDOR( vendor, name ) static char __vendorstr_##vendor[] __initdata = name;
#define ENDVENDOR() #define ENDVENDOR()
#define DEVICE( vendor, device, name ) static const char __devicestr_##vendor##device[] __initdata = name; #define DEVICE( vendor, device, name ) static char __devicestr_##vendor##device[] __initdata = name;
#include "devlist.h" #include "devlist.h"
...@@ -43,7 +43,7 @@ struct pci_vendor_info { ...@@ -43,7 +43,7 @@ struct pci_vendor_info {
#define DEVICE( vendor, device, name ) { 0x##device, 0, __devicestr_##vendor##device }, #define DEVICE( vendor, device, name ) { 0x##device, 0, __devicestr_##vendor##device },
#include "devlist.h" #include "devlist.h"
static const struct pci_vendor_info __initdata pci_vendor_list[] = { static struct pci_vendor_info __initdata pci_vendor_list[] = {
#define VENDOR( vendor, name ) { 0x##vendor, sizeof(__devices_##vendor) / sizeof(struct pci_device_info), __vendorstr_##vendor, __devices_##vendor }, #define VENDOR( vendor, name ) { 0x##vendor, sizeof(__devices_##vendor) / sizeof(struct pci_device_info), __vendorstr_##vendor, __devices_##vendor },
#define ENDVENDOR() #define ENDVENDOR()
#define DEVICE( vendor, device, name ) #define DEVICE( vendor, device, name )
......
...@@ -729,7 +729,7 @@ static void yenta_allocate_res(pci_socket_t *socket, int nr, unsigned type) ...@@ -729,7 +729,7 @@ static void yenta_allocate_res(pci_socket_t *socket, int nr, unsigned type)
if (type & IORESOURCE_IO) { if (type & IORESOURCE_IO) {
align = 1024; align = 1024;
size = 256; size = 256;
min = PCIBIOS_MIN_IO; min = 0x4000;
max = 0xffff; max = 0xffff;
} }
......
/* $Id: ds1286.c,v 1.6 1999/10/09 00:01:31 ralf Exp $ /*
* * DS1286 Real Time Clock interface for Linux
* Real Time Clock interface for Linux
* *
* Copyright (C) 1998, 1999 Ralf Baechle * Copyright (C) 1998, 1999, 2000 Ralf Baechle
* *
* Based on code written by Paul Gortmaker. * Based on code written by Paul Gortmaker.
* *
* This driver allows use of the real time clock (built into * This driver allows use of the real time clock (built into nearly all
* nearly all computers) from user space. It exports the /dev/rtc * computers) from user space. It exports the /dev/rtc interface supporting
* interface supporting various ioctl() and also the /proc/rtc * various ioctl() and also the /proc/rtc pseudo-file for status
* pseudo-file for status information. * information.
* *
* The ioctls can be used to set the interrupt behaviour and * The ioctls can be used to set the interrupt behaviour and generation rate
* generation rate from the RTC via IRQ 8. Then the /dev/rtc * from the RTC via IRQ 8. Then the /dev/rtc interface can be used to make
* interface can be used to make use of these timer interrupts, * use of these timer interrupts, be they interval or alarm based.
* be they interval or alarm based.
* *
* The /dev/rtc interface will block on reads until an interrupt * The /dev/rtc interface will block on reads until an interrupt has been
* has been received. If a RTC interrupt has already happened, * received. If a RTC interrupt has already happened, it will output an
* it will output an unsigned long and then block. The output value * unsigned long and then block. The output value contains the interrupt
* contains the interrupt status in the low byte and the number of * status in the low byte and the number of interrupts since the last read
* interrupts since the last read in the remaining high bytes. The * in the remaining high bytes. The /dev/rtc interface can also be used with
* /dev/rtc interface can also be used with the select(2) call. * the select(2) call.
* *
* This program is free software; you can redistribute it and/or * This program is free software; you can redistribute it and/or modify it
* modify it under the terms of the GNU General Public License * under the terms of the GNU General Public License as published by the
* as published by the Free Software Foundation; either version * Free Software Foundation; either version 2 of the License, or (at your
* 2 of the License, or (at your option) any later version. * option) any later version.
*/ */
#include <linux/types.h> #include <linux/types.h>
#include <linux/errno.h> #include <linux/errno.h>
...@@ -38,7 +36,6 @@ ...@@ -38,7 +36,6 @@
#include <linux/poll.h> #include <linux/poll.h>
#include <linux/rtc.h> #include <linux/rtc.h>
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/smp_lock.h>
#include <asm/ds1286.h> #include <asm/ds1286.h>
#include <asm/io.h> #include <asm/io.h>
...@@ -81,20 +78,12 @@ static spinlock_t ds1286_lock = SPIN_LOCK_UNLOCKED; ...@@ -81,20 +78,12 @@ static spinlock_t ds1286_lock = SPIN_LOCK_UNLOCKED;
#define RTC_IS_OPEN 0x01 /* means /dev/rtc is in use */ #define RTC_IS_OPEN 0x01 /* means /dev/rtc is in use */
#define RTC_TIMER_ON 0x02 /* missed irq timer active */ #define RTC_TIMER_ON 0x02 /* missed irq timer active */
unsigned char ds1286_status = 0; /* bitmapped status byte. */ unsigned char ds1286_status; /* bitmapped status byte. */
unsigned long ds1286_freq = 0; /* Current periodic IRQ rate */ unsigned long ds1286_freq; /* Current periodic IRQ rate */
unsigned long ds1286_irq_data = 0; /* our output to the world */
unsigned char days_in_mo[] = unsigned char days_in_mo[] =
{0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
/*
* A very tiny interrupt handler. It runs with SA_INTERRUPT set,
* so that there is no possibility of conflicting with the
* set_rtc_mmss() call that happens during some timer interrupts.
* (See ./arch/XXXX/kernel/time.c for the set_rtc_mmss() function.)
*/
/* /*
* Now all the various file operations that we export. * Now all the various file operations that we export.
*/ */
...@@ -102,37 +91,7 @@ unsigned char days_in_mo[] = ...@@ -102,37 +91,7 @@ unsigned char days_in_mo[] =
static ssize_t ds1286_read(struct file *file, char *buf, static ssize_t ds1286_read(struct file *file, char *buf,
size_t count, loff_t *ppos) size_t count, loff_t *ppos)
{ {
DECLARE_WAITQUEUE(wait, current); return -EIO;
unsigned long data;
ssize_t retval;
if (count < sizeof(unsigned long))
return -EINVAL;
add_wait_queue(&ds1286_wait, &wait);
current->state = TASK_INTERRUPTIBLE;
while ((data = xchg(&ds1286_irq_data, 0)) == 0) {
if (file->f_flags & O_NONBLOCK) {
retval = -EAGAIN;
goto out;
}
if (signal_pending(current)) {
retval = -ERESTARTSYS;
goto out;
}
schedule();
}
retval = put_user(data, (unsigned long *)buf);
if (!retval)
retval = sizeof(unsigned long);
out:
current->state = TASK_RUNNING;
remove_wait_queue(&ds1286_wait, &wait);
return retval;
} }
static int ds1286_ioctl(struct inode *inode, struct file *file, static int ds1286_ioctl(struct inode *inode, struct file *file,
...@@ -338,27 +297,32 @@ static int ds1286_ioctl(struct inode *inode, struct file *file, ...@@ -338,27 +297,32 @@ static int ds1286_ioctl(struct inode *inode, struct file *file,
static int ds1286_open(struct inode *inode, struct file *file) static int ds1286_open(struct inode *inode, struct file *file)
{ {
if(ds1286_status & RTC_IS_OPEN) spin_lock_irq(&ds1286_lock);
return -EBUSY;
if (ds1286_status & RTC_IS_OPEN)
goto out_busy;
ds1286_status |= RTC_IS_OPEN; ds1286_status |= RTC_IS_OPEN;
ds1286_irq_data = 0;
spin_lock_irq(&ds1286_lock);
return 0; return 0;
out_busy:
spin_lock_irq(&ds1286_lock);
return -EBUSY;
} }
static int ds1286_release(struct inode *inode, struct file *file) static int ds1286_release(struct inode *inode, struct file *file)
{ {
lock_kernel();
ds1286_status &= ~RTC_IS_OPEN; ds1286_status &= ~RTC_IS_OPEN;
unlock_kernel();
return 0; return 0;
} }
static unsigned int ds1286_poll(struct file *file, poll_table *wait) static unsigned int ds1286_poll(struct file *file, poll_table *wait)
{ {
poll_wait(file, &ds1286_wait, wait); poll_wait(file, &ds1286_wait, wait);
if (ds1286_irq_data != 0)
return POLLIN | POLLRDNORM;
return 0; return 0;
} }
...@@ -407,7 +371,7 @@ int get_ds1286_status(char *buf) ...@@ -407,7 +371,7 @@ int get_ds1286_status(char *buf)
get_rtc_time(&tm); get_rtc_time(&tm);
hundredth = CMOS_READ(RTC_HUNDREDTH_SECOND); hundredth = CMOS_READ(RTC_HUNDREDTH_SECOND);
hundredth = BCD_TO_BIN(hundredth); BCD_TO_BIN(hundredth);
p += sprintf(p, p += sprintf(p,
"rtc_time\t: %02d:%02d:%02d.%02d\n" "rtc_time\t: %02d:%02d:%02d.%02d\n"
......
/* $Id: graphics.c,v 1.22 2000/02/18 00:24:43 ralf Exp $ /*
*
* gfx.c: support for SGI's /dev/graphics, /dev/opengl * gfx.c: support for SGI's /dev/graphics, /dev/opengl
* *
* Author: Miguel de Icaza (miguel@nuclecu.unam.mx) * Author: Miguel de Icaza (miguel@nuclecu.unam.mx)
...@@ -214,8 +213,7 @@ sgi_graphics_close (struct inode *inode, struct file *file) ...@@ -214,8 +213,7 @@ sgi_graphics_close (struct inode *inode, struct file *file)
/* /*
* This is the core of the direct rendering engine. * This is the core of the direct rendering engine.
*/ */
struct page *
unsigned long
sgi_graphics_nopage (struct vm_area_struct *vma, unsigned long address, int sgi_graphics_nopage (struct vm_area_struct *vma, unsigned long address, int
no_share) no_share)
{ {
...@@ -250,7 +248,6 @@ sgi_graphics_nopage (struct vm_area_struct *vma, unsigned long address, int ...@@ -250,7 +248,6 @@ sgi_graphics_nopage (struct vm_area_struct *vma, unsigned long address, int
pgd = pgd_offset(current->mm, address); pgd = pgd_offset(current->mm, address);
pmd = pmd_offset(pgd, address); pmd = pmd_offset(pgd, address);
pte = pte_offset(pmd, address); pte = pte_offset(pmd, address);
printk("page: %08lx\n", pte_page(*pte));
return pte_page(*pte); return pte_page(*pte);
} }
......
/*
* graphics_syms.c: interfaces for SGI Indy newport graphics
*
* Copyright (C) 1999 Alex deVries <puffin@redhat.com>
*
* We should not even be trying to compile this if we are not doing
* a module.
*/
#define __NO_VERSION__
#include <linux/module.h>
/* extern int rrm_command (unsigned int cmd, void *arg);
extern int rrm_close (struct inode *inode, struct file *file);
EXPORT_SYMBOL(rrm_command);
EXPORT_SYMBOL(rrm_close);
*/
extern void shmiq_init (void);
extern void usema_init(void);
EXPORT_SYMBOL(shmiq_init);
EXPORT_SYMBOL(usema_init);
extern void disable_gconsole(void);
extern void enable_gconsole(void);
extern void remove_mapping (struct task_struct *task, unsigned long start,
unsigned long end);
EXPORT_SYMBOL(disable_gconsole);
EXPORT_SYMBOL(enable_gconsole);
EXPORT_SYMBOL(remove_mapping);
EXPORT_SYMBOL(npregs);
...@@ -16,6 +16,8 @@ ...@@ -16,6 +16,8 @@
struct newport_regs *npregs; struct newport_regs *npregs;
EXPORT_SYMBOL(npregs);
/* Kernel routines for supporting graphics context switching */ /* Kernel routines for supporting graphics context switching */
void newport_save (void *y) void newport_save (void *y)
......
...@@ -9,12 +9,11 @@ ...@@ -9,12 +9,11 @@
* *
* Fixes: * Fixes:
*/ */
#include <linux/module.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include <asm/rrm.h> #include <asm/rrm.h>
#ifdef MODULE
#include <linux/module.h>
#endif
int int
rrm_open_rn (int rnid, void *arg) rrm_open_rn (int rnid, void *arg)
...@@ -71,3 +70,6 @@ rrm_close (struct inode *inode, struct file *file) ...@@ -71,3 +70,6 @@ rrm_close (struct inode *inode, struct file *file)
/* This routine is invoked when the device is closed */ /* This routine is invoked when the device is closed */
return 0; return 0;
} }
EXPORT_SYMBOL(rrm_command);
EXPORT_SYMBOL(rrm_close);
/* $Id: sgicons.c,v 1.10 1998/08/25 09:18:58 ralf Exp $ /*
*
* sgicons.c: Setting up and registering console I/O on the SGI. * sgicons.c: Setting up and registering console I/O on the SGI.
* *
* Copyright (C) 1996 David S. Miller (dm@engr.sgi.com) * Copyright (C) 1996 David S. Miller (dm@engr.sgi.com)
...@@ -10,12 +9,10 @@ ...@@ -10,12 +9,10 @@
#include <linux/init.h> #include <linux/init.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/module.h>
#include <asm/uaccess.h> #include <asm/uaccess.h>
#include "gconsole.h" #include "gconsole.h"
/* To make psaux code cleaner */
unsigned char aux_device_present = 0xaa;
/* This is the system graphics console (the first adapter found) */ /* This is the system graphics console (the first adapter found) */
struct console_ops *gconsole = 0; struct console_ops *gconsole = 0;
struct console_ops *real_gconsole = 0; struct console_ops *real_gconsole = 0;
...@@ -36,6 +33,9 @@ disable_gconsole (void) ...@@ -36,6 +33,9 @@ disable_gconsole (void)
} }
} }
EXPORT_SYMBOL(disable_gconsole);
EXPORT_SYMBOL(enable_gconsole);
void void
register_gconsole (struct console_ops *gc) register_gconsole (struct console_ops *gc)
{ {
......
This diff is collapsed.
...@@ -359,7 +359,7 @@ struct sgi_serial { ...@@ -359,7 +359,7 @@ struct sgi_serial {
#define ZCOUNT 0x2 /* Zero count */ #define ZCOUNT 0x2 /* Zero count */
#define Tx_BUF_EMP 0x4 /* Tx Buffer empty */ #define Tx_BUF_EMP 0x4 /* Tx Buffer empty */
#define DCD 0x8 /* DCD */ #define DCD 0x8 /* DCD */
#define SYNC_HUNT 0x10 /* Sync/hunt */ #define SYNC 0x10 /* Sync/hunt */
#define CTS 0x20 /* CTS */ #define CTS 0x20 /* CTS */
#define TxEOM 0x40 /* Tx underrun */ #define TxEOM 0x40 /* Tx underrun */
#define BRK_ABRT 0x80 /* Break/Abort */ #define BRK_ABRT 0x80 /* Break/Abort */
......
/* $Id: shmiq.c,v 1.19 2000/02/23 00:41:21 ralf Exp $ /*
*
* shmiq.c: shared memory input queue driver * shmiq.c: shared memory input queue driver
* written 1997 Miguel de Icaza (miguel@nuclecu.unam.mx) * written 1997 Miguel de Icaza (miguel@nuclecu.unam.mx)
* *
...@@ -42,7 +41,6 @@ ...@@ -42,7 +41,6 @@
* Until then, I just allow for 1 qcntl device. * Until then, I just allow for 1 qcntl device.
* *
*/ */
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/sched.h> #include <linux/sched.h>
...@@ -52,6 +50,7 @@ ...@@ -52,6 +50,7 @@
#include <linux/vmalloc.h> #include <linux/vmalloc.h>
#include <linux/wait.h> #include <linux/wait.h>
#include <linux/major.h> #include <linux/major.h>
#include <linux/module.h>
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
#include <linux/devfs_fs_kernel.h> #include <linux/devfs_fs_kernel.h>
...@@ -470,3 +469,5 @@ shmiq_init (void) ...@@ -470,3 +469,5 @@ shmiq_init (void)
S_IFCHR | S_IRUSR | S_IWUSR, S_IFCHR | S_IRUSR | S_IWUSR,
&shmiq_fops, NULL); &shmiq_fops, NULL);
} }
EXPORT_SYMBOL(shmiq_init);
...@@ -20,8 +20,7 @@ ...@@ -20,8 +20,7 @@
* usema(7m), usinit(3p), usnewsema(3p) * usema(7m), usinit(3p), usnewsema(3p)
* /usr/include/sys/usioctl.h * /usr/include/sys/usioctl.h
* *
*/ */
#include <linux/fs.h> #include <linux/fs.h>
#include <linux/miscdevice.h> #include <linux/miscdevice.h>
#include <linux/sched.h> #include <linux/sched.h>
...@@ -31,6 +30,7 @@ ...@@ -31,6 +30,7 @@
#include <linux/string.h> #include <linux/string.h>
#include <linux/dcache.h> #include <linux/dcache.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/module.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/smp_lock.h> #include <linux/smp_lock.h>
#include "usema.h" #include "usema.h"
...@@ -180,3 +180,5 @@ usema_init(void) ...@@ -180,3 +180,5 @@ usema_init(void)
SGI_USEMACLONE); SGI_USEMACLONE);
misc_register(&dev_usemaclone); misc_register(&dev_usemaclone);
} }
EXPORT_SYMBOL(usema_init);
...@@ -4873,7 +4873,7 @@ awe_detect(void) ...@@ -4873,7 +4873,7 @@ awe_detect(void)
/* any three numbers you like */ /* any three numbers you like */
#define UNIQUE_ID1 0x1234 #define UNIQUE_ID1 0x1234
#define UNIQUE_ID2 0x4321 #define UNIQUE_ID2 0x4321
#define UNIQUE_ID3 0xFFFF #define UNIQUE_ID3 0xABCD
static void __init static void __init
awe_check_dram(void) awe_check_dram(void)
......
This diff is collapsed.
/*
* Keyboard mappings for DEC LK201/401/501 keyboards
*
* 17.05.99 Michael Engel (engel@unix-ag.org)
*
* DEC US keyboards generate keycodes in the range 0x55 - 0xfb
*
* This conflicts with Linux scancode conventions which define
* 0x00-0x7f as "normal" and 0x80-0xff as "shifted" scancodes, so we
* have to remap the keycodes to 0x00-0x7f with the scancodeRemap
* array. The generated scancode is simply the number of the key counted
* from the left upper to the right lower corner of the keyboard ...
*
* These scancodes are then being remapped (I hope ;-)) with the
* lk501*map[] arrays which define scancode -> Linux code mapping
*
* Oh man is this horrible ;-)
*
* Scancodes with dual labels exist for keyboards as follows:
*
* code: left label / right label
*
* 0x73: LKx01, LK421 / LK443, LK444
* 0x74: LKx01, LK421 / LK443, LK444
* 0x7c: LKx01, LK421 / LK443, LK444
* 0x8a: LKx01, LK421 / LK443, LK444
* 0x8b: LKx01, LK421 / LK443, LK444
* 0x8c: LKx01, LK421 / LK443, LK444
* 0x8d: LKx01, LK421 / LK443, LK444
* 0x8e: LKx01, LK421 / LK443, LK444
* 0x8f: LKx01, LK421 / LK443, LK444
* 0x9c: LKx01, LK421 / LK443, LK444
* 0xa1: LKx01, LK421 / LK443, LK444
* 0xa2: LKx01, LK421 / LK443, LK444
* 0xa3: LKx01, LK421 / LK443, LK444
* 0xa4: LKx01, LK421 / LK443, LK444
* 0xad: LK421 / LK443, LK444
* 0xc9: LKx01, LK421, LK443 / LK444
* 0xf7: LKx01, LK443 / LK444
*/
unsigned char scancodeRemap[256] = {
/* ----- */
/* 0 */ 0, 0, 0, 0,
/* ----- */
/* 4 */ 0, 0, 0, 0,
/* ----- */
/* 8 */ 0, 0, 0, 0,
/* ----- */
/* c */ 0, 0, 0, 0,
/* ----- */
/* 10 */ 0, 0, 0, 0,
/* ----- */
/* 14 */ 0, 0, 0, 0,
/* ----- */
/* 18 */ 0, 0, 0, 0,
/* ----- */
/* 1c */ 0, 0, 0, 0,
/* ----- */
/* 20 */ 0, 0, 0, 0,
/* ----- */
/* 24 */ 0, 0, 0, 0,
/* ----- */
/* 28 */ 0, 0, 0, 0,
/* ----- */
/* 2c */ 0, 0, 0, 0,
/* ----- */
/* 30 */ 0, 0, 0, 0,
/* ----- */
/* 34 */ 0, 0, 0, 0,
/* ----- */
/* 38 */ 0, 0, 0, 0,
/* ----- */
/* 3c */ 0, 0, 0, 0,
/* ----- */
/* 40 */ 0, 0, 0, 0,
/* ----- */
/* 44 */ 0, 0, 0, 0,
/* ----- */
/* 48 */ 0, 0, 0, 0,
/* ----- */
/* 4c */ 0, 0, 0, 0,
/* ----- */
/* 50 */ 0, 0, 0, 0,
/* ----- ESC F1 F2 */
/* 54 */ 0, 0, 0x01, 0x02,
/* ----- F3 F4 F5 */
/* 58 */ 0x03, 0x04, 0x05, 0,
/* ----- */
/* 5c */ 0, 0, 0, 0,
/* ----- */
/* 60 */ 0, 0, 0, 0,
/* ----- F6 F7 F8 F9 */
/* 64 */ 0x06, 0x07, 0x08, 0x09,
/* ----- F10 */
/* 68 */ 0x0a, 0, 0, 0,
/* ----- */
/* 6c */ 0, 0, 0, 0,
/* ----- F11 F12 F13/PRNT SCRN */
/* 70 */ 0, 0x0b, 0x0c, 0x0d,
/* ----- F14/SCRL LCK */
/* 74 */ 0x0e, 0, 0, 0,
/* ----- */
/* 78 */ 0, 0, 0, 0,
/* ----- HELP/PAUSE DO */
/* 7c */ 0x0f, 0x10, 0, 0,
/* ----- F17 F18 F19 F20 */
/* 80 */ 0x11, 0x12, 0x13, 0x14,
/* ----- */
/* 84 */ 0, 0, 0, 0,
/* ----- FIND/INSERT INSERT/HOME */
/* 88 */ 0, 0, 0x23, 0x24,
/* ----- REMOVE/PG UP SELECT/DELETE PREVIOUS/END NEXT/PG DN */
/* 8c */ 0x25, 0x38, 0x39, 0x3a,
/* ----- KP 0 */
/* 90 */ 0, 0, 0x6b, 0,
/* ----- KP . KP ENTER KP 1 KP 2 */
/* 94 */ 0x6c, 0x65, 0x62, 0x63,
/* ----- KP 3 KP 4 KP 5 KP 6 */
/* 98 */ 0x64, 0x4e, 0x4f, 0x50,
/* ----- KP ,/KP + KP 7 KP 8 KP 9 */
/* 9c */ 0x51, 0x3b, 0x3c, 0x3d,
/* ----- KP - KP F1/NUM LCK KP F2/KP / KP F3/KP * */
/* a0 */ 0x3e, 0x26, 0x27, 0x28,
/* ----- KP F4/KP - LEFT */
/* a4 */ 0x29, 0, 0, 0x5f,
/* ----- RIGHT DOWN UP SHIFT Rt */
/* a8 */ 0x61, 0x60, 0x4d, 0x5e,
/* ----- ALT COMP Rt/CTRL Rt SHIFT CONTROL */
/* ac */ 0, 0, 0x52, 0x3f,
/* ----- CAPS COMPOSE ALT Rt */
/* b0 */ 0x40, 0x67, 0, 0,
/* ----- */
/* b4 */ 0, 0, 0, 0,
/* ----- */
/* b8 */ 0, 0, 0, 0,
/* ----- BKSP RET TAB ` */
/* bc */ 0x22, 0x37, 0x2a, 0x15,
/* ----- 1 q a z */
/* c0 */ 0x16, 0x2b, 0x41, 0x54,
/* ----- 2 w s */
/* c4 */ 0, 0x17, 0x2c, 0x42,
/* ----- x </\\ 3 */
/* c8 */ 0x55, 0x53, 0, 0x18,
/* ----- e d c */
/* cc */ 0x2d, 0x43, 0x56, 0,
/* ----- 4 r f v */
/* d0 */ 0x19, 0x2e, 0x44, 0x57,
/* ----- SPACE 5 t */
/* d4 */ 0x68, 0, 0x1a, 0x2f,
/* ----- g b 6 */
/* d8 */ 0x45, 0x58, 0, 0x1b,
/* ----- y h n */
/* dc */ 0x30, 0x46, 0x59, 0,
/* ----- 7 u j m */
/* e0 */ 0x1c, 0x31, 0x47, 0x5a,
/* ----- 8 i k */
/* e4 */ 0, 0x1d, 0x32, 0x48,
/* ----- , 9 o */
/* e8 */ 0x5b, 0, 0x1e, 0x33,
/* ----- l . 0 */
/* ec */ 0x49, 0x5c, 0, 0x1f,
/* ----- p ; / */
/* f0 */ 0x34, 0, 0x4a, 0x5d,
/* ----- = ] \\/\' */
/* f4 */ 0, 0x21, 0x36, 0x4c,
/* ----- - [ \' */
/* f8 */ 0, 0x20, 0x35, 0x4b,
/* ----- */
/* fc */ 0, 0, 0, 0,
};
/*
*
* This file is subject to the terms and conditions of the GNU General Public
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
*/
#include <linux/errno.h>
#include <linux/tty.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/delay.h>
#include <linux/kbd_ll.h>
#include <asm/wbflush.h>
#include <asm/dec/tc.h>
#include <asm/dec/machtype.h>
#include "zs.h"
#include "lk201.h"
/* Simple translation table for the SysRq keys */
#ifdef CONFIG_MAGIC_SYSRQ
/*
* Actually no translation at all, at least until we figure out
* how to define SysRq for LK201 and friends. --macro
*/
unsigned char lk201_sysrq_xlate[128];
unsigned char *kbd_sysrq_xlate = lk201_sysrq_xlate;
#endif
#define KEYB_LINE 3
static int __init lk201_init(struct dec_serial *);
static void __init lk201_info(struct dec_serial *);
static void lk201_kbd_rx_char(unsigned char, unsigned char);
struct zs_hook lk201_kbdhook = {
init_channel: lk201_init,
init_info: lk201_info,
rx_char: NULL,
poll_rx_char: NULL,
poll_tx_char: NULL,
cflags: B4800 | CS8 | CSTOPB | CLOCAL
};
/*
* This is used during keyboard initialisation
*/
static unsigned char lk201_reset_string[] = {
LK_CMD_LEDS_ON, LK_PARAM_LED_MASK(0xf), /* show we are resetting */
LK_CMD_SET_DEFAULTS,
LK_CMD_MODE(LK_MODE_RPT_DOWN, 1),
LK_CMD_MODE(LK_MODE_RPT_DOWN, 2),
LK_CMD_MODE(LK_MODE_RPT_DOWN, 3),
LK_CMD_MODE(LK_MODE_RPT_DOWN, 4),
LK_CMD_MODE(LK_MODE_DOWN_UP, 5),
LK_CMD_MODE(LK_MODE_DOWN_UP, 6),
LK_CMD_MODE(LK_MODE_RPT_DOWN, 7),
LK_CMD_MODE(LK_MODE_RPT_DOWN, 8),
LK_CMD_MODE(LK_MODE_RPT_DOWN, 9),
LK_CMD_MODE(LK_MODE_RPT_DOWN, 10),
LK_CMD_MODE(LK_MODE_RPT_DOWN, 11),
LK_CMD_MODE(LK_MODE_RPT_DOWN, 12),
LK_CMD_MODE(LK_MODE_DOWN, 13),
LK_CMD_MODE(LK_MODE_RPT_DOWN, 14),
LK_CMD_ENB_RPT,
LK_CMD_DIS_KEYCLK,
LK_CMD_RESUME,
LK_CMD_ENB_BELL, LK_PARAM_VOLUME(4),
LK_CMD_LEDS_OFF, LK_PARAM_LED_MASK(0xf)
};
static int __init lk201_reset(struct dec_serial *info)
{
int i;
for (i = 0; i < sizeof(lk201_reset_string); i++)
if (info->hook->poll_tx_char(info, lk201_reset_string[i])) {
printk(__FUNCTION__" transmit timeout\n");
return -EIO;
}
return 0;
}
void kbd_leds(unsigned char leds)
{
return;
}
int kbd_setkeycode(unsigned int scancode, unsigned int keycode)
{
return -EINVAL;
}
int kbd_getkeycode(unsigned int scancode)
{
return -EINVAL;
}
int kbd_translate(unsigned char scancode, unsigned char *keycode,
char raw_mode)
{
*keycode = scancode;
return 1;
}
char kbd_unexpected_up(unsigned char keycode)
{
return 0x80;
}
static void lk201_kbd_rx_char(unsigned char ch, unsigned char stat)
{
static int shift_state = 0;
static int prev_scancode;
unsigned char c = scancodeRemap[ch];
if (!stat || stat == 4) {
switch (ch) {
case LK_KEY_ACK:
break;
case LK_KEY_LOCK:
shift_state ^= LK_LOCK;
handle_scancode(c, shift_state && LK_LOCK ? 1 : 0);
break;
case LK_KEY_SHIFT:
shift_state ^= LK_SHIFT;
handle_scancode(c, shift_state && LK_SHIFT ? 1 : 0);
break;
case LK_KEY_CTRL:
shift_state ^= LK_CTRL;
handle_scancode(c, shift_state && LK_CTRL ? 1 : 0);
break;
case LK_KEY_COMP:
shift_state ^= LK_COMP;
handle_scancode(c, shift_state && LK_COMP ? 1 : 0);
break;
case LK_KEY_RELEASE:
if (shift_state & LK_SHIFT)
handle_scancode(scancodeRemap[LK_KEY_SHIFT], 0);
if (shift_state & LK_CTRL)
handle_scancode(scancodeRemap[LK_KEY_CTRL], 0);
if (shift_state & LK_COMP)
handle_scancode(scancodeRemap[LK_KEY_COMP], 0);
if (shift_state & LK_LOCK)
handle_scancode(scancodeRemap[LK_KEY_LOCK], 0);
shift_state = 0;
break;
case LK_KEY_REPEAT:
handle_scancode(prev_scancode, 1);
break;
default:
prev_scancode = c;
handle_scancode(c, 1);
break;
}
} else
printk("Error reading LKx01 keyboard: 0x%02x\n", stat);
}
static void __init lk201_info(struct dec_serial *info)
{
}
static int __init lk201_init(struct dec_serial *info)
{
unsigned int ch, id = 0;
int result;
printk("DECstation LK keyboard driver v0.04... ");
result = lk201_reset(info);
if (result)
return result;
mdelay(10);
/*
* Detect whether there is an LK201 or an LK401
* The LK401 has ALT keys...
*/
info->hook->poll_tx_char(info, LK_CMD_REQ_ID);
while ((ch = info->hook->poll_rx_char(info)) > 0)
id = ch;
switch (id) {
case 1:
printk("LK201 detected\n");
break;
case 2:
printk("LK401 detected\n");
break;
default:
printk("unknown keyboard, ID %d,\n", id);
printk("... please report to <linux-mips@oss.sgi.com>\n");
}
/*
* now we're ready
*/
info->hook->rx_char = lk201_kbd_rx_char;
return 0;
}
void __init kbd_init_hw(void)
{
extern int register_zs_hook(unsigned int, struct zs_hook *);
extern int unregister_zs_hook(unsigned int);
if (TURBOCHANNEL) {
if (mips_machtype != MACH_DS5000_XX) {
/*
* This is not a MAXINE, so:
*
* kbd_init_hw() is being called before
* rs_init() so just register the kbd hook
* and let zs_init do the rest :-)
*/
if (mips_machtype == MACH_DS5000_200)
printk("LK201 Support for DS5000/200 not yet ready ...\n");
else
if(!register_zs_hook(KEYB_LINE, &lk201_kbdhook))
unregister_zs_hook(KEYB_LINE);
}
} else {
/*
* TODO: modify dz.c to allow similar hooks
* for LK201 handling on DS2100, DS3100, and DS5000/200
*/
printk("LK201 Support for DS3100 not yet ready ...\n");
}
}
/*
* Commands to the keyboard processor
*/
#define LK_PARAM 0x80 /* start/end parameter list */
#define LK_CMD_RESUME 0x8b
#define LK_CMD_INHIBIT 0xb9
#define LK_CMD_LEDS_ON 0x13 /* 1 param: led bitmask */
#define LK_CMD_LEDS_OFF 0x11 /* 1 param: led bitmask */
#define LK_CMD_DIS_KEYCLK 0x99
#define LK_CMD_ENB_KEYCLK 0x1b /* 1 param: volume */
#define LK_CMD_DIS_CTLCLK 0xb9
#define LK_CMD_ENB_CTLCLK 0xbb
#define LK_CMD_SOUND_CLK 0x9f
#define LK_CMD_DIS_BELL 0xa1
#define LK_CMD_ENB_BELL 0x23 /* 1 param: volume */
#define LK_CMD_BELL 0xa7
#define LK_CMD_TMP_NORPT 0xc1
#define LK_CMD_ENB_RPT 0xe3
#define LK_CMD_DIS_RPT 0xe1
#define LK_CMD_RPT_TO_DOWN 0xd9
#define LK_CMD_REQ_ID 0xab
#define LK_CMD_POWER_UP 0xfd
#define LK_CMD_TEST_MODE 0xcb
#define LK_CMD_SET_DEFAULTS 0xd3
/* there are 4 leds, represent them in the low 4 bits of a byte */
#define LK_PARAM_LED_MASK(ledbmap) (LK_PARAM|(ledbmap))
/* max volume is 0, lowest is 0x7 */
#define LK_PARAM_VOLUME(v) (LK_PARAM|((v)&0x7))
/* mode set command(s) details */
#define LK_MODE_DOWN 0x0
#define LK_MODE_RPT_DOWN 0x2
#define LK_MODE_DOWN_UP 0x6
#define LK_CMD_MODE(m,div) (LK_PARAM|(div<<3)|m)
#define LK_SHIFT 1<<0
#define LK_CTRL 1<<1
#define LK_LOCK 1<<2
#define LK_COMP 1<<3
#define LK_KEY_SHIFT 174
#define LK_KEY_CTRL 175
#define LK_KEY_LOCK 176
#define LK_KEY_COMP 177
#define LK_KEY_RELEASE 179
#define LK_KEY_REPEAT 180
#define LK_KEY_ACK 186
extern unsigned char scancodeRemap[256];
\ No newline at end of file
/* $Id: tc.c,v 1.3 1999/10/09 00:01:32 ralf Exp $ /*
* tc-init: We assume the TURBOchannel to be up and running so * tc-init: We assume the TURBOchannel to be up and running so
* just probe for Modules and fill in the global data structure * just probe for Modules and fill in the global data structure
* tc_bus. * tc_bus.
...@@ -8,9 +8,7 @@ ...@@ -8,9 +8,7 @@
* for more details. * for more details.
* *
* Copyright (c) Harald Koerfgen, 1998 * Copyright (c) Harald Koerfgen, 1998
*
*/ */
#include <linux/string.h> #include <linux/string.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/ioport.h> #include <linux/ioport.h>
...@@ -23,14 +21,15 @@ ...@@ -23,14 +21,15 @@
#include <asm/ptrace.h> #include <asm/ptrace.h>
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/module.h>
#define TC_DEBUG #define TC_DEBUG
slot_info tc_bus[MAX_SLOT]; slot_info tc_bus[MAX_SLOT];
static int max_tcslot = 0; static int max_tcslot;
static tcinfo *info = (tcinfo *)0; static tcinfo *info;
unsigned long system_base = 0; unsigned long system_base;
extern void (*dbe_board_handler)(struct pt_regs *regs); extern void (*dbe_board_handler)(struct pt_regs *regs);
extern unsigned long *(*rex_slot_address)(int); extern unsigned long *(*rex_slot_address)(int);
...@@ -112,19 +111,19 @@ static void __init tc_probe(unsigned long startaddr, unsigned long size, int max ...@@ -112,19 +111,19 @@ static void __init tc_probe(unsigned long startaddr, unsigned long size, int max
for (slot = 0; slot <= max_slot; slot++) { for (slot = 0; slot <= max_slot; slot++) {
module = (char *)(startaddr + slot * size); module = (char *)(startaddr + slot * size);
offset = -1; offset = -1;
if (module[OLDCARD + PATTERN0] == 0x55 && module[OLDCARD + PATTERN1] == 0x00 if (module[OLDCARD + TC_PATTERN0] == 0x55 && module[OLDCARD + TC_PATTERN1] == 0x00
&& module[OLDCARD + PATTERN2] == 0xaa && module[OLDCARD + PATTERN3] == 0xff) && module[OLDCARD + TC_PATTERN2] == 0xaa && module[OLDCARD + TC_PATTERN3] == 0xff)
offset = OLDCARD; offset = OLDCARD;
if (module[PATTERN0] == 0x55 && module[PATTERN1] == 0x00 if (module[TC_PATTERN0] == 0x55 && module[TC_PATTERN1] == 0x00
&& module[PATTERN2] == 0xaa && module[PATTERN3] == 0xff) && module[TC_PATTERN2] == 0xaa && module[TC_PATTERN3] == 0xff)
offset = 0; offset = 0;
if (offset != -1) { if (offset != -1) {
tc_bus[slot].base_addr = (unsigned long)module; tc_bus[slot].base_addr = (unsigned long)module;
for(i = 0; i < 8; i++) { for(i = 0; i < 8; i++) {
tc_bus[slot].firmware[i] = module[FIRM_VER + offset + 4 * i]; tc_bus[slot].firmware[i] = module[TC_FIRM_VER + offset + 4 * i];
tc_bus[slot].vendor[i] = module[VENDOR + offset + 4 * i]; tc_bus[slot].vendor[i] = module[TC_VENDOR + offset + 4 * i];
tc_bus[slot].name[i] = module[MODULE + offset + 4 * i]; tc_bus[slot].name[i] = module[TC_MODULE + offset + 4 * i];
} }
tc_bus[slot].firmware[8] = 0; tc_bus[slot].firmware[8] = 0;
tc_bus[slot].vendor[8] = 0; tc_bus[slot].vendor[8] = 0;
...@@ -206,7 +205,7 @@ void __init tc_init(void) ...@@ -206,7 +205,7 @@ void __init tc_init(void)
if (TURBOCHANNEL && info->slot_size && slot0addr) { if (TURBOCHANNEL && info->slot_size && slot0addr) {
printk("TURBOchannel rev. %1d at %2d.%1d MHz ", info->revision, printk("TURBOchannel rev. %1d at %2d.%1d MHz ", info->revision,
tc_clock / 10, tc_clock % 10); tc_clock / 10, tc_clock % 10);
printk("(%sparity)\n", info->parity ? "" : "no "); printk("(with%s parity)\n", info->parity ? "" : "out");
slot_size = info->slot_size << 20; slot_size = info->slot_size << 20;
...@@ -235,3 +234,11 @@ void __init tc_init(void) ...@@ -235,3 +234,11 @@ void __init tc_init(void)
ioport_resource.end = KSEG2 - 1; ioport_resource.end = KSEG2 - 1;
} }
} }
EXPORT_SYMBOL(search_tc_card);
EXPORT_SYMBOL(claim_tc_card);
EXPORT_SYMBOL(release_tc_card);
EXPORT_SYMBOL(get_tc_base_addr);
EXPORT_SYMBOL(get_tc_irq_nr);
EXPORT_SYMBOL(get_tc_speed);
/*
* TURBOchannel Services -- Exported Symbols
*
*/
#include <linux/module.h>
#include <asm/dec/tc.h>
EXPORT_SYMBOL(search_tc_card);
EXPORT_SYMBOL(claim_tc_card);
EXPORT_SYMBOL(release_tc_card);
EXPORT_SYMBOL(get_tc_base_addr);
EXPORT_SYMBOL(get_tc_irq_nr);
EXPORT_SYMBOL(get_tc_speed);
This diff is collapsed.
...@@ -89,6 +89,18 @@ struct dec_zschannel { ...@@ -89,6 +89,18 @@ struct dec_zschannel {
unsigned char curregs[NUM_ZSREGS]; unsigned char curregs[NUM_ZSREGS];
}; };
struct dec_serial;
struct zs_hook {
int (*init_channel)(struct dec_serial* info);
void (*init_info)(struct dec_serial* info);
void (*rx_char)(unsigned char ch, unsigned char stat);
int (*poll_rx_char)(struct dec_serial* info);
int (*poll_tx_char)(struct dec_serial* info,
unsigned char ch);
unsigned cflags;
};
struct dec_serial { struct dec_serial {
struct dec_serial *zs_next; /* For IRQ servicing chain */ struct dec_serial *zs_next; /* For IRQ servicing chain */
struct dec_zschannel *zs_channel; /* Channel registers */ struct dec_zschannel *zs_channel; /* Channel registers */
...@@ -97,7 +109,7 @@ struct dec_serial { ...@@ -97,7 +109,7 @@ struct dec_serial {
char soft_carrier; /* Use soft carrier on this channel */ char soft_carrier; /* Use soft carrier on this channel */
char break_abort; /* Is serial console in, so process brk/abrt */ char break_abort; /* Is serial console in, so process brk/abrt */
char kgdb_channel; /* Kgdb is running on this channel */ struct zs_hook *hook; /* Hook on this channel */
char is_cons; /* Is this our console. */ char is_cons; /* Is this our console. */
unsigned char tx_active; /* character is being xmitted */ unsigned char tx_active; /* character is being xmitted */
unsigned char tx_stopped; /* output is suspended */ unsigned char tx_stopped; /* output is suspended */
......
...@@ -67,6 +67,7 @@ comment 'USB Controllers' ...@@ -67,6 +67,7 @@ comment 'USB Controllers'
dep_tristate ' PLUSB Prolific USB-Network driver (EXPERIMENTAL)' CONFIG_USB_PLUSB $CONFIG_USB $CONFIG_NET $CONFIG_EXPERIMENTAL dep_tristate ' PLUSB Prolific USB-Network driver (EXPERIMENTAL)' CONFIG_USB_PLUSB $CONFIG_USB $CONFIG_NET $CONFIG_EXPERIMENTAL
dep_tristate ' USB ADMtek Pegasus-based ethernet device support (EXPERIMENTAL)' CONFIG_USB_PEGASUS $CONFIG_USB $CONFIG_NET $CONFIG_EXPERIMENTAL dep_tristate ' USB ADMtek Pegasus-based ethernet device support (EXPERIMENTAL)' CONFIG_USB_PEGASUS $CONFIG_USB $CONFIG_NET $CONFIG_EXPERIMENTAL
dep_tristate ' USB CATC NetMate-based Ethernet driver (EXPERIMENTAL)' CONFIG_USB_CATC $CONFIG_USB $CONFIG_NET $CONFIG_EXPERIMENTAL dep_tristate ' USB CATC NetMate-based Ethernet driver (EXPERIMENTAL)' CONFIG_USB_CATC $CONFIG_USB $CONFIG_NET $CONFIG_EXPERIMENTAL
dep_tristate ' USB KLSI KL5USB101-based ethernet device support (EXPERIMENTAL)' CONFIG_USB_KAWETH $CONFIG_USB $CONFIG_NET $CONFIG_EXPERIMENTAL
dep_tristate ' NetChip 1080-based USB Host-to-Host Link (EXPERIMENTAL)' CONFIG_USB_NET1080 $CONFIG_USB $CONFIG_NET $CONFIG_EXPERIMENTAL dep_tristate ' NetChip 1080-based USB Host-to-Host Link (EXPERIMENTAL)' CONFIG_USB_NET1080 $CONFIG_USB $CONFIG_NET $CONFIG_EXPERIMENTAL
comment 'USB port drivers' comment 'USB port drivers'
......
...@@ -65,6 +65,7 @@ obj-$(CONFIG_USB_OV511) += ov511.o ...@@ -65,6 +65,7 @@ obj-$(CONFIG_USB_OV511) += ov511.o
obj-$(CONFIG_USB_SE401) += se401.o obj-$(CONFIG_USB_SE401) += se401.o
obj-$(CONFIG_USB_PEGASUS) += pegasus.o obj-$(CONFIG_USB_PEGASUS) += pegasus.o
obj-$(CONFIG_USB_CATC) += catc.o obj-$(CONFIG_USB_CATC) += catc.o
obj-$(CONFIG_USB_KAWETH) += kaweth.o
obj-$(CONFIG_USB_RIO500) += rio500.o obj-$(CONFIG_USB_RIO500) += rio500.o
obj-$(CONFIG_USB_DSBR) += dsbr100.o obj-$(CONFIG_USB_DSBR) += dsbr100.o
obj-$(CONFIG_USB_MICROTEK) += microtek.o obj-$(CONFIG_USB_MICROTEK) += microtek.o
......
...@@ -248,9 +248,9 @@ static int kaweth_control(struct kaweth_device *kaweth, ...@@ -248,9 +248,9 @@ static int kaweth_control(struct kaweth_device *kaweth,
dr->requesttype = requesttype; dr->requesttype = requesttype;
dr->request = request; dr->request = request;
dr->value = value; dr->value = cpu_to_le16p(&value);
dr->index = index; dr->index = cpu_to_le16p(&index);
dr->length = size; dr->length = cpu_to_le16p(&size);
return kaweth_internal_control_msg(kaweth->dev, return kaweth_internal_control_msg(kaweth->dev,
pipe, pipe,
...@@ -370,6 +370,9 @@ static int kaweth_download_firmware(struct kaweth_device *kaweth, ...@@ -370,6 +370,9 @@ static int kaweth_download_firmware(struct kaweth_device *kaweth,
kaweth->firmware_buf[4] = type; kaweth->firmware_buf[4] = type;
kaweth->firmware_buf[5] = interrupt; kaweth->firmware_buf[5] = interrupt;
kaweth_dbg("High: %i, Low:%i", kaweth->firmware_buf[3],
kaweth->firmware_buf[2]);
kaweth_dbg("Downloading firmware at %x to kaweth device at %x", kaweth_dbg("Downloading firmware at %x to kaweth device at %x",
(int)data, (int)data,
(int)kaweth); (int)kaweth);
...@@ -476,7 +479,7 @@ static void kaweth_usb_receive(struct urb *urb) ...@@ -476,7 +479,7 @@ static void kaweth_usb_receive(struct urb *urb)
int count = urb->actual_length; int count = urb->actual_length;
int count2 = urb->transfer_buffer_length; int count2 = urb->transfer_buffer_length;
__u16 pkt_len = *(__u16 *)kaweth->rx_buf; __u16 pkt_len = le16_to_cpup(kaweth->rx_buf);
struct sk_buff *skb; struct sk_buff *skb;
...@@ -608,7 +611,7 @@ static int kaweth_start_xmit(struct sk_buff *skb, struct net_device *net) ...@@ -608,7 +611,7 @@ static int kaweth_start_xmit(struct sk_buff *skb, struct net_device *net)
kaweth_async_set_rx_mode(kaweth); kaweth_async_set_rx_mode(kaweth);
netif_stop_queue(net); netif_stop_queue(net);
*((__u16 *)kaweth->tx_buf) = skb->len; *((__u16 *)kaweth->tx_buf) = cpu_to_le16(skb->len);
memcpy(kaweth->tx_buf + 2, skb->data, skb->len); memcpy(kaweth->tx_buf + 2, skb->data, skb->len);
...@@ -836,7 +839,7 @@ static void *kaweth_probe( ...@@ -836,7 +839,7 @@ static void *kaweth_probe(
kaweth_info("Statistics collection: %x", kaweth->configuration.statistics_mask); kaweth_info("Statistics collection: %x", kaweth->configuration.statistics_mask);
kaweth_info("Multicast filter limit: %x", kaweth->configuration.max_multicast_filters & ((1 << 15) - 1)); kaweth_info("Multicast filter limit: %x", kaweth->configuration.max_multicast_filters & ((1 << 15) - 1));
kaweth_info("MTU: %d", kaweth->configuration.segment_size); kaweth_info("MTU: %d", le16_to_cpu(kaweth->configuration.segment_size));
kaweth_info("Read MAC address %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x", kaweth_info("Read MAC address %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x",
(int)kaweth->configuration.hw_addr[0], (int)kaweth->configuration.hw_addr[0],
(int)kaweth->configuration.hw_addr[1], (int)kaweth->configuration.hw_addr[1],
...@@ -896,7 +899,7 @@ static void *kaweth_probe( ...@@ -896,7 +899,7 @@ static void *kaweth_probe(
kaweth->net->hard_start_xmit = kaweth_start_xmit; kaweth->net->hard_start_xmit = kaweth_start_xmit;
kaweth->net->set_multicast_list = kaweth_set_rx_mode; kaweth->net->set_multicast_list = kaweth_set_rx_mode;
kaweth->net->get_stats = kaweth_netdev_stats; kaweth->net->get_stats = kaweth_netdev_stats;
kaweth->net->mtu = kaweth->configuration.segment_size; kaweth->net->mtu = le16_to_cpu(kaweth->configuration.segment_size);
memset(&kaweth->stats, 0, sizeof(kaweth->stats)); memset(&kaweth->stats, 0, sizeof(kaweth->stats));
...@@ -1052,3 +1055,10 @@ void __exit kaweth_exit(void) ...@@ -1052,3 +1055,10 @@ void __exit kaweth_exit(void)
module_init(kaweth_init); module_init(kaweth_init);
module_exit(kaweth_exit); module_exit(kaweth_exit);
...@@ -374,6 +374,7 @@ static int cramfs_readpage(struct file *file, struct page * page) ...@@ -374,6 +374,7 @@ static int cramfs_readpage(struct file *file, struct page * page)
{ {
struct inode *inode = page->mapping->host; struct inode *inode = page->mapping->host;
u32 maxblock, bytes_filled; u32 maxblock, bytes_filled;
void *pgdata;
maxblock = (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT; maxblock = (inode->i_size + PAGE_CACHE_SIZE - 1) >> PAGE_CACHE_SHIFT;
bytes_filled = 0; bytes_filled = 0;
...@@ -387,15 +388,18 @@ static int cramfs_readpage(struct file *file, struct page * page) ...@@ -387,15 +388,18 @@ static int cramfs_readpage(struct file *file, struct page * page)
start_offset = *(u32 *) cramfs_read(sb, blkptr_offset-4, 4); start_offset = *(u32 *) cramfs_read(sb, blkptr_offset-4, 4);
compr_len = (*(u32 *) cramfs_read(sb, blkptr_offset, 4) compr_len = (*(u32 *) cramfs_read(sb, blkptr_offset, 4)
- start_offset); - start_offset);
pgdata = kmap(page);
if (compr_len == 0) if (compr_len == 0)
; /* hole */ ; /* hole */
else else
bytes_filled = cramfs_uncompress_block(page_address(page), bytes_filled = cramfs_uncompress_block(pgdata,
PAGE_CACHE_SIZE, PAGE_CACHE_SIZE,
cramfs_read(sb, start_offset, compr_len), cramfs_read(sb, start_offset, compr_len),
compr_len); compr_len);
} } else
memset(page_address(page) + bytes_filled, 0, PAGE_CACHE_SIZE - bytes_filled); pgdata = kmap(page);
memset(pgdata + bytes_filled, 0, PAGE_CACHE_SIZE - bytes_filled);
kunmap(page);
flush_dcache_page(page); flush_dcache_page(page);
SetPageUptodate(page); SetPageUptodate(page);
UnlockPage(page); UnlockPage(page);
......
...@@ -1049,6 +1049,7 @@ void iput(struct inode *inode) ...@@ -1049,6 +1049,7 @@ void iput(struct inode *inode)
if (op && op->delete_inode) { if (op && op->delete_inode) {
void (*delete)(struct inode *) = op->delete_inode; void (*delete)(struct inode *) = op->delete_inode;
DQUOT_INIT(inode);
/* s_op->delete_inode internally recalls clear_inode() */ /* s_op->delete_inode internally recalls clear_inode() */
delete(inode); delete(inode);
} else } else
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
*/ */
#include <linux/string.h> #include <linux/string.h>
#include <linux/kernel.h>
#include <asm/byteorder.h> #include <asm/byteorder.h>
#include "unistr.h" #include "unistr.h"
......
...@@ -259,10 +259,10 @@ int umsdos_writeentry (struct dentry *parent, struct umsdos_info *info, ...@@ -259,10 +259,10 @@ int umsdos_writeentry (struct dentry *parent, struct umsdos_info *info,
p->ctime = cpu_to_le32(entry->ctime); p->ctime = cpu_to_le32(entry->ctime);
p->rdev = cpu_to_le16(entry->rdev); p->rdev = cpu_to_le16(entry->rdev);
p->mode = cpu_to_le16(entry->mode); p->mode = cpu_to_le16(entry->mode);
memcpy(p->name,entry->name, memcpy(p->spare,entry->spare,
(char *)(page_address(page) + PAGE_CACHE_SIZE) - p->spare); (char *)(page_address(page) + PAGE_CACHE_SIZE) - p->spare);
memcpy(page_address(page2), memcpy(page_address(page2),
entry->spare+PAGE_CACHE_SIZE-offs, ((char*)entry)+PAGE_CACHE_SIZE-offs,
offs+info->recsize-PAGE_CACHE_SIZE); offs+info->recsize-PAGE_CACHE_SIZE);
ret = mapping->a_ops->commit_write(NULL,page2,0, ret = mapping->a_ops->commit_write(NULL,page2,0,
offs+info->recsize-PAGE_CACHE_SIZE); offs+info->recsize-PAGE_CACHE_SIZE);
......
...@@ -13,6 +13,8 @@ ...@@ -13,6 +13,8 @@
#ifdef __KERNEL__ #ifdef __KERNEL__
#include <linux/kd.h>
#define KEYBOARD_IRQ 1 #define KEYBOARD_IRQ 1
#define DISABLE_KBD_DURING_INTERRUPTS 0 #define DISABLE_KBD_DURING_INTERRUPTS 0
...@@ -31,7 +33,7 @@ extern unsigned char pckbd_sysrq_xlate[128]; ...@@ -31,7 +33,7 @@ extern unsigned char pckbd_sysrq_xlate[128];
#define kbd_translate pckbd_translate #define kbd_translate pckbd_translate
#define kbd_unexpected_up pckbd_unexpected_up #define kbd_unexpected_up pckbd_unexpected_up
#define kbd_leds pckbd_leds #define kbd_leds pckbd_leds
#define kbd_rate pckbd_rate #define kbd_rate pckbd_rate
#define kbd_init_hw pckbd_init_hw #define kbd_init_hw pckbd_init_hw
#define kbd_sysrq_xlate pckbd_sysrq_xlate #define kbd_sysrq_xlate pckbd_sysrq_xlate
......
...@@ -6,6 +6,8 @@ enum km_type { ...@@ -6,6 +6,8 @@ enum km_type {
KM_BOUNCE_WRITE, KM_BOUNCE_WRITE,
KM_SKB_DATA, KM_SKB_DATA,
KM_SKB_DATA_SOFTIRQ, KM_SKB_DATA_SOFTIRQ,
KM_USER0,
KM_USER1,
KM_TYPE_NR KM_TYPE_NR
}; };
......
...@@ -85,6 +85,8 @@ typedef struct _agp_kern_info { ...@@ -85,6 +85,8 @@ typedef struct _agp_kern_info {
size_t aper_size; size_t aper_size;
int max_memory; /* In pages */ int max_memory; /* In pages */
int current_memory; int current_memory;
int cant_use_aperture;
unsigned long page_mask;
} agp_kern_info; } agp_kern_info;
/* /*
......
...@@ -45,8 +45,9 @@ static inline void *kmap(struct page *page) { return page_address(page); } ...@@ -45,8 +45,9 @@ static inline void *kmap(struct page *page) { return page_address(page); }
/* when CONFIG_HIGHMEM is not set these will be plain clear/copy_page */ /* when CONFIG_HIGHMEM is not set these will be plain clear/copy_page */
static inline void clear_user_highpage(struct page *page, unsigned long vaddr) static inline void clear_user_highpage(struct page *page, unsigned long vaddr)
{ {
clear_user_page(kmap(page), vaddr); void *addr = kmap_atomic(page, KM_USER0);
kunmap(page); clear_user_page(addr, vaddr);
kunmap_atomic(addr, KM_USER0);
} }
static inline void clear_highpage(struct page *page) static inline void clear_highpage(struct page *page)
...@@ -85,11 +86,11 @@ static inline void copy_user_highpage(struct page *to, struct page *from, unsign ...@@ -85,11 +86,11 @@ static inline void copy_user_highpage(struct page *to, struct page *from, unsign
{ {
char *vfrom, *vto; char *vfrom, *vto;
vfrom = kmap(from); vfrom = kmap_atomic(from, KM_USER0);
vto = kmap(to); vto = kmap_atomic(to, KM_USER1);
copy_user_page(vto, vfrom, vaddr); copy_user_page(vto, vfrom, vaddr);
kunmap(from); kunmap_atomic(vfrom, KM_USER0);
kunmap(to); kunmap_atomic(vto, KM_USER1);
} }
static inline void copy_highpage(struct page *to, struct page *from) static inline void copy_highpage(struct page *to, struct page *from)
......
...@@ -113,9 +113,9 @@ static inline void console_verbose(void) ...@@ -113,9 +113,9 @@ static inline void console_verbose(void)
((unsigned char *)&addr)[0] ((unsigned char *)&addr)[0]
#define min(type,x,y) \ #define min(type,x,y) \
({ type __x = (x), __y = (y); __x < __y ? __x: __y; }) ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
#define max(type,x,y) \ #define max(type,x,y) \
({ type __x = (x), __y = (y); __x > __y ? __x: __y; }) ({ type __x = (x); type __y = (y); __x > __y ? __x: __y; })
#endif /* __KERNEL__ */ #endif /* __KERNEL__ */
......
...@@ -985,6 +985,7 @@ ...@@ -985,6 +985,7 @@
#define PCI_VENDOR_ID_PHILIPS 0x1131 #define PCI_VENDOR_ID_PHILIPS 0x1131
#define PCI_DEVICE_ID_PHILIPS_SAA7145 0x7145 #define PCI_DEVICE_ID_PHILIPS_SAA7145 0x7145
#define PCI_DEVICE_ID_PHILIPS_SAA7146 0x7146 #define PCI_DEVICE_ID_PHILIPS_SAA7146 0x7146
#define PCI_DEVICE_ID_PHILIPS_SAA9730 0x9730
#define PCI_VENDOR_ID_EICON 0x1133 #define PCI_VENDOR_ID_EICON 0x1133
#define PCI_DEVICE_ID_EICON_DIVA20PRO 0xe001 #define PCI_DEVICE_ID_EICON_DIVA20PRO 0xe001
...@@ -1098,6 +1099,9 @@ ...@@ -1098,6 +1099,9 @@
#define PCI_VENDOR_ID_GALILEO 0x11ab #define PCI_VENDOR_ID_GALILEO 0x11ab
#define PCI_DEVICE_ID_GALILEO_GT64011 0x4146 #define PCI_DEVICE_ID_GALILEO_GT64011 0x4146
#define PCI_DEVICE_ID_GALILEO_GT64111 0x4146
#define PCI_DEVICE_ID_GALILEO_GT96100 0x9652
#define PCI_DEVICE_ID_GALILEO_GT96100A 0x9653
#define PCI_VENDOR_ID_LITEON 0x11ad #define PCI_VENDOR_ID_LITEON 0x11ad
#define PCI_DEVICE_ID_LITEON_LNE100TX 0x0002 #define PCI_DEVICE_ID_LITEON_LNE100TX 0x0002
...@@ -1228,6 +1232,10 @@ ...@@ -1228,6 +1232,10 @@
#define PCI_VENDOR_ID_ROCKWELL 0x127A #define PCI_VENDOR_ID_ROCKWELL 0x127A
#define PCI_VENDOR_ID_ITE 0x1283
#define PCI_DEVICE_ID_ITE_IT8172G 0x8172
#define PCI_DEVICE_ID_ITE_IT8172G_AUDIO 0x0801
#define PCI_VENDOR_ID_ITE 0x1283 #define PCI_VENDOR_ID_ITE 0x1283
#define PCI_DEVICE_ID_ITE_IT8172G 0x8172 #define PCI_DEVICE_ID_ITE_IT8172G 0x8172
......
...@@ -434,6 +434,7 @@ EXPORT_SYMBOL(iomem_resource); ...@@ -434,6 +434,7 @@ EXPORT_SYMBOL(iomem_resource);
/* process management */ /* process management */
EXPORT_SYMBOL(complete_and_exit); EXPORT_SYMBOL(complete_and_exit);
EXPORT_SYMBOL(__wake_up); EXPORT_SYMBOL(__wake_up);
EXPORT_SYMBOL(__wake_up_sync);
EXPORT_SYMBOL(wake_up_process); EXPORT_SYMBOL(wake_up_process);
EXPORT_SYMBOL(sleep_on); EXPORT_SYMBOL(sleep_on);
EXPORT_SYMBOL(sleep_on_timeout); EXPORT_SYMBOL(sleep_on_timeout);
......
...@@ -242,16 +242,16 @@ printk("SIG dequeue (%s:%d): %d ", current->comm, current->pid, ...@@ -242,16 +242,16 @@ printk("SIG dequeue (%s:%d): %d ", current->comm, current->pid,
#endif #endif
sig = next_signal(current, mask); sig = next_signal(current, mask);
if (current->notifier) { if (sig) {
if (sigismember(current->notifier_mask, sig)) { if (current->notifier) {
if (!(current->notifier)(current->notifier_data)) { if (sigismember(current->notifier_mask, sig)) {
current->sigpending = 0; if (!(current->notifier)(current->notifier_data)) {
return 0; current->sigpending = 0;
return 0;
}
} }
} }
}
if (sig) {
if (!collect_signal(sig, &current->pending, info)) if (!collect_signal(sig, &current->pending, info))
sig = 0; sig = 0;
......
...@@ -1119,6 +1119,7 @@ static int do_swap_page(struct mm_struct * mm, ...@@ -1119,6 +1119,7 @@ static int do_swap_page(struct mm_struct * mm,
*/ */
return pte_same(*page_table, orig_pte) ? -1 : 1; return pte_same(*page_table, orig_pte) ? -1 : 1;
} }
SetPageReferenced(page);
} }
/* /*
......
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