Commit ebb3e820 authored by Linus Torvalds's avatar Linus Torvalds

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:
  WOL bugfix for 3c59x.c
  skge 1.12
  skge: add a debug interface
  skge: eeprom support
  skge: internal stats
  skge: XM PHY handling fixes
  skge: changing MTU while running causes problems
  skge: fix ram buffer size calculation
  gianfar: Fix compile regression caused by 09f75cd7
  net: Fix new EMAC driver for NAPI changes
  bonding: two small fixes for IPoIB support
  e1000e: don't poke PHY registers to retreive link status
  e1000e: fix error checks
  e1000e: Fix debug printk macro
  tokenring/3c359.c: fixed array index problem
  [netdrvr] forcedeth: remove in-driver copy of net_device_stats
  [netdrvr] forcedeth: improved probe info; dev_printk() cleanups
  forcedeth: fix NAPI rx poll function
parents e5712a6a 1a1769f3
...@@ -3118,7 +3118,13 @@ static void acpi_set_WOL(struct net_device *dev) ...@@ -3118,7 +3118,13 @@ static void acpi_set_WOL(struct net_device *dev)
iowrite16(SetRxFilter|RxStation|RxMulticast|RxBroadcast, ioaddr + EL3_CMD); iowrite16(SetRxFilter|RxStation|RxMulticast|RxBroadcast, ioaddr + EL3_CMD);
iowrite16(RxEnable, ioaddr + EL3_CMD); iowrite16(RxEnable, ioaddr + EL3_CMD);
pci_enable_wake(VORTEX_PCI(vp), 0, 1); if (pci_enable_wake(VORTEX_PCI(vp), PCI_D3hot, 1)) {
printk(KERN_INFO "%s: WOL not supported.\n",
pci_name(VORTEX_PCI(vp)));
vp->enable_wol = 0;
return;
}
/* Change the power state to D3; RxEnable doesn't take effect. */ /* Change the power state to D3; RxEnable doesn't take effect. */
pci_set_power_state(VORTEX_PCI(vp), PCI_D3hot); pci_set_power_state(VORTEX_PCI(vp), PCI_D3hot);
......
...@@ -2173,6 +2173,16 @@ config SKGE ...@@ -2173,6 +2173,16 @@ config SKGE
To compile this driver as a module, choose M here: the module To compile this driver as a module, choose M here: the module
will be called skge. This is recommended. will be called skge. This is recommended.
config SKGE_DEBUG
bool "Debugging interface"
depends on SKGE && DEBUG_FS
help
This option adds the ability to dump driver state for debugging.
The file debugfs/skge/ethX displays the state of the internal
transmit and receive rings.
If unsure, say N.
config SKY2 config SKY2
tristate "SysKonnect Yukon2 support" tristate "SysKonnect Yukon2 support"
depends on PCI depends on PCI
......
...@@ -1263,6 +1263,7 @@ static void bond_setup_by_slave(struct net_device *bond_dev, ...@@ -1263,6 +1263,7 @@ static void bond_setup_by_slave(struct net_device *bond_dev,
struct bonding *bond = bond_dev->priv; struct bonding *bond = bond_dev->priv;
bond_dev->neigh_setup = slave_dev->neigh_setup; bond_dev->neigh_setup = slave_dev->neigh_setup;
bond_dev->header_ops = slave_dev->header_ops;
bond_dev->type = slave_dev->type; bond_dev->type = slave_dev->type;
bond_dev->hard_header_len = slave_dev->hard_header_len; bond_dev->hard_header_len = slave_dev->hard_header_len;
...@@ -3351,6 +3352,9 @@ static int bond_slave_netdev_event(unsigned long event, struct net_device *slave ...@@ -3351,6 +3352,9 @@ static int bond_slave_netdev_event(unsigned long event, struct net_device *slave
switch (event) { switch (event) {
case NETDEV_UNREGISTER: case NETDEV_UNREGISTER:
if (bond_dev) { if (bond_dev) {
if (bond->setup_by_slave)
bond_release_and_destroy(bond_dev, slave_dev);
else
bond_release(bond_dev, slave_dev); bond_release(bond_dev, slave_dev);
} }
break; break;
...@@ -3366,11 +3370,6 @@ static int bond_slave_netdev_event(unsigned long event, struct net_device *slave ...@@ -3366,11 +3370,6 @@ static int bond_slave_netdev_event(unsigned long event, struct net_device *slave
* ... Or is it this? * ... Or is it this?
*/ */
break; break;
case NETDEV_GOING_DOWN:
dprintk("slave %s is going down\n", slave_dev->name);
if (bond->setup_by_slave)
bond_release_and_destroy(bond_dev, slave_dev);
break;
case NETDEV_CHANGEMTU: case NETDEV_CHANGEMTU:
/* /*
* TODO: Should slaves be allowed to * TODO: Should slaves be allowed to
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
#include "bond_3ad.h" #include "bond_3ad.h"
#include "bond_alb.h" #include "bond_alb.h"
#define DRV_VERSION "3.2.0" #define DRV_VERSION "3.2.1"
#define DRV_RELDATE "September 13, 2007" #define DRV_RELDATE "October 15, 2007"
#define DRV_NAME "bonding" #define DRV_NAME "bonding"
#define DRV_DESCRIPTION "Ethernet Channel Bonding Driver" #define DRV_DESCRIPTION "Ethernet Channel Bonding Driver"
......
...@@ -110,6 +110,7 @@ static int e1000_get_settings(struct net_device *netdev, ...@@ -110,6 +110,7 @@ static int e1000_get_settings(struct net_device *netdev,
{ {
struct e1000_adapter *adapter = netdev_priv(netdev); struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw; struct e1000_hw *hw = &adapter->hw;
u32 status;
if (hw->media_type == e1000_media_type_copper) { if (hw->media_type == e1000_media_type_copper) {
...@@ -147,16 +148,16 @@ static int e1000_get_settings(struct net_device *netdev, ...@@ -147,16 +148,16 @@ static int e1000_get_settings(struct net_device *netdev,
ecmd->transceiver = XCVR_EXTERNAL; ecmd->transceiver = XCVR_EXTERNAL;
} }
if (er32(STATUS) & E1000_STATUS_LU) { status = er32(STATUS);
if (status & E1000_STATUS_LU) {
adapter->hw.mac.ops.get_link_up_info(hw, &adapter->link_speed, if (status & E1000_STATUS_SPEED_1000)
&adapter->link_duplex); ecmd->speed = 1000;
ecmd->speed = adapter->link_speed; else if (status & E1000_STATUS_SPEED_100)
ecmd->speed = 100;
/* unfortunately FULL_DUPLEX != DUPLEX_FULL else
* and HALF_DUPLEX != DUPLEX_HALF */ ecmd->speed = 10;
if (adapter->link_duplex == FULL_DUPLEX) if (status & E1000_STATUS_FD)
ecmd->duplex = DUPLEX_FULL; ecmd->duplex = DUPLEX_FULL;
else else
ecmd->duplex = DUPLEX_HALF; ecmd->duplex = DUPLEX_HALF;
...@@ -170,6 +171,16 @@ static int e1000_get_settings(struct net_device *netdev, ...@@ -170,6 +171,16 @@ static int e1000_get_settings(struct net_device *netdev,
return 0; return 0;
} }
static u32 e1000_get_link(struct net_device *netdev)
{
struct e1000_adapter *adapter = netdev_priv(netdev);
struct e1000_hw *hw = &adapter->hw;
u32 status;
status = er32(STATUS);
return (status & E1000_STATUS_LU);
}
static int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx) static int e1000_set_spd_dplx(struct e1000_adapter *adapter, u16 spddplx)
{ {
struct e1000_mac_info *mac = &adapter->hw.mac; struct e1000_mac_info *mac = &adapter->hw.mac;
...@@ -1451,11 +1462,11 @@ static int e1000_loopback_test(struct e1000_adapter *adapter, u64 *data) ...@@ -1451,11 +1462,11 @@ static int e1000_loopback_test(struct e1000_adapter *adapter, u64 *data)
} }
*data = e1000_setup_desc_rings(adapter); *data = e1000_setup_desc_rings(adapter);
if (data) if (*data)
goto out; goto out;
*data = e1000_setup_loopback_test(adapter); *data = e1000_setup_loopback_test(adapter);
if (data) if (*data)
goto err_loopback; goto err_loopback;
*data = e1000_run_loopback_test(adapter); *data = e1000_run_loopback_test(adapter);
...@@ -1751,7 +1762,7 @@ static const struct ethtool_ops e1000_ethtool_ops = { ...@@ -1751,7 +1762,7 @@ static const struct ethtool_ops e1000_ethtool_ops = {
.get_msglevel = e1000_get_msglevel, .get_msglevel = e1000_get_msglevel,
.set_msglevel = e1000_set_msglevel, .set_msglevel = e1000_set_msglevel,
.nway_reset = e1000_nway_reset, .nway_reset = e1000_nway_reset,
.get_link = ethtool_op_get_link, .get_link = e1000_get_link,
.get_eeprom_len = e1000_get_eeprom_len, .get_eeprom_len = e1000_get_eeprom_len,
.get_eeprom = e1000_get_eeprom, .get_eeprom = e1000_get_eeprom,
.set_eeprom = e1000_set_eeprom, .set_eeprom = e1000_set_eeprom,
......
...@@ -852,7 +852,7 @@ struct e1000_hw { ...@@ -852,7 +852,7 @@ struct e1000_hw {
#ifdef DEBUG #ifdef DEBUG
#define hw_dbg(hw, format, arg...) \ #define hw_dbg(hw, format, arg...) \
printk(KERN_DEBUG, "%s: " format, e1000e_get_hw_dev_name(hw), ##arg); printk(KERN_DEBUG "%s: " format, e1000e_get_hw_dev_name(hw), ##arg)
#else #else
static inline int __attribute__ ((format (printf, 2, 3))) static inline int __attribute__ ((format (printf, 2, 3)))
hw_dbg(struct e1000_hw *hw, const char *format, ...) hw_dbg(struct e1000_hw *hw, const char *format, ...)
......
This diff is collapsed.
...@@ -1237,8 +1237,6 @@ static int gfar_change_mtu(struct net_device *dev, int new_mtu) ...@@ -1237,8 +1237,6 @@ static int gfar_change_mtu(struct net_device *dev, int new_mtu)
* starting over will fix the problem. */ * starting over will fix the problem. */
static void gfar_timeout(struct net_device *dev) static void gfar_timeout(struct net_device *dev)
{ {
struct gfar_private *priv = netdev_priv(dev);
dev->stats.tx_errors++; dev->stats.tx_errors++;
if (dev->flags & IFF_UP) { if (dev->flags & IFF_UP) {
...@@ -1344,8 +1342,9 @@ struct sk_buff * gfar_new_skb(struct net_device *dev, struct rxbd8 *bdp) ...@@ -1344,8 +1342,9 @@ struct sk_buff * gfar_new_skb(struct net_device *dev, struct rxbd8 *bdp)
return skb; return skb;
} }
static inline void count_errors(unsigned short status, struct gfar_private *priv) static inline void count_errors(unsigned short status, struct net_device *dev)
{ {
struct gfar_private *priv = netdev_priv(dev);
struct net_device_stats *stats = &dev->stats; struct net_device_stats *stats = &dev->stats;
struct gfar_extra_stats *estats = &priv->extra_stats; struct gfar_extra_stats *estats = &priv->extra_stats;
...@@ -1539,7 +1538,7 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit) ...@@ -1539,7 +1538,7 @@ int gfar_clean_rx_ring(struct net_device *dev, int rx_work_limit)
dev->stats.rx_bytes += pkt_len; dev->stats.rx_bytes += pkt_len;
} else { } else {
count_errors(bdp->status, priv); count_errors(bdp->status, dev);
if (skb) if (skb)
dev_kfree_skb_any(skb); dev_kfree_skb_any(skb);
......
...@@ -45,6 +45,8 @@ int __devinit mal_register_commac(struct mal_instance *mal, ...@@ -45,6 +45,8 @@ int __devinit mal_register_commac(struct mal_instance *mal,
return -EBUSY; return -EBUSY;
} }
if (list_empty(&mal->list))
napi_enable(&mal->napi);
mal->tx_chan_mask |= commac->tx_chan_mask; mal->tx_chan_mask |= commac->tx_chan_mask;
mal->rx_chan_mask |= commac->rx_chan_mask; mal->rx_chan_mask |= commac->rx_chan_mask;
list_add(&commac->list, &mal->list); list_add(&commac->list, &mal->list);
...@@ -67,6 +69,8 @@ void __devexit mal_unregister_commac(struct mal_instance *mal, ...@@ -67,6 +69,8 @@ void __devexit mal_unregister_commac(struct mal_instance *mal,
mal->tx_chan_mask &= ~commac->tx_chan_mask; mal->tx_chan_mask &= ~commac->tx_chan_mask;
mal->rx_chan_mask &= ~commac->rx_chan_mask; mal->rx_chan_mask &= ~commac->rx_chan_mask;
list_del_init(&commac->list); list_del_init(&commac->list);
if (list_empty(&mal->list))
napi_disable(&mal->napi);
spin_unlock_irqrestore(&mal->lock, flags); spin_unlock_irqrestore(&mal->lock, flags);
} }
...@@ -182,7 +186,7 @@ static inline void mal_enable_eob_irq(struct mal_instance *mal) ...@@ -182,7 +186,7 @@ static inline void mal_enable_eob_irq(struct mal_instance *mal)
set_mal_dcrn(mal, MAL_CFG, get_mal_dcrn(mal, MAL_CFG) | MAL_CFG_EOPIE); set_mal_dcrn(mal, MAL_CFG, get_mal_dcrn(mal, MAL_CFG) | MAL_CFG_EOPIE);
} }
/* synchronized by __LINK_STATE_RX_SCHED bit in ndev->state */ /* synchronized by NAPI state */
static inline void mal_disable_eob_irq(struct mal_instance *mal) static inline void mal_disable_eob_irq(struct mal_instance *mal)
{ {
// XXX might want to cache MAL_CFG as the DCR read can be slooooow // XXX might want to cache MAL_CFG as the DCR read can be slooooow
...@@ -317,8 +321,8 @@ void mal_poll_disable(struct mal_instance *mal, struct mal_commac *commac) ...@@ -317,8 +321,8 @@ void mal_poll_disable(struct mal_instance *mal, struct mal_commac *commac)
while (test_and_set_bit(MAL_COMMAC_POLL_DISABLED, &commac->flags)) while (test_and_set_bit(MAL_COMMAC_POLL_DISABLED, &commac->flags))
msleep(1); msleep(1);
/* Synchronize with the MAL NAPI poller. */ /* Synchronize with the MAL NAPI poller */
napi_disable(&mal->napi); __napi_synchronize(&mal->napi);
} }
void mal_poll_enable(struct mal_instance *mal, struct mal_commac *commac) void mal_poll_enable(struct mal_instance *mal, struct mal_commac *commac)
...@@ -326,7 +330,12 @@ void mal_poll_enable(struct mal_instance *mal, struct mal_commac *commac) ...@@ -326,7 +330,12 @@ void mal_poll_enable(struct mal_instance *mal, struct mal_commac *commac)
smp_wmb(); smp_wmb();
clear_bit(MAL_COMMAC_POLL_DISABLED, &commac->flags); clear_bit(MAL_COMMAC_POLL_DISABLED, &commac->flags);
// XXX might want to kick a poll now... /* Feels better to trigger a poll here to catch up with events that
* may have happened on this channel while disabled. It will most
* probably be delayed until the next interrupt but that's mostly a
* non-issue in the context where this is called.
*/
napi_schedule(&mal->napi);
} }
static int mal_poll(struct napi_struct *napi, int budget) static int mal_poll(struct napi_struct *napi, int budget)
...@@ -336,8 +345,7 @@ static int mal_poll(struct napi_struct *napi, int budget) ...@@ -336,8 +345,7 @@ static int mal_poll(struct napi_struct *napi, int budget)
int received = 0; int received = 0;
unsigned long flags; unsigned long flags;
MAL_DBG2(mal, "poll(%d) %d ->" NL, *budget, MAL_DBG2(mal, "poll(%d)" NL, budget);
rx_work_limit);
again: again:
/* Process TX skbs */ /* Process TX skbs */
list_for_each(l, &mal->poll_list) { list_for_each(l, &mal->poll_list) {
...@@ -528,11 +536,12 @@ static int __devinit mal_probe(struct of_device *ofdev, ...@@ -528,11 +536,12 @@ static int __devinit mal_probe(struct of_device *ofdev,
} }
INIT_LIST_HEAD(&mal->poll_list); INIT_LIST_HEAD(&mal->poll_list);
mal->napi.weight = CONFIG_IBM_NEW_EMAC_POLL_WEIGHT;
mal->napi.poll = mal_poll;
INIT_LIST_HEAD(&mal->list); INIT_LIST_HEAD(&mal->list);
spin_lock_init(&mal->lock); spin_lock_init(&mal->lock);
netif_napi_add(NULL, &mal->napi, mal_poll,
CONFIG_IBM_NEW_EMAC_POLL_WEIGHT);
/* Load power-on reset defaults */ /* Load power-on reset defaults */
mal_reset(mal); mal_reset(mal);
......
This diff is collapsed.
/* /*
* Definitions for the new Marvell Yukon / SysKonenct driver. * Definitions for the new Marvell Yukon / SysKonnect driver.
*/ */
#ifndef _SKGE_H #ifndef _SKGE_H
#define _SKGE_H #define _SKGE_H
...@@ -8,8 +8,10 @@ ...@@ -8,8 +8,10 @@
#define PCI_DEV_REG1 0x40 #define PCI_DEV_REG1 0x40
#define PCI_PHY_COMA 0x8000000 #define PCI_PHY_COMA 0x8000000
#define PCI_VIO 0x2000000 #define PCI_VIO 0x2000000
#define PCI_DEV_REG2 0x44 #define PCI_DEV_REG2 0x44
#define PCI_REV_DESC 0x4 #define PCI_VPD_ROM_SZ 7L<<14 /* VPD ROM size 0=256, 1=512, ... */
#define PCI_REV_DESC 1<<2 /* Reverse Descriptor bytes */
#define PCI_STATUS_ERROR_BITS (PCI_STATUS_DETECTED_PARITY | \ #define PCI_STATUS_ERROR_BITS (PCI_STATUS_DETECTED_PARITY | \
PCI_STATUS_SIG_SYSTEM_ERROR | \ PCI_STATUS_SIG_SYSTEM_ERROR | \
...@@ -2191,11 +2193,9 @@ enum { ...@@ -2191,11 +2193,9 @@ enum {
XM_IS_TXF_UR = 1<<2, /* Bit 2: Transmit FIFO Underrun */ XM_IS_TXF_UR = 1<<2, /* Bit 2: Transmit FIFO Underrun */
XM_IS_TX_COMP = 1<<1, /* Bit 1: Frame Tx Complete */ XM_IS_TX_COMP = 1<<1, /* Bit 1: Frame Tx Complete */
XM_IS_RX_COMP = 1<<0, /* Bit 0: Frame Rx Complete */ XM_IS_RX_COMP = 1<<0, /* Bit 0: Frame Rx Complete */
};
#define XM_DEF_MSK (~(XM_IS_INP_ASS | XM_IS_LIPA_RC | \
XM_IS_RXF_OV | XM_IS_TXF_UR))
XM_IMSK_DISABLE = 0xffff,
};
/* XM_HW_CFG 16 bit r/w Hardware Config Register */ /* XM_HW_CFG 16 bit r/w Hardware Config Register */
enum { enum {
...@@ -2469,8 +2469,9 @@ struct skge_port { ...@@ -2469,8 +2469,9 @@ struct skge_port {
void *mem; /* PCI memory for rings */ void *mem; /* PCI memory for rings */
dma_addr_t dma; dma_addr_t dma;
unsigned long mem_size; unsigned long mem_size;
#ifdef CONFIG_SKGE_DEBUG
struct net_device_stats net_stats; struct dentry *debugfs;
#endif
}; };
......
...@@ -760,7 +760,7 @@ static int xl_open_hw(struct net_device *dev) ...@@ -760,7 +760,7 @@ static int xl_open_hw(struct net_device *dev)
if (xl_priv->xl_laa[0]) { /* If using a LAA address */ if (xl_priv->xl_laa[0]) { /* If using a LAA address */
for (i=10;i<16;i++) { for (i=10;i<16;i++) {
writel( (MEM_BYTE_WRITE | 0xD0000 | xl_priv->srb) + i, xl_mmio + MMIO_MAC_ACCESS_CMD) ; writel( (MEM_BYTE_WRITE | 0xD0000 | xl_priv->srb) + i, xl_mmio + MMIO_MAC_ACCESS_CMD) ;
writeb(xl_priv->xl_laa[i],xl_mmio + MMIO_MACDATA) ; writeb(xl_priv->xl_laa[i-10],xl_mmio + MMIO_MACDATA) ;
} }
memcpy(dev->dev_addr,xl_priv->xl_laa,dev->addr_len) ; memcpy(dev->dev_addr,xl_priv->xl_laa,dev->addr_len) ;
} else { /* Regular hardware address */ } else { /* Regular hardware address */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment