Merge branch 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6
* 'upstream-linus' of master.kernel.org:/pub/scm/linux/kernel/git/jgarzik/netdev-2.6: (217 commits)
net/ieee80211: fix more crypto-related build breakage
[PATCH] Spidernet: add ethtool -S (show statistics)
[NET] GT96100: Delete bitrotting ethernet driver
[PATCH] mv643xx_eth: restrict to 32-bit PPC_MULTIPLATFORM
[PATCH] Cirrus Logic ep93xx ethernet driver
r8169: the MMIO region of the 8167 stands behin BAR#1
e1000, ixgb: Remove pointless wrappers
[PATCH] Remove powerpc specific parts of 3c509 driver
[PATCH] s2io: Switch to pci_get_device
[PATCH] gt96100: move to pci_get_device API
[PATCH] ehea: bugfix for register access functions
[PATCH] e1000 disable device on PCI error
drivers/net/phy/fixed: #if 0 some incomplete code
drivers/net: const-ify ethtool_ops declarations
[PATCH] ethtool: allow const ethtool_ops
[PATCH] sky2: big endian
[PATCH] sky2: fiber support
[PATCH] sky2: tx pause bug fix
drivers/net: Trim trailing whitespace
[PATCH] ehea: IBM eHEA Ethernet Device Driver
...
Manually resolved conflicts in drivers/net/ixgb/ixgb_main.c and
drivers/net/sky2.c related to CHECKSUM_HW/CHECKSUM_PARTIAL changes by
commit 84fa7933a3
that just happened to be
next to unrelated changes in this update.
This commit is contained in:
Коммит
a319a2773a
|
@ -0,0 +1,46 @@
|
|||
Copyright (c) 2003-2006 QLogic Corporation
|
||||
QLogic Linux Networking HBA Driver
|
||||
|
||||
This program includes a device driver for Linux 2.6 that may be
|
||||
distributed with QLogic hardware specific firmware binary file.
|
||||
You may modify and redistribute the device driver code under the
|
||||
GNU General Public License as published by the Free Software
|
||||
Foundation (version 2 or a later version).
|
||||
|
||||
You may redistribute the hardware specific firmware binary file
|
||||
under the following terms:
|
||||
|
||||
1. Redistribution of source code (only if applicable),
|
||||
must retain the above copyright notice, this list of
|
||||
conditions and the following disclaimer.
|
||||
|
||||
2. Redistribution in binary form must reproduce the above
|
||||
copyright notice, this list of conditions and the
|
||||
following disclaimer in the documentation and/or other
|
||||
materials provided with the distribution.
|
||||
|
||||
3. The name of QLogic Corporation may not be used to
|
||||
endorse or promote products derived from this software
|
||||
without specific prior written permission
|
||||
|
||||
REGARDLESS OF WHAT LICENSING MECHANISM IS USED OR APPLICABLE,
|
||||
THIS PROGRAM IS PROVIDED BY QLOGIC CORPORATION "AS IS'' AND ANY
|
||||
EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
|
||||
PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR
|
||||
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
|
||||
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
|
||||
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
||||
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
USER ACKNOWLEDGES AND AGREES THAT USE OF THIS PROGRAM WILL NOT
|
||||
CREATE OR GIVE GROUNDS FOR A LICENSE BY IMPLICATION, ESTOPPEL, OR
|
||||
OTHERWISE IN ANY INTELLECTUAL PROPERTY RIGHTS (PATENT, COPYRIGHT,
|
||||
TRADE SECRET, MASK WORK, OR OTHER PROPRIETARY RIGHT) EMBODIED IN
|
||||
ANY OTHER QLOGIC HARDWARE OR SOFTWARE EITHER SOLELY OR IN
|
||||
COMBINATION WITH THIS PROGRAM.
|
||||
|
37
MAINTAINERS
37
MAINTAINERS
|
@ -457,9 +457,9 @@ L: linux-hams@vger.kernel.org
|
|||
W: http://www.baycom.org/~tom/ham/ham.html
|
||||
S: Maintained
|
||||
|
||||
BCM43XX WIRELESS DRIVER
|
||||
P: Michael Buesch
|
||||
M: mb@bu3sch.de
|
||||
BCM43XX WIRELESS DRIVER (SOFTMAC BASED VERSION)
|
||||
P: Larry Finger
|
||||
M: Larry.Finger@lwfinger.net
|
||||
P: Stefano Brivio
|
||||
M: st3@riseup.net
|
||||
W: http://bcm43xx.berlios.de/
|
||||
|
@ -2389,6 +2389,12 @@ M: linux-driver@qlogic.com
|
|||
L: linux-scsi@vger.kernel.org
|
||||
S: Supported
|
||||
|
||||
QLOGIC QLA3XXX NETWORK DRIVER
|
||||
P: Ron Mercer
|
||||
M: linux-driver@qlogic.com
|
||||
L: netdev@vger.kernel.org
|
||||
S: Supported
|
||||
|
||||
QNX4 FILESYSTEM
|
||||
P: Anders Larsen
|
||||
M: al@alarsen.net
|
||||
|
@ -2641,6 +2647,18 @@ P: Nicolas Pitre
|
|||
M: nico@cam.org
|
||||
S: Maintained
|
||||
|
||||
SOFTMAC LAYER (IEEE 802.11)
|
||||
P: Johannes Berg
|
||||
M: johannes@sipsolutions.net
|
||||
P: Joe Jezak
|
||||
M: josejx@gentoo.org
|
||||
P: Daniel Drake
|
||||
M: dsd@gentoo.org
|
||||
W: http://softmac.sipsolutions.net/
|
||||
L: softmac-dev@sipsolutions.net
|
||||
L: netdev@vger.kernel.org
|
||||
S: Maintained
|
||||
|
||||
SOFTWARE RAID (Multiple Disks) SUPPORT
|
||||
P: Ingo Molnar
|
||||
M: mingo@redhat.com
|
||||
|
@ -2922,8 +2940,8 @@ W: http://www.auk.cx/tms380tr/
|
|||
S: Maintained
|
||||
|
||||
TULIP NETWORK DRIVER
|
||||
P: Jeff Garzik
|
||||
M: jgarzik@pobox.com
|
||||
P: Valerie Henson
|
||||
M: val_henson@linux.intel.com
|
||||
L: tulip-users@lists.sourceforge.net
|
||||
W: http://sourceforge.net/projects/tulip/
|
||||
S: Maintained
|
||||
|
@ -3374,6 +3392,15 @@ W: http://www.qsl.net/dl1bke/
|
|||
L: linux-hams@vger.kernel.org
|
||||
S: Maintained
|
||||
|
||||
ZD1211RW WIRELESS DRIVER
|
||||
P: Daniel Drake
|
||||
M: dsd@gentoo.org
|
||||
P: Ulrich Kunitz
|
||||
M: kune@deine-taler.de
|
||||
W: http://zd1211.ath.cx/wiki/DriverRewrite
|
||||
L: zd1211-devs@lists.sourceforge.net (subscribers-only)
|
||||
S: Maintained
|
||||
|
||||
ZF MACHZ WATCHDOG
|
||||
P: Fernando Fuganti
|
||||
M: fuganti@netbank.com.br
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
config ISDN_PPP
|
||||
bool "Support synchronous PPP"
|
||||
depends on INET
|
||||
select SLHC
|
||||
help
|
||||
Over digital connections such as ISDN, there is no need to
|
||||
synchronize sender and recipient's clocks with start and stop bits
|
||||
|
|
|
@ -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
|
||||
|
@ -120,7 +120,6 @@ static const char version[] =
|
|||
#include <linux/slab.h>
|
||||
#include <linux/string.h>
|
||||
#include <linux/errno.h>
|
||||
#include <linux/config.h> /* for CONFIG_IP_MULTICAST */
|
||||
#include <linux/spinlock.h>
|
||||
#include <linux/ethtool.h>
|
||||
#include <linux/delay.h>
|
||||
|
@ -146,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
|
||||
|
@ -156,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));
|
||||
|
@ -201,7 +200,7 @@ out:
|
|||
}
|
||||
|
||||
/**
|
||||
* el1_probe1:
|
||||
* el1_probe1:
|
||||
* @dev: The device structure to use
|
||||
* @ioaddr: An I/O address to probe at.
|
||||
*
|
||||
|
@ -308,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.
|
||||
*/
|
||||
|
@ -329,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.
|
||||
*
|
||||
|
@ -368,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));
|
||||
|
@ -386,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
|
||||
|
@ -422,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.
|
||||
*/
|
||||
|
@ -435,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;
|
||||
|
@ -464,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) */
|
||||
|
@ -473,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. */
|
||||
|
@ -499,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.
|
||||
|
@ -527,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 ?
|
||||
*/
|
||||
|
@ -795,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;
|
||||
|
@ -804,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.
|
||||
*/
|
||||
|
@ -825,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);
|
||||
|
@ -836,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.
|
||||
|
@ -882,7 +881,7 @@ static void netdev_set_msglevel(struct net_device *dev, u32 level)
|
|||
debug = level;
|
||||
}
|
||||
|
||||
static struct ethtool_ops netdev_ethtool_ops = {
|
||||
static const struct ethtool_ops netdev_ethtool_ops = {
|
||||
.get_drvinfo = netdev_get_drvinfo,
|
||||
.get_msglevel = netdev_get_msglevel,
|
||||
.set_msglevel = netdev_set_msglevel,
|
||||
|
@ -908,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);
|
||||
|
@ -919,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;
|
||||
|
|
|
@ -13,7 +13,7 @@ static void el_reset(struct net_device *dev);
|
|||
static int el1_close(struct net_device *dev);
|
||||
static struct net_device_stats *el1_get_stats(struct net_device *dev);
|
||||
static void set_multicast_list(struct net_device *dev);
|
||||
static struct ethtool_ops netdev_ethtool_ops;
|
||||
static const struct ethtool_ops netdev_ethtool_ops;
|
||||
|
||||
#define EL1_IO_EXTENT 16
|
||||
|
||||
|
@ -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)
|
||||
|
|
|
@ -79,9 +79,9 @@ static void el2_block_input(struct net_device *dev, int count, struct sk_buff *s
|
|||
int ring_offset);
|
||||
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;
|
||||
static const 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;
|
||||
}
|
||||
|
@ -666,7 +666,7 @@ static void netdev_get_drvinfo(struct net_device *dev,
|
|||
sprintf(info->bus_info, "ISA 0x%lx", dev->base_addr);
|
||||
}
|
||||
|
||||
static struct ethtool_ops netdev_ethtool_ops = {
|
||||
static const struct ethtool_ops netdev_ethtool_ops = {
|
||||
.get_drvinfo = netdev_get_drvinfo,
|
||||
};
|
||||
|
||||
|
|
|
@ -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
|
||||
*/
|
||||
|
@ -1169,7 +1169,7 @@ static void netdev_set_msglevel(struct net_device *dev, u32 level)
|
|||
debug = level;
|
||||
}
|
||||
|
||||
static struct ethtool_ops netdev_ethtool_ops = {
|
||||
static const struct ethtool_ops netdev_ethtool_ops = {
|
||||
.get_drvinfo = netdev_get_drvinfo,
|
||||
.get_msglevel = netdev_get_msglevel,
|
||||
.set_msglevel = netdev_set_msglevel,
|
||||
|
@ -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
|
||||
*
|
||||
|
|
|
@ -294,14 +294,14 @@ static void el16_tx_timeout (struct net_device *dev);
|
|||
|
||||
static void hardware_send_packet(struct net_device *dev, void *buf, short length, short pad);
|
||||
static void init_82586_mem(struct net_device *dev);
|
||||
static struct ethtool_ops netdev_ethtool_ops;
|
||||
static const struct ethtool_ops netdev_ethtool_ops;
|
||||
static void init_rx_bufs(struct net_device *);
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
@ -919,7 +919,7 @@ static void netdev_set_msglevel(struct net_device *dev, u32 level)
|
|||
debug = level;
|
||||
}
|
||||
|
||||
static struct ethtool_ops netdev_ethtool_ops = {
|
||||
static const struct ethtool_ops netdev_ethtool_ops = {
|
||||
.get_drvinfo = netdev_get_drvinfo,
|
||||
.get_msglevel = netdev_get_msglevel,
|
||||
.set_msglevel = netdev_set_msglevel,
|
||||
|
@ -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
|
||||
|
@ -200,7 +200,7 @@ static void set_multicast_list(struct net_device *dev);
|
|||
static void el3_tx_timeout (struct net_device *dev);
|
||||
static void el3_down(struct net_device *dev);
|
||||
static void el3_up(struct net_device *dev);
|
||||
static struct ethtool_ops ethtool_ops;
|
||||
static const struct ethtool_ops ethtool_ops;
|
||||
#ifdef EL3_SUSPEND
|
||||
static int el3_suspend(struct device *, pm_message_t);
|
||||
static int el3_resume(struct device *);
|
||||
|
@ -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));
|
||||
|
@ -879,11 +879,7 @@ el3_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||
outw(skb->len, ioaddr + TX_FIFO);
|
||||
outw(0x00, ioaddr + TX_FIFO);
|
||||
/* ... and the packet rounded to a doubleword. */
|
||||
#ifdef __powerpc__
|
||||
outsl_ns(ioaddr + TX_FIFO, skb->data, (skb->len + 3) >> 2);
|
||||
#else
|
||||
outsl(ioaddr + TX_FIFO, skb->data, (skb->len + 3) >> 2);
|
||||
#endif
|
||||
|
||||
dev->trans_start = jiffies;
|
||||
if (inw(ioaddr + TX_FREE) > 1536)
|
||||
|
@ -1024,7 +1020,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);
|
||||
|
@ -1103,13 +1099,8 @@ el3_rx(struct net_device *dev)
|
|||
skb_reserve(skb, 2); /* Align IP on 16 byte */
|
||||
|
||||
/* 'skb->data' points to the start of sk_buff data area. */
|
||||
#ifdef __powerpc__
|
||||
insl_ns(ioaddr+RX_FIFO, skb_put(skb,pkt_len),
|
||||
(pkt_len + 3) >> 2);
|
||||
#else
|
||||
insl(ioaddr + RX_FIFO, skb_put(skb,pkt_len),
|
||||
(pkt_len + 3) >> 2);
|
||||
#endif
|
||||
|
||||
outw(RxDiscard, ioaddr + EL3_CMD); /* Pop top Rx packet. */
|
||||
skb->protocol = eth_type_trans(skb,dev);
|
||||
|
@ -1168,7 +1159,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 +1178,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 +1195,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) {
|
||||
|
@ -1349,7 +1340,7 @@ static void el3_set_msglevel(struct net_device *dev, u32 v)
|
|||
el3_debug = v;
|
||||
}
|
||||
|
||||
static struct ethtool_ops ethtool_ops = {
|
||||
static const struct ethtool_ops ethtool_ops = {
|
||||
.get_drvinfo = el3_get_drvinfo,
|
||||
.get_settings = el3_get_settings,
|
||||
.set_settings = el3_set_settings,
|
||||
|
@ -1391,7 +1382,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 +1402,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 +1474,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 +1498,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 +1510,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},
|
||||
};
|
||||
|
||||
|
@ -379,10 +379,10 @@ static int corkscrew_close(struct net_device *dev);
|
|||
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;
|
||||
|
||||
static const 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)
|
||||
|
@ -1561,13 +1561,13 @@ static void netdev_set_msglevel(struct net_device *dev, u32 level)
|
|||
corkscrew_debug = level;
|
||||
}
|
||||
|
||||
static struct ethtool_ops netdev_ethtool_ops = {
|
||||
static const struct ethtool_ops netdev_ethtool_ops = {
|
||||
.get_drvinfo = netdev_get_drvinfo,
|
||||
.get_msglevel = netdev_get_msglevel,
|
||||
.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 $
|
||||
*/
|
||||
|
||||
|
@ -189,7 +189,7 @@ static void elmc_timeout(struct net_device *dev);
|
|||
#ifdef ELMC_MULTICAST
|
||||
static void set_multicast_list(struct net_device *dev);
|
||||
#endif
|
||||
static struct ethtool_ops netdev_ethtool_ops;
|
||||
static const struct ethtool_ops netdev_ethtool_ops;
|
||||
|
||||
/* helper-functions */
|
||||
static int init586(struct net_device *dev);
|
||||
|
@ -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;
|
||||
|
@ -1259,7 +1259,7 @@ static void netdev_get_drvinfo(struct net_device *dev,
|
|||
sprintf(info->bus_info, "MCA 0x%lx", dev->base_addr);
|
||||
}
|
||||
|
||||
static struct ethtool_ops netdev_ethtool_ops = {
|
||||
static const struct ethtool_ops netdev_ethtool_ops = {
|
||||
.get_drvinfo = netdev_get_drvinfo,
|
||||
};
|
||||
|
||||
|
@ -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];
|
||||
|
|
|
@ -729,7 +729,7 @@ static int vortex_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
|
|||
#endif
|
||||
static void vortex_tx_timeout(struct net_device *dev);
|
||||
static void acpi_set_WOL(struct net_device *dev);
|
||||
static struct ethtool_ops vortex_ethtool_ops;
|
||||
static const struct ethtool_ops vortex_ethtool_ops;
|
||||
static void set_8021q_mode(struct net_device *dev, int enable);
|
||||
|
||||
/* This driver uses 'options' to pass the media type, full-duplex flag, etc. */
|
||||
|
@ -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 */
|
||||
|
@ -2873,7 +2873,7 @@ static void vortex_get_drvinfo(struct net_device *dev,
|
|||
}
|
||||
}
|
||||
|
||||
static struct ethtool_ops vortex_ethtool_ops = {
|
||||
static const struct ethtool_ops vortex_ethtool_ops = {
|
||||
.get_drvinfo = vortex_get_drvinfo,
|
||||
.get_strings = vortex_get_strings,
|
||||
.get_msglevel = vortex_get_msglevel,
|
||||
|
@ -2928,7 +2928,7 @@ static void set_rx_mode(struct net_device *dev)
|
|||
int new_mode;
|
||||
|
||||
if (dev->flags & IFF_PROMISC) {
|
||||
if (vortex_debug > 0)
|
||||
if (vortex_debug > 3)
|
||||
printk(KERN_NOTICE "%s: Setting promiscuous mode.\n", dev->name);
|
||||
new_mode = SetRxFilter|RxStation|RxMulticast|RxBroadcast|RxProm;
|
||||
} else if ((dev->mc_list) || (dev->flags & IFF_ALLMULTI)) {
|
||||
|
@ -3169,7 +3169,7 @@ static int __init vortex_init(void)
|
|||
{
|
||||
int pci_rc, eisa_rc;
|
||||
|
||||
pci_rc = pci_module_init(&vortex_driver);
|
||||
pci_rc = pci_register_driver(&vortex_driver);
|
||||
eisa_rc = vortex_eisa_init();
|
||||
|
||||
if (pci_rc == 0)
|
||||
|
@ -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 */
|
||||
|
|
|
@ -48,7 +48,7 @@
|
|||
*/
|
||||
|
||||
#define DRV_NAME "8139cp"
|
||||
#define DRV_VERSION "1.2"
|
||||
#define DRV_VERSION "1.3"
|
||||
#define DRV_RELDATE "Mar 22, 2004"
|
||||
|
||||
|
||||
|
@ -314,12 +314,6 @@ struct cp_desc {
|
|||
u64 addr;
|
||||
};
|
||||
|
||||
struct ring_info {
|
||||
struct sk_buff *skb;
|
||||
dma_addr_t mapping;
|
||||
u32 len;
|
||||
};
|
||||
|
||||
struct cp_dma_stats {
|
||||
u64 tx_ok;
|
||||
u64 rx_ok;
|
||||
|
@ -353,23 +347,23 @@ struct cp_private {
|
|||
struct net_device_stats net_stats;
|
||||
struct cp_extra_stats cp_stats;
|
||||
|
||||
unsigned rx_tail ____cacheline_aligned;
|
||||
unsigned rx_head ____cacheline_aligned;
|
||||
unsigned rx_tail;
|
||||
struct cp_desc *rx_ring;
|
||||
struct ring_info rx_skb[CP_RX_RING_SIZE];
|
||||
unsigned rx_buf_sz;
|
||||
struct sk_buff *rx_skb[CP_RX_RING_SIZE];
|
||||
|
||||
unsigned tx_head ____cacheline_aligned;
|
||||
unsigned tx_tail;
|
||||
|
||||
struct cp_desc *tx_ring;
|
||||
struct ring_info tx_skb[CP_TX_RING_SIZE];
|
||||
dma_addr_t ring_dma;
|
||||
struct sk_buff *tx_skb[CP_TX_RING_SIZE];
|
||||
|
||||
unsigned rx_buf_sz;
|
||||
unsigned wol_enabled : 1; /* Is Wake-on-LAN enabled? */
|
||||
|
||||
#if CP_VLAN_TAG_USED
|
||||
struct vlan_group *vlgrp;
|
||||
#endif
|
||||
|
||||
unsigned int wol_enabled : 1; /* Is Wake-on-LAN enabled? */
|
||||
dma_addr_t ring_dma;
|
||||
|
||||
struct mii_if_info mii_if;
|
||||
};
|
||||
|
@ -407,10 +401,8 @@ static int cp_set_eeprom(struct net_device *dev,
|
|||
struct ethtool_eeprom *eeprom, u8 *data);
|
||||
|
||||
static struct pci_device_id cp_pci_tbl[] = {
|
||||
{ PCI_VENDOR_ID_REALTEK, PCI_DEVICE_ID_REALTEK_8139,
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
|
||||
{ PCI_VENDOR_ID_TTTECH, PCI_DEVICE_ID_TTTECH_MC322,
|
||||
PCI_ANY_ID, PCI_ANY_ID, 0, 0, },
|
||||
{ PCI_DEVICE(PCI_VENDOR_ID_REALTEK, PCI_DEVICE_ID_REALTEK_8139), },
|
||||
{ PCI_DEVICE(PCI_VENDOR_ID_TTTECH, PCI_DEVICE_ID_TTTECH_MC322), },
|
||||
{ },
|
||||
};
|
||||
MODULE_DEVICE_TABLE(pci, cp_pci_tbl);
|
||||
|
@ -542,7 +534,7 @@ rx_status_loop:
|
|||
struct cp_desc *desc;
|
||||
unsigned buflen;
|
||||
|
||||
skb = cp->rx_skb[rx_tail].skb;
|
||||
skb = cp->rx_skb[rx_tail];
|
||||
BUG_ON(!skb);
|
||||
|
||||
desc = &cp->rx_ring[rx_tail];
|
||||
|
@ -551,7 +543,7 @@ rx_status_loop:
|
|||
break;
|
||||
|
||||
len = (status & 0x1fff) - 4;
|
||||
mapping = cp->rx_skb[rx_tail].mapping;
|
||||
mapping = le64_to_cpu(desc->addr);
|
||||
|
||||
if ((status & (FirstFrag | LastFrag)) != (FirstFrag | LastFrag)) {
|
||||
/* we don't support incoming fragmented frames.
|
||||
|
@ -572,7 +564,7 @@ rx_status_loop:
|
|||
|
||||
if (netif_msg_rx_status(cp))
|
||||
printk(KERN_DEBUG "%s: rx slot %d status 0x%x len %d\n",
|
||||
cp->dev->name, rx_tail, status, len);
|
||||
dev->name, rx_tail, status, len);
|
||||
|
||||
buflen = cp->rx_buf_sz + RX_OFFSET;
|
||||
new_skb = dev_alloc_skb (buflen);
|
||||
|
@ -582,7 +574,7 @@ rx_status_loop:
|
|||
}
|
||||
|
||||
skb_reserve(new_skb, RX_OFFSET);
|
||||
new_skb->dev = cp->dev;
|
||||
new_skb->dev = dev;
|
||||
|
||||
pci_unmap_single(cp->pdev, mapping,
|
||||
buflen, PCI_DMA_FROMDEVICE);
|
||||
|
@ -595,11 +587,9 @@ rx_status_loop:
|
|||
|
||||
skb_put(skb, len);
|
||||
|
||||
mapping =
|
||||
cp->rx_skb[rx_tail].mapping =
|
||||
pci_map_single(cp->pdev, new_skb->data,
|
||||
buflen, PCI_DMA_FROMDEVICE);
|
||||
cp->rx_skb[rx_tail].skb = new_skb;
|
||||
mapping = pci_map_single(cp->pdev, new_skb->data, buflen,
|
||||
PCI_DMA_FROMDEVICE);
|
||||
cp->rx_skb[rx_tail] = new_skb;
|
||||
|
||||
cp_rx_skb(cp, skb, desc);
|
||||
rx++;
|
||||
|
@ -717,19 +707,21 @@ static void cp_tx (struct cp_private *cp)
|
|||
unsigned tx_tail = cp->tx_tail;
|
||||
|
||||
while (tx_tail != tx_head) {
|
||||
struct cp_desc *txd = cp->tx_ring + tx_tail;
|
||||
struct sk_buff *skb;
|
||||
u32 status;
|
||||
|
||||
rmb();
|
||||
status = le32_to_cpu(cp->tx_ring[tx_tail].opts1);
|
||||
status = le32_to_cpu(txd->opts1);
|
||||
if (status & DescOwn)
|
||||
break;
|
||||
|
||||
skb = cp->tx_skb[tx_tail].skb;
|
||||
skb = cp->tx_skb[tx_tail];
|
||||
BUG_ON(!skb);
|
||||
|
||||
pci_unmap_single(cp->pdev, cp->tx_skb[tx_tail].mapping,
|
||||
cp->tx_skb[tx_tail].len, PCI_DMA_TODEVICE);
|
||||
pci_unmap_single(cp->pdev, le64_to_cpu(txd->addr),
|
||||
le32_to_cpu(txd->opts1) & 0xffff,
|
||||
PCI_DMA_TODEVICE);
|
||||
|
||||
if (status & LastFrag) {
|
||||
if (status & (TxError | TxFIFOUnder)) {
|
||||
|
@ -756,7 +748,7 @@ static void cp_tx (struct cp_private *cp)
|
|||
dev_kfree_skb_irq(skb);
|
||||
}
|
||||
|
||||
cp->tx_skb[tx_tail].skb = NULL;
|
||||
cp->tx_skb[tx_tail] = NULL;
|
||||
|
||||
tx_tail = NEXT_TX(tx_tail);
|
||||
}
|
||||
|
@ -826,9 +818,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
|
|||
txd->opts1 = cpu_to_le32(flags);
|
||||
wmb();
|
||||
|
||||
cp->tx_skb[entry].skb = skb;
|
||||
cp->tx_skb[entry].mapping = mapping;
|
||||
cp->tx_skb[entry].len = len;
|
||||
cp->tx_skb[entry] = skb;
|
||||
entry = NEXT_TX(entry);
|
||||
} else {
|
||||
struct cp_desc *txd;
|
||||
|
@ -844,9 +834,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
|
|||
first_len = skb_headlen(skb);
|
||||
first_mapping = pci_map_single(cp->pdev, skb->data,
|
||||
first_len, PCI_DMA_TODEVICE);
|
||||
cp->tx_skb[entry].skb = skb;
|
||||
cp->tx_skb[entry].mapping = first_mapping;
|
||||
cp->tx_skb[entry].len = first_len;
|
||||
cp->tx_skb[entry] = skb;
|
||||
entry = NEXT_TX(entry);
|
||||
|
||||
for (frag = 0; frag < skb_shinfo(skb)->nr_frags; frag++) {
|
||||
|
@ -887,9 +875,7 @@ static int cp_start_xmit (struct sk_buff *skb, struct net_device *dev)
|
|||
txd->opts1 = cpu_to_le32(ctrl);
|
||||
wmb();
|
||||
|
||||
cp->tx_skb[entry].skb = skb;
|
||||
cp->tx_skb[entry].mapping = mapping;
|
||||
cp->tx_skb[entry].len = len;
|
||||
cp->tx_skb[entry] = skb;
|
||||
entry = NEXT_TX(entry);
|
||||
}
|
||||
|
||||
|
@ -942,8 +928,6 @@ static void __cp_set_rx_mode (struct net_device *dev)
|
|||
/* Note: do not reorder, GCC is clever about common statements. */
|
||||
if (dev->flags & IFF_PROMISC) {
|
||||
/* Unconditionally log net taps. */
|
||||
printk (KERN_NOTICE "%s: Promiscuous mode enabled.\n",
|
||||
dev->name);
|
||||
rx_mode =
|
||||
AcceptBroadcast | AcceptMulticast | AcceptMyPhys |
|
||||
AcceptAllPhys;
|
||||
|
@ -1091,6 +1075,7 @@ static int cp_refill_rx (struct cp_private *cp)
|
|||
|
||||
for (i = 0; i < CP_RX_RING_SIZE; i++) {
|
||||
struct sk_buff *skb;
|
||||
dma_addr_t mapping;
|
||||
|
||||
skb = dev_alloc_skb(cp->rx_buf_sz + RX_OFFSET);
|
||||
if (!skb)
|
||||
|
@ -1099,12 +1084,12 @@ static int cp_refill_rx (struct cp_private *cp)
|
|||
skb->dev = cp->dev;
|
||||
skb_reserve(skb, RX_OFFSET);
|
||||
|
||||
cp->rx_skb[i].mapping = pci_map_single(cp->pdev,
|
||||
skb->data, cp->rx_buf_sz, PCI_DMA_FROMDEVICE);
|
||||
cp->rx_skb[i].skb = skb;
|
||||
mapping = pci_map_single(cp->pdev, skb->data, cp->rx_buf_sz,
|
||||
PCI_DMA_FROMDEVICE);
|
||||
cp->rx_skb[i] = skb;
|
||||
|
||||
cp->rx_ring[i].opts2 = 0;
|
||||
cp->rx_ring[i].addr = cpu_to_le64(cp->rx_skb[i].mapping);
|
||||
cp->rx_ring[i].addr = cpu_to_le64(mapping);
|
||||
if (i == (CP_RX_RING_SIZE - 1))
|
||||
cp->rx_ring[i].opts1 =
|
||||
cpu_to_le32(DescOwn | RingEnd | cp->rx_buf_sz);
|
||||
|
@ -1152,23 +1137,27 @@ static int cp_alloc_rings (struct cp_private *cp)
|
|||
|
||||
static void cp_clean_rings (struct cp_private *cp)
|
||||
{
|
||||
struct cp_desc *desc;
|
||||
unsigned i;
|
||||
|
||||
for (i = 0; i < CP_RX_RING_SIZE; i++) {
|
||||
if (cp->rx_skb[i].skb) {
|
||||
pci_unmap_single(cp->pdev, cp->rx_skb[i].mapping,
|
||||
if (cp->rx_skb[i]) {
|
||||
desc = cp->rx_ring + i;
|
||||
pci_unmap_single(cp->pdev, le64_to_cpu(desc->addr),
|
||||
cp->rx_buf_sz, PCI_DMA_FROMDEVICE);
|
||||
dev_kfree_skb(cp->rx_skb[i].skb);
|
||||
dev_kfree_skb(cp->rx_skb[i]);
|
||||
}
|
||||
}
|
||||
|
||||
for (i = 0; i < CP_TX_RING_SIZE; i++) {
|
||||
if (cp->tx_skb[i].skb) {
|
||||
struct sk_buff *skb = cp->tx_skb[i].skb;
|
||||
if (cp->tx_skb[i]) {
|
||||
struct sk_buff *skb = cp->tx_skb[i];
|
||||
|
||||
pci_unmap_single(cp->pdev, cp->tx_skb[i].mapping,
|
||||
cp->tx_skb[i].len, PCI_DMA_TODEVICE);
|
||||
if (le32_to_cpu(cp->tx_ring[i].opts1) & LastFrag)
|
||||
desc = cp->tx_ring + i;
|
||||
pci_unmap_single(cp->pdev, le64_to_cpu(desc->addr),
|
||||
le32_to_cpu(desc->opts1) & 0xffff,
|
||||
PCI_DMA_TODEVICE);
|
||||
if (le32_to_cpu(desc->opts1) & LastFrag)
|
||||
dev_kfree_skb(skb);
|
||||
cp->net_stats.tx_dropped++;
|
||||
}
|
||||
|
@ -1177,8 +1166,8 @@ static void cp_clean_rings (struct cp_private *cp)
|
|||
memset(cp->rx_ring, 0, sizeof(struct cp_desc) * CP_RX_RING_SIZE);
|
||||
memset(cp->tx_ring, 0, sizeof(struct cp_desc) * CP_TX_RING_SIZE);
|
||||
|
||||
memset(&cp->rx_skb, 0, sizeof(struct ring_info) * CP_RX_RING_SIZE);
|
||||
memset(&cp->tx_skb, 0, sizeof(struct ring_info) * CP_TX_RING_SIZE);
|
||||
memset(cp->rx_skb, 0, sizeof(struct sk_buff *) * CP_RX_RING_SIZE);
|
||||
memset(cp->tx_skb, 0, sizeof(struct sk_buff *) * CP_TX_RING_SIZE);
|
||||
}
|
||||
|
||||
static void cp_free_rings (struct cp_private *cp)
|
||||
|
@ -1557,7 +1546,7 @@ static void cp_get_ethtool_stats (struct net_device *dev,
|
|||
pci_free_consistent(cp->pdev, sizeof(*nic_stats), nic_stats, dma);
|
||||
}
|
||||
|
||||
static struct ethtool_ops cp_ethtool_ops = {
|
||||
static const struct ethtool_ops cp_ethtool_ops = {
|
||||
.get_drvinfo = cp_get_drvinfo,
|
||||
.get_regs_len = cp_get_regs_len,
|
||||
.get_stats_count = cp_get_stats_count,
|
||||
|
@ -2010,7 +1999,6 @@ static void cp_remove_one (struct pci_dev *pdev)
|
|||
struct net_device *dev = pci_get_drvdata(pdev);
|
||||
struct cp_private *cp = netdev_priv(dev);
|
||||
|
||||
BUG_ON(!dev);
|
||||
unregister_netdev(dev);
|
||||
iounmap(cp->regs);
|
||||
if (cp->wol_enabled)
|
||||
|
@ -2025,14 +2013,12 @@ static void cp_remove_one (struct pci_dev *pdev)
|
|||
#ifdef CONFIG_PM
|
||||
static int cp_suspend (struct pci_dev *pdev, pm_message_t state)
|
||||
{
|
||||
struct net_device *dev;
|
||||
struct cp_private *cp;
|
||||
struct net_device *dev = pci_get_drvdata(pdev);
|
||||
struct cp_private *cp = netdev_priv(dev);
|
||||
unsigned long flags;
|
||||
|
||||
dev = pci_get_drvdata (pdev);
|
||||
cp = netdev_priv(dev);
|
||||
|
||||
if (!dev || !netif_running (dev)) return 0;
|
||||
if (!netif_running(dev))
|
||||
return 0;
|
||||
|
||||
netif_device_detach (dev);
|
||||
netif_stop_queue (dev);
|
||||
|
@ -2098,7 +2084,7 @@ static int __init cp_init (void)
|
|||
#ifdef MODULE
|
||||
printk("%s", version);
|
||||
#endif
|
||||
return pci_module_init (&cp_driver);
|
||||
return pci_register_driver(&cp_driver);
|
||||
}
|
||||
|
||||
static void __exit cp_exit (void)
|
||||
|
|
|
@ -90,7 +90,7 @@
|
|||
*/
|
||||
|
||||
#define DRV_NAME "8139too"
|
||||
#define DRV_VERSION "0.9.27"
|
||||
#define DRV_VERSION "0.9.28"
|
||||
|
||||
|
||||
#include <linux/module.h>
|
||||
|
@ -639,7 +639,7 @@ static void __set_rx_mode (struct net_device *dev);
|
|||
static void rtl8139_hw_start (struct net_device *dev);
|
||||
static void rtl8139_thread (void *_data);
|
||||
static void rtl8139_tx_timeout_task(void *_data);
|
||||
static struct ethtool_ops rtl8139_ethtool_ops;
|
||||
static const struct ethtool_ops rtl8139_ethtool_ops;
|
||||
|
||||
/* write MMIO register, with flush */
|
||||
/* Flush avoids rtl8139 bug w/ posted MMIO writes */
|
||||
|
@ -2446,7 +2446,7 @@ static void rtl8139_get_strings(struct net_device *dev, u32 stringset, u8 *data)
|
|||
memcpy(data, ethtool_stats_keys, sizeof(ethtool_stats_keys));
|
||||
}
|
||||
|
||||
static struct ethtool_ops rtl8139_ethtool_ops = {
|
||||
static const struct ethtool_ops rtl8139_ethtool_ops = {
|
||||
.get_drvinfo = rtl8139_get_drvinfo,
|
||||
.get_settings = rtl8139_get_settings,
|
||||
.set_settings = rtl8139_set_settings,
|
||||
|
@ -2512,9 +2512,6 @@ static void __set_rx_mode (struct net_device *dev)
|
|||
|
||||
/* Note: do not reorder, GCC is clever about common statements. */
|
||||
if (dev->flags & IFF_PROMISC) {
|
||||
/* Unconditionally log net taps. */
|
||||
printk (KERN_NOTICE "%s: Promiscuous mode enabled.\n",
|
||||
dev->name);
|
||||
rx_mode =
|
||||
AcceptBroadcast | AcceptMulticast | AcceptMyPhys |
|
||||
AcceptAllPhys;
|
||||
|
@ -2629,7 +2626,7 @@ static int __init rtl8139_init_module (void)
|
|||
printk (KERN_INFO RTL8139_DRIVER_NAME "\n");
|
||||
#endif
|
||||
|
||||
return pci_module_init (&rtl8139_pci_driver);
|
||||
return pci_register_driver(&rtl8139_pci_driver);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -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(dev->irq);
|
||||
|
||||
|
||||
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;
|
||||
|
@ -338,7 +338,7 @@ static int ei_start_xmit(struct sk_buff *skb, struct net_device *dev)
|
|||
netif_stop_queue(dev);
|
||||
outb_p(ENISR_ALL, e8390_base + EN0_IMR);
|
||||
spin_unlock(&ei_local->page_lock);
|
||||
enable_irq(dev->irq);
|
||||
enable_irq_lockdep(dev->irq);
|
||||
ei_local->stat.tx_errors++;
|
||||
return 1;
|
||||
}
|
||||
|
@ -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(dev->irq);
|
||||
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)
|
||||
|
@ -505,9 +505,9 @@ irqreturn_t ei_interrupt(int irq, void *dev_id, struct pt_regs * regs)
|
|||
#ifdef CONFIG_NET_POLL_CONTROLLER
|
||||
void ei_poll(struct net_device *dev)
|
||||
{
|
||||
disable_irq(dev->irq);
|
||||
disable_irq_lockdep(dev->irq);
|
||||
ei_interrupt(dev->irq, dev, NULL);
|
||||
enable_irq(dev->irq);
|
||||
enable_irq_lockdep(dev->irq);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
@ -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)
|
||||
|
|
|
@ -438,12 +438,6 @@ config MIPS_JAZZ_SONIC
|
|||
This is the driver for the onboard card of MIPS Magnum 4000,
|
||||
Acer PICA, Olivetti M700-10 and a few other identical OEM systems.
|
||||
|
||||
config MIPS_GT96100ETH
|
||||
bool "MIPS GT96100 Ethernet support"
|
||||
depends on NET_ETHERNET && MIPS_GT96100
|
||||
help
|
||||
Say Y here to support the Ethernet subsystem on your GT96100 card.
|
||||
|
||||
config MIPS_AU1X00_ENET
|
||||
bool "MIPS AU1000 Ethernet support"
|
||||
depends on NET_ETHERNET && SOC_AU1X00
|
||||
|
@ -1300,6 +1294,23 @@ config PCNET32
|
|||
<file:Documentation/networking/net-modules.txt>. The module
|
||||
will be called pcnet32.
|
||||
|
||||
config PCNET32_NAPI
|
||||
bool "Use RX polling (NAPI) (EXPERIMENTAL)"
|
||||
depends on PCNET32 && EXPERIMENTAL
|
||||
help
|
||||
NAPI is a new driver API designed to reduce CPU and interrupt load
|
||||
when the driver is receiving lots of packets from the card. It is
|
||||
still somewhat experimental and thus not yet enabled by default.
|
||||
|
||||
If your estimated Rx load is 10kpps or more, or if the card will be
|
||||
deployed on potentially unfriendly networks (e.g. in a firewall),
|
||||
then say Y here.
|
||||
|
||||
See <file:Documentation/networking/NAPI_HOWTO.txt> for more
|
||||
information.
|
||||
|
||||
If in doubt, say N.
|
||||
|
||||
config AMD8111_ETH
|
||||
tristate "AMD 8111 (new PCI lance) support"
|
||||
depends on NET_PCI && PCI
|
||||
|
@ -1411,6 +1422,22 @@ config FORCEDETH
|
|||
<file:Documentation/networking/net-modules.txt>. The module will be
|
||||
called forcedeth.
|
||||
|
||||
config FORCEDETH_NAPI
|
||||
bool "Use Rx and Tx Polling (NAPI) (EXPERIMENTAL)"
|
||||
depends on FORCEDETH && EXPERIMENTAL
|
||||
help
|
||||
NAPI is a new driver API designed to reduce CPU and interrupt load
|
||||
when the driver is receiving lots of packets from the card. It is
|
||||
still somewhat experimental and thus not yet enabled by default.
|
||||
|
||||
If your estimated Rx load is 10kpps or more, or if the card will be
|
||||
deployed on potentially unfriendly networks (e.g. in a firewall),
|
||||
then say Y here.
|
||||
|
||||
See <file:Documentation/networking/NAPI_HOWTO.txt> for more
|
||||
information.
|
||||
|
||||
If in doubt, say N.
|
||||
|
||||
config CS89x0
|
||||
tristate "CS89x0 support"
|
||||
|
@ -2262,7 +2289,7 @@ config UGETH_HAS_GIGA
|
|||
|
||||
config MV643XX_ETH
|
||||
tristate "MV-643XX Ethernet support"
|
||||
depends on MOMENCO_OCELOT_C || MOMENCO_JAGUAR_ATX || MV64360 || MOMENCO_OCELOT_3 || PPC_MULTIPLATFORM
|
||||
depends on MOMENCO_OCELOT_C || MOMENCO_JAGUAR_ATX || MV64360 || MOMENCO_OCELOT_3 || (PPC_MULTIPLATFORM && PPC32)
|
||||
select MII
|
||||
help
|
||||
This driver supports the gigabit Ethernet on the Marvell MV643XX
|
||||
|
@ -2290,6 +2317,15 @@ config MV643XX_ETH_2
|
|||
This enables support for Port 2 of the Marvell MV643XX Gigabit
|
||||
Ethernet.
|
||||
|
||||
config QLA3XXX
|
||||
tristate "QLogic QLA3XXX Network Driver Support"
|
||||
depends on PCI
|
||||
help
|
||||
This driver supports QLogic ISP3XXX gigabit Ethernet cards.
|
||||
|
||||
To compile this driver as a module, choose M here: the module
|
||||
will be called qla3xxx.
|
||||
|
||||
endmenu
|
||||
|
||||
#
|
||||
|
@ -2318,6 +2354,15 @@ config CHELSIO_T1
|
|||
To compile this driver as a module, choose M here: the module
|
||||
will be called cxgb.
|
||||
|
||||
config EHEA
|
||||
tristate "eHEA Ethernet support"
|
||||
depends on IBMEBUS
|
||||
---help---
|
||||
This driver supports the IBM pSeries eHEA ethernet adapter.
|
||||
|
||||
To compile the driver as a module, choose M here. The module
|
||||
will be called ehea.
|
||||
|
||||
config IXGB
|
||||
tristate "Intel(R) PRO/10GbE support"
|
||||
depends on PCI
|
||||
|
@ -2550,6 +2595,7 @@ config PLIP
|
|||
|
||||
config PPP
|
||||
tristate "PPP (point-to-point protocol) support"
|
||||
select SLHC
|
||||
---help---
|
||||
PPP (Point to Point Protocol) is a newer and better SLIP. It serves
|
||||
the same purpose: sending Internet traffic over telephone (and other
|
||||
|
@ -2730,6 +2776,7 @@ config SLIP
|
|||
config SLIP_COMPRESSED
|
||||
bool "CSLIP compressed headers"
|
||||
depends on SLIP
|
||||
select SLHC
|
||||
---help---
|
||||
This protocol is faster than SLIP because it uses compression on the
|
||||
TCP/IP headers (not on the data itself), but it has to be supported
|
||||
|
@ -2742,6 +2789,12 @@ config SLIP_COMPRESSED
|
|||
<http://www.tldp.org/docs.html#howto>, explains how to configure
|
||||
CSLIP. This won't enlarge your kernel.
|
||||
|
||||
config SLHC
|
||||
tristate
|
||||
help
|
||||
This option enables Van Jacobsen serial line header compression
|
||||
routines.
|
||||
|
||||
config SLIP_SMART
|
||||
bool "Keepalive and linefill"
|
||||
depends on SLIP
|
||||
|
|
|
@ -2,14 +2,11 @@
|
|||
# Makefile for the Linux network (ethercard) device drivers.
|
||||
#
|
||||
|
||||
ifeq ($(CONFIG_ISDN_PPP),y)
|
||||
obj-$(CONFIG_ISDN) += slhc.o
|
||||
endif
|
||||
|
||||
obj-$(CONFIG_E1000) += e1000/
|
||||
obj-$(CONFIG_IBM_EMAC) += ibm_emac/
|
||||
obj-$(CONFIG_IXGB) += ixgb/
|
||||
obj-$(CONFIG_CHELSIO_T1) += chelsio/
|
||||
obj-$(CONFIG_EHEA) += ehea/
|
||||
obj-$(CONFIG_BONDING) += bonding/
|
||||
obj-$(CONFIG_GIANFAR) += gianfar_driver.o
|
||||
|
||||
|
@ -113,8 +110,9 @@ obj-$(CONFIG_FORCEDETH) += forcedeth.o
|
|||
obj-$(CONFIG_NE_H8300) += ne-h8300.o 8390.o
|
||||
|
||||
obj-$(CONFIG_MV643XX_ETH) += mv643xx_eth.o
|
||||
obj-$(CONFIG_QLA3XXX) += qla3xxx.o
|
||||
|
||||
obj-$(CONFIG_PPP) += ppp_generic.o slhc.o
|
||||
obj-$(CONFIG_PPP) += ppp_generic.o
|
||||
obj-$(CONFIG_PPP_ASYNC) += ppp_async.o
|
||||
obj-$(CONFIG_PPP_SYNC_TTY) += ppp_synctty.o
|
||||
obj-$(CONFIG_PPP_DEFLATE) += ppp_deflate.o
|
||||
|
@ -123,9 +121,7 @@ obj-$(CONFIG_PPP_MPPE) += ppp_mppe.o
|
|||
obj-$(CONFIG_PPPOE) += pppox.o pppoe.o
|
||||
|
||||
obj-$(CONFIG_SLIP) += slip.o
|
||||
ifeq ($(CONFIG_SLIP_COMPRESSED),y)
|
||||
obj-$(CONFIG_SLIP) += slhc.o
|
||||
endif
|
||||
obj-$(CONFIG_SLHC) += slhc.o
|
||||
|
||||
obj-$(CONFIG_DUMMY) += dummy.o
|
||||
obj-$(CONFIG_IFB) += ifb.o
|
||||
|
@ -174,7 +170,6 @@ obj-$(CONFIG_HPLANCE) += hplance.o 7990.o
|
|||
obj-$(CONFIG_MVME147_NET) += mvme147.o 7990.o
|
||||
obj-$(CONFIG_EQUALIZER) += eql.o
|
||||
obj-$(CONFIG_MIPS_JAZZ_SONIC) += jazzsonic.o
|
||||
obj-$(CONFIG_MIPS_GT96100ETH) += gt96100eth.o
|
||||
obj-$(CONFIG_MIPS_AU1X00_ENET) += au1000_eth.o
|
||||
obj-$(CONFIG_MIPS_SIM_NET) += mipsnet.o
|
||||
obj-$(CONFIG_SGI_IOC3_ETH) += ioc3-eth.o
|
||||
|
|
|
@ -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";
|
||||
|
||||
|
@ -451,7 +451,7 @@ static int ace_get_settings(struct net_device *, struct ethtool_cmd *);
|
|||
static int ace_set_settings(struct net_device *, struct ethtool_cmd *);
|
||||
static void ace_get_drvinfo(struct net_device *, struct ethtool_drvinfo *);
|
||||
|
||||
static struct ethtool_ops ace_ethtool_ops = {
|
||||
static const struct ethtool_ops ace_ethtool_ops = {
|
||||
.get_settings = ace_get_settings,
|
||||
.set_settings = ace_set_settings,
|
||||
.get_drvinfo = ace_get_drvinfo,
|
||||
|
@ -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(®s->CpuCtrl) | CPU_HALT, ®s->CpuCtrl);
|
||||
if (ap->version >= 2)
|
||||
writel(readl(®s->CpuBCtrl) | CPU_HALT, ®s->CpuBCtrl);
|
||||
|
||||
|
||||
/*
|
||||
* This clears any pending interrupts
|
||||
*/
|
||||
|
@ -725,7 +725,7 @@ static struct pci_driver acenic_pci_driver = {
|
|||
|
||||
static int __init acenic_init(void)
|
||||
{
|
||||
return pci_module_init(&acenic_pci_driver);
|
||||
return pci_register_driver(&acenic_pci_driver);
|
||||
}
|
||||
|
||||
static void __exit acenic_exit(void)
|
||||
|
@ -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 *) ®s->Window +
|
||||
tdest = (void __iomem *) ®s->Window +
|
||||
(dest & (ACE_WINDOW_SIZE - 1));
|
||||
writel(dest & ~(ACE_WINDOW_SIZE - 1), ®s->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 *) ®s->Window +
|
||||
tdest = (void __iomem *) ®s->Window +
|
||||
(dest & (ACE_WINDOW_SIZE - 1));
|
||||
writel(dest & ~(ACE_WINDOW_SIZE - 1), ®s->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, ®s->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);
|
||||
|
|
|
@ -178,7 +178,7 @@ static struct pci_driver com20020pci_driver = {
|
|||
static int __init com20020pci_init(void)
|
||||
{
|
||||
BUGLVL(D_NORMAL) printk(VERSION);
|
||||
return pci_module_init(&com20020pci_driver);
|
||||
return pci_register_driver(&com20020pci_driver);
|
||||
}
|
||||
|
||||
static void __exit com20020pci_cleanup(void)
|
||||
|
|
|
@ -825,8 +825,6 @@ static void set_multicast_list(struct net_device *dev)
|
|||
ariadne_init_ring(dev);
|
||||
|
||||
if (dev->flags & IFF_PROMISC) {
|
||||
/* Log any net taps. */
|
||||
printk(KERN_INFO "%s: Promiscuous mode enabled.\n", dev->name);
|
||||
lance->RAP = CSR15; /* Mode Register */
|
||||
lance->RDP = PROM; /* Set promiscuous mode */
|
||||
} else {
|
||||
|
|
|
@ -39,3 +39,10 @@ config ARM_AT91_ETHER
|
|||
help
|
||||
If you wish to compile a kernel for the AT91RM9200 and enable
|
||||
ethernet support, then you should always answer Y to this.
|
||||
|
||||
config EP93XX_ETH
|
||||
tristate "EP93xx Ethernet support"
|
||||
depends on NET_ETHERNET && ARM && ARCH_EP93XX
|
||||
help
|
||||
This is a driver for the ethernet hardware included in EP93xx CPUs.
|
||||
Say Y if you are building a kernel for EP93xx based devices.
|
||||
|
|
|
@ -8,3 +8,4 @@ obj-$(CONFIG_ARM_ETHERH) += etherh.o
|
|||
obj-$(CONFIG_ARM_ETHER3) += ether3.o
|
||||
obj-$(CONFIG_ARM_ETHER1) += ether1.o
|
||||
obj-$(CONFIG_ARM_AT91_ETHER) += at91_ether.o
|
||||
obj-$(CONFIG_EP93XX_ETH) += ep93xx_eth.o
|
||||
|
|
|
@ -648,7 +648,7 @@ static void at91ether_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo
|
|||
strlcpy(info->bus_info, dev->class_dev.dev->bus_id, sizeof(info->bus_info));
|
||||
}
|
||||
|
||||
static struct ethtool_ops at91ether_ethtool_ops = {
|
||||
static const struct ethtool_ops at91ether_ethtool_ops = {
|
||||
.get_settings = at91ether_get_settings,
|
||||
.set_settings = at91ether_set_settings,
|
||||
.get_drvinfo = at91ether_get_drvinfo,
|
||||
|
|
|
@ -0,0 +1,944 @@
|
|||
/*
|
||||
* EP93xx ethernet network device driver
|
||||
* Copyright (C) 2006 Lennert Buytenhek <buytenh@wantstofly.org>
|
||||
* Dedicated to Marija Kulikova.
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*/
|
||||
|
||||
#include <linux/config.h>
|
||||
#include <linux/dma-mapping.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/netdevice.h>
|
||||
#include <linux/mii.h>
|
||||
#include <linux/etherdevice.h>
|
||||
#include <linux/ethtool.h>
|
||||
#include <linux/init.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/platform_device.h>
|
||||
#include <linux/delay.h>
|
||||
#include <asm/arch/ep93xx-regs.h>
|
||||
#include <asm/arch/platform.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
#define DRV_MODULE_NAME "ep93xx-eth"
|
||||
#define DRV_MODULE_VERSION "0.1"
|
||||
|
||||
#define RX_QUEUE_ENTRIES 64
|
||||
#define TX_QUEUE_ENTRIES 8
|
||||
|
||||
#define MAX_PKT_SIZE 2044
|
||||
#define PKT_BUF_SIZE 2048
|
||||
|
||||
#define REG_RXCTL 0x0000
|
||||
#define REG_RXCTL_DEFAULT 0x00073800
|
||||
#define REG_TXCTL 0x0004
|
||||
#define REG_TXCTL_ENABLE 0x00000001
|
||||
#define REG_MIICMD 0x0010
|
||||
#define REG_MIICMD_READ 0x00008000
|
||||
#define REG_MIICMD_WRITE 0x00004000
|
||||
#define REG_MIIDATA 0x0014
|
||||
#define REG_MIISTS 0x0018
|
||||
#define REG_MIISTS_BUSY 0x00000001
|
||||
#define REG_SELFCTL 0x0020
|
||||
#define REG_SELFCTL_RESET 0x00000001
|
||||
#define REG_INTEN 0x0024
|
||||
#define REG_INTEN_TX 0x00000008
|
||||
#define REG_INTEN_RX 0x00000007
|
||||
#define REG_INTSTSP 0x0028
|
||||
#define REG_INTSTS_TX 0x00000008
|
||||
#define REG_INTSTS_RX 0x00000004
|
||||
#define REG_INTSTSC 0x002c
|
||||
#define REG_AFP 0x004c
|
||||
#define REG_INDAD0 0x0050
|
||||
#define REG_INDAD1 0x0051
|
||||
#define REG_INDAD2 0x0052
|
||||
#define REG_INDAD3 0x0053
|
||||
#define REG_INDAD4 0x0054
|
||||
#define REG_INDAD5 0x0055
|
||||
#define REG_GIINTMSK 0x0064
|
||||
#define REG_GIINTMSK_ENABLE 0x00008000
|
||||
#define REG_BMCTL 0x0080
|
||||
#define REG_BMCTL_ENABLE_TX 0x00000100
|
||||
#define REG_BMCTL_ENABLE_RX 0x00000001
|
||||
#define REG_BMSTS 0x0084
|
||||
#define REG_BMSTS_RX_ACTIVE 0x00000008
|
||||
#define REG_RXDQBADD 0x0090
|
||||
#define REG_RXDQBLEN 0x0094
|
||||
#define REG_RXDCURADD 0x0098
|
||||
#define REG_RXDENQ 0x009c
|
||||
#define REG_RXSTSQBADD 0x00a0
|
||||
#define REG_RXSTSQBLEN 0x00a4
|
||||
#define REG_RXSTSQCURADD 0x00a8
|
||||
#define REG_RXSTSENQ 0x00ac
|
||||
#define REG_TXDQBADD 0x00b0
|
||||
#define REG_TXDQBLEN 0x00b4
|
||||
#define REG_TXDQCURADD 0x00b8
|
||||
#define REG_TXDENQ 0x00bc
|
||||
#define REG_TXSTSQBADD 0x00c0
|
||||
#define REG_TXSTSQBLEN 0x00c4
|
||||
#define REG_TXSTSQCURADD 0x00c8
|
||||
#define REG_MAXFRMLEN 0x00e8
|
||||
|
||||
struct ep93xx_rdesc
|
||||
{
|
||||
u32 buf_addr;
|
||||
u32 rdesc1;
|
||||
};
|
||||
|
||||
#define RDESC1_NSOF 0x80000000
|
||||
#define RDESC1_BUFFER_INDEX 0x7fff0000
|
||||
#define RDESC1_BUFFER_LENGTH 0x0000ffff
|
||||
|
||||
struct ep93xx_rstat
|
||||
{
|
||||
u32 rstat0;
|
||||
u32 rstat1;
|
||||
};
|
||||
|
||||
#define RSTAT0_RFP 0x80000000
|
||||
#define RSTAT0_RWE 0x40000000
|
||||
#define RSTAT0_EOF 0x20000000
|
||||
#define RSTAT0_EOB 0x10000000
|
||||
#define RSTAT0_AM 0x00c00000
|
||||
#define RSTAT0_RX_ERR 0x00200000
|
||||
#define RSTAT0_OE 0x00100000
|
||||
#define RSTAT0_FE 0x00080000
|
||||
#define RSTAT0_RUNT 0x00040000
|
||||
#define RSTAT0_EDATA 0x00020000
|
||||
#define RSTAT0_CRCE 0x00010000
|
||||
#define RSTAT0_CRCI 0x00008000
|
||||
#define RSTAT0_HTI 0x00003f00
|
||||
#define RSTAT1_RFP 0x80000000
|
||||
#define RSTAT1_BUFFER_INDEX 0x7fff0000
|
||||
#define RSTAT1_FRAME_LENGTH 0x0000ffff
|
||||
|
||||
struct ep93xx_tdesc
|
||||
{
|
||||
u32 buf_addr;
|
||||
u32 tdesc1;
|
||||
};
|
||||
|
||||
#define TDESC1_EOF 0x80000000
|
||||
#define TDESC1_BUFFER_INDEX 0x7fff0000
|
||||
#define TDESC1_BUFFER_ABORT 0x00008000
|
||||
#define TDESC1_BUFFER_LENGTH 0x00000fff
|
||||
|
||||
struct ep93xx_tstat
|
||||
{
|
||||
u32 tstat0;
|
||||
};
|
||||
|
||||
#define TSTAT0_TXFP 0x80000000
|
||||
#define TSTAT0_TXWE 0x40000000
|
||||
#define TSTAT0_FA 0x20000000
|
||||
#define TSTAT0_LCRS 0x10000000
|
||||
#define TSTAT0_OW 0x04000000
|
||||
#define TSTAT0_TXU 0x02000000
|
||||
#define TSTAT0_ECOLL 0x01000000
|
||||
#define TSTAT0_NCOLL 0x001f0000
|
||||
#define TSTAT0_BUFFER_INDEX 0x00007fff
|
||||
|
||||
struct ep93xx_descs
|
||||
{
|
||||
struct ep93xx_rdesc rdesc[RX_QUEUE_ENTRIES];
|
||||
struct ep93xx_tdesc tdesc[TX_QUEUE_ENTRIES];
|
||||
struct ep93xx_rstat rstat[RX_QUEUE_ENTRIES];
|
||||
struct ep93xx_tstat tstat[TX_QUEUE_ENTRIES];
|
||||
};
|
||||
|
||||
struct ep93xx_priv
|
||||
{
|
||||
struct resource *res;
|
||||
void *base_addr;
|
||||
int irq;
|
||||
|
||||
struct ep93xx_descs *descs;
|
||||
dma_addr_t descs_dma_addr;
|
||||
|
||||
void *rx_buf[RX_QUEUE_ENTRIES];
|
||||
void *tx_buf[TX_QUEUE_ENTRIES];
|
||||
|
||||
spinlock_t rx_lock;
|
||||
unsigned int rx_pointer;
|
||||
unsigned int tx_clean_pointer;
|
||||
unsigned int tx_pointer;
|
||||
spinlock_t tx_pending_lock;
|
||||
unsigned int tx_pending;
|
||||
|
||||
struct net_device_stats stats;
|
||||
|
||||
struct mii_if_info mii;
|
||||
u8 mdc_divisor;
|
||||
};
|
||||
|
||||
#define rdb(ep, off) __raw_readb((ep)->base_addr + (off))
|
||||
#define rdw(ep, off) __raw_readw((ep)->base_addr + (off))
|
||||
#define rdl(ep, off) __raw_readl((ep)->base_addr + (off))
|
||||
#define wrb(ep, off, val) __raw_writeb((val), (ep)->base_addr + (off))
|
||||
#define wrw(ep, off, val) __raw_writew((val), (ep)->base_addr + (off))
|
||||
#define wrl(ep, off, val) __raw_writel((val), (ep)->base_addr + (off))
|
||||
|
||||
static int ep93xx_mdio_read(struct net_device *dev, int phy_id, int reg);
|
||||
|
||||
static struct net_device_stats *ep93xx_get_stats(struct net_device *dev)
|
||||
{
|
||||
struct ep93xx_priv *ep = netdev_priv(dev);
|
||||
return &(ep->stats);
|
||||
}
|
||||
|
||||
static int ep93xx_rx(struct net_device *dev, int *budget)
|
||||
{
|
||||
struct ep93xx_priv *ep = netdev_priv(dev);
|
||||
int tail_offset;
|
||||
int rx_done;
|
||||
int processed;
|
||||
|
||||
tail_offset = rdl(ep, REG_RXSTSQCURADD) - ep->descs_dma_addr;
|
||||
|
||||
rx_done = 0;
|
||||
processed = 0;
|
||||
while (*budget > 0) {
|
||||
int entry;
|
||||
struct ep93xx_rstat *rstat;
|
||||
u32 rstat0;
|
||||
u32 rstat1;
|
||||
int length;
|
||||
struct sk_buff *skb;
|
||||
|
||||
entry = ep->rx_pointer;
|
||||
rstat = ep->descs->rstat + entry;
|
||||
if ((void *)rstat - (void *)ep->descs == tail_offset) {
|
||||
rx_done = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
rstat0 = rstat->rstat0;
|
||||
rstat1 = rstat->rstat1;
|
||||
rstat->rstat0 = 0;
|
||||
rstat->rstat1 = 0;
|
||||
|
||||
if (!(rstat0 & RSTAT0_RFP))
|
||||
printk(KERN_CRIT "ep93xx_rx: buffer not done "
|
||||
" %.8x %.8x\n", rstat0, rstat1);
|
||||
if (!(rstat0 & RSTAT0_EOF))
|
||||
printk(KERN_CRIT "ep93xx_rx: not end-of-frame "
|
||||
" %.8x %.8x\n", rstat0, rstat1);
|
||||
if (!(rstat0 & RSTAT0_EOB))
|
||||
printk(KERN_CRIT "ep93xx_rx: not end-of-buffer "
|
||||
" %.8x %.8x\n", rstat0, rstat1);
|
||||
if (!(rstat1 & RSTAT1_RFP))
|
||||
printk(KERN_CRIT "ep93xx_rx: buffer1 not done "
|
||||
" %.8x %.8x\n", rstat0, rstat1);
|
||||
if ((rstat1 & RSTAT1_BUFFER_INDEX) >> 16 != entry)
|
||||
printk(KERN_CRIT "ep93xx_rx: entry mismatch "
|
||||
" %.8x %.8x\n", rstat0, rstat1);
|
||||
|
||||
if (!(rstat0 & RSTAT0_RWE)) {
|
||||
printk(KERN_NOTICE "ep93xx_rx: receive error "
|
||||
" %.8x %.8x\n", rstat0, rstat1);
|
||||
|
||||
ep->stats.rx_errors++;
|
||||
if (rstat0 & RSTAT0_OE)
|
||||
ep->stats.rx_fifo_errors++;
|
||||
if (rstat0 & RSTAT0_FE)
|
||||
ep->stats.rx_frame_errors++;
|
||||
if (rstat0 & (RSTAT0_RUNT | RSTAT0_EDATA))
|
||||
ep->stats.rx_length_errors++;
|
||||
if (rstat0 & RSTAT0_CRCE)
|
||||
ep->stats.rx_crc_errors++;
|
||||
goto err;
|
||||
}
|
||||
|
||||
length = rstat1 & RSTAT1_FRAME_LENGTH;
|
||||
if (length > MAX_PKT_SIZE) {
|
||||
printk(KERN_NOTICE "ep93xx_rx: invalid length "
|
||||
" %.8x %.8x\n", rstat0, rstat1);
|
||||
goto err;
|
||||
}
|
||||
|
||||
/* Strip FCS. */
|
||||
if (rstat0 & RSTAT0_CRCI)
|
||||
length -= 4;
|
||||
|
||||
skb = dev_alloc_skb(length + 2);
|
||||
if (likely(skb != NULL)) {
|
||||
skb->dev = dev;
|
||||
skb_reserve(skb, 2);
|
||||
dma_sync_single(NULL, ep->descs->rdesc[entry].buf_addr,
|
||||
length, DMA_FROM_DEVICE);
|
||||
eth_copy_and_sum(skb, ep->rx_buf[entry], length, 0);
|
||||
skb_put(skb, length);
|
||||
skb->protocol = eth_type_trans(skb, dev);
|
||||
|
||||
dev->last_rx = jiffies;
|
||||
|
||||
netif_receive_skb(skb);
|
||||
|
||||
ep->stats.rx_packets++;
|
||||
ep->stats.rx_bytes += length;
|
||||
} else {
|
||||
ep->stats.rx_dropped++;
|
||||
}
|
||||
|
||||
err:
|
||||
ep->rx_pointer = (entry + 1) & (RX_QUEUE_ENTRIES - 1);
|
||||
processed++;
|
||||
dev->quota--;
|
||||
(*budget)--;
|
||||
}
|
||||
|
||||
if (processed) {
|
||||
wrw(ep, REG_RXDENQ, processed);
|
||||
wrw(ep, REG_RXSTSENQ, processed);
|
||||
}
|
||||
|
||||
return !rx_done;
|
||||
}
|
||||
|
||||
static int ep93xx_have_more_rx(struct ep93xx_priv *ep)
|
||||
{
|
||||
struct ep93xx_rstat *rstat;
|
||||
int tail_offset;
|
||||
|
||||
rstat = ep->descs->rstat + ep->rx_pointer;
|
||||
tail_offset = rdl(ep, REG_RXSTSQCURADD) - ep->descs_dma_addr;
|
||||
|
||||
return !((void *)rstat - (void *)ep->descs == tail_offset);
|
||||
}
|
||||
|
||||
static int ep93xx_poll(struct net_device *dev, int *budget)
|
||||
{
|
||||
struct ep93xx_priv *ep = netdev_priv(dev);
|
||||
|
||||
/*
|
||||
* @@@ Have to stop polling if device is downed while we
|
||||
* are polling.
|
||||
*/
|
||||
|
||||
poll_some_more:
|
||||
if (ep93xx_rx(dev, budget))
|
||||
return 1;
|
||||
|
||||
netif_rx_complete(dev);
|
||||
|
||||
spin_lock_irq(&ep->rx_lock);
|
||||
wrl(ep, REG_INTEN, REG_INTEN_TX | REG_INTEN_RX);
|
||||
if (ep93xx_have_more_rx(ep)) {
|
||||
wrl(ep, REG_INTEN, REG_INTEN_TX);
|
||||
wrl(ep, REG_INTSTSP, REG_INTSTS_RX);
|
||||
spin_unlock_irq(&ep->rx_lock);
|
||||
|
||||
if (netif_rx_reschedule(dev, 0))
|
||||
goto poll_some_more;
|
||||
|
||||
return 0;
|
||||
}
|
||||
spin_unlock_irq(&ep->rx_lock);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ep93xx_xmit(struct sk_buff *skb, struct net_device *dev)
|
||||
{
|
||||
struct ep93xx_priv *ep = netdev_priv(dev);
|
||||
int entry;
|
||||
|
||||
if (unlikely(skb->len) > MAX_PKT_SIZE) {
|
||||
ep->stats.tx_dropped++;
|
||||
dev_kfree_skb(skb);
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
||||
entry = ep->tx_pointer;
|
||||
ep->tx_pointer = (ep->tx_pointer + 1) & (TX_QUEUE_ENTRIES - 1);
|
||||
|
||||
ep->descs->tdesc[entry].tdesc1 =
|
||||
TDESC1_EOF | (entry << 16) | (skb->len & 0xfff);
|
||||
skb_copy_and_csum_dev(skb, ep->tx_buf[entry]);
|
||||
dma_sync_single(NULL, ep->descs->tdesc[entry].buf_addr,
|
||||
skb->len, DMA_TO_DEVICE);
|
||||
dev_kfree_skb(skb);
|
||||
|
||||
dev->trans_start = jiffies;
|
||||
|
||||
spin_lock_irq(&ep->tx_pending_lock);
|
||||
ep->tx_pending++;
|
||||
if (ep->tx_pending == TX_QUEUE_ENTRIES)
|
||||
netif_stop_queue(dev);
|
||||
spin_unlock_irq(&ep->tx_pending_lock);
|
||||
|
||||
wrl(ep, REG_TXDENQ, 1);
|
||||
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
||||
static void ep93xx_tx_complete(struct net_device *dev)
|
||||
{
|
||||
struct ep93xx_priv *ep = netdev_priv(dev);
|
||||
int tail_offset;
|
||||
int wake;
|
||||
|
||||
tail_offset = rdl(ep, REG_TXSTSQCURADD) - ep->descs_dma_addr;
|
||||
wake = 0;
|
||||
|
||||
spin_lock(&ep->tx_pending_lock);
|
||||
while (1) {
|
||||
int entry;
|
||||
struct ep93xx_tstat *tstat;
|
||||
u32 tstat0;
|
||||
|
||||
entry = ep->tx_clean_pointer;
|
||||
tstat = ep->descs->tstat + entry;
|
||||
if ((void *)tstat - (void *)ep->descs == tail_offset)
|
||||
break;
|
||||
|
||||
tstat0 = tstat->tstat0;
|
||||
tstat->tstat0 = 0;
|
||||
|
||||
if (!(tstat0 & TSTAT0_TXFP))
|
||||
printk(KERN_CRIT "ep93xx_tx_complete: buffer not done "
|
||||
" %.8x\n", tstat0);
|
||||
if (tstat0 & TSTAT0_FA)
|
||||
printk(KERN_CRIT "ep93xx_tx_complete: frame aborted "
|
||||
" %.8x\n", tstat0);
|
||||
if ((tstat0 & TSTAT0_BUFFER_INDEX) != entry)
|
||||
printk(KERN_CRIT "ep93xx_tx_complete: entry mismatch "
|
||||
" %.8x\n", tstat0);
|
||||
|
||||
if (tstat0 & TSTAT0_TXWE) {
|
||||
int length = ep->descs->tdesc[entry].tdesc1 & 0xfff;
|
||||
|
||||
ep->stats.tx_packets++;
|
||||
ep->stats.tx_bytes += length;
|
||||
} else {
|
||||
ep->stats.tx_errors++;
|
||||
}
|
||||
|
||||
if (tstat0 & TSTAT0_OW)
|
||||
ep->stats.tx_window_errors++;
|
||||
if (tstat0 & TSTAT0_TXU)
|
||||
ep->stats.tx_fifo_errors++;
|
||||
ep->stats.collisions += (tstat0 >> 16) & 0x1f;
|
||||
|
||||
ep->tx_clean_pointer = (entry + 1) & (TX_QUEUE_ENTRIES - 1);
|
||||
if (ep->tx_pending == TX_QUEUE_ENTRIES)
|
||||
wake = 1;
|
||||
ep->tx_pending--;
|
||||
}
|
||||
spin_unlock(&ep->tx_pending_lock);
|
||||
|
||||
if (wake)
|
||||
netif_wake_queue(dev);
|
||||
}
|
||||
|
||||
static irqreturn_t ep93xx_irq(int irq, void *dev_id, struct pt_regs *regs)
|
||||
{
|
||||
struct net_device *dev = dev_id;
|
||||
struct ep93xx_priv *ep = netdev_priv(dev);
|
||||
u32 status;
|
||||
|
||||
status = rdl(ep, REG_INTSTSC);
|
||||
if (status == 0)
|
||||
return IRQ_NONE;
|
||||
|
||||
if (status & REG_INTSTS_RX) {
|
||||
spin_lock(&ep->rx_lock);
|
||||
if (likely(__netif_rx_schedule_prep(dev))) {
|
||||
wrl(ep, REG_INTEN, REG_INTEN_TX);
|
||||
__netif_rx_schedule(dev);
|
||||
}
|
||||
spin_unlock(&ep->rx_lock);
|
||||
}
|
||||
|
||||
if (status & REG_INTSTS_TX)
|
||||
ep93xx_tx_complete(dev);
|
||||
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
static void ep93xx_free_buffers(struct ep93xx_priv *ep)
|
||||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < RX_QUEUE_ENTRIES; i += 2) {
|
||||
dma_addr_t d;
|
||||
|
||||
d = ep->descs->rdesc[i].buf_addr;
|
||||
if (d)
|
||||
dma_unmap_single(NULL, d, PAGE_SIZE, DMA_FROM_DEVICE);
|
||||
|
||||
if (ep->rx_buf[i] != NULL)
|
||||
free_page((unsigned long)ep->rx_buf[i]);
|
||||
}
|
||||
|
||||
for (i = 0; i < TX_QUEUE_ENTRIES; i += 2) {
|
||||
dma_addr_t d;
|
||||
|
||||
d = ep->descs->tdesc[i].buf_addr;
|
||||
if (d)
|
||||
dma_unmap_single(NULL, d, PAGE_SIZE, DMA_TO_DEVICE);
|
||||
|
||||
if (ep->tx_buf[i] != NULL)
|
||||
free_page((unsigned long)ep->tx_buf[i]);
|
||||
}
|
||||
|
||||
dma_free_coherent(NULL, sizeof(struct ep93xx_descs), ep->descs,
|
||||
ep->descs_dma_addr);
|
||||
}
|
||||
|
||||
/*
|
||||
* The hardware enforces a sub-2K maximum packet size, so we put
|
||||
* two buffers on every hardware page.
|
||||
*/
|
||||
static int ep93xx_alloc_buffers(struct ep93xx_priv *ep)
|
||||
{
|
||||
int i;
|
||||
|
||||
ep->descs = dma_alloc_coherent(NULL, sizeof(struct ep93xx_descs),
|
||||
&ep->descs_dma_addr, GFP_KERNEL | GFP_DMA);
|
||||
if (ep->descs == NULL)
|
||||
return 1;
|
||||
|
||||
for (i = 0; i < RX_QUEUE_ENTRIES; i += 2) {
|
||||
void *page;
|
||||
dma_addr_t d;
|
||||
|
||||
page = (void *)__get_free_page(GFP_KERNEL | GFP_DMA);
|
||||
if (page == NULL)
|
||||
goto err;
|
||||
|
||||
d = dma_map_single(NULL, page, PAGE_SIZE, DMA_FROM_DEVICE);
|
||||
if (dma_mapping_error(d)) {
|
||||
free_page((unsigned long)page);
|
||||
goto err;
|
||||
}
|
||||
|
||||
ep->rx_buf[i] = page;
|
||||
ep->descs->rdesc[i].buf_addr = d;
|
||||
ep->descs->rdesc[i].rdesc1 = (i << 16) | PKT_BUF_SIZE;
|
||||
|
||||
ep->rx_buf[i + 1] = page + PKT_BUF_SIZE;
|
||||
ep->descs->rdesc[i + 1].buf_addr = d + PKT_BUF_SIZE;
|
||||
ep->descs->rdesc[i + 1].rdesc1 = ((i + 1) << 16) | PKT_BUF_SIZE;
|
||||
}
|
||||
|
||||
for (i = 0; i < TX_QUEUE_ENTRIES; i += 2) {
|
||||
void *page;
|
||||
dma_addr_t d;
|
||||
|
||||
page = (void *)__get_free_page(GFP_KERNEL | GFP_DMA);
|
||||
if (page == NULL)
|
||||
goto err;
|
||||
|
||||
d = dma_map_single(NULL, page, PAGE_SIZE, DMA_TO_DEVICE);
|
||||
if (dma_mapping_error(d)) {
|
||||
free_page((unsigned long)page);
|
||||
goto err;
|
||||
}
|
||||
|
||||
ep->tx_buf[i] = page;
|
||||
ep->descs->tdesc[i].buf_addr = d;
|
||||
|
||||
ep->tx_buf[i + 1] = page + PKT_BUF_SIZE;
|
||||
ep->descs->tdesc[i + 1].buf_addr = d + PKT_BUF_SIZE;
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
err:
|
||||
ep93xx_free_buffers(ep);
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int ep93xx_start_hw(struct net_device *dev)
|
||||
{
|
||||
struct ep93xx_priv *ep = netdev_priv(dev);
|
||||
unsigned long addr;
|
||||
int i;
|
||||
|
||||
wrl(ep, REG_SELFCTL, REG_SELFCTL_RESET);
|
||||
for (i = 0; i < 10; i++) {
|
||||
if ((rdl(ep, REG_SELFCTL) & REG_SELFCTL_RESET) == 0)
|
||||
break;
|
||||
msleep(1);
|
||||
}
|
||||
|
||||
if (i == 10) {
|
||||
printk(KERN_CRIT DRV_MODULE_NAME ": hw failed to reset\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
wrl(ep, REG_SELFCTL, ((ep->mdc_divisor - 1) << 9));
|
||||
|
||||
/* Does the PHY support preamble suppress? */
|
||||
if ((ep93xx_mdio_read(dev, ep->mii.phy_id, MII_BMSR) & 0x0040) != 0)
|
||||
wrl(ep, REG_SELFCTL, ((ep->mdc_divisor - 1) << 9) | (1 << 8));
|
||||
|
||||
/* Receive descriptor ring. */
|
||||
addr = ep->descs_dma_addr + offsetof(struct ep93xx_descs, rdesc);
|
||||
wrl(ep, REG_RXDQBADD, addr);
|
||||
wrl(ep, REG_RXDCURADD, addr);
|
||||
wrw(ep, REG_RXDQBLEN, RX_QUEUE_ENTRIES * sizeof(struct ep93xx_rdesc));
|
||||
|
||||
/* Receive status ring. */
|
||||
addr = ep->descs_dma_addr + offsetof(struct ep93xx_descs, rstat);
|
||||
wrl(ep, REG_RXSTSQBADD, addr);
|
||||
wrl(ep, REG_RXSTSQCURADD, addr);
|
||||
wrw(ep, REG_RXSTSQBLEN, RX_QUEUE_ENTRIES * sizeof(struct ep93xx_rstat));
|
||||
|
||||
/* Transmit descriptor ring. */
|
||||
addr = ep->descs_dma_addr + offsetof(struct ep93xx_descs, tdesc);
|
||||
wrl(ep, REG_TXDQBADD, addr);
|
||||
wrl(ep, REG_TXDQCURADD, addr);
|
||||
wrw(ep, REG_TXDQBLEN, TX_QUEUE_ENTRIES * sizeof(struct ep93xx_tdesc));
|
||||
|
||||
/* Transmit status ring. */
|
||||
addr = ep->descs_dma_addr + offsetof(struct ep93xx_descs, tstat);
|
||||
wrl(ep, REG_TXSTSQBADD, addr);
|
||||
wrl(ep, REG_TXSTSQCURADD, addr);
|
||||
wrw(ep, REG_TXSTSQBLEN, TX_QUEUE_ENTRIES * sizeof(struct ep93xx_tstat));
|
||||
|
||||
wrl(ep, REG_BMCTL, REG_BMCTL_ENABLE_TX | REG_BMCTL_ENABLE_RX);
|
||||
wrl(ep, REG_INTEN, REG_INTEN_TX | REG_INTEN_RX);
|
||||
wrl(ep, REG_GIINTMSK, 0);
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
if ((rdl(ep, REG_BMSTS) & REG_BMSTS_RX_ACTIVE) != 0)
|
||||
break;
|
||||
msleep(1);
|
||||
}
|
||||
|
||||
if (i == 10) {
|
||||
printk(KERN_CRIT DRV_MODULE_NAME ": hw failed to start\n");
|
||||
return 1;
|
||||
}
|
||||
|
||||
wrl(ep, REG_RXDENQ, RX_QUEUE_ENTRIES);
|
||||
wrl(ep, REG_RXSTSENQ, RX_QUEUE_ENTRIES);
|
||||
|
||||
wrb(ep, REG_INDAD0, dev->dev_addr[0]);
|
||||
wrb(ep, REG_INDAD1, dev->dev_addr[1]);
|
||||
wrb(ep, REG_INDAD2, dev->dev_addr[2]);
|
||||
wrb(ep, REG_INDAD3, dev->dev_addr[3]);
|
||||
wrb(ep, REG_INDAD4, dev->dev_addr[4]);
|
||||
wrb(ep, REG_INDAD5, dev->dev_addr[5]);
|
||||
wrl(ep, REG_AFP, 0);
|
||||
|
||||
wrl(ep, REG_MAXFRMLEN, (MAX_PKT_SIZE << 16) | MAX_PKT_SIZE);
|
||||
|
||||
wrl(ep, REG_RXCTL, REG_RXCTL_DEFAULT);
|
||||
wrl(ep, REG_TXCTL, REG_TXCTL_ENABLE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void ep93xx_stop_hw(struct net_device *dev)
|
||||
{
|
||||
struct ep93xx_priv *ep = netdev_priv(dev);
|
||||
int i;
|
||||
|
||||
wrl(ep, REG_SELFCTL, REG_SELFCTL_RESET);
|
||||
for (i = 0; i < 10; i++) {
|
||||
if ((rdl(ep, REG_SELFCTL) & REG_SELFCTL_RESET) == 0)
|
||||
break;
|
||||
msleep(1);
|
||||
}
|
||||
|
||||
if (i == 10)
|
||||
printk(KERN_CRIT DRV_MODULE_NAME ": hw failed to reset\n");
|
||||
}
|
||||
|
||||
static int ep93xx_open(struct net_device *dev)
|
||||
{
|
||||
struct ep93xx_priv *ep = netdev_priv(dev);
|
||||
int err;
|
||||
|
||||
if (ep93xx_alloc_buffers(ep))
|
||||
return -ENOMEM;
|
||||
|
||||
if (is_zero_ether_addr(dev->dev_addr)) {
|
||||
random_ether_addr(dev->dev_addr);
|
||||
printk(KERN_INFO "%s: generated random MAC address "
|
||||
"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x.\n", dev->name,
|
||||
dev->dev_addr[0], dev->dev_addr[1],
|
||||
dev->dev_addr[2], dev->dev_addr[3],
|
||||
dev->dev_addr[4], dev->dev_addr[5]);
|
||||
}
|
||||
|
||||
if (ep93xx_start_hw(dev)) {
|
||||
ep93xx_free_buffers(ep);
|
||||
return -EIO;
|
||||
}
|
||||
|
||||
spin_lock_init(&ep->rx_lock);
|
||||
ep->rx_pointer = 0;
|
||||
ep->tx_clean_pointer = 0;
|
||||
ep->tx_pointer = 0;
|
||||
spin_lock_init(&ep->tx_pending_lock);
|
||||
ep->tx_pending = 0;
|
||||
|
||||
err = request_irq(ep->irq, ep93xx_irq, IRQF_SHARED, dev->name, dev);
|
||||
if (err) {
|
||||
ep93xx_stop_hw(dev);
|
||||
ep93xx_free_buffers(ep);
|
||||
return err;
|
||||
}
|
||||
|
||||
wrl(ep, REG_GIINTMSK, REG_GIINTMSK_ENABLE);
|
||||
|
||||
netif_start_queue(dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ep93xx_close(struct net_device *dev)
|
||||
{
|
||||
struct ep93xx_priv *ep = netdev_priv(dev);
|
||||
|
||||
netif_stop_queue(dev);
|
||||
|
||||
wrl(ep, REG_GIINTMSK, 0);
|
||||
free_irq(ep->irq, dev);
|
||||
ep93xx_stop_hw(dev);
|
||||
ep93xx_free_buffers(ep);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ep93xx_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd)
|
||||
{
|
||||
struct ep93xx_priv *ep = netdev_priv(dev);
|
||||
struct mii_ioctl_data *data = if_mii(ifr);
|
||||
|
||||
return generic_mii_ioctl(&ep->mii, data, cmd, NULL);
|
||||
}
|
||||
|
||||
static int ep93xx_mdio_read(struct net_device *dev, int phy_id, int reg)
|
||||
{
|
||||
struct ep93xx_priv *ep = netdev_priv(dev);
|
||||
int data;
|
||||
int i;
|
||||
|
||||
wrl(ep, REG_MIICMD, REG_MIICMD_READ | (phy_id << 5) | reg);
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
if ((rdl(ep, REG_MIISTS) & REG_MIISTS_BUSY) == 0)
|
||||
break;
|
||||
msleep(1);
|
||||
}
|
||||
|
||||
if (i == 10) {
|
||||
printk(KERN_INFO DRV_MODULE_NAME ": mdio read timed out\n");
|
||||
data = 0xffff;
|
||||
} else {
|
||||
data = rdl(ep, REG_MIIDATA);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
static void ep93xx_mdio_write(struct net_device *dev, int phy_id, int reg, int data)
|
||||
{
|
||||
struct ep93xx_priv *ep = netdev_priv(dev);
|
||||
int i;
|
||||
|
||||
wrl(ep, REG_MIIDATA, data);
|
||||
wrl(ep, REG_MIICMD, REG_MIICMD_WRITE | (phy_id << 5) | reg);
|
||||
|
||||
for (i = 0; i < 10; i++) {
|
||||
if ((rdl(ep, REG_MIISTS) & REG_MIISTS_BUSY) == 0)
|
||||
break;
|
||||
msleep(1);
|
||||
}
|
||||
|
||||
if (i == 10)
|
||||
printk(KERN_INFO DRV_MODULE_NAME ": mdio write timed out\n");
|
||||
}
|
||||
|
||||
static void ep93xx_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
|
||||
{
|
||||
strcpy(info->driver, DRV_MODULE_NAME);
|
||||
strcpy(info->version, DRV_MODULE_VERSION);
|
||||
}
|
||||
|
||||
static int ep93xx_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
||||
{
|
||||
struct ep93xx_priv *ep = netdev_priv(dev);
|
||||
return mii_ethtool_gset(&ep->mii, cmd);
|
||||
}
|
||||
|
||||
static int ep93xx_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
||||
{
|
||||
struct ep93xx_priv *ep = netdev_priv(dev);
|
||||
return mii_ethtool_sset(&ep->mii, cmd);
|
||||
}
|
||||
|
||||
static int ep93xx_nway_reset(struct net_device *dev)
|
||||
{
|
||||
struct ep93xx_priv *ep = netdev_priv(dev);
|
||||
return mii_nway_restart(&ep->mii);
|
||||
}
|
||||
|
||||
static u32 ep93xx_get_link(struct net_device *dev)
|
||||
{
|
||||
struct ep93xx_priv *ep = netdev_priv(dev);
|
||||
return mii_link_ok(&ep->mii);
|
||||
}
|
||||
|
||||
static struct ethtool_ops ep93xx_ethtool_ops = {
|
||||
.get_drvinfo = ep93xx_get_drvinfo,
|
||||
.get_settings = ep93xx_get_settings,
|
||||
.set_settings = ep93xx_set_settings,
|
||||
.nway_reset = ep93xx_nway_reset,
|
||||
.get_link = ep93xx_get_link,
|
||||
};
|
||||
|
||||
struct net_device *ep93xx_dev_alloc(struct ep93xx_eth_data *data)
|
||||
{
|
||||
struct net_device *dev;
|
||||
struct ep93xx_priv *ep;
|
||||
|
||||
dev = alloc_etherdev(sizeof(struct ep93xx_priv));
|
||||
if (dev == NULL)
|
||||
return NULL;
|
||||
ep = netdev_priv(dev);
|
||||
|
||||
memcpy(dev->dev_addr, data->dev_addr, ETH_ALEN);
|
||||
|
||||
dev->get_stats = ep93xx_get_stats;
|
||||
dev->ethtool_ops = &ep93xx_ethtool_ops;
|
||||
dev->poll = ep93xx_poll;
|
||||
dev->hard_start_xmit = ep93xx_xmit;
|
||||
dev->open = ep93xx_open;
|
||||
dev->stop = ep93xx_close;
|
||||
dev->do_ioctl = ep93xx_ioctl;
|
||||
|
||||
dev->features |= NETIF_F_SG | NETIF_F_HW_CSUM;
|
||||
dev->weight = 64;
|
||||
|
||||
return dev;
|
||||
}
|
||||
|
||||
|
||||
static int ep93xx_eth_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct net_device *dev;
|
||||
struct ep93xx_priv *ep;
|
||||
|
||||
dev = platform_get_drvdata(pdev);
|
||||
if (dev == NULL)
|
||||
return 0;
|
||||
platform_set_drvdata(pdev, NULL);
|
||||
|
||||
ep = netdev_priv(dev);
|
||||
|
||||
/* @@@ Force down. */
|
||||
unregister_netdev(dev);
|
||||
ep93xx_free_buffers(ep);
|
||||
|
||||
if (ep->base_addr != NULL)
|
||||
iounmap(ep->base_addr);
|
||||
|
||||
if (ep->res != NULL) {
|
||||
release_resource(ep->res);
|
||||
kfree(ep->res);
|
||||
}
|
||||
|
||||
free_netdev(dev);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ep93xx_eth_probe(struct platform_device *pdev)
|
||||
{
|
||||
struct ep93xx_eth_data *data;
|
||||
struct net_device *dev;
|
||||
struct ep93xx_priv *ep;
|
||||
int err;
|
||||
|
||||
data = pdev->dev.platform_data;
|
||||
if (pdev == NULL)
|
||||
return -ENODEV;
|
||||
|
||||
dev = ep93xx_dev_alloc(data);
|
||||
if (dev == NULL) {
|
||||
err = -ENOMEM;
|
||||
goto err_out;
|
||||
}
|
||||
ep = netdev_priv(dev);
|
||||
|
||||
platform_set_drvdata(pdev, dev);
|
||||
|
||||
ep->res = request_mem_region(pdev->resource[0].start,
|
||||
pdev->resource[0].end - pdev->resource[0].start + 1,
|
||||
pdev->dev.bus_id);
|
||||
if (ep->res == NULL) {
|
||||
dev_err(&pdev->dev, "Could not reserve memory region\n");
|
||||
err = -ENOMEM;
|
||||
goto err_out;
|
||||
}
|
||||
|
||||
ep->base_addr = ioremap(pdev->resource[0].start,
|
||||
pdev->resource[0].end - pdev->resource[0].start);
|
||||
if (ep->base_addr == NULL) {
|
||||
dev_err(&pdev->dev, "Failed to ioremap ethernet registers\n");
|
||||
err = -EIO;
|
||||
goto err_out;
|
||||
}
|
||||
ep->irq = pdev->resource[1].start;
|
||||
|
||||
ep->mii.phy_id = data->phy_id;
|
||||
ep->mii.phy_id_mask = 0x1f;
|
||||
ep->mii.reg_num_mask = 0x1f;
|
||||
ep->mii.dev = dev;
|
||||
ep->mii.mdio_read = ep93xx_mdio_read;
|
||||
ep->mii.mdio_write = ep93xx_mdio_write;
|
||||
ep->mdc_divisor = 40; /* Max HCLK 100 MHz, min MDIO clk 2.5 MHz. */
|
||||
|
||||
err = register_netdev(dev);
|
||||
if (err) {
|
||||
dev_err(&pdev->dev, "Failed to register netdev\n");
|
||||
goto err_out;
|
||||
}
|
||||
|
||||
printk(KERN_INFO "%s: ep93xx on-chip ethernet, IRQ %d, "
|
||||
"%.2x:%.2x:%.2x:%.2x:%.2x:%.2x.\n", dev->name,
|
||||
ep->irq, data->dev_addr[0], data->dev_addr[1],
|
||||
data->dev_addr[2], data->dev_addr[3],
|
||||
data->dev_addr[4], data->dev_addr[5]);
|
||||
|
||||
return 0;
|
||||
|
||||
err_out:
|
||||
ep93xx_eth_remove(pdev);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
||||
static struct platform_driver ep93xx_eth_driver = {
|
||||
.probe = ep93xx_eth_probe,
|
||||
.remove = ep93xx_eth_remove,
|
||||
.driver = {
|
||||
.name = "ep93xx-eth",
|
||||
},
|
||||
};
|
||||
|
||||
static int __init ep93xx_eth_init_module(void)
|
||||
{
|
||||
printk(KERN_INFO DRV_MODULE_NAME " version " DRV_MODULE_VERSION " loading\n");
|
||||
return platform_driver_register(&ep93xx_eth_driver);
|
||||
}
|
||||
|
||||
static void __exit ep93xx_eth_cleanup_module(void)
|
||||
{
|
||||
platform_driver_unregister(&ep93xx_eth_driver);
|
||||
}
|
||||
|
||||
module_init(ep93xx_eth_init_module);
|
||||
module_exit(ep93xx_eth_cleanup_module);
|
||||
MODULE_LICENSE("GPL");
|
|
@ -626,7 +626,7 @@ static int etherh_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct ethtool_ops etherh_ethtool_ops = {
|
||||
static const struct ethtool_ops etherh_ethtool_ops = {
|
||||
.get_settings = etherh_get_settings,
|
||||
.set_settings = etherh_set_settings,
|
||||
.get_drvinfo = etherh_get_drvinfo,
|
||||
|
|
|
@ -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.
|
||||
|
@ -58,7 +58,7 @@
|
|||
#include <asm/dma.h>
|
||||
|
||||
static char version[] __initdata =
|
||||
"at1700.c:v1.15 4/7/98 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
|
||||
"at1700.c:v1.16 9/11/06 Donald Becker (becker@cesdis.gsfc.nasa.gov)\n";
|
||||
|
||||
#define DRV_NAME "at1700"
|
||||
|
||||
|
@ -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);
|
||||
|
||||
|
@ -851,8 +851,6 @@ set_rx_mode(struct net_device *dev)
|
|||
int i;
|
||||
|
||||
if (dev->flags & IFF_PROMISC) {
|
||||
/* Unconditionally log net taps. */
|
||||
printk("%s: Promiscuous mode enabled.\n", dev->name);
|
||||
memset(mc_filter, 0xff, sizeof(mc_filter));
|
||||
outb(3, ioaddr + RX_MODE); /* Enable promiscuous mode */
|
||||
} else if (dev->mc_count > MC_FILTERBREAK
|
||||
|
@ -921,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 */
|
||||
|
@ -1121,7 +1121,7 @@ static void set_multicast_list( struct net_device *dev )
|
|||
|
||||
if (dev->flags & IFF_PROMISC) {
|
||||
/* Log any net taps. */
|
||||
DPRINTK( 1, ( "%s: Promiscuous mode enabled.\n", dev->name ));
|
||||
DPRINTK( 2, ( "%s: Promiscuous mode enabled.\n", dev->name ));
|
||||
REGA( CSR15 ) = 0x8000; /* Set promiscuous mode */
|
||||
} else {
|
||||
short multicast_table[4];
|
||||
|
@ -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>
|
||||
|
@ -72,7 +72,7 @@ static int au1000_debug = 3;
|
|||
#endif
|
||||
|
||||
#define DRV_NAME "au1000_eth"
|
||||
#define DRV_VERSION "1.5"
|
||||
#define DRV_VERSION "1.6"
|
||||
#define DRV_AUTHOR "Pete Popov <ppopov@embeddedalley.com>"
|
||||
#define DRV_DESC "Au1xxx on-chip Ethernet driver"
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -608,7 +608,7 @@ au1000_get_drvinfo(struct net_device *dev, struct ethtool_drvinfo *info)
|
|||
info->regdump_len = 0;
|
||||
}
|
||||
|
||||
static struct ethtool_ops au1000_ethtool_ops = {
|
||||
static const struct ethtool_ops au1000_ethtool_ops = {
|
||||
.get_settings = au1000_get_settings,
|
||||
.set_settings = au1000_set_settings,
|
||||
.get_drvinfo = au1000_get_drvinfo,
|
||||
|
@ -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,12 +1287,11 @@ 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. */
|
||||
aup->mac->control |= MAC_PROMISCUOUS;
|
||||
printk(KERN_INFO "%s: Promiscuous mode enabled.\n", dev->name);
|
||||
} else if ((dev->flags & IFF_ALLMULTI) ||
|
||||
dev->mc_count > MULTICAST_FILTER_LIMIT) {
|
||||
aup->mac->control |= MAC_PASS_ALL_MULTI;
|
||||
|
@ -1306,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 */
|
||||
|
|
|
@ -2012,7 +2012,7 @@ static int b44_set_wol(struct net_device *dev, struct ethtool_wolinfo *wol)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct ethtool_ops b44_ethtool_ops = {
|
||||
static const struct ethtool_ops b44_ethtool_ops = {
|
||||
.get_drvinfo = b44_get_drvinfo,
|
||||
.get_settings = b44_get_settings,
|
||||
.set_settings = b44_set_settings,
|
||||
|
@ -2354,7 +2354,7 @@ static int __init b44_init(void)
|
|||
dma_desc_align_mask = ~(dma_desc_align_size - 1);
|
||||
dma_desc_sync_size = max_t(unsigned int, dma_desc_align_size, sizeof(struct dma_desc));
|
||||
|
||||
return pci_module_init(&b44_driver);
|
||||
return pci_register_driver(&b44_driver);
|
||||
}
|
||||
|
||||
static void __exit b44_cleanup(void)
|
||||
|
|
|
@ -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.
|
||||
|
@ -1289,7 +1289,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);
|
||||
|
@ -1382,7 +1382,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:
|
||||
|
@ -1474,7 +1474,7 @@ bmac_start(struct net_device *dev)
|
|||
|
||||
if (bp->sleeping)
|
||||
return;
|
||||
|
||||
|
||||
spin_lock_irqsave(&bp->lock, flags);
|
||||
while (1) {
|
||||
i = bp->tx_fill + 1;
|
||||
|
@ -1562,9 +1562,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);
|
||||
|
@ -1574,10 +1574,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),
|
||||
|
@ -1633,7 +1633,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);
|
||||
|
@ -1647,7 +1647,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",
|
||||
|
@ -1662,7 +1662,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,
|
||||
|
@ -5429,7 +5429,7 @@ bnx2_phys_id(struct net_device *dev, u32 data)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct ethtool_ops bnx2_ethtool_ops = {
|
||||
static const struct ethtool_ops bnx2_ethtool_ops = {
|
||||
.get_settings = bnx2_get_settings,
|
||||
.set_settings = bnx2_set_settings,
|
||||
.get_drvinfo = bnx2_get_drvinfo,
|
||||
|
@ -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;
|
||||
|
@ -6016,7 +6016,7 @@ static struct pci_driver bnx2_pci_driver = {
|
|||
|
||||
static int __init bnx2_init(void)
|
||||
{
|
||||
return pci_module_init(&bnx2_pci_driver);
|
||||
return pci_register_driver(&bnx2_pci_driver);
|
||||
}
|
||||
|
||||
static void __exit bnx2_cleanup(void)
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -4130,7 +4130,7 @@ static void bond_ethtool_get_drvinfo(struct net_device *bond_dev,
|
|||
snprintf(drvinfo->fw_version, 32, "%d", BOND_ABI_VERSION);
|
||||
}
|
||||
|
||||
static struct ethtool_ops bond_ethtool_ops = {
|
||||
static const struct ethtool_ops bond_ethtool_ops = {
|
||||
.get_tx_csum = ethtool_op_get_tx_csum,
|
||||
.get_tso = ethtool_op_get_tso,
|
||||
.get_ufo = ethtool_op_get_ufo,
|
||||
|
|
|
@ -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
|
||||
*************************************************************/
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -779,7 +779,7 @@ static int get_eeprom(struct net_device *dev, struct ethtool_eeprom *e,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct ethtool_ops t1_ethtool_ops = {
|
||||
static const struct ethtool_ops t1_ethtool_ops = {
|
||||
.get_settings = get_settings,
|
||||
.set_settings = set_settings,
|
||||
.get_drvinfo = get_drvinfo,
|
||||
|
@ -1243,7 +1243,7 @@ static struct pci_driver driver = {
|
|||
|
||||
static int __init t1_init_module(void)
|
||||
{
|
||||
return pci_module_init(&driver);
|
||||
return pci_register_driver(&driver);
|
||||
}
|
||||
|
||||
static void __exit t1_cleanup_module(void)
|
||||
|
|
|
@ -434,7 +434,7 @@ static void e100_reset_transceiver(struct net_device* net);
|
|||
static void e100_clear_network_leds(unsigned long dummy);
|
||||
static void e100_set_network_leds(int active);
|
||||
|
||||
static struct ethtool_ops e100_ethtool_ops;
|
||||
static const struct ethtool_ops e100_ethtool_ops;
|
||||
|
||||
static void broadcom_check_speed(struct net_device* dev);
|
||||
static void broadcom_check_duplex(struct net_device* dev);
|
||||
|
@ -1552,7 +1552,7 @@ static int e100_nway_reset(struct net_device *dev)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static struct ethtool_ops e100_ethtool_ops = {
|
||||
static const struct ethtool_ops e100_ethtool_ops = {
|
||||
.get_settings = e100_get_settings,
|
||||
.set_settings = e100_set_settings,
|
||||
.get_drvinfo = e100_get_drvinfo,
|
||||
|
|
|
@ -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
|
||||
*
|
||||
|
@ -3444,13 +3444,13 @@ static int __init dfx_init(void)
|
|||
{
|
||||
int rc_pci, rc_eisa;
|
||||
|
||||
rc_pci = pci_module_init(&dfx_driver);
|
||||
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];
|
||||
|
@ -83,7 +83,7 @@ static int mii_read (struct net_device *dev, int phy_addr, int reg_num);
|
|||
static int mii_write (struct net_device *dev, int phy_addr, int reg_num,
|
||||
u16 data);
|
||||
|
||||
static struct ethtool_ops ethtool_ops;
|
||||
static const struct ethtool_ops ethtool_ops;
|
||||
|
||||
static int __devinit
|
||||
rio_probe1 (struct pci_dev *pdev, const struct pci_device_id *ent)
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -1261,7 +1261,7 @@ static u32 rio_get_link(struct net_device *dev)
|
|||
return np->link_status;
|
||||
}
|
||||
|
||||
static struct ethtool_ops ethtool_ops = {
|
||||
static const struct ethtool_ops ethtool_ops = {
|
||||
.get_drvinfo = rio_get_drvinfo,
|
||||
.get_settings = rio_get_settings,
|
||||
.set_settings = rio_set_settings,
|
||||
|
@ -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);
|
||||
|
@ -1815,7 +1815,7 @@ static struct pci_driver rio_driver = {
|
|||
static int __init
|
||||
rio_init (void)
|
||||
{
|
||||
return pci_module_init (&rio_driver);
|
||||
return pci_register_driver(&rio_driver);
|
||||
}
|
||||
|
||||
static void __exit
|
||||
|
@ -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);
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
/*******************************************************************************
|
||||
|
||||
|
||||
Copyright(c) 1999 - 2005 Intel Corporation. All rights reserved.
|
||||
Copyright(c) 1999 - 2006 Intel Corporation. All rights reserved.
|
||||
|
||||
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 the Free
|
||||
|
@ -158,10 +158,10 @@
|
|||
|
||||
|
||||
#define DRV_NAME "e100"
|
||||
#define DRV_EXT "-NAPI"
|
||||
#define DRV_VERSION "3.5.10-k2"DRV_EXT
|
||||
#define DRV_EXT "-NAPI"
|
||||
#define DRV_VERSION "3.5.16-k2"DRV_EXT
|
||||
#define DRV_DESCRIPTION "Intel(R) PRO/100 Network Driver"
|
||||
#define DRV_COPYRIGHT "Copyright(c) 1999-2005 Intel Corporation"
|
||||
#define DRV_COPYRIGHT "Copyright(c) 1999-2006 Intel Corporation"
|
||||
#define PFX DRV_NAME ": "
|
||||
|
||||
#define E100_WATCHDOG_PERIOD (2 * HZ)
|
||||
|
@ -1395,15 +1395,11 @@ static int e100_phy_init(struct nic *nic)
|
|||
}
|
||||
|
||||
if((nic->mac >= mac_82550_D102) || ((nic->flags & ich) &&
|
||||
(mdio_read(netdev, nic->mii.phy_id, MII_TPISTATUS) & 0x8000))) {
|
||||
/* enable/disable MDI/MDI-X auto-switching.
|
||||
MDI/MDI-X auto-switching is disabled for 82551ER/QM chips */
|
||||
if((nic->mac == mac_82551_E) || (nic->mac == mac_82551_F) ||
|
||||
(nic->mac == mac_82551_10) || (nic->mii.force_media) ||
|
||||
!(nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled))
|
||||
mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG, 0);
|
||||
else
|
||||
mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG, NCONFIG_AUTO_SWITCH);
|
||||
(mdio_read(netdev, nic->mii.phy_id, MII_TPISTATUS) & 0x8000) &&
|
||||
!(nic->eeprom[eeprom_cnfg_mdix] & eeprom_mdix_enabled))) {
|
||||
/* enable/disable MDI/MDI-X auto-switching. */
|
||||
mdio_write(netdev, nic->mii.phy_id, MII_NCONFIG,
|
||||
nic->mii.force_media ? 0 : NCONFIG_AUTO_SWITCH);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
@ -1767,11 +1763,10 @@ static inline void e100_start_receiver(struct nic *nic, struct rx *rx)
|
|||
#define RFD_BUF_LEN (sizeof(struct rfd) + VLAN_ETH_FRAME_LEN)
|
||||
static int e100_rx_alloc_skb(struct nic *nic, struct rx *rx)
|
||||
{
|
||||
if(!(rx->skb = dev_alloc_skb(RFD_BUF_LEN + NET_IP_ALIGN)))
|
||||
if(!(rx->skb = netdev_alloc_skb(nic->netdev, RFD_BUF_LEN + NET_IP_ALIGN)))
|
||||
return -ENOMEM;
|
||||
|
||||
/* Align, init, and map the RFD. */
|
||||
rx->skb->dev = nic->netdev;
|
||||
skb_reserve(rx->skb, NET_IP_ALIGN);
|
||||
memcpy(rx->skb->data, &nic->blank_rfd, sizeof(struct rfd));
|
||||
rx->dma_addr = pci_map_single(nic->pdev, rx->skb->data,
|
||||
|
@ -2147,7 +2142,7 @@ static int e100_loopback_test(struct nic *nic, enum loopback loopback_mode)
|
|||
|
||||
e100_start_receiver(nic, NULL);
|
||||
|
||||
if(!(skb = dev_alloc_skb(ETH_DATA_LEN))) {
|
||||
if(!(skb = netdev_alloc_skb(nic->netdev, ETH_DATA_LEN))) {
|
||||
err = -ENOMEM;
|
||||
goto err_loopback_none;
|
||||
}
|
||||
|
@ -2482,7 +2477,7 @@ static void e100_get_strings(struct net_device *netdev, u32 stringset, u8 *data)
|
|||
}
|
||||
}
|
||||
|
||||
static struct ethtool_ops e100_ethtool_ops = {
|
||||
static const struct ethtool_ops e100_ethtool_ops = {
|
||||
.get_settings = e100_get_settings,
|
||||
.set_settings = e100_set_settings,
|
||||
.get_drvinfo = e100_get_drvinfo,
|
||||
|
@ -2799,6 +2794,7 @@ static pci_ers_result_t e100_io_error_detected(struct pci_dev *pdev, pci_channel
|
|||
/* Detach; put netif into state similar to hotplug unplug. */
|
||||
netif_poll_enable(netdev);
|
||||
netif_device_detach(netdev);
|
||||
pci_disable_device(pdev);
|
||||
|
||||
/* Request a slot reset. */
|
||||
return PCI_ERS_RESULT_NEED_RESET;
|
||||
|
@ -2877,7 +2873,7 @@ static int __init e100_init_module(void)
|
|||
printk(KERN_INFO PFX "%s, %s\n", DRV_DESCRIPTION, DRV_VERSION);
|
||||
printk(KERN_INFO PFX "%s\n", DRV_COPYRIGHT);
|
||||
}
|
||||
return pci_module_init(&e100_driver);
|
||||
return pci_register_driver(&e100_driver);
|
||||
}
|
||||
|
||||
static void __exit e100_cleanup_module(void)
|
||||
|
|
|
@ -242,12 +242,10 @@ struct e1000_adapter {
|
|||
struct timer_list watchdog_timer;
|
||||
struct timer_list phy_info_timer;
|
||||
struct vlan_group *vlgrp;
|
||||
uint16_t mng_vlan_id;
|
||||
uint16_t mng_vlan_id;
|
||||
uint32_t bd_number;
|
||||
uint32_t rx_buffer_len;
|
||||
uint32_t part_num;
|
||||
uint32_t wol;
|
||||
uint32_t ksp3_port_a;
|
||||
uint32_t smartspeed;
|
||||
uint32_t en_mng_pt;
|
||||
uint16_t link_speed;
|
||||
|
@ -342,7 +340,9 @@ struct e1000_adapter {
|
|||
boolean_t tso_force;
|
||||
#endif
|
||||
boolean_t smart_power_down; /* phy smart power down */
|
||||
boolean_t quad_port_a;
|
||||
unsigned long flags;
|
||||
uint32_t eeprom_wol;
|
||||
};
|
||||
|
||||
enum e1000_state_t {
|
||||
|
|
|
@ -183,6 +183,9 @@ e1000_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
while (test_and_set_bit(__E1000_RESETTING, &adapter->flags))
|
||||
msleep(1);
|
||||
|
||||
if (ecmd->autoneg == AUTONEG_ENABLE) {
|
||||
hw->autoneg = 1;
|
||||
if (hw->media_type == e1000_media_type_fiber)
|
||||
|
@ -199,16 +202,20 @@ e1000_set_settings(struct net_device *netdev, struct ethtool_cmd *ecmd)
|
|||
ADVERTISED_TP;
|
||||
ecmd->advertising = hw->autoneg_advertised;
|
||||
} else
|
||||
if (e1000_set_spd_dplx(adapter, ecmd->speed + ecmd->duplex))
|
||||
if (e1000_set_spd_dplx(adapter, ecmd->speed + ecmd->duplex)) {
|
||||
clear_bit(__E1000_RESETTING, &adapter->flags);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
/* reset the link */
|
||||
|
||||
if (netif_running(adapter->netdev))
|
||||
e1000_reinit_locked(adapter);
|
||||
else
|
||||
if (netif_running(adapter->netdev)) {
|
||||
e1000_down(adapter);
|
||||
e1000_up(adapter);
|
||||
} else
|
||||
e1000_reset(adapter);
|
||||
|
||||
clear_bit(__E1000_RESETTING, &adapter->flags);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -238,9 +245,13 @@ e1000_set_pauseparam(struct net_device *netdev,
|
|||
{
|
||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||
struct e1000_hw *hw = &adapter->hw;
|
||||
int retval = 0;
|
||||
|
||||
adapter->fc_autoneg = pause->autoneg;
|
||||
|
||||
while (test_and_set_bit(__E1000_RESETTING, &adapter->flags))
|
||||
msleep(1);
|
||||
|
||||
if (pause->rx_pause && pause->tx_pause)
|
||||
hw->fc = e1000_fc_full;
|
||||
else if (pause->rx_pause && !pause->tx_pause)
|
||||
|
@ -253,15 +264,17 @@ e1000_set_pauseparam(struct net_device *netdev,
|
|||
hw->original_fc = hw->fc;
|
||||
|
||||
if (adapter->fc_autoneg == AUTONEG_ENABLE) {
|
||||
if (netif_running(adapter->netdev))
|
||||
e1000_reinit_locked(adapter);
|
||||
else
|
||||
if (netif_running(adapter->netdev)) {
|
||||
e1000_down(adapter);
|
||||
e1000_up(adapter);
|
||||
} else
|
||||
e1000_reset(adapter);
|
||||
} else
|
||||
return ((hw->media_type == e1000_media_type_fiber) ?
|
||||
e1000_setup_link(hw) : e1000_force_mac_fc(hw));
|
||||
retval = ((hw->media_type == e1000_media_type_fiber) ?
|
||||
e1000_setup_link(hw) : e1000_force_mac_fc(hw));
|
||||
|
||||
return 0;
|
||||
clear_bit(__E1000_RESETTING, &adapter->flags);
|
||||
return retval;
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
|
@ -415,12 +428,12 @@ e1000_get_regs(struct net_device *netdev,
|
|||
regs_buff[23] = regs_buff[18]; /* mdix mode */
|
||||
e1000_write_phy_reg(hw, IGP01E1000_PHY_PAGE_SELECT, 0x0);
|
||||
} else {
|
||||
e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, &phy_data);
|
||||
e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_STATUS, &phy_data);
|
||||
regs_buff[13] = (uint32_t)phy_data; /* cable length */
|
||||
regs_buff[14] = 0; /* Dummy (to align w/ IGP phy reg dump) */
|
||||
regs_buff[15] = 0; /* Dummy (to align w/ IGP phy reg dump) */
|
||||
regs_buff[16] = 0; /* Dummy (to align w/ IGP phy reg dump) */
|
||||
e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
|
||||
e1000_read_phy_reg(hw, M88E1000_PHY_SPEC_CTRL, &phy_data);
|
||||
regs_buff[17] = (uint32_t)phy_data; /* extended 10bt distance */
|
||||
regs_buff[18] = regs_buff[13]; /* cable polarity */
|
||||
regs_buff[19] = 0; /* Dummy (to align w/ IGP phy reg dump) */
|
||||
|
@ -696,7 +709,6 @@ e1000_set_ringparam(struct net_device *netdev,
|
|||
}
|
||||
|
||||
clear_bit(__E1000_RESETTING, &adapter->flags);
|
||||
|
||||
return 0;
|
||||
err_setup_tx:
|
||||
e1000_free_all_rx_resources(adapter);
|
||||
|
@ -881,21 +893,22 @@ e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data)
|
|||
|
||||
*data = 0;
|
||||
|
||||
/* NOTE: we don't test MSI interrupts here, yet */
|
||||
/* Hook up test interrupt handler just for this test */
|
||||
if (!request_irq(irq, &e1000_test_intr, IRQF_PROBE_SHARED,
|
||||
netdev->name, netdev)) {
|
||||
shared_int = FALSE;
|
||||
} else if (request_irq(irq, &e1000_test_intr, IRQF_SHARED,
|
||||
netdev->name, netdev)){
|
||||
netdev->name, netdev))
|
||||
shared_int = FALSE;
|
||||
else if (request_irq(irq, &e1000_test_intr, IRQF_SHARED,
|
||||
netdev->name, netdev)) {
|
||||
*data = 1;
|
||||
return -1;
|
||||
}
|
||||
DPRINTK(PROBE,INFO, "testing %s interrupt\n",
|
||||
DPRINTK(HW, INFO, "testing %s interrupt\n",
|
||||
(shared_int ? "shared" : "unshared"));
|
||||
|
||||
/* Disable all the interrupts */
|
||||
E1000_WRITE_REG(&adapter->hw, IMC, 0xFFFFFFFF);
|
||||
msec_delay(10);
|
||||
msleep(10);
|
||||
|
||||
/* Test each interrupt */
|
||||
for (; i < 10; i++) {
|
||||
|
@ -915,7 +928,7 @@ e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data)
|
|||
adapter->test_icr = 0;
|
||||
E1000_WRITE_REG(&adapter->hw, IMC, mask);
|
||||
E1000_WRITE_REG(&adapter->hw, ICS, mask);
|
||||
msec_delay(10);
|
||||
msleep(10);
|
||||
|
||||
if (adapter->test_icr & mask) {
|
||||
*data = 3;
|
||||
|
@ -932,7 +945,7 @@ e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data)
|
|||
adapter->test_icr = 0;
|
||||
E1000_WRITE_REG(&adapter->hw, IMS, mask);
|
||||
E1000_WRITE_REG(&adapter->hw, ICS, mask);
|
||||
msec_delay(10);
|
||||
msleep(10);
|
||||
|
||||
if (!(adapter->test_icr & mask)) {
|
||||
*data = 4;
|
||||
|
@ -949,7 +962,7 @@ e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data)
|
|||
adapter->test_icr = 0;
|
||||
E1000_WRITE_REG(&adapter->hw, IMC, ~mask & 0x00007FFF);
|
||||
E1000_WRITE_REG(&adapter->hw, ICS, ~mask & 0x00007FFF);
|
||||
msec_delay(10);
|
||||
msleep(10);
|
||||
|
||||
if (adapter->test_icr) {
|
||||
*data = 5;
|
||||
|
@ -960,7 +973,7 @@ e1000_intr_test(struct e1000_adapter *adapter, uint64_t *data)
|
|||
|
||||
/* Disable all the interrupts */
|
||||
E1000_WRITE_REG(&adapter->hw, IMC, 0xFFFFFFFF);
|
||||
msec_delay(10);
|
||||
msleep(10);
|
||||
|
||||
/* Unhook test interrupt handler */
|
||||
free_irq(irq, netdev);
|
||||
|
@ -1256,11 +1269,10 @@ e1000_integrated_phy_loopback(struct e1000_adapter *adapter)
|
|||
e1000_write_phy_reg(&adapter->hw, PHY_CTRL, 0x9140);
|
||||
/* autoneg off */
|
||||
e1000_write_phy_reg(&adapter->hw, PHY_CTRL, 0x8140);
|
||||
} else if (adapter->hw.phy_type == e1000_phy_gg82563) {
|
||||
} else if (adapter->hw.phy_type == e1000_phy_gg82563)
|
||||
e1000_write_phy_reg(&adapter->hw,
|
||||
GG82563_PHY_KMRN_MODE_CTRL,
|
||||
0x1CC);
|
||||
}
|
||||
|
||||
ctrl_reg = E1000_READ_REG(&adapter->hw, CTRL);
|
||||
|
||||
|
@ -1288,9 +1300,9 @@ e1000_integrated_phy_loopback(struct e1000_adapter *adapter)
|
|||
}
|
||||
|
||||
if (adapter->hw.media_type == e1000_media_type_copper &&
|
||||
adapter->hw.phy_type == e1000_phy_m88) {
|
||||
adapter->hw.phy_type == e1000_phy_m88)
|
||||
ctrl_reg |= E1000_CTRL_ILOS; /* Invert Loss of Signal */
|
||||
} else {
|
||||
else {
|
||||
/* Set the ILOS bit on the fiber Nic is half
|
||||
* duplex link is detected. */
|
||||
stat_reg = E1000_READ_REG(&adapter->hw, STATUS);
|
||||
|
@ -1383,7 +1395,7 @@ e1000_setup_loopback_test(struct e1000_adapter *adapter)
|
|||
#define E1000_SERDES_LB_ON 0x410
|
||||
e1000_set_phy_loopback(adapter);
|
||||
E1000_WRITE_REG(hw, SCTL, E1000_SERDES_LB_ON);
|
||||
msec_delay(10);
|
||||
msleep(10);
|
||||
return 0;
|
||||
break;
|
||||
default:
|
||||
|
@ -1416,7 +1428,7 @@ e1000_loopback_cleanup(struct e1000_adapter *adapter)
|
|||
hw->media_type == e1000_media_type_internal_serdes) {
|
||||
#define E1000_SERDES_LB_OFF 0x400
|
||||
E1000_WRITE_REG(hw, SCTL, E1000_SERDES_LB_OFF);
|
||||
msec_delay(10);
|
||||
msleep(10);
|
||||
break;
|
||||
}
|
||||
/* Fall Through */
|
||||
|
@ -1426,11 +1438,10 @@ e1000_loopback_cleanup(struct e1000_adapter *adapter)
|
|||
case e1000_82546_rev_3:
|
||||
default:
|
||||
hw->autoneg = TRUE;
|
||||
if (hw->phy_type == e1000_phy_gg82563) {
|
||||
if (hw->phy_type == e1000_phy_gg82563)
|
||||
e1000_write_phy_reg(hw,
|
||||
GG82563_PHY_KMRN_MODE_CTRL,
|
||||
0x180);
|
||||
}
|
||||
e1000_read_phy_reg(hw, PHY_CTRL, &phy_reg);
|
||||
if (phy_reg & MII_CR_LOOPBACK) {
|
||||
phy_reg &= ~MII_CR_LOOPBACK;
|
||||
|
@ -1497,7 +1508,7 @@ e1000_run_loopback_test(struct e1000_adapter *adapter)
|
|||
if (unlikely(++k == txdr->count)) k = 0;
|
||||
}
|
||||
E1000_WRITE_REG(&adapter->hw, TDT, k);
|
||||
msec_delay(200);
|
||||
msleep(200);
|
||||
time = jiffies; /* set the start time for the receive */
|
||||
good_cnt = 0;
|
||||
do { /* receive the sent packets */
|
||||
|
@ -1568,14 +1579,14 @@ e1000_link_test(struct e1000_adapter *adapter, uint64_t *data)
|
|||
e1000_check_for_link(&adapter->hw);
|
||||
if (adapter->hw.serdes_link_down == FALSE)
|
||||
return *data;
|
||||
msec_delay(20);
|
||||
msleep(20);
|
||||
} while (i++ < 3750);
|
||||
|
||||
*data = 1;
|
||||
} else {
|
||||
e1000_check_for_link(&adapter->hw);
|
||||
if (adapter->hw.autoneg) /* if auto_neg is set wait for it */
|
||||
msec_delay(4000);
|
||||
msleep(4000);
|
||||
|
||||
if (!(E1000_READ_REG(&adapter->hw, STATUS) & E1000_STATUS_LU)) {
|
||||
*data = 1;
|
||||
|
@ -1590,6 +1601,8 @@ e1000_diag_test_count(struct net_device *netdev)
|
|||
return E1000_TEST_LEN;
|
||||
}
|
||||
|
||||
extern void e1000_power_up_phy(struct e1000_adapter *);
|
||||
|
||||
static void
|
||||
e1000_diag_test(struct net_device *netdev,
|
||||
struct ethtool_test *eth_test, uint64_t *data)
|
||||
|
@ -1606,6 +1619,8 @@ e1000_diag_test(struct net_device *netdev,
|
|||
uint8_t forced_speed_duplex = adapter->hw.forced_speed_duplex;
|
||||
uint8_t autoneg = adapter->hw.autoneg;
|
||||
|
||||
DPRINTK(HW, INFO, "offline testing starting\n");
|
||||
|
||||
/* Link test performed before hardware reset so autoneg doesn't
|
||||
* interfere with test result */
|
||||
if (e1000_link_test(adapter, &data[4]))
|
||||
|
@ -1629,6 +1644,8 @@ e1000_diag_test(struct net_device *netdev,
|
|||
eth_test->flags |= ETH_TEST_FL_FAILED;
|
||||
|
||||
e1000_reset(adapter);
|
||||
/* make sure the phy is powered up */
|
||||
e1000_power_up_phy(adapter);
|
||||
if (e1000_loopback_test(adapter, &data[3]))
|
||||
eth_test->flags |= ETH_TEST_FL_FAILED;
|
||||
|
||||
|
@ -1642,6 +1659,7 @@ e1000_diag_test(struct net_device *netdev,
|
|||
if (if_running)
|
||||
dev_open(netdev);
|
||||
} else {
|
||||
DPRINTK(HW, INFO, "online testing starting\n");
|
||||
/* Online tests */
|
||||
if (e1000_link_test(adapter, &data[4]))
|
||||
eth_test->flags |= ETH_TEST_FL_FAILED;
|
||||
|
@ -1657,14 +1675,12 @@ e1000_diag_test(struct net_device *netdev,
|
|||
msleep_interruptible(4 * 1000);
|
||||
}
|
||||
|
||||
static void
|
||||
e1000_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
|
||||
static int e1000_wol_exclusion(struct e1000_adapter *adapter, struct ethtool_wolinfo *wol)
|
||||
{
|
||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||
struct e1000_hw *hw = &adapter->hw;
|
||||
int retval = 1; /* fail by default */
|
||||
|
||||
switch (adapter->hw.device_id) {
|
||||
case E1000_DEV_ID_82542:
|
||||
switch (hw->device_id) {
|
||||
case E1000_DEV_ID_82543GC_FIBER:
|
||||
case E1000_DEV_ID_82543GC_COPPER:
|
||||
case E1000_DEV_ID_82544EI_FIBER:
|
||||
|
@ -1672,52 +1688,87 @@ e1000_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
|
|||
case E1000_DEV_ID_82545EM_FIBER:
|
||||
case E1000_DEV_ID_82545EM_COPPER:
|
||||
case E1000_DEV_ID_82546GB_QUAD_COPPER:
|
||||
case E1000_DEV_ID_82546GB_PCIE:
|
||||
/* these don't support WoL at all */
|
||||
wol->supported = 0;
|
||||
wol->wolopts = 0;
|
||||
break;
|
||||
case E1000_DEV_ID_82546EB_FIBER:
|
||||
case E1000_DEV_ID_82546GB_FIBER:
|
||||
case E1000_DEV_ID_82571EB_FIBER:
|
||||
case E1000_DEV_ID_82571EB_SERDES:
|
||||
case E1000_DEV_ID_82571EB_COPPER:
|
||||
/* Wake events not supported on port B */
|
||||
if (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1) {
|
||||
wol->supported = 0;
|
||||
break;
|
||||
}
|
||||
/* return success for non excluded adapter ports */
|
||||
retval = 0;
|
||||
break;
|
||||
case E1000_DEV_ID_82571EB_QUAD_COPPER:
|
||||
case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3:
|
||||
/* quad port adapters only support WoL on port A */
|
||||
if (!adapter->quad_port_a) {
|
||||
wol->supported = 0;
|
||||
break;
|
||||
}
|
||||
/* return success for non excluded adapter ports */
|
||||
retval = 0;
|
||||
break;
|
||||
default:
|
||||
/* dual port cards only support WoL on port A from now on
|
||||
* unless it was enabled in the eeprom for port B
|
||||
* so exclude FUNC_1 ports from having WoL enabled */
|
||||
if (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1 &&
|
||||
!adapter->eeprom_wol) {
|
||||
wol->supported = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
retval = 0;
|
||||
}
|
||||
|
||||
return retval;
|
||||
}
|
||||
|
||||
static void
|
||||
e1000_get_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
|
||||
{
|
||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||
|
||||
wol->supported = WAKE_UCAST | WAKE_MCAST |
|
||||
WAKE_BCAST | WAKE_MAGIC;
|
||||
wol->wolopts = 0;
|
||||
|
||||
/* this function will set ->supported = 0 and return 1 if wol is not
|
||||
* supported by this hardware */
|
||||
if (e1000_wol_exclusion(adapter, wol))
|
||||
return;
|
||||
|
||||
/* apply any specific unsupported masks here */
|
||||
switch (adapter->hw.device_id) {
|
||||
case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3:
|
||||
/* device id 10B5 port-A supports wol */
|
||||
if (!adapter->ksp3_port_a) {
|
||||
wol->supported = 0;
|
||||
return;
|
||||
}
|
||||
/* KSP3 does not suppport UCAST wake-ups for any interface */
|
||||
wol->supported = WAKE_MCAST | WAKE_BCAST | WAKE_MAGIC;
|
||||
/* KSP3 does not suppport UCAST wake-ups */
|
||||
wol->supported &= ~WAKE_UCAST;
|
||||
|
||||
if (adapter->wol & E1000_WUFC_EX)
|
||||
DPRINTK(DRV, ERR, "Interface does not support "
|
||||
"directed (unicast) frame wake-up packets\n");
|
||||
wol->wolopts = 0;
|
||||
goto do_defaults;
|
||||
|
||||
case E1000_DEV_ID_82546EB_FIBER:
|
||||
case E1000_DEV_ID_82546GB_FIBER:
|
||||
case E1000_DEV_ID_82571EB_FIBER:
|
||||
/* Wake events only supported on port A for dual fiber */
|
||||
if (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1) {
|
||||
wol->supported = 0;
|
||||
wol->wolopts = 0;
|
||||
return;
|
||||
}
|
||||
/* Fall Through */
|
||||
|
||||
break;
|
||||
default:
|
||||
wol->supported = WAKE_UCAST | WAKE_MCAST |
|
||||
WAKE_BCAST | WAKE_MAGIC;
|
||||
wol->wolopts = 0;
|
||||
|
||||
do_defaults:
|
||||
if (adapter->wol & E1000_WUFC_EX)
|
||||
wol->wolopts |= WAKE_UCAST;
|
||||
if (adapter->wol & E1000_WUFC_MC)
|
||||
wol->wolopts |= WAKE_MCAST;
|
||||
if (adapter->wol & E1000_WUFC_BC)
|
||||
wol->wolopts |= WAKE_BCAST;
|
||||
if (adapter->wol & E1000_WUFC_MAG)
|
||||
wol->wolopts |= WAKE_MAGIC;
|
||||
return;
|
||||
break;
|
||||
}
|
||||
|
||||
if (adapter->wol & E1000_WUFC_EX)
|
||||
wol->wolopts |= WAKE_UCAST;
|
||||
if (adapter->wol & E1000_WUFC_MC)
|
||||
wol->wolopts |= WAKE_MCAST;
|
||||
if (adapter->wol & E1000_WUFC_BC)
|
||||
wol->wolopts |= WAKE_BCAST;
|
||||
if (adapter->wol & E1000_WUFC_MAG)
|
||||
wol->wolopts |= WAKE_MAGIC;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
static int
|
||||
|
@ -1726,52 +1777,36 @@ e1000_set_wol(struct net_device *netdev, struct ethtool_wolinfo *wol)
|
|||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||
struct e1000_hw *hw = &adapter->hw;
|
||||
|
||||
switch (adapter->hw.device_id) {
|
||||
case E1000_DEV_ID_82542:
|
||||
case E1000_DEV_ID_82543GC_FIBER:
|
||||
case E1000_DEV_ID_82543GC_COPPER:
|
||||
case E1000_DEV_ID_82544EI_FIBER:
|
||||
case E1000_DEV_ID_82546EB_QUAD_COPPER:
|
||||
case E1000_DEV_ID_82546GB_QUAD_COPPER:
|
||||
case E1000_DEV_ID_82545EM_FIBER:
|
||||
case E1000_DEV_ID_82545EM_COPPER:
|
||||
if (wol->wolopts & (WAKE_PHY | WAKE_ARP | WAKE_MAGICSECURE))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (e1000_wol_exclusion(adapter, wol))
|
||||
return wol->wolopts ? -EOPNOTSUPP : 0;
|
||||
|
||||
switch (hw->device_id) {
|
||||
case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3:
|
||||
/* device id 10B5 port-A supports wol */
|
||||
if (!adapter->ksp3_port_a)
|
||||
return wol->wolopts ? -EOPNOTSUPP : 0;
|
||||
|
||||
if (wol->wolopts & WAKE_UCAST) {
|
||||
DPRINTK(DRV, ERR, "Interface does not support "
|
||||
"directed (unicast) frame wake-up packets\n");
|
||||
return -EOPNOTSUPP;
|
||||
}
|
||||
|
||||
case E1000_DEV_ID_82546EB_FIBER:
|
||||
case E1000_DEV_ID_82546GB_FIBER:
|
||||
case E1000_DEV_ID_82571EB_FIBER:
|
||||
/* Wake events only supported on port A for dual fiber */
|
||||
if (E1000_READ_REG(hw, STATUS) & E1000_STATUS_FUNC_1)
|
||||
return wol->wolopts ? -EOPNOTSUPP : 0;
|
||||
/* Fall Through */
|
||||
|
||||
break;
|
||||
default:
|
||||
if (wol->wolopts & (WAKE_PHY | WAKE_ARP | WAKE_MAGICSECURE))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
adapter->wol = 0;
|
||||
|
||||
if (wol->wolopts & WAKE_UCAST)
|
||||
adapter->wol |= E1000_WUFC_EX;
|
||||
if (wol->wolopts & WAKE_MCAST)
|
||||
adapter->wol |= E1000_WUFC_MC;
|
||||
if (wol->wolopts & WAKE_BCAST)
|
||||
adapter->wol |= E1000_WUFC_BC;
|
||||
if (wol->wolopts & WAKE_MAGIC)
|
||||
adapter->wol |= E1000_WUFC_MAG;
|
||||
break;
|
||||
}
|
||||
|
||||
/* these settings will always override what we currently have */
|
||||
adapter->wol = 0;
|
||||
|
||||
if (wol->wolopts & WAKE_UCAST)
|
||||
adapter->wol |= E1000_WUFC_EX;
|
||||
if (wol->wolopts & WAKE_MCAST)
|
||||
adapter->wol |= E1000_WUFC_MC;
|
||||
if (wol->wolopts & WAKE_BCAST)
|
||||
adapter->wol |= E1000_WUFC_BC;
|
||||
if (wol->wolopts & WAKE_MAGIC)
|
||||
adapter->wol |= E1000_WUFC_MAG;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1887,7 +1922,7 @@ e1000_get_strings(struct net_device *netdev, uint32_t stringset, uint8_t *data)
|
|||
}
|
||||
}
|
||||
|
||||
static struct ethtool_ops e1000_ethtool_ops = {
|
||||
static const struct ethtool_ops e1000_ethtool_ops = {
|
||||
.get_settings = e1000_get_settings,
|
||||
.set_settings = e1000_set_settings,
|
||||
.get_drvinfo = e1000_get_drvinfo,
|
||||
|
@ -1895,8 +1930,8 @@ static struct ethtool_ops e1000_ethtool_ops = {
|
|||
.get_regs = e1000_get_regs,
|
||||
.get_wol = e1000_get_wol,
|
||||
.set_wol = e1000_set_wol,
|
||||
.get_msglevel = e1000_get_msglevel,
|
||||
.set_msglevel = e1000_set_msglevel,
|
||||
.get_msglevel = e1000_get_msglevel,
|
||||
.set_msglevel = e1000_set_msglevel,
|
||||
.nway_reset = e1000_nway_reset,
|
||||
.get_link = ethtool_op_get_link,
|
||||
.get_eeprom_len = e1000_get_eeprom_len,
|
||||
|
@ -1904,17 +1939,17 @@ static struct ethtool_ops e1000_ethtool_ops = {
|
|||
.set_eeprom = e1000_set_eeprom,
|
||||
.get_ringparam = e1000_get_ringparam,
|
||||
.set_ringparam = e1000_set_ringparam,
|
||||
.get_pauseparam = e1000_get_pauseparam,
|
||||
.set_pauseparam = e1000_set_pauseparam,
|
||||
.get_rx_csum = e1000_get_rx_csum,
|
||||
.set_rx_csum = e1000_set_rx_csum,
|
||||
.get_tx_csum = e1000_get_tx_csum,
|
||||
.set_tx_csum = e1000_set_tx_csum,
|
||||
.get_sg = ethtool_op_get_sg,
|
||||
.set_sg = ethtool_op_set_sg,
|
||||
.get_pauseparam = e1000_get_pauseparam,
|
||||
.set_pauseparam = e1000_set_pauseparam,
|
||||
.get_rx_csum = e1000_get_rx_csum,
|
||||
.set_rx_csum = e1000_set_rx_csum,
|
||||
.get_tx_csum = e1000_get_tx_csum,
|
||||
.set_tx_csum = e1000_set_tx_csum,
|
||||
.get_sg = ethtool_op_get_sg,
|
||||
.set_sg = ethtool_op_set_sg,
|
||||
#ifdef NETIF_F_TSO
|
||||
.get_tso = ethtool_op_get_tso,
|
||||
.set_tso = e1000_set_tso,
|
||||
.get_tso = ethtool_op_get_tso,
|
||||
.set_tso = e1000_set_tso,
|
||||
#endif
|
||||
.self_test_count = e1000_diag_test_count,
|
||||
.self_test = e1000_diag_test,
|
||||
|
@ -1922,7 +1957,7 @@ static struct ethtool_ops e1000_ethtool_ops = {
|
|||
.phys_id = e1000_phys_id,
|
||||
.get_stats_count = e1000_get_stats_count,
|
||||
.get_ethtool_stats = e1000_get_ethtool_stats,
|
||||
.get_perm_addr = ethtool_op_get_perm_addr,
|
||||
.get_perm_addr = ethtool_op_get_perm_addr,
|
||||
};
|
||||
|
||||
void e1000_set_ethtool_ops(struct net_device *netdev)
|
||||
|
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -336,9 +336,9 @@ uint32_t e1000_enable_mng_pass_thru(struct e1000_hw *hw);
|
|||
#define E1000_HI_MAX_MNG_DATA_LENGTH 0x6F8 /* Host Interface data length */
|
||||
|
||||
#define E1000_MNG_DHCP_COMMAND_TIMEOUT 10 /* Time in ms to process MNG command */
|
||||
#define E1000_MNG_DHCP_COOKIE_OFFSET 0x6F0 /* Cookie offset */
|
||||
#define E1000_MNG_DHCP_COOKIE_LENGTH 0x10 /* Cookie length */
|
||||
#define E1000_MNG_IAMT_MODE 0x3
|
||||
#define E1000_MNG_DHCP_COOKIE_OFFSET 0x6F0 /* Cookie offset */
|
||||
#define E1000_MNG_DHCP_COOKIE_LENGTH 0x10 /* Cookie length */
|
||||
#define E1000_MNG_IAMT_MODE 0x3
|
||||
#define E1000_MNG_ICH_IAMT_MODE 0x2
|
||||
#define E1000_IAMT_SIGNATURE 0x544D4149 /* Intel(R) Active Management Technology signature */
|
||||
|
||||
|
@ -385,7 +385,7 @@ struct e1000_host_mng_dhcp_cookie{
|
|||
#endif
|
||||
|
||||
int32_t e1000_mng_write_dhcp_info(struct e1000_hw *hw, uint8_t *buffer,
|
||||
uint16_t length);
|
||||
uint16_t length);
|
||||
boolean_t e1000_check_mng_mode(struct e1000_hw *hw);
|
||||
boolean_t e1000_enable_tx_pkt_filtering(struct e1000_hw *hw);
|
||||
|
||||
|
@ -470,6 +470,7 @@ int32_t e1000_check_phy_reset_block(struct e1000_hw *hw);
|
|||
#define E1000_DEV_ID_82571EB_COPPER 0x105E
|
||||
#define E1000_DEV_ID_82571EB_FIBER 0x105F
|
||||
#define E1000_DEV_ID_82571EB_SERDES 0x1060
|
||||
#define E1000_DEV_ID_82571EB_QUAD_COPPER 0x10A4
|
||||
#define E1000_DEV_ID_82572EI_COPPER 0x107D
|
||||
#define E1000_DEV_ID_82572EI_FIBER 0x107E
|
||||
#define E1000_DEV_ID_82572EI_SERDES 0x107F
|
||||
|
@ -523,7 +524,7 @@ int32_t e1000_check_phy_reset_block(struct e1000_hw *hw);
|
|||
|
||||
|
||||
/* 802.1q VLAN Packet Sizes */
|
||||
#define VLAN_TAG_SIZE 4 /* 802.3ac tag (not DMAed) */
|
||||
#define VLAN_TAG_SIZE 4 /* 802.3ac tag (not DMAed) */
|
||||
|
||||
/* Ethertype field values */
|
||||
#define ETHERNET_IEEE_VLAN_TYPE 0x8100 /* 802.3ac packet */
|
||||
|
@ -697,6 +698,7 @@ union e1000_rx_desc_packet_split {
|
|||
E1000_RXDEXT_STATERR_CXE | \
|
||||
E1000_RXDEXT_STATERR_RXE)
|
||||
|
||||
|
||||
/* Transmit Descriptor */
|
||||
struct e1000_tx_desc {
|
||||
uint64_t buffer_addr; /* Address of the descriptor's data buffer */
|
||||
|
@ -2086,7 +2088,7 @@ struct e1000_hw {
|
|||
#define E1000_MANC_EN_IP_ADDR_FILTER 0x00400000 /* Enable IP address
|
||||
* filtering */
|
||||
#define E1000_MANC_EN_XSUM_FILTER 0x00800000 /* Enable checksum filtering */
|
||||
#define E1000_MANC_BR_EN 0x01000000 /* Enable broadcast filtering */
|
||||
#define E1000_MANC_BR_EN 0x01000000 /* Enable broadcast filtering */
|
||||
#define E1000_MANC_SMB_REQ 0x01000000 /* SMBus Request */
|
||||
#define E1000_MANC_SMB_GNT 0x02000000 /* SMBus Grant */
|
||||
#define E1000_MANC_SMB_CLK_IN 0x04000000 /* SMBus Clock In */
|
||||
|
@ -2172,7 +2174,7 @@ struct e1000_host_command_info {
|
|||
|
||||
#define E1000_MDALIGN 4096
|
||||
|
||||
/* PCI-Ex registers */
|
||||
/* PCI-Ex registers*/
|
||||
|
||||
/* PCI-Ex Control Register */
|
||||
#define E1000_GCR_RXD_NO_SNOOP 0x00000001
|
||||
|
@ -2224,7 +2226,7 @@ struct e1000_host_command_info {
|
|||
#define EEPROM_EWDS_OPCODE_MICROWIRE 0x10 /* EEPROM erast/write disable */
|
||||
|
||||
/* EEPROM Commands - SPI */
|
||||
#define EEPROM_MAX_RETRY_SPI 5000 /* Max wait of 5ms, for RDY signal */
|
||||
#define EEPROM_MAX_RETRY_SPI 5000 /* Max wait of 5ms, for RDY signal */
|
||||
#define EEPROM_READ_OPCODE_SPI 0x03 /* EEPROM read opcode */
|
||||
#define EEPROM_WRITE_OPCODE_SPI 0x02 /* EEPROM write opcode */
|
||||
#define EEPROM_A8_OPCODE_SPI 0x08 /* opcode bit-3 = address bit-8 */
|
||||
|
@ -3082,10 +3084,10 @@ struct e1000_host_command_info {
|
|||
|
||||
/* DSP Distance Register (Page 5, Register 26) */
|
||||
#define GG82563_DSPD_CABLE_LENGTH 0x0007 /* 0 = <50M;
|
||||
1 = 50-80M;
|
||||
2 = 80-110M;
|
||||
3 = 110-140M;
|
||||
4 = >140M */
|
||||
1 = 50-80M;
|
||||
2 = 80-110M;
|
||||
3 = 110-140M;
|
||||
4 = >140M */
|
||||
|
||||
/* Kumeran Mode Control Register (Page 193, Register 16) */
|
||||
#define GG82563_KMCR_PHY_LEDS_EN 0x0020 /* 1=PHY LEDs, 0=Kumeran Inband LEDs */
|
||||
|
|
|
@ -36,7 +36,7 @@ static char e1000_driver_string[] = "Intel(R) PRO/1000 Network Driver";
|
|||
#else
|
||||
#define DRIVERNAPI "-NAPI"
|
||||
#endif
|
||||
#define DRV_VERSION "7.1.9-k4"DRIVERNAPI
|
||||
#define DRV_VERSION "7.2.7-k2"DRIVERNAPI
|
||||
char e1000_driver_version[] = DRV_VERSION;
|
||||
static char e1000_copyright[] = "Copyright (c) 1999-2006 Intel Corporation.";
|
||||
|
||||
|
@ -99,6 +99,7 @@ static struct pci_device_id e1000_pci_tbl[] = {
|
|||
INTEL_E1000_ETHERNET_DEVICE(0x1098),
|
||||
INTEL_E1000_ETHERNET_DEVICE(0x1099),
|
||||
INTEL_E1000_ETHERNET_DEVICE(0x109A),
|
||||
INTEL_E1000_ETHERNET_DEVICE(0x10A4),
|
||||
INTEL_E1000_ETHERNET_DEVICE(0x10B5),
|
||||
INTEL_E1000_ETHERNET_DEVICE(0x10B9),
|
||||
INTEL_E1000_ETHERNET_DEVICE(0x10BA),
|
||||
|
@ -245,7 +246,7 @@ e1000_init_module(void)
|
|||
|
||||
printk(KERN_INFO "%s\n", e1000_copyright);
|
||||
|
||||
ret = pci_module_init(&e1000_driver);
|
||||
ret = pci_register_driver(&e1000_driver);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -485,7 +486,7 @@ e1000_up(struct e1000_adapter *adapter)
|
|||
*
|
||||
**/
|
||||
|
||||
static void e1000_power_up_phy(struct e1000_adapter *adapter)
|
||||
void e1000_power_up_phy(struct e1000_adapter *adapter)
|
||||
{
|
||||
uint16_t mii_reg = 0;
|
||||
|
||||
|
@ -682,9 +683,9 @@ e1000_probe(struct pci_dev *pdev,
|
|||
unsigned long flash_start, flash_len;
|
||||
|
||||
static int cards_found = 0;
|
||||
static int e1000_ksp3_port_a = 0; /* global ksp3 port a indication */
|
||||
static int global_quad_port_a = 0; /* global ksp3 port a indication */
|
||||
int i, err, pci_using_dac;
|
||||
uint16_t eeprom_data;
|
||||
uint16_t eeprom_data = 0;
|
||||
uint16_t eeprom_apme_mask = E1000_EEPROM_APME;
|
||||
if ((err = pci_enable_device(pdev)))
|
||||
return err;
|
||||
|
@ -696,21 +697,20 @@ e1000_probe(struct pci_dev *pdev,
|
|||
if ((err = pci_set_dma_mask(pdev, DMA_32BIT_MASK)) &&
|
||||
(err = pci_set_consistent_dma_mask(pdev, DMA_32BIT_MASK))) {
|
||||
E1000_ERR("No usable DMA configuration, aborting\n");
|
||||
return err;
|
||||
goto err_dma;
|
||||
}
|
||||
pci_using_dac = 0;
|
||||
}
|
||||
|
||||
if ((err = pci_request_regions(pdev, e1000_driver_name)))
|
||||
return err;
|
||||
goto err_pci_reg;
|
||||
|
||||
pci_set_master(pdev);
|
||||
|
||||
err = -ENOMEM;
|
||||
netdev = alloc_etherdev(sizeof(struct e1000_adapter));
|
||||
if (!netdev) {
|
||||
err = -ENOMEM;
|
||||
if (!netdev)
|
||||
goto err_alloc_etherdev;
|
||||
}
|
||||
|
||||
SET_MODULE_OWNER(netdev);
|
||||
SET_NETDEV_DEV(netdev, &pdev->dev);
|
||||
|
@ -725,11 +725,10 @@ e1000_probe(struct pci_dev *pdev,
|
|||
mmio_start = pci_resource_start(pdev, BAR_0);
|
||||
mmio_len = pci_resource_len(pdev, BAR_0);
|
||||
|
||||
err = -EIO;
|
||||
adapter->hw.hw_addr = ioremap(mmio_start, mmio_len);
|
||||
if (!adapter->hw.hw_addr) {
|
||||
err = -EIO;
|
||||
if (!adapter->hw.hw_addr)
|
||||
goto err_ioremap;
|
||||
}
|
||||
|
||||
for (i = BAR_1; i <= BAR_5; i++) {
|
||||
if (pci_resource_len(pdev, i) == 0)
|
||||
|
@ -774,6 +773,7 @@ e1000_probe(struct pci_dev *pdev,
|
|||
if ((err = e1000_sw_init(adapter)))
|
||||
goto err_sw_init;
|
||||
|
||||
err = -EIO;
|
||||
/* Flash BAR mapping must happen after e1000_sw_init
|
||||
* because it depends on mac_type */
|
||||
if ((adapter->hw.mac_type == e1000_ich8lan) &&
|
||||
|
@ -781,24 +781,13 @@ e1000_probe(struct pci_dev *pdev,
|
|||
flash_start = pci_resource_start(pdev, 1);
|
||||
flash_len = pci_resource_len(pdev, 1);
|
||||
adapter->hw.flash_address = ioremap(flash_start, flash_len);
|
||||
if (!adapter->hw.flash_address) {
|
||||
err = -EIO;
|
||||
if (!adapter->hw.flash_address)
|
||||
goto err_flashmap;
|
||||
}
|
||||
}
|
||||
|
||||
if ((err = e1000_check_phy_reset_block(&adapter->hw)))
|
||||
if (e1000_check_phy_reset_block(&adapter->hw))
|
||||
DPRINTK(PROBE, INFO, "PHY reset is blocked due to SOL/IDER session.\n");
|
||||
|
||||
/* if ksp3, indicate if it's port a being setup */
|
||||
if (pdev->device == E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3 &&
|
||||
e1000_ksp3_port_a == 0)
|
||||
adapter->ksp3_port_a = 1;
|
||||
e1000_ksp3_port_a++;
|
||||
/* Reset for multiple KP3 adapters */
|
||||
if (e1000_ksp3_port_a == 4)
|
||||
e1000_ksp3_port_a = 0;
|
||||
|
||||
if (adapter->hw.mac_type >= e1000_82543) {
|
||||
netdev->features = NETIF_F_SG |
|
||||
NETIF_F_HW_CSUM |
|
||||
|
@ -830,7 +819,7 @@ e1000_probe(struct pci_dev *pdev,
|
|||
|
||||
if (e1000_init_eeprom_params(&adapter->hw)) {
|
||||
E1000_ERR("EEPROM initialization failed\n");
|
||||
return -EIO;
|
||||
goto err_eeprom;
|
||||
}
|
||||
|
||||
/* before reading the EEPROM, reset the controller to
|
||||
|
@ -842,7 +831,6 @@ e1000_probe(struct pci_dev *pdev,
|
|||
|
||||
if (e1000_validate_eeprom_checksum(&adapter->hw) < 0) {
|
||||
DPRINTK(PROBE, ERR, "The EEPROM Checksum Is Not Valid\n");
|
||||
err = -EIO;
|
||||
goto err_eeprom;
|
||||
}
|
||||
|
||||
|
@ -855,12 +843,9 @@ e1000_probe(struct pci_dev *pdev,
|
|||
|
||||
if (!is_valid_ether_addr(netdev->perm_addr)) {
|
||||
DPRINTK(PROBE, ERR, "Invalid MAC Address\n");
|
||||
err = -EIO;
|
||||
goto err_eeprom;
|
||||
}
|
||||
|
||||
e1000_read_part_num(&adapter->hw, &(adapter->part_num));
|
||||
|
||||
e1000_get_bus_info(&adapter->hw);
|
||||
|
||||
init_timer(&adapter->tx_fifo_stall_timer);
|
||||
|
@ -921,7 +906,38 @@ e1000_probe(struct pci_dev *pdev,
|
|||
break;
|
||||
}
|
||||
if (eeprom_data & eeprom_apme_mask)
|
||||
adapter->wol |= E1000_WUFC_MAG;
|
||||
adapter->eeprom_wol |= E1000_WUFC_MAG;
|
||||
|
||||
/* now that we have the eeprom settings, apply the special cases
|
||||
* where the eeprom may be wrong or the board simply won't support
|
||||
* wake on lan on a particular port */
|
||||
switch (pdev->device) {
|
||||
case E1000_DEV_ID_82546GB_PCIE:
|
||||
adapter->eeprom_wol = 0;
|
||||
break;
|
||||
case E1000_DEV_ID_82546EB_FIBER:
|
||||
case E1000_DEV_ID_82546GB_FIBER:
|
||||
case E1000_DEV_ID_82571EB_FIBER:
|
||||
/* Wake events only supported on port A for dual fiber
|
||||
* regardless of eeprom setting */
|
||||
if (E1000_READ_REG(&adapter->hw, STATUS) & E1000_STATUS_FUNC_1)
|
||||
adapter->eeprom_wol = 0;
|
||||
break;
|
||||
case E1000_DEV_ID_82546GB_QUAD_COPPER_KSP3:
|
||||
case E1000_DEV_ID_82571EB_QUAD_COPPER:
|
||||
/* if quad port adapter, disable WoL on all but port A */
|
||||
if (global_quad_port_a != 0)
|
||||
adapter->eeprom_wol = 0;
|
||||
else
|
||||
adapter->quad_port_a = 1;
|
||||
/* Reset for multiple quad port adapters */
|
||||
if (++global_quad_port_a == 4)
|
||||
global_quad_port_a = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
/* initialize the wol settings based on the eeprom settings */
|
||||
adapter->wol = adapter->eeprom_wol;
|
||||
|
||||
/* print bus type/speed/width info */
|
||||
{
|
||||
|
@ -964,16 +980,33 @@ e1000_probe(struct pci_dev *pdev,
|
|||
return 0;
|
||||
|
||||
err_register:
|
||||
e1000_release_hw_control(adapter);
|
||||
err_eeprom:
|
||||
if (!e1000_check_phy_reset_block(&adapter->hw))
|
||||
e1000_phy_hw_reset(&adapter->hw);
|
||||
|
||||
if (adapter->hw.flash_address)
|
||||
iounmap(adapter->hw.flash_address);
|
||||
err_flashmap:
|
||||
#ifdef CONFIG_E1000_NAPI
|
||||
for (i = 0; i < adapter->num_rx_queues; i++)
|
||||
dev_put(&adapter->polling_netdev[i]);
|
||||
#endif
|
||||
|
||||
kfree(adapter->tx_ring);
|
||||
kfree(adapter->rx_ring);
|
||||
#ifdef CONFIG_E1000_NAPI
|
||||
kfree(adapter->polling_netdev);
|
||||
#endif
|
||||
err_sw_init:
|
||||
err_eeprom:
|
||||
iounmap(adapter->hw.hw_addr);
|
||||
err_ioremap:
|
||||
free_netdev(netdev);
|
||||
err_alloc_etherdev:
|
||||
pci_release_regions(pdev);
|
||||
err_pci_reg:
|
||||
err_dma:
|
||||
pci_disable_device(pdev);
|
||||
return err;
|
||||
}
|
||||
|
||||
|
@ -1208,7 +1241,7 @@ e1000_open(struct net_device *netdev)
|
|||
|
||||
err = e1000_request_irq(adapter);
|
||||
if (err)
|
||||
goto err_up;
|
||||
goto err_req_irq;
|
||||
|
||||
e1000_power_up_phy(adapter);
|
||||
|
||||
|
@ -1229,6 +1262,9 @@ e1000_open(struct net_device *netdev)
|
|||
return E1000_SUCCESS;
|
||||
|
||||
err_up:
|
||||
e1000_power_down_phy(adapter);
|
||||
e1000_free_irq(adapter);
|
||||
err_req_irq:
|
||||
e1000_free_all_rx_resources(adapter);
|
||||
err_setup_rx:
|
||||
e1000_free_all_tx_resources(adapter);
|
||||
|
@ -1381,10 +1417,6 @@ setup_tx_desc_die:
|
|||
* (Descriptors) for all queues
|
||||
* @adapter: board private structure
|
||||
*
|
||||
* If this function returns with an error, then it's possible one or
|
||||
* more of the rings is populated (while the rest are not). It is the
|
||||
* callers duty to clean those orphaned rings.
|
||||
*
|
||||
* Return 0 on success, negative on failure
|
||||
**/
|
||||
|
||||
|
@ -1398,6 +1430,9 @@ e1000_setup_all_tx_resources(struct e1000_adapter *adapter)
|
|||
if (err) {
|
||||
DPRINTK(PROBE, ERR,
|
||||
"Allocation for Tx Queue %u failed\n", i);
|
||||
for (i-- ; i >= 0; i--)
|
||||
e1000_free_tx_resources(adapter,
|
||||
&adapter->tx_ring[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1499,8 +1534,6 @@ e1000_configure_tx(struct e1000_adapter *adapter)
|
|||
} else if (hw->mac_type == e1000_80003es2lan) {
|
||||
tarc = E1000_READ_REG(hw, TARC0);
|
||||
tarc |= 1;
|
||||
if (hw->media_type == e1000_media_type_internal_serdes)
|
||||
tarc |= (1 << 20);
|
||||
E1000_WRITE_REG(hw, TARC0, tarc);
|
||||
tarc = E1000_READ_REG(hw, TARC1);
|
||||
tarc |= 1;
|
||||
|
@ -1639,10 +1672,6 @@ setup_rx_desc_die:
|
|||
* (Descriptors) for all queues
|
||||
* @adapter: board private structure
|
||||
*
|
||||
* If this function returns with an error, then it's possible one or
|
||||
* more of the rings is populated (while the rest are not). It is the
|
||||
* callers duty to clean those orphaned rings.
|
||||
*
|
||||
* Return 0 on success, negative on failure
|
||||
**/
|
||||
|
||||
|
@ -1656,6 +1685,9 @@ e1000_setup_all_rx_resources(struct e1000_adapter *adapter)
|
|||
if (err) {
|
||||
DPRINTK(PROBE, ERR,
|
||||
"Allocation for Rx Queue %u failed\n", i);
|
||||
for (i-- ; i >= 0; i--)
|
||||
e1000_free_rx_resources(adapter,
|
||||
&adapter->rx_ring[i]);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -2442,10 +2474,9 @@ e1000_watchdog(unsigned long data)
|
|||
* disable receives in the ISR and
|
||||
* reset device here in the watchdog
|
||||
*/
|
||||
if (adapter->hw.mac_type == e1000_80003es2lan) {
|
||||
if (adapter->hw.mac_type == e1000_80003es2lan)
|
||||
/* reset device */
|
||||
schedule_work(&adapter->reset_task);
|
||||
}
|
||||
}
|
||||
|
||||
e1000_smartspeed(adapter);
|
||||
|
@ -2545,7 +2576,7 @@ e1000_tso(struct e1000_adapter *adapter, struct e1000_tx_ring *tx_ring,
|
|||
cmd_length = E1000_TXD_CMD_IP;
|
||||
ipcse = skb->h.raw - skb->data - 1;
|
||||
#ifdef NETIF_F_TSO_IPV6
|
||||
} else if (skb->protocol == ntohs(ETH_P_IPV6)) {
|
||||
} else if (skb->protocol == htons(ETH_P_IPV6)) {
|
||||
skb->nh.ipv6h->payload_len = 0;
|
||||
skb->h.th->check =
|
||||
~csum_ipv6_magic(&skb->nh.ipv6h->saddr,
|
||||
|
@ -3680,7 +3711,7 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter,
|
|||
E1000_DBG("%s: Receive packet consumed multiple"
|
||||
" buffers\n", netdev->name);
|
||||
/* recycle */
|
||||
buffer_info-> skb = skb;
|
||||
buffer_info->skb = skb;
|
||||
goto next_desc;
|
||||
}
|
||||
|
||||
|
@ -3711,7 +3742,6 @@ e1000_clean_rx_irq(struct e1000_adapter *adapter,
|
|||
netdev_alloc_skb(netdev, length + NET_IP_ALIGN);
|
||||
if (new_skb) {
|
||||
skb_reserve(new_skb, NET_IP_ALIGN);
|
||||
new_skb->dev = netdev;
|
||||
memcpy(new_skb->data - NET_IP_ALIGN,
|
||||
skb->data - NET_IP_ALIGN,
|
||||
length + NET_IP_ALIGN);
|
||||
|
@ -3978,13 +4008,13 @@ e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
|
|||
buffer_info = &rx_ring->buffer_info[i];
|
||||
|
||||
while (cleaned_count--) {
|
||||
if (!(skb = buffer_info->skb))
|
||||
skb = netdev_alloc_skb(netdev, bufsz);
|
||||
else {
|
||||
skb = buffer_info->skb;
|
||||
if (skb) {
|
||||
skb_trim(skb, 0);
|
||||
goto map_skb;
|
||||
}
|
||||
|
||||
skb = netdev_alloc_skb(netdev, bufsz);
|
||||
if (unlikely(!skb)) {
|
||||
/* Better luck next round */
|
||||
adapter->alloc_rx_buff_failed++;
|
||||
|
@ -4009,10 +4039,10 @@ e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
|
|||
dev_kfree_skb(skb);
|
||||
dev_kfree_skb(oldskb);
|
||||
break; /* while !buffer_info->skb */
|
||||
} else {
|
||||
/* Use new allocation */
|
||||
dev_kfree_skb(oldskb);
|
||||
}
|
||||
|
||||
/* Use new allocation */
|
||||
dev_kfree_skb(oldskb);
|
||||
}
|
||||
/* Make buffer alignment 2 beyond a 16 byte boundary
|
||||
* this will result in a 16 byte aligned IP header after
|
||||
|
@ -4020,8 +4050,6 @@ e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
|
|||
*/
|
||||
skb_reserve(skb, NET_IP_ALIGN);
|
||||
|
||||
skb->dev = netdev;
|
||||
|
||||
buffer_info->skb = skb;
|
||||
buffer_info->length = adapter->rx_buffer_len;
|
||||
map_skb:
|
||||
|
@ -4135,8 +4163,6 @@ e1000_alloc_rx_buffers_ps(struct e1000_adapter *adapter,
|
|||
*/
|
||||
skb_reserve(skb, NET_IP_ALIGN);
|
||||
|
||||
skb->dev = netdev;
|
||||
|
||||
buffer_info->skb = skb;
|
||||
buffer_info->length = adapter->rx_ps_bsize0;
|
||||
buffer_info->dma = pci_map_single(pdev, skb->data,
|
||||
|
@ -4628,7 +4654,7 @@ e1000_suspend(struct pci_dev *pdev, pm_message_t state)
|
|||
e1000_set_multi(netdev);
|
||||
|
||||
/* turn on all-multi mode if wake on multicast is enabled */
|
||||
if (adapter->wol & E1000_WUFC_MC) {
|
||||
if (wufc & E1000_WUFC_MC) {
|
||||
rctl = E1000_READ_REG(&adapter->hw, RCTL);
|
||||
rctl |= E1000_RCTL_MPE;
|
||||
E1000_WRITE_REG(&adapter->hw, RCTL, rctl);
|
||||
|
@ -4700,11 +4726,14 @@ e1000_resume(struct pci_dev *pdev)
|
|||
{
|
||||
struct net_device *netdev = pci_get_drvdata(pdev);
|
||||
struct e1000_adapter *adapter = netdev_priv(netdev);
|
||||
uint32_t manc, ret_val;
|
||||
uint32_t manc, err;
|
||||
|
||||
pci_set_power_state(pdev, PCI_D0);
|
||||
e1000_pci_restore_state(adapter);
|
||||
ret_val = pci_enable_device(pdev);
|
||||
if ((err = pci_enable_device(pdev))) {
|
||||
printk(KERN_ERR "e1000: Cannot enable PCI device from suspend\n");
|
||||
return err;
|
||||
}
|
||||
pci_set_master(pdev);
|
||||
|
||||
pci_enable_wake(pdev, PCI_D3hot, 0);
|
||||
|
@ -4782,6 +4811,7 @@ static pci_ers_result_t e1000_io_error_detected(struct pci_dev *pdev, pci_channe
|
|||
|
||||
if (netif_running(netdev))
|
||||
e1000_down(adapter);
|
||||
pci_disable_device(pdev);
|
||||
|
||||
/* Request a slot slot reset. */
|
||||
return PCI_ERS_RESULT_NEED_RESET;
|
||||
|
|
|
@ -42,25 +42,6 @@
|
|||
#include <linux/interrupt.h>
|
||||
#include <linux/sched.h>
|
||||
|
||||
#ifndef msec_delay
|
||||
#define msec_delay(x) do { if(in_interrupt()) { \
|
||||
/* Don't mdelay in interrupt context! */ \
|
||||
BUG(); \
|
||||
} else { \
|
||||
msleep(x); \
|
||||
} } while (0)
|
||||
|
||||
/* Some workarounds require millisecond delays and are run during interrupt
|
||||
* context. Most notably, when establishing link, the phy may need tweaking
|
||||
* but cannot process phy register reads/writes faster than millisecond
|
||||
* intervals...and we establish link due to a "link status change" interrupt.
|
||||
*/
|
||||
#define msec_delay_irq(x) mdelay(x)
|
||||
#endif
|
||||
|
||||
#define PCI_COMMAND_REGISTER PCI_COMMAND
|
||||
#define CMD_MEM_WRT_INVALIDATE PCI_COMMAND_INVALIDATE
|
||||
|
||||
typedef enum {
|
||||
#undef FALSE
|
||||
FALSE = 0,
|
||||
|
|
|
@ -324,7 +324,6 @@ e1000_check_options(struct e1000_adapter *adapter)
|
|||
DPRINTK(PROBE, NOTICE,
|
||||
"Warning: no configuration for board #%i\n", bd);
|
||||
DPRINTK(PROBE, NOTICE, "Using defaults for all values\n");
|
||||
bd = E1000_MAX_NIC;
|
||||
}
|
||||
|
||||
{ /* Transmit Descriptor Count */
|
||||
|
@ -342,9 +341,14 @@ e1000_check_options(struct e1000_adapter *adapter)
|
|||
opt.arg.r.max = mac_type < e1000_82544 ?
|
||||
E1000_MAX_TXD : E1000_MAX_82544_TXD;
|
||||
|
||||
tx_ring->count = TxDescriptors[bd];
|
||||
e1000_validate_option(&tx_ring->count, &opt, adapter);
|
||||
E1000_ROUNDUP(tx_ring->count, REQ_TX_DESCRIPTOR_MULTIPLE);
|
||||
if (num_TxDescriptors > bd) {
|
||||
tx_ring->count = TxDescriptors[bd];
|
||||
e1000_validate_option(&tx_ring->count, &opt, adapter);
|
||||
E1000_ROUNDUP(tx_ring->count,
|
||||
REQ_TX_DESCRIPTOR_MULTIPLE);
|
||||
} else {
|
||||
tx_ring->count = opt.def;
|
||||
}
|
||||
for (i = 0; i < adapter->num_tx_queues; i++)
|
||||
tx_ring[i].count = tx_ring->count;
|
||||
}
|
||||
|
@ -363,9 +367,14 @@ e1000_check_options(struct e1000_adapter *adapter)
|
|||
opt.arg.r.max = mac_type < e1000_82544 ? E1000_MAX_RXD :
|
||||
E1000_MAX_82544_RXD;
|
||||
|
||||
rx_ring->count = RxDescriptors[bd];
|
||||
e1000_validate_option(&rx_ring->count, &opt, adapter);
|
||||
E1000_ROUNDUP(rx_ring->count, REQ_RX_DESCRIPTOR_MULTIPLE);
|
||||
if (num_RxDescriptors > bd) {
|
||||
rx_ring->count = RxDescriptors[bd];
|
||||
e1000_validate_option(&rx_ring->count, &opt, adapter);
|
||||
E1000_ROUNDUP(rx_ring->count,
|
||||
REQ_RX_DESCRIPTOR_MULTIPLE);
|
||||
} else {
|
||||
rx_ring->count = opt.def;
|
||||
}
|
||||
for (i = 0; i < adapter->num_rx_queues; i++)
|
||||
rx_ring[i].count = rx_ring->count;
|
||||
}
|
||||
|
@ -377,9 +386,13 @@ e1000_check_options(struct e1000_adapter *adapter)
|
|||
.def = OPTION_ENABLED
|
||||
};
|
||||
|
||||
int rx_csum = XsumRX[bd];
|
||||
e1000_validate_option(&rx_csum, &opt, adapter);
|
||||
adapter->rx_csum = rx_csum;
|
||||
if (num_XsumRX > bd) {
|
||||
int rx_csum = XsumRX[bd];
|
||||
e1000_validate_option(&rx_csum, &opt, adapter);
|
||||
adapter->rx_csum = rx_csum;
|
||||
} else {
|
||||
adapter->rx_csum = opt.def;
|
||||
}
|
||||
}
|
||||
{ /* Flow Control */
|
||||
|
||||
|
@ -399,9 +412,13 @@ e1000_check_options(struct e1000_adapter *adapter)
|
|||
.p = fc_list }}
|
||||
};
|
||||
|
||||
int fc = FlowControl[bd];
|
||||
e1000_validate_option(&fc, &opt, adapter);
|
||||
adapter->hw.fc = adapter->hw.original_fc = fc;
|
||||
if (num_FlowControl > bd) {
|
||||
int fc = FlowControl[bd];
|
||||
e1000_validate_option(&fc, &opt, adapter);
|
||||
adapter->hw.fc = adapter->hw.original_fc = fc;
|
||||
} else {
|
||||
adapter->hw.fc = adapter->hw.original_fc = opt.def;
|
||||
}
|
||||
}
|
||||
{ /* Transmit Interrupt Delay */
|
||||
struct e1000_option opt = {
|
||||
|
@ -413,8 +430,13 @@ e1000_check_options(struct e1000_adapter *adapter)
|
|||
.max = MAX_TXDELAY }}
|
||||
};
|
||||
|
||||
adapter->tx_int_delay = TxIntDelay[bd];
|
||||
e1000_validate_option(&adapter->tx_int_delay, &opt, adapter);
|
||||
if (num_TxIntDelay > bd) {
|
||||
adapter->tx_int_delay = TxIntDelay[bd];
|
||||
e1000_validate_option(&adapter->tx_int_delay, &opt,
|
||||
adapter);
|
||||
} else {
|
||||
adapter->tx_int_delay = opt.def;
|
||||
}
|
||||
}
|
||||
{ /* Transmit Absolute Interrupt Delay */
|
||||
struct e1000_option opt = {
|
||||
|
@ -426,9 +448,13 @@ e1000_check_options(struct e1000_adapter *adapter)
|
|||
.max = MAX_TXABSDELAY }}
|
||||
};
|
||||
|
||||
adapter->tx_abs_int_delay = TxAbsIntDelay[bd];
|
||||
e1000_validate_option(&adapter->tx_abs_int_delay, &opt,
|
||||
adapter);
|
||||
if (num_TxAbsIntDelay > bd) {
|
||||
adapter->tx_abs_int_delay = TxAbsIntDelay[bd];
|
||||
e1000_validate_option(&adapter->tx_abs_int_delay, &opt,
|
||||
adapter);
|
||||
} else {
|
||||
adapter->tx_abs_int_delay = opt.def;
|
||||
}
|
||||
}
|
||||
{ /* Receive Interrupt Delay */
|
||||
struct e1000_option opt = {
|
||||
|
@ -440,8 +466,13 @@ e1000_check_options(struct e1000_adapter *adapter)
|
|||
.max = MAX_RXDELAY }}
|
||||
};
|
||||
|
||||
adapter->rx_int_delay = RxIntDelay[bd];
|
||||
e1000_validate_option(&adapter->rx_int_delay, &opt, adapter);
|
||||
if (num_RxIntDelay > bd) {
|
||||
adapter->rx_int_delay = RxIntDelay[bd];
|
||||
e1000_validate_option(&adapter->rx_int_delay, &opt,
|
||||
adapter);
|
||||
} else {
|
||||
adapter->rx_int_delay = opt.def;
|
||||
}
|
||||
}
|
||||
{ /* Receive Absolute Interrupt Delay */
|
||||
struct e1000_option opt = {
|
||||
|
@ -453,9 +484,13 @@ e1000_check_options(struct e1000_adapter *adapter)
|
|||
.max = MAX_RXABSDELAY }}
|
||||
};
|
||||
|
||||
adapter->rx_abs_int_delay = RxAbsIntDelay[bd];
|
||||
e1000_validate_option(&adapter->rx_abs_int_delay, &opt,
|
||||
adapter);
|
||||
if (num_RxAbsIntDelay > bd) {
|
||||
adapter->rx_abs_int_delay = RxAbsIntDelay[bd];
|
||||
e1000_validate_option(&adapter->rx_abs_int_delay, &opt,
|
||||
adapter);
|
||||
} else {
|
||||
adapter->rx_abs_int_delay = opt.def;
|
||||
}
|
||||
}
|
||||
{ /* Interrupt Throttling Rate */
|
||||
struct e1000_option opt = {
|
||||
|
@ -467,18 +502,24 @@ e1000_check_options(struct e1000_adapter *adapter)
|
|||
.max = MAX_ITR }}
|
||||
};
|
||||
|
||||
adapter->itr = InterruptThrottleRate[bd];
|
||||
switch (adapter->itr) {
|
||||
case 0:
|
||||
DPRINTK(PROBE, INFO, "%s turned off\n", opt.name);
|
||||
break;
|
||||
case 1:
|
||||
DPRINTK(PROBE, INFO, "%s set to dynamic mode\n",
|
||||
opt.name);
|
||||
break;
|
||||
default:
|
||||
e1000_validate_option(&adapter->itr, &opt, adapter);
|
||||
break;
|
||||
if (num_InterruptThrottleRate > bd) {
|
||||
adapter->itr = InterruptThrottleRate[bd];
|
||||
switch (adapter->itr) {
|
||||
case 0:
|
||||
DPRINTK(PROBE, INFO, "%s turned off\n",
|
||||
opt.name);
|
||||
break;
|
||||
case 1:
|
||||
DPRINTK(PROBE, INFO, "%s set to dynamic mode\n",
|
||||
opt.name);
|
||||
break;
|
||||
default:
|
||||
e1000_validate_option(&adapter->itr, &opt,
|
||||
adapter);
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
adapter->itr = opt.def;
|
||||
}
|
||||
}
|
||||
{ /* Smart Power Down */
|
||||
|
@ -489,9 +530,13 @@ e1000_check_options(struct e1000_adapter *adapter)
|
|||
.def = OPTION_DISABLED
|
||||
};
|
||||
|
||||
int spd = SmartPowerDownEnable[bd];
|
||||
e1000_validate_option(&spd, &opt, adapter);
|
||||
adapter->smart_power_down = spd;
|
||||
if (num_SmartPowerDownEnable > bd) {
|
||||
int spd = SmartPowerDownEnable[bd];
|
||||
e1000_validate_option(&spd, &opt, adapter);
|
||||
adapter->smart_power_down = spd;
|
||||
} else {
|
||||
adapter->smart_power_down = opt.def;
|
||||
}
|
||||
}
|
||||
{ /* Kumeran Lock Loss Workaround */
|
||||
struct e1000_option opt = {
|
||||
|
@ -501,9 +546,13 @@ e1000_check_options(struct e1000_adapter *adapter)
|
|||
.def = OPTION_ENABLED
|
||||
};
|
||||
|
||||
if (num_KumeranLockLoss > bd) {
|
||||
int kmrn_lock_loss = KumeranLockLoss[bd];
|
||||
e1000_validate_option(&kmrn_lock_loss, &opt, adapter);
|
||||
adapter->hw.kmrn_lock_loss_workaround_disabled = !kmrn_lock_loss;
|
||||
} else {
|
||||
adapter->hw.kmrn_lock_loss_workaround_disabled = !opt.def;
|
||||
}
|
||||
}
|
||||
|
||||
switch (adapter->hw.media_type) {
|
||||
|
@ -530,18 +579,17 @@ static void __devinit
|
|||
e1000_check_fiber_options(struct e1000_adapter *adapter)
|
||||
{
|
||||
int bd = adapter->bd_number;
|
||||
bd = bd > E1000_MAX_NIC ? E1000_MAX_NIC : bd;
|
||||
if ((Speed[bd] != OPTION_UNSET)) {
|
||||
if (num_Speed > bd) {
|
||||
DPRINTK(PROBE, INFO, "Speed not valid for fiber adapters, "
|
||||
"parameter ignored\n");
|
||||
}
|
||||
|
||||
if ((Duplex[bd] != OPTION_UNSET)) {
|
||||
if (num_Duplex > bd) {
|
||||
DPRINTK(PROBE, INFO, "Duplex not valid for fiber adapters, "
|
||||
"parameter ignored\n");
|
||||
}
|
||||
|
||||
if ((AutoNeg[bd] != OPTION_UNSET) && (AutoNeg[bd] != 0x20)) {
|
||||
if ((num_AutoNeg > bd) && (AutoNeg[bd] != 0x20)) {
|
||||
DPRINTK(PROBE, INFO, "AutoNeg other than 1000/Full is "
|
||||
"not valid for fiber adapters, "
|
||||
"parameter ignored\n");
|
||||
|
@ -560,7 +608,6 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
|
|||
{
|
||||
int speed, dplx, an;
|
||||
int bd = adapter->bd_number;
|
||||
bd = bd > E1000_MAX_NIC ? E1000_MAX_NIC : bd;
|
||||
|
||||
{ /* Speed */
|
||||
struct e1000_opt_list speed_list[] = {{ 0, "" },
|
||||
|
@ -577,8 +624,12 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
|
|||
.p = speed_list }}
|
||||
};
|
||||
|
||||
speed = Speed[bd];
|
||||
e1000_validate_option(&speed, &opt, adapter);
|
||||
if (num_Speed > bd) {
|
||||
speed = Speed[bd];
|
||||
e1000_validate_option(&speed, &opt, adapter);
|
||||
} else {
|
||||
speed = opt.def;
|
||||
}
|
||||
}
|
||||
{ /* Duplex */
|
||||
struct e1000_opt_list dplx_list[] = {{ 0, "" },
|
||||
|
@ -600,11 +651,15 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
|
|||
"Speed/Duplex/AutoNeg parameter ignored.\n");
|
||||
return;
|
||||
}
|
||||
dplx = Duplex[bd];
|
||||
e1000_validate_option(&dplx, &opt, adapter);
|
||||
if (num_Duplex > bd) {
|
||||
dplx = Duplex[bd];
|
||||
e1000_validate_option(&dplx, &opt, adapter);
|
||||
} else {
|
||||
dplx = opt.def;
|
||||
}
|
||||
}
|
||||
|
||||
if (AutoNeg[bd] != OPTION_UNSET && (speed != 0 || dplx != 0)) {
|
||||
if ((num_AutoNeg > bd) && (speed != 0 || dplx != 0)) {
|
||||
DPRINTK(PROBE, INFO,
|
||||
"AutoNeg specified along with Speed or Duplex, "
|
||||
"parameter ignored\n");
|
||||
|
@ -653,15 +708,19 @@ e1000_check_copper_options(struct e1000_adapter *adapter)
|
|||
.p = an_list }}
|
||||
};
|
||||
|
||||
an = AutoNeg[bd];
|
||||
e1000_validate_option(&an, &opt, adapter);
|
||||
if (num_AutoNeg > bd) {
|
||||
an = AutoNeg[bd];
|
||||
e1000_validate_option(&an, &opt, adapter);
|
||||
} else {
|
||||
an = opt.def;
|
||||
}
|
||||
adapter->hw.autoneg_advertised = an;
|
||||
}
|
||||
|
||||
switch (speed + dplx) {
|
||||
case 0:
|
||||
adapter->hw.autoneg = adapter->fc_autoneg = 1;
|
||||
if (Speed[bd] != OPTION_UNSET || Duplex[bd] != OPTION_UNSET)
|
||||
if ((num_Speed > bd) && (speed != 0 || dplx != 0))
|
||||
DPRINTK(PROBE, INFO,
|
||||
"Speed and duplex autonegotiation enabled\n");
|
||||
break;
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -154,7 +154,7 @@ static const char version[] =
|
|||
#include <asm/dma.h>
|
||||
|
||||
#define DRV_NAME "eepro"
|
||||
#define DRV_VERSION "0.13b"
|
||||
#define DRV_VERSION "0.13c"
|
||||
|
||||
#define compat_dev_kfree_skb( skb, mode ) dev_kfree_skb( (skb) )
|
||||
/* I had reports of looong delays with SLOW_DOWN defined as udelay(2) */
|
||||
|
@ -743,7 +743,7 @@ static void __init eepro_print_info (struct net_device *dev)
|
|||
printEEPROMInfo(dev);
|
||||
}
|
||||
|
||||
static struct ethtool_ops eepro_ethtool_ops;
|
||||
static const struct ethtool_ops eepro_ethtool_ops;
|
||||
|
||||
/* This is the real probe routine. Linux has a history of friendly device
|
||||
probes on the ISA bus. A good device probe avoids doing writes, and
|
||||
|
@ -1333,7 +1333,6 @@ set_multicast_list(struct net_device *dev)
|
|||
mode = inb(ioaddr + REG3);
|
||||
outb(mode, ioaddr + REG3); /* writing reg. 3 to complete the update */
|
||||
eepro_sw2bank0(ioaddr); /* Return to BANK 0 now */
|
||||
printk(KERN_INFO "%s: promiscuous mode enabled.\n", dev->name);
|
||||
}
|
||||
|
||||
else if (dev->mc_count==0 )
|
||||
|
@ -1772,7 +1771,7 @@ static void eepro_ethtool_get_drvinfo(struct net_device *dev,
|
|||
sprintf(drvinfo->bus_info, "ISA 0x%lx", dev->base_addr);
|
||||
}
|
||||
|
||||
static struct ethtool_ops eepro_ethtool_ops = {
|
||||
static const struct ethtool_ops eepro_ethtool_ops = {
|
||||
.get_settings = eepro_ethtool_get_settings,
|
||||
.get_drvinfo = eepro_ethtool_get_drvinfo,
|
||||
};
|
||||
|
|
|
@ -494,9 +494,9 @@ static struct net_device_stats *speedo_get_stats(struct net_device *dev);
|
|||
static int speedo_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
|
||||
static void set_rx_mode(struct net_device *dev);
|
||||
static void speedo_show_state(struct net_device *dev);
|
||||
static struct ethtool_ops ethtool_ops;
|
||||
static const 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) {
|
||||
|
@ -2015,7 +2015,7 @@ static void speedo_set_msglevel(struct net_device *dev, u32 v)
|
|||
sp->msg_enable = v;
|
||||
}
|
||||
|
||||
static struct ethtool_ops ethtool_ops = {
|
||||
static const struct ethtool_ops ethtool_ops = {
|
||||
.get_drvinfo = speedo_get_drvinfo,
|
||||
.get_settings = speedo_get_settings,
|
||||
.set_settings = speedo_set_settings,
|
||||
|
@ -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,
|
||||
|
@ -2385,7 +2385,7 @@ static int __init eepro100_init_module(void)
|
|||
#ifdef MODULE
|
||||
printk(version);
|
||||
#endif
|
||||
return pci_module_init(&eepro100_driver);
|
||||
return pci_register_driver(&eepro100_driver);
|
||||
}
|
||||
|
||||
static void __exit eepro100_cleanup_module(void)
|
||||
|
@ -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;
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
#
|
||||
# Makefile for the eHEA ethernet device driver for IBM eServer System p
|
||||
#
|
||||
ehea-y = ehea_main.o ehea_phyp.o ehea_qmr.o ehea_ethtool.o ehea_phyp.o
|
||||
obj-$(CONFIG_EHEA) += ehea.o
|
||||
|
|
@ -0,0 +1,447 @@
|
|||
/*
|
||||
* linux/drivers/net/ehea/ehea.h
|
||||
*
|
||||
* eHEA ethernet device driver for IBM eServer System p
|
||||
*
|
||||
* (C) Copyright IBM Corp. 2006
|
||||
*
|
||||
* Authors:
|
||||
* Christoph Raisch <raisch@de.ibm.com>
|
||||
* Jan-Bernd Themann <themann@de.ibm.com>
|
||||
* Thomas Klein <tklein@de.ibm.com>
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef __EHEA_H__
|
||||
#define __EHEA_H__
|
||||
|
||||
#include <linux/module.h>
|
||||
#include <linux/ethtool.h>
|
||||
#include <linux/vmalloc.h>
|
||||
#include <linux/if_vlan.h>
|
||||
|
||||
#include <asm/ibmebus.h>
|
||||
#include <asm/abs_addr.h>
|
||||
#include <asm/io.h>
|
||||
|
||||
#define DRV_NAME "ehea"
|
||||
#define DRV_VERSION "EHEA_0028"
|
||||
|
||||
#define EHEA_MSG_DEFAULT (NETIF_MSG_LINK | NETIF_MSG_TIMER \
|
||||
| NETIF_MSG_RX_ERR | NETIF_MSG_TX_ERR)
|
||||
|
||||
#define EHEA_MAX_ENTRIES_RQ1 32767
|
||||
#define EHEA_MAX_ENTRIES_RQ2 16383
|
||||
#define EHEA_MAX_ENTRIES_RQ3 16383
|
||||
#define EHEA_MAX_ENTRIES_SQ 32767
|
||||
#define EHEA_MIN_ENTRIES_QP 127
|
||||
|
||||
#define EHEA_NUM_TX_QP 1
|
||||
|
||||
#ifdef EHEA_SMALL_QUEUES
|
||||
#define EHEA_MAX_CQE_COUNT 1023
|
||||
#define EHEA_DEF_ENTRIES_SQ 1023
|
||||
#define EHEA_DEF_ENTRIES_RQ1 4095
|
||||
#define EHEA_DEF_ENTRIES_RQ2 1023
|
||||
#define EHEA_DEF_ENTRIES_RQ3 1023
|
||||
#else
|
||||
#define EHEA_MAX_CQE_COUNT 32000
|
||||
#define EHEA_DEF_ENTRIES_SQ 16000
|
||||
#define EHEA_DEF_ENTRIES_RQ1 32080
|
||||
#define EHEA_DEF_ENTRIES_RQ2 4020
|
||||
#define EHEA_DEF_ENTRIES_RQ3 4020
|
||||
#endif
|
||||
|
||||
#define EHEA_MAX_ENTRIES_EQ 20
|
||||
|
||||
#define EHEA_SG_SQ 2
|
||||
#define EHEA_SG_RQ1 1
|
||||
#define EHEA_SG_RQ2 0
|
||||
#define EHEA_SG_RQ3 0
|
||||
|
||||
#define EHEA_MAX_PACKET_SIZE 9022 /* for jumbo frames */
|
||||
#define EHEA_RQ2_PKT_SIZE 1522
|
||||
#define EHEA_L_PKT_SIZE 256 /* low latency */
|
||||
|
||||
#define EHEA_POLL_MAX_RWQE 1000
|
||||
|
||||
/* Send completion signaling */
|
||||
#define EHEA_SIG_IV_LONG 1
|
||||
|
||||
/* Protection Domain Identifier */
|
||||
#define EHEA_PD_ID 0xaabcdeff
|
||||
|
||||
#define EHEA_RQ2_THRESHOLD 1
|
||||
#define EHEA_RQ3_THRESHOLD 9 /* use RQ3 threshold of 1522 bytes */
|
||||
|
||||
#define EHEA_SPEED_10G 10000
|
||||
#define EHEA_SPEED_1G 1000
|
||||
#define EHEA_SPEED_100M 100
|
||||
#define EHEA_SPEED_10M 10
|
||||
#define EHEA_SPEED_AUTONEG 0
|
||||
|
||||
/* Broadcast/Multicast registration types */
|
||||
#define EHEA_BCMC_SCOPE_ALL 0x08
|
||||
#define EHEA_BCMC_SCOPE_SINGLE 0x00
|
||||
#define EHEA_BCMC_MULTICAST 0x04
|
||||
#define EHEA_BCMC_BROADCAST 0x00
|
||||
#define EHEA_BCMC_UNTAGGED 0x02
|
||||
#define EHEA_BCMC_TAGGED 0x00
|
||||
#define EHEA_BCMC_VLANID_ALL 0x01
|
||||
#define EHEA_BCMC_VLANID_SINGLE 0x00
|
||||
|
||||
/* Use this define to kmallocate pHYP control blocks */
|
||||
#define H_CB_ALIGNMENT 4096
|
||||
|
||||
#define EHEA_CACHE_LINE 128
|
||||
|
||||
/* Memory Regions */
|
||||
#define EHEA_MR_MAX_TX_PAGES 20
|
||||
#define EHEA_MR_TX_DATA_PN 3
|
||||
#define EHEA_MR_ACC_CTRL 0x00800000
|
||||
#define EHEA_RWQES_PER_MR_RQ2 10
|
||||
#define EHEA_RWQES_PER_MR_RQ3 10
|
||||
|
||||
#define EHEA_WATCH_DOG_TIMEOUT 10*HZ
|
||||
|
||||
/* utility functions */
|
||||
|
||||
#define ehea_info(fmt, args...) \
|
||||
printk(KERN_INFO DRV_NAME ": " fmt "\n", ## args)
|
||||
|
||||
#define ehea_error(fmt, args...) \
|
||||
printk(KERN_ERR DRV_NAME ": Error in %s: " fmt "\n", __func__, ## args)
|
||||
|
||||
#ifdef DEBUG
|
||||
#define ehea_debug(fmt, args...) \
|
||||
printk(KERN_DEBUG DRV_NAME ": " fmt, ## args)
|
||||
#else
|
||||
#define ehea_debug(fmt, args...) do {} while (0)
|
||||
#endif
|
||||
|
||||
void ehea_dump(void *adr, int len, char *msg);
|
||||
|
||||
#define EHEA_BMASK(pos, length) (((pos) << 16) + (length))
|
||||
|
||||
#define EHEA_BMASK_IBM(from, to) (((63 - to) << 16) + ((to) - (from) + 1))
|
||||
|
||||
#define EHEA_BMASK_SHIFTPOS(mask) (((mask) >> 16) & 0xffff)
|
||||
|
||||
#define EHEA_BMASK_MASK(mask) \
|
||||
(0xffffffffffffffffULL >> ((64 - (mask)) & 0xffff))
|
||||
|
||||
#define EHEA_BMASK_SET(mask, value) \
|
||||
((EHEA_BMASK_MASK(mask) & ((u64)(value))) << EHEA_BMASK_SHIFTPOS(mask))
|
||||
|
||||
#define EHEA_BMASK_GET(mask, value) \
|
||||
(EHEA_BMASK_MASK(mask) & (((u64)(value)) >> EHEA_BMASK_SHIFTPOS(mask)))
|
||||
|
||||
/*
|
||||
* Generic ehea page
|
||||
*/
|
||||
struct ehea_page {
|
||||
u8 entries[PAGE_SIZE];
|
||||
};
|
||||
|
||||
/*
|
||||
* Generic queue in linux kernel virtual memory
|
||||
*/
|
||||
struct hw_queue {
|
||||
u64 current_q_offset; /* current queue entry */
|
||||
struct ehea_page **queue_pages; /* array of pages belonging to queue */
|
||||
u32 qe_size; /* queue entry size */
|
||||
u32 queue_length; /* queue length allocated in bytes */
|
||||
u32 pagesize;
|
||||
u32 toggle_state; /* toggle flag - per page */
|
||||
u32 reserved; /* 64 bit alignment */
|
||||
};
|
||||
|
||||
/*
|
||||
* For pSeries this is a 64bit memory address where
|
||||
* I/O memory is mapped into CPU address space
|
||||
*/
|
||||
struct h_epa {
|
||||
void __iomem *addr;
|
||||
};
|
||||
|
||||
struct h_epa_user {
|
||||
u64 addr;
|
||||
};
|
||||
|
||||
struct h_epas {
|
||||
struct h_epa kernel; /* kernel space accessible resource,
|
||||
set to 0 if unused */
|
||||
struct h_epa_user user; /* user space accessible resource
|
||||
set to 0 if unused */
|
||||
};
|
||||
|
||||
struct ehea_qp;
|
||||
struct ehea_cq;
|
||||
struct ehea_eq;
|
||||
struct ehea_port;
|
||||
struct ehea_av;
|
||||
|
||||
/*
|
||||
* Queue attributes passed to ehea_create_qp()
|
||||
*/
|
||||
struct ehea_qp_init_attr {
|
||||
/* input parameter */
|
||||
u32 qp_token; /* queue token */
|
||||
u8 low_lat_rq1;
|
||||
u8 signalingtype; /* cqe generation flag */
|
||||
u8 rq_count; /* num of receive queues */
|
||||
u8 eqe_gen; /* eqe generation flag */
|
||||
u16 max_nr_send_wqes; /* max number of send wqes */
|
||||
u16 max_nr_rwqes_rq1; /* max number of receive wqes */
|
||||
u16 max_nr_rwqes_rq2;
|
||||
u16 max_nr_rwqes_rq3;
|
||||
u8 wqe_size_enc_sq;
|
||||
u8 wqe_size_enc_rq1;
|
||||
u8 wqe_size_enc_rq2;
|
||||
u8 wqe_size_enc_rq3;
|
||||
u8 swqe_imm_data_len; /* immediate data length for swqes */
|
||||
u16 port_nr;
|
||||
u16 rq2_threshold;
|
||||
u16 rq3_threshold;
|
||||
u64 send_cq_handle;
|
||||
u64 recv_cq_handle;
|
||||
u64 aff_eq_handle;
|
||||
|
||||
/* output parameter */
|
||||
u32 qp_nr;
|
||||
u16 act_nr_send_wqes;
|
||||
u16 act_nr_rwqes_rq1;
|
||||
u16 act_nr_rwqes_rq2;
|
||||
u16 act_nr_rwqes_rq3;
|
||||
u8 act_wqe_size_enc_sq;
|
||||
u8 act_wqe_size_enc_rq1;
|
||||
u8 act_wqe_size_enc_rq2;
|
||||
u8 act_wqe_size_enc_rq3;
|
||||
u32 nr_sq_pages;
|
||||
u32 nr_rq1_pages;
|
||||
u32 nr_rq2_pages;
|
||||
u32 nr_rq3_pages;
|
||||
u32 liobn_sq;
|
||||
u32 liobn_rq1;
|
||||
u32 liobn_rq2;
|
||||
u32 liobn_rq3;
|
||||
};
|
||||
|
||||
/*
|
||||
* Event Queue attributes, passed as paramter
|
||||
*/
|
||||
struct ehea_eq_attr {
|
||||
u32 type;
|
||||
u32 max_nr_of_eqes;
|
||||
u8 eqe_gen; /* generate eqe flag */
|
||||
u64 eq_handle;
|
||||
u32 act_nr_of_eqes;
|
||||
u32 nr_pages;
|
||||
u32 ist1; /* Interrupt service token */
|
||||
u32 ist2;
|
||||
u32 ist3;
|
||||
u32 ist4;
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* Event Queue
|
||||
*/
|
||||
struct ehea_eq {
|
||||
struct ehea_adapter *adapter;
|
||||
struct hw_queue hw_queue;
|
||||
u64 fw_handle;
|
||||
struct h_epas epas;
|
||||
spinlock_t spinlock;
|
||||
struct ehea_eq_attr attr;
|
||||
};
|
||||
|
||||
/*
|
||||
* HEA Queues
|
||||
*/
|
||||
struct ehea_qp {
|
||||
struct ehea_adapter *adapter;
|
||||
u64 fw_handle; /* QP handle for firmware calls */
|
||||
struct hw_queue hw_squeue;
|
||||
struct hw_queue hw_rqueue1;
|
||||
struct hw_queue hw_rqueue2;
|
||||
struct hw_queue hw_rqueue3;
|
||||
struct h_epas epas;
|
||||
struct ehea_qp_init_attr init_attr;
|
||||
};
|
||||
|
||||
/*
|
||||
* Completion Queue attributes
|
||||
*/
|
||||
struct ehea_cq_attr {
|
||||
/* input parameter */
|
||||
u32 max_nr_of_cqes;
|
||||
u32 cq_token;
|
||||
u64 eq_handle;
|
||||
|
||||
/* output parameter */
|
||||
u32 act_nr_of_cqes;
|
||||
u32 nr_pages;
|
||||
};
|
||||
|
||||
/*
|
||||
* Completion Queue
|
||||
*/
|
||||
struct ehea_cq {
|
||||
struct ehea_adapter *adapter;
|
||||
u64 fw_handle;
|
||||
struct hw_queue hw_queue;
|
||||
struct h_epas epas;
|
||||
struct ehea_cq_attr attr;
|
||||
};
|
||||
|
||||
/*
|
||||
* Memory Region
|
||||
*/
|
||||
struct ehea_mr {
|
||||
u64 handle;
|
||||
u64 vaddr;
|
||||
u32 lkey;
|
||||
};
|
||||
|
||||
/*
|
||||
* Port state information
|
||||
*/
|
||||
struct port_state {
|
||||
int poll_max_processed;
|
||||
int poll_receive_errors;
|
||||
int ehea_poll;
|
||||
int queue_stopped;
|
||||
int min_swqe_avail;
|
||||
u64 sqc_stop_sum;
|
||||
int pkt_send;
|
||||
int pkt_xmit;
|
||||
int send_tasklet;
|
||||
int nwqe;
|
||||
};
|
||||
|
||||
#define EHEA_IRQ_NAME_SIZE 20
|
||||
|
||||
/*
|
||||
* Queue SKB Array
|
||||
*/
|
||||
struct ehea_q_skb_arr {
|
||||
struct sk_buff **arr; /* skb array for queue */
|
||||
int len; /* array length */
|
||||
int index; /* array index */
|
||||
int os_skbs; /* rq2/rq3 only: outstanding skbs */
|
||||
};
|
||||
|
||||
/*
|
||||
* Port resources
|
||||
*/
|
||||
struct ehea_port_res {
|
||||
struct ehea_mr send_mr; /* send memory region */
|
||||
struct ehea_mr recv_mr; /* receive memory region */
|
||||
spinlock_t xmit_lock;
|
||||
struct ehea_port *port;
|
||||
char int_recv_name[EHEA_IRQ_NAME_SIZE];
|
||||
char int_send_name[EHEA_IRQ_NAME_SIZE];
|
||||
struct ehea_qp *qp;
|
||||
struct ehea_cq *send_cq;
|
||||
struct ehea_cq *recv_cq;
|
||||
struct ehea_eq *send_eq;
|
||||
struct ehea_eq *recv_eq;
|
||||
spinlock_t send_lock;
|
||||
struct ehea_q_skb_arr rq1_skba;
|
||||
struct ehea_q_skb_arr rq2_skba;
|
||||
struct ehea_q_skb_arr rq3_skba;
|
||||
struct ehea_q_skb_arr sq_skba;
|
||||
spinlock_t netif_queue;
|
||||
int queue_stopped;
|
||||
int swqe_refill_th;
|
||||
atomic_t swqe_avail;
|
||||
int swqe_ll_count;
|
||||
int swqe_count;
|
||||
u32 swqe_id_counter;
|
||||
u64 tx_packets;
|
||||
struct tasklet_struct send_comp_task;
|
||||
spinlock_t recv_lock;
|
||||
struct port_state p_state;
|
||||
u64 rx_packets;
|
||||
u32 poll_counter;
|
||||
};
|
||||
|
||||
|
||||
struct ehea_adapter {
|
||||
u64 handle;
|
||||
u8 num_ports;
|
||||
struct ehea_port *port[16];
|
||||
struct ehea_eq *neq; /* notification event queue */
|
||||
struct workqueue_struct *ehea_wq;
|
||||
struct tasklet_struct neq_tasklet;
|
||||
struct ehea_mr mr;
|
||||
u32 pd; /* protection domain */
|
||||
u64 max_mc_mac; /* max number of multicast mac addresses */
|
||||
};
|
||||
|
||||
|
||||
struct ehea_mc_list {
|
||||
struct list_head list;
|
||||
u64 macaddr;
|
||||
};
|
||||
|
||||
#define EHEA_PORT_UP 1
|
||||
#define EHEA_PORT_DOWN 0
|
||||
#define EHEA_MAX_PORT_RES 16
|
||||
struct ehea_port {
|
||||
struct ehea_adapter *adapter; /* adapter that owns this port */
|
||||
struct net_device *netdev;
|
||||
struct net_device_stats stats;
|
||||
struct ehea_port_res port_res[EHEA_MAX_PORT_RES];
|
||||
struct device_node *of_dev_node; /* Open Firmware Device Node */
|
||||
struct ehea_mc_list *mc_list; /* Multicast MAC addresses */
|
||||
struct vlan_group *vgrp;
|
||||
struct ehea_eq *qp_eq;
|
||||
struct work_struct reset_task;
|
||||
struct semaphore port_lock;
|
||||
char int_aff_name[EHEA_IRQ_NAME_SIZE];
|
||||
int allmulti; /* Indicates IFF_ALLMULTI state */
|
||||
int promisc; /* Indicates IFF_PROMISC state */
|
||||
int num_add_tx_qps;
|
||||
int resets;
|
||||
u64 mac_addr;
|
||||
u32 logical_port_id;
|
||||
u32 port_speed;
|
||||
u32 msg_enable;
|
||||
u32 sig_comp_iv;
|
||||
u32 state;
|
||||
u8 full_duplex;
|
||||
u8 autoneg;
|
||||
u8 num_def_qps;
|
||||
};
|
||||
|
||||
struct port_res_cfg {
|
||||
int max_entries_rcq;
|
||||
int max_entries_scq;
|
||||
int max_entries_sq;
|
||||
int max_entries_rq1;
|
||||
int max_entries_rq2;
|
||||
int max_entries_rq3;
|
||||
};
|
||||
|
||||
|
||||
void ehea_set_ethtool_ops(struct net_device *netdev);
|
||||
int ehea_sense_port_attr(struct ehea_port *port);
|
||||
int ehea_set_portspeed(struct ehea_port *port, u32 port_speed);
|
||||
|
||||
#endif /* __EHEA_H__ */
|
|
@ -0,0 +1,294 @@
|
|||
/*
|
||||
* linux/drivers/net/ehea/ehea_ethtool.c
|
||||
*
|
||||
* eHEA ethernet device driver for IBM eServer System p
|
||||
*
|
||||
* (C) Copyright IBM Corp. 2006
|
||||
*
|
||||
* Authors:
|
||||
* Christoph Raisch <raisch@de.ibm.com>
|
||||
* Jan-Bernd Themann <themann@de.ibm.com>
|
||||
* Thomas Klein <tklein@de.ibm.com>
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include "ehea.h"
|
||||
#include "ehea_phyp.h"
|
||||
|
||||
static int ehea_get_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
||||
{
|
||||
struct ehea_port *port = netdev_priv(dev);
|
||||
int ret;
|
||||
|
||||
ret = ehea_sense_port_attr(port);
|
||||
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (netif_carrier_ok(dev)) {
|
||||
switch(port->port_speed) {
|
||||
case EHEA_SPEED_10M: cmd->speed = SPEED_10; break;
|
||||
case EHEA_SPEED_100M: cmd->speed = SPEED_100; break;
|
||||
case EHEA_SPEED_1G: cmd->speed = SPEED_1000; break;
|
||||
case EHEA_SPEED_10G: cmd->speed = SPEED_10000; break;
|
||||
}
|
||||
cmd->duplex = port->full_duplex == 1 ?
|
||||
DUPLEX_FULL : DUPLEX_HALF;
|
||||
} else {
|
||||
cmd->speed = -1;
|
||||
cmd->duplex = -1;
|
||||
}
|
||||
|
||||
cmd->supported = (SUPPORTED_10000baseT_Full | SUPPORTED_1000baseT_Full
|
||||
| SUPPORTED_100baseT_Full | SUPPORTED_100baseT_Half
|
||||
| SUPPORTED_10baseT_Full | SUPPORTED_10baseT_Half
|
||||
| SUPPORTED_Autoneg | SUPPORTED_FIBRE);
|
||||
|
||||
cmd->advertising = (ADVERTISED_10000baseT_Full | ADVERTISED_Autoneg
|
||||
| ADVERTISED_FIBRE);
|
||||
|
||||
cmd->port = PORT_FIBRE;
|
||||
cmd->autoneg = port->autoneg == 1 ? AUTONEG_ENABLE : AUTONEG_DISABLE;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ehea_set_settings(struct net_device *dev, struct ethtool_cmd *cmd)
|
||||
{
|
||||
struct ehea_port *port = netdev_priv(dev);
|
||||
int ret = 0;
|
||||
u32 sp;
|
||||
|
||||
if (cmd->autoneg == AUTONEG_ENABLE) {
|
||||
sp = EHEA_SPEED_AUTONEG;
|
||||
goto doit;
|
||||
}
|
||||
|
||||
switch(cmd->speed) {
|
||||
case SPEED_10:
|
||||
if (cmd->duplex == DUPLEX_FULL)
|
||||
sp = H_SPEED_10M_F;
|
||||
else
|
||||
sp = H_SPEED_10M_H;
|
||||
break;
|
||||
|
||||
case SPEED_100:
|
||||
if (cmd->duplex == DUPLEX_FULL)
|
||||
sp = H_SPEED_100M_F;
|
||||
else
|
||||
sp = H_SPEED_100M_H;
|
||||
break;
|
||||
|
||||
case SPEED_1000:
|
||||
if (cmd->duplex == DUPLEX_FULL)
|
||||
sp = H_SPEED_1G_F;
|
||||
else
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
|
||||
case SPEED_10000:
|
||||
if (cmd->duplex == DUPLEX_FULL)
|
||||
sp = H_SPEED_10G_F;
|
||||
else
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
|
||||
default:
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
}
|
||||
|
||||
if (ret)
|
||||
goto out;
|
||||
doit:
|
||||
ret = ehea_set_portspeed(port, sp);
|
||||
|
||||
if (!ret)
|
||||
ehea_info("%s: Port speed succesfully set: %dMbps "
|
||||
"%s Duplex",
|
||||
port->netdev->name, port->port_speed,
|
||||
port->full_duplex == 1 ? "Full" : "Half");
|
||||
out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int ehea_nway_reset(struct net_device *dev)
|
||||
{
|
||||
struct ehea_port *port = netdev_priv(dev);
|
||||
int ret;
|
||||
|
||||
ret = ehea_set_portspeed(port, EHEA_SPEED_AUTONEG);
|
||||
|
||||
if (!ret)
|
||||
ehea_info("%s: Port speed succesfully set: %dMbps "
|
||||
"%s Duplex",
|
||||
port->netdev->name, port->port_speed,
|
||||
port->full_duplex == 1 ? "Full" : "Half");
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void ehea_get_drvinfo(struct net_device *dev,
|
||||
struct ethtool_drvinfo *info)
|
||||
{
|
||||
strlcpy(info->driver, DRV_NAME, sizeof(info->driver) - 1);
|
||||
strlcpy(info->version, DRV_VERSION, sizeof(info->version) - 1);
|
||||
}
|
||||
|
||||
static u32 ehea_get_msglevel(struct net_device *dev)
|
||||
{
|
||||
struct ehea_port *port = netdev_priv(dev);
|
||||
return port->msg_enable;
|
||||
}
|
||||
|
||||
static void ehea_set_msglevel(struct net_device *dev, u32 value)
|
||||
{
|
||||
struct ehea_port *port = netdev_priv(dev);
|
||||
port->msg_enable = value;
|
||||
}
|
||||
|
||||
static u32 ehea_get_rx_csum(struct net_device *dev)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
static char ehea_ethtool_stats_keys[][ETH_GSTRING_LEN] = {
|
||||
{"poll_max_processed"},
|
||||
{"queue_stopped"},
|
||||
{"min_swqe_avail"},
|
||||
{"poll_receive_err"},
|
||||
{"pkt_send"},
|
||||
{"pkt_xmit"},
|
||||
{"send_tasklet"},
|
||||
{"ehea_poll"},
|
||||
{"nwqe"},
|
||||
{"swqe_available_0"},
|
||||
{"sig_comp_iv"},
|
||||
{"swqe_refill_th"},
|
||||
{"port resets"},
|
||||
{"rxo"},
|
||||
{"rx64"},
|
||||
{"rx65"},
|
||||
{"rx128"},
|
||||
{"rx256"},
|
||||
{"rx512"},
|
||||
{"rx1024"},
|
||||
{"txo"},
|
||||
{"tx64"},
|
||||
{"tx65"},
|
||||
{"tx128"},
|
||||
{"tx256"},
|
||||
{"tx512"},
|
||||
{"tx1024"},
|
||||
};
|
||||
|
||||
static void ehea_get_strings(struct net_device *dev, u32 stringset, u8 *data)
|
||||
{
|
||||
if (stringset == ETH_SS_STATS) {
|
||||
memcpy(data, &ehea_ethtool_stats_keys,
|
||||
sizeof(ehea_ethtool_stats_keys));
|
||||
}
|
||||
}
|
||||
|
||||
static int ehea_get_stats_count(struct net_device *dev)
|
||||
{
|
||||
return ARRAY_SIZE(ehea_ethtool_stats_keys);
|
||||
}
|
||||
|
||||
static void ehea_get_ethtool_stats(struct net_device *dev,
|
||||
struct ethtool_stats *stats, u64 *data)
|
||||
{
|
||||
u64 hret;
|
||||
int i;
|
||||
struct ehea_port *port = netdev_priv(dev);
|
||||
struct ehea_adapter *adapter = port->adapter;
|
||||
struct ehea_port_res *pr = &port->port_res[0];
|
||||
struct port_state *p_state = &pr->p_state;
|
||||
struct hcp_ehea_port_cb6 *cb6;
|
||||
|
||||
for (i = 0; i < ehea_get_stats_count(dev); i++)
|
||||
data[i] = 0;
|
||||
|
||||
i = 0;
|
||||
|
||||
data[i++] = p_state->poll_max_processed;
|
||||
data[i++] = p_state->queue_stopped;
|
||||
data[i++] = p_state->min_swqe_avail;
|
||||
data[i++] = p_state->poll_receive_errors;
|
||||
data[i++] = p_state->pkt_send;
|
||||
data[i++] = p_state->pkt_xmit;
|
||||
data[i++] = p_state->send_tasklet;
|
||||
data[i++] = p_state->ehea_poll;
|
||||
data[i++] = p_state->nwqe;
|
||||
data[i++] = atomic_read(&port->port_res[0].swqe_avail);
|
||||
data[i++] = port->sig_comp_iv;
|
||||
data[i++] = port->port_res[0].swqe_refill_th;
|
||||
data[i++] = port->resets;
|
||||
|
||||
cb6 = kzalloc(H_CB_ALIGNMENT, GFP_KERNEL);
|
||||
if (!cb6) {
|
||||
ehea_error("no mem for cb6");
|
||||
return;
|
||||
}
|
||||
|
||||
hret = ehea_h_query_ehea_port(adapter->handle, port->logical_port_id,
|
||||
H_PORT_CB6, H_PORT_CB6_ALL, cb6);
|
||||
if (netif_msg_hw(port))
|
||||
ehea_dump(cb6, sizeof(*cb6), "ehea_get_ethtool_stats");
|
||||
|
||||
if (hret == H_SUCCESS) {
|
||||
data[i++] = cb6->rxo;
|
||||
data[i++] = cb6->rx64;
|
||||
data[i++] = cb6->rx65;
|
||||
data[i++] = cb6->rx128;
|
||||
data[i++] = cb6->rx256;
|
||||
data[i++] = cb6->rx512;
|
||||
data[i++] = cb6->rx1024;
|
||||
data[i++] = cb6->txo;
|
||||
data[i++] = cb6->tx64;
|
||||
data[i++] = cb6->tx65;
|
||||
data[i++] = cb6->tx128;
|
||||
data[i++] = cb6->tx256;
|
||||
data[i++] = cb6->tx512;
|
||||
data[i++] = cb6->tx1024;
|
||||
} else
|
||||
ehea_error("query_ehea_port failed");
|
||||
|
||||
kfree(cb6);
|
||||
}
|
||||
|
||||
const struct ethtool_ops ehea_ethtool_ops = {
|
||||
.get_settings = ehea_get_settings,
|
||||
.get_drvinfo = ehea_get_drvinfo,
|
||||
.get_msglevel = ehea_get_msglevel,
|
||||
.set_msglevel = ehea_set_msglevel,
|
||||
.get_link = ethtool_op_get_link,
|
||||
.get_tx_csum = ethtool_op_get_tx_csum,
|
||||
.get_sg = ethtool_op_get_sg,
|
||||
.get_tso = ethtool_op_get_tso,
|
||||
.set_tso = ethtool_op_set_tso,
|
||||
.get_strings = ehea_get_strings,
|
||||
.get_stats_count = ehea_get_stats_count,
|
||||
.get_ethtool_stats = ehea_get_ethtool_stats,
|
||||
.get_rx_csum = ehea_get_rx_csum,
|
||||
.set_settings = ehea_set_settings,
|
||||
.nway_reset = ehea_nway_reset, /* Restart autonegotiation */
|
||||
};
|
||||
|
||||
void ehea_set_ethtool_ops(struct net_device *netdev)
|
||||
{
|
||||
SET_ETHTOOL_OPS(netdev, &ehea_ethtool_ops);
|
||||
}
|
|
@ -0,0 +1,51 @@
|
|||
/*
|
||||
* linux/drivers/net/ehea/ehea_hcall.h
|
||||
*
|
||||
* eHEA ethernet device driver for IBM eServer System p
|
||||
*
|
||||
* (C) Copyright IBM Corp. 2006
|
||||
*
|
||||
* Authors:
|
||||
* Christoph Raisch <raisch@de.ibm.com>
|
||||
* Jan-Bernd Themann <themann@de.ibm.com>
|
||||
* Thomas Klein <tklein@de.ibm.com>
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef __EHEA_HCALL_H__
|
||||
#define __EHEA_HCALL_H__
|
||||
|
||||
/**
|
||||
* This file contains HCALL defines that are to be included in the appropriate
|
||||
* kernel files later
|
||||
*/
|
||||
|
||||
#define H_ALLOC_HEA_RESOURCE 0x278
|
||||
#define H_MODIFY_HEA_QP 0x250
|
||||
#define H_QUERY_HEA_QP 0x254
|
||||
#define H_QUERY_HEA 0x258
|
||||
#define H_QUERY_HEA_PORT 0x25C
|
||||
#define H_MODIFY_HEA_PORT 0x260
|
||||
#define H_REG_BCMC 0x264
|
||||
#define H_DEREG_BCMC 0x268
|
||||
#define H_REGISTER_HEA_RPAGES 0x26C
|
||||
#define H_DISABLE_AND_GET_HEA 0x270
|
||||
#define H_GET_HEA_INFO 0x274
|
||||
#define H_ADD_CONN 0x284
|
||||
#define H_DEL_CONN 0x288
|
||||
|
||||
#endif /* __EHEA_HCALL_H__ */
|
|
@ -0,0 +1,292 @@
|
|||
/*
|
||||
* linux/drivers/net/ehea/ehea_hw.h
|
||||
*
|
||||
* eHEA ethernet device driver for IBM eServer System p
|
||||
*
|
||||
* (C) Copyright IBM Corp. 2006
|
||||
*
|
||||
* Authors:
|
||||
* Christoph Raisch <raisch@de.ibm.com>
|
||||
* Jan-Bernd Themann <themann@de.ibm.com>
|
||||
* Thomas Klein <tklein@de.ibm.com>
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef __EHEA_HW_H__
|
||||
#define __EHEA_HW_H__
|
||||
|
||||
#define QPX_SQA_VALUE EHEA_BMASK_IBM(48,63)
|
||||
#define QPX_RQ1A_VALUE EHEA_BMASK_IBM(48,63)
|
||||
#define QPX_RQ2A_VALUE EHEA_BMASK_IBM(48,63)
|
||||
#define QPX_RQ3A_VALUE EHEA_BMASK_IBM(48,63)
|
||||
|
||||
#define QPTEMM_OFFSET(x) offsetof(struct ehea_qptemm, x)
|
||||
|
||||
struct ehea_qptemm {
|
||||
u64 qpx_hcr;
|
||||
u64 qpx_c;
|
||||
u64 qpx_herr;
|
||||
u64 qpx_aer;
|
||||
u64 qpx_sqa;
|
||||
u64 qpx_sqc;
|
||||
u64 qpx_rq1a;
|
||||
u64 qpx_rq1c;
|
||||
u64 qpx_st;
|
||||
u64 qpx_aerr;
|
||||
u64 qpx_tenure;
|
||||
u64 qpx_reserved1[(0x098 - 0x058) / 8];
|
||||
u64 qpx_portp;
|
||||
u64 qpx_reserved2[(0x100 - 0x0A0) / 8];
|
||||
u64 qpx_t;
|
||||
u64 qpx_sqhp;
|
||||
u64 qpx_sqptp;
|
||||
u64 qpx_reserved3[(0x140 - 0x118) / 8];
|
||||
u64 qpx_sqwsize;
|
||||
u64 qpx_reserved4[(0x170 - 0x148) / 8];
|
||||
u64 qpx_sqsize;
|
||||
u64 qpx_reserved5[(0x1B0 - 0x178) / 8];
|
||||
u64 qpx_sigt;
|
||||
u64 qpx_wqecnt;
|
||||
u64 qpx_rq1hp;
|
||||
u64 qpx_rq1ptp;
|
||||
u64 qpx_rq1size;
|
||||
u64 qpx_reserved6[(0x220 - 0x1D8) / 8];
|
||||
u64 qpx_rq1wsize;
|
||||
u64 qpx_reserved7[(0x240 - 0x228) / 8];
|
||||
u64 qpx_pd;
|
||||
u64 qpx_scqn;
|
||||
u64 qpx_rcqn;
|
||||
u64 qpx_aeqn;
|
||||
u64 reserved49;
|
||||
u64 qpx_ram;
|
||||
u64 qpx_reserved8[(0x300 - 0x270) / 8];
|
||||
u64 qpx_rq2a;
|
||||
u64 qpx_rq2c;
|
||||
u64 qpx_rq2hp;
|
||||
u64 qpx_rq2ptp;
|
||||
u64 qpx_rq2size;
|
||||
u64 qpx_rq2wsize;
|
||||
u64 qpx_rq2th;
|
||||
u64 qpx_rq3a;
|
||||
u64 qpx_rq3c;
|
||||
u64 qpx_rq3hp;
|
||||
u64 qpx_rq3ptp;
|
||||
u64 qpx_rq3size;
|
||||
u64 qpx_rq3wsize;
|
||||
u64 qpx_rq3th;
|
||||
u64 qpx_lpn;
|
||||
u64 qpx_reserved9[(0x400 - 0x378) / 8];
|
||||
u64 reserved_ext[(0x500 - 0x400) / 8];
|
||||
u64 reserved2[(0x1000 - 0x500) / 8];
|
||||
};
|
||||
|
||||
#define MRx_HCR_LPARID_VALID EHEA_BMASK_IBM(0, 0)
|
||||
|
||||
#define MRMWMM_OFFSET(x) offsetof(struct ehea_mrmwmm, x)
|
||||
|
||||
struct ehea_mrmwmm {
|
||||
u64 mrx_hcr;
|
||||
u64 mrx_c;
|
||||
u64 mrx_herr;
|
||||
u64 mrx_aer;
|
||||
u64 mrx_pp;
|
||||
u64 reserved1;
|
||||
u64 reserved2;
|
||||
u64 reserved3;
|
||||
u64 reserved4[(0x200 - 0x40) / 8];
|
||||
u64 mrx_ctl[64];
|
||||
};
|
||||
|
||||
#define QPEDMM_OFFSET(x) offsetof(struct ehea_qpedmm, x)
|
||||
|
||||
struct ehea_qpedmm {
|
||||
|
||||
u64 reserved0[(0x400) / 8];
|
||||
u64 qpedx_phh;
|
||||
u64 qpedx_ppsgp;
|
||||
u64 qpedx_ppsgu;
|
||||
u64 qpedx_ppdgp;
|
||||
u64 qpedx_ppdgu;
|
||||
u64 qpedx_aph;
|
||||
u64 qpedx_apsgp;
|
||||
u64 qpedx_apsgu;
|
||||
u64 qpedx_apdgp;
|
||||
u64 qpedx_apdgu;
|
||||
u64 qpedx_apav;
|
||||
u64 qpedx_apsav;
|
||||
u64 qpedx_hcr;
|
||||
u64 reserved1[4];
|
||||
u64 qpedx_rrl0;
|
||||
u64 qpedx_rrrkey0;
|
||||
u64 qpedx_rrva0;
|
||||
u64 reserved2;
|
||||
u64 qpedx_rrl1;
|
||||
u64 qpedx_rrrkey1;
|
||||
u64 qpedx_rrva1;
|
||||
u64 reserved3;
|
||||
u64 qpedx_rrl2;
|
||||
u64 qpedx_rrrkey2;
|
||||
u64 qpedx_rrva2;
|
||||
u64 reserved4;
|
||||
u64 qpedx_rrl3;
|
||||
u64 qpedx_rrrkey3;
|
||||
u64 qpedx_rrva3;
|
||||
};
|
||||
|
||||
#define CQX_FECADDER EHEA_BMASK_IBM(32, 63)
|
||||
#define CQX_FEC_CQE_CNT EHEA_BMASK_IBM(32, 63)
|
||||
#define CQX_N1_GENERATE_COMP_EVENT EHEA_BMASK_IBM(0, 0)
|
||||
#define CQX_EP_EVENT_PENDING EHEA_BMASK_IBM(0, 0)
|
||||
|
||||
#define CQTEMM_OFFSET(x) offsetof(struct ehea_cqtemm, x)
|
||||
|
||||
struct ehea_cqtemm {
|
||||
u64 cqx_hcr;
|
||||
u64 cqx_c;
|
||||
u64 cqx_herr;
|
||||
u64 cqx_aer;
|
||||
u64 cqx_ptp;
|
||||
u64 cqx_tp;
|
||||
u64 cqx_fec;
|
||||
u64 cqx_feca;
|
||||
u64 cqx_ep;
|
||||
u64 cqx_eq;
|
||||
u64 reserved1;
|
||||
u64 cqx_n0;
|
||||
u64 cqx_n1;
|
||||
u64 reserved2[(0x1000 - 0x60) / 8];
|
||||
};
|
||||
|
||||
#define EQTEMM_OFFSET(x) offsetof(struct ehea_eqtemm, x)
|
||||
|
||||
struct ehea_eqtemm {
|
||||
u64 eqx_hcr;
|
||||
u64 eqx_c;
|
||||
u64 eqx_herr;
|
||||
u64 eqx_aer;
|
||||
u64 eqx_ptp;
|
||||
u64 eqx_tp;
|
||||
u64 eqx_ssba;
|
||||
u64 eqx_psba;
|
||||
u64 eqx_cec;
|
||||
u64 eqx_meql;
|
||||
u64 eqx_xisbi;
|
||||
u64 eqx_xisc;
|
||||
u64 eqx_it;
|
||||
};
|
||||
|
||||
/*
|
||||
* These access functions will be changed when the dissuccsion about
|
||||
* the new access methods for POWER has settled.
|
||||
*/
|
||||
|
||||
static inline u64 epa_load(struct h_epa epa, u32 offset)
|
||||
{
|
||||
return __raw_readq((void __iomem *)(epa.addr + offset));
|
||||
}
|
||||
|
||||
static inline void epa_store(struct h_epa epa, u32 offset, u64 value)
|
||||
{
|
||||
__raw_writeq(value, (void __iomem *)(epa.addr + offset));
|
||||
epa_load(epa, offset); /* synchronize explicitly to eHEA */
|
||||
}
|
||||
|
||||
static inline void epa_store_acc(struct h_epa epa, u32 offset, u64 value)
|
||||
{
|
||||
__raw_writeq(value, (void __iomem *)(epa.addr + offset));
|
||||
}
|
||||
|
||||
#define epa_store_eq(epa, offset, value)\
|
||||
epa_store(epa, EQTEMM_OFFSET(offset), value)
|
||||
#define epa_load_eq(epa, offset)\
|
||||
epa_load(epa, EQTEMM_OFFSET(offset))
|
||||
|
||||
#define epa_store_cq(epa, offset, value)\
|
||||
epa_store(epa, CQTEMM_OFFSET(offset), value)
|
||||
#define epa_load_cq(epa, offset)\
|
||||
epa_load(epa, CQTEMM_OFFSET(offset))
|
||||
|
||||
#define epa_store_qp(epa, offset, value)\
|
||||
epa_store(epa, QPTEMM_OFFSET(offset), value)
|
||||
#define epa_load_qp(epa, offset)\
|
||||
epa_load(epa, QPTEMM_OFFSET(offset))
|
||||
|
||||
#define epa_store_qped(epa, offset, value)\
|
||||
epa_store(epa, QPEDMM_OFFSET(offset), value)
|
||||
#define epa_load_qped(epa, offset)\
|
||||
epa_load(epa, QPEDMM_OFFSET(offset))
|
||||
|
||||
#define epa_store_mrmw(epa, offset, value)\
|
||||
epa_store(epa, MRMWMM_OFFSET(offset), value)
|
||||
#define epa_load_mrmw(epa, offset)\
|
||||
epa_load(epa, MRMWMM_OFFSET(offset))
|
||||
|
||||
#define epa_store_base(epa, offset, value)\
|
||||
epa_store(epa, HCAGR_OFFSET(offset), value)
|
||||
#define epa_load_base(epa, offset)\
|
||||
epa_load(epa, HCAGR_OFFSET(offset))
|
||||
|
||||
static inline void ehea_update_sqa(struct ehea_qp *qp, u16 nr_wqes)
|
||||
{
|
||||
struct h_epa epa = qp->epas.kernel;
|
||||
epa_store_acc(epa, QPTEMM_OFFSET(qpx_sqa),
|
||||
EHEA_BMASK_SET(QPX_SQA_VALUE, nr_wqes));
|
||||
}
|
||||
|
||||
static inline void ehea_update_rq3a(struct ehea_qp *qp, u16 nr_wqes)
|
||||
{
|
||||
struct h_epa epa = qp->epas.kernel;
|
||||
epa_store_acc(epa, QPTEMM_OFFSET(qpx_rq3a),
|
||||
EHEA_BMASK_SET(QPX_RQ1A_VALUE, nr_wqes));
|
||||
}
|
||||
|
||||
static inline void ehea_update_rq2a(struct ehea_qp *qp, u16 nr_wqes)
|
||||
{
|
||||
struct h_epa epa = qp->epas.kernel;
|
||||
epa_store_acc(epa, QPTEMM_OFFSET(qpx_rq2a),
|
||||
EHEA_BMASK_SET(QPX_RQ2A_VALUE, nr_wqes));
|
||||
}
|
||||
|
||||
static inline void ehea_update_rq1a(struct ehea_qp *qp, u16 nr_wqes)
|
||||
{
|
||||
struct h_epa epa = qp->epas.kernel;
|
||||
epa_store_acc(epa, QPTEMM_OFFSET(qpx_rq1a),
|
||||
EHEA_BMASK_SET(QPX_RQ3A_VALUE, nr_wqes));
|
||||
}
|
||||
|
||||
static inline void ehea_update_feca(struct ehea_cq *cq, u32 nr_cqes)
|
||||
{
|
||||
struct h_epa epa = cq->epas.kernel;
|
||||
epa_store_acc(epa, CQTEMM_OFFSET(cqx_feca),
|
||||
EHEA_BMASK_SET(CQX_FECADDER, nr_cqes));
|
||||
}
|
||||
|
||||
static inline void ehea_reset_cq_n1(struct ehea_cq *cq)
|
||||
{
|
||||
struct h_epa epa = cq->epas.kernel;
|
||||
epa_store_cq(epa, cqx_n1,
|
||||
EHEA_BMASK_SET(CQX_N1_GENERATE_COMP_EVENT, 1));
|
||||
}
|
||||
|
||||
static inline void ehea_reset_cq_ep(struct ehea_cq *my_cq)
|
||||
{
|
||||
struct h_epa epa = my_cq->epas.kernel;
|
||||
epa_store_acc(epa, CQTEMM_OFFSET(cqx_ep),
|
||||
EHEA_BMASK_SET(CQX_EP_EVENT_PENDING, 0));
|
||||
}
|
||||
|
||||
#endif /* __EHEA_HW_H__ */
|
Разница между файлами не показана из-за своего большого размера
Загрузить разницу
|
@ -0,0 +1,705 @@
|
|||
/*
|
||||
* linux/drivers/net/ehea/ehea_phyp.c
|
||||
*
|
||||
* eHEA ethernet device driver for IBM eServer System p
|
||||
*
|
||||
* (C) Copyright IBM Corp. 2006
|
||||
*
|
||||
* Authors:
|
||||
* Christoph Raisch <raisch@de.ibm.com>
|
||||
* Jan-Bernd Themann <themann@de.ibm.com>
|
||||
* Thomas Klein <tklein@de.ibm.com>
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#include "ehea_phyp.h"
|
||||
|
||||
|
||||
static inline u16 get_order_of_qentries(u16 queue_entries)
|
||||
{
|
||||
u8 ld = 1; /* logarithmus dualis */
|
||||
while (((1U << ld) - 1) < queue_entries)
|
||||
ld++;
|
||||
return ld - 1;
|
||||
}
|
||||
|
||||
/* Defines for H_CALL H_ALLOC_RESOURCE */
|
||||
#define H_ALL_RES_TYPE_QP 1
|
||||
#define H_ALL_RES_TYPE_CQ 2
|
||||
#define H_ALL_RES_TYPE_EQ 3
|
||||
#define H_ALL_RES_TYPE_MR 5
|
||||
#define H_ALL_RES_TYPE_MW 6
|
||||
|
||||
static long ehea_hcall_9arg_9ret(unsigned long opcode,
|
||||
unsigned long arg1, unsigned long arg2,
|
||||
unsigned long arg3, unsigned long arg4,
|
||||
unsigned long arg5, unsigned long arg6,
|
||||
unsigned long arg7, unsigned long arg8,
|
||||
unsigned long arg9, unsigned long *out1,
|
||||
unsigned long *out2,unsigned long *out3,
|
||||
unsigned long *out4,unsigned long *out5,
|
||||
unsigned long *out6,unsigned long *out7,
|
||||
unsigned long *out8,unsigned long *out9)
|
||||
{
|
||||
long hret;
|
||||
int i, sleep_msecs;
|
||||
|
||||
for (i = 0; i < 5; i++) {
|
||||
hret = plpar_hcall_9arg_9ret(opcode,arg1, arg2, arg3, arg4,
|
||||
arg5, arg6, arg7, arg8, arg9, out1,
|
||||
out2, out3, out4, out5, out6, out7,
|
||||
out8, out9);
|
||||
if (H_IS_LONG_BUSY(hret)) {
|
||||
sleep_msecs = get_longbusy_msecs(hret);
|
||||
msleep_interruptible(sleep_msecs);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (hret < H_SUCCESS)
|
||||
ehea_error("op=%lx hret=%lx "
|
||||
"i1=%lx i2=%lx i3=%lx i4=%lx i5=%lx i6=%lx "
|
||||
"i7=%lx i8=%lx i9=%lx "
|
||||
"o1=%lx o2=%lx o3=%lx o4=%lx o5=%lx o6=%lx "
|
||||
"o7=%lx o8=%lx o9=%lx",
|
||||
opcode, hret, arg1, arg2, arg3, arg4, arg5,
|
||||
arg6, arg7, arg8, arg9, *out1, *out2, *out3,
|
||||
*out4, *out5, *out6, *out7, *out8, *out9);
|
||||
return hret;
|
||||
}
|
||||
return H_BUSY;
|
||||
}
|
||||
|
||||
u64 ehea_h_query_ehea_qp(const u64 adapter_handle, const u8 qp_category,
|
||||
const u64 qp_handle, const u64 sel_mask, void *cb_addr)
|
||||
{
|
||||
u64 dummy;
|
||||
|
||||
if ((((u64)cb_addr) & (PAGE_SIZE - 1)) != 0) {
|
||||
ehea_error("not on pageboundary");
|
||||
return H_PARAMETER;
|
||||
}
|
||||
|
||||
return ehea_hcall_9arg_9ret(H_QUERY_HEA_QP,
|
||||
adapter_handle, /* R4 */
|
||||
qp_category, /* R5 */
|
||||
qp_handle, /* R6 */
|
||||
sel_mask, /* R7 */
|
||||
virt_to_abs(cb_addr), /* R8 */
|
||||
0, 0, 0, 0, /* R9-R12 */
|
||||
&dummy, /* R4 */
|
||||
&dummy, /* R5 */
|
||||
&dummy, /* R6 */
|
||||
&dummy, /* R7 */
|
||||
&dummy, /* R8 */
|
||||
&dummy, /* R9 */
|
||||
&dummy, /* R10 */
|
||||
&dummy, /* R11 */
|
||||
&dummy); /* R12 */
|
||||
}
|
||||
|
||||
/* input param R5 */
|
||||
#define H_ALL_RES_QP_EQPO EHEA_BMASK_IBM(9, 11)
|
||||
#define H_ALL_RES_QP_QPP EHEA_BMASK_IBM(12, 12)
|
||||
#define H_ALL_RES_QP_RQR EHEA_BMASK_IBM(13, 15)
|
||||
#define H_ALL_RES_QP_EQEG EHEA_BMASK_IBM(16, 16)
|
||||
#define H_ALL_RES_QP_LL_QP EHEA_BMASK_IBM(17, 17)
|
||||
#define H_ALL_RES_QP_DMA128 EHEA_BMASK_IBM(19, 19)
|
||||
#define H_ALL_RES_QP_HSM EHEA_BMASK_IBM(20, 21)
|
||||
#define H_ALL_RES_QP_SIGT EHEA_BMASK_IBM(22, 23)
|
||||
#define H_ALL_RES_QP_TENURE EHEA_BMASK_IBM(48, 55)
|
||||
#define H_ALL_RES_QP_RES_TYP EHEA_BMASK_IBM(56, 63)
|
||||
|
||||
/* input param R9 */
|
||||
#define H_ALL_RES_QP_TOKEN EHEA_BMASK_IBM(0, 31)
|
||||
#define H_ALL_RES_QP_PD EHEA_BMASK_IBM(32,63)
|
||||
|
||||
/* input param R10 */
|
||||
#define H_ALL_RES_QP_MAX_SWQE EHEA_BMASK_IBM(4, 7)
|
||||
#define H_ALL_RES_QP_MAX_R1WQE EHEA_BMASK_IBM(12, 15)
|
||||
#define H_ALL_RES_QP_MAX_R2WQE EHEA_BMASK_IBM(20, 23)
|
||||
#define H_ALL_RES_QP_MAX_R3WQE EHEA_BMASK_IBM(28, 31)
|
||||
/* Max Send Scatter Gather Elements */
|
||||
#define H_ALL_RES_QP_MAX_SSGE EHEA_BMASK_IBM(37, 39)
|
||||
#define H_ALL_RES_QP_MAX_R1SGE EHEA_BMASK_IBM(45, 47)
|
||||
/* Max Receive SG Elements RQ1 */
|
||||
#define H_ALL_RES_QP_MAX_R2SGE EHEA_BMASK_IBM(53, 55)
|
||||
#define H_ALL_RES_QP_MAX_R3SGE EHEA_BMASK_IBM(61, 63)
|
||||
|
||||
/* input param R11 */
|
||||
#define H_ALL_RES_QP_SWQE_IDL EHEA_BMASK_IBM(0, 7)
|
||||
/* max swqe immediate data length */
|
||||
#define H_ALL_RES_QP_PORT_NUM EHEA_BMASK_IBM(48, 63)
|
||||
|
||||
/* input param R12 */
|
||||
#define H_ALL_RES_QP_TH_RQ2 EHEA_BMASK_IBM(0, 15)
|
||||
/* Threshold RQ2 */
|
||||
#define H_ALL_RES_QP_TH_RQ3 EHEA_BMASK_IBM(16, 31)
|
||||
/* Threshold RQ3 */
|
||||
|
||||
/* output param R6 */
|
||||
#define H_ALL_RES_QP_ACT_SWQE EHEA_BMASK_IBM(0, 15)
|
||||
#define H_ALL_RES_QP_ACT_R1WQE EHEA_BMASK_IBM(16, 31)
|
||||
#define H_ALL_RES_QP_ACT_R2WQE EHEA_BMASK_IBM(32, 47)
|
||||
#define H_ALL_RES_QP_ACT_R3WQE EHEA_BMASK_IBM(48, 63)
|
||||
|
||||
/* output param, R7 */
|
||||
#define H_ALL_RES_QP_ACT_SSGE EHEA_BMASK_IBM(0, 7)
|
||||
#define H_ALL_RES_QP_ACT_R1SGE EHEA_BMASK_IBM(8, 15)
|
||||
#define H_ALL_RES_QP_ACT_R2SGE EHEA_BMASK_IBM(16, 23)
|
||||
#define H_ALL_RES_QP_ACT_R3SGE EHEA_BMASK_IBM(24, 31)
|
||||
#define H_ALL_RES_QP_ACT_SWQE_IDL EHEA_BMASK_IBM(32, 39)
|
||||
|
||||
/* output param R8,R9 */
|
||||
#define H_ALL_RES_QP_SIZE_SQ EHEA_BMASK_IBM(0, 31)
|
||||
#define H_ALL_RES_QP_SIZE_RQ1 EHEA_BMASK_IBM(32, 63)
|
||||
#define H_ALL_RES_QP_SIZE_RQ2 EHEA_BMASK_IBM(0, 31)
|
||||
#define H_ALL_RES_QP_SIZE_RQ3 EHEA_BMASK_IBM(32, 63)
|
||||
|
||||
/* output param R11,R12 */
|
||||
#define H_ALL_RES_QP_LIOBN_SQ EHEA_BMASK_IBM(0, 31)
|
||||
#define H_ALL_RES_QP_LIOBN_RQ1 EHEA_BMASK_IBM(32, 63)
|
||||
#define H_ALL_RES_QP_LIOBN_RQ2 EHEA_BMASK_IBM(0, 31)
|
||||
#define H_ALL_RES_QP_LIOBN_RQ3 EHEA_BMASK_IBM(32, 63)
|
||||
|
||||
u64 ehea_h_alloc_resource_qp(const u64 adapter_handle,
|
||||
struct ehea_qp_init_attr *init_attr, const u32 pd,
|
||||
u64 *qp_handle, struct h_epas *h_epas)
|
||||
{
|
||||
u64 hret;
|
||||
|
||||
u64 allocate_controls =
|
||||
EHEA_BMASK_SET(H_ALL_RES_QP_EQPO, init_attr->low_lat_rq1 ? 1 : 0)
|
||||
| EHEA_BMASK_SET(H_ALL_RES_QP_QPP, 0)
|
||||
| EHEA_BMASK_SET(H_ALL_RES_QP_RQR, 6) /* rq1 & rq2 & rq3 */
|
||||
| EHEA_BMASK_SET(H_ALL_RES_QP_EQEG, 0) /* EQE gen. disabled */
|
||||
| EHEA_BMASK_SET(H_ALL_RES_QP_LL_QP, init_attr->low_lat_rq1)
|
||||
| EHEA_BMASK_SET(H_ALL_RES_QP_DMA128, 0)
|
||||
| EHEA_BMASK_SET(H_ALL_RES_QP_HSM, 0)
|
||||
| EHEA_BMASK_SET(H_ALL_RES_QP_SIGT, init_attr->signalingtype)
|
||||
| EHEA_BMASK_SET(H_ALL_RES_QP_RES_TYP, H_ALL_RES_TYPE_QP);
|
||||
|
||||
u64 r9_reg = EHEA_BMASK_SET(H_ALL_RES_QP_PD, pd)
|
||||
| EHEA_BMASK_SET(H_ALL_RES_QP_TOKEN, init_attr->qp_token);
|
||||
|
||||
u64 max_r10_reg =
|
||||
EHEA_BMASK_SET(H_ALL_RES_QP_MAX_SWQE,
|
||||
get_order_of_qentries(init_attr->max_nr_send_wqes))
|
||||
| EHEA_BMASK_SET(H_ALL_RES_QP_MAX_R1WQE,
|
||||
get_order_of_qentries(init_attr->max_nr_rwqes_rq1))
|
||||
| EHEA_BMASK_SET(H_ALL_RES_QP_MAX_R2WQE,
|
||||
get_order_of_qentries(init_attr->max_nr_rwqes_rq2))
|
||||
| EHEA_BMASK_SET(H_ALL_RES_QP_MAX_R3WQE,
|
||||
get_order_of_qentries(init_attr->max_nr_rwqes_rq3))
|
||||
| EHEA_BMASK_SET(H_ALL_RES_QP_MAX_SSGE, init_attr->wqe_size_enc_sq)
|
||||
| EHEA_BMASK_SET(H_ALL_RES_QP_MAX_R1SGE,
|
||||
init_attr->wqe_size_enc_rq1)
|
||||
| EHEA_BMASK_SET(H_ALL_RES_QP_MAX_R2SGE,
|
||||
init_attr->wqe_size_enc_rq2)
|
||||
| EHEA_BMASK_SET(H_ALL_RES_QP_MAX_R3SGE,
|
||||
init_attr->wqe_size_enc_rq3);
|
||||
|
||||
u64 r11_in =
|
||||
EHEA_BMASK_SET(H_ALL_RES_QP_SWQE_IDL, init_attr->swqe_imm_data_len)
|
||||
| EHEA_BMASK_SET(H_ALL_RES_QP_PORT_NUM, init_attr->port_nr);
|
||||
u64 threshold =
|
||||
EHEA_BMASK_SET(H_ALL_RES_QP_TH_RQ2, init_attr->rq2_threshold)
|
||||
| EHEA_BMASK_SET(H_ALL_RES_QP_TH_RQ3, init_attr->rq3_threshold);
|
||||
|
||||
u64 r5_out = 0;
|
||||
u64 r6_out = 0;
|
||||
u64 r7_out = 0;
|
||||
u64 r8_out = 0;
|
||||
u64 r9_out = 0;
|
||||
u64 g_la_user_out = 0;
|
||||
u64 r11_out = 0;
|
||||
u64 r12_out = 0;
|
||||
|
||||
hret = ehea_hcall_9arg_9ret(H_ALLOC_HEA_RESOURCE,
|
||||
adapter_handle, /* R4 */
|
||||
allocate_controls, /* R5 */
|
||||
init_attr->send_cq_handle, /* R6 */
|
||||
init_attr->recv_cq_handle, /* R7 */
|
||||
init_attr->aff_eq_handle, /* R8 */
|
||||
r9_reg, /* R9 */
|
||||
max_r10_reg, /* R10 */
|
||||
r11_in, /* R11 */
|
||||
threshold, /* R12 */
|
||||
qp_handle, /* R4 */
|
||||
&r5_out, /* R5 */
|
||||
&r6_out, /* R6 */
|
||||
&r7_out, /* R7 */
|
||||
&r8_out, /* R8 */
|
||||
&r9_out, /* R9 */
|
||||
&g_la_user_out, /* R10 */
|
||||
&r11_out, /* R11 */
|
||||
&r12_out); /* R12 */
|
||||
|
||||
init_attr->qp_nr = (u32)r5_out;
|
||||
|
||||
init_attr->act_nr_send_wqes =
|
||||
(u16)EHEA_BMASK_GET(H_ALL_RES_QP_ACT_SWQE, r6_out);
|
||||
init_attr->act_nr_rwqes_rq1 =
|
||||
(u16)EHEA_BMASK_GET(H_ALL_RES_QP_ACT_R1WQE, r6_out);
|
||||
init_attr->act_nr_rwqes_rq2 =
|
||||
(u16)EHEA_BMASK_GET(H_ALL_RES_QP_ACT_R2WQE, r6_out);
|
||||
init_attr->act_nr_rwqes_rq3 =
|
||||
(u16)EHEA_BMASK_GET(H_ALL_RES_QP_ACT_R3WQE, r6_out);
|
||||
|
||||
init_attr->act_wqe_size_enc_sq = init_attr->wqe_size_enc_sq;
|
||||
init_attr->act_wqe_size_enc_rq1 = init_attr->wqe_size_enc_rq1;
|
||||
init_attr->act_wqe_size_enc_rq2 = init_attr->wqe_size_enc_rq2;
|
||||
init_attr->act_wqe_size_enc_rq3 = init_attr->wqe_size_enc_rq3;
|
||||
|
||||
init_attr->nr_sq_pages =
|
||||
(u32)EHEA_BMASK_GET(H_ALL_RES_QP_SIZE_SQ, r8_out);
|
||||
init_attr->nr_rq1_pages =
|
||||
(u32)EHEA_BMASK_GET(H_ALL_RES_QP_SIZE_RQ1, r8_out);
|
||||
init_attr->nr_rq2_pages =
|
||||
(u32)EHEA_BMASK_GET(H_ALL_RES_QP_SIZE_RQ2, r9_out);
|
||||
init_attr->nr_rq3_pages =
|
||||
(u32)EHEA_BMASK_GET(H_ALL_RES_QP_SIZE_RQ3, r9_out);
|
||||
|
||||
init_attr->liobn_sq =
|
||||
(u32)EHEA_BMASK_GET(H_ALL_RES_QP_LIOBN_SQ, r11_out);
|
||||
init_attr->liobn_rq1 =
|
||||
(u32)EHEA_BMASK_GET(H_ALL_RES_QP_LIOBN_RQ1, r11_out);
|
||||
init_attr->liobn_rq2 =
|
||||
(u32)EHEA_BMASK_GET(H_ALL_RES_QP_LIOBN_RQ2, r12_out);
|
||||
init_attr->liobn_rq3 =
|
||||
(u32)EHEA_BMASK_GET(H_ALL_RES_QP_LIOBN_RQ3, r12_out);
|
||||
|
||||
if (!hret)
|
||||
hcp_epas_ctor(h_epas, g_la_user_out, g_la_user_out);
|
||||
|
||||
return hret;
|
||||
}
|
||||
|
||||
u64 ehea_h_alloc_resource_cq(const u64 adapter_handle,
|
||||
struct ehea_cq_attr *cq_attr,
|
||||
u64 *cq_handle, struct h_epas *epas)
|
||||
{
|
||||
u64 hret, dummy, act_nr_of_cqes_out, act_pages_out;
|
||||
u64 g_la_privileged_out, g_la_user_out;
|
||||
|
||||
hret = ehea_hcall_9arg_9ret(H_ALLOC_HEA_RESOURCE,
|
||||
adapter_handle, /* R4 */
|
||||
H_ALL_RES_TYPE_CQ, /* R5 */
|
||||
cq_attr->eq_handle, /* R6 */
|
||||
cq_attr->cq_token, /* R7 */
|
||||
cq_attr->max_nr_of_cqes, /* R8 */
|
||||
0, 0, 0, 0, /* R9-R12 */
|
||||
cq_handle, /* R4 */
|
||||
&dummy, /* R5 */
|
||||
&dummy, /* R6 */
|
||||
&act_nr_of_cqes_out, /* R7 */
|
||||
&act_pages_out, /* R8 */
|
||||
&g_la_privileged_out, /* R9 */
|
||||
&g_la_user_out, /* R10 */
|
||||
&dummy, /* R11 */
|
||||
&dummy); /* R12 */
|
||||
|
||||
cq_attr->act_nr_of_cqes = act_nr_of_cqes_out;
|
||||
cq_attr->nr_pages = act_pages_out;
|
||||
|
||||
if (!hret)
|
||||
hcp_epas_ctor(epas, g_la_privileged_out, g_la_user_out);
|
||||
|
||||
return hret;
|
||||
}
|
||||
|
||||
/* Defines for H_CALL H_ALLOC_RESOURCE */
|
||||
#define H_ALL_RES_TYPE_QP 1
|
||||
#define H_ALL_RES_TYPE_CQ 2
|
||||
#define H_ALL_RES_TYPE_EQ 3
|
||||
#define H_ALL_RES_TYPE_MR 5
|
||||
#define H_ALL_RES_TYPE_MW 6
|
||||
|
||||
/* input param R5 */
|
||||
#define H_ALL_RES_EQ_NEQ EHEA_BMASK_IBM(0, 0)
|
||||
#define H_ALL_RES_EQ_NON_NEQ_ISN EHEA_BMASK_IBM(6, 7)
|
||||
#define H_ALL_RES_EQ_INH_EQE_GEN EHEA_BMASK_IBM(16, 16)
|
||||
#define H_ALL_RES_EQ_RES_TYPE EHEA_BMASK_IBM(56, 63)
|
||||
/* input param R6 */
|
||||
#define H_ALL_RES_EQ_MAX_EQE EHEA_BMASK_IBM(32, 63)
|
||||
|
||||
/* output param R6 */
|
||||
#define H_ALL_RES_EQ_LIOBN EHEA_BMASK_IBM(32, 63)
|
||||
|
||||
/* output param R7 */
|
||||
#define H_ALL_RES_EQ_ACT_EQE EHEA_BMASK_IBM(32, 63)
|
||||
|
||||
/* output param R8 */
|
||||
#define H_ALL_RES_EQ_ACT_PS EHEA_BMASK_IBM(32, 63)
|
||||
|
||||
/* output param R9 */
|
||||
#define H_ALL_RES_EQ_ACT_EQ_IST_C EHEA_BMASK_IBM(30, 31)
|
||||
#define H_ALL_RES_EQ_ACT_EQ_IST_1 EHEA_BMASK_IBM(40, 63)
|
||||
|
||||
/* output param R10 */
|
||||
#define H_ALL_RES_EQ_ACT_EQ_IST_2 EHEA_BMASK_IBM(40, 63)
|
||||
|
||||
/* output param R11 */
|
||||
#define H_ALL_RES_EQ_ACT_EQ_IST_3 EHEA_BMASK_IBM(40, 63)
|
||||
|
||||
/* output param R12 */
|
||||
#define H_ALL_RES_EQ_ACT_EQ_IST_4 EHEA_BMASK_IBM(40, 63)
|
||||
|
||||
u64 ehea_h_alloc_resource_eq(const u64 adapter_handle,
|
||||
struct ehea_eq_attr *eq_attr, u64 *eq_handle)
|
||||
{
|
||||
u64 hret, dummy, eq_liobn, allocate_controls;
|
||||
u64 ist1_out, ist2_out, ist3_out, ist4_out;
|
||||
u64 act_nr_of_eqes_out, act_pages_out;
|
||||
|
||||
/* resource type */
|
||||
allocate_controls =
|
||||
EHEA_BMASK_SET(H_ALL_RES_EQ_RES_TYPE, H_ALL_RES_TYPE_EQ)
|
||||
| EHEA_BMASK_SET(H_ALL_RES_EQ_NEQ, eq_attr->type ? 1 : 0)
|
||||
| EHEA_BMASK_SET(H_ALL_RES_EQ_INH_EQE_GEN, !eq_attr->eqe_gen)
|
||||
| EHEA_BMASK_SET(H_ALL_RES_EQ_NON_NEQ_ISN, 1);
|
||||
|
||||
hret = ehea_hcall_9arg_9ret(H_ALLOC_HEA_RESOURCE,
|
||||
adapter_handle, /* R4 */
|
||||
allocate_controls, /* R5 */
|
||||
eq_attr->max_nr_of_eqes, /* R6 */
|
||||
0, 0, 0, 0, 0, 0, /* R7-R10 */
|
||||
eq_handle, /* R4 */
|
||||
&dummy, /* R5 */
|
||||
&eq_liobn, /* R6 */
|
||||
&act_nr_of_eqes_out, /* R7 */
|
||||
&act_pages_out, /* R8 */
|
||||
&ist1_out, /* R9 */
|
||||
&ist2_out, /* R10 */
|
||||
&ist3_out, /* R11 */
|
||||
&ist4_out); /* R12 */
|
||||
|
||||
eq_attr->act_nr_of_eqes = act_nr_of_eqes_out;
|
||||
eq_attr->nr_pages = act_pages_out;
|
||||
eq_attr->ist1 = ist1_out;
|
||||
eq_attr->ist2 = ist2_out;
|
||||
eq_attr->ist3 = ist3_out;
|
||||
eq_attr->ist4 = ist4_out;
|
||||
|
||||
return hret;
|
||||
}
|
||||
|
||||
u64 ehea_h_modify_ehea_qp(const u64 adapter_handle, const u8 cat,
|
||||
const u64 qp_handle, const u64 sel_mask,
|
||||
void *cb_addr, u64 *inv_attr_id, u64 *proc_mask,
|
||||
u16 *out_swr, u16 *out_rwr)
|
||||
{
|
||||
u64 hret, dummy, act_out_swr, act_out_rwr;
|
||||
|
||||
if ((((u64)cb_addr) & (PAGE_SIZE - 1)) != 0) {
|
||||
ehea_error("not on page boundary");
|
||||
return H_PARAMETER;
|
||||
}
|
||||
|
||||
hret = ehea_hcall_9arg_9ret(H_MODIFY_HEA_QP,
|
||||
adapter_handle, /* R4 */
|
||||
(u64) cat, /* R5 */
|
||||
qp_handle, /* R6 */
|
||||
sel_mask, /* R7 */
|
||||
virt_to_abs(cb_addr), /* R8 */
|
||||
0, 0, 0, 0, /* R9-R12 */
|
||||
inv_attr_id, /* R4 */
|
||||
&dummy, /* R5 */
|
||||
&dummy, /* R6 */
|
||||
&act_out_swr, /* R7 */
|
||||
&act_out_rwr, /* R8 */
|
||||
proc_mask, /* R9 */
|
||||
&dummy, /* R10 */
|
||||
&dummy, /* R11 */
|
||||
&dummy); /* R12 */
|
||||
*out_swr = act_out_swr;
|
||||
*out_rwr = act_out_rwr;
|
||||
|
||||
return hret;
|
||||
}
|
||||
|
||||
u64 ehea_h_register_rpage(const u64 adapter_handle, const u8 pagesize,
|
||||
const u8 queue_type, const u64 resource_handle,
|
||||
const u64 log_pageaddr, u64 count)
|
||||
{
|
||||
u64 dummy, reg_control;
|
||||
|
||||
reg_control = EHEA_BMASK_SET(H_REG_RPAGE_PAGE_SIZE, pagesize)
|
||||
| EHEA_BMASK_SET(H_REG_RPAGE_QT, queue_type);
|
||||
|
||||
return ehea_hcall_9arg_9ret(H_REGISTER_HEA_RPAGES,
|
||||
adapter_handle, /* R4 */
|
||||
reg_control, /* R5 */
|
||||
resource_handle, /* R6 */
|
||||
log_pageaddr, /* R7 */
|
||||
count, /* R8 */
|
||||
0, 0, 0, 0, /* R9-R12 */
|
||||
&dummy, /* R4 */
|
||||
&dummy, /* R5 */
|
||||
&dummy, /* R6 */
|
||||
&dummy, /* R7 */
|
||||
&dummy, /* R8 */
|
||||
&dummy, /* R9 */
|
||||
&dummy, /* R10 */
|
||||
&dummy, /* R11 */
|
||||
&dummy); /* R12 */
|
||||
}
|
||||
|
||||
u64 ehea_h_register_smr(const u64 adapter_handle, const u64 orig_mr_handle,
|
||||
const u64 vaddr_in, const u32 access_ctrl, const u32 pd,
|
||||
struct ehea_mr *mr)
|
||||
{
|
||||
u64 hret, dummy, lkey_out;
|
||||
|
||||
hret = ehea_hcall_9arg_9ret(H_REGISTER_SMR,
|
||||
adapter_handle , /* R4 */
|
||||
orig_mr_handle, /* R5 */
|
||||
vaddr_in, /* R6 */
|
||||
(((u64)access_ctrl) << 32ULL), /* R7 */
|
||||
pd, /* R8 */
|
||||
0, 0, 0, 0, /* R9-R12 */
|
||||
&mr->handle, /* R4 */
|
||||
&dummy, /* R5 */
|
||||
&lkey_out, /* R6 */
|
||||
&dummy, /* R7 */
|
||||
&dummy, /* R8 */
|
||||
&dummy, /* R9 */
|
||||
&dummy, /* R10 */
|
||||
&dummy, /* R11 */
|
||||
&dummy); /* R12 */
|
||||
mr->lkey = (u32)lkey_out;
|
||||
|
||||
return hret;
|
||||
}
|
||||
|
||||
u64 ehea_h_disable_and_get_hea(const u64 adapter_handle, const u64 qp_handle)
|
||||
{
|
||||
u64 hret, dummy, ladr_next_sq_wqe_out;
|
||||
u64 ladr_next_rq1_wqe_out, ladr_next_rq2_wqe_out, ladr_next_rq3_wqe_out;
|
||||
|
||||
hret = ehea_hcall_9arg_9ret(H_DISABLE_AND_GET_HEA,
|
||||
adapter_handle, /* R4 */
|
||||
H_DISABLE_GET_EHEA_WQE_P, /* R5 */
|
||||
qp_handle, /* R6 */
|
||||
0, 0, 0, 0, 0, 0, /* R7-R12 */
|
||||
&ladr_next_sq_wqe_out, /* R4 */
|
||||
&ladr_next_rq1_wqe_out, /* R5 */
|
||||
&ladr_next_rq2_wqe_out, /* R6 */
|
||||
&ladr_next_rq3_wqe_out, /* R7 */
|
||||
&dummy, /* R8 */
|
||||
&dummy, /* R9 */
|
||||
&dummy, /* R10 */
|
||||
&dummy, /* R11 */
|
||||
&dummy); /* R12 */
|
||||
return hret;
|
||||
}
|
||||
|
||||
u64 ehea_h_free_resource(const u64 adapter_handle, const u64 res_handle)
|
||||
{
|
||||
u64 dummy;
|
||||
|
||||
return ehea_hcall_9arg_9ret(H_FREE_RESOURCE,
|
||||
adapter_handle, /* R4 */
|
||||
res_handle, /* R5 */
|
||||
0, 0, 0, 0, 0, 0, 0, /* R6-R12 */
|
||||
&dummy, /* R4 */
|
||||
&dummy, /* R5 */
|
||||
&dummy, /* R6 */
|
||||
&dummy, /* R7 */
|
||||
&dummy, /* R8 */
|
||||
&dummy, /* R9 */
|
||||
&dummy, /* R10 */
|
||||
&dummy, /* R11 */
|
||||
&dummy); /* R12 */
|
||||
}
|
||||
|
||||
u64 ehea_h_alloc_resource_mr(const u64 adapter_handle, const u64 vaddr,
|
||||
const u64 length, const u32 access_ctrl,
|
||||
const u32 pd, u64 *mr_handle, u32 *lkey)
|
||||
{
|
||||
u64 hret, dummy, lkey_out;
|
||||
|
||||
hret = ehea_hcall_9arg_9ret(H_ALLOC_HEA_RESOURCE,
|
||||
adapter_handle, /* R4 */
|
||||
5, /* R5 */
|
||||
vaddr, /* R6 */
|
||||
length, /* R7 */
|
||||
(((u64) access_ctrl) << 32ULL),/* R8 */
|
||||
pd, /* R9 */
|
||||
0, 0, 0, /* R10-R12 */
|
||||
mr_handle, /* R4 */
|
||||
&dummy, /* R5 */
|
||||
&lkey_out, /* R6 */
|
||||
&dummy, /* R7 */
|
||||
&dummy, /* R8 */
|
||||
&dummy, /* R9 */
|
||||
&dummy, /* R10 */
|
||||
&dummy, /* R11 */
|
||||
&dummy); /* R12 */
|
||||
*lkey = (u32) lkey_out;
|
||||
|
||||
return hret;
|
||||
}
|
||||
|
||||
u64 ehea_h_register_rpage_mr(const u64 adapter_handle, const u64 mr_handle,
|
||||
const u8 pagesize, const u8 queue_type,
|
||||
const u64 log_pageaddr, const u64 count)
|
||||
{
|
||||
if ((count > 1) && (log_pageaddr & 0xfff)) {
|
||||
ehea_error("not on pageboundary");
|
||||
return H_PARAMETER;
|
||||
}
|
||||
|
||||
return ehea_h_register_rpage(adapter_handle, pagesize,
|
||||
queue_type, mr_handle,
|
||||
log_pageaddr, count);
|
||||
}
|
||||
|
||||
u64 ehea_h_query_ehea(const u64 adapter_handle, void *cb_addr)
|
||||
{
|
||||
u64 hret, dummy, cb_logaddr;
|
||||
|
||||
cb_logaddr = virt_to_abs(cb_addr);
|
||||
|
||||
hret = ehea_hcall_9arg_9ret(H_QUERY_HEA,
|
||||
adapter_handle, /* R4 */
|
||||
cb_logaddr, /* R5 */
|
||||
0, 0, 0, 0, 0, 0, 0, /* R6-R12 */
|
||||
&dummy, /* R4 */
|
||||
&dummy, /* R5 */
|
||||
&dummy, /* R6 */
|
||||
&dummy, /* R7 */
|
||||
&dummy, /* R8 */
|
||||
&dummy, /* R9 */
|
||||
&dummy, /* R10 */
|
||||
&dummy, /* R11 */
|
||||
&dummy); /* R12 */
|
||||
#ifdef DEBUG
|
||||
ehea_dmp(cb_addr, sizeof(struct hcp_query_ehea), "hcp_query_ehea");
|
||||
#endif
|
||||
return hret;
|
||||
}
|
||||
|
||||
u64 ehea_h_query_ehea_port(const u64 adapter_handle, const u16 port_num,
|
||||
const u8 cb_cat, const u64 select_mask,
|
||||
void *cb_addr)
|
||||
{
|
||||
u64 port_info, dummy;
|
||||
u64 cb_logaddr = virt_to_abs(cb_addr);
|
||||
u64 arr_index = 0;
|
||||
|
||||
port_info = EHEA_BMASK_SET(H_MEHEAPORT_CAT, cb_cat)
|
||||
| EHEA_BMASK_SET(H_MEHEAPORT_PN, port_num);
|
||||
|
||||
return ehea_hcall_9arg_9ret(H_QUERY_HEA_PORT,
|
||||
adapter_handle, /* R4 */
|
||||
port_info, /* R5 */
|
||||
select_mask, /* R6 */
|
||||
arr_index, /* R7 */
|
||||
cb_logaddr, /* R8 */
|
||||
0, 0, 0, 0, /* R9-R12 */
|
||||
&dummy, /* R4 */
|
||||
&dummy, /* R5 */
|
||||
&dummy, /* R6 */
|
||||
&dummy, /* R7 */
|
||||
&dummy, /* R8 */
|
||||
&dummy, /* R9 */
|
||||
&dummy, /* R10 */
|
||||
&dummy, /* R11 */
|
||||
&dummy); /* R12 */
|
||||
}
|
||||
|
||||
u64 ehea_h_modify_ehea_port(const u64 adapter_handle, const u16 port_num,
|
||||
const u8 cb_cat, const u64 select_mask,
|
||||
void *cb_addr)
|
||||
{
|
||||
u64 port_info, dummy, inv_attr_ident, proc_mask;
|
||||
u64 arr_index = 0;
|
||||
u64 cb_logaddr = virt_to_abs(cb_addr);
|
||||
|
||||
port_info = EHEA_BMASK_SET(H_MEHEAPORT_CAT, cb_cat)
|
||||
| EHEA_BMASK_SET(H_MEHEAPORT_PN, port_num);
|
||||
#ifdef DEBUG
|
||||
ehea_dump(cb_addr, sizeof(struct hcp_ehea_port_cb0), "Before HCALL");
|
||||
#endif
|
||||
return ehea_hcall_9arg_9ret(H_MODIFY_HEA_PORT,
|
||||
adapter_handle, /* R4 */
|
||||
port_info, /* R5 */
|
||||
select_mask, /* R6 */
|
||||
arr_index, /* R7 */
|
||||
cb_logaddr, /* R8 */
|
||||
0, 0, 0, 0, /* R9-R12 */
|
||||
&inv_attr_ident, /* R4 */
|
||||
&proc_mask, /* R5 */
|
||||
&dummy, /* R6 */
|
||||
&dummy, /* R7 */
|
||||
&dummy, /* R8 */
|
||||
&dummy, /* R9 */
|
||||
&dummy, /* R10 */
|
||||
&dummy, /* R11 */
|
||||
&dummy); /* R12 */
|
||||
}
|
||||
|
||||
u64 ehea_h_reg_dereg_bcmc(const u64 adapter_handle, const u16 port_num,
|
||||
const u8 reg_type, const u64 mc_mac_addr,
|
||||
const u16 vlan_id, const u32 hcall_id)
|
||||
{
|
||||
u64 r5_port_num, r6_reg_type, r7_mc_mac_addr, r8_vlan_id, dummy;
|
||||
u64 mac_addr = mc_mac_addr >> 16;
|
||||
|
||||
r5_port_num = EHEA_BMASK_SET(H_REGBCMC_PN, port_num);
|
||||
r6_reg_type = EHEA_BMASK_SET(H_REGBCMC_REGTYPE, reg_type);
|
||||
r7_mc_mac_addr = EHEA_BMASK_SET(H_REGBCMC_MACADDR, mac_addr);
|
||||
r8_vlan_id = EHEA_BMASK_SET(H_REGBCMC_VLANID, vlan_id);
|
||||
|
||||
return ehea_hcall_9arg_9ret(hcall_id,
|
||||
adapter_handle, /* R4 */
|
||||
r5_port_num, /* R5 */
|
||||
r6_reg_type, /* R6 */
|
||||
r7_mc_mac_addr, /* R7 */
|
||||
r8_vlan_id, /* R8 */
|
||||
0, 0, 0, 0, /* R9-R12 */
|
||||
&dummy, /* R4 */
|
||||
&dummy, /* R5 */
|
||||
&dummy, /* R6 */
|
||||
&dummy, /* R7 */
|
||||
&dummy, /* R8 */
|
||||
&dummy, /* R9 */
|
||||
&dummy, /* R10 */
|
||||
&dummy, /* R11 */
|
||||
&dummy); /* R12 */
|
||||
}
|
||||
|
||||
u64 ehea_h_reset_events(const u64 adapter_handle, const u64 neq_handle,
|
||||
const u64 event_mask)
|
||||
{
|
||||
u64 dummy;
|
||||
|
||||
return ehea_hcall_9arg_9ret(H_RESET_EVENTS,
|
||||
adapter_handle, /* R4 */
|
||||
neq_handle, /* R5 */
|
||||
event_mask, /* R6 */
|
||||
0, 0, 0, 0, 0, 0, /* R7-R12 */
|
||||
&dummy, /* R4 */
|
||||
&dummy, /* R5 */
|
||||
&dummy, /* R6 */
|
||||
&dummy, /* R7 */
|
||||
&dummy, /* R8 */
|
||||
&dummy, /* R9 */
|
||||
&dummy, /* R10 */
|
||||
&dummy, /* R11 */
|
||||
&dummy); /* R12 */
|
||||
}
|
|
@ -0,0 +1,455 @@
|
|||
/*
|
||||
* linux/drivers/net/ehea/ehea_phyp.h
|
||||
*
|
||||
* eHEA ethernet device driver for IBM eServer System p
|
||||
*
|
||||
* (C) Copyright IBM Corp. 2006
|
||||
*
|
||||
* Authors:
|
||||
* Christoph Raisch <raisch@de.ibm.com>
|
||||
* Jan-Bernd Themann <themann@de.ibm.com>
|
||||
* Thomas Klein <tklein@de.ibm.com>
|
||||
*
|
||||
*
|
||||
* 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
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* 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., 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
*/
|
||||
|
||||
#ifndef __EHEA_PHYP_H__
|
||||
#define __EHEA_PHYP_H__
|
||||
|
||||
#include <linux/delay.h>
|
||||
#include <asm/hvcall.h>
|
||||
#include "ehea.h"
|
||||
#include "ehea_hw.h"
|
||||
#include "ehea_hcall.h"
|
||||
|
||||
/* Some abbreviations used here:
|
||||
*
|
||||
* hcp_* - structures, variables and functions releated to Hypervisor Calls
|
||||
*/
|
||||
|
||||
static inline u32 get_longbusy_msecs(int long_busy_ret_code)
|
||||
{
|
||||
switch (long_busy_ret_code) {
|
||||
case H_LONG_BUSY_ORDER_1_MSEC:
|
||||
return 1;
|
||||
case H_LONG_BUSY_ORDER_10_MSEC:
|
||||
return 10;
|
||||
case H_LONG_BUSY_ORDER_100_MSEC:
|
||||
return 100;
|
||||
case H_LONG_BUSY_ORDER_1_SEC:
|
||||
return 1000;
|
||||
case H_LONG_BUSY_ORDER_10_SEC:
|
||||
return 10000;
|
||||
case H_LONG_BUSY_ORDER_100_SEC:
|
||||
return 100000;
|
||||
default:
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Notification Event Queue (NEQ) Entry bit masks */
|
||||
#define NEQE_EVENT_CODE EHEA_BMASK_IBM(2, 7)
|
||||
#define NEQE_PORTNUM EHEA_BMASK_IBM(32, 47)
|
||||
#define NEQE_PORT_UP EHEA_BMASK_IBM(16, 16)
|
||||
#define NEQE_EXTSWITCH_PORT_UP EHEA_BMASK_IBM(17, 17)
|
||||
#define NEQE_EXTSWITCH_PRIMARY EHEA_BMASK_IBM(18, 18)
|
||||
#define NEQE_PLID EHEA_BMASK_IBM(16, 47)
|
||||
|
||||
/* Notification Event Codes */
|
||||
#define EHEA_EC_PORTSTATE_CHG 0x30
|
||||
#define EHEA_EC_ADAPTER_MALFUNC 0x32
|
||||
#define EHEA_EC_PORT_MALFUNC 0x33
|
||||
|
||||
/* Notification Event Log Register (NELR) bit masks */
|
||||
#define NELR_PORT_MALFUNC EHEA_BMASK_IBM(61, 61)
|
||||
#define NELR_ADAPTER_MALFUNC EHEA_BMASK_IBM(62, 62)
|
||||
#define NELR_PORTSTATE_CHG EHEA_BMASK_IBM(63, 63)
|
||||
|
||||
static inline void hcp_epas_ctor(struct h_epas *epas, u64 paddr_kernel,
|
||||
u64 paddr_user)
|
||||
{
|
||||
epas->kernel.addr = ioremap(paddr_kernel, PAGE_SIZE);
|
||||
epas->user.addr = paddr_user;
|
||||
}
|
||||
|
||||
static inline void hcp_epas_dtor(struct h_epas *epas)
|
||||
{
|
||||
if (epas->kernel.addr)
|
||||
iounmap(epas->kernel.addr);
|
||||
|
||||
epas->user.addr = 0;
|
||||
epas->kernel.addr = 0;
|
||||
}
|
||||
|
||||
struct hcp_modify_qp_cb0 {
|
||||
u64 qp_ctl_reg; /* 00 */
|
||||
u32 max_swqe; /* 02 */
|
||||
u32 max_rwqe; /* 03 */
|
||||
u32 port_nb; /* 04 */
|
||||
u32 reserved0; /* 05 */
|
||||
u64 qp_aer; /* 06 */
|
||||
u64 qp_tenure; /* 08 */
|
||||
};
|
||||
|
||||
/* Hcall Query/Modify Queue Pair Control Block 0 Selection Mask Bits */
|
||||
#define H_QPCB0_ALL EHEA_BMASK_IBM(0, 5)
|
||||
#define H_QPCB0_QP_CTL_REG EHEA_BMASK_IBM(0, 0)
|
||||
#define H_QPCB0_MAX_SWQE EHEA_BMASK_IBM(1, 1)
|
||||
#define H_QPCB0_MAX_RWQE EHEA_BMASK_IBM(2, 2)
|
||||
#define H_QPCB0_PORT_NB EHEA_BMASK_IBM(3, 3)
|
||||
#define H_QPCB0_QP_AER EHEA_BMASK_IBM(4, 4)
|
||||
#define H_QPCB0_QP_TENURE EHEA_BMASK_IBM(5, 5)
|
||||
|
||||
/* Queue Pair Control Register Status Bits */
|
||||
#define H_QP_CR_ENABLED 0x8000000000000000ULL /* QP enabled */
|
||||
/* QP States: */
|
||||
#define H_QP_CR_STATE_RESET 0x0000010000000000ULL /* Reset */
|
||||
#define H_QP_CR_STATE_INITIALIZED 0x0000020000000000ULL /* Initialized */
|
||||
#define H_QP_CR_STATE_RDY2RCV 0x0000030000000000ULL /* Ready to recv */
|
||||
#define H_QP_CR_STATE_RDY2SND 0x0000050000000000ULL /* Ready to send */
|
||||
#define H_QP_CR_STATE_ERROR 0x0000800000000000ULL /* Error */
|
||||
|
||||
struct hcp_modify_qp_cb1 {
|
||||
u32 qpn; /* 00 */
|
||||
u32 qp_asyn_ev_eq_nb; /* 01 */
|
||||
u64 sq_cq_handle; /* 02 */
|
||||
u64 rq_cq_handle; /* 04 */
|
||||
/* sgel = scatter gather element */
|
||||
u32 sgel_nb_sq; /* 06 */
|
||||
u32 sgel_nb_rq1; /* 07 */
|
||||
u32 sgel_nb_rq2; /* 08 */
|
||||
u32 sgel_nb_rq3; /* 09 */
|
||||
};
|
||||
|
||||
/* Hcall Query/Modify Queue Pair Control Block 1 Selection Mask Bits */
|
||||
#define H_QPCB1_ALL EHEA_BMASK_IBM(0, 7)
|
||||
#define H_QPCB1_QPN EHEA_BMASK_IBM(0, 0)
|
||||
#define H_QPCB1_ASYN_EV_EQ_NB EHEA_BMASK_IBM(1, 1)
|
||||
#define H_QPCB1_SQ_CQ_HANDLE EHEA_BMASK_IBM(2, 2)
|
||||
#define H_QPCB1_RQ_CQ_HANDLE EHEA_BMASK_IBM(3, 3)
|
||||
#define H_QPCB1_SGEL_NB_SQ EHEA_BMASK_IBM(4, 4)
|
||||
#define H_QPCB1_SGEL_NB_RQ1 EHEA_BMASK_IBM(5, 5)
|
||||
#define H_QPCB1_SGEL_NB_RQ2 EHEA_BMASK_IBM(6, 6)
|
||||
#define H_QPCB1_SGEL_NB_RQ3 EHEA_BMASK_IBM(7, 7)
|
||||
|
||||
struct hcp_query_ehea {
|
||||
u32 cur_num_qps; /* 00 */
|
||||
u32 cur_num_cqs; /* 01 */
|
||||
u32 cur_num_eqs; /* 02 */
|
||||
u32 cur_num_mrs; /* 03 */
|
||||
u32 auth_level; /* 04 */
|
||||
u32 max_num_qps; /* 05 */
|
||||
u32 max_num_cqs; /* 06 */
|
||||
u32 max_num_eqs; /* 07 */
|
||||
u32 max_num_mrs; /* 08 */
|
||||
u32 reserved0; /* 09 */
|
||||
u32 int_clock_freq; /* 10 */
|
||||
u32 max_num_pds; /* 11 */
|
||||
u32 max_num_addr_handles; /* 12 */
|
||||
u32 max_num_cqes; /* 13 */
|
||||
u32 max_num_wqes; /* 14 */
|
||||
u32 max_num_sgel_rq1wqe; /* 15 */
|
||||
u32 max_num_sgel_rq2wqe; /* 16 */
|
||||
u32 max_num_sgel_rq3wqe; /* 17 */
|
||||
u32 mr_page_size; /* 18 */
|
||||
u32 reserved1; /* 19 */
|
||||
u64 max_mr_size; /* 20 */
|
||||
u64 reserved2; /* 22 */
|
||||
u32 num_ports; /* 24 */
|
||||
u32 reserved3; /* 25 */
|
||||
u32 reserved4; /* 26 */
|
||||
u32 reserved5; /* 27 */
|
||||
u64 max_mc_mac; /* 28 */
|
||||
u64 ehea_cap; /* 30 */
|
||||
u32 max_isn_per_eq; /* 32 */
|
||||
u32 max_num_neq; /* 33 */
|
||||
u64 max_num_vlan_ids; /* 34 */
|
||||
u32 max_num_port_group; /* 36 */
|
||||
u32 max_num_phys_port; /* 37 */
|
||||
|
||||
};
|
||||
|
||||
/* Hcall Query/Modify Port Control Block defines */
|
||||
#define H_PORT_CB0 0
|
||||
#define H_PORT_CB1 1
|
||||
#define H_PORT_CB2 2
|
||||
#define H_PORT_CB3 3
|
||||
#define H_PORT_CB4 4
|
||||
#define H_PORT_CB5 5
|
||||
#define H_PORT_CB6 6
|
||||
#define H_PORT_CB7 7
|
||||
|
||||
struct hcp_ehea_port_cb0 {
|
||||
u64 port_mac_addr;
|
||||
u64 port_rc;
|
||||
u64 reserved0;
|
||||
u32 port_op_state;
|
||||
u32 port_speed;
|
||||
u32 ext_swport_op_state;
|
||||
u32 neg_tpf_prpf;
|
||||
u32 num_default_qps;
|
||||
u32 reserved1;
|
||||
u64 default_qpn_arr[16];
|
||||
};
|
||||
|
||||
/* Hcall Query/Modify Port Control Block 0 Selection Mask Bits */
|
||||
#define H_PORT_CB0_ALL EHEA_BMASK_IBM(0, 7) /* Set all bits */
|
||||
#define H_PORT_CB0_MAC EHEA_BMASK_IBM(0, 0) /* MAC address */
|
||||
#define H_PORT_CB0_PRC EHEA_BMASK_IBM(1, 1) /* Port Recv Control */
|
||||
#define H_PORT_CB0_DEFQPNARRAY EHEA_BMASK_IBM(7, 7) /* Default QPN Array */
|
||||
|
||||
/* Hcall Query Port: Returned port speed values */
|
||||
#define H_SPEED_10M_H 1 /* 10 Mbps, Half Duplex */
|
||||
#define H_SPEED_10M_F 2 /* 10 Mbps, Full Duplex */
|
||||
#define H_SPEED_100M_H 3 /* 100 Mbps, Half Duplex */
|
||||
#define H_SPEED_100M_F 4 /* 100 Mbps, Full Duplex */
|
||||
#define H_SPEED_1G_F 6 /* 1 Gbps, Full Duplex */
|
||||
#define H_SPEED_10G_F 8 /* 10 Gbps, Full Duplex */
|
||||
|
||||
/* Port Receive Control Status Bits */
|
||||
#define PXLY_RC_VALID EHEA_BMASK_IBM(49, 49)
|
||||
#define PXLY_RC_VLAN_XTRACT EHEA_BMASK_IBM(50, 50)
|
||||
#define PXLY_RC_TCP_6_TUPLE EHEA_BMASK_IBM(51, 51)
|
||||
#define PXLY_RC_UDP_6_TUPLE EHEA_BMASK_IBM(52, 52)
|
||||
#define PXLY_RC_TCP_3_TUPLE EHEA_BMASK_IBM(53, 53)
|
||||
#define PXLY_RC_TCP_2_TUPLE EHEA_BMASK_IBM(54, 54)
|
||||
#define PXLY_RC_LLC_SNAP EHEA_BMASK_IBM(55, 55)
|
||||
#define PXLY_RC_JUMBO_FRAME EHEA_BMASK_IBM(56, 56)
|
||||
#define PXLY_RC_FRAG_IP_PKT EHEA_BMASK_IBM(57, 57)
|
||||
#define PXLY_RC_TCP_UDP_CHKSUM EHEA_BMASK_IBM(58, 58)
|
||||
#define PXLY_RC_IP_CHKSUM EHEA_BMASK_IBM(59, 59)
|
||||
#define PXLY_RC_MAC_FILTER EHEA_BMASK_IBM(60, 60)
|
||||
#define PXLY_RC_UNTAG_FILTER EHEA_BMASK_IBM(61, 61)
|
||||
#define PXLY_RC_VLAN_TAG_FILTER EHEA_BMASK_IBM(62, 63)
|
||||
|
||||
#define PXLY_RC_VLAN_FILTER 2
|
||||
#define PXLY_RC_VLAN_PERM 0
|
||||
|
||||
|
||||
#define H_PORT_CB1_ALL 0x8000000000000000ULL
|
||||
|
||||
struct hcp_ehea_port_cb1 {
|
||||
u64 vlan_filter[64];
|
||||
};
|
||||
|
||||
#define H_PORT_CB2_ALL 0xFFE0000000000000ULL
|
||||
|
||||
struct hcp_ehea_port_cb2 {
|
||||
u64 rxo;
|
||||
u64 rxucp;
|
||||
u64 rxufd;
|
||||
u64 rxuerr;
|
||||
u64 rxftl;
|
||||
u64 rxmcp;
|
||||
u64 rxbcp;
|
||||
u64 txo;
|
||||
u64 txucp;
|
||||
u64 txmcp;
|
||||
u64 txbcp;
|
||||
};
|
||||
|
||||
struct hcp_ehea_port_cb3 {
|
||||
u64 vlan_bc_filter[64];
|
||||
u64 vlan_mc_filter[64];
|
||||
u64 vlan_un_filter[64];
|
||||
u64 port_mac_hash_array[64];
|
||||
};
|
||||
|
||||
#define H_PORT_CB4_ALL 0xF000000000000000ULL
|
||||
#define H_PORT_CB4_JUMBO 0x1000000000000000ULL
|
||||
#define H_PORT_CB4_SPEED 0x8000000000000000ULL
|
||||
|
||||
struct hcp_ehea_port_cb4 {
|
||||
u32 port_speed;
|
||||
u32 pause_frame;
|
||||
u32 ens_port_op_state;
|
||||
u32 jumbo_frame;
|
||||
u32 ens_port_wrap;
|
||||
};
|
||||
|
||||
/* Hcall Query/Modify Port Control Block 5 Selection Mask Bits */
|
||||
#define H_PORT_CB5_RCU 0x0001000000000000ULL
|
||||
#define PXS_RCU EHEA_BMASK_IBM(61, 63)
|
||||
|
||||
struct hcp_ehea_port_cb5 {
|
||||
u64 prc; /* 00 */
|
||||
u64 uaa; /* 01 */
|
||||
u64 macvc; /* 02 */
|
||||
u64 xpcsc; /* 03 */
|
||||
u64 xpcsp; /* 04 */
|
||||
u64 pcsid; /* 05 */
|
||||
u64 xpcsst; /* 06 */
|
||||
u64 pthlb; /* 07 */
|
||||
u64 pthrb; /* 08 */
|
||||
u64 pqu; /* 09 */
|
||||
u64 pqd; /* 10 */
|
||||
u64 prt; /* 11 */
|
||||
u64 wsth; /* 12 */
|
||||
u64 rcb; /* 13 */
|
||||
u64 rcm; /* 14 */
|
||||
u64 rcu; /* 15 */
|
||||
u64 macc; /* 16 */
|
||||
u64 pc; /* 17 */
|
||||
u64 pst; /* 18 */
|
||||
u64 ducqpn; /* 19 */
|
||||
u64 mcqpn; /* 20 */
|
||||
u64 mma; /* 21 */
|
||||
u64 pmc0h; /* 22 */
|
||||
u64 pmc0l; /* 23 */
|
||||
u64 lbc; /* 24 */
|
||||
};
|
||||
|
||||
#define H_PORT_CB6_ALL 0xFFFFFE7FFFFF8000ULL
|
||||
|
||||
struct hcp_ehea_port_cb6 {
|
||||
u64 rxo; /* 00 */
|
||||
u64 rx64; /* 01 */
|
||||
u64 rx65; /* 02 */
|
||||
u64 rx128; /* 03 */
|
||||
u64 rx256; /* 04 */
|
||||
u64 rx512; /* 05 */
|
||||
u64 rx1024; /* 06 */
|
||||
u64 rxbfcs; /* 07 */
|
||||
u64 rxime; /* 08 */
|
||||
u64 rxrle; /* 09 */
|
||||
u64 rxorle; /* 10 */
|
||||
u64 rxftl; /* 11 */
|
||||
u64 rxjab; /* 12 */
|
||||
u64 rxse; /* 13 */
|
||||
u64 rxce; /* 14 */
|
||||
u64 rxrf; /* 15 */
|
||||
u64 rxfrag; /* 16 */
|
||||
u64 rxuoc; /* 17 */
|
||||
u64 rxcpf; /* 18 */
|
||||
u64 rxsb; /* 19 */
|
||||
u64 rxfd; /* 20 */
|
||||
u64 rxoerr; /* 21 */
|
||||
u64 rxaln; /* 22 */
|
||||
u64 ducqpn; /* 23 */
|
||||
u64 reserved0; /* 24 */
|
||||
u64 rxmcp; /* 25 */
|
||||
u64 rxbcp; /* 26 */
|
||||
u64 txmcp; /* 27 */
|
||||
u64 txbcp; /* 28 */
|
||||
u64 txo; /* 29 */
|
||||
u64 tx64; /* 30 */
|
||||
u64 tx65; /* 31 */
|
||||
u64 tx128; /* 32 */
|
||||
u64 tx256; /* 33 */
|
||||
u64 tx512; /* 34 */
|
||||
u64 tx1024; /* 35 */
|
||||
u64 txbfcs; /* 36 */
|
||||
u64 txcpf; /* 37 */
|
||||
u64 txlf; /* 38 */
|
||||
u64 txrf; /* 39 */
|
||||
u64 txime; /* 40 */
|
||||
u64 txsc; /* 41 */
|
||||
u64 txmc; /* 42 */
|
||||
u64 txsqe; /* 43 */
|
||||
u64 txdef; /* 44 */
|
||||
u64 txlcol; /* 45 */
|
||||
u64 txexcol; /* 46 */
|
||||
u64 txcse; /* 47 */
|
||||
u64 txbor; /* 48 */
|
||||
};
|
||||
|
||||
#define H_PORT_CB7_DUCQPN 0x8000000000000000ULL
|
||||
|
||||
struct hcp_ehea_port_cb7 {
|
||||
u64 def_uc_qpn;
|
||||
};
|
||||
|
||||
u64 ehea_h_query_ehea_qp(const u64 adapter_handle,
|
||||
const u8 qp_category,
|
||||
const u64 qp_handle, const u64 sel_mask,
|
||||
void *cb_addr);
|
||||
|
||||
u64 ehea_h_modify_ehea_qp(const u64 adapter_handle,
|
||||
const u8 cat,
|
||||
const u64 qp_handle,
|
||||
const u64 sel_mask,
|
||||
void *cb_addr,
|
||||
u64 * inv_attr_id,
|
||||
u64 * proc_mask, u16 * out_swr, u16 * out_rwr);
|
||||
|
||||
u64 ehea_h_alloc_resource_eq(const u64 adapter_handle,
|
||||
struct ehea_eq_attr *eq_attr, u64 * eq_handle);
|
||||
|
||||
u64 ehea_h_alloc_resource_cq(const u64 adapter_handle,
|
||||
struct ehea_cq_attr *cq_attr,
|
||||
u64 * cq_handle, struct h_epas *epas);
|
||||
|
||||
u64 ehea_h_alloc_resource_qp(const u64 adapter_handle,
|
||||
struct ehea_qp_init_attr *init_attr,
|
||||
const u32 pd,
|
||||
u64 * qp_handle, struct h_epas *h_epas);
|
||||
|
||||
#define H_REG_RPAGE_PAGE_SIZE EHEA_BMASK_IBM(48,55)
|
||||
#define H_REG_RPAGE_QT EHEA_BMASK_IBM(62,63)
|
||||
|
||||
u64 ehea_h_register_rpage(const u64 adapter_handle,
|
||||
const u8 pagesize,
|
||||
const u8 queue_type,
|
||||
const u64 resource_handle,
|
||||
const u64 log_pageaddr, u64 count);
|
||||
|
||||
#define H_DISABLE_GET_EHEA_WQE_P 1
|
||||
#define H_DISABLE_GET_SQ_WQE_P 2
|
||||
#define H_DISABLE_GET_RQC 3
|
||||
|
||||
u64 ehea_h_disable_and_get_hea(const u64 adapter_handle, const u64 qp_handle);
|
||||
|
||||
u64 ehea_h_free_resource(const u64 adapter_handle, const u64 res_handle);
|
||||
|
||||
u64 ehea_h_alloc_resource_mr(const u64 adapter_handle, const u64 vaddr,
|
||||
const u64 length, const u32 access_ctrl,
|
||||
const u32 pd, u64 * mr_handle, u32 * lkey);
|
||||
|
||||
u64 ehea_h_register_rpage_mr(const u64 adapter_handle, const u64 mr_handle,
|
||||
const u8 pagesize, const u8 queue_type,
|
||||
const u64 log_pageaddr, const u64 count);
|
||||
|
||||
u64 ehea_h_register_smr(const u64 adapter_handle, const u64 orig_mr_handle,
|
||||
const u64 vaddr_in, const u32 access_ctrl, const u32 pd,
|
||||
struct ehea_mr *mr);
|
||||
|
||||
u64 ehea_h_query_ehea(const u64 adapter_handle, void *cb_addr);
|
||||
|
||||
/* output param R5 */
|
||||
#define H_MEHEAPORT_CAT EHEA_BMASK_IBM(40,47)
|
||||
#define H_MEHEAPORT_PN EHEA_BMASK_IBM(48,63)
|
||||
|
||||
u64 ehea_h_query_ehea_port(const u64 adapter_handle, const u16 port_num,
|
||||
const u8 cb_cat, const u64 select_mask,
|
||||
void *cb_addr);
|
||||
|
||||
u64 ehea_h_modify_ehea_port(const u64 adapter_handle, const u16 port_num,
|
||||
const u8 cb_cat, const u64 select_mask,
|
||||
void *cb_addr);
|
||||
|
||||
#define H_REGBCMC_PN EHEA_BMASK_IBM(48, 63)
|
||||
#define H_REGBCMC_REGTYPE EHEA_BMASK_IBM(61, 63)
|
||||
#define H_REGBCMC_MACADDR EHEA_BMASK_IBM(16, 63)
|
||||
#define H_REGBCMC_VLANID EHEA_BMASK_IBM(52, 63)
|
||||
|
||||
u64 ehea_h_reg_dereg_bcmc(const u64 adapter_handle, const u16 port_num,
|
||||
const u8 reg_type, const u64 mc_mac_addr,
|
||||
const u16 vlan_id, const u32 hcall_id);
|
||||
|
||||
u64 ehea_h_reset_events(const u64 adapter_handle, const u64 neq_handle,
|
||||
const u64 event_mask);
|
||||
|
||||
#endif /* __EHEA_PHYP_H__ */
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче