From: Jan-Benedict G. <jb...@us...> - 2005-04-25 09:37:22
|
Update of /cvsroot/linux-vax/kernel-2.5/drivers/vax/net In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10024/net Modified Files: delqa.c lance.c sgec.c Log Message: - Some more __iomem and whitespace updates. Index: sgec.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/drivers/vax/net/sgec.c,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- sgec.c 28 Oct 2004 19:23:42 -0000 1.4 +++ sgec.c 25 Apr 2005 09:37:12 -0000 1.5 @@ -1,7 +1,7 @@ -/* +/* * SGEC ethernet driver. Reported as EZA0 etc by VAX Console. * - * SGEC stands for Second Generation Ethernet Card, and is the + * SGEC stands for Second Generation Ethernet Card, and is the * replacement for the LANCE adapters in the MicroVaxen. * * Loosely adapted from vaxlance.c by Dave Airlie @@ -201,7 +201,7 @@ #define SG_TD1_VA 0x4000 /* virtual address */ #define SG_TD1_DT 0x3000 /* data type: */ #define SG_TD1_DT_NORM 0x0000 /* normal transmit frame */ -#define SG_TD1_DT_SETUP 0x2000 /* setup frame */ +#define SG_TD1_DT_SETUP 0x2000 /* setup frame */ #define SG_TD1_DT_DIAG 0x3000 /* diagnostic frame */ #define SG_TD1_AC 0x0800 /* CRC disable */ #define SG_TD1_FS 0x0400 /* first segment */ @@ -250,7 +250,7 @@ #define RXDESCS 30 /* no of receive descriptors */ #define TXDESCS 60 /* no of transmit descriptors */ -#define TX_RING_SIZE 60 +#define TX_RING_SIZE 60 #define TX_RING_MOD_MASK 59 #define RX_RING_SIZE 30 @@ -307,7 +307,7 @@ volatile struct sgec_shared_mem *sgec_mem; /* virtual addr of block inside shared mem block */ volatile struct sgec_init_block *init_block; - unsigned char vsbus_int; + unsigned char vsbus_int; spinlock_t lock; int rx_new, tx_new; int rx_old, tx_old; @@ -383,7 +383,7 @@ ib->phys_addr[4] = dev->dev_addr[4]; ib->phys_addr[5] = dev->dev_addr[5]; /* Setup the initialization block */ - + /* Setup rx descriptor pointer */ /* Calculate the physical address of the first receive descriptor */ @@ -393,7 +393,7 @@ #ifdef VAX_SGEC_DEBUG // printk("RX ptr: %8.8lx(%8.8x)\n", leptr, ib->brx_ring); -#endif +#endif /* Setup tx descriptor pointer */ /* Calculate the physical address of the first transmit descriptor */ @@ -439,7 +439,7 @@ reg = ll->sg_nicsr6; writecsr6(ll, SG_NICSR6_RE); /* reset card */ - + /* Wait for the sgec to complete initialization */ for (i = 0; (i < 100) && !(ll->sg_nicsr5 & SG_NICSR5_ID); i++) { #ifdef VAX_SGEC_DEBUG @@ -493,15 +493,15 @@ for (rd=&ib->brx_ring[lp->rx_new]; !((bits = rd->framelen) & SG_FR_OWN); rd=&ib->brx_ring[lp->rx_new]){ - + /* - * check for incomplete frame + * check for incomplete frame if ((bits & SG_R0_POK) != SG_R0_POK) { lp->stats.rx_over_errors ++; lp->stats_rx_errors++; } else if (bits & SG_R0_ERR) { - * only count last frame as the error + * only count last frame as the error if (bits & SG_R0_BUF) lp->stats.rx_fifo_errors++; if (bits & SG_R0_CRC) lp->stats.rx_crc_errors++; if (bits & SG_R0_OFL) lp->stats.rx_over_errors++; @@ -588,12 +588,12 @@ * So we don't count the packet more than once. */ td->word1 &= ~(SG_TD1_POK); - - /* * One collision before packet was sent. + + /* * One collision before packet was sent. if (td->word1 & SG_T1_EONE) lp->stats.collisions++; - - * More than one collision, be optimistic. + + * More than one collision, be optimistic. if (td->tmd1_bits & LE_T1_EMORE) lp->stats.collisions += 2; */ @@ -606,7 +606,7 @@ if (netif_queue_stopped(dev) && TX_BUFFS_AVAIL > 0) netif_wake_queue(dev); - + spin_unlock(&lp->lock); } @@ -626,7 +626,7 @@ writereg(&ll->sg_nicsr5, csr5); /* reset interrupt */ /* if ((csr0 & LE_C0_ERR)) { - * Clear the error condition + * Clear the error condition writecsr0(ll, LE_C0_BABL | LE_C0_ERR | LE_C0_MISS | LE_C0_CERR | LE_C0_MERR); }*/ @@ -713,7 +713,7 @@ struct sgec_private *lp = (struct sgec_private *) dev->priv; volatile struct sgec_regs *ll = lp->ll; int status; - + sgec_stop(ll); sgec_init_ring(dev); @@ -751,13 +751,13 @@ spin_lock_irq(&lp->lock); lp->stats.tx_bytes += len; - + entry = lp->tx_new & TX_RING_MOD_MASK; ib->btx_ring[entry].word1 = len; // ib->btx_ring[entry].misc = 0; - + cp_to_buf((char *) lp->sgec_mem->tx_buf[entry], skb->data, skblen); - + /* Clear the slack of the packet, do I need this? */ /* For a firewall its a good idea - AC */ /* @@ -779,7 +779,7 @@ dev->trans_start = jiffies; dev_kfree_skb(skb); - return 0; + return 0; } static struct net_device_stats *sgec_get_stats(struct net_device *dev) @@ -797,7 +797,7 @@ struct dev_mc_list *dmi = dev->mc_list; char *addrs; int i, j, bit, byte; - u32 crc, poly = CRC_POLYNOMIAL_LE; + u32 crc, poly = CRC_POLYNOMIAL_LE; /* set all multicast bits */ if (dev->flags & IFF_ALLMULTI) { @@ -821,7 +821,7 @@ /* multicast address? */ if (!(*addrs & 1)) continue; - + crc = 0xffffffff; for (byte = 0; byte < 6; byte++) for (bit = *addrs++, j = 0; j < 8; j++, bit >>= 1) { @@ -834,7 +834,7 @@ crc = crc ^ poly; } } - + crc = crc >> 26; mcast_table[crc >> 4] |= 1 << (crc & 0xf); } @@ -887,7 +887,7 @@ struct sgec_private *lp; volatile struct sgec_regs *ll; int i, ret; - volatile unsigned long *esar; + volatile unsigned long __iomem *esar; /* Could these base addresses be different on other CPUs? */ unsigned long sgec_phys_addr = vsbus_dev->phys_base; @@ -902,8 +902,8 @@ spin_lock_init(&lp->lock); /* Need a block of 64KB */ - /* At present, until we figure out the address extension - * parity control bit, ask for memory in the DMA zone */ + /* At present, until we figure out the address extension + * parity control bit, ask for memory in the DMA zone */ dev->mem_start = __get_free_pages(GFP_DMA, 4); if (!dev->mem_start) { /* Shouldn't we free dev->priv here if dev was non-NULL on entry? */ @@ -1007,7 +1007,7 @@ if (retval) free_netdev (netdev); } - + return 0; } Index: delqa.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/drivers/vax/net/delqa.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- delqa.c 9 May 2004 23:40:48 -0000 1.10 +++ delqa.c 25 Apr 2005 09:37:12 -0000 1.11 @@ -61,7 +61,7 @@ }; struct delqa_private { - unsigned char *base; + unsigned char __iomem *base; unsigned int qbus_vector; struct net_device_stats stats; struct delqa_descs *descs; @@ -170,7 +170,7 @@ break; } } else { - printk("."); + printk("."); } } printk("\n"); @@ -202,7 +202,7 @@ break; } } else { - printk("."); + printk("."); } } printk("\n"); @@ -362,7 +362,7 @@ skb->dev = dev; skb_reserve(skb, 2); skb_put(skb, len); - memcpy(skb->data, + memcpy(skb->data, priv->rx_map[priv->next_rx]->virtaddr, len); skb->protocol = eth_type_trans(skb, dev); netif_rx(skb); @@ -381,7 +381,7 @@ desc = priv->descs->rxdesc + priv->next_rx; } - /* DEQNA manual errata sheet states that we must check for an + /* DEQNA manual errata sheet states that we must check for an invalid receive list before leaving the ISR and reset the buffer list if it is invalid */ if (read_reg(priv, DELQA_CSR) & DELQA_CSR_RL_INVALID) { @@ -396,7 +396,7 @@ o The while() loop above stops when next_rx points to a 'NOTYET' descriptor. */ - busaddr = priv->desc_map->busaddr + + busaddr = priv->desc_map->busaddr + offsetof(struct delqa_descs, rxdesc[priv->next_rx]); write_reg(priv, DELQA_RCLL, LOWORD(busaddr)); @@ -415,7 +415,7 @@ spin_lock(&priv->lock); csr = read_reg(priv, DELQA_CSR); - + #if DELQA_DEBUG_CSR dump_csr("delqa_interrupt entry", dev); #endif @@ -477,7 +477,7 @@ return -ENOMEM; } - memset(skb_put(new_skb, ETH_ZLEN - skb->len), 0, + memset(skb_put(new_skb, ETH_ZLEN - skb->len), 0, ETH_ZLEN - skb->len); dev_kfree_skb(skb); @@ -708,7 +708,7 @@ return -EAGAIN; } - /* Mark the transmit descriptors as not yet owned by + /* Mark the transmit descriptors as not yet owned by the DELQA (and also not VALID). */ for (i=0; i<TXDESCS; i++) { desc = priv->descs->txdesc + i; @@ -720,7 +720,7 @@ desc->status2 = 0; } - /* Mark the receive descriptors as not yet owned by + /* Mark the receive descriptors as not yet owned by the DELQA. */ for (i=0; i<RXDESCS; i++) { desc = priv->descs->rxdesc + i; @@ -732,13 +732,13 @@ /* Tell the DELQA where the receive descriptors live (i.e. which Q-bus addresses are mapped to the descriptor - addresses by the mapping registers. There is no + addresses by the mapping registers. There is no point in setting the transmit descriptor address, since there are no valid transmit descriptors yet. When the card hits an invalid transmit descriptor, it stops the transmit logic, which can only be restarted by setting the transmit descriptor address again. */ - + busaddr = priv->desc_map->busaddr + offsetof(struct delqa_descs, rxdesc[0]); write_reg(priv, DELQA_RCLL, LOWORD(busaddr)); @@ -911,7 +911,7 @@ printk("delqa qbus vector: %d (0%03o, 0x%04x)\n", priv->qbus_vector, priv->qbus_vector, priv->qbus_vector); - /* This is purely informational */ + /* This is purely informational */ dev->irq = qbus_vector_to_irq(priv->parent, priv->qbus_vector); printk("Ethernet address in ROM: "); @@ -975,7 +975,7 @@ } static struct qbus_driver delqa_driver = { - .probe = delqa_probe, + .probe = delqa_probe, .drv = { .name = "delqa", }, @@ -986,6 +986,5 @@ return qbus_register_driver(&delqa_driver); } - device_initcall(delqa_init); Index: lance.c =================================================================== RCS file: /cvsroot/linux-vax/kernel-2.5/drivers/vax/net/lance.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- lance.c 7 Aug 2004 23:38:20 -0000 1.7 +++ lance.c 25 Apr 2005 09:37:12 -0000 1.8 @@ -1,15 +1,15 @@ -/* +/* * Lance ethernet driver for the VAX station 3100 * * Adapted from declance.c - Linux MIPS Decstation Team * modified for DS5000/200 + VAX MIPS - Dave Airlie (ai...@li...) * - * I have every intention of remerging this driver with declance.c + * I have every intention of remerging this driver with declance.c * at some stage, this version is just intermediate I hope :-) * - D.A. July 2000 * * I've started to write some more of this.. doesn't do anything - * extra visibly, just does some static block allocation to use + * extra visibly, just does some static block allocation to use * until kmalloc arrives... next on the list are the IRQ and getting * the lance pointed at the init block in the right address space. * - D.A. 14 Aug 2000 @@ -117,7 +117,7 @@ unsigned short rmd0; /* low address of packet */ unsigned char rmd1_hadr; /* high address of packet */ unsigned char rmd1_bits; /* descriptor bits */ - short length; /* This length is 2s complement (negative)! + short length; /* This length is 2s complement (negative)! * Buffer length */ unsigned short mblength; /* This is the actual number of bytes received */ @@ -127,10 +127,10 @@ unsigned short tmd0; /* low address of packet */ unsigned char tmd1_hadr; /* high address of packet */ unsigned char tmd1_bits; /* descriptor bits */ - short length; /* Length is 2s complement (negative)! */ + short length; /* Length is 2s complement (negative)! */ unsigned short misc; }; - + /* First part of the LANCE initialization block, described in databook. */ struct lance_init_block { @@ -183,12 +183,12 @@ /* virtual addr of block inside shared mem block */ volatile struct lance_init_block *init_block; - unsigned char vsbus_int; + unsigned char vsbus_int; spinlock_t lock; int rx_new, tx_new; int rx_old, tx_old; - + struct net_device_stats stats; unsigned short busmaster_regval; @@ -217,8 +217,8 @@ /* Communication with the LANCE takes place via four channels: - 1. The RDP and RAP ports (which live at 200e0000 physical on - VS3100-family machines). Through these two ports we can + 1. The RDP and RAP ports (which live at 200e0000 physical on + VS3100-family machines). Through these two ports we can access the LANCE's 4 registers: CSR0, CSR1, CSR2 and CSR3 (very imaginatively named...) @@ -235,7 +235,7 @@ 4. The RX and TX buffers themselves. These buffers have no alignment requirement. - To keep things simple, we allocate a single 64K chunk of memory which + To keep things simple, we allocate a single 64K chunk of memory which contains the init block, followed by the buffer descriptors and then the buffers. @@ -246,11 +246,11 @@ However, the KA43 has an unusual requirement. Physical memory on the KA43 is accessible from address 0 upwards as normal, but is also visible in the region starting a 0x28000000. This region is called the DIAGMEM - region. What's different about it, I don't know, but it's probably - something to do with caching. + region. What's different about it, I don't know, but it's probably + something to do with caching. So, after allocating the 64KB chunk, but before we tell the LANCE - about it, we tweak the PTEs behind these pages to map to physical + about it, we tweak the PTEs behind these pages to map to physical addresses in the DIAGMEM region. As of 2001-03-06, the closest data sheet I can find is the AM79C90 (aka @@ -336,7 +336,7 @@ ib->phys_addr[4] = dev->dev_addr[4]; ib->phys_addr[5] = dev->dev_addr[5]; /* Setup the initialization block */ - + /* Setup rx descriptor pointer */ /* Calculate the physical address of the first receive descriptor */ @@ -346,7 +346,7 @@ #ifdef VAX_LANCE_DEBUG printk("RX ptr: %8.8lx(%8.8x)\n", leptr, ib->brx_ring); -#endif +#endif /* Setup tx descriptor pointer */ /* Calculate the physical address of the first transmit descriptor */ @@ -403,7 +403,7 @@ udelay(100); writecsr0(ll, LE_C0_INIT); - + /* Wait for the lance to complete initialization */ for (i = 0; (i < 100) && !(ll->rdp & LE_C0_IDON); i++) { #ifdef VAX_LANCE_DEBUG @@ -463,7 +463,7 @@ } printk("]"); #endif - + for (rd = &ib->brx_ring[lp->rx_new]; !((bits = rd->rmd1_bits) & LE_R1_OWN); rd = &ib->brx_ring[lp->rx_new]) { @@ -539,10 +539,10 @@ /* If we hit a packet not owned by us, stop */ if (td->tmd1_bits & LE_T1_OWN) break; - + if (td->tmd1_bits & LE_T1_ERR) { status = td->misc; - + lp->stats.tx_errors++; if (status & LE_T3_RTY) lp->stats.tx_aborted_errors++; @@ -636,7 +636,7 @@ } if (csr0 & LE_C0_RINT) lance_rx(dev); - + if (csr0 & LE_C0_TINT) lance_tx(dev); @@ -716,7 +716,7 @@ struct lance_private *lp = (struct lance_private *) dev->priv; volatile struct lance_regs *ll = lp->ll; int status; - + lance_stop(ll); lance_init_ring(dev); @@ -754,13 +754,13 @@ spin_lock_irq(&lp->lock); lp->stats.tx_bytes += len; - + entry = lp->tx_new & TX_RING_MOD_MASK; ib->btx_ring[entry].length = (-len) | 0xf000; ib->btx_ring[entry].misc = 0; - + cp_to_buf((char *) lp->lance_mem->tx_buf[entry], skb->data, skblen); - + /* Clear the slack of the packet, do I need this? */ /* For a firewall its a good idea - AC */ /* @@ -782,7 +782,7 @@ dev->trans_start = jiffies; dev_kfree_skb(skb); - return 0; + return 0; } static struct net_device_stats *lance_get_stats(struct net_device *dev) @@ -800,7 +800,7 @@ struct dev_mc_list *dmi = dev->mc_list; char *addrs; int i, j, bit, byte; - u32 crc, poly = CRC_POLYNOMIAL_LE; + u32 crc, poly = CRC_POLYNOMIAL_LE; /* set all multicast bits */ if (dev->flags & IFF_ALLMULTI) { @@ -824,7 +824,7 @@ /* multicast address? */ if (!(*addrs & 1)) continue; - + crc = 0xffffffff; for (byte = 0; byte < 6; byte++) for (bit = *addrs++, j = 0; j < 8; j++, bit >>= 1) { @@ -837,7 +837,7 @@ crc = crc ^ poly; } } - + crc = crc >> 26; mcast_table[crc >> 4] |= 1 << (crc & 0xf); } @@ -890,8 +890,8 @@ struct lance_private *lp; volatile struct lance_regs *ll; int i; - unsigned char *esar; - + unsigned char __iomem *esar; + /* Could these base addresses be different on other CPUs? */ unsigned long lance_phys_addr=vsbus_dev->phys_base; unsigned long esar_phys_addr=KA43_NWA_BASE; @@ -904,8 +904,8 @@ spin_lock_init(&lp->lock); /* Need a block of 64KB */ - /* At present, until we figure out the address extension - * parity control bit, ask for memory in the DMA zone */ + /* At present, until we figure out the address extension + * parity control bit, ask for memory in the DMA zone */ dev->mem_start = __get_free_pages(GFP_DMA, 4); if (!dev->mem_start) { return -ENOMEM; @@ -916,7 +916,7 @@ /* FIXME: We need to check if this block straddles the 16MB boundary. If - it does, then we can't use it for DMA. Instead we allocate + it does, then we can't use it for DMA. Instead we allocate another 64KB block (which obviously cannot straddle the 16MB boundary as well) and free the first. @@ -926,11 +926,10 @@ */ /* KA43 only. */ - ka43_diagmem_remap(dev->mem_start, 65536); - + ka43_diagmem_remap(dev->mem_start, 65536); } #endif /* CONFIG_CPU_KA43 */ - + dev->mem_end = dev->mem_start + 65536; @@ -1027,7 +1026,7 @@ struct net_device *netdev; int retval; - printk("vaxlance_probe: name = %s, base = 0x%08x, irqindex = %d\n", + printk("vaxlance_probe: name = %s, base = 0x%08x, irqindex = %d\n", vsbus_dev->dev.bus_id, vsbus_dev->phys_base, vsbus_dev->vsbus_irq); netdev = alloc_etherdev(sizeof(struct lance_private)); @@ -1059,6 +1058,5 @@ return vsbus_register_driver(&vaxlance_driver); } - device_initcall(vaxlance_init); |