[patch 5/6] Add MMC password protection (lock/unlock) support V4
- From: Carlos Aguiar <carlos.aguiar@xxxxxxxxxxx>
- Date: Tue, 31 Jan 2006 16:16:41 -0400
The MMC_LOCK_UNLOCK command requires the block length to be exactly the
password length + 2 bytes, but hardware-specific drivers force a "power of 2"
block size.
This patch sends the exact block size (password + 2 bytes) to the host. OMAP
specific.
Signed-off-by: Anderson Briglia <anderson.briglia@xxxxxxxxxxx>
Signed-off-by: Anderson Lizardo <anderson.lizardo@xxxxxxxxxxx>
Signed-off-by: Carlos Eduardo Aguiar <carlos.aguiar@xxxxxxxxxxx>
Index: linux-omap-2.6.git/drivers/mmc/omap.c
===================================================================
--- linux-omap-2.6.git.orig/drivers/mmc/omap.c 2006-01-31 15:17:44.000000000 -0400
+++ linux-omap-2.6.git/drivers/mmc/omap.c 2006-01-31 15:22:33.000000000 -0400
@@ -888,8 +888,12 @@ mmc_omap_prepare_data(struct mmc_omap_ho
return;
}
-
- block_size = 1 << data->blksz_bits;
+ /* password protection: we need to send the exact block size to the
+ * card (password + 2), not a 2-exponent. */
+ if (req->cmd->opcode == MMC_LOCK_UNLOCK)
+ block_size = data->sg[0].length;
+ else
+ block_size = 1 << data->blksz_bits;
OMAP_MMC_WRITE(host->base, NBLK, data->blocks - 1);
OMAP_MMC_WRITE(host->base, BLEN, block_size - 1);
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
- References:
- [patch 0/6] Add MMC password protection (lock/unlock) support V4
- From: Carlos Aguiar
- [patch 0/6] Add MMC password protection (lock/unlock) support V4
- Prev by Date: Re: RFC [patch 13/34] PID Virtualization Define new task_pid api
- Next by Date: Re: [PATCH 09/11] kbuild: drop vmlinux dependency from 'make install'
- Previous by thread: [patch 2/6] Add MMC password protection (lock/unlock) support V4
- Next by thread: Re: R: Xorg crashes 2.6.16-rc1-git4
- Index(es):