From 152834694dcb90d3088bc77fa436755c66553929 Mon Sep 17 00:00:00 2001 From: Asai Thambi S P Date: Fri, 11 Jan 2013 14:41:34 +0100 Subject: mtip32xx: add trim support TRIM support added through vendor unique command. Signed-off-by: Sam Bradshaw < sbradshaw@micron.com> Signed-off-by: Asai Thambi S P Signed-off-by: Jens Axboe --- drivers/block/mtip32xx/mtip32xx.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'drivers/block/mtip32xx/mtip32xx.h') diff --git a/drivers/block/mtip32xx/mtip32xx.h b/drivers/block/mtip32xx/mtip32xx.h index d782b1aa913e..3bffff5f670c 100644 --- a/drivers/block/mtip32xx/mtip32xx.h +++ b/drivers/block/mtip32xx/mtip32xx.h @@ -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]; -- cgit v1.2.3