Commit cb334648 authored by Joe Perches's avatar Joe Perches Committed by Michael Grzeschik

arcnet: Use normal kernel spacing style

Standardized spacing is easier to read.

git diff -w shows no differences.
objdiff shows no differences.
Signed-off-by: default avatarJoe Perches <joe@perches.com>
Signed-off-by: default avatarMichael Grzeschik <m.grzeschik@pengutronix.de>
parent 37587fad
...@@ -109,7 +109,7 @@ static void rx(struct net_device *dev, int bufnum, ...@@ -109,7 +109,7 @@ static void rx(struct net_device *dev, int bufnum,
skb_put(skb, length + ARC_HDR_SIZE); skb_put(skb, length + ARC_HDR_SIZE);
skb->dev = dev; skb->dev = dev;
pkt = (struct archdr *) skb->data; pkt = (struct archdr *)skb->data;
skb_reset_mac_header(skb); skb_reset_mac_header(skb);
skb_pull(skb, ARC_HDR_SIZE); skb_pull(skb, ARC_HDR_SIZE);
...@@ -136,7 +136,7 @@ static int build_header(struct sk_buff *skb, struct net_device *dev, ...@@ -136,7 +136,7 @@ static int build_header(struct sk_buff *skb, struct net_device *dev,
unsigned short type, uint8_t daddr) unsigned short type, uint8_t daddr)
{ {
int hdr_size = ARC_HDR_SIZE; int hdr_size = ARC_HDR_SIZE;
struct archdr *pkt = (struct archdr *) skb_push(skb, hdr_size); struct archdr *pkt = (struct archdr *)skb_push(skb, hdr_size);
/* /*
* Set the source hardware address. * Set the source hardware address.
...@@ -192,7 +192,7 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, ...@@ -192,7 +192,7 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
hard->offset[0] = ofs = 256 - length; hard->offset[0] = ofs = 256 - length;
BUGMSG(D_DURING, "prepare_tx: length=%d ofs=%d\n", BUGMSG(D_DURING, "prepare_tx: length=%d ofs=%d\n",
length,ofs); length, ofs);
lp->hw.copy_to_card(dev, bufnum, 0, hard, ARC_HDR_SIZE); lp->hw.copy_to_card(dev, bufnum, 0, hard, ARC_HDR_SIZE);
lp->hw.copy_to_card(dev, bufnum, ofs, &pkt->soft, length); lp->hw.copy_to_card(dev, bufnum, ofs, &pkt->soft, length);
......
...@@ -57,26 +57,26 @@ static void arcrimi_copy_from_card(struct net_device *dev, int bufnum, int offse ...@@ -57,26 +57,26 @@ static void arcrimi_copy_from_card(struct net_device *dev, int bufnum, int offse
/* Amount of I/O memory used by the card */ /* Amount of I/O memory used by the card */
#define BUFFER_SIZE (512) #define BUFFER_SIZE (512)
#define MIRROR_SIZE (BUFFER_SIZE*4) #define MIRROR_SIZE (BUFFER_SIZE * 4)
/* COM 9026 controller chip --> ARCnet register addresses */ /* COM 9026 controller chip --> ARCnet register addresses */
#define _INTMASK (ioaddr+0) /* writable */ #define _INTMASK (ioaddr + 0) /* writable */
#define _STATUS (ioaddr+0) /* readable */ #define _STATUS (ioaddr + 0) /* readable */
#define _COMMAND (ioaddr+1) /* writable, returns random vals on read (?) */ #define _COMMAND (ioaddr + 1) /* writable, returns random vals on read (?) */
#define _RESET (ioaddr+8) /* software reset (on read) */ #define _RESET (ioaddr + 8) /* software reset (on read) */
#define _MEMDATA (ioaddr+12) /* Data port for IO-mapped memory */ #define _MEMDATA (ioaddr + 12) /* Data port for IO-mapped memory */
#define _ADDR_HI (ioaddr+15) /* Control registers for said */ #define _ADDR_HI (ioaddr + 15) /* Control registers for said */
#define _ADDR_LO (ioaddr+14) #define _ADDR_LO (ioaddr + 14)
#define _CONFIG (ioaddr+2) /* Configuration register */ #define _CONFIG (ioaddr + 2) /* Configuration register */
#undef ASTATUS #undef ASTATUS
#undef ACOMMAND #undef ACOMMAND
#undef AINTMASK #undef AINTMASK
#define ASTATUS() readb(_STATUS) #define ASTATUS() readb(_STATUS)
#define ACOMMAND(cmd) writeb((cmd),_COMMAND) #define ACOMMAND(cmd) writeb((cmd), _COMMAND)
#define AINTMASK(msk) writeb((msk),_INTMASK) #define AINTMASK(msk) writeb((msk), _INTMASK)
#define SETCONF() writeb(lp->config,_CONFIG) #define SETCONF() writeb(lp->config, _CONFIG)
/* /*
......
This diff is collapsed.
...@@ -71,12 +71,12 @@ static void rx(struct net_device *dev, int bufnum, ...@@ -71,12 +71,12 @@ static void rx(struct net_device *dev, int bufnum,
/* use these variables to be sure we count in bytes, not in /* use these variables to be sure we count in bytes, not in
sizeof(struct archdr) */ sizeof(struct archdr) */
pktbuf=(char*)pkt; pktbuf = (char *)pkt;
pkthdrbuf=(char*)pkthdr; pkthdrbuf = (char *)pkthdr;
memcpy(pktbuf, pkthdrbuf, ARC_HDR_SIZE+sizeof(pkt->soft.cap.proto)); memcpy(pktbuf, pkthdrbuf, ARC_HDR_SIZE + sizeof(pkt->soft.cap.proto));
memcpy(pktbuf+ARC_HDR_SIZE+sizeof(pkt->soft.cap.proto)+sizeof(int), memcpy(pktbuf + ARC_HDR_SIZE + sizeof(pkt->soft.cap.proto) + sizeof(int),
pkthdrbuf+ARC_HDR_SIZE+sizeof(pkt->soft.cap.proto), pkthdrbuf + ARC_HDR_SIZE + sizeof(pkt->soft.cap.proto),
sizeof(struct archdr)-ARC_HDR_SIZE-sizeof(pkt->soft.cap.proto)); sizeof(struct archdr) - ARC_HDR_SIZE - sizeof(pkt->soft.cap.proto));
if (length > sizeof(pkt->soft)) if (length > sizeof(pkt->soft))
lp->hw.copy_from_card(dev, bufnum, ofs + sizeof(pkt->soft), lp->hw.copy_from_card(dev, bufnum, ofs + sizeof(pkt->soft),
...@@ -101,10 +101,10 @@ static int build_header(struct sk_buff *skb, ...@@ -101,10 +101,10 @@ static int build_header(struct sk_buff *skb,
uint8_t daddr) uint8_t daddr)
{ {
int hdr_size = ARC_HDR_SIZE; int hdr_size = ARC_HDR_SIZE;
struct archdr *pkt = (struct archdr *) skb_push(skb, hdr_size); struct archdr *pkt = (struct archdr *)skb_push(skb, hdr_size);
BUGMSG(D_PROTO, "Preparing header for cap packet %x.\n", BUGMSG(D_PROTO, "Preparing header for cap packet %x.\n",
*((int*)&pkt->soft.cap.cookie[0])); *((int *)&pkt->soft.cap.cookie[0]));
/* /*
* Set the source hardware address. * Set the source hardware address.
* *
...@@ -148,7 +148,7 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, ...@@ -148,7 +148,7 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
lp->next_tx, lp->cur_tx, bufnum); lp->next_tx, lp->cur_tx, bufnum);
BUGMSG(D_PROTO, "Sending for cap packet %x.\n", BUGMSG(D_PROTO, "Sending for cap packet %x.\n",
*((int*)&pkt->soft.cap.cookie[0])); *((int *)&pkt->soft.cap.cookie[0]));
if (length > XMTU) { if (length > XMTU) {
/* should never happen! other people already check for this. */ /* should never happen! other people already check for this. */
...@@ -166,7 +166,7 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, ...@@ -166,7 +166,7 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
hard->offset[0] = ofs = 256 - length; hard->offset[0] = ofs = 256 - length;
BUGMSG(D_DURING, "prepare_tx: length=%d ofs=%d\n", BUGMSG(D_DURING, "prepare_tx: length=%d ofs=%d\n",
length,ofs); length, ofs);
/* Copy the arcnet-header + the protocol byte down: */ /* Copy the arcnet-header + the protocol byte down: */
lp->hw.copy_to_card(dev, bufnum, 0, hard, ARC_HDR_SIZE); lp->hw.copy_to_card(dev, bufnum, 0, hard, ARC_HDR_SIZE);
...@@ -175,8 +175,8 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length, ...@@ -175,8 +175,8 @@ static int prepare_tx(struct net_device *dev, struct archdr *pkt, int length,
/* Skip the extra integer we have written into it as a cookie /* Skip the extra integer we have written into it as a cookie
but write the rest of the message: */ but write the rest of the message: */
lp->hw.copy_to_card(dev, bufnum, ofs+1, lp->hw.copy_to_card(dev, bufnum, ofs + 1,
((unsigned char*)&pkt->soft.cap.mes),length-1); ((unsigned char *)&pkt->soft.cap.mes), length - 1);
lp->lastload_dest = hard->dest; lp->lastload_dest = hard->dest;
...@@ -188,7 +188,7 @@ static int ack_tx(struct net_device *dev, int acked) ...@@ -188,7 +188,7 @@ static int ack_tx(struct net_device *dev, int acked)
struct arcnet_local *lp = netdev_priv(dev); struct arcnet_local *lp = netdev_priv(dev);
struct sk_buff *ackskb; struct sk_buff *ackskb;
struct archdr *ackpkt; struct archdr *ackpkt;
int length=sizeof(struct arc_cap); int length = sizeof(struct arc_cap);
BUGMSG(D_DURING, "capmode: ack_tx: protocol: %x: result: %d\n", BUGMSG(D_DURING, "capmode: ack_tx: protocol: %x: result: %d\n",
lp->outgoing.skb->protocol, acked); lp->outgoing.skb->protocol, acked);
...@@ -196,13 +196,13 @@ static int ack_tx(struct net_device *dev, int acked) ...@@ -196,13 +196,13 @@ static int ack_tx(struct net_device *dev, int acked)
BUGLVL(D_SKB) arcnet_dump_skb(dev, lp->outgoing.skb, "ack_tx"); BUGLVL(D_SKB) arcnet_dump_skb(dev, lp->outgoing.skb, "ack_tx");
/* Now alloc a skb to send back up through the layers: */ /* Now alloc a skb to send back up through the layers: */
ackskb = alloc_skb(length + ARC_HDR_SIZE , GFP_ATOMIC); ackskb = alloc_skb(length + ARC_HDR_SIZE, GFP_ATOMIC);
if (ackskb == NULL) { if (ackskb == NULL) {
BUGMSG(D_NORMAL, "Memory squeeze, can't acknowledge.\n"); BUGMSG(D_NORMAL, "Memory squeeze, can't acknowledge.\n");
goto free_outskb; goto free_outskb;
} }
skb_put(ackskb, length + ARC_HDR_SIZE ); skb_put(ackskb, length + ARC_HDR_SIZE);
ackskb->dev = dev; ackskb->dev = dev;
skb_reset_mac_header(ackskb); skb_reset_mac_header(ackskb);
...@@ -212,10 +212,10 @@ static int ack_tx(struct net_device *dev, int acked) ...@@ -212,10 +212,10 @@ static int ack_tx(struct net_device *dev, int acked)
skb_copy_from_linear_data(lp->outgoing.skb, ackpkt, skb_copy_from_linear_data(lp->outgoing.skb, ackpkt,
ARC_HDR_SIZE + sizeof(struct arc_cap)); ARC_HDR_SIZE + sizeof(struct arc_cap));
ackpkt->soft.cap.proto = 0; /* using protocol 0 for acknowledge */ ackpkt->soft.cap.proto = 0; /* using protocol 0 for acknowledge */
ackpkt->soft.cap.mes.ack=acked; ackpkt->soft.cap.mes.ack = acked;
BUGMSG(D_PROTO, "Ackknowledge for cap packet %x.\n", BUGMSG(D_PROTO, "Ackknowledge for cap packet %x.\n",
*((int*)&ackpkt->soft.cap.cookie[0])); *((int *)&ackpkt->soft.cap.cookie[0]));
ackskb->protocol = cpu_to_be16(ETH_P_ARCNET); ackskb->protocol = cpu_to_be16(ETH_P_ARCNET);
......
...@@ -117,7 +117,7 @@ int com20020_check(struct net_device *dev) ...@@ -117,7 +117,7 @@ int com20020_check(struct net_device *dev)
lp->config = 0x21 | (lp->timeout << 3) | (lp->backplane << 2); lp->config = 0x21 | (lp->timeout << 3) | (lp->backplane << 2);
/* set node ID to 0x42 (but transmitter is disabled, so it's okay) */ /* set node ID to 0x42 (but transmitter is disabled, so it's okay) */
SETCONF; SETCONF;
outb(0x42, ioaddr + BUS_ALIGN*7); outb(0x42, ioaddr + BUS_ALIGN * 7);
status = ASTATUS(); status = ASTATUS();
...@@ -129,7 +129,7 @@ int com20020_check(struct net_device *dev) ...@@ -129,7 +129,7 @@ int com20020_check(struct net_device *dev)
/* Enable TX */ /* Enable TX */
outb(0x39, _CONFIG); outb(0x39, _CONFIG);
outb(inb(ioaddr + BUS_ALIGN*8), ioaddr + BUS_ALIGN*7); outb(inb(ioaddr + BUS_ALIGN * 8), ioaddr + BUS_ALIGN * 7);
ACOMMAND(CFLAGScmd | RESETclear | CONFIGclear); ACOMMAND(CFLAGScmd | RESETclear | CONFIGclear);
...@@ -193,7 +193,7 @@ int com20020_found(struct net_device *dev, int shared) ...@@ -193,7 +193,7 @@ int com20020_found(struct net_device *dev, int shared)
lp->hw.close = com20020_close; lp->hw.close = com20020_close;
if (!dev->dev_addr[0]) if (!dev->dev_addr[0])
dev->dev_addr[0] = inb(ioaddr + BUS_ALIGN*8); /* FIXME: do this some other way! */ dev->dev_addr[0] = inb(ioaddr + BUS_ALIGN * 8); /* FIXME: do this some other way! */
SET_SUBADR(SUB_SETUP1); SET_SUBADR(SUB_SETUP1);
outb(lp->setup, _XREG); outb(lp->setup, _XREG);
...@@ -258,15 +258,15 @@ static int com20020_reset(struct net_device *dev, int really_reset) ...@@ -258,15 +258,15 @@ static int com20020_reset(struct net_device *dev, int really_reset)
u_char inbyte; u_char inbyte;
BUGMSG(D_DEBUG, "%s: %d: %s: dev: %p, lp: %p, dev->name: %s\n", BUGMSG(D_DEBUG, "%s: %d: %s: dev: %p, lp: %p, dev->name: %s\n",
__FILE__,__LINE__,__func__,dev,lp,dev->name); __FILE__, __LINE__, __func__, dev, lp, dev->name);
BUGMSG(D_INIT, "Resetting %s (status=%02Xh)\n", BUGMSG(D_INIT, "Resetting %s (status=%02Xh)\n",
dev->name, ASTATUS()); dev->name, ASTATUS());
BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__func__); BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
lp->config = TXENcfg | (lp->timeout << 3) | (lp->backplane << 2); lp->config = TXENcfg | (lp->timeout << 3) | (lp->backplane << 2);
/* power-up defaults */ /* power-up defaults */
SETCONF; SETCONF;
BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__func__); BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
if (really_reset) { if (really_reset) {
/* reset the card */ /* reset the card */
...@@ -274,22 +274,22 @@ static int com20020_reset(struct net_device *dev, int really_reset) ...@@ -274,22 +274,22 @@ static int com20020_reset(struct net_device *dev, int really_reset)
mdelay(RESETtime * 2); /* COM20020 seems to be slower sometimes */ mdelay(RESETtime * 2); /* COM20020 seems to be slower sometimes */
} }
/* clear flags & end reset */ /* clear flags & end reset */
BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__func__); BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
ACOMMAND(CFLAGScmd | RESETclear | CONFIGclear); ACOMMAND(CFLAGScmd | RESETclear | CONFIGclear);
/* verify that the ARCnet signature byte is present */ /* verify that the ARCnet signature byte is present */
BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__func__); BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
com20020_copy_from_card(dev, 0, 0, &inbyte, 1); com20020_copy_from_card(dev, 0, 0, &inbyte, 1);
BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__func__); BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
if (inbyte != TESTvalue) { if (inbyte != TESTvalue) {
BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__func__); BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
BUGMSG(D_NORMAL, "reset failed: TESTvalue not present.\n"); BUGMSG(D_NORMAL, "reset failed: TESTvalue not present.\n");
return 1; return 1;
} }
/* enable extended (512-byte) packets */ /* enable extended (512-byte) packets */
ACOMMAND(CONFIGcmd | EXTconf); ACOMMAND(CONFIGcmd | EXTconf);
BUGMSG(D_DEBUG, "%s: %d: %s\n",__FILE__,__LINE__,__func__); BUGMSG(D_DEBUG, "%s: %d: %s\n", __FILE__, __LINE__, __func__);
/* done! return success. */ /* done! return success. */
return 0; return 0;
...@@ -299,7 +299,7 @@ static int com20020_reset(struct net_device *dev, int really_reset) ...@@ -299,7 +299,7 @@ static int com20020_reset(struct net_device *dev, int really_reset)
static void com20020_setmask(struct net_device *dev, int mask) static void com20020_setmask(struct net_device *dev, int mask)
{ {
u_int ioaddr = dev->base_addr; u_int ioaddr = dev->base_addr;
BUGMSG(D_DURING, "Setting mask to %x at %x\n",mask,ioaddr); BUGMSG(D_DURING, "Setting mask to %x at %x\n", mask, ioaddr);
AINTMASK(mask); AINTMASK(mask);
} }
...@@ -315,7 +315,7 @@ static int com20020_status(struct net_device *dev) ...@@ -315,7 +315,7 @@ static int com20020_status(struct net_device *dev)
{ {
u_int ioaddr = dev->base_addr; u_int ioaddr = dev->base_addr;
return ASTATUS() + (ADIAGSTATUS()<<8); return ASTATUS() + (ADIAGSTATUS() << 8);
} }
static void com20020_close(struct net_device *dev) static void com20020_close(struct net_device *dev)
......
...@@ -71,7 +71,7 @@ static void regdump(struct net_device *dev) ...@@ -71,7 +71,7 @@ static void regdump(struct net_device *dev)
outb((count >> 8) | RDDATAflag | AUTOINCflag, _ADDR_HI); outb((count >> 8) | RDDATAflag | AUTOINCflag, _ADDR_HI);
outb(count & 0xff, _ADDR_LO); outb(count & 0xff, _ADDR_LO);
for (count = 0; count < 256+32; count++) for (count = 0; count < 256 + 32; count++)
{ {
if (!(count % 16)) if (!(count % 16))
pr_cont("%04X:", count); pr_cont("%04X:", count);
...@@ -208,7 +208,7 @@ static int com20020_config(struct pcmcia_device *link) ...@@ -208,7 +208,7 @@ static int com20020_config(struct pcmcia_device *link)
dev_dbg(&link->dev, "com20020_config\n"); dev_dbg(&link->dev, "com20020_config\n");
dev_dbg(&link->dev, "baseport1 is %Xh\n", dev_dbg(&link->dev, "baseport1 is %Xh\n",
(unsigned int) link->resource[0]->start); (unsigned int)link->resource[0]->start);
i = -ENODEV; i = -ENODEV;
link->io_lines = 16; link->io_lines = 16;
......
...@@ -60,23 +60,23 @@ static void com90io_copy_from_card(struct net_device *dev, int bufnum, int offse ...@@ -60,23 +60,23 @@ static void com90io_copy_from_card(struct net_device *dev, int bufnum, int offse
#define ARCNET_TOTAL_SIZE 16 #define ARCNET_TOTAL_SIZE 16
/* COM 9026 controller chip --> ARCnet register addresses */ /* COM 9026 controller chip --> ARCnet register addresses */
#define _INTMASK (ioaddr+0) /* writable */ #define _INTMASK (ioaddr + 0) /* writable */
#define _STATUS (ioaddr+0) /* readable */ #define _STATUS (ioaddr + 0) /* readable */
#define _COMMAND (ioaddr+1) /* writable, returns random vals on read (?) */ #define _COMMAND (ioaddr + 1) /* writable, returns random vals on read (?) */
#define _RESET (ioaddr+8) /* software reset (on read) */ #define _RESET (ioaddr + 8) /* software reset (on read) */
#define _MEMDATA (ioaddr+12) /* Data port for IO-mapped memory */ #define _MEMDATA (ioaddr + 12) /* Data port for IO-mapped memory */
#define _ADDR_HI (ioaddr+15) /* Control registers for said */ #define _ADDR_HI (ioaddr + 15) /* Control registers for said */
#define _ADDR_LO (ioaddr+14) #define _ADDR_LO (ioaddr + 14)
#define _CONFIG (ioaddr+2) /* Configuration register */ #define _CONFIG (ioaddr + 2) /* Configuration register */
#undef ASTATUS #undef ASTATUS
#undef ACOMMAND #undef ACOMMAND
#undef AINTMASK #undef AINTMASK
#define ASTATUS() inb(_STATUS) #define ASTATUS() inb(_STATUS)
#define ACOMMAND(cmd) outb((cmd),_COMMAND) #define ACOMMAND(cmd) outb((cmd), _COMMAND)
#define AINTMASK(msk) outb((msk),_INTMASK) #define AINTMASK(msk) outb((msk), _INTMASK)
#define SETCONF() outb((lp->config),_CONFIG) #define SETCONF() outb((lp->config), _CONFIG)
/**************************************************************************** /****************************************************************************
......
...@@ -77,25 +77,25 @@ static int numcards; ...@@ -77,25 +77,25 @@ static int numcards;
/* Amount of I/O memory used by the card */ /* Amount of I/O memory used by the card */
#define BUFFER_SIZE (512) #define BUFFER_SIZE (512)
#define MIRROR_SIZE (BUFFER_SIZE*4) #define MIRROR_SIZE (BUFFER_SIZE * 4)
/* COM 9026 controller chip --> ARCnet register addresses */ /* COM 9026 controller chip --> ARCnet register addresses */
#define _INTMASK (ioaddr+0) /* writable */ #define _INTMASK (ioaddr + 0) /* writable */
#define _STATUS (ioaddr+0) /* readable */ #define _STATUS (ioaddr + 0) /* readable */
#define _COMMAND (ioaddr+1) /* writable, returns random vals on read (?) */ #define _COMMAND (ioaddr + 1) /* writable, returns random vals on read (?) */
#define _CONFIG (ioaddr+2) /* Configuration register */ #define _CONFIG (ioaddr + 2) /* Configuration register */
#define _RESET (ioaddr+8) /* software reset (on read) */ #define _RESET (ioaddr + 8) /* software reset (on read) */
#define _MEMDATA (ioaddr+12) /* Data port for IO-mapped memory */ #define _MEMDATA (ioaddr + 12) /* Data port for IO-mapped memory */
#define _ADDR_HI (ioaddr+15) /* Control registers for said */ #define _ADDR_HI (ioaddr + 15) /* Control registers for said */
#define _ADDR_LO (ioaddr+14) #define _ADDR_LO (ioaddr + 14)
#undef ASTATUS #undef ASTATUS
#undef ACOMMAND #undef ACOMMAND
#undef AINTMASK #undef AINTMASK
#define ASTATUS() inb(_STATUS) #define ASTATUS() inb(_STATUS)
#define ACOMMAND(cmd) outb((cmd),_COMMAND) #define ACOMMAND(cmd) outb((cmd), _COMMAND)
#define AINTMASK(msk) outb((msk),_INTMASK) #define AINTMASK(msk) outb((msk), _INTMASK)
static int com90xx_skip_probe __initdata = 0; static int com90xx_skip_probe __initdata = 0;
...@@ -127,11 +127,11 @@ static void __init com90xx_probe(void) ...@@ -127,11 +127,11 @@ static void __init com90xx_probe(void)
if (!io && !irq && !shmem && !*device && com90xx_skip_probe) if (!io && !irq && !shmem && !*device && com90xx_skip_probe)
return; return;
shmems = kzalloc(((0x100000-0xa0000) / 0x800) * sizeof(unsigned long), shmems = kzalloc(((0x100000 - 0xa0000) / 0x800) * sizeof(unsigned long),
GFP_KERNEL); GFP_KERNEL);
if (!shmems) if (!shmems)
return; return;
iomem = kzalloc(((0x100000-0xa0000) / 0x800) * sizeof(void __iomem *), iomem = kzalloc(((0x100000 - 0xa0000) / 0x800) * sizeof(void __iomem *),
GFP_KERNEL); GFP_KERNEL);
if (!iomem) { if (!iomem) {
kfree(shmems); kfree(shmems);
......
...@@ -89,7 +89,7 @@ MODULE_LICENSE("GPL"); ...@@ -89,7 +89,7 @@ MODULE_LICENSE("GPL");
*/ */
static __be16 type_trans(struct sk_buff *skb, struct net_device *dev) static __be16 type_trans(struct sk_buff *skb, struct net_device *dev)
{ {
struct archdr *pkt = (struct archdr *) skb->data; struct archdr *pkt = (struct archdr *)skb->data;
struct arc_rfc1051 *soft = &pkt->soft.rfc1051; struct arc_rfc1051 *soft = &pkt->soft.rfc1051;
int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE; int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE;
...@@ -146,7 +146,7 @@ static void rx(struct net_device *dev, int bufnum, ...@@ -146,7 +146,7 @@ static void rx(struct net_device *dev, int bufnum,
skb_put(skb, length + ARC_HDR_SIZE); skb_put(skb, length + ARC_HDR_SIZE);
skb->dev = dev; skb->dev = dev;
pkt = (struct archdr *) skb->data; pkt = (struct archdr *)skb->data;
/* up to sizeof(pkt->soft) has already been copied from the card */ /* up to sizeof(pkt->soft) has already been copied from the card */
memcpy(pkt, pkthdr, sizeof(struct archdr)); memcpy(pkt, pkthdr, sizeof(struct archdr));
...@@ -169,7 +169,7 @@ static int build_header(struct sk_buff *skb, struct net_device *dev, ...@@ -169,7 +169,7 @@ static int build_header(struct sk_buff *skb, struct net_device *dev,
unsigned short type, uint8_t daddr) unsigned short type, uint8_t daddr)
{ {
int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE; int hdr_size = ARC_HDR_SIZE + RFC1051_HDR_SIZE;
struct archdr *pkt = (struct archdr *) skb_push(skb, hdr_size); struct archdr *pkt = (struct archdr *)skb_push(skb, hdr_size);
struct arc_rfc1051 *soft = &pkt->soft.rfc1051; struct arc_rfc1051 *soft = &pkt->soft.rfc1051;
/* set the protocol ID according to RFC1051 */ /* set the protocol ID according to RFC1051 */
......
...@@ -91,7 +91,7 @@ module_exit(arcnet_rfc1201_exit); ...@@ -91,7 +91,7 @@ module_exit(arcnet_rfc1201_exit);
*/ */
static __be16 type_trans(struct sk_buff *skb, struct net_device *dev) static __be16 type_trans(struct sk_buff *skb, struct net_device *dev)
{ {
struct archdr *pkt = (struct archdr *) skb->data; struct archdr *pkt = (struct archdr *)skb->data;
struct arc_rfc1201 *soft = &pkt->soft.rfc1201; struct arc_rfc1201 *soft = &pkt->soft.rfc1201;
int hdr_size = ARC_HDR_SIZE + RFC1201_HDR_SIZE; int hdr_size = ARC_HDR_SIZE + RFC1201_HDR_SIZE;
...@@ -187,7 +187,7 @@ static void rx(struct net_device *dev, int bufnum, ...@@ -187,7 +187,7 @@ static void rx(struct net_device *dev, int bufnum,
skb_put(skb, length + ARC_HDR_SIZE); skb_put(skb, length + ARC_HDR_SIZE);
skb->dev = dev; skb->dev = dev;
pkt = (struct archdr *) skb->data; pkt = (struct archdr *)skb->data;
soft = &pkt->soft.rfc1201; soft = &pkt->soft.rfc1201;
/* up to sizeof(pkt->soft) has already been copied from the card */ /* up to sizeof(pkt->soft) has already been copied from the card */
...@@ -203,11 +203,11 @@ static void rx(struct net_device *dev, int bufnum, ...@@ -203,11 +203,11 @@ static void rx(struct net_device *dev, int bufnum,
* (which is impossible to fumble) and insert it ourselves. * (which is impossible to fumble) and insert it ourselves.
*/ */
if (soft->proto == ARC_P_ARP) { if (soft->proto == ARC_P_ARP) {
struct arphdr *arp = (struct arphdr *) soft->payload; struct arphdr *arp = (struct arphdr *)soft->payload;
/* make sure addresses are the right length */ /* make sure addresses are the right length */
if (arp->ar_hln == 1 && arp->ar_pln == 4) { if (arp->ar_hln == 1 && arp->ar_pln == 4) {
uint8_t *cptr = (uint8_t *) arp + sizeof(struct arphdr); uint8_t *cptr = (uint8_t *)arp + sizeof(struct arphdr);
if (!*cptr) { /* is saddr = 00? */ if (!*cptr) { /* is saddr = 00? */
BUGMSG(D_EXTRA, BUGMSG(D_EXTRA,
...@@ -274,7 +274,7 @@ static void rx(struct net_device *dev, int bufnum, ...@@ -274,7 +274,7 @@ static void rx(struct net_device *dev, int bufnum,
dev_kfree_skb_irq(in->skb); dev_kfree_skb_irq(in->skb);
} }
in->sequence = soft->sequence; in->sequence = soft->sequence;
in->numpackets = ((unsigned) soft->split_flag >> 1) + 2; in->numpackets = ((unsigned)soft->split_flag >> 1) + 2;
in->lastpacket = 1; in->lastpacket = 1;
if (in->numpackets > 16) { if (in->numpackets > 16) {
...@@ -294,7 +294,7 @@ static void rx(struct net_device *dev, int bufnum, ...@@ -294,7 +294,7 @@ static void rx(struct net_device *dev, int bufnum,
return; return;
} }
skb->dev = dev; skb->dev = dev;
pkt = (struct archdr *) skb->data; pkt = (struct archdr *)skb->data;
soft = &pkt->soft.rfc1201; soft = &pkt->soft.rfc1201;
memcpy(pkt, pkthdr, ARC_HDR_SIZE + RFC1201_HDR_SIZE); memcpy(pkt, pkthdr, ARC_HDR_SIZE + RFC1201_HDR_SIZE);
...@@ -302,7 +302,7 @@ static void rx(struct net_device *dev, int bufnum, ...@@ -302,7 +302,7 @@ static void rx(struct net_device *dev, int bufnum,
soft->split_flag = 0; /* end result won't be split */ soft->split_flag = 0; /* end result won't be split */
} else { /* not first packet */ } else { /* not first packet */
int packetnum = ((unsigned) soft->split_flag >> 1) + 1; int packetnum = ((unsigned)soft->split_flag >> 1) + 1;
/* /*
* if we're not assembling, there's no point trying to * if we're not assembling, there's no point trying to
...@@ -341,7 +341,7 @@ static void rx(struct net_device *dev, int bufnum, ...@@ -341,7 +341,7 @@ static void rx(struct net_device *dev, int bufnum,
in->lastpacket = in->numpackets = 0; in->lastpacket = in->numpackets = 0;
return; return;
} }
pkt = (struct archdr *) in->skb->data; pkt = (struct archdr *)in->skb->data;
soft = &pkt->soft.rfc1201; soft = &pkt->soft.rfc1201;
} }
...@@ -376,7 +376,7 @@ static int build_header(struct sk_buff *skb, struct net_device *dev, ...@@ -376,7 +376,7 @@ static int build_header(struct sk_buff *skb, struct net_device *dev,
{ {
struct arcnet_local *lp = netdev_priv(dev); struct arcnet_local *lp = netdev_priv(dev);
int hdr_size = ARC_HDR_SIZE + RFC1201_HDR_SIZE; int hdr_size = ARC_HDR_SIZE + RFC1201_HDR_SIZE;
struct archdr *pkt = (struct archdr *) skb_push(skb, hdr_size); struct archdr *pkt = (struct archdr *)skb_push(skb, hdr_size);
struct arc_rfc1201 *soft = &pkt->soft.rfc1201; struct arc_rfc1201 *soft = &pkt->soft.rfc1201;
/* set the protocol ID according to RFC1201 */ /* set the protocol ID according to RFC1201 */
......
...@@ -77,18 +77,18 @@ ...@@ -77,18 +77,18 @@
#endif #endif
#ifndef ARCNET_DEBUG #ifndef ARCNET_DEBUG
#define ARCNET_DEBUG (D_NORMAL|D_EXTRA) #define ARCNET_DEBUG (D_NORMAL | D_EXTRA)
#endif #endif
extern int arcnet_debug; extern int arcnet_debug;
/* macros to simplify debug checking */ /* macros to simplify debug checking */
#define BUGLVL(x) if ((ARCNET_DEBUG_MAX)&arcnet_debug&(x)) #define BUGLVL(x) if ((ARCNET_DEBUG_MAX) & arcnet_debug & (x))
#define BUGMSG2(x,msg,args...) do { BUGLVL(x) printk(msg, ## args); } while (0) #define BUGMSG2(x, msg, args...) do { BUGLVL(x) printk(msg, ## args); } while (0)
#define BUGMSG(x,msg,args...) \ #define BUGMSG(x, msg, args...) \
BUGMSG2(x, "%s%6s: " msg, \ BUGMSG2(x, "%s%6s: " msg, \
x==D_NORMAL ? KERN_WARNING \ x == D_NORMAL ? KERN_WARNING \
: x < D_DURING ? KERN_INFO : KERN_DEBUG, \ : x < D_DURING ? KERN_INFO : KERN_DEBUG, \
dev->name , ## args) dev->name, ## args)
/* see how long a function call takes to run, expressed in CPU cycles */ /* see how long a function call takes to run, expressed in CPU cycles */
#define TIME(name, bytes, call) BUGLVL(D_TIMING) { \ #define TIME(name, bytes, call) BUGLVL(D_TIMING) { \
...@@ -98,12 +98,12 @@ extern int arcnet_debug; ...@@ -98,12 +98,12 @@ extern int arcnet_debug;
_y = get_cycles(); \ _y = get_cycles(); \
BUGMSG(D_TIMING, \ BUGMSG(D_TIMING, \
"%s: %d bytes in %lu cycles == " \ "%s: %d bytes in %lu cycles == " \
"%lu Kbytes/100Mcycle\n",\ "%lu Kbytes/100Mcycle\n", \
name, bytes, _y - _x, \ name, bytes, _y - _x, \
100000000 / 1024 * bytes / (_y - _x + 1));\ 100000000 / 1024 * bytes / (_y - _x + 1)); \
} \ } \
else { \ else { \
call;\ call; \
} }
...@@ -189,16 +189,16 @@ struct ArcProto { ...@@ -189,16 +189,16 @@ struct ArcProto {
int mtu; /* largest possible packet */ int mtu; /* largest possible packet */
int is_ip; /* This is a ip plugin - not a raw thing */ int is_ip; /* This is a ip plugin - not a raw thing */
void (*rx) (struct net_device * dev, int bufnum, void (*rx)(struct net_device *dev, int bufnum,
struct archdr * pkthdr, int length); struct archdr *pkthdr, int length);
int (*build_header) (struct sk_buff * skb, struct net_device *dev, int (*build_header)(struct sk_buff *skb, struct net_device *dev,
unsigned short ethproto, uint8_t daddr); unsigned short ethproto, uint8_t daddr);
/* these functions return '1' if the skb can now be freed */ /* these functions return '1' if the skb can now be freed */
int (*prepare_tx) (struct net_device * dev, struct archdr * pkt, int length, int (*prepare_tx)(struct net_device *dev, struct archdr *pkt, int length,
int bufnum); int bufnum);
int (*continue_tx) (struct net_device * dev, int bufnum); int (*continue_tx)(struct net_device *dev, int bufnum);
int (*ack_tx) (struct net_device * dev, int acked); int (*ack_tx)(struct net_device *dev, int acked);
}; };
extern struct ArcProto *arc_proto_map[256], *arc_proto_default, extern struct ArcProto *arc_proto_map[256], *arc_proto_default,
...@@ -298,16 +298,16 @@ struct arcnet_local { ...@@ -298,16 +298,16 @@ struct arcnet_local {
/* hardware-specific functions */ /* hardware-specific functions */
struct { struct {
struct module *owner; struct module *owner;
void (*command) (struct net_device * dev, int cmd); void (*command)(struct net_device *dev, int cmd);
int (*status) (struct net_device * dev); int (*status)(struct net_device *dev);
void (*intmask) (struct net_device * dev, int mask); void (*intmask)(struct net_device *dev, int mask);
int (*reset) (struct net_device * dev, int really_reset); int (*reset)(struct net_device *dev, int really_reset);
void (*open) (struct net_device * dev); void (*open)(struct net_device *dev);
void (*close) (struct net_device * dev); void (*close)(struct net_device *dev);
void (*copy_to_card) (struct net_device * dev, int bufnum, int offset, void (*copy_to_card)(struct net_device *dev, int bufnum, int offset,
void *buf, int count); void *buf, int count);
void (*copy_from_card) (struct net_device * dev, int bufnum, int offset, void (*copy_from_card)(struct net_device *dev, int bufnum, int offset,
void *buf, int count); void *buf, int count);
} hw; } hw;
...@@ -325,7 +325,7 @@ struct arcnet_local { ...@@ -325,7 +325,7 @@ struct arcnet_local {
#if ARCNET_DEBUG_MAX & D_SKB #if ARCNET_DEBUG_MAX & D_SKB
void arcnet_dump_skb(struct net_device *dev, struct sk_buff *skb, char *desc); void arcnet_dump_skb(struct net_device *dev, struct sk_buff *skb, char *desc);
#else #else
#define arcnet_dump_skb(dev,skb,desc) ; #define arcnet_dump_skb(dev, skb, desc) ;
#endif #endif
void arcnet_unregister_proto(struct ArcProto *proto); void arcnet_unregister_proto(struct ArcProto *proto);
......
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