drivers/net: Trim trailing whitespace

Signed-off-by: Jeff Garzik <jeff@garzik.org>
This commit is contained in:
Jeff Garzik 2006-09-13 13:24:59 -04:00
Родитель 7a29108322
Коммит 6aa20a2235
178 изменённых файлов: 22402 добавлений и 22402 удалений

Просмотреть файл

@ -30,17 +30,17 @@
with a TX-TX optimisation to see if we can touch 180-200K/second as seems
theoretically maximum.
19950402 Alan Cox <Alan.Cox@linux.org>
Cleaned up for 2.3.x because we broke SMP now.
Cleaned up for 2.3.x because we broke SMP now.
20000208 Alan Cox <alan@redhat.com>
Check up pass for 2.5. Nothing significant changed
20021009 Alan Cox <alan@redhat.com>
Fixed zero fill corner case
Fixed zero fill corner case
20030104 Alan Cox <alan@redhat.com>
For the avoidance of doubt the "preferred form" of this code is one which
is in an open non patent encumbered format. Where cryptographic key signing
forms part of the process of creating an executable the information
@ -58,7 +58,7 @@
* Some documentation is available from 3Com. Due to the boards age
* standard responses when you ask for this will range from 'be serious'
* to 'give it to a museum'. The documentation is incomplete and mostly
* of historical interest anyway.
* of historical interest anyway.
*
* The basic system is a single buffer which can be used to receive or
* transmit a packet. A third command mode exists when you are setting
@ -80,7 +80,7 @@
* out with those too).
*
* DOC: Problems
*
*
* There are a wide variety of undocumented error returns from the card
* and you basically have to kick the board and pray if they turn up. Most
* only occur under extreme load or if you do something the board doesn't
@ -145,7 +145,7 @@ static int mem_start;
/**
* el1_probe: - probe for a 3c501
* @dev: The device structure passed in to probe.
* @dev: The device structure passed in to probe.
*
* This can be called from two places. The network layer will probe using
* a device structure passed in with the probe information completed. For a
@ -155,7 +155,7 @@ static int mem_start;
* Returns 0 on success. ENXIO if asked not to probe and ENODEV if asked to
* probe and failing to find anything.
*/
struct net_device * __init el1_probe(int unit)
{
struct net_device *dev = alloc_etherdev(sizeof(struct net_local));
@ -200,7 +200,7 @@ out:
}
/**
* el1_probe1:
* el1_probe1:
* @dev: The device structure to use
* @ioaddr: An I/O address to probe at.
*
@ -307,7 +307,7 @@ static int __init el1_probe1(struct net_device *dev, int ioaddr)
memset(dev->priv, 0, sizeof(struct net_local));
lp = netdev_priv(dev);
spin_lock_init(&lp->lock);
/*
* The EL1-specific entries in the device structure.
*/
@ -328,7 +328,7 @@ static int __init el1_probe1(struct net_device *dev, int ioaddr)
* @dev: device that is being opened
*
* When an ifconfig is issued which changes the device flags to include
* IFF_UP this function is called. It is only called when the change
* IFF_UP this function is called. It is only called when the change
* occurs, not when the interface remains up. #el1_close will be called
* when it goes down.
*
@ -367,12 +367,12 @@ static int el_open(struct net_device *dev)
* violence and prayer
*
*/
static void el_timeout(struct net_device *dev)
{
struct net_local *lp = netdev_priv(dev);
int ioaddr = dev->base_addr;
if (el_debug)
printk (KERN_DEBUG "%s: transmit timed out, txsr %#2x axsr=%02x rxsr=%02x.\n",
dev->name, inb(TX_STATUS), inb(AX_STATUS), inb(RX_STATUS));
@ -385,7 +385,7 @@ static void el_timeout(struct net_device *dev)
netif_wake_queue(dev);
}
/**
* el_start_xmit:
* @skb: The packet that is queued to be sent
@ -421,7 +421,7 @@ static int el_start_xmit(struct sk_buff *skb, struct net_device *dev)
*/
spin_lock_irqsave(&lp->lock, flags);
/*
* Avoid timer-based retransmission conflicts.
*/
@ -434,10 +434,10 @@ static int el_start_xmit(struct sk_buff *skb, struct net_device *dev)
int pad = 0;
int gp_start;
unsigned char *buf = skb->data;
if (len < ETH_ZLEN)
pad = ETH_ZLEN - len;
gp_start = 0x800 - ( len + pad );
lp->tx_pkt_start = gp_start;
@ -463,7 +463,7 @@ static int el_start_xmit(struct sk_buff *skb, struct net_device *dev)
*/
spin_unlock_irqrestore(&lp->lock, flags);
outw(0x00, RX_BUF_CLR); /* Set rx packet area to 0. */
outw(gp_start, GP_LOW); /* aim - packet will be loaded into buffer start */
outsb(DATAPORT,buf,len); /* load buffer (usual thing each byte increments the pointer) */
@ -472,7 +472,7 @@ static int el_start_xmit(struct sk_buff *skb, struct net_device *dev)
outb(0, DATAPORT);
}
outw(gp_start, GP_LOW); /* the board reuses the same register */
if(lp->loading != 2)
{
outb(AX_XMIT, AX_CMD); /* fire ... Trigger xmit. */
@ -498,7 +498,7 @@ static int el_start_xmit(struct sk_buff *skb, struct net_device *dev)
* @dev_id: The 3c501 that burped
* @regs: Register data (surplus to our requirements)
*
* Handle the ether interface interrupts. The 3c501 needs a lot more
* Handle the ether interface interrupts. The 3c501 needs a lot more
* hand holding than most cards. In particular we get a transmit interrupt
* with a collision error because the board firmware isnt capable of rewinding
* its own transmit buffer pointers. It can however count to 16 for us.
@ -526,7 +526,7 @@ static irqreturn_t el_interrupt(int irq, void *dev_id, struct pt_regs *regs)
lp = netdev_priv(dev);
spin_lock(&lp->lock);
/*
* What happened ?
*/
@ -794,7 +794,7 @@ static void el_reset(struct net_device *dev)
* of the rest will be cleaned up by #el1_open. Always returns 0 indicating
* a success.
*/
static int el1_close(struct net_device *dev)
{
int ioaddr = dev->base_addr;
@ -803,7 +803,7 @@ static int el1_close(struct net_device *dev)
printk(KERN_INFO "%s: Shutting down Ethernet card at %#x.\n", dev->name, ioaddr);
netif_stop_queue(dev);
/*
* Free and disable the IRQ.
*/
@ -824,7 +824,7 @@ static int el1_close(struct net_device *dev)
*
* Returns the statistics for the card from the card private data
*/
static struct net_device_stats *el1_get_stats(struct net_device *dev)
{
struct net_local *lp = netdev_priv(dev);
@ -835,7 +835,7 @@ static struct net_device_stats *el1_get_stats(struct net_device *dev)
* set_multicast_list:
* @dev: The device to adjust
*
* Set or clear the multicast filter for this adaptor to use the best-effort
* Set or clear the multicast filter for this adaptor to use the best-effort
* filtering supported. The 3c501 supports only three modes of filtering.
* It always receives broadcasts and packets for itself. You can choose to
* optionally receive all packets, or all multicast packets on top of this.
@ -907,7 +907,7 @@ MODULE_PARM_DESC(irq, "EtherLink IRQ number");
* Returns 0 for success or -EIO if a card is not found. Returning an error
* here also causes the module to be unloaded
*/
int __init init_module(void)
{
dev_3c501 = el1_probe(-1);
@ -918,11 +918,11 @@ int __init init_module(void)
/**
* cleanup_module:
*
*
* The module is being unloaded. We unhook our network device from the system
* and then free up the resources we took when the card was found.
*/
void cleanup_module(void)
{
struct net_device *dev = dev_3c501;

Просмотреть файл

@ -37,7 +37,7 @@ struct net_local
spinlock_t lock; /* Serializing lock */
};
#define RX_STATUS (ioaddr + 0x06)
#define RX_CMD RX_STATUS
#define TX_STATUS (ioaddr + 0x07)

Просмотреть файл

@ -81,7 +81,7 @@ static void el2_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr,
int ring_page);
static struct ethtool_ops netdev_ethtool_ops;
/* This routine probes for a memory-mapped 3c503 board by looking for
the "location register" at the end of the jumpered boot PROM space.
This works even if a PROM isn't there.
@ -96,7 +96,7 @@ static int __init do_el2_probe(struct net_device *dev)
int irq = dev->irq;
SET_MODULE_OWNER(dev);
if (base_addr > 0x1ff) /* Check a single specified location. */
return el2_probe1(dev, base_addr);
else if (base_addr != 0) /* Don't probe at all. */
@ -127,7 +127,7 @@ static int __init do_el2_probe(struct net_device *dev)
/* Try all of the locations that aren't obviously empty. This touches
a lot of locations, and is much riskier than the code above. */
static int __init
static int __init
el2_pio_probe(struct net_device *dev)
{
int i;
@ -173,7 +173,7 @@ out:
/* Probe for the Etherlink II card at I/O port base IOADDR,
returning non-zero on success. If found, set the station
address and memory parameters in DEVICE. */
static int __init
static int __init
el2_probe1(struct net_device *dev, int ioaddr)
{
int i, iobase_reg, membase_reg, saved_406, wordlength, retval;
@ -367,7 +367,7 @@ out:
release_region(ioaddr, EL2_IO_EXTENT);
return retval;
}
static int
el2_open(struct net_device *dev)
{
@ -385,7 +385,7 @@ el2_open(struct net_device *dev)
outb_p(0x04 << ((*irqp == 9) ? 2 : *irqp), E33G_IDCFR);
outb_p(0x00, E33G_IDCFR);
if (*irqp == probe_irq_off(cookie) /* It's a good IRQ line! */
&& ((retval = request_irq(dev->irq = *irqp,
&& ((retval = request_irq(dev->irq = *irqp,
ei_interrupt, 0, dev->name, dev)) == 0))
break;
}

Просмотреть файл

@ -14,7 +14,7 @@
/* Shared memory management parameters. NB: The 8 bit cards have only
one bank (MB1) which serves both Tx and Rx packet space. The 16bit
cards have 2 banks, MB0 for Tx packets, and MB1 for Rx packets.
cards have 2 banks, MB0 for Tx packets, and MB1 for Rx packets.
You choose which bank appears in the sh. mem window with EGACFR_MBSn */
#define EL2_MB0_START_PG (0x00) /* EL2/16 Tx packets go in bank 0 */
@ -82,7 +82,7 @@
0 1 0 0x4000 -- bank 2, not used
0 1 1 0x6000 -- bank 3, not used
There was going to be a 32k card that used bank 2 and 3, but it
There was going to be a 32k card that used bank 2 and 3, but it
never got produced.
*/

Просмотреть файл

@ -315,11 +315,11 @@ static inline void check_3c505_dma(struct net_device *dev)
spin_lock_irqsave(&adapter->lock, flags);
adapter->dmaing = 0;
adapter->busy = 0;
f=claim_dma_lock();
disable_dma(dev->dma);
release_dma_lock(f);
if (adapter->rx_active)
adapter->rx_active--;
outb_control(adapter->hcr_val & ~(DMAE | TCEN | DIR), dev);
@ -660,7 +660,7 @@ static irqreturn_t elp_interrupt(int irq, void *dev_id, struct pt_regs *reg_ptr)
dev = dev_id;
adapter = (elp_device *) dev->priv;
spin_lock(&adapter->lock);
do {
@ -712,7 +712,7 @@ static irqreturn_t elp_interrupt(int irq, void *dev_id, struct pt_regs *reg_ptr)
timeout = jiffies + 3*HZ/100;
while ((inb_status(dev->base_addr) & ACRF) != 0 && time_before(jiffies, timeout)) {
if (receive_pcb(dev, &adapter->irx_pcb)) {
switch (adapter->irx_pcb.command)
switch (adapter->irx_pcb.command)
{
case 0:
break;
@ -889,7 +889,7 @@ static int elp_open(struct net_device *dev)
adapter->send_pcb_semaphore = 0;
adapter->rx_backlog.in = 0;
adapter->rx_backlog.out = 0;
spin_lock_init(&adapter->lock);
/*
@ -1003,7 +1003,7 @@ static int send_packet(struct net_device *dev, struct sk_buff *skb)
}
adapter->stats.tx_bytes += nlen;
/*
* send the adapter a transmit packet command. Ignore segment and offset
* and make sure the length is even
@ -1044,7 +1044,7 @@ static int send_packet(struct net_device *dev, struct sk_buff *skb)
outb_control(adapter->hcr_val | DMAE | TCEN, dev);
enable_dma(dev->dma);
release_dma_lock(flags);
if (elp_debug >= 3)
printk(KERN_DEBUG "%s: DMA transfer started\n", dev->name);
@ -1054,7 +1054,7 @@ static int send_packet(struct net_device *dev, struct sk_buff *skb)
/*
* The upper layer thinks we timed out
*/
static void elp_timeout(struct net_device *dev)
{
elp_device *adapter = dev->priv;
@ -1080,7 +1080,7 @@ static int elp_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
unsigned long flags;
elp_device *adapter = dev->priv;
spin_lock_irqsave(&adapter->lock, flags);
check_3c505_dma(dev);
@ -1088,7 +1088,7 @@ static int elp_start_xmit(struct sk_buff *skb, struct net_device *dev)
printk(KERN_DEBUG "%s: request to send packet of length %d\n", dev->name, (int) skb->len);
netif_stop_queue(dev);
/*
* send the packet at skb->data for skb->len
*/
@ -1235,7 +1235,7 @@ static void elp_set_mc_list(struct net_device *dev)
printk(KERN_DEBUG "%s: request to set multicast list\n", dev->name);
spin_lock_irqsave(&adapter->lock, flags);
if (!(dev->flags & (IFF_PROMISC | IFF_ALLMULTI))) {
/* send a "load multicast list" command to the board, max 10 addrs/cmd */
/* if num_addrs==0 the list will be cleared */

Просмотреть файл

@ -72,7 +72,7 @@
/*****************************************************************
*
* timeout value
* this is a rough value used for loops to stop them from
* this is a rough value used for loops to stop them from
* locking up the whole machine in the case of failure or
* error conditions
*

Просмотреть файл

@ -301,7 +301,7 @@ static int io = 0x300;
static int irq;
static int mem_start;
/* Check for a network adaptor of this type, and return '0' iff one exists.
If dev->base_addr == 0, probe all likely locations.
If dev->base_addr == 1, always return failure.
@ -379,7 +379,7 @@ static int __init el16_probe1(struct net_device *dev, int ioaddr)
if (!request_region(ioaddr, EL16_IO_EXTENT, DRV_NAME))
return -ENODEV;
if ((inb(ioaddr) != '*') || (inb(ioaddr + 1) != '3') ||
if ((inb(ioaddr) != '*') || (inb(ioaddr + 1) != '3') ||
(inb(ioaddr + 2) != 'C') || (inb(ioaddr + 3) != 'O')) {
retval = -ENODEV;
goto out;
@ -575,7 +575,7 @@ static irqreturn_t el16_interrupt(int irq, void *dev_id, struct pt_regs *regs)
while (lp->tx_pkts_in_ring) {
unsigned short tx_status = readw(shmem+lp->tx_reap);
if (!(tx_status & 0x8000)) {
if (net_debug > 5)
if (net_debug > 5)
printk("Tx command incomplete (%#x).\n", lp->tx_reap);
break;
}
@ -825,7 +825,7 @@ static void hardware_send_packet(struct net_device *dev, void *buf, short length
}
/* Grimly block further packets if there has been insufficient reaping. */
if (++lp->tx_pkts_in_ring < NUM_TX_BUFS)
if (++lp->tx_pkts_in_ring < NUM_TX_BUFS)
netif_wake_queue(dev);
}
@ -953,7 +953,7 @@ cleanup_module(void)
#endif /* MODULE */
MODULE_LICENSE("GPL");
/*
* Local variables:
* compile-command: "gcc -D__KERNEL__ -I/usr/src/linux/net/inet -I/usr/src/linux/drivers/net -Wall -Wstrict-prototypes -O6 -m486 -c 3c507.c"

Просмотреть файл

@ -28,7 +28,7 @@
FIXES:
Alan Cox: Removed the 'Unexpected interrupt' bug.
Michael Meskes: Upgraded to Donald Becker's version 1.07.
Alan Cox: Increased the eeprom delay. Regardless of
Alan Cox: Increased the eeprom delay. Regardless of
what the docs say some people definitely
get problems with lower (but in card spec)
delays
@ -162,7 +162,7 @@ enum RxFilter {
#define WN4_MEDIA 0x0A /* Window 4: Various transcvr/media bits. */
#define MEDIA_TP 0x00C0 /* Enable link beat and jabber for 10baseT. */
#define WN4_NETDIAG 0x06 /* Window 4: Net diagnostic */
#define FD_ENABLE 0x8000 /* Enable full-duplex ("external loopback") */
#define FD_ENABLE 0x8000 /* Enable full-duplex ("external loopback") */
/*
* Must be a power of two (we use a binary and in the
@ -350,7 +350,7 @@ static int __init el3_common_init(struct net_device *dev)
{
const char *if_names[] = {"10baseT", "AUI", "undefined", "BNC"};
printk("%s: 3c5x9 found at %#3.3lx, %s port, address ",
dev->name, dev->base_addr,
dev->name, dev->base_addr,
if_names[(dev->if_port & 0x03)]);
}
@ -528,7 +528,7 @@ no_pnp:
SET_MODULE_OWNER(dev);
netdev_boot_setup_check(dev);
/* Set passed-in IRQ or I/O Addr. */
if (dev->irq > 1 && dev->irq < 16)
irq = dev->irq;
@ -630,7 +630,7 @@ static int __init el3_mca_probe(struct device *device)
if_port = pos4 & 0x03;
irq = mca_device_transform_irq(mdev, irq);
ioaddr = mca_device_transform_ioport(mdev, ioaddr);
ioaddr = mca_device_transform_ioport(mdev, ioaddr);
if (el3_debug > 2) {
printk("3c529: irq %d ioaddr 0x%x ifport %d\n", irq, ioaddr, if_port);
}
@ -667,7 +667,7 @@ static int __init el3_mca_probe(struct device *device)
el3_cards++;
return 0;
}
#endif /* CONFIG_MCA */
#ifdef CONFIG_EISA
@ -684,7 +684,7 @@ static int __init el3_eisa_probe (struct device *device)
/* Yeepee, The driver framework is calling us ! */
edev = to_eisa_device (device);
ioaddr = edev->base_addr;
if (!request_region(ioaddr, EL3_IO_EXTENT, "3c509"))
return -EBUSY;
@ -751,7 +751,7 @@ static int __devexit el3_device_remove (struct device *device)
static ushort read_eeprom(int ioaddr, int index)
{
outw(EEPROM_READ + index, ioaddr + 10);
/* Pause for at least 162 us. for the read to take place.
/* Pause for at least 162 us. for the read to take place.
Some chips seem to require much longer */
mdelay(2);
return inw(ioaddr + 12);
@ -769,7 +769,7 @@ static ushort __init id_read_eeprom(int index)
/* Pause for at least 162 us. for the read to take place. */
/* Some chips seem to require much longer */
mdelay(4);
for (bit = 15; bit >= 0; bit--)
word = (word << 1) + (inb(id_port) & 0x01);
@ -838,7 +838,7 @@ el3_start_xmit(struct sk_buff *skb, struct net_device *dev)
netif_stop_queue (dev);
lp->stats.tx_bytes += skb->len;
if (el3_debug > 4) {
printk("%s: el3_start_xmit(length = %u) called, status %4.4x.\n",
dev->name, skb->len, inw(ioaddr + EL3_STATUS));
@ -1024,7 +1024,7 @@ el3_get_stats(struct net_device *dev)
* This is fast enough not to bother with disable IRQ
* stuff.
*/
spin_lock_irqsave(&lp->lock, flags);
update_stats(dev);
spin_unlock_irqrestore(&lp->lock, flags);
@ -1168,7 +1168,7 @@ el3_close(struct net_device *dev)
{
int ioaddr = dev->base_addr;
struct el3_private *lp = netdev_priv(dev);
if (el3_debug > 2)
printk("%s: Shutting down ethercard.\n", dev->name);
@ -1187,7 +1187,7 @@ el3_close(struct net_device *dev)
return 0;
}
static int
static int
el3_link_ok(struct net_device *dev)
{
int ioaddr = dev->base_addr;
@ -1204,9 +1204,9 @@ el3_netdev_get_ecmd(struct net_device *dev, struct ethtool_cmd *ecmd)
{
u16 tmp;
int ioaddr = dev->base_addr;
EL3WINDOW(0);
/* obtain current transceiver via WN4_MEDIA? */
/* obtain current transceiver via WN4_MEDIA? */
tmp = inw(ioaddr + WN0_ADDR_CONF);
ecmd->transceiver = XCVR_INTERNAL;
switch (tmp >> 14) {
@ -1391,7 +1391,7 @@ el3_up(struct net_device *dev)
{
int i, sw_info, net_diag;
int ioaddr = dev->base_addr;
/* Activating the board required and does no harm otherwise */
outw(0x0001, ioaddr + 4);
@ -1411,7 +1411,7 @@ el3_up(struct net_device *dev)
/* Combine secondary sw_info word (the adapter level) and primary
sw_info word (duplex setting plus other useless bits) */
EL3WINDOW(0);
sw_info = (read_eeprom(ioaddr, 0x14) & 0x400f) |
sw_info = (read_eeprom(ioaddr, 0x14) & 0x400f) |
(read_eeprom(ioaddr, 0x0d) & 0xBff0);
EL3WINDOW(4);
@ -1483,7 +1483,7 @@ el3_suspend(struct device *pdev, pm_message_t state)
struct net_device *dev;
struct el3_private *lp;
int ioaddr;
dev = pdev->driver_data;
lp = netdev_priv(dev);
ioaddr = dev->base_addr;
@ -1507,7 +1507,7 @@ el3_resume(struct device *pdev)
struct net_device *dev;
struct el3_private *lp;
int ioaddr;
dev = pdev->driver_data;
lp = netdev_priv(dev);
ioaddr = dev->base_addr;
@ -1519,7 +1519,7 @@ el3_resume(struct device *pdev)
if (netif_running(dev))
netif_device_attach(dev);
spin_unlock_irqrestore(&lp->lock, flags);
return 0;
}

Просмотреть файл

@ -12,12 +12,12 @@
Annapolis MD 21403
2000/2/2- Added support for kernel-level ISAPnP
2000/2/2- Added support for kernel-level ISAPnP
by Stephen Frost <sfrost@snowman.net> and Alessandro Zummo
Cleaned up for 2.3.x/softnet by Jeff Garzik and Alan Cox.
2001/11/17 - Added ethtool support (jgarzik)
2002/10/28 - Locking updates for 2.5 (alan@redhat.com)
*/
@ -187,9 +187,9 @@ enum corkscrew_cmd {
TotalReset = 0 << 11, SelectWindow = 1 << 11, StartCoax = 2 << 11,
RxDisable = 3 << 11, RxEnable = 4 << 11, RxReset = 5 << 11,
UpStall = 6 << 11, UpUnstall = (6 << 11) + 1, DownStall = (6 << 11) + 2,
DownUnstall = (6 << 11) + 3, RxDiscard = 8 << 11, TxEnable = 9 << 11,
TxDisable = 10 << 11, TxReset = 11 << 11, FakeIntr = 12 << 11,
AckIntr = 13 << 11, SetIntrEnb = 14 << 11, SetStatusEnb = 15 << 11,
DownUnstall = (6 << 11) + 3, RxDiscard = 8 << 11, TxEnable = 9 << 11,
TxDisable = 10 << 11, TxReset = 11 << 11, FakeIntr = 12 << 11,
AckIntr = 13 << 11, SetIntrEnb = 14 << 11, SetStatusEnb = 15 << 11,
SetRxFilter = 16 << 11, SetRxThreshold = 17 << 11,
SetTxThreshold = 18 << 11, SetTxStart = 19 << 11, StartDMAUp = 20 << 11,
StartDMADown = (20 << 11) + 1, StatsEnable = 21 << 11,
@ -338,15 +338,15 @@ static struct media_table {
mask:8, /* The transceiver-present bit in Wn3_Config. */
next:8; /* The media type to try next. */
short wait; /* Time before we check media status. */
} media_tbl[] = {
{ "10baseT", Media_10TP, 0x08, XCVR_10base2, (14 * HZ) / 10 },
{ "10Mbs AUI", Media_SQE, 0x20, XCVR_Default, (1 * HZ) / 10},
{ "undefined", 0, 0x80, XCVR_10baseT, 10000},
{ "10base2", 0, 0x10, XCVR_AUI, (1 * HZ) / 10},
{ "100baseTX", Media_Lnk, 0x02, XCVR_100baseFx, (14 * HZ) / 10},
{ "100baseFX", Media_Lnk, 0x04, XCVR_MII, (14 * HZ) / 10},
{ "MII", 0, 0x40, XCVR_10baseT, 3 * HZ},
{ "undefined", 0, 0x01, XCVR_10baseT, 10000},
} media_tbl[] = {
{ "10baseT", Media_10TP, 0x08, XCVR_10base2, (14 * HZ) / 10 },
{ "10Mbs AUI", Media_SQE, 0x20, XCVR_Default, (1 * HZ) / 10},
{ "undefined", 0, 0x80, XCVR_10baseT, 10000},
{ "10base2", 0, 0x10, XCVR_AUI, (1 * HZ) / 10},
{ "100baseTX", Media_Lnk, 0x02, XCVR_100baseFx, (14 * HZ) / 10},
{ "100baseFX", Media_Lnk, 0x04, XCVR_MII, (14 * HZ) / 10},
{ "MII", 0, 0x40, XCVR_10baseT, 3 * HZ},
{ "undefined", 0, 0x01, XCVR_10baseT, 10000},
{ "Default", 0, 0xFF, XCVR_10baseT, 10000},
};
@ -380,9 +380,9 @@ static void update_stats(int addr, struct net_device *dev);
static struct net_device_stats *corkscrew_get_stats(struct net_device *dev);
static void set_rx_mode(struct net_device *dev);
static struct ethtool_ops netdev_ethtool_ops;
/*
/*
Unfortunately maximizing the shared code between the integrated and
module version of the driver results in a complicated set of initialization
procedures.
@ -612,7 +612,7 @@ static int corkscrew_setup(struct net_device *dev, int ioaddr,
printk(KERN_INFO "%s: 3Com %s at %#3x,", dev->name, vp->product_name, ioaddr);
spin_lock_init(&vp->lock);
/* Read the station address from the EEPROM. */
EL3WINDOW(0);
for (i = 0; i < 0x18; i++) {
@ -691,7 +691,7 @@ static int corkscrew_setup(struct net_device *dev, int ioaddr,
return register_netdev(dev);
}
static int corkscrew_open(struct net_device *dev)
{
@ -715,7 +715,7 @@ static int corkscrew_open(struct net_device *dev)
} else if (vp->autoselect) {
/* Find first available media type, starting with 100baseTx. */
dev->if_port = 4;
while (!(vp->available_media & media_tbl[dev->if_port].mask))
while (!(vp->available_media & media_tbl[dev->if_port].mask))
dev->if_port = media_tbl[dev->if_port].next;
if (corkscrew_debug > 1)
@ -871,7 +871,7 @@ static void corkscrew_timer(unsigned long data)
dev->name, media_tbl[dev->if_port].name);
spin_lock_irqsave(&vp->lock, flags);
{
int old_window = inw(ioaddr + EL3_CMD) >> 13;
int media_status;
@ -911,7 +911,7 @@ static void corkscrew_timer(unsigned long data)
media_tbl[dev->if_port].next;
}
while (!(vp->available_media & media_tbl[dev->if_port].mask));
if (dev->if_port == 8) { /* Go back to default. */
dev->if_port = vp->default_media;
if (corkscrew_debug > 1)
@ -940,7 +940,7 @@ static void corkscrew_timer(unsigned long data)
}
EL3WINDOW(old_window);
}
spin_unlock_irqrestore(&vp->lock, flags);
if (corkscrew_debug > 1)
printk("%s: Media selection timer finished, %s.\n",
@ -1026,7 +1026,7 @@ static int corkscrew_start_xmit(struct sk_buff *skb,
outw(DownStall, ioaddr + EL3_CMD);
/* Wait for the stall to complete. */
for (i = 20; i >= 0; i--)
if ((inw(ioaddr + EL3_STATUS) & CmdInProgress) == 0)
if ((inw(ioaddr + EL3_STATUS) & CmdInProgress) == 0)
break;
if (prev_entry)
prev_entry->next = isa_virt_to_bus(&vp->tx_ring[entry]);
@ -1102,7 +1102,7 @@ static int corkscrew_start_xmit(struct sk_buff *skb,
int j;
outw(TxReset, ioaddr + EL3_CMD);
for (j = 20; j >= 0; j--)
if (!(inw(ioaddr + EL3_STATUS) & CmdInProgress))
if (!(inw(ioaddr + EL3_STATUS) & CmdInProgress))
break;
}
outw(TxEnable, ioaddr + EL3_CMD);
@ -1130,7 +1130,7 @@ static irqreturn_t corkscrew_interrupt(int irq, void *dev_id,
latency = inb(ioaddr + Timer);
spin_lock(&lp->lock);
status = inw(ioaddr + EL3_STATUS);
if (corkscrew_debug > 4)
@ -1249,7 +1249,7 @@ static irqreturn_t corkscrew_interrupt(int irq, void *dev_id,
outw(AckIntr | IntReq | IntLatch, ioaddr + EL3_CMD);
} while ((status = inw(ioaddr + EL3_STATUS)) & (IntLatch | RxComplete));
spin_unlock(&lp->lock);
if (corkscrew_debug > 4)
@ -1308,7 +1308,7 @@ static int corkscrew_rx(struct net_device *dev)
vp->stats.rx_bytes += pkt_len;
/* Wait a limited time to go to next packet. */
for (i = 200; i >= 0; i--)
if (! (inw(ioaddr + EL3_STATUS) & CmdInProgress))
if (! (inw(ioaddr + EL3_STATUS) & CmdInProgress))
break;
continue;
} else if (corkscrew_debug)
@ -1567,7 +1567,7 @@ static struct ethtool_ops netdev_ethtool_ops = {
.set_msglevel = netdev_set_msglevel,
};
#ifdef MODULE
void cleanup_module(void)
{
@ -1584,7 +1584,7 @@ void cleanup_module(void)
}
}
#endif /* MODULE */
/*
* Local variables:
* compile-command: "gcc -DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -O6 -c 3c515.c"

Просмотреть файл

@ -83,7 +83,7 @@
Stuart Adamson <stuart.adamson@compsoc.net>
Nov 2001
added support for ethtool (jgarzik)
$Header: /fsys2/home/chrisb/linux-1.3.59-MCA/drivers/net/RCS/3c523.c,v 1.1 1996/02/05 01:53:46 chrisb Exp chrisb $
*/
@ -434,14 +434,14 @@ static int __init do_elmc_probe(struct net_device *dev)
dev->irq=irq_table[(status & ELMC_STATUS_IRQ_SELECT) >> 6];
dev->base_addr=csr_table[(status & ELMC_STATUS_CSR_SELECT) >> 1];
/*
If we're trying to match a specified irq or IO address,
we'll reject a match unless it's what we're looking for.
Also reject it if the card is already in use.
*/
if ((irq && irq != dev->irq) ||
if ((irq && irq != dev->irq) ||
(base_addr && base_addr != dev->base_addr)) {
slot = mca_find_adapter(ELMC_MCA_ID, slot + 1);
continue;
@ -540,7 +540,7 @@ static int __init do_elmc_probe(struct net_device *dev)
/* dump all the assorted information */
printk(KERN_INFO "%s: IRQ %d, %sternal xcvr, memory %#lx-%#lx.\n", dev->name,
dev->irq, dev->if_port ? "ex" : "in",
dev->irq, dev->if_port ? "ex" : "in",
dev->mem_start, dev->mem_end - 1);
/* The hardware address for the 3c523 is stored in the first six
@ -564,7 +564,7 @@ static int __init do_elmc_probe(struct net_device *dev)
dev->set_multicast_list = NULL;
#endif
dev->ethtool_ops = &netdev_ethtool_ops;
/* note that we haven't actually requested the IRQ from the kernel.
That gets done in elmc_open(). I'm not sure that's such a good idea,
but it works, so I'll go with it. */
@ -583,7 +583,7 @@ err_out:
release_region(dev->base_addr, ELMC_IO_EXTENT);
return retval;
}
static void cleanup_card(struct net_device *dev)
{
mca_set_adapter_procfn(((struct priv *) (dev->priv))->slot, NULL, NULL);
@ -926,7 +926,7 @@ elmc_interrupt(int irq, void *dev_id, struct pt_regs *reg_ptr)
p = (struct priv *) dev->priv;
while ((stat = p->scb->status & STAT_MASK))
while ((stat = p->scb->status & STAT_MASK))
{
p->scb->cmd = stat;
elmc_attn586(); /* ack inter. */
@ -1102,7 +1102,7 @@ static void startrecv586(struct net_device *dev)
/******************************************************
* timeout
*/
static void elmc_timeout(struct net_device *dev)
{
struct priv *p = (struct priv *) dev->priv;
@ -1129,7 +1129,7 @@ static void elmc_timeout(struct net_device *dev)
elmc_open(dev);
}
}
/******************************************************
* send frame
*/
@ -1146,7 +1146,7 @@ static int elmc_send_packet(struct sk_buff *skb, struct net_device *dev)
netif_stop_queue(dev);
len = (ETH_ZLEN < skb->len) ? skb->len : ETH_ZLEN;
if (len != skb->len)
memset((char *) p->xmit_cbuffs[p->xmit_count], 0, ETH_ZLEN);
memcpy((char *) p->xmit_cbuffs[p->xmit_count], (char *) (skb->data), skb->len);
@ -1177,7 +1177,7 @@ static int elmc_send_packet(struct sk_buff *skb, struct net_device *dev)
#else
next_nop = (p->nop_point + 1) & 0x1;
p->xmit_buffs[0]->size = TBD_LAST | len;
p->xmit_cmds[0]->cmd_link = p->nop_cmds[next_nop]->cmd_link
= make16((p->nop_cmds[next_nop]));
p->xmit_cmds[0]->cmd_status = p->nop_cmds[next_nop]->cmd_status = 0;
@ -1281,7 +1281,7 @@ int __init init_module(void)
{
int this_dev,found = 0;
/* Loop until we either can't find any more cards, or we have MAX_3C523_CARDS */
/* Loop until we either can't find any more cards, or we have MAX_3C523_CARDS */
for(this_dev=0; this_dev<MAX_3C523_CARDS; this_dev++) {
struct net_device *dev = alloc_etherdev(sizeof(struct priv));
if (!dev)

Просмотреть файл

@ -130,7 +130,7 @@ struct rfd_struct
/*
* Receive Buffer Descriptor (RBD)
*/
struct rbd_struct
struct rbd_struct
{
unsigned short status; /* status word,number of used bytes in buff */
unsigned short next; /* pointeroffset to next RBD */
@ -182,7 +182,7 @@ struct nop_cmd_struct
/*
* IA Setup command
*/
struct iasetup_cmd_struct
struct iasetup_cmd_struct
{
unsigned short cmd_status;
unsigned short cmd_cmd;
@ -191,7 +191,7 @@ struct iasetup_cmd_struct
};
/*
* Configure command
* Configure command
*/
struct configure_cmd_struct
{
@ -213,9 +213,9 @@ struct configure_cmd_struct
};
/*
* Multicast Setup command
* Multicast Setup command
*/
struct mcsetup_cmd_struct
struct mcsetup_cmd_struct
{
unsigned short cmd_status;
unsigned short cmd_cmd;
@ -225,9 +225,9 @@ struct mcsetup_cmd_struct
};
/*
* transmit command
* transmit command
*/
struct transmit_cmd_struct
struct transmit_cmd_struct
{
unsigned short cmd_status;
unsigned short cmd_cmd;

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -5,7 +5,7 @@
/*
* Registers
*/
#define HOST_CMD 0
#define HOST_CMD_START_RX (1<<3)
#define HOST_CMD_SUSPND_RX (3<<3)
@ -63,7 +63,7 @@ struct mc32_stats
u32 tx_underrun_errors;
u32 tx_cts_errors;
u32 tx_timeout_errors;
/* various cruft */
u32 dataA[6];
u16 dataB[5];

Просмотреть файл

@ -796,7 +796,7 @@ static void poll_vortex(struct net_device *dev)
local_irq_disable();
(vp->full_bus_master_rx ? boomerang_interrupt:vortex_interrupt)(dev->irq,dev,NULL);
local_irq_restore(flags);
}
}
#endif
#ifdef CONFIG_PM
@ -904,7 +904,7 @@ static int vortex_eisa_remove(struct device *device)
vp = netdev_priv(dev);
ioaddr = vp->ioaddr;
unregister_netdev(dev);
iowrite16(TotalReset|0x14, ioaddr + EL3_CMD);
release_region(dev->base_addr, VORTEX_TOTAL_SIZE);
@ -935,7 +935,7 @@ static int __init vortex_eisa_init(void)
eisa_found = 1;
}
#endif
/* Special code to work-around the Compaq PCI BIOS32 problem. */
if (compaq_ioaddr) {
vortex_probe1(NULL, ioport_map(compaq_ioaddr, VORTEX_TOTAL_SIZE),
@ -953,7 +953,7 @@ static int __devinit vortex_init_one(struct pci_dev *pdev,
struct vortex_chip_info *vci;
void __iomem *ioaddr;
/* wake up and enable device */
/* wake up and enable device */
rc = pci_enable_device(pdev);
if (rc < 0)
goto out;
@ -1089,7 +1089,7 @@ static int __devinit vortex_probe1(struct device *gendev,
if (request_region(dev->base_addr, vci->io_size, print_name) != NULL)
vp->must_free_region = 1;
/* enable bus-mastering if necessary */
/* enable bus-mastering if necessary */
if (vci->flags & PCI_USES_MASTER)
pci_set_master(pdev);
@ -1131,7 +1131,7 @@ static int __devinit vortex_probe1(struct device *gendev,
vp->tx_ring_dma = vp->rx_ring_dma + sizeof(struct boom_rx_desc) * RX_RING_SIZE;
/* if we are a PCI driver, we store info in pdev->driver_data
* instead of a module list */
* instead of a module list */
if (pdev)
pci_set_drvdata(pdev, dev);
if (edev)
@ -1393,7 +1393,7 @@ static int __devinit vortex_probe1(struct device *gendev,
dev->tx_timeout = vortex_tx_timeout;
dev->watchdog_timeo = (watchdog * HZ) / 1000;
#ifdef CONFIG_NET_POLL_CONTROLLER
dev->poll_controller = poll_vortex;
dev->poll_controller = poll_vortex;
#endif
if (pdev) {
vp->pm_state_valid = 1;
@ -1875,11 +1875,11 @@ static void vortex_tx_timeout(struct net_device *dev)
vp->stats.tx_dropped++;
netif_wake_queue(dev);
}
/* Issue Tx Enable */
iowrite16(TxEnable, ioaddr + EL3_CMD);
dev->trans_start = jiffies;
/* Switch to register set 7 for normal use. */
EL3WINDOW(7);
}
@ -2316,10 +2316,10 @@ boomerang_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if ((vp->tx_ring[entry].status & DN_COMPLETE) == 0)
break; /* It still hasn't been processed. */
#endif
if (vp->tx_skbuff[entry]) {
struct sk_buff *skb = vp->tx_skbuff[entry];
#if DO_ZEROCOPY
#if DO_ZEROCOPY
int i;
for (i=0; i<=skb_shinfo(skb)->nr_frags; i++)
pci_unmap_single(VORTEX_PCI(vp),
@ -2633,7 +2633,7 @@ vortex_close(struct net_device *dev)
"not using them!\n", dev->name);
}
#endif
free_irq(dev->irq, dev);
if (vp->full_bus_master_rx) { /* Free Boomerang bus master Rx buffers. */
@ -2675,7 +2675,7 @@ dump_tx_ring(struct net_device *dev)
if (vortex_debug > 0) {
struct vortex_private *vp = netdev_priv(dev);
void __iomem *ioaddr = vp->ioaddr;
if (vp->full_bus_master_tx) {
int i;
int stalled = ioread32(ioaddr + PktStatus) & 0x04; /* Possible racy. But it's only debug stuff */
@ -3190,7 +3190,7 @@ static void __exit vortex_eisa_cleanup(void)
/* Take care of the EISA devices */
eisa_driver_unregister(&vortex_eisa_driver);
#endif
if (compaq_net_device) {
vp = compaq_net_device->priv;
ioaddr = ioport_map(compaq_net_device->base_addr,

Просмотреть файл

@ -1,7 +1,7 @@
/*
* 7990.c -- LANCE ethernet IC generic routines.
/*
* 7990.c -- LANCE ethernet IC generic routines.
* This is an attempt to separate out the bits of various ethernet
* drivers that are common because they all use the AMD 7990 LANCE
* drivers that are common because they all use the AMD 7990 LANCE
* (Local Area Network Controller for Ethernet) chip.
*
* Copyright (C) 05/1998 Peter Maydell <pmaydell@chiark.greenend.org.uk>
@ -9,7 +9,7 @@
* Most of this stuff was obtained by looking at other LANCE drivers,
* in particular a2065.[ch]. The AMD C-LANCE datasheet was also helpful.
* NB: this was made easy by the fact that Jes Sorensen had cleaned up
* most of a2025 and sunlance with the aim of merging them, so the
* most of a2025 and sunlance with the aim of merging them, so the
* common code was pretty obvious.
*/
#include <linux/crc32.h>
@ -109,10 +109,10 @@ do { \
ib->btx_ring[t].length,\
ib->btx_ring[t].misc, ib->btx_ring[t].tmd1_bits);\
}\
} while (0)
} while (0)
#else
#define PRINT_RINGS()
#endif
#endif
/* Load the CSR registers. The LANCE has to be STOPped when we do this! */
static void load_csrs (struct lance_private *lp)
@ -157,7 +157,7 @@ static void lance_init_ring (struct net_device *dev)
* a2065 and atarilance do the byteswap and lance.c (PC) doesn't.
* However, the datasheet says that the BSWAP bit doesn't affect
* the init block, so surely it should be low byte first for
* everybody? Um.]
* everybody? Um.]
* We could define the ib->physaddr as three 16bit values and
* use (addr[1] << 8) | addr[0] & co, but this is more efficient.
*/
@ -171,11 +171,11 @@ static void lance_init_ring (struct net_device *dev)
#else
for (i=0; i<6; i++)
ib->phys_addr[i] = dev->dev_addr[i];
#endif
#endif
if (DEBUG_IRING)
printk ("TX rings:\n");
lp->tx_full = 0;
/* Setup the Tx ring entries */
for (i = 0; i < (1<<lp->lance_log_tx_bufs); i++) {
@ -185,7 +185,7 @@ static void lance_init_ring (struct net_device *dev)
ib->btx_ring [i].tmd1_bits = 0;
ib->btx_ring [i].length = 0xf000; /* The ones required by tmd2 */
ib->btx_ring [i].misc = 0;
if (DEBUG_IRING)
if (DEBUG_IRING)
printk ("%d: 0x%8.8x\n", i, leptr);
}
@ -206,14 +206,14 @@ static void lance_init_ring (struct net_device *dev)
}
/* Setup the initialization block */
/* Setup rx descriptor pointer */
leptr = LANCE_ADDR(&aib->brx_ring);
ib->rx_len = (lp->lance_log_rx_bufs << 13) | (leptr >> 16);
ib->rx_ptr = leptr;
if (DEBUG_IRING)
printk ("RX ptr: %8.8x\n", leptr);
/* Setup tx descriptor pointer */
leptr = LANCE_ADDR(&aib->btx_ring);
ib->tx_len = (lp->lance_log_tx_bufs << 13) | (leptr >> 16);
@ -256,7 +256,7 @@ static int lance_reset (struct net_device *dev)
{
struct lance_private *lp = netdev_priv(dev);
int status;
/* Stop the lance */
WRITERAP(lp, LE_CSR0);
WRITERDP(lp, LE_C0_STOP);
@ -297,7 +297,7 @@ static int lance_rx (struct net_device *dev)
#endif
#ifdef CONFIG_HP300
blinken_leds(0x40, 0);
#endif
#endif
WRITERDP(lp, LE_C0_RINT | LE_C0_INEA); /* ack Rx int, reenable ints */
for (rd = &ib->brx_ring [lp->rx_new]; /* For each Rx ring we own... */
!((bits = rd->rmd1_bits) & LE_R1_OWN);
@ -330,7 +330,7 @@ static int lance_rx (struct net_device *dev)
lp->rx_new = (lp->rx_new + 1) & lp->rx_ring_mod_mask;
return 0;
}
skb->dev = dev;
skb_reserve (skb, 2); /* 16 byte align */
skb_put (skb, len); /* make room */
@ -374,10 +374,10 @@ static int lance_tx (struct net_device *dev)
/* 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++;
if (status & LE_T3_LCOL) lp->stats.tx_window_errors++;
@ -429,7 +429,7 @@ static int lance_tx (struct net_device *dev)
lp->stats.tx_packets++;
}
j = (j + 1) & lp->tx_ring_mod_mask;
}
lp->tx_old = j;
@ -450,7 +450,7 @@ lance_interrupt (int irq, void *dev_id, struct pt_regs *regs)
csr0 = READRDP(lp);
PRINT_RINGS();
if (!(csr0 & LE_C0_INTR)) { /* Check if any interrupt has */
spin_unlock (&lp->devlock);
return IRQ_NONE; /* been generated by the Lance. */
@ -476,7 +476,7 @@ lance_interrupt (int irq, void *dev_id, struct pt_regs *regs)
if (csr0 & LE_C0_MISS)
lp->stats.rx_errors++; /* Missed a Rx frame. */
if (csr0 & LE_C0_MERR) {
printk("%s: Bus master arbitration failure, status %4.4x.\n",
printk("%s: Bus master arbitration failure, status %4.4x.\n",
dev->name, csr0);
/* Restart the chip. */
WRITERDP(lp, LE_C0_STRT);
@ -486,7 +486,7 @@ lance_interrupt (int irq, void *dev_id, struct pt_regs *regs)
lp->tx_full = 0;
netif_wake_queue (dev);
}
WRITERAP(lp, LE_CSR0);
WRITERDP(lp, LE_C0_BABL|LE_C0_CERR|LE_C0_MISS|LE_C0_MERR|LE_C0_IDON|LE_C0_INEA);
@ -498,7 +498,7 @@ int lance_open (struct net_device *dev)
{
struct lance_private *lp = netdev_priv(dev);
int res;
/* Install the Interrupt handler. Or we could shunt this out to specific drivers? */
if (request_irq(lp->irq, lance_interrupt, 0, lp->name, dev))
return -EAGAIN;
@ -513,7 +513,7 @@ int lance_open (struct net_device *dev)
int lance_close (struct net_device *dev)
{
struct lance_private *lp = netdev_priv(dev);
netif_stop_queue (dev);
/* Stop the LANCE */
@ -553,7 +553,7 @@ int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
/* dump the packet */
{
int i;
for (i = 0; i < 64; i++) {
if ((i % 16) == 0)
printk ("\n");
@ -565,11 +565,11 @@ int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
entry = lp->tx_new & lp->tx_ring_mod_mask;
ib->btx_ring [entry].length = (-len) | 0xf000;
ib->btx_ring [entry].misc = 0;
if (skb->len < ETH_ZLEN)
memset((char *)&ib->tx_buf[entry][0], 0, ETH_ZLEN);
memcpy ((char *)&ib->tx_buf [entry][0], skb->data, skblen);
/* Now, give the packet to the lance */
ib->btx_ring [entry].tmd1_bits = (LE_T1_POK|LE_T1_OWN);
lp->tx_new = (lp->tx_new+1) & lp->tx_ring_mod_mask;
@ -579,7 +579,7 @@ int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
WRITERDP(lp, LE_C0_INEA | LE_C0_TDMD);
dev->trans_start = jiffies;
dev_kfree_skb (skb);
spin_lock_irqsave (&lp->devlock, flags);
if (TX_BUFFS_AVAIL)
netif_start_queue (dev);
@ -607,9 +607,9 @@ static void lance_load_multicast (struct net_device *dev)
char *addrs;
int i;
u32 crc;
/* set all multicast bits */
if (dev->flags & IFF_ALLMULTI){
if (dev->flags & IFF_ALLMULTI){
ib->filter [0] = 0xffffffff;
ib->filter [1] = 0xffffffff;
return;
@ -626,7 +626,7 @@ static void lance_load_multicast (struct net_device *dev)
/* multicast address? */
if (!(*addrs & 1))
continue;
crc = ether_crc_le(6, addrs);
crc = crc >> 26;
mcast_table [crc >> 4] |= 1 << (crc & 0xf);

Просмотреть файл

@ -1,9 +1,9 @@
/*
/*
* 7990.h -- LANCE ethernet IC generic routines.
* This is an attempt to separate out the bits of various ethernet
* drivers that are common because they all use the AMD 7990 LANCE
* (Local Area Network Controller for Ethernet) chip.
*
*
* Copyright (C) 05/1998 Peter Maydell <pmaydell@chiark.greenend.org.uk>
*
* Most of this stuff was obtained by looking at other LANCE drivers,
@ -55,7 +55,7 @@ struct lance_rx_desc {
*/
volatile unsigned short mblength; /* Actual number of bytes received */
};
/* Ditto for TMD: */
struct lance_tx_desc {
volatile unsigned short tmd0; /* low address of packet */
@ -80,8 +80,8 @@ struct lance_init_block {
volatile unsigned short rx_len; /* receive len and high addr */
volatile unsigned short tx_ptr; /* transmit descriptor addr */
volatile unsigned short tx_len; /* transmit len and high addr */
/* The Tx and Rx ring entries must be aligned on 8-byte boundaries.
/* The Tx and Rx ring entries must be aligned on 8-byte boundaries.
* This will be true if this whole struct is 8-byte aligned.
*/
volatile struct lance_tx_desc btx_ring[TX_RING_SIZE];
@ -104,21 +104,21 @@ struct lance_private
unsigned long base;
volatile struct lance_init_block *init_block; /* CPU address of RAM */
volatile struct lance_init_block *lance_init_block; /* LANCE address of RAM */
int rx_new, tx_new;
int rx_old, tx_old;
int lance_log_rx_bufs, lance_log_tx_bufs;
int rx_ring_mod_mask, tx_ring_mod_mask;
struct net_device_stats stats;
int tpe; /* TPE is selected */
int auto_select; /* cable-selection is by carrier */
unsigned short busmaster_regval;
unsigned int irq; /* IRQ to register */
/* This is because the HP LANCE is disgusting and you have to check
/* This is because the HP LANCE is disgusting and you have to check
* a DIO-specific register every time you read/write the LANCE regs :-<
* [could we get away with making these some sort of macro?]
*/
@ -148,7 +148,7 @@ struct lance_private
#define LE_C0_RINT 0x0400 /* Receive Interrupt */
#define LE_C0_TINT 0x0200 /* Transmit Interrupt */
#define LE_C0_IDON 0x0100 /* Initialization Done */
#define LE_C0_INTR 0x0080 /* Interrupt Flag
#define LE_C0_INTR 0x0080 /* Interrupt Flag
= BABL | MISS | MERR | RINT | TINT | IDON */
#define LE_C0_INEA 0x0040 /* Interrupt Enable */
#define LE_C0_RXON 0x0020 /* Receive On */
@ -185,7 +185,7 @@ struct lance_private
#define LE_MO_PSEL1 0x0100 /* port selection bit1 */
#define LE_MO_PSEL0 0x0080 /* port selection bit0 */
/* and this one is from the C-LANCE data sheet... */
#define LE_MO_EMBA 0x0080 /* Enable Modified Backoff Algorithm
#define LE_MO_EMBA 0x0080 /* Enable Modified Backoff Algorithm
(C-LANCE, not original LANCE) */
#define LE_MO_INTL 0x0040 /* Internal Loopback */
#define LE_MO_DRTY 0x0020 /* Disable Retry */

Просмотреть файл

@ -444,7 +444,7 @@ static inline int wait_cmd(struct net_device *dev, struct i596_private *lp, int
static inline int wait_cfg(struct net_device *dev, struct i596_cmd *cmd, int delcnt, char *str)
{
volatile struct i596_cmd *c = cmd;
while (--delcnt && c->command)
udelay(10);
if (!delcnt) {
@ -455,7 +455,7 @@ static inline int wait_cfg(struct net_device *dev, struct i596_cmd *cmd, int del
return 0;
}
static void i596_display_data(struct net_device *dev)
{
struct i596_private *lp = dev->priv;
@ -787,7 +787,7 @@ static inline int i596_rx(struct net_device *dev)
}
DEB(DEB_RXFRAME, printk(KERN_DEBUG " rfd %p, rfd.rbd %p, rfd.stat %04x\n",
rfd, rfd->rbd, rfd->stat));
if (rbd != I596_NULL && ((rfd->stat) & STAT_OK)) {
/* a good frame */
int pkt_len = rbd->count & 0x3fff;
@ -1208,7 +1208,7 @@ struct net_device * __init i82596_probe(int unit)
Some other boards trip the checksum.. but then appear as
ether address 0. Trap these - AC */
if ((checksum % 0x100) ||
if ((checksum % 0x100) ||
(memcmp(eth_addr, "\x00\x00\x49", 3) != 0)) {
err = -ENODEV;
goto out1;
@ -1545,7 +1545,7 @@ static void set_multicast_list(struct net_device *dev)
printk(KERN_ERR "%s: Only %d multicast addresses supported",
dev->name, cnt);
}
if (dev->mc_count > 0) {
struct dev_mc_list *dmi;
unsigned char *cp;
@ -1609,7 +1609,7 @@ void __exit cleanup_module(void)
}
#endif /* MODULE */
/*
* Local variables:
* compile-command: "gcc -D__KERNEL__ -I/usr/src/linux/net/inet -Wall -Wstrict-prototypes -O6 -m486 -c 82596.c"

Просмотреть файл

@ -1,7 +1,7 @@
/* 8390.c: A general NS8390 ethernet driver core for linux. */
/*
Written 1992-94 by Donald Becker.
Copyright 1993 United States Government as represented by the
Director, National Security Agency.
@ -13,7 +13,7 @@
410 Severn Ave., Suite 210
Annapolis MD 21403
This is the chip-specific code for many 8390-based ethernet adaptors.
This is not a complete driver, it must be combined with board-specific
code such as ne.c, wd.c, 3c503.c, etc.
@ -27,7 +27,7 @@
Changelog:
Paul Gortmaker : remove set_bit lock, other cleanups.
Paul Gortmaker : add ei_get_8390_hdr() so we can pass skb's to
Paul Gortmaker : add ei_get_8390_hdr() so we can pass skb's to
ei_block_input() for eth_io_copy_and_sum().
Paul Gortmaker : exchange static int ei_pingpong for a #define,
also add better Tx error handling.
@ -94,9 +94,9 @@ static const char version[] =
Read the 4 byte, page aligned 8390 header. *If* there is a
subsequent read, it will be of the rest of the packet.
void block_input(struct net_device *dev, int count, struct sk_buff *skb, int ring_offset)
Read COUNT bytes from the packet buffer into the skb data area. Start
Read COUNT bytes from the packet buffer into the skb data area. Start
reading from RING_OFFSET, the address as the 8390 sees it. This will always
follow the read of the 8390 header.
follow the read of the 8390 header.
*/
#define ei_reset_8390 (ei_local->reset_8390)
#define ei_block_output (ei_local->block_output)
@ -128,7 +128,7 @@ static void do_set_multicast_list(struct net_device *dev);
* a page register that controls bank and packet buffer access. We guard
* this with ei_local->page_lock. Nobody should assume or set the page other
* than zero when the lock is not held. Lock holders must restore page 0
* before unlocking. Even pure readers must take the lock to protect in
* before unlocking. Even pure readers must take the lock to protect in
* page 0.
*
* To make life difficult the chip can also be very slow. We therefore can't
@ -141,14 +141,14 @@ static void do_set_multicast_list(struct net_device *dev);
* a latency on SMP irq delivery. So we can easily go "disable irq" "sync irqs"
* enter lock, take the queued irq. So we waddle instead of flying.
*
* Finally by special arrangement for the purpose of being generally
* Finally by special arrangement for the purpose of being generally
* annoying the transmit function is called bh atomic. That places
* restrictions on the user context callers as disable_irq won't save
* them.
*/
/**
* ei_open - Open/initialize the board.
* @dev: network device to initialize
@ -168,12 +168,12 @@ int ei_open(struct net_device *dev)
dev->tx_timeout = ei_tx_timeout;
if (dev->watchdog_timeo <= 0)
dev->watchdog_timeo = TX_TIMEOUT;
/*
* Grab the page lock so we own the register set, then call
* the init function.
*/
spin_lock_irqsave(&ei_local->page_lock, flags);
NS8390_init(dev, 1);
/* Set the flag before we drop the lock, That way the IRQ arrives
@ -198,7 +198,7 @@ int ei_close(struct net_device *dev)
/*
* Hold the page lock during close
*/
spin_lock_irqsave(&ei_local->page_lock, flags);
NS8390_init(dev, 0);
spin_unlock_irqrestore(&ei_local->page_lock, flags);
@ -241,26 +241,26 @@ void ei_tx_timeout(struct net_device *dev)
dev->name, (txsr & ENTSR_ABT) ? "excess collisions." :
(isr) ? "lost interrupt?" : "cable problem?", txsr, isr, tickssofar);
if (!isr && !ei_local->stat.tx_packets)
if (!isr && !ei_local->stat.tx_packets)
{
/* The 8390 probably hasn't gotten on the cable yet. */
ei_local->interface_num ^= 1; /* Try a different xcvr. */
}
/* Ugly but a reset can be slow, yet must be protected */
disable_irq_nosync_lockdep(dev->irq);
spin_lock(&ei_local->page_lock);
/* Try to restart the card. Perhaps the user has fixed something. */
ei_reset_8390(dev);
NS8390_init(dev, 1);
spin_unlock(&ei_local->page_lock);
enable_irq_lockdep(dev->irq);
netif_wake_queue(dev);
}
/**
* ei_start_xmit - begin packet transmission
* @skb: packet to be sent
@ -268,7 +268,7 @@ void ei_tx_timeout(struct net_device *dev)
*
* Sends a packet to an 8390 network device.
*/
static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
long e8390_base = dev->base_addr;
@ -285,24 +285,24 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
data = buf;
}
/* Mask interrupts from the ethercard.
/* Mask interrupts from the ethercard.
SMP: We have to grab the lock here otherwise the IRQ handler
on another CPU can flip window and race the IRQ mask set. We end
up trashing the mcast filter not disabling irqs if we don't lock */
spin_lock_irqsave(&ei_local->page_lock, flags);
outb_p(0x00, e8390_base + EN0_IMR);
spin_unlock_irqrestore(&ei_local->page_lock, flags);
/*
* Slow phase with lock held.
*/
disable_irq_nosync_lockdep(dev->irq);
spin_lock(&ei_local->page_lock);
ei_local->irqlock = 1;
/*
@ -313,7 +313,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
* card, leaving a substantial gap between each transmitted packet.
*/
if (ei_local->tx1 == 0)
if (ei_local->tx1 == 0)
{
output_page = ei_local->tx_start_page;
ei_local->tx1 = send_length;
@ -321,7 +321,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
printk(KERN_DEBUG "%s: idle transmitter tx2=%d, lasttx=%d, txing=%d.\n",
dev->name, ei_local->tx2, ei_local->lasttx, ei_local->txing);
}
else if (ei_local->tx2 == 0)
else if (ei_local->tx2 == 0)
{
output_page = ei_local->tx_start_page + TX_PAGES/2;
ei_local->tx2 = send_length;
@ -348,20 +348,20 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
* isn't already sending. If it is busy, the interrupt handler will
* trigger the send later, upon receiving a Tx done interrupt.
*/
ei_block_output(dev, send_length, data, output_page);
if (! ei_local->txing)
if (! ei_local->txing)
{
ei_local->txing = 1;
NS8390_trigger_send(dev, send_length, output_page);
dev->trans_start = jiffies;
if (output_page == ei_local->tx_start_page)
if (output_page == ei_local->tx_start_page)
{
ei_local->tx1 = -1;
ei_local->lasttx = -1;
}
else
else
{
ei_local->tx2 = -1;
ei_local->lasttx = -2;
@ -377,16 +377,16 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
/* Turn 8390 interrupts back on. */
ei_local->irqlock = 0;
outb_p(ENISR_ALL, e8390_base + EN0_IMR);
spin_unlock(&ei_local->page_lock);
enable_irq_lockdep(dev->irq);
dev_kfree_skb (skb);
ei_local->stat.tx_bytes += send_length;
return 0;
}
/**
* ei_interrupt - handle the interrupts from an 8390
* @irq: interrupt number
@ -406,23 +406,23 @@ irqreturn_t ei_interrupt(int irq, void *dev_id, struct pt_regs * regs)
long e8390_base;
int interrupts, nr_serviced = 0;
struct ei_device *ei_local;
if (dev == NULL)
if (dev == NULL)
{
printk ("net_interrupt(): irq %d for unknown device.\n", irq);
return IRQ_NONE;
}
e8390_base = dev->base_addr;
ei_local = (struct ei_device *) netdev_priv(dev);
/*
* Protect the irq test too.
*/
spin_lock(&ei_local->page_lock);
if (ei_local->irqlock)
if (ei_local->irqlock)
{
#if 1 /* This might just be an interrupt for a PCI device sharing this line */
/* The "irqlock" check is only for testing. */
@ -435,16 +435,16 @@ irqreturn_t ei_interrupt(int irq, void *dev_id, struct pt_regs * regs)
spin_unlock(&ei_local->page_lock);
return IRQ_NONE;
}
/* Change to page 0 and read the intr status reg. */
outb_p(E8390_NODMA+E8390_PAGE0, e8390_base + E8390_CMD);
if (ei_debug > 3)
printk(KERN_DEBUG "%s: interrupt(isr=%#2.2x).\n", dev->name,
inb_p(e8390_base + EN0_ISR));
/* !!Assumption!! -- we stay in page 0. Don't break this. */
while ((interrupts = inb_p(e8390_base + EN0_ISR)) != 0
&& ++nr_serviced < MAX_SERVICE)
&& ++nr_serviced < MAX_SERVICE)
{
if (!netif_running(dev)) {
printk(KERN_WARNING "%s: interrupt from stopped card\n", dev->name);
@ -453,9 +453,9 @@ irqreturn_t ei_interrupt(int irq, void *dev_id, struct pt_regs * regs)
interrupts = 0;
break;
}
if (interrupts & ENISR_OVER)
if (interrupts & ENISR_OVER)
ei_rx_overrun(dev);
else if (interrupts & (ENISR_RX+ENISR_RX_ERR))
else if (interrupts & (ENISR_RX+ENISR_RX_ERR))
{
/* Got a good (?) packet. */
ei_receive(dev);
@ -466,27 +466,27 @@ irqreturn_t ei_interrupt(int irq, void *dev_id, struct pt_regs * regs)
else if (interrupts & ENISR_TX_ERR)
ei_tx_err(dev);
if (interrupts & ENISR_COUNTERS)
if (interrupts & ENISR_COUNTERS)
{
ei_local->stat.rx_frame_errors += inb_p(e8390_base + EN0_COUNTER0);
ei_local->stat.rx_crc_errors += inb_p(e8390_base + EN0_COUNTER1);
ei_local->stat.rx_missed_errors+= inb_p(e8390_base + EN0_COUNTER2);
outb_p(ENISR_COUNTERS, e8390_base + EN0_ISR); /* Ack intr. */
}
/* Ignore any RDC interrupts that make it back to here. */
if (interrupts & ENISR_RDC)
if (interrupts & ENISR_RDC)
{
outb_p(ENISR_RDC, e8390_base + EN0_ISR);
}
outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, e8390_base + E8390_CMD);
}
if (interrupts && ei_debug)
if (interrupts && ei_debug)
{
outb_p(E8390_NODMA+E8390_PAGE0+E8390_START, e8390_base + E8390_CMD);
if (nr_serviced >= MAX_SERVICE)
if (nr_serviced >= MAX_SERVICE)
{
/* 0xFF is valid for a card removal */
if(interrupts!=0xFF)
@ -551,7 +551,7 @@ static void ei_tx_err(struct net_device *dev)
if (tx_was_aborted)
ei_tx_intr(dev);
else
else
{
ei_local->stat.tx_errors++;
if (txsr & ENTSR_CRS) ei_local->stat.tx_carrier_errors++;
@ -573,7 +573,7 @@ static void ei_tx_intr(struct net_device *dev)
long e8390_base = dev->base_addr;
struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
int status = inb(e8390_base + EN0_TSR);
outb_p(ENISR_TX, e8390_base + EN0_ISR); /* Ack intr. */
/*
@ -582,13 +582,13 @@ static void ei_tx_intr(struct net_device *dev)
*/
ei_local->txqueue--;
if (ei_local->tx1 < 0)
if (ei_local->tx1 < 0)
{
if (ei_local->lasttx != 1 && ei_local->lasttx != -1)
printk(KERN_ERR "%s: bogus last_tx_buffer %d, tx1=%d.\n",
ei_local->name, ei_local->lasttx, ei_local->tx1);
ei_local->tx1 = 0;
if (ei_local->tx2 > 0)
if (ei_local->tx2 > 0)
{
ei_local->txing = 1;
NS8390_trigger_send(dev, ei_local->tx2, ei_local->tx_start_page + 6);
@ -596,15 +596,15 @@ static void ei_tx_intr(struct net_device *dev)
ei_local->tx2 = -1,
ei_local->lasttx = 2;
}
else ei_local->lasttx = 20, ei_local->txing = 0;
else ei_local->lasttx = 20, ei_local->txing = 0;
}
else if (ei_local->tx2 < 0)
else if (ei_local->tx2 < 0)
{
if (ei_local->lasttx != 2 && ei_local->lasttx != -2)
printk("%s: bogus last_tx_buffer %d, tx2=%d.\n",
ei_local->name, ei_local->lasttx, ei_local->tx2);
ei_local->tx2 = 0;
if (ei_local->tx1 > 0)
if (ei_local->tx1 > 0)
{
ei_local->txing = 1;
NS8390_trigger_send(dev, ei_local->tx1, ei_local->tx_start_page);
@ -623,17 +623,17 @@ static void ei_tx_intr(struct net_device *dev)
ei_local->stat.collisions++;
if (status & ENTSR_PTX)
ei_local->stat.tx_packets++;
else
else
{
ei_local->stat.tx_errors++;
if (status & ENTSR_ABT)
if (status & ENTSR_ABT)
{
ei_local->stat.tx_aborted_errors++;
ei_local->stat.collisions += 16;
}
if (status & ENTSR_CRS)
if (status & ENTSR_CRS)
ei_local->stat.tx_carrier_errors++;
if (status & ENTSR_FU)
if (status & ENTSR_FU)
ei_local->stat.tx_fifo_errors++;
if (status & ENTSR_CDH)
ei_local->stat.tx_heartbeat_errors++;
@ -647,7 +647,7 @@ static void ei_tx_intr(struct net_device *dev)
* ei_receive - receive some packets
* @dev: network device with which receive will be run
*
* We have a good packet(s), get it/them out of the buffers.
* We have a good packet(s), get it/them out of the buffers.
* Called with lock held.
*/
@ -660,42 +660,42 @@ static void ei_receive(struct net_device *dev)
int rx_pkt_count = 0;
struct e8390_pkt_hdr rx_frame;
int num_rx_pages = ei_local->stop_page-ei_local->rx_start_page;
while (++rx_pkt_count < 10)
while (++rx_pkt_count < 10)
{
int pkt_len, pkt_stat;
/* Get the rx page (incoming packet pointer). */
outb_p(E8390_NODMA+E8390_PAGE1, e8390_base + E8390_CMD);
rxing_page = inb_p(e8390_base + EN1_CURPAG);
outb_p(E8390_NODMA+E8390_PAGE0, e8390_base + E8390_CMD);
/* Remove one frame from the ring. Boundary is always a page behind. */
this_frame = inb_p(e8390_base + EN0_BOUNDARY) + 1;
if (this_frame >= ei_local->stop_page)
this_frame = ei_local->rx_start_page;
/* Someday we'll omit the previous, iff we never get this message.
(There is at least one clone claimed to have a problem.)
(There is at least one clone claimed to have a problem.)
Keep quiet if it looks like a card removal. One problem here
is that some clones crash in roughly the same way.
*/
if (ei_debug > 0 && this_frame != ei_local->current_page && (this_frame!=0x0 || rxing_page!=0xFF))
printk(KERN_ERR "%s: mismatched read page pointers %2x vs %2x.\n",
dev->name, this_frame, ei_local->current_page);
if (this_frame == rxing_page) /* Read all the frames? */
break; /* Done for now */
current_offset = this_frame << 8;
ei_get_8390_hdr(dev, &rx_frame, this_frame);
pkt_len = rx_frame.count - sizeof(struct e8390_pkt_hdr);
pkt_stat = rx_frame.status;
next_frame = this_frame + 1 + ((pkt_len+4)>>8);
/* Check for bogosity warned by 3c503 book: the status byte is never
written. This happened a lot during testing! This code should be
cleaned up someday. */
@ -709,7 +709,7 @@ static void ei_receive(struct net_device *dev)
continue;
}
if (pkt_len < 60 || pkt_len > 1518)
if (pkt_len < 60 || pkt_len > 1518)
{
if (ei_debug)
printk(KERN_DEBUG "%s: bogus packet size: %d, status=%#2x nxpg=%#2x.\n",
@ -718,12 +718,12 @@ static void ei_receive(struct net_device *dev)
ei_local->stat.rx_errors++;
ei_local->stat.rx_length_errors++;
}
else if ((pkt_stat & 0x0F) == ENRSR_RXOK)
else if ((pkt_stat & 0x0F) == ENRSR_RXOK)
{
struct sk_buff *skb;
skb = dev_alloc_skb(pkt_len+2);
if (skb == NULL)
if (skb == NULL)
{
if (ei_debug > 1)
printk(KERN_DEBUG "%s: Couldn't allocate a sk_buff of size %d.\n",
@ -745,8 +745,8 @@ static void ei_receive(struct net_device *dev)
if (pkt_stat & ENRSR_PHY)
ei_local->stat.multicast++;
}
}
else
}
else
{
if (ei_debug)
printk(KERN_DEBUG "%s: bogus packet: status=%#2x nxpg=%#2x size=%d\n",
@ -758,7 +758,7 @@ static void ei_receive(struct net_device *dev)
ei_local->stat.rx_fifo_errors++;
}
next_frame = rx_frame.next;
/* This _should_ never happen: it's here for avoiding bad clones. */
if (next_frame >= ei_local->stop_page) {
printk("%s: next frame inconsistency, %#2x\n", dev->name,
@ -785,7 +785,7 @@ static void ei_receive(struct net_device *dev)
* This includes causing "the NIC to defer indefinitely when it is stopped
* on a busy network." Ugh.
* Called with lock held. Don't call this with the interrupts off or your
* computer will hate you - it takes 10ms or so.
* computer will hate you - it takes 10ms or so.
*/
static void ei_rx_overrun(struct net_device *dev)
@ -793,19 +793,19 @@ static void ei_rx_overrun(struct net_device *dev)
long e8390_base = dev->base_addr;
unsigned char was_txing, must_resend = 0;
struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
/*
* Record whether a Tx was in progress and then issue the
* stop command.
*/
was_txing = inb_p(e8390_base+E8390_CMD) & E8390_TRANS;
outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, e8390_base+E8390_CMD);
if (ei_debug > 1)
printk(KERN_DEBUG "%s: Receiver overrun.\n", dev->name);
ei_local->stat.rx_over_errors++;
/*
/*
* Wait a full Tx time (1.2ms) + some guard time, NS says 1.6ms total.
* Early datasheets said to poll the reset bit, but now they say that
* it "is not a reliable indicator and subsequently should be ignored."
@ -826,7 +826,7 @@ static void ei_rx_overrun(struct net_device *dev)
*/
if (was_txing)
{
{
unsigned char tx_completed = inb_p(e8390_base+EN0_ISR) & (ENISR_TX+ENISR_TX_ERR);
if (!tx_completed)
must_resend = 1;
@ -848,7 +848,7 @@ static void ei_rx_overrun(struct net_device *dev)
/*
* Leave loopback mode, and resend any packet that got stopped.
*/
outb_p(E8390_TXCONFIG, e8390_base + EN0_TXCR);
outb_p(E8390_TXCONFIG, e8390_base + EN0_TXCR);
if (must_resend)
outb_p(E8390_NODMA + E8390_PAGE0 + E8390_START + E8390_TRANS, e8390_base + E8390_CMD);
}
@ -856,13 +856,13 @@ static void ei_rx_overrun(struct net_device *dev)
/*
* Collect the stats. This is called unlocked and from several contexts.
*/
static struct net_device_stats *get_stats(struct net_device *dev)
{
long ioaddr = dev->base_addr;
struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
unsigned long flags;
/* If the card is stopped, just return the present stats. */
if (!netif_running(dev))
return &ei_local->stat;
@ -873,7 +873,7 @@ static struct net_device_stats *get_stats(struct net_device *dev)
ei_local->stat.rx_crc_errors += inb_p(ioaddr + EN0_COUNTER1);
ei_local->stat.rx_missed_errors+= inb_p(ioaddr + EN0_COUNTER2);
spin_unlock_irqrestore(&ei_local->page_lock, flags);
return &ei_local->stat;
}
@ -881,21 +881,21 @@ static struct net_device_stats *get_stats(struct net_device *dev)
* Form the 64 bit 8390 multicast table from the linked list of addresses
* associated with this dev structure.
*/
static inline void make_mc_bits(u8 *bits, struct net_device *dev)
{
struct dev_mc_list *dmi;
for (dmi=dev->mc_list; dmi; dmi=dmi->next)
for (dmi=dev->mc_list; dmi; dmi=dmi->next)
{
u32 crc;
if (dmi->dmi_addrlen != ETH_ALEN)
if (dmi->dmi_addrlen != ETH_ALEN)
{
printk(KERN_INFO "%s: invalid multicast address length given.\n", dev->name);
continue;
}
crc = ether_crc(ETH_ALEN, dmi->dmi_addr);
/*
/*
* The 8390 uses the 6 most significant bits of the
* CRC to index the multicast table.
*/
@ -908,16 +908,16 @@ static inline void make_mc_bits(u8 *bits, struct net_device *dev)
* @dev: net device for which multicast filter is adjusted
*
* Set or clear the multicast filter for this adaptor. May be called
* from a BH in 2.1.x. Must be called with lock held.
* from a BH in 2.1.x. Must be called with lock held.
*/
static void do_set_multicast_list(struct net_device *dev)
{
long e8390_base = dev->base_addr;
int i;
struct ei_device *ei_local = (struct ei_device*)netdev_priv(dev);
if (!(dev->flags&(IFF_PROMISC|IFF_ALLMULTI)))
if (!(dev->flags&(IFF_PROMISC|IFF_ALLMULTI)))
{
memset(ei_local->mcfilter, 0, 8);
if (dev->mc_list)
@ -926,23 +926,23 @@ static void do_set_multicast_list(struct net_device *dev)
else
memset(ei_local->mcfilter, 0xFF, 8); /* mcast set to accept-all */
/*
/*
* DP8390 manuals don't specify any magic sequence for altering
* the multicast regs on an already running card. To be safe, we
* ensure multicast mode is off prior to loading up the new hash
* table. If this proves to be not enough, we can always resort
* to stopping the NIC, loading the table and then restarting.
*
* Bug Alert! The MC regs on the SMC 83C690 (SMC Elite and SMC
* Bug Alert! The MC regs on the SMC 83C690 (SMC Elite and SMC
* Elite16) appear to be write-only. The NS 8390 data sheet lists
* them as r/w so this is a bug. The SMC 83C790 (SMC Ultra and
* Ultra32 EISA) appears to have this bug fixed.
*/
if (netif_running(dev))
outb_p(E8390_RXCONFIG, e8390_base + EN0_RXCR);
outb_p(E8390_NODMA + E8390_PAGE1, e8390_base + E8390_CMD);
for(i = 0; i < 8; i++)
for(i = 0; i < 8; i++)
{
outb_p(ei_local->mcfilter[i], e8390_base + EN1_MULT_SHIFT(i));
#ifndef BUG_83C690
@ -965,16 +965,16 @@ static void do_set_multicast_list(struct net_device *dev)
* be parallel to just about everything else. Its also fairly quick and
* not called too often. Must protect against both bh and irq users
*/
static void set_multicast_list(struct net_device *dev)
{
unsigned long flags;
struct ei_device *ei_local = (struct ei_device*)netdev_priv(dev);
spin_lock_irqsave(&ei_local->page_lock, flags);
do_set_multicast_list(dev);
spin_unlock_irqrestore(&ei_local->page_lock, flags);
}
}
/**
* ethdev_setup - init rest of 8390 device struct
@ -989,7 +989,7 @@ static void ethdev_setup(struct net_device *dev)
struct ei_device *ei_local = (struct ei_device *) netdev_priv(dev);
if (ei_debug > 1)
printk(version);
dev->hard_start_xmit = &ei_start_xmit;
dev->get_stats = get_stats;
dev->set_multicast_list = &set_multicast_list;
@ -1011,7 +1011,7 @@ struct net_device *__alloc_ei_netdev(int size)
ethdev_setup);
}
/* This page of functions should be 8390 generic */
@ -1033,9 +1033,9 @@ void NS8390_init(struct net_device *dev, int startp)
int endcfg = ei_local->word16
? (0x48 | ENDCFG_WTS | (ei_local->bigendian ? ENDCFG_BOS : 0))
: 0x48;
if(sizeof(struct e8390_pkt_hdr)!=4)
panic("8390.c: header struct mispacked\n");
panic("8390.c: header struct mispacked\n");
/* Follow National Semi's recommendations for initing the DP83902. */
outb_p(E8390_NODMA+E8390_PAGE0+E8390_STOP, e8390_base+E8390_CMD); /* 0x21 */
outb_p(endcfg, e8390_base + EN0_DCFG); /* 0x48 or 0x49 */
@ -1055,11 +1055,11 @@ void NS8390_init(struct net_device *dev, int startp)
/* Clear the pending interrupts and mask. */
outb_p(0xFF, e8390_base + EN0_ISR);
outb_p(0x00, e8390_base + EN0_IMR);
/* Copy the station address into the DS8390 registers. */
outb_p(E8390_NODMA + E8390_PAGE1 + E8390_STOP, e8390_base+E8390_CMD); /* 0x61 */
for(i = 0; i < 6; i++)
for(i = 0; i < 6; i++)
{
outb_p(dev->dev_addr[i], e8390_base + EN1_PHYS_SHIFT(i));
if (ei_debug > 1 && inb_p(e8390_base + EN1_PHYS_SHIFT(i))!=dev->dev_addr[i])
@ -1073,7 +1073,7 @@ void NS8390_init(struct net_device *dev, int startp)
ei_local->tx1 = ei_local->tx2 = 0;
ei_local->txing = 0;
if (startp)
if (startp)
{
outb_p(0xff, e8390_base + EN0_ISR);
outb_p(ENISR_ALL, e8390_base + EN0_IMR);
@ -1085,18 +1085,18 @@ void NS8390_init(struct net_device *dev, int startp)
}
}
/* Trigger a transmit start, assuming the length is valid.
/* Trigger a transmit start, assuming the length is valid.
Always called with the page lock held */
static void NS8390_trigger_send(struct net_device *dev, unsigned int length,
int start_page)
{
long e8390_base = dev->base_addr;
struct ei_device *ei_local __attribute((unused)) = (struct ei_device *) netdev_priv(dev);
outb_p(E8390_NODMA+E8390_PAGE0, e8390_base+E8390_CMD);
if (inb_p(e8390_base + E8390_CMD) & E8390_TRANS)
if (inb_p(e8390_base + E8390_CMD) & E8390_TRANS)
{
printk(KERN_WARNING "%s: trigger_send() called with the transmitter busy.\n",
dev->name);

Просмотреть файл

@ -106,7 +106,7 @@ struct ei_device {
* Only generate indirect loads given a machine that needs them.
* - removed AMIGA_PCMCIA from this list, handled as ISA io now
*/
#if defined(CONFIG_MAC) || \
defined(CONFIG_ZORRO8390) || defined(CONFIG_ZORRO8390_MODULE) || \
defined(CONFIG_HYDRA) || defined(CONFIG_HYDRA_MODULE)

Просмотреть файл

@ -18,7 +18,7 @@
* - struct init cleanup, enable multiple ISA autoprobes.
* Arnaldo Carvalho de Melo <acme@conectiva.com.br> - 09/1999
* - fix sbni: s/device/net_device/
* Paul Gortmaker (06/98):
* Paul Gortmaker (06/98):
* - sort probes in a sane way, make sure all (safe) probes
* get run once & failed autoprobes don't autoprobe again.
*
@ -91,7 +91,7 @@ extern struct net_device *mac89x0_probe(int unit);
extern struct net_device *mc32_probe(int unit);
extern struct net_device *cops_probe(int unit);
extern struct net_device *ltpc_probe(void);
/* Detachable devices ("pocket adaptors") */
extern struct net_device *de620_probe(int unit);
@ -129,10 +129,10 @@ static int __init probe_list2(int unit, struct devprobe2 *p, int autoprobe)
*/
static struct devprobe2 eisa_probes[] __initdata = {
#ifdef CONFIG_ULTRA32
{ultra32_probe, 0},
#ifdef CONFIG_ULTRA32
{ultra32_probe, 0},
#endif
#ifdef CONFIG_AC3200
#ifdef CONFIG_AC3200
{ac3200_probe, 0},
#endif
#ifdef CONFIG_ES3210
@ -167,14 +167,14 @@ static struct devprobe2 mca_probes[] __initdata = {
static struct devprobe2 isa_probes[] __initdata = {
#ifdef CONFIG_HP100 /* ISA, EISA & PCI */
{hp100_probe, 0},
#endif
#endif
#ifdef CONFIG_3C515
{tc515_probe, 0},
#endif
#ifdef CONFIG_ULTRA
#ifdef CONFIG_ULTRA
{ultra_probe, 0},
#endif
#ifdef CONFIG_WD80x3
#ifdef CONFIG_WD80x3
{wd_probe, 0},
#endif
#ifdef CONFIG_EL2 /* 3c503 */
@ -199,7 +199,7 @@ static struct devprobe2 isa_probes[] __initdata = {
#ifdef CONFIG_SMC9194
{smc_init, 0},
#endif
#ifdef CONFIG_SEEQ8005
#ifdef CONFIG_SEEQ8005
{seeq8005_probe, 0},
#endif
#ifdef CONFIG_CS89x0
@ -295,7 +295,7 @@ static struct devprobe2 m68k_probes[] __initdata = {
* Unified ethernet device probe, segmented per architecture and
* per bus interface. This drives the legacy devices only for now.
*/
static void __init ethif_probe2(int unit)
{
unsigned long base_addr = netdev_boot_base("eth", unit);
@ -349,7 +349,7 @@ static void __init trif_probe2(int unit)
}
#endif
/*
* The loopback device is global so it can be directly referenced
* by the network code. Also, it must be first on device list.
@ -365,7 +365,7 @@ static int __init net_olddevs_init(void)
printk(KERN_ERR "Network loopback device setup failed\n");
}
#ifdef CONFIG_SBNI
for (num = 0; num < 8; ++num)
sbni_probe(num);

Просмотреть файл

@ -93,7 +93,7 @@ struct lance_init_block {
unsigned short rx_len; /* receive len and high addr */
unsigned short tx_ptr; /* transmit descriptor addr */
unsigned short tx_len; /* transmit len and high addr */
/* The Tx and Rx ring entries must aligned on 8-byte boundaries. */
struct lance_rx_desc brx_ring[RX_RING_SIZE];
struct lance_tx_desc btx_ring[TX_RING_SIZE];
@ -115,7 +115,7 @@ struct lance_private {
int rx_new, tx_new;
int rx_old, tx_old;
int lance_log_rx_bufs, lance_log_tx_bufs;
int rx_ring_mod_mask, tx_ring_mod_mask;
@ -190,7 +190,7 @@ static void lance_init_ring (struct net_device *dev)
if (ZERO)
printk(KERN_DEBUG "TX rings:\n");
/* Setup the Tx ring entries */
for (i = 0; i <= (1<<lp->lance_log_tx_bufs); i++) {
leptr = LANCE_ADDR(&aib->tx_buf[i][0]);
@ -219,14 +219,14 @@ static void lance_init_ring (struct net_device *dev)
}
/* Setup the initialization block */
/* Setup rx descriptor pointer */
leptr = LANCE_ADDR(&aib->brx_ring);
ib->rx_len = (lp->lance_log_rx_bufs << 13) | (leptr >> 16);
ib->rx_ptr = leptr;
if (ZERO)
printk(KERN_DEBUG "RX ptr: %8.8x\n", leptr);
/* Setup tx descriptor pointer */
leptr = LANCE_ADDR(&aib->btx_ring);
ib->tx_len = (lp->lance_log_tx_bufs << 13) | (leptr >> 16);
@ -286,7 +286,7 @@ static int lance_rx (struct net_device *dev)
}
printk ("]\n");
#endif
ll->rdp = LE_C0_RINT|LE_C0_INEA;
for (rd = &ib->brx_ring [lp->rx_new];
!((bits = rd->rmd1_bits) & LE_R1_OWN);
@ -319,7 +319,7 @@ static int lance_rx (struct net_device *dev)
lp->rx_new = (lp->rx_new + 1) & lp->rx_ring_mod_mask;
return 0;
}
skb->dev = dev;
skb_reserve (skb, 2); /* 16 byte align */
skb_put (skb, len); /* make room */
@ -361,10 +361,10 @@ static int lance_tx (struct net_device *dev)
/* 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++;
if (status & LE_T3_LCOL) lp->stats.tx_window_errors++;
@ -417,7 +417,7 @@ static int lance_tx (struct net_device *dev)
lp->stats.tx_packets++;
}
j = (j + 1) & lp->tx_ring_mod_mask;
}
lp->tx_old = j;
@ -452,7 +452,7 @@ lance_interrupt (int irq, void *dev_id, struct pt_regs *regs)
/* Clear the error condition */
ll->rdp = LE_C0_BABL|LE_C0_ERR|LE_C0_MISS|LE_C0_INEA;
}
if (csr0 & LE_C0_RINT)
lance_rx (dev);
@ -528,7 +528,7 @@ static inline int lance_reset (struct net_device *dev)
struct lance_private *lp = netdev_priv(dev);
volatile struct lance_regs *ll = lp->ll;
int status;
/* Stop the lance */
ll->rap = LE_CSR0;
ll->rdp = LE_C0_STOP;
@ -569,7 +569,7 @@ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
skblen = skb->len;
len = skblen;
if (len < ETH_ZLEN) {
len = ETH_ZLEN;
if (skb_padto(skb, ETH_ZLEN))
@ -587,7 +587,7 @@ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
/* dump the packet */
{
int i;
for (i = 0; i < 64; i++) {
if ((i % 16) == 0)
printk("\n" KERN_DEBUG);
@ -599,13 +599,13 @@ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
entry = lp->tx_new & lp->tx_ring_mod_mask;
ib->btx_ring [entry].length = (-len) | 0xf000;
ib->btx_ring [entry].misc = 0;
memcpy ((char *)&ib->tx_buf [entry][0], skb->data, skblen);
/* Clear the slack of the packet, do I need this? */
if (len != skblen)
memset ((char *) &ib->tx_buf [entry][skblen], 0, len - skblen);
/* Now, give the packet to the lance */
ib->btx_ring [entry].tmd1_bits = (LE_T1_POK|LE_T1_OWN);
lp->tx_new = (lp->tx_new+1) & lp->tx_ring_mod_mask;
@ -619,7 +619,7 @@ static int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
ll->rdp = LE_C0_INEA | LE_C0_TDMD;
dev->trans_start = jiffies;
dev_kfree_skb (skb);
local_irq_restore(flags);
return status;
@ -642,9 +642,9 @@ static void lance_load_multicast (struct net_device *dev)
char *addrs;
int i;
u32 crc;
/* set all multicast bits */
if (dev->flags & IFF_ALLMULTI){
if (dev->flags & IFF_ALLMULTI){
ib->filter [0] = 0xffffffff;
ib->filter [1] = 0xffffffff;
return;
@ -661,7 +661,7 @@ static void lance_load_multicast (struct net_device *dev)
/* multicast address? */
if (!(*addrs & 1))
continue;
crc = ether_crc_le(6, addrs);
crc = crc >> 26;
mcast_table [crc >> 4] |= 1 << (crc & 0xf);

Просмотреть файл

@ -109,7 +109,7 @@ struct lance_rx_desc {
*/
unsigned short mblength; /* Aactual number of bytes received */
};
struct lance_tx_desc {
unsigned short tmd0; /* low address of packet */
unsigned char tmd1_bits; /* descriptor bits */
@ -117,7 +117,7 @@ struct lance_tx_desc {
short length; /* Length is 2s complement (negative)! */
unsigned short misc;
};
/*
* Receive Flags

Просмотреть файл

@ -45,7 +45,7 @@ static const char version[] =
#define AC_NIC_BASE 0x00
#define AC_SA_PROM 0x16 /* The station address PROM. */
#define AC_ADDR0 0x00 /* Prefix station address values. */
#define AC_ADDR1 0x40
#define AC_ADDR1 0x40
#define AC_ADDR2 0x90
#define AC_ID_PORT 0xC80
#define AC_EISA_ID 0x0110d305
@ -89,7 +89,7 @@ static void ac_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr,
int ring_page);
static int ac_close_card(struct net_device *dev);
/* Probe for the AC3200.
@ -217,7 +217,7 @@ static int __init ac_probe1(int ioaddr, struct net_device *dev)
dev->if_port = inb(ioaddr + AC_CONFIG) >> 6;
dev->mem_start = config2mem(inb(ioaddr + AC_CONFIG));
printk("%s: AC3200 at %#3x with %dkB memory at physical address %#lx.\n",
printk("%s: AC3200 at %#3x with %dkB memory at physical address %#lx.\n",
dev->name, ioaddr, AC_STOP_PG/4, dev->mem_start);
/*

Просмотреть файл

@ -99,7 +99,7 @@
#endif
#ifndef PCI_VENDOR_ID_ALTEON
#define PCI_VENDOR_ID_ALTEON 0x12ae
#define PCI_VENDOR_ID_ALTEON 0x12ae
#endif
#ifndef PCI_DEVICE_ID_ALTEON_ACENIC_FIBRE
#define PCI_DEVICE_ID_ALTEON_ACENIC_FIBRE 0x0001
@ -443,7 +443,7 @@ MODULE_PARM_DESC(max_rx_desc, "AceNIC/3C985/GA620 max number of receive descript
MODULE_PARM_DESC(tx_ratio, "AceNIC/3C985/GA620 ratio of NIC memory used for TX/RX descriptors (range 0-63)");
static char version[] __devinitdata =
static char version[] __devinitdata =
"acenic.c: v0.92 08/05/2002 Jes Sorensen, linux-acenic@SunSITE.dk\n"
" http://home.cern.ch/~jes/gige/acenic.html\n";
@ -516,7 +516,7 @@ static int __devinit acenic_probe_one(struct pci_dev *pdev,
pci_read_config_word(pdev, PCI_COMMAND, &ap->pci_command);
/* OpenFirmware on Mac's does not set this - DOH.. */
/* OpenFirmware on Mac's does not set this - DOH.. */
if (!(ap->pci_command & PCI_COMMAND_MEMORY)) {
printk(KERN_INFO "%s: Enabling PCI Memory Mapped "
"access - was not enabled by BIOS/Firmware\n",
@ -636,7 +636,7 @@ static void __devexit acenic_remove_one(struct pci_dev *pdev)
writel(readl(&regs->CpuCtrl) | CPU_HALT, &regs->CpuCtrl);
if (ap->version >= 2)
writel(readl(&regs->CpuBCtrl) | CPU_HALT, &regs->CpuBCtrl);
/*
* This clears any pending interrupts
*/
@ -1059,7 +1059,7 @@ static int __devinit ace_init(struct net_device *dev)
printk(KERN_INFO " PCI bus width: %i bits, speed: %iMHz, "
"latency: %i clks\n",
(pci_state & PCI_32BIT) ? 32 : 64,
(pci_state & PCI_66MHZ) ? 66 : 33,
(pci_state & PCI_66MHZ) ? 66 : 33,
ap->pci_latency);
/*
@ -1161,7 +1161,7 @@ static int __devinit ace_init(struct net_device *dev)
pci_write_config_word(pdev, PCI_COMMAND, ap->pci_command);
}
#endif
/*
* Configure DMA attributes.
*/
@ -1284,7 +1284,7 @@ static int __devinit ace_init(struct net_device *dev)
(RX_STD_RING_ENTRIES +
RX_JUMBO_RING_ENTRIES))));
info->rx_mini_ctrl.max_len = ACE_MINI_SIZE;
info->rx_mini_ctrl.flags =
info->rx_mini_ctrl.flags =
RCB_FLG_TCP_UDP_SUM|RCB_FLG_NO_PSEUDO_HDR|ACE_RCB_VLAN_FLAG;
for (i = 0; i < RX_MINI_RING_ENTRIES; i++)
@ -1318,7 +1318,7 @@ static int __devinit ace_init(struct net_device *dev)
if (ACE_IS_TIGON_I(ap)) {
ap->tx_ring = (struct tx_desc *) regs->Window;
for (i = 0; i < (TIGON_I_TX_RING_ENTRIES
for (i = 0; i < (TIGON_I_TX_RING_ENTRIES
* sizeof(struct tx_desc)) / sizeof(u32); i++)
writel(0, (void __iomem *)ap->tx_ring + i * 4);
@ -1670,7 +1670,7 @@ static void ace_load_std_rx_ring(struct ace_private *ap, int nr_bufs)
{
struct ace_regs __iomem *regs = ap->regs;
short i, idx;
prefetchw(&ap->cur_rx_bufs);
@ -1966,7 +1966,7 @@ static void ace_rx_int(struct net_device *dev, u32 rxretprd, u32 rxretcsm)
prefetchw(&ap->cur_rx_bufs);
prefetchw(&ap->cur_mini_bufs);
while (idx != rxretprd) {
struct ring_info *rip;
struct sk_buff *skb;
@ -1977,7 +1977,7 @@ static void ace_rx_int(struct net_device *dev, u32 rxretprd, u32 rxretcsm)
/* make sure the rx descriptor isn't read before rxretprd */
if (idx == rxretcsm)
if (idx == rxretcsm)
rmb();
retdesc = &ap->rx_return_ring[idx];
@ -2009,7 +2009,7 @@ static void ace_rx_int(struct net_device *dev, u32 rxretprd, u32 rxretcsm)
rip = &ap->skb->rx_mini_skbuff[skbidx];
mapsize = ACE_MINI_BUFSIZE;
rxdesc = &ap->rx_mini_ring[skbidx];
mini_count++;
mini_count++;
break;
default:
printk(KERN_INFO "%s: unknown frame type (0x%02x) "
@ -2377,7 +2377,7 @@ static int ace_close(struct net_device *dev)
*/
netif_stop_queue(dev);
if (ap->promisc) {
cmd.evt = C_SET_PROMISC_MODE;
cmd.code = C_C_PROMISC_DISABLE;
@ -2412,7 +2412,7 @@ static int ace_close(struct net_device *dev)
if (mapping) {
if (ACE_IS_TIGON_I(ap)) {
struct tx_desc __iomem *tx
struct tx_desc __iomem *tx
= (struct tx_desc __iomem *) &ap->tx_ring[i];
writel(0, &tx->addr.addrhi);
writel(0, &tx->addr.addrlo);
@ -2625,7 +2625,7 @@ overflow:
cpu_relax();
goto restart;
}
/* The ring is stuck full. */
printk(KERN_WARNING "%s: Transmit ring stuck full\n", dev->name);
return NETDEV_TX_BUSY;
@ -2784,18 +2784,18 @@ static int ace_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)
return 0;
}
static void ace_get_drvinfo(struct net_device *dev,
static void ace_get_drvinfo(struct net_device *dev,
struct ethtool_drvinfo *info)
{
struct ace_private *ap = netdev_priv(dev);
strlcpy(info->driver, "acenic", sizeof(info->driver));
snprintf(info->version, sizeof(info->version), "%i.%i.%i",
snprintf(info->version, sizeof(info->version), "%i.%i.%i",
tigonFwReleaseMajor, tigonFwReleaseMinor,
tigonFwReleaseFix);
if (ap->pdev)
strlcpy(info->bus_info, pci_name(ap->pdev),
strlcpy(info->bus_info, pci_name(ap->pdev),
sizeof(info->bus_info));
}
@ -2912,7 +2912,7 @@ static void __devinit ace_copy(struct ace_regs __iomem *regs, void *src,
while (size > 0) {
tsize = min_t(u32, ((~dest & (ACE_WINDOW_SIZE - 1)) + 1),
min_t(u32, size, ACE_WINDOW_SIZE));
tdest = (void __iomem *) &regs->Window +
tdest = (void __iomem *) &regs->Window +
(dest & (ACE_WINDOW_SIZE - 1));
writel(dest & ~(ACE_WINDOW_SIZE - 1), &regs->WinBase);
/*
@ -2943,7 +2943,7 @@ static void __devinit ace_clear(struct ace_regs __iomem *regs, u32 dest, int siz
while (size > 0) {
tsize = min_t(u32, ((~dest & (ACE_WINDOW_SIZE - 1)) + 1),
min_t(u32, size, ACE_WINDOW_SIZE));
tdest = (void __iomem *) &regs->Window +
tdest = (void __iomem *) &regs->Window +
(dest & (ACE_WINDOW_SIZE - 1));
writel(dest & ~(ACE_WINDOW_SIZE - 1), &regs->WinBase);
@ -3060,7 +3060,7 @@ static void __devinit eeprom_prep(struct ace_regs __iomem *regs, u8 magic)
for (i = 0; i < 8; i++, magic <<= 1) {
udelay(ACE_SHORT_DELAY);
if (magic & 0x80)
if (magic & 0x80)
local |= EEPROM_DATA_OUT;
else
local &= ~EEPROM_DATA_OUT;

Просмотреть файл

@ -173,7 +173,7 @@ typedef struct {
/*
* Host control register bits.
*/
#define IN_INT 0x01
#define CLR_INT 0x02
#define HW_RESET 0x08
@ -449,7 +449,7 @@ struct cmd {
struct tx_desc{
aceaddr addr;
u32 flagsize;
u32 flagsize;
#if 0
/*
* This is in PCI shared mem and must be accessed with readl/writel
@ -754,7 +754,7 @@ static inline void ace_unmask_irq(struct net_device *dev)
{
struct ace_private *ap = netdev_priv(dev);
struct ace_regs __iomem *regs = ap->regs;
if (ACE_IS_TIGON_I(ap))
writel(0, &regs->MaskInt);
else

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -1,6 +1,6 @@
/*
* Advanced Micro Devices Inc. AMD8111E Linux Network Driver
* Copyright (C) 2003 Advanced Micro Devices
* Advanced Micro Devices Inc. AMD8111E Linux Network Driver
* Copyright (C) 2003 Advanced Micro Devices
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@ -14,7 +14,7 @@
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
Module Name:
@ -22,11 +22,11 @@ Module Name:
amd8111e.h
Abstract:
AMD8111 based 10/100 Ethernet Controller driver definitions.
AMD8111 based 10/100 Ethernet Controller driver definitions.
Environment:
Kernel Mode
Revision History:
@ -40,7 +40,7 @@ Revision History:
/* Command style register access
Registers CMD0, CMD2, CMD3,CMD7 and INTEN0 uses a write access technique called command style access. It allows the write to selected bits of this register without altering the bits that are not selected. Command style registers are divided into 4 bytes that can be written independently. Higher order bit of each byte is the value bit that specifies the value that will be written into the selected bits of register.
Registers CMD0, CMD2, CMD3,CMD7 and INTEN0 uses a write access technique called command style access. It allows the write to selected bits of this register without altering the bits that are not selected. Command style registers are divided into 4 bytes that can be written independently. Higher order bit of each byte is the value bit that specifies the value that will be written into the selected bits of register.
eg., if the value 10011010b is written into the least significant byte of a command style register, bits 1,3 and 4 of the register will be set to 1, and the other bits will not be altered. If the value 00011010b is written into the same byte, bits 1,3 and 4 will be cleared to 0 and the other bits will not be altered.
@ -122,8 +122,8 @@ typedef enum {
ASF_INIT_DONE = (1 << 1),
ASF_INIT_PRESENT = (1 << 0),
}STAT_ASF_BITS;
}STAT_ASF_BITS;
typedef enum {
MIB_CMD_ACTIVE = (1 << 15 ),
@ -135,7 +135,7 @@ typedef enum {
typedef enum {
PMAT_DET = (1 << 12),
MP_DET = (1 << 11),
LC_DET = (1 << 10),
@ -157,7 +157,7 @@ typedef enum {
typedef enum {
INTR = (1 << 31),
PCSINT = (1 << 28),
PCSINT = (1 << 28),
LCINT = (1 << 27),
APINT5 = (1 << 26),
APINT4 = (1 << 25),
@ -221,7 +221,7 @@ typedef enum {
INTEN0_CLEAR = 0x1F7F7F1F, /* Command style register */
}INTEN0_BITS;
}INTEN0_BITS;
typedef enum {
/* VAL2 */
@ -240,7 +240,7 @@ typedef enum {
INTREN = (1 << 1),
RUN = (1 << 0),
CMD0_CLEAR = 0x000F0F7F, /* Command style register */
CMD0_CLEAR = 0x000F0F7F, /* Command style register */
}CMD0_BITS;
@ -279,20 +279,20 @@ typedef enum {
ASF_INIT_DONE_ALIAS = (1 << 29),
/* VAL2 */
JUMBO = (1 << 21),
VSIZE = (1 << 20),
VSIZE = (1 << 20),
VLONLY = (1 << 19),
VL_TAG_DEL = (1 << 18),
VL_TAG_DEL = (1 << 18),
/* VAL1 */
EN_PMGR = (1 << 14),
EN_PMGR = (1 << 14),
INTLEVEL = (1 << 13),
FORCE_FULL_DUPLEX = (1 << 12),
FORCE_LINK_STATUS = (1 << 11),
APEP = (1 << 10),
MPPLBA = (1 << 9),
FORCE_FULL_DUPLEX = (1 << 12),
FORCE_LINK_STATUS = (1 << 11),
APEP = (1 << 10),
MPPLBA = (1 << 9),
/* VAL0 */
RESET_PHY_PULSE = (1 << 2),
RESET_PHY = (1 << 1),
PHY_RST_POL = (1 << 0),
RESET_PHY_PULSE = (1 << 2),
RESET_PHY = (1 << 1),
PHY_RST_POL = (1 << 0),
}CMD3_BITS;
@ -314,7 +314,7 @@ typedef enum {
RESET_PHY_WIDTH = (0xF << 16) | (0xF<< 20), /* 0x00FF0000 */
XMTSP_MASK = (1 << 9) | (1 << 8), /* 9:8 */
XMTSP_128 = (1 << 9), /* 9 */
XMTSP_128 = (1 << 9), /* 9 */
XMTSP_64 = (1 << 8),
CACHE_ALIGN = (1 << 4),
BURST_LIMIT_MASK = (0xF << 0 ),
@ -445,7 +445,7 @@ typedef enum {
DLY_INT_B_T1 = (1 << 25),
DLY_INT_B_T0 = ( 1 << 24),
EVENT_COUNT_B = (0xF << 16) | (0x1 << 20),/* 20:16 */
MAX_DELAY_TIME_B = (0xF << 0) | (0xF << 4) | (1 << 8)|
MAX_DELAY_TIME_B = (0xF << 0) | (0xF << 4) | (1 << 8)|
(1 << 9) | (1 << 10), /* 10:0 */
}DLY_INT_B_BITS;
@ -569,20 +569,20 @@ typedef enum {
#define MAX_UNITS 8 /* Maximum number of devices possible */
#define NUM_TX_BUFFERS 32 /* Number of transmit buffers */
#define NUM_RX_BUFFERS 32 /* Number of receive buffers */
#define NUM_RX_BUFFERS 32 /* Number of receive buffers */
#define TX_BUFF_MOD_MASK 31 /* (NUM_TX_BUFFERS -1) */
#define RX_BUFF_MOD_MASK 31 /* (NUM_RX_BUFFERS -1) */
#define NUM_TX_RING_DR 32
#define NUM_RX_RING_DR 32
#define NUM_TX_RING_DR 32
#define NUM_RX_RING_DR 32
#define TX_RING_DR_MOD_MASK 31 /* (NUM_TX_RING_DR -1) */
#define RX_RING_DR_MOD_MASK 31 /* (NUM_RX_RING_DR -1) */
#define MAX_FILTER_SIZE 64 /* Maximum multicast address */
#define AMD8111E_MIN_MTU 60
#define AMD8111E_MAX_MTU 9000
#define MAX_FILTER_SIZE 64 /* Maximum multicast address */
#define AMD8111E_MIN_MTU 60
#define AMD8111E_MAX_MTU 9000
#define PKT_BUFF_SZ 1536
#define MIN_PKT_LEN 60
@ -591,7 +591,7 @@ typedef enum {
#define AMD8111E_TX_TIMEOUT (3 * HZ)/* 3 sec */
#define SOFT_TIMER_FREQ 0xBEBC /* 0.5 sec */
#define DELAY_TIMER_CONV 50 /* msec to 10 usec conversion.
Only 500 usec resolution */
Only 500 usec resolution */
#define OPTION_VLAN_ENABLE 0x0001
#define OPTION_JUMBO_ENABLE 0x0002
#define OPTION_MULTICAST_ENABLE 0x0004
@ -611,12 +611,12 @@ typedef enum {
#define MIN_IPG 96
#define MAX_IPG 255
#define IPG_STEP 16
#define CSTATE 1
#define SSTATE 2
#define CSTATE 1
#define SSTATE 2
/* Assume contoller gets data 10 times the maximum processing time */
#define REPEAT_CNT 10;
#define REPEAT_CNT 10;
/* amd8111e decriptor flag definitions */
typedef enum {
@ -649,7 +649,7 @@ typedef enum {
#define TCC_MASK 0x0003
/* driver ioctl parameters */
#define AMD8111E_REG_DUMP_LEN 13*sizeof(u32)
#define AMD8111E_REG_DUMP_LEN 13*sizeof(u32)
/* crc generator constants */
#define CRC32 0xedb88320
@ -670,15 +670,15 @@ struct amd8111e_tx_dr{
u32 buff_phy_addr;
u32 reserved;
};
};
struct amd8111e_rx_dr{
u32 reserved;
u16 msg_count; /* Received message len */
u16 tag_ctrl_info;
u16 tag_ctrl_info;
u16 buff_count; /* Len of the buffer pointed by descriptor. */
@ -692,7 +692,7 @@ struct amd8111e_link_config{
#define SPEED_INVALID 0xffff
#define DUPLEX_INVALID 0xff
#define AUTONEG_INVALID 0xff
unsigned long orig_phy_option;
u16 speed;
u8 duplex;
@ -709,7 +709,7 @@ enum coal_type{
};
enum coal_mode{
enum coal_mode{
RX_INTR_COAL,
TX_INTR_COAL,
DISABLE_COAL,
@ -727,7 +727,7 @@ struct amd8111e_coalesce_conf{
unsigned long rx_bytes;
unsigned long rx_prev_bytes;
unsigned int rx_coal_type;
unsigned int tx_timeout;
unsigned int tx_event_count;
unsigned long tx_packets;
@ -738,7 +738,7 @@ struct amd8111e_coalesce_conf{
};
struct ipg_info{
unsigned int ipg_state;
unsigned int ipg;
unsigned int current_ipg;
@ -750,7 +750,7 @@ struct ipg_info{
};
struct amd8111e_priv{
struct amd8111e_tx_dr* tx_ring;
struct amd8111e_rx_dr* rx_ring;
dma_addr_t tx_ring_dma_addr; /* tx descriptor ring base address */
@ -766,7 +766,7 @@ struct amd8111e_priv{
dma_addr_t rx_dma_addr[NUM_RX_BUFFERS];
/* Reg memory mapped address */
void __iomem *mmio;
spinlock_t lock; /* Guard lock */
unsigned long rx_idx, tx_idx; /* The next free ring entry */
unsigned long tx_complete_idx;
@ -778,7 +778,7 @@ struct amd8111e_priv{
unsigned long ext_phy_option;
int ext_phy_addr;
u32 ext_phy_id;
struct amd8111e_link_config link_config;
int pm_cap;
@ -787,22 +787,22 @@ struct amd8111e_priv{
struct mii_if_info mii_if;
#if AMD8111E_VLAN_TAG_USED
struct vlan_group *vlgrp;
#endif
#endif
char opened;
struct net_device_stats stats;
unsigned int drv_rx_errors;
struct dev_mc_list* mc_list;
struct amd8111e_coalesce_conf coal_conf;
struct ipg_info ipg_data;
struct ipg_info ipg_data;
};
/* kernel provided writeq does not write 64 bits into the amd8111e device register instead writes only higher 32bits data into lower 32bits of the register.
BUG? */
#define amd8111e_writeq(_UlData,_memMap) \
writel(*(u32*)(&_UlData), _memMap); \
writel(*(u32*)((u8*)(&_UlData)+4), _memMap+4)
writel(*(u32*)((u8*)(&_UlData)+4), _memMap+4)
/* maps the external speed options to internal value */
typedef enum {

Просмотреть файл

@ -132,9 +132,9 @@ struct net_device * __init apne_probe(int unit)
if ( !(AMIGAHW_PRESENT(PCMCIA)) )
return ERR_PTR(-ENODEV);
printk("Looking for PCMCIA ethernet card : ");
/* check if a card is inserted */
if (!(PCMCIA_INSERTED)) {
printk("NO PCMCIA card inserted\n");
@ -205,7 +205,7 @@ static int __init apne_probe1(struct net_device *dev, int ioaddr)
int neX000, ctron;
#endif
static unsigned version_printed;
if (ei_debug && version_printed++ == 0)
printk(version);
@ -261,13 +261,13 @@ static int __init apne_probe1(struct net_device *dev, int ioaddr)
/* At this point, wordlength *only* tells us if the SA_prom is doubled
up or not because some broken PCI cards don't respect the byte-wide
request in program_seq above, and hence don't have doubled up values.
request in program_seq above, and hence don't have doubled up values.
These broken cards would otherwise be detected as an ne1000. */
if (wordlength == 2)
for (i = 0; i < 16; i++)
SA_prom[i] = SA_prom[i+i];
if (wordlength == 2) {
/* We must set the 8390 for word mode. */
outb(0x49, ioaddr + NE_EN0_DCFG);

Просмотреть файл

@ -18,7 +18,7 @@
straight-forward Fujitsu MB86965 implementations.
Modification for Fujitsu FMV-18X cards is done by Yutaka Tamiya
(tamy@flab.fujitsu.co.jp).
(tamy@flab.fujitsu.co.jp).
Sources:
The Fujitsu MB86965 datasheet.
@ -168,7 +168,7 @@ static struct net_device_stats *net_get_stats(struct net_device *dev);
static void set_rx_mode(struct net_device *dev);
static void net_tx_timeout (struct net_device *dev);
#ifdef CONFIG_MCA_LEGACY
struct at1720_mca_adapters_struct {
char* name;
@ -201,7 +201,7 @@ static void cleanup_card(struct net_device *dev)
struct net_local *lp = netdev_priv(dev);
if (lp->mca_slot >= 0)
mca_mark_as_unused(lp->mca_slot);
#endif
#endif
free_irq(dev->irq, NULL);
release_region(dev->base_addr, AT1700_IO_EXTENT);
}
@ -301,7 +301,7 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr)
for (j = 0; at1720_mca_adapters[j].name != NULL; j ++) {
slot = 0;
while (slot != MCA_NOTFOUND) {
slot = mca_find_unused_adapter( at1720_mca_adapters[j].id, slot );
if (slot == MCA_NOTFOUND) break;
@ -315,7 +315,7 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr)
if (( pos3 & 0x07) == at1700_ioaddr_pattern[l_i])
break;
ioaddr = at1700_mca_probe_list[l_i];
for (irq = 0; irq < 0x10; irq++)
if (((((pos4>>4) & 0x0f) | (pos3 & 0xf0)) & 0xff) == at1700_irq_pattern[irq])
break;
@ -328,7 +328,7 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr)
}
dev->irq = irq;
/* claim the slot */
mca_set_adapter_name( slot, at1720_mca_adapters[j].name );
mca_mark_as_used(slot);
@ -353,7 +353,7 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr)
else {
goto err_out;
}
#ifdef CONFIG_MCA_LEGACY
found:
#endif
@ -487,7 +487,7 @@ err_out:
return ret;
}
/* EEPROM_Ctrl bits. */
#define EE_SHIFT_CLK 0x40 /* EEPROM shift clock, in reg. 16. */
#define EE_CS 0x20 /* EEPROM chip select, in reg. 16. */
@ -528,7 +528,7 @@ static int __init read_eeprom(long ioaddr, int location)
return retval;
}
static int net_open(struct net_device *dev)
{
@ -645,7 +645,7 @@ static int net_send_packet (struct sk_buff *skb, struct net_device *dev)
return 0;
}
/* The typical workload of the driver:
Handle the network interface interrupts. */
static irqreturn_t
@ -663,9 +663,9 @@ net_interrupt(int irq, void *dev_id, struct pt_regs *regs)
ioaddr = dev->base_addr;
lp = netdev_priv(dev);
spin_lock (&lp->lock);
status = inw(ioaddr + TX_STATUS);
outw(status, ioaddr + TX_STATUS);
@ -919,7 +919,7 @@ cleanup_module(void)
#endif /* MODULE */
MODULE_LICENSE("GPL");
/*
* Local variables:
* compile-command: "gcc -DMODULE -D__KERNEL__ -Wall -Wstrict-prototypes -O6 -c at1700.c"

Просмотреть файл

@ -460,7 +460,7 @@ bionet_send_packet(struct sk_buff *skb, struct net_device *dev) {
if (bionet_debug >1) {
u_char *data = nic_packet->buffer, *p;
int i;
printk( "%s: TX pkt type 0x%4x from ", dev->name,
((u_short *)data)[6]);
@ -551,7 +551,7 @@ bionet_poll_rx(struct net_device *dev) {
/* 'skb->data' points to the start of sk_buff data area.
*/
memcpy(skb->data, nic_packet->buffer, pkt_len);
skb->protocol = eth_type_trans( skb, dev );
skb->protocol = eth_type_trans( skb, dev );
netif_rx(skb);
dev->last_rx = jiffies;
lp->stats.rx_packets++;
@ -565,17 +565,17 @@ bionet_poll_rx(struct net_device *dev) {
if (bionet_debug >1) {
u_char *data = nic_packet->buffer, *p;
int i;
printk( "%s: RX pkt type 0x%4x from ", dev->name,
((u_short *)data)[6]);
for( p = &data[6], i = 0; i < 6; i++ )
printk("%02x%s", *p++,i != 5 ? ":" : "" );
printk(" to ");
for( p = data, i = 0; i < 6; i++ )
printk("%02x%s", *p++,i != 5 ? ":" : "" "\n" );
printk( "%s: ", dev->name );
printk(" data %02x%02x %02x%02x%02x%02x %02x%02x%02x%02x %02x%02x%02x%02x %02x%02x%02x%02x"
" %02x%02x%02x%02x len %d\n",
@ -636,7 +636,7 @@ bionet_close(struct net_device *dev) {
/* Get the current statistics.
This may be called with the card open or closed.
*/
static struct net_device_stats *net_get_stats(struct net_device *dev)
static struct net_device_stats *net_get_stats(struct net_device *dev)
{
struct net_local *lp = netdev_priv(dev);
return &lp->stats;

Просмотреть файл

@ -857,7 +857,7 @@ pamsnet_close(struct net_device *dev) {
/* Get the current statistics.
This may be called with the card open or closed.
*/
static struct net_device_stats *net_get_stats(struct net_device *dev)
static struct net_device_stats *net_get_stats(struct net_device *dev)
{
struct net_local *lp = netdev_priv(dev);
return &lp->stats;

Просмотреть файл

@ -356,7 +356,7 @@ static void lance_tx_timeout (struct net_device *dev);
static void *slow_memcpy( void *dst, const void *src, size_t len )
@ -549,7 +549,7 @@ static unsigned long __init lance_probe1( struct net_device *dev,
memaddr == (unsigned short *)0xffe00000) {
/* PAMs card and Riebl on ST use level 5 autovector */
if (request_irq(IRQ_AUTO_5, lance_interrupt, IRQ_TYPE_PRIO,
"PAM/Riebl-ST Ethernet", dev)) {
"PAM/Riebl-ST Ethernet", dev)) {
printk( "Lance: request for irq %d failed\n", IRQ_AUTO_5 );
return( 0 );
}
@ -639,7 +639,7 @@ static unsigned long __init lance_probe1( struct net_device *dev,
/* XXX MSch */
dev->tx_timeout = lance_tx_timeout;
dev->watchdog_timeo = TX_TIMEOUT;
#if 0
dev->start = 0;
@ -650,7 +650,7 @@ static unsigned long __init lance_probe1( struct net_device *dev,
return( 1 );
}
static int lance_open( struct net_device *dev )
{ struct lance_private *lp = (struct lance_private *)dev->priv;
@ -744,7 +744,7 @@ static void lance_tx_timeout (struct net_device *dev)
{
struct lance_private *lp = (struct lance_private *) dev->priv;
struct lance_ioreg *IO = lp->iobase;
AREG = CSR0;
DPRINTK( 1, ( "%s: transmit timed out, status %04x, resetting.\n",
dev->name, DREG ));
@ -772,7 +772,7 @@ static void lance_tx_timeout (struct net_device *dev)
-MEM->tx_head[i].length,
MEM->tx_head[i].misc ));
}
#endif
#endif
/* XXX MSch: maybe purge/reinit ring here */
/* lance_restart, essentially */
lance_init_ring(dev);
@ -802,12 +802,12 @@ static int lance_start_xmit( struct sk_buff *skb, struct net_device *dev )
/* PAM-Card has a bug: Can only send packets with even number of bytes! */
else if (lp->cardtype == PAM_CARD && (len & 1))
++len;
if (len > skb->len) {
if (skb_padto(skb, len))
return 0;
}
netif_stop_queue (dev);
/* Fill in a Tx ring entry */
@ -1175,7 +1175,7 @@ static int lance_set_mac_address( struct net_device *dev, void *addr )
return( 0 );
}
#ifdef MODULE
static struct net_device *atarilance_dev;
@ -1195,7 +1195,7 @@ void cleanup_module(void)
}
#endif /* MODULE */
/*
* Local variables:

Просмотреть файл

@ -221,7 +221,7 @@ static struct net_device *root_atp_dev;
If dev->base_addr == 1, always return failure.
If dev->base_addr == 2, allocate space for the device and return success
(detachable devices only).
FIXME: we should use the parport layer for this
*/
static int __init atp_init(void)

Просмотреть файл

@ -6,8 +6,8 @@
* Copyright 2002 TimeSys Corp.
* Added ethtool/mii-tool support,
* Copyright 2004 Matt Porter <mporter@kernel.crashing.org>
* Update: 2004 Bjoern Riemer, riemer@fokus.fraunhofer.de
* or riemer@riemer-nt.de: fixed the link beat detection with
* Update: 2004 Bjoern Riemer, riemer@fokus.fraunhofer.de
* or riemer@riemer-nt.de: fixed the link beat detection with
* ioctls (SIOCGMIIPHY)
* Copyright 2006 Herbert Valerio Riedel <hvr@gnu.org>
* converted to use linux-2.6.x's PHY framework
@ -32,7 +32,7 @@
*
* ########################################################################
*
*
*
*/
#include <linux/module.h>
@ -107,13 +107,13 @@ extern char * __init prom_getcmdline(void);
/*
* Theory of operation
*
* The Au1000 MACs use a simple rx and tx descriptor ring scheme.
* There are four receive and four transmit descriptors. These
* descriptors are not in memory; rather, they are just a set of
* The Au1000 MACs use a simple rx and tx descriptor ring scheme.
* There are four receive and four transmit descriptors. These
* descriptors are not in memory; rather, they are just a set of
* hardware registers.
*
* Since the Au1000 has a coherent data cache, the receive and
* transmit buffers are allocated from the KSEG0 segment. The
* transmit buffers are allocated from the KSEG0 segment. The
* hardware registers, however, are still mapped at KSEG1 to
* make sure there's no out-of-order writes, and that all writes
* complete immediately.
@ -123,7 +123,7 @@ extern char * __init prom_getcmdline(void);
* the mac address is, and the mac address is not passed on the
* command line.
*/
static unsigned char au1000_mac_addr[6] __devinitdata = {
static unsigned char au1000_mac_addr[6] __devinitdata = {
0x00, 0x50, 0xc2, 0x0c, 0x30, 0x00
};
@ -207,13 +207,13 @@ static int mdio_read(struct net_device *dev, int phy_addr, int reg)
while (*mii_control_reg & MAC_MII_BUSY) {
mdelay(1);
if (--timedout == 0) {
printk(KERN_ERR "%s: read_MII busy timeout!!\n",
printk(KERN_ERR "%s: read_MII busy timeout!!\n",
dev->name);
return -1;
}
}
mii_control = MAC_SET_MII_SELECT_REG(reg) |
mii_control = MAC_SET_MII_SELECT_REG(reg) |
MAC_SET_MII_SELECT_PHY(phy_addr) | MAC_MII_READ;
*mii_control_reg = mii_control;
@ -222,7 +222,7 @@ static int mdio_read(struct net_device *dev, int phy_addr, int reg)
while (*mii_control_reg & MAC_MII_BUSY) {
mdelay(1);
if (--timedout == 0) {
printk(KERN_ERR "%s: mdio_read busy timeout!!\n",
printk(KERN_ERR "%s: mdio_read busy timeout!!\n",
dev->name);
return -1;
}
@ -241,13 +241,13 @@ static void mdio_write(struct net_device *dev, int phy_addr, int reg, u16 value)
while (*mii_control_reg & MAC_MII_BUSY) {
mdelay(1);
if (--timedout == 0) {
printk(KERN_ERR "%s: mdio_write busy timeout!!\n",
printk(KERN_ERR "%s: mdio_write busy timeout!!\n",
dev->name);
return;
}
}
mii_control = MAC_SET_MII_SELECT_REG(reg) |
mii_control = MAC_SET_MII_SELECT_REG(reg) |
MAC_SET_MII_SELECT_PHY(phy_addr) | MAC_MII_WRITE;
*mii_data_reg = value;
@ -394,7 +394,7 @@ static int mii_probe (struct net_device *dev)
/*
* Buffer allocation/deallocation routines. The buffer descriptor returned
* has the virtual and dma address of a buffer suitable for
* has the virtual and dma address of a buffer suitable for
* both, receive and transmit operations.
*/
static db_dest_t *GetFreeDB(struct au1000_private *aup)
@ -500,22 +500,22 @@ static void reset_mac(struct net_device *dev)
spin_unlock_irqrestore(&aup->lock, flags);
}
/*
/*
* Setup the receive and transmit "rings". These pointers are the addresses
* of the rx and tx MAC DMA registers so they are fixed by the hardware --
* these are not descriptors sitting in memory.
*/
static void
static void
setup_hw_rings(struct au1000_private *aup, u32 rx_base, u32 tx_base)
{
int i;
for (i = 0; i < NUM_RX_DMA; i++) {
aup->rx_dma_ring[i] =
aup->rx_dma_ring[i] =
(volatile rx_dma_t *) (rx_base + sizeof(rx_dma_t)*i);
}
for (i = 0; i < NUM_TX_DMA; i++) {
aup->tx_dma_ring[i] =
aup->tx_dma_ring[i] =
(volatile tx_dma_t *) (tx_base + sizeof(tx_dma_t)*i);
}
}
@ -691,7 +691,7 @@ static struct net_device * au1000_probe(int port_num)
/* Use the hard coded MAC addresses */
else {
str2eaddr(ethaddr, pmac + strlen("ethaddr="));
memcpy(au1000_mac_addr, ethaddr,
memcpy(au1000_mac_addr, ethaddr,
sizeof(au1000_mac_addr));
}
}
@ -780,8 +780,8 @@ static struct net_device * au1000_probe(int port_num)
dev->tx_timeout = au1000_tx_timeout;
dev->watchdog_timeo = ETH_TX_TIMEOUT;
/*
* The boot code uses the ethernet controller, so reset it to start
/*
* The boot code uses the ethernet controller, so reset it to start
* fresh. au1000_init() expects that the device is in reset state.
*/
reset_mac(dev);
@ -810,7 +810,7 @@ err_out:
return NULL;
}
/*
/*
* Initialize the interface.
*
* When the device powers up, the clocks are disabled and the
@ -826,7 +826,7 @@ static int au1000_init(struct net_device *dev)
int i;
u32 control;
if (au1000_debug > 4)
if (au1000_debug > 4)
printk("%s: au1000_init\n", dev->name);
/* bring the device out of reset */
@ -1102,8 +1102,8 @@ static int au1000_tx(struct sk_buff *skb, struct net_device *dev)
int i;
if (au1000_debug > 5)
printk("%s: tx: aup %x len=%d, data=%p, head %d\n",
dev->name, (unsigned)aup, skb->len,
printk("%s: tx: aup %x len=%d, data=%p, head %d\n",
dev->name, (unsigned)aup, skb->len,
skb->data, aup->tx_head);
ptxd = aup->tx_dma_ring[aup->tx_head];
@ -1127,7 +1127,7 @@ static int au1000_tx(struct sk_buff *skb, struct net_device *dev)
pDB = aup->tx_db_inuse[aup->tx_head];
memcpy((void *)pDB->vaddr, skb->data, skb->len);
if (skb->len < ETH_ZLEN) {
for (i=skb->len; i<ETH_ZLEN; i++) {
for (i=skb->len; i<ETH_ZLEN; i++) {
((char *)pDB->vaddr)[i] = 0;
}
ptxd->len = ETH_ZLEN;
@ -1166,7 +1166,7 @@ static inline void update_rx_stats(struct net_device *dev, u32 status)
if (status & RX_COLL)
ps->collisions++;
}
else
else
ps->rx_bytes += status & RX_FRAME_LEN_MASK;
}
@ -1215,13 +1215,13 @@ static int au1000_rx(struct net_device *dev)
}
else {
if (au1000_debug > 4) {
if (status & RX_MISSED_FRAME)
if (status & RX_MISSED_FRAME)
printk("rx miss\n");
if (status & RX_WDOG_TIMER)
if (status & RX_WDOG_TIMER)
printk("rx wdog\n");
if (status & RX_RUNT)
if (status & RX_RUNT)
printk("rx runt\n");
if (status & RX_OVERLEN)
if (status & RX_OVERLEN)
printk("rx overlen\n");
if (status & RX_COLL)
printk("rx coll\n");
@ -1287,7 +1287,7 @@ static void set_rx_mode(struct net_device *dev)
{
struct au1000_private *aup = (struct au1000_private *) dev->priv;
if (au1000_debug > 4)
if (au1000_debug > 4)
printk("%s: set_rx_mode: flags=%x\n", dev->name, dev->flags);
if (dev->flags & IFF_PROMISC) { /* Set promiscuous. */
@ -1305,7 +1305,7 @@ static void set_rx_mode(struct net_device *dev)
mc_filter[1] = mc_filter[0] = 0;
for (i = 0, mclist = dev->mc_list; mclist && i < dev->mc_count;
i++, mclist = mclist->next) {
set_bit(ether_crc(ETH_ALEN, mclist->dmi_addr)>>26,
set_bit(ether_crc(ETH_ALEN, mclist->dmi_addr)>>26,
(long *)mc_filter);
}
aup->mac->multi_hash_high = mc_filter[1];

Просмотреть файл

@ -23,7 +23,7 @@
*
* ########################################################################
*
*
*
*/
@ -40,8 +40,8 @@
#define MULTICAST_FILTER_LIMIT 64
/*
* Data Buffer Descriptor. Data buffers must be aligned on 32 byte
/*
* Data Buffer Descriptor. Data buffers must be aligned on 32 byte
* boundary for both, receive and transmit.
*/
typedef struct db_dest {
@ -51,7 +51,7 @@ typedef struct db_dest {
} db_dest_t;
/*
* The transmit and receive descriptors are memory
* The transmit and receive descriptors are memory
* mapped registers.
*/
typedef struct tx_dma {
@ -107,9 +107,9 @@ struct au1000_private {
struct phy_device *phy_dev;
struct mii_bus mii_bus;
/* These variables are just for quick access to certain regs addresses. */
volatile mac_reg_t *mac; /* mac registers */
volatile mac_reg_t *mac; /* mac registers */
volatile u32 *enable; /* address of MAC Enable Register */
u32 vaddr; /* virtual address of rx/tx buffers */

Просмотреть файл

@ -333,7 +333,7 @@ bmac_init_registers(struct net_device *dev)
udelay(10000);
}
bmwrite(dev, RSEED, (unsigned short)0x1968);
bmwrite(dev, RSEED, (unsigned short)0x1968);
regValue = bmread(dev, XIFC);
regValue |= TxOutputEnable;
@ -373,7 +373,7 @@ bmac_init_registers(struct net_device *dev)
bmwrite(dev, BHASH2, bp->hash_table_mask[1]); /* bits 31 - 16 */
bmwrite(dev, BHASH1, bp->hash_table_mask[2]); /* bits 47 - 32 */
bmwrite(dev, BHASH0, bp->hash_table_mask[3]); /* bits 63 - 48 */
pWord16 = (unsigned short *)dev->dev_addr;
bmwrite(dev, MADD0, *pWord16++);
bmwrite(dev, MADD1, *pWord16++);
@ -411,11 +411,11 @@ bmac_start_chip(struct net_device *dev)
/* enable rx dma channel */
dbdma_continue(rd);
oldConfig = bmread(dev, TXCFG);
oldConfig = bmread(dev, TXCFG);
bmwrite(dev, TXCFG, oldConfig | TxMACEnable );
/* turn on rx plus any other bits already on (promiscuous possibly) */
oldConfig = bmread(dev, RXCFG);
oldConfig = bmread(dev, RXCFG);
bmwrite(dev, RXCFG, oldConfig | RxMACEnable );
udelay(20000);
}
@ -456,12 +456,12 @@ static void bmac_init_chip(struct net_device *dev)
#ifdef CONFIG_PM
static int bmac_suspend(struct macio_dev *mdev, pm_message_t state)
{
struct net_device* dev = macio_get_drvdata(mdev);
struct net_device* dev = macio_get_drvdata(mdev);
struct bmac_data *bp = netdev_priv(dev);
unsigned long flags;
unsigned short config;
int i;
netif_device_detach(dev);
/* prolly should wait for dma to finish & turn off the chip */
spin_lock_irqsave(&bp->lock, flags);
@ -477,7 +477,7 @@ static int bmac_suspend(struct macio_dev *mdev, pm_message_t state)
if (bp->opened) {
volatile struct dbdma_regs __iomem *rd = bp->rx_dma;
volatile struct dbdma_regs __iomem *td = bp->tx_dma;
config = bmread(dev, RXCFG);
bmwrite(dev, RXCFG, (config & ~RxMACEnable));
config = bmread(dev, TXCFG);
@ -506,7 +506,7 @@ static int bmac_suspend(struct macio_dev *mdev, pm_message_t state)
static int bmac_resume(struct macio_dev *mdev)
{
struct net_device* dev = macio_get_drvdata(mdev);
struct net_device* dev = macio_get_drvdata(mdev);
struct bmac_data *bp = netdev_priv(dev);
/* see if this is enough */
@ -855,12 +855,12 @@ crc416(unsigned int curval, unsigned short nxtval)
else high_crc_set = 1;
cur = cur << 1;
if ((next & 0x0001) == 0) low_data_set = 0;
else low_data_set = 1;
next = next >> 1;
/* do the XOR */
if (high_crc_set ^ low_data_set) cur = cur ^ ENET_CRCPOLY;
}
@ -869,7 +869,7 @@ crc416(unsigned int curval, unsigned short nxtval)
static unsigned int
bmac_crc(unsigned short *address)
{
{
unsigned int newcrc;
XXDEBUG(("bmac_crc: addr=%#04x, %#04x, %#04x\n", *address, address[1], address[2]));
@ -887,7 +887,7 @@ bmac_crc(unsigned short *address)
static void
bmac_addhash(struct bmac_data *bp, unsigned char *addr)
{
{
unsigned int crc;
unsigned short mask;
@ -902,7 +902,7 @@ bmac_addhash(struct bmac_data *bp, unsigned char *addr)
static void
bmac_removehash(struct bmac_data *bp, unsigned char *addr)
{
{
unsigned int crc;
unsigned char mask;
@ -1054,13 +1054,13 @@ static void bmac_set_multicast(struct net_device *dev)
bmwrite(dev, RXCFG, rx_cfg);
} else {
u16 hash_table[4];
rx_cfg = bmread(dev, RXCFG);
rx_cfg &= ~RxPromiscEnable;
bmwrite(dev, RXCFG, rx_cfg);
for(i = 0; i < 4; i++) hash_table[i] = 0;
for(i = 0; i < dev->mc_count; i++) {
addrs = dmi->dmi_addr;
dmi = dmi->next;
@ -1220,7 +1220,7 @@ bmac_get_station_address(struct net_device *dev, unsigned char *ea)
int i;
unsigned short data;
for (i = 0; i < 6; i++)
for (i = 0; i < 6; i++)
{
reset_and_select_srom(dev);
data = read_srom(dev, i + EnetAddressOffset/2, SROMAddressBits);
@ -1244,7 +1244,7 @@ static void bmac_reset_and_enable(struct net_device *dev)
bmac_start_chip(dev);
bmwrite(dev, INTDISABLE, EnableNormal);
bp->sleeping = 0;
/*
* It seems that the bmac can't receive until it's transmitted
* a packet. So we give it a dummy packet to transmit.
@ -1286,7 +1286,7 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_device_i
printk(KERN_ERR "BMAC: alloc_etherdev failed, out of memory\n");
return -ENOMEM;
}
bp = netdev_priv(dev);
SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, &mdev->ofdev.dev);
@ -1379,7 +1379,7 @@ static int __devinit bmac_probe(struct macio_dev *mdev, const struct of_device_i
printk("%c%.2x", (j? ':': ' '), dev->dev_addr[j]);
XXDEBUG((", base_addr=%#0lx", dev->base_addr));
printk("\n");
return 0;
err_out_irq2:
@ -1471,7 +1471,7 @@ bmac_start(struct net_device *dev)
if (bp->sleeping)
return;
spin_lock_irqsave(&bp->lock, flags);
while (1) {
i = bp->tx_fill + 1;
@ -1559,9 +1559,9 @@ static void bmac_tx_timeout(unsigned long data)
}
/* turn it back on */
oldConfig = bmread(dev, RXCFG);
oldConfig = bmread(dev, RXCFG);
bmwrite(dev, RXCFG, oldConfig | RxMACEnable );
oldConfig = bmread(dev, TXCFG);
oldConfig = bmread(dev, TXCFG);
bmwrite(dev, TXCFG, oldConfig | TxMACEnable );
spin_unlock_irqrestore(&bp->lock, flags);
@ -1571,10 +1571,10 @@ static void bmac_tx_timeout(unsigned long data)
static void dump_dbdma(volatile struct dbdma_cmd *cp,int count)
{
int i,*ip;
for (i=0;i< count;i++) {
ip = (int*)(cp+i);
printk("dbdma req 0x%x addr 0x%x baddr 0x%x xfer/res 0x%x\n",
ld_le32(ip+0),
ld_le32(ip+1),
@ -1630,7 +1630,7 @@ static int __devexit bmac_remove(struct macio_dev *mdev)
unregister_netdev(dev);
free_irq(dev->irq, dev);
free_irq(bp->tx_dma_intr, dev);
free_irq(bp->tx_dma_intr, dev);
free_irq(bp->rx_dma_intr, dev);
iounmap((void __iomem *)dev->base_addr);
@ -1644,7 +1644,7 @@ static int __devexit bmac_remove(struct macio_dev *mdev)
return 0;
}
static struct of_device_id bmac_match[] =
static struct of_device_id bmac_match[] =
{
{
.name = "bmac",
@ -1659,7 +1659,7 @@ static struct of_device_id bmac_match[] =
};
MODULE_DEVICE_TABLE (of, bmac_match);
static struct macio_driver bmac_driver =
static struct macio_driver bmac_driver =
{
.name = "bmac",
.match_table = bmac_match,

Просмотреть файл

@ -14,7 +14,7 @@
* (HME) controller. See sunhme.h
*/
/* register offsets */
/* global status and control */

Просмотреть файл

@ -148,7 +148,7 @@ static struct flash_spec flash_table[] =
SAIFUN_FLASH_BYTE_ADDR_MASK, 0,
"Entry 0100"},
/* Entry 0101: ST M45PE10 (non-buffered flash, TetonII B0) */
{0x19000002, 0x5b808201, 0x000500db, 0x03840253, 0xaf020406,
{0x19000002, 0x5b808201, 0x000500db, 0x03840253, 0xaf020406,
0, ST_MICRO_FLASH_PAGE_BITS, ST_MICRO_FLASH_PAGE_SIZE,
ST_MICRO_FLASH_BYTE_ADDR_MASK, ST_MICRO_FLASH_BASE_TOTAL_SIZE*2,
"Entry 0101: ST M45PE10 (128kB non-bufferred)"},
@ -317,7 +317,7 @@ bnx2_write_phy(struct bnx2 *bp, u32 reg, u32 val)
BNX2_EMAC_MDIO_COMM_COMMAND_WRITE |
BNX2_EMAC_MDIO_COMM_START_BUSY | BNX2_EMAC_MDIO_COMM_DISEXT;
REG_WR(bp, BNX2_EMAC_MDIO_COMM, val1);
for (i = 0; i < 50; i++) {
udelay(10);
@ -585,7 +585,7 @@ bnx2_resolve_flow_ctrl(struct bnx2 *bp)
u32 local_adv, remote_adv;
bp->flow_ctrl = 0;
if ((bp->autoneg & (AUTONEG_SPEED | AUTONEG_FLOW_CTRL)) !=
if ((bp->autoneg & (AUTONEG_SPEED | AUTONEG_FLOW_CTRL)) !=
(AUTONEG_SPEED | AUTONEG_FLOW_CTRL)) {
if (bp->duplex == DUPLEX_FULL) {
@ -1087,7 +1087,7 @@ bnx2_setup_serdes_phy(struct bnx2 *bp)
#define PHY_ALL_10_100_SPEED (ADVERTISE_10HALF | ADVERTISE_10FULL | \
ADVERTISE_100HALF | ADVERTISE_100FULL | ADVERTISE_CSMA)
#define PHY_ALL_1000_SPEED (ADVERTISE_1000HALF | ADVERTISE_1000FULL)
static int
@ -1120,7 +1120,7 @@ bnx2_setup_copper_phy(struct bnx2 *bp)
new_adv_reg |= ADVERTISE_100FULL;
if (bp->advertising & ADVERTISED_1000baseT_Full)
new_adv1000_reg |= ADVERTISE_1000FULL;
new_adv_reg |= ADVERTISE_CSMA;
new_adv_reg |= bnx2_phy_get_pause_adv(bp);
@ -1157,7 +1157,7 @@ bnx2_setup_copper_phy(struct bnx2 *bp)
bnx2_read_phy(bp, MII_BMSR, &bmsr);
bnx2_read_phy(bp, MII_BMSR, &bmsr);
if (bmsr & BMSR_LSTATUS) {
/* Force link down */
bnx2_write_phy(bp, MII_BMCR, BMCR_LOOPBACK);
@ -1547,7 +1547,7 @@ bnx2_alloc_bad_rbuf(struct bnx2 *bp)
}
static void
bnx2_set_mac_addr(struct bnx2 *bp)
bnx2_set_mac_addr(struct bnx2 *bp)
{
u32 val;
u8 *mac_addr = bp->dev->dev_addr;
@ -1556,7 +1556,7 @@ bnx2_set_mac_addr(struct bnx2 *bp)
REG_WR(bp, BNX2_EMAC_MAC_MATCH0, val);
val = (mac_addr[2] << 24) | (mac_addr[3] << 16) |
val = (mac_addr[2] << 24) | (mac_addr[3] << 16) |
(mac_addr[4] << 8) | mac_addr[5];
REG_WR(bp, BNX2_EMAC_MAC_MATCH1, val);
@ -1638,7 +1638,7 @@ bnx2_tx_int(struct bnx2 *bp)
tx_buf = &bp->tx_buf_ring[sw_ring_cons];
skb = tx_buf->skb;
#ifdef BCM_TSO
#ifdef BCM_TSO
/* partial BD completions possible with TSO packets */
if (skb_is_gso(skb)) {
u16 last_idx, last_ring_idx;
@ -1984,12 +1984,12 @@ bnx2_poll(struct net_device *dev, int *budget)
if (orig_budget > dev->quota)
orig_budget = dev->quota;
work_done = bnx2_rx_int(bp, orig_budget);
*budget -= work_done;
dev->quota -= work_done;
}
bp->last_status_idx = bp->status_blk->status_idx;
rmb();
@ -2322,7 +2322,7 @@ bnx2_init_cpus(struct bnx2 *bp)
cpu_reg.bp = BNX2_RXP_CPU_HW_BREAKPOINT;
cpu_reg.spad_base = BNX2_RXP_SCRATCH;
cpu_reg.mips_view_base = 0x8000000;
fw.ver_major = bnx2_RXP_b06FwReleaseMajor;
fw.ver_minor = bnx2_RXP_b06FwReleaseMinor;
fw.ver_fix = bnx2_RXP_b06FwReleaseFix;
@ -2374,7 +2374,7 @@ bnx2_init_cpus(struct bnx2 *bp)
cpu_reg.bp = BNX2_TXP_CPU_HW_BREAKPOINT;
cpu_reg.spad_base = BNX2_TXP_SCRATCH;
cpu_reg.mips_view_base = 0x8000000;
fw.ver_major = bnx2_TXP_b06FwReleaseMajor;
fw.ver_minor = bnx2_TXP_b06FwReleaseMinor;
fw.ver_fix = bnx2_TXP_b06FwReleaseFix;
@ -2426,7 +2426,7 @@ bnx2_init_cpus(struct bnx2 *bp)
cpu_reg.bp = BNX2_TPAT_CPU_HW_BREAKPOINT;
cpu_reg.spad_base = BNX2_TPAT_SCRATCH;
cpu_reg.mips_view_base = 0x8000000;
fw.ver_major = bnx2_TPAT_b06FwReleaseMajor;
fw.ver_minor = bnx2_TPAT_b06FwReleaseMinor;
fw.ver_fix = bnx2_TPAT_b06FwReleaseFix;
@ -2478,7 +2478,7 @@ bnx2_init_cpus(struct bnx2 *bp)
cpu_reg.bp = BNX2_COM_CPU_HW_BREAKPOINT;
cpu_reg.spad_base = BNX2_COM_SCRATCH;
cpu_reg.mips_view_base = 0x8000000;
fw.ver_major = bnx2_COM_b06FwReleaseMajor;
fw.ver_minor = bnx2_COM_b06FwReleaseMinor;
fw.ver_fix = bnx2_COM_b06FwReleaseFix;
@ -2741,7 +2741,7 @@ bnx2_enable_nvram_access(struct bnx2 *bp)
val = REG_RD(bp, BNX2_NVM_ACCESS_ENABLE);
/* Enable both bits, even on read. */
REG_WR(bp, BNX2_NVM_ACCESS_ENABLE,
REG_WR(bp, BNX2_NVM_ACCESS_ENABLE,
val | BNX2_NVM_ACCESS_ENABLE_EN | BNX2_NVM_ACCESS_ENABLE_WR_EN);
}
@ -2752,7 +2752,7 @@ bnx2_disable_nvram_access(struct bnx2 *bp)
val = REG_RD(bp, BNX2_NVM_ACCESS_ENABLE);
/* Disable both bits, even after read. */
REG_WR(bp, BNX2_NVM_ACCESS_ENABLE,
REG_WR(bp, BNX2_NVM_ACCESS_ENABLE,
val & ~(BNX2_NVM_ACCESS_ENABLE_EN |
BNX2_NVM_ACCESS_ENABLE_WR_EN));
}
@ -3143,7 +3143,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf,
/* Find the data_start addr */
data_start = (written == 0) ? offset32 : page_start;
/* Find the data_end addr */
data_end = (page_end > offset32 + len32) ?
data_end = (page_end > offset32 + len32) ?
(offset32 + len32) : page_end;
/* Request access to the flash interface. */
@ -3164,8 +3164,8 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf,
cmd_flags |= BNX2_NVM_COMMAND_LAST;
}
rc = bnx2_nvram_read_dword(bp,
page_start + j,
&flash_buffer[j],
page_start + j,
&flash_buffer[j],
cmd_flags);
if (rc)
@ -3192,7 +3192,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf,
if (bp->flash_info->buffered == 0) {
for (addr = page_start; addr < data_start;
addr += 4, i += 4) {
rc = bnx2_nvram_write_dword(bp, addr,
&flash_buffer[i], cmd_flags);
@ -3226,7 +3226,7 @@ bnx2_nvram_write(struct bnx2 *bp, u32 offset, u8 *data_buf,
if (bp->flash_info->buffered == 0) {
for (addr = data_end; addr < page_end;
addr += 4, i += 4) {
if (addr == page_end-4) {
cmd_flags = BNX2_NVM_COMMAND_LAST;
}
@ -3351,9 +3351,9 @@ bnx2_init_chip(struct bnx2 *bp)
val = BNX2_DMA_CONFIG_DATA_BYTE_SWAP |
BNX2_DMA_CONFIG_DATA_WORD_SWAP |
#ifdef __BIG_ENDIAN
BNX2_DMA_CONFIG_CNTL_BYTE_SWAP |
BNX2_DMA_CONFIG_CNTL_BYTE_SWAP |
#endif
BNX2_DMA_CONFIG_CNTL_WORD_SWAP |
BNX2_DMA_CONFIG_CNTL_WORD_SWAP |
DMA_READ_CHANS << 12 |
DMA_WRITE_CHANS << 16;
@ -3446,7 +3446,7 @@ bnx2_init_chip(struct bnx2 *bp)
REG_WR(bp, BNX2_HC_STATISTICS_ADDR_H,
(u64) bp->stats_blk_mapping >> 32);
REG_WR(bp, BNX2_HC_TX_QUICK_CONS_TRIP,
REG_WR(bp, BNX2_HC_TX_QUICK_CONS_TRIP,
(bp->tx_quick_cons_trip_int << 16) | bp->tx_quick_cons_trip);
REG_WR(bp, BNX2_HC_RX_QUICK_CONS_TRIP,
@ -3511,7 +3511,7 @@ bnx2_init_tx_ring(struct bnx2 *bp)
bp->tx_wake_thresh = bp->tx_ring_size / 2;
txbd = &bp->tx_desc_ring[MAX_TX_DESC_CNT];
txbd->tx_bd_haddr_hi = (u64) bp->tx_desc_mapping >> 32;
txbd->tx_bd_haddr_lo = (u64) bp->tx_desc_mapping & 0xffffffff;
@ -3519,7 +3519,7 @@ bnx2_init_tx_ring(struct bnx2 *bp)
bp->tx_cons = 0;
bp->hw_tx_cons = 0;
bp->tx_prod_bseq = 0;
val = BNX2_L2CTX_TYPE_TYPE_L2;
val |= BNX2_L2CTX_TYPE_SIZE_L2;
CTX_WR(bp, GET_CID_ADDR(TX_CID), BNX2_L2CTX_TYPE, val);
@ -3540,7 +3540,7 @@ bnx2_init_rx_ring(struct bnx2 *bp)
{
struct rx_bd *rxbd;
int i;
u16 prod, ring_prod;
u16 prod, ring_prod;
u32 val;
/* 8 for CRC and VLAN */
@ -3552,7 +3552,7 @@ bnx2_init_rx_ring(struct bnx2 *bp)
bp->rx_cons = 0;
bp->hw_rx_cons = 0;
bp->rx_prod_bseq = 0;
for (i = 0; i < bp->rx_max_ring; i++) {
int j;
@ -3927,7 +3927,7 @@ bnx2_test_memory(struct bnx2 *bp)
return ret;
}
}
return ret;
}
@ -4124,7 +4124,7 @@ bnx2_test_link(struct bnx2 *bp)
bnx2_read_phy(bp, MII_BMSR, &bmsr);
bnx2_read_phy(bp, MII_BMSR, &bmsr);
spin_unlock_bh(&bp->phy_lock);
if (bmsr & BMSR_LSTATUS) {
return 0;
}
@ -4291,7 +4291,7 @@ bnx2_open(struct net_device *dev)
bnx2_free_mem(bp);
return rc;
}
mod_timer(&bp->timer, jiffies + bp->current_interval);
atomic_set(&bp->intr_sem, 0);
@ -4431,7 +4431,7 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
vlan_tag_flags |=
(TX_BD_FLAGS_VLAN_TAG | (vlan_tx_tag_get(skb) << 16));
}
#ifdef BCM_TSO
#ifdef BCM_TSO
if ((mss = skb_shinfo(skb)->gso_size) &&
(skb->len > (bp->dev->mtu + ETH_HLEN))) {
u32 tcp_opt_len, ip_tcp_len;
@ -4470,7 +4470,7 @@ bnx2_start_xmit(struct sk_buff *skb, struct net_device *dev)
}
mapping = pci_map_single(bp->pdev, skb->data, len, PCI_DMA_TODEVICE);
tx_buf = &bp->tx_buf_ring[ring_prod];
tx_buf->skb = skb;
pci_unmap_addr_set(tx_buf, mapping, mapping);
@ -4600,23 +4600,23 @@ bnx2_get_stats(struct net_device *dev)
net_stats->tx_bytes =
GET_NET_STATS(stats_blk->stat_IfHCOutOctets);
net_stats->multicast =
net_stats->multicast =
GET_NET_STATS(stats_blk->stat_IfHCOutMulticastPkts);
net_stats->collisions =
net_stats->collisions =
(unsigned long) stats_blk->stat_EtherStatsCollisions;
net_stats->rx_length_errors =
net_stats->rx_length_errors =
(unsigned long) (stats_blk->stat_EtherStatsUndersizePkts +
stats_blk->stat_EtherStatsOverrsizePkts);
net_stats->rx_over_errors =
net_stats->rx_over_errors =
(unsigned long) stats_blk->stat_IfInMBUFDiscards;
net_stats->rx_frame_errors =
net_stats->rx_frame_errors =
(unsigned long) stats_blk->stat_Dot3StatsAlignmentErrors;
net_stats->rx_crc_errors =
net_stats->rx_crc_errors =
(unsigned long) stats_blk->stat_Dot3StatsFCSErrors;
net_stats->rx_errors = net_stats->rx_length_errors +
@ -4637,7 +4637,7 @@ bnx2_get_stats(struct net_device *dev)
}
net_stats->tx_errors =
(unsigned long)
(unsigned long)
stats_blk->stat_emac_tx_stat_dot3statsinternalmactransmiterrors
+
net_stats->tx_aborted_errors +
@ -4698,7 +4698,7 @@ bnx2_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
return 0;
}
static int
bnx2_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
@ -4711,7 +4711,7 @@ bnx2_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
if (cmd->autoneg == AUTONEG_ENABLE) {
autoneg |= AUTONEG_SPEED;
cmd->advertising &= ETHTOOL_ALL_COPPER_SPEED;
cmd->advertising &= ETHTOOL_ALL_COPPER_SPEED;
/* allow advertising 1 speed */
if ((cmd->advertising == ADVERTISED_10baseT_Half) ||
@ -4988,7 +4988,7 @@ bnx2_set_coalesce(struct net_device *dev, struct ethtool_coalesce *coal)
bp->rx_ticks = (u16) coal->rx_coalesce_usecs;
if (bp->rx_ticks > 0x3ff) bp->rx_ticks = 0x3ff;
bp->rx_quick_cons_trip = (u16) coal->rx_max_coalesced_frames;
bp->rx_quick_cons_trip = (u16) coal->rx_max_coalesced_frames;
if (bp->rx_quick_cons_trip > 0xff) bp->rx_quick_cons_trip = 0xff;
bp->rx_ticks_int = (u16) coal->rx_coalesce_usecs_irq;
@ -5206,46 +5206,46 @@ static const unsigned long bnx2_stats_offset_arr[BNX2_NUM_STATS] = {
STATS_OFFSET32(stat_IfHCOutMulticastPkts_hi),
STATS_OFFSET32(stat_IfHCOutBroadcastPkts_hi),
STATS_OFFSET32(stat_emac_tx_stat_dot3statsinternalmactransmiterrors),
STATS_OFFSET32(stat_Dot3StatsCarrierSenseErrors),
STATS_OFFSET32(stat_Dot3StatsFCSErrors),
STATS_OFFSET32(stat_Dot3StatsAlignmentErrors),
STATS_OFFSET32(stat_Dot3StatsSingleCollisionFrames),
STATS_OFFSET32(stat_Dot3StatsMultipleCollisionFrames),
STATS_OFFSET32(stat_Dot3StatsDeferredTransmissions),
STATS_OFFSET32(stat_Dot3StatsExcessiveCollisions),
STATS_OFFSET32(stat_Dot3StatsLateCollisions),
STATS_OFFSET32(stat_EtherStatsCollisions),
STATS_OFFSET32(stat_EtherStatsFragments),
STATS_OFFSET32(stat_EtherStatsJabbers),
STATS_OFFSET32(stat_EtherStatsUndersizePkts),
STATS_OFFSET32(stat_EtherStatsOverrsizePkts),
STATS_OFFSET32(stat_EtherStatsPktsRx64Octets),
STATS_OFFSET32(stat_EtherStatsPktsRx65Octetsto127Octets),
STATS_OFFSET32(stat_EtherStatsPktsRx128Octetsto255Octets),
STATS_OFFSET32(stat_EtherStatsPktsRx256Octetsto511Octets),
STATS_OFFSET32(stat_EtherStatsPktsRx512Octetsto1023Octets),
STATS_OFFSET32(stat_EtherStatsPktsRx1024Octetsto1522Octets),
STATS_OFFSET32(stat_EtherStatsPktsRx1523Octetsto9022Octets),
STATS_OFFSET32(stat_EtherStatsPktsTx64Octets),
STATS_OFFSET32(stat_EtherStatsPktsTx65Octetsto127Octets),
STATS_OFFSET32(stat_EtherStatsPktsTx128Octetsto255Octets),
STATS_OFFSET32(stat_EtherStatsPktsTx256Octetsto511Octets),
STATS_OFFSET32(stat_EtherStatsPktsTx512Octetsto1023Octets),
STATS_OFFSET32(stat_EtherStatsPktsTx1024Octetsto1522Octets),
STATS_OFFSET32(stat_EtherStatsPktsTx1523Octetsto9022Octets),
STATS_OFFSET32(stat_XonPauseFramesReceived),
STATS_OFFSET32(stat_XoffPauseFramesReceived),
STATS_OFFSET32(stat_OutXonSent),
STATS_OFFSET32(stat_OutXoffSent),
STATS_OFFSET32(stat_MacControlFramesReceived),
STATS_OFFSET32(stat_IfInFramesL2FilterDiscards),
STATS_OFFSET32(stat_IfInMBUFDiscards),
STATS_OFFSET32(stat_Dot3StatsCarrierSenseErrors),
STATS_OFFSET32(stat_Dot3StatsFCSErrors),
STATS_OFFSET32(stat_Dot3StatsAlignmentErrors),
STATS_OFFSET32(stat_Dot3StatsSingleCollisionFrames),
STATS_OFFSET32(stat_Dot3StatsMultipleCollisionFrames),
STATS_OFFSET32(stat_Dot3StatsDeferredTransmissions),
STATS_OFFSET32(stat_Dot3StatsExcessiveCollisions),
STATS_OFFSET32(stat_Dot3StatsLateCollisions),
STATS_OFFSET32(stat_EtherStatsCollisions),
STATS_OFFSET32(stat_EtherStatsFragments),
STATS_OFFSET32(stat_EtherStatsJabbers),
STATS_OFFSET32(stat_EtherStatsUndersizePkts),
STATS_OFFSET32(stat_EtherStatsOverrsizePkts),
STATS_OFFSET32(stat_EtherStatsPktsRx64Octets),
STATS_OFFSET32(stat_EtherStatsPktsRx65Octetsto127Octets),
STATS_OFFSET32(stat_EtherStatsPktsRx128Octetsto255Octets),
STATS_OFFSET32(stat_EtherStatsPktsRx256Octetsto511Octets),
STATS_OFFSET32(stat_EtherStatsPktsRx512Octetsto1023Octets),
STATS_OFFSET32(stat_EtherStatsPktsRx1024Octetsto1522Octets),
STATS_OFFSET32(stat_EtherStatsPktsRx1523Octetsto9022Octets),
STATS_OFFSET32(stat_EtherStatsPktsTx64Octets),
STATS_OFFSET32(stat_EtherStatsPktsTx65Octetsto127Octets),
STATS_OFFSET32(stat_EtherStatsPktsTx128Octetsto255Octets),
STATS_OFFSET32(stat_EtherStatsPktsTx256Octetsto511Octets),
STATS_OFFSET32(stat_EtherStatsPktsTx512Octetsto1023Octets),
STATS_OFFSET32(stat_EtherStatsPktsTx1024Octetsto1522Octets),
STATS_OFFSET32(stat_EtherStatsPktsTx1523Octetsto9022Octets),
STATS_OFFSET32(stat_XonPauseFramesReceived),
STATS_OFFSET32(stat_XoffPauseFramesReceived),
STATS_OFFSET32(stat_OutXonSent),
STATS_OFFSET32(stat_OutXoffSent),
STATS_OFFSET32(stat_MacControlFramesReceived),
STATS_OFFSET32(stat_IfInFramesL2FilterDiscards),
STATS_OFFSET32(stat_IfInMBUFDiscards),
STATS_OFFSET32(stat_FwRxDrop),
};
/* stat_IfHCInBadOctets and stat_Dot3StatsCarrierSenseErrors are
* skipped because of errata.
*/
*/
static u8 bnx2_5706_stats_len_arr[BNX2_NUM_STATS] = {
8,0,8,8,8,8,8,8,8,8,
4,0,4,4,4,4,4,4,4,4,
@ -5665,7 +5665,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
bp->flags |= PCIX_FLAG;
clkreg = REG_RD(bp, BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS);
clkreg &= BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET;
switch (clkreg) {
case BNX2_PCICFG_PCI_CLOCK_CONTROL_BITS_PCI_CLK_SPD_DET_133MHZ:
@ -5762,7 +5762,7 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)
bp->tx_quick_cons_trip = 20;
bp->tx_ticks_int = 80;
bp->tx_ticks = 80;
bp->rx_quick_cons_trip_int = 6;
bp->rx_quick_cons_trip = 6;
bp->rx_ticks_int = 18;

Просмотреть файл

@ -22,9 +22,9 @@
*/
struct tx_bd {
u32 tx_bd_haddr_hi;
u32 tx_bd_haddr_lo;
u32 tx_bd_mss_nbytes;
u32 tx_bd_vlan_tag_flags;
u32 tx_bd_haddr_lo;
u32 tx_bd_mss_nbytes;
u32 tx_bd_vlan_tag_flags;
#define TX_BD_FLAGS_CONN_FAULT (1<<0)
#define TX_BD_FLAGS_TCP_UDP_CKSUM (1<<1)
#define TX_BD_FLAGS_IP_CKSUM (1<<2)
@ -3893,7 +3893,7 @@ struct bnx2 {
u16 tx_cons __attribute__((aligned(L1_CACHE_BYTES)));
u16 hw_tx_cons;
#ifdef BCM_VLAN
#ifdef BCM_VLAN
struct vlan_group *vlgrp;
#endif
@ -3950,7 +3950,7 @@ struct bnx2 {
#define CHIP_REV_Ax 0x00000000
#define CHIP_REV_Bx 0x00001000
#define CHIP_REV_Cx 0x00002000
#define CHIP_METAL(bp) (((bp)->chip_id) & 0x00000ff0)
#define CHIP_BONDING(bp) (((bp)->chip_id) & 0x0000000f)
@ -3969,7 +3969,7 @@ struct bnx2 {
u32 phy_addr;
u32 phy_id;
u16 bus_speed_mhz;
u8 wol;
@ -4025,7 +4025,7 @@ struct bnx2 {
u32 advertising;
u8 req_flow_ctrl; /* flow ctrl advertisement */
u8 req_flow_ctrl; /* flow ctrl advertisement */
/* settings or forced */
/* settings */
u8 autoneg;
@ -4179,7 +4179,7 @@ struct fw_info {
#define BNX2_DRV_MSG_DATA_WAIT1 0x00020000
#define BNX2_DRV_MSG_DATA_WAIT2 0x00030000
#define BNX2_DRV_MSG_DATA_WAIT3 0x00040000
#define BNX2_DRV_MSG_SEQ 0x0000ffff
#define BNX2_FW_MB 0x00000008
@ -4189,38 +4189,38 @@ struct fw_info {
#define BNX2_FW_MSG_STATUS_FAILURE 0x00ff0000
#define BNX2_LINK_STATUS 0x0000000c
#define BNX2_LINK_STATUS_INIT_VALUE 0xffffffff
#define BNX2_LINK_STATUS_LINK_UP 0x1
#define BNX2_LINK_STATUS_LINK_DOWN 0x0
#define BNX2_LINK_STATUS_INIT_VALUE 0xffffffff
#define BNX2_LINK_STATUS_LINK_UP 0x1
#define BNX2_LINK_STATUS_LINK_DOWN 0x0
#define BNX2_LINK_STATUS_SPEED_MASK 0x1e
#define BNX2_LINK_STATUS_AN_INCOMPLETE (0<<1)
#define BNX2_LINK_STATUS_10HALF (1<<1)
#define BNX2_LINK_STATUS_10FULL (2<<1)
#define BNX2_LINK_STATUS_100HALF (3<<1)
#define BNX2_LINK_STATUS_100BASE_T4 (4<<1)
#define BNX2_LINK_STATUS_100FULL (5<<1)
#define BNX2_LINK_STATUS_1000HALF (6<<1)
#define BNX2_LINK_STATUS_1000FULL (7<<1)
#define BNX2_LINK_STATUS_2500HALF (8<<1)
#define BNX2_LINK_STATUS_2500FULL (9<<1)
#define BNX2_LINK_STATUS_AN_ENABLED (1<<5)
#define BNX2_LINK_STATUS_AN_COMPLETE (1<<6)
#define BNX2_LINK_STATUS_PARALLEL_DET (1<<7)
#define BNX2_LINK_STATUS_RESERVED (1<<8)
#define BNX2_LINK_STATUS_PARTNER_AD_1000FULL (1<<9)
#define BNX2_LINK_STATUS_PARTNER_AD_1000HALF (1<<10)
#define BNX2_LINK_STATUS_PARTNER_AD_100BT4 (1<<11)
#define BNX2_LINK_STATUS_PARTNER_AD_100FULL (1<<12)
#define BNX2_LINK_STATUS_PARTNER_AD_100HALF (1<<13)
#define BNX2_LINK_STATUS_PARTNER_AD_10FULL (1<<14)
#define BNX2_LINK_STATUS_PARTNER_AD_10HALF (1<<15)
#define BNX2_LINK_STATUS_TX_FC_ENABLED (1<<16)
#define BNX2_LINK_STATUS_RX_FC_ENABLED (1<<17)
#define BNX2_LINK_STATUS_PARTNER_SYM_PAUSE_CAP (1<<18)
#define BNX2_LINK_STATUS_PARTNER_ASYM_PAUSE_CAP (1<<19)
#define BNX2_LINK_STATUS_SERDES_LINK (1<<20)
#define BNX2_LINK_STATUS_PARTNER_AD_2500FULL (1<<21)
#define BNX2_LINK_STATUS_PARTNER_AD_2500HALF (1<<22)
#define BNX2_LINK_STATUS_AN_INCOMPLETE (0<<1)
#define BNX2_LINK_STATUS_10HALF (1<<1)
#define BNX2_LINK_STATUS_10FULL (2<<1)
#define BNX2_LINK_STATUS_100HALF (3<<1)
#define BNX2_LINK_STATUS_100BASE_T4 (4<<1)
#define BNX2_LINK_STATUS_100FULL (5<<1)
#define BNX2_LINK_STATUS_1000HALF (6<<1)
#define BNX2_LINK_STATUS_1000FULL (7<<1)
#define BNX2_LINK_STATUS_2500HALF (8<<1)
#define BNX2_LINK_STATUS_2500FULL (9<<1)
#define BNX2_LINK_STATUS_AN_ENABLED (1<<5)
#define BNX2_LINK_STATUS_AN_COMPLETE (1<<6)
#define BNX2_LINK_STATUS_PARALLEL_DET (1<<7)
#define BNX2_LINK_STATUS_RESERVED (1<<8)
#define BNX2_LINK_STATUS_PARTNER_AD_1000FULL (1<<9)
#define BNX2_LINK_STATUS_PARTNER_AD_1000HALF (1<<10)
#define BNX2_LINK_STATUS_PARTNER_AD_100BT4 (1<<11)
#define BNX2_LINK_STATUS_PARTNER_AD_100FULL (1<<12)
#define BNX2_LINK_STATUS_PARTNER_AD_100HALF (1<<13)
#define BNX2_LINK_STATUS_PARTNER_AD_10FULL (1<<14)
#define BNX2_LINK_STATUS_PARTNER_AD_10HALF (1<<15)
#define BNX2_LINK_STATUS_TX_FC_ENABLED (1<<16)
#define BNX2_LINK_STATUS_RX_FC_ENABLED (1<<17)
#define BNX2_LINK_STATUS_PARTNER_SYM_PAUSE_CAP (1<<18)
#define BNX2_LINK_STATUS_PARTNER_ASYM_PAUSE_CAP (1<<19)
#define BNX2_LINK_STATUS_SERDES_LINK (1<<20)
#define BNX2_LINK_STATUS_PARTNER_AD_2500FULL (1<<21)
#define BNX2_LINK_STATUS_PARTNER_AD_2500HALF (1<<22)
#define BNX2_DRV_PULSE_MB 0x00000010
#define BNX2_DRV_PULSE_SEQ_MASK 0x00007fff
@ -4400,7 +4400,7 @@ struct fw_info {
0x00020000)
#define BNX2_BC_STATE_RESET_TYPE_VAUX (BNX2_BC_STATE_RESET_TYPE_SIG | \
0x00030000)
#define BNX2_BC_STATE_RESET_TYPE_DRV_MASK DRV_MSG_CODE
#define BNX2_BC_STATE_RESET_TYPE_DRV_MASK DRV_MSG_CODE
#define BNX2_BC_STATE_RESET_TYPE_DRV_RESET (BNX2_BC_STATE_RESET_TYPE_SIG | \
DRV_MSG_CODE_RESET)
#define BNX2_BC_STATE_RESET_TYPE_DRV_UNLOAD (BNX2_BC_STATE_RESET_TYPE_SIG | \
@ -4443,7 +4443,7 @@ struct fw_info {
#define BNX2_BC_STATE_ERR_DRV_DEAD (BNX2_BC_STATE_SIGN | 0x0500)
#define BNX2_BC_STATE_ERR_NO_RXP (BNX2_BC_STATE_SIGN | 0x0600)
#define BNX2_BC_STATE_ERR_TOO_MANY_RBUF (BNX2_BC_STATE_SIGN | 0x0700)
#define BNX2_BC_STATE_DEBUG_CMD 0x1dc
#define BNX2_BC_STATE_BC_DBG_CMD_SIGNATURE 0x42440000
#define BNX2_BC_STATE_BC_DBG_CMD_SIGNATURE_MASK 0xffff0000

Просмотреть файл

@ -1,5 +1,5 @@
/*
* Update: The Berkeley copyright was changed, and the change
* Update: The Berkeley copyright was changed, and the change
* is retroactive to all "true" BSD software (ie everything
* from UCB as opposed to other peoples code that just carried
* the same license). The new copyright doesn't clash with the
@ -256,9 +256,9 @@ static int bsd_check (struct bsd_db *db) /* 1=output CLEAR */
db->in_count -= (db->in_count >> 2);
db->bytes_out -= (db->bytes_out >> 2);
}
db->checkpoint = db->in_count + CHECK_GAP;
if (db->max_ent >= db->maxmaxcode)
{
/* Reset the dictionary only if the ratio is worse,
@ -274,7 +274,7 @@ static int bsd_check (struct bsd_db *db) /* 1=output CLEAR */
{
new_ratio /= db->bytes_out;
}
if (new_ratio < db->ratio || new_ratio < 1 * RATIO_SCALE)
{
bsd_clear (db);
@ -293,7 +293,7 @@ static int bsd_check (struct bsd_db *db) /* 1=output CLEAR */
static void bsd_comp_stats (void *state, struct compstat *stats)
{
struct bsd_db *db = (struct bsd_db *) state;
stats->unc_bytes = db->uncomp_bytes;
stats->unc_packets = db->uncomp_count;
stats->comp_bytes = db->comp_bytes;
@ -325,7 +325,7 @@ static void bsd_reset (void *state)
static void bsd_free (void *state)
{
struct bsd_db *db = state;
if (!db)
return;
@ -468,7 +468,7 @@ static int bsd_init (void *state, unsigned char *options,
{
struct bsd_db *db = state;
int indx;
if ((opt_len != 3) || (options[0] != CI_BSD_COMPRESS) || (options[1] != 3)
|| (BSD_VERSION(options[2]) != BSD_CURRENT_VERSION)
|| (BSD_NBITS(options[2]) != db->maxbits)
@ -500,9 +500,9 @@ static int bsd_init (void *state, unsigned char *options,
if (debug)
#endif
db->debug = 1;
bsd_reset(db);
return 1;
}
@ -660,7 +660,7 @@ static int bsd_compress (void *state, unsigned char *rptr, unsigned char *obuf,
fcode = BSD_KEY (ent, c);
hval = BSD_HASH (ent, c, hshift);
dictp = dict_ptr (db, hval);
/* Validate and then check the entry. */
if (dictp->codem1 >= max_ent)
{
@ -672,7 +672,7 @@ static int bsd_compress (void *state, unsigned char *rptr, unsigned char *obuf,
ent = dictp->codem1 + 1;
continue; /* found (prefix,suffix) */
}
/* continue probing until a match or invalid entry */
disp = (hval == 0) ? 1 : hval;
@ -693,10 +693,10 @@ static int bsd_compress (void *state, unsigned char *rptr, unsigned char *obuf,
ent = dictp->codem1 + 1; /* finally found (prefix,suffix) */
continue;
nomatch:
OUTPUT(ent); /* output the prefix */
/* code -> hashtable */
if (max_ent < db->maxmaxcode)
{
@ -710,7 +710,7 @@ nomatch:
db->n_bits = ++n_bits;
mxcode = MAXCODE (n_bits);
}
/* Invalidate old hash table entry using
* this code, and then take it over.
*/
@ -738,7 +738,7 @@ nomatch:
}
ent = c;
}
OUTPUT(ent); /* output the last code */
db->bytes_out += olen - PPP_HDRLEN - BSD_OVHD;
@ -760,7 +760,7 @@ nomatch:
{
OUTPUT (CLEAR);
}
/*
* Pad dribble bits of last code with ones.
* Do not emit a completely useless byte of ones.
@ -770,7 +770,7 @@ nomatch:
{
PUTBYTE((accm | (0xff << (bitno-8))) >> 24);
}
/*
* Increase code size if we would have without the packet
* boundary because the decompressor will do so.
@ -856,7 +856,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize,
bitno = 32; /* 1st valid bit in accm */
n_bits = db->n_bits;
tgtbitno = 32 - n_bits; /* bitno when we have a code */
/*
* Save the address/control from the PPP header
* and then get the sequence number.
@ -869,7 +869,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize,
ibuf += (PPP_HDRLEN + 2);
ilen = isize - (PPP_HDRLEN + 2);
/*
* Check the sequence number and give up if it differs from
* the value we're expecting.
@ -897,7 +897,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize,
*wptr++ = adrs;
*wptr++ = ctrl;
*wptr++ = 0;
oldcode = CLEAR;
explen = 3;
@ -934,7 +934,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize,
/*
* The dictionary must only be cleared at the end of a packet.
*/
if (incode == CLEAR)
{
if (ilen > 0)
@ -945,7 +945,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize,
}
return DECOMP_FATALERROR; /* probably a bug */
}
bsd_clear(db);
break;
}
@ -962,7 +962,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize,
}
return DECOMP_FATALERROR; /* probably a bug */
}
/* Special case for KwKwK string. */
if (incode > max_ent)
{
@ -974,7 +974,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize,
finchar = incode;
extra = 0;
}
codelen = *(lens_ptr (db, finchar));
explen += codelen + extra;
if (explen > osize)
@ -989,7 +989,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize,
}
return DECOMP_FATALERROR;
}
/*
* Decode this code and install it in the decompressed buffer.
*/
@ -999,7 +999,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize,
while (finchar > LAST)
{
struct bsd_dict *dictp2 = dict_ptr (db, finchar);
dictp = dict_ptr (db, dictp2->cptr);
#ifdef DEBUG
if (--codelen <= 0 || dictp->codem1 != finchar-1)
@ -1029,7 +1029,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize,
finchar = dictp->f.hs.prefix;
}
*--p = finchar;
#ifdef DEBUG
if (--codelen != 0)
{
@ -1037,12 +1037,12 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize,
db->unit, codelen, incode, max_ent);
}
#endif
if (extra) /* the KwKwK case again */
{
*wptr++ = finchar;
}
/*
* If not first code in a packet, and
* if not out of code space, then allocate a new code.
@ -1057,11 +1057,11 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize,
unsigned short *lens1, *lens2;
unsigned long fcode;
int hval, disp, indx;
fcode = BSD_KEY(oldcode,finchar);
hval = BSD_HASH(oldcode,finchar,db->hshift);
dictp = dict_ptr (db, hval);
/* look for a free hash table entry */
if (dictp->codem1 < max_ent)
{
@ -1077,7 +1077,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize,
}
while (dictp->codem1 < max_ent);
}
/*
* Invalidate previous hash table entry
* assigned this code, and then take it over
@ -1101,7 +1101,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize,
lens1 = lens_ptr (db, max_ent);
lens2 = lens_ptr (db, oldcode);
*lens1 = *lens2 + 1;
/* Expand code size if needed. */
if (max_ent >= MAXCODE(n_bits) && max_ent < db->maxmaxcode)
{
@ -1127,7 +1127,7 @@ static int bsd_decompress (void *state, unsigned char *ibuf, int isize,
}
return explen;
}
/*************************************************************
* Table of addresses for the BSD compression module
*************************************************************/

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Разница между файлами не показана из-за своего большого размера Загрузить разницу

Просмотреть файл

@ -15,13 +15,13 @@
Changelog:
Mike Cruse : mcruse@cti-ltd.com
: Changes for Linux 2.0 compatibility.
: Changes for Linux 2.0 compatibility.
: Added dev_id parameter in net_interrupt(),
: request_irq() and free_irq(). Just NULL for now.
Mike Cruse : Added MOD_INC_USE_COUNT and MOD_DEC_USE_COUNT macros
: in net_open() and net_close() so kerneld would know
: that the module is in use and wouldn't eject the
: that the module is in use and wouldn't eject the
: driver prematurely.
Mike Cruse : Rewrote init_module() and cleanup_module using 8390.c
@ -31,7 +31,7 @@
Russ Nelson : Jul 13 1998. Added RxOnly DMA support.
Melody Lee : Aug 10 1999. Changes for Linux 2.2.5 compatibility.
Melody Lee : Aug 10 1999. Changes for Linux 2.2.5 compatibility.
: email: ethernet@crystal.cirrus.com
Alan Cox : Removed 1.2 support, added 2.1 extra counters.
@ -163,12 +163,12 @@ static char version[] __initdata =
/* First, a few definitions that the brave might change.
A zero-terminated list of I/O addresses to be probed. Some special flags..
Addr & 1 = Read back the address port, look for signature and reset
the page window before probing
Addr & 3 = Reset the page window and probe
the page window before probing
Addr & 3 = Reset the page window and probe
The CLPS eval board has the Cirrus chip at 0x80090300, in ARM IO space,
but it is possible that a Cirrus board could be plugged into the ISA
slots. */
/* The cs8900 has 4 IRQ pins, software selectable. cs8900_irq_map maps
/* The cs8900 has 4 IRQ pins, software selectable. cs8900_irq_map maps
them to system IRQ numbers. This mapping is card specific and is set to
the configuration of the Cirrus Eval board for this chip. */
#ifdef CONFIG_ARCH_CLPS7500
@ -299,7 +299,7 @@ static int __init media_fn(char *str)
__setup("cs89x0_media=", media_fn);
/* Check for a network adaptor of this type, and return '0' iff one exists.
If dev->base_addr == 0, probe all likely locations.
If dev->base_addr == 1, always return failure.
@ -630,7 +630,7 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
dev->base_addr);
reset_chip(dev);
/* Here we read the current configuration of the chip. If there
is no Extended EEPROM then the idea is to not disturb the chip
configuration, it should have been correctly setup by automatic
@ -654,7 +654,7 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
cnt = (*confd++ & 0x00ff) >> 1;
while (--cnt > 0) {
__u16 j = *confd++;
switch (j & 0x0fff) {
case PP_IA:
for (i = 0; i < ETH_ALEN/2; i++) {
@ -670,7 +670,7 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
} else
#endif
if ((readreg(dev, PP_SelfST) & (EEPROM_OK | EEPROM_PRESENT)) ==
if ((readreg(dev, PP_SelfST) & (EEPROM_OK | EEPROM_PRESENT)) ==
(EEPROM_OK|EEPROM_PRESENT)) {
/* Load the MAC. */
for (i=0; i < ETH_ALEN/2; i++) {
@ -679,17 +679,17 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
dev->dev_addr[i*2] = Addr & 0xFF;
dev->dev_addr[i*2+1] = Addr >> 8;
}
/* Load the Adapter Configuration.
Note: Barring any more specific information from some
other source (ie EEPROM+Schematics), we would not know
how to operate a 10Base2 interface on the AUI port.
However, since we do read the status of HCB1 and use
settings that always result in calls to control_dc_dc(dev,0)
a BNC interface should work if the enable pin
(dc/dc converter) is on HCB1. It will be called AUI
/* Load the Adapter Configuration.
Note: Barring any more specific information from some
other source (ie EEPROM+Schematics), we would not know
how to operate a 10Base2 interface on the AUI port.
However, since we do read the status of HCB1 and use
settings that always result in calls to control_dc_dc(dev,0)
a BNC interface should work if the enable pin
(dc/dc converter) is on HCB1. It will be called AUI
however. */
lp->adapter_cnf = 0;
i = readreg(dev, PP_LineCTL);
/* Preserve the setting of the HCB1 pin. */
@ -706,22 +706,22 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
lp->adapter_cnf |= A_CNF_AUI | A_CNF_MEDIA_AUI;
/* Check if the card is in Auto mode. */
if ((i & (AUI_ONLY | AUTO_AUI_10BASET)) == AUTO_AUI_10BASET)
lp->adapter_cnf |= A_CNF_AUI | A_CNF_10B_T |
lp->adapter_cnf |= A_CNF_AUI | A_CNF_10B_T |
A_CNF_MEDIA_AUI | A_CNF_MEDIA_10B_T | A_CNF_MEDIA_AUTO;
if (net_debug > 1)
printk(KERN_INFO "%s: PP_LineCTL=0x%x, adapter_cnf=0x%x\n",
dev->name, i, lp->adapter_cnf);
/* IRQ. Other chips already probe, see below. */
if (lp->chip_type == CS8900)
if (lp->chip_type == CS8900)
lp->isa_config = readreg(dev, PP_CS8900_ISAINT) & INT_NO_MASK;
printk( "[Cirrus EEPROM] ");
}
printk("\n");
/* First check to see if an EEPROM is attached. */
#ifdef CONFIG_SH_HICOSH4 /* no EEPROM on HiCO, don't hazzle with it here */
if (1) {
@ -736,13 +736,13 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
/* Check if the chip was able to read its own configuration starting
at 0 in the EEPROM*/
if ((readreg(dev, PP_SelfST) & (EEPROM_OK | EEPROM_PRESENT)) !=
(EEPROM_OK|EEPROM_PRESENT))
(EEPROM_OK|EEPROM_PRESENT))
printk(KERN_WARNING "cs89x0: Extended EEPROM checksum bad and no Cirrus EEPROM, relying on command line\n");
} else {
/* This reads an extended EEPROM that is not documented
in the CS8900 datasheet. */
/* get transmission control word but keep the autonegotiation bits */
if (!lp->auto_neg_cnf) lp->auto_neg_cnf = eeprom_buff[AUTO_NEG_CNF_OFFSET/2];
/* Store adapter configuration */
@ -810,7 +810,7 @@ cs89x0_probe1(struct net_device *dev, int ioaddr, int modular)
printk("\ncs89x0: invalid ISA interrupt number %d\n", i);
else
i = cs8900_irq_map[i];
lp->irq_map = CS8900_IRQ_MAP; /* fixed IRQ map for CS8900 */
} else {
int irq_map_buff[IRQ_MAP_LEN/2];
@ -875,7 +875,7 @@ out1:
return retval;
}
/*********************************
* This page contains DMA routines
**********************************/
@ -1064,14 +1064,14 @@ void __init reset_chip(struct net_device *dev)
;
}
static void
control_dc_dc(struct net_device *dev, int on_not_off)
{
struct net_local *lp = netdev_priv(dev);
unsigned int selfcontrol;
int timenow = jiffies;
/* control the DC to DC convertor in the SelfControl register.
/* control the DC to DC convertor in the SelfControl register.
Note: This is hooked up to a general purpose pin, might not
always be a DC to DC convertor. */
@ -1240,7 +1240,7 @@ detect_bnc(struct net_device *dev)
return DETECTED_NONE;
}
static void
write_irq(struct net_device *dev, int chip_type, int irq)
{
@ -1544,7 +1544,7 @@ static int net_send_packet(struct sk_buff *skb, struct net_device *dev)
* Gasp! It hasn't. But that shouldn't happen since
* we're waiting for TxOk, so return 1 and requeue this packet.
*/
spin_unlock_irq(&lp->lock);
if (net_debug) printk("cs89x0: Tx buffer not free!\n");
return 1;
@ -1569,10 +1569,10 @@ static int net_send_packet(struct sk_buff *skb, struct net_device *dev)
return 0;
}
/* The typical workload of the driver:
Handle the network interface interrupts. */
static irqreturn_t net_interrupt(int irq, void *dev_id, struct pt_regs * regs)
{
struct net_device *dev = dev_id;
@ -1740,7 +1740,7 @@ net_close(struct net_device *dev)
#endif
netif_stop_queue(dev);
writereg(dev, PP_RxCFG, 0);
writereg(dev, PP_TxCFG, 0);
writereg(dev, PP_BufCFG, 0);
@ -1791,7 +1791,7 @@ static void set_multicast_list(struct net_device *dev)
/* The multicast-accept list is initialized to accept-all, and we
rely on higher-level filtering for now. */
lp->rx_mode = RX_MULTCAST_ACCEPT;
}
}
else
lp->rx_mode = 0;
@ -1833,8 +1833,8 @@ static int set_mac_address(struct net_device *dev, void *p)
static struct net_device *dev_cs89x0;
/*
* Support the 'debug' module parm even if we're compiled for non-debug to
* avoid breaking someone's startup scripts
* Support the 'debug' module parm even if we're compiled for non-debug to
* avoid breaking someone's startup scripts
*/
static int io;
@ -1983,7 +1983,7 @@ cleanup_module(void)
free_netdev(dev_cs89x0);
}
#endif /* MODULE */
/*
* Local variables:
* version-control: t

Просмотреть файл

@ -427,8 +427,8 @@
#define DMA_SIZE (16*1024) /* Size of dma buffer - 16k */
#define CS8900 0x0000
#define CS8920 0x4000
#define CS8920M 0x6000
#define CS8920 0x4000
#define CS8920M 0x6000
#define REVISON_BITS 0x1F00
#define EEVER_NUMBER 0x12
#define CHKSUM_LEN 0x14

Просмотреть файл

@ -179,7 +179,7 @@ static inline void trigger_interrupt(struct net_device *dev)
* Copy a buffer to the adapter transmit page memory.
* Start sending.
*/
static int de600_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
unsigned long flags;
@ -272,7 +272,7 @@ static irqreturn_t de600_interrupt(int irq, void *dev_id, struct pt_regs * regs)
}
spin_lock(&de600_lock);
select_nic();
irq_status = de600_read_status(dev);

Просмотреть файл

@ -40,7 +40,7 @@
*****************************************************************************/
static const char version[] =
"de620.c: $Revision: 1.40 $, Bjorn Ekwall <bj0rn@blox.se>\n";
/***********************************************************************
*
* "Tuning" section.
@ -115,7 +115,7 @@ static const char version[] =
#define COUNT_LOOPS
*/
#endif
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/types.h>
@ -250,7 +250,7 @@ static struct nic {
byte Media;
byte SCR;
} nic_data;
/**********************************************************
* *
* Convenience macros/functions for D-Link DE-620 adapter *
@ -432,7 +432,7 @@ de620_get_register(struct net_device *dev, byte reg)
return value;
}
/*********************************************************************
*
* Open/initialize the board.
@ -515,10 +515,10 @@ static void de620_set_multicast_list(struct net_device *dev)
}
/*******************************************************
*
*
* Handle timeouts on transmit
*/
static void de620_timeout(struct net_device *dev)
{
printk(KERN_WARNING "%s: transmit timed out, %s?\n", dev->name, "network cable problem");
@ -540,9 +540,9 @@ static int de620_start_xmit(struct sk_buff *skb, struct net_device *dev)
byte using_txbuf;
using_txbuf = de620_tx_buffs(dev); /* Peek at the adapter */
netif_stop_queue(dev);
if ((len = skb->len) < RUNT)
len = RUNT;
@ -584,7 +584,7 @@ static int de620_start_xmit(struct sk_buff *skb, struct net_device *dev)
dev_kfree_skb (skb);
return 0;
}
/*****************************************************
*
* Handle the network interface interrupts.
@ -599,7 +599,7 @@ de620_interrupt(int irq_in, void *dev_id, struct pt_regs *regs)
int again = 0;
spin_lock(&de620_lock);
/* Read the status register (_not_ the status port) */
irq_status = de620_get_register(dev, R_STS);
@ -615,7 +615,7 @@ de620_interrupt(int irq_in, void *dev_id, struct pt_regs *regs)
if(de620_tx_buffs(dev) != (TXBF0 | TXBF1))
netif_wake_queue(dev);
spin_unlock(&de620_lock);
return IRQ_HANDLED;
}
@ -720,7 +720,7 @@ static int de620_rx_intr(struct net_device *dev)
return (next_rx_page != curr_page); /* That was slightly tricky... */
}
/*********************************************
*
* Reset the adapter to a known state
@ -803,7 +803,7 @@ static int adapter_init(struct net_device *dev)
return 0; /* all ok */
}
/******************************************************************************
*
* Only start-up code below
@ -827,7 +827,7 @@ struct net_device * __init de620_probe(int unit)
SET_MODULE_OWNER(dev);
spin_lock_init(&de620_lock);
/*
* This is where the base_addr and irq gets set.
* Tunable at compile-time and insmod-time
@ -840,7 +840,7 @@ struct net_device * __init de620_probe(int unit)
sprintf(dev->name, "eth%d", unit);
netdev_boot_setup_check(dev);
}
if (de620_debug)
printk(version);
@ -889,7 +889,7 @@ struct net_device * __init de620_probe(int unit)
dev->tx_timeout = de620_timeout;
dev->watchdog_timeo = HZ*2;
dev->set_multicast_list = de620_set_multicast_list;
/* base_addr and irq are already set, see above! */
/* dump eeprom */
@ -917,7 +917,7 @@ out1:
out:
return ERR_PTR(err);
}
/**********************************
*
* Read info from on-board EEPROM
@ -1003,7 +1003,7 @@ static int __init read_eeprom(struct net_device *dev)
return 0; /* no errors */
}
/******************************************************************************
*
* Loadable module skeleton
@ -1029,7 +1029,7 @@ void cleanup_module(void)
#endif /* MODULE */
MODULE_LICENSE("GPL");
/*
* (add '-DMODULE' when compiling as loadable module)
*

Просмотреть файл

@ -1,4 +1,4 @@
/*
/*
* Lance ethernet driver for the MIPS processor based
* DECstation family
*
@ -158,9 +158,9 @@ MODULE_LICENSE("GPL");
/* The DS2000/3000 have a linear 64 KB buffer.
* The PMAD-AA has 128 kb buffer on-board.
* The PMAD-AA has 128 kb buffer on-board.
*
* The IOASIC LANCE devices use a shared memory region. This region as seen
* The IOASIC LANCE devices use a shared memory region. This region as seen
* from the CPU is (max) 128 KB long and has to be on an 128 KB boundary.
* The LANCE sees this as a 64 KB long continuous memory region.
*
@ -882,7 +882,7 @@ static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev)
skblen = skb->len;
len = skblen;
if (len < ETH_ZLEN) {
if (skb_padto(skb, ETH_ZLEN))
return 0;

Просмотреть файл

@ -275,7 +275,7 @@ static void dfx_xmt_flush(DFX_board_t *bp);
static struct net_device *root_dfx_eisa_dev;
/*
* =======================
* = dfx_port_write_byte =
@ -283,13 +283,13 @@ static struct net_device *root_dfx_eisa_dev;
* = dfx_port_write_long =
* = dfx_port_read_long =
* =======================
*
*
* Overview:
* Routines for reading and writing values from/to adapter
*
*
* Returns:
* None
*
*
* Arguments:
* bp - pointer to board information
* offset - register offset from base I/O address
@ -301,7 +301,7 @@ static struct net_device *root_dfx_eisa_dev;
* Functional Description:
* These routines perform the correct operation to read or write
* the adapter register.
*
*
* EISA port block base addresses are based on the slot number in which the
* controller is installed. For example, if the EISA controller is installed
* in slot 4, the port block base address is 0x4000. If the controller is
@ -377,18 +377,18 @@ static inline void dfx_port_read_long(
*data = inl(port);
}
/*
* =============
* = dfx_init_one_pci_or_eisa =
* =============
*
*
* Overview:
* Initializes a supported FDDI EISA or PCI controller
*
*
* Returns:
* Condition code
*
*
* Arguments:
* pdev - pointer to pci device information (NULL for EISA)
* ioaddr - pointer to port (NULL for PCI)
@ -537,18 +537,18 @@ static int __init dfx_eisa_init(void)
}
return rc;
}
/*
* ================
* = dfx_bus_init =
* ================
*
*
* Overview:
* Initializes EISA and PCI controller bus-specific logic.
*
*
* Returns:
* None
*
*
* Arguments:
* dev - pointer to device information
*
@ -672,19 +672,19 @@ static void __devinit dfx_bus_init(struct net_device *dev)
}
}
/*
* ========================
* = dfx_bus_config_check =
* ========================
*
*
* Overview:
* Checks the configuration (burst size, full-duplex, etc.) If any parameters
* are illegal, then this routine will set new defaults.
*
*
* Returns:
* None
*
*
* Arguments:
* bp - pointer to board information
*
@ -766,19 +766,19 @@ static void __devinit dfx_bus_config_check(DFX_board_t *bp)
}
}
/*
* ===================
* = dfx_driver_init =
* ===================
*
*
* Overview:
* Initializes remaining adapter board structure information
* and makes sure adapter is in a safe state prior to dfx_open().
*
*
* Returns:
* Condition code
*
*
* Arguments:
* dev - pointer to device information
* print_name - printable device name
@ -984,18 +984,18 @@ static int __devinit dfx_driver_init(struct net_device *dev,
return(DFX_K_SUCCESS);
}
/*
* =================
* = dfx_adap_init =
* =================
*
*
* Overview:
* Brings the adapter to the link avail/link unavailable state.
*
*
* Returns:
* Condition code
*
*
* Arguments:
* bp - pointer to board information
* get_buffers - non-zero if buffers to be allocated
@ -1188,18 +1188,18 @@ static int dfx_adap_init(DFX_board_t *bp, int get_buffers)
return(DFX_K_SUCCESS);
}
/*
* ============
* = dfx_open =
* ============
*
*
* Overview:
* Opens the adapter
*
*
* Returns:
* Condition code
*
*
* Arguments:
* dev - pointer to device information
*
@ -1225,7 +1225,7 @@ static int dfx_open(struct net_device *dev)
DFX_board_t *bp = dev->priv;
DBG_printk("In dfx_open...\n");
/* Register IRQ - support shared interrupts by passing device ptr */
ret = request_irq(dev->irq, dfx_interrupt, IRQF_SHARED, dev->name, dev);
@ -1276,18 +1276,18 @@ static int dfx_open(struct net_device *dev)
return(0);
}
/*
* =============
* = dfx_close =
* =============
*
*
* Overview:
* Closes the device/module.
*
*
* Returns:
* Condition code
*
*
* Arguments:
* dev - pointer to device information
*
@ -1360,26 +1360,26 @@ static int dfx_close(struct net_device *dev)
/* Clear device structure flags */
netif_stop_queue(dev);
/* Deregister (free) IRQ */
free_irq(dev->irq, dev);
return(0);
}
/*
* ======================
* = dfx_int_pr_halt_id =
* ======================
*
*
* Overview:
* Displays halt id's in string form.
*
*
* Returns:
* None
*
*
* Arguments:
* bp - pointer to board information
*
@ -1452,18 +1452,18 @@ static void dfx_int_pr_halt_id(DFX_board_t *bp)
}
}
/*
* ==========================
* = dfx_int_type_0_process =
* ==========================
*
*
* Overview:
* Processes Type 0 interrupts.
*
*
* Returns:
* None
*
*
* Arguments:
* bp - pointer to board information
*
@ -1569,7 +1569,7 @@ static void dfx_int_type_0_process(DFX_board_t *bp)
/* Check for adapter state change */
if (type_0_status & PI_TYPE_0_STAT_M_STATE_CHANGE)
{
{
/* Get latest adapter state */
state = dfx_hw_adap_state_rd(bp); /* get adapter state */
@ -1604,18 +1604,18 @@ static void dfx_int_type_0_process(DFX_board_t *bp)
}
}
/*
* ==================
* = dfx_int_common =
* ==================
*
*
* Overview:
* Interrupt service routine (ISR)
*
*
* Returns:
* None
*
*
* Arguments:
* bp - pointer to board information
*
@ -1678,7 +1678,7 @@ static void dfx_int_common(struct net_device *dev)
dfx_int_type_0_process(bp); /* process Type 0 interrupts */
}
/*
* =================
* = dfx_interrupt =
@ -1780,18 +1780,18 @@ static irqreturn_t dfx_interrupt(int irq, void *dev_id, struct pt_regs *regs)
return IRQ_HANDLED;
}
/*
* =====================
* = dfx_ctl_get_stats =
* =====================
*
*
* Overview:
* Get statistics for FDDI adapter
*
*
* Returns:
* Pointer to FDDI statistics structure
*
*
* Arguments:
* dev - pointer to device information
*
@ -1967,19 +1967,19 @@ static struct net_device_stats *dfx_ctl_get_stats(struct net_device *dev)
return((struct net_device_stats *) &bp->stats);
}
/*
* ==============================
* = dfx_ctl_set_multicast_list =
* ==============================
*
*
* Overview:
* Enable/Disable LLC frame promiscuous mode reception
* on the adapter and/or update multicast address table.
*
*
* Returns:
* None
*
*
* Arguments:
* dev - pointer to device information
*
@ -2088,19 +2088,19 @@ static void dfx_ctl_set_multicast_list(struct net_device *dev)
}
}
/*
* ===========================
* = dfx_ctl_set_mac_address =
* ===========================
*
*
* Overview:
* Add node address override (unicast address) to adapter
* CAM and update dev_addr field in device table.
*
*
* Returns:
* None
*
*
* Arguments:
* dev - pointer to device information
* addr - pointer to sockaddr structure containing unicast address to add
@ -2178,7 +2178,7 @@ static int dfx_ctl_set_mac_address(struct net_device *dev, void *addr)
return(0); /* always return zero */
}
/*
* ======================
* = dfx_ctl_update_cam =
@ -2263,7 +2263,7 @@ static int dfx_ctl_update_cam(DFX_board_t *bp)
return(DFX_K_SUCCESS);
}
/*
* ==========================
* = dfx_ctl_update_filters =
@ -2272,10 +2272,10 @@ static int dfx_ctl_update_cam(DFX_board_t *bp)
* Overview:
* Procedure to update adapter filters with desired
* filter settings.
*
*
* Returns:
* Condition code
*
*
* Arguments:
* bp - pointer to board information
*
@ -2329,18 +2329,18 @@ static int dfx_ctl_update_filters(DFX_board_t *bp)
return(DFX_K_SUCCESS);
}
/*
* ======================
* = dfx_hw_dma_cmd_req =
* ======================
*
*
* Overview:
* Sends PDQ DMA command to adapter firmware
*
*
* Returns:
* Condition code
*
*
* Arguments:
* bp - pointer to board information
*
@ -2374,9 +2374,9 @@ static int dfx_hw_dma_cmd_req(DFX_board_t *bp)
{
int status; /* adapter status */
int timeout_cnt; /* used in for loops */
/* Make sure the adapter is in a state that we can issue the DMA command in */
status = dfx_hw_adap_state_rd(bp);
if ((status == PI_STATE_K_RESET) ||
(status == PI_STATE_K_HALTED) ||
@ -2397,7 +2397,7 @@ static int dfx_hw_dma_cmd_req(DFX_board_t *bp)
dfx_port_write_long(bp, PI_PDQ_K_REG_CMD_RSP_PROD, bp->cmd_rsp_reg.lword);
/* Put request buffer on the command request queue */
bp->descr_block_virt->cmd_req[bp->cmd_req_reg.index.prod].long_0 = (u32) (PI_XMT_DESCR_M_SOP |
PI_XMT_DESCR_M_EOP | (PI_CMD_REQ_K_SIZE_MAX << PI_XMT_DESCR_V_SEG_LEN));
bp->descr_block_virt->cmd_req[bp->cmd_req_reg.index.prod].long_1 = bp->cmd_req_phys;
@ -2419,7 +2419,7 @@ static int dfx_hw_dma_cmd_req(DFX_board_t *bp)
break;
udelay(100); /* wait for 100 microseconds */
}
if (timeout_cnt == 0)
if (timeout_cnt == 0)
return(DFX_K_HW_TIMEOUT);
/* Bump (and wrap) the completion index and write out to register */
@ -2439,7 +2439,7 @@ static int dfx_hw_dma_cmd_req(DFX_board_t *bp)
break;
udelay(100); /* wait for 100 microseconds */
}
if (timeout_cnt == 0)
if (timeout_cnt == 0)
return(DFX_K_HW_TIMEOUT);
/* Bump (and wrap) the completion index and write out to register */
@ -2450,18 +2450,18 @@ static int dfx_hw_dma_cmd_req(DFX_board_t *bp)
return(DFX_K_SUCCESS);
}
/*
* ========================
* = dfx_hw_port_ctrl_req =
* ========================
*
*
* Overview:
* Sends PDQ port control command to adapter firmware
*
*
* Returns:
* Host data register value in host_data if ptr is not NULL
*
*
* Arguments:
* bp - pointer to board information
* command - port control command
@ -2497,7 +2497,7 @@ static int dfx_hw_port_ctrl_req(
int timeout_cnt; /* used in for loops */
/* Set Command Error bit in command longword */
port_cmd = (PI_UINT32) (command | PI_PCTRL_M_CMD_ERROR);
/* Issue port command to the adapter */
@ -2520,12 +2520,12 @@ static int dfx_hw_port_ctrl_req(
break;
udelay(100); /* wait for 100 microseconds */
}
if (timeout_cnt == 0)
if (timeout_cnt == 0)
return(DFX_K_HW_TIMEOUT);
/*
* If the address of host_data is non-zero, assume caller has supplied a
* non NULL pointer, and return the contents of the HOST_DATA register in
* If the address of host_data is non-zero, assume caller has supplied a
* non NULL pointer, and return the contents of the HOST_DATA register in
* it.
*/
@ -2534,18 +2534,18 @@ static int dfx_hw_port_ctrl_req(
return(DFX_K_SUCCESS);
}
/*
* =====================
* = dfx_hw_adap_reset =
* =====================
*
*
* Overview:
* Resets adapter
*
*
* Returns:
* None
*
*
* Arguments:
* bp - pointer to board information
* type - type of reset to perform
@ -2588,18 +2588,18 @@ static void dfx_hw_adap_reset(
dfx_port_write_long(bp, PI_PDQ_K_REG_PORT_RESET, 0);
}
/*
* ========================
* = dfx_hw_adap_state_rd =
* ========================
*
*
* Overview:
* Returns current adapter state
*
*
* Returns:
* Adapter state per PDQ Port Specification
*
*
* Arguments:
* bp - pointer to board information
*
@ -2624,18 +2624,18 @@ static int dfx_hw_adap_state_rd(DFX_board_t *bp)
return((port_status & PI_PSTATUS_M_STATE) >> PI_PSTATUS_V_STATE);
}
/*
* =====================
* = dfx_hw_dma_uninit =
* =====================
*
*
* Overview:
* Brings adapter to DMA_UNAVAILABLE state
*
*
* Returns:
* Condition code
*
*
* Arguments:
* bp - pointer to board information
* type - type of reset to perform
@ -2672,38 +2672,38 @@ static int dfx_hw_dma_uninit(DFX_board_t *bp, PI_UINT32 type)
break;
udelay(100); /* wait for 100 microseconds */
}
if (timeout_cnt == 0)
if (timeout_cnt == 0)
return(DFX_K_HW_TIMEOUT);
return(DFX_K_SUCCESS);
}
/*
* Align an sk_buff to a boundary power of 2
*
*/
static void my_skb_align(struct sk_buff *skb, int n)
{
unsigned long x = (unsigned long)skb->data;
unsigned long v;
v = ALIGN(x, n); /* Where we want to be */
skb_reserve(skb, v - x);
}
/*
* ================
* = dfx_rcv_init =
* ================
*
*
* Overview:
* Produces buffers to adapter LLC Host receive descriptor block
*
*
* Returns:
* None
*
*
* Arguments:
* bp - pointer to board information
* get_buffers - non-zero if buffers to be allocated
@ -2764,7 +2764,7 @@ static int dfx_rcv_init(DFX_board_t *bp, int get_buffers)
* align to 128 bytes for compatibility with
* the old EISA boards.
*/
my_skb_align(newskb, 128);
bp->descr_block_virt->rcv_data[i + j].long_1 =
(u32)pci_map_single(bp->pci_dev, newskb->data,
@ -2795,18 +2795,18 @@ static int dfx_rcv_init(DFX_board_t *bp, int get_buffers)
return 0;
}
/*
* =========================
* = dfx_rcv_queue_process =
* =========================
*
*
* Overview:
* Process received LLC frames.
*
*
* Returns:
* None
*
*
* Arguments:
* bp - pointer to board information
*
@ -2880,7 +2880,7 @@ static void dfx_rcv_queue_process(
newskb = dev_alloc_skb(NEW_SKB_SIZE);
if (newskb){
rx_in_place = 1;
my_skb_align(newskb, 128);
skb = (struct sk_buff *)bp->p_rcv_buff_va[entry];
pci_unmap_single(bp->pci_dev,
@ -2914,7 +2914,7 @@ static void dfx_rcv_queue_process(
memcpy(skb->data, p_buff + RCV_BUFF_K_PADDING, pkt_len+3);
}
skb_reserve(skb,3); /* adjust data field so that it points to FC byte */
skb_put(skb, pkt_len); /* pass up packet length, NOT including CRC */
skb->dev = bp->dev; /* pass up device pointer */
@ -2945,18 +2945,18 @@ static void dfx_rcv_queue_process(
}
}
/*
* =====================
* = dfx_xmt_queue_pkt =
* =====================
*
*
* Overview:
* Queues packets for transmission
*
*
* Returns:
* Condition code
*
*
* Arguments:
* skb - pointer to sk_buff to queue for transmission
* dev - pointer to device information
@ -3020,7 +3020,7 @@ static int dfx_xmt_queue_pkt(
unsigned long flags;
netif_stop_queue(dev);
/*
* Verify that incoming transmit request is OK
*
@ -3032,7 +3032,7 @@ static int dfx_xmt_queue_pkt(
if (!IN_RANGE(skb->len, FDDI_K_LLC_ZLEN, FDDI_K_LLC_LEN))
{
printk("%s: Invalid packet length - %u bytes\n",
printk("%s: Invalid packet length - %u bytes\n",
dev->name, skb->len);
bp->xmt_length_errors++; /* bump error counter */
netif_wake_queue(dev);
@ -3065,7 +3065,7 @@ static int dfx_xmt_queue_pkt(
}
spin_lock_irqsave(&bp->lock, flags);
/* Get the current producer and the next free xmt data descriptor */
prod = bp->rcv_xmt_reg.index.xmt_prod;
@ -3167,18 +3167,18 @@ static int dfx_xmt_queue_pkt(
return(0); /* packet queued to adapter */
}
/*
* ================
* = dfx_xmt_done =
* ================
*
*
* Overview:
* Processes all frames that have been transmitted.
*
*
* Returns:
* None
*
*
* Arguments:
* bp - pointer to board information
*
@ -3246,18 +3246,18 @@ static int dfx_xmt_done(DFX_board_t *bp)
return freed;
}
/*
* =================
* = dfx_rcv_flush =
* =================
*
*
* Overview:
* Remove all skb's in the receive ring.
*
*
* Returns:
* None
*
*
* Arguments:
* bp - pointer to board information
*
@ -3299,14 +3299,14 @@ static inline void dfx_rcv_flush( DFX_board_t *bp )
* =================
* = dfx_xmt_flush =
* =================
*
*
* Overview:
* Processes all frames whether they've been transmitted
* or not.
*
*
* Returns:
* None
*
*
* Arguments:
* bp - pointer to board information
*
@ -3446,11 +3446,11 @@ static int __init dfx_init(void)
rc_pci = pci_register_driver(&dfx_driver);
if (rc_pci >= 0) dfx_have_pci = 1;
rc_eisa = dfx_eisa_init();
if (rc_eisa >= 0) dfx_have_eisa = 1;
return ((rc_eisa < 0) ? 0 : rc_eisa) + ((rc_pci < 0) ? 0 : rc_pci);
return ((rc_eisa < 0) ? 0 : rc_eisa) + ((rc_pci < 0) ? 0 : rc_pci);
}
static void __exit dfx_cleanup(void)
@ -3459,8 +3459,8 @@ static void __exit dfx_cleanup(void)
pci_unregister_driver(&dfx_driver);
if (dfx_have_eisa)
dfx_eisa_cleanup();
}
}
module_init(dfx_init);
module_exit(dfx_cleanup);
@ -3469,7 +3469,7 @@ MODULE_DESCRIPTION("DEC FDDIcontroller EISA/PCI (DEFEA/DEFPA) driver "
DRV_VERSION " " DRV_RELDATE);
MODULE_LICENSE("GPL");
/*
* Local variables:
* kernel-compile-command: "gcc -D__KERNEL__ -I/root/linux/include -Wall -Wstrict-prototypes -O2 -pipe -fomit-frame-pointer -fno-strength-reduce -m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2 -c defxx.c"

Просмотреть файл

@ -45,7 +45,7 @@ typedef struct /* 64-bit counter */
} PI_CNTR;
typedef struct /* LAN address */
{
{
PI_UINT32 lwrd_0;
PI_UINT32 lwrd_1;
} PI_LAN_ADDR;
@ -146,7 +146,7 @@ typedef struct /* Station ID address */
#define PI_STATE_K_LINK_UNAVAIL 5
#define PI_STATE_K_HALTED 6
#define PI_STATE_K_RING_MEMBER 7
#define PI_STATE_K_NUMBER 8
#define PI_STATE_K_NUMBER 8
/* Define codes for command type */
@ -175,9 +175,9 @@ typedef struct /* Station ID address */
#define PI_ITEM_K_EOL 0x00 /* End-of-Item list */
#define PI_ITEM_K_T_REQ 0x01 /* DECnet T_REQ */
#define PI_ITEM_K_TVX 0x02 /* DECnet TVX */
#define PI_ITEM_K_RESTRICTED_TOKEN 0x03 /* DECnet Restricted Token */
#define PI_ITEM_K_RESTRICTED_TOKEN 0x03 /* DECnet Restricted Token */
#define PI_ITEM_K_LEM_THRESHOLD 0x04 /* DECnet LEM Threshold */
#define PI_ITEM_K_RING_PURGER 0x05 /* DECnet Ring Purger Enable */
#define PI_ITEM_K_RING_PURGER 0x05 /* DECnet Ring Purger Enable */
#define PI_ITEM_K_CNTR_INTERVAL 0x06 /* Chars_Set */
#define PI_ITEM_K_IND_GROUP_PROM 0x07 /* Filters_Set */
#define PI_ITEM_K_GROUP_PROM 0x08 /* Filters_Set */
@ -283,16 +283,16 @@ typedef struct
/* Start Response */
typedef struct
typedef struct
{
PI_RSP_HEADER header;
PI_RSP_HEADER header;
} PI_CMD_START_RSP;
/* Filters_Set Request */
#define PI_CMD_FILTERS_SET_K_ITEMS_MAX 63 /* Fits in a 512 byte buffer */
typedef struct
typedef struct
{
PI_UINT32 cmd_type;
PI_ITEM_LIST item[PI_CMD_FILTERS_SET_K_ITEMS_MAX];
@ -302,21 +302,21 @@ typedef struct
typedef struct
{
PI_RSP_HEADER header;
PI_RSP_HEADER header;
} PI_CMD_FILTERS_SET_RSP;
/* Filters_Get Request */
typedef struct
{
PI_UINT32 cmd_type;
PI_UINT32 cmd_type;
} PI_CMD_FILTERS_GET_REQ;
/* Filters_Get Response */
typedef struct
typedef struct
{
PI_RSP_HEADER header;
PI_RSP_HEADER header;
PI_UINT32 ind_group_prom;
PI_UINT32 group_prom;
PI_UINT32 broadcast_all;
@ -339,14 +339,14 @@ typedef struct
PI_UINT32 item_code;
PI_UINT32 value;
PI_UINT32 item_index;
} item[PI_CMD_CHARS_SET_K_ITEMS_MAX];
} item[PI_CMD_CHARS_SET_K_ITEMS_MAX];
} PI_CMD_CHARS_SET_REQ;
/* Chars_Set Response */
typedef struct
{
PI_RSP_HEADER header;
PI_RSP_HEADER header;
} PI_CMD_CHARS_SET_RSP;
@ -362,20 +362,20 @@ typedef struct
PI_UINT32 item_code;
PI_UINT32 value;
PI_UINT32 item_index;
} item[PI_CMD_SNMP_SET_K_ITEMS_MAX];
} item[PI_CMD_SNMP_SET_K_ITEMS_MAX];
} PI_CMD_SNMP_SET_REQ;
/* SNMP_Set Response */
typedef struct
{
PI_RSP_HEADER header;
PI_RSP_HEADER header;
} PI_CMD_SNMP_SET_RSP;
/* SMT_MIB_Set Request */
#define PI_CMD_SMT_MIB_SET_K_ITEMS_MAX 42 /* Max number of items */
#define PI_CMD_SMT_MIB_SET_K_ITEMS_MAX 42 /* Max number of items */
typedef struct
{
@ -392,7 +392,7 @@ typedef struct
typedef struct
{
PI_RSP_HEADER header;
PI_RSP_HEADER header;
} PI_CMD_SMT_MIB_SET_RSP;
/* SMT_MIB_Get Request */
@ -407,8 +407,8 @@ typedef struct
typedef struct /* Refer to ANSI FDDI SMT Rev. 7.3 */
{
PI_RSP_HEADER header;
/* SMT GROUP */
/* SMT GROUP */
PI_STATION_ID smt_station_id;
PI_UINT32 smt_op_version_id;
@ -485,7 +485,7 @@ typedef struct /* Refer to ANSI FDDI SMT Rev. 7.3 */
PI_UINT32 port_connection_capabilities[PI_PHY_K_MAX];
PI_UINT32 port_bs_flag[PI_PHY_K_MAX];
PI_UINT32 port_ler_estimate[PI_PHY_K_MAX];
PI_UINT32 port_ler_cutoff[PI_PHY_K_MAX];
PI_UINT32 port_ler_cutoff[PI_PHY_K_MAX];
PI_UINT32 port_ler_alarm[PI_PHY_K_MAX];
PI_UINT32 port_connect_state[PI_PHY_K_MAX];
PI_UINT32 port_pcm_state[PI_PHY_K_MAX];
@ -497,7 +497,7 @@ typedef struct /* Refer to ANSI FDDI SMT Rev. 7.3 */
PI_CNTR path_ring_latency;
} PI_CMD_SMT_MIB_GET_RSP;
} PI_CMD_SMT_MIB_GET_RSP;
/*
@ -506,7 +506,7 @@ typedef struct /* Refer to ANSI FDDI SMT Rev. 7.3 */
* certain host-sent SMT frames such as PMF Get and Set requests. The
* codes have been taken from the MIB summary section of ANSI SMT 7.3.
*/
#define PI_GRP_K_SMT_STATION_ID 0x100A
#define PI_ITEM_K_SMT_STATION_ID 0x100B
#define PI_ITEM_K_SMT_OP_VERS_ID 0x100D
@ -536,7 +536,7 @@ typedef struct /* Refer to ANSI FDDI SMT Rev. 7.3 */
#define PI_ITEM_K_SMT_REM_DISC_FLAG 0x102C
#define PI_ITEM_K_SMT_STATION_STATUS 0x102D
#define PI_ITEM_K_SMT_PEER_WRAP_FLAG 0x102E
#define PI_GRP_K_SMT_MIB_OPERATION 0x1032
#define PI_ITEM_K_SMT_MSG_TIME_STAMP 0x1033
#define PI_ITEM_K_SMT_TRN_TIME_STAMP 0x1034
@ -643,9 +643,9 @@ typedef struct
/* Addr_Filter_Set Response */
typedef struct
typedef struct
{
PI_RSP_HEADER header;
PI_RSP_HEADER header;
} PI_CMD_ADDR_FILTER_SET_RSP;
/* Addr_Filter_Get Request */
@ -659,7 +659,7 @@ typedef struct
typedef struct
{
PI_RSP_HEADER header;
PI_RSP_HEADER header;
PI_LAN_ADDR entry[PI_CMD_ADDR_FILTER_K_SIZE];
} PI_CMD_ADDR_FILTER_GET_RSP;
@ -674,7 +674,7 @@ typedef struct
typedef struct
{
PI_RSP_HEADER header;
PI_RSP_HEADER header;
PI_STATION_ID station_id; /* Station */
PI_UINT32 station_type;
PI_UINT32 smt_ver_id;
@ -728,66 +728,66 @@ typedef struct
typedef struct
{
PI_RSP_HEADER header;
PI_RSP_HEADER header;
/* SMT GROUP */
PI_STATION_ID smt_station_id;
PI_STATION_ID smt_station_id;
PI_UINT32 smt_op_version_id;
PI_UINT32 smt_hi_version_id;
PI_UINT32 smt_lo_version_id;
PI_UINT32 smt_mac_ct;
PI_UINT32 smt_non_master_ct;
PI_UINT32 smt_master_ct;
PI_UINT32 smt_paths_available;
PI_UINT32 smt_config_capabilities;
PI_UINT32 smt_config_policy;
PI_UINT32 smt_connection_policy;
PI_UINT32 smt_t_notify;
PI_UINT32 smt_mac_ct;
PI_UINT32 smt_non_master_ct;
PI_UINT32 smt_master_ct;
PI_UINT32 smt_paths_available;
PI_UINT32 smt_config_capabilities;
PI_UINT32 smt_config_policy;
PI_UINT32 smt_connection_policy;
PI_UINT32 smt_t_notify;
PI_UINT32 smt_status_reporting;
PI_UINT32 smt_ecm_state;
PI_UINT32 smt_cf_state;
PI_UINT32 smt_hold_state;
PI_UINT32 smt_ecm_state;
PI_UINT32 smt_cf_state;
PI_UINT32 smt_hold_state;
PI_UINT32 smt_remote_disconnect_flag;
PI_UINT32 smt_station_action;
PI_UINT32 smt_station_action;
/* MAC GROUP */
PI_UINT32 mac_frame_status_capabilities;
PI_UINT32 mac_frame_status_capabilities;
PI_UINT32 mac_t_max_greatest_lower_bound;
PI_UINT32 mac_tvx_greatest_lower_bound;
PI_UINT32 mac_paths_available;
PI_UINT32 mac_current_path;
PI_LAN_ADDR mac_upstream_nbr;
PI_LAN_ADDR mac_old_upstream_nbr;
PI_UINT32 mac_dup_addr_test;
PI_LAN_ADDR mac_upstream_nbr;
PI_LAN_ADDR mac_old_upstream_nbr;
PI_UINT32 mac_dup_addr_test;
PI_UINT32 mac_paths_requested;
PI_UINT32 mac_downstream_port_type;
PI_LAN_ADDR mac_smt_address;
PI_UINT32 mac_t_req;
PI_LAN_ADDR mac_smt_address;
PI_UINT32 mac_t_req;
PI_UINT32 mac_t_neg;
PI_UINT32 mac_t_max;
PI_UINT32 mac_tvx_value;
PI_UINT32 mac_t_min;
PI_UINT32 mac_t_max;
PI_UINT32 mac_tvx_value;
PI_UINT32 mac_t_min;
PI_UINT32 mac_current_frame_status;
/* mac_frame_cts */
/* mac_error_cts */
/* mac_lost_cts */
PI_UINT32 mac_frame_error_threshold;
PI_UINT32 mac_frame_error_ratio;
PI_UINT32 mac_frame_error_threshold;
PI_UINT32 mac_frame_error_ratio;
PI_UINT32 mac_rmt_state;
PI_UINT32 mac_da_flag;
PI_UINT32 mac_una_da_flag;
PI_UINT32 mac_una_da_flag;
PI_UINT32 mac_frame_condition;
PI_UINT32 mac_chip_set;
PI_UINT32 mac_action;
PI_UINT32 mac_chip_set;
PI_UINT32 mac_action;
/* PATH GROUP => Does not need to be implemented */
/* PORT GROUP */
PI_UINT32 port_pc_type[PI_PHY_K_MAX];
PI_UINT32 port_pc_neighbor[PI_PHY_K_MAX];
PI_UINT32 port_pc_type[PI_PHY_K_MAX];
PI_UINT32 port_pc_neighbor[PI_PHY_K_MAX];
PI_UINT32 port_connection_policies[PI_PHY_K_MAX];
PI_UINT32 port_remote_mac_indicated[PI_PHY_K_MAX];
PI_UINT32 port_ce_state[PI_PHY_K_MAX];
@ -798,17 +798,17 @@ typedef struct
PI_UINT32 port_tb_max[PI_PHY_K_MAX];
PI_UINT32 port_bs_flag[PI_PHY_K_MAX];
/* port_lct_fail_cts[PI_PHY_K_MAX]; */
PI_UINT32 port_ler_estimate[PI_PHY_K_MAX];
PI_UINT32 port_ler_estimate[PI_PHY_K_MAX];
/* port_lem_reject_cts[PI_PHY_K_MAX]; */
/* port_lem_cts[PI_PHY_K_MAX]; */
PI_UINT32 port_ler_cutoff[PI_PHY_K_MAX];
PI_UINT32 port_ler_alarm[PI_PHY_K_MAX];
PI_UINT32 port_ler_cutoff[PI_PHY_K_MAX];
PI_UINT32 port_ler_alarm[PI_PHY_K_MAX];
PI_UINT32 port_connect_state[PI_PHY_K_MAX];
PI_UINT32 port_pcm_state[PI_PHY_K_MAX];
PI_UINT32 port_pc_withhold[PI_PHY_K_MAX];
PI_UINT32 port_ler_condition[PI_PHY_K_MAX];
PI_UINT32 port_chip_set[PI_PHY_K_MAX];
PI_UINT32 port_action[PI_PHY_K_MAX];
PI_UINT32 port_ler_condition[PI_PHY_K_MAX];
PI_UINT32 port_chip_set[PI_PHY_K_MAX];
PI_UINT32 port_action[PI_PHY_K_MAX];
/* ATTACHMENT GROUP */
@ -833,7 +833,7 @@ typedef struct
typedef struct
{
PI_RSP_HEADER header;
PI_RSP_HEADER header;
/* SMT GROUP */
@ -841,7 +841,7 @@ typedef struct
/* MAC GROUP */
PI_UINT32 emac_link_state;
PI_UINT32 emac_link_state;
PI_UINT32 emac_ring_purger_state;
PI_UINT32 emac_ring_purger_enable;
PI_UINT32 emac_frame_strip_mode;
@ -915,9 +915,9 @@ typedef struct
typedef struct
{
PI_RSP_HEADER header;
PI_CNTR time_since_reset;
PI_CNTR_BLK cntrs;
PI_RSP_HEADER header;
PI_CNTR time_since_reset;
PI_CNTR_BLK cntrs;
} PI_CMD_CNTRS_GET_RSP;
/* Counters_Set Request */
@ -925,14 +925,14 @@ typedef struct
typedef struct
{
PI_UINT32 cmd_type;
PI_CNTR_BLK cntrs;
PI_CNTR_BLK cntrs;
} PI_CMD_CNTRS_SET_REQ;
/* Counters_Set Response */
typedef struct
typedef struct
{
PI_RSP_HEADER header;
PI_RSP_HEADER header;
} PI_CMD_CNTRS_SET_RSP;
/* Error_Log_Clear Request */
@ -946,7 +946,7 @@ typedef struct
typedef struct
{
PI_RSP_HEADER header;
PI_RSP_HEADER header;
} PI_CMD_ERROR_LOG_CLEAR_RSP;
/* Error_Log_Get Request */
@ -966,7 +966,7 @@ typedef struct
typedef struct
{
struct
struct
{
PI_UINT32 fru_imp_mask;
PI_UINT32 test_id;
@ -977,7 +977,7 @@ typedef struct
typedef struct
{
PI_RSP_HEADER header;
PI_RSP_HEADER header;
PI_UINT32 event_status;
PI_UINT32 caller_id;
PI_UINT32 timestamp_l;
@ -993,7 +993,7 @@ typedef struct
#define PI_LOG_EVENT_STATUS_K_VALID 0 /* Valid Event Status */
#define PI_LOG_EVENT_STATUS_K_INVALID 1 /* Invalid Event Status */
#define PI_LOG_CALLER_ID_K_NONE 0 /* No caller */
#define PI_LOG_CALLER_ID_K_SELFTEST 1 /* Normal power-up selftest */
#define PI_LOG_CALLER_ID_K_SELFTEST 1 /* Normal power-up selftest */
#define PI_LOG_CALLER_ID_K_MFG 2 /* Mfg power-up selftest */
#define PI_LOG_CALLER_ID_K_ONLINE 3 /* On-line diagnostics */
#define PI_LOG_CALLER_ID_K_HW 4 /* Hardware */
@ -1026,7 +1026,7 @@ typedef union
PI_CMD_DEC_EXT_MIB_GET_REQ dec_mib_get;
PI_CMD_SMT_MIB_SET_REQ smt_mib_set;
PI_CMD_SMT_MIB_GET_REQ smt_mib_get;
char pad[PI_CMD_REQ_K_SIZE_MAX];
char pad[PI_CMD_REQ_K_SIZE_MAX];
} PI_DMA_CMD_REQ;
typedef union
@ -1048,7 +1048,7 @@ typedef union
PI_CMD_DEC_EXT_MIB_GET_RSP dec_mib_get;
PI_CMD_SMT_MIB_SET_RSP smt_mib_set;
PI_CMD_SMT_MIB_GET_RSP smt_mib_get;
char pad[PI_CMD_RSP_K_SIZE_MAX];
char pad[PI_CMD_RSP_K_SIZE_MAX];
} PI_DMA_CMD_RSP;
typedef union
@ -1094,7 +1094,7 @@ typedef struct
#define PI_DESCR_BLK_K_SMT_HOST 0x1000
#define PI_DESCR_BLK_K_UNSOL 0x1200
#define PI_DESCR_BLK_K_CMD_RSP 0x1280
#define PI_DESCR_BLK_K_CMD_REQ 0x1300
#define PI_DESCR_BLK_K_CMD_REQ 0x1300
/* Define format of a rcv descr (Rcv Data, Cmd Rsp, Unsolicited, SMT Host) */
/* Note a field has been added for later versions of the PDQ to allow for */
@ -1110,10 +1110,10 @@ typedef struct
} PI_RCV_DESCR;
#define PI_RCV_DESCR_M_SOP 0x80000000
#define PI_RCV_DESCR_M_SEG_LEN_LO 0x60000000
#define PI_RCV_DESCR_M_MBZ 0x60000000
#define PI_RCV_DESCR_M_SEG_LEN_LO 0x60000000
#define PI_RCV_DESCR_M_MBZ 0x60000000
#define PI_RCV_DESCR_M_SEG_LEN 0x1F800000
#define PI_RCV_DESCR_M_SEG_LEN_HI 0x1FF00000
#define PI_RCV_DESCR_M_SEG_LEN_HI 0x1FF00000
#define PI_RCV_DESCR_M_SEG_CNT 0x000F0000
#define PI_RCV_DESCR_M_BUFF_HI 0x0000FFFF
@ -1121,7 +1121,7 @@ typedef struct
#define PI_RCV_DESCR_V_SEG_LEN_LO 29
#define PI_RCV_DESCR_V_MBZ 29
#define PI_RCV_DESCR_V_SEG_LEN 23
#define PI_RCV_DESCR_V_SEG_LEN_HI 20
#define PI_RCV_DESCR_V_SEG_LEN_HI 20
#define PI_RCV_DESCR_V_SEG_CNT 16
#define PI_RCV_DESCR_V_BUFF_HI 0
@ -1135,7 +1135,7 @@ typedef struct
#define PI_XMT_DESCR_M_SOP 0x80000000
#define PI_XMT_DESCR_M_EOP 0x40000000
#define PI_XMT_DESCR_M_MBZ 0x20000000
#define PI_XMT_DESCR_M_MBZ 0x20000000
#define PI_XMT_DESCR_M_SEG_LEN 0x1FFF0000
#define PI_XMT_DESCR_M_BUFF_HI 0x0000FFFF
@ -1195,7 +1195,7 @@ typedef struct
#define PI_PCTRL_M_CONS_BLOCK 0x0040
#define PI_PCTRL_M_UNINIT 0x0020
#define PI_PCTRL_M_RING_MEMBER 0x0010
#define PI_PCTRL_M_MLA 0x0008
#define PI_PCTRL_M_MLA 0x0008
#define PI_PCTRL_M_FW_REV_READ 0x0004
#define PI_PCTRL_M_DEV_SPECIFIC 0x0002
#define PI_PCTRL_M_SUB_CMD 0x0001
@ -1230,12 +1230,12 @@ typedef struct
#define PI_PDATA_A_INIT_M_DESC_BLK_ADDR 0x0FFFFE000
#define PI_PDATA_A_INIT_M_RESERVED 0x000001FFC
#define PI_PDATA_A_INIT_M_BSWAP_DATA 0x000000002
#define PI_PDATA_A_INIT_M_BSWAP_DATA 0x000000002
#define PI_PDATA_A_INIT_M_BSWAP_LITERAL 0x000000001
#define PI_PDATA_A_INIT_V_DESC_BLK_ADDR 13
#define PI_PDATA_A_INIT_V_RESERVED 3
#define PI_PDATA_A_INIT_V_BSWAP_DATA 1
#define PI_PDATA_A_INIT_V_BSWAP_DATA 1
#define PI_PDATA_A_INIT_V_BSWAP_LITERAL 0
/* Port Reset Register */
@ -1281,11 +1281,11 @@ typedef struct
#define PI_HALT_ID_K_IMAGE_CRC_ERROR 7 /* Image is bad, update it */
#define PI_HALT_ID_K_BUS_EXCEPTION 8 /* 68K bus exception */
/* Host Interrupt Enable Register as seen by host */
/* Host Interrupt Enable Register as seen by host */
#define PI_HOST_INT_M_XMT_DATA_ENB 0x80000000 /* Type 2 Enables */
#define PI_HOST_INT_M_RCV_DATA_ENB 0x40000000
#define PI_HOST_INT_M_SMT_HOST_ENB 0x10000000 /* Type 1 Enables */
#define PI_HOST_INT_M_RCV_DATA_ENB 0x40000000
#define PI_HOST_INT_M_SMT_HOST_ENB 0x10000000 /* Type 1 Enables */
#define PI_HOST_INT_M_UNSOL_ENB 0x20000000
#define PI_HOST_INT_M_CMD_RSP_ENB 0x08000000
#define PI_HOST_INT_M_CMD_REQ_ENB 0x04000000
@ -1301,8 +1301,8 @@ typedef struct
#define PI_HOST_INT_M_BUS_PAR_ERR 0x00000001
#define PI_HOST_INT_V_XMT_DATA_ENB 31 /* Type 2 Enables */
#define PI_HOST_INT_V_RCV_DATA_ENB 30
#define PI_HOST_INT_V_SMT_HOST_ENB 29 /* Type 1 Enables */
#define PI_HOST_INT_V_RCV_DATA_ENB 30
#define PI_HOST_INT_V_SMT_HOST_ENB 29 /* Type 1 Enables */
#define PI_HOST_INT_V_UNSOL_ENB 28
#define PI_HOST_INT_V_CMD_RSP_ENB 27
#define PI_HOST_INT_V_CMD_REQ_ENB 26
@ -1333,8 +1333,8 @@ typedef struct
#define PI_TYPE_0_STAT_M_PM_PAR_ERR 0x00000002
#define PI_TYPE_0_STAT_M_BUS_PAR_ERR 0x00000001
#define PI_TYPE_0_STAT_V_1MS 7
#define PI_TYPE_0_STAT_V_20MS 6
#define PI_TYPE_0_STAT_V_1MS 7
#define PI_TYPE_0_STAT_V_20MS 6
#define PI_TYPE_0_STAT_V_CSR_CMD_DONE 5
#define PI_TYPE_0_STAT_V_STATE_CHANGE 4
#define PI_TYPE_0_STAT_V_XMT_FLUSH 3
@ -1692,7 +1692,7 @@ typedef struct DFX_board_tag
{
/* Keep virtual and physical pointers to locked, physically contiguous memory */
char *kmalloced; /* pci_free_consistent this on unload */
char *kmalloced; /* pci_free_consistent this on unload */
dma_addr_t kmalloced_dma;
/* DMA handle for the above */
PI_DESCR_BLOCK *descr_block_virt; /* PDQ descriptor block virt address */
@ -1739,9 +1739,9 @@ typedef struct DFX_board_tag
/* Store pointers to transmit buffers for transmit completion code */
XMT_DRIVER_DESCR xmt_drv_descr_blk[PI_XMT_DATA_K_NUM_ENTRIES];
/* Transmit spinlocks */
spinlock_t lock;
/* Store device, bus-specific, and parameter information for this adapter */

Просмотреть файл

@ -4,9 +4,9 @@
Copyright 1994 David C. Davies
and
and
United States Government
(as represented by the Director, National Security Agency).
(as represented by the Director, National Security Agency).
Copyright 1995 Digital Equipment Corporation.
@ -61,7 +61,7 @@
Digital Equipment Corporation, 1989
8) "DEC EtherWORKS Turbo_(TP BNC) Ethernet Controller Owners Manual",
Digital Equipment corporation, 1991, Pub. #EK-DE202-OM.001
Peter Bauer's depca.c (V0.5) was referred to when debugging V0.1 of this
driver.
@ -135,20 +135,20 @@
[Alan Cox: Changed the code to allow command line irq/io assignments]
[Dave Davies: Changed the code to allow command line mem/name
assignments]
6) run the net startup bits for your eth?? interface manually
(usually /etc/rc.inet[12] at boot time).
6) run the net startup bits for your eth?? interface manually
(usually /etc/rc.inet[12] at boot time).
7) enjoy!
Note that autoprobing is not allowed in loadable modules - the system is
already up and running and you're messing with interrupts.
To unload a module, turn off the associated interface
To unload a module, turn off the associated interface
'ifconfig eth?? down' then 'rmmod depca'.
To assign a base memory address for the shared memory when running as a
loadable module, see 5 above. To include the adapter name (if you have
no PROM but know the card name) also see 5 above. Note that this last
option will not work with kernel built-in depca's.
option will not work with kernel built-in depca's.
The shared memory assignment for a loadable module makes sense to avoid
the 'memory autoprobe' picking the wrong shared memory (for the case of
@ -157,7 +157,7 @@
************************************************************************
Support for MCA EtherWORKS cards added 11-3-98.
Verified to work with up to 2 DE212 cards in a system (although not
fully stress-tested).
fully stress-tested).
Currently known bugs/limitations:
@ -176,7 +176,7 @@
----------------
Version Date Description
0.1 25-jan-94 Initial writing.
0.2 27-jan-94 Added LANCE TX hardware buffer chaining.
0.3 1-feb-94 Added multiple DEPCA support.
@ -190,7 +190,7 @@
0.351 30-apr-94 Added EISA support. Added DE422 recognition.
0.36 16-may-94 DE422 fix released.
0.37 22-jul-94 Added MODULE support
0.38 15-aug-94 Added DBR ROM switch in depca_close().
0.38 15-aug-94 Added DBR ROM switch in depca_close().
Multi DEPCA bug fix.
0.38axp 15-sep-94 Special version for Alpha AXP Linux V1.0.
0.381 12-dec-94 Added DE101 recognition, fix multicast bug.
@ -198,17 +198,17 @@
0.383 22-feb-95 Fix for conflict with VESA SCSI reported by
<stromain@alf.dec.com>
0.384 17-mar-95 Fix a ring full bug reported by <bkm@star.rl.ac.uk>
0.385 3-apr-95 Fix a recognition bug reported by
0.385 3-apr-95 Fix a recognition bug reported by
<ryan.niemi@lastfrontier.com>
0.386 21-apr-95 Fix the last fix...sorry, must be galloping senility
0.40 25-May-95 Rewrite for portability & updated.
ALPHA support from <jestabro@amt.tay1.dec.com>
0.41 26-Jun-95 Added verify_area() calls in depca_ioctl() from
suggestion by <heiko@colossus.escape.de>
0.42 27-Dec-95 Add 'mem' shared memory assignment for loadable
0.42 27-Dec-95 Add 'mem' shared memory assignment for loadable
modules.
Add 'adapter_name' for loadable modules when no PROM.
Both above from a suggestion by
Both above from a suggestion by
<pchen@woodruffs121.residence.gatech.edu>.
Add new multicasting code.
0.421 22-Apr-96 Fix alloc_device() bug <jari@markkus2.fimr.fi>
@ -218,7 +218,7 @@
0.44 1-Sep-97 Fix *_probe() to test check_region() first - bug
reported by <mmogilvi@elbert.uccs.edu>
0.45 3-Nov-98 Added support for MCA EtherWORKS (DE210/DE212) cards
by <tymm@computer.org>
by <tymm@computer.org>
0.451 5-Nov-98 Fixed mca stuff cuz I'm a dummy. <tymm@computer.org>
0.5 14-Nov-98 Re-spin for 2.1.x kernels.
0.51 27-Jun-99 Correct received packet length for CRC from
@ -411,7 +411,7 @@ static struct platform_driver depca_isa_driver = {
.name = depca_string,
},
};
/*
** Miscellaneous info...
*/
@ -421,14 +421,14 @@ static struct platform_driver depca_isa_driver = {
** Memory Alignment. Each descriptor is 4 longwords long. To force a
** particular alignment on the TX descriptor, adjust DESC_SKIP_LEN and
** DESC_ALIGN. DEPCA_ALIGN aligns the start address of the private memory area
** and hence the RX descriptor ring's first entry.
** and hence the RX descriptor ring's first entry.
*/
#define DEPCA_ALIGN4 ((u_long)4 - 1) /* 1 longword align */
#define DEPCA_ALIGN8 ((u_long)8 - 1) /* 2 longword (quadword) align */
#define DEPCA_ALIGN DEPCA_ALIGN8 /* Keep the LANCE happy... */
/*
** The DEPCA Rx and Tx ring descriptors.
** The DEPCA Rx and Tx ring descriptors.
*/
struct depca_rx_desc {
volatile s32 base;
@ -591,7 +591,7 @@ static int __init depca_hw_init (struct net_device *dev, struct device *device)
*/
ioaddr = dev->base_addr;
STOP_DEPCA;
nicsr = inb(DEPCA_NICSR);
@ -610,7 +610,7 @@ static int __init depca_hw_init (struct net_device *dev, struct device *device)
printk ("%s: %s at 0x%04lx",
device->bus_id, depca_signature[lp->adapter], ioaddr);
switch (lp->depca_bus) {
#ifdef CONFIG_MCA
case DEPCA_BUS_MCA:
@ -657,7 +657,7 @@ static int __init depca_hw_init (struct net_device *dev, struct device *device)
if (lp->depca_bus != DEPCA_BUS_MCA)
mem_start += 0x8000;
}
if ((mem_len = (NUM_RX_DESC * (sizeof(struct depca_rx_desc) + RX_BUFF_SZ) + NUM_TX_DESC * (sizeof(struct depca_tx_desc) + TX_BUFF_SZ) + sizeof(struct depca_init)))
> (netRAM << 10)) {
printk(",\n requests %dkB RAM: only %dkB is available!\n", (mem_len >> 10), netRAM);
@ -682,7 +682,7 @@ static int __init depca_hw_init (struct net_device *dev, struct device *device)
printk(KERN_ERR "depca: cannot request ISA memory, aborting\n");
goto out_priv;
}
status = -EIO;
lp->sh_mem = ioremap(mem_start, mem_len);
if (lp->sh_mem == NULL) {
@ -811,7 +811,7 @@ static int __init depca_hw_init (struct net_device *dev, struct device *device)
device->driver_data = dev;
SET_NETDEV_DEV (dev, device);
status = register_netdev(dev);
if (status == 0)
return 0;
@ -822,7 +822,7 @@ out1:
out_priv:
return status;
}
static int depca_open(struct net_device *dev)
{
@ -924,8 +924,8 @@ static void depca_tx_timeout(struct net_device *dev)
}
/*
** Writes a socket buffer to TX descriptor ring and starts transmission
/*
** Writes a socket buffer to TX descriptor ring and starts transmission
*/
static int depca_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
@ -939,7 +939,7 @@ static int depca_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (skb_padto(skb, ETH_ZLEN))
goto out;
netif_stop_queue(dev);
if (TX_BUFFS_AVAIL) { /* Fill in a Tx ring entry */
@ -963,7 +963,7 @@ static int depca_start_xmit(struct sk_buff *skb, struct net_device *dev)
}
/*
** The DEPCA interrupt handler.
** The DEPCA interrupt handler.
*/
static irqreturn_t depca_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
@ -1053,8 +1053,8 @@ static int depca_rx(struct net_device *dev)
memcpy_fromio(buf, lp->rx_buff[lp->rx_old], pkt_len);
}
/*
** Notify the upper protocol layers that there is another
/*
** Notify the upper protocol layers that there is another
** packet to handle
*/
skb->protocol = eth_type_trans(skb, dev);
@ -1167,9 +1167,9 @@ static int depca_close(struct net_device *dev)
printk("%s: Shutting down ethercard, status was %2.2x.\n", dev->name, inw(DEPCA_DATA));
}
/*
/*
** We stop the DEPCA here -- it occasionally polls
** memory if we don't.
** memory if we don't.
*/
outw(STOP, DEPCA_DATA);
@ -1320,12 +1320,12 @@ static void SetMulticastFilter(struct net_device *dev)
static int __init depca_common_init (u_long ioaddr, struct net_device **devp)
{
int status = 0;
if (!request_region (ioaddr, DEPCA_TOTAL_SIZE, depca_string)) {
status = -EBUSY;
goto out;
}
if (DevicePresent(ioaddr)) {
status = -ENODEV;
goto out_release;
@ -1337,7 +1337,7 @@ static int __init depca_common_init (u_long ioaddr, struct net_device **devp)
}
return 0;
out_release:
release_region (ioaddr, DEPCA_TOTAL_SIZE);
out:
@ -1359,16 +1359,16 @@ static int __init depca_mca_probe(struct device *device)
struct depca_private *lp;
/*
** Search for the adapter. If an address has been given, search
** Search for the adapter. If an address has been given, search
** specifically for the card at that address. Otherwise find the
** first card in the system.
*/
pos[0] = mca_device_read_stored_pos(mdev, 2);
pos[1] = mca_device_read_stored_pos(mdev, 3);
/*
** IO of card is handled by bits 1 and 2 of pos0.
** IO of card is handled by bits 1 and 2 of pos0.
**
** bit2 bit1 IO
** 0 0 0x2c00
@ -1381,12 +1381,12 @@ static int __init depca_mca_probe(struct device *device)
/*
** Found the adapter we were looking for. Now start setting it up.
**
**
** First work on decoding the IRQ. It's stored in the lower 4 bits
** of pos1. Bits are as follows (from the ADF file):
**
** Bits
** 3 2 1 0 IRQ
** Bits
** 3 2 1 0 IRQ
** --------------------
** 0 0 1 0 5
** 0 0 0 1 9
@ -1435,7 +1435,7 @@ static int __init depca_mca_probe(struct device *device)
strncpy(mdev->name, depca_mca_adapter_name[mdev->index],
sizeof(mdev->name));
mca_device_set_claim(mdev, 1);
/*
** Get everything allocated and initialized... (almost just
** like the ISA and EISA probes)
@ -1452,10 +1452,10 @@ static int __init depca_mca_probe(struct device *device)
lp->depca_bus = DEPCA_BUS_MCA;
lp->adapter = depca_mca_adapter_type[mdev->index];
lp->mem_start = mem_start;
if ((err = depca_hw_init(dev, device)))
goto out_free;
return 0;
out_free:
@ -1479,7 +1479,7 @@ static void __init depca_platform_probe (void)
for (i = 0; depca_io_ports[i].iobase; i++) {
depca_io_ports[i].device = NULL;
/* if an address has been specified on the command
* line, use it (if valid) */
if (io && io != depca_io_ports[i].iobase)
@ -1503,7 +1503,7 @@ static void __init depca_platform_probe (void)
* no hardware at this address. Unregister it, as the
* release fuction will take care of freeing the
* allocated structure */
depca_io_ports[i].device = NULL;
pldev->dev.platform_data = NULL;
platform_device_unregister (pldev);
@ -1541,7 +1541,7 @@ static int __init depca_isa_probe (struct platform_device *device)
goto out;
adapter = depca_shmem_probe (&mem_start);
if (adapter == unknown) {
status = -ENODEV;
goto out_free;
@ -1554,10 +1554,10 @@ static int __init depca_isa_probe (struct platform_device *device)
lp->depca_bus = DEPCA_BUS_ISA;
lp->adapter = adapter;
lp->mem_start = mem_start;
if ((status = depca_hw_init(dev, &device->dev)))
goto out_free;
return 0;
out_free:
@ -1591,7 +1591,7 @@ static int __init depca_eisa_probe (struct device *device)
* it's address with the ethernet prom)... As we don't parse
* the EISA configuration structures (yet... :-), just rely on
* the ISA probing to sort it out... */
depca_shmem_probe (&mem_start);
dev->base_addr = ioaddr;
@ -1600,10 +1600,10 @@ static int __init depca_eisa_probe (struct device *device)
lp->depca_bus = DEPCA_BUS_EISA;
lp->adapter = edev->id.driver_data;
lp->mem_start = mem_start;
if ((status = depca_hw_init(dev, device)))
goto out_free;
return 0;
out_free:
@ -1650,7 +1650,7 @@ static int __init DepcaSignature(char *name, u_long base_addr)
* used, at least on x86. Instead, reserve a memory region a
* board would certainly use. If it works, go ahead. If not,
* run like hell... */
if (!request_mem_region (mem_addr, 16, depca_string))
return unknown;
@ -1699,7 +1699,7 @@ static int __init DepcaSignature(char *name, u_long base_addr)
** if the first address octet is a 0x08 - this minimises the chances of
** messing around with some other hardware, but it assumes that this DEPCA
** card initialized itself correctly.
**
**
** Search the Ethernet address ROM for the signature. Since the ROM address
** counter can start at an arbitrary point, the search must include the entire
** probe sequence length plus the (length_of_the_signature - 1).
@ -1804,7 +1804,7 @@ static int load_packet(struct net_device *dev, struct sk_buff *skb)
entry = lp->tx_new; /* Ring around buffer number. */
end = (entry + (skb->len - 1) / TX_BUFF_SZ) & lp->txRingMask;
if (!(readl(&lp->tx_ring[end].base) & T_OWN)) { /* Enough room? */
/*
/*
** Caution: the write order is important here... don't set up the
** ownership rights until all the other information is in place.
*/
@ -2086,7 +2086,7 @@ static int __init depca_module_init (void)
#endif
err |= platform_driver_register (&depca_isa_driver);
depca_platform_probe ();
return err;
}

Просмотреть файл

@ -20,17 +20,17 @@
#define DEPCA_RBSA ioaddr+0x0e /* RAM buffer starting address (2k buff.) */
/*
** These are LANCE registers addressable through DEPCA_ADDR
** These are LANCE registers addressable through DEPCA_ADDR
*/
#define CSR0 0
#define CSR1 1
#define CSR2 2
#define CSR3 3
/*
** NETWORK INTERFACE CSR (NI_CSR) bit definitions
/*
** NETWORK INTERFACE CSR (NI_CSR) bit definitions
*/
#define TO 0x0100 /* Time Out for remote boot */
#define SHE 0x0080 /* SHadow memory Enable */
#define BS 0x0040 /* Bank Select */
@ -42,8 +42,8 @@
#define IEN 0x0002 /* Interrupt tristate ENable (1->enable) */
#define LED 0x0001 /* LED control */
/*
** Control and Status Register 0 (CSR0) bit definitions
/*
** Control and Status Register 0 (CSR0) bit definitions
*/
#define ERR 0x8000 /* Error summary */
@ -74,7 +74,7 @@
#define BCON 0x0001 /* Byte CONtrol */
/*
** Initialization Block Mode Register
** Initialization Block Mode Register
*/
#define PROM 0x8000 /* Promiscuous Mode */
@ -88,7 +88,7 @@
#define DRX 0x0001 /* Disable the Receiver */
/*
** Receive Message Descriptor 1 (RMD1) bit definitions.
** Receive Message Descriptor 1 (RMD1) bit definitions.
*/
#define R_OWN 0x80000000 /* Owner bit 0 = host, 1 = lance */
@ -101,7 +101,7 @@
#define R_ENP 0x0100 /* End of Packet */
/*
** Transmit Message Descriptor 1 (TMD1) bit definitions.
** Transmit Message Descriptor 1 (TMD1) bit definitions.
*/
#define T_OWN 0x80000000 /* Owner bit 0 = host, 1 = lance */
@ -125,10 +125,10 @@
#define TMD3_LCAR 0x0800 /* Loss of CARrier */
#define TMD3_RTRY 0x0400 /* ReTRY error */
/*
** EISA configuration Register (CNFG) bit definitions
/*
** EISA configuration Register (CNFG) bit definitions
*/
#define TIMEOUT 0x0100 /* 0:2.5 mins, 1: 30 secs */
#define REMOTE 0x0080 /* Remote Boot Enable -> 1 */
#define IRQ11 0x0040 /* Enable -> 1 */
@ -165,8 +165,8 @@ struct depca_ioctl {
unsigned char __user *data; /* Pointer to the data buffer */
};
/*
** Recognised commands for the driver
/*
** Recognised commands for the driver
*/
#define DEPCA_GET_HWADDR 0x01 /* Get the hardware address */
#define DEPCA_SET_HWADDR 0x02 /* Get the hardware address */

Просмотреть файл

@ -874,7 +874,7 @@ static int dgrs_ioctl(struct net_device *devN, struct ifreq *ifr, int cmd)
privN->bcomm->bc_filter_port = ioc.port;
privN->bcomm->bc_filter_num = ioc.filter;
privN->bcomm->bc_filter_len = ioc.len;
if (ioc.len)
{
if(copy_from_user(S2HN(privN->bcomm->bc_filter_area),
@ -986,7 +986,7 @@ ack_intr:
/*
* Download the board firmware
*/
static int __init
static int __init
dgrs_download(struct net_device *dev0)
{
DGRS_PRIV *priv0 = (DGRS_PRIV *) dev0->priv;
@ -1150,7 +1150,7 @@ dgrs_download(struct net_device *dev0)
/*
* Probe (init) a board
*/
static int __init
static int __init
dgrs_probe1(struct net_device *dev)
{
DGRS_PRIV *priv = (DGRS_PRIV *) dev->priv;
@ -1190,7 +1190,7 @@ dgrs_probe1(struct net_device *dev)
*/
if (priv->plxreg)
OUTL(dev->base_addr + PLX_LCL2PCI_DOORBELL, 1);
rc = request_irq(dev->irq, &dgrs_intr, IRQF_SHARED, "RightSwitch", dev);
if (rc)
goto err_out;
@ -1228,7 +1228,7 @@ err_out:
return rc;
}
static int __init
static int __init
dgrs_initclone(struct net_device *dev)
{
DGRS_PRIV *priv = (DGRS_PRIV *) dev->priv;
@ -1243,7 +1243,7 @@ dgrs_initclone(struct net_device *dev)
return (0);
}
static struct net_device * __init
static struct net_device * __init
dgrs_found_device(
int io,
ulong mem,
@ -1276,9 +1276,9 @@ dgrs_found_device(
SET_MODULE_OWNER(dev);
SET_NETDEV_DEV(dev, pdev);
ret = dgrs_probe1(dev);
if (ret)
if (ret)
goto err1;
ret = register_netdev(dev);
@ -1301,7 +1301,7 @@ dgrs_found_device(
/* Allocate new dev and priv structures */
devN = alloc_etherdev(sizeof(DGRS_PRIV));
ret = -ENOMEM;
if (!devN)
if (!devN)
goto fail;
/* Don't copy the network device structure! */
@ -1335,7 +1335,7 @@ dgrs_found_device(
}
return dev;
fail:
fail:
while (i >= 0) {
struct net_device *d = priv->devtbl[i--];
unregister_netdev(d);
@ -1480,7 +1480,7 @@ static int __init dgrs_eisa_probe (struct device *gendev)
return -EBUSY;
}
if ( ! (inb(io+ES4H_EC) & ES4H_EC_ENABLE) )
if ( ! (inb(io+ES4H_EC) & ES4H_EC_ENABLE) )
goto err_out;
mem = (inb(io+ES4H_AS_31_24) << 24)
@ -1504,11 +1504,11 @@ static int __init dgrs_eisa_probe (struct device *gendev)
static int __devexit dgrs_eisa_remove(struct device *gendev)
{
struct net_device *dev = gendev->driver_data;
dgrs_remove(dev);
release_region(dev->base_addr, 256);
free_netdev(dev);
return 0;
}

Просмотреть файл

@ -31,8 +31,8 @@ typedef struct dgrs_ioctl {
unsigned short filter; /* filter number for command, if needed */
} DGRS_IOCTL;
/*
* Commands for the driver
/*
* Commands for the driver
*/
#define DGRS_GETMEM 0x01 /* Get the dual port memory address */
#define DGRS_SETFILTER 0x02 /* Set a filter */

Просмотреть файл

@ -19,7 +19,7 @@
# define S1(t,x) _Off=(_Off+0)&~0; x=_Off; _Off=_Off+1
# define S2(t,x) _Off=(_Off+1)&~1; x=_Off; _Off=_Off+2
# define S4(t,x) _Off=(_Off+3)&~3; x=_Off; _Off=_Off+4
# define END_STRUCT(x) _Off=(_Off+3)&~3; x=_Off
# define END_STRUCT(x) _Off=(_Off+3)&~3; x=_Off
#else /* C */

Просмотреть файл

@ -27,7 +27,7 @@
* bc_nowait
* bc_hostarea_len
* bc_filter_len
*
*
*/
BEGIN_STRUCT(bios_comm)
S4(ulong, bc_intflag) /* Count of all interrupts */

Просмотреть файл

@ -49,7 +49,7 @@ typedef struct
int buf_cnt; /* Total RBD's allocated */
/* Rx Statistics */
ulong cnt_rx_cnt; /* Total packets rcvd, good and bad */
ulong cnt_rx_cnt; /* Total packets rcvd, good and bad */
ulong cnt_rx_good; /* Total good packets rcvd */
ulong cnt_rx_bad; /* Total of all bad packets rcvd */
/* Subtotals can be gotten from SCB */
@ -94,7 +94,7 @@ typedef struct
* Filter 0: input filter
* Filter 1: output filter
*/
ulong *filter_space[NFILTERS];
FILTER_FUNC *filter_func[NFILTERS];
ulong filter_cnt[NFILTERS];

Просмотреть файл

@ -455,7 +455,7 @@ typedef volatile struct
/************************************************************************/
typedef volatile struct
{
ulong sysbus;
ulong sysbus;
ulong dummy;
I596_ISCP *iscpp;
} I596_SCP;

Просмотреть файл

@ -17,7 +17,7 @@
#include <linux/dma-mapping.h>
static char version[] __devinitdata =
KERN_INFO DRV_NAME " " DRV_VERSION " " DRV_RELDATE "\n";
KERN_INFO DRV_NAME " " DRV_VERSION " " DRV_RELDATE "\n";
#define MAX_UNITS 8
static int mtu[MAX_UNITS];
static int vlan[MAX_UNITS];
@ -144,9 +144,9 @@ rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent)
if (media[card_idx] != NULL) {
np->an_enable = 0;
if (strcmp (media[card_idx], "auto") == 0 ||
strcmp (media[card_idx], "autosense") == 0 ||
strcmp (media[card_idx], "autosense") == 0 ||
strcmp (media[card_idx], "0") == 0 ) {
np->an_enable = 2;
np->an_enable = 2;
} else if (strcmp (media[card_idx], "100mbps_fd") == 0 ||
strcmp (media[card_idx], "4") == 0) {
np->speed = 100;
@ -232,7 +232,7 @@ rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent)
err = find_miiphy (dev);
if (err)
goto err_out_unmap_rx;
/* Fiber device? */
np->phy_media = (readw(ioaddr + ASICCtrl) & PhyMedia) ? 1 : 0;
np->link_status = 0;
@ -263,11 +263,11 @@ rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent)
dev->dev_addr[0], dev->dev_addr[1], dev->dev_addr[2],
dev->dev_addr[3], dev->dev_addr[4], dev->dev_addr[5], irq);
if (tx_coalesce > 1)
printk(KERN_INFO "tx_coalesce:\t%d packets\n",
printk(KERN_INFO "tx_coalesce:\t%d packets\n",
tx_coalesce);
if (np->coalesce)
printk(KERN_INFO "rx_coalesce:\t%d packets\n"
KERN_INFO "rx_timeout: \t%d ns\n",
KERN_INFO "rx_timeout: \t%d ns\n",
np->rx_coalesce, np->rx_timeout*640);
if (np->vlan)
printk(KERN_INFO "vlan(id):\t%d\n", np->vlan);
@ -339,7 +339,7 @@ parse_eeprom (struct net_device *dev)
}
#ifdef MEM_MAPPING
ioaddr = dev->base_addr;
#endif
#endif
/* Check CRC */
crc = ~ether_crc_le (256 - 4, sromdata);
if (psrom->crc != crc) {
@ -400,16 +400,16 @@ rio_open (struct net_device *dev)
long ioaddr = dev->base_addr;
int i;
u16 macctrl;
i = request_irq (dev->irq, &rio_interrupt, IRQF_SHARED, dev->name, dev);
if (i)
return i;
/* Reset all logic functions */
writew (GlobalReset | DMAReset | FIFOReset | NetworkReset | HostReset,
ioaddr + ASICCtrl + 2);
mdelay(10);
/* DebugCtrl bit 4, 5, 9 must set */
writel (readl (ioaddr + DebugCtrl) | 0x0230, ioaddr + DebugCtrl);
@ -440,7 +440,7 @@ rio_open (struct net_device *dev)
/* VLAN supported */
if (np->vlan) {
/* priority field in RxDMAIntCtrl */
writel (readl(ioaddr + RxDMAIntCtrl) | 0x7 << 10,
writel (readl(ioaddr + RxDMAIntCtrl) | 0x7 << 10,
ioaddr + RxDMAIntCtrl);
/* VLANId */
writew (np->vlan, ioaddr + VLANId);
@ -459,9 +459,9 @@ rio_open (struct net_device *dev)
add_timer (&np->timer);
/* Start Tx/Rx */
writel (readl (ioaddr + MACCtrl) | StatsEnable | RxEnable | TxEnable,
writel (readl (ioaddr + MACCtrl) | StatsEnable | RxEnable | TxEnable,
ioaddr + MACCtrl);
macctrl = 0;
macctrl |= (np->vlan) ? AutoVLANuntagging : 0;
macctrl |= (np->full_duplex) ? DuplexSelect : 0;
@ -470,13 +470,13 @@ rio_open (struct net_device *dev)
writew(macctrl, ioaddr + MACCtrl);
netif_start_queue (dev);
/* Enable default interrupts */
EnableInt ();
return 0;
}
static void
static void
rio_timer (unsigned long data)
{
struct net_device *dev = (struct net_device *)data;
@ -521,7 +521,7 @@ rio_timer (unsigned long data)
np->timer.expires = jiffies + next_tick;
add_timer(&np->timer);
}
static void
rio_tx_timeout (struct net_device *dev)
{
@ -632,12 +632,12 @@ start_xmit (struct sk_buff *skb, struct net_device *dev)
* Work around: Always use 1 descriptor in 10Mbps mode */
if (entry % np->tx_coalesce == 0 || np->speed == 10)
txdesc->status = cpu_to_le64 (entry | tfc_vlan_tag |
WordAlignDisable |
WordAlignDisable |
TxDMAIndicate |
(1 << FragCountShift));
else
txdesc->status = cpu_to_le64 (entry | tfc_vlan_tag |
WordAlignDisable |
WordAlignDisable |
(1 << FragCountShift));
/* TxDMAPollNow */
@ -658,7 +658,7 @@ start_xmit (struct sk_buff *skb, struct net_device *dev)
dev->base_addr + TFDListPtr0);
writel (0, dev->base_addr + TFDListPtr1);
}
/* NETDEV WATCHDOG timer */
dev->trans_start = jiffies;
return 0;
@ -677,7 +677,7 @@ rio_interrupt (int irq, void *dev_instance, struct pt_regs *rgs)
ioaddr = dev->base_addr;
np = netdev_priv(dev);
while (1) {
int_status = readw (ioaddr + IntStatus);
int_status = readw (ioaddr + IntStatus);
writew (int_status, ioaddr + IntStatus);
int_status &= DEFAULT_INTR;
if (int_status == 0 || --cnt < 0)
@ -693,7 +693,7 @@ rio_interrupt (int irq, void *dev_instance, struct pt_regs *rgs)
if (tx_status & 0x01)
tx_error (dev, tx_status);
/* Free used tx skbuffs */
rio_free_tx (dev, 1);
rio_free_tx (dev, 1);
}
/* Handle uncommon events */
@ -706,19 +706,19 @@ rio_interrupt (int irq, void *dev_instance, struct pt_regs *rgs)
return IRQ_RETVAL(handled);
}
static void
rio_free_tx (struct net_device *dev, int irq)
static void
rio_free_tx (struct net_device *dev, int irq)
{
struct netdev_private *np = netdev_priv(dev);
int entry = np->old_tx % TX_RING_SIZE;
int tx_use = 0;
unsigned long flag = 0;
if (irq)
spin_lock(&np->tx_lock);
else
spin_lock_irqsave(&np->tx_lock, flag);
/* Free used tx skbuffs */
while (entry != np->cur_tx) {
struct sk_buff *skb;
@ -744,11 +744,11 @@ rio_free_tx (struct net_device *dev, int irq)
spin_unlock_irqrestore(&np->tx_lock, flag);
np->old_tx = entry;
/* If the ring is no longer full, clear tx_full and
/* If the ring is no longer full, clear tx_full and
call netif_wake_queue() */
if (netif_queue_stopped(dev) &&
((np->cur_tx - np->old_tx + TX_RING_SIZE) % TX_RING_SIZE
((np->cur_tx - np->old_tx + TX_RING_SIZE) % TX_RING_SIZE
< TX_QUEUE_LEN - 1 || np->speed == 10)) {
netif_wake_queue (dev);
}
@ -805,11 +805,11 @@ tx_error (struct net_device *dev, int tx_status)
/* Let TxStartThresh stay default value */
}
/* Maximum Collisions */
#ifdef ETHER_STATS
if (tx_status & 0x08)
#ifdef ETHER_STATS
if (tx_status & 0x08)
np->stats.collisions16++;
#else
if (tx_status & 0x08)
if (tx_status & 0x08)
np->stats.collisions++;
#endif
/* Restart the Tx */
@ -862,7 +862,7 @@ receive_packet (struct net_device *dev)
np->rx_skbuff[entry] = NULL;
} else if ((skb = dev_alloc_skb (pkt_len + 2)) != NULL) {
pci_dma_sync_single_for_cpu(np->pdev,
desc->fraginfo &
desc->fraginfo &
DMA_48BIT_MASK,
np->rx_buf_sz,
PCI_DMA_FROMDEVICE);
@ -880,12 +880,12 @@ receive_packet (struct net_device *dev)
PCI_DMA_FROMDEVICE);
}
skb->protocol = eth_type_trans (skb, dev);
#if 0
#if 0
/* Checksum done by hw, but csum value unavailable. */
if (np->pci_rev_id >= 0x0c &&
if (np->pci_rev_id >= 0x0c &&
!(frame_status & (TCPError | UDPError | IPError))) {
skb->ip_summed = CHECKSUM_UNNECESSARY;
}
}
#endif
netif_rx (skb);
dev->last_rx = jiffies;
@ -945,14 +945,14 @@ rio_error (struct net_device *dev, int int_status)
mii_get_media (dev);
if (np->speed == 1000)
np->tx_coalesce = tx_coalesce;
else
else
np->tx_coalesce = 1;
macctrl = 0;
macctrl |= (np->vlan) ? AutoVLANuntagging : 0;
macctrl |= (np->full_duplex) ? DuplexSelect : 0;
macctrl |= (np->tx_flow) ?
macctrl |= (np->tx_flow) ?
TxFlowControlEnable : 0;
macctrl |= (np->rx_flow) ?
macctrl |= (np->rx_flow) ?
RxFlowControlEnable : 0;
writew(macctrl, ioaddr + MACCtrl);
np->link_status = 1;
@ -969,7 +969,7 @@ rio_error (struct net_device *dev, int int_status)
get_stats (dev);
}
/* PCI Error, a catastronphic error related to the bus interface
/* PCI Error, a catastronphic error related to the bus interface
occurs, set GlobalReset and HostReset to reset. */
if (int_status & HostError) {
printk (KERN_ERR "%s: HostError! IntStatus %4.4x.\n",
@ -991,16 +991,16 @@ get_stats (struct net_device *dev)
/* All statistics registers need to be acknowledged,
else statistic overflow could cause problems */
np->stats.rx_packets += readl (ioaddr + FramesRcvOk);
np->stats.tx_packets += readl (ioaddr + FramesXmtOk);
np->stats.rx_bytes += readl (ioaddr + OctetRcvOk);
np->stats.tx_bytes += readl (ioaddr + OctetXmtOk);
np->stats.multicast = readl (ioaddr + McstFramesRcvdOk);
np->stats.collisions += readl (ioaddr + SingleColFrames)
+ readl (ioaddr + MultiColFrames);
np->stats.collisions += readl (ioaddr + SingleColFrames)
+ readl (ioaddr + MultiColFrames);
/* detailed tx errors */
stat_reg = readw (ioaddr + FramesAbortXSColls);
np->stats.tx_aborted_errors += stat_reg;
@ -1047,7 +1047,7 @@ clear_stats (struct net_device *dev)
long ioaddr = dev->base_addr;
#ifdef MEM_MAPPING
int i;
#endif
#endif
/* All statistics registers need to be acknowledged,
else statistic overflow could cause problems */
@ -1060,7 +1060,7 @@ clear_stats (struct net_device *dev)
readl (ioaddr + SingleColFrames);
readl (ioaddr + MultiColFrames);
readl (ioaddr + LateCollisions);
/* detailed rx errors */
/* detailed rx errors */
readw (ioaddr + FrameTooLongErrors);
readw (ioaddr + InRangeLengthErrors);
readw (ioaddr + FramesCheckSeqErrors);
@ -1086,7 +1086,7 @@ clear_stats (struct net_device *dev)
#ifdef MEM_MAPPING
for (i = 0x100; i <= 0x150; i += 4)
readl (ioaddr + i);
#endif
#endif
readw (ioaddr + TxJumboFrames);
readw (ioaddr + RxJumboFrames);
readw (ioaddr + TCPCheckSumErrors);
@ -1118,26 +1118,26 @@ set_multicast (struct net_device *dev)
u32 hash_table[2];
u16 rx_mode = 0;
struct netdev_private *np = netdev_priv(dev);
hash_table[0] = hash_table[1] = 0;
/* RxFlowcontrol DA: 01-80-C2-00-00-01. Hash index=0x39 */
hash_table[1] |= cpu_to_le32(0x02000000);
if (dev->flags & IFF_PROMISC) {
/* Receive all frames promiscuously. */
rx_mode = ReceiveAllFrames;
} else if ((dev->flags & IFF_ALLMULTI) ||
} else if ((dev->flags & IFF_ALLMULTI) ||
(dev->mc_count > multicast_filter_limit)) {
/* Receive broadcast and multicast frames */
rx_mode = ReceiveBroadcast | ReceiveMulticast | ReceiveUnicast;
} else if (dev->mc_count > 0) {
int i;
struct dev_mc_list *mclist;
/* Receive broadcast frames and multicast frames filtering
/* Receive broadcast frames and multicast frames filtering
by Hashtable */
rx_mode =
ReceiveBroadcast | ReceiveMulticastHash | ReceiveUnicast;
for (i=0, mclist = dev->mc_list; mclist && i < dev->mc_count;
i++, mclist=mclist->next)
for (i=0, mclist = dev->mc_list; mclist && i < dev->mc_count;
i++, mclist=mclist->next)
{
int bit, index = 0;
int crc = ether_crc_le (ETH_ALEN, mclist->dmi_addr);
@ -1167,7 +1167,7 @@ static void rio_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info
strcpy(info->driver, "dl2k");
strcpy(info->version, DRV_VERSION);
strcpy(info->bus_info, pci_name(np->pdev));
}
}
static int rio_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
{
@ -1177,10 +1177,10 @@ static int rio_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
cmd->supported = SUPPORTED_Autoneg | SUPPORTED_FIBRE;
cmd->advertising= ADVERTISED_Autoneg | ADVERTISED_FIBRE;
cmd->port = PORT_FIBRE;
cmd->transceiver = XCVR_INTERNAL;
cmd->transceiver = XCVR_INTERNAL;
} else {
/* copper device */
cmd->supported = SUPPORTED_10baseT_Half |
cmd->supported = SUPPORTED_10baseT_Half |
SUPPORTED_10baseT_Full | SUPPORTED_100baseT_Half
| SUPPORTED_100baseT_Full | SUPPORTED_1000baseT_Full |
SUPPORTED_Autoneg | SUPPORTED_MII;
@ -1191,7 +1191,7 @@ static int rio_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
cmd->port = PORT_MII;
cmd->transceiver = XCVR_INTERNAL;
}
if ( np->link_status ) {
if ( np->link_status ) {
cmd->speed = np->speed;
cmd->duplex = np->full_duplex ? DUPLEX_FULL : DUPLEX_HALF;
} else {
@ -1202,9 +1202,9 @@ static int rio_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
cmd->autoneg = AUTONEG_ENABLE;
else
cmd->autoneg = AUTONEG_DISABLE;
cmd->phy_address = np->phy_addr;
return 0;
return 0;
}
static int rio_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
@ -1217,22 +1217,22 @@ static int rio_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
else {
np->an_enable = 1;
mii_set_media(dev);
return 0;
}
return 0;
}
} else {
np->an_enable = 0;
if (np->speed == 1000) {
cmd->speed = SPEED_100;
cmd->speed = SPEED_100;
cmd->duplex = DUPLEX_FULL;
printk("Warning!! Can't disable Auto negotiation in 1000Mbps, change to Manual 100Mbps, Full duplex.\n");
}
switch(cmd->speed + cmd->duplex) {
case SPEED_10 + DUPLEX_HALF:
np->speed = 10;
np->full_duplex = 0;
break;
case SPEED_10 + DUPLEX_FULL:
np->speed = 10;
np->full_duplex = 1;
@ -1248,7 +1248,7 @@ static int rio_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
case SPEED_1000 + DUPLEX_HALF:/* not supported */
case SPEED_1000 + DUPLEX_FULL:/* not supported */
default:
return -EINVAL;
return -EINVAL;
}
mii_set_media(dev);
}
@ -1274,7 +1274,7 @@ rio_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
int phy_addr;
struct netdev_private *np = netdev_priv(dev);
struct mii_data *miidata = (struct mii_data *) &rq->ifr_ifru;
struct netdev_desc *desc;
int i;
@ -1282,7 +1282,7 @@ rio_ioctl (struct net_device *dev, struct ifreq *rq, int cmd)
switch (cmd) {
case SIOCDEVPRIVATE:
break;
case SIOCDEVPRIVATE + 1:
miidata->out_value = mii_read (dev, phy_addr, miidata->reg_num);
break;
@ -1467,7 +1467,7 @@ mii_get_media (struct net_device *dev)
/* Auto-Negotiation not completed */
return -1;
}
negotiate.image = mii_read (dev, phy_addr, MII_ANAR) &
negotiate.image = mii_read (dev, phy_addr, MII_ANAR) &
mii_read (dev, phy_addr, MII_ANLPAR);
mscr.image = mii_read (dev, phy_addr, MII_MSCR);
mssr.image = mii_read (dev, phy_addr, MII_MSSR);
@ -1519,9 +1519,9 @@ mii_get_media (struct net_device *dev)
printk ("Half duplex\n");
}
}
if (np->tx_flow)
if (np->tx_flow)
printk(KERN_INFO "Enable Tx Flow Control\n");
else
else
printk(KERN_INFO "Disable Tx Flow Control\n");
if (np->rx_flow)
printk(KERN_INFO "Enable Rx Flow Control\n");
@ -1561,7 +1561,7 @@ mii_set_media (struct net_device *dev)
pscr.image = mii_read (dev, phy_addr, MII_PHY_SCR);
pscr.bits.mdi_crossover_mode = 3; /* 11'b */
mii_write (dev, phy_addr, MII_PHY_SCR, pscr.image);
/* Soft reset PHY */
mii_write (dev, phy_addr, MII_BMCR, MII_BMCR_RESET);
bmcr.image = 0;
@ -1639,7 +1639,7 @@ mii_get_media_pcs (struct net_device *dev)
/* Auto-Negotiation not completed */
return -1;
}
negotiate.image = mii_read (dev, phy_addr, PCS_ANAR) &
negotiate.image = mii_read (dev, phy_addr, PCS_ANAR) &
mii_read (dev, phy_addr, PCS_ANLPAR);
np->speed = 1000;
if (negotiate.bits.full_duplex) {
@ -1666,9 +1666,9 @@ mii_get_media_pcs (struct net_device *dev)
printk ("Half duplex\n");
}
}
if (np->tx_flow)
if (np->tx_flow)
printk(KERN_INFO "Enable Tx Flow Control\n");
else
else
printk(KERN_INFO "Disable Tx Flow Control\n");
if (np->rx_flow)
printk(KERN_INFO "Enable Rx Flow Control\n");
@ -1694,9 +1694,9 @@ mii_set_media_pcs (struct net_device *dev)
/* Advertise capabilities */
esr.image = mii_read (dev, phy_addr, PCS_ESR);
anar.image = mii_read (dev, phy_addr, MII_ANAR);
anar.bits.half_duplex =
anar.bits.half_duplex =
esr.bits.media_1000BT_HD | esr.bits.media_1000BX_HD;
anar.bits.full_duplex =
anar.bits.full_duplex =
esr.bits.media_1000BT_FD | esr.bits.media_1000BX_FD;
anar.bits.pause = 1;
anar.bits.asymmetric = 1;
@ -1754,14 +1754,14 @@ rio_close (struct net_device *dev)
synchronize_irq (dev->irq);
free_irq (dev->irq, dev);
del_timer_sync (&np->timer);
/* Free all the skbuffs in the queue. */
for (i = 0; i < RX_RING_SIZE; i++) {
np->rx_ring[i].status = 0;
np->rx_ring[i].fraginfo = 0;
skb = np->rx_skbuff[i];
if (skb) {
pci_unmap_single(np->pdev,
pci_unmap_single(np->pdev,
np->rx_ring[i].fraginfo & DMA_48BIT_MASK,
skb->len, PCI_DMA_FROMDEVICE);
dev_kfree_skb (skb);
@ -1771,7 +1771,7 @@ rio_close (struct net_device *dev)
for (i = 0; i < TX_RING_SIZE; i++) {
skb = np->tx_skbuff[i];
if (skb) {
pci_unmap_single(np->pdev,
pci_unmap_single(np->pdev,
np->tx_ring[i].fraginfo & DMA_48BIT_MASK,
skb->len, PCI_DMA_TODEVICE);
dev_kfree_skb (skb);
@ -1828,9 +1828,9 @@ module_init (rio_init);
module_exit (rio_exit);
/*
Compile command:
Compile command:
gcc -D__KERNEL__ -DMODULE -I/usr/src/linux/include -Wall -Wstrict-prototypes -O2 -c dl2k.c
Read Documentation/networking/dl2k.txt for details.

Просмотреть файл

@ -1,5 +1,5 @@
/* D-Link DL2000-based Gigabit Ethernet Adapter Linux driver */
/*
/*
Copyright (c) 2001, 2002 by D-Link Corporation
Written by Edward Peng.<edward_peng@dlink.com.tw>
Created 03-May-2001, base on Linux' sundance.c.
@ -216,7 +216,7 @@ enum MACCtrl_bits {
enum ASICCtrl_LoWord_bits {
PhyMedia = 0x0080,
};
enum ASICCtrl_HiWord_bits {
GlobalReset = 0x0001,
RxReset = 0x0002,
@ -596,7 +596,7 @@ typedef union t_PCS_ANLPAR {
} ANLPAR_PCS_t, *PANLPAR_PCS_t;
enum _pcs_anlpar {
PCS_ANLPAR_NEXT_PAGE = PCS_ANAR_NEXT_PAGE,
PCS_ANLPAR_NEXT_PAGE = PCS_ANAR_NEXT_PAGE,
PCS_ANLPAR_REMOTE_FAULT = PCS_ANAR_REMOTE_FAULT,
PCS_ANLPAR_ASYMMETRIC = PCS_ANAR_ASYMMETRIC,
PCS_ANLPAR_PAUSE = PCS_ANAR_PAUSE,

Просмотреть файл

@ -11,7 +11,7 @@
One solution is to set up a dummy link using PPP/SLIP/PLIP,
but this seems (to me) too much overhead for too little gain.
This driver provides a small alternative. Thus you can do
[when not running slip]
ifconfig dummy slip.addr.ess.here up
[to go to slip]
@ -44,9 +44,9 @@ static int dummy_set_address(struct net_device *dev, void *p)
{
struct sockaddr *sa = p;
if (!is_valid_ether_addr(sa->sa_data))
if (!is_valid_ether_addr(sa->sa_data))
return -EADDRNOTAVAIL;
memcpy(dev->dev_addr, sa->sa_data, ETH_ALEN);
return 0;
}
@ -111,7 +111,7 @@ static int __init dummy_init_one(int index)
free_netdev(dev_dummy);
dev_dummy = NULL;
} else {
dummies[index] = dev_dummy;
dummies[index] = dev_dummy;
}
return err;
@ -121,30 +121,30 @@ static void dummy_free_one(int index)
{
unregister_netdev(dummies[index]);
free_netdev(dummies[index]);
}
}
static int __init dummy_init_module(void)
{
{
int i, err = 0;
dummies = kmalloc(numdummies * sizeof(void *), GFP_KERNEL);
dummies = kmalloc(numdummies * sizeof(void *), GFP_KERNEL);
if (!dummies)
return -ENOMEM;
return -ENOMEM;
for (i = 0; i < numdummies && !err; i++)
err = dummy_init_one(i);
if (err) {
err = dummy_init_one(i);
if (err) {
i--;
while (--i >= 0)
dummy_free_one(i);
}
return err;
}
}
static void __exit dummy_cleanup_module(void)
{
int i;
for (i = 0; i < numdummies; i++)
dummy_free_one(i);
kfree(dummies);
for (i = 0; i < numdummies; i++)
dummy_free_one(i);
kfree(dummies);
}
module_init(dummy_init_module);

Просмотреть файл

@ -110,7 +110,7 @@ static void e21_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr,
static int e21_close(struct net_device *dev);
/* Probe for the E2100 series ethercards. These cards have an 8390 at the
base address and the station address at both offset 0x10 and 0x18. I read
the station address from offset 0x18 to avoid the dataport of NE2000
@ -403,7 +403,7 @@ e21_close(struct net_device *dev)
return 0;
}
#ifdef MODULE
#define MAX_E21_CARDS 4 /* Max number of E21 cards per module */
static struct net_device *dev_e21[MAX_E21_CARDS];

Просмотреть файл

@ -496,7 +496,7 @@ static void set_rx_mode(struct net_device *dev);
static void speedo_show_state(struct net_device *dev);
static struct ethtool_ops ethtool_ops;
#ifdef honor_default_port
/* Optional driver feature to allow forcing the transceiver setting.
@ -646,7 +646,7 @@ static int __devinit speedo_found1(struct pci_dev *pdev,
option = 0;
rtnl_lock();
if (dev_alloc_name(dev, dev->name) < 0)
if (dev_alloc_name(dev, dev->name) < 0)
goto err_free_unlock;
/* Read the station address EEPROM before doing the reset.
@ -825,10 +825,10 @@ static int __devinit speedo_found1(struct pci_dev *pdev,
sp->mii_if.dev = dev;
sp->mii_if.mdio_read = mdio_read;
sp->mii_if.mdio_write = mdio_write;
sp->rx_bug = (eeprom[3] & 0x03) == 3 ? 0 : 1;
if (((pdev->device > 0x1030 && (pdev->device < 0x103F)))
|| (pdev->device == 0x2449) || (pdev->device == 0x2459)
if (((pdev->device > 0x1030 && (pdev->device < 0x103F)))
|| (pdev->device == 0x2449) || (pdev->device == 0x2459)
|| (pdev->device == 0x245D)) {
sp->chip_id = 1;
}
@ -1208,7 +1208,7 @@ static void speedo_show_state(struct net_device *dev)
int i;
if (netif_msg_pktdata(sp)) {
printk(KERN_DEBUG "%s: Tx ring dump, Tx queue %u / %u:\n",
printk(KERN_DEBUG "%s: Tx ring dump, Tx queue %u / %u:\n",
dev->name, sp->cur_tx, sp->dirty_tx);
for (i = 0; i < TX_RING_SIZE; i++)
printk(KERN_DEBUG "%s: %c%c%2d %8.8x.\n", dev->name,
@ -1586,7 +1586,7 @@ static irqreturn_t speedo_interrupt(int irq, void *dev_instance, struct pt_regs
/* Always check if all rx buffers are allocated. --SAW */
speedo_refill_rx_buffers(dev, 0);
spin_lock(&sp->lock);
/*
* The chip may have suspended reception for various reasons.
@ -1607,8 +1607,8 @@ static irqreturn_t speedo_interrupt(int irq, void *dev_instance, struct pt_regs
/* these are all reserved values */
break;
}
/* User interrupt, Command/Tx unit interrupt or CU not active. */
if (status & 0xA400) {
speedo_tx_buffer_gc(dev);
@ -1619,7 +1619,7 @@ static irqreturn_t speedo_interrupt(int irq, void *dev_instance, struct pt_regs
netif_wake_queue(dev); /* Attention: under a spinlock. --SAW */
}
}
spin_unlock(&sp->lock);
if (--boguscnt < 0) {
@ -2263,7 +2263,7 @@ static void set_rx_mode(struct net_device *dev)
sp->rx_mode = new_rx_mode;
}
#ifdef CONFIG_PM
static int eepro100_suspend(struct pci_dev *pdev, pm_message_t state)
{
@ -2275,12 +2275,12 @@ static int eepro100_suspend(struct pci_dev *pdev, pm_message_t state)
if (!netif_running(dev))
return 0;
del_timer_sync(&sp->timer);
netif_device_detach(dev);
iowrite32(PortPartialReset, ioaddr + SCBPort);
/* XXX call pci_set_power_state ()? */
pci_disable_device(pdev);
pci_set_power_state (pdev, PCI_D3hot);
@ -2324,7 +2324,7 @@ static void __devexit eepro100_remove_one (struct pci_dev *pdev)
{
struct net_device *dev = pci_get_drvdata (pdev);
struct speedo_private *sp = netdev_priv(dev);
unregister_netdev(dev);
release_region(pci_resource_start(pdev, 1), pci_resource_len(pdev, 1));
@ -2337,7 +2337,7 @@ static void __devexit eepro100_remove_one (struct pci_dev *pdev)
pci_disable_device(pdev);
free_netdev(dev);
}
static struct pci_device_id eepro100_pci_tbl[] = {
{ PCI_VENDOR_ID_INTEL, 0x1229, PCI_ANY_ID, PCI_ANY_ID, },
{ PCI_VENDOR_ID_INTEL, 0x1209, PCI_ANY_ID, PCI_ANY_ID, },
@ -2368,7 +2368,7 @@ static struct pci_device_id eepro100_pci_tbl[] = {
{ 0,}
};
MODULE_DEVICE_TABLE(pci, eepro100_pci_tbl);
static struct pci_driver eepro100_driver = {
.name = "eepro100",
.id_table = eepro100_pci_tbl,
@ -2395,7 +2395,7 @@ static void __exit eepro100_cleanup_module(void)
module_init(eepro100_init_module);
module_exit(eepro100_cleanup_module);
/*
* Local variables:
* compile-command: "gcc -DMODULE -D__KERNEL__ -I/usr/src/linux/net/inet -Wall -Wstrict-prototypes -O6 -c eepro100.c `[ -f /usr/include/linux/modversions.h ] && echo -DMODVERSIONS`"

Просмотреть файл

@ -77,7 +77,7 @@
* CU before submitting a packet for transmission, and then restarts it as soon
* as the process of handing the packet is complete. This is definitely an
* unnecessary slowdown if the card is running in 16-bit mode; therefore one
* should detect 16-bit vs 8-bit mode from the EEPROM settings and act
* should detect 16-bit vs 8-bit mode from the EEPROM settings and act
* accordingly. In 8-bit mode with this bugfix I'm getting about 150 K/s for
* ftp's, which is significantly better than I get in DOS, so the overhead of
* stopping and restarting the CU with each transmit is not prohibitive in
@ -96,7 +96,7 @@
#ifndef LOCKUP16
#define LOCKUP16 0
#endif
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/types.h>
@ -177,7 +177,7 @@ static unsigned short start_code[] = {
/* 0x20 -- start of 82586 CU program */
#define CONF_LINK 0x20
0x0000,Cmd_Config,
0x0000,Cmd_Config,
0x0032, /* link to next command */
0x080c, /* 12 bytes follow : fifo threshold=8 */
0x2e40, /* don't rx bad frames
@ -187,10 +187,10 @@ static unsigned short start_code[] = {
*/
0x6000, /* default backoff method & priority
* interframe spacing = 0x60 */
0xf200, /* slot time=0x200
0xf200, /* slot time=0x200
* max collision retry = 0xf */
#define CONF_PROMISC 0x2e
0x0000, /* no HDLC : normal CRC : enable broadcast
0x0000, /* no HDLC : normal CRC : enable broadcast
* disable promiscuous/multicast modes */
0x003c, /* minimum frame length = 60 octets) */
@ -237,7 +237,7 @@ static unsigned short mca_iomap[] = {
};
/* bits 5-7 of the second POS register */
static char mca_irqmap[] = { 12, 9, 3, 4, 5, 10, 11, 15 };
#endif
#endif
/*
* Prototypes for Linux interface
@ -356,7 +356,7 @@ static int __init do_express_probe(struct net_device *dev)
*/
while (slot != MCA_NOTFOUND) {
int pos0, pos1;
slot = mca_find_unused_adapter(0x628B, slot);
if (slot == MCA_NOTFOUND)
break;
@ -366,10 +366,10 @@ static int __init do_express_probe(struct net_device *dev)
ioaddr = mca_iomap[pos1&0xf];
dev->irq = mca_irqmap[(pos1>>4)&0x7];
/*
* XXX: Transciever selection is done
* differently on the MCA version.
* differently on the MCA version.
* How to get it to select something
* other than external/AUI is currently
* unknown. This code is just for looks. -- ASF
@ -482,7 +482,7 @@ static int eexp_open(struct net_device *dev)
, ioaddr+0xc000);
goto err_out4;
}
if (lp->width) {
printk("%s: forcing ASIC to 8-bit mode\n", dev->name);
outb(inb(dev->base_addr+Config)&~4, dev->base_addr+Config);
@ -518,7 +518,7 @@ static int eexp_close(struct net_device *dev)
int irq = dev->irq;
netif_stop_queue(dev);
outb(SIRQ_dis|irqrmap[irq],ioaddr+SET_IRQ);
lp->started = 0;
scb_command(dev, SCB_CUsuspend|SCB_RUsuspend);
@ -630,14 +630,14 @@ static void eexp_timeout(struct net_device *dev)
unsigned long flags;
#endif
int status;
disable_irq(dev->irq);
/*
* Best would be to use synchronize_irq(); spin_lock() here
* lets make it work first..
*/
#ifdef CONFIG_SMP
spin_lock_irqsave(&lp->lock, flags);
#endif
@ -653,7 +653,7 @@ static void eexp_timeout(struct net_device *dev)
scb_command(dev, SCB_CUabort);
outb(0,dev->base_addr+SIGNAL_CA);
}
netif_wake_queue(dev);
netif_wake_queue(dev);
#ifdef CONFIG_SMP
spin_unlock_irqrestore(&lp->lock, flags);
#endif
@ -687,11 +687,11 @@ static int eexp_xmit(struct sk_buff *buf, struct net_device *dev)
* Best would be to use synchronize_irq(); spin_lock() here
* lets make it work first..
*/
#ifdef CONFIG_SMP
spin_lock_irqsave(&lp->lock, flags);
#endif
{
unsigned short *data = (unsigned short *)buf->data;
@ -739,7 +739,7 @@ static unsigned short eexp_start_irq(struct net_device *dev,
outw(CONF_DIAG_RESULT & ~31, ioaddr + SM_PTR);
diag_status = inw(ioaddr + SHADOW(CONF_DIAG_RESULT));
if (diag_status & 1<<11) {
printk(KERN_WARNING "%s: 82586 failed self-test\n",
printk(KERN_WARNING "%s: 82586 failed self-test\n",
dev->name);
} else if (!(diag_status & 1<<13)) {
printk(KERN_WARNING "%s: 82586 self-test failed to complete\n", dev->name);
@ -749,7 +749,7 @@ static unsigned short eexp_start_irq(struct net_device *dev,
tdr_status = inw(ioaddr + SHADOW(CONF_TDR_RESULT));
if (tdr_status & (TDR_SHORT|TDR_OPEN)) {
printk(KERN_WARNING "%s: TDR reports cable %s at %d tick%s\n", dev->name, (tdr_status & TDR_SHORT)?"short":"broken", tdr_status & TDR_TIME, ((tdr_status & TDR_TIME) != 1) ? "s" : "");
}
}
else if (tdr_status & TDR_XCVRPROBLEM) {
printk(KERN_WARNING "%s: TDR reports transceiver problem\n", dev->name);
}
@ -761,7 +761,7 @@ static unsigned short eexp_start_irq(struct net_device *dev,
printk("%s: TDR is ga-ga (status %04x)\n", dev->name,
tdr_status);
}
lp->started |= STARTED_CU;
scb_wrcbl(dev, lp->tx_link);
/* if the RU isn't running, start it now */
@ -774,7 +774,7 @@ static unsigned short eexp_start_irq(struct net_device *dev,
ack_cmd |= SCB_CUstart | 0x2000;
}
if ((dev->flags & IFF_UP) && !(lp->started & STARTED_RU) && SCB_RUstat(status)==4)
if ((dev->flags & IFF_UP) && !(lp->started & STARTED_RU) && SCB_RUstat(status)==4)
lp->started|=STARTED_RU;
return ack_cmd;
@ -788,7 +788,7 @@ static void eexp_cmd_clear(struct net_device *dev)
printk("%s: command didn't clear\n", dev->name);
}
}
static irqreturn_t eexp_irq(int irq, void *dev_info, struct pt_regs *regs)
{
struct net_device *dev = dev_info;
@ -813,7 +813,7 @@ static irqreturn_t eexp_irq(int irq, void *dev_info, struct pt_regs *regs)
outb(SIRQ_dis|irqrmap[irq],ioaddr+SET_IRQ);
status = scb_status(dev);
#if NET_DEBUG > 4
@ -836,14 +836,14 @@ static irqreturn_t eexp_irq(int irq, void *dev_info, struct pt_regs *regs)
printk("%s: tx interrupt but no status\n", dev->name);
}
}
if (SCB_rxdframe(status))
if (SCB_rxdframe(status))
eexp_hw_rx_pio(dev);
status = scb_status(dev);
} while (status & 0xc000);
if (SCB_RUdead(status))
if (SCB_RUdead(status))
{
printk(KERN_WARNING "%s: RU stopped: status %04x\n",
dev->name,status);
@ -867,9 +867,9 @@ static irqreturn_t eexp_irq(int irq, void *dev_info, struct pt_regs *regs)
scb_wrrfa(dev, lp->rx_buf_start);
scb_command(dev, SCB_RUstart);
outb(0,ioaddr+SIGNAL_CA);
}
}
} else {
if (status & 0x8000)
if (status & 0x8000)
ack_cmd = eexp_start_irq(dev, status);
else
ack_cmd = SCB_ack(status);
@ -879,14 +879,14 @@ static irqreturn_t eexp_irq(int irq, void *dev_info, struct pt_regs *regs)
eexp_cmd_clear(dev);
outb(SIRQ_en|irqrmap[irq],ioaddr+SET_IRQ);
outb(SIRQ_en|irqrmap[irq],ioaddr+SET_IRQ);
#if NET_DEBUG > 6
#if NET_DEBUG > 6
printk("%s: leaving eexp_irq()\n", dev->name);
#endif
outw(old_read_ptr, ioaddr+READ_PTR);
outw(old_write_ptr, ioaddr+WRITE_PTR);
spin_unlock(&lp->lock);
return IRQ_HANDLED;
}
@ -934,7 +934,7 @@ static void eexp_hw_rx_pio(struct net_device *dev)
do {
unsigned short rfd_cmd, rx_next, pbuf, pkt_len;
outw(rx_block, ioaddr + READ_PTR);
status = inw(ioaddr + DATAPORT);
@ -943,7 +943,7 @@ static void eexp_hw_rx_pio(struct net_device *dev)
rfd_cmd = inw(ioaddr + DATAPORT);
rx_next = inw(ioaddr + DATAPORT);
pbuf = inw(ioaddr + DATAPORT);
outw(pbuf, ioaddr + READ_PTR);
pkt_len = inw(ioaddr + DATAPORT);
@ -955,17 +955,17 @@ static void eexp_hw_rx_pio(struct net_device *dev)
}
else if (pbuf!=rx_block+0x16)
{
printk(KERN_WARNING "%s: rfd and rbd out of sync 0x%04x 0x%04x\n",
printk(KERN_WARNING "%s: rfd and rbd out of sync 0x%04x 0x%04x\n",
dev->name, rx_block+0x16, pbuf);
continue;
}
else if ((pkt_len & 0xc000)!=0xc000)
else if ((pkt_len & 0xc000)!=0xc000)
{
printk(KERN_WARNING "%s: EOF or F not set on received buffer (%04x)\n",
dev->name, pkt_len & 0xc000);
continue;
}
else if (!FD_OK(status))
else if (!FD_OK(status))
{
lp->stats.rx_errors++;
if (FD_CRC(status))
@ -1025,9 +1025,9 @@ static void eexp_hw_tx_pio(struct net_device *dev, unsigned short *buf,
if (LOCKUP16 || lp->width) {
/* Stop the CU so that there is no chance that it
jumps off to a bogus address while we are writing the
pointer to the next transmit packet in 8-bit mode --
pointer to the next transmit packet in 8-bit mode --
this eliminates the "CU wedged" errors in 8-bit mode.
(Zoltan Szilagyi 10-12-96) */
(Zoltan Szilagyi 10-12-96) */
scb_command(dev, SCB_CUsuspend);
outw(0xFFFF, ioaddr+SIGNAL_CA);
}
@ -1061,7 +1061,7 @@ static void eexp_hw_tx_pio(struct net_device *dev, unsigned short *buf,
lp->tx_head += TX_BUF_SIZE;
if (lp->tx_head != lp->tx_reap)
netif_wake_queue(dev);
if (LOCKUP16 || lp->width) {
/* Restart the CU so that the packet can actually
be transmitted. (Zoltan Szilagyi 10-12-96) */
@ -1102,7 +1102,7 @@ static int __init eexp_hw_probe(struct net_device *dev, unsigned short ioaddr)
/* Standard Address or Compaq LTE Address */
if (!((hw_addr[2]==0x00aa && ((hw_addr[1] & 0xff00)==0x0000)) ||
(hw_addr[2]==0x0080 && ((hw_addr[1] & 0xff00)==0x5F00))))
(hw_addr[2]==0x0080 && ((hw_addr[1] & 0xff00)==0x5F00))))
{
printk(" rejected: invalid address %04x%04x%04x\n",
hw_addr[2],hw_addr[1],hw_addr[0]);
@ -1140,16 +1140,16 @@ static int __init eexp_hw_probe(struct net_device *dev, unsigned short ioaddr)
memset(lp, 0, sizeof(struct net_local));
spin_lock_init(&lp->lock);
printk("(IRQ %d, %s connector, %d-bit bus", dev->irq,
printk("(IRQ %d, %s connector, %d-bit bus", dev->irq,
eexp_ifmap[dev->if_port], buswidth?8:16);
if (!request_region(dev->base_addr + 0x300e, 1, "EtherExpress"))
return -EBUSY;
eexp_hw_set_interface(dev);
release_region(dev->base_addr + 0x300e, 1);
/* Find out how much RAM we have on the card */
outw(0, dev->base_addr + WRITE_PTR);
for (i = 0; i < 32768; i++)
@ -1284,7 +1284,7 @@ static unsigned short eexp_hw_lasttxstat(struct net_device *dev)
{
char *whatsup = NULL;
lp->stats.tx_errors++;
if (Stat_Abort(status))
if (Stat_Abort(status))
lp->stats.tx_aborted_errors++;
if (Stat_TNoCar(status)) {
whatsup = "aborted, no carrier";
@ -1460,11 +1460,11 @@ static void eexp_hw_rxinit(struct net_device *dev)
/* Close Rx frame descriptor ring */
outw(lp->rx_last + 4, ioaddr+WRITE_PTR);
outw(lp->rx_first, ioaddr+DATAPORT);
/* Close Rx buffer descriptor ring */
outw(lp->rx_last + 0x16 + 2, ioaddr+WRITE_PTR);
outw(lp->rx_first + 0x16, ioaddr+DATAPORT);
}
/*
@ -1512,7 +1512,7 @@ static void eexp_hw_init586(struct net_device *dev)
/* Do we want promiscuous mode or multicast? */
outw(CONF_PROMISC & ~31, ioaddr+SM_PTR);
i = inw(ioaddr+SHADOW(CONF_PROMISC));
outw((dev->flags & IFF_PROMISC)?(i|1):(i & ~1),
outw((dev->flags & IFF_PROMISC)?(i|1):(i & ~1),
ioaddr+SHADOW(CONF_PROMISC));
lp->was_promisc = dev->flags & IFF_PROMISC;
#if 0
@ -1522,7 +1522,7 @@ static void eexp_hw_init586(struct net_device *dev)
/* Write our hardware address */
outw(CONF_HWADDR & ~31, ioaddr+SM_PTR);
outw(((unsigned short *)dev->dev_addr)[0], ioaddr+SHADOW(CONF_HWADDR));
outw(((unsigned short *)dev->dev_addr)[1],
outw(((unsigned short *)dev->dev_addr)[1],
ioaddr+SHADOW(CONF_HWADDR+2));
outw(((unsigned short *)dev->dev_addr)[2],
ioaddr+SHADOW(CONF_HWADDR+4));
@ -1608,7 +1608,7 @@ static void eexp_setup_filter(struct net_device *dev)
dev->name, count);
count = 8;
}
outw(CONF_NR_MULTICAST & ~31, ioaddr+SM_PTR);
outw(count, ioaddr+SHADOW(CONF_NR_MULTICAST));
for (i = 0; i < count; i++) {

Просмотреть файл

@ -53,8 +53,8 @@
#define SCB_START 0x0008
/* Start of buffer region. Everything before this is used for control
* structures and the CU configuration program. The memory layout is
* determined in eexp_hw_probe(), once we know how much memory is
* structures and the CU configuration program. The memory layout is
* determined in eexp_hw_probe(), once we know how much memory is
* available on the card.
*/
@ -64,7 +64,7 @@
#define RX_BUF_SIZE ((32+ETH_FRAME_LEN+31)&~0x1f)
/*
* SCB defines
* SCB defines
*/
/* these functions take the SCB status word and test the relevant status bit */
@ -95,7 +95,7 @@
#define SCB_RUabort 0x0040
/*
* Command block defines
* Command block defines
*/
#define Stat_Done(s) ((s&0x8000)!=0)
@ -158,9 +158,9 @@ struct rfd_header {
volatile unsigned short srcaddr2;
volatile unsigned short srcaddr3;
volatile unsigned short length;
/* This is actually a Receive Buffer Descriptor. The way we
* arrange memory means that an RBD always follows the RFD that
/* This is actually a Receive Buffer Descriptor. The way we
* arrange memory means that an RBD always follows the RFD that
* points to it, so they might as well be in the same structure.
*/
volatile unsigned short actual_count;

Просмотреть файл

@ -544,7 +544,7 @@ static irqreturn_t ehea_send_irq_handler(int irq, void *param,
return IRQ_HANDLED;
}
static irqreturn_t ehea_recv_irq_handler(int irq, void *param,
static irqreturn_t ehea_recv_irq_handler(int irq, void *param,
struct pt_regs *regs)
{
struct ehea_port_res *pr = param;
@ -553,7 +553,7 @@ static irqreturn_t ehea_recv_irq_handler(int irq, void *param,
return IRQ_HANDLED;
}
static irqreturn_t ehea_qp_aff_irq_handler(int irq, void *param,
static irqreturn_t ehea_qp_aff_irq_handler(int irq, void *param,
struct pt_regs *regs)
{
struct ehea_port *port = param;
@ -850,7 +850,7 @@ static void ehea_neq_tasklet(unsigned long data)
adapter->neq->fw_handle, event_mask);
}
static irqreturn_t ehea_interrupt_neq(int irq, void *param,
static irqreturn_t ehea_interrupt_neq(int irq, void *param,
struct pt_regs *regs)
{
struct ehea_adapter *adapter = param;

Просмотреть файл

@ -8,7 +8,7 @@
*
* This software may be used and distributed according to the terms
* of the GNU General Public License, incorporated herein by reference.
*
*
* The author may be reached as simon@ncm.com, or C/O
* NCM
* Attn: Simon Janes
@ -23,7 +23,7 @@
* Inspirations:
* The Harried and Overworked Alan Cox
* Conspiracies:
* The Alan Cox and Mike McLagan plot to get someone else to do the code,
* The Alan Cox and Mike McLagan plot to get someone else to do the code,
* which turned out to be me.
*/
@ -138,7 +138,7 @@ static void eql_timer(unsigned long param)
{
equalizer_t *eql = (equalizer_t *) param;
struct list_head *this, *tmp, *head;
spin_lock_bh(&eql->queue.lock);
head = &eql->queue.all_slaves;
list_for_each_safe(this, tmp, head) {
@ -159,7 +159,7 @@ static void eql_timer(unsigned long param)
add_timer(&eql->timer);
}
static char version[] __initdata =
static char version[] __initdata =
"Equalizer2002: Simon Janes (simon@ncm.com) and David S. Miller (davem@redhat.com)\n";
static void __init eql_setup(struct net_device *dev)
@ -182,12 +182,12 @@ static void __init eql_setup(struct net_device *dev)
dev->do_ioctl = eql_ioctl;
dev->hard_start_xmit = eql_slave_xmit;
dev->get_stats = eql_get_stats;
/*
* Now we undo some of the things that eth_setup does
* that we don't like
* that we don't like
*/
dev->mtu = EQL_DEFAULT_MTU; /* set to 576 in if_eql.h */
dev->flags = IFF_MASTER;
@ -223,7 +223,7 @@ static void eql_kill_one_slave(slave_queue_t *queue, slave_t *slave)
}
static void eql_kill_slave_queue(slave_queue_t *queue)
{
{
struct list_head *head, *tmp, *this;
spin_lock_bh(&queue->lock);
@ -244,7 +244,7 @@ static int eql_close(struct net_device *dev)
/*
* The timer has to be stopped first before we start hacking away
* at the data structure it scans every so often...
* at the data structure it scans every so often...
*/
del_timer_sync(&eql->timer);
@ -264,7 +264,7 @@ static int eql_g_master_cfg(struct net_device *dev, master_config_t __user *mc);
static int eql_s_master_cfg(struct net_device *dev, master_config_t __user *mc);
static int eql_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
{
{
if (cmd != EQL_GETMASTRCFG && cmd != EQL_GETSLAVECFG &&
!capable(CAP_NET_ADMIN))
return -EPERM;
@ -300,15 +300,15 @@ static slave_t *__eql_schedule_slaves(slave_queue_t *queue)
head = &queue->all_slaves;
list_for_each_safe(this, tmp, head) {
slave_t *slave = list_entry(this, slave_t, list);
unsigned long slave_load, bytes_queued, priority_Bps;
unsigned long slave_load, bytes_queued, priority_Bps;
/* Go through the slave list once, updating best_slave
* whenever a new best_load is found.
*/
bytes_queued = slave->bytes_queued;
priority_Bps = slave->priority_Bps;
priority_Bps = slave->priority_Bps;
if ((slave->dev->flags & IFF_UP) == IFF_UP) {
slave_load = (~0UL - (~0UL / 2)) -
slave_load = (~0UL - (~0UL / 2)) -
(priority_Bps) + bytes_queued * 8;
if (slave_load < best_load) {
@ -336,13 +336,13 @@ static int eql_slave_xmit(struct sk_buff *skb, struct net_device *dev)
skb->dev = slave_dev;
skb->priority = 1;
slave->bytes_queued += skb->len;
slave->bytes_queued += skb->len;
dev_queue_xmit(skb);
eql->stats.tx_packets++;
} else {
eql->stats.tx_dropped++;
dev_kfree_skb(skb);
}
}
spin_unlock(&eql->queue.lock);
@ -596,7 +596,7 @@ static int __init eql_init_module(void)
return -ENOMEM;
err = register_netdev(dev_eql);
if (err)
if (err)
free_netdev(dev_eql);
return err;
}

Просмотреть файл

@ -1,7 +1,7 @@
/* eth16i.c An ICL EtherTeam 16i and 32 EISA ethernet driver for Linux
Written 1994-1999 by Mika Kuoppala
Copyright (C) 1994-1999 by Mika Kuoppala
Based on skeleton.c and heavily on at1700.c by Donald Becker
@ -12,7 +12,7 @@
This driver supports following cards :
- ICL EtherTeam 16i
- ICL EtherTeam 32 EISA
- ICL EtherTeam 32 EISA
(Uses true 32 bit transfers rather than 16i compability mode)
Example Module usage:
@ -25,26 +25,26 @@
I have benchmarked driver with PII/300Mhz as a ftp client
and 486/33Mhz as a ftp server. Top speed was 1128.37 kilobytes/sec.
Sources:
- skeleton.c a sample network driver core for linux,
written by Donald Becker <becker@scyld.com>
- at1700.c a driver for Allied Telesis AT1700, written
- at1700.c a driver for Allied Telesis AT1700, written
by Donald Becker.
- e16iSRV.asm a Netware 3.X Server Driver for ICL EtherTeam16i
written by Markku Viima
- The Fujitsu MB86965 databook.
Author thanks following persons due to their valueble assistance:
Author thanks following persons due to their valueble assistance:
Markku Viima (ICL)
Ari Valve (ICL)
Ari Valve (ICL)
Donald Becker
Kurt Huwig <kurt@huwig.de>
Revision history:
Version Date Description
0.01 15.12-94 Initial version (card detection)
0.02 23.01-95 Interrupt is now hooked correctly
0.03 01.02-95 Rewrote initialization part
@ -58,7 +58,7 @@
0.05 08.02-95 If there were more than one packet to send,
transmit was jammed due to invalid
register write...now fixed
0.06 19.02-95 Rewrote interrupt handling
0.06 19.02-95 Rewrote interrupt handling
0.07 13.04-95 Wrote EEPROM read routines
Card configuration now set according to
data read from EEPROM
@ -66,34 +66,34 @@
port if AUTO is selected
0.09 01.09-95 Added module support
0.10 04.09-95 Fixed receive packet allocation to work
with kernels > 1.3.x
0.20 20.09-95 Added support for EtherTeam32 EISA
0.21 17.10-95 Removed the unnecessary extern
0.20 20.09-95 Added support for EtherTeam32 EISA
0.21 17.10-95 Removed the unnecessary extern
init_etherdev() declaration. Some
other cleanups.
0.22 22.02-96 Receive buffer was not flushed
correctly when faulty packet was
received. Now fixed.
0.23 26.02-96 Made resetting the adapter
0.23 26.02-96 Made resetting the adapter
more reliable.
0.24 27.02-96 Rewrote faulty packet handling in eth16i_rx
0.25 22.05-96 kfree() was missing from cleanup_module.
0.26 11.06-96 Sometimes card was not found by
0.26 11.06-96 Sometimes card was not found by
check_signature(). Now made more reliable.
0.27 23.06-96 Oops. 16 consecutive collisions halted
adapter. Now will try to retransmit
0.27 23.06-96 Oops. 16 consecutive collisions halted
adapter. Now will try to retransmit
MAX_COL_16 times before finally giving up.
0.28 28.10-97 Added dev_id parameter (NULL) for free_irq
0.29 29.10-97 Multiple card support for module users
@ -103,16 +103,16 @@
0.30a 21.08-98 Card detection made more relaxed. Driver
had problems with some TCP/IP-PROM boots
to find the card. Suggested by
to find the card. Suggested by
Kurt Huwig <kurt@huwig.de>
0.31 28.08-98 Media interface port can now be selected
with module parameters or kernel
boot parameters.
boot parameters.
0.32 31.08-98 IRQ was never freed if open/close
0.32 31.08-98 IRQ was never freed if open/close
pair wasn't called. Now fixed.
0.33 10.09-98 When eth16i_open() was called after
eth16i_close() chip never recovered.
Now more shallow reset is made on
@ -122,15 +122,15 @@
Changed ioaddr -> io for consistency
0.35 01.07-99 transmit,-receive bytes were never
updated in stats.
updated in stats.
Bugs:
In some cases the media interface autoprobing code doesn't find
the correct interface type. In this case you can
manually choose the interface type in DOS with E16IC.EXE which is
In some cases the media interface autoprobing code doesn't find
the correct interface type. In this case you can
manually choose the interface type in DOS with E16IC.EXE which is
configuration software for EtherTeam16i and EtherTeam32 cards.
This is also true for IRQ setting. You cannot use module
parameter to configure IRQ of the card (yet).
parameter to configure IRQ of the card (yet).
To do:
- Real multicast support
@ -142,18 +142,18 @@
irq without configuration utility.
*/
static char *version =
static char *version =
"eth16i.c: v0.35 01-Jul-1999 Mika Kuoppala (miku@iki.fi)\n";
#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/interrupt.h>
#include <linux/ioport.h>
#include <linux/in.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/types.h>
#include <linux/fcntl.h>
#include <linux/interrupt.h>
#include <linux/ioport.h>
#include <linux/in.h>
#include <linux/slab.h>
#include <linux/string.h>
#include <linux/errno.h>
#include <linux/init.h>
#include <linux/spinlock.h>
@ -163,15 +163,15 @@ static char *version =
#include <linux/bitops.h>
#include <linux/jiffies.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/system.h>
#include <asm/io.h>
#include <asm/dma.h>
/* Few macros */
#define BIT(a) ( (1 << (a)) )
#define BITSET(ioaddr, bnum) ((outb(((inb(ioaddr)) | (bnum)), ioaddr)))
#define BIT(a) ( (1 << (a)) )
#define BITSET(ioaddr, bnum) ((outb(((inb(ioaddr)) | (bnum)), ioaddr)))
#define BITCLR(ioaddr, bnum) ((outb(((inb(ioaddr)) & (~(bnum))), ioaddr)))
/* This is the I/O address space for Etherteam 16i adapter. */
@ -186,7 +186,7 @@ static char *version =
/* Some interrupt masks */
#define ETH16I_INTR_ON 0xef8a /* Higher is receive mask */
#define ETH16I_INTR_OFF 0x0000
/* Buffers header status byte meanings */
#define PKT_GOOD BIT(5)
#define PKT_GOOD_RMT BIT(4)
@ -213,7 +213,7 @@ static char *version =
#define ALIGN_ERR BIT(2)
#define CRC_ERR BIT(1)
#define RX_BUF_OVERFLOW BIT(0)
/* Transmit Interrupt Enable Register (DLCR2) */
#define TX_INTR_REG 2
#define TX_INTR_DONE BIT(7)
@ -252,14 +252,14 @@ static char *version =
#define SRAM_CYCLE_TIME_100NS BIT(6)
#define SYSTEM_BUS_WIDTH_8 BIT(5) /* 1 = 8bit, 0 = 16bit */
#define BUFFER_WIDTH_8 BIT(4) /* 1 = 8bit, 0 = 16bit */
#define TBS1 BIT(3)
#define TBS1 BIT(3)
#define TBS0 BIT(2)
#define SRAM_BS1 BIT(1) /* 00=8kb, 01=16kb */
#define SRAM_BS0 BIT(0) /* 10=32kb, 11=64kb */
#ifndef ETH16I_TX_BUF_SIZE /* 0 = 2kb, 1 = 4kb */
#ifndef ETH16I_TX_BUF_SIZE /* 0 = 2kb, 1 = 4kb */
#define ETH16I_TX_BUF_SIZE 3 /* 2 = 8kb, 3 = 16kb */
#endif
#endif
#define TX_BUF_1x2048 0
#define TX_BUF_2x2048 1
#define TX_BUF_2x4098 2
@ -297,7 +297,7 @@ static char *version =
/* DMA Burst and Transceiver Mode Register (BMPR13) */
#define TRANSCEIVER_MODE_REG 13
#define TRANSCEIVER_MODE_RB 2
#define TRANSCEIVER_MODE_RB 2
#define IO_BASE_UNLOCK BIT(7)
#define LOWER_SQUELCH_TRESH BIT(6)
#define LINK_TEST_DISABLE BIT(5)
@ -337,7 +337,7 @@ static char *version =
#define E_PORT_AUTO 0x03
#define E_PORT_FROM_EPROM 0x04
#define E_PRODUCT_CFG 0x30
/* Macro to slow down io between EEPROM clock transitions */
#define eeprom_slow_io() do { int _i = 40; while(--_i > 0) { inb(0x80); }}while(0)
@ -352,12 +352,12 @@ static char *version =
/* This is the I/O address list to be probed when seeking the card */
static unsigned int eth16i_portlist[] __initdata = {
0x260, 0x280, 0x2A0, 0x240, 0x340, 0x320, 0x380, 0x300, 0
0x260, 0x280, 0x2A0, 0x240, 0x340, 0x320, 0x380, 0x300, 0
};
static unsigned int eth32i_portlist[] __initdata = {
static unsigned int eth32i_portlist[] __initdata = {
0x1000, 0x2000, 0x3000, 0x4000, 0x5000, 0x6000, 0x7000, 0x8000,
0x9000, 0xA000, 0xB000, 0xC000, 0xD000, 0xE000, 0xF000, 0
0x9000, 0xA000, 0xB000, 0xC000, 0xD000, 0xE000, 0xF000, 0
};
/* This is the Interrupt lookup table for Eth16i card */
@ -365,7 +365,7 @@ static unsigned int eth16i_irqmap[] __initdata = { 9, 10, 5, 15, 0 };
#define NUM_OF_ISA_IRQS 4
/* This is the Interrupt lookup table for Eth32i card */
static unsigned int eth32i_irqmap[] __initdata = { 3, 5, 7, 9, 10, 11, 12, 15, 0 };
static unsigned int eth32i_irqmap[] __initdata = { 3, 5, 7, 9, 10, 11, 12, 15, 0 };
#define EISA_IRQ_REG 0xc89
#define NUM_OF_EISA_IRQS 8
@ -384,7 +384,7 @@ struct eth16i_local {
unsigned char tx_started;
unsigned char tx_buf_busy;
unsigned short tx_queue; /* Number of packets in transmit buffer */
unsigned short tx_queue_len;
unsigned short tx_queue_len;
unsigned int tx_buf_size;
unsigned long open_time;
unsigned long tx_buffered_packets;
@ -414,7 +414,7 @@ static irqreturn_t eth16i_interrupt(int irq, void *dev_id, struct pt_regs *regs)
static void eth16i_reset(struct net_device *dev);
static void eth16i_timeout(struct net_device *dev);
static void eth16i_skip_packet(struct net_device *dev);
static void eth16i_multicast(struct net_device *dev);
static void eth16i_multicast(struct net_device *dev);
static void eth16i_select_regbank(unsigned char regbank, int ioaddr);
static void eth16i_initialize(struct net_device *dev, int boot);
@ -435,10 +435,10 @@ static int __init do_eth16i_probe(struct net_device *dev)
int i;
int ioaddr;
int base_addr = dev->base_addr;
SET_MODULE_OWNER(dev);
if(eth16i_debug > 4)
if(eth16i_debug > 4)
printk(KERN_DEBUG "Probing started for %s\n", cardname);
if(base_addr > 0x1ff) /* Check only single location */
@ -492,14 +492,14 @@ static int __init eth16i_probe1(struct net_device *dev, int ioaddr)
return -EBUSY;
/*
The MB86985 chip has on register which holds information in which
The MB86985 chip has on register which holds information in which
io address the chip lies. First read this register and compare
it to our current io address and if match then this could
be our chip.
*/
if(ioaddr < 0x1000) {
if(eth16i_portlist[(inb(ioaddr + JUMPERLESS_CONFIG) & 0x07)]
if(eth16i_portlist[(inb(ioaddr + JUMPERLESS_CONFIG) & 0x07)]
!= ioaddr) {
retval = -ENODEV;
goto out;
@ -513,9 +513,9 @@ static int __init eth16i_probe1(struct net_device *dev, int ioaddr)
goto out;
}
/*
/*
Now it seems that we have found a ethernet chip in this particular
ioaddr. The MB86985 chip has this feature, that when you read a
ioaddr. The MB86985 chip has this feature, that when you read a
certain register it will increase it's io base address to next
configurable slot. Now when we have found the chip, first thing is
to make sure that the chip's ioaddr will hold still here.
@ -536,7 +536,7 @@ static int __init eth16i_probe1(struct net_device *dev, int ioaddr)
/* Try to obtain interrupt vector */
if ((retval = request_irq(dev->irq, (void *)&eth16i_interrupt, 0, cardname, dev))) {
printk(KERN_WARNING "%s at %#3x, but is unusable due to conflicting IRQ %d.\n",
printk(KERN_WARNING "%s at %#3x, but is unusable due to conflicting IRQ %d.\n",
cardname, ioaddr, dev->irq);
goto out;
}
@ -547,7 +547,7 @@ static int __init eth16i_probe1(struct net_device *dev, int ioaddr)
/* Now we will have to lock the chip's io address */
eth16i_select_regbank(TRANSCEIVER_MODE_RB, ioaddr);
outb(0x38, ioaddr + TRANSCEIVER_MODE_REG);
outb(0x38, ioaddr + TRANSCEIVER_MODE_REG);
eth16i_initialize(dev, 1); /* Initialize rest of the chip's registers */
@ -590,7 +590,7 @@ static void eth16i_initialize(struct net_device *dev, int boot)
((unsigned short *)dev->dev_addr)[i] = ntohs(node_val);
}
for(i = 0; i < 6; i++) {
for(i = 0; i < 6; i++) {
outb( ((unsigned char *)dev->dev_addr)[i], ioaddr + NODE_ID_0 + i);
if(boot) {
printk("%02x", inb(ioaddr + NODE_ID_0 + i));
@ -601,11 +601,11 @@ static void eth16i_initialize(struct net_device *dev, int boot)
/* Now we will set multicast addresses to accept none */
eth16i_select_regbank(HASH_TABLE_RB, ioaddr);
for(i = 0; i < 8; i++)
for(i = 0; i < 8; i++)
outb(0x00, ioaddr + HASH_TABLE_0 + i);
/*
Now let's disable the transmitter and receiver, set the buffer ram
Now let's disable the transmitter and receiver, set the buffer ram
cycle time, bus width and buffer data path width. Also we shall
set transmit buffer size and total buffer size.
*/
@ -633,7 +633,7 @@ static void eth16i_initialize(struct net_device *dev, int boot)
#ifdef MODULE
/* if_port already set by init_module() */
#else
dev->if_port = (dev->mem_start < E_PORT_FROM_EPROM) ?
dev->if_port = (dev->mem_start < E_PORT_FROM_EPROM) ?
dev->mem_start : E_PORT_FROM_EPROM;
#endif
@ -651,7 +651,7 @@ static void eth16i_initialize(struct net_device *dev, int boot)
case E_PORT_AUTO:
dev->if_port = eth16i_probe_port(ioaddr);
break;
case E_PORT_BNC:
case E_PORT_TP:
case E_PORT_DIX:
@ -721,7 +721,7 @@ static int eth16i_probe_port(int ioaddr)
}
static void eth16i_set_port(int ioaddr, int porttype)
{
{
unsigned short temp = 0;
eth16i_select_regbank(TRANSCEIVER_MODE_RB, ioaddr);
@ -742,13 +742,13 @@ static void eth16i_set_port(int ioaddr, int porttype)
temp |= AUI_SELECT;
BITSET(ioaddr + TRANSMIT_MODE_REG, CONTROL_OUTPUT);
break;
}
}
outb(temp, ioaddr + TRANSCEIVER_MODE_REG);
if(eth16i_debug > 1) {
printk(KERN_DEBUG "TRANSMIT_MODE_REG = %x\n", inb(ioaddr + TRANSMIT_MODE_REG));
printk(KERN_DEBUG "TRANSCEIVER_MODE_REG = %x\n",
printk(KERN_DEBUG "TRANSCEIVER_MODE_REG = %x\n",
inb(ioaddr+TRANSCEIVER_MODE_REG));
}
}
@ -760,10 +760,10 @@ static int eth16i_send_probe_packet(int ioaddr, unsigned char *b, int l)
outb(0xff, ioaddr + TX_STATUS_REG);
outw(l, ioaddr + DATAPORT);
outsw(ioaddr + DATAPORT, (unsigned short *)b, (l + 1) >> 1);
outsw(ioaddr + DATAPORT, (unsigned short *)b, (l + 1) >> 1);
starttime = jiffies;
outb(TX_START | 1, ioaddr + TRANSMIT_START_REG);
outb(TX_START | 1, ioaddr + TRANSMIT_START_REG);
while( (inb(ioaddr + TX_STATUS_REG) & 0x80) == 0) {
if( time_after(jiffies, starttime + TX_TIMEOUT)) {
@ -815,10 +815,10 @@ static int eth16i_set_irq(struct net_device* dev)
const int irq = dev->irq;
int i = 0;
if(ioaddr < 0x1000) {
if(ioaddr < 0x1000) {
while(eth16i_irqmap[i] && eth16i_irqmap[i] != irq)
i++;
if(i < NUM_OF_ISA_IRQS) {
u8 cbyte = inb(ioaddr + JUMPERLESS_CONFIG);
cbyte = (cbyte & 0x3F) | (i << 6);
@ -829,7 +829,7 @@ static int eth16i_set_irq(struct net_device* dev)
else {
printk(KERN_NOTICE "%s: EISA Interrupt cannot be set. Use EISA Configuration utility.\n", dev->name);
}
return -1;
}
@ -863,7 +863,7 @@ static int __init eth16i_check_signature(int ioaddr)
creg[i] = inb(ioaddr + TRANSMIT_MODE_REG + i);
if(eth16i_debug > 1)
printk("eth16i: read signature byte %x at %x\n",
printk("eth16i: read signature byte %x at %x\n",
creg[i],
ioaddr + TRANSMIT_MODE_REG + i);
}
@ -872,7 +872,7 @@ static int __init eth16i_check_signature(int ioaddr)
creg[2] &= 0x7F; /* Mask DCLEN bit */
#if 0
/*
/*
This was removed because the card was sometimes left to state
from which it couldn't be find anymore. If there is need
to more strict check still this have to be fixed.
@ -886,14 +886,14 @@ static int __init eth16i_check_signature(int ioaddr)
if( !((creg[2] == 0x36) && (creg[3] == 0xE0)) ) {
creg[2] &= 0x40;
creg[3] &= 0x03;
if( !((creg[2] == 0x40) && (creg[3] == 0x00)) )
return -1;
}
if(eth16i_read_eeprom(ioaddr, E_NODEID_0) != 0)
return -1;
if((eth16i_read_eeprom(ioaddr, E_NODEID_1) & 0xFF00) != 0x4B00)
return -1;
@ -909,22 +909,22 @@ static int eth16i_read_eeprom(int ioaddr, int offset)
data = eth16i_read_eeprom_word(ioaddr);
outb(CS_0 | SK_0, ioaddr + EEPROM_CTRL_REG);
return(data);
return(data);
}
static int eth16i_read_eeprom_word(int ioaddr)
{
int i;
int data = 0;
for(i = 16; i > 0; i--) {
outb(CS_1 | SK_0, ioaddr + EEPROM_CTRL_REG);
eeprom_slow_io();
outb(CS_1 | SK_1, ioaddr + EEPROM_CTRL_REG);
eeprom_slow_io();
data = (data << 1) |
data = (data << 1) |
((inb(ioaddr + EEPROM_DATA_REG) & DI_1) ? 1 : 0);
eeprom_slow_io();
}
@ -948,25 +948,25 @@ static void eth16i_eeprom_cmd(int ioaddr, unsigned char command)
eeprom_slow_io();
outb(CS_1 | SK_1, ioaddr + EEPROM_CTRL_REG);
eeprom_slow_io();
}
}
}
static int eth16i_open(struct net_device *dev)
{
struct eth16i_local *lp = netdev_priv(dev);
int ioaddr = dev->base_addr;
/* Powerup the chip */
outb(0xc0 | POWERUP, ioaddr + CONFIG_REG_1);
/* Initialize the chip */
eth16i_initialize(dev, 0);
eth16i_initialize(dev, 0);
/* Set the transmit buffer size */
lp->tx_buf_size = eth16i_tx_buf_map[ETH16I_TX_BUF_SIZE & 0x03];
if(eth16i_debug > 0)
printk(KERN_DEBUG "%s: transmit buffer size %d\n",
printk(KERN_DEBUG "%s: transmit buffer size %d\n",
dev->name, lp->tx_buf_size);
/* Now enable Transmitter and Receiver sections */
@ -981,7 +981,7 @@ static int eth16i_open(struct net_device *dev)
lp->tx_queue_len = 0;
/* Turn on interrupts*/
outw(ETH16I_INTR_ON, ioaddr + TX_INTR_REG);
outw(ETH16I_INTR_ON, ioaddr + TX_INTR_REG);
netif_start_queue(dev);
return 0;
@ -995,10 +995,10 @@ static int eth16i_close(struct net_device *dev)
eth16i_reset(dev);
/* Turn off interrupts*/
outw(ETH16I_INTR_OFF, ioaddr + TX_INTR_REG);
outw(ETH16I_INTR_OFF, ioaddr + TX_INTR_REG);
netif_stop_queue(dev);
lp->open_time = 0;
/* Disable transmit and receive */
@ -1007,7 +1007,7 @@ static int eth16i_close(struct net_device *dev)
/* Reset the chip */
/* outb(0xff, ioaddr + RESET); */
/* outw(0xffff, ioaddr + TX_STATUS_REG); */
outb(0x00, ioaddr + CONFIG_REG_1);
return 0;
@ -1017,26 +1017,26 @@ static void eth16i_timeout(struct net_device *dev)
{
struct eth16i_local *lp = netdev_priv(dev);
int ioaddr = dev->base_addr;
/*
If we get here, some higher level has decided that
we are broken. There should really be a "kick me"
function call instead.
/*
If we get here, some higher level has decided that
we are broken. There should really be a "kick me"
function call instead.
*/
outw(ETH16I_INTR_OFF, ioaddr + TX_INTR_REG);
printk(KERN_WARNING "%s: transmit timed out with status %04x, %s ?\n",
printk(KERN_WARNING "%s: transmit timed out with status %04x, %s ?\n",
dev->name,
inw(ioaddr + TX_STATUS_REG), (inb(ioaddr + TX_STATUS_REG) & TX_DONE) ?
inw(ioaddr + TX_STATUS_REG), (inb(ioaddr + TX_STATUS_REG) & TX_DONE) ?
"IRQ conflict" : "network cable problem");
dev->trans_start = jiffies;
/* Let's dump all registers */
if(eth16i_debug > 0) {
if(eth16i_debug > 0) {
printk(KERN_DEBUG "%s: timeout: %02x %02x %02x %02x %02x %02x %02x %02x.\n",
dev->name, inb(ioaddr + 0),
inb(ioaddr + 1), inb(ioaddr + 2),
inb(ioaddr + 3), inb(ioaddr + 4),
dev->name, inb(ioaddr + 0),
inb(ioaddr + 1), inb(ioaddr + 2),
inb(ioaddr + 3), inb(ioaddr + 4),
inb(ioaddr + 5),
inb(ioaddr + 6), inb(ioaddr + 7));
@ -1071,31 +1071,31 @@ static int eth16i_tx(struct sk_buff *skb, struct net_device *dev)
buf = skb->data;
netif_stop_queue(dev);
/* Turn off TX interrupts */
outw(ETH16I_INTR_OFF, ioaddr + TX_INTR_REG);
/* We would be better doing the disable_irq tricks the 3c509 does,
that would make this suck a lot less */
spin_lock_irqsave(&lp->lock, flags);
if( (length + 2) > (lp->tx_buf_size - lp->tx_queue_len)) {
if(eth16i_debug > 0)
printk(KERN_WARNING "%s: Transmit buffer full.\n", dev->name);
}
if(eth16i_debug > 0)
printk(KERN_WARNING "%s: Transmit buffer full.\n", dev->name);
}
else {
outw(length, ioaddr + DATAPORT);
if( ioaddr < 0x1000 )
if( ioaddr < 0x1000 )
outsw(ioaddr + DATAPORT, buf, (length + 1) >> 1);
else {
unsigned char frag = length % 4;
outsl(ioaddr + DATAPORT, buf, length >> 2);
if( frag != 0 ) {
outsw(ioaddr + DATAPORT, (buf + (length & 0xFFFC)), 1);
if( frag == 3 )
outsw(ioaddr + DATAPORT,
if( frag == 3 )
outsw(ioaddr + DATAPORT,
(buf + (length & 0xFFFC) + 2), 1);
}
}
@ -1119,9 +1119,9 @@ static int eth16i_tx(struct sk_buff *skb, struct net_device *dev)
/* There is still more room for one more packet in tx buffer */
netif_wake_queue(dev);
}
spin_unlock_irqrestore(&lp->lock, flags);
outw(ETH16I_INTR_ON, ioaddr + TX_INTR_REG);
/* Turn TX interrupts back on */
/* outb(TX_INTR_DONE | TX_INTR_16_COL, ioaddr + TX_INTR_REG); */
@ -1139,36 +1139,36 @@ static void eth16i_rx(struct net_device *dev)
/* Loop until all packets have been read */
while( (inb(ioaddr + RECEIVE_MODE_REG) & RX_BUFFER_EMPTY) == 0) {
/* Read status byte from receive buffer */
/* Read status byte from receive buffer */
ushort status = inw(ioaddr + DATAPORT);
/* Get the size of the packet from receive buffer */
ushort pkt_len = inw(ioaddr + DATAPORT);
if(eth16i_debug > 4)
printk(KERN_DEBUG "%s: Receiving packet mode %02x status %04x.\n",
dev->name,
printk(KERN_DEBUG "%s: Receiving packet mode %02x status %04x.\n",
dev->name,
inb(ioaddr + RECEIVE_MODE_REG), status);
if( !(status & PKT_GOOD) ) {
lp->stats.rx_errors++;
if( (pkt_len < ETH_ZLEN) || (pkt_len > ETH_FRAME_LEN) ) {
lp->stats.rx_length_errors++;
eth16i_reset(dev);
return;
return;
}
else {
else {
eth16i_skip_packet(dev);
lp->stats.rx_dropped++;
}
}
}
else { /* Ok so now we should have a good packet */
struct sk_buff *skb;
skb = dev_alloc_skb(pkt_len + 3);
if( skb == NULL ) {
printk(KERN_WARNING "%s: Could'n allocate memory for packet (len %d)\n",
printk(KERN_WARNING "%s: Could'n allocate memory for packet (len %d)\n",
dev->name, pkt_len);
eth16i_skip_packet(dev);
lp->stats.rx_dropped++;
@ -1177,17 +1177,17 @@ static void eth16i_rx(struct net_device *dev)
skb->dev = dev;
skb_reserve(skb,2);
/*
/*
Now let's get the packet out of buffer.
size is (pkt_len + 1) >> 1, cause we are now reading words
and it have to be even aligned.
*/
if(ioaddr < 0x1000)
insw(ioaddr + DATAPORT, skb_put(skb, pkt_len),
*/
if(ioaddr < 0x1000)
insw(ioaddr + DATAPORT, skb_put(skb, pkt_len),
(pkt_len + 1) >> 1);
else {
else {
unsigned char *buf = skb_put(skb, pkt_len);
unsigned char frag = pkt_len % 4;
@ -1207,9 +1207,9 @@ static void eth16i_rx(struct net_device *dev)
if( eth16i_debug > 5 ) {
int i;
printk(KERN_DEBUG "%s: Received packet of length %d.\n",
printk(KERN_DEBUG "%s: Received packet of length %d.\n",
dev->name, pkt_len);
for(i = 0; i < 14; i++)
for(i = 0; i < 14; i++)
printk(KERN_DEBUG " %02x", skb->data[i]);
printk(KERN_DEBUG ".\n");
}
@ -1255,7 +1255,7 @@ static irqreturn_t eth16i_interrupt(int irq, void *dev_id, struct pt_regs *regs)
lp->stats.rx_errors++;
if(status & (BUS_RD_ERR << 8) )
if(status & (BUS_RD_ERR << 8) )
printk(KERN_WARNING "%s: Bus read error.\n",dev->name);
if(status & (SHORT_PKT_ERR << 8) ) lp->stats.rx_length_errors++;
if(status & (ALIGN_ERR << 8) ) lp->stats.rx_frame_errors++;
@ -1269,14 +1269,14 @@ static irqreturn_t eth16i_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if(status & CR_LOST) lp->stats.tx_carrier_errors++;
if(status & TX_JABBER_ERR) lp->stats.tx_window_errors++;
#if 0
#if 0
if(status & COLLISION) {
lp->stats.collisions +=
lp->stats.collisions +=
((inb(ioaddr+TRANSMIT_MODE_REG) & 0xF0) >> 4);
}
#endif
if(status & COLLISIONS_16) {
if(lp->col_16 < MAX_COL_16) {
if(lp->col_16 < MAX_COL_16) {
lp->col_16++;
lp->stats.collisions++;
/* Resume transmitting, skip failed packet */
@ -1293,7 +1293,7 @@ static irqreturn_t eth16i_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if(status & TX_DONE) { /* The transmit has been done */
lp->stats.tx_packets = lp->tx_buffered_packets;
lp->stats.tx_bytes += lp->tx_buffered_bytes;
lp->col_16 = 0;
lp->col_16 = 0;
if(lp->tx_queue) { /* Is there still packets ? */
/* There was packet(s) so start transmitting and write also
@ -1310,26 +1310,26 @@ static irqreturn_t eth16i_interrupt(int irq, void *dev_id, struct pt_regs *regs)
}
}
if( ( status & 0x8000 ) ||
if( ( status & 0x8000 ) ||
( (inb(ioaddr + RECEIVE_MODE_REG) & RX_BUFFER_EMPTY) == 0) ) {
eth16i_rx(dev); /* We have packet in receive buffer */
}
}
/* Turn interrupts back on */
outw(ETH16I_INTR_ON, ioaddr + TX_INTR_REG);
if(lp->tx_queue_len < lp->tx_buf_size - (ETH_FRAME_LEN + 2)) {
/* There is still more room for one more packet in tx buffer */
netif_wake_queue(dev);
}
spin_unlock(&lp->lock);
return IRQ_RETVAL(handled);
}
static void eth16i_skip_packet(struct net_device *dev)
{
{
int ioaddr = dev->base_addr;
inw(ioaddr + DATAPORT);
@ -1345,28 +1345,28 @@ static void eth16i_reset(struct net_device *dev)
struct eth16i_local *lp = netdev_priv(dev);
int ioaddr = dev->base_addr;
if(eth16i_debug > 1)
if(eth16i_debug > 1)
printk(KERN_DEBUG "%s: Resetting device.\n", dev->name);
BITSET(ioaddr + CONFIG_REG_0, DLC_EN);
outw(0xffff, ioaddr + TX_STATUS_REG);
outw(0xffff, ioaddr + TX_STATUS_REG);
eth16i_select_regbank(2, ioaddr);
lp->tx_started = 0;
lp->tx_buf_busy = 0;
lp->tx_queue = 0;
lp->tx_queue_len = 0;
lp->tx_queue_len = 0;
BITCLR(ioaddr + CONFIG_REG_0, DLC_EN);
}
static void eth16i_multicast(struct net_device *dev)
{
int ioaddr = dev->base_addr;
if(dev->mc_count || dev->flags&(IFF_ALLMULTI|IFF_PROMISC))
if(dev->mc_count || dev->flags&(IFF_ALLMULTI|IFF_PROMISC))
{
dev->flags|=IFF_PROMISC; /* Must do this */
outb(3, ioaddr + RECEIVE_MODE_REG);
outb(3, ioaddr + RECEIVE_MODE_REG);
} else {
outb(2, ioaddr + RECEIVE_MODE_REG);
}
@ -1383,7 +1383,7 @@ static void eth16i_select_regbank(unsigned char banknbr, int ioaddr)
unsigned char data;
data = inb(ioaddr + CONFIG_REG_1);
outb( ((data & 0xF3) | ( (banknbr & 0x03) << 2)), ioaddr + CONFIG_REG_1);
outb( ((data & 0xF3) | ( (banknbr & 0x03) << 2)), ioaddr + CONFIG_REG_1);
}
#ifdef MODULE
@ -1392,7 +1392,7 @@ static ushort eth16i_parse_mediatype(const char* s)
{
if(!s)
return E_PORT_FROM_EPROM;
if (!strncmp(s, "bnc", 3))
return E_PORT_BNC;
else if (!strncmp(s, "tp", 2))
@ -1474,14 +1474,14 @@ int __init init_module(void)
return 0;
return -ENXIO;
}
void cleanup_module(void)
{
int this_dev;
for(this_dev = 0; this_dev < MAX_ETH16I_CARDS; this_dev++) {
struct net_device *dev = dev_eth16i[this_dev];
if(dev->priv) {
unregister_netdev(dev);
free_irq(dev->irq, dev);

Просмотреть файл

@ -359,13 +359,13 @@ struct net_device * __init ewrk3_probe(int unit)
SET_MODULE_OWNER(dev);
err = ewrk3_probe1(dev, dev->base_addr, dev->irq);
if (err)
if (err)
goto out;
return dev;
out:
free_netdev(dev);
return ERR_PTR(err);
}
#endif
@ -378,7 +378,7 @@ static int __init ewrk3_probe1(struct net_device *dev, u_long iobase, int irq)
/* Address PROM pattern */
err = isa_probe(dev, iobase);
if (err != 0)
if (err != 0)
err = eisa_probe(dev, iobase);
if (err)
@ -391,7 +391,7 @@ static int __init ewrk3_probe1(struct net_device *dev, u_long iobase, int irq)
return err;
}
static int __init
static int __init
ewrk3_hw_init(struct net_device *dev, u_long iobase)
{
struct ewrk3_private *lp;
@ -435,19 +435,19 @@ ewrk3_hw_init(struct net_device *dev, u_long iobase)
printk("%s: Device has a bad on-board EEPROM.\n", dev->name);
return -ENXIO;
}
EthwrkSignature(name, eeprom_image);
if (*name == '\0')
if (*name == '\0')
return -ENXIO;
dev->base_addr = iobase;
if (iobase > 0x400) {
outb(eisa_cr, EISA_CR); /* Rewrite the EISA CR */
}
lemac = eeprom_image[EEPROM_CHIPVER];
cmr = inb(EWRK3_CMR);
if (((lemac == LeMAC) && ((cmr & CMR_NO_EEPROM) != CMR_NO_EEPROM)) ||
((lemac == LeMAC2) && !(cmr & CMR_HS))) {
printk("%s: %s at %#4lx", dev->name, name, iobase);
@ -468,7 +468,7 @@ ewrk3_hw_init(struct net_device *dev, u_long iobase)
printk("%2.2x:", dev->dev_addr[i]);
}
printk("%2.2x,\n", dev->dev_addr[i]);
if (status) {
printk(" which has an EEPROM CRC error.\n");
return -ENXIO;
@ -490,7 +490,7 @@ ewrk3_hw_init(struct net_device *dev, u_long iobase)
if (eeprom_image[EEPROM_SETUP] & SETUP_DRAM)
cmr |= CMR_DRAM;
outb(cmr, EWRK3_CMR);
cr = inb(EWRK3_CR); /* Set up the Control Register */
cr |= eeprom_image[EEPROM_SETUP] & SETUP_APD;
if (cr & SETUP_APD)
@ -524,7 +524,7 @@ ewrk3_hw_init(struct net_device *dev, u_long iobase)
** uncommenting this line.
*/
/* FORCE_2K_MODE; */
if (hard_strapped) {
printk(" is hard strapped.\n");
} else if (mem_start) {
@ -544,44 +544,44 @@ ewrk3_hw_init(struct net_device *dev, u_long iobase)
lp->hard_strapped = hard_strapped;
lp->led_mask = CR_LED;
spin_lock_init(&lp->hw_lock);
lp->mPage = 64;
if (cmr & CMR_DRAM)
lp->mPage <<= 1; /* 2 DRAMS on module */
sprintf(lp->adapter_name, "%s (%s)", name, dev->name);
lp->irq_mask = ICR_TNEM | ICR_TXDM | ICR_RNEM | ICR_RXDM;
if (!hard_strapped) {
/*
** Enable EWRK3 board interrupts for autoprobing
*/
icr |= ICR_IE; /* Enable interrupts */
outb(icr, EWRK3_ICR);
/* The DMA channel may be passed in on this parameter. */
dev->dma = 0;
/* To auto-IRQ we enable the initialization-done and DMA err,
interrupts. For now we will always get a DMA error. */
if (dev->irq < 2) {
#ifndef MODULE
u_char irqnum;
unsigned long irq_mask;
irq_mask = probe_irq_on();
/*
** Trigger a TNE interrupt.
*/
icr |= ICR_TNEM;
outb(1, EWRK3_TDQ); /* Write to the TX done queue */
outb(icr, EWRK3_ICR); /* Unmask the TXD interrupt */
irqnum = irq[((icr & IRQ_SEL) >> 4)];
mdelay(20);
dev->irq = probe_irq_off(irq_mask);
if ((dev->irq) && (irqnum == dev->irq)) {
@ -622,12 +622,12 @@ ewrk3_hw_init(struct net_device *dev, u_long iobase)
SET_ETHTOOL_OPS(dev, &ethtool_ops);
dev->tx_timeout = ewrk3_timeout;
dev->watchdog_timeo = QUEUE_PKT_TIMEOUT;
dev->mem_start = 0;
return 0;
}
static int ewrk3_open(struct net_device *dev)
{
@ -732,14 +732,14 @@ static void ewrk3_init(struct net_device *dev)
/*
* Transmit timeout
*/
static void ewrk3_timeout(struct net_device *dev)
{
struct ewrk3_private *lp = netdev_priv(dev);
u_char icr, csr;
u_long iobase = dev->base_addr;
if (!lp->hard_strapped)
if (!lp->hard_strapped)
{
printk(KERN_WARNING"%s: transmit timed/locked out, status %04x, resetting.\n",
dev->name, inb(EWRK3_CSR));
@ -1108,7 +1108,7 @@ static int ewrk3_close(struct net_device *dev)
u_char icr, csr;
netif_stop_queue(dev);
if (ewrk3_debug > 1) {
printk("%s: Shutting down ethercard, status was %2.2x.\n",
dev->name, inb(EWRK3_CSR));
@ -1697,7 +1697,7 @@ static int ewrk3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
u_char addr[HASH_TABLE_LEN * ETH_ALEN];
u_short val[(HASH_TABLE_LEN * ETH_ALEN) >> 1];
};
union ewrk3_addr *tmp;
/* All we handle are private IOCTLs */
@ -1717,7 +1717,7 @@ static int ewrk3_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
if (copy_to_user(ioc->data, tmp->addr, ioc->len))
status = -EFAULT;
break;
case EWRK3_SET_HWADDR: /* Set the hardware address */
if (capable(CAP_NET_ADMIN)) {
spin_lock_irqsave(&lp->hw_lock, flags);
@ -1990,7 +1990,7 @@ module_init(ewrk3_init_module);
#endif /* MODULE */
MODULE_LICENSE("GPL");
/*
* Local variables:

Просмотреть файл

@ -63,7 +63,7 @@
*/
#define CSR_RA 0x80 /* Runt Accept */
#define CSR_PME 0x40 /* Promiscuous Mode Enable */
#define CSR_MCE 0x20 /* Multicast Enable */
#define CSR_MCE 0x20 /* Multicast Enable */
#define CSR_TNE 0x08 /* TX Done Queue Not Empty */
#define CSR_RNE 0x04 /* RX Queue Not Empty */
#define CSR_TXD 0x02 /* TX Disable */
@ -127,7 +127,7 @@
#define CMR_DRAM 0x02 /* 0-> 1DRAM, 1-> 2 DRAM on board */
#define CMR_0WS 0x01 /* Zero Wait State */
/*
/*
** MAC Receive Status Register bit definitions
*/
@ -138,7 +138,7 @@
#define R_CRC 0x02 /* CRC error */
#define R_PLL 0x01 /* Phase Lock Lost */
/*
/*
** MAC Transmit Control Register bit definitions
*/
@ -150,7 +150,7 @@
#define TCR_IFC 0x02 /* Insert Frame Check */
#define TCR_ISA 0x01 /* Insert Source Address */
/*
/*
** MAC Transmit Status Register bit definitions
*/
@ -168,15 +168,15 @@
#define T_XUR 0x03 /* Excessive Underruns */
#define T_TXE 0x7f /* TX Errors */
/*
** EISA Configuration Register bit definitions
/*
** EISA Configuration Register bit definitions
*/
#define EISA_ID iobase + 0x0c80 /* EISA ID Registers */
#define EISA_ID0 iobase + 0x0c80 /* EISA ID Register 0 */
#define EISA_ID1 iobase + 0x0c81 /* EISA ID Register 1 */
#define EISA_ID2 iobase + 0x0c82 /* EISA ID Register 2 */
#define EISA_ID3 iobase + 0x0c83 /* EISA ID Register 3 */
#define EISA_ID iobase + 0x0c80 /* EISA ID Registers */
#define EISA_ID0 iobase + 0x0c80 /* EISA ID Register 0 */
#define EISA_ID1 iobase + 0x0c81 /* EISA ID Register 1 */
#define EISA_ID2 iobase + 0x0c82 /* EISA ID Register 2 */
#define EISA_ID3 iobase + 0x0c83 /* EISA ID Register 3 */
#define EISA_CR iobase + 0x0c84 /* EISA Control Register */
/*
@ -223,7 +223,7 @@
/*
** EEPROM MISCELLANEOUS FLAGS
*/
#define RBE_SHADOW 0x0100 /* Remote Boot Enable Shadow */
#define RBE_SHADOW 0x0100 /* Remote Boot Enable Shadow */
#define READ_AHEAD 0x0080 /* Read Ahead feature */
#define IRQ_SEL2 0x0070 /* IRQ line selection (LeMAC2) */
#define IRQ_SEL 0x0060 /* IRQ line selection */
@ -242,7 +242,7 @@
/*
** EEPROM SW FLAGS
*/
#define SW_SQE 0x10 /* Signal Quality Error */
#define SW_SQE 0x10 /* Signal Quality Error */
#define SW_LAB 0x08 /* Less Aggressive Backoff */
#define SW_INIT 0x04 /* Initialized */
#define SW_TIMEOUT 0x02 /* 0:2.5 mins, 1: 30 secs */
@ -299,8 +299,8 @@ struct ewrk3_ioctl {
unsigned char __user *data; /* Pointer to the data buffer */
};
/*
** Recognised commands for the driver
/*
** Recognised commands for the driver
*/
#define EWRK3_GET_HWADDR 0x01 /* Get the hardware address */
#define EWRK3_SET_HWADDR 0x02 /* Get the hardware address */

Просмотреть файл

@ -486,23 +486,23 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
#else
int bar = 1;
#endif
/* when built into the kernel, we only print version if device is found */
#ifndef MODULE
static int printed_version;
if (!printed_version++)
printk(version);
#endif
card_idx++;
sprintf(boardname, "fealnx%d", card_idx);
option = card_idx < MAX_UNITS ? options[card_idx] : 0;
i = pci_enable_device(pdev);
if (i) return i;
pci_set_master(pdev);
len = pci_resource_len(pdev, bar);
if (len < MIN_REGION_SIZE) {
dev_err(&pdev->dev,
@ -513,7 +513,7 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
i = pci_request_regions(pdev, boardname);
if (i)
return i;
irq = pdev->irq;
ioaddr = pci_iomap(pdev, bar, len);
@ -660,7 +660,7 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
dev->ethtool_ops = &netdev_ethtool_ops;
dev->tx_timeout = &tx_timeout;
dev->watchdog_timeo = TX_TIMEOUT;
err = register_netdev(dev);
if (err)
goto err_out_free_tx;
@ -865,25 +865,25 @@ static int netdev_open(struct net_device *dev)
Tx and Rx queues and the address filter list.
FIXME (Ueimor): optimistic for alpha + posted writes ? */
#if defined(__powerpc__) || defined(__sparc__)
// 89/9/1 modify,
// 89/9/1 modify,
// np->bcrvalue=0x04 | 0x0x38; /* big-endian, 256 burst length */
np->bcrvalue = 0x04 | 0x10; /* big-endian, tx 8 burst length */
np->crvalue = 0xe00; /* rx 128 burst length */
#elif defined(__alpha__) || defined(__x86_64__)
// 89/9/1 modify,
// 89/9/1 modify,
// np->bcrvalue=0x38; /* little-endian, 256 burst length */
np->bcrvalue = 0x10; /* little-endian, 8 burst length */
np->crvalue = 0xe00; /* rx 128 burst length */
#elif defined(__i386__)
#if defined(MODULE)
// 89/9/1 modify,
// 89/9/1 modify,
// np->bcrvalue=0x38; /* little-endian, 256 burst length */
np->bcrvalue = 0x10; /* little-endian, 8 burst length */
np->crvalue = 0xe00; /* rx 128 burst length */
#else
/* When not a module we can work around broken '486 PCI boards. */
#define x86 boot_cpu_data.x86
// 89/9/1 modify,
// 89/9/1 modify,
// np->bcrvalue=(x86 <= 4 ? 0x10 : 0x38);
np->bcrvalue = 0x10;
np->crvalue = (x86 <= 4 ? 0xa00 : 0xe00);
@ -1160,7 +1160,7 @@ static void reset_and_disable_rxtx(struct net_device *dev)
/* Reset the chip to erase previous misconfiguration. */
iowrite32(0x00000001, ioaddr + BCR);
/* Ueimor: wait for 50 PCI cycles (and flush posted writes btw).
/* Ueimor: wait for 50 PCI cycles (and flush posted writes btw).
We surely wait too long (address+data phase). Who cares? */
while (--delay) {
ioread32(ioaddr + BCR);
@ -1213,7 +1213,7 @@ static void reset_timer(unsigned long data)
reset_tx_descriptors(dev); */
enable_rxtx(dev);
netif_start_queue(dev); /* FIXME: or netif_wake_queue(dev); ? */
np->reset_timer_armed = 0;
spin_unlock_irqrestore(&np->lock, flags);
@ -1239,7 +1239,7 @@ static void tx_timeout(struct net_device *dev)
printk(" %4.4x", np->tx_ring[i].status);
printk("\n");
}
spin_lock_irqsave(&np->lock, flags);
reset_and_disable_rxtx(dev);
@ -1509,7 +1509,7 @@ static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs
stop_nic_rx(ioaddr, np->crvalue);
reset_rx_descriptors(dev);
iowrite32(np->crvalue, ioaddr + TCRRCR);
}
}
}
while (np->really_tx_count) {
@ -1571,7 +1571,7 @@ static irqreturn_t intr_handler(int irq, void *dev_instance, struct pt_regs *rgs
}
num_tx++;
} /* end of for loop */
if (num_tx && np->free_tx_count >= 2)
netif_wake_queue(dev);
@ -1728,7 +1728,7 @@ static int netdev_rx(struct net_device *dev)
/* Call copy + cksum if available. */
#if ! defined(__alpha__)
eth_copy_and_sum(skb,
eth_copy_and_sum(skb,
np->cur_rx->skbuff->data, pkt_len, 0);
skb_put(skb, pkt_len);
#else

Просмотреть файл

@ -256,7 +256,7 @@ static mii_list_t *mii_free;
static mii_list_t *mii_head;
static mii_list_t *mii_tail;
static int mii_queue(struct net_device *dev, int request,
static int mii_queue(struct net_device *dev, int request,
void (*func)(uint, struct net_device *));
/* Make MII read/write commands for the FEC.
@ -277,7 +277,7 @@ static int mii_queue(struct net_device *dev, int request,
#define MII_REG_SR 1 /* Status Register */
#define MII_REG_PHYIR1 2 /* PHY Identification Register 1 */
#define MII_REG_PHYIR2 3 /* PHY Identification Register 2 */
#define MII_REG_ANAR 4 /* A-N Advertisement Register */
#define MII_REG_ANAR 4 /* A-N Advertisement Register */
#define MII_REG_ANLPAR 5 /* A-N Link Partner Ability Register */
#define MII_REG_ANER 6 /* A-N Expansion Register */
#define MII_REG_ANNPTR 7 /* A-N Next Page Transmit Register */
@ -289,18 +289,18 @@ static int mii_queue(struct net_device *dev, int request,
#define PHY_CONF_LOOP 0x0002 /* 1 loopback mode enabled */
#define PHY_CONF_SPMASK 0x00f0 /* mask for speed */
#define PHY_CONF_10HDX 0x0010 /* 10 Mbit half duplex supported */
#define PHY_CONF_10FDX 0x0020 /* 10 Mbit full duplex supported */
#define PHY_CONF_10FDX 0x0020 /* 10 Mbit full duplex supported */
#define PHY_CONF_100HDX 0x0040 /* 100 Mbit half duplex supported */
#define PHY_CONF_100FDX 0x0080 /* 100 Mbit full duplex supported */
#define PHY_CONF_100FDX 0x0080 /* 100 Mbit full duplex supported */
#define PHY_STAT_LINK 0x0100 /* 1 up - 0 down */
#define PHY_STAT_FAULT 0x0200 /* 1 remote fault */
#define PHY_STAT_ANC 0x0400 /* 1 auto-negotiation complete */
#define PHY_STAT_SPMASK 0xf000 /* mask for speed */
#define PHY_STAT_10HDX 0x1000 /* 10 Mbit half duplex selected */
#define PHY_STAT_10FDX 0x2000 /* 10 Mbit full duplex selected */
#define PHY_STAT_10FDX 0x2000 /* 10 Mbit full duplex selected */
#define PHY_STAT_100HDX 0x4000 /* 100 Mbit half duplex selected */
#define PHY_STAT_100FDX 0x8000 /* 100 Mbit full duplex selected */
#define PHY_STAT_100FDX 0x8000 /* 100 Mbit full duplex selected */
static int
@ -360,7 +360,7 @@ fec_enet_start_xmit(struct sk_buff *skb, struct net_device *dev)
fep->stats.tx_bytes += skb->len;
fep->skb_cur = (fep->skb_cur+1) & TX_RING_MOD_MASK;
/* Push the data cache so the CPM does not get stale memory
* data.
*/
@ -422,7 +422,7 @@ fec_timeout(struct net_device *dev)
bdp = fep->tx_bd_base;
printk(" tx: %u buffers\n", TX_RING_SIZE);
for (i = 0 ; i < TX_RING_SIZE; i++) {
printk(" %08x: %04x %04x %08x\n",
printk(" %08x: %04x %04x %08x\n",
(uint) bdp,
bdp->cbd_sc,
bdp->cbd_datlen,
@ -484,7 +484,7 @@ fec_enet_interrupt(int irq, void * dev_id, struct pt_regs * regs)
handled = 1;
fec_enet_mii(dev);
}
}
return IRQ_RETVAL(handled);
}
@ -534,20 +534,20 @@ fec_enet_tx(struct net_device *dev)
*/
if (status & BD_ENET_TX_DEF)
fep->stats.collisions++;
/* Free the sk buffer associated with this last transmit.
*/
dev_kfree_skb_any(skb);
fep->tx_skbuff[fep->skb_dirty] = NULL;
fep->skb_dirty = (fep->skb_dirty + 1) & TX_RING_MOD_MASK;
/* Update pointer to next buffer descriptor to be transmitted.
*/
if (status & BD_ENET_TX_WRAP)
bdp = fep->tx_bd_base;
else
bdp++;
/* Since we have freed up a buffer, the ring is no longer
* full.
*/
@ -577,10 +577,10 @@ fec_enet_rx(struct net_device *dev)
struct sk_buff *skb;
ushort pkt_len;
__u8 *data;
#ifdef CONFIG_M532x
flush_cache_all();
#endif
#endif
fep = netdev_priv(dev);
fecp = (volatile fec_t*)dev->base_addr;
@ -606,7 +606,7 @@ while (!((status = bdp->cbd_sc) & BD_ENET_RX_EMPTY)) {
/* Check for errors. */
if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH | BD_ENET_RX_NO |
BD_ENET_RX_CR | BD_ENET_RX_OV)) {
fep->stats.rx_errors++;
fep->stats.rx_errors++;
if (status & (BD_ENET_RX_LG | BD_ENET_RX_SH)) {
/* Frame too long or too short. */
fep->stats.rx_length_errors++;
@ -670,7 +670,7 @@ while (!((status = bdp->cbd_sc) & BD_ENET_RX_EMPTY)) {
bdp = fep->rx_bd_base;
else
bdp++;
#if 1
/* Doing this here will keep the FEC running while we process
* incoming frames. On a heavily loaded network, we should be
@ -708,7 +708,7 @@ fec_enet_mii(struct net_device *dev)
mii_reg = ep->fec_mii_data;
spin_lock(&fep->lock);
if ((mip = mii_head) == NULL) {
printk("MII and no head!\n");
goto unlock;
@ -886,14 +886,14 @@ static phy_cmd_t const phy_cmd_lxt970_shutdown[] = { /* disable interrupts */
{ mk_mii_end, }
};
static phy_info_t const phy_info_lxt970 = {
.id = 0x07810000,
.id = 0x07810000,
.name = "LXT970",
.config = phy_cmd_lxt970_config,
.startup = phy_cmd_lxt970_startup,
.ack_int = phy_cmd_lxt970_ack_int,
.shutdown = phy_cmd_lxt970_shutdown
};
/* ------------------------------------------------------------------------- */
/* The Level one LXT971 is used on some of my custom boards */
@ -906,7 +906,7 @@ static phy_info_t const phy_info_lxt970 = {
#define MII_LXT971_LCR 20 /* LED Control Register */
#define MII_LXT971_TCR 30 /* Transmit Control Register */
/*
/*
* I had some nice ideas of running the MDIO faster...
* The 971 should support 8MHz and I tried it, but things acted really
* weird, so 2.5 MHz ought to be enough for anyone...
@ -944,9 +944,9 @@ static void mii_parse_lxt971_sr2(uint mii_reg, struct net_device *dev)
*s = status;
}
static phy_cmd_t const phy_cmd_lxt971_config[] = {
/* limit to 10MBit because my prototype board
/* limit to 10MBit because my prototype board
* doesn't work with 100. */
{ mk_mii_read(MII_REG_CR), mii_parse_cr },
{ mk_mii_read(MII_REG_ANAR), mii_parse_anar },
@ -960,7 +960,7 @@ static phy_cmd_t const phy_cmd_lxt971_startup[] = { /* enable interrupts */
/* Somehow does the 971 tell me that the link is down
* the first read after power-up.
* read here to get a valid value in ack_int */
{ mk_mii_read(MII_REG_SR), mii_parse_sr },
{ mk_mii_read(MII_REG_SR), mii_parse_sr },
{ mk_mii_end, }
};
static phy_cmd_t const phy_cmd_lxt971_ack_int[] = {
@ -976,7 +976,7 @@ static phy_cmd_t const phy_cmd_lxt971_shutdown[] = { /* disable interrupts */
{ mk_mii_end, }
};
static phy_info_t const phy_info_lxt971 = {
.id = 0x0001378e,
.id = 0x0001378e,
.name = "LXT971",
.config = phy_cmd_lxt971_config,
.startup = phy_cmd_lxt971_startup,
@ -1015,7 +1015,7 @@ static void mii_parse_qs6612_pcr(uint mii_reg, struct net_device *dev)
}
static phy_cmd_t const phy_cmd_qs6612_config[] = {
/* The PHY powers up isolated on the RPX,
/* The PHY powers up isolated on the RPX,
* so send a command to allow operation.
*/
{ mk_mii_write(MII_QS6612_PCR, 0x0dc0), NULL },
@ -1045,7 +1045,7 @@ static phy_cmd_t const phy_cmd_qs6612_shutdown[] = { /* disable interrupts */
{ mk_mii_end, }
};
static phy_info_t const phy_info_qs6612 = {
.id = 0x00181440,
.id = 0x00181440,
.name = "QS6612",
.config = phy_cmd_qs6612_config,
.startup = phy_cmd_qs6612_startup,
@ -1093,7 +1093,7 @@ static phy_cmd_t const phy_cmd_am79c874_config[] = {
static phy_cmd_t const phy_cmd_am79c874_startup[] = { /* enable interrupts */
{ mk_mii_write(MII_AM79C874_ICSR, 0xff00), NULL },
{ mk_mii_write(MII_REG_CR, 0x1200), NULL }, /* autonegotiate */
{ mk_mii_read(MII_REG_SR), mii_parse_sr },
{ mk_mii_read(MII_REG_SR), mii_parse_sr },
{ mk_mii_end, }
};
static phy_cmd_t const phy_cmd_am79c874_ack_int[] = {
@ -1135,7 +1135,7 @@ static phy_cmd_t const phy_cmd_ks8721bl_config[] = {
static phy_cmd_t const phy_cmd_ks8721bl_startup[] = { /* enable interrupts */
{ mk_mii_write(MII_KS8721BL_ICSR, 0xff00), NULL },
{ mk_mii_write(MII_REG_CR, 0x1200), NULL }, /* autonegotiate */
{ mk_mii_read(MII_REG_SR), mii_parse_sr },
{ mk_mii_read(MII_REG_SR), mii_parse_sr },
{ mk_mii_end, }
};
static phy_cmd_t const phy_cmd_ks8721bl_ack_int[] = {
@ -1150,7 +1150,7 @@ static phy_cmd_t const phy_cmd_ks8721bl_shutdown[] = { /* disable interrupts */
{ mk_mii_end, }
};
static phy_info_t const phy_info_ks8721bl = {
.id = 0x00022161,
.id = 0x00022161,
.name = "KS8721BL",
.config = phy_cmd_ks8721bl_config,
.startup = phy_cmd_ks8721bl_startup,
@ -1420,7 +1420,7 @@ static void __inline__ fec_request_intrs(struct net_device *dev)
{
volatile u16 *gpio_paspar;
volatile u8 *gpio_pehlpar;
gpio_paspar = (volatile u16 *) (MCF_IPSBAR + 0x100056);
gpio_pehlpar = (volatile u16 *) (MCF_IPSBAR + 0x100058);
*gpio_paspar |= 0x0f00;
@ -1667,7 +1667,7 @@ static void __inline__ fec_request_intrs(struct net_device *dev)
/* Setup interrupt handlers. */
for (idp = id; idp->name; idp++) {
if (request_irq(b+idp->irq,fec_enet_interrupt,0,idp->name,dev)!=0)
printk("FEC: Could not allocate %s IRQ(%d)!\n",
printk("FEC: Could not allocate %s IRQ(%d)!\n",
idp->name, b+idp->irq);
}
@ -1856,10 +1856,10 @@ static void __inline__ fec_set_mii(struct net_device *dev, struct fec_enet_priva
immap->im_ioport.iop_pddir = 0x1c58; /* Pre rev. D */
else
immap->im_ioport.iop_pddir = 0x1fff; /* Rev. D and later */
/* Set MII speed to 2.5 MHz
*/
fecp->fec_mii_speed = fep->phy_speed =
fecp->fec_mii_speed = fep->phy_speed =
((bd->bi_busfreq * 1000000) / 2500000) & 0x7e;
}
@ -1869,7 +1869,7 @@ static void __inline__ fec_enable_phy_intr(void)
fecp = fep->hwp;
/* Enable MII command finished interrupt
/* Enable MII command finished interrupt
*/
fecp->fec_ivec = (FEC_INTERRUPT/2) << 29;
}
@ -1971,7 +1971,7 @@ static void mii_display_config(struct net_device *dev)
if (status & PHY_CONF_LOOP)
printk(", loopback enabled");
printk(".\n");
fep->sequence_done = 1;
@ -1993,7 +1993,7 @@ static void mii_relink(struct net_device *dev)
if (fep->link) {
duplex = 0;
if (fep->phy_status
if (fep->phy_status
& (PHY_STAT_100FDX | PHY_STAT_10FDX))
duplex = 1;
fec_restart(dev, duplex);
@ -2070,7 +2070,7 @@ mii_discover_phy3(uint mii_reg, struct net_device *dev)
printk(" -- %s\n", phy_info[i]->name);
else
printk(" -- unknown PHY!\n");
fep->phy = phy_info[i];
fep->phy_id_done = 1;
}
@ -2090,7 +2090,7 @@ mii_discover_phy(uint mii_reg, struct net_device *dev)
if (fep->phy_addr < 32) {
if ((phytype = (mii_reg & 0xffff)) != 0xffff && phytype != 0) {
/* Got first part of ID, now get remainder.
*/
fep->phy_id = phytype << 16;
@ -2243,7 +2243,7 @@ static void set_multicast_list(struct net_device *dev)
*/
ep->fec_hash_table_high = 0;
ep->fec_hash_table_low = 0;
dmi = dev->mc_list;
for (j = 0; j < dev->mc_count; j++, dmi = dmi->next)
@ -2252,7 +2252,7 @@ static void set_multicast_list(struct net_device *dev)
*/
if (!(dmi->dmi_addr[0] & 1))
continue;
/* calculate crc32 value of mac address
*/
crc = 0xffffffff;
@ -2271,7 +2271,7 @@ static void set_multicast_list(struct net_device *dev)
which point to specific bit in he hash registers
*/
hash = (crc >> (32 - HASH_BITS)) & 0x3f;
if (hash > 31)
ep->fec_hash_table_high |= 1 << (hash - 32);
else

Просмотреть файл

@ -1063,7 +1063,7 @@ static void gfar_vlan_rx_register(struct net_device *dev,
tempval |= TCTRL_VLINS;
gfar_write(&priv->regs->tctrl, tempval);
/* Enable VLAN tag extraction */
tempval = gfar_read(&priv->regs->rctrl);
tempval |= RCTRL_VLEX;
@ -1718,7 +1718,7 @@ static void gfar_set_multi(struct net_device *dev)
tempval &= ~(RCTRL_PROM);
gfar_write(&regs->rctrl, tempval);
}
if(dev->flags & IFF_ALLMULTI) {
/* Set the hash to rx all multicast frames */
gfar_write(&regs->igaddr0, 0xffffffff);
@ -1954,7 +1954,7 @@ static int __init gfar_init(void)
if (err)
gfar_mdio_exit();
return err;
}

Просмотреть файл

@ -10,8 +10,8 @@
*
* Copyright (c) 2003,2004 Freescale Semiconductor, Inc.
*
* This software may be used and distributed according to
* the terms of the GNU Public License, Version 2, incorporated herein
* This software may be used and distributed according to
* the terms of the GNU Public License, Version 2, incorporated herein
* by reference.
*/
@ -202,7 +202,7 @@ static int gfar_gsettings(struct net_device *dev, struct ethtool_cmd *cmd)
if (NULL == phydev)
return -ENODEV;
cmd->maxtxpkt = priv->txcount;
cmd->maxrxpkt = priv->rxcount;
@ -281,7 +281,7 @@ static unsigned int gfar_ticks2usecs(struct gfar_private *priv, unsigned int tic
static int gfar_gcoalesce(struct net_device *dev, struct ethtool_coalesce *cvals)
{
struct gfar_private *priv = netdev_priv(dev);
if (!(priv->einfo->device_flags & FSL_GIANFAR_DEV_HAS_COALESCE))
return -EOPNOTSUPP;
@ -555,13 +555,13 @@ static uint32_t gfar_get_tx_csum(struct net_device *dev)
}
static uint32_t gfar_get_msglevel(struct net_device *dev)
{
{
struct gfar_private *priv = netdev_priv(dev);
return priv->msg_enable;
}
}
static void gfar_set_msglevel(struct net_device *dev, uint32_t data)
{
{
struct gfar_private *priv = netdev_priv(dev);
priv->msg_enable = data;
}

Просмотреть файл

@ -1,4 +1,4 @@
/*
/*
* drivers/net/gianfar_mii.c
*
* Gianfar Ethernet Driver -- MIIM bus implementation
@ -171,7 +171,7 @@ int gfar_mdio_probe(struct device *dev)
err = mdiobus_register(new_bus);
if (0 != err) {
printk (KERN_ERR "%s: Cannot register as MDIO bus\n",
printk (KERN_ERR "%s: Cannot register as MDIO bus\n",
new_bus->name);
goto bus_register_fail;
}

Просмотреть файл

@ -1,4 +1,4 @@
/*
/*
* drivers/net/gianfar_mii.h
*
* Gianfar Ethernet Driver -- MII Management Bus Implementation

Просмотреть файл

@ -87,7 +87,7 @@ static ssize_t gfar_set_bd_stash(struct class_device *cdev,
priv->bd_stash_en = new_setting;
temp = gfar_read(&priv->regs->attr);
if (new_setting)
temp |= ATTR_BDSTASH;
else

Просмотреть файл

@ -25,7 +25,7 @@
*
* Ethernet driver definitions for the MIPS GT96100 Advanced
* Communication Controller.
*
*
* Modified for the Marvellous GT64240 Retarded Communication Controller.
*/
#ifndef _GT64240ETH_H

Просмотреть файл

@ -17,9 +17,9 @@
* 59 Temple Place - Suite 330, Boston MA 02111-1307, USA.
*
* Ethernet driver for the MIPS GT96100 Advanced Communication Controller.
*
*
* Revision history
*
*
* 11.11.2001 Moved to 2.4.14, ppopov@mvista.com. Modified driver to add
* proper gt96100A support.
* 12.05.2001 Moved eth port 0 to irq 3 (mapped to GT_SERINT0 on EV96100A)
@ -160,9 +160,9 @@ chip_name(int chip_rev)
static void * dmaalloc(size_t size, dma_addr_t *dma_handle)
{
void *ret;
ret = (void *)__get_free_pages(GFP_ATOMIC | GFP_DMA, get_order(size));
if (ret != NULL) {
dma_cache_inv((unsigned long)ret, size);
if (dma_handle != NULL)
@ -194,7 +194,7 @@ parse_mac_addr(struct net_device *dev, char* macstr)
{
int i, j;
unsigned char result, value;
for (i=0; i<6; i++) {
result = 0;
if (i != 5 && *(macstr+2) != '.') {
@ -202,10 +202,10 @@ parse_mac_addr(struct net_device *dev, char* macstr)
i, *(macstr+2));
return -EINVAL;
}
for (j=0; j<2; j++) {
if (isxdigit(*macstr) &&
(value = isdigit(*macstr) ? *macstr-'0' :
(value = isdigit(*macstr) ? *macstr-'0' :
toupper(*macstr)-'A'+10) < 16) {
result = result*16 + value;
macstr++;
@ -241,7 +241,7 @@ read_MII(int phy_addr, u32 reg)
return -ENODEV;
}
}
GT96100_WRITE(GT96100_ETH_SMI_REG, smir);
timedout = 20;
@ -249,7 +249,7 @@ read_MII(int phy_addr, u32 reg)
while (!((smir = GT96100_READ(GT96100_ETH_SMI_REG)) & smirReadValid)) {
// snooze for 1 msec and check again
gt96100_delay(1);
if (--timedout == 0) {
printk(KERN_ERR "%s: timeout!!\n", __FUNCTION__);
return -ENODEV;
@ -301,7 +301,7 @@ write_MII(int phy_addr, u32 reg, u16 data)
while (GT96100_READ(GT96100_ETH_SMI_REG) & smirBusy) {
// snooze for 1 msec and check again
gt96100_delay(1);
if (--timedout == 0) {
printk(KERN_ERR "%s: busy timeout!!\n", __FUNCTION__);
return -1;
@ -317,7 +317,7 @@ dump_MII(int dbg_lvl, struct net_device *dev)
{
int i, val;
struct gt96100_private *gp = netdev_priv(dev);
if (dbg_lvl <= GT96100_DEBUG) {
for (i=0; i<7; i++) {
if ((val = read_MII(gp->phy_addr, i)) >= 0)
@ -336,7 +336,7 @@ dump_hw_addr(int dbg_lvl, struct net_device *dev, const char* pfx,
{
int i;
char buf[100], octet[5];
if (dbg_lvl <= GT96100_DEBUG) {
sprintf(buf, pfx, func);
for (i = 0; i < 6; i++) {
@ -354,13 +354,13 @@ dump_skb(int dbg_lvl, struct net_device *dev, struct sk_buff *skb)
{
int i;
unsigned char* skbdata;
if (dbg_lvl <= GT96100_DEBUG) {
dbg(dbg_lvl, "%s: skb=%p, skb->data=%p, skb->len=%d\n",
__FUNCTION__, skb, skb->data, skb->len);
skbdata = (unsigned char*)KSEG1ADDR(skb->data);
for (i=0; i<skb->len; i++) {
if (!(i % 16))
printk(KERN_DEBUG "\n %3.3x: %2.2x,",
@ -406,7 +406,7 @@ gt96100_add_hash_entry(struct net_device *dev, unsigned char* addr)
}
dump_hw_addr(3, dev, "%s: nib swap/invt addr=", __FUNCTION__, hash_ea);
if (gp->hash_mode == 0) {
hashResult = ((u16)hash_ea[0] & 0xfc) << 7;
stmp = ((u16)hash_ea[0] & 0x03) |
@ -423,7 +423,7 @@ gt96100_add_hash_entry(struct net_device *dev, unsigned char* addr)
tblEntryAddr =
(u32 *)(&gp->hash_table[((u32)hashResult & 0x7ff) << 3]);
dbg(3, "%s: tblEntryAddr=%p\n", tblEntryAddr, __FUNCTION__);
for (i=0; i<HASH_HOP_NUMBER; i++) {
@ -431,7 +431,7 @@ gt96100_add_hash_entry(struct net_device *dev, unsigned char* addr)
!(*tblEntryAddr & hteSkip)) {
// This entry is already occupied, go to next entry
tblEntryAddr += 2;
dbg(3, "%s: skipping to %p\n", __FUNCTION__,
dbg(3, "%s: skipping to %p\n", __FUNCTION__,
tblEntryAddr);
} else {
memset(tblEntryAddr, 0, 8);
@ -455,7 +455,7 @@ gt96100_add_hash_entry(struct net_device *dev, unsigned char* addr)
}
#endif
return 0;
}
@ -465,7 +465,7 @@ read_mib_counters(struct gt96100_private *gp)
{
u32* mib_regs = (u32*)&gp->mib;
int i;
for (i=0; i<sizeof(mib_counters_t)/sizeof(u32); i++)
mib_regs[i] = GT96100ETH_READ(gp, GT96100_ETH_MIB_COUNT_BASE +
i*sizeof(u32));
@ -477,9 +477,9 @@ update_stats(struct gt96100_private *gp)
{
mib_counters_t *mib = &gp->mib;
struct net_device_stats *stats = &gp->stats;
read_mib_counters(gp);
stats->rx_packets = mib->totalFramesReceived;
stats->tx_packets = mib->framesSent;
stats->rx_bytes = mib->totalByteReceived;
@ -512,7 +512,7 @@ abort(struct net_device *dev, u32 abort_bits)
// make sure only the Rx/Tx abort bits are set
abort_bits &= (sdcmrAR | sdcmrAT);
spin_lock(&gp->lock);
// abort any Rx/Tx DMA immediately
@ -525,7 +525,7 @@ abort(struct net_device *dev, u32 abort_bits)
while (GT96100ETH_READ(gp, GT96100_ETH_SDMA_COMM) & abort_bits) {
// snooze for 1 msec and check again
gt96100_delay(1);
if (--timedout == 0) {
err("%s: timeout!!\n", __FUNCTION__);
break;
@ -563,7 +563,7 @@ enable_ether_irq(struct net_device *dev)
*/
int intr_mask_reg = (gp->port_num == 0) ?
GT96100_SERINT0_MASK : GT96100_INT0_HIGH_MASK;
if (gp->chip_rev >= REV_GT96100A_1) {
intMask = icrTxBufferLow | icrTxEndLow |
icrTxErrorLow | icrRxOVR | icrTxUdr |
@ -576,10 +576,10 @@ enable_ether_irq(struct net_device *dev)
icrRxBuffer | icrRxError |
icrMIIPhySTC | icrEtherIntSum;
}
// unmask interrupts
GT96100ETH_WRITE(gp, GT96100_ETH_INT_MASK, intMask);
intMask = GT96100_READ(intr_mask_reg);
intMask |= 1<<gp->port_num;
GT96100_WRITE(intr_mask_reg, intMask);
@ -596,7 +596,7 @@ disable_ether_irq(struct net_device *dev)
intMask = GT96100_READ(intr_mask_reg);
intMask &= ~(1<<gp->port_num);
GT96100_WRITE(intr_mask_reg, intMask);
GT96100ETH_WRITE(gp, GT96100_ETH_INT_MASK, 0);
}
@ -643,13 +643,13 @@ static int __init gt96100_probe1(struct pci_dev *pci, int port_num)
int retval;
unsigned char chip_rev;
struct net_device *dev = NULL;
if (gtif->irq < 0) {
printk(KERN_ERR "%s: irq unknown - probing not supported\n",
__FUNCTION__);
return -ENODEV;
}
pci_read_config_byte(pci, PCI_REVISION_ID, &chip_rev);
if (chip_rev >= REV_GT96100A_1) {
@ -665,14 +665,14 @@ static int __init gt96100_probe1(struct pci_dev *pci, int port_num)
phyAD |= phy_addr << (port_num*5);
GT96100_WRITE(GT96100_ETH_PHY_ADDR_REG, phyAD);
}
// probe for the external PHY
if ((phy_id1 = read_MII(phy_addr, 2)) <= 0 ||
(phy_id2 = read_MII(phy_addr, 3)) <= 0) {
printk(KERN_ERR "%s: no PHY found on MII%d\n", __FUNCTION__, port_num);
return -ENODEV;
}
if (!request_region(gtif->iobase, GT96100_ETH_IO_SIZE, "GT96100ETH")) {
printk(KERN_ERR "%s: request_region failed\n", __FUNCTION__);
return -EBUSY;
@ -682,7 +682,7 @@ static int __init gt96100_probe1(struct pci_dev *pci, int port_num)
if (!dev)
goto out;
gtif->dev = dev;
/* private struct aligned and zeroed by alloc_etherdev */
/* Fill in the 'dev' fields. */
dev->base_addr = gtif->iobase;
@ -720,12 +720,12 @@ static int __init gt96100_probe1(struct pci_dev *pci, int port_num)
retval = -ENOMEM;
goto out1;
}
gp->tx_ring = (gt96100_td_t *)(gp->rx_ring + RX_RING_SIZE);
gp->tx_ring_dma =
gp->rx_ring_dma + sizeof(gt96100_rd_t) * RX_RING_SIZE;
}
// Allocate the Rx Data Buffers
if (gp->rx_buff == NULL) {
gp->rx_buff = dmaalloc(PKT_BUF_SZ*RX_RING_SIZE,
@ -735,7 +735,7 @@ static int __init gt96100_probe1(struct pci_dev *pci, int port_num)
goto out2;
}
}
dbg(3, "%s: rx_ring=%p, tx_ring=%p\n", __FUNCTION__,
gp->rx_ring, gp->tx_ring);
@ -748,11 +748,11 @@ static int __init gt96100_probe1(struct pci_dev *pci, int port_num)
goto out3;
}
}
dbg(3, "%s: hash=%p\n", __FUNCTION__, gp->hash_table);
spin_lock_init(&gp->lock);
dev->open = gt96100_open;
dev->hard_start_xmit = gt96100_tx;
dev->stop = gt96100_close;
@ -812,7 +812,7 @@ reset_tx(struct net_device *dev)
}
/* Wrap the ring. */
gp->tx_ring[i-1].next = cpu_to_dma32(gp->tx_ring_dma);
// setup only the lowest priority TxCDP reg
GT96100ETH_WRITE(gp, GT96100_ETH_CURR_TX_DESC_PTR0, gp->tx_ring_dma);
GT96100ETH_WRITE(gp, GT96100_ETH_CURR_TX_DESC_PTR1, 0);
@ -830,7 +830,7 @@ reset_rx(struct net_device *dev)
int i;
abort(dev, sdcmrAR);
for (i=0; i<RX_RING_SIZE; i++) {
gp->rx_ring[i].next =
cpu_to_dma32(gp->rx_ring_dma +
@ -876,7 +876,7 @@ gt96100_check_tx_consistent(struct gt96100_private *gp)
diff = diff<0 ? TX_RING_SIZE + diff : diff;
diff = gp->tx_count == TX_RING_SIZE ? diff + TX_RING_SIZE : diff;
return (diff != gp->tx_count);
}
@ -886,16 +886,16 @@ gt96100_init(struct net_device *dev)
struct gt96100_private *gp = netdev_priv(dev);
u32 tmp;
u16 mii_reg;
dbg(3, "%s: dev=%p\n", __FUNCTION__, dev);
dbg(3, "%s: scs10_lo=%4x, scs10_hi=%4x\n", __FUNCTION__,
dbg(3, "%s: scs10_lo=%4x, scs10_hi=%4x\n", __FUNCTION__,
GT96100_READ(0x8), GT96100_READ(0x10));
dbg(3, "%s: scs32_lo=%4x, scs32_hi=%4x\n", __FUNCTION__,
GT96100_READ(0x18), GT96100_READ(0x20));
// Stop and disable Port
hard_stop(dev);
// Setup CIU Arbiter
tmp = GT96100_READ(GT96100_CIU_ARBITER_CONFIG);
tmp |= (0x0c << (gp->port_num*2)); // set Ether DMA req priority to hi
@ -905,7 +905,7 @@ gt96100_init(struct net_device *dev)
tmp |= (1<<31);
#endif
GT96100_WRITE(GT96100_CIU_ARBITER_CONFIG, tmp);
dbg(3, "%s: CIU Config=%x/%x\n", __FUNCTION__,
dbg(3, "%s: CIU Config=%x/%x\n", __FUNCTION__,
tmp, GT96100_READ(GT96100_CIU_ARBITER_CONFIG));
// Set routing.
@ -917,7 +917,7 @@ gt96100_init(struct net_device *dev)
tmp = GT96100_READ(GT96100_GPP_CONFIG2);
tmp |= 0x7fff << (gp->port_num*16);
GT96100_WRITE(GT96100_GPP_CONFIG2, tmp);
/* Set up MII port pin directions */
tmp = GT96100_READ(GT96100_GPP_IO2);
tmp |= 0x003d << (gp->port_num*16);
@ -953,7 +953,7 @@ gt96100_init(struct net_device *dev)
mii_reg = read_MII(gp->phy_addr, 0x11); /* int enable register */
mii_reg |= 2; /* enable mii interrupt */
write_MII(gp->phy_addr, 0x11, mii_reg);
dbg(3, "%s: PhyAD=%x\n", __FUNCTION__,
GT96100_READ(GT96100_ETH_PHY_ADDR_REG));
@ -976,12 +976,12 @@ gt96100_init(struct net_device *dev)
GT96100ETH_WRITE(gp, GT96100_ETH_SDMA_COMM, sdcmrERD);
dbg(3, "%s: SDMA Comm=%x\n", __FUNCTION__,
GT96100ETH_READ(gp, GT96100_ETH_SDMA_COMM));
// enable this port (set hash size to 1/2K)
GT96100ETH_WRITE(gp, GT96100_ETH_PORT_CONFIG, pcrEN | pcrHS);
dbg(3, "%s: Port Config=%x\n", __FUNCTION__,
GT96100ETH_READ(gp, GT96100_ETH_PORT_CONFIG));
/*
* Disable all Type-of-Service queueing. All Rx packets will be
* treated normally and will be sent to the lowest priority
@ -998,7 +998,7 @@ gt96100_init(struct net_device *dev)
GT96100ETH_WRITE(gp, GT96100_ETH_PORT_CONFIG_EXT,
pcxrFCTL | pcxrFCTLen | pcxrFLP |
pcxrPRIOrxOverride | pcxrMIBclrMode);
dbg(3, "%s: Port Config Ext=%x\n", __FUNCTION__,
GT96100ETH_READ(gp, GT96100_ETH_PORT_CONFIG_EXT));
@ -1018,7 +1018,7 @@ static int
gt96100_open(struct net_device *dev)
{
int retval;
dbg(2, "%s: dev=%p\n", __FUNCTION__, dev);
// Initialize and startup the GT-96100 ethernet port
@ -1033,7 +1033,7 @@ gt96100_open(struct net_device *dev)
err("unable to get IRQ %d\n", dev->irq);
return retval;
}
dbg(2, "%s: Initialization done.\n", __FUNCTION__);
return 0;
@ -1051,7 +1051,7 @@ gt96100_close(struct net_device *dev)
}
free_irq(dev->irq, dev);
return 0;
}
@ -1068,21 +1068,21 @@ gt96100_tx(struct sk_buff *skb, struct net_device *dev)
nextIn = gp->tx_next_in;
dbg(3, "%s: nextIn=%d\n", __FUNCTION__, nextIn);
if (gp->tx_count >= TX_RING_SIZE) {
warn("Tx Ring full, pkt dropped.\n");
gp->stats.tx_dropped++;
spin_unlock_irqrestore(&gp->lock, flags);
return 1;
}
if (!(gp->last_psr & psrLink)) {
err("%s: Link down, pkt dropped.\n", __FUNCTION__);
gp->stats.tx_dropped++;
spin_unlock_irqrestore(&gp->lock, flags);
return 1;
}
if (dma32_to_cpu(gp->tx_ring[nextIn].cmdstat) & txOwn) {
err("%s: device owns descriptor, pkt dropped.\n", __FUNCTION__);
gp->stats.tx_dropped++;
@ -1091,7 +1091,7 @@ gt96100_tx(struct sk_buff *skb, struct net_device *dev)
spin_unlock_irqrestore(&gp->lock, flags);
return 1;
}
// Prepare the Descriptor at tx_next_in
gp->tx_skbuff[nextIn] = skb;
gp->tx_ring[nextIn].byte_cnt = cpu_to_dma16(skb->len);
@ -1103,7 +1103,7 @@ gt96100_tx(struct sk_buff *skb, struct net_device *dev)
gp->tx_ring[nextIn].cmdstat =
cpu_to_dma32((u32)(txOwn | txGenCRC | txEI |
txPad | txFirst | txLast));
dump_tx_desc(4, dev, nextIn);
dump_skb(4, dev, skb);
@ -1120,7 +1120,7 @@ gt96100_tx(struct sk_buff *skb, struct net_device *dev)
netif_stop_queue(dev);
dbg(2, "Tx Ring now full, queue stopped.\n");
}
dev->trans_start = jiffies;
spin_unlock_irqrestore(&gp->lock, flags);
@ -1136,7 +1136,7 @@ gt96100_rx(struct net_device *dev, u32 status)
int pkt_len, nextOut, cdp;
gt96100_rd_t *rd;
u32 cmdstat;
dbg(3, "%s: dev=%p, status=%x\n", __FUNCTION__, dev, status);
cdp = (GT96100ETH_READ(gp, GT96100_ETH_1ST_RX_DESC_PTR0)
@ -1145,13 +1145,13 @@ gt96100_rx(struct net_device *dev, u32 status)
// Continue until we reach 1st descriptor pointer
for (nextOut = gp->rx_next_out; nextOut != cdp;
nextOut = (nextOut + 1) % RX_RING_SIZE) {
if (--gp->intr_work_done == 0)
break;
rd = &gp->rx_ring[nextOut];
cmdstat = dma32_to_cpu(rd->cmdstat);
dbg(4, "%s: Rx desc cmdstat=%x, nextOut=%d\n", __FUNCTION__,
cmdstat, nextOut);
@ -1202,9 +1202,9 @@ gt96100_rx(struct net_device *dev, u32 status)
// continue to drop every descriptor of this packet
continue;
}
pkt_len = dma16_to_cpu(rd->byte_cnt);
/* Create new skb. */
skb = dev_alloc_skb(pkt_len+2);
if (skb == NULL) {
@ -1220,7 +1220,7 @@ gt96100_rx(struct net_device *dev, u32 status)
&gp->rx_buff[nextOut*PKT_BUF_SZ], pkt_len);
skb->protocol = eth_type_trans(skb, dev);
dump_skb(4, dev, skb);
netif_rx(skb); /* pass the packet to upper layers */
dev->last_rx = jiffies;
@ -1228,7 +1228,7 @@ gt96100_rx(struct net_device *dev, u32 status)
cmdstat |= (u32)rxOwn;
rd->cmdstat = cpu_to_dma32(cmdstat);
}
if (nextOut == gp->rx_next_out)
dbg(3, "%s: RxCDP did not increment?\n", __FUNCTION__);
@ -1247,20 +1247,20 @@ gt96100_tx_complete(struct net_device *dev, u32 status)
cdp = (GT96100ETH_READ(gp, GT96100_ETH_CURR_TX_DESC_PTR0)
- gp->tx_ring_dma) / sizeof(gt96100_td_t);
// Continue until we reach the current descriptor pointer
for (nextOut = gp->tx_next_out; nextOut != cdp;
nextOut = (nextOut + 1) % TX_RING_SIZE) {
if (--gp->intr_work_done == 0)
break;
td = &gp->tx_ring[nextOut];
cmdstat = dma32_to_cpu(td->cmdstat);
dbg(3, "%s: Tx desc cmdstat=%x, nextOut=%d\n", __FUNCTION__,
cmdstat, nextOut);
if (cmdstat & (u32)txOwn) {
/*
* DMA is not finished writing descriptor???
@ -1269,7 +1269,7 @@ gt96100_tx_complete(struct net_device *dev, u32 status)
*/
break;
}
// increment Tx error stats
if (cmdstat & (u32)txErrorSummary) {
dbg(2, "%s: Tx error, cmdstat = %x\n", __FUNCTION__,
@ -1282,7 +1282,7 @@ gt96100_tx_complete(struct net_device *dev, u32 status)
if (cmdstat & (u32)txLateCollision)
gp->stats.tx_window_errors++;
}
if (cmdstat & (u32)txCollision)
gp->stats.collisions +=
(u32)((cmdstat & txReTxCntMask) >>
@ -1297,10 +1297,10 @@ gt96100_tx_complete(struct net_device *dev, u32 status)
__FUNCTION__);
}
}
// decrement tx ring buffer count
if (gp->tx_count) gp->tx_count--;
// free the skb
if (gp->tx_skbuff[nextOut]) {
dbg(3, "%s: good Tx, skb=%p\n", __FUNCTION__,
@ -1317,7 +1317,7 @@ gt96100_tx_complete(struct net_device *dev, u32 status)
if (gt96100_check_tx_consistent(gp)) {
err("%s: Tx queue inconsistent!\n", __FUNCTION__);
}
if ((status & icrTxEndLow) && gp->tx_count != 0) {
// we must restart the DMA
dbg(3, "%s: Restarting Tx DMA\n", __FUNCTION__);
@ -1374,7 +1374,7 @@ gt96100_interrupt(int irq, void *dev_id, struct pt_regs *regs)
psr & psrTxLow ? "running":"stopped",
psr & psrTxHigh ? "running":"stopped",
psr & psrTxInProg ? "on":"off");
if ((psr & psrLink) && !gp->tx_full &&
netif_queue_stopped(dev)) {
dbg(0, "%s: Link up, waking queue.\n",
@ -1393,21 +1393,21 @@ gt96100_interrupt(int irq, void *dev_id, struct pt_regs *regs)
if (--gp->intr_work_done == 0)
break;
}
if (status & (icrTxBufferLow | icrTxEndLow))
gt96100_tx_complete(dev, status);
if (status & (icrRxBuffer | icrRxError)) {
gt96100_rx(dev, status);
}
// Now check TX errors (RX errors were handled in gt96100_rx)
if (status & icrTxErrorLow) {
err("%s: Tx resource error\n", __FUNCTION__);
if (--gp->intr_work_done == 0)
break;
}
if (status & icrTxUdr) {
err("%s: Tx underrun error\n", __FUNCTION__);
if (--gp->intr_work_done == 0)
@ -1420,7 +1420,7 @@ gt96100_interrupt(int irq, void *dev_id, struct pt_regs *regs)
GT96100ETH_WRITE(gp, GT96100_ETH_INT_CAUSE, 0);
dbg(3, "%s: hit max work\n", __FUNCTION__);
}
dbg(3, "%s: exit, icr=%x\n", __FUNCTION__,
GT96100ETH_READ(gp, GT96100_ETH_INT_CAUSE));
@ -1434,9 +1434,9 @@ gt96100_tx_timeout(struct net_device *dev)
{
struct gt96100_private *gp = netdev_priv(dev);
unsigned long flags;
spin_lock_irqsave(&gp->lock, flags);
if (!(gp->last_psr & psrLink)) {
err("tx_timeout: link down.\n");
spin_unlock_irqrestore(&gp->lock, flags);
@ -1448,7 +1448,7 @@ gt96100_tx_timeout(struct net_device *dev)
spin_unlock_irqrestore(&gp->lock, flags);
reset_tx(dev);
enable_ether_irq(dev);
netif_wake_queue(dev);
}
}
@ -1460,7 +1460,7 @@ gt96100_set_rx_mode(struct net_device *dev)
struct gt96100_private *gp = netdev_priv(dev);
unsigned long flags;
//struct dev_mc_list *mcptr;
dbg(3, "%s: dev=%p, flags=%x\n", __FUNCTION__, dev, dev->flags);
// stop the Receiver DMA
@ -1491,7 +1491,7 @@ gt96100_set_rx_mode(struct net_device *dev)
}
}
#endif
// restart Rx DMA
GT96100ETH_WRITE(gp, GT96100_ETH_SDMA_COMM, sdcmrERD);

Просмотреть файл

@ -22,7 +22,7 @@
*
* Ethernet driver definitions for the MIPS GT96100 Advanced
* Communication Controller.
*
*
*/
#ifndef _GT96100ETH_H
#define _GT96100ETH_H
@ -314,7 +314,7 @@ struct gt96100_private {
// The Hash Table must be 8-byte aligned
dma_addr_t hash_table_dma;
int hash_mode;
// The Rx buffers must be 8-byte aligned
char* rx_buff;
dma_addr_t rx_buff_dma;
@ -327,14 +327,14 @@ struct gt96100_private {
int tx_count; /* current # of pkts waiting to be sent in Tx ring */
int intr_work_done; /* number of Rx and Tx pkts processed in the isr */
int tx_full; /* Tx ring is full */
mib_counters_t mib;
struct net_device_stats stats;
int port_num; // 0 or 1
int chip_rev;
u32 port_offset;
int phy_addr; // PHY address
u32 last_psr; // last value of the port status register

Просмотреть файл

@ -3,7 +3,7 @@
Written 1998-2000 by Donald Becker.
Updates 2000 by Keith Underwood.
This software may be used and distributed according to the terms of
This software may be used and distributed according to the terms of
the GNU General Public License (GPL), incorporated herein by reference.
Drivers based on or derived from this code fall under the GPL and must
retain the authorship, copyright and license notice. This file is not
@ -46,7 +46,7 @@ static int mtu;
static int max_rx_latency = 0x11;
static int max_rx_gap = 0x05;
static int min_rx_pkt = 0x18;
static int max_tx_latency = 0x00;
static int max_tx_latency = 0x00;
static int max_tx_gap = 0x00;
static int min_tx_pkt = 0x30;
@ -76,7 +76,7 @@ static int force32;
- The next bit can be used to force half-duplex. This is a bad
idea since no known implementations implement half-duplex, and,
in general, half-duplex for gigabit ethernet is a bad idea.
0x00000080 : Force half-duplex
0x00000080 : Force half-duplex
Default is full-duplex.
- In the original driver, the ninth bit could be used to force
full-duplex. Maintain that for compatibility
@ -87,7 +87,7 @@ static int options[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
/* The Hamachi chipset supports 3 parameters each for Rx and Tx
* interruput management. Parameters will be loaded as specified into
* the TxIntControl and RxIntControl registers.
* the TxIntControl and RxIntControl registers.
*
* The registers are arranged as follows:
* 23 - 16 15 - 8 7 - 0
@ -95,10 +95,10 @@ static int full_duplex[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
* | min_pkt | max_gap | max_latency |
* ---------------------------------
* min_pkt : The minimum number of packets processed between
* interrupts.
* interrupts.
* max_gap : The maximum inter-packet gap in units of 8.192 us
* max_latency : The absolute time between interrupts in units of 8.192 us
*
*
*/
static int rx_params[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
static int tx_params[MAX_UNITS] = {-1, -1, -1, -1, -1, -1, -1, -1};
@ -183,7 +183,7 @@ KERN_INFO " Further modifications by Keith Underwood <keithu@parl.clemson.edu>
other linux headers causing many compiler warnings.
*/
#ifndef IP_MF
#define IP_MF 0x2000 /* IP more frags from <netinet/ip.h> */
#define IP_MF 0x2000 /* IP more frags from <netinet/ip.h> */
#endif
/* Define IP_OFFSET to be IPOPT_OFFSET */
@ -204,9 +204,9 @@ KERN_INFO " Further modifications by Keith Underwood <keithu@parl.clemson.edu>
/* Condensed bus+endian portability operations. */
#if ADDRLEN == 64
#define cpu_to_leXX(addr) cpu_to_le64(addr)
#else
#else
#define cpu_to_leXX(addr) cpu_to_le32(addr)
#endif
#endif
/*
@ -291,30 +291,30 @@ Hamachi Engineering Design Specification, 5/15/97
IVc. Errata
None noted.
None noted.
V. Recent Changes
01/15/1999 EPK Enlargement of the TX and RX ring sizes. This appears
01/15/1999 EPK Enlargement of the TX and RX ring sizes. This appears
to help avoid some stall conditions -- this needs further research.
01/15/1999 EPK Creation of the hamachi_tx function. This function cleans
01/15/1999 EPK Creation of the hamachi_tx function. This function cleans
the Tx ring and is called from hamachi_start_xmit (this used to be
called from hamachi_interrupt but it tends to delay execution of the
interrupt handler and thus reduce bandwidth by reducing the latency
between hamachi_rx()'s). Notably, some modification has been made so
that the cleaning loop checks only to make sure that the DescOwn bit
isn't set in the status flag since the card is not required
between hamachi_rx()'s). Notably, some modification has been made so
that the cleaning loop checks only to make sure that the DescOwn bit
isn't set in the status flag since the card is not required
to set the entire flag to zero after processing.
01/15/1999 EPK In the hamachi_start_tx function, the Tx ring full flag is
01/15/1999 EPK In the hamachi_start_tx function, the Tx ring full flag is
checked before attempting to add a buffer to the ring. If the ring is full
an attempt is made to free any dirty buffers and thus find space for
the new buffer or the function returns non-zero which should case the
scheduler to reschedule the buffer later.
01/15/1999 EPK Some adjustments were made to the chip initialization.
End-to-end flow control should now be fully active and the interrupt
01/15/1999 EPK Some adjustments were made to the chip initialization.
End-to-end flow control should now be fully active and the interrupt
algorithm vars have been changed. These could probably use further tuning.
01/15/1999 EPK Added the max_{rx,tx}_latency options. These are used to
@ -322,7 +322,7 @@ V. Recent Changes
problems with network stalls, try setting these to higher values.
Valid values are 0x00 through 0xff.
01/15/1999 EPK In general, the overall bandwidth has increased and
01/15/1999 EPK In general, the overall bandwidth has increased and
latencies are better (sometimes by a factor of 2). Stalls are rare at
this point, however there still appears to be a bug somewhere between the
hardware and driver. TCP checksum errors under load also appear to be
@ -334,20 +334,20 @@ V. Recent Changes
rings was typically getting set correctly, but the Tx ring wasn't getting
the DescEndRing bit set during initialization. ??? Does this mean the
hamachi card is using the DescEndRing in processing even if a particular
slot isn't in use -- hypothetically, the card might be searching the
slot isn't in use -- hypothetically, the card might be searching the
entire Tx ring for slots with the DescOwn bit set and then processing
them. If the DescEndRing bit isn't set, then it might just wander off
through memory until it hits a chunk of data with that bit set
and then looping back.
02/09/1999 EPK Added Michel Mueller's TxDMA Interrupt and Tx-timeout
02/09/1999 EPK Added Michel Mueller's TxDMA Interrupt and Tx-timeout
problem (TxCmd and RxCmd need only to be set when idle or stopped.
02/09/1999 EPK Added code to check/reset dev->tbusy in hamachi_interrupt.
(Michel Mueller pointed out the ``permanently busy'' potential
(Michel Mueller pointed out the ``permanently busy'' potential
problem here).
02/22/1999 EPK Added Pete Wyckoff's ioctl to control the Tx/Rx latencies.
02/22/1999 EPK Added Pete Wyckoff's ioctl to control the Tx/Rx latencies.
02/23/1999 EPK Verified that the interrupt status field bits for Tx were
incorrectly defined and corrected (as per Michel Mueller).
@ -363,7 +363,7 @@ V. Recent Changes
02/20/2000 KDU Some of the control was just plain odd. Cleaned up the
hamachi_start_xmit() and hamachi_interrupt() code. There is still some
re-structuring I would like to do.
re-structuring I would like to do.
03/01/2000 KDU Experimenting with a WIDE range of interrupt mitigation
parameters on a dual P3-450 setup yielded the new default interrupt
@ -371,25 +371,25 @@ mitigation parameters. Tx should interrupt VERY infrequently due to
Eric's scheme. Rx should be more often...
03/13/2000 KDU Added a patch to make the Rx Checksum code interact
nicely with non-linux machines.
nicely with non-linux machines.
03/13/2000 KDU Experimented with some of the configuration values:
03/13/2000 KDU Experimented with some of the configuration values:
-It seems that enabling PCI performance commands for descriptors
(changing RxDMACtrl and TxDMACtrl lower nibble from 5 to D) has minimal
performance impact for any of my tests. (ttcp, netpipe, netperf) I will
(changing RxDMACtrl and TxDMACtrl lower nibble from 5 to D) has minimal
performance impact for any of my tests. (ttcp, netpipe, netperf) I will
leave them that way until I hear further feedback.
-Increasing the PCI_LATENCY_TIMER to 130
-Increasing the PCI_LATENCY_TIMER to 130
(2 + (burst size of 128 * (0 wait states + 1))) seems to slightly
degrade performance. Leaving default at 64 pending further information.
03/14/2000 KDU Further tuning:
03/14/2000 KDU Further tuning:
-adjusted boguscnt in hamachi_rx() to depend on interrupt
mitigation parameters chosen.
-Selected a set of interrupt parameters based on some extensive testing.
-Selected a set of interrupt parameters based on some extensive testing.
These may change with more testing.
TO DO:
@ -398,14 +398,14 @@ TO DO:
PCI_COMMAND_INVALIDATE. Set maximum burst size to cache line size in
that case.
-fix the reset procedure. It doesn't quite work.
-fix the reset procedure. It doesn't quite work.
*/
/* A few values that may be tweaked. */
/* Size of each temporary Rx buffer, calculated as:
* 1518 bytes (ethernet packet) + 2 bytes (to get 8 byte alignment for
* the card) + 8 bytes of status info + 8 bytes for the Rx Checksum +
* 2 more because we use skb_reserve.
* 2 more because we use skb_reserve.
*/
#define PKT_BUF_SZ 1538
@ -465,7 +465,7 @@ enum intr_status_bits {
/* The Hamachi Rx and Tx buffer descriptors. */
struct hamachi_desc {
u32 status_n_length;
u32 status_n_length;
#if ADDRLEN == 64
u32 pad;
u64 addr;
@ -476,7 +476,7 @@ struct hamachi_desc {
/* Bits in hamachi_desc.status_n_length */
enum desc_status_bits {
DescOwn=0x80000000, DescEndPacket=0x40000000, DescEndRing=0x20000000,
DescOwn=0x80000000, DescEndPacket=0x40000000, DescEndRing=0x20000000,
DescIntr=0x10000000,
};
@ -546,7 +546,7 @@ MODULE_PARM_DESC(tx_params, "GNIC-II min_tx_pkt+max_tx_gap+max_tx_latency");
MODULE_PARM_DESC(options, "GNIC-II Bits 0-3: media type, bits 4-6: as force32, bit 7: half duplex, bit 9 full duplex");
MODULE_PARM_DESC(full_duplex, "GNIC-II full duplex setting(s) (1)");
MODULE_PARM_DESC(force32, "GNIC-II: Bit 0: 32 bit PCI, bit 1: disable parity, bit 2: 64 bit PCI (all boards)");
static int read_eeprom(void __iomem *ioaddr, int location);
static int mdio_read(struct net_device *dev, int phy_id, int location);
static void mdio_write(struct net_device *dev, int phy_id, int location, int value);
@ -659,7 +659,7 @@ static int __devinit hamachi_init_one (struct pci_dev *pdev,
option = dev->mem_start;
/* If the bus size is misidentified, do the following. */
force32 = force32 ? force32 :
force32 = force32 ? force32 :
((option >= 0) ? ((option & 0x00000070) >> 4) : 0 );
if (force32)
writeb(force32, ioaddr + VirtualJumpers);
@ -671,11 +671,11 @@ static int __devinit hamachi_init_one (struct pci_dev *pdev,
* be valid for a moment. Wait for a little while until it is. If
* it takes more than 10ms, forget it.
*/
udelay(10);
udelay(10);
i = readb(ioaddr + PCIClkMeas);
for (boguscnt = 0; (!(i & 0x080)) && boguscnt < 1000; boguscnt++){
udelay(10);
i = readb(ioaddr + PCIClkMeas);
udelay(10);
i = readb(ioaddr + PCIClkMeas);
}
hmp->base = ioaddr;
@ -714,9 +714,9 @@ static int __devinit hamachi_init_one (struct pci_dev *pdev,
rx_int_var = card_idx < MAX_UNITS ? rx_params[card_idx] : -1;
tx_int_var = card_idx < MAX_UNITS ? tx_params[card_idx] : -1;
hmp->rx_int_var = rx_int_var >= 0 ? rx_int_var :
hmp->rx_int_var = rx_int_var >= 0 ? rx_int_var :
(min_rx_pkt << 16 | max_rx_gap << 8 | max_rx_latency);
hmp->tx_int_var = tx_int_var >= 0 ? tx_int_var :
hmp->tx_int_var = tx_int_var >= 0 ? tx_int_var :
(min_tx_pkt << 16 | max_tx_gap << 8 | max_tx_latency);
@ -783,10 +783,10 @@ static int __devinit hamachi_init_one (struct pci_dev *pdev,
return 0;
err_out_unmap_rx:
pci_free_consistent(pdev, RX_TOTAL_SIZE, hmp->rx_ring,
pci_free_consistent(pdev, RX_TOTAL_SIZE, hmp->rx_ring,
hmp->rx_ring_dma);
err_out_unmap_tx:
pci_free_consistent(pdev, TX_TOTAL_SIZE, hmp->tx_ring,
pci_free_consistent(pdev, TX_TOTAL_SIZE, hmp->tx_ring,
hmp->tx_ring_dma);
err_out_cleardev:
free_netdev (dev);
@ -856,7 +856,7 @@ static void mdio_write(struct net_device *dev, int phy_id, int location, int val
return;
}
static int hamachi_open(struct net_device *dev)
{
struct hamachi_private *hmp = netdev_priv(dev);
@ -886,7 +886,7 @@ static int hamachi_open(struct net_device *dev)
writel(cpu_to_le32(hmp->tx_ring_dma), ioaddr + TxPtr);
#endif
/* TODO: It would make sense to organize this as words since the card
/* TODO: It would make sense to organize this as words since the card
* documentation does. -KDU
*/
for (i = 0; i < 6; i++)
@ -898,36 +898,36 @@ static int hamachi_open(struct net_device *dev)
/* Configure the FIFO */
fifo_info = (readw(ioaddr + GPIO) & 0x00C0) >> 6;
switch (fifo_info){
case 0 :
case 0 :
/* No FIFO */
writew(0x0000, ioaddr + FIFOcfg);
break;
case 1 :
case 1 :
/* Configure the FIFO for 512K external, 16K used for Tx. */
writew(0x0028, ioaddr + FIFOcfg);
break;
case 2 :
case 2 :
/* Configure the FIFO for 1024 external, 32K used for Tx. */
writew(0x004C, ioaddr + FIFOcfg);
break;
case 3 :
case 3 :
/* Configure the FIFO for 2048 external, 32K used for Tx. */
writew(0x006C, ioaddr + FIFOcfg);
break;
default :
default :
printk(KERN_WARNING "%s: Unsupported external memory config!\n",
dev->name);
/* Default to no FIFO */
writew(0x0000, ioaddr + FIFOcfg);
break;
}
if (dev->if_port == 0)
dev->if_port = hmp->default_port;
/* Setting the Rx mode will start the Rx process. */
/* If someone didn't choose a duplex, default to full-duplex */
/* If someone didn't choose a duplex, default to full-duplex */
if (hmp->duplex_lock != 1)
hmp->mii_if.full_duplex = 1;
@ -940,7 +940,7 @@ static int hamachi_open(struct net_device *dev)
#endif
writew(0x8000, ioaddr + MACCnfg); /* Soft reset the MAC */
writew(0x215F, ioaddr + MACCnfg);
writew(0x000C, ioaddr + FrameGap0);
writew(0x000C, ioaddr + FrameGap0);
/* WHAT?!?!? Why isn't this documented somewhere? -KDU */
writew(0x1018, ioaddr + FrameGap1);
/* Why do we enable receives/transmits here? -KDU */
@ -962,16 +962,16 @@ static int hamachi_open(struct net_device *dev)
if (hamachi_debug > 1) {
printk("max_tx_latency: %d, max_tx_gap: %d, min_tx_pkt: %d\n",
tx_int_var & 0x00ff, (tx_int_var & 0x00ff00) >> 8,
tx_int_var & 0x00ff, (tx_int_var & 0x00ff00) >> 8,
(tx_int_var & 0x00ff0000) >> 16);
printk("max_rx_latency: %d, max_rx_gap: %d, min_rx_pkt: %d\n",
rx_int_var & 0x00ff, (rx_int_var & 0x00ff00) >> 8,
rx_int_var & 0x00ff, (rx_int_var & 0x00ff00) >> 8,
(rx_int_var & 0x00ff0000) >> 16);
printk("rx_int_var: %x, tx_int_var: %x\n", rx_int_var, tx_int_var);
}
writel(tx_int_var, ioaddr + TxIntrCtrl);
writel(rx_int_var, ioaddr + RxIntrCtrl);
writel(tx_int_var, ioaddr + TxIntrCtrl);
writel(rx_int_var, ioaddr + RxIntrCtrl);
set_rx_mode(dev);
@ -1016,21 +1016,21 @@ static inline int hamachi_tx(struct net_device *dev)
int entry = hmp->dirty_tx % TX_RING_SIZE;
struct sk_buff *skb;
if (hmp->tx_ring[entry].status_n_length & cpu_to_le32(DescOwn))
if (hmp->tx_ring[entry].status_n_length & cpu_to_le32(DescOwn))
break;
/* Free the original skb. */
skb = hmp->tx_skbuff[entry];
if (skb != 0) {
pci_unmap_single(hmp->pci_dev,
hmp->tx_ring[entry].addr, skb->len,
pci_unmap_single(hmp->pci_dev,
hmp->tx_ring[entry].addr, skb->len,
PCI_DMA_TODEVICE);
dev_kfree_skb(skb);
hmp->tx_skbuff[entry] = NULL;
}
hmp->tx_ring[entry].status_n_length = 0;
if (entry >= TX_RING_SIZE-1)
if (entry >= TX_RING_SIZE-1)
hmp->tx_ring[TX_RING_SIZE-1].status_n_length |=
cpu_to_le32(DescEndRing);
cpu_to_le32(DescEndRing);
hmp->stats.tx_packets++;
}
@ -1082,7 +1082,7 @@ static void hamachi_tx_timeout(struct net_device *dev)
printk("\n");
}
/* Reinit the hardware and make sure the Rx and Tx processes
/* Reinit the hardware and make sure the Rx and Tx processes
are up and running.
*/
dev->if_port = 0;
@ -1092,7 +1092,7 @@ static void hamachi_tx_timeout(struct net_device *dev)
* -Turn off MAC receiver
* -Issue Reset
*/
for (i = 0; i < RX_RING_SIZE; i++)
hmp->rx_ring[i].status_n_length &= cpu_to_le32(~DescOwn);
@ -1106,11 +1106,11 @@ static void hamachi_tx_timeout(struct net_device *dev)
hmp->tx_ring[i].status_n_length = cpu_to_le32(
DescEndRing |
(hmp->tx_ring[i].status_n_length & 0x0000FFFF));
else
else
hmp->tx_ring[i].status_n_length &= 0x0000ffff;
skb = hmp->tx_skbuff[i];
if (skb){
pci_unmap_single(hmp->pci_dev, hmp->tx_ring[i].addr,
pci_unmap_single(hmp->pci_dev, hmp->tx_ring[i].addr,
skb->len, PCI_DMA_TODEVICE);
dev_kfree_skb(skb);
hmp->tx_skbuff[i] = NULL;
@ -1119,20 +1119,20 @@ static void hamachi_tx_timeout(struct net_device *dev)
udelay(60); /* Sleep 60 us just for safety sake */
writew(0x0002, ioaddr + RxCmd); /* STOP Rx */
writeb(0x01, ioaddr + ChipReset); /* Reinit the hardware */
writeb(0x01, ioaddr + ChipReset); /* Reinit the hardware */
hmp->tx_full = 0;
hmp->cur_rx = hmp->cur_tx = 0;
hmp->dirty_rx = hmp->dirty_tx = 0;
/* Rx packets are also presumed lost; however, we need to make sure a
* ring of buffers is in tact. -KDU
*/
*/
for (i = 0; i < RX_RING_SIZE; i++){
struct sk_buff *skb = hmp->rx_skbuff[i];
if (skb){
pci_unmap_single(hmp->pci_dev, hmp->rx_ring[i].addr,
pci_unmap_single(hmp->pci_dev, hmp->rx_ring[i].addr,
hmp->rx_buf_sz, PCI_DMA_FROMDEVICE);
dev_kfree_skb(skb);
hmp->rx_skbuff[i] = NULL;
@ -1146,9 +1146,9 @@ static void hamachi_tx_timeout(struct net_device *dev)
break;
skb->dev = dev; /* Mark as being used by this device. */
skb_reserve(skb, 2); /* 16 byte align the IP header. */
hmp->rx_ring[i].addr = cpu_to_leXX(pci_map_single(hmp->pci_dev,
hmp->rx_ring[i].addr = cpu_to_leXX(pci_map_single(hmp->pci_dev,
skb->data, hmp->rx_buf_sz, PCI_DMA_FROMDEVICE));
hmp->rx_ring[i].status_n_length = cpu_to_le32(DescOwn |
hmp->rx_ring[i].status_n_length = cpu_to_le32(DescOwn |
DescEndPacket | DescIntr | (hmp->rx_buf_sz - 2));
}
hmp->dirty_rx = (unsigned int)(i - RX_RING_SIZE);
@ -1187,11 +1187,11 @@ static void hamachi_init_ring(struct net_device *dev)
#endif
/* My attempt at a reasonable correction */
/* +26 gets the maximum ethernet encapsulation, +7 & ~7 because the
* card needs room to do 8 byte alignment, +2 so we can reserve
* the first 2 bytes, and +16 gets room for the status word from the
* card needs room to do 8 byte alignment, +2 so we can reserve
* the first 2 bytes, and +16 gets room for the status word from the
* card. -KDU
*/
hmp->rx_buf_sz = (dev->mtu <= 1492 ? PKT_BUF_SZ :
hmp->rx_buf_sz = (dev->mtu <= 1492 ? PKT_BUF_SZ :
(((dev->mtu+26+7) & ~7) + 2 + 16));
/* Initialize all Rx descriptors. */
@ -1207,10 +1207,10 @@ static void hamachi_init_ring(struct net_device *dev)
break;
skb->dev = dev; /* Mark as being used by this device. */
skb_reserve(skb, 2); /* 16 byte align the IP header. */
hmp->rx_ring[i].addr = cpu_to_leXX(pci_map_single(hmp->pci_dev,
hmp->rx_ring[i].addr = cpu_to_leXX(pci_map_single(hmp->pci_dev,
skb->data, hmp->rx_buf_sz, PCI_DMA_FROMDEVICE));
/* -2 because it doesn't REALLY have that first 2 bytes -KDU */
hmp->rx_ring[i].status_n_length = cpu_to_le32(DescOwn |
hmp->rx_ring[i].status_n_length = cpu_to_le32(DescOwn |
DescEndPacket | DescIntr | (hmp->rx_buf_sz -2));
}
hmp->dirty_rx = (unsigned int)(i - RX_RING_SIZE);
@ -1267,7 +1267,7 @@ static int hamachi_start_xmit(struct sk_buff *skb, struct net_device *dev)
unsigned entry;
u16 status;
/* Ok, now make sure that the queue has space before trying to
/* Ok, now make sure that the queue has space before trying to
add another skbuff. if we return non-zero the scheduler
should interpret this as a queue full and requeue the buffer
for later.
@ -1282,7 +1282,7 @@ static int hamachi_start_xmit(struct sk_buff *skb, struct net_device *dev)
if( !(status & 0x0001) || (status & 0x0002))
writew(0x0001, hmp->base + TxCmd);
return 1;
}
}
/* Caution: the write order is important here, set the field
with the "ownership" bits last. */
@ -1322,15 +1322,15 @@ static int hamachi_start_xmit(struct sk_buff *skb, struct net_device *dev)
}
#endif
hmp->tx_ring[entry].addr = cpu_to_leXX(pci_map_single(hmp->pci_dev,
hmp->tx_ring[entry].addr = cpu_to_leXX(pci_map_single(hmp->pci_dev,
skb->data, skb->len, PCI_DMA_TODEVICE));
/* Hmmmm, could probably put a DescIntr on these, but the way
the driver is currently coded makes Tx interrupts unnecessary
since the clearing of the Tx ring is handled by the start_xmit
routine. This organization helps mitigate the interrupts a
bit and probably renders the max_tx_latency param useless.
Update: Putting a DescIntr bit on all of the descriptors and
mitigating interrupt frequency with the tx_min_pkt parameter. -KDU
*/
@ -1359,7 +1359,7 @@ static int hamachi_start_xmit(struct sk_buff *skb, struct net_device *dev)
* hence, any packet that got put off because we were in the transmit
* routine should IMMEDIATELY get a chance to be re-queued. -KDU
*/
if ((hmp->cur_tx - hmp->dirty_tx) < (TX_RING_SIZE - 4))
if ((hmp->cur_tx - hmp->dirty_tx) < (TX_RING_SIZE - 4))
netif_wake_queue(dev); /* Typical path */
else {
hmp->tx_full = 1;
@ -1412,27 +1412,27 @@ static irqreturn_t hamachi_interrupt(int irq, void *dev_instance, struct pt_regs
/* This code should RARELY need to execute. After all, this is
* a gigabit link, it should consume packets as fast as we put
* them in AND we clear the Tx ring in hamachi_start_xmit().
*/
*/
if (hmp->tx_full){
for (; hmp->cur_tx - hmp->dirty_tx > 0; hmp->dirty_tx++){
int entry = hmp->dirty_tx % TX_RING_SIZE;
struct sk_buff *skb;
if (hmp->tx_ring[entry].status_n_length & cpu_to_le32(DescOwn))
if (hmp->tx_ring[entry].status_n_length & cpu_to_le32(DescOwn))
break;
skb = hmp->tx_skbuff[entry];
/* Free the original skb. */
if (skb){
pci_unmap_single(hmp->pci_dev,
hmp->tx_ring[entry].addr,
pci_unmap_single(hmp->pci_dev,
hmp->tx_ring[entry].addr,
skb->len,
PCI_DMA_TODEVICE);
dev_kfree_skb_irq(skb);
hmp->tx_skbuff[entry] = NULL;
}
hmp->tx_ring[entry].status_n_length = 0;
if (entry >= TX_RING_SIZE-1)
hmp->tx_ring[TX_RING_SIZE-1].status_n_length |=
if (entry >= TX_RING_SIZE-1)
hmp->tx_ring[TX_RING_SIZE-1].status_n_length |=
cpu_to_le32(DescEndRing);
hmp->stats.tx_packets++;
}
@ -1498,9 +1498,9 @@ static int hamachi_rx(struct net_device *dev)
struct hamachi_desc *desc = &(hmp->rx_ring[entry]);
u32 desc_status = le32_to_cpu(desc->status_n_length);
u16 data_size = desc_status; /* Implicit truncate */
u8 *buf_addr;
u8 *buf_addr;
s32 frame_status;
if (desc_status & DescOwn)
break;
pci_dma_sync_single_for_cpu(hmp->pci_dev,
@ -1540,7 +1540,7 @@ static int hamachi_rx(struct net_device *dev)
} else {
struct sk_buff *skb;
/* Omit CRC */
u16 pkt_len = (frame_status & 0x07ff) - 4;
u16 pkt_len = (frame_status & 0x07ff) - 4;
#ifdef RX_CHECKSUM
u32 pfck = *(u32 *) &buf_addr[data_size - 8];
#endif
@ -1576,7 +1576,7 @@ static int hamachi_rx(struct net_device *dev)
PCI_DMA_FROMDEVICE);
/* Call copy + cksum if available. */
#if 1 || USE_IP_COPYSUM
eth_copy_and_sum(skb,
eth_copy_and_sum(skb,
hmp->rx_skbuff[entry]->data, pkt_len, 0);
skb_put(skb, pkt_len);
#else
@ -1588,7 +1588,7 @@ static int hamachi_rx(struct net_device *dev)
hmp->rx_buf_sz,
PCI_DMA_FROMDEVICE);
} else {
pci_unmap_single(hmp->pci_dev,
pci_unmap_single(hmp->pci_dev,
hmp->rx_ring[entry].addr,
hmp->rx_buf_sz, PCI_DMA_FROMDEVICE);
skb_put(skb = hmp->rx_skbuff[entry], pkt_len);
@ -1619,18 +1619,18 @@ static int hamachi_rx(struct net_device *dev)
p_r = *p;
p_r1 = *(p-1);
switch (inv) {
case 0:
case 0:
crc = (p_r & 0xffff) + (p_r >> 16);
break;
case 1:
case 1:
crc = (p_r >> 16) + (p_r & 0xffff)
+ (p_r1 >> 16 & 0xff00);
+ (p_r1 >> 16 & 0xff00);
break;
case 2:
crc = p_r + (p_r1 >> 16);
case 2:
crc = p_r + (p_r1 >> 16);
break;
case 3:
crc = p_r + (p_r1 & 0xff00) + (p_r1 >> 16);
case 3:
crc = p_r + (p_r1 & 0xff00) + (p_r1 >> 16);
break;
default: /*NOTREACHED*/ crc = 0;
}
@ -1650,7 +1650,7 @@ static int hamachi_rx(struct net_device *dev)
*/
skb->ip_summed = CHECKSUM_HW;
}
}
}
}
#endif /* RX_CHECKSUM */
@ -1675,15 +1675,15 @@ static int hamachi_rx(struct net_device *dev)
break; /* Better luck next round. */
skb->dev = dev; /* Mark as being used by this device. */
skb_reserve(skb, 2); /* Align IP on 16 byte boundaries */
desc->addr = cpu_to_leXX(pci_map_single(hmp->pci_dev,
desc->addr = cpu_to_leXX(pci_map_single(hmp->pci_dev,
skb->data, hmp->rx_buf_sz, PCI_DMA_FROMDEVICE));
}
desc->status_n_length = cpu_to_le32(hmp->rx_buf_sz);
if (entry >= RX_RING_SIZE-1)
desc->status_n_length |= cpu_to_le32(DescOwn |
desc->status_n_length |= cpu_to_le32(DescOwn |
DescEndPacket | DescEndRing | DescIntr);
else
desc->status_n_length |= cpu_to_le32(DescOwn |
desc->status_n_length |= cpu_to_le32(DescOwn |
DescEndPacket | DescIntr);
}
@ -1794,8 +1794,8 @@ static int hamachi_close(struct net_device *dev)
hmp->rx_ring[i].status_n_length = 0;
hmp->rx_ring[i].addr = 0xBADF00D0; /* An invalid address. */
if (skb) {
pci_unmap_single(hmp->pci_dev,
hmp->rx_ring[i].addr, hmp->rx_buf_sz,
pci_unmap_single(hmp->pci_dev,
hmp->rx_ring[i].addr, hmp->rx_buf_sz,
PCI_DMA_FROMDEVICE);
dev_kfree_skb(skb);
hmp->rx_skbuff[i] = NULL;
@ -1804,8 +1804,8 @@ static int hamachi_close(struct net_device *dev)
for (i = 0; i < TX_RING_SIZE; i++) {
skb = hmp->tx_skbuff[i];
if (skb) {
pci_unmap_single(hmp->pci_dev,
hmp->tx_ring[i].addr, skb->len,
pci_unmap_single(hmp->pci_dev,
hmp->tx_ring[i].addr, skb->len,
PCI_DMA_TODEVICE);
dev_kfree_skb(skb);
hmp->tx_skbuff[i] = NULL;
@ -1829,7 +1829,7 @@ static struct net_device_stats *hamachi_get_stats(struct net_device *dev)
according to ifconfig. It does get incremented in hamachi_tx(),
so I think I'll comment it out here and see if better things
happen.
*/
*/
/* hmp->stats.tx_packets = readl(ioaddr + 0x000); */
hmp->stats.rx_bytes = readl(ioaddr + 0x330); /* Total Uni+Brd+Multi */
@ -1976,9 +1976,9 @@ static void __devexit hamachi_remove_one (struct pci_dev *pdev)
if (dev) {
struct hamachi_private *hmp = netdev_priv(dev);
pci_free_consistent(pdev, RX_TOTAL_SIZE, hmp->rx_ring,
pci_free_consistent(pdev, RX_TOTAL_SIZE, hmp->rx_ring,
hmp->rx_ring_dma);
pci_free_consistent(pdev, TX_TOTAL_SIZE, hmp->tx_ring,
pci_free_consistent(pdev, TX_TOTAL_SIZE, hmp->tx_ring,
hmp->tx_ring_dma);
unregister_netdev(dev);
iounmap(hmp->base);

Просмотреть файл

@ -112,7 +112,7 @@ static void hpp_io_block_output(struct net_device *dev, int count,
static void hpp_io_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr,
int ring_page);
/* Probe a list of addresses for an HP LAN+ adaptor.
This routine is almost boilerplate. */
@ -430,7 +430,7 @@ hpp_mem_block_output(struct net_device *dev, int count,
return;
}
#ifdef MODULE
#define MAX_HPP_CARDS 4 /* Max number of HPP cards per module */
static struct net_device *dev_hpp[MAX_HPP_CARDS];

Просмотреть файл

@ -75,7 +75,7 @@ static void hp_init_card(struct net_device *dev);
/* My default is IRQ5 0 1 2 3 4 5 6 7 8 9 10 11 */
static char irqmap[16] __initdata= { 0, 0, 4, 6, 8,10, 0,14, 0, 4, 2,12,0,0,0,0};
/* Probe for an HP LAN adaptor.
Also initialize the card and fill in STATION_ADDR with the station
address. */

Просмотреть файл

@ -1,24 +1,24 @@
/*
** hp100.c
** hp100.c
** HP CASCADE Architecture Driver for 100VG-AnyLan Network Adapters
**
** $Id: hp100.c,v 1.58 2001/09/24 18:03:01 perex Exp perex $
**
** Based on the HP100 driver written by Jaroslav Kysela <perex@jcu.cz>
** Extended for new busmaster capable chipsets by
** Extended for new busmaster capable chipsets by
** Siegfried "Frieder" Loeffler (dg1sek) <floeff@mathematik.uni-stuttgart.de>
**
** Maintained by: Jaroslav Kysela <perex@suse.cz>
**
**
** This driver has only been tested with
** -- HP J2585B 10/100 Mbit/s PCI Busmaster
** -- HP J2585A 10/100 Mbit/s PCI
** -- HP J2585A 10/100 Mbit/s PCI
** -- HP J2970A 10 Mbit/s PCI Combo 10base-T/BNC
** -- HP J2973A 10 Mbit/s PCI 10base-T
** -- HP J2573 10/100 ISA
** -- Compex ReadyLink ENET100-VG4 10/100 Mbit/s PCI / EISA
** -- Compex FreedomLine 100/VG 10/100 Mbit/s ISA / EISA / PCI
**
**
** but it should also work with the other CASCADE based adapters.
**
** TODO:
@ -65,7 +65,7 @@
** - timing changes in xmit routines, relogin to 100VG hub added when
** driver does reset
** - included fix for Compex FreedomLine PCI adapter
**
**
** 1.54 -> 1.55
** - fixed bad initialization in init_module
** - added Compex FreedomLine adapter
@ -73,10 +73,10 @@
**
** 1.53 -> 1.54
** - added hardware multicast filter support (doesn't work)
** - little changes in hp100_sense_lan routine
** - little changes in hp100_sense_lan routine
** - added support for Coax and AUI (J2970)
** - fix for multiple cards and hp100_mode parameter (insmod)
** - fix for shared IRQ
** - fix for shared IRQ
**
** 1.52 -> 1.53
** - fixed bug in multicast support
@ -286,7 +286,7 @@ static inline dma_addr_t virt_to_whatever(struct net_device *dev, u32 * ptr)
static inline u_int pdl_map_data(struct hp100_private *lp, void *data)
{
return pci_map_single(lp->pci_dev, data,
return pci_map_single(lp->pci_dev, data,
MAX_ETHER_SIZE, PCI_DMA_FROMDEVICE);
}
@ -353,7 +353,7 @@ static __init int hp100_isa_probe1(struct net_device *dev, int ioaddr)
goto err;
for (i = 0; i < ARRAY_SIZE(hp100_isa_tbl); i++) {
if (!strcmp(hp100_isa_tbl[i], sig))
if (!strcmp(hp100_isa_tbl[i], sig))
break;
}
@ -373,11 +373,11 @@ static int __init hp100_isa_probe(struct net_device *dev, int addr)
{
int err = -ENODEV;
/* Probe for a specific ISA address */
/* Probe for a specific ISA address */
if (addr > 0xff && addr < 0x400)
err = hp100_isa_probe1(dev, addr);
else if (addr != 0)
else if (addr != 0)
err = -ENXIO;
else {
@ -448,7 +448,7 @@ static int __devinit hp100_probe1(struct net_device *dev, int ioaddr,
if (!request_region(ioaddr, HP100_REGION_SIZE, "hp100"))
goto out1;
if (hp100_inw(HW_ID) != HP100_HW_ID_CASCADE)
if (hp100_inw(HW_ID) != HP100_HW_ID_CASCADE)
goto out2;
chip = hp100_inw(PAGING) & HP100_CHIPID_MASK;
@ -491,7 +491,7 @@ static int __devinit hp100_probe1(struct net_device *dev, int ioaddr,
* Use the variable "hp100_mode" upon insmod or as kernel parameter to
* force driver modes:
* hp100_mode=1 -> default, use busmaster mode if configured.
* hp100_mode=2 -> enable shared memory mode
* hp100_mode=2 -> enable shared memory mode
* hp100_mode=3 -> force use of i/o mapped mode.
* hp100_mode=4 -> same as 1, but re-set the enable bit on the card.
*/
@ -689,9 +689,9 @@ static int __devinit hp100_probe1(struct net_device *dev, int ioaddr,
hp100_clear_stats(lp, ioaddr);
/* If busmaster mode is wanted, a dma-capable memory area is needed for
* the rx and tx PDLs
* the rx and tx PDLs
* PCI cards can access the whole PC memory. Therefore GFP_DMA is not
* needed for the allocation of the memory area.
* needed for the allocation of the memory area.
*/
/* TODO: We do not need this with old cards, where PDLs are stored
@ -718,7 +718,7 @@ static int __devinit hp100_probe1(struct net_device *dev, int ioaddr,
}
/* Initialise the card. */
/* (I'm not really sure if it's a good idea to do this during probing, but
/* (I'm not really sure if it's a good idea to do this during probing, but
* like this it's assured that the lan connection type can be sensed
* correctly)
*/
@ -778,8 +778,8 @@ static int __devinit hp100_probe1(struct net_device *dev, int ioaddr,
return 0;
out3:
if (local_mode == 1)
pci_free_consistent(lp->pci_dev, MAX_RINGSIZE + 0x0f,
lp->page_vaddr_algn,
pci_free_consistent(lp->pci_dev, MAX_RINGSIZE + 0x0f,
lp->page_vaddr_algn,
virt_to_whatever(dev, lp->page_vaddr_algn));
if (mem_ptr_virt)
iounmap(mem_ptr_virt);
@ -860,7 +860,7 @@ static void hp100_hwinit(struct net_device *dev)
/* Next comes code from mmuinit procedure of SCO BM driver which is
* called from HWconfigure in the SCO driver. */
/* Initialise MMU, eventually switch on Busmaster Mode, initialise
/* Initialise MMU, eventually switch on Busmaster Mode, initialise
* multicast filter...
*/
hp100_mmuinit(dev);
@ -878,11 +878,11 @@ static void hp100_hwinit(struct net_device *dev)
hp100_login_to_vg_hub(dev, 0); /* relogin */
}
/*
/*
* mmuinit - Reinitialise Cascade MMU and MAC settings.
* Note: Must already be in reset and leaves card in reset.
* Note: Must already be in reset and leaves card in reset.
*/
static void hp100_mmuinit(struct net_device *dev)
{
@ -908,7 +908,7 @@ static void hp100_mmuinit(struct net_device *dev)
hp100_outw(0xffff, IRQ_STATUS); /* ack IRQ */
/*
* Enable Hardware
* Enable Hardware
* - Clear Debug En, Rx Hdr Pipe, EE En, I/O En, Fake Int and Intr En
* - Set Tri-State Int, Bus Master Rd/Wr, and Mem Map Disable
* - Clear Priority, Advance Pkt and Xmit Cmd
@ -983,7 +983,7 @@ static void hp100_mmuinit(struct net_device *dev)
* 4 bytes for header). We will leave NUM_RXPDLS * 508 (rounded
* to the next higher 1k boundary) bytes for the rx-pdl's
* Note: For non-etr chips the transmit stop register must be
* programmed on a 1k boundary, i.e. bits 9:0 must be zero.
* programmed on a 1k boundary, i.e. bits 9:0 must be zero.
*/
pdl_stop = lp->memory_size;
xmit_stop = (pdl_stop - 508 * (MAX_RX_PDL) - 16) & ~(0x03ff);
@ -1131,10 +1131,10 @@ static int hp100_close(struct net_device *dev)
return 0;
}
/*
* Configure the PDL Rx rings and LAN
* Configure the PDL Rx rings and LAN
*/
static void hp100_init_pdls(struct net_device *dev)
{
@ -1182,7 +1182,7 @@ static void hp100_init_pdls(struct net_device *dev)
}
}
}
/* These functions "format" the entries in the pdl structure */
/* They return how much memory the fragments need. */
@ -1200,10 +1200,10 @@ static int hp100_init_rxpdl(struct net_device *dev,
ringptr->pdl_paddr = virt_to_whatever(dev, pdlptr + 1);
ringptr->skb = (void *) NULL;
/*
/*
* Write address and length of first PDL Fragment (which is used for
* storing the RX-Header
* We use the 4 bytes _before_ the PDH in the pdl memory area to
* We use the 4 bytes _before_ the PDH in the pdl memory area to
* store this information. (PDH is at offset 0x04)
*/
/* Note that pdlptr+1 and not pdlptr is the pointer to the PDH */
@ -1230,9 +1230,9 @@ static int hp100_init_txpdl(struct net_device *dev,
}
/*
* hp100_build_rx_pdl allocates an skb_buff of maximum size plus two bytes
* hp100_build_rx_pdl allocates an skb_buff of maximum size plus two bytes
* for possible odd word alignment rounding up to next dword and set PDL
* address for fragment#2
* address for fragment#2
* Returns: 0 if unable to allocate skb_buff
* 1 if successful
*/
@ -1252,13 +1252,13 @@ static int hp100_build_rx_pdl(hp100_ring_t * ringptr,
#endif
/* Allocate skb buffer of maximum size */
/* Note: This depends on the alloc_skb functions allocating more
/* Note: This depends on the alloc_skb functions allocating more
* space than requested, i.e. aligning to 16bytes */
ringptr->skb = dev_alloc_skb(((MAX_ETHER_SIZE + 2 + 3) / 4) * 4);
if (NULL != ringptr->skb) {
/*
/*
* Reserve 2 bytes at the head of the buffer to land the IP header
* on a long word boundary (According to the Network Driver section
* in the Linux KHG, this should help to increase performance.)
@ -1270,10 +1270,10 @@ static int hp100_build_rx_pdl(hp100_ring_t * ringptr,
/* ringptr->pdl points to the beginning of the PDL, i.e. the PDH */
/* Note: 1st Fragment is used for the 4 byte packet status
* (receive header). Its PDL entries are set up by init_rxpdl. So
* (receive header). Its PDL entries are set up by init_rxpdl. So
* here we only have to set up the PDL fragment entries for the data
* part. Those 4 bytes will be stored in the DMA memory region
* directly before the PDL.
* part. Those 4 bytes will be stored in the DMA memory region
* directly before the PDL.
*/
#ifdef HP100_DEBUG_BM
printk("hp100: %s: build_rx_pdl: PDH@0x%x, skb->data (len %d) at 0x%x\n",
@ -1285,7 +1285,7 @@ static int hp100_build_rx_pdl(hp100_ring_t * ringptr,
/* Conversion to new PCI API : map skbuf data to PCI bus.
* Doc says it's OK for EISA as well - Jean II */
ringptr->pdl[0] = 0x00020000; /* Write PDH */
ringptr->pdl[3] = pdl_map_data(netdev_priv(dev),
ringptr->pdl[3] = pdl_map_data(netdev_priv(dev),
ringptr->skb->data);
ringptr->pdl[4] = MAX_ETHER_SIZE; /* Length of Data */
@ -1406,7 +1406,7 @@ static void hp100_BM_shutdown(struct net_device *dev)
}
} else { /* Shasta or Rainier Shutdown/Reset */
/* To ensure all bus master inloading activity has ceased,
* wait for no Rx PDAs or no Rx packets on card.
* wait for no Rx PDAs or no Rx packets on card.
*/
hp100_page(PERFORMANCE);
/* 100 ms timeout */
@ -1422,7 +1422,7 @@ static void hp100_BM_shutdown(struct net_device *dev)
/* To ensure all bus master outloading activity has ceased,
* wait until the Tx PDA count goes to zero or no more Tx space
* available in the Tx region of the card.
* available in the Tx region of the card.
*/
/* 100 ms timeout */
for (time = 0; time < 10000; time++) {
@ -1461,7 +1461,7 @@ static int hp100_check_lan(struct net_device *dev)
return 0;
}
/*
/*
* transmit functions
*/
@ -1485,7 +1485,7 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev)
if (skb->len <= 0)
return 0;
if (lp->chip == HP100_CHIPID_SHASTA && skb_padto(skb, ETH_ZLEN))
return 0;
@ -1575,14 +1575,14 @@ static int hp100_start_xmit_bm(struct sk_buff *skb, struct net_device *dev)
return 0;
}
/* clean_txring checks if packets have been sent by the card by reading
* the TX_PDL register from the performance page and comparing it to the
* number of commited packets. It then frees the skb's of the packets that
* obviously have been sent to the network.
*
* Needs the PERFORMANCE page selected.
* Needs the PERFORMANCE page selected.
*/
static void hp100_clean_txring(struct net_device *dev)
{
@ -1743,15 +1743,15 @@ static int hp100_start_xmit(struct sk_buff *skb, struct net_device *dev)
return 0;
}
/*
* Receive Function (Non-Busmaster mode)
* Called when an "Receive Packet" interrupt occurs, i.e. the receive
* Called when an "Receive Packet" interrupt occurs, i.e. the receive
* packet counter is non-zero.
* For non-busmaster, this function does the whole work of transfering
* the packet to the host memory and then up to higher layers via skb
* and netif_rx.
* and netif_rx.
*/
static void hp100_rx(struct net_device *dev)
@ -1854,7 +1854,7 @@ static void hp100_rx(struct net_device *dev)
#endif
}
/*
/*
* Receive Function for Busmaster Mode
*/
static void hp100_rx_bm(struct net_device *dev)
@ -1875,7 +1875,7 @@ static void hp100_rx_bm(struct net_device *dev)
printk("hp100: %s: rx_bm called although no PDLs were committed to adapter?\n", dev->name);
return;
} else
/* RX_PKT_CNT states how many PDLs are currently formatted and available to
/* RX_PKT_CNT states how many PDLs are currently formatted and available to
* the cards BM engine */
if ((hp100_inw(RX_PKT_CNT) & 0x00ff) >= lp->rxrcommit) {
printk("hp100: %s: More packets received than commited? RX_PKT_CNT=0x%x, commit=0x%x\n",
@ -1888,7 +1888,7 @@ static void hp100_rx_bm(struct net_device *dev)
while ((lp->rxrcommit > hp100_inb(RX_PDL))) {
/*
* The packet was received into the pdl pointed to by lp->rxrhead (
* the oldest pdl in the ring
* the oldest pdl in the ring
*/
/* First we get the header, which contains information about the */
@ -2043,7 +2043,7 @@ static void hp100_clear_stats(struct hp100_private *lp, int ioaddr)
hp100_page(PERFORMANCE);
spin_unlock_irqrestore(&lp->lock, flags);
}
/*
* multicast setup
@ -2220,9 +2220,9 @@ static irqreturn_t hp100_interrupt(int irq, void *dev_id, struct pt_regs *regs)
/* We're only interested in those interrupts we really enabled. */
/* val &= hp100_inw( IRQ_MASK ); */
/*
* RX_PDL_FILL_COMPL is set whenever a RX_PDL has been executed. A RX_PDL
* is considered executed whenever the RX_PDL data structure is no longer
/*
* RX_PDL_FILL_COMPL is set whenever a RX_PDL has been executed. A RX_PDL
* is considered executed whenever the RX_PDL data structure is no longer
* needed.
*/
if (val & HP100_RX_PDL_FILL_COMPL) {
@ -2233,7 +2233,7 @@ static irqreturn_t hp100_interrupt(int irq, void *dev_id, struct pt_regs *regs)
}
}
/*
/*
* The RX_PACKET interrupt is set, when the receive packet counter is
* non zero. We use this interrupt for receiving in slave mode. In
* busmaster mode, we use it to make sure we did not miss any rx_pdl_fill
@ -2259,10 +2259,10 @@ static irqreturn_t hp100_interrupt(int irq, void *dev_id, struct pt_regs *regs)
hp100_outw(val, IRQ_STATUS);
/*
* RX_ERROR is set when a packet is dropped due to no memory resources on
* the card or when a RCV_ERR occurs.
* TX_ERROR is set when a TX_ABORT condition occurs in the MAC->exists
* only in the 802.3 MAC and happens when 16 collisions occur during a TX
* RX_ERROR is set when a packet is dropped due to no memory resources on
* the card or when a RCV_ERR occurs.
* TX_ERROR is set when a TX_ABORT condition occurs in the MAC->exists
* only in the 802.3 MAC and happens when 16 collisions occur during a TX
*/
if (val & (HP100_TX_ERROR | HP100_RX_ERROR)) {
#ifdef HP100_DEBUG_IRQ
@ -2275,20 +2275,20 @@ static irqreturn_t hp100_interrupt(int irq, void *dev_id, struct pt_regs *regs)
}
}
/*
* RX_PDA_ZERO is set when the PDA count goes from non-zero to zero.
/*
* RX_PDA_ZERO is set when the PDA count goes from non-zero to zero.
*/
if ((lp->mode == 1) && (val & (HP100_RX_PDA_ZERO)))
hp100_rxfill(dev);
/*
* HP100_TX_COMPLETE interrupt occurs when packet transmitted on wire
* is completed
/*
* HP100_TX_COMPLETE interrupt occurs when packet transmitted on wire
* is completed
*/
if ((lp->mode == 1) && (val & (HP100_TX_COMPLETE)))
hp100_clean_txring(dev);
/*
/*
* MISC_ERROR is set when either the LAN link goes down or a detected
* bus error occurs.
*/
@ -2471,12 +2471,12 @@ static int hp100_sense_lan(struct net_device *dev)
/* Those cards don't have a 100 Mbit connector */
if ( !strcmp(lp->id, "HWP1920") ||
(lp->pci_dev &&
lp->pci_dev->vendor == PCI_VENDOR_ID &&
(lp->pci_dev &&
lp->pci_dev->vendor == PCI_VENDOR_ID &&
(lp->pci_dev->device == PCI_DEVICE_ID_HP_J2970A ||
lp->pci_dev->device == PCI_DEVICE_ID_HP_J2973A)))
return HP100_LAN_ERR;
if (val_VG & HP100_LINK_CABLE_ST) /* Can hear the HUBs tone. */
return HP100_LAN_100;
return HP100_LAN_ERR;
@ -2822,8 +2822,8 @@ static void cleanup_dev(struct net_device *d)
release_region(d->base_addr, HP100_REGION_SIZE);
if (p->mode == 1) /* busmaster */
pci_free_consistent(p->pci_dev, MAX_RINGSIZE + 0x0f,
p->page_vaddr_algn,
pci_free_consistent(p->pci_dev, MAX_RINGSIZE + 0x0f,
p->page_vaddr_algn,
virt_to_whatever(d, p->page_vaddr_algn));
if (p->mem_ptr_virt)
iounmap(p->mem_ptr_virt);
@ -2849,7 +2849,7 @@ static int __init hp100_eisa_probe (struct device *gendev)
goto out1;
#ifdef HP100_DEBUG
printk("hp100: %s: EISA adapter found at 0x%x\n", dev->name,
printk("hp100: %s: EISA adapter found at 0x%x\n", dev->name,
dev->base_addr);
#endif
gendev->driver_data = dev;
@ -2913,12 +2913,12 @@ static int __devinit hp100_pci_probe (struct pci_dev *pdev,
pci_command |= PCI_COMMAND_MASTER;
pci_write_config_word(pdev, PCI_COMMAND, pci_command);
}
ioaddr = pci_resource_start(pdev, 0);
err = hp100_probe1(dev, ioaddr, HP100_BUS_PCI, pdev);
if (err)
if (err)
goto out1;
#ifdef HP100_DEBUG
printk("hp100: %s: PCI adapter found at 0x%x\n", dev->name, ioaddr);
#endif
@ -3003,7 +3003,7 @@ static int __init hp100_isa_init(void)
return cards > 0 ? 0 : -ENODEV;
}
static void __exit hp100_isa_cleanup(void)
static void __exit hp100_isa_cleanup(void)
{
int i;
@ -3027,12 +3027,12 @@ static int __init hp100_module_init(void)
goto out;
#ifdef CONFIG_EISA
err = eisa_driver_register(&hp100_eisa_driver);
if (err && err != -ENODEV)
if (err && err != -ENODEV)
goto out2;
#endif
#ifdef CONFIG_PCI
err = pci_module_init(&hp100_pci_driver);
if (err && err != -ENODEV)
if (err && err != -ENODEV)
goto out3;
#endif
out:

Просмотреть файл

@ -8,9 +8,9 @@
*
* This driver is based on the 'hpfepkt' crynwr packet driver.
*
* This source/code is public free; you can distribute it and/or modify
* This source/code is public free; you can distribute it and/or modify
* it under terms of the GNU General Public License (published by the
* Free Software Foundation) either version two of this License, or any
* Free Software Foundation) either version two of this License, or any
* later version.
*/
@ -18,7 +18,7 @@
* Hardware Constants
****************************************************************************/
/*
/*
* Page Identifiers
* (Swap Paging Register, PAGING, bits 3:0, Offset 0x02)
*/
@ -143,15 +143,15 @@
/* ------------------------------------------------------------------------ */
/*
/*
* Hardware ID Register I (Always available, HW_ID, Offset 0x00)
*/
#define HP100_HW_ID_CASCADE 0x4850 /* Identifies Cascade Chip */
/*
/*
* Hardware ID Register 2 & Paging Register
* (Always available, PAGING, Offset 0x02)
* Bits 15:4 are for the Chip ID
* Bits 15:4 are for the Chip ID
*/
#define HP100_CHIPID_MASK 0xFFF0
#define HP100_CHIPID_SHASTA 0x5350 /* Not 802.12 compliant */
@ -162,7 +162,7 @@
/* LRF supported */
/*
* Option Registers I and II
* Option Registers I and II
* (Always available, OPTION_LSW, Offset 0x04-0x05)
*/
#define HP100_DEBUG_EN 0x8000 /* 0:Dis., 1:Enable Debug Dump Ptr. */
@ -187,7 +187,7 @@
/* NIC reset on 0 to 1 transition */
/*
* Option Register III
* Option Register III
* (Always available, OPTION_MSW, Offset 0x06)
*/
#define HP100_PRIORITY_TX 0x0080 /* 1:Do all Tx pkts as priority */
@ -253,7 +253,7 @@
#define HP100_BM_PCI_8CLK 0x40 /* ... cycles 8 clocks apart */
/*
/*
* Mode Control Register I
* (Page HW_MAP, MODECTRL1, Offset0x10)
*/
@ -281,7 +281,7 @@
#define HP100_EN_BUS_FAIL 0x80 /* Enables bus-fail portion of misc */
/* interrupt */
/*
/*
* PCI Configuration and Control Register I
* (Page HW_MAP, PCICTRL1, Offset 0x12)
*/
@ -378,7 +378,7 @@
/*
* 100MB LAN Control and Configuration Register
* (Page MAC_CTRL, VG_LAN_CFG_1, Offset 0x0a)
* (Page MAC_CTRL, VG_LAN_CFG_1, Offset 0x0a)
*/
#define HP100_VG_SEL 0x80 /* 0:No, 1:Yes use 100 Mbit MAC */
#define HP100_LINK_UP_ST 0x40 /* 0:No, 1:Yes endnode logged in */
@ -422,7 +422,7 @@
#define HP100_MAC1MODE7 HP100_MAC1MODE6 | HP100_ACC_ERRORED
/*
* MAC Configuration Register II
* MAC Configuration Register II
* (Page MAC_CTRL, MAC_CFG_2, Offset 0x0d)
*/
#define HP100_TR_MODE 0x80 /* 0:No, 1:Yes support Token Ring formats */
@ -447,8 +447,8 @@
#define HP100_MAC2MODE7 KEEP_CRC
/*
* MAC Configuration Register III
* (Page MAC_CTRL, MAC_CFG_3, Offset 0x0e)
* MAC Configuration Register III
* (Page MAC_CTRL, MAC_CFG_3, Offset 0x0e)
*/
#define HP100_PACKET_PACE 0x03 /* Packet Pacing:
* 00: No packet pacing
@ -461,7 +461,7 @@
#define HP100_AUTO_MODE 0x10 /* 1: AutoSelect between 10/100 */
/*
* MAC Configuration Register IV
* MAC Configuration Register IV
* (Page MAC_CTRL, MAC_CFG_4, Offset 0x0f)
*/
#define HP100_MAC_SEL_ST 0x01 /* (R): Status of external VGSEL
@ -469,18 +469,18 @@
#define HP100_LINK_FAIL_ST 0x02 /* (R): Status of Link Fail portion
* of the Misc. Interrupt */
/*
* 100 MB LAN Training Request/Allowed Registers
/*
* 100 MB LAN Training Request/Allowed Registers
* (Page MAC_CTRL, TRAIN_REQUEST and TRAIN_ALLOW, Offset 0x14-0x16)(ETR parts only)
*/
#define HP100_MACRQ_REPEATER 0x0001 /* 1: MAC tells HUB it wants to be
#define HP100_MACRQ_REPEATER 0x0001 /* 1: MAC tells HUB it wants to be
* a cascaded repeater
* 0: ... wants to be a DTE */
#define HP100_MACRQ_PROMSC 0x0006 /* 2 bits: Promiscious mode
* 00: Rcv only unicast packets
* specifically addr to this
* endnode
* 10: Rcv all pckts fwded by
* 10: Rcv all pckts fwded by
* the local repeater */
#define HP100_MACRQ_FRAMEFMT_EITHER 0x0018 /* 11: either format allowed */
#define HP100_MACRQ_FRAMEFMT_802_3 0x0000 /* 00: 802.3 is requested */
@ -492,7 +492,7 @@
* 00: Rcv only unicast packets
* specifically addr to this
* endnode
* 10: Rcv all pckts fwded by
* 10: Rcv all pckts fwded by
* the local repeater */
#define HP100_MALLOW_FRAMEFMT 0x00e0 /* 2 bits: Frame Format
* 00: 802.3 format will be used
@ -521,7 +521,7 @@
#define HP100_LAN_COAX 9 /* lan_type value for Coax */
#define HP100_LAN_ERR (-1) /* lan_type value for link down */
/*
/*
* Bus Master Data Structures ----------------------------------------------
*/
@ -554,7 +554,7 @@ typedef struct hp100_ring {
#define HP100_PKT_LEN_MASK 0x1FFF /* AND with RxLength to get length */
/* Receive Packet Status. Note, the error bits are only valid if ACC_ERRORED
/* Receive Packet Status. Note, the error bits are only valid if ACC_ERRORED
bit in the MAC Configuration Register 1 is set. */
#define HP100_RX_PRI 0x8000 /* 0:No, 1:Yes packet is priority */
#define HP100_SDF_ERR 0x4000 /* 0:No, 1:Yes start of frame error */

Просмотреть файл

@ -45,12 +45,12 @@ struct hplance_private {
/* function prototypes... This is easy because all the grot is in the
* generic LANCE support. All we have to support is probing for boards,
* plus board-specific init, open and close actions.
* plus board-specific init, open and close actions.
* Oh, and we need to tell the generic code how to read and write LANCE registers...
*/
static int __devinit hplance_init_one(struct dio_dev *d,
const struct dio_device_id *ent);
static void __devinit hplance_init(struct net_device *dev,
static void __devinit hplance_init(struct net_device *dev,
struct dio_dev *d);
static void __devexit hplance_remove_one(struct dio_dev *d);
static void hplance_writerap(void *priv, unsigned short value);
@ -118,7 +118,7 @@ static void __init hplance_init(struct net_device *dev, struct dio_dev *d)
unsigned long va = (d->resource.start + DIO_VIRADDRBASE);
struct hplance_private *lp;
int i;
printk(KERN_INFO "%s: %s; select code %d, addr", dev->name, d->name, d->scode);
/* reset the board */
@ -136,7 +136,7 @@ static void __init hplance_init(struct net_device *dev, struct dio_dev *d)
dev->get_stats = &lance_get_stats;
dev->set_multicast_list = &lance_set_multicast;
dev->dma = 0;
for (i=0; i<6; i++) {
/* The NVRAM holds our ethernet address, one nibble per byte,
* at bytes NVRAMOFF+1,3,5,7,9...
@ -145,7 +145,7 @@ static void __init hplance_init(struct net_device *dev, struct dio_dev *d)
| (in_8(va + HPLANCE_NVRAMOFF + i*4 + 3) & 0xF);
printk("%c%2.2x", i == 0 ? ' ' : ':', dev->dev_addr[i]);
}
lp = netdev_priv(dev);
lp->lance.name = (char*)d->name; /* discards const, shut up gcc */
lp->lance.base = va;
@ -196,7 +196,7 @@ static int hplance_open(struct net_device *dev)
{
int status;
struct lance_private *lp = netdev_priv(dev);
status = lance_open(dev); /* call generic lance open code */
if (status)
return status;

Просмотреть файл

@ -1,4 +1,4 @@
/* drivers/net/ifb.c:
/* drivers/net/ifb.c:
The purpose of this driver is to provide a device that allows
for sharing of resources:
@ -8,8 +8,8 @@
an impression of sharing.
2) Allows for queueing incoming traffic for shaping instead of
dropping.
dropping.
The original concept is based on what is known as the IMQ
driver initially written by Martin Devera, later rewritten
by Patrick McHardy and then maintained by Andre Correa.
@ -21,9 +21,9 @@
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version
2 of the License, or (at your option) any later version.
Authors: Jamal Hadi Salim (2005)
*/
@ -33,10 +33,10 @@
#include <linux/etherdevice.h>
#include <linux/init.h>
#include <linux/moduleparam.h>
#include <net/pkt_sched.h>
#include <net/pkt_sched.h>
#define TX_TIMEOUT (2*HZ)
#define TX_Q_LIMIT 32
struct ifb_private {
struct net_device_stats stats;
@ -64,7 +64,7 @@ static struct net_device_stats *ifb_get_stats(struct net_device *dev);
static int ifb_open(struct net_device *dev);
static int ifb_close(struct net_device *dev);
static void ri_tasklet(unsigned long dev)
static void ri_tasklet(unsigned long dev)
{
struct net_device *_dev = (struct net_device *)dev;
@ -163,7 +163,7 @@ dropped:
stats->rx_dropped++;
return ret;
} else {
/*
/*
* note we could be going
* ingress -> egress or
* egress -> ingress
@ -199,7 +199,7 @@ static struct net_device_stats *ifb_get_stats(struct net_device *dev)
struct net_device_stats *stats = &dp->stats;
pr_debug("tasklets stats %ld:%ld:%ld:%ld:%ld:%ld:%ld:%ld:%ld \n",
dp->st_task_enter, dp->st_txq_refl_try, dp->st_rxq_enter,
dp->st_task_enter, dp->st_txq_refl_try, dp->st_rxq_enter,
dp->st_rx2tx_tran dp->st_rxq_notenter, dp->st_rx_frm_egr,
dp->st_rx_frm_ing, dp->st_rxq_check, dp->st_rxq_rsch );
@ -250,7 +250,7 @@ static int __init ifb_init_one(int index)
free_netdev(dev_ifb);
dev_ifb = NULL;
} else {
ifbs[index] = dev_ifb;
ifbs[index] = dev_ifb;
}
return err;
@ -260,32 +260,32 @@ static void ifb_free_one(int index)
{
unregister_netdev(ifbs[index]);
free_netdev(ifbs[index]);
}
}
static int __init ifb_init_module(void)
{
{
int i, err = 0;
ifbs = kmalloc(numifbs * sizeof(void *), GFP_KERNEL);
ifbs = kmalloc(numifbs * sizeof(void *), GFP_KERNEL);
if (!ifbs)
return -ENOMEM;
return -ENOMEM;
for (i = 0; i < numifbs && !err; i++)
err = ifb_init_one(i);
if (err) {
err = ifb_init_one(i);
if (err) {
i--;
while (--i >= 0)
ifb_free_one(i);
}
return err;
}
}
static void __exit ifb_cleanup_module(void)
{
int i;
for (i = 0; i < numifbs; i++)
ifb_free_one(i);
kfree(ifbs);
for (i = 0; i < numifbs; i++)
ifb_free_one(i);
kfree(ifbs);
}
module_init(ifb_init_module);

Просмотреть файл

@ -149,7 +149,7 @@ static int __init do_netcard_probe(struct net_device *dev)
return -ENODEV;
}
static void cleanup_card(struct net_device *dev)
{
#ifdef jumpered_dma
@ -200,10 +200,10 @@ static int __init netcard_probe1(struct net_device *dev, int ioaddr)
return -EBUSY;
/*
* For ethernet adaptors the first three octets of the station address
* For ethernet adaptors the first three octets of the station address
* contains the manufacturer's unique code. That might be a good probe
* method. Ideally you would add additional checks.
*/
*/
if (inb(ioaddr + 0) != SA_ADDR0
|| inb(ioaddr + 1) != SA_ADDR1
|| inb(ioaddr + 2) != SA_ADDR2)
@ -292,7 +292,7 @@ static int __init netcard_probe1(struct net_device *dev, int ioaddr)
if (i <= 0) {
printk("DMA probe failed.\n");
goto out1;
}
}
if (request_dma(dev->dma, cardname)) {
printk("probed DMA %d allocation failed.\n", dev->dma);
goto out1;
@ -310,7 +310,7 @@ static int __init netcard_probe1(struct net_device *dev, int ioaddr)
dev->set_multicast_list = &set_multicast_list;
dev->tx_timeout = &net_tx_timeout;
dev->watchdog_timeo = MY_TX_TIMEOUT;
dev->watchdog_timeo = MY_TX_TIMEOUT;
err = register_netdev(dev);
if (err)
@ -551,7 +551,7 @@ net_rx(struct net_device *dev)
do {
int status = inw(ioaddr);
int pkt_len = inw(ioaddr);
if (pkt_len == 0) /* Read all the frames? */
break; /* Done for now */
@ -566,7 +566,7 @@ net_rx(struct net_device *dev)
struct sk_buff *skb;
lp->stats.rx_bytes+=pkt_len;
skb = dev_alloc_skb(pkt_len);
if (skb == NULL) {
printk(KERN_NOTICE "%s: Memory squeeze, dropping packet.\n",
@ -663,7 +663,7 @@ set_multicast_list(struct net_device *dev)
outw(MULTICAST, ioaddr);
}
else
else
outw(0, ioaddr);
}

Просмотреть файл

@ -7,10 +7,10 @@
* dhd's support for 16-bit cards.
*
* (C) 1996,1998 by Thomas Bogendoerfer (tsbogend@alpha.franken.de)
*
*
* This driver is based on work from Andreas Busse, but most of
* the code is rewritten.
*
*
* (C) 1995 by Andreas Busse (andy@waldorf-gmbh.de)
*
* A driver for the onboard Sonic ethernet controller on Mips Jazz
@ -65,7 +65,7 @@ do { \
/* use 0 for production, 1 for verification, >1 for debug */
#ifdef SONIC_DEBUG
static unsigned int sonic_debug = SONIC_DEBUG;
#else
#else
static unsigned int sonic_debug = 1;
#endif
@ -80,7 +80,7 @@ static struct {
/*
* We cannot use station (ethernet) address prefixes to detect the
* sonic controller since these are board manufacturer depended.
* So we check for known Silicon Revision IDs instead.
* So we check for known Silicon Revision IDs instead.
*/
static unsigned short known_revisions[] =
{
@ -119,7 +119,7 @@ static int __init sonic_probe1(struct net_device *dev)
silicon_revision);
goto out;
}
if (sonic_debug && version_printed++ == 0)
printk(version);
@ -138,7 +138,7 @@ static int __init sonic_probe1(struct net_device *dev)
}
err = -ENOMEM;
/* Initialize the device structure. */
lp->dma_bitmode = SONIC_BITMODE32;

Просмотреть файл

@ -19,7 +19,7 @@
- alignment problem with 1.3.* kernel and some minor changes.
Thomas Bogendoerfer (tsbogend@bigbug.franken.de):
- added support for Linux/Alpha, but removed most of it, because
it worked only for the PCI chip.
it worked only for the PCI chip.
- added hook for the 32bit lance driver
- added PCnetPCI II (79C970A) to chip table
Paul Gortmaker (gpg109@rsphy1.anu.edu.au):
@ -31,7 +31,7 @@
before unregister_netdev() which caused NULL pointer
reference later in the chain (in rtnetlink_fill_ifinfo())
-- Mika Kuoppala <miku@iki.fi>
Forward ported v1.14 to 2.1.129, merged the PCI and misc changes from
the 2.1 version of the old driver - Alan Cox
@ -307,7 +307,7 @@ static struct net_device_stats *lance_get_stats(struct net_device *dev);
static void set_multicast_list(struct net_device *dev);
static void lance_tx_timeout (struct net_device *dev);
#ifdef MODULE
#define MAX_CARDS 8 /* Max number of interfaces (cards) per module */
@ -374,7 +374,7 @@ void cleanup_module(void)
for (this_dev = 0; this_dev < MAX_CARDS; this_dev++) {
struct net_device *dev = dev_lance[this_dev];
if (dev) {
unregister_netdev(dev);
unregister_netdev(dev);
cleanup_card(dev);
free_netdev(dev);
}
@ -531,7 +531,7 @@ static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, int
dev->base_addr = ioaddr;
/* Make certain the data structures used by the LANCE are aligned and DMAble. */
lp = kmalloc(sizeof(*lp), GFP_DMA | GFP_KERNEL);
if(lp==NULL)
return -ENODEV;
@ -656,7 +656,7 @@ static int __init lance_probe1(struct net_device *dev, int ioaddr, int irq, int
outw(0x7f04, ioaddr+LANCE_DATA); /* Clear the memory error bits. */
if (request_dma(dma, chipname))
continue;
flags=claim_dma_lock();
set_dma_mode(dma, DMA_MODE_CASCADE);
enable_dma(dma);
@ -737,7 +737,7 @@ out_lp:
return err;
}
static int
lance_open(struct net_device *dev)
{
@ -801,7 +801,7 @@ lance_open(struct net_device *dev)
while (i++ < 100)
if (inw(ioaddr+LANCE_DATA) & 0x0100)
break;
/*
/*
* We used to clear the InitDone bit, 0x0100, here but Mark Stockton
* reports that doing so triggers a bug in the '974.
*/
@ -826,7 +826,7 @@ lance_open(struct net_device *dev)
restarting the chip, but I'm too lazy to do so right now. dplatt@3do.com
*/
static void
static void
lance_purge_ring(struct net_device *dev)
{
struct lance_private *lp = dev->priv;
@ -972,7 +972,7 @@ static int lance_start_xmit(struct sk_buff *skb, struct net_device *dev)
goto out;
lp->tx_ring[entry].length = -ETH_ZLEN;
}
else
else
lp->tx_ring[entry].length = -skb->len;
} else
lp->tx_ring[entry].length = -skb->len;
@ -1027,7 +1027,7 @@ lance_interrupt(int irq, void *dev_id, struct pt_regs * regs)
ioaddr = dev->base_addr;
lp = dev->priv;
spin_lock (&lp->devlock);
outw(0x00, dev->base_addr + LANCE_ADDR);
@ -1051,7 +1051,7 @@ lance_interrupt(int irq, void *dev_id, struct pt_regs * regs)
while (dirty_tx < lp->cur_tx) {
int entry = dirty_tx & TX_RING_MOD_MASK;
int status = lp->tx_ring[entry].base;
if (status < 0)
break; /* It still hasn't been Txed */
@ -1142,7 +1142,7 @@ lance_rx(struct net_device *dev)
struct lance_private *lp = dev->priv;
int entry = lp->cur_rx & RX_RING_MOD_MASK;
int i;
/* If we own the next entry, it's a new packet. Send it up. */
while (lp->rx_ring[entry].base >= 0) {
int status = lp->rx_ring[entry].base >> 24;
@ -1160,12 +1160,12 @@ lance_rx(struct net_device *dev)
if (status & 0x04) lp->stats.rx_fifo_errors++;
lp->rx_ring[entry].base &= 0x03ffffff;
}
else
else
{
/* Malloc up new buffer, compatible with net3. */
short pkt_len = (lp->rx_ring[entry].msg_length & 0xfff)-4;
struct sk_buff *skb;
if(pkt_len<60)
{
printk("%s: Runt packet!\n",dev->name);
@ -1174,14 +1174,14 @@ lance_rx(struct net_device *dev)
else
{
skb = dev_alloc_skb(pkt_len+2);
if (skb == NULL)
if (skb == NULL)
{
printk("%s: Memory squeeze, deferring packet.\n", dev->name);
for (i=0; i < RX_RING_SIZE; i++)
if (lp->rx_ring[(entry+i) & RX_RING_MOD_MASK].base < 0)
break;
if (i > RX_RING_SIZE -2)
if (i > RX_RING_SIZE -2)
{
lp->stats.rx_dropped++;
lp->rx_ring[entry].base |= 0x80000000;

Просмотреть файл

@ -5,14 +5,14 @@
but there were too many hoops which HP wants jumped through to
keep this code in there in a sane manner.
3 primary sources of the mess --
3 primary sources of the mess --
1) hppa needs *lots* of cacheline flushing to keep this kind of
MMIO running.
2) The 82596 needs to see all of its pointers as their physical
address. Thus virt_to_bus/bus_to_virt are *everywhere*.
3) The implementation HP is using seems to be significantly pickier
3) The implementation HP is using seems to be significantly pickier
about when and how the command and RX units are started. some
command ordering was changed.
@ -21,7 +21,7 @@
full rewrite can be my guest.
Split 02/13/2000 Sam Creasey (sammy@oh.verio.com)
02/01/2000 Initial modifications for parisc by Helge Deller (deller@gmx.de)
03/02/2000 changes for better/correct(?) cache-flushing (deller)
*/
@ -172,7 +172,7 @@
#define PORT_ALTSCP 0x02 /* alternate SCB address */
#define PORT_ALTDUMP 0x03 /* Alternate DUMP address */
static int i596_debug = (DEB_SERIOUS|DEB_PROBE);
static int i596_debug = (DEB_SERIOUS|DEB_PROBE);
MODULE_AUTHOR("Richard Hirst");
MODULE_DESCRIPTION("i82596 driver");
@ -265,9 +265,9 @@ struct tx_cmd {
dma_addr_t dma_addr;
#ifdef __LP64__
u32 cache_pad[6]; /* Total 64 bytes... */
#else
#else
u32 cache_pad[1]; /* Total 32 bytes... */
#endif
#endif
};
struct tdr_cmd {
@ -301,9 +301,9 @@ struct i596_rfd {
unsigned short size;
struct i596_rfd *v_next; /* Address from CPUs viewpoint */
struct i596_rfd *v_prev;
#ifndef __LP64__
#ifndef __LP64__
u32 cache_pad[2]; /* Total 32 bytes... */
#endif
#endif
};
struct i596_rbd {
@ -322,7 +322,7 @@ struct i596_rbd {
/* Total 32 bytes... */
#ifdef __LP64__
u32 cache_pad[4];
#endif
#endif
};
/* These values as chosen so struct i596_private fits in one page... */
@ -605,7 +605,7 @@ static inline void remove_rx_bufs(struct net_device *dev)
if (rbd->skb == NULL)
break;
dma_unmap_single(lp->dev,
(dma_addr_t)WSWAPchar(rbd->b_data),
(dma_addr_t)WSWAPchar(rbd->b_data),
PKT_BUF_SZ, DMA_FROM_DEVICE);
dev_kfree_skb(rbd->skb);
}
@ -643,7 +643,7 @@ static int init_i596_mem(struct net_device *dev)
printk("RESET 82596 port: %lx (with IRQ %d disabled)\n",
(dev->base_addr + PA_I82596_RESET),
dev->irq));
gsc_writel(0, (dev->base_addr + PA_I82596_RESET)); /* Hard Reset */
udelay(100); /* Wait 100us - seems to help */
@ -666,7 +666,7 @@ static int init_i596_mem(struct net_device *dev)
CHECK_WBACK(&(lp->scp), sizeof(struct i596_scp));
CHECK_WBACK(&(lp->iscp), sizeof(struct i596_iscp));
MPU_PORT(dev, PORT_ALTSCP, virt_to_dma(lp,&lp->scp));
MPU_PORT(dev, PORT_ALTSCP, virt_to_dma(lp,&lp->scp));
CA(dev);
@ -755,7 +755,7 @@ static inline int i596_rx(struct net_device *dev)
}
DEB(DEB_RXFRAME, printk(" rfd %p, rfd.rbd %08x, rfd.stat %04x\n",
rfd, rfd->rbd, rfd->stat));
if (rbd != NULL && ((rfd->stat) & STAT_OK)) {
/* a good frame */
int pkt_len = rbd->count & 0x3fff;
@ -996,7 +996,7 @@ static int i596_test(struct net_device *dev)
tint = (volatile int *)(&(lp->scp));
data = virt_to_dma(lp,tint);
tint[1] = -1;
CHECK_WBACK(tint,PAGE_SIZE);
@ -1087,7 +1087,7 @@ static int i596_start_xmit(struct sk_buff *skb, struct net_device *dev)
return 0;
length = ETH_ZLEN;
}
netif_stop_queue(dev);
tx_cmd = lp->tx_cmds + lp->next_tx_cmd;
@ -1194,7 +1194,7 @@ static int __devinit i82596_probe(struct net_device *dev,
printk(KERN_INFO "%s: MAC of HP700 LAN read from EEPROM\n", __FILE__);
}
dev->mem_start = (unsigned long) dma_alloc_noncoherent(gen_dev,
dev->mem_start = (unsigned long) dma_alloc_noncoherent(gen_dev,
sizeof(struct i596_private), &dma_addr, GFP_KERNEL);
if (!dev->mem_start) {
printk(KERN_ERR "%s: Couldn't get shared memory\n", __FILE__);
@ -1233,7 +1233,7 @@ static int __devinit i82596_probe(struct net_device *dev,
i = register_netdev(dev);
if (i) {
lp = dev->priv;
dma_free_noncoherent(lp->dev, sizeof(struct i596_private),
dma_free_noncoherent(lp->dev, sizeof(struct i596_private),
(void *)dev->mem_start, lp->dma_addr);
return i;
};
@ -1400,7 +1400,7 @@ static irqreturn_t i596_interrupt(int irq, void *dev_id, struct pt_regs *regs)
CHECK_WBACK(&lp->scb, sizeof(struct i596_scb));
/* DANGER: I suspect that some kind of interrupt
acknowledgement aside from acking the 82596 might be needed
acknowledgement aside from acking the 82596 might be needed
here... but it's running acceptably without */
CA(dev);
@ -1498,7 +1498,7 @@ static void set_multicast_list(struct net_device *dev)
printk("%s: Only %d multicast addresses supported",
dev->name, cnt);
}
if (dev->mc_count > 0) {
struct dev_mc_list *dmi;
unsigned char *cp;
@ -1539,7 +1539,7 @@ lan_init_chip(struct parisc_device *dev)
if (num_drivers == 0)
printk(KERN_INFO LASI_82596_DRIVER_VERSION "\n");
if (!dev->irq) {
printk(KERN_ERR "%s: IRQ not found for i82596 at 0x%lx\n",
__FILE__, dev->hpa.start);
@ -1602,15 +1602,15 @@ static void __exit lasi_82596_exit(void)
for (i=0; i<MAX_DRIVERS; i++) {
struct i596_private *lp;
struct net_device *netdevice;
netdevice = netdevs[i];
if (!netdevice)
if (!netdevice)
continue;
unregister_netdev(netdevice);
lp = netdevice->priv;
dma_free_noncoherent(lp->dev, sizeof(struct i596_private),
dma_free_noncoherent(lp->dev, sizeof(struct i596_private),
(void *)netdevice->mem_start, lp->dma_addr);
free_netdev(netdevice);
}

Просмотреть файл

@ -188,7 +188,7 @@ static int __init lne390_probe1(struct net_device *dev, int ioaddr)
}
revision = (eisa_id >> 24) & 0x01; /* 0 = rev A, 1 rev B */
#if 0
/* Check the Mylex vendor ID as well. Not really required. */
if (inb(ioaddr + LNE390_SA_PROM + 0) != LNE390_ADDR0
@ -341,7 +341,7 @@ lne390_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr, int ring_
hdr->count = (hdr->count + 3) & ~3; /* Round up allocation. */
}
/*
/*
* Block input and output are easy on shared memory ethercards, the only
* complication is when the ring buffer wraps. The count will already
* be rounded up to a doubleword value via lne390_get_8390_hdr() above.

Просмотреть файл

@ -181,7 +181,7 @@ static struct net_device_stats *get_stats(struct net_device *dev)
stats->rx_packets += lb_stats->rx_packets;
stats->tx_packets += lb_stats->tx_packets;
}
return stats;
}
@ -230,7 +230,7 @@ int __init loopback_init(void)
loopback_dev.priv = stats;
loopback_dev.get_stats = &get_stats;
}
return register_netdev(&loopback_dev);
};

Просмотреть файл

@ -277,7 +277,7 @@ struct i596_rbd {
phys_addr pa_next; /* va_to_pa(struct i596_tbd *next) */
phys_addr pa_data; /* va_to_pa(char *data) */
phys_addr pa_prev; /* va_to_pa(struct i596_tbd *prev) */
/* Driver private part */
struct sk_buff *skb;
};
@ -647,7 +647,7 @@ init_i596(struct net_device *dev) {
CA();
barrier();
if (lp->scb.command && i596_timeout(dev, "Receive Unit start", 100))
return 1;
@ -676,7 +676,7 @@ i596_rx_one(struct net_device *dev, struct i596_private *lp,
return 1;
}
skb->dev = dev;
skb->dev = dev;
memcpy(skb_put(skb,pkt_len), rfd->data, pkt_len);
skb->protocol = eth_type_trans(skb,dev);
@ -797,7 +797,7 @@ static void i596_reset(struct net_device *dev, struct i596_private *lp, int ioad
lp->scb.command = CUC_ABORT | RX_ABORT;
CA();
barrier();
/* wait for shutdown */
if (lp->scb.command && i596_timeout(dev, "i596_reset(2)", 400))
;
@ -820,7 +820,7 @@ static void i596_add_cmd(struct net_device *dev, struct i596_cmd *cmd) {
cmd->pa_next = I596_NULL;
spin_lock_irqsave(&lp->cmd_lock, flags);
if (lp->cmd_head) {
lp->cmd_tail->pa_next = va_to_pa(cmd);
} else {
@ -847,7 +847,7 @@ static void i596_add_cmd(struct net_device *dev, struct i596_cmd *cmd) {
}
}
static int i596_open(struct net_device *dev)
static int i596_open(struct net_device *dev)
{
int i;
@ -875,13 +875,13 @@ static int i596_start_xmit (struct sk_buff *skb, struct net_device *dev) {
short length;
length = skb->len;
if (length < ETH_ZLEN) {
if (skb_padto(skb, ETH_ZLEN))
return 0;
length = ETH_ZLEN;
}
dev->trans_start = jiffies;
tx_cmd = (struct tx_cmd *) kmalloc ((sizeof (struct tx_cmd) + sizeof (struct i596_tbd)), GFP_ATOMIC);
@ -941,7 +941,7 @@ i596_tx_timeout (struct net_device *dev) {
netif_wake_queue(dev);
}
static void print_eth(char *add)
static void print_eth(char *add)
{
int i;
@ -978,7 +978,7 @@ static int __init lp486e_probe(struct net_device *dev) {
lp = (struct i596_private *) dev->priv;
spin_lock_init(&lp->cmd_lock);
/*
* Do we really have this thing?
*/
@ -1132,7 +1132,7 @@ i596_handle_CU_completion(struct net_device *dev,
default:
cmd->pa_next = I596_NULL;
lp->last_cmd = jiffies;
}
barrier();
}

Просмотреть файл

@ -7,12 +7,12 @@
This software may be used and distributed according to the terms of
the GNU Public License, incorporated herein by reference. */
/* 2000-02-28: support added for Dayna and Kinetics cards by
/* 2000-02-28: support added for Dayna and Kinetics cards by
A.G.deWijn@phys.uu.nl */
/* 2000-04-04: support added for Dayna2 by bart@etpmod.phys.tue.nl */
/* 2001-04-18: support for DaynaPort E/LC-M by rayk@knightsmanor.org */
/* 2001-05-15: support for Cabletron ported from old daynaport driver
* and fixed access to Sonic Sys card which masquerades as a Farallon
* and fixed access to Sonic Sys card which masquerades as a Farallon
* by rayk@knightsmanor.org */
#include <linux/module.h>
@ -55,7 +55,7 @@
#define KINETICS_8390_BASE 0x80000
#define KINETICS_8390_MEM 0x00000
#define CABLETRON_8390_BASE 0x90000
#define CABLETRON_8390_BASE 0x90000
#define CABLETRON_8390_MEM 0x00000
enum mac8390_type {
@ -118,7 +118,7 @@ static int useresources[] = {
static char version[] __initdata =
"mac8390.c: v0.4 2001-05-15 David Huggins-Daines <dhd@debian.org> and others\n";
extern enum mac8390_type mac8390_ident(struct nubus_dev * dev);
extern int mac8390_memsize(unsigned long membase);
extern int mac8390_memtest(struct net_device * dev);
@ -168,7 +168,7 @@ enum mac8390_type __init mac8390_ident(struct nubus_dev * dev)
{
if (dev->dr_sw == NUBUS_DRSW_ASANTE)
return MAC8390_ASANTE;
if (dev->dr_sw == NUBUS_DRSW_FARALLON)
if (dev->dr_sw == NUBUS_DRSW_FARALLON)
return MAC8390_FARALLON;
if (dev->dr_sw == NUBUS_DRSW_KINETICS)
return MAC8390_KINETICS;
@ -187,7 +187,7 @@ int __init mac8390_memsize(unsigned long membase)
{
unsigned long flags;
int i, j;
local_irq_save(flags);
/* Check up to 32K in 4K increments */
for (i = 0; i < 8; i++) {
@ -197,7 +197,7 @@ int __init mac8390_memsize(unsigned long membase)
RAM end located */
if (hwreg_present(m) == 0)
break;
/* write a distinctive byte */
*m = 0xA5A0 | i;
/* check that we read back what we wrote */
@ -224,7 +224,7 @@ struct net_device * __init mac8390_probe(int unit)
int version_disp = 0;
struct nubus_dev * ndev = NULL;
int err = -ENODEV;
struct nubus_dir dir;
struct nubus_dirent ent;
int offset;
@ -273,7 +273,7 @@ struct net_device * __init mac8390_probe(int unit)
dev->name, ndev->board->slot);
continue;
}
/* Get the MAC address */
if ((nubus_find_rsrc(&dir, NUBUS_RESID_MAC_ADDRESS, &ent)) == -1) {
printk(KERN_INFO "%s: Couldn't get MAC address!\n",
@ -282,7 +282,7 @@ struct net_device * __init mac8390_probe(int unit)
} else {
nubus_get_rsrc_mem(dev->dev_addr, &ent, 6);
/* Some Sonic Sys cards masquerade as Farallon */
if (cardtype == MAC8390_FARALLON &&
if (cardtype == MAC8390_FARALLON &&
dev->dev_addr[0] == 0x0 &&
dev->dev_addr[1] == 0x40 &&
dev->dev_addr[2] == 0x10) {
@ -290,7 +290,7 @@ struct net_device * __init mac8390_probe(int unit)
cardtype = MAC8390_SONICSYS;
}
}
if (useresources[cardtype] == 1) {
nubus_rewinddir(&dir);
if (nubus_find_rsrc(&dir, NUBUS_RESID_MINOR_BASEOS, &ent) == -1) {
@ -318,10 +318,10 @@ struct net_device * __init mac8390_probe(int unit)
switch (cardtype) {
case MAC8390_KINETICS:
case MAC8390_DAYNA: /* it's the same */
dev->base_addr =
dev->base_addr =
(int)(ndev->board->slot_addr +
DAYNA_8390_BASE);
dev->mem_start =
dev->mem_start =
(int)(ndev->board->slot_addr +
DAYNA_8390_MEM);
dev->mem_end =
@ -343,11 +343,11 @@ struct net_device * __init mac8390_probe(int unit)
*/
i = (void *)dev->base_addr;
*i = 0x21;
dev->mem_end =
dev->mem_end =
dev->mem_start +
mac8390_memsize(dev->mem_start);
break;
default:
printk(KERN_ERR "Card type %s is"
" unsupported, sorry\n",
@ -433,7 +433,7 @@ static int __init mac8390_initdev(struct net_device * dev, struct nubus_dev * nd
};
int access_bitmode;
/* Now fill in our stuff */
dev->open = &mac8390_open;
dev->stop = &mac8390_close;
@ -459,7 +459,7 @@ static int __init mac8390_initdev(struct net_device * dev, struct nubus_dev * nd
ei_status.rmem_start = dev->mem_start + TX_PAGES*256;
ei_status.rmem_end = dev->mem_end;
}
/* Fill in model-specific information and functions */
switch(type) {
case MAC8390_SONICSYS:
@ -509,7 +509,7 @@ static int __init mac8390_initdev(struct net_device * dev, struct nubus_dev * nd
printk(KERN_ERR "Card type %s is unsupported, sorry\n", cardname[type]);
return -ENODEV;
}
NS8390_init(dev, 0);
/* Good, done, now spit out some messages */
@ -525,7 +525,7 @@ static int __init mac8390_initdev(struct net_device * dev, struct nubus_dev * nd
}
}
printk(" IRQ %d, shared memory at %#lx-%#lx, %d-bit access.\n",
dev->irq, dev->mem_start, dev->mem_end-1,
dev->irq, dev->mem_start, dev->mem_end-1,
access_bitmode?32:16);
return 0;
}
@ -536,7 +536,7 @@ static int mac8390_open(struct net_device *dev)
if (request_irq(dev->irq, ei_interrupt, 0, "8390 Ethernet", dev)) {
printk ("%s: unable to get IRQ %d.\n", dev->name, dev->irq);
return -EAGAIN;
}
}
return 0;
}
@ -639,7 +639,7 @@ static void sane_block_output(struct net_device *dev, int count,
const unsigned char *buf, int start_page)
{
long shmem = (start_page - WD_START_PG)<<8;
memcpy_toio((char *)dev->mem_start + shmem, buf, count);
}
@ -681,12 +681,12 @@ static void dayna_block_output(struct net_device *dev, int count, const unsigned
int start_page)
{
long shmem = (start_page - WD_START_PG)<<8;
dayna_memcpy_tocard(dev, shmem, buf, count);
}
/* Cabletron block I/O */
static void slow_sane_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr,
static void slow_sane_get_8390_hdr(struct net_device *dev, struct e8390_pkt_hdr *hdr,
int ring_page)
{
unsigned long hdr_start = (ring_page - WD_START_PG)<<8;
@ -750,4 +750,4 @@ static void word_memcpy_fromcard(void *tp, const void *fp, int count)
*to++=*from++;
}

Просмотреть файл

@ -12,24 +12,24 @@
Changelog:
Mike Cruse : mcruse@cti-ltd.com
: Changes for Linux 2.0 compatibility.
: Changes for Linux 2.0 compatibility.
: Added dev_id parameter in net_interrupt(),
: request_irq() and free_irq(). Just NULL for now.
Mike Cruse : Added MOD_INC_USE_COUNT and MOD_DEC_USE_COUNT macros
: in net_open() and net_close() so kerneld would know
: that the module is in use and wouldn't eject the
: that the module is in use and wouldn't eject the
: driver prematurely.
Mike Cruse : Rewrote init_module() and cleanup_module using 8390.c
: as an example. Disabled autoprobing in init_module(),
: not a good thing to do to other devices while Linux
: is running from all accounts.
Alan Cox : Removed 1.2 support, added 2.1 extra counters.
David Huggins-Daines <dhd@debian.org>
Split this off into mac89x0.c, and gutted it of all parts which are
not relevant to the existing CS8900 cards on the Macintosh
(i.e. basically the Daynaport CS and LC cards). To be precise:
@ -210,7 +210,7 @@ struct net_device * __init mac89x0_probe(int unit)
{
unsigned long flags;
int card_present;
local_irq_save(flags);
card_present = hwreg_present((void*) ioaddr+4)
&& hwreg_present((void*) ioaddr + DATA_PORT);
@ -230,7 +230,7 @@ struct net_device * __init mac89x0_probe(int unit)
/* Fill in the 'dev' fields. */
dev->base_addr = ioaddr;
dev->mem_start = (unsigned long)
dev->mem_start = (unsigned long)
nubus_slot_addr(slot) | (((slot&0xf) << 20) + MMIOBASE);
dev->mem_end = dev->mem_start + 0x1000;
@ -428,7 +428,7 @@ net_send_packet(struct sk_buff *skb, struct net_device *dev)
return 0;
}
/* The typical workload of the driver:
Handle the network interface interrupts. */
static irqreturn_t net_interrupt(int irq, void *dev_id, struct pt_regs * regs)
@ -596,7 +596,7 @@ static void set_multicast_list(struct net_device *dev)
/* The multicast-accept list is initialized to accept-all, and we
rely on higher-level filtering for now. */
lp->rx_mode = RX_MULTCAST_ACCEPT;
}
}
else
lp->rx_mode = 0;
@ -653,7 +653,7 @@ cleanup_module(void)
free_netdev(dev_cs89x0);
}
#endif /* MODULE */
/*
* Local variables:
* compile-command: "m68k-linux-gcc -D__KERNEL__ -I../../include -Wall -Wstrict-prototypes -O2 -fomit-frame-pointer -pipe -fno-strength-reduce -ffixed-a2 -DMODULE -DMODVERSIONS -include ../../include/linux/modversions.h -c -o mac89x0.o mac89x0.c"

Просмотреть файл

@ -177,7 +177,7 @@ static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_i
}
mp->chipid = (in_8(&mp->mace->chipid_hi) << 8) |
in_8(&mp->mace->chipid_lo);
mp = (struct mace_data *) dev->priv;
mp->maccc = ENXMT | ENRCV;
@ -219,7 +219,7 @@ static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_i
mp->port_aaui = 1;
#else
mp->port_aaui = 0;
#endif
#endif
}
}
@ -264,7 +264,7 @@ static int __devinit mace_probe(struct macio_dev *mdev, const struct of_device_i
printk(", chip revision %d.%d\n", mp->chipid >> 8, mp->chipid & 0xff);
return 0;
err_free_rx_irq:
free_irq(macio_irq(mdev, 2), dev);
err_free_tx_irq:
@ -1008,7 +1008,7 @@ static irqreturn_t mace_rxdma_intr(int irq, void *dev_id, struct pt_regs *regs)
return IRQ_HANDLED;
}
static struct of_device_id mace_match[] =
static struct of_device_id mace_match[] =
{
{
.name = "mace",
@ -1017,7 +1017,7 @@ static struct of_device_id mace_match[] =
};
MODULE_DEVICE_TABLE (of, mace_match);
static struct macio_driver mace_driver =
static struct macio_driver mace_driver =
{
.name = "mace",
.match_table = mace_match,

Просмотреть файл

@ -63,7 +63,7 @@ struct mace_frame {
u16 rcvcc;
u32 pad1;
u32 pad2;
u8 data[1];
u8 data[1];
/* And frame continues.. */
};
@ -118,17 +118,17 @@ static void mace_rxdma_reset(struct net_device *dev)
struct mace_data *mp = (struct mace_data *) dev->priv;
volatile struct mace *mace = mp->mace;
u8 maccc = mace->maccc;
mace->maccc = maccc & ~ENRCV;
psc_write_word(PSC_ENETRD_CTL, 0x8800);
mace_load_rxdma_base(dev, 0x00);
psc_write_word(PSC_ENETRD_CTL, 0x0400);
psc_write_word(PSC_ENETRD_CTL, 0x8800);
mace_load_rxdma_base(dev, 0x10);
psc_write_word(PSC_ENETRD_CTL, 0x0400);
mace->maccc = maccc;
mp->rx_slot = 0;
@ -139,7 +139,7 @@ static void mace_rxdma_reset(struct net_device *dev)
/*
* Reset the transmit DMA subsystem
*/
static void mace_txdma_reset(struct net_device *dev)
{
struct mace_data *mp = (struct mace_data *) dev->priv;
@ -161,7 +161,7 @@ static void mace_txdma_reset(struct net_device *dev)
/*
* Disable DMA
*/
static void mace_dma_off(struct net_device *dev)
{
psc_write_word(PSC_ENETRD_CTL, 0x8800);
@ -179,7 +179,7 @@ static void mace_dma_off(struct net_device *dev)
* Not really much of a probe. The hardware table tells us if this
* model of Macintrash has a MACE (AV macintoshes)
*/
struct net_device *mace_probe(int unit)
{
int j;
@ -189,7 +189,7 @@ struct net_device *mace_probe(int unit)
unsigned char checksum = 0;
static int found = 0;
int err;
if (found || macintosh_config->ether_type != MAC_ETHER_MACE)
return ERR_PTR(-ENODEV);
@ -205,7 +205,7 @@ struct net_device *mace_probe(int unit)
mp = (struct mace_data *) dev->priv;
dev->base_addr = (u32)MACE_BASE;
mp->mace = (volatile struct mace *) MACE_BASE;
dev->irq = IRQ_MAC_MACE;
mp->dma_intr = IRQ_MAC_MACE_DMA;
@ -217,7 +217,7 @@ struct net_device *mace_probe(int unit)
*/
addr = (void *)MACE_PROM;
for (j = 0; j < 6; ++j) {
u8 v=bitrev(addr[j<<4]);
checksum ^= v;
@ -226,7 +226,7 @@ struct net_device *mace_probe(int unit)
for (; j < 8; ++j) {
checksum ^= bitrev(addr[j<<4]);
}
if (checksum != 0xFF) {
free_netdev(dev);
return ERR_PTR(-ENODEV);
@ -275,7 +275,7 @@ static int mace_set_address(struct net_device *dev, void *addr)
/* load up the hardware address */
mb->iac = ADDRCHG | PHYADDR;
while ((mb->iac & ADDRCHG) != 0);
for (i = 0; i < 6; ++i) {
mb->padr = dev->dev_addr[i] = p[i];
}
@ -290,7 +290,7 @@ static int mace_set_address(struct net_device *dev, void *addr)
* Open the Macintosh MACE. Most of this is playing with the DMA
* engine. The ethernet chip is quite friendly.
*/
static int mace_open(struct net_device *dev)
{
struct mace_data *mp = (struct mace_data *) dev->priv;
@ -333,7 +333,7 @@ static int mace_open(struct net_device *dev)
mp->rx_ring = (void *) __get_free_pages(GFP_KERNEL | GFP_DMA, N_RX_PAGES);
mp->tx_ring = (void *) __get_free_pages(GFP_KERNEL | GFP_DMA, 0);
if (mp->tx_ring==NULL || mp->rx_ring==NULL) {
if (mp->rx_ring) free_pages((u32) mp->rx_ring, N_RX_PAGES);
if (mp->tx_ring) free_pages((u32) mp->tx_ring, 0);
@ -348,7 +348,7 @@ static int mace_open(struct net_device *dev)
/* We want the Rx buffer to be uncached and the Tx buffer to be writethrough */
kernel_set_cachemode((void *)mp->rx_ring, N_RX_PAGES * PAGE_SIZE, IOMAP_NOCACHE_NONSER);
kernel_set_cachemode((void *)mp->rx_ring, N_RX_PAGES * PAGE_SIZE, IOMAP_NOCACHE_NONSER);
kernel_set_cachemode((void *)mp->tx_ring, PAGE_SIZE, IOMAP_WRITETHROUGH);
mace_dma_off(dev);
@ -362,11 +362,11 @@ static int mace_open(struct net_device *dev)
#if 0
/* load up the hardware address */
mb->iac = ADDRCHG | PHYADDR;
while ((mb->iac & ADDRCHG) != 0);
for (i = 0; i < 6; ++i)
mb->padr = dev->dev_addr[i];
@ -374,7 +374,7 @@ static int mace_open(struct net_device *dev)
mb->iac = ADDRCHG | LOGADDR;
while ((mb->iac & ADDRCHG) != 0);
for (i = 0; i < 8; ++i)
mb->ladrf = 0;
@ -386,14 +386,14 @@ static int mace_open(struct net_device *dev)
mace_rxdma_reset(dev);
mace_txdma_reset(dev);
return 0;
}
/*
* Shut down the mace and its interrupt channel
*/
static int mace_close(struct net_device *dev)
{
struct mace_data *mp = (struct mace_data *) dev->priv;
@ -415,7 +415,7 @@ static int mace_close(struct net_device *dev)
/*
* Transmit a frame
*/
static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev)
{
struct mace_data *mp = (struct mace_data *) dev->priv;
@ -427,7 +427,7 @@ static int mace_xmit_start(struct sk_buff *skb, struct net_device *dev)
return 1;
}
mp->tx_count--;
mp->stats.tx_packets++;
mp->stats.tx_bytes += skb->len;
@ -488,7 +488,7 @@ static void mace_set_multicast(struct net_device *dev)
mb->iac = ADDRCHG | LOGADDR;
while (mb->iac & ADDRCHG);
for (i = 0; i < 8; ++i) {
mb->ladrf = multicast_filter[i];
}
@ -498,10 +498,10 @@ static void mace_set_multicast(struct net_device *dev)
}
/*
* Miscellaneous interrupts are handled here. We may end up
* Miscellaneous interrupts are handled here. We may end up
* having to bash the chip on the head for bad errors
*/
static void mace_handle_misc_intrs(struct mace_data *mp, int intr)
{
volatile struct mace *mb = mp->mace;
@ -536,16 +536,16 @@ static void mace_handle_misc_intrs(struct mace_data *mp, int intr)
* A transmit error has occurred. (We kick the transmit side from
* the DMA completion)
*/
static void mace_xmit_error(struct net_device *dev)
{
struct mace_data *mp = (struct mace_data *) dev->priv;
volatile struct mace *mb = mp->mace;
u8 xmtfs, xmtrc;
xmtfs = mb->xmtfs;
xmtrc = mb->xmtrc;
if (xmtfs & XMTSV) {
if (xmtfs & UFLO) {
printk("%s: DMA underrun.\n", dev->name);
@ -556,13 +556,13 @@ static void mace_xmit_error(struct net_device *dev)
if (xmtfs & RTRY) {
mp->stats.collisions++;
}
}
}
}
/*
* A receive interrupt occurred.
*/
static void mace_recv_interrupt(struct net_device *dev)
{
/* struct mace_data *mp = (struct mace_data *) dev->priv; */
@ -572,17 +572,17 @@ static void mace_recv_interrupt(struct net_device *dev)
/*
* Process the chip interrupt
*/
static irqreturn_t mace_interrupt(int irq, void *dev_id, struct pt_regs *regs)
{
struct net_device *dev = (struct net_device *) dev_id;
struct mace_data *mp = (struct mace_data *) dev->priv;
volatile struct mace *mb = mp->mace;
u8 ir;
ir = mb->ir;
mace_handle_misc_intrs(mp, ir);
if (ir & XMTINT) {
mace_xmit_error(dev);
}
@ -601,7 +601,7 @@ static void mace_tx_timeout(struct net_device *dev)
/*
* Handle a newly arrived frame
*/
static void mace_dma_rx_frame(struct net_device *dev, struct mace_frame *mf)
{
struct mace_data *mp = (struct mace_data *) dev->priv;
@ -614,7 +614,7 @@ static void mace_dma_rx_frame(struct net_device *dev, struct mace_frame *mf)
}
if (mf->status&(RS_CLSN|RS_FRAMERR|RS_FCSERR))
mp->stats.rx_errors++;
if (mf->status&RS_CLSN) {
mp->stats.collisions++;
}
@ -624,7 +624,7 @@ static void mace_dma_rx_frame(struct net_device *dev, struct mace_frame *mf)
if (mf->status&RS_FCSERR) {
mp->stats.rx_crc_errors++;
}
skb = dev_alloc_skb(mf->len+2);
if (!skb) {
mp->stats.rx_dropped++;
@ -632,7 +632,7 @@ static void mace_dma_rx_frame(struct net_device *dev, struct mace_frame *mf)
}
skb_reserve(skb,2);
memcpy(skb_put(skb, mf->len), mf->data, mf->len);
skb->dev = dev;
skb->protocol = eth_type_trans(skb, dev);
netif_rx(skb);
@ -644,7 +644,7 @@ static void mace_dma_rx_frame(struct net_device *dev, struct mace_frame *mf)
/*
* The PSC has passed us a DMA interrupt event.
*/
static irqreturn_t mace_dma_intr(int irq, void *dev_id, struct pt_regs *regs)
{
struct net_device *dev = (struct net_device *) dev_id;
@ -661,9 +661,9 @@ static irqreturn_t mace_dma_intr(int irq, void *dev_id, struct pt_regs *regs)
/*
* Process the read queue
*/
status = psc_read_word(PSC_ENETRD_CTL);
if (status & 0x2000) {
mace_rxdma_reset(dev);
} else if (status & 0x0100) {
@ -678,7 +678,7 @@ static irqreturn_t mace_dma_intr(int irq, void *dev_id, struct pt_regs *regs)
mace_dma_rx_frame(dev, (struct mace_frame *) (mp->rx_ring + (mp->rx_tail * 0x0800)));
mp->rx_tail++;
}
/* If we're out of buffers in this ring then switch to */
/* the other set, otherwise just reactivate this one. */
@ -689,7 +689,7 @@ static irqreturn_t mace_dma_intr(int irq, void *dev_id, struct pt_regs *regs)
psc_write_word(PSC_ENETRD_CMD + mp->rx_slot, 0x9800);
}
}
/*
* Process the write queue
*/

Просмотреть файл

@ -13,20 +13,20 @@
*
* Based on code
* (C) 1996 by Thomas Bogendoerfer (tsbogend@bigbug.franken.de)
*
*
* This driver is based on work from Andreas Busse, but most of
* the code is rewritten.
*
*
* (C) 1995 by Andreas Busse (andy@waldorf-gmbh.de)
*
* A driver for the Mac onboard Sonic ethernet chip.
*
* 98/12/21 MSch: judged from tests on Q800, it's basically working,
* 98/12/21 MSch: judged from tests on Q800, it's basically working,
* but eating up both receive and transmit resources
* and duplicating packets. Needs more testing.
*
* 99/01/03 MSch: upgraded to version 0.92 of the core driver, fixed.
*
*
* 00/10/31 sammy@oh.verio.com: Updated driver for 2.4 kernels, fixed problems
* on centris.
*/
@ -76,7 +76,7 @@ static struct platform_device *mac_sonic_device;
/* use 0 for production, 1 for verification, >1 for debug */
#ifdef SONIC_DEBUG
static unsigned int sonic_debug = SONIC_DEBUG;
#else
#else
static unsigned int sonic_debug = 1;
#endif
@ -129,7 +129,7 @@ static inline void bit_reverse_addr(unsigned char addr[6])
int i;
for(i = 0; i < 6; i++)
addr[i] = ((nibbletab[addr[i] & 0xf] << 4) |
addr[i] = ((nibbletab[addr[i] & 0xf] << 4) |
nibbletab[(addr[i] >> 4) &0xf]);
}
@ -215,7 +215,7 @@ int __init mac_onboard_sonic_ethernet_addr(struct net_device* dev)
unsigned short val;
printk(KERN_INFO "macsonic: PROM seems to be wrong, trying CAM entry 15\n");
SONIC_WRITE(SONIC_CMD, SONIC_CR_RST);
SONIC_WRITE(SONIC_CEP, 15);
@ -228,7 +228,7 @@ int __init mac_onboard_sonic_ethernet_addr(struct net_device* dev)
val = SONIC_READ(SONIC_CAP0);
dev->dev_addr[1] = val >> 8;
dev->dev_addr[0] = val & 0xff;
printk(KERN_INFO "HW Address from CAM 15: ");
for (i = 0; i < 6; i++) {
printk("%2.2x", dev->dev_addr[i]);
@ -258,7 +258,7 @@ int __init mac_onboard_sonic_probe(struct net_device* dev)
struct sonic_local* lp = netdev_priv(dev);
int sr;
int commslot = 0;
if (once_is_more_than_enough)
return -ENODEV;
once_is_more_than_enough = 1;
@ -268,9 +268,9 @@ int __init mac_onboard_sonic_probe(struct net_device* dev)
if (macintosh_config->ether_type != MAC_ETHER_SONIC)
return -ENODEV;
printk(KERN_INFO "Checking for internal Macintosh ethernet (SONIC).. ");
/* Bogus probing, on the models which may or may not have
Ethernet (BTW, the Ethernet *is* always at the same
address, and nothing else lives there, at least if Apple's
@ -293,7 +293,7 @@ int __init mac_onboard_sonic_probe(struct net_device* dev)
commslot = 1;
}
printk("yes\n");
printk("yes\n");
/* Danger! My arms are flailing wildly! You *must* set lp->reg_offset
* and dev->base_addr before using SONIC_READ() or SONIC_WRITE() */
@ -325,7 +325,7 @@ int __init mac_onboard_sonic_probe(struct net_device* dev)
lp->dma_bitmode = SONIC_BITMODE16;
sr = SONIC_READ(SONIC_SR);
if (sr == 0x0004 || sr == 0x0006 || sr == 0x0100 || sr == 0x0101)
if (sr == 0x0004 || sr == 0x0006 || sr == 0x0100 || sr == 0x0101)
/* 83932 is 0x0004 or 0x0006, 83934 is 0x0100 or 0x0101 */
lp->dma_bitmode = SONIC_BITMODE32;
else {
@ -389,7 +389,7 @@ int __init mac_nubus_sonic_ethernet_addr(struct net_device* dev,
int __init macsonic_ident(struct nubus_dev* ndev)
{
if (ndev->dr_hw == NUBUS_DRHW_ASANTE_LC &&
if (ndev->dr_hw == NUBUS_DRHW_ASANTE_LC &&
ndev->dr_sw == NUBUS_DRSW_SONIC_LC)
return MACSONIC_DAYNALINK;
if (ndev->dr_hw == NUBUS_DRHW_SONIC &&
@ -400,11 +400,11 @@ int __init macsonic_ident(struct nubus_dev* ndev)
else
return MACSONIC_APPLE;
}
if (ndev->dr_hw == NUBUS_DRHW_SMC9194 &&
ndev->dr_sw == NUBUS_DRSW_DAYNA)
return MACSONIC_DAYNA;
if (ndev->dr_hw == NUBUS_DRHW_SONIC_LC &&
ndev->dr_sw == 0) { /* huh? */
return MACSONIC_APPLE16;
@ -421,7 +421,7 @@ int __init mac_nubus_sonic_probe(struct net_device* dev)
u16 sonic_dcr;
int id = -1;
int reg_offset, dma_bitmode;
/* Find the first SONIC that hasn't been initialized already */
while ((ndev = nubus_find_type(NUBUS_CAT_NETWORK,
NUBUS_TYPE_ETHERNET, ndev)) != NULL)
@ -459,7 +459,7 @@ int __init mac_nubus_sonic_probe(struct net_device* dev)
base_addr = ndev->board->slot_addr + APPLE_SONIC_REGISTERS;
prom_addr = ndev->board->slot_addr + APPLE_SONIC_PROM_BASE;
sonic_dcr = SONIC_DCR_EXBUS | SONIC_DCR_RFT1 | SONIC_DCR_TFT0 |
SONIC_DCR_PO1 | SONIC_DCR_BMS;
SONIC_DCR_PO1 | SONIC_DCR_BMS;
reg_offset = 0;
dma_bitmode = SONIC_BITMODE16;
break;
@ -467,7 +467,7 @@ int __init mac_nubus_sonic_probe(struct net_device* dev)
base_addr = ndev->board->slot_addr + APPLE_SONIC_REGISTERS;
prom_addr = ndev->board->slot_addr + DAYNALINK_PROM_BASE;
sonic_dcr = SONIC_DCR_RFT1 | SONIC_DCR_TFT0 |
SONIC_DCR_PO1 | SONIC_DCR_BMS;
SONIC_DCR_PO1 | SONIC_DCR_BMS;
reg_offset = 0;
dma_bitmode = SONIC_BITMODE16;
break;

Просмотреть файл

@ -93,7 +93,7 @@ struct meth_private {
static void meth_tx_timeout(struct net_device *dev);
static irqreturn_t meth_interrupt(int irq, void *dev_id, struct pt_regs *pregs);
/* global, initialized in ip32-setup.c */
char o2meth_eaddr[8]={0,0,0,0,0,0,0,0};
@ -232,7 +232,7 @@ static int meth_init_rx_ring(struct meth_private *priv)
skb_reserve(priv->rx_skbs[i],METH_RX_HEAD);
priv->rx_ring[i]=(rx_packet*)(priv->rx_skbs[i]->head);
/* I'll need to re-sync it after each RX */
priv->rx_ring_dmas[i] =
priv->rx_ring_dmas[i] =
dma_map_single(NULL, priv->rx_ring[i],
METH_RX_BUFF_SIZE, DMA_FROM_DEVICE);
mace->eth.rx_fifo = priv->rx_ring_dmas[i];
@ -281,7 +281,7 @@ int meth_reset(struct net_device *dev)
/* Load ethernet address */
load_eaddr(dev);
/* Should load some "errata", but later */
/* Check for device */
if (mdio_probe(priv) < 0) {
DPRINTK("Unable to find PHY\n");
@ -452,7 +452,7 @@ static void meth_rx(struct net_device* dev, unsigned long int_status)
}
priv->rx_ring[priv->rx_write] = (rx_packet*)skb->head;
priv->rx_ring[priv->rx_write]->status.raw = 0;
priv->rx_ring_dmas[priv->rx_write] =
priv->rx_ring_dmas[priv->rx_write] =
dma_map_single(NULL, priv->rx_ring[priv->rx_write],
METH_RX_BUFF_SIZE, DMA_FROM_DEVICE);
mace->eth.rx_fifo = priv->rx_ring_dmas[priv->rx_write];
@ -555,7 +555,7 @@ static void meth_error(struct net_device* dev, unsigned status)
printk(KERN_WARNING "meth: Rx underflow\n");
spin_lock(&priv->meth_lock);
mace->eth.int_stat = METH_INT_RX_UNDERFLOW;
/* more underflow interrupts will be delivered,
/* more underflow interrupts will be delivered,
* effectively throwing us into an infinite loop.
* Thus I stop processing Rx in this case. */
priv->dma_ctrl &= ~METH_DMA_RX_EN;
@ -761,12 +761,12 @@ static void meth_tx_timeout(struct net_device *dev)
}
/*
* Ioctl commands
* Ioctl commands
*/
static int meth_ioctl(struct net_device *dev, struct ifreq *rq, int cmd)
{
/* XXX Not yet implemented */
switch(cmd) {
switch(cmd) {
case SIOCGMIIPHY:
case SIOCGMIIREG:
case SIOCSMIIREG:

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше