aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@g5.osdl.org>2006-10-20 13:27:38 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-10-20 13:27:38 -0400
commitc1448791648d44ecbf8cadb192704e3e6eb3bb0e (patch)
tree606cb5289bc8770e925761c6e1617eb44a6dafef /drivers
parentac4e0aba7daf0a7c6ac20974070428481dc940f5 (diff)
parent7b19ffc40b0247fcfe083644fdb621fdb3c05ef6 (diff)
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6: (36 commits) [Bluetooth] Fix HID disconnect NULL pointer dereference [Bluetooth] Add missing entry for Nokia DTL-4 PCMCIA card [Bluetooth] Add support for newer ANYCOM USB dongles [NET]: Can use __get_cpu_var() instead of per_cpu() in loopback driver. [IPV4] inet_peer: Group together avl_left, avl_right, v4daddr to speedup lookups on some CPUS [TCP]: One NET_INC_STATS() could be NET_INC_STATS_BH in tcp_v4_err() [NETFILTER]: Missing check for CAP_NET_ADMIN in iptables compat layer [NETPOLL]: initialize skb for UDP [IPV6]: Fix route.c warnings when multiple tables are disabled. [TG3]: Bump driver version and release date. [TG3]: Add lower bound checks for tx ring size. [TG3]: Fix set ring params tx ring size implementation [NET]: reduce per cpu ram used for loopback stats [IPv6] route: Fix prohibit and blackhole routing decision [DECNET]: Fix input routing bug [TCP]: Bound TSO defer time [IPv4] fib: Remove unused fib_config members [IPV6]: Always copy rt->u.dst.error when copying a rt6_info. [IPV6]: Make IPV6_SUBTREES depend on IPV6_MULTIPLE_TABLES. [IPV6]: Clean up BACKTRACK(). ...
Diffstat (limited to 'drivers')
-rw-r--r--drivers/bluetooth/dtl1_cs.c1
-rw-r--r--drivers/bluetooth/hci_usb.c3
-rw-r--r--drivers/net/loopback.c39
-rw-r--r--drivers/net/tg3.c19
4 files changed, 36 insertions, 26 deletions
diff --git a/drivers/bluetooth/dtl1_cs.c b/drivers/bluetooth/dtl1_cs.c
index e7c800f4c3ad..07eafbc5dc3a 100644
--- a/drivers/bluetooth/dtl1_cs.c
+++ b/drivers/bluetooth/dtl1_cs.c
@@ -711,6 +711,7 @@ static void dtl1_release(struct pcmcia_device *link)
711 711
712static struct pcmcia_device_id dtl1_ids[] = { 712static struct pcmcia_device_id dtl1_ids[] = {
713 PCMCIA_DEVICE_PROD_ID12("Nokia Mobile Phones", "DTL-1", 0xe1bfdd64, 0xe168480d), 713 PCMCIA_DEVICE_PROD_ID12("Nokia Mobile Phones", "DTL-1", 0xe1bfdd64, 0xe168480d),
714 PCMCIA_DEVICE_PROD_ID12("Nokia Mobile Phones", "DTL-4", 0xe1bfdd64, 0x9102bc82),
714 PCMCIA_DEVICE_PROD_ID12("Socket", "CF", 0xb38bcc2e, 0x44ebf863), 715 PCMCIA_DEVICE_PROD_ID12("Socket", "CF", 0xb38bcc2e, 0x44ebf863),
715 PCMCIA_DEVICE_PROD_ID12("Socket", "CF+ Personal Network Card", 0xb38bcc2e, 0xe732bae3), 716 PCMCIA_DEVICE_PROD_ID12("Socket", "CF+ Personal Network Card", 0xb38bcc2e, 0xe732bae3),
716 PCMCIA_DEVICE_NULL 717 PCMCIA_DEVICE_NULL
diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c
index 7565642a007a..fdea58ae16b2 100644
--- a/drivers/bluetooth/hci_usb.c
+++ b/drivers/bluetooth/hci_usb.c
@@ -118,6 +118,9 @@ static struct usb_device_id blacklist_ids[] = {
118 /* IBM/Lenovo ThinkPad with Broadcom chip */ 118 /* IBM/Lenovo ThinkPad with Broadcom chip */
119 { USB_DEVICE(0x0a5c, 0x201e), .driver_info = HCI_WRONG_SCO_MTU }, 119 { USB_DEVICE(0x0a5c, 0x201e), .driver_info = HCI_WRONG_SCO_MTU },
120 120
121 /* ANYCOM Bluetooth USB-200 and USB-250 */
122 { USB_DEVICE(0x0a5c, 0x2111), .driver_info = HCI_RESET },
123
121 /* Microsoft Wireless Transceiver for Bluetooth 2.0 */ 124 /* Microsoft Wireless Transceiver for Bluetooth 2.0 */
122 { USB_DEVICE(0x045e, 0x009c), .driver_info = HCI_RESET }, 125 { USB_DEVICE(0x045e, 0x009c), .driver_info = HCI_RESET },
123 126
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c
index 4178b4b1d2df..82c10dec1b5a 100644
--- a/drivers/net/loopback.c
+++ b/drivers/net/loopback.c
@@ -58,7 +58,11 @@
58#include <linux/tcp.h> 58#include <linux/tcp.h>
59#include <linux/percpu.h> 59#include <linux/percpu.h>
60 60
61static DEFINE_PER_CPU(struct net_device_stats, loopback_stats); 61struct pcpu_lstats {
62 unsigned long packets;
63 unsigned long bytes;
64};
65static DEFINE_PER_CPU(struct pcpu_lstats, pcpu_lstats);
62 66
63#define LOOPBACK_OVERHEAD (128 + MAX_HEADER + 16 + 16) 67#define LOOPBACK_OVERHEAD (128 + MAX_HEADER + 16 + 16)
64 68
@@ -128,7 +132,7 @@ static void emulate_large_send_offload(struct sk_buff *skb)
128 */ 132 */
129static int loopback_xmit(struct sk_buff *skb, struct net_device *dev) 133static int loopback_xmit(struct sk_buff *skb, struct net_device *dev)
130{ 134{
131 struct net_device_stats *lb_stats; 135 struct pcpu_lstats *lb_stats;
132 136
133 skb_orphan(skb); 137 skb_orphan(skb);
134 138
@@ -149,16 +153,14 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev)
149#endif 153#endif
150 dev->last_rx = jiffies; 154 dev->last_rx = jiffies;
151 155
152 lb_stats = &per_cpu(loopback_stats, get_cpu()); 156 /* it's OK to use __get_cpu_var() because BHs are off */
153 lb_stats->rx_bytes += skb->len; 157 lb_stats = &__get_cpu_var(pcpu_lstats);
154 lb_stats->tx_bytes = lb_stats->rx_bytes; 158 lb_stats->bytes += skb->len;
155 lb_stats->rx_packets++; 159 lb_stats->packets++;
156 lb_stats->tx_packets = lb_stats->rx_packets;
157 put_cpu();
158 160
159 netif_rx(skb); 161 netif_rx(skb);
160 162
161 return(0); 163 return 0;
162} 164}
163 165
164static struct net_device_stats loopback_stats; 166static struct net_device_stats loopback_stats;
@@ -166,20 +168,21 @@ static struct net_device_stats loopback_stats;
166static struct net_device_stats *get_stats(struct net_device *dev) 168static struct net_device_stats *get_stats(struct net_device *dev)
167{ 169{
168 struct net_device_stats *stats = &loopback_stats; 170 struct net_device_stats *stats = &loopback_stats;
171 unsigned long bytes = 0;
172 unsigned long packets = 0;
169 int i; 173 int i;
170 174
171 memset(stats, 0, sizeof(struct net_device_stats));
172
173 for_each_possible_cpu(i) { 175 for_each_possible_cpu(i) {
174 struct net_device_stats *lb_stats; 176 const struct pcpu_lstats *lb_stats;
175 177
176 lb_stats = &per_cpu(loopback_stats, i); 178 lb_stats = &per_cpu(pcpu_lstats, i);
177 stats->rx_bytes += lb_stats->rx_bytes; 179 bytes += lb_stats->bytes;
178 stats->tx_bytes += lb_stats->tx_bytes; 180 packets += lb_stats->packets;
179 stats->rx_packets += lb_stats->rx_packets;
180 stats->tx_packets += lb_stats->tx_packets;
181 } 181 }
182 182 stats->rx_packets = packets;
183 stats->tx_packets = packets;
184 stats->rx_bytes = bytes;
185 stats->tx_bytes = bytes;
183 return stats; 186 return stats;
184} 187}
185 188
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 327836b1014e..8e398499c045 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -68,8 +68,8 @@
68 68
69#define DRV_MODULE_NAME "tg3" 69#define DRV_MODULE_NAME "tg3"
70#define PFX DRV_MODULE_NAME ": " 70#define PFX DRV_MODULE_NAME ": "
71#define DRV_MODULE_VERSION "3.66" 71#define DRV_MODULE_VERSION "3.67"
72#define DRV_MODULE_RELDATE "September 23, 2006" 72#define DRV_MODULE_RELDATE "October 18, 2006"
73 73
74#define TG3_DEF_MAC_MODE 0 74#define TG3_DEF_MAC_MODE 0
75#define TG3_DEF_RX_MODE 0 75#define TG3_DEF_RX_MODE 0
@@ -129,7 +129,7 @@
129#define RX_JUMBO_PKT_BUF_SZ (9046 + tp->rx_offset + 64) 129#define RX_JUMBO_PKT_BUF_SZ (9046 + tp->rx_offset + 64)
130 130
131/* minimum number of free TX descriptors required to wake up TX process */ 131/* minimum number of free TX descriptors required to wake up TX process */
132#define TG3_TX_WAKEUP_THRESH (TG3_TX_RING_SIZE / 4) 132#define TG3_TX_WAKEUP_THRESH(tp) ((tp)->tx_pending / 4)
133 133
134/* number of ETHTOOL_GSTATS u64's */ 134/* number of ETHTOOL_GSTATS u64's */
135#define TG3_NUM_STATS (sizeof(struct tg3_ethtool_stats)/sizeof(u64)) 135#define TG3_NUM_STATS (sizeof(struct tg3_ethtool_stats)/sizeof(u64))
@@ -3075,10 +3075,10 @@ static void tg3_tx(struct tg3 *tp)
3075 smp_mb(); 3075 smp_mb();
3076 3076
3077 if (unlikely(netif_queue_stopped(tp->dev) && 3077 if (unlikely(netif_queue_stopped(tp->dev) &&
3078 (tg3_tx_avail(tp) > TG3_TX_WAKEUP_THRESH))) { 3078 (tg3_tx_avail(tp) > TG3_TX_WAKEUP_THRESH(tp)))) {
3079 netif_tx_lock(tp->dev); 3079 netif_tx_lock(tp->dev);
3080 if (netif_queue_stopped(tp->dev) && 3080 if (netif_queue_stopped(tp->dev) &&
3081 (tg3_tx_avail(tp) > TG3_TX_WAKEUP_THRESH)) 3081 (tg3_tx_avail(tp) > TG3_TX_WAKEUP_THRESH(tp)))
3082 netif_wake_queue(tp->dev); 3082 netif_wake_queue(tp->dev);
3083 netif_tx_unlock(tp->dev); 3083 netif_tx_unlock(tp->dev);
3084 } 3084 }
@@ -3928,7 +3928,7 @@ static int tg3_start_xmit(struct sk_buff *skb, struct net_device *dev)
3928 tp->tx_prod = entry; 3928 tp->tx_prod = entry;
3929 if (unlikely(tg3_tx_avail(tp) <= (MAX_SKB_FRAGS + 1))) { 3929 if (unlikely(tg3_tx_avail(tp) <= (MAX_SKB_FRAGS + 1))) {
3930 netif_stop_queue(dev); 3930 netif_stop_queue(dev);
3931 if (tg3_tx_avail(tp) > TG3_TX_WAKEUP_THRESH) 3931 if (tg3_tx_avail(tp) > TG3_TX_WAKEUP_THRESH(tp))
3932 netif_wake_queue(tp->dev); 3932 netif_wake_queue(tp->dev);
3933 } 3933 }
3934 3934
@@ -4143,7 +4143,7 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev)
4143 tp->tx_prod = entry; 4143 tp->tx_prod = entry;
4144 if (unlikely(tg3_tx_avail(tp) <= (MAX_SKB_FRAGS + 1))) { 4144 if (unlikely(tg3_tx_avail(tp) <= (MAX_SKB_FRAGS + 1))) {
4145 netif_stop_queue(dev); 4145 netif_stop_queue(dev);
4146 if (tg3_tx_avail(tp) > TG3_TX_WAKEUP_THRESH) 4146 if (tg3_tx_avail(tp) > TG3_TX_WAKEUP_THRESH(tp))
4147 netif_wake_queue(tp->dev); 4147 netif_wake_queue(tp->dev);
4148 } 4148 }
4149 4149
@@ -8106,7 +8106,10 @@ static int tg3_set_ringparam(struct net_device *dev, struct ethtool_ringparam *e
8106 8106
8107 if ((ering->rx_pending > TG3_RX_RING_SIZE - 1) || 8107 if ((ering->rx_pending > TG3_RX_RING_SIZE - 1) ||
8108 (ering->rx_jumbo_pending > TG3_RX_JUMBO_RING_SIZE - 1) || 8108 (ering->rx_jumbo_pending > TG3_RX_JUMBO_RING_SIZE - 1) ||
8109 (ering->tx_pending > TG3_TX_RING_SIZE - 1)) 8109 (ering->tx_pending > TG3_TX_RING_SIZE - 1) ||
8110 (ering->tx_pending <= MAX_SKB_FRAGS) ||
8111 ((tp->tg3_flags2 & TG3_FLG2_HW_TSO_1_BUG) &&
8112 (ering->tx_pending <= (MAX_SKB_FRAGS * 3))))
8110 return -EINVAL; 8113 return -EINVAL;
8111 8114
8112 if (netif_running(dev)) { 8115 if (netif_running(dev)) {