diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/ata.h | 155 | ||||
-rw-r--r-- | include/linux/device.h | 5 | ||||
-rw-r--r-- | include/linux/exportfs.h | 21 | ||||
-rw-r--r-- | include/linux/fb.h | 3 | ||||
-rw-r--r-- | include/linux/fs_uart_pd.h | 1 | ||||
-rw-r--r-- | include/linux/if_tun.h | 1 | ||||
-rw-r--r-- | include/linux/libata.h | 24 | ||||
-rw-r--r-- | include/linux/pci-acpi.h | 11 | ||||
-rw-r--r-- | include/linux/pci_ids.h | 3 | ||||
-rw-r--r-- | include/linux/pid.h | 9 | ||||
-rw-r--r-- | include/linux/rmap.h | 2 | ||||
-rw-r--r-- | include/linux/skbuff.h | 4 | ||||
-rw-r--r-- | include/linux/tick.h | 5 | ||||
-rw-r--r-- | include/linux/usb.h | 3 |
14 files changed, 196 insertions, 51 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h index 1c622e2b0504..1ce19c1ef0e9 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -46,18 +46,48 @@ enum { | |||
46 | ATA_MAX_SECTORS_TAPE = 65535, | 46 | ATA_MAX_SECTORS_TAPE = 65535, |
47 | 47 | ||
48 | ATA_ID_WORDS = 256, | 48 | ATA_ID_WORDS = 256, |
49 | ATA_ID_CONFIG = 0, | ||
50 | ATA_ID_CYLS = 1, | ||
51 | ATA_ID_HEADS = 3, | ||
52 | ATA_ID_SECTORS = 6, | ||
49 | ATA_ID_SERNO = 10, | 53 | ATA_ID_SERNO = 10, |
54 | ATA_ID_BUF_SIZE = 21, | ||
50 | ATA_ID_FW_REV = 23, | 55 | ATA_ID_FW_REV = 23, |
51 | ATA_ID_PROD = 27, | 56 | ATA_ID_PROD = 27, |
57 | ATA_ID_MAX_MULTSECT = 47, | ||
58 | ATA_ID_DWORD_IO = 48, | ||
59 | ATA_ID_CAPABILITY = 49, | ||
52 | ATA_ID_OLD_PIO_MODES = 51, | 60 | ATA_ID_OLD_PIO_MODES = 51, |
61 | ATA_ID_OLD_DMA_MODES = 52, | ||
53 | ATA_ID_FIELD_VALID = 53, | 62 | ATA_ID_FIELD_VALID = 53, |
63 | ATA_ID_CUR_CYLS = 54, | ||
64 | ATA_ID_CUR_HEADS = 55, | ||
65 | ATA_ID_CUR_SECTORS = 56, | ||
66 | ATA_ID_MULTSECT = 59, | ||
67 | ATA_ID_LBA_CAPACITY = 60, | ||
68 | ATA_ID_SWDMA_MODES = 62, | ||
54 | ATA_ID_MWDMA_MODES = 63, | 69 | ATA_ID_MWDMA_MODES = 63, |
55 | ATA_ID_PIO_MODES = 64, | 70 | ATA_ID_PIO_MODES = 64, |
56 | ATA_ID_EIDE_DMA_MIN = 65, | 71 | ATA_ID_EIDE_DMA_MIN = 65, |
72 | ATA_ID_EIDE_DMA_TIME = 66, | ||
57 | ATA_ID_EIDE_PIO = 67, | 73 | ATA_ID_EIDE_PIO = 67, |
58 | ATA_ID_EIDE_PIO_IORDY = 68, | 74 | ATA_ID_EIDE_PIO_IORDY = 68, |
59 | ATA_ID_UDMA_MODES = 88, | 75 | ATA_ID_QUEUE_DEPTH = 75, |
60 | ATA_ID_MAJOR_VER = 80, | 76 | ATA_ID_MAJOR_VER = 80, |
77 | ATA_ID_COMMAND_SET_1 = 82, | ||
78 | ATA_ID_COMMAND_SET_2 = 83, | ||
79 | ATA_ID_CFSSE = 84, | ||
80 | ATA_ID_CFS_ENABLE_1 = 85, | ||
81 | ATA_ID_CFS_ENABLE_2 = 86, | ||
82 | ATA_ID_CSF_DEFAULT = 87, | ||
83 | ATA_ID_UDMA_MODES = 88, | ||
84 | ATA_ID_HW_CONFIG = 93, | ||
85 | ATA_ID_SPG = 98, | ||
86 | ATA_ID_LBA_CAPACITY_2 = 100, | ||
87 | ATA_ID_LAST_LUN = 126, | ||
88 | ATA_ID_DLF = 128, | ||
89 | ATA_ID_CSFO = 129, | ||
90 | ATA_ID_CFA_POWER = 160, | ||
61 | ATA_ID_PIO4 = (1 << 1), | 91 | ATA_ID_PIO4 = (1 << 1), |
62 | 92 | ||
63 | ATA_ID_SERNO_LEN = 20, | 93 | ATA_ID_SERNO_LEN = 20, |
@@ -123,13 +153,26 @@ enum { | |||
123 | ATA_BUSY = (1 << 7), /* BSY status bit */ | 153 | ATA_BUSY = (1 << 7), /* BSY status bit */ |
124 | ATA_DRDY = (1 << 6), /* device ready */ | 154 | ATA_DRDY = (1 << 6), /* device ready */ |
125 | ATA_DF = (1 << 5), /* device fault */ | 155 | ATA_DF = (1 << 5), /* device fault */ |
156 | ATA_DSC = (1 << 4), /* drive seek complete */ | ||
126 | ATA_DRQ = (1 << 3), /* data request i/o */ | 157 | ATA_DRQ = (1 << 3), /* data request i/o */ |
158 | ATA_CORR = (1 << 2), /* corrected data error */ | ||
159 | ATA_IDX = (1 << 1), /* index */ | ||
127 | ATA_ERR = (1 << 0), /* have an error */ | 160 | ATA_ERR = (1 << 0), /* have an error */ |
128 | ATA_SRST = (1 << 2), /* software reset */ | 161 | ATA_SRST = (1 << 2), /* software reset */ |
129 | ATA_ICRC = (1 << 7), /* interface CRC error */ | 162 | ATA_ICRC = (1 << 7), /* interface CRC error */ |
163 | ATA_BBK = ATA_ICRC, /* pre-EIDE: block marked bad */ | ||
130 | ATA_UNC = (1 << 6), /* uncorrectable media error */ | 164 | ATA_UNC = (1 << 6), /* uncorrectable media error */ |
165 | ATA_MC = (1 << 5), /* media changed */ | ||
131 | ATA_IDNF = (1 << 4), /* ID not found */ | 166 | ATA_IDNF = (1 << 4), /* ID not found */ |
167 | ATA_MCR = (1 << 3), /* media change requested */ | ||
132 | ATA_ABORTED = (1 << 2), /* command aborted */ | 168 | ATA_ABORTED = (1 << 2), /* command aborted */ |
169 | ATA_TRK0NF = (1 << 1), /* track 0 not found */ | ||
170 | ATA_AMNF = (1 << 0), /* address mark not found */ | ||
171 | ATAPI_LFS = 0xF0, /* last failed sense */ | ||
172 | ATAPI_EOM = ATA_TRK0NF, /* end of media */ | ||
173 | ATAPI_ILI = ATA_AMNF, /* illegal length indication */ | ||
174 | ATAPI_IO = (1 << 1), | ||
175 | ATAPI_COD = (1 << 0), | ||
133 | 176 | ||
134 | /* ATA command block registers */ | 177 | /* ATA command block registers */ |
135 | ATA_REG_DATA = 0x00, | 178 | ATA_REG_DATA = 0x00, |
@@ -192,6 +235,13 @@ enum { | |||
192 | ATA_CMD_PMP_WRITE = 0xE8, | 235 | ATA_CMD_PMP_WRITE = 0xE8, |
193 | ATA_CMD_CONF_OVERLAY = 0xB1, | 236 | ATA_CMD_CONF_OVERLAY = 0xB1, |
194 | ATA_CMD_SEC_FREEZE_LOCK = 0xF5, | 237 | ATA_CMD_SEC_FREEZE_LOCK = 0xF5, |
238 | ATA_CMD_SMART = 0xB0, | ||
239 | ATA_CMD_MEDIA_LOCK = 0xDE, | ||
240 | ATA_CMD_MEDIA_UNLOCK = 0xDF, | ||
241 | /* marked obsolete in the ATA/ATAPI-7 spec */ | ||
242 | ATA_CMD_RESTORE = 0x10, | ||
243 | /* EXABYTE specific */ | ||
244 | ATA_EXABYTE_ENABLE_NEST = 0xF0, | ||
195 | 245 | ||
196 | /* READ_LOG_EXT pages */ | 246 | /* READ_LOG_EXT pages */ |
197 | ATA_LOG_SATA_NCQ = 0x10, | 247 | ATA_LOG_SATA_NCQ = 0x10, |
@@ -232,6 +282,10 @@ enum { | |||
232 | SETFEATURES_WC_ON = 0x02, /* Enable write cache */ | 282 | SETFEATURES_WC_ON = 0x02, /* Enable write cache */ |
233 | SETFEATURES_WC_OFF = 0x82, /* Disable write cache */ | 283 | SETFEATURES_WC_OFF = 0x82, /* Disable write cache */ |
234 | 284 | ||
285 | /* Enable/Disable Automatic Acoustic Management */ | ||
286 | SETFEATURES_AAM_ON = 0x42, | ||
287 | SETFEATURES_AAM_OFF = 0xC2, | ||
288 | |||
235 | SETFEATURES_SPINUP = 0x07, /* Spin-up drive */ | 289 | SETFEATURES_SPINUP = 0x07, /* Spin-up drive */ |
236 | 290 | ||
237 | SETFEATURES_SATA_ENABLE = 0x10, /* Enable use of SATA feature */ | 291 | SETFEATURES_SATA_ENABLE = 0x10, /* Enable use of SATA feature */ |
@@ -254,6 +308,15 @@ enum { | |||
254 | ATA_DCO_IDENTIFY = 0xC2, | 308 | ATA_DCO_IDENTIFY = 0xC2, |
255 | ATA_DCO_SET = 0xC3, | 309 | ATA_DCO_SET = 0xC3, |
256 | 310 | ||
311 | /* feature values for SMART */ | ||
312 | ATA_SMART_ENABLE = 0xD8, | ||
313 | ATA_SMART_READ_VALUES = 0xD0, | ||
314 | ATA_SMART_READ_THRESHOLDS = 0xD1, | ||
315 | |||
316 | /* password used in LBA Mid / LBA High for executing SMART commands */ | ||
317 | ATA_SMART_LBAM_PASS = 0x4F, | ||
318 | ATA_SMART_LBAH_PASS = 0xC2, | ||
319 | |||
257 | /* ATAPI stuff */ | 320 | /* ATAPI stuff */ |
258 | ATAPI_PKT_DMA = (1 << 0), | 321 | ATAPI_PKT_DMA = (1 << 0), |
259 | ATAPI_DMADIR = (1 << 2), /* ATAPI data dir: | 322 | ATAPI_DMADIR = (1 << 2), /* ATAPI data dir: |
@@ -438,17 +501,17 @@ static inline int ata_is_data(u8 prot) | |||
438 | /* | 501 | /* |
439 | * id tests | 502 | * id tests |
440 | */ | 503 | */ |
441 | #define ata_id_is_ata(id) (((id)[0] & (1 << 15)) == 0) | 504 | #define ata_id_is_ata(id) (((id)[ATA_ID_CONFIG] & (1 << 15)) == 0) |
442 | #define ata_id_has_lba(id) ((id)[49] & (1 << 9)) | 505 | #define ata_id_has_lba(id) ((id)[ATA_ID_CAPABILITY] & (1 << 9)) |
443 | #define ata_id_has_dma(id) ((id)[49] & (1 << 8)) | 506 | #define ata_id_has_dma(id) ((id)[ATA_ID_CAPABILITY] & (1 << 8)) |
444 | #define ata_id_has_ncq(id) ((id)[76] & (1 << 8)) | 507 | #define ata_id_has_ncq(id) ((id)[76] & (1 << 8)) |
445 | #define ata_id_queue_depth(id) (((id)[75] & 0x1f) + 1) | 508 | #define ata_id_queue_depth(id) (((id)[ATA_ID_QUEUE_DEPTH] & 0x1f) + 1) |
446 | #define ata_id_removeable(id) ((id)[0] & (1 << 7)) | 509 | #define ata_id_removeable(id) ((id)[ATA_ID_CONFIG] & (1 << 7)) |
447 | #define ata_id_has_atapi_AN(id) \ | 510 | #define ata_id_has_atapi_AN(id) \ |
448 | ( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \ | 511 | ( (((id)[76] != 0x0000) && ((id)[76] != 0xffff)) && \ |
449 | ((id)[78] & (1 << 5)) ) | 512 | ((id)[78] & (1 << 5)) ) |
450 | #define ata_id_iordy_disable(id) ((id)[49] & (1 << 10)) | 513 | #define ata_id_iordy_disable(id) ((id)[ATA_ID_CAPABILITY] & (1 << 10)) |
451 | #define ata_id_has_iordy(id) ((id)[49] & (1 << 11)) | 514 | #define ata_id_has_iordy(id) ((id)[ATA_ID_CAPABILITY] & (1 << 11)) |
452 | #define ata_id_u32(id,n) \ | 515 | #define ata_id_u32(id,n) \ |
453 | (((u32) (id)[(n) + 1] << 16) | ((u32) (id)[(n)])) | 516 | (((u32) (id)[(n) + 1] << 16) | ((u32) (id)[(n)])) |
454 | #define ata_id_u64(id,n) \ | 517 | #define ata_id_u64(id,n) \ |
@@ -457,7 +520,7 @@ static inline int ata_is_data(u8 prot) | |||
457 | ((u64) (id)[(n) + 1] << 16) | \ | 520 | ((u64) (id)[(n) + 1] << 16) | \ |
458 | ((u64) (id)[(n) + 0]) ) | 521 | ((u64) (id)[(n) + 0]) ) |
459 | 522 | ||
460 | #define ata_id_cdb_intr(id) (((id)[0] & 0x60) == 0x20) | 523 | #define ata_id_cdb_intr(id) (((id)[ATA_ID_CONFIG] & 0x60) == 0x20) |
461 | 524 | ||
462 | static inline bool ata_id_has_hipm(const u16 *id) | 525 | static inline bool ata_id_has_hipm(const u16 *id) |
463 | { | 526 | { |
@@ -482,75 +545,75 @@ static inline bool ata_id_has_dipm(const u16 *id) | |||
482 | 545 | ||
483 | static inline int ata_id_has_fua(const u16 *id) | 546 | static inline int ata_id_has_fua(const u16 *id) |
484 | { | 547 | { |
485 | if ((id[84] & 0xC000) != 0x4000) | 548 | if ((id[ATA_ID_CFSSE] & 0xC000) != 0x4000) |
486 | return 0; | 549 | return 0; |
487 | return id[84] & (1 << 6); | 550 | return id[ATA_ID_CFSSE] & (1 << 6); |
488 | } | 551 | } |
489 | 552 | ||
490 | static inline int ata_id_has_flush(const u16 *id) | 553 | static inline int ata_id_has_flush(const u16 *id) |
491 | { | 554 | { |
492 | if ((id[83] & 0xC000) != 0x4000) | 555 | if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) |
493 | return 0; | 556 | return 0; |
494 | return id[83] & (1 << 12); | 557 | return id[ATA_ID_COMMAND_SET_2] & (1 << 12); |
495 | } | 558 | } |
496 | 559 | ||
497 | static inline int ata_id_has_flush_ext(const u16 *id) | 560 | static inline int ata_id_has_flush_ext(const u16 *id) |
498 | { | 561 | { |
499 | if ((id[83] & 0xC000) != 0x4000) | 562 | if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) |
500 | return 0; | 563 | return 0; |
501 | return id[83] & (1 << 13); | 564 | return id[ATA_ID_COMMAND_SET_2] & (1 << 13); |
502 | } | 565 | } |
503 | 566 | ||
504 | static inline int ata_id_has_lba48(const u16 *id) | 567 | static inline int ata_id_has_lba48(const u16 *id) |
505 | { | 568 | { |
506 | if ((id[83] & 0xC000) != 0x4000) | 569 | if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) |
507 | return 0; | 570 | return 0; |
508 | if (!ata_id_u64(id, 100)) | 571 | if (!ata_id_u64(id, ATA_ID_LBA_CAPACITY_2)) |
509 | return 0; | 572 | return 0; |
510 | return id[83] & (1 << 10); | 573 | return id[ATA_ID_COMMAND_SET_2] & (1 << 10); |
511 | } | 574 | } |
512 | 575 | ||
513 | static inline int ata_id_hpa_enabled(const u16 *id) | 576 | static inline int ata_id_hpa_enabled(const u16 *id) |
514 | { | 577 | { |
515 | /* Yes children, word 83 valid bits cover word 82 data */ | 578 | /* Yes children, word 83 valid bits cover word 82 data */ |
516 | if ((id[83] & 0xC000) != 0x4000) | 579 | if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) |
517 | return 0; | 580 | return 0; |
518 | /* And 87 covers 85-87 */ | 581 | /* And 87 covers 85-87 */ |
519 | if ((id[87] & 0xC000) != 0x4000) | 582 | if ((id[ATA_ID_CSF_DEFAULT] & 0xC000) != 0x4000) |
520 | return 0; | 583 | return 0; |
521 | /* Check command sets enabled as well as supported */ | 584 | /* Check command sets enabled as well as supported */ |
522 | if ((id[85] & ( 1 << 10)) == 0) | 585 | if ((id[ATA_ID_CFS_ENABLE_1] & (1 << 10)) == 0) |
523 | return 0; | 586 | return 0; |
524 | return id[82] & (1 << 10); | 587 | return id[ATA_ID_COMMAND_SET_1] & (1 << 10); |
525 | } | 588 | } |
526 | 589 | ||
527 | static inline int ata_id_has_wcache(const u16 *id) | 590 | static inline int ata_id_has_wcache(const u16 *id) |
528 | { | 591 | { |
529 | /* Yes children, word 83 valid bits cover word 82 data */ | 592 | /* Yes children, word 83 valid bits cover word 82 data */ |
530 | if ((id[83] & 0xC000) != 0x4000) | 593 | if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) |
531 | return 0; | 594 | return 0; |
532 | return id[82] & (1 << 5); | 595 | return id[ATA_ID_COMMAND_SET_1] & (1 << 5); |
533 | } | 596 | } |
534 | 597 | ||
535 | static inline int ata_id_has_pm(const u16 *id) | 598 | static inline int ata_id_has_pm(const u16 *id) |
536 | { | 599 | { |
537 | if ((id[83] & 0xC000) != 0x4000) | 600 | if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) |
538 | return 0; | 601 | return 0; |
539 | return id[82] & (1 << 3); | 602 | return id[ATA_ID_COMMAND_SET_1] & (1 << 3); |
540 | } | 603 | } |
541 | 604 | ||
542 | static inline int ata_id_rahead_enabled(const u16 *id) | 605 | static inline int ata_id_rahead_enabled(const u16 *id) |
543 | { | 606 | { |
544 | if ((id[87] & 0xC000) != 0x4000) | 607 | if ((id[ATA_ID_CSF_DEFAULT] & 0xC000) != 0x4000) |
545 | return 0; | 608 | return 0; |
546 | return id[85] & (1 << 6); | 609 | return id[ATA_ID_CFS_ENABLE_1] & (1 << 6); |
547 | } | 610 | } |
548 | 611 | ||
549 | static inline int ata_id_wcache_enabled(const u16 *id) | 612 | static inline int ata_id_wcache_enabled(const u16 *id) |
550 | { | 613 | { |
551 | if ((id[87] & 0xC000) != 0x4000) | 614 | if ((id[ATA_ID_CSF_DEFAULT] & 0xC000) != 0x4000) |
552 | return 0; | 615 | return 0; |
553 | return id[85] & (1 << 5); | 616 | return id[ATA_ID_CFS_ENABLE_1] & (1 << 5); |
554 | } | 617 | } |
555 | 618 | ||
556 | /** | 619 | /** |
@@ -581,7 +644,7 @@ static inline unsigned int ata_id_major_version(const u16 *id) | |||
581 | 644 | ||
582 | static inline int ata_id_is_sata(const u16 *id) | 645 | static inline int ata_id_is_sata(const u16 *id) |
583 | { | 646 | { |
584 | return ata_id_major_version(id) >= 5 && id[93] == 0; | 647 | return ata_id_major_version(id) >= 5 && id[ATA_ID_HW_CONFIG] == 0; |
585 | } | 648 | } |
586 | 649 | ||
587 | static inline int ata_id_has_tpm(const u16 *id) | 650 | static inline int ata_id_has_tpm(const u16 *id) |
@@ -599,7 +662,7 @@ static inline int ata_id_has_dword_io(const u16 *id) | |||
599 | /* ATA 8 reuses this flag for "trusted" computing */ | 662 | /* ATA 8 reuses this flag for "trusted" computing */ |
600 | if (ata_id_major_version(id) > 7) | 663 | if (ata_id_major_version(id) > 7) |
601 | return 0; | 664 | return 0; |
602 | if (id[48] & (1 << 0)) | 665 | if (id[ATA_ID_DWORD_IO] & (1 << 0)) |
603 | return 1; | 666 | return 1; |
604 | return 0; | 667 | return 0; |
605 | } | 668 | } |
@@ -608,22 +671,22 @@ static inline int ata_id_current_chs_valid(const u16 *id) | |||
608 | { | 671 | { |
609 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command | 672 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command |
610 | has not been issued to the device then the values of | 673 | has not been issued to the device then the values of |
611 | id[54] to id[56] are vendor specific. */ | 674 | id[ATA_ID_CUR_CYLS] to id[ATA_ID_CUR_SECTORS] are vendor specific. */ |
612 | return (id[53] & 0x01) && /* Current translation valid */ | 675 | return (id[ATA_ID_FIELD_VALID] & 1) && /* Current translation valid */ |
613 | id[54] && /* cylinders in current translation */ | 676 | id[ATA_ID_CUR_CYLS] && /* cylinders in current translation */ |
614 | id[55] && /* heads in current translation */ | 677 | id[ATA_ID_CUR_HEADS] && /* heads in current translation */ |
615 | id[55] <= 16 && | 678 | id[ATA_ID_CUR_HEADS] <= 16 && |
616 | id[56]; /* sectors in current translation */ | 679 | id[ATA_ID_CUR_SECTORS]; /* sectors in current translation */ |
617 | } | 680 | } |
618 | 681 | ||
619 | static inline int ata_id_is_cfa(const u16 *id) | 682 | static inline int ata_id_is_cfa(const u16 *id) |
620 | { | 683 | { |
621 | u16 v = id[0]; | 684 | if (id[ATA_ID_CONFIG] == 0x848A) /* Standard CF */ |
622 | if (v == 0x848A) /* Standard CF */ | ||
623 | return 1; | 685 | return 1; |
624 | /* Could be CF hiding as standard ATA */ | 686 | /* Could be CF hiding as standard ATA */ |
625 | if (ata_id_major_version(id) >= 3 && id[82] != 0xFFFF && | 687 | if (ata_id_major_version(id) >= 3 && |
626 | (id[82] & ( 1 << 2))) | 688 | id[ATA_ID_COMMAND_SET_1] != 0xFFFF && |
689 | (id[ATA_ID_COMMAND_SET_1] & (1 << 2))) | ||
627 | return 1; | 690 | return 1; |
628 | return 0; | 691 | return 0; |
629 | } | 692 | } |
@@ -632,21 +695,21 @@ static inline int ata_drive_40wire(const u16 *dev_id) | |||
632 | { | 695 | { |
633 | if (ata_id_is_sata(dev_id)) | 696 | if (ata_id_is_sata(dev_id)) |
634 | return 0; /* SATA */ | 697 | return 0; /* SATA */ |
635 | if ((dev_id[93] & 0xE000) == 0x6000) | 698 | if ((dev_id[ATA_ID_HW_CONFIG] & 0xE000) == 0x6000) |
636 | return 0; /* 80 wire */ | 699 | return 0; /* 80 wire */ |
637 | return 1; | 700 | return 1; |
638 | } | 701 | } |
639 | 702 | ||
640 | static inline int ata_drive_40wire_relaxed(const u16 *dev_id) | 703 | static inline int ata_drive_40wire_relaxed(const u16 *dev_id) |
641 | { | 704 | { |
642 | if ((dev_id[93] & 0x2000) == 0x2000) | 705 | if ((dev_id[ATA_ID_HW_CONFIG] & 0x2000) == 0x2000) |
643 | return 0; /* 80 wire */ | 706 | return 0; /* 80 wire */ |
644 | return 1; | 707 | return 1; |
645 | } | 708 | } |
646 | 709 | ||
647 | static inline int atapi_cdb_len(const u16 *dev_id) | 710 | static inline int atapi_cdb_len(const u16 *dev_id) |
648 | { | 711 | { |
649 | u16 tmp = dev_id[0] & 0x3; | 712 | u16 tmp = dev_id[ATA_ID_CONFIG] & 0x3; |
650 | switch (tmp) { | 713 | switch (tmp) { |
651 | case 0: return 12; | 714 | case 0: return 12; |
652 | case 1: return 16; | 715 | case 1: return 16; |
@@ -656,7 +719,7 @@ static inline int atapi_cdb_len(const u16 *dev_id) | |||
656 | 719 | ||
657 | static inline int atapi_command_packet_set(const u16 *dev_id) | 720 | static inline int atapi_command_packet_set(const u16 *dev_id) |
658 | { | 721 | { |
659 | return (dev_id[0] >> 8) & 0x1f; | 722 | return (dev_id[ATA_ID_CONFIG] >> 8) & 0x1f; |
660 | } | 723 | } |
661 | 724 | ||
662 | static inline int atapi_id_dmadir(const u16 *dev_id) | 725 | static inline int atapi_id_dmadir(const u16 *dev_id) |
diff --git a/include/linux/device.h b/include/linux/device.h index d24a47f80f9c..4d8372d135df 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -358,6 +358,7 @@ struct device { | |||
358 | 358 | ||
359 | struct kobject kobj; | 359 | struct kobject kobj; |
360 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ | 360 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ |
361 | const char *init_name; /* initial name of the device */ | ||
361 | struct device_type *type; | 362 | struct device_type *type; |
362 | unsigned uevent_suppress:1; | 363 | unsigned uevent_suppress:1; |
363 | 364 | ||
@@ -406,7 +407,7 @@ struct device { | |||
406 | /* Get the wakeup routines, which depend on struct device */ | 407 | /* Get the wakeup routines, which depend on struct device */ |
407 | #include <linux/pm_wakeup.h> | 408 | #include <linux/pm_wakeup.h> |
408 | 409 | ||
409 | static inline const char *dev_name(struct device *dev) | 410 | static inline const char *dev_name(const struct device *dev) |
410 | { | 411 | { |
411 | /* will be changed into kobject_name(&dev->kobj) in the near future */ | 412 | /* will be changed into kobject_name(&dev->kobj) in the near future */ |
412 | return dev->bus_id; | 413 | return dev->bus_id; |
@@ -518,7 +519,7 @@ extern void device_shutdown(void); | |||
518 | extern void sysdev_shutdown(void); | 519 | extern void sysdev_shutdown(void); |
519 | 520 | ||
520 | /* debugging and troubleshooting/diagnostic helpers. */ | 521 | /* debugging and troubleshooting/diagnostic helpers. */ |
521 | extern const char *dev_driver_string(struct device *dev); | 522 | extern const char *dev_driver_string(const struct device *dev); |
522 | #define dev_printk(level, dev, format, arg...) \ | 523 | #define dev_printk(level, dev, format, arg...) \ |
523 | printk(level "%s %s: " format , dev_driver_string(dev) , \ | 524 | printk(level "%s %s: " format , dev_driver_string(dev) , \ |
524 | dev_name(dev) , ## arg) | 525 | dev_name(dev) , ## arg) |
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h index f5abd1306638..27e772cefb6a 100644 --- a/include/linux/exportfs.h +++ b/include/linux/exportfs.h | |||
@@ -35,6 +35,27 @@ enum fid_type { | |||
35 | FILEID_INO32_GEN_PARENT = 2, | 35 | FILEID_INO32_GEN_PARENT = 2, |
36 | 36 | ||
37 | /* | 37 | /* |
38 | * 64 bit object ID, 64 bit root object ID, | ||
39 | * 32 bit generation number. | ||
40 | */ | ||
41 | FILEID_BTRFS_WITHOUT_PARENT = 0x4d, | ||
42 | |||
43 | /* | ||
44 | * 64 bit object ID, 64 bit root object ID, | ||
45 | * 32 bit generation number, | ||
46 | * 64 bit parent object ID, 32 bit parent generation. | ||
47 | */ | ||
48 | FILEID_BTRFS_WITH_PARENT = 0x4e, | ||
49 | |||
50 | /* | ||
51 | * 64 bit object ID, 64 bit root object ID, | ||
52 | * 32 bit generation number, | ||
53 | * 64 bit parent object ID, 32 bit parent generation, | ||
54 | * 64 bit parent root object ID. | ||
55 | */ | ||
56 | FILEID_BTRFS_WITH_PARENT_ROOT = 0x4f, | ||
57 | |||
58 | /* | ||
38 | * 32 bit block number, 16 bit partition reference, | 59 | * 32 bit block number, 16 bit partition reference, |
39 | * 16 bit unused, 32 bit generation number. | 60 | * 16 bit unused, 32 bit generation number. |
40 | */ | 61 | */ |
diff --git a/include/linux/fb.h b/include/linux/fb.h index 3b8870e32afd..531ccd5f5960 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -976,6 +976,9 @@ static inline void __fb_pad_aligned_buffer(u8 *dst, u32 d_pitch, | |||
976 | 976 | ||
977 | /* drivers/video/fb_defio.c */ | 977 | /* drivers/video/fb_defio.c */ |
978 | extern void fb_deferred_io_init(struct fb_info *info); | 978 | extern void fb_deferred_io_init(struct fb_info *info); |
979 | extern void fb_deferred_io_open(struct fb_info *info, | ||
980 | struct inode *inode, | ||
981 | struct file *file); | ||
979 | extern void fb_deferred_io_cleanup(struct fb_info *info); | 982 | extern void fb_deferred_io_cleanup(struct fb_info *info); |
980 | extern int fb_deferred_io_fsync(struct file *file, struct dentry *dentry, | 983 | extern int fb_deferred_io_fsync(struct file *file, struct dentry *dentry, |
981 | int datasync); | 984 | int datasync); |
diff --git a/include/linux/fs_uart_pd.h b/include/linux/fs_uart_pd.h index 809bb9ffc788..36b61ff39277 100644 --- a/include/linux/fs_uart_pd.h +++ b/include/linux/fs_uart_pd.h | |||
@@ -12,7 +12,6 @@ | |||
12 | #ifndef FS_UART_PD_H | 12 | #ifndef FS_UART_PD_H |
13 | #define FS_UART_PD_H | 13 | #define FS_UART_PD_H |
14 | 14 | ||
15 | #include <linux/version.h> | ||
16 | #include <asm/types.h> | 15 | #include <asm/types.h> |
17 | 16 | ||
18 | enum fs_uart_id { | 17 | enum fs_uart_id { |
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h index 4c6307ad9fdb..8529f57ba263 100644 --- a/include/linux/if_tun.h +++ b/include/linux/if_tun.h | |||
@@ -45,6 +45,7 @@ | |||
45 | #define TUNGETFEATURES _IOR('T', 207, unsigned int) | 45 | #define TUNGETFEATURES _IOR('T', 207, unsigned int) |
46 | #define TUNSETOFFLOAD _IOW('T', 208, unsigned int) | 46 | #define TUNSETOFFLOAD _IOW('T', 208, unsigned int) |
47 | #define TUNSETTXFILTER _IOW('T', 209, unsigned int) | 47 | #define TUNSETTXFILTER _IOW('T', 209, unsigned int) |
48 | #define TUNGETIFF _IOR('T', 210, unsigned int) | ||
48 | 49 | ||
49 | /* TUNSETIFF ifr flags */ | 50 | /* TUNSETIFF ifr flags */ |
50 | #define IFF_TUN 0x0001 | 51 | #define IFF_TUN 0x0001 |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 06b80337303b..225bfc5bd9ec 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -163,6 +163,7 @@ enum { | |||
163 | ATA_DEV_NONE = 9, /* no device */ | 163 | ATA_DEV_NONE = 9, /* no device */ |
164 | 164 | ||
165 | /* struct ata_link flags */ | 165 | /* struct ata_link flags */ |
166 | ATA_LFLAG_NO_HRST = (1 << 1), /* avoid hardreset */ | ||
166 | ATA_LFLAG_NO_SRST = (1 << 2), /* avoid softreset */ | 167 | ATA_LFLAG_NO_SRST = (1 << 2), /* avoid softreset */ |
167 | ATA_LFLAG_ASSUME_ATA = (1 << 3), /* assume ATA class */ | 168 | ATA_LFLAG_ASSUME_ATA = (1 << 3), /* assume ATA class */ |
168 | ATA_LFLAG_ASSUME_SEMB = (1 << 4), /* assume SEMB class */ | 169 | ATA_LFLAG_ASSUME_SEMB = (1 << 4), /* assume SEMB class */ |
@@ -646,6 +647,7 @@ struct ata_link { | |||
646 | 647 | ||
647 | unsigned int flags; /* ATA_LFLAG_xxx */ | 648 | unsigned int flags; /* ATA_LFLAG_xxx */ |
648 | 649 | ||
650 | u32 saved_scontrol; /* SControl on probe */ | ||
649 | unsigned int hw_sata_spd_limit; | 651 | unsigned int hw_sata_spd_limit; |
650 | unsigned int sata_spd_limit; | 652 | unsigned int sata_spd_limit; |
651 | unsigned int sata_spd; /* current SATA PHY speed */ | 653 | unsigned int sata_spd; /* current SATA PHY speed */ |
@@ -1427,6 +1429,28 @@ static inline unsigned long ata_deadline(unsigned long from_jiffies, | |||
1427 | return from_jiffies + msecs_to_jiffies(timeout_msecs); | 1429 | return from_jiffies + msecs_to_jiffies(timeout_msecs); |
1428 | } | 1430 | } |
1429 | 1431 | ||
1432 | /* Don't open code these in drivers as there are traps. Firstly the range may | ||
1433 | change in future hardware and specs, secondly 0xFF means 'no DMA' but is | ||
1434 | > UDMA_0. Dyma ddreigiau */ | ||
1435 | |||
1436 | static inline int ata_using_mwdma(struct ata_device *adev) | ||
1437 | { | ||
1438 | if (adev->dma_mode >= XFER_MW_DMA_0 && adev->dma_mode <= XFER_MW_DMA_4) | ||
1439 | return 1; | ||
1440 | return 0; | ||
1441 | } | ||
1442 | |||
1443 | static inline int ata_using_udma(struct ata_device *adev) | ||
1444 | { | ||
1445 | if (adev->dma_mode >= XFER_UDMA_0 && adev->dma_mode <= XFER_UDMA_7) | ||
1446 | return 1; | ||
1447 | return 0; | ||
1448 | } | ||
1449 | |||
1450 | static inline int ata_dma_enabled(struct ata_device *adev) | ||
1451 | { | ||
1452 | return (adev->dma_mode == 0xFF ? 0 : 1); | ||
1453 | } | ||
1430 | 1454 | ||
1431 | /************************************************************************** | 1455 | /************************************************************************** |
1432 | * PMP - drivers/ata/libata-pmp.c | 1456 | * PMP - drivers/ata/libata-pmp.c |
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index 3ba25065fa96..8837928fbf33 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h | |||
@@ -57,6 +57,15 @@ static inline acpi_status pcie_osc_support_set(u32 flags) | |||
57 | { | 57 | { |
58 | return __pci_osc_support_set(flags, PCI_EXPRESS_ROOT_HID_STRING); | 58 | return __pci_osc_support_set(flags, PCI_EXPRESS_ROOT_HID_STRING); |
59 | } | 59 | } |
60 | static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) | ||
61 | { | ||
62 | /* Find root host bridge */ | ||
63 | while (pdev->bus->self) | ||
64 | pdev = pdev->bus->self; | ||
65 | |||
66 | return acpi_get_pci_rootbridge_handle(pci_domain_nr(pdev->bus), | ||
67 | pdev->bus->number); | ||
68 | } | ||
60 | #else | 69 | #else |
61 | #if !defined(AE_ERROR) | 70 | #if !defined(AE_ERROR) |
62 | typedef u32 acpi_status; | 71 | typedef u32 acpi_status; |
@@ -66,6 +75,8 @@ static inline acpi_status pci_osc_control_set(acpi_handle handle, u32 flags) | |||
66 | {return AE_ERROR;} | 75 | {return AE_ERROR;} |
67 | static inline acpi_status pci_osc_support_set(u32 flags) {return AE_ERROR;} | 76 | static inline acpi_status pci_osc_support_set(u32 flags) {return AE_ERROR;} |
68 | static inline acpi_status pcie_osc_support_set(u32 flags) {return AE_ERROR;} | 77 | static inline acpi_status pcie_osc_support_set(u32 flags) {return AE_ERROR;} |
78 | static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) | ||
79 | { return NULL; } | ||
69 | #endif | 80 | #endif |
70 | 81 | ||
71 | #endif /* _PCI_ACPI_H_ */ | 82 | #endif /* _PCI_ACPI_H_ */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 9ec2bcce8e83..f1624b396754 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -2428,6 +2428,9 @@ | |||
2428 | #define PCI_DEVICE_ID_INTEL_ICH10_3 0x3a1a | 2428 | #define PCI_DEVICE_ID_INTEL_ICH10_3 0x3a1a |
2429 | #define PCI_DEVICE_ID_INTEL_ICH10_4 0x3a30 | 2429 | #define PCI_DEVICE_ID_INTEL_ICH10_4 0x3a30 |
2430 | #define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60 | 2430 | #define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60 |
2431 | #define PCI_DEVICE_ID_INTEL_PCH_0 0x3b10 | ||
2432 | #define PCI_DEVICE_ID_INTEL_PCH_1 0x3b11 | ||
2433 | #define PCI_DEVICE_ID_INTEL_PCH_2 0x3b30 | ||
2431 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f | 2434 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f |
2432 | #define PCI_DEVICE_ID_INTEL_5100_16 0x65f0 | 2435 | #define PCI_DEVICE_ID_INTEL_5100_16 0x65f0 |
2433 | #define PCI_DEVICE_ID_INTEL_5100_21 0x65f5 | 2436 | #define PCI_DEVICE_ID_INTEL_5100_21 0x65f5 |
diff --git a/include/linux/pid.h b/include/linux/pid.h index 22921ac4cfd9..d7e98ff8021e 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h | |||
@@ -161,4 +161,13 @@ pid_t pid_vnr(struct pid *pid); | |||
161 | } \ | 161 | } \ |
162 | } while (0) | 162 | } while (0) |
163 | 163 | ||
164 | #define do_each_pid_thread(pid, type, task) \ | ||
165 | do_each_pid_task(pid, type, task) { \ | ||
166 | struct task_struct *tg___ = task; \ | ||
167 | do { | ||
168 | |||
169 | #define while_each_pid_thread(pid, type, task) \ | ||
170 | } while_each_thread(tg___, task); \ | ||
171 | task = tg___; \ | ||
172 | } while_each_pid_task(pid, type, task) | ||
164 | #endif /* _LINUX_PID_H */ | 173 | #endif /* _LINUX_PID_H */ |
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index 69407f85e10b..fed6f5e0b411 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -102,7 +102,7 @@ int try_to_unmap(struct page *, int ignore_refs); | |||
102 | * Called from mm/filemap_xip.c to unmap empty zero page | 102 | * Called from mm/filemap_xip.c to unmap empty zero page |
103 | */ | 103 | */ |
104 | pte_t *page_check_address(struct page *, struct mm_struct *, | 104 | pte_t *page_check_address(struct page *, struct mm_struct *, |
105 | unsigned long, spinlock_t **); | 105 | unsigned long, spinlock_t **, int); |
106 | 106 | ||
107 | /* | 107 | /* |
108 | * Used by swapoff to help locate where page is expected in vma. | 108 | * Used by swapoff to help locate where page is expected in vma. |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 358661c9990e..909923717830 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -1452,6 +1452,10 @@ extern int skb_copy_datagram_iovec(const struct sk_buff *from, | |||
1452 | extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, | 1452 | extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, |
1453 | int hlen, | 1453 | int hlen, |
1454 | struct iovec *iov); | 1454 | struct iovec *iov); |
1455 | extern int skb_copy_datagram_from_iovec(struct sk_buff *skb, | ||
1456 | int offset, | ||
1457 | struct iovec *from, | ||
1458 | int len); | ||
1455 | extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); | 1459 | extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); |
1456 | extern int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, | 1460 | extern int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, |
1457 | unsigned int flags); | 1461 | unsigned int flags); |
diff --git a/include/linux/tick.h b/include/linux/tick.h index d3c02695dc5d..8cf8cfe2cc97 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h | |||
@@ -74,10 +74,13 @@ extern struct tick_device *tick_get_device(int cpu); | |||
74 | extern int tick_init_highres(void); | 74 | extern int tick_init_highres(void); |
75 | extern int tick_program_event(ktime_t expires, int force); | 75 | extern int tick_program_event(ktime_t expires, int force); |
76 | extern void tick_setup_sched_timer(void); | 76 | extern void tick_setup_sched_timer(void); |
77 | # endif | ||
78 | |||
79 | # if defined CONFIG_NO_HZ || defined CONFIG_HIGH_RES_TIMERS | ||
77 | extern void tick_cancel_sched_timer(int cpu); | 80 | extern void tick_cancel_sched_timer(int cpu); |
78 | # else | 81 | # else |
79 | static inline void tick_cancel_sched_timer(int cpu) { } | 82 | static inline void tick_cancel_sched_timer(int cpu) { } |
80 | # endif /* HIGHRES */ | 83 | # endif |
81 | 84 | ||
82 | # ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST | 85 | # ifdef CONFIG_GENERIC_CLOCKEVENTS_BROADCAST |
83 | extern struct tick_device *tick_get_broadcast_device(void); | 86 | extern struct tick_device *tick_get_broadcast_device(void); |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 0924cd9c30f6..94ac74aba6b6 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -110,6 +110,8 @@ enum usb_interface_condition { | |||
110 | * @sysfs_files_created: sysfs attributes exist | 110 | * @sysfs_files_created: sysfs attributes exist |
111 | * @needs_remote_wakeup: flag set when the driver requires remote-wakeup | 111 | * @needs_remote_wakeup: flag set when the driver requires remote-wakeup |
112 | * capability during autosuspend. | 112 | * capability during autosuspend. |
113 | * @needs_altsetting0: flag set when a set-interface request for altsetting 0 | ||
114 | * has been deferred. | ||
113 | * @needs_binding: flag set when the driver should be re-probed or unbound | 115 | * @needs_binding: flag set when the driver should be re-probed or unbound |
114 | * following a reset or suspend operation it doesn't support. | 116 | * following a reset or suspend operation it doesn't support. |
115 | * @dev: driver model's view of this device | 117 | * @dev: driver model's view of this device |
@@ -162,6 +164,7 @@ struct usb_interface { | |||
162 | unsigned is_active:1; /* the interface is not suspended */ | 164 | unsigned is_active:1; /* the interface is not suspended */ |
163 | unsigned sysfs_files_created:1; /* the sysfs attributes exist */ | 165 | unsigned sysfs_files_created:1; /* the sysfs attributes exist */ |
164 | unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */ | 166 | unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */ |
167 | unsigned needs_altsetting0:1; /* switch to altsetting 0 is pending */ | ||
165 | unsigned needs_binding:1; /* needs delayed unbind/rebind */ | 168 | unsigned needs_binding:1; /* needs delayed unbind/rebind */ |
166 | 169 | ||
167 | struct device dev; /* interface specific device info */ | 170 | struct device dev; /* interface specific device info */ |