Add MMC Password Protection (lock/unlock) support V9: mmc_lock_unlock.diff
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
@@ -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
@@ -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
Implement card lock/unlock operation, using the MMC_LOCK_UNLOCK command.
Signed-off-by Carlos Eduardo Aguiar <[email protected]>
Signed-off-by Anderson Lizardo <[email protected]>
Signed-off-by Anderson Briglia <[email protected]>
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 delayed_work *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