فهرست منبع

Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6

* git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next-2.6: (1429 commits)
  net: Allow dependancies of FDDI & Tokenring to be modular.
  igb: Fix build warning when DCA is disabled.
  net: Fix warning fallout from recent NAPI interface changes.
  gro: Fix potential use after free
  sfc: If AN is enabled, always read speed/duplex from the AN advertising bits
  sfc: When disabling the NIC, close the device rather than unregistering it
  sfc: SFT9001: Add cable diagnostics
  sfc: Add support for multiple PHY self-tests
  sfc: Merge top-level functions for self-tests
  sfc: Clean up PHY mode management in loopback self-test
  sfc: Fix unreliable link detection in some loopback modes
  sfc: Generate unique names for per-NIC workqueues
  802.3ad: use standard ethhdr instead of ad_header
  802.3ad: generalize out mac address initializer
  802.3ad: initialize ports LACPDU from const initializer
  802.3ad: remove typedef around ad_system
  802.3ad: turn ports is_individual into a bool
  802.3ad: turn ports is_enabled into a bool
  802.3ad: make ntt bool
  ixgbe: Fix set_ringparam in ixgbe to use the same memory pools.
  ...

Fixed trivial IPv4/6 address printing conflicts in fs/cifs/connect.c due
to the conversion to %pI (in this networking merge) and the addition of
doing IPv6 addresses (from the earlier merge of CIFS).
Linus Torvalds 16 سال پیش
والد
کامیت
0191b625ca
100فایلهای تغییر یافته به همراه2273 افزوده شده و 1996 حذف شده
  1. 1 1
      Documentation/DocBook/Makefile
  2. 0 3
      Documentation/DocBook/networking.tmpl
  3. 0 99
      Documentation/DocBook/wanbook.tmpl
  4. 167 0
      Documentation/RCU/rculist_nulls.txt
  5. 0 7
      Documentation/feature-removal-schedule.txt
  6. 1 1
      Documentation/networking/README.ipw2200
  7. 61 7
      Documentation/networking/bonding.txt
  8. 21 11
      Documentation/networking/dccp.txt
  9. 1 1
      Documentation/networking/driver.txt
  10. 4 4
      Documentation/networking/generic-hdlc.txt
  11. 6 0
      Documentation/networking/ip-sysctl.txt
  12. 5 4
      Documentation/networking/mac80211_hwsim/README
  13. 1 1
      Documentation/networking/netdevices.txt
  14. 9 13
      Documentation/networking/regulatory.txt
  15. 10 2
      Documentation/powerpc/dts-bindings/fsl/tsec.txt
  16. 13 7
      Documentation/rfkill.txt
  17. 35 13
      MAINTAINERS
  18. 4 5
      arch/arm/mach-ixp4xx/fsg-setup.c
  19. 33 2
      arch/arm/mach-ixp4xx/include/mach/qmgr.h
  20. 33 11
      arch/arm/mach-ixp4xx/ixp4xx_qmgr.c
  21. 2 3
      arch/arm/mach-ixp4xx/nas100d-setup.c
  22. 2 3
      arch/arm/mach-ixp4xx/nslu2-setup.c
  23. 15 10
      arch/ia64/hp/sim/simeth.c
  24. 20 0
      arch/powerpc/boot/dts/asp834x-redboot.dts
  25. 20 0
      arch/powerpc/boot/dts/ksi8560.dts
  26. 20 0
      arch/powerpc/boot/dts/mpc8313erdb.dts
  27. 19 0
      arch/powerpc/boot/dts/mpc8315erdb.dts
  28. 18 0
      arch/powerpc/boot/dts/mpc8349emitx.dts
  29. 5 0
      arch/powerpc/boot/dts/mpc8349emitxgp.dts
  30. 19 0
      arch/powerpc/boot/dts/mpc834x_mds.dts
  31. 19 0
      arch/powerpc/boot/dts/mpc8377_mds.dts
  32. 19 0
      arch/powerpc/boot/dts/mpc8377_rdb.dts
  33. 19 0
      arch/powerpc/boot/dts/mpc8378_mds.dts
  34. 17 0
      arch/powerpc/boot/dts/mpc8378_rdb.dts
  35. 18 0
      arch/powerpc/boot/dts/mpc8379_mds.dts
  36. 18 0
      arch/powerpc/boot/dts/mpc8379_rdb.dts
  37. 18 0
      arch/powerpc/boot/dts/mpc8536ds.dts
  38. 31 0
      arch/powerpc/boot/dts/mpc8540ads.dts
  39. 18 0
      arch/powerpc/boot/dts/mpc8541cds.dts
  40. 20 0
      arch/powerpc/boot/dts/mpc8544ds.dts
  41. 44 0
      arch/powerpc/boot/dts/mpc8548cds.dts
  42. 18 0
      arch/powerpc/boot/dts/mpc8555cds.dts
  43. 18 0
      arch/powerpc/boot/dts/mpc8560ads.dts
  44. 18 0
      arch/powerpc/boot/dts/mpc8568mds.dts
  45. 45 0
      arch/powerpc/boot/dts/mpc8572ds.dts
  46. 45 0
      arch/powerpc/boot/dts/mpc8641_hpcn.dts
  47. 18 0
      arch/powerpc/boot/dts/sbc8349.dts
  48. 18 0
      arch/powerpc/boot/dts/sbc8548.dts
  49. 18 0
      arch/powerpc/boot/dts/sbc8560.dts
  50. 44 0
      arch/powerpc/boot/dts/sbc8641d.dts
  51. 18 0
      arch/powerpc/boot/dts/stx_gp3_8560.dts
  52. 28 0
      arch/powerpc/boot/dts/tqm8540.dts
  53. 18 0
      arch/powerpc/boot/dts/tqm8541.dts
  54. 44 0
      arch/powerpc/boot/dts/tqm8548-bigflash.dts
  55. 44 0
      arch/powerpc/boot/dts/tqm8548.dts
  56. 18 0
      arch/powerpc/boot/dts/tqm8555.dts
  57. 18 0
      arch/powerpc/boot/dts/tqm8560.dts
  58. 28 213
      arch/powerpc/sysdev/fsl_soc.c
  59. 2 2
      arch/s390/appldata/appldata_net_sum.c
  60. 1 4
      arch/sparc64/kernel/idprom.c
  61. 1 1
      arch/um/drivers/daemon_kern.c
  62. 1 1
      arch/um/drivers/mcast_kern.c
  63. 12 17
      arch/um/drivers/net_kern.c
  64. 1 1
      arch/um/drivers/pcap_kern.c
  65. 1 1
      arch/um/drivers/slip_kern.c
  66. 1 1
      arch/um/drivers/slirp_kern.c
  67. 1 1
      arch/um/drivers/vde_kern.c
  68. 1 1
      arch/um/os-Linux/drivers/ethertap_kern.c
  69. 1 1
      arch/um/os-Linux/drivers/tuntap_kern.c
  70. 9 12
      arch/xtensa/platforms/iss/network.c
  71. 6 0
      drivers/atm/Kconfig
  72. 1 0
      drivers/atm/Makefile
  73. 790 0
      drivers/atm/solos-pci.c
  74. 0 1
      drivers/block/aoe/aoe.h
  75. 1 1
      drivers/block/aoe/aoeblk.c
  76. 10 12
      drivers/block/aoe/aoecmd.c
  77. 0 11
      drivers/block/aoe/aoenet.c
  78. 0 20
      drivers/bluetooth/Kconfig
  79. 0 1
      drivers/bluetooth/Makefile
  80. 2 7
      drivers/bluetooth/bcm203x.c
  81. 3 8
      drivers/bluetooth/bfusb.c
  82. 2 5
      drivers/bluetooth/bpa10x.c
  83. 4 4
      drivers/bluetooth/bt3c_cs.c
  84. 1 5
      drivers/bluetooth/btsdio.c
  85. 140 89
      drivers/bluetooth/btusb.c
  86. 0 5
      drivers/bluetooth/hci_bcsp.c
  87. 0 5
      drivers/bluetooth/hci_h4.c
  88. 2 7
      drivers/bluetooth/hci_ldisc.c
  89. 0 1136
      drivers/bluetooth/hci_usb.c
  90. 0 129
      drivers/bluetooth/hci_usb.h
  91. 0 5
      drivers/bluetooth/hci_vhci.c
  92. 2 5
      drivers/firmware/iscsi_ibft.c
  93. 1 9
      drivers/infiniband/core/sysfs.c
  94. 4 4
      drivers/infiniband/hw/amso1100/c2_provider.c
  95. 2 21
      drivers/infiniband/hw/mthca/mthca_mcg.c
  96. 5 12
      drivers/infiniband/hw/nes/nes.c
  97. 13 18
      drivers/infiniband/hw/nes/nes_cm.c
  98. 1 1
      drivers/infiniband/hw/nes/nes_hw.c
  99. 5 8
      drivers/infiniband/hw/nes/nes_nic.c
  100. 2 3
      drivers/infiniband/hw/nes/nes_utils.c

+ 1 - 1
Documentation/DocBook/Makefile

@@ -6,7 +6,7 @@
 # To add a new book the only step required is to add the book to the
 # To add a new book the only step required is to add the book to the
 # list of DOCBOOKS.
 # list of DOCBOOKS.
 
 
-DOCBOOKS := wanbook.xml z8530book.xml mcabook.xml \
+DOCBOOKS := z8530book.xml mcabook.xml \
 	    kernel-hacking.xml kernel-locking.xml deviceiobook.xml \
 	    kernel-hacking.xml kernel-locking.xml deviceiobook.xml \
 	    procfs-guide.xml writing_usb_driver.xml networking.xml \
 	    procfs-guide.xml writing_usb_driver.xml networking.xml \
 	    kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \
 	    kernel-api.xml filesystems.xml lsm.xml usb.xml kgdb.xml \

+ 0 - 3
Documentation/DocBook/networking.tmpl

@@ -98,9 +98,6 @@
 X!Enet/core/wireless.c
 X!Enet/core/wireless.c
      </sect1>
      </sect1>
 -->
 -->
-     <sect1><title>Synchronous PPP</title>
-!Edrivers/net/wan/syncppp.c
-     </sect1>
   </chapter>
   </chapter>
 
 
 </book>
 </book>

+ 0 - 99
Documentation/DocBook/wanbook.tmpl

@@ -1,99 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
-	"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" []>
-
-<book id="WANGuide">
- <bookinfo>
-  <title>Synchronous PPP and Cisco HDLC Programming Guide</title>
-  
-  <authorgroup>
-   <author>
-    <firstname>Alan</firstname>
-    <surname>Cox</surname>
-    <affiliation>
-     <address>
-      <email>alan@lxorguk.ukuu.org.uk</email>
-     </address>
-    </affiliation>
-   </author>
-  </authorgroup>
-
-  <copyright>
-   <year>2000</year>
-   <holder>Alan Cox</holder>
-  </copyright>
-
-  <legalnotice>
-   <para>
-     This documentation 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.
-   </para>
-      
-   <para>
-     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.
-   </para>
-      
-   <para>
-     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
-   </para>
-      
-   <para>
-     For more details see the file COPYING in the source
-     distribution of Linux.
-   </para>
-  </legalnotice>
- </bookinfo>
-
-<toc></toc>
-
-  <chapter id="intro">
-      <title>Introduction</title>
-  <para>
-	The syncppp drivers in Linux provide a fairly complete 
-	implementation of Cisco HDLC and a minimal implementation of
-	PPP. The longer term goal is to switch the PPP layer to the
-	generic PPP interface that is new in Linux 2.3.x. The API should
-	remain unchanged when this is done, but support will then be
-	available for IPX, compression and other PPP features
-  </para>
-  </chapter>
-  <chapter id="bugs">
-     <title>Known Bugs And Assumptions</title>
-  <para>
-  <variablelist>
-    <varlistentry><term>PPP is minimal</term>
-    <listitem>
-    <para>
-	The current PPP implementation is very basic, although sufficient
-	for most wan usages.
-    </para>
-    </listitem></varlistentry>
-
-    <varlistentry><term>Cisco HDLC Quirks</term>
-    <listitem>
-    <para>
-	Currently we do not end all packets with the correct Cisco multicast
-	or unicast flags. Nothing appears to mind too much but this should
-	be corrected.
-    </para>
-    </listitem></varlistentry>
-  </variablelist>
-	
-  </para>
-  </chapter>
-
-  <chapter id="pubfunctions">
-     <title>Public Functions Provided</title>
-!Edrivers/net/wan/syncppp.c
-  </chapter>
-
-</book>

+ 167 - 0
Documentation/RCU/rculist_nulls.txt

@@ -0,0 +1,167 @@
+Using hlist_nulls to protect read-mostly linked lists and
+objects using SLAB_DESTROY_BY_RCU allocations.
+
+Please read the basics in Documentation/RCU/listRCU.txt
+
+Using special makers (called 'nulls') is a convenient way
+to solve following problem :
+
+A typical RCU linked list managing objects which are
+allocated with SLAB_DESTROY_BY_RCU kmem_cache can
+use following algos :
+
+1) Lookup algo
+--------------
+rcu_read_lock()
+begin:
+obj = lockless_lookup(key);
+if (obj) {
+  if (!try_get_ref(obj)) // might fail for free objects
+    goto begin;
+  /*
+   * Because a writer could delete object, and a writer could
+   * reuse these object before the RCU grace period, we
+   * must check key after geting the reference on object
+   */
+  if (obj->key != key) { // not the object we expected
+     put_ref(obj);
+     goto begin;
+   }
+}
+rcu_read_unlock();
+
+Beware that lockless_lookup(key) cannot use traditional hlist_for_each_entry_rcu()
+but a version with an additional memory barrier (smp_rmb())
+
+lockless_lookup(key)
+{
+   struct hlist_node *node, *next;
+   for (pos = rcu_dereference((head)->first);
+          pos && ({ next = pos->next; smp_rmb(); prefetch(next); 1; }) &&
+          ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; });
+          pos = rcu_dereference(next))
+      if (obj->key == key)
+         return obj;
+   return NULL;
+
+And note the traditional hlist_for_each_entry_rcu() misses this smp_rmb() :
+
+   struct hlist_node *node;
+   for (pos = rcu_dereference((head)->first);
+		pos && ({ prefetch(pos->next); 1; }) &&
+		({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; });
+		pos = rcu_dereference(pos->next))
+      if (obj->key == key)
+         return obj;
+   return NULL;
+}
+
+Quoting Corey Minyard :
+
+"If the object is moved from one list to another list in-between the
+ time the hash is calculated and the next field is accessed, and the
+ object has moved to the end of a new list, the traversal will not
+ complete properly on the list it should have, since the object will
+ be on the end of the new list and there's not a way to tell it's on a
+ new list and restart the list traversal.  I think that this can be
+ solved by pre-fetching the "next" field (with proper barriers) before
+ checking the key."
+
+2) Insert algo :
+----------------
+
+We need to make sure a reader cannot read the new 'obj->obj_next' value
+and previous value of 'obj->key'. Or else, an item could be deleted
+from a chain, and inserted into another chain. If new chain was empty
+before the move, 'next' pointer is NULL, and lockless reader can
+not detect it missed following items in original chain.
+
+/*
+ * Please note that new inserts are done at the head of list,
+ * not in the middle or end.
+ */
+obj = kmem_cache_alloc(...);
+lock_chain(); // typically a spin_lock()
+obj->key = key;
+atomic_inc(&obj->refcnt);
+/*
+ * we need to make sure obj->key is updated before obj->next
+ */
+smp_wmb();
+hlist_add_head_rcu(&obj->obj_node, list);
+unlock_chain(); // typically a spin_unlock()
+
+
+3) Remove algo
+--------------
+Nothing special here, we can use a standard RCU hlist deletion.
+But thanks to SLAB_DESTROY_BY_RCU, beware a deleted object can be reused
+very very fast (before the end of RCU grace period)
+
+if (put_last_reference_on(obj) {
+   lock_chain(); // typically a spin_lock()
+   hlist_del_init_rcu(&obj->obj_node);
+   unlock_chain(); // typically a spin_unlock()
+   kmem_cache_free(cachep, obj);
+}
+
+
+
+--------------------------------------------------------------------------
+With hlist_nulls we can avoid extra smp_rmb() in lockless_lookup()
+and extra smp_wmb() in insert function.
+
+For example, if we choose to store the slot number as the 'nulls'
+end-of-list marker for each slot of the hash table, we can detect
+a race (some writer did a delete and/or a move of an object
+to another chain) checking the final 'nulls' value if
+the lookup met the end of chain. If final 'nulls' value
+is not the slot number, then we must restart the lookup at
+the begining. If the object was moved to same chain,
+then the reader doesnt care : It might eventually
+scan the list again without harm.
+
+
+1) lookup algo
+
+ head = &table[slot];
+ rcu_read_lock();
+begin:
+ hlist_nulls_for_each_entry_rcu(obj, node, head, member) {
+   if (obj->key == key) {
+      if (!try_get_ref(obj)) // might fail for free objects
+         goto begin;
+      if (obj->key != key) { // not the object we expected
+         put_ref(obj);
+         goto begin;
+      }
+  goto out;
+ }
+/*
+ * if the nulls value we got at the end of this lookup is
+ * not the expected one, we must restart lookup.
+ * We probably met an item that was moved to another chain.
+ */
+ if (get_nulls_value(node) != slot)
+   goto begin;
+ obj = NULL;
+
+out:
+ rcu_read_unlock();
+
+2) Insert function :
+--------------------
+
+/*
+ * Please note that new inserts are done at the head of list,
+ * not in the middle or end.
+ */
+obj = kmem_cache_alloc(cachep);
+lock_chain(); // typically a spin_lock()
+obj->key = key;
+atomic_set(&obj->refcnt, 1);
+/*
+ * insert obj in RCU way (readers might be traversing chain)
+ */
+hlist_nulls_add_head_rcu(&obj->obj_node, list);
+unlock_chain(); // typically a spin_unlock()

+ 0 - 7
Documentation/feature-removal-schedule.txt

@@ -120,13 +120,6 @@ Who:	Christoph Hellwig <hch@lst.de>
 
 
 ---------------------------
 ---------------------------
 
 
-What:   eepro100 network driver
-When:   January 2007
-Why:    replaced by the e100 driver
-Who:    Adrian Bunk <bunk@stusta.de>
-
----------------------------
-
 What:	Unused EXPORT_SYMBOL/EXPORT_SYMBOL_GPL exports
 What:	Unused EXPORT_SYMBOL/EXPORT_SYMBOL_GPL exports
 	(temporary transition config option provided until then)
 	(temporary transition config option provided until then)
 	The transition config option will also be removed at the same time.
 	The transition config option will also be removed at the same time.

+ 1 - 1
Documentation/networking/README.ipw2200

@@ -147,7 +147,7 @@ Where the supported parameter are:
 	driver.  If disabled, the driver will not attempt to scan 
 	driver.  If disabled, the driver will not attempt to scan 
 	for and associate to a network until it has been configured with 
 	for and associate to a network until it has been configured with 
 	one or more properties for the target network, for example configuring 
 	one or more properties for the target network, for example configuring 
-	the network SSID.  Default is 1 (auto-associate)
+	the network SSID.  Default is 0 (do not auto-associate)
 	
 	
 	Example: % modprobe ipw2200 associate=0
 	Example: % modprobe ipw2200 associate=0
 
 

+ 61 - 7
Documentation/networking/bonding.txt

@@ -194,6 +194,48 @@ or, for backwards compatibility, the option value.  E.g.,
 
 
 	The parameters are as follows:
 	The parameters are as follows:
 
 
+ad_select
+
+	Specifies the 802.3ad aggregation selection logic to use.  The
+	possible values and their effects are:
+
+	stable or 0
+
+		The active aggregator is chosen by largest aggregate
+		bandwidth.
+
+		Reselection of the active aggregator occurs only when all
+		slaves of the active aggregator are down or the active
+		aggregator has no slaves.
+
+		This is the default value.
+
+	bandwidth or 1
+
+		The active aggregator is chosen by largest aggregate
+		bandwidth.  Reselection occurs if:
+
+		- A slave is added to or removed from the bond
+
+		- Any slave's link state changes
+
+		- Any slave's 802.3ad association state changes
+
+		- The bond's adminstrative state changes to up
+
+	count or 2
+
+		The active aggregator is chosen by the largest number of
+		ports (slaves).  Reselection occurs as described under the
+		"bandwidth" setting, above.
+
+	The bandwidth and count selection policies permit failover of
+	802.3ad aggregations when partial failure of the active aggregator
+	occurs.  This keeps the aggregator with the highest availability
+	(either in bandwidth or in number of ports) active at all times.
+
+	This option was added in bonding version 3.4.0.
+
 arp_interval
 arp_interval
 
 
 	Specifies the ARP link monitoring frequency in milliseconds.
 	Specifies the ARP link monitoring frequency in milliseconds.
@@ -551,6 +593,16 @@ num_grat_arp
 	affects only the active-backup mode.  This option was added for
 	affects only the active-backup mode.  This option was added for
 	bonding version 3.3.0.
 	bonding version 3.3.0.
 
 
+num_unsol_na
+
+	Specifies the number of unsolicited IPv6 Neighbor Advertisements
+	to be issued after a failover event.  One unsolicited NA is issued
+	immediately after the failover.
+
+	The valid range is 0 - 255; the default value is 1.  This option
+	affects only the active-backup mode.  This option was added for
+	bonding version 3.4.0.
+
 primary
 primary
 
 
 	A string (eth0, eth2, etc) specifying which slave is the
 	A string (eth0, eth2, etc) specifying which slave is the
@@ -922,17 +974,19 @@ USERCTL=no
 NETMASK, NETWORK and BROADCAST) to match your network configuration.
 NETMASK, NETWORK and BROADCAST) to match your network configuration.
 
 
 	For later versions of initscripts, such as that found with Fedora
 	For later versions of initscripts, such as that found with Fedora
-7 and Red Hat Enterprise Linux version 5 (or later), it is possible, and,
-indeed, preferable, to specify the bonding options in the ifcfg-bond0
+7 (or later) and Red Hat Enterprise Linux version 5 (or later), it is possible,
+and, indeed, preferable, to specify the bonding options in the ifcfg-bond0
 file, e.g. a line of the format:
 file, e.g. a line of the format:
 
 
-BONDING_OPTS="mode=active-backup arp_interval=60 arp_ip_target=+192.168.1.254"
+BONDING_OPTS="mode=active-backup arp_interval=60 arp_ip_target=192.168.1.254"
 
 
 	will configure the bond with the specified options.  The options
 	will configure the bond with the specified options.  The options
 specified in BONDING_OPTS are identical to the bonding module parameters
 specified in BONDING_OPTS are identical to the bonding module parameters
-except for the arp_ip_target field.  Each target should be included as a
-separate option and should be preceded by a '+' to indicate it should be
-added to the list of queried targets, e.g.,
+except for the arp_ip_target field when using versions of initscripts older
+than and 8.57 (Fedora 8) and 8.45.19 (Red Hat Enterprise Linux 5.2).  When
+using older versions each target should be included as a separate option and
+should be preceded by a '+' to indicate it should be added to the list of
+queried targets, e.g.,
 
 
 	arp_ip_target=+192.168.1.1 arp_ip_target=+192.168.1.2
 	arp_ip_target=+192.168.1.1 arp_ip_target=+192.168.1.2
 
 
@@ -940,7 +994,7 @@ added to the list of queried targets, e.g.,
 options via BONDING_OPTS, it is not necessary to edit /etc/modules.conf or
 options via BONDING_OPTS, it is not necessary to edit /etc/modules.conf or
 /etc/modprobe.conf.
 /etc/modprobe.conf.
 
 
-	For older versions of initscripts that do not support
+	For even older versions of initscripts that do not support
 BONDING_OPTS, it is necessary to edit /etc/modules.conf (or
 BONDING_OPTS, it is necessary to edit /etc/modules.conf (or
 /etc/modprobe.conf, depending upon your distro) to load the bonding module
 /etc/modprobe.conf, depending upon your distro) to load the bonding module
 with your desired options when the bond0 interface is brought up.  The
 with your desired options when the bond0 interface is brought up.  The

+ 21 - 11
Documentation/networking/dccp.txt

@@ -57,6 +57,24 @@ can be set before calling bind().
 DCCP_SOCKOPT_GET_CUR_MPS is read-only and retrieves the current maximum packet
 DCCP_SOCKOPT_GET_CUR_MPS is read-only and retrieves the current maximum packet
 size (application payload size) in bytes, see RFC 4340, section 14.
 size (application payload size) in bytes, see RFC 4340, section 14.
 
 
+DCCP_SOCKOPT_AVAILABLE_CCIDS is also read-only and returns the list of CCIDs
+supported by the endpoint (see include/linux/dccp.h for symbolic constants).
+The caller needs to provide a sufficiently large (> 2) array of type uint8_t.
+
+DCCP_SOCKOPT_CCID is write-only and sets both the TX and RX CCIDs at the same
+time, combining the operation of the next two socket options. This option is
+preferrable over the latter two, since often applications will use the same
+type of CCID for both directions; and mixed use of CCIDs is not currently well
+understood. This socket option takes as argument at least one uint8_t value, or
+an array of uint8_t values, which must match available CCIDS (see above). CCIDs
+must be registered on the socket before calling connect() or listen().
+
+DCCP_SOCKOPT_TX_CCID is read/write. It returns the current CCID (if set) or sets
+the preference list for the TX CCID, using the same format as DCCP_SOCKOPT_CCID.
+Please note that the getsockopt argument type here is `int', not uint8_t.
+
+DCCP_SOCKOPT_RX_CCID is analogous to DCCP_SOCKOPT_TX_CCID, but for the RX CCID.
+
 DCCP_SOCKOPT_SERVER_TIMEWAIT enables the server (listening socket) to hold
 DCCP_SOCKOPT_SERVER_TIMEWAIT enables the server (listening socket) to hold
 timewait state when closing the connection (RFC 4340, 8.3). The usual case is
 timewait state when closing the connection (RFC 4340, 8.3). The usual case is
 that the closing server sends a CloseReq, whereupon the client holds timewait
 that the closing server sends a CloseReq, whereupon the client holds timewait
@@ -115,20 +133,12 @@ retries2
 	importance for retransmitted acknowledgments and feature negotiation,
 	importance for retransmitted acknowledgments and feature negotiation,
 	data packets are never retransmitted. Analogue of tcp_retries2.
 	data packets are never retransmitted. Analogue of tcp_retries2.
 
 
-send_ndp = 1
-	Whether or not to send NDP count options (sec. 7.7.2).
-
-send_ackvec = 1
-	Whether or not to send Ack Vector options (sec. 11.5).
-
-ack_ratio = 2
-	The default Ack Ratio (sec. 11.3) to use.
-
 tx_ccid = 2
 tx_ccid = 2
-	Default CCID for the sender-receiver half-connection.
+	Default CCID for the sender-receiver half-connection. Depending on the
+	choice of CCID, the Send Ack Vector feature is enabled automatically.
 
 
 rx_ccid = 2
 rx_ccid = 2
-	Default CCID for the receiver-sender half-connection.
+	Default CCID for the receiver-sender half-connection; see tx_ccid.
 
 
 seq_window = 100
 seq_window = 100
 	The initial sequence window (sec. 7.5.2).
 	The initial sequence window (sec. 7.5.2).

+ 1 - 1
Documentation/networking/driver.txt

@@ -13,7 +13,7 @@ Transmit path guidelines:
 	static int drv_hard_start_xmit(struct sk_buff *skb,
 	static int drv_hard_start_xmit(struct sk_buff *skb,
 		   		       struct net_device *dev)
 		   		       struct net_device *dev)
 	{
 	{
-		struct drv *dp = dev->priv;
+		struct drv *dp = netdev_priv(dev);
 
 
 		lock_tx(dp);
 		lock_tx(dp);
 		...
 		...

+ 4 - 4
Documentation/networking/generic-hdlc.txt

@@ -3,15 +3,15 @@ Krzysztof Halasa <khc@pm.waw.pl>
 
 
 
 
 Generic HDLC layer currently supports:
 Generic HDLC layer currently supports:
-1. Frame Relay (ANSI, CCITT, Cisco and no LMI).
+1. Frame Relay (ANSI, CCITT, Cisco and no LMI)
    - Normal (routed) and Ethernet-bridged (Ethernet device emulation)
    - Normal (routed) and Ethernet-bridged (Ethernet device emulation)
      interfaces can share a single PVC.
      interfaces can share a single PVC.
    - ARP support (no InARP support in the kernel - there is an
    - ARP support (no InARP support in the kernel - there is an
      experimental InARP user-space daemon available on:
      experimental InARP user-space daemon available on:
      http://www.kernel.org/pub/linux/utils/net/hdlc/).
      http://www.kernel.org/pub/linux/utils/net/hdlc/).
-2. raw HDLC - either IP (IPv4) interface or Ethernet device emulation.
-3. Cisco HDLC.
-4. PPP (uses syncppp.c).
+2. raw HDLC - either IP (IPv4) interface or Ethernet device emulation
+3. Cisco HDLC
+4. PPP
 5. X.25 (uses X.25 routines).
 5. X.25 (uses X.25 routines).
 
 
 Generic HDLC is a protocol driver only - it needs a low-level driver
 Generic HDLC is a protocol driver only - it needs a low-level driver

+ 6 - 0
Documentation/networking/ip-sysctl.txt

@@ -27,6 +27,12 @@ min_adv_mss - INTEGER
 	The advertised MSS depends on the first hop route MTU, but will
 	The advertised MSS depends on the first hop route MTU, but will
 	never be lower than this setting.
 	never be lower than this setting.
 
 
+rt_cache_rebuild_count - INTEGER
+	The per net-namespace route cache emergency rebuild threshold.
+	Any net-namespace having its route cache rebuilt due to
+	a hash bucket chain being too long more than this many times
+	will have its route caching disabled
+
 IP Fragmentation:
 IP Fragmentation:
 
 
 ipfrag_high_thresh - INTEGER
 ipfrag_high_thresh - INTEGER

+ 5 - 4
Documentation/networking/mac80211_hwsim/README

@@ -50,10 +50,6 @@ associates with the AP. hostapd and wpa_supplicant are used to take
 care of WPA2-PSK authentication. In addition, hostapd is also
 care of WPA2-PSK authentication. In addition, hostapd is also
 processing access point side of association.
 processing access point side of association.
 
 
-Please note that the current Linux kernel does not enable AP mode, so a
-simple patch is needed to enable AP mode selection:
-http://johannes.sipsolutions.net/patches/kernel/all/LATEST/006-allow-ap-vlan-modes.patch
-
 
 
 # Build mac80211_hwsim as part of kernel configuration
 # Build mac80211_hwsim as part of kernel configuration
 
 
@@ -65,3 +61,8 @@ hostapd hostapd.conf
 
 
 # Run wpa_supplicant (station) for wlan1
 # Run wpa_supplicant (station) for wlan1
 wpa_supplicant -Dwext -iwlan1 -c wpa_supplicant.conf
 wpa_supplicant -Dwext -iwlan1 -c wpa_supplicant.conf
+
+
+More test cases are available in hostap.git:
+git://w1.fi/srv/git/hostap.git and mac80211_hwsim/tests subdirectory
+(http://w1.fi/gitweb/gitweb.cgi?p=hostap.git;a=tree;f=mac80211_hwsim/tests)

+ 1 - 1
Documentation/networking/netdevices.txt

@@ -18,7 +18,7 @@ There are routines in net_init.c to handle the common cases of
 alloc_etherdev, alloc_netdev.  These reserve extra space for driver
 alloc_etherdev, alloc_netdev.  These reserve extra space for driver
 private data which gets freed when the network device is freed. If
 private data which gets freed when the network device is freed. If
 separately allocated data is attached to the network device
 separately allocated data is attached to the network device
-(dev->priv) then it is up to the module exit handler to free that.
+(netdev_priv(dev)) then it is up to the module exit handler to free that.
 
 
 MTU
 MTU
 ===
 ===

+ 9 - 13
Documentation/networking/regulatory.txt

@@ -131,11 +131,13 @@ are expected to do this during initialization.
 
 
 	r = zd_reg2alpha2(mac->regdomain, alpha2);
 	r = zd_reg2alpha2(mac->regdomain, alpha2);
 	if (!r)
 	if (!r)
-		regulatory_hint(hw->wiphy, alpha2, NULL);
+		regulatory_hint(hw->wiphy, alpha2);
 
 
 Example code - drivers providing a built in regulatory domain:
 Example code - drivers providing a built in regulatory domain:
 --------------------------------------------------------------
 --------------------------------------------------------------
 
 
+[NOTE: This API is not currently available, it can be added when required]
+
 If you have regulatory information you can obtain from your
 If you have regulatory information you can obtain from your
 driver and you *need* to use this we let you build a regulatory domain
 driver and you *need* to use this we let you build a regulatory domain
 structure and pass it to the wireless core. To do this you should
 structure and pass it to the wireless core. To do this you should
@@ -167,7 +169,6 @@ struct ieee80211_regdomain mydriver_jp_regdom = {
 
 
 Then in some part of your code after your wiphy has been registered:
 Then in some part of your code after your wiphy has been registered:
 
 
-	int r;
 	struct ieee80211_regdomain *rd;
 	struct ieee80211_regdomain *rd;
 	int size_of_regd;
 	int size_of_regd;
 	int num_rules = mydriver_jp_regdom.n_reg_rules;
 	int num_rules = mydriver_jp_regdom.n_reg_rules;
@@ -178,17 +179,12 @@ Then in some part of your code after your wiphy has been registered:
 
 
 	rd = kzalloc(size_of_regd, GFP_KERNEL);
 	rd = kzalloc(size_of_regd, GFP_KERNEL);
 	if (!rd)
 	if (!rd)
-	return -ENOMEM;
+		return -ENOMEM;
 
 
 	memcpy(rd, &mydriver_jp_regdom, sizeof(struct ieee80211_regdomain));
 	memcpy(rd, &mydriver_jp_regdom, sizeof(struct ieee80211_regdomain));
 
 
-	for (i=0; i < num_rules; i++) {
-		memcpy(&rd->reg_rules[i], &mydriver_jp_regdom.reg_rules[i],
-			sizeof(struct ieee80211_reg_rule));
-	}
-	r = regulatory_hint(hw->wiphy, NULL, rd);
-	if (r) {
-		kfree(rd);
-		return r;
-	}
-
+	for (i=0; i < num_rules; i++)
+		memcpy(&rd->reg_rules[i],
+		       &mydriver_jp_regdom.reg_rules[i],
+		       sizeof(struct ieee80211_reg_rule));
+	regulatory_struct_hint(rd);

+ 10 - 2
Documentation/powerpc/dts-bindings/fsl/tsec.txt

@@ -2,8 +2,8 @@
 
 
 The MDIO is a bus to which the PHY devices are connected.  For each
 The MDIO is a bus to which the PHY devices are connected.  For each
 device that exists on this bus, a child node should be created.  See
 device that exists on this bus, a child node should be created.  See
-the definition of the PHY node below for an example of how to define
-a PHY.
+the definition of the PHY node in booting-without-of.txt for an example
+of how to define a PHY.
 
 
 Required properties:
 Required properties:
   - reg : Offset and length of the register set for the device
   - reg : Offset and length of the register set for the device
@@ -21,6 +21,14 @@ Example:
 		};
 		};
 	};
 	};
 
 
+* TBI Internal MDIO bus
+
+As of this writing, every tsec is associated with an internal TBI PHY.
+This PHY is accessed through the local MDIO bus.  These buses are defined
+similarly to the mdio buses, except they are compatible with "fsl,gianfar-tbi".
+The TBI PHYs underneath them are similar to normal PHYs, but the reg property
+is considered instructive, rather than descriptive.  The reg property should
+be chosen so it doesn't interfere with other PHYs on the bus.
 
 
 * Gianfar-compatible ethernet nodes
 * Gianfar-compatible ethernet nodes
 
 

+ 13 - 7
Documentation/rfkill.txt

@@ -191,12 +191,20 @@ Userspace input handlers (uevents) or kernel input handlers (rfkill-input):
 	  to tell the devices registered with the rfkill class to change
 	  to tell the devices registered with the rfkill class to change
 	  their state (i.e. translates the input layer event into real
 	  their state (i.e. translates the input layer event into real
 	  action).
 	  action).
+
 	* rfkill-input implements EPO by handling EV_SW SW_RFKILL_ALL 0
 	* rfkill-input implements EPO by handling EV_SW SW_RFKILL_ALL 0
 	  (power off all transmitters) in a special way: it ignores any
 	  (power off all transmitters) in a special way: it ignores any
 	  overrides and local state cache and forces all transmitters to the
 	  overrides and local state cache and forces all transmitters to the
 	  RFKILL_STATE_SOFT_BLOCKED state (including those which are already
 	  RFKILL_STATE_SOFT_BLOCKED state (including those which are already
-	  supposed to be BLOCKED).  Note that the opposite event (power on all
-	  transmitters) is handled normally.
+	  supposed to be BLOCKED).
+	* rfkill EPO will remain active until rfkill-input receives an
+	  EV_SW SW_RFKILL_ALL 1 event.  While the EPO is active, transmitters
+	  are locked in the blocked state (rfkill will refuse to unblock them).
+	* rfkill-input implements different policies that the user can
+	  select for handling EV_SW SW_RFKILL_ALL 1.  It will unlock rfkill,
+	  and either do nothing (leave transmitters blocked, but now unlocked),
+	  restore the transmitters to their state before the EPO, or unblock
+	  them all.
 
 
 Userspace uevent handler or kernel platform-specific drivers hooked to the
 Userspace uevent handler or kernel platform-specific drivers hooked to the
 rfkill notifier chain:
 rfkill notifier chain:
@@ -331,11 +339,9 @@ class to get a sysfs interface :-)
 correct event for your switch/button.  These events are emergency power-off
 correct event for your switch/button.  These events are emergency power-off
 events when they are trying to turn the transmitters off.  An example of an
 events when they are trying to turn the transmitters off.  An example of an
 input device which SHOULD generate *_RFKILL_ALL events is the wireless-kill
 input device which SHOULD generate *_RFKILL_ALL events is the wireless-kill
-switch in a laptop which is NOT a hotkey, but a real switch that kills radios
-in hardware, even if the O.S. has gone to lunch.  An example of an input device
-which SHOULD NOT generate *_RFKILL_ALL events by default, is any sort of hot
-key that does nothing by itself, as well as any hot key that is type-specific
-(e.g. the one for WLAN).
+switch in a laptop which is NOT a hotkey, but a real sliding/rocker switch.
+An example of an input device which SHOULD NOT generate *_RFKILL_ALL events by
+default, is any sort of hot key that is type-specific (e.g. the one for WLAN).
 
 
 
 
 3.1 Guidelines for wireless device drivers
 3.1 Guidelines for wireless device drivers

+ 35 - 13
MAINTAINERS

@@ -742,7 +742,7 @@ M:	jirislaby@gmail.com
 P:	Nick Kossifidis
 P:	Nick Kossifidis
 M:	mickflemm@gmail.com
 M:	mickflemm@gmail.com
 P:	Luis R. Rodriguez
 P:	Luis R. Rodriguez
-M:	mcgrof@gmail.com
+M:	lrodriguez@atheros.com
 P:	Bob Copeland
 P:	Bob Copeland
 M:	me@bobcopeland.com
 M:	me@bobcopeland.com
 L:	linux-wireless@vger.kernel.org
 L:	linux-wireless@vger.kernel.org
@@ -1607,11 +1607,6 @@ L:	acpi4asus-user@lists.sourceforge.net
 W:	http://sourceforge.net/projects/acpi4asus
 W:	http://sourceforge.net/projects/acpi4asus
 S:	Maintained
 S:	Maintained
 
 
-EEPRO100 NETWORK DRIVER
-P:	Andrey V. Savochkin
-M:	saw@saw.sw.com.sg
-S:	Maintained
-
 EFS FILESYSTEM
 EFS FILESYSTEM
 W:	http://aeschi.ch.eu.org/efs/
 W:	http://aeschi.ch.eu.org/efs/
 S:	Orphan
 S:	Orphan
@@ -1849,7 +1844,7 @@ P:	Haavard Skinnemoen
 M:	hskinnemoen@atmel.com
 M:	hskinnemoen@atmel.com
 S:	Supported
 S:	Supported
 
 
-GENERIC HDLC DRIVER, N2, C101, PCI200SYN and WANXL DRIVERS
+GENERIC HDLC (WAN) DRIVERS
 P:	Krzysztof Halasa
 P:	Krzysztof Halasa
 M:	khc@pm.waw.pl
 M:	khc@pm.waw.pl
 W:	http://www.kernel.org/pub/linux/utils/net/hdlc/
 W:	http://www.kernel.org/pub/linux/utils/net/hdlc/
@@ -2248,6 +2243,11 @@ M:	dan.j.williams@intel.com
 L:	linux-kernel@vger.kernel.org
 L:	linux-kernel@vger.kernel.org
 S:	Supported
 S:	Supported
 
 
+INTEL IXP4XX QMGR, NPE, ETHERNET and HSS SUPPORT
+P:	Krzysztof Halasa
+M:	khc@pm.waw.pl
+S:	Maintained
+
 INTEL IXP4XX RANDOM NUMBER GENERATOR SUPPORT
 INTEL IXP4XX RANDOM NUMBER GENERATOR SUPPORT
 P:	Deepak Saxena
 P:	Deepak Saxena
 M:	dsaxena@plexity.net
 M:	dsaxena@plexity.net
@@ -3614,16 +3614,26 @@ L:	linux-hams@vger.kernel.org
 W:	http://www.linux-ax25.org/
 W:	http://www.linux-ax25.org/
 S:	Maintained
 S:	Maintained
 
 
-RTL818X WIRELESS DRIVER
-P:	Michael Wu
-M:	flamingice@sourmilk.net
-P:	Andrea Merello
-M:	andreamrl@tiscali.it
+RTL8180 WIRELESS DRIVER
+P:	John W. Linville
+M:	linville@tuxdriver.com
 L:	linux-wireless@vger.kernel.org
 L:	linux-wireless@vger.kernel.org
 W:	http://linuxwireless.org/
 W:	http://linuxwireless.org/
-T:	git kernel.org:/pub/scm/linux/kernel/git/mwu/mac80211-drivers.git
+T:	git kernel.org:/pub/scm/linux/kernel/git/linville/wireless-testing.git
 S:	Maintained
 S:	Maintained
 
 
+RTL8187 WIRELESS DRIVER
+P:	 Herton Ronaldo Krzesinski
+M:      herton@mandriva.com.br
+P:      Hin-Tak Leung
+M       htl10@users.sourceforge.net
+P:      Larry Finger
+M:      Larry.Finger@lwfinger.net
+L:      linux-wireless@vger.kernel.org
+W:      http://linuxwireless.org/
+T:      git kernel.org:/pub/scm/linux/kernel/git/linville/wireless-testing.git
+S:      Maintained
+
 S3 SAVAGE FRAMEBUFFER DRIVER
 S3 SAVAGE FRAMEBUFFER DRIVER
 P:	Antonino Daplas
 P:	Antonino Daplas
 M:	adaplas@gmail.com
 M:	adaplas@gmail.com
@@ -3913,6 +3923,18 @@ M:	mhoffman@lightlink.com
 L:	lm-sensors@lm-sensors.org
 L:	lm-sensors@lm-sensors.org
 S:	Maintained
 S:	Maintained
 
 
+SMSC911x ETHERNET DRIVER
+P:	Steve Glendinning
+M:	steve.glendinning@smsc.com
+L:	netdev@vger.kernel.org
+S:	Supported
+
+SMSC9420 PCI ETHERNET DRIVER
+P:	Steve Glendinning
+M:	steve.glendinning@smsc.com
+L:	netdev@vger.kernel.org
+S:	Supported
+
 SMX UIO Interface
 SMX UIO Interface
 P:	Ben Nizette
 P:	Ben Nizette
 M:	bn@niasdigital.com
 M:	bn@niasdigital.com

+ 4 - 5
arch/arm/mach-ixp4xx/fsg-setup.c

@@ -177,7 +177,6 @@ static irqreturn_t fsg_reset_handler(int irq, void *dev_id)
 
 
 static void __init fsg_init(void)
 static void __init fsg_init(void)
 {
 {
-	DECLARE_MAC_BUF(mac_buf);
 	uint8_t __iomem *f;
 	uint8_t __iomem *f;
 
 
 	ixp4xx_sys_init();
 	ixp4xx_sys_init();
@@ -256,10 +255,10 @@ static void __init fsg_init(void)
 #endif
 #endif
 		iounmap(f);
 		iounmap(f);
 	}
 	}
-	printk(KERN_INFO "FSG: Using MAC address %s for port 0\n",
-	       print_mac(mac_buf, fsg_plat_eth[0].hwaddr));
-	printk(KERN_INFO "FSG: Using MAC address %s for port 1\n",
-	       print_mac(mac_buf, fsg_plat_eth[1].hwaddr));
+	printk(KERN_INFO "FSG: Using MAC address %pM for port 0\n",
+	       fsg_plat_eth[0].hwaddr);
+	printk(KERN_INFO "FSG: Using MAC address %pM for port 1\n",
+	       fsg_plat_eth[1].hwaddr);
 
 
 }
 }
 
 

+ 33 - 2
arch/arm/mach-ixp4xx/include/mach/qmgr.h

@@ -12,6 +12,8 @@
 #include <linux/io.h>
 #include <linux/io.h>
 #include <linux/kernel.h>
 #include <linux/kernel.h>
 
 
+#define DEBUG_QMGR	0
+
 #define HALF_QUEUES	32
 #define HALF_QUEUES	32
 #define QUEUES		64	/* only 32 lower queues currently supported */
 #define QUEUES		64	/* only 32 lower queues currently supported */
 #define MAX_QUEUE_LENGTH 4	/* in dwords */
 #define MAX_QUEUE_LENGTH 4	/* in dwords */
@@ -61,22 +63,51 @@ void qmgr_enable_irq(unsigned int queue);
 void qmgr_disable_irq(unsigned int queue);
 void qmgr_disable_irq(unsigned int queue);
 
 
 /* request_ and release_queue() must be called from non-IRQ context */
 /* request_ and release_queue() must be called from non-IRQ context */
+
+#if DEBUG_QMGR
+extern char qmgr_queue_descs[QUEUES][32];
+
 int qmgr_request_queue(unsigned int queue, unsigned int len /* dwords */,
 int qmgr_request_queue(unsigned int queue, unsigned int len /* dwords */,
 		       unsigned int nearly_empty_watermark,
 		       unsigned int nearly_empty_watermark,
-		       unsigned int nearly_full_watermark);
+		       unsigned int nearly_full_watermark,
+		       const char *desc_format, const char* name);
+#else
+int __qmgr_request_queue(unsigned int queue, unsigned int len /* dwords */,
+			 unsigned int nearly_empty_watermark,
+			 unsigned int nearly_full_watermark);
+#define qmgr_request_queue(queue, len, nearly_empty_watermark,		\
+			   nearly_full_watermark, desc_format, name)	\
+	__qmgr_request_queue(queue, len, nearly_empty_watermark,	\
+			     nearly_full_watermark)
+#endif
+
 void qmgr_release_queue(unsigned int queue);
 void qmgr_release_queue(unsigned int queue);
 
 
 
 
 static inline void qmgr_put_entry(unsigned int queue, u32 val)
 static inline void qmgr_put_entry(unsigned int queue, u32 val)
 {
 {
 	extern struct qmgr_regs __iomem *qmgr_regs;
 	extern struct qmgr_regs __iomem *qmgr_regs;
+#if DEBUG_QMGR
+	BUG_ON(!qmgr_queue_descs[queue]); /* not yet requested */
+
+	printk(KERN_DEBUG "Queue %s(%i) put %X\n",
+	       qmgr_queue_descs[queue], queue, val);
+#endif
 	__raw_writel(val, &qmgr_regs->acc[queue][0]);
 	__raw_writel(val, &qmgr_regs->acc[queue][0]);
 }
 }
 
 
 static inline u32 qmgr_get_entry(unsigned int queue)
 static inline u32 qmgr_get_entry(unsigned int queue)
 {
 {
+	u32 val;
 	extern struct qmgr_regs __iomem *qmgr_regs;
 	extern struct qmgr_regs __iomem *qmgr_regs;
-	return __raw_readl(&qmgr_regs->acc[queue][0]);
+	val = __raw_readl(&qmgr_regs->acc[queue][0]);
+#if DEBUG_QMGR
+	BUG_ON(!qmgr_queue_descs[queue]); /* not yet requested */
+
+	printk(KERN_DEBUG "Queue %s(%i) get %X\n",
+	       qmgr_queue_descs[queue], queue, val);
+#endif
+	return val;
 }
 }
 
 
 static inline int qmgr_get_stat1(unsigned int queue)
 static inline int qmgr_get_stat1(unsigned int queue)

+ 33 - 11
arch/arm/mach-ixp4xx/ixp4xx_qmgr.c

@@ -14,8 +14,6 @@
 #include <linux/module.h>
 #include <linux/module.h>
 #include <mach/qmgr.h>
 #include <mach/qmgr.h>
 
 
-#define DEBUG		0
-
 struct qmgr_regs __iomem *qmgr_regs;
 struct qmgr_regs __iomem *qmgr_regs;
 static struct resource *mem_res;
 static struct resource *mem_res;
 static spinlock_t qmgr_lock;
 static spinlock_t qmgr_lock;
@@ -23,6 +21,10 @@ static u32 used_sram_bitmap[4]; /* 128 16-dword pages */
 static void (*irq_handlers[HALF_QUEUES])(void *pdev);
 static void (*irq_handlers[HALF_QUEUES])(void *pdev);
 static void *irq_pdevs[HALF_QUEUES];
 static void *irq_pdevs[HALF_QUEUES];
 
 
+#if DEBUG_QMGR
+char qmgr_queue_descs[QUEUES][32];
+#endif
+
 void qmgr_set_irq(unsigned int queue, int src,
 void qmgr_set_irq(unsigned int queue, int src,
 		  void (*handler)(void *pdev), void *pdev)
 		  void (*handler)(void *pdev), void *pdev)
 {
 {
@@ -70,6 +72,7 @@ void qmgr_disable_irq(unsigned int queue)
 	spin_lock_irqsave(&qmgr_lock, flags);
 	spin_lock_irqsave(&qmgr_lock, flags);
 	__raw_writel(__raw_readl(&qmgr_regs->irqen[0]) & ~(1 << queue),
 	__raw_writel(__raw_readl(&qmgr_regs->irqen[0]) & ~(1 << queue),
 		     &qmgr_regs->irqen[0]);
 		     &qmgr_regs->irqen[0]);
+	__raw_writel(1 << queue, &qmgr_regs->irqstat[0]); /* clear */
 	spin_unlock_irqrestore(&qmgr_lock, flags);
 	spin_unlock_irqrestore(&qmgr_lock, flags);
 }
 }
 
 
@@ -81,9 +84,16 @@ static inline void shift_mask(u32 *mask)
 	mask[0] <<= 1;
 	mask[0] <<= 1;
 }
 }
 
 
+#if DEBUG_QMGR
 int qmgr_request_queue(unsigned int queue, unsigned int len /* dwords */,
 int qmgr_request_queue(unsigned int queue, unsigned int len /* dwords */,
 		       unsigned int nearly_empty_watermark,
 		       unsigned int nearly_empty_watermark,
-		       unsigned int nearly_full_watermark)
+		       unsigned int nearly_full_watermark,
+		       const char *desc_format, const char* name)
+#else
+int __qmgr_request_queue(unsigned int queue, unsigned int len /* dwords */,
+			 unsigned int nearly_empty_watermark,
+			 unsigned int nearly_full_watermark)
+#endif
 {
 {
 	u32 cfg, addr = 0, mask[4]; /* in 16-dwords */
 	u32 cfg, addr = 0, mask[4]; /* in 16-dwords */
 	int err;
 	int err;
@@ -151,12 +161,13 @@ int qmgr_request_queue(unsigned int queue, unsigned int len /* dwords */,
 	used_sram_bitmap[2] |= mask[2];
 	used_sram_bitmap[2] |= mask[2];
 	used_sram_bitmap[3] |= mask[3];
 	used_sram_bitmap[3] |= mask[3];
 	__raw_writel(cfg | (addr << 14), &qmgr_regs->sram[queue]);
 	__raw_writel(cfg | (addr << 14), &qmgr_regs->sram[queue]);
-	spin_unlock_irq(&qmgr_lock);
-
-#if DEBUG
-	printk(KERN_DEBUG "qmgr: requested queue %i, addr = 0x%02X\n",
-	       queue, addr);
+#if DEBUG_QMGR
+	snprintf(qmgr_queue_descs[queue], sizeof(qmgr_queue_descs[0]),
+		 desc_format, name);
+	printk(KERN_DEBUG "qmgr: requested queue %s(%i) addr = 0x%02X\n",
+	       qmgr_queue_descs[queue], queue, addr);
 #endif
 #endif
+	spin_unlock_irq(&qmgr_lock);
 	return 0;
 	return 0;
 
 
 err:
 err:
@@ -189,6 +200,11 @@ void qmgr_release_queue(unsigned int queue)
 	while (addr--)
 	while (addr--)
 		shift_mask(mask);
 		shift_mask(mask);
 
 
+#if DEBUG_QMGR
+	printk(KERN_DEBUG "qmgr: releasing queue %s(%i)\n",
+	       qmgr_queue_descs[queue], queue);
+	qmgr_queue_descs[queue][0] = '\x0';
+#endif
 	__raw_writel(0, &qmgr_regs->sram[queue]);
 	__raw_writel(0, &qmgr_regs->sram[queue]);
 
 
 	used_sram_bitmap[0] &= ~mask[0];
 	used_sram_bitmap[0] &= ~mask[0];
@@ -199,9 +215,10 @@ void qmgr_release_queue(unsigned int queue)
 	spin_unlock_irq(&qmgr_lock);
 	spin_unlock_irq(&qmgr_lock);
 
 
 	module_put(THIS_MODULE);
 	module_put(THIS_MODULE);
-#if DEBUG
-	printk(KERN_DEBUG "qmgr: released queue %i\n", queue);
-#endif
+
+	while ((addr = qmgr_get_entry(queue)))
+		printk(KERN_ERR "qmgr: released queue %i not empty: 0x%08X\n",
+		       queue, addr);
 }
 }
 
 
 static int qmgr_init(void)
 static int qmgr_init(void)
@@ -272,5 +289,10 @@ EXPORT_SYMBOL(qmgr_regs);
 EXPORT_SYMBOL(qmgr_set_irq);
 EXPORT_SYMBOL(qmgr_set_irq);
 EXPORT_SYMBOL(qmgr_enable_irq);
 EXPORT_SYMBOL(qmgr_enable_irq);
 EXPORT_SYMBOL(qmgr_disable_irq);
 EXPORT_SYMBOL(qmgr_disable_irq);
+#if DEBUG_QMGR
+EXPORT_SYMBOL(qmgr_queue_descs);
 EXPORT_SYMBOL(qmgr_request_queue);
 EXPORT_SYMBOL(qmgr_request_queue);
+#else
+EXPORT_SYMBOL(__qmgr_request_queue);
+#endif
 EXPORT_SYMBOL(qmgr_release_queue);
 EXPORT_SYMBOL(qmgr_release_queue);

+ 2 - 3
arch/arm/mach-ixp4xx/nas100d-setup.c

@@ -231,7 +231,6 @@ static irqreturn_t nas100d_reset_handler(int irq, void *dev_id)
 
 
 static void __init nas100d_init(void)
 static void __init nas100d_init(void)
 {
 {
-	DECLARE_MAC_BUF(mac_buf);
 	uint8_t __iomem *f;
 	uint8_t __iomem *f;
 	int i;
 	int i;
 
 
@@ -294,8 +293,8 @@ static void __init nas100d_init(void)
 #endif
 #endif
 		iounmap(f);
 		iounmap(f);
 	}
 	}
-	printk(KERN_INFO "NAS100D: Using MAC address %s for port 0\n",
-	       print_mac(mac_buf, nas100d_plat_eth[0].hwaddr));
+	printk(KERN_INFO "NAS100D: Using MAC address %pM for port 0\n",
+	       nas100d_plat_eth[0].hwaddr);
 
 
 }
 }
 
 

+ 2 - 3
arch/arm/mach-ixp4xx/nslu2-setup.c

@@ -220,7 +220,6 @@ static struct sys_timer nslu2_timer = {
 
 
 static void __init nslu2_init(void)
 static void __init nslu2_init(void)
 {
 {
-	DECLARE_MAC_BUF(mac_buf);
 	uint8_t __iomem *f;
 	uint8_t __iomem *f;
 	int i;
 	int i;
 
 
@@ -275,8 +274,8 @@ static void __init nslu2_init(void)
 #endif
 #endif
 		iounmap(f);
 		iounmap(f);
 	}
 	}
-	printk(KERN_INFO "NSLU2: Using MAC address %s for port 0\n",
-	       print_mac(mac_buf, nslu2_plat_eth[0].hwaddr));
+	printk(KERN_INFO "NSLU2: Using MAC address %pM for port 0\n",
+	       nslu2_plat_eth[0].hwaddr);
 
 
 }
 }
 
 

+ 15 - 10
arch/ia64/hp/sim/simeth.c

@@ -167,6 +167,15 @@ netdev_read(int fd, unsigned char *buf, unsigned int len)
 	return ia64_ssc(fd, __pa(buf), len, 0, SSC_NETDEV_RECV);
 	return ia64_ssc(fd, __pa(buf), len, 0, SSC_NETDEV_RECV);
 }
 }
 
 
+static const struct net_device_ops simeth_netdev_ops = {
+	.ndo_open		= simeth_open,
+	.ndo_stop		= simeth_close,
+	.ndo_start_xmit		= simeth_tx,
+	.ndo_get_stats		= simeth_get_stats,
+	.ndo_set_multicast_list	= set_multicast_list, /* not yet used */
+
+};
+
 /*
 /*
  * Function shared with module code, so cannot be in init section
  * Function shared with module code, so cannot be in init section
  *
  *
@@ -206,14 +215,10 @@ simeth_probe1(void)
 
 
 	memcpy(dev->dev_addr, mac_addr, sizeof(mac_addr));
 	memcpy(dev->dev_addr, mac_addr, sizeof(mac_addr));
 
 
-	local = dev->priv;
+	local = netdev_priv(dev);
 	local->simfd = fd; /* keep track of underlying file descriptor */
 	local->simfd = fd; /* keep track of underlying file descriptor */
 
 
-	dev->open		= simeth_open;
-	dev->stop		= simeth_close;
-	dev->hard_start_xmit	= simeth_tx;
-	dev->get_stats		= simeth_get_stats;
-	dev->set_multicast_list = set_multicast_list; /* no yet used */
+	dev->netdev_ops = &simeth_netdev_ops;
 
 
 	err = register_netdev(dev);
 	err = register_netdev(dev);
 	if (err) {
 	if (err) {
@@ -325,7 +330,7 @@ simeth_device_event(struct notifier_block *this,unsigned long event, void *ptr)
 	 * we get DOWN then UP.
 	 * we get DOWN then UP.
 	 */
 	 */
 
 
-	local = dev->priv;
+	local = netdev_priv(dev);
 	/* now do it for real */
 	/* now do it for real */
 	r = event == NETDEV_UP ?
 	r = event == NETDEV_UP ?
 		netdev_attach(local->simfd, dev->irq, ntohl(ifa->ifa_local)):
 		netdev_attach(local->simfd, dev->irq, ntohl(ifa->ifa_local)):
@@ -380,7 +385,7 @@ frame_print(unsigned char *from, unsigned char *frame, int len)
 static int
 static int
 simeth_tx(struct sk_buff *skb, struct net_device *dev)
 simeth_tx(struct sk_buff *skb, struct net_device *dev)
 {
 {
-	struct simeth_local *local = dev->priv;
+	struct simeth_local *local = netdev_priv(dev);
 
 
 #if 0
 #if 0
 	/* ensure we have at least ETH_ZLEN bytes (min frame size) */
 	/* ensure we have at least ETH_ZLEN bytes (min frame size) */
@@ -443,7 +448,7 @@ simeth_rx(struct net_device *dev)
 	int			len;
 	int			len;
 	int			rcv_count = SIMETH_RECV_MAX;
 	int			rcv_count = SIMETH_RECV_MAX;
 
 
-	local = dev->priv;
+	local = netdev_priv(dev);
 	/*
 	/*
 	 * the loop concept has been borrowed from other drivers
 	 * the loop concept has been borrowed from other drivers
 	 * looks to me like it's a throttling thing to avoid pushing to many
 	 * looks to me like it's a throttling thing to avoid pushing to many
@@ -507,7 +512,7 @@ simeth_interrupt(int irq, void *dev_id)
 static struct net_device_stats *
 static struct net_device_stats *
 simeth_get_stats(struct net_device *dev)
 simeth_get_stats(struct net_device *dev)
 {
 {
-	struct simeth_local *local = dev->priv;
+	struct simeth_local *local = netdev_priv(dev);
 
 
 	return &local->stats;
 	return &local->stats;
 }
 }

+ 20 - 0
arch/powerpc/boot/dts/asp834x-redboot.dts

@@ -199,8 +199,26 @@
 				reg = <0x2>;
 				reg = <0x2>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
 			cell-index = <0>;
 			cell-index = <0>;
 			device_type = "network";
 			device_type = "network";
@@ -210,6 +228,7 @@
 			local-mac-address = [ 00 08 e5 11 32 33 ];
 			local-mac-address = [ 00 08 e5 11 32 33 ];
 			interrupts = <32 0x8 33 0x8 34 0x8>;
 			interrupts = <32 0x8 33 0x8 34 0x8>;
 			interrupt-parent = <&ipic>;
 			interrupt-parent = <&ipic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy0>;
 			phy-handle = <&phy0>;
 			linux,network-index = <0>;
 			linux,network-index = <0>;
 		};
 		};
@@ -223,6 +242,7 @@
 			local-mac-address = [ 00 08 e5 11 32 34 ];
 			local-mac-address = [ 00 08 e5 11 32 34 ];
 			interrupts = <35 0x8 36 0x8 37 0x8>;
 			interrupts = <35 0x8 36 0x8 37 0x8>;
 			interrupt-parent = <&ipic>;
 			interrupt-parent = <&ipic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = <&phy1>;
 			phy-handle = <&phy1>;
 			linux,network-index = <1>;
 			linux,network-index = <1>;
 		};
 		};

+ 20 - 0
arch/powerpc/boot/dts/ksi8560.dts

@@ -141,8 +141,26 @@
 				reg = <0x2>;
 				reg = <0x2>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
 			device_type = "network";
 			device_type = "network";
 			model = "TSEC";
 			model = "TSEC";
@@ -152,6 +170,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>;
 			interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&PHY1>;
 			phy-handle = <&PHY1>;
 		};
 		};
 
 
@@ -164,6 +183,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <0x23 0x2 0x24 0x2 0x28 0x2>;
 			interrupts = <0x23 0x2 0x24 0x2 0x28 0x2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = <&PHY2>;
 			phy-handle = <&PHY2>;
 		};
 		};
 
 

+ 20 - 0
arch/powerpc/boot/dts/mpc8313erdb.dts

@@ -190,6 +190,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <37 0x8 36 0x8 35 0x8>;
 			interrupts = <37 0x8 36 0x8 35 0x8>;
 			interrupt-parent = <&ipic>;
 			interrupt-parent = <&ipic>;
+			tbi-handle = < &tbi0 >;
 			phy-handle = < &phy1 >;
 			phy-handle = < &phy1 >;
 			fsl,magic-packet;
 			fsl,magic-packet;
 
 
@@ -210,6 +211,10 @@
 					reg = <0x4>;
 					reg = <0x4>;
 					device_type = "ethernet-phy";
 					device_type = "ethernet-phy";
 				};
 				};
+				tbi0: tbi-phy@11 {
+					reg = <0x11>;
+					device_type = "tbi-phy";
+				};
 			};
 			};
 		};
 		};
 
 
@@ -222,9 +227,24 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <34 0x8 33 0x8 32 0x8>;
 			interrupts = <34 0x8 33 0x8 32 0x8>;
 			interrupt-parent = <&ipic>;
 			interrupt-parent = <&ipic>;
+			tbi-handle = < &tbi1 >;
 			phy-handle = < &phy4 >;
 			phy-handle = < &phy4 >;
 			sleep = <&pmc 0x10000000>;
 			sleep = <&pmc 0x10000000>;
 			fsl,magic-packet;
 			fsl,magic-packet;
+
+			mdio@25520 {
+				#address-cells = <1>;
+				#size-cells = <0>;
+				compatible = "fsl,gianfar-tbi";
+				reg = <0x25520 0x20>;
+
+				tbi1: tbi-phy@11 {
+					reg = <0x11>;
+					device_type = "tbi-phy";
+				};
+			};
+
+
 		};
 		};
 
 
 		serial0: serial@4500 {
 		serial0: serial@4500 {

+ 19 - 0
arch/powerpc/boot/dts/mpc8315erdb.dts

@@ -206,8 +206,25 @@
 				reg = <0x1>;
 				reg = <0x1>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
+
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
 			cell-index = <0>;
 			cell-index = <0>;
 			device_type = "network";
 			device_type = "network";
@@ -217,6 +234,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <32 0x8 33 0x8 34 0x8>;
 			interrupts = <32 0x8 33 0x8 34 0x8>;
 			interrupt-parent = <&ipic>;
 			interrupt-parent = <&ipic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = < &phy0 >;
 			phy-handle = < &phy0 >;
 		};
 		};
 
 
@@ -229,6 +247,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <35 0x8 36 0x8 37 0x8>;
 			interrupts = <35 0x8 36 0x8 37 0x8>;
 			interrupt-parent = <&ipic>;
 			interrupt-parent = <&ipic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = < &phy1 >;
 			phy-handle = < &phy1 >;
 		};
 		};
 
 

+ 18 - 0
arch/powerpc/boot/dts/mpc8349emitx.dts

@@ -184,6 +184,22 @@
 				reg = <0x1c>;
 				reg = <0x1c>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
@@ -195,6 +211,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <32 0x8 33 0x8 34 0x8>;
 			interrupts = <32 0x8 33 0x8 34 0x8>;
 			interrupt-parent = <&ipic>;
 			interrupt-parent = <&ipic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy1c>;
 			phy-handle = <&phy1c>;
 			linux,network-index = <0>;
 			linux,network-index = <0>;
 		};
 		};
@@ -211,6 +228,7 @@
 			/* Vitesse 7385 isn't on the MDIO bus */
 			/* Vitesse 7385 isn't on the MDIO bus */
 			fixed-link = <1 1 1000 0 0>;
 			fixed-link = <1 1 1000 0 0>;
 			linux,network-index = <1>;
 			linux,network-index = <1>;
+			tbi-handle = <&tbi1>;
 		};
 		};
 
 
 		serial0: serial@4500 {
 		serial0: serial@4500 {

+ 5 - 0
arch/powerpc/boot/dts/mpc8349emitxgp.dts

@@ -163,6 +163,10 @@
 				reg = <0x1c>;
 				reg = <0x1c>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
@@ -174,6 +178,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <32 0x8 33 0x8 34 0x8>;
 			interrupts = <32 0x8 33 0x8 34 0x8>;
 			interrupt-parent = <&ipic>;
 			interrupt-parent = <&ipic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy1c>;
 			phy-handle = <&phy1c>;
 			linux,network-index = <0>;
 			linux,network-index = <0>;
 		};
 		};

+ 19 - 0
arch/powerpc/boot/dts/mpc834x_mds.dts

@@ -185,8 +185,25 @@
 				reg = <0x1>;
 				reg = <0x1>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
+
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
 			cell-index = <0>;
 			cell-index = <0>;
 			device_type = "network";
 			device_type = "network";
@@ -196,6 +213,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <32 0x8 33 0x8 34 0x8>;
 			interrupts = <32 0x8 33 0x8 34 0x8>;
 			interrupt-parent = <&ipic>;
 			interrupt-parent = <&ipic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy0>;
 			phy-handle = <&phy0>;
 			linux,network-index = <0>;
 			linux,network-index = <0>;
 		};
 		};
@@ -209,6 +227,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <35 0x8 36 0x8 37 0x8>;
 			interrupts = <35 0x8 36 0x8 37 0x8>;
 			interrupt-parent = <&ipic>;
 			interrupt-parent = <&ipic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = <&phy1>;
 			phy-handle = <&phy1>;
 			linux,network-index = <1>;
 			linux,network-index = <1>;
 		};
 		};

+ 19 - 0
arch/powerpc/boot/dts/mpc8377_mds.dts

@@ -193,8 +193,25 @@
 				reg = <0x3>;
 				reg = <0x3>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
+
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
 			cell-index = <0>;
 			cell-index = <0>;
 			device_type = "network";
 			device_type = "network";
@@ -205,6 +222,7 @@
 			interrupts = <32 0x8 33 0x8 34 0x8>;
 			interrupts = <32 0x8 33 0x8 34 0x8>;
 			phy-connection-type = "mii";
 			phy-connection-type = "mii";
 			interrupt-parent = <&ipic>;
 			interrupt-parent = <&ipic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy2>;
 			phy-handle = <&phy2>;
 		};
 		};
 
 
@@ -218,6 +236,7 @@
 			interrupts = <35 0x8 36 0x8 37 0x8>;
 			interrupts = <35 0x8 36 0x8 37 0x8>;
 			phy-connection-type = "mii";
 			phy-connection-type = "mii";
 			interrupt-parent = <&ipic>;
 			interrupt-parent = <&ipic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = <&phy3>;
 			phy-handle = <&phy3>;
 		};
 		};
 
 

+ 19 - 0
arch/powerpc/boot/dts/mpc8377_rdb.dts

@@ -211,8 +211,25 @@
 				reg = <0x2>;
 				reg = <0x2>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
+
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
 			cell-index = <0>;
 			cell-index = <0>;
 			device_type = "network";
 			device_type = "network";
@@ -223,6 +240,7 @@
 			interrupts = <32 0x8 33 0x8 34 0x8>;
 			interrupts = <32 0x8 33 0x8 34 0x8>;
 			phy-connection-type = "mii";
 			phy-connection-type = "mii";
 			interrupt-parent = <&ipic>;
 			interrupt-parent = <&ipic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy2>;
 			phy-handle = <&phy2>;
 		};
 		};
 
 
@@ -237,6 +255,7 @@
 			phy-connection-type = "mii";
 			phy-connection-type = "mii";
 			interrupt-parent = <&ipic>;
 			interrupt-parent = <&ipic>;
 			fixed-link = <1 1 1000 0 0>;
 			fixed-link = <1 1 1000 0 0>;
+			tbi-handle = <&tbi1>;
 		};
 		};
 
 
 		serial0: serial@4500 {
 		serial0: serial@4500 {

+ 19 - 0
arch/powerpc/boot/dts/mpc8378_mds.dts

@@ -232,8 +232,25 @@
 				reg = <0x3>;
 				reg = <0x3>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
+
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
 			cell-index = <0>;
 			cell-index = <0>;
 			device_type = "network";
 			device_type = "network";
@@ -244,6 +261,7 @@
 			interrupts = <32 0x8 33 0x8 34 0x8>;
 			interrupts = <32 0x8 33 0x8 34 0x8>;
 			phy-connection-type = "mii";
 			phy-connection-type = "mii";
 			interrupt-parent = <&ipic>;
 			interrupt-parent = <&ipic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy2>;
 			phy-handle = <&phy2>;
 		};
 		};
 
 
@@ -257,6 +275,7 @@
 			interrupts = <35 0x8 36 0x8 37 0x8>;
 			interrupts = <35 0x8 36 0x8 37 0x8>;
 			phy-connection-type = "mii";
 			phy-connection-type = "mii";
 			interrupt-parent = <&ipic>;
 			interrupt-parent = <&ipic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = <&phy3>;
 			phy-handle = <&phy3>;
 		};
 		};
 
 

+ 17 - 0
arch/powerpc/boot/dts/mpc8378_rdb.dts

@@ -211,8 +211,25 @@
 				reg = <0x2>;
 				reg = <0x2>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
+
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
 			cell-index = <0>;
 			cell-index = <0>;
 			device_type = "network";
 			device_type = "network";

+ 18 - 0
arch/powerpc/boot/dts/mpc8379_mds.dts

@@ -232,6 +232,22 @@
 				reg = <0x3>;
 				reg = <0x3>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
@@ -244,6 +260,7 @@
 			interrupts = <32 0x8 33 0x8 34 0x8>;
 			interrupts = <32 0x8 33 0x8 34 0x8>;
 			phy-connection-type = "mii";
 			phy-connection-type = "mii";
 			interrupt-parent = <&ipic>;
 			interrupt-parent = <&ipic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy2>;
 			phy-handle = <&phy2>;
 		};
 		};
 
 
@@ -257,6 +274,7 @@
 			interrupts = <35 0x8 36 0x8 37 0x8>;
 			interrupts = <35 0x8 36 0x8 37 0x8>;
 			phy-connection-type = "mii";
 			phy-connection-type = "mii";
 			interrupt-parent = <&ipic>;
 			interrupt-parent = <&ipic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = <&phy3>;
 			phy-handle = <&phy3>;
 		};
 		};
 
 

+ 18 - 0
arch/powerpc/boot/dts/mpc8379_rdb.dts

@@ -211,6 +211,22 @@
 				reg = <0x2>;
 				reg = <0x2>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
@@ -223,6 +239,7 @@
 			interrupts = <32 0x8 33 0x8 34 0x8>;
 			interrupts = <32 0x8 33 0x8 34 0x8>;
 			phy-connection-type = "mii";
 			phy-connection-type = "mii";
 			interrupt-parent = <&ipic>;
 			interrupt-parent = <&ipic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy2>;
 			phy-handle = <&phy2>;
 		};
 		};
 
 
@@ -237,6 +254,7 @@
 			phy-connection-type = "mii";
 			phy-connection-type = "mii";
 			interrupt-parent = <&ipic>;
 			interrupt-parent = <&ipic>;
 			fixed-link = <1 1 1000 0 0>;
 			fixed-link = <1 1 1000 0 0>;
+			tbi-handle = <&tbi1>;
 		};
 		};
 
 
 		serial0: serial@4500 {
 		serial0: serial@4500 {

+ 18 - 0
arch/powerpc/boot/dts/mpc8536ds.dts

@@ -155,6 +155,22 @@
 				reg = <1>;
 				reg = <1>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@26520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x26520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
 		usb@22000 {
 		usb@22000 {
@@ -186,6 +202,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <29 2 30 2 34 2>;
 			interrupts = <29 2 30 2 34 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy1>;
 			phy-handle = <&phy1>;
 			phy-connection-type = "rgmii-id";
 			phy-connection-type = "rgmii-id";
 		};
 		};
@@ -199,6 +216,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <31 2 32 2 33 2>;
 			interrupts = <31 2 32 2 33 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = <&phy0>;
 			phy-handle = <&phy0>;
 			phy-connection-type = "rgmii-id";
 			phy-connection-type = "rgmii-id";
 		};
 		};

+ 31 - 0
arch/powerpc/boot/dts/mpc8540ads.dts

@@ -150,6 +150,34 @@
 				reg = <0x3>;
 				reg = <0x3>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@26520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x26520 0x20>;
+
+			tbi2: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
@@ -161,6 +189,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <29 2 30 2 34 2>;
 			interrupts = <29 2 30 2 34 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy0>;
 			phy-handle = <&phy0>;
 		};
 		};
 
 
@@ -173,6 +202,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <35 2 36 2 40 2>;
 			interrupts = <35 2 36 2 40 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = <&phy1>;
 			phy-handle = <&phy1>;
 		};
 		};
 
 
@@ -185,6 +215,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <41 2>;
 			interrupts = <41 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi2>;
 			phy-handle = <&phy3>;
 			phy-handle = <&phy3>;
 		};
 		};
 
 

+ 18 - 0
arch/powerpc/boot/dts/mpc8541cds.dts

@@ -144,6 +144,22 @@
 				reg = <0x1>;
 				reg = <0x1>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
@@ -155,6 +171,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <29 2 30 2 34 2>;
 			interrupts = <29 2 30 2 34 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy0>;
 			phy-handle = <&phy0>;
 		};
 		};
 
 
@@ -167,6 +184,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <35 2 36 2 40 2>;
 			interrupts = <35 2 36 2 40 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = <&phy1>;
 			phy-handle = <&phy1>;
 		};
 		};
 
 

+ 20 - 0
arch/powerpc/boot/dts/mpc8544ds.dts

@@ -116,8 +116,26 @@
 				reg = <0x1>;
 				reg = <0x1>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
+		mdio@26520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x26520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+
 		dma@21300 {
 		dma@21300 {
 			#address-cells = <1>;
 			#address-cells = <1>;
 			#size-cells = <1>;
 			#size-cells = <1>;
@@ -169,6 +187,7 @@
 			interrupts = <29 2 30 2 34 2>;
 			interrupts = <29 2 30 2 34 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
 			phy-handle = <&phy0>;
 			phy-handle = <&phy0>;
+			tbi-handle = <&tbi0>;
 			phy-connection-type = "rgmii-id";
 			phy-connection-type = "rgmii-id";
 		};
 		};
 
 
@@ -182,6 +201,7 @@
 			interrupts = <31 2 32 2 33 2>;
 			interrupts = <31 2 32 2 33 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
 			phy-handle = <&phy1>;
 			phy-handle = <&phy1>;
+			tbi-handle = <&tbi1>;
 			phy-connection-type = "rgmii-id";
 			phy-connection-type = "rgmii-id";
 		};
 		};
 
 

+ 44 - 0
arch/powerpc/boot/dts/mpc8548cds.dts

@@ -172,6 +172,46 @@
 				reg = <0x3>;
 				reg = <0x3>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@26520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x26520 0x20>;
+
+			tbi2: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@27520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x27520 0x20>;
+
+			tbi3: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
@@ -183,6 +223,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <29 2 30 2 34 2>;
 			interrupts = <29 2 30 2 34 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy0>;
 			phy-handle = <&phy0>;
 		};
 		};
 
 
@@ -195,6 +236,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <35 2 36 2 40 2>;
 			interrupts = <35 2 36 2 40 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = <&phy1>;
 			phy-handle = <&phy1>;
 		};
 		};
 
 
@@ -208,6 +250,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <31 2 32 2 33 2>;
 			interrupts = <31 2 32 2 33 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi2>;
 			phy-handle = <&phy2>;
 			phy-handle = <&phy2>;
 		};
 		};
 
 
@@ -220,6 +263,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <37 2 38 2 39 2>;
 			interrupts = <37 2 38 2 39 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi3>;
 			phy-handle = <&phy3>;
 			phy-handle = <&phy3>;
 		};
 		};
  */
  */

+ 18 - 0
arch/powerpc/boot/dts/mpc8555cds.dts

@@ -144,6 +144,22 @@
 				reg = <0x1>;
 				reg = <0x1>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
@@ -155,6 +171,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <29 2 30 2 34 2>;
 			interrupts = <29 2 30 2 34 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy0>;
 			phy-handle = <&phy0>;
 		};
 		};
 
 
@@ -167,6 +184,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <35 2 36 2 40 2>;
 			interrupts = <35 2 36 2 40 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = <&phy1>;
 			phy-handle = <&phy1>;
 		};
 		};
 
 

+ 18 - 0
arch/powerpc/boot/dts/mpc8560ads.dts

@@ -145,6 +145,22 @@
 				reg = <0x3>;
 				reg = <0x3>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
@@ -156,6 +172,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <29 2 30 2 34 2>;
 			interrupts = <29 2 30 2 34 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy0>;
 			phy-handle = <&phy0>;
 		};
 		};
 
 
@@ -168,6 +185,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <35 2 36 2 40 2>;
 			interrupts = <35 2 36 2 40 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = <&phy1>;
 			phy-handle = <&phy1>;
 		};
 		};
 
 

+ 18 - 0
arch/powerpc/boot/dts/mpc8568mds.dts

@@ -179,6 +179,22 @@
 				reg = <0x3>;
 				reg = <0x3>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
@@ -190,6 +206,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
  			interrupts = <29 2 30 2 34 2>;
  			interrupts = <29 2 30 2 34 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy2>;
 			phy-handle = <&phy2>;
 		};
 		};
 
 
@@ -202,6 +219,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
  			interrupts = <35 2 36 2 40 2>;
  			interrupts = <35 2 36 2 40 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = <&phy3>;
 			phy-handle = <&phy3>;
 		};
 		};
 
 

+ 45 - 0
arch/powerpc/boot/dts/mpc8572ds.dts

@@ -225,6 +225,47 @@
 				interrupts = <10 1>;
 				interrupts = <10 1>;
 				reg = <0x3>;
 				reg = <0x3>;
 			};
 			};
+
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@26520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x26520 0x20>;
+
+			tbi2: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@27520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x27520 0x20>;
+
+			tbi3: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
@@ -236,6 +277,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <29 2 30 2 34 2>;
 			interrupts = <29 2 30 2 34 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy0>;
 			phy-handle = <&phy0>;
 			phy-connection-type = "rgmii-id";
 			phy-connection-type = "rgmii-id";
 		};
 		};
@@ -249,6 +291,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <35 2 36 2 40 2>;
 			interrupts = <35 2 36 2 40 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = <&phy1>;
 			phy-handle = <&phy1>;
 			phy-connection-type = "rgmii-id";
 			phy-connection-type = "rgmii-id";
 		};
 		};
@@ -262,6 +305,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <31 2 32 2 33 2>;
 			interrupts = <31 2 32 2 33 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi2>;
 			phy-handle = <&phy2>;
 			phy-handle = <&phy2>;
 			phy-connection-type = "rgmii-id";
 			phy-connection-type = "rgmii-id";
 		};
 		};
@@ -275,6 +319,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <37 2 38 2 39 2>;
 			interrupts = <37 2 38 2 39 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi3>;
 			phy-handle = <&phy3>;
 			phy-handle = <&phy3>;
 			phy-connection-type = "rgmii-id";
 			phy-connection-type = "rgmii-id";
 		};
 		};

+ 45 - 0
arch/powerpc/boot/dts/mpc8641_hpcn.dts

@@ -205,8 +205,49 @@
 				reg = <3>;
 				reg = <3>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@26520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x26520 0x20>;
+
+			tbi2: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@27520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x27520 0x20>;
+
+			tbi3: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
+
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
 			cell-index = <0>;
 			cell-index = <0>;
 			device_type = "network";
 			device_type = "network";
@@ -216,6 +257,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <29 2 30  2 34 2>;
 			interrupts = <29 2 30  2 34 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy0>;
 			phy-handle = <&phy0>;
 			phy-connection-type = "rgmii-id";
 			phy-connection-type = "rgmii-id";
 		};
 		};
@@ -229,6 +271,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <35 2 36 2 40 2>;
 			interrupts = <35 2 36 2 40 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = <&phy1>;
 			phy-handle = <&phy1>;
 			phy-connection-type = "rgmii-id";
 			phy-connection-type = "rgmii-id";
 		};
 		};
@@ -242,6 +285,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <31 2 32 2 33 2>;
 			interrupts = <31 2 32 2 33 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi2>;
 			phy-handle = <&phy2>;
 			phy-handle = <&phy2>;
 			phy-connection-type = "rgmii-id";
 			phy-connection-type = "rgmii-id";
 		};
 		};
@@ -255,6 +299,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <37 2 38 2 39 2>;
 			interrupts = <37 2 38 2 39 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi3>;
 			phy-handle = <&phy3>;
 			phy-handle = <&phy3>;
 			phy-connection-type = "rgmii-id";
 			phy-connection-type = "rgmii-id";
 		};
 		};

+ 18 - 0
arch/powerpc/boot/dts/sbc8349.dts

@@ -177,6 +177,22 @@
 				reg = <0x1a>;
 				reg = <0x1a>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
@@ -188,6 +204,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <32 0x8 33 0x8 34 0x8>;
 			interrupts = <32 0x8 33 0x8 34 0x8>;
 			interrupt-parent = <&ipic>;
 			interrupt-parent = <&ipic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy0>;
 			phy-handle = <&phy0>;
 			linux,network-index = <0>;
 			linux,network-index = <0>;
 		};
 		};
@@ -201,6 +218,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <35 0x8 36 0x8 37 0x8>;
 			interrupts = <35 0x8 36 0x8 37 0x8>;
 			interrupt-parent = <&ipic>;
 			interrupt-parent = <&ipic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = <&phy1>;
 			phy-handle = <&phy1>;
 			linux,network-index = <1>;
 			linux,network-index = <1>;
 		};
 		};

+ 18 - 0
arch/powerpc/boot/dts/sbc8548.dts

@@ -252,6 +252,22 @@
 				reg = <0x1a>;
 				reg = <0x1a>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
@@ -263,6 +279,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>;
 			interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy0>;
 			phy-handle = <&phy0>;
 		};
 		};
 
 
@@ -275,6 +292,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <0x23 0x2 0x24 0x2 0x28 0x2>;
 			interrupts = <0x23 0x2 0x24 0x2 0x28 0x2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = <&phy1>;
 			phy-handle = <&phy1>;
 		};
 		};
 
 

+ 18 - 0
arch/powerpc/boot/dts/sbc8560.dts

@@ -168,6 +168,22 @@
 				reg = <0x1c>;
 				reg = <0x1c>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
@@ -179,6 +195,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>;
 			interrupts = <0x1d 0x2 0x1e 0x2 0x22 0x2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy0>;
 			phy-handle = <&phy0>;
 		};
 		};
 
 
@@ -191,6 +208,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <0x23 0x2 0x24 0x2 0x28 0x2>;
 			interrupts = <0x23 0x2 0x24 0x2 0x28 0x2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = <&phy1>;
 			phy-handle = <&phy1>;
 		};
 		};
 
 

+ 44 - 0
arch/powerpc/boot/dts/sbc8641d.dts

@@ -222,6 +222,46 @@
 				reg = <2>;
 				reg = <2>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@26520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x26520 0x20>;
+
+			tbi2: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@27520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x27520 0x20>;
+
+			tbi3: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
@@ -233,6 +273,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <29 2 30  2 34 2>;
 			interrupts = <29 2 30  2 34 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy0>;
 			phy-handle = <&phy0>;
 			phy-connection-type = "rgmii-id";
 			phy-connection-type = "rgmii-id";
 		};
 		};
@@ -246,6 +287,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <35 2 36 2 40 2>;
 			interrupts = <35 2 36 2 40 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = <&phy1>;
 			phy-handle = <&phy1>;
 			phy-connection-type = "rgmii-id";
 			phy-connection-type = "rgmii-id";
 		};
 		};
@@ -259,6 +301,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <31 2 32 2 33 2>;
 			interrupts = <31 2 32 2 33 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi2>;
 			phy-handle = <&phy2>;
 			phy-handle = <&phy2>;
 			phy-connection-type = "rgmii-id";
 			phy-connection-type = "rgmii-id";
 		};
 		};
@@ -272,6 +315,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <37 2 38 2 39 2>;
 			interrupts = <37 2 38 2 39 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi3>;
 			phy-handle = <&phy3>;
 			phy-handle = <&phy3>;
 			phy-connection-type = "rgmii-id";
 			phy-connection-type = "rgmii-id";
 		};
 		};

+ 18 - 0
arch/powerpc/boot/dts/stx_gp3_8560.dts

@@ -142,6 +142,22 @@
 				reg = <4>;
 				reg = <4>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
@@ -153,6 +169,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <29 2 30 2 34 2>;
 			interrupts = <29 2 30 2 34 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy2>;
 			phy-handle = <&phy2>;
 		};
 		};
 
 
@@ -165,6 +182,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <35 2 36 2 40 2>;
 			interrupts = <35 2 36 2 40 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = <&phy4>;
 			phy-handle = <&phy4>;
 		};
 		};
 
 

+ 28 - 0
arch/powerpc/boot/dts/tqm8540.dts

@@ -155,6 +155,34 @@
 				reg = <3>;
 				reg = <3>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@26520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x26520 0x20>;
+
+			tbi2: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {

+ 18 - 0
arch/powerpc/boot/dts/tqm8541.dts

@@ -154,6 +154,22 @@
 				reg = <3>;
 				reg = <3>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
@@ -165,6 +181,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <29 2 30 2 34 2>;
 			interrupts = <29 2 30 2 34 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy2>;
 			phy-handle = <&phy2>;
 		};
 		};
 
 
@@ -177,6 +194,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <35 2 36 2 40 2>;
 			interrupts = <35 2 36 2 40 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = <&phy1>;
 			phy-handle = <&phy1>;
 		};
 		};
 
 

+ 44 - 0
arch/powerpc/boot/dts/tqm8548-bigflash.dts

@@ -179,6 +179,46 @@
 				reg = <5>;
 				reg = <5>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@26520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x26520 0x20>;
+
+			tbi2: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@27520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x27520 0x20>;
+
+			tbi3: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
@@ -190,6 +230,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <29 2 30 2 34 2>;
 			interrupts = <29 2 30 2 34 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy2>;
 			phy-handle = <&phy2>;
 		};
 		};
 
 
@@ -202,6 +243,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <35 2 36 2 40 2>;
 			interrupts = <35 2 36 2 40 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = <&phy1>;
 			phy-handle = <&phy1>;
 		};
 		};
 
 
@@ -214,6 +256,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <31 2 32 2 33 2>;
 			interrupts = <31 2 32 2 33 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi2>;
 			phy-handle = <&phy3>;
 			phy-handle = <&phy3>;
 		};
 		};
 
 
@@ -226,6 +269,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <37 2 38 2 39 2>;
 			interrupts = <37 2 38 2 39 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi3>;
 			phy-handle = <&phy4>;
 			phy-handle = <&phy4>;
 		};
 		};
 
 

+ 44 - 0
arch/powerpc/boot/dts/tqm8548.dts

@@ -179,6 +179,46 @@
 				reg = <5>;
 				reg = <5>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@26520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x26520 0x20>;
+
+			tbi2: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@27520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x27520 0x20>;
+
+			tbi3: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
@@ -190,6 +230,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <29 2 30 2 34 2>;
 			interrupts = <29 2 30 2 34 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy2>;
 			phy-handle = <&phy2>;
 		};
 		};
 
 
@@ -202,6 +243,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <35 2 36 2 40 2>;
 			interrupts = <35 2 36 2 40 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = <&phy1>;
 			phy-handle = <&phy1>;
 		};
 		};
 
 
@@ -214,6 +256,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <31 2 32 2 33 2>;
 			interrupts = <31 2 32 2 33 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi2>;
 			phy-handle = <&phy3>;
 			phy-handle = <&phy3>;
 		};
 		};
 
 
@@ -226,6 +269,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <37 2 38 2 39 2>;
 			interrupts = <37 2 38 2 39 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi3>;
 			phy-handle = <&phy4>;
 			phy-handle = <&phy4>;
 		};
 		};
 
 

+ 18 - 0
arch/powerpc/boot/dts/tqm8555.dts

@@ -154,6 +154,22 @@
 				reg = <3>;
 				reg = <3>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
@@ -165,6 +181,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <29 2 30 2 34 2>;
 			interrupts = <29 2 30 2 34 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy2>;
 			phy-handle = <&phy2>;
 		};
 		};
 
 
@@ -177,6 +194,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <35 2 36 2 40 2>;
 			interrupts = <35 2 36 2 40 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = <&phy1>;
 			phy-handle = <&phy1>;
 		};
 		};
 
 

+ 18 - 0
arch/powerpc/boot/dts/tqm8560.dts

@@ -156,6 +156,22 @@
 				reg = <3>;
 				reg = <3>;
 				device_type = "ethernet-phy";
 				device_type = "ethernet-phy";
 			};
 			};
+			tbi0: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
+		};
+
+		mdio@25520 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			compatible = "fsl,gianfar-tbi";
+			reg = <0x25520 0x20>;
+
+			tbi1: tbi-phy@11 {
+				reg = <0x11>;
+				device_type = "tbi-phy";
+			};
 		};
 		};
 
 
 		enet0: ethernet@24000 {
 		enet0: ethernet@24000 {
@@ -167,6 +183,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <29 2 30 2 34 2>;
 			interrupts = <29 2 30 2 34 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi0>;
 			phy-handle = <&phy2>;
 			phy-handle = <&phy2>;
 		};
 		};
 
 
@@ -179,6 +196,7 @@
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			local-mac-address = [ 00 00 00 00 00 00 ];
 			interrupts = <35 2 36 2 40 2>;
 			interrupts = <35 2 36 2 40 2>;
 			interrupt-parent = <&mpic>;
 			interrupt-parent = <&mpic>;
+			tbi-handle = <&tbi1>;
 			phy-handle = <&phy1>;
 			phy-handle = <&phy1>;
 		};
 		};
 
 

+ 28 - 213
arch/powerpc/sysdev/fsl_soc.c

@@ -207,236 +207,51 @@ static int __init of_add_fixed_phys(void)
 arch_initcall(of_add_fixed_phys);
 arch_initcall(of_add_fixed_phys);
 #endif /* CONFIG_FIXED_PHY */
 #endif /* CONFIG_FIXED_PHY */
 
 
-static int gfar_mdio_of_init_one(struct device_node *np)
-{
-	int k;
-	struct device_node *child = NULL;
-	struct gianfar_mdio_data mdio_data;
-	struct platform_device *mdio_dev;
-	struct resource res;
-	int ret;
-
-	memset(&res, 0, sizeof(res));
-	memset(&mdio_data, 0, sizeof(mdio_data));
-
-	ret = of_address_to_resource(np, 0, &res);
-	if (ret)
-		return ret;
-
-	/* The gianfar device will try to use the same ID created below to find
-	 * this bus, to coordinate register access (since they share).  */
-	mdio_dev = platform_device_register_simple("fsl-gianfar_mdio",
-			res.start&0xfffff, &res, 1);
-	if (IS_ERR(mdio_dev))
-		return PTR_ERR(mdio_dev);
-
-	for (k = 0; k < 32; k++)
-		mdio_data.irq[k] = PHY_POLL;
-
-	while ((child = of_get_next_child(np, child)) != NULL) {
-		int irq = irq_of_parse_and_map(child, 0);
-		if (irq != NO_IRQ) {
-			const u32 *id = of_get_property(child, "reg", NULL);
-			mdio_data.irq[*id] = irq;
-		}
-	}
-
-	ret = platform_device_add_data(mdio_dev, &mdio_data,
-				sizeof(struct gianfar_mdio_data));
-	if (ret)
-		platform_device_unregister(mdio_dev);
-
-	return ret;
-}
-
-static int __init gfar_mdio_of_init(void)
-{
-	struct device_node *np = NULL;
-
-	for_each_compatible_node(np, NULL, "fsl,gianfar-mdio")
-		gfar_mdio_of_init_one(np);
-
-	/* try the deprecated version */
-	for_each_compatible_node(np, "mdio", "gianfar");
-		gfar_mdio_of_init_one(np);
-
-	return 0;
-}
-
-arch_initcall(gfar_mdio_of_init);
-
-static const char *gfar_tx_intr = "tx";
-static const char *gfar_rx_intr = "rx";
-static const char *gfar_err_intr = "error";
-
-static int __init gfar_of_init(void)
+#ifdef CONFIG_PPC_83xx
+static int __init mpc83xx_wdt_init(void)
 {
 {
+	struct resource r;
 	struct device_node *np;
 	struct device_node *np;
-	unsigned int i;
-	struct platform_device *gfar_dev;
-	struct resource res;
+	struct platform_device *dev;
+	u32 freq = fsl_get_sys_freq();
 	int ret;
 	int ret;
 
 
-	for (np = NULL, i = 0;
-	     (np = of_find_compatible_node(np, "network", "gianfar")) != NULL;
-	     i++) {
-		struct resource r[4];
-		struct device_node *phy, *mdio;
-		struct gianfar_platform_data gfar_data;
-		const unsigned int *id;
-		const char *model;
-		const char *ctype;
-		const void *mac_addr;
-		const phandle *ph;
-		int n_res = 2;
-
-		if (!of_device_is_available(np))
-			continue;
-
-		memset(r, 0, sizeof(r));
-		memset(&gfar_data, 0, sizeof(gfar_data));
-
-		ret = of_address_to_resource(np, 0, &r[0]);
-		if (ret)
-			goto err;
-
-		of_irq_to_resource(np, 0, &r[1]);
-
-		model = of_get_property(np, "model", NULL);
-
-		/* If we aren't the FEC we have multiple interrupts */
-		if (model && strcasecmp(model, "FEC")) {
-			r[1].name = gfar_tx_intr;
-
-			r[2].name = gfar_rx_intr;
-			of_irq_to_resource(np, 1, &r[2]);
+	np = of_find_compatible_node(NULL, "watchdog", "mpc83xx_wdt");
 
 
-			r[3].name = gfar_err_intr;
-			of_irq_to_resource(np, 2, &r[3]);
-
-			n_res += 2;
-		}
-
-		gfar_dev =
-		    platform_device_register_simple("fsl-gianfar", i, &r[0],
-						    n_res);
-
-		if (IS_ERR(gfar_dev)) {
-			ret = PTR_ERR(gfar_dev);
-			goto err;
-		}
-
-		mac_addr = of_get_mac_address(np);
-		if (mac_addr)
-			memcpy(gfar_data.mac_addr, mac_addr, 6);
-
-		if (model && !strcasecmp(model, "TSEC"))
-			gfar_data.device_flags =
-			    FSL_GIANFAR_DEV_HAS_GIGABIT |
-			    FSL_GIANFAR_DEV_HAS_COALESCE |
-			    FSL_GIANFAR_DEV_HAS_RMON |
-			    FSL_GIANFAR_DEV_HAS_MULTI_INTR;
-		if (model && !strcasecmp(model, "eTSEC"))
-			gfar_data.device_flags =
-			    FSL_GIANFAR_DEV_HAS_GIGABIT |
-			    FSL_GIANFAR_DEV_HAS_COALESCE |
-			    FSL_GIANFAR_DEV_HAS_RMON |
-			    FSL_GIANFAR_DEV_HAS_MULTI_INTR |
-			    FSL_GIANFAR_DEV_HAS_CSUM |
-			    FSL_GIANFAR_DEV_HAS_VLAN |
-			    FSL_GIANFAR_DEV_HAS_EXTENDED_HASH;
-
-		ctype = of_get_property(np, "phy-connection-type", NULL);
-
-		/* We only care about rgmii-id.  The rest are autodetected */
-		if (ctype && !strcmp(ctype, "rgmii-id"))
-			gfar_data.interface = PHY_INTERFACE_MODE_RGMII_ID;
-		else
-			gfar_data.interface = PHY_INTERFACE_MODE_MII;
-
-		if (of_get_property(np, "fsl,magic-packet", NULL))
-			gfar_data.device_flags |= FSL_GIANFAR_DEV_HAS_MAGIC_PACKET;
-
-		ph = of_get_property(np, "phy-handle", NULL);
-		if (ph == NULL) {
-			u32 *fixed_link;
-
-			fixed_link = (u32 *)of_get_property(np, "fixed-link",
-							   NULL);
-			if (!fixed_link) {
-				ret = -ENODEV;
-				goto unreg;
-			}
-
-			snprintf(gfar_data.bus_id, MII_BUS_ID_SIZE, "0");
-			gfar_data.phy_id = fixed_link[0];
-		} else {
-			phy = of_find_node_by_phandle(*ph);
-
-			if (phy == NULL) {
-				ret = -ENODEV;
-				goto unreg;
-			}
-
-			mdio = of_get_parent(phy);
-
-			id = of_get_property(phy, "reg", NULL);
-			ret = of_address_to_resource(mdio, 0, &res);
-			if (ret) {
-				of_node_put(phy);
-				of_node_put(mdio);
-				goto unreg;
-			}
-
-			gfar_data.phy_id = *id;
-			snprintf(gfar_data.bus_id, MII_BUS_ID_SIZE, "%llx",
-				 (unsigned long long)res.start&0xfffff);
+	if (!np) {
+		ret = -ENODEV;
+		goto nodev;
+	}
 
 
-			of_node_put(phy);
-			of_node_put(mdio);
-		}
+	memset(&r, 0, sizeof(r));
 
 
-		/* Get MDIO bus controlled by this eTSEC, if any.  Normally only
-		 * eTSEC 1 will control an MDIO bus, not necessarily the same
-		 * bus that its PHY is on ('mdio' above), so we can't just use
-		 * that.  What we do is look for a gianfar mdio device that has
-		 * overlapping registers with this device.  That's really the
-		 * whole point, to find the device sharing our registers to
-		 * coordinate access with it.
-		 */
-		for_each_compatible_node(mdio, NULL, "fsl,gianfar-mdio") {
-			if (of_address_to_resource(mdio, 0, &res))
-				continue;
-
-			if (res.start >= r[0].start && res.end <= r[0].end) {
-				/* Get the ID the mdio bus platform device was
-				 * registered with.  gfar_data.bus_id is
-				 * different because it's for finding a PHY,
-				 * while this is for finding a MII bus.
-				 */
-				gfar_data.mdio_bus = res.start&0xfffff;
-				of_node_put(mdio);
-				break;
-			}
-		}
+	ret = of_address_to_resource(np, 0, &r);
+	if (ret)
+		goto err;
 
 
-		ret =
-		    platform_device_add_data(gfar_dev, &gfar_data,
-					     sizeof(struct
-						    gianfar_platform_data));
-		if (ret)
-			goto unreg;
+	dev = platform_device_register_simple("mpc83xx_wdt", 0, &r, 1);
+	if (IS_ERR(dev)) {
+		ret = PTR_ERR(dev);
+		goto err;
 	}
 	}
 
 
+	ret = platform_device_add_data(dev, &freq, sizeof(freq));
+	if (ret)
+		goto unreg;
+
+	of_node_put(np);
 	return 0;
 	return 0;
 
 
 unreg:
 unreg:
-	platform_device_unregister(gfar_dev);
+	platform_device_unregister(dev);
 err:
 err:
+	of_node_put(np);
+nodev:
 	return ret;
 	return ret;
 }
 }
 
 
-arch_initcall(gfar_of_init);
+arch_initcall(mpc83xx_wdt_init);
+#endif
 
 
 static enum fsl_usb2_phy_modes determine_usb_phy(const char *phy_type)
 static enum fsl_usb2_phy_modes determine_usb_phy(const char *phy_type)
 {
 {

+ 2 - 2
arch/s390/appldata/appldata_net_sum.c

@@ -67,7 +67,6 @@ static void appldata_get_net_sum_data(void *data)
 	int i;
 	int i;
 	struct appldata_net_sum_data *net_data;
 	struct appldata_net_sum_data *net_data;
 	struct net_device *dev;
 	struct net_device *dev;
-	struct net_device_stats *stats;
 	unsigned long rx_packets, tx_packets, rx_bytes, tx_bytes, rx_errors,
 	unsigned long rx_packets, tx_packets, rx_bytes, tx_bytes, rx_errors,
 			tx_errors, rx_dropped, tx_dropped, collisions;
 			tx_errors, rx_dropped, tx_dropped, collisions;
 
 
@@ -86,7 +85,8 @@ static void appldata_get_net_sum_data(void *data)
 	collisions = 0;
 	collisions = 0;
 	read_lock(&dev_base_lock);
 	read_lock(&dev_base_lock);
 	for_each_netdev(&init_net, dev) {
 	for_each_netdev(&init_net, dev) {
-		stats = dev->get_stats(dev);
+		const struct net_device_stats *stats = dev_get_stats(dev);
+
 		rx_packets += stats->rx_packets;
 		rx_packets += stats->rx_packets;
 		tx_packets += stats->tx_packets;
 		tx_packets += stats->tx_packets;
 		rx_bytes   += stats->rx_bytes;
 		rx_bytes   += stats->rx_bytes;

+ 1 - 4
arch/sparc64/kernel/idprom.c

@@ -42,8 +42,5 @@ void __init idprom_init(void)
 			    idprom->id_cksum, calc_idprom_cksum(idprom));
 			    idprom->id_cksum, calc_idprom_cksum(idprom));
 	}
 	}
 
 
-	printk("Ethernet address: %02x:%02x:%02x:%02x:%02x:%02x\n",
-	       idprom->id_ethaddr[0], idprom->id_ethaddr[1],
-	       idprom->id_ethaddr[2], idprom->id_ethaddr[3],
-	       idprom->id_ethaddr[4], idprom->id_ethaddr[5]);
+	printk("Ethernet address: %pM\n", idprom->id_ethaddr);
 }
 }

+ 1 - 1
arch/um/drivers/daemon_kern.c

@@ -22,7 +22,7 @@ static void daemon_init(struct net_device *dev, void *data)
 	struct daemon_data *dpri;
 	struct daemon_data *dpri;
 	struct daemon_init *init = data;
 	struct daemon_init *init = data;
 
 
-	pri = dev->priv;
+	pri = netdev_priv(dev);
 	dpri = (struct daemon_data *) pri->user;
 	dpri = (struct daemon_data *) pri->user;
 	dpri->sock_type = init->sock_type;
 	dpri->sock_type = init->sock_type;
 	dpri->ctl_sock = init->ctl_sock;
 	dpri->ctl_sock = init->ctl_sock;

+ 1 - 1
arch/um/drivers/mcast_kern.c

@@ -28,7 +28,7 @@ static void mcast_init(struct net_device *dev, void *data)
 	struct mcast_data *dpri;
 	struct mcast_data *dpri;
 	struct mcast_init *init = data;
 	struct mcast_init *init = data;
 
 
-	pri = dev->priv;
+	pri = netdev_priv(dev);
 	dpri = (struct mcast_data *) pri->user;
 	dpri = (struct mcast_data *) pri->user;
 	dpri->addr = init->addr;
 	dpri->addr = init->addr;
 	dpri->port = init->port;
 	dpri->port = init->port;

+ 12 - 17
arch/um/drivers/net_kern.c

@@ -76,7 +76,7 @@ out:
 
 
 static int uml_net_rx(struct net_device *dev)
 static int uml_net_rx(struct net_device *dev)
 {
 {
-	struct uml_net_private *lp = dev->priv;
+	struct uml_net_private *lp = netdev_priv(dev);
 	int pkt_len;
 	int pkt_len;
 	struct sk_buff *skb;
 	struct sk_buff *skb;
 
 
@@ -119,7 +119,7 @@ static void uml_dev_close(struct work_struct *work)
 static irqreturn_t uml_net_interrupt(int irq, void *dev_id)
 static irqreturn_t uml_net_interrupt(int irq, void *dev_id)
 {
 {
 	struct net_device *dev = dev_id;
 	struct net_device *dev = dev_id;
-	struct uml_net_private *lp = dev->priv;
+	struct uml_net_private *lp = netdev_priv(dev);
 	int err;
 	int err;
 
 
 	if (!netif_running(dev))
 	if (!netif_running(dev))
@@ -150,7 +150,7 @@ out:
 
 
 static int uml_net_open(struct net_device *dev)
 static int uml_net_open(struct net_device *dev)
 {
 {
-	struct uml_net_private *lp = dev->priv;
+	struct uml_net_private *lp = netdev_priv(dev);
 	int err;
 	int err;
 
 
 	if (lp->fd >= 0) {
 	if (lp->fd >= 0) {
@@ -195,7 +195,7 @@ out:
 
 
 static int uml_net_close(struct net_device *dev)
 static int uml_net_close(struct net_device *dev)
 {
 {
-	struct uml_net_private *lp = dev->priv;
+	struct uml_net_private *lp = netdev_priv(dev);
 
 
 	netif_stop_queue(dev);
 	netif_stop_queue(dev);
 
 
@@ -213,7 +213,7 @@ static int uml_net_close(struct net_device *dev)
 
 
 static int uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
 static int uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 {
-	struct uml_net_private *lp = dev->priv;
+	struct uml_net_private *lp = netdev_priv(dev);
 	unsigned long flags;
 	unsigned long flags;
 	int len;
 	int len;
 
 
@@ -250,7 +250,7 @@ static int uml_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
 
 static struct net_device_stats *uml_net_get_stats(struct net_device *dev)
 static struct net_device_stats *uml_net_get_stats(struct net_device *dev)
 {
 {
-	struct uml_net_private *lp = dev->priv;
+	struct uml_net_private *lp = netdev_priv(dev);
 	return &lp->stats;
 	return &lp->stats;
 }
 }
 
 
@@ -267,7 +267,7 @@ static void uml_net_tx_timeout(struct net_device *dev)
 
 
 static int uml_net_set_mac(struct net_device *dev, void *addr)
 static int uml_net_set_mac(struct net_device *dev, void *addr)
 {
 {
-	struct uml_net_private *lp = dev->priv;
+	struct uml_net_private *lp = netdev_priv(dev);
 	struct sockaddr *hwaddr = addr;
 	struct sockaddr *hwaddr = addr;
 
 
 	spin_lock_irq(&lp->lock);
 	spin_lock_irq(&lp->lock);
@@ -368,7 +368,7 @@ static void net_device_release(struct device *dev)
 {
 {
 	struct uml_net *device = dev->driver_data;
 	struct uml_net *device = dev->driver_data;
 	struct net_device *netdev = device->dev;
 	struct net_device *netdev = device->dev;
-	struct uml_net_private *lp = netdev->priv;
+	struct uml_net_private *lp = netdev_priv(netdev);
 
 
 	if (lp->remove != NULL)
 	if (lp->remove != NULL)
 		(*lp->remove)(&lp->user);
 		(*lp->remove)(&lp->user);
@@ -418,14 +418,9 @@ static void eth_configure(int n, void *init, char *mac,
 
 
 	setup_etheraddr(mac, device->mac, dev->name);
 	setup_etheraddr(mac, device->mac, dev->name);
 
 
-	printk(KERN_INFO "Netdevice %d ", n);
-	printk("(%02x:%02x:%02x:%02x:%02x:%02x) ",
-	       device->mac[0], device->mac[1],
-	       device->mac[2], device->mac[3],
-	       device->mac[4], device->mac[5]);
-	printk(": ");
+	printk(KERN_INFO "Netdevice %d (%pM) : ", n, device->mac);
 
 
-	lp = dev->priv;
+	lp = netdev_priv(dev);
 	/* This points to the transport private data. It's still clear, but we
 	/* This points to the transport private data. It's still clear, but we
 	 * must memset it to 0 *now*. Let's help the drivers. */
 	 * must memset it to 0 *now*. Let's help the drivers. */
 	memset(lp, 0, size);
 	memset(lp, 0, size);
@@ -735,7 +730,7 @@ static int net_remove(int n, char **error_out)
 		return -ENODEV;
 		return -ENODEV;
 
 
 	dev = device->dev;
 	dev = device->dev;
-	lp = dev->priv;
+	lp = netdev_priv(dev);
 	if (lp->fd > 0)
 	if (lp->fd > 0)
 		return -EBUSY;
 		return -EBUSY;
 	unregister_netdev(dev);
 	unregister_netdev(dev);
@@ -766,7 +761,7 @@ static int uml_inetaddr_event(struct notifier_block *this, unsigned long event,
 	if (dev->open != uml_net_open)
 	if (dev->open != uml_net_open)
 		return NOTIFY_DONE;
 		return NOTIFY_DONE;
 
 
-	lp = dev->priv;
+	lp = netdev_priv(dev);
 
 
 	proc = NULL;
 	proc = NULL;
 	switch (event) {
 	switch (event) {

+ 1 - 1
arch/um/drivers/pcap_kern.c

@@ -21,7 +21,7 @@ void pcap_init(struct net_device *dev, void *data)
 	struct pcap_data *ppri;
 	struct pcap_data *ppri;
 	struct pcap_init *init = data;
 	struct pcap_init *init = data;
 
 
-	pri = dev->priv;
+	pri = netdev_priv(dev);
 	ppri = (struct pcap_data *) pri->user;
 	ppri = (struct pcap_data *) pri->user;
 	ppri->host_if = init->host_if;
 	ppri->host_if = init->host_if;
 	ppri->promisc = init->promisc;
 	ppri->promisc = init->promisc;

+ 1 - 1
arch/um/drivers/slip_kern.c

@@ -19,7 +19,7 @@ static void slip_init(struct net_device *dev, void *data)
 	struct slip_data *spri;
 	struct slip_data *spri;
 	struct slip_init *init = data;
 	struct slip_init *init = data;
 
 
-	private = dev->priv;
+	private = netdev_priv(dev);
 	spri = (struct slip_data *) private->user;
 	spri = (struct slip_data *) private->user;
 
 
 	memset(spri->name, 0, sizeof(spri->name));
 	memset(spri->name, 0, sizeof(spri->name));

+ 1 - 1
arch/um/drivers/slirp_kern.c

@@ -22,7 +22,7 @@ void slirp_init(struct net_device *dev, void *data)
 	struct slirp_init *init = data;
 	struct slirp_init *init = data;
 	int i;
 	int i;
 
 
-	private = dev->priv;
+	private = netdev_priv(dev);
 	spri = (struct slirp_data *) private->user;
 	spri = (struct slirp_data *) private->user;
 
 
 	spri->argw = init->argw;
 	spri->argw = init->argw;

+ 1 - 1
arch/um/drivers/vde_kern.c

@@ -19,7 +19,7 @@ static void vde_init(struct net_device *dev, void *data)
 	struct uml_net_private *pri;
 	struct uml_net_private *pri;
 	struct vde_data *vpri;
 	struct vde_data *vpri;
 
 
-	pri = dev->priv;
+	pri = netdev_priv(dev);
 	vpri = (struct vde_data *) pri->user;
 	vpri = (struct vde_data *) pri->user;
 
 
 	vpri->vde_switch = init->vde_switch;
 	vpri->vde_switch = init->vde_switch;

+ 1 - 1
arch/um/os-Linux/drivers/ethertap_kern.c

@@ -22,7 +22,7 @@ static void etap_init(struct net_device *dev, void *data)
 	struct ethertap_data *epri;
 	struct ethertap_data *epri;
 	struct ethertap_init *init = data;
 	struct ethertap_init *init = data;
 
 
-	pri = dev->priv;
+	pri = netdev_priv(dev);
 	epri = (struct ethertap_data *) pri->user;
 	epri = (struct ethertap_data *) pri->user;
 	epri->dev_name = init->dev_name;
 	epri->dev_name = init->dev_name;
 	epri->gate_addr = init->gate_addr;
 	epri->gate_addr = init->gate_addr;

+ 1 - 1
arch/um/os-Linux/drivers/tuntap_kern.c

@@ -21,7 +21,7 @@ static void tuntap_init(struct net_device *dev, void *data)
 	struct tuntap_data *tpri;
 	struct tuntap_data *tpri;
 	struct tuntap_init *init = data;
 	struct tuntap_init *init = data;
 
 
-	pri = dev->priv;
+	pri = netdev_priv(dev);
 	tpri = (struct tuntap_data *) pri->user;
 	tpri = (struct tuntap_data *) pri->user;
 	tpri->dev_name = init->dev_name;
 	tpri->dev_name = init->dev_name;
 	tpri->fixed_config = (init->dev_name != NULL);
 	tpri->fixed_config = (init->dev_name != NULL);

+ 9 - 12
arch/xtensa/platforms/iss/network.c

@@ -365,7 +365,7 @@ static int tuntap_probe(struct iss_net_private *lp, int index, char *init)
 
 
 static int iss_net_rx(struct net_device *dev)
 static int iss_net_rx(struct net_device *dev)
 {
 {
-	struct iss_net_private *lp = dev->priv;
+	struct iss_net_private *lp = netdev_priv(dev);
 	int pkt_len;
 	int pkt_len;
 	struct sk_buff *skb;
 	struct sk_buff *skb;
 
 
@@ -456,7 +456,7 @@ static void iss_net_timer(unsigned long priv)
 
 
 static int iss_net_open(struct net_device *dev)
 static int iss_net_open(struct net_device *dev)
 {
 {
-	struct iss_net_private *lp = dev->priv;
+	struct iss_net_private *lp = netdev_priv(dev);
 	char addr[sizeof "255.255.255.255\0"];
 	char addr[sizeof "255.255.255.255\0"];
 	int err;
 	int err;
 
 
@@ -496,7 +496,7 @@ out:
 
 
 static int iss_net_close(struct net_device *dev)
 static int iss_net_close(struct net_device *dev)
 {
 {
-	struct iss_net_private *lp = dev->priv;
+	struct iss_net_private *lp = netdev_priv(dev);
 printk("iss_net_close!\n");
 printk("iss_net_close!\n");
 	netif_stop_queue(dev);
 	netif_stop_queue(dev);
 	spin_lock(&lp->lock);
 	spin_lock(&lp->lock);
@@ -515,7 +515,7 @@ printk("iss_net_close!\n");
 
 
 static int iss_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
 static int iss_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
 {
 {
-	struct iss_net_private *lp = dev->priv;
+	struct iss_net_private *lp = netdev_priv(dev);
 	unsigned long flags;
 	unsigned long flags;
 	int len;
 	int len;
 
 
@@ -551,7 +551,7 @@ static int iss_net_start_xmit(struct sk_buff *skb, struct net_device *dev)
 
 
 static struct net_device_stats *iss_net_get_stats(struct net_device *dev)
 static struct net_device_stats *iss_net_get_stats(struct net_device *dev)
 {
 {
-	struct iss_net_private *lp = dev->priv;
+	struct iss_net_private *lp = netdev_priv(dev);
 	return &lp->stats;
 	return &lp->stats;
 }
 }
 
 
@@ -578,7 +578,7 @@ static void iss_net_tx_timeout(struct net_device *dev)
 static int iss_net_set_mac(struct net_device *dev, void *addr)
 static int iss_net_set_mac(struct net_device *dev, void *addr)
 {
 {
 #if 0
 #if 0
-	struct iss_net_private *lp = dev->priv;
+	struct iss_net_private *lp = netdev_priv(dev);
 	struct sockaddr *hwaddr = addr;
 	struct sockaddr *hwaddr = addr;
 
 
 	spin_lock(&lp->lock);
 	spin_lock(&lp->lock);
@@ -592,7 +592,7 @@ static int iss_net_set_mac(struct net_device *dev, void *addr)
 static int iss_net_change_mtu(struct net_device *dev, int new_mtu)
 static int iss_net_change_mtu(struct net_device *dev, int new_mtu)
 {
 {
 #if 0
 #if 0
-	struct iss_net_private *lp = dev->priv;
+	struct iss_net_private *lp = netdev_priv(dev);
 	int err = 0;
 	int err = 0;
 
 
 	spin_lock(&lp->lock);
 	spin_lock(&lp->lock);
@@ -636,7 +636,7 @@ static int iss_net_configure(int index, char *init)
 
 
 	/* Initialize private element. */
 	/* Initialize private element. */
 
 
-	lp = dev->priv;
+	lp = netdev_priv(dev);
 	*lp = ((struct iss_net_private) {
 	*lp = ((struct iss_net_private) {
 		.device_list		= LIST_HEAD_INIT(lp->device_list),
 		.device_list		= LIST_HEAD_INIT(lp->device_list),
 		.opened_list		= LIST_HEAD_INIT(lp->opened_list),
 		.opened_list		= LIST_HEAD_INIT(lp->opened_list),
@@ -660,10 +660,7 @@ static int iss_net_configure(int index, char *init)
 
 
 	printk(KERN_INFO "Netdevice %d ", index);
 	printk(KERN_INFO "Netdevice %d ", index);
 	if (lp->have_mac)
 	if (lp->have_mac)
-		printk("(%02x:%02x:%02x:%02x:%02x:%02x) ",
-				lp->mac[0], lp->mac[1],
-				lp->mac[2], lp->mac[3],
-				lp->mac[4], lp->mac[5]);
+		printk("(%pM) ", lp->mac);
 	printk(": ");
 	printk(": ");
 
 
 	/* sysfs register */
 	/* sysfs register */

+ 6 - 0
drivers/atm/Kconfig

@@ -391,4 +391,10 @@ config ATM_HE_USE_SUNI
 	  Support for the S/UNI-Ultra and S/UNI-622 found in the ForeRunner
 	  Support for the S/UNI-Ultra and S/UNI-622 found in the ForeRunner
 	  HE cards.  This driver provides carrier detection some statistics.
 	  HE cards.  This driver provides carrier detection some statistics.
 
 
+config ATM_SOLOS
+	tristate "Solos ADSL2+ PCI Multiport card driver"
+	depends on PCI
+	help
+	  Support for the Solos multiport ADSL2+ card.
+
 endif # ATM
 endif # ATM

+ 1 - 0
drivers/atm/Makefile

@@ -12,6 +12,7 @@ obj-$(CONFIG_ATM_IA)		+= iphase.o suni.o
 obj-$(CONFIG_ATM_FORE200E)	+= fore_200e.o
 obj-$(CONFIG_ATM_FORE200E)	+= fore_200e.o
 obj-$(CONFIG_ATM_ENI)		+= eni.o suni.o
 obj-$(CONFIG_ATM_ENI)		+= eni.o suni.o
 obj-$(CONFIG_ATM_IDT77252)	+= idt77252.o
 obj-$(CONFIG_ATM_IDT77252)	+= idt77252.o
+obj-$(CONFIG_ATM_SOLOS)		+= solos-pci.o
 
 
 ifeq ($(CONFIG_ATM_NICSTAR_USE_SUNI),y)
 ifeq ($(CONFIG_ATM_NICSTAR_USE_SUNI),y)
   obj-$(CONFIG_ATM_NICSTAR)	+= suni.o
   obj-$(CONFIG_ATM_NICSTAR)	+= suni.o

+ 790 - 0
drivers/atm/solos-pci.c

@@ -0,0 +1,790 @@
+/*
+ * Driver for the Solos PCI ADSL2+ card, designed to support Linux by
+ *  Traverse Technologies -- http://www.traverse.com.au/
+ *  Xrio Limited          -- http://www.xrio.com/
+ *
+ *
+ * Copyright © 2008 Traverse Technologies
+ * Copyright © 2008 Intel Corporation
+ *
+ * Authors: Nathan Williams <nathan@traverse.com.au>
+ *          David Woodhouse <dwmw2@infradead.org>
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * version 2, as published by the Free Software Foundation.
+ *
+ * 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.
+ */
+
+#define DEBUG
+#define VERBOSE_DEBUG
+
+#include <linux/interrupt.h>
+#include <linux/module.h>
+#include <linux/kernel.h>
+#include <linux/errno.h>
+#include <linux/ioport.h>
+#include <linux/types.h>
+#include <linux/pci.h>
+#include <linux/atm.h>
+#include <linux/atmdev.h>
+#include <linux/skbuff.h>
+#include <linux/sysfs.h>
+#include <linux/device.h>
+#include <linux/kobject.h>
+
+#define VERSION "0.04"
+#define PTAG "solos-pci"
+
+#define CONFIG_RAM_SIZE	128
+#define FLAGS_ADDR	0x7C
+#define IRQ_EN_ADDR	0x78
+#define FPGA_VER	0x74
+#define IRQ_CLEAR	0x70
+#define BUG_FLAG	0x6C
+
+#define DATA_RAM_SIZE	32768
+#define BUF_SIZE	4096
+
+#define RX_BUF(card, nr) ((card->buffers) + (nr)*BUF_SIZE*2)
+#define TX_BUF(card, nr) ((card->buffers) + (nr)*BUF_SIZE*2 + BUF_SIZE)
+
+static int debug = 0;
+static int atmdebug = 0;
+
+struct pkt_hdr {
+	__le16 size;
+	__le16 vpi;
+	__le16 vci;
+	__le16 type;
+};
+
+#define PKT_DATA	0
+#define PKT_COMMAND	1
+#define PKT_POPEN	3
+#define PKT_PCLOSE	4
+
+struct solos_card {
+	void __iomem *config_regs;
+	void __iomem *buffers;
+	int nr_ports;
+	struct pci_dev *dev;
+	struct atm_dev *atmdev[4];
+	struct tasklet_struct tlet;
+	spinlock_t tx_lock;
+	spinlock_t tx_queue_lock;
+	spinlock_t cli_queue_lock;
+	struct sk_buff_head tx_queue[4];
+	struct sk_buff_head cli_queue[4];
+};
+
+#define SOLOS_CHAN(atmdev) ((int)(unsigned long)(atmdev)->phy_data)
+
+MODULE_AUTHOR("Traverse Technologies <support@traverse.com.au>");
+MODULE_DESCRIPTION("Solos PCI driver");
+MODULE_VERSION(VERSION);
+MODULE_LICENSE("GPL");
+MODULE_PARM_DESC(debug, "Enable Loopback");
+MODULE_PARM_DESC(atmdebug, "Print ATM data");
+module_param(debug, int, 0444);
+module_param(atmdebug, int, 0444);
+
+static int opens;
+
+static void fpga_queue(struct solos_card *card, int port, struct sk_buff *skb,
+		       struct atm_vcc *vcc);
+static int fpga_tx(struct solos_card *);
+static irqreturn_t solos_irq(int irq, void *dev_id);
+static struct atm_vcc* find_vcc(struct atm_dev *dev, short vpi, int vci);
+static int list_vccs(int vci);
+static int atm_init(struct solos_card *);
+static void atm_remove(struct solos_card *);
+static int send_command(struct solos_card *card, int dev, const char *buf, size_t size);
+static void solos_bh(unsigned long);
+static int print_buffer(struct sk_buff *buf);
+
+static inline void solos_pop(struct atm_vcc *vcc, struct sk_buff *skb)
+{
+        if (vcc->pop)
+                vcc->pop(vcc, skb);
+        else
+                dev_kfree_skb_any(skb);
+}
+
+static ssize_t console_show(struct device *dev, struct device_attribute *attr,
+			    char *buf)
+{
+	struct atm_dev *atmdev = container_of(dev, struct atm_dev, class_dev);
+	struct solos_card *card = atmdev->dev_data;
+	struct sk_buff *skb;
+
+	spin_lock(&card->cli_queue_lock);
+	skb = skb_dequeue(&card->cli_queue[SOLOS_CHAN(atmdev)]);
+	spin_unlock(&card->cli_queue_lock);
+	if(skb == NULL)
+		return sprintf(buf, "No data.\n");
+
+	memcpy(buf, skb->data, skb->len);
+	dev_dbg(&card->dev->dev, "len: %d\n", skb->len);
+
+	kfree_skb(skb);
+	return skb->len;
+}
+
+static int send_command(struct solos_card *card, int dev, const char *buf, size_t size)
+{
+	struct sk_buff *skb;
+	struct pkt_hdr *header;
+
+//	dev_dbg(&card->dev->dev, "size: %d\n", size);
+
+	if (size > (BUF_SIZE - sizeof(*header))) {
+		dev_dbg(&card->dev->dev, "Command is too big.  Dropping request\n");
+		return 0;
+	}
+	skb = alloc_skb(size + sizeof(*header), GFP_ATOMIC);
+	if (!skb) {
+		dev_warn(&card->dev->dev, "Failed to allocate sk_buff in send_command()\n");
+		return 0;
+	}
+
+	header = (void *)skb_put(skb, sizeof(*header));
+
+	header->size = cpu_to_le16(size);
+	header->vpi = cpu_to_le16(0);
+	header->vci = cpu_to_le16(0);
+	header->type = cpu_to_le16(PKT_COMMAND);
+
+	memcpy(skb_put(skb, size), buf, size);
+
+	fpga_queue(card, dev, skb, NULL);
+
+	return 0;
+}
+
+static ssize_t console_store(struct device *dev, struct device_attribute *attr,
+			     const char *buf, size_t count)
+{
+	struct atm_dev *atmdev = container_of(dev, struct atm_dev, class_dev);
+	struct solos_card *card = atmdev->dev_data;
+	int err;
+
+	err = send_command(card, SOLOS_CHAN(atmdev), buf, count);
+
+	return err?:count;
+}
+
+static DEVICE_ATTR(console, 0644, console_show, console_store);
+
+static irqreturn_t solos_irq(int irq, void *dev_id)
+{
+	struct solos_card *card = dev_id;
+	int handled = 1;
+
+	//ACK IRQ
+	iowrite32(0, card->config_regs + IRQ_CLEAR);
+	//Disable IRQs from FPGA
+	iowrite32(0, card->config_regs + IRQ_EN_ADDR);
+
+	/* If we only do it when the device is open, we lose console
+	   messages */
+	if (1 || opens)
+		tasklet_schedule(&card->tlet);
+
+	//Enable IRQs from FPGA
+	iowrite32(1, card->config_regs + IRQ_EN_ADDR);
+	return IRQ_RETVAL(handled);
+}
+
+void solos_bh(unsigned long card_arg)
+{
+	struct solos_card *card = (void *)card_arg;
+	int port;
+	uint32_t card_flags;
+	uint32_t tx_mask;
+	uint32_t rx_done = 0;
+
+	card_flags = ioread32(card->config_regs + FLAGS_ADDR);
+
+	/* The TX bits are set if the channel is busy; clear if not. We want to
+	   invoke fpga_tx() unless _all_ the bits for active channels are set */
+	tx_mask = (1 << card->nr_ports) - 1;
+	if ((card_flags & tx_mask) != tx_mask)
+		fpga_tx(card);
+
+	for (port = 0; port < card->nr_ports; port++) {
+		if (card_flags & (0x10 << port)) {
+			struct pkt_hdr header;
+			struct sk_buff *skb;
+			struct atm_vcc *vcc;
+			int size;
+
+			rx_done |= 0x10 << port;
+
+			memcpy_fromio(&header, RX_BUF(card, port), sizeof(header));
+
+			size = le16_to_cpu(header.size);
+
+			skb = alloc_skb(size, GFP_ATOMIC);
+			if (!skb) {
+				if (net_ratelimit())
+					dev_warn(&card->dev->dev, "Failed to allocate sk_buff for RX\n");
+				continue;
+			}
+
+			memcpy_fromio(skb_put(skb, size),
+				      RX_BUF(card, port) + sizeof(header),
+				      size);
+
+			if (atmdebug) {
+				dev_info(&card->dev->dev, "Received: device %d\n", port);
+				dev_info(&card->dev->dev, "size: %d VPI: %d VCI: %d\n",
+					 size, le16_to_cpu(header.vpi),
+					 le16_to_cpu(header.vci));
+				print_buffer(skb);
+			}
+
+			switch (le16_to_cpu(header.type)) {
+			case PKT_DATA:
+				vcc = find_vcc(card->atmdev[port], le16_to_cpu(header.vpi),
+					       le16_to_cpu(header.vci));
+				if (!vcc) {
+					if (net_ratelimit())
+						dev_warn(&card->dev->dev, "Received packet for unknown VCI.VPI %d.%d on port %d\n",
+							 le16_to_cpu(header.vci), le16_to_cpu(header.vpi),
+							 port);
+					continue;
+				}
+				atm_charge(vcc, skb->truesize);
+				vcc->push(vcc, skb);
+				atomic_inc(&vcc->stats->rx);
+				break;
+
+			case PKT_COMMAND:
+			default: /* FIXME: Not really, surely? */
+				spin_lock(&card->cli_queue_lock);
+				if (skb_queue_len(&card->cli_queue[port]) > 10) {
+					if (net_ratelimit())
+						dev_warn(&card->dev->dev, "Dropping console response on port %d\n",
+							 port);
+				} else
+					skb_queue_tail(&card->cli_queue[port], skb);
+				spin_unlock(&card->cli_queue_lock);
+				break;
+			}
+		}
+	}
+	if (rx_done)
+		iowrite32(rx_done, card->config_regs + FLAGS_ADDR);
+
+	return;
+}
+
+static struct atm_vcc *find_vcc(struct atm_dev *dev, short vpi, int vci)
+{
+	struct hlist_head *head;
+	struct atm_vcc *vcc = NULL;
+	struct hlist_node *node;
+	struct sock *s;
+
+	read_lock(&vcc_sklist_lock);
+	head = &vcc_hash[vci & (VCC_HTABLE_SIZE -1)];
+	sk_for_each(s, node, head) {
+		vcc = atm_sk(s);
+		if (vcc->dev == dev && vcc->vci == vci &&
+		    vcc->vpi == vpi && vcc->qos.rxtp.traffic_class != ATM_NONE)
+			goto out;
+	}
+	vcc = NULL;
+ out:
+	read_unlock(&vcc_sklist_lock);
+	return vcc;
+}
+
+static int list_vccs(int vci)
+{
+	struct hlist_head *head;
+	struct atm_vcc *vcc;
+	struct hlist_node *node;
+	struct sock *s;
+	int num_found = 0;
+	int i;
+
+	read_lock(&vcc_sklist_lock);
+	if (vci != 0){
+		head = &vcc_hash[vci & (VCC_HTABLE_SIZE -1)];
+		sk_for_each(s, node, head) {
+			num_found ++;
+			vcc = atm_sk(s);
+			printk(KERN_DEBUG "Device: %d Vpi: %d Vci: %d\n",
+			       vcc->dev->number,
+			       vcc->vpi,
+			       vcc->vci);
+		}
+	} else {
+		for(i=0; i<32; i++){
+			head = &vcc_hash[i];
+			sk_for_each(s, node, head) {
+				num_found ++;
+				vcc = atm_sk(s);
+				printk(KERN_DEBUG "Device: %d Vpi: %d Vci: %d\n",
+				       vcc->dev->number,
+				       vcc->vpi,
+				       vcc->vci);
+			}
+		}
+	}
+	read_unlock(&vcc_sklist_lock);
+	return num_found;
+}
+
+
+static int popen(struct atm_vcc *vcc)
+{
+	struct solos_card *card = vcc->dev->dev_data;
+	struct sk_buff *skb;
+	struct pkt_hdr *header;
+
+	skb = alloc_skb(sizeof(*header), GFP_ATOMIC);
+	if (!skb && net_ratelimit()) {
+		dev_warn(&card->dev->dev, "Failed to allocate sk_buff in popen()\n");
+		return -ENOMEM;
+	}
+	header = (void *)skb_put(skb, sizeof(*header));
+
+	header->size = cpu_to_le16(sizeof(*header));
+	header->vpi = cpu_to_le16(vcc->vpi);
+	header->vci = cpu_to_le16(vcc->vci);
+	header->type = cpu_to_le16(PKT_POPEN);
+
+	fpga_queue(card, SOLOS_CHAN(vcc->dev), skb, NULL);
+
+//	dev_dbg(&card->dev->dev, "Open for vpi %d and vci %d on interface %d\n", vcc->vpi, vcc->vci, SOLOS_CHAN(vcc->dev));
+	set_bit(ATM_VF_ADDR, &vcc->flags); // accept the vpi / vci
+	set_bit(ATM_VF_READY, &vcc->flags);
+	list_vccs(0);
+
+	if (!opens)
+		iowrite32(1, card->config_regs + IRQ_EN_ADDR);
+
+	opens++; //count open PVCs
+
+	return 0;
+}
+
+static void pclose(struct atm_vcc *vcc)
+{
+	struct solos_card *card = vcc->dev->dev_data;
+	struct sk_buff *skb;
+	struct pkt_hdr *header;
+
+	skb = alloc_skb(sizeof(*header), GFP_ATOMIC);
+	if (!skb) {
+		dev_warn(&card->dev->dev, "Failed to allocate sk_buff in pclose()\n");
+		return;
+	}
+	header = (void *)skb_put(skb, sizeof(*header));
+
+	header->size = cpu_to_le16(sizeof(*header));
+	header->vpi = cpu_to_le16(vcc->vpi);
+	header->vci = cpu_to_le16(vcc->vci);
+	header->type = cpu_to_le16(PKT_PCLOSE);
+
+	fpga_queue(card, SOLOS_CHAN(vcc->dev), skb, NULL);
+
+//	dev_dbg(&card->dev->dev, "Close for vpi %d and vci %d on interface %d\n", vcc->vpi, vcc->vci, SOLOS_CHAN(vcc->dev));
+	if (!--opens)
+		iowrite32(0, card->config_regs + IRQ_EN_ADDR);
+
+	clear_bit(ATM_VF_ADDR, &vcc->flags);
+	clear_bit(ATM_VF_READY, &vcc->flags);
+
+	return;
+}
+
+static int print_buffer(struct sk_buff *buf)
+{
+	int len,i;
+	char msg[500];
+	char item[10];
+
+	len = buf->len;
+	for (i = 0; i < len; i++){
+		if(i % 8 == 0)
+			sprintf(msg, "%02X: ", i);
+
+		sprintf(item,"%02X ",*(buf->data + i));
+		strcat(msg, item);
+		if(i % 8 == 7) {
+			sprintf(item, "\n");
+			strcat(msg, item);
+			printk(KERN_DEBUG "%s", msg);
+		}
+	}
+	if (i % 8 != 0) {
+		sprintf(item, "\n");
+		strcat(msg, item);
+		printk(KERN_DEBUG "%s", msg);
+	}
+	printk(KERN_DEBUG "\n");
+
+	return 0;
+}
+
+static void fpga_queue(struct solos_card *card, int port, struct sk_buff *skb,
+		       struct atm_vcc *vcc)
+{
+	int old_len;
+
+	*(void **)skb->cb = vcc;
+
+	spin_lock(&card->tx_queue_lock);
+	old_len = skb_queue_len(&card->tx_queue[port]);
+	skb_queue_tail(&card->tx_queue[port], skb);
+	spin_unlock(&card->tx_queue_lock);
+
+	/* If TX might need to be started, do so */
+	if (!old_len)
+		fpga_tx(card);
+}
+
+static int fpga_tx(struct solos_card *card)
+{
+	uint32_t tx_pending;
+	uint32_t tx_started = 0;
+	struct sk_buff *skb;
+	struct atm_vcc *vcc;
+	unsigned char port;
+	unsigned long flags;
+
+	spin_lock_irqsave(&card->tx_lock, flags);
+
+	tx_pending = ioread32(card->config_regs + FLAGS_ADDR);
+
+	dev_vdbg(&card->dev->dev, "TX Flags are %X\n", tx_pending);
+
+	for (port = 0; port < card->nr_ports; port++) {
+		if (!(tx_pending & (1 << port))) {
+
+			spin_lock(&card->tx_queue_lock);
+			skb = skb_dequeue(&card->tx_queue[port]);
+			spin_unlock(&card->tx_queue_lock);
+
+			if (!skb)
+				continue;
+
+			if (atmdebug) {
+				dev_info(&card->dev->dev, "Transmitted: port %d\n",
+					 port);
+				print_buffer(skb);
+			}
+			memcpy_toio(TX_BUF(card, port), skb->data, skb->len);
+
+			vcc = *(void **)skb->cb;
+
+			if (vcc) {
+				atomic_inc(&vcc->stats->tx);
+				solos_pop(vcc, skb);
+			} else
+				dev_kfree_skb_irq(skb);
+
+			tx_started |= 1 << port; //Set TX full flag
+		}
+	}
+	if (tx_started)
+		iowrite32(tx_started, card->config_regs + FLAGS_ADDR);
+
+	spin_unlock_irqrestore(&card->tx_lock, flags);
+	return 0;
+}
+
+static int psend(struct atm_vcc *vcc, struct sk_buff *skb)
+{
+	struct solos_card *card = vcc->dev->dev_data;
+	struct sk_buff *skb2 = NULL;
+	struct pkt_hdr *header;
+
+	//dev_dbg(&card->dev->dev, "psend called.\n");
+	//dev_dbg(&card->dev->dev, "dev,vpi,vci = %d,%d,%d\n",SOLOS_CHAN(vcc->dev),vcc->vpi,vcc->vci);
+
+	if (debug) {
+		skb2 = atm_alloc_charge(vcc, skb->len, GFP_ATOMIC);
+		if (skb2) {
+			memcpy(skb2->data, skb->data, skb->len);
+			skb_put(skb2, skb->len);
+			vcc->push(vcc, skb2);
+			atomic_inc(&vcc->stats->rx);
+		}
+		atomic_inc(&vcc->stats->tx);
+		solos_pop(vcc, skb);
+		return 0;
+	}
+
+	if (skb->len > (BUF_SIZE - sizeof(*header))) {
+		dev_warn(&card->dev->dev, "Length of PDU is too large. Dropping PDU.\n");
+		solos_pop(vcc, skb);
+		return 0;
+	}
+
+	if (!skb_clone_writable(skb, sizeof(*header))) {
+		int expand_by = 0;
+		int ret;
+
+		if (skb_headroom(skb) < sizeof(*header))
+			expand_by = sizeof(*header) - skb_headroom(skb);
+
+		ret = pskb_expand_head(skb, expand_by, 0, GFP_ATOMIC);
+		if (ret) {
+			solos_pop(vcc, skb);
+			return ret;
+		}
+	}
+
+	header = (void *)skb_push(skb, sizeof(*header));
+
+	header->size = cpu_to_le16(skb->len);
+	header->vpi = cpu_to_le16(vcc->vpi);
+	header->vci = cpu_to_le16(vcc->vci);
+	header->type = cpu_to_le16(PKT_DATA);
+
+	fpga_queue(card, SOLOS_CHAN(vcc->dev), skb, vcc);
+
+	return 0;
+}
+
+static struct atmdev_ops fpga_ops = {
+	.open =		popen,
+	.close =	pclose,
+	.ioctl =	NULL,
+	.getsockopt =	NULL,
+	.setsockopt =	NULL,
+	.send =		psend,
+	.send_oam =	NULL,
+	.phy_put =	NULL,
+	.phy_get =	NULL,
+	.change_qos =	NULL,
+	.proc_read =	NULL,
+	.owner =	THIS_MODULE
+};
+
+static int fpga_probe(struct pci_dev *dev, const struct pci_device_id *id)
+{
+	int err, i;
+	uint16_t fpga_ver;
+	uint8_t major_ver, minor_ver;
+	uint32_t data32;
+	struct solos_card *card;
+
+	if (debug)
+		return 0;
+
+	card = kzalloc(sizeof(*card), GFP_KERNEL);
+	if (!card)
+		return -ENOMEM;
+
+	card->dev = dev;
+
+	err = pci_enable_device(dev);
+	if (err) {
+		dev_warn(&dev->dev,  "Failed to enable PCI device\n");
+		goto out;
+	}
+
+	err = pci_request_regions(dev, "solos");
+	if (err) {
+		dev_warn(&dev->dev, "Failed to request regions\n");
+		goto out;
+	}
+
+	card->config_regs = pci_iomap(dev, 0, CONFIG_RAM_SIZE);
+	if (!card->config_regs) {
+		dev_warn(&dev->dev, "Failed to ioremap config registers\n");
+		goto out_release_regions;
+	}
+	card->buffers = pci_iomap(dev, 1, DATA_RAM_SIZE);
+	if (!card->buffers) {
+		dev_warn(&dev->dev, "Failed to ioremap data buffers\n");
+		goto out_unmap_config;
+	}
+
+//	for(i=0;i<64 ;i+=4){
+//		data32=ioread32(card->buffers + i);
+//		dev_dbg(&card->dev->dev, "%08lX\n",(unsigned long)data32);
+//	}
+
+	//Fill Config Mem with zeros
+	for(i = 0; i < 128; i += 4)
+		iowrite32(0, card->config_regs + i);
+
+	//Set RX empty flags
+	iowrite32(0xF0, card->config_regs + FLAGS_ADDR);
+
+	data32 = ioread32(card->config_regs + FPGA_VER);
+	fpga_ver = (data32 & 0x0000FFFF);
+	major_ver = ((data32 & 0xFF000000) >> 24);
+	minor_ver = ((data32 & 0x00FF0000) >> 16);
+	dev_info(&dev->dev, "Solos FPGA Version %d.%02d svn-%d\n",
+		 major_ver, minor_ver, fpga_ver);
+
+	card->nr_ports = 2; /* FIXME: Detect daughterboard */
+
+	err = atm_init(card);
+	if (err)
+		goto out_unmap_both;
+
+	pci_set_drvdata(dev, card);
+	tasklet_init(&card->tlet, solos_bh, (unsigned long)card);
+	spin_lock_init(&card->tx_lock);
+	spin_lock_init(&card->tx_queue_lock);
+	spin_lock_init(&card->cli_queue_lock);
+/*
+	// Set Loopback mode
+	data32 = 0x00010000;
+	iowrite32(data32,card->config_regs + FLAGS_ADDR);
+*/
+/*
+	// Fill Buffers with zeros
+	for (i = 0; i < BUF_SIZE * 8; i += 4)
+		iowrite32(0, card->buffers + i);
+*/
+/*
+	for(i = 0; i < (BUF_SIZE * 1); i += 4)
+		iowrite32(0x12345678, card->buffers + i + (0*BUF_SIZE));
+	for(i = 0; i < (BUF_SIZE * 1); i += 4)
+		iowrite32(0xabcdef98, card->buffers + i + (1*BUF_SIZE));
+
+	// Read Config Memory
+	printk(KERN_DEBUG "Reading Config MEM\n");
+	i = 0;
+	for(i = 0; i < 16; i++) {
+		data32=ioread32(card->buffers + i*(BUF_SIZE/2));
+		printk(KERN_ALERT "Addr: %lX Data: %08lX\n",
+		       (unsigned long)(addr_start + i*(BUF_SIZE/2)),
+		       (unsigned long)data32);
+	}
+*/
+	//dev_dbg(&card->dev->dev, "Requesting IRQ: %d\n",dev->irq);
+	err = request_irq(dev->irq, solos_irq, IRQF_DISABLED|IRQF_SHARED,
+			  "solos-pci", card);
+	if (err)
+		dev_dbg(&card->dev->dev, "Failed to request interrupt IRQ: %d\n", dev->irq);
+
+	// Enable IRQs
+	iowrite32(1, card->config_regs + IRQ_EN_ADDR);
+
+	return 0;
+
+ out_unmap_both:
+	pci_iounmap(dev, card->config_regs);
+ out_unmap_config:
+	pci_iounmap(dev, card->buffers);
+ out_release_regions:
+	pci_release_regions(dev);
+ out:
+	return err;
+}
+
+static int atm_init(struct solos_card *card)
+{
+	int i;
+
+	opens = 0;
+
+	for (i = 0; i < card->nr_ports; i++) {
+		skb_queue_head_init(&card->tx_queue[i]);
+		skb_queue_head_init(&card->cli_queue[i]);
+
+		card->atmdev[i] = atm_dev_register("solos-pci", &fpga_ops, -1, NULL);
+		if (!card->atmdev[i]) {
+			dev_err(&card->dev->dev, "Could not register ATM device %d\n", i);
+			atm_remove(card);
+			return -ENODEV;
+		}
+		if (device_create_file(&card->atmdev[i]->class_dev, &dev_attr_console))
+			dev_err(&card->dev->dev, "Could not register console for ATM device %d\n", i);
+
+		dev_info(&card->dev->dev, "Registered ATM device %d\n", card->atmdev[i]->number);
+
+		card->atmdev[i]->ci_range.vpi_bits = 8;
+		card->atmdev[i]->ci_range.vci_bits = 16;
+		card->atmdev[i]->dev_data = card;
+		card->atmdev[i]->phy_data = (void *)(unsigned long)i;
+	}
+	return 0;
+}
+
+static void atm_remove(struct solos_card *card)
+{
+	int i;
+
+	for (i = 0; i < card->nr_ports; i++) {
+		if (card->atmdev[i]) {
+			dev_info(&card->dev->dev, "Unregistering ATM device %d\n", card->atmdev[i]->number);
+			atm_dev_deregister(card->atmdev[i]);
+		}
+	}
+}
+
+static void fpga_remove(struct pci_dev *dev)
+{
+	struct solos_card *card = pci_get_drvdata(dev);
+
+	if (debug)
+		return;
+
+	atm_remove(card);
+
+	dev_vdbg(&dev->dev, "Freeing IRQ\n");
+	// Disable IRQs from FPGA
+	iowrite32(0, card->config_regs + IRQ_EN_ADDR);
+	free_irq(dev->irq, card);
+	tasklet_kill(&card->tlet);
+
+	//	iowrite32(0x01,pciregs);
+	dev_vdbg(&dev->dev, "Unmapping PCI resource\n");
+	pci_iounmap(dev, card->buffers);
+	pci_iounmap(dev, card->config_regs);
+
+	dev_vdbg(&dev->dev, "Releasing PCI Region\n");
+	pci_release_regions(dev);
+	pci_disable_device(dev);
+
+	pci_set_drvdata(dev, NULL);
+	kfree(card);
+//	dev_dbg(&card->dev->dev, "fpga_remove\n");
+	return;
+}
+
+static struct pci_device_id fpga_pci_tbl[] __devinitdata = {
+	{ 0x10ee, 0x0300, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0 },
+	{ 0, }
+};
+
+MODULE_DEVICE_TABLE(pci,fpga_pci_tbl);
+
+static struct pci_driver fpga_driver = {
+	.name =		"solos",
+	.id_table =	fpga_pci_tbl,
+	.probe =	fpga_probe,
+	.remove =	fpga_remove,
+};
+
+
+static int __init solos_pci_init(void)
+{
+	printk(KERN_INFO "Solos PCI Driver Version %s\n", VERSION);
+	return pci_register_driver(&fpga_driver);
+}
+
+static void __exit solos_pci_exit(void)
+{
+	pci_unregister_driver(&fpga_driver);
+	printk(KERN_INFO "Solos PCI Driver %s Unloaded\n", VERSION);
+}
+
+module_init(solos_pci_init);
+module_exit(solos_pci_exit);

+ 0 - 1
drivers/block/aoe/aoe.h

@@ -200,4 +200,3 @@ void aoenet_xmit(struct sk_buff_head *);
 int is_aoe_netif(struct net_device *ifp);
 int is_aoe_netif(struct net_device *ifp);
 int set_aoe_iflist(const char __user *str, size_t size);
 int set_aoe_iflist(const char __user *str, size_t size);
 
 
-unsigned long long mac_addr(char addr[6]);

+ 1 - 1
drivers/block/aoe/aoeblk.c

@@ -37,7 +37,7 @@ static ssize_t aoedisk_show_mac(struct device *dev,
 
 
 	if (t == NULL)
 	if (t == NULL)
 		return snprintf(page, PAGE_SIZE, "none\n");
 		return snprintf(page, PAGE_SIZE, "none\n");
-	return snprintf(page, PAGE_SIZE, "%012llx\n", mac_addr(t->addr));
+	return snprintf(page, PAGE_SIZE, "%pm\n", t->addr);
 }
 }
 static ssize_t aoedisk_show_netif(struct device *dev,
 static ssize_t aoedisk_show_netif(struct device *dev,
 				  struct device_attribute *attr, char *page)
 				  struct device_attribute *attr, char *page)

+ 10 - 12
drivers/block/aoe/aoecmd.c

@@ -349,11 +349,9 @@ resend(struct aoedev *d, struct aoetgt *t, struct frame *f)
 	ah = (struct aoe_atahdr *) (h+1);
 	ah = (struct aoe_atahdr *) (h+1);
 
 
 	snprintf(buf, sizeof buf,
 	snprintf(buf, sizeof buf,
-		"%15s e%ld.%d oldtag=%08x@%08lx newtag=%08x "
-		"s=%012llx d=%012llx nout=%d\n",
+		"%15s e%ld.%d oldtag=%08x@%08lx newtag=%08x s=%pm d=%pm nout=%d\n",
 		"retransmit", d->aoemajor, d->aoeminor, f->tag, jiffies, n,
 		"retransmit", d->aoemajor, d->aoeminor, f->tag, jiffies, n,
-		mac_addr(h->src),
-		mac_addr(h->dst), t->nout);
+		h->src, h->dst, t->nout);
 	aoechr_error(buf);
 	aoechr_error(buf);
 
 
 	f->tag = n;
 	f->tag = n;
@@ -544,10 +542,10 @@ rexmit_timer(ulong vp)
 				printk(KERN_INFO
 				printk(KERN_INFO
 					"aoe: e%ld.%d: "
 					"aoe: e%ld.%d: "
 					"too many lost jumbo on "
 					"too many lost jumbo on "
-					"%s:%012llx - "
+					"%s:%pm - "
 					"falling back to %d frames.\n",
 					"falling back to %d frames.\n",
 					d->aoemajor, d->aoeminor,
 					d->aoemajor, d->aoeminor,
-					ifp->nd->name, mac_addr(t->addr),
+					ifp->nd->name, t->addr,
 					DEFAULTBCNT);
 					DEFAULTBCNT);
 				ifp->maxbcnt = 0;
 				ifp->maxbcnt = 0;
 			}
 			}
@@ -672,8 +670,8 @@ ataid_complete(struct aoedev *d, struct aoetgt *t, unsigned char *id)
 
 
 	if (d->ssize != ssize)
 	if (d->ssize != ssize)
 		printk(KERN_INFO
 		printk(KERN_INFO
-			"aoe: %012llx e%ld.%d v%04x has %llu sectors\n",
-			mac_addr(t->addr),
+			"aoe: %pm e%ld.%d v%04x has %llu sectors\n",
+			t->addr,
 			d->aoemajor, d->aoeminor,
 			d->aoemajor, d->aoeminor,
 			d->fw_ver, (long long)ssize);
 			d->fw_ver, (long long)ssize);
 	d->ssize = ssize;
 	d->ssize = ssize;
@@ -775,8 +773,8 @@ aoecmd_ata_rsp(struct sk_buff *skb)
 	n = get_unaligned_be32(&hin->tag);
 	n = get_unaligned_be32(&hin->tag);
 	t = gettgt(d, hin->src);
 	t = gettgt(d, hin->src);
 	if (t == NULL) {
 	if (t == NULL) {
-		printk(KERN_INFO "aoe: can't find target e%ld.%d:%012llx\n",
-			d->aoemajor, d->aoeminor, mac_addr(hin->src));
+		printk(KERN_INFO "aoe: can't find target e%ld.%d:%pm\n",
+			d->aoemajor, d->aoeminor, hin->src);
 		spin_unlock_irqrestore(&d->lock, flags);
 		spin_unlock_irqrestore(&d->lock, flags);
 		return;
 		return;
 	}
 	}
@@ -1036,10 +1034,10 @@ aoecmd_cfg_rsp(struct sk_buff *skb)
 		n = n ? n * 512 : DEFAULTBCNT;
 		n = n ? n * 512 : DEFAULTBCNT;
 		if (n != ifp->maxbcnt) {
 		if (n != ifp->maxbcnt) {
 			printk(KERN_INFO
 			printk(KERN_INFO
-				"aoe: e%ld.%d: setting %d%s%s:%012llx\n",
+				"aoe: e%ld.%d: setting %d%s%s:%pm\n",
 				d->aoemajor, d->aoeminor, n,
 				d->aoemajor, d->aoeminor, n,
 				" byte data frames on ", ifp->nd->name,
 				" byte data frames on ", ifp->nd->name,
-				mac_addr(t->addr));
+				t->addr);
 			ifp->maxbcnt = n;
 			ifp->maxbcnt = n;
 		}
 		}
 	}
 	}

+ 0 - 11
drivers/block/aoe/aoenet.c

@@ -83,17 +83,6 @@ set_aoe_iflist(const char __user *user_str, size_t size)
 	return 0;
 	return 0;
 }
 }
 
 
-unsigned long long
-mac_addr(char addr[6])
-{
-	__be64 n = 0;
-	char *p = (char *) &n;
-
-	memcpy(p + 2, addr, 6);	/* (sizeof addr != 6) */
-
-	return (unsigned long long) __be64_to_cpu(n);
-}
-
 void
 void
 aoenet_xmit(struct sk_buff_head *queue)
 aoenet_xmit(struct sk_buff_head *queue)
 {
 {

+ 0 - 20
drivers/bluetooth/Kconfig

@@ -2,26 +2,6 @@
 menu "Bluetooth device drivers"
 menu "Bluetooth device drivers"
 	depends on BT
 	depends on BT
 
 
-config BT_HCIUSB
-	tristate "HCI USB driver (old version)"
-	depends on USB && BT_HCIBTUSB=n
-	help
-	  Bluetooth HCI USB driver.
-	  This driver is required if you want to use Bluetooth devices with
-	  USB interface.
-
-	  Say Y here to compile support for Bluetooth USB devices into the
-	  kernel or say M to compile it as module (hci_usb).
-
-config BT_HCIUSB_SCO
-	bool "SCO (voice) support"
-	depends on BT_HCIUSB
-	help
-	  This option enables the SCO support in the HCI USB driver. You need this
-	  to transmit voice data with your Bluetooth USB device.
-
-	  Say Y here to compile support for SCO over HCI USB.
-
 config BT_HCIBTUSB
 config BT_HCIBTUSB
 	tristate "HCI USB driver"
 	tristate "HCI USB driver"
 	depends on USB
 	depends on USB

+ 0 - 1
drivers/bluetooth/Makefile

@@ -2,7 +2,6 @@
 # Makefile for the Linux Bluetooth HCI device drivers.
 # Makefile for the Linux Bluetooth HCI device drivers.
 #
 #
 
 
-obj-$(CONFIG_BT_HCIUSB)		+= hci_usb.o
 obj-$(CONFIG_BT_HCIVHCI)	+= hci_vhci.o
 obj-$(CONFIG_BT_HCIVHCI)	+= hci_vhci.o
 obj-$(CONFIG_BT_HCIUART)	+= hci_uart.o
 obj-$(CONFIG_BT_HCIUART)	+= hci_uart.o
 obj-$(CONFIG_BT_HCIBCM203X)	+= bcm203x.o
 obj-$(CONFIG_BT_HCIBCM203X)	+= bcm203x.o

+ 2 - 7
drivers/bluetooth/bcm203x.c

@@ -37,11 +37,6 @@
 
 
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/bluetooth.h>
 
 
-#ifndef CONFIG_BT_HCIBCM203X_DEBUG
-#undef  BT_DBG
-#define BT_DBG(D...)
-#endif
-
 #define VERSION "1.2"
 #define VERSION "1.2"
 
 
 static struct usb_device_id bcm203x_table[] = {
 static struct usb_device_id bcm203x_table[] = {
@@ -199,7 +194,7 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id
 		return -EIO;
 		return -EIO;
 	}
 	}
 
 
-	BT_DBG("minidrv data %p size %d", firmware->data, firmware->size);
+	BT_DBG("minidrv data %p size %zu", firmware->data, firmware->size);
 
 
 	size = max_t(uint, firmware->size, 4096);
 	size = max_t(uint, firmware->size, 4096);
 
 
@@ -227,7 +222,7 @@ static int bcm203x_probe(struct usb_interface *intf, const struct usb_device_id
 		return -EIO;
 		return -EIO;
 	}
 	}
 
 
-	BT_DBG("firmware data %p size %d", firmware->data, firmware->size);
+	BT_DBG("firmware data %p size %zu", firmware->data, firmware->size);
 
 
 	data->fw_data = kmalloc(firmware->size, GFP_KERNEL);
 	data->fw_data = kmalloc(firmware->size, GFP_KERNEL);
 	if (!data->fw_data) {
 	if (!data->fw_data) {

+ 3 - 8
drivers/bluetooth/bfusb.c

@@ -38,11 +38,6 @@
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
 #include <net/bluetooth/hci_core.h>
 
 
-#ifndef CONFIG_BT_HCIBFUSB_DEBUG
-#undef  BT_DBG
-#define BT_DBG(D...)
-#endif
-
 #define VERSION "1.2"
 #define VERSION "1.2"
 
 
 static struct usb_driver bfusb_driver;
 static struct usb_driver bfusb_driver;
@@ -221,7 +216,7 @@ static int bfusb_rx_submit(struct bfusb_data *data, struct urb *urb)
 	struct sk_buff *skb;
 	struct sk_buff *skb;
 	int err, pipe, size = HCI_MAX_FRAME_SIZE + 32;
 	int err, pipe, size = HCI_MAX_FRAME_SIZE + 32;
 
 
-	BT_DBG("bfusb %p urb %p", bfusb, urb);
+	BT_DBG("bfusb %p urb %p", data, urb);
 
 
 	if (!urb && !(urb = usb_alloc_urb(0, GFP_ATOMIC)))
 	if (!urb && !(urb = usb_alloc_urb(0, GFP_ATOMIC)))
 		return -ENOMEM;
 		return -ENOMEM;
@@ -354,7 +349,7 @@ static void bfusb_rx_complete(struct urb *urb)
 	int count = urb->actual_length;
 	int count = urb->actual_length;
 	int err, hdr, len;
 	int err, hdr, len;
 
 
-	BT_DBG("bfusb %p urb %p skb %p len %d", bfusb, urb, skb, skb->len);
+	BT_DBG("bfusb %p urb %p skb %p len %d", data, urb, skb, skb->len);
 
 
 	read_lock(&data->lock);
 	read_lock(&data->lock);
 
 
@@ -691,7 +686,7 @@ static int bfusb_probe(struct usb_interface *intf, const struct usb_device_id *i
 		goto error;
 		goto error;
 	}
 	}
 
 
-	BT_DBG("firmware data %p size %d", firmware->data, firmware->size);
+	BT_DBG("firmware data %p size %zu", firmware->data, firmware->size);
 
 
 	if (bfusb_load_firmware(data, firmware->data, firmware->size) < 0) {
 	if (bfusb_load_firmware(data, firmware->data, firmware->size) < 0) {
 		BT_ERR("Firmware loading failed");
 		BT_ERR("Firmware loading failed");

+ 2 - 5
drivers/bluetooth/bpa10x.c

@@ -35,11 +35,6 @@
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
 #include <net/bluetooth/hci_core.h>
 
 
-#ifndef CONFIG_BT_HCIBPA10X_DEBUG
-#undef  BT_DBG
-#define BT_DBG(D...)
-#endif
-
 #define VERSION "0.10"
 #define VERSION "0.10"
 
 
 static struct usb_device_id bpa10x_table[] = {
 static struct usb_device_id bpa10x_table[] = {
@@ -489,6 +484,8 @@ static int bpa10x_probe(struct usb_interface *intf, const struct usb_device_id *
 
 
 	hdev->owner = THIS_MODULE;
 	hdev->owner = THIS_MODULE;
 
 
+	set_bit(HCI_QUIRK_NO_RESET, &hdev->quirks);
+
 	err = hci_register_dev(hdev);
 	err = hci_register_dev(hdev);
 	if (err < 0) {
 	if (err < 0) {
 		hci_free_dev(hdev);
 		hci_free_dev(hdev);

+ 4 - 4
drivers/bluetooth/bt3c_cs.c

@@ -502,15 +502,15 @@ static int bt3c_load_firmware(bt3c_info_t *info, const unsigned char *firmware,
 
 
 		memset(b, 0, sizeof(b));
 		memset(b, 0, sizeof(b));
 		memcpy(b, ptr + 2, 2);
 		memcpy(b, ptr + 2, 2);
-		size = simple_strtol(b, NULL, 16);
+		size = simple_strtoul(b, NULL, 16);
 
 
 		memset(b, 0, sizeof(b));
 		memset(b, 0, sizeof(b));
 		memcpy(b, ptr + 4, 8);
 		memcpy(b, ptr + 4, 8);
-		addr = simple_strtol(b, NULL, 16);
+		addr = simple_strtoul(b, NULL, 16);
 
 
 		memset(b, 0, sizeof(b));
 		memset(b, 0, sizeof(b));
 		memcpy(b, ptr + (size * 2) + 2, 2);
 		memcpy(b, ptr + (size * 2) + 2, 2);
-		fcs = simple_strtol(b, NULL, 16);
+		fcs = simple_strtoul(b, NULL, 16);
 
 
 		memset(b, 0, sizeof(b));
 		memset(b, 0, sizeof(b));
 		for (tmp = 0, i = 0; i < size; i++) {
 		for (tmp = 0, i = 0; i < size; i++) {
@@ -530,7 +530,7 @@ static int bt3c_load_firmware(bt3c_info_t *info, const unsigned char *firmware,
 			memset(b, 0, sizeof(b));
 			memset(b, 0, sizeof(b));
 			for (i = 0; i < (size - 4) / 2; i++) {
 			for (i = 0; i < (size - 4) / 2; i++) {
 				memcpy(b, ptr + (i * 4) + 12, 4);
 				memcpy(b, ptr + (i * 4) + 12, 4);
-				tmp = simple_strtol(b, NULL, 16);
+				tmp = simple_strtoul(b, NULL, 16);
 				bt3c_put(iobase, tmp);
 				bt3c_put(iobase, tmp);
 			}
 			}
 		}
 		}

+ 1 - 5
drivers/bluetooth/btsdio.c

@@ -37,11 +37,6 @@
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
 #include <net/bluetooth/hci_core.h>
 
 
-#ifndef CONFIG_BT_HCIBTSDIO_DEBUG
-#undef  BT_DBG
-#define BT_DBG(D...)
-#endif
-
 #define VERSION "0.1"
 #define VERSION "0.1"
 
 
 static const struct sdio_device_id btsdio_table[] = {
 static const struct sdio_device_id btsdio_table[] = {
@@ -91,6 +86,7 @@ static int btsdio_tx_packet(struct btsdio_data *data, struct sk_buff *skb)
 
 
 	err = sdio_writesb(data->func, REG_TDAT, skb->data, skb->len);
 	err = sdio_writesb(data->func, REG_TDAT, skb->data, skb->len);
 	if (err < 0) {
 	if (err < 0) {
+		skb_pull(skb, 4);
 		sdio_writeb(data->func, 0x01, REG_PC_WRT, NULL);
 		sdio_writeb(data->func, 0x01, REG_PC_WRT, NULL);
 		return err;
 		return err;
 	}
 	}

+ 140 - 89
drivers/bluetooth/btusb.c

@@ -35,31 +35,25 @@
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
 #include <net/bluetooth/hci_core.h>
 
 
-//#define CONFIG_BT_HCIBTUSB_DEBUG
-#ifndef CONFIG_BT_HCIBTUSB_DEBUG
-#undef  BT_DBG
-#define BT_DBG(D...)
-#endif
-
-#define VERSION "0.3"
+#define VERSION "0.4"
 
 
 static int ignore_dga;
 static int ignore_dga;
 static int ignore_csr;
 static int ignore_csr;
 static int ignore_sniffer;
 static int ignore_sniffer;
 static int disable_scofix;
 static int disable_scofix;
 static int force_scofix;
 static int force_scofix;
-static int reset;
+
+static int reset = 1;
 
 
 static struct usb_driver btusb_driver;
 static struct usb_driver btusb_driver;
 
 
 #define BTUSB_IGNORE		0x01
 #define BTUSB_IGNORE		0x01
-#define BTUSB_RESET		0x02
-#define BTUSB_DIGIANSWER	0x04
-#define BTUSB_CSR		0x08
-#define BTUSB_SNIFFER		0x10
-#define BTUSB_BCM92035		0x20
-#define BTUSB_BROKEN_ISOC	0x40
-#define BTUSB_WRONG_SCO_MTU	0x80
+#define BTUSB_DIGIANSWER	0x02
+#define BTUSB_CSR		0x04
+#define BTUSB_SNIFFER		0x08
+#define BTUSB_BCM92035		0x10
+#define BTUSB_BROKEN_ISOC	0x20
+#define BTUSB_WRONG_SCO_MTU	0x40
 
 
 static struct usb_device_id btusb_table[] = {
 static struct usb_device_id btusb_table[] = {
 	/* Generic Bluetooth USB device */
 	/* Generic Bluetooth USB device */
@@ -79,7 +73,7 @@ static struct usb_device_id btusb_table[] = {
 	{ USB_DEVICE(0x0bdb, 0x1002) },
 	{ USB_DEVICE(0x0bdb, 0x1002) },
 
 
 	/* Canyon CN-BTU1 with HID interfaces */
 	/* Canyon CN-BTU1 with HID interfaces */
-	{ USB_DEVICE(0x0c10, 0x0000), .driver_info = BTUSB_RESET },
+	{ USB_DEVICE(0x0c10, 0x0000) },
 
 
 	{ }	/* Terminating entry */
 	{ }	/* Terminating entry */
 };
 };
@@ -94,52 +88,37 @@ static struct usb_device_id blacklist_table[] = {
 	{ USB_DEVICE(0x0a5c, 0x2033), .driver_info = BTUSB_IGNORE },
 	{ USB_DEVICE(0x0a5c, 0x2033), .driver_info = BTUSB_IGNORE },
 
 
 	/* Broadcom BCM2035 */
 	/* Broadcom BCM2035 */
-	{ USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
-	{ USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
+	{ USB_DEVICE(0x0a5c, 0x2035), .driver_info = BTUSB_WRONG_SCO_MTU },
+	{ USB_DEVICE(0x0a5c, 0x200a), .driver_info = BTUSB_WRONG_SCO_MTU },
+	{ USB_DEVICE(0x0a5c, 0x2009), .driver_info = BTUSB_BCM92035 },
 
 
 	/* Broadcom BCM2045 */
 	/* Broadcom BCM2045 */
-	{ USB_DEVICE(0x0a5c, 0x2039), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
-	{ USB_DEVICE(0x0a5c, 0x2101), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
-
-	/* Broadcom BCM2046 */
-	{ USB_DEVICE(0x0a5c, 0x2146), .driver_info = BTUSB_RESET },
-	{ USB_DEVICE(0x0a5c, 0x2151), .driver_info = BTUSB_RESET },
-
-	/* Apple MacBook Pro with Broadcom chip */
-	{ USB_DEVICE(0x05ac, 0x820f), .driver_info = BTUSB_RESET },
+	{ USB_DEVICE(0x0a5c, 0x2039), .driver_info = BTUSB_WRONG_SCO_MTU },
+	{ USB_DEVICE(0x0a5c, 0x2101), .driver_info = BTUSB_WRONG_SCO_MTU },
 
 
 	/* IBM/Lenovo ThinkPad with Broadcom chip */
 	/* IBM/Lenovo ThinkPad with Broadcom chip */
-	{ USB_DEVICE(0x0a5c, 0x201e), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
-	{ USB_DEVICE(0x0a5c, 0x2110), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
-
-	/* Targus ACB10US */
-	{ USB_DEVICE(0x0a5c, 0x2100), .driver_info = BTUSB_RESET },
-	{ USB_DEVICE(0x0a5c, 0x2154), .driver_info = BTUSB_RESET },
-
-	/* ANYCOM Bluetooth USB-200 and USB-250 */
-	{ USB_DEVICE(0x0a5c, 0x2111), .driver_info = BTUSB_RESET },
+	{ USB_DEVICE(0x0a5c, 0x201e), .driver_info = BTUSB_WRONG_SCO_MTU },
+	{ USB_DEVICE(0x0a5c, 0x2110), .driver_info = BTUSB_WRONG_SCO_MTU },
 
 
 	/* HP laptop with Broadcom chip */
 	/* HP laptop with Broadcom chip */
-	{ USB_DEVICE(0x03f0, 0x171d), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
+	{ USB_DEVICE(0x03f0, 0x171d), .driver_info = BTUSB_WRONG_SCO_MTU },
 
 
 	/* Dell laptop with Broadcom chip */
 	/* Dell laptop with Broadcom chip */
-	{ USB_DEVICE(0x413c, 0x8126), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
+	{ USB_DEVICE(0x413c, 0x8126), .driver_info = BTUSB_WRONG_SCO_MTU },
 
 
-	/* Dell Wireless 370 */
-	{ USB_DEVICE(0x413c, 0x8156), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
+	/* Dell Wireless 370 and 410 devices */
+	{ USB_DEVICE(0x413c, 0x8152), .driver_info = BTUSB_WRONG_SCO_MTU },
+	{ USB_DEVICE(0x413c, 0x8156), .driver_info = BTUSB_WRONG_SCO_MTU },
 
 
-	/* Dell Wireless 410 */
-	{ USB_DEVICE(0x413c, 0x8152), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
+	/* Belkin F8T012 and F8T013 devices */
+	{ USB_DEVICE(0x050d, 0x0012), .driver_info = BTUSB_WRONG_SCO_MTU },
+	{ USB_DEVICE(0x050d, 0x0013), .driver_info = BTUSB_WRONG_SCO_MTU },
 
 
-	/* Microsoft Wireless Transceiver for Bluetooth 2.0 */
-	{ USB_DEVICE(0x045e, 0x009c), .driver_info = BTUSB_RESET },
+	/* Asus WL-BTD202 device */
+	{ USB_DEVICE(0x0b05, 0x1715), .driver_info = BTUSB_WRONG_SCO_MTU },
 
 
 	/* Kensington Bluetooth USB adapter */
 	/* Kensington Bluetooth USB adapter */
-	{ USB_DEVICE(0x047d, 0x105d), .driver_info = BTUSB_RESET },
-	{ USB_DEVICE(0x047d, 0x105e), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
-
-	/* ISSC Bluetooth Adapter v3.1 */
-	{ USB_DEVICE(0x1131, 0x1001), .driver_info = BTUSB_RESET },
+	{ USB_DEVICE(0x047d, 0x105e), .driver_info = BTUSB_WRONG_SCO_MTU },
 
 
 	/* RTX Telecom based adapters with buggy SCO support */
 	/* RTX Telecom based adapters with buggy SCO support */
 	{ USB_DEVICE(0x0400, 0x0807), .driver_info = BTUSB_BROKEN_ISOC },
 	{ USB_DEVICE(0x0400, 0x0807), .driver_info = BTUSB_BROKEN_ISOC },
@@ -148,13 +127,6 @@ static struct usb_device_id blacklist_table[] = {
 	/* CONWISE Technology based adapters with buggy SCO support */
 	/* CONWISE Technology based adapters with buggy SCO support */
 	{ USB_DEVICE(0x0e5e, 0x6622), .driver_info = BTUSB_BROKEN_ISOC },
 	{ USB_DEVICE(0x0e5e, 0x6622), .driver_info = BTUSB_BROKEN_ISOC },
 
 
-	/* Belkin F8T012 and F8T013 devices */
-	{ USB_DEVICE(0x050d, 0x0012), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
-	{ USB_DEVICE(0x050d, 0x0013), .driver_info = BTUSB_RESET | BTUSB_WRONG_SCO_MTU },
-
-	/* Belkin F8T016 device */
-	{ USB_DEVICE(0x050d, 0x016a), .driver_info = BTUSB_RESET },
-
 	/* Digianswer devices */
 	/* Digianswer devices */
 	{ USB_DEVICE(0x08fd, 0x0001), .driver_info = BTUSB_DIGIANSWER },
 	{ USB_DEVICE(0x08fd, 0x0001), .driver_info = BTUSB_DIGIANSWER },
 	{ USB_DEVICE(0x08fd, 0x0002), .driver_info = BTUSB_IGNORE },
 	{ USB_DEVICE(0x08fd, 0x0002), .driver_info = BTUSB_IGNORE },
@@ -197,7 +169,10 @@ struct btusb_data {
 	struct usb_endpoint_descriptor *isoc_tx_ep;
 	struct usb_endpoint_descriptor *isoc_tx_ep;
 	struct usb_endpoint_descriptor *isoc_rx_ep;
 	struct usb_endpoint_descriptor *isoc_rx_ep;
 
 
+	__u8 cmdreq_type;
+
 	int isoc_altsetting;
 	int isoc_altsetting;
+	int suspend_count;
 };
 };
 
 
 static void btusb_intr_complete(struct urb *urb)
 static void btusb_intr_complete(struct urb *urb)
@@ -236,7 +211,7 @@ static void btusb_intr_complete(struct urb *urb)
 	}
 	}
 }
 }
 
 
-static int btusb_submit_intr_urb(struct hci_dev *hdev)
+static int btusb_submit_intr_urb(struct hci_dev *hdev, gfp_t mem_flags)
 {
 {
 	struct btusb_data *data = hdev->driver_data;
 	struct btusb_data *data = hdev->driver_data;
 	struct urb *urb;
 	struct urb *urb;
@@ -249,13 +224,13 @@ static int btusb_submit_intr_urb(struct hci_dev *hdev)
 	if (!data->intr_ep)
 	if (!data->intr_ep)
 		return -ENODEV;
 		return -ENODEV;
 
 
-	urb = usb_alloc_urb(0, GFP_ATOMIC);
+	urb = usb_alloc_urb(0, mem_flags);
 	if (!urb)
 	if (!urb)
 		return -ENOMEM;
 		return -ENOMEM;
 
 
 	size = le16_to_cpu(data->intr_ep->wMaxPacketSize);
 	size = le16_to_cpu(data->intr_ep->wMaxPacketSize);
 
 
-	buf = kmalloc(size, GFP_ATOMIC);
+	buf = kmalloc(size, mem_flags);
 	if (!buf) {
 	if (!buf) {
 		usb_free_urb(urb);
 		usb_free_urb(urb);
 		return -ENOMEM;
 		return -ENOMEM;
@@ -271,7 +246,7 @@ static int btusb_submit_intr_urb(struct hci_dev *hdev)
 
 
 	usb_anchor_urb(urb, &data->intr_anchor);
 	usb_anchor_urb(urb, &data->intr_anchor);
 
 
-	err = usb_submit_urb(urb, GFP_ATOMIC);
+	err = usb_submit_urb(urb, mem_flags);
 	if (err < 0) {
 	if (err < 0) {
 		BT_ERR("%s urb %p submission failed (%d)",
 		BT_ERR("%s urb %p submission failed (%d)",
 						hdev->name, urb, -err);
 						hdev->name, urb, -err);
@@ -319,7 +294,7 @@ static void btusb_bulk_complete(struct urb *urb)
 	}
 	}
 }
 }
 
 
-static int btusb_submit_bulk_urb(struct hci_dev *hdev)
+static int btusb_submit_bulk_urb(struct hci_dev *hdev, gfp_t mem_flags)
 {
 {
 	struct btusb_data *data = hdev->driver_data;
 	struct btusb_data *data = hdev->driver_data;
 	struct urb *urb;
 	struct urb *urb;
@@ -332,13 +307,13 @@ static int btusb_submit_bulk_urb(struct hci_dev *hdev)
 	if (!data->bulk_rx_ep)
 	if (!data->bulk_rx_ep)
 		return -ENODEV;
 		return -ENODEV;
 
 
-	urb = usb_alloc_urb(0, GFP_KERNEL);
+	urb = usb_alloc_urb(0, mem_flags);
 	if (!urb)
 	if (!urb)
 		return -ENOMEM;
 		return -ENOMEM;
 
 
 	size = le16_to_cpu(data->bulk_rx_ep->wMaxPacketSize);
 	size = le16_to_cpu(data->bulk_rx_ep->wMaxPacketSize);
 
 
-	buf = kmalloc(size, GFP_KERNEL);
+	buf = kmalloc(size, mem_flags);
 	if (!buf) {
 	if (!buf) {
 		usb_free_urb(urb);
 		usb_free_urb(urb);
 		return -ENOMEM;
 		return -ENOMEM;
@@ -353,7 +328,7 @@ static int btusb_submit_bulk_urb(struct hci_dev *hdev)
 
 
 	usb_anchor_urb(urb, &data->bulk_anchor);
 	usb_anchor_urb(urb, &data->bulk_anchor);
 
 
-	err = usb_submit_urb(urb, GFP_KERNEL);
+	err = usb_submit_urb(urb, mem_flags);
 	if (err < 0) {
 	if (err < 0) {
 		BT_ERR("%s urb %p submission failed (%d)",
 		BT_ERR("%s urb %p submission failed (%d)",
 						hdev->name, urb, -err);
 						hdev->name, urb, -err);
@@ -430,7 +405,7 @@ static void inline __fill_isoc_descriptor(struct urb *urb, int len, int mtu)
 	urb->number_of_packets = i;
 	urb->number_of_packets = i;
 }
 }
 
 
-static int btusb_submit_isoc_urb(struct hci_dev *hdev)
+static int btusb_submit_isoc_urb(struct hci_dev *hdev, gfp_t mem_flags)
 {
 {
 	struct btusb_data *data = hdev->driver_data;
 	struct btusb_data *data = hdev->driver_data;
 	struct urb *urb;
 	struct urb *urb;
@@ -443,14 +418,14 @@ static int btusb_submit_isoc_urb(struct hci_dev *hdev)
 	if (!data->isoc_rx_ep)
 	if (!data->isoc_rx_ep)
 		return -ENODEV;
 		return -ENODEV;
 
 
-	urb = usb_alloc_urb(BTUSB_MAX_ISOC_FRAMES, GFP_KERNEL);
+	urb = usb_alloc_urb(BTUSB_MAX_ISOC_FRAMES, mem_flags);
 	if (!urb)
 	if (!urb)
 		return -ENOMEM;
 		return -ENOMEM;
 
 
 	size = le16_to_cpu(data->isoc_rx_ep->wMaxPacketSize) *
 	size = le16_to_cpu(data->isoc_rx_ep->wMaxPacketSize) *
 						BTUSB_MAX_ISOC_FRAMES;
 						BTUSB_MAX_ISOC_FRAMES;
 
 
-	buf = kmalloc(size, GFP_KERNEL);
+	buf = kmalloc(size, mem_flags);
 	if (!buf) {
 	if (!buf) {
 		usb_free_urb(urb);
 		usb_free_urb(urb);
 		return -ENOMEM;
 		return -ENOMEM;
@@ -473,7 +448,7 @@ static int btusb_submit_isoc_urb(struct hci_dev *hdev)
 
 
 	usb_anchor_urb(urb, &data->isoc_anchor);
 	usb_anchor_urb(urb, &data->isoc_anchor);
 
 
-	err = usb_submit_urb(urb, GFP_KERNEL);
+	err = usb_submit_urb(urb, mem_flags);
 	if (err < 0) {
 	if (err < 0) {
 		BT_ERR("%s urb %p submission failed (%d)",
 		BT_ERR("%s urb %p submission failed (%d)",
 						hdev->name, urb, -err);
 						hdev->name, urb, -err);
@@ -520,7 +495,7 @@ static int btusb_open(struct hci_dev *hdev)
 	if (test_and_set_bit(BTUSB_INTR_RUNNING, &data->flags))
 	if (test_and_set_bit(BTUSB_INTR_RUNNING, &data->flags))
 		return 0;
 		return 0;
 
 
-	err = btusb_submit_intr_urb(hdev);
+	err = btusb_submit_intr_urb(hdev, GFP_KERNEL);
 	if (err < 0) {
 	if (err < 0) {
 		clear_bit(BTUSB_INTR_RUNNING, &data->flags);
 		clear_bit(BTUSB_INTR_RUNNING, &data->flags);
 		clear_bit(HCI_RUNNING, &hdev->flags);
 		clear_bit(HCI_RUNNING, &hdev->flags);
@@ -589,7 +564,7 @@ static int btusb_send_frame(struct sk_buff *skb)
 			return -ENOMEM;
 			return -ENOMEM;
 		}
 		}
 
 
-		dr->bRequestType = USB_TYPE_CLASS;
+		dr->bRequestType = data->cmdreq_type;
 		dr->bRequest     = 0;
 		dr->bRequest     = 0;
 		dr->wIndex       = 0;
 		dr->wIndex       = 0;
 		dr->wValue       = 0;
 		dr->wValue       = 0;
@@ -680,8 +655,19 @@ static void btusb_notify(struct hci_dev *hdev, unsigned int evt)
 
 
 	BT_DBG("%s evt %d", hdev->name, evt);
 	BT_DBG("%s evt %d", hdev->name, evt);
 
 
-	if (evt == HCI_NOTIFY_CONN_ADD || evt == HCI_NOTIFY_CONN_DEL)
-		schedule_work(&data->work);
+	if (hdev->conn_hash.acl_num > 0) {
+		if (!test_and_set_bit(BTUSB_BULK_RUNNING, &data->flags)) {
+			if (btusb_submit_bulk_urb(hdev, GFP_ATOMIC) < 0)
+				clear_bit(BTUSB_BULK_RUNNING, &data->flags);
+			else
+				btusb_submit_bulk_urb(hdev, GFP_ATOMIC);
+		}
+	} else {
+		clear_bit(BTUSB_BULK_RUNNING, &data->flags);
+		usb_unlink_anchored_urbs(&data->bulk_anchor);
+	}
+
+	schedule_work(&data->work);
 }
 }
 
 
 static int inline __set_isoc_interface(struct hci_dev *hdev, int altsetting)
 static int inline __set_isoc_interface(struct hci_dev *hdev, int altsetting)
@@ -732,18 +718,6 @@ static void btusb_work(struct work_struct *work)
 	struct btusb_data *data = container_of(work, struct btusb_data, work);
 	struct btusb_data *data = container_of(work, struct btusb_data, work);
 	struct hci_dev *hdev = data->hdev;
 	struct hci_dev *hdev = data->hdev;
 
 
-	if (hdev->conn_hash.acl_num > 0) {
-		if (!test_and_set_bit(BTUSB_BULK_RUNNING, &data->flags)) {
-			if (btusb_submit_bulk_urb(hdev) < 0)
-				clear_bit(BTUSB_BULK_RUNNING, &data->flags);
-			else
-				btusb_submit_bulk_urb(hdev);
-		}
-	} else {
-		clear_bit(BTUSB_BULK_RUNNING, &data->flags);
-		usb_kill_anchored_urbs(&data->bulk_anchor);
-	}
-
 	if (hdev->conn_hash.sco_num > 0) {
 	if (hdev->conn_hash.sco_num > 0) {
 		if (data->isoc_altsetting != 2) {
 		if (data->isoc_altsetting != 2) {
 			clear_bit(BTUSB_ISOC_RUNNING, &data->flags);
 			clear_bit(BTUSB_ISOC_RUNNING, &data->flags);
@@ -754,10 +728,10 @@ static void btusb_work(struct work_struct *work)
 		}
 		}
 
 
 		if (!test_and_set_bit(BTUSB_ISOC_RUNNING, &data->flags)) {
 		if (!test_and_set_bit(BTUSB_ISOC_RUNNING, &data->flags)) {
-			if (btusb_submit_isoc_urb(hdev) < 0)
+			if (btusb_submit_isoc_urb(hdev, GFP_KERNEL) < 0)
 				clear_bit(BTUSB_ISOC_RUNNING, &data->flags);
 				clear_bit(BTUSB_ISOC_RUNNING, &data->flags);
 			else
 			else
-				btusb_submit_isoc_urb(hdev);
+				btusb_submit_isoc_urb(hdev, GFP_KERNEL);
 		}
 		}
 	} else {
 	} else {
 		clear_bit(BTUSB_ISOC_RUNNING, &data->flags);
 		clear_bit(BTUSB_ISOC_RUNNING, &data->flags);
@@ -828,6 +802,8 @@ static int btusb_probe(struct usb_interface *intf,
 		return -ENODEV;
 		return -ENODEV;
 	}
 	}
 
 
+	data->cmdreq_type = USB_TYPE_CLASS;
+
 	data->udev = interface_to_usbdev(intf);
 	data->udev = interface_to_usbdev(intf);
 	data->intf = intf;
 	data->intf = intf;
 
 
@@ -862,11 +838,11 @@ static int btusb_probe(struct usb_interface *intf,
 
 
 	hdev->owner = THIS_MODULE;
 	hdev->owner = THIS_MODULE;
 
 
-	/* interface numbers are hardcoded in the spec */
+	/* Interface numbers are hardcoded in the specification */
 	data->isoc = usb_ifnum_to_if(data->udev, 1);
 	data->isoc = usb_ifnum_to_if(data->udev, 1);
 
 
-	if (reset || id->driver_info & BTUSB_RESET)
-		set_bit(HCI_QUIRK_RESET_ON_INIT, &hdev->quirks);
+	if (!reset)
+		set_bit(HCI_QUIRK_NO_RESET, &hdev->quirks);
 
 
 	if (force_scofix || id->driver_info & BTUSB_WRONG_SCO_MTU) {
 	if (force_scofix || id->driver_info & BTUSB_WRONG_SCO_MTU) {
 		if (!disable_scofix)
 		if (!disable_scofix)
@@ -876,9 +852,23 @@ static int btusb_probe(struct usb_interface *intf,
 	if (id->driver_info & BTUSB_BROKEN_ISOC)
 	if (id->driver_info & BTUSB_BROKEN_ISOC)
 		data->isoc = NULL;
 		data->isoc = NULL;
 
 
+	if (id->driver_info & BTUSB_DIGIANSWER) {
+		data->cmdreq_type = USB_TYPE_VENDOR;
+		set_bit(HCI_QUIRK_NO_RESET, &hdev->quirks);
+	}
+
+	if (id->driver_info & BTUSB_CSR) {
+		struct usb_device *udev = data->udev;
+
+		/* Old firmware would otherwise execute USB reset */
+		if (le16_to_cpu(udev->descriptor.bcdDevice) < 0x117)
+			set_bit(HCI_QUIRK_NO_RESET, &hdev->quirks);
+	}
+
 	if (id->driver_info & BTUSB_SNIFFER) {
 	if (id->driver_info & BTUSB_SNIFFER) {
 		struct usb_device *udev = data->udev;
 		struct usb_device *udev = data->udev;
 
 
+		/* New sniffer firmware has crippled HCI interface */
 		if (le16_to_cpu(udev->descriptor.bcdDevice) > 0x997)
 		if (le16_to_cpu(udev->descriptor.bcdDevice) > 0x997)
 			set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks);
 			set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks);
 
 
@@ -949,10 +939,71 @@ static void btusb_disconnect(struct usb_interface *intf)
 	hci_free_dev(hdev);
 	hci_free_dev(hdev);
 }
 }
 
 
+static int btusb_suspend(struct usb_interface *intf, pm_message_t message)
+{
+	struct btusb_data *data = usb_get_intfdata(intf);
+
+	BT_DBG("intf %p", intf);
+
+	if (data->suspend_count++)
+		return 0;
+
+	cancel_work_sync(&data->work);
+
+	usb_kill_anchored_urbs(&data->tx_anchor);
+
+	usb_kill_anchored_urbs(&data->isoc_anchor);
+	usb_kill_anchored_urbs(&data->bulk_anchor);
+	usb_kill_anchored_urbs(&data->intr_anchor);
+
+	return 0;
+}
+
+static int btusb_resume(struct usb_interface *intf)
+{
+	struct btusb_data *data = usb_get_intfdata(intf);
+	struct hci_dev *hdev = data->hdev;
+	int err;
+
+	BT_DBG("intf %p", intf);
+
+	if (--data->suspend_count)
+		return 0;
+
+	if (!test_bit(HCI_RUNNING, &hdev->flags))
+		return 0;
+
+	if (test_bit(BTUSB_INTR_RUNNING, &data->flags)) {
+		err = btusb_submit_intr_urb(hdev, GFP_NOIO);
+		if (err < 0) {
+			clear_bit(BTUSB_INTR_RUNNING, &data->flags);
+			return err;
+		}
+	}
+
+	if (test_bit(BTUSB_BULK_RUNNING, &data->flags)) {
+		if (btusb_submit_bulk_urb(hdev, GFP_NOIO) < 0)
+			clear_bit(BTUSB_BULK_RUNNING, &data->flags);
+		else
+			btusb_submit_bulk_urb(hdev, GFP_NOIO);
+	}
+
+	if (test_bit(BTUSB_ISOC_RUNNING, &data->flags)) {
+		if (btusb_submit_isoc_urb(hdev, GFP_NOIO) < 0)
+			clear_bit(BTUSB_ISOC_RUNNING, &data->flags);
+		else
+			btusb_submit_isoc_urb(hdev, GFP_NOIO);
+	}
+
+	return 0;
+}
+
 static struct usb_driver btusb_driver = {
 static struct usb_driver btusb_driver = {
 	.name		= "btusb",
 	.name		= "btusb",
 	.probe		= btusb_probe,
 	.probe		= btusb_probe,
 	.disconnect	= btusb_disconnect,
 	.disconnect	= btusb_disconnect,
+	.suspend	= btusb_suspend,
+	.resume		= btusb_resume,
 	.id_table	= btusb_table,
 	.id_table	= btusb_table,
 };
 };
 
 

+ 0 - 5
drivers/bluetooth/hci_bcsp.c

@@ -47,11 +47,6 @@
 
 
 #include "hci_uart.h"
 #include "hci_uart.h"
 
 
-#ifndef CONFIG_BT_HCIUART_DEBUG
-#undef  BT_DBG
-#define BT_DBG( A... )
-#endif
-
 #define VERSION "0.3"
 #define VERSION "0.3"
 
 
 static int txcrc = 1;
 static int txcrc = 1;

+ 0 - 5
drivers/bluetooth/hci_h4.c

@@ -46,11 +46,6 @@
 
 
 #include "hci_uart.h"
 #include "hci_uart.h"
 
 
-#ifndef CONFIG_BT_HCIUART_DEBUG
-#undef  BT_DBG
-#define BT_DBG( A... )
-#endif
-
 #define VERSION "1.2"
 #define VERSION "1.2"
 
 
 struct h4_struct {
 struct h4_struct {

+ 2 - 7
drivers/bluetooth/hci_ldisc.c

@@ -46,11 +46,6 @@
 
 
 #include "hci_uart.h"
 #include "hci_uart.h"
 
 
-#ifndef CONFIG_BT_HCIUART_DEBUG
-#undef  BT_DBG
-#define BT_DBG( A... )
-#endif
-
 #define VERSION "2.2"
 #define VERSION "2.2"
 
 
 static int reset = 0;
 static int reset = 0;
@@ -399,8 +394,8 @@ static int hci_uart_register_dev(struct hci_uart *hu)
 
 
 	hdev->owner = THIS_MODULE;
 	hdev->owner = THIS_MODULE;
 
 
-	if (reset)
-		set_bit(HCI_QUIRK_RESET_ON_INIT, &hdev->quirks);
+	if (!reset)
+		set_bit(HCI_QUIRK_NO_RESET, &hdev->quirks);
 
 
 	if (hci_register_dev(hdev) < 0) {
 	if (hci_register_dev(hdev) < 0) {
 		BT_ERR("Can't register HCI device");
 		BT_ERR("Can't register HCI device");

+ 0 - 1136
drivers/bluetooth/hci_usb.c

@@ -1,1136 +0,0 @@
-/* 
-   HCI USB driver for Linux Bluetooth protocol stack (BlueZ)
-   Copyright (C) 2000-2001 Qualcomm Incorporated
-   Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
-
-   Copyright (C) 2003 Maxim Krasnyansky <maxk@qualcomm.com>
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation;
-
-   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
-   IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
-   CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 
-   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 
-   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 
-   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-   ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 
-   COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 
-   SOFTWARE IS DISCLAIMED.
-*/
-
-/*
- * Bluetooth HCI USB driver.
- * Based on original USB Bluetooth driver for Linux kernel
- *    Copyright (c) 2000 Greg Kroah-Hartman        <greg@kroah.com>
- *    Copyright (c) 2000 Mark Douglas Corner       <mcorner@umich.edu>
- *
- */
-
-#include <linux/module.h>
-
-#include <linux/kernel.h>
-#include <linux/init.h>
-#include <linux/unistd.h>
-#include <linux/types.h>
-#include <linux/interrupt.h>
-#include <linux/moduleparam.h>
-
-#include <linux/slab.h>
-#include <linux/errno.h>
-#include <linux/string.h>
-#include <linux/skbuff.h>
-
-#include <linux/usb.h>
-
-#include <net/bluetooth/bluetooth.h>
-#include <net/bluetooth/hci_core.h>
-
-#include "hci_usb.h"
-
-#ifndef CONFIG_BT_HCIUSB_DEBUG
-#undef  BT_DBG
-#define BT_DBG(D...)
-#endif
-
-#ifndef CONFIG_BT_HCIUSB_ZERO_PACKET
-#undef  URB_ZERO_PACKET
-#define URB_ZERO_PACKET 0
-#endif
-
-static int ignore_dga;
-static int ignore_csr;
-static int ignore_sniffer;
-static int disable_scofix;
-static int force_scofix;
-static int reset;
-
-#ifdef CONFIG_BT_HCIUSB_SCO
-static int isoc = 2;
-#endif
-
-#define VERSION "2.10"
-
-static struct usb_driver hci_usb_driver; 
-
-static struct usb_device_id bluetooth_ids[] = {
-	/* Generic Bluetooth USB device */
-	{ USB_DEVICE_INFO(HCI_DEV_CLASS, HCI_DEV_SUBCLASS, HCI_DEV_PROTOCOL) },
-
-	/* AVM BlueFRITZ! USB v2.0 */
-	{ USB_DEVICE(0x057c, 0x3800) },
-
-	/* Bluetooth Ultraport Module from IBM */
-	{ USB_DEVICE(0x04bf, 0x030a) },
-
-	/* ALPS Modules with non-standard id */
-	{ USB_DEVICE(0x044e, 0x3001) },
-	{ USB_DEVICE(0x044e, 0x3002) },
-
-	/* Ericsson with non-standard id */
-	{ USB_DEVICE(0x0bdb, 0x1002) },
-
-	/* Canyon CN-BTU1 with HID interfaces */
-	{ USB_DEVICE(0x0c10, 0x0000), .driver_info = HCI_RESET },
-
-	{ }	/* Terminating entry */
-};
-
-MODULE_DEVICE_TABLE (usb, bluetooth_ids);
-
-static struct usb_device_id blacklist_ids[] = {
-	/* CSR BlueCore devices */
-	{ USB_DEVICE(0x0a12, 0x0001), .driver_info = HCI_CSR },
-
-	/* Broadcom BCM2033 without firmware */
-	{ USB_DEVICE(0x0a5c, 0x2033), .driver_info = HCI_IGNORE },
-
-	/* Broadcom BCM2035 */
-	{ USB_DEVICE(0x0a5c, 0x2035), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
-	{ USB_DEVICE(0x0a5c, 0x200a), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
-	{ USB_DEVICE(0x0a5c, 0x2009), .driver_info = HCI_BCM92035 },
-
-	/* Broadcom BCM2045 */
-	{ USB_DEVICE(0x0a5c, 0x2039), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
-	{ USB_DEVICE(0x0a5c, 0x2101), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
-
-	/* IBM/Lenovo ThinkPad with Broadcom chip */
-	{ USB_DEVICE(0x0a5c, 0x201e), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
-	{ USB_DEVICE(0x0a5c, 0x2110), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
-
-	/* Targus ACB10US */
-	{ USB_DEVICE(0x0a5c, 0x2100), .driver_info = HCI_RESET },
-
-	/* ANYCOM Bluetooth USB-200 and USB-250 */
-	{ USB_DEVICE(0x0a5c, 0x2111), .driver_info = HCI_RESET },
-
-	/* HP laptop with Broadcom chip */
-	{ USB_DEVICE(0x03f0, 0x171d), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
-
-	/* Dell laptop with Broadcom chip */
-	{ USB_DEVICE(0x413c, 0x8126), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
-	/* Dell Wireless 370 */
-	{ USB_DEVICE(0x413c, 0x8156), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
-	/* Dell Wireless 410 */
-	{ USB_DEVICE(0x413c, 0x8152), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
-
-	/* Broadcom 2046 */
-	{ USB_DEVICE(0x0a5c, 0x2151), .driver_info = HCI_RESET },
-
-	/* Microsoft Wireless Transceiver for Bluetooth 2.0 */
-	{ USB_DEVICE(0x045e, 0x009c), .driver_info = HCI_RESET },
-
-	/* Kensington Bluetooth USB adapter */
-	{ USB_DEVICE(0x047d, 0x105d), .driver_info = HCI_RESET },
-	{ USB_DEVICE(0x047d, 0x105e), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
-
-	/* ISSC Bluetooth Adapter v3.1 */
-	{ USB_DEVICE(0x1131, 0x1001), .driver_info = HCI_RESET },
-
-	/* RTX Telecom based adapters with buggy SCO support */
-	{ USB_DEVICE(0x0400, 0x0807), .driver_info = HCI_BROKEN_ISOC },
-	{ USB_DEVICE(0x0400, 0x080a), .driver_info = HCI_BROKEN_ISOC },
-
-	/* CONWISE Technology based adapters with buggy SCO support */
-	{ USB_DEVICE(0x0e5e, 0x6622), .driver_info = HCI_BROKEN_ISOC },
-
-	/* Belkin F8T012 and F8T013 devices */
-	{ USB_DEVICE(0x050d, 0x0012), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
-	{ USB_DEVICE(0x050d, 0x0013), .driver_info = HCI_RESET | HCI_WRONG_SCO_MTU },
-
-	/* Digianswer devices */
-	{ USB_DEVICE(0x08fd, 0x0001), .driver_info = HCI_DIGIANSWER },
-	{ USB_DEVICE(0x08fd, 0x0002), .driver_info = HCI_IGNORE },
-
-	/* CSR BlueCore Bluetooth Sniffer */
-	{ USB_DEVICE(0x0a12, 0x0002), .driver_info = HCI_SNIFFER },
-
-	/* Frontline ComProbe Bluetooth Sniffer */
-	{ USB_DEVICE(0x16d3, 0x0002), .driver_info = HCI_SNIFFER },
-
-	{ }	/* Terminating entry */
-};
-
-static struct _urb *_urb_alloc(int isoc, gfp_t gfp)
-{
-	struct _urb *_urb = kmalloc(sizeof(struct _urb) +
-				sizeof(struct usb_iso_packet_descriptor) * isoc, gfp);
-	if (_urb) {
-		memset(_urb, 0, sizeof(*_urb));
-		usb_init_urb(&_urb->urb);
-	}
-	return _urb;
-}
-
-static struct _urb *_urb_dequeue(struct _urb_queue *q)
-{
-	struct _urb *_urb = NULL;
-	unsigned long flags;
-	spin_lock_irqsave(&q->lock, flags);
-	{
-		struct list_head *head = &q->head;
-		struct list_head *next = head->next;
-		if (next != head) {
-			_urb = list_entry(next, struct _urb, list);
-			list_del(next); _urb->queue = NULL;
-		}
-	}
-	spin_unlock_irqrestore(&q->lock, flags);
-	return _urb;
-}
-
-static void hci_usb_rx_complete(struct urb *urb);
-static void hci_usb_tx_complete(struct urb *urb);
-
-#define __pending_tx(husb, type)  (&husb->pending_tx[type-1])
-#define __pending_q(husb, type)   (&husb->pending_q[type-1])
-#define __completed_q(husb, type) (&husb->completed_q[type-1])
-#define __transmit_q(husb, type)  (&husb->transmit_q[type-1])
-
-static inline struct _urb *__get_completed(struct hci_usb *husb, int type)
-{
-	return _urb_dequeue(__completed_q(husb, type)); 
-}
-
-#ifdef CONFIG_BT_HCIUSB_SCO
-static void __fill_isoc_desc(struct urb *urb, int len, int mtu)
-{
-	int offset = 0, i;
-
-	BT_DBG("len %d mtu %d", len, mtu);
-
-	for (i=0; i < HCI_MAX_ISOC_FRAMES && len >= mtu; i++, offset += mtu, len -= mtu) {
-		urb->iso_frame_desc[i].offset = offset;
-		urb->iso_frame_desc[i].length = mtu;
-		BT_DBG("desc %d offset %d len %d", i, offset, mtu);
-	}
-	if (len && i < HCI_MAX_ISOC_FRAMES) {
-		urb->iso_frame_desc[i].offset = offset;
-		urb->iso_frame_desc[i].length = len;
-		BT_DBG("desc %d offset %d len %d", i, offset, len);
-		i++;
-	}
-	urb->number_of_packets = i;
-}
-#endif
-
-static int hci_usb_intr_rx_submit(struct hci_usb *husb)
-{
-	struct _urb *_urb;
-	struct urb *urb;
-	int err, pipe, interval, size;
-	void *buf;
-
-	BT_DBG("%s", husb->hdev->name);
-
-	size = le16_to_cpu(husb->intr_in_ep->desc.wMaxPacketSize);
-
-	buf = kmalloc(size, GFP_ATOMIC);
-	if (!buf)
-		return -ENOMEM;
-
-	_urb = _urb_alloc(0, GFP_ATOMIC);
-	if (!_urb) {
-		kfree(buf);
-		return -ENOMEM;
-	}
-	_urb->type = HCI_EVENT_PKT;
-	_urb_queue_tail(__pending_q(husb, _urb->type), _urb);
-
-	urb = &_urb->urb;
-	pipe     = usb_rcvintpipe(husb->udev, husb->intr_in_ep->desc.bEndpointAddress);
-	interval = husb->intr_in_ep->desc.bInterval;
-	usb_fill_int_urb(urb, husb->udev, pipe, buf, size, hci_usb_rx_complete, husb, interval);
-	
-	err = usb_submit_urb(urb, GFP_ATOMIC);
-	if (err) {
-		BT_ERR("%s intr rx submit failed urb %p err %d",
-				husb->hdev->name, urb, err);
-		_urb_unlink(_urb);
-		kfree(_urb);
-		kfree(buf);
-	}
-	return err;
-}
-
-static int hci_usb_bulk_rx_submit(struct hci_usb *husb)
-{
-	struct _urb *_urb;
-	struct urb *urb;
-	int err, pipe, size = HCI_MAX_FRAME_SIZE;
-	void *buf;
-
-	buf = kmalloc(size, GFP_ATOMIC);
-	if (!buf)
-		return -ENOMEM;
-
-	_urb = _urb_alloc(0, GFP_ATOMIC);
-	if (!_urb) {
-		kfree(buf);
-		return -ENOMEM;
-	}
-	_urb->type = HCI_ACLDATA_PKT;
-	_urb_queue_tail(__pending_q(husb, _urb->type), _urb);
-
-	urb  = &_urb->urb;
-	pipe = usb_rcvbulkpipe(husb->udev, husb->bulk_in_ep->desc.bEndpointAddress);
-	usb_fill_bulk_urb(urb, husb->udev, pipe, buf, size, hci_usb_rx_complete, husb);
-	urb->transfer_flags = 0;
-
-	BT_DBG("%s urb %p", husb->hdev->name, urb);
-
-	err = usb_submit_urb(urb, GFP_ATOMIC);
-	if (err) {
-		BT_ERR("%s bulk rx submit failed urb %p err %d",
-				husb->hdev->name, urb, err);
-		_urb_unlink(_urb);
-		kfree(_urb);
-		kfree(buf);
-	}
-	return err;
-}
-
-#ifdef CONFIG_BT_HCIUSB_SCO
-static int hci_usb_isoc_rx_submit(struct hci_usb *husb)
-{
-	struct _urb *_urb;
-	struct urb *urb;
-	int err, mtu, size;
-	void *buf;
-
-	mtu  = le16_to_cpu(husb->isoc_in_ep->desc.wMaxPacketSize);
-	size = mtu * HCI_MAX_ISOC_FRAMES;
-
-	buf = kmalloc(size, GFP_ATOMIC);
-	if (!buf)
-		return -ENOMEM;
-
-	_urb = _urb_alloc(HCI_MAX_ISOC_FRAMES, GFP_ATOMIC);
-	if (!_urb) {
-		kfree(buf);
-		return -ENOMEM;
-	}
-	_urb->type = HCI_SCODATA_PKT;
-	_urb_queue_tail(__pending_q(husb, _urb->type), _urb);
-
-	urb = &_urb->urb;
-
-	urb->context  = husb;
-	urb->dev      = husb->udev;
-	urb->pipe     = usb_rcvisocpipe(husb->udev, husb->isoc_in_ep->desc.bEndpointAddress);
-	urb->complete = hci_usb_rx_complete;
-
-	urb->interval = husb->isoc_in_ep->desc.bInterval;
-
-	urb->transfer_buffer_length = size;
-	urb->transfer_buffer = buf;
-	urb->transfer_flags  = URB_ISO_ASAP;
-
-	__fill_isoc_desc(urb, size, mtu);
-
-	BT_DBG("%s urb %p", husb->hdev->name, urb);
-
-	err = usb_submit_urb(urb, GFP_ATOMIC);
-	if (err) {
-		BT_ERR("%s isoc rx submit failed urb %p err %d",
-				husb->hdev->name, urb, err);
-		_urb_unlink(_urb);
-		kfree(_urb);
-		kfree(buf);
-	}
-	return err;
-}
-#endif
-
-/* Initialize device */
-static int hci_usb_open(struct hci_dev *hdev)
-{
-	struct hci_usb *husb = (struct hci_usb *) hdev->driver_data;
-	int i, err;
-	unsigned long flags;
-
-	BT_DBG("%s", hdev->name);
-
-	if (test_and_set_bit(HCI_RUNNING, &hdev->flags))
-		return 0;
-
-	write_lock_irqsave(&husb->completion_lock, flags);
-
-	err = hci_usb_intr_rx_submit(husb);
-	if (!err) {
-		for (i = 0; i < HCI_MAX_BULK_RX; i++)
-			hci_usb_bulk_rx_submit(husb);
-
-#ifdef CONFIG_BT_HCIUSB_SCO
-		if (husb->isoc_iface)
-			for (i = 0; i < HCI_MAX_ISOC_RX; i++)
-				hci_usb_isoc_rx_submit(husb);
-#endif
-	} else {
-		clear_bit(HCI_RUNNING, &hdev->flags);
-	}
-
-	write_unlock_irqrestore(&husb->completion_lock, flags);
-	return err;
-}
-
-/* Reset device */
-static int hci_usb_flush(struct hci_dev *hdev)
-{
-	struct hci_usb *husb = (struct hci_usb *) hdev->driver_data;
-	int i;
-
-	BT_DBG("%s", hdev->name);
-
-	for (i = 0; i < 4; i++)
-		skb_queue_purge(&husb->transmit_q[i]);
-	return 0;
-}
-
-static void hci_usb_unlink_urbs(struct hci_usb *husb)
-{
-	int i;
-
-	BT_DBG("%s", husb->hdev->name);
-
-	for (i = 0; i < 4; i++) {
-		struct _urb *_urb;
-		struct urb *urb;
-
-		/* Kill pending requests */
-		while ((_urb = _urb_dequeue(&husb->pending_q[i]))) {
-			urb = &_urb->urb;
-			BT_DBG("%s unlinking _urb %p type %d urb %p", 
-					husb->hdev->name, _urb, _urb->type, urb);
-			usb_kill_urb(urb);
-			_urb_queue_tail(__completed_q(husb, _urb->type), _urb);
-		}
-
-		/* Release completed requests */
-		while ((_urb = _urb_dequeue(&husb->completed_q[i]))) {
-			urb = &_urb->urb;
-			BT_DBG("%s freeing _urb %p type %d urb %p",
-					husb->hdev->name, _urb, _urb->type, urb);
-			kfree(urb->setup_packet);
-			kfree(urb->transfer_buffer);
-			kfree(_urb);
-		}
-	}
-}
-
-/* Close device */
-static int hci_usb_close(struct hci_dev *hdev)
-{
-	struct hci_usb *husb = (struct hci_usb *) hdev->driver_data;
-	unsigned long flags;
-
-	if (!test_and_clear_bit(HCI_RUNNING, &hdev->flags))
-		return 0;
-
-	BT_DBG("%s", hdev->name);
-
-	/* Synchronize with completion handlers */
-	write_lock_irqsave(&husb->completion_lock, flags);
-	write_unlock_irqrestore(&husb->completion_lock, flags);
-
-	hci_usb_unlink_urbs(husb);
-	hci_usb_flush(hdev);
-	return 0;
-}
-
-static int __tx_submit(struct hci_usb *husb, struct _urb *_urb)
-{
-	struct urb *urb = &_urb->urb;
-	int err;
-
-	BT_DBG("%s urb %p type %d", husb->hdev->name, urb, _urb->type);
-
-	_urb_queue_tail(__pending_q(husb, _urb->type), _urb);
-	err = usb_submit_urb(urb, GFP_ATOMIC);
-	if (err) {
-		BT_ERR("%s tx submit failed urb %p type %d err %d",
-				husb->hdev->name, urb, _urb->type, err);
-		_urb_unlink(_urb);
-		_urb_queue_tail(__completed_q(husb, _urb->type), _urb);
-	} else
-		atomic_inc(__pending_tx(husb, _urb->type));
-
-	return err;
-}
-
-static inline int hci_usb_send_ctrl(struct hci_usb *husb, struct sk_buff *skb)
-{
-	struct _urb *_urb = __get_completed(husb, bt_cb(skb)->pkt_type);
-	struct usb_ctrlrequest *dr;
-	struct urb *urb;
-
-	if (!_urb) {
-		_urb = _urb_alloc(0, GFP_ATOMIC);
-		if (!_urb)
-			return -ENOMEM;
-		_urb->type = bt_cb(skb)->pkt_type;
-
-		dr = kmalloc(sizeof(*dr), GFP_ATOMIC);
-		if (!dr) {
-			kfree(_urb);
-			return -ENOMEM;
-		}
-	} else
-		dr = (void *) _urb->urb.setup_packet;
-
-	dr->bRequestType = husb->ctrl_req;
-	dr->bRequest = 0;
-	dr->wIndex   = 0;
-	dr->wValue   = 0;
-	dr->wLength  = __cpu_to_le16(skb->len);
-
-	urb = &_urb->urb;
-	usb_fill_control_urb(urb, husb->udev, usb_sndctrlpipe(husb->udev, 0),
-		(void *) dr, skb->data, skb->len, hci_usb_tx_complete, husb);
-
-	BT_DBG("%s skb %p len %d", husb->hdev->name, skb, skb->len);
-	
-	_urb->priv = skb;
-	return __tx_submit(husb, _urb);
-}
-
-static inline int hci_usb_send_bulk(struct hci_usb *husb, struct sk_buff *skb)
-{
-	struct _urb *_urb = __get_completed(husb, bt_cb(skb)->pkt_type);
-	struct urb *urb;
-	int pipe;
-
-	if (!_urb) {
-		_urb = _urb_alloc(0, GFP_ATOMIC);
-		if (!_urb)
-			return -ENOMEM;
-		_urb->type = bt_cb(skb)->pkt_type;
-	}
-
-	urb  = &_urb->urb;
-	pipe = usb_sndbulkpipe(husb->udev, husb->bulk_out_ep->desc.bEndpointAddress);
-	usb_fill_bulk_urb(urb, husb->udev, pipe, skb->data, skb->len, 
-			hci_usb_tx_complete, husb);
-	urb->transfer_flags = URB_ZERO_PACKET;
-
-	BT_DBG("%s skb %p len %d", husb->hdev->name, skb, skb->len);
-
-	_urb->priv = skb;
-	return __tx_submit(husb, _urb);
-}
-
-#ifdef CONFIG_BT_HCIUSB_SCO
-static inline int hci_usb_send_isoc(struct hci_usb *husb, struct sk_buff *skb)
-{
-	struct _urb *_urb = __get_completed(husb, bt_cb(skb)->pkt_type);
-	struct urb *urb;
-
-	if (!_urb) {
-		_urb = _urb_alloc(HCI_MAX_ISOC_FRAMES, GFP_ATOMIC);
-		if (!_urb)
-			return -ENOMEM;
-		_urb->type = bt_cb(skb)->pkt_type;
-	}
-
-	BT_DBG("%s skb %p len %d", husb->hdev->name, skb, skb->len);
-
-	urb = &_urb->urb;
-
-	urb->context  = husb;
-	urb->dev      = husb->udev;
-	urb->pipe     = usb_sndisocpipe(husb->udev, husb->isoc_out_ep->desc.bEndpointAddress);
-	urb->complete = hci_usb_tx_complete;
-	urb->transfer_flags = URB_ISO_ASAP;
-
-	urb->interval = husb->isoc_out_ep->desc.bInterval;
-
-	urb->transfer_buffer = skb->data;
-	urb->transfer_buffer_length = skb->len;
-
-	__fill_isoc_desc(urb, skb->len, le16_to_cpu(husb->isoc_out_ep->desc.wMaxPacketSize));
-
-	_urb->priv = skb;
-	return __tx_submit(husb, _urb);
-}
-#endif
-
-static void hci_usb_tx_process(struct hci_usb *husb)
-{
-	struct sk_buff_head *q;
-	struct sk_buff *skb;
-
-	BT_DBG("%s", husb->hdev->name);
-
-	do {
-		clear_bit(HCI_USB_TX_WAKEUP, &husb->state);
-
-		/* Process command queue */
-		q = __transmit_q(husb, HCI_COMMAND_PKT);
-		if (!atomic_read(__pending_tx(husb, HCI_COMMAND_PKT)) &&
-				(skb = skb_dequeue(q))) {
-			if (hci_usb_send_ctrl(husb, skb) < 0)
-				skb_queue_head(q, skb);
-		}
-
-#ifdef CONFIG_BT_HCIUSB_SCO
-		/* Process SCO queue */
-		q = __transmit_q(husb, HCI_SCODATA_PKT);
-		if (atomic_read(__pending_tx(husb, HCI_SCODATA_PKT)) < HCI_MAX_ISOC_TX &&
-				(skb = skb_dequeue(q))) {
-			if (hci_usb_send_isoc(husb, skb) < 0)
-				skb_queue_head(q, skb);
-		}
-#endif
-
-		/* Process ACL queue */
-		q = __transmit_q(husb, HCI_ACLDATA_PKT);
-		while (atomic_read(__pending_tx(husb, HCI_ACLDATA_PKT)) < HCI_MAX_BULK_TX &&
-				(skb = skb_dequeue(q))) {
-			if (hci_usb_send_bulk(husb, skb) < 0) {
-				skb_queue_head(q, skb);
-				break;
-			}
-		}
-	} while(test_bit(HCI_USB_TX_WAKEUP, &husb->state));
-}
-
-static inline void hci_usb_tx_wakeup(struct hci_usb *husb)
-{
-	/* Serialize TX queue processing to avoid data reordering */
-	if (!test_and_set_bit(HCI_USB_TX_PROCESS, &husb->state)) {
-		hci_usb_tx_process(husb);
-		clear_bit(HCI_USB_TX_PROCESS, &husb->state);
-	} else
-		set_bit(HCI_USB_TX_WAKEUP, &husb->state);
-}
-
-/* Send frames from HCI layer */
-static int hci_usb_send_frame(struct sk_buff *skb)
-{
-	struct hci_dev *hdev = (struct hci_dev *) skb->dev;
-	struct hci_usb *husb;
-
-	if (!hdev) {
-		BT_ERR("frame for uknown device (hdev=NULL)");
-		return -ENODEV;
-	}
-
-	if (!test_bit(HCI_RUNNING, &hdev->flags))
-		return -EBUSY;
-
-	BT_DBG("%s type %d len %d", hdev->name, bt_cb(skb)->pkt_type, skb->len);
-
-	husb = (struct hci_usb *) hdev->driver_data;
-
-	switch (bt_cb(skb)->pkt_type) {
-	case HCI_COMMAND_PKT:
-		hdev->stat.cmd_tx++;
-		break;
-
-	case HCI_ACLDATA_PKT:
-		hdev->stat.acl_tx++;
-		break;
-
-#ifdef CONFIG_BT_HCIUSB_SCO
-	case HCI_SCODATA_PKT:
-		hdev->stat.sco_tx++;
-		break;
-#endif
-
-	default:
-		kfree_skb(skb);
-		return 0;
-	}
-
-	read_lock(&husb->completion_lock);
-
-	skb_queue_tail(__transmit_q(husb, bt_cb(skb)->pkt_type), skb);
-	hci_usb_tx_wakeup(husb);
-
-	read_unlock(&husb->completion_lock);
-	return 0;
-}
-
-static void hci_usb_rx_complete(struct urb *urb)
-{
-	struct _urb *_urb = container_of(urb, struct _urb, urb);
-	struct hci_usb *husb = (void *) urb->context;
-	struct hci_dev *hdev = husb->hdev;
-	int err, count = urb->actual_length;
-
-	BT_DBG("%s urb %p type %d status %d count %d flags %x", hdev->name, urb,
-			_urb->type, urb->status, count, urb->transfer_flags);
-
-	read_lock(&husb->completion_lock);
-
-	if (!test_bit(HCI_RUNNING, &hdev->flags))
-		goto unlock;
-
-	if (urb->status || !count)
-		goto resubmit;
-
-	if (_urb->type == HCI_SCODATA_PKT) {
-#ifdef CONFIG_BT_HCIUSB_SCO
-		int i;
-		for (i=0; i < urb->number_of_packets; i++) {
-			BT_DBG("desc %d status %d offset %d len %d", i,
-					urb->iso_frame_desc[i].status,
-					urb->iso_frame_desc[i].offset,
-					urb->iso_frame_desc[i].actual_length);
-	
-			if (!urb->iso_frame_desc[i].status) {
-				husb->hdev->stat.byte_rx += urb->iso_frame_desc[i].actual_length;
-				hci_recv_fragment(husb->hdev, _urb->type, 
-					urb->transfer_buffer + urb->iso_frame_desc[i].offset,
-					urb->iso_frame_desc[i].actual_length);
-			}
-		}
-#else
-		;
-#endif
-	} else {
-		husb->hdev->stat.byte_rx += count;
-		err = hci_recv_fragment(husb->hdev, _urb->type, urb->transfer_buffer, count);
-		if (err < 0) { 
-			BT_ERR("%s corrupted packet: type %d count %d",
-					husb->hdev->name, _urb->type, count);
-			hdev->stat.err_rx++;
-		}
-	}
-
-resubmit:
-	urb->dev = husb->udev;
-	err = usb_submit_urb(urb, GFP_ATOMIC);
-	BT_DBG("%s urb %p type %d resubmit status %d", hdev->name, urb,
-			_urb->type, err);
-
-unlock:
-	read_unlock(&husb->completion_lock);
-}
-
-static void hci_usb_tx_complete(struct urb *urb)
-{
-	struct _urb *_urb = container_of(urb, struct _urb, urb);
-	struct hci_usb *husb = (void *) urb->context;
-	struct hci_dev *hdev = husb->hdev;
-
-	BT_DBG("%s urb %p status %d flags %x", hdev->name, urb,
-			urb->status, urb->transfer_flags);
-
-	atomic_dec(__pending_tx(husb, _urb->type));
-
-	urb->transfer_buffer = NULL;
-	kfree_skb((struct sk_buff *) _urb->priv);
-
-	if (!test_bit(HCI_RUNNING, &hdev->flags))
-		return;
-
-	if (!urb->status)
-		hdev->stat.byte_tx += urb->transfer_buffer_length;
-	else
-		hdev->stat.err_tx++;
-
-	read_lock(&husb->completion_lock);
-
-	_urb_unlink(_urb);
-	_urb_queue_tail(__completed_q(husb, _urb->type), _urb);
-
-	hci_usb_tx_wakeup(husb);
-
-	read_unlock(&husb->completion_lock);
-}
-
-static void hci_usb_destruct(struct hci_dev *hdev)
-{
-	struct hci_usb *husb = (struct hci_usb *) hdev->driver_data;
-
-	BT_DBG("%s", hdev->name);
-
-	kfree(husb);
-}
-
-static void hci_usb_notify(struct hci_dev *hdev, unsigned int evt)
-{
-	BT_DBG("%s evt %d", hdev->name, evt);
-}
-
-static int hci_usb_probe(struct usb_interface *intf, const struct usb_device_id *id)
-{
-	struct usb_device *udev = interface_to_usbdev(intf);
-	struct usb_host_endpoint *bulk_out_ep = NULL;
-	struct usb_host_endpoint *bulk_in_ep = NULL;
-	struct usb_host_endpoint *intr_in_ep = NULL;
-	struct usb_host_endpoint  *ep;
-	struct usb_host_interface *uif;
-	struct usb_interface *isoc_iface;
-	struct hci_usb *husb;
-	struct hci_dev *hdev;
-	int i, e, size, isoc_ifnum, isoc_alts;
-
-	BT_DBG("udev %p intf %p", udev, intf);
-
-	if (!id->driver_info) {
-		const struct usb_device_id *match;
-		match = usb_match_id(intf, blacklist_ids);
-		if (match)
-			id = match;
-	}
-
-	if (id->driver_info & HCI_IGNORE)
-		return -ENODEV;
-
-	if (ignore_dga && id->driver_info & HCI_DIGIANSWER)
-		return -ENODEV;
-
-	if (ignore_csr && id->driver_info & HCI_CSR)
-		return -ENODEV;
-
-	if (ignore_sniffer && id->driver_info & HCI_SNIFFER)
-		return -ENODEV;
-
-	if (intf->cur_altsetting->desc.bInterfaceNumber > 0)
-		return -ENODEV;
-
-	/* Find endpoints that we need */
-	uif = intf->cur_altsetting;
-	for (e = 0; e < uif->desc.bNumEndpoints; e++) {
-		ep = &uif->endpoint[e];
-
-		switch (ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) {
-		case USB_ENDPOINT_XFER_INT:
-			if (ep->desc.bEndpointAddress & USB_DIR_IN)
-				intr_in_ep = ep;
-			break;
-
-		case USB_ENDPOINT_XFER_BULK:
-			if (ep->desc.bEndpointAddress & USB_DIR_IN)
-				bulk_in_ep  = ep;
-			else
-				bulk_out_ep = ep;
-			break;
-		}
-	}
-
-	if (!bulk_in_ep || !bulk_out_ep || !intr_in_ep) {
-		BT_DBG("Bulk endpoints not found");
-		goto done;
-	}
-
-	if (!(husb = kzalloc(sizeof(struct hci_usb), GFP_KERNEL))) {
-		BT_ERR("Can't allocate: control structure");
-		goto done;
-	}
-
-	husb->udev = udev;
-	husb->bulk_out_ep = bulk_out_ep;
-	husb->bulk_in_ep  = bulk_in_ep;
-	husb->intr_in_ep  = intr_in_ep;
-
-	if (id->driver_info & HCI_DIGIANSWER)
-		husb->ctrl_req = USB_TYPE_VENDOR;
-	else
-		husb->ctrl_req = USB_TYPE_CLASS;
-
-	/* Find isochronous endpoints that we can use */
-	size = 0; 
-	isoc_iface = NULL;
-	isoc_alts  = 0;
-	isoc_ifnum = 1;
-
-#ifdef CONFIG_BT_HCIUSB_SCO
-	if (isoc && !(id->driver_info & (HCI_BROKEN_ISOC | HCI_SNIFFER)))
-		isoc_iface = usb_ifnum_to_if(udev, isoc_ifnum);
-
-	if (isoc_iface) {
-		int a;
-		struct usb_host_endpoint *isoc_out_ep = NULL;
-		struct usb_host_endpoint *isoc_in_ep = NULL;
-
-		for (a = 0; a < isoc_iface->num_altsetting; a++) {
-			uif = &isoc_iface->altsetting[a];
-			for (e = 0; e < uif->desc.bNumEndpoints; e++) {
-				ep = &uif->endpoint[e];
-
-				switch (ep->desc.bmAttributes & USB_ENDPOINT_XFERTYPE_MASK) {
-				case USB_ENDPOINT_XFER_ISOC:
-					if (le16_to_cpu(ep->desc.wMaxPacketSize) < size ||
-							uif->desc.bAlternateSetting != isoc)
-						break;
-					size = le16_to_cpu(ep->desc.wMaxPacketSize);
-
-					isoc_alts = uif->desc.bAlternateSetting;
-
-					if (ep->desc.bEndpointAddress & USB_DIR_IN)
-						isoc_in_ep  = ep;
-					else
-						isoc_out_ep = ep;
-					break;
-				}
-			}
-		}
-
-		if (!isoc_in_ep || !isoc_out_ep)
-			BT_DBG("Isoc endpoints not found");
-		else {
-			BT_DBG("isoc ifnum %d alts %d", isoc_ifnum, isoc_alts);
-			if (usb_driver_claim_interface(&hci_usb_driver, isoc_iface, husb) != 0)
-				BT_ERR("Can't claim isoc interface");
-			else if (usb_set_interface(udev, isoc_ifnum, isoc_alts)) {
-				BT_ERR("Can't set isoc interface settings");
-				husb->isoc_iface = isoc_iface;
-				usb_driver_release_interface(&hci_usb_driver, isoc_iface);
-				husb->isoc_iface = NULL;
-			} else {
-				husb->isoc_iface  = isoc_iface;
-				husb->isoc_in_ep  = isoc_in_ep;
-				husb->isoc_out_ep = isoc_out_ep;
-			}
-		}
-	}
-#endif
-
-	rwlock_init(&husb->completion_lock);
-
-	for (i = 0; i < 4; i++) {
-		skb_queue_head_init(&husb->transmit_q[i]);
-		_urb_queue_init(&husb->pending_q[i]);
-		_urb_queue_init(&husb->completed_q[i]);
-	}
-
-	/* Initialize and register HCI device */
-	hdev = hci_alloc_dev();
-	if (!hdev) {
-		BT_ERR("Can't allocate HCI device");
-		goto probe_error;
-	}
-
-	husb->hdev = hdev;
-
-	hdev->type = HCI_USB;
-	hdev->driver_data = husb;
-	SET_HCIDEV_DEV(hdev, &intf->dev);
-
-	hdev->open     = hci_usb_open;
-	hdev->close    = hci_usb_close;
-	hdev->flush    = hci_usb_flush;
-	hdev->send     = hci_usb_send_frame;
-	hdev->destruct = hci_usb_destruct;
-	hdev->notify   = hci_usb_notify;
-
-	hdev->owner = THIS_MODULE;
-
-	if (reset || id->driver_info & HCI_RESET)
-		set_bit(HCI_QUIRK_RESET_ON_INIT, &hdev->quirks);
-
-	if (force_scofix || id->driver_info & HCI_WRONG_SCO_MTU) {
-		if (!disable_scofix)
-			set_bit(HCI_QUIRK_FIXUP_BUFFER_SIZE, &hdev->quirks);
-	}
-
-	if (id->driver_info & HCI_SNIFFER) {
-		if (le16_to_cpu(udev->descriptor.bcdDevice) > 0x997)
-			set_bit(HCI_QUIRK_RAW_DEVICE, &hdev->quirks);
-	}
-
-	if (id->driver_info & HCI_BCM92035) {
-		unsigned char cmd[] = { 0x3b, 0xfc, 0x01, 0x00 };
-		struct sk_buff *skb;
-
-		skb = bt_skb_alloc(sizeof(cmd), GFP_KERNEL);
-		if (skb) {
-			memcpy(skb_put(skb, sizeof(cmd)), cmd, sizeof(cmd));
-			skb_queue_tail(&hdev->driver_init, skb);
-		}
-	}
-
-	if (hci_register_dev(hdev) < 0) {
-		BT_ERR("Can't register HCI device");
-		hci_free_dev(hdev);
-		goto probe_error;
-	}
-
-	usb_set_intfdata(intf, husb);
-	return 0;
-
-probe_error:
-	if (husb->isoc_iface)
-		usb_driver_release_interface(&hci_usb_driver, husb->isoc_iface);
-	kfree(husb);
-
-done:
-	return -EIO;
-}
-
-static void hci_usb_disconnect(struct usb_interface *intf)
-{
-	struct hci_usb *husb = usb_get_intfdata(intf);
-	struct hci_dev *hdev;
-
-	if (!husb || intf == husb->isoc_iface)
-		return;
-
-	usb_set_intfdata(intf, NULL);
-	hdev = husb->hdev;
-
-	BT_DBG("%s", hdev->name);
-
-	hci_usb_close(hdev);
-
-	if (husb->isoc_iface)
-		usb_driver_release_interface(&hci_usb_driver, husb->isoc_iface);
-
-	if (hci_unregister_dev(hdev) < 0)
-		BT_ERR("Can't unregister HCI device %s", hdev->name);
-
-	hci_free_dev(hdev);
-}
-
-static int hci_usb_suspend(struct usb_interface *intf, pm_message_t message)
-{
-	struct hci_usb *husb = usb_get_intfdata(intf);
-	struct list_head killed;
-	unsigned long flags;
-	int i;
-
-	if (!husb || intf == husb->isoc_iface)
-		return 0;
-
-	hci_suspend_dev(husb->hdev);
-
-	INIT_LIST_HEAD(&killed);
-
-	for (i = 0; i < 4; i++) {
-		struct _urb_queue *q = &husb->pending_q[i];
-		struct _urb *_urb, *_tmp;
-
-		while ((_urb = _urb_dequeue(q))) {
-			/* reset queue since _urb_dequeue sets it to NULL */
-			_urb->queue = q;
-			usb_kill_urb(&_urb->urb);
-			list_add(&_urb->list, &killed);
-		}
-
-		spin_lock_irqsave(&q->lock, flags);
-
-		list_for_each_entry_safe(_urb, _tmp, &killed, list) {
-			list_move_tail(&_urb->list, &q->head);
-		}
-
-		spin_unlock_irqrestore(&q->lock, flags);
-	}
-
-	return 0;
-}
-
-static int hci_usb_resume(struct usb_interface *intf)
-{
-	struct hci_usb *husb = usb_get_intfdata(intf);
-	unsigned long flags;
-	int i, err = 0;
-
-	if (!husb || intf == husb->isoc_iface)
-		return 0;
-	
-	for (i = 0; i < 4; i++) {
-		struct _urb_queue *q = &husb->pending_q[i];
-		struct _urb *_urb;
-
-		spin_lock_irqsave(&q->lock, flags);
-
-		list_for_each_entry(_urb, &q->head, list) {
-			err = usb_submit_urb(&_urb->urb, GFP_ATOMIC);
-			if (err)
-				break;
-		}
-
-		spin_unlock_irqrestore(&q->lock, flags);
-
-		if (err)
-			return -EIO;
-	}
-
-	hci_resume_dev(husb->hdev);
-
-	return 0;
-}
-
-static struct usb_driver hci_usb_driver = {
-	.name		= "hci_usb",
-	.probe		= hci_usb_probe,
-	.disconnect	= hci_usb_disconnect,
-	.suspend	= hci_usb_suspend,
-	.resume		= hci_usb_resume,
-	.id_table	= bluetooth_ids,
-};
-
-static int __init hci_usb_init(void)
-{
-	int err;
-
-	BT_INFO("HCI USB driver ver %s", VERSION);
-
-	if ((err = usb_register(&hci_usb_driver)) < 0)
-		BT_ERR("Failed to register HCI USB driver");
-
-	return err;
-}
-
-static void __exit hci_usb_exit(void)
-{
-	usb_deregister(&hci_usb_driver);
-}
-
-module_init(hci_usb_init);
-module_exit(hci_usb_exit);
-
-module_param(ignore_dga, bool, 0644);
-MODULE_PARM_DESC(ignore_dga, "Ignore devices with id 08fd:0001");
-
-module_param(ignore_csr, bool, 0644);
-MODULE_PARM_DESC(ignore_csr, "Ignore devices with id 0a12:0001");
-
-module_param(ignore_sniffer, bool, 0644);
-MODULE_PARM_DESC(ignore_sniffer, "Ignore devices with id 0a12:0002");
-
-module_param(disable_scofix, bool, 0644);
-MODULE_PARM_DESC(disable_scofix, "Disable fixup of wrong SCO buffer size");
-
-module_param(force_scofix, bool, 0644);
-MODULE_PARM_DESC(force_scofix, "Force fixup of wrong SCO buffers size");
-
-module_param(reset, bool, 0644);
-MODULE_PARM_DESC(reset, "Send HCI reset command on initialization");
-
-#ifdef CONFIG_BT_HCIUSB_SCO
-module_param(isoc, int, 0644);
-MODULE_PARM_DESC(isoc, "Set isochronous transfers for SCO over HCI support");
-#endif
-
-MODULE_AUTHOR("Marcel Holtmann <marcel@holtmann.org>");
-MODULE_DESCRIPTION("Bluetooth HCI USB driver ver " VERSION);
-MODULE_VERSION(VERSION);
-MODULE_LICENSE("GPL");

+ 0 - 129
drivers/bluetooth/hci_usb.h

@@ -1,129 +0,0 @@
-/* 
-   HCI USB driver for Linux Bluetooth protocol stack (BlueZ)
-   Copyright (C) 2000-2001 Qualcomm Incorporated
-   Written 2000,2001 by Maxim Krasnyansky <maxk@qualcomm.com>
-
-   Copyright (C) 2003 Maxim Krasnyansky <maxk@qualcomm.com>
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License version 2 as
-   published by the Free Software Foundation;
-
-   THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
-   OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-   FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
-   IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
-   CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES 
-   WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN 
-   ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF 
-   OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
-
-   ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS, 
-   COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS 
-   SOFTWARE IS DISCLAIMED.
-*/
-
-/* Class, SubClass, and Protocol codes that describe a Bluetooth device */
-#define HCI_DEV_CLASS		0xe0	/* Wireless class */
-#define HCI_DEV_SUBCLASS	0x01	/* RF subclass */
-#define HCI_DEV_PROTOCOL	0x01	/* Bluetooth programming protocol */
-
-#define HCI_IGNORE		0x01
-#define HCI_RESET		0x02
-#define HCI_DIGIANSWER		0x04
-#define HCI_CSR			0x08
-#define HCI_SNIFFER		0x10
-#define HCI_BCM92035		0x20
-#define HCI_BROKEN_ISOC		0x40
-#define HCI_WRONG_SCO_MTU	0x80
-
-#define HCI_MAX_IFACE_NUM	3
-
-#define HCI_MAX_BULK_TX		4
-#define HCI_MAX_BULK_RX		1
-
-#define HCI_MAX_ISOC_RX		2
-#define HCI_MAX_ISOC_TX		2
-
-#define HCI_MAX_ISOC_FRAMES	10
-
-struct _urb_queue {
-	struct list_head head;
-	spinlock_t       lock;
-};
-
-struct _urb {
-	struct list_head  list;
-	struct _urb_queue *queue;
-	int               type;
-	void              *priv;
-	struct urb        urb;
-};
-
-static inline void _urb_queue_init(struct _urb_queue *q)
-{
-	INIT_LIST_HEAD(&q->head);
-	spin_lock_init(&q->lock);
-}
-
-static inline void _urb_queue_head(struct _urb_queue *q, struct _urb *_urb)
-{
-	unsigned long flags;
-	spin_lock_irqsave(&q->lock, flags);
-	/* _urb_unlink needs to know which spinlock to use, thus smp_mb(). */
-	_urb->queue = q; smp_mb(); list_add(&_urb->list, &q->head);
-	spin_unlock_irqrestore(&q->lock, flags);
-}
-
-static inline void _urb_queue_tail(struct _urb_queue *q, struct _urb *_urb)
-{
-	unsigned long flags;
-	spin_lock_irqsave(&q->lock, flags);
-	/* _urb_unlink needs to know which spinlock to use, thus smp_mb(). */
-	_urb->queue = q; smp_mb(); list_add_tail(&_urb->list, &q->head);
-	spin_unlock_irqrestore(&q->lock, flags);
-}
-
-static inline void _urb_unlink(struct _urb *_urb)
-{
-	struct _urb_queue *q;
-	unsigned long flags;
-
-	smp_mb();
-	q = _urb->queue;
-	/* If q is NULL, it will die at easy-to-debug NULL pointer dereference.
-	   No need to BUG(). */
-	spin_lock_irqsave(&q->lock, flags);
-	list_del(&_urb->list); _urb->queue = NULL;
-	spin_unlock_irqrestore(&q->lock, flags);
-}
-
-struct hci_usb {
-	struct hci_dev		*hdev;
-
-	unsigned long		state;
-
-	struct usb_device	*udev;
-
-	struct usb_host_endpoint	*bulk_in_ep;
-	struct usb_host_endpoint	*bulk_out_ep;
-	struct usb_host_endpoint	*intr_in_ep;
-
-	struct usb_interface		*isoc_iface;
-	struct usb_host_endpoint	*isoc_out_ep;
-	struct usb_host_endpoint	*isoc_in_ep;
-
-	__u8			ctrl_req;
-
-	struct sk_buff_head	transmit_q[4];
-
-	rwlock_t		completion_lock;
-
-	atomic_t		pending_tx[4];		/* Number of pending requests */
-	struct _urb_queue	pending_q[4];		/* Pending requests */
-	struct _urb_queue	completed_q[4];		/* Completed requests */
-};
-
-/* States  */
-#define HCI_USB_TX_PROCESS	1
-#define HCI_USB_TX_WAKEUP	2

+ 0 - 5
drivers/bluetooth/hci_vhci.c

@@ -40,11 +40,6 @@
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/bluetooth.h>
 #include <net/bluetooth/hci_core.h>
 #include <net/bluetooth/hci_core.h>
 
 
-#ifndef CONFIG_BT_HCIVHCI_DEBUG
-#undef  BT_DBG
-#define BT_DBG(D...)
-#endif
-
 #define VERSION "1.2"
 #define VERSION "1.2"
 
 
 static int minor = MISC_DYNAMIC_MINOR;
 static int minor = MISC_DYNAMIC_MINOR;

+ 2 - 5
drivers/firmware/iscsi_ibft.c

@@ -284,15 +284,12 @@ static ssize_t sprintf_ipaddr(char *buf, u8 *ip)
 		/*
 		/*
 		 * IPV4
 		 * IPV4
 		 */
 		 */
-		str += sprintf(buf, NIPQUAD_FMT, ip[12],
-			       ip[13], ip[14], ip[15]);
+		str += sprintf(buf, "%pI4", ip + 12);
 	} else {
 	} else {
 		/*
 		/*
 		 * IPv6
 		 * IPv6
 		 */
 		 */
-		str += sprintf(str, NIP6_FMT, ntohs(ip[0]), ntohs(ip[1]),
-			       ntohs(ip[2]), ntohs(ip[3]), ntohs(ip[4]),
-			       ntohs(ip[5]), ntohs(ip[6]), ntohs(ip[7]));
+		str += sprintf(str, "%pI6", ip);
 	}
 	}
 	str += sprintf(str, "\n");
 	str += sprintf(str, "\n");
 	return str - buf;
 	return str - buf;

+ 1 - 9
drivers/infiniband/core/sysfs.c

@@ -262,15 +262,7 @@ static ssize_t show_port_gid(struct ib_port *p, struct port_attribute *attr,
 	if (ret)
 	if (ret)
 		return ret;
 		return ret;
 
 
-	return sprintf(buf, "%04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x\n",
-		       be16_to_cpu(((__be16 *) gid.raw)[0]),
-		       be16_to_cpu(((__be16 *) gid.raw)[1]),
-		       be16_to_cpu(((__be16 *) gid.raw)[2]),
-		       be16_to_cpu(((__be16 *) gid.raw)[3]),
-		       be16_to_cpu(((__be16 *) gid.raw)[4]),
-		       be16_to_cpu(((__be16 *) gid.raw)[5]),
-		       be16_to_cpu(((__be16 *) gid.raw)[6]),
-		       be16_to_cpu(((__be16 *) gid.raw)[7]));
+	return sprintf(buf, "%pI6\n", gid.raw);
 }
 }
 
 
 static ssize_t show_port_pkey(struct ib_port *p, struct port_attribute *attr,
 static ssize_t show_port_pkey(struct ib_port *p, struct port_attribute *attr,

+ 4 - 4
drivers/infiniband/hw/amso1100/c2_provider.c

@@ -653,7 +653,7 @@ static int c2_service_destroy(struct iw_cm_id *cm_id)
 static int c2_pseudo_up(struct net_device *netdev)
 static int c2_pseudo_up(struct net_device *netdev)
 {
 {
 	struct in_device *ind;
 	struct in_device *ind;
-	struct c2_dev *c2dev = netdev->priv;
+	struct c2_dev *c2dev = netdev->ml_priv;
 
 
 	ind = in_dev_get(netdev);
 	ind = in_dev_get(netdev);
 	if (!ind)
 	if (!ind)
@@ -678,7 +678,7 @@ static int c2_pseudo_up(struct net_device *netdev)
 static int c2_pseudo_down(struct net_device *netdev)
 static int c2_pseudo_down(struct net_device *netdev)
 {
 {
 	struct in_device *ind;
 	struct in_device *ind;
-	struct c2_dev *c2dev = netdev->priv;
+	struct c2_dev *c2dev = netdev->ml_priv;
 
 
 	ind = in_dev_get(netdev);
 	ind = in_dev_get(netdev);
 	if (!ind)
 	if (!ind)
@@ -746,14 +746,14 @@ static struct net_device *c2_pseudo_netdev_init(struct c2_dev *c2dev)
 	/* change ethxxx to iwxxx */
 	/* change ethxxx to iwxxx */
 	strcpy(name, "iw");
 	strcpy(name, "iw");
 	strcat(name, &c2dev->netdev->name[3]);
 	strcat(name, &c2dev->netdev->name[3]);
-	netdev = alloc_netdev(sizeof(*netdev), name, setup);
+	netdev = alloc_netdev(0, name, setup);
 	if (!netdev) {
 	if (!netdev) {
 		printk(KERN_ERR PFX "%s -  etherdev alloc failed",
 		printk(KERN_ERR PFX "%s -  etherdev alloc failed",
 			__func__);
 			__func__);
 		return NULL;
 		return NULL;
 	}
 	}
 
 
-	netdev->priv = c2dev;
+	netdev->ml_priv = c2dev;
 
 
 	SET_NETDEV_DEV(netdev, &c2dev->pcidev->dev);
 	SET_NETDEV_DEV(netdev, &c2dev->pcidev->dev);
 
 

+ 2 - 21
drivers/infiniband/hw/mthca/mthca_mcg.c

@@ -87,17 +87,7 @@ static int find_mgm(struct mthca_dev *dev,
 	}
 	}
 
 
 	if (0)
 	if (0)
-		mthca_dbg(dev, "Hash for %04x:%04x:%04x:%04x:"
-			  "%04x:%04x:%04x:%04x is %04x\n",
-			  be16_to_cpu(((__be16 *) gid)[0]),
-			  be16_to_cpu(((__be16 *) gid)[1]),
-			  be16_to_cpu(((__be16 *) gid)[2]),
-			  be16_to_cpu(((__be16 *) gid)[3]),
-			  be16_to_cpu(((__be16 *) gid)[4]),
-			  be16_to_cpu(((__be16 *) gid)[5]),
-			  be16_to_cpu(((__be16 *) gid)[6]),
-			  be16_to_cpu(((__be16 *) gid)[7]),
-			  *hash);
+		mthca_dbg(dev, "Hash for %pI6 is %04x\n", gid, *hash);
 
 
 	*index = *hash;
 	*index = *hash;
 	*prev  = -1;
 	*prev  = -1;
@@ -264,16 +254,7 @@ int mthca_multicast_detach(struct ib_qp *ibqp, union ib_gid *gid, u16 lid)
 		goto out;
 		goto out;
 
 
 	if (index == -1) {
 	if (index == -1) {
-		mthca_err(dev, "MGID %04x:%04x:%04x:%04x:%04x:%04x:%04x:%04x "
-			  "not found\n",
-			  be16_to_cpu(((__be16 *) gid->raw)[0]),
-			  be16_to_cpu(((__be16 *) gid->raw)[1]),
-			  be16_to_cpu(((__be16 *) gid->raw)[2]),
-			  be16_to_cpu(((__be16 *) gid->raw)[3]),
-			  be16_to_cpu(((__be16 *) gid->raw)[4]),
-			  be16_to_cpu(((__be16 *) gid->raw)[5]),
-			  be16_to_cpu(((__be16 *) gid->raw)[6]),
-			  be16_to_cpu(((__be16 *) gid->raw)[7]));
+		mthca_err(dev, "MGID %pI6 not found\n", gid->raw);
 		err = -EINVAL;
 		err = -EINVAL;
 		goto out;
 		goto out;
 	}
 	}

+ 5 - 12
drivers/infiniband/hw/nes/nes.c

@@ -142,14 +142,9 @@ static int nes_inetaddr_event(struct notifier_block *notifier,
 	struct nes_device *nesdev;
 	struct nes_device *nesdev;
 	struct net_device *netdev;
 	struct net_device *netdev;
 	struct nes_vnic *nesvnic;
 	struct nes_vnic *nesvnic;
-	unsigned int addr;
-	unsigned int mask;
-
-	addr = ntohl(ifa->ifa_address);
-	mask = ntohl(ifa->ifa_mask);
-	nes_debug(NES_DBG_NETDEV, "nes_inetaddr_event: ip address " NIPQUAD_FMT
-		  ", netmask " NIPQUAD_FMT ".\n",
-		  HIPQUAD(addr), HIPQUAD(mask));
+
+	nes_debug(NES_DBG_NETDEV, "nes_inetaddr_event: ip address %pI4, netmask %pI4.\n",
+		  &ifa->ifa_address, &ifa->ifa_mask);
 	list_for_each_entry(nesdev, &nes_dev_list, list) {
 	list_for_each_entry(nesdev, &nes_dev_list, list) {
 		nes_debug(NES_DBG_NETDEV, "Nesdev list entry = 0x%p. (%s)\n",
 		nes_debug(NES_DBG_NETDEV, "Nesdev list entry = 0x%p. (%s)\n",
 				nesdev, nesdev->netdev[0]->name);
 				nesdev, nesdev->netdev[0]->name);
@@ -360,10 +355,8 @@ struct ib_qp *nes_get_qp(struct ib_device *device, int qpn)
  */
  */
 static void nes_print_macaddr(struct net_device *netdev)
 static void nes_print_macaddr(struct net_device *netdev)
 {
 {
-	DECLARE_MAC_BUF(mac);
-
-	nes_debug(NES_DBG_INIT, "%s: %s, IRQ %u\n",
-		  netdev->name, print_mac(mac, netdev->dev_addr), netdev->irq);
+	nes_debug(NES_DBG_INIT, "%s: %pM, IRQ %u\n",
+		  netdev->name, netdev->dev_addr, netdev->irq);
 }
 }
 
 
 /**
 /**

+ 13 - 18
drivers/infiniband/hw/nes/nes_cm.c

@@ -782,8 +782,8 @@ static struct nes_cm_node *find_node(struct nes_cm_core *cm_core,
 	/* get a handle on the hte */
 	/* get a handle on the hte */
 	hte = &cm_core->connected_nodes;
 	hte = &cm_core->connected_nodes;
 
 
-	nes_debug(NES_DBG_CM, "Searching for an owner node: " NIPQUAD_FMT ":%x from core %p->%p\n",
-		  HIPQUAD(loc_addr), loc_port, cm_core, hte);
+	nes_debug(NES_DBG_CM, "Searching for an owner node: %pI4:%x from core %p->%p\n",
+		  &loc_addr, loc_port, cm_core, hte);
 
 
 	/* walk list and find cm_node associated with this session ID */
 	/* walk list and find cm_node associated with this session ID */
 	spin_lock_irqsave(&cm_core->ht_lock, flags);
 	spin_lock_irqsave(&cm_core->ht_lock, flags);
@@ -832,8 +832,8 @@ static struct nes_cm_listener *find_listener(struct nes_cm_core *cm_core,
 	}
 	}
 	spin_unlock_irqrestore(&cm_core->listen_list_lock, flags);
 	spin_unlock_irqrestore(&cm_core->listen_list_lock, flags);
 
 
-	nes_debug(NES_DBG_CM, "Unable to find listener for " NIPQUAD_FMT ":%x\n",
-		  HIPQUAD(dst_addr), dst_port);
+	nes_debug(NES_DBG_CM, "Unable to find listener for %pI4:%x\n",
+		  &dst_addr, dst_port);
 
 
 	/* no listener */
 	/* no listener */
 	return NULL;
 	return NULL;
@@ -988,7 +988,6 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip)
 	struct flowi fl;
 	struct flowi fl;
 	struct neighbour *neigh;
 	struct neighbour *neigh;
 	int rc = -1;
 	int rc = -1;
-	DECLARE_MAC_BUF(mac);
 
 
 	memset(&fl, 0, sizeof fl);
 	memset(&fl, 0, sizeof fl);
 	fl.nl_u.ip4_u.daddr = htonl(dst_ip);
 	fl.nl_u.ip4_u.daddr = htonl(dst_ip);
@@ -1002,8 +1001,8 @@ static int nes_addr_resolve_neigh(struct nes_vnic *nesvnic, u32 dst_ip)
 	if (neigh) {
 	if (neigh) {
 		if (neigh->nud_state & NUD_VALID) {
 		if (neigh->nud_state & NUD_VALID) {
 			nes_debug(NES_DBG_CM, "Neighbor MAC address for 0x%08X"
 			nes_debug(NES_DBG_CM, "Neighbor MAC address for 0x%08X"
-				  " is %s, Gateway is 0x%08X \n", dst_ip,
-				  print_mac(mac, neigh->ha), ntohl(rt->rt_gateway));
+				  " is %pM, Gateway is 0x%08X \n", dst_ip,
+				  neigh->ha, ntohl(rt->rt_gateway));
 			nes_manage_arp_cache(nesvnic->netdev, neigh->ha,
 			nes_manage_arp_cache(nesvnic->netdev, neigh->ha,
 					     dst_ip, NES_ARP_ADD);
 					     dst_ip, NES_ARP_ADD);
 			rc = nes_arp_table(nesvnic->nesdev, dst_ip, NULL,
 			rc = nes_arp_table(nesvnic->nesdev, dst_ip, NULL,
@@ -1032,7 +1031,6 @@ static struct nes_cm_node *make_cm_node(struct nes_cm_core *cm_core,
 	int arpindex = 0;
 	int arpindex = 0;
 	struct nes_device *nesdev;
 	struct nes_device *nesdev;
 	struct nes_adapter *nesadapter;
 	struct nes_adapter *nesadapter;
-	DECLARE_MAC_BUF(mac);
 
 
 	/* create an hte and cm_node for this instance */
 	/* create an hte and cm_node for this instance */
 	cm_node = kzalloc(sizeof(*cm_node), GFP_ATOMIC);
 	cm_node = kzalloc(sizeof(*cm_node), GFP_ATOMIC);
@@ -1045,10 +1043,9 @@ static struct nes_cm_node *make_cm_node(struct nes_cm_core *cm_core,
 	cm_node->loc_port = cm_info->loc_port;
 	cm_node->loc_port = cm_info->loc_port;
 	cm_node->rem_port = cm_info->rem_port;
 	cm_node->rem_port = cm_info->rem_port;
 	cm_node->send_write0 = send_first;
 	cm_node->send_write0 = send_first;
-	nes_debug(NES_DBG_CM, "Make node addresses : loc = " NIPQUAD_FMT
-			":%x, rem = " NIPQUAD_FMT ":%x\n",
-			HIPQUAD(cm_node->loc_addr), cm_node->loc_port,
-			HIPQUAD(cm_node->rem_addr), cm_node->rem_port);
+	nes_debug(NES_DBG_CM, "Make node addresses : loc = %pI4:%x, rem = %pI4:%x\n",
+		  &cm_node->loc_addr, cm_node->loc_port,
+		  &cm_node->rem_addr, cm_node->rem_port);
 	cm_node->listener = listener;
 	cm_node->listener = listener;
 	cm_node->netdev = nesvnic->netdev;
 	cm_node->netdev = nesvnic->netdev;
 	cm_node->cm_id = cm_info->cm_id;
 	cm_node->cm_id = cm_info->cm_id;
@@ -1101,8 +1098,8 @@ static struct nes_cm_node *make_cm_node(struct nes_cm_core *cm_core,
 
 
 	/* copy the mac addr to node context */
 	/* copy the mac addr to node context */
 	memcpy(cm_node->rem_mac, nesadapter->arp_table[arpindex].mac_addr, ETH_ALEN);
 	memcpy(cm_node->rem_mac, nesadapter->arp_table[arpindex].mac_addr, ETH_ALEN);
-	nes_debug(NES_DBG_CM, "Remote mac addr from arp table: %s\n",
-		  print_mac(mac, cm_node->rem_mac));
+	nes_debug(NES_DBG_CM, "Remote mac addr from arp table: %pM\n",
+		  cm_node->rem_mac);
 
 
 	add_hte_node(cm_core, cm_node);
 	add_hte_node(cm_core, cm_node);
 	atomic_inc(&cm_nodes_created);
 	atomic_inc(&cm_nodes_created);
@@ -2077,10 +2074,8 @@ static int mini_cm_recv_pkt(struct nes_cm_core *cm_core,
 	nfo.rem_addr = ntohl(iph->saddr);
 	nfo.rem_addr = ntohl(iph->saddr);
 	nfo.rem_port = ntohs(tcph->source);
 	nfo.rem_port = ntohs(tcph->source);
 
 
-	nes_debug(NES_DBG_CM, "Received packet: dest=" NIPQUAD_FMT
-		  ":0x%04X src=" NIPQUAD_FMT ":0x%04X\n",
-		  NIPQUAD(iph->daddr), tcph->dest,
-		  NIPQUAD(iph->saddr), tcph->source);
+	nes_debug(NES_DBG_CM, "Received packet: dest=%pI4:0x%04X src=%pI4:0x%04X\n",
+		  &iph->daddr, tcph->dest, &iph->saddr, tcph->source);
 
 
 	do {
 	do {
 		cm_node = find_node(cm_core,
 		cm_node = find_node(cm_core,

+ 1 - 1
drivers/infiniband/hw/nes/nes_hw.c

@@ -2541,7 +2541,7 @@ static void nes_nic_napi_ce_handler(struct nes_device *nesdev, struct nes_hw_nic
 {
 {
 	struct nes_vnic *nesvnic = container_of(cq, struct nes_vnic, nic_cq);
 	struct nes_vnic *nesvnic = container_of(cq, struct nes_vnic, nic_cq);
 
 
-	netif_rx_schedule(nesdev->netdev[nesvnic->netdev_index], &nesvnic->napi);
+	netif_rx_schedule(&nesvnic->napi);
 }
 }
 
 
 
 

+ 5 - 8
drivers/infiniband/hw/nes/nes_nic.c

@@ -99,7 +99,6 @@ static int nics_per_function = 1;
 static int nes_netdev_poll(struct napi_struct *napi, int budget)
 static int nes_netdev_poll(struct napi_struct *napi, int budget)
 {
 {
 	struct nes_vnic *nesvnic = container_of(napi, struct nes_vnic, napi);
 	struct nes_vnic *nesvnic = container_of(napi, struct nes_vnic, napi);
-	struct net_device *netdev = nesvnic->netdev;
 	struct nes_device *nesdev = nesvnic->nesdev;
 	struct nes_device *nesdev = nesvnic->nesdev;
 	struct nes_hw_nic_cq *nescq = &nesvnic->nic_cq;
 	struct nes_hw_nic_cq *nescq = &nesvnic->nic_cq;
 
 
@@ -112,7 +111,7 @@ static int nes_netdev_poll(struct napi_struct *napi, int budget)
 	nes_nic_ce_handler(nesdev, nescq);
 	nes_nic_ce_handler(nesdev, nescq);
 
 
 	if (nescq->cqes_pending == 0) {
 	if (nescq->cqes_pending == 0) {
-		netif_rx_complete(netdev, napi);
+		netif_rx_complete(napi);
 		/* clear out completed cqes and arm */
 		/* clear out completed cqes and arm */
 		nes_write32(nesdev->regs+NES_CQE_ALLOC, NES_CQE_ALLOC_NOTIFY_NEXT |
 		nes_write32(nesdev->regs+NES_CQE_ALLOC, NES_CQE_ALLOC_NOTIFY_NEXT |
 				nescq->cq_number | (nescq->cqe_allocs_pending << 16));
 				nescq->cq_number | (nescq->cqe_allocs_pending << 16));
@@ -797,14 +796,13 @@ static int nes_netdev_set_mac_address(struct net_device *netdev, void *p)
 	int i;
 	int i;
 	u32 macaddr_low;
 	u32 macaddr_low;
 	u16 macaddr_high;
 	u16 macaddr_high;
-	DECLARE_MAC_BUF(mac);
 
 
 	if (!is_valid_ether_addr(mac_addr->sa_data))
 	if (!is_valid_ether_addr(mac_addr->sa_data))
 		return -EADDRNOTAVAIL;
 		return -EADDRNOTAVAIL;
 
 
 	memcpy(netdev->dev_addr, mac_addr->sa_data, netdev->addr_len);
 	memcpy(netdev->dev_addr, mac_addr->sa_data, netdev->addr_len);
-	printk(PFX "%s: Address length = %d, Address = %s\n",
-	       __func__, netdev->addr_len, print_mac(mac, mac_addr->sa_data));
+	printk(PFX "%s: Address length = %d, Address = %pM\n",
+	       __func__, netdev->addr_len, mac_addr->sa_data);
 	macaddr_high  = ((u16)netdev->dev_addr[0]) << 8;
 	macaddr_high  = ((u16)netdev->dev_addr[0]) << 8;
 	macaddr_high += (u16)netdev->dev_addr[1];
 	macaddr_high += (u16)netdev->dev_addr[1];
 	macaddr_low   = ((u32)netdev->dev_addr[2]) << 24;
 	macaddr_low   = ((u32)netdev->dev_addr[2]) << 24;
@@ -909,9 +907,8 @@ static void nes_netdev_set_multicast_list(struct net_device *netdev)
 			if (mc_index >= max_pft_entries_avaiable)
 			if (mc_index >= max_pft_entries_avaiable)
 				break;
 				break;
 			if (multicast_addr) {
 			if (multicast_addr) {
-				DECLARE_MAC_BUF(mac);
-				nes_debug(NES_DBG_NIC_RX, "Assigning MC Address %s to register 0x%04X nic_idx=%d\n",
-					  print_mac(mac, multicast_addr->dmi_addr),
+				nes_debug(NES_DBG_NIC_RX, "Assigning MC Address %pM to register 0x%04X nic_idx=%d\n",
+					  multicast_addr->dmi_addr,
 					  perfect_filter_register_address+(mc_index * 8),
 					  perfect_filter_register_address+(mc_index * 8),
 					  mc_nic_index);
 					  mc_nic_index);
 				macaddr_high  = ((u16)multicast_addr->dmi_addr[0]) << 8;
 				macaddr_high  = ((u16)multicast_addr->dmi_addr[0]) << 8;

+ 2 - 3
drivers/infiniband/hw/nes/nes_utils.c

@@ -682,9 +682,8 @@ int nes_arp_table(struct nes_device *nesdev, u32 ip_addr, u8 *mac_addr, u32 acti
 
 
 	/* DELETE or RESOLVE */
 	/* DELETE or RESOLVE */
 	if (arp_index == nesadapter->arp_table_size) {
 	if (arp_index == nesadapter->arp_table_size) {
-		nes_debug(NES_DBG_NETDEV, "MAC for " NIPQUAD_FMT " not in ARP table - cannot %s\n",
-			  HIPQUAD(ip_addr),
-			  action == NES_ARP_RESOLVE ? "resolve" : "delete");
+		nes_debug(NES_DBG_NETDEV, "MAC for %pI4 not in ARP table - cannot %s\n",
+			  &ip_addr, action == NES_ARP_RESOLVE ? "resolve" : "delete");
 		return -1;
 		return -1;
 	}
 	}
 
 

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است