linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 5/5] Add MMC password protection (lock/unlock) support V3
@ 2006-01-09 22:17 Anderson Briglia
  0 siblings, 0 replies; only message in thread
From: Anderson Briglia @ 2006-01-09 22:17 UTC (permalink / raw)
  To: linux-kernel, Linux-omap-open-source@linux.omap.com
  Cc: linux, ext David Brownell, Tony Lindgren, drzeus-list,
	Aguiar Carlos (EXT-INdT/Manaus),
	Lizardo Anderson (EXT-INdT/Manaus),
	Anderson Briglia

[-- Attachment #1: Type: text/plain, Size: 5 bytes --]







[-- Attachment #2: mmc_omap_blklen.diff --]
[-- Type: text/x-patch, Size: 1182 bytes --]

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@indt.org.br>
Signed-off-by: Anderson Lizardo <anderson.lizardo@indt.org.br>
Signed-off-by: Carlos Eduardo Aguiar <carlos.aguiar@indt.org.br>

Index: linux-2.6.15-rc4/drivers/mmc/omap.c
===================================================================
--- linux-2.6.15-rc4.orig/drivers/mmc/omap.c	2005-12-27 17:42:49.000000000 -0400
+++ linux-2.6.15-rc4/drivers/mmc/omap.c	2005-12-27 17:43:57.000000000 -0400
@@ -889,8 +889,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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-01-09 22:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-09 22:17 [patch 5/5] Add MMC password protection (lock/unlock) support V3 Anderson Briglia

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).