Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 341849
b: refs/heads/master
c: 682d797
h: refs/heads/master
i:
  341847: 14827e1
v: v3
  • Loading branch information
David S. Miller committed Dec 3, 2012
1 parent 607b274 commit b894ae6
Show file tree
Hide file tree
Showing 26 changed files with 352 additions and 127 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9f9a12f8ca79839c948464a37c5b557808278708
refs/heads/master: 682d7978aee072f411fc747d32954a8371dd7b1b
8 changes: 8 additions & 0 deletions trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -11570,6 +11570,14 @@ static int bnx2x_init_dev(struct pci_dev *pdev,
goto err_out_disable;
}

pci_read_config_dword(pdev, PCICFG_REVISION_ID_OFFSET, &pci_cfg_dword);
if ((pci_cfg_dword & PCICFG_REVESION_ID_MASK) ==
PCICFG_REVESION_ID_ERROR_VAL) {
pr_err("PCI device error, probably due to fan failure, aborting\n");
rc = -ENODEV;
goto err_out_disable;
}

if (atomic_read(&pdev->enable_cnt) == 1) {
rc = pci_request_regions(pdev, DRV_MODULE_NAME);
if (rc) {
Expand Down
4 changes: 3 additions & 1 deletion trunk/drivers/net/ethernet/broadcom/bnx2x/bnx2x_reg.h
Original file line number Diff line number Diff line change
Expand Up @@ -6160,7 +6160,9 @@
#define PCICFG_COMMAND_INT_DISABLE (1<<10)
#define PCICFG_COMMAND_RESERVED (0x1f<<11)
#define PCICFG_STATUS_OFFSET 0x06
#define PCICFG_REVESION_ID_OFFSET 0x08
#define PCICFG_REVISION_ID_OFFSET 0x08
#define PCICFG_REVESION_ID_MASK 0xff
#define PCICFG_REVESION_ID_ERROR_VAL 0xff
#define PCICFG_CACHE_LINE_SIZE 0x0c
#define PCICFG_LATENCY_TIMER 0x0d
#define PCICFG_BAR_1_LOW 0x10
Expand Down
81 changes: 80 additions & 1 deletion trunk/drivers/net/ethernet/dlink/sundance.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ enum alta_offsets {
EECtrl = 0x36,
FlashAddr = 0x40,
FlashData = 0x44,
WakeEvent = 0x45,
TxStatus = 0x46,
TxFrameId = 0x47,
DownCounter = 0x18,
Expand Down Expand Up @@ -333,6 +334,14 @@ enum mac_ctrl1_bits {
RxEnable=0x0800, RxDisable=0x1000, RxEnabled=0x2000,
};

/* Bits in WakeEvent register. */
enum wake_event_bits {
WakePktEnable = 0x01,
MagicPktEnable = 0x02,
LinkEventEnable = 0x04,
WolEnable = 0x80,
};

/* The Rx and Tx buffer descriptors. */
/* Note that using only 32 bit fields simplifies conversion to big-endian
architectures. */
Expand Down Expand Up @@ -392,6 +401,7 @@ struct netdev_private {
unsigned int default_port:4; /* Last dev->if_port value. */
unsigned int an_enable:1;
unsigned int speed;
unsigned int wol_enabled:1; /* Wake on LAN enabled */
struct tasklet_struct rx_tasklet;
struct tasklet_struct tx_tasklet;
int budget;
Expand Down Expand Up @@ -829,7 +839,7 @@ static int netdev_open(struct net_device *dev)
unsigned long flags;
int i;

/* Do we need to reset the chip??? */
sundance_reset(dev, 0x00ff << 16);

i = request_irq(irq, intr_handler, IRQF_SHARED, dev->name, dev);
if (i)
Expand Down Expand Up @@ -877,6 +887,10 @@ static int netdev_open(struct net_device *dev)

iowrite16 (StatsEnable | RxEnable | TxEnable, ioaddr + MACCtrl1);

/* Disable Wol */
iowrite8(ioread8(ioaddr + WakeEvent) | 0x00, ioaddr + WakeEvent);
np->wol_enabled = 0;

if (netif_msg_ifup(np))
printk(KERN_DEBUG "%s: Done netdev_open(), status: Rx %x Tx %x "
"MAC Control %x, %4.4x %4.4x.\n",
Expand Down Expand Up @@ -1715,13 +1729,69 @@ static void get_ethtool_stats(struct net_device *dev,
data[i++] = np->xstats.rx_mcasts;
}

#ifdef CONFIG_PM

static void sundance_get_wol(struct net_device *dev,
struct ethtool_wolinfo *wol)
{
struct netdev_private *np = netdev_priv(dev);
void __iomem *ioaddr = np->base;
u8 wol_bits;

wol->wolopts = 0;

wol->supported = (WAKE_PHY | WAKE_MAGIC);
if (!np->wol_enabled)
return;

wol_bits = ioread8(ioaddr + WakeEvent);
if (wol_bits & MagicPktEnable)
wol->wolopts |= WAKE_MAGIC;
if (wol_bits & LinkEventEnable)
wol->wolopts |= WAKE_PHY;
}

static int sundance_set_wol(struct net_device *dev,
struct ethtool_wolinfo *wol)
{
struct netdev_private *np = netdev_priv(dev);
void __iomem *ioaddr = np->base;
u8 wol_bits;

if (!device_can_wakeup(&np->pci_dev->dev))
return -EOPNOTSUPP;

np->wol_enabled = !!(wol->wolopts);
wol_bits = ioread8(ioaddr + WakeEvent);
wol_bits &= ~(WakePktEnable | MagicPktEnable |
LinkEventEnable | WolEnable);

if (np->wol_enabled) {
if (wol->wolopts & WAKE_MAGIC)
wol_bits |= (MagicPktEnable | WolEnable);
if (wol->wolopts & WAKE_PHY)
wol_bits |= (LinkEventEnable | WolEnable);
}
iowrite8(wol_bits, ioaddr + WakeEvent);

device_set_wakeup_enable(&np->pci_dev->dev, np->wol_enabled);

return 0;
}
#else
#define sundance_get_wol NULL
#define sundance_set_wol NULL
#endif /* CONFIG_PM */

static const struct ethtool_ops ethtool_ops = {
.begin = check_if_running,
.get_drvinfo = get_drvinfo,
.get_settings = get_settings,
.set_settings = set_settings,
.nway_reset = nway_reset,
.get_link = get_link,
.get_wol = sundance_get_wol,
.set_wol = sundance_set_wol,
.get_msglevel = get_msglevel,
.set_msglevel = set_msglevel,
.get_strings = get_strings,
Expand Down Expand Up @@ -1867,6 +1937,8 @@ static void sundance_remove1(struct pci_dev *pdev)
static int sundance_suspend(struct pci_dev *pci_dev, pm_message_t state)
{
struct net_device *dev = pci_get_drvdata(pci_dev);
struct netdev_private *np = netdev_priv(dev);
void __iomem *ioaddr = np->base;

if (!netif_running(dev))
return 0;
Expand All @@ -1875,6 +1947,12 @@ static int sundance_suspend(struct pci_dev *pci_dev, pm_message_t state)
netif_device_detach(dev);

pci_save_state(pci_dev);
if (np->wol_enabled) {
iowrite8(AcceptBroadcast | AcceptMyPhys, ioaddr + RxMode);
iowrite16(RxEnable, ioaddr + MACCtrl1);
}
pci_enable_wake(pci_dev, pci_choose_state(pci_dev, state),
np->wol_enabled);
pci_set_power_state(pci_dev, pci_choose_state(pci_dev, state));

return 0;
Expand All @@ -1890,6 +1968,7 @@ static int sundance_resume(struct pci_dev *pci_dev)

pci_set_power_state(pci_dev, PCI_D0);
pci_restore_state(pci_dev);
pci_enable_wake(pci_dev, PCI_D0, 0);

err = netdev_open(dev);
if (err) {
Expand Down
15 changes: 8 additions & 7 deletions trunk/drivers/net/ethernet/marvell/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -4919,13 +4919,13 @@ static int sky2_probe(struct pci_dev *pdev,
err = pci_read_config_dword(pdev, PCI_DEV_REG2, &reg);
if (err) {
dev_err(&pdev->dev, "PCI read config failed\n");
goto err_out;
goto err_out_disable;
}

if (~reg == 0) {
dev_err(&pdev->dev, "PCI configuration read error\n");
err = -EIO;
goto err_out;
goto err_out_disable;
}

err = pci_request_regions(pdev, DRV_NAME);
Expand Down Expand Up @@ -5012,10 +5012,11 @@ static int sky2_probe(struct pci_dev *pdev,

if (!disable_msi && pci_enable_msi(pdev) == 0) {
err = sky2_test_msi(hw);
if (err == -EOPNOTSUPP)
if (err) {
pci_disable_msi(pdev);
else if (err)
goto err_out_free_netdev;
if (err != -EOPNOTSUPP)
goto err_out_free_netdev;
}
}

err = register_netdev(dev);
Expand Down Expand Up @@ -5063,10 +5064,10 @@ static int sky2_probe(struct pci_dev *pdev,
err_out_free_dev1:
free_netdev(dev1);
err_out_unregister:
if (hw->flags & SKY2_HW_USE_MSI)
pci_disable_msi(pdev);
unregister_netdev(dev);
err_out_free_netdev:
if (hw->flags & SKY2_HW_USE_MSI)
pci_disable_msi(pdev);
free_netdev(dev);
err_out_free_pci:
pci_free_consistent(pdev, hw->st_size * sizeof(struct sky2_status_le),
Expand Down
23 changes: 4 additions & 19 deletions trunk/drivers/net/ethernet/realtek/8139cp.c
Original file line number Diff line number Diff line change
Expand Up @@ -1226,12 +1226,9 @@ static void cp_tx_timeout(struct net_device *dev)
spin_unlock_irqrestore(&cp->lock, flags);
}

#ifdef BROKEN
static int cp_change_mtu(struct net_device *dev, int new_mtu)
{
struct cp_private *cp = netdev_priv(dev);
int rc;
unsigned long flags;

/* check for invalid MTU, according to hardware limits */
if (new_mtu < CP_MIN_MTU || new_mtu > CP_MAX_MTU)
Expand All @@ -1244,22 +1241,12 @@ static int cp_change_mtu(struct net_device *dev, int new_mtu)
return 0;
}

spin_lock_irqsave(&cp->lock, flags);

cp_stop_hw(cp); /* stop h/w and free rings */
cp_clean_rings(cp);

/* network IS up, close it, reset MTU, and come up again. */
cp_close(dev);
dev->mtu = new_mtu;
cp_set_rxbufsize(cp); /* set new rx buf size */

rc = cp_init_rings(cp); /* realloc and restart h/w */
cp_start_hw(cp);

spin_unlock_irqrestore(&cp->lock, flags);

return rc;
cp_set_rxbufsize(cp);
return cp_open(dev);
}
#endif /* BROKEN */

static const char mii_2_8139_map[8] = {
BasicModeCtrl,
Expand Down Expand Up @@ -1835,9 +1822,7 @@ static const struct net_device_ops cp_netdev_ops = {
.ndo_start_xmit = cp_start_xmit,
.ndo_tx_timeout = cp_tx_timeout,
.ndo_set_features = cp_set_features,
#ifdef BROKEN
.ndo_change_mtu = cp_change_mtu,
#endif

#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = cp_poll_controller,
Expand Down
2 changes: 0 additions & 2 deletions trunk/drivers/net/ethernet/stmicro/stmmac/dwmac_dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@
#define DMA_STATUS_GPI 0x10000000 /* PMT interrupt */
#define DMA_STATUS_GMI 0x08000000 /* MMC interrupt */
#define DMA_STATUS_GLI 0x04000000 /* GMAC Line interface int */
#define DMA_STATUS_GMI 0x08000000
#define DMA_STATUS_GLI 0x04000000
#define DMA_STATUS_EB_MASK 0x00380000 /* Error Bits Mask */
#define DMA_STATUS_EB_TX_ABORT 0x00080000 /* Error Bits - TX Abort */
#define DMA_STATUS_EB_RX_ABORT 0x00100000 /* Error Bits - RX Abort */
Expand Down
73 changes: 27 additions & 46 deletions trunk/drivers/net/irda/ep7211-sir.c
Original file line number Diff line number Diff line change
@@ -1,52 +1,18 @@
/*
* IR port driver for the Cirrus Logic EP7211 processor.
* IR port driver for the Cirrus Logic CLPS711X processors
*
* Copyright 2001, Blue Mug Inc. All rights reserved.
* Copyright 2007, Samuel Ortiz <samuel@sortiz.org>
*/
#include <linux/module.h>
#include <linux/delay.h>
#include <linux/tty.h>
#include <linux/init.h>
#include <linux/spinlock.h>

#include <net/irda/irda.h>
#include <net/irda/irda_device.h>
#include <linux/module.h>
#include <linux/platform_device.h>

#include <asm/io.h>
#include <mach/hardware.h>

#include "sir-dev.h"

#define MIN_DELAY 25 /* 15 us, but wait a little more to be sure */
#define MAX_DELAY 10000 /* 1 ms */

static int ep7211_open(struct sir_dev *dev);
static int ep7211_close(struct sir_dev *dev);
static int ep7211_change_speed(struct sir_dev *dev, unsigned speed);
static int ep7211_reset(struct sir_dev *dev);

static struct dongle_driver ep7211 = {
.owner = THIS_MODULE,
.driver_name = "EP7211 IR driver",
.type = IRDA_EP7211_DONGLE,
.open = ep7211_open,
.close = ep7211_close,
.reset = ep7211_reset,
.set_speed = ep7211_change_speed,
};

static int __init ep7211_sir_init(void)
{
return irda_register_dongle(&ep7211);
}

static void __exit ep7211_sir_cleanup(void)
{
irda_unregister_dongle(&ep7211);
}

static int ep7211_open(struct sir_dev *dev)
static int clps711x_dongle_open(struct sir_dev *dev)
{
unsigned int syscon;

Expand All @@ -58,7 +24,7 @@ static int ep7211_open(struct sir_dev *dev)
return 0;
}

static int ep7211_close(struct sir_dev *dev)
static int clps711x_dongle_close(struct sir_dev *dev)
{
unsigned int syscon;

Expand All @@ -70,20 +36,35 @@ static int ep7211_close(struct sir_dev *dev)
return 0;
}

static int ep7211_change_speed(struct sir_dev *dev, unsigned speed)
static struct dongle_driver clps711x_dongle = {
.owner = THIS_MODULE,
.driver_name = "EP7211 IR driver",
.type = IRDA_EP7211_DONGLE,
.open = clps711x_dongle_open,
.close = clps711x_dongle_close,
};

static int clps711x_sir_probe(struct platform_device *pdev)
{
return 0;
return irda_register_dongle(&clps711x_dongle);
}

static int ep7211_reset(struct sir_dev *dev)
static int clps711x_sir_remove(struct platform_device *pdev)
{
return 0;
return irda_unregister_dongle(&clps711x_dongle);
}

static struct platform_driver clps711x_sir_driver = {
.driver = {
.name = "sir-clps711x",
.owner = THIS_MODULE,
},
.probe = clps711x_sir_probe,
.remove = clps711x_sir_remove,
};
module_platform_driver(clps711x_sir_driver);

MODULE_AUTHOR("Samuel Ortiz <samuel@sortiz.org>");
MODULE_DESCRIPTION("EP7211 IR dongle driver");
MODULE_LICENSE("GPL");
MODULE_ALIAS("irda-dongle-13"); /* IRDA_EP7211_DONGLE */

module_init(ep7211_sir_init);
module_exit(ep7211_sir_cleanup);
Loading

0 comments on commit b894ae6

Please sign in to comment.