mmc: add erase, secure erase, trim and secure trim operations
[linux-2.6-block.git] / include / linux / mmc / core.h
index e4898e9eeb5971753b0447b4399177748460eade..7429033acb663dc4974a5ecdf44b696da416976d 100644 (file)
@@ -92,6 +92,8 @@ struct mmc_command {
  *              actively failing requests
  */
 
+       unsigned int            erase_timeout;  /* in milliseconds */
+
        struct mmc_data         *data;          /* data segment associated with cmd */
        struct mmc_request      *mrq;           /* associated request */
 };
@@ -134,6 +136,23 @@ extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);
 extern int mmc_wait_for_app_cmd(struct mmc_host *, struct mmc_card *,
        struct mmc_command *, int);
 
+#define MMC_ERASE_ARG          0x00000000
+#define MMC_SECURE_ERASE_ARG   0x80000000
+#define MMC_TRIM_ARG           0x00000001
+#define MMC_SECURE_TRIM1_ARG   0x80000001
+#define MMC_SECURE_TRIM2_ARG   0x80008000
+
+#define MMC_SECURE_ARGS                0x80000000
+#define MMC_TRIM_ARGS          0x00008001
+
+extern int mmc_erase(struct mmc_card *card, unsigned int from, unsigned int nr,
+                    unsigned int arg);
+extern int mmc_can_erase(struct mmc_card *card);
+extern int mmc_can_trim(struct mmc_card *card);
+extern int mmc_can_secure_erase_trim(struct mmc_card *card);
+extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from,
+                                  unsigned int nr);
+
 extern void mmc_set_data_timeout(struct mmc_data *, const struct mmc_card *);
 extern unsigned int mmc_align_data_size(struct mmc_card *, unsigned int);