Commit 0a4cf2c8 authored by Linus Torvalds's avatar Linus Torvalds

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6:
  dsa: fix master interface allmulti/promisc handling
  dsa: fix skb->pkt_type when mac address of slave interface differs
  net: fix setting of skb->tail in skb_recycle_check()
  net: fix /proc/net/snmp as memory corruptor
  mac80211: fix a buffer overrun in station debug code
  netfilter: payload_len is be16, add size of struct rather than size of pointer
  ipv6: fix ip6_mr_init error path
  [4/4] dca: fixup initialization dependency
  [3/4] I/OAT: fix async_tx.callback checking
  [2/4] I/OAT: fix dma_pin_iovec_pages() error handling
  [1/4] I/OAT: fix channel resources free for not allocated channels
  ssb: Fix DMA-API compilation for non-PCI systems
  SSB: hide empty sub menu
  vlan: Fix typos in proc output string
  [netdrvr] usb/hso: Cleanup rfkill error handling
  sfc: Correct address of gPXE boot configuration in EEPROM
  el3_common_init() should be __devinit, not __init
  hso: rfkill type should be WWAN
  mlx4_en: Start port error flow bug fix
  af_key: mark policy as dead before destroying
parents 4694516d df02c6ff
......@@ -270,6 +270,6 @@ static void __exit dca_exit(void)
dca_sysfs_exit();
}
module_init(dca_init);
subsys_initcall(dca_init);
module_exit(dca_exit);
......@@ -525,7 +525,7 @@ static dma_cookie_t ioat1_tx_submit(struct dma_async_tx_descriptor *tx)
}
hw->ctl = IOAT_DMA_DESCRIPTOR_CTL_CP_STS;
if (new->async_tx.callback) {
if (first->async_tx.callback) {
hw->ctl |= IOAT_DMA_DESCRIPTOR_CTL_INT_GN;
if (first != new) {
/* move callback into to last desc */
......@@ -617,7 +617,7 @@ static dma_cookie_t ioat2_tx_submit(struct dma_async_tx_descriptor *tx)
}
hw->ctl |= IOAT_DMA_DESCRIPTOR_CTL_CP_STS;
if (new->async_tx.callback) {
if (first->async_tx.callback) {
hw->ctl |= IOAT_DMA_DESCRIPTOR_CTL_INT_GN;
if (first != new) {
/* move callback into to last desc */
......@@ -807,6 +807,12 @@ static void ioat_dma_free_chan_resources(struct dma_chan *chan)
struct ioat_desc_sw *desc, *_desc;
int in_use_descs = 0;
/* Before freeing channel resources first check
* if they have been previously allocated for this channel.
*/
if (ioat_chan->desccount == 0)
return;
tasklet_disable(&ioat_chan->cleanup_task);
ioat_dma_memcpy_cleanup(ioat_chan);
......@@ -869,6 +875,7 @@ static void ioat_dma_free_chan_resources(struct dma_chan *chan)
ioat_chan->last_completion = ioat_chan->completion_addr = 0;
ioat_chan->pending = 0;
ioat_chan->dmacount = 0;
ioat_chan->desccount = 0;
ioat_chan->watchdog_completion = 0;
ioat_chan->last_compl_desc_addr_hw = 0;
ioat_chan->watchdog_tcp_cookie =
......
......@@ -55,7 +55,6 @@ struct dma_pinned_list *dma_pin_iovec_pages(struct iovec *iov, size_t len)
int nr_iovecs = 0;
int iovec_len_used = 0;
int iovec_pages_used = 0;
long err;
/* don't pin down non-user-based iovecs */
if (segment_eq(get_fs(), KERNEL_DS))
......@@ -72,23 +71,21 @@ struct dma_pinned_list *dma_pin_iovec_pages(struct iovec *iov, size_t len)
local_list = kmalloc(sizeof(*local_list)
+ (nr_iovecs * sizeof (struct dma_page_list))
+ (iovec_pages_used * sizeof (struct page*)), GFP_KERNEL);
if (!local_list) {
err = -ENOMEM;
if (!local_list)
goto out;
}
/* list of pages starts right after the page list array */
pages = (struct page **) &local_list->page_list[nr_iovecs];
local_list->nr_iovecs = 0;
for (i = 0; i < nr_iovecs; i++) {
struct dma_page_list *page_list = &local_list->page_list[i];
len -= iov[i].iov_len;
if (!access_ok(VERIFY_WRITE, iov[i].iov_base, iov[i].iov_len)) {
err = -EFAULT;
if (!access_ok(VERIFY_WRITE, iov[i].iov_base, iov[i].iov_len))
goto unpin;
}
page_list->nr_pages = num_pages_spanned(&iov[i]);
page_list->base_address = iov[i].iov_base;
......@@ -109,10 +106,8 @@ struct dma_pinned_list *dma_pin_iovec_pages(struct iovec *iov, size_t len)
NULL);
up_read(&current->mm->mmap_sem);
if (ret != page_list->nr_pages) {
err = -ENOMEM;
if (ret != page_list->nr_pages)
goto unpin;
}
local_list->nr_iovecs = i + 1;
}
......@@ -122,7 +117,7 @@ struct dma_pinned_list *dma_pin_iovec_pages(struct iovec *iov, size_t len)
unpin:
dma_unpin_iovec_pages(local_list);
out:
return ERR_PTR(err);
return NULL;
}
void dma_unpin_iovec_pages(struct dma_pinned_list *pinned_list)
......
......@@ -706,7 +706,7 @@ static int mlx4_en_start_port(struct net_device *dev)
mlx4_en_release_rss_steer(priv);
rx_err:
for (i = 0; i < priv->rx_ring_num; i++)
mlx4_en_deactivate_rx_ring(priv, &priv->rx_ring[rx_index]);
mlx4_en_deactivate_rx_ring(priv, &priv->rx_ring[i]);
cq_err:
while (rx_index--)
mlx4_en_deactivate_cq(priv, &priv->rx_cq[rx_index]);
......
......@@ -174,8 +174,8 @@ static struct efx_ethtool_stat efx_ethtool_stats[] = {
/* EEPROM range with gPXE configuration */
#define EFX_ETHTOOL_EEPROM_MAGIC 0xEFAB
#define EFX_ETHTOOL_EEPROM_MIN 0x100U
#define EFX_ETHTOOL_EEPROM_MAX 0x400U
#define EFX_ETHTOOL_EEPROM_MIN 0x800U
#define EFX_ETHTOOL_EEPROM_MAX 0x1800U
/**************************************************************************
*
......
......@@ -2184,19 +2184,20 @@ static void hso_create_rfkill(struct hso_device *hso_dev,
struct usb_interface *interface)
{
struct hso_net *hso_net = dev2net(hso_dev);
struct device *dev = hso_dev->dev;
struct device *dev = &hso_net->net->dev;
char *rfkn;
hso_net->rfkill = rfkill_allocate(&interface_to_usbdev(interface)->dev,
RFKILL_TYPE_WLAN);
RFKILL_TYPE_WWAN);
if (!hso_net->rfkill) {
dev_err(dev, "%s - Out of memory", __func__);
dev_err(dev, "%s - Out of memory\n", __func__);
return;
}
rfkn = kzalloc(20, GFP_KERNEL);
if (!rfkn) {
rfkill_free(hso_net->rfkill);
dev_err(dev, "%s - Out of memory", __func__);
hso_net->rfkill = NULL;
dev_err(dev, "%s - Out of memory\n", __func__);
return;
}
snprintf(rfkn, 20, "hso-%d",
......@@ -2209,7 +2210,8 @@ static void hso_create_rfkill(struct hso_device *hso_dev,
kfree(rfkn);
hso_net->rfkill->name = NULL;
rfkill_free(hso_net->rfkill);
dev_err(dev, "%s - Failed to register rfkill", __func__);
hso_net->rfkill = NULL;
dev_err(dev, "%s - Failed to register rfkill\n", __func__);
return;
}
}
......
menu "Sonics Silicon Backplane"
config SSB_POSSIBLE
bool
depends on HAS_IOMEM && HAS_DMA
default y
menu "Sonics Silicon Backplane"
depends on SSB_POSSIBLE
config SSB
tristate "Sonics Silicon Backplane support"
depends on SSB_POSSIBLE
......
......@@ -427,12 +427,16 @@ static inline int ssb_dma_mapping_error(struct ssb_device *dev, dma_addr_t addr)
{
switch (dev->bus->bustype) {
case SSB_BUSTYPE_PCI:
#ifdef CONFIG_SSB_PCIHOST
return pci_dma_mapping_error(dev->bus->host_pci, addr);
#endif
break;
case SSB_BUSTYPE_SSB:
return dma_mapping_error(dev->dev, addr);
default:
__ssb_dma_not_implemented(dev);
break;
}
__ssb_dma_not_implemented(dev);
return -ENOSYS;
}
......@@ -441,12 +445,16 @@ static inline dma_addr_t ssb_dma_map_single(struct ssb_device *dev, void *p,
{
switch (dev->bus->bustype) {
case SSB_BUSTYPE_PCI:
#ifdef CONFIG_SSB_PCIHOST
return pci_map_single(dev->bus->host_pci, p, size, dir);
#endif
break;
case SSB_BUSTYPE_SSB:
return dma_map_single(dev->dev, p, size, dir);
default:
__ssb_dma_not_implemented(dev);
break;
}
__ssb_dma_not_implemented(dev);
return 0;
}
......@@ -455,14 +463,18 @@ static inline void ssb_dma_unmap_single(struct ssb_device *dev, dma_addr_t dma_a
{
switch (dev->bus->bustype) {
case SSB_BUSTYPE_PCI:
#ifdef CONFIG_SSB_PCIHOST
pci_unmap_single(dev->bus->host_pci, dma_addr, size, dir);
return;
#endif
break;
case SSB_BUSTYPE_SSB:
dma_unmap_single(dev->dev, dma_addr, size, dir);
return;
default:
__ssb_dma_not_implemented(dev);
break;
}
__ssb_dma_not_implemented(dev);
}
static inline void ssb_dma_sync_single_for_cpu(struct ssb_device *dev,
......@@ -472,15 +484,19 @@ static inline void ssb_dma_sync_single_for_cpu(struct ssb_device *dev,
{
switch (dev->bus->bustype) {
case SSB_BUSTYPE_PCI:
#ifdef CONFIG_SSB_PCIHOST
pci_dma_sync_single_for_cpu(dev->bus->host_pci, dma_addr,
size, dir);
return;
#endif
break;
case SSB_BUSTYPE_SSB:
dma_sync_single_for_cpu(dev->dev, dma_addr, size, dir);
return;
default:
__ssb_dma_not_implemented(dev);
break;
}
__ssb_dma_not_implemented(dev);
}
static inline void ssb_dma_sync_single_for_device(struct ssb_device *dev,
......@@ -490,15 +506,19 @@ static inline void ssb_dma_sync_single_for_device(struct ssb_device *dev,
{
switch (dev->bus->bustype) {
case SSB_BUSTYPE_PCI:
#ifdef CONFIG_SSB_PCIHOST
pci_dma_sync_single_for_device(dev->bus->host_pci, dma_addr,
size, dir);
return;
#endif
break;
case SSB_BUSTYPE_SSB:
dma_sync_single_for_device(dev->dev, dma_addr, size, dir);
return;
default:
__ssb_dma_not_implemented(dev);
break;
}
__ssb_dma_not_implemented(dev);
}
static inline void ssb_dma_sync_single_range_for_cpu(struct ssb_device *dev,
......@@ -509,17 +529,21 @@ static inline void ssb_dma_sync_single_range_for_cpu(struct ssb_device *dev,
{
switch (dev->bus->bustype) {
case SSB_BUSTYPE_PCI:
#ifdef CONFIG_SSB_PCIHOST
/* Just sync everything. That's all the PCI API can do. */
pci_dma_sync_single_for_cpu(dev->bus->host_pci, dma_addr,
offset + size, dir);
return;
#endif
break;
case SSB_BUSTYPE_SSB:
dma_sync_single_range_for_cpu(dev->dev, dma_addr, offset,
size, dir);
return;
default:
__ssb_dma_not_implemented(dev);
break;
}
__ssb_dma_not_implemented(dev);
}
static inline void ssb_dma_sync_single_range_for_device(struct ssb_device *dev,
......@@ -530,17 +554,21 @@ static inline void ssb_dma_sync_single_range_for_device(struct ssb_device *dev,
{
switch (dev->bus->bustype) {
case SSB_BUSTYPE_PCI:
#ifdef CONFIG_SSB_PCIHOST
/* Just sync everything. That's all the PCI API can do. */
pci_dma_sync_single_for_device(dev->bus->host_pci, dma_addr,
offset + size, dir);
return;
#endif
break;
case SSB_BUSTYPE_SSB:
dma_sync_single_range_for_device(dev->dev, dma_addr, offset,
size, dir);
return;
default:
__ssb_dma_not_implemented(dev);
break;
}
__ssb_dma_not_implemented(dev);
}
......
......@@ -314,7 +314,7 @@ static int vlandev_seq_show(struct seq_file *seq, void *offset)
dev_info->ingress_priority_map[6],
dev_info->ingress_priority_map[7]);
seq_printf(seq, "EGRESSS priority Mappings: ");
seq_printf(seq, " EGRESS priority mappings: ");
for (i = 0; i < 16; i++) {
const struct vlan_priority_tci_mapping *mp
= dev_info->egress_priority_map[i];
......
......@@ -486,8 +486,8 @@ int skb_recycle_check(struct sk_buff *skb, int skb_size)
shinfo->frag_list = NULL;
memset(skb, 0, offsetof(struct sk_buff, tail));
skb_reset_tail_pointer(skb);
skb->data = skb->head + NET_SKB_PAD;
skb_reset_tail_pointer(skb);
return 1;
}
......
......@@ -10,6 +10,7 @@
#include <linux/list.h>
#include <linux/netdevice.h>
#include <linux/etherdevice.h>
#include <linux/phy.h>
#include "dsa_priv.h"
......@@ -49,11 +50,57 @@ void dsa_slave_mii_bus_init(struct dsa_switch *ds)
/* slave device handling ****************************************************/
static int dsa_slave_open(struct net_device *dev)
{
struct dsa_slave_priv *p = netdev_priv(dev);
struct net_device *master = p->parent->master_netdev;
int err;
if (!(master->flags & IFF_UP))
return -ENETDOWN;
if (compare_ether_addr(dev->dev_addr, master->dev_addr)) {
err = dev_unicast_add(master, dev->dev_addr, ETH_ALEN);
if (err < 0)
goto out;
}
if (dev->flags & IFF_ALLMULTI) {
err = dev_set_allmulti(master, 1);
if (err < 0)
goto del_unicast;
}
if (dev->flags & IFF_PROMISC) {
err = dev_set_promiscuity(master, 1);
if (err < 0)
goto clear_allmulti;
}
return 0;
clear_allmulti:
if (dev->flags & IFF_ALLMULTI)
dev_set_allmulti(master, -1);
del_unicast:
if (compare_ether_addr(dev->dev_addr, master->dev_addr))
dev_unicast_delete(master, dev->dev_addr, ETH_ALEN);
out:
return err;
}
static int dsa_slave_close(struct net_device *dev)
{
struct dsa_slave_priv *p = netdev_priv(dev);
struct net_device *master = p->parent->master_netdev;
dev_mc_unsync(master, dev);
dev_unicast_unsync(master, dev);
if (dev->flags & IFF_ALLMULTI)
dev_set_allmulti(master, -1);
if (dev->flags & IFF_PROMISC)
dev_set_promiscuity(master, -1);
if (compare_ether_addr(dev->dev_addr, master->dev_addr))
dev_unicast_delete(master, dev->dev_addr, ETH_ALEN);
return 0;
}
......@@ -77,9 +124,30 @@ static void dsa_slave_set_rx_mode(struct net_device *dev)
dev_unicast_sync(master, dev);
}
static int dsa_slave_set_mac_address(struct net_device *dev, void *addr)
static int dsa_slave_set_mac_address(struct net_device *dev, void *a)
{
memcpy(dev->dev_addr, addr + 2, 6);
struct dsa_slave_priv *p = netdev_priv(dev);
struct net_device *master = p->parent->master_netdev;
struct sockaddr *addr = a;
int err;
if (!is_valid_ether_addr(addr->sa_data))
return -EADDRNOTAVAIL;
if (!(dev->flags & IFF_UP))
goto out;
if (compare_ether_addr(addr->sa_data, master->dev_addr)) {
err = dev_unicast_add(master, addr->sa_data, ETH_ALEN);
if (err < 0)
return err;
}
if (compare_ether_addr(dev->dev_addr, master->dev_addr))
dev_unicast_delete(master, dev->dev_addr, ETH_ALEN);
out:
memcpy(dev->dev_addr, addr->sa_data, ETH_ALEN);
return 0;
}
......
......@@ -159,6 +159,7 @@ static int dsa_rcv(struct sk_buff *skb, struct net_device *dev,
skb->dev = ds->ports[source_port];
skb_push(skb, ETH_HLEN);
skb->pkt_type = PACKET_HOST;
skb->protocol = eth_type_trans(skb, skb->dev);
skb->dev->last_rx = jiffies;
......
......@@ -178,6 +178,7 @@ static int edsa_rcv(struct sk_buff *skb, struct net_device *dev,
skb->dev = ds->ports[source_port];
skb_push(skb, ETH_HLEN);
skb->pkt_type = PACKET_HOST;
skb->protocol = eth_type_trans(skb, skb->dev);
skb->dev->last_rx = jiffies;
......
......@@ -95,6 +95,7 @@ static int trailer_rcv(struct sk_buff *skb, struct net_device *dev,
skb->dev = ds->ports[source_port];
skb_push(skb, ETH_HLEN);
skb->pkt_type = PACKET_HOST;
skb->protocol = eth_type_trans(skb, skb->dev);
skb->dev->last_rx = jiffies;
......
......@@ -237,43 +237,45 @@ static const struct snmp_mib snmp4_net_list[] = {
SNMP_MIB_SENTINEL
};
static void icmpmsg_put_line(struct seq_file *seq, unsigned long *vals,
unsigned short *type, int count)
{
int j;
if (count) {
seq_printf(seq, "\nIcmpMsg:");
for (j = 0; j < count; ++j)
seq_printf(seq, " %sType%u",
type[j] & 0x100 ? "Out" : "In",
type[j] & 0xff);
seq_printf(seq, "\nIcmpMsg:");
for (j = 0; j < count; ++j)
seq_printf(seq, " %lu", vals[j]);
}
}
static void icmpmsg_put(struct seq_file *seq)
{
#define PERLINE 16
int j, i, count;
static int out[PERLINE];
int i, count;
unsigned short type[PERLINE];
unsigned long vals[PERLINE], val;
struct net *net = seq->private;
count = 0;
for (i = 0; i < ICMPMSG_MIB_MAX; i++) {
if (snmp_fold_field((void **) net->mib.icmpmsg_statistics, i))
out[count++] = i;
if (count < PERLINE)
continue;
seq_printf(seq, "\nIcmpMsg:");
for (j = 0; j < PERLINE; ++j)
seq_printf(seq, " %sType%u", i & 0x100 ? "Out" : "In",
i & 0xff);
seq_printf(seq, "\nIcmpMsg: ");
for (j = 0; j < PERLINE; ++j)
seq_printf(seq, " %lu",
snmp_fold_field((void **) net->mib.icmpmsg_statistics,
out[j]));
seq_putc(seq, '\n');
}
if (count) {
seq_printf(seq, "\nIcmpMsg:");
for (j = 0; j < count; ++j)
seq_printf(seq, " %sType%u", out[j] & 0x100 ? "Out" :
"In", out[j] & 0xff);
seq_printf(seq, "\nIcmpMsg:");
for (j = 0; j < count; ++j)
seq_printf(seq, " %lu", snmp_fold_field((void **)
net->mib.icmpmsg_statistics, out[j]));
val = snmp_fold_field((void **) net->mib.icmpmsg_statistics, i);
if (val) {
type[count] = i;
vals[count++] = val;
}
if (count == PERLINE) {
icmpmsg_put_line(seq, vals, type, count);
count = 0;
}
}
icmpmsg_put_line(seq, vals, type, count);
#undef PERLINE
}
......
......@@ -981,14 +981,15 @@ int __init ip6_mr_init(void)
goto proc_cache_fail;
#endif
return 0;
reg_notif_fail:
kmem_cache_destroy(mrt_cachep);
#ifdef CONFIG_PROC_FS
proc_vif_fail:
unregister_netdevice_notifier(&ip6_mr_notifier);
proc_cache_fail:
proc_net_remove(&init_net, "ip6_mr_vif");
proc_vif_fail:
unregister_netdevice_notifier(&ip6_mr_notifier);
#endif
reg_notif_fail:
del_timer(&ipmr_expire_timer);
kmem_cache_destroy(mrt_cachep);
return err;
}
......
......@@ -3188,6 +3188,7 @@ static struct xfrm_policy *pfkey_compile_policy(struct sock *sk, int opt,
return xp;
out:
xp->walk.dead = 1;
xfrm_policy_destroy(xp);
return NULL;
}
......
......@@ -199,7 +199,7 @@ static ssize_t sta_agg_status_write(struct file *file,
/* toggle Rx aggregation command */
tid_num = tid_num - 100;
if (tid_static_rx[tid_num] == 1) {
strcpy(state, "off ");
strcpy(state, "off");
ieee80211_sta_stop_rx_ba_session(sta->sdata, da, tid_num, 0,
WLAN_REASON_QSTA_REQUIRE_SETUP);
sta->ampdu_mlme.tid_state_rx[tid_num] |=
......
......@@ -713,7 +713,8 @@ ip_vs_tunnel_xmit_v6(struct sk_buff *skb, struct ip_vs_conn *cp,
iph = ipv6_hdr(skb);
iph->version = 6;
iph->nexthdr = IPPROTO_IPV6;
iph->payload_len = old_iph->payload_len + sizeof(old_iph);
iph->payload_len = old_iph->payload_len;
be16_add_cpu(&iph->payload_len, sizeof(*old_iph));
iph->priority = old_iph->priority;
memset(&iph->flow_lbl, 0, sizeof(iph->flow_lbl));
iph->daddr = rt->rt6i_dst.addr;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment