aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/atm/iphase.c7
-rw-r--r--drivers/atm/nicstar.c117
-rw-r--r--drivers/atm/nicstar.h12
-rw-r--r--drivers/bluetooth/hci_usb.c24
-rw-r--r--drivers/bluetooth/hci_usb.h5
-rw-r--r--drivers/net/appletalk/cops.c3
-rw-r--r--drivers/net/tg3.c52
-rw-r--r--drivers/net/tg3.h1
-rw-r--r--drivers/net/wireless/iwlwifi/iwl-debugfs.c18
9 files changed, 98 insertions, 141 deletions
diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
index 670c093ed25f..5c28ca7380ff 100644
--- a/drivers/atm/iphase.c
+++ b/drivers/atm/iphase.c
@@ -60,7 +60,8 @@
60#include <asm/uaccess.h> 60#include <asm/uaccess.h>
61#include <asm/string.h> 61#include <asm/string.h>
62#include <asm/byteorder.h> 62#include <asm/byteorder.h>
63#include <linux/vmalloc.h> 63#include <linux/vmalloc.h>
64#include <linux/jiffies.h>
64#include "iphase.h" 65#include "iphase.h"
65#include "suni.h" 66#include "suni.h"
66#define swap(x) (((x & 0xff) << 8) | ((x & 0xff00) >> 8)) 67#define swap(x) (((x & 0xff) << 8) | ((x & 0xff00) >> 8))
@@ -189,7 +190,7 @@ static u16 get_desc (IADEV *dev, struct ia_vcc *iavcc) {
189 int ltimeout; 190 int ltimeout;
190 191
191 ia_hack_tcq (dev); 192 ia_hack_tcq (dev);
192 if(((jiffies - timer)>50)||((dev->ffL.tcq_rd==dev->host_tcq_wr))){ 193 if((time_after(jiffies,timer+50)) || ((dev->ffL.tcq_rd==dev->host_tcq_wr))) {
193 timer = jiffies; 194 timer = jiffies;
194 i=0; 195 i=0;
195 while (i < dev->num_tx_desc) { 196 while (i < dev->num_tx_desc) {
@@ -1225,7 +1226,7 @@ static void rx_intr(struct atm_dev *dev)
1225 iadev->rx_tmp_jif = jiffies; 1226 iadev->rx_tmp_jif = jiffies;
1226 iadev->rxing = 0; 1227 iadev->rxing = 0;
1227 } 1228 }
1228 else if (((jiffies - iadev->rx_tmp_jif) > 50) && 1229 else if ((time_after(jiffies, iadev->rx_tmp_jif + 50)) &&
1229 ((iadev->rx_pkt_cnt - iadev->rx_tmp_cnt) == 0)) { 1230 ((iadev->rx_pkt_cnt - iadev->rx_tmp_cnt) == 0)) {
1230 for (i = 1; i <= iadev->num_rx_desc; i++) 1231 for (i = 1; i <= iadev->num_rx_desc; i++)
1231 free_desc(dev, i); 1232 free_desc(dev, i);
diff --git a/drivers/atm/nicstar.c b/drivers/atm/nicstar.c
index 0c205b000e8b..38c769f8d2b7 100644
--- a/drivers/atm/nicstar.c
+++ b/drivers/atm/nicstar.c
@@ -125,85 +125,6 @@
125#define ATM_SKB(s) (&(s)->atm) 125#define ATM_SKB(s) (&(s)->atm)
126#endif 126#endif
127 127
128 /* Spinlock debugging stuff */
129#ifdef NS_DEBUG_SPINLOCKS /* See nicstar.h */
130#define ns_grab_int_lock(card,flags) \
131 do { \
132 unsigned long nsdsf, nsdsf2; \
133 local_irq_save(flags); \
134 save_flags(nsdsf); cli();\
135 if (nsdsf & (1<<9)) printk ("nicstar.c: ints %sabled -> enabled.\n", \
136 (flags)&(1<<9)?"en":"dis"); \
137 if (spin_is_locked(&(card)->int_lock) && \
138 (card)->cpu_int == smp_processor_id()) { \
139 printk("nicstar.c: line %d (cpu %d) int_lock already locked at line %d (cpu %d)\n", \
140 __LINE__, smp_processor_id(), (card)->has_int_lock, \
141 (card)->cpu_int); \
142 printk("nicstar.c: ints were %sabled.\n", ((flags)&(1<<9)?"en":"dis")); \
143 } \
144 if (spin_is_locked(&(card)->res_lock) && \
145 (card)->cpu_res == smp_processor_id()) { \
146 printk("nicstar.c: line %d (cpu %d) res_lock locked at line %d (cpu %d)(trying int)\n", \
147 __LINE__, smp_processor_id(), (card)->has_res_lock, \
148 (card)->cpu_res); \
149 printk("nicstar.c: ints were %sabled.\n", ((flags)&(1<<9)?"en":"dis")); \
150 } \
151 spin_lock_irq(&(card)->int_lock); \
152 (card)->has_int_lock = __LINE__; \
153 (card)->cpu_int = smp_processor_id(); \
154 restore_flags(nsdsf); } while (0)
155#define ns_grab_res_lock(card,flags) \
156 do { \
157 unsigned long nsdsf, nsdsf2; \
158 local_irq_save(flags); \
159 save_flags(nsdsf); cli();\
160 if (nsdsf & (1<<9)) printk ("nicstar.c: ints %sabled -> enabled.\n", \
161 (flags)&(1<<9)?"en":"dis"); \
162 if (spin_is_locked(&(card)->res_lock) && \
163 (card)->cpu_res == smp_processor_id()) { \
164 printk("nicstar.c: line %d (cpu %d) res_lock already locked at line %d (cpu %d)\n", \
165 __LINE__, smp_processor_id(), (card)->has_res_lock, \
166 (card)->cpu_res); \
167 printk("nicstar.c: ints were %sabled.\n", ((flags)&(1<<9)?"en":"dis")); \
168 } \
169 spin_lock_irq(&(card)->res_lock); \
170 (card)->has_res_lock = __LINE__; \
171 (card)->cpu_res = smp_processor_id(); \
172 restore_flags(nsdsf); } while (0)
173#define ns_grab_scq_lock(card,scq,flags) \
174 do { \
175 unsigned long nsdsf, nsdsf2; \
176 local_irq_save(flags); \
177 save_flags(nsdsf); cli();\
178 if (nsdsf & (1<<9)) printk ("nicstar.c: ints %sabled -> enabled.\n", \
179 (flags)&(1<<9)?"en":"dis"); \
180 if (spin_is_locked(&(scq)->lock) && \
181 (scq)->cpu_lock == smp_processor_id()) { \
182 printk("nicstar.c: line %d (cpu %d) this scq_lock already locked at line %d (cpu %d)\n", \
183 __LINE__, smp_processor_id(), (scq)->has_lock, \
184 (scq)->cpu_lock); \
185 printk("nicstar.c: ints were %sabled.\n", ((flags)&(1<<9)?"en":"dis")); \
186 } \
187 if (spin_is_locked(&(card)->res_lock) && \
188 (card)->cpu_res == smp_processor_id()) { \
189 printk("nicstar.c: line %d (cpu %d) res_lock locked at line %d (cpu %d)(trying scq)\n", \
190 __LINE__, smp_processor_id(), (card)->has_res_lock, \
191 (card)->cpu_res); \
192 printk("nicstar.c: ints were %sabled.\n", ((flags)&(1<<9)?"en":"dis")); \
193 } \
194 spin_lock_irq(&(scq)->lock); \
195 (scq)->has_lock = __LINE__; \
196 (scq)->cpu_lock = smp_processor_id(); \
197 restore_flags(nsdsf); } while (0)
198#else /* !NS_DEBUG_SPINLOCKS */
199#define ns_grab_int_lock(card,flags) \
200 spin_lock_irqsave(&(card)->int_lock,(flags))
201#define ns_grab_res_lock(card,flags) \
202 spin_lock_irqsave(&(card)->res_lock,(flags))
203#define ns_grab_scq_lock(card,scq,flags) \
204 spin_lock_irqsave(&(scq)->lock,flags)
205#endif /* NS_DEBUG_SPINLOCKS */
206
207 128
208/* Function declarations ******************************************************/ 129/* Function declarations ******************************************************/
209 130
@@ -422,7 +343,7 @@ static u32 ns_read_sram(ns_dev *card, u32 sram_address)
422 sram_address <<= 2; 343 sram_address <<= 2;
423 sram_address &= 0x0007FFFC; /* address must be dword aligned */ 344 sram_address &= 0x0007FFFC; /* address must be dword aligned */
424 sram_address |= 0x50000000; /* SRAM read command */ 345 sram_address |= 0x50000000; /* SRAM read command */
425 ns_grab_res_lock(card, flags); 346 spin_lock_irqsave(&card->res_lock, flags);
426 while (CMD_BUSY(card)); 347 while (CMD_BUSY(card));
427 writel(sram_address, card->membase + CMD); 348 writel(sram_address, card->membase + CMD);
428 while (CMD_BUSY(card)); 349 while (CMD_BUSY(card));
@@ -440,7 +361,7 @@ static void ns_write_sram(ns_dev *card, u32 sram_address, u32 *value, int count)
440 count--; /* count range now is 0..3 instead of 1..4 */ 361 count--; /* count range now is 0..3 instead of 1..4 */
441 c = count; 362 c = count;
442 c <<= 2; /* to use increments of 4 */ 363 c <<= 2; /* to use increments of 4 */
443 ns_grab_res_lock(card, flags); 364 spin_lock_irqsave(&card->res_lock, flags);
444 while (CMD_BUSY(card)); 365 while (CMD_BUSY(card));
445 for (i = 0; i <= c; i += 4) 366 for (i = 0; i <= c; i += 4)
446 writel(*(value++), card->membase + i); 367 writel(*(value++), card->membase + i);
@@ -1166,7 +1087,7 @@ static void push_rxbufs(ns_dev *card, struct sk_buff *skb)
1166 card->lbfqc += 2; 1087 card->lbfqc += 2;
1167 } 1088 }
1168 1089
1169 ns_grab_res_lock(card, flags); 1090 spin_lock_irqsave(&card->res_lock, flags);
1170 1091
1171 while (CMD_BUSY(card)); 1092 while (CMD_BUSY(card));
1172 writel(addr2, card->membase + DR3); 1093 writel(addr2, card->membase + DR3);
@@ -1206,7 +1127,7 @@ static irqreturn_t ns_irq_handler(int irq, void *dev_id)
1206 1127
1207 PRINTK("nicstar%d: NICStAR generated an interrupt\n", card->index); 1128 PRINTK("nicstar%d: NICStAR generated an interrupt\n", card->index);
1208 1129
1209 ns_grab_int_lock(card, flags); 1130 spin_lock_irqsave(&card->int_lock, flags);
1210 1131
1211 stat_r = readl(card->membase + STAT); 1132 stat_r = readl(card->membase + STAT);
1212 1133
@@ -1585,7 +1506,7 @@ static void ns_close(struct atm_vcc *vcc)
1585 unsigned long flags; 1506 unsigned long flags;
1586 1507
1587 addr = NS_RCT + (vcc->vpi << card->vcibits | vcc->vci) * NS_RCT_ENTRY_SIZE; 1508 addr = NS_RCT + (vcc->vpi << card->vcibits | vcc->vci) * NS_RCT_ENTRY_SIZE;
1588 ns_grab_res_lock(card, flags); 1509 spin_lock_irqsave(&card->res_lock, flags);
1589 while(CMD_BUSY(card)); 1510 while(CMD_BUSY(card));
1590 writel(NS_CMD_CLOSE_CONNECTION | addr << 2, card->membase + CMD); 1511 writel(NS_CMD_CLOSE_CONNECTION | addr << 2, card->membase + CMD);
1591 spin_unlock_irqrestore(&card->res_lock, flags); 1512 spin_unlock_irqrestore(&card->res_lock, flags);
@@ -1607,7 +1528,7 @@ static void ns_close(struct atm_vcc *vcc)
1607 NS_SKB(iovb)->iovcnt); 1528 NS_SKB(iovb)->iovcnt);
1608 NS_SKB(iovb)->iovcnt = 0; 1529 NS_SKB(iovb)->iovcnt = 0;
1609 NS_SKB(iovb)->vcc = NULL; 1530 NS_SKB(iovb)->vcc = NULL;
1610 ns_grab_int_lock(card, flags); 1531 spin_lock_irqsave(&card->int_lock, flags);
1611 recycle_iov_buf(card, iovb); 1532 recycle_iov_buf(card, iovb);
1612 spin_unlock_irqrestore(&card->int_lock, flags); 1533 spin_unlock_irqrestore(&card->int_lock, flags);
1613 vc->rx_iov = NULL; 1534 vc->rx_iov = NULL;
@@ -1629,7 +1550,7 @@ static void ns_close(struct atm_vcc *vcc)
1629 1550
1630 for (;;) 1551 for (;;)
1631 { 1552 {
1632 ns_grab_scq_lock(card, scq, flags); 1553 spin_lock_irqsave(&scq->lock, flags);
1633 scqep = scq->next; 1554 scqep = scq->next;
1634 if (scqep == scq->base) 1555 if (scqep == scq->base)
1635 scqep = scq->last; 1556 scqep = scq->last;
@@ -1691,7 +1612,7 @@ static void ns_close(struct atm_vcc *vcc)
1691 unsigned long flags; 1612 unsigned long flags;
1692 scq_info *scq = card->scq0; 1613 scq_info *scq = card->scq0;
1693 1614
1694 ns_grab_scq_lock(card, scq, flags); 1615 spin_lock_irqsave(&scq->lock, flags);
1695 1616
1696 for(i = 0; i < scq->num_entries; i++) { 1617 for(i = 0; i < scq->num_entries; i++) {
1697 if(scq->skb[i] && ATM_SKB(scq->skb[i])->vcc == vcc) { 1618 if(scq->skb[i] && ATM_SKB(scq->skb[i])->vcc == vcc) {
@@ -1892,7 +1813,7 @@ static int push_scqe(ns_dev *card, vc_map *vc, scq_info *scq, ns_scqe *tbd,
1892 u32 data; 1813 u32 data;
1893 int index; 1814 int index;
1894 1815
1895 ns_grab_scq_lock(card, scq, flags); 1816 spin_lock_irqsave(&scq->lock, flags);
1896 while (scq->tail == scq->next) 1817 while (scq->tail == scq->next)
1897 { 1818 {
1898 if (in_interrupt()) { 1819 if (in_interrupt()) {
@@ -1904,7 +1825,7 @@ static int push_scqe(ns_dev *card, vc_map *vc, scq_info *scq, ns_scqe *tbd,
1904 scq->full = 1; 1825 scq->full = 1;
1905 spin_unlock_irqrestore(&scq->lock, flags); 1826 spin_unlock_irqrestore(&scq->lock, flags);
1906 interruptible_sleep_on_timeout(&scq->scqfull_waitq, SCQFULL_TIMEOUT); 1827 interruptible_sleep_on_timeout(&scq->scqfull_waitq, SCQFULL_TIMEOUT);
1907 ns_grab_scq_lock(card, scq, flags); 1828 spin_lock_irqsave(&scq->lock, flags);
1908 1829
1909 if (scq->full) { 1830 if (scq->full) {
1910 spin_unlock_irqrestore(&scq->lock, flags); 1831 spin_unlock_irqrestore(&scq->lock, flags);
@@ -1953,7 +1874,7 @@ static int push_scqe(ns_dev *card, vc_map *vc, scq_info *scq, ns_scqe *tbd,
1953 if (has_run++) break; 1874 if (has_run++) break;
1954 spin_unlock_irqrestore(&scq->lock, flags); 1875 spin_unlock_irqrestore(&scq->lock, flags);
1955 interruptible_sleep_on_timeout(&scq->scqfull_waitq, SCQFULL_TIMEOUT); 1876 interruptible_sleep_on_timeout(&scq->scqfull_waitq, SCQFULL_TIMEOUT);
1956 ns_grab_scq_lock(card, scq, flags); 1877 spin_lock_irqsave(&scq->lock, flags);
1957 } 1878 }
1958 1879
1959 if (!scq->full) 1880 if (!scq->full)
@@ -2090,7 +2011,7 @@ static void drain_scq(ns_dev *card, scq_info *scq, int pos)
2090 return; 2011 return;
2091 } 2012 }
2092 2013
2093 ns_grab_scq_lock(card, scq, flags); 2014 spin_lock_irqsave(&scq->lock, flags);
2094 i = (int) (scq->tail - scq->base); 2015 i = (int) (scq->tail - scq->base);
2095 if (++i == scq->num_entries) 2016 if (++i == scq->num_entries)
2096 i = 0; 2017 i = 0;
@@ -2898,7 +2819,7 @@ static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
2898 { 2819 {
2899 struct sk_buff *hb; 2820 struct sk_buff *hb;
2900 2821
2901 ns_grab_int_lock(card, flags); 2822 spin_lock_irqsave(&card->int_lock, flags);
2902 hb = skb_dequeue(&card->hbpool.queue); 2823 hb = skb_dequeue(&card->hbpool.queue);
2903 card->hbpool.count--; 2824 card->hbpool.count--;
2904 spin_unlock_irqrestore(&card->int_lock, flags); 2825 spin_unlock_irqrestore(&card->int_lock, flags);
@@ -2917,7 +2838,7 @@ static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
2917 if (hb == NULL) 2838 if (hb == NULL)
2918 return -ENOMEM; 2839 return -ENOMEM;
2919 NS_SKB_CB(hb)->buf_type = BUF_NONE; 2840 NS_SKB_CB(hb)->buf_type = BUF_NONE;
2920 ns_grab_int_lock(card, flags); 2841 spin_lock_irqsave(&card->int_lock, flags);
2921 skb_queue_tail(&card->hbpool.queue, hb); 2842 skb_queue_tail(&card->hbpool.queue, hb);
2922 card->hbpool.count++; 2843 card->hbpool.count++;
2923 spin_unlock_irqrestore(&card->int_lock, flags); 2844 spin_unlock_irqrestore(&card->int_lock, flags);
@@ -2929,7 +2850,7 @@ static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
2929 { 2850 {
2930 struct sk_buff *iovb; 2851 struct sk_buff *iovb;
2931 2852
2932 ns_grab_int_lock(card, flags); 2853 spin_lock_irqsave(&card->int_lock, flags);
2933 iovb = skb_dequeue(&card->iovpool.queue); 2854 iovb = skb_dequeue(&card->iovpool.queue);
2934 card->iovpool.count--; 2855 card->iovpool.count--;
2935 spin_unlock_irqrestore(&card->int_lock, flags); 2856 spin_unlock_irqrestore(&card->int_lock, flags);
@@ -2948,7 +2869,7 @@ static int ns_ioctl(struct atm_dev *dev, unsigned int cmd, void __user *arg)
2948 if (iovb == NULL) 2869 if (iovb == NULL)
2949 return -ENOMEM; 2870 return -ENOMEM;
2950 NS_SKB_CB(iovb)->buf_type = BUF_NONE; 2871 NS_SKB_CB(iovb)->buf_type = BUF_NONE;
2951 ns_grab_int_lock(card, flags); 2872 spin_lock_irqsave(&card->int_lock, flags);
2952 skb_queue_tail(&card->iovpool.queue, iovb); 2873 skb_queue_tail(&card->iovpool.queue, iovb);
2953 card->iovpool.count++; 2874 card->iovpool.count++;
2954 spin_unlock_irqrestore(&card->int_lock, flags); 2875 spin_unlock_irqrestore(&card->int_lock, flags);
@@ -2995,7 +2916,7 @@ static void ns_poll(unsigned long arg)
2995 /* Probably it isn't worth spinning */ 2916 /* Probably it isn't worth spinning */
2996 continue; 2917 continue;
2997 } 2918 }
2998 ns_grab_int_lock(card, flags); 2919 spin_lock_irqsave(&card->int_lock, flags);
2999 2920
3000 stat_w = 0; 2921 stat_w = 0;
3001 stat_r = readl(card->membase + STAT); 2922 stat_r = readl(card->membase + STAT);
@@ -3062,7 +2983,7 @@ static void ns_phy_put(struct atm_dev *dev, unsigned char value,
3062 unsigned long flags; 2983 unsigned long flags;
3063 2984
3064 card = dev->dev_data; 2985 card = dev->dev_data;
3065 ns_grab_res_lock(card, flags); 2986 spin_lock_irqsave(&card->res_lock, flags);
3066 while(CMD_BUSY(card)); 2987 while(CMD_BUSY(card));
3067 writel((unsigned long) value, card->membase + DR0); 2988 writel((unsigned long) value, card->membase + DR0);
3068 writel(NS_CMD_WRITE_UTILITY | 0x00000200 | (addr & 0x000000FF), 2989 writel(NS_CMD_WRITE_UTILITY | 0x00000200 | (addr & 0x000000FF),
@@ -3079,7 +3000,7 @@ static unsigned char ns_phy_get(struct atm_dev *dev, unsigned long addr)
3079 unsigned long data; 3000 unsigned long data;
3080 3001
3081 card = dev->dev_data; 3002 card = dev->dev_data;
3082 ns_grab_res_lock(card, flags); 3003 spin_lock_irqsave(&card->res_lock, flags);
3083 while(CMD_BUSY(card)); 3004 while(CMD_BUSY(card));
3084 writel(NS_CMD_READ_UTILITY | 0x00000200 | (addr & 0x000000FF), 3005 writel(NS_CMD_READ_UTILITY | 0x00000200 | (addr & 0x000000FF),
3085 card->membase + CMD); 3006 card->membase + CMD);
diff --git a/drivers/atm/nicstar.h b/drivers/atm/nicstar.h
index 5997bcb45b59..6010e3daa6a2 100644
--- a/drivers/atm/nicstar.h
+++ b/drivers/atm/nicstar.h
@@ -28,8 +28,6 @@
28 28
29/* Options ********************************************************************/ 29/* Options ********************************************************************/
30 30
31#undef NS_DEBUG_SPINLOCKS
32
33#define NS_MAX_CARDS 4 /* Maximum number of NICStAR based cards 31#define NS_MAX_CARDS 4 /* Maximum number of NICStAR based cards
34 controlled by the device driver. Must 32 controlled by the device driver. Must
35 be <= 5 */ 33 be <= 5 */
@@ -721,10 +719,6 @@ typedef struct scq_info
721 wait_queue_head_t scqfull_waitq; 719 wait_queue_head_t scqfull_waitq;
722 volatile char full; /* SCQ full indicator */ 720 volatile char full; /* SCQ full indicator */
723 spinlock_t lock; /* SCQ spinlock */ 721 spinlock_t lock; /* SCQ spinlock */
724#ifdef NS_DEBUG_SPINLOCKS
725 volatile long has_lock;
726 volatile int cpu_lock;
727#endif /* NS_DEBUG_SPINLOCKS */
728} scq_info; 722} scq_info;
729 723
730 724
@@ -810,12 +804,6 @@ typedef struct ns_dev
810 unsigned intcnt; /* Interrupt counter */ 804 unsigned intcnt; /* Interrupt counter */
811 spinlock_t int_lock; /* Interrupt lock */ 805 spinlock_t int_lock; /* Interrupt lock */
812 spinlock_t res_lock; /* Card resource lock */ 806 spinlock_t res_lock; /* Card resource lock */
813#ifdef NS_DEBUG_SPINLOCKS
814 volatile long has_int_lock;
815 volatile int cpu_int;
816 volatile long has_res_lock;
817 volatile int cpu_res;
818#endif /* NS_DEBUG_SPINLOCKS */
819} ns_dev; 807} ns_dev;
820 808
821 809
diff --git a/drivers/bluetooth/hci_usb.c b/drivers/bluetooth/hci_usb.c
index 8b884f87d8b7..192522ebb771 100644
--- a/drivers/bluetooth/hci_usb.c
+++ b/drivers/bluetooth/hci_usb.c
@@ -62,13 +62,13 @@
62#define URB_ZERO_PACKET 0 62#define URB_ZERO_PACKET 0
63#endif 63#endif
64 64
65static int ignore = 0; 65static int ignore;
66static int ignore_dga = 0; 66static int ignore_dga;
67static int ignore_csr = 0; 67static int ignore_csr;
68static int ignore_sniffer = 0; 68static int ignore_sniffer;
69static int disable_scofix = 0; 69static int disable_scofix;
70static int force_scofix = 0; 70static int force_scofix;
71static int reset = 0; 71static int reset;
72 72
73#ifdef CONFIG_BT_HCIUSB_SCO 73#ifdef CONFIG_BT_HCIUSB_SCO
74static int isoc = 2; 74static int isoc = 2;
@@ -265,7 +265,7 @@ static int hci_usb_intr_rx_submit(struct hci_usb *husb)
265 BT_ERR("%s intr rx submit failed urb %p err %d", 265 BT_ERR("%s intr rx submit failed urb %p err %d",
266 husb->hdev->name, urb, err); 266 husb->hdev->name, urb, err);
267 _urb_unlink(_urb); 267 _urb_unlink(_urb);
268 _urb_free(_urb); 268 kfree(_urb);
269 kfree(buf); 269 kfree(buf);
270 } 270 }
271 return err; 271 return err;
@@ -302,7 +302,7 @@ static int hci_usb_bulk_rx_submit(struct hci_usb *husb)
302 BT_ERR("%s bulk rx submit failed urb %p err %d", 302 BT_ERR("%s bulk rx submit failed urb %p err %d",
303 husb->hdev->name, urb, err); 303 husb->hdev->name, urb, err);
304 _urb_unlink(_urb); 304 _urb_unlink(_urb);
305 _urb_free(_urb); 305 kfree(_urb);
306 kfree(buf); 306 kfree(buf);
307 } 307 }
308 return err; 308 return err;
@@ -353,7 +353,7 @@ static int hci_usb_isoc_rx_submit(struct hci_usb *husb)
353 BT_ERR("%s isoc rx submit failed urb %p err %d", 353 BT_ERR("%s isoc rx submit failed urb %p err %d",
354 husb->hdev->name, urb, err); 354 husb->hdev->name, urb, err);
355 _urb_unlink(_urb); 355 _urb_unlink(_urb);
356 _urb_free(_urb); 356 kfree(_urb);
357 kfree(buf); 357 kfree(buf);
358 } 358 }
359 return err; 359 return err;
@@ -431,7 +431,7 @@ static void hci_usb_unlink_urbs(struct hci_usb *husb)
431 husb->hdev->name, _urb, _urb->type, urb); 431 husb->hdev->name, _urb, _urb->type, urb);
432 kfree(urb->setup_packet); 432 kfree(urb->setup_packet);
433 kfree(urb->transfer_buffer); 433 kfree(urb->transfer_buffer);
434 _urb_free(_urb); 434 kfree(_urb);
435 } 435 }
436 } 436 }
437} 437}
@@ -490,7 +490,7 @@ static inline int hci_usb_send_ctrl(struct hci_usb *husb, struct sk_buff *skb)
490 490
491 dr = kmalloc(sizeof(*dr), GFP_ATOMIC); 491 dr = kmalloc(sizeof(*dr), GFP_ATOMIC);
492 if (!dr) { 492 if (!dr) {
493 _urb_free(_urb); 493 kfree(_urb);
494 return -ENOMEM; 494 return -ENOMEM;
495 } 495 }
496 } else 496 } else
diff --git a/drivers/bluetooth/hci_usb.h b/drivers/bluetooth/hci_usb.h
index 56cd3a92ceca..414080a4e8ff 100644
--- a/drivers/bluetooth/hci_usb.h
+++ b/drivers/bluetooth/hci_usb.h
@@ -60,11 +60,6 @@ struct _urb {
60 struct urb urb; 60 struct urb urb;
61}; 61};
62 62
63static inline void _urb_free(struct _urb *_urb)
64{
65 kfree(_urb);
66}
67
68static inline void _urb_queue_init(struct _urb_queue *q) 63static inline void _urb_queue_init(struct _urb_queue *q)
69{ 64{
70 INIT_LIST_HEAD(&q->head); 65 INIT_LIST_HEAD(&q->head);
diff --git a/drivers/net/appletalk/cops.c b/drivers/net/appletalk/cops.c
index 65b901ebfd62..82e9a5bd0dd2 100644
--- a/drivers/net/appletalk/cops.c
+++ b/drivers/net/appletalk/cops.c
@@ -69,6 +69,7 @@ static const char *version =
69#include <linux/atalk.h> 69#include <linux/atalk.h>
70#include <linux/spinlock.h> 70#include <linux/spinlock.h>
71#include <linux/bitops.h> 71#include <linux/bitops.h>
72#include <linux/jiffies.h>
72 73
73#include <asm/system.h> 74#include <asm/system.h>
74#include <asm/io.h> 75#include <asm/io.h>
@@ -503,7 +504,7 @@ static void cops_reset(struct net_device *dev, int sleep)
503 long snap=jiffies; 504 long snap=jiffies;
504 505
505 /* Let card finish initializing, about 1/3 second */ 506 /* Let card finish initializing, about 1/3 second */
506 while(jiffies-snap<HZ/3) 507 while (time_before(jiffies, snap + HZ/3))
507 schedule(); 508 schedule();
508 } 509 }
509 else 510 else
diff --git a/drivers/net/tg3.c b/drivers/net/tg3.c
index 96043c5746d0..bc4c62b8e81a 100644
--- a/drivers/net/tg3.c
+++ b/drivers/net/tg3.c
@@ -64,8 +64,8 @@
64 64
65#define DRV_MODULE_NAME "tg3" 65#define DRV_MODULE_NAME "tg3"
66#define PFX DRV_MODULE_NAME ": " 66#define PFX DRV_MODULE_NAME ": "
67#define DRV_MODULE_VERSION "3.90" 67#define DRV_MODULE_VERSION "3.91"
68#define DRV_MODULE_RELDATE "April 12, 2008" 68#define DRV_MODULE_RELDATE "April 18, 2008"
69 69
70#define TG3_DEF_MAC_MODE 0 70#define TG3_DEF_MAC_MODE 0
71#define TG3_DEF_RX_MODE 0 71#define TG3_DEF_RX_MODE 0
@@ -4135,11 +4135,21 @@ static int tigon3_dma_hwbug_workaround(struct tg3 *tp, struct sk_buff *skb,
4135 u32 last_plus_one, u32 *start, 4135 u32 last_plus_one, u32 *start,
4136 u32 base_flags, u32 mss) 4136 u32 base_flags, u32 mss)
4137{ 4137{
4138 struct sk_buff *new_skb = skb_copy(skb, GFP_ATOMIC); 4138 struct sk_buff *new_skb;
4139 dma_addr_t new_addr = 0; 4139 dma_addr_t new_addr = 0;
4140 u32 entry = *start; 4140 u32 entry = *start;
4141 int i, ret = 0; 4141 int i, ret = 0;
4142 4142
4143 if (GET_ASIC_REV(tp->pci_chip_rev_id) != ASIC_REV_5701)
4144 new_skb = skb_copy(skb, GFP_ATOMIC);
4145 else {
4146 int more_headroom = 4 - ((unsigned long)skb->data & 3);
4147
4148 new_skb = skb_copy_expand(skb,
4149 skb_headroom(skb) + more_headroom,
4150 skb_tailroom(skb), GFP_ATOMIC);
4151 }
4152
4143 if (!new_skb) { 4153 if (!new_skb) {
4144 ret = -1; 4154 ret = -1;
4145 } else { 4155 } else {
@@ -4462,7 +4472,9 @@ static int tg3_start_xmit_dma_bug(struct sk_buff *skb, struct net_device *dev)
4462 4472
4463 would_hit_hwbug = 0; 4473 would_hit_hwbug = 0;
4464 4474
4465 if (tg3_4g_overflow_test(mapping, len)) 4475 if (tp->tg3_flags3 & TG3_FLG3_5701_DMA_BUG)
4476 would_hit_hwbug = 1;
4477 else if (tg3_4g_overflow_test(mapping, len))
4466 would_hit_hwbug = 1; 4478 would_hit_hwbug = 1;
4467 4479
4468 tg3_set_txd(tp, entry, mapping, len, base_flags, 4480 tg3_set_txd(tp, entry, mapping, len, base_flags,
@@ -11339,6 +11351,38 @@ static int __devinit tg3_get_invariants(struct tg3 *tp)
11339 } 11351 }
11340 } 11352 }
11341 11353
11354 if ((GET_ASIC_REV(tp->pci_chip_rev_id) == ASIC_REV_5701)) {
11355 static struct tg3_dev_id {
11356 u32 vendor;
11357 u32 device;
11358 } bridge_chipsets[] = {
11359 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_0 },
11360 { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PXH_1 },
11361 { },
11362 };
11363 struct tg3_dev_id *pci_id = &bridge_chipsets[0];
11364 struct pci_dev *bridge = NULL;
11365
11366 while (pci_id->vendor != 0) {
11367 bridge = pci_get_device(pci_id->vendor,
11368 pci_id->device,
11369 bridge);
11370 if (!bridge) {
11371 pci_id++;
11372 continue;
11373 }
11374 if (bridge->subordinate &&
11375 (bridge->subordinate->number <=
11376 tp->pdev->bus->number) &&
11377 (bridge->subordinate->subordinate >=
11378 tp->pdev->bus->number)) {
11379 tp->tg3_flags3 |= TG3_FLG3_5701_DMA_BUG;
11380 pci_dev_put(bridge);
11381 break;
11382 }
11383 }
11384 }
11385
11342 /* The EPB bridge inside 5714, 5715, and 5780 cannot support 11386 /* The EPB bridge inside 5714, 5715, and 5780 cannot support
11343 * DMA addresses > 40-bit. This bridge may have other additional 11387 * DMA addresses > 40-bit. This bridge may have other additional
11344 * 57xx devices behind it in some 4-port NIC designs for example. 11388 * 57xx devices behind it in some 4-port NIC designs for example.
diff --git a/drivers/net/tg3.h b/drivers/net/tg3.h
index c1075a73d66c..c688c3ac5035 100644
--- a/drivers/net/tg3.h
+++ b/drivers/net/tg3.h
@@ -2476,6 +2476,7 @@ struct tg3 {
2476#define TG3_FLG3_NO_NVRAM_ADDR_TRANS 0x00000001 2476#define TG3_FLG3_NO_NVRAM_ADDR_TRANS 0x00000001
2477#define TG3_FLG3_ENABLE_APE 0x00000002 2477#define TG3_FLG3_ENABLE_APE 0x00000002
2478#define TG3_FLG3_5761_5784_AX_FIXES 0x00000004 2478#define TG3_FLG3_5761_5784_AX_FIXES 0x00000004
2479#define TG3_FLG3_5701_DMA_BUG 0x00000008
2479 2480
2480 struct timer_list timer; 2481 struct timer_list timer;
2481 u16 timer_counter; 2482 u16 timer_counter;
diff --git a/drivers/net/wireless/iwlwifi/iwl-debugfs.c b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
index 0f16f2606f29..9a30e1df311d 100644
--- a/drivers/net/wireless/iwlwifi/iwl-debugfs.c
+++ b/drivers/net/wireless/iwlwifi/iwl-debugfs.c
@@ -239,28 +239,34 @@ static ssize_t iwl_dbgfs_stations_read(struct file *file, char __user *user_buf,
239 "ps_status: %u\n", station->ps_status); 239 "ps_status: %u\n", station->ps_status);
240 pos += scnprintf(buf + pos, bufsz - pos, "tid data:\n"); 240 pos += scnprintf(buf + pos, bufsz - pos, "tid data:\n");
241 pos += scnprintf(buf + pos, bufsz - pos, 241 pos += scnprintf(buf + pos, bufsz - pos,
242 "seq_num\t\ttxq_id\t"); 242 "seq_num\t\ttxq_id");
243#ifdef CONFIG_IWL4965_HT
243 pos += scnprintf(buf + pos, bufsz - pos, 244 pos += scnprintf(buf + pos, bufsz - pos,
244 "frame_count\twait_for_ba\t"); 245 "\tframe_count\twait_for_ba\t");
245 pos += scnprintf(buf + pos, bufsz - pos, 246 pos += scnprintf(buf + pos, bufsz - pos,
246 "start_idx\tbitmap0\t"); 247 "start_idx\tbitmap0\t");
247 pos += scnprintf(buf + pos, bufsz - pos, 248 pos += scnprintf(buf + pos, bufsz - pos,
248 "bitmap1\trate_n_flags\n"); 249 "bitmap1\trate_n_flags");
250#endif
251 pos += scnprintf(buf + pos, bufsz - pos, "\n");
249 252
250 for (j = 0; j < MAX_TID_COUNT; j++) { 253 for (j = 0; j < MAX_TID_COUNT; j++) {
251 pos += scnprintf(buf + pos, bufsz - pos, 254 pos += scnprintf(buf + pos, bufsz - pos,
252 "[%d]:\t\t%u\t", j, 255 "[%d]:\t\t%u", j,
253 station->tid[j].seq_number); 256 station->tid[j].seq_number);
257#ifdef CONFIG_IWL4965_HT
254 pos += scnprintf(buf + pos, bufsz - pos, 258 pos += scnprintf(buf + pos, bufsz - pos,
255 "%u\t\t%u\t\t%u\t\t", 259 "\t%u\t\t%u\t\t%u\t\t",
256 station->tid[j].agg.txq_id, 260 station->tid[j].agg.txq_id,
257 station->tid[j].agg.frame_count, 261 station->tid[j].agg.frame_count,
258 station->tid[j].agg.wait_for_ba); 262 station->tid[j].agg.wait_for_ba);
259 pos += scnprintf(buf + pos, bufsz - pos, 263 pos += scnprintf(buf + pos, bufsz - pos,
260 "%u\t%llu\t%u\n", 264 "%u\t%llu\t%u",
261 station->tid[j].agg.start_idx, 265 station->tid[j].agg.start_idx,
262 (unsigned long long)station->tid[j].agg.bitmap, 266 (unsigned long long)station->tid[j].agg.bitmap,
263 station->tid[j].agg.rate_n_flags); 267 station->tid[j].agg.rate_n_flags);
268#endif
269 pos += scnprintf(buf + pos, bufsz - pos, "\n");
264 } 270 }
265 pos += scnprintf(buf + pos, bufsz - pos, "\n"); 271 pos += scnprintf(buf + pos, bufsz - pos, "\n");
266 } 272 }