Add MMC Password Protection (lock/unlock) support V8: mmc_lock_unlock.diff
PATCH 3/4 Add MMC Password Protection (lock/unlock) support V8: 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
@@ -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 work_struct *work,unsigned long delay);void mmc_flush_scheduled_work (void );
include/linux/mmc/protocol.h +8 -0
@@ -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 (0<<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 +113 -0
131 lines not on this page · raw message
Hi all,
As discussed with Pierre, I changed this patch and now I'm sending a new version.
You can track the discussion here: http://linux.omap.com/pipermail/linux-omap-open-source/2006-November/008466.html
Another patches weren't modified.
Fixed in this patch:
- Definition of MMC_LOCK_MODE_UNLOCK changed to 1 << 2.
- Use bit operations to handle with LOCK_MODE's macros.
Comments are always welcome.
Best regards,
Anderson Briglia
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
@@ -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 work_struct *work,unsigned long delay);void mmc_flush_scheduled_work (void );
include/linux/mmc/protocol.h +8 -0
@@ -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