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:
  can: add sanity checks
  fs_enet: restore promiscuous and multicast settings in restart()
  ibm_newemac: Fixes entry of short packets
  ibm_newemac: Fixes kernel crashes when speed of cable connected changes
  pasemi_mac: Access iph->tot_len with correct endianness
  ehea: Access iph->tot_len with correct endianness
  ehea: fix race condition
  ehea: add MODULE_DEVICE_TABLE
  ehea: fix might sleep problem
  forcedeth: fix lockdep warning on ethtool -s
  Add missing skb->dev assignment in Frame Relay RX code
  bridge: fix use-after-free in br_cleanup_bridges()
  tcp: fix a size_t < 0 comparison in tcp_read_sock
  tcp: net/ipv4/tcp.c needs linux/scatterlist.h
  libertas: support USB persistence on suspend/resume (resend)
  iwlwifi: drop skb silently for Tx request in monitor mode
  iwlwifi: fix incorrect 5GHz rates reported in monitor mode
  • Loading branch information
torvalds committed Jul 7, 2008
2 parents 3bc5ab9 + 7f2d38e commit b2798bf
Show file tree
Hide file tree
Showing 17 changed files with 113 additions and 35 deletions.
8 changes: 5 additions & 3 deletions drivers/net/ehea/ehea.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
#include <asm/io.h>

#define DRV_NAME "ehea"
#define DRV_VERSION "EHEA_0091"
#define DRV_VERSION "EHEA_0092"

/* eHEA capability flags */
#define DLPAR_PORT_ADD_REM 1
Expand Down Expand Up @@ -452,7 +452,7 @@ struct ehea_bcmc_reg_entry {
struct ehea_bcmc_reg_array {
struct ehea_bcmc_reg_entry *arr;
int num_entries;
struct mutex lock;
spinlock_t lock;
};

#define EHEA_PORT_UP 1
Expand All @@ -478,6 +478,7 @@ struct ehea_port {
int num_add_tx_qps;
int num_mcs;
int resets;
u64 flags;
u64 mac_addr;
u32 logical_port_id;
u32 port_speed;
Expand All @@ -501,7 +502,8 @@ struct port_res_cfg {
};

enum ehea_flag_bits {
__EHEA_STOP_XFER
__EHEA_STOP_XFER,
__EHEA_DISABLE_PORT_RESET
};

void ehea_set_ethtool_ops(struct net_device *netdev);
Expand Down
42 changes: 25 additions & 17 deletions drivers/net/ehea/ehea_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ static struct of_device_id ehea_device_table[] = {
},
{},
};
MODULE_DEVICE_TABLE(of, ehea_device_table);

static struct of_platform_driver ehea_driver = {
.name = "ehea",
Expand All @@ -137,6 +138,12 @@ void ehea_dump(void *adr, int len, char *msg)
}
}

void ehea_schedule_port_reset(struct ehea_port *port)
{
if (!test_bit(__EHEA_DISABLE_PORT_RESET, &port->flags))
schedule_work(&port->reset_task);
}

static void ehea_update_firmware_handles(void)
{
struct ehea_fw_handle_entry *arr = NULL;
Expand Down Expand Up @@ -241,7 +248,7 @@ static void ehea_update_bcmc_registrations(void)
}

if (num_registrations) {
arr = kzalloc(num_registrations * sizeof(*arr), GFP_KERNEL);
arr = kzalloc(num_registrations * sizeof(*arr), GFP_ATOMIC);
if (!arr)
return; /* Keep the existing array */
} else
Expand Down Expand Up @@ -301,7 +308,7 @@ static struct net_device_stats *ehea_get_stats(struct net_device *dev)

memset(stats, 0, sizeof(*stats));

cb2 = kzalloc(PAGE_SIZE, GFP_KERNEL);
cb2 = kzalloc(PAGE_SIZE, GFP_ATOMIC);
if (!cb2) {
ehea_error("no mem for cb2");
goto out;
Expand Down Expand Up @@ -587,7 +594,7 @@ static int ehea_treat_poll_error(struct ehea_port_res *pr, int rq,
"Resetting port.", pr->qp->init_attr.qp_nr);
ehea_dump(cqe, sizeof(*cqe), "CQE");
}
schedule_work(&pr->port->reset_task);
ehea_schedule_port_reset(pr->port);
return 1;
}

Expand Down Expand Up @@ -616,7 +623,7 @@ static int get_skb_hdr(struct sk_buff *skb, void **iphdr,
*tcph = tcp_hdr(skb);

/* check if ip header and tcp header are complete */
if (iph->tot_len < ip_len + tcp_hdrlen(skb))
if (ntohs(iph->tot_len) < ip_len + tcp_hdrlen(skb))
return -1;

*hdr_flags = LRO_IPV4 | LRO_TCP;
Expand Down Expand Up @@ -765,7 +772,7 @@ static struct ehea_cqe *ehea_proc_cqes(struct ehea_port_res *pr, int my_quota)
ehea_error("Send Completion Error: Resetting port");
if (netif_msg_tx_err(pr->port))
ehea_dump(cqe, sizeof(*cqe), "Send CQE");
schedule_work(&pr->port->reset_task);
ehea_schedule_port_reset(pr->port);
break;
}

Expand Down Expand Up @@ -885,7 +892,7 @@ static irqreturn_t ehea_qp_aff_irq_handler(int irq, void *param)
eqe = ehea_poll_eq(port->qp_eq);
}

schedule_work(&port->reset_task);
ehea_schedule_port_reset(port);

return IRQ_HANDLED;
}
Expand Down Expand Up @@ -1763,7 +1770,7 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa)

memcpy(dev->dev_addr, mac_addr->sa_data, dev->addr_len);

mutex_lock(&ehea_bcmc_regs.lock);
spin_lock(&ehea_bcmc_regs.lock);

/* Deregister old MAC in pHYP */
if (port->state == EHEA_PORT_UP) {
Expand All @@ -1785,7 +1792,7 @@ static int ehea_set_mac_addr(struct net_device *dev, void *sa)

out_upregs:
ehea_update_bcmc_registrations();
mutex_unlock(&ehea_bcmc_regs.lock);
spin_unlock(&ehea_bcmc_regs.lock);
out_free:
kfree(cb0);
out:
Expand Down Expand Up @@ -1947,7 +1954,7 @@ static void ehea_set_multicast_list(struct net_device *dev)
}
ehea_promiscuous(dev, 0);

mutex_lock(&ehea_bcmc_regs.lock);
spin_lock(&ehea_bcmc_regs.lock);

if (dev->flags & IFF_ALLMULTI) {
ehea_allmulti(dev, 1);
Expand Down Expand Up @@ -1978,7 +1985,7 @@ static void ehea_set_multicast_list(struct net_device *dev)
}
out:
ehea_update_bcmc_registrations();
mutex_unlock(&ehea_bcmc_regs.lock);
spin_unlock(&ehea_bcmc_regs.lock);
return;
}

Expand Down Expand Up @@ -2497,7 +2504,7 @@ static int ehea_up(struct net_device *dev)
}
}

mutex_lock(&ehea_bcmc_regs.lock);
spin_lock(&ehea_bcmc_regs.lock);

ret = ehea_broadcast_reg_helper(port, H_REG_BCMC);
if (ret) {
Expand All @@ -2520,7 +2527,7 @@ static int ehea_up(struct net_device *dev)
ehea_info("Failed starting %s. ret=%i", dev->name, ret);

ehea_update_bcmc_registrations();
mutex_unlock(&ehea_bcmc_regs.lock);
spin_unlock(&ehea_bcmc_regs.lock);

ehea_update_firmware_handles();
mutex_unlock(&ehea_fw_handles.lock);
Expand Down Expand Up @@ -2575,7 +2582,7 @@ static int ehea_down(struct net_device *dev)

mutex_lock(&ehea_fw_handles.lock);

mutex_lock(&ehea_bcmc_regs.lock);
spin_lock(&ehea_bcmc_regs.lock);
ehea_drop_multicast_list(dev);
ehea_broadcast_reg_helper(port, H_DEREG_BCMC);

Expand All @@ -2584,7 +2591,7 @@ static int ehea_down(struct net_device *dev)
port->state = EHEA_PORT_DOWN;

ehea_update_bcmc_registrations();
mutex_unlock(&ehea_bcmc_regs.lock);
spin_unlock(&ehea_bcmc_regs.lock);

ret = ehea_clean_all_portres(port);
if (ret)
Expand All @@ -2605,13 +2612,14 @@ static int ehea_stop(struct net_device *dev)
if (netif_msg_ifdown(port))
ehea_info("disabling port %s", dev->name);

set_bit(__EHEA_DISABLE_PORT_RESET, &port->flags);
cancel_work_sync(&port->reset_task);

mutex_lock(&port->port_lock);
netif_stop_queue(dev);
port_napi_disable(port);
ret = ehea_down(dev);
mutex_unlock(&port->port_lock);
clear_bit(__EHEA_DISABLE_PORT_RESET, &port->flags);
return ret;
}

Expand Down Expand Up @@ -2941,7 +2949,7 @@ static void ehea_tx_watchdog(struct net_device *dev)

if (netif_carrier_ok(dev) &&
!test_bit(__EHEA_STOP_XFER, &ehea_driver_flags))
schedule_work(&port->reset_task);
ehea_schedule_port_reset(port);
}

int ehea_sense_adapter_attr(struct ehea_adapter *adapter)
Expand Down Expand Up @@ -3590,7 +3598,7 @@ int __init ehea_module_init(void)
memset(&ehea_bcmc_regs, 0, sizeof(ehea_bcmc_regs));

mutex_init(&ehea_fw_handles.lock);
mutex_init(&ehea_bcmc_regs.lock);
spin_lock_init(&ehea_bcmc_regs.lock);

ret = check_module_parm();
if (ret)
Expand Down
15 changes: 13 additions & 2 deletions drivers/net/forcedeth.c
Original file line number Diff line number Diff line change
Expand Up @@ -4194,12 +4194,23 @@ static int nv_set_settings(struct net_device *dev, struct ethtool_cmd *ecmd)

netif_carrier_off(dev);
if (netif_running(dev)) {
unsigned long flags;

nv_disable_irq(dev);
netif_tx_lock_bh(dev);
spin_lock(&np->lock);
/* with plain spinlock lockdep complains */
spin_lock_irqsave(&np->lock, flags);
/* stop engines */
/* FIXME:
* this can take some time, and interrupts are disabled
* due to spin_lock_irqsave, but let's hope no daemon
* is going to change the settings very often...
* Worst case:
* NV_RXSTOP_DELAY1MAX + NV_TXSTOP_DELAY1MAX
* + some minor delays, which is up to a second approximately
*/
nv_stop_rxtx(dev);
spin_unlock(&np->lock);
spin_unlock_irqrestore(&np->lock, flags);
netif_tx_unlock_bh(dev);
}

Expand Down
3 changes: 3 additions & 0 deletions drivers/net/fs_enet/mac-fcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,6 +463,9 @@ static void restart(struct net_device *dev)
else
C32(fccp, fcc_fpsmr, FCC_PSMR_FDE | FCC_PSMR_LPB);

/* Restore multicast and promiscuous settings */
set_multicast_list(dev);

S32(fccp, fcc_gfmr, FCC_GFMR_ENR | FCC_GFMR_ENT);
}

Expand Down
8 changes: 8 additions & 0 deletions drivers/net/ibm_newemac/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1636,6 +1636,12 @@ static int emac_poll_rx(void *param, int budget)
goto next;
}

if (len < ETH_HLEN) {
++dev->estats.rx_dropped_stack;
emac_recycle_rx_skb(dev, slot, len);
goto next;
}

if (len && len < EMAC_RX_COPY_THRESH) {
struct sk_buff *copy_skb =
alloc_skb(len + EMAC_RX_SKB_HEADROOM + 2, GFP_ATOMIC);
Expand Down Expand Up @@ -2719,6 +2725,8 @@ static int __devinit emac_probe(struct of_device *ofdev,
/* Clean rings */
memset(dev->tx_desc, 0, NUM_TX_BUFF * sizeof(struct mal_descriptor));
memset(dev->rx_desc, 0, NUM_RX_BUFF * sizeof(struct mal_descriptor));
memset(dev->tx_skb, 0, NUM_TX_BUFF * sizeof(struct sk_buff *));
memset(dev->rx_skb, 0, NUM_RX_BUFF * sizeof(struct sk_buff *));

/* Attach to ZMII, if needed */
if (emac_has_feature(dev, EMAC_FTR_HAS_ZMII) &&
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/pasemi_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ static int get_skb_hdr(struct sk_buff *skb, void **iphdr,
*tcph = tcp_hdr(skb);

/* check if ip header and tcp header are complete */
if (iph->tot_len < ip_len + tcp_hdrlen(skb))
if (ntohs(iph->tot_len) < ip_len + tcp_hdrlen(skb))
return -1;

*hdr_flags = LRO_IPV4 | LRO_TCP;
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wan/hdlc_fr.c
Original file line number Diff line number Diff line change
Expand Up @@ -1008,6 +1008,7 @@ static int fr_rx(struct sk_buff *skb)
stats->rx_bytes += skb->len;
if (pvc->state.becn)
stats->rx_compressed++;
skb->dev = dev;
netif_rx(skb);
return NET_RX_SUCCESS;
} else {
Expand Down
6 changes: 5 additions & 1 deletion drivers/net/wireless/iwlwifi/iwl-3945.c
Original file line number Diff line number Diff line change
Expand Up @@ -588,8 +588,12 @@ static void iwl3945_add_radiotap(struct iwl3945_priv *priv,

if (rate == -1)
iwl3945_rt->rt_rate = 0;
else
else {
if (stats->band == IEEE80211_BAND_5GHZ)
rate += IWL_FIRST_OFDM_RATE;

iwl3945_rt->rt_rate = iwl3945_rates[rate].ieee;
}

/* antenna number */
antenna = phy_flags_hw & RX_RES_PHY_FLAGS_ANTENNA_MSK;
Expand Down
6 changes: 5 additions & 1 deletion drivers/net/wireless/iwlwifi/iwl-4965.c
Original file line number Diff line number Diff line change
Expand Up @@ -3528,8 +3528,12 @@ static void iwl4965_add_radiotap(struct iwl_priv *priv,

if (rate == -1)
iwl4965_rt->rt_rate = 0;
else
else {
if (stats->band == IEEE80211_BAND_5GHZ)
rate += IWL_FIRST_OFDM_RATE;

iwl4965_rt->rt_rate = iwl4965_rates[rate].ieee;
}

/*
* "antenna number"
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/wireless/iwlwifi/iwl3945-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -6687,7 +6687,8 @@ static int iwl3945_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb,

if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) {
IWL_DEBUG_MAC80211("leave - monitor\n");
return -1;
dev_kfree_skb_any(skb);
return 0;
}

IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len,
Expand Down
3 changes: 2 additions & 1 deletion drivers/net/wireless/iwlwifi/iwl4965-base.c
Original file line number Diff line number Diff line change
Expand Up @@ -6237,7 +6237,8 @@ static int iwl4965_mac_tx(struct ieee80211_hw *hw, struct sk_buff *skb,

if (priv->iw_mode == IEEE80211_IF_TYPE_MNTR) {
IWL_DEBUG_MAC80211("leave - monitor\n");
return -1;
dev_kfree_skb_any(skb);
return 0;
}

IWL_DEBUG_TX("dev->xmit(%d bytes) at rate 0x%02x\n", skb->len,
Expand Down
1 change: 1 addition & 0 deletions drivers/net/wireless/libertas/if_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -925,6 +925,7 @@ static struct usb_driver if_usb_driver = {
.id_table = if_usb_table,
.suspend = if_usb_suspend,
.resume = if_usb_resume,
.reset_resume = if_usb_resume,
};

static int __init if_usb_init_module(void)
Expand Down
10 changes: 7 additions & 3 deletions net/bridge/br_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -442,12 +442,16 @@ int br_del_if(struct net_bridge *br, struct net_device *dev)

void __exit br_cleanup_bridges(void)
{
struct net_device *dev, *nxt;
struct net_device *dev;

rtnl_lock();
for_each_netdev_safe(&init_net, dev, nxt)
if (dev->priv_flags & IFF_EBRIDGE)
restart:
for_each_netdev(&init_net, dev) {
if (dev->priv_flags & IFF_EBRIDGE) {
del_br(dev->priv);
goto restart;
}
}
rtnl_unlock();

}
Loading

0 comments on commit b2798bf

Please sign in to comment.