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: (42 commits)
  net: Fix routing tables with id > 255 for legacy software
  sky2: Hold RTNL while calling dev_close()
  s2io iomem annotations
  atl1: fix suspend regression
  qeth: start dev queue after tx drop error
  qeth: Prepare-function to call s390dbf was wrong
  qeth: reduce number of kernel messages
  qeth: Use ccw_device_get_id().
  qeth: layer 3 Oops in ip event handler
  virtio: use callback on empty in virtio_net
  virtio: virtio_net free transmit skbs in a timer
  virtio: Fix typo in virtio_net_hdr comments
  virtio_net: Fix skb->csum_start computation
  ehea: set mac address fix
  sfc: Recover from RX queue flush failure
  add missing lance_* exports
  ixgbe: fix typo
  forcedeth: msi interrupts
  ipsec: pfkey should ignore events when no listeners
  pppoe: Unshare skb before anything else
  ...
  • Loading branch information
Linus Torvalds committed Jun 11, 2008
2 parents 7427d8b + 513fd37 commit f7f866e
Show file tree
Hide file tree
Showing 47 changed files with 361 additions and 366 deletions.
1 change: 0 additions & 1 deletion drivers/atm/eni.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "midway.h"


#define KERNEL_OFFSET 0xC0000000 /* kernel 0x0 is at phys 0xC0000000 */
#define DEV_LABEL "eni"

#define UBR_BUFFER (128*1024) /* UBR buffer size */
Expand Down
1 change: 0 additions & 1 deletion drivers/isdn/hardware/eicon/divasmain.c
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,6 @@ static int DIVA_INIT_FUNCTION divas_init(void)

if (!create_divas_proc()) {
#ifdef MODULE
remove_divas_proc();
divas_unregister_chrdev();
divasfunc_exit();
#endif
Expand Down
4 changes: 2 additions & 2 deletions drivers/isdn/hardware/eicon/divasproc.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,8 +125,8 @@ static const struct file_operations divas_fops = {

int create_divas_proc(void)
{
proc_create(divas_proc_name, S_IFREG | S_IRUGO, proc_net_eicon,
&divas_fops);
divas_proc_entry = proc_create(divas_proc_name, S_IFREG | S_IRUGO,
proc_net_eicon, &divas_fops);
if (!divas_proc_entry)
return (0);

Expand Down
29 changes: 8 additions & 21 deletions drivers/isdn/hysdn/hysdn_procconf.c
Original file line number Diff line number Diff line change
Expand Up @@ -207,30 +207,17 @@ hysdn_conf_write(struct file *file, const char __user *buf, size_t count, loff_t
/* read conf file -> output card info data */
/*******************************************/
static ssize_t
hysdn_conf_read(struct file *file, char __user *buf, size_t count, loff_t * off)
hysdn_conf_read(struct file *file, char __user *buf, size_t count, loff_t *off)
{
char *cp;
int i;

if (file->f_mode & FMODE_READ) {
if (!(cp = file->private_data))
return (-EFAULT); /* should never happen */
i = strlen(cp); /* get total string length */
if (*off < i) {
/* still bytes to transfer */
cp += *off; /* point to desired data offset */
i -= *off; /* remaining length */
if (i > count)
i = count; /* limit length to transfer */
if (copy_to_user(buf, cp, i))
return (-EFAULT); /* copy error */
*off += i; /* adjust offset */
} else
return (0);
} else
return (-EPERM); /* no permission to read */

return (i);
if (!(file->f_mode & FMODE_READ))
return -EPERM; /* no permission to read */

if (!(cp = file->private_data))
return -EFAULT; /* should never happen */

return simple_read_from_buffer(buf, count, off, cp, strlen(cp));
} /* hysdn_conf_read */

/******************/
Expand Down
6 changes: 5 additions & 1 deletion drivers/net/7990.c
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,7 @@ int lance_open (struct net_device *dev)

return res;
}
EXPORT_SYMBOL_GPL(lance_open);

int lance_close (struct net_device *dev)
{
Expand All @@ -521,6 +522,7 @@ int lance_close (struct net_device *dev)

return 0;
}
EXPORT_SYMBOL_GPL(lance_close);

void lance_tx_timeout(struct net_device *dev)
{
Expand All @@ -529,7 +531,7 @@ void lance_tx_timeout(struct net_device *dev)
dev->trans_start = jiffies;
netif_wake_queue (dev);
}

EXPORT_SYMBOL_GPL(lance_tx_timeout);

int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)
{
Expand Down Expand Up @@ -586,6 +588,7 @@ int lance_start_xmit (struct sk_buff *skb, struct net_device *dev)

return 0;
}
EXPORT_SYMBOL_GPL(lance_start_xmit);

/* taken from the depca driver via a2065.c */
static void lance_load_multicast (struct net_device *dev)
Expand Down Expand Up @@ -654,6 +657,7 @@ void lance_set_multicast (struct net_device *dev)
if (!stopped)
netif_start_queue (dev);
}
EXPORT_SYMBOL_GPL(lance_set_multicast);

#ifdef CONFIG_NET_POLL_CONTROLLER
void lance_poll(struct net_device *dev)
Expand Down
17 changes: 0 additions & 17 deletions drivers/net/atlx/atl1.c
Original file line number Diff line number Diff line change
Expand Up @@ -636,22 +636,6 @@ static s32 atl1_phy_leave_power_saving(struct atl1_hw *hw)
return atl1_write_phy_reg(hw, 30, 0);
}

/*
* Force the PHY into power saving mode using vendor magic.
*/
#ifdef CONFIG_PM
static void atl1_phy_enter_power_saving(struct atl1_hw *hw)
{
atl1_write_phy_reg(hw, MII_DBG_ADDR, 0);
atl1_write_phy_reg(hw, MII_DBG_DATA, 0x124E);
atl1_write_phy_reg(hw, MII_DBG_ADDR, 2);
atl1_write_phy_reg(hw, MII_DBG_DATA, 0x3000);
atl1_write_phy_reg(hw, MII_DBG_ADDR, 3);
atl1_write_phy_reg(hw, MII_DBG_DATA, 0);

}
#endif

/*
* Resets the PHY and make all config validate
* hw - Struct containing variables accessed by shared code
Expand Down Expand Up @@ -2860,7 +2844,6 @@ static int atl1_suspend(struct pci_dev *pdev, pm_message_t state)
ctrl |= PCIE_PHYMISC_FORCE_RCV_DET;
iowrite32(ctrl, hw->hw_addr + REG_PCIE_PHYMISC);
ioread32(hw->hw_addr + REG_PCIE_PHYMISC);
atl1_phy_enter_power_saving(hw);
hw->phy_configured = false;
pci_enable_wake(pdev, pci_choose_state(pdev, state), 0);
exit:
Expand Down
16 changes: 10 additions & 6 deletions drivers/net/ehea/ehea_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1766,16 +1766,20 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa)
mutex_lock(&ehea_bcmc_regs.lock);

/* Deregister old MAC in pHYP */
ret = ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
if (ret)
goto out_upregs;
if (port->state == EHEA_PORT_UP) {
ret = ehea_broadcast_reg_helper(port, H_DEREG_BCMC);
if (ret)
goto out_upregs;
}

port->mac_addr = cb0->port_mac_addr << 16;

/* Register new MAC in pHYP */
ret = ehea_broadcast_reg_helper(port, H_REG_BCMC);
if (ret)
goto out_upregs;
if (port->state == EHEA_PORT_UP) {
ret = ehea_broadcast_reg_helper(port, H_REG_BCMC);
if (ret)
goto out_upregs;
}

ret = 0;

Expand Down
20 changes: 20 additions & 0 deletions drivers/net/forcedeth.c
Original file line number Diff line number Diff line change
Expand Up @@ -3273,6 +3273,20 @@ static void nv_link_irq(struct net_device *dev)
dprintk(KERN_DEBUG "%s: link change notification done.\n", dev->name);
}

static void nv_msi_workaround(struct fe_priv *np)
{

/* Need to toggle the msi irq mask within the ethernet device,
* otherwise, future interrupts will not be detected.
*/
if (np->msi_flags & NV_MSI_ENABLED) {
u8 __iomem *base = np->base;

writel(0, base + NvRegMSIIrqMask);
writel(NVREG_MSI_VECTOR_0_ENABLED, base + NvRegMSIIrqMask);
}
}

static irqreturn_t nv_nic_irq(int foo, void *data)
{
struct net_device *dev = (struct net_device *) data;
Expand All @@ -3295,6 +3309,8 @@ static irqreturn_t nv_nic_irq(int foo, void *data)
if (!(events & np->irqmask))
break;

nv_msi_workaround(np);

spin_lock(&np->lock);
nv_tx_done(dev);
spin_unlock(&np->lock);
Expand Down Expand Up @@ -3410,6 +3426,8 @@ static irqreturn_t nv_nic_irq_optimized(int foo, void *data)
if (!(events & np->irqmask))
break;

nv_msi_workaround(np);

spin_lock(&np->lock);
nv_tx_done_optimized(dev, TX_WORK_PER_LOOP);
spin_unlock(&np->lock);
Expand Down Expand Up @@ -3750,6 +3768,8 @@ static irqreturn_t nv_nic_irq_test(int foo, void *data)
if (!(events & NVREG_IRQ_TIMER))
return IRQ_RETVAL(0);

nv_msi_workaround(np);

spin_lock(&np->lock);
np->intr_test = 1;
spin_unlock(&np->lock);
Expand Down
1 change: 1 addition & 0 deletions drivers/net/irda/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ config PXA_FICP
config MCS_FIR
tristate "MosChip MCS7780 IrDA-USB dongle"
depends on IRDA && USB && EXPERIMENTAL
select CRC32
help
Say Y or M here if you want to build support for the MosChip
MCS7780 IrDA-USB bridge device driver.
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ixgbe/ixgbe_82598.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ static s32 ixgbe_reset_hw_82598(struct ixgbe_hw *hw);

static s32 ixgbe_get_invariants_82598(struct ixgbe_hw *hw)
{
hw->mac.num_rx_queues = IXGBE_82598_MAX_TX_QUEUES;
hw->mac.num_tx_queues = IXGBE_82598_MAX_RX_QUEUES;
hw->mac.num_rx_queues = IXGBE_82598_MAX_RX_QUEUES;
hw->mac.num_tx_queues = IXGBE_82598_MAX_TX_QUEUES;
hw->mac.num_rx_addrs = IXGBE_82598_RAR_ENTRIES;

/* PHY ops are filled in by default properly for Fiber only */
Expand Down
37 changes: 20 additions & 17 deletions drivers/net/pppoe.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,12 +341,6 @@ static int pppoe_rcv_core(struct sock *sk, struct sk_buff *skb)
struct pppox_sock *relay_po;

if (sk->sk_state & PPPOX_BOUND) {
struct pppoe_hdr *ph = pppoe_hdr(skb);
int len = ntohs(ph->length);
skb_pull_rcsum(skb, sizeof(struct pppoe_hdr));
if (pskb_trim_rcsum(skb, len))
goto abort_kfree;

ppp_input(&po->chan, skb);
} else if (sk->sk_state & PPPOX_RELAY) {
relay_po = get_item_by_addr(&po->pppoe_relay);
Expand All @@ -357,7 +351,6 @@ static int pppoe_rcv_core(struct sock *sk, struct sk_buff *skb)
if ((sk_pppox(relay_po)->sk_state & PPPOX_CONNECTED) == 0)
goto abort_put;

skb_pull(skb, sizeof(struct pppoe_hdr));
if (!__pppoe_xmit(sk_pppox(relay_po), skb))
goto abort_put;
} else {
Expand Down Expand Up @@ -388,6 +381,7 @@ static int pppoe_rcv(struct sk_buff *skb,
{
struct pppoe_hdr *ph;
struct pppox_sock *po;
int len;

if (!(skb = skb_share_check(skb, GFP_ATOMIC)))
goto out;
Expand All @@ -399,10 +393,21 @@ static int pppoe_rcv(struct sk_buff *skb,
goto drop;

ph = pppoe_hdr(skb);
len = ntohs(ph->length);

skb_pull_rcsum(skb, sizeof(*ph));
if (skb->len < len)
goto drop;

po = get_item(ph->sid, eth_hdr(skb)->h_source, dev->ifindex);
if (po != NULL)
return sk_receive_skb(sk_pppox(po), skb, 0);
if (!po)
goto drop;

if (pskb_trim_rcsum(skb, len))
goto drop;

return sk_receive_skb(sk_pppox(po), skb, 0);

drop:
kfree_skb(skb);
out:
Expand All @@ -427,12 +432,12 @@ static int pppoe_disc_rcv(struct sk_buff *skb,
if (dev_net(dev) != &init_net)
goto abort;

if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr)))
goto abort;

if (!(skb = skb_share_check(skb, GFP_ATOMIC)))
goto out;

if (!pskb_may_pull(skb, sizeof(struct pppoe_hdr)))
goto abort;

ph = pppoe_hdr(skb);
if (ph->code != PADT_CODE)
goto abort;
Expand Down Expand Up @@ -937,12 +942,10 @@ static int pppoe_recvmsg(struct kiocb *iocb, struct socket *sock,
m->msg_namelen = 0;

if (skb) {
struct pppoe_hdr *ph = pppoe_hdr(skb);
const int len = ntohs(ph->length);

error = memcpy_toiovec(m->msg_iov, (unsigned char *) &ph->tag[0], len);
total_len = min(total_len, skb->len);
error = skb_copy_datagram_iovec(skb, 0, m->msg_iov, total_len);
if (error == 0)
error = len;
error = total_len;
}

kfree_skb(skb);
Expand Down
20 changes: 12 additions & 8 deletions drivers/net/pppol2tp.c
Original file line number Diff line number Diff line change
Expand Up @@ -783,14 +783,18 @@ static int pppol2tp_recvmsg(struct kiocb *iocb, struct socket *sock,
err = 0;
skb = skb_recv_datagram(sk, flags & ~MSG_DONTWAIT,
flags & MSG_DONTWAIT, &err);
if (skb) {
err = memcpy_toiovec(msg->msg_iov, (unsigned char *) skb->data,
skb->len);
if (err < 0)
goto do_skb_free;
err = skb->len;
}
do_skb_free:
if (!skb)
goto end;

if (len > skb->len)
len = skb->len;
else if (len < skb->len)
msg->msg_flags |= MSG_TRUNC;

err = skb_copy_datagram_iovec(skb, 0, msg->msg_iov, len);
if (likely(err == 0))
err = len;

kfree_skb(skb);
end:
return err;
Expand Down
4 changes: 3 additions & 1 deletion drivers/net/sfc/falcon.c
Original file line number Diff line number Diff line change
Expand Up @@ -733,8 +733,10 @@ void falcon_fini_rx(struct efx_rx_queue *rx_queue)
continue;
break;
}
if (rc)
if (rc) {
EFX_ERR(efx, "failed to flush rx queue %d\n", rx_queue->queue);
efx_schedule_reset(efx, RESET_TYPE_INVISIBLE);
}

/* Remove RX descriptor ring from card */
EFX_ZERO_OWORD(rx_desc_ptr);
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/sky2.c
Original file line number Diff line number Diff line change
Expand Up @@ -4404,7 +4404,9 @@ static int sky2_resume(struct pci_dev *pdev)
if (err) {
printk(KERN_ERR PFX "%s: could not up: %d\n",
dev->name, err);
rtnl_lock();
dev_close(dev);
rtnl_unlock();
goto out;
}
}
Expand Down
Loading

0 comments on commit f7f866e

Please sign in to comment.