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:
  bnx2: Fix bnx2_netif_stop() merge error.
  gianfar: Fix bit definitions of IMASK_GRSC and IMASK_GTSC
  gianfar: Fix stats support
  gianfar: Fix a filer bug
  bnx2: fixing a timout error due not refreshing TX timers correctly
  can/at91: don't check platform_get_irq's return value against zero
  mISDN: use DECLARE_COMPLETION_ONSTACK for non-constant completion
  bnx2: reset_task is crashing the kernel. Fixing it.
  ipv6: fix an oops when force unload ipv6 module
  TI DaVinci EMAC: Fix MDIO bus frequency configuration
  e100: Fix broken cbs accounting due to missing memset.
  broadcom: bcm54xx_shadow_read() errors ignored in bcm54xx_adjust_rxrefclk()
  e1000e: LED settings in EEPROM ignored on 82571 and 82572
  netxen: use module parameter correctly
  netns: fix net.ipv6.route.gc_min_interval_ms in netns
  Bluetooth: Prevent ill-timed autosuspend in USB driver
  Bluetooth: Fix L2CAP locking scheme regression
  Bluetooth: Ack L2CAP I-frames before retransmit missing packet
  Bluetooth: Fix unset of RemoteBusy flag for L2CAP
  Bluetooth: Fix PTR_ERR return of wrong pointer in hidp_setup_hid()
This commit is contained in:
Linus Torvalds 2009-12-21 10:12:25 -08:00
commit 292be57e15
15 changed files with 86 additions and 80 deletions

View file

@ -307,6 +307,7 @@ static void btusb_bulk_complete(struct urb *urb)
return; return;
usb_anchor_urb(urb, &data->bulk_anchor); usb_anchor_urb(urb, &data->bulk_anchor);
usb_mark_last_busy(data->udev);
err = usb_submit_urb(urb, GFP_ATOMIC); err = usb_submit_urb(urb, GFP_ATOMIC);
if (err < 0) { if (err < 0) {

View file

@ -661,7 +661,7 @@ l1oip_socket_thread(void *data)
size_t recvbuf_size = 1500; size_t recvbuf_size = 1500;
int recvlen; int recvlen;
struct socket *socket = NULL; struct socket *socket = NULL;
DECLARE_COMPLETION(wait); DECLARE_COMPLETION_ONSTACK(wait);
/* allocate buffer memory */ /* allocate buffer memory */
recvbuf = kmalloc(recvbuf_size, GFP_KERNEL); recvbuf = kmalloc(recvbuf_size, GFP_KERNEL);

View file

@ -653,12 +653,20 @@ static void
bnx2_netif_stop(struct bnx2 *bp) bnx2_netif_stop(struct bnx2 *bp)
{ {
bnx2_cnic_stop(bp); bnx2_cnic_stop(bp);
bnx2_disable_int_sync(bp);
if (netif_running(bp->dev)) { if (netif_running(bp->dev)) {
int i;
bnx2_napi_disable(bp); bnx2_napi_disable(bp);
netif_tx_disable(bp->dev); netif_tx_disable(bp->dev);
bp->dev->trans_start = jiffies; /* prevent tx timeout */ /* prevent tx timeout */
for (i = 0; i < bp->dev->num_tx_queues; i++) {
struct netdev_queue *txq;
txq = netdev_get_tx_queue(bp->dev, i);
txq->trans_start = jiffies;
}
} }
bnx2_disable_int_sync(bp);
} }
static void static void

View file

@ -1037,7 +1037,7 @@ static int __init at91_can_probe(struct platform_device *pdev)
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irq = platform_get_irq(pdev, 0); irq = platform_get_irq(pdev, 0);
if (!res || !irq) { if (!res || irq <= 0) {
err = -ENODEV; err = -ENODEV;
goto exit_put; goto exit_put;
} }

View file

@ -2272,7 +2272,7 @@ static int emac_mii_reset(struct mii_bus *bus)
unsigned int clk_div; unsigned int clk_div;
int mdio_bus_freq = emac_bus_frequency; int mdio_bus_freq = emac_bus_frequency;
if (mdio_max_freq & mdio_bus_freq) if (mdio_max_freq && mdio_bus_freq)
clk_div = ((mdio_bus_freq / mdio_max_freq) - 1); clk_div = ((mdio_bus_freq / mdio_max_freq) - 1);
else else
clk_div = 0xFF; clk_div = 0xFF;

View file

@ -1829,6 +1829,7 @@ static int e100_alloc_cbs(struct nic *nic)
&nic->cbs_dma_addr); &nic->cbs_dma_addr);
if (!nic->cbs) if (!nic->cbs)
return -ENOMEM; return -ENOMEM;
memset(nic->cbs, 0, count * sizeof(struct cb));
for (cb = nic->cbs, i = 0; i < count; cb++, i++) { for (cb = nic->cbs, i = 0; i < count; cb++, i++) {
cb->next = (i + 1 < count) ? cb + 1 : nic->cbs; cb->next = (i + 1 < count) ? cb + 1 : nic->cbs;
@ -1837,7 +1838,6 @@ static int e100_alloc_cbs(struct nic *nic)
cb->dma_addr = nic->cbs_dma_addr + i * sizeof(struct cb); cb->dma_addr = nic->cbs_dma_addr + i * sizeof(struct cb);
cb->link = cpu_to_le32(nic->cbs_dma_addr + cb->link = cpu_to_le32(nic->cbs_dma_addr +
((i+1) % count) * sizeof(struct cb)); ((i+1) % count) * sizeof(struct cb));
cb->skb = NULL;
} }
nic->cb_to_use = nic->cb_to_send = nic->cb_to_clean = nic->cbs; nic->cb_to_use = nic->cb_to_send = nic->cb_to_clean = nic->cbs;

View file

@ -1290,7 +1290,6 @@ static s32 e1000_setup_link_82571(struct e1000_hw *hw)
static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw) static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw)
{ {
u32 ctrl; u32 ctrl;
u32 led_ctrl;
s32 ret_val; s32 ret_val;
ctrl = er32(CTRL); ctrl = er32(CTRL);
@ -1305,11 +1304,6 @@ static s32 e1000_setup_copper_link_82571(struct e1000_hw *hw)
break; break;
case e1000_phy_igp_2: case e1000_phy_igp_2:
ret_val = e1000e_copper_link_setup_igp(hw); ret_val = e1000e_copper_link_setup_igp(hw);
/* Setup activity LED */
led_ctrl = er32(LEDCTL);
led_ctrl &= IGP_ACTIVITY_LED_MASK;
led_ctrl |= (IGP_ACTIVITY_LED_ENABLE | IGP_LED3_MODE);
ew32(LEDCTL, led_ctrl);
break; break;
default: default:
return -E1000_ERR_PHY; return -E1000_ERR_PHY;

View file

@ -357,8 +357,11 @@ static void gfar_init_mac(struct net_device *ndev)
/* Configure the coalescing support */ /* Configure the coalescing support */
gfar_configure_coalescing(priv, 0xFF, 0xFF); gfar_configure_coalescing(priv, 0xFF, 0xFF);
if (priv->rx_filer_enable) if (priv->rx_filer_enable) {
rctrl |= RCTRL_FILREN; rctrl |= RCTRL_FILREN;
/* Program the RIR0 reg with the required distribution */
gfar_write(&regs->rir0, DEFAULT_RIR0);
}
if (priv->rx_csum_enable) if (priv->rx_csum_enable)
rctrl |= RCTRL_CHECKSUMMING; rctrl |= RCTRL_CHECKSUMMING;
@ -414,6 +417,36 @@ static void gfar_init_mac(struct net_device *ndev)
gfar_write(&regs->fifo_tx_starve_shutoff, priv->fifo_starve_off); gfar_write(&regs->fifo_tx_starve_shutoff, priv->fifo_starve_off);
} }
static struct net_device_stats *gfar_get_stats(struct net_device *dev)
{
struct gfar_private *priv = netdev_priv(dev);
struct netdev_queue *txq;
unsigned long rx_packets = 0, rx_bytes = 0, rx_dropped = 0;
unsigned long tx_packets = 0, tx_bytes = 0;
int i = 0;
for (i = 0; i < priv->num_rx_queues; i++) {
rx_packets += priv->rx_queue[i]->stats.rx_packets;
rx_bytes += priv->rx_queue[i]->stats.rx_bytes;
rx_dropped += priv->rx_queue[i]->stats.rx_dropped;
}
dev->stats.rx_packets = rx_packets;
dev->stats.rx_bytes = rx_bytes;
dev->stats.rx_dropped = rx_dropped;
for (i = 0; i < priv->num_tx_queues; i++) {
txq = netdev_get_tx_queue(dev, i);
tx_bytes += txq->tx_bytes;
tx_packets += txq->tx_packets;
}
dev->stats.tx_bytes = tx_bytes;
dev->stats.tx_packets = tx_packets;
return &dev->stats;
}
static const struct net_device_ops gfar_netdev_ops = { static const struct net_device_ops gfar_netdev_ops = {
.ndo_open = gfar_enet_open, .ndo_open = gfar_enet_open,
.ndo_start_xmit = gfar_start_xmit, .ndo_start_xmit = gfar_start_xmit,
@ -423,6 +456,7 @@ static const struct net_device_ops gfar_netdev_ops = {
.ndo_tx_timeout = gfar_timeout, .ndo_tx_timeout = gfar_timeout,
.ndo_do_ioctl = gfar_ioctl, .ndo_do_ioctl = gfar_ioctl,
.ndo_select_queue = gfar_select_queue, .ndo_select_queue = gfar_select_queue,
.ndo_get_stats = gfar_get_stats,
.ndo_vlan_rx_register = gfar_vlan_rx_register, .ndo_vlan_rx_register = gfar_vlan_rx_register,
.ndo_set_mac_address = eth_mac_addr, .ndo_set_mac_address = eth_mac_addr,
.ndo_validate_addr = eth_validate_addr, .ndo_validate_addr = eth_validate_addr,
@ -1022,6 +1056,9 @@ static int gfar_probe(struct of_device *ofdev,
priv->rx_queue[i]->rxic = DEFAULT_RXIC; priv->rx_queue[i]->rxic = DEFAULT_RXIC;
} }
/* enable filer if using multiple RX queues*/
if(priv->num_rx_queues > 1)
priv->rx_filer_enable = 1;
/* Enable most messages by default */ /* Enable most messages by default */
priv->msg_enable = (NETIF_MSG_IFUP << 1 ) - 1; priv->msg_enable = (NETIF_MSG_IFUP << 1 ) - 1;
@ -1937,7 +1974,8 @@ static int gfar_start_xmit(struct sk_buff *skb, struct net_device *dev)
} }
/* Update transmit stats */ /* Update transmit stats */
dev->stats.tx_bytes += skb->len; txq->tx_bytes += skb->len;
txq->tx_packets ++;
txbdp = txbdp_start = tx_queue->cur_tx; txbdp = txbdp_start = tx_queue->cur_tx;
@ -2295,8 +2333,6 @@ static int gfar_clean_tx_ring(struct gfar_priv_tx_q *tx_queue)
tx_queue->skb_dirtytx = skb_dirtytx; tx_queue->skb_dirtytx = skb_dirtytx;
tx_queue->dirty_tx = bdp; tx_queue->dirty_tx = bdp;
dev->stats.tx_packets += howmany;
return howmany; return howmany;
} }
@ -2510,14 +2546,14 @@ int gfar_clean_rx_ring(struct gfar_priv_rx_q *rx_queue, int rx_work_limit)
} }
} else { } else {
/* Increment the number of packets */ /* Increment the number of packets */
dev->stats.rx_packets++; rx_queue->stats.rx_packets++;
howmany++; howmany++;
if (likely(skb)) { if (likely(skb)) {
pkt_len = bdp->length - ETH_FCS_LEN; pkt_len = bdp->length - ETH_FCS_LEN;
/* Remove the FCS from the packet length */ /* Remove the FCS from the packet length */
skb_put(skb, pkt_len); skb_put(skb, pkt_len);
dev->stats.rx_bytes += pkt_len; rx_queue->stats.rx_bytes += pkt_len;
gfar_process_frame(dev, skb, amount_pull); gfar_process_frame(dev, skb, amount_pull);
@ -2525,7 +2561,7 @@ int gfar_clean_rx_ring(struct gfar_priv_rx_q *rx_queue, int rx_work_limit)
if (netif_msg_rx_err(priv)) if (netif_msg_rx_err(priv))
printk(KERN_WARNING printk(KERN_WARNING
"%s: Missing skb!\n", dev->name); "%s: Missing skb!\n", dev->name);
dev->stats.rx_dropped++; rx_queue->stats.rx_dropped++;
priv->extra_stats.rx_skbmissing++; priv->extra_stats.rx_skbmissing++;
} }

View file

@ -333,7 +333,7 @@ extern const char gfar_driver_version[];
#define IMASK_BSY 0x20000000 #define IMASK_BSY 0x20000000
#define IMASK_EBERR 0x10000000 #define IMASK_EBERR 0x10000000
#define IMASK_MSRO 0x04000000 #define IMASK_MSRO 0x04000000
#define IMASK_GRSC 0x02000000 #define IMASK_GTSC 0x02000000
#define IMASK_BABT 0x01000000 #define IMASK_BABT 0x01000000
#define IMASK_TXC 0x00800000 #define IMASK_TXC 0x00800000
#define IMASK_TXEEN 0x00400000 #define IMASK_TXEEN 0x00400000
@ -344,7 +344,7 @@ extern const char gfar_driver_version[];
#define IMASK_XFUN 0x00010000 #define IMASK_XFUN 0x00010000
#define IMASK_RXB0 0x00008000 #define IMASK_RXB0 0x00008000
#define IMASK_MAG 0x00000800 #define IMASK_MAG 0x00000800
#define IMASK_GTSC 0x00000100 #define IMASK_GRSC 0x00000100
#define IMASK_RXFEN0 0x00000080 #define IMASK_RXFEN0 0x00000080
#define IMASK_FIR 0x00000008 #define IMASK_FIR 0x00000008
#define IMASK_FIQ 0x00000004 #define IMASK_FIQ 0x00000004
@ -401,6 +401,10 @@ extern const char gfar_driver_version[];
#define FPR_FILER_MASK 0xFFFFFFFF #define FPR_FILER_MASK 0xFFFFFFFF
#define MAX_FILER_IDX 0xFF #define MAX_FILER_IDX 0xFF
/* This default RIR value directly corresponds
* to the 3-bit hash value generated */
#define DEFAULT_RIR0 0x05397700
/* RQFCR register bits */ /* RQFCR register bits */
#define RQFCR_GPI 0x80000000 #define RQFCR_GPI 0x80000000
#define RQFCR_HASHTBL_Q 0x00000000 #define RQFCR_HASHTBL_Q 0x00000000
@ -936,6 +940,15 @@ struct gfar_priv_tx_q {
unsigned short txtime; unsigned short txtime;
}; };
/*
* Per RX queue stats
*/
struct rx_q_stats {
unsigned long rx_packets;
unsigned long rx_bytes;
unsigned long rx_dropped;
};
/** /**
* struct gfar_priv_rx_q - per rx queue structure * struct gfar_priv_rx_q - per rx queue structure
* @rxlock: per queue rx spin lock * @rxlock: per queue rx spin lock
@ -958,6 +971,7 @@ struct gfar_priv_rx_q {
struct rxbd8 *cur_rx; struct rxbd8 *cur_rx;
struct net_device *dev; struct net_device *dev;
struct gfar_priv_grp *grp; struct gfar_priv_grp *grp;
struct rx_q_stats stats;
u16 skb_currx; u16 skb_currx;
u16 qindex; u16 qindex;
unsigned int rx_ring_size; unsigned int rx_ring_size;

View file

@ -57,7 +57,9 @@ static int use_msi = 1;
static int use_msi_x = 1; static int use_msi_x = 1;
static unsigned long auto_fw_reset = AUTO_FW_RESET_ENABLED; static int auto_fw_reset = AUTO_FW_RESET_ENABLED;
module_param(auto_fw_reset, int, 0644);
MODULE_PARM_DESC(auto_fw_reset,"Auto firmware reset (0=disabled, 1=enabled");
static int __devinit netxen_nic_probe(struct pci_dev *pdev, static int __devinit netxen_nic_probe(struct pci_dev *pdev,
const struct pci_device_id *ent); const struct pci_device_id *ent);
@ -2534,42 +2536,6 @@ static struct bin_attribute bin_attr_mem = {
.write = netxen_sysfs_write_mem, .write = netxen_sysfs_write_mem,
}; };
#ifdef CONFIG_MODULES
static ssize_t
netxen_store_auto_fw_reset(struct module_attribute *mattr,
struct module *mod, const char *buf, size_t count)
{
unsigned long new;
if (strict_strtoul(buf, 16, &new))
return -EINVAL;
if ((new == AUTO_FW_RESET_ENABLED) || (new == AUTO_FW_RESET_DISABLED)) {
auto_fw_reset = new;
return count;
}
return -EINVAL;
}
static ssize_t
netxen_show_auto_fw_reset(struct module_attribute *mattr,
struct module *mod, char *buf)
{
if (auto_fw_reset == AUTO_FW_RESET_ENABLED)
return sprintf(buf, "enabled\n");
else
return sprintf(buf, "disabled\n");
}
static struct module_attribute mod_attr_fw_reset = {
.attr = {.name = "auto_fw_reset", .mode = (S_IRUGO | S_IWUSR)},
.show = netxen_show_auto_fw_reset,
.store = netxen_store_auto_fw_reset,
};
#endif
static void static void
netxen_create_sysfs_entries(struct netxen_adapter *adapter) netxen_create_sysfs_entries(struct netxen_adapter *adapter)
@ -2775,23 +2741,12 @@ static struct pci_driver netxen_driver = {
static int __init netxen_init_module(void) static int __init netxen_init_module(void)
{ {
#ifdef CONFIG_MODULES
struct module *mod = THIS_MODULE;
#endif
printk(KERN_INFO "%s\n", netxen_nic_driver_string); printk(KERN_INFO "%s\n", netxen_nic_driver_string);
#ifdef CONFIG_INET #ifdef CONFIG_INET
register_netdevice_notifier(&netxen_netdev_cb); register_netdevice_notifier(&netxen_netdev_cb);
register_inetaddr_notifier(&netxen_inetaddr_cb); register_inetaddr_notifier(&netxen_inetaddr_cb);
#endif #endif
#ifdef CONFIG_MODULES
if (sysfs_create_file(&mod->mkobj.kobj, &mod_attr_fw_reset.attr))
printk(KERN_ERR "%s: Failed to create auto_fw_reset "
"sysfs entry.", netxen_nic_driver_name);
#endif
return pci_register_driver(&netxen_driver); return pci_register_driver(&netxen_driver);
} }
@ -2799,12 +2754,6 @@ module_init(netxen_init_module);
static void __exit netxen_exit_module(void) static void __exit netxen_exit_module(void)
{ {
#ifdef CONFIG_MODULES
struct module *mod = THIS_MODULE;
sysfs_remove_file(&mod->mkobj.kobj, &mod_attr_fw_reset.attr);
#endif
pci_unregister_driver(&netxen_driver); pci_unregister_driver(&netxen_driver);
#ifdef CONFIG_INET #ifdef CONFIG_INET

View file

@ -326,7 +326,8 @@ error:
static void bcm54xx_adjust_rxrefclk(struct phy_device *phydev) static void bcm54xx_adjust_rxrefclk(struct phy_device *phydev)
{ {
u32 val, orig; u32 orig;
int val;
bool clk125en = true; bool clk125en = true;
/* Abort if we are using an untested phy. */ /* Abort if we are using an untested phy. */

View file

@ -770,7 +770,7 @@ static int hidp_setup_hid(struct hidp_session *session,
hid = hid_allocate_device(); hid = hid_allocate_device();
if (IS_ERR(hid)) if (IS_ERR(hid))
return PTR_ERR(session->hid); return PTR_ERR(hid);
session->hid = hid; session->hid = hid;
session->req = req; session->req = req;

View file

@ -1212,6 +1212,7 @@ static void l2cap_monitor_timeout(unsigned long arg)
bh_lock_sock(sk); bh_lock_sock(sk);
if (l2cap_pi(sk)->retry_count >= l2cap_pi(sk)->remote_max_tx) { if (l2cap_pi(sk)->retry_count >= l2cap_pi(sk)->remote_max_tx) {
l2cap_send_disconn_req(l2cap_pi(sk)->conn, sk); l2cap_send_disconn_req(l2cap_pi(sk)->conn, sk);
bh_unlock_sock(sk);
return; return;
} }
@ -3435,8 +3436,8 @@ static inline int l2cap_data_channel_sframe(struct sock *sk, u16 rx_control, str
(pi->unacked_frames > 0)) (pi->unacked_frames > 0))
__mod_retrans_timer(); __mod_retrans_timer();
l2cap_ertm_send(sk);
pi->conn_state &= ~L2CAP_CONN_REMOTE_BUSY; pi->conn_state &= ~L2CAP_CONN_REMOTE_BUSY;
l2cap_ertm_send(sk);
} }
break; break;
@ -3471,9 +3472,9 @@ static inline int l2cap_data_channel_sframe(struct sock *sk, u16 rx_control, str
pi->conn_state &= ~L2CAP_CONN_REMOTE_BUSY; pi->conn_state &= ~L2CAP_CONN_REMOTE_BUSY;
if (rx_control & L2CAP_CTRL_POLL) { if (rx_control & L2CAP_CTRL_POLL) {
l2cap_retransmit_frame(sk, tx_seq);
pi->expected_ack_seq = tx_seq; pi->expected_ack_seq = tx_seq;
l2cap_drop_acked_frames(sk); l2cap_drop_acked_frames(sk);
l2cap_retransmit_frame(sk, tx_seq);
l2cap_ertm_send(sk); l2cap_ertm_send(sk);
if (pi->conn_state & L2CAP_CONN_WAIT_F) { if (pi->conn_state & L2CAP_CONN_WAIT_F) {
pi->srej_save_reqseq = tx_seq; pi->srej_save_reqseq = tx_seq;

View file

@ -708,7 +708,8 @@ static void ip6_frags_ns_sysctl_unregister(struct net *net)
table = net->ipv6.sysctl.frags_hdr->ctl_table_arg; table = net->ipv6.sysctl.frags_hdr->ctl_table_arg;
unregister_net_sysctl_table(net->ipv6.sysctl.frags_hdr); unregister_net_sysctl_table(net->ipv6.sysctl.frags_hdr);
kfree(table); if (!net_eq(net, &init_net))
kfree(table);
} }
static struct ctl_table_header *ip6_ctl_header; static struct ctl_table_header *ip6_ctl_header;

View file

@ -2630,6 +2630,7 @@ struct ctl_table *ipv6_route_sysctl_init(struct net *net)
table[6].data = &net->ipv6.sysctl.ip6_rt_gc_elasticity; table[6].data = &net->ipv6.sysctl.ip6_rt_gc_elasticity;
table[7].data = &net->ipv6.sysctl.ip6_rt_mtu_expires; table[7].data = &net->ipv6.sysctl.ip6_rt_mtu_expires;
table[8].data = &net->ipv6.sysctl.ip6_rt_min_advmss; table[8].data = &net->ipv6.sysctl.ip6_rt_min_advmss;
table[9].data = &net->ipv6.sysctl.ip6_rt_gc_min_interval;
} }
return table; return table;