aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-06-16 21:25:48 -0400
committerDavid S. Miller <davem@davemloft.net>2008-06-16 21:25:48 -0400
commitcaea902f72b053fd0c76d0d3b6b2e057beb3fc64 (patch)
tree74e8d476b2c51480420e2ef7c9bbae249b6edbc9 /drivers/net
parent0b4419162aa6c4204843f3a13b48d9ab821d3167 (diff)
parent65c3e4715b1b934f8dcc002d9f46b4371ca7a9b1 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts: drivers/net/wireless/rt2x00/Kconfig drivers/net/wireless/rt2x00/rt2x00usb.c net/sctp/protocol.c
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/b43/b43.h1
-rw-r--r--drivers/net/wireless/b43/dma.c65
-rw-r--r--drivers/net/wireless/b43/main.c16
-rw-r--r--drivers/net/wireless/rt2x00/Kconfig19
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00pci.c3
-rw-r--r--drivers/net/wireless/rt2x00/rt2x00usb.c5
-rw-r--r--drivers/net/wireless/rt2x00/rt73usb.c1
7 files changed, 58 insertions, 52 deletions
diff --git a/drivers/net/wireless/b43/b43.h b/drivers/net/wireless/b43/b43.h
index 239e71c3d1b1..532365f5ecef 100644
--- a/drivers/net/wireless/b43/b43.h
+++ b/drivers/net/wireless/b43/b43.h
@@ -649,7 +649,6 @@ struct b43_pio {
649 649
650/* Context information for a noise calculation (Link Quality). */ 650/* Context information for a noise calculation (Link Quality). */
651struct b43_noise_calculation { 651struct b43_noise_calculation {
652 u8 channel_at_start;
653 bool calculation_running; 652 bool calculation_running;
654 u8 nr_samples; 653 u8 nr_samples;
655 s8 samples[8][4]; 654 s8 samples[8][4];
diff --git a/drivers/net/wireless/b43/dma.c b/drivers/net/wireless/b43/dma.c
index b4eadd908bea..8a09a1db08db 100644
--- a/drivers/net/wireless/b43/dma.c
+++ b/drivers/net/wireless/b43/dma.c
@@ -795,24 +795,49 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,
795{ 795{
796 struct b43_dmaring *ring; 796 struct b43_dmaring *ring;
797 int err; 797 int err;
798 int nr_slots;
799 dma_addr_t dma_test; 798 dma_addr_t dma_test;
800 799
801 ring = kzalloc(sizeof(*ring), GFP_KERNEL); 800 ring = kzalloc(sizeof(*ring), GFP_KERNEL);
802 if (!ring) 801 if (!ring)
803 goto out; 802 goto out;
804 ring->type = type;
805 803
806 nr_slots = B43_RXRING_SLOTS; 804 ring->nr_slots = B43_RXRING_SLOTS;
807 if (for_tx) 805 if (for_tx)
808 nr_slots = B43_TXRING_SLOTS; 806 ring->nr_slots = B43_TXRING_SLOTS;
809 807
810 ring->meta = kcalloc(nr_slots, sizeof(struct b43_dmadesc_meta), 808 ring->meta = kcalloc(ring->nr_slots, sizeof(struct b43_dmadesc_meta),
811 GFP_KERNEL); 809 GFP_KERNEL);
812 if (!ring->meta) 810 if (!ring->meta)
813 goto err_kfree_ring; 811 goto err_kfree_ring;
812
813 ring->type = type;
814 ring->dev = dev;
815 ring->mmio_base = b43_dmacontroller_base(type, controller_index);
816 ring->index = controller_index;
817 if (type == B43_DMA_64BIT)
818 ring->ops = &dma64_ops;
819 else
820 ring->ops = &dma32_ops;
814 if (for_tx) { 821 if (for_tx) {
815 ring->txhdr_cache = kcalloc(nr_slots, 822 ring->tx = 1;
823 ring->current_slot = -1;
824 } else {
825 if (ring->index == 0) {
826 ring->rx_buffersize = B43_DMA0_RX_BUFFERSIZE;
827 ring->frameoffset = B43_DMA0_RX_FRAMEOFFSET;
828 } else if (ring->index == 3) {
829 ring->rx_buffersize = B43_DMA3_RX_BUFFERSIZE;
830 ring->frameoffset = B43_DMA3_RX_FRAMEOFFSET;
831 } else
832 B43_WARN_ON(1);
833 }
834 spin_lock_init(&ring->lock);
835#ifdef CONFIG_B43_DEBUG
836 ring->last_injected_overflow = jiffies;
837#endif
838
839 if (for_tx) {
840 ring->txhdr_cache = kcalloc(ring->nr_slots,
816 b43_txhdr_size(dev), 841 b43_txhdr_size(dev),
817 GFP_KERNEL); 842 GFP_KERNEL);
818 if (!ring->txhdr_cache) 843 if (!ring->txhdr_cache)
@@ -828,7 +853,7 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,
828 b43_txhdr_size(dev), 1)) { 853 b43_txhdr_size(dev), 1)) {
829 /* ugh realloc */ 854 /* ugh realloc */
830 kfree(ring->txhdr_cache); 855 kfree(ring->txhdr_cache);
831 ring->txhdr_cache = kcalloc(nr_slots, 856 ring->txhdr_cache = kcalloc(ring->nr_slots,
832 b43_txhdr_size(dev), 857 b43_txhdr_size(dev),
833 GFP_KERNEL | GFP_DMA); 858 GFP_KERNEL | GFP_DMA);
834 if (!ring->txhdr_cache) 859 if (!ring->txhdr_cache)
@@ -853,32 +878,6 @@ struct b43_dmaring *b43_setup_dmaring(struct b43_wldev *dev,
853 DMA_TO_DEVICE); 878 DMA_TO_DEVICE);
854 } 879 }
855 880
856 ring->dev = dev;
857 ring->nr_slots = nr_slots;
858 ring->mmio_base = b43_dmacontroller_base(type, controller_index);
859 ring->index = controller_index;
860 if (type == B43_DMA_64BIT)
861 ring->ops = &dma64_ops;
862 else
863 ring->ops = &dma32_ops;
864 if (for_tx) {
865 ring->tx = 1;
866 ring->current_slot = -1;
867 } else {
868 if (ring->index == 0) {
869 ring->rx_buffersize = B43_DMA0_RX_BUFFERSIZE;
870 ring->frameoffset = B43_DMA0_RX_FRAMEOFFSET;
871 } else if (ring->index == 3) {
872 ring->rx_buffersize = B43_DMA3_RX_BUFFERSIZE;
873 ring->frameoffset = B43_DMA3_RX_FRAMEOFFSET;
874 } else
875 B43_WARN_ON(1);
876 }
877 spin_lock_init(&ring->lock);
878#ifdef CONFIG_B43_DEBUG
879 ring->last_injected_overflow = jiffies;
880#endif
881
882 err = alloc_ringmemory(ring); 881 err = alloc_ringmemory(ring);
883 if (err) 882 if (err)
884 goto err_kfree_txhdr_cache; 883 goto err_kfree_txhdr_cache;
diff --git a/drivers/net/wireless/b43/main.c b/drivers/net/wireless/b43/main.c
index 1e31e0bca744..7bca8e981512 100644
--- a/drivers/net/wireless/b43/main.c
+++ b/drivers/net/wireless/b43/main.c
@@ -1145,7 +1145,6 @@ static void b43_generate_noise_sample(struct b43_wldev *dev)
1145 b43_jssi_write(dev, 0x7F7F7F7F); 1145 b43_jssi_write(dev, 0x7F7F7F7F);
1146 b43_write32(dev, B43_MMIO_MACCMD, 1146 b43_write32(dev, B43_MMIO_MACCMD,
1147 b43_read32(dev, B43_MMIO_MACCMD) | B43_MACCMD_BGNOISE); 1147 b43_read32(dev, B43_MMIO_MACCMD) | B43_MACCMD_BGNOISE);
1148 B43_WARN_ON(dev->noisecalc.channel_at_start != dev->phy.channel);
1149} 1148}
1150 1149
1151static void b43_calculate_link_quality(struct b43_wldev *dev) 1150static void b43_calculate_link_quality(struct b43_wldev *dev)
@@ -1154,7 +1153,6 @@ static void b43_calculate_link_quality(struct b43_wldev *dev)
1154 1153
1155 if (dev->noisecalc.calculation_running) 1154 if (dev->noisecalc.calculation_running)
1156 return; 1155 return;
1157 dev->noisecalc.channel_at_start = dev->phy.channel;
1158 dev->noisecalc.calculation_running = 1; 1156 dev->noisecalc.calculation_running = 1;
1159 dev->noisecalc.nr_samples = 0; 1157 dev->noisecalc.nr_samples = 0;
1160 1158
@@ -1171,9 +1169,16 @@ static void handle_irq_noise(struct b43_wldev *dev)
1171 1169
1172 /* Bottom half of Link Quality calculation. */ 1170 /* Bottom half of Link Quality calculation. */
1173 1171
1172 /* Possible race condition: It might be possible that the user
1173 * changed to a different channel in the meantime since we
1174 * started the calculation. We ignore that fact, since it's
1175 * not really that much of a problem. The background noise is
1176 * an estimation only anyway. Slightly wrong results will get damped
1177 * by the averaging of the 8 sample rounds. Additionally the
1178 * value is shortlived. So it will be replaced by the next noise
1179 * calculation round soon. */
1180
1174 B43_WARN_ON(!dev->noisecalc.calculation_running); 1181 B43_WARN_ON(!dev->noisecalc.calculation_running);
1175 if (dev->noisecalc.channel_at_start != phy->channel)
1176 goto drop_calculation;
1177 *((__le32 *)noise) = cpu_to_le32(b43_jssi_read(dev)); 1182 *((__le32 *)noise) = cpu_to_le32(b43_jssi_read(dev));
1178 if (noise[0] == 0x7F || noise[1] == 0x7F || 1183 if (noise[0] == 0x7F || noise[1] == 0x7F ||
1179 noise[2] == 0x7F || noise[3] == 0x7F) 1184 noise[2] == 0x7F || noise[3] == 0x7F)
@@ -1214,11 +1219,10 @@ static void handle_irq_noise(struct b43_wldev *dev)
1214 average -= 48; 1219 average -= 48;
1215 1220
1216 dev->stats.link_noise = average; 1221 dev->stats.link_noise = average;
1217 drop_calculation:
1218 dev->noisecalc.calculation_running = 0; 1222 dev->noisecalc.calculation_running = 0;
1219 return; 1223 return;
1220 } 1224 }
1221 generate_new: 1225generate_new:
1222 b43_generate_noise_sample(dev); 1226 b43_generate_noise_sample(dev);
1223} 1227}
1224 1228
diff --git a/drivers/net/wireless/rt2x00/Kconfig b/drivers/net/wireless/rt2x00/Kconfig
index 0ace76149422..3a9b1d72caf8 100644
--- a/drivers/net/wireless/rt2x00/Kconfig
+++ b/drivers/net/wireless/rt2x00/Kconfig
@@ -36,12 +36,13 @@ config RT2X00_LIB_FIRMWARE
36config RT2X00_LIB_RFKILL 36config RT2X00_LIB_RFKILL
37 boolean 37 boolean
38 depends on RT2X00_LIB 38 depends on RT2X00_LIB
39 depends on INPUT
39 select RFKILL 40 select RFKILL
40 select INPUT_POLLDEV 41 select INPUT_POLLDEV
41 42
42config RT2X00_LIB_LEDS 43config RT2X00_LIB_LEDS
43 boolean 44 boolean
44 depends on RT2X00_LIB 45 depends on RT2X00_LIB && NEW_LEDS
45 46
46config RT2400PCI 47config RT2400PCI
47 tristate "Ralink rt2400 (PCI/PCMCIA) support" 48 tristate "Ralink rt2400 (PCI/PCMCIA) support"
@@ -56,7 +57,7 @@ config RT2400PCI
56 57
57config RT2400PCI_RFKILL 58config RT2400PCI_RFKILL
58 bool "Ralink rt2400 rfkill support" 59 bool "Ralink rt2400 rfkill support"
59 depends on RT2400PCI 60 depends on RT2400PCI && INPUT
60 select RT2X00_LIB_RFKILL 61 select RT2X00_LIB_RFKILL
61 ---help--- 62 ---help---
62 This adds support for integrated rt2400 hardware that features a 63 This adds support for integrated rt2400 hardware that features a
@@ -65,7 +66,7 @@ config RT2400PCI_RFKILL
65 66
66config RT2400PCI_LEDS 67config RT2400PCI_LEDS
67 bool "Ralink rt2400 leds support" 68 bool "Ralink rt2400 leds support"
68 depends on RT2400PCI 69 depends on RT2400PCI && NEW_LEDS
69 select LEDS_CLASS 70 select LEDS_CLASS
70 select RT2X00_LIB_LEDS 71 select RT2X00_LIB_LEDS
71 ---help--- 72 ---help---
@@ -84,7 +85,7 @@ config RT2500PCI
84 85
85config RT2500PCI_RFKILL 86config RT2500PCI_RFKILL
86 bool "Ralink rt2500 rfkill support" 87 bool "Ralink rt2500 rfkill support"
87 depends on RT2500PCI 88 depends on RT2500PCI && INPUT
88 select RT2X00_LIB_RFKILL 89 select RT2X00_LIB_RFKILL
89 ---help--- 90 ---help---
90 This adds support for integrated rt2500 hardware that features a 91 This adds support for integrated rt2500 hardware that features a
@@ -93,7 +94,7 @@ config RT2500PCI_RFKILL
93 94
94config RT2500PCI_LEDS 95config RT2500PCI_LEDS
95 bool "Ralink rt2500 leds support" 96 bool "Ralink rt2500 leds support"
96 depends on RT2500PCI 97 depends on RT2500PCI && NEW_LEDS
97 select LEDS_CLASS 98 select LEDS_CLASS
98 select RT2X00_LIB_LEDS 99 select RT2X00_LIB_LEDS
99 ---help--- 100 ---help---
@@ -114,7 +115,7 @@ config RT61PCI
114 115
115config RT61PCI_RFKILL 116config RT61PCI_RFKILL
116 bool "Ralink rt2501/rt61 rfkill support" 117 bool "Ralink rt2501/rt61 rfkill support"
117 depends on RT61PCI 118 depends on RT61PCI && INPUT
118 select RT2X00_LIB_RFKILL 119 select RT2X00_LIB_RFKILL
119 ---help--- 120 ---help---
120 This adds support for integrated rt61 hardware that features a 121 This adds support for integrated rt61 hardware that features a
@@ -123,7 +124,7 @@ config RT61PCI_RFKILL
123 124
124config RT61PCI_LEDS 125config RT61PCI_LEDS
125 bool "Ralink rt2501/rt61 leds support" 126 bool "Ralink rt2501/rt61 leds support"
126 depends on RT61PCI 127 depends on RT61PCI && NEW_LEDS
127 select LEDS_CLASS 128 select LEDS_CLASS
128 select RT2X00_LIB_LEDS 129 select RT2X00_LIB_LEDS
129 ---help--- 130 ---help---
@@ -141,7 +142,7 @@ config RT2500USB
141 142
142config RT2500USB_LEDS 143config RT2500USB_LEDS
143 bool "Ralink rt2500 leds support" 144 bool "Ralink rt2500 leds support"
144 depends on RT2500USB 145 depends on RT2500USB && NEW_LEDS
145 select LEDS_CLASS 146 select LEDS_CLASS
146 select RT2X00_LIB_LEDS 147 select RT2X00_LIB_LEDS
147 ---help--- 148 ---help---
@@ -161,7 +162,7 @@ config RT73USB
161 162
162config RT73USB_LEDS 163config RT73USB_LEDS
163 bool "Ralink rt2501/rt73 leds support" 164 bool "Ralink rt2501/rt73 leds support"
164 depends on RT73USB 165 depends on RT73USB && NEW_LEDS
165 select LEDS_CLASS 166 select LEDS_CLASS
166 select RT2X00_LIB_LEDS 167 select RT2X00_LIB_LEDS
167 ---help--- 168 ---help---
diff --git a/drivers/net/wireless/rt2x00/rt2x00pci.c b/drivers/net/wireless/rt2x00/rt2x00pci.c
index 82e80b69d0be..8d6ad18d3890 100644
--- a/drivers/net/wireless/rt2x00/rt2x00pci.c
+++ b/drivers/net/wireless/rt2x00/rt2x00pci.c
@@ -357,8 +357,7 @@ int rt2x00pci_probe(struct pci_dev *pci_dev, const struct pci_device_id *id)
357 if (pci_set_mwi(pci_dev)) 357 if (pci_set_mwi(pci_dev))
358 ERROR_PROBE("MWI not available.\n"); 358 ERROR_PROBE("MWI not available.\n");
359 359
360 if (pci_set_dma_mask(pci_dev, DMA_64BIT_MASK) && 360 if (pci_set_dma_mask(pci_dev, DMA_32BIT_MASK)) {
361 pci_set_dma_mask(pci_dev, DMA_32BIT_MASK)) {
362 ERROR_PROBE("PCI DMA not supported.\n"); 361 ERROR_PROBE("PCI DMA not supported.\n");
363 retval = -EIO; 362 retval = -EIO;
364 goto exit_disable_device; 363 goto exit_disable_device;
diff --git a/drivers/net/wireless/rt2x00/rt2x00usb.c b/drivers/net/wireless/rt2x00/rt2x00usb.c
index 68d87f09e054..3080969ae5b3 100644
--- a/drivers/net/wireless/rt2x00/rt2x00usb.c
+++ b/drivers/net/wireless/rt2x00/rt2x00usb.c
@@ -345,8 +345,11 @@ void rt2x00usb_disable_radio(struct rt2x00_dev *rt2x00dev)
345 } 345 }
346 346
347 /* 347 /*
348 * Kill guardian urb. 348 * Kill guardian urb (if required by driver).
349 */ 349 */
350 if (!test_bit(DRIVER_REQUIRE_BEACON_GUARD, &rt2x00dev->flags))
351 return;
352
350 for (i = 0; i < rt2x00dev->bcn->limit; i++) { 353 for (i = 0; i < rt2x00dev->bcn->limit; i++) {
351 bcn_priv = rt2x00dev->bcn->entries[i].priv_data; 354 bcn_priv = rt2x00dev->bcn->entries[i].priv_data;
352 if (bcn_priv->guardian_urb) 355 if (bcn_priv->guardian_urb)
diff --git a/drivers/net/wireless/rt2x00/rt73usb.c b/drivers/net/wireless/rt2x00/rt73usb.c
index 505a9f5e09e9..fceefd730ab8 100644
--- a/drivers/net/wireless/rt2x00/rt73usb.c
+++ b/drivers/net/wireless/rt2x00/rt73usb.c
@@ -2114,6 +2114,7 @@ static struct usb_device_id rt73usb_device_table[] = {
2114 /* D-Link */ 2114 /* D-Link */
2115 { USB_DEVICE(0x07d1, 0x3c03), USB_DEVICE_DATA(&rt73usb_ops) }, 2115 { USB_DEVICE(0x07d1, 0x3c03), USB_DEVICE_DATA(&rt73usb_ops) },
2116 { USB_DEVICE(0x07d1, 0x3c04), USB_DEVICE_DATA(&rt73usb_ops) }, 2116 { USB_DEVICE(0x07d1, 0x3c04), USB_DEVICE_DATA(&rt73usb_ops) },
2117 { USB_DEVICE(0x07d1, 0x3c06), USB_DEVICE_DATA(&rt73usb_ops) },
2117 { USB_DEVICE(0x07d1, 0x3c07), USB_DEVICE_DATA(&rt73usb_ops) }, 2118 { USB_DEVICE(0x07d1, 0x3c07), USB_DEVICE_DATA(&rt73usb_ops) },
2118 /* Gemtek */ 2119 /* Gemtek */
2119 { USB_DEVICE(0x15a9, 0x0004), USB_DEVICE_DATA(&rt73usb_ops) }, 2120 { USB_DEVICE(0x15a9, 0x0004), USB_DEVICE_DATA(&rt73usb_ops) },