mtip32xx: add trim support
[firefly-linux-kernel-4.4.55.git] / drivers / block / mtip32xx / mtip32xx.h
index d782b1aa913ecf0ecb5a0a0b2451e7af9d55f2cb..3bffff5f670cc66f55f01ca5953f9d47702468ac 100644 (file)
@@ -178,6 +178,21 @@ struct mtip_work {
                mtip_workq_sdbfx(w->port, group, w->completed);     \
        }
 
+#define MTIP_TRIM_TIMEOUT_MS           240000
+#define MTIP_MAX_TRIM_ENTRIES          8
+#define MTIP_MAX_TRIM_ENTRY_LEN        0xfff8
+
+struct mtip_trim_entry {
+       u32 lba;   /* starting lba of region */
+       u16 rsvd;  /* unused */
+       u16 range; /* # of 512b blocks to trim */
+} __packed;
+
+struct mtip_trim {
+       /* Array of regions to trim */
+       struct mtip_trim_entry entry[MTIP_MAX_TRIM_ENTRIES];
+} __packed;
+
 /* Register Frame Information Structure (FIS), host to device. */
 struct host_to_dev_fis {
        /*
@@ -473,6 +488,8 @@ struct driver_data {
 
        struct dentry *dfs_node;
 
+       bool trim_supp; /* flag indicating trim support */
+
        int numa_node; /* NUMA support */
 
        char workq_name[32];