aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
diff options
context:
space:
mode:
authorArend van Spriel <arend@broadcom.com>2012-12-07 04:49:57 -0500
committerJohn W. Linville <linville@tuxdriver.com>2012-12-10 15:33:06 -0500
commit5e8149f5036afe2d94b5fafc9ff752283804a752 (patch)
treeb21016be1f39e649b4b79a4abfb75e93fecfe7b9 /drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
parentdc5cbdfdf7936178361c386de84aaf64e8842789 (diff)
brcmfmac: error messages should not be suppressed
The call to brcmf_dbg(ERROR, ...) only resulted in a log message when compiled with -DDEBUG. Error messages are valuable for resolving issues so this patch replaces it with brcmf_err(...) so they always end up in the log. Reviewed-by: Hante Meuleman <meuleman@broadcom.com> Reviewed-by: Pieter-Paul Giesberts <pieterpg@broadcom.com> Signed-off-by: Arend van Spriel <arend@broadcom.com> Signed-off-by: John W. Linville <linville@tuxdriver.com>
Diffstat (limited to 'drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c')
-rw-r--r--drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c189
1 files changed, 94 insertions, 95 deletions
diff --git a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
index f2293bbb3c9..cf857f1edf8 100644
--- a/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
+++ b/drivers/net/wireless/brcm80211/brcmfmac/dhd_sdio.c
@@ -689,7 +689,7 @@ static int brcmf_sdbrcm_htclk(struct brcmf_sdio *bus, bool on, bool pendok)
689 brcmf_sdio_regwb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR, 689 brcmf_sdio_regwb(bus->sdiodev, SBSDIO_FUNC1_CHIPCLKCSR,
690 clkreq, &err); 690 clkreq, &err);
691 if (err) { 691 if (err) {
692 brcmf_dbg(ERROR, "HT Avail request error: %d\n", err); 692 brcmf_err("HT Avail request error: %d\n", err);
693 return -EBADE; 693 return -EBADE;
694 } 694 }
695 695
@@ -697,7 +697,7 @@ static int brcmf_sdbrcm_htclk(struct brcmf_sdio *bus, bool on, bool pendok)
697 clkctl = brcmf_sdio_regrb(bus->sdiodev, 697 clkctl = brcmf_sdio_regrb(bus->sdiodev,
698 SBSDIO_FUNC1_CHIPCLKCSR, &err); 698 SBSDIO_FUNC1_CHIPCLKCSR, &err);
699 if (err) { 699 if (err) {
700 brcmf_dbg(ERROR, "HT Avail read error: %d\n", err); 700 brcmf_err("HT Avail read error: %d\n", err);
701 return -EBADE; 701 return -EBADE;
702 } 702 }
703 703
@@ -707,7 +707,7 @@ static int brcmf_sdbrcm_htclk(struct brcmf_sdio *bus, bool on, bool pendok)
707 devctl = brcmf_sdio_regrb(bus->sdiodev, 707 devctl = brcmf_sdio_regrb(bus->sdiodev,
708 SBSDIO_DEVICE_CTL, &err); 708 SBSDIO_DEVICE_CTL, &err);
709 if (err) { 709 if (err) {
710 brcmf_dbg(ERROR, "Devctl error setting CA: %d\n", 710 brcmf_err("Devctl error setting CA: %d\n",
711 err); 711 err);
712 return -EBADE; 712 return -EBADE;
713 } 713 }
@@ -741,11 +741,11 @@ static int brcmf_sdbrcm_htclk(struct brcmf_sdio *bus, bool on, bool pendok)
741 usleep_range(5000, 10000); 741 usleep_range(5000, 10000);
742 } 742 }
743 if (err) { 743 if (err) {
744 brcmf_dbg(ERROR, "HT Avail request error: %d\n", err); 744 brcmf_err("HT Avail request error: %d\n", err);
745 return -EBADE; 745 return -EBADE;
746 } 746 }
747 if (!SBSDIO_CLKAV(clkctl, bus->alp_only)) { 747 if (!SBSDIO_CLKAV(clkctl, bus->alp_only)) {
748 brcmf_dbg(ERROR, "HT Avail timeout (%d): clkctl 0x%02x\n", 748 brcmf_err("HT Avail timeout (%d): clkctl 0x%02x\n",
749 PMU_MAX_TRANSITION_DLY, clkctl); 749 PMU_MAX_TRANSITION_DLY, clkctl);
750 return -EBADE; 750 return -EBADE;
751 } 751 }
@@ -757,7 +757,7 @@ static int brcmf_sdbrcm_htclk(struct brcmf_sdio *bus, bool on, bool pendok)
757#if defined(DEBUG) 757#if defined(DEBUG)
758 if (!bus->alp_only) { 758 if (!bus->alp_only) {
759 if (SBSDIO_ALPONLY(clkctl)) 759 if (SBSDIO_ALPONLY(clkctl))
760 brcmf_dbg(ERROR, "HT Clock should be on\n"); 760 brcmf_err("HT Clock should be on\n");
761 } 761 }
762#endif /* defined (DEBUG) */ 762#endif /* defined (DEBUG) */
763 763
@@ -779,7 +779,7 @@ static int brcmf_sdbrcm_htclk(struct brcmf_sdio *bus, bool on, bool pendok)
779 clkreq, &err); 779 clkreq, &err);
780 brcmf_dbg(INFO, "CLKCTL: turned OFF\n"); 780 brcmf_dbg(INFO, "CLKCTL: turned OFF\n");
781 if (err) { 781 if (err) {
782 brcmf_dbg(ERROR, "Failed access turning clock off: %d\n", 782 brcmf_err("Failed access turning clock off: %d\n",
783 err); 783 err);
784 return -EBADE; 784 return -EBADE;
785 } 785 }
@@ -836,7 +836,7 @@ static int brcmf_sdbrcm_clkctl(struct brcmf_sdio *bus, uint target, bool pendok)
836 else if (bus->clkstate == CLK_AVAIL) 836 else if (bus->clkstate == CLK_AVAIL)
837 brcmf_sdbrcm_htclk(bus, false, false); 837 brcmf_sdbrcm_htclk(bus, false, false);
838 else 838 else
839 brcmf_dbg(ERROR, "request for %d -> %d\n", 839 brcmf_err("request for %d -> %d\n",
840 bus->clkstate, target); 840 bus->clkstate, target);
841 brcmf_sdbrcm_wd_timer(bus, BRCMF_WD_POLL_MS); 841 brcmf_sdbrcm_wd_timer(bus, BRCMF_WD_POLL_MS);
842 break; 842 break;
@@ -880,7 +880,7 @@ static u32 brcmf_sdbrcm_hostmail(struct brcmf_sdio *bus)
880 brcmf_dbg(INFO, "Dongle reports NAK handled, expect rtx of %d\n", 880 brcmf_dbg(INFO, "Dongle reports NAK handled, expect rtx of %d\n",
881 bus->rx_seq); 881 bus->rx_seq);
882 if (!bus->rxskip) 882 if (!bus->rxskip)
883 brcmf_dbg(ERROR, "unexpected NAKHANDLED!\n"); 883 brcmf_err("unexpected NAKHANDLED!\n");
884 884
885 bus->rxskip = false; 885 bus->rxskip = false;
886 intstatus |= I_HMB_FRAME_IND; 886 intstatus |= I_HMB_FRAME_IND;
@@ -894,7 +894,7 @@ static u32 brcmf_sdbrcm_hostmail(struct brcmf_sdio *bus)
894 (hmb_data & HMB_DATA_VERSION_MASK) >> 894 (hmb_data & HMB_DATA_VERSION_MASK) >>
895 HMB_DATA_VERSION_SHIFT; 895 HMB_DATA_VERSION_SHIFT;
896 if (bus->sdpcm_ver != SDPCM_PROT_VERSION) 896 if (bus->sdpcm_ver != SDPCM_PROT_VERSION)
897 brcmf_dbg(ERROR, "Version mismatch, dongle reports %d, " 897 brcmf_err("Version mismatch, dongle reports %d, "
898 "expecting %d\n", 898 "expecting %d\n",
899 bus->sdpcm_ver, SDPCM_PROT_VERSION); 899 bus->sdpcm_ver, SDPCM_PROT_VERSION);
900 else 900 else
@@ -927,7 +927,7 @@ static u32 brcmf_sdbrcm_hostmail(struct brcmf_sdio *bus)
927 HMB_DATA_FC | 927 HMB_DATA_FC |
928 HMB_DATA_FWREADY | 928 HMB_DATA_FWREADY |
929 HMB_DATA_FCDATA_MASK | HMB_DATA_VERSION_MASK)) 929 HMB_DATA_FCDATA_MASK | HMB_DATA_VERSION_MASK))
930 brcmf_dbg(ERROR, "Unknown mailbox data content: 0x%02x\n", 930 brcmf_err("Unknown mailbox data content: 0x%02x\n",
931 hmb_data); 931 hmb_data);
932 932
933 return intstatus; 933 return intstatus;
@@ -940,7 +940,7 @@ static void brcmf_sdbrcm_rxfail(struct brcmf_sdio *bus, bool abort, bool rtx)
940 u8 hi, lo; 940 u8 hi, lo;
941 int err; 941 int err;
942 942
943 brcmf_dbg(ERROR, "%sterminate frame%s\n", 943 brcmf_err("%sterminate frame%s\n",
944 abort ? "abort command, " : "", 944 abort ? "abort command, " : "",
945 rtx ? ", send NAK" : ""); 945 rtx ? ", send NAK" : "");
946 946
@@ -963,14 +963,14 @@ static void brcmf_sdbrcm_rxfail(struct brcmf_sdio *bus, bool abort, bool rtx)
963 break; 963 break;
964 964
965 if ((hi > (lastrbc >> 8)) && (lo > (lastrbc & 0x00ff))) { 965 if ((hi > (lastrbc >> 8)) && (lo > (lastrbc & 0x00ff))) {
966 brcmf_dbg(ERROR, "count growing: last 0x%04x now 0x%04x\n", 966 brcmf_err("count growing: last 0x%04x now 0x%04x\n",
967 lastrbc, (hi << 8) + lo); 967 lastrbc, (hi << 8) + lo);
968 } 968 }
969 lastrbc = (hi << 8) + lo; 969 lastrbc = (hi << 8) + lo;
970 } 970 }
971 971
972 if (!retries) 972 if (!retries)
973 brcmf_dbg(ERROR, "count never zeroed: last 0x%04x\n", lastrbc); 973 brcmf_err("count never zeroed: last 0x%04x\n", lastrbc);
974 else 974 else
975 brcmf_dbg(INFO, "flush took %d iterations\n", 0xffff - retries); 975 brcmf_dbg(INFO, "flush took %d iterations\n", 0xffff - retries);
976 976
@@ -1057,22 +1057,22 @@ static int brcmf_sdio_hdparser(struct brcmf_sdio *bus, u8 *header,
1057 return -ENODATA; 1057 return -ENODATA;
1058 } 1058 }
1059 if ((u16)(~(len ^ checksum))) { 1059 if ((u16)(~(len ^ checksum))) {
1060 brcmf_dbg(ERROR, "HW header checksum error\n"); 1060 brcmf_err("HW header checksum error\n");
1061 bus->sdcnt.rx_badhdr++; 1061 bus->sdcnt.rx_badhdr++;
1062 brcmf_sdbrcm_rxfail(bus, false, false); 1062 brcmf_sdbrcm_rxfail(bus, false, false);
1063 return -EIO; 1063 return -EIO;
1064 } 1064 }
1065 if (len < SDPCM_HDRLEN) { 1065 if (len < SDPCM_HDRLEN) {
1066 brcmf_dbg(ERROR, "HW header length error\n"); 1066 brcmf_err("HW header length error\n");
1067 return -EPROTO; 1067 return -EPROTO;
1068 } 1068 }
1069 if (type == BRCMF_SDIO_FT_SUPER && 1069 if (type == BRCMF_SDIO_FT_SUPER &&
1070 (roundup(len, bus->blocksize) != rd->len)) { 1070 (roundup(len, bus->blocksize) != rd->len)) {
1071 brcmf_dbg(ERROR, "HW superframe header length error\n"); 1071 brcmf_err("HW superframe header length error\n");
1072 return -EPROTO; 1072 return -EPROTO;
1073 } 1073 }
1074 if (type == BRCMF_SDIO_FT_SUB && len > rd->len) { 1074 if (type == BRCMF_SDIO_FT_SUB && len > rd->len) {
1075 brcmf_dbg(ERROR, "HW subframe header length error\n"); 1075 brcmf_err("HW subframe header length error\n");
1076 return -EPROTO; 1076 return -EPROTO;
1077 } 1077 }
1078 rd->len = len; 1078 rd->len = len;
@@ -1089,7 +1089,7 @@ static int brcmf_sdio_hdparser(struct brcmf_sdio *bus, u8 *header,
1089 */ 1089 */
1090 if (type == BRCMF_SDIO_FT_SUPER && 1090 if (type == BRCMF_SDIO_FT_SUPER &&
1091 SDPCM_GLOMDESC(&header[SDPCM_FRAMETAG_LEN])) { 1091 SDPCM_GLOMDESC(&header[SDPCM_FRAMETAG_LEN])) {
1092 brcmf_dbg(ERROR, "Glom descriptor found in superframe head\n"); 1092 brcmf_err("Glom descriptor found in superframe head\n");
1093 rd->len = 0; 1093 rd->len = 0;
1094 return -EINVAL; 1094 return -EINVAL;
1095 } 1095 }
@@ -1097,7 +1097,7 @@ static int brcmf_sdio_hdparser(struct brcmf_sdio *bus, u8 *header,
1097 rd->channel = SDPCM_PACKET_CHANNEL(&header[SDPCM_FRAMETAG_LEN]); 1097 rd->channel = SDPCM_PACKET_CHANNEL(&header[SDPCM_FRAMETAG_LEN]);
1098 if (len > MAX_RX_DATASZ && rd->channel != SDPCM_CONTROL_CHANNEL && 1098 if (len > MAX_RX_DATASZ && rd->channel != SDPCM_CONTROL_CHANNEL &&
1099 type != BRCMF_SDIO_FT_SUPER) { 1099 type != BRCMF_SDIO_FT_SUPER) {
1100 brcmf_dbg(ERROR, "HW header length too long\n"); 1100 brcmf_err("HW header length too long\n");
1101 bus->sdiodev->bus_if->dstats.rx_errors++; 1101 bus->sdiodev->bus_if->dstats.rx_errors++;
1102 bus->sdcnt.rx_toolong++; 1102 bus->sdcnt.rx_toolong++;
1103 brcmf_sdbrcm_rxfail(bus, false, false); 1103 brcmf_sdbrcm_rxfail(bus, false, false);
@@ -1105,26 +1105,26 @@ static int brcmf_sdio_hdparser(struct brcmf_sdio *bus, u8 *header,
1105 return -EPROTO; 1105 return -EPROTO;
1106 } 1106 }
1107 if (type == BRCMF_SDIO_FT_SUPER && rd->channel != SDPCM_GLOM_CHANNEL) { 1107 if (type == BRCMF_SDIO_FT_SUPER && rd->channel != SDPCM_GLOM_CHANNEL) {
1108 brcmf_dbg(ERROR, "Wrong channel for superframe\n"); 1108 brcmf_err("Wrong channel for superframe\n");
1109 rd->len = 0; 1109 rd->len = 0;
1110 return -EINVAL; 1110 return -EINVAL;
1111 } 1111 }
1112 if (type == BRCMF_SDIO_FT_SUB && rd->channel != SDPCM_DATA_CHANNEL && 1112 if (type == BRCMF_SDIO_FT_SUB && rd->channel != SDPCM_DATA_CHANNEL &&
1113 rd->channel != SDPCM_EVENT_CHANNEL) { 1113 rd->channel != SDPCM_EVENT_CHANNEL) {
1114 brcmf_dbg(ERROR, "Wrong channel for subframe\n"); 1114 brcmf_err("Wrong channel for subframe\n");
1115 rd->len = 0; 1115 rd->len = 0;
1116 return -EINVAL; 1116 return -EINVAL;
1117 } 1117 }
1118 rd->dat_offset = SDPCM_DOFFSET_VALUE(&header[SDPCM_FRAMETAG_LEN]); 1118 rd->dat_offset = SDPCM_DOFFSET_VALUE(&header[SDPCM_FRAMETAG_LEN]);
1119 if (rd->dat_offset < SDPCM_HDRLEN || rd->dat_offset > rd->len) { 1119 if (rd->dat_offset < SDPCM_HDRLEN || rd->dat_offset > rd->len) {
1120 brcmf_dbg(ERROR, "seq %d: bad data offset\n", rx_seq); 1120 brcmf_err("seq %d: bad data offset\n", rx_seq);
1121 bus->sdcnt.rx_badhdr++; 1121 bus->sdcnt.rx_badhdr++;
1122 brcmf_sdbrcm_rxfail(bus, false, false); 1122 brcmf_sdbrcm_rxfail(bus, false, false);
1123 rd->len = 0; 1123 rd->len = 0;
1124 return -ENXIO; 1124 return -ENXIO;
1125 } 1125 }
1126 if (rd->seq_num != rx_seq) { 1126 if (rd->seq_num != rx_seq) {
1127 brcmf_dbg(ERROR, "seq %d: sequence number error, expect %d\n", 1127 brcmf_err("seq %d: sequence number error, expect %d\n",
1128 rx_seq, rd->seq_num); 1128 rx_seq, rd->seq_num);
1129 bus->sdcnt.rx_badseq++; 1129 bus->sdcnt.rx_badseq++;
1130 rd->seq_num = rx_seq; 1130 rd->seq_num = rx_seq;
@@ -1136,7 +1136,7 @@ static int brcmf_sdio_hdparser(struct brcmf_sdio *bus, u8 *header,
1136 if (rd->len_nxtfrm << 4 > MAX_RX_DATASZ) { 1136 if (rd->len_nxtfrm << 4 > MAX_RX_DATASZ) {
1137 /* only warm for NON glom packet */ 1137 /* only warm for NON glom packet */
1138 if (rd->channel != SDPCM_GLOM_CHANNEL) 1138 if (rd->channel != SDPCM_GLOM_CHANNEL)
1139 brcmf_dbg(ERROR, "seq %d: next length error\n", rx_seq); 1139 brcmf_err("seq %d: next length error\n", rx_seq);
1140 rd->len_nxtfrm = 0; 1140 rd->len_nxtfrm = 0;
1141 } 1141 }
1142 fc = SDPCM_FCMASK_VALUE(&header[SDPCM_FRAMETAG_LEN]); 1142 fc = SDPCM_FCMASK_VALUE(&header[SDPCM_FRAMETAG_LEN]);
@@ -1150,7 +1150,7 @@ static int brcmf_sdio_hdparser(struct brcmf_sdio *bus, u8 *header,
1150 } 1150 }
1151 tx_seq_max = SDPCM_WINDOW_VALUE(&header[SDPCM_FRAMETAG_LEN]); 1151 tx_seq_max = SDPCM_WINDOW_VALUE(&header[SDPCM_FRAMETAG_LEN]);
1152 if ((u8)(tx_seq_max - bus->tx_seq) > 0x40) { 1152 if ((u8)(tx_seq_max - bus->tx_seq) > 0x40) {
1153 brcmf_dbg(ERROR, "seq %d: max tx seq number error\n", rx_seq); 1153 brcmf_err("seq %d: max tx seq number error\n", rx_seq);
1154 tx_seq_max = bus->tx_seq + 2; 1154 tx_seq_max = bus->tx_seq + 2;
1155 } 1155 }
1156 bus->tx_max = tx_seq_max; 1156 bus->tx_max = tx_seq_max;
@@ -1186,7 +1186,7 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_sdio *bus, u8 rxseq)
1186 dlen = (u16) (bus->glomd->len); 1186 dlen = (u16) (bus->glomd->len);
1187 dptr = bus->glomd->data; 1187 dptr = bus->glomd->data;
1188 if (!dlen || (dlen & 1)) { 1188 if (!dlen || (dlen & 1)) {
1189 brcmf_dbg(ERROR, "bad glomd len(%d), ignore descriptor\n", 1189 brcmf_err("bad glomd len(%d), ignore descriptor\n",
1190 dlen); 1190 dlen);
1191 dlen = 0; 1191 dlen = 0;
1192 } 1192 }
@@ -1198,13 +1198,13 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_sdio *bus, u8 rxseq)
1198 dptr += sizeof(u16); 1198 dptr += sizeof(u16);
1199 if ((sublen < SDPCM_HDRLEN) || 1199 if ((sublen < SDPCM_HDRLEN) ||
1200 ((num == 0) && (sublen < (2 * SDPCM_HDRLEN)))) { 1200 ((num == 0) && (sublen < (2 * SDPCM_HDRLEN)))) {
1201 brcmf_dbg(ERROR, "descriptor len %d bad: %d\n", 1201 brcmf_err("descriptor len %d bad: %d\n",
1202 num, sublen); 1202 num, sublen);
1203 pnext = NULL; 1203 pnext = NULL;
1204 break; 1204 break;
1205 } 1205 }
1206 if (sublen % BRCMF_SDALIGN) { 1206 if (sublen % BRCMF_SDALIGN) {
1207 brcmf_dbg(ERROR, "sublen %d not multiple of %d\n", 1207 brcmf_err("sublen %d not multiple of %d\n",
1208 sublen, BRCMF_SDALIGN); 1208 sublen, BRCMF_SDALIGN);
1209 usechain = false; 1209 usechain = false;
1210 } 1210 }
@@ -1221,7 +1221,7 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_sdio *bus, u8 rxseq)
1221 /* Allocate/chain packet for next subframe */ 1221 /* Allocate/chain packet for next subframe */
1222 pnext = brcmu_pkt_buf_get_skb(sublen + BRCMF_SDALIGN); 1222 pnext = brcmu_pkt_buf_get_skb(sublen + BRCMF_SDALIGN);
1223 if (pnext == NULL) { 1223 if (pnext == NULL) {
1224 brcmf_dbg(ERROR, "bcm_pkt_buf_get_skb failed, num %d len %d\n", 1224 brcmf_err("bcm_pkt_buf_get_skb failed, num %d len %d\n",
1225 num, sublen); 1225 num, sublen);
1226 break; 1226 break;
1227 } 1227 }
@@ -1284,13 +1284,13 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_sdio *bus, u8 rxseq)
1284 bus->dataptr, dlen); 1284 bus->dataptr, dlen);
1285 sublen = (u16) brcmf_sdbrcm_glom_from_buf(bus, dlen); 1285 sublen = (u16) brcmf_sdbrcm_glom_from_buf(bus, dlen);
1286 if (sublen != dlen) { 1286 if (sublen != dlen) {
1287 brcmf_dbg(ERROR, "FAILED TO COPY, dlen %d sublen %d\n", 1287 brcmf_err("FAILED TO COPY, dlen %d sublen %d\n",
1288 dlen, sublen); 1288 dlen, sublen);
1289 errcode = -1; 1289 errcode = -1;
1290 } 1290 }
1291 pnext = NULL; 1291 pnext = NULL;
1292 } else { 1292 } else {
1293 brcmf_dbg(ERROR, "COULDN'T ALLOC %d-BYTE GLOM, FORCE FAILURE\n", 1293 brcmf_err("COULDN'T ALLOC %d-BYTE GLOM, FORCE FAILURE\n",
1294 dlen); 1294 dlen);
1295 errcode = -1; 1295 errcode = -1;
1296 } 1296 }
@@ -1299,7 +1299,7 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_sdio *bus, u8 rxseq)
1299 1299
1300 /* On failure, kill the superframe, allow a couple retries */ 1300 /* On failure, kill the superframe, allow a couple retries */
1301 if (errcode < 0) { 1301 if (errcode < 0) {
1302 brcmf_dbg(ERROR, "glom read of %d bytes failed: %d\n", 1302 brcmf_err("glom read of %d bytes failed: %d\n",
1303 dlen, errcode); 1303 dlen, errcode);
1304 bus->sdiodev->bus_if->dstats.rx_errors++; 1304 bus->sdiodev->bus_if->dstats.rx_errors++;
1305 1305
@@ -1390,7 +1390,7 @@ static u8 brcmf_sdbrcm_rxglom(struct brcmf_sdio *bus, u8 rxseq)
1390 continue; 1390 continue;
1391 } else if (brcmf_proto_hdrpull(bus->sdiodev->dev, 1391 } else if (brcmf_proto_hdrpull(bus->sdiodev->dev,
1392 &ifidx, pfirst) != 0) { 1392 &ifidx, pfirst) != 0) {
1393 brcmf_dbg(ERROR, "rx protocol error\n"); 1393 brcmf_err("rx protocol error\n");
1394 bus->sdiodev->bus_if->dstats.rx_errors++; 1394 bus->sdiodev->bus_if->dstats.rx_errors++;
1395 skb_unlink(pfirst, &bus->glom); 1395 skb_unlink(pfirst, &bus->glom);
1396 brcmu_pkt_buf_free_skb(pfirst); 1396 brcmu_pkt_buf_free_skb(pfirst);
@@ -1456,7 +1456,7 @@ brcmf_sdbrcm_read_control(struct brcmf_sdio *bus, u8 *hdr, uint len, uint doff)
1456 if (bus->rxblen) 1456 if (bus->rxblen)
1457 buf = vzalloc(bus->rxblen); 1457 buf = vzalloc(bus->rxblen);
1458 if (!buf) { 1458 if (!buf) {
1459 brcmf_dbg(ERROR, "no memory for control frame\n"); 1459 brcmf_err("no memory for control frame\n");
1460 goto done; 1460 goto done;
1461 } 1461 }
1462 rbuf = bus->rxbuf; 1462 rbuf = bus->rxbuf;
@@ -1486,7 +1486,7 @@ brcmf_sdbrcm_read_control(struct brcmf_sdio *bus, u8 *hdr, uint len, uint doff)
1486 1486
1487 /* Drop if the read is too big or it exceeds our maximum */ 1487 /* Drop if the read is too big or it exceeds our maximum */
1488 if ((rdlen + BRCMF_FIRSTREAD) > bus->sdiodev->bus_if->maxctl) { 1488 if ((rdlen + BRCMF_FIRSTREAD) > bus->sdiodev->bus_if->maxctl) {
1489 brcmf_dbg(ERROR, "%d-byte control read exceeds %d-byte buffer\n", 1489 brcmf_err("%d-byte control read exceeds %d-byte buffer\n",
1490 rdlen, bus->sdiodev->bus_if->maxctl); 1490 rdlen, bus->sdiodev->bus_if->maxctl);
1491 bus->sdiodev->bus_if->dstats.rx_errors++; 1491 bus->sdiodev->bus_if->dstats.rx_errors++;
1492 brcmf_sdbrcm_rxfail(bus, false, false); 1492 brcmf_sdbrcm_rxfail(bus, false, false);
@@ -1494,7 +1494,7 @@ brcmf_sdbrcm_read_control(struct brcmf_sdio *bus, u8 *hdr, uint len, uint doff)
1494 } 1494 }
1495 1495
1496 if ((len - doff) > bus->sdiodev->bus_if->maxctl) { 1496 if ((len - doff) > bus->sdiodev->bus_if->maxctl) {
1497 brcmf_dbg(ERROR, "%d-byte ctl frame (%d-byte ctl data) exceeds %d-byte limit\n", 1497 brcmf_err("%d-byte ctl frame (%d-byte ctl data) exceeds %d-byte limit\n",
1498 len, len - doff, bus->sdiodev->bus_if->maxctl); 1498 len, len - doff, bus->sdiodev->bus_if->maxctl);
1499 bus->sdiodev->bus_if->dstats.rx_errors++; 1499 bus->sdiodev->bus_if->dstats.rx_errors++;
1500 bus->sdcnt.rx_toolong++; 1500 bus->sdcnt.rx_toolong++;
@@ -1511,7 +1511,7 @@ brcmf_sdbrcm_read_control(struct brcmf_sdio *bus, u8 *hdr, uint len, uint doff)
1511 1511
1512 /* Control frame failures need retransmission */ 1512 /* Control frame failures need retransmission */
1513 if (sdret < 0) { 1513 if (sdret < 0) {
1514 brcmf_dbg(ERROR, "read %d control bytes failed: %d\n", 1514 brcmf_err("read %d control bytes failed: %d\n",
1515 rdlen, sdret); 1515 rdlen, sdret);
1516 bus->sdcnt.rxc_errors++; 1516 bus->sdcnt.rxc_errors++;
1517 brcmf_sdbrcm_rxfail(bus, true, true); 1517 brcmf_sdbrcm_rxfail(bus, true, true);
@@ -1527,7 +1527,7 @@ gotpkt:
1527 /* Point to valid data and indicate its length */ 1527 /* Point to valid data and indicate its length */
1528 spin_lock_bh(&bus->rxctl_lock); 1528 spin_lock_bh(&bus->rxctl_lock);
1529 if (bus->rxctl) { 1529 if (bus->rxctl) {
1530 brcmf_dbg(ERROR, "last control frame is being processed.\n"); 1530 brcmf_err("last control frame is being processed.\n");
1531 spin_unlock_bh(&bus->rxctl_lock); 1531 spin_unlock_bh(&bus->rxctl_lock);
1532 vfree(buf); 1532 vfree(buf);
1533 goto done; 1533 goto done;
@@ -1599,7 +1599,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
1599 BRCMF_FIRSTREAD); 1599 BRCMF_FIRSTREAD);
1600 bus->sdcnt.f2rxhdrs++; 1600 bus->sdcnt.f2rxhdrs++;
1601 if (sdret < 0) { 1601 if (sdret < 0) {
1602 brcmf_dbg(ERROR, "RXHEADER FAILED: %d\n", 1602 brcmf_err("RXHEADER FAILED: %d\n",
1603 sdret); 1603 sdret);
1604 bus->sdcnt.rx_hdrfail++; 1604 bus->sdcnt.rx_hdrfail++;
1605 brcmf_sdbrcm_rxfail(bus, true, true); 1605 brcmf_sdbrcm_rxfail(bus, true, true);
@@ -1643,7 +1643,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
1643 BRCMF_SDALIGN); 1643 BRCMF_SDALIGN);
1644 if (!pkt) { 1644 if (!pkt) {
1645 /* Give up on data, request rtx of events */ 1645 /* Give up on data, request rtx of events */
1646 brcmf_dbg(ERROR, "brcmu_pkt_buf_get_skb failed\n"); 1646 brcmf_err("brcmu_pkt_buf_get_skb failed\n");
1647 bus->sdiodev->bus_if->dstats.rx_dropped++; 1647 bus->sdiodev->bus_if->dstats.rx_dropped++;
1648 brcmf_sdbrcm_rxfail(bus, false, 1648 brcmf_sdbrcm_rxfail(bus, false,
1649 RETRYCHAN(rd->channel)); 1649 RETRYCHAN(rd->channel));
@@ -1659,7 +1659,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
1659 sdio_release_host(bus->sdiodev->func[1]); 1659 sdio_release_host(bus->sdiodev->func[1]);
1660 1660
1661 if (sdret < 0) { 1661 if (sdret < 0) {
1662 brcmf_dbg(ERROR, "read %d bytes from channel %d failed: %d\n", 1662 brcmf_err("read %d bytes from channel %d failed: %d\n",
1663 rd->len, rd->channel, sdret); 1663 rd->len, rd->channel, sdret);
1664 brcmu_pkt_buf_free_skb(pkt); 1664 brcmu_pkt_buf_free_skb(pkt);
1665 bus->sdiodev->bus_if->dstats.rx_errors++; 1665 bus->sdiodev->bus_if->dstats.rx_errors++;
@@ -1685,7 +1685,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
1685 } 1685 }
1686 bus->sdcnt.rx_readahead_cnt++; 1686 bus->sdcnt.rx_readahead_cnt++;
1687 if (rd->len != roundup(rd_new.len, 16)) { 1687 if (rd->len != roundup(rd_new.len, 16)) {
1688 brcmf_dbg(ERROR, "frame length mismatch:read %d, should be %d\n", 1688 brcmf_err("frame length mismatch:read %d, should be %d\n",
1689 rd->len, 1689 rd->len,
1690 roundup(rd_new.len, 16) >> 4); 1690 roundup(rd_new.len, 16) >> 4);
1691 rd->len = 0; 1691 rd->len = 0;
@@ -1706,7 +1706,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
1706 "RxHdr:\n"); 1706 "RxHdr:\n");
1707 1707
1708 if (rd_new.channel == SDPCM_CONTROL_CHANNEL) { 1708 if (rd_new.channel == SDPCM_CONTROL_CHANNEL) {
1709 brcmf_dbg(ERROR, "readahead on control packet %d?\n", 1709 brcmf_err("readahead on control packet %d?\n",
1710 rd_new.seq_num); 1710 rd_new.seq_num);
1711 /* Force retry w/normal header read */ 1711 /* Force retry w/normal header read */
1712 rd->len = 0; 1712 rd->len = 0;
@@ -1733,7 +1733,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
1733 skb_pull(pkt, SDPCM_HDRLEN); 1733 skb_pull(pkt, SDPCM_HDRLEN);
1734 bus->glomd = pkt; 1734 bus->glomd = pkt;
1735 } else { 1735 } else {
1736 brcmf_dbg(ERROR, "%s: glom superframe w/o " 1736 brcmf_err("%s: glom superframe w/o "
1737 "descriptor!\n", __func__); 1737 "descriptor!\n", __func__);
1738 sdio_claim_host(bus->sdiodev->func[1]); 1738 sdio_claim_host(bus->sdiodev->func[1]);
1739 brcmf_sdbrcm_rxfail(bus, false, false); 1739 brcmf_sdbrcm_rxfail(bus, false, false);
@@ -1762,7 +1762,7 @@ static uint brcmf_sdio_readframes(struct brcmf_sdio *bus, uint maxframes)
1762 continue; 1762 continue;
1763 } else if (brcmf_proto_hdrpull(bus->sdiodev->dev, &ifidx, 1763 } else if (brcmf_proto_hdrpull(bus->sdiodev->dev, &ifidx,
1764 pkt) != 0) { 1764 pkt) != 0) {
1765 brcmf_dbg(ERROR, "rx protocol error\n"); 1765 brcmf_err("rx protocol error\n");
1766 brcmu_pkt_buf_free_skb(pkt); 1766 brcmu_pkt_buf_free_skb(pkt);
1767 bus->sdiodev->bus_if->dstats.rx_errors++; 1767 bus->sdiodev->bus_if->dstats.rx_errors++;
1768 continue; 1768 continue;
@@ -1818,7 +1818,7 @@ static int brcmf_sdbrcm_txpkt(struct brcmf_sdio *bus, struct sk_buff *pkt,
1818 bus->sdiodev->bus_if->tx_realloc++; 1818 bus->sdiodev->bus_if->tx_realloc++;
1819 new = brcmu_pkt_buf_get_skb(pkt->len + BRCMF_SDALIGN); 1819 new = brcmu_pkt_buf_get_skb(pkt->len + BRCMF_SDALIGN);
1820 if (!new) { 1820 if (!new) {
1821 brcmf_dbg(ERROR, "couldn't allocate new %d-byte packet\n", 1821 brcmf_err("couldn't allocate new %d-byte packet\n",
1822 pkt->len + BRCMF_SDALIGN); 1822 pkt->len + BRCMF_SDALIGN);
1823 ret = -ENOMEM; 1823 ret = -ENOMEM;
1824 goto done; 1824 goto done;
@@ -2024,7 +2024,7 @@ static void brcmf_sdbrcm_bus_stop(struct device *dev)
2024 (saveclk | SBSDIO_FORCE_HT), &err); 2024 (saveclk | SBSDIO_FORCE_HT), &err);
2025 } 2025 }
2026 if (err) 2026 if (err)
2027 brcmf_dbg(ERROR, "Failed to force clock for F2: err %d\n", err); 2027 brcmf_err("Failed to force clock for F2: err %d\n", err);
2028 2028
2029 /* Turn off the bus (F2), free any pending packets */ 2029 /* Turn off the bus (F2), free any pending packets */
2030 brcmf_dbg(INTR, "disable SDIO interrupts\n"); 2030 brcmf_dbg(INTR, "disable SDIO interrupts\n");
@@ -2150,7 +2150,7 @@ static void brcmf_sdbrcm_dpc(struct brcmf_sdio *bus)
2150 devctl = brcmf_sdio_regrb(bus->sdiodev, 2150 devctl = brcmf_sdio_regrb(bus->sdiodev,
2151 SBSDIO_DEVICE_CTL, &err); 2151 SBSDIO_DEVICE_CTL, &err);
2152 if (err) { 2152 if (err) {
2153 brcmf_dbg(ERROR, "error reading DEVCTL: %d\n", err); 2153 brcmf_err("error reading DEVCTL: %d\n", err);
2154 bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN; 2154 bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN;
2155 } 2155 }
2156#endif /* DEBUG */ 2156#endif /* DEBUG */
@@ -2159,7 +2159,7 @@ static void brcmf_sdbrcm_dpc(struct brcmf_sdio *bus)
2159 clkctl = brcmf_sdio_regrb(bus->sdiodev, 2159 clkctl = brcmf_sdio_regrb(bus->sdiodev,
2160 SBSDIO_FUNC1_CHIPCLKCSR, &err); 2160 SBSDIO_FUNC1_CHIPCLKCSR, &err);
2161 if (err) { 2161 if (err) {
2162 brcmf_dbg(ERROR, "error reading CSR: %d\n", 2162 brcmf_err("error reading CSR: %d\n",
2163 err); 2163 err);
2164 bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN; 2164 bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN;
2165 } 2165 }
@@ -2171,7 +2171,7 @@ static void brcmf_sdbrcm_dpc(struct brcmf_sdio *bus)
2171 devctl = brcmf_sdio_regrb(bus->sdiodev, 2171 devctl = brcmf_sdio_regrb(bus->sdiodev,
2172 SBSDIO_DEVICE_CTL, &err); 2172 SBSDIO_DEVICE_CTL, &err);
2173 if (err) { 2173 if (err) {
2174 brcmf_dbg(ERROR, "error reading DEVCTL: %d\n", 2174 brcmf_err("error reading DEVCTL: %d\n",
2175 err); 2175 err);
2176 bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN; 2176 bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN;
2177 } 2177 }
@@ -2179,7 +2179,7 @@ static void brcmf_sdbrcm_dpc(struct brcmf_sdio *bus)
2179 brcmf_sdio_regwb(bus->sdiodev, SBSDIO_DEVICE_CTL, 2179 brcmf_sdio_regwb(bus->sdiodev, SBSDIO_DEVICE_CTL,
2180 devctl, &err); 2180 devctl, &err);
2181 if (err) { 2181 if (err) {
2182 brcmf_dbg(ERROR, "error writing DEVCTL: %d\n", 2182 brcmf_err("error writing DEVCTL: %d\n",
2183 err); 2183 err);
2184 bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN; 2184 bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN;
2185 } 2185 }
@@ -2226,17 +2226,17 @@ static void brcmf_sdbrcm_dpc(struct brcmf_sdio *bus)
2226 2226
2227 /* Generally don't ask for these, can get CRC errors... */ 2227 /* Generally don't ask for these, can get CRC errors... */
2228 if (intstatus & I_WR_OOSYNC) { 2228 if (intstatus & I_WR_OOSYNC) {
2229 brcmf_dbg(ERROR, "Dongle reports WR_OOSYNC\n"); 2229 brcmf_err("Dongle reports WR_OOSYNC\n");
2230 intstatus &= ~I_WR_OOSYNC; 2230 intstatus &= ~I_WR_OOSYNC;
2231 } 2231 }
2232 2232
2233 if (intstatus & I_RD_OOSYNC) { 2233 if (intstatus & I_RD_OOSYNC) {
2234 brcmf_dbg(ERROR, "Dongle reports RD_OOSYNC\n"); 2234 brcmf_err("Dongle reports RD_OOSYNC\n");
2235 intstatus &= ~I_RD_OOSYNC; 2235 intstatus &= ~I_RD_OOSYNC;
2236 } 2236 }
2237 2237
2238 if (intstatus & I_SBINT) { 2238 if (intstatus & I_SBINT) {
2239 brcmf_dbg(ERROR, "Dongle reports SBINT\n"); 2239 brcmf_err("Dongle reports SBINT\n");
2240 intstatus &= ~I_SBINT; 2240 intstatus &= ~I_SBINT;
2241 } 2241 }
2242 2242
@@ -2319,7 +2319,7 @@ static void brcmf_sdbrcm_dpc(struct brcmf_sdio *bus)
2319 } 2319 }
2320 2320
2321 if ((bus->sdiodev->bus_if->state == BRCMF_BUS_DOWN) || (err != 0)) { 2321 if ((bus->sdiodev->bus_if->state == BRCMF_BUS_DOWN) || (err != 0)) {
2322 brcmf_dbg(ERROR, "failed backplane access over SDIO, halting operation\n"); 2322 brcmf_err("failed backplane access over SDIO, halting operation\n");
2323 bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN; 2323 bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN;
2324 atomic_set(&bus->intstatus, 0); 2324 atomic_set(&bus->intstatus, 0);
2325 } else if (atomic_read(&bus->intstatus) || 2325 } else if (atomic_read(&bus->intstatus) ||
@@ -2370,7 +2370,7 @@ static int brcmf_sdbrcm_bus_txdata(struct device *dev, struct sk_buff *pkt)
2370 skb_pull(pkt, SDPCM_HDRLEN); 2370 skb_pull(pkt, SDPCM_HDRLEN);
2371 brcmf_txcomplete(bus->sdiodev->dev, pkt, false); 2371 brcmf_txcomplete(bus->sdiodev->dev, pkt, false);
2372 brcmu_pkt_buf_free_skb(pkt); 2372 brcmu_pkt_buf_free_skb(pkt);
2373 brcmf_dbg(ERROR, "out of bus->txq !!!\n"); 2373 brcmf_err("out of bus->txq !!!\n");
2374 ret = -ENOSR; 2374 ret = -ENOSR;
2375 } else { 2375 } else {
2376 ret = 0; 2376 ret = 0;
@@ -2420,7 +2420,7 @@ brcmf_sdbrcm_membytes(struct brcmf_sdio *bus, bool write, u32 address, u8 *data,
2420 /* Set the backplane window to include the start address */ 2420 /* Set the backplane window to include the start address */
2421 bcmerror = brcmf_sdcard_set_sbaddr_window(bus->sdiodev, address); 2421 bcmerror = brcmf_sdcard_set_sbaddr_window(bus->sdiodev, address);
2422 if (bcmerror) { 2422 if (bcmerror) {
2423 brcmf_dbg(ERROR, "window change failed\n"); 2423 brcmf_err("window change failed\n");
2424 goto xfer_done; 2424 goto xfer_done;
2425 } 2425 }
2426 2426
@@ -2432,7 +2432,7 @@ brcmf_sdbrcm_membytes(struct brcmf_sdio *bus, bool write, u32 address, u8 *data,
2432 bcmerror = brcmf_sdcard_rwdata(bus->sdiodev, write, 2432 bcmerror = brcmf_sdcard_rwdata(bus->sdiodev, write,
2433 sdaddr, data, dsize); 2433 sdaddr, data, dsize);
2434 if (bcmerror) { 2434 if (bcmerror) {
2435 brcmf_dbg(ERROR, "membytes transfer failed\n"); 2435 brcmf_err("membytes transfer failed\n");
2436 break; 2436 break;
2437 } 2437 }
2438 2438
@@ -2444,7 +2444,7 @@ brcmf_sdbrcm_membytes(struct brcmf_sdio *bus, bool write, u32 address, u8 *data,
2444 bcmerror = brcmf_sdcard_set_sbaddr_window(bus->sdiodev, 2444 bcmerror = brcmf_sdcard_set_sbaddr_window(bus->sdiodev,
2445 address); 2445 address);
2446 if (bcmerror) { 2446 if (bcmerror) {
2447 brcmf_dbg(ERROR, "window change failed\n"); 2447 brcmf_err("window change failed\n");
2448 break; 2448 break;
2449 } 2449 }
2450 sdaddr = 0; 2450 sdaddr = 0;
@@ -2455,7 +2455,7 @@ brcmf_sdbrcm_membytes(struct brcmf_sdio *bus, bool write, u32 address, u8 *data,
2455xfer_done: 2455xfer_done:
2456 /* Return the window to backplane enumeration space for core access */ 2456 /* Return the window to backplane enumeration space for core access */
2457 if (brcmf_sdcard_set_sbaddr_window(bus->sdiodev, bus->sdiodev->sbwad)) 2457 if (brcmf_sdcard_set_sbaddr_window(bus->sdiodev, bus->sdiodev->sbwad))
2458 brcmf_dbg(ERROR, "FAILED to set window back to 0x%x\n", 2458 brcmf_err("FAILED to set window back to 0x%x\n",
2459 bus->sdiodev->sbwad); 2459 bus->sdiodev->sbwad);
2460 2460
2461 sdio_release_host(bus->sdiodev->func[1]); 2461 sdio_release_host(bus->sdiodev->func[1]);
@@ -2739,7 +2739,7 @@ static int brcmf_sdio_readshared(struct brcmf_sdio *bus,
2739 * NVRAM length at the end of memory should have been overwritten. 2739 * NVRAM length at the end of memory should have been overwritten.
2740 */ 2740 */
2741 if (!brcmf_sdio_valid_shared_address(addr)) { 2741 if (!brcmf_sdio_valid_shared_address(addr)) {
2742 brcmf_dbg(ERROR, "invalid sdpcm_shared address 0x%08X\n", 2742 brcmf_err("invalid sdpcm_shared address 0x%08X\n",
2743 addr); 2743 addr);
2744 return -EINVAL; 2744 return -EINVAL;
2745 } 2745 }
@@ -2762,8 +2762,7 @@ static int brcmf_sdio_readshared(struct brcmf_sdio *bus,
2762 sh->msgtrace_addr = le32_to_cpu(sh_le.msgtrace_addr); 2762 sh->msgtrace_addr = le32_to_cpu(sh_le.msgtrace_addr);
2763 2763
2764 if ((sh->flags & SDPCM_SHARED_VERSION_MASK) != SDPCM_SHARED_VERSION) { 2764 if ((sh->flags & SDPCM_SHARED_VERSION_MASK) != SDPCM_SHARED_VERSION) {
2765 brcmf_dbg(ERROR, 2765 brcmf_err("sdpcm_shared version mismatch: dhd %d dongle %d\n",
2766 "sdpcm_shared version mismatch: dhd %d dongle %d\n",
2767 SDPCM_SHARED_VERSION, 2766 SDPCM_SHARED_VERSION,
2768 sh->flags & SDPCM_SHARED_VERSION_MASK); 2767 sh->flags & SDPCM_SHARED_VERSION_MASK);
2769 return -EPROTO; 2768 return -EPROTO;
@@ -2938,10 +2937,10 @@ static int brcmf_sdbrcm_checkdied(struct brcmf_sdio *bus)
2938 if ((sh.flags & SDPCM_SHARED_ASSERT_BUILT) == 0) 2937 if ((sh.flags & SDPCM_SHARED_ASSERT_BUILT) == 0)
2939 brcmf_dbg(INFO, "firmware not built with -assert\n"); 2938 brcmf_dbg(INFO, "firmware not built with -assert\n");
2940 else if (sh.flags & SDPCM_SHARED_ASSERT) 2939 else if (sh.flags & SDPCM_SHARED_ASSERT)
2941 brcmf_dbg(ERROR, "assertion in dongle\n"); 2940 brcmf_err("assertion in dongle\n");
2942 2941
2943 if (sh.flags & SDPCM_SHARED_TRAP) 2942 if (sh.flags & SDPCM_SHARED_TRAP)
2944 brcmf_dbg(ERROR, "firmware trap in dongle\n"); 2943 brcmf_err("firmware trap in dongle\n");
2945 2944
2946 return 0; 2945 return 0;
2947} 2946}
@@ -3047,7 +3046,7 @@ brcmf_sdbrcm_bus_rxctl(struct device *dev, unsigned char *msg, uint msglen)
3047 brcmf_dbg(CTL, "resumed on rxctl frame, got %d expected %d\n", 3046 brcmf_dbg(CTL, "resumed on rxctl frame, got %d expected %d\n",
3048 rxlen, msglen); 3047 rxlen, msglen);
3049 } else if (timeleft == 0) { 3048 } else if (timeleft == 0) {
3050 brcmf_dbg(ERROR, "resumed on timeout\n"); 3049 brcmf_err("resumed on timeout\n");
3051 brcmf_sdbrcm_checkdied(bus); 3050 brcmf_sdbrcm_checkdied(bus);
3052 } else if (pending) { 3051 } else if (pending) {
3053 brcmf_dbg(CTL, "cancelled\n"); 3052 brcmf_dbg(CTL, "cancelled\n");
@@ -3098,14 +3097,14 @@ static int brcmf_sdbrcm_write_vars(struct brcmf_sdio *bus)
3098 bcmerror = brcmf_sdbrcm_membytes(bus, false, varaddr, 3097 bcmerror = brcmf_sdbrcm_membytes(bus, false, varaddr,
3099 nvram_ularray, bus->varsz); 3098 nvram_ularray, bus->varsz);
3100 if (bcmerror) { 3099 if (bcmerror) {
3101 brcmf_dbg(ERROR, "error %d on reading %d nvram bytes at 0x%08x\n", 3100 brcmf_err("error %d on reading %d nvram bytes at 0x%08x\n",
3102 bcmerror, bus->varsz, varaddr); 3101 bcmerror, bus->varsz, varaddr);
3103 } 3102 }
3104 /* Compare the org NVRAM with the one read from RAM */ 3103 /* Compare the org NVRAM with the one read from RAM */
3105 if (memcmp(bus->vars, nvram_ularray, bus->varsz)) 3104 if (memcmp(bus->vars, nvram_ularray, bus->varsz))
3106 brcmf_dbg(ERROR, "Downloaded NVRAM image is corrupted\n"); 3105 brcmf_err("Downloaded NVRAM image is corrupted\n");
3107 else 3106 else
3108 brcmf_dbg(ERROR, "Download/Upload/Compare of NVRAM ok\n"); 3107 brcmf_err("Download/Upload/Compare of NVRAM ok\n");
3109 3108
3110 kfree(nvram_ularray); 3109 kfree(nvram_ularray);
3111#endif /* DEBUG */ 3110#endif /* DEBUG */
@@ -3163,14 +3162,14 @@ static int brcmf_sdbrcm_download_state(struct brcmf_sdio *bus, bool enter)
3163 } 3162 }
3164 } else { 3163 } else {
3165 if (!ci->iscoreup(bus->sdiodev, ci, BCMA_CORE_INTERNAL_MEM)) { 3164 if (!ci->iscoreup(bus->sdiodev, ci, BCMA_CORE_INTERNAL_MEM)) {
3166 brcmf_dbg(ERROR, "SOCRAM core is down after reset?\n"); 3165 brcmf_err("SOCRAM core is down after reset?\n");
3167 bcmerror = -EBADE; 3166 bcmerror = -EBADE;
3168 goto fail; 3167 goto fail;
3169 } 3168 }
3170 3169
3171 bcmerror = brcmf_sdbrcm_write_vars(bus); 3170 bcmerror = brcmf_sdbrcm_write_vars(bus);
3172 if (bcmerror) { 3171 if (bcmerror) {
3173 brcmf_dbg(ERROR, "no vars written to RAM\n"); 3172 brcmf_err("no vars written to RAM\n");
3174 bcmerror = 0; 3173 bcmerror = 0;
3175 } 3174 }
3176 3175
@@ -3210,7 +3209,7 @@ static int brcmf_sdbrcm_download_code_file(struct brcmf_sdio *bus)
3210 ret = request_firmware(&bus->firmware, BRCMF_SDIO_FW_NAME, 3209 ret = request_firmware(&bus->firmware, BRCMF_SDIO_FW_NAME,
3211 &bus->sdiodev->func[2]->dev); 3210 &bus->sdiodev->func[2]->dev);
3212 if (ret) { 3211 if (ret) {
3213 brcmf_dbg(ERROR, "Fail to request firmware %d\n", ret); 3212 brcmf_err("Fail to request firmware %d\n", ret);
3214 return ret; 3213 return ret;
3215 } 3214 }
3216 bus->fw_ptr = 0; 3215 bus->fw_ptr = 0;
@@ -3229,7 +3228,7 @@ static int brcmf_sdbrcm_download_code_file(struct brcmf_sdio *bus)
3229 brcmf_sdbrcm_get_image((char *)memptr, MEMBLOCK, bus))) { 3228 brcmf_sdbrcm_get_image((char *)memptr, MEMBLOCK, bus))) {
3230 ret = brcmf_sdbrcm_membytes(bus, true, offset, memptr, len); 3229 ret = brcmf_sdbrcm_membytes(bus, true, offset, memptr, len);
3231 if (ret) { 3230 if (ret) {
3232 brcmf_dbg(ERROR, "error %d on writing %d membytes at 0x%08x\n", 3231 brcmf_err("error %d on writing %d membytes at 0x%08x\n",
3233 ret, MEMBLOCK, offset); 3232 ret, MEMBLOCK, offset);
3234 goto err; 3233 goto err;
3235 } 3234 }
@@ -3329,7 +3328,7 @@ static int brcmf_sdbrcm_download_nvram(struct brcmf_sdio *bus)
3329 ret = request_firmware(&bus->firmware, BRCMF_SDIO_NV_NAME, 3328 ret = request_firmware(&bus->firmware, BRCMF_SDIO_NV_NAME,
3330 &bus->sdiodev->func[2]->dev); 3329 &bus->sdiodev->func[2]->dev);
3331 if (ret) { 3330 if (ret) {
3332 brcmf_dbg(ERROR, "Fail to request nvram %d\n", ret); 3331 brcmf_err("Fail to request nvram %d\n", ret);
3333 return ret; 3332 return ret;
3334 } 3333 }
3335 3334
@@ -3346,23 +3345,23 @@ static int _brcmf_sdbrcm_download_firmware(struct brcmf_sdio *bus)
3346 3345
3347 /* Keep arm in reset */ 3346 /* Keep arm in reset */
3348 if (brcmf_sdbrcm_download_state(bus, true)) { 3347 if (brcmf_sdbrcm_download_state(bus, true)) {
3349 brcmf_dbg(ERROR, "error placing ARM core in reset\n"); 3348 brcmf_err("error placing ARM core in reset\n");
3350 goto err; 3349 goto err;
3351 } 3350 }
3352 3351
3353 /* External image takes precedence if specified */ 3352 /* External image takes precedence if specified */
3354 if (brcmf_sdbrcm_download_code_file(bus)) { 3353 if (brcmf_sdbrcm_download_code_file(bus)) {
3355 brcmf_dbg(ERROR, "dongle image file download failed\n"); 3354 brcmf_err("dongle image file download failed\n");
3356 goto err; 3355 goto err;
3357 } 3356 }
3358 3357
3359 /* External nvram takes precedence if specified */ 3358 /* External nvram takes precedence if specified */
3360 if (brcmf_sdbrcm_download_nvram(bus)) 3359 if (brcmf_sdbrcm_download_nvram(bus))
3361 brcmf_dbg(ERROR, "dongle nvram file download failed\n"); 3360 brcmf_err("dongle nvram file download failed\n");
3362 3361
3363 /* Take arm out of reset */ 3362 /* Take arm out of reset */
3364 if (brcmf_sdbrcm_download_state(bus, false)) { 3363 if (brcmf_sdbrcm_download_state(bus, false)) {
3365 brcmf_dbg(ERROR, "error getting out of ARM core reset\n"); 3364 brcmf_err("error getting out of ARM core reset\n");
3366 goto err; 3365 goto err;
3367 } 3366 }
3368 3367
@@ -3430,7 +3429,7 @@ static int brcmf_sdbrcm_bus_init(struct device *dev)
3430 (saveclk | SBSDIO_FORCE_HT), &err); 3429 (saveclk | SBSDIO_FORCE_HT), &err);
3431 } 3430 }
3432 if (err) { 3431 if (err) {
3433 brcmf_dbg(ERROR, "Failed to force clock for F2: err %d\n", err); 3432 brcmf_err("Failed to force clock for F2: err %d\n", err);
3434 goto exit; 3433 goto exit;
3435 } 3434 }
3436 3435
@@ -3476,7 +3475,7 @@ static int brcmf_sdbrcm_bus_init(struct device *dev)
3476 if (ret == 0) { 3475 if (ret == 0) {
3477 ret = brcmf_sdio_intr_register(bus->sdiodev); 3476 ret = brcmf_sdio_intr_register(bus->sdiodev);
3478 if (ret != 0) 3477 if (ret != 0)
3479 brcmf_dbg(ERROR, "intr register failed:%d\n", ret); 3478 brcmf_err("intr register failed:%d\n", ret);
3480 } 3479 }
3481 3480
3482 /* If we didn't come up, turn off backplane clock */ 3481 /* If we didn't come up, turn off backplane clock */
@@ -3496,12 +3495,12 @@ void brcmf_sdbrcm_isr(void *arg)
3496 brcmf_dbg(TRACE, "Enter\n"); 3495 brcmf_dbg(TRACE, "Enter\n");
3497 3496
3498 if (!bus) { 3497 if (!bus) {
3499 brcmf_dbg(ERROR, "bus is null pointer, exiting\n"); 3498 brcmf_err("bus is null pointer, exiting\n");
3500 return; 3499 return;
3501 } 3500 }
3502 3501
3503 if (bus->sdiodev->bus_if->state == BRCMF_BUS_DOWN) { 3502 if (bus->sdiodev->bus_if->state == BRCMF_BUS_DOWN) {
3504 brcmf_dbg(ERROR, "bus is down. we have nothing to do\n"); 3503 brcmf_err("bus is down. we have nothing to do\n");
3505 return; 3504 return;
3506 } 3505 }
3507 /* Count the interrupt call */ 3506 /* Count the interrupt call */
@@ -3510,13 +3509,13 @@ void brcmf_sdbrcm_isr(void *arg)
3510 atomic_set(&bus->ipend, 1); 3509 atomic_set(&bus->ipend, 1);
3511 else 3510 else
3512 if (brcmf_sdio_intr_rstatus(bus)) { 3511 if (brcmf_sdio_intr_rstatus(bus)) {
3513 brcmf_dbg(ERROR, "failed backplane access\n"); 3512 brcmf_err("failed backplane access\n");
3514 bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN; 3513 bus->sdiodev->bus_if->state = BRCMF_BUS_DOWN;
3515 } 3514 }
3516 3515
3517 /* Disable additional interrupts (is this needed now)? */ 3516 /* Disable additional interrupts (is this needed now)? */
3518 if (!bus->intr) 3517 if (!bus->intr)
3519 brcmf_dbg(ERROR, "isr w/o interrupt configured!\n"); 3518 brcmf_err("isr w/o interrupt configured!\n");
3520 3519
3521 brcmf_sdbrcm_adddpctsk(bus); 3520 brcmf_sdbrcm_adddpctsk(bus);
3522 queue_work(bus->brcmf_wq, &bus->datawork); 3521 queue_work(bus->brcmf_wq, &bus->datawork);
@@ -3718,18 +3717,18 @@ brcmf_sdbrcm_probe_attach(struct brcmf_sdio *bus, u32 regsva)
3718 SBSDIO_FUNC1_CHIPCLKCSR, &err); 3717 SBSDIO_FUNC1_CHIPCLKCSR, &err);
3719 3718
3720 if (err || ((clkctl & ~SBSDIO_AVBITS) != BRCMF_INIT_CLKCTL1)) { 3719 if (err || ((clkctl & ~SBSDIO_AVBITS) != BRCMF_INIT_CLKCTL1)) {
3721 brcmf_dbg(ERROR, "ChipClkCSR access: err %d wrote 0x%02x read 0x%02x\n", 3720 brcmf_err("ChipClkCSR access: err %d wrote 0x%02x read 0x%02x\n",
3722 err, BRCMF_INIT_CLKCTL1, clkctl); 3721 err, BRCMF_INIT_CLKCTL1, clkctl);
3723 goto fail; 3722 goto fail;
3724 } 3723 }
3725 3724
3726 if (brcmf_sdio_chip_attach(bus->sdiodev, &bus->ci, regsva)) { 3725 if (brcmf_sdio_chip_attach(bus->sdiodev, &bus->ci, regsva)) {
3727 brcmf_dbg(ERROR, "brcmf_sdio_chip_attach failed!\n"); 3726 brcmf_err("brcmf_sdio_chip_attach failed!\n");
3728 goto fail; 3727 goto fail;
3729 } 3728 }
3730 3729
3731 if (!brcmf_sdbrcm_chipmatch((u16) bus->ci->chip)) { 3730 if (!brcmf_sdbrcm_chipmatch((u16) bus->ci->chip)) {
3732 brcmf_dbg(ERROR, "unsupported chip: 0x%04x\n", bus->ci->chip); 3731 brcmf_err("unsupported chip: 0x%04x\n", bus->ci->chip);
3733 goto fail; 3732 goto fail;
3734 } 3733 }
3735 3734
@@ -3739,7 +3738,7 @@ brcmf_sdbrcm_probe_attach(struct brcmf_sdio *bus, u32 regsva)
3739 /* Get info on the SOCRAM cores... */ 3738 /* Get info on the SOCRAM cores... */
3740 bus->ramsize = bus->ci->ramsize; 3739 bus->ramsize = bus->ci->ramsize;
3741 if (!(bus->ramsize)) { 3740 if (!(bus->ramsize)) {
3742 brcmf_dbg(ERROR, "failed to find SOCRAM memory!\n"); 3741 brcmf_err("failed to find SOCRAM memory!\n");
3743 goto fail; 3742 goto fail;
3744 } 3743 }
3745 3744
@@ -3921,13 +3920,13 @@ void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev)
3921 INIT_WORK(&bus->datawork, brcmf_sdio_dataworker); 3920 INIT_WORK(&bus->datawork, brcmf_sdio_dataworker);
3922 bus->brcmf_wq = create_singlethread_workqueue("brcmf_wq"); 3921 bus->brcmf_wq = create_singlethread_workqueue("brcmf_wq");
3923 if (bus->brcmf_wq == NULL) { 3922 if (bus->brcmf_wq == NULL) {
3924 brcmf_dbg(ERROR, "insufficient memory to create txworkqueue\n"); 3923 brcmf_err("insufficient memory to create txworkqueue\n");
3925 goto fail; 3924 goto fail;
3926 } 3925 }
3927 3926
3928 /* attempt to attach to the dongle */ 3927 /* attempt to attach to the dongle */
3929 if (!(brcmf_sdbrcm_probe_attach(bus, regsva))) { 3928 if (!(brcmf_sdbrcm_probe_attach(bus, regsva))) {
3930 brcmf_dbg(ERROR, "brcmf_sdbrcm_probe_attach failed\n"); 3929 brcmf_err("brcmf_sdbrcm_probe_attach failed\n");
3931 goto fail; 3930 goto fail;
3932 } 3931 }
3933 3932
@@ -3960,18 +3959,18 @@ void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev)
3960 /* Attach to the brcmf/OS/network interface */ 3959 /* Attach to the brcmf/OS/network interface */
3961 ret = brcmf_attach(SDPCM_RESERVE, bus->sdiodev->dev); 3960 ret = brcmf_attach(SDPCM_RESERVE, bus->sdiodev->dev);
3962 if (ret != 0) { 3961 if (ret != 0) {
3963 brcmf_dbg(ERROR, "brcmf_attach failed\n"); 3962 brcmf_err("brcmf_attach failed\n");
3964 goto fail; 3963 goto fail;
3965 } 3964 }
3966 3965
3967 /* Allocate buffers */ 3966 /* Allocate buffers */
3968 if (!(brcmf_sdbrcm_probe_malloc(bus))) { 3967 if (!(brcmf_sdbrcm_probe_malloc(bus))) {
3969 brcmf_dbg(ERROR, "brcmf_sdbrcm_probe_malloc failed\n"); 3968 brcmf_err("brcmf_sdbrcm_probe_malloc failed\n");
3970 goto fail; 3969 goto fail;
3971 } 3970 }
3972 3971
3973 if (!(brcmf_sdbrcm_probe_init(bus))) { 3972 if (!(brcmf_sdbrcm_probe_init(bus))) {
3974 brcmf_dbg(ERROR, "brcmf_sdbrcm_probe_init failed\n"); 3973 brcmf_err("brcmf_sdbrcm_probe_init failed\n");
3975 goto fail; 3974 goto fail;
3976 } 3975 }
3977 3976
@@ -4001,7 +4000,7 @@ void *brcmf_sdbrcm_probe(u32 regsva, struct brcmf_sdio_dev *sdiodev)
4001 /* if firmware path present try to download and bring up bus */ 4000 /* if firmware path present try to download and bring up bus */
4002 ret = brcmf_bus_start(bus->sdiodev->dev); 4001 ret = brcmf_bus_start(bus->sdiodev->dev);
4003 if (ret != 0) { 4002 if (ret != 0) {
4004 brcmf_dbg(ERROR, "dongle is not responding\n"); 4003 brcmf_err("dongle is not responding\n");
4005 goto fail; 4004 goto fail;
4006 } 4005 }
4007 4006