Skip to contentSkip to conversation

Add MMC Password Protection (lock/unlock) support V9: mmc_lock_unlock.diff

PATCH In review Anderson Briglia 1 participant 2 messages Dec 15, 2006 – Jan 3, 2007 MMC, SD and SDIO

lore
Share & tools
lore
#0 lore raw

PATCH 3/4 Add MMC Password Protection (lock/unlock) support V9: mmc_lock_unlock.diff

Implement card lock/unlock operation, using the MMC_LOCK_UNLOCK command.

Signed-off-by Carlos Eduardo Aguiar <carlos.aguiar <at> indt.org.br>
Signed-off-by Anderson Lizardo <anderson.lizardo <at> indt.org.br>
Signed-off-by Anderson Briglia <anderson.briglia <at> indt.org.br>
drivers/mmc/mmc.h +4 -0
Index: linux-linus-2.6/drivers/mmc/mmc.h
===================================================================
@@ -27,6 +27,10 @@ struct mmc_key_payload {
 	char		data[0];	/* actual data */
 };
 
+struct key;
+
+extern int mmc_lock_unlock(struct mmc_card *card, struct key *key, int mode);
+
 int mmc_schedule_work(struct work_struct *work);
 int mmc_schedule_delayed_work(struct delayed_work *work, unsigned long delay);
 void mmc_flush_scheduled_work(void);
include/linux/mmc/protocol.h +8 -0
Index: linux-linus-2.6/include/linux/mmc/protocol.h
===================================================================
@@ -312,5 +312,13 @@ struct _mmc_csd {
 #define SD_BUS_WIDTH_1      0
 #define SD_BUS_WIDTH_4      2
 
+/*
+ * MMC_LOCK_UNLOCK modes
+ */
+#define MMC_LOCK_MODE_ERASE	(1<<3)
+#define MMC_LOCK_MODE_UNLOCK	(1<<2)
+#define MMC_LOCK_MODE_CLR_PWD	(1<<1)
+#define MMC_LOCK_MODE_SET_PWD	(1<<0)
+
 #endif  /* MMC_MMC_PROTOCOL_H */
 
drivers/mmc/mmc.c +116 -0

134 lines not on this page · raw message

#1 lore raw

Implement card lock/unlock operation, using the MMC_LOCK_UNLOCK command.

drivers/mmc/mmc.h +4 -0
Index: linux-linus-2.6/drivers/mmc/mmc.h
===================================================================
@@ -27,6 +27,10 @@ struct mmc_key_payload {
 	char		data[0];	/* actual data */
 };
 
+struct key;
+
+extern int mmc_lock_unlock(struct mmc_card *card, struct key *key, int mode);
+
 int mmc_schedule_work(struct work_struct *work);
 int mmc_schedule_delayed_work(struct delayed_work *work, unsigned long delay);
 void mmc_flush_scheduled_work(void);
include/linux/mmc/protocol.h +8 -0
Index: linux-linus-2.6/include/linux/mmc/protocol.h
===================================================================
@@ -312,5 +312,13 @@ struct _mmc_csd {
 #define SD_BUS_WIDTH_1      0
 #define SD_BUS_WIDTH_4      2
 
+/*
+ * MMC_LOCK_UNLOCK modes
+ */
+#define MMC_LOCK_MODE_ERASE	(1<<3)
+#define MMC_LOCK_MODE_UNLOCK	(1<<2)
+#define MMC_LOCK_MODE_CLR_PWD	(1<<1)
+#define MMC_LOCK_MODE_SET_PWD	(1<<0)
+
 #endif  /* MMC_MMC_PROTOCOL_H */
 
drivers/mmc/mmc.c +116 -0

134 lines not on this page · raw message