diff options
| author | Ingo Molnar <mingo@elte.hu> | 2008-12-31 02:31:57 -0500 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2008-12-31 02:31:57 -0500 |
| commit | a9de18eb761f7c1c860964b2e5addc1a35c7e861 (patch) | |
| tree | 886e75fdfd09690cd262ca69cb7f5d1d42b48602 /include/linux/libata.h | |
| parent | b2aaf8f74cdc84a9182f6cabf198b7763bcb9d40 (diff) | |
| parent | 6a94cb73064c952255336cc57731904174b2c58f (diff) | |
Merge branch 'linus' into stackprotector
Conflicts:
arch/x86/include/asm/pda.h
kernel/fork.c
Diffstat (limited to 'include/linux/libata.h')
| -rw-r--r-- | include/linux/libata.h | 78 |
1 files changed, 61 insertions, 17 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h index 947cf84e555..3449de597ef 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -213,10 +213,11 @@ enum { | |||
| 213 | ATA_PFLAG_FROZEN = (1 << 2), /* port is frozen */ | 213 | ATA_PFLAG_FROZEN = (1 << 2), /* port is frozen */ |
| 214 | ATA_PFLAG_RECOVERED = (1 << 3), /* recovery action performed */ | 214 | ATA_PFLAG_RECOVERED = (1 << 3), /* recovery action performed */ |
| 215 | ATA_PFLAG_LOADING = (1 << 4), /* boot/loading probe */ | 215 | ATA_PFLAG_LOADING = (1 << 4), /* boot/loading probe */ |
| 216 | ATA_PFLAG_UNLOADING = (1 << 5), /* module is unloading */ | ||
| 217 | ATA_PFLAG_SCSI_HOTPLUG = (1 << 6), /* SCSI hotplug scheduled */ | 216 | ATA_PFLAG_SCSI_HOTPLUG = (1 << 6), /* SCSI hotplug scheduled */ |
| 218 | ATA_PFLAG_INITIALIZING = (1 << 7), /* being initialized, don't touch */ | 217 | ATA_PFLAG_INITIALIZING = (1 << 7), /* being initialized, don't touch */ |
| 219 | ATA_PFLAG_RESETTING = (1 << 8), /* reset in progress */ | 218 | ATA_PFLAG_RESETTING = (1 << 8), /* reset in progress */ |
| 219 | ATA_PFLAG_UNLOADING = (1 << 9), /* driver is being unloaded */ | ||
| 220 | ATA_PFLAG_UNLOADED = (1 << 10), /* driver is unloaded */ | ||
| 220 | 221 | ||
| 221 | ATA_PFLAG_SUSPENDED = (1 << 17), /* port is suspended (power) */ | 222 | ATA_PFLAG_SUSPENDED = (1 << 17), /* port is suspended (power) */ |
| 222 | ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */ | 223 | ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */ |
| @@ -340,6 +341,9 @@ enum { | |||
| 340 | 341 | ||
| 341 | ATA_EHI_DID_RESET = ATA_EHI_DID_SOFTRESET | ATA_EHI_DID_HARDRESET, | 342 | ATA_EHI_DID_RESET = ATA_EHI_DID_SOFTRESET | ATA_EHI_DID_HARDRESET, |
| 342 | 343 | ||
| 344 | /* mask of flags to transfer *to* the slave link */ | ||
| 345 | ATA_EHI_TO_SLAVE_MASK = ATA_EHI_NO_AUTOPSY | ATA_EHI_QUIET, | ||
| 346 | |||
| 343 | /* max tries if error condition is still set after ->error_handler */ | 347 | /* max tries if error condition is still set after ->error_handler */ |
| 344 | ATA_EH_MAX_TRIES = 5, | 348 | ATA_EH_MAX_TRIES = 5, |
| 345 | 349 | ||
| @@ -369,6 +373,10 @@ enum { | |||
| 369 | ATA_HORKAGE_IPM = (1 << 7), /* Link PM problems */ | 373 | ATA_HORKAGE_IPM = (1 << 7), /* Link PM problems */ |
| 370 | ATA_HORKAGE_IVB = (1 << 8), /* cbl det validity bit bugs */ | 374 | ATA_HORKAGE_IVB = (1 << 8), /* cbl det validity bit bugs */ |
| 371 | ATA_HORKAGE_STUCK_ERR = (1 << 9), /* stuck ERR on next PACKET */ | 375 | ATA_HORKAGE_STUCK_ERR = (1 << 9), /* stuck ERR on next PACKET */ |
| 376 | ATA_HORKAGE_BRIDGE_OK = (1 << 10), /* no bridge limits */ | ||
| 377 | ATA_HORKAGE_ATAPI_MOD16_DMA = (1 << 11), /* use ATAPI DMA for commands | ||
| 378 | not multiple of 16 bytes */ | ||
| 379 | ATA_HORKAGE_FIRMWARE_WARN = (1 << 12), /* firwmare update warning */ | ||
| 372 | 380 | ||
| 373 | /* DMA mask for user DMA control: User visible values; DO NOT | 381 | /* DMA mask for user DMA control: User visible values; DO NOT |
| 374 | renumber */ | 382 | renumber */ |
| @@ -1278,26 +1286,62 @@ static inline int ata_link_active(struct ata_link *link) | |||
| 1278 | return ata_tag_valid(link->active_tag) || link->sactive; | 1286 | return ata_tag_valid(link->active_tag) || link->sactive; |
| 1279 | } | 1287 | } |
| 1280 | 1288 | ||
| 1281 | extern struct ata_link *__ata_port_next_link(struct ata_port *ap, | 1289 | /* |
| 1282 | struct ata_link *link, | 1290 | * Iterators |
| 1283 | bool dev_only); | 1291 | * |
| 1292 | * ATA_LITER_* constants are used to select link iteration mode and | ||
| 1293 | * ATA_DITER_* device iteration mode. | ||
| 1294 | * | ||
| 1295 | * For a custom iteration directly using ata_{link|dev}_next(), if | ||
| 1296 | * @link or @dev, respectively, is NULL, the first element is | ||
| 1297 | * returned. @dev and @link can be any valid device or link and the | ||
| 1298 | * next element according to the iteration mode will be returned. | ||
| 1299 | * After the last element, NULL is returned. | ||
| 1300 | */ | ||
| 1301 | enum ata_link_iter_mode { | ||
| 1302 | ATA_LITER_EDGE, /* if present, PMP links only; otherwise, | ||
| 1303 | * host link. no slave link */ | ||
| 1304 | ATA_LITER_HOST_FIRST, /* host link followed by PMP or slave links */ | ||
| 1305 | ATA_LITER_PMP_FIRST, /* PMP links followed by host link, | ||
| 1306 | * slave link still comes after host link */ | ||
| 1307 | }; | ||
| 1308 | |||
| 1309 | enum ata_dev_iter_mode { | ||
| 1310 | ATA_DITER_ENABLED, | ||
| 1311 | ATA_DITER_ENABLED_REVERSE, | ||
| 1312 | ATA_DITER_ALL, | ||
| 1313 | ATA_DITER_ALL_REVERSE, | ||
| 1314 | }; | ||
| 1284 | 1315 | ||
| 1285 | #define __ata_port_for_each_link(link, ap) \ | 1316 | extern struct ata_link *ata_link_next(struct ata_link *link, |
| 1286 | for ((link) = __ata_port_next_link((ap), NULL, false); (link); \ | 1317 | struct ata_port *ap, |
| 1287 | (link) = __ata_port_next_link((ap), (link), false)) | 1318 | enum ata_link_iter_mode mode); |
| 1288 | 1319 | ||
| 1289 | #define ata_port_for_each_link(link, ap) \ | 1320 | extern struct ata_device *ata_dev_next(struct ata_device *dev, |
| 1290 | for ((link) = __ata_port_next_link((ap), NULL, true); (link); \ | 1321 | struct ata_link *link, |
| 1291 | (link) = __ata_port_next_link((ap), (link), true)) | 1322 | enum ata_dev_iter_mode mode); |
| 1292 | 1323 | ||
| 1293 | #define ata_link_for_each_dev(dev, link) \ | 1324 | /* |
| 1294 | for ((dev) = (link)->device; \ | 1325 | * Shortcut notation for iterations |
| 1295 | (dev) < (link)->device + ata_link_max_devices(link) || ((dev) = NULL); \ | 1326 | * |
| 1296 | (dev)++) | 1327 | * ata_for_each_link() iterates over each link of @ap according to |
| 1328 | * @mode. @link points to the current link in the loop. @link is | ||
| 1329 | * NULL after loop termination. ata_for_each_dev() works the same way | ||
| 1330 | * except that it iterates over each device of @link. | ||
| 1331 | * | ||
| 1332 | * Note that the mode prefixes ATA_{L|D}ITER_ shouldn't need to be | ||
| 1333 | * specified when using the following shorthand notations. Only the | ||
| 1334 | * mode itself (EDGE, HOST_FIRST, ENABLED, etc...) should be | ||
| 1335 | * specified. This not only increases brevity but also makes it | ||
| 1336 | * impossible to use ATA_LITER_* for device iteration or vice-versa. | ||
| 1337 | */ | ||
| 1338 | #define ata_for_each_link(link, ap, mode) \ | ||
| 1339 | for ((link) = ata_link_next(NULL, (ap), ATA_LITER_##mode); (link); \ | ||
| 1340 | (link) = ata_link_next((link), (ap), ATA_LITER_##mode)) | ||
| 1297 | 1341 | ||
| 1298 | #define ata_link_for_each_dev_reverse(dev, link) \ | 1342 | #define ata_for_each_dev(dev, link, mode) \ |
| 1299 | for ((dev) = (link)->device + ata_link_max_devices(link) - 1; \ | 1343 | for ((dev) = ata_dev_next(NULL, (link), ATA_DITER_##mode); (dev); \ |
| 1300 | (dev) >= (link)->device || ((dev) = NULL); (dev)--) | 1344 | (dev) = ata_dev_next((dev), (link), ATA_DITER_##mode)) |
| 1301 | 1345 | ||
| 1302 | /** | 1346 | /** |
| 1303 | * ata_ncq_enabled - Test whether NCQ is enabled | 1347 | * ata_ncq_enabled - Test whether NCQ is enabled |
