Commit 3ddf5291 authored by Linus Torvalds's avatar Linus Torvalds

Import 2.3.36pre2

parent 8f3af4d1
......@@ -38,13 +38,17 @@ KMod
If you use kmod, you will find it useful to edit /etc/modules.conf.
Here is an example of the lines that need to be added:
post-install parport modprobe -k parport_pc
alias parport_lowlevel parport_pc
options parport_pc io=0x378,0x278 irq=7,auto
KMod will then automatically load parport_pc (with the options
"io=0x378,0x278 irq=7,auto") whenever a parallel port device driver
(such as lp) is loaded.
Note that these are example lines only! You shouldn't in general need
to specify any options to parport_pc in order to be able to use a
parallel port.
Parport probe [optional]
-------------
......
......@@ -146,6 +146,10 @@ ifdef CONFIG_WAN
DRIVERS := $(DRIVERS) drivers/net/wan/wan.a
endif
ifeq ($(CONFIG_ARCNET),y)
DRIVERS := $(DRIVERS) drivers/net/arcnet/arcnet.a
endif
ifdef CONFIG_ATM
DRIVERS := $(DRIVERS) drivers/atm/atm.a
endif
......
......@@ -154,6 +154,12 @@ CONFIG_SKB_LARGE=y
# CONFIG_IPX is not set
# CONFIG_ATALK is not set
#
# Telephony Support
#
# CONFIG_PHONE is not set
# CONFIG_PHONE_IXJ is not set
#
# SCSI support
#
......
......@@ -731,6 +731,7 @@ unsigned long probe_irq_on(void)
{
unsigned int i;
unsigned long delay;
unsigned long val;
/*
* first, enable any unassigned irqs
......@@ -754,6 +755,7 @@ unsigned long probe_irq_on(void)
/*
* Now filter out any obviously spurious interrupts
*/
val = 0;
spin_lock_irq(&irq_controller_lock);
for (i=0; i<NR_IRQS; i++) {
unsigned int status = irq_desc[i].status;
......@@ -766,24 +768,24 @@ unsigned long probe_irq_on(void)
irq_desc[i].status = status & ~IRQ_AUTODETECT;
irq_desc[i].handler->shutdown(i);
}
if (i < 32)
val |= 1 << i;
}
spin_unlock_irq(&irq_controller_lock);
return 0x12345678;
return val;
}
/*
* Return a mask of triggered interrupts (this
* can handle only legacy ISA interrupts).
*/
unsigned int probe_irq_mask(unsigned long unused)
unsigned int probe_irq_mask(unsigned long val)
{
int i;
unsigned int mask;
if (unused != 0x12345678)
printk("Bad IRQ probe from %lx\n", (&unused)[-1]);
mask = 0;
spin_lock_irq(&irq_controller_lock);
for (i = 0; i < 16; i++) {
......@@ -800,20 +802,17 @@ unsigned int probe_irq_mask(unsigned long unused)
}
spin_unlock_irq(&irq_controller_lock);
return mask;
return mask & val;
}
/*
* Return the one interrupt that triggered (this can
* handle any interrupt source)
*/
int probe_irq_off(unsigned long unused)
int probe_irq_off(unsigned long val)
{
int i, irq_found, nr_irqs;
if (unused != 0x12345678)
printk("Bad IRQ probe from %lx\n", (&unused)[-1]);
nr_irqs = 0;
irq_found = 0;
spin_lock_irq(&irq_controller_lock);
......
......@@ -662,11 +662,30 @@ static void lp_console_write (struct console *co, const char *s,
parport_negotiate (port, IEEE1284_MODE_COMPAT);
do {
/* Write the data. */
written = parport_write (port, s, count);
if (written > 0) {
s += written;
count -= written;
/* Write the data, converting LF->CRLF as we go. */
ssize_t canwrite = count;
char *line = strchr (s, '\n');
if (line)
canwrite = line - s;
written = parport_write (port, s, canwrite);
if (written <= 0)
continue;
s += written;
count -= written;
if (line) {
const char *crlf = "\r\n";
int i = 2;
/* Dodge the original '\n', and put '\r\n' instead. */
s++;
count--;
while (i) {
written = parport_write (port, crlf, i);
if (written > 0)
i -= written, crlf += written;
}
}
} while (count > 0 && (CONSOLE_LP_STRICT || written > 0));
......
......@@ -2,20 +2,7 @@
# Network device configuration
#
mainmenu_option next_comment
comment 'ARCnet devices'
tristate 'ARCnet support' CONFIG_ARCNET
if [ "$CONFIG_ARCNET" != "n" ]; then
bool ' Enable arc0e (ARCnet "Ether-Encap" packet format)' CONFIG_ARCNET_ETH
bool ' Enable arc0s (ARCnet RFC1051 packet format)' CONFIG_ARCNET_1051
dep_tristate ' ARCnet COM90xx (normal) chipset driver' CONFIG_ARCNET_COM90xx $CONFIG_ARCNET
dep_tristate ' ARCnet COM90xx (IO mapped) chipset driver' CONFIG_ARCNET_COM90xxIO $CONFIG_ARCNET
dep_tristate ' ARCnet COM90xx (RIM I) chipset driver' CONFIG_ARCNET_RIM_I $CONFIG_ARCNET
dep_tristate ' ARCnet COM20020 chipset driver' CONFIG_ARCNET_COM20020 $CONFIG_ARCNET
fi
endmenu
source drivers/net/arcnet/Config.in
tristate 'Dummy net driver support' CONFIG_DUMMY
tristate 'EQL (serial line load balancing) support' CONFIG_EQUALIZER
......
......@@ -17,7 +17,7 @@ obj- :=
SUB_DIRS :=
MOD_SUB_DIRS :=
MOD_IN_SUB_DIRS :=
ALL_SUB_DIRS := $(SUB_DIRS) fc hamradio irda pcmcia tokenring wan sk98lin
ALL_SUB_DIRS := $(SUB_DIRS) fc hamradio irda pcmcia tokenring wan sk98lin arcnet
O_TARGET := net.o
O_OBJS :=
......@@ -27,7 +27,7 @@ MOD_LIST_NAME := NET_MODULES
# All of the (potential) objects that export symbols.
# This list comes from 'grep -l EXPORT_SYMBOL *.[hc]'.
export-objs := 8390.o arcnet.o arlan.o aironet4500_core.o aironet4500_card.o ppp_async.o \
export-objs := 8390.o arlan.o aironet4500_core.o aironet4500_card.o ppp_async.o \
ppp_generic.o slhc.o
ifeq ($(CONFIG_PCMCIA),y)
......@@ -96,6 +96,15 @@ else
endif
endif
ifeq ($(CONFIG_ARCNET),y)
SUB_DIRS += arcnet
MOD_IN_SUB_DIRS += arcnet
else
ifeq ($(CONFIG_ARCNET),m)
MOD_IN_SUB_DIRS += arcnet
endif
endif
obj-$(CONFIG_AIRONET4500) += aironet4500_core.o
......@@ -215,11 +224,6 @@ obj-$(CONFIG_APRICOT) += 82596.o
obj-$(CONFIG_MVME16x_NET) += 82596.o
obj-$(CONFIG_BVME6000_NET) += 82596.o
obj-$(CONFIG_DEC_ELCP) += tulip.o
obj-$(CONFIG_ARCNET) += arcnet.o
obj-$(CONFIG_ARCNET_COM90xx) += com90xx.o
obj-$(CONFIG_ARCNET_COM90xxIO) += com90io.o
obj-$(CONFIG_ARCNET_RIM_I) += arc-rimi.o
obj-$(CONFIG_ARCNET_COM20020) += com20020.o
obj-$(CONFIG_ETH16I) += eth16i.o
obj-$(CONFIG_EPIC100) += epic100.o
obj-$(CONFIG_ARIADNE2) += ariadne2.o 8390.o
......
This diff is collapsed.
This diff is collapsed.
#
# Arcnet configuration
#
mainmenu_option next_comment
comment 'ARCnet devices'
tristate 'ARCnet support' CONFIG_ARCNET
if [ "$CONFIG_ARCNET" != "n" ]; then
dep_tristate 'Enable standard ARCNet packet format (RFC 1201)' CONFIG_ARCNET_1201 $CONFIG_ARCNET
dep_tristate 'Enable old ARCNet packet format (RFC 1051)' CONFIG_ARCNET_1051 $CONFIG_ARCNET
dep_tristate 'Enable raw mode packet interface' CONFIG_ARCNET_RAW $CONFIG_ARCNET
dep_tristate 'ARCnet COM90xx (normal) chipset driver' CONFIG_ARCNET_COM90xx $CONFIG_ARCNET
dep_tristate 'ARCnet COM90xx (IO mapped) chipset driver' CONFIG_ARCNET_COM90xxIO $CONFIG_ARCNET
dep_tristate 'ARCnet COM90xx (RIM I) chipset driver' CONFIG_ARCNET_RIM_I $CONFIG_ARCNET
dep_tristate 'ARCnet COM20020 chipset driver' CONFIG_ARCNET_COM20020 $CONFIG_ARCNET
if [ "$CONFIG_ARCNET_COM20020" != "n" ]; then
dep_tristate ' Support for COM20020 on ISA' CONFIG_ARCNET_COM20020_ISA $CONFIG_ARCNET_COM20020 $CONFIG_ARCNET
dep_tristate ' Support for COM20020 on PCI' CONFIG_ARCNET_COM20020_PCI $CONFIG_ARCNET_COM20020 $CONFIG_ARCNET
fi
fi
endmenu
# Makefile for linux/drivers/net/arcnet
#
# Note! Dependencies are done automagically by 'make dep', which also
# removes any old dependencies. DON'T put your own dependencies here
# unless it's something special (ie not a .c file).
#
SUB_DIRS :=
MOD_SUB_DIRS := $(SUB_DIRS)
ALL_SUB_DIRS := $(SUB_DIRS)
obj-y :=
obj-n :=
obj-m :=
obj- :=
export-objs := arcnet.o com20020.o
obj-$(CONFIG_ARCNET) += arcnet.o
obj-$(CONFIG_ARCNET_1201) += rfc1201.o
obj-$(CONFIG_ARCNET_1051) += rfc1051.o
obj-$(CONFIG_ARCNET_RAW) += arc-rawmode.o
obj-$(CONFIG_ARCNET_COM90xx) += com90xx.o
obj-$(CONFIG_ARCNET_COM90xxIO) += com90io.o
obj-$(CONFIG_ARCNET_RIM_I) += arc-rimi.o
obj-$(CONFIG_ARCNET_COM20020) += com20020.o
obj-$(CONFIG_ARCNET_COM20020_ISA) += com20020-isa.o
obj-$(CONFIG_ARCNET_COM20020_PCI) += com20020-pci.o
L_TARGET := arcnet.a
L_OBJS := $(filter-out $(export-objs), $(obj-y))
LX_OBJS := $(filter $(export-objs), $(obj-y))
M_OBJS := $(sort $(filter-out $(export-objs), $(obj-m)))
MX_OBJS := $(sort $(filter $(export-objs), $(obj-m)))
include $(TOPDIR)/Rules.make
/*
* Linux ARCnet driver - "raw mode" packet encapsulation (no soft headers)
*
* Written 1994-1999 by Avery Pennarun.
* Derived from skeleton.c by Donald Becker.
*
* Special thanks to Contemporary Controls, Inc. (www.ccontrols.com)
* for sponsoring the further development of this driver.
*
* **********************
*
* The original copyright of skeleton.c was as follows:
*
* skeleton.c Written 1993 by Donald Becker.
* Copyright 1993 United States Government as represented by the
* Director, National Security Agency. This software may only be used
* and distributed according to the terms of the GNU Public License as
* modified by SRC, incorporated herein by reference.
*
* **********************
*
* For more details, see drivers/net/arcnet.c
*
* **********************
*/
#include <linux/module.h>
#include <linux/config.h> /* for CONFIG_INET */
#include <linux/init.h>
#include <linux/if_arp.h>
#include <net/arp.h>
#include <linux/netdevice.h>
#include <linux/skbuff.h>
#include <linux/arcdevice.h>
#define VERSION "arcnet: raw mode (`r') encapsulation support loaded.\n"
static void rx(struct net_device *dev, int bufnum,
struct archdr *pkthdr, int length);
static int build_header(struct sk_buff *skb, unsigned short type,
uint8_t daddr);
static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
int bufnum);
struct ArcProto rawmode_proto = {
'r',
XMTU,
rx,
build_header,
prepare_tx
};
void arcnet_raw_init(void)
{
int count;
for (count = 0; count < 256; count++)
if (arc_proto_map[count] == arc_proto_default)
arc_proto_map[count] = &rawmode_proto;
/* for raw mode, we only set the bcast proto if there's no better one */
if (arc_bcast_proto == arc_proto_default)
arc_bcast_proto = &rawmode_proto;
arc_proto_default = &rawmode_proto;
}
#ifdef MODULE
int __init init_module(void)
{
printk(VERSION);
arcnet_raw_init();
return 0;
}
void cleanup_module(void)
{
arcnet_unregister_proto(&rawmode_proto);
}
#endif /* MODULE */
/* packet receiver */
static void rx(struct net_device *dev, int bufnum,
struct archdr *pkthdr, int length)
{
struct arcnet_local *lp = (struct arcnet_local *)dev->priv;
struct sk_buff *skb;
struct archdr *pkt = pkthdr;
int ofs;
BUGMSG(D_DURING, "it's a raw packet (length=%d)\n", length);
if (length >= MinTU)
ofs = 512 - length;
else
ofs = 256 - length;
skb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC);
if (skb == NULL)
{
BUGMSG(D_NORMAL, "Memory squeeze, dropping packet.\n");
lp->stats.rx_dropped++;
return;
}
skb_put(skb, length + ARC_HDR_SIZE);
skb->dev = dev;
pkt = (struct archdr *)skb->data;
skb->mac.raw = skb->data;
skb_pull(skb, ARC_HDR_SIZE);
/* up to sizeof(pkt->soft) has already been copied from the card */
memcpy(pkt, pkthdr, sizeof(struct archdr));
if (length > sizeof(pkt->soft))
lp->hw.copy_from_card(dev, bufnum, ofs + sizeof(pkt->soft),
pkt->soft.raw + sizeof(pkt->soft),
length - sizeof(pkt->soft));
BUGLVL(D_SKB) arcnet_dump_skb(dev, skb, "rx");
skb->protocol = 0;
netif_rx(skb);
}
/*
* Create the ARCnet hard/soft headers for raw mode.
* There aren't any soft headers in raw mode - not even the protocol id.
*/
static int build_header(struct sk_buff *skb, unsigned short type,
uint8_t daddr)
{
struct net_device *dev = skb->dev;
int hdr_size = ARC_HDR_SIZE;
struct archdr *pkt = (struct archdr *)skb_push(skb, hdr_size);
/*
* Set the source hardware address.
*
* This is pretty pointless for most purposes, but it can help in
* debugging. ARCnet does not allow us to change the source address in
* the actual packet sent)
*/
pkt->hard.source = *dev->dev_addr;
/* see linux/net/ethernet/eth.c to see where I got the following */
if (dev->flags & (IFF_LOOPBACK|IFF_NOARP))
{
/*
* FIXME: fill in the last byte of the dest ipaddr here to better
* comply with RFC1051 in "noarp" mode.
*/
pkt->hard.dest = 0;
return hdr_size;
}
/* otherwise, just fill it in and go! */
pkt->hard.dest = daddr;
return hdr_size; /* success */
}
static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
int bufnum)
{
struct arcnet_local *lp = (struct arcnet_local *)dev->priv;
struct arc_hardware *hard = &pkt->hard;
int ofs;
BUGMSG(D_DURING, "prepare_tx: txbufs=%d/%d/%d\n",
lp->next_tx, lp->cur_tx, bufnum);
length -= ARC_HDR_SIZE; /* hard header is not included in packet length */
if (length > XMTU)
{
/* should never happen! other people already check for this. */
BUGMSG(D_NORMAL, "Bug! prepare_tx with size %d (> %d)\n",
length, XMTU);
length = XMTU;
}
if (length > MinTU)
{
hard->offset[0] = 0;
hard->offset[1] = ofs = 512 - length;
}
else if (length > MTU)
{
hard->offset[0] = 0;
hard->offset[1] = ofs = 512 - length - 3;
}
else
hard->offset[0] = ofs = 256 - length;
lp->hw.copy_to_card(dev, bufnum, 0, hard, ARC_HDR_SIZE);
lp->hw.copy_to_card(dev, bufnum, ofs, &pkt->soft, length);
lp->lastload_dest = hard->dest;
return 1; /* done */
}
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
/*
* Linux ARCnet driver - COM20020 PCI support (Contemporary Controls PCI20)
*
* Written 1994-1999 by Avery Pennarun,
* based on an ISA version by David Woodhouse.
* Written 1999 by Martin Mares <mj@suse.cz>.
* Derived from skeleton.c by Donald Becker.
*
* Special thanks to Contemporary Controls, Inc. (www.ccontrols.com)
* for sponsoring the further development of this driver.
*
* **********************
*
* The original copyright of skeleton.c was as follows:
*
* skeleton.c Written 1993 by Donald Becker.
* Copyright 1993 United States Government as represented by the
* Director, National Security Agency. This software may only be used
* and distributed according to the terms of the GNU Public License as
* modified by SRC, incorporated herein by reference.
*
* **********************
*
* For more details, see drivers/net/arcnet.c
*
* **********************
*/
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/ioport.h>
#include <linux/malloc.h>
#include <linux/errno.h>
#include <linux/netdevice.h>
#include <linux/init.h>
#include <linux/pci.h>
#include <linux/arcdevice.h>
#include <linux/com20020.h>
#include <asm/io.h>
#define VERSION "arcnet: COM20020 PCI support\n"
#ifdef MODULE
static struct net_device *cards[16];
static int numcards;
#endif
static void com20020pci_open_close(struct net_device *dev, bool open)
{
if (open)
MOD_INC_USE_COUNT;
else
MOD_DEC_USE_COUNT;
}
/*
* No need to probe for PCI cards - just ask the PCI layer and launch all the
* ones we find.
*/
static int __init com20020pci_probe(char *name_template, int node, int backplane, int clock, int timeout)
{
struct net_device *dev;
struct arcnet_local *lp;
struct pci_dev *pdev = NULL;
int ioaddr, gotone = 0, err;
BUGLVL(D_NORMAL) printk(VERSION);
while ((pdev = pci_find_device(0x1571, 0xa004, pdev)))
{
if (pci_enable_device(pdev))
continue;
dev = dev_alloc(name_template ? : "arc%d", &err);
if (!dev)
return err;
lp = dev->priv = kmalloc(sizeof(struct arcnet_local), GFP_KERNEL);
if (!lp)
return -ENOMEM;
memset(lp, 0, sizeof(struct arcnet_local));
ioaddr = pdev->resource[2].start;
dev->base_addr = ioaddr;
dev->irq = pdev->irq;
dev->dev_addr[0] = node;
lp->backplane = backplane;
lp->clock = clock;
lp->timeout = timeout;
lp->hw.open_close_ll = com20020pci_open_close;
BUGMSG(D_INIT, "PCI BIOS reports a device at %Xh, IRQ %d\n",
ioaddr, dev->irq);
if (check_region(ioaddr, ARCNET_TOTAL_SIZE))
{
BUGMSG(D_INIT, "IO region %xh-%xh already allocated.\n",
ioaddr, ioaddr + ARCNET_TOTAL_SIZE - 1);
continue;
}
if (ASTATUS() == 0xFF)
{
BUGMSG(D_NORMAL, "IO address %Xh was reported by PCI BIOS, "
"but seems empty!\n", ioaddr);
continue;
}
if (com20020_check(dev))
continue;
if (!com20020_found(dev, SA_SHIRQ))
{
#ifdef MODULE
cards[numcards++] = dev;
#endif
gotone++;
}
}
return gotone ? 0 : -ENODEV;
}
#ifdef MODULE
/* Module parameters */
static int node = 0;
static char *device; /* use eg. device="arc1" to change name */
static int timeout = 3;
static int backplane = 0;
static int clock = 0;
MODULE_PARM(node, "i");
MODULE_PARM(device, "s");
MODULE_PARM(timeout, "i");
MODULE_PARM(backplane, "i");
MODULE_PARM(clock, "i");
int init_module(void)
{
return com20020pci_probe(device, node, backplane, clock & 7, timeout & 3);
}
void cleanup_module(void)
{
struct net_device *dev;
int count;
for (count = 0; count < numcards; count++)
{
dev = cards[count];
if (dev->start)
dev->stop(dev);
free_irq(dev->irq, dev);
release_region(dev->base_addr, ARCNET_TOTAL_SIZE);
unregister_netdev(dev);
kfree(dev->priv);
kfree(dev);
}
}
#else
void __init com20020pci_probe_all(void)
{
com20020pci_probe(NULL, 0, 0, 0, 3);
}
#endif /* MODULE */
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment