Browse Source

Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6

Conflicts:
	drivers/net/bnx2x/bnx2x_ethtool.c
David S. Miller 14 năm trước cách đây
mục cha
commit
e1943424e4
44 tập tin đã thay đổi với 197 bổ sung136 xóa
  1. 1 0
      MAINTAINERS
  2. 1 0
      drivers/connector/connector.c
  3. 18 13
      drivers/net/bna/bfa_ioc.c
  4. 1 0
      drivers/net/bna/bfa_ioc.h
  5. 28 0
      drivers/net/bna/bfa_ioc_ct.c
  6. 4 2
      drivers/net/bna/bfi.h
  7. 0 1
      drivers/net/bna/bnad.c
  8. 5 6
      drivers/net/bnx2x/bnx2x_ethtool.c
  9. 1 1
      drivers/net/can/mscan/mpc5xxx_can.c
  10. 2 1
      drivers/net/loopback.c
  11. 3 0
      drivers/net/natsemi.c
  12. 1 0
      drivers/net/qlcnic/qlcnic.h
  13. 14 0
      drivers/net/qlcnic/qlcnic_main.c
  14. 4 2
      drivers/net/sfc/efx.c
  15. 2 0
      drivers/net/sfc/io.h
  16. 0 2
      drivers/net/sfc/net_driver.h
  17. 15 7
      drivers/net/sfc/nic.c
  18. 1 0
      drivers/net/sfc/nic.h
  19. 6 19
      drivers/net/sfc/selftest.c
  20. 2 1
      drivers/net/sfc/tx.c
  21. 19 4
      drivers/net/sis900.c
  22. 2 2
      drivers/net/wireless/ath/ath9k/hif_usb.c
  23. 0 9
      drivers/net/wireless/ath/ath9k/hw.c
  24. 22 3
      drivers/net/wireless/ath/ath9k/mac.c
  25. 1 1
      drivers/net/wireless/ath/ath9k/mac.h
  26. 3 3
      drivers/net/wireless/ath/ath9k/recv.c
  27. 0 2
      drivers/net/wireless/iwlegacy/iwl-3945-hw.h
  28. 0 3
      drivers/net/wireless/iwlegacy/iwl-4965-hw.h
  29. 11 6
      drivers/net/wireless/iwlegacy/iwl-core.c
  30. 0 7
      drivers/net/wireless/iwlegacy/iwl-eeprom.c
  31. 0 4
      drivers/net/wireless/iwlegacy/iwl3945-base.c
  32. 0 6
      drivers/net/wireless/iwlegacy/iwl4965-base.c
  33. 2 2
      include/linux/usb/usbnet.h
  34. 2 4
      net/bridge/br_netfilter.c
  35. 7 3
      net/core/dev.c
  36. 0 2
      net/ieee802154/Makefile
  37. 2 3
      net/ipv4/inet_connection_sock.c
  38. 7 6
      net/ipv4/inetpeer.c
  39. 3 3
      net/ipv4/ip_options.c
  40. 0 3
      net/ipv4/sysctl_net_ipv4.c
  41. 1 1
      net/ipv6/inet6_connection_sock.c
  42. 1 2
      net/irda/af_irda.c
  43. 1 2
      net/llc/llc_input.c
  44. 4 0
      net/sctp/associola.c

+ 1 - 0
MAINTAINERS

@@ -151,6 +151,7 @@ S:	Maintained
 F:	drivers/net/hamradio/6pack.c
 F:	drivers/net/hamradio/6pack.c
 
 
 8169 10/100/1000 GIGABIT ETHERNET DRIVER
 8169 10/100/1000 GIGABIT ETHERNET DRIVER
+M:	Realtek linux nic maintainers <nic_swsd@realtek.com>
 M:	Francois Romieu <romieu@fr.zoreil.com>
 M:	Francois Romieu <romieu@fr.zoreil.com>
 L:	netdev@vger.kernel.org
 L:	netdev@vger.kernel.org
 S:	Maintained
 S:	Maintained

+ 1 - 0
drivers/connector/connector.c

@@ -142,6 +142,7 @@ static int cn_call_callback(struct sk_buff *skb)
 		cbq->callback(msg, nsp);
 		cbq->callback(msg, nsp);
 		kfree_skb(skb);
 		kfree_skb(skb);
 		cn_queue_release_callback(cbq);
 		cn_queue_release_callback(cbq);
+		err = 0;
 	}
 	}
 
 
 	return err;
 	return err;

+ 18 - 13
drivers/net/bna/bfa_ioc.c

@@ -38,6 +38,8 @@
 #define bfa_ioc_map_port(__ioc) ((__ioc)->ioc_hwif->ioc_map_port(__ioc))
 #define bfa_ioc_map_port(__ioc) ((__ioc)->ioc_hwif->ioc_map_port(__ioc))
 #define bfa_ioc_notify_fail(__ioc)			\
 #define bfa_ioc_notify_fail(__ioc)			\
 			((__ioc)->ioc_hwif->ioc_notify_fail(__ioc))
 			((__ioc)->ioc_hwif->ioc_notify_fail(__ioc))
+#define bfa_ioc_sync_start(__ioc)               \
+			((__ioc)->ioc_hwif->ioc_sync_start(__ioc))
 #define bfa_ioc_sync_join(__ioc)			\
 #define bfa_ioc_sync_join(__ioc)			\
 			((__ioc)->ioc_hwif->ioc_sync_join(__ioc))
 			((__ioc)->ioc_hwif->ioc_sync_join(__ioc))
 #define bfa_ioc_sync_leave(__ioc)			\
 #define bfa_ioc_sync_leave(__ioc)			\
@@ -602,7 +604,7 @@ bfa_iocpf_sm_fwcheck(struct bfa_iocpf *iocpf, enum iocpf_event event)
 	switch (event) {
 	switch (event) {
 	case IOCPF_E_SEMLOCKED:
 	case IOCPF_E_SEMLOCKED:
 		if (bfa_ioc_firmware_lock(ioc)) {
 		if (bfa_ioc_firmware_lock(ioc)) {
-			if (bfa_ioc_sync_complete(ioc)) {
+			if (bfa_ioc_sync_start(ioc)) {
 				iocpf->retry_count = 0;
 				iocpf->retry_count = 0;
 				bfa_ioc_sync_join(ioc);
 				bfa_ioc_sync_join(ioc);
 				bfa_fsm_set_state(iocpf, bfa_iocpf_sm_hwinit);
 				bfa_fsm_set_state(iocpf, bfa_iocpf_sm_hwinit);
@@ -1313,7 +1315,7 @@ bfa_nw_ioc_fwver_cmp(struct bfa_ioc *ioc, struct bfi_ioc_image_hdr *fwhdr)
  * execution context (driver/bios) must match.
  * execution context (driver/bios) must match.
  */
  */
 static bool
 static bool
-bfa_ioc_fwver_valid(struct bfa_ioc *ioc)
+bfa_ioc_fwver_valid(struct bfa_ioc *ioc, u32 boot_env)
 {
 {
 	struct bfi_ioc_image_hdr fwhdr, *drv_fwhdr;
 	struct bfi_ioc_image_hdr fwhdr, *drv_fwhdr;
 
 
@@ -1324,7 +1326,7 @@ bfa_ioc_fwver_valid(struct bfa_ioc *ioc)
 	if (fwhdr.signature != drv_fwhdr->signature)
 	if (fwhdr.signature != drv_fwhdr->signature)
 		return false;
 		return false;
 
 
-	if (fwhdr.exec != drv_fwhdr->exec)
+	if (swab32(fwhdr.param) != boot_env)
 		return false;
 		return false;
 
 
 	return bfa_nw_ioc_fwver_cmp(ioc, &fwhdr);
 	return bfa_nw_ioc_fwver_cmp(ioc, &fwhdr);
@@ -1351,9 +1353,12 @@ bfa_ioc_hwinit(struct bfa_ioc *ioc, bool force)
 {
 {
 	enum bfi_ioc_state ioc_fwstate;
 	enum bfi_ioc_state ioc_fwstate;
 	bool fwvalid;
 	bool fwvalid;
+	u32 boot_env;
 
 
 	ioc_fwstate = readl(ioc->ioc_regs.ioc_fwstate);
 	ioc_fwstate = readl(ioc->ioc_regs.ioc_fwstate);
 
 
+	boot_env = BFI_BOOT_LOADER_OS;
+
 	if (force)
 	if (force)
 		ioc_fwstate = BFI_IOC_UNINIT;
 		ioc_fwstate = BFI_IOC_UNINIT;
 
 
@@ -1361,10 +1366,10 @@ bfa_ioc_hwinit(struct bfa_ioc *ioc, bool force)
 	 * check if firmware is valid
 	 * check if firmware is valid
 	 */
 	 */
 	fwvalid = (ioc_fwstate == BFI_IOC_UNINIT) ?
 	fwvalid = (ioc_fwstate == BFI_IOC_UNINIT) ?
-		false : bfa_ioc_fwver_valid(ioc);
+		false : bfa_ioc_fwver_valid(ioc, boot_env);
 
 
 	if (!fwvalid) {
 	if (!fwvalid) {
-		bfa_ioc_boot(ioc, BFI_BOOT_TYPE_NORMAL, ioc->pcidev.device_id);
+		bfa_ioc_boot(ioc, BFI_BOOT_TYPE_NORMAL, boot_env);
 		return;
 		return;
 	}
 	}
 
 
@@ -1395,7 +1400,7 @@ bfa_ioc_hwinit(struct bfa_ioc *ioc, bool force)
 	/**
 	/**
 	 * Initialize the h/w for any other states.
 	 * Initialize the h/w for any other states.
 	 */
 	 */
-	bfa_ioc_boot(ioc, BFI_BOOT_TYPE_NORMAL, ioc->pcidev.device_id);
+	bfa_ioc_boot(ioc, BFI_BOOT_TYPE_NORMAL, boot_env);
 }
 }
 
 
 void
 void
@@ -1505,7 +1510,7 @@ bfa_ioc_hb_stop(struct bfa_ioc *ioc)
  */
  */
 static void
 static void
 bfa_ioc_download_fw(struct bfa_ioc *ioc, u32 boot_type,
 bfa_ioc_download_fw(struct bfa_ioc *ioc, u32 boot_type,
-		    u32 boot_param)
+		    u32 boot_env)
 {
 {
 	u32 *fwimg;
 	u32 *fwimg;
 	u32 pgnum;
 	u32 pgnum;
@@ -1556,10 +1561,10 @@ bfa_ioc_download_fw(struct bfa_ioc *ioc, u32 boot_type,
 	/*
 	/*
 	 * Set boot type and boot param at the end.
 	 * Set boot type and boot param at the end.
 	*/
 	*/
-	writel((swab32(swab32(boot_type))), ((ioc->ioc_regs.smem_page_start)
+	writel(boot_type, ((ioc->ioc_regs.smem_page_start)
 			+ (BFI_BOOT_TYPE_OFF)));
 			+ (BFI_BOOT_TYPE_OFF)));
-	writel((swab32(swab32(boot_param))), ((ioc->ioc_regs.smem_page_start)
-			+ (BFI_BOOT_PARAM_OFF)));
+	writel(boot_env, ((ioc->ioc_regs.smem_page_start)
+			+ (BFI_BOOT_LOADER_OFF)));
 }
 }
 
 
 static void
 static void
@@ -1719,7 +1724,7 @@ bfa_ioc_pll_init(struct bfa_ioc *ioc)
  * as the entry vector.
  * as the entry vector.
  */
  */
 static void
 static void
-bfa_ioc_boot(struct bfa_ioc *ioc, u32 boot_type, u32 boot_param)
+bfa_ioc_boot(struct bfa_ioc *ioc, u32 boot_type, u32 boot_env)
 {
 {
 	void __iomem *rb;
 	void __iomem *rb;
 
 
@@ -1732,7 +1737,7 @@ bfa_ioc_boot(struct bfa_ioc *ioc, u32 boot_type, u32 boot_param)
 	 * Initialize IOC state of all functions on a chip reset.
 	 * Initialize IOC state of all functions on a chip reset.
 	 */
 	 */
 	rb = ioc->pcidev.pci_bar_kva;
 	rb = ioc->pcidev.pci_bar_kva;
-	if (boot_param == BFI_BOOT_TYPE_MEMTEST) {
+	if (boot_type == BFI_BOOT_TYPE_MEMTEST) {
 		writel(BFI_IOC_MEMTEST, (rb + BFA_IOC0_STATE_REG));
 		writel(BFI_IOC_MEMTEST, (rb + BFA_IOC0_STATE_REG));
 		writel(BFI_IOC_MEMTEST, (rb + BFA_IOC1_STATE_REG));
 		writel(BFI_IOC_MEMTEST, (rb + BFA_IOC1_STATE_REG));
 	} else {
 	} else {
@@ -1741,7 +1746,7 @@ bfa_ioc_boot(struct bfa_ioc *ioc, u32 boot_type, u32 boot_param)
 	}
 	}
 
 
 	bfa_ioc_msgflush(ioc);
 	bfa_ioc_msgflush(ioc);
-	bfa_ioc_download_fw(ioc, boot_type, boot_param);
+	bfa_ioc_download_fw(ioc, boot_type, boot_env);
 
 
 	/**
 	/**
 	 * Enable interrupts just before starting LPU
 	 * Enable interrupts just before starting LPU

+ 1 - 0
drivers/net/bna/bfa_ioc.h

@@ -194,6 +194,7 @@ struct bfa_ioc_hwif {
 					bool msix);
 					bool msix);
 	void		(*ioc_notify_fail)	(struct bfa_ioc *ioc);
 	void		(*ioc_notify_fail)	(struct bfa_ioc *ioc);
 	void		(*ioc_ownership_reset)	(struct bfa_ioc *ioc);
 	void		(*ioc_ownership_reset)	(struct bfa_ioc *ioc);
+	bool		(*ioc_sync_start)       (struct bfa_ioc *ioc);
 	void		(*ioc_sync_join)	(struct bfa_ioc *ioc);
 	void		(*ioc_sync_join)	(struct bfa_ioc *ioc);
 	void		(*ioc_sync_leave)	(struct bfa_ioc *ioc);
 	void		(*ioc_sync_leave)	(struct bfa_ioc *ioc);
 	void		(*ioc_sync_ack)		(struct bfa_ioc *ioc);
 	void		(*ioc_sync_ack)		(struct bfa_ioc *ioc);

+ 28 - 0
drivers/net/bna/bfa_ioc_ct.c

@@ -41,6 +41,7 @@ static void bfa_ioc_ct_map_port(struct bfa_ioc *ioc);
 static void bfa_ioc_ct_isr_mode_set(struct bfa_ioc *ioc, bool msix);
 static void bfa_ioc_ct_isr_mode_set(struct bfa_ioc *ioc, bool msix);
 static void bfa_ioc_ct_notify_fail(struct bfa_ioc *ioc);
 static void bfa_ioc_ct_notify_fail(struct bfa_ioc *ioc);
 static void bfa_ioc_ct_ownership_reset(struct bfa_ioc *ioc);
 static void bfa_ioc_ct_ownership_reset(struct bfa_ioc *ioc);
+static bool bfa_ioc_ct_sync_start(struct bfa_ioc *ioc);
 static void bfa_ioc_ct_sync_join(struct bfa_ioc *ioc);
 static void bfa_ioc_ct_sync_join(struct bfa_ioc *ioc);
 static void bfa_ioc_ct_sync_leave(struct bfa_ioc *ioc);
 static void bfa_ioc_ct_sync_leave(struct bfa_ioc *ioc);
 static void bfa_ioc_ct_sync_ack(struct bfa_ioc *ioc);
 static void bfa_ioc_ct_sync_ack(struct bfa_ioc *ioc);
@@ -63,6 +64,7 @@ bfa_nw_ioc_set_ct_hwif(struct bfa_ioc *ioc)
 	nw_hwif_ct.ioc_isr_mode_set = bfa_ioc_ct_isr_mode_set;
 	nw_hwif_ct.ioc_isr_mode_set = bfa_ioc_ct_isr_mode_set;
 	nw_hwif_ct.ioc_notify_fail = bfa_ioc_ct_notify_fail;
 	nw_hwif_ct.ioc_notify_fail = bfa_ioc_ct_notify_fail;
 	nw_hwif_ct.ioc_ownership_reset = bfa_ioc_ct_ownership_reset;
 	nw_hwif_ct.ioc_ownership_reset = bfa_ioc_ct_ownership_reset;
+	nw_hwif_ct.ioc_sync_start = bfa_ioc_ct_sync_start;
 	nw_hwif_ct.ioc_sync_join = bfa_ioc_ct_sync_join;
 	nw_hwif_ct.ioc_sync_join = bfa_ioc_ct_sync_join;
 	nw_hwif_ct.ioc_sync_leave = bfa_ioc_ct_sync_leave;
 	nw_hwif_ct.ioc_sync_leave = bfa_ioc_ct_sync_leave;
 	nw_hwif_ct.ioc_sync_ack = bfa_ioc_ct_sync_ack;
 	nw_hwif_ct.ioc_sync_ack = bfa_ioc_ct_sync_ack;
@@ -342,6 +344,32 @@ bfa_ioc_ct_ownership_reset(struct bfa_ioc *ioc)
 	bfa_nw_ioc_hw_sem_release(ioc);
 	bfa_nw_ioc_hw_sem_release(ioc);
 }
 }
 
 
+/**
+ * Synchronized IOC failure processing routines
+ */
+static bool
+bfa_ioc_ct_sync_start(struct bfa_ioc *ioc)
+{
+	u32 r32 = readl(ioc->ioc_regs.ioc_fail_sync);
+	u32 sync_reqd = bfa_ioc_ct_get_sync_reqd(r32);
+
+	/*
+	 * Driver load time.  If the sync required bit for this PCI fn
+	 * is set, it is due to an unclean exit by the driver for this
+	 * PCI fn in the previous incarnation. Whoever comes here first
+	 * should clean it up, no matter which PCI fn.
+	 */
+
+	if (sync_reqd & bfa_ioc_ct_sync_pos(ioc)) {
+		writel(0, ioc->ioc_regs.ioc_fail_sync);
+		writel(1, ioc->ioc_regs.ioc_usage_reg);
+		writel(BFI_IOC_UNINIT, ioc->ioc_regs.ioc_fwstate);
+		writel(BFI_IOC_UNINIT, ioc->ioc_regs.alt_ioc_fwstate);
+		return true;
+	}
+
+	return bfa_ioc_ct_sync_complete(ioc);
+}
 /**
 /**
  * Synchronized IOC failure processing routines
  * Synchronized IOC failure processing routines
  */
  */

+ 4 - 2
drivers/net/bna/bfi.h

@@ -184,12 +184,14 @@ enum bfi_mclass {
 #define BFI_IOC_MSGLEN_MAX	32	/* 32 bytes */
 #define BFI_IOC_MSGLEN_MAX	32	/* 32 bytes */
 
 
 #define BFI_BOOT_TYPE_OFF		8
 #define BFI_BOOT_TYPE_OFF		8
-#define BFI_BOOT_PARAM_OFF		12
+#define BFI_BOOT_LOADER_OFF		12
 
 
-#define BFI_BOOT_TYPE_NORMAL 		0	/* param is device id */
+#define BFI_BOOT_TYPE_NORMAL 		0
 #define	BFI_BOOT_TYPE_FLASH		1
 #define	BFI_BOOT_TYPE_FLASH		1
 #define	BFI_BOOT_TYPE_MEMTEST		2
 #define	BFI_BOOT_TYPE_MEMTEST		2
 
 
+#define BFI_BOOT_LOADER_OS		0
+
 #define BFI_BOOT_MEMTEST_RES_ADDR   0x900
 #define BFI_BOOT_MEMTEST_RES_ADDR   0x900
 #define BFI_BOOT_MEMTEST_RES_SIG    0xA0A1A2A3
 #define BFI_BOOT_MEMTEST_RES_SIG    0xA0A1A2A3
 
 

+ 0 - 1
drivers/net/bna/bnad.c

@@ -1837,7 +1837,6 @@ bnad_setup_rx(struct bnad *bnad, uint rx_id)
 	/* Initialize the Rx event handlers */
 	/* Initialize the Rx event handlers */
 	rx_cbfn.rcb_setup_cbfn = bnad_cb_rcb_setup;
 	rx_cbfn.rcb_setup_cbfn = bnad_cb_rcb_setup;
 	rx_cbfn.rcb_destroy_cbfn = bnad_cb_rcb_destroy;
 	rx_cbfn.rcb_destroy_cbfn = bnad_cb_rcb_destroy;
-	rx_cbfn.rcb_destroy_cbfn = NULL;
 	rx_cbfn.ccb_setup_cbfn = bnad_cb_ccb_setup;
 	rx_cbfn.ccb_setup_cbfn = bnad_cb_ccb_setup;
 	rx_cbfn.ccb_destroy_cbfn = bnad_cb_ccb_destroy;
 	rx_cbfn.ccb_destroy_cbfn = bnad_cb_ccb_destroy;
 	rx_cbfn.rx_cleanup_cbfn = bnad_cb_rx_cleanup;
 	rx_cbfn.rx_cleanup_cbfn = bnad_cb_rx_cleanup;

+ 5 - 6
drivers/net/bnx2x/bnx2x_ethtool.c

@@ -2030,20 +2030,19 @@ static int bnx2x_set_phys_id(struct net_device *dev,
 
 
 	case ETHTOOL_ID_ON:
 	case ETHTOOL_ID_ON:
 		bnx2x_set_led(&bp->link_params, &bp->link_vars,
 		bnx2x_set_led(&bp->link_params, &bp->link_vars,
-			      LED_MODE_OPER, SPEED_1000);
+			      LED_MODE_ON, SPEED_1000);
 		break;
 		break;
 
 
 	case ETHTOOL_ID_OFF:
 	case ETHTOOL_ID_OFF:
 		bnx2x_set_led(&bp->link_params, &bp->link_vars,
 		bnx2x_set_led(&bp->link_params, &bp->link_vars,
-			      LED_MODE_OFF, 0);
+			      LED_MODE_FRONT_PANEL_OFF, 0);
 
 
 		break;
 		break;
 
 
 	case ETHTOOL_ID_INACTIVE:
 	case ETHTOOL_ID_INACTIVE:
-		if (bp->link_vars.link_up)
-			bnx2x_set_led(&bp->link_params, &bp->link_vars,
-				      LED_MODE_OPER,
-				      bp->link_vars.line_speed);
+		bnx2x_set_led(&bp->link_params, &bp->link_vars,
+			      LED_MODE_OPER,
+			      bp->link_vars.line_speed);
 	}
 	}
 
 
 	return 0;
 	return 0;

+ 1 - 1
drivers/net/can/mscan/mpc5xxx_can.c

@@ -260,7 +260,7 @@ static int __devinit mpc5xxx_can_probe(struct platform_device *ofdev)
 
 
 	if (!ofdev->dev.of_match)
 	if (!ofdev->dev.of_match)
 		return -EINVAL;
 		return -EINVAL;
-	data = (struct mpc5xxx_can_data *)of_dev->dev.of_match->data;
+	data = (struct mpc5xxx_can_data *)ofdev->dev.of_match->data;
 
 
 	base = of_iomap(np, 0);
 	base = of_iomap(np, 0);
 	if (!base) {
 	if (!base) {

+ 2 - 1
drivers/net/loopback.c

@@ -173,7 +173,8 @@ static void loopback_setup(struct net_device *dev)
 		| NETIF_F_RXCSUM
 		| NETIF_F_RXCSUM
 		| NETIF_F_HIGHDMA
 		| NETIF_F_HIGHDMA
 		| NETIF_F_LLTX
 		| NETIF_F_LLTX
-		| NETIF_F_NETNS_LOCAL;
+		| NETIF_F_NETNS_LOCAL
+		| NETIF_F_VLAN_CHALLENGED;
 	dev->ethtool_ops	= &loopback_ethtool_ops;
 	dev->ethtool_ops	= &loopback_ethtool_ops;
 	dev->header_ops		= &eth_header_ops;
 	dev->header_ops		= &eth_header_ops;
 	dev->netdev_ops		= &loopback_ops;
 	dev->netdev_ops		= &loopback_ops;

+ 3 - 0
drivers/net/natsemi.c

@@ -860,6 +860,9 @@ static int __devinit natsemi_probe1 (struct pci_dev *pdev,
 		prev_eedata = eedata;
 		prev_eedata = eedata;
 	}
 	}
 
 
+	/* Store MAC Address in perm_addr */
+	memcpy(dev->perm_addr, dev->dev_addr, ETH_ALEN);
+
 	dev->base_addr = (unsigned long __force) ioaddr;
 	dev->base_addr = (unsigned long __force) ioaddr;
 	dev->irq = irq;
 	dev->irq = irq;
 
 

+ 1 - 0
drivers/net/qlcnic/qlcnic.h

@@ -99,6 +99,7 @@
 #define TX_UDPV6_PKT	0x0c
 #define TX_UDPV6_PKT	0x0c
 
 
 /* Tx defines */
 /* Tx defines */
+#define QLCNIC_MAX_FRAGS_PER_TX	14
 #define MAX_TSO_HEADER_DESC	2
 #define MAX_TSO_HEADER_DESC	2
 #define MGMT_CMD_DESC_RESV	4
 #define MGMT_CMD_DESC_RESV	4
 #define TX_STOP_THRESH		((MAX_SKB_FRAGS >> 2) + MAX_TSO_HEADER_DESC \
 #define TX_STOP_THRESH		((MAX_SKB_FRAGS >> 2) + MAX_TSO_HEADER_DESC \

+ 14 - 0
drivers/net/qlcnic/qlcnic_main.c

@@ -2138,6 +2138,7 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 	struct cmd_desc_type0 *hwdesc, *first_desc;
 	struct cmd_desc_type0 *hwdesc, *first_desc;
 	struct pci_dev *pdev;
 	struct pci_dev *pdev;
 	struct ethhdr *phdr;
 	struct ethhdr *phdr;
+	int delta = 0;
 	int i, k;
 	int i, k;
 
 
 	u32 producer;
 	u32 producer;
@@ -2157,6 +2158,19 @@ qlcnic_xmit_frame(struct sk_buff *skb, struct net_device *netdev)
 	}
 	}
 
 
 	frag_count = skb_shinfo(skb)->nr_frags + 1;
 	frag_count = skb_shinfo(skb)->nr_frags + 1;
+	/* 14 frags supported for normal packet and
+	 * 32 frags supported for TSO packet
+	 */
+	if (!skb_is_gso(skb) && frag_count > QLCNIC_MAX_FRAGS_PER_TX) {
+
+		for (i = 0; i < (frag_count - QLCNIC_MAX_FRAGS_PER_TX); i++)
+			delta += skb_shinfo(skb)->frags[i].size;
+
+		if (!__pskb_pull_tail(skb, delta))
+			goto drop_packet;
+
+		frag_count = 1 + skb_shinfo(skb)->nr_frags;
+	}
 
 
 	if (unlikely(qlcnic_tx_avail(tx_ring) <= TX_STOP_THRESH)) {
 	if (unlikely(qlcnic_tx_avail(tx_ring) <= TX_STOP_THRESH)) {
 		netif_stop_queue(netdev);
 		netif_stop_queue(netdev);

+ 4 - 2
drivers/net/sfc/efx.c

@@ -328,7 +328,8 @@ static int efx_poll(struct napi_struct *napi, int budget)
  * processing to finish, then directly poll (and ack ) the eventq.
  * processing to finish, then directly poll (and ack ) the eventq.
  * Finally reenable NAPI and interrupts.
  * Finally reenable NAPI and interrupts.
  *
  *
- * Since we are touching interrupts the caller should hold the suspend lock
+ * This is for use only during a loopback self-test.  It must not
+ * deliver any packets up the stack as this can result in deadlock.
  */
  */
 void efx_process_channel_now(struct efx_channel *channel)
 void efx_process_channel_now(struct efx_channel *channel)
 {
 {
@@ -336,6 +337,7 @@ void efx_process_channel_now(struct efx_channel *channel)
 
 
 	BUG_ON(channel->channel >= efx->n_channels);
 	BUG_ON(channel->channel >= efx->n_channels);
 	BUG_ON(!channel->enabled);
 	BUG_ON(!channel->enabled);
+	BUG_ON(!efx->loopback_selftest);
 
 
 	/* Disable interrupts and wait for ISRs to complete */
 	/* Disable interrupts and wait for ISRs to complete */
 	efx_nic_disable_interrupts(efx);
 	efx_nic_disable_interrupts(efx);
@@ -1436,7 +1438,7 @@ static void efx_start_all(struct efx_nic *efx)
 	 * restart the transmit interface early so the watchdog timer stops */
 	 * restart the transmit interface early so the watchdog timer stops */
 	efx_start_port(efx);
 	efx_start_port(efx);
 
 
-	if (efx_dev_registered(efx))
+	if (efx_dev_registered(efx) && !efx->port_inhibited)
 		netif_tx_wake_all_queues(efx->net_dev);
 		netif_tx_wake_all_queues(efx->net_dev);
 
 
 	efx_for_each_channel(channel, efx)
 	efx_for_each_channel(channel, efx)

+ 2 - 0
drivers/net/sfc/io.h

@@ -152,6 +152,7 @@ static inline void efx_reado(struct efx_nic *efx, efx_oword_t *value,
 
 
 	spin_lock_irqsave(&efx->biu_lock, flags);
 	spin_lock_irqsave(&efx->biu_lock, flags);
 	value->u32[0] = _efx_readd(efx, reg + 0);
 	value->u32[0] = _efx_readd(efx, reg + 0);
+	rmb();
 	value->u32[1] = _efx_readd(efx, reg + 4);
 	value->u32[1] = _efx_readd(efx, reg + 4);
 	value->u32[2] = _efx_readd(efx, reg + 8);
 	value->u32[2] = _efx_readd(efx, reg + 8);
 	value->u32[3] = _efx_readd(efx, reg + 12);
 	value->u32[3] = _efx_readd(efx, reg + 12);
@@ -174,6 +175,7 @@ static inline void efx_sram_readq(struct efx_nic *efx, void __iomem *membase,
 	value->u64[0] = (__force __le64)__raw_readq(membase + addr);
 	value->u64[0] = (__force __le64)__raw_readq(membase + addr);
 #else
 #else
 	value->u32[0] = (__force __le32)__raw_readl(membase + addr);
 	value->u32[0] = (__force __le32)__raw_readl(membase + addr);
+	rmb();
 	value->u32[1] = (__force __le32)__raw_readl(membase + addr + 4);
 	value->u32[1] = (__force __le32)__raw_readl(membase + addr + 4);
 #endif
 #endif
 	spin_unlock_irqrestore(&efx->biu_lock, flags);
 	spin_unlock_irqrestore(&efx->biu_lock, flags);

+ 0 - 2
drivers/net/sfc/net_driver.h

@@ -330,7 +330,6 @@ enum efx_rx_alloc_method {
  * @eventq_mask: Event queue pointer mask
  * @eventq_mask: Event queue pointer mask
  * @eventq_read_ptr: Event queue read pointer
  * @eventq_read_ptr: Event queue read pointer
  * @last_eventq_read_ptr: Last event queue read pointer value.
  * @last_eventq_read_ptr: Last event queue read pointer value.
- * @magic_count: Event queue test event count
  * @irq_count: Number of IRQs since last adaptive moderation decision
  * @irq_count: Number of IRQs since last adaptive moderation decision
  * @irq_mod_score: IRQ moderation score
  * @irq_mod_score: IRQ moderation score
  * @rx_alloc_level: Watermark based heuristic counter for pushing descriptors
  * @rx_alloc_level: Watermark based heuristic counter for pushing descriptors
@@ -360,7 +359,6 @@ struct efx_channel {
 	unsigned int eventq_mask;
 	unsigned int eventq_mask;
 	unsigned int eventq_read_ptr;
 	unsigned int eventq_read_ptr;
 	unsigned int last_eventq_read_ptr;
 	unsigned int last_eventq_read_ptr;
-	unsigned int magic_count;
 
 
 	unsigned int irq_count;
 	unsigned int irq_count;
 	unsigned int irq_mod_score;
 	unsigned int irq_mod_score;

+ 15 - 7
drivers/net/sfc/nic.c

@@ -84,7 +84,8 @@ static inline void efx_write_buf_tbl(struct efx_nic *efx, efx_qword_t *value,
 static inline efx_qword_t *efx_event(struct efx_channel *channel,
 static inline efx_qword_t *efx_event(struct efx_channel *channel,
 				     unsigned int index)
 				     unsigned int index)
 {
 {
-	return ((efx_qword_t *) (channel->eventq.addr)) + index;
+	return ((efx_qword_t *) (channel->eventq.addr)) +
+		(index & channel->eventq_mask);
 }
 }
 
 
 /* See if an event is present
 /* See if an event is present
@@ -673,7 +674,8 @@ void efx_nic_eventq_read_ack(struct efx_channel *channel)
 	efx_dword_t reg;
 	efx_dword_t reg;
 	struct efx_nic *efx = channel->efx;
 	struct efx_nic *efx = channel->efx;
 
 
-	EFX_POPULATE_DWORD_1(reg, FRF_AZ_EVQ_RPTR, channel->eventq_read_ptr);
+	EFX_POPULATE_DWORD_1(reg, FRF_AZ_EVQ_RPTR,
+			     channel->eventq_read_ptr & channel->eventq_mask);
 	efx_writed_table(efx, &reg, efx->type->evq_rptr_tbl_base,
 	efx_writed_table(efx, &reg, efx->type->evq_rptr_tbl_base,
 			 channel->channel);
 			 channel->channel);
 }
 }
@@ -906,7 +908,7 @@ efx_handle_generated_event(struct efx_channel *channel, efx_qword_t *event)
 
 
 	code = EFX_QWORD_FIELD(*event, FSF_AZ_DRV_GEN_EV_MAGIC);
 	code = EFX_QWORD_FIELD(*event, FSF_AZ_DRV_GEN_EV_MAGIC);
 	if (code == EFX_CHANNEL_MAGIC_TEST(channel))
 	if (code == EFX_CHANNEL_MAGIC_TEST(channel))
-		++channel->magic_count;
+		; /* ignore */
 	else if (code == EFX_CHANNEL_MAGIC_FILL(channel))
 	else if (code == EFX_CHANNEL_MAGIC_FILL(channel))
 		/* The queue must be empty, so we won't receive any rx
 		/* The queue must be empty, so we won't receive any rx
 		 * events, so efx_process_channel() won't refill the
 		 * events, so efx_process_channel() won't refill the
@@ -1013,8 +1015,7 @@ int efx_nic_process_eventq(struct efx_channel *channel, int budget)
 		/* Clear this event by marking it all ones */
 		/* Clear this event by marking it all ones */
 		EFX_SET_QWORD(*p_event);
 		EFX_SET_QWORD(*p_event);
 
 
-		/* Increment read pointer */
-		read_ptr = (read_ptr + 1) & channel->eventq_mask;
+		++read_ptr;
 
 
 		ev_code = EFX_QWORD_FIELD(event, FSF_AZ_EV_CODE);
 		ev_code = EFX_QWORD_FIELD(event, FSF_AZ_EV_CODE);
 
 
@@ -1058,6 +1059,13 @@ out:
 	return spent;
 	return spent;
 }
 }
 
 
+/* Check whether an event is present in the eventq at the current
+ * read pointer.  Only useful for self-test.
+ */
+bool efx_nic_event_present(struct efx_channel *channel)
+{
+	return efx_event_present(efx_event(channel, channel->eventq_read_ptr));
+}
 
 
 /* Allocate buffer table entries for event queue */
 /* Allocate buffer table entries for event queue */
 int efx_nic_probe_eventq(struct efx_channel *channel)
 int efx_nic_probe_eventq(struct efx_channel *channel)
@@ -1163,7 +1171,7 @@ static void efx_poll_flush_events(struct efx_nic *efx)
 	struct efx_tx_queue *tx_queue;
 	struct efx_tx_queue *tx_queue;
 	struct efx_rx_queue *rx_queue;
 	struct efx_rx_queue *rx_queue;
 	unsigned int read_ptr = channel->eventq_read_ptr;
 	unsigned int read_ptr = channel->eventq_read_ptr;
-	unsigned int end_ptr = (read_ptr - 1) & channel->eventq_mask;
+	unsigned int end_ptr = read_ptr + channel->eventq_mask - 1;
 
 
 	do {
 	do {
 		efx_qword_t *event = efx_event(channel, read_ptr);
 		efx_qword_t *event = efx_event(channel, read_ptr);
@@ -1203,7 +1211,7 @@ static void efx_poll_flush_events(struct efx_nic *efx)
 		 * it's ok to throw away every non-flush event */
 		 * it's ok to throw away every non-flush event */
 		EFX_SET_QWORD(*event);
 		EFX_SET_QWORD(*event);
 
 
-		read_ptr = (read_ptr + 1) & channel->eventq_mask;
+		++read_ptr;
 	} while (read_ptr != end_ptr);
 	} while (read_ptr != end_ptr);
 
 
 	channel->eventq_read_ptr = read_ptr;
 	channel->eventq_read_ptr = read_ptr;

+ 1 - 0
drivers/net/sfc/nic.h

@@ -184,6 +184,7 @@ extern void efx_nic_fini_eventq(struct efx_channel *channel);
 extern void efx_nic_remove_eventq(struct efx_channel *channel);
 extern void efx_nic_remove_eventq(struct efx_channel *channel);
 extern int efx_nic_process_eventq(struct efx_channel *channel, int rx_quota);
 extern int efx_nic_process_eventq(struct efx_channel *channel, int rx_quota);
 extern void efx_nic_eventq_read_ack(struct efx_channel *channel);
 extern void efx_nic_eventq_read_ack(struct efx_channel *channel);
+extern bool efx_nic_event_present(struct efx_channel *channel);
 
 
 /* MAC/PHY */
 /* MAC/PHY */
 extern void falcon_drain_tx_fifo(struct efx_nic *efx);
 extern void falcon_drain_tx_fifo(struct efx_nic *efx);

+ 6 - 19
drivers/net/sfc/selftest.c

@@ -131,8 +131,6 @@ static int efx_test_chip(struct efx_nic *efx, struct efx_self_tests *tests)
 static int efx_test_interrupts(struct efx_nic *efx,
 static int efx_test_interrupts(struct efx_nic *efx,
 			       struct efx_self_tests *tests)
 			       struct efx_self_tests *tests)
 {
 {
-	struct efx_channel *channel;
-
 	netif_dbg(efx, drv, efx->net_dev, "testing interrupts\n");
 	netif_dbg(efx, drv, efx->net_dev, "testing interrupts\n");
 	tests->interrupt = -1;
 	tests->interrupt = -1;
 
 
@@ -140,15 +138,6 @@ static int efx_test_interrupts(struct efx_nic *efx,
 	efx->last_irq_cpu = -1;
 	efx->last_irq_cpu = -1;
 	smp_wmb();
 	smp_wmb();
 
 
-	/* ACK each interrupting event queue. Receiving an interrupt due to
-	 * traffic before a test event is raised is considered a pass */
-	efx_for_each_channel(channel, efx) {
-		if (channel->work_pending)
-			efx_process_channel_now(channel);
-		if (efx->last_irq_cpu >= 0)
-			goto success;
-	}
-
 	efx_nic_generate_interrupt(efx);
 	efx_nic_generate_interrupt(efx);
 
 
 	/* Wait for arrival of test interrupt. */
 	/* Wait for arrival of test interrupt. */
@@ -173,13 +162,13 @@ static int efx_test_eventq_irq(struct efx_channel *channel,
 			       struct efx_self_tests *tests)
 			       struct efx_self_tests *tests)
 {
 {
 	struct efx_nic *efx = channel->efx;
 	struct efx_nic *efx = channel->efx;
-	unsigned int magic_count, count;
+	unsigned int read_ptr, count;
 
 
 	tests->eventq_dma[channel->channel] = -1;
 	tests->eventq_dma[channel->channel] = -1;
 	tests->eventq_int[channel->channel] = -1;
 	tests->eventq_int[channel->channel] = -1;
 	tests->eventq_poll[channel->channel] = -1;
 	tests->eventq_poll[channel->channel] = -1;
 
 
-	magic_count = channel->magic_count;
+	read_ptr = channel->eventq_read_ptr;
 	channel->efx->last_irq_cpu = -1;
 	channel->efx->last_irq_cpu = -1;
 	smp_wmb();
 	smp_wmb();
 
 
@@ -190,10 +179,7 @@ static int efx_test_eventq_irq(struct efx_channel *channel,
 	do {
 	do {
 		schedule_timeout_uninterruptible(HZ / 100);
 		schedule_timeout_uninterruptible(HZ / 100);
 
 
-		if (channel->work_pending)
-			efx_process_channel_now(channel);
-
-		if (channel->magic_count != magic_count)
+		if (ACCESS_ONCE(channel->eventq_read_ptr) != read_ptr)
 			goto eventq_ok;
 			goto eventq_ok;
 	} while (++count < 2);
 	} while (++count < 2);
 
 
@@ -211,8 +197,7 @@ static int efx_test_eventq_irq(struct efx_channel *channel,
 	}
 	}
 
 
 	/* Check to see if event was received even if interrupt wasn't */
 	/* Check to see if event was received even if interrupt wasn't */
-	efx_process_channel_now(channel);
-	if (channel->magic_count != magic_count) {
+	if (efx_nic_event_present(channel)) {
 		netif_err(efx, drv, efx->net_dev,
 		netif_err(efx, drv, efx->net_dev,
 			  "channel %d event was generated, but "
 			  "channel %d event was generated, but "
 			  "failed to trigger an interrupt\n", channel->channel);
 			  "failed to trigger an interrupt\n", channel->channel);
@@ -770,6 +755,8 @@ int efx_selftest(struct efx_nic *efx, struct efx_self_tests *tests,
 	__efx_reconfigure_port(efx);
 	__efx_reconfigure_port(efx);
 	mutex_unlock(&efx->mac_lock);
 	mutex_unlock(&efx->mac_lock);
 
 
+	netif_tx_wake_all_queues(efx->net_dev);
+
 	return rc_test;
 	return rc_test;
 }
 }
 
 

+ 2 - 1
drivers/net/sfc/tx.c

@@ -435,7 +435,8 @@ void efx_xmit_done(struct efx_tx_queue *tx_queue, unsigned int index)
 	 * queue state. */
 	 * queue state. */
 	smp_mb();
 	smp_mb();
 	if (unlikely(netif_tx_queue_stopped(tx_queue->core_txq)) &&
 	if (unlikely(netif_tx_queue_stopped(tx_queue->core_txq)) &&
-	    likely(efx->port_enabled)) {
+	    likely(efx->port_enabled) &&
+	    likely(!efx->port_inhibited)) {
 		fill_level = tx_queue->insert_count - tx_queue->read_count;
 		fill_level = tx_queue->insert_count - tx_queue->read_count;
 		if (fill_level < EFX_TXQ_THRESHOLD(efx)) {
 		if (fill_level < EFX_TXQ_THRESHOLD(efx)) {
 			EFX_BUG_ON_PARANOID(!efx_dev_registered(efx));
 			EFX_BUG_ON_PARANOID(!efx_dev_registered(efx));

+ 19 - 4
drivers/net/sis900.c

@@ -240,7 +240,8 @@ static const struct ethtool_ops sis900_ethtool_ops;
  *	@net_dev: the net device to get address for
  *	@net_dev: the net device to get address for
  *
  *
  *	Older SiS900 and friends, use EEPROM to store MAC address.
  *	Older SiS900 and friends, use EEPROM to store MAC address.
- *	MAC address is read from read_eeprom() into @net_dev->dev_addr.
+ *	MAC address is read from read_eeprom() into @net_dev->dev_addr and
+ *	@net_dev->perm_addr.
  */
  */
 
 
 static int __devinit sis900_get_mac_addr(struct pci_dev * pci_dev, struct net_device *net_dev)
 static int __devinit sis900_get_mac_addr(struct pci_dev * pci_dev, struct net_device *net_dev)
@@ -261,6 +262,9 @@ static int __devinit sis900_get_mac_addr(struct pci_dev * pci_dev, struct net_de
 	for (i = 0; i < 3; i++)
 	for (i = 0; i < 3; i++)
 	        ((u16 *)(net_dev->dev_addr))[i] = read_eeprom(ioaddr, i+EEPROMMACAddr);
 	        ((u16 *)(net_dev->dev_addr))[i] = read_eeprom(ioaddr, i+EEPROMMACAddr);
 
 
+	/* Store MAC Address in perm_addr */
+	memcpy(net_dev->perm_addr, net_dev->dev_addr, ETH_ALEN);
+
 	return 1;
 	return 1;
 }
 }
 
 
@@ -271,7 +275,8 @@ static int __devinit sis900_get_mac_addr(struct pci_dev * pci_dev, struct net_de
  *
  *
  *	SiS630E model, use APC CMOS RAM to store MAC address.
  *	SiS630E model, use APC CMOS RAM to store MAC address.
  *	APC CMOS RAM is accessed through ISA bridge.
  *	APC CMOS RAM is accessed through ISA bridge.
- *	MAC address is read into @net_dev->dev_addr.
+ *	MAC address is read into @net_dev->dev_addr and
+ *	@net_dev->perm_addr.
  */
  */
 
 
 static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev,
 static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev,
@@ -296,6 +301,10 @@ static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev,
 		outb(0x09 + i, 0x70);
 		outb(0x09 + i, 0x70);
 		((u8 *)(net_dev->dev_addr))[i] = inb(0x71);
 		((u8 *)(net_dev->dev_addr))[i] = inb(0x71);
 	}
 	}
+
+	/* Store MAC Address in perm_addr */
+	memcpy(net_dev->perm_addr, net_dev->dev_addr, ETH_ALEN);
+
 	pci_write_config_byte(isa_bridge, 0x48, reg & ~0x40);
 	pci_write_config_byte(isa_bridge, 0x48, reg & ~0x40);
 	pci_dev_put(isa_bridge);
 	pci_dev_put(isa_bridge);
 
 
@@ -310,7 +319,7 @@ static int __devinit sis630e_get_mac_addr(struct pci_dev * pci_dev,
  *
  *
  *	SiS635 model, set MAC Reload Bit to load Mac address from APC
  *	SiS635 model, set MAC Reload Bit to load Mac address from APC
  *	to rfdr. rfdr is accessed through rfcr. MAC address is read into
  *	to rfdr. rfdr is accessed through rfcr. MAC address is read into
- *	@net_dev->dev_addr.
+ *	@net_dev->dev_addr and @net_dev->perm_addr.
  */
  */
 
 
 static int __devinit sis635_get_mac_addr(struct pci_dev * pci_dev,
 static int __devinit sis635_get_mac_addr(struct pci_dev * pci_dev,
@@ -334,6 +343,9 @@ static int __devinit sis635_get_mac_addr(struct pci_dev * pci_dev,
 		*( ((u16 *)net_dev->dev_addr) + i) = inw(ioaddr + rfdr);
 		*( ((u16 *)net_dev->dev_addr) + i) = inw(ioaddr + rfdr);
 	}
 	}
 
 
+	/* Store MAC Address in perm_addr */
+	memcpy(net_dev->perm_addr, net_dev->dev_addr, ETH_ALEN);
+
 	/* enable packet filtering */
 	/* enable packet filtering */
 	outl(rfcrSave | RFEN, rfcr + ioaddr);
 	outl(rfcrSave | RFEN, rfcr + ioaddr);
 
 
@@ -353,7 +365,7 @@ static int __devinit sis635_get_mac_addr(struct pci_dev * pci_dev,
  *	EEDONE signal to refuse EEPROM access by LAN.
  *	EEDONE signal to refuse EEPROM access by LAN.
  *	The EEPROM map of SiS962 or SiS963 is different to SiS900.
  *	The EEPROM map of SiS962 or SiS963 is different to SiS900.
  *	The signature field in SiS962 or SiS963 spec is meaningless.
  *	The signature field in SiS962 or SiS963 spec is meaningless.
- *	MAC address is read into @net_dev->dev_addr.
+ *	MAC address is read into @net_dev->dev_addr and @net_dev->perm_addr.
  */
  */
 
 
 static int __devinit sis96x_get_mac_addr(struct pci_dev * pci_dev,
 static int __devinit sis96x_get_mac_addr(struct pci_dev * pci_dev,
@@ -372,6 +384,9 @@ static int __devinit sis96x_get_mac_addr(struct pci_dev * pci_dev,
 			for (i = 0; i < 3; i++)
 			for (i = 0; i < 3; i++)
 			        ((u16 *)(net_dev->dev_addr))[i] = read_eeprom(ioaddr, i+EEPROMMACAddr);
 			        ((u16 *)(net_dev->dev_addr))[i] = read_eeprom(ioaddr, i+EEPROMMACAddr);
 
 
+			/* Store MAC Address in perm_addr */
+			memcpy(net_dev->perm_addr, net_dev->dev_addr, ETH_ALEN);
+
 			outl(EEDONE, ee_addr);
 			outl(EEDONE, ee_addr);
 			return 1;
 			return 1;
 		} else {
 		} else {

+ 2 - 2
drivers/net/wireless/ath/ath9k/hif_usb.c

@@ -1040,7 +1040,7 @@ static int ath9k_hif_usb_probe(struct usb_interface *interface,
 	}
 	}
 
 
 	ret = ath9k_htc_hw_init(hif_dev->htc_handle,
 	ret = ath9k_htc_hw_init(hif_dev->htc_handle,
-				&hif_dev->udev->dev, hif_dev->device_id,
+				&interface->dev, hif_dev->device_id,
 				hif_dev->udev->product, id->driver_info);
 				hif_dev->udev->product, id->driver_info);
 	if (ret) {
 	if (ret) {
 		ret = -EINVAL;
 		ret = -EINVAL;
@@ -1158,7 +1158,7 @@ fail_resume:
 #endif
 #endif
 
 
 static struct usb_driver ath9k_hif_usb_driver = {
 static struct usb_driver ath9k_hif_usb_driver = {
-	.name = "ath9k_hif_usb",
+	.name = KBUILD_MODNAME,
 	.probe = ath9k_hif_usb_probe,
 	.probe = ath9k_hif_usb_probe,
 	.disconnect = ath9k_hif_usb_disconnect,
 	.disconnect = ath9k_hif_usb_disconnect,
 #ifdef CONFIG_PM
 #ifdef CONFIG_PM

+ 0 - 9
drivers/net/wireless/ath/ath9k/hw.c

@@ -1249,15 +1249,6 @@ int ath9k_hw_reset(struct ath_hw *ah, struct ath9k_channel *chan,
 	ah->txchainmask = common->tx_chainmask;
 	ah->txchainmask = common->tx_chainmask;
 	ah->rxchainmask = common->rx_chainmask;
 	ah->rxchainmask = common->rx_chainmask;
 
 
-	if ((common->bus_ops->ath_bus_type != ATH_USB) && !ah->chip_fullsleep) {
-		ath9k_hw_abortpcurecv(ah);
-		if (!ath9k_hw_stopdmarecv(ah)) {
-			ath_dbg(common, ATH_DBG_XMIT,
-				"Failed to stop receive dma\n");
-			bChannelChange = false;
-		}
-	}
-
 	if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE))
 	if (!ath9k_hw_setpower(ah, ATH9K_PM_AWAKE))
 		return -EIO;
 		return -EIO;
 
 

+ 22 - 3
drivers/net/wireless/ath/ath9k/mac.c

@@ -710,27 +710,46 @@ void ath9k_hw_abortpcurecv(struct ath_hw *ah)
 }
 }
 EXPORT_SYMBOL(ath9k_hw_abortpcurecv);
 EXPORT_SYMBOL(ath9k_hw_abortpcurecv);
 
 
-bool ath9k_hw_stopdmarecv(struct ath_hw *ah)
+bool ath9k_hw_stopdmarecv(struct ath_hw *ah, bool *reset)
 {
 {
 #define AH_RX_STOP_DMA_TIMEOUT 10000   /* usec */
 #define AH_RX_STOP_DMA_TIMEOUT 10000   /* usec */
 	struct ath_common *common = ath9k_hw_common(ah);
 	struct ath_common *common = ath9k_hw_common(ah);
+	u32 mac_status, last_mac_status = 0;
 	int i;
 	int i;
 
 
+	/* Enable access to the DMA observation bus */
+	REG_WRITE(ah, AR_MACMISC,
+		  ((AR_MACMISC_DMA_OBS_LINE_8 << AR_MACMISC_DMA_OBS_S) |
+		   (AR_MACMISC_MISC_OBS_BUS_1 <<
+		    AR_MACMISC_MISC_OBS_BUS_MSB_S)));
+
 	REG_WRITE(ah, AR_CR, AR_CR_RXD);
 	REG_WRITE(ah, AR_CR, AR_CR_RXD);
 
 
 	/* Wait for rx enable bit to go low */
 	/* Wait for rx enable bit to go low */
 	for (i = AH_RX_STOP_DMA_TIMEOUT / AH_TIME_QUANTUM; i != 0; i--) {
 	for (i = AH_RX_STOP_DMA_TIMEOUT / AH_TIME_QUANTUM; i != 0; i--) {
 		if ((REG_READ(ah, AR_CR) & AR_CR_RXE) == 0)
 		if ((REG_READ(ah, AR_CR) & AR_CR_RXE) == 0)
 			break;
 			break;
+
+		if (!AR_SREV_9300_20_OR_LATER(ah)) {
+			mac_status = REG_READ(ah, AR_DMADBG_7) & 0x7f0;
+			if (mac_status == 0x1c0 && mac_status == last_mac_status) {
+				*reset = true;
+				break;
+			}
+
+			last_mac_status = mac_status;
+		}
+
 		udelay(AH_TIME_QUANTUM);
 		udelay(AH_TIME_QUANTUM);
 	}
 	}
 
 
 	if (i == 0) {
 	if (i == 0) {
 		ath_err(common,
 		ath_err(common,
-			"DMA failed to stop in %d ms AR_CR=0x%08x AR_DIAG_SW=0x%08x\n",
+			"DMA failed to stop in %d ms AR_CR=0x%08x AR_DIAG_SW=0x%08x DMADBG_7=0x%08x\n",
 			AH_RX_STOP_DMA_TIMEOUT / 1000,
 			AH_RX_STOP_DMA_TIMEOUT / 1000,
 			REG_READ(ah, AR_CR),
 			REG_READ(ah, AR_CR),
-			REG_READ(ah, AR_DIAG_SW));
+			REG_READ(ah, AR_DIAG_SW),
+			REG_READ(ah, AR_DMADBG_7));
 		return false;
 		return false;
 	} else {
 	} else {
 		return true;
 		return true;

+ 1 - 1
drivers/net/wireless/ath/ath9k/mac.h

@@ -695,7 +695,7 @@ bool ath9k_hw_setrxabort(struct ath_hw *ah, bool set);
 void ath9k_hw_putrxbuf(struct ath_hw *ah, u32 rxdp);
 void ath9k_hw_putrxbuf(struct ath_hw *ah, u32 rxdp);
 void ath9k_hw_startpcureceive(struct ath_hw *ah, bool is_scanning);
 void ath9k_hw_startpcureceive(struct ath_hw *ah, bool is_scanning);
 void ath9k_hw_abortpcurecv(struct ath_hw *ah);
 void ath9k_hw_abortpcurecv(struct ath_hw *ah);
-bool ath9k_hw_stopdmarecv(struct ath_hw *ah);
+bool ath9k_hw_stopdmarecv(struct ath_hw *ah, bool *reset);
 int ath9k_hw_beaconq_setup(struct ath_hw *ah);
 int ath9k_hw_beaconq_setup(struct ath_hw *ah);
 
 
 /* Interrupt Handling */
 /* Interrupt Handling */

+ 3 - 3
drivers/net/wireless/ath/ath9k/recv.c

@@ -486,12 +486,12 @@ start_recv:
 bool ath_stoprecv(struct ath_softc *sc)
 bool ath_stoprecv(struct ath_softc *sc)
 {
 {
 	struct ath_hw *ah = sc->sc_ah;
 	struct ath_hw *ah = sc->sc_ah;
-	bool stopped;
+	bool stopped, reset = false;
 
 
 	spin_lock_bh(&sc->rx.rxbuflock);
 	spin_lock_bh(&sc->rx.rxbuflock);
 	ath9k_hw_abortpcurecv(ah);
 	ath9k_hw_abortpcurecv(ah);
 	ath9k_hw_setrxfilter(ah, 0);
 	ath9k_hw_setrxfilter(ah, 0);
-	stopped = ath9k_hw_stopdmarecv(ah);
+	stopped = ath9k_hw_stopdmarecv(ah, &reset);
 
 
 	if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)
 	if (sc->sc_ah->caps.hw_caps & ATH9K_HW_CAP_EDMA)
 		ath_edma_stop_recv(sc);
 		ath_edma_stop_recv(sc);
@@ -506,7 +506,7 @@ bool ath_stoprecv(struct ath_softc *sc)
 			"confusing the DMA engine when we start RX up\n");
 			"confusing the DMA engine when we start RX up\n");
 		ATH_DBG_WARN_ON_ONCE(!stopped);
 		ATH_DBG_WARN_ON_ONCE(!stopped);
 	}
 	}
-	return stopped;
+	return stopped || reset;
 }
 }
 
 
 void ath_flushrecv(struct ath_softc *sc)
 void ath_flushrecv(struct ath_softc *sc)

+ 0 - 2
drivers/net/wireless/iwlegacy/iwl-3945-hw.h

@@ -74,8 +74,6 @@
 /* RSSI to dBm */
 /* RSSI to dBm */
 #define IWL39_RSSI_OFFSET	95
 #define IWL39_RSSI_OFFSET	95
 
 
-#define IWL_DEFAULT_TX_POWER	0x0F
-
 /*
 /*
  * EEPROM related constants, enums, and structures.
  * EEPROM related constants, enums, and structures.
  */
  */

+ 0 - 3
drivers/net/wireless/iwlegacy/iwl-4965-hw.h

@@ -804,9 +804,6 @@ struct iwl4965_scd_bc_tbl {
 
 
 #define IWL4965_DEFAULT_TX_RETRY  15
 #define IWL4965_DEFAULT_TX_RETRY  15
 
 
-/* Limit range of txpower output target to be between these values */
-#define IWL4965_TX_POWER_TARGET_POWER_MIN	(0)	/* 0 dBm: 1 milliwatt */
-
 /* EEPROM */
 /* EEPROM */
 #define IWL4965_FIRST_AMPDU_QUEUE	10
 #define IWL4965_FIRST_AMPDU_QUEUE	10
 
 

+ 11 - 6
drivers/net/wireless/iwlegacy/iwl-core.c

@@ -160,6 +160,7 @@ int iwl_legacy_init_geos(struct iwl_priv *priv)
 	struct ieee80211_channel *geo_ch;
 	struct ieee80211_channel *geo_ch;
 	struct ieee80211_rate *rates;
 	struct ieee80211_rate *rates;
 	int i = 0;
 	int i = 0;
+	s8 max_tx_power = 0;
 
 
 	if (priv->bands[IEEE80211_BAND_2GHZ].n_bitrates ||
 	if (priv->bands[IEEE80211_BAND_2GHZ].n_bitrates ||
 	    priv->bands[IEEE80211_BAND_5GHZ].n_bitrates) {
 	    priv->bands[IEEE80211_BAND_5GHZ].n_bitrates) {
@@ -235,8 +236,8 @@ int iwl_legacy_init_geos(struct iwl_priv *priv)
 
 
 			geo_ch->flags |= ch->ht40_extension_channel;
 			geo_ch->flags |= ch->ht40_extension_channel;
 
 
-			if (ch->max_power_avg > priv->tx_power_device_lmt)
-				priv->tx_power_device_lmt = ch->max_power_avg;
+			if (ch->max_power_avg > max_tx_power)
+				max_tx_power = ch->max_power_avg;
 		} else {
 		} else {
 			geo_ch->flags |= IEEE80211_CHAN_DISABLED;
 			geo_ch->flags |= IEEE80211_CHAN_DISABLED;
 		}
 		}
@@ -249,6 +250,10 @@ int iwl_legacy_init_geos(struct iwl_priv *priv)
 				 geo_ch->flags);
 				 geo_ch->flags);
 	}
 	}
 
 
+	priv->tx_power_device_lmt = max_tx_power;
+	priv->tx_power_user_lmt = max_tx_power;
+	priv->tx_power_next = max_tx_power;
+
 	if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) &&
 	if ((priv->bands[IEEE80211_BAND_5GHZ].n_channels == 0) &&
 	     priv->cfg->sku & IWL_SKU_A) {
 	     priv->cfg->sku & IWL_SKU_A) {
 		IWL_INFO(priv, "Incorrectly detected BG card as ABG. "
 		IWL_INFO(priv, "Incorrectly detected BG card as ABG. "
@@ -1124,11 +1129,11 @@ int iwl_legacy_set_tx_power(struct iwl_priv *priv, s8 tx_power, bool force)
 	if (!priv->cfg->ops->lib->send_tx_power)
 	if (!priv->cfg->ops->lib->send_tx_power)
 		return -EOPNOTSUPP;
 		return -EOPNOTSUPP;
 
 
-	if (tx_power < IWL4965_TX_POWER_TARGET_POWER_MIN) {
+	/* 0 dBm mean 1 milliwatt */
+	if (tx_power < 0) {
 		IWL_WARN(priv,
 		IWL_WARN(priv,
-			 "Requested user TXPOWER %d below lower limit %d.\n",
-			 tx_power,
-			 IWL4965_TX_POWER_TARGET_POWER_MIN);
+			 "Requested user TXPOWER %d below 1 mW.\n",
+			 tx_power);
 		return -EINVAL;
 		return -EINVAL;
 	}
 	}
 
 

+ 0 - 7
drivers/net/wireless/iwlegacy/iwl-eeprom.c

@@ -471,13 +471,6 @@ int iwl_legacy_init_channel_map(struct iwl_priv *priv)
 					     flags & EEPROM_CHANNEL_RADAR))
 					     flags & EEPROM_CHANNEL_RADAR))
 				       ? "" : "not ");
 				       ? "" : "not ");
 
 
-			/* Set the tx_power_user_lmt to the highest power
-			 * supported by any channel */
-			if (eeprom_ch_info[ch].max_power_avg >
-						priv->tx_power_user_lmt)
-				priv->tx_power_user_lmt =
-				    eeprom_ch_info[ch].max_power_avg;
-
 			ch_info++;
 			ch_info++;
 		}
 		}
 	}
 	}

+ 0 - 4
drivers/net/wireless/iwlegacy/iwl3945-base.c

@@ -3825,10 +3825,6 @@ static int iwl3945_init_drv(struct iwl_priv *priv)
 	priv->force_reset[IWL_FW_RESET].reset_duration =
 	priv->force_reset[IWL_FW_RESET].reset_duration =
 		IWL_DELAY_NEXT_FORCE_FW_RELOAD;
 		IWL_DELAY_NEXT_FORCE_FW_RELOAD;
 
 
-
-	priv->tx_power_user_lmt = IWL_DEFAULT_TX_POWER;
-	priv->tx_power_next = IWL_DEFAULT_TX_POWER;
-
 	if (eeprom->version < EEPROM_3945_EEPROM_VERSION) {
 	if (eeprom->version < EEPROM_3945_EEPROM_VERSION) {
 		IWL_WARN(priv, "Unsupported EEPROM version: 0x%04X\n",
 		IWL_WARN(priv, "Unsupported EEPROM version: 0x%04X\n",
 			 eeprom->version);
 			 eeprom->version);

+ 0 - 6
drivers/net/wireless/iwlegacy/iwl4965-base.c

@@ -3140,12 +3140,6 @@ static int iwl4965_init_drv(struct iwl_priv *priv)
 
 
 	iwl_legacy_init_scan_params(priv);
 	iwl_legacy_init_scan_params(priv);
 
 
-	/* Set the tx_power_user_lmt to the lowest power level
-	 * this value will get overwritten by channel max power avg
-	 * from eeprom */
-	priv->tx_power_user_lmt = IWL4965_TX_POWER_TARGET_POWER_MIN;
-	priv->tx_power_next = IWL4965_TX_POWER_TARGET_POWER_MIN;
-
 	ret = iwl_legacy_init_channel_map(priv);
 	ret = iwl_legacy_init_channel_map(priv);
 	if (ret) {
 	if (ret) {
 		IWL_ERR(priv, "initializing regulatory failed: %d\n", ret);
 		IWL_ERR(priv, "initializing regulatory failed: %d\n", ret);

+ 2 - 2
include/linux/usb/usbnet.h

@@ -103,8 +103,8 @@ struct driver_info {
  * Indicates to usbnet, that USB driver accumulates multiple IP packets.
  * Indicates to usbnet, that USB driver accumulates multiple IP packets.
  * Affects statistic (counters) and short packet handling.
  * Affects statistic (counters) and short packet handling.
  */
  */
-#define FLAG_MULTI_PACKET	0x1000
-#define FLAG_RX_ASSEMBLE	0x2000	/* rx packets may span >1 frames */
+#define FLAG_MULTI_PACKET	0x2000
+#define FLAG_RX_ASSEMBLE	0x4000	/* rx packets may span >1 frames */
 
 
 	/* init device ... can sleep, or cause probe() failure */
 	/* init device ... can sleep, or cause probe() failure */
 	int	(*bind)(struct usbnet *, struct usb_interface *);
 	int	(*bind)(struct usbnet *, struct usb_interface *);

+ 2 - 4
net/bridge/br_netfilter.c

@@ -249,11 +249,9 @@ static int br_parse_ip_options(struct sk_buff *skb)
 		goto drop;
 		goto drop;
 	}
 	}
 
 
-	/* Zero out the CB buffer if no options present */
-	if (iph->ihl == 5) {
-		memset(IPCB(skb), 0, sizeof(struct inet_skb_parm));
+	memset(IPCB(skb), 0, sizeof(struct inet_skb_parm));
+	if (iph->ihl == 5)
 		return 0;
 		return 0;
-	}
 
 
 	opt->optlen = iph->ihl*4 - sizeof(struct iphdr);
 	opt->optlen = iph->ihl*4 - sizeof(struct iphdr);
 	if (ip_options_compile(dev_net(dev), opt, skb))
 	if (ip_options_compile(dev_net(dev), opt, skb))

+ 7 - 3
net/core/dev.c

@@ -5209,11 +5209,15 @@ u32 netdev_fix_features(struct net_device *dev, u32 features)
 	}
 	}
 
 
 	/* TSO requires that SG is present as well. */
 	/* TSO requires that SG is present as well. */
-	if ((features & NETIF_F_TSO) && !(features & NETIF_F_SG)) {
-		netdev_info(dev, "Dropping NETIF_F_TSO since no SG feature.\n");
-		features &= ~NETIF_F_TSO;
+	if ((features & NETIF_F_ALL_TSO) && !(features & NETIF_F_SG)) {
+		netdev_info(dev, "Dropping TSO features since no SG feature.\n");
+		features &= ~NETIF_F_ALL_TSO;
 	}
 	}
 
 
+	/* TSO ECN requires that TSO is present as well. */
+	if ((features & NETIF_F_ALL_TSO) == NETIF_F_TSO_ECN)
+		features &= ~NETIF_F_TSO_ECN;
+
 	/* Software GSO depends on SG. */
 	/* Software GSO depends on SG. */
 	if ((features & NETIF_F_GSO) && !(features & NETIF_F_SG)) {
 	if ((features & NETIF_F_GSO) && !(features & NETIF_F_SG)) {
 		netdev_info(dev, "Dropping NETIF_F_GSO since no SG feature.\n");
 		netdev_info(dev, "Dropping NETIF_F_GSO since no SG feature.\n");

+ 0 - 2
net/ieee802154/Makefile

@@ -1,5 +1,3 @@
 obj-$(CONFIG_IEEE802154) +=	ieee802154.o af_802154.o
 obj-$(CONFIG_IEEE802154) +=	ieee802154.o af_802154.o
 ieee802154-y		:= netlink.o nl-mac.o nl-phy.o nl_policy.o wpan-class.o
 ieee802154-y		:= netlink.o nl-mac.o nl-phy.o nl_policy.o wpan-class.o
 af_802154-y		:= af_ieee802154.o raw.o dgram.o
 af_802154-y		:= af_ieee802154.o raw.o dgram.o
-
-ccflags-y += -Wall -DDEBUG

+ 2 - 3
net/ipv4/inet_connection_sock.c

@@ -73,7 +73,7 @@ int inet_csk_bind_conflict(const struct sock *sk,
 		     !sk2->sk_bound_dev_if ||
 		     !sk2->sk_bound_dev_if ||
 		     sk->sk_bound_dev_if == sk2->sk_bound_dev_if)) {
 		     sk->sk_bound_dev_if == sk2->sk_bound_dev_if)) {
 			if (!reuse || !sk2->sk_reuse ||
 			if (!reuse || !sk2->sk_reuse ||
-			    ((1 << sk2->sk_state) & (TCPF_LISTEN | TCPF_CLOSE))) {
+			    sk2->sk_state == TCP_LISTEN) {
 				const __be32 sk2_rcv_saddr = sk_rcv_saddr(sk2);
 				const __be32 sk2_rcv_saddr = sk_rcv_saddr(sk2);
 				if (!sk2_rcv_saddr || !sk_rcv_saddr(sk) ||
 				if (!sk2_rcv_saddr || !sk_rcv_saddr(sk) ||
 				    sk2_rcv_saddr == sk_rcv_saddr(sk))
 				    sk2_rcv_saddr == sk_rcv_saddr(sk))
@@ -122,8 +122,7 @@ again:
 					    (tb->num_owners < smallest_size || smallest_size == -1)) {
 					    (tb->num_owners < smallest_size || smallest_size == -1)) {
 						smallest_size = tb->num_owners;
 						smallest_size = tb->num_owners;
 						smallest_rover = rover;
 						smallest_rover = rover;
-						if (atomic_read(&hashinfo->bsockets) > (high - low) + 1 &&
-						    !inet_csk(sk)->icsk_af_ops->bind_conflict(sk, tb)) {
+						if (atomic_read(&hashinfo->bsockets) > (high - low) + 1) {
 							spin_unlock(&head->lock);
 							spin_unlock(&head->lock);
 							snum = smallest_rover;
 							snum = smallest_rover;
 							goto have_snum;
 							goto have_snum;

+ 7 - 6
net/ipv4/inetpeer.c

@@ -354,7 +354,8 @@ static void inetpeer_free_rcu(struct rcu_head *head)
 }
 }
 
 
 /* May be called with local BH enabled. */
 /* May be called with local BH enabled. */
-static void unlink_from_pool(struct inet_peer *p, struct inet_peer_base *base)
+static void unlink_from_pool(struct inet_peer *p, struct inet_peer_base *base,
+			     struct inet_peer __rcu **stack[PEER_MAXDEPTH])
 {
 {
 	int do_free;
 	int do_free;
 
 
@@ -368,7 +369,6 @@ static void unlink_from_pool(struct inet_peer *p, struct inet_peer_base *base)
 	 * We use refcnt=-1 to alert lockless readers this entry is deleted.
 	 * We use refcnt=-1 to alert lockless readers this entry is deleted.
 	 */
 	 */
 	if (atomic_cmpxchg(&p->refcnt, 1, -1) == 1) {
 	if (atomic_cmpxchg(&p->refcnt, 1, -1) == 1) {
-		struct inet_peer __rcu **stack[PEER_MAXDEPTH];
 		struct inet_peer __rcu ***stackptr, ***delp;
 		struct inet_peer __rcu ***stackptr, ***delp;
 		if (lookup(&p->daddr, stack, base) != p)
 		if (lookup(&p->daddr, stack, base) != p)
 			BUG();
 			BUG();
@@ -422,7 +422,7 @@ static struct inet_peer_base *peer_to_base(struct inet_peer *p)
 }
 }
 
 
 /* May be called with local BH enabled. */
 /* May be called with local BH enabled. */
-static int cleanup_once(unsigned long ttl)
+static int cleanup_once(unsigned long ttl, struct inet_peer __rcu **stack[PEER_MAXDEPTH])
 {
 {
 	struct inet_peer *p = NULL;
 	struct inet_peer *p = NULL;
 
 
@@ -454,7 +454,7 @@ static int cleanup_once(unsigned long ttl)
 		 * happen because of entry limits in route cache. */
 		 * happen because of entry limits in route cache. */
 		return -1;
 		return -1;
 
 
-	unlink_from_pool(p, peer_to_base(p));
+	unlink_from_pool(p, peer_to_base(p), stack);
 	return 0;
 	return 0;
 }
 }
 
 
@@ -524,7 +524,7 @@ struct inet_peer *inet_getpeer(struct inetpeer_addr *daddr, int create)
 
 
 	if (base->total >= inet_peer_threshold)
 	if (base->total >= inet_peer_threshold)
 		/* Remove one less-recently-used entry. */
 		/* Remove one less-recently-used entry. */
-		cleanup_once(0);
+		cleanup_once(0, stack);
 
 
 	return p;
 	return p;
 }
 }
@@ -540,6 +540,7 @@ static void peer_check_expire(unsigned long dummy)
 {
 {
 	unsigned long now = jiffies;
 	unsigned long now = jiffies;
 	int ttl, total;
 	int ttl, total;
+	struct inet_peer __rcu **stack[PEER_MAXDEPTH];
 
 
 	total = compute_total();
 	total = compute_total();
 	if (total >= inet_peer_threshold)
 	if (total >= inet_peer_threshold)
@@ -548,7 +549,7 @@ static void peer_check_expire(unsigned long dummy)
 		ttl = inet_peer_maxttl
 		ttl = inet_peer_maxttl
 				- (inet_peer_maxttl - inet_peer_minttl) / HZ *
 				- (inet_peer_maxttl - inet_peer_minttl) / HZ *
 					total / inet_peer_threshold * HZ;
 					total / inet_peer_threshold * HZ;
-	while (!cleanup_once(ttl)) {
+	while (!cleanup_once(ttl, stack)) {
 		if (jiffies != now)
 		if (jiffies != now)
 			break;
 			break;
 	}
 	}

+ 3 - 3
net/ipv4/ip_options.c

@@ -329,7 +329,7 @@ int ip_options_compile(struct net *net,
 					pp_ptr = optptr + 2;
 					pp_ptr = optptr + 2;
 					goto error;
 					goto error;
 				}
 				}
-				if (skb) {
+				if (rt) {
 					memcpy(&optptr[optptr[2]-1], &rt->rt_spec_dst, 4);
 					memcpy(&optptr[optptr[2]-1], &rt->rt_spec_dst, 4);
 					opt->is_changed = 1;
 					opt->is_changed = 1;
 				}
 				}
@@ -371,7 +371,7 @@ int ip_options_compile(struct net *net,
 						goto error;
 						goto error;
 					}
 					}
 					opt->ts = optptr - iph;
 					opt->ts = optptr - iph;
-					if (skb) {
+					if (rt)  {
 						memcpy(&optptr[optptr[2]-1], &rt->rt_spec_dst, 4);
 						memcpy(&optptr[optptr[2]-1], &rt->rt_spec_dst, 4);
 						timeptr = (__be32*)&optptr[optptr[2]+3];
 						timeptr = (__be32*)&optptr[optptr[2]+3];
 					}
 					}
@@ -603,7 +603,7 @@ int ip_options_rcv_srr(struct sk_buff *skb)
 	unsigned long orefdst;
 	unsigned long orefdst;
 	int err;
 	int err;
 
 
-	if (!opt->srr)
+	if (!opt->srr || !rt)
 		return 0;
 		return 0;
 
 
 	if (skb->pkt_type != PACKET_HOST)
 	if (skb->pkt_type != PACKET_HOST)

+ 0 - 3
net/ipv4/sysctl_net_ipv4.c

@@ -311,7 +311,6 @@ static struct ctl_table ipv4_table[] = {
 		.mode		= 0644,
 		.mode		= 0644,
 		.proc_handler	= proc_do_large_bitmap,
 		.proc_handler	= proc_do_large_bitmap,
 	},
 	},
-#ifdef CONFIG_IP_MULTICAST
 	{
 	{
 		.procname	= "igmp_max_memberships",
 		.procname	= "igmp_max_memberships",
 		.data		= &sysctl_igmp_max_memberships,
 		.data		= &sysctl_igmp_max_memberships,
@@ -319,8 +318,6 @@ static struct ctl_table ipv4_table[] = {
 		.mode		= 0644,
 		.mode		= 0644,
 		.proc_handler	= proc_dointvec
 		.proc_handler	= proc_dointvec
 	},
 	},
-
-#endif
 	{
 	{
 		.procname	= "igmp_max_msf",
 		.procname	= "igmp_max_msf",
 		.data		= &sysctl_igmp_max_msf,
 		.data		= &sysctl_igmp_max_msf,

+ 1 - 1
net/ipv6/inet6_connection_sock.c

@@ -44,7 +44,7 @@ int inet6_csk_bind_conflict(const struct sock *sk,
 		     !sk2->sk_bound_dev_if ||
 		     !sk2->sk_bound_dev_if ||
 		     sk->sk_bound_dev_if == sk2->sk_bound_dev_if) &&
 		     sk->sk_bound_dev_if == sk2->sk_bound_dev_if) &&
 		    (!sk->sk_reuse || !sk2->sk_reuse ||
 		    (!sk->sk_reuse || !sk2->sk_reuse ||
-		     ((1 << sk2->sk_state) & (TCPF_LISTEN | TCPF_CLOSE))) &&
+		     sk2->sk_state == TCP_LISTEN) &&
 		     ipv6_rcv_saddr_equal(sk, sk2))
 		     ipv6_rcv_saddr_equal(sk, sk2))
 			break;
 			break;
 	}
 	}

+ 1 - 2
net/irda/af_irda.c

@@ -1297,8 +1297,7 @@ static int irda_sendmsg(struct kiocb *iocb, struct socket *sock,
 	/* Note : socket.c set MSG_EOR on SEQPACKET sockets */
 	/* Note : socket.c set MSG_EOR on SEQPACKET sockets */
 	if (msg->msg_flags & ~(MSG_DONTWAIT | MSG_EOR | MSG_CMSG_COMPAT |
 	if (msg->msg_flags & ~(MSG_DONTWAIT | MSG_EOR | MSG_CMSG_COMPAT |
 			       MSG_NOSIGNAL)) {
 			       MSG_NOSIGNAL)) {
-		err = -EINVAL;
-		goto out;
+		return -EINVAL;
 	}
 	}
 
 
 	lock_sock(sk);
 	lock_sock(sk);

+ 1 - 2
net/llc/llc_input.c

@@ -121,8 +121,7 @@ static inline int llc_fixup_skb(struct sk_buff *skb)
 		s32 data_size = ntohs(pdulen) - llc_len;
 		s32 data_size = ntohs(pdulen) - llc_len;
 
 
 		if (data_size < 0 ||
 		if (data_size < 0 ||
-		    ((skb_tail_pointer(skb) -
-		      (u8 *)pdu) - llc_len) < data_size)
+		    !pskb_may_pull(skb, data_size))
 			return 0;
 			return 0;
 		if (unlikely(pskb_trim_rcsum(skb, data_size)))
 		if (unlikely(pskb_trim_rcsum(skb, data_size)))
 			return 0;
 			return 0;

+ 4 - 0
net/sctp/associola.c

@@ -569,6 +569,8 @@ void sctp_assoc_rm_peer(struct sctp_association *asoc,
 		sctp_assoc_set_primary(asoc, transport);
 		sctp_assoc_set_primary(asoc, transport);
 	if (asoc->peer.active_path == peer)
 	if (asoc->peer.active_path == peer)
 		asoc->peer.active_path = transport;
 		asoc->peer.active_path = transport;
+	if (asoc->peer.retran_path == peer)
+		asoc->peer.retran_path = transport;
 	if (asoc->peer.last_data_from == peer)
 	if (asoc->peer.last_data_from == peer)
 		asoc->peer.last_data_from = transport;
 		asoc->peer.last_data_from = transport;
 
 
@@ -1323,6 +1325,8 @@ void sctp_assoc_update_retran_path(struct sctp_association *asoc)
 
 
 	if (t)
 	if (t)
 		asoc->peer.retran_path = t;
 		asoc->peer.retran_path = t;
+	else
+		t = asoc->peer.retran_path;
 
 
 	SCTP_DEBUG_PRINTK_IPADDR("sctp_assoc_update_retran_path:association"
 	SCTP_DEBUG_PRINTK_IPADDR("sctp_assoc_update_retran_path:association"
 				 " %p addr: ",
 				 " %p addr: ",