aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ata.h
diff options
context:
space:
mode:
authorTejun Heo <htejun@gmail.com>2007-07-01 06:05:58 -0400
committerJeff Garzik <jeff@garzik.org>2007-07-10 21:46:03 -0400
commit814600ee10d3c056ada315cdbdc2ebe48f54c75a (patch)
tree0d83d136e891ad1bbec738572ef37390c00e7e9b /include/linux/ata.h
parentfee7ca72d3dae1078031b6fd272b9930f43bd3d1 (diff)
libata-link: add PMP related ATA constants
Add Port Multiplier related ATA constants and macros. Some of these will be used by ata_link implementation. Signed-off-by: Tejun Heo <htejun@gmail.com> Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'include/linux/ata.h')
-rw-r--r--include/linux/ata.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 407dc7e098bc..b5a20162af32 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -164,6 +164,8 @@ enum {
164 ATA_CMD_SET_MAX = 0xF9, 164 ATA_CMD_SET_MAX = 0xF9,
165 ATA_CMD_SET_MAX_EXT = 0x37, 165 ATA_CMD_SET_MAX_EXT = 0x37,
166 ATA_CMD_READ_LOG_EXT = 0x2f, 166 ATA_CMD_READ_LOG_EXT = 0x2f,
167 ATA_CMD_PMP_READ = 0xE4,
168 ATA_CMD_PMP_WRITE = 0xE8,
167 169
168 /* READ_LOG_EXT pages */ 170 /* READ_LOG_EXT pages */
169 ATA_LOG_SATA_NCQ = 0x10, 171 ATA_LOG_SATA_NCQ = 0x10,
@@ -212,6 +214,28 @@ enum {
212 0=to device, 1=to host */ 214 0=to device, 1=to host */
213 ATAPI_CDB_LEN = 16, 215 ATAPI_CDB_LEN = 16,
214 216
217 /* PMP stuff */
218 SATA_PMP_MAX_PORTS = 15,
219 SATA_PMP_CTRL_PORT = 15,
220
221 SATA_PMP_GSCR_DWORDS = 128,
222 SATA_PMP_GSCR_PROD_ID = 0,
223 SATA_PMP_GSCR_REV = 1,
224 SATA_PMP_GSCR_PORT_INFO = 2,
225 SATA_PMP_GSCR_ERROR = 32,
226 SATA_PMP_GSCR_ERROR_EN = 33,
227 SATA_PMP_GSCR_FEAT = 64,
228 SATA_PMP_GSCR_FEAT_EN = 96,
229
230 SATA_PMP_PSCR_STATUS = 0,
231 SATA_PMP_PSCR_ERROR = 1,
232 SATA_PMP_PSCR_CONTROL = 2,
233
234 SATA_PMP_FEAT_BIST = (1 << 0),
235 SATA_PMP_FEAT_PMREQ = (1 << 1),
236 SATA_PMP_FEAT_DYNSSC = (1 << 2),
237 SATA_PMP_FEAT_NOTIFY = (1 << 3),
238
215 /* cable types */ 239 /* cable types */
216 ATA_CBL_NONE = 0, 240 ATA_CBL_NONE = 0,
217 ATA_CBL_PATA40 = 1, 241 ATA_CBL_PATA40 = 1,
@@ -418,4 +442,9 @@ static inline int lba_48_ok(u64 block, u32 n_block)
418 return ((block + n_block - 1) < ((u64)1 << 48)) && (n_block <= 65536); 442 return ((block + n_block - 1) < ((u64)1 << 48)) && (n_block <= 65536);
419} 443}
420 444
445#define sata_pmp_gscr_vendor(gscr) ((gscr)[SATA_PMP_GSCR_PROD_ID] & 0xffff)
446#define sata_pmp_gscr_devid(gscr) ((gscr)[SATA_PMP_GSCR_PROD_ID] >> 16)
447#define sata_pmp_gscr_rev(gscr) (((gscr)[SATA_PMP_GSCR_REV] >> 8) & 0xff)
448#define sata_pmp_gscr_ports(gscr) ((gscr)[SATA_PMP_GSCR_PORT_INFO] & 0xf)
449
421#endif /* __LINUX_ATA_H__ */ 450#endif /* __LINUX_ATA_H__ */