Skip to content

Commit

Permalink
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Browse files Browse the repository at this point in the history
* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  sunrpc: fix rdma dependencies
  e1000: Fix PCI enable to honor the need_ioport flag
  sgi-xp: link XPNET's net_device_ops to its net_device structure
  pcnet_cs: Fix misuse of the equality operator.
  hso: add new device id's
  dca: redesign locks to fix deadlocks
  cassini/sungem: limit reaches -1, but 0 tested
  net: variables reach -1, but 0 tested
  qlge: bugfix: Add missing netif_napi_del call.
  qlge: bugfix: Add flash offset for second port.
  qlge: bugfix: Fix endian issue when reading flash.
  udp: increments sk_drops in __udp_queue_rcv_skb()
  net: Fix userland breakage wrt. linux/if_tunnel.h
  net: packet socket packet_lookup_frame fix
  • Loading branch information
Linus Torvalds committed Feb 4, 2009
2 parents 0d7a063 + 55128bc commit 25431e9
Show file tree
Hide file tree
Showing 21 changed files with 93 additions and 57 deletions.
51 changes: 33 additions & 18 deletions drivers/dca/dca-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include <linux/device.h>
#include <linux/dca.h>

#define DCA_VERSION "1.4"
#define DCA_VERSION "1.8"

MODULE_VERSION(DCA_VERSION);
MODULE_LICENSE("GPL");
Expand Down Expand Up @@ -60,16 +60,17 @@ int dca_add_requester(struct device *dev)
{
struct dca_provider *dca;
int err, slot = -ENODEV;
unsigned long flags;

if (!dev)
return -EFAULT;

spin_lock(&dca_lock);
spin_lock_irqsave(&dca_lock, flags);

/* check if the requester has not been added already */
dca = dca_find_provider_by_dev(dev);
if (dca) {
spin_unlock(&dca_lock);
spin_unlock_irqrestore(&dca_lock, flags);
return -EEXIST;
}

Expand All @@ -78,19 +79,21 @@ int dca_add_requester(struct device *dev)
if (slot >= 0)
break;
}
if (slot < 0) {
spin_unlock(&dca_lock);

spin_unlock_irqrestore(&dca_lock, flags);

if (slot < 0)
return slot;
}

err = dca_sysfs_add_req(dca, dev, slot);
if (err) {
dca->ops->remove_requester(dca, dev);
spin_unlock(&dca_lock);
spin_lock_irqsave(&dca_lock, flags);
if (dca == dca_find_provider_by_dev(dev))
dca->ops->remove_requester(dca, dev);
spin_unlock_irqrestore(&dca_lock, flags);
return err;
}

spin_unlock(&dca_lock);
return 0;
}
EXPORT_SYMBOL_GPL(dca_add_requester);
Expand All @@ -103,25 +106,25 @@ int dca_remove_requester(struct device *dev)
{
struct dca_provider *dca;
int slot;
unsigned long flags;

if (!dev)
return -EFAULT;

spin_lock(&dca_lock);
spin_lock_irqsave(&dca_lock, flags);
dca = dca_find_provider_by_dev(dev);
if (!dca) {
spin_unlock(&dca_lock);
spin_unlock_irqrestore(&dca_lock, flags);
return -ENODEV;
}
slot = dca->ops->remove_requester(dca, dev);
if (slot < 0) {
spin_unlock(&dca_lock);
spin_unlock_irqrestore(&dca_lock, flags);

if (slot < 0)
return slot;
}

dca_sysfs_remove_req(dca, slot);

spin_unlock(&dca_lock);
return 0;
}
EXPORT_SYMBOL_GPL(dca_remove_requester);
Expand All @@ -135,17 +138,18 @@ u8 dca_common_get_tag(struct device *dev, int cpu)
{
struct dca_provider *dca;
u8 tag;
unsigned long flags;

spin_lock(&dca_lock);
spin_lock_irqsave(&dca_lock, flags);

dca = dca_find_provider_by_dev(dev);
if (!dca) {
spin_unlock(&dca_lock);
spin_unlock_irqrestore(&dca_lock, flags);
return -ENODEV;
}
tag = dca->ops->get_tag(dca, dev, cpu);

spin_unlock(&dca_lock);
spin_unlock_irqrestore(&dca_lock, flags);
return tag;
}

Expand Down Expand Up @@ -217,11 +221,16 @@ static BLOCKING_NOTIFIER_HEAD(dca_provider_chain);
int register_dca_provider(struct dca_provider *dca, struct device *dev)
{
int err;
unsigned long flags;

err = dca_sysfs_add_provider(dca, dev);
if (err)
return err;

spin_lock_irqsave(&dca_lock, flags);
list_add(&dca->node, &dca_providers);
spin_unlock_irqrestore(&dca_lock, flags);

blocking_notifier_call_chain(&dca_provider_chain,
DCA_PROVIDER_ADD, NULL);
return 0;
Expand All @@ -234,9 +243,15 @@ EXPORT_SYMBOL_GPL(register_dca_provider);
*/
void unregister_dca_provider(struct dca_provider *dca)
{
unsigned long flags;

blocking_notifier_call_chain(&dca_provider_chain,
DCA_PROVIDER_REMOVE, NULL);

spin_lock_irqsave(&dca_lock, flags);
list_del(&dca->node);
spin_unlock_irqrestore(&dca_lock, flags);

dca_sysfs_remove_provider(dca);
}
EXPORT_SYMBOL_GPL(unregister_dca_provider);
Expand Down
3 changes: 2 additions & 1 deletion drivers/misc/sgi-xp/xpnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* License. See the file "COPYING" in the main directory of this archive
* for more details.
*
* Copyright (C) 1999-2008 Silicon Graphics, Inc. All rights reserved.
* Copyright (C) 1999-2009 Silicon Graphics, Inc. All rights reserved.
*/

/*
Expand Down Expand Up @@ -551,6 +551,7 @@ xpnet_init(void)

netif_carrier_off(xpnet_device);

xpnet_device->netdev_ops = &xpnet_netdev_ops;
xpnet_device->mtu = XPNET_DEF_MTU;

/*
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/cassini.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ static int cas_reset_mii_phy(struct cas *cp)

cas_phy_write(cp, MII_BMCR, BMCR_RESET);
udelay(100);
while (limit--) {
while (--limit) {
val = cas_phy_read(cp, MII_BMCR);
if ((val & BMCR_RESET) == 0)
break;
Expand Down Expand Up @@ -979,7 +979,7 @@ static void cas_phy_init(struct cas *cp)
writel(val, cp->regs + REG_PCS_MII_CTRL);

limit = STOP_TRIES;
while (limit-- > 0) {
while (--limit > 0) {
udelay(10);
if ((readl(cp->regs + REG_PCS_MII_CTRL) &
PCS_MII_RESET) == 0)
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/e1000/e1000_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ static int __devinit e1000_probe(struct pci_dev *pdev,
err = pci_enable_device(pdev);
} else {
bars = pci_select_bars(pdev, IORESOURCE_MEM);
err = pci_enable_device(pdev);
err = pci_enable_device_mem(pdev);
}
if (err)
return err;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ibm_newemac/phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ int emac_mii_reset_phy(struct mii_phy *phy)

udelay(300);

while (limit--) {
while (--limit) {
val = phy_read(phy, MII_BMCR);
if (val >= 0 && (val & BMCR_RESET) == 0)
break;
Expand All @@ -84,7 +84,7 @@ int emac_mii_reset_gpcs(struct mii_phy *phy)

udelay(300);

while (limit--) {
while (--limit) {
val = gpcs_phy_read(phy, MII_BMCR);
if (val >= 0 && (val & BMCR_RESET) == 0)
break;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/pcmcia/pcnet_cs.c
Original file line number Diff line number Diff line change
Expand Up @@ -586,7 +586,7 @@ static int pcnet_config(struct pcmcia_device *link)
}

if ((link->conf.ConfigBase == 0x03c0)
&& (link->manf_id == 0x149) && (link->card_id = 0xc1ab)) {
&& (link->manf_id == 0x149) && (link->card_id == 0xc1ab)) {
printk(KERN_INFO "pcnet_cs: this is an AX88190 card!\n");
printk(KERN_INFO "pcnet_cs: use axnet_cs instead.\n");
goto failed;
Expand Down
10 changes: 5 additions & 5 deletions drivers/net/qlge/qlge.h
Original file line number Diff line number Diff line change
Expand Up @@ -787,12 +787,12 @@ struct mbox_params {

struct flash_params {
u8 dev_id_str[4];
u16 size;
u16 csum;
u16 ver;
u16 sub_dev_id;
__le16 size;
__le16 csum;
__le16 ver;
__le16 sub_dev_id;
u8 mac_addr[6];
u16 res;
__le16 res;
};


Expand Down
25 changes: 19 additions & 6 deletions drivers/net/qlge/qlge_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -641,7 +641,7 @@ static void ql_enable_all_completion_interrupts(struct ql_adapter *qdev)

}

static int ql_read_flash_word(struct ql_adapter *qdev, int offset, u32 *data)
static int ql_read_flash_word(struct ql_adapter *qdev, int offset, __le32 *data)
{
int status = 0;
/* wait for reg to come ready */
Expand All @@ -656,8 +656,11 @@ static int ql_read_flash_word(struct ql_adapter *qdev, int offset, u32 *data)
FLASH_ADDR, FLASH_ADDR_RDY, FLASH_ADDR_ERR);
if (status)
goto exit;
/* get the data */
*data = ql_read32(qdev, FLASH_DATA);
/* This data is stored on flash as an array of
* __le32. Since ql_read32() returns cpu endian
* we need to swap it back.
*/
*data = cpu_to_le32(ql_read32(qdev, FLASH_DATA));
exit:
return status;
}
Expand All @@ -666,13 +669,20 @@ static int ql_get_flash_params(struct ql_adapter *qdev)
{
int i;
int status;
u32 *p = (u32 *)&qdev->flash;
__le32 *p = (__le32 *)&qdev->flash;
u32 offset = 0;

/* Second function's parameters follow the first
* function's.
*/
if (qdev->func)
offset = sizeof(qdev->flash) / sizeof(u32);

if (ql_sem_spinlock(qdev, SEM_FLASH_MASK))
return -ETIMEDOUT;

for (i = 0; i < sizeof(qdev->flash) / sizeof(u32); i++, p++) {
status = ql_read_flash_word(qdev, i, p);
status = ql_read_flash_word(qdev, i+offset, p);
if (status) {
QPRINTK(qdev, IFUP, ERR, "Error reading flash.\n");
goto exit;
Expand Down Expand Up @@ -3826,7 +3836,7 @@ static int qlge_suspend(struct pci_dev *pdev, pm_message_t state)
{
struct net_device *ndev = pci_get_drvdata(pdev);
struct ql_adapter *qdev = netdev_priv(ndev);
int err;
int err, i;

netif_device_detach(ndev);

Expand All @@ -3836,6 +3846,9 @@ static int qlge_suspend(struct pci_dev *pdev, pm_message_t state)
return err;
}

for (i = qdev->rss_ring_first_cq_id; i < qdev->rx_ring_count; i++)
netif_napi_del(&qdev->rx_ring[i].napi);

err = pci_save_state(pdev);
if (err)
return err;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/smc911x.c
Original file line number Diff line number Diff line change
Expand Up @@ -220,9 +220,9 @@ static void smc911x_reset(struct net_device *dev)

/* make sure EEPROM has finished loading before setting GPIO_CFG */
timeout=1000;
while ( timeout-- && (SMC_GET_E2P_CMD(lp) & E2P_CMD_EPC_BUSY_)) {
while (--timeout && (SMC_GET_E2P_CMD(lp) & E2P_CMD_EPC_BUSY_))
udelay(10);
}

if (timeout == 0){
PRINTK("%s: smc911x_reset timeout waiting for EEPROM busy\n", dev->name);
return;
Expand Down
12 changes: 6 additions & 6 deletions drivers/net/smsc9420.c
Original file line number Diff line number Diff line change
Expand Up @@ -498,21 +498,21 @@ static void smsc9420_check_mac_address(struct net_device *dev)
static void smsc9420_stop_tx(struct smsc9420_pdata *pd)
{
u32 dmac_control, mac_cr, dma_intr_ena;
int timeOut = 1000;
int timeout = 1000;

/* disable TX DMAC */
dmac_control = smsc9420_reg_read(pd, DMAC_CONTROL);
dmac_control &= (~DMAC_CONTROL_ST_);
smsc9420_reg_write(pd, DMAC_CONTROL, dmac_control);

/* Wait max 10ms for transmit process to stop */
while (timeOut--) {
while (--timeout) {
if (smsc9420_reg_read(pd, DMAC_STATUS) & DMAC_STS_TS_)
break;
udelay(10);
}

if (!timeOut)
if (!timeout)
smsc_warn(IFDOWN, "TX DMAC failed to stop");

/* ACK Tx DMAC stop bit */
Expand Down Expand Up @@ -596,7 +596,7 @@ static void smsc9420_free_rx_ring(struct smsc9420_pdata *pd)

static void smsc9420_stop_rx(struct smsc9420_pdata *pd)
{
int timeOut = 1000;
int timeout = 1000;
u32 mac_cr, dmac_control, dma_intr_ena;

/* mask RX DMAC interrupts */
Expand All @@ -617,13 +617,13 @@ static void smsc9420_stop_rx(struct smsc9420_pdata *pd)
smsc9420_pci_flush_write(pd);

/* wait up to 10ms for receive to stop */
while (timeOut--) {
while (--timeout) {
if (smsc9420_reg_read(pd, DMAC_STATUS) & DMAC_STS_RS_)
break;
udelay(10);
}

if (!timeOut)
if (!timeout)
smsc_warn(IFDOWN, "RX DMAC did not stop! timeout.");

/* ACK the Rx DMAC stop bit */
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/sungem.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ static u16 __phy_read(struct gem *gp, int phy_addr, int reg)
cmd |= (MIF_FRAME_TAMSB);
writel(cmd, gp->regs + MIF_FRAME);

while (limit--) {
while (--limit) {
cmd = readl(gp->regs + MIF_FRAME);
if (cmd & MIF_FRAME_TALSB)
break;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/sungem_phy.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static int reset_one_mii_phy(struct mii_phy* phy, int phy_id)

udelay(100);

while (limit--) {
while (--limit) {
val = __phy_read(phy, phy_id, MII_BMCR);
if ((val & BMCR_RESET) == 0)
break;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/sunqe.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ static int qe_init(struct sunqe *qep, int from_irq)
if (!(sbus_readb(mregs + MREGS_PHYCONFIG) & MREGS_PHYCONFIG_LTESTDIS)) {
int tries = 50;

while (tries--) {
while (--tries) {
u8 tmp;

mdelay(5);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/tsi108_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1237,7 +1237,7 @@ static void tsi108_init_phy(struct net_device *dev)
spin_lock_irqsave(&phy_lock, flags);

tsi108_write_mii(data, MII_BMCR, BMCR_RESET);
while (i--){
while (--i) {
if(!(tsi108_read_mii(data, MII_BMCR) & BMCR_RESET))
break;
udelay(10);
Expand Down
Loading

0 comments on commit 25431e9

Please sign in to comment.