aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/ath/ath6kl/sdio.c
diff options
context:
space:
mode:
authorKalle Valo <kvalo@qca.qualcomm.com>2011-09-27 07:30:58 -0400
committerKalle Valo <kvalo@qca.qualcomm.com>2011-09-28 12:27:31 -0400
commitf7325b85efe1395b52ef1006dafe3c0d4ff79f15 (patch)
tree557a08d21af2f2ba0ad6c3364cacf05af62115e5 /drivers/net/wireless/ath/ath6kl/sdio.c
parentef094103233344271990d15045d6a776386c3784 (diff)
ath6kl: add sdio debug messages
Add extensive debug messages to sdio.c. Makes it easier to debug various problems. Signed-off-by: Kalle Valo <kvalo@qca.qualcomm.com>
Diffstat (limited to 'drivers/net/wireless/ath/ath6kl/sdio.c')
-rw-r--r--drivers/net/wireless/ath/ath6kl/sdio.c36
1 files changed, 27 insertions, 9 deletions
diff --git a/drivers/net/wireless/ath/ath6kl/sdio.c b/drivers/net/wireless/ath/ath6kl/sdio.c
index 4724ddfab4f7..f1dc311ee0c7 100644
--- a/drivers/net/wireless/ath/ath6kl/sdio.c
+++ b/drivers/net/wireless/ath/ath6kl/sdio.c
@@ -135,10 +135,12 @@ static int ath6kl_sdio_io(struct sdio_func *func, u32 request, u32 addr,
135 int ret = 0; 135 int ret = 0;
136 136
137 if (request & HIF_WRITE) { 137 if (request & HIF_WRITE) {
138 /* FIXME: looks like ugly workaround for something */
138 if (addr >= HIF_MBOX_BASE_ADDR && 139 if (addr >= HIF_MBOX_BASE_ADDR &&
139 addr <= HIF_MBOX_END_ADDR) 140 addr <= HIF_MBOX_END_ADDR)
140 addr += (HIF_MBOX_WIDTH - len); 141 addr += (HIF_MBOX_WIDTH - len);
141 142
143 /* FIXME: this also looks like ugly workaround */
142 if (addr == HIF_MBOX0_EXT_BASE_ADDR) 144 if (addr == HIF_MBOX0_EXT_BASE_ADDR)
143 addr += HIF_MBOX0_EXT_WIDTH - len; 145 addr += HIF_MBOX0_EXT_WIDTH - len;
144 146
@@ -153,6 +155,11 @@ static int ath6kl_sdio_io(struct sdio_func *func, u32 request, u32 addr,
153 ret = sdio_memcpy_fromio(func, buf, addr, len); 155 ret = sdio_memcpy_fromio(func, buf, addr, len);
154 } 156 }
155 157
158 ath6kl_dbg(ATH6KL_DBG_SDIO, "%s addr 0x%x%s buf 0x%p len %d\n",
159 request & HIF_WRITE ? "wr" : "rd", addr,
160 request & HIF_FIXED_ADDRESS ? " (fixed)" : "", buf, len);
161 ath6kl_dbg_dump(ATH6KL_DBG_SDIO_DUMP, NULL, "sdio ", buf, len);
162
156 return ret; 163 return ret;
157} 164}
158 165
@@ -173,7 +180,8 @@ static struct bus_request *ath6kl_sdio_alloc_busreq(struct ath6kl_sdio *ar_sdio)
173 list_del(&bus_req->list); 180 list_del(&bus_req->list);
174 181
175 spin_unlock_irqrestore(&ar_sdio->lock, flag); 182 spin_unlock_irqrestore(&ar_sdio->lock, flag);
176 ath6kl_dbg(ATH6KL_DBG_TRC, "%s: bus request 0x%p\n", __func__, bus_req); 183 ath6kl_dbg(ATH6KL_DBG_SCATTER, "%s: bus request 0x%p\n",
184 __func__, bus_req);
177 185
178 return bus_req; 186 return bus_req;
179} 187}
@@ -183,7 +191,8 @@ static void ath6kl_sdio_free_bus_req(struct ath6kl_sdio *ar_sdio,
183{ 191{
184 unsigned long flag; 192 unsigned long flag;
185 193
186 ath6kl_dbg(ATH6KL_DBG_TRC, "%s: bus request 0x%p\n", __func__, bus_req); 194 ath6kl_dbg(ATH6KL_DBG_SCATTER, "%s: bus request 0x%p\n",
195 __func__, bus_req);
187 196
188 spin_lock_irqsave(&ar_sdio->lock, flag); 197 spin_lock_irqsave(&ar_sdio->lock, flag);
189 list_add_tail(&bus_req->list, &ar_sdio->bus_req_freeq); 198 list_add_tail(&bus_req->list, &ar_sdio->bus_req_freeq);
@@ -438,6 +447,8 @@ static void ath6kl_sdio_irq_handler(struct sdio_func *func)
438 int status; 447 int status;
439 struct ath6kl_sdio *ar_sdio; 448 struct ath6kl_sdio *ar_sdio;
440 449
450 ath6kl_dbg(ATH6KL_DBG_SDIO, "irq\n");
451
441 ar_sdio = sdio_get_drvdata(func); 452 ar_sdio = sdio_get_drvdata(func);
442 atomic_set(&ar_sdio->irq_handling, 1); 453 atomic_set(&ar_sdio->irq_handling, 1);
443 454
@@ -675,7 +686,7 @@ static int ath6kl_sdio_enable_scatter(struct ath6kl *ar)
675 MAX_SCATTER_REQUESTS, virt_scat); 686 MAX_SCATTER_REQUESTS, virt_scat);
676 687
677 if (!ret) { 688 if (!ret) {
678 ath6kl_dbg(ATH6KL_DBG_ANY, 689 ath6kl_dbg(ATH6KL_DBG_SCATTER,
679 "hif-scatter enabled: max scatter req : %d entries: %d\n", 690 "hif-scatter enabled: max scatter req : %d entries: %d\n",
680 MAX_SCATTER_REQUESTS, 691 MAX_SCATTER_REQUESTS,
681 MAX_SCATTER_ENTRIES_PER_REQ); 692 MAX_SCATTER_ENTRIES_PER_REQ);
@@ -700,7 +711,7 @@ static int ath6kl_sdio_enable_scatter(struct ath6kl *ar)
700 return ret; 711 return ret;
701 } 712 }
702 713
703 ath6kl_dbg(ATH6KL_DBG_ANY, 714 ath6kl_dbg(ATH6KL_DBG_SCATTER,
704 "Vitual scatter enabled, max_scat_req:%d, entries:%d\n", 715 "Vitual scatter enabled, max_scat_req:%d, entries:%d\n",
705 ATH6KL_SCATTER_REQS, ATH6KL_SCATTER_ENTRIES_PER_REQ); 716 ATH6KL_SCATTER_REQS, ATH6KL_SCATTER_ENTRIES_PER_REQ);
706 717
@@ -723,6 +734,9 @@ static int ath6kl_sdio_suspend(struct ath6kl *ar)
723 734
724 if (!(flags & MMC_PM_KEEP_POWER)) 735 if (!(flags & MMC_PM_KEEP_POWER))
725 /* as host doesn't support keep power we need to bail out */ 736 /* as host doesn't support keep power we need to bail out */
737 ath6kl_dbg(ATH6KL_DBG_SDIO,
738 "func %d doesn't support MMC_PM_KEEP_POWER\n",
739 func->num);
726 return -EINVAL; 740 return -EINVAL;
727 741
728 ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER); 742 ret = sdio_set_host_pm_flags(func, MMC_PM_KEEP_POWER);
@@ -758,10 +772,10 @@ static int ath6kl_sdio_probe(struct sdio_func *func,
758 struct ath6kl *ar; 772 struct ath6kl *ar;
759 int count; 773 int count;
760 774
761 ath6kl_dbg(ATH6KL_DBG_TRC, 775 ath6kl_dbg(ATH6KL_DBG_SDIO,
762 "%s: func: 0x%X, vendor id: 0x%X, dev id: 0x%X, block size: 0x%X/0x%X\n", 776 "new func %d vendor 0x%x device 0x%x block 0x%x/0x%x\n",
763 __func__, func->num, func->vendor, 777 func->num, func->vendor, func->device,
764 func->device, func->max_blksize, func->cur_blksize); 778 func->max_blksize, func->cur_blksize);
765 779
766 ar_sdio = kzalloc(sizeof(struct ath6kl_sdio), GFP_KERNEL); 780 ar_sdio = kzalloc(sizeof(struct ath6kl_sdio), GFP_KERNEL);
767 if (!ar_sdio) 781 if (!ar_sdio)
@@ -820,7 +834,7 @@ static int ath6kl_sdio_probe(struct sdio_func *func,
820 goto err_cfg80211; 834 goto err_cfg80211;
821 } 835 }
822 836
823 ath6kl_dbg(ATH6KL_DBG_TRC, "4-bit async irq mode enabled\n"); 837 ath6kl_dbg(ATH6KL_DBG_SDIO, "4-bit async irq mode enabled\n");
824 } 838 }
825 839
826 /* give us some time to enable, in ms */ 840 /* give us some time to enable, in ms */
@@ -868,6 +882,10 @@ static void ath6kl_sdio_remove(struct sdio_func *func)
868{ 882{
869 struct ath6kl_sdio *ar_sdio; 883 struct ath6kl_sdio *ar_sdio;
870 884
885 ath6kl_dbg(ATH6KL_DBG_SDIO,
886 "removed func %d vendor 0x%x device 0x%x\n",
887 func->num, func->vendor, func->device);
888
871 ar_sdio = sdio_get_drvdata(func); 889 ar_sdio = sdio_get_drvdata(func);
872 890
873 ath6kl_stop_txrx(ar_sdio->ar); 891 ath6kl_stop_txrx(ar_sdio->ar);