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: (45 commits)
  cnic: Fix ISCSI_KEVENT_IF_DOWN message handling.
  net: irda: init spinlock after memcpy
  ixgbe: fix for 82599 errata marking UDP checksum errors
  r8169: WakeOnLan fix for the 8168
  netxen: reset ring consumer during cleanup
  net/bridge: use kobject_put to release kobject in br_add_if error path
  smc91x.h: add config for Nomadik evaluation kit
  NET: ROSE: Don't use static buffer.
  eepro: Read buffer overflow
  tokenring: Read buffer overflow
  at1700: Read buffer overflow
  fealnx: Write outside array bounds
  ixgbe: remove unnecessary call to device_init_wakeup
  ixgbe: Don't priority tag control frames in DCB mode
  ixgbe: Enable FCoE offload when DCB is enabled for 82599
  net: Rework mdio-ofgpio driver to use of_mdio infrastructure
  register at91_ether using platform_driver_probe
  skge: Enable WoL by default if supported
  net: KS8851 needs to depend on MII
  be2net: Bug fix in the non-lro path. Size of received packet was not updated in statistics properly.
  ...
  • Loading branch information
Linus Torvalds committed Jul 27, 2009
2 parents e00b95d + 6d7760a commit f146214
Show file tree
Hide file tree
Showing 47 changed files with 336 additions and 174 deletions.
1 change: 1 addition & 0 deletions drivers/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1732,6 +1732,7 @@ config KS8842
config KS8851
tristate "Micrel KS8851 SPI"
depends on SPI
select MII
help
SPI driver for Micrel KS8851 SPI attached network chip.

Expand Down
3 changes: 1 addition & 2 deletions drivers/net/arm/at91_ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -1228,7 +1228,6 @@ static int at91ether_resume(struct platform_device *pdev)
#endif

static struct platform_driver at91ether_driver = {
.probe = at91ether_probe,
.remove = __devexit_p(at91ether_remove),
.suspend = at91ether_suspend,
.resume = at91ether_resume,
Expand All @@ -1240,7 +1239,7 @@ static struct platform_driver at91ether_driver = {

static int __init at91ether_init(void)
{
return platform_driver_register(&at91ether_driver);
return platform_driver_probe(&at91ether_driver, at91ether_probe);
}

static void __exit at91ether_exit(void)
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/at1700.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ static int __init at1700_probe1(struct net_device *dev, int ioaddr)
pos3 = mca_read_stored_pos( slot, 3 );
pos4 = mca_read_stored_pos( slot, 4 );

for (l_i = 0; l_i < 0x09; l_i++)
for (l_i = 0; l_i < 8; l_i++)
if (( pos3 & 0x07) == at1700_ioaddr_pattern[l_i])
break;
ioaddr = at1700_mca_probe_list[l_i];
Expand Down
8 changes: 4 additions & 4 deletions drivers/net/benet/be_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -667,7 +667,7 @@ static void skb_fill_rx_data(struct be_adapter *adapter,
struct be_queue_info *rxq = &adapter->rx_obj.q;
struct be_rx_page_info *page_info;
u16 rxq_idx, i, num_rcvd, j;
u32 pktsize, hdr_len, curr_frag_len;
u32 pktsize, hdr_len, curr_frag_len, size;
u8 *start;

rxq_idx = AMAP_GET_BITS(struct amap_eth_rx_compl, fragndx, rxcp);
Expand Down Expand Up @@ -708,12 +708,13 @@ static void skb_fill_rx_data(struct be_adapter *adapter,
}

/* More frags present for this completion */
pktsize -= curr_frag_len; /* account for above copied frag */
size = pktsize;
for (i = 1, j = 0; i < num_rcvd; i++) {
size -= curr_frag_len;
index_inc(&rxq_idx, rxq->len);
page_info = get_rx_page_info(adapter, rxq_idx);

curr_frag_len = min(pktsize, rx_frag_size);
curr_frag_len = min(size, rx_frag_size);

/* Coalesce all frags from the same physical page in one slot */
if (page_info->page_offset == 0) {
Expand All @@ -731,7 +732,6 @@ static void skb_fill_rx_data(struct be_adapter *adapter,
skb_shinfo(skb)->frags[j].size += curr_frag_len;
skb->len += curr_frag_len;
skb->data_len += curr_frag_len;
pktsize -= curr_frag_len;

memset(page_info, 0, sizeof(*page_info));
}
Expand Down
23 changes: 21 additions & 2 deletions drivers/net/cnic.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ static int cnic_send_nlmsg(struct cnic_local *cp, u32 type,
}

rcu_read_lock();
ulp_ops = rcu_dereference(cp->ulp_ops[CNIC_ULP_ISCSI]);
ulp_ops = rcu_dereference(cnic_ulp_tbl[CNIC_ULP_ISCSI]);
if (ulp_ops)
ulp_ops->iscsi_nl_send_msg(cp->dev, msg_type, buf, len);
rcu_read_unlock();
Expand Down Expand Up @@ -319,6 +319,20 @@ static int cnic_abort_prep(struct cnic_sock *csk)
return 0;
}

static void cnic_uio_stop(void)
{
struct cnic_dev *dev;

read_lock(&cnic_dev_lock);
list_for_each_entry(dev, &cnic_dev_list, list) {
struct cnic_local *cp = dev->cnic_priv;

if (cp->cnic_uinfo)
cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL);
}
read_unlock(&cnic_dev_lock);
}

int cnic_register_driver(int ulp_type, struct cnic_ulp_ops *ulp_ops)
{
struct cnic_dev *dev;
Expand Down Expand Up @@ -390,6 +404,9 @@ int cnic_unregister_driver(int ulp_type)
}
read_unlock(&cnic_dev_lock);

if (ulp_type == CNIC_ULP_ISCSI)
cnic_uio_stop();

rcu_assign_pointer(cnic_ulp_tbl[ulp_type], NULL);

mutex_unlock(&cnic_lock);
Expand Down Expand Up @@ -632,7 +649,6 @@ static void cnic_free_resc(struct cnic_dev *dev)
int i = 0;

if (cp->cnic_uinfo) {
cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL);
while (cp->uio_dev != -1 && i < 15) {
msleep(100);
i++;
Expand Down Expand Up @@ -1057,6 +1073,9 @@ static void cnic_ulp_stop(struct cnic_dev *dev)
struct cnic_local *cp = dev->cnic_priv;
int if_type;

if (cp->cnic_uinfo)
cnic_send_nlmsg(cp, ISCSI_KEVENT_IF_DOWN, NULL);

rcu_read_lock();
for (if_type = 0; if_type < MAX_CNIC_ULP_TYPE; if_type++) {
struct cnic_ulp_ops *ulp_ops;
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/eepro.c
Original file line number Diff line number Diff line change
Expand Up @@ -1784,7 +1784,7 @@ int __init init_module(void)
printk(KERN_INFO "eepro_init_module: Auto-detecting boards (May God protect us...)\n");
}

for (i = 0; io[i] != -1 && i < MAX_EEPRO; i++) {
for (i = 0; i < MAX_EEPRO && io[i] != -1; i++) {
dev = alloc_etherdev(sizeof(struct eepro_local));
if (!dev)
break;
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/fealnx.c
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,8 @@ static int __devinit fealnx_init_one(struct pci_dev *pdev,
if (np->flags == HAS_MII_XCVR) {
int phy, phy_idx = 0;

for (phy = 1; phy < 32 && phy_idx < 4; phy++) {
for (phy = 1; phy < 32 && phy_idx < ARRAY_SIZE(np->phys);
phy++) {
int mii_status = mdio_read(dev, phy, 1);

if (mii_status != 0xffff && mii_status != 0x0000) {
Expand Down
20 changes: 10 additions & 10 deletions drivers/net/fs_enet/fs_enet-main.c
Original file line number Diff line number Diff line change
Expand Up @@ -754,17 +754,16 @@ static int fs_init_phy(struct net_device *dev)
fep->oldlink = 0;
fep->oldspeed = 0;
fep->oldduplex = -1;
if(fep->fpi->phy_node)
phydev = of_phy_connect(dev, fep->fpi->phy_node,
&fs_adjust_link, 0,
PHY_INTERFACE_MODE_MII);
else {
printk("No phy bus ID specified in BSP code\n");
return -EINVAL;

phydev = of_phy_connect(dev, fep->fpi->phy_node, &fs_adjust_link, 0,
PHY_INTERFACE_MODE_MII);
if (!phydev) {
phydev = of_phy_connect_fixed_link(dev, &fs_adjust_link,
PHY_INTERFACE_MODE_MII);
}
if (IS_ERR(phydev)) {
printk(KERN_ERR "%s: Could not attach to PHY\n", dev->name);
return PTR_ERR(phydev);
if (!phydev) {
dev_err(&dev->dev, "Could not attach to PHY\n");
return -ENODEV;
}

fep->phydev = phydev;
Expand Down Expand Up @@ -1005,6 +1004,7 @@ static int __devinit fs_enet_probe(struct of_device *ofdev,
goto out_free_fpi;
}

SET_NETDEV_DEV(ndev, &ofdev->dev);
dev_set_drvdata(&ofdev->dev, ndev);

fep = netdev_priv(ndev);
Expand Down
24 changes: 8 additions & 16 deletions drivers/net/gianfar.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,15 +264,6 @@ static int gfar_of_init(struct net_device *dev)
priv->device_flags |= FSL_GIANFAR_DEV_HAS_MAGIC_PACKET;

priv->phy_node = of_parse_phandle(np, "phy-handle", 0);
if (!priv->phy_node) {
u32 *fixed_link;

fixed_link = (u32 *)of_get_property(np, "fixed-link", NULL);
if (!fixed_link) {
err = -ENODEV;
goto err_out;
}
}

/* Find the TBI PHY. If it's not there, we don't support SGMII */
priv->tbi_node = of_parse_phandle(np, "tbi-handle", 0);
Expand Down Expand Up @@ -659,13 +650,14 @@ static int init_phy(struct net_device *dev)

interface = gfar_get_interface(dev);

if (priv->phy_node) {
priv->phydev = of_phy_connect(dev, priv->phy_node, &adjust_link,
0, interface);
if (!priv->phydev) {
dev_err(&dev->dev, "error: Could not attach to PHY\n");
return -ENODEV;
}
priv->phydev = of_phy_connect(dev, priv->phy_node, &adjust_link, 0,
interface);
if (!priv->phydev)
priv->phydev = of_phy_connect_fixed_link(dev, &adjust_link,
interface);
if (!priv->phydev) {
dev_err(&dev->dev, "could not attach to PHY\n");
return -ENODEV;
}

if (interface == PHY_INTERFACE_MODE_SGMII)
Expand Down
1 change: 1 addition & 0 deletions drivers/net/ixgbe/ixgbe.h
Original file line number Diff line number Diff line change
Expand Up @@ -327,6 +327,7 @@ struct ixgbe_adapter {
#define IXGBE_FLAG_IN_SFP_MOD_TASK (u32)(1 << 25)
#define IXGBE_FLAG_FDIR_HASH_CAPABLE (u32)(1 << 26)
#define IXGBE_FLAG_FDIR_PERFECT_CAPABLE (u32)(1 << 27)
#define IXGBE_FLAG_FCOE_CAPABLE (u32)(1 << 28)
#define IXGBE_FLAG_FCOE_ENABLED (u32)(1 << 29)

u32 flags2;
Expand Down
24 changes: 24 additions & 0 deletions drivers/net/ixgbe/ixgbe_dcb_nl.c
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,18 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
adapter->flags &= ~IXGBE_FLAG_FDIR_PERFECT_CAPABLE;
}
adapter->flags |= IXGBE_FLAG_DCB_ENABLED;
#ifdef IXGBE_FCOE
/* Turn on FCoE offload */
if ((adapter->flags & IXGBE_FLAG_FCOE_CAPABLE) &&
(!(adapter->flags & IXGBE_FLAG_FCOE_ENABLED))) {
adapter->flags |= IXGBE_FLAG_FCOE_ENABLED;
adapter->ring_feature[RING_F_FCOE].indices =
IXGBE_FCRETA_SIZE;
netdev->features |= NETIF_F_FCOE_CRC;
netdev->features |= NETIF_F_FSO;
netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1;
}
#endif /* IXGBE_FCOE */
ixgbe_init_interrupt_scheme(adapter);
if (netif_running(netdev))
netdev->netdev_ops->ndo_open(netdev);
Expand All @@ -156,6 +168,18 @@ static u8 ixgbe_dcbnl_set_state(struct net_device *netdev, u8 state)
adapter->flags |= IXGBE_FLAG_RSS_ENABLED;
if (adapter->hw.mac.type == ixgbe_mac_82599EB)
adapter->flags |= IXGBE_FLAG_FDIR_HASH_CAPABLE;

#ifdef IXGBE_FCOE
/* Turn off FCoE offload */
if (adapter->flags & (IXGBE_FLAG_FCOE_CAPABLE |
IXGBE_FLAG_FCOE_ENABLED)) {
adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED;
adapter->ring_feature[RING_F_FCOE].indices = 0;
netdev->features &= ~NETIF_F_FCOE_CRC;
netdev->features &= ~NETIF_F_FSO;
netdev->fcoe_ddp_xid = 0;
}
#endif /* IXGBE_FCOE */
ixgbe_init_interrupt_scheme(adapter);
if (netif_running(netdev))
netdev->netdev_ops->ndo_open(netdev);
Expand Down
52 changes: 33 additions & 19 deletions drivers/net/ixgbe/ixgbe_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
#include <linux/in.h>
#include <linux/ip.h>
#include <linux/tcp.h>
#include <linux/pkt_sched.h>
#include <linux/ipv6.h>
#include <net/checksum.h>
#include <net/ip6_checksum.h>
Expand Down Expand Up @@ -510,8 +511,11 @@ static void ixgbe_receive_skb(struct ixgbe_q_vector *q_vector,
* @skb: skb currently being received and modified
**/
static inline void ixgbe_rx_checksum(struct ixgbe_adapter *adapter,
u32 status_err, struct sk_buff *skb)
union ixgbe_adv_rx_desc *rx_desc,
struct sk_buff *skb)
{
u32 status_err = le32_to_cpu(rx_desc->wb.upper.status_error);

skb->ip_summed = CHECKSUM_NONE;

/* Rx csum disabled */
Expand All @@ -529,6 +533,16 @@ static inline void ixgbe_rx_checksum(struct ixgbe_adapter *adapter,
return;

if (status_err & IXGBE_RXDADV_ERR_TCPE) {
u16 pkt_info = rx_desc->wb.lower.lo_dword.hs_rss.pkt_info;

/*
* 82599 errata, UDP frames with a 0 checksum can be marked as
* checksum errors.
*/
if ((pkt_info & IXGBE_RXDADV_PKTTYPE_UDP) &&
(adapter->hw.mac.type == ixgbe_mac_82599EB))
return;

adapter->hw_csum_rx_error++;
return;
}
Expand Down Expand Up @@ -802,7 +816,7 @@ static bool ixgbe_clean_rx_irq(struct ixgbe_q_vector *q_vector,
goto next_desc;
}

ixgbe_rx_checksum(adapter, staterr, skb);
ixgbe_rx_checksum(adapter, rx_desc, skb);

/* probably a little skewed due to removing CRC */
total_rx_bytes += skb->len;
Expand Down Expand Up @@ -3806,8 +3820,9 @@ static int __devinit ixgbe_sw_init(struct ixgbe_adapter *adapter)
adapter->atr_sample_rate = 20;
adapter->fdir_pballoc = 0;
#ifdef IXGBE_FCOE
adapter->flags |= IXGBE_FLAG_FCOE_ENABLED;
adapter->ring_feature[RING_F_FCOE].indices = IXGBE_FCRETA_SIZE;
adapter->flags |= IXGBE_FLAG_FCOE_CAPABLE;
adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED;
adapter->ring_feature[RING_F_FCOE].indices = 0;
#endif /* IXGBE_FCOE */
}

Expand Down Expand Up @@ -5125,9 +5140,6 @@ static int ixgbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
int count = 0;
unsigned int f;

r_idx = skb->queue_mapping;
tx_ring = &adapter->tx_ring[r_idx];

if (adapter->vlgrp && vlan_tx_tag_present(skb)) {
tx_flags |= vlan_tx_tag_get(skb);
if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
Expand All @@ -5137,11 +5149,19 @@ static int ixgbe_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT;
tx_flags |= IXGBE_TX_FLAGS_VLAN;
} else if (adapter->flags & IXGBE_FLAG_DCB_ENABLED) {
tx_flags |= (skb->queue_mapping << 13);
tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT;
tx_flags |= IXGBE_TX_FLAGS_VLAN;
if (skb->priority != TC_PRIO_CONTROL) {
tx_flags |= (skb->queue_mapping << 13);
tx_flags <<= IXGBE_TX_FLAGS_VLAN_SHIFT;
tx_flags |= IXGBE_TX_FLAGS_VLAN;
} else {
skb->queue_mapping =
adapter->ring_feature[RING_F_DCB].indices-1;
}
}

r_idx = skb->queue_mapping;
tx_ring = &adapter->tx_ring[r_idx];

if ((adapter->flags & IXGBE_FLAG_FCOE_ENABLED) &&
(skb->protocol == htons(ETH_P_FCOE)))
tx_flags |= IXGBE_TX_FLAGS_FCOE;
Expand Down Expand Up @@ -5580,16 +5600,11 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
#endif

#ifdef IXGBE_FCOE
if (adapter->flags & IXGBE_FLAG_FCOE_ENABLED) {
if (adapter->flags & IXGBE_FLAG_FCOE_CAPABLE) {
if (hw->mac.ops.get_device_caps) {
hw->mac.ops.get_device_caps(hw, &device_caps);
if (!(device_caps & IXGBE_DEVICE_CAPS_FCOE_OFFLOADS)) {
netdev->features |= NETIF_F_FCOE_CRC;
netdev->features |= NETIF_F_FSO;
netdev->fcoe_ddp_xid = IXGBE_FCOE_DDP_MAX - 1;
} else {
adapter->flags &= ~IXGBE_FLAG_FCOE_ENABLED;
}
if (device_caps & IXGBE_DEVICE_CAPS_FCOE_OFFLOADS)
adapter->flags &= ~IXGBE_FLAG_FCOE_CAPABLE;
}
}
#endif /* IXGBE_FCOE */
Expand Down Expand Up @@ -5638,7 +5653,6 @@ static int __devinit ixgbe_probe(struct pci_dev *pdev,
adapter->wol = 0;
break;
}
device_init_wakeup(&adapter->pdev->dev, true);
device_set_wakeup_enable(&adapter->pdev->dev, adapter->wol);

/* pick up the PCI bus settings for reporting later */
Expand Down
7 changes: 7 additions & 0 deletions drivers/net/netxen/netxen_nic_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,13 @@ void netxen_free_sw_resources(struct netxen_adapter *adapter)
kfree(recv_ctx->rds_rings);

skip_rds:
if (recv_ctx->sds_rings == NULL)
goto skip_sds;

for(ring = 0; ring < adapter->max_sds_rings; ring++)
recv_ctx->sds_rings[ring].consumer = 0;

skip_sds:
if (adapter->tx_ring == NULL)
return;

Expand Down
Loading

0 comments on commit f146214

Please sign in to comment.