aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/b43legacy
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2008-06-29 01:57:58 -0400
committerDavid S. Miller <davem@davemloft.net>2008-06-29 01:57:58 -0400
commit28f49d8fec19833672a6a813bfde0068fee50bc9 (patch)
tree6905c5cabc063e44b891ae0af5b5d7cce69e6e71 /drivers/net/wireless/b43legacy
parent332e4af80d1214fbf0e263e1408fc7c5b64ecdd6 (diff)
parentff28bd94e307c67abb1bccda5d3a9018bd798e08 (diff)
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/linville/wireless-next-2.6
Diffstat (limited to 'drivers/net/wireless/b43legacy')
-rw-r--r--drivers/net/wireless/b43legacy/dma.c63
-rw-r--r--drivers/net/wireless/b43legacy/rfkill.c8
-rw-r--r--drivers/net/wireless/b43legacy/xmit.c16
3 files changed, 44 insertions, 43 deletions
diff --git a/drivers/net/wireless/b43legacy/dma.c b/drivers/net/wireless/b43legacy/dma.c
index 203b0f42ac5..eb0243a2269 100644
--- a/drivers/net/wireless/b43legacy/dma.c
+++ b/drivers/net/wireless/b43legacy/dma.c
@@ -393,13 +393,13 @@ dma_addr_t map_descbuffer(struct b43legacy_dmaring *ring,
393 dma_addr_t dmaaddr; 393 dma_addr_t dmaaddr;
394 394
395 if (tx) 395 if (tx)
396 dmaaddr = dma_map_single(ring->dev->dev->dma_dev, 396 dmaaddr = ssb_dma_map_single(ring->dev->dev,
397 buf, len, 397 buf, len,
398 DMA_TO_DEVICE); 398 DMA_TO_DEVICE);
399 else 399 else
400 dmaaddr = dma_map_single(ring->dev->dev->dma_dev, 400 dmaaddr = ssb_dma_map_single(ring->dev->dev,
401 buf, len, 401 buf, len,
402 DMA_FROM_DEVICE); 402 DMA_FROM_DEVICE);
403 403
404 return dmaaddr; 404 return dmaaddr;
405} 405}
@@ -411,13 +411,13 @@ void unmap_descbuffer(struct b43legacy_dmaring *ring,
411 int tx) 411 int tx)
412{ 412{
413 if (tx) 413 if (tx)
414 dma_unmap_single(ring->dev->dev->dma_dev, 414 ssb_dma_unmap_single(ring->dev->dev,
415 addr, len, 415 addr, len,
416 DMA_TO_DEVICE); 416 DMA_TO_DEVICE);
417 else 417 else
418 dma_unmap_single(ring->dev->dev->dma_dev, 418 ssb_dma_unmap_single(ring->dev->dev,
419 addr, len, 419 addr, len,
420 DMA_FROM_DEVICE); 420 DMA_FROM_DEVICE);
421} 421}
422 422
423static inline 423static inline
@@ -427,8 +427,8 @@ void sync_descbuffer_for_cpu(struct b43legacy_dmaring *ring,
427{ 427{
428 B43legacy_WARN_ON(ring->tx); 428 B43legacy_WARN_ON(ring->tx);
429 429
430 dma_sync_single_for_cpu(ring->dev->dev->dma_dev, 430 ssb_dma_sync_single_for_cpu(ring->dev->dev,
431 addr, len, DMA_FROM_DEVICE); 431 addr, len, DMA_FROM_DEVICE);
432} 432}
433 433
434static inline 434static inline
@@ -438,8 +438,8 @@ void sync_descbuffer_for_device(struct b43legacy_dmaring *ring,
438{ 438{
439 B43legacy_WARN_ON(ring->tx); 439 B43legacy_WARN_ON(ring->tx);
440 440
441 dma_sync_single_for_device(ring->dev->dev->dma_dev, 441 ssb_dma_sync_single_for_device(ring->dev->dev,
442 addr, len, DMA_FROM_DEVICE); 442 addr, len, DMA_FROM_DEVICE);
443} 443}
444 444
445static inline 445static inline
@@ -458,10 +458,11 @@ void free_descriptor_buffer(struct b43legacy_dmaring *ring,
458 458
459static int alloc_ringmemory(struct b43legacy_dmaring *ring) 459static int alloc_ringmemory(struct b43legacy_dmaring *ring)
460{ 460{
461 struct device *dma_dev = ring->dev->dev->dma_dev; 461 /* GFP flags must match the flags in free_ringmemory()! */
462 462 ring->descbase = ssb_dma_alloc_consistent(ring->dev->dev,
463 ring->descbase = dma_alloc_coherent(dma_dev, B43legacy_DMA_RINGMEMSIZE, 463 B43legacy_DMA_RINGMEMSIZE,
464 &(ring->dmabase), GFP_KERNEL); 464 &(ring->dmabase),
465 GFP_KERNEL);
465 if (!ring->descbase) { 466 if (!ring->descbase) {
466 b43legacyerr(ring->dev->wl, "DMA ringmemory allocation" 467 b43legacyerr(ring->dev->wl, "DMA ringmemory allocation"
467 " failed\n"); 468 " failed\n");
@@ -474,10 +475,8 @@ static int alloc_ringmemory(struct b43legacy_dmaring *ring)
474 475
475static void free_ringmemory(struct b43legacy_dmaring *ring) 476static void free_ringmemory(struct b43legacy_dmaring *ring)
476{ 477{
477 struct device *dma_dev = ring->dev->dev->dma_dev; 478 ssb_dma_free_consistent(ring->dev->dev, B43legacy_DMA_RINGMEMSIZE,
478 479 ring->descbase, ring->dmabase, GFP_KERNEL);
479 dma_free_coherent(dma_dev, B43legacy_DMA_RINGMEMSIZE,
480 ring->descbase, ring->dmabase);
481} 480}
482 481
483/* Reset the RX DMA channel */ 482/* Reset the RX DMA channel */
@@ -589,7 +588,7 @@ static bool b43legacy_dma_mapping_error(struct b43legacy_dmaring *ring,
589 size_t buffersize, 588 size_t buffersize,
590 bool dma_to_device) 589 bool dma_to_device)
591{ 590{
592 if (unlikely(dma_mapping_error(addr))) 591 if (unlikely(ssb_dma_mapping_error(ring->dev->dev, addr)))
593 return 1; 592 return 1;
594 593
595 switch (ring->type) { 594 switch (ring->type) {
@@ -894,9 +893,9 @@ struct b43legacy_dmaring *b43legacy_setup_dmaring(struct b43legacy_wldev *dev,
894 goto err_kfree_meta; 893 goto err_kfree_meta;
895 894
896 /* test for ability to dma to txhdr_cache */ 895 /* test for ability to dma to txhdr_cache */
897 dma_test = dma_map_single(dev->dev->dma_dev, ring->txhdr_cache, 896 dma_test = ssb_dma_map_single(dev->dev, ring->txhdr_cache,
898 sizeof(struct b43legacy_txhdr_fw3), 897 sizeof(struct b43legacy_txhdr_fw3),
899 DMA_TO_DEVICE); 898 DMA_TO_DEVICE);
900 899
901 if (b43legacy_dma_mapping_error(ring, dma_test, 900 if (b43legacy_dma_mapping_error(ring, dma_test,
902 sizeof(struct b43legacy_txhdr_fw3), 1)) { 901 sizeof(struct b43legacy_txhdr_fw3), 1)) {
@@ -908,7 +907,7 @@ struct b43legacy_dmaring *b43legacy_setup_dmaring(struct b43legacy_wldev *dev,
908 if (!ring->txhdr_cache) 907 if (!ring->txhdr_cache)
909 goto err_kfree_meta; 908 goto err_kfree_meta;
910 909
911 dma_test = dma_map_single(dev->dev->dma_dev, 910 dma_test = ssb_dma_map_single(dev->dev,
912 ring->txhdr_cache, 911 ring->txhdr_cache,
913 sizeof(struct b43legacy_txhdr_fw3), 912 sizeof(struct b43legacy_txhdr_fw3),
914 DMA_TO_DEVICE); 913 DMA_TO_DEVICE);
@@ -918,9 +917,9 @@ struct b43legacy_dmaring *b43legacy_setup_dmaring(struct b43legacy_wldev *dev,
918 goto err_kfree_txhdr_cache; 917 goto err_kfree_txhdr_cache;
919 } 918 }
920 919
921 dma_unmap_single(dev->dev->dma_dev, 920 ssb_dma_unmap_single(dev->dev, dma_test,
922 dma_test, sizeof(struct b43legacy_txhdr_fw3), 921 sizeof(struct b43legacy_txhdr_fw3),
923 DMA_TO_DEVICE); 922 DMA_TO_DEVICE);
924 } 923 }
925 924
926 ring->nr_slots = nr_slots; 925 ring->nr_slots = nr_slots;
diff --git a/drivers/net/wireless/b43legacy/rfkill.c b/drivers/net/wireless/b43legacy/rfkill.c
index d178dfbb1c9..8935a302b22 100644
--- a/drivers/net/wireless/b43legacy/rfkill.c
+++ b/drivers/net/wireless/b43legacy/rfkill.c
@@ -90,7 +90,7 @@ static int b43legacy_rfkill_soft_toggle(void *data, enum rfkill_state state)
90 goto out_unlock; 90 goto out_unlock;
91 err = 0; 91 err = 0;
92 switch (state) { 92 switch (state) {
93 case RFKILL_STATE_ON: 93 case RFKILL_STATE_UNBLOCKED:
94 if (!dev->radio_hw_enable) { 94 if (!dev->radio_hw_enable) {
95 /* No luck. We can't toggle the hardware RF-kill 95 /* No luck. We can't toggle the hardware RF-kill
96 * button from software. */ 96 * button from software. */
@@ -100,10 +100,14 @@ static int b43legacy_rfkill_soft_toggle(void *data, enum rfkill_state state)
100 if (!dev->phy.radio_on) 100 if (!dev->phy.radio_on)
101 b43legacy_radio_turn_on(dev); 101 b43legacy_radio_turn_on(dev);
102 break; 102 break;
103 case RFKILL_STATE_OFF: 103 case RFKILL_STATE_SOFT_BLOCKED:
104 if (dev->phy.radio_on) 104 if (dev->phy.radio_on)
105 b43legacy_radio_turn_off(dev, 0); 105 b43legacy_radio_turn_off(dev, 0);
106 break; 106 break;
107 default:
108 b43legacywarn(wl, "Received unexpected rfkill state %d.\n",
109 state);
110 break;
107 } 111 }
108 112
109out_unlock: 113out_unlock:
diff --git a/drivers/net/wireless/b43legacy/xmit.c b/drivers/net/wireless/b43legacy/xmit.c
index 82dc04d5944..a3540787eb5 100644
--- a/drivers/net/wireless/b43legacy/xmit.c
+++ b/drivers/net/wireless/b43legacy/xmit.c
@@ -442,7 +442,7 @@ void b43legacy_rx(struct b43legacy_wldev *dev,
442 struct b43legacy_plcp_hdr6 *plcp; 442 struct b43legacy_plcp_hdr6 *plcp;
443 struct ieee80211_hdr *wlhdr; 443 struct ieee80211_hdr *wlhdr;
444 const struct b43legacy_rxhdr_fw3 *rxhdr = _rxhdr; 444 const struct b43legacy_rxhdr_fw3 *rxhdr = _rxhdr;
445 u16 fctl; 445 __le16 fctl;
446 u16 phystat0; 446 u16 phystat0;
447 u16 phystat3; 447 u16 phystat3;
448 u16 chanstat; 448 u16 chanstat;
@@ -480,7 +480,7 @@ void b43legacy_rx(struct b43legacy_wldev *dev,
480 goto drop; 480 goto drop;
481 } 481 }
482 wlhdr = (struct ieee80211_hdr *)(skb->data); 482 wlhdr = (struct ieee80211_hdr *)(skb->data);
483 fctl = le16_to_cpu(wlhdr->frame_control); 483 fctl = wlhdr->frame_control;
484 484
485 if ((macstat & B43legacy_RX_MAC_DEC) && 485 if ((macstat & B43legacy_RX_MAC_DEC) &&
486 !(macstat & B43legacy_RX_MAC_DECERR)) { 486 !(macstat & B43legacy_RX_MAC_DECERR)) {
@@ -499,11 +499,11 @@ void b43legacy_rx(struct b43legacy_wldev *dev,
499 499
500 if (dev->key[keyidx].algorithm != B43legacy_SEC_ALGO_NONE) { 500 if (dev->key[keyidx].algorithm != B43legacy_SEC_ALGO_NONE) {
501 /* Remove PROTECTED flag to mark it as decrypted. */ 501 /* Remove PROTECTED flag to mark it as decrypted. */
502 B43legacy_WARN_ON(!(fctl & IEEE80211_FCTL_PROTECTED)); 502 B43legacy_WARN_ON(!ieee80211_has_protected(fctl));
503 fctl &= ~IEEE80211_FCTL_PROTECTED; 503 fctl &= ~cpu_to_le16(IEEE80211_FCTL_PROTECTED);
504 wlhdr->frame_control = cpu_to_le16(fctl); 504 wlhdr->frame_control = fctl;
505 505
506 wlhdr_len = ieee80211_get_hdrlen(fctl); 506 wlhdr_len = ieee80211_hdrlen(fctl);
507 if (unlikely(skb->len < (wlhdr_len + 3))) { 507 if (unlikely(skb->len < (wlhdr_len + 3))) {
508 b43legacydbg(dev->wl, "RX: Packet size" 508 b43legacydbg(dev->wl, "RX: Packet size"
509 " underrun3\n"); 509 " underrun3\n");
@@ -556,9 +556,7 @@ void b43legacy_rx(struct b43legacy_wldev *dev,
556 * of timestamp, i.e. about 65 milliseconds after the PHY received 556 * of timestamp, i.e. about 65 milliseconds after the PHY received
557 * the first symbol. 557 * the first symbol.
558 */ 558 */
559 if (((fctl & (IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) 559 if (ieee80211_is_beacon(fctl) || dev->wl->radiotap_enabled) {
560 == (IEEE80211_FTYPE_MGMT | IEEE80211_STYPE_BEACON)) ||
561 dev->wl->radiotap_enabled) {
562 u16 low_mactime_now; 560 u16 low_mactime_now;
563 561
564 b43legacy_tsf_read(dev, &status.mactime); 562 b43legacy_tsf_read(dev, &status.mactime);