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: (40 commits)
  pxa168_eth: fix race in transmit path.
  ipv4, ping: Remove duplicate icmp.h include
  netxen: fix race in skb->len access
  sgi-xp: fix a use after free
  hp100: fix an skb->len race
  netpoll: copy dev name of slaves to struct netpoll
  ipv4: fix multicast losses
  r8169: fix static initializers.
  inet_diag: fix inet_diag_bc_audit()
  gigaset: call module_put before restart of if_open()
  farsync: add module_put to error path in fst_open()
  net: rfs: enable RFS before first data packet is received
  fs_enet: fix freescale FCC ethernet dp buffer alignment
  netdev: bfin_mac: fix memory leak when freeing dma descriptors
  vlan: don't call ndo_vlan_rx_register on hardware that doesn't have vlan support
  caif: Bugfix - XOFF removed channel from caif-mux
  tun: teach the tun/tap driver to support netpoll
  dp83640: drop PHY status frames in the driver.
  dp83640: fix phy status frame event parsing
  phylib: Allow BCM63XX PHY to be selected only on BCM63XX.
  ...
  • Loading branch information
Linus Torvalds committed Jun 21, 2011
2 parents 3669820 + 3844204 commit 6e158d2
Show file tree
Hide file tree
Showing 48 changed files with 563 additions and 77 deletions.
3 changes: 1 addition & 2 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -2291,8 +2291,7 @@ F: drivers/scsi/eata_pio.*

EBTABLES
M: Bart De Schuymer <bart.de.schuymer@pandora.be>
L: ebtables-user@lists.sourceforge.net
L: ebtables-devel@lists.sourceforge.net
L: netfilter-devel@vger.kernel.org
W: http://ebtables.sourceforge.net/
S: Maintained
F: include/linux/netfilter_bridge/ebt_*.h
Expand Down
12 changes: 12 additions & 0 deletions drivers/bluetooth/btmrvl_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@ static ssize_t btmrvl_hscfgcmd_write(struct file *file,
return -EFAULT;

ret = strict_strtol(buf, 10, &result);
if (ret)
return ret;

priv->btmrvl_dev.hscfgcmd = result;

Expand Down Expand Up @@ -108,6 +110,8 @@ static ssize_t btmrvl_psmode_write(struct file *file, const char __user *ubuf,
return -EFAULT;

ret = strict_strtol(buf, 10, &result);
if (ret)
return ret;

priv->btmrvl_dev.psmode = result;

Expand Down Expand Up @@ -147,6 +151,8 @@ static ssize_t btmrvl_pscmd_write(struct file *file, const char __user *ubuf,
return -EFAULT;

ret = strict_strtol(buf, 10, &result);
if (ret)
return ret;

priv->btmrvl_dev.pscmd = result;

Expand Down Expand Up @@ -191,6 +197,8 @@ static ssize_t btmrvl_gpiogap_write(struct file *file, const char __user *ubuf,
return -EFAULT;

ret = strict_strtol(buf, 16, &result);
if (ret)
return ret;

priv->btmrvl_dev.gpio_gap = result;

Expand Down Expand Up @@ -230,6 +238,8 @@ static ssize_t btmrvl_hscmd_write(struct file *file, const char __user *ubuf,
return -EFAULT;

ret = strict_strtol(buf, 10, &result);
if (ret)
return ret;

priv->btmrvl_dev.hscmd = result;
if (priv->btmrvl_dev.hscmd) {
Expand Down Expand Up @@ -272,6 +282,8 @@ static ssize_t btmrvl_hsmode_write(struct file *file, const char __user *ubuf,
return -EFAULT;

ret = strict_strtol(buf, 10, &result);
if (ret)
return ret;

priv->btmrvl_dev.hsmode = result;

Expand Down
4 changes: 3 additions & 1 deletion drivers/isdn/gigaset/interface.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,10 @@ static int if_open(struct tty_struct *tty, struct file *filp)
if (!cs || !try_module_get(cs->driver->owner))
return -ENODEV;

if (mutex_lock_interruptible(&cs->mutex))
if (mutex_lock_interruptible(&cs->mutex)) {
module_put(cs->driver->owner);
return -ERESTARTSYS;
}
tty->driver_data = cs;

++cs->open_count;
Expand Down
6 changes: 3 additions & 3 deletions drivers/misc/sgi-xp/xpnet.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,14 +495,14 @@ xpnet_dev_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
}
}

dev->stats.tx_packets++;
dev->stats.tx_bytes += skb->len;

if (atomic_dec_return(&queued_msg->use_count) == 0) {
dev_kfree_skb(skb);
kfree(queued_msg);
}

dev->stats.tx_packets++;
dev->stats.tx_bytes += skb->len;

return NETDEV_TX_OK;
}

Expand Down
3 changes: 2 additions & 1 deletion drivers/net/3c503.c
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ el2_open(struct net_device *dev)
outb_p(0x04 << ((*irqp == 9) ? 2 : *irqp), E33G_IDCFR);
outb_p(0x00, E33G_IDCFR);
msleep(1);
free_irq(*irqp, el2_probe_interrupt);
free_irq(*irqp, &seen);
if (!seen)
continue;

Expand All @@ -422,6 +422,7 @@ el2_open(struct net_device *dev)
continue;
if (retval < 0)
goto err_disable;
break;
} while (*++irqp);

if (*irqp == 0) {
Expand Down
20 changes: 10 additions & 10 deletions drivers/net/bfin_mac.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,13 @@ MODULE_DESCRIPTION(DRV_DESC);
MODULE_ALIAS("platform:bfin_mac");

#if defined(CONFIG_BFIN_MAC_USE_L1)
# define bfin_mac_alloc(dma_handle, size) l1_data_sram_zalloc(size)
# define bfin_mac_free(dma_handle, ptr) l1_data_sram_free(ptr)
# define bfin_mac_alloc(dma_handle, size, num) l1_data_sram_zalloc(size*num)
# define bfin_mac_free(dma_handle, ptr, num) l1_data_sram_free(ptr)
#else
# define bfin_mac_alloc(dma_handle, size) \
dma_alloc_coherent(NULL, size, dma_handle, GFP_KERNEL)
# define bfin_mac_free(dma_handle, ptr) \
dma_free_coherent(NULL, sizeof(*ptr), ptr, dma_handle)
# define bfin_mac_alloc(dma_handle, size, num) \
dma_alloc_coherent(NULL, size*num, dma_handle, GFP_KERNEL)
# define bfin_mac_free(dma_handle, ptr, num) \
dma_free_coherent(NULL, sizeof(*ptr)*num, ptr, dma_handle)
#endif

#define PKT_BUF_SZ 1580
Expand Down Expand Up @@ -95,7 +95,7 @@ static void desc_list_free(void)
t = t->next;
}
}
bfin_mac_free(dma_handle, tx_desc);
bfin_mac_free(dma_handle, tx_desc, CONFIG_BFIN_TX_DESC_NUM);
}

if (rx_desc) {
Expand All @@ -109,7 +109,7 @@ static void desc_list_free(void)
r = r->next;
}
}
bfin_mac_free(dma_handle, rx_desc);
bfin_mac_free(dma_handle, rx_desc, CONFIG_BFIN_RX_DESC_NUM);
}
}

Expand All @@ -126,13 +126,13 @@ static int desc_list_init(void)
#endif

tx_desc = bfin_mac_alloc(&dma_handle,
sizeof(struct net_dma_desc_tx) *
sizeof(struct net_dma_desc_tx),
CONFIG_BFIN_TX_DESC_NUM);
if (tx_desc == NULL)
goto init_error;

rx_desc = bfin_mac_alloc(&dma_handle,
sizeof(struct net_dma_desc_rx) *
sizeof(struct net_dma_desc_rx),
CONFIG_BFIN_RX_DESC_NUM);
if (rx_desc == NULL)
goto init_error;
Expand Down
1 change: 1 addition & 0 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1297,6 +1297,7 @@ static inline int slave_enable_netpoll(struct slave *slave)
goto out;

np->dev = slave->dev;
strlcpy(np->dev_name, slave->dev->name, IFNAMSIZ);
err = __netpoll_setup(np);
if (err) {
kfree(np);
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/fs_enet/mac-fcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ static int do_pd_setup(struct fs_enet_private *fep)
goto out_ep;

fep->fcc.mem = (void __iomem *)cpm2_immr;
fpi->dpram_offset = cpm_dpalloc(128, 8);
fpi->dpram_offset = cpm_dpalloc(128, 32);
if (IS_ERR_VALUE(fpi->dpram_offset)) {
ret = fpi->dpram_offset;
goto out_fcccp;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/hp100.c
Original file line number Diff line number Diff line change
Expand Up @@ -1580,12 +1580,12 @@ static netdev_tx_t hp100_start_xmit_bm(struct sk_buff *skb,
hp100_outl(ringptr->pdl_paddr, TX_PDA_L); /* Low Prio. Queue */

lp->txrcommit++;
spin_unlock_irqrestore(&lp->lock, flags);

/* Update statistics */
dev->stats.tx_packets++;
dev->stats.tx_bytes += skb->len;

spin_unlock_irqrestore(&lp->lock, flags);

return NETDEV_TX_OK;

drop:
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/hplance.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ static void __devexit hplance_remove_one(struct dio_dev *d)
}

/* Initialise a single lance board at the given DIO device */
static void __init hplance_init(struct net_device *dev, struct dio_dev *d)
static void __devinit hplance_init(struct net_device *dev, struct dio_dev *d)
{
unsigned long va = (d->resource.start + DIO_VIRADDRBASE);
struct hplance_private *lp;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/netxen/netxen_nic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1965,11 +1965,11 @@ netxen_nic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)

netxen_tso_check(netdev, tx_ring, first_desc, skb);

netxen_nic_update_cmd_producer(adapter, tx_ring);

adapter->stats.txbytes += skb->len;
adapter->stats.xmitcalled++;

netxen_nic_update_cmd_producer(adapter, tx_ring);

return NETDEV_TX_OK;

drop_packet:
Expand Down
1 change: 1 addition & 0 deletions drivers/net/phy/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ config BROADCOM_PHY

config BCM63XX_PHY
tristate "Drivers for Broadcom 63xx SOCs internal PHY"
depends on BCM63XX
---help---
Currently supports the 6348 and 6358 PHYs.

Expand Down
24 changes: 17 additions & 7 deletions drivers/net/phy/dp83640.c
Original file line number Diff line number Diff line change
Expand Up @@ -543,11 +543,20 @@ static void recalibrate(struct dp83640_clock *clock)

/* time stamping methods */

static void decode_evnt(struct dp83640_private *dp83640,
struct phy_txts *phy_txts, u16 ests)
static int decode_evnt(struct dp83640_private *dp83640,
void *data, u16 ests)
{
struct phy_txts *phy_txts;
struct ptp_clock_event event;
int words = (ests >> EVNT_TS_LEN_SHIFT) & EVNT_TS_LEN_MASK;
u16 ext_status = 0;

if (ests & MULT_EVNT) {
ext_status = *(u16 *) data;
data += sizeof(ext_status);
}

phy_txts = data;

switch (words) { /* fall through in every case */
case 3:
Expand All @@ -565,6 +574,9 @@ static void decode_evnt(struct dp83640_private *dp83640,
event.timestamp = phy2txts(&dp83640->edata);

ptp_clock_event(dp83640->clock->ptp_clock, &event);

words = ext_status ? words + 2 : words + 1;
return words * sizeof(u16);
}

static void decode_rxts(struct dp83640_private *dp83640,
Expand Down Expand Up @@ -643,9 +655,7 @@ static void decode_status_frame(struct dp83640_private *dp83640,

} else if (PSF_EVNT == type && len >= sizeof(*phy_txts)) {

phy_txts = (struct phy_txts *) ptr;
decode_evnt(dp83640, phy_txts, ests);
size = sizeof(*phy_txts);
size = decode_evnt(dp83640, ptr, ests);

} else {
size = 0;
Expand Down Expand Up @@ -1034,8 +1044,8 @@ static bool dp83640_rxtstamp(struct phy_device *phydev,

if (is_status_frame(skb, type)) {
decode_status_frame(dp83640, skb);
/* Let the stack drop this frame. */
return false;
kfree_skb(skb);
return true;
}

SKB_PTP_TYPE(skb) = type;
Expand Down
4 changes: 2 additions & 2 deletions drivers/net/ppp_async.c
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ static void ppp_async_process(unsigned long arg)
#define PUT_BYTE(ap, buf, c, islcp) do { \
if ((islcp && c < 0x20) || (ap->xaccm[c >> 5] & (1 << (c & 0x1f)))) {\
*buf++ = PPP_ESCAPE; \
*buf++ = c ^ 0x20; \
*buf++ = c ^ PPP_TRANS; \
} else \
*buf++ = c; \
} while (0)
Expand Down Expand Up @@ -896,7 +896,7 @@ ppp_async_input(struct asyncppp *ap, const unsigned char *buf,
sp = skb_put(skb, n);
memcpy(sp, buf, n);
if (ap->state & SC_ESCAPE) {
sp[0] ^= 0x20;
sp[0] ^= PPP_TRANS;
ap->state &= ~SC_ESCAPE;
}
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/pxa168_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1273,7 +1273,7 @@ static int pxa168_eth_start_xmit(struct sk_buff *skb, struct net_device *dev)
wmb();
wrl(pep, SDMA_CMD, SDMA_CMD_TXDH | SDMA_CMD_ERD);

stats->tx_bytes += skb->len;
stats->tx_bytes += length;
stats->tx_packets++;
dev->trans_start = jiffies;
if (pep->tx_ring_size - pep->tx_desc_count <= 1) {
Expand Down
10 changes: 6 additions & 4 deletions drivers/net/r8169.c
Original file line number Diff line number Diff line change
Expand Up @@ -1621,7 +1621,7 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp,
*
* (RTL_R32(TxConfig) & 0x700000) == 0x200000 ? 8101Eb : 8101Ec
*/
static const struct {
static const struct rtl_mac_info {
u32 mask;
u32 val;
int mac_version;
Expand Down Expand Up @@ -1689,7 +1689,8 @@ static void rtl8169_get_mac_version(struct rtl8169_private *tp,

/* Catch-all */
{ 0x00000000, 0x00000000, RTL_GIGA_MAC_NONE }
}, *p = mac_info;
};
const struct rtl_mac_info *p = mac_info;
u32 reg;

reg = RTL_R32(TxConfig);
Expand Down Expand Up @@ -3681,7 +3682,7 @@ static void rtl_set_rx_max_size(void __iomem *ioaddr, unsigned int rx_buf_sz)

static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version)
{
static const struct {
static const struct rtl_cfg2_info {
u32 mac_version;
u32 clk;
u32 val;
Expand All @@ -3690,7 +3691,8 @@ static void rtl8169_set_magic_reg(void __iomem *ioaddr, unsigned mac_version)
{ RTL_GIGA_MAC_VER_05, PCI_Clock_66MHz, 0x000fffff },
{ RTL_GIGA_MAC_VER_06, PCI_Clock_33MHz, 0x00ffff00 }, // 8110SCe
{ RTL_GIGA_MAC_VER_06, PCI_Clock_66MHz, 0x00ffffff }
}, *p = cfg2_info;
};
const struct rtl_cfg2_info *p = cfg2_info;
unsigned int i;
u32 clk;

Expand Down
24 changes: 23 additions & 1 deletion drivers/net/tun.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,14 +460,33 @@ static u32 tun_net_fix_features(struct net_device *dev, u32 features)

return (features & tun->set_features) | (features & ~TUN_USER_FEATURES);
}

#ifdef CONFIG_NET_POLL_CONTROLLER
static void tun_poll_controller(struct net_device *dev)
{
/*
* Tun only receives frames when:
* 1) the char device endpoint gets data from user space
* 2) the tun socket gets a sendmsg call from user space
* Since both of those are syncronous operations, we are guaranteed
* never to have pending data when we poll for it
* so theres nothing to do here but return.
* We need this though so netpoll recognizes us as an interface that
* supports polling, which enables bridge devices in virt setups to
* still use netconsole
*/
return;
}
#endif
static const struct net_device_ops tun_netdev_ops = {
.ndo_uninit = tun_net_uninit,
.ndo_open = tun_net_open,
.ndo_stop = tun_net_close,
.ndo_start_xmit = tun_net_xmit,
.ndo_change_mtu = tun_net_change_mtu,
.ndo_fix_features = tun_net_fix_features,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = tun_poll_controller,
#endif
};

static const struct net_device_ops tap_netdev_ops = {
Expand All @@ -480,6 +499,9 @@ static const struct net_device_ops tap_netdev_ops = {
.ndo_set_multicast_list = tun_net_mclist,
.ndo_set_mac_address = eth_mac_addr,
.ndo_validate_addr = eth_validate_addr,
#ifdef CONFIG_NET_POLL_CONTROLLER
.ndo_poll_controller = tun_poll_controller,
#endif
};

/* Initialize net device. */
Expand Down
Loading

0 comments on commit 6e158d2

Please sign in to comment.