aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net
diff options
context:
space:
mode:
authorSeth Forshee <seth.forshee@canonical.com>2012-11-15 09:08:07 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-11-20 14:07:12 -0500
commit90123e045cac4ce8ec13e266f030c618fa674554 (patch)
treee5ad019b9696c6e38e20e9218f7a4b4a78d39133 /drivers/net
parent229a41d9d0d27e9570a18444e6435164b8807c75 (diff)
brcmsmac: Add brcms_dbg_dma() debug macro
Also convert relevant messages to use this macro. Signed-off-by: Seth Forshee <seth.forshee@canonical.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Reviewed-by: Arend van Spriel <arend@broadcom.com> Tested-by: Daniel Wagner <wagi@monom.org> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/debug.h1
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/dma.c155
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/dma.h2
-rw-r--r--drivers/net/wireless/brcm80211/brcmsmac/main.c10
-rw-r--r--drivers/net/wireless/brcm80211/include/defs.h1
5 files changed, 73 insertions, 96 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/debug.h b/drivers/net/wireless/brcm80211/brcmsmac/debug.h
index 1114833464cd..2e7e077ca680 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/debug.h
+++ b/drivers/net/wireless/brcm80211/brcmsmac/debug.h
@@ -40,5 +40,6 @@ static inline void __brcms_dbg(struct device *dev, u32 level,
40#define brcms_dbg_rx(core, f, a...) brcms_dbg(core, BRCM_DL_RX, f, ##a) 40#define brcms_dbg_rx(core, f, a...) brcms_dbg(core, BRCM_DL_RX, f, ##a)
41#define brcms_dbg_tx(core, f, a...) brcms_dbg(core, BRCM_DL_TX, f, ##a) 41#define brcms_dbg_tx(core, f, a...) brcms_dbg(core, BRCM_DL_TX, f, ##a)
42#define brcms_dbg_int(core, f, a...) brcms_dbg(core, BRCM_DL_INT, f, ##a) 42#define brcms_dbg_int(core, f, a...) brcms_dbg(core, BRCM_DL_INT, f, ##a)
43#define brcms_dbg_dma(core, f, a...) brcms_dbg(core, BRCM_DL_DMA, f, ##a)
43 44
44#endif /* _BRCMS_DEBUG_H_ */ 45#endif /* _BRCMS_DEBUG_H_ */
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/dma.c b/drivers/net/wireless/brcm80211/brcmsmac/dma.c
index d7ce1ac9adc9..ba3344310f07 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/dma.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/dma.c
@@ -14,8 +14,6 @@
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. 14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */ 15 */
16 16
17#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
18
19#include <linux/slab.h> 17#include <linux/slab.h>
20#include <linux/delay.h> 18#include <linux/delay.h>
21#include <linux/pci.h> 19#include <linux/pci.h>
@@ -30,6 +28,7 @@
30#include "soc.h" 28#include "soc.h"
31#include "scb.h" 29#include "scb.h"
32#include "ampdu.h" 30#include "ampdu.h"
31#include "debug.h"
33 32
34/* 33/*
35 * dma register field offset calculation 34 * dma register field offset calculation
@@ -181,28 +180,6 @@
181 180
182#define BCMEXTRAHDROOM 172 181#define BCMEXTRAHDROOM 172
183 182
184/* debug/trace */
185#ifdef DEBUG
186#define DMA_ERROR(fmt, ...) \
187do { \
188 if (*di->msg_level & 1) \
189 pr_debug("%s: " fmt, __func__, ##__VA_ARGS__); \
190} while (0)
191#define DMA_TRACE(fmt, ...) \
192do { \
193 if (*di->msg_level & 2) \
194 pr_debug("%s: " fmt, __func__, ##__VA_ARGS__); \
195} while (0)
196#else
197#define DMA_ERROR(fmt, ...) \
198 no_printk(fmt, ##__VA_ARGS__)
199#define DMA_TRACE(fmt, ...) \
200 no_printk(fmt, ##__VA_ARGS__)
201#endif /* DEBUG */
202
203#define DMA_NONE(fmt, ...) \
204 no_printk(fmt, ##__VA_ARGS__)
205
206#define MAXNAMEL 8 /* 8 char names */ 183#define MAXNAMEL 8 /* 8 char names */
207 184
208/* macros to convert between byte offsets and indexes */ 185/* macros to convert between byte offsets and indexes */
@@ -229,7 +206,6 @@ struct dma64desc {
229/* dma engine software state */ 206/* dma engine software state */
230struct dma_info { 207struct dma_info {
231 struct dma_pub dma; /* exported structure */ 208 struct dma_pub dma; /* exported structure */
232 uint *msg_level; /* message level pointer */
233 char name[MAXNAMEL]; /* callers name for diag msgs */ 209 char name[MAXNAMEL]; /* callers name for diag msgs */
234 210
235 struct bcma_device *core; 211 struct bcma_device *core;
@@ -306,12 +282,6 @@ struct dma_info {
306 bool aligndesc_4k; 282 bool aligndesc_4k;
307}; 283};
308 284
309/*
310 * default dma message level (if input msg_level
311 * pointer is null in dma_attach())
312 */
313static uint dma_msg_level;
314
315/* Check for odd number of 1's */ 285/* Check for odd number of 1's */
316static u32 parity32(__le32 data) 286static u32 parity32(__le32 data)
317{ 287{
@@ -379,7 +349,7 @@ static uint _dma_ctrlflags(struct dma_info *di, uint mask, uint flags)
379 uint dmactrlflags; 349 uint dmactrlflags;
380 350
381 if (di == NULL) { 351 if (di == NULL) {
382 DMA_ERROR("NULL dma handle\n"); 352 brcms_dbg_dma(di->core, "NULL dma handle\n");
383 return 0; 353 return 0;
384 } 354 }
385 355
@@ -431,13 +401,15 @@ static bool _dma_isaddrext(struct dma_info *di)
431 /* not all tx or rx channel are available */ 401 /* not all tx or rx channel are available */
432 if (di->d64txregbase != 0) { 402 if (di->d64txregbase != 0) {
433 if (!_dma64_addrext(di, DMA64TXREGOFFS(di, control))) 403 if (!_dma64_addrext(di, DMA64TXREGOFFS(di, control)))
434 DMA_ERROR("%s: DMA64 tx doesn't have AE set\n", 404 brcms_dbg_dma(di->core,
435 di->name); 405 "%s: DMA64 tx doesn't have AE set\n",
406 di->name);
436 return true; 407 return true;
437 } else if (di->d64rxregbase != 0) { 408 } else if (di->d64rxregbase != 0) {
438 if (!_dma64_addrext(di, DMA64RXREGOFFS(di, control))) 409 if (!_dma64_addrext(di, DMA64RXREGOFFS(di, control)))
439 DMA_ERROR("%s: DMA64 rx doesn't have AE set\n", 410 brcms_dbg_dma(di->core,
440 di->name); 411 "%s: DMA64 rx doesn't have AE set\n",
412 di->name);
441 return true; 413 return true;
442 } 414 }
443 415
@@ -538,8 +510,9 @@ static bool dma64_alloc(struct dma_info *di, uint direction)
538 va = dma_ringalloc(di, D64RINGALIGN, size, &align_bits, 510 va = dma_ringalloc(di, D64RINGALIGN, size, &align_bits,
539 &alloced, &di->txdpaorig); 511 &alloced, &di->txdpaorig);
540 if (va == NULL) { 512 if (va == NULL) {
541 DMA_ERROR("%s: DMA_ALLOC_CONSISTENT(ntxd) failed\n", 513 brcms_dbg_dma(di->core,
542 di->name); 514 "%s: DMA_ALLOC_CONSISTENT(ntxd) failed\n",
515 di->name);
543 return false; 516 return false;
544 } 517 }
545 align = (1 << align_bits); 518 align = (1 << align_bits);
@@ -552,8 +525,9 @@ static bool dma64_alloc(struct dma_info *di, uint direction)
552 va = dma_ringalloc(di, D64RINGALIGN, size, &align_bits, 525 va = dma_ringalloc(di, D64RINGALIGN, size, &align_bits,
553 &alloced, &di->rxdpaorig); 526 &alloced, &di->rxdpaorig);
554 if (va == NULL) { 527 if (va == NULL) {
555 DMA_ERROR("%s: DMA_ALLOC_CONSISTENT(nrxd) failed\n", 528 brcms_dbg_dma(di->core,
556 di->name); 529 "%s: DMA_ALLOC_CONSISTENT(nrxd) failed\n",
530 di->name);
557 return false; 531 return false;
558 } 532 }
559 align = (1 << align_bits); 533 align = (1 << align_bits);
@@ -575,7 +549,7 @@ static bool _dma_alloc(struct dma_info *di, uint direction)
575struct dma_pub *dma_attach(char *name, struct brcms_c_info *wlc, 549struct dma_pub *dma_attach(char *name, struct brcms_c_info *wlc,
576 uint txregbase, uint rxregbase, uint ntxd, uint nrxd, 550 uint txregbase, uint rxregbase, uint ntxd, uint nrxd,
577 uint rxbufsize, int rxextheadroom, 551 uint rxbufsize, int rxextheadroom,
578 uint nrxpost, uint rxoffset, uint *msg_level) 552 uint nrxpost, uint rxoffset)
579{ 553{
580 struct si_pub *sih = wlc->hw->sih; 554 struct si_pub *sih = wlc->hw->sih;
581 struct bcma_device *core = wlc->hw->d11core; 555 struct bcma_device *core = wlc->hw->d11core;
@@ -589,9 +563,6 @@ struct dma_pub *dma_attach(char *name, struct brcms_c_info *wlc,
589 if (di == NULL) 563 if (di == NULL)
590 return NULL; 564 return NULL;
591 565
592 di->msg_level = msg_level ? msg_level : &dma_msg_level;
593
594
595 di->dma64 = 566 di->dma64 =
596 ((bcma_aread32(core, BCMA_IOST) & SISF_DMA64) == SISF_DMA64); 567 ((bcma_aread32(core, BCMA_IOST) & SISF_DMA64) == SISF_DMA64);
597 568
@@ -607,11 +578,11 @@ struct dma_pub *dma_attach(char *name, struct brcms_c_info *wlc,
607 */ 578 */
608 _dma_ctrlflags(di, DMA_CTRL_ROC | DMA_CTRL_PEN, 0); 579 _dma_ctrlflags(di, DMA_CTRL_ROC | DMA_CTRL_PEN, 0);
609 580
610 DMA_TRACE("%s: %s flags 0x%x ntxd %d nrxd %d " 581 brcms_dbg_dma(di->core, "%s: %s flags 0x%x ntxd %d nrxd %d "
611 "rxbufsize %d rxextheadroom %d nrxpost %d rxoffset %d " 582 "rxbufsize %d rxextheadroom %d nrxpost %d rxoffset %d "
612 "txregbase %u rxregbase %u\n", name, "DMA64", 583 "txregbase %u rxregbase %u\n", name, "DMA64",
613 di->dma.dmactrlflags, ntxd, nrxd, rxbufsize, 584 di->dma.dmactrlflags, ntxd, nrxd, rxbufsize,
614 rxextheadroom, nrxpost, rxoffset, txregbase, rxregbase); 585 rxextheadroom, nrxpost, rxoffset, txregbase, rxregbase);
615 586
616 /* make a private copy of our callers name */ 587 /* make a private copy of our callers name */
617 strncpy(di->name, name, MAXNAMEL); 588 strncpy(di->name, name, MAXNAMEL);
@@ -673,8 +644,8 @@ struct dma_pub *dma_attach(char *name, struct brcms_c_info *wlc,
673 di->dmadesc_align = 4; /* 16 byte alignment */ 644 di->dmadesc_align = 4; /* 16 byte alignment */
674 } 645 }
675 646
676 DMA_NONE("DMA descriptor align_needed %d, align %d\n", 647 brcms_dbg_dma(di->core, "DMA descriptor align_needed %d, align %d\n",
677 di->aligndesc_4k, di->dmadesc_align); 648 di->aligndesc_4k, di->dmadesc_align);
678 649
679 /* allocate tx packet pointer vector */ 650 /* allocate tx packet pointer vector */
680 if (ntxd) { 651 if (ntxd) {
@@ -712,13 +683,15 @@ struct dma_pub *dma_attach(char *name, struct brcms_c_info *wlc,
712 683
713 if ((di->ddoffsetlow != 0) && !di->addrext) { 684 if ((di->ddoffsetlow != 0) && !di->addrext) {
714 if (di->txdpa > SI_PCI_DMA_SZ) { 685 if (di->txdpa > SI_PCI_DMA_SZ) {
715 DMA_ERROR("%s: txdpa 0x%x: addrext not supported\n", 686 brcms_dbg_dma(di->core,
716 di->name, (u32)di->txdpa); 687 "%s: txdpa 0x%x: addrext not supported\n",
688 di->name, (u32)di->txdpa);
717 goto fail; 689 goto fail;
718 } 690 }
719 if (di->rxdpa > SI_PCI_DMA_SZ) { 691 if (di->rxdpa > SI_PCI_DMA_SZ) {
720 DMA_ERROR("%s: rxdpa 0x%x: addrext not supported\n", 692 brcms_dbg_dma(di->core,
721 di->name, (u32)di->rxdpa); 693 "%s: rxdpa 0x%x: addrext not supported\n",
694 di->name, (u32)di->rxdpa);
722 goto fail; 695 goto fail;
723 } 696 }
724 } 697 }
@@ -726,10 +699,11 @@ struct dma_pub *dma_attach(char *name, struct brcms_c_info *wlc,
726 /* Initialize AMPDU session */ 699 /* Initialize AMPDU session */
727 brcms_c_ampdu_reset_session(&di->ampdu_session, wlc); 700 brcms_c_ampdu_reset_session(&di->ampdu_session, wlc);
728 701
729 DMA_TRACE("ddoffsetlow 0x%x ddoffsethigh 0x%x dataoffsetlow 0x%x dataoffsethigh 0x%x addrext %d\n", 702 brcms_dbg_dma(di->core,
730 di->ddoffsetlow, di->ddoffsethigh, 703 "ddoffsetlow 0x%x ddoffsethigh 0x%x dataoffsetlow 0x%x dataoffsethigh 0x%x addrext %d\n",
731 di->dataoffsetlow, di->dataoffsethigh, 704 di->ddoffsetlow, di->ddoffsethigh,
732 di->addrext); 705 di->dataoffsetlow, di->dataoffsethigh,
706 di->addrext);
733 707
734 return (struct dma_pub *) di; 708 return (struct dma_pub *) di;
735 709
@@ -775,7 +749,7 @@ void dma_detach(struct dma_pub *pub)
775{ 749{
776 struct dma_info *di = (struct dma_info *)pub; 750 struct dma_info *di = (struct dma_info *)pub;
777 751
778 DMA_TRACE("%s:\n", di->name); 752 brcms_dbg_dma(di->core, "%s:\n", di->name);
779 753
780 /* free dma descriptor rings */ 754 /* free dma descriptor rings */
781 if (di->txd64) 755 if (di->txd64)
@@ -851,7 +825,7 @@ static void _dma_rxenable(struct dma_info *di)
851 uint dmactrlflags = di->dma.dmactrlflags; 825 uint dmactrlflags = di->dma.dmactrlflags;
852 u32 control; 826 u32 control;
853 827
854 DMA_TRACE("%s:\n", di->name); 828 brcms_dbg_dma(di->core, "%s:\n", di->name);
855 829
856 control = D64_RC_RE | (bcma_read32(di->core, 830 control = D64_RC_RE | (bcma_read32(di->core,
857 DMA64RXREGOFFS(di, control)) & 831 DMA64RXREGOFFS(di, control)) &
@@ -871,7 +845,7 @@ void dma_rxinit(struct dma_pub *pub)
871{ 845{
872 struct dma_info *di = (struct dma_info *)pub; 846 struct dma_info *di = (struct dma_info *)pub;
873 847
874 DMA_TRACE("%s:\n", di->name); 848 brcms_dbg_dma(di->core, "%s:\n", di->name);
875 849
876 if (di->nrxd == 0) 850 if (di->nrxd == 0)
877 return; 851 return;
@@ -966,7 +940,7 @@ int dma_rx(struct dma_pub *pub, struct sk_buff_head *skb_list)
966 return 0; 940 return 0;
967 941
968 len = le16_to_cpu(*(__le16 *) (p->data)); 942 len = le16_to_cpu(*(__le16 *) (p->data));
969 DMA_TRACE("%s: dma_rx len %d\n", di->name, len); 943 brcms_dbg_dma(di->core, "%s: dma_rx len %d\n", di->name, len);
970 dma_spin_for_len(len, p); 944 dma_spin_for_len(len, p);
971 945
972 /* set actual length */ 946 /* set actual length */
@@ -993,14 +967,15 @@ int dma_rx(struct dma_pub *pub, struct sk_buff_head *skb_list)
993 DMA64RXREGOFFS(di, status0)) & 967 DMA64RXREGOFFS(di, status0)) &
994 D64_RS0_CD_MASK) - di->rcvptrbase) & 968 D64_RS0_CD_MASK) - di->rcvptrbase) &
995 D64_RS0_CD_MASK, struct dma64desc); 969 D64_RS0_CD_MASK, struct dma64desc);
996 DMA_ERROR("rxin %d rxout %d, hw_curr %d\n", 970 brcms_dbg_dma(di->core,
997 di->rxin, di->rxout, cur); 971 "rxin %d rxout %d, hw_curr %d\n",
972 di->rxin, di->rxout, cur);
998 } 973 }
999#endif /* DEBUG */ 974#endif /* DEBUG */
1000 975
1001 if ((di->dma.dmactrlflags & DMA_CTRL_RXMULTI) == 0) { 976 if ((di->dma.dmactrlflags & DMA_CTRL_RXMULTI) == 0) {
1002 DMA_ERROR("%s: bad frame length (%d)\n", 977 brcms_dbg_dma(di->core, "%s: bad frame length (%d)\n",
1003 di->name, len); 978 di->name, len);
1004 skb_queue_walk_safe(&dma_frames, p, next) { 979 skb_queue_walk_safe(&dma_frames, p, next) {
1005 skb_unlink(p, &dma_frames); 980 skb_unlink(p, &dma_frames);
1006 brcmu_pkt_buf_free_skb(p); 981 brcmu_pkt_buf_free_skb(p);
@@ -1017,7 +992,7 @@ int dma_rx(struct dma_pub *pub, struct sk_buff_head *skb_list)
1017 992
1018static bool dma64_rxidle(struct dma_info *di) 993static bool dma64_rxidle(struct dma_info *di)
1019{ 994{
1020 DMA_TRACE("%s:\n", di->name); 995 brcms_dbg_dma(di->core, "%s:\n", di->name);
1021 996
1022 if (di->nrxd == 0) 997 if (di->nrxd == 0)
1023 return true; 998 return true;
@@ -1070,7 +1045,7 @@ bool dma_rxfill(struct dma_pub *pub)
1070 1045
1071 n = di->nrxpost - nrxdactive(di, rxin, rxout); 1046 n = di->nrxpost - nrxdactive(di, rxin, rxout);
1072 1047
1073 DMA_TRACE("%s: post %d\n", di->name, n); 1048 brcms_dbg_dma(di->core, "%s: post %d\n", di->name, n);
1074 1049
1075 if (di->rxbufsize > BCMEXTRAHDROOM) 1050 if (di->rxbufsize > BCMEXTRAHDROOM)
1076 extra_offset = di->rxextrahdrroom; 1051 extra_offset = di->rxextrahdrroom;
@@ -1083,9 +1058,11 @@ bool dma_rxfill(struct dma_pub *pub)
1083 p = brcmu_pkt_buf_get_skb(di->rxbufsize + extra_offset); 1058 p = brcmu_pkt_buf_get_skb(di->rxbufsize + extra_offset);
1084 1059
1085 if (p == NULL) { 1060 if (p == NULL) {
1086 DMA_ERROR("%s: out of rxbufs\n", di->name); 1061 brcms_dbg_dma(di->core, "%s: out of rxbufs\n",
1062 di->name);
1087 if (i == 0 && dma64_rxidle(di)) { 1063 if (i == 0 && dma64_rxidle(di)) {
1088 DMA_ERROR("%s: ring is empty !\n", di->name); 1064 brcms_dbg_dma(di->core, "%s: ring is empty !\n",
1065 di->name);
1089 ring_empty = true; 1066 ring_empty = true;
1090 } 1067 }
1091 di->dma.rxnobuf++; 1068 di->dma.rxnobuf++;
@@ -1130,7 +1107,7 @@ void dma_rxreclaim(struct dma_pub *pub)
1130 struct dma_info *di = (struct dma_info *)pub; 1107 struct dma_info *di = (struct dma_info *)pub;
1131 struct sk_buff *p; 1108 struct sk_buff *p;
1132 1109
1133 DMA_TRACE("%s:\n", di->name); 1110 brcms_dbg_dma(di->core, "%s:\n", di->name);
1134 1111
1135 while ((p = _dma_getnextrxp(di, true))) 1112 while ((p = _dma_getnextrxp(di, true)))
1136 brcmu_pkt_buf_free_skb(p); 1113 brcmu_pkt_buf_free_skb(p);
@@ -1161,7 +1138,7 @@ void dma_txinit(struct dma_pub *pub)
1161 struct dma_info *di = (struct dma_info *)pub; 1138 struct dma_info *di = (struct dma_info *)pub;
1162 u32 control = D64_XC_XE; 1139 u32 control = D64_XC_XE;
1163 1140
1164 DMA_TRACE("%s:\n", di->name); 1141 brcms_dbg_dma(di->core, "%s:\n", di->name);
1165 1142
1166 if (di->ntxd == 0) 1143 if (di->ntxd == 0)
1167 return; 1144 return;
@@ -1193,7 +1170,7 @@ void dma_txsuspend(struct dma_pub *pub)
1193{ 1170{
1194 struct dma_info *di = (struct dma_info *)pub; 1171 struct dma_info *di = (struct dma_info *)pub;
1195 1172
1196 DMA_TRACE("%s:\n", di->name); 1173 brcms_dbg_dma(di->core, "%s:\n", di->name);
1197 1174
1198 if (di->ntxd == 0) 1175 if (di->ntxd == 0)
1199 return; 1176 return;
@@ -1205,7 +1182,7 @@ void dma_txresume(struct dma_pub *pub)
1205{ 1182{
1206 struct dma_info *di = (struct dma_info *)pub; 1183 struct dma_info *di = (struct dma_info *)pub;
1207 1184
1208 DMA_TRACE("%s:\n", di->name); 1185 brcms_dbg_dma(di->core, "%s:\n", di->name);
1209 1186
1210 if (di->ntxd == 0) 1187 if (di->ntxd == 0)
1211 return; 1188 return;
@@ -1228,11 +1205,11 @@ void dma_txreclaim(struct dma_pub *pub, enum txd_range range)
1228 struct dma_info *di = (struct dma_info *)pub; 1205 struct dma_info *di = (struct dma_info *)pub;
1229 struct sk_buff *p; 1206 struct sk_buff *p;
1230 1207
1231 DMA_TRACE("%s: %s\n", 1208 brcms_dbg_dma(di->core, "%s: %s\n",
1232 di->name, 1209 di->name,
1233 range == DMA_RANGE_ALL ? "all" : 1210 range == DMA_RANGE_ALL ? "all" :
1234 range == DMA_RANGE_TRANSMITTED ? "transmitted" : 1211 range == DMA_RANGE_TRANSMITTED ? "transmitted" :
1235 "transferred"); 1212 "transferred");
1236 1213
1237 if (di->txin == di->txout) 1214 if (di->txin == di->txout)
1238 return; 1215 return;
@@ -1392,7 +1369,7 @@ int dma_txfast(struct brcms_c_info *wlc, struct dma_pub *pub,
1392 struct ieee80211_tx_info *tx_info; 1369 struct ieee80211_tx_info *tx_info;
1393 bool is_ampdu; 1370 bool is_ampdu;
1394 1371
1395 DMA_TRACE("%s:\n", di->name); 1372 brcms_dbg_dma(di->core, "%s:\n", di->name);
1396 1373
1397 /* no use to transmit a zero length packet */ 1374 /* no use to transmit a zero length packet */
1398 if (p->len == 0) 1375 if (p->len == 0)
@@ -1430,7 +1407,7 @@ int dma_txfast(struct brcms_c_info *wlc, struct dma_pub *pub,
1430 return 0; 1407 return 0;
1431 1408
1432 outoftxd: 1409 outoftxd:
1433 DMA_ERROR("%s: out of txds !!!\n", di->name); 1410 brcms_dbg_dma(di->core, "%s: out of txds !!!\n", di->name);
1434 brcmu_pkt_buf_free_skb(p); 1411 brcmu_pkt_buf_free_skb(p);
1435 di->dma.txavail = 0; 1412 di->dma.txavail = 0;
1436 di->dma.txnobuf++; 1413 di->dma.txnobuf++;
@@ -1482,11 +1459,11 @@ struct sk_buff *dma_getnexttxp(struct dma_pub *pub, enum txd_range range)
1482 u16 active_desc; 1459 u16 active_desc;
1483 struct sk_buff *txp; 1460 struct sk_buff *txp;
1484 1461
1485 DMA_TRACE("%s: %s\n", 1462 brcms_dbg_dma(di->core, "%s: %s\n",
1486 di->name, 1463 di->name,
1487 range == DMA_RANGE_ALL ? "all" : 1464 range == DMA_RANGE_ALL ? "all" :
1488 range == DMA_RANGE_TRANSMITTED ? "transmitted" : 1465 range == DMA_RANGE_TRANSMITTED ? "transmitted" :
1489 "transferred"); 1466 "transferred");
1490 1467
1491 if (di->ntxd == 0) 1468 if (di->ntxd == 0)
1492 return NULL; 1469 return NULL;
@@ -1545,8 +1522,8 @@ struct sk_buff *dma_getnexttxp(struct dma_pub *pub, enum txd_range range)
1545 return txp; 1522 return txp;
1546 1523
1547 bogus: 1524 bogus:
1548 DMA_NONE("bogus curr: start %d end %d txout %d\n", 1525 brcms_dbg_dma(di->core, "bogus curr: start %d end %d txout %d\n",
1549 start, end, di->txout); 1526 start, end, di->txout);
1550 return NULL; 1527 return NULL;
1551} 1528}
1552 1529
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/dma.h b/drivers/net/wireless/brcm80211/brcmsmac/dma.h
index 459abf13924a..ff5b80b09046 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/dma.h
+++ b/drivers/net/wireless/brcm80211/brcmsmac/dma.h
@@ -78,7 +78,7 @@ extern struct dma_pub *dma_attach(char *name, struct brcms_c_info *wlc,
78 uint txregbase, uint rxregbase, 78 uint txregbase, uint rxregbase,
79 uint ntxd, uint nrxd, 79 uint ntxd, uint nrxd,
80 uint rxbufsize, int rxextheadroom, 80 uint rxbufsize, int rxextheadroom,
81 uint nrxpost, uint rxoffset, uint *msg_level); 81 uint nrxpost, uint rxoffset);
82 82
83void dma_rxinit(struct dma_pub *pub); 83void dma_rxinit(struct dma_pub *pub);
84int dma_rx(struct dma_pub *pub, struct sk_buff_head *skb_list); 84int dma_rx(struct dma_pub *pub, struct sk_buff_head *skb_list);
diff --git a/drivers/net/wireless/brcm80211/brcmsmac/main.c b/drivers/net/wireless/brcm80211/brcmsmac/main.c
index bfd796e69a81..84440a8751fd 100644
--- a/drivers/net/wireless/brcm80211/brcmsmac/main.c
+++ b/drivers/net/wireless/brcm80211/brcmsmac/main.c
@@ -1153,7 +1153,7 @@ static bool brcms_b_attach_dmapio(struct brcms_c_info *wlc, uint j, bool wme)
1153 dmareg(DMA_RX, 0), 1153 dmareg(DMA_RX, 0),
1154 (wme ? NTXD : 0), NRXD, 1154 (wme ? NTXD : 0), NRXD,
1155 RXBUFSZ, -1, NRXBUFPOST, 1155 RXBUFSZ, -1, NRXBUFPOST,
1156 BRCMS_HWRXOFF, &brcm_msg_level); 1156 BRCMS_HWRXOFF);
1157 dma_attach_err |= (NULL == wlc_hw->di[0]); 1157 dma_attach_err |= (NULL == wlc_hw->di[0]);
1158 1158
1159 /* 1159 /*
@@ -1164,8 +1164,7 @@ static bool brcms_b_attach_dmapio(struct brcms_c_info *wlc, uint j, bool wme)
1164 */ 1164 */
1165 wlc_hw->di[1] = dma_attach(name, wlc, 1165 wlc_hw->di[1] = dma_attach(name, wlc,
1166 dmareg(DMA_TX, 1), 0, 1166 dmareg(DMA_TX, 1), 0,
1167 NTXD, 0, 0, -1, 0, 0, 1167 NTXD, 0, 0, -1, 0, 0);
1168 &brcm_msg_level);
1169 dma_attach_err |= (NULL == wlc_hw->di[1]); 1168 dma_attach_err |= (NULL == wlc_hw->di[1]);
1170 1169
1171 /* 1170 /*
@@ -1175,8 +1174,7 @@ static bool brcms_b_attach_dmapio(struct brcms_c_info *wlc, uint j, bool wme)
1175 */ 1174 */
1176 wlc_hw->di[2] = dma_attach(name, wlc, 1175 wlc_hw->di[2] = dma_attach(name, wlc,
1177 dmareg(DMA_TX, 2), 0, 1176 dmareg(DMA_TX, 2), 0,
1178 NTXD, 0, 0, -1, 0, 0, 1177 NTXD, 0, 0, -1, 0, 0);
1179 &brcm_msg_level);
1180 dma_attach_err |= (NULL == wlc_hw->di[2]); 1178 dma_attach_err |= (NULL == wlc_hw->di[2]);
1181 /* 1179 /*
1182 * FIFO 3 1180 * FIFO 3
@@ -1186,7 +1184,7 @@ static bool brcms_b_attach_dmapio(struct brcms_c_info *wlc, uint j, bool wme)
1186 wlc_hw->di[3] = dma_attach(name, wlc, 1184 wlc_hw->di[3] = dma_attach(name, wlc,
1187 dmareg(DMA_TX, 3), 1185 dmareg(DMA_TX, 3),
1188 0, NTXD, 0, 0, -1, 1186 0, NTXD, 0, 0, -1,
1189 0, 0, &brcm_msg_level); 1187 0, 0);
1190 dma_attach_err |= (NULL == wlc_hw->di[3]); 1188 dma_attach_err |= (NULL == wlc_hw->di[3]);
1191/* Cleaner to leave this as if with AP defined */ 1189/* Cleaner to leave this as if with AP defined */
1192 1190
diff --git a/drivers/net/wireless/brcm80211/include/defs.h b/drivers/net/wireless/brcm80211/include/defs.h
index 12dd33fb985f..54ffe7ff0191 100644
--- a/drivers/net/wireless/brcm80211/include/defs.h
+++ b/drivers/net/wireless/brcm80211/include/defs.h
@@ -84,6 +84,7 @@
84#define BRCM_DL_RX 0x00000004 84#define BRCM_DL_RX 0x00000004
85#define BRCM_DL_TX 0x00000008 85#define BRCM_DL_TX 0x00000008
86#define BRCM_DL_INT 0x00000010 86#define BRCM_DL_INT 0x00000010
87#define BRCM_DL_DMA 0x00000020
87 88
88#define PM_OFF 0 89#define PM_OFF 0
89#define PM_MAX 1 90#define PM_MAX 1