aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/bcmdhd/bcmsdh_sdmmc.c
diff options
context:
space:
mode:
authorPawit Pornkitprasan <p.pawit@gmail.com>2012-11-20 14:07:00 +0700
committerPawit Pornkitprasan <p.pawit@gmail.com>2012-11-20 19:26:27 +0700
commit67196921fba94cf21b6c2de7da422d536fc9471d (patch)
tree68df62d89e409ed6458379d13cb9aeb9a5ba4de2 /drivers/net/wireless/bcmdhd/bcmsdh_sdmmc.c
parent9cc9894f039461a2f772de8bfd79617642f8665a (diff)
downloadkernel_samsung_aries-67196921fba94cf21b6c2de7da422d536fc9471d.zip
kernel_samsung_aries-67196921fba94cf21b6c2de7da422d536fc9471d.tar.gz
kernel_samsung_aries-67196921fba94cf21b6c2de7da422d536fc9471d.tar.bz2
net: wireless: import bcmdhd from tuna kernel
as of d5a18e013da25a07b330fd70c212ac477cabff4e 'Revert "net: wireless: bcmdhd: Fix WD wakelock behavior"' Change-Id: I8d0951437855e49e3a47cd0d105095e22f349a84
Diffstat (limited to 'drivers/net/wireless/bcmdhd/bcmsdh_sdmmc.c')
-rw-r--r--drivers/net/wireless/bcmdhd/bcmsdh_sdmmc.c62
1 files changed, 38 insertions, 24 deletions
diff --git a/drivers/net/wireless/bcmdhd/bcmsdh_sdmmc.c b/drivers/net/wireless/bcmdhd/bcmsdh_sdmmc.c
index 374154f..db051a4 100644
--- a/drivers/net/wireless/bcmdhd/bcmsdh_sdmmc.c
+++ b/drivers/net/wireless/bcmdhd/bcmsdh_sdmmc.c
@@ -21,7 +21,7 @@
* software in any way with any other Broadcom software provided under a license
* other than the GPL, without Broadcom's express prior written consent.
*
- * $Id: bcmsdh_sdmmc.c 314904 2012-02-14 21:36:04Z $
+ * $Id: bcmsdh_sdmmc.c 351910 2012-08-21 22:39:46Z $
*/
#include <typedefs.h>
@@ -799,41 +799,49 @@ sdioh_request_byte(sdioh_info_t *sd, uint rw, uint func, uint regaddr, uint8 *by
#if defined(MMC_SDIO_ABORT)
/* to allow abort command through F1 */
else if (regaddr == SDIOD_CCCR_IOABORT) {
- sdio_claim_host(gInstance->func[func]);
- /*
- * this sdio_f0_writeb() can be replaced with another api
- * depending upon MMC driver change.
- * As of this time, this is temporaray one
- */
- sdio_writeb(gInstance->func[func], *byte, regaddr, &err_ret);
- sdio_release_host(gInstance->func[func]);
+ if (gInstance->func[func]) {
+ sdio_claim_host(gInstance->func[func]);
+ /*
+ * this sdio_f0_writeb() can be replaced with another api
+ * depending upon MMC driver change.
+ * As of this time, this is temporaray one
+ */
+ sdio_writeb(gInstance->func[func],
+ *byte, regaddr, &err_ret);
+ sdio_release_host(gInstance->func[func]);
+ }
}
#endif /* MMC_SDIO_ABORT */
else if (regaddr < 0xF0) {
sd_err(("bcmsdh_sdmmc: F0 Wr:0x%02x: write disallowed\n", regaddr));
} else {
/* Claim host controller, perform F0 write, and release */
- sdio_claim_host(gInstance->func[func]);
- sdio_f0_writeb(gInstance->func[func], *byte, regaddr, &err_ret);
- sdio_release_host(gInstance->func[func]);
+ if (gInstance->func[func]) {
+ sdio_claim_host(gInstance->func[func]);
+ sdio_f0_writeb(gInstance->func[func],
+ *byte, regaddr, &err_ret);
+ sdio_release_host(gInstance->func[func]);
+ }
}
} else {
/* Claim host controller, perform Fn write, and release */
- sdio_claim_host(gInstance->func[func]);
- sdio_writeb(gInstance->func[func], *byte, regaddr, &err_ret);
- sdio_release_host(gInstance->func[func]);
+ if (gInstance->func[func]) {
+ sdio_claim_host(gInstance->func[func]);
+ sdio_writeb(gInstance->func[func], *byte, regaddr, &err_ret);
+ sdio_release_host(gInstance->func[func]);
+ }
}
} else { /* CMD52 Read */
/* Claim host controller, perform Fn read, and release */
- sdio_claim_host(gInstance->func[func]);
-
- if (func == 0) {
- *byte = sdio_f0_readb(gInstance->func[func], regaddr, &err_ret);
- } else {
- *byte = sdio_readb(gInstance->func[func], regaddr, &err_ret);
+ if (gInstance->func[func]) {
+ sdio_claim_host(gInstance->func[func]);
+ if (func == 0) {
+ *byte = sdio_f0_readb(gInstance->func[func], regaddr, &err_ret);
+ } else {
+ *byte = sdio_readb(gInstance->func[func], regaddr, &err_ret);
+ }
+ sdio_release_host(gInstance->func[func]);
}
-
- sdio_release_host(gInstance->func[func]);
}
if (err_ret) {
@@ -1012,7 +1020,13 @@ sdioh_request_packet(sdioh_info_t *sd, uint fix_inc, uint write, uint func,
pkt_len -= xfred_len;
xfred_len = 0;
}
- pkt_len = (pkt_len + 3) & 0xFFFFFFFC;
+
+ /* Align Patch */
+ if (!write || pkt_len < 32)
+ pkt_len = (pkt_len + 3) & 0xFFFFFFFC;
+ else if (pkt_len % DHD_SDALIGN)
+ pkt_len += DHD_SDALIGN - (pkt_len % DHD_SDALIGN);
+
#ifdef CONFIG_MMC_MSM7X00A
if ((pkt_len % 64) == 32) {
sd_trace(("%s: Rounding up TX packet +=32\n", __FUNCTION__));