mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	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: (32 commits) ucc_geth: Fix oops when using fixed-link support dm9000: locking bugfix net: update dnet.c for bus_id removal dnet: DNET should depend on HAS_IOMEM dca: add missing copyright/license headers nl80211: Check that function pointer != NULL before using it sungem: missing net_device_ops be2net: fix to restore vlan ids into BE2 during a IF DOWN->UP cycle be2net: replenish when posting to rx-queue is starved in out of mem conditions bas_gigaset: correctly allocate USB interrupt transfer buffer smsc911x: reset last known duplex and carrier on open sh_eth: Fix mistake of the address of SH7763 sh_eth: Change handling of IRQ netns: oops in ip[6]_frag_reasm incrementing stats net: kfree(napi->skb) => kfree_skb net: fix sctp breakage ipv6: fix display of local and remote sit endpoints net: Document /proc/sys/net/core/netdev_budget tulip: fix crash on iface up with shirq debug virtio_net: Make virtio_net support carrier detection ...
This commit is contained in:
		
						commit
						d56ffd38a9
					
				
					 39 changed files with 314 additions and 121 deletions
				
			
		| 
						 | 
					@ -1478,6 +1478,13 @@ of problems on the network like duplicate address or bad checksums. Normally,
 | 
				
			||||||
this should be enabled, but if the problem persists the messages can be
 | 
					this should be enabled, but if the problem persists the messages can be
 | 
				
			||||||
disabled.
 | 
					disabled.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					netdev_budget
 | 
				
			||||||
 | 
					-------------
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					Maximum number of packets taken from all interfaces in one polling cycle (NAPI
 | 
				
			||||||
 | 
					poll). In one polling cycle interfaces which are registered to polling are
 | 
				
			||||||
 | 
					probed in a round-robin manner. The limit of packets in one such probe can be
 | 
				
			||||||
 | 
					set per-device via sysfs class/net/<device>/weight .
 | 
				
			||||||
 | 
					
 | 
				
			||||||
netdev_max_backlog
 | 
					netdev_max_backlog
 | 
				
			||||||
------------------
 | 
					------------------
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,3 +1,24 @@
 | 
				
			||||||
 | 
					/*
 | 
				
			||||||
 | 
					 * Copyright(c) 2007 - 2009 Intel Corporation. All rights reserved.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * This program is free software; you can redistribute it and/or modify it
 | 
				
			||||||
 | 
					 * under the terms of the GNU General Public License as published by the Free
 | 
				
			||||||
 | 
					 * Software Foundation; either version 2 of the License, or (at your option)
 | 
				
			||||||
 | 
					 * any later version.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * This program is distributed in the hope that it will be useful, but WITHOUT
 | 
				
			||||||
 | 
					 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 | 
				
			||||||
 | 
					 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 | 
				
			||||||
 | 
					 * more details.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * You should have received a copy of the GNU General Public License along with
 | 
				
			||||||
 | 
					 * this program; if not, write to the Free Software Foundation, Inc., 59
 | 
				
			||||||
 | 
					 * Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * The full GNU General Public License is included in this distribution in the
 | 
				
			||||||
 | 
					 * file called COPYING.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <linux/kernel.h>
 | 
					#include <linux/kernel.h>
 | 
				
			||||||
#include <linux/spinlock.h>
 | 
					#include <linux/spinlock.h>
 | 
				
			||||||
#include <linux/device.h>
 | 
					#include <linux/device.h>
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -46,6 +46,9 @@ MODULE_PARM_DESC(cidmode, "Call-ID mode");
 | 
				
			||||||
/* length limit according to Siemens 3070usb-protokoll.doc ch. 2.1 */
 | 
					/* length limit according to Siemens 3070usb-protokoll.doc ch. 2.1 */
 | 
				
			||||||
#define IF_WRITEBUF 264
 | 
					#define IF_WRITEBUF 264
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/* interrupt pipe message size according to ibid. ch. 2.2 */
 | 
				
			||||||
 | 
					#define IP_MSGSIZE 3
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Values for the Gigaset 307x */
 | 
					/* Values for the Gigaset 307x */
 | 
				
			||||||
#define USB_GIGA_VENDOR_ID      0x0681
 | 
					#define USB_GIGA_VENDOR_ID      0x0681
 | 
				
			||||||
#define USB_3070_PRODUCT_ID     0x0001
 | 
					#define USB_3070_PRODUCT_ID     0x0001
 | 
				
			||||||
| 
						 | 
					@ -110,7 +113,7 @@ struct bas_cardstate {
 | 
				
			||||||
	unsigned char		*rcvbuf;	/* AT reply receive buffer */
 | 
						unsigned char		*rcvbuf;	/* AT reply receive buffer */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct urb		*urb_int_in;	/* URB for interrupt pipe */
 | 
						struct urb		*urb_int_in;	/* URB for interrupt pipe */
 | 
				
			||||||
	unsigned char		int_in_buf[3];
 | 
						unsigned char		*int_in_buf;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spinlock_t		lock;		/* locks all following */
 | 
						spinlock_t		lock;		/* locks all following */
 | 
				
			||||||
	int			basstate;	/* bitmap (BS_*) */
 | 
						int			basstate;	/* bitmap (BS_*) */
 | 
				
			||||||
| 
						 | 
					@ -657,7 +660,7 @@ static void read_int_callback(struct urb *urb)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* drop incomplete packets even if the missing bytes wouldn't matter */
 | 
						/* drop incomplete packets even if the missing bytes wouldn't matter */
 | 
				
			||||||
	if (unlikely(urb->actual_length < 3)) {
 | 
						if (unlikely(urb->actual_length < IP_MSGSIZE)) {
 | 
				
			||||||
		dev_warn(cs->dev, "incomplete interrupt packet (%d bytes)\n",
 | 
							dev_warn(cs->dev, "incomplete interrupt packet (%d bytes)\n",
 | 
				
			||||||
			 urb->actual_length);
 | 
								 urb->actual_length);
 | 
				
			||||||
		goto resubmit;
 | 
							goto resubmit;
 | 
				
			||||||
| 
						 | 
					@ -2127,6 +2130,7 @@ static void gigaset_reinitbcshw(struct bc_state *bcs)
 | 
				
			||||||
static void gigaset_freecshw(struct cardstate *cs)
 | 
					static void gigaset_freecshw(struct cardstate *cs)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	/* timers, URBs and rcvbuf are disposed of in disconnect */
 | 
						/* timers, URBs and rcvbuf are disposed of in disconnect */
 | 
				
			||||||
 | 
						kfree(cs->hw.bas->int_in_buf);
 | 
				
			||||||
	kfree(cs->hw.bas);
 | 
						kfree(cs->hw.bas);
 | 
				
			||||||
	cs->hw.bas = NULL;
 | 
						cs->hw.bas = NULL;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -2140,6 +2144,12 @@ static int gigaset_initcshw(struct cardstate *cs)
 | 
				
			||||||
		pr_err("out of memory\n");
 | 
							pr_err("out of memory\n");
 | 
				
			||||||
		return 0;
 | 
							return 0;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
						ucs->int_in_buf = kmalloc(IP_MSGSIZE, GFP_KERNEL);
 | 
				
			||||||
 | 
						if (!ucs->int_in_buf) {
 | 
				
			||||||
 | 
							kfree(ucs);
 | 
				
			||||||
 | 
							pr_err("out of memory\n");
 | 
				
			||||||
 | 
							return 0;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ucs->urb_cmd_in = NULL;
 | 
						ucs->urb_cmd_in = NULL;
 | 
				
			||||||
	ucs->urb_cmd_out = NULL;
 | 
						ucs->urb_cmd_out = NULL;
 | 
				
			||||||
| 
						 | 
					@ -2292,7 +2302,7 @@ static int gigaset_probe(struct usb_interface *interface,
 | 
				
			||||||
	usb_fill_int_urb(ucs->urb_int_in, udev,
 | 
						usb_fill_int_urb(ucs->urb_int_in, udev,
 | 
				
			||||||
			 usb_rcvintpipe(udev,
 | 
								 usb_rcvintpipe(udev,
 | 
				
			||||||
					(endpoint->bEndpointAddress) & 0x0f),
 | 
										(endpoint->bEndpointAddress) & 0x0f),
 | 
				
			||||||
			 ucs->int_in_buf, 3, read_int_callback, cs,
 | 
								 ucs->int_in_buf, IP_MSGSIZE, read_int_callback, cs,
 | 
				
			||||||
			 endpoint->bInterval);
 | 
								 endpoint->bInterval);
 | 
				
			||||||
	if ((rc = usb_submit_urb(ucs->urb_int_in, GFP_KERNEL)) != 0) {
 | 
						if ((rc = usb_submit_urb(ucs->urb_int_in, GFP_KERNEL)) != 0) {
 | 
				
			||||||
		dev_err(cs->dev, "could not submit interrupt URB: %s\n",
 | 
							dev_err(cs->dev, "could not submit interrupt URB: %s\n",
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1042,7 +1042,7 @@ config NI65
 | 
				
			||||||
 | 
					
 | 
				
			||||||
config DNET
 | 
					config DNET
 | 
				
			||||||
	tristate "Dave ethernet support (DNET)"
 | 
						tristate "Dave ethernet support (DNET)"
 | 
				
			||||||
	depends on NET_ETHERNET
 | 
						depends on NET_ETHERNET && HAS_IOMEM
 | 
				
			||||||
	select PHYLIB
 | 
						select PHYLIB
 | 
				
			||||||
	help
 | 
						help
 | 
				
			||||||
	  The Dave ethernet interface (DNET) is found on Qong Board FPGA.
 | 
						  The Dave ethernet interface (DNET) is found on Qong Board FPGA.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -194,6 +194,7 @@ struct be_adapter {
 | 
				
			||||||
	struct be_eq_obj rx_eq;
 | 
						struct be_eq_obj rx_eq;
 | 
				
			||||||
	struct be_rx_obj rx_obj;
 | 
						struct be_rx_obj rx_obj;
 | 
				
			||||||
	u32 big_page_size;	/* Compounded page size shared by rx wrbs */
 | 
						u32 big_page_size;	/* Compounded page size shared by rx wrbs */
 | 
				
			||||||
 | 
						bool rx_post_starved;	/* Zero rx frags have been posted to BE */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct vlan_group *vlan_grp;
 | 
						struct vlan_group *vlan_grp;
 | 
				
			||||||
	u16 num_vlans;
 | 
						u16 num_vlans;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -273,26 +273,6 @@ static void be_rx_eqd_update(struct be_adapter *adapter)
 | 
				
			||||||
	rx_eq->cur_eqd = eqd;
 | 
						rx_eq->cur_eqd = eqd;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void be_worker(struct work_struct *work)
 | 
					 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	struct be_adapter *adapter =
 | 
					 | 
				
			||||||
		container_of(work, struct be_adapter, work.work);
 | 
					 | 
				
			||||||
	int status;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/* Check link */
 | 
					 | 
				
			||||||
	be_link_status_update(adapter);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/* Get Stats */
 | 
					 | 
				
			||||||
	status = be_cmd_get_stats(&adapter->ctrl, &adapter->stats.cmd);
 | 
					 | 
				
			||||||
	if (!status)
 | 
					 | 
				
			||||||
		netdev_stats_update(adapter);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/* Set EQ delay */
 | 
					 | 
				
			||||||
	be_rx_eqd_update(adapter);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000));
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
static struct net_device_stats *be_get_stats(struct net_device *dev)
 | 
					static struct net_device_stats *be_get_stats(struct net_device *dev)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct be_adapter *adapter = netdev_priv(dev);
 | 
						struct be_adapter *adapter = netdev_priv(dev);
 | 
				
			||||||
| 
						 | 
					@ -493,7 +473,7 @@ static int be_change_mtu(struct net_device *netdev, int new_mtu)
 | 
				
			||||||
 * program them in BE.  If more than BE_NUM_VLANS_SUPPORTED are configured,
 | 
					 * program them in BE.  If more than BE_NUM_VLANS_SUPPORTED are configured,
 | 
				
			||||||
 * set the BE in promiscuous VLAN mode.
 | 
					 * set the BE in promiscuous VLAN mode.
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
static void be_vids_config(struct net_device *netdev)
 | 
					static void be_vid_config(struct net_device *netdev)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct be_adapter *adapter = netdev_priv(netdev);
 | 
						struct be_adapter *adapter = netdev_priv(netdev);
 | 
				
			||||||
	u16 vtag[BE_NUM_VLANS_SUPPORTED];
 | 
						u16 vtag[BE_NUM_VLANS_SUPPORTED];
 | 
				
			||||||
| 
						 | 
					@ -536,7 +516,7 @@ static void be_vlan_add_vid(struct net_device *netdev, u16 vid)
 | 
				
			||||||
	adapter->num_vlans++;
 | 
						adapter->num_vlans++;
 | 
				
			||||||
	adapter->vlan_tag[vid] = 1;
 | 
						adapter->vlan_tag[vid] = 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	be_vids_config(netdev);
 | 
						be_vid_config(netdev);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void be_vlan_rem_vid(struct net_device *netdev, u16 vid)
 | 
					static void be_vlan_rem_vid(struct net_device *netdev, u16 vid)
 | 
				
			||||||
| 
						 | 
					@ -547,7 +527,7 @@ static void be_vlan_rem_vid(struct net_device *netdev, u16 vid)
 | 
				
			||||||
	adapter->vlan_tag[vid] = 0;
 | 
						adapter->vlan_tag[vid] = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	vlan_group_set_device(adapter->vlan_grp, vid, NULL);
 | 
						vlan_group_set_device(adapter->vlan_grp, vid, NULL);
 | 
				
			||||||
	be_vids_config(netdev);
 | 
						be_vid_config(netdev);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void be_set_multicast_filter(struct net_device *netdev)
 | 
					static void be_set_multicast_filter(struct net_device *netdev)
 | 
				
			||||||
| 
						 | 
					@ -900,8 +880,11 @@ static void be_post_rx_frags(struct be_adapter *adapter)
 | 
				
			||||||
		page_info->last_page_user = true;
 | 
							page_info->last_page_user = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (posted) {
 | 
						if (posted) {
 | 
				
			||||||
		be_rxq_notify(&adapter->ctrl, rxq->id, posted);
 | 
					 | 
				
			||||||
		atomic_add(posted, &rxq->used);
 | 
							atomic_add(posted, &rxq->used);
 | 
				
			||||||
 | 
							be_rxq_notify(&adapter->ctrl, rxq->id, posted);
 | 
				
			||||||
 | 
						} else if (atomic_read(&rxq->used) == 0) {
 | 
				
			||||||
 | 
							/* Let be_worker replenish when memory is available */
 | 
				
			||||||
 | 
							adapter->rx_post_starved = true;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return;
 | 
						return;
 | 
				
			||||||
| 
						 | 
					@ -1305,6 +1288,31 @@ int be_poll_tx(struct napi_struct *napi, int budget)
 | 
				
			||||||
	return 1;
 | 
						return 1;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static void be_worker(struct work_struct *work)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						struct be_adapter *adapter =
 | 
				
			||||||
 | 
							container_of(work, struct be_adapter, work.work);
 | 
				
			||||||
 | 
						int status;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/* Check link */
 | 
				
			||||||
 | 
						be_link_status_update(adapter);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/* Get Stats */
 | 
				
			||||||
 | 
						status = be_cmd_get_stats(&adapter->ctrl, &adapter->stats.cmd);
 | 
				
			||||||
 | 
						if (!status)
 | 
				
			||||||
 | 
							netdev_stats_update(adapter);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/* Set EQ delay */
 | 
				
			||||||
 | 
						be_rx_eqd_update(adapter);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (adapter->rx_post_starved) {
 | 
				
			||||||
 | 
							adapter->rx_post_starved = false;
 | 
				
			||||||
 | 
							be_post_rx_frags(adapter);
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						schedule_delayed_work(&adapter->work, msecs_to_jiffies(1000));
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void be_msix_enable(struct be_adapter *adapter)
 | 
					static void be_msix_enable(struct be_adapter *adapter)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int i, status;
 | 
						int i, status;
 | 
				
			||||||
| 
						 | 
					@ -1422,6 +1430,8 @@ static int be_open(struct net_device *netdev)
 | 
				
			||||||
	if (status != 0)
 | 
						if (status != 0)
 | 
				
			||||||
		goto do_none;
 | 
							goto do_none;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						be_vid_config(netdev);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	status = be_cmd_set_flow_control(ctrl, true, true);
 | 
						status = be_cmd_set_flow_control(ctrl, true, true);
 | 
				
			||||||
	if (status != 0)
 | 
						if (status != 0)
 | 
				
			||||||
		goto if_destroy;
 | 
							goto if_destroy;
 | 
				
			||||||
| 
						 | 
					@ -1856,8 +1866,6 @@ static int be_resume(struct pci_dev *pdev)
 | 
				
			||||||
	pci_set_power_state(pdev, 0);
 | 
						pci_set_power_state(pdev, 0);
 | 
				
			||||||
	pci_restore_state(pdev);
 | 
						pci_restore_state(pdev);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	be_vids_config(netdev);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (netif_running(netdev)) {
 | 
						if (netif_running(netdev)) {
 | 
				
			||||||
		rtnl_lock();
 | 
							rtnl_lock();
 | 
				
			||||||
		be_open(netdev);
 | 
							be_open(netdev);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -57,8 +57,8 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define DRV_MODULE_NAME		"bnx2"
 | 
					#define DRV_MODULE_NAME		"bnx2"
 | 
				
			||||||
#define PFX DRV_MODULE_NAME	": "
 | 
					#define PFX DRV_MODULE_NAME	": "
 | 
				
			||||||
#define DRV_MODULE_VERSION	"1.9.2"
 | 
					#define DRV_MODULE_VERSION	"1.9.3"
 | 
				
			||||||
#define DRV_MODULE_RELDATE	"Feb 11, 2009"
 | 
					#define DRV_MODULE_RELDATE	"March 17, 2009"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define RUN_AT(x) (jiffies + (x))
 | 
					#define RUN_AT(x) (jiffies + (x))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -5843,9 +5843,6 @@ bnx2_enable_msix(struct bnx2 *bp, int msix_vecs)
 | 
				
			||||||
	for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) {
 | 
						for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) {
 | 
				
			||||||
		msix_ent[i].entry = i;
 | 
							msix_ent[i].entry = i;
 | 
				
			||||||
		msix_ent[i].vector = 0;
 | 
							msix_ent[i].vector = 0;
 | 
				
			||||||
 | 
					 | 
				
			||||||
		snprintf(bp->irq_tbl[i].name, len, "%s-%d", dev->name, i);
 | 
					 | 
				
			||||||
		bp->irq_tbl[i].handler = bnx2_msi_1shot;
 | 
					 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	rc = pci_enable_msix(bp->pdev, msix_ent, BNX2_MAX_MSIX_VEC);
 | 
						rc = pci_enable_msix(bp->pdev, msix_ent, BNX2_MAX_MSIX_VEC);
 | 
				
			||||||
| 
						 | 
					@ -5854,8 +5851,11 @@ bnx2_enable_msix(struct bnx2 *bp, int msix_vecs)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	bp->irq_nvecs = msix_vecs;
 | 
						bp->irq_nvecs = msix_vecs;
 | 
				
			||||||
	bp->flags |= BNX2_FLAG_USING_MSIX | BNX2_FLAG_ONE_SHOT_MSI;
 | 
						bp->flags |= BNX2_FLAG_USING_MSIX | BNX2_FLAG_ONE_SHOT_MSI;
 | 
				
			||||||
	for (i = 0; i < BNX2_MAX_MSIX_VEC; i++)
 | 
						for (i = 0; i < BNX2_MAX_MSIX_VEC; i++) {
 | 
				
			||||||
		bp->irq_tbl[i].vector = msix_ent[i].vector;
 | 
							bp->irq_tbl[i].vector = msix_ent[i].vector;
 | 
				
			||||||
 | 
							snprintf(bp->irq_tbl[i].name, len, "%s-%d", dev->name, i);
 | 
				
			||||||
 | 
							bp->irq_tbl[i].handler = bnx2_msi_1shot;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void
 | 
					static void
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3537,11 +3537,26 @@ static int bond_slave_netdev_event(unsigned long event, struct net_device *slave
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	case NETDEV_CHANGE:
 | 
						case NETDEV_CHANGE:
 | 
				
			||||||
		/*
 | 
							if (bond->params.mode == BOND_MODE_8023AD || bond_is_lb(bond)) {
 | 
				
			||||||
		 * TODO: is this what we get if somebody
 | 
								struct slave *slave;
 | 
				
			||||||
		 * sets up a hierarchical bond, then rmmod's
 | 
					
 | 
				
			||||||
		 * one of the slave bonding devices?
 | 
								slave = bond_get_slave_by_dev(bond, slave_dev);
 | 
				
			||||||
		 */
 | 
								if (slave) {
 | 
				
			||||||
 | 
									u16 old_speed = slave->speed;
 | 
				
			||||||
 | 
									u16 old_duplex = slave->duplex;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									bond_update_speed_duplex(slave);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									if (bond_is_lb(bond))
 | 
				
			||||||
 | 
										break;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
									if (old_speed != slave->speed)
 | 
				
			||||||
 | 
										bond_3ad_adapter_speed_changed(slave);
 | 
				
			||||||
 | 
									if (old_duplex != slave->duplex)
 | 
				
			||||||
 | 
										bond_3ad_adapter_duplex_changed(slave);
 | 
				
			||||||
 | 
								}
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		break;
 | 
							break;
 | 
				
			||||||
	case NETDEV_DOWN:
 | 
						case NETDEV_DOWN:
 | 
				
			||||||
		/*
 | 
							/*
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -930,13 +930,15 @@ static irqreturn_t dm9000_interrupt(int irq, void *dev_id)
 | 
				
			||||||
	struct net_device *dev = dev_id;
 | 
						struct net_device *dev = dev_id;
 | 
				
			||||||
	board_info_t *db = netdev_priv(dev);
 | 
						board_info_t *db = netdev_priv(dev);
 | 
				
			||||||
	int int_status;
 | 
						int int_status;
 | 
				
			||||||
 | 
						unsigned long flags;
 | 
				
			||||||
	u8 reg_save;
 | 
						u8 reg_save;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	dm9000_dbg(db, 3, "entering %s\n", __func__);
 | 
						dm9000_dbg(db, 3, "entering %s\n", __func__);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* A real interrupt coming */
 | 
						/* A real interrupt coming */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spin_lock(&db->lock);
 | 
						/* holders of db->lock must always block IRQs */
 | 
				
			||||||
 | 
						spin_lock_irqsave(&db->lock, flags);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Save previous register address */
 | 
						/* Save previous register address */
 | 
				
			||||||
	reg_save = readb(db->io_addr);
 | 
						reg_save = readb(db->io_addr);
 | 
				
			||||||
| 
						 | 
					@ -972,7 +974,7 @@ static irqreturn_t dm9000_interrupt(int irq, void *dev_id)
 | 
				
			||||||
	/* Restore previous register address */
 | 
						/* Restore previous register address */
 | 
				
			||||||
	writeb(reg_save, db->io_addr);
 | 
						writeb(reg_save, db->io_addr);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spin_unlock(&db->lock);
 | 
						spin_unlock_irqrestore(&db->lock, flags);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return IRQ_HANDLED;
 | 
						return IRQ_HANDLED;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -280,11 +280,11 @@ static int dnet_mii_probe(struct net_device *dev)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* attach the mac to the phy */
 | 
						/* attach the mac to the phy */
 | 
				
			||||||
	if (bp->capabilities & DNET_HAS_RMII) {
 | 
						if (bp->capabilities & DNET_HAS_RMII) {
 | 
				
			||||||
		phydev = phy_connect(dev, phydev->dev.bus_id,
 | 
							phydev = phy_connect(dev, dev_name(&phydev->dev),
 | 
				
			||||||
				     &dnet_handle_link_change, 0,
 | 
									     &dnet_handle_link_change, 0,
 | 
				
			||||||
				     PHY_INTERFACE_MODE_RMII);
 | 
									     PHY_INTERFACE_MODE_RMII);
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
		phydev = phy_connect(dev, phydev->dev.bus_id,
 | 
							phydev = phy_connect(dev, dev_name(&phydev->dev),
 | 
				
			||||||
				     &dnet_handle_link_change, 0,
 | 
									     &dnet_handle_link_change, 0,
 | 
				
			||||||
				     PHY_INTERFACE_MODE_MII);
 | 
									     PHY_INTERFACE_MODE_MII);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -927,7 +927,7 @@ static int __devinit dnet_probe(struct platform_device *pdev)
 | 
				
			||||||
	phydev = bp->phy_dev;
 | 
						phydev = bp->phy_dev;
 | 
				
			||||||
	dev_info(&pdev->dev, "attached PHY driver [%s] "
 | 
						dev_info(&pdev->dev, "attached PHY driver [%s] "
 | 
				
			||||||
	       "(mii_bus:phy_addr=%s, irq=%d)\n",
 | 
						       "(mii_bus:phy_addr=%s, irq=%d)\n",
 | 
				
			||||||
	       phydev->drv->name, phydev->dev.bus_id, phydev->irq);
 | 
						       phydev->drv->name, dev_name(&phydev->dev), phydev->irq);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -687,6 +687,7 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct net_device *ndev = netdev;
 | 
						struct net_device *ndev = netdev;
 | 
				
			||||||
	struct sh_eth_private *mdp = netdev_priv(ndev);
 | 
						struct sh_eth_private *mdp = netdev_priv(ndev);
 | 
				
			||||||
 | 
						irqreturn_t ret = IRQ_NONE;
 | 
				
			||||||
	u32 ioaddr, boguscnt = RX_RING_SIZE;
 | 
						u32 ioaddr, boguscnt = RX_RING_SIZE;
 | 
				
			||||||
	u32 intr_status = 0;
 | 
						u32 intr_status = 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -696,7 +697,13 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev)
 | 
				
			||||||
	/* Get interrpt stat */
 | 
						/* Get interrpt stat */
 | 
				
			||||||
	intr_status = ctrl_inl(ioaddr + EESR);
 | 
						intr_status = ctrl_inl(ioaddr + EESR);
 | 
				
			||||||
	/* Clear interrupt */
 | 
						/* Clear interrupt */
 | 
				
			||||||
 | 
						if (intr_status & (EESR_FRC | EESR_RMAF | EESR_RRF |
 | 
				
			||||||
 | 
								EESR_RTLF | EESR_RTSF | EESR_PRE | EESR_CERF |
 | 
				
			||||||
 | 
								TX_CHECK | EESR_ERR_CHECK)) {
 | 
				
			||||||
		ctrl_outl(intr_status, ioaddr + EESR);
 | 
							ctrl_outl(intr_status, ioaddr + EESR);
 | 
				
			||||||
 | 
							ret = IRQ_HANDLED;
 | 
				
			||||||
 | 
						} else
 | 
				
			||||||
 | 
							goto other_irq;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (intr_status & (EESR_FRC | /* Frame recv*/
 | 
						if (intr_status & (EESR_FRC | /* Frame recv*/
 | 
				
			||||||
			EESR_RMAF | /* Multi cast address recv*/
 | 
								EESR_RMAF | /* Multi cast address recv*/
 | 
				
			||||||
| 
						 | 
					@ -723,9 +730,10 @@ static irqreturn_t sh_eth_interrupt(int irq, void *netdev)
 | 
				
			||||||
		       ndev->name, intr_status);
 | 
							       ndev->name, intr_status);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					other_irq:
 | 
				
			||||||
	spin_unlock(&mdp->lock);
 | 
						spin_unlock(&mdp->lock);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return IRQ_HANDLED;
 | 
						return ret;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void sh_eth_timer(unsigned long data)
 | 
					static void sh_eth_timer(unsigned long data)
 | 
				
			||||||
| 
						 | 
					@ -844,7 +852,13 @@ static int sh_eth_open(struct net_device *ndev)
 | 
				
			||||||
	int ret = 0;
 | 
						int ret = 0;
 | 
				
			||||||
	struct sh_eth_private *mdp = netdev_priv(ndev);
 | 
						struct sh_eth_private *mdp = netdev_priv(ndev);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ret = request_irq(ndev->irq, &sh_eth_interrupt, 0, ndev->name, ndev);
 | 
						ret = request_irq(ndev->irq, &sh_eth_interrupt,
 | 
				
			||||||
 | 
					#if defined(CONFIG_CPU_SUBTYPE_SH7763) || defined(CONFIG_CPU_SUBTYPE_SH7764)
 | 
				
			||||||
 | 
									IRQF_SHARED,
 | 
				
			||||||
 | 
					#else
 | 
				
			||||||
 | 
									0,
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
									ndev->name, ndev);
 | 
				
			||||||
	if (ret) {
 | 
						if (ret) {
 | 
				
			||||||
		printk(KERN_ERR "Can not assign IRQ number to %s\n", CARDNAME);
 | 
							printk(KERN_ERR "Can not assign IRQ number to %s\n", CARDNAME);
 | 
				
			||||||
		return ret;
 | 
							return ret;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -43,8 +43,8 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define SH7763_SKB_ALIGN 32
 | 
					#define SH7763_SKB_ALIGN 32
 | 
				
			||||||
/* Chip Base Address */
 | 
					/* Chip Base Address */
 | 
				
			||||||
# define SH_TSU_ADDR  0xFFE01800
 | 
					# define SH_TSU_ADDR	0xFEE01800
 | 
				
			||||||
# define ARSTR 		  0xFFE01800
 | 
					# define ARSTR			SH_TSU_ADDR
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* Chip Registers */
 | 
					/* Chip Registers */
 | 
				
			||||||
/* E-DMAC */
 | 
					/* E-DMAC */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1225,6 +1225,10 @@ static int smsc911x_open(struct net_device *dev)
 | 
				
			||||||
	dev_info(&dev->dev, "SMSC911x/921x identified at %#08lx, IRQ: %d\n",
 | 
						dev_info(&dev->dev, "SMSC911x/921x identified at %#08lx, IRQ: %d\n",
 | 
				
			||||||
		 (unsigned long)pdata->ioaddr, dev->irq);
 | 
							 (unsigned long)pdata->ioaddr, dev->irq);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/* Reset the last known duplex and carrier */
 | 
				
			||||||
 | 
						pdata->last_duplex = -1;
 | 
				
			||||||
 | 
						pdata->last_carrier = -1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Bring the PHY up */
 | 
						/* Bring the PHY up */
 | 
				
			||||||
	phy_start(pdata->phy_dev);
 | 
						phy_start(pdata->phy_dev);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2998,8 +2998,11 @@ static const struct net_device_ops gem_netdev_ops = {
 | 
				
			||||||
	.ndo_do_ioctl		= gem_ioctl,
 | 
						.ndo_do_ioctl		= gem_ioctl,
 | 
				
			||||||
	.ndo_tx_timeout		= gem_tx_timeout,
 | 
						.ndo_tx_timeout		= gem_tx_timeout,
 | 
				
			||||||
	.ndo_change_mtu		= gem_change_mtu,
 | 
						.ndo_change_mtu		= gem_change_mtu,
 | 
				
			||||||
	.ndo_set_mac_address 	= eth_mac_addr,
 | 
					 | 
				
			||||||
	.ndo_validate_addr	= eth_validate_addr,
 | 
						.ndo_validate_addr	= eth_validate_addr,
 | 
				
			||||||
 | 
						.ndo_set_mac_address    = gem_set_mac_address,
 | 
				
			||||||
 | 
					#ifdef CONFIG_NET_POLL_CONTROLLER
 | 
				
			||||||
 | 
						.ndo_poll_controller    = gem_poll_controller,
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static int __devinit gem_init_one(struct pci_dev *pdev,
 | 
					static int __devinit gem_init_one(struct pci_dev *pdev,
 | 
				
			||||||
| 
						 | 
					@ -3161,10 +3164,6 @@ static int __devinit gem_init_one(struct pci_dev *pdev,
 | 
				
			||||||
	dev->watchdog_timeo = 5 * HZ;
 | 
						dev->watchdog_timeo = 5 * HZ;
 | 
				
			||||||
	dev->irq = pdev->irq;
 | 
						dev->irq = pdev->irq;
 | 
				
			||||||
	dev->dma = 0;
 | 
						dev->dma = 0;
 | 
				
			||||||
	dev->set_mac_address = gem_set_mac_address;
 | 
					 | 
				
			||||||
#ifdef CONFIG_NET_POLL_CONTROLLER
 | 
					 | 
				
			||||||
	dev->poll_controller = gem_poll_controller;
 | 
					 | 
				
			||||||
#endif
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Set that now, in case PM kicks in now */
 | 
						/* Set that now, in case PM kicks in now */
 | 
				
			||||||
	pci_set_drvdata(pdev, dev);
 | 
						pci_set_drvdata(pdev, dev);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -255,6 +255,7 @@ const char tulip_media_cap[32] =
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static void tulip_tx_timeout(struct net_device *dev);
 | 
					static void tulip_tx_timeout(struct net_device *dev);
 | 
				
			||||||
static void tulip_init_ring(struct net_device *dev);
 | 
					static void tulip_init_ring(struct net_device *dev);
 | 
				
			||||||
 | 
					static void tulip_free_ring(struct net_device *dev);
 | 
				
			||||||
static int tulip_start_xmit(struct sk_buff *skb, struct net_device *dev);
 | 
					static int tulip_start_xmit(struct sk_buff *skb, struct net_device *dev);
 | 
				
			||||||
static int tulip_open(struct net_device *dev);
 | 
					static int tulip_open(struct net_device *dev);
 | 
				
			||||||
static int tulip_close(struct net_device *dev);
 | 
					static int tulip_close(struct net_device *dev);
 | 
				
			||||||
| 
						 | 
					@ -502,16 +503,21 @@ tulip_open(struct net_device *dev)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	int retval;
 | 
						int retval;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if ((retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev)))
 | 
					 | 
				
			||||||
		return retval;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	tulip_init_ring (dev);
 | 
						tulip_init_ring (dev);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						retval = request_irq(dev->irq, &tulip_interrupt, IRQF_SHARED, dev->name, dev);
 | 
				
			||||||
 | 
						if (retval)
 | 
				
			||||||
 | 
							goto free_ring;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	tulip_up (dev);
 | 
						tulip_up (dev);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	netif_start_queue (dev);
 | 
						netif_start_queue (dev);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					free_ring:
 | 
				
			||||||
 | 
						tulip_free_ring (dev);
 | 
				
			||||||
 | 
						return retval;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -768,23 +774,11 @@ static void tulip_down (struct net_device *dev)
 | 
				
			||||||
	tulip_set_power_state (tp, 0, 1);
 | 
						tulip_set_power_state (tp, 0, 1);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static void tulip_free_ring (struct net_device *dev)
 | 
				
			||||||
static int tulip_close (struct net_device *dev)
 | 
					 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct tulip_private *tp = netdev_priv(dev);
 | 
						struct tulip_private *tp = netdev_priv(dev);
 | 
				
			||||||
	void __iomem *ioaddr = tp->base_addr;
 | 
					 | 
				
			||||||
	int i;
 | 
						int i;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	netif_stop_queue (dev);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	tulip_down (dev);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (tulip_debug > 1)
 | 
					 | 
				
			||||||
		printk (KERN_DEBUG "%s: Shutting down ethercard, status was %2.2x.\n",
 | 
					 | 
				
			||||||
			dev->name, ioread32 (ioaddr + CSR5));
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	free_irq (dev->irq, dev);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	/* Free all the skbuffs in the Rx queue. */
 | 
						/* Free all the skbuffs in the Rx queue. */
 | 
				
			||||||
	for (i = 0; i < RX_RING_SIZE; i++) {
 | 
						for (i = 0; i < RX_RING_SIZE; i++) {
 | 
				
			||||||
		struct sk_buff *skb = tp->rx_buffers[i].skb;
 | 
							struct sk_buff *skb = tp->rx_buffers[i].skb;
 | 
				
			||||||
| 
						 | 
					@ -803,6 +797,7 @@ static int tulip_close (struct net_device *dev)
 | 
				
			||||||
			dev_kfree_skb (skb);
 | 
								dev_kfree_skb (skb);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for (i = 0; i < TX_RING_SIZE; i++) {
 | 
						for (i = 0; i < TX_RING_SIZE; i++) {
 | 
				
			||||||
		struct sk_buff *skb = tp->tx_buffers[i].skb;
 | 
							struct sk_buff *skb = tp->tx_buffers[i].skb;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -814,6 +809,24 @@ static int tulip_close (struct net_device *dev)
 | 
				
			||||||
		tp->tx_buffers[i].skb = NULL;
 | 
							tp->tx_buffers[i].skb = NULL;
 | 
				
			||||||
		tp->tx_buffers[i].mapping = 0;
 | 
							tp->tx_buffers[i].mapping = 0;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static int tulip_close (struct net_device *dev)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						struct tulip_private *tp = netdev_priv(dev);
 | 
				
			||||||
 | 
						void __iomem *ioaddr = tp->base_addr;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						netif_stop_queue (dev);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						tulip_down (dev);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (tulip_debug > 1)
 | 
				
			||||||
 | 
							printk (KERN_DEBUG "%s: Shutting down ethercard, status was %2.2x.\n",
 | 
				
			||||||
 | 
								dev->name, ioread32 (ioaddr + CSR5));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						free_irq (dev->irq, dev);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						tulip_free_ring (dev);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1536,32 +1536,15 @@ static void adjust_link(struct net_device *dev)
 | 
				
			||||||
static int init_phy(struct net_device *dev)
 | 
					static int init_phy(struct net_device *dev)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	struct ucc_geth_private *priv = netdev_priv(dev);
 | 
						struct ucc_geth_private *priv = netdev_priv(dev);
 | 
				
			||||||
	struct device_node *np = priv->node;
 | 
						struct ucc_geth_info *ug_info = priv->ug_info;
 | 
				
			||||||
	struct device_node *phy, *mdio;
 | 
					 | 
				
			||||||
	const phandle *ph;
 | 
					 | 
				
			||||||
	char bus_name[MII_BUS_ID_SIZE];
 | 
					 | 
				
			||||||
	const unsigned int *id;
 | 
					 | 
				
			||||||
	struct phy_device *phydev;
 | 
						struct phy_device *phydev;
 | 
				
			||||||
	char phy_id[BUS_ID_SIZE];
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	priv->oldlink = 0;
 | 
						priv->oldlink = 0;
 | 
				
			||||||
	priv->oldspeed = 0;
 | 
						priv->oldspeed = 0;
 | 
				
			||||||
	priv->oldduplex = -1;
 | 
						priv->oldduplex = -1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ph = of_get_property(np, "phy-handle", NULL);
 | 
						phydev = phy_connect(dev, ug_info->phy_bus_id, &adjust_link, 0,
 | 
				
			||||||
	phy = of_find_node_by_phandle(*ph);
 | 
								     priv->phy_interface);
 | 
				
			||||||
	mdio = of_get_parent(phy);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	id = of_get_property(phy, "reg", NULL);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	of_node_put(phy);
 | 
					 | 
				
			||||||
	of_node_put(mdio);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	uec_mdio_bus_name(bus_name, mdio);
 | 
					 | 
				
			||||||
	snprintf(phy_id, sizeof(phy_id), "%s:%02x",
 | 
					 | 
				
			||||||
                                bus_name, *id);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	phydev = phy_connect(dev, phy_id, &adjust_link, 0, priv->phy_interface);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (IS_ERR(phydev)) {
 | 
						if (IS_ERR(phydev)) {
 | 
				
			||||||
		printk("%s: Could not attach to PHY\n", dev->name);
 | 
							printk("%s: Could not attach to PHY\n", dev->name);
 | 
				
			||||||
| 
						 | 
					@ -3629,10 +3612,12 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
 | 
				
			||||||
	ug_info->uf_info.irq = irq_of_parse_and_map(np, 0);
 | 
						ug_info->uf_info.irq = irq_of_parse_and_map(np, 0);
 | 
				
			||||||
	fixed_link = of_get_property(np, "fixed-link", NULL);
 | 
						fixed_link = of_get_property(np, "fixed-link", NULL);
 | 
				
			||||||
	if (fixed_link) {
 | 
						if (fixed_link) {
 | 
				
			||||||
		snprintf(ug_info->mdio_bus, MII_BUS_ID_SIZE, "0");
 | 
							snprintf(ug_info->phy_bus_id, sizeof(ug_info->phy_bus_id),
 | 
				
			||||||
		ug_info->phy_address = fixed_link[0];
 | 
								 PHY_ID_FMT, "0", fixed_link[0]);
 | 
				
			||||||
		phy = NULL;
 | 
							phy = NULL;
 | 
				
			||||||
	} else {
 | 
						} else {
 | 
				
			||||||
 | 
							char bus_name[MII_BUS_ID_SIZE];
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		ph = of_get_property(np, "phy-handle", NULL);
 | 
							ph = of_get_property(np, "phy-handle", NULL);
 | 
				
			||||||
		phy = of_find_node_by_phandle(*ph);
 | 
							phy = of_find_node_by_phandle(*ph);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3643,7 +3628,6 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
 | 
				
			||||||
		prop = of_get_property(phy, "reg", NULL);
 | 
							prop = of_get_property(phy, "reg", NULL);
 | 
				
			||||||
		if (prop == NULL)
 | 
							if (prop == NULL)
 | 
				
			||||||
			return -1;
 | 
								return -1;
 | 
				
			||||||
		ug_info->phy_address = *prop;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
		/* Set the bus id */
 | 
							/* Set the bus id */
 | 
				
			||||||
		mdio = of_get_parent(phy);
 | 
							mdio = of_get_parent(phy);
 | 
				
			||||||
| 
						 | 
					@ -3657,7 +3641,9 @@ static int ucc_geth_probe(struct of_device* ofdev, const struct of_device_id *ma
 | 
				
			||||||
		if (err)
 | 
							if (err)
 | 
				
			||||||
			return -1;
 | 
								return -1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		snprintf(ug_info->mdio_bus, MII_BUS_ID_SIZE, "%x", res.start);
 | 
							uec_mdio_bus_name(bus_name, mdio);
 | 
				
			||||||
 | 
							snprintf(ug_info->phy_bus_id, sizeof(ug_info->phy_bus_id),
 | 
				
			||||||
 | 
								"%s:%02x", bus_name, *prop);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* get the phy interface type, or default to MII */
 | 
						/* get the phy interface type, or default to MII */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1091,8 +1091,7 @@ struct ucc_geth_info {
 | 
				
			||||||
	u32 eventRegMask;
 | 
						u32 eventRegMask;
 | 
				
			||||||
	u16 pausePeriod;
 | 
						u16 pausePeriod;
 | 
				
			||||||
	u16 extensionField;
 | 
						u16 extensionField;
 | 
				
			||||||
	u8 phy_address;
 | 
						char phy_bus_id[BUS_ID_SIZE];
 | 
				
			||||||
	char mdio_bus[MII_BUS_ID_SIZE];
 | 
					 | 
				
			||||||
	u8 weightfactor[NUM_TX_QUEUES];
 | 
						u8 weightfactor[NUM_TX_QUEUES];
 | 
				
			||||||
	u8 interruptcoalescingmaxvalue[NUM_RX_QUEUES];
 | 
						u8 interruptcoalescingmaxvalue[NUM_RX_QUEUES];
 | 
				
			||||||
	u8 l2qt[UCC_GETH_VLAN_PRIORITY_MAX];
 | 
						u8 l2qt[UCC_GETH_VLAN_PRIORITY_MAX];
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -612,6 +612,7 @@ static struct ethtool_ops virtnet_ethtool_ops = {
 | 
				
			||||||
	.set_tx_csum = virtnet_set_tx_csum,
 | 
						.set_tx_csum = virtnet_set_tx_csum,
 | 
				
			||||||
	.set_sg = ethtool_op_set_sg,
 | 
						.set_sg = ethtool_op_set_sg,
 | 
				
			||||||
	.set_tso = ethtool_op_set_tso,
 | 
						.set_tso = ethtool_op_set_tso,
 | 
				
			||||||
 | 
						.get_link = ethtool_op_get_link,
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define MIN_MTU 68
 | 
					#define MIN_MTU 68
 | 
				
			||||||
| 
						 | 
					@ -739,6 +740,8 @@ static int virtnet_probe(struct virtio_device *vdev)
 | 
				
			||||||
		goto unregister;
 | 
							goto unregister;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						netif_carrier_on(dev);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	pr_debug("virtnet: registered device %s\n", dev->name);
 | 
						pr_debug("virtnet: registered device %s\n", dev->name);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -587,8 +587,8 @@ struct ath9k_country_entry {
 | 
				
			||||||
	u8 iso[3];
 | 
						u8 iso[3];
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define REG_WRITE(_ah, _reg, _val) iowrite32(_val, _ah->ah_sh + _reg)
 | 
					#define REG_WRITE(_ah, _reg, _val) ath9k_iowrite32((_ah), (_reg), (_val))
 | 
				
			||||||
#define REG_READ(_ah, _reg) ioread32(_ah->ah_sh + _reg)
 | 
					#define REG_READ(_ah, _reg) ath9k_ioread32((_ah), (_reg))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define SM(_v, _f)  (((_v) << _f##_S) & _f)
 | 
					#define SM(_v, _f)  (((_v) << _f##_S) & _f)
 | 
				
			||||||
#define MS(_v, _f)  (((_v) & _f) >> _f##_S)
 | 
					#define MS(_v, _f)  (((_v) & _f) >> _f##_S)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -701,6 +701,7 @@ struct ath_softc {
 | 
				
			||||||
	struct ath_hal *sc_ah;
 | 
						struct ath_hal *sc_ah;
 | 
				
			||||||
	void __iomem *mem;
 | 
						void __iomem *mem;
 | 
				
			||||||
	spinlock_t sc_resetlock;
 | 
						spinlock_t sc_resetlock;
 | 
				
			||||||
 | 
						spinlock_t sc_serial_rw;
 | 
				
			||||||
	struct mutex mutex;
 | 
						struct mutex mutex;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	u8 sc_curbssid[ETH_ALEN];
 | 
						u8 sc_curbssid[ETH_ALEN];
 | 
				
			||||||
| 
						 | 
					@ -751,4 +752,36 @@ int ath_get_hal_qnum(u16 queue, struct ath_softc *sc);
 | 
				
			||||||
int ath_get_mac80211_qnum(u32 queue, struct ath_softc *sc);
 | 
					int ath_get_mac80211_qnum(u32 queue, struct ath_softc *sc);
 | 
				
			||||||
int ath_cabq_update(struct ath_softc *);
 | 
					int ath_cabq_update(struct ath_softc *);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/*
 | 
				
			||||||
 | 
					 * Read and write, they both share the same lock. We do this to serialize
 | 
				
			||||||
 | 
					 * reads and writes on Atheros 802.11n PCI devices only. This is required
 | 
				
			||||||
 | 
					 * as the FIFO on these devices can only accept sanely 2 requests. After
 | 
				
			||||||
 | 
					 * that the device goes bananas. Serializing the reads/writes prevents this
 | 
				
			||||||
 | 
					 * from happening.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static inline void ath9k_iowrite32(struct ath_hal *ah, u32 reg_offset, u32 val)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						if (ah->ah_config.serialize_regmode == SER_REG_MODE_ON) {
 | 
				
			||||||
 | 
							unsigned long flags;
 | 
				
			||||||
 | 
							spin_lock_irqsave(&ah->ah_sc->sc_serial_rw, flags);
 | 
				
			||||||
 | 
							iowrite32(val, ah->ah_sc->mem + reg_offset);
 | 
				
			||||||
 | 
							spin_unlock_irqrestore(&ah->ah_sc->sc_serial_rw, flags);
 | 
				
			||||||
 | 
						} else
 | 
				
			||||||
 | 
							iowrite32(val, ah->ah_sc->mem + reg_offset);
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					static inline unsigned int ath9k_ioread32(struct ath_hal *ah, u32 reg_offset)
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
						u32 val;
 | 
				
			||||||
 | 
						if (ah->ah_config.serialize_regmode == SER_REG_MODE_ON) {
 | 
				
			||||||
 | 
							unsigned long flags;
 | 
				
			||||||
 | 
							spin_lock_irqsave(&ah->ah_sc->sc_serial_rw, flags);
 | 
				
			||||||
 | 
							val = ioread32(ah->ah_sc->mem + reg_offset);
 | 
				
			||||||
 | 
							spin_unlock_irqrestore(&ah->ah_sc->sc_serial_rw, flags);
 | 
				
			||||||
 | 
						} else
 | 
				
			||||||
 | 
							val = ioread32(ah->ah_sc->mem + reg_offset);
 | 
				
			||||||
 | 
						return val;
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#endif /* CORE_H */
 | 
					#endif /* CORE_H */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -437,6 +437,25 @@ static void ath9k_hw_set_defaults(struct ath_hal *ah)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ah->ah_config.intr_mitigation = 1;
 | 
						ah->ah_config.intr_mitigation = 1;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						/*
 | 
				
			||||||
 | 
						 * We need this for PCI devices only (Cardbus, PCI, miniPCI)
 | 
				
			||||||
 | 
						 * _and_ if on non-uniprocessor systems (Multiprocessor/HT).
 | 
				
			||||||
 | 
						 * This means we use it for all AR5416 devices, and the few
 | 
				
			||||||
 | 
						 * minor PCI AR9280 devices out there.
 | 
				
			||||||
 | 
						 *
 | 
				
			||||||
 | 
						 * Serialization is required because these devices do not handle
 | 
				
			||||||
 | 
						 * well the case of two concurrent reads/writes due to the latency
 | 
				
			||||||
 | 
						 * involved. During one read/write another read/write can be issued
 | 
				
			||||||
 | 
						 * on another CPU while the previous read/write may still be working
 | 
				
			||||||
 | 
						 * on our hardware, if we hit this case the hardware poops in a loop.
 | 
				
			||||||
 | 
						 * We prevent this by serializing reads and writes.
 | 
				
			||||||
 | 
						 *
 | 
				
			||||||
 | 
						 * This issue is not present on PCI-Express devices or pre-AR5416
 | 
				
			||||||
 | 
						 * devices (legacy, 802.11abg).
 | 
				
			||||||
 | 
						 */
 | 
				
			||||||
 | 
						if (num_possible_cpus() > 1)
 | 
				
			||||||
 | 
							ah->ah_config.serialize_regmode = SER_REG_MODE_AUTO;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
static struct ath_hal_5416 *ath9k_hw_newstate(u16 devid,
 | 
					static struct ath_hal_5416 *ath9k_hw_newstate(u16 devid,
 | 
				
			||||||
| 
						 | 
					@ -668,7 +687,8 @@ static struct ath_hal *ath9k_hw_do_attach(u16 devid, struct ath_softc *sc,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (ah->ah_config.serialize_regmode == SER_REG_MODE_AUTO) {
 | 
						if (ah->ah_config.serialize_regmode == SER_REG_MODE_AUTO) {
 | 
				
			||||||
		if (ah->ah_macVersion == AR_SREV_VERSION_5416_PCI) {
 | 
							if (ah->ah_macVersion == AR_SREV_VERSION_5416_PCI ||
 | 
				
			||||||
 | 
							    (AR_SREV_9280(ah) && !ah->ah_isPciExpress)) {
 | 
				
			||||||
			ah->ah_config.serialize_regmode =
 | 
								ah->ah_config.serialize_regmode =
 | 
				
			||||||
				SER_REG_MODE_ON;
 | 
									SER_REG_MODE_ON;
 | 
				
			||||||
		} else {
 | 
							} else {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1336,6 +1336,7 @@ static int ath_init(u16 devid, struct ath_softc *sc)
 | 
				
			||||||
		printk(KERN_ERR "Unable to create debugfs files\n");
 | 
							printk(KERN_ERR "Unable to create debugfs files\n");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spin_lock_init(&sc->sc_resetlock);
 | 
						spin_lock_init(&sc->sc_resetlock);
 | 
				
			||||||
 | 
						spin_lock_init(&sc->sc_serial_rw);
 | 
				
			||||||
	mutex_init(&sc->mutex);
 | 
						mutex_init(&sc->mutex);
 | 
				
			||||||
	tasklet_init(&sc->intr_tq, ath9k_tasklet, (unsigned long)sc);
 | 
						tasklet_init(&sc->intr_tq, ath9k_tasklet, (unsigned long)sc);
 | 
				
			||||||
	tasklet_init(&sc->bcon_tasklet, ath9k_beacon_tasklet,
 | 
						tasklet_init(&sc->bcon_tasklet, ath9k_beacon_tasklet,
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -575,13 +575,17 @@ static int zd_op_tx(struct ieee80211_hw *hw, struct sk_buff *skb)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	r = fill_ctrlset(mac, skb);
 | 
						r = fill_ctrlset(mac, skb);
 | 
				
			||||||
	if (r)
 | 
						if (r)
 | 
				
			||||||
		return r;
 | 
							goto fail;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	info->rate_driver_data[0] = hw;
 | 
						info->rate_driver_data[0] = hw;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	r = zd_usb_tx(&mac->chip.usb, skb);
 | 
						r = zd_usb_tx(&mac->chip.usb, skb);
 | 
				
			||||||
	if (r)
 | 
						if (r)
 | 
				
			||||||
		return r;
 | 
							goto fail;
 | 
				
			||||||
 | 
						return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					fail:
 | 
				
			||||||
 | 
						dev_kfree_skb(skb);
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,3 +1,23 @@
 | 
				
			||||||
 | 
					/*
 | 
				
			||||||
 | 
					 * Copyright(c) 2007 - 2009 Intel Corporation. All rights reserved.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * This program is free software; you can redistribute it and/or modify it
 | 
				
			||||||
 | 
					 * under the terms of the GNU General Public License as published by the Free
 | 
				
			||||||
 | 
					 * Software Foundation; either version 2 of the License, or (at your option)
 | 
				
			||||||
 | 
					 * any later version.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * This program is distributed in the hope that it will be useful, but WITHOUT
 | 
				
			||||||
 | 
					 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 | 
				
			||||||
 | 
					 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
 | 
				
			||||||
 | 
					 * more details.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * You should have received a copy of the GNU General Public License along with
 | 
				
			||||||
 | 
					 * this program; if not, write to the Free Software Foundation, Inc., 59
 | 
				
			||||||
 | 
					 * Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * The full GNU General Public License is included in this distribution in the
 | 
				
			||||||
 | 
					 * file called COPYING.
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
#ifndef DCA_H
 | 
					#ifndef DCA_H
 | 
				
			||||||
#define DCA_H
 | 
					#define DCA_H
 | 
				
			||||||
/* DCA Provider API */
 | 
					/* DCA Provider API */
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -62,6 +62,7 @@ static inline int nf_conntrack_confirm(struct sk_buff *skb)
 | 
				
			||||||
	if (ct && ct != &nf_conntrack_untracked) {
 | 
						if (ct && ct != &nf_conntrack_untracked) {
 | 
				
			||||||
		if (!nf_ct_is_confirmed(ct) && !nf_ct_is_dying(ct))
 | 
							if (!nf_ct_is_confirmed(ct) && !nf_ct_is_dying(ct))
 | 
				
			||||||
			ret = __nf_conntrack_confirm(skb);
 | 
								ret = __nf_conntrack_confirm(skb);
 | 
				
			||||||
 | 
							if (likely(ret == NF_ACCEPT))
 | 
				
			||||||
			nf_ct_deliver_cached_events(ct);
 | 
								nf_ct_deliver_cached_events(ct);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	return ret;
 | 
						return ret;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2588,9 +2588,9 @@ static int process_backlog(struct napi_struct *napi, int quota)
 | 
				
			||||||
		local_irq_disable();
 | 
							local_irq_disable();
 | 
				
			||||||
		skb = __skb_dequeue(&queue->input_pkt_queue);
 | 
							skb = __skb_dequeue(&queue->input_pkt_queue);
 | 
				
			||||||
		if (!skb) {
 | 
							if (!skb) {
 | 
				
			||||||
			__napi_complete(napi);
 | 
					 | 
				
			||||||
			local_irq_enable();
 | 
								local_irq_enable();
 | 
				
			||||||
			break;
 | 
								napi_complete(napi);
 | 
				
			||||||
 | 
								goto out;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		local_irq_enable();
 | 
							local_irq_enable();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2599,6 +2599,7 @@ static int process_backlog(struct napi_struct *napi, int quota)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	napi_gro_flush(napi);
 | 
						napi_gro_flush(napi);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					out:
 | 
				
			||||||
	return work;
 | 
						return work;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -2671,7 +2672,7 @@ void netif_napi_del(struct napi_struct *napi)
 | 
				
			||||||
	struct sk_buff *skb, *next;
 | 
						struct sk_buff *skb, *next;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	list_del_init(&napi->dev_list);
 | 
						list_del_init(&napi->dev_list);
 | 
				
			||||||
	kfree(napi->skb);
 | 
						kfree_skb(napi->skb);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	for (skb = napi->gro_list; skb; skb = next) {
 | 
						for (skb = napi->gro_list; skb; skb = next) {
 | 
				
			||||||
		next = skb->next;
 | 
							next = skb->next;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -463,6 +463,7 @@ static int ip_frag_queue(struct ipq *qp, struct sk_buff *skb)
 | 
				
			||||||
static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev,
 | 
					static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev,
 | 
				
			||||||
			 struct net_device *dev)
 | 
								 struct net_device *dev)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						struct net *net = container_of(qp->q.net, struct net, ipv4.frags);
 | 
				
			||||||
	struct iphdr *iph;
 | 
						struct iphdr *iph;
 | 
				
			||||||
	struct sk_buff *fp, *head = qp->q.fragments;
 | 
						struct sk_buff *fp, *head = qp->q.fragments;
 | 
				
			||||||
	int len;
 | 
						int len;
 | 
				
			||||||
| 
						 | 
					@ -548,7 +549,7 @@ static int ip_frag_reasm(struct ipq *qp, struct sk_buff *prev,
 | 
				
			||||||
	iph = ip_hdr(head);
 | 
						iph = ip_hdr(head);
 | 
				
			||||||
	iph->frag_off = 0;
 | 
						iph->frag_off = 0;
 | 
				
			||||||
	iph->tot_len = htons(len);
 | 
						iph->tot_len = htons(len);
 | 
				
			||||||
	IP_INC_STATS_BH(dev_net(dev), IPSTATS_MIB_REASMOKS);
 | 
						IP_INC_STATS_BH(net, IPSTATS_MIB_REASMOKS);
 | 
				
			||||||
	qp->q.fragments = NULL;
 | 
						qp->q.fragments = NULL;
 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -528,14 +528,14 @@ find_prev_fhdr(struct sk_buff *skb, u8 *prevhdrp, int *prevhoff, int *fhoff)
 | 
				
			||||||
		if (!ipv6_ext_hdr(nexthdr)) {
 | 
							if (!ipv6_ext_hdr(nexthdr)) {
 | 
				
			||||||
			return -1;
 | 
								return -1;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		if (len < (int)sizeof(struct ipv6_opt_hdr)) {
 | 
					 | 
				
			||||||
			pr_debug("too short\n");
 | 
					 | 
				
			||||||
			return -1;
 | 
					 | 
				
			||||||
		}
 | 
					 | 
				
			||||||
		if (nexthdr == NEXTHDR_NONE) {
 | 
							if (nexthdr == NEXTHDR_NONE) {
 | 
				
			||||||
			pr_debug("next header is none\n");
 | 
								pr_debug("next header is none\n");
 | 
				
			||||||
			return -1;
 | 
								return -1;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
							if (len < (int)sizeof(struct ipv6_opt_hdr)) {
 | 
				
			||||||
 | 
								pr_debug("too short\n");
 | 
				
			||||||
 | 
								return -1;
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
		if (skb_copy_bits(skb, start, &hdr, sizeof(hdr)))
 | 
							if (skb_copy_bits(skb, start, &hdr, sizeof(hdr)))
 | 
				
			||||||
			BUG();
 | 
								BUG();
 | 
				
			||||||
		if (nexthdr == NEXTHDR_AUTH)
 | 
							if (nexthdr == NEXTHDR_AUTH)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -452,6 +452,7 @@ static int ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
 | 
				
			||||||
static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev,
 | 
					static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev,
 | 
				
			||||||
			  struct net_device *dev)
 | 
								  struct net_device *dev)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
						struct net *net = container_of(fq->q.net, struct net, ipv6.frags);
 | 
				
			||||||
	struct sk_buff *fp, *head = fq->q.fragments;
 | 
						struct sk_buff *fp, *head = fq->q.fragments;
 | 
				
			||||||
	int    payload_len;
 | 
						int    payload_len;
 | 
				
			||||||
	unsigned int nhoff;
 | 
						unsigned int nhoff;
 | 
				
			||||||
| 
						 | 
					@ -551,8 +552,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev,
 | 
				
			||||||
					  head->csum);
 | 
										  head->csum);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	rcu_read_lock();
 | 
						rcu_read_lock();
 | 
				
			||||||
	IP6_INC_STATS_BH(dev_net(dev),
 | 
						IP6_INC_STATS_BH(net, __in6_dev_get(dev), IPSTATS_MIB_REASMOKS);
 | 
				
			||||||
			 __in6_dev_get(dev), IPSTATS_MIB_REASMOKS);
 | 
					 | 
				
			||||||
	rcu_read_unlock();
 | 
						rcu_read_unlock();
 | 
				
			||||||
	fq->q.fragments = NULL;
 | 
						fq->q.fragments = NULL;
 | 
				
			||||||
	return 1;
 | 
						return 1;
 | 
				
			||||||
| 
						 | 
					@ -566,8 +566,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff *prev,
 | 
				
			||||||
		printk(KERN_DEBUG "ip6_frag_reasm: no memory for reassembly\n");
 | 
							printk(KERN_DEBUG "ip6_frag_reasm: no memory for reassembly\n");
 | 
				
			||||||
out_fail:
 | 
					out_fail:
 | 
				
			||||||
	rcu_read_lock();
 | 
						rcu_read_lock();
 | 
				
			||||||
	IP6_INC_STATS_BH(dev_net(dev),
 | 
						IP6_INC_STATS_BH(net, __in6_dev_get(dev), IPSTATS_MIB_REASMFAILS);
 | 
				
			||||||
			 __in6_dev_get(dev), IPSTATS_MIB_REASMFAILS);
 | 
					 | 
				
			||||||
	rcu_read_unlock();
 | 
						rcu_read_unlock();
 | 
				
			||||||
	return -1;
 | 
						return -1;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -188,9 +188,9 @@ static struct ip_tunnel * ipip6_tunnel_locate(struct net *net,
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	nt = netdev_priv(dev);
 | 
						nt = netdev_priv(dev);
 | 
				
			||||||
	ipip6_tunnel_init(dev);
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	nt->parms = *parms;
 | 
						nt->parms = *parms;
 | 
				
			||||||
 | 
						ipip6_tunnel_init(dev);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (parms->i_flags & SIT_ISATAP)
 | 
						if (parms->i_flags & SIT_ISATAP)
 | 
				
			||||||
		dev->priv_flags |= IFF_ISATAP;
 | 
							dev->priv_flags |= IFF_ISATAP;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -752,6 +752,8 @@ ieee80211_tx_h_fragment(struct ieee80211_tx_data *tx)
 | 
				
			||||||
		skb_copy_queue_mapping(frag, first);
 | 
							skb_copy_queue_mapping(frag, first);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		frag->do_not_encrypt = first->do_not_encrypt;
 | 
							frag->do_not_encrypt = first->do_not_encrypt;
 | 
				
			||||||
 | 
							frag->dev = first->dev;
 | 
				
			||||||
 | 
							frag->iif = first->iif;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		pos += copylen;
 | 
							pos += copylen;
 | 
				
			||||||
		left -= copylen;
 | 
							left -= copylen;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -726,7 +726,7 @@ nf_conntrack_in(struct net *net, u_int8_t pf, unsigned int hooknum,
 | 
				
			||||||
	NF_CT_ASSERT(skb->nfct);
 | 
						NF_CT_ASSERT(skb->nfct);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ret = l4proto->packet(ct, skb, dataoff, ctinfo, pf, hooknum);
 | 
						ret = l4proto->packet(ct, skb, dataoff, ctinfo, pf, hooknum);
 | 
				
			||||||
	if (ret < 0) {
 | 
						if (ret <= 0) {
 | 
				
			||||||
		/* Invalid: inverse of the return code tells
 | 
							/* Invalid: inverse of the return code tells
 | 
				
			||||||
		 * the netfilter core what to do */
 | 
							 * the netfilter core what to do */
 | 
				
			||||||
		pr_debug("nf_conntrack_in: Can't track with proto module\n");
 | 
							pr_debug("nf_conntrack_in: Can't track with proto module\n");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1780,6 +1780,7 @@ ctnetlink_create_expect(struct nlattr *cda[], u_int8_t u3, u32 pid, int report)
 | 
				
			||||||
		goto out;
 | 
							goto out;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						exp->class = 0;
 | 
				
			||||||
	exp->expectfn = NULL;
 | 
						exp->expectfn = NULL;
 | 
				
			||||||
	exp->flags = 0;
 | 
						exp->flags = 0;
 | 
				
			||||||
	exp->master = ct;
 | 
						exp->master = ct;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -859,7 +859,7 @@ static int tcp_packet(struct nf_conn *ct,
 | 
				
			||||||
			 */
 | 
								 */
 | 
				
			||||||
			if (nf_ct_kill(ct))
 | 
								if (nf_ct_kill(ct))
 | 
				
			||||||
				return -NF_REPEAT;
 | 
									return -NF_REPEAT;
 | 
				
			||||||
			return -NF_DROP;
 | 
								return NF_DROP;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		/* Fall through */
 | 
							/* Fall through */
 | 
				
			||||||
	case TCP_CONNTRACK_IGNORE:
 | 
						case TCP_CONNTRACK_IGNORE:
 | 
				
			||||||
| 
						 | 
					@ -892,7 +892,7 @@ static int tcp_packet(struct nf_conn *ct,
 | 
				
			||||||
				nf_log_packet(pf, 0, skb, NULL, NULL, NULL,
 | 
									nf_log_packet(pf, 0, skb, NULL, NULL, NULL,
 | 
				
			||||||
					  "nf_ct_tcp: killing out of sync session ");
 | 
										  "nf_ct_tcp: killing out of sync session ");
 | 
				
			||||||
			nf_ct_kill(ct);
 | 
								nf_ct_kill(ct);
 | 
				
			||||||
			return -NF_DROP;
 | 
								return NF_DROP;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		ct->proto.tcp.last_index = index;
 | 
							ct->proto.tcp.last_index = index;
 | 
				
			||||||
		ct->proto.tcp.last_dir = dir;
 | 
							ct->proto.tcp.last_dir = dir;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -111,7 +111,8 @@ static struct sctp_endpoint *sctp_endpoint_init(struct sctp_endpoint *ep,
 | 
				
			||||||
		if (sctp_addip_enable) {
 | 
							if (sctp_addip_enable) {
 | 
				
			||||||
			auth_chunks->chunks[0] = SCTP_CID_ASCONF;
 | 
								auth_chunks->chunks[0] = SCTP_CID_ASCONF;
 | 
				
			||||||
			auth_chunks->chunks[1] = SCTP_CID_ASCONF_ACK;
 | 
								auth_chunks->chunks[1] = SCTP_CID_ASCONF_ACK;
 | 
				
			||||||
			auth_chunks->param_hdr.length += htons(2);
 | 
								auth_chunks->param_hdr.length =
 | 
				
			||||||
 | 
										htons(sizeof(sctp_paramhdr_t) + 2);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -102,3 +102,13 @@ config LIB80211_CRYPT_CCMP
 | 
				
			||||||
 | 
					
 | 
				
			||||||
config LIB80211_CRYPT_TKIP
 | 
					config LIB80211_CRYPT_TKIP
 | 
				
			||||||
	tristate
 | 
						tristate
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					config LIB80211_DEBUG
 | 
				
			||||||
 | 
						bool "lib80211 debugging messages"
 | 
				
			||||||
 | 
						depends on LIB80211
 | 
				
			||||||
 | 
						default n
 | 
				
			||||||
 | 
						---help---
 | 
				
			||||||
 | 
						  You can enable this if you want verbose debugging messages
 | 
				
			||||||
 | 
						  from lib80211.
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						  If unsure, say N.
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -337,6 +337,7 @@ static int lib80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
 | 
				
			||||||
	pos += 8;
 | 
						pos += 8;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (ccmp_replay_check(pn, key->rx_pn)) {
 | 
						if (ccmp_replay_check(pn, key->rx_pn)) {
 | 
				
			||||||
 | 
					#ifdef CONFIG_LIB80211_DEBUG
 | 
				
			||||||
		if (net_ratelimit()) {
 | 
							if (net_ratelimit()) {
 | 
				
			||||||
			printk(KERN_DEBUG "CCMP: replay detected: STA=%pM "
 | 
								printk(KERN_DEBUG "CCMP: replay detected: STA=%pM "
 | 
				
			||||||
				 "previous PN %02x%02x%02x%02x%02x%02x "
 | 
									 "previous PN %02x%02x%02x%02x%02x%02x "
 | 
				
			||||||
| 
						 | 
					@ -346,6 +347,7 @@ static int lib80211_ccmp_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
 | 
				
			||||||
				 key->rx_pn[3], key->rx_pn[4], key->rx_pn[5],
 | 
									 key->rx_pn[3], key->rx_pn[4], key->rx_pn[5],
 | 
				
			||||||
				 pn[0], pn[1], pn[2], pn[3], pn[4], pn[5]);
 | 
									 pn[0], pn[1], pn[2], pn[3], pn[4], pn[5]);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
		key->dot11RSNAStatsCCMPReplays++;
 | 
							key->dot11RSNAStatsCCMPReplays++;
 | 
				
			||||||
		return -4;
 | 
							return -4;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -465,12 +465,14 @@ static int lib80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
 | 
				
			||||||
	pos += 8;
 | 
						pos += 8;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if (tkip_replay_check(iv32, iv16, tkey->rx_iv32, tkey->rx_iv16)) {
 | 
						if (tkip_replay_check(iv32, iv16, tkey->rx_iv32, tkey->rx_iv16)) {
 | 
				
			||||||
 | 
					#ifdef CONFIG_LIB80211_DEBUG
 | 
				
			||||||
		if (net_ratelimit()) {
 | 
							if (net_ratelimit()) {
 | 
				
			||||||
			printk(KERN_DEBUG "TKIP: replay detected: STA=%pM"
 | 
								printk(KERN_DEBUG "TKIP: replay detected: STA=%pM"
 | 
				
			||||||
			       " previous TSC %08x%04x received TSC "
 | 
								       " previous TSC %08x%04x received TSC "
 | 
				
			||||||
			       "%08x%04x\n", hdr->addr2,
 | 
								       "%08x%04x\n", hdr->addr2,
 | 
				
			||||||
			       tkey->rx_iv32, tkey->rx_iv16, iv32, iv16);
 | 
								       tkey->rx_iv32, tkey->rx_iv16, iv32, iv16);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
		tkey->dot11RSNAStatsTKIPReplays++;
 | 
							tkey->dot11RSNAStatsTKIPReplays++;
 | 
				
			||||||
		return -4;
 | 
							return -4;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					@ -505,10 +507,12 @@ static int lib80211_tkip_decrypt(struct sk_buff *skb, int hdr_len, void *priv)
 | 
				
			||||||
			 * it needs to be recalculated for the next packet. */
 | 
								 * it needs to be recalculated for the next packet. */
 | 
				
			||||||
			tkey->rx_phase1_done = 0;
 | 
								tkey->rx_phase1_done = 0;
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					#ifdef CONFIG_LIB80211_DEBUG
 | 
				
			||||||
		if (net_ratelimit()) {
 | 
							if (net_ratelimit()) {
 | 
				
			||||||
			printk(KERN_DEBUG "TKIP: ICV error detected: STA="
 | 
								printk(KERN_DEBUG "TKIP: ICV error detected: STA="
 | 
				
			||||||
			       "%pM\n", hdr->addr2);
 | 
								       "%pM\n", hdr->addr2);
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
		tkey->dot11RSNAStatsTKIPICVErrors++;
 | 
							tkey->dot11RSNAStatsTKIPICVErrors++;
 | 
				
			||||||
		return -5;
 | 
							return -5;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1908,6 +1908,11 @@ static int nl80211_get_mesh_params(struct sk_buff *skb,
 | 
				
			||||||
	if (err)
 | 
						if (err)
 | 
				
			||||||
		return err;
 | 
							return err;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (!drv->ops->get_mesh_params) {
 | 
				
			||||||
 | 
							err = -EOPNOTSUPP;
 | 
				
			||||||
 | 
							goto out;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* Get the mesh params */
 | 
						/* Get the mesh params */
 | 
				
			||||||
	rtnl_lock();
 | 
						rtnl_lock();
 | 
				
			||||||
	err = drv->ops->get_mesh_params(&drv->wiphy, dev, &cur_params);
 | 
						err = drv->ops->get_mesh_params(&drv->wiphy, dev, &cur_params);
 | 
				
			||||||
| 
						 | 
					@ -2017,6 +2022,11 @@ static int nl80211_set_mesh_params(struct sk_buff *skb, struct genl_info *info)
 | 
				
			||||||
	if (err)
 | 
						if (err)
 | 
				
			||||||
		return err;
 | 
							return err;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						if (!drv->ops->set_mesh_params) {
 | 
				
			||||||
 | 
							err = -EOPNOTSUPP;
 | 
				
			||||||
 | 
							goto out;
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	/* This makes sure that there aren't more than 32 mesh config
 | 
						/* This makes sure that there aren't more than 32 mesh config
 | 
				
			||||||
	 * parameters (otherwise our bitfield scheme would not work.) */
 | 
						 * parameters (otherwise our bitfield scheme would not work.) */
 | 
				
			||||||
	BUILD_BUG_ON(NL80211_MESHCONF_ATTR_MAX > 32);
 | 
						BUILD_BUG_ON(NL80211_MESHCONF_ATTR_MAX > 32);
 | 
				
			||||||
| 
						 | 
					@ -2061,6 +2071,7 @@ static int nl80211_set_mesh_params(struct sk_buff *skb, struct genl_info *info)
 | 
				
			||||||
	err = drv->ops->set_mesh_params(&drv->wiphy, dev, &cfg, mask);
 | 
						err = drv->ops->set_mesh_params(&drv->wiphy, dev, &cfg, mask);
 | 
				
			||||||
	rtnl_unlock();
 | 
						rtnl_unlock();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					 out:
 | 
				
			||||||
	/* cleanup */
 | 
						/* cleanup */
 | 
				
			||||||
	cfg80211_put_dev(drv);
 | 
						cfg80211_put_dev(drv);
 | 
				
			||||||
	dev_put(dev);
 | 
						dev_put(dev);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue