diff options
Diffstat (limited to 'include/linux')
155 files changed, 2911 insertions, 838 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index aa80d7a2dee..e2ea0b2159c 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
| @@ -43,6 +43,7 @@ header-y += blkpg.h | |||
| 43 | header-y += bpqether.h | 43 | header-y += bpqether.h |
| 44 | header-y += bsg.h | 44 | header-y += bsg.h |
| 45 | header-y += can.h | 45 | header-y += can.h |
| 46 | header-y += cciss_defs.h | ||
| 46 | header-y += cdk.h | 47 | header-y += cdk.h |
| 47 | header-y += chio.h | 48 | header-y += chio.h |
| 48 | header-y += coda_psdev.h | 49 | header-y += coda_psdev.h |
| @@ -363,6 +364,7 @@ unifdef-y += uio.h | |||
| 363 | unifdef-y += unistd.h | 364 | unifdef-y += unistd.h |
| 364 | unifdef-y += usbdevice_fs.h | 365 | unifdef-y += usbdevice_fs.h |
| 365 | unifdef-y += utsname.h | 366 | unifdef-y += utsname.h |
| 367 | unifdef-y += vhost.h | ||
| 366 | unifdef-y += videodev2.h | 368 | unifdef-y += videodev2.h |
| 367 | unifdef-y += videodev.h | 369 | unifdef-y += videodev.h |
| 368 | unifdef-y += virtio_config.h | 370 | unifdef-y += virtio_config.h |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index ce945d4845f..b926afe8c03 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
| @@ -80,7 +80,7 @@ char * __acpi_map_table (unsigned long phys_addr, unsigned long size); | |||
| 80 | void __acpi_unmap_table(char *map, unsigned long size); | 80 | void __acpi_unmap_table(char *map, unsigned long size); |
| 81 | int early_acpi_boot_init(void); | 81 | int early_acpi_boot_init(void); |
| 82 | int acpi_boot_init (void); | 82 | int acpi_boot_init (void); |
| 83 | int acpi_boot_table_init (void); | 83 | void acpi_boot_table_init (void); |
| 84 | int acpi_mps_check (void); | 84 | int acpi_mps_check (void); |
| 85 | int acpi_numa_init (void); | 85 | int acpi_numa_init (void); |
| 86 | 86 | ||
| @@ -251,6 +251,7 @@ int acpi_check_mem_region(resource_size_t start, resource_size_t n, | |||
| 251 | void __init acpi_no_s4_hw_signature(void); | 251 | void __init acpi_no_s4_hw_signature(void); |
| 252 | void __init acpi_old_suspend_ordering(void); | 252 | void __init acpi_old_suspend_ordering(void); |
| 253 | void __init acpi_s4_no_nvs(void); | 253 | void __init acpi_s4_no_nvs(void); |
| 254 | void __init acpi_set_sci_en_on_resume(void); | ||
| 254 | #endif /* CONFIG_PM_SLEEP */ | 255 | #endif /* CONFIG_PM_SLEEP */ |
| 255 | 256 | ||
| 256 | struct acpi_osc_context { | 257 | struct acpi_osc_context { |
| @@ -320,9 +321,9 @@ static inline int acpi_boot_init(void) | |||
| 320 | return 0; | 321 | return 0; |
| 321 | } | 322 | } |
| 322 | 323 | ||
| 323 | static inline int acpi_boot_table_init(void) | 324 | static inline void acpi_boot_table_init(void) |
| 324 | { | 325 | { |
| 325 | return 0; | 326 | return; |
| 326 | } | 327 | } |
| 327 | 328 | ||
| 328 | static inline int acpi_mps_check(void) | 329 | static inline int acpi_mps_check(void) |
diff --git a/include/linux/amba/bus.h b/include/linux/amba/bus.h index ab94335b4bb..6816be6c3f7 100644 --- a/include/linux/amba/bus.h +++ b/include/linux/amba/bus.h | |||
| @@ -1,5 +1,9 @@ | |||
| 1 | /* | 1 | /* |
| 2 | * linux/include/asm-arm/hardware/amba.h | 2 | * linux/include/amba/bus.h |
| 3 | * | ||
| 4 | * This device type deals with ARM PrimeCells and anything else that | ||
| 5 | * presents a proper CID (0xB105F00D) at the end of the I/O register | ||
| 6 | * region or that is derived from a PrimeCell. | ||
| 3 | * | 7 | * |
| 4 | * Copyright (C) 2003 Deep Blue Solutions Ltd, All Rights Reserved. | 8 | * Copyright (C) 2003 Deep Blue Solutions Ltd, All Rights Reserved. |
| 5 | * | 9 | * |
diff --git a/include/linux/ata.h b/include/linux/ata.h index 38a6948ce0c..b4c85e2adef 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
| @@ -647,9 +647,9 @@ static inline int ata_id_has_large_logical_sectors(const u16 *id) | |||
| 647 | return id[ATA_ID_SECTOR_SIZE] & (1 << 13); | 647 | return id[ATA_ID_SECTOR_SIZE] & (1 << 13); |
| 648 | } | 648 | } |
| 649 | 649 | ||
| 650 | static inline u8 ata_id_logical_per_physical_sectors(const u16 *id) | 650 | static inline u16 ata_id_logical_per_physical_sectors(const u16 *id) |
| 651 | { | 651 | { |
| 652 | return id[ATA_ID_SECTOR_SIZE] & 0xf; | 652 | return 1 << (id[ATA_ID_SECTOR_SIZE] & 0xf); |
| 653 | } | 653 | } |
| 654 | 654 | ||
| 655 | static inline int ata_id_has_lba48(const u16 *id) | 655 | static inline int ata_id_has_lba48(const u16 *id) |
| @@ -841,7 +841,8 @@ static inline int ata_id_current_chs_valid(const u16 *id) | |||
| 841 | 841 | ||
| 842 | static inline int ata_id_is_cfa(const u16 *id) | 842 | static inline int ata_id_is_cfa(const u16 *id) |
| 843 | { | 843 | { |
| 844 | if (id[ATA_ID_CONFIG] == 0x848A) /* Traditional CF */ | 844 | if ((id[ATA_ID_CONFIG] == 0x848A) || /* Traditional CF */ |
| 845 | (id[ATA_ID_CONFIG] == 0x844A)) /* Delkin Devices CF */ | ||
| 845 | return 1; | 846 | return 1; |
| 846 | /* | 847 | /* |
| 847 | * CF specs don't require specific value in the word 0 anymore and yet | 848 | * CF specs don't require specific value in the word 0 anymore and yet |
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h index cd4349bdc34..89c6249fc56 100644 --- a/include/linux/binfmts.h +++ b/include/linux/binfmts.h | |||
| @@ -109,6 +109,7 @@ extern int prepare_binprm(struct linux_binprm *); | |||
| 109 | extern int __must_check remove_arg_zero(struct linux_binprm *); | 109 | extern int __must_check remove_arg_zero(struct linux_binprm *); |
| 110 | extern int search_binary_handler(struct linux_binprm *,struct pt_regs *); | 110 | extern int search_binary_handler(struct linux_binprm *,struct pt_regs *); |
| 111 | extern int flush_old_exec(struct linux_binprm * bprm); | 111 | extern int flush_old_exec(struct linux_binprm * bprm); |
| 112 | extern void setup_new_exec(struct linux_binprm * bprm); | ||
| 112 | 113 | ||
| 113 | extern int suid_dumpable; | 114 | extern int suid_dumpable; |
| 114 | #define SUID_DUMP_DISABLE 0 /* No setuid dumping */ | 115 | #define SUID_DUMP_DISABLE 0 /* No setuid dumping */ |
diff --git a/include/linux/bitops.h b/include/linux/bitops.h index c05a29cb9bb..25b8b2f33ae 100644 --- a/include/linux/bitops.h +++ b/include/linux/bitops.h | |||
| @@ -25,7 +25,7 @@ | |||
| 25 | static __inline__ int get_bitmask_order(unsigned int count) | 25 | static __inline__ int get_bitmask_order(unsigned int count) |
| 26 | { | 26 | { |
| 27 | int order; | 27 | int order; |
| 28 | 28 | ||
| 29 | order = fls(count); | 29 | order = fls(count); |
| 30 | return order; /* We could be slightly more clever with -1 here... */ | 30 | return order; /* We could be slightly more clever with -1 here... */ |
| 31 | } | 31 | } |
| @@ -33,7 +33,7 @@ static __inline__ int get_bitmask_order(unsigned int count) | |||
| 33 | static __inline__ int get_count_order(unsigned int count) | 33 | static __inline__ int get_count_order(unsigned int count) |
| 34 | { | 34 | { |
| 35 | int order; | 35 | int order; |
| 36 | 36 | ||
| 37 | order = fls(count) - 1; | 37 | order = fls(count) - 1; |
| 38 | if (count & (count - 1)) | 38 | if (count & (count - 1)) |
| 39 | order++; | 39 | order++; |
| @@ -45,6 +45,31 @@ static inline unsigned long hweight_long(unsigned long w) | |||
| 45 | return sizeof(w) == 4 ? hweight32(w) : hweight64(w); | 45 | return sizeof(w) == 4 ? hweight32(w) : hweight64(w); |
| 46 | } | 46 | } |
| 47 | 47 | ||
| 48 | /* | ||
| 49 | * Clearly slow versions of the hweightN() functions, their benefit is | ||
| 50 | * of course compile time evaluation of constant arguments. | ||
| 51 | */ | ||
| 52 | #define HWEIGHT8(w) \ | ||
| 53 | ( BUILD_BUG_ON_ZERO(!__builtin_constant_p(w)) + \ | ||
| 54 | (!!((w) & (1ULL << 0))) + \ | ||
| 55 | (!!((w) & (1ULL << 1))) + \ | ||
| 56 | (!!((w) & (1ULL << 2))) + \ | ||
| 57 | (!!((w) & (1ULL << 3))) + \ | ||
| 58 | (!!((w) & (1ULL << 4))) + \ | ||
| 59 | (!!((w) & (1ULL << 5))) + \ | ||
| 60 | (!!((w) & (1ULL << 6))) + \ | ||
| 61 | (!!((w) & (1ULL << 7))) ) | ||
| 62 | |||
| 63 | #define HWEIGHT16(w) (HWEIGHT8(w) + HWEIGHT8((w) >> 8)) | ||
| 64 | #define HWEIGHT32(w) (HWEIGHT16(w) + HWEIGHT16((w) >> 16)) | ||
| 65 | #define HWEIGHT64(w) (HWEIGHT32(w) + HWEIGHT32((w) >> 32)) | ||
| 66 | |||
| 67 | /* | ||
| 68 | * Type invariant version that simply casts things to the | ||
| 69 | * largest type. | ||
| 70 | */ | ||
| 71 | #define HWEIGHT(w) HWEIGHT64((u64)(w)) | ||
| 72 | |||
| 48 | /** | 73 | /** |
| 49 | * rol32 - rotate a 32-bit value left | 74 | * rol32 - rotate a 32-bit value left |
| 50 | * @word: value to rotate | 75 | * @word: value to rotate |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 784a919aa0d..ebd22dbed86 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
| @@ -316,8 +316,7 @@ struct queue_limits { | |||
| 316 | unsigned int discard_alignment; | 316 | unsigned int discard_alignment; |
| 317 | 317 | ||
| 318 | unsigned short logical_block_size; | 318 | unsigned short logical_block_size; |
| 319 | unsigned short max_hw_segments; | 319 | unsigned short max_segments; |
| 320 | unsigned short max_phys_segments; | ||
| 321 | 320 | ||
| 322 | unsigned char misaligned; | 321 | unsigned char misaligned; |
| 323 | unsigned char discard_misaligned; | 322 | unsigned char discard_misaligned; |
| @@ -461,8 +460,8 @@ struct request_queue | |||
| 461 | #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ | 460 | #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ |
| 462 | #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ | 461 | #define QUEUE_FLAG_VIRT QUEUE_FLAG_NONROT /* paravirt device */ |
| 463 | #define QUEUE_FLAG_IO_STAT 15 /* do IO stats */ | 462 | #define QUEUE_FLAG_IO_STAT 15 /* do IO stats */ |
| 464 | #define QUEUE_FLAG_CQ 16 /* hardware does queuing */ | 463 | #define QUEUE_FLAG_DISCARD 16 /* supports DISCARD */ |
| 465 | #define QUEUE_FLAG_DISCARD 17 /* supports DISCARD */ | 464 | #define QUEUE_FLAG_NOXMERGES 17 /* No extended merges */ |
| 466 | 465 | ||
| 467 | #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ | 466 | #define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ |
| 468 | (1 << QUEUE_FLAG_CLUSTER) | \ | 467 | (1 << QUEUE_FLAG_CLUSTER) | \ |
| @@ -586,9 +585,10 @@ enum { | |||
| 586 | 585 | ||
| 587 | #define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) | 586 | #define blk_queue_plugged(q) test_bit(QUEUE_FLAG_PLUGGED, &(q)->queue_flags) |
| 588 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) | 587 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) |
| 589 | #define blk_queue_queuing(q) test_bit(QUEUE_FLAG_CQ, &(q)->queue_flags) | ||
| 590 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) | 588 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) |
| 591 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) | 589 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) |
| 590 | #define blk_queue_noxmerges(q) \ | ||
| 591 | test_bit(QUEUE_FLAG_NOXMERGES, &(q)->queue_flags) | ||
| 592 | #define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags) | 592 | #define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags) |
| 593 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags) | 593 | #define blk_queue_io_stat(q) test_bit(QUEUE_FLAG_IO_STAT, &(q)->queue_flags) |
| 594 | #define blk_queue_flushing(q) ((q)->ordseq) | 594 | #define blk_queue_flushing(q) ((q)->ordseq) |
| @@ -845,7 +845,6 @@ static inline struct request_queue *bdev_get_queue(struct block_device *bdev) | |||
| 845 | * blk_rq_err_bytes() : bytes left till the next error boundary | 845 | * blk_rq_err_bytes() : bytes left till the next error boundary |
| 846 | * blk_rq_sectors() : sectors left in the entire request | 846 | * blk_rq_sectors() : sectors left in the entire request |
| 847 | * blk_rq_cur_sectors() : sectors left in the current segment | 847 | * blk_rq_cur_sectors() : sectors left in the current segment |
| 848 | * blk_rq_err_sectors() : sectors left till the next error boundary | ||
| 849 | */ | 848 | */ |
| 850 | static inline sector_t blk_rq_pos(const struct request *rq) | 849 | static inline sector_t blk_rq_pos(const struct request *rq) |
| 851 | { | 850 | { |
| @@ -874,11 +873,6 @@ static inline unsigned int blk_rq_cur_sectors(const struct request *rq) | |||
| 874 | return blk_rq_cur_bytes(rq) >> 9; | 873 | return blk_rq_cur_bytes(rq) >> 9; |
| 875 | } | 874 | } |
| 876 | 875 | ||
| 877 | static inline unsigned int blk_rq_err_sectors(const struct request *rq) | ||
| 878 | { | ||
| 879 | return blk_rq_err_bytes(rq) >> 9; | ||
| 880 | } | ||
| 881 | |||
| 882 | /* | 876 | /* |
| 883 | * Request issue related functions. | 877 | * Request issue related functions. |
| 884 | */ | 878 | */ |
| @@ -926,10 +920,27 @@ extern struct request_queue *blk_init_queue(request_fn_proc *, spinlock_t *); | |||
| 926 | extern void blk_cleanup_queue(struct request_queue *); | 920 | extern void blk_cleanup_queue(struct request_queue *); |
| 927 | extern void blk_queue_make_request(struct request_queue *, make_request_fn *); | 921 | extern void blk_queue_make_request(struct request_queue *, make_request_fn *); |
| 928 | extern void blk_queue_bounce_limit(struct request_queue *, u64); | 922 | extern void blk_queue_bounce_limit(struct request_queue *, u64); |
| 929 | extern void blk_queue_max_sectors(struct request_queue *, unsigned int); | ||
| 930 | extern void blk_queue_max_hw_sectors(struct request_queue *, unsigned int); | 923 | extern void blk_queue_max_hw_sectors(struct request_queue *, unsigned int); |
| 931 | extern void blk_queue_max_phys_segments(struct request_queue *, unsigned short); | 924 | |
| 932 | extern void blk_queue_max_hw_segments(struct request_queue *, unsigned short); | 925 | /* Temporary compatibility wrapper */ |
| 926 | static inline void blk_queue_max_sectors(struct request_queue *q, unsigned int max) | ||
| 927 | { | ||
| 928 | blk_queue_max_hw_sectors(q, max); | ||
| 929 | } | ||
| 930 | |||
| 931 | extern void blk_queue_max_segments(struct request_queue *, unsigned short); | ||
| 932 | |||
| 933 | static inline void blk_queue_max_phys_segments(struct request_queue *q, unsigned short max) | ||
| 934 | { | ||
| 935 | blk_queue_max_segments(q, max); | ||
| 936 | } | ||
| 937 | |||
| 938 | static inline void blk_queue_max_hw_segments(struct request_queue *q, unsigned short max) | ||
| 939 | { | ||
| 940 | blk_queue_max_segments(q, max); | ||
| 941 | } | ||
| 942 | |||
| 943 | |||
| 933 | extern void blk_queue_max_segment_size(struct request_queue *, unsigned int); | 944 | extern void blk_queue_max_segment_size(struct request_queue *, unsigned int); |
| 934 | extern void blk_queue_max_discard_sectors(struct request_queue *q, | 945 | extern void blk_queue_max_discard_sectors(struct request_queue *q, |
| 935 | unsigned int max_discard_sectors); | 946 | unsigned int max_discard_sectors); |
| @@ -944,6 +955,8 @@ extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt); | |||
| 944 | extern void blk_set_default_limits(struct queue_limits *lim); | 955 | extern void blk_set_default_limits(struct queue_limits *lim); |
| 945 | extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, | 956 | extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, |
| 946 | sector_t offset); | 957 | sector_t offset); |
| 958 | extern int bdev_stack_limits(struct queue_limits *t, struct block_device *bdev, | ||
| 959 | sector_t offset); | ||
| 947 | extern void disk_stack_limits(struct gendisk *disk, struct block_device *bdev, | 960 | extern void disk_stack_limits(struct gendisk *disk, struct block_device *bdev, |
| 948 | sector_t offset); | 961 | sector_t offset); |
| 949 | extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b); | 962 | extern void blk_queue_stack_limits(struct request_queue *t, struct request_queue *b); |
| @@ -1020,11 +1033,15 @@ extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); | |||
| 1020 | #define MAX_PHYS_SEGMENTS 128 | 1033 | #define MAX_PHYS_SEGMENTS 128 |
| 1021 | #define MAX_HW_SEGMENTS 128 | 1034 | #define MAX_HW_SEGMENTS 128 |
| 1022 | #define SAFE_MAX_SECTORS 255 | 1035 | #define SAFE_MAX_SECTORS 255 |
| 1023 | #define BLK_DEF_MAX_SECTORS 1024 | ||
| 1024 | |||
| 1025 | #define MAX_SEGMENT_SIZE 65536 | 1036 | #define MAX_SEGMENT_SIZE 65536 |
| 1026 | 1037 | ||
| 1027 | #define BLK_SEG_BOUNDARY_MASK 0xFFFFFFFFUL | 1038 | enum blk_default_limits { |
| 1039 | BLK_MAX_SEGMENTS = 128, | ||
| 1040 | BLK_SAFE_MAX_SECTORS = 255, | ||
| 1041 | BLK_DEF_MAX_SECTORS = 1024, | ||
| 1042 | BLK_MAX_SEGMENT_SIZE = 65536, | ||
| 1043 | BLK_SEG_BOUNDARY_MASK = 0xFFFFFFFFUL, | ||
| 1044 | }; | ||
| 1028 | 1045 | ||
| 1029 | #define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist) | 1046 | #define blkdev_entry_to_request(entry) list_entry((entry), struct request, queuelist) |
| 1030 | 1047 | ||
| @@ -1048,14 +1065,9 @@ static inline unsigned int queue_max_hw_sectors(struct request_queue *q) | |||
| 1048 | return q->limits.max_hw_sectors; | 1065 | return q->limits.max_hw_sectors; |
| 1049 | } | 1066 | } |
| 1050 | 1067 | ||
| 1051 | static inline unsigned short queue_max_hw_segments(struct request_queue *q) | 1068 | static inline unsigned short queue_max_segments(struct request_queue *q) |
| 1052 | { | 1069 | { |
| 1053 | return q->limits.max_hw_segments; | 1070 | return q->limits.max_segments; |
| 1054 | } | ||
| 1055 | |||
| 1056 | static inline unsigned short queue_max_phys_segments(struct request_queue *q) | ||
| 1057 | { | ||
| 1058 | return q->limits.max_phys_segments; | ||
| 1059 | } | 1071 | } |
| 1060 | 1072 | ||
| 1061 | static inline unsigned int queue_max_segment_size(struct request_queue *q) | 1073 | static inline unsigned int queue_max_segment_size(struct request_queue *q) |
| @@ -1116,11 +1128,13 @@ static inline int queue_alignment_offset(struct request_queue *q) | |||
| 1116 | return q->limits.alignment_offset; | 1128 | return q->limits.alignment_offset; |
| 1117 | } | 1129 | } |
| 1118 | 1130 | ||
| 1119 | static inline int queue_sector_alignment_offset(struct request_queue *q, | 1131 | static inline int queue_limit_alignment_offset(struct queue_limits *lim, sector_t sector) |
| 1120 | sector_t sector) | ||
| 1121 | { | 1132 | { |
| 1122 | return ((sector << 9) - q->limits.alignment_offset) | 1133 | unsigned int granularity = max(lim->physical_block_size, lim->io_min); |
| 1123 | & (q->limits.io_min - 1); | 1134 | unsigned int alignment = (sector << 9) & (granularity - 1); |
| 1135 | |||
| 1136 | return (granularity + lim->alignment_offset - alignment) | ||
| 1137 | & (granularity - 1); | ||
| 1124 | } | 1138 | } |
| 1125 | 1139 | ||
| 1126 | static inline int bdev_alignment_offset(struct block_device *bdev) | 1140 | static inline int bdev_alignment_offset(struct block_device *bdev) |
| @@ -1144,11 +1158,12 @@ static inline int queue_discard_alignment(struct request_queue *q) | |||
| 1144 | return q->limits.discard_alignment; | 1158 | return q->limits.discard_alignment; |
| 1145 | } | 1159 | } |
| 1146 | 1160 | ||
| 1147 | static inline int queue_sector_discard_alignment(struct request_queue *q, | 1161 | static inline int queue_limit_discard_alignment(struct queue_limits *lim, sector_t sector) |
| 1148 | sector_t sector) | ||
| 1149 | { | 1162 | { |
| 1150 | return ((sector << 9) - q->limits.discard_alignment) | 1163 | unsigned int alignment = (sector << 9) & (lim->discard_granularity - 1); |
| 1151 | & (q->limits.discard_granularity - 1); | 1164 | |
| 1165 | return (lim->discard_granularity + lim->discard_alignment - alignment) | ||
| 1166 | & (lim->discard_granularity - 1); | ||
| 1152 | } | 1167 | } |
| 1153 | 1168 | ||
| 1154 | static inline unsigned int queue_discard_zeroes_data(struct request_queue *q) | 1169 | static inline unsigned int queue_discard_zeroes_data(struct request_queue *q) |
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h index 2b31b91f587..7f437ca1ed4 100644 --- a/include/linux/brcmphy.h +++ b/include/linux/brcmphy.h | |||
| @@ -1,3 +1,14 @@ | |||
| 1 | #define PHY_ID_BCM50610 0x0143bd60 | ||
| 2 | #define PHY_ID_BCM50610M 0x0143bd70 | ||
| 3 | #define PHY_ID_BCMAC131 0x0143bc70 | ||
| 4 | #define PHY_ID_BCM57780 0x03625d90 | ||
| 5 | |||
| 6 | #define PHY_BCM_OUI_MASK 0xfffffc00 | ||
| 7 | #define PHY_BCM_OUI_1 0x00206000 | ||
| 8 | #define PHY_BCM_OUI_2 0x0143bc00 | ||
| 9 | #define PHY_BCM_OUI_3 0x03625c00 | ||
| 10 | |||
| 11 | |||
| 1 | #define PHY_BCM_FLAGS_MODE_COPPER 0x00000001 | 12 | #define PHY_BCM_FLAGS_MODE_COPPER 0x00000001 |
| 2 | #define PHY_BCM_FLAGS_MODE_1000BX 0x00000002 | 13 | #define PHY_BCM_FLAGS_MODE_1000BX 0x00000002 |
| 3 | #define PHY_BCM_FLAGS_INTF_SGMII 0x00000010 | 14 | #define PHY_BCM_FLAGS_INTF_SGMII 0x00000010 |
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h index 3db7767d2a1..6e5a7f00223 100644 --- a/include/linux/can/dev.h +++ b/include/linux/can/dev.h | |||
| @@ -38,6 +38,7 @@ struct can_priv { | |||
| 38 | 38 | ||
| 39 | enum can_state state; | 39 | enum can_state state; |
| 40 | u32 ctrlmode; | 40 | u32 ctrlmode; |
| 41 | u32 ctrlmode_supported; | ||
| 41 | 42 | ||
| 42 | int restart_ms; | 43 | int restart_ms; |
| 43 | struct timer_list restart_timer; | 44 | struct timer_list restart_timer; |
| @@ -46,6 +47,8 @@ struct can_priv { | |||
| 46 | int (*do_set_mode)(struct net_device *dev, enum can_mode mode); | 47 | int (*do_set_mode)(struct net_device *dev, enum can_mode mode); |
| 47 | int (*do_get_state)(const struct net_device *dev, | 48 | int (*do_get_state)(const struct net_device *dev, |
| 48 | enum can_state *state); | 49 | enum can_state *state); |
| 50 | int (*do_get_berr_counter)(const struct net_device *dev, | ||
| 51 | struct can_berr_counter *bec); | ||
| 49 | 52 | ||
| 50 | unsigned int echo_skb_max; | 53 | unsigned int echo_skb_max; |
| 51 | struct sk_buff **echo_skb; | 54 | struct sk_buff **echo_skb; |
| @@ -60,6 +63,21 @@ struct can_priv { | |||
| 60 | */ | 63 | */ |
| 61 | #define get_can_dlc(i) (min_t(__u8, (i), 8)) | 64 | #define get_can_dlc(i) (min_t(__u8, (i), 8)) |
| 62 | 65 | ||
| 66 | /* Drop a given socketbuffer if it does not contain a valid CAN frame. */ | ||
| 67 | static inline int can_dropped_invalid_skb(struct net_device *dev, | ||
| 68 | struct sk_buff *skb) | ||
| 69 | { | ||
| 70 | const struct can_frame *cf = (struct can_frame *)skb->data; | ||
| 71 | |||
| 72 | if (unlikely(skb->len != sizeof(*cf) || cf->can_dlc > 8)) { | ||
| 73 | kfree_skb(skb); | ||
| 74 | dev->stats.tx_dropped++; | ||
| 75 | return 1; | ||
| 76 | } | ||
| 77 | |||
| 78 | return 0; | ||
| 79 | } | ||
| 80 | |||
| 63 | struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); | 81 | struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); |
| 64 | void free_candev(struct net_device *dev); | 82 | void free_candev(struct net_device *dev); |
| 65 | 83 | ||
diff --git a/include/linux/can/netlink.h b/include/linux/can/netlink.h index 9ecbb7871c0..3250de935e1 100644 --- a/include/linux/can/netlink.h +++ b/include/linux/can/netlink.h | |||
| @@ -70,6 +70,14 @@ enum can_state { | |||
| 70 | }; | 70 | }; |
| 71 | 71 | ||
| 72 | /* | 72 | /* |
| 73 | * CAN bus error counters | ||
| 74 | */ | ||
| 75 | struct can_berr_counter { | ||
| 76 | __u16 txerr; | ||
| 77 | __u16 rxerr; | ||
| 78 | }; | ||
| 79 | |||
| 80 | /* | ||
| 73 | * CAN controller mode | 81 | * CAN controller mode |
| 74 | */ | 82 | */ |
| 75 | struct can_ctrlmode { | 83 | struct can_ctrlmode { |
| @@ -77,9 +85,11 @@ struct can_ctrlmode { | |||
| 77 | __u32 flags; | 85 | __u32 flags; |
| 78 | }; | 86 | }; |
| 79 | 87 | ||
| 80 | #define CAN_CTRLMODE_LOOPBACK 0x1 /* Loopback mode */ | 88 | #define CAN_CTRLMODE_LOOPBACK 0x01 /* Loopback mode */ |
| 81 | #define CAN_CTRLMODE_LISTENONLY 0x2 /* Listen-only mode */ | 89 | #define CAN_CTRLMODE_LISTENONLY 0x02 /* Listen-only mode */ |
| 82 | #define CAN_CTRLMODE_3_SAMPLES 0x4 /* Triple sampling mode */ | 90 | #define CAN_CTRLMODE_3_SAMPLES 0x04 /* Triple sampling mode */ |
| 91 | #define CAN_CTRLMODE_ONE_SHOT 0x08 /* One-Shot mode */ | ||
| 92 | #define CAN_CTRLMODE_BERR_REPORTING 0x10 /* Bus-error reporting */ | ||
| 83 | 93 | ||
| 84 | /* | 94 | /* |
| 85 | * CAN device statistics | 95 | * CAN device statistics |
| @@ -105,6 +115,7 @@ enum { | |||
| 105 | IFLA_CAN_CTRLMODE, | 115 | IFLA_CAN_CTRLMODE, |
| 106 | IFLA_CAN_RESTART_MS, | 116 | IFLA_CAN_RESTART_MS, |
| 107 | IFLA_CAN_RESTART, | 117 | IFLA_CAN_RESTART, |
| 118 | IFLA_CAN_BERR_COUNTER, | ||
| 108 | __IFLA_CAN_MAX | 119 | __IFLA_CAN_MAX |
| 109 | }; | 120 | }; |
| 110 | 121 | ||
diff --git a/include/linux/can/platform/ti_hecc.h b/include/linux/can/platform/ti_hecc.h index 4688c7bb1bd..af17cb3f7a8 100644 --- a/include/linux/can/platform/ti_hecc.h +++ b/include/linux/can/platform/ti_hecc.h | |||
| @@ -1,3 +1,6 @@ | |||
| 1 | #ifndef __CAN_PLATFORM_TI_HECC_H__ | ||
| 2 | #define __CAN_PLATFORM_TI_HECC_H__ | ||
| 3 | |||
| 1 | /* | 4 | /* |
| 2 | * TI HECC (High End CAN Controller) driver platform header | 5 | * TI HECC (High End CAN Controller) driver platform header |
| 3 | * | 6 | * |
| @@ -23,6 +26,7 @@ | |||
| 23 | * @mbx_offset: Mailbox RAM offset | 26 | * @mbx_offset: Mailbox RAM offset |
| 24 | * @int_line: Interrupt line to use - 0 or 1 | 27 | * @int_line: Interrupt line to use - 0 or 1 |
| 25 | * @version: version for future use | 28 | * @version: version for future use |
| 29 | * @transceiver_switch: platform specific callback fn for transceiver control | ||
| 26 | * | 30 | * |
| 27 | * Platform data structure to get all platform specific settings. | 31 | * Platform data structure to get all platform specific settings. |
| 28 | * this structure also accounts the fact that the IP may have different | 32 | * this structure also accounts the fact that the IP may have different |
| @@ -35,6 +39,6 @@ struct ti_hecc_platform_data { | |||
| 35 | u32 mbx_offset; | 39 | u32 mbx_offset; |
| 36 | u32 int_line; | 40 | u32 int_line; |
| 37 | u32 version; | 41 | u32 version; |
| 42 | void (*transceiver_switch) (int); | ||
| 38 | }; | 43 | }; |
| 39 | 44 | #endif | |
| 40 | |||
diff --git a/include/linux/cciss_defs.h b/include/linux/cciss_defs.h new file mode 100644 index 00000000000..316b670d4e3 --- /dev/null +++ b/include/linux/cciss_defs.h | |||
| @@ -0,0 +1,130 @@ | |||
| 1 | #ifndef CCISS_DEFS_H | ||
| 2 | #define CCISS_DEFS_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | /* general boundary definitions */ | ||
| 7 | #define SENSEINFOBYTES 32 /* note that this value may vary | ||
| 8 | between host implementations */ | ||
| 9 | |||
| 10 | /* Command Status value */ | ||
| 11 | #define CMD_SUCCESS 0x0000 | ||
| 12 | #define CMD_TARGET_STATUS 0x0001 | ||
| 13 | #define CMD_DATA_UNDERRUN 0x0002 | ||
| 14 | #define CMD_DATA_OVERRUN 0x0003 | ||
| 15 | #define CMD_INVALID 0x0004 | ||
| 16 | #define CMD_PROTOCOL_ERR 0x0005 | ||
| 17 | #define CMD_HARDWARE_ERR 0x0006 | ||
| 18 | #define CMD_CONNECTION_LOST 0x0007 | ||
| 19 | #define CMD_ABORTED 0x0008 | ||
| 20 | #define CMD_ABORT_FAILED 0x0009 | ||
| 21 | #define CMD_UNSOLICITED_ABORT 0x000A | ||
| 22 | #define CMD_TIMEOUT 0x000B | ||
| 23 | #define CMD_UNABORTABLE 0x000C | ||
| 24 | |||
| 25 | /* transfer direction */ | ||
| 26 | #define XFER_NONE 0x00 | ||
| 27 | #define XFER_WRITE 0x01 | ||
| 28 | #define XFER_READ 0x02 | ||
| 29 | #define XFER_RSVD 0x03 | ||
| 30 | |||
| 31 | /* task attribute */ | ||
| 32 | #define ATTR_UNTAGGED 0x00 | ||
| 33 | #define ATTR_SIMPLE 0x04 | ||
| 34 | #define ATTR_HEADOFQUEUE 0x05 | ||
| 35 | #define ATTR_ORDERED 0x06 | ||
| 36 | #define ATTR_ACA 0x07 | ||
| 37 | |||
| 38 | /* cdb type */ | ||
| 39 | #define TYPE_CMD 0x00 | ||
| 40 | #define TYPE_MSG 0x01 | ||
| 41 | |||
| 42 | /* Type defs used in the following structs */ | ||
| 43 | #define BYTE __u8 | ||
| 44 | #define WORD __u16 | ||
| 45 | #define HWORD __u16 | ||
| 46 | #define DWORD __u32 | ||
| 47 | |||
| 48 | #define CISS_MAX_LUN 1024 | ||
| 49 | |||
| 50 | #define LEVEL2LUN 1 /* index into Target(x) structure, due to byte swapping */ | ||
| 51 | #define LEVEL3LUN 0 | ||
| 52 | |||
| 53 | #pragma pack(1) | ||
| 54 | |||
| 55 | /* Command List Structure */ | ||
| 56 | typedef union _SCSI3Addr_struct { | ||
| 57 | struct { | ||
| 58 | BYTE Dev; | ||
| 59 | BYTE Bus:6; | ||
| 60 | BYTE Mode:2; /* b00 */ | ||
| 61 | } PeripDev; | ||
| 62 | struct { | ||
| 63 | BYTE DevLSB; | ||
| 64 | BYTE DevMSB:6; | ||
| 65 | BYTE Mode:2; /* b01 */ | ||
| 66 | } LogDev; | ||
| 67 | struct { | ||
| 68 | BYTE Dev:5; | ||
| 69 | BYTE Bus:3; | ||
| 70 | BYTE Targ:6; | ||
| 71 | BYTE Mode:2; /* b10 */ | ||
| 72 | } LogUnit; | ||
| 73 | } SCSI3Addr_struct; | ||
| 74 | |||
| 75 | typedef struct _PhysDevAddr_struct { | ||
| 76 | DWORD TargetId:24; | ||
| 77 | DWORD Bus:6; | ||
| 78 | DWORD Mode:2; | ||
| 79 | SCSI3Addr_struct Target[2]; /* 2 level target device addr */ | ||
| 80 | } PhysDevAddr_struct; | ||
| 81 | |||
| 82 | typedef struct _LogDevAddr_struct { | ||
| 83 | DWORD VolId:30; | ||
| 84 | DWORD Mode:2; | ||
| 85 | BYTE reserved[4]; | ||
| 86 | } LogDevAddr_struct; | ||
| 87 | |||
| 88 | typedef union _LUNAddr_struct { | ||
| 89 | BYTE LunAddrBytes[8]; | ||
| 90 | SCSI3Addr_struct SCSI3Lun[4]; | ||
| 91 | PhysDevAddr_struct PhysDev; | ||
| 92 | LogDevAddr_struct LogDev; | ||
| 93 | } LUNAddr_struct; | ||
| 94 | |||
| 95 | typedef struct _RequestBlock_struct { | ||
| 96 | BYTE CDBLen; | ||
| 97 | struct { | ||
| 98 | BYTE Type:3; | ||
| 99 | BYTE Attribute:3; | ||
| 100 | BYTE Direction:2; | ||
| 101 | } Type; | ||
| 102 | HWORD Timeout; | ||
| 103 | BYTE CDB[16]; | ||
| 104 | } RequestBlock_struct; | ||
| 105 | |||
| 106 | typedef union _MoreErrInfo_struct{ | ||
| 107 | struct { | ||
| 108 | BYTE Reserved[3]; | ||
| 109 | BYTE Type; | ||
| 110 | DWORD ErrorInfo; | ||
| 111 | } Common_Info; | ||
| 112 | struct{ | ||
| 113 | BYTE Reserved[2]; | ||
| 114 | BYTE offense_size; /* size of offending entry */ | ||
| 115 | BYTE offense_num; /* byte # of offense 0-base */ | ||
| 116 | DWORD offense_value; | ||
| 117 | } Invalid_Cmd; | ||
| 118 | } MoreErrInfo_struct; | ||
| 119 | typedef struct _ErrorInfo_struct { | ||
| 120 | BYTE ScsiStatus; | ||
| 121 | BYTE SenseLen; | ||
| 122 | HWORD CommandStatus; | ||
| 123 | DWORD ResidualCnt; | ||
| 124 | MoreErrInfo_struct MoreErrInfo; | ||
| 125 | BYTE SenseInfo[SENSEINFOBYTES]; | ||
| 126 | } ErrorInfo_struct; | ||
| 127 | |||
| 128 | #pragma pack() | ||
| 129 | |||
| 130 | #endif /* CCISS_DEFS_H */ | ||
diff --git a/include/linux/cciss_ioctl.h b/include/linux/cciss_ioctl.h index eb130b4d8e7..986493f5b92 100644 --- a/include/linux/cciss_ioctl.h +++ b/include/linux/cciss_ioctl.h | |||
| @@ -3,6 +3,7 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
| 5 | #include <linux/ioctl.h> | 5 | #include <linux/ioctl.h> |
| 6 | #include <linux/cciss_defs.h> | ||
| 6 | 7 | ||
| 7 | #define CCISS_IOC_MAGIC 'B' | 8 | #define CCISS_IOC_MAGIC 'B' |
| 8 | 9 | ||
| @@ -36,133 +37,6 @@ typedef __u32 DriverVer_type; | |||
| 36 | 37 | ||
| 37 | #define MAX_KMALLOC_SIZE 128000 | 38 | #define MAX_KMALLOC_SIZE 128000 |
| 38 | 39 | ||
| 39 | #ifndef CCISS_CMD_H | ||
| 40 | // This defines are duplicated in cciss_cmd.h in the driver directory | ||
| 41 | |||
| 42 | //general boundary definitions | ||
| 43 | #define SENSEINFOBYTES 32//note that this value may vary between host implementations | ||
| 44 | |||
| 45 | //Command Status value | ||
| 46 | #define CMD_SUCCESS 0x0000 | ||
| 47 | #define CMD_TARGET_STATUS 0x0001 | ||
| 48 | #define CMD_DATA_UNDERRUN 0x0002 | ||
| 49 | #define CMD_DATA_OVERRUN 0x0003 | ||
| 50 | #define CMD_INVALID 0x0004 | ||
| 51 | #define CMD_PROTOCOL_ERR 0x0005 | ||
| 52 | #define CMD_HARDWARE_ERR 0x0006 | ||
| 53 | #define CMD_CONNECTION_LOST 0x0007 | ||
| 54 | #define CMD_ABORTED 0x0008 | ||
| 55 | #define CMD_ABORT_FAILED 0x0009 | ||
| 56 | #define CMD_UNSOLICITED_ABORT 0x000A | ||
| 57 | #define CMD_TIMEOUT 0x000B | ||
| 58 | #define CMD_UNABORTABLE 0x000C | ||
| 59 | |||
| 60 | //transfer direction | ||
| 61 | #define XFER_NONE 0x00 | ||
| 62 | #define XFER_WRITE 0x01 | ||
| 63 | #define XFER_READ 0x02 | ||
| 64 | #define XFER_RSVD 0x03 | ||
| 65 | |||
| 66 | //task attribute | ||
| 67 | #define ATTR_UNTAGGED 0x00 | ||
| 68 | #define ATTR_SIMPLE 0x04 | ||
| 69 | #define ATTR_HEADOFQUEUE 0x05 | ||
| 70 | #define ATTR_ORDERED 0x06 | ||
| 71 | #define ATTR_ACA 0x07 | ||
| 72 | |||
| 73 | //cdb type | ||
| 74 | #define TYPE_CMD 0x00 | ||
| 75 | #define TYPE_MSG 0x01 | ||
| 76 | |||
| 77 | // Type defs used in the following structs | ||
| 78 | #define BYTE __u8 | ||
| 79 | #define WORD __u16 | ||
| 80 | #define HWORD __u16 | ||
| 81 | #define DWORD __u32 | ||
| 82 | |||
| 83 | #define CISS_MAX_LUN 1024 | ||
| 84 | |||
| 85 | #define LEVEL2LUN 1 // index into Target(x) structure, due to byte swapping | ||
| 86 | #define LEVEL3LUN 0 | ||
| 87 | |||
| 88 | #pragma pack(1) | ||
| 89 | |||
| 90 | //Command List Structure | ||
| 91 | typedef union _SCSI3Addr_struct { | ||
| 92 | struct { | ||
| 93 | BYTE Dev; | ||
| 94 | BYTE Bus:6; | ||
| 95 | BYTE Mode:2; // b00 | ||
| 96 | } PeripDev; | ||
| 97 | struct { | ||
| 98 | BYTE DevLSB; | ||
| 99 | BYTE DevMSB:6; | ||
| 100 | BYTE Mode:2; // b01 | ||
| 101 | } LogDev; | ||
| 102 | struct { | ||
| 103 | BYTE Dev:5; | ||
| 104 | BYTE Bus:3; | ||
| 105 | BYTE Targ:6; | ||
| 106 | BYTE Mode:2; // b10 | ||
| 107 | } LogUnit; | ||
| 108 | } SCSI3Addr_struct; | ||
| 109 | |||
| 110 | typedef struct _PhysDevAddr_struct { | ||
| 111 | DWORD TargetId:24; | ||
| 112 | DWORD Bus:6; | ||
| 113 | DWORD Mode:2; | ||
| 114 | SCSI3Addr_struct Target[2]; //2 level target device addr | ||
| 115 | } PhysDevAddr_struct; | ||
| 116 | |||
| 117 | typedef struct _LogDevAddr_struct { | ||
| 118 | DWORD VolId:30; | ||
| 119 | DWORD Mode:2; | ||
| 120 | BYTE reserved[4]; | ||
| 121 | } LogDevAddr_struct; | ||
| 122 | |||
| 123 | typedef union _LUNAddr_struct { | ||
| 124 | BYTE LunAddrBytes[8]; | ||
| 125 | SCSI3Addr_struct SCSI3Lun[4]; | ||
| 126 | PhysDevAddr_struct PhysDev; | ||
| 127 | LogDevAddr_struct LogDev; | ||
| 128 | } LUNAddr_struct; | ||
| 129 | |||
| 130 | typedef struct _RequestBlock_struct { | ||
| 131 | BYTE CDBLen; | ||
| 132 | struct { | ||
| 133 | BYTE Type:3; | ||
| 134 | BYTE Attribute:3; | ||
| 135 | BYTE Direction:2; | ||
| 136 | } Type; | ||
| 137 | HWORD Timeout; | ||
| 138 | BYTE CDB[16]; | ||
| 139 | } RequestBlock_struct; | ||
| 140 | |||
| 141 | typedef union _MoreErrInfo_struct{ | ||
| 142 | struct { | ||
| 143 | BYTE Reserved[3]; | ||
| 144 | BYTE Type; | ||
| 145 | DWORD ErrorInfo; | ||
| 146 | }Common_Info; | ||
| 147 | struct{ | ||
| 148 | BYTE Reserved[2]; | ||
| 149 | BYTE offense_size;//size of offending entry | ||
| 150 | BYTE offense_num; //byte # of offense 0-base | ||
| 151 | DWORD offense_value; | ||
| 152 | }Invalid_Cmd; | ||
| 153 | }MoreErrInfo_struct; | ||
| 154 | typedef struct _ErrorInfo_struct { | ||
| 155 | BYTE ScsiStatus; | ||
| 156 | BYTE SenseLen; | ||
| 157 | HWORD CommandStatus; | ||
| 158 | DWORD ResidualCnt; | ||
| 159 | MoreErrInfo_struct MoreErrInfo; | ||
| 160 | BYTE SenseInfo[SENSEINFOBYTES]; | ||
| 161 | } ErrorInfo_struct; | ||
| 162 | |||
| 163 | #pragma pack() | ||
| 164 | #endif /* CCISS_CMD_H */ | ||
| 165 | |||
| 166 | typedef struct _IOCTL_Command_struct { | 40 | typedef struct _IOCTL_Command_struct { |
| 167 | LUNAddr_struct LUN_info; | 41 | LUNAddr_struct LUN_info; |
| 168 | RequestBlock_struct Request; | 42 | RequestBlock_struct Request; |
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h index 0008dee6651..c9bbcb2a75a 100644 --- a/include/linux/cgroup.h +++ b/include/linux/cgroup.h | |||
| @@ -28,6 +28,7 @@ struct css_id; | |||
| 28 | extern int cgroup_init_early(void); | 28 | extern int cgroup_init_early(void); |
| 29 | extern int cgroup_init(void); | 29 | extern int cgroup_init(void); |
| 30 | extern void cgroup_lock(void); | 30 | extern void cgroup_lock(void); |
| 31 | extern int cgroup_lock_is_held(void); | ||
| 31 | extern bool cgroup_lock_live_group(struct cgroup *cgrp); | 32 | extern bool cgroup_lock_live_group(struct cgroup *cgrp); |
| 32 | extern void cgroup_unlock(void); | 33 | extern void cgroup_unlock(void); |
| 33 | extern void cgroup_fork(struct task_struct *p); | 34 | extern void cgroup_fork(struct task_struct *p); |
| @@ -486,7 +487,9 @@ static inline struct cgroup_subsys_state *cgroup_subsys_state( | |||
| 486 | static inline struct cgroup_subsys_state *task_subsys_state( | 487 | static inline struct cgroup_subsys_state *task_subsys_state( |
| 487 | struct task_struct *task, int subsys_id) | 488 | struct task_struct *task, int subsys_id) |
| 488 | { | 489 | { |
| 489 | return rcu_dereference(task->cgroups->subsys[subsys_id]); | 490 | return rcu_dereference_check(task->cgroups->subsys[subsys_id], |
| 491 | rcu_read_lock_held() || | ||
| 492 | cgroup_lock_is_held()); | ||
| 490 | } | 493 | } |
| 491 | 494 | ||
| 492 | static inline struct cgroup* task_cgroup(struct task_struct *task, | 495 | static inline struct cgroup* task_cgroup(struct task_struct *task, |
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 8a4a130cc19..4bca8b60cdf 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
| @@ -154,6 +154,7 @@ extern u64 timecounter_cyc2time(struct timecounter *tc, | |||
| 154 | * @max_idle_ns: max idle time permitted by the clocksource (nsecs) | 154 | * @max_idle_ns: max idle time permitted by the clocksource (nsecs) |
| 155 | * @flags: flags describing special properties | 155 | * @flags: flags describing special properties |
| 156 | * @vread: vsyscall based read | 156 | * @vread: vsyscall based read |
| 157 | * @suspend: suspend function for the clocksource, if necessary | ||
| 157 | * @resume: resume function for the clocksource, if necessary | 158 | * @resume: resume function for the clocksource, if necessary |
| 158 | */ | 159 | */ |
| 159 | struct clocksource { | 160 | struct clocksource { |
| @@ -172,7 +173,8 @@ struct clocksource { | |||
| 172 | u64 max_idle_ns; | 173 | u64 max_idle_ns; |
| 173 | unsigned long flags; | 174 | unsigned long flags; |
| 174 | cycle_t (*vread)(void); | 175 | cycle_t (*vread)(void); |
| 175 | void (*resume)(void); | 176 | void (*suspend)(struct clocksource *cs); |
| 177 | void (*resume)(struct clocksource *cs); | ||
| 176 | #ifdef CONFIG_IA64 | 178 | #ifdef CONFIG_IA64 |
| 177 | void *fsys_mmio; /* used by fsyscall asm code */ | 179 | void *fsys_mmio; /* used by fsyscall asm code */ |
| 178 | #define CLKSRC_FSYS_MMIO_SET(mmio, addr) ((mmio) = (addr)) | 180 | #define CLKSRC_FSYS_MMIO_SET(mmio, addr) ((mmio) = (addr)) |
| @@ -277,6 +279,7 @@ extern void clocksource_unregister(struct clocksource*); | |||
| 277 | extern void clocksource_touch_watchdog(void); | 279 | extern void clocksource_touch_watchdog(void); |
| 278 | extern struct clocksource* clocksource_get_next(void); | 280 | extern struct clocksource* clocksource_get_next(void); |
| 279 | extern void clocksource_change_rating(struct clocksource *cs, int rating); | 281 | extern void clocksource_change_rating(struct clocksource *cs, int rating); |
| 282 | extern void clocksource_suspend(void); | ||
| 280 | extern void clocksource_resume(void); | 283 | extern void clocksource_resume(void); |
| 281 | extern struct clocksource * __init __weak clocksource_default_clock(void); | 284 | extern struct clocksource * __init __weak clocksource_default_clock(void); |
| 282 | extern void clocksource_mark_unstable(struct clocksource *cs); | 285 | extern void clocksource_mark_unstable(struct clocksource *cs); |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 5be3dab4a69..188fcae10a9 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | # define __acquire(x) __context__(x,1) | 15 | # define __acquire(x) __context__(x,1) |
| 16 | # define __release(x) __context__(x,-1) | 16 | # define __release(x) __context__(x,-1) |
| 17 | # define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) | 17 | # define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) |
| 18 | # define __percpu __attribute__((noderef, address_space(3))) | ||
| 18 | extern void __chk_user_ptr(const volatile void __user *); | 19 | extern void __chk_user_ptr(const volatile void __user *); |
| 19 | extern void __chk_io_ptr(const volatile void __iomem *); | 20 | extern void __chk_io_ptr(const volatile void __iomem *); |
| 20 | #else | 21 | #else |
| @@ -32,6 +33,7 @@ extern void __chk_io_ptr(const volatile void __iomem *); | |||
| 32 | # define __acquire(x) (void)0 | 33 | # define __acquire(x) (void)0 |
| 33 | # define __release(x) (void)0 | 34 | # define __release(x) (void)0 |
| 34 | # define __cond_lock(x,c) (c) | 35 | # define __cond_lock(x,c) (c) |
| 36 | # define __percpu | ||
| 35 | #endif | 37 | #endif |
| 36 | 38 | ||
| 37 | #ifdef __KERNEL__ | 39 | #ifdef __KERNEL__ |
diff --git a/include/linux/connector.h b/include/linux/connector.h index 72ba63eb83c..3a779ffba60 100644 --- a/include/linux/connector.h +++ b/include/linux/connector.h | |||
| @@ -24,9 +24,6 @@ | |||
| 24 | 24 | ||
| 25 | #include <linux/types.h> | 25 | #include <linux/types.h> |
| 26 | 26 | ||
| 27 | #define CN_IDX_CONNECTOR 0xffffffff | ||
| 28 | #define CN_VAL_CONNECTOR 0xffffffff | ||
| 29 | |||
| 30 | /* | 27 | /* |
| 31 | * Process Events connector unique ids -- used for message routing | 28 | * Process Events connector unique ids -- used for message routing |
| 32 | */ | 29 | */ |
| @@ -75,30 +72,6 @@ struct cn_msg { | |||
| 75 | __u8 data[0]; | 72 | __u8 data[0]; |
| 76 | }; | 73 | }; |
| 77 | 74 | ||
| 78 | /* | ||
| 79 | * Notify structure - requests notification about | ||
| 80 | * registering/unregistering idx/val in range [first, first+range]. | ||
| 81 | */ | ||
| 82 | struct cn_notify_req { | ||
| 83 | __u32 first; | ||
| 84 | __u32 range; | ||
| 85 | }; | ||
| 86 | |||
| 87 | /* | ||
| 88 | * Main notification control message | ||
| 89 | * *_notify_num - number of appropriate cn_notify_req structures after | ||
| 90 | * this struct. | ||
| 91 | * group - notification receiver's idx. | ||
| 92 | * len - total length of the attached data. | ||
| 93 | */ | ||
| 94 | struct cn_ctl_msg { | ||
| 95 | __u32 idx_notify_num; | ||
| 96 | __u32 val_notify_num; | ||
| 97 | __u32 group; | ||
| 98 | __u32 len; | ||
| 99 | __u8 data[0]; | ||
| 100 | }; | ||
| 101 | |||
| 102 | #ifdef __KERNEL__ | 75 | #ifdef __KERNEL__ |
| 103 | 76 | ||
| 104 | #include <asm/atomic.h> | 77 | #include <asm/atomic.h> |
| @@ -151,11 +124,6 @@ struct cn_callback_entry { | |||
| 151 | u32 seq, group; | 124 | u32 seq, group; |
| 152 | }; | 125 | }; |
| 153 | 126 | ||
| 154 | struct cn_ctl_entry { | ||
| 155 | struct list_head notify_entry; | ||
| 156 | struct cn_ctl_msg *msg; | ||
| 157 | }; | ||
| 158 | |||
| 159 | struct cn_dev { | 127 | struct cn_dev { |
| 160 | struct cb_id id; | 128 | struct cb_id id; |
| 161 | 129 | ||
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h index d77b54733c5..dbcee7647d9 100644 --- a/include/linux/cpumask.h +++ b/include/linux/cpumask.h | |||
| @@ -143,6 +143,8 @@ static inline unsigned int cpumask_any_but(const struct cpumask *mask, | |||
| 143 | 143 | ||
| 144 | #define for_each_cpu(cpu, mask) \ | 144 | #define for_each_cpu(cpu, mask) \ |
| 145 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) | 145 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) |
| 146 | #define for_each_cpu_not(cpu, mask) \ | ||
| 147 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask) | ||
| 146 | #define for_each_cpu_and(cpu, mask, and) \ | 148 | #define for_each_cpu_and(cpu, mask, and) \ |
| 147 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)and) | 149 | for ((cpu) = 0; (cpu) < 1; (cpu)++, (void)mask, (void)and) |
| 148 | #else | 150 | #else |
| @@ -203,6 +205,18 @@ int cpumask_any_but(const struct cpumask *mask, unsigned int cpu); | |||
| 203 | (cpu) < nr_cpu_ids;) | 205 | (cpu) < nr_cpu_ids;) |
| 204 | 206 | ||
| 205 | /** | 207 | /** |
| 208 | * for_each_cpu_not - iterate over every cpu in a complemented mask | ||
| 209 | * @cpu: the (optionally unsigned) integer iterator | ||
| 210 | * @mask: the cpumask pointer | ||
| 211 | * | ||
| 212 | * After the loop, cpu is >= nr_cpu_ids. | ||
| 213 | */ | ||
| 214 | #define for_each_cpu_not(cpu, mask) \ | ||
| 215 | for ((cpu) = -1; \ | ||
| 216 | (cpu) = cpumask_next_zero((cpu), (mask)), \ | ||
| 217 | (cpu) < nr_cpu_ids;) | ||
| 218 | |||
| 219 | /** | ||
| 206 | * for_each_cpu_and - iterate over every cpu in both masks | 220 | * for_each_cpu_and - iterate over every cpu in both masks |
| 207 | * @cpu: the (optionally unsigned) integer iterator | 221 | * @cpu: the (optionally unsigned) integer iterator |
| 208 | * @mask: the first cpumask pointer | 222 | * @mask: the first cpumask pointer |
diff --git a/include/linux/cred.h b/include/linux/cred.h index 4e3387a89cb..4db09f89b63 100644 --- a/include/linux/cred.h +++ b/include/linux/cred.h | |||
| @@ -280,7 +280,7 @@ static inline void put_cred(const struct cred *_cred) | |||
| 280 | * task or by holding tasklist_lock to prevent it from being unlinked. | 280 | * task or by holding tasklist_lock to prevent it from being unlinked. |
| 281 | */ | 281 | */ |
| 282 | #define __task_cred(task) \ | 282 | #define __task_cred(task) \ |
| 283 | ((const struct cred *)(rcu_dereference((task)->real_cred))) | 283 | ((const struct cred *)(rcu_dereference_check((task)->real_cred, rcu_read_lock_held() || lockdep_is_held(&tasklist_lock)))) |
| 284 | 284 | ||
| 285 | /** | 285 | /** |
| 286 | * get_task_cred - Get another task's objective credentials | 286 | * get_task_cred - Get another task's objective credentials |
diff --git a/include/linux/davinci_emac.h b/include/linux/davinci_emac.h new file mode 100644 index 00000000000..7c930dba477 --- /dev/null +++ b/include/linux/davinci_emac.h | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | /* | ||
| 2 | * TI DaVinci EMAC platform support | ||
| 3 | * | ||
| 4 | * Author: Kevin Hilman, Deep Root Systems, LLC | ||
| 5 | * | ||
| 6 | * 2007 (c) Deep Root Systems, LLC. This file is licensed under | ||
| 7 | * the terms of the GNU General Public License version 2. This program | ||
| 8 | * is licensed "as is" without any warranty of any kind, whether express | ||
| 9 | * or implied. | ||
| 10 | */ | ||
| 11 | #ifndef _LINUX_DAVINCI_EMAC_H | ||
| 12 | #define _LINUX_DAVINCI_EMAC_H | ||
| 13 | |||
| 14 | #include <linux/if_ether.h> | ||
| 15 | #include <linux/memory.h> | ||
| 16 | |||
| 17 | struct emac_platform_data { | ||
| 18 | char mac_addr[ETH_ALEN]; | ||
| 19 | u32 ctrl_reg_offset; | ||
| 20 | u32 ctrl_mod_reg_offset; | ||
| 21 | u32 ctrl_ram_offset; | ||
| 22 | u32 hw_ram_addr; | ||
| 23 | u32 mdio_reg_offset; | ||
| 24 | u32 ctrl_ram_size; | ||
| 25 | u32 phy_mask; | ||
| 26 | u32 mdio_max_freq; | ||
| 27 | u8 rmii_en; | ||
| 28 | u8 version; | ||
| 29 | void (*interrupt_enable) (void); | ||
| 30 | void (*interrupt_disable) (void); | ||
| 31 | }; | ||
| 32 | |||
| 33 | enum { | ||
| 34 | EMAC_VERSION_1, /* DM644x */ | ||
| 35 | EMAC_VERSION_2, /* DM646x */ | ||
| 36 | }; | ||
| 37 | |||
| 38 | void davinci_get_mac_addr(struct memory_accessor *mem_acc, void *context); | ||
| 39 | #endif | ||
diff --git a/include/linux/decompress/unlzo.h b/include/linux/decompress/unlzo.h new file mode 100644 index 00000000000..98722975251 --- /dev/null +++ b/include/linux/decompress/unlzo.h | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | #ifndef DECOMPRESS_UNLZO_H | ||
| 2 | #define DECOMPRESS_UNLZO_H | ||
| 3 | |||
| 4 | int unlzo(unsigned char *inbuf, int len, | ||
| 5 | int(*fill)(void*, unsigned int), | ||
| 6 | int(*flush)(void*, unsigned int), | ||
| 7 | unsigned char *output, | ||
| 8 | int *pos, | ||
| 9 | void(*error)(char *x)); | ||
| 10 | #endif | ||
diff --git a/include/linux/device.h b/include/linux/device.h index a62799f2ab0..b30527db3ac 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
| @@ -472,6 +472,23 @@ static inline int device_is_registered(struct device *dev) | |||
| 472 | return dev->kobj.state_in_sysfs; | 472 | return dev->kobj.state_in_sysfs; |
| 473 | } | 473 | } |
| 474 | 474 | ||
| 475 | static inline void device_enable_async_suspend(struct device *dev) | ||
| 476 | { | ||
| 477 | if (dev->power.status == DPM_ON) | ||
| 478 | dev->power.async_suspend = true; | ||
| 479 | } | ||
| 480 | |||
| 481 | static inline void device_disable_async_suspend(struct device *dev) | ||
| 482 | { | ||
| 483 | if (dev->power.status == DPM_ON) | ||
| 484 | dev->power.async_suspend = false; | ||
| 485 | } | ||
| 486 | |||
| 487 | static inline bool device_async_suspend_enabled(struct device *dev) | ||
| 488 | { | ||
| 489 | return !!dev->power.async_suspend; | ||
| 490 | } | ||
| 491 | |||
| 475 | void driver_init(void); | 492 | void driver_init(void); |
| 476 | 493 | ||
| 477 | /* | 494 | /* |
diff --git a/include/linux/drbd.h b/include/linux/drbd.h index e84f4733cb5..78962272338 100644 --- a/include/linux/drbd.h +++ b/include/linux/drbd.h | |||
| @@ -53,7 +53,7 @@ | |||
| 53 | 53 | ||
| 54 | 54 | ||
| 55 | extern const char *drbd_buildtag(void); | 55 | extern const char *drbd_buildtag(void); |
| 56 | #define REL_VERSION "8.3.6" | 56 | #define REL_VERSION "8.3.7" |
| 57 | #define API_VERSION 88 | 57 | #define API_VERSION 88 |
| 58 | #define PRO_VERSION_MIN 86 | 58 | #define PRO_VERSION_MIN 86 |
| 59 | #define PRO_VERSION_MAX 91 | 59 | #define PRO_VERSION_MAX 91 |
diff --git a/include/linux/drbd_nl.h b/include/linux/drbd_nl.h index db5721ad50d..a4d82f89599 100644 --- a/include/linux/drbd_nl.h +++ b/include/linux/drbd_nl.h | |||
| @@ -69,6 +69,7 @@ NL_PACKET(disconnect, 6, ) | |||
| 69 | 69 | ||
| 70 | NL_PACKET(resize, 7, | 70 | NL_PACKET(resize, 7, |
| 71 | NL_INT64( 29, T_MAY_IGNORE, resize_size) | 71 | NL_INT64( 29, T_MAY_IGNORE, resize_size) |
| 72 | NL_BIT( 68, T_MAY_IGNORE, resize_force) | ||
| 72 | ) | 73 | ) |
| 73 | 74 | ||
| 74 | NL_PACKET(syncer_conf, 8, | 75 | NL_PACKET(syncer_conf, 8, |
diff --git a/include/linux/elf.h b/include/linux/elf.h index 0cc4d55151b..ad990c5f63f 100644 --- a/include/linux/elf.h +++ b/include/linux/elf.h | |||
| @@ -349,7 +349,11 @@ typedef struct elf64_shdr { | |||
| 349 | #define ELF_OSABI ELFOSABI_NONE | 349 | #define ELF_OSABI ELFOSABI_NONE |
| 350 | #endif | 350 | #endif |
| 351 | 351 | ||
| 352 | /* Notes used in ET_CORE */ | 352 | /* |
| 353 | * Notes used in ET_CORE. Architectures export some of the arch register sets | ||
| 354 | * using the corresponding note types via the PTRACE_GETREGSET and | ||
| 355 | * PTRACE_SETREGSET requests. | ||
| 356 | */ | ||
| 353 | #define NT_PRSTATUS 1 | 357 | #define NT_PRSTATUS 1 |
| 354 | #define NT_PRFPREG 2 | 358 | #define NT_PRFPREG 2 |
| 355 | #define NT_PRPSINFO 3 | 359 | #define NT_PRPSINFO 3 |
| @@ -361,7 +365,13 @@ typedef struct elf64_shdr { | |||
| 361 | #define NT_PPC_VSX 0x102 /* PowerPC VSX registers */ | 365 | #define NT_PPC_VSX 0x102 /* PowerPC VSX registers */ |
| 362 | #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ | 366 | #define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */ |
| 363 | #define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */ | 367 | #define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */ |
| 368 | #define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */ | ||
| 364 | #define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */ | 369 | #define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */ |
| 370 | #define NT_S390_TIMER 0x301 /* s390 timer register */ | ||
| 371 | #define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */ | ||
| 372 | #define NT_S390_TODPREG 0x303 /* s390 TOD programmable register */ | ||
| 373 | #define NT_S390_CTRS 0x304 /* s390 control registers */ | ||
| 374 | #define NT_S390_PREFIX 0x305 /* s390 prefix register */ | ||
| 365 | 375 | ||
| 366 | 376 | ||
| 367 | /* Note header in a PT_NOTE section */ | 377 | /* Note header in a PT_NOTE section */ |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index ef4a2d84d92..cca1c3de140 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
| @@ -242,6 +242,7 @@ enum ethtool_stringset { | |||
| 242 | ETH_SS_TEST = 0, | 242 | ETH_SS_TEST = 0, |
| 243 | ETH_SS_STATS, | 243 | ETH_SS_STATS, |
| 244 | ETH_SS_PRIV_FLAGS, | 244 | ETH_SS_PRIV_FLAGS, |
| 245 | ETH_SS_NTUPLE_FILTERS, | ||
| 245 | }; | 246 | }; |
| 246 | 247 | ||
| 247 | /* for passing string sets for data tagging */ | 248 | /* for passing string sets for data tagging */ |
| @@ -290,6 +291,7 @@ struct ethtool_perm_addr { | |||
| 290 | */ | 291 | */ |
| 291 | enum ethtool_flags { | 292 | enum ethtool_flags { |
| 292 | ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ | 293 | ETH_FLAG_LRO = (1 << 15), /* LRO is enabled */ |
| 294 | ETH_FLAG_NTUPLE = (1 << 27), /* N-tuple filters enabled */ | ||
| 293 | }; | 295 | }; |
| 294 | 296 | ||
| 295 | /* The following structures are for supporting RX network flow | 297 | /* The following structures are for supporting RX network flow |
| @@ -363,6 +365,35 @@ struct ethtool_rxnfc { | |||
| 363 | __u32 rule_locs[0]; | 365 | __u32 rule_locs[0]; |
| 364 | }; | 366 | }; |
| 365 | 367 | ||
| 368 | struct ethtool_rx_ntuple_flow_spec { | ||
| 369 | __u32 flow_type; | ||
| 370 | union { | ||
| 371 | struct ethtool_tcpip4_spec tcp_ip4_spec; | ||
| 372 | struct ethtool_tcpip4_spec udp_ip4_spec; | ||
| 373 | struct ethtool_tcpip4_spec sctp_ip4_spec; | ||
| 374 | struct ethtool_ah_espip4_spec ah_ip4_spec; | ||
| 375 | struct ethtool_ah_espip4_spec esp_ip4_spec; | ||
| 376 | struct ethtool_rawip4_spec raw_ip4_spec; | ||
| 377 | struct ethtool_ether_spec ether_spec; | ||
| 378 | struct ethtool_usrip4_spec usr_ip4_spec; | ||
| 379 | __u8 hdata[64]; | ||
| 380 | } h_u, m_u; /* entry, mask */ | ||
| 381 | |||
| 382 | __u16 vlan_tag; | ||
| 383 | __u16 vlan_tag_mask; | ||
| 384 | __u64 data; /* user-defined flow spec data */ | ||
| 385 | __u64 data_mask; /* user-defined flow spec mask */ | ||
| 386 | |||
| 387 | /* signed to distinguish between queue and actions (DROP) */ | ||
| 388 | __s32 action; | ||
| 389 | #define ETHTOOL_RXNTUPLE_ACTION_DROP -1 | ||
| 390 | }; | ||
| 391 | |||
| 392 | struct ethtool_rx_ntuple { | ||
| 393 | __u32 cmd; | ||
| 394 | struct ethtool_rx_ntuple_flow_spec fs; | ||
| 395 | }; | ||
| 396 | |||
| 366 | #define ETHTOOL_FLASH_MAX_FILENAME 128 | 397 | #define ETHTOOL_FLASH_MAX_FILENAME 128 |
| 367 | enum ethtool_flash_op_type { | 398 | enum ethtool_flash_op_type { |
| 368 | ETHTOOL_FLASH_ALL_REGIONS = 0, | 399 | ETHTOOL_FLASH_ALL_REGIONS = 0, |
| @@ -377,6 +408,20 @@ struct ethtool_flash { | |||
| 377 | 408 | ||
| 378 | #ifdef __KERNEL__ | 409 | #ifdef __KERNEL__ |
| 379 | 410 | ||
| 411 | #include <linux/rculist.h> | ||
| 412 | |||
| 413 | struct ethtool_rx_ntuple_flow_spec_container { | ||
| 414 | struct ethtool_rx_ntuple_flow_spec fs; | ||
| 415 | struct list_head list; | ||
| 416 | }; | ||
| 417 | |||
| 418 | struct ethtool_rx_ntuple_list { | ||
| 419 | #define ETHTOOL_MAX_NTUPLE_LIST_ENTRY 1024 | ||
| 420 | #define ETHTOOL_MAX_NTUPLE_STRING_PER_ENTRY 14 | ||
| 421 | struct list_head list; | ||
| 422 | unsigned int count; | ||
| 423 | }; | ||
| 424 | |||
| 380 | struct net_device; | 425 | struct net_device; |
| 381 | 426 | ||
| 382 | /* Some generic methods drivers may use in their ethtool_ops */ | 427 | /* Some generic methods drivers may use in their ethtool_ops */ |
| @@ -394,6 +439,7 @@ u32 ethtool_op_get_ufo(struct net_device *dev); | |||
| 394 | int ethtool_op_set_ufo(struct net_device *dev, u32 data); | 439 | int ethtool_op_set_ufo(struct net_device *dev, u32 data); |
| 395 | u32 ethtool_op_get_flags(struct net_device *dev); | 440 | u32 ethtool_op_get_flags(struct net_device *dev); |
| 396 | int ethtool_op_set_flags(struct net_device *dev, u32 data); | 441 | int ethtool_op_set_flags(struct net_device *dev, u32 data); |
| 442 | void ethtool_ntuple_flush(struct net_device *dev); | ||
| 397 | 443 | ||
| 398 | /** | 444 | /** |
| 399 | * ðtool_ops - Alter and report network device settings | 445 | * ðtool_ops - Alter and report network device settings |
| @@ -500,6 +546,8 @@ struct ethtool_ops { | |||
| 500 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); | 546 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); |
| 501 | int (*flash_device)(struct net_device *, struct ethtool_flash *); | 547 | int (*flash_device)(struct net_device *, struct ethtool_flash *); |
| 502 | int (*reset)(struct net_device *, u32 *); | 548 | int (*reset)(struct net_device *, u32 *); |
| 549 | int (*set_rx_ntuple)(struct net_device *, struct ethtool_rx_ntuple *); | ||
| 550 | int (*get_rx_ntuple)(struct net_device *, u32 stringset, void *); | ||
| 503 | }; | 551 | }; |
| 504 | #endif /* __KERNEL__ */ | 552 | #endif /* __KERNEL__ */ |
| 505 | 553 | ||
| @@ -559,6 +607,9 @@ struct ethtool_ops { | |||
| 559 | #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ | 607 | #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ |
| 560 | #define ETHTOOL_RESET 0x00000034 /* Reset hardware */ | 608 | #define ETHTOOL_RESET 0x00000034 /* Reset hardware */ |
| 561 | 609 | ||
| 610 | #define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */ | ||
| 611 | #define ETHTOOL_GRXNTUPLE 0x00000036 /* Get n-tuple filters from device */ | ||
| 612 | |||
| 562 | /* compatibility with older code */ | 613 | /* compatibility with older code */ |
| 563 | #define SPARC_ETH_GSET ETHTOOL_GSET | 614 | #define SPARC_ETH_GSET ETHTOOL_GSET |
| 564 | #define SPARC_ETH_SSET ETHTOOL_SSET | 615 | #define SPARC_ETH_SSET ETHTOOL_SSET |
diff --git a/include/linux/eventfd.h b/include/linux/eventfd.h index 94dd10366a7..91bb4f27238 100644 --- a/include/linux/eventfd.h +++ b/include/linux/eventfd.h | |||
| @@ -10,6 +10,7 @@ | |||
| 10 | 10 | ||
| 11 | #include <linux/fcntl.h> | 11 | #include <linux/fcntl.h> |
| 12 | #include <linux/file.h> | 12 | #include <linux/file.h> |
| 13 | #include <linux/wait.h> | ||
| 13 | 14 | ||
| 14 | /* | 15 | /* |
| 15 | * CAREFUL: Check include/asm-generic/fcntl.h when defining | 16 | * CAREFUL: Check include/asm-generic/fcntl.h when defining |
| @@ -34,6 +35,9 @@ struct file *eventfd_fget(int fd); | |||
| 34 | struct eventfd_ctx *eventfd_ctx_fdget(int fd); | 35 | struct eventfd_ctx *eventfd_ctx_fdget(int fd); |
| 35 | struct eventfd_ctx *eventfd_ctx_fileget(struct file *file); | 36 | struct eventfd_ctx *eventfd_ctx_fileget(struct file *file); |
| 36 | int eventfd_signal(struct eventfd_ctx *ctx, int n); | 37 | int eventfd_signal(struct eventfd_ctx *ctx, int n); |
| 38 | ssize_t eventfd_ctx_read(struct eventfd_ctx *ctx, int no_wait, __u64 *cnt); | ||
| 39 | int eventfd_ctx_remove_wait_queue(struct eventfd_ctx *ctx, wait_queue_t *wait, | ||
| 40 | __u64 *cnt); | ||
| 37 | 41 | ||
| 38 | #else /* CONFIG_EVENTFD */ | 42 | #else /* CONFIG_EVENTFD */ |
| 39 | 43 | ||
| @@ -61,6 +65,18 @@ static inline void eventfd_ctx_put(struct eventfd_ctx *ctx) | |||
| 61 | 65 | ||
| 62 | } | 66 | } |
| 63 | 67 | ||
| 68 | static inline ssize_t eventfd_ctx_read(struct eventfd_ctx *ctx, int no_wait, | ||
| 69 | __u64 *cnt) | ||
| 70 | { | ||
| 71 | return -ENOSYS; | ||
| 72 | } | ||
| 73 | |||
| 74 | static inline int eventfd_ctx_remove_wait_queue(struct eventfd_ctx *ctx, | ||
| 75 | wait_queue_t *wait, __u64 *cnt) | ||
| 76 | { | ||
| 77 | return -ENOSYS; | ||
| 78 | } | ||
| 79 | |||
| 64 | #endif | 80 | #endif |
| 65 | 81 | ||
| 66 | #endif /* _LINUX_EVENTFD_H */ | 82 | #endif /* _LINUX_EVENTFD_H */ |
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h index a2ec74bc481..013dc529e95 100644 --- a/include/linux/fdtable.h +++ b/include/linux/fdtable.h | |||
| @@ -57,7 +57,14 @@ struct files_struct { | |||
| 57 | struct file * fd_array[NR_OPEN_DEFAULT]; | 57 | struct file * fd_array[NR_OPEN_DEFAULT]; |
| 58 | }; | 58 | }; |
| 59 | 59 | ||
| 60 | #define files_fdtable(files) (rcu_dereference((files)->fdt)) | 60 | #define rcu_dereference_check_fdtable(files, fdtfd) \ |
| 61 | (rcu_dereference_check((fdtfd), \ | ||
| 62 | rcu_read_lock_held() || \ | ||
| 63 | lockdep_is_held(&(files)->file_lock) || \ | ||
| 64 | atomic_read(&(files)->count) == 1)) | ||
| 65 | |||
| 66 | #define files_fdtable(files) \ | ||
| 67 | (rcu_dereference_check_fdtable((files), (files)->fdt)) | ||
| 61 | 68 | ||
| 62 | struct file_operations; | 69 | struct file_operations; |
| 63 | struct vfsmount; | 70 | struct vfsmount; |
| @@ -78,7 +85,7 @@ static inline struct file * fcheck_files(struct files_struct *files, unsigned in | |||
| 78 | struct fdtable *fdt = files_fdtable(files); | 85 | struct fdtable *fdt = files_fdtable(files); |
| 79 | 86 | ||
| 80 | if (fd < fdt->max_fds) | 87 | if (fd < fdt->max_fds) |
| 81 | file = rcu_dereference(fdt->fd[fd]); | 88 | file = rcu_dereference_check_fdtable(files, fdt->fd[fd]); |
| 82 | return file; | 89 | return file; |
| 83 | } | 90 | } |
| 84 | 91 | ||
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h index c6b3ca3af6d..520ecf86cbb 100644 --- a/include/linux/firewire-cdev.h +++ b/include/linux/firewire-cdev.h | |||
| @@ -340,6 +340,9 @@ struct fw_cdev_send_response { | |||
| 340 | * The @closure field is passed back to userspace in the response event. | 340 | * The @closure field is passed back to userspace in the response event. |
| 341 | * The @handle field is an out parameter, returning a handle to the allocated | 341 | * The @handle field is an out parameter, returning a handle to the allocated |
| 342 | * range to be used for later deallocation of the range. | 342 | * range to be used for later deallocation of the range. |
| 343 | * | ||
| 344 | * The address range is allocated on all local nodes. The address allocation | ||
| 345 | * is exclusive except for the FCP command and response registers. | ||
| 343 | */ | 346 | */ |
| 344 | struct fw_cdev_allocate { | 347 | struct fw_cdev_allocate { |
| 345 | __u64 offset; | 348 | __u64 offset; |
| @@ -377,7 +380,7 @@ struct fw_cdev_initiate_bus_reset { | |||
| 377 | * @immediate: If non-zero, immediate key to insert before pointer | 380 | * @immediate: If non-zero, immediate key to insert before pointer |
| 378 | * @key: Upper 8 bits of root directory pointer | 381 | * @key: Upper 8 bits of root directory pointer |
| 379 | * @data: Userspace pointer to contents of descriptor block | 382 | * @data: Userspace pointer to contents of descriptor block |
| 380 | * @length: Length of descriptor block data, in bytes | 383 | * @length: Length of descriptor block data, in quadlets |
| 381 | * @handle: Handle to the descriptor, written by the kernel | 384 | * @handle: Handle to the descriptor, written by the kernel |
| 382 | * | 385 | * |
| 383 | * Add a descriptor block and optionally a preceding immediate key to the local | 386 | * Add a descriptor block and optionally a preceding immediate key to the local |
| @@ -391,6 +394,8 @@ struct fw_cdev_initiate_bus_reset { | |||
| 391 | * If not 0, the @immediate field specifies an immediate key which will be | 394 | * If not 0, the @immediate field specifies an immediate key which will be |
| 392 | * inserted before the root directory pointer. | 395 | * inserted before the root directory pointer. |
| 393 | * | 396 | * |
| 397 | * @immediate, @key, and @data array elements are CPU-endian quadlets. | ||
| 398 | * | ||
| 394 | * If successful, the kernel adds the descriptor and writes back a handle to the | 399 | * If successful, the kernel adds the descriptor and writes back a handle to the |
| 395 | * kernel-side object to be used for later removal of the descriptor block and | 400 | * kernel-side object to be used for later removal of the descriptor block and |
| 396 | * immediate key. | 401 | * immediate key. |
diff --git a/include/linux/firewire.h b/include/linux/firewire.h index 9416a461b69..a0e67150a72 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h | |||
| @@ -248,8 +248,8 @@ typedef void (*fw_transaction_callback_t)(struct fw_card *card, int rcode, | |||
| 248 | void *data, size_t length, | 248 | void *data, size_t length, |
| 249 | void *callback_data); | 249 | void *callback_data); |
| 250 | /* | 250 | /* |
| 251 | * Important note: The callback must guarantee that either fw_send_response() | 251 | * Important note: Except for the FCP registers, the callback must guarantee |
| 252 | * or kfree() is called on the @request. | 252 | * that either fw_send_response() or kfree() is called on the @request. |
| 253 | */ | 253 | */ |
| 254 | typedef void (*fw_address_callback_t)(struct fw_card *card, | 254 | typedef void (*fw_address_callback_t)(struct fw_card *card, |
| 255 | struct fw_request *request, | 255 | struct fw_request *request, |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 9147ca88f25..ebb1cd5bc24 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
| @@ -729,6 +729,7 @@ struct inode { | |||
| 729 | uid_t i_uid; | 729 | uid_t i_uid; |
| 730 | gid_t i_gid; | 730 | gid_t i_gid; |
| 731 | dev_t i_rdev; | 731 | dev_t i_rdev; |
| 732 | unsigned int i_blkbits; | ||
| 732 | u64 i_version; | 733 | u64 i_version; |
| 733 | loff_t i_size; | 734 | loff_t i_size; |
| 734 | #ifdef __NEED_I_SIZE_ORDERED | 735 | #ifdef __NEED_I_SIZE_ORDERED |
| @@ -738,7 +739,6 @@ struct inode { | |||
| 738 | struct timespec i_mtime; | 739 | struct timespec i_mtime; |
| 739 | struct timespec i_ctime; | 740 | struct timespec i_ctime; |
| 740 | blkcnt_t i_blocks; | 741 | blkcnt_t i_blocks; |
| 741 | unsigned int i_blkbits; | ||
| 742 | unsigned short i_bytes; | 742 | unsigned short i_bytes; |
| 743 | umode_t i_mode; | 743 | umode_t i_mode; |
| 744 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ | 744 | spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ |
| @@ -2463,7 +2463,7 @@ int proc_nr_files(struct ctl_table *table, int write, | |||
| 2463 | 2463 | ||
| 2464 | int __init get_filesystem_list(char *buf); | 2464 | int __init get_filesystem_list(char *buf); |
| 2465 | 2465 | ||
| 2466 | #define ACC_MODE(x) ("\000\004\002\006"[(x)&O_ACCMODE]) | 2466 | #define ACC_MODE(x) ("\004\002\006\006"[(x)&O_ACCMODE]) |
| 2467 | #define OPEN_FMODE(flag) ((__force fmode_t)((flag + 1) & O_ACCMODE)) | 2467 | #define OPEN_FMODE(flag) ((__force fmode_t)((flag + 1) & O_ACCMODE)) |
| 2468 | 2468 | ||
| 2469 | #endif /* __KERNEL__ */ | 2469 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 0b4f97d24d7..01e6adea07e 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
| @@ -134,6 +134,8 @@ extern void | |||
| 134 | unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops); | 134 | unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops); |
| 135 | extern void unregister_ftrace_function_probe_all(char *glob); | 135 | extern void unregister_ftrace_function_probe_all(char *glob); |
| 136 | 136 | ||
| 137 | extern int ftrace_text_reserved(void *start, void *end); | ||
| 138 | |||
| 137 | enum { | 139 | enum { |
| 138 | FTRACE_FL_FREE = (1 << 0), | 140 | FTRACE_FL_FREE = (1 << 0), |
| 139 | FTRACE_FL_FAILED = (1 << 1), | 141 | FTRACE_FL_FAILED = (1 << 1), |
| @@ -141,7 +143,6 @@ enum { | |||
| 141 | FTRACE_FL_ENABLED = (1 << 3), | 143 | FTRACE_FL_ENABLED = (1 << 3), |
| 142 | FTRACE_FL_NOTRACE = (1 << 4), | 144 | FTRACE_FL_NOTRACE = (1 << 4), |
| 143 | FTRACE_FL_CONVERTED = (1 << 5), | 145 | FTRACE_FL_CONVERTED = (1 << 5), |
| 144 | FTRACE_FL_FROZEN = (1 << 6), | ||
| 145 | }; | 146 | }; |
| 146 | 147 | ||
| 147 | struct dyn_ftrace { | 148 | struct dyn_ftrace { |
| @@ -250,6 +251,10 @@ static inline int unregister_ftrace_command(char *cmd_name) | |||
| 250 | { | 251 | { |
| 251 | return -EINVAL; | 252 | return -EINVAL; |
| 252 | } | 253 | } |
| 254 | static inline int ftrace_text_reserved(void *start, void *end) | ||
| 255 | { | ||
| 256 | return 0; | ||
| 257 | } | ||
| 253 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 258 | #endif /* CONFIG_DYNAMIC_FTRACE */ |
| 254 | 259 | ||
| 255 | /* totally disable ftrace - can not re-enable after this */ | 260 | /* totally disable ftrace - can not re-enable after this */ |
| @@ -511,4 +516,10 @@ static inline void trace_hw_branch_oops(void) {} | |||
| 511 | 516 | ||
| 512 | #endif /* CONFIG_HW_BRANCH_TRACER */ | 517 | #endif /* CONFIG_HW_BRANCH_TRACER */ |
| 513 | 518 | ||
| 519 | #ifdef CONFIG_FTRACE_SYSCALLS | ||
| 520 | |||
| 521 | unsigned long arch_syscall_addr(int nr); | ||
| 522 | |||
| 523 | #endif /* CONFIG_FTRACE_SYSCALLS */ | ||
| 524 | |||
| 514 | #endif /* _LINUX_FTRACE_H */ | 525 | #endif /* _LINUX_FTRACE_H */ |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 2233c98d80d..6b7c444ab8f 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include <linux/trace_seq.h> | 5 | #include <linux/trace_seq.h> |
| 6 | #include <linux/percpu.h> | 6 | #include <linux/percpu.h> |
| 7 | #include <linux/hardirq.h> | 7 | #include <linux/hardirq.h> |
| 8 | #include <linux/perf_event.h> | ||
| 8 | 9 | ||
| 9 | struct trace_array; | 10 | struct trace_array; |
| 10 | struct tracer; | 11 | struct tracer; |
| @@ -121,9 +122,8 @@ struct ftrace_event_call { | |||
| 121 | int (*regfunc)(struct ftrace_event_call *); | 122 | int (*regfunc)(struct ftrace_event_call *); |
| 122 | void (*unregfunc)(struct ftrace_event_call *); | 123 | void (*unregfunc)(struct ftrace_event_call *); |
| 123 | int id; | 124 | int id; |
| 125 | const char *print_fmt; | ||
| 124 | int (*raw_init)(struct ftrace_event_call *); | 126 | int (*raw_init)(struct ftrace_event_call *); |
| 125 | int (*show_format)(struct ftrace_event_call *, | ||
| 126 | struct trace_seq *); | ||
| 127 | int (*define_fields)(struct ftrace_event_call *); | 127 | int (*define_fields)(struct ftrace_event_call *); |
| 128 | struct list_head fields; | 128 | struct list_head fields; |
| 129 | int filter_active; | 129 | int filter_active; |
| @@ -138,9 +138,6 @@ struct ftrace_event_call { | |||
| 138 | 138 | ||
| 139 | #define FTRACE_MAX_PROFILE_SIZE 2048 | 139 | #define FTRACE_MAX_PROFILE_SIZE 2048 |
| 140 | 140 | ||
| 141 | extern char *perf_trace_buf; | ||
| 142 | extern char *perf_trace_buf_nmi; | ||
| 143 | |||
| 144 | #define MAX_FILTER_PRED 32 | 141 | #define MAX_FILTER_PRED 32 |
| 145 | #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ | 142 | #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ |
| 146 | 143 | ||
| @@ -188,13 +185,27 @@ do { \ | |||
| 188 | __trace_printk(ip, fmt, ##args); \ | 185 | __trace_printk(ip, fmt, ##args); \ |
| 189 | } while (0) | 186 | } while (0) |
| 190 | 187 | ||
| 191 | #ifdef CONFIG_EVENT_PROFILE | 188 | #ifdef CONFIG_PERF_EVENTS |
| 192 | struct perf_event; | 189 | struct perf_event; |
| 193 | extern int ftrace_profile_enable(int event_id); | 190 | extern int ftrace_profile_enable(int event_id); |
| 194 | extern void ftrace_profile_disable(int event_id); | 191 | extern void ftrace_profile_disable(int event_id); |
| 195 | extern int ftrace_profile_set_filter(struct perf_event *event, int event_id, | 192 | extern int ftrace_profile_set_filter(struct perf_event *event, int event_id, |
| 196 | char *filter_str); | 193 | char *filter_str); |
| 197 | extern void ftrace_profile_free_filter(struct perf_event *event); | 194 | extern void ftrace_profile_free_filter(struct perf_event *event); |
| 195 | extern void * | ||
| 196 | ftrace_perf_buf_prepare(int size, unsigned short type, int *rctxp, | ||
| 197 | unsigned long *irq_flags); | ||
| 198 | |||
| 199 | static inline void | ||
| 200 | ftrace_perf_buf_submit(void *raw_data, int size, int rctx, u64 addr, | ||
| 201 | u64 count, unsigned long irq_flags) | ||
| 202 | { | ||
| 203 | struct trace_entry *entry = raw_data; | ||
| 204 | |||
| 205 | perf_tp_event(entry->type, addr, count, raw_data, size); | ||
| 206 | perf_swevent_put_recursion_context(rctx); | ||
| 207 | local_irq_restore(irq_flags); | ||
| 208 | } | ||
| 198 | #endif | 209 | #endif |
| 199 | 210 | ||
| 200 | #endif /* _LINUX_FTRACE_EVENT_H */ | 211 | #endif /* _LINUX_FTRACE_EVENT_H */ |
diff --git a/include/linux/gameport.h b/include/linux/gameport.h index 1bc08541c2b..48e68da097f 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h | |||
| @@ -46,7 +46,6 @@ struct gameport { | |||
| 46 | struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */ | 46 | struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */ |
| 47 | 47 | ||
| 48 | struct device dev; | 48 | struct device dev; |
| 49 | unsigned int registered; /* port has been fully registered with driver core */ | ||
| 50 | 49 | ||
| 51 | struct list_head node; | 50 | struct list_head node; |
| 52 | }; | 51 | }; |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index c6c0c41af35..9717081c75a 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
| @@ -256,9 +256,9 @@ extern struct hd_struct *disk_map_sector_rcu(struct gendisk *disk, | |||
| 256 | #define part_stat_read(part, field) \ | 256 | #define part_stat_read(part, field) \ |
| 257 | ({ \ | 257 | ({ \ |
| 258 | typeof((part)->dkstats->field) res = 0; \ | 258 | typeof((part)->dkstats->field) res = 0; \ |
| 259 | int i; \ | 259 | unsigned int _cpu; \ |
| 260 | for_each_possible_cpu(i) \ | 260 | for_each_possible_cpu(_cpu) \ |
| 261 | res += per_cpu_ptr((part)->dkstats, i)->field; \ | 261 | res += per_cpu_ptr((part)->dkstats, _cpu)->field; \ |
| 262 | res; \ | 262 | res; \ |
| 263 | }) | 263 | }) |
| 264 | 264 | ||
diff --git a/include/linux/gpio_keys.h b/include/linux/gpio_keys.h index 1289fa7623c..cd0b3f30f48 100644 --- a/include/linux/gpio_keys.h +++ b/include/linux/gpio_keys.h | |||
| @@ -10,6 +10,7 @@ struct gpio_keys_button { | |||
| 10 | int type; /* input event type (EV_KEY, EV_SW) */ | 10 | int type; /* input event type (EV_KEY, EV_SW) */ |
| 11 | int wakeup; /* configure the button as a wake-up source */ | 11 | int wakeup; /* configure the button as a wake-up source */ |
| 12 | int debounce_interval; /* debounce ticks interval in msecs */ | 12 | int debounce_interval; /* debounce ticks interval in msecs */ |
| 13 | bool can_disable; | ||
| 13 | }; | 14 | }; |
| 14 | 15 | ||
| 15 | struct gpio_keys_platform_data { | 16 | struct gpio_keys_platform_data { |
diff --git a/include/linux/hid.h b/include/linux/hid.h index 87093652dda..b1344ec4b7f 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
| @@ -501,7 +501,7 @@ struct hid_device { /* device report descriptor */ | |||
| 501 | void (*hiddev_report_event) (struct hid_device *, struct hid_report *); | 501 | void (*hiddev_report_event) (struct hid_device *, struct hid_report *); |
| 502 | 502 | ||
| 503 | /* handler for raw output data, used by hidraw */ | 503 | /* handler for raw output data, used by hidraw */ |
| 504 | int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t); | 504 | int (*hid_output_raw_report) (struct hid_device *, __u8 *, size_t, unsigned char); |
| 505 | 505 | ||
| 506 | /* debugging support via debugfs */ | 506 | /* debugging support via debugfs */ |
| 507 | unsigned short debug; | 507 | unsigned short debug; |
| @@ -663,7 +663,7 @@ struct hid_ll_driver { | |||
| 663 | 663 | ||
| 664 | /* Applications from HID Usage Tables 4/8/99 Version 1.1 */ | 664 | /* Applications from HID Usage Tables 4/8/99 Version 1.1 */ |
| 665 | /* We ignore a few input applications that are not widely used */ | 665 | /* We ignore a few input applications that are not widely used */ |
| 666 | #define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001) || (a == 0x000d0002)) | 666 | #define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001) || ((a >= 0x000d0002) && (a <= 0x000d0006))) |
| 667 | 667 | ||
| 668 | /* HID core API */ | 668 | /* HID core API */ |
| 669 | 669 | ||
| @@ -690,6 +690,7 @@ int hid_input_report(struct hid_device *, int type, u8 *, int, int); | |||
| 690 | int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field); | 690 | int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field); |
| 691 | void hid_output_report(struct hid_report *report, __u8 *data); | 691 | void hid_output_report(struct hid_report *report, __u8 *data); |
| 692 | struct hid_device *hid_allocate_device(void); | 692 | struct hid_device *hid_allocate_device(void); |
| 693 | struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id); | ||
| 693 | int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size); | 694 | int hid_parse_report(struct hid_device *hid, __u8 *start, unsigned size); |
| 694 | int hid_check_keys_pressed(struct hid_device *hid); | 695 | int hid_check_keys_pressed(struct hid_device *hid); |
| 695 | int hid_connect(struct hid_device *hid, unsigned int connect_mask); | 696 | int hid_connect(struct hid_device *hid, unsigned int connect_mask); |
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 211ff449726..74152c08ad0 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
| @@ -17,6 +17,12 @@ static inline void flush_anon_page(struct vm_area_struct *vma, struct page *page | |||
| 17 | static inline void flush_kernel_dcache_page(struct page *page) | 17 | static inline void flush_kernel_dcache_page(struct page *page) |
| 18 | { | 18 | { |
| 19 | } | 19 | } |
| 20 | static inline void flush_kernel_vmap_range(void *vaddr, int size) | ||
| 21 | { | ||
| 22 | } | ||
| 23 | static inline void invalidate_kernel_vmap_range(void *vaddr, int size) | ||
| 24 | { | ||
| 25 | } | ||
| 20 | #endif | 26 | #endif |
| 21 | 27 | ||
| 22 | #include <asm/kmap_types.h> | 28 | #include <asm/kmap_types.h> |
| @@ -46,7 +52,7 @@ void kmap_flush_unused(void); | |||
| 46 | 52 | ||
| 47 | static inline unsigned int nr_free_highpages(void) { return 0; } | 53 | static inline unsigned int nr_free_highpages(void) { return 0; } |
| 48 | 54 | ||
| 49 | #define totalhigh_pages 0 | 55 | #define totalhigh_pages 0UL |
| 50 | 56 | ||
| 51 | #ifndef ARCH_HAS_KMAP | 57 | #ifndef ARCH_HAS_KMAP |
| 52 | static inline void *kmap(struct page *page) | 58 | static inline void *kmap(struct page *page) |
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h index 41235c93e4e..5977b724f7c 100644 --- a/include/linux/hw_breakpoint.h +++ b/include/linux/hw_breakpoint.h | |||
| @@ -44,7 +44,7 @@ static inline int hw_breakpoint_type(struct perf_event *bp) | |||
| 44 | return bp->attr.bp_type; | 44 | return bp->attr.bp_type; |
| 45 | } | 45 | } |
| 46 | 46 | ||
| 47 | static inline int hw_breakpoint_len(struct perf_event *bp) | 47 | static inline unsigned long hw_breakpoint_len(struct perf_event *bp) |
| 48 | { | 48 | { |
| 49 | return bp->attr.bp_len; | 49 | return bp->attr.bp_len; |
| 50 | } | 50 | } |
| @@ -75,6 +75,8 @@ extern int __register_perf_hw_breakpoint(struct perf_event *bp); | |||
| 75 | extern void unregister_hw_breakpoint(struct perf_event *bp); | 75 | extern void unregister_hw_breakpoint(struct perf_event *bp); |
| 76 | extern void unregister_wide_hw_breakpoint(struct perf_event **cpu_events); | 76 | extern void unregister_wide_hw_breakpoint(struct perf_event **cpu_events); |
| 77 | 77 | ||
| 78 | extern int dbg_reserve_bp_slot(struct perf_event *bp); | ||
| 79 | extern int dbg_release_bp_slot(struct perf_event *bp); | ||
| 78 | extern int reserve_bp_slot(struct perf_event *bp); | 80 | extern int reserve_bp_slot(struct perf_event *bp); |
| 79 | extern void release_bp_slot(struct perf_event *bp); | 81 | extern void release_bp_slot(struct perf_event *bp); |
| 80 | 82 | ||
diff --git a/include/linux/i2c-pnx.h b/include/linux/i2c-pnx.h index 9eb07bbc652..a87124d4d53 100644 --- a/include/linux/i2c-pnx.h +++ b/include/linux/i2c-pnx.h | |||
| @@ -12,9 +12,8 @@ | |||
| 12 | #ifndef __I2C_PNX_H__ | 12 | #ifndef __I2C_PNX_H__ |
| 13 | #define __I2C_PNX_H__ | 13 | #define __I2C_PNX_H__ |
| 14 | 14 | ||
| 15 | #include <linux/pm.h> | ||
| 16 | |||
| 17 | struct platform_device; | 15 | struct platform_device; |
| 16 | struct clk; | ||
| 18 | 17 | ||
| 19 | struct i2c_pnx_mif { | 18 | struct i2c_pnx_mif { |
| 20 | int ret; /* Return value */ | 19 | int ret; /* Return value */ |
| @@ -26,20 +25,18 @@ struct i2c_pnx_mif { | |||
| 26 | }; | 25 | }; |
| 27 | 26 | ||
| 28 | struct i2c_pnx_algo_data { | 27 | struct i2c_pnx_algo_data { |
| 29 | u32 base; | 28 | void __iomem *ioaddr; |
| 30 | u32 ioaddr; | ||
| 31 | int irq; | ||
| 32 | struct i2c_pnx_mif mif; | 29 | struct i2c_pnx_mif mif; |
| 33 | int last; | 30 | int last; |
| 31 | struct clk *clk; | ||
| 32 | struct i2c_pnx_data *i2c_pnx; | ||
| 33 | struct i2c_adapter adapter; | ||
| 34 | }; | 34 | }; |
| 35 | 35 | ||
| 36 | struct i2c_pnx_data { | 36 | struct i2c_pnx_data { |
| 37 | int (*suspend) (struct platform_device *pdev, pm_message_t state); | 37 | const char *name; |
| 38 | int (*resume) (struct platform_device *pdev); | 38 | u32 base; |
| 39 | u32 (*calculate_input_freq) (struct platform_device *pdev); | 39 | int irq; |
| 40 | int (*set_clock_run) (struct platform_device *pdev); | ||
| 41 | int (*set_clock_stop) (struct platform_device *pdev); | ||
| 42 | struct i2c_adapter *adapter; | ||
| 43 | }; | 40 | }; |
| 44 | 41 | ||
| 45 | #endif /* __I2C_PNX_H__ */ | 42 | #endif /* __I2C_PNX_H__ */ |
diff --git a/include/linux/i2c/adp5588.h b/include/linux/i2c/adp5588.h index fc5db826b48..02c9af37474 100644 --- a/include/linux/i2c/adp5588.h +++ b/include/linux/i2c/adp5588.h | |||
| @@ -89,4 +89,16 @@ struct adp5588_kpad_platform_data { | |||
| 89 | unsigned short unlock_key2; /* Unlock Key 2 */ | 89 | unsigned short unlock_key2; /* Unlock Key 2 */ |
| 90 | }; | 90 | }; |
| 91 | 91 | ||
| 92 | struct adp5588_gpio_platform_data { | ||
| 93 | unsigned gpio_start; /* GPIO Chip base # */ | ||
| 94 | unsigned pullup_dis_mask; /* Pull-Up Disable Mask */ | ||
| 95 | int (*setup)(struct i2c_client *client, | ||
| 96 | int gpio, unsigned ngpio, | ||
| 97 | void *context); | ||
| 98 | int (*teardown)(struct i2c_client *client, | ||
| 99 | int gpio, unsigned ngpio, | ||
| 100 | void *context); | ||
| 101 | void *context; | ||
| 102 | }; | ||
| 103 | |||
| 92 | #endif | 104 | #endif |
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h index bf1c5be1f5b..7897f309656 100644 --- a/include/linux/i2c/twl.h +++ b/include/linux/i2c/twl.h | |||
| @@ -547,6 +547,10 @@ struct twl4030_codec_data { | |||
| 547 | unsigned int audio_mclk; | 547 | unsigned int audio_mclk; |
| 548 | struct twl4030_codec_audio_data *audio; | 548 | struct twl4030_codec_audio_data *audio; |
| 549 | struct twl4030_codec_vibra_data *vibra; | 549 | struct twl4030_codec_vibra_data *vibra; |
| 550 | |||
| 551 | /* twl6030 */ | ||
| 552 | int audpwron_gpio; /* audio power-on gpio */ | ||
| 553 | int naudint_irq; /* audio interrupt */ | ||
| 550 | }; | 554 | }; |
| 551 | 555 | ||
| 552 | struct twl4030_platform_data { | 556 | struct twl4030_platform_data { |
diff --git a/include/linux/i2o.h b/include/linux/i2o.h index 4c4e57d1f19..87018dc5527 100644 --- a/include/linux/i2o.h +++ b/include/linux/i2o.h | |||
| @@ -385,7 +385,7 @@ | |||
| 385 | /* defines for max_sectors and max_phys_segments */ | 385 | /* defines for max_sectors and max_phys_segments */ |
| 386 | #define I2O_MAX_SECTORS 1024 | 386 | #define I2O_MAX_SECTORS 1024 |
| 387 | #define I2O_MAX_SECTORS_LIMITED 128 | 387 | #define I2O_MAX_SECTORS_LIMITED 128 |
| 388 | #define I2O_MAX_PHYS_SEGMENTS MAX_PHYS_SEGMENTS | 388 | #define I2O_MAX_PHYS_SEGMENTS BLK_MAX_SEGMENTS |
| 389 | 389 | ||
| 390 | /* | 390 | /* |
| 391 | * Message structures | 391 | * Message structures |
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h index c0d8357917e..4c4c74ec598 100644 --- a/include/linux/icmpv6.h +++ b/include/linux/icmpv6.h | |||
| @@ -174,8 +174,7 @@ struct icmp6_filter { | |||
| 174 | 174 | ||
| 175 | extern void icmpv6_send(struct sk_buff *skb, | 175 | extern void icmpv6_send(struct sk_buff *skb, |
| 176 | u8 type, u8 code, | 176 | u8 type, u8 code, |
| 177 | __u32 info, | 177 | __u32 info); |
| 178 | struct net_device *dev); | ||
| 179 | 178 | ||
| 180 | extern int icmpv6_init(void); | 179 | extern int icmpv6_init(void); |
| 181 | extern int icmpv6_err_convert(u8 type, u8 code, | 180 | extern int icmpv6_err_convert(u8 type, u8 code, |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index d9724a28c0c..19984958ab7 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
| @@ -120,6 +120,26 @@ | |||
| 120 | #define IEEE80211_QOS_CTL_TID_MASK 0x000F | 120 | #define IEEE80211_QOS_CTL_TID_MASK 0x000F |
| 121 | #define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007 | 121 | #define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007 |
| 122 | 122 | ||
| 123 | /* U-APSD queue for WMM IEs sent by AP */ | ||
| 124 | #define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7) | ||
| 125 | |||
| 126 | /* U-APSD queues for WMM IEs sent by STA */ | ||
| 127 | #define IEEE80211_WMM_IE_STA_QOSINFO_AC_VO (1<<0) | ||
| 128 | #define IEEE80211_WMM_IE_STA_QOSINFO_AC_VI (1<<1) | ||
| 129 | #define IEEE80211_WMM_IE_STA_QOSINFO_AC_BK (1<<2) | ||
| 130 | #define IEEE80211_WMM_IE_STA_QOSINFO_AC_BE (1<<3) | ||
| 131 | #define IEEE80211_WMM_IE_STA_QOSINFO_AC_MASK 0x0f | ||
| 132 | |||
| 133 | /* U-APSD max SP length for WMM IEs sent by STA */ | ||
| 134 | #define IEEE80211_WMM_IE_STA_QOSINFO_SP_ALL 0x00 | ||
| 135 | #define IEEE80211_WMM_IE_STA_QOSINFO_SP_2 0x01 | ||
| 136 | #define IEEE80211_WMM_IE_STA_QOSINFO_SP_4 0x02 | ||
| 137 | #define IEEE80211_WMM_IE_STA_QOSINFO_SP_6 0x03 | ||
| 138 | #define IEEE80211_WMM_IE_STA_QOSINFO_SP_MASK 0x03 | ||
| 139 | #define IEEE80211_WMM_IE_STA_QOSINFO_SP_SHIFT 5 | ||
| 140 | |||
| 141 | #define IEEE80211_HT_CTL_LEN 4 | ||
| 142 | |||
| 123 | struct ieee80211_hdr { | 143 | struct ieee80211_hdr { |
| 124 | __le16 frame_control; | 144 | __le16 frame_control; |
| 125 | __le16 duration_id; | 145 | __le16 duration_id; |
| @@ -130,6 +150,25 @@ struct ieee80211_hdr { | |||
| 130 | u8 addr4[6]; | 150 | u8 addr4[6]; |
| 131 | } __attribute__ ((packed)); | 151 | } __attribute__ ((packed)); |
| 132 | 152 | ||
| 153 | struct ieee80211_hdr_3addr { | ||
| 154 | __le16 frame_control; | ||
| 155 | __le16 duration_id; | ||
| 156 | u8 addr1[6]; | ||
| 157 | u8 addr2[6]; | ||
| 158 | u8 addr3[6]; | ||
| 159 | __le16 seq_ctrl; | ||
| 160 | } __attribute__ ((packed)); | ||
| 161 | |||
| 162 | struct ieee80211_qos_hdr { | ||
| 163 | __le16 frame_control; | ||
| 164 | __le16 duration_id; | ||
| 165 | u8 addr1[6]; | ||
| 166 | u8 addr2[6]; | ||
| 167 | u8 addr3[6]; | ||
| 168 | __le16 seq_ctrl; | ||
| 169 | __le16 qos_ctrl; | ||
| 170 | } __attribute__ ((packed)); | ||
| 171 | |||
| 133 | /** | 172 | /** |
| 134 | * ieee80211_has_tods - check if IEEE80211_FCTL_TODS is set | 173 | * ieee80211_has_tods - check if IEEE80211_FCTL_TODS is set |
| 135 | * @fc: frame control bytes in little-endian byteorder | 174 | * @fc: frame control bytes in little-endian byteorder |
| @@ -707,6 +746,10 @@ struct ieee80211_mgmt { | |||
| 707 | u8 action; | 746 | u8 action; |
| 708 | u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN]; | 747 | u8 trans_id[WLAN_SA_QUERY_TR_ID_LEN]; |
| 709 | } __attribute__ ((packed)) sa_query; | 748 | } __attribute__ ((packed)) sa_query; |
| 749 | struct { | ||
| 750 | u8 action; | ||
| 751 | u8 smps_control; | ||
| 752 | } __attribute__ ((packed)) ht_smps; | ||
| 710 | } u; | 753 | } u; |
| 711 | } __attribute__ ((packed)) action; | 754 | } __attribute__ ((packed)) action; |
| 712 | } u; | 755 | } u; |
| @@ -771,7 +814,10 @@ struct ieee80211_bar { | |||
| 771 | /** | 814 | /** |
| 772 | * struct ieee80211_mcs_info - MCS information | 815 | * struct ieee80211_mcs_info - MCS information |
| 773 | * @rx_mask: RX mask | 816 | * @rx_mask: RX mask |
| 774 | * @rx_highest: highest supported RX rate | 817 | * @rx_highest: highest supported RX rate. If set represents |
| 818 | * the highest supported RX data rate in units of 1 Mbps. | ||
| 819 | * If this field is 0 this value should not be used to | ||
| 820 | * consider the highest RX data rate supported. | ||
| 775 | * @tx_params: TX parameters | 821 | * @tx_params: TX parameters |
| 776 | */ | 822 | */ |
| 777 | struct ieee80211_mcs_info { | 823 | struct ieee80211_mcs_info { |
| @@ -824,6 +870,7 @@ struct ieee80211_ht_cap { | |||
| 824 | #define IEEE80211_HT_CAP_LDPC_CODING 0x0001 | 870 | #define IEEE80211_HT_CAP_LDPC_CODING 0x0001 |
| 825 | #define IEEE80211_HT_CAP_SUP_WIDTH_20_40 0x0002 | 871 | #define IEEE80211_HT_CAP_SUP_WIDTH_20_40 0x0002 |
| 826 | #define IEEE80211_HT_CAP_SM_PS 0x000C | 872 | #define IEEE80211_HT_CAP_SM_PS 0x000C |
| 873 | #define IEEE80211_HT_CAP_SM_PS_SHIFT 2 | ||
| 827 | #define IEEE80211_HT_CAP_GRN_FLD 0x0010 | 874 | #define IEEE80211_HT_CAP_GRN_FLD 0x0010 |
| 828 | #define IEEE80211_HT_CAP_SGI_20 0x0020 | 875 | #define IEEE80211_HT_CAP_SGI_20 0x0020 |
| 829 | #define IEEE80211_HT_CAP_SGI_40 0x0040 | 876 | #define IEEE80211_HT_CAP_SGI_40 0x0040 |
| @@ -832,13 +879,14 @@ struct ieee80211_ht_cap { | |||
| 832 | #define IEEE80211_HT_CAP_DELAY_BA 0x0400 | 879 | #define IEEE80211_HT_CAP_DELAY_BA 0x0400 |
| 833 | #define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 | 880 | #define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 |
| 834 | #define IEEE80211_HT_CAP_DSSSCCK40 0x1000 | 881 | #define IEEE80211_HT_CAP_DSSSCCK40 0x1000 |
| 835 | #define IEEE80211_HT_CAP_PSMP_SUPPORT 0x2000 | 882 | #define IEEE80211_HT_CAP_RESERVED 0x2000 |
| 836 | #define IEEE80211_HT_CAP_40MHZ_INTOLERANT 0x4000 | 883 | #define IEEE80211_HT_CAP_40MHZ_INTOLERANT 0x4000 |
| 837 | #define IEEE80211_HT_CAP_LSIG_TXOP_PROT 0x8000 | 884 | #define IEEE80211_HT_CAP_LSIG_TXOP_PROT 0x8000 |
| 838 | 885 | ||
| 839 | /* 802.11n HT capability AMPDU settings (for ampdu_params_info) */ | 886 | /* 802.11n HT capability AMPDU settings (for ampdu_params_info) */ |
| 840 | #define IEEE80211_HT_AMPDU_PARM_FACTOR 0x03 | 887 | #define IEEE80211_HT_AMPDU_PARM_FACTOR 0x03 |
| 841 | #define IEEE80211_HT_AMPDU_PARM_DENSITY 0x1C | 888 | #define IEEE80211_HT_AMPDU_PARM_DENSITY 0x1C |
| 889 | #define IEEE80211_HT_AMPDU_PARM_DENSITY_SHIFT 2 | ||
| 842 | 890 | ||
| 843 | /* | 891 | /* |
| 844 | * Maximum length of AMPDU that the STA can receive. | 892 | * Maximum length of AMPDU that the STA can receive. |
| @@ -922,12 +970,17 @@ struct ieee80211_ht_info { | |||
| 922 | #define IEEE80211_MAX_AMPDU_BUF 0x40 | 970 | #define IEEE80211_MAX_AMPDU_BUF 0x40 |
| 923 | 971 | ||
| 924 | 972 | ||
| 925 | /* Spatial Multiplexing Power Save Modes */ | 973 | /* Spatial Multiplexing Power Save Modes (for capability) */ |
| 926 | #define WLAN_HT_CAP_SM_PS_STATIC 0 | 974 | #define WLAN_HT_CAP_SM_PS_STATIC 0 |
| 927 | #define WLAN_HT_CAP_SM_PS_DYNAMIC 1 | 975 | #define WLAN_HT_CAP_SM_PS_DYNAMIC 1 |
| 928 | #define WLAN_HT_CAP_SM_PS_INVALID 2 | 976 | #define WLAN_HT_CAP_SM_PS_INVALID 2 |
| 929 | #define WLAN_HT_CAP_SM_PS_DISABLED 3 | 977 | #define WLAN_HT_CAP_SM_PS_DISABLED 3 |
| 930 | 978 | ||
| 979 | /* for SM power control field lower two bits */ | ||
| 980 | #define WLAN_HT_SMPS_CONTROL_DISABLED 0 | ||
| 981 | #define WLAN_HT_SMPS_CONTROL_STATIC 1 | ||
| 982 | #define WLAN_HT_SMPS_CONTROL_DYNAMIC 3 | ||
| 983 | |||
| 931 | /* Authentication algorithms */ | 984 | /* Authentication algorithms */ |
| 932 | #define WLAN_AUTH_OPEN 0 | 985 | #define WLAN_AUTH_OPEN 0 |
| 933 | #define WLAN_AUTH_SHARED_KEY 1 | 986 | #define WLAN_AUTH_SHARED_KEY 1 |
| @@ -1071,12 +1124,12 @@ enum ieee80211_eid { | |||
| 1071 | WLAN_EID_TIM = 5, | 1124 | WLAN_EID_TIM = 5, |
| 1072 | WLAN_EID_IBSS_PARAMS = 6, | 1125 | WLAN_EID_IBSS_PARAMS = 6, |
| 1073 | WLAN_EID_CHALLENGE = 16, | 1126 | WLAN_EID_CHALLENGE = 16, |
| 1074 | /* 802.11d */ | 1127 | |
| 1075 | WLAN_EID_COUNTRY = 7, | 1128 | WLAN_EID_COUNTRY = 7, |
| 1076 | WLAN_EID_HP_PARAMS = 8, | 1129 | WLAN_EID_HP_PARAMS = 8, |
| 1077 | WLAN_EID_HP_TABLE = 9, | 1130 | WLAN_EID_HP_TABLE = 9, |
| 1078 | WLAN_EID_REQUEST = 10, | 1131 | WLAN_EID_REQUEST = 10, |
| 1079 | /* 802.11e */ | 1132 | |
| 1080 | WLAN_EID_QBSS_LOAD = 11, | 1133 | WLAN_EID_QBSS_LOAD = 11, |
| 1081 | WLAN_EID_EDCA_PARAM_SET = 12, | 1134 | WLAN_EID_EDCA_PARAM_SET = 12, |
| 1082 | WLAN_EID_TSPEC = 13, | 1135 | WLAN_EID_TSPEC = 13, |
| @@ -1099,7 +1152,7 @@ enum ieee80211_eid { | |||
| 1099 | WLAN_EID_PREP = 69, | 1152 | WLAN_EID_PREP = 69, |
| 1100 | WLAN_EID_PERR = 70, | 1153 | WLAN_EID_PERR = 70, |
| 1101 | WLAN_EID_RANN = 49, /* compatible with FreeBSD */ | 1154 | WLAN_EID_RANN = 49, /* compatible with FreeBSD */ |
| 1102 | /* 802.11h */ | 1155 | |
| 1103 | WLAN_EID_PWR_CONSTRAINT = 32, | 1156 | WLAN_EID_PWR_CONSTRAINT = 32, |
| 1104 | WLAN_EID_PWR_CAPABILITY = 33, | 1157 | WLAN_EID_PWR_CAPABILITY = 33, |
| 1105 | WLAN_EID_TPC_REQUEST = 34, | 1158 | WLAN_EID_TPC_REQUEST = 34, |
| @@ -1110,20 +1163,41 @@ enum ieee80211_eid { | |||
| 1110 | WLAN_EID_MEASURE_REPORT = 39, | 1163 | WLAN_EID_MEASURE_REPORT = 39, |
| 1111 | WLAN_EID_QUIET = 40, | 1164 | WLAN_EID_QUIET = 40, |
| 1112 | WLAN_EID_IBSS_DFS = 41, | 1165 | WLAN_EID_IBSS_DFS = 41, |
| 1113 | /* 802.11g */ | 1166 | |
| 1114 | WLAN_EID_ERP_INFO = 42, | 1167 | WLAN_EID_ERP_INFO = 42, |
| 1115 | WLAN_EID_EXT_SUPP_RATES = 50, | 1168 | WLAN_EID_EXT_SUPP_RATES = 50, |
| 1116 | /* 802.11n */ | 1169 | |
| 1117 | WLAN_EID_HT_CAPABILITY = 45, | 1170 | WLAN_EID_HT_CAPABILITY = 45, |
| 1118 | WLAN_EID_HT_INFORMATION = 61, | 1171 | WLAN_EID_HT_INFORMATION = 61, |
| 1119 | /* 802.11i */ | 1172 | |
| 1120 | WLAN_EID_RSN = 48, | 1173 | WLAN_EID_RSN = 48, |
| 1121 | WLAN_EID_TIMEOUT_INTERVAL = 56, | 1174 | WLAN_EID_MMIE = 76, |
| 1122 | WLAN_EID_MMIE = 76 /* 802.11w */, | ||
| 1123 | WLAN_EID_WPA = 221, | 1175 | WLAN_EID_WPA = 221, |
| 1124 | WLAN_EID_GENERIC = 221, | 1176 | WLAN_EID_GENERIC = 221, |
| 1125 | WLAN_EID_VENDOR_SPECIFIC = 221, | 1177 | WLAN_EID_VENDOR_SPECIFIC = 221, |
| 1126 | WLAN_EID_QOS_PARAMETER = 222 | 1178 | WLAN_EID_QOS_PARAMETER = 222, |
| 1179 | |||
| 1180 | WLAN_EID_AP_CHAN_REPORT = 51, | ||
| 1181 | WLAN_EID_NEIGHBOR_REPORT = 52, | ||
| 1182 | WLAN_EID_RCPI = 53, | ||
| 1183 | WLAN_EID_BSS_AVG_ACCESS_DELAY = 63, | ||
| 1184 | WLAN_EID_ANTENNA_INFO = 64, | ||
| 1185 | WLAN_EID_RSNI = 65, | ||
| 1186 | WLAN_EID_MEASUREMENT_PILOT_TX_INFO = 66, | ||
| 1187 | WLAN_EID_BSS_AVAILABLE_CAPACITY = 67, | ||
| 1188 | WLAN_EID_BSS_AC_ACCESS_DELAY = 68, | ||
| 1189 | WLAN_EID_RRM_ENABLED_CAPABILITIES = 70, | ||
| 1190 | WLAN_EID_MULTIPLE_BSSID = 71, | ||
| 1191 | |||
| 1192 | WLAN_EID_MOBILITY_DOMAIN = 54, | ||
| 1193 | WLAN_EID_FAST_BSS_TRANSITION = 55, | ||
| 1194 | WLAN_EID_TIMEOUT_INTERVAL = 56, | ||
| 1195 | WLAN_EID_RIC_DATA = 57, | ||
| 1196 | WLAN_EID_RIC_DESCRIPTOR = 75, | ||
| 1197 | |||
| 1198 | WLAN_EID_DSE_REGISTERED_LOCATION = 58, | ||
| 1199 | WLAN_EID_SUPPORTED_REGULATORY_CLASSES = 59, | ||
| 1200 | WLAN_EID_EXT_CHANSWITCH_ANN = 60, | ||
| 1127 | }; | 1201 | }; |
| 1128 | 1202 | ||
| 1129 | /* Action category code */ | 1203 | /* Action category code */ |
| @@ -1150,6 +1224,18 @@ enum ieee80211_spectrum_mgmt_actioncode { | |||
| 1150 | WLAN_ACTION_SPCT_CHL_SWITCH = 4, | 1224 | WLAN_ACTION_SPCT_CHL_SWITCH = 4, |
| 1151 | }; | 1225 | }; |
| 1152 | 1226 | ||
| 1227 | /* HT action codes */ | ||
| 1228 | enum ieee80211_ht_actioncode { | ||
| 1229 | WLAN_HT_ACTION_NOTIFY_CHANWIDTH = 0, | ||
| 1230 | WLAN_HT_ACTION_SMPS = 1, | ||
| 1231 | WLAN_HT_ACTION_PSMP = 2, | ||
| 1232 | WLAN_HT_ACTION_PCO_PHASE = 3, | ||
| 1233 | WLAN_HT_ACTION_CSI = 4, | ||
| 1234 | WLAN_HT_ACTION_NONCOMPRESSED_BF = 5, | ||
| 1235 | WLAN_HT_ACTION_COMPRESSED_BF = 6, | ||
| 1236 | WLAN_HT_ACTION_ASEL_IDX_FEEDBACK = 7, | ||
| 1237 | }; | ||
| 1238 | |||
| 1153 | /* Security key length */ | 1239 | /* Security key length */ |
| 1154 | enum ieee80211_key_len { | 1240 | enum ieee80211_key_len { |
| 1155 | WLAN_KEY_LEN_WEP40 = 5, | 1241 | WLAN_KEY_LEN_WEP40 = 5, |
diff --git a/include/linux/if_link.h b/include/linux/if_link.h index 6674791622c..c9bf92cd765 100644 --- a/include/linux/if_link.h +++ b/include/linux/if_link.h | |||
| @@ -78,6 +78,11 @@ enum { | |||
| 78 | #define IFLA_LINKINFO IFLA_LINKINFO | 78 | #define IFLA_LINKINFO IFLA_LINKINFO |
| 79 | IFLA_NET_NS_PID, | 79 | IFLA_NET_NS_PID, |
| 80 | IFLA_IFALIAS, | 80 | IFLA_IFALIAS, |
| 81 | IFLA_NUM_VF, /* Number of VFs if device is SR-IOV PF */ | ||
| 82 | IFLA_VF_MAC, /* Hardware queue specific attributes */ | ||
| 83 | IFLA_VF_VLAN, | ||
| 84 | IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */ | ||
| 85 | IFLA_VFINFO, | ||
| 81 | __IFLA_MAX | 86 | __IFLA_MAX |
| 82 | }; | 87 | }; |
| 83 | 88 | ||
| @@ -196,4 +201,29 @@ enum macvlan_mode { | |||
| 196 | MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */ | 201 | MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */ |
| 197 | }; | 202 | }; |
| 198 | 203 | ||
| 204 | /* SR-IOV virtual function managment section */ | ||
| 205 | |||
| 206 | struct ifla_vf_mac { | ||
| 207 | __u32 vf; | ||
| 208 | __u8 mac[32]; /* MAX_ADDR_LEN */ | ||
| 209 | }; | ||
| 210 | |||
| 211 | struct ifla_vf_vlan { | ||
| 212 | __u32 vf; | ||
| 213 | __u32 vlan; /* 0 - 4095, 0 disables VLAN filter */ | ||
| 214 | __u32 qos; | ||
| 215 | }; | ||
| 216 | |||
| 217 | struct ifla_vf_tx_rate { | ||
| 218 | __u32 vf; | ||
| 219 | __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */ | ||
| 220 | }; | ||
| 221 | |||
| 222 | struct ifla_vf_info { | ||
| 223 | __u32 vf; | ||
| 224 | __u8 mac[32]; | ||
| 225 | __u32 vlan; | ||
| 226 | __u32 qos; | ||
| 227 | __u32 tx_rate; | ||
| 228 | }; | ||
| 199 | #endif /* _LINUX_IF_LINK_H */ | 229 | #endif /* _LINUX_IF_LINK_H */ |
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h index 5f200bac374..b78a712247d 100644 --- a/include/linux/if_macvlan.h +++ b/include/linux/if_macvlan.h | |||
| @@ -1,6 +1,90 @@ | |||
| 1 | #ifndef _LINUX_IF_MACVLAN_H | 1 | #ifndef _LINUX_IF_MACVLAN_H |
| 2 | #define _LINUX_IF_MACVLAN_H | 2 | #define _LINUX_IF_MACVLAN_H |
| 3 | 3 | ||
| 4 | #include <linux/if_link.h> | ||
| 5 | #include <linux/list.h> | ||
| 6 | #include <linux/netdevice.h> | ||
| 7 | #include <linux/netlink.h> | ||
| 8 | #include <net/netlink.h> | ||
| 9 | |||
| 10 | #if defined(CONFIG_MACVTAP) || defined(CONFIG_MACVTAP_MODULE) | ||
| 11 | struct socket *macvtap_get_socket(struct file *); | ||
| 12 | #else | ||
| 13 | #include <linux/err.h> | ||
| 14 | #include <linux/errno.h> | ||
| 15 | struct file; | ||
| 16 | struct socket; | ||
| 17 | static inline struct socket *macvtap_get_socket(struct file *f) | ||
| 18 | { | ||
| 19 | return ERR_PTR(-EINVAL); | ||
| 20 | } | ||
| 21 | #endif /* CONFIG_MACVTAP */ | ||
| 22 | |||
| 23 | struct macvlan_port; | ||
| 24 | struct macvtap_queue; | ||
| 25 | |||
| 26 | /** | ||
| 27 | * struct macvlan_rx_stats - MACVLAN percpu rx stats | ||
| 28 | * @rx_packets: number of received packets | ||
| 29 | * @rx_bytes: number of received bytes | ||
| 30 | * @multicast: number of received multicast packets | ||
| 31 | * @rx_errors: number of errors | ||
| 32 | */ | ||
| 33 | struct macvlan_rx_stats { | ||
| 34 | unsigned long rx_packets; | ||
| 35 | unsigned long rx_bytes; | ||
| 36 | unsigned long multicast; | ||
| 37 | unsigned long rx_errors; | ||
| 38 | }; | ||
| 39 | |||
| 40 | struct macvlan_dev { | ||
| 41 | struct net_device *dev; | ||
| 42 | struct list_head list; | ||
| 43 | struct hlist_node hlist; | ||
| 44 | struct macvlan_port *port; | ||
| 45 | struct net_device *lowerdev; | ||
| 46 | struct macvlan_rx_stats __percpu *rx_stats; | ||
| 47 | enum macvlan_mode mode; | ||
| 48 | int (*receive)(struct sk_buff *skb); | ||
| 49 | int (*forward)(struct net_device *dev, struct sk_buff *skb); | ||
| 50 | struct macvtap_queue *tap; | ||
| 51 | }; | ||
| 52 | |||
| 53 | static inline void macvlan_count_rx(const struct macvlan_dev *vlan, | ||
| 54 | unsigned int len, bool success, | ||
| 55 | bool multicast) | ||
| 56 | { | ||
| 57 | struct macvlan_rx_stats *rx_stats; | ||
| 58 | |||
| 59 | rx_stats = per_cpu_ptr(vlan->rx_stats, smp_processor_id()); | ||
| 60 | if (likely(success)) { | ||
| 61 | rx_stats->rx_packets++;; | ||
| 62 | rx_stats->rx_bytes += len; | ||
| 63 | if (multicast) | ||
| 64 | rx_stats->multicast++; | ||
| 65 | } else { | ||
| 66 | rx_stats->rx_errors++; | ||
| 67 | } | ||
| 68 | } | ||
| 69 | |||
| 70 | extern int macvlan_common_newlink(struct net *src_net, struct net_device *dev, | ||
| 71 | struct nlattr *tb[], struct nlattr *data[], | ||
| 72 | int (*receive)(struct sk_buff *skb), | ||
| 73 | int (*forward)(struct net_device *dev, | ||
| 74 | struct sk_buff *skb)); | ||
| 75 | |||
| 76 | extern void macvlan_count_rx(const struct macvlan_dev *vlan, | ||
| 77 | unsigned int len, bool success, | ||
| 78 | bool multicast); | ||
| 79 | |||
| 80 | extern void macvlan_dellink(struct net_device *dev, struct list_head *head); | ||
| 81 | |||
| 82 | extern int macvlan_link_register(struct rtnl_link_ops *ops); | ||
| 83 | |||
| 84 | extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb, | ||
| 85 | struct net_device *dev); | ||
| 86 | |||
| 87 | |||
| 4 | extern struct sk_buff *(*macvlan_handle_frame_hook)(struct sk_buff *); | 88 | extern struct sk_buff *(*macvlan_handle_frame_hook)(struct sk_buff *); |
| 5 | 89 | ||
| 6 | #endif /* _LINUX_IF_MACVLAN_H */ | 90 | #endif /* _LINUX_IF_MACVLAN_H */ |
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h index 4021d47cc43..aa57a5f993f 100644 --- a/include/linux/if_packet.h +++ b/include/linux/if_packet.h | |||
| @@ -46,6 +46,7 @@ struct sockaddr_ll { | |||
| 46 | #define PACKET_RESERVE 12 | 46 | #define PACKET_RESERVE 12 |
| 47 | #define PACKET_TX_RING 13 | 47 | #define PACKET_TX_RING 13 |
| 48 | #define PACKET_LOSS 14 | 48 | #define PACKET_LOSS 14 |
| 49 | #define PACKET_VNET_HDR 15 | ||
| 49 | 50 | ||
| 50 | struct tpacket_stats { | 51 | struct tpacket_stats { |
| 51 | unsigned int tp_packets; | 52 | unsigned int tp_packets; |
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h index 3f5fd523b49..1350a246893 100644 --- a/include/linux/if_tun.h +++ b/include/linux/if_tun.h | |||
| @@ -18,6 +18,7 @@ | |||
| 18 | 18 | ||
| 19 | #include <linux/types.h> | 19 | #include <linux/types.h> |
| 20 | #include <linux/if_ether.h> | 20 | #include <linux/if_ether.h> |
| 21 | #include <linux/filter.h> | ||
| 21 | 22 | ||
| 22 | /* Read queue size */ | 23 | /* Read queue size */ |
| 23 | #define TUN_READQ_SIZE 500 | 24 | #define TUN_READQ_SIZE 500 |
| @@ -48,6 +49,8 @@ | |||
| 48 | #define TUNGETIFF _IOR('T', 210, unsigned int) | 49 | #define TUNGETIFF _IOR('T', 210, unsigned int) |
| 49 | #define TUNGETSNDBUF _IOR('T', 211, int) | 50 | #define TUNGETSNDBUF _IOR('T', 211, int) |
| 50 | #define TUNSETSNDBUF _IOW('T', 212, int) | 51 | #define TUNSETSNDBUF _IOW('T', 212, int) |
| 52 | #define TUNATTACHFILTER _IOW('T', 213, struct sock_fprog) | ||
| 53 | #define TUNDETACHFILTER _IOW('T', 214, struct sock_fprog) | ||
| 51 | 54 | ||
| 52 | /* TUNSETIFF ifr flags */ | 55 | /* TUNSETIFF ifr flags */ |
| 53 | #define IFF_TUN 0x0001 | 56 | #define IFF_TUN 0x0001 |
| @@ -86,4 +89,18 @@ struct tun_filter { | |||
| 86 | __u8 addr[0][ETH_ALEN]; | 89 | __u8 addr[0][ETH_ALEN]; |
| 87 | }; | 90 | }; |
| 88 | 91 | ||
| 92 | #ifdef __KERNEL__ | ||
| 93 | #if defined(CONFIG_TUN) || defined(CONFIG_TUN_MODULE) | ||
| 94 | struct socket *tun_get_socket(struct file *); | ||
| 95 | #else | ||
| 96 | #include <linux/err.h> | ||
| 97 | #include <linux/errno.h> | ||
| 98 | struct file; | ||
| 99 | struct socket; | ||
| 100 | static inline struct socket *tun_get_socket(struct file *f) | ||
| 101 | { | ||
| 102 | return ERR_PTR(-EINVAL); | ||
| 103 | } | ||
| 104 | #endif /* CONFIG_TUN */ | ||
| 105 | #endif /* __KERNEL__ */ | ||
| 89 | #endif /* __IF_TUN_H */ | 106 | #endif /* __IF_TUN_H */ |
diff --git a/include/linux/igmp.h b/include/linux/igmp.h index 724c27e5d17..93fc2449af1 100644 --- a/include/linux/igmp.h +++ b/include/linux/igmp.h | |||
| @@ -153,6 +153,7 @@ extern int sysctl_igmp_max_msf; | |||
| 153 | struct ip_sf_socklist { | 153 | struct ip_sf_socklist { |
| 154 | unsigned int sl_max; | 154 | unsigned int sl_max; |
| 155 | unsigned int sl_count; | 155 | unsigned int sl_count; |
| 156 | struct rcu_head rcu; | ||
| 156 | __be32 sl_addr[0]; | 157 | __be32 sl_addr[0]; |
| 157 | }; | 158 | }; |
| 158 | 159 | ||
| @@ -170,6 +171,7 @@ struct ip_mc_socklist { | |||
| 170 | struct ip_mreqn multi; | 171 | struct ip_mreqn multi; |
| 171 | unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ | 172 | unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ |
| 172 | struct ip_sf_socklist *sflist; | 173 | struct ip_sf_socklist *sflist; |
| 174 | struct rcu_head rcu; | ||
| 173 | }; | 175 | }; |
| 174 | 176 | ||
| 175 | struct ip_sf_list { | 177 | struct ip_sf_list { |
diff --git a/include/linux/ima.h b/include/linux/ima.h index 99dc6d5cf7e..975837e7d6c 100644 --- a/include/linux/ima.h +++ b/include/linux/ima.h | |||
| @@ -17,7 +17,7 @@ struct linux_binprm; | |||
| 17 | extern int ima_bprm_check(struct linux_binprm *bprm); | 17 | extern int ima_bprm_check(struct linux_binprm *bprm); |
| 18 | extern int ima_inode_alloc(struct inode *inode); | 18 | extern int ima_inode_alloc(struct inode *inode); |
| 19 | extern void ima_inode_free(struct inode *inode); | 19 | extern void ima_inode_free(struct inode *inode); |
| 20 | extern int ima_path_check(struct path *path, int mask); | 20 | extern int ima_file_check(struct file *file, int mask); |
| 21 | extern void ima_file_free(struct file *file); | 21 | extern void ima_file_free(struct file *file); |
| 22 | extern int ima_file_mmap(struct file *file, unsigned long prot); | 22 | extern int ima_file_mmap(struct file *file, unsigned long prot); |
| 23 | extern void ima_counts_get(struct file *file); | 23 | extern void ima_counts_get(struct file *file); |
| @@ -38,7 +38,7 @@ static inline void ima_inode_free(struct inode *inode) | |||
| 38 | return; | 38 | return; |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | static inline int ima_path_check(struct path *path, int mask) | 41 | static inline int ima_file_check(struct file *file, int mask) |
| 42 | { | 42 | { |
| 43 | return 0; | 43 | return 0; |
| 44 | } | 44 | } |
diff --git a/include/linux/in.h b/include/linux/in.h index b615649db12..583c76f9c30 100644 --- a/include/linux/in.h +++ b/include/linux/in.h | |||
| @@ -84,6 +84,8 @@ struct in_addr { | |||
| 84 | #define IP_ORIGDSTADDR 20 | 84 | #define IP_ORIGDSTADDR 20 |
| 85 | #define IP_RECVORIGDSTADDR IP_ORIGDSTADDR | 85 | #define IP_RECVORIGDSTADDR IP_ORIGDSTADDR |
| 86 | 86 | ||
| 87 | #define IP_MINTTL 21 | ||
| 88 | |||
| 87 | /* IP_MTU_DISCOVER values */ | 89 | /* IP_MTU_DISCOVER values */ |
| 88 | #define IP_PMTUDISC_DONT 0 /* Never send DF frames */ | 90 | #define IP_PMTUDISC_DONT 0 /* Never send DF frames */ |
| 89 | #define IP_PMTUDISC_WANT 1 /* Use per route hints */ | 91 | #define IP_PMTUDISC_WANT 1 /* Use per route hints */ |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 699e85c01a4..2be1a1a2beb 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
| @@ -10,10 +10,40 @@ | |||
| 10 | #include <linux/timer.h> | 10 | #include <linux/timer.h> |
| 11 | #include <linux/sysctl.h> | 11 | #include <linux/sysctl.h> |
| 12 | 12 | ||
| 13 | enum | ||
| 14 | { | ||
| 15 | IPV4_DEVCONF_FORWARDING=1, | ||
| 16 | IPV4_DEVCONF_MC_FORWARDING, | ||
| 17 | IPV4_DEVCONF_PROXY_ARP, | ||
| 18 | IPV4_DEVCONF_ACCEPT_REDIRECTS, | ||
| 19 | IPV4_DEVCONF_SECURE_REDIRECTS, | ||
| 20 | IPV4_DEVCONF_SEND_REDIRECTS, | ||
| 21 | IPV4_DEVCONF_SHARED_MEDIA, | ||
| 22 | IPV4_DEVCONF_RP_FILTER, | ||
| 23 | IPV4_DEVCONF_ACCEPT_SOURCE_ROUTE, | ||
| 24 | IPV4_DEVCONF_BOOTP_RELAY, | ||
| 25 | IPV4_DEVCONF_LOG_MARTIANS, | ||
| 26 | IPV4_DEVCONF_TAG, | ||
| 27 | IPV4_DEVCONF_ARPFILTER, | ||
| 28 | IPV4_DEVCONF_MEDIUM_ID, | ||
| 29 | IPV4_DEVCONF_NOXFRM, | ||
| 30 | IPV4_DEVCONF_NOPOLICY, | ||
| 31 | IPV4_DEVCONF_FORCE_IGMP_VERSION, | ||
| 32 | IPV4_DEVCONF_ARP_ANNOUNCE, | ||
| 33 | IPV4_DEVCONF_ARP_IGNORE, | ||
| 34 | IPV4_DEVCONF_PROMOTE_SECONDARIES, | ||
| 35 | IPV4_DEVCONF_ARP_ACCEPT, | ||
| 36 | IPV4_DEVCONF_ARP_NOTIFY, | ||
| 37 | IPV4_DEVCONF_ACCEPT_LOCAL, | ||
| 38 | IPV4_DEVCONF_SRC_VMARK, | ||
| 39 | IPV4_DEVCONF_PROXY_ARP_PVLAN, | ||
| 40 | __IPV4_DEVCONF_MAX | ||
| 41 | }; | ||
| 42 | |||
| 13 | struct ipv4_devconf { | 43 | struct ipv4_devconf { |
| 14 | void *sysctl; | 44 | void *sysctl; |
| 15 | int data[__NET_IPV4_CONF_MAX - 1]; | 45 | int data[__IPV4_DEVCONF_MAX - 1]; |
| 16 | DECLARE_BITMAP(state, __NET_IPV4_CONF_MAX - 1); | 46 | DECLARE_BITMAP(state, __IPV4_DEVCONF_MAX - 1); |
| 17 | }; | 47 | }; |
| 18 | 48 | ||
| 19 | struct in_device { | 49 | struct in_device { |
| @@ -40,7 +70,7 @@ struct in_device { | |||
| 40 | struct rcu_head rcu_head; | 70 | struct rcu_head rcu_head; |
| 41 | }; | 71 | }; |
| 42 | 72 | ||
| 43 | #define IPV4_DEVCONF(cnf, attr) ((cnf).data[NET_IPV4_CONF_ ## attr - 1]) | 73 | #define IPV4_DEVCONF(cnf, attr) ((cnf).data[IPV4_DEVCONF_ ## attr - 1]) |
| 44 | #define IPV4_DEVCONF_ALL(net, attr) \ | 74 | #define IPV4_DEVCONF_ALL(net, attr) \ |
| 45 | IPV4_DEVCONF((*(net)->ipv4.devconf_all), attr) | 75 | IPV4_DEVCONF((*(net)->ipv4.devconf_all), attr) |
| 46 | 76 | ||
| @@ -60,13 +90,13 @@ static inline void ipv4_devconf_set(struct in_device *in_dev, int index, | |||
| 60 | 90 | ||
| 61 | static inline void ipv4_devconf_setall(struct in_device *in_dev) | 91 | static inline void ipv4_devconf_setall(struct in_device *in_dev) |
| 62 | { | 92 | { |
| 63 | bitmap_fill(in_dev->cnf.state, __NET_IPV4_CONF_MAX - 1); | 93 | bitmap_fill(in_dev->cnf.state, __IPV4_DEVCONF_MAX - 1); |
| 64 | } | 94 | } |
| 65 | 95 | ||
| 66 | #define IN_DEV_CONF_GET(in_dev, attr) \ | 96 | #define IN_DEV_CONF_GET(in_dev, attr) \ |
| 67 | ipv4_devconf_get((in_dev), NET_IPV4_CONF_ ## attr) | 97 | ipv4_devconf_get((in_dev), IPV4_DEVCONF_ ## attr) |
| 68 | #define IN_DEV_CONF_SET(in_dev, attr, val) \ | 98 | #define IN_DEV_CONF_SET(in_dev, attr, val) \ |
| 69 | ipv4_devconf_set((in_dev), NET_IPV4_CONF_ ## attr, (val)) | 99 | ipv4_devconf_set((in_dev), IPV4_DEVCONF_ ## attr, (val)) |
| 70 | 100 | ||
| 71 | #define IN_DEV_ANDCONF(in_dev, attr) \ | 101 | #define IN_DEV_ANDCONF(in_dev, attr) \ |
| 72 | (IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr) && \ | 102 | (IPV4_DEVCONF_ALL(dev_net(in_dev->dev), attr) && \ |
| @@ -81,6 +111,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) | |||
| 81 | #define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING) | 111 | #define IN_DEV_FORWARD(in_dev) IN_DEV_CONF_GET((in_dev), FORWARDING) |
| 82 | #define IN_DEV_MFORWARD(in_dev) IN_DEV_ANDCONF((in_dev), MC_FORWARDING) | 112 | #define IN_DEV_MFORWARD(in_dev) IN_DEV_ANDCONF((in_dev), MC_FORWARDING) |
| 83 | #define IN_DEV_RPFILTER(in_dev) IN_DEV_MAXCONF((in_dev), RP_FILTER) | 113 | #define IN_DEV_RPFILTER(in_dev) IN_DEV_MAXCONF((in_dev), RP_FILTER) |
| 114 | #define IN_DEV_SRC_VMARK(in_dev) IN_DEV_ORCONF((in_dev), SRC_VMARK) | ||
| 84 | #define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \ | 115 | #define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \ |
| 85 | ACCEPT_SOURCE_ROUTE) | 116 | ACCEPT_SOURCE_ROUTE) |
| 86 | #define IN_DEV_ACCEPT_LOCAL(in_dev) IN_DEV_ORCONF((in_dev), ACCEPT_LOCAL) | 117 | #define IN_DEV_ACCEPT_LOCAL(in_dev) IN_DEV_ORCONF((in_dev), ACCEPT_LOCAL) |
| @@ -88,6 +119,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) | |||
| 88 | 119 | ||
| 89 | #define IN_DEV_LOG_MARTIANS(in_dev) IN_DEV_ORCONF((in_dev), LOG_MARTIANS) | 120 | #define IN_DEV_LOG_MARTIANS(in_dev) IN_DEV_ORCONF((in_dev), LOG_MARTIANS) |
| 90 | #define IN_DEV_PROXY_ARP(in_dev) IN_DEV_ORCONF((in_dev), PROXY_ARP) | 121 | #define IN_DEV_PROXY_ARP(in_dev) IN_DEV_ORCONF((in_dev), PROXY_ARP) |
| 122 | #define IN_DEV_PROXY_ARP_PVLAN(in_dev) IN_DEV_CONF_GET(in_dev, PROXY_ARP_PVLAN) | ||
| 91 | #define IN_DEV_SHARED_MEDIA(in_dev) IN_DEV_ORCONF((in_dev), SHARED_MEDIA) | 123 | #define IN_DEV_SHARED_MEDIA(in_dev) IN_DEV_ORCONF((in_dev), SHARED_MEDIA) |
| 92 | #define IN_DEV_TX_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), SEND_REDIRECTS) | 124 | #define IN_DEV_TX_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), SEND_REDIRECTS) |
| 93 | #define IN_DEV_SEC_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), \ | 125 | #define IN_DEV_SEC_REDIRECTS(in_dev) IN_DEV_ORCONF((in_dev), \ |
diff --git a/include/linux/input.h b/include/linux/input.h index 7be8a6537b5..dc24effb6d0 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
| @@ -376,8 +376,9 @@ struct input_absinfo { | |||
| 376 | #define KEY_DISPLAY_OFF 245 /* display device to off state */ | 376 | #define KEY_DISPLAY_OFF 245 /* display device to off state */ |
| 377 | 377 | ||
| 378 | #define KEY_WIMAX 246 | 378 | #define KEY_WIMAX 246 |
| 379 | #define KEY_RFKILL 247 /* Key that controls all radios */ | ||
| 379 | 380 | ||
| 380 | /* Range 248 - 255 is reserved for special needs of AT keyboard driver */ | 381 | /* Code 255 is reserved for special needs of AT keyboard driver */ |
| 381 | 382 | ||
| 382 | #define BTN_MISC 0x100 | 383 | #define BTN_MISC 0x100 |
| 383 | #define BTN_0 0x100 | 384 | #define BTN_0 0x100 |
| @@ -596,6 +597,49 @@ struct input_absinfo { | |||
| 596 | #define KEY_NUMERIC_POUND 0x20b | 597 | #define KEY_NUMERIC_POUND 0x20b |
| 597 | 598 | ||
| 598 | #define KEY_CAMERA_FOCUS 0x210 | 599 | #define KEY_CAMERA_FOCUS 0x210 |
| 600 | #define KEY_WPS_BUTTON 0x211 /* WiFi Protected Setup key */ | ||
| 601 | |||
| 602 | #define BTN_TRIGGER_HAPPY 0x2c0 | ||
| 603 | #define BTN_TRIGGER_HAPPY1 0x2c0 | ||
| 604 | #define BTN_TRIGGER_HAPPY2 0x2c1 | ||
| 605 | #define BTN_TRIGGER_HAPPY3 0x2c2 | ||
| 606 | #define BTN_TRIGGER_HAPPY4 0x2c3 | ||
| 607 | #define BTN_TRIGGER_HAPPY5 0x2c4 | ||
| 608 | #define BTN_TRIGGER_HAPPY6 0x2c5 | ||
| 609 | #define BTN_TRIGGER_HAPPY7 0x2c6 | ||
| 610 | #define BTN_TRIGGER_HAPPY8 0x2c7 | ||
| 611 | #define BTN_TRIGGER_HAPPY9 0x2c8 | ||
| 612 | #define BTN_TRIGGER_HAPPY10 0x2c9 | ||
| 613 | #define BTN_TRIGGER_HAPPY11 0x2ca | ||
| 614 | #define BTN_TRIGGER_HAPPY12 0x2cb | ||
| 615 | #define BTN_TRIGGER_HAPPY13 0x2cc | ||
| 616 | #define BTN_TRIGGER_HAPPY14 0x2cd | ||
| 617 | #define BTN_TRIGGER_HAPPY15 0x2ce | ||
| 618 | #define BTN_TRIGGER_HAPPY16 0x2cf | ||
| 619 | #define BTN_TRIGGER_HAPPY17 0x2d0 | ||
| 620 | #define BTN_TRIGGER_HAPPY18 0x2d1 | ||
| 621 | #define BTN_TRIGGER_HAPPY19 0x2d2 | ||
| 622 | #define BTN_TRIGGER_HAPPY20 0x2d3 | ||
| 623 | #define BTN_TRIGGER_HAPPY21 0x2d4 | ||
| 624 | #define BTN_TRIGGER_HAPPY22 0x2d5 | ||
| 625 | #define BTN_TRIGGER_HAPPY23 0x2d6 | ||
| 626 | #define BTN_TRIGGER_HAPPY24 0x2d7 | ||
| 627 | #define BTN_TRIGGER_HAPPY25 0x2d8 | ||
| 628 | #define BTN_TRIGGER_HAPPY26 0x2d9 | ||
| 629 | #define BTN_TRIGGER_HAPPY27 0x2da | ||
| 630 | #define BTN_TRIGGER_HAPPY28 0x2db | ||
| 631 | #define BTN_TRIGGER_HAPPY29 0x2dc | ||
| 632 | #define BTN_TRIGGER_HAPPY30 0x2dd | ||
| 633 | #define BTN_TRIGGER_HAPPY31 0x2de | ||
| 634 | #define BTN_TRIGGER_HAPPY32 0x2df | ||
| 635 | #define BTN_TRIGGER_HAPPY33 0x2e0 | ||
| 636 | #define BTN_TRIGGER_HAPPY34 0x2e1 | ||
| 637 | #define BTN_TRIGGER_HAPPY35 0x2e2 | ||
| 638 | #define BTN_TRIGGER_HAPPY36 0x2e3 | ||
| 639 | #define BTN_TRIGGER_HAPPY37 0x2e4 | ||
| 640 | #define BTN_TRIGGER_HAPPY38 0x2e5 | ||
| 641 | #define BTN_TRIGGER_HAPPY39 0x2e6 | ||
| 642 | #define BTN_TRIGGER_HAPPY40 0x2e7 | ||
| 599 | 643 | ||
| 600 | /* We avoid low common keys in module aliases so they don't get huge. */ | 644 | /* We avoid low common keys in module aliases so they don't get huge. */ |
| 601 | #define KEY_MIN_INTERESTING KEY_MUTE | 645 | #define KEY_MIN_INTERESTING KEY_MUTE |
| @@ -660,6 +704,7 @@ struct input_absinfo { | |||
| 660 | #define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */ | 704 | #define ABS_MT_TOOL_TYPE 0x37 /* Type of touching device */ |
| 661 | #define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ | 705 | #define ABS_MT_BLOB_ID 0x38 /* Group a set of packets as a blob */ |
| 662 | #define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ | 706 | #define ABS_MT_TRACKING_ID 0x39 /* Unique ID of initiated contact */ |
| 707 | #define ABS_MT_PRESSURE 0x3a /* Pressure on contact area */ | ||
| 663 | 708 | ||
| 664 | #define ABS_MAX 0x3f | 709 | #define ABS_MAX 0x3f |
| 665 | #define ABS_CNT (ABS_MAX+1) | 710 | #define ABS_CNT (ABS_MAX+1) |
| @@ -1198,6 +1243,10 @@ struct input_handle; | |||
| 1198 | * @event: event handler. This method is being called by input core with | 1243 | * @event: event handler. This method is being called by input core with |
| 1199 | * interrupts disabled and dev->event_lock spinlock held and so | 1244 | * interrupts disabled and dev->event_lock spinlock held and so |
| 1200 | * it may not sleep | 1245 | * it may not sleep |
| 1246 | * @filter: similar to @event; separates normal event handlers from | ||
| 1247 | * "filters". | ||
| 1248 | * @match: called after comparing device's id with handler's id_table | ||
| 1249 | * to perform fine-grained matching between device and handler | ||
| 1201 | * @connect: called when attaching a handler to an input device | 1250 | * @connect: called when attaching a handler to an input device |
| 1202 | * @disconnect: disconnects a handler from input device | 1251 | * @disconnect: disconnects a handler from input device |
| 1203 | * @start: starts handler for given handle. This function is called by | 1252 | * @start: starts handler for given handle. This function is called by |
| @@ -1209,8 +1258,6 @@ struct input_handle; | |||
| 1209 | * @name: name of the handler, to be shown in /proc/bus/input/handlers | 1258 | * @name: name of the handler, to be shown in /proc/bus/input/handlers |
| 1210 | * @id_table: pointer to a table of input_device_ids this driver can | 1259 | * @id_table: pointer to a table of input_device_ids this driver can |
| 1211 | * handle | 1260 | * handle |
| 1212 | * @blacklist: pointer to a table of input_device_ids this driver should | ||
| 1213 | * ignore even if they match @id_table | ||
| 1214 | * @h_list: list of input handles associated with the handler | 1261 | * @h_list: list of input handles associated with the handler |
| 1215 | * @node: for placing the driver onto input_handler_list | 1262 | * @node: for placing the driver onto input_handler_list |
| 1216 | * | 1263 | * |
| @@ -1219,6 +1266,11 @@ struct input_handle; | |||
| 1219 | * same time. All of them will get their copy of input event generated by | 1266 | * same time. All of them will get their copy of input event generated by |
| 1220 | * the device. | 1267 | * the device. |
| 1221 | * | 1268 | * |
| 1269 | * The very same structure is used to implement input filters. Input core | ||
| 1270 | * allows filters to run first and will not pass event to regular handlers | ||
| 1271 | * if any of the filters indicate that the event should be filtered (by | ||
| 1272 | * returning %true from their filter() method). | ||
| 1273 | * | ||
| 1222 | * Note that input core serializes calls to connect() and disconnect() | 1274 | * Note that input core serializes calls to connect() and disconnect() |
| 1223 | * methods. | 1275 | * methods. |
| 1224 | */ | 1276 | */ |
| @@ -1227,6 +1279,8 @@ struct input_handler { | |||
| 1227 | void *private; | 1279 | void *private; |
| 1228 | 1280 | ||
| 1229 | void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value); | 1281 | void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value); |
| 1282 | bool (*filter)(struct input_handle *handle, unsigned int type, unsigned int code, int value); | ||
| 1283 | bool (*match)(struct input_handler *handler, struct input_dev *dev); | ||
| 1230 | int (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id); | 1284 | int (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id); |
| 1231 | void (*disconnect)(struct input_handle *handle); | 1285 | void (*disconnect)(struct input_handle *handle); |
| 1232 | void (*start)(struct input_handle *handle); | 1286 | void (*start)(struct input_handle *handle); |
| @@ -1236,7 +1290,6 @@ struct input_handler { | |||
| 1236 | const char *name; | 1290 | const char *name; |
| 1237 | 1291 | ||
| 1238 | const struct input_device_id *id_table; | 1292 | const struct input_device_id *id_table; |
| 1239 | const struct input_device_id *blacklist; | ||
| 1240 | 1293 | ||
| 1241 | struct list_head h_list; | 1294 | struct list_head h_list; |
| 1242 | struct list_head node; | 1295 | struct list_head node; |
diff --git a/include/linux/input/sh_keysc.h b/include/linux/input/sh_keysc.h index c211b5cf08e..649dc7f1292 100644 --- a/include/linux/input/sh_keysc.h +++ b/include/linux/input/sh_keysc.h | |||
| @@ -1,14 +1,15 @@ | |||
| 1 | #ifndef __SH_KEYSC_H__ | 1 | #ifndef __SH_KEYSC_H__ |
| 2 | #define __SH_KEYSC_H__ | 2 | #define __SH_KEYSC_H__ |
| 3 | 3 | ||
| 4 | #define SH_KEYSC_MAXKEYS 30 | 4 | #define SH_KEYSC_MAXKEYS 49 |
| 5 | 5 | ||
| 6 | struct sh_keysc_info { | 6 | struct sh_keysc_info { |
| 7 | enum { SH_KEYSC_MODE_1, SH_KEYSC_MODE_2, SH_KEYSC_MODE_3 } mode; | 7 | enum { SH_KEYSC_MODE_1, SH_KEYSC_MODE_2, SH_KEYSC_MODE_3, |
| 8 | SH_KEYSC_MODE_4, SH_KEYSC_MODE_5, SH_KEYSC_MODE_6 } mode; | ||
| 8 | int scan_timing; /* 0 -> 7, see KYCR1, SCN[2:0] */ | 9 | int scan_timing; /* 0 -> 7, see KYCR1, SCN[2:0] */ |
| 9 | int delay; | 10 | int delay; |
| 10 | int kycr2_delay; | 11 | int kycr2_delay; |
| 11 | int keycodes[SH_KEYSC_MAXKEYS]; | 12 | int keycodes[SH_KEYSC_MAXKEYS]; /* KEYIN * KEYOUT */ |
| 12 | }; | 13 | }; |
| 13 | 14 | ||
| 14 | #endif /* __SH_KEYSC_H__ */ | 15 | #endif /* __SH_KEYSC_H__ */ |
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h index a6323599630..1195a806fe0 100644 --- a/include/linux/iocontext.h +++ b/include/linux/iocontext.h | |||
| @@ -4,32 +4,6 @@ | |||
| 4 | #include <linux/radix-tree.h> | 4 | #include <linux/radix-tree.h> |
| 5 | #include <linux/rcupdate.h> | 5 | #include <linux/rcupdate.h> |
| 6 | 6 | ||
| 7 | /* | ||
| 8 | * This is the per-process anticipatory I/O scheduler state. | ||
| 9 | */ | ||
| 10 | struct as_io_context { | ||
| 11 | spinlock_t lock; | ||
| 12 | |||
| 13 | void (*dtor)(struct as_io_context *aic); /* destructor */ | ||
| 14 | void (*exit)(struct as_io_context *aic); /* called on task exit */ | ||
| 15 | |||
| 16 | unsigned long state; | ||
| 17 | atomic_t nr_queued; /* queued reads & sync writes */ | ||
| 18 | atomic_t nr_dispatched; /* number of requests gone to the drivers */ | ||
| 19 | |||
| 20 | /* IO History tracking */ | ||
| 21 | /* Thinktime */ | ||
| 22 | unsigned long last_end_request; | ||
| 23 | unsigned long ttime_total; | ||
| 24 | unsigned long ttime_samples; | ||
| 25 | unsigned long ttime_mean; | ||
| 26 | /* Layout pattern */ | ||
| 27 | unsigned int seek_samples; | ||
| 28 | sector_t last_request_pos; | ||
| 29 | u64 seek_total; | ||
| 30 | sector_t seek_mean; | ||
| 31 | }; | ||
| 32 | |||
| 33 | struct cfq_queue; | 7 | struct cfq_queue; |
| 34 | struct cfq_io_context { | 8 | struct cfq_io_context { |
| 35 | void *key; | 9 | void *key; |
| @@ -75,10 +49,9 @@ struct io_context { | |||
| 75 | /* | 49 | /* |
| 76 | * For request batching | 50 | * For request batching |
| 77 | */ | 51 | */ |
| 78 | unsigned long last_waited; /* Time last woken after wait for request */ | ||
| 79 | int nr_batch_requests; /* Number of requests left in the batch */ | 52 | int nr_batch_requests; /* Number of requests left in the batch */ |
| 53 | unsigned long last_waited; /* Time last woken after wait for request */ | ||
| 80 | 54 | ||
| 81 | struct as_io_context *aic; | ||
| 82 | struct radix_tree_root radix_root; | 55 | struct radix_tree_root radix_root; |
| 83 | struct hlist_head cic_list; | 56 | struct hlist_head cic_list; |
| 84 | void *ioc_data; | 57 | void *ioc_data; |
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 7129504e053..dda98410d58 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
| @@ -112,6 +112,7 @@ extern struct resource iomem_resource; | |||
| 112 | 112 | ||
| 113 | extern int request_resource(struct resource *root, struct resource *new); | 113 | extern int request_resource(struct resource *root, struct resource *new); |
| 114 | extern int release_resource(struct resource *new); | 114 | extern int release_resource(struct resource *new); |
| 115 | void release_child_resources(struct resource *new); | ||
| 115 | extern void reserve_region_with_split(struct resource *root, | 116 | extern void reserve_region_with_split(struct resource *root, |
| 116 | resource_size_t start, resource_size_t end, | 117 | resource_size_t start, resource_size_t end, |
| 117 | const char *name); | 118 | const char *name); |
| @@ -120,8 +121,10 @@ extern void insert_resource_expand_to_fit(struct resource *root, struct resource | |||
| 120 | extern int allocate_resource(struct resource *root, struct resource *new, | 121 | extern int allocate_resource(struct resource *root, struct resource *new, |
| 121 | resource_size_t size, resource_size_t min, | 122 | resource_size_t size, resource_size_t min, |
| 122 | resource_size_t max, resource_size_t align, | 123 | resource_size_t max, resource_size_t align, |
| 123 | void (*alignf)(void *, struct resource *, | 124 | resource_size_t (*alignf)(void *, |
| 124 | resource_size_t, resource_size_t), | 125 | const struct resource *, |
| 126 | resource_size_t, | ||
| 127 | resource_size_t), | ||
| 125 | void *alignf_data); | 128 | void *alignf_data); |
| 126 | int adjust_resource(struct resource *res, resource_size_t start, | 129 | int adjust_resource(struct resource *res, resource_size_t start, |
| 127 | resource_size_t size); | 130 | resource_size_t size); |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 451481c082b..d13492df57a 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
| @@ -90,7 +90,7 @@ struct msi_desc; | |||
| 90 | * @startup: start up the interrupt (defaults to ->enable if NULL) | 90 | * @startup: start up the interrupt (defaults to ->enable if NULL) |
| 91 | * @shutdown: shut down the interrupt (defaults to ->disable if NULL) | 91 | * @shutdown: shut down the interrupt (defaults to ->disable if NULL) |
| 92 | * @enable: enable the interrupt (defaults to chip->unmask if NULL) | 92 | * @enable: enable the interrupt (defaults to chip->unmask if NULL) |
| 93 | * @disable: disable the interrupt (defaults to chip->mask if NULL) | 93 | * @disable: disable the interrupt |
| 94 | * @ack: start of a new interrupt | 94 | * @ack: start of a new interrupt |
| 95 | * @mask: mask an interrupt source | 95 | * @mask: mask an interrupt source |
| 96 | * @mask_ack: ack and mask an interrupt source | 96 | * @mask_ack: ack and mask an interrupt source |
diff --git a/include/linux/isdn/capilli.h b/include/linux/isdn/capilli.h index 7acb87a4487..11b57c48585 100644 --- a/include/linux/isdn/capilli.h +++ b/include/linux/isdn/capilli.h | |||
| @@ -50,8 +50,7 @@ struct capi_ctr { | |||
| 50 | u16 (*send_message)(struct capi_ctr *, struct sk_buff *skb); | 50 | u16 (*send_message)(struct capi_ctr *, struct sk_buff *skb); |
| 51 | 51 | ||
| 52 | char *(*procinfo)(struct capi_ctr *); | 52 | char *(*procinfo)(struct capi_ctr *); |
| 53 | int (*ctr_read_proc)(char *page, char **start, off_t off, | 53 | const struct file_operations *proc_fops; |
| 54 | int count, int *eof, struct capi_ctr *card); | ||
| 55 | 54 | ||
| 56 | /* filled in before calling ready callback */ | 55 | /* filled in before calling ready callback */ |
| 57 | u8 manu[CAPI_MANUFACTURER_LEN]; /* CAPI_GET_MANUFACTURER */ | 56 | u8 manu[CAPI_MANUFACTURER_LEN]; /* CAPI_GET_MANUFACTURER */ |
| @@ -67,9 +66,10 @@ struct capi_ctr { | |||
| 67 | unsigned long nsentdatapkt; | 66 | unsigned long nsentdatapkt; |
| 68 | 67 | ||
| 69 | int cnr; /* controller number */ | 68 | int cnr; /* controller number */ |
| 70 | volatile unsigned short cardstate; /* controller state */ | 69 | unsigned short state; /* controller state */ |
| 71 | volatile int blocked; /* output blocked */ | 70 | int blocked; /* output blocked */ |
| 72 | int traceflag; /* capi trace */ | 71 | int traceflag; /* capi trace */ |
| 72 | wait_queue_head_t state_wait_queue; | ||
| 73 | 73 | ||
| 74 | struct proc_dir_entry *procent; | 74 | struct proc_dir_entry *procent; |
| 75 | char procfn[128]; | 75 | char procfn[128]; |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index f1011f7f3d4..638ce4554c7 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
| @@ -653,6 +653,7 @@ struct transaction_s | |||
| 653 | * waiting for it to finish. | 653 | * waiting for it to finish. |
| 654 | */ | 654 | */ |
| 655 | unsigned int t_synchronous_commit:1; | 655 | unsigned int t_synchronous_commit:1; |
| 656 | unsigned int t_flushed_data_blocks:1; | ||
| 656 | 657 | ||
| 657 | /* | 658 | /* |
| 658 | * For use by the filesystem to store fs-specific data | 659 | * For use by the filesystem to store fs-specific data |
diff --git a/include/linux/kbd_kern.h b/include/linux/kbd_kern.h index 8bdb16bfe5f..506ad20c18f 100644 --- a/include/linux/kbd_kern.h +++ b/include/linux/kbd_kern.h | |||
| @@ -161,7 +161,4 @@ static inline void con_schedule_flip(struct tty_struct *t) | |||
| 161 | schedule_delayed_work(&t->buf.work, 0); | 161 | schedule_delayed_work(&t->buf.work, 0); |
| 162 | } | 162 | } |
| 163 | 163 | ||
| 164 | /* mac_hid.c */ | ||
| 165 | extern int mac_hid_mouse_emulate_buttons(int, unsigned int, int); | ||
| 166 | |||
| 167 | #endif | 164 | #endif |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 3fc9f5aab5f..1221d2331a6 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
| @@ -124,7 +124,7 @@ extern int _cond_resched(void); | |||
| 124 | #endif | 124 | #endif |
| 125 | 125 | ||
| 126 | #ifdef CONFIG_DEBUG_SPINLOCK_SLEEP | 126 | #ifdef CONFIG_DEBUG_SPINLOCK_SLEEP |
| 127 | void __might_sleep(char *file, int line, int preempt_offset); | 127 | void __might_sleep(const char *file, int line, int preempt_offset); |
| 128 | /** | 128 | /** |
| 129 | * might_sleep - annotation for functions that can sleep | 129 | * might_sleep - annotation for functions that can sleep |
| 130 | * | 130 | * |
| @@ -138,7 +138,8 @@ extern int _cond_resched(void); | |||
| 138 | # define might_sleep() \ | 138 | # define might_sleep() \ |
| 139 | do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0) | 139 | do { __might_sleep(__FILE__, __LINE__, 0); might_resched(); } while (0) |
| 140 | #else | 140 | #else |
| 141 | static inline void __might_sleep(char *file, int line, int preempt_offset) { } | 141 | static inline void __might_sleep(const char *file, int line, |
| 142 | int preempt_offset) { } | ||
| 142 | # define might_sleep() do { might_resched(); } while (0) | 143 | # define might_sleep() do { might_resched(); } while (0) |
| 143 | #endif | 144 | #endif |
| 144 | 145 | ||
| @@ -734,6 +735,10 @@ struct sysinfo { | |||
| 734 | /* Force a compilation error if condition is constant and true */ | 735 | /* Force a compilation error if condition is constant and true */ |
| 735 | #define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)])) | 736 | #define MAYBE_BUILD_BUG_ON(cond) ((void)sizeof(char[1 - 2 * !!(cond)])) |
| 736 | 737 | ||
| 738 | /* Force a compilation error if a constant expression is not a power of 2 */ | ||
| 739 | #define BUILD_BUG_ON_NOT_POWER_OF_2(n) \ | ||
| 740 | BUILD_BUG_ON((n) == 0 || (((n) & ((n) - 1)) != 0)) | ||
| 741 | |||
| 737 | /* Force a compilation error if condition is true, but also produce a | 742 | /* Force a compilation error if condition is true, but also produce a |
| 738 | result (of value 0 and type size_t), so the expression can be used | 743 | result (of value 0 and type size_t), so the expression can be used |
| 739 | e.g. in a structure initializer (or where-ever else comma expressions | 744 | e.g. in a structure initializer (or where-ever else comma expressions |
diff --git a/include/linux/kernelcapi.h b/include/linux/kernelcapi.h index a53e932f80f..9c2683929fd 100644 --- a/include/linux/kernelcapi.h +++ b/include/linux/kernelcapi.h | |||
| @@ -48,9 +48,7 @@ typedef struct kcapi_carddef { | |||
| 48 | #include <linux/list.h> | 48 | #include <linux/list.h> |
| 49 | #include <linux/skbuff.h> | 49 | #include <linux/skbuff.h> |
| 50 | #include <linux/workqueue.h> | 50 | #include <linux/workqueue.h> |
| 51 | 51 | #include <linux/notifier.h> | |
| 52 | #define KCI_CONTRUP 0 /* arg: struct capi_profile */ | ||
| 53 | #define KCI_CONTRDOWN 1 /* arg: NULL */ | ||
| 54 | 52 | ||
| 55 | struct capi20_appl { | 53 | struct capi20_appl { |
| 56 | u16 applid; | 54 | u16 applid; |
| @@ -67,11 +65,6 @@ struct capi20_appl { | |||
| 67 | struct sk_buff_head recv_queue; | 65 | struct sk_buff_head recv_queue; |
| 68 | struct work_struct recv_work; | 66 | struct work_struct recv_work; |
| 69 | int release_in_progress; | 67 | int release_in_progress; |
| 70 | |||
| 71 | /* ugly hack to allow for notification of added/removed | ||
| 72 | * controllers. The Right Way (tm) is known. XXX | ||
| 73 | */ | ||
| 74 | void (*callback) (unsigned int cmd, __u32 contr, void *data); | ||
| 75 | }; | 68 | }; |
| 76 | 69 | ||
| 77 | u16 capi20_isinstalled(void); | 70 | u16 capi20_isinstalled(void); |
| @@ -84,11 +77,11 @@ u16 capi20_get_serial(u32 contr, u8 serial[CAPI_SERIAL_LEN]); | |||
| 84 | u16 capi20_get_profile(u32 contr, struct capi_profile *profp); | 77 | u16 capi20_get_profile(u32 contr, struct capi_profile *profp); |
| 85 | int capi20_manufacturer(unsigned int cmd, void __user *data); | 78 | int capi20_manufacturer(unsigned int cmd, void __user *data); |
| 86 | 79 | ||
| 87 | /* temporary hack XXX */ | 80 | #define CAPICTR_UP 0 |
| 88 | void capi20_set_callback(struct capi20_appl *ap, | 81 | #define CAPICTR_DOWN 1 |
| 89 | void (*callback) (unsigned int cmd, __u32 contr, void *data)); | ||
| 90 | |||
| 91 | 82 | ||
| 83 | int register_capictr_notifier(struct notifier_block *nb); | ||
| 84 | int unregister_capictr_notifier(struct notifier_block *nb); | ||
| 92 | 85 | ||
| 93 | #define CAPI_NOERROR 0x0000 | 86 | #define CAPI_NOERROR 0x0000 |
| 94 | 87 | ||
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h index 3d44e9c65a8..bc0fc795bd3 100644 --- a/include/linux/kfifo.h +++ b/include/linux/kfifo.h | |||
| @@ -67,7 +67,7 @@ struct kfifo { | |||
| 67 | /** | 67 | /** |
| 68 | * DECLARE_KFIFO - macro to declare a kfifo and the associated buffer | 68 | * DECLARE_KFIFO - macro to declare a kfifo and the associated buffer |
| 69 | * @name: name of the declared kfifo datatype | 69 | * @name: name of the declared kfifo datatype |
| 70 | * @size: size of the fifo buffer | 70 | * @size: size of the fifo buffer. Must be a power of two. |
| 71 | * | 71 | * |
| 72 | * Note1: the macro can be used inside struct or union declaration | 72 | * Note1: the macro can be used inside struct or union declaration |
| 73 | * Note2: the macro creates two objects: | 73 | * Note2: the macro creates two objects: |
| @@ -81,7 +81,7 @@ union { \ | |||
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | /** | 83 | /** |
| 84 | * INIT_KFIFO - Initialize a kfifo declared by DECLARED_KFIFO | 84 | * INIT_KFIFO - Initialize a kfifo declared by DECLARE_KFIFO |
| 85 | * @name: name of the declared kfifo datatype | 85 | * @name: name of the declared kfifo datatype |
| 86 | */ | 86 | */ |
| 87 | #define INIT_KFIFO(name) \ | 87 | #define INIT_KFIFO(name) \ |
| @@ -91,7 +91,7 @@ union { \ | |||
| 91 | /** | 91 | /** |
| 92 | * DEFINE_KFIFO - macro to define and initialize a kfifo | 92 | * DEFINE_KFIFO - macro to define and initialize a kfifo |
| 93 | * @name: name of the declared kfifo datatype | 93 | * @name: name of the declared kfifo datatype |
| 94 | * @size: size of the fifo buffer | 94 | * @size: size of the fifo buffer. Must be a power of two. |
| 95 | * | 95 | * |
| 96 | * Note1: the macro can be used for global and local kfifo data type variables | 96 | * Note1: the macro can be used for global and local kfifo data type variables |
| 97 | * Note2: the macro creates two objects: | 97 | * Note2: the macro creates two objects: |
| @@ -104,15 +104,28 @@ union { \ | |||
| 104 | 104 | ||
| 105 | #undef __kfifo_initializer | 105 | #undef __kfifo_initializer |
| 106 | 106 | ||
| 107 | extern void kfifo_init(struct kfifo *fifo, unsigned char *buffer, | 107 | extern void kfifo_init(struct kfifo *fifo, void *buffer, |
| 108 | unsigned int size); | 108 | unsigned int size); |
| 109 | extern __must_check int kfifo_alloc(struct kfifo *fifo, unsigned int size, | 109 | extern __must_check int kfifo_alloc(struct kfifo *fifo, unsigned int size, |
| 110 | gfp_t gfp_mask); | 110 | gfp_t gfp_mask); |
| 111 | extern void kfifo_free(struct kfifo *fifo); | 111 | extern void kfifo_free(struct kfifo *fifo); |
| 112 | extern unsigned int kfifo_in(struct kfifo *fifo, | 112 | extern unsigned int kfifo_in(struct kfifo *fifo, |
| 113 | const unsigned char *from, unsigned int len); | 113 | const void *from, unsigned int len); |
| 114 | extern __must_check unsigned int kfifo_out(struct kfifo *fifo, | 114 | extern __must_check unsigned int kfifo_out(struct kfifo *fifo, |
| 115 | unsigned char *to, unsigned int len); | 115 | void *to, unsigned int len); |
| 116 | extern __must_check unsigned int kfifo_out_peek(struct kfifo *fifo, | ||
| 117 | void *to, unsigned int len, unsigned offset); | ||
| 118 | |||
| 119 | /** | ||
| 120 | * kfifo_initialized - Check if kfifo is initialized. | ||
| 121 | * @fifo: fifo to check | ||
| 122 | * Return %true if FIFO is initialized, otherwise %false. | ||
| 123 | * Assumes the fifo was 0 before. | ||
| 124 | */ | ||
| 125 | static inline bool kfifo_initialized(struct kfifo *fifo) | ||
| 126 | { | ||
| 127 | return fifo->buffer != NULL; | ||
| 128 | } | ||
| 116 | 129 | ||
| 117 | /** | 130 | /** |
| 118 | * kfifo_reset - removes the entire FIFO contents | 131 | * kfifo_reset - removes the entire FIFO contents |
| @@ -194,7 +207,7 @@ static inline __must_check unsigned int kfifo_avail(struct kfifo *fifo) | |||
| 194 | * bytes copied. | 207 | * bytes copied. |
| 195 | */ | 208 | */ |
| 196 | static inline unsigned int kfifo_in_locked(struct kfifo *fifo, | 209 | static inline unsigned int kfifo_in_locked(struct kfifo *fifo, |
| 197 | const unsigned char *from, unsigned int n, spinlock_t *lock) | 210 | const void *from, unsigned int n, spinlock_t *lock) |
| 198 | { | 211 | { |
| 199 | unsigned long flags; | 212 | unsigned long flags; |
| 200 | unsigned int ret; | 213 | unsigned int ret; |
| @@ -219,7 +232,7 @@ static inline unsigned int kfifo_in_locked(struct kfifo *fifo, | |||
| 219 | * @to buffer and returns the number of copied bytes. | 232 | * @to buffer and returns the number of copied bytes. |
| 220 | */ | 233 | */ |
| 221 | static inline __must_check unsigned int kfifo_out_locked(struct kfifo *fifo, | 234 | static inline __must_check unsigned int kfifo_out_locked(struct kfifo *fifo, |
| 222 | unsigned char *to, unsigned int n, spinlock_t *lock) | 235 | void *to, unsigned int n, spinlock_t *lock) |
| 223 | { | 236 | { |
| 224 | unsigned long flags; | 237 | unsigned long flags; |
| 225 | unsigned int ret; | 238 | unsigned int ret; |
| @@ -228,13 +241,6 @@ static inline __must_check unsigned int kfifo_out_locked(struct kfifo *fifo, | |||
| 228 | 241 | ||
| 229 | ret = kfifo_out(fifo, to, n); | 242 | ret = kfifo_out(fifo, to, n); |
| 230 | 243 | ||
| 231 | /* | ||
| 232 | * optimization: if the FIFO is empty, set the indices to 0 | ||
| 233 | * so we don't wrap the next time | ||
| 234 | */ | ||
| 235 | if (kfifo_is_empty(fifo)) | ||
| 236 | kfifo_reset(fifo); | ||
| 237 | |||
| 238 | spin_unlock_irqrestore(lock, flags); | 244 | spin_unlock_irqrestore(lock, flags); |
| 239 | 245 | ||
| 240 | return ret; | 246 | return ret; |
| @@ -242,11 +248,11 @@ static inline __must_check unsigned int kfifo_out_locked(struct kfifo *fifo, | |||
| 242 | 248 | ||
| 243 | extern void kfifo_skip(struct kfifo *fifo, unsigned int len); | 249 | extern void kfifo_skip(struct kfifo *fifo, unsigned int len); |
| 244 | 250 | ||
| 245 | extern __must_check unsigned int kfifo_from_user(struct kfifo *fifo, | 251 | extern __must_check int kfifo_from_user(struct kfifo *fifo, |
| 246 | const void __user *from, unsigned int n); | 252 | const void __user *from, unsigned int n, unsigned *lenout); |
| 247 | 253 | ||
| 248 | extern __must_check unsigned int kfifo_to_user(struct kfifo *fifo, | 254 | extern __must_check int kfifo_to_user(struct kfifo *fifo, |
| 249 | void __user *to, unsigned int n); | 255 | void __user *to, unsigned int n, unsigned *lenout); |
| 250 | 256 | ||
| 251 | /* | 257 | /* |
| 252 | * __kfifo_add_out internal helper function for updating the out offset | 258 | * __kfifo_add_out internal helper function for updating the out offset |
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h index 6adcc297e35..19ec41a183f 100644 --- a/include/linux/kgdb.h +++ b/include/linux/kgdb.h | |||
| @@ -29,8 +29,7 @@ struct pt_regs; | |||
| 29 | * | 29 | * |
| 30 | * On some architectures it is required to skip a breakpoint | 30 | * On some architectures it is required to skip a breakpoint |
| 31 | * exception when it occurs after a breakpoint has been removed. | 31 | * exception when it occurs after a breakpoint has been removed. |
| 32 | * This can be implemented in the architecture specific portion of | 32 | * This can be implemented in the architecture specific portion of kgdb. |
| 33 | * for kgdb. | ||
| 34 | */ | 33 | */ |
| 35 | extern int kgdb_skipexception(int exception, struct pt_regs *regs); | 34 | extern int kgdb_skipexception(int exception, struct pt_regs *regs); |
| 36 | 35 | ||
| @@ -65,7 +64,7 @@ struct uart_port; | |||
| 65 | /** | 64 | /** |
| 66 | * kgdb_breakpoint - compiled in breakpoint | 65 | * kgdb_breakpoint - compiled in breakpoint |
| 67 | * | 66 | * |
| 68 | * This will be impelmented a static inline per architecture. This | 67 | * This will be implemented as a static inline per architecture. This |
| 69 | * function is called by the kgdb core to execute an architecture | 68 | * function is called by the kgdb core to execute an architecture |
| 70 | * specific trap to cause kgdb to enter the exception processing. | 69 | * specific trap to cause kgdb to enter the exception processing. |
| 71 | * | 70 | * |
| @@ -190,7 +189,7 @@ kgdb_arch_handle_exception(int vector, int signo, int err_code, | |||
| 190 | * @flags: Current IRQ state | 189 | * @flags: Current IRQ state |
| 191 | * | 190 | * |
| 192 | * On SMP systems, we need to get the attention of the other CPUs | 191 | * On SMP systems, we need to get the attention of the other CPUs |
| 193 | * and get them be in a known state. This should do what is needed | 192 | * and get them into a known state. This should do what is needed |
| 194 | * to get the other CPUs to call kgdb_wait(). Note that on some arches, | 193 | * to get the other CPUs to call kgdb_wait(). Note that on some arches, |
| 195 | * the NMI approach is not used for rounding up all the CPUs. For example, | 194 | * the NMI approach is not used for rounding up all the CPUs. For example, |
| 196 | * in case of MIPS, smp_call_function() is used to roundup CPUs. In | 195 | * in case of MIPS, smp_call_function() is used to roundup CPUs. In |
diff --git a/include/linux/kmemcheck.h b/include/linux/kmemcheck.h index e880d4cf9e2..08d7dc4ddf4 100644 --- a/include/linux/kmemcheck.h +++ b/include/linux/kmemcheck.h | |||
| @@ -36,6 +36,56 @@ int kmemcheck_hide_addr(unsigned long address); | |||
| 36 | 36 | ||
| 37 | bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size); | 37 | bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size); |
| 38 | 38 | ||
| 39 | /* | ||
| 40 | * Bitfield annotations | ||
| 41 | * | ||
| 42 | * How to use: If you have a struct using bitfields, for example | ||
| 43 | * | ||
| 44 | * struct a { | ||
| 45 | * int x:8, y:8; | ||
| 46 | * }; | ||
| 47 | * | ||
| 48 | * then this should be rewritten as | ||
| 49 | * | ||
| 50 | * struct a { | ||
| 51 | * kmemcheck_bitfield_begin(flags); | ||
| 52 | * int x:8, y:8; | ||
| 53 | * kmemcheck_bitfield_end(flags); | ||
| 54 | * }; | ||
| 55 | * | ||
| 56 | * Now the "flags_begin" and "flags_end" members may be used to refer to the | ||
| 57 | * beginning and end, respectively, of the bitfield (and things like | ||
| 58 | * &x.flags_begin is allowed). As soon as the struct is allocated, the bit- | ||
| 59 | * fields should be annotated: | ||
| 60 | * | ||
| 61 | * struct a *a = kmalloc(sizeof(struct a), GFP_KERNEL); | ||
| 62 | * kmemcheck_annotate_bitfield(a, flags); | ||
| 63 | */ | ||
| 64 | #define kmemcheck_bitfield_begin(name) \ | ||
| 65 | int name##_begin[0]; | ||
| 66 | |||
| 67 | #define kmemcheck_bitfield_end(name) \ | ||
| 68 | int name##_end[0]; | ||
| 69 | |||
| 70 | #define kmemcheck_annotate_bitfield(ptr, name) \ | ||
| 71 | do { \ | ||
| 72 | int _n; \ | ||
| 73 | \ | ||
| 74 | if (!ptr) \ | ||
| 75 | break; \ | ||
| 76 | \ | ||
| 77 | _n = (long) &((ptr)->name##_end) \ | ||
| 78 | - (long) &((ptr)->name##_begin); \ | ||
| 79 | MAYBE_BUILD_BUG_ON(_n < 0); \ | ||
| 80 | \ | ||
| 81 | kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \ | ||
| 82 | } while (0) | ||
| 83 | |||
| 84 | #define kmemcheck_annotate_variable(var) \ | ||
| 85 | do { \ | ||
| 86 | kmemcheck_mark_initialized(&(var), sizeof(var)); \ | ||
| 87 | } while (0) \ | ||
| 88 | |||
| 39 | #else | 89 | #else |
| 40 | #define kmemcheck_enabled 0 | 90 | #define kmemcheck_enabled 0 |
| 41 | 91 | ||
| @@ -106,60 +156,16 @@ static inline bool kmemcheck_is_obj_initialized(unsigned long addr, size_t size) | |||
| 106 | return true; | 156 | return true; |
| 107 | } | 157 | } |
| 108 | 158 | ||
| 109 | #endif /* CONFIG_KMEMCHECK */ | 159 | #define kmemcheck_bitfield_begin(name) |
| 110 | 160 | #define kmemcheck_bitfield_end(name) | |
| 111 | /* | 161 | #define kmemcheck_annotate_bitfield(ptr, name) \ |
| 112 | * Bitfield annotations | 162 | do { \ |
| 113 | * | 163 | } while (0) |
| 114 | * How to use: If you have a struct using bitfields, for example | ||
| 115 | * | ||
| 116 | * struct a { | ||
| 117 | * int x:8, y:8; | ||
| 118 | * }; | ||
| 119 | * | ||
| 120 | * then this should be rewritten as | ||
| 121 | * | ||
| 122 | * struct a { | ||
| 123 | * kmemcheck_bitfield_begin(flags); | ||
| 124 | * int x:8, y:8; | ||
| 125 | * kmemcheck_bitfield_end(flags); | ||
| 126 | * }; | ||
| 127 | * | ||
| 128 | * Now the "flags_begin" and "flags_end" members may be used to refer to the | ||
| 129 | * beginning and end, respectively, of the bitfield (and things like | ||
| 130 | * &x.flags_begin is allowed). As soon as the struct is allocated, the bit- | ||
| 131 | * fields should be annotated: | ||
| 132 | * | ||
| 133 | * struct a *a = kmalloc(sizeof(struct a), GFP_KERNEL); | ||
| 134 | * kmemcheck_annotate_bitfield(a, flags); | ||
| 135 | * | ||
| 136 | * Note: We provide the same definitions for both kmemcheck and non- | ||
| 137 | * kmemcheck kernels. This makes it harder to introduce accidental errors. It | ||
| 138 | * is also allowed to pass NULL pointers to kmemcheck_annotate_bitfield(). | ||
| 139 | */ | ||
| 140 | #define kmemcheck_bitfield_begin(name) \ | ||
| 141 | int name##_begin[0]; | ||
| 142 | |||
| 143 | #define kmemcheck_bitfield_end(name) \ | ||
| 144 | int name##_end[0]; | ||
| 145 | 164 | ||
| 146 | #define kmemcheck_annotate_bitfield(ptr, name) \ | 165 | #define kmemcheck_annotate_variable(var) \ |
| 147 | do { \ | 166 | do { \ |
| 148 | int _n; \ | ||
| 149 | \ | ||
| 150 | if (!ptr) \ | ||
| 151 | break; \ | ||
| 152 | \ | ||
| 153 | _n = (long) &((ptr)->name##_end) \ | ||
| 154 | - (long) &((ptr)->name##_begin); \ | ||
| 155 | MAYBE_BUILD_BUG_ON(_n < 0); \ | ||
| 156 | \ | ||
| 157 | kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \ | ||
| 158 | } while (0) | 167 | } while (0) |
| 159 | 168 | ||
| 160 | #define kmemcheck_annotate_variable(var) \ | 169 | #endif /* CONFIG_KMEMCHECK */ |
| 161 | do { \ | ||
| 162 | kmemcheck_mark_initialized(&(var), sizeof(var)); \ | ||
| 163 | } while (0) \ | ||
| 164 | 170 | ||
| 165 | #endif /* LINUX_KMEMCHECK_H */ | 171 | #endif /* LINUX_KMEMCHECK_H */ |
diff --git a/include/linux/kmsg_dump.h b/include/linux/kmsg_dump.h index e32aa268efa..24b44145a88 100644 --- a/include/linux/kmsg_dump.h +++ b/include/linux/kmsg_dump.h | |||
| @@ -17,6 +17,7 @@ | |||
| 17 | enum kmsg_dump_reason { | 17 | enum kmsg_dump_reason { |
| 18 | KMSG_DUMP_OOPS, | 18 | KMSG_DUMP_OOPS, |
| 19 | KMSG_DUMP_PANIC, | 19 | KMSG_DUMP_PANIC, |
| 20 | KMSG_DUMP_KEXEC, | ||
| 20 | }; | 21 | }; |
| 21 | 22 | ||
| 22 | /** | 23 | /** |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 6a9c4ddd3d9..f8ea71e6d0e 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
| @@ -354,6 +354,9 @@ enum { | |||
| 354 | /* max tries if error condition is still set after ->error_handler */ | 354 | /* max tries if error condition is still set after ->error_handler */ |
| 355 | ATA_EH_MAX_TRIES = 5, | 355 | ATA_EH_MAX_TRIES = 5, |
| 356 | 356 | ||
| 357 | /* sometimes resuming a link requires several retries */ | ||
| 358 | ATA_LINK_RESUME_TRIES = 5, | ||
| 359 | |||
| 357 | /* how hard are we gonna try to probe/recover devices */ | 360 | /* how hard are we gonna try to probe/recover devices */ |
| 358 | ATA_PROBE_MAX_TRIES = 3, | 361 | ATA_PROBE_MAX_TRIES = 3, |
| 359 | ATA_EH_DEV_TRIES = 3, | 362 | ATA_EH_DEV_TRIES = 3, |
| @@ -854,6 +857,7 @@ struct ata_port_operations { | |||
| 854 | unsigned int (*sff_data_xfer)(struct ata_device *dev, | 857 | unsigned int (*sff_data_xfer)(struct ata_device *dev, |
| 855 | unsigned char *buf, unsigned int buflen, int rw); | 858 | unsigned char *buf, unsigned int buflen, int rw); |
| 856 | u8 (*sff_irq_on)(struct ata_port *); | 859 | u8 (*sff_irq_on)(struct ata_port *); |
| 860 | bool (*sff_irq_check)(struct ata_port *); | ||
| 857 | void (*sff_irq_clear)(struct ata_port *); | 861 | void (*sff_irq_clear)(struct ata_port *); |
| 858 | 862 | ||
| 859 | void (*bmdma_setup)(struct ata_queued_cmd *qc); | 863 | void (*bmdma_setup)(struct ata_queued_cmd *qc); |
| @@ -1639,8 +1643,8 @@ extern int ata_pci_sff_activate_host(struct ata_host *host, | |||
| 1639 | irq_handler_t irq_handler, | 1643 | irq_handler_t irq_handler, |
| 1640 | struct scsi_host_template *sht); | 1644 | struct scsi_host_template *sht); |
| 1641 | extern int ata_pci_sff_init_one(struct pci_dev *pdev, | 1645 | extern int ata_pci_sff_init_one(struct pci_dev *pdev, |
| 1642 | const struct ata_port_info * const * ppi, | 1646 | const struct ata_port_info * const * ppi, |
| 1643 | struct scsi_host_template *sht, void *host_priv); | 1647 | struct scsi_host_template *sht, void *host_priv, int hflags); |
| 1644 | #endif /* CONFIG_PCI */ | 1648 | #endif /* CONFIG_PCI */ |
| 1645 | 1649 | ||
| 1646 | /** | 1650 | /** |
diff --git a/include/linux/list.h b/include/linux/list.h index 969f6e92d08..5d9c6558e8a 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
| @@ -206,6 +206,20 @@ static inline int list_empty_careful(const struct list_head *head) | |||
| 206 | } | 206 | } |
| 207 | 207 | ||
| 208 | /** | 208 | /** |
| 209 | * list_rotate_left - rotate the list to the left | ||
| 210 | * @head: the head of the list | ||
| 211 | */ | ||
| 212 | static inline void list_rotate_left(struct list_head *head) | ||
| 213 | { | ||
| 214 | struct list_head *first; | ||
| 215 | |||
| 216 | if (!list_empty(head)) { | ||
| 217 | first = head->next; | ||
| 218 | list_move_tail(first, head); | ||
| 219 | } | ||
| 220 | } | ||
| 221 | |||
| 222 | /** | ||
| 209 | * list_is_singular - tests whether a list has just one entry. | 223 | * list_is_singular - tests whether a list has just one entry. |
| 210 | * @head: the list to test. | 224 | * @head: the list to test. |
| 211 | */ | 225 | */ |
diff --git a/include/linux/list_sort.h b/include/linux/list_sort.h new file mode 100644 index 00000000000..1a2df2efb77 --- /dev/null +++ b/include/linux/list_sort.h | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | #ifndef _LINUX_LIST_SORT_H | ||
| 2 | #define _LINUX_LIST_SORT_H | ||
| 3 | |||
| 4 | #include <linux/types.h> | ||
| 5 | |||
| 6 | struct list_head; | ||
| 7 | |||
| 8 | void list_sort(void *priv, struct list_head *head, | ||
| 9 | int (*cmp)(void *priv, struct list_head *a, | ||
| 10 | struct list_head *b)); | ||
| 11 | #endif | ||
diff --git a/include/linux/llc.h b/include/linux/llc.h index 7733585603f..ad7074ba81a 100644 --- a/include/linux/llc.h +++ b/include/linux/llc.h | |||
| @@ -36,6 +36,7 @@ enum llc_sockopts { | |||
| 36 | LLC_OPT_BUSY_TMR_EXP, /* busy state expire time (secs). */ | 36 | LLC_OPT_BUSY_TMR_EXP, /* busy state expire time (secs). */ |
| 37 | LLC_OPT_TX_WIN, /* tx window size. */ | 37 | LLC_OPT_TX_WIN, /* tx window size. */ |
| 38 | LLC_OPT_RX_WIN, /* rx window size. */ | 38 | LLC_OPT_RX_WIN, /* rx window size. */ |
| 39 | LLC_OPT_PKTINFO, /* ancillary packet information. */ | ||
| 39 | LLC_OPT_MAX | 40 | LLC_OPT_MAX |
| 40 | }; | 41 | }; |
| 41 | 42 | ||
| @@ -70,6 +71,12 @@ enum llc_sockopts { | |||
| 70 | #define LLC_SAP_RM 0xD4 /* Resource Management */ | 71 | #define LLC_SAP_RM 0xD4 /* Resource Management */ |
| 71 | #define LLC_SAP_GLOBAL 0xFF /* Global SAP. */ | 72 | #define LLC_SAP_GLOBAL 0xFF /* Global SAP. */ |
| 72 | 73 | ||
| 74 | struct llc_pktinfo { | ||
| 75 | int lpi_ifindex; | ||
| 76 | unsigned char lpi_sap; | ||
| 77 | unsigned char lpi_mac[IFHWADDRLEN]; | ||
| 78 | }; | ||
| 79 | |||
| 73 | #ifdef __KERNEL__ | 80 | #ifdef __KERNEL__ |
| 74 | #define LLC_SAP_DYN_START 0xC0 | 81 | #define LLC_SAP_DYN_START 0xC0 |
| 75 | #define LLC_SAP_DYN_STOP 0xDE | 82 | #define LLC_SAP_DYN_STOP 0xDE |
diff --git a/include/linux/lmb.h b/include/linux/lmb.h index ef82b8fcbdd..f3d14333ebe 100644 --- a/include/linux/lmb.h +++ b/include/linux/lmb.h | |||
| @@ -42,6 +42,7 @@ extern void __init lmb_init(void); | |||
| 42 | extern void __init lmb_analyze(void); | 42 | extern void __init lmb_analyze(void); |
| 43 | extern long lmb_add(u64 base, u64 size); | 43 | extern long lmb_add(u64 base, u64 size); |
| 44 | extern long lmb_remove(u64 base, u64 size); | 44 | extern long lmb_remove(u64 base, u64 size); |
| 45 | extern long __init lmb_free(u64 base, u64 size); | ||
| 45 | extern long __init lmb_reserve(u64 base, u64 size); | 46 | extern long __init lmb_reserve(u64 base, u64 size); |
| 46 | extern u64 __init lmb_alloc_nid(u64 size, u64 align, int nid, | 47 | extern u64 __init lmb_alloc_nid(u64 size, u64 align, int nid, |
| 47 | u64 (*nid_range)(u64, u64, int *)); | 48 | u64 (*nid_range)(u64, u64, int *)); |
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index 9ccf0e286b2..10206a87da1 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
| @@ -534,4 +534,8 @@ do { \ | |||
| 534 | # define might_lock_read(lock) do { } while (0) | 534 | # define might_lock_read(lock) do { } while (0) |
| 535 | #endif | 535 | #endif |
| 536 | 536 | ||
| 537 | #ifdef CONFIG_PROVE_RCU | ||
| 538 | extern void lockdep_rcu_dereference(const char *file, const int line); | ||
| 539 | #endif | ||
| 540 | |||
| 537 | #endif /* __LINUX_LOCKDEP_H */ | 541 | #endif /* __LINUX_LOCKDEP_H */ |
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index 6b9c5d06690..9cb1834deff 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h | |||
| @@ -2,6 +2,8 @@ | |||
| 2 | #define MFD_TMIO_H | 2 | #define MFD_TMIO_H |
| 3 | 3 | ||
| 4 | #include <linux/fb.h> | 4 | #include <linux/fb.h> |
| 5 | #include <linux/io.h> | ||
| 6 | #include <linux/platform_device.h> | ||
| 5 | 7 | ||
| 6 | #define tmio_ioread8(addr) readb(addr) | 8 | #define tmio_ioread8(addr) readb(addr) |
| 7 | #define tmio_ioread16(addr) readw(addr) | 9 | #define tmio_ioread16(addr) readw(addr) |
| @@ -18,11 +20,48 @@ | |||
| 18 | writew((val) >> 16, (addr) + 2); \ | 20 | writew((val) >> 16, (addr) + 2); \ |
| 19 | } while (0) | 21 | } while (0) |
| 20 | 22 | ||
| 23 | #define CNF_CMD 0x04 | ||
| 24 | #define CNF_CTL_BASE 0x10 | ||
| 25 | #define CNF_INT_PIN 0x3d | ||
| 26 | #define CNF_STOP_CLK_CTL 0x40 | ||
| 27 | #define CNF_GCLK_CTL 0x41 | ||
| 28 | #define CNF_SD_CLK_MODE 0x42 | ||
| 29 | #define CNF_PIN_STATUS 0x44 | ||
| 30 | #define CNF_PWR_CTL_1 0x48 | ||
| 31 | #define CNF_PWR_CTL_2 0x49 | ||
| 32 | #define CNF_PWR_CTL_3 0x4a | ||
| 33 | #define CNF_CARD_DETECT_MODE 0x4c | ||
| 34 | #define CNF_SD_SLOT 0x50 | ||
| 35 | #define CNF_EXT_GCLK_CTL_1 0xf0 | ||
| 36 | #define CNF_EXT_GCLK_CTL_2 0xf1 | ||
| 37 | #define CNF_EXT_GCLK_CTL_3 0xf9 | ||
| 38 | #define CNF_SD_LED_EN_1 0xfa | ||
| 39 | #define CNF_SD_LED_EN_2 0xfe | ||
| 40 | |||
| 41 | #define SDCREN 0x2 /* Enable access to MMC CTL regs. (flag in COMMAND_REG)*/ | ||
| 42 | |||
| 43 | #define sd_config_write8(base, shift, reg, val) \ | ||
| 44 | tmio_iowrite8((val), (base) + ((reg) << (shift))) | ||
| 45 | #define sd_config_write16(base, shift, reg, val) \ | ||
| 46 | tmio_iowrite16((val), (base) + ((reg) << (shift))) | ||
| 47 | #define sd_config_write32(base, shift, reg, val) \ | ||
| 48 | do { \ | ||
| 49 | tmio_iowrite16((val), (base) + ((reg) << (shift))); \ | ||
| 50 | tmio_iowrite16((val) >> 16, (base) + ((reg + 2) << (shift))); \ | ||
| 51 | } while (0) | ||
| 52 | |||
| 53 | int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); | ||
| 54 | int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); | ||
| 55 | void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state); | ||
| 56 | void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state); | ||
| 57 | |||
| 21 | /* | 58 | /* |
| 22 | * data for the MMC controller | 59 | * data for the MMC controller |
| 23 | */ | 60 | */ |
| 24 | struct tmio_mmc_data { | 61 | struct tmio_mmc_data { |
| 25 | const unsigned int hclk; | 62 | const unsigned int hclk; |
| 63 | void (*set_pwr)(struct platform_device *host, int state); | ||
| 64 | void (*set_clk_div)(struct platform_device *host, int state); | ||
| 26 | }; | 65 | }; |
| 27 | 66 | ||
| 28 | /* | 67 | /* |
diff --git a/include/linux/mfd/wm8350/pmic.h b/include/linux/mfd/wm8350/pmic.h index be3264e286e..e786fe9841e 100644 --- a/include/linux/mfd/wm8350/pmic.h +++ b/include/linux/mfd/wm8350/pmic.h | |||
| @@ -666,20 +666,20 @@ | |||
| 666 | #define WM8350_ISINK_FLASH_DUR_64MS (1 << 8) | 666 | #define WM8350_ISINK_FLASH_DUR_64MS (1 << 8) |
| 667 | #define WM8350_ISINK_FLASH_DUR_96MS (2 << 8) | 667 | #define WM8350_ISINK_FLASH_DUR_96MS (2 << 8) |
| 668 | #define WM8350_ISINK_FLASH_DUR_1024MS (3 << 8) | 668 | #define WM8350_ISINK_FLASH_DUR_1024MS (3 << 8) |
| 669 | #define WM8350_ISINK_FLASH_ON_INSTANT (0 << 4) | 669 | #define WM8350_ISINK_FLASH_ON_INSTANT (0 << 0) |
| 670 | #define WM8350_ISINK_FLASH_ON_0_25S (1 << 4) | 670 | #define WM8350_ISINK_FLASH_ON_0_25S (1 << 0) |
| 671 | #define WM8350_ISINK_FLASH_ON_0_50S (2 << 4) | 671 | #define WM8350_ISINK_FLASH_ON_0_50S (2 << 0) |
| 672 | #define WM8350_ISINK_FLASH_ON_1_00S (3 << 4) | 672 | #define WM8350_ISINK_FLASH_ON_1_00S (3 << 0) |
| 673 | #define WM8350_ISINK_FLASH_ON_1_95S (1 << 4) | 673 | #define WM8350_ISINK_FLASH_ON_1_95S (1 << 0) |
| 674 | #define WM8350_ISINK_FLASH_ON_3_91S (2 << 4) | 674 | #define WM8350_ISINK_FLASH_ON_3_91S (2 << 0) |
| 675 | #define WM8350_ISINK_FLASH_ON_7_80S (3 << 4) | 675 | #define WM8350_ISINK_FLASH_ON_7_80S (3 << 0) |
| 676 | #define WM8350_ISINK_FLASH_OFF_INSTANT (0 << 0) | 676 | #define WM8350_ISINK_FLASH_OFF_INSTANT (0 << 4) |
| 677 | #define WM8350_ISINK_FLASH_OFF_0_25S (1 << 0) | 677 | #define WM8350_ISINK_FLASH_OFF_0_25S (1 << 4) |
| 678 | #define WM8350_ISINK_FLASH_OFF_0_50S (2 << 0) | 678 | #define WM8350_ISINK_FLASH_OFF_0_50S (2 << 4) |
| 679 | #define WM8350_ISINK_FLASH_OFF_1_00S (3 << 0) | 679 | #define WM8350_ISINK_FLASH_OFF_1_00S (3 << 4) |
| 680 | #define WM8350_ISINK_FLASH_OFF_1_95S (1 << 0) | 680 | #define WM8350_ISINK_FLASH_OFF_1_95S (1 << 4) |
| 681 | #define WM8350_ISINK_FLASH_OFF_3_91S (2 << 0) | 681 | #define WM8350_ISINK_FLASH_OFF_3_91S (2 << 4) |
| 682 | #define WM8350_ISINK_FLASH_OFF_7_80S (3 << 0) | 682 | #define WM8350_ISINK_FLASH_OFF_7_80S (3 << 4) |
| 683 | 683 | ||
| 684 | /* | 684 | /* |
| 685 | * Regulator Interrupts. | 685 | * Regulator Interrupts. |
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index adaf3c15e44..8b5f7cc0fba 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h | |||
| @@ -30,6 +30,7 @@ | |||
| 30 | #define HPET_MINOR 228 | 30 | #define HPET_MINOR 228 |
| 31 | #define FUSE_MINOR 229 | 31 | #define FUSE_MINOR 229 |
| 32 | #define KVM_MINOR 232 | 32 | #define KVM_MINOR 232 |
| 33 | #define VHOST_NET_MINOR 233 | ||
| 33 | #define MISC_DYNAMIC_MINOR 255 | 34 | #define MISC_DYNAMIC_MINOR 255 |
| 34 | 35 | ||
| 35 | struct device; | 36 | struct device; |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 2265f28eb47..8b2fa8593c6 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
| @@ -265,6 +265,8 @@ static inline int get_page_unless_zero(struct page *page) | |||
| 265 | return atomic_inc_not_zero(&page->_count); | 265 | return atomic_inc_not_zero(&page->_count); |
| 266 | } | 266 | } |
| 267 | 267 | ||
| 268 | extern int page_is_ram(unsigned long pfn); | ||
| 269 | |||
| 268 | /* Support for virtually mapped pages */ | 270 | /* Support for virtually mapped pages */ |
| 269 | struct page *vmalloc_to_page(const void *addr); | 271 | struct page *vmalloc_to_page(const void *addr); |
| 270 | unsigned long vmalloc_to_pfn(const void *addr); | 272 | unsigned long vmalloc_to_pfn(const void *addr); |
| @@ -1089,6 +1091,7 @@ extern void zone_pcp_update(struct zone *zone); | |||
| 1089 | 1091 | ||
| 1090 | /* nommu.c */ | 1092 | /* nommu.c */ |
| 1091 | extern atomic_long_t mmap_pages_allocated; | 1093 | extern atomic_long_t mmap_pages_allocated; |
| 1094 | extern int nommu_shrink_inode_mappings(struct inode *, size_t, size_t); | ||
| 1092 | 1095 | ||
| 1093 | /* prio_tree.c */ | 1096 | /* prio_tree.c */ |
| 1094 | void vma_prio_tree_add(struct vm_area_struct *, struct vm_area_struct *old); | 1097 | void vma_prio_tree_add(struct vm_area_struct *, struct vm_area_struct *old); |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 84a524afb3d..36f96271306 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
| @@ -122,7 +122,9 @@ struct vm_region { | |||
| 122 | unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */ | 122 | unsigned long vm_pgoff; /* the offset in vm_file corresponding to vm_start */ |
| 123 | struct file *vm_file; /* the backing file or NULL */ | 123 | struct file *vm_file; /* the backing file or NULL */ |
| 124 | 124 | ||
| 125 | atomic_t vm_usage; /* region usage count */ | 125 | int vm_usage; /* region usage count (access under nommu_region_sem) */ |
| 126 | bool vm_icache_flushed : 1; /* true if the icache has been flushed for | ||
| 127 | * this region */ | ||
| 126 | }; | 128 | }; |
| 127 | 129 | ||
| 128 | /* | 130 | /* |
| @@ -203,10 +205,12 @@ struct mm_struct { | |||
| 203 | struct vm_area_struct * mmap; /* list of VMAs */ | 205 | struct vm_area_struct * mmap; /* list of VMAs */ |
| 204 | struct rb_root mm_rb; | 206 | struct rb_root mm_rb; |
| 205 | struct vm_area_struct * mmap_cache; /* last find_vma result */ | 207 | struct vm_area_struct * mmap_cache; /* last find_vma result */ |
| 208 | #ifdef CONFIG_MMU | ||
| 206 | unsigned long (*get_unmapped_area) (struct file *filp, | 209 | unsigned long (*get_unmapped_area) (struct file *filp, |
| 207 | unsigned long addr, unsigned long len, | 210 | unsigned long addr, unsigned long len, |
| 208 | unsigned long pgoff, unsigned long flags); | 211 | unsigned long pgoff, unsigned long flags); |
| 209 | void (*unmap_area) (struct mm_struct *mm, unsigned long addr); | 212 | void (*unmap_area) (struct mm_struct *mm, unsigned long addr); |
| 213 | #endif | ||
| 210 | unsigned long mmap_base; /* base of mmap area */ | 214 | unsigned long mmap_base; /* base of mmap area */ |
| 211 | unsigned long task_size; /* size of task vm space */ | 215 | unsigned long task_size; /* size of task vm space */ |
| 212 | unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */ | 216 | unsigned long cached_hole_size; /* if non-zero, the largest hole below free_area_cache */ |
diff --git a/include/linux/mtd/pismo.h b/include/linux/mtd/pismo.h new file mode 100644 index 00000000000..8dfb7e1421c --- /dev/null +++ b/include/linux/mtd/pismo.h | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | /* | ||
| 2 | * PISMO memory driver - http://www.pismoworld.org/ | ||
| 3 | * | ||
| 4 | * This program is free software; you can redistribute it and/or modify | ||
| 5 | * it under the terms of the GNU General Public License as published by | ||
| 6 | * the Free Software Foundation; either version 2 of the License. | ||
| 7 | */ | ||
| 8 | #ifndef __LINUX_MTD_PISMO_H | ||
| 9 | #define __LINUX_MTD_PISMO_H | ||
| 10 | |||
| 11 | struct pismo_pdata { | ||
| 12 | void (*set_vpp)(void *, int); | ||
| 13 | void *vpp_data; | ||
| 14 | phys_addr_t cs_addrs[5]; | ||
| 15 | }; | ||
| 16 | |||
| 17 | #endif | ||
diff --git a/include/linux/mtd/sh_flctl.h b/include/linux/mtd/sh_flctl.h index e77c1cea404..ab77609ec33 100644 --- a/include/linux/mtd/sh_flctl.h +++ b/include/linux/mtd/sh_flctl.h | |||
| @@ -51,6 +51,8 @@ | |||
| 51 | #define _4ECCCNTEN (0x1 << 24) | 51 | #define _4ECCCNTEN (0x1 << 24) |
| 52 | #define _4ECCEN (0x1 << 23) | 52 | #define _4ECCEN (0x1 << 23) |
| 53 | #define _4ECCCORRECT (0x1 << 22) | 53 | #define _4ECCCORRECT (0x1 << 22) |
| 54 | #define SHBUSSEL (0x1 << 20) | ||
| 55 | #define SEL_16BIT (0x1 << 19) | ||
| 54 | #define SNAND_E (0x1 << 18) /* SNAND (0=512 1=2048)*/ | 56 | #define SNAND_E (0x1 << 18) /* SNAND (0=512 1=2048)*/ |
| 55 | #define QTSEL_E (0x1 << 17) | 57 | #define QTSEL_E (0x1 << 17) |
| 56 | #define ENDIAN (0x1 << 16) /* 1 = little endian */ | 58 | #define ENDIAN (0x1 << 16) /* 1 = little endian */ |
| @@ -96,6 +98,7 @@ | |||
| 96 | struct sh_flctl { | 98 | struct sh_flctl { |
| 97 | struct mtd_info mtd; | 99 | struct mtd_info mtd; |
| 98 | struct nand_chip chip; | 100 | struct nand_chip chip; |
| 101 | struct platform_device *pdev; | ||
| 99 | void __iomem *reg; | 102 | void __iomem *reg; |
| 100 | 103 | ||
| 101 | uint8_t done_buff[2048 + 64]; /* max size 2048 + 64 */ | 104 | uint8_t done_buff[2048 + 64]; /* max size 2048 + 64 */ |
diff --git a/include/linux/net.h b/include/linux/net.h index 5e8083cacc8..4157b5d42bd 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
| @@ -174,18 +174,22 @@ struct proto_ops { | |||
| 174 | struct poll_table_struct *wait); | 174 | struct poll_table_struct *wait); |
| 175 | int (*ioctl) (struct socket *sock, unsigned int cmd, | 175 | int (*ioctl) (struct socket *sock, unsigned int cmd, |
| 176 | unsigned long arg); | 176 | unsigned long arg); |
| 177 | #ifdef CONFIG_COMPAT | ||
| 177 | int (*compat_ioctl) (struct socket *sock, unsigned int cmd, | 178 | int (*compat_ioctl) (struct socket *sock, unsigned int cmd, |
| 178 | unsigned long arg); | 179 | unsigned long arg); |
| 180 | #endif | ||
| 179 | int (*listen) (struct socket *sock, int len); | 181 | int (*listen) (struct socket *sock, int len); |
| 180 | int (*shutdown) (struct socket *sock, int flags); | 182 | int (*shutdown) (struct socket *sock, int flags); |
| 181 | int (*setsockopt)(struct socket *sock, int level, | 183 | int (*setsockopt)(struct socket *sock, int level, |
| 182 | int optname, char __user *optval, unsigned int optlen); | 184 | int optname, char __user *optval, unsigned int optlen); |
| 183 | int (*getsockopt)(struct socket *sock, int level, | 185 | int (*getsockopt)(struct socket *sock, int level, |
| 184 | int optname, char __user *optval, int __user *optlen); | 186 | int optname, char __user *optval, int __user *optlen); |
| 187 | #ifdef CONFIG_COMPAT | ||
| 185 | int (*compat_setsockopt)(struct socket *sock, int level, | 188 | int (*compat_setsockopt)(struct socket *sock, int level, |
| 186 | int optname, char __user *optval, unsigned int optlen); | 189 | int optname, char __user *optval, unsigned int optlen); |
| 187 | int (*compat_getsockopt)(struct socket *sock, int level, | 190 | int (*compat_getsockopt)(struct socket *sock, int level, |
| 188 | int optname, char __user *optval, int __user *optlen); | 191 | int optname, char __user *optval, int __user *optlen); |
| 192 | #endif | ||
| 189 | int (*sendmsg) (struct kiocb *iocb, struct socket *sock, | 193 | int (*sendmsg) (struct kiocb *iocb, struct socket *sock, |
| 190 | struct msghdr *m, size_t total_len); | 194 | struct msghdr *m, size_t total_len); |
| 191 | int (*recvmsg) (struct kiocb *iocb, struct socket *sock, | 195 | int (*recvmsg) (struct kiocb *iocb, struct socket *sock, |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index a3fccc85b1a..c79a88be7c3 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
| @@ -28,6 +28,7 @@ | |||
| 28 | #include <linux/if.h> | 28 | #include <linux/if.h> |
| 29 | #include <linux/if_ether.h> | 29 | #include <linux/if_ether.h> |
| 30 | #include <linux/if_packet.h> | 30 | #include <linux/if_packet.h> |
| 31 | #include <linux/if_link.h> | ||
| 31 | 32 | ||
| 32 | #ifdef __KERNEL__ | 33 | #ifdef __KERNEL__ |
| 33 | #include <linux/timer.h> | 34 | #include <linux/timer.h> |
| @@ -136,7 +137,7 @@ static inline bool dev_xmit_complete(int rc) | |||
| 136 | * used. | 137 | * used. |
| 137 | */ | 138 | */ |
| 138 | 139 | ||
| 139 | #if defined(CONFIG_WLAN_80211) || defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) | 140 | #if defined(CONFIG_WLAN) || defined(CONFIG_AX25) || defined(CONFIG_AX25_MODULE) |
| 140 | # if defined(CONFIG_MAC80211_MESH) | 141 | # if defined(CONFIG_MAC80211_MESH) |
| 141 | # define LL_MAX_HEADER 128 | 142 | # define LL_MAX_HEADER 128 |
| 142 | # else | 143 | # else |
| @@ -263,6 +264,17 @@ struct netdev_hw_addr_list { | |||
| 263 | int count; | 264 | int count; |
| 264 | }; | 265 | }; |
| 265 | 266 | ||
| 267 | #define netdev_uc_count(dev) ((dev)->uc.count) | ||
| 268 | #define netdev_uc_empty(dev) ((dev)->uc.count == 0) | ||
| 269 | #define netdev_for_each_uc_addr(ha, dev) \ | ||
| 270 | list_for_each_entry(ha, &dev->uc.list, list) | ||
| 271 | |||
| 272 | #define netdev_mc_count(dev) ((dev)->mc_count) | ||
| 273 | #define netdev_mc_empty(dev) (netdev_mc_count(dev) == 0) | ||
| 274 | |||
| 275 | #define netdev_for_each_mc_addr(mclist, dev) \ | ||
| 276 | for (mclist = dev->mc_list; mclist; mclist = mclist->next) | ||
| 277 | |||
| 266 | struct hh_cache { | 278 | struct hh_cache { |
| 267 | struct hh_cache *hh_next; /* Next entry */ | 279 | struct hh_cache *hh_next; /* Next entry */ |
| 268 | atomic_t hh_refcnt; /* number of users */ | 280 | atomic_t hh_refcnt; /* number of users */ |
| @@ -610,6 +622,13 @@ struct netdev_queue { | |||
| 610 | * this function is called when a VLAN id is unregistered. | 622 | * this function is called when a VLAN id is unregistered. |
| 611 | * | 623 | * |
| 612 | * void (*ndo_poll_controller)(struct net_device *dev); | 624 | * void (*ndo_poll_controller)(struct net_device *dev); |
| 625 | * | ||
| 626 | * SR-IOV management functions. | ||
| 627 | * int (*ndo_set_vf_mac)(struct net_device *dev, int vf, u8* mac); | ||
| 628 | * int (*ndo_set_vf_vlan)(struct net_device *dev, int vf, u16 vlan, u8 qos); | ||
| 629 | * int (*ndo_set_vf_tx_rate)(struct net_device *dev, int vf, int rate); | ||
| 630 | * int (*ndo_get_vf_config)(struct net_device *dev, | ||
| 631 | * int vf, struct ifla_vf_info *ivf); | ||
| 613 | */ | 632 | */ |
| 614 | #define HAVE_NET_DEVICE_OPS | 633 | #define HAVE_NET_DEVICE_OPS |
| 615 | struct net_device_ops { | 634 | struct net_device_ops { |
| @@ -621,30 +640,21 @@ struct net_device_ops { | |||
| 621 | struct net_device *dev); | 640 | struct net_device *dev); |
| 622 | u16 (*ndo_select_queue)(struct net_device *dev, | 641 | u16 (*ndo_select_queue)(struct net_device *dev, |
| 623 | struct sk_buff *skb); | 642 | struct sk_buff *skb); |
| 624 | #define HAVE_CHANGE_RX_FLAGS | ||
| 625 | void (*ndo_change_rx_flags)(struct net_device *dev, | 643 | void (*ndo_change_rx_flags)(struct net_device *dev, |
| 626 | int flags); | 644 | int flags); |
| 627 | #define HAVE_SET_RX_MODE | ||
| 628 | void (*ndo_set_rx_mode)(struct net_device *dev); | 645 | void (*ndo_set_rx_mode)(struct net_device *dev); |
| 629 | #define HAVE_MULTICAST | ||
| 630 | void (*ndo_set_multicast_list)(struct net_device *dev); | 646 | void (*ndo_set_multicast_list)(struct net_device *dev); |
| 631 | #define HAVE_SET_MAC_ADDR | ||
| 632 | int (*ndo_set_mac_address)(struct net_device *dev, | 647 | int (*ndo_set_mac_address)(struct net_device *dev, |
| 633 | void *addr); | 648 | void *addr); |
| 634 | #define HAVE_VALIDATE_ADDR | ||
| 635 | int (*ndo_validate_addr)(struct net_device *dev); | 649 | int (*ndo_validate_addr)(struct net_device *dev); |
| 636 | #define HAVE_PRIVATE_IOCTL | ||
| 637 | int (*ndo_do_ioctl)(struct net_device *dev, | 650 | int (*ndo_do_ioctl)(struct net_device *dev, |
| 638 | struct ifreq *ifr, int cmd); | 651 | struct ifreq *ifr, int cmd); |
| 639 | #define HAVE_SET_CONFIG | ||
| 640 | int (*ndo_set_config)(struct net_device *dev, | 652 | int (*ndo_set_config)(struct net_device *dev, |
| 641 | struct ifmap *map); | 653 | struct ifmap *map); |
| 642 | #define HAVE_CHANGE_MTU | ||
| 643 | int (*ndo_change_mtu)(struct net_device *dev, | 654 | int (*ndo_change_mtu)(struct net_device *dev, |
| 644 | int new_mtu); | 655 | int new_mtu); |
| 645 | int (*ndo_neigh_setup)(struct net_device *dev, | 656 | int (*ndo_neigh_setup)(struct net_device *dev, |
| 646 | struct neigh_parms *); | 657 | struct neigh_parms *); |
| 647 | #define HAVE_TX_TIMEOUT | ||
| 648 | void (*ndo_tx_timeout) (struct net_device *dev); | 658 | void (*ndo_tx_timeout) (struct net_device *dev); |
| 649 | 659 | ||
| 650 | struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); | 660 | struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); |
| @@ -656,9 +666,17 @@ struct net_device_ops { | |||
| 656 | void (*ndo_vlan_rx_kill_vid)(struct net_device *dev, | 666 | void (*ndo_vlan_rx_kill_vid)(struct net_device *dev, |
| 657 | unsigned short vid); | 667 | unsigned short vid); |
| 658 | #ifdef CONFIG_NET_POLL_CONTROLLER | 668 | #ifdef CONFIG_NET_POLL_CONTROLLER |
| 659 | #define HAVE_NETDEV_POLL | ||
| 660 | void (*ndo_poll_controller)(struct net_device *dev); | 669 | void (*ndo_poll_controller)(struct net_device *dev); |
| 661 | #endif | 670 | #endif |
| 671 | int (*ndo_set_vf_mac)(struct net_device *dev, | ||
| 672 | int queue, u8 *mac); | ||
| 673 | int (*ndo_set_vf_vlan)(struct net_device *dev, | ||
| 674 | int queue, u16 vlan, u8 qos); | ||
| 675 | int (*ndo_set_vf_tx_rate)(struct net_device *dev, | ||
| 676 | int vf, int rate); | ||
| 677 | int (*ndo_get_vf_config)(struct net_device *dev, | ||
| 678 | int vf, | ||
| 679 | struct ifla_vf_info *ivf); | ||
| 662 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) | 680 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) |
| 663 | int (*ndo_fcoe_enable)(struct net_device *dev); | 681 | int (*ndo_fcoe_enable)(struct net_device *dev); |
| 664 | int (*ndo_fcoe_disable)(struct net_device *dev); | 682 | int (*ndo_fcoe_disable)(struct net_device *dev); |
| @@ -745,6 +763,7 @@ struct net_device { | |||
| 745 | #define NETIF_F_FCOE_CRC (1 << 24) /* FCoE CRC32 */ | 763 | #define NETIF_F_FCOE_CRC (1 << 24) /* FCoE CRC32 */ |
| 746 | #define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */ | 764 | #define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */ |
| 747 | #define NETIF_F_FCOE_MTU (1 << 26) /* Supports max FCoE MTU, 2158 bytes*/ | 765 | #define NETIF_F_FCOE_MTU (1 << 26) /* Supports max FCoE MTU, 2158 bytes*/ |
| 766 | #define NETIF_F_NTUPLE (1 << 27) /* N-tuple filters supported */ | ||
| 748 | 767 | ||
| 749 | /* Segmentation offload features */ | 768 | /* Segmentation offload features */ |
| 750 | #define NETIF_F_GSO_SHIFT 16 | 769 | #define NETIF_F_GSO_SHIFT 16 |
| @@ -905,7 +924,12 @@ struct net_device { | |||
| 905 | NETREG_UNREGISTERED, /* completed unregister todo */ | 924 | NETREG_UNREGISTERED, /* completed unregister todo */ |
| 906 | NETREG_RELEASED, /* called free_netdev */ | 925 | NETREG_RELEASED, /* called free_netdev */ |
| 907 | NETREG_DUMMY, /* dummy device for NAPI poll */ | 926 | NETREG_DUMMY, /* dummy device for NAPI poll */ |
| 908 | } reg_state; | 927 | } reg_state:16; |
| 928 | |||
| 929 | enum { | ||
| 930 | RTNL_LINK_INITIALIZED, | ||
| 931 | RTNL_LINK_INITIALIZING, | ||
| 932 | } rtnl_link_state:16; | ||
| 909 | 933 | ||
| 910 | /* Called from unregister, can be used to call free_netdev */ | 934 | /* Called from unregister, can be used to call free_netdev */ |
| 911 | void (*destructor)(struct net_device *dev); | 935 | void (*destructor)(struct net_device *dev); |
| @@ -953,6 +977,8 @@ struct net_device { | |||
| 953 | /* max exchange id for FCoE LRO by ddp */ | 977 | /* max exchange id for FCoE LRO by ddp */ |
| 954 | unsigned int fcoe_ddp_xid; | 978 | unsigned int fcoe_ddp_xid; |
| 955 | #endif | 979 | #endif |
| 980 | /* n-tuple filter list attached to this device */ | ||
| 981 | struct ethtool_rx_ntuple_list ethtool_ntuple_list; | ||
| 956 | }; | 982 | }; |
| 957 | #define to_net_dev(d) container_of(d, struct net_device, dev) | 983 | #define to_net_dev(d) container_of(d, struct net_device, dev) |
| 958 | 984 | ||
| @@ -1009,6 +1035,15 @@ static inline bool netdev_uses_dsa_tags(struct net_device *dev) | |||
| 1009 | return 0; | 1035 | return 0; |
| 1010 | } | 1036 | } |
| 1011 | 1037 | ||
| 1038 | #ifndef CONFIG_NET_NS | ||
| 1039 | static inline void skb_set_dev(struct sk_buff *skb, struct net_device *dev) | ||
| 1040 | { | ||
| 1041 | skb->dev = dev; | ||
| 1042 | } | ||
| 1043 | #else /* CONFIG_NET_NS */ | ||
| 1044 | void skb_set_dev(struct sk_buff *skb, struct net_device *dev); | ||
| 1045 | #endif | ||
| 1046 | |||
| 1012 | static inline bool netdev_uses_trailer_tags(struct net_device *dev) | 1047 | static inline bool netdev_uses_trailer_tags(struct net_device *dev) |
| 1013 | { | 1048 | { |
| 1014 | #ifdef CONFIG_NET_DSA_TAG_TRAILER | 1049 | #ifdef CONFIG_NET_DSA_TAG_TRAILER |
| @@ -1527,7 +1562,6 @@ extern int netif_rx(struct sk_buff *skb); | |||
| 1527 | extern int netif_rx_ni(struct sk_buff *skb); | 1562 | extern int netif_rx_ni(struct sk_buff *skb); |
| 1528 | #define HAVE_NETIF_RECEIVE_SKB 1 | 1563 | #define HAVE_NETIF_RECEIVE_SKB 1 |
| 1529 | extern int netif_receive_skb(struct sk_buff *skb); | 1564 | extern int netif_receive_skb(struct sk_buff *skb); |
| 1530 | extern void napi_gro_flush(struct napi_struct *napi); | ||
| 1531 | extern gro_result_t dev_gro_receive(struct napi_struct *napi, | 1565 | extern gro_result_t dev_gro_receive(struct napi_struct *napi, |
| 1532 | struct sk_buff *skb); | 1566 | struct sk_buff *skb); |
| 1533 | extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb); | 1567 | extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb); |
| @@ -1553,7 +1587,9 @@ extern int dev_valid_name(const char *name); | |||
| 1553 | extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); | 1587 | extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); |
| 1554 | extern int dev_ethtool(struct net *net, struct ifreq *); | 1588 | extern int dev_ethtool(struct net *net, struct ifreq *); |
| 1555 | extern unsigned dev_get_flags(const struct net_device *); | 1589 | extern unsigned dev_get_flags(const struct net_device *); |
| 1590 | extern int __dev_change_flags(struct net_device *, unsigned int flags); | ||
| 1556 | extern int dev_change_flags(struct net_device *, unsigned); | 1591 | extern int dev_change_flags(struct net_device *, unsigned); |
| 1592 | extern void __dev_notify_flags(struct net_device *, unsigned int old_flags); | ||
| 1557 | extern int dev_change_name(struct net_device *, const char *); | 1593 | extern int dev_change_name(struct net_device *, const char *); |
| 1558 | extern int dev_set_alias(struct net_device *, const char *, size_t); | 1594 | extern int dev_set_alias(struct net_device *, const char *, size_t); |
| 1559 | extern int dev_change_net_namespace(struct net_device *, | 1595 | extern int dev_change_net_namespace(struct net_device *, |
| @@ -2083,6 +2119,130 @@ static inline u32 dev_ethtool_get_flags(struct net_device *dev) | |||
| 2083 | return 0; | 2119 | return 0; |
| 2084 | return dev->ethtool_ops->get_flags(dev); | 2120 | return dev->ethtool_ops->get_flags(dev); |
| 2085 | } | 2121 | } |
| 2122 | |||
| 2123 | /* Logging, debugging and troubleshooting/diagnostic helpers. */ | ||
| 2124 | |||
| 2125 | /* netdev_printk helpers, similar to dev_printk */ | ||
| 2126 | |||
| 2127 | static inline const char *netdev_name(const struct net_device *dev) | ||
| 2128 | { | ||
| 2129 | if (dev->reg_state != NETREG_REGISTERED) | ||
| 2130 | return "(unregistered net_device)"; | ||
| 2131 | return dev->name; | ||
| 2132 | } | ||
| 2133 | |||
| 2134 | #define netdev_printk(level, netdev, format, args...) \ | ||
| 2135 | dev_printk(level, (netdev)->dev.parent, \ | ||
| 2136 | "%s: " format, \ | ||
| 2137 | netdev_name(netdev), ##args) | ||
| 2138 | |||
| 2139 | #define netdev_emerg(dev, format, args...) \ | ||
| 2140 | netdev_printk(KERN_EMERG, dev, format, ##args) | ||
| 2141 | #define netdev_alert(dev, format, args...) \ | ||
| 2142 | netdev_printk(KERN_ALERT, dev, format, ##args) | ||
| 2143 | #define netdev_crit(dev, format, args...) \ | ||
| 2144 | netdev_printk(KERN_CRIT, dev, format, ##args) | ||
| 2145 | #define netdev_err(dev, format, args...) \ | ||
| 2146 | netdev_printk(KERN_ERR, dev, format, ##args) | ||
| 2147 | #define netdev_warn(dev, format, args...) \ | ||
| 2148 | netdev_printk(KERN_WARNING, dev, format, ##args) | ||
| 2149 | #define netdev_notice(dev, format, args...) \ | ||
| 2150 | netdev_printk(KERN_NOTICE, dev, format, ##args) | ||
| 2151 | #define netdev_info(dev, format, args...) \ | ||
| 2152 | netdev_printk(KERN_INFO, dev, format, ##args) | ||
| 2153 | |||
| 2154 | #if defined(DEBUG) | ||
| 2155 | #define netdev_dbg(__dev, format, args...) \ | ||
| 2156 | netdev_printk(KERN_DEBUG, __dev, format, ##args) | ||
| 2157 | #elif defined(CONFIG_DYNAMIC_DEBUG) | ||
| 2158 | #define netdev_dbg(__dev, format, args...) \ | ||
| 2159 | do { \ | ||
| 2160 | dynamic_dev_dbg((__dev)->dev.parent, "%s: " format, \ | ||
| 2161 | netdev_name(__dev), ##args); \ | ||
| 2162 | } while (0) | ||
| 2163 | #else | ||
| 2164 | #define netdev_dbg(__dev, format, args...) \ | ||
| 2165 | ({ \ | ||
| 2166 | if (0) \ | ||
| 2167 | netdev_printk(KERN_DEBUG, __dev, format, ##args); \ | ||
| 2168 | 0; \ | ||
| 2169 | }) | ||
| 2170 | #endif | ||
| 2171 | |||
| 2172 | #if defined(VERBOSE_DEBUG) | ||
| 2173 | #define netdev_vdbg netdev_dbg | ||
| 2174 | #else | ||
| 2175 | |||
| 2176 | #define netdev_vdbg(dev, format, args...) \ | ||
| 2177 | ({ \ | ||
| 2178 | if (0) \ | ||
| 2179 | netdev_printk(KERN_DEBUG, dev, format, ##args); \ | ||
| 2180 | 0; \ | ||
| 2181 | }) | ||
| 2182 | #endif | ||
| 2183 | |||
| 2184 | /* | ||
| 2185 | * netdev_WARN() acts like dev_printk(), but with the key difference | ||
| 2186 | * of using a WARN/WARN_ON to get the message out, including the | ||
| 2187 | * file/line information and a backtrace. | ||
| 2188 | */ | ||
| 2189 | #define netdev_WARN(dev, format, args...) \ | ||
| 2190 | WARN(1, "netdevice: %s\n" format, netdev_name(dev), ##args); | ||
| 2191 | |||
| 2192 | /* netif printk helpers, similar to netdev_printk */ | ||
| 2193 | |||
| 2194 | #define netif_printk(priv, type, level, dev, fmt, args...) \ | ||
| 2195 | do { \ | ||
| 2196 | if (netif_msg_##type(priv)) \ | ||
| 2197 | netdev_printk(level, (dev), fmt, ##args); \ | ||
| 2198 | } while (0) | ||
| 2199 | |||
| 2200 | #define netif_emerg(priv, type, dev, fmt, args...) \ | ||
| 2201 | netif_printk(priv, type, KERN_EMERG, dev, fmt, ##args) | ||
| 2202 | #define netif_alert(priv, type, dev, fmt, args...) \ | ||
| 2203 | netif_printk(priv, type, KERN_ALERT, dev, fmt, ##args) | ||
| 2204 | #define netif_crit(priv, type, dev, fmt, args...) \ | ||
| 2205 | netif_printk(priv, type, KERN_CRIT, dev, fmt, ##args) | ||
| 2206 | #define netif_err(priv, type, dev, fmt, args...) \ | ||
| 2207 | netif_printk(priv, type, KERN_ERR, dev, fmt, ##args) | ||
| 2208 | #define netif_warn(priv, type, dev, fmt, args...) \ | ||
| 2209 | netif_printk(priv, type, KERN_WARNING, dev, fmt, ##args) | ||
| 2210 | #define netif_notice(priv, type, dev, fmt, args...) \ | ||
| 2211 | netif_printk(priv, type, KERN_NOTICE, dev, fmt, ##args) | ||
| 2212 | #define netif_info(priv, type, dev, fmt, args...) \ | ||
| 2213 | netif_printk(priv, type, KERN_INFO, (dev), fmt, ##args) | ||
| 2214 | |||
| 2215 | #if defined(DEBUG) | ||
| 2216 | #define netif_dbg(priv, type, dev, format, args...) \ | ||
| 2217 | netif_printk(priv, type, KERN_DEBUG, dev, format, ##args) | ||
| 2218 | #elif defined(CONFIG_DYNAMIC_DEBUG) | ||
| 2219 | #define netif_dbg(priv, type, netdev, format, args...) \ | ||
| 2220 | do { \ | ||
| 2221 | if (netif_msg_##type(priv)) \ | ||
| 2222 | dynamic_dev_dbg((netdev)->dev.parent, \ | ||
| 2223 | "%s: " format, \ | ||
| 2224 | netdev_name(netdev), ##args); \ | ||
| 2225 | } while (0) | ||
| 2226 | #else | ||
| 2227 | #define netif_dbg(priv, type, dev, format, args...) \ | ||
| 2228 | ({ \ | ||
| 2229 | if (0) \ | ||
| 2230 | netif_printk(priv, type, KERN_DEBUG, dev, format, ##args); \ | ||
| 2231 | 0; \ | ||
| 2232 | }) | ||
| 2233 | #endif | ||
| 2234 | |||
| 2235 | #if defined(VERBOSE_DEBUG) | ||
| 2236 | #define netif_vdbg netdev_dbg | ||
| 2237 | #else | ||
| 2238 | #define netif_vdbg(priv, type, dev, format, args...) \ | ||
| 2239 | ({ \ | ||
| 2240 | if (0) \ | ||
| 2241 | netif_printk(KERN_DEBUG, dev, format, ##args); \ | ||
| 2242 | 0; \ | ||
| 2243 | }) | ||
| 2244 | #endif | ||
| 2245 | |||
| 2086 | #endif /* __KERNEL__ */ | 2246 | #endif /* __KERNEL__ */ |
| 2087 | 2247 | ||
| 2088 | #endif /* _LINUX_NETDEVICE_H */ | 2248 | #endif /* _LINUX_NETDEVICE_H */ |
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 48c54960773..89341c32631 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
| @@ -114,15 +114,17 @@ struct nf_sockopt_ops { | |||
| 114 | int set_optmin; | 114 | int set_optmin; |
| 115 | int set_optmax; | 115 | int set_optmax; |
| 116 | int (*set)(struct sock *sk, int optval, void __user *user, unsigned int len); | 116 | int (*set)(struct sock *sk, int optval, void __user *user, unsigned int len); |
| 117 | #ifdef CONFIG_COMPAT | ||
| 117 | int (*compat_set)(struct sock *sk, int optval, | 118 | int (*compat_set)(struct sock *sk, int optval, |
| 118 | void __user *user, unsigned int len); | 119 | void __user *user, unsigned int len); |
| 119 | 120 | #endif | |
| 120 | int get_optmin; | 121 | int get_optmin; |
| 121 | int get_optmax; | 122 | int get_optmax; |
| 122 | int (*get)(struct sock *sk, int optval, void __user *user, int *len); | 123 | int (*get)(struct sock *sk, int optval, void __user *user, int *len); |
| 124 | #ifdef CONFIG_COMPAT | ||
| 123 | int (*compat_get)(struct sock *sk, int optval, | 125 | int (*compat_get)(struct sock *sk, int optval, |
| 124 | void __user *user, int *len); | 126 | void __user *user, int *len); |
| 125 | 127 | #endif | |
| 126 | /* Use the module struct to lock set/get code in place */ | 128 | /* Use the module struct to lock set/get code in place */ |
| 127 | struct module *owner; | 129 | struct module *owner; |
| 128 | }; | 130 | }; |
| @@ -161,11 +163,8 @@ static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook, | |||
| 161 | struct sk_buff *skb, | 163 | struct sk_buff *skb, |
| 162 | struct net_device *indev, | 164 | struct net_device *indev, |
| 163 | struct net_device *outdev, | 165 | struct net_device *outdev, |
| 164 | int (*okfn)(struct sk_buff *), int thresh, | 166 | int (*okfn)(struct sk_buff *), int thresh) |
| 165 | int cond) | ||
| 166 | { | 167 | { |
| 167 | if (!cond) | ||
| 168 | return 1; | ||
| 169 | #ifndef CONFIG_NETFILTER_DEBUG | 168 | #ifndef CONFIG_NETFILTER_DEBUG |
| 170 | if (list_empty(&nf_hooks[pf][hook])) | 169 | if (list_empty(&nf_hooks[pf][hook])) |
| 171 | return 1; | 170 | return 1; |
| @@ -177,7 +176,7 @@ static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb, | |||
| 177 | struct net_device *indev, struct net_device *outdev, | 176 | struct net_device *indev, struct net_device *outdev, |
| 178 | int (*okfn)(struct sk_buff *)) | 177 | int (*okfn)(struct sk_buff *)) |
| 179 | { | 178 | { |
| 180 | return nf_hook_thresh(pf, hook, skb, indev, outdev, okfn, INT_MIN, 1); | 179 | return nf_hook_thresh(pf, hook, skb, indev, outdev, okfn, INT_MIN); |
| 181 | } | 180 | } |
| 182 | 181 | ||
| 183 | /* Activate hook; either okfn or kfree_skb called, unless a hook | 182 | /* Activate hook; either okfn or kfree_skb called, unless a hook |
| @@ -197,36 +196,49 @@ static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb, | |||
| 197 | coders :) | 196 | coders :) |
| 198 | */ | 197 | */ |
| 199 | 198 | ||
| 200 | /* This is gross, but inline doesn't cut it for avoiding the function | 199 | static inline int |
| 201 | call in fast path: gcc doesn't inline (needs value tracking?). --RR */ | 200 | NF_HOOK_THRESH(uint8_t pf, unsigned int hook, struct sk_buff *skb, |
| 202 | 201 | struct net_device *in, struct net_device *out, | |
| 203 | /* HX: It's slightly less gross now. */ | 202 | int (*okfn)(struct sk_buff *), int thresh) |
| 203 | { | ||
| 204 | int ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, thresh); | ||
| 205 | if (ret == 1) | ||
| 206 | ret = okfn(skb); | ||
| 207 | return ret; | ||
| 208 | } | ||
| 204 | 209 | ||
| 205 | #define NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, thresh) \ | 210 | static inline int |
| 206 | ({int __ret; \ | 211 | NF_HOOK_COND(uint8_t pf, unsigned int hook, struct sk_buff *skb, |
| 207 | if ((__ret=nf_hook_thresh(pf, hook, (skb), indev, outdev, okfn, thresh, 1)) == 1)\ | 212 | struct net_device *in, struct net_device *out, |
| 208 | __ret = (okfn)(skb); \ | 213 | int (*okfn)(struct sk_buff *), bool cond) |
| 209 | __ret;}) | 214 | { |
| 215 | int ret; | ||
| 210 | 216 | ||
| 211 | #define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) \ | 217 | if (!cond || |
| 212 | ({int __ret; \ | 218 | (ret = nf_hook_thresh(pf, hook, skb, in, out, okfn, INT_MIN) == 1)) |
| 213 | if ((__ret=nf_hook_thresh(pf, hook, (skb), indev, outdev, okfn, INT_MIN, cond)) == 1)\ | 219 | ret = okfn(skb); |
| 214 | __ret = (okfn)(skb); \ | 220 | return ret; |
| 215 | __ret;}) | 221 | } |
| 216 | 222 | ||
| 217 | #define NF_HOOK(pf, hook, skb, indev, outdev, okfn) \ | 223 | static inline int |
| 218 | NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, INT_MIN) | 224 | NF_HOOK(uint8_t pf, unsigned int hook, struct sk_buff *skb, |
| 225 | struct net_device *in, struct net_device *out, | ||
| 226 | int (*okfn)(struct sk_buff *)) | ||
| 227 | { | ||
| 228 | return NF_HOOK_THRESH(pf, hook, skb, in, out, okfn, INT_MIN); | ||
| 229 | } | ||
| 219 | 230 | ||
| 220 | /* Call setsockopt() */ | 231 | /* Call setsockopt() */ |
| 221 | int nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt, | 232 | int nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt, |
| 222 | unsigned int len); | 233 | unsigned int len); |
| 223 | int nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt, | 234 | int nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt, |
| 224 | int *len); | 235 | int *len); |
| 225 | 236 | #ifdef CONFIG_COMPAT | |
| 226 | int compat_nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, | 237 | int compat_nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, |
| 227 | char __user *opt, unsigned int len); | 238 | char __user *opt, unsigned int len); |
| 228 | int compat_nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, | 239 | int compat_nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, |
| 229 | char __user *opt, int *len); | 240 | char __user *opt, int *len); |
| 241 | #endif | ||
| 230 | 242 | ||
| 231 | /* Call this before modifying an existing packet: ensures it is | 243 | /* Call this before modifying an existing packet: ensures it is |
| 232 | modifiable and linear to the point you care about (writable_len). | 244 | modifiable and linear to the point you care about (writable_len). |
| @@ -325,8 +337,7 @@ static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook, | |||
| 325 | struct sk_buff *skb, | 337 | struct sk_buff *skb, |
| 326 | struct net_device *indev, | 338 | struct net_device *indev, |
| 327 | struct net_device *outdev, | 339 | struct net_device *outdev, |
| 328 | int (*okfn)(struct sk_buff *), int thresh, | 340 | int (*okfn)(struct sk_buff *), int thresh) |
| 329 | int cond) | ||
| 330 | { | 341 | { |
| 331 | return okfn(skb); | 342 | return okfn(skb); |
| 332 | } | 343 | } |
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild index 2aea50399c0..a5a63e41b8a 100644 --- a/include/linux/netfilter/Kbuild +++ b/include/linux/netfilter/Kbuild | |||
| @@ -6,6 +6,7 @@ header-y += nfnetlink_queue.h | |||
| 6 | header-y += xt_CLASSIFY.h | 6 | header-y += xt_CLASSIFY.h |
| 7 | header-y += xt_CONNMARK.h | 7 | header-y += xt_CONNMARK.h |
| 8 | header-y += xt_CONNSECMARK.h | 8 | header-y += xt_CONNSECMARK.h |
| 9 | header-y += xt_CT.h | ||
| 9 | header-y += xt_DSCP.h | 10 | header-y += xt_DSCP.h |
| 10 | header-y += xt_LED.h | 11 | header-y += xt_LED.h |
| 11 | header-y += xt_MARK.h | 12 | header-y += xt_MARK.h |
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h index a374787ed9b..c608677dda6 100644 --- a/include/linux/netfilter/nf_conntrack_common.h +++ b/include/linux/netfilter/nf_conntrack_common.h | |||
| @@ -72,6 +72,28 @@ enum ip_conntrack_status { | |||
| 72 | /* Connection has fixed timeout. */ | 72 | /* Connection has fixed timeout. */ |
| 73 | IPS_FIXED_TIMEOUT_BIT = 10, | 73 | IPS_FIXED_TIMEOUT_BIT = 10, |
| 74 | IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT), | 74 | IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT), |
| 75 | |||
| 76 | /* Conntrack is a template */ | ||
| 77 | IPS_TEMPLATE_BIT = 11, | ||
| 78 | IPS_TEMPLATE = (1 << IPS_TEMPLATE_BIT), | ||
| 79 | }; | ||
| 80 | |||
| 81 | /* Connection tracking event types */ | ||
| 82 | enum ip_conntrack_events { | ||
| 83 | IPCT_NEW, /* new conntrack */ | ||
| 84 | IPCT_RELATED, /* related conntrack */ | ||
| 85 | IPCT_DESTROY, /* destroyed conntrack */ | ||
| 86 | IPCT_REPLY, /* connection has seen two-way traffic */ | ||
| 87 | IPCT_ASSURED, /* connection status has changed to assured */ | ||
| 88 | IPCT_PROTOINFO, /* protocol information has changed */ | ||
| 89 | IPCT_HELPER, /* new helper has been set */ | ||
| 90 | IPCT_MARK, /* new mark has been set */ | ||
| 91 | IPCT_NATSEQADJ, /* NAT is doing sequence adjustment */ | ||
| 92 | IPCT_SECMARK, /* new security mark has been set */ | ||
| 93 | }; | ||
| 94 | |||
| 95 | enum ip_conntrack_expect_events { | ||
| 96 | IPEXP_NEW, /* new expectation */ | ||
| 75 | }; | 97 | }; |
| 76 | 98 | ||
| 77 | #ifdef __KERNEL__ | 99 | #ifdef __KERNEL__ |
diff --git a/include/linux/netfilter/nf_conntrack_sip.h b/include/linux/netfilter/nf_conntrack_sip.h index 23aa2ec6b7b..ff8cfbcf3b8 100644 --- a/include/linux/netfilter/nf_conntrack_sip.h +++ b/include/linux/netfilter/nf_conntrack_sip.h | |||
| @@ -14,6 +14,7 @@ enum sip_expectation_classes { | |||
| 14 | SIP_EXPECT_SIGNALLING, | 14 | SIP_EXPECT_SIGNALLING, |
| 15 | SIP_EXPECT_AUDIO, | 15 | SIP_EXPECT_AUDIO, |
| 16 | SIP_EXPECT_VIDEO, | 16 | SIP_EXPECT_VIDEO, |
| 17 | SIP_EXPECT_IMAGE, | ||
| 17 | __SIP_EXPECT_MAX | 18 | __SIP_EXPECT_MAX |
| 18 | }; | 19 | }; |
| 19 | #define SIP_EXPECT_MAX (__SIP_EXPECT_MAX - 1) | 20 | #define SIP_EXPECT_MAX (__SIP_EXPECT_MAX - 1) |
| @@ -34,10 +35,10 @@ struct sdp_media_type { | |||
| 34 | struct sip_handler { | 35 | struct sip_handler { |
| 35 | const char *method; | 36 | const char *method; |
| 36 | unsigned int len; | 37 | unsigned int len; |
| 37 | int (*request)(struct sk_buff *skb, | 38 | int (*request)(struct sk_buff *skb, unsigned int dataoff, |
| 38 | const char **dptr, unsigned int *datalen, | 39 | const char **dptr, unsigned int *datalen, |
| 39 | unsigned int cseq); | 40 | unsigned int cseq); |
| 40 | int (*response)(struct sk_buff *skb, | 41 | int (*response)(struct sk_buff *skb, unsigned int dataoff, |
| 41 | const char **dptr, unsigned int *datalen, | 42 | const char **dptr, unsigned int *datalen, |
| 42 | unsigned int cseq, unsigned int code); | 43 | unsigned int cseq, unsigned int code); |
| 43 | }; | 44 | }; |
| @@ -84,7 +85,8 @@ enum sip_header_types { | |||
| 84 | SIP_HDR_FROM, | 85 | SIP_HDR_FROM, |
| 85 | SIP_HDR_TO, | 86 | SIP_HDR_TO, |
| 86 | SIP_HDR_CONTACT, | 87 | SIP_HDR_CONTACT, |
| 87 | SIP_HDR_VIA, | 88 | SIP_HDR_VIA_UDP, |
| 89 | SIP_HDR_VIA_TCP, | ||
| 88 | SIP_HDR_EXPIRES, | 90 | SIP_HDR_EXPIRES, |
| 89 | SIP_HDR_CONTENT_LENGTH, | 91 | SIP_HDR_CONTENT_LENGTH, |
| 90 | }; | 92 | }; |
| @@ -100,33 +102,40 @@ enum sdp_header_types { | |||
| 100 | }; | 102 | }; |
| 101 | 103 | ||
| 102 | extern unsigned int (*nf_nat_sip_hook)(struct sk_buff *skb, | 104 | extern unsigned int (*nf_nat_sip_hook)(struct sk_buff *skb, |
| 105 | unsigned int dataoff, | ||
| 103 | const char **dptr, | 106 | const char **dptr, |
| 104 | unsigned int *datalen); | 107 | unsigned int *datalen); |
| 108 | extern void (*nf_nat_sip_seq_adjust_hook)(struct sk_buff *skb, s16 off); | ||
| 105 | extern unsigned int (*nf_nat_sip_expect_hook)(struct sk_buff *skb, | 109 | extern unsigned int (*nf_nat_sip_expect_hook)(struct sk_buff *skb, |
| 110 | unsigned int dataoff, | ||
| 106 | const char **dptr, | 111 | const char **dptr, |
| 107 | unsigned int *datalen, | 112 | unsigned int *datalen, |
| 108 | struct nf_conntrack_expect *exp, | 113 | struct nf_conntrack_expect *exp, |
| 109 | unsigned int matchoff, | 114 | unsigned int matchoff, |
| 110 | unsigned int matchlen); | 115 | unsigned int matchlen); |
| 111 | extern unsigned int (*nf_nat_sdp_addr_hook)(struct sk_buff *skb, | 116 | extern unsigned int (*nf_nat_sdp_addr_hook)(struct sk_buff *skb, |
| 112 | const char **dptr, | ||
| 113 | unsigned int dataoff, | 117 | unsigned int dataoff, |
| 118 | const char **dptr, | ||
| 114 | unsigned int *datalen, | 119 | unsigned int *datalen, |
| 120 | unsigned int sdpoff, | ||
| 115 | enum sdp_header_types type, | 121 | enum sdp_header_types type, |
| 116 | enum sdp_header_types term, | 122 | enum sdp_header_types term, |
| 117 | const union nf_inet_addr *addr); | 123 | const union nf_inet_addr *addr); |
| 118 | extern unsigned int (*nf_nat_sdp_port_hook)(struct sk_buff *skb, | 124 | extern unsigned int (*nf_nat_sdp_port_hook)(struct sk_buff *skb, |
| 125 | unsigned int dataoff, | ||
| 119 | const char **dptr, | 126 | const char **dptr, |
| 120 | unsigned int *datalen, | 127 | unsigned int *datalen, |
| 121 | unsigned int matchoff, | 128 | unsigned int matchoff, |
| 122 | unsigned int matchlen, | 129 | unsigned int matchlen, |
| 123 | u_int16_t port); | 130 | u_int16_t port); |
| 124 | extern unsigned int (*nf_nat_sdp_session_hook)(struct sk_buff *skb, | 131 | extern unsigned int (*nf_nat_sdp_session_hook)(struct sk_buff *skb, |
| 125 | const char **dptr, | ||
| 126 | unsigned int dataoff, | 132 | unsigned int dataoff, |
| 133 | const char **dptr, | ||
| 127 | unsigned int *datalen, | 134 | unsigned int *datalen, |
| 135 | unsigned int sdpoff, | ||
| 128 | const union nf_inet_addr *addr); | 136 | const union nf_inet_addr *addr); |
| 129 | extern unsigned int (*nf_nat_sdp_media_hook)(struct sk_buff *skb, | 137 | extern unsigned int (*nf_nat_sdp_media_hook)(struct sk_buff *skb, |
| 138 | unsigned int dataoff, | ||
| 130 | const char **dptr, | 139 | const char **dptr, |
| 131 | unsigned int *datalen, | 140 | unsigned int *datalen, |
| 132 | struct nf_conntrack_expect *rtp_exp, | 141 | struct nf_conntrack_expect *rtp_exp, |
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index 49d321f3ccd..53923868c9b 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
| @@ -73,11 +73,11 @@ struct nfnetlink_subsystem { | |||
| 73 | extern int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n); | 73 | extern int nfnetlink_subsys_register(const struct nfnetlink_subsystem *n); |
| 74 | extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n); | 74 | extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n); |
| 75 | 75 | ||
| 76 | extern int nfnetlink_has_listeners(unsigned int group); | 76 | extern int nfnetlink_has_listeners(struct net *net, unsigned int group); |
| 77 | extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, | 77 | extern int nfnetlink_send(struct sk_buff *skb, struct net *net, u32 pid, unsigned group, |
| 78 | int echo, gfp_t flags); | 78 | int echo, gfp_t flags); |
| 79 | extern void nfnetlink_set_err(u32 pid, u32 group, int error); | 79 | extern void nfnetlink_set_err(struct net *net, u32 pid, u32 group, int error); |
| 80 | extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags); | 80 | extern int nfnetlink_unicast(struct sk_buff *skb, struct net *net, u_int32_t pid, int flags); |
| 81 | 81 | ||
| 82 | extern void nfnl_lock(void); | 82 | extern void nfnl_lock(void); |
| 83 | extern void nfnl_unlock(void); | 83 | extern void nfnl_unlock(void); |
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h index ed4ef8d0b11..9ed534c991b 100644 --- a/include/linux/netfilter/nfnetlink_conntrack.h +++ b/include/linux/netfilter/nfnetlink_conntrack.h | |||
| @@ -40,6 +40,7 @@ enum ctattr_type { | |||
| 40 | CTA_NAT_SEQ_ADJ_ORIG, | 40 | CTA_NAT_SEQ_ADJ_ORIG, |
| 41 | CTA_NAT_SEQ_ADJ_REPLY, | 41 | CTA_NAT_SEQ_ADJ_REPLY, |
| 42 | CTA_SECMARK, | 42 | CTA_SECMARK, |
| 43 | CTA_ZONE, | ||
| 43 | __CTA_MAX | 44 | __CTA_MAX |
| 44 | }; | 45 | }; |
| 45 | #define CTA_MAX (__CTA_MAX - 1) | 46 | #define CTA_MAX (__CTA_MAX - 1) |
| @@ -159,6 +160,7 @@ enum ctattr_expect { | |||
| 159 | CTA_EXPECT_TIMEOUT, | 160 | CTA_EXPECT_TIMEOUT, |
| 160 | CTA_EXPECT_ID, | 161 | CTA_EXPECT_ID, |
| 161 | CTA_EXPECT_HELP_NAME, | 162 | CTA_EXPECT_HELP_NAME, |
| 163 | CTA_EXPECT_ZONE, | ||
| 162 | __CTA_EXPECT_MAX | 164 | __CTA_EXPECT_MAX |
| 163 | }; | 165 | }; |
| 164 | #define CTA_EXPECT_MAX (__CTA_EXPECT_MAX - 1) | 166 | #define CTA_EXPECT_MAX (__CTA_EXPECT_MAX - 1) |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 378f27ae777..84c7c928e9e 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
| @@ -93,8 +93,7 @@ struct _xt_align { | |||
| 93 | __u64 u64; | 93 | __u64 u64; |
| 94 | }; | 94 | }; |
| 95 | 95 | ||
| 96 | #define XT_ALIGN(s) (((s) + (__alignof__(struct _xt_align)-1)) \ | 96 | #define XT_ALIGN(s) ALIGN((s), __alignof__(struct _xt_align)) |
| 97 | & ~(__alignof__(struct _xt_align)-1)) | ||
| 98 | 97 | ||
| 99 | /* Standard return verdict, or do jump. */ | 98 | /* Standard return verdict, or do jump. */ |
| 100 | #define XT_STANDARD_TARGET "" | 99 | #define XT_STANDARD_TARGET "" |
| @@ -121,6 +120,7 @@ struct xt_counters_info { | |||
| 121 | 120 | ||
| 122 | #define XT_INV_PROTO 0x40 /* Invert the sense of PROTO. */ | 121 | #define XT_INV_PROTO 0x40 /* Invert the sense of PROTO. */ |
| 123 | 122 | ||
| 123 | #ifndef __KERNEL__ | ||
| 124 | /* fn returns 0 to continue iteration */ | 124 | /* fn returns 0 to continue iteration */ |
| 125 | #define XT_MATCH_ITERATE(type, e, fn, args...) \ | 125 | #define XT_MATCH_ITERATE(type, e, fn, args...) \ |
| 126 | ({ \ | 126 | ({ \ |
| @@ -164,6 +164,22 @@ struct xt_counters_info { | |||
| 164 | #define XT_ENTRY_ITERATE(type, entries, size, fn, args...) \ | 164 | #define XT_ENTRY_ITERATE(type, entries, size, fn, args...) \ |
| 165 | XT_ENTRY_ITERATE_CONTINUE(type, entries, size, 0, fn, args) | 165 | XT_ENTRY_ITERATE_CONTINUE(type, entries, size, 0, fn, args) |
| 166 | 166 | ||
| 167 | #endif /* !__KERNEL__ */ | ||
| 168 | |||
| 169 | /* pos is normally a struct ipt_entry/ip6t_entry/etc. */ | ||
| 170 | #define xt_entry_foreach(pos, ehead, esize) \ | ||
| 171 | for ((pos) = (typeof(pos))(ehead); \ | ||
| 172 | (pos) < (typeof(pos))((char *)(ehead) + (esize)); \ | ||
| 173 | (pos) = (typeof(pos))((char *)(pos) + (pos)->next_offset)) | ||
| 174 | |||
| 175 | /* can only be xt_entry_match, so no use of typeof here */ | ||
| 176 | #define xt_ematch_foreach(pos, entry) \ | ||
| 177 | for ((pos) = (struct xt_entry_match *)entry->elems; \ | ||
| 178 | (pos) < (struct xt_entry_match *)((char *)(entry) + \ | ||
| 179 | (entry)->target_offset); \ | ||
| 180 | (pos) = (struct xt_entry_match *)((char *)(pos) + \ | ||
| 181 | (pos)->u.match_size)) | ||
| 182 | |||
| 167 | #ifdef __KERNEL__ | 183 | #ifdef __KERNEL__ |
| 168 | 184 | ||
| 169 | #include <linux/netdevice.h> | 185 | #include <linux/netdevice.h> |
| @@ -205,6 +221,7 @@ struct xt_match_param { | |||
| 205 | * @hook_mask: via which hooks the new rule is reachable | 221 | * @hook_mask: via which hooks the new rule is reachable |
| 206 | */ | 222 | */ |
| 207 | struct xt_mtchk_param { | 223 | struct xt_mtchk_param { |
| 224 | struct net *net; | ||
| 208 | const char *table; | 225 | const char *table; |
| 209 | const void *entryinfo; | 226 | const void *entryinfo; |
| 210 | const struct xt_match *match; | 227 | const struct xt_match *match; |
| @@ -215,6 +232,7 @@ struct xt_mtchk_param { | |||
| 215 | 232 | ||
| 216 | /* Match destructor parameters */ | 233 | /* Match destructor parameters */ |
| 217 | struct xt_mtdtor_param { | 234 | struct xt_mtdtor_param { |
| 235 | struct net *net; | ||
| 218 | const struct xt_match *match; | 236 | const struct xt_match *match; |
| 219 | void *matchinfo; | 237 | void *matchinfo; |
| 220 | u_int8_t family; | 238 | u_int8_t family; |
| @@ -247,6 +265,7 @@ struct xt_target_param { | |||
| 247 | * Other fields see above. | 265 | * Other fields see above. |
| 248 | */ | 266 | */ |
| 249 | struct xt_tgchk_param { | 267 | struct xt_tgchk_param { |
| 268 | struct net *net; | ||
| 250 | const char *table; | 269 | const char *table; |
| 251 | const void *entryinfo; | 270 | const void *entryinfo; |
| 252 | const struct xt_target *target; | 271 | const struct xt_target *target; |
| @@ -257,6 +276,7 @@ struct xt_tgchk_param { | |||
| 257 | 276 | ||
| 258 | /* Target destructor parameters */ | 277 | /* Target destructor parameters */ |
| 259 | struct xt_tgdtor_param { | 278 | struct xt_tgdtor_param { |
| 279 | struct net *net; | ||
| 260 | const struct xt_target *target; | 280 | const struct xt_target *target; |
| 261 | void *targinfo; | 281 | void *targinfo; |
| 262 | u_int8_t family; | 282 | u_int8_t family; |
| @@ -281,11 +301,11 @@ struct xt_match { | |||
| 281 | 301 | ||
| 282 | /* Called when entry of this type deleted. */ | 302 | /* Called when entry of this type deleted. */ |
| 283 | void (*destroy)(const struct xt_mtdtor_param *); | 303 | void (*destroy)(const struct xt_mtdtor_param *); |
| 284 | 304 | #ifdef CONFIG_COMPAT | |
| 285 | /* Called when userspace align differs from kernel space one */ | 305 | /* Called when userspace align differs from kernel space one */ |
| 286 | void (*compat_from_user)(void *dst, void *src); | 306 | void (*compat_from_user)(void *dst, const void *src); |
| 287 | int (*compat_to_user)(void __user *dst, void *src); | 307 | int (*compat_to_user)(void __user *dst, const void *src); |
| 288 | 308 | #endif | |
| 289 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ | 309 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ |
| 290 | struct module *me; | 310 | struct module *me; |
| 291 | 311 | ||
| @@ -294,7 +314,9 @@ struct xt_match { | |||
| 294 | 314 | ||
| 295 | const char *table; | 315 | const char *table; |
| 296 | unsigned int matchsize; | 316 | unsigned int matchsize; |
| 317 | #ifdef CONFIG_COMPAT | ||
| 297 | unsigned int compatsize; | 318 | unsigned int compatsize; |
| 319 | #endif | ||
| 298 | unsigned int hooks; | 320 | unsigned int hooks; |
| 299 | unsigned short proto; | 321 | unsigned short proto; |
| 300 | 322 | ||
| @@ -321,17 +343,19 @@ struct xt_target { | |||
| 321 | 343 | ||
| 322 | /* Called when entry of this type deleted. */ | 344 | /* Called when entry of this type deleted. */ |
| 323 | void (*destroy)(const struct xt_tgdtor_param *); | 345 | void (*destroy)(const struct xt_tgdtor_param *); |
| 324 | 346 | #ifdef CONFIG_COMPAT | |
| 325 | /* Called when userspace align differs from kernel space one */ | 347 | /* Called when userspace align differs from kernel space one */ |
| 326 | void (*compat_from_user)(void *dst, void *src); | 348 | void (*compat_from_user)(void *dst, const void *src); |
| 327 | int (*compat_to_user)(void __user *dst, void *src); | 349 | int (*compat_to_user)(void __user *dst, const void *src); |
| 328 | 350 | #endif | |
| 329 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ | 351 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ |
| 330 | struct module *me; | 352 | struct module *me; |
| 331 | 353 | ||
| 332 | const char *table; | 354 | const char *table; |
| 333 | unsigned int targetsize; | 355 | unsigned int targetsize; |
| 356 | #ifdef CONFIG_COMPAT | ||
| 334 | unsigned int compatsize; | 357 | unsigned int compatsize; |
| 358 | #endif | ||
| 335 | unsigned int hooks; | 359 | unsigned int hooks; |
| 336 | unsigned short proto; | 360 | unsigned short proto; |
| 337 | 361 | ||
| @@ -353,6 +377,7 @@ struct xt_table { | |||
| 353 | struct module *me; | 377 | struct module *me; |
| 354 | 378 | ||
| 355 | u_int8_t af; /* address/protocol family */ | 379 | u_int8_t af; /* address/protocol family */ |
| 380 | int priority; /* hook order */ | ||
| 356 | 381 | ||
| 357 | /* A unique name... */ | 382 | /* A unique name... */ |
| 358 | const char name[XT_TABLE_MAXNAMELEN]; | 383 | const char name[XT_TABLE_MAXNAMELEN]; |
| @@ -514,6 +539,9 @@ static inline unsigned long ifname_compare_aligned(const char *_a, | |||
| 514 | return ret; | 539 | return ret; |
| 515 | } | 540 | } |
| 516 | 541 | ||
| 542 | extern struct nf_hook_ops *xt_hook_link(const struct xt_table *, nf_hookfn *); | ||
| 543 | extern void xt_hook_unlink(const struct xt_table *, struct nf_hook_ops *); | ||
| 544 | |||
| 517 | #ifdef CONFIG_COMPAT | 545 | #ifdef CONFIG_COMPAT |
| 518 | #include <net/compat.h> | 546 | #include <net/compat.h> |
| 519 | 547 | ||
| @@ -554,11 +582,7 @@ struct compat_xt_entry_target { | |||
| 554 | * current task alignment */ | 582 | * current task alignment */ |
| 555 | 583 | ||
| 556 | struct compat_xt_counters { | 584 | struct compat_xt_counters { |
| 557 | #if defined(CONFIG_X86_64) || defined(CONFIG_IA64) | 585 | compat_u64 pcnt, bcnt; /* Packet and byte counters */ |
| 558 | u_int32_t cnt[4]; | ||
| 559 | #else | ||
| 560 | u_int64_t cnt[2]; | ||
| 561 | #endif | ||
| 562 | }; | 586 | }; |
| 563 | 587 | ||
| 564 | struct compat_xt_counters_info { | 588 | struct compat_xt_counters_info { |
| @@ -567,26 +591,32 @@ struct compat_xt_counters_info { | |||
| 567 | struct compat_xt_counters counters[0]; | 591 | struct compat_xt_counters counters[0]; |
| 568 | }; | 592 | }; |
| 569 | 593 | ||
| 570 | #define COMPAT_XT_ALIGN(s) (((s) + (__alignof__(struct compat_xt_counters)-1)) \ | 594 | struct _compat_xt_align { |
| 571 | & ~(__alignof__(struct compat_xt_counters)-1)) | 595 | __u8 u8; |
| 596 | __u16 u16; | ||
| 597 | __u32 u32; | ||
| 598 | compat_u64 u64; | ||
| 599 | }; | ||
| 600 | |||
| 601 | #define COMPAT_XT_ALIGN(s) ALIGN((s), __alignof__(struct _compat_xt_align)) | ||
| 572 | 602 | ||
| 573 | extern void xt_compat_lock(u_int8_t af); | 603 | extern void xt_compat_lock(u_int8_t af); |
| 574 | extern void xt_compat_unlock(u_int8_t af); | 604 | extern void xt_compat_unlock(u_int8_t af); |
| 575 | 605 | ||
| 576 | extern int xt_compat_add_offset(u_int8_t af, unsigned int offset, short delta); | 606 | extern int xt_compat_add_offset(u_int8_t af, unsigned int offset, short delta); |
| 577 | extern void xt_compat_flush_offsets(u_int8_t af); | 607 | extern void xt_compat_flush_offsets(u_int8_t af); |
| 578 | extern short xt_compat_calc_jump(u_int8_t af, unsigned int offset); | 608 | extern int xt_compat_calc_jump(u_int8_t af, unsigned int offset); |
| 579 | 609 | ||
| 580 | extern int xt_compat_match_offset(const struct xt_match *match); | 610 | extern int xt_compat_match_offset(const struct xt_match *match); |
| 581 | extern int xt_compat_match_from_user(struct xt_entry_match *m, | 611 | extern int xt_compat_match_from_user(struct xt_entry_match *m, |
| 582 | void **dstptr, unsigned int *size); | 612 | void **dstptr, unsigned int *size); |
| 583 | extern int xt_compat_match_to_user(struct xt_entry_match *m, | 613 | extern int xt_compat_match_to_user(const struct xt_entry_match *m, |
| 584 | void __user **dstptr, unsigned int *size); | 614 | void __user **dstptr, unsigned int *size); |
| 585 | 615 | ||
| 586 | extern int xt_compat_target_offset(const struct xt_target *target); | 616 | extern int xt_compat_target_offset(const struct xt_target *target); |
| 587 | extern void xt_compat_target_from_user(struct xt_entry_target *t, | 617 | extern void xt_compat_target_from_user(struct xt_entry_target *t, |
| 588 | void **dstptr, unsigned int *size); | 618 | void **dstptr, unsigned int *size); |
| 589 | extern int xt_compat_target_to_user(struct xt_entry_target *t, | 619 | extern int xt_compat_target_to_user(const struct xt_entry_target *t, |
| 590 | void __user **dstptr, unsigned int *size); | 620 | void __user **dstptr, unsigned int *size); |
| 591 | 621 | ||
| 592 | #endif /* CONFIG_COMPAT */ | 622 | #endif /* CONFIG_COMPAT */ |
diff --git a/include/linux/netfilter/xt_CT.h b/include/linux/netfilter/xt_CT.h new file mode 100644 index 00000000000..1b564106891 --- /dev/null +++ b/include/linux/netfilter/xt_CT.h | |||
| @@ -0,0 +1,17 @@ | |||
| 1 | #ifndef _XT_CT_H | ||
| 2 | #define _XT_CT_H | ||
| 3 | |||
| 4 | #define XT_CT_NOTRACK 0x1 | ||
| 5 | |||
| 6 | struct xt_ct_target_info { | ||
| 7 | u_int16_t flags; | ||
| 8 | u_int16_t zone; | ||
| 9 | u_int32_t ct_events; | ||
| 10 | u_int32_t exp_events; | ||
| 11 | char helper[16]; | ||
| 12 | |||
| 13 | /* Used internally by the kernel */ | ||
| 14 | struct nf_conn *ct __attribute__((aligned(8))); | ||
| 15 | }; | ||
| 16 | |||
| 17 | #endif /* _XT_CT_H */ | ||
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h index f2336523a9d..e9948c0560f 100644 --- a/include/linux/netfilter_arp/arp_tables.h +++ b/include/linux/netfilter_arp/arp_tables.h | |||
| @@ -211,9 +211,11 @@ static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e | |||
| 211 | return (void *)e + e->target_offset; | 211 | return (void *)e + e->target_offset; |
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | #ifndef __KERNEL__ | ||
| 214 | /* fn returns 0 to continue iteration */ | 215 | /* fn returns 0 to continue iteration */ |
| 215 | #define ARPT_ENTRY_ITERATE(entries, size, fn, args...) \ | 216 | #define ARPT_ENTRY_ITERATE(entries, size, fn, args...) \ |
| 216 | XT_ENTRY_ITERATE(struct arpt_entry, entries, size, fn, ## args) | 217 | XT_ENTRY_ITERATE(struct arpt_entry, entries, size, fn, ## args) |
| 218 | #endif | ||
| 217 | 219 | ||
| 218 | /* | 220 | /* |
| 219 | * Main firewall chains definitions and global var's definitions. | 221 | * Main firewall chains definitions and global var's definitions. |
| @@ -258,6 +260,7 @@ struct arpt_error { | |||
| 258 | .target.errorname = "ERROR", \ | 260 | .target.errorname = "ERROR", \ |
| 259 | } | 261 | } |
| 260 | 262 | ||
| 263 | extern void *arpt_alloc_initial_table(const struct xt_table *); | ||
| 261 | extern struct xt_table *arpt_register_table(struct net *net, | 264 | extern struct xt_table *arpt_register_table(struct net *net, |
| 262 | const struct xt_table *table, | 265 | const struct xt_table *table, |
| 263 | const struct arpt_replace *repl); | 266 | const struct arpt_replace *repl); |
| @@ -290,14 +293,6 @@ compat_arpt_get_target(struct compat_arpt_entry *e) | |||
| 290 | 293 | ||
| 291 | #define COMPAT_ARPT_ALIGN(s) COMPAT_XT_ALIGN(s) | 294 | #define COMPAT_ARPT_ALIGN(s) COMPAT_XT_ALIGN(s) |
| 292 | 295 | ||
| 293 | /* fn returns 0 to continue iteration */ | ||
| 294 | #define COMPAT_ARPT_ENTRY_ITERATE(entries, size, fn, args...) \ | ||
| 295 | XT_ENTRY_ITERATE(struct compat_arpt_entry, entries, size, fn, ## args) | ||
| 296 | |||
| 297 | #define COMPAT_ARPT_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \ | ||
| 298 | XT_ENTRY_ITERATE_CONTINUE(struct compat_arpt_entry, entries, size, n, \ | ||
| 299 | fn, ## args) | ||
| 300 | |||
| 301 | #endif /* CONFIG_COMPAT */ | 296 | #endif /* CONFIG_COMPAT */ |
| 302 | #endif /*__KERNEL__*/ | 297 | #endif /*__KERNEL__*/ |
| 303 | #endif /* _ARPTABLES_H */ | 298 | #endif /* _ARPTABLES_H */ |
diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h index 3cc40c131cc..1c6f0c5f530 100644 --- a/include/linux/netfilter_bridge/ebtables.h +++ b/include/linux/netfilter_bridge/ebtables.h | |||
| @@ -289,7 +289,7 @@ struct ebt_table { | |||
| 289 | ~(__alignof__(struct ebt_replace)-1)) | 289 | ~(__alignof__(struct ebt_replace)-1)) |
| 290 | extern struct ebt_table *ebt_register_table(struct net *net, | 290 | extern struct ebt_table *ebt_register_table(struct net *net, |
| 291 | const struct ebt_table *table); | 291 | const struct ebt_table *table); |
| 292 | extern void ebt_unregister_table(struct ebt_table *table); | 292 | extern void ebt_unregister_table(struct net *net, struct ebt_table *table); |
| 293 | extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb, | 293 | extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb, |
| 294 | const struct net_device *in, const struct net_device *out, | 294 | const struct net_device *in, const struct net_device *out, |
| 295 | struct ebt_table *table); | 295 | struct ebt_table *table); |
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index 27b3f580730..704a7b6e816 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h | |||
| @@ -223,6 +223,7 @@ ipt_get_target(struct ipt_entry *e) | |||
| 223 | return (void *)e + e->target_offset; | 223 | return (void *)e + e->target_offset; |
| 224 | } | 224 | } |
| 225 | 225 | ||
| 226 | #ifndef __KERNEL__ | ||
| 226 | /* fn returns 0 to continue iteration */ | 227 | /* fn returns 0 to continue iteration */ |
| 227 | #define IPT_MATCH_ITERATE(e, fn, args...) \ | 228 | #define IPT_MATCH_ITERATE(e, fn, args...) \ |
| 228 | XT_MATCH_ITERATE(struct ipt_entry, e, fn, ## args) | 229 | XT_MATCH_ITERATE(struct ipt_entry, e, fn, ## args) |
| @@ -230,6 +231,7 @@ ipt_get_target(struct ipt_entry *e) | |||
| 230 | /* fn returns 0 to continue iteration */ | 231 | /* fn returns 0 to continue iteration */ |
| 231 | #define IPT_ENTRY_ITERATE(entries, size, fn, args...) \ | 232 | #define IPT_ENTRY_ITERATE(entries, size, fn, args...) \ |
| 232 | XT_ENTRY_ITERATE(struct ipt_entry, entries, size, fn, ## args) | 233 | XT_ENTRY_ITERATE(struct ipt_entry, entries, size, fn, ## args) |
| 234 | #endif | ||
| 233 | 235 | ||
| 234 | /* | 236 | /* |
| 235 | * Main firewall chains definitions and global var's definitions. | 237 | * Main firewall chains definitions and global var's definitions. |
| @@ -242,7 +244,7 @@ extern void ipt_init(void) __init; | |||
| 242 | extern struct xt_table *ipt_register_table(struct net *net, | 244 | extern struct xt_table *ipt_register_table(struct net *net, |
| 243 | const struct xt_table *table, | 245 | const struct xt_table *table, |
| 244 | const struct ipt_replace *repl); | 246 | const struct ipt_replace *repl); |
| 245 | extern void ipt_unregister_table(struct xt_table *table); | 247 | extern void ipt_unregister_table(struct net *net, struct xt_table *table); |
| 246 | 248 | ||
| 247 | /* Standard entry. */ | 249 | /* Standard entry. */ |
| 248 | struct ipt_standard { | 250 | struct ipt_standard { |
| @@ -282,6 +284,7 @@ struct ipt_error { | |||
| 282 | .target.errorname = "ERROR", \ | 284 | .target.errorname = "ERROR", \ |
| 283 | } | 285 | } |
| 284 | 286 | ||
| 287 | extern void *ipt_alloc_initial_table(const struct xt_table *); | ||
| 285 | extern unsigned int ipt_do_table(struct sk_buff *skb, | 288 | extern unsigned int ipt_do_table(struct sk_buff *skb, |
| 286 | unsigned int hook, | 289 | unsigned int hook, |
| 287 | const struct net_device *in, | 290 | const struct net_device *in, |
| @@ -312,19 +315,6 @@ compat_ipt_get_target(struct compat_ipt_entry *e) | |||
| 312 | 315 | ||
| 313 | #define COMPAT_IPT_ALIGN(s) COMPAT_XT_ALIGN(s) | 316 | #define COMPAT_IPT_ALIGN(s) COMPAT_XT_ALIGN(s) |
| 314 | 317 | ||
| 315 | /* fn returns 0 to continue iteration */ | ||
| 316 | #define COMPAT_IPT_MATCH_ITERATE(e, fn, args...) \ | ||
| 317 | XT_MATCH_ITERATE(struct compat_ipt_entry, e, fn, ## args) | ||
| 318 | |||
| 319 | /* fn returns 0 to continue iteration */ | ||
| 320 | #define COMPAT_IPT_ENTRY_ITERATE(entries, size, fn, args...) \ | ||
| 321 | XT_ENTRY_ITERATE(struct compat_ipt_entry, entries, size, fn, ## args) | ||
| 322 | |||
| 323 | /* fn returns 0 to continue iteration */ | ||
| 324 | #define COMPAT_IPT_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \ | ||
| 325 | XT_ENTRY_ITERATE_CONTINUE(struct compat_ipt_entry, entries, size, n, \ | ||
| 326 | fn, ## args) | ||
| 327 | |||
| 328 | #endif /* CONFIG_COMPAT */ | 318 | #endif /* CONFIG_COMPAT */ |
| 329 | #endif /*__KERNEL__*/ | 319 | #endif /*__KERNEL__*/ |
| 330 | #endif /* _IPTABLES_H */ | 320 | #endif /* _IPTABLES_H */ |
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h index b31050d20ae..e5ba03d783c 100644 --- a/include/linux/netfilter_ipv6/ip6_tables.h +++ b/include/linux/netfilter_ipv6/ip6_tables.h | |||
| @@ -280,6 +280,7 @@ ip6t_get_target(struct ip6t_entry *e) | |||
| 280 | return (void *)e + e->target_offset; | 280 | return (void *)e + e->target_offset; |
| 281 | } | 281 | } |
| 282 | 282 | ||
| 283 | #ifndef __KERNEL__ | ||
| 283 | /* fn returns 0 to continue iteration */ | 284 | /* fn returns 0 to continue iteration */ |
| 284 | #define IP6T_MATCH_ITERATE(e, fn, args...) \ | 285 | #define IP6T_MATCH_ITERATE(e, fn, args...) \ |
| 285 | XT_MATCH_ITERATE(struct ip6t_entry, e, fn, ## args) | 286 | XT_MATCH_ITERATE(struct ip6t_entry, e, fn, ## args) |
| @@ -287,6 +288,7 @@ ip6t_get_target(struct ip6t_entry *e) | |||
| 287 | /* fn returns 0 to continue iteration */ | 288 | /* fn returns 0 to continue iteration */ |
| 288 | #define IP6T_ENTRY_ITERATE(entries, size, fn, args...) \ | 289 | #define IP6T_ENTRY_ITERATE(entries, size, fn, args...) \ |
| 289 | XT_ENTRY_ITERATE(struct ip6t_entry, entries, size, fn, ## args) | 290 | XT_ENTRY_ITERATE(struct ip6t_entry, entries, size, fn, ## args) |
| 291 | #endif | ||
| 290 | 292 | ||
| 291 | /* | 293 | /* |
| 292 | * Main firewall chains definitions and global var's definitions. | 294 | * Main firewall chains definitions and global var's definitions. |
| @@ -297,10 +299,11 @@ ip6t_get_target(struct ip6t_entry *e) | |||
| 297 | #include <linux/init.h> | 299 | #include <linux/init.h> |
| 298 | extern void ip6t_init(void) __init; | 300 | extern void ip6t_init(void) __init; |
| 299 | 301 | ||
| 302 | extern void *ip6t_alloc_initial_table(const struct xt_table *); | ||
| 300 | extern struct xt_table *ip6t_register_table(struct net *net, | 303 | extern struct xt_table *ip6t_register_table(struct net *net, |
| 301 | const struct xt_table *table, | 304 | const struct xt_table *table, |
| 302 | const struct ip6t_replace *repl); | 305 | const struct ip6t_replace *repl); |
| 303 | extern void ip6t_unregister_table(struct xt_table *table); | 306 | extern void ip6t_unregister_table(struct net *net, struct xt_table *table); |
| 304 | extern unsigned int ip6t_do_table(struct sk_buff *skb, | 307 | extern unsigned int ip6t_do_table(struct sk_buff *skb, |
| 305 | unsigned int hook, | 308 | unsigned int hook, |
| 306 | const struct net_device *in, | 309 | const struct net_device *in, |
| @@ -340,18 +343,6 @@ compat_ip6t_get_target(struct compat_ip6t_entry *e) | |||
| 340 | 343 | ||
| 341 | #define COMPAT_IP6T_ALIGN(s) COMPAT_XT_ALIGN(s) | 344 | #define COMPAT_IP6T_ALIGN(s) COMPAT_XT_ALIGN(s) |
| 342 | 345 | ||
| 343 | /* fn returns 0 to continue iteration */ | ||
| 344 | #define COMPAT_IP6T_MATCH_ITERATE(e, fn, args...) \ | ||
| 345 | XT_MATCH_ITERATE(struct compat_ip6t_entry, e, fn, ## args) | ||
| 346 | |||
| 347 | /* fn returns 0 to continue iteration */ | ||
| 348 | #define COMPAT_IP6T_ENTRY_ITERATE(entries, size, fn, args...) \ | ||
| 349 | XT_ENTRY_ITERATE(struct compat_ip6t_entry, entries, size, fn, ## args) | ||
| 350 | |||
| 351 | #define COMPAT_IP6T_ENTRY_ITERATE_CONTINUE(entries, size, n, fn, args...) \ | ||
| 352 | XT_ENTRY_ITERATE_CONTINUE(struct compat_ip6t_entry, entries, size, n, \ | ||
| 353 | fn, ## args) | ||
| 354 | |||
| 355 | #endif /* CONFIG_COMPAT */ | 346 | #endif /* CONFIG_COMPAT */ |
| 356 | #endif /*__KERNEL__*/ | 347 | #endif /*__KERNEL__*/ |
| 357 | #endif /* _IP6_TABLES_H */ | 348 | #endif /* _IP6_TABLES_H */ |
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h index 2524267210d..a765ea89854 100644 --- a/include/linux/netpoll.h +++ b/include/linux/netpoll.h | |||
| @@ -21,15 +21,20 @@ struct netpoll { | |||
| 21 | __be32 local_ip, remote_ip; | 21 | __be32 local_ip, remote_ip; |
| 22 | u16 local_port, remote_port; | 22 | u16 local_port, remote_port; |
| 23 | u8 remote_mac[ETH_ALEN]; | 23 | u8 remote_mac[ETH_ALEN]; |
| 24 | |||
| 25 | struct list_head rx; /* rx_np list element */ | ||
| 24 | }; | 26 | }; |
| 25 | 27 | ||
| 26 | struct netpoll_info { | 28 | struct netpoll_info { |
| 27 | atomic_t refcnt; | 29 | atomic_t refcnt; |
| 30 | |||
| 28 | int rx_flags; | 31 | int rx_flags; |
| 29 | spinlock_t rx_lock; | 32 | spinlock_t rx_lock; |
| 30 | struct netpoll *rx_np; /* netpoll that registered an rx_hook */ | 33 | struct list_head rx_np; /* netpolls that registered an rx_hook */ |
| 34 | |||
| 31 | struct sk_buff_head arp_tx; /* list of arp requests to reply to */ | 35 | struct sk_buff_head arp_tx; /* list of arp requests to reply to */ |
| 32 | struct sk_buff_head txq; | 36 | struct sk_buff_head txq; |
| 37 | |||
| 33 | struct delayed_work tx_work; | 38 | struct delayed_work tx_work; |
| 34 | }; | 39 | }; |
| 35 | 40 | ||
| @@ -51,7 +56,7 @@ static inline int netpoll_rx(struct sk_buff *skb) | |||
| 51 | unsigned long flags; | 56 | unsigned long flags; |
| 52 | int ret = 0; | 57 | int ret = 0; |
| 53 | 58 | ||
| 54 | if (!npinfo || (!npinfo->rx_np && !npinfo->rx_flags)) | 59 | if (!npinfo || (list_empty(&npinfo->rx_np) && !npinfo->rx_flags)) |
| 55 | return 0; | 60 | return 0; |
| 56 | 61 | ||
| 57 | spin_lock_irqsave(&npinfo->rx_lock, flags); | 62 | spin_lock_irqsave(&npinfo->rx_lock, flags); |
| @@ -67,7 +72,7 @@ static inline int netpoll_rx_on(struct sk_buff *skb) | |||
| 67 | { | 72 | { |
| 68 | struct netpoll_info *npinfo = skb->dev->npinfo; | 73 | struct netpoll_info *npinfo = skb->dev->npinfo; |
| 69 | 74 | ||
| 70 | return npinfo && (npinfo->rx_np || npinfo->rx_flags); | 75 | return npinfo && (!list_empty(&npinfo->rx_np) || npinfo->rx_flags); |
| 71 | } | 76 | } |
| 72 | 77 | ||
| 73 | static inline int netpoll_receive_skb(struct sk_buff *skb) | 78 | static inline int netpoll_receive_skb(struct sk_buff *skb) |
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index da8ea2e1927..28ba20fda3e 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
| @@ -3,7 +3,7 @@ | |||
| 3 | /* | 3 | /* |
| 4 | * 802.11 netlink interface public header | 4 | * 802.11 netlink interface public header |
| 5 | * | 5 | * |
| 6 | * Copyright 2006, 2007, 2008 Johannes Berg <johannes@sipsolutions.net> | 6 | * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net> |
| 7 | * Copyright 2008 Michael Wu <flamingice@sourmilk.net> | 7 | * Copyright 2008 Michael Wu <flamingice@sourmilk.net> |
| 8 | * Copyright 2008 Luis Carlos Cobo <luisca@cozybit.com> | 8 | * Copyright 2008 Luis Carlos Cobo <luisca@cozybit.com> |
| 9 | * Copyright 2008 Michael Buesch <mb@bu3sch.de> | 9 | * Copyright 2008 Michael Buesch <mb@bu3sch.de> |
| @@ -270,6 +270,60 @@ | |||
| 270 | * @NL80211_CMD_SET_WIPHY_NETNS: Set a wiphy's netns. Note that all devices | 270 | * @NL80211_CMD_SET_WIPHY_NETNS: Set a wiphy's netns. Note that all devices |
| 271 | * associated with this wiphy must be down and will follow. | 271 | * associated with this wiphy must be down and will follow. |
| 272 | * | 272 | * |
| 273 | * @NL80211_CMD_REMAIN_ON_CHANNEL: Request to remain awake on the specified | ||
| 274 | * channel for the specified amount of time. This can be used to do | ||
| 275 | * off-channel operations like transmit a Public Action frame and wait for | ||
| 276 | * a response while being associated to an AP on another channel. | ||
| 277 | * %NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify which | ||
| 278 | * radio is used. %NL80211_ATTR_WIPHY_FREQ is used to specify the | ||
| 279 | * frequency for the operation and %NL80211_ATTR_WIPHY_CHANNEL_TYPE may be | ||
| 280 | * optionally used to specify additional channel parameters. | ||
| 281 | * %NL80211_ATTR_DURATION is used to specify the duration in milliseconds | ||
| 282 | * to remain on the channel. This command is also used as an event to | ||
| 283 | * notify when the requested duration starts (it may take a while for the | ||
| 284 | * driver to schedule this time due to other concurrent needs for the | ||
| 285 | * radio). | ||
| 286 | * When called, this operation returns a cookie (%NL80211_ATTR_COOKIE) | ||
| 287 | * that will be included with any events pertaining to this request; | ||
| 288 | * the cookie is also used to cancel the request. | ||
| 289 | * @NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL: This command can be used to cancel a | ||
| 290 | * pending remain-on-channel duration if the desired operation has been | ||
| 291 | * completed prior to expiration of the originally requested duration. | ||
| 292 | * %NL80211_ATTR_WIPHY or %NL80211_ATTR_IFINDEX is used to specify the | ||
| 293 | * radio. The %NL80211_ATTR_COOKIE attribute must be given as well to | ||
| 294 | * uniquely identify the request. | ||
| 295 | * This command is also used as an event to notify when a requested | ||
| 296 | * remain-on-channel duration has expired. | ||
| 297 | * | ||
| 298 | * @NL80211_CMD_SET_TX_BITRATE_MASK: Set the mask of rates to be used in TX | ||
| 299 | * rate selection. %NL80211_ATTR_IFINDEX is used to specify the interface | ||
| 300 | * and @NL80211_ATTR_TX_RATES the set of allowed rates. | ||
| 301 | * | ||
| 302 | * @NL80211_CMD_REGISTER_ACTION: Register for receiving certain action frames | ||
| 303 | * (via @NL80211_CMD_ACTION) for processing in userspace. This command | ||
| 304 | * requires an interface index and a match attribute containing the first | ||
| 305 | * few bytes of the frame that should match, e.g. a single byte for only | ||
| 306 | * a category match or four bytes for vendor frames including the OUI. | ||
| 307 | * The registration cannot be dropped, but is removed automatically | ||
| 308 | * when the netlink socket is closed. Multiple registrations can be made. | ||
| 309 | * @NL80211_CMD_ACTION: Action frame TX request and RX notification. This | ||
| 310 | * command is used both as a request to transmit an Action frame and as an | ||
| 311 | * event indicating reception of an Action frame that was not processed in | ||
| 312 | * kernel code, but is for us (i.e., which may need to be processed in a | ||
| 313 | * user space application). %NL80211_ATTR_FRAME is used to specify the | ||
| 314 | * frame contents (including header). %NL80211_ATTR_WIPHY_FREQ (and | ||
| 315 | * optionally %NL80211_ATTR_WIPHY_CHANNEL_TYPE) is used to indicate on | ||
| 316 | * which channel the frame is to be transmitted or was received. This | ||
| 317 | * channel has to be the current channel (remain-on-channel or the | ||
| 318 | * operational channel). When called, this operation returns a cookie | ||
| 319 | * (%NL80211_ATTR_COOKIE) that will be included with the TX status event | ||
| 320 | * pertaining to the TX request. | ||
| 321 | * @NL80211_CMD_ACTION_TX_STATUS: Report TX status of an Action frame | ||
| 322 | * transmitted with %NL80211_CMD_ACTION. %NL80211_ATTR_COOKIE identifies | ||
| 323 | * the TX command and %NL80211_ATTR_FRAME includes the contents of the | ||
| 324 | * frame. %NL80211_ATTR_ACK flag is included if the recipient acknowledged | ||
| 325 | * the frame. | ||
| 326 | * | ||
| 273 | * @NL80211_CMD_MAX: highest used command number | 327 | * @NL80211_CMD_MAX: highest used command number |
| 274 | * @__NL80211_CMD_AFTER_LAST: internal use | 328 | * @__NL80211_CMD_AFTER_LAST: internal use |
| 275 | */ | 329 | */ |
| @@ -353,6 +407,18 @@ enum nl80211_commands { | |||
| 353 | NL80211_CMD_DEL_PMKSA, | 407 | NL80211_CMD_DEL_PMKSA, |
| 354 | NL80211_CMD_FLUSH_PMKSA, | 408 | NL80211_CMD_FLUSH_PMKSA, |
| 355 | 409 | ||
| 410 | NL80211_CMD_REMAIN_ON_CHANNEL, | ||
| 411 | NL80211_CMD_CANCEL_REMAIN_ON_CHANNEL, | ||
| 412 | |||
| 413 | NL80211_CMD_SET_TX_BITRATE_MASK, | ||
| 414 | |||
| 415 | NL80211_CMD_REGISTER_ACTION, | ||
| 416 | NL80211_CMD_ACTION, | ||
| 417 | NL80211_CMD_ACTION_TX_STATUS, | ||
| 418 | |||
| 419 | NL80211_CMD_SET_POWER_SAVE, | ||
| 420 | NL80211_CMD_GET_POWER_SAVE, | ||
| 421 | |||
| 356 | /* add new commands above here */ | 422 | /* add new commands above here */ |
| 357 | 423 | ||
| 358 | /* used to define NL80211_CMD_MAX below */ | 424 | /* used to define NL80211_CMD_MAX below */ |
| @@ -402,6 +468,8 @@ enum nl80211_commands { | |||
| 402 | * @NL80211_ATTR_WIPHY_RTS_THRESHOLD: RTS threshold (TX frames with length | 468 | * @NL80211_ATTR_WIPHY_RTS_THRESHOLD: RTS threshold (TX frames with length |
| 403 | * larger than or equal to this use RTS/CTS handshake); allowed range: | 469 | * larger than or equal to this use RTS/CTS handshake); allowed range: |
| 404 | * 0..65536, disable with (u32)-1; dot11RTSThreshold; u32 | 470 | * 0..65536, disable with (u32)-1; dot11RTSThreshold; u32 |
| 471 | * @NL80211_ATTR_WIPHY_COVERAGE_CLASS: Coverage Class as defined by IEEE 802.11 | ||
| 472 | * section 7.3.2.9; dot11CoverageClass; u8 | ||
| 405 | * | 473 | * |
| 406 | * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on | 474 | * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on |
| 407 | * @NL80211_ATTR_IFNAME: network interface name | 475 | * @NL80211_ATTR_IFNAME: network interface name |
| @@ -606,6 +674,23 @@ enum nl80211_commands { | |||
| 606 | * @NL80211_ATTR_MAX_NUM_PMKIDS: maximum number of PMKIDs a firmware can | 674 | * @NL80211_ATTR_MAX_NUM_PMKIDS: maximum number of PMKIDs a firmware can |
| 607 | * cache, a wiphy attribute. | 675 | * cache, a wiphy attribute. |
| 608 | * | 676 | * |
| 677 | * @NL80211_ATTR_DURATION: Duration of an operation in milliseconds, u32. | ||
| 678 | * | ||
| 679 | * @NL80211_ATTR_COOKIE: Generic 64-bit cookie to identify objects. | ||
| 680 | * | ||
| 681 | * @NL80211_ATTR_TX_RATES: Nested set of attributes | ||
| 682 | * (enum nl80211_tx_rate_attributes) describing TX rates per band. The | ||
| 683 | * enum nl80211_band value is used as the index (nla_type() of the nested | ||
| 684 | * data. If a band is not included, it will be configured to allow all | ||
| 685 | * rates based on negotiated supported rates information. This attribute | ||
| 686 | * is used with %NL80211_CMD_SET_TX_BITRATE_MASK. | ||
| 687 | * | ||
| 688 | * @NL80211_ATTR_FRAME_MATCH: A binary attribute which typically must contain | ||
| 689 | * at least one byte, currently used with @NL80211_CMD_REGISTER_ACTION. | ||
| 690 | * | ||
| 691 | * @NL80211_ATTR_ACK: Flag attribute indicating that the frame was | ||
| 692 | * acknowledged by the recipient. | ||
| 693 | * | ||
| 609 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 694 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
| 610 | * @__NL80211_ATTR_AFTER_LAST: internal use | 695 | * @__NL80211_ATTR_AFTER_LAST: internal use |
| 611 | */ | 696 | */ |
| @@ -743,6 +828,20 @@ enum nl80211_attrs { | |||
| 743 | NL80211_ATTR_PMKID, | 828 | NL80211_ATTR_PMKID, |
| 744 | NL80211_ATTR_MAX_NUM_PMKIDS, | 829 | NL80211_ATTR_MAX_NUM_PMKIDS, |
| 745 | 830 | ||
| 831 | NL80211_ATTR_DURATION, | ||
| 832 | |||
| 833 | NL80211_ATTR_COOKIE, | ||
| 834 | |||
| 835 | NL80211_ATTR_WIPHY_COVERAGE_CLASS, | ||
| 836 | |||
| 837 | NL80211_ATTR_TX_RATES, | ||
| 838 | |||
| 839 | NL80211_ATTR_FRAME_MATCH, | ||
| 840 | |||
| 841 | NL80211_ATTR_ACK, | ||
| 842 | |||
| 843 | NL80211_ATTR_PS_STATE, | ||
| 844 | |||
| 746 | /* add attributes here, update the policy in nl80211.c */ | 845 | /* add attributes here, update the policy in nl80211.c */ |
| 747 | 846 | ||
| 748 | __NL80211_ATTR_AFTER_LAST, | 847 | __NL80211_ATTR_AFTER_LAST, |
| @@ -1323,13 +1422,20 @@ enum nl80211_channel_type { | |||
| 1323 | * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16) | 1422 | * @NL80211_BSS_BEACON_INTERVAL: beacon interval of the (I)BSS (u16) |
| 1324 | * @NL80211_BSS_CAPABILITY: capability field (CPU order, u16) | 1423 | * @NL80211_BSS_CAPABILITY: capability field (CPU order, u16) |
| 1325 | * @NL80211_BSS_INFORMATION_ELEMENTS: binary attribute containing the | 1424 | * @NL80211_BSS_INFORMATION_ELEMENTS: binary attribute containing the |
| 1326 | * raw information elements from the probe response/beacon (bin) | 1425 | * raw information elements from the probe response/beacon (bin); |
| 1426 | * if the %NL80211_BSS_BEACON_IES attribute is present, the IEs here are | ||
| 1427 | * from a Probe Response frame; otherwise they are from a Beacon frame. | ||
| 1428 | * However, if the driver does not indicate the source of the IEs, these | ||
| 1429 | * IEs may be from either frame subtype. | ||
| 1327 | * @NL80211_BSS_SIGNAL_MBM: signal strength of probe response/beacon | 1430 | * @NL80211_BSS_SIGNAL_MBM: signal strength of probe response/beacon |
| 1328 | * in mBm (100 * dBm) (s32) | 1431 | * in mBm (100 * dBm) (s32) |
| 1329 | * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon | 1432 | * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon |
| 1330 | * in unspecified units, scaled to 0..100 (u8) | 1433 | * in unspecified units, scaled to 0..100 (u8) |
| 1331 | * @NL80211_BSS_STATUS: status, if this BSS is "used" | 1434 | * @NL80211_BSS_STATUS: status, if this BSS is "used" |
| 1332 | * @NL80211_BSS_SEEN_MS_AGO: age of this BSS entry in ms | 1435 | * @NL80211_BSS_SEEN_MS_AGO: age of this BSS entry in ms |
| 1436 | * @NL80211_BSS_BEACON_IES: binary attribute containing the raw information | ||
| 1437 | * elements from a Beacon frame (bin); not present if no Beacon frame has | ||
| 1438 | * yet been received | ||
| 1333 | * @__NL80211_BSS_AFTER_LAST: internal | 1439 | * @__NL80211_BSS_AFTER_LAST: internal |
| 1334 | * @NL80211_BSS_MAX: highest BSS attribute | 1440 | * @NL80211_BSS_MAX: highest BSS attribute |
| 1335 | */ | 1441 | */ |
| @@ -1345,6 +1451,7 @@ enum nl80211_bss { | |||
| 1345 | NL80211_BSS_SIGNAL_UNSPEC, | 1451 | NL80211_BSS_SIGNAL_UNSPEC, |
| 1346 | NL80211_BSS_STATUS, | 1452 | NL80211_BSS_STATUS, |
| 1347 | NL80211_BSS_SEEN_MS_AGO, | 1453 | NL80211_BSS_SEEN_MS_AGO, |
| 1454 | NL80211_BSS_BEACON_IES, | ||
| 1348 | 1455 | ||
| 1349 | /* keep last */ | 1456 | /* keep last */ |
| 1350 | __NL80211_BSS_AFTER_LAST, | 1457 | __NL80211_BSS_AFTER_LAST, |
| @@ -1442,4 +1549,38 @@ enum nl80211_key_attributes { | |||
| 1442 | NL80211_KEY_MAX = __NL80211_KEY_AFTER_LAST - 1 | 1549 | NL80211_KEY_MAX = __NL80211_KEY_AFTER_LAST - 1 |
| 1443 | }; | 1550 | }; |
| 1444 | 1551 | ||
| 1552 | /** | ||
| 1553 | * enum nl80211_tx_rate_attributes - TX rate set attributes | ||
| 1554 | * @__NL80211_TXRATE_INVALID: invalid | ||
| 1555 | * @NL80211_TXRATE_LEGACY: Legacy (non-MCS) rates allowed for TX rate selection | ||
| 1556 | * in an array of rates as defined in IEEE 802.11 7.3.2.2 (u8 values with | ||
| 1557 | * 1 = 500 kbps) but without the IE length restriction (at most | ||
| 1558 | * %NL80211_MAX_SUPP_RATES in a single array). | ||
| 1559 | * @__NL80211_TXRATE_AFTER_LAST: internal | ||
| 1560 | * @NL80211_TXRATE_MAX: highest TX rate attribute | ||
| 1561 | */ | ||
| 1562 | enum nl80211_tx_rate_attributes { | ||
| 1563 | __NL80211_TXRATE_INVALID, | ||
| 1564 | NL80211_TXRATE_LEGACY, | ||
| 1565 | |||
| 1566 | /* keep last */ | ||
| 1567 | __NL80211_TXRATE_AFTER_LAST, | ||
| 1568 | NL80211_TXRATE_MAX = __NL80211_TXRATE_AFTER_LAST - 1 | ||
| 1569 | }; | ||
| 1570 | |||
| 1571 | /** | ||
| 1572 | * enum nl80211_band - Frequency band | ||
| 1573 | * @NL80211_BAND_2GHZ - 2.4 GHz ISM band | ||
| 1574 | * @NL80211_BAND_5GHZ - around 5 GHz band (4.9 - 5.7 GHz) | ||
| 1575 | */ | ||
| 1576 | enum nl80211_band { | ||
| 1577 | NL80211_BAND_2GHZ, | ||
| 1578 | NL80211_BAND_5GHZ, | ||
| 1579 | }; | ||
| 1580 | |||
| 1581 | enum nl80211_ps_state { | ||
| 1582 | NL80211_PS_DISABLED, | ||
| 1583 | NL80211_PS_ENABLED, | ||
| 1584 | }; | ||
| 1585 | |||
| 1445 | #endif /* __LINUX_NL80211_H */ | 1586 | #endif /* __LINUX_NL80211_H */ |
diff --git a/include/linux/of.h b/include/linux/of.h index e7facd8fbce..f6d9cbc39c9 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
| @@ -19,6 +19,11 @@ | |||
| 19 | #include <linux/bitops.h> | 19 | #include <linux/bitops.h> |
| 20 | #include <linux/kref.h> | 20 | #include <linux/kref.h> |
| 21 | #include <linux/mod_devicetable.h> | 21 | #include <linux/mod_devicetable.h> |
| 22 | #include <linux/spinlock.h> | ||
| 23 | |||
| 24 | #include <asm/byteorder.h> | ||
| 25 | |||
| 26 | #ifdef CONFIG_OF | ||
| 22 | 27 | ||
| 23 | typedef u32 phandle; | 28 | typedef u32 phandle; |
| 24 | typedef u32 ihandle; | 29 | typedef u32 ihandle; |
| @@ -39,10 +44,7 @@ struct of_irq_controller; | |||
| 39 | struct device_node { | 44 | struct device_node { |
| 40 | const char *name; | 45 | const char *name; |
| 41 | const char *type; | 46 | const char *type; |
| 42 | phandle node; | 47 | phandle phandle; |
| 43 | #if !defined(CONFIG_SPARC) | ||
| 44 | phandle linux_phandle; | ||
| 45 | #endif | ||
| 46 | char *full_name; | 48 | char *full_name; |
| 47 | 49 | ||
| 48 | struct property *properties; | 50 | struct property *properties; |
| @@ -63,6 +65,11 @@ struct device_node { | |||
| 63 | #endif | 65 | #endif |
| 64 | }; | 66 | }; |
| 65 | 67 | ||
| 68 | /* Pointer for first entry in chain of all nodes. */ | ||
| 69 | extern struct device_node *allnodes; | ||
| 70 | extern struct device_node *of_chosen; | ||
| 71 | extern rwlock_t devtree_lock; | ||
| 72 | |||
| 66 | static inline int of_node_check_flag(struct device_node *n, unsigned long flag) | 73 | static inline int of_node_check_flag(struct device_node *n, unsigned long flag) |
| 67 | { | 74 | { |
| 68 | return test_bit(flag, &n->_flags); | 75 | return test_bit(flag, &n->_flags); |
| @@ -73,12 +80,6 @@ static inline void of_node_set_flag(struct device_node *n, unsigned long flag) | |||
| 73 | set_bit(flag, &n->_flags); | 80 | set_bit(flag, &n->_flags); |
| 74 | } | 81 | } |
| 75 | 82 | ||
| 76 | static inline void | ||
| 77 | set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de) | ||
| 78 | { | ||
| 79 | dn->pde = de; | ||
| 80 | } | ||
| 81 | |||
| 82 | extern struct device_node *of_find_all_nodes(struct device_node *prev); | 83 | extern struct device_node *of_find_all_nodes(struct device_node *prev); |
| 83 | 84 | ||
| 84 | #if defined(CONFIG_SPARC) | 85 | #if defined(CONFIG_SPARC) |
| @@ -101,26 +102,36 @@ extern void of_node_put(struct device_node *node); | |||
| 101 | */ | 102 | */ |
| 102 | 103 | ||
| 103 | /* Helper to read a big number; size is in cells (not bytes) */ | 104 | /* Helper to read a big number; size is in cells (not bytes) */ |
| 104 | static inline u64 of_read_number(const u32 *cell, int size) | 105 | static inline u64 of_read_number(const __be32 *cell, int size) |
| 105 | { | 106 | { |
| 106 | u64 r = 0; | 107 | u64 r = 0; |
| 107 | while (size--) | 108 | while (size--) |
| 108 | r = (r << 32) | *(cell++); | 109 | r = (r << 32) | be32_to_cpu(*(cell++)); |
| 109 | return r; | 110 | return r; |
| 110 | } | 111 | } |
| 111 | 112 | ||
| 112 | /* Like of_read_number, but we want an unsigned long result */ | 113 | /* Like of_read_number, but we want an unsigned long result */ |
| 113 | #ifdef CONFIG_PPC32 | 114 | static inline unsigned long of_read_ulong(const __be32 *cell, int size) |
| 114 | static inline unsigned long of_read_ulong(const u32 *cell, int size) | ||
| 115 | { | 115 | { |
| 116 | return cell[size-1]; | 116 | /* toss away upper bits if unsigned long is smaller than u64 */ |
| 117 | return of_read_number(cell, size); | ||
| 117 | } | 118 | } |
| 118 | #else | ||
| 119 | #define of_read_ulong(cell, size) of_read_number(cell, size) | ||
| 120 | #endif | ||
| 121 | 119 | ||
| 122 | #include <asm/prom.h> | 120 | #include <asm/prom.h> |
| 123 | 121 | ||
| 122 | /* Default #address and #size cells. Allow arch asm/prom.h to override */ | ||
| 123 | #if !defined(OF_ROOT_NODE_ADDR_CELLS_DEFAULT) | ||
| 124 | #define OF_ROOT_NODE_ADDR_CELLS_DEFAULT 1 | ||
| 125 | #define OF_ROOT_NODE_SIZE_CELLS_DEFAULT 1 | ||
| 126 | #endif | ||
| 127 | |||
| 128 | /* Default string compare functions, Allow arch asm/prom.h to override */ | ||
| 129 | #if !defined(of_compat_cmp) | ||
| 130 | #define of_compat_cmp(s1, s2, l) strncasecmp((s1), (s2), (l)) | ||
| 131 | #define of_prop_cmp(s1, s2) strcmp((s1), (s2)) | ||
| 132 | #define of_node_cmp(s1, s2) strcasecmp((s1), (s2)) | ||
| 133 | #endif | ||
| 134 | |||
| 124 | /* flag descriptions */ | 135 | /* flag descriptions */ |
| 125 | #define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ | 136 | #define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ |
| 126 | #define OF_DETACHED 2 /* node has been detached from the device tree */ | 137 | #define OF_DETACHED 2 /* node has been detached from the device tree */ |
| @@ -187,4 +198,19 @@ extern int of_parse_phandles_with_args(struct device_node *np, | |||
| 187 | const char *list_name, const char *cells_name, int index, | 198 | const char *list_name, const char *cells_name, int index, |
| 188 | struct device_node **out_node, const void **out_args); | 199 | struct device_node **out_node, const void **out_args); |
| 189 | 200 | ||
| 201 | extern int of_machine_is_compatible(const char *compat); | ||
| 202 | |||
| 203 | extern int prom_add_property(struct device_node* np, struct property* prop); | ||
| 204 | extern int prom_remove_property(struct device_node *np, struct property *prop); | ||
| 205 | extern int prom_update_property(struct device_node *np, | ||
| 206 | struct property *newprop, | ||
| 207 | struct property *oldprop); | ||
| 208 | |||
| 209 | #if defined(CONFIG_OF_DYNAMIC) | ||
| 210 | /* For updating the device tree at runtime */ | ||
| 211 | extern void of_attach_node(struct device_node *); | ||
| 212 | extern void of_detach_node(struct device_node *); | ||
| 213 | #endif | ||
| 214 | |||
| 215 | #endif /* CONFIG_OF */ | ||
| 190 | #endif /* _LINUX_OF_H */ | 216 | #endif /* _LINUX_OF_H */ |
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h index 41d432b1355..a1ca92ccb0f 100644 --- a/include/linux/of_fdt.h +++ b/include/linux/of_fdt.h | |||
| @@ -42,45 +42,62 @@ | |||
| 42 | * ends when size is 0 | 42 | * ends when size is 0 |
| 43 | */ | 43 | */ |
| 44 | struct boot_param_header { | 44 | struct boot_param_header { |
| 45 | u32 magic; /* magic word OF_DT_HEADER */ | 45 | __be32 magic; /* magic word OF_DT_HEADER */ |
| 46 | u32 totalsize; /* total size of DT block */ | 46 | __be32 totalsize; /* total size of DT block */ |
| 47 | u32 off_dt_struct; /* offset to structure */ | 47 | __be32 off_dt_struct; /* offset to structure */ |
| 48 | u32 off_dt_strings; /* offset to strings */ | 48 | __be32 off_dt_strings; /* offset to strings */ |
| 49 | u32 off_mem_rsvmap; /* offset to memory reserve map */ | 49 | __be32 off_mem_rsvmap; /* offset to memory reserve map */ |
| 50 | u32 version; /* format version */ | 50 | __be32 version; /* format version */ |
| 51 | u32 last_comp_version; /* last compatible version */ | 51 | __be32 last_comp_version; /* last compatible version */ |
| 52 | /* version 2 fields below */ | 52 | /* version 2 fields below */ |
| 53 | u32 boot_cpuid_phys; /* Physical CPU id we're booting on */ | 53 | __be32 boot_cpuid_phys; /* Physical CPU id we're booting on */ |
| 54 | /* version 3 fields below */ | 54 | /* version 3 fields below */ |
| 55 | u32 dt_strings_size; /* size of the DT strings block */ | 55 | __be32 dt_strings_size; /* size of the DT strings block */ |
| 56 | /* version 17 fields below */ | 56 | /* version 17 fields below */ |
| 57 | u32 dt_struct_size; /* size of the DT structure block */ | 57 | __be32 dt_struct_size; /* size of the DT structure block */ |
| 58 | }; | 58 | }; |
| 59 | 59 | ||
| 60 | /* TBD: Temporary export of fdt globals - remove when code fully merged */ | ||
| 61 | extern int __initdata dt_root_addr_cells; | ||
| 62 | extern int __initdata dt_root_size_cells; | ||
| 63 | extern struct boot_param_header *initial_boot_params; | ||
| 64 | |||
| 60 | /* For scanning the flat device-tree at boot time */ | 65 | /* For scanning the flat device-tree at boot time */ |
| 61 | extern int __init of_scan_flat_dt(int (*it)(unsigned long node, | 66 | extern char *find_flat_dt_string(u32 offset); |
| 62 | const char *uname, int depth, | 67 | extern int of_scan_flat_dt(int (*it)(unsigned long node, const char *uname, |
| 63 | void *data), | 68 | int depth, void *data), |
| 64 | void *data); | 69 | void *data); |
| 65 | extern void __init *of_get_flat_dt_prop(unsigned long node, const char *name, | 70 | extern void *of_get_flat_dt_prop(unsigned long node, const char *name, |
| 66 | unsigned long *size); | 71 | unsigned long *size); |
| 67 | extern int __init of_flat_dt_is_compatible(unsigned long node, | 72 | extern int of_flat_dt_is_compatible(unsigned long node, const char *name); |
| 68 | const char *name); | 73 | extern unsigned long of_get_flat_dt_root(void); |
| 69 | extern unsigned long __init of_get_flat_dt_root(void); | 74 | extern void early_init_dt_scan_chosen_arch(unsigned long node); |
| 75 | extern int early_init_dt_scan_chosen(unsigned long node, const char *uname, | ||
| 76 | int depth, void *data); | ||
| 77 | extern void early_init_dt_check_for_initrd(unsigned long node); | ||
| 78 | extern int early_init_dt_scan_memory(unsigned long node, const char *uname, | ||
| 79 | int depth, void *data); | ||
| 80 | extern void early_init_dt_add_memory_arch(u64 base, u64 size); | ||
| 81 | extern u64 early_init_dt_alloc_memory_arch(u64 size, u64 align); | ||
| 82 | extern u64 dt_mem_next_cell(int s, __be32 **cellp); | ||
| 83 | |||
| 84 | /* | ||
| 85 | * If BLK_DEV_INITRD, the fdt early init code will call this function, | ||
| 86 | * to be provided by the arch code. start and end are specified as | ||
| 87 | * physical addresses. | ||
| 88 | */ | ||
| 89 | #ifdef CONFIG_BLK_DEV_INITRD | ||
| 90 | extern void early_init_dt_setup_initrd_arch(unsigned long start, | ||
| 91 | unsigned long end); | ||
| 92 | #endif | ||
| 93 | |||
| 94 | /* Early flat tree scan hooks */ | ||
| 95 | extern int early_init_dt_scan_root(unsigned long node, const char *uname, | ||
| 96 | int depth, void *data); | ||
| 70 | 97 | ||
| 71 | /* Other Prototypes */ | 98 | /* Other Prototypes */ |
| 72 | extern void finish_device_tree(void); | ||
| 73 | extern void unflatten_device_tree(void); | 99 | extern void unflatten_device_tree(void); |
| 74 | extern void early_init_devtree(void *); | 100 | extern void early_init_devtree(void *); |
| 75 | extern int machine_is_compatible(const char *compat); | ||
| 76 | extern void print_properties(struct device_node *node); | ||
| 77 | extern int prom_n_intr_cells(struct device_node* np); | ||
| 78 | extern void prom_get_irq_senses(unsigned char *senses, int off, int max); | ||
| 79 | extern int prom_add_property(struct device_node* np, struct property* prop); | ||
| 80 | extern int prom_remove_property(struct device_node *np, struct property *prop); | ||
| 81 | extern int prom_update_property(struct device_node *np, | ||
| 82 | struct property *newprop, | ||
| 83 | struct property *oldprop); | ||
| 84 | 101 | ||
| 85 | #endif /* __ASSEMBLY__ */ | 102 | #endif /* __ASSEMBLY__ */ |
| 86 | #endif /* _LINUX_OF_FDT_H */ | 103 | #endif /* _LINUX_OF_FDT_H */ |
diff --git a/include/linux/padata.h b/include/linux/padata.h new file mode 100644 index 00000000000..51611da9c49 --- /dev/null +++ b/include/linux/padata.h | |||
| @@ -0,0 +1,88 @@ | |||
| 1 | /* | ||
| 2 | * padata.h - header for the padata parallelization interface | ||
| 3 | * | ||
| 4 | * Copyright (C) 2008, 2009 secunet Security Networks AG | ||
| 5 | * Copyright (C) 2008, 2009 Steffen Klassert <steffen.klassert@secunet.com> | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify it | ||
| 8 | * under the terms and conditions of the GNU General Public License, | ||
| 9 | * version 2, as published by the Free Software Foundation. | ||
| 10 | * | ||
| 11 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
| 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 14 | * more details. | ||
| 15 | * | ||
| 16 | * You should have received a copy of the GNU General Public License along with | ||
| 17 | * this program; if not, write to the Free Software Foundation, Inc., | ||
| 18 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 19 | */ | ||
| 20 | |||
| 21 | #ifndef PADATA_H | ||
| 22 | #define PADATA_H | ||
| 23 | |||
| 24 | #include <linux/workqueue.h> | ||
| 25 | #include <linux/spinlock.h> | ||
| 26 | #include <linux/list.h> | ||
| 27 | |||
| 28 | struct padata_priv { | ||
| 29 | struct list_head list; | ||
| 30 | struct parallel_data *pd; | ||
| 31 | int cb_cpu; | ||
| 32 | int seq_nr; | ||
| 33 | int info; | ||
| 34 | void (*parallel)(struct padata_priv *padata); | ||
| 35 | void (*serial)(struct padata_priv *padata); | ||
| 36 | }; | ||
| 37 | |||
| 38 | struct padata_list { | ||
| 39 | struct list_head list; | ||
| 40 | spinlock_t lock; | ||
| 41 | }; | ||
| 42 | |||
| 43 | struct padata_queue { | ||
| 44 | struct padata_list parallel; | ||
| 45 | struct padata_list reorder; | ||
| 46 | struct padata_list serial; | ||
| 47 | struct work_struct pwork; | ||
| 48 | struct work_struct swork; | ||
| 49 | struct parallel_data *pd; | ||
| 50 | atomic_t num_obj; | ||
| 51 | int cpu_index; | ||
| 52 | }; | ||
| 53 | |||
| 54 | struct parallel_data { | ||
| 55 | struct padata_instance *pinst; | ||
| 56 | struct padata_queue *queue; | ||
| 57 | atomic_t seq_nr; | ||
| 58 | atomic_t reorder_objects; | ||
| 59 | atomic_t refcnt; | ||
| 60 | unsigned int max_seq_nr; | ||
| 61 | cpumask_var_t cpumask; | ||
| 62 | spinlock_t lock; | ||
| 63 | }; | ||
| 64 | |||
| 65 | struct padata_instance { | ||
| 66 | struct notifier_block cpu_notifier; | ||
| 67 | struct workqueue_struct *wq; | ||
| 68 | struct parallel_data *pd; | ||
| 69 | cpumask_var_t cpumask; | ||
| 70 | struct mutex lock; | ||
| 71 | u8 flags; | ||
| 72 | #define PADATA_INIT 1 | ||
| 73 | #define PADATA_RESET 2 | ||
| 74 | }; | ||
| 75 | |||
| 76 | extern struct padata_instance *padata_alloc(const struct cpumask *cpumask, | ||
| 77 | struct workqueue_struct *wq); | ||
| 78 | extern void padata_free(struct padata_instance *pinst); | ||
| 79 | extern int padata_do_parallel(struct padata_instance *pinst, | ||
| 80 | struct padata_priv *padata, int cb_cpu); | ||
| 81 | extern void padata_do_serial(struct padata_priv *padata); | ||
| 82 | extern int padata_set_cpumask(struct padata_instance *pinst, | ||
| 83 | cpumask_var_t cpumask); | ||
| 84 | extern int padata_add_cpu(struct padata_instance *pinst, int cpu); | ||
| 85 | extern int padata_remove_cpu(struct padata_instance *pinst, int cpu); | ||
| 86 | extern void padata_start(struct padata_instance *pinst); | ||
| 87 | extern void padata_stop(struct padata_instance *pinst); | ||
| 88 | #endif | ||
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index ed5d7501e18..3c62ed40849 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
| @@ -253,6 +253,8 @@ extern struct page * read_cache_page_async(struct address_space *mapping, | |||
| 253 | extern struct page * read_cache_page(struct address_space *mapping, | 253 | extern struct page * read_cache_page(struct address_space *mapping, |
| 254 | pgoff_t index, filler_t *filler, | 254 | pgoff_t index, filler_t *filler, |
| 255 | void *data); | 255 | void *data); |
| 256 | extern struct page * read_cache_page_gfp(struct address_space *mapping, | ||
| 257 | pgoff_t index, gfp_t gfp_mask); | ||
| 256 | extern int read_cache_pages(struct address_space *mapping, | 258 | extern int read_cache_pages(struct address_space *mapping, |
| 257 | struct list_head *pages, filler_t *filler, void *data); | 259 | struct list_head *pages, filler_t *filler, void *data); |
| 258 | 260 | ||
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index 93a7c08f869..c8b6473c5f4 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h | |||
| @@ -11,6 +11,13 @@ | |||
| 11 | #include <linux/acpi.h> | 11 | #include <linux/acpi.h> |
| 12 | 12 | ||
| 13 | #ifdef CONFIG_ACPI | 13 | #ifdef CONFIG_ACPI |
| 14 | extern acpi_status pci_acpi_add_bus_pm_notifier(struct acpi_device *dev, | ||
| 15 | struct pci_bus *pci_bus); | ||
| 16 | extern acpi_status pci_acpi_remove_bus_pm_notifier(struct acpi_device *dev); | ||
| 17 | extern acpi_status pci_acpi_add_pm_notifier(struct acpi_device *dev, | ||
| 18 | struct pci_dev *pci_dev); | ||
| 19 | extern acpi_status pci_acpi_remove_pm_notifier(struct acpi_device *dev); | ||
| 20 | |||
| 14 | static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) | 21 | static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) |
| 15 | { | 22 | { |
| 16 | struct pci_bus *pbus = pdev->bus; | 23 | struct pci_bus *pbus = pdev->bus; |
diff --git a/include/linux/pci.h b/include/linux/pci.h index bf1e6708084..ec95ebe629f 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
| @@ -187,6 +187,33 @@ enum pci_bus_flags { | |||
| 187 | PCI_BUS_FLAGS_NO_MMRBC = (__force pci_bus_flags_t) 2, | 187 | PCI_BUS_FLAGS_NO_MMRBC = (__force pci_bus_flags_t) 2, |
| 188 | }; | 188 | }; |
| 189 | 189 | ||
| 190 | /* Based on the PCI Hotplug Spec, but some values are made up by us */ | ||
| 191 | enum pci_bus_speed { | ||
| 192 | PCI_SPEED_33MHz = 0x00, | ||
| 193 | PCI_SPEED_66MHz = 0x01, | ||
| 194 | PCI_SPEED_66MHz_PCIX = 0x02, | ||
| 195 | PCI_SPEED_100MHz_PCIX = 0x03, | ||
| 196 | PCI_SPEED_133MHz_PCIX = 0x04, | ||
| 197 | PCI_SPEED_66MHz_PCIX_ECC = 0x05, | ||
| 198 | PCI_SPEED_100MHz_PCIX_ECC = 0x06, | ||
| 199 | PCI_SPEED_133MHz_PCIX_ECC = 0x07, | ||
| 200 | PCI_SPEED_66MHz_PCIX_266 = 0x09, | ||
| 201 | PCI_SPEED_100MHz_PCIX_266 = 0x0a, | ||
| 202 | PCI_SPEED_133MHz_PCIX_266 = 0x0b, | ||
| 203 | AGP_UNKNOWN = 0x0c, | ||
| 204 | AGP_1X = 0x0d, | ||
| 205 | AGP_2X = 0x0e, | ||
| 206 | AGP_4X = 0x0f, | ||
| 207 | AGP_8X = 0x10, | ||
| 208 | PCI_SPEED_66MHz_PCIX_533 = 0x11, | ||
| 209 | PCI_SPEED_100MHz_PCIX_533 = 0x12, | ||
| 210 | PCI_SPEED_133MHz_PCIX_533 = 0x13, | ||
| 211 | PCIE_SPEED_2_5GT = 0x14, | ||
| 212 | PCIE_SPEED_5_0GT = 0x15, | ||
| 213 | PCIE_SPEED_8_0GT = 0x16, | ||
| 214 | PCI_SPEED_UNKNOWN = 0xff, | ||
| 215 | }; | ||
| 216 | |||
| 190 | struct pci_cap_saved_state { | 217 | struct pci_cap_saved_state { |
| 191 | struct hlist_node next; | 218 | struct hlist_node next; |
| 192 | char cap_nr; | 219 | char cap_nr; |
| @@ -239,10 +266,12 @@ struct pci_dev { | |||
| 239 | configuration space */ | 266 | configuration space */ |
| 240 | unsigned int pme_support:5; /* Bitmask of states from which PME# | 267 | unsigned int pme_support:5; /* Bitmask of states from which PME# |
| 241 | can be generated */ | 268 | can be generated */ |
| 269 | unsigned int pme_interrupt:1; | ||
| 242 | unsigned int d1_support:1; /* Low power state D1 is supported */ | 270 | unsigned int d1_support:1; /* Low power state D1 is supported */ |
| 243 | unsigned int d2_support:1; /* Low power state D2 is supported */ | 271 | unsigned int d2_support:1; /* Low power state D2 is supported */ |
| 244 | unsigned int no_d1d2:1; /* Only allow D0 and D3 */ | 272 | unsigned int no_d1d2:1; /* Only allow D0 and D3 */ |
| 245 | unsigned int wakeup_prepared:1; | 273 | unsigned int wakeup_prepared:1; |
| 274 | unsigned int d3_delay; /* D3->D0 transition time in ms */ | ||
| 246 | 275 | ||
| 247 | #ifdef CONFIG_PCIEASPM | 276 | #ifdef CONFIG_PCIEASPM |
| 248 | struct pcie_link_state *link_state; /* ASPM link state. */ | 277 | struct pcie_link_state *link_state; /* ASPM link state. */ |
| @@ -274,7 +303,8 @@ struct pci_dev { | |||
| 274 | unsigned int msix_enabled:1; | 303 | unsigned int msix_enabled:1; |
| 275 | unsigned int ari_enabled:1; /* ARI forwarding */ | 304 | unsigned int ari_enabled:1; /* ARI forwarding */ |
| 276 | unsigned int is_managed:1; | 305 | unsigned int is_managed:1; |
| 277 | unsigned int is_pcie:1; | 306 | unsigned int is_pcie:1; /* Obsolete. Will be removed. |
| 307 | Use pci_is_pcie() instead */ | ||
| 278 | unsigned int needs_freset:1; /* Dev requires fundamental reset */ | 308 | unsigned int needs_freset:1; /* Dev requires fundamental reset */ |
| 279 | unsigned int state_saved:1; | 309 | unsigned int state_saved:1; |
| 280 | unsigned int is_physfn:1; | 310 | unsigned int is_physfn:1; |
| @@ -334,9 +364,26 @@ static inline void pci_add_saved_cap(struct pci_dev *pci_dev, | |||
| 334 | hlist_add_head(&new_cap->next, &pci_dev->saved_cap_space); | 364 | hlist_add_head(&new_cap->next, &pci_dev->saved_cap_space); |
| 335 | } | 365 | } |
| 336 | 366 | ||
| 337 | #ifndef PCI_BUS_NUM_RESOURCES | 367 | /* |
| 338 | #define PCI_BUS_NUM_RESOURCES 16 | 368 | * The first PCI_BRIDGE_RESOURCE_NUM PCI bus resources (those that correspond |
| 339 | #endif | 369 | * to P2P or CardBus bridge windows) go in a table. Additional ones (for |
| 370 | * buses below host bridges or subtractive decode bridges) go in the list. | ||
| 371 | * Use pci_bus_for_each_resource() to iterate through all the resources. | ||
| 372 | */ | ||
| 373 | |||
| 374 | /* | ||
| 375 | * PCI_SUBTRACTIVE_DECODE means the bridge forwards the window implicitly | ||
| 376 | * and there's no way to program the bridge with the details of the window. | ||
| 377 | * This does not apply to ACPI _CRS windows, even with the _DEC subtractive- | ||
| 378 | * decode bit set, because they are explicit and can be programmed with _SRS. | ||
| 379 | */ | ||
| 380 | #define PCI_SUBTRACTIVE_DECODE 0x1 | ||
| 381 | |||
| 382 | struct pci_bus_resource { | ||
| 383 | struct list_head list; | ||
| 384 | struct resource *res; | ||
| 385 | unsigned int flags; | ||
| 386 | }; | ||
| 340 | 387 | ||
| 341 | #define PCI_REGION_FLAG_MASK 0x0fU /* These bits of resource flags tell us the PCI region flags */ | 388 | #define PCI_REGION_FLAG_MASK 0x0fU /* These bits of resource flags tell us the PCI region flags */ |
| 342 | 389 | ||
| @@ -347,8 +394,8 @@ struct pci_bus { | |||
| 347 | struct list_head devices; /* list of devices on this bus */ | 394 | struct list_head devices; /* list of devices on this bus */ |
| 348 | struct pci_dev *self; /* bridge device as seen by parent */ | 395 | struct pci_dev *self; /* bridge device as seen by parent */ |
| 349 | struct list_head slots; /* list of slots on this bus */ | 396 | struct list_head slots; /* list of slots on this bus */ |
| 350 | struct resource *resource[PCI_BUS_NUM_RESOURCES]; | 397 | struct resource *resource[PCI_BRIDGE_RESOURCE_NUM]; |
| 351 | /* address space routed to this bus */ | 398 | struct list_head resources; /* address space routed to this bus */ |
| 352 | 399 | ||
| 353 | struct pci_ops *ops; /* configuration access functions */ | 400 | struct pci_ops *ops; /* configuration access functions */ |
| 354 | void *sysdata; /* hook for sys-specific extension */ | 401 | void *sysdata; /* hook for sys-specific extension */ |
| @@ -358,6 +405,8 @@ struct pci_bus { | |||
| 358 | unsigned char primary; /* number of primary bridge */ | 405 | unsigned char primary; /* number of primary bridge */ |
| 359 | unsigned char secondary; /* number of secondary bridge */ | 406 | unsigned char secondary; /* number of secondary bridge */ |
| 360 | unsigned char subordinate; /* max number of subordinate buses */ | 407 | unsigned char subordinate; /* max number of subordinate buses */ |
| 408 | unsigned char max_bus_speed; /* enum pci_bus_speed */ | ||
| 409 | unsigned char cur_bus_speed; /* enum pci_bus_speed */ | ||
| 361 | 410 | ||
| 362 | char name[48]; | 411 | char name[48]; |
| 363 | 412 | ||
| @@ -562,10 +611,14 @@ int __must_check pcibios_enable_device(struct pci_dev *, int mask); | |||
| 562 | char *pcibios_setup(char *str); | 611 | char *pcibios_setup(char *str); |
| 563 | 612 | ||
| 564 | /* Used only when drivers/pci/setup.c is used */ | 613 | /* Used only when drivers/pci/setup.c is used */ |
| 565 | void pcibios_align_resource(void *, struct resource *, resource_size_t, | 614 | resource_size_t pcibios_align_resource(void *, const struct resource *, |
| 615 | resource_size_t, | ||
| 566 | resource_size_t); | 616 | resource_size_t); |
| 567 | void pcibios_update_irq(struct pci_dev *, int irq); | 617 | void pcibios_update_irq(struct pci_dev *, int irq); |
| 568 | 618 | ||
| 619 | /* Weak but can be overriden by arch */ | ||
| 620 | void pci_fixup_cardbus(struct pci_bus *); | ||
| 621 | |||
| 569 | /* Generic PCI functions used internally */ | 622 | /* Generic PCI functions used internally */ |
| 570 | 623 | ||
| 571 | extern struct pci_bus *pci_find_bus(int domain, int busnr); | 624 | extern struct pci_bus *pci_find_bus(int domain, int busnr); |
| @@ -585,6 +638,7 @@ struct pci_bus *pci_create_bus(struct device *parent, int bus, | |||
| 585 | struct pci_ops *ops, void *sysdata); | 638 | struct pci_ops *ops, void *sysdata); |
| 586 | struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, | 639 | struct pci_bus *pci_add_new_bus(struct pci_bus *parent, struct pci_dev *dev, |
| 587 | int busnr); | 640 | int busnr); |
| 641 | void pcie_update_link_speed(struct pci_bus *bus, u16 link_status); | ||
| 588 | struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr, | 642 | struct pci_slot *pci_create_slot(struct pci_bus *parent, int slot_nr, |
| 589 | const char *name, | 643 | const char *name, |
| 590 | struct hotplug_slot *hotplug); | 644 | struct hotplug_slot *hotplug); |
| @@ -608,15 +662,12 @@ extern void pci_remove_bus_device(struct pci_dev *dev); | |||
| 608 | extern void pci_stop_bus_device(struct pci_dev *dev); | 662 | extern void pci_stop_bus_device(struct pci_dev *dev); |
| 609 | void pci_setup_cardbus(struct pci_bus *bus); | 663 | void pci_setup_cardbus(struct pci_bus *bus); |
| 610 | extern void pci_sort_breadthfirst(void); | 664 | extern void pci_sort_breadthfirst(void); |
| 665 | #define dev_is_pci(d) ((d)->bus == &pci_bus_type) | ||
| 666 | #define dev_is_pf(d) ((dev_is_pci(d) ? to_pci_dev(d)->is_physfn : false)) | ||
| 667 | #define dev_num_vf(d) ((dev_is_pci(d) ? pci_num_vf(to_pci_dev(d)) : 0)) | ||
| 611 | 668 | ||
| 612 | /* Generic PCI functions exported to card drivers */ | 669 | /* Generic PCI functions exported to card drivers */ |
| 613 | 670 | ||
| 614 | #ifdef CONFIG_PCI_LEGACY | ||
| 615 | struct pci_dev __deprecated *pci_find_device(unsigned int vendor, | ||
| 616 | unsigned int device, | ||
| 617 | struct pci_dev *from); | ||
| 618 | #endif /* CONFIG_PCI_LEGACY */ | ||
| 619 | |||
| 620 | enum pci_lost_interrupt_reason { | 671 | enum pci_lost_interrupt_reason { |
| 621 | PCI_LOST_IRQ_NO_INFORMATION = 0, | 672 | PCI_LOST_IRQ_NO_INFORMATION = 0, |
| 622 | PCI_LOST_IRQ_DISABLE_MSI, | 673 | PCI_LOST_IRQ_DISABLE_MSI, |
| @@ -746,11 +797,23 @@ int pci_set_power_state(struct pci_dev *dev, pci_power_t state); | |||
| 746 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); | 797 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); |
| 747 | bool pci_pme_capable(struct pci_dev *dev, pci_power_t state); | 798 | bool pci_pme_capable(struct pci_dev *dev, pci_power_t state); |
| 748 | void pci_pme_active(struct pci_dev *dev, bool enable); | 799 | void pci_pme_active(struct pci_dev *dev, bool enable); |
| 749 | int pci_enable_wake(struct pci_dev *dev, pci_power_t state, bool enable); | 800 | int __pci_enable_wake(struct pci_dev *dev, pci_power_t state, |
| 801 | bool runtime, bool enable); | ||
| 750 | int pci_wake_from_d3(struct pci_dev *dev, bool enable); | 802 | int pci_wake_from_d3(struct pci_dev *dev, bool enable); |
| 751 | pci_power_t pci_target_state(struct pci_dev *dev); | 803 | pci_power_t pci_target_state(struct pci_dev *dev); |
| 752 | int pci_prepare_to_sleep(struct pci_dev *dev); | 804 | int pci_prepare_to_sleep(struct pci_dev *dev); |
| 753 | int pci_back_from_sleep(struct pci_dev *dev); | 805 | int pci_back_from_sleep(struct pci_dev *dev); |
| 806 | bool pci_dev_run_wake(struct pci_dev *dev); | ||
| 807 | |||
| 808 | static inline int pci_enable_wake(struct pci_dev *dev, pci_power_t state, | ||
| 809 | bool enable) | ||
| 810 | { | ||
| 811 | return __pci_enable_wake(dev, state, false, enable); | ||
| 812 | } | ||
| 813 | |||
| 814 | /* For use by arch with custom probe code */ | ||
| 815 | void set_pcie_port_type(struct pci_dev *pdev); | ||
| 816 | void set_pcie_hotplug_bridge(struct pci_dev *pdev); | ||
| 754 | 817 | ||
| 755 | /* Functions for PCI Hotplug drivers to use */ | 818 | /* Functions for PCI Hotplug drivers to use */ |
| 756 | int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); | 819 | int pci_bus_find_capability(struct pci_bus *bus, unsigned int devfn, int cap); |
| @@ -768,6 +831,7 @@ void pci_bus_assign_resources(const struct pci_bus *bus); | |||
| 768 | void pci_bus_size_bridges(struct pci_bus *bus); | 831 | void pci_bus_size_bridges(struct pci_bus *bus); |
| 769 | int pci_claim_resource(struct pci_dev *, int); | 832 | int pci_claim_resource(struct pci_dev *, int); |
| 770 | void pci_assign_unassigned_resources(void); | 833 | void pci_assign_unassigned_resources(void); |
| 834 | void pci_assign_unassigned_bridge_resources(struct pci_dev *bridge); | ||
| 771 | void pdev_enable_device(struct pci_dev *); | 835 | void pdev_enable_device(struct pci_dev *); |
| 772 | void pdev_sort_resources(struct pci_dev *, struct resource_list *); | 836 | void pdev_sort_resources(struct pci_dev *, struct resource_list *); |
| 773 | int pci_enable_resources(struct pci_dev *, int mask); | 837 | int pci_enable_resources(struct pci_dev *, int mask); |
| @@ -785,12 +849,23 @@ int pci_request_selected_regions_exclusive(struct pci_dev *, int, const char *); | |||
| 785 | void pci_release_selected_regions(struct pci_dev *, int); | 849 | void pci_release_selected_regions(struct pci_dev *, int); |
| 786 | 850 | ||
| 787 | /* drivers/pci/bus.c */ | 851 | /* drivers/pci/bus.c */ |
| 852 | void pci_bus_add_resource(struct pci_bus *bus, struct resource *res, unsigned int flags); | ||
| 853 | struct resource *pci_bus_resource_n(const struct pci_bus *bus, int n); | ||
| 854 | void pci_bus_remove_resources(struct pci_bus *bus); | ||
| 855 | |||
| 856 | #define pci_bus_for_each_resource(bus, res, i) \ | ||
| 857 | for (i = 0; \ | ||
| 858 | (res = pci_bus_resource_n(bus, i)) || i < PCI_BRIDGE_RESOURCE_NUM; \ | ||
| 859 | i++) | ||
| 860 | |||
| 788 | int __must_check pci_bus_alloc_resource(struct pci_bus *bus, | 861 | int __must_check pci_bus_alloc_resource(struct pci_bus *bus, |
| 789 | struct resource *res, resource_size_t size, | 862 | struct resource *res, resource_size_t size, |
| 790 | resource_size_t align, resource_size_t min, | 863 | resource_size_t align, resource_size_t min, |
| 791 | unsigned int type_mask, | 864 | unsigned int type_mask, |
| 792 | void (*alignf)(void *, struct resource *, | 865 | resource_size_t (*alignf)(void *, |
| 793 | resource_size_t, resource_size_t), | 866 | const struct resource *, |
| 867 | resource_size_t, | ||
| 868 | resource_size_t), | ||
| 794 | void *alignf_data); | 869 | void *alignf_data); |
| 795 | void pci_enable_bridges(struct pci_bus *bus); | 870 | void pci_enable_bridges(struct pci_bus *bus); |
| 796 | 871 | ||
| @@ -951,6 +1026,11 @@ static inline int pci_proc_domain(struct pci_bus *bus) | |||
| 951 | } | 1026 | } |
| 952 | #endif /* CONFIG_PCI_DOMAINS */ | 1027 | #endif /* CONFIG_PCI_DOMAINS */ |
| 953 | 1028 | ||
| 1029 | /* some architectures require additional setup to direct VGA traffic */ | ||
| 1030 | typedef int (*arch_set_vga_state_t)(struct pci_dev *pdev, bool decode, | ||
| 1031 | unsigned int command_bits, bool change_bridge); | ||
| 1032 | extern void pci_register_set_vga_state(arch_set_vga_state_t func); | ||
| 1033 | |||
| 954 | #else /* CONFIG_PCI is not enabled */ | 1034 | #else /* CONFIG_PCI is not enabled */ |
| 955 | 1035 | ||
| 956 | /* | 1036 | /* |
| @@ -969,13 +1049,6 @@ static inline int pci_proc_domain(struct pci_bus *bus) | |||
| 969 | _PCI_NOP_ALL(read, *) | 1049 | _PCI_NOP_ALL(read, *) |
| 970 | _PCI_NOP_ALL(write,) | 1050 | _PCI_NOP_ALL(write,) |
| 971 | 1051 | ||
| 972 | static inline struct pci_dev *pci_find_device(unsigned int vendor, | ||
| 973 | unsigned int device, | ||
| 974 | struct pci_dev *from) | ||
| 975 | { | ||
| 976 | return NULL; | ||
| 977 | } | ||
| 978 | |||
| 979 | static inline struct pci_dev *pci_get_device(unsigned int vendor, | 1052 | static inline struct pci_dev *pci_get_device(unsigned int vendor, |
| 980 | unsigned int device, | 1053 | unsigned int device, |
| 981 | struct pci_dev *from) | 1054 | struct pci_dev *from) |
| @@ -1125,6 +1198,9 @@ static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, | |||
| 1125 | unsigned int devfn) | 1198 | unsigned int devfn) |
| 1126 | { return NULL; } | 1199 | { return NULL; } |
| 1127 | 1200 | ||
| 1201 | #define dev_is_pci(d) (false) | ||
| 1202 | #define dev_is_pf(d) (false) | ||
| 1203 | #define dev_num_vf(d) (0) | ||
| 1128 | #endif /* CONFIG_PCI */ | 1204 | #endif /* CONFIG_PCI */ |
| 1129 | 1205 | ||
| 1130 | /* Include architecture-dependent settings and functions */ | 1206 | /* Include architecture-dependent settings and functions */ |
| @@ -1233,8 +1309,12 @@ enum pci_fixup_pass { | |||
| 1233 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ | 1309 | DECLARE_PCI_FIXUP_SECTION(.pci_fixup_suspend, \ |
| 1234 | suspend##vendor##device##hook, vendor, device, hook) | 1310 | suspend##vendor##device##hook, vendor, device, hook) |
| 1235 | 1311 | ||
| 1236 | 1312 | #ifdef CONFIG_PCI_QUIRKS | |
| 1237 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); | 1313 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); |
| 1314 | #else | ||
| 1315 | static inline void pci_fixup_device(enum pci_fixup_pass pass, | ||
| 1316 | struct pci_dev *dev) {} | ||
| 1317 | #endif | ||
| 1238 | 1318 | ||
| 1239 | void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); | 1319 | void __iomem *pcim_iomap(struct pci_dev *pdev, int bar, unsigned long maxlen); |
| 1240 | void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr); | 1320 | void pcim_iounmap(struct pci_dev *pdev, void __iomem *addr); |
| @@ -1282,6 +1362,7 @@ void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar); | |||
| 1282 | extern int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn); | 1362 | extern int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn); |
| 1283 | extern void pci_disable_sriov(struct pci_dev *dev); | 1363 | extern void pci_disable_sriov(struct pci_dev *dev); |
| 1284 | extern irqreturn_t pci_sriov_migration(struct pci_dev *dev); | 1364 | extern irqreturn_t pci_sriov_migration(struct pci_dev *dev); |
| 1365 | extern int pci_num_vf(struct pci_dev *dev); | ||
| 1285 | #else | 1366 | #else |
| 1286 | static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) | 1367 | static inline int pci_enable_sriov(struct pci_dev *dev, int nr_virtfn) |
| 1287 | { | 1368 | { |
| @@ -1294,6 +1375,10 @@ static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev) | |||
| 1294 | { | 1375 | { |
| 1295 | return IRQ_NONE; | 1376 | return IRQ_NONE; |
| 1296 | } | 1377 | } |
| 1378 | static inline int pci_num_vf(struct pci_dev *dev) | ||
| 1379 | { | ||
| 1380 | return 0; | ||
| 1381 | } | ||
| 1297 | #endif | 1382 | #endif |
| 1298 | 1383 | ||
| 1299 | #if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) | 1384 | #if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) |
| @@ -1330,5 +1415,93 @@ static inline bool pci_is_pcie(struct pci_dev *dev) | |||
| 1330 | 1415 | ||
| 1331 | void pci_request_acs(void); | 1416 | void pci_request_acs(void); |
| 1332 | 1417 | ||
| 1418 | |||
| 1419 | #define PCI_VPD_LRDT 0x80 /* Large Resource Data Type */ | ||
| 1420 | #define PCI_VPD_LRDT_ID(x) (x | PCI_VPD_LRDT) | ||
| 1421 | |||
| 1422 | /* Large Resource Data Type Tag Item Names */ | ||
| 1423 | #define PCI_VPD_LTIN_ID_STRING 0x02 /* Identifier String */ | ||
| 1424 | #define PCI_VPD_LTIN_RO_DATA 0x10 /* Read-Only Data */ | ||
| 1425 | #define PCI_VPD_LTIN_RW_DATA 0x11 /* Read-Write Data */ | ||
| 1426 | |||
| 1427 | #define PCI_VPD_LRDT_ID_STRING PCI_VPD_LRDT_ID(PCI_VPD_LTIN_ID_STRING) | ||
| 1428 | #define PCI_VPD_LRDT_RO_DATA PCI_VPD_LRDT_ID(PCI_VPD_LTIN_RO_DATA) | ||
| 1429 | #define PCI_VPD_LRDT_RW_DATA PCI_VPD_LRDT_ID(PCI_VPD_LTIN_RW_DATA) | ||
| 1430 | |||
| 1431 | /* Small Resource Data Type Tag Item Names */ | ||
| 1432 | #define PCI_VPD_STIN_END 0x78 /* End */ | ||
| 1433 | |||
| 1434 | #define PCI_VPD_SRDT_END PCI_VPD_STIN_END | ||
| 1435 | |||
| 1436 | #define PCI_VPD_SRDT_TIN_MASK 0x78 | ||
| 1437 | #define PCI_VPD_SRDT_LEN_MASK 0x07 | ||
| 1438 | |||
| 1439 | #define PCI_VPD_LRDT_TAG_SIZE 3 | ||
| 1440 | #define PCI_VPD_SRDT_TAG_SIZE 1 | ||
| 1441 | |||
| 1442 | #define PCI_VPD_INFO_FLD_HDR_SIZE 3 | ||
| 1443 | |||
| 1444 | #define PCI_VPD_RO_KEYWORD_PARTNO "PN" | ||
| 1445 | #define PCI_VPD_RO_KEYWORD_MFR_ID "MN" | ||
| 1446 | #define PCI_VPD_RO_KEYWORD_VENDOR0 "V0" | ||
| 1447 | |||
| 1448 | /** | ||
| 1449 | * pci_vpd_lrdt_size - Extracts the Large Resource Data Type length | ||
| 1450 | * @lrdt: Pointer to the beginning of the Large Resource Data Type tag | ||
| 1451 | * | ||
| 1452 | * Returns the extracted Large Resource Data Type length. | ||
| 1453 | */ | ||
| 1454 | static inline u16 pci_vpd_lrdt_size(const u8 *lrdt) | ||
| 1455 | { | ||
| 1456 | return (u16)lrdt[1] + ((u16)lrdt[2] << 8); | ||
| 1457 | } | ||
| 1458 | |||
| 1459 | /** | ||
| 1460 | * pci_vpd_srdt_size - Extracts the Small Resource Data Type length | ||
| 1461 | * @lrdt: Pointer to the beginning of the Small Resource Data Type tag | ||
| 1462 | * | ||
| 1463 | * Returns the extracted Small Resource Data Type length. | ||
| 1464 | */ | ||
| 1465 | static inline u8 pci_vpd_srdt_size(const u8 *srdt) | ||
| 1466 | { | ||
| 1467 | return (*srdt) & PCI_VPD_SRDT_LEN_MASK; | ||
| 1468 | } | ||
| 1469 | |||
| 1470 | /** | ||
| 1471 | * pci_vpd_info_field_size - Extracts the information field length | ||
| 1472 | * @lrdt: Pointer to the beginning of an information field header | ||
| 1473 | * | ||
| 1474 | * Returns the extracted information field length. | ||
| 1475 | */ | ||
| 1476 | static inline u8 pci_vpd_info_field_size(const u8 *info_field) | ||
| 1477 | { | ||
| 1478 | return info_field[2]; | ||
| 1479 | } | ||
| 1480 | |||
| 1481 | /** | ||
| 1482 | * pci_vpd_find_tag - Locates the Resource Data Type tag provided | ||
| 1483 | * @buf: Pointer to buffered vpd data | ||
| 1484 | * @off: The offset into the buffer at which to begin the search | ||
| 1485 | * @len: The length of the vpd buffer | ||
| 1486 | * @rdt: The Resource Data Type to search for | ||
| 1487 | * | ||
| 1488 | * Returns the index where the Resource Data Type was found or | ||
| 1489 | * -ENOENT otherwise. | ||
| 1490 | */ | ||
| 1491 | int pci_vpd_find_tag(const u8 *buf, unsigned int off, unsigned int len, u8 rdt); | ||
| 1492 | |||
| 1493 | /** | ||
| 1494 | * pci_vpd_find_info_keyword - Locates an information field keyword in the VPD | ||
| 1495 | * @buf: Pointer to buffered vpd data | ||
| 1496 | * @off: The offset into the buffer at which to begin the search | ||
| 1497 | * @len: The length of the buffer area, relative to off, in which to search | ||
| 1498 | * @kw: The keyword to search for | ||
| 1499 | * | ||
| 1500 | * Returns the index where the information field keyword was found or | ||
| 1501 | * -ENOENT otherwise. | ||
| 1502 | */ | ||
| 1503 | int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off, | ||
| 1504 | unsigned int len, const char *kw); | ||
| 1505 | |||
| 1333 | #endif /* __KERNEL__ */ | 1506 | #endif /* __KERNEL__ */ |
| 1334 | #endif /* LINUX_PCI_H */ | 1507 | #endif /* LINUX_PCI_H */ |
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h index 652ba797696..5d09cbafa7d 100644 --- a/include/linux/pci_hotplug.h +++ b/include/linux/pci_hotplug.h | |||
| @@ -28,26 +28,6 @@ | |||
| 28 | #ifndef _PCI_HOTPLUG_H | 28 | #ifndef _PCI_HOTPLUG_H |
| 29 | #define _PCI_HOTPLUG_H | 29 | #define _PCI_HOTPLUG_H |
| 30 | 30 | ||
| 31 | |||
| 32 | /* These values come from the PCI Hotplug Spec */ | ||
| 33 | enum pci_bus_speed { | ||
| 34 | PCI_SPEED_33MHz = 0x00, | ||
| 35 | PCI_SPEED_66MHz = 0x01, | ||
| 36 | PCI_SPEED_66MHz_PCIX = 0x02, | ||
| 37 | PCI_SPEED_100MHz_PCIX = 0x03, | ||
| 38 | PCI_SPEED_133MHz_PCIX = 0x04, | ||
| 39 | PCI_SPEED_66MHz_PCIX_ECC = 0x05, | ||
| 40 | PCI_SPEED_100MHz_PCIX_ECC = 0x06, | ||
| 41 | PCI_SPEED_133MHz_PCIX_ECC = 0x07, | ||
| 42 | PCI_SPEED_66MHz_PCIX_266 = 0x09, | ||
| 43 | PCI_SPEED_100MHz_PCIX_266 = 0x0a, | ||
| 44 | PCI_SPEED_133MHz_PCIX_266 = 0x0b, | ||
| 45 | PCI_SPEED_66MHz_PCIX_533 = 0x11, | ||
| 46 | PCI_SPEED_100MHz_PCIX_533 = 0x12, | ||
| 47 | PCI_SPEED_133MHz_PCIX_533 = 0x13, | ||
| 48 | PCI_SPEED_UNKNOWN = 0xff, | ||
| 49 | }; | ||
| 50 | |||
| 51 | /* These values come from the PCI Express Spec */ | 31 | /* These values come from the PCI Express Spec */ |
| 52 | enum pcie_link_width { | 32 | enum pcie_link_width { |
| 53 | PCIE_LNK_WIDTH_RESRV = 0x00, | 33 | PCIE_LNK_WIDTH_RESRV = 0x00, |
| @@ -61,12 +41,6 @@ enum pcie_link_width { | |||
| 61 | PCIE_LNK_WIDTH_UNKNOWN = 0xFF, | 41 | PCIE_LNK_WIDTH_UNKNOWN = 0xFF, |
| 62 | }; | 42 | }; |
| 63 | 43 | ||
| 64 | enum pcie_link_speed { | ||
| 65 | PCIE_2_5GB = 0x14, | ||
| 66 | PCIE_5_0GB = 0x15, | ||
| 67 | PCIE_LNK_SPEED_UNKNOWN = 0xFF, | ||
| 68 | }; | ||
| 69 | |||
| 70 | /** | 44 | /** |
| 71 | * struct hotplug_slot_ops -the callbacks that the hotplug pci core can use | 45 | * struct hotplug_slot_ops -the callbacks that the hotplug pci core can use |
| 72 | * @owner: The module owner of this structure | 46 | * @owner: The module owner of this structure |
| @@ -89,12 +63,6 @@ enum pcie_link_speed { | |||
| 89 | * @get_adapter_status: Called to get see if an adapter is present in the slot or not. | 63 | * @get_adapter_status: Called to get see if an adapter is present in the slot or not. |
| 90 | * If this field is NULL, the value passed in the struct hotplug_slot_info | 64 | * If this field is NULL, the value passed in the struct hotplug_slot_info |
| 91 | * will be used when this value is requested by a user. | 65 | * will be used when this value is requested by a user. |
| 92 | * @get_max_bus_speed: Called to get the max bus speed for a slot. | ||
| 93 | * If this field is NULL, the value passed in the struct hotplug_slot_info | ||
| 94 | * will be used when this value is requested by a user. | ||
| 95 | * @get_cur_bus_speed: Called to get the current bus speed for a slot. | ||
| 96 | * If this field is NULL, the value passed in the struct hotplug_slot_info | ||
| 97 | * will be used when this value is requested by a user. | ||
| 98 | * | 66 | * |
| 99 | * The table of function pointers that is passed to the hotplug pci core by a | 67 | * The table of function pointers that is passed to the hotplug pci core by a |
| 100 | * hotplug pci driver. These functions are called by the hotplug pci core when | 68 | * hotplug pci driver. These functions are called by the hotplug pci core when |
| @@ -112,17 +80,14 @@ struct hotplug_slot_ops { | |||
| 112 | int (*get_attention_status) (struct hotplug_slot *slot, u8 *value); | 80 | int (*get_attention_status) (struct hotplug_slot *slot, u8 *value); |
| 113 | int (*get_latch_status) (struct hotplug_slot *slot, u8 *value); | 81 | int (*get_latch_status) (struct hotplug_slot *slot, u8 *value); |
| 114 | int (*get_adapter_status) (struct hotplug_slot *slot, u8 *value); | 82 | int (*get_adapter_status) (struct hotplug_slot *slot, u8 *value); |
| 115 | int (*get_max_bus_speed) (struct hotplug_slot *slot, enum pci_bus_speed *value); | ||
| 116 | int (*get_cur_bus_speed) (struct hotplug_slot *slot, enum pci_bus_speed *value); | ||
| 117 | }; | 83 | }; |
| 118 | 84 | ||
| 119 | /** | 85 | /** |
| 120 | * struct hotplug_slot_info - used to notify the hotplug pci core of the state of the slot | 86 | * struct hotplug_slot_info - used to notify the hotplug pci core of the state of the slot |
| 121 | * @power: if power is enabled or not (1/0) | 87 | * @power_status: if power is enabled or not (1/0) |
| 122 | * @attention_status: if the attention light is enabled or not (1/0) | 88 | * @attention_status: if the attention light is enabled or not (1/0) |
| 123 | * @latch_status: if the latch (if any) is open or closed (1/0) | 89 | * @latch_status: if the latch (if any) is open or closed (1/0) |
| 124 | * @adapter_present: if there is a pci board present in the slot or not (1/0) | 90 | * @adapter_status: if there is a pci board present in the slot or not (1/0) |
| 125 | * @address: (domain << 16 | bus << 8 | dev) | ||
| 126 | * | 91 | * |
| 127 | * Used to notify the hotplug pci core of the status of a specific slot. | 92 | * Used to notify the hotplug pci core of the status of a specific slot. |
| 128 | */ | 93 | */ |
| @@ -131,8 +96,6 @@ struct hotplug_slot_info { | |||
| 131 | u8 attention_status; | 96 | u8 attention_status; |
| 132 | u8 latch_status; | 97 | u8 latch_status; |
| 133 | u8 adapter_status; | 98 | u8 adapter_status; |
| 134 | enum pci_bus_speed max_bus_speed; | ||
| 135 | enum pci_bus_speed cur_bus_speed; | ||
| 136 | }; | 99 | }; |
| 137 | 100 | ||
| 138 | /** | 101 | /** |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index cca8a044e2b..0be82432058 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
| @@ -2417,6 +2417,9 @@ | |||
| 2417 | #define PCI_DEVICE_ID_INTEL_82840_HB 0x1a21 | 2417 | #define PCI_DEVICE_ID_INTEL_82840_HB 0x1a21 |
| 2418 | #define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30 | 2418 | #define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30 |
| 2419 | #define PCI_DEVICE_ID_INTEL_IOAT 0x1a38 | 2419 | #define PCI_DEVICE_ID_INTEL_IOAT 0x1a38 |
| 2420 | #define PCI_DEVICE_ID_INTEL_CPT_SMBUS 0x1c22 | ||
| 2421 | #define PCI_DEVICE_ID_INTEL_CPT_LPC1 0x1c42 | ||
| 2422 | #define PCI_DEVICE_ID_INTEL_CPT_LPC2 0x1c43 | ||
| 2420 | #define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 | 2423 | #define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 |
| 2421 | #define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 | 2424 | #define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 |
| 2422 | #define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413 | 2425 | #define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413 |
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h index a7684a51399..794662b2be5 100644 --- a/include/linux/percpu_counter.h +++ b/include/linux/percpu_counter.h | |||
| @@ -98,9 +98,6 @@ static inline void percpu_counter_set(struct percpu_counter *fbc, s64 amount) | |||
| 98 | fbc->count = amount; | 98 | fbc->count = amount; |
| 99 | } | 99 | } |
| 100 | 100 | ||
| 101 | #define __percpu_counter_add(fbc, amount, batch) \ | ||
| 102 | percpu_counter_add(fbc, amount) | ||
| 103 | |||
| 104 | static inline void | 101 | static inline void |
| 105 | percpu_counter_add(struct percpu_counter *fbc, s64 amount) | 102 | percpu_counter_add(struct percpu_counter *fbc, s64 amount) |
| 106 | { | 103 | { |
| @@ -109,6 +106,12 @@ percpu_counter_add(struct percpu_counter *fbc, s64 amount) | |||
| 109 | preempt_enable(); | 106 | preempt_enable(); |
| 110 | } | 107 | } |
| 111 | 108 | ||
| 109 | static inline void | ||
| 110 | __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch) | ||
| 111 | { | ||
| 112 | percpu_counter_add(fbc, amount); | ||
| 113 | } | ||
| 114 | |||
| 112 | static inline s64 percpu_counter_read(struct percpu_counter *fbc) | 115 | static inline s64 percpu_counter_read(struct percpu_counter *fbc) |
| 113 | { | 116 | { |
| 114 | return fbc->count; | 117 | return fbc->count; |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index c66b34f75ee..7b18b4fd5df 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
| @@ -211,11 +211,9 @@ struct perf_event_attr { | |||
| 211 | __u32 wakeup_watermark; /* bytes before wakeup */ | 211 | __u32 wakeup_watermark; /* bytes before wakeup */ |
| 212 | }; | 212 | }; |
| 213 | 213 | ||
| 214 | __u32 __reserved_2; | ||
| 215 | |||
| 216 | __u64 bp_addr; | ||
| 217 | __u32 bp_type; | 214 | __u32 bp_type; |
| 218 | __u32 bp_len; | 215 | __u64 bp_addr; |
| 216 | __u64 bp_len; | ||
| 219 | }; | 217 | }; |
| 220 | 218 | ||
| 221 | /* | 219 | /* |
| @@ -290,7 +288,7 @@ struct perf_event_mmap_page { | |||
| 290 | }; | 288 | }; |
| 291 | 289 | ||
| 292 | #define PERF_RECORD_MISC_CPUMODE_MASK (3 << 0) | 290 | #define PERF_RECORD_MISC_CPUMODE_MASK (3 << 0) |
| 293 | #define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0) | 291 | #define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0) |
| 294 | #define PERF_RECORD_MISC_KERNEL (1 << 0) | 292 | #define PERF_RECORD_MISC_KERNEL (1 << 0) |
| 295 | #define PERF_RECORD_MISC_USER (2 << 0) | 293 | #define PERF_RECORD_MISC_USER (2 << 0) |
| 296 | #define PERF_RECORD_MISC_HYPERVISOR (3 << 0) | 294 | #define PERF_RECORD_MISC_HYPERVISOR (3 << 0) |
| @@ -356,8 +354,8 @@ enum perf_event_type { | |||
| 356 | * u64 stream_id; | 354 | * u64 stream_id; |
| 357 | * }; | 355 | * }; |
| 358 | */ | 356 | */ |
| 359 | PERF_RECORD_THROTTLE = 5, | 357 | PERF_RECORD_THROTTLE = 5, |
| 360 | PERF_RECORD_UNTHROTTLE = 6, | 358 | PERF_RECORD_UNTHROTTLE = 6, |
| 361 | 359 | ||
| 362 | /* | 360 | /* |
| 363 | * struct { | 361 | * struct { |
| @@ -371,10 +369,10 @@ enum perf_event_type { | |||
| 371 | 369 | ||
| 372 | /* | 370 | /* |
| 373 | * struct { | 371 | * struct { |
| 374 | * struct perf_event_header header; | 372 | * struct perf_event_header header; |
| 375 | * u32 pid, tid; | 373 | * u32 pid, tid; |
| 376 | * | 374 | * |
| 377 | * struct read_format values; | 375 | * struct read_format values; |
| 378 | * }; | 376 | * }; |
| 379 | */ | 377 | */ |
| 380 | PERF_RECORD_READ = 8, | 378 | PERF_RECORD_READ = 8, |
| @@ -412,7 +410,7 @@ enum perf_event_type { | |||
| 412 | * char data[size];}&& PERF_SAMPLE_RAW | 410 | * char data[size];}&& PERF_SAMPLE_RAW |
| 413 | * }; | 411 | * }; |
| 414 | */ | 412 | */ |
| 415 | PERF_RECORD_SAMPLE = 9, | 413 | PERF_RECORD_SAMPLE = 9, |
| 416 | 414 | ||
| 417 | PERF_RECORD_MAX, /* non-ABI */ | 415 | PERF_RECORD_MAX, /* non-ABI */ |
| 418 | }; | 416 | }; |
| @@ -478,9 +476,11 @@ struct hw_perf_event { | |||
| 478 | union { | 476 | union { |
| 479 | struct { /* hardware */ | 477 | struct { /* hardware */ |
| 480 | u64 config; | 478 | u64 config; |
| 479 | u64 last_tag; | ||
| 481 | unsigned long config_base; | 480 | unsigned long config_base; |
| 482 | unsigned long event_base; | 481 | unsigned long event_base; |
| 483 | int idx; | 482 | int idx; |
| 483 | int last_cpu; | ||
| 484 | }; | 484 | }; |
| 485 | struct { /* software */ | 485 | struct { /* software */ |
| 486 | s64 remaining; | 486 | s64 remaining; |
| @@ -498,9 +498,8 @@ struct hw_perf_event { | |||
| 498 | atomic64_t period_left; | 498 | atomic64_t period_left; |
| 499 | u64 interrupts; | 499 | u64 interrupts; |
| 500 | 500 | ||
| 501 | u64 freq_count; | 501 | u64 freq_time_stamp; |
| 502 | u64 freq_interrupts; | 502 | u64 freq_count_stamp; |
| 503 | u64 freq_stamp; | ||
| 504 | #endif | 503 | #endif |
| 505 | }; | 504 | }; |
| 506 | 505 | ||
| @@ -512,6 +511,8 @@ struct perf_event; | |||
| 512 | struct pmu { | 511 | struct pmu { |
| 513 | int (*enable) (struct perf_event *event); | 512 | int (*enable) (struct perf_event *event); |
| 514 | void (*disable) (struct perf_event *event); | 513 | void (*disable) (struct perf_event *event); |
| 514 | int (*start) (struct perf_event *event); | ||
| 515 | void (*stop) (struct perf_event *event); | ||
| 515 | void (*read) (struct perf_event *event); | 516 | void (*read) (struct perf_event *event); |
| 516 | void (*unthrottle) (struct perf_event *event); | 517 | void (*unthrottle) (struct perf_event *event); |
| 517 | }; | 518 | }; |
| @@ -565,6 +566,10 @@ typedef void (*perf_overflow_handler_t)(struct perf_event *, int, | |||
| 565 | struct perf_sample_data *, | 566 | struct perf_sample_data *, |
| 566 | struct pt_regs *regs); | 567 | struct pt_regs *regs); |
| 567 | 568 | ||
| 569 | enum perf_group_flag { | ||
| 570 | PERF_GROUP_SOFTWARE = 0x1, | ||
| 571 | }; | ||
| 572 | |||
| 568 | /** | 573 | /** |
| 569 | * struct perf_event - performance event kernel representation: | 574 | * struct perf_event - performance event kernel representation: |
| 570 | */ | 575 | */ |
| @@ -574,6 +579,7 @@ struct perf_event { | |||
| 574 | struct list_head event_entry; | 579 | struct list_head event_entry; |
| 575 | struct list_head sibling_list; | 580 | struct list_head sibling_list; |
| 576 | int nr_siblings; | 581 | int nr_siblings; |
| 582 | int group_flags; | ||
| 577 | struct perf_event *group_leader; | 583 | struct perf_event *group_leader; |
| 578 | struct perf_event *output; | 584 | struct perf_event *output; |
| 579 | const struct pmu *pmu; | 585 | const struct pmu *pmu; |
| @@ -658,7 +664,7 @@ struct perf_event { | |||
| 658 | 664 | ||
| 659 | perf_overflow_handler_t overflow_handler; | 665 | perf_overflow_handler_t overflow_handler; |
| 660 | 666 | ||
| 661 | #ifdef CONFIG_EVENT_PROFILE | 667 | #ifdef CONFIG_EVENT_TRACING |
| 662 | struct event_filter *filter; | 668 | struct event_filter *filter; |
| 663 | #endif | 669 | #endif |
| 664 | 670 | ||
| @@ -683,7 +689,8 @@ struct perf_event_context { | |||
| 683 | */ | 689 | */ |
| 684 | struct mutex mutex; | 690 | struct mutex mutex; |
| 685 | 691 | ||
| 686 | struct list_head group_list; | 692 | struct list_head pinned_groups; |
| 693 | struct list_head flexible_groups; | ||
| 687 | struct list_head event_list; | 694 | struct list_head event_list; |
| 688 | int nr_events; | 695 | int nr_events; |
| 689 | int nr_active; | 696 | int nr_active; |
| @@ -746,10 +753,9 @@ extern int perf_max_events; | |||
| 746 | 753 | ||
| 747 | extern const struct pmu *hw_perf_event_init(struct perf_event *event); | 754 | extern const struct pmu *hw_perf_event_init(struct perf_event *event); |
| 748 | 755 | ||
| 749 | extern void perf_event_task_sched_in(struct task_struct *task, int cpu); | 756 | extern void perf_event_task_sched_in(struct task_struct *task); |
| 750 | extern void perf_event_task_sched_out(struct task_struct *task, | 757 | extern void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next); |
| 751 | struct task_struct *next, int cpu); | 758 | extern void perf_event_task_tick(struct task_struct *task); |
| 752 | extern void perf_event_task_tick(struct task_struct *task, int cpu); | ||
| 753 | extern int perf_event_init_task(struct task_struct *child); | 759 | extern int perf_event_init_task(struct task_struct *child); |
| 754 | extern void perf_event_exit_task(struct task_struct *child); | 760 | extern void perf_event_exit_task(struct task_struct *child); |
| 755 | extern void perf_event_free_task(struct task_struct *task); | 761 | extern void perf_event_free_task(struct task_struct *task); |
| @@ -764,7 +770,7 @@ extern int perf_event_task_disable(void); | |||
| 764 | extern int perf_event_task_enable(void); | 770 | extern int perf_event_task_enable(void); |
| 765 | extern int hw_perf_group_sched_in(struct perf_event *group_leader, | 771 | extern int hw_perf_group_sched_in(struct perf_event *group_leader, |
| 766 | struct perf_cpu_context *cpuctx, | 772 | struct perf_cpu_context *cpuctx, |
| 767 | struct perf_event_context *ctx, int cpu); | 773 | struct perf_event_context *ctx); |
| 768 | extern void perf_event_update_userpage(struct perf_event *event); | 774 | extern void perf_event_update_userpage(struct perf_event *event); |
| 769 | extern int perf_event_release_kernel(struct perf_event *event); | 775 | extern int perf_event_release_kernel(struct perf_event *event); |
| 770 | extern struct perf_event * | 776 | extern struct perf_event * |
| @@ -814,9 +820,14 @@ extern int perf_event_overflow(struct perf_event *event, int nmi, | |||
| 814 | */ | 820 | */ |
| 815 | static inline int is_software_event(struct perf_event *event) | 821 | static inline int is_software_event(struct perf_event *event) |
| 816 | { | 822 | { |
| 817 | return (event->attr.type != PERF_TYPE_RAW) && | 823 | switch (event->attr.type) { |
| 818 | (event->attr.type != PERF_TYPE_HARDWARE) && | 824 | case PERF_TYPE_SOFTWARE: |
| 819 | (event->attr.type != PERF_TYPE_HW_CACHE); | 825 | case PERF_TYPE_TRACEPOINT: |
| 826 | /* for now the breakpoint stuff also works as software event */ | ||
| 827 | case PERF_TYPE_BREAKPOINT: | ||
| 828 | return 1; | ||
| 829 | } | ||
| 830 | return 0; | ||
| 820 | } | 831 | } |
| 821 | 832 | ||
| 822 | extern atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX]; | 833 | extern atomic_t perf_swevent_enabled[PERF_COUNT_SW_MAX]; |
| @@ -848,8 +859,7 @@ extern int sysctl_perf_event_mlock; | |||
| 848 | extern int sysctl_perf_event_sample_rate; | 859 | extern int sysctl_perf_event_sample_rate; |
| 849 | 860 | ||
| 850 | extern void perf_event_init(void); | 861 | extern void perf_event_init(void); |
| 851 | extern void perf_tp_event(int event_id, u64 addr, u64 count, | 862 | extern void perf_tp_event(int event_id, u64 addr, u64 count, void *record, int entry_size); |
| 852 | void *record, int entry_size); | ||
| 853 | extern void perf_bp_event(struct perf_event *event, void *data); | 863 | extern void perf_bp_event(struct perf_event *event, void *data); |
| 854 | 864 | ||
| 855 | #ifndef perf_misc_flags | 865 | #ifndef perf_misc_flags |
| @@ -870,12 +880,12 @@ extern void perf_event_enable(struct perf_event *event); | |||
| 870 | extern void perf_event_disable(struct perf_event *event); | 880 | extern void perf_event_disable(struct perf_event *event); |
| 871 | #else | 881 | #else |
| 872 | static inline void | 882 | static inline void |
| 873 | perf_event_task_sched_in(struct task_struct *task, int cpu) { } | 883 | perf_event_task_sched_in(struct task_struct *task) { } |
| 874 | static inline void | 884 | static inline void |
| 875 | perf_event_task_sched_out(struct task_struct *task, | 885 | perf_event_task_sched_out(struct task_struct *task, |
| 876 | struct task_struct *next, int cpu) { } | 886 | struct task_struct *next) { } |
| 877 | static inline void | 887 | static inline void |
| 878 | perf_event_task_tick(struct task_struct *task, int cpu) { } | 888 | perf_event_task_tick(struct task_struct *task) { } |
| 879 | static inline int perf_event_init_task(struct task_struct *child) { return 0; } | 889 | static inline int perf_event_init_task(struct task_struct *child) { return 0; } |
| 880 | static inline void perf_event_exit_task(struct task_struct *child) { } | 890 | static inline void perf_event_exit_task(struct task_struct *child) { } |
| 881 | static inline void perf_event_free_task(struct task_struct *task) { } | 891 | static inline void perf_event_free_task(struct task_struct *task) { } |
| @@ -890,13 +900,13 @@ static inline void | |||
| 890 | perf_sw_event(u32 event_id, u64 nr, int nmi, | 900 | perf_sw_event(u32 event_id, u64 nr, int nmi, |
| 891 | struct pt_regs *regs, u64 addr) { } | 901 | struct pt_regs *regs, u64 addr) { } |
| 892 | static inline void | 902 | static inline void |
| 893 | perf_bp_event(struct perf_event *event, void *data) { } | 903 | perf_bp_event(struct perf_event *event, void *data) { } |
| 894 | 904 | ||
| 895 | static inline void perf_event_mmap(struct vm_area_struct *vma) { } | 905 | static inline void perf_event_mmap(struct vm_area_struct *vma) { } |
| 896 | static inline void perf_event_comm(struct task_struct *tsk) { } | 906 | static inline void perf_event_comm(struct task_struct *tsk) { } |
| 897 | static inline void perf_event_fork(struct task_struct *tsk) { } | 907 | static inline void perf_event_fork(struct task_struct *tsk) { } |
| 898 | static inline void perf_event_init(void) { } | 908 | static inline void perf_event_init(void) { } |
| 899 | static inline int perf_swevent_get_recursion_context(void) { return -1; } | 909 | static inline int perf_swevent_get_recursion_context(void) { return -1; } |
| 900 | static inline void perf_swevent_put_recursion_context(int rctx) { } | 910 | static inline void perf_swevent_put_recursion_context(int rctx) { } |
| 901 | static inline void perf_event_enable(struct perf_event *event) { } | 911 | static inline void perf_event_enable(struct perf_event *event) { } |
| 902 | static inline void perf_event_disable(struct perf_event *event) { } | 912 | static inline void perf_event_disable(struct perf_event *event) { } |
diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h index 228b0b6306b..0b80c806631 100644 --- a/include/linux/pfkeyv2.h +++ b/include/linux/pfkeyv2.h | |||
| @@ -315,6 +315,7 @@ struct sadb_x_kmaddress { | |||
| 315 | #define SADB_X_EALG_AES_GCM_ICV12 19 | 315 | #define SADB_X_EALG_AES_GCM_ICV12 19 |
| 316 | #define SADB_X_EALG_AES_GCM_ICV16 20 | 316 | #define SADB_X_EALG_AES_GCM_ICV16 20 |
| 317 | #define SADB_X_EALG_CAMELLIACBC 22 | 317 | #define SADB_X_EALG_CAMELLIACBC 22 |
| 318 | #define SADB_X_EALG_NULL_AES_GMAC 23 | ||
| 318 | #define SADB_EALG_MAX 253 /* last EALG */ | 319 | #define SADB_EALG_MAX 253 /* last EALG */ |
| 319 | /* private allocations should use 249-255 (RFC2407) */ | 320 | /* private allocations should use 249-255 (RFC2407) */ |
| 320 | #define SADB_X_EALG_SERPENTCBC 252 /* draft-ietf-ipsec-ciph-aes-cbc-00 */ | 321 | #define SADB_X_EALG_SERPENTCBC 252 /* draft-ietf-ipsec-ciph-aes-cbc-00 */ |
diff --git a/include/linux/phy.h b/include/linux/phy.h index b1368b8f657..14d7fdf6a90 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
| @@ -447,10 +447,12 @@ struct phy_device* get_phy_device(struct mii_bus *bus, int addr); | |||
| 447 | int phy_device_register(struct phy_device *phy); | 447 | int phy_device_register(struct phy_device *phy); |
| 448 | int phy_clear_interrupt(struct phy_device *phydev); | 448 | int phy_clear_interrupt(struct phy_device *phydev); |
| 449 | int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); | 449 | int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); |
| 450 | int phy_init_hw(struct phy_device *phydev); | ||
| 450 | int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, | 451 | int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, |
| 451 | u32 flags, phy_interface_t interface); | 452 | u32 flags, phy_interface_t interface); |
| 452 | struct phy_device * phy_attach(struct net_device *dev, | 453 | struct phy_device * phy_attach(struct net_device *dev, |
| 453 | const char *bus_id, u32 flags, phy_interface_t interface); | 454 | const char *bus_id, u32 flags, phy_interface_t interface); |
| 455 | struct phy_device *phy_find_first(struct mii_bus *bus); | ||
| 454 | int phy_connect_direct(struct net_device *dev, struct phy_device *phydev, | 456 | int phy_connect_direct(struct net_device *dev, struct phy_device *phydev, |
| 455 | void (*handler)(struct net_device *), u32 flags, | 457 | void (*handler)(struct net_device *), u32 flags, |
| 456 | phy_interface_t interface); | 458 | phy_interface_t interface); |
| @@ -484,6 +486,7 @@ void phy_driver_unregister(struct phy_driver *drv); | |||
| 484 | int phy_driver_register(struct phy_driver *new_driver); | 486 | int phy_driver_register(struct phy_driver *new_driver); |
| 485 | void phy_prepare_link(struct phy_device *phydev, | 487 | void phy_prepare_link(struct phy_device *phydev, |
| 486 | void (*adjust_link)(struct net_device *)); | 488 | void (*adjust_link)(struct net_device *)); |
| 489 | void phy_state_machine(struct work_struct *work); | ||
| 487 | void phy_start_machine(struct phy_device *phydev, | 490 | void phy_start_machine(struct phy_device *phydev, |
| 488 | void (*handler)(struct net_device *)); | 491 | void (*handler)(struct net_device *)); |
| 489 | void phy_stop_machine(struct phy_device *phydev); | 492 | void phy_stop_machine(struct phy_device *phydev); |
diff --git a/include/linux/pktcdvd.h b/include/linux/pktcdvd.h index 76e5053e1fa..721301b0a90 100644 --- a/include/linux/pktcdvd.h +++ b/include/linux/pktcdvd.h | |||
| @@ -163,10 +163,8 @@ struct packet_iosched | |||
| 163 | atomic_t attention; /* Set to non-zero when queue processing is needed */ | 163 | atomic_t attention; /* Set to non-zero when queue processing is needed */ |
| 164 | int writing; /* Non-zero when writing, zero when reading */ | 164 | int writing; /* Non-zero when writing, zero when reading */ |
| 165 | spinlock_t lock; /* Protecting read/write queue manipulations */ | 165 | spinlock_t lock; /* Protecting read/write queue manipulations */ |
| 166 | struct bio *read_queue; | 166 | struct bio_list read_queue; |
| 167 | struct bio *read_queue_tail; | 167 | struct bio_list write_queue; |
| 168 | struct bio *write_queue; | ||
| 169 | struct bio *write_queue_tail; | ||
| 170 | sector_t last_write; /* The sector where the last write ended */ | 168 | sector_t last_write; /* The sector where the last write ended */ |
| 171 | int successive_reads; | 169 | int successive_reads; |
| 172 | }; | 170 | }; |
| @@ -206,8 +204,8 @@ struct packet_data | |||
| 206 | spinlock_t lock; /* Lock protecting state transitions and */ | 204 | spinlock_t lock; /* Lock protecting state transitions and */ |
| 207 | /* orig_bios list */ | 205 | /* orig_bios list */ |
| 208 | 206 | ||
| 209 | struct bio *orig_bios; /* Original bios passed to pkt_make_request */ | 207 | struct bio_list orig_bios; /* Original bios passed to pkt_make_request */ |
| 210 | struct bio *orig_bios_tail;/* that will be handled by this packet */ | 208 | /* that will be handled by this packet */ |
| 211 | int write_size; /* Total size of all bios in the orig_bios */ | 209 | int write_size; /* Total size of all bios in the orig_bios */ |
| 212 | /* list, measured in number of frames */ | 210 | /* list, measured in number of frames */ |
| 213 | 211 | ||
diff --git a/include/linux/plist.h b/include/linux/plist.h index 8227f717c70..6898985e7b3 100644 --- a/include/linux/plist.h +++ b/include/linux/plist.h | |||
| @@ -45,7 +45,7 @@ | |||
| 45 | * the insertion of new nodes. There are no nodes with duplicate | 45 | * the insertion of new nodes. There are no nodes with duplicate |
| 46 | * priorites on the list. | 46 | * priorites on the list. |
| 47 | * | 47 | * |
| 48 | * The nodes on the node_list is ordered by priority and can contain | 48 | * The nodes on the node_list are ordered by priority and can contain |
| 49 | * entries which have the same priority. Those entries are ordered | 49 | * entries which have the same priority. Those entries are ordered |
| 50 | * FIFO | 50 | * FIFO |
| 51 | * | 51 | * |
| @@ -265,7 +265,7 @@ static inline int plist_node_empty(const struct plist_node *node) | |||
| 265 | * | 265 | * |
| 266 | * Assumes the plist is _not_ empty. | 266 | * Assumes the plist is _not_ empty. |
| 267 | */ | 267 | */ |
| 268 | static inline struct plist_node* plist_first(const struct plist_head *head) | 268 | static inline struct plist_node *plist_first(const struct plist_head *head) |
| 269 | { | 269 | { |
| 270 | return list_entry(head->node_list.next, | 270 | return list_entry(head->node_list.next, |
| 271 | struct plist_node, plist.node_list); | 271 | struct plist_node, plist.node_list); |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 198b8f9fe05..e80df06ad22 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
| @@ -26,6 +26,7 @@ | |||
| 26 | #include <linux/spinlock.h> | 26 | #include <linux/spinlock.h> |
| 27 | #include <linux/wait.h> | 27 | #include <linux/wait.h> |
| 28 | #include <linux/timer.h> | 28 | #include <linux/timer.h> |
| 29 | #include <linux/completion.h> | ||
| 29 | 30 | ||
| 30 | /* | 31 | /* |
| 31 | * Callbacks for platform drivers to implement. | 32 | * Callbacks for platform drivers to implement. |
| @@ -412,9 +413,11 @@ struct dev_pm_info { | |||
| 412 | pm_message_t power_state; | 413 | pm_message_t power_state; |
| 413 | unsigned int can_wakeup:1; | 414 | unsigned int can_wakeup:1; |
| 414 | unsigned int should_wakeup:1; | 415 | unsigned int should_wakeup:1; |
| 416 | unsigned async_suspend:1; | ||
| 415 | enum dpm_state status; /* Owned by the PM core */ | 417 | enum dpm_state status; /* Owned by the PM core */ |
| 416 | #ifdef CONFIG_PM_SLEEP | 418 | #ifdef CONFIG_PM_SLEEP |
| 417 | struct list_head entry; | 419 | struct list_head entry; |
| 420 | struct completion completion; | ||
| 418 | #endif | 421 | #endif |
| 419 | #ifdef CONFIG_PM_RUNTIME | 422 | #ifdef CONFIG_PM_RUNTIME |
| 420 | struct timer_list suspend_timer; | 423 | struct timer_list suspend_timer; |
| @@ -430,6 +433,7 @@ struct dev_pm_info { | |||
| 430 | unsigned int request_pending:1; | 433 | unsigned int request_pending:1; |
| 431 | unsigned int deferred_resume:1; | 434 | unsigned int deferred_resume:1; |
| 432 | unsigned int run_wake:1; | 435 | unsigned int run_wake:1; |
| 436 | unsigned int runtime_auto:1; | ||
| 433 | enum rpm_request request; | 437 | enum rpm_request request; |
| 434 | enum rpm_status runtime_status; | 438 | enum rpm_status runtime_status; |
| 435 | int runtime_error; | 439 | int runtime_error; |
| @@ -508,6 +512,7 @@ extern void __suspend_report_result(const char *function, void *fn, int ret); | |||
| 508 | __suspend_report_result(__func__, fn, ret); \ | 512 | __suspend_report_result(__func__, fn, ret); \ |
| 509 | } while (0) | 513 | } while (0) |
| 510 | 514 | ||
| 515 | extern void device_pm_wait_for_dev(struct device *sub, struct device *dev); | ||
| 511 | #else /* !CONFIG_PM_SLEEP */ | 516 | #else /* !CONFIG_PM_SLEEP */ |
| 512 | 517 | ||
| 513 | #define device_pm_lock() do {} while (0) | 518 | #define device_pm_lock() do {} while (0) |
| @@ -520,6 +525,7 @@ static inline int dpm_suspend_start(pm_message_t state) | |||
| 520 | 525 | ||
| 521 | #define suspend_report_result(fn, ret) do {} while (0) | 526 | #define suspend_report_result(fn, ret) do {} while (0) |
| 522 | 527 | ||
| 528 | static inline void device_pm_wait_for_dev(struct device *a, struct device *b) {} | ||
| 523 | #endif /* !CONFIG_PM_SLEEP */ | 529 | #endif /* !CONFIG_PM_SLEEP */ |
| 524 | 530 | ||
| 525 | /* How to reorder dpm_list after device_move() */ | 531 | /* How to reorder dpm_list after device_move() */ |
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 370ce0a6fe4..7d773aac531 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
| @@ -28,6 +28,8 @@ extern int __pm_runtime_set_status(struct device *dev, unsigned int status); | |||
| 28 | extern int pm_runtime_barrier(struct device *dev); | 28 | extern int pm_runtime_barrier(struct device *dev); |
| 29 | extern void pm_runtime_enable(struct device *dev); | 29 | extern void pm_runtime_enable(struct device *dev); |
| 30 | extern void __pm_runtime_disable(struct device *dev, bool check_resume); | 30 | extern void __pm_runtime_disable(struct device *dev, bool check_resume); |
| 31 | extern void pm_runtime_allow(struct device *dev); | ||
| 32 | extern void pm_runtime_forbid(struct device *dev); | ||
| 31 | 33 | ||
| 32 | static inline bool pm_children_suspended(struct device *dev) | 34 | static inline bool pm_children_suspended(struct device *dev) |
| 33 | { | 35 | { |
| @@ -78,6 +80,8 @@ static inline int __pm_runtime_set_status(struct device *dev, | |||
| 78 | static inline int pm_runtime_barrier(struct device *dev) { return 0; } | 80 | static inline int pm_runtime_barrier(struct device *dev) { return 0; } |
| 79 | static inline void pm_runtime_enable(struct device *dev) {} | 81 | static inline void pm_runtime_enable(struct device *dev) {} |
| 80 | static inline void __pm_runtime_disable(struct device *dev, bool c) {} | 82 | static inline void __pm_runtime_disable(struct device *dev, bool c) {} |
| 83 | static inline void pm_runtime_allow(struct device *dev) {} | ||
| 84 | static inline void pm_runtime_forbid(struct device *dev) {} | ||
| 81 | 85 | ||
| 82 | static inline bool pm_children_suspended(struct device *dev) { return false; } | 86 | static inline bool pm_children_suspended(struct device *dev) { return false; } |
| 83 | static inline void pm_suspend_ignore_children(struct device *dev, bool en) {} | 87 | static inline void pm_suspend_ignore_children(struct device *dev, bool en) {} |
diff --git a/include/linux/poison.h b/include/linux/poison.h index 7fc194aef8c..2110a81c5e2 100644 --- a/include/linux/poison.h +++ b/include/linux/poison.h | |||
| @@ -2,13 +2,25 @@ | |||
| 2 | #define _LINUX_POISON_H | 2 | #define _LINUX_POISON_H |
| 3 | 3 | ||
| 4 | /********** include/linux/list.h **********/ | 4 | /********** include/linux/list.h **********/ |
| 5 | |||
| 6 | /* | ||
| 7 | * Architectures might want to move the poison pointer offset | ||
| 8 | * into some well-recognized area such as 0xdead000000000000, | ||
| 9 | * that is also not mappable by user-space exploits: | ||
| 10 | */ | ||
| 11 | #ifdef CONFIG_ILLEGAL_POINTER_VALUE | ||
| 12 | # define POISON_POINTER_DELTA _AC(CONFIG_ILLEGAL_POINTER_VALUE, UL) | ||
| 13 | #else | ||
| 14 | # define POISON_POINTER_DELTA 0 | ||
| 15 | #endif | ||
| 16 | |||
| 5 | /* | 17 | /* |
| 6 | * These are non-NULL pointers that will result in page faults | 18 | * These are non-NULL pointers that will result in page faults |
| 7 | * under normal circumstances, used to verify that nobody uses | 19 | * under normal circumstances, used to verify that nobody uses |
| 8 | * non-initialized list entries. | 20 | * non-initialized list entries. |
| 9 | */ | 21 | */ |
| 10 | #define LIST_POISON1 ((void *) 0x00100100) | 22 | #define LIST_POISON1 ((void *) 0x00100100 + POISON_POINTER_DELTA) |
| 11 | #define LIST_POISON2 ((void *) 0x00200200) | 23 | #define LIST_POISON2 ((void *) 0x00200200 + POISON_POINTER_DELTA) |
| 12 | 24 | ||
| 13 | /********** include/linux/timer.h **********/ | 25 | /********** include/linux/timer.h **********/ |
| 14 | /* | 26 | /* |
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 56f2d63a5cb..c5eab89da51 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
| @@ -27,6 +27,26 @@ | |||
| 27 | #define PTRACE_GETSIGINFO 0x4202 | 27 | #define PTRACE_GETSIGINFO 0x4202 |
| 28 | #define PTRACE_SETSIGINFO 0x4203 | 28 | #define PTRACE_SETSIGINFO 0x4203 |
| 29 | 29 | ||
| 30 | /* | ||
| 31 | * Generic ptrace interface that exports the architecture specific regsets | ||
| 32 | * using the corresponding NT_* types (which are also used in the core dump). | ||
| 33 | * Please note that the NT_PRSTATUS note type in a core dump contains a full | ||
| 34 | * 'struct elf_prstatus'. But the user_regset for NT_PRSTATUS contains just the | ||
| 35 | * elf_gregset_t that is the pr_reg field of 'struct elf_prstatus'. For all the | ||
| 36 | * other user_regset flavors, the user_regset layout and the ELF core dump note | ||
| 37 | * payload are exactly the same layout. | ||
| 38 | * | ||
| 39 | * This interface usage is as follows: | ||
| 40 | * struct iovec iov = { buf, len}; | ||
| 41 | * | ||
| 42 | * ret = ptrace(PTRACE_GETREGSET/PTRACE_SETREGSET, pid, NT_XXX_TYPE, &iov); | ||
| 43 | * | ||
| 44 | * On the successful completion, iov.len will be updated by the kernel, | ||
| 45 | * specifying how much the kernel has written/read to/from the user's iov.buf. | ||
| 46 | */ | ||
| 47 | #define PTRACE_GETREGSET 0x4204 | ||
| 48 | #define PTRACE_SETREGSET 0x4205 | ||
| 49 | |||
| 30 | /* options set using PTRACE_SETOPTIONS */ | 50 | /* options set using PTRACE_SETOPTIONS */ |
| 31 | #define PTRACE_O_TRACESYSGOOD 0x00000001 | 51 | #define PTRACE_O_TRACESYSGOOD 0x00000001 |
| 32 | #define PTRACE_O_TRACEFORK 0x00000002 | 52 | #define PTRACE_O_TRACEFORK 0x00000002 |
diff --git a/include/linux/raid_class.h b/include/linux/raid_class.h index 6b537f1ac96..31e1ff69efc 100644 --- a/include/linux/raid_class.h +++ b/include/linux/raid_class.h | |||
| @@ -32,6 +32,7 @@ enum raid_level { | |||
| 32 | RAID_LEVEL_0, | 32 | RAID_LEVEL_0, |
| 33 | RAID_LEVEL_1, | 33 | RAID_LEVEL_1, |
| 34 | RAID_LEVEL_10, | 34 | RAID_LEVEL_10, |
| 35 | RAID_LEVEL_1E, | ||
| 35 | RAID_LEVEL_3, | 36 | RAID_LEVEL_3, |
| 36 | RAID_LEVEL_4, | 37 | RAID_LEVEL_4, |
| 37 | RAID_LEVEL_5, | 38 | RAID_LEVEL_5, |
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index 1bf0f708c4f..2c9b46cff3d 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
| @@ -208,7 +208,7 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
| 208 | * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). | 208 | * primitives such as list_add_rcu() as long as it's guarded by rcu_read_lock(). |
| 209 | */ | 209 | */ |
| 210 | #define list_entry_rcu(ptr, type, member) \ | 210 | #define list_entry_rcu(ptr, type, member) \ |
| 211 | container_of(rcu_dereference(ptr), type, member) | 211 | container_of(rcu_dereference_raw(ptr), type, member) |
| 212 | 212 | ||
| 213 | /** | 213 | /** |
| 214 | * list_first_entry_rcu - get the first element from a list | 214 | * list_first_entry_rcu - get the first element from a list |
| @@ -225,9 +225,9 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
| 225 | list_entry_rcu((ptr)->next, type, member) | 225 | list_entry_rcu((ptr)->next, type, member) |
| 226 | 226 | ||
| 227 | #define __list_for_each_rcu(pos, head) \ | 227 | #define __list_for_each_rcu(pos, head) \ |
| 228 | for (pos = rcu_dereference((head)->next); \ | 228 | for (pos = rcu_dereference_raw((head)->next); \ |
| 229 | pos != (head); \ | 229 | pos != (head); \ |
| 230 | pos = rcu_dereference(pos->next)) | 230 | pos = rcu_dereference_raw(pos->next)) |
| 231 | 231 | ||
| 232 | /** | 232 | /** |
| 233 | * list_for_each_entry_rcu - iterate over rcu list of given type | 233 | * list_for_each_entry_rcu - iterate over rcu list of given type |
| @@ -257,9 +257,9 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
| 257 | * as long as the traversal is guarded by rcu_read_lock(). | 257 | * as long as the traversal is guarded by rcu_read_lock(). |
| 258 | */ | 258 | */ |
| 259 | #define list_for_each_continue_rcu(pos, head) \ | 259 | #define list_for_each_continue_rcu(pos, head) \ |
| 260 | for ((pos) = rcu_dereference((pos)->next); \ | 260 | for ((pos) = rcu_dereference_raw((pos)->next); \ |
| 261 | prefetch((pos)->next), (pos) != (head); \ | 261 | prefetch((pos)->next), (pos) != (head); \ |
| 262 | (pos) = rcu_dereference((pos)->next)) | 262 | (pos) = rcu_dereference_raw((pos)->next)) |
| 263 | 263 | ||
| 264 | /** | 264 | /** |
| 265 | * list_for_each_entry_continue_rcu - continue iteration over list of given type | 265 | * list_for_each_entry_continue_rcu - continue iteration over list of given type |
| @@ -406,6 +406,11 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
| 406 | n->next->pprev = &n->next; | 406 | n->next->pprev = &n->next; |
| 407 | } | 407 | } |
| 408 | 408 | ||
| 409 | #define __hlist_for_each_rcu(pos, head) \ | ||
| 410 | for (pos = rcu_dereference((head)->first); \ | ||
| 411 | pos && ({ prefetch(pos->next); 1; }); \ | ||
| 412 | pos = rcu_dereference(pos->next)) | ||
| 413 | |||
| 409 | /** | 414 | /** |
| 410 | * hlist_for_each_entry_rcu - iterate over rcu list of given type | 415 | * hlist_for_each_entry_rcu - iterate over rcu list of given type |
| 411 | * @tpos: the type * to use as a loop cursor. | 416 | * @tpos: the type * to use as a loop cursor. |
| @@ -418,10 +423,10 @@ static inline void hlist_add_after_rcu(struct hlist_node *prev, | |||
| 418 | * as long as the traversal is guarded by rcu_read_lock(). | 423 | * as long as the traversal is guarded by rcu_read_lock(). |
| 419 | */ | 424 | */ |
| 420 | #define hlist_for_each_entry_rcu(tpos, pos, head, member) \ | 425 | #define hlist_for_each_entry_rcu(tpos, pos, head, member) \ |
| 421 | for (pos = rcu_dereference((head)->first); \ | 426 | for (pos = rcu_dereference_raw((head)->first); \ |
| 422 | pos && ({ prefetch(pos->next); 1; }) && \ | 427 | pos && ({ prefetch(pos->next); 1; }) && \ |
| 423 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ | 428 | ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1; }); \ |
| 424 | pos = rcu_dereference(pos->next)) | 429 | pos = rcu_dereference_raw(pos->next)) |
| 425 | 430 | ||
| 426 | #endif /* __KERNEL__ */ | 431 | #endif /* __KERNEL__ */ |
| 427 | #endif | 432 | #endif |
diff --git a/include/linux/rculist_nulls.h b/include/linux/rculist_nulls.h index 589a40919f0..b70ffe53cb9 100644 --- a/include/linux/rculist_nulls.h +++ b/include/linux/rculist_nulls.h | |||
| @@ -101,10 +101,10 @@ static inline void hlist_nulls_add_head_rcu(struct hlist_nulls_node *n, | |||
| 101 | * | 101 | * |
| 102 | */ | 102 | */ |
| 103 | #define hlist_nulls_for_each_entry_rcu(tpos, pos, head, member) \ | 103 | #define hlist_nulls_for_each_entry_rcu(tpos, pos, head, member) \ |
| 104 | for (pos = rcu_dereference((head)->first); \ | 104 | for (pos = rcu_dereference_raw((head)->first); \ |
| 105 | (!is_a_nulls(pos)) && \ | 105 | (!is_a_nulls(pos)) && \ |
| 106 | ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); 1; }); \ | 106 | ({ tpos = hlist_nulls_entry(pos, typeof(*tpos), member); 1; }); \ |
| 107 | pos = rcu_dereference(pos->next)) | 107 | pos = rcu_dereference_raw(pos->next)) |
| 108 | 108 | ||
| 109 | #endif | 109 | #endif |
| 110 | #endif | 110 | #endif |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 24440f4bf47..c8437362633 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
| @@ -62,6 +62,8 @@ extern int sched_expedited_torture_stats(char *page); | |||
| 62 | 62 | ||
| 63 | /* Internal to kernel */ | 63 | /* Internal to kernel */ |
| 64 | extern void rcu_init(void); | 64 | extern void rcu_init(void); |
| 65 | extern int rcu_scheduler_active; | ||
| 66 | extern void rcu_scheduler_starting(void); | ||
| 65 | 67 | ||
| 66 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) | 68 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) |
| 67 | #include <linux/rcutree.h> | 69 | #include <linux/rcutree.h> |
| @@ -78,14 +80,120 @@ extern void rcu_init(void); | |||
| 78 | } while (0) | 80 | } while (0) |
| 79 | 81 | ||
| 80 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | 82 | #ifdef CONFIG_DEBUG_LOCK_ALLOC |
| 83 | |||
| 81 | extern struct lockdep_map rcu_lock_map; | 84 | extern struct lockdep_map rcu_lock_map; |
| 82 | # define rcu_read_acquire() \ | 85 | # define rcu_read_acquire() \ |
| 83 | lock_acquire(&rcu_lock_map, 0, 0, 2, 1, NULL, _THIS_IP_) | 86 | lock_acquire(&rcu_lock_map, 0, 0, 2, 1, NULL, _THIS_IP_) |
| 84 | # define rcu_read_release() lock_release(&rcu_lock_map, 1, _THIS_IP_) | 87 | # define rcu_read_release() lock_release(&rcu_lock_map, 1, _THIS_IP_) |
| 85 | #else | 88 | |
| 86 | # define rcu_read_acquire() do { } while (0) | 89 | extern struct lockdep_map rcu_bh_lock_map; |
| 87 | # define rcu_read_release() do { } while (0) | 90 | # define rcu_read_acquire_bh() \ |
| 88 | #endif | 91 | lock_acquire(&rcu_bh_lock_map, 0, 0, 2, 1, NULL, _THIS_IP_) |
| 92 | # define rcu_read_release_bh() lock_release(&rcu_bh_lock_map, 1, _THIS_IP_) | ||
| 93 | |||
| 94 | extern struct lockdep_map rcu_sched_lock_map; | ||
| 95 | # define rcu_read_acquire_sched() \ | ||
| 96 | lock_acquire(&rcu_sched_lock_map, 0, 0, 2, 1, NULL, _THIS_IP_) | ||
| 97 | # define rcu_read_release_sched() \ | ||
| 98 | lock_release(&rcu_sched_lock_map, 1, _THIS_IP_) | ||
| 99 | |||
| 100 | /** | ||
| 101 | * rcu_read_lock_held - might we be in RCU read-side critical section? | ||
| 102 | * | ||
| 103 | * If CONFIG_PROVE_LOCKING is selected and enabled, returns nonzero iff in | ||
| 104 | * an RCU read-side critical section. In absence of CONFIG_PROVE_LOCKING, | ||
| 105 | * this assumes we are in an RCU read-side critical section unless it can | ||
| 106 | * prove otherwise. | ||
| 107 | */ | ||
| 108 | static inline int rcu_read_lock_held(void) | ||
| 109 | { | ||
| 110 | if (debug_locks) | ||
| 111 | return lock_is_held(&rcu_lock_map); | ||
| 112 | return 1; | ||
| 113 | } | ||
| 114 | |||
| 115 | /** | ||
| 116 | * rcu_read_lock_bh_held - might we be in RCU-bh read-side critical section? | ||
| 117 | * | ||
| 118 | * If CONFIG_PROVE_LOCKING is selected and enabled, returns nonzero iff in | ||
| 119 | * an RCU-bh read-side critical section. In absence of CONFIG_PROVE_LOCKING, | ||
| 120 | * this assumes we are in an RCU-bh read-side critical section unless it can | ||
| 121 | * prove otherwise. | ||
| 122 | */ | ||
| 123 | static inline int rcu_read_lock_bh_held(void) | ||
| 124 | { | ||
| 125 | if (debug_locks) | ||
| 126 | return lock_is_held(&rcu_bh_lock_map); | ||
| 127 | return 1; | ||
| 128 | } | ||
| 129 | |||
| 130 | /** | ||
| 131 | * rcu_read_lock_sched_held - might we be in RCU-sched read-side critical section? | ||
| 132 | * | ||
| 133 | * If CONFIG_PROVE_LOCKING is selected and enabled, returns nonzero iff in an | ||
| 134 | * RCU-sched read-side critical section. In absence of CONFIG_PROVE_LOCKING, | ||
| 135 | * this assumes we are in an RCU-sched read-side critical section unless it | ||
| 136 | * can prove otherwise. Note that disabling of preemption (including | ||
| 137 | * disabling irqs) counts as an RCU-sched read-side critical section. | ||
| 138 | */ | ||
| 139 | static inline int rcu_read_lock_sched_held(void) | ||
| 140 | { | ||
| 141 | int lockdep_opinion = 0; | ||
| 142 | |||
| 143 | if (debug_locks) | ||
| 144 | lockdep_opinion = lock_is_held(&rcu_sched_lock_map); | ||
| 145 | return lockdep_opinion || preempt_count() != 0 || !rcu_scheduler_active; | ||
| 146 | } | ||
| 147 | |||
| 148 | #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | ||
| 149 | |||
| 150 | # define rcu_read_acquire() do { } while (0) | ||
| 151 | # define rcu_read_release() do { } while (0) | ||
| 152 | # define rcu_read_acquire_bh() do { } while (0) | ||
| 153 | # define rcu_read_release_bh() do { } while (0) | ||
| 154 | # define rcu_read_acquire_sched() do { } while (0) | ||
| 155 | # define rcu_read_release_sched() do { } while (0) | ||
| 156 | |||
| 157 | static inline int rcu_read_lock_held(void) | ||
| 158 | { | ||
| 159 | return 1; | ||
| 160 | } | ||
| 161 | |||
| 162 | static inline int rcu_read_lock_bh_held(void) | ||
| 163 | { | ||
| 164 | return 1; | ||
| 165 | } | ||
| 166 | |||
| 167 | static inline int rcu_read_lock_sched_held(void) | ||
| 168 | { | ||
| 169 | return preempt_count() != 0 || !rcu_scheduler_active; | ||
| 170 | } | ||
| 171 | |||
| 172 | #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | ||
| 173 | |||
| 174 | #ifdef CONFIG_PROVE_RCU | ||
| 175 | |||
| 176 | /** | ||
| 177 | * rcu_dereference_check - rcu_dereference with debug checking | ||
| 178 | * | ||
| 179 | * Do an rcu_dereference(), but check that the context is correct. | ||
| 180 | * For example, rcu_dereference_check(gp, rcu_read_lock_held()) to | ||
| 181 | * ensure that the rcu_dereference_check() executes within an RCU | ||
| 182 | * read-side critical section. It is also possible to check for | ||
| 183 | * locks being held, for example, by using lockdep_is_held(). | ||
| 184 | */ | ||
| 185 | #define rcu_dereference_check(p, c) \ | ||
| 186 | ({ \ | ||
| 187 | if (debug_locks && !(c)) \ | ||
| 188 | lockdep_rcu_dereference(__FILE__, __LINE__); \ | ||
| 189 | rcu_dereference_raw(p); \ | ||
| 190 | }) | ||
| 191 | |||
| 192 | #else /* #ifdef CONFIG_PROVE_RCU */ | ||
| 193 | |||
| 194 | #define rcu_dereference_check(p, c) rcu_dereference_raw(p) | ||
| 195 | |||
| 196 | #endif /* #else #ifdef CONFIG_PROVE_RCU */ | ||
| 89 | 197 | ||
| 90 | /** | 198 | /** |
| 91 | * rcu_read_lock - mark the beginning of an RCU read-side critical section. | 199 | * rcu_read_lock - mark the beginning of an RCU read-side critical section. |
| @@ -160,7 +268,7 @@ static inline void rcu_read_lock_bh(void) | |||
| 160 | { | 268 | { |
| 161 | __rcu_read_lock_bh(); | 269 | __rcu_read_lock_bh(); |
| 162 | __acquire(RCU_BH); | 270 | __acquire(RCU_BH); |
| 163 | rcu_read_acquire(); | 271 | rcu_read_acquire_bh(); |
| 164 | } | 272 | } |
| 165 | 273 | ||
| 166 | /* | 274 | /* |
| @@ -170,7 +278,7 @@ static inline void rcu_read_lock_bh(void) | |||
| 170 | */ | 278 | */ |
| 171 | static inline void rcu_read_unlock_bh(void) | 279 | static inline void rcu_read_unlock_bh(void) |
| 172 | { | 280 | { |
| 173 | rcu_read_release(); | 281 | rcu_read_release_bh(); |
| 174 | __release(RCU_BH); | 282 | __release(RCU_BH); |
| 175 | __rcu_read_unlock_bh(); | 283 | __rcu_read_unlock_bh(); |
| 176 | } | 284 | } |
| @@ -188,7 +296,7 @@ static inline void rcu_read_lock_sched(void) | |||
| 188 | { | 296 | { |
| 189 | preempt_disable(); | 297 | preempt_disable(); |
| 190 | __acquire(RCU_SCHED); | 298 | __acquire(RCU_SCHED); |
| 191 | rcu_read_acquire(); | 299 | rcu_read_acquire_sched(); |
| 192 | } | 300 | } |
| 193 | 301 | ||
| 194 | /* Used by lockdep and tracing: cannot be traced, cannot call lockdep. */ | 302 | /* Used by lockdep and tracing: cannot be traced, cannot call lockdep. */ |
| @@ -205,7 +313,7 @@ static inline notrace void rcu_read_lock_sched_notrace(void) | |||
| 205 | */ | 313 | */ |
| 206 | static inline void rcu_read_unlock_sched(void) | 314 | static inline void rcu_read_unlock_sched(void) |
| 207 | { | 315 | { |
| 208 | rcu_read_release(); | 316 | rcu_read_release_sched(); |
| 209 | __release(RCU_SCHED); | 317 | __release(RCU_SCHED); |
| 210 | preempt_enable(); | 318 | preempt_enable(); |
| 211 | } | 319 | } |
| @@ -219,22 +327,49 @@ static inline notrace void rcu_read_unlock_sched_notrace(void) | |||
| 219 | 327 | ||
| 220 | 328 | ||
| 221 | /** | 329 | /** |
| 222 | * rcu_dereference - fetch an RCU-protected pointer in an | 330 | * rcu_dereference_raw - fetch an RCU-protected pointer |
| 223 | * RCU read-side critical section. This pointer may later | 331 | * |
| 224 | * be safely dereferenced. | 332 | * The caller must be within some flavor of RCU read-side critical |
| 333 | * section, or must be otherwise preventing the pointer from changing, | ||
| 334 | * for example, by holding an appropriate lock. This pointer may later | ||
| 335 | * be safely dereferenced. It is the caller's responsibility to have | ||
| 336 | * done the right thing, as this primitive does no checking of any kind. | ||
| 225 | * | 337 | * |
| 226 | * Inserts memory barriers on architectures that require them | 338 | * Inserts memory barriers on architectures that require them |
| 227 | * (currently only the Alpha), and, more importantly, documents | 339 | * (currently only the Alpha), and, more importantly, documents |
| 228 | * exactly which pointers are protected by RCU. | 340 | * exactly which pointers are protected by RCU. |
| 229 | */ | 341 | */ |
| 230 | 342 | #define rcu_dereference_raw(p) ({ \ | |
| 231 | #define rcu_dereference(p) ({ \ | ||
| 232 | typeof(p) _________p1 = ACCESS_ONCE(p); \ | 343 | typeof(p) _________p1 = ACCESS_ONCE(p); \ |
| 233 | smp_read_barrier_depends(); \ | 344 | smp_read_barrier_depends(); \ |
| 234 | (_________p1); \ | 345 | (_________p1); \ |
| 235 | }) | 346 | }) |
| 236 | 347 | ||
| 237 | /** | 348 | /** |
| 349 | * rcu_dereference - fetch an RCU-protected pointer, checking for RCU | ||
| 350 | * | ||
| 351 | * Makes rcu_dereference_check() do the dirty work. | ||
| 352 | */ | ||
| 353 | #define rcu_dereference(p) \ | ||
| 354 | rcu_dereference_check(p, rcu_read_lock_held()) | ||
| 355 | |||
| 356 | /** | ||
| 357 | * rcu_dereference_bh - fetch an RCU-protected pointer, checking for RCU-bh | ||
| 358 | * | ||
| 359 | * Makes rcu_dereference_check() do the dirty work. | ||
| 360 | */ | ||
| 361 | #define rcu_dereference_bh(p) \ | ||
| 362 | rcu_dereference_check(p, rcu_read_lock_bh_held()) | ||
| 363 | |||
| 364 | /** | ||
| 365 | * rcu_dereference_sched - fetch RCU-protected pointer, checking for RCU-sched | ||
| 366 | * | ||
| 367 | * Makes rcu_dereference_check() do the dirty work. | ||
| 368 | */ | ||
| 369 | #define rcu_dereference_sched(p) \ | ||
| 370 | rcu_dereference_check(p, rcu_read_lock_sched_held()) | ||
| 371 | |||
| 372 | /** | ||
| 238 | * rcu_assign_pointer - assign (publicize) a pointer to a newly | 373 | * rcu_assign_pointer - assign (publicize) a pointer to a newly |
| 239 | * initialized structure that will be dereferenced by RCU read-side | 374 | * initialized structure that will be dereferenced by RCU read-side |
| 240 | * critical sections. Returns the value assigned. | 375 | * critical sections. Returns the value assigned. |
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h index 96cc307ed9f..a5195875480 100644 --- a/include/linux/rcutiny.h +++ b/include/linux/rcutiny.h | |||
| @@ -62,6 +62,18 @@ static inline long rcu_batches_completed_bh(void) | |||
| 62 | 62 | ||
| 63 | extern int rcu_expedited_torture_stats(char *page); | 63 | extern int rcu_expedited_torture_stats(char *page); |
| 64 | 64 | ||
| 65 | static inline void rcu_force_quiescent_state(void) | ||
| 66 | { | ||
| 67 | } | ||
| 68 | |||
| 69 | static inline void rcu_bh_force_quiescent_state(void) | ||
| 70 | { | ||
| 71 | } | ||
| 72 | |||
| 73 | static inline void rcu_sched_force_quiescent_state(void) | ||
| 74 | { | ||
| 75 | } | ||
| 76 | |||
| 65 | #define synchronize_rcu synchronize_sched | 77 | #define synchronize_rcu synchronize_sched |
| 66 | 78 | ||
| 67 | static inline void synchronize_rcu_expedited(void) | 79 | static inline void synchronize_rcu_expedited(void) |
| @@ -93,10 +105,6 @@ static inline void rcu_exit_nohz(void) | |||
| 93 | 105 | ||
| 94 | #endif /* #else #ifdef CONFIG_NO_HZ */ | 106 | #endif /* #else #ifdef CONFIG_NO_HZ */ |
| 95 | 107 | ||
| 96 | static inline void rcu_scheduler_starting(void) | ||
| 97 | { | ||
| 98 | } | ||
| 99 | |||
| 100 | static inline void exit_rcu(void) | 108 | static inline void exit_rcu(void) |
| 101 | { | 109 | { |
| 102 | } | 110 | } |
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 8044b1b9433..42cc3a04779 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
| @@ -35,7 +35,6 @@ struct notifier_block; | |||
| 35 | extern void rcu_sched_qs(int cpu); | 35 | extern void rcu_sched_qs(int cpu); |
| 36 | extern void rcu_bh_qs(int cpu); | 36 | extern void rcu_bh_qs(int cpu); |
| 37 | extern int rcu_needs_cpu(int cpu); | 37 | extern int rcu_needs_cpu(int cpu); |
| 38 | extern void rcu_scheduler_starting(void); | ||
| 39 | extern int rcu_expedited_torture_stats(char *page); | 38 | extern int rcu_expedited_torture_stats(char *page); |
| 40 | 39 | ||
| 41 | #ifdef CONFIG_TREE_PREEMPT_RCU | 40 | #ifdef CONFIG_TREE_PREEMPT_RCU |
| @@ -99,6 +98,9 @@ extern void rcu_check_callbacks(int cpu, int user); | |||
| 99 | extern long rcu_batches_completed(void); | 98 | extern long rcu_batches_completed(void); |
| 100 | extern long rcu_batches_completed_bh(void); | 99 | extern long rcu_batches_completed_bh(void); |
| 101 | extern long rcu_batches_completed_sched(void); | 100 | extern long rcu_batches_completed_sched(void); |
| 101 | extern void rcu_force_quiescent_state(void); | ||
| 102 | extern void rcu_bh_force_quiescent_state(void); | ||
| 103 | extern void rcu_sched_force_quiescent_state(void); | ||
| 102 | 104 | ||
| 103 | #ifdef CONFIG_NO_HZ | 105 | #ifdef CONFIG_NO_HZ |
| 104 | void rcu_enter_nohz(void); | 106 | void rcu_enter_nohz(void); |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index c96c1858fe2..1ba3cf6edfb 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
| @@ -62,6 +62,12 @@ void reiserfs_write_unlock(struct super_block *s); | |||
| 62 | int reiserfs_write_lock_once(struct super_block *s); | 62 | int reiserfs_write_lock_once(struct super_block *s); |
| 63 | void reiserfs_write_unlock_once(struct super_block *s, int lock_depth); | 63 | void reiserfs_write_unlock_once(struct super_block *s, int lock_depth); |
| 64 | 64 | ||
| 65 | #ifdef CONFIG_REISERFS_CHECK | ||
| 66 | void reiserfs_lock_check_recursive(struct super_block *s); | ||
| 67 | #else | ||
| 68 | static inline void reiserfs_lock_check_recursive(struct super_block *s) { } | ||
| 69 | #endif | ||
| 70 | |||
| 65 | /* | 71 | /* |
| 66 | * Several mutexes depend on the write lock. | 72 | * Several mutexes depend on the write lock. |
| 67 | * However sometimes we want to relax the write lock while we hold | 73 | * However sometimes we want to relax the write lock while we hold |
| @@ -92,11 +98,31 @@ void reiserfs_write_unlock_once(struct super_block *s, int lock_depth); | |||
| 92 | static inline void reiserfs_mutex_lock_safe(struct mutex *m, | 98 | static inline void reiserfs_mutex_lock_safe(struct mutex *m, |
| 93 | struct super_block *s) | 99 | struct super_block *s) |
| 94 | { | 100 | { |
| 101 | reiserfs_lock_check_recursive(s); | ||
| 95 | reiserfs_write_unlock(s); | 102 | reiserfs_write_unlock(s); |
| 96 | mutex_lock(m); | 103 | mutex_lock(m); |
| 97 | reiserfs_write_lock(s); | 104 | reiserfs_write_lock(s); |
| 98 | } | 105 | } |
| 99 | 106 | ||
| 107 | static inline void | ||
| 108 | reiserfs_mutex_lock_nested_safe(struct mutex *m, unsigned int subclass, | ||
| 109 | struct super_block *s) | ||
| 110 | { | ||
| 111 | reiserfs_lock_check_recursive(s); | ||
| 112 | reiserfs_write_unlock(s); | ||
| 113 | mutex_lock_nested(m, subclass); | ||
| 114 | reiserfs_write_lock(s); | ||
| 115 | } | ||
| 116 | |||
| 117 | static inline void | ||
| 118 | reiserfs_down_read_safe(struct rw_semaphore *sem, struct super_block *s) | ||
| 119 | { | ||
| 120 | reiserfs_lock_check_recursive(s); | ||
| 121 | reiserfs_write_unlock(s); | ||
| 122 | down_read(sem); | ||
| 123 | reiserfs_write_lock(s); | ||
| 124 | } | ||
| 125 | |||
| 100 | /* | 126 | /* |
| 101 | * When we schedule, we usually want to also release the write lock, | 127 | * When we schedule, we usually want to also release the write lock, |
| 102 | * according to the previous bkl based locking scheme of reiserfs. | 128 | * according to the previous bkl based locking scheme of reiserfs. |
diff --git a/include/linux/resource.h b/include/linux/resource.h index 40fc7e62608..f1e914eefea 100644 --- a/include/linux/resource.h +++ b/include/linux/resource.h | |||
| @@ -3,8 +3,6 @@ | |||
| 3 | 3 | ||
| 4 | #include <linux/time.h> | 4 | #include <linux/time.h> |
| 5 | 5 | ||
| 6 | struct task_struct; | ||
| 7 | |||
| 8 | /* | 6 | /* |
| 9 | * Resource control/accounting header file for linux | 7 | * Resource control/accounting header file for linux |
| 10 | */ | 8 | */ |
| @@ -70,6 +68,12 @@ struct rlimit { | |||
| 70 | */ | 68 | */ |
| 71 | #include <asm/resource.h> | 69 | #include <asm/resource.h> |
| 72 | 70 | ||
| 71 | #ifdef __KERNEL__ | ||
| 72 | |||
| 73 | struct task_struct; | ||
| 74 | |||
| 73 | int getrusage(struct task_struct *p, int who, struct rusage __user *ru); | 75 | int getrusage(struct task_struct *p, int who, struct rusage __user *ru); |
| 74 | 76 | ||
| 77 | #endif /* __KERNEL__ */ | ||
| 78 | |||
| 75 | #endif | 79 | #endif |
diff --git a/include/linux/resume-trace.h b/include/linux/resume-trace.h index c9ba2fdf807..bc8c3881c72 100644 --- a/include/linux/resume-trace.h +++ b/include/linux/resume-trace.h | |||
| @@ -6,6 +6,11 @@ | |||
| 6 | 6 | ||
| 7 | extern int pm_trace_enabled; | 7 | extern int pm_trace_enabled; |
| 8 | 8 | ||
| 9 | static inline int pm_trace_is_enabled(void) | ||
| 10 | { | ||
| 11 | return pm_trace_enabled; | ||
| 12 | } | ||
| 13 | |||
| 9 | struct device; | 14 | struct device; |
| 10 | extern void set_trace_device(struct device *); | 15 | extern void set_trace_device(struct device *); |
| 11 | extern void generate_resume_trace(const void *tracedata, unsigned int user); | 16 | extern void generate_resume_trace(const void *tracedata, unsigned int user); |
| @@ -17,6 +22,8 @@ extern void generate_resume_trace(const void *tracedata, unsigned int user); | |||
| 17 | 22 | ||
| 18 | #else | 23 | #else |
| 19 | 24 | ||
| 25 | static inline int pm_trace_is_enabled(void) { return 0; } | ||
| 26 | |||
| 20 | #define TRACE_DEVICE(dev) do { } while (0) | 27 | #define TRACE_DEVICE(dev) do { } while (0) |
| 21 | #define TRACE_RESUME(dev) do { } while (0) | 28 | #define TRACE_RESUME(dev) do { } while (0) |
| 22 | 29 | ||
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 05330fc5b43..d1c7c90e9cd 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
| @@ -362,6 +362,8 @@ enum { | |||
| 362 | #define RTAX_FEATURES RTAX_FEATURES | 362 | #define RTAX_FEATURES RTAX_FEATURES |
| 363 | RTAX_RTO_MIN, | 363 | RTAX_RTO_MIN, |
| 364 | #define RTAX_RTO_MIN RTAX_RTO_MIN | 364 | #define RTAX_RTO_MIN RTAX_RTO_MIN |
| 365 | RTAX_INITRWND, | ||
| 366 | #define RTAX_INITRWND RTAX_INITRWND | ||
| 365 | __RTAX_MAX | 367 | __RTAX_MAX |
| 366 | }; | 368 | }; |
| 367 | 369 | ||
| @@ -735,6 +737,9 @@ extern void rtnl_lock(void); | |||
| 735 | extern void rtnl_unlock(void); | 737 | extern void rtnl_unlock(void); |
| 736 | extern int rtnl_trylock(void); | 738 | extern int rtnl_trylock(void); |
| 737 | extern int rtnl_is_locked(void); | 739 | extern int rtnl_is_locked(void); |
| 740 | #ifdef CONFIG_PROVE_LOCKING | ||
| 741 | extern int lockdep_rtnl_is_held(void); | ||
| 742 | #endif /* #ifdef CONFIG_PROVE_LOCKING */ | ||
| 738 | 743 | ||
| 739 | extern void rtnetlink_init(void); | 744 | extern void rtnetlink_init(void); |
| 740 | extern void __rtnl_unlock(void); | 745 | extern void __rtnl_unlock(void); |
diff --git a/include/linux/sched.h b/include/linux/sched.h index f2f842db03c..4b1753f7e48 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
| @@ -97,7 +97,7 @@ struct sched_param { | |||
| 97 | struct exec_domain; | 97 | struct exec_domain; |
| 98 | struct futex_pi_state; | 98 | struct futex_pi_state; |
| 99 | struct robust_list_head; | 99 | struct robust_list_head; |
| 100 | struct bio; | 100 | struct bio_list; |
| 101 | struct fs_struct; | 101 | struct fs_struct; |
| 102 | struct bts_context; | 102 | struct bts_context; |
| 103 | struct perf_event_context; | 103 | struct perf_event_context; |
| @@ -310,6 +310,7 @@ extern void sched_show_task(struct task_struct *p); | |||
| 310 | #ifdef CONFIG_DETECT_SOFTLOCKUP | 310 | #ifdef CONFIG_DETECT_SOFTLOCKUP |
| 311 | extern void softlockup_tick(void); | 311 | extern void softlockup_tick(void); |
| 312 | extern void touch_softlockup_watchdog(void); | 312 | extern void touch_softlockup_watchdog(void); |
| 313 | extern void touch_softlockup_watchdog_sync(void); | ||
| 313 | extern void touch_all_softlockup_watchdogs(void); | 314 | extern void touch_all_softlockup_watchdogs(void); |
| 314 | extern int proc_dosoftlockup_thresh(struct ctl_table *table, int write, | 315 | extern int proc_dosoftlockup_thresh(struct ctl_table *table, int write, |
| 315 | void __user *buffer, | 316 | void __user *buffer, |
| @@ -323,6 +324,9 @@ static inline void softlockup_tick(void) | |||
| 323 | static inline void touch_softlockup_watchdog(void) | 324 | static inline void touch_softlockup_watchdog(void) |
| 324 | { | 325 | { |
| 325 | } | 326 | } |
| 327 | static inline void touch_softlockup_watchdog_sync(void) | ||
| 328 | { | ||
| 329 | } | ||
| 326 | static inline void touch_all_softlockup_watchdogs(void) | 330 | static inline void touch_all_softlockup_watchdogs(void) |
| 327 | { | 331 | { |
| 328 | } | 332 | } |
| @@ -377,6 +381,8 @@ extern int sysctl_max_map_count; | |||
| 377 | 381 | ||
| 378 | #include <linux/aio.h> | 382 | #include <linux/aio.h> |
| 379 | 383 | ||
| 384 | #ifdef CONFIG_MMU | ||
| 385 | extern void arch_pick_mmap_layout(struct mm_struct *mm); | ||
| 380 | extern unsigned long | 386 | extern unsigned long |
| 381 | arch_get_unmapped_area(struct file *, unsigned long, unsigned long, | 387 | arch_get_unmapped_area(struct file *, unsigned long, unsigned long, |
| 382 | unsigned long, unsigned long); | 388 | unsigned long, unsigned long); |
| @@ -386,6 +392,9 @@ arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr, | |||
| 386 | unsigned long flags); | 392 | unsigned long flags); |
| 387 | extern void arch_unmap_area(struct mm_struct *, unsigned long); | 393 | extern void arch_unmap_area(struct mm_struct *, unsigned long); |
| 388 | extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); | 394 | extern void arch_unmap_area_topdown(struct mm_struct *, unsigned long); |
| 395 | #else | ||
| 396 | static inline void arch_pick_mmap_layout(struct mm_struct *mm) {} | ||
| 397 | #endif | ||
| 389 | 398 | ||
| 390 | #if USE_SPLIT_PTLOCKS | 399 | #if USE_SPLIT_PTLOCKS |
| 391 | /* | 400 | /* |
| @@ -731,14 +740,6 @@ struct user_struct { | |||
| 731 | uid_t uid; | 740 | uid_t uid; |
| 732 | struct user_namespace *user_ns; | 741 | struct user_namespace *user_ns; |
| 733 | 742 | ||
| 734 | #ifdef CONFIG_USER_SCHED | ||
| 735 | struct task_group *tg; | ||
| 736 | #ifdef CONFIG_SYSFS | ||
| 737 | struct kobject kobj; | ||
| 738 | struct delayed_work work; | ||
| 739 | #endif | ||
| 740 | #endif | ||
| 741 | |||
| 742 | #ifdef CONFIG_PERF_EVENTS | 743 | #ifdef CONFIG_PERF_EVENTS |
| 743 | atomic_long_t locked_vm; | 744 | atomic_long_t locked_vm; |
| 744 | #endif | 745 | #endif |
| @@ -869,7 +870,10 @@ static inline int sd_balance_for_mc_power(void) | |||
| 869 | if (sched_smt_power_savings) | 870 | if (sched_smt_power_savings) |
| 870 | return SD_POWERSAVINGS_BALANCE; | 871 | return SD_POWERSAVINGS_BALANCE; |
| 871 | 872 | ||
| 872 | return SD_PREFER_SIBLING; | 873 | if (!sched_mc_power_savings) |
| 874 | return SD_PREFER_SIBLING; | ||
| 875 | |||
| 876 | return 0; | ||
| 873 | } | 877 | } |
| 874 | 878 | ||
| 875 | static inline int sd_balance_for_package_power(void) | 879 | static inline int sd_balance_for_package_power(void) |
| @@ -1075,7 +1079,8 @@ struct sched_domain; | |||
| 1075 | struct sched_class { | 1079 | struct sched_class { |
| 1076 | const struct sched_class *next; | 1080 | const struct sched_class *next; |
| 1077 | 1081 | ||
| 1078 | void (*enqueue_task) (struct rq *rq, struct task_struct *p, int wakeup); | 1082 | void (*enqueue_task) (struct rq *rq, struct task_struct *p, int wakeup, |
| 1083 | bool head); | ||
| 1079 | void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep); | 1084 | void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep); |
| 1080 | void (*yield_task) (struct rq *rq); | 1085 | void (*yield_task) (struct rq *rq); |
| 1081 | 1086 | ||
| @@ -1087,14 +1092,6 @@ struct sched_class { | |||
| 1087 | #ifdef CONFIG_SMP | 1092 | #ifdef CONFIG_SMP |
| 1088 | int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags); | 1093 | int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags); |
| 1089 | 1094 | ||
| 1090 | unsigned long (*load_balance) (struct rq *this_rq, int this_cpu, | ||
| 1091 | struct rq *busiest, unsigned long max_load_move, | ||
| 1092 | struct sched_domain *sd, enum cpu_idle_type idle, | ||
| 1093 | int *all_pinned, int *this_best_prio); | ||
| 1094 | |||
| 1095 | int (*move_one_task) (struct rq *this_rq, int this_cpu, | ||
| 1096 | struct rq *busiest, struct sched_domain *sd, | ||
| 1097 | enum cpu_idle_type idle); | ||
| 1098 | void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); | 1095 | void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); |
| 1099 | void (*post_schedule) (struct rq *this_rq); | 1096 | void (*post_schedule) (struct rq *this_rq); |
| 1100 | void (*task_waking) (struct rq *this_rq, struct task_struct *task); | 1097 | void (*task_waking) (struct rq *this_rq, struct task_struct *task); |
| @@ -1364,7 +1361,7 @@ struct task_struct { | |||
| 1364 | char comm[TASK_COMM_LEN]; /* executable name excluding path | 1361 | char comm[TASK_COMM_LEN]; /* executable name excluding path |
| 1365 | - access with [gs]et_task_comm (which lock | 1362 | - access with [gs]et_task_comm (which lock |
| 1366 | it with task_lock()) | 1363 | it with task_lock()) |
| 1367 | - initialized normally by flush_old_exec */ | 1364 | - initialized normally by setup_new_exec */ |
| 1368 | /* file system info */ | 1365 | /* file system info */ |
| 1369 | int link_count, total_link_count; | 1366 | int link_count, total_link_count; |
| 1370 | #ifdef CONFIG_SYSVIPC | 1367 | #ifdef CONFIG_SYSVIPC |
| @@ -1457,7 +1454,7 @@ struct task_struct { | |||
| 1457 | void *journal_info; | 1454 | void *journal_info; |
| 1458 | 1455 | ||
| 1459 | /* stacked block device info */ | 1456 | /* stacked block device info */ |
| 1460 | struct bio *bio_list, **bio_tail; | 1457 | struct bio_list *bio_list; |
| 1461 | 1458 | ||
| 1462 | /* VM state */ | 1459 | /* VM state */ |
| 1463 | struct reclaim_state *reclaim_state; | 1460 | struct reclaim_state *reclaim_state; |
| @@ -2491,8 +2488,6 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu) | |||
| 2491 | 2488 | ||
| 2492 | #endif /* CONFIG_SMP */ | 2489 | #endif /* CONFIG_SMP */ |
| 2493 | 2490 | ||
| 2494 | extern void arch_pick_mmap_layout(struct mm_struct *mm); | ||
| 2495 | |||
| 2496 | #ifdef CONFIG_TRACING | 2491 | #ifdef CONFIG_TRACING |
| 2497 | extern void | 2492 | extern void |
| 2498 | __trace_special(void *__tr, void *__data, | 2493 | __trace_special(void *__tr, void *__data, |
| @@ -2510,13 +2505,9 @@ extern long sched_getaffinity(pid_t pid, struct cpumask *mask); | |||
| 2510 | 2505 | ||
| 2511 | extern void normalize_rt_tasks(void); | 2506 | extern void normalize_rt_tasks(void); |
| 2512 | 2507 | ||
| 2513 | #ifdef CONFIG_GROUP_SCHED | 2508 | #ifdef CONFIG_CGROUP_SCHED |
| 2514 | 2509 | ||
| 2515 | extern struct task_group init_task_group; | 2510 | extern struct task_group init_task_group; |
| 2516 | #ifdef CONFIG_USER_SCHED | ||
| 2517 | extern struct task_group root_task_group; | ||
| 2518 | extern void set_tg_uid(struct user_struct *user); | ||
| 2519 | #endif | ||
| 2520 | 2511 | ||
| 2521 | extern struct task_group *sched_create_group(struct task_group *parent); | 2512 | extern struct task_group *sched_create_group(struct task_group *parent); |
| 2522 | extern void sched_destroy_group(struct task_group *tg); | 2513 | extern void sched_destroy_group(struct task_group *tg); |
| @@ -2601,6 +2592,28 @@ static inline void mm_init_owner(struct mm_struct *mm, struct task_struct *p) | |||
| 2601 | } | 2592 | } |
| 2602 | #endif /* CONFIG_MM_OWNER */ | 2593 | #endif /* CONFIG_MM_OWNER */ |
| 2603 | 2594 | ||
| 2595 | static inline unsigned long task_rlimit(const struct task_struct *tsk, | ||
| 2596 | unsigned int limit) | ||
| 2597 | { | ||
| 2598 | return ACCESS_ONCE(tsk->signal->rlim[limit].rlim_cur); | ||
| 2599 | } | ||
| 2600 | |||
| 2601 | static inline unsigned long task_rlimit_max(const struct task_struct *tsk, | ||
| 2602 | unsigned int limit) | ||
| 2603 | { | ||
| 2604 | return ACCESS_ONCE(tsk->signal->rlim[limit].rlim_max); | ||
| 2605 | } | ||
| 2606 | |||
| 2607 | static inline unsigned long rlimit(unsigned int limit) | ||
| 2608 | { | ||
| 2609 | return task_rlimit(current, limit); | ||
| 2610 | } | ||
| 2611 | |||
| 2612 | static inline unsigned long rlimit_max(unsigned int limit) | ||
| 2613 | { | ||
| 2614 | return task_rlimit_max(current, limit); | ||
| 2615 | } | ||
| 2616 | |||
| 2604 | #endif /* __KERNEL__ */ | 2617 | #endif /* __KERNEL__ */ |
| 2605 | 2618 | ||
| 2606 | #endif | 2619 | #endif |
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 8366d8f12e5..03c0232b416 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
| @@ -135,4 +135,22 @@ extern struct list_head *seq_list_start_head(struct list_head *head, | |||
| 135 | extern struct list_head *seq_list_next(void *v, struct list_head *head, | 135 | extern struct list_head *seq_list_next(void *v, struct list_head *head, |
| 136 | loff_t *ppos); | 136 | loff_t *ppos); |
| 137 | 137 | ||
| 138 | /* | ||
| 139 | * Helpers for iteration over hlist_head-s in seq_files | ||
| 140 | */ | ||
| 141 | |||
| 142 | extern struct hlist_node *seq_hlist_start(struct hlist_head *head, | ||
| 143 | loff_t pos); | ||
| 144 | extern struct hlist_node *seq_hlist_start_head(struct hlist_head *head, | ||
| 145 | loff_t pos); | ||
| 146 | extern struct hlist_node *seq_hlist_next(void *v, struct hlist_head *head, | ||
| 147 | loff_t *ppos); | ||
| 148 | |||
| 149 | extern struct hlist_node *seq_hlist_start_rcu(struct hlist_head *head, | ||
| 150 | loff_t pos); | ||
| 151 | extern struct hlist_node *seq_hlist_start_head_rcu(struct hlist_head *head, | ||
| 152 | loff_t pos); | ||
| 153 | extern struct hlist_node *seq_hlist_next_rcu(void *v, | ||
| 154 | struct hlist_head *head, | ||
| 155 | loff_t *ppos); | ||
| 138 | #endif | 156 | #endif |
diff --git a/include/linux/serio.h b/include/linux/serio.h index e2f3044d4a4..64b473066b9 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h | |||
| @@ -30,7 +30,6 @@ struct serio { | |||
| 30 | char phys[32]; | 30 | char phys[32]; |
| 31 | 31 | ||
| 32 | bool manual_bind; | 32 | bool manual_bind; |
| 33 | bool registered; /* port has been fully registered with driver core */ | ||
| 34 | 33 | ||
| 35 | struct serio_device_id id; | 34 | struct serio_device_id id; |
| 36 | 35 | ||
| @@ -136,25 +135,6 @@ static inline void serio_continue_rx(struct serio *serio) | |||
| 136 | spin_unlock_irq(&serio->lock); | 135 | spin_unlock_irq(&serio->lock); |
| 137 | } | 136 | } |
| 138 | 137 | ||
| 139 | /* | ||
| 140 | * Use the following functions to pin serio's driver in process context | ||
| 141 | */ | ||
| 142 | static inline int serio_pin_driver(struct serio *serio) | ||
| 143 | { | ||
| 144 | return mutex_lock_interruptible(&serio->drv_mutex); | ||
| 145 | } | ||
| 146 | |||
| 147 | static inline void serio_pin_driver_uninterruptible(struct serio *serio) | ||
| 148 | { | ||
| 149 | mutex_lock(&serio->drv_mutex); | ||
| 150 | } | ||
| 151 | |||
| 152 | static inline void serio_unpin_driver(struct serio *serio) | ||
| 153 | { | ||
| 154 | mutex_unlock(&serio->drv_mutex); | ||
| 155 | } | ||
| 156 | |||
| 157 | |||
| 158 | #endif | 138 | #endif |
| 159 | 139 | ||
| 160 | /* | 140 | /* |
diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h index 4ef246f1465..51d288d8ac8 100644 --- a/include/linux/sh_intc.h +++ b/include/linux/sh_intc.h | |||
| @@ -45,7 +45,7 @@ struct intc_sense_reg { | |||
| 45 | #define INTC_SMP(stride, nr) | 45 | #define INTC_SMP(stride, nr) |
| 46 | #endif | 46 | #endif |
| 47 | 47 | ||
| 48 | struct intc_desc { | 48 | struct intc_hw_desc { |
| 49 | struct intc_vect *vectors; | 49 | struct intc_vect *vectors; |
| 50 | unsigned int nr_vectors; | 50 | unsigned int nr_vectors; |
| 51 | struct intc_group *groups; | 51 | struct intc_group *groups; |
| @@ -56,29 +56,40 @@ struct intc_desc { | |||
| 56 | unsigned int nr_prio_regs; | 56 | unsigned int nr_prio_regs; |
| 57 | struct intc_sense_reg *sense_regs; | 57 | struct intc_sense_reg *sense_regs; |
| 58 | unsigned int nr_sense_regs; | 58 | unsigned int nr_sense_regs; |
| 59 | char *name; | ||
| 60 | struct intc_mask_reg *ack_regs; | 59 | struct intc_mask_reg *ack_regs; |
| 61 | unsigned int nr_ack_regs; | 60 | unsigned int nr_ack_regs; |
| 62 | }; | 61 | }; |
| 63 | 62 | ||
| 64 | #define _INTC_ARRAY(a) a, sizeof(a)/sizeof(*a) | 63 | #define _INTC_ARRAY(a) a, sizeof(a)/sizeof(*a) |
| 64 | #define INTC_HW_DESC(vectors, groups, mask_regs, \ | ||
| 65 | prio_regs, sense_regs, ack_regs) \ | ||
| 66 | { \ | ||
| 67 | _INTC_ARRAY(vectors), _INTC_ARRAY(groups), \ | ||
| 68 | _INTC_ARRAY(mask_regs), _INTC_ARRAY(prio_regs), \ | ||
| 69 | _INTC_ARRAY(sense_regs), _INTC_ARRAY(ack_regs), \ | ||
| 70 | } | ||
| 71 | |||
| 72 | struct intc_desc { | ||
| 73 | char *name; | ||
| 74 | intc_enum force_enable; | ||
| 75 | intc_enum force_disable; | ||
| 76 | struct intc_hw_desc hw; | ||
| 77 | }; | ||
| 78 | |||
| 65 | #define DECLARE_INTC_DESC(symbol, chipname, vectors, groups, \ | 79 | #define DECLARE_INTC_DESC(symbol, chipname, vectors, groups, \ |
| 66 | mask_regs, prio_regs, sense_regs) \ | 80 | mask_regs, prio_regs, sense_regs) \ |
| 67 | struct intc_desc symbol __initdata = { \ | 81 | struct intc_desc symbol __initdata = { \ |
| 68 | _INTC_ARRAY(vectors), _INTC_ARRAY(groups), \ | 82 | .name = chipname, \ |
| 69 | _INTC_ARRAY(mask_regs), _INTC_ARRAY(prio_regs), \ | 83 | .hw = INTC_HW_DESC(vectors, groups, mask_regs, \ |
| 70 | _INTC_ARRAY(sense_regs), \ | 84 | prio_regs, sense_regs, NULL), \ |
| 71 | chipname, \ | ||
| 72 | } | 85 | } |
| 73 | 86 | ||
| 74 | #define DECLARE_INTC_DESC_ACK(symbol, chipname, vectors, groups, \ | 87 | #define DECLARE_INTC_DESC_ACK(symbol, chipname, vectors, groups, \ |
| 75 | mask_regs, prio_regs, sense_regs, ack_regs) \ | 88 | mask_regs, prio_regs, sense_regs, ack_regs) \ |
| 76 | struct intc_desc symbol __initdata = { \ | 89 | struct intc_desc symbol __initdata = { \ |
| 77 | _INTC_ARRAY(vectors), _INTC_ARRAY(groups), \ | 90 | .name = chipname, \ |
| 78 | _INTC_ARRAY(mask_regs), _INTC_ARRAY(prio_regs), \ | 91 | .hw = INTC_HW_DESC(vectors, groups, mask_regs, \ |
| 79 | _INTC_ARRAY(sense_regs), \ | 92 | prio_regs, sense_regs, ack_regs), \ |
| 80 | chipname, \ | ||
| 81 | _INTC_ARRAY(ack_regs), \ | ||
| 82 | } | 93 | } |
| 83 | 94 | ||
| 84 | void __init register_intc_controller(struct intc_desc *desc); | 95 | void __init register_intc_controller(struct intc_desc *desc); |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index ae836fded53..03f816a9b65 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
| @@ -315,22 +315,23 @@ struct sk_buff { | |||
| 315 | struct sk_buff *next; | 315 | struct sk_buff *next; |
| 316 | struct sk_buff *prev; | 316 | struct sk_buff *prev; |
| 317 | 317 | ||
| 318 | struct sock *sk; | ||
| 319 | ktime_t tstamp; | 318 | ktime_t tstamp; |
| 319 | |||
| 320 | struct sock *sk; | ||
| 320 | struct net_device *dev; | 321 | struct net_device *dev; |
| 321 | 322 | ||
| 322 | unsigned long _skb_dst; | ||
| 323 | #ifdef CONFIG_XFRM | ||
| 324 | struct sec_path *sp; | ||
| 325 | #endif | ||
| 326 | /* | 323 | /* |
| 327 | * This is the control buffer. It is free to use for every | 324 | * This is the control buffer. It is free to use for every |
| 328 | * layer. Please put your private variables there. If you | 325 | * layer. Please put your private variables there. If you |
| 329 | * want to keep them across layers you have to do a skb_clone() | 326 | * want to keep them across layers you have to do a skb_clone() |
| 330 | * first. This is owned by whoever has the skb queued ATM. | 327 | * first. This is owned by whoever has the skb queued ATM. |
| 331 | */ | 328 | */ |
| 332 | char cb[48]; | 329 | char cb[48] __aligned(8); |
| 333 | 330 | ||
| 331 | unsigned long _skb_dst; | ||
| 332 | #ifdef CONFIG_XFRM | ||
| 333 | struct sec_path *sp; | ||
| 334 | #endif | ||
| 334 | unsigned int len, | 335 | unsigned int len, |
| 335 | data_len; | 336 | data_len; |
| 336 | __u16 mac_len, | 337 | __u16 mac_len, |
| @@ -354,8 +355,8 @@ struct sk_buff { | |||
| 354 | ipvs_property:1, | 355 | ipvs_property:1, |
| 355 | peeked:1, | 356 | peeked:1, |
| 356 | nf_trace:1; | 357 | nf_trace:1; |
| 357 | __be16 protocol:16; | ||
| 358 | kmemcheck_bitfield_end(flags1); | 358 | kmemcheck_bitfield_end(flags1); |
| 359 | __be16 protocol; | ||
| 359 | 360 | ||
| 360 | void (*destructor)(struct sk_buff *skb); | 361 | void (*destructor)(struct sk_buff *skb); |
| 361 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 362 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
| @@ -738,7 +739,7 @@ static inline struct sk_buff *skb_unshare(struct sk_buff *skb, | |||
| 738 | } | 739 | } |
| 739 | 740 | ||
| 740 | /** | 741 | /** |
| 741 | * skb_peek | 742 | * skb_peek - peek at the head of an &sk_buff_head |
| 742 | * @list_: list to peek at | 743 | * @list_: list to peek at |
| 743 | * | 744 | * |
| 744 | * Peek an &sk_buff. Unlike most other operations you _MUST_ | 745 | * Peek an &sk_buff. Unlike most other operations you _MUST_ |
| @@ -759,7 +760,7 @@ static inline struct sk_buff *skb_peek(struct sk_buff_head *list_) | |||
| 759 | } | 760 | } |
| 760 | 761 | ||
| 761 | /** | 762 | /** |
| 762 | * skb_peek_tail | 763 | * skb_peek_tail - peek at the tail of an &sk_buff_head |
| 763 | * @list_: list to peek at | 764 | * @list_: list to peek at |
| 764 | * | 765 | * |
| 765 | * Peek an &sk_buff. Unlike most other operations you _MUST_ | 766 | * Peek an &sk_buff. Unlike most other operations you _MUST_ |
diff --git a/include/linux/snmp.h b/include/linux/snmp.h index 0f953fe4041..e28f5a0182e 100644 --- a/include/linux/snmp.h +++ b/include/linux/snmp.h | |||
| @@ -257,6 +257,7 @@ enum | |||
| 257 | LINUX_MIB_XFRMOUTPOLBLOCK, /* XfrmOutPolBlock */ | 257 | LINUX_MIB_XFRMOUTPOLBLOCK, /* XfrmOutPolBlock */ |
| 258 | LINUX_MIB_XFRMOUTPOLDEAD, /* XfrmOutPolDead */ | 258 | LINUX_MIB_XFRMOUTPOLDEAD, /* XfrmOutPolDead */ |
| 259 | LINUX_MIB_XFRMOUTPOLERROR, /* XfrmOutPolError */ | 259 | LINUX_MIB_XFRMOUTPOLERROR, /* XfrmOutPolError */ |
| 260 | LINUX_MIB_XFRMFWDHDRERROR, /* XfrmFwdHdrError*/ | ||
| 260 | __LINUX_MIB_XFRMMAX | 261 | __LINUX_MIB_XFRMMAX |
| 261 | }; | 262 | }; |
| 262 | 263 | ||
diff --git a/include/linux/spi/ad7879.h b/include/linux/spi/ad7879.h index 4231104c9af..6334cee1a3b 100644 --- a/include/linux/spi/ad7879.h +++ b/include/linux/spi/ad7879.h | |||
| @@ -28,8 +28,12 @@ struct ad7879_platform_data { | |||
| 28 | * 1 = 4, 2 = 8, 3 = 16 (median > averaging) | 28 | * 1 = 4, 2 = 8, 3 = 16 (median > averaging) |
| 29 | */ | 29 | */ |
| 30 | u8 median; | 30 | u8 median; |
| 31 | /* 1 = AUX/VBAT/GPIO set to GPIO Output */ | 31 | /* 1 = AUX/VBAT/GPIO export GPIO to gpiolib |
| 32 | u8 gpio_output; | 32 | * requires CONFIG_GPIOLIB |
| 33 | /* Initial GPIO pin state (valid if gpio_output = 1) */ | 33 | */ |
| 34 | u8 gpio_default; | 34 | bool gpio_export; |
| 35 | /* identifies the first GPIO number handled by this chip; | ||
| 36 | * or, if negative, requests dynamic ID allocation. | ||
| 37 | */ | ||
| 38 | s32 gpio_base; | ||
| 35 | }; | 39 | }; |
diff --git a/include/linux/spi/dw_spi.h b/include/linux/spi/dw_spi.h index 51b3e771a9a..cc813f95a2f 100644 --- a/include/linux/spi/dw_spi.h +++ b/include/linux/spi/dw_spi.h | |||
| @@ -90,6 +90,7 @@ struct dw_spi { | |||
| 90 | unsigned long paddr; | 90 | unsigned long paddr; |
| 91 | u32 iolen; | 91 | u32 iolen; |
| 92 | int irq; | 92 | int irq; |
| 93 | u32 fifo_len; /* depth of the FIFO buffer */ | ||
| 93 | u32 max_freq; /* max bus freq supported */ | 94 | u32 max_freq; /* max bus freq supported */ |
| 94 | 95 | ||
| 95 | u16 bus_num; | 96 | u16 bus_num; |
| @@ -171,6 +172,10 @@ static inline void spi_chip_sel(struct dw_spi *dws, u16 cs) | |||
| 171 | { | 172 | { |
| 172 | if (cs > dws->num_cs) | 173 | if (cs > dws->num_cs) |
| 173 | return; | 174 | return; |
| 175 | |||
| 176 | if (dws->cs_control) | ||
| 177 | dws->cs_control(1); | ||
| 178 | |||
| 174 | dw_writel(dws, ser, 1 << cs); | 179 | dw_writel(dws, ser, 1 << cs); |
| 175 | } | 180 | } |
| 176 | 181 | ||
diff --git a/include/linux/srcu.h b/include/linux/srcu.h index 4765d97dcaf..3084f80909c 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h | |||
| @@ -35,6 +35,9 @@ struct srcu_struct { | |||
| 35 | int completed; | 35 | int completed; |
| 36 | struct srcu_struct_array *per_cpu_ref; | 36 | struct srcu_struct_array *per_cpu_ref; |
| 37 | struct mutex mutex; | 37 | struct mutex mutex; |
| 38 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
| 39 | struct lockdep_map dep_map; | ||
| 40 | #endif /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | ||
| 38 | }; | 41 | }; |
| 39 | 42 | ||
| 40 | #ifndef CONFIG_PREEMPT | 43 | #ifndef CONFIG_PREEMPT |
| @@ -43,12 +46,100 @@ struct srcu_struct { | |||
| 43 | #define srcu_barrier() | 46 | #define srcu_barrier() |
| 44 | #endif /* #else #ifndef CONFIG_PREEMPT */ | 47 | #endif /* #else #ifndef CONFIG_PREEMPT */ |
| 45 | 48 | ||
| 49 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
| 50 | |||
| 51 | int __init_srcu_struct(struct srcu_struct *sp, const char *name, | ||
| 52 | struct lock_class_key *key); | ||
| 53 | |||
| 54 | #define init_srcu_struct(sp) \ | ||
| 55 | ({ \ | ||
| 56 | static struct lock_class_key __srcu_key; \ | ||
| 57 | \ | ||
| 58 | __init_srcu_struct((sp), #sp, &__srcu_key); \ | ||
| 59 | }) | ||
| 60 | |||
| 61 | # define srcu_read_acquire(sp) \ | ||
| 62 | lock_acquire(&(sp)->dep_map, 0, 0, 2, 1, NULL, _THIS_IP_) | ||
| 63 | # define srcu_read_release(sp) \ | ||
| 64 | lock_release(&(sp)->dep_map, 1, _THIS_IP_) | ||
| 65 | |||
| 66 | #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | ||
| 67 | |||
| 46 | int init_srcu_struct(struct srcu_struct *sp); | 68 | int init_srcu_struct(struct srcu_struct *sp); |
| 69 | |||
| 70 | # define srcu_read_acquire(sp) do { } while (0) | ||
| 71 | # define srcu_read_release(sp) do { } while (0) | ||
| 72 | |||
| 73 | #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | ||
| 74 | |||
| 47 | void cleanup_srcu_struct(struct srcu_struct *sp); | 75 | void cleanup_srcu_struct(struct srcu_struct *sp); |
| 48 | int srcu_read_lock(struct srcu_struct *sp) __acquires(sp); | 76 | int __srcu_read_lock(struct srcu_struct *sp) __acquires(sp); |
| 49 | void srcu_read_unlock(struct srcu_struct *sp, int idx) __releases(sp); | 77 | void __srcu_read_unlock(struct srcu_struct *sp, int idx) __releases(sp); |
| 50 | void synchronize_srcu(struct srcu_struct *sp); | 78 | void synchronize_srcu(struct srcu_struct *sp); |
| 51 | void synchronize_srcu_expedited(struct srcu_struct *sp); | 79 | void synchronize_srcu_expedited(struct srcu_struct *sp); |
| 52 | long srcu_batches_completed(struct srcu_struct *sp); | 80 | long srcu_batches_completed(struct srcu_struct *sp); |
| 53 | 81 | ||
| 82 | #ifdef CONFIG_DEBUG_LOCK_ALLOC | ||
| 83 | |||
| 84 | /** | ||
| 85 | * srcu_read_lock_held - might we be in SRCU read-side critical section? | ||
| 86 | * | ||
| 87 | * If CONFIG_PROVE_LOCKING is selected and enabled, returns nonzero iff in | ||
| 88 | * an SRCU read-side critical section. In absence of CONFIG_PROVE_LOCKING, | ||
| 89 | * this assumes we are in an SRCU read-side critical section unless it can | ||
| 90 | * prove otherwise. | ||
| 91 | */ | ||
| 92 | static inline int srcu_read_lock_held(struct srcu_struct *sp) | ||
| 93 | { | ||
| 94 | if (debug_locks) | ||
| 95 | return lock_is_held(&sp->dep_map); | ||
| 96 | return 1; | ||
| 97 | } | ||
| 98 | |||
| 99 | #else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | ||
| 100 | |||
| 101 | static inline int srcu_read_lock_held(struct srcu_struct *sp) | ||
| 102 | { | ||
| 103 | return 1; | ||
| 104 | } | ||
| 105 | |||
| 106 | #endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ | ||
| 107 | |||
| 108 | /** | ||
| 109 | * srcu_dereference - fetch SRCU-protected pointer with checking | ||
| 110 | * | ||
| 111 | * Makes rcu_dereference_check() do the dirty work. | ||
| 112 | */ | ||
| 113 | #define srcu_dereference(p, sp) \ | ||
| 114 | rcu_dereference_check(p, srcu_read_lock_held(sp)) | ||
| 115 | |||
| 116 | /** | ||
| 117 | * srcu_read_lock - register a new reader for an SRCU-protected structure. | ||
| 118 | * @sp: srcu_struct in which to register the new reader. | ||
| 119 | * | ||
| 120 | * Enter an SRCU read-side critical section. Note that SRCU read-side | ||
| 121 | * critical sections may be nested. | ||
| 122 | */ | ||
| 123 | static inline int srcu_read_lock(struct srcu_struct *sp) __acquires(sp) | ||
| 124 | { | ||
| 125 | int retval = __srcu_read_lock(sp); | ||
| 126 | |||
| 127 | srcu_read_acquire(sp); | ||
| 128 | return retval; | ||
| 129 | } | ||
| 130 | |||
| 131 | /** | ||
| 132 | * srcu_read_unlock - unregister a old reader from an SRCU-protected structure. | ||
| 133 | * @sp: srcu_struct in which to unregister the old reader. | ||
| 134 | * @idx: return value from corresponding srcu_read_lock(). | ||
| 135 | * | ||
| 136 | * Exit an SRCU read-side critical section. | ||
| 137 | */ | ||
| 138 | static inline void srcu_read_unlock(struct srcu_struct *sp, int idx) | ||
| 139 | __releases(sp) | ||
| 140 | { | ||
| 141 | srcu_read_release(sp); | ||
| 142 | __srcu_read_unlock(sp, idx); | ||
| 143 | } | ||
| 144 | |||
| 54 | #endif | 145 | #endif |
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h new file mode 100644 index 00000000000..32bfd1a8a48 --- /dev/null +++ b/include/linux/stmmac.h | |||
| @@ -0,0 +1,53 @@ | |||
| 1 | /******************************************************************************* | ||
| 2 | |||
| 3 | Header file for stmmac platform data | ||
| 4 | |||
| 5 | Copyright (C) 2009 STMicroelectronics Ltd | ||
| 6 | |||
| 7 | This program is free software; you can redistribute it and/or modify it | ||
| 8 | under the terms and conditions of the GNU General Public License, | ||
| 9 | version 2, as published by the Free Software Foundation. | ||
| 10 | |||
| 11 | This program is distributed in the hope it will be useful, but WITHOUT | ||
| 12 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
| 13 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
| 14 | more details. | ||
| 15 | |||
| 16 | You should have received a copy of the GNU General Public License along with | ||
| 17 | this program; if not, write to the Free Software Foundation, Inc., | ||
| 18 | 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
| 19 | |||
| 20 | The full GNU General Public License is included in this distribution in | ||
| 21 | the file called "COPYING". | ||
| 22 | |||
| 23 | Author: Giuseppe Cavallaro <peppe.cavallaro@st.com> | ||
| 24 | *******************************************************************************/ | ||
| 25 | |||
| 26 | #ifndef __STMMAC_PLATFORM_DATA | ||
| 27 | #define __STMMAC_PLATFORM_DATA | ||
| 28 | |||
| 29 | /* platfrom data for platfrom device structure's platfrom_data field */ | ||
| 30 | |||
| 31 | /* Private data for the STM on-board ethernet driver */ | ||
| 32 | struct plat_stmmacenet_data { | ||
| 33 | int bus_id; | ||
| 34 | int pbl; | ||
| 35 | int has_gmac; | ||
| 36 | void (*fix_mac_speed)(void *priv, unsigned int speed); | ||
| 37 | void (*bus_setup)(unsigned long ioaddr); | ||
| 38 | #ifdef CONFIG_STM_DRIVERS | ||
| 39 | struct stm_pad_config *pad_config; | ||
| 40 | #endif | ||
| 41 | void *bsp_priv; | ||
| 42 | }; | ||
| 43 | |||
| 44 | struct plat_stmmacphy_data { | ||
| 45 | int bus_id; | ||
| 46 | int phy_addr; | ||
| 47 | unsigned int phy_mask; | ||
| 48 | int interface; | ||
| 49 | int (*phy_reset)(void *priv); | ||
| 50 | void *priv; | ||
| 51 | }; | ||
| 52 | #endif | ||
| 53 | |||
diff --git a/include/linux/string.h b/include/linux/string.h index 651839a2a75..a716ee2a8ad 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
| @@ -72,7 +72,10 @@ static inline __must_check char *strstrip(char *str) | |||
| 72 | } | 72 | } |
| 73 | 73 | ||
| 74 | #ifndef __HAVE_ARCH_STRSTR | 74 | #ifndef __HAVE_ARCH_STRSTR |
| 75 | extern char * strstr(const char *,const char *); | 75 | extern char * strstr(const char *, const char *); |
| 76 | #endif | ||
| 77 | #ifndef __HAVE_ARCH_STRNSTR | ||
| 78 | extern char * strnstr(const char *, const char *, size_t); | ||
| 76 | #endif | 79 | #endif |
| 77 | #ifndef __HAVE_ARCH_STRLEN | 80 | #ifndef __HAVE_ARCH_STRLEN |
| 78 | extern __kernel_size_t strlen(const char *); | 81 | extern __kernel_size_t strlen(const char *); |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 65793e90d6f..8126f239edf 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
| @@ -99,7 +99,7 @@ struct perf_event_attr; | |||
| 99 | #define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__) | 99 | #define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__) |
| 100 | #define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) | 100 | #define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) |
| 101 | 101 | ||
| 102 | #ifdef CONFIG_EVENT_PROFILE | 102 | #ifdef CONFIG_PERF_EVENTS |
| 103 | 103 | ||
| 104 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) \ | 104 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) \ |
| 105 | .profile_enable = prof_sysenter_enable, \ | 105 | .profile_enable = prof_sysenter_enable, \ |
| @@ -113,7 +113,7 @@ struct perf_event_attr; | |||
| 113 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) | 113 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) |
| 114 | #define TRACE_SYS_EXIT_PROFILE(sname) | 114 | #define TRACE_SYS_EXIT_PROFILE(sname) |
| 115 | #define TRACE_SYS_EXIT_PROFILE_INIT(sname) | 115 | #define TRACE_SYS_EXIT_PROFILE_INIT(sname) |
| 116 | #endif | 116 | #endif /* CONFIG_PERF_EVENTS */ |
| 117 | 117 | ||
| 118 | #ifdef CONFIG_FTRACE_SYSCALLS | 118 | #ifdef CONFIG_FTRACE_SYSCALLS |
| 119 | #define __SC_STR_ADECL1(t, a) #a | 119 | #define __SC_STR_ADECL1(t, a) #a |
| @@ -132,7 +132,8 @@ struct perf_event_attr; | |||
| 132 | 132 | ||
| 133 | #define SYSCALL_TRACE_ENTER_EVENT(sname) \ | 133 | #define SYSCALL_TRACE_ENTER_EVENT(sname) \ |
| 134 | static const struct syscall_metadata __syscall_meta_##sname; \ | 134 | static const struct syscall_metadata __syscall_meta_##sname; \ |
| 135 | static struct ftrace_event_call event_enter_##sname; \ | 135 | static struct ftrace_event_call \ |
| 136 | __attribute__((__aligned__(4))) event_enter_##sname; \ | ||
| 136 | static struct trace_event enter_syscall_print_##sname = { \ | 137 | static struct trace_event enter_syscall_print_##sname = { \ |
| 137 | .trace = print_syscall_enter, \ | 138 | .trace = print_syscall_enter, \ |
| 138 | }; \ | 139 | }; \ |
| @@ -143,8 +144,7 @@ struct perf_event_attr; | |||
| 143 | .name = "sys_enter"#sname, \ | 144 | .name = "sys_enter"#sname, \ |
| 144 | .system = "syscalls", \ | 145 | .system = "syscalls", \ |
| 145 | .event = &enter_syscall_print_##sname, \ | 146 | .event = &enter_syscall_print_##sname, \ |
| 146 | .raw_init = trace_event_raw_init, \ | 147 | .raw_init = init_syscall_trace, \ |
| 147 | .show_format = syscall_enter_format, \ | ||
| 148 | .define_fields = syscall_enter_define_fields, \ | 148 | .define_fields = syscall_enter_define_fields, \ |
| 149 | .regfunc = reg_event_syscall_enter, \ | 149 | .regfunc = reg_event_syscall_enter, \ |
| 150 | .unregfunc = unreg_event_syscall_enter, \ | 150 | .unregfunc = unreg_event_syscall_enter, \ |
| @@ -154,7 +154,8 @@ struct perf_event_attr; | |||
| 154 | 154 | ||
| 155 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ | 155 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ |
| 156 | static const struct syscall_metadata __syscall_meta_##sname; \ | 156 | static const struct syscall_metadata __syscall_meta_##sname; \ |
| 157 | static struct ftrace_event_call event_exit_##sname; \ | 157 | static struct ftrace_event_call \ |
| 158 | __attribute__((__aligned__(4))) event_exit_##sname; \ | ||
| 158 | static struct trace_event exit_syscall_print_##sname = { \ | 159 | static struct trace_event exit_syscall_print_##sname = { \ |
| 159 | .trace = print_syscall_exit, \ | 160 | .trace = print_syscall_exit, \ |
| 160 | }; \ | 161 | }; \ |
| @@ -165,8 +166,7 @@ struct perf_event_attr; | |||
| 165 | .name = "sys_exit"#sname, \ | 166 | .name = "sys_exit"#sname, \ |
| 166 | .system = "syscalls", \ | 167 | .system = "syscalls", \ |
| 167 | .event = &exit_syscall_print_##sname, \ | 168 | .event = &exit_syscall_print_##sname, \ |
| 168 | .raw_init = trace_event_raw_init, \ | 169 | .raw_init = init_syscall_trace, \ |
| 169 | .show_format = syscall_exit_format, \ | ||
| 170 | .define_fields = syscall_exit_define_fields, \ | 170 | .define_fields = syscall_exit_define_fields, \ |
| 171 | .regfunc = reg_event_syscall_exit, \ | 171 | .regfunc = reg_event_syscall_exit, \ |
| 172 | .unregfunc = unreg_event_syscall_exit, \ | 172 | .unregfunc = unreg_event_syscall_exit, \ |
| @@ -195,7 +195,7 @@ struct perf_event_attr; | |||
| 195 | static const struct syscall_metadata __used \ | 195 | static const struct syscall_metadata __used \ |
| 196 | __attribute__((__aligned__(4))) \ | 196 | __attribute__((__aligned__(4))) \ |
| 197 | __attribute__((section("__syscalls_metadata"))) \ | 197 | __attribute__((section("__syscalls_metadata"))) \ |
| 198 | __syscall_meta_##sname = { \ | 198 | __syscall_meta__##sname = { \ |
| 199 | .name = "sys_"#sname, \ | 199 | .name = "sys_"#sname, \ |
| 200 | .nb_args = 0, \ | 200 | .nb_args = 0, \ |
| 201 | .enter_event = &event_enter__##sname, \ | 201 | .enter_event = &event_enter__##sname, \ |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 877ba039e6a..f66014c90c9 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
| @@ -481,8 +481,6 @@ enum | |||
| 481 | NET_IPV4_CONF_PROMOTE_SECONDARIES=20, | 481 | NET_IPV4_CONF_PROMOTE_SECONDARIES=20, |
| 482 | NET_IPV4_CONF_ARP_ACCEPT=21, | 482 | NET_IPV4_CONF_ARP_ACCEPT=21, |
| 483 | NET_IPV4_CONF_ARP_NOTIFY=22, | 483 | NET_IPV4_CONF_ARP_NOTIFY=22, |
| 484 | NET_IPV4_CONF_ACCEPT_LOCAL=23, | ||
| 485 | __NET_IPV4_CONF_MAX | ||
| 486 | }; | 484 | }; |
| 487 | 485 | ||
| 488 | /* /proc/sys/net/ipv4/netfilter */ | 486 | /* /proc/sys/net/ipv4/netfilter */ |
| @@ -598,7 +596,6 @@ enum { | |||
| 598 | NET_NEIGH_GC_THRESH3=16, | 596 | NET_NEIGH_GC_THRESH3=16, |
| 599 | NET_NEIGH_RETRANS_TIME_MS=17, | 597 | NET_NEIGH_RETRANS_TIME_MS=17, |
| 600 | NET_NEIGH_REACHABLE_TIME_MS=18, | 598 | NET_NEIGH_REACHABLE_TIME_MS=18, |
| 601 | __NET_NEIGH_MAX | ||
| 602 | }; | 599 | }; |
| 603 | 600 | ||
| 604 | /* /proc/sys/net/dccp */ | 601 | /* /proc/sys/net/dccp */ |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 7fee8a4df93..a778ee02459 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
| @@ -103,6 +103,8 @@ enum { | |||
| 103 | #define TCP_CONGESTION 13 /* Congestion control algorithm */ | 103 | #define TCP_CONGESTION 13 /* Congestion control algorithm */ |
| 104 | #define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */ | 104 | #define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */ |
| 105 | #define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */ | 105 | #define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */ |
| 106 | #define TCP_THIN_LINEAR_TIMEOUTS 16 /* Use linear timeouts for thin streams*/ | ||
| 107 | #define TCP_THIN_DUPACK 17 /* Fast retrans. after 1 dupack */ | ||
| 106 | 108 | ||
| 107 | /* for TCP_INFO socket option */ | 109 | /* for TCP_INFO socket option */ |
| 108 | #define TCPI_OPT_TIMESTAMPS 1 | 110 | #define TCPI_OPT_TIMESTAMPS 1 |
| @@ -340,7 +342,10 @@ struct tcp_sock { | |||
| 340 | u32 frto_highmark; /* snd_nxt when RTO occurred */ | 342 | u32 frto_highmark; /* snd_nxt when RTO occurred */ |
| 341 | u16 advmss; /* Advertised MSS */ | 343 | u16 advmss; /* Advertised MSS */ |
| 342 | u8 frto_counter; /* Number of new acks after RTO */ | 344 | u8 frto_counter; /* Number of new acks after RTO */ |
| 343 | u8 nonagle; /* Disable Nagle algorithm? */ | 345 | u8 nonagle : 4,/* Disable Nagle algorithm? */ |
| 346 | thin_lto : 1,/* Use linear timeouts for thin streams */ | ||
| 347 | thin_dupack : 1,/* Fast retransmit on first dupack */ | ||
| 348 | unused : 2; | ||
| 344 | 349 | ||
| 345 | /* RTT measurement */ | 350 | /* RTT measurement */ |
| 346 | u32 srtt; /* smoothed round trip time << 3 */ | 351 | u32 srtt; /* smoothed round trip time << 3 */ |
diff --git a/include/linux/timex.h b/include/linux/timex.h index 94f8faecdcb..7a082b32d8e 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
| @@ -238,9 +238,6 @@ extern int tickadj; /* amount of adjustment per tick */ | |||
| 238 | * phase-lock loop variables | 238 | * phase-lock loop variables |
| 239 | */ | 239 | */ |
| 240 | extern int time_status; /* clock synchronization status bits */ | 240 | extern int time_status; /* clock synchronization status bits */ |
| 241 | extern long time_maxerror; /* maximum error */ | ||
| 242 | extern long time_esterror; /* estimated error */ | ||
| 243 | |||
| 244 | extern long time_adjust; /* The amount of adjtime left */ | 241 | extern long time_adjust; /* The amount of adjtime left */ |
| 245 | 242 | ||
| 246 | extern void ntp_init(void); | 243 | extern void ntp_init(void); |
diff --git a/include/linux/topology.h b/include/linux/topology.h index 57e63579bfd..5b81156780b 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
| @@ -99,7 +99,7 @@ int arch_update_cpu_topology(void); | |||
| 99 | | 1*SD_WAKE_AFFINE \ | 99 | | 1*SD_WAKE_AFFINE \ |
| 100 | | 1*SD_SHARE_CPUPOWER \ | 100 | | 1*SD_SHARE_CPUPOWER \ |
| 101 | | 0*SD_POWERSAVINGS_BALANCE \ | 101 | | 0*SD_POWERSAVINGS_BALANCE \ |
| 102 | | 0*SD_SHARE_PKG_RESOURCES \ | 102 | | 1*SD_SHARE_PKG_RESOURCES \ |
| 103 | | 0*SD_SERIALIZE \ | 103 | | 0*SD_SERIALIZE \ |
| 104 | | 0*SD_PREFER_SIBLING \ | 104 | | 0*SD_PREFER_SIBLING \ |
| 105 | , \ | 105 | , \ |
diff --git a/include/linux/tty.h b/include/linux/tty.h index ef3a2947b10..6abfcf5b588 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
| @@ -464,7 +464,7 @@ extern int tty_port_alloc_xmit_buf(struct tty_port *port); | |||
| 464 | extern void tty_port_free_xmit_buf(struct tty_port *port); | 464 | extern void tty_port_free_xmit_buf(struct tty_port *port); |
| 465 | extern void tty_port_put(struct tty_port *port); | 465 | extern void tty_port_put(struct tty_port *port); |
| 466 | 466 | ||
| 467 | extern inline struct tty_port *tty_port_get(struct tty_port *port) | 467 | static inline struct tty_port *tty_port_get(struct tty_port *port) |
| 468 | { | 468 | { |
| 469 | if (port) | 469 | if (port) |
| 470 | kref_get(&port->kref); | 470 | kref_get(&port->kref); |
| @@ -486,7 +486,7 @@ extern void tty_port_close(struct tty_port *port, | |||
| 486 | struct tty_struct *tty, struct file *filp); | 486 | struct tty_struct *tty, struct file *filp); |
| 487 | extern int tty_port_open(struct tty_port *port, | 487 | extern int tty_port_open(struct tty_port *port, |
| 488 | struct tty_struct *tty, struct file *filp); | 488 | struct tty_struct *tty, struct file *filp); |
| 489 | extern inline int tty_port_users(struct tty_port *port) | 489 | static inline int tty_port_users(struct tty_port *port) |
| 490 | { | 490 | { |
| 491 | return port->count + port->blocked_open; | 491 | return port->count + port->blocked_open; |
| 492 | } | 492 | } |
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h index 6b58367d145..d512d98dfb7 100644 --- a/include/linux/uaccess.h +++ b/include/linux/uaccess.h | |||
| @@ -94,6 +94,7 @@ static inline unsigned long __copy_from_user_nocache(void *to, | |||
| 94 | * happens, handle that and return -EFAULT. | 94 | * happens, handle that and return -EFAULT. |
| 95 | */ | 95 | */ |
| 96 | extern long probe_kernel_read(void *dst, void *src, size_t size); | 96 | extern long probe_kernel_read(void *dst, void *src, size_t size); |
| 97 | extern long __probe_kernel_read(void *dst, void *src, size_t size); | ||
| 97 | 98 | ||
| 98 | /* | 99 | /* |
| 99 | * probe_kernel_write(): safely attempt to write to a location | 100 | * probe_kernel_write(): safely attempt to write to a location |
| @@ -104,6 +105,7 @@ extern long probe_kernel_read(void *dst, void *src, size_t size); | |||
| 104 | * Safely write to address @dst from the buffer at @src. If a kernel fault | 105 | * Safely write to address @dst from the buffer at @src. If a kernel fault |
| 105 | * happens, handle that and return -EFAULT. | 106 | * happens, handle that and return -EFAULT. |
| 106 | */ | 107 | */ |
| 107 | extern long probe_kernel_write(void *dst, void *src, size_t size); | 108 | extern long notrace probe_kernel_write(void *dst, void *src, size_t size); |
| 109 | extern long notrace __probe_kernel_write(void *dst, void *src, size_t size); | ||
| 108 | 110 | ||
| 109 | #endif /* __LINUX_UACCESS_H__ */ | 111 | #endif /* __LINUX_UACCESS_H__ */ |
diff --git a/include/linux/usb.h b/include/linux/usb.h index e101a2d04d7..332eaea6102 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
| @@ -192,6 +192,7 @@ struct usb_interface { | |||
| 192 | unsigned needs_altsetting0:1; /* switch to altsetting 0 is pending */ | 192 | unsigned needs_altsetting0:1; /* switch to altsetting 0 is pending */ |
| 193 | unsigned needs_binding:1; /* needs delayed unbind/rebind */ | 193 | unsigned needs_binding:1; /* needs delayed unbind/rebind */ |
| 194 | unsigned reset_running:1; | 194 | unsigned reset_running:1; |
| 195 | unsigned resetting_device:1; /* true: bandwidth alloc after reset */ | ||
| 195 | 196 | ||
| 196 | struct device dev; /* interface specific device info */ | 197 | struct device dev; /* interface specific device info */ |
| 197 | struct device *usb_dev; | 198 | struct device *usb_dev; |
| @@ -338,6 +339,7 @@ struct usb_bus { | |||
| 338 | 339 | ||
| 339 | struct usb_devmap devmap; /* device address allocation map */ | 340 | struct usb_devmap devmap; /* device address allocation map */ |
| 340 | struct usb_device *root_hub; /* Root hub */ | 341 | struct usb_device *root_hub; /* Root hub */ |
| 342 | struct usb_bus *hs_companion; /* Companion EHCI bus, if any */ | ||
| 341 | struct list_head bus_list; /* list of busses */ | 343 | struct list_head bus_list; /* list of busses */ |
| 342 | 344 | ||
| 343 | int bandwidth_allocated; /* on this bus: how much of the time | 345 | int bandwidth_allocated; /* on this bus: how much of the time |
diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h index eaf9dffe0a0..6bb293684eb 100644 --- a/include/linux/usb/audio.h +++ b/include/linux/usb/audio.h | |||
| @@ -25,6 +25,9 @@ | |||
| 25 | #define USB_SUBCLASS_AUDIOSTREAMING 0x02 | 25 | #define USB_SUBCLASS_AUDIOSTREAMING 0x02 |
| 26 | #define USB_SUBCLASS_MIDISTREAMING 0x03 | 26 | #define USB_SUBCLASS_MIDISTREAMING 0x03 |
| 27 | 27 | ||
| 28 | #define UAC_VERSION_1 0x00 | ||
| 29 | #define UAC_VERSION_2 0x20 | ||
| 30 | |||
| 28 | /* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */ | 31 | /* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */ |
| 29 | #define UAC_HEADER 0x01 | 32 | #define UAC_HEADER 0x01 |
| 30 | #define UAC_INPUT_TERMINAL 0x02 | 33 | #define UAC_INPUT_TERMINAL 0x02 |
| @@ -32,8 +35,17 @@ | |||
| 32 | #define UAC_MIXER_UNIT 0x04 | 35 | #define UAC_MIXER_UNIT 0x04 |
| 33 | #define UAC_SELECTOR_UNIT 0x05 | 36 | #define UAC_SELECTOR_UNIT 0x05 |
| 34 | #define UAC_FEATURE_UNIT 0x06 | 37 | #define UAC_FEATURE_UNIT 0x06 |
| 35 | #define UAC_PROCESSING_UNIT 0x07 | 38 | #define UAC_PROCESSING_UNIT_V1 0x07 |
| 36 | #define UAC_EXTENSION_UNIT 0x08 | 39 | #define UAC_EXTENSION_UNIT_V1 0x08 |
| 40 | |||
| 41 | /* UAC v2.0 types */ | ||
| 42 | #define UAC_EFFECT_UNIT 0x07 | ||
| 43 | #define UAC_PROCESSING_UNIT_V2 0x08 | ||
| 44 | #define UAC_EXTENSION_UNIT_V2 0x09 | ||
| 45 | #define UAC_CLOCK_SOURCE 0x0a | ||
| 46 | #define UAC_CLOCK_SELECTOR 0x0b | ||
| 47 | #define UAC_CLOCK_MULTIPLIER 0x0c | ||
| 48 | #define UAC_SAMPLE_RATE_CONVERTER 0x0d | ||
| 37 | 49 | ||
| 38 | /* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ | 50 | /* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ |
| 39 | #define UAC_AS_GENERAL 0x01 | 51 | #define UAC_AS_GENERAL 0x01 |
| @@ -66,6 +78,10 @@ | |||
| 66 | 78 | ||
| 67 | #define UAC_GET_STAT 0xff | 79 | #define UAC_GET_STAT 0xff |
| 68 | 80 | ||
| 81 | /* Audio class v2.0 handles all the parameter calls differently */ | ||
| 82 | #define UAC2_CS_CUR 0x01 | ||
| 83 | #define UAC2_CS_RANGE 0x02 | ||
| 84 | |||
| 69 | /* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */ | 85 | /* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */ |
| 70 | #define UAC_MS_HEADER 0x01 | 86 | #define UAC_MS_HEADER 0x01 |
| 71 | #define UAC_MIDI_IN_JACK 0x02 | 87 | #define UAC_MIDI_IN_JACK 0x02 |
| @@ -81,7 +97,7 @@ | |||
| 81 | 97 | ||
| 82 | /* Terminal Control Selectors */ | 98 | /* Terminal Control Selectors */ |
| 83 | /* 4.3.2 Class-Specific AC Interface Descriptor */ | 99 | /* 4.3.2 Class-Specific AC Interface Descriptor */ |
| 84 | struct uac_ac_header_descriptor { | 100 | struct uac_ac_header_descriptor_v1 { |
| 85 | __u8 bLength; /* 8 + n */ | 101 | __u8 bLength; /* 8 + n */ |
| 86 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | 102 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
| 87 | __u8 bDescriptorSubtype; /* UAC_MS_HEADER */ | 103 | __u8 bDescriptorSubtype; /* UAC_MS_HEADER */ |
| @@ -95,7 +111,7 @@ struct uac_ac_header_descriptor { | |||
| 95 | 111 | ||
| 96 | /* As above, but more useful for defining your own descriptors: */ | 112 | /* As above, but more useful for defining your own descriptors: */ |
| 97 | #define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \ | 113 | #define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \ |
| 98 | struct uac_ac_header_descriptor_##n { \ | 114 | struct uac_ac_header_descriptor_v1_##n { \ |
| 99 | __u8 bLength; \ | 115 | __u8 bLength; \ |
| 100 | __u8 bDescriptorType; \ | 116 | __u8 bDescriptorType; \ |
| 101 | __u8 bDescriptorSubtype; \ | 117 | __u8 bDescriptorSubtype; \ |
| @@ -130,8 +146,12 @@ struct uac_input_terminal_descriptor { | |||
| 130 | #define UAC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205 | 146 | #define UAC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205 |
| 131 | #define UAC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206 | 147 | #define UAC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206 |
| 132 | 148 | ||
| 149 | /* Terminals - control selectors */ | ||
| 150 | |||
| 151 | #define UAC_TERMINAL_CS_COPY_PROTECT_CONTROL 0x01 | ||
| 152 | |||
| 133 | /* 4.3.2.2 Output Terminal Descriptor */ | 153 | /* 4.3.2.2 Output Terminal Descriptor */ |
| 134 | struct uac_output_terminal_descriptor { | 154 | struct uac_output_terminal_descriptor_v1 { |
| 135 | __u8 bLength; /* in bytes: 9 */ | 155 | __u8 bLength; /* in bytes: 9 */ |
| 136 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ | 156 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ |
| 137 | __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ | 157 | __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ |
| @@ -171,7 +191,7 @@ struct uac_feature_unit_descriptor_##ch { \ | |||
| 171 | } __attribute__ ((packed)) | 191 | } __attribute__ ((packed)) |
| 172 | 192 | ||
| 173 | /* 4.5.2 Class-Specific AS Interface Descriptor */ | 193 | /* 4.5.2 Class-Specific AS Interface Descriptor */ |
| 174 | struct uac_as_header_descriptor { | 194 | struct uac_as_header_descriptor_v1 { |
| 175 | __u8 bLength; /* in bytes: 7 */ | 195 | __u8 bLength; /* in bytes: 7 */ |
| 176 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | 196 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
| 177 | __u8 bDescriptorSubtype; /* AS_GENERAL */ | 197 | __u8 bDescriptorSubtype; /* AS_GENERAL */ |
| @@ -180,6 +200,19 @@ struct uac_as_header_descriptor { | |||
| 180 | __le16 wFormatTag; /* The Audio Data Format */ | 200 | __le16 wFormatTag; /* The Audio Data Format */ |
| 181 | } __attribute__ ((packed)); | 201 | } __attribute__ ((packed)); |
| 182 | 202 | ||
| 203 | struct uac_as_header_descriptor_v2 { | ||
| 204 | __u8 bLength; | ||
| 205 | __u8 bDescriptorType; | ||
| 206 | __u8 bDescriptorSubtype; | ||
| 207 | __u8 bTerminalLink; | ||
| 208 | __u8 bmControls; | ||
| 209 | __u8 bFormatType; | ||
| 210 | __u32 bmFormats; | ||
| 211 | __u8 bNrChannels; | ||
| 212 | __u32 bmChannelConfig; | ||
| 213 | __u8 iChannelNames; | ||
| 214 | } __attribute__((packed)); | ||
| 215 | |||
| 183 | #define UAC_DT_AS_HEADER_SIZE 7 | 216 | #define UAC_DT_AS_HEADER_SIZE 7 |
| 184 | 217 | ||
| 185 | /* Formats - A.1.1 Audio Data Format Type I Codes */ | 218 | /* Formats - A.1.1 Audio Data Format Type I Codes */ |
| @@ -232,11 +265,62 @@ struct uac_format_type_i_discrete_descriptor_##n { \ | |||
| 232 | 265 | ||
| 233 | #define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3)) | 266 | #define UAC_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3)) |
| 234 | 267 | ||
| 268 | struct uac_format_type_i_ext_descriptor { | ||
| 269 | __u8 bLength; | ||
| 270 | __u8 bDescriptorType; | ||
| 271 | __u8 bDescriptorSubtype; | ||
| 272 | __u8 bSubslotSize; | ||
| 273 | __u8 bFormatType; | ||
| 274 | __u8 bBitResolution; | ||
| 275 | __u8 bHeaderLength; | ||
| 276 | __u8 bControlSize; | ||
| 277 | __u8 bSideBandProtocol; | ||
| 278 | } __attribute__((packed)); | ||
| 279 | |||
| 280 | |||
| 281 | /* Formats - Audio Data Format Type I Codes */ | ||
| 282 | |||
| 283 | #define UAC_FORMAT_TYPE_II_MPEG 0x1001 | ||
| 284 | #define UAC_FORMAT_TYPE_II_AC3 0x1002 | ||
| 285 | |||
| 286 | struct uac_format_type_ii_discrete_descriptor { | ||
| 287 | __u8 bLength; | ||
| 288 | __u8 bDescriptorType; | ||
| 289 | __u8 bDescriptorSubtype; | ||
| 290 | __u8 bFormatType; | ||
| 291 | __le16 wMaxBitRate; | ||
| 292 | __le16 wSamplesPerFrame; | ||
| 293 | __u8 bSamFreqType; | ||
| 294 | __u8 tSamFreq[][3]; | ||
| 295 | } __attribute__((packed)); | ||
| 296 | |||
| 297 | struct uac_format_type_ii_ext_descriptor { | ||
| 298 | __u8 bLength; | ||
| 299 | __u8 bDescriptorType; | ||
| 300 | __u8 bDescriptorSubtype; | ||
| 301 | __u8 bFormatType; | ||
| 302 | __u16 wMaxBitRate; | ||
| 303 | __u16 wSamplesPerFrame; | ||
| 304 | __u8 bHeaderLength; | ||
| 305 | __u8 bSideBandProtocol; | ||
| 306 | } __attribute__((packed)); | ||
| 307 | |||
| 308 | /* type III */ | ||
| 309 | #define UAC_FORMAT_TYPE_III_IEC1937_AC3 0x2001 | ||
| 310 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG1_LAYER1 0x2002 | ||
| 311 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_NOEXT 0x2003 | ||
| 312 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_EXT 0x2004 | ||
| 313 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER1_LS 0x2005 | ||
| 314 | #define UAC_FORMAT_TYPE_III_IEC1937_MPEG2_LAYER23_LS 0x2006 | ||
| 315 | |||
| 235 | /* Formats - A.2 Format Type Codes */ | 316 | /* Formats - A.2 Format Type Codes */ |
| 236 | #define UAC_FORMAT_TYPE_UNDEFINED 0x0 | 317 | #define UAC_FORMAT_TYPE_UNDEFINED 0x0 |
| 237 | #define UAC_FORMAT_TYPE_I 0x1 | 318 | #define UAC_FORMAT_TYPE_I 0x1 |
| 238 | #define UAC_FORMAT_TYPE_II 0x2 | 319 | #define UAC_FORMAT_TYPE_II 0x2 |
| 239 | #define UAC_FORMAT_TYPE_III 0x3 | 320 | #define UAC_FORMAT_TYPE_III 0x3 |
| 321 | #define UAC_EXT_FORMAT_TYPE_I 0x81 | ||
| 322 | #define UAC_EXT_FORMAT_TYPE_II 0x82 | ||
| 323 | #define UAC_EXT_FORMAT_TYPE_III 0x83 | ||
| 240 | 324 | ||
| 241 | struct uac_iso_endpoint_descriptor { | 325 | struct uac_iso_endpoint_descriptor { |
| 242 | __u8 bLength; /* in bytes: 7 */ | 326 | __u8 bLength; /* in bytes: 7 */ |
| @@ -252,7 +336,31 @@ struct uac_iso_endpoint_descriptor { | |||
| 252 | #define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02 | 336 | #define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02 |
| 253 | #define UAC_EP_CS_ATTR_FILL_MAX 0x80 | 337 | #define UAC_EP_CS_ATTR_FILL_MAX 0x80 |
| 254 | 338 | ||
| 339 | /* Audio class v2.0: CLOCK_SOURCE descriptor */ | ||
| 340 | |||
| 341 | struct uac_clock_source_descriptor { | ||
| 342 | __u8 bLength; | ||
| 343 | __u8 bDescriptorType; | ||
| 344 | __u8 bDescriptorSubtype; | ||
| 345 | __u8 bClockID; | ||
| 346 | __u8 bmAttributes; | ||
| 347 | __u8 bmControls; | ||
| 348 | __u8 bAssocTerminal; | ||
| 349 | __u8 iClockSource; | ||
| 350 | } __attribute__((packed)); | ||
| 351 | |||
| 255 | /* A.10.2 Feature Unit Control Selectors */ | 352 | /* A.10.2 Feature Unit Control Selectors */ |
| 353 | |||
| 354 | struct uac_feature_unit_descriptor { | ||
| 355 | __u8 bLength; | ||
| 356 | __u8 bDescriptorType; | ||
| 357 | __u8 bDescriptorSubtype; | ||
| 358 | __u8 bUnitID; | ||
| 359 | __u8 bSourceID; | ||
| 360 | __u8 bControlSize; | ||
| 361 | __u8 controls[0]; /* variable length */ | ||
| 362 | } __attribute__((packed)); | ||
| 363 | |||
| 256 | #define UAC_FU_CONTROL_UNDEFINED 0x00 | 364 | #define UAC_FU_CONTROL_UNDEFINED 0x00 |
| 257 | #define UAC_MUTE_CONTROL 0x01 | 365 | #define UAC_MUTE_CONTROL 0x01 |
| 258 | #define UAC_VOLUME_CONTROL 0x02 | 366 | #define UAC_VOLUME_CONTROL 0x02 |
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h index d4375566926..5dc2f227a0f 100644 --- a/include/linux/usb/musb.h +++ b/include/linux/usb/musb.h | |||
| @@ -84,6 +84,9 @@ struct musb_hdrc_platform_data { | |||
| 84 | 84 | ||
| 85 | /* MUSB configuration-specific details */ | 85 | /* MUSB configuration-specific details */ |
| 86 | struct musb_hdrc_config *config; | 86 | struct musb_hdrc_config *config; |
| 87 | |||
| 88 | /* Architecture specific board data */ | ||
| 89 | void *board_data; | ||
| 87 | }; | 90 | }; |
| 88 | 91 | ||
| 89 | 92 | ||
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index 52bb917641f..fef0972c814 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
| @@ -110,9 +110,19 @@ struct otg_transceiver { | |||
| 110 | /* for board-specific init logic */ | 110 | /* for board-specific init logic */ |
| 111 | extern int otg_set_transceiver(struct otg_transceiver *); | 111 | extern int otg_set_transceiver(struct otg_transceiver *); |
| 112 | 112 | ||
| 113 | #if defined(CONFIG_NOP_USB_XCEIV) || defined(CONFIG_NOP_USB_XCEIV_MODULE) | ||
| 113 | /* sometimes transceivers are accessed only through e.g. ULPI */ | 114 | /* sometimes transceivers are accessed only through e.g. ULPI */ |
| 114 | extern void usb_nop_xceiv_register(void); | 115 | extern void usb_nop_xceiv_register(void); |
| 115 | extern void usb_nop_xceiv_unregister(void); | 116 | extern void usb_nop_xceiv_unregister(void); |
| 117 | #else | ||
| 118 | static inline void usb_nop_xceiv_register(void) | ||
| 119 | { | ||
| 120 | } | ||
| 121 | |||
| 122 | static inline void usb_nop_xceiv_unregister(void) | ||
| 123 | { | ||
| 124 | } | ||
| 125 | #endif | ||
| 116 | 126 | ||
| 117 | /* helpers for direct access thru low-level io interface */ | 127 | /* helpers for direct access thru low-level io interface */ |
| 118 | static inline int otg_io_read(struct otg_transceiver *otg, u32 reg) | 128 | static inline int otg_io_read(struct otg_transceiver *otg, u32 reg) |
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index 8ce61359bf7..df1e83dd9a5 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
| @@ -214,25 +214,4 @@ extern void usbnet_set_msglevel (struct net_device *, u32); | |||
| 214 | extern void usbnet_get_drvinfo (struct net_device *, struct ethtool_drvinfo *); | 214 | extern void usbnet_get_drvinfo (struct net_device *, struct ethtool_drvinfo *); |
| 215 | extern int usbnet_nway_reset(struct net_device *net); | 215 | extern int usbnet_nway_reset(struct net_device *net); |
| 216 | 216 | ||
| 217 | /* messaging support includes the interface name, so it must not be | ||
| 218 | * used before it has one ... notably, in minidriver bind() calls. | ||
| 219 | */ | ||
| 220 | #ifdef DEBUG | ||
| 221 | #define devdbg(usbnet, fmt, arg...) \ | ||
| 222 | printk(KERN_DEBUG "%s: " fmt "\n" , (usbnet)->net->name , ## arg) | ||
| 223 | #else | ||
| 224 | #define devdbg(usbnet, fmt, arg...) \ | ||
| 225 | ({ if (0) printk(KERN_DEBUG "%s: " fmt "\n" , (usbnet)->net->name , \ | ||
| 226 | ## arg); 0; }) | ||
| 227 | #endif | ||
| 228 | |||
| 229 | #define deverr(usbnet, fmt, arg...) \ | ||
| 230 | printk(KERN_ERR "%s: " fmt "\n" , (usbnet)->net->name , ## arg) | ||
| 231 | #define devwarn(usbnet, fmt, arg...) \ | ||
| 232 | printk(KERN_WARNING "%s: " fmt "\n" , (usbnet)->net->name , ## arg) | ||
| 233 | |||
| 234 | #define devinfo(usbnet, fmt, arg...) \ | ||
| 235 | printk(KERN_INFO "%s: " fmt "\n" , (usbnet)->net->name , ## arg); \ | ||
| 236 | |||
| 237 | |||
| 238 | #endif /* __LINUX_USB_USBNET_H */ | 217 | #endif /* __LINUX_USB_USBNET_H */ |
diff --git a/include/linux/vhost.h b/include/linux/vhost.h new file mode 100644 index 00000000000..e847f1e3075 --- /dev/null +++ b/include/linux/vhost.h | |||
| @@ -0,0 +1,130 @@ | |||
| 1 | #ifndef _LINUX_VHOST_H | ||
| 2 | #define _LINUX_VHOST_H | ||
| 3 | /* Userspace interface for in-kernel virtio accelerators. */ | ||
| 4 | |||
| 5 | /* vhost is used to reduce the number of system calls involved in virtio. | ||
| 6 | * | ||
| 7 | * Existing virtio net code is used in the guest without modification. | ||
| 8 | * | ||
| 9 | * This header includes interface used by userspace hypervisor for | ||
| 10 | * device configuration. | ||
| 11 | */ | ||
| 12 | |||
| 13 | #include <linux/types.h> | ||
| 14 | #include <linux/compiler.h> | ||
| 15 | #include <linux/ioctl.h> | ||
| 16 | #include <linux/virtio_config.h> | ||
| 17 | #include <linux/virtio_ring.h> | ||
| 18 | |||
| 19 | struct vhost_vring_state { | ||
| 20 | unsigned int index; | ||
| 21 | unsigned int num; | ||
| 22 | }; | ||
| 23 | |||
| 24 | struct vhost_vring_file { | ||
| 25 | unsigned int index; | ||
| 26 | int fd; /* Pass -1 to unbind from file. */ | ||
| 27 | |||
| 28 | }; | ||
| 29 | |||
| 30 | struct vhost_vring_addr { | ||
| 31 | unsigned int index; | ||
| 32 | /* Option flags. */ | ||
| 33 | unsigned int flags; | ||
| 34 | /* Flag values: */ | ||
| 35 | /* Whether log address is valid. If set enables logging. */ | ||
| 36 | #define VHOST_VRING_F_LOG 0 | ||
| 37 | |||
| 38 | /* Start of array of descriptors (virtually contiguous) */ | ||
| 39 | __u64 desc_user_addr; | ||
| 40 | /* Used structure address. Must be 32 bit aligned */ | ||
| 41 | __u64 used_user_addr; | ||
| 42 | /* Available structure address. Must be 16 bit aligned */ | ||
| 43 | __u64 avail_user_addr; | ||
| 44 | /* Logging support. */ | ||
| 45 | /* Log writes to used structure, at offset calculated from specified | ||
| 46 | * address. Address must be 32 bit aligned. */ | ||
| 47 | __u64 log_guest_addr; | ||
| 48 | }; | ||
| 49 | |||
| 50 | struct vhost_memory_region { | ||
| 51 | __u64 guest_phys_addr; | ||
| 52 | __u64 memory_size; /* bytes */ | ||
| 53 | __u64 userspace_addr; | ||
| 54 | __u64 flags_padding; /* No flags are currently specified. */ | ||
| 55 | }; | ||
| 56 | |||
| 57 | /* All region addresses and sizes must be 4K aligned. */ | ||
| 58 | #define VHOST_PAGE_SIZE 0x1000 | ||
| 59 | |||
| 60 | struct vhost_memory { | ||
| 61 | __u32 nregions; | ||
| 62 | __u32 padding; | ||
| 63 | struct vhost_memory_region regions[0]; | ||
| 64 | }; | ||
| 65 | |||
| 66 | /* ioctls */ | ||
| 67 | |||
| 68 | #define VHOST_VIRTIO 0xAF | ||
| 69 | |||
| 70 | /* Features bitmask for forward compatibility. Transport bits are used for | ||
| 71 | * vhost specific features. */ | ||
| 72 | #define VHOST_GET_FEATURES _IOR(VHOST_VIRTIO, 0x00, __u64) | ||
| 73 | #define VHOST_SET_FEATURES _IOW(VHOST_VIRTIO, 0x00, __u64) | ||
| 74 | |||
| 75 | /* Set current process as the (exclusive) owner of this file descriptor. This | ||
| 76 | * must be called before any other vhost command. Further calls to | ||
| 77 | * VHOST_OWNER_SET fail until VHOST_OWNER_RESET is called. */ | ||
| 78 | #define VHOST_SET_OWNER _IO(VHOST_VIRTIO, 0x01) | ||
| 79 | /* Give up ownership, and reset the device to default values. | ||
| 80 | * Allows subsequent call to VHOST_OWNER_SET to succeed. */ | ||
| 81 | #define VHOST_RESET_OWNER _IO(VHOST_VIRTIO, 0x02) | ||
| 82 | |||
| 83 | /* Set up/modify memory layout */ | ||
| 84 | #define VHOST_SET_MEM_TABLE _IOW(VHOST_VIRTIO, 0x03, struct vhost_memory) | ||
| 85 | |||
| 86 | /* Write logging setup. */ | ||
| 87 | /* Memory writes can optionally be logged by setting bit at an offset | ||
| 88 | * (calculated from the physical address) from specified log base. | ||
| 89 | * The bit is set using an atomic 32 bit operation. */ | ||
| 90 | /* Set base address for logging. */ | ||
| 91 | #define VHOST_SET_LOG_BASE _IOW(VHOST_VIRTIO, 0x04, __u64) | ||
| 92 | /* Specify an eventfd file descriptor to signal on log write. */ | ||
| 93 | #define VHOST_SET_LOG_FD _IOW(VHOST_VIRTIO, 0x07, int) | ||
| 94 | |||
| 95 | /* Ring setup. */ | ||
| 96 | /* Set number of descriptors in ring. This parameter can not | ||
| 97 | * be modified while ring is running (bound to a device). */ | ||
| 98 | #define VHOST_SET_VRING_NUM _IOW(VHOST_VIRTIO, 0x10, struct vhost_vring_state) | ||
| 99 | /* Set addresses for the ring. */ | ||
| 100 | #define VHOST_SET_VRING_ADDR _IOW(VHOST_VIRTIO, 0x11, struct vhost_vring_addr) | ||
| 101 | /* Base value where queue looks for available descriptors */ | ||
| 102 | #define VHOST_SET_VRING_BASE _IOW(VHOST_VIRTIO, 0x12, struct vhost_vring_state) | ||
| 103 | /* Get accessor: reads index, writes value in num */ | ||
| 104 | #define VHOST_GET_VRING_BASE _IOWR(VHOST_VIRTIO, 0x12, struct vhost_vring_state) | ||
| 105 | |||
| 106 | /* The following ioctls use eventfd file descriptors to signal and poll | ||
| 107 | * for events. */ | ||
| 108 | |||
| 109 | /* Set eventfd to poll for added buffers */ | ||
| 110 | #define VHOST_SET_VRING_KICK _IOW(VHOST_VIRTIO, 0x20, struct vhost_vring_file) | ||
| 111 | /* Set eventfd to signal when buffers have beed used */ | ||
| 112 | #define VHOST_SET_VRING_CALL _IOW(VHOST_VIRTIO, 0x21, struct vhost_vring_file) | ||
| 113 | /* Set eventfd to signal an error */ | ||
| 114 | #define VHOST_SET_VRING_ERR _IOW(VHOST_VIRTIO, 0x22, struct vhost_vring_file) | ||
| 115 | |||
| 116 | /* VHOST_NET specific defines */ | ||
| 117 | |||
| 118 | /* Attach virtio net ring to a raw socket, or tap device. | ||
| 119 | * The socket must be already bound to an ethernet device, this device will be | ||
| 120 | * used for transmit. Pass fd -1 to unbind from the socket and the transmit | ||
| 121 | * device. This can be used to stop the ring (e.g. for migration). */ | ||
| 122 | #define VHOST_NET_SET_BACKEND _IOW(VHOST_VIRTIO, 0x30, struct vhost_vring_file) | ||
| 123 | |||
| 124 | /* Feature bits */ | ||
| 125 | /* Log all write descriptors. Can be changed while device is active. */ | ||
| 126 | #define VHOST_F_LOG_ALL 26 | ||
| 127 | /* vhost-net should add virtio_net_hdr for RX, and strip for TX packets. */ | ||
| 128 | #define VHOST_NET_F_VIRTIO_NET_HDR 27 | ||
| 129 | |||
| 130 | #endif | ||
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index d4962a782b8..3793d168b44 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
| @@ -350,6 +350,7 @@ struct v4l2_pix_format { | |||
| 350 | #define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 */ | 350 | #define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 */ |
| 351 | 351 | ||
| 352 | /* Vendor-specific formats */ | 352 | /* Vendor-specific formats */ |
| 353 | #define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */ | ||
| 353 | #define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */ | 354 | #define V4L2_PIX_FMT_WNVA v4l2_fourcc('W', 'N', 'V', 'A') /* Winnov hw compress */ |
| 354 | #define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */ | 355 | #define V4L2_PIX_FMT_SN9C10X v4l2_fourcc('S', '9', '1', '0') /* SN9C10x compression */ |
| 355 | #define V4L2_PIX_FMT_SN9C20X_I420 v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */ | 356 | #define V4L2_PIX_FMT_SN9C20X_I420 v4l2_fourcc('S', '9', '2', '0') /* SN9C20x YUV 4:2:0 */ |
| @@ -362,6 +363,7 @@ struct v4l2_pix_format { | |||
| 362 | #define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */ | 363 | #define V4L2_PIX_FMT_SPCA561 v4l2_fourcc('S', '5', '6', '1') /* compressed GBRG bayer */ |
| 363 | #define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */ | 364 | #define V4L2_PIX_FMT_PAC207 v4l2_fourcc('P', '2', '0', '7') /* compressed BGGR bayer */ |
| 364 | #define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */ | 365 | #define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */ |
| 366 | #define V4L2_PIX_FMT_SN9C2028 v4l2_fourcc('S', 'O', 'N', 'X') /* compressed GBRG bayer */ | ||
| 365 | #define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */ | 367 | #define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */ |
| 366 | #define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ | 368 | #define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ |
| 367 | #define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */ | 369 | #define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */ |
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 057a2e01075..f508c651e53 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h | |||
| @@ -51,6 +51,9 @@ struct virtqueue { | |||
| 51 | * This re-enables callbacks; it returns "false" if there are pending | 51 | * This re-enables callbacks; it returns "false" if there are pending |
| 52 | * buffers in the queue, to detect a possible race between the driver | 52 | * buffers in the queue, to detect a possible race between the driver |
| 53 | * checking for more work, and enabling callbacks. | 53 | * checking for more work, and enabling callbacks. |
| 54 | * @detach_unused_buf: detach first unused buffer | ||
| 55 | * vq: the struct virtqueue we're talking about. | ||
| 56 | * Returns NULL or the "data" token handed to add_buf | ||
| 54 | * | 57 | * |
| 55 | * Locking rules are straightforward: the driver is responsible for | 58 | * Locking rules are straightforward: the driver is responsible for |
| 56 | * locking. No two operations may be invoked simultaneously, with the exception | 59 | * locking. No two operations may be invoked simultaneously, with the exception |
| @@ -71,6 +74,7 @@ struct virtqueue_ops { | |||
| 71 | 74 | ||
| 72 | void (*disable_cb)(struct virtqueue *vq); | 75 | void (*disable_cb)(struct virtqueue *vq); |
| 73 | bool (*enable_cb)(struct virtqueue *vq); | 76 | bool (*enable_cb)(struct virtqueue *vq); |
| 77 | void *(*detach_unused_buf)(struct virtqueue *vq); | ||
| 74 | }; | 78 | }; |
| 75 | 79 | ||
| 76 | /** | 80 | /** |
diff --git a/include/linux/virtio_balloon.h b/include/linux/virtio_balloon.h index 1418f048cb3..a50ecd1b81a 100644 --- a/include/linux/virtio_balloon.h +++ b/include/linux/virtio_balloon.h | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | 7 | ||
| 8 | /* The feature bitmap for virtio balloon */ | 8 | /* The feature bitmap for virtio balloon */ |
| 9 | #define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */ | 9 | #define VIRTIO_BALLOON_F_MUST_TELL_HOST 0 /* Tell before reclaiming pages */ |
| 10 | #define VIRTIO_BALLOON_F_STATS_VQ 1 /* Memory Stats virtqueue */ | ||
| 10 | 11 | ||
| 11 | /* Size of a PFN in the balloon interface. */ | 12 | /* Size of a PFN in the balloon interface. */ |
| 12 | #define VIRTIO_BALLOON_PFN_SHIFT 12 | 13 | #define VIRTIO_BALLOON_PFN_SHIFT 12 |
| @@ -18,4 +19,18 @@ struct virtio_balloon_config | |||
| 18 | /* Number of pages we've actually got in balloon. */ | 19 | /* Number of pages we've actually got in balloon. */ |
| 19 | __le32 actual; | 20 | __le32 actual; |
| 20 | }; | 21 | }; |
| 22 | |||
| 23 | #define VIRTIO_BALLOON_S_SWAP_IN 0 /* Amount of memory swapped in */ | ||
| 24 | #define VIRTIO_BALLOON_S_SWAP_OUT 1 /* Amount of memory swapped out */ | ||
| 25 | #define VIRTIO_BALLOON_S_MAJFLT 2 /* Number of major faults */ | ||
| 26 | #define VIRTIO_BALLOON_S_MINFLT 3 /* Number of minor faults */ | ||
| 27 | #define VIRTIO_BALLOON_S_MEMFREE 4 /* Total amount of free memory */ | ||
| 28 | #define VIRTIO_BALLOON_S_MEMTOT 5 /* Total amount of memory */ | ||
| 29 | #define VIRTIO_BALLOON_S_NR 6 | ||
| 30 | |||
| 31 | struct virtio_balloon_stat { | ||
| 32 | u16 tag; | ||
| 33 | u64 val; | ||
| 34 | } __attribute__((packed)); | ||
| 35 | |||
| 21 | #endif /* _LINUX_VIRTIO_BALLOON_H */ | 36 | #endif /* _LINUX_VIRTIO_BALLOON_H */ |
diff --git a/include/linux/virtio_blk.h b/include/linux/virtio_blk.h index fd294c56d57..e52029e9891 100644 --- a/include/linux/virtio_blk.h +++ b/include/linux/virtio_blk.h | |||
| @@ -15,6 +15,7 @@ | |||
| 15 | #define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ | 15 | #define VIRTIO_BLK_F_BLK_SIZE 6 /* Block size of disk is available*/ |
| 16 | #define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ | 16 | #define VIRTIO_BLK_F_SCSI 7 /* Supports scsi command passthru */ |
| 17 | #define VIRTIO_BLK_F_FLUSH 9 /* Cache flush command support */ | 17 | #define VIRTIO_BLK_F_FLUSH 9 /* Cache flush command support */ |
| 18 | #define VIRTIO_BLK_F_TOPOLOGY 10 /* Topology information is available */ | ||
| 18 | 19 | ||
| 19 | struct virtio_blk_config { | 20 | struct virtio_blk_config { |
| 20 | /* The capacity (in 512-byte sectors). */ | 21 | /* The capacity (in 512-byte sectors). */ |
| @@ -29,8 +30,20 @@ struct virtio_blk_config { | |||
| 29 | __u8 heads; | 30 | __u8 heads; |
| 30 | __u8 sectors; | 31 | __u8 sectors; |
| 31 | } geometry; | 32 | } geometry; |
| 33 | |||
| 32 | /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */ | 34 | /* block size of device (if VIRTIO_BLK_F_BLK_SIZE) */ |
| 33 | __u32 blk_size; | 35 | __u32 blk_size; |
| 36 | |||
| 37 | /* the next 4 entries are guarded by VIRTIO_BLK_F_TOPOLOGY */ | ||
| 38 | /* exponent for physical block per logical block. */ | ||
| 39 | __u8 physical_block_exp; | ||
| 40 | /* alignment offset in logical blocks. */ | ||
| 41 | __u8 alignment_offset; | ||
| 42 | /* minimum I/O size without performance penalty in logical blocks. */ | ||
| 43 | __u16 min_io_size; | ||
| 44 | /* optimal sustained I/O size in logical blocks. */ | ||
| 45 | __u32 opt_io_size; | ||
| 46 | |||
| 34 | } __attribute__((packed)); | 47 | } __attribute__((packed)); |
| 35 | 48 | ||
| 36 | /* | 49 | /* |
diff --git a/include/linux/virtio_console.h b/include/linux/virtio_console.h index fe885174cc1..ae4f039515b 100644 --- a/include/linux/virtio_console.h +++ b/include/linux/virtio_console.h | |||
| @@ -3,19 +3,45 @@ | |||
| 3 | #include <linux/types.h> | 3 | #include <linux/types.h> |
| 4 | #include <linux/virtio_ids.h> | 4 | #include <linux/virtio_ids.h> |
| 5 | #include <linux/virtio_config.h> | 5 | #include <linux/virtio_config.h> |
| 6 | /* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so | 6 | /* |
| 7 | * anyone can use the definitions to implement compatible drivers/servers. */ | 7 | * This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so |
| 8 | * anyone can use the definitions to implement compatible drivers/servers. | ||
| 9 | * | ||
| 10 | * Copyright (C) Red Hat, Inc., 2009, 2010 | ||
| 11 | */ | ||
| 8 | 12 | ||
| 9 | /* Feature bits */ | 13 | /* Feature bits */ |
| 10 | #define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */ | 14 | #define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */ |
| 15 | #define VIRTIO_CONSOLE_F_MULTIPORT 1 /* Does host provide multiple ports? */ | ||
| 11 | 16 | ||
| 12 | struct virtio_console_config { | 17 | struct virtio_console_config { |
| 13 | /* colums of the screens */ | 18 | /* colums of the screens */ |
| 14 | __u16 cols; | 19 | __u16 cols; |
| 15 | /* rows of the screens */ | 20 | /* rows of the screens */ |
| 16 | __u16 rows; | 21 | __u16 rows; |
| 22 | /* max. number of ports this device can hold */ | ||
| 23 | __u32 max_nr_ports; | ||
| 24 | /* number of ports added so far */ | ||
| 25 | __u32 nr_ports; | ||
| 17 | } __attribute__((packed)); | 26 | } __attribute__((packed)); |
| 18 | 27 | ||
| 28 | /* | ||
| 29 | * A message that's passed between the Host and the Guest for a | ||
| 30 | * particular port. | ||
| 31 | */ | ||
| 32 | struct virtio_console_control { | ||
| 33 | __u32 id; /* Port number */ | ||
| 34 | __u16 event; /* The kind of control event (see below) */ | ||
| 35 | __u16 value; /* Extra information for the key */ | ||
| 36 | }; | ||
| 37 | |||
| 38 | /* Some events for control messages */ | ||
| 39 | #define VIRTIO_CONSOLE_PORT_READY 0 | ||
| 40 | #define VIRTIO_CONSOLE_CONSOLE_PORT 1 | ||
| 41 | #define VIRTIO_CONSOLE_RESIZE 2 | ||
| 42 | #define VIRTIO_CONSOLE_PORT_OPEN 3 | ||
| 43 | #define VIRTIO_CONSOLE_PORT_NAME 4 | ||
| 44 | #define VIRTIO_CONSOLE_PORT_REMOVE 5 | ||
| 19 | 45 | ||
| 20 | #ifdef __KERNEL__ | 46 | #ifdef __KERNEL__ |
| 21 | int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int)); | 47 | int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int)); |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index c18c008f4bb..76e8903cd20 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
| @@ -70,6 +70,7 @@ struct writeback_control { | |||
| 70 | struct bdi_writeback; | 70 | struct bdi_writeback; |
| 71 | int inode_wait(void *); | 71 | int inode_wait(void *); |
| 72 | void writeback_inodes_sb(struct super_block *); | 72 | void writeback_inodes_sb(struct super_block *); |
| 73 | int writeback_inodes_sb_if_idle(struct super_block *); | ||
| 73 | void sync_inodes_sb(struct super_block *); | 74 | void sync_inodes_sb(struct super_block *); |
| 74 | void writeback_inodes_wbc(struct writeback_control *wbc); | 75 | void writeback_inodes_wbc(struct writeback_control *wbc); |
| 75 | long wb_do_writeback(struct bdi_writeback *wb, int force_wait); | 76 | long wb_do_writeback(struct bdi_writeback *wb, int force_wait); |
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index 29e04beb1fc..b971e384849 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
| @@ -267,8 +267,8 @@ enum xfrm_attr_type_t { | |||
| 267 | XFRMA_ALG_COMP, /* struct xfrm_algo */ | 267 | XFRMA_ALG_COMP, /* struct xfrm_algo */ |
| 268 | XFRMA_ENCAP, /* struct xfrm_algo + struct xfrm_encap_tmpl */ | 268 | XFRMA_ENCAP, /* struct xfrm_algo + struct xfrm_encap_tmpl */ |
| 269 | XFRMA_TMPL, /* 1 or more struct xfrm_user_tmpl */ | 269 | XFRMA_TMPL, /* 1 or more struct xfrm_user_tmpl */ |
| 270 | XFRMA_SA, | 270 | XFRMA_SA, /* struct xfrm_usersa_info */ |
| 271 | XFRMA_POLICY, | 271 | XFRMA_POLICY, /*struct xfrm_userpolicy_info */ |
| 272 | XFRMA_SEC_CTX, /* struct xfrm_sec_ctx */ | 272 | XFRMA_SEC_CTX, /* struct xfrm_sec_ctx */ |
| 273 | XFRMA_LTIME_VAL, | 273 | XFRMA_LTIME_VAL, |
| 274 | XFRMA_REPLAY_VAL, | 274 | XFRMA_REPLAY_VAL, |
| @@ -276,17 +276,23 @@ enum xfrm_attr_type_t { | |||
| 276 | XFRMA_ETIMER_THRESH, | 276 | XFRMA_ETIMER_THRESH, |
| 277 | XFRMA_SRCADDR, /* xfrm_address_t */ | 277 | XFRMA_SRCADDR, /* xfrm_address_t */ |
| 278 | XFRMA_COADDR, /* xfrm_address_t */ | 278 | XFRMA_COADDR, /* xfrm_address_t */ |
| 279 | XFRMA_LASTUSED, | 279 | XFRMA_LASTUSED, /* unsigned long */ |
| 280 | XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */ | 280 | XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */ |
| 281 | XFRMA_MIGRATE, | 281 | XFRMA_MIGRATE, |
| 282 | XFRMA_ALG_AEAD, /* struct xfrm_algo_aead */ | 282 | XFRMA_ALG_AEAD, /* struct xfrm_algo_aead */ |
| 283 | XFRMA_KMADDRESS, /* struct xfrm_user_kmaddress */ | 283 | XFRMA_KMADDRESS, /* struct xfrm_user_kmaddress */ |
| 284 | XFRMA_ALG_AUTH_TRUNC, /* struct xfrm_algo_auth */ | 284 | XFRMA_ALG_AUTH_TRUNC, /* struct xfrm_algo_auth */ |
| 285 | XFRMA_MARK, /* struct xfrm_mark */ | ||
| 285 | __XFRMA_MAX | 286 | __XFRMA_MAX |
| 286 | 287 | ||
| 287 | #define XFRMA_MAX (__XFRMA_MAX - 1) | 288 | #define XFRMA_MAX (__XFRMA_MAX - 1) |
| 288 | }; | 289 | }; |
| 289 | 290 | ||
| 291 | struct xfrm_mark { | ||
| 292 | __u32 v; /* value */ | ||
| 293 | __u32 m; /* mask */ | ||
| 294 | }; | ||
| 295 | |||
| 290 | enum xfrm_sadattr_type_t { | 296 | enum xfrm_sadattr_type_t { |
| 291 | XFRMA_SAD_UNSPEC, | 297 | XFRMA_SAD_UNSPEC, |
| 292 | XFRMA_SAD_CNT, | 298 | XFRMA_SAD_CNT, |
