Use a more current kernel line style.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de>
#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, struct net_device *dev,
.ack_tx = NULL
};
-
static int __init arcnet_raw_init(void)
{
int count;
MODULE_LICENSE("GPL");
-
/* packet receiver */
static void rx(struct net_device *dev, int bufnum,
struct archdr *pkthdr, int length)
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.
return hdr_size; /* success */
}
-
static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
int bufnum)
{
#include <asm/io.h>
#include <linux/arcdevice.h>
-
#define VERSION "arcnet: RIM I (entirely mem-mapped) support\n"
-
/* Internal function declarations */
static int arcrimi_probe(struct net_device *dev);
#define AINTMASK(msk) writeb((msk), _INTMASK)
#define SETCONF() writeb(lp->config, _CONFIG)
-
/*
* We cannot probe for a RIM I card; one reason is I don't know how to reset
* them. In fact, we can't even get their node ID automatically. So, we
return -EIO;
}
-
/*
* Do a hardware reset on the card, and set up necessary registers.
*
{
struct arcnet_local *lp = netdev_priv(dev);
void __iomem *memaddr = lp->mem_start + 0x800 + bufnum * 512 + offset;
+
TIME("memcpy_toio", count, memcpy_toio(memaddr, buf, count));
}
-
static void arcrimi_copy_from_card(struct net_device *dev, int bufnum, int offset,
void *buf, int count)
{
struct arcnet_local *lp = netdev_priv(dev);
void __iomem *memaddr = lp->mem_start + 0x800 + bufnum * 512 + offset;
+
TIME("memcpy_fromio", count, memcpy_fromio(buf, memaddr, count));
}
static int __init arcrimi_setup(char *s)
{
int ints[8];
+
s = get_options(s, 8, ints);
if (!ints[0])
return 1;
EXPORT_SYMBOL(arcnet_dump_skb);
#endif
-
/*
* Dump the contents of an ARCnet buffer
*/
#endif
-
/*
* Unregister a protocol driver from the arc_proto_map. Protocol drivers
* are responsible for registering themselves, but the unregister routine
}
}
-
/*
* Add a buffer to the queue. Only the interrupt handler is allowed to do
* this, unless interrupts are disabled.
}
}
-
/*
* Get a buffer from the queue. If this returns -1, there are no buffers
* available.
}
}
-
BUGLVL(D_DURING) {
BUGMSG(D_DURING, "get_arcbuf: got #%d; buffer queue is now: ", buf);
for (i = lp->next_buf; i != lp->first_free_buf; i = (i + 1) % 5)
return buf;
}
-
static int choose_mtu(void)
{
int count, mtu = 65535;
arcdev_setup);
if (dev) {
struct arcnet_local *lp = netdev_priv(dev);
+
spin_lock_init(&lp->lock);
}
BUGMSG2(D_PROTO, "\n");
}
-
BUGMSG(D_INIT, "arcnet_open: resetting card.\n");
/* try to put the card in a defined state - if it fails the first
ACOMMAND(CFLAGScmd | RESETclear);
}
-
BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
/* make sure we're ready to receive IRQ's. */
AINTMASK(0);
return error;
}
-
/* The inverse routine to arcnet_open - shuts down the card. */
int arcnet_close(struct net_device *dev)
{
return 0;
}
-
static int arcnet_header(struct sk_buff *skb, struct net_device *dev,
unsigned short type, const void *daddr,
const void *saddr, unsigned len)
BUGMSG(D_NORMAL, "arcnet_header: Yikes! skb->len(%d) != len(%d)!\n",
skb->len, len);
-
/* Type is host order - ? */
if (type == ETH_P_ARCNET) {
proto = arc_raw_proto;
return retval; /* no need to try again */
}
-
/*
* Actually start transmitting a packet that was loaded into a buffer
* by prepare_tx. This should _only_ be called by the interrupt handler.
return 1;
}
-
/* Called by the kernel when transmit times out */
void arcnet_timeout(struct net_device *dev)
{
netif_wake_queue(dev);
}
-
/*
* The typical workload of the driver: Handle the network interface
* interrupts. Establish which device needs attention, and call the correct
didsomething++;
}
-
/* a transmit finished, and we're interested in it. */
if ((status & lp->intmask & TXFREEflag) || lp->timed_out) {
lp->intmask &= ~(TXFREEflag | EXCNAKflag);
if (lp->outgoing.proto &&
lp->outgoing.proto->ack_tx) {
int ackstatus;
+
if (status & TXACKflag)
ackstatus = 2;
else if (lp->excnak_pending)
/* continue a split packet, if any */
if (lp->outgoing.proto && lp->outgoing.proto->continue_tx) {
int txbuf = get_arcbuf(dev);
+
if (txbuf != -1) {
if (lp->outgoing.proto->continue_tx(dev, txbuf)) {
/* that was the last segment */
ASTATUS(), boguscount);
BUGMSG(D_DURING, "\n");
-
AINTMASK(0);
udelay(1);
AINTMASK(lp->intmask);
return retval;
}
-
/*
* This is a generic packet receiver that calls arcnet??_rx depending on the
* protocol ID found.
arc_proto_map[soft->proto]->rx(dev, bufnum, &pkt, length);
}
-
static void null_rx(struct net_device *dev, int bufnum,
struct archdr *pkthdr, int length)
{
pkthdr->soft.rfc1201.proto, pkthdr->hard.source);
}
-
static int null_build_header(struct sk_buff *skb, struct net_device *dev,
unsigned short type, uint8_t daddr)
{
return 0;
}
-
/* the "do nothing" prepare_tx function warns that there's nothing to do. */
static int null_prepare_tx(struct net_device *dev, struct archdr *pkt,
int length, int bufnum)
netif_rx(skb);
}
-
/*
* Create the ARCnet hard/soft headers for cap mode.
* There aren't any soft headers in cap mode - not even the protocol id.
return hdr_size; /* success */
}
-
static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
int bufnum)
{
struct arc_hardware *hard = &pkt->hard;
int ofs;
-
/* hard header is not included in packet length */
length -= ARC_HDR_SIZE;
/* And neither is the cookie field */
#define VERSION "arcnet: COM20020 ISA support (by David Woodhouse et al.)\n"
-
/*
* We cannot (yet) probe for an IO mapped card, although we can check that
* it's where we were told it was, and even do autoirq.
#include <asm/io.h>
-
#define VERSION "arcnet: COM20020 PCI support\n"
/* Module parameters */
INIT_LIST_HEAD(&priv->list_dev);
-
for (i = 0; i < ci->devcount; i++) {
struct com20020_pci_channel_map *cm = &ci->chan_map_tbl[i];
struct com20020_dev *card;
TIME("insb", count, insb(_MEMDATA, buf, count));
}
-
static void com20020_copy_to_card(struct net_device *dev, int bufnum,
int offset, void *buf, int count)
{
TIME("outsb", count, outsb(_MEMDATA, buf, count));
}
-
/* Reset the card and check some basic stuff during the detection stage. */
int com20020_check(struct net_device *dev)
{
return 0;
}
-
/*
* Do a hardware reset on the card, and set up necessary registers.
*
return 0;
}
-
static void com20020_setmask(struct net_device *dev, int mask)
{
u_int ioaddr = dev->base_addr;
+
BUGMSG(D_DURING, "Setting mask to %x at %x\n", mask, ioaddr);
AINTMASK(mask);
}
-
static void com20020_command(struct net_device *dev, int cmd)
{
u_int ioaddr = dev->base_addr;
+
ACOMMAND(cmd);
}
-
static int com20020_status(struct net_device *dev)
{
u_int ioaddr = dev->base_addr;
#define VERSION "arcnet: COM20020 PCMCIA support loaded.\n"
-
static void regdump(struct net_device *dev)
{
#ifdef DEBUG
#endif
}
-
-
/*====================================================================*/
/* Parameters that can be set with 'insmod' */
if (link->open) {
int ioaddr = dev->base_addr;
struct arcnet_local *lp = netdev_priv(dev);
+
ARCRESET;
}
#include <asm/io.h>
#include <linux/arcdevice.h>
-
#define VERSION "arcnet: COM90xx IO-mapped mode support (by David Woodhouse et el.)\n"
-
/* Internal function declarations */
static int com90io_found(struct net_device *dev);
static void com90io_copy_from_card(struct net_device *dev, int bufnum, int offset,
void *buf, int count);
-
/* Handy defines for ARCnet specific stuff */
/* The number of low I/O ports used by the card. */
#define AINTMASK(msk) outb((msk), _INTMASK)
#define SETCONF() outb((lp->config), _CONFIG)
-
/****************************************************************************
* *
* IO-mapped operation routines *
#endif
-
static void get_whole_buffer(struct net_device *dev, unsigned offset, unsigned length, char *dest)
{
int ioaddr = dev->base_addr;
return -ENODEV;
}
-
/* Set up the struct net_device associated with this card. Called after
* probing succeeds.
*/
return 0;
}
-
/*
* Do a hardware reset on the card, and set up necessary registers.
*
return 0;
}
-
static void com90io_command(struct net_device *dev, int cmd)
{
short ioaddr = dev->base_addr;
ACOMMAND(cmd);
}
-
static int com90io_status(struct net_device *dev)
{
short ioaddr = dev->base_addr;
return ASTATUS();
}
-
static void com90io_setmask(struct net_device *dev, int mask)
{
short ioaddr = dev->base_addr;
TIME("put_whole_buffer", count, put_whole_buffer(dev, bufnum * 512 + offset, count, buf));
}
-
static void com90io_copy_from_card(struct net_device *dev, int bufnum, int offset,
void *buf, int count)
{
static int __init com90io_setup(char *s)
{
int ints[4];
+
s = get_options(s, 4, ints);
if (!ints[0])
return 0;
#include <asm/io.h>
#include <linux/arcdevice.h>
-
#define VERSION "arcnet: COM90xx chipset support\n"
-
/* Define this to speed up the autoprobe by assuming if only one io port and
* shmem are left in the list at Stage 5, they must correspond to each
* other.
*/
#undef FAST_PROBE
-
/* Internal function declarations */
static int com90xx_found(int ioaddr, int airq, u_long shmem, void __iomem *);
static void com90xx_command(struct net_device *dev, int command);
#define ACOMMAND(cmd) outb((cmd), _COMMAND)
#define AINTMASK(msk) outb((msk), _INTMASK)
-
static int com90xx_skip_probe __initdata = 0;
/* Module parameters */
numprint = -1;
for (port = &ports[0]; port < ports + numports; port++) {
int found = 0;
+
numprint++;
numprint %= 8;
if (!numprint) {
return -EIO;
}
-
static void com90xx_command(struct net_device *dev, int cmd)
{
short ioaddr = dev->base_addr;
ACOMMAND(cmd);
}
-
static int com90xx_status(struct net_device *dev)
{
short ioaddr = dev->base_addr;
return ASTATUS();
}
-
static void com90xx_setmask(struct net_device *dev, int mask)
{
short ioaddr = dev->base_addr;
AINTMASK(mask);
}
-
/*
* Do a hardware reset on the card, and set up necessary registers.
*
{
struct arcnet_local *lp = netdev_priv(dev);
void __iomem *memaddr = lp->mem_start + bufnum * 512 + offset;
+
TIME("memcpy_toio", count, memcpy_toio(memaddr, buf, count));
}
-
static void com90xx_copy_from_card(struct net_device *dev, int bufnum, int offset,
void *buf, int count)
{
struct arcnet_local *lp = netdev_priv(dev);
void __iomem *memaddr = lp->mem_start + bufnum * 512 + offset;
+
TIME("memcpy_fromio", count, memcpy_fromio(buf, memaddr, count));
}
-
MODULE_LICENSE("GPL");
static int __init com90xx_init(void)
#define VERSION "arcnet: RFC1051 \"simple standard\" (`s') encapsulation support loaded.\n"
-
static __be16 type_trans(struct sk_buff *skb, struct net_device *dev);
static void rx(struct net_device *dev, int bufnum,
struct archdr *pkthdr, int length);
static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
int bufnum);
-
static struct ArcProto rfc1051_proto =
{
.suffix = 's',
.ack_tx = NULL
};
-
static int __init arcnet_rfc1051_init(void)
{
printk(VERSION);
return htons(ETH_P_IP);
}
-
/* packet receiver */
static void rx(struct net_device *dev, int bufnum,
struct archdr *pkthdr, int length)
netif_rx(skb);
}
-
/*
* Create the ARCnet hard/soft headers for RFC1051.
*/
return 0;
}
-
/*
* Set the source hardware address.
*
return hdr_size; /* success */
}
-
static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
int bufnum)
{
MODULE_LICENSE("GPL");
#define VERSION "arcnet: RFC1201 \"standard\" (`a') encapsulation support loaded.\n"
-
static __be16 type_trans(struct sk_buff *skb, struct net_device *dev);
static void rx(struct net_device *dev, int bufnum,
struct archdr *pkthdr, int length);
.ack_tx = NULL
};
-
static int __init arcnet_rfc1201_init(void)
{
printk(VERSION);
return htons(ETH_P_IP);
}
-
/* packet receiver */
static void rx(struct net_device *dev, int bufnum,
struct archdr *pkthdr, int length)
}
}
-
/* Create the ARCnet hard/soft headers for RFC1201. */
static int build_header(struct sk_buff *skb, struct net_device *dev,
unsigned short type, uint8_t daddr)
return hdr_size;
}
-
static void load_pkt(struct net_device *dev, struct arc_hardware *hard,
struct arc_rfc1201 *soft, int softlen, int bufnum)
{
lp->lastload_dest = hard->dest;
}
-
static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
int bufnum)
{
const int maxsegsize = XMTU - RFC1201_HDR_SIZE;
struct Outgoing *out;
-
BUGMSG(D_DURING, "prepare_tx: txbufs=%d/%d/%d\n",
lp->next_tx, lp->cur_tx, bufnum);
return 1; /* done */
}
-
static int continue_tx(struct net_device *dev, int bufnum)
{
struct arcnet_local *lp = netdev_priv(dev);
*/
#define RECON_THRESHOLD 30
-
/*
* Define this to the minimum "timeout" value. If a transmit takes longer
* than TX_TIMEOUT jiffies, Linux will abort the TX and retry. On a large
*/
#define TX_TIMEOUT (HZ * 200 / 1000)
-
/* Display warnings about the driver being an ALPHA version. */
#undef ALPHA_WARNING
-
/*
* Debugging bitflags: each option can be enabled individually.
*
call; \
}
-
/*
* Time needed to reset the card - in ms (milliseconds). This works on my
* SMC PC100. I can't find a reference that tells me just how long I
#define ARC_CAN_10MBIT 2 /* card uses COM20022, supporting 10MBit,
but default is 2.5MBit. */
-
/* information needed to define an encapsulation driver */
struct ArcProto {
char suffix; /* a for RFC1201, e for ether-encap, etc. */
extern struct ArcProto *arc_proto_map[256], *arc_proto_default,
*arc_bcast_proto, *arc_raw_proto;
-
/*
* "Incoming" is information needed for each address that could be sending
* to us. Mostly for partially-received split packets.
numpackets; /* number of packets in split */
};
-
/* only needed for RFC1201 */
struct Outgoing {
struct ArcProto *proto; /* protocol driver that owns this:
numsegs; /* number of segments */
};
-
struct arcnet_local {
uint8_t config, /* current value of CONFIG register */
timeout, /* Extended timeout for COM20020 */
char *card_name; /* card ident string */
int card_flags; /* special card features */
-
/* On preemtive and SMB a lock is needed */
spinlock_t lock;
void __iomem *mem_start; /* pointer to ioremap'ed MMIO */
};
-
#define ARCRESET(x) (lp->hw.reset(dev, (x)))
#define ACOMMAND(x) (lp->hw.command(dev, (x)))
#define ASTATUS() (lp->hw.status(dev))
#define AINTMASK(x) (lp->hw.intmask(dev, (x)))
-
-
#if ARCNET_DEBUG_MAX & D_SKB
void arcnet_dump_skb(struct net_device *dev, struct sk_buff *skb, char *desc);
#else