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:
  smc91x: let smc91x work well under netpoll
  pxaficp-ir: remove incorrect net_device_ops
  NET: llc, zero sockaddr_llc struct
  drivers/net: fixed drivers that support netpoll use ndo_start_xmit()
  netpoll: warning for ndo_start_xmit returns with interrupts enabled
  net: Fix Micrel KSZ8842 Kconfig description
  netfilter: xt_quota: fix wrong return value (error case)
  ipv6: Fix commit 63d9950 (ipv6: Make v4-mapped bindings consistent with IPv4)
  E100: fix interaction with swiotlb on X86.
  pkt_sched: Convert CBQ to tasklet_hrtimer.
  pkt_sched: Convert qdisc_watchdog to tasklet_hrtimer
  rtl8187: always set MSR_LINK_ENEDCA flag with RTL8187B
  ibm_newemac: emac_close() needs to call netif_carrier_off()
  net: fix ks8851 build errors
  net: Rename MAC platform driver for w90p910 platform
  yellowfin: Fix buffer underrun after dev_alloc_skb() failure
  orinoco: correct key bounds check in orinoco_hw_get_tkip_iv
  mac80211: fix todo lock
  • Loading branch information
torvalds committed Aug 24, 2009
2 parents ce0cfd4 + 8ff499e commit 1cac6ec
Show file tree
Hide file tree
Showing 21 changed files with 117 additions and 80 deletions.
4 changes: 3 additions & 1 deletion drivers/net/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -1727,12 +1727,14 @@ config KS8842
tristate "Micrel KSZ8842"
depends on HAS_IOMEM
help
This platform driver is for Micrel KSZ8842 chip.
This platform driver is for Micrel KSZ8842 / KS8842
2-port ethernet switch chip (managed, VLAN, QoS).

config KS8851
tristate "Micrel KS8851 SPI"
depends on SPI
select MII
select CRC32
help
SPI driver for Micrel KS8851 SPI attached network chip.

Expand Down
4 changes: 2 additions & 2 deletions drivers/net/arm/w90p910_ether.c
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ static struct platform_driver w90p910_ether_driver = {
.probe = w90p910_ether_probe,
.remove = __devexit_p(w90p910_ether_remove),
.driver = {
.name = "w90p910-emc",
.name = "nuc900-emc",
.owner = THIS_MODULE,
},
};
Expand All @@ -1101,5 +1101,5 @@ module_exit(w90p910_ether_exit);
MODULE_AUTHOR("Wan ZongShun <mcuos.com@gmail.com>");
MODULE_DESCRIPTION("w90p910 MAC driver!");
MODULE_LICENSE("GPL");
MODULE_ALIAS("platform:w90p910-emc");
MODULE_ALIAS("platform:nuc900-emc");

2 changes: 1 addition & 1 deletion drivers/net/e100.c
Original file line number Diff line number Diff line change
Expand Up @@ -1899,7 +1899,7 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx,
nic->ru_running = RU_SUSPENDED;
pci_dma_sync_single_for_device(nic->pdev, rx->dma_addr,
sizeof(struct rfd),
PCI_DMA_BIDIRECTIONAL);
PCI_DMA_FROMDEVICE);
return -ENODATA;
}

Expand Down
5 changes: 3 additions & 2 deletions drivers/net/fec_mpc52xx.c
Original file line number Diff line number Diff line change
Expand Up @@ -309,14 +309,15 @@ static int mpc52xx_fec_start_xmit(struct sk_buff *skb, struct net_device *dev)
{
struct mpc52xx_fec_priv *priv = netdev_priv(dev);
struct bcom_fec_bd *bd;
unsigned long flags;

if (bcom_queue_full(priv->tx_dmatsk)) {
if (net_ratelimit())
dev_err(&dev->dev, "transmit queue overrun\n");
return NETDEV_TX_BUSY;
}

spin_lock_irq(&priv->lock);
spin_lock_irqsave(&priv->lock, flags);
dev->trans_start = jiffies;

bd = (struct bcom_fec_bd *)
Expand All @@ -332,7 +333,7 @@ static int mpc52xx_fec_start_xmit(struct sk_buff *skb, struct net_device *dev)
netif_stop_queue(dev);
}

spin_unlock_irq(&priv->lock);
spin_unlock_irqrestore(&priv->lock, flags);

return NETDEV_TX_OK;
}
Expand Down
2 changes: 2 additions & 0 deletions drivers/net/ibm_newemac/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1305,6 +1305,8 @@ static int emac_close(struct net_device *ndev)

free_irq(dev->emac_irq, dev);

netif_carrier_off(ndev);

return 0;
}

Expand Down
4 changes: 1 addition & 3 deletions drivers/net/irda/pxaficp_ir.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,9 +803,6 @@ static const struct net_device_ops pxa_irda_netdev_ops = {
.ndo_stop = pxa_irda_stop,
.ndo_start_xmit = pxa_irda_hard_xmit,
.ndo_do_ioctl = pxa_irda_ioctl,
.ndo_change_mtu = eth_change_mtu,
.ndo_validate_addr = eth_validate_addr,
.ndo_set_mac_address = eth_mac_addr,
};

static int pxa_irda_probe(struct platform_device *pdev)
Expand All @@ -830,6 +827,7 @@ static int pxa_irda_probe(struct platform_device *pdev)
if (!dev)
goto err_mem_3;

SET_NETDEV_DEV(dev, &pdev->dev);
si = netdev_priv(dev);
si->dev = &pdev->dev;
si->pdata = pdev->dev.platform_data;
Expand Down
5 changes: 3 additions & 2 deletions drivers/net/ixp2000/ixpdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ static int ixpdev_xmit(struct sk_buff *skb, struct net_device *dev)
struct ixpdev_priv *ip = netdev_priv(dev);
struct ixpdev_tx_desc *desc;
int entry;
unsigned long flags;

if (unlikely(skb->len > PAGE_SIZE)) {
/* @@@ Count drops. */
Expand All @@ -63,11 +64,11 @@ static int ixpdev_xmit(struct sk_buff *skb, struct net_device *dev)

dev->trans_start = jiffies;

local_irq_disable();
local_irq_save(flags);
ip->tx_queue_entries++;
if (ip->tx_queue_entries == TX_BUF_COUNT_PER_CHAN)
netif_stop_queue(dev);
local_irq_enable();
local_irq_restore(flags);

return 0;
}
Expand Down
7 changes: 4 additions & 3 deletions drivers/net/macb.c
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev)
dma_addr_t mapping;
unsigned int len, entry;
u32 ctrl;
unsigned long flags;

#ifdef DEBUG
int i;
Expand All @@ -635,12 +636,12 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev)
#endif

len = skb->len;
spin_lock_irq(&bp->lock);
spin_lock_irqsave(&bp->lock, flags);

/* This is a hard error, log it. */
if (TX_BUFFS_AVAIL(bp) < 1) {
netif_stop_queue(dev);
spin_unlock_irq(&bp->lock);
spin_unlock_irqrestore(&bp->lock, flags);
dev_err(&bp->pdev->dev,
"BUG! Tx Ring full when queue awake!\n");
dev_dbg(&bp->pdev->dev, "tx_head = %u, tx_tail = %u\n",
Expand Down Expand Up @@ -674,7 +675,7 @@ static int macb_start_xmit(struct sk_buff *skb, struct net_device *dev)
if (TX_BUFFS_AVAIL(bp) < 1)
netif_stop_queue(dev);

spin_unlock_irq(&bp->lock);
spin_unlock_irqrestore(&bp->lock, flags);

dev->trans_start = jiffies;

Expand Down
5 changes: 3 additions & 2 deletions drivers/net/mlx4/en_tx.c
Original file line number Diff line number Diff line change
Expand Up @@ -437,6 +437,7 @@ static inline void mlx4_en_xmit_poll(struct mlx4_en_priv *priv, int tx_ind)
{
struct mlx4_en_cq *cq = &priv->tx_cq[tx_ind];
struct mlx4_en_tx_ring *ring = &priv->tx_ring[tx_ind];
unsigned long flags;

/* If we don't have a pending timer, set one up to catch our recent
post in case the interface becomes idle */
Expand All @@ -445,9 +446,9 @@ static inline void mlx4_en_xmit_poll(struct mlx4_en_priv *priv, int tx_ind)

/* Poll the CQ every mlx4_en_TX_MODER_POLL packets */
if ((++ring->poll_cnt & (MLX4_EN_TX_POLL_MODER - 1)) == 0)
if (spin_trylock_irq(&ring->comp_lock)) {
if (spin_trylock_irqsave(&ring->comp_lock, flags)) {
mlx4_en_process_tx_cq(priv->dev, cq);
spin_unlock_irq(&ring->comp_lock);
spin_unlock_irqrestore(&ring->comp_lock, flags);
}
}

Expand Down
40 changes: 22 additions & 18 deletions drivers/net/smc91x.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,21 +196,23 @@ static void PRINT_PKT(u_char *buf, int length)
/* this enables an interrupt in the interrupt mask register */
#define SMC_ENABLE_INT(lp, x) do { \
unsigned char mask; \
spin_lock_irq(&lp->lock); \
unsigned long smc_enable_flags; \
spin_lock_irqsave(&lp->lock, smc_enable_flags); \
mask = SMC_GET_INT_MASK(lp); \
mask |= (x); \
SMC_SET_INT_MASK(lp, mask); \
spin_unlock_irq(&lp->lock); \
spin_unlock_irqrestore(&lp->lock, smc_enable_flags); \
} while (0)

/* this disables an interrupt from the interrupt mask register */
#define SMC_DISABLE_INT(lp, x) do { \
unsigned char mask; \
spin_lock_irq(&lp->lock); \
unsigned long smc_disable_flags; \
spin_lock_irqsave(&lp->lock, smc_disable_flags); \
mask = SMC_GET_INT_MASK(lp); \
mask &= ~(x); \
SMC_SET_INT_MASK(lp, mask); \
spin_unlock_irq(&lp->lock); \
spin_unlock_irqrestore(&lp->lock, smc_disable_flags); \
} while (0)

/*
Expand Down Expand Up @@ -520,21 +522,21 @@ static inline void smc_rcv(struct net_device *dev)
* any other concurrent access and C would always interrupt B. But life
* isn't that easy in a SMP world...
*/
#define smc_special_trylock(lock) \
#define smc_special_trylock(lock, flags) \
({ \
int __ret; \
local_irq_disable(); \
local_irq_save(flags); \
__ret = spin_trylock(lock); \
if (!__ret) \
local_irq_enable(); \
local_irq_restore(flags); \
__ret; \
})
#define smc_special_lock(lock) spin_lock_irq(lock)
#define smc_special_unlock(lock) spin_unlock_irq(lock)
#define smc_special_lock(lock, flags) spin_lock_irq(lock, flags)
#define smc_special_unlock(lock, flags) spin_unlock_irqrestore(lock, flags)
#else
#define smc_special_trylock(lock) (1)
#define smc_special_lock(lock) do { } while (0)
#define smc_special_unlock(lock) do { } while (0)
#define smc_special_trylock(lock, flags) (1)
#define smc_special_lock(lock, flags) do { } while (0)
#define smc_special_unlock(lock, flags) do { } while (0)
#endif

/*
Expand All @@ -548,18 +550,19 @@ static void smc_hardware_send_pkt(unsigned long data)
struct sk_buff *skb;
unsigned int packet_no, len;
unsigned char *buf;
unsigned long flags;

DBG(3, "%s: %s\n", dev->name, __func__);

if (!smc_special_trylock(&lp->lock)) {
if (!smc_special_trylock(&lp->lock, flags)) {
netif_stop_queue(dev);
tasklet_schedule(&lp->tx_task);
return;
}

skb = lp->pending_tx_skb;
if (unlikely(!skb)) {
smc_special_unlock(&lp->lock);
smc_special_unlock(&lp->lock, flags);
return;
}
lp->pending_tx_skb = NULL;
Expand All @@ -569,7 +572,7 @@ static void smc_hardware_send_pkt(unsigned long data)
printk("%s: Memory allocation failed.\n", dev->name);
dev->stats.tx_errors++;
dev->stats.tx_fifo_errors++;
smc_special_unlock(&lp->lock);
smc_special_unlock(&lp->lock, flags);
goto done;
}

Expand Down Expand Up @@ -608,7 +611,7 @@ static void smc_hardware_send_pkt(unsigned long data)

/* queue the packet for TX */
SMC_SET_MMU_CMD(lp, MC_ENQUEUE);
smc_special_unlock(&lp->lock);
smc_special_unlock(&lp->lock, flags);

dev->trans_start = jiffies;
dev->stats.tx_packets++;
Expand All @@ -633,6 +636,7 @@ static int smc_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
struct smc_local *lp = netdev_priv(dev);
void __iomem *ioaddr = lp->base;
unsigned int numPages, poll_count, status;
unsigned long flags;

DBG(3, "%s: %s\n", dev->name, __func__);

Expand All @@ -658,7 +662,7 @@ static int smc_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
return 0;
}

smc_special_lock(&lp->lock);
smc_special_lock(&lp->lock, flags);

/* now, try to allocate the memory */
SMC_SET_MMU_CMD(lp, MC_ALLOC | numPages);
Expand All @@ -676,7 +680,7 @@ static int smc_hard_start_xmit(struct sk_buff *skb, struct net_device *dev)
}
} while (--poll_count);

smc_special_unlock(&lp->lock);
smc_special_unlock(&lp->lock, flags);

lp->pending_tx_skb = skb;
if (!poll_count) {
Expand Down
2 changes: 1 addition & 1 deletion drivers/net/wireless/orinoco/hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ int orinoco_hw_get_tkip_iv(struct orinoco_private *priv, int key, u8 *tsc)
int err = 0;
u8 tsc_arr[4][IW_ENCODE_SEQ_MAX_SIZE];

if ((key < 0) || (key > 4))
if ((key < 0) || (key >= 4))
return -EINVAL;

err = hermes_read_ltv(hw, USER_BAP, HERMES_RID_CURRENT_TKIP_IV,
Expand Down
14 changes: 10 additions & 4 deletions drivers/net/wireless/rtl818x/rtl8187_dev.c
Original file line number Diff line number Diff line change
Expand Up @@ -869,6 +869,9 @@ static int rtl8187b_init_hw(struct ieee80211_hw *dev)
priv->aifsn[3] = 3; /* AIFSN[AC_BE] */
rtl818x_iowrite8(priv, &priv->map->ACM_CONTROL, 0);

/* ENEDCA flag must always be set, transmit issues? */
rtl818x_iowrite8(priv, &priv->map->MSR, RTL818X_MSR_ENEDCA);

return 0;
}

Expand Down Expand Up @@ -1173,13 +1176,16 @@ static void rtl8187_bss_info_changed(struct ieee80211_hw *dev,
rtl818x_iowrite8(priv, &priv->map->BSSID[i],
info->bssid[i]);

if (priv->is_rtl8187b)
reg = RTL818X_MSR_ENEDCA;
else
reg = 0;

if (is_valid_ether_addr(info->bssid)) {
reg = RTL818X_MSR_INFRA;
if (priv->is_rtl8187b)
reg |= RTL818X_MSR_ENEDCA;
reg |= RTL818X_MSR_INFRA;
rtl818x_iowrite8(priv, &priv->map->MSR, reg);
} else {
reg = RTL818X_MSR_NO_LINK;
reg |= RTL818X_MSR_NO_LINK;
rtl818x_iowrite8(priv, &priv->map->MSR, reg);
}

Expand Down
Loading

0 comments on commit 1cac6ec

Please sign in to comment.