diff options
Diffstat (limited to 'include/linux')
63 files changed, 617 insertions, 307 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 327f60658d94..b68ec09399be 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -167,7 +167,8 @@ unifdef-y += acct.h | |||
167 | unifdef-y += adb.h | 167 | unifdef-y += adb.h |
168 | unifdef-y += adfs_fs.h | 168 | unifdef-y += adfs_fs.h |
169 | unifdef-y += agpgart.h | 169 | unifdef-y += agpgart.h |
170 | ifneq ($(wildcard $(srctree)/include/asm-$(SRCARCH)/a.out.h),) | 170 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/a.out.h \ |
171 | $(srctree)/include/asm-$(SRCARCH)/a.out.h),) | ||
171 | unifdef-y += a.out.h | 172 | unifdef-y += a.out.h |
172 | endif | 173 | endif |
173 | unifdef-y += apm_bios.h | 174 | unifdef-y += apm_bios.h |
@@ -250,13 +251,16 @@ unifdef-y += isdn.h | |||
250 | unifdef-y += isdnif.h | 251 | unifdef-y += isdnif.h |
251 | unifdef-y += isdn_divertif.h | 252 | unifdef-y += isdn_divertif.h |
252 | unifdef-y += isdn_ppp.h | 253 | unifdef-y += isdn_ppp.h |
254 | unifdef-y += ivtv.h | ||
255 | unifdef-y += ivtvfb.h | ||
253 | unifdef-y += joystick.h | 256 | unifdef-y += joystick.h |
254 | unifdef-y += kdev_t.h | 257 | unifdef-y += kdev_t.h |
255 | unifdef-y += kd.h | 258 | unifdef-y += kd.h |
256 | unifdef-y += kernelcapi.h | 259 | unifdef-y += kernelcapi.h |
257 | unifdef-y += kernel.h | 260 | unifdef-y += kernel.h |
258 | unifdef-y += keyboard.h | 261 | unifdef-y += keyboard.h |
259 | ifneq ($(wildcard $(srctree)/include/asm-$(SRCARCH)/kvm.h),) | 262 | ifneq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/asm/kvm.h \ |
263 | $(srctree)/include/asm-$(SRCARCH)/kvm.h),) | ||
260 | unifdef-y += kvm.h | 264 | unifdef-y += kvm.h |
261 | endif | 265 | endif |
262 | unifdef-y += llc.h | 266 | unifdef-y += llc.h |
@@ -295,7 +299,6 @@ unifdef-y += parport.h | |||
295 | unifdef-y += patchkey.h | 299 | unifdef-y += patchkey.h |
296 | unifdef-y += pci.h | 300 | unifdef-y += pci.h |
297 | unifdef-y += personality.h | 301 | unifdef-y += personality.h |
298 | unifdef-y += pim.h | ||
299 | unifdef-y += pktcdvd.h | 302 | unifdef-y += pktcdvd.h |
300 | unifdef-y += pmu.h | 303 | unifdef-y += pmu.h |
301 | unifdef-y += poll.h | 304 | unifdef-y += poll.h |
diff --git a/include/linux/ata.h b/include/linux/ata.h index 1c622e2b0504..a26ebd25bac1 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,16 @@ 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)) |
666 | return 1; | ||
667 | return 0; | ||
668 | } | ||
669 | |||
670 | static inline int ata_id_has_unload(const u16 *id) | ||
671 | { | ||
672 | if (ata_id_major_version(id) >= 7 && | ||
673 | (id[ATA_ID_CFSSE] & 0xC000) == 0x4000 && | ||
674 | id[ATA_ID_CFSSE] & (1 << 13)) | ||
603 | return 1; | 675 | return 1; |
604 | return 0; | 676 | return 0; |
605 | } | 677 | } |
@@ -608,22 +680,22 @@ static inline int ata_id_current_chs_valid(const u16 *id) | |||
608 | { | 680 | { |
609 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command | 681 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command |
610 | has not been issued to the device then the values of | 682 | has not been issued to the device then the values of |
611 | id[54] to id[56] are vendor specific. */ | 683 | id[ATA_ID_CUR_CYLS] to id[ATA_ID_CUR_SECTORS] are vendor specific. */ |
612 | return (id[53] & 0x01) && /* Current translation valid */ | 684 | return (id[ATA_ID_FIELD_VALID] & 1) && /* Current translation valid */ |
613 | id[54] && /* cylinders in current translation */ | 685 | id[ATA_ID_CUR_CYLS] && /* cylinders in current translation */ |
614 | id[55] && /* heads in current translation */ | 686 | id[ATA_ID_CUR_HEADS] && /* heads in current translation */ |
615 | id[55] <= 16 && | 687 | id[ATA_ID_CUR_HEADS] <= 16 && |
616 | id[56]; /* sectors in current translation */ | 688 | id[ATA_ID_CUR_SECTORS]; /* sectors in current translation */ |
617 | } | 689 | } |
618 | 690 | ||
619 | static inline int ata_id_is_cfa(const u16 *id) | 691 | static inline int ata_id_is_cfa(const u16 *id) |
620 | { | 692 | { |
621 | u16 v = id[0]; | 693 | if (id[ATA_ID_CONFIG] == 0x848A) /* Standard CF */ |
622 | if (v == 0x848A) /* Standard CF */ | ||
623 | return 1; | 694 | return 1; |
624 | /* Could be CF hiding as standard ATA */ | 695 | /* Could be CF hiding as standard ATA */ |
625 | if (ata_id_major_version(id) >= 3 && id[82] != 0xFFFF && | 696 | if (ata_id_major_version(id) >= 3 && |
626 | (id[82] & ( 1 << 2))) | 697 | id[ATA_ID_COMMAND_SET_1] != 0xFFFF && |
698 | (id[ATA_ID_COMMAND_SET_1] & (1 << 2))) | ||
627 | return 1; | 699 | return 1; |
628 | return 0; | 700 | return 0; |
629 | } | 701 | } |
@@ -632,21 +704,21 @@ static inline int ata_drive_40wire(const u16 *dev_id) | |||
632 | { | 704 | { |
633 | if (ata_id_is_sata(dev_id)) | 705 | if (ata_id_is_sata(dev_id)) |
634 | return 0; /* SATA */ | 706 | return 0; /* SATA */ |
635 | if ((dev_id[93] & 0xE000) == 0x6000) | 707 | if ((dev_id[ATA_ID_HW_CONFIG] & 0xE000) == 0x6000) |
636 | return 0; /* 80 wire */ | 708 | return 0; /* 80 wire */ |
637 | return 1; | 709 | return 1; |
638 | } | 710 | } |
639 | 711 | ||
640 | static inline int ata_drive_40wire_relaxed(const u16 *dev_id) | 712 | static inline int ata_drive_40wire_relaxed(const u16 *dev_id) |
641 | { | 713 | { |
642 | if ((dev_id[93] & 0x2000) == 0x2000) | 714 | if ((dev_id[ATA_ID_HW_CONFIG] & 0x2000) == 0x2000) |
643 | return 0; /* 80 wire */ | 715 | return 0; /* 80 wire */ |
644 | return 1; | 716 | return 1; |
645 | } | 717 | } |
646 | 718 | ||
647 | static inline int atapi_cdb_len(const u16 *dev_id) | 719 | static inline int atapi_cdb_len(const u16 *dev_id) |
648 | { | 720 | { |
649 | u16 tmp = dev_id[0] & 0x3; | 721 | u16 tmp = dev_id[ATA_ID_CONFIG] & 0x3; |
650 | switch (tmp) { | 722 | switch (tmp) { |
651 | case 0: return 12; | 723 | case 0: return 12; |
652 | case 1: return 16; | 724 | case 1: return 16; |
@@ -656,7 +728,7 @@ static inline int atapi_cdb_len(const u16 *dev_id) | |||
656 | 728 | ||
657 | static inline int atapi_command_packet_set(const u16 *dev_id) | 729 | static inline int atapi_command_packet_set(const u16 *dev_id) |
658 | { | 730 | { |
659 | return (dev_id[0] >> 8) & 0x1f; | 731 | return (dev_id[ATA_ID_CONFIG] >> 8) & 0x1f; |
660 | } | 732 | } |
661 | 733 | ||
662 | static inline int atapi_id_dmadir(const u16 *dev_id) | 734 | static inline int atapi_id_dmadir(const u16 *dev_id) |
@@ -682,7 +754,7 @@ static inline int ata_ok(u8 status) | |||
682 | static inline int lba_28_ok(u64 block, u32 n_block) | 754 | static inline int lba_28_ok(u64 block, u32 n_block) |
683 | { | 755 | { |
684 | /* check the ending block number */ | 756 | /* check the ending block number */ |
685 | return ((block + n_block - 1) < ((u64)1 << 28)) && (n_block <= 256); | 757 | return ((block + n_block) < ((u64)1 << 28)) && (n_block <= 256); |
686 | } | 758 | } |
687 | 759 | ||
688 | static inline int lba_48_ok(u64 block, u32 n_block) | 760 | static inline int lba_48_ok(u64 block, u32 n_block) |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index e61f22be4d0e..53ea933cf60b 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -280,6 +280,15 @@ struct blk_queue_tag { | |||
280 | atomic_t refcnt; /* map can be shared */ | 280 | atomic_t refcnt; /* map can be shared */ |
281 | }; | 281 | }; |
282 | 282 | ||
283 | #define BLK_SCSI_MAX_CMDS (256) | ||
284 | #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) | ||
285 | |||
286 | struct blk_cmd_filter { | ||
287 | unsigned long read_ok[BLK_SCSI_CMD_PER_LONG]; | ||
288 | unsigned long write_ok[BLK_SCSI_CMD_PER_LONG]; | ||
289 | struct kobject kobj; | ||
290 | }; | ||
291 | |||
283 | struct request_queue | 292 | struct request_queue |
284 | { | 293 | { |
285 | /* | 294 | /* |
@@ -398,6 +407,7 @@ struct request_queue | |||
398 | #if defined(CONFIG_BLK_DEV_BSG) | 407 | #if defined(CONFIG_BLK_DEV_BSG) |
399 | struct bsg_class_device bsg_dev; | 408 | struct bsg_class_device bsg_dev; |
400 | #endif | 409 | #endif |
410 | struct blk_cmd_filter cmd_filter; | ||
401 | }; | 411 | }; |
402 | 412 | ||
403 | #define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ | 413 | #define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ |
@@ -807,8 +817,6 @@ extern void blk_put_queue(struct request_queue *); | |||
807 | /* | 817 | /* |
808 | * tag stuff | 818 | * tag stuff |
809 | */ | 819 | */ |
810 | #define blk_queue_tag_depth(q) ((q)->queue_tags->busy) | ||
811 | #define blk_queue_tag_queue(q) ((q)->queue_tags->busy < (q)->queue_tags->max_depth) | ||
812 | #define blk_rq_tagged(rq) ((rq)->cmd_flags & REQ_QUEUED) | 820 | #define blk_rq_tagged(rq) ((rq)->cmd_flags & REQ_QUEUED) |
813 | extern int blk_queue_start_tag(struct request_queue *, struct request *); | 821 | extern int blk_queue_start_tag(struct request_queue *, struct request *); |
814 | extern struct request *blk_queue_find_tag(struct request_queue *, int); | 822 | extern struct request *blk_queue_find_tag(struct request_queue *, int); |
@@ -833,11 +841,9 @@ extern int blkdev_issue_flush(struct block_device *, sector_t *); | |||
833 | /* | 841 | /* |
834 | * command filter functions | 842 | * command filter functions |
835 | */ | 843 | */ |
836 | extern int blk_verify_command(struct file *file, unsigned char *cmd); | 844 | extern int blk_verify_command(struct blk_cmd_filter *filter, |
837 | extern int blk_cmd_filter_verify_command(struct blk_scsi_cmd_filter *filter, | 845 | unsigned char *cmd, int has_write_perm); |
838 | unsigned char *cmd, mode_t *f_mode); | 846 | extern void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter); |
839 | extern int blk_register_filter(struct gendisk *disk); | ||
840 | extern void blk_unregister_filter(struct gendisk *disk); | ||
841 | 847 | ||
842 | #define MAX_PHYS_SEGMENTS 128 | 848 | #define MAX_PHYS_SEGMENTS 128 |
843 | #define MAX_HW_SEGMENTS 128 | 849 | #define MAX_HW_SEGMENTS 128 |
diff --git a/include/linux/capability.h b/include/linux/capability.h index 02673846d205..9d1fe30b6f6c 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
@@ -503,8 +503,19 @@ extern const kernel_cap_t __cap_init_eff_set; | |||
503 | 503 | ||
504 | kernel_cap_t cap_set_effective(const kernel_cap_t pE_new); | 504 | kernel_cap_t cap_set_effective(const kernel_cap_t pE_new); |
505 | 505 | ||
506 | int capable(int cap); | 506 | /** |
507 | int __capable(struct task_struct *t, int cap); | 507 | * has_capability - Determine if a task has a superior capability available |
508 | * @t: The task in question | ||
509 | * @cap: The capability to be tested for | ||
510 | * | ||
511 | * Return true if the specified task has the given superior capability | ||
512 | * currently in effect, false if not. | ||
513 | * | ||
514 | * Note that this does not set PF_SUPERPRIV on the task. | ||
515 | */ | ||
516 | #define has_capability(t, cap) (security_capable((t), (cap)) == 0) | ||
517 | |||
518 | extern int capable(int cap); | ||
508 | 519 | ||
509 | #endif /* __KERNEL__ */ | 520 | #endif /* __KERNEL__ */ |
510 | 521 | ||
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index c33b0dc28e4d..ed3a5d473e52 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h | |||
@@ -127,6 +127,8 @@ extern int clockevents_register_notifier(struct notifier_block *nb); | |||
127 | extern int clockevents_program_event(struct clock_event_device *dev, | 127 | extern int clockevents_program_event(struct clock_event_device *dev, |
128 | ktime_t expires, ktime_t now); | 128 | ktime_t expires, ktime_t now); |
129 | 129 | ||
130 | extern void clockevents_handle_noop(struct clock_event_device *dev); | ||
131 | |||
130 | #ifdef CONFIG_GENERIC_CLOCKEVENTS | 132 | #ifdef CONFIG_GENERIC_CLOCKEVENTS |
131 | extern void clockevents_notify(unsigned long reason, void *arg); | 133 | extern void clockevents_notify(unsigned long reason, void *arg); |
132 | #else | 134 | #else |
diff --git a/include/linux/cnt32_to_63.h b/include/linux/cnt32_to_63.h new file mode 100644 index 000000000000..8c0f9505b48c --- /dev/null +++ b/include/linux/cnt32_to_63.h | |||
@@ -0,0 +1,80 @@ | |||
1 | /* | ||
2 | * Extend a 32-bit counter to 63 bits | ||
3 | * | ||
4 | * Author: Nicolas Pitre | ||
5 | * Created: December 3, 2006 | ||
6 | * Copyright: MontaVista Software, Inc. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 | ||
10 | * as published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef __LINUX_CNT32_TO_63_H__ | ||
14 | #define __LINUX_CNT32_TO_63_H__ | ||
15 | |||
16 | #include <linux/compiler.h> | ||
17 | #include <linux/types.h> | ||
18 | #include <asm/byteorder.h> | ||
19 | |||
20 | /* this is used only to give gcc a clue about good code generation */ | ||
21 | union cnt32_to_63 { | ||
22 | struct { | ||
23 | #if defined(__LITTLE_ENDIAN) | ||
24 | u32 lo, hi; | ||
25 | #elif defined(__BIG_ENDIAN) | ||
26 | u32 hi, lo; | ||
27 | #endif | ||
28 | }; | ||
29 | u64 val; | ||
30 | }; | ||
31 | |||
32 | |||
33 | /** | ||
34 | * cnt32_to_63 - Expand a 32-bit counter to a 63-bit counter | ||
35 | * @cnt_lo: The low part of the counter | ||
36 | * | ||
37 | * Many hardware clock counters are only 32 bits wide and therefore have | ||
38 | * a relatively short period making wrap-arounds rather frequent. This | ||
39 | * is a problem when implementing sched_clock() for example, where a 64-bit | ||
40 | * non-wrapping monotonic value is expected to be returned. | ||
41 | * | ||
42 | * To overcome that limitation, let's extend a 32-bit counter to 63 bits | ||
43 | * in a completely lock free fashion. Bits 0 to 31 of the clock are provided | ||
44 | * by the hardware while bits 32 to 62 are stored in memory. The top bit in | ||
45 | * memory is used to synchronize with the hardware clock half-period. When | ||
46 | * the top bit of both counters (hardware and in memory) differ then the | ||
47 | * memory is updated with a new value, incrementing it when the hardware | ||
48 | * counter wraps around. | ||
49 | * | ||
50 | * Because a word store in memory is atomic then the incremented value will | ||
51 | * always be in synch with the top bit indicating to any potential concurrent | ||
52 | * reader if the value in memory is up to date or not with regards to the | ||
53 | * needed increment. And any race in updating the value in memory is harmless | ||
54 | * as the same value would simply be stored more than once. | ||
55 | * | ||
56 | * The only restriction for the algorithm to work properly is that this | ||
57 | * code must be executed at least once per each half period of the 32-bit | ||
58 | * counter to properly update the state bit in memory. This is usually not a | ||
59 | * problem in practice, but if it is then a kernel timer could be scheduled | ||
60 | * to manage for this code to be executed often enough. | ||
61 | * | ||
62 | * Note that the top bit (bit 63) in the returned value should be considered | ||
63 | * as garbage. It is not cleared here because callers are likely to use a | ||
64 | * multiplier on the returned value which can get rid of the top bit | ||
65 | * implicitly by making the multiplier even, therefore saving on a runtime | ||
66 | * clear-bit instruction. Otherwise caller must remember to clear the top | ||
67 | * bit explicitly. | ||
68 | */ | ||
69 | #define cnt32_to_63(cnt_lo) \ | ||
70 | ({ \ | ||
71 | static volatile u32 __m_cnt_hi; \ | ||
72 | union cnt32_to_63 __x; \ | ||
73 | __x.hi = __m_cnt_hi; \ | ||
74 | __x.lo = (cnt_lo); \ | ||
75 | if (unlikely((s32)(__x.hi ^ __x.lo) < 0)) \ | ||
76 | __m_cnt_hi = __x.hi = (__x.hi ^ 0x80000000) + (__x.hi >> 31); \ | ||
77 | __x.val; \ | ||
78 | }) | ||
79 | |||
80 | #endif | ||
diff --git a/include/linux/completion.h b/include/linux/completion.h index 57faa60de9bd..02ef8835999c 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h | |||
@@ -49,6 +49,8 @@ extern unsigned long wait_for_completion_timeout(struct completion *x, | |||
49 | unsigned long timeout); | 49 | unsigned long timeout); |
50 | extern unsigned long wait_for_completion_interruptible_timeout( | 50 | extern unsigned long wait_for_completion_interruptible_timeout( |
51 | struct completion *x, unsigned long timeout); | 51 | struct completion *x, unsigned long timeout); |
52 | extern bool try_wait_for_completion(struct completion *x); | ||
53 | extern bool completion_done(struct completion *x); | ||
52 | 54 | ||
53 | extern void complete(struct completion *); | 55 | extern void complete(struct completion *); |
54 | extern void complete_all(struct completion *); | 56 | extern void complete_all(struct completion *); |
@@ -56,48 +58,4 @@ extern void complete_all(struct completion *); | |||
56 | #define INIT_COMPLETION(x) ((x).done = 0) | 58 | #define INIT_COMPLETION(x) ((x).done = 0) |
57 | 59 | ||
58 | 60 | ||
59 | /** | ||
60 | * try_wait_for_completion - try to decrement a completion without blocking | ||
61 | * @x: completion structure | ||
62 | * | ||
63 | * Returns: 0 if a decrement cannot be done without blocking | ||
64 | * 1 if a decrement succeeded. | ||
65 | * | ||
66 | * If a completion is being used as a counting completion, | ||
67 | * attempt to decrement the counter without blocking. This | ||
68 | * enables us to avoid waiting if the resource the completion | ||
69 | * is protecting is not available. | ||
70 | */ | ||
71 | static inline bool try_wait_for_completion(struct completion *x) | ||
72 | { | ||
73 | int ret = 1; | ||
74 | |||
75 | spin_lock_irq(&x->wait.lock); | ||
76 | if (!x->done) | ||
77 | ret = 0; | ||
78 | else | ||
79 | x->done--; | ||
80 | spin_unlock_irq(&x->wait.lock); | ||
81 | return ret; | ||
82 | } | ||
83 | |||
84 | /** | ||
85 | * completion_done - Test to see if a completion has any waiters | ||
86 | * @x: completion structure | ||
87 | * | ||
88 | * Returns: 0 if there are waiters (wait_for_completion() in progress) | ||
89 | * 1 if there are no waiters. | ||
90 | * | ||
91 | */ | ||
92 | static inline bool completion_done(struct completion *x) | ||
93 | { | ||
94 | int ret = 1; | ||
95 | |||
96 | spin_lock_irq(&x->wait.lock); | ||
97 | if (!x->done) | ||
98 | ret = 0; | ||
99 | spin_unlock_irq(&x->wait.lock); | ||
100 | return ret; | ||
101 | } | ||
102 | |||
103 | #endif | 61 | #endif |
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index e8f450c499b0..2691926fb506 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
@@ -160,7 +160,7 @@ static inline int current_cpuset_is_being_rebound(void) | |||
160 | 160 | ||
161 | static inline void rebuild_sched_domains(void) | 161 | static inline void rebuild_sched_domains(void) |
162 | { | 162 | { |
163 | partition_sched_domains(0, NULL, NULL); | 163 | partition_sched_domains(1, NULL, NULL); |
164 | } | 164 | } |
165 | 165 | ||
166 | #endif /* !CONFIG_CPUSETS */ | 166 | #endif /* !CONFIG_CPUSETS */ |
diff --git a/include/linux/dcache.h b/include/linux/dcache.h index 07aa198f19ed..efba1de629ac 100644 --- a/include/linux/dcache.h +++ b/include/linux/dcache.h | |||
@@ -230,7 +230,7 @@ extern void d_delete(struct dentry *); | |||
230 | extern struct dentry * d_alloc(struct dentry *, const struct qstr *); | 230 | extern struct dentry * d_alloc(struct dentry *, const struct qstr *); |
231 | extern struct dentry * d_alloc_anon(struct inode *); | 231 | extern struct dentry * d_alloc_anon(struct inode *); |
232 | extern struct dentry * d_splice_alias(struct inode *, struct dentry *); | 232 | extern struct dentry * d_splice_alias(struct inode *, struct dentry *); |
233 | extern struct dentry * d_add_ci(struct inode *, struct dentry *, struct qstr *); | 233 | extern struct dentry * d_add_ci(struct dentry *, struct inode *, struct qstr *); |
234 | extern void shrink_dcache_sb(struct super_block *); | 234 | extern void shrink_dcache_sb(struct super_block *); |
235 | extern void shrink_dcache_parent(struct dentry *); | 235 | extern void shrink_dcache_parent(struct dentry *); |
236 | extern void shrink_dcache_for_umount(struct super_block *); | 236 | extern void shrink_dcache_for_umount(struct super_block *); |
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/dma-mapping.h b/include/linux/dma-mapping.h index 952e0f857ac9..ba9114ec5d3a 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -48,6 +48,11 @@ static inline int is_device_dma_capable(struct device *dev) | |||
48 | return dev->dma_mask != NULL && *dev->dma_mask != DMA_MASK_NONE; | 48 | return dev->dma_mask != NULL && *dev->dma_mask != DMA_MASK_NONE; |
49 | } | 49 | } |
50 | 50 | ||
51 | static inline int is_buffer_dma_capable(u64 mask, dma_addr_t addr, size_t size) | ||
52 | { | ||
53 | return addr + size <= mask; | ||
54 | } | ||
55 | |||
51 | #ifdef CONFIG_HAS_DMA | 56 | #ifdef CONFIG_HAS_DMA |
52 | #include <asm/dma-mapping.h> | 57 | #include <asm/dma-mapping.h> |
53 | #else | 58 | #else |
@@ -58,6 +63,13 @@ static inline int is_device_dma_capable(struct device *dev) | |||
58 | #define dma_sync_single dma_sync_single_for_cpu | 63 | #define dma_sync_single dma_sync_single_for_cpu |
59 | #define dma_sync_sg dma_sync_sg_for_cpu | 64 | #define dma_sync_sg dma_sync_sg_for_cpu |
60 | 65 | ||
66 | static inline u64 dma_get_mask(struct device *dev) | ||
67 | { | ||
68 | if (dev && dev->dma_mask && *dev->dma_mask) | ||
69 | return *dev->dma_mask; | ||
70 | return DMA_32BIT_MASK; | ||
71 | } | ||
72 | |||
61 | extern u64 dma_get_required_mask(struct device *dev); | 73 | extern u64 dma_get_required_mask(struct device *dev); |
62 | 74 | ||
63 | static inline unsigned int dma_get_max_seg_size(struct device *dev) | 75 | static inline unsigned int dma_get_max_seg_size(struct device *dev) |
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/ftrace.h b/include/linux/ftrace.h index f368d041e02d..bb384068272e 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -98,6 +98,27 @@ static inline void tracer_disable(void) | |||
98 | #endif | 98 | #endif |
99 | } | 99 | } |
100 | 100 | ||
101 | /* Ftrace disable/restore without lock. Some synchronization mechanism | ||
102 | * must be used to prevent ftrace_enabled to be changed between | ||
103 | * disable/restore. */ | ||
104 | static inline int __ftrace_enabled_save(void) | ||
105 | { | ||
106 | #ifdef CONFIG_FTRACE | ||
107 | int saved_ftrace_enabled = ftrace_enabled; | ||
108 | ftrace_enabled = 0; | ||
109 | return saved_ftrace_enabled; | ||
110 | #else | ||
111 | return 0; | ||
112 | #endif | ||
113 | } | ||
114 | |||
115 | static inline void __ftrace_enabled_restore(int enabled) | ||
116 | { | ||
117 | #ifdef CONFIG_FTRACE | ||
118 | ftrace_enabled = enabled; | ||
119 | #endif | ||
120 | } | ||
121 | |||
101 | #ifdef CONFIG_FRAME_POINTER | 122 | #ifdef CONFIG_FRAME_POINTER |
102 | /* TODO: need to fix this for ARM */ | 123 | /* TODO: need to fix this for ARM */ |
103 | # define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0)) | 124 | # define CALLER_ADDR0 ((unsigned long)__builtin_return_address(0)) |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 118216f1bd3c..be4f5e5bfe06 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -110,15 +110,6 @@ struct hd_struct { | |||
110 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 | 110 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 |
111 | #define GENHD_FL_FAIL 64 | 111 | #define GENHD_FL_FAIL 64 |
112 | 112 | ||
113 | #define BLK_SCSI_MAX_CMDS (256) | ||
114 | #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) | ||
115 | |||
116 | struct blk_scsi_cmd_filter { | ||
117 | unsigned long read_ok[BLK_SCSI_CMD_PER_LONG]; | ||
118 | unsigned long write_ok[BLK_SCSI_CMD_PER_LONG]; | ||
119 | struct kobject kobj; | ||
120 | }; | ||
121 | |||
122 | struct gendisk { | 113 | struct gendisk { |
123 | int major; /* major number of driver */ | 114 | int major; /* major number of driver */ |
124 | int first_minor; | 115 | int first_minor; |
@@ -128,7 +119,6 @@ struct gendisk { | |||
128 | struct hd_struct **part; /* [indexed by minor] */ | 119 | struct hd_struct **part; /* [indexed by minor] */ |
129 | struct block_device_operations *fops; | 120 | struct block_device_operations *fops; |
130 | struct request_queue *queue; | 121 | struct request_queue *queue; |
131 | struct blk_scsi_cmd_filter cmd_filter; | ||
132 | void *private_data; | 122 | void *private_data; |
133 | sector_t capacity; | 123 | sector_t capacity; |
134 | 124 | ||
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 6d93dce61cbb..2f245fe63bda 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -47,14 +47,22 @@ enum hrtimer_restart { | |||
47 | * HRTIMER_CB_IRQSAFE: Callback may run in hardirq context | 47 | * HRTIMER_CB_IRQSAFE: Callback may run in hardirq context |
48 | * HRTIMER_CB_IRQSAFE_NO_RESTART: Callback may run in hardirq context and | 48 | * HRTIMER_CB_IRQSAFE_NO_RESTART: Callback may run in hardirq context and |
49 | * does not restart the timer | 49 | * does not restart the timer |
50 | * HRTIMER_CB_IRQSAFE_NO_SOFTIRQ: Callback must run in hardirq context | 50 | * HRTIMER_CB_IRQSAFE_PERCPU: Callback must run in hardirq context |
51 | * Special mode for tick emultation | 51 | * Special mode for tick emulation and |
52 | * scheduler timer. Such timers are per | ||
53 | * cpu and not allowed to be migrated on | ||
54 | * cpu unplug. | ||
55 | * HRTIMER_CB_IRQSAFE_UNLOCKED: Callback should run in hardirq context | ||
56 | * with timer->base lock unlocked | ||
57 | * used for timers which call wakeup to | ||
58 | * avoid lock order problems with rq->lock | ||
52 | */ | 59 | */ |
53 | enum hrtimer_cb_mode { | 60 | enum hrtimer_cb_mode { |
54 | HRTIMER_CB_SOFTIRQ, | 61 | HRTIMER_CB_SOFTIRQ, |
55 | HRTIMER_CB_IRQSAFE, | 62 | HRTIMER_CB_IRQSAFE, |
56 | HRTIMER_CB_IRQSAFE_NO_RESTART, | 63 | HRTIMER_CB_IRQSAFE_NO_RESTART, |
57 | HRTIMER_CB_IRQSAFE_NO_SOFTIRQ, | 64 | HRTIMER_CB_IRQSAFE_PERCPU, |
65 | HRTIMER_CB_IRQSAFE_UNLOCKED, | ||
58 | }; | 66 | }; |
59 | 67 | ||
60 | /* | 68 | /* |
@@ -67,9 +75,10 @@ enum hrtimer_cb_mode { | |||
67 | * 0x02 callback function running | 75 | * 0x02 callback function running |
68 | * 0x04 callback pending (high resolution mode) | 76 | * 0x04 callback pending (high resolution mode) |
69 | * | 77 | * |
70 | * Special case: | 78 | * Special cases: |
71 | * 0x03 callback function running and enqueued | 79 | * 0x03 callback function running and enqueued |
72 | * (was requeued on another CPU) | 80 | * (was requeued on another CPU) |
81 | * 0x09 timer was migrated on CPU hotunplug | ||
73 | * The "callback function running and enqueued" status is only possible on | 82 | * The "callback function running and enqueued" status is only possible on |
74 | * SMP. It happens for example when a posix timer expired and the callback | 83 | * SMP. It happens for example when a posix timer expired and the callback |
75 | * queued a signal. Between dropping the lock which protects the posix timer | 84 | * queued a signal. Between dropping the lock which protects the posix timer |
@@ -87,6 +96,7 @@ enum hrtimer_cb_mode { | |||
87 | #define HRTIMER_STATE_ENQUEUED 0x01 | 96 | #define HRTIMER_STATE_ENQUEUED 0x01 |
88 | #define HRTIMER_STATE_CALLBACK 0x02 | 97 | #define HRTIMER_STATE_CALLBACK 0x02 |
89 | #define HRTIMER_STATE_PENDING 0x04 | 98 | #define HRTIMER_STATE_PENDING 0x04 |
99 | #define HRTIMER_STATE_MIGRATE 0x08 | ||
90 | 100 | ||
91 | /** | 101 | /** |
92 | * struct hrtimer - the basic hrtimer structure | 102 | * struct hrtimer - the basic hrtimer structure |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 08be0d21864c..06115128047f 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -97,7 +97,19 @@ extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, | |||
97 | 97 | ||
98 | /** | 98 | /** |
99 | * struct i2c_driver - represent an I2C device driver | 99 | * struct i2c_driver - represent an I2C device driver |
100 | * @id: Unique driver ID (optional) | ||
100 | * @class: What kind of i2c device we instantiate (for detect) | 101 | * @class: What kind of i2c device we instantiate (for detect) |
102 | * @attach_adapter: Callback for bus addition (for legacy drivers) | ||
103 | * @detach_adapter: Callback for bus removal (for legacy drivers) | ||
104 | * @detach_client: Callback for device removal (for legacy drivers) | ||
105 | * @probe: Callback for device binding (new-style drivers) | ||
106 | * @remove: Callback for device unbinding (new-style drivers) | ||
107 | * @shutdown: Callback for device shutdown | ||
108 | * @suspend: Callback for device suspend | ||
109 | * @resume: Callback for device resume | ||
110 | * @command: Callback for bus-wide signaling (optional) | ||
111 | * @driver: Device driver model driver | ||
112 | * @id_table: List of I2C devices supported by this driver | ||
101 | * @detect: Callback for device detection | 113 | * @detect: Callback for device detection |
102 | * @address_data: The I2C addresses to probe, ignore or force (for detect) | 114 | * @address_data: The I2C addresses to probe, ignore or force (for detect) |
103 | * @clients: List of detected clients we created (for i2c-core use only) | 115 | * @clients: List of detected clients we created (for i2c-core use only) |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 87c12ed96954..6514db8fd2e4 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -366,7 +366,9 @@ enum { | |||
366 | /* Currently on a filemark */ | 366 | /* Currently on a filemark */ |
367 | IDE_AFLAG_FILEMARK = (1 << 25), | 367 | IDE_AFLAG_FILEMARK = (1 << 25), |
368 | /* 0 = no tape is loaded, so we don't rewind after ejecting */ | 368 | /* 0 = no tape is loaded, so we don't rewind after ejecting */ |
369 | IDE_AFLAG_MEDIUM_PRESENT = (1 << 26) | 369 | IDE_AFLAG_MEDIUM_PRESENT = (1 << 26), |
370 | |||
371 | IDE_AFLAG_NO_AUTOCLOSE = (1 << 27), | ||
370 | }; | 372 | }; |
371 | 373 | ||
372 | struct ide_drive_s { | 374 | struct ide_drive_s { |
@@ -1111,7 +1113,6 @@ void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); | |||
1111 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI | 1113 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI |
1112 | int ide_pci_set_master(struct pci_dev *, const char *); | 1114 | int ide_pci_set_master(struct pci_dev *, const char *); |
1113 | unsigned long ide_pci_dma_base(ide_hwif_t *, const struct ide_port_info *); | 1115 | unsigned long ide_pci_dma_base(ide_hwif_t *, const struct ide_port_info *); |
1114 | extern const struct ide_dma_ops sff_dma_ops; | ||
1115 | int ide_pci_check_simplex(ide_hwif_t *, const struct ide_port_info *); | 1116 | int ide_pci_check_simplex(ide_hwif_t *, const struct ide_port_info *); |
1116 | int ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *); | 1117 | int ide_hwif_setup_dma(ide_hwif_t *, const struct ide_port_info *); |
1117 | #else | 1118 | #else |
@@ -1275,6 +1276,7 @@ extern int __ide_dma_end(ide_drive_t *); | |||
1275 | int ide_dma_test_irq(ide_drive_t *); | 1276 | int ide_dma_test_irq(ide_drive_t *); |
1276 | extern void ide_dma_lost_irq(ide_drive_t *); | 1277 | extern void ide_dma_lost_irq(ide_drive_t *); |
1277 | extern void ide_dma_timeout(ide_drive_t *); | 1278 | extern void ide_dma_timeout(ide_drive_t *); |
1279 | extern const struct ide_dma_ops sff_dma_ops; | ||
1278 | #endif /* CONFIG_BLK_DEV_IDEDMA_SFF */ | 1280 | #endif /* CONFIG_BLK_DEV_IDEDMA_SFF */ |
1279 | 1281 | ||
1280 | #else | 1282 | #else |
@@ -1448,8 +1450,7 @@ static inline void ide_dump_identify(u8 *id) | |||
1448 | 1450 | ||
1449 | static inline int hwif_to_node(ide_hwif_t *hwif) | 1451 | static inline int hwif_to_node(ide_hwif_t *hwif) |
1450 | { | 1452 | { |
1451 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 1453 | return hwif->dev ? dev_to_node(hwif->dev) : -1; |
1452 | return hwif->dev ? pcibus_to_node(dev->bus) : -1; | ||
1453 | } | 1454 | } |
1454 | 1455 | ||
1455 | static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive) | 1456 | static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive) |
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/iommu-helper.h b/include/linux/iommu-helper.h index c975caf75385..a6d0586e2bf7 100644 --- a/include/linux/iommu-helper.h +++ b/include/linux/iommu-helper.h | |||
@@ -1,6 +1,20 @@ | |||
1 | #ifndef _LINUX_IOMMU_HELPER_H | ||
2 | #define _LINUX_IOMMU_HELPER_H | ||
3 | |||
4 | static inline unsigned long iommu_device_max_index(unsigned long size, | ||
5 | unsigned long offset, | ||
6 | u64 dma_mask) | ||
7 | { | ||
8 | if (size + offset > dma_mask) | ||
9 | return dma_mask - offset + 1; | ||
10 | else | ||
11 | return size; | ||
12 | } | ||
13 | |||
1 | extern int iommu_is_span_boundary(unsigned int index, unsigned int nr, | 14 | extern int iommu_is_span_boundary(unsigned int index, unsigned int nr, |
2 | unsigned long shift, | 15 | unsigned long shift, |
3 | unsigned long boundary_size); | 16 | unsigned long boundary_size); |
17 | extern void iommu_area_reserve(unsigned long *map, unsigned long i, int len); | ||
4 | extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, | 18 | extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, |
5 | unsigned long start, unsigned int nr, | 19 | unsigned long start, unsigned int nr, |
6 | unsigned long shift, | 20 | unsigned long shift, |
@@ -8,3 +22,5 @@ extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, | |||
8 | unsigned long align_mask); | 22 | unsigned long align_mask); |
9 | extern void iommu_area_free(unsigned long *map, unsigned long start, | 23 | extern void iommu_area_free(unsigned long *map, unsigned long start, |
10 | unsigned int nr); | 24 | unsigned int nr); |
25 | |||
26 | #endif | ||
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 22d2115458c6..350033e8f4e1 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -109,6 +109,7 @@ extern struct resource iomem_resource; | |||
109 | extern int request_resource(struct resource *root, struct resource *new); | 109 | extern int request_resource(struct resource *root, struct resource *new); |
110 | extern int release_resource(struct resource *new); | 110 | extern int release_resource(struct resource *new); |
111 | extern int insert_resource(struct resource *parent, struct resource *new); | 111 | extern int insert_resource(struct resource *parent, struct resource *new); |
112 | extern void insert_resource_expand_to_fit(struct resource *root, struct resource *new); | ||
112 | extern int allocate_resource(struct resource *root, struct resource *new, | 113 | extern int allocate_resource(struct resource *root, struct resource *new, |
113 | resource_size_t size, resource_size_t min, | 114 | resource_size_t size, resource_size_t min, |
114 | resource_size_t max, resource_size_t align, | 115 | resource_size_t max, resource_size_t align, |
@@ -158,9 +159,9 @@ extern struct resource * __devm_request_region(struct device *dev, | |||
158 | struct resource *parent, resource_size_t start, | 159 | struct resource *parent, resource_size_t start, |
159 | resource_size_t n, const char *name); | 160 | resource_size_t n, const char *name); |
160 | 161 | ||
161 | #define devm_release_region(start,n) \ | 162 | #define devm_release_region(dev, start, n) \ |
162 | __devm_release_region(dev, &ioport_resource, (start), (n)) | 163 | __devm_release_region(dev, &ioport_resource, (start), (n)) |
163 | #define devm_release_mem_region(start,n) \ | 164 | #define devm_release_mem_region(dev, start, n) \ |
164 | __devm_release_region(dev, &iomem_resource, (start), (n)) | 165 | __devm_release_region(dev, &iomem_resource, (start), (n)) |
165 | 166 | ||
166 | extern void __devm_release_region(struct device *dev, struct resource *parent, | 167 | extern void __devm_release_region(struct device *dev, struct resource *parent, |
diff --git a/include/linux/ivtv.h b/include/linux/ivtv.h index 794b8daa9378..17ca64b5a66c 100644 --- a/include/linux/ivtv.h +++ b/include/linux/ivtv.h | |||
@@ -21,11 +21,7 @@ | |||
21 | #ifndef __LINUX_IVTV_H__ | 21 | #ifndef __LINUX_IVTV_H__ |
22 | #define __LINUX_IVTV_H__ | 22 | #define __LINUX_IVTV_H__ |
23 | 23 | ||
24 | #ifdef __KERNEL__ | 24 | #include <linux/compiler.h> |
25 | #include <linux/compiler.h> /* need __user */ | ||
26 | #else | ||
27 | #define __user | ||
28 | #endif | ||
29 | #include <linux/types.h> | 25 | #include <linux/types.h> |
30 | 26 | ||
31 | /* ivtv knows several distinct output modes: MPEG streaming, | 27 | /* ivtv knows several distinct output modes: MPEG streaming, |
diff --git a/include/linux/ivtvfb.h b/include/linux/ivtvfb.h index e980ba62ddcc..e20af47b59ad 100644 --- a/include/linux/ivtvfb.h +++ b/include/linux/ivtvfb.h | |||
@@ -21,11 +21,7 @@ | |||
21 | #ifndef __LINUX_IVTVFB_H__ | 21 | #ifndef __LINUX_IVTVFB_H__ |
22 | #define __LINUX_IVTVFB_H__ | 22 | #define __LINUX_IVTVFB_H__ |
23 | 23 | ||
24 | #ifdef __KERNEL__ | 24 | #include <linux/compiler.h> |
25 | #include <linux/compiler.h> /* need __user */ | ||
26 | #else | ||
27 | #define __user | ||
28 | #endif | ||
29 | #include <linux/types.h> | 25 | #include <linux/types.h> |
30 | 26 | ||
31 | /* Framebuffer external API */ | 27 | /* Framebuffer external API */ |
diff --git a/include/linux/kexec.h b/include/linux/kexec.h index 32110cede64f..17f76fc05173 100644 --- a/include/linux/kexec.h +++ b/include/linux/kexec.h | |||
@@ -25,8 +25,8 @@ | |||
25 | #error KEXEC_CONTROL_MEMORY_LIMIT not defined | 25 | #error KEXEC_CONTROL_MEMORY_LIMIT not defined |
26 | #endif | 26 | #endif |
27 | 27 | ||
28 | #ifndef KEXEC_CONTROL_CODE_SIZE | 28 | #ifndef KEXEC_CONTROL_PAGE_SIZE |
29 | #error KEXEC_CONTROL_CODE_SIZE not defined | 29 | #error KEXEC_CONTROL_PAGE_SIZE not defined |
30 | #endif | 30 | #endif |
31 | 31 | ||
32 | #ifndef KEXEC_ARCH | 32 | #ifndef KEXEC_ARCH |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 69511f74f912..70a30651cd12 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -320,12 +320,12 @@ struct kvm_trace_rec { | |||
320 | struct { | 320 | struct { |
321 | __u64 cycle_u64; | 321 | __u64 cycle_u64; |
322 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; | 322 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; |
323 | } cycle; | 323 | } __attribute__((packed)) cycle; |
324 | struct { | 324 | struct { |
325 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; | 325 | __u32 extra_u32[KVM_TRC_EXTRA_MAX]; |
326 | } nocycle; | 326 | } nocycle; |
327 | } u; | 327 | } u; |
328 | } __attribute__((packed)); | 328 | }; |
329 | 329 | ||
330 | #define KVMIO 0xAE | 330 | #define KVMIO 0xAE |
331 | 331 | ||
diff --git a/include/linux/libata.h b/include/linux/libata.h index 06b80337303b..947cf84e555d 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -146,6 +146,7 @@ enum { | |||
146 | ATA_DFLAG_SPUNDOWN = (1 << 14), /* XXX: for spindown_compat */ | 146 | ATA_DFLAG_SPUNDOWN = (1 << 14), /* XXX: for spindown_compat */ |
147 | ATA_DFLAG_SLEEPING = (1 << 15), /* device is sleeping */ | 147 | ATA_DFLAG_SLEEPING = (1 << 15), /* device is sleeping */ |
148 | ATA_DFLAG_DUBIOUS_XFER = (1 << 16), /* data transfer not verified */ | 148 | ATA_DFLAG_DUBIOUS_XFER = (1 << 16), /* data transfer not verified */ |
149 | ATA_DFLAG_NO_UNLOAD = (1 << 17), /* device doesn't support unload */ | ||
149 | ATA_DFLAG_INIT_MASK = (1 << 24) - 1, | 150 | ATA_DFLAG_INIT_MASK = (1 << 24) - 1, |
150 | 151 | ||
151 | ATA_DFLAG_DETACH = (1 << 24), | 152 | ATA_DFLAG_DETACH = (1 << 24), |
@@ -163,6 +164,7 @@ enum { | |||
163 | ATA_DEV_NONE = 9, /* no device */ | 164 | ATA_DEV_NONE = 9, /* no device */ |
164 | 165 | ||
165 | /* struct ata_link flags */ | 166 | /* struct ata_link flags */ |
167 | ATA_LFLAG_NO_HRST = (1 << 1), /* avoid hardreset */ | ||
166 | ATA_LFLAG_NO_SRST = (1 << 2), /* avoid softreset */ | 168 | ATA_LFLAG_NO_SRST = (1 << 2), /* avoid softreset */ |
167 | ATA_LFLAG_ASSUME_ATA = (1 << 3), /* assume ATA class */ | 169 | ATA_LFLAG_ASSUME_ATA = (1 << 3), /* assume ATA class */ |
168 | ATA_LFLAG_ASSUME_SEMB = (1 << 4), /* assume SEMB class */ | 170 | ATA_LFLAG_ASSUME_SEMB = (1 << 4), /* assume SEMB class */ |
@@ -243,6 +245,7 @@ enum { | |||
243 | ATA_TMOUT_BOOT = 30000, /* heuristic */ | 245 | ATA_TMOUT_BOOT = 30000, /* heuristic */ |
244 | ATA_TMOUT_BOOT_QUICK = 7000, /* heuristic */ | 246 | ATA_TMOUT_BOOT_QUICK = 7000, /* heuristic */ |
245 | ATA_TMOUT_INTERNAL_QUICK = 5000, | 247 | ATA_TMOUT_INTERNAL_QUICK = 5000, |
248 | ATA_TMOUT_MAX_PARK = 30000, | ||
246 | 249 | ||
247 | /* FIXME: GoVault needs 2s but we can't afford that without | 250 | /* FIXME: GoVault needs 2s but we can't afford that without |
248 | * parallel probing. 800ms is enough for iVDR disk | 251 | * parallel probing. 800ms is enough for iVDR disk |
@@ -318,8 +321,11 @@ enum { | |||
318 | ATA_EH_RESET = ATA_EH_SOFTRESET | ATA_EH_HARDRESET, | 321 | ATA_EH_RESET = ATA_EH_SOFTRESET | ATA_EH_HARDRESET, |
319 | ATA_EH_ENABLE_LINK = (1 << 3), | 322 | ATA_EH_ENABLE_LINK = (1 << 3), |
320 | ATA_EH_LPM = (1 << 4), /* link power management action */ | 323 | ATA_EH_LPM = (1 << 4), /* link power management action */ |
324 | ATA_EH_PARK = (1 << 5), /* unload heads and stop I/O */ | ||
321 | 325 | ||
322 | ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE, | 326 | ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE | ATA_EH_PARK, |
327 | ATA_EH_ALL_ACTIONS = ATA_EH_REVALIDATE | ATA_EH_RESET | | ||
328 | ATA_EH_ENABLE_LINK | ATA_EH_LPM, | ||
323 | 329 | ||
324 | /* ata_eh_info->flags */ | 330 | /* ata_eh_info->flags */ |
325 | ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */ | 331 | ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */ |
@@ -451,6 +457,7 @@ enum link_pm { | |||
451 | MEDIUM_POWER, | 457 | MEDIUM_POWER, |
452 | }; | 458 | }; |
453 | extern struct device_attribute dev_attr_link_power_management_policy; | 459 | extern struct device_attribute dev_attr_link_power_management_policy; |
460 | extern struct device_attribute dev_attr_unload_heads; | ||
454 | extern struct device_attribute dev_attr_em_message_type; | 461 | extern struct device_attribute dev_attr_em_message_type; |
455 | extern struct device_attribute dev_attr_em_message; | 462 | extern struct device_attribute dev_attr_em_message; |
456 | extern struct device_attribute dev_attr_sw_activity; | 463 | extern struct device_attribute dev_attr_sw_activity; |
@@ -553,8 +560,8 @@ struct ata_ering { | |||
553 | struct ata_device { | 560 | struct ata_device { |
554 | struct ata_link *link; | 561 | struct ata_link *link; |
555 | unsigned int devno; /* 0 or 1 */ | 562 | unsigned int devno; /* 0 or 1 */ |
556 | unsigned long flags; /* ATA_DFLAG_xxx */ | ||
557 | unsigned int horkage; /* List of broken features */ | 563 | unsigned int horkage; /* List of broken features */ |
564 | unsigned long flags; /* ATA_DFLAG_xxx */ | ||
558 | struct scsi_device *sdev; /* attached SCSI device */ | 565 | struct scsi_device *sdev; /* attached SCSI device */ |
559 | #ifdef CONFIG_ATA_ACPI | 566 | #ifdef CONFIG_ATA_ACPI |
560 | acpi_handle acpi_handle; | 567 | acpi_handle acpi_handle; |
@@ -563,6 +570,7 @@ struct ata_device { | |||
563 | /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ | 570 | /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ |
564 | u64 n_sectors; /* size of device, if ATA */ | 571 | u64 n_sectors; /* size of device, if ATA */ |
565 | unsigned int class; /* ATA_DEV_xxx */ | 572 | unsigned int class; /* ATA_DEV_xxx */ |
573 | unsigned long unpark_deadline; | ||
566 | 574 | ||
567 | u8 pio_mode; | 575 | u8 pio_mode; |
568 | u8 dma_mode; | 576 | u8 dma_mode; |
@@ -620,6 +628,7 @@ struct ata_eh_context { | |||
620 | [ATA_EH_CMD_TIMEOUT_TABLE_SIZE]; | 628 | [ATA_EH_CMD_TIMEOUT_TABLE_SIZE]; |
621 | unsigned int classes[ATA_MAX_DEVICES]; | 629 | unsigned int classes[ATA_MAX_DEVICES]; |
622 | unsigned int did_probe_mask; | 630 | unsigned int did_probe_mask; |
631 | unsigned int unloaded_mask; | ||
623 | unsigned int saved_ncq_enabled; | 632 | unsigned int saved_ncq_enabled; |
624 | u8 saved_xfer_mode[ATA_MAX_DEVICES]; | 633 | u8 saved_xfer_mode[ATA_MAX_DEVICES]; |
625 | /* timestamp for the last reset attempt or success */ | 634 | /* timestamp for the last reset attempt or success */ |
@@ -646,6 +655,7 @@ struct ata_link { | |||
646 | 655 | ||
647 | unsigned int flags; /* ATA_LFLAG_xxx */ | 656 | unsigned int flags; /* ATA_LFLAG_xxx */ |
648 | 657 | ||
658 | u32 saved_scontrol; /* SControl on probe */ | ||
649 | unsigned int hw_sata_spd_limit; | 659 | unsigned int hw_sata_spd_limit; |
650 | unsigned int sata_spd_limit; | 660 | unsigned int sata_spd_limit; |
651 | unsigned int sata_spd; /* current SATA PHY speed */ | 661 | unsigned int sata_spd; /* current SATA PHY speed */ |
@@ -686,7 +696,8 @@ struct ata_port { | |||
686 | unsigned int qc_active; | 696 | unsigned int qc_active; |
687 | int nr_active_links; /* #links with active qcs */ | 697 | int nr_active_links; /* #links with active qcs */ |
688 | 698 | ||
689 | struct ata_link link; /* host default link */ | 699 | struct ata_link link; /* host default link */ |
700 | struct ata_link *slave_link; /* see ata_slave_link_init() */ | ||
690 | 701 | ||
691 | int nr_pmp_links; /* nr of available PMP links */ | 702 | int nr_pmp_links; /* nr of available PMP links */ |
692 | struct ata_link *pmp_link; /* array of PMP links */ | 703 | struct ata_link *pmp_link; /* array of PMP links */ |
@@ -707,6 +718,7 @@ struct ata_port { | |||
707 | struct list_head eh_done_q; | 718 | struct list_head eh_done_q; |
708 | wait_queue_head_t eh_wait_q; | 719 | wait_queue_head_t eh_wait_q; |
709 | int eh_tries; | 720 | int eh_tries; |
721 | struct completion park_req_pending; | ||
710 | 722 | ||
711 | pm_message_t pm_mesg; | 723 | pm_message_t pm_mesg; |
712 | int *pm_result; | 724 | int *pm_result; |
@@ -770,8 +782,8 @@ struct ata_port_operations { | |||
770 | /* | 782 | /* |
771 | * Optional features | 783 | * Optional features |
772 | */ | 784 | */ |
773 | int (*scr_read)(struct ata_port *ap, unsigned int sc_reg, u32 *val); | 785 | int (*scr_read)(struct ata_link *link, unsigned int sc_reg, u32 *val); |
774 | int (*scr_write)(struct ata_port *ap, unsigned int sc_reg, u32 val); | 786 | int (*scr_write)(struct ata_link *link, unsigned int sc_reg, u32 val); |
775 | void (*pmp_attach)(struct ata_port *ap); | 787 | void (*pmp_attach)(struct ata_port *ap); |
776 | void (*pmp_detach)(struct ata_port *ap); | 788 | void (*pmp_detach)(struct ata_port *ap); |
777 | int (*enable_pm)(struct ata_port *ap, enum link_pm policy); | 789 | int (*enable_pm)(struct ata_port *ap, enum link_pm policy); |
@@ -893,6 +905,7 @@ extern void ata_port_disable(struct ata_port *); | |||
893 | extern struct ata_host *ata_host_alloc(struct device *dev, int max_ports); | 905 | extern struct ata_host *ata_host_alloc(struct device *dev, int max_ports); |
894 | extern struct ata_host *ata_host_alloc_pinfo(struct device *dev, | 906 | extern struct ata_host *ata_host_alloc_pinfo(struct device *dev, |
895 | const struct ata_port_info * const * ppi, int n_ports); | 907 | const struct ata_port_info * const * ppi, int n_ports); |
908 | extern int ata_slave_link_init(struct ata_port *ap); | ||
896 | extern int ata_host_start(struct ata_host *host); | 909 | extern int ata_host_start(struct ata_host *host); |
897 | extern int ata_host_register(struct ata_host *host, | 910 | extern int ata_host_register(struct ata_host *host, |
898 | struct scsi_host_template *sht); | 911 | struct scsi_host_template *sht); |
@@ -918,8 +931,8 @@ extern int sata_scr_valid(struct ata_link *link); | |||
918 | extern int sata_scr_read(struct ata_link *link, int reg, u32 *val); | 931 | extern int sata_scr_read(struct ata_link *link, int reg, u32 *val); |
919 | extern int sata_scr_write(struct ata_link *link, int reg, u32 val); | 932 | extern int sata_scr_write(struct ata_link *link, int reg, u32 val); |
920 | extern int sata_scr_write_flush(struct ata_link *link, int reg, u32 val); | 933 | extern int sata_scr_write_flush(struct ata_link *link, int reg, u32 val); |
921 | extern int ata_link_online(struct ata_link *link); | 934 | extern bool ata_link_online(struct ata_link *link); |
922 | extern int ata_link_offline(struct ata_link *link); | 935 | extern bool ata_link_offline(struct ata_link *link); |
923 | #ifdef CONFIG_PM | 936 | #ifdef CONFIG_PM |
924 | extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg); | 937 | extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg); |
925 | extern void ata_host_resume(struct ata_host *host); | 938 | extern void ata_host_resume(struct ata_host *host); |
@@ -1096,6 +1109,7 @@ extern void ata_std_error_handler(struct ata_port *ap); | |||
1096 | */ | 1109 | */ |
1097 | extern const struct ata_port_operations ata_base_port_ops; | 1110 | extern const struct ata_port_operations ata_base_port_ops; |
1098 | extern const struct ata_port_operations sata_port_ops; | 1111 | extern const struct ata_port_operations sata_port_ops; |
1112 | extern struct device_attribute *ata_common_sdev_attrs[]; | ||
1099 | 1113 | ||
1100 | #define ATA_BASE_SHT(drv_name) \ | 1114 | #define ATA_BASE_SHT(drv_name) \ |
1101 | .module = THIS_MODULE, \ | 1115 | .module = THIS_MODULE, \ |
@@ -1110,7 +1124,8 @@ extern const struct ata_port_operations sata_port_ops; | |||
1110 | .proc_name = drv_name, \ | 1124 | .proc_name = drv_name, \ |
1111 | .slave_configure = ata_scsi_slave_config, \ | 1125 | .slave_configure = ata_scsi_slave_config, \ |
1112 | .slave_destroy = ata_scsi_slave_destroy, \ | 1126 | .slave_destroy = ata_scsi_slave_destroy, \ |
1113 | .bios_param = ata_std_bios_param | 1127 | .bios_param = ata_std_bios_param, \ |
1128 | .sdev_attrs = ata_common_sdev_attrs | ||
1114 | 1129 | ||
1115 | #define ATA_NCQ_SHT(drv_name) \ | 1130 | #define ATA_NCQ_SHT(drv_name) \ |
1116 | ATA_BASE_SHT(drv_name), \ | 1131 | ATA_BASE_SHT(drv_name), \ |
@@ -1132,7 +1147,7 @@ static inline bool sata_pmp_attached(struct ata_port *ap) | |||
1132 | 1147 | ||
1133 | static inline int ata_is_host_link(const struct ata_link *link) | 1148 | static inline int ata_is_host_link(const struct ata_link *link) |
1134 | { | 1149 | { |
1135 | return link == &link->ap->link; | 1150 | return link == &link->ap->link || link == link->ap->slave_link; |
1136 | } | 1151 | } |
1137 | #else /* CONFIG_SATA_PMP */ | 1152 | #else /* CONFIG_SATA_PMP */ |
1138 | static inline bool sata_pmp_supported(struct ata_port *ap) | 1153 | static inline bool sata_pmp_supported(struct ata_port *ap) |
@@ -1165,7 +1180,7 @@ static inline int sata_srst_pmp(struct ata_link *link) | |||
1165 | printk("%sata%u: "fmt, lv, (ap)->print_id , ##args) | 1180 | printk("%sata%u: "fmt, lv, (ap)->print_id , ##args) |
1166 | 1181 | ||
1167 | #define ata_link_printk(link, lv, fmt, args...) do { \ | 1182 | #define ata_link_printk(link, lv, fmt, args...) do { \ |
1168 | if (sata_pmp_attached((link)->ap)) \ | 1183 | if (sata_pmp_attached((link)->ap) || (link)->ap->slave_link) \ |
1169 | printk("%sata%u.%02u: "fmt, lv, (link)->ap->print_id, \ | 1184 | printk("%sata%u.%02u: "fmt, lv, (link)->ap->print_id, \ |
1170 | (link)->pmp , ##args); \ | 1185 | (link)->pmp , ##args); \ |
1171 | else \ | 1186 | else \ |
@@ -1263,34 +1278,17 @@ static inline int ata_link_active(struct ata_link *link) | |||
1263 | return ata_tag_valid(link->active_tag) || link->sactive; | 1278 | return ata_tag_valid(link->active_tag) || link->sactive; |
1264 | } | 1279 | } |
1265 | 1280 | ||
1266 | static inline struct ata_link *ata_port_first_link(struct ata_port *ap) | 1281 | extern struct ata_link *__ata_port_next_link(struct ata_port *ap, |
1267 | { | 1282 | struct ata_link *link, |
1268 | if (sata_pmp_attached(ap)) | 1283 | bool dev_only); |
1269 | return ap->pmp_link; | ||
1270 | return &ap->link; | ||
1271 | } | ||
1272 | |||
1273 | static inline struct ata_link *ata_port_next_link(struct ata_link *link) | ||
1274 | { | ||
1275 | struct ata_port *ap = link->ap; | ||
1276 | |||
1277 | if (ata_is_host_link(link)) { | ||
1278 | if (!sata_pmp_attached(ap)) | ||
1279 | return NULL; | ||
1280 | return ap->pmp_link; | ||
1281 | } | ||
1282 | |||
1283 | if (++link < ap->nr_pmp_links + ap->pmp_link) | ||
1284 | return link; | ||
1285 | return NULL; | ||
1286 | } | ||
1287 | 1284 | ||
1288 | #define __ata_port_for_each_link(lk, ap) \ | 1285 | #define __ata_port_for_each_link(link, ap) \ |
1289 | for ((lk) = &(ap)->link; (lk); (lk) = ata_port_next_link(lk)) | 1286 | for ((link) = __ata_port_next_link((ap), NULL, false); (link); \ |
1287 | (link) = __ata_port_next_link((ap), (link), false)) | ||
1290 | 1288 | ||
1291 | #define ata_port_for_each_link(link, ap) \ | 1289 | #define ata_port_for_each_link(link, ap) \ |
1292 | for ((link) = ata_port_first_link(ap); (link); \ | 1290 | for ((link) = __ata_port_next_link((ap), NULL, true); (link); \ |
1293 | (link) = ata_port_next_link(link)) | 1291 | (link) = __ata_port_next_link((ap), (link), true)) |
1294 | 1292 | ||
1295 | #define ata_link_for_each_dev(dev, link) \ | 1293 | #define ata_link_for_each_dev(dev, link) \ |
1296 | for ((dev) = (link)->device; \ | 1294 | for ((dev) = (link)->device; \ |
@@ -1427,6 +1425,28 @@ static inline unsigned long ata_deadline(unsigned long from_jiffies, | |||
1427 | return from_jiffies + msecs_to_jiffies(timeout_msecs); | 1425 | return from_jiffies + msecs_to_jiffies(timeout_msecs); |
1428 | } | 1426 | } |
1429 | 1427 | ||
1428 | /* Don't open code these in drivers as there are traps. Firstly the range may | ||
1429 | change in future hardware and specs, secondly 0xFF means 'no DMA' but is | ||
1430 | > UDMA_0. Dyma ddreigiau */ | ||
1431 | |||
1432 | static inline int ata_using_mwdma(struct ata_device *adev) | ||
1433 | { | ||
1434 | if (adev->dma_mode >= XFER_MW_DMA_0 && adev->dma_mode <= XFER_MW_DMA_4) | ||
1435 | return 1; | ||
1436 | return 0; | ||
1437 | } | ||
1438 | |||
1439 | static inline int ata_using_udma(struct ata_device *adev) | ||
1440 | { | ||
1441 | if (adev->dma_mode >= XFER_UDMA_0 && adev->dma_mode <= XFER_UDMA_7) | ||
1442 | return 1; | ||
1443 | return 0; | ||
1444 | } | ||
1445 | |||
1446 | static inline int ata_dma_enabled(struct ata_device *adev) | ||
1447 | { | ||
1448 | return (adev->dma_mode == 0xFF ? 0 : 1); | ||
1449 | } | ||
1430 | 1450 | ||
1431 | /************************************************************************** | 1451 | /************************************************************************** |
1432 | * PMP - drivers/ata/libata-pmp.c | 1452 | * PMP - drivers/ata/libata-pmp.c |
diff --git a/include/linux/list.h b/include/linux/list.h index db35ef02e745..969f6e92d089 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -619,6 +619,19 @@ static inline void hlist_add_after(struct hlist_node *n, | |||
619 | next->next->pprev = &next->next; | 619 | next->next->pprev = &next->next; |
620 | } | 620 | } |
621 | 621 | ||
622 | /* | ||
623 | * Move a list from one list head to another. Fixup the pprev | ||
624 | * reference of the first entry if it exists. | ||
625 | */ | ||
626 | static inline void hlist_move_list(struct hlist_head *old, | ||
627 | struct hlist_head *new) | ||
628 | { | ||
629 | new->first = old->first; | ||
630 | if (new->first) | ||
631 | new->first->pprev = &new->first; | ||
632 | old->first = NULL; | ||
633 | } | ||
634 | |||
622 | #define hlist_entry(ptr, type, member) container_of(ptr,type,member) | 635 | #define hlist_entry(ptr, type, member) container_of(ptr,type,member) |
623 | 636 | ||
624 | #define hlist_for_each(pos, head) \ | 637 | #define hlist_for_each(pos, head) \ |
diff --git a/include/linux/memstick.h b/include/linux/memstick.h index a9f998a3f48b..d0c37e682234 100644 --- a/include/linux/memstick.h +++ b/include/linux/memstick.h | |||
@@ -21,30 +21,30 @@ | |||
21 | struct ms_status_register { | 21 | struct ms_status_register { |
22 | unsigned char reserved; | 22 | unsigned char reserved; |
23 | unsigned char interrupt; | 23 | unsigned char interrupt; |
24 | #define MEMSTICK_INT_CMDNAK 0x0001 | 24 | #define MEMSTICK_INT_CMDNAK 0x01 |
25 | #define MEMSTICK_INT_IOREQ 0x0008 | 25 | #define MEMSTICK_INT_IOREQ 0x08 |
26 | #define MEMSTICK_INT_IOBREQ 0x0010 | 26 | #define MEMSTICK_INT_IOBREQ 0x10 |
27 | #define MEMSTICK_INT_BREQ 0x0020 | 27 | #define MEMSTICK_INT_BREQ 0x20 |
28 | #define MEMSTICK_INT_ERR 0x0040 | 28 | #define MEMSTICK_INT_ERR 0x40 |
29 | #define MEMSTICK_INT_CED 0x0080 | 29 | #define MEMSTICK_INT_CED 0x80 |
30 | 30 | ||
31 | unsigned char status0; | 31 | unsigned char status0; |
32 | #define MEMSTICK_STATUS0_WP 0x0001 | 32 | #define MEMSTICK_STATUS0_WP 0x01 |
33 | #define MEMSTICK_STATUS0_SL 0x0002 | 33 | #define MEMSTICK_STATUS0_SL 0x02 |
34 | #define MEMSTICK_STATUS0_BF 0x0010 | 34 | #define MEMSTICK_STATUS0_BF 0x10 |
35 | #define MEMSTICK_STATUS0_BE 0x0020 | 35 | #define MEMSTICK_STATUS0_BE 0x20 |
36 | #define MEMSTICK_STATUS0_FB0 0x0040 | 36 | #define MEMSTICK_STATUS0_FB0 0x40 |
37 | #define MEMSTICK_STATUS0_MB 0x0080 | 37 | #define MEMSTICK_STATUS0_MB 0x80 |
38 | 38 | ||
39 | unsigned char status1; | 39 | unsigned char status1; |
40 | #define MEMSTICK_STATUS1_UCFG 0x0001 | 40 | #define MEMSTICK_STATUS1_UCFG 0x01 |
41 | #define MEMSTICK_STATUS1_FGER 0x0002 | 41 | #define MEMSTICK_STATUS1_FGER 0x02 |
42 | #define MEMSTICK_STATUS1_UCEX 0x0004 | 42 | #define MEMSTICK_STATUS1_UCEX 0x04 |
43 | #define MEMSTICK_STATUS1_EXER 0x0008 | 43 | #define MEMSTICK_STATUS1_EXER 0x08 |
44 | #define MEMSTICK_STATUS1_UCDT 0x0010 | 44 | #define MEMSTICK_STATUS1_UCDT 0x10 |
45 | #define MEMSTICK_STATUS1_DTER 0x0020 | 45 | #define MEMSTICK_STATUS1_DTER 0x20 |
46 | #define MEMSTICK_STATUS1_FBI 0x0040 | 46 | #define MEMSTICK_STATUS1_FB1 0x40 |
47 | #define MEMSTICK_STATUS1_MB 0x0080 | 47 | #define MEMSTICK_STATUS1_MB 0x80 |
48 | } __attribute__((packed)); | 48 | } __attribute__((packed)); |
49 | 49 | ||
50 | struct ms_id_register { | 50 | struct ms_id_register { |
@@ -56,32 +56,32 @@ struct ms_id_register { | |||
56 | 56 | ||
57 | struct ms_param_register { | 57 | struct ms_param_register { |
58 | unsigned char system; | 58 | unsigned char system; |
59 | #define MEMSTICK_SYS_ATEN 0xc0 | ||
60 | #define MEMSTICK_SYS_BAMD 0x80 | ||
61 | #define MEMSTICK_SYS_PAM 0x08 | 59 | #define MEMSTICK_SYS_PAM 0x08 |
60 | #define MEMSTICK_SYS_BAMD 0x80 | ||
62 | 61 | ||
63 | unsigned char block_address_msb; | 62 | unsigned char block_address_msb; |
64 | unsigned short block_address; | 63 | unsigned short block_address; |
65 | unsigned char cp; | 64 | unsigned char cp; |
66 | #define MEMSTICK_CP_BLOCK 0x0000 | 65 | #define MEMSTICK_CP_BLOCK 0x00 |
67 | #define MEMSTICK_CP_PAGE 0x0020 | 66 | #define MEMSTICK_CP_PAGE 0x20 |
68 | #define MEMSTICK_CP_EXTRA 0x0040 | 67 | #define MEMSTICK_CP_EXTRA 0x40 |
69 | #define MEMSTICK_CP_OVERWRITE 0x0080 | 68 | #define MEMSTICK_CP_OVERWRITE 0x80 |
70 | 69 | ||
71 | unsigned char page_address; | 70 | unsigned char page_address; |
72 | } __attribute__((packed)); | 71 | } __attribute__((packed)); |
73 | 72 | ||
74 | struct ms_extra_data_register { | 73 | struct ms_extra_data_register { |
75 | unsigned char overwrite_flag; | 74 | unsigned char overwrite_flag; |
76 | #define MEMSTICK_OVERWRITE_UPDATA 0x0010 | 75 | #define MEMSTICK_OVERWRITE_UDST 0x10 |
77 | #define MEMSTICK_OVERWRITE_PAGE 0x0060 | 76 | #define MEMSTICK_OVERWRITE_PGST1 0x20 |
78 | #define MEMSTICK_OVERWRITE_BLOCK 0x0080 | 77 | #define MEMSTICK_OVERWRITE_PGST0 0x40 |
78 | #define MEMSTICK_OVERWRITE_BKST 0x80 | ||
79 | 79 | ||
80 | unsigned char management_flag; | 80 | unsigned char management_flag; |
81 | #define MEMSTICK_MANAGEMENT_SYSTEM 0x0004 | 81 | #define MEMSTICK_MANAGEMENT_SYSFLG 0x04 |
82 | #define MEMSTICK_MANAGEMENT_TRANS_TABLE 0x0008 | 82 | #define MEMSTICK_MANAGEMENT_ATFLG 0x08 |
83 | #define MEMSTICK_MANAGEMENT_COPY 0x0010 | 83 | #define MEMSTICK_MANAGEMENT_SCMS1 0x10 |
84 | #define MEMSTICK_MANAGEMENT_ACCESS 0x0020 | 84 | #define MEMSTICK_MANAGEMENT_SCMS0 0x20 |
85 | 85 | ||
86 | unsigned short logical_address; | 86 | unsigned short logical_address; |
87 | } __attribute__((packed)); | 87 | } __attribute__((packed)); |
@@ -96,9 +96,9 @@ struct ms_register { | |||
96 | 96 | ||
97 | struct mspro_param_register { | 97 | struct mspro_param_register { |
98 | unsigned char system; | 98 | unsigned char system; |
99 | #define MEMSTICK_SYS_SERIAL 0x80 | ||
100 | #define MEMSTICK_SYS_PAR4 0x00 | 99 | #define MEMSTICK_SYS_PAR4 0x00 |
101 | #define MEMSTICK_SYS_PAR8 0x40 | 100 | #define MEMSTICK_SYS_PAR8 0x40 |
101 | #define MEMSTICK_SYS_SERIAL 0x80 | ||
102 | 102 | ||
103 | unsigned short data_count; | 103 | unsigned short data_count; |
104 | unsigned int data_address; | 104 | unsigned int data_address; |
@@ -147,7 +147,7 @@ struct ms_register_addr { | |||
147 | unsigned char w_length; | 147 | unsigned char w_length; |
148 | } __attribute__((packed)); | 148 | } __attribute__((packed)); |
149 | 149 | ||
150 | enum { | 150 | enum memstick_tpc { |
151 | MS_TPC_READ_MG_STATUS = 0x01, | 151 | MS_TPC_READ_MG_STATUS = 0x01, |
152 | MS_TPC_READ_LONG_DATA = 0x02, | 152 | MS_TPC_READ_LONG_DATA = 0x02, |
153 | MS_TPC_READ_SHORT_DATA = 0x03, | 153 | MS_TPC_READ_SHORT_DATA = 0x03, |
@@ -167,7 +167,7 @@ enum { | |||
167 | MS_TPC_SET_CMD = 0x0e | 167 | MS_TPC_SET_CMD = 0x0e |
168 | }; | 168 | }; |
169 | 169 | ||
170 | enum { | 170 | enum memstick_command { |
171 | MS_CMD_BLOCK_END = 0x33, | 171 | MS_CMD_BLOCK_END = 0x33, |
172 | MS_CMD_RESET = 0x3c, | 172 | MS_CMD_RESET = 0x3c, |
173 | MS_CMD_BLOCK_WRITE = 0x55, | 173 | MS_CMD_BLOCK_WRITE = 0x55, |
@@ -201,8 +201,6 @@ enum { | |||
201 | 201 | ||
202 | /*** Driver structures and functions ***/ | 202 | /*** Driver structures and functions ***/ |
203 | 203 | ||
204 | #define MEMSTICK_PART_SHIFT 3 | ||
205 | |||
206 | enum memstick_param { MEMSTICK_POWER = 1, MEMSTICK_INTERFACE }; | 204 | enum memstick_param { MEMSTICK_POWER = 1, MEMSTICK_INTERFACE }; |
207 | 205 | ||
208 | #define MEMSTICK_POWER_OFF 0 | 206 | #define MEMSTICK_POWER_OFF 0 |
@@ -215,24 +213,27 @@ enum memstick_param { MEMSTICK_POWER = 1, MEMSTICK_INTERFACE }; | |||
215 | struct memstick_host; | 213 | struct memstick_host; |
216 | struct memstick_driver; | 214 | struct memstick_driver; |
217 | 215 | ||
216 | struct memstick_device_id { | ||
217 | unsigned char match_flags; | ||
218 | #define MEMSTICK_MATCH_ALL 0x01 | 218 | #define MEMSTICK_MATCH_ALL 0x01 |
219 | 219 | ||
220 | unsigned char type; | ||
220 | #define MEMSTICK_TYPE_LEGACY 0xff | 221 | #define MEMSTICK_TYPE_LEGACY 0xff |
221 | #define MEMSTICK_TYPE_DUO 0x00 | 222 | #define MEMSTICK_TYPE_DUO 0x00 |
222 | #define MEMSTICK_TYPE_PRO 0x01 | 223 | #define MEMSTICK_TYPE_PRO 0x01 |
223 | 224 | ||
225 | unsigned char category; | ||
224 | #define MEMSTICK_CATEGORY_STORAGE 0xff | 226 | #define MEMSTICK_CATEGORY_STORAGE 0xff |
225 | #define MEMSTICK_CATEGORY_STORAGE_DUO 0x00 | 227 | #define MEMSTICK_CATEGORY_STORAGE_DUO 0x00 |
228 | #define MEMSTICK_CATEGORY_IO 0x01 | ||
229 | #define MEMSTICK_CATEGORY_IO_PRO 0x10 | ||
226 | 230 | ||
227 | #define MEMSTICK_CLASS_GENERIC 0xff | ||
228 | #define MEMSTICK_CLASS_GENERIC_DUO 0x00 | ||
229 | |||
230 | |||
231 | struct memstick_device_id { | ||
232 | unsigned char match_flags; | ||
233 | unsigned char type; | ||
234 | unsigned char category; | ||
235 | unsigned char class; | 231 | unsigned char class; |
232 | #define MEMSTICK_CLASS_FLASH 0xff | ||
233 | #define MEMSTICK_CLASS_DUO 0x00 | ||
234 | #define MEMSTICK_CLASS_ROM 0x01 | ||
235 | #define MEMSTICK_CLASS_RO 0x02 | ||
236 | #define MEMSTICK_CLASS_WP 0x03 | ||
236 | }; | 237 | }; |
237 | 238 | ||
238 | struct memstick_request { | 239 | struct memstick_request { |
@@ -319,9 +320,9 @@ void memstick_suspend_host(struct memstick_host *host); | |||
319 | void memstick_resume_host(struct memstick_host *host); | 320 | void memstick_resume_host(struct memstick_host *host); |
320 | 321 | ||
321 | void memstick_init_req_sg(struct memstick_request *mrq, unsigned char tpc, | 322 | void memstick_init_req_sg(struct memstick_request *mrq, unsigned char tpc, |
322 | struct scatterlist *sg); | 323 | const struct scatterlist *sg); |
323 | void memstick_init_req(struct memstick_request *mrq, unsigned char tpc, | 324 | void memstick_init_req(struct memstick_request *mrq, unsigned char tpc, |
324 | void *buf, size_t length); | 325 | const void *buf, size_t length); |
325 | int memstick_next_req(struct memstick_host *host, | 326 | int memstick_next_req(struct memstick_host *host, |
326 | struct memstick_request **mrq); | 327 | struct memstick_request **mrq); |
327 | void memstick_new_req(struct memstick_host *host); | 328 | void memstick_new_req(struct memstick_host *host); |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 655ea0d1ee14..b2f944468313 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -141,6 +141,10 @@ enum { | |||
141 | MLX4_STAT_RATE_OFFSET = 5 | 141 | MLX4_STAT_RATE_OFFSET = 5 |
142 | }; | 142 | }; |
143 | 143 | ||
144 | enum { | ||
145 | MLX4_MTT_FLAG_PRESENT = 1 | ||
146 | }; | ||
147 | |||
144 | static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) | 148 | static inline u64 mlx4_fw_ver(u64 major, u64 minor, u64 subminor) |
145 | { | 149 | { |
146 | return (major << 32) | (minor << 16) | subminor; | 150 | return (major << 32) | (minor << 16) | subminor; |
diff --git a/include/linux/mm.h b/include/linux/mm.h index fa651609b65d..72a15dc26bbf 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -73,7 +73,7 @@ extern unsigned int kobjsize(const void *objp); | |||
73 | #endif | 73 | #endif |
74 | 74 | ||
75 | /* | 75 | /* |
76 | * vm_flags.. | 76 | * vm_flags in vm_area_struct, see mm_types.h. |
77 | */ | 77 | */ |
78 | #define VM_READ 0x00000001 /* currently active flags */ | 78 | #define VM_READ 0x00000001 /* currently active flags */ |
79 | #define VM_WRITE 0x00000002 | 79 | #define VM_WRITE 0x00000002 |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 386edbe2cb4e..bf334138c7c1 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -113,7 +113,7 @@ struct vm_area_struct { | |||
113 | struct vm_area_struct *vm_next; | 113 | struct vm_area_struct *vm_next; |
114 | 114 | ||
115 | pgprot_t vm_page_prot; /* Access permissions of this VMA. */ | 115 | pgprot_t vm_page_prot; /* Access permissions of this VMA. */ |
116 | unsigned long vm_flags; /* Flags, listed below. */ | 116 | unsigned long vm_flags; /* Flags, see mm.h. */ |
117 | 117 | ||
118 | struct rb_node vm_rb; | 118 | struct rb_node vm_rb; |
119 | 119 | ||
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 443bc7cd8c62..428328a05fa1 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -751,8 +751,9 @@ static inline int zonelist_node_idx(struct zoneref *zoneref) | |||
751 | * | 751 | * |
752 | * This function returns the next zone at or below a given zone index that is | 752 | * This function returns the next zone at or below a given zone index that is |
753 | * within the allowed nodemask using a cursor as the starting point for the | 753 | * within the allowed nodemask using a cursor as the starting point for the |
754 | * search. The zoneref returned is a cursor that is used as the next starting | 754 | * search. The zoneref returned is a cursor that represents the current zone |
755 | * point for future calls to next_zones_zonelist(). | 755 | * being examined. It should be advanced by one before calling |
756 | * next_zones_zonelist again. | ||
756 | */ | 757 | */ |
757 | struct zoneref *next_zones_zonelist(struct zoneref *z, | 758 | struct zoneref *next_zones_zonelist(struct zoneref *z, |
758 | enum zone_type highest_zoneidx, | 759 | enum zone_type highest_zoneidx, |
@@ -768,9 +769,8 @@ struct zoneref *next_zones_zonelist(struct zoneref *z, | |||
768 | * | 769 | * |
769 | * This function returns the first zone at or below a given zone index that is | 770 | * This function returns the first zone at or below a given zone index that is |
770 | * within the allowed nodemask. The zoneref returned is a cursor that can be | 771 | * within the allowed nodemask. The zoneref returned is a cursor that can be |
771 | * used to iterate the zonelist with next_zones_zonelist. The cursor should | 772 | * used to iterate the zonelist with next_zones_zonelist by advancing it by |
772 | * not be used by the caller as it does not match the value of the zone | 773 | * one before calling. |
773 | * returned. | ||
774 | */ | 774 | */ |
775 | static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist, | 775 | static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist, |
776 | enum zone_type highest_zoneidx, | 776 | enum zone_type highest_zoneidx, |
@@ -795,7 +795,7 @@ static inline struct zoneref *first_zones_zonelist(struct zonelist *zonelist, | |||
795 | #define for_each_zone_zonelist_nodemask(zone, z, zlist, highidx, nodemask) \ | 795 | #define for_each_zone_zonelist_nodemask(zone, z, zlist, highidx, nodemask) \ |
796 | for (z = first_zones_zonelist(zlist, highidx, nodemask, &zone); \ | 796 | for (z = first_zones_zonelist(zlist, highidx, nodemask, &zone); \ |
797 | zone; \ | 797 | zone; \ |
798 | z = next_zones_zonelist(z, highidx, nodemask, &zone)) \ | 798 | z = next_zones_zonelist(++z, highidx, nodemask, &zone)) \ |
799 | 799 | ||
800 | /** | 800 | /** |
801 | * for_each_zone_zonelist - helper macro to iterate over valid zones in a zonelist at or below a given zone index | 801 | * for_each_zone_zonelist - helper macro to iterate over valid zones in a zonelist at or below a given zone index |
diff --git a/include/linux/mroute.h b/include/linux/mroute.h index 07112ee9293a..8a455694d682 100644 --- a/include/linux/mroute.h +++ b/include/linux/mroute.h | |||
@@ -6,7 +6,6 @@ | |||
6 | #ifdef __KERNEL__ | 6 | #ifdef __KERNEL__ |
7 | #include <linux/in.h> | 7 | #include <linux/in.h> |
8 | #endif | 8 | #endif |
9 | #include <linux/pim.h> | ||
10 | 9 | ||
11 | /* | 10 | /* |
12 | * Based on the MROUTING 3.5 defines primarily to keep | 11 | * Based on the MROUTING 3.5 defines primarily to keep |
@@ -130,6 +129,7 @@ struct igmpmsg | |||
130 | */ | 129 | */ |
131 | 130 | ||
132 | #ifdef __KERNEL__ | 131 | #ifdef __KERNEL__ |
132 | #include <linux/pim.h> | ||
133 | #include <net/sock.h> | 133 | #include <net/sock.h> |
134 | 134 | ||
135 | #ifdef CONFIG_IP_MROUTE | 135 | #ifdef CONFIG_IP_MROUTE |
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h index 5cf50473a10f..6f4c180179e2 100644 --- a/include/linux/mroute6.h +++ b/include/linux/mroute6.h | |||
@@ -115,6 +115,7 @@ struct sioc_mif_req6 | |||
115 | 115 | ||
116 | #ifdef __KERNEL__ | 116 | #ifdef __KERNEL__ |
117 | 117 | ||
118 | #include <linux/pim.h> | ||
118 | #include <linux/skbuff.h> /* for struct sk_buff_head */ | 119 | #include <linux/skbuff.h> /* for struct sk_buff_head */ |
119 | 120 | ||
120 | #ifdef CONFIG_IPV6_MROUTE | 121 | #ifdef CONFIG_IPV6_MROUTE |
diff --git a/include/linux/net.h b/include/linux/net.h index 4a9a30f2d68f..6dc14a240042 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -18,16 +18,9 @@ | |||
18 | #ifndef _LINUX_NET_H | 18 | #ifndef _LINUX_NET_H |
19 | #define _LINUX_NET_H | 19 | #define _LINUX_NET_H |
20 | 20 | ||
21 | #include <linux/wait.h> | ||
22 | #include <linux/socket.h> | 21 | #include <linux/socket.h> |
23 | #include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */ | ||
24 | #include <asm/socket.h> | 22 | #include <asm/socket.h> |
25 | 23 | ||
26 | struct poll_table_struct; | ||
27 | struct pipe_inode_info; | ||
28 | struct inode; | ||
29 | struct net; | ||
30 | |||
31 | #define NPROTO AF_MAX | 24 | #define NPROTO AF_MAX |
32 | 25 | ||
33 | #define SYS_SOCKET 1 /* sys_socket(2) */ | 26 | #define SYS_SOCKET 1 /* sys_socket(2) */ |
@@ -62,6 +55,13 @@ typedef enum { | |||
62 | #ifdef __KERNEL__ | 55 | #ifdef __KERNEL__ |
63 | #include <linux/stringify.h> | 56 | #include <linux/stringify.h> |
64 | #include <linux/random.h> | 57 | #include <linux/random.h> |
58 | #include <linux/wait.h> | ||
59 | #include <linux/fcntl.h> /* For O_CLOEXEC and O_NONBLOCK */ | ||
60 | |||
61 | struct poll_table_struct; | ||
62 | struct pipe_inode_info; | ||
63 | struct inode; | ||
64 | struct net; | ||
65 | 65 | ||
66 | #define SOCK_ASYNC_NOSPACE 0 | 66 | #define SOCK_ASYNC_NOSPACE 0 |
67 | #define SOCK_ASYNC_WAITDATA 1 | 67 | #define SOCK_ASYNC_WAITDATA 1 |
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.h b/include/linux/pci.h index c0e14008a3c2..98dc6243a706 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -534,7 +534,7 @@ extern void pci_sort_breadthfirst(void); | |||
534 | #ifdef CONFIG_PCI_LEGACY | 534 | #ifdef CONFIG_PCI_LEGACY |
535 | struct pci_dev __deprecated *pci_find_device(unsigned int vendor, | 535 | struct pci_dev __deprecated *pci_find_device(unsigned int vendor, |
536 | unsigned int device, | 536 | unsigned int device, |
537 | const struct pci_dev *from); | 537 | struct pci_dev *from); |
538 | struct pci_dev __deprecated *pci_find_slot(unsigned int bus, | 538 | struct pci_dev __deprecated *pci_find_slot(unsigned int bus, |
539 | unsigned int devfn); | 539 | unsigned int devfn); |
540 | #endif /* CONFIG_PCI_LEGACY */ | 540 | #endif /* CONFIG_PCI_LEGACY */ |
@@ -550,7 +550,7 @@ struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device, | |||
550 | struct pci_dev *from); | 550 | struct pci_dev *from); |
551 | struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device, | 551 | struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device, |
552 | unsigned int ss_vendor, unsigned int ss_device, | 552 | unsigned int ss_vendor, unsigned int ss_device, |
553 | const struct pci_dev *from); | 553 | struct pci_dev *from); |
554 | struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn); | 554 | struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn); |
555 | struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn); | 555 | struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn); |
556 | struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from); | 556 | struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from); |
@@ -816,7 +816,7 @@ _PCI_NOP_ALL(write,) | |||
816 | 816 | ||
817 | static inline struct pci_dev *pci_find_device(unsigned int vendor, | 817 | static inline struct pci_dev *pci_find_device(unsigned int vendor, |
818 | unsigned int device, | 818 | unsigned int device, |
819 | const struct pci_dev *from) | 819 | struct pci_dev *from) |
820 | { | 820 | { |
821 | return NULL; | 821 | return NULL; |
822 | } | 822 | } |
@@ -838,7 +838,7 @@ static inline struct pci_dev *pci_get_subsys(unsigned int vendor, | |||
838 | unsigned int device, | 838 | unsigned int device, |
839 | unsigned int ss_vendor, | 839 | unsigned int ss_vendor, |
840 | unsigned int ss_device, | 840 | unsigned int ss_device, |
841 | const struct pci_dev *from) | 841 | struct pci_dev *from) |
842 | { | 842 | { |
843 | return NULL; | 843 | return NULL; |
844 | } | 844 | } |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 9ec2bcce8e83..c114103af987 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -497,6 +497,16 @@ | |||
497 | #define PCI_DEVICE_ID_AMD_K8_NB_ADDRMAP 0x1101 | 497 | #define PCI_DEVICE_ID_AMD_K8_NB_ADDRMAP 0x1101 |
498 | #define PCI_DEVICE_ID_AMD_K8_NB_MEMCTL 0x1102 | 498 | #define PCI_DEVICE_ID_AMD_K8_NB_MEMCTL 0x1102 |
499 | #define PCI_DEVICE_ID_AMD_K8_NB_MISC 0x1103 | 499 | #define PCI_DEVICE_ID_AMD_K8_NB_MISC 0x1103 |
500 | #define PCI_DEVICE_ID_AMD_10H_NB_HT 0x1200 | ||
501 | #define PCI_DEVICE_ID_AMD_10H_NB_MAP 0x1201 | ||
502 | #define PCI_DEVICE_ID_AMD_10H_NB_DRAM 0x1202 | ||
503 | #define PCI_DEVICE_ID_AMD_10H_NB_MISC 0x1203 | ||
504 | #define PCI_DEVICE_ID_AMD_10H_NB_LINK 0x1204 | ||
505 | #define PCI_DEVICE_ID_AMD_11H_NB_HT 0x1300 | ||
506 | #define PCI_DEVICE_ID_AMD_11H_NB_MAP 0x1301 | ||
507 | #define PCI_DEVICE_ID_AMD_11H_NB_DRAM 0x1302 | ||
508 | #define PCI_DEVICE_ID_AMD_11H_NB_MISC 0x1303 | ||
509 | #define PCI_DEVICE_ID_AMD_11H_NB_LINK 0x1304 | ||
500 | #define PCI_DEVICE_ID_AMD_LANCE 0x2000 | 510 | #define PCI_DEVICE_ID_AMD_LANCE 0x2000 |
501 | #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 | 511 | #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 |
502 | #define PCI_DEVICE_ID_AMD_SCSI 0x2020 | 512 | #define PCI_DEVICE_ID_AMD_SCSI 0x2020 |
@@ -2428,6 +2438,9 @@ | |||
2428 | #define PCI_DEVICE_ID_INTEL_ICH10_3 0x3a1a | 2438 | #define PCI_DEVICE_ID_INTEL_ICH10_3 0x3a1a |
2429 | #define PCI_DEVICE_ID_INTEL_ICH10_4 0x3a30 | 2439 | #define PCI_DEVICE_ID_INTEL_ICH10_4 0x3a30 |
2430 | #define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60 | 2440 | #define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60 |
2441 | #define PCI_DEVICE_ID_INTEL_PCH_0 0x3b10 | ||
2442 | #define PCI_DEVICE_ID_INTEL_PCH_1 0x3b11 | ||
2443 | #define PCI_DEVICE_ID_INTEL_PCH_2 0x3b30 | ||
2431 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f | 2444 | #define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f |
2432 | #define PCI_DEVICE_ID_INTEL_5100_16 0x65f0 | 2445 | #define PCI_DEVICE_ID_INTEL_5100_16 0x65f0 |
2433 | #define PCI_DEVICE_ID_INTEL_5100_21 0x65f5 | 2446 | #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/pim.h b/include/linux/pim.h index 236ffd317394..1ba0661561a4 100644 --- a/include/linux/pim.h +++ b/include/linux/pim.h | |||
@@ -3,22 +3,6 @@ | |||
3 | 3 | ||
4 | #include <asm/byteorder.h> | 4 | #include <asm/byteorder.h> |
5 | 5 | ||
6 | #ifndef __KERNEL__ | ||
7 | struct pim { | ||
8 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
9 | __u8 pim_type:4, /* PIM message type */ | ||
10 | pim_ver:4; /* PIM version */ | ||
11 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
12 | __u8 pim_ver:4; /* PIM version */ | ||
13 | pim_type:4; /* PIM message type */ | ||
14 | #endif | ||
15 | __u8 pim_rsv; /* Reserved */ | ||
16 | __be16 pim_cksum; /* Checksum */ | ||
17 | }; | ||
18 | |||
19 | #define PIM_MINLEN 8 | ||
20 | #endif | ||
21 | |||
22 | /* Message types - V1 */ | 6 | /* Message types - V1 */ |
23 | #define PIM_V1_VERSION __constant_htonl(0x10000000) | 7 | #define PIM_V1_VERSION __constant_htonl(0x10000000) |
24 | #define PIM_V1_REGISTER 1 | 8 | #define PIM_V1_REGISTER 1 |
@@ -27,7 +11,6 @@ struct pim { | |||
27 | #define PIM_VERSION 2 | 11 | #define PIM_VERSION 2 |
28 | #define PIM_REGISTER 1 | 12 | #define PIM_REGISTER 1 |
29 | 13 | ||
30 | #if defined(__KERNEL__) | ||
31 | #define PIM_NULL_REGISTER __constant_htonl(0x40000000) | 14 | #define PIM_NULL_REGISTER __constant_htonl(0x40000000) |
32 | 15 | ||
33 | /* PIMv2 register message header layout (ietf-draft-idmr-pimvsm-v2-00.ps */ | 16 | /* PIMv2 register message header layout (ietf-draft-idmr-pimvsm-v2-00.ps */ |
@@ -42,4 +25,3 @@ struct pimreghdr | |||
42 | struct sk_buff; | 25 | struct sk_buff; |
43 | extern int pim_rcv_v1(struct sk_buff *); | 26 | extern int pim_rcv_v1(struct sk_buff *); |
44 | #endif | 27 | #endif |
45 | #endif | ||
diff --git a/include/linux/pnp.h b/include/linux/pnp.h index 1ce54b63085d..be764e514e35 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h | |||
@@ -21,7 +21,14 @@ struct pnp_dev; | |||
21 | /* | 21 | /* |
22 | * Resource Management | 22 | * Resource Management |
23 | */ | 23 | */ |
24 | #ifdef CONFIG_PNP | ||
24 | struct resource *pnp_get_resource(struct pnp_dev *, unsigned int, unsigned int); | 25 | struct resource *pnp_get_resource(struct pnp_dev *, unsigned int, unsigned int); |
26 | #else | ||
27 | static inline struct resource *pnp_get_resource(struct pnp_dev *dev, unsigned int type, unsigned int num) | ||
28 | { | ||
29 | return NULL; | ||
30 | } | ||
31 | #endif | ||
25 | 32 | ||
26 | static inline int pnp_resource_valid(struct resource *res) | 33 | static inline int pnp_resource_valid(struct resource *res) |
27 | { | 34 | { |
diff --git a/include/linux/quicklist.h b/include/linux/quicklist.h index 39b66713a0bb..bd466439c588 100644 --- a/include/linux/quicklist.h +++ b/include/linux/quicklist.h | |||
@@ -80,6 +80,13 @@ void quicklist_trim(int nr, void (*dtor)(void *), | |||
80 | 80 | ||
81 | unsigned long quicklist_total_size(void); | 81 | unsigned long quicklist_total_size(void); |
82 | 82 | ||
83 | #else | ||
84 | |||
85 | static inline unsigned long quicklist_total_size(void) | ||
86 | { | ||
87 | return 0; | ||
88 | } | ||
89 | |||
83 | #endif | 90 | #endif |
84 | 91 | ||
85 | #endif /* LINUX_QUICKLIST_H */ | 92 | #endif /* LINUX_QUICKLIST_H */ |
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h index b160fb18e8d6..37aaf2b39863 100644 --- a/include/linux/ramfs.h +++ b/include/linux/ramfs.h | |||
@@ -6,6 +6,7 @@ extern int ramfs_get_sb(struct file_system_type *fs_type, | |||
6 | int flags, const char *dev_name, void *data, struct vfsmount *mnt); | 6 | int flags, const char *dev_name, void *data, struct vfsmount *mnt); |
7 | 7 | ||
8 | #ifndef CONFIG_MMU | 8 | #ifndef CONFIG_MMU |
9 | extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize); | ||
9 | extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file, | 10 | extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file, |
10 | unsigned long addr, | 11 | unsigned long addr, |
11 | unsigned long len, | 12 | unsigned long len, |
diff --git a/include/linux/reboot.h b/include/linux/reboot.h index b93b541cf111..988e55fe649b 100644 --- a/include/linux/reboot.h +++ b/include/linux/reboot.h | |||
@@ -59,6 +59,7 @@ extern void machine_crash_shutdown(struct pt_regs *); | |||
59 | * Architecture independent implemenations of sys_reboot commands. | 59 | * Architecture independent implemenations of sys_reboot commands. |
60 | */ | 60 | */ |
61 | 61 | ||
62 | extern void kernel_restart_prepare(char *cmd); | ||
62 | extern void kernel_restart(char *cmd); | 63 | extern void kernel_restart(char *cmd); |
63 | extern void kernel_halt(void); | 64 | extern void kernel_halt(void); |
64 | extern void kernel_power_off(void); | 65 | extern void kernel_power_off(void); |
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h index fdeadd9740dc..271c1c2c9f6f 100644 --- a/include/linux/res_counter.h +++ b/include/linux/res_counter.h | |||
@@ -166,7 +166,7 @@ static inline int res_counter_set_limit(struct res_counter *cnt, | |||
166 | int ret = -EBUSY; | 166 | int ret = -EBUSY; |
167 | 167 | ||
168 | spin_lock_irqsave(&cnt->lock, flags); | 168 | spin_lock_irqsave(&cnt->lock, flags); |
169 | if (cnt->usage < limit) { | 169 | if (cnt->usage <= limit) { |
170 | cnt->limit = limit; | 170 | cnt->limit = limit; |
171 | ret = 0; | 171 | ret = 0; |
172 | } | 172 | } |
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/sched.h b/include/linux/sched.h index cfb0d87b99fc..3d9120c5ad15 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -1475,6 +1475,10 @@ static inline void put_task_struct(struct task_struct *t) | |||
1475 | __put_task_struct(t); | 1475 | __put_task_struct(t); |
1476 | } | 1476 | } |
1477 | 1477 | ||
1478 | extern cputime_t task_utime(struct task_struct *p); | ||
1479 | extern cputime_t task_stime(struct task_struct *p); | ||
1480 | extern cputime_t task_gtime(struct task_struct *p); | ||
1481 | |||
1478 | /* | 1482 | /* |
1479 | * Per process flags | 1483 | * Per process flags |
1480 | */ | 1484 | */ |
diff --git a/include/linux/security.h b/include/linux/security.h index fd96e7f8a6f9..80c4d002864c 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -46,8 +46,8 @@ struct audit_krule; | |||
46 | */ | 46 | */ |
47 | extern int cap_capable(struct task_struct *tsk, int cap); | 47 | extern int cap_capable(struct task_struct *tsk, int cap); |
48 | extern int cap_settime(struct timespec *ts, struct timezone *tz); | 48 | extern int cap_settime(struct timespec *ts, struct timezone *tz); |
49 | extern int cap_ptrace(struct task_struct *parent, struct task_struct *child, | 49 | extern int cap_ptrace_may_access(struct task_struct *child, unsigned int mode); |
50 | unsigned int mode); | 50 | extern int cap_ptrace_traceme(struct task_struct *parent); |
51 | extern int cap_capget(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); | 51 | extern int cap_capget(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); |
52 | extern int cap_capset_check(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); | 52 | extern int cap_capset_check(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); |
53 | extern void cap_capset_set(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); | 53 | extern void cap_capset_set(struct task_struct *target, kernel_cap_t *effective, kernel_cap_t *inheritable, kernel_cap_t *permitted); |
@@ -1157,17 +1157,24 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
1157 | * @alter contains the flag indicating whether changes are to be made. | 1157 | * @alter contains the flag indicating whether changes are to be made. |
1158 | * Return 0 if permission is granted. | 1158 | * Return 0 if permission is granted. |
1159 | * | 1159 | * |
1160 | * @ptrace: | 1160 | * @ptrace_may_access: |
1161 | * Check permission before allowing the @parent process to trace the | 1161 | * Check permission before allowing the current process to trace the |
1162 | * @child process. | 1162 | * @child process. |
1163 | * Security modules may also want to perform a process tracing check | 1163 | * Security modules may also want to perform a process tracing check |
1164 | * during an execve in the set_security or apply_creds hooks of | 1164 | * during an execve in the set_security or apply_creds hooks of |
1165 | * binprm_security_ops if the process is being traced and its security | 1165 | * binprm_security_ops if the process is being traced and its security |
1166 | * attributes would be changed by the execve. | 1166 | * attributes would be changed by the execve. |
1167 | * @parent contains the task_struct structure for parent process. | 1167 | * @child contains the task_struct structure for the target process. |
1168 | * @child contains the task_struct structure for child process. | ||
1169 | * @mode contains the PTRACE_MODE flags indicating the form of access. | 1168 | * @mode contains the PTRACE_MODE flags indicating the form of access. |
1170 | * Return 0 if permission is granted. | 1169 | * Return 0 if permission is granted. |
1170 | * @ptrace_traceme: | ||
1171 | * Check that the @parent process has sufficient permission to trace the | ||
1172 | * current process before allowing the current process to present itself | ||
1173 | * to the @parent process for tracing. | ||
1174 | * The parent process will still have to undergo the ptrace_may_access | ||
1175 | * checks before it is allowed to trace this one. | ||
1176 | * @parent contains the task_struct structure for debugger process. | ||
1177 | * Return 0 if permission is granted. | ||
1171 | * @capget: | 1178 | * @capget: |
1172 | * Get the @effective, @inheritable, and @permitted capability sets for | 1179 | * Get the @effective, @inheritable, and @permitted capability sets for |
1173 | * the @target process. The hook may also perform permission checking to | 1180 | * the @target process. The hook may also perform permission checking to |
@@ -1287,8 +1294,8 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
1287 | struct security_operations { | 1294 | struct security_operations { |
1288 | char name[SECURITY_NAME_MAX + 1]; | 1295 | char name[SECURITY_NAME_MAX + 1]; |
1289 | 1296 | ||
1290 | int (*ptrace) (struct task_struct *parent, struct task_struct *child, | 1297 | int (*ptrace_may_access) (struct task_struct *child, unsigned int mode); |
1291 | unsigned int mode); | 1298 | int (*ptrace_traceme) (struct task_struct *parent); |
1292 | int (*capget) (struct task_struct *target, | 1299 | int (*capget) (struct task_struct *target, |
1293 | kernel_cap_t *effective, | 1300 | kernel_cap_t *effective, |
1294 | kernel_cap_t *inheritable, kernel_cap_t *permitted); | 1301 | kernel_cap_t *inheritable, kernel_cap_t *permitted); |
@@ -1560,8 +1567,8 @@ extern struct dentry *securityfs_create_dir(const char *name, struct dentry *par | |||
1560 | extern void securityfs_remove(struct dentry *dentry); | 1567 | extern void securityfs_remove(struct dentry *dentry); |
1561 | 1568 | ||
1562 | /* Security operations */ | 1569 | /* Security operations */ |
1563 | int security_ptrace(struct task_struct *parent, struct task_struct *child, | 1570 | int security_ptrace_may_access(struct task_struct *child, unsigned int mode); |
1564 | unsigned int mode); | 1571 | int security_ptrace_traceme(struct task_struct *parent); |
1565 | int security_capget(struct task_struct *target, | 1572 | int security_capget(struct task_struct *target, |
1566 | kernel_cap_t *effective, | 1573 | kernel_cap_t *effective, |
1567 | kernel_cap_t *inheritable, | 1574 | kernel_cap_t *inheritable, |
@@ -1742,11 +1749,15 @@ static inline int security_init(void) | |||
1742 | return 0; | 1749 | return 0; |
1743 | } | 1750 | } |
1744 | 1751 | ||
1745 | static inline int security_ptrace(struct task_struct *parent, | 1752 | static inline int security_ptrace_may_access(struct task_struct *child, |
1746 | struct task_struct *child, | 1753 | unsigned int mode) |
1747 | unsigned int mode) | 1754 | { |
1755 | return cap_ptrace_may_access(child, mode); | ||
1756 | } | ||
1757 | |||
1758 | static inline int security_ptrace_traceme(struct task_struct *parent) | ||
1748 | { | 1759 | { |
1749 | return cap_ptrace(parent, child, mode); | 1760 | return cap_ptrace_traceme(parent); |
1750 | } | 1761 | } |
1751 | 1762 | ||
1752 | static inline int security_capget(struct task_struct *target, | 1763 | static inline int security_capget(struct task_struct *target, |
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/smb.h b/include/linux/smb.h index caa43b2370cb..82fefddc5987 100644 --- a/include/linux/smb.h +++ b/include/linux/smb.h | |||
@@ -11,7 +11,9 @@ | |||
11 | 11 | ||
12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
13 | #include <linux/magic.h> | 13 | #include <linux/magic.h> |
14 | #ifdef __KERNEL__ | ||
14 | #include <linux/time.h> | 15 | #include <linux/time.h> |
16 | #endif | ||
15 | 17 | ||
16 | enum smb_protocol { | 18 | enum smb_protocol { |
17 | SMB_PROTOCOL_NONE, | 19 | SMB_PROTOCOL_NONE, |
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h index 5da9794b2d78..b106fd8e0d5c 100644 --- a/include/linux/stacktrace.h +++ b/include/linux/stacktrace.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __LINUX_STACKTRACE_H | 1 | #ifndef __LINUX_STACKTRACE_H |
2 | #define __LINUX_STACKTRACE_H | 2 | #define __LINUX_STACKTRACE_H |
3 | 3 | ||
4 | struct task_struct; | ||
5 | |||
4 | #ifdef CONFIG_STACKTRACE | 6 | #ifdef CONFIG_STACKTRACE |
5 | struct stack_trace { | 7 | struct stack_trace { |
6 | unsigned int nr_entries, max_entries; | 8 | unsigned int nr_entries, max_entries; |
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h index f1cb0ba6d715..faf1519b5adc 100644 --- a/include/linux/stop_machine.h +++ b/include/linux/stop_machine.h | |||
@@ -3,16 +3,13 @@ | |||
3 | /* "Bogolock": stop the entire machine, disable interrupts. This is a | 3 | /* "Bogolock": stop the entire machine, disable interrupts. This is a |
4 | very heavy lock, which is equivalent to grabbing every spinlock | 4 | very heavy lock, which is equivalent to grabbing every spinlock |
5 | (and more). So the "read" side to such a lock is anything which | 5 | (and more). So the "read" side to such a lock is anything which |
6 | diables preeempt. */ | 6 | disables preeempt. */ |
7 | #include <linux/cpu.h> | 7 | #include <linux/cpu.h> |
8 | #include <linux/cpumask.h> | 8 | #include <linux/cpumask.h> |
9 | #include <asm/system.h> | 9 | #include <asm/system.h> |
10 | 10 | ||
11 | #if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) | 11 | #if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) |
12 | 12 | ||
13 | /* Deprecated, but useful for transition. */ | ||
14 | #define ALL_CPUS ~0U | ||
15 | |||
16 | /** | 13 | /** |
17 | * stop_machine: freeze the machine on all CPUs and run this function | 14 | * stop_machine: freeze the machine on all CPUs and run this function |
18 | * @fn: the function to run | 15 | * @fn: the function to run |
@@ -50,18 +47,4 @@ static inline int stop_machine(int (*fn)(void *), void *data, | |||
50 | return ret; | 47 | return ret; |
51 | } | 48 | } |
52 | #endif /* CONFIG_SMP */ | 49 | #endif /* CONFIG_SMP */ |
53 | |||
54 | static inline int __deprecated stop_machine_run(int (*fn)(void *), void *data, | ||
55 | unsigned int cpu) | ||
56 | { | ||
57 | /* If they don't care which cpu fn runs on, just pick one. */ | ||
58 | if (cpu == NR_CPUS) | ||
59 | return stop_machine(fn, data, NULL); | ||
60 | else if (cpu == ~0U) | ||
61 | return stop_machine(fn, data, &cpu_possible_map); | ||
62 | else { | ||
63 | cpumask_t cpus = cpumask_of_cpu(cpu); | ||
64 | return stop_machine(fn, data, &cpus); | ||
65 | } | ||
66 | } | ||
67 | #endif /* _LINUX_STOP_MACHINE */ | 50 | #endif /* _LINUX_STOP_MACHINE */ |
diff --git a/include/linux/sunrpc/svc_rdma.h b/include/linux/sunrpc/svc_rdma.h index ef2e3a20bf3b..dc05b54bd3a3 100644 --- a/include/linux/sunrpc/svc_rdma.h +++ b/include/linux/sunrpc/svc_rdma.h | |||
@@ -143,7 +143,6 @@ struct svcxprt_rdma { | |||
143 | unsigned long sc_flags; | 143 | unsigned long sc_flags; |
144 | struct list_head sc_dto_q; /* DTO tasklet I/O pending Q */ | 144 | struct list_head sc_dto_q; /* DTO tasklet I/O pending Q */ |
145 | struct list_head sc_read_complete_q; | 145 | struct list_head sc_read_complete_q; |
146 | spinlock_t sc_read_complete_lock; | ||
147 | struct work_struct sc_work; | 146 | struct work_struct sc_work; |
148 | }; | 147 | }; |
149 | /* sc_flags */ | 148 | /* sc_flags */ |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index c63435095970..2ce8207686e2 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -217,11 +217,11 @@ struct platform_hibernation_ops { | |||
217 | #ifdef CONFIG_HIBERNATION | 217 | #ifdef CONFIG_HIBERNATION |
218 | /* kernel/power/snapshot.c */ | 218 | /* kernel/power/snapshot.c */ |
219 | extern void __register_nosave_region(unsigned long b, unsigned long e, int km); | 219 | extern void __register_nosave_region(unsigned long b, unsigned long e, int km); |
220 | static inline void register_nosave_region(unsigned long b, unsigned long e) | 220 | static inline void __init register_nosave_region(unsigned long b, unsigned long e) |
221 | { | 221 | { |
222 | __register_nosave_region(b, e, 0); | 222 | __register_nosave_region(b, e, 0); |
223 | } | 223 | } |
224 | static inline void register_nosave_region_late(unsigned long b, unsigned long e) | 224 | static inline void __init register_nosave_region_late(unsigned long b, unsigned long e) |
225 | { | 225 | { |
226 | __register_nosave_region(b, e, 1); | 226 | __register_nosave_region(b, e, 1); |
227 | } | 227 | } |
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/tracehook.h b/include/linux/tracehook.h index b48d81969574..6186a789d6c7 100644 --- a/include/linux/tracehook.h +++ b/include/linux/tracehook.h | |||
@@ -272,7 +272,7 @@ static inline void tracehook_finish_clone(struct task_struct *child, | |||
272 | * tracehook_report_clone_complete(). This must prevent the child from | 272 | * tracehook_report_clone_complete(). This must prevent the child from |
273 | * self-reaping if tracehook_report_clone_complete() uses the @child | 273 | * self-reaping if tracehook_report_clone_complete() uses the @child |
274 | * pointer; otherwise it might have died and been released by the time | 274 | * pointer; otherwise it might have died and been released by the time |
275 | * tracehook_report_report_clone_complete() is called. | 275 | * tracehook_report_clone_complete() is called. |
276 | * | 276 | * |
277 | * Called with no locks held, but the child cannot run until this returns. | 277 | * Called with no locks held, but the child cannot run until this returns. |
278 | */ | 278 | */ |
diff --git a/include/linux/tty.h b/include/linux/tty.h index e3579cb086e0..0cbec74ec086 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -331,6 +331,8 @@ extern int tty_write_room(struct tty_struct *tty); | |||
331 | extern void tty_driver_flush_buffer(struct tty_struct *tty); | 331 | extern void tty_driver_flush_buffer(struct tty_struct *tty); |
332 | extern void tty_throttle(struct tty_struct *tty); | 332 | extern void tty_throttle(struct tty_struct *tty); |
333 | extern void tty_unthrottle(struct tty_struct *tty); | 333 | extern void tty_unthrottle(struct tty_struct *tty); |
334 | extern int tty_do_resize(struct tty_struct *tty, struct tty_struct *real_tty, | ||
335 | struct winsize *ws); | ||
334 | 336 | ||
335 | extern int is_current_pgrp_orphaned(void); | 337 | extern int is_current_pgrp_orphaned(void); |
336 | extern struct pid *tty_get_pgrp(struct tty_struct *tty); | 338 | extern struct pid *tty_get_pgrp(struct tty_struct *tty); |
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index e1065ac0d922..16d27944c321 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h | |||
@@ -168,6 +168,18 @@ | |||
168 | * | 168 | * |
169 | * Optional: If not provided then the write method is called under | 169 | * Optional: If not provided then the write method is called under |
170 | * the atomic write lock to keep it serialized with the ldisc. | 170 | * the atomic write lock to keep it serialized with the ldisc. |
171 | * | ||
172 | * int (*resize)(struct tty_struct *tty, struct tty_struct *real_tty, | ||
173 | * unsigned int rows, unsigned int cols); | ||
174 | * | ||
175 | * Called when a termios request is issued which changes the | ||
176 | * requested terminal geometry. | ||
177 | * | ||
178 | * Optional: the default action is to update the termios structure | ||
179 | * without error. This is usually the correct behaviour. Drivers should | ||
180 | * not force errors here if they are not resizable objects (eg a serial | ||
181 | * line). See tty_do_resize() if you need to wrap the standard method | ||
182 | * in your own logic - the usual case. | ||
171 | */ | 183 | */ |
172 | 184 | ||
173 | #include <linux/fs.h> | 185 | #include <linux/fs.h> |
@@ -206,6 +218,8 @@ struct tty_operations { | |||
206 | int (*tiocmget)(struct tty_struct *tty, struct file *file); | 218 | int (*tiocmget)(struct tty_struct *tty, struct file *file); |
207 | int (*tiocmset)(struct tty_struct *tty, struct file *file, | 219 | int (*tiocmset)(struct tty_struct *tty, struct file *file, |
208 | unsigned int set, unsigned int clear); | 220 | unsigned int set, unsigned int clear); |
221 | int (*resize)(struct tty_struct *tty, struct tty_struct *real_tty, | ||
222 | struct winsize *ws); | ||
209 | #ifdef CONFIG_CONSOLE_POLL | 223 | #ifdef CONFIG_CONSOLE_POLL |
210 | int (*poll_init)(struct tty_driver *driver, int line, char *options); | 224 | int (*poll_init)(struct tty_driver *driver, int line, char *options); |
211 | int (*poll_get_char)(struct tty_driver *driver, int line); | 225 | int (*poll_get_char)(struct tty_driver *driver, int line); |
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 */ |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index e466bd54a50e..303d93ffd6b2 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -55,13 +55,13 @@ | |||
55 | */ | 55 | */ |
56 | #ifndef __LINUX_VIDEODEV2_H | 56 | #ifndef __LINUX_VIDEODEV2_H |
57 | #define __LINUX_VIDEODEV2_H | 57 | #define __LINUX_VIDEODEV2_H |
58 | |||
58 | #ifdef __KERNEL__ | 59 | #ifdef __KERNEL__ |
59 | #include <linux/time.h> /* need struct timeval */ | 60 | #include <linux/time.h> /* need struct timeval */ |
60 | #include <linux/compiler.h> /* need __user */ | ||
61 | #else | 61 | #else |
62 | #define __user | ||
63 | #include <sys/time.h> | 62 | #include <sys/time.h> |
64 | #endif | 63 | #endif |
64 | #include <linux/compiler.h> | ||
65 | #include <linux/ioctl.h> | 65 | #include <linux/ioctl.h> |
66 | #include <linux/types.h> | 66 | #include <linux/types.h> |
67 | 67 | ||
@@ -334,6 +334,8 @@ struct v4l2_pix_format { | |||
334 | #define V4L2_PIX_FMT_SPCA508 v4l2_fourcc('S', '5', '0', '8') /* YUVY per line */ | 334 | #define V4L2_PIX_FMT_SPCA508 v4l2_fourcc('S', '5', '0', '8') /* YUVY per line */ |
335 | #define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */ | 335 | #define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */ |
336 | #define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */ | 336 | #define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */ |
337 | #define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ | ||
338 | #define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */ | ||
337 | 339 | ||
338 | /* | 340 | /* |
339 | * F O R M A T E N U M E R A T I O N | 341 | * F O R M A T E N U M E R A T I O N |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index 364789aae9f3..328eb4022727 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -4,9 +4,9 @@ | |||
4 | #include <linux/spinlock.h> | 4 | #include <linux/spinlock.h> |
5 | #include <asm/page.h> /* pgprot_t */ | 5 | #include <asm/page.h> /* pgprot_t */ |
6 | 6 | ||
7 | struct vm_area_struct; | 7 | struct vm_area_struct; /* vma defining user mapping in mm_types.h */ |
8 | 8 | ||
9 | /* bits in vm_struct->flags */ | 9 | /* bits in flags of vmalloc's vm_struct below */ |
10 | #define VM_IOREMAP 0x00000001 /* ioremap() and friends */ | 10 | #define VM_IOREMAP 0x00000001 /* ioremap() and friends */ |
11 | #define VM_ALLOC 0x00000002 /* vmalloc() */ | 11 | #define VM_ALLOC 0x00000002 /* vmalloc() */ |
12 | #define VM_MAP 0x00000004 /* vmap()ed pages */ | 12 | #define VM_MAP 0x00000004 /* vmap()ed pages */ |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index 1c78d56c57e5..1cbd0a7db4e6 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
@@ -35,7 +35,6 @@ extern int fg_console, last_console, want_console; | |||
35 | int vc_allocate(unsigned int console); | 35 | int vc_allocate(unsigned int console); |
36 | int vc_cons_allocated(unsigned int console); | 36 | int vc_cons_allocated(unsigned int console); |
37 | int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines); | 37 | int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines); |
38 | int vc_lock_resize(struct vc_data *vc, unsigned int cols, unsigned int lines); | ||
39 | void vc_deallocate(unsigned int console); | 38 | void vc_deallocate(unsigned int console); |
40 | void reset_palette(struct vc_data *vc); | 39 | void reset_palette(struct vc_data *vc); |
41 | void do_blank_screen(int entering_gfx); | 40 | void do_blank_screen(int entering_gfx); |