diff options
Diffstat (limited to 'include/linux')
89 files changed, 2622 insertions, 760 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index b68ec09399be..282a504bd1db 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -126,6 +126,7 @@ header-y += pci_regs.h | |||
126 | header-y += pfkeyv2.h | 126 | header-y += pfkeyv2.h |
127 | header-y += pg.h | 127 | header-y += pg.h |
128 | header-y += phantom.h | 128 | header-y += phantom.h |
129 | header-y += phonet.h | ||
129 | header-y += pkt_cls.h | 130 | header-y += pkt_cls.h |
130 | header-y += pkt_sched.h | 131 | header-y += pkt_sched.h |
131 | header-y += posix_types.h | 132 | header-y += posix_types.h |
@@ -180,6 +181,7 @@ unifdef-y += audit.h | |||
180 | unifdef-y += auto_fs.h | 181 | unifdef-y += auto_fs.h |
181 | unifdef-y += auxvec.h | 182 | unifdef-y += auxvec.h |
182 | unifdef-y += binfmts.h | 183 | unifdef-y += binfmts.h |
184 | unifdef-y += blktrace_api.h | ||
183 | unifdef-y += capability.h | 185 | unifdef-y += capability.h |
184 | unifdef-y += capi.h | 186 | unifdef-y += capi.h |
185 | unifdef-y += cciss_ioctl.h | 187 | unifdef-y += cciss_ioctl.h |
@@ -232,6 +234,7 @@ unifdef-y += if_fddi.h | |||
232 | unifdef-y += if_frad.h | 234 | unifdef-y += if_frad.h |
233 | unifdef-y += if_ltalk.h | 235 | unifdef-y += if_ltalk.h |
234 | unifdef-y += if_link.h | 236 | unifdef-y += if_link.h |
237 | unifdef-y += if_phonet.h | ||
235 | unifdef-y += if_pppol2tp.h | 238 | unifdef-y += if_pppol2tp.h |
236 | unifdef-y += if_pppox.h | 239 | unifdef-y += if_pppox.h |
237 | unifdef-y += if_tr.h | 240 | unifdef-y += if_tr.h |
diff --git a/include/linux/ata.h b/include/linux/ata.h index 8a12d718c169..a53318b8cbd0 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #define __LINUX_ATA_H__ | 30 | #define __LINUX_ATA_H__ |
31 | 31 | ||
32 | #include <linux/types.h> | 32 | #include <linux/types.h> |
33 | #include <asm/byteorder.h> | ||
33 | 34 | ||
34 | /* defines only for the constants which don't work well as enums */ | 35 | /* defines only for the constants which don't work well as enums */ |
35 | #define ATA_DMA_BOUNDARY 0xffffUL | 36 | #define ATA_DMA_BOUNDARY 0xffffUL |
@@ -88,6 +89,7 @@ enum { | |||
88 | ATA_ID_DLF = 128, | 89 | ATA_ID_DLF = 128, |
89 | ATA_ID_CSFO = 129, | 90 | ATA_ID_CSFO = 129, |
90 | ATA_ID_CFA_POWER = 160, | 91 | ATA_ID_CFA_POWER = 160, |
92 | ATA_ID_ROT_SPEED = 217, | ||
91 | ATA_ID_PIO4 = (1 << 1), | 93 | ATA_ID_PIO4 = (1 << 1), |
92 | 94 | ||
93 | ATA_ID_SERNO_LEN = 20, | 95 | ATA_ID_SERNO_LEN = 20, |
@@ -557,6 +559,15 @@ static inline int ata_id_has_flush(const u16 *id) | |||
557 | return id[ATA_ID_COMMAND_SET_2] & (1 << 12); | 559 | return id[ATA_ID_COMMAND_SET_2] & (1 << 12); |
558 | } | 560 | } |
559 | 561 | ||
562 | static inline int ata_id_flush_enabled(const u16 *id) | ||
563 | { | ||
564 | if (ata_id_has_flush(id) == 0) | ||
565 | return 0; | ||
566 | if ((id[ATA_ID_CSF_DEFAULT] & 0xC000) != 0x4000) | ||
567 | return 0; | ||
568 | return id[ATA_ID_CFS_ENABLE_2] & (1 << 12); | ||
569 | } | ||
570 | |||
560 | static inline int ata_id_has_flush_ext(const u16 *id) | 571 | static inline int ata_id_has_flush_ext(const u16 *id) |
561 | { | 572 | { |
562 | if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) | 573 | if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) |
@@ -564,6 +575,19 @@ static inline int ata_id_has_flush_ext(const u16 *id) | |||
564 | return id[ATA_ID_COMMAND_SET_2] & (1 << 13); | 575 | return id[ATA_ID_COMMAND_SET_2] & (1 << 13); |
565 | } | 576 | } |
566 | 577 | ||
578 | static inline int ata_id_flush_ext_enabled(const u16 *id) | ||
579 | { | ||
580 | if (ata_id_has_flush_ext(id) == 0) | ||
581 | return 0; | ||
582 | if ((id[ATA_ID_CSF_DEFAULT] & 0xC000) != 0x4000) | ||
583 | return 0; | ||
584 | /* | ||
585 | * some Maxtor disks have bit 13 defined incorrectly | ||
586 | * so check bit 10 too | ||
587 | */ | ||
588 | return (id[ATA_ID_CFS_ENABLE_2] & 0x2400) == 0x2400; | ||
589 | } | ||
590 | |||
567 | static inline int ata_id_has_lba48(const u16 *id) | 591 | static inline int ata_id_has_lba48(const u16 *id) |
568 | { | 592 | { |
569 | if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) | 593 | if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) |
@@ -573,6 +597,15 @@ static inline int ata_id_has_lba48(const u16 *id) | |||
573 | return id[ATA_ID_COMMAND_SET_2] & (1 << 10); | 597 | return id[ATA_ID_COMMAND_SET_2] & (1 << 10); |
574 | } | 598 | } |
575 | 599 | ||
600 | static inline int ata_id_lba48_enabled(const u16 *id) | ||
601 | { | ||
602 | if (ata_id_has_lba48(id) == 0) | ||
603 | return 0; | ||
604 | if ((id[ATA_ID_CSF_DEFAULT] & 0xC000) != 0x4000) | ||
605 | return 0; | ||
606 | return id[ATA_ID_CFS_ENABLE_2] & (1 << 10); | ||
607 | } | ||
608 | |||
576 | static inline int ata_id_hpa_enabled(const u16 *id) | 609 | static inline int ata_id_hpa_enabled(const u16 *id) |
577 | { | 610 | { |
578 | /* Yes children, word 83 valid bits cover word 82 data */ | 611 | /* Yes children, word 83 valid bits cover word 82 data */ |
@@ -644,7 +677,15 @@ static inline unsigned int ata_id_major_version(const u16 *id) | |||
644 | 677 | ||
645 | static inline int ata_id_is_sata(const u16 *id) | 678 | static inline int ata_id_is_sata(const u16 *id) |
646 | { | 679 | { |
647 | return ata_id_major_version(id) >= 5 && id[ATA_ID_HW_CONFIG] == 0; | 680 | /* |
681 | * See if word 93 is 0 AND drive is at least ATA-5 compatible | ||
682 | * verifying that word 80 by casting it to a signed type -- | ||
683 | * this trick allows us to filter out the reserved values of | ||
684 | * 0x0000 and 0xffff along with the earlier ATA revisions... | ||
685 | */ | ||
686 | if (id[ATA_ID_HW_CONFIG] == 0 && (short)id[ATA_ID_MAJOR_VER] >= 0x0020) | ||
687 | return 1; | ||
688 | return 0; | ||
648 | } | 689 | } |
649 | 690 | ||
650 | static inline int ata_id_has_tpm(const u16 *id) | 691 | static inline int ata_id_has_tpm(const u16 *id) |
@@ -667,6 +708,15 @@ static inline int ata_id_has_dword_io(const u16 *id) | |||
667 | return 0; | 708 | return 0; |
668 | } | 709 | } |
669 | 710 | ||
711 | static inline int ata_id_has_unload(const u16 *id) | ||
712 | { | ||
713 | if (ata_id_major_version(id) >= 7 && | ||
714 | (id[ATA_ID_CFSSE] & 0xC000) == 0x4000 && | ||
715 | id[ATA_ID_CFSSE] & (1 << 13)) | ||
716 | return 1; | ||
717 | return 0; | ||
718 | } | ||
719 | |||
670 | static inline int ata_id_current_chs_valid(const u16 *id) | 720 | static inline int ata_id_current_chs_valid(const u16 *id) |
671 | { | 721 | { |
672 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command | 722 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command |
@@ -691,6 +741,11 @@ static inline int ata_id_is_cfa(const u16 *id) | |||
691 | return 0; | 741 | return 0; |
692 | } | 742 | } |
693 | 743 | ||
744 | static inline int ata_id_is_ssd(const u16 *id) | ||
745 | { | ||
746 | return id[ATA_ID_ROT_SPEED] == 0x01; | ||
747 | } | ||
748 | |||
694 | static inline int ata_drive_40wire(const u16 *dev_id) | 749 | static inline int ata_drive_40wire(const u16 *dev_id) |
695 | { | 750 | { |
696 | if (ata_id_is_sata(dev_id)) | 751 | if (ata_id_is_sata(dev_id)) |
@@ -727,6 +782,76 @@ static inline int atapi_id_dmadir(const u16 *dev_id) | |||
727 | return ata_id_major_version(dev_id) >= 7 && (dev_id[62] & 0x8000); | 782 | return ata_id_major_version(dev_id) >= 7 && (dev_id[62] & 0x8000); |
728 | } | 783 | } |
729 | 784 | ||
785 | /* | ||
786 | * ata_id_is_lba_capacity_ok() performs a sanity check on | ||
787 | * the claimed LBA capacity value for the device. | ||
788 | * | ||
789 | * Returns 1 if LBA capacity looks sensible, 0 otherwise. | ||
790 | * | ||
791 | * It is called only once for each device. | ||
792 | */ | ||
793 | static inline int ata_id_is_lba_capacity_ok(u16 *id) | ||
794 | { | ||
795 | unsigned long lba_sects, chs_sects, head, tail; | ||
796 | |||
797 | /* No non-LBA info .. so valid! */ | ||
798 | if (id[ATA_ID_CYLS] == 0) | ||
799 | return 1; | ||
800 | |||
801 | lba_sects = ata_id_u32(id, ATA_ID_LBA_CAPACITY); | ||
802 | |||
803 | /* | ||
804 | * The ATA spec tells large drives to return | ||
805 | * C/H/S = 16383/16/63 independent of their size. | ||
806 | * Some drives can be jumpered to use 15 heads instead of 16. | ||
807 | * Some drives can be jumpered to use 4092 cyls instead of 16383. | ||
808 | */ | ||
809 | if ((id[ATA_ID_CYLS] == 16383 || | ||
810 | (id[ATA_ID_CYLS] == 4092 && id[ATA_ID_CUR_CYLS] == 16383)) && | ||
811 | id[ATA_ID_SECTORS] == 63 && | ||
812 | (id[ATA_ID_HEADS] == 15 || id[ATA_ID_HEADS] == 16) && | ||
813 | (lba_sects >= 16383 * 63 * id[ATA_ID_HEADS])) | ||
814 | return 1; | ||
815 | |||
816 | chs_sects = id[ATA_ID_CYLS] * id[ATA_ID_HEADS] * id[ATA_ID_SECTORS]; | ||
817 | |||
818 | /* perform a rough sanity check on lba_sects: within 10% is OK */ | ||
819 | if (lba_sects - chs_sects < chs_sects/10) | ||
820 | return 1; | ||
821 | |||
822 | /* some drives have the word order reversed */ | ||
823 | head = (lba_sects >> 16) & 0xffff; | ||
824 | tail = lba_sects & 0xffff; | ||
825 | lba_sects = head | (tail << 16); | ||
826 | |||
827 | if (lba_sects - chs_sects < chs_sects/10) { | ||
828 | *(__le32 *)&id[ATA_ID_LBA_CAPACITY] = __cpu_to_le32(lba_sects); | ||
829 | return 1; /* LBA capacity is (now) good */ | ||
830 | } | ||
831 | |||
832 | return 0; /* LBA capacity value may be bad */ | ||
833 | } | ||
834 | |||
835 | static inline void ata_id_to_hd_driveid(u16 *id) | ||
836 | { | ||
837 | #ifdef __BIG_ENDIAN | ||
838 | /* accessed in struct hd_driveid as 8-bit values */ | ||
839 | id[ATA_ID_MAX_MULTSECT] = __cpu_to_le16(id[ATA_ID_MAX_MULTSECT]); | ||
840 | id[ATA_ID_CAPABILITY] = __cpu_to_le16(id[ATA_ID_CAPABILITY]); | ||
841 | id[ATA_ID_OLD_PIO_MODES] = __cpu_to_le16(id[ATA_ID_OLD_PIO_MODES]); | ||
842 | id[ATA_ID_OLD_DMA_MODES] = __cpu_to_le16(id[ATA_ID_OLD_DMA_MODES]); | ||
843 | id[ATA_ID_MULTSECT] = __cpu_to_le16(id[ATA_ID_MULTSECT]); | ||
844 | |||
845 | /* as 32-bit values */ | ||
846 | *(u32 *)&id[ATA_ID_LBA_CAPACITY] = ata_id_u32(id, ATA_ID_LBA_CAPACITY); | ||
847 | *(u32 *)&id[ATA_ID_SPG] = ata_id_u32(id, ATA_ID_SPG); | ||
848 | |||
849 | /* as 64-bit value */ | ||
850 | *(u64 *)&id[ATA_ID_LBA_CAPACITY_2] = | ||
851 | ata_id_u64(id, ATA_ID_LBA_CAPACITY_2); | ||
852 | #endif | ||
853 | } | ||
854 | |||
730 | static inline int is_multi_taskfile(struct ata_taskfile *tf) | 855 | static inline int is_multi_taskfile(struct ata_taskfile *tf) |
731 | { | 856 | { |
732 | return (tf->command == ATA_CMD_READ_MULTI) || | 857 | return (tf->command == ATA_CMD_READ_MULTI) || |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 0933a14e6414..ff5b4cf9e2da 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -26,21 +26,8 @@ | |||
26 | 26 | ||
27 | #ifdef CONFIG_BLOCK | 27 | #ifdef CONFIG_BLOCK |
28 | 28 | ||
29 | /* Platforms may set this to teach the BIO layer about IOMMU hardware. */ | ||
30 | #include <asm/io.h> | 29 | #include <asm/io.h> |
31 | 30 | ||
32 | #if defined(BIO_VMERGE_MAX_SIZE) && defined(BIO_VMERGE_BOUNDARY) | ||
33 | #define BIOVEC_VIRT_START_SIZE(x) (bvec_to_phys(x) & (BIO_VMERGE_BOUNDARY - 1)) | ||
34 | #define BIOVEC_VIRT_OVERSIZE(x) ((x) > BIO_VMERGE_MAX_SIZE) | ||
35 | #else | ||
36 | #define BIOVEC_VIRT_START_SIZE(x) 0 | ||
37 | #define BIOVEC_VIRT_OVERSIZE(x) 0 | ||
38 | #endif | ||
39 | |||
40 | #ifndef BIO_VMERGE_BOUNDARY | ||
41 | #define BIO_VMERGE_BOUNDARY 0 | ||
42 | #endif | ||
43 | |||
44 | #define BIO_DEBUG | 31 | #define BIO_DEBUG |
45 | 32 | ||
46 | #ifdef BIO_DEBUG | 33 | #ifdef BIO_DEBUG |
@@ -88,25 +75,14 @@ struct bio { | |||
88 | /* Number of segments in this BIO after | 75 | /* Number of segments in this BIO after |
89 | * physical address coalescing is performed. | 76 | * physical address coalescing is performed. |
90 | */ | 77 | */ |
91 | unsigned short bi_phys_segments; | 78 | unsigned int bi_phys_segments; |
92 | |||
93 | /* Number of segments after physical and DMA remapping | ||
94 | * hardware coalescing is performed. | ||
95 | */ | ||
96 | unsigned short bi_hw_segments; | ||
97 | 79 | ||
98 | unsigned int bi_size; /* residual I/O count */ | 80 | unsigned int bi_size; /* residual I/O count */ |
99 | 81 | ||
100 | /* | ||
101 | * To keep track of the max hw size, we account for the | ||
102 | * sizes of the first and last virtually mergeable segments | ||
103 | * in this bio | ||
104 | */ | ||
105 | unsigned int bi_hw_front_size; | ||
106 | unsigned int bi_hw_back_size; | ||
107 | |||
108 | unsigned int bi_max_vecs; /* max bvl_vecs we can hold */ | 82 | unsigned int bi_max_vecs; /* max bvl_vecs we can hold */ |
109 | 83 | ||
84 | unsigned int bi_comp_cpu; /* completion CPU */ | ||
85 | |||
110 | struct bio_vec *bi_io_vec; /* the actual vec list */ | 86 | struct bio_vec *bi_io_vec; /* the actual vec list */ |
111 | 87 | ||
112 | bio_end_io_t *bi_end_io; | 88 | bio_end_io_t *bi_end_io; |
@@ -126,11 +102,14 @@ struct bio { | |||
126 | #define BIO_UPTODATE 0 /* ok after I/O completion */ | 102 | #define BIO_UPTODATE 0 /* ok after I/O completion */ |
127 | #define BIO_RW_BLOCK 1 /* RW_AHEAD set, and read/write would block */ | 103 | #define BIO_RW_BLOCK 1 /* RW_AHEAD set, and read/write would block */ |
128 | #define BIO_EOF 2 /* out-out-bounds error */ | 104 | #define BIO_EOF 2 /* out-out-bounds error */ |
129 | #define BIO_SEG_VALID 3 /* nr_hw_seg valid */ | 105 | #define BIO_SEG_VALID 3 /* bi_phys_segments valid */ |
130 | #define BIO_CLONED 4 /* doesn't own data */ | 106 | #define BIO_CLONED 4 /* doesn't own data */ |
131 | #define BIO_BOUNCED 5 /* bio is a bounce bio */ | 107 | #define BIO_BOUNCED 5 /* bio is a bounce bio */ |
132 | #define BIO_USER_MAPPED 6 /* contains user pages */ | 108 | #define BIO_USER_MAPPED 6 /* contains user pages */ |
133 | #define BIO_EOPNOTSUPP 7 /* not supported */ | 109 | #define BIO_EOPNOTSUPP 7 /* not supported */ |
110 | #define BIO_CPU_AFFINE 8 /* complete bio on same CPU as submitted */ | ||
111 | #define BIO_NULL_MAPPED 9 /* contains invalid user pages */ | ||
112 | #define BIO_FS_INTEGRITY 10 /* fs owns integrity data, not block layer */ | ||
134 | #define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag))) | 113 | #define bio_flagged(bio, flag) ((bio)->bi_flags & (1 << (flag))) |
135 | 114 | ||
136 | /* | 115 | /* |
@@ -144,18 +123,31 @@ struct bio { | |||
144 | /* | 123 | /* |
145 | * bio bi_rw flags | 124 | * bio bi_rw flags |
146 | * | 125 | * |
147 | * bit 0 -- read (not set) or write (set) | 126 | * bit 0 -- data direction |
127 | * If not set, bio is a read from device. If set, it's a write to device. | ||
148 | * bit 1 -- rw-ahead when set | 128 | * bit 1 -- rw-ahead when set |
149 | * bit 2 -- barrier | 129 | * bit 2 -- barrier |
130 | * Insert a serialization point in the IO queue, forcing previously | ||
131 | * submitted IO to be completed before this oen is issued. | ||
150 | * bit 3 -- fail fast, don't want low level driver retries | 132 | * bit 3 -- fail fast, don't want low level driver retries |
151 | * bit 4 -- synchronous I/O hint: the block layer will unplug immediately | 133 | * bit 4 -- synchronous I/O hint: the block layer will unplug immediately |
134 | * Note that this does NOT indicate that the IO itself is sync, just | ||
135 | * that the block layer will not postpone issue of this IO by plugging. | ||
136 | * bit 5 -- metadata request | ||
137 | * Used for tracing to differentiate metadata and data IO. May also | ||
138 | * get some preferential treatment in the IO scheduler | ||
139 | * bit 6 -- discard sectors | ||
140 | * Informs the lower level device that this range of sectors is no longer | ||
141 | * used by the file system and may thus be freed by the device. Used | ||
142 | * for flash based storage. | ||
152 | */ | 143 | */ |
153 | #define BIO_RW 0 | 144 | #define BIO_RW 0 /* Must match RW in req flags (blkdev.h) */ |
154 | #define BIO_RW_AHEAD 1 | 145 | #define BIO_RW_AHEAD 1 /* Must match FAILFAST in req flags */ |
155 | #define BIO_RW_BARRIER 2 | 146 | #define BIO_RW_BARRIER 2 |
156 | #define BIO_RW_FAILFAST 3 | 147 | #define BIO_RW_FAILFAST 3 |
157 | #define BIO_RW_SYNC 4 | 148 | #define BIO_RW_SYNC 4 |
158 | #define BIO_RW_META 5 | 149 | #define BIO_RW_META 5 |
150 | #define BIO_RW_DISCARD 6 | ||
159 | 151 | ||
160 | /* | 152 | /* |
161 | * upper 16 bits of bi_rw define the io priority of this bio | 153 | * upper 16 bits of bi_rw define the io priority of this bio |
@@ -185,14 +177,15 @@ struct bio { | |||
185 | #define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST)) | 177 | #define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST)) |
186 | #define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD)) | 178 | #define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD)) |
187 | #define bio_rw_meta(bio) ((bio)->bi_rw & (1 << BIO_RW_META)) | 179 | #define bio_rw_meta(bio) ((bio)->bi_rw & (1 << BIO_RW_META)) |
188 | #define bio_empty_barrier(bio) (bio_barrier(bio) && !(bio)->bi_size) | 180 | #define bio_discard(bio) ((bio)->bi_rw & (1 << BIO_RW_DISCARD)) |
181 | #define bio_empty_barrier(bio) (bio_barrier(bio) && !bio_has_data(bio) && !bio_discard(bio)) | ||
189 | 182 | ||
190 | static inline unsigned int bio_cur_sectors(struct bio *bio) | 183 | static inline unsigned int bio_cur_sectors(struct bio *bio) |
191 | { | 184 | { |
192 | if (bio->bi_vcnt) | 185 | if (bio->bi_vcnt) |
193 | return bio_iovec(bio)->bv_len >> 9; | 186 | return bio_iovec(bio)->bv_len >> 9; |
194 | 187 | else /* dataless requests such as discard */ | |
195 | return 0; | 188 | return bio->bi_size >> 9; |
196 | } | 189 | } |
197 | 190 | ||
198 | static inline void *bio_data(struct bio *bio) | 191 | static inline void *bio_data(struct bio *bio) |
@@ -236,8 +229,6 @@ static inline void *bio_data(struct bio *bio) | |||
236 | ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2))) | 229 | ((bvec_to_phys((vec1)) + (vec1)->bv_len) == bvec_to_phys((vec2))) |
237 | #endif | 230 | #endif |
238 | 231 | ||
239 | #define BIOVEC_VIRT_MERGEABLE(vec1, vec2) \ | ||
240 | ((((bvec_to_phys((vec1)) + (vec1)->bv_len) | bvec_to_phys((vec2))) & (BIO_VMERGE_BOUNDARY - 1)) == 0) | ||
241 | #define __BIO_SEG_BOUNDARY(addr1, addr2, mask) \ | 232 | #define __BIO_SEG_BOUNDARY(addr1, addr2, mask) \ |
242 | (((addr1) | (mask)) == (((addr2) - 1) | (mask))) | 233 | (((addr1) | (mask)) == (((addr2) - 1) | (mask))) |
243 | #define BIOVEC_SEG_BOUNDARY(q, b1, b2) \ | 234 | #define BIOVEC_SEG_BOUNDARY(q, b1, b2) \ |
@@ -319,15 +310,14 @@ struct bio_pair { | |||
319 | atomic_t cnt; | 310 | atomic_t cnt; |
320 | int error; | 311 | int error; |
321 | }; | 312 | }; |
322 | extern struct bio_pair *bio_split(struct bio *bi, mempool_t *pool, | 313 | extern struct bio_pair *bio_split(struct bio *bi, int first_sectors); |
323 | int first_sectors); | ||
324 | extern mempool_t *bio_split_pool; | ||
325 | extern void bio_pair_release(struct bio_pair *dbio); | 314 | extern void bio_pair_release(struct bio_pair *dbio); |
326 | 315 | ||
327 | extern struct bio_set *bioset_create(int, int); | 316 | extern struct bio_set *bioset_create(int, int); |
328 | extern void bioset_free(struct bio_set *); | 317 | extern void bioset_free(struct bio_set *); |
329 | 318 | ||
330 | extern struct bio *bio_alloc(gfp_t, int); | 319 | extern struct bio *bio_alloc(gfp_t, int); |
320 | extern struct bio *bio_kmalloc(gfp_t, int); | ||
331 | extern struct bio *bio_alloc_bioset(gfp_t, int, struct bio_set *); | 321 | extern struct bio *bio_alloc_bioset(gfp_t, int, struct bio_set *); |
332 | extern void bio_put(struct bio *); | 322 | extern void bio_put(struct bio *); |
333 | extern void bio_free(struct bio *, struct bio_set *); | 323 | extern void bio_free(struct bio *, struct bio_set *); |
@@ -335,7 +325,6 @@ extern void bio_free(struct bio *, struct bio_set *); | |||
335 | extern void bio_endio(struct bio *, int); | 325 | extern void bio_endio(struct bio *, int); |
336 | struct request_queue; | 326 | struct request_queue; |
337 | extern int bio_phys_segments(struct request_queue *, struct bio *); | 327 | extern int bio_phys_segments(struct request_queue *, struct bio *); |
338 | extern int bio_hw_segments(struct request_queue *, struct bio *); | ||
339 | 328 | ||
340 | extern void __bio_clone(struct bio *, struct bio *); | 329 | extern void __bio_clone(struct bio *, struct bio *); |
341 | extern struct bio *bio_clone(struct bio *, gfp_t); | 330 | extern struct bio *bio_clone(struct bio *, gfp_t); |
@@ -346,12 +335,14 @@ extern int bio_add_page(struct bio *, struct page *, unsigned int,unsigned int); | |||
346 | extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *, | 335 | extern int bio_add_pc_page(struct request_queue *, struct bio *, struct page *, |
347 | unsigned int, unsigned int); | 336 | unsigned int, unsigned int); |
348 | extern int bio_get_nr_vecs(struct block_device *); | 337 | extern int bio_get_nr_vecs(struct block_device *); |
338 | extern sector_t bio_sector_offset(struct bio *, unsigned short, unsigned int); | ||
349 | extern struct bio *bio_map_user(struct request_queue *, struct block_device *, | 339 | extern struct bio *bio_map_user(struct request_queue *, struct block_device *, |
350 | unsigned long, unsigned int, int); | 340 | unsigned long, unsigned int, int, gfp_t); |
351 | struct sg_iovec; | 341 | struct sg_iovec; |
342 | struct rq_map_data; | ||
352 | extern struct bio *bio_map_user_iov(struct request_queue *, | 343 | extern struct bio *bio_map_user_iov(struct request_queue *, |
353 | struct block_device *, | 344 | struct block_device *, |
354 | struct sg_iovec *, int, int); | 345 | struct sg_iovec *, int, int, gfp_t); |
355 | extern void bio_unmap_user(struct bio *); | 346 | extern void bio_unmap_user(struct bio *); |
356 | extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int, | 347 | extern struct bio *bio_map_kern(struct request_queue *, void *, unsigned int, |
357 | gfp_t); | 348 | gfp_t); |
@@ -359,15 +350,25 @@ extern struct bio *bio_copy_kern(struct request_queue *, void *, unsigned int, | |||
359 | gfp_t, int); | 350 | gfp_t, int); |
360 | extern void bio_set_pages_dirty(struct bio *bio); | 351 | extern void bio_set_pages_dirty(struct bio *bio); |
361 | extern void bio_check_pages_dirty(struct bio *bio); | 352 | extern void bio_check_pages_dirty(struct bio *bio); |
362 | extern struct bio *bio_copy_user(struct request_queue *, unsigned long, unsigned int, int); | 353 | extern struct bio *bio_copy_user(struct request_queue *, struct rq_map_data *, |
363 | extern struct bio *bio_copy_user_iov(struct request_queue *, struct sg_iovec *, | 354 | unsigned long, unsigned int, int, gfp_t); |
364 | int, int); | 355 | extern struct bio *bio_copy_user_iov(struct request_queue *, |
356 | struct rq_map_data *, struct sg_iovec *, | ||
357 | int, int, gfp_t); | ||
365 | extern int bio_uncopy_user(struct bio *); | 358 | extern int bio_uncopy_user(struct bio *); |
366 | void zero_fill_bio(struct bio *bio); | 359 | void zero_fill_bio(struct bio *bio); |
367 | extern struct bio_vec *bvec_alloc_bs(gfp_t, int, unsigned long *, struct bio_set *); | 360 | extern struct bio_vec *bvec_alloc_bs(gfp_t, int, unsigned long *, struct bio_set *); |
368 | extern unsigned int bvec_nr_vecs(unsigned short idx); | 361 | extern unsigned int bvec_nr_vecs(unsigned short idx); |
369 | 362 | ||
370 | /* | 363 | /* |
364 | * Allow queuer to specify a completion CPU for this bio | ||
365 | */ | ||
366 | static inline void bio_set_completion_cpu(struct bio *bio, unsigned int cpu) | ||
367 | { | ||
368 | bio->bi_comp_cpu = cpu; | ||
369 | } | ||
370 | |||
371 | /* | ||
371 | * bio_set is used to allow other portions of the IO system to | 372 | * bio_set is used to allow other portions of the IO system to |
372 | * allocate their own private memory pools for bio and iovec structures. | 373 | * allocate their own private memory pools for bio and iovec structures. |
373 | * These memory pools in turn all allocate from the bio_slab | 374 | * These memory pools in turn all allocate from the bio_slab |
@@ -445,6 +446,14 @@ static inline char *__bio_kmap_irq(struct bio *bio, unsigned short idx, | |||
445 | __bio_kmap_irq((bio), (bio)->bi_idx, (flags)) | 446 | __bio_kmap_irq((bio), (bio)->bi_idx, (flags)) |
446 | #define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags) | 447 | #define bio_kunmap_irq(buf,flags) __bio_kunmap_irq(buf, flags) |
447 | 448 | ||
449 | /* | ||
450 | * Check whether this bio carries any data or not. A NULL bio is allowed. | ||
451 | */ | ||
452 | static inline int bio_has_data(struct bio *bio) | ||
453 | { | ||
454 | return bio && bio->bi_io_vec != NULL; | ||
455 | } | ||
456 | |||
448 | #if defined(CONFIG_BLK_DEV_INTEGRITY) | 457 | #if defined(CONFIG_BLK_DEV_INTEGRITY) |
449 | 458 | ||
450 | #define bip_vec_idx(bip, idx) (&(bip->bip_vec[(idx)])) | 459 | #define bip_vec_idx(bip, idx) (&(bip->bip_vec[(idx)])) |
@@ -458,14 +467,7 @@ static inline char *__bio_kmap_irq(struct bio *bio, unsigned short idx, | |||
458 | #define bip_for_each_vec(bvl, bip, i) \ | 467 | #define bip_for_each_vec(bvl, bip, i) \ |
459 | __bip_for_each_vec(bvl, bip, i, (bip)->bip_idx) | 468 | __bip_for_each_vec(bvl, bip, i, (bip)->bip_idx) |
460 | 469 | ||
461 | static inline int bio_integrity(struct bio *bio) | 470 | #define bio_integrity(bio) (bio->bi_integrity != NULL) |
462 | { | ||
463 | #if defined(CONFIG_BLK_DEV_INTEGRITY) | ||
464 | return bio->bi_integrity != NULL; | ||
465 | #else | ||
466 | return 0; | ||
467 | #endif | ||
468 | } | ||
469 | 471 | ||
470 | extern struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *, gfp_t, unsigned int, struct bio_set *); | 472 | extern struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *, gfp_t, unsigned int, struct bio_set *); |
471 | extern struct bio_integrity_payload *bio_integrity_alloc(struct bio *, gfp_t, unsigned int); | 473 | extern struct bio_integrity_payload *bio_integrity_alloc(struct bio *, gfp_t, unsigned int); |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 53ea933cf60b..a92d9e4ea96e 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -16,7 +16,9 @@ | |||
16 | #include <linux/bio.h> | 16 | #include <linux/bio.h> |
17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
18 | #include <linux/stringify.h> | 18 | #include <linux/stringify.h> |
19 | #include <linux/gfp.h> | ||
19 | #include <linux/bsg.h> | 20 | #include <linux/bsg.h> |
21 | #include <linux/smp.h> | ||
20 | 22 | ||
21 | #include <asm/scatterlist.h> | 23 | #include <asm/scatterlist.h> |
22 | 24 | ||
@@ -54,7 +56,6 @@ enum rq_cmd_type_bits { | |||
54 | REQ_TYPE_PM_SUSPEND, /* suspend request */ | 56 | REQ_TYPE_PM_SUSPEND, /* suspend request */ |
55 | REQ_TYPE_PM_RESUME, /* resume request */ | 57 | REQ_TYPE_PM_RESUME, /* resume request */ |
56 | REQ_TYPE_PM_SHUTDOWN, /* shutdown request */ | 58 | REQ_TYPE_PM_SHUTDOWN, /* shutdown request */ |
57 | REQ_TYPE_FLUSH, /* flush request */ | ||
58 | REQ_TYPE_SPECIAL, /* driver defined type */ | 59 | REQ_TYPE_SPECIAL, /* driver defined type */ |
59 | REQ_TYPE_LINUX_BLOCK, /* generic block layer message */ | 60 | REQ_TYPE_LINUX_BLOCK, /* generic block layer message */ |
60 | /* | 61 | /* |
@@ -76,19 +77,18 @@ enum rq_cmd_type_bits { | |||
76 | * | 77 | * |
77 | */ | 78 | */ |
78 | enum { | 79 | enum { |
79 | /* | ||
80 | * just examples for now | ||
81 | */ | ||
82 | REQ_LB_OP_EJECT = 0x40, /* eject request */ | 80 | REQ_LB_OP_EJECT = 0x40, /* eject request */ |
83 | REQ_LB_OP_FLUSH = 0x41, /* flush device */ | 81 | REQ_LB_OP_FLUSH = 0x41, /* flush request */ |
82 | REQ_LB_OP_DISCARD = 0x42, /* discard sectors */ | ||
84 | }; | 83 | }; |
85 | 84 | ||
86 | /* | 85 | /* |
87 | * request type modified bits. first three bits match BIO_RW* bits, important | 86 | * request type modified bits. first two bits match BIO_RW* bits, important |
88 | */ | 87 | */ |
89 | enum rq_flag_bits { | 88 | enum rq_flag_bits { |
90 | __REQ_RW, /* not set, read. set, write */ | 89 | __REQ_RW, /* not set, read. set, write */ |
91 | __REQ_FAILFAST, /* no low level driver retries */ | 90 | __REQ_FAILFAST, /* no low level driver retries */ |
91 | __REQ_DISCARD, /* request to discard sectors */ | ||
92 | __REQ_SORTED, /* elevator knows about this request */ | 92 | __REQ_SORTED, /* elevator knows about this request */ |
93 | __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ | 93 | __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ |
94 | __REQ_HARDBARRIER, /* may not be passed by drive either */ | 94 | __REQ_HARDBARRIER, /* may not be passed by drive either */ |
@@ -111,6 +111,7 @@ enum rq_flag_bits { | |||
111 | }; | 111 | }; |
112 | 112 | ||
113 | #define REQ_RW (1 << __REQ_RW) | 113 | #define REQ_RW (1 << __REQ_RW) |
114 | #define REQ_DISCARD (1 << __REQ_DISCARD) | ||
114 | #define REQ_FAILFAST (1 << __REQ_FAILFAST) | 115 | #define REQ_FAILFAST (1 << __REQ_FAILFAST) |
115 | #define REQ_SORTED (1 << __REQ_SORTED) | 116 | #define REQ_SORTED (1 << __REQ_SORTED) |
116 | #define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) | 117 | #define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) |
@@ -140,12 +141,14 @@ enum rq_flag_bits { | |||
140 | */ | 141 | */ |
141 | struct request { | 142 | struct request { |
142 | struct list_head queuelist; | 143 | struct list_head queuelist; |
143 | struct list_head donelist; | 144 | struct call_single_data csd; |
145 | int cpu; | ||
144 | 146 | ||
145 | struct request_queue *q; | 147 | struct request_queue *q; |
146 | 148 | ||
147 | unsigned int cmd_flags; | 149 | unsigned int cmd_flags; |
148 | enum rq_cmd_type_bits cmd_type; | 150 | enum rq_cmd_type_bits cmd_type; |
151 | unsigned long atomic_flags; | ||
149 | 152 | ||
150 | /* Maintain bio traversal state for part by part I/O submission. | 153 | /* Maintain bio traversal state for part by part I/O submission. |
151 | * hard_* are block layer internals, no driver should touch them! | 154 | * hard_* are block layer internals, no driver should touch them! |
@@ -190,13 +193,6 @@ struct request { | |||
190 | */ | 193 | */ |
191 | unsigned short nr_phys_segments; | 194 | unsigned short nr_phys_segments; |
192 | 195 | ||
193 | /* Number of scatter-gather addr+len pairs after | ||
194 | * physical and DMA remapping hardware coalescing is performed. | ||
195 | * This is the number of scatter-gather entries the driver | ||
196 | * will actually have to deal with after DMA mapping is done. | ||
197 | */ | ||
198 | unsigned short nr_hw_segments; | ||
199 | |||
200 | unsigned short ioprio; | 196 | unsigned short ioprio; |
201 | 197 | ||
202 | void *special; | 198 | void *special; |
@@ -220,6 +216,8 @@ struct request { | |||
220 | void *data; | 216 | void *data; |
221 | void *sense; | 217 | void *sense; |
222 | 218 | ||
219 | unsigned long deadline; | ||
220 | struct list_head timeout_list; | ||
223 | unsigned int timeout; | 221 | unsigned int timeout; |
224 | int retries; | 222 | int retries; |
225 | 223 | ||
@@ -233,6 +231,11 @@ struct request { | |||
233 | struct request *next_rq; | 231 | struct request *next_rq; |
234 | }; | 232 | }; |
235 | 233 | ||
234 | static inline unsigned short req_get_ioprio(struct request *req) | ||
235 | { | ||
236 | return req->ioprio; | ||
237 | } | ||
238 | |||
236 | /* | 239 | /* |
237 | * State information carried for REQ_TYPE_PM_SUSPEND and REQ_TYPE_PM_RESUME | 240 | * State information carried for REQ_TYPE_PM_SUSPEND and REQ_TYPE_PM_RESUME |
238 | * requests. Some step values could eventually be made generic. | 241 | * requests. Some step values could eventually be made generic. |
@@ -252,6 +255,7 @@ typedef void (request_fn_proc) (struct request_queue *q); | |||
252 | typedef int (make_request_fn) (struct request_queue *q, struct bio *bio); | 255 | typedef int (make_request_fn) (struct request_queue *q, struct bio *bio); |
253 | typedef int (prep_rq_fn) (struct request_queue *, struct request *); | 256 | typedef int (prep_rq_fn) (struct request_queue *, struct request *); |
254 | typedef void (unplug_fn) (struct request_queue *); | 257 | typedef void (unplug_fn) (struct request_queue *); |
258 | typedef int (prepare_discard_fn) (struct request_queue *, struct request *); | ||
255 | 259 | ||
256 | struct bio_vec; | 260 | struct bio_vec; |
257 | struct bvec_merge_data { | 261 | struct bvec_merge_data { |
@@ -265,6 +269,15 @@ typedef int (merge_bvec_fn) (struct request_queue *, struct bvec_merge_data *, | |||
265 | typedef void (prepare_flush_fn) (struct request_queue *, struct request *); | 269 | typedef void (prepare_flush_fn) (struct request_queue *, struct request *); |
266 | typedef void (softirq_done_fn)(struct request *); | 270 | typedef void (softirq_done_fn)(struct request *); |
267 | typedef int (dma_drain_needed_fn)(struct request *); | 271 | typedef int (dma_drain_needed_fn)(struct request *); |
272 | typedef int (lld_busy_fn) (struct request_queue *q); | ||
273 | |||
274 | enum blk_eh_timer_return { | ||
275 | BLK_EH_NOT_HANDLED, | ||
276 | BLK_EH_HANDLED, | ||
277 | BLK_EH_RESET_TIMER, | ||
278 | }; | ||
279 | |||
280 | typedef enum blk_eh_timer_return (rq_timed_out_fn)(struct request *); | ||
268 | 281 | ||
269 | enum blk_queue_state { | 282 | enum blk_queue_state { |
270 | Queue_down, | 283 | Queue_down, |
@@ -307,10 +320,13 @@ struct request_queue | |||
307 | make_request_fn *make_request_fn; | 320 | make_request_fn *make_request_fn; |
308 | prep_rq_fn *prep_rq_fn; | 321 | prep_rq_fn *prep_rq_fn; |
309 | unplug_fn *unplug_fn; | 322 | unplug_fn *unplug_fn; |
323 | prepare_discard_fn *prepare_discard_fn; | ||
310 | merge_bvec_fn *merge_bvec_fn; | 324 | merge_bvec_fn *merge_bvec_fn; |
311 | prepare_flush_fn *prepare_flush_fn; | 325 | prepare_flush_fn *prepare_flush_fn; |
312 | softirq_done_fn *softirq_done_fn; | 326 | softirq_done_fn *softirq_done_fn; |
327 | rq_timed_out_fn *rq_timed_out_fn; | ||
313 | dma_drain_needed_fn *dma_drain_needed; | 328 | dma_drain_needed_fn *dma_drain_needed; |
329 | lld_busy_fn *lld_busy_fn; | ||
314 | 330 | ||
315 | /* | 331 | /* |
316 | * Dispatch queue sorting | 332 | * Dispatch queue sorting |
@@ -385,6 +401,10 @@ struct request_queue | |||
385 | unsigned int nr_sorted; | 401 | unsigned int nr_sorted; |
386 | unsigned int in_flight; | 402 | unsigned int in_flight; |
387 | 403 | ||
404 | unsigned int rq_timeout; | ||
405 | struct timer_list timeout; | ||
406 | struct list_head timeout_list; | ||
407 | |||
388 | /* | 408 | /* |
389 | * sg stuff | 409 | * sg stuff |
390 | */ | 410 | */ |
@@ -421,6 +441,10 @@ struct request_queue | |||
421 | #define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */ | 441 | #define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */ |
422 | #define QUEUE_FLAG_BIDI 9 /* queue supports bidi requests */ | 442 | #define QUEUE_FLAG_BIDI 9 /* queue supports bidi requests */ |
423 | #define QUEUE_FLAG_NOMERGES 10 /* disable merge attempts */ | 443 | #define QUEUE_FLAG_NOMERGES 10 /* disable merge attempts */ |
444 | #define QUEUE_FLAG_SAME_COMP 11 /* force complete on same CPU */ | ||
445 | #define QUEUE_FLAG_FAIL_IO 12 /* fake timeout */ | ||
446 | #define QUEUE_FLAG_STACKABLE 13 /* supports request stacking */ | ||
447 | #define QUEUE_FLAG_NONROT 14 /* non-rotational device (SSD) */ | ||
424 | 448 | ||
425 | static inline int queue_is_locked(struct request_queue *q) | 449 | static inline int queue_is_locked(struct request_queue *q) |
426 | { | 450 | { |
@@ -526,7 +550,10 @@ enum { | |||
526 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) | 550 | #define blk_queue_tagged(q) test_bit(QUEUE_FLAG_QUEUED, &(q)->queue_flags) |
527 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) | 551 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) |
528 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) | 552 | #define blk_queue_nomerges(q) test_bit(QUEUE_FLAG_NOMERGES, &(q)->queue_flags) |
553 | #define blk_queue_nonrot(q) test_bit(QUEUE_FLAG_NONROT, &(q)->queue_flags) | ||
529 | #define blk_queue_flushing(q) ((q)->ordseq) | 554 | #define blk_queue_flushing(q) ((q)->ordseq) |
555 | #define blk_queue_stackable(q) \ | ||
556 | test_bit(QUEUE_FLAG_STACKABLE, &(q)->queue_flags) | ||
530 | 557 | ||
531 | #define blk_fs_request(rq) ((rq)->cmd_type == REQ_TYPE_FS) | 558 | #define blk_fs_request(rq) ((rq)->cmd_type == REQ_TYPE_FS) |
532 | #define blk_pc_request(rq) ((rq)->cmd_type == REQ_TYPE_BLOCK_PC) | 559 | #define blk_pc_request(rq) ((rq)->cmd_type == REQ_TYPE_BLOCK_PC) |
@@ -536,16 +563,18 @@ enum { | |||
536 | #define blk_noretry_request(rq) ((rq)->cmd_flags & REQ_FAILFAST) | 563 | #define blk_noretry_request(rq) ((rq)->cmd_flags & REQ_FAILFAST) |
537 | #define blk_rq_started(rq) ((rq)->cmd_flags & REQ_STARTED) | 564 | #define blk_rq_started(rq) ((rq)->cmd_flags & REQ_STARTED) |
538 | 565 | ||
539 | #define blk_account_rq(rq) (blk_rq_started(rq) && blk_fs_request(rq)) | 566 | #define blk_account_rq(rq) (blk_rq_started(rq) && (blk_fs_request(rq) || blk_discard_rq(rq))) |
540 | 567 | ||
541 | #define blk_pm_suspend_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_SUSPEND) | 568 | #define blk_pm_suspend_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_SUSPEND) |
542 | #define blk_pm_resume_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_RESUME) | 569 | #define blk_pm_resume_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_RESUME) |
543 | #define blk_pm_request(rq) \ | 570 | #define blk_pm_request(rq) \ |
544 | (blk_pm_suspend_request(rq) || blk_pm_resume_request(rq)) | 571 | (blk_pm_suspend_request(rq) || blk_pm_resume_request(rq)) |
545 | 572 | ||
573 | #define blk_rq_cpu_valid(rq) ((rq)->cpu != -1) | ||
546 | #define blk_sorted_rq(rq) ((rq)->cmd_flags & REQ_SORTED) | 574 | #define blk_sorted_rq(rq) ((rq)->cmd_flags & REQ_SORTED) |
547 | #define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER) | 575 | #define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER) |
548 | #define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) | 576 | #define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) |
577 | #define blk_discard_rq(rq) ((rq)->cmd_flags & REQ_DISCARD) | ||
549 | #define blk_bidi_rq(rq) ((rq)->next_rq != NULL) | 578 | #define blk_bidi_rq(rq) ((rq)->next_rq != NULL) |
550 | #define blk_empty_barrier(rq) (blk_barrier_rq(rq) && blk_fs_request(rq) && !(rq)->hard_nr_sectors) | 579 | #define blk_empty_barrier(rq) (blk_barrier_rq(rq) && blk_fs_request(rq) && !(rq)->hard_nr_sectors) |
551 | /* rq->queuelist of dequeued request must be list_empty() */ | 580 | /* rq->queuelist of dequeued request must be list_empty() */ |
@@ -592,7 +621,8 @@ static inline void blk_clear_queue_full(struct request_queue *q, int rw) | |||
592 | #define RQ_NOMERGE_FLAGS \ | 621 | #define RQ_NOMERGE_FLAGS \ |
593 | (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER) | 622 | (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER) |
594 | #define rq_mergeable(rq) \ | 623 | #define rq_mergeable(rq) \ |
595 | (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && blk_fs_request((rq))) | 624 | (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && \ |
625 | (blk_discard_rq(rq) || blk_fs_request((rq)))) | ||
596 | 626 | ||
597 | /* | 627 | /* |
598 | * q->prep_rq_fn return values | 628 | * q->prep_rq_fn return values |
@@ -637,6 +667,12 @@ static inline void blk_queue_bounce(struct request_queue *q, struct bio **bio) | |||
637 | } | 667 | } |
638 | #endif /* CONFIG_MMU */ | 668 | #endif /* CONFIG_MMU */ |
639 | 669 | ||
670 | struct rq_map_data { | ||
671 | struct page **pages; | ||
672 | int page_order; | ||
673 | int nr_entries; | ||
674 | }; | ||
675 | |||
640 | struct req_iterator { | 676 | struct req_iterator { |
641 | int i; | 677 | int i; |
642 | struct bio *bio; | 678 | struct bio *bio; |
@@ -664,6 +700,10 @@ extern void __blk_put_request(struct request_queue *, struct request *); | |||
664 | extern struct request *blk_get_request(struct request_queue *, int, gfp_t); | 700 | extern struct request *blk_get_request(struct request_queue *, int, gfp_t); |
665 | extern void blk_insert_request(struct request_queue *, struct request *, int, void *); | 701 | extern void blk_insert_request(struct request_queue *, struct request *, int, void *); |
666 | extern void blk_requeue_request(struct request_queue *, struct request *); | 702 | extern void blk_requeue_request(struct request_queue *, struct request *); |
703 | extern int blk_rq_check_limits(struct request_queue *q, struct request *rq); | ||
704 | extern int blk_lld_busy(struct request_queue *q); | ||
705 | extern int blk_insert_cloned_request(struct request_queue *q, | ||
706 | struct request *rq); | ||
667 | extern void blk_plug_device(struct request_queue *); | 707 | extern void blk_plug_device(struct request_queue *); |
668 | extern void blk_plug_device_unlocked(struct request_queue *); | 708 | extern void blk_plug_device_unlocked(struct request_queue *); |
669 | extern int blk_remove_plug(struct request_queue *); | 709 | extern int blk_remove_plug(struct request_queue *); |
@@ -705,11 +745,14 @@ extern void __blk_stop_queue(struct request_queue *q); | |||
705 | extern void __blk_run_queue(struct request_queue *); | 745 | extern void __blk_run_queue(struct request_queue *); |
706 | extern void blk_run_queue(struct request_queue *); | 746 | extern void blk_run_queue(struct request_queue *); |
707 | extern void blk_start_queueing(struct request_queue *); | 747 | extern void blk_start_queueing(struct request_queue *); |
708 | extern int blk_rq_map_user(struct request_queue *, struct request *, void __user *, unsigned long); | 748 | extern int blk_rq_map_user(struct request_queue *, struct request *, |
749 | struct rq_map_data *, void __user *, unsigned long, | ||
750 | gfp_t); | ||
709 | extern int blk_rq_unmap_user(struct bio *); | 751 | extern int blk_rq_unmap_user(struct bio *); |
710 | extern int blk_rq_map_kern(struct request_queue *, struct request *, void *, unsigned int, gfp_t); | 752 | extern int blk_rq_map_kern(struct request_queue *, struct request *, void *, unsigned int, gfp_t); |
711 | extern int blk_rq_map_user_iov(struct request_queue *, struct request *, | 753 | extern int blk_rq_map_user_iov(struct request_queue *, struct request *, |
712 | struct sg_iovec *, int, unsigned int); | 754 | struct rq_map_data *, struct sg_iovec *, int, |
755 | unsigned int, gfp_t); | ||
713 | extern int blk_execute_rq(struct request_queue *, struct gendisk *, | 756 | extern int blk_execute_rq(struct request_queue *, struct gendisk *, |
714 | struct request *, int); | 757 | struct request *, int); |
715 | extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *, | 758 | extern void blk_execute_rq_nowait(struct request_queue *, struct gendisk *, |
@@ -750,12 +793,15 @@ extern int __blk_end_request(struct request *rq, int error, | |||
750 | extern int blk_end_bidi_request(struct request *rq, int error, | 793 | extern int blk_end_bidi_request(struct request *rq, int error, |
751 | unsigned int nr_bytes, unsigned int bidi_bytes); | 794 | unsigned int nr_bytes, unsigned int bidi_bytes); |
752 | extern void end_request(struct request *, int); | 795 | extern void end_request(struct request *, int); |
753 | extern void end_queued_request(struct request *, int); | ||
754 | extern void end_dequeued_request(struct request *, int); | ||
755 | extern int blk_end_request_callback(struct request *rq, int error, | 796 | extern int blk_end_request_callback(struct request *rq, int error, |
756 | unsigned int nr_bytes, | 797 | unsigned int nr_bytes, |
757 | int (drv_callback)(struct request *)); | 798 | int (drv_callback)(struct request *)); |
758 | extern void blk_complete_request(struct request *); | 799 | extern void blk_complete_request(struct request *); |
800 | extern void __blk_complete_request(struct request *); | ||
801 | extern void blk_abort_request(struct request *); | ||
802 | extern void blk_abort_queue(struct request_queue *); | ||
803 | extern void blk_update_request(struct request *rq, int error, | ||
804 | unsigned int nr_bytes); | ||
759 | 805 | ||
760 | /* | 806 | /* |
761 | * blk_end_request() takes bytes instead of sectors as a complete size. | 807 | * blk_end_request() takes bytes instead of sectors as a complete size. |
@@ -790,12 +836,16 @@ extern void blk_queue_update_dma_pad(struct request_queue *, unsigned int); | |||
790 | extern int blk_queue_dma_drain(struct request_queue *q, | 836 | extern int blk_queue_dma_drain(struct request_queue *q, |
791 | dma_drain_needed_fn *dma_drain_needed, | 837 | dma_drain_needed_fn *dma_drain_needed, |
792 | void *buf, unsigned int size); | 838 | void *buf, unsigned int size); |
839 | extern void blk_queue_lld_busy(struct request_queue *q, lld_busy_fn *fn); | ||
793 | extern void blk_queue_segment_boundary(struct request_queue *, unsigned long); | 840 | extern void blk_queue_segment_boundary(struct request_queue *, unsigned long); |
794 | extern void blk_queue_prep_rq(struct request_queue *, prep_rq_fn *pfn); | 841 | extern void blk_queue_prep_rq(struct request_queue *, prep_rq_fn *pfn); |
795 | extern void blk_queue_merge_bvec(struct request_queue *, merge_bvec_fn *); | 842 | extern void blk_queue_merge_bvec(struct request_queue *, merge_bvec_fn *); |
796 | extern void blk_queue_dma_alignment(struct request_queue *, int); | 843 | extern void blk_queue_dma_alignment(struct request_queue *, int); |
797 | extern void blk_queue_update_dma_alignment(struct request_queue *, int); | 844 | extern void blk_queue_update_dma_alignment(struct request_queue *, int); |
798 | extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *); | 845 | extern void blk_queue_softirq_done(struct request_queue *, softirq_done_fn *); |
846 | extern void blk_queue_set_discard(struct request_queue *, prepare_discard_fn *); | ||
847 | extern void blk_queue_rq_timed_out(struct request_queue *, rq_timed_out_fn *); | ||
848 | extern void blk_queue_rq_timeout(struct request_queue *, unsigned int); | ||
799 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); | 849 | extern struct backing_dev_info *blk_get_backing_dev_info(struct block_device *bdev); |
800 | extern int blk_queue_ordered(struct request_queue *, unsigned, prepare_flush_fn *); | 850 | extern int blk_queue_ordered(struct request_queue *, unsigned, prepare_flush_fn *); |
801 | extern int blk_do_ordered(struct request_queue *, struct request **); | 851 | extern int blk_do_ordered(struct request_queue *, struct request **); |
@@ -837,6 +887,16 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt, | |||
837 | } | 887 | } |
838 | 888 | ||
839 | extern int blkdev_issue_flush(struct block_device *, sector_t *); | 889 | extern int blkdev_issue_flush(struct block_device *, sector_t *); |
890 | extern int blkdev_issue_discard(struct block_device *, | ||
891 | sector_t sector, sector_t nr_sects, gfp_t); | ||
892 | |||
893 | static inline int sb_issue_discard(struct super_block *sb, | ||
894 | sector_t block, sector_t nr_blocks) | ||
895 | { | ||
896 | block <<= (sb->s_blocksize_bits - 9); | ||
897 | nr_blocks <<= (sb->s_blocksize_bits - 9); | ||
898 | return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL); | ||
899 | } | ||
840 | 900 | ||
841 | /* | 901 | /* |
842 | * command filter functions | 902 | * command filter functions |
@@ -874,6 +934,13 @@ static inline int queue_dma_alignment(struct request_queue *q) | |||
874 | return q ? q->dma_alignment : 511; | 934 | return q ? q->dma_alignment : 511; |
875 | } | 935 | } |
876 | 936 | ||
937 | static inline int blk_rq_aligned(struct request_queue *q, void *addr, | ||
938 | unsigned int len) | ||
939 | { | ||
940 | unsigned int alignment = queue_dma_alignment(q) | q->dma_pad_mask; | ||
941 | return !((unsigned long)addr & alignment) && !(len & alignment); | ||
942 | } | ||
943 | |||
877 | /* assumes size > 256 */ | 944 | /* assumes size > 256 */ |
878 | static inline unsigned int blksize_bits(unsigned int size) | 945 | static inline unsigned int blksize_bits(unsigned int size) |
879 | { | 946 | { |
@@ -900,7 +967,7 @@ static inline void put_dev_sector(Sector p) | |||
900 | } | 967 | } |
901 | 968 | ||
902 | struct work_struct; | 969 | struct work_struct; |
903 | int kblockd_schedule_work(struct work_struct *work); | 970 | int kblockd_schedule_work(struct request_queue *q, struct work_struct *work); |
904 | void kblockd_flush_work(struct work_struct *work); | 971 | void kblockd_flush_work(struct work_struct *work); |
905 | 972 | ||
906 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ | 973 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ |
@@ -945,49 +1012,19 @@ struct blk_integrity { | |||
945 | 1012 | ||
946 | extern int blk_integrity_register(struct gendisk *, struct blk_integrity *); | 1013 | extern int blk_integrity_register(struct gendisk *, struct blk_integrity *); |
947 | extern void blk_integrity_unregister(struct gendisk *); | 1014 | extern void blk_integrity_unregister(struct gendisk *); |
948 | extern int blk_integrity_compare(struct block_device *, struct block_device *); | 1015 | extern int blk_integrity_compare(struct gendisk *, struct gendisk *); |
949 | extern int blk_rq_map_integrity_sg(struct request *, struct scatterlist *); | 1016 | extern int blk_rq_map_integrity_sg(struct request *, struct scatterlist *); |
950 | extern int blk_rq_count_integrity_sg(struct request *); | 1017 | extern int blk_rq_count_integrity_sg(struct request *); |
951 | 1018 | ||
952 | static inline unsigned short blk_integrity_tuple_size(struct blk_integrity *bi) | 1019 | static inline |
953 | { | 1020 | struct blk_integrity *bdev_get_integrity(struct block_device *bdev) |
954 | if (bi) | ||
955 | return bi->tuple_size; | ||
956 | |||
957 | return 0; | ||
958 | } | ||
959 | |||
960 | static inline struct blk_integrity *bdev_get_integrity(struct block_device *bdev) | ||
961 | { | 1021 | { |
962 | return bdev->bd_disk->integrity; | 1022 | return bdev->bd_disk->integrity; |
963 | } | 1023 | } |
964 | 1024 | ||
965 | static inline unsigned int bdev_get_tag_size(struct block_device *bdev) | 1025 | static inline struct blk_integrity *blk_get_integrity(struct gendisk *disk) |
966 | { | 1026 | { |
967 | struct blk_integrity *bi = bdev_get_integrity(bdev); | 1027 | return disk->integrity; |
968 | |||
969 | if (bi) | ||
970 | return bi->tag_size; | ||
971 | |||
972 | return 0; | ||
973 | } | ||
974 | |||
975 | static inline int bdev_integrity_enabled(struct block_device *bdev, int rw) | ||
976 | { | ||
977 | struct blk_integrity *bi = bdev_get_integrity(bdev); | ||
978 | |||
979 | if (bi == NULL) | ||
980 | return 0; | ||
981 | |||
982 | if (rw == READ && bi->verify_fn != NULL && | ||
983 | (bi->flags & INTEGRITY_FLAG_READ)) | ||
984 | return 1; | ||
985 | |||
986 | if (rw == WRITE && bi->generate_fn != NULL && | ||
987 | (bi->flags & INTEGRITY_FLAG_WRITE)) | ||
988 | return 1; | ||
989 | |||
990 | return 0; | ||
991 | } | 1028 | } |
992 | 1029 | ||
993 | static inline int blk_integrity_rq(struct request *rq) | 1030 | static inline int blk_integrity_rq(struct request *rq) |
@@ -1004,7 +1041,7 @@ static inline int blk_integrity_rq(struct request *rq) | |||
1004 | #define blk_rq_count_integrity_sg(a) (0) | 1041 | #define blk_rq_count_integrity_sg(a) (0) |
1005 | #define blk_rq_map_integrity_sg(a, b) (0) | 1042 | #define blk_rq_map_integrity_sg(a, b) (0) |
1006 | #define bdev_get_integrity(a) (0) | 1043 | #define bdev_get_integrity(a) (0) |
1007 | #define bdev_get_tag_size(a) (0) | 1044 | #define blk_get_integrity(a) (0) |
1008 | #define blk_integrity_compare(a, b) (0) | 1045 | #define blk_integrity_compare(a, b) (0) |
1009 | #define blk_integrity_register(a, b) (0) | 1046 | #define blk_integrity_register(a, b) (0) |
1010 | #define blk_integrity_unregister(a) do { } while (0); | 1047 | #define blk_integrity_unregister(a) do { } while (0); |
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index d084b8d227a5..3a31eb506164 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
@@ -1,8 +1,10 @@ | |||
1 | #ifndef BLKTRACE_H | 1 | #ifndef BLKTRACE_H |
2 | #define BLKTRACE_H | 2 | #define BLKTRACE_H |
3 | 3 | ||
4 | #ifdef __KERNEL__ | ||
4 | #include <linux/blkdev.h> | 5 | #include <linux/blkdev.h> |
5 | #include <linux/relay.h> | 6 | #include <linux/relay.h> |
7 | #endif | ||
6 | 8 | ||
7 | /* | 9 | /* |
8 | * Trace categories | 10 | * Trace categories |
@@ -21,6 +23,7 @@ enum blktrace_cat { | |||
21 | BLK_TC_NOTIFY = 1 << 10, /* special message */ | 23 | BLK_TC_NOTIFY = 1 << 10, /* special message */ |
22 | BLK_TC_AHEAD = 1 << 11, /* readahead */ | 24 | BLK_TC_AHEAD = 1 << 11, /* readahead */ |
23 | BLK_TC_META = 1 << 12, /* metadata */ | 25 | BLK_TC_META = 1 << 12, /* metadata */ |
26 | BLK_TC_DISCARD = 1 << 13, /* discard requests */ | ||
24 | 27 | ||
25 | BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ | 28 | BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ |
26 | }; | 29 | }; |
@@ -47,6 +50,7 @@ enum blktrace_act { | |||
47 | __BLK_TA_SPLIT, /* bio was split */ | 50 | __BLK_TA_SPLIT, /* bio was split */ |
48 | __BLK_TA_BOUNCE, /* bio was bounced */ | 51 | __BLK_TA_BOUNCE, /* bio was bounced */ |
49 | __BLK_TA_REMAP, /* bio was remapped */ | 52 | __BLK_TA_REMAP, /* bio was remapped */ |
53 | __BLK_TA_ABORT, /* request aborted */ | ||
50 | }; | 54 | }; |
51 | 55 | ||
52 | /* | 56 | /* |
@@ -77,6 +81,7 @@ enum blktrace_notify { | |||
77 | #define BLK_TA_SPLIT (__BLK_TA_SPLIT) | 81 | #define BLK_TA_SPLIT (__BLK_TA_SPLIT) |
78 | #define BLK_TA_BOUNCE (__BLK_TA_BOUNCE) | 82 | #define BLK_TA_BOUNCE (__BLK_TA_BOUNCE) |
79 | #define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE)) | 83 | #define BLK_TA_REMAP (__BLK_TA_REMAP | BLK_TC_ACT(BLK_TC_QUEUE)) |
84 | #define BLK_TA_ABORT (__BLK_TA_ABORT | BLK_TC_ACT(BLK_TC_QUEUE)) | ||
80 | 85 | ||
81 | #define BLK_TN_PROCESS (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY)) | 86 | #define BLK_TN_PROCESS (__BLK_TN_PROCESS | BLK_TC_ACT(BLK_TC_NOTIFY)) |
82 | #define BLK_TN_TIMESTAMP (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY)) | 87 | #define BLK_TN_TIMESTAMP (__BLK_TN_TIMESTAMP | BLK_TC_ACT(BLK_TC_NOTIFY)) |
@@ -89,17 +94,17 @@ enum blktrace_notify { | |||
89 | * The trace itself | 94 | * The trace itself |
90 | */ | 95 | */ |
91 | struct blk_io_trace { | 96 | struct blk_io_trace { |
92 | u32 magic; /* MAGIC << 8 | version */ | 97 | __u32 magic; /* MAGIC << 8 | version */ |
93 | u32 sequence; /* event number */ | 98 | __u32 sequence; /* event number */ |
94 | u64 time; /* in microseconds */ | 99 | __u64 time; /* in microseconds */ |
95 | u64 sector; /* disk offset */ | 100 | __u64 sector; /* disk offset */ |
96 | u32 bytes; /* transfer length */ | 101 | __u32 bytes; /* transfer length */ |
97 | u32 action; /* what happened */ | 102 | __u32 action; /* what happened */ |
98 | u32 pid; /* who did it */ | 103 | __u32 pid; /* who did it */ |
99 | u32 device; /* device number */ | 104 | __u32 device; /* device number */ |
100 | u32 cpu; /* on what cpu did it happen */ | 105 | __u32 cpu; /* on what cpu did it happen */ |
101 | u16 error; /* completion error */ | 106 | __u16 error; /* completion error */ |
102 | u16 pdu_len; /* length of data after this trace */ | 107 | __u16 pdu_len; /* length of data after this trace */ |
103 | }; | 108 | }; |
104 | 109 | ||
105 | /* | 110 | /* |
@@ -117,6 +122,23 @@ enum { | |||
117 | Blktrace_stopped, | 122 | Blktrace_stopped, |
118 | }; | 123 | }; |
119 | 124 | ||
125 | #define BLKTRACE_BDEV_SIZE 32 | ||
126 | |||
127 | /* | ||
128 | * User setup structure passed with BLKTRACESTART | ||
129 | */ | ||
130 | struct blk_user_trace_setup { | ||
131 | char name[BLKTRACE_BDEV_SIZE]; /* output */ | ||
132 | __u16 act_mask; /* input */ | ||
133 | __u32 buf_size; /* input */ | ||
134 | __u32 buf_nr; /* input */ | ||
135 | __u64 start_lba; | ||
136 | __u64 end_lba; | ||
137 | __u32 pid; | ||
138 | }; | ||
139 | |||
140 | #ifdef __KERNEL__ | ||
141 | #if defined(CONFIG_BLK_DEV_IO_TRACE) | ||
120 | struct blk_trace { | 142 | struct blk_trace { |
121 | int trace_state; | 143 | int trace_state; |
122 | struct rchan *rchan; | 144 | struct rchan *rchan; |
@@ -133,21 +155,6 @@ struct blk_trace { | |||
133 | atomic_t dropped; | 155 | atomic_t dropped; |
134 | }; | 156 | }; |
135 | 157 | ||
136 | /* | ||
137 | * User setup structure passed with BLKTRACESTART | ||
138 | */ | ||
139 | struct blk_user_trace_setup { | ||
140 | char name[BDEVNAME_SIZE]; /* output */ | ||
141 | u16 act_mask; /* input */ | ||
142 | u32 buf_size; /* input */ | ||
143 | u32 buf_nr; /* input */ | ||
144 | u64 start_lba; | ||
145 | u64 end_lba; | ||
146 | u32 pid; | ||
147 | }; | ||
148 | |||
149 | #ifdef __KERNEL__ | ||
150 | #if defined(CONFIG_BLK_DEV_IO_TRACE) | ||
151 | extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); | 158 | extern int blk_trace_ioctl(struct block_device *, unsigned, char __user *); |
152 | extern void blk_trace_shutdown(struct request_queue *); | 159 | extern void blk_trace_shutdown(struct request_queue *); |
153 | extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *); | 160 | extern void __blk_add_trace(struct blk_trace *, sector_t, int, int, u32, int, int, void *); |
@@ -195,6 +202,9 @@ static inline void blk_add_trace_rq(struct request_queue *q, struct request *rq, | |||
195 | if (likely(!bt)) | 202 | if (likely(!bt)) |
196 | return; | 203 | return; |
197 | 204 | ||
205 | if (blk_discard_rq(rq)) | ||
206 | rw |= (1 << BIO_RW_DISCARD); | ||
207 | |||
198 | if (blk_pc_request(rq)) { | 208 | if (blk_pc_request(rq)) { |
199 | what |= BLK_TC_ACT(BLK_TC_PC); | 209 | what |= BLK_TC_ACT(BLK_TC_PC); |
200 | __blk_add_trace(bt, 0, rq->data_len, rw, what, rq->errors, sizeof(rq->cmd), rq->cmd); | 210 | __blk_add_trace(bt, 0, rq->data_len, rw, what, rq->errors, sizeof(rq->cmd), rq->cmd); |
diff --git a/include/linux/cnt32_to_63.h b/include/linux/cnt32_to_63.h new file mode 100644 index 000000000000..8c0f9505b48c --- /dev/null +++ b/include/linux/cnt32_to_63.h | |||
@@ -0,0 +1,80 @@ | |||
1 | /* | ||
2 | * Extend a 32-bit counter to 63 bits | ||
3 | * | ||
4 | * Author: Nicolas Pitre | ||
5 | * Created: December 3, 2006 | ||
6 | * Copyright: MontaVista Software, Inc. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 | ||
10 | * as published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef __LINUX_CNT32_TO_63_H__ | ||
14 | #define __LINUX_CNT32_TO_63_H__ | ||
15 | |||
16 | #include <linux/compiler.h> | ||
17 | #include <linux/types.h> | ||
18 | #include <asm/byteorder.h> | ||
19 | |||
20 | /* this is used only to give gcc a clue about good code generation */ | ||
21 | union cnt32_to_63 { | ||
22 | struct { | ||
23 | #if defined(__LITTLE_ENDIAN) | ||
24 | u32 lo, hi; | ||
25 | #elif defined(__BIG_ENDIAN) | ||
26 | u32 hi, lo; | ||
27 | #endif | ||
28 | }; | ||
29 | u64 val; | ||
30 | }; | ||
31 | |||
32 | |||
33 | /** | ||
34 | * cnt32_to_63 - Expand a 32-bit counter to a 63-bit counter | ||
35 | * @cnt_lo: The low part of the counter | ||
36 | * | ||
37 | * Many hardware clock counters are only 32 bits wide and therefore have | ||
38 | * a relatively short period making wrap-arounds rather frequent. This | ||
39 | * is a problem when implementing sched_clock() for example, where a 64-bit | ||
40 | * non-wrapping monotonic value is expected to be returned. | ||
41 | * | ||
42 | * To overcome that limitation, let's extend a 32-bit counter to 63 bits | ||
43 | * in a completely lock free fashion. Bits 0 to 31 of the clock are provided | ||
44 | * by the hardware while bits 32 to 62 are stored in memory. The top bit in | ||
45 | * memory is used to synchronize with the hardware clock half-period. When | ||
46 | * the top bit of both counters (hardware and in memory) differ then the | ||
47 | * memory is updated with a new value, incrementing it when the hardware | ||
48 | * counter wraps around. | ||
49 | * | ||
50 | * Because a word store in memory is atomic then the incremented value will | ||
51 | * always be in synch with the top bit indicating to any potential concurrent | ||
52 | * reader if the value in memory is up to date or not with regards to the | ||
53 | * needed increment. And any race in updating the value in memory is harmless | ||
54 | * as the same value would simply be stored more than once. | ||
55 | * | ||
56 | * The only restriction for the algorithm to work properly is that this | ||
57 | * code must be executed at least once per each half period of the 32-bit | ||
58 | * counter to properly update the state bit in memory. This is usually not a | ||
59 | * problem in practice, but if it is then a kernel timer could be scheduled | ||
60 | * to manage for this code to be executed often enough. | ||
61 | * | ||
62 | * Note that the top bit (bit 63) in the returned value should be considered | ||
63 | * as garbage. It is not cleared here because callers are likely to use a | ||
64 | * multiplier on the returned value which can get rid of the top bit | ||
65 | * implicitly by making the multiplier even, therefore saving on a runtime | ||
66 | * clear-bit instruction. Otherwise caller must remember to clear the top | ||
67 | * bit explicitly. | ||
68 | */ | ||
69 | #define cnt32_to_63(cnt_lo) \ | ||
70 | ({ \ | ||
71 | static volatile u32 __m_cnt_hi; \ | ||
72 | union cnt32_to_63 __x; \ | ||
73 | __x.hi = __m_cnt_hi; \ | ||
74 | __x.lo = (cnt_lo); \ | ||
75 | if (unlikely((s32)(__x.hi ^ __x.lo) < 0)) \ | ||
76 | __m_cnt_hi = __x.hi = (__x.hi ^ 0x80000000) + (__x.hi >> 31); \ | ||
77 | __x.val; \ | ||
78 | }) | ||
79 | |||
80 | #endif | ||
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index c8bd2daf95ec..8322141ee480 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -190,7 +190,9 @@ extern void __chk_io_ptr(const volatile void __iomem *); | |||
190 | * ACCESS_ONCE() in different C statements. | 190 | * ACCESS_ONCE() in different C statements. |
191 | * | 191 | * |
192 | * This macro does absolutely -nothing- to prevent the CPU from reordering, | 192 | * This macro does absolutely -nothing- to prevent the CPU from reordering, |
193 | * merging, or refetching absolutely anything at any time. | 193 | * merging, or refetching absolutely anything at any time. Its main intended |
194 | * use is to mediate communication between process-level code and irq/NMI | ||
195 | * handlers, all running on the same CPU. | ||
194 | */ | 196 | */ |
195 | #define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) | 197 | #define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x)) |
196 | 198 | ||
diff --git a/include/linux/completion.h b/include/linux/completion.h index 02ef8835999c..4a6b604ef7e4 100644 --- a/include/linux/completion.h +++ b/include/linux/completion.h | |||
@@ -10,6 +10,18 @@ | |||
10 | 10 | ||
11 | #include <linux/wait.h> | 11 | #include <linux/wait.h> |
12 | 12 | ||
13 | /** | ||
14 | * struct completion - structure used to maintain state for a "completion" | ||
15 | * | ||
16 | * This is the opaque structure used to maintain the state for a "completion". | ||
17 | * Completions currently use a FIFO to queue threads that have to wait for | ||
18 | * the "completion" event. | ||
19 | * | ||
20 | * See also: complete(), wait_for_completion() (and friends _timeout, | ||
21 | * _interruptible, _interruptible_timeout, and _killable), init_completion(), | ||
22 | * and macros DECLARE_COMPLETION(), DECLARE_COMPLETION_ONSTACK(), and | ||
23 | * INIT_COMPLETION(). | ||
24 | */ | ||
13 | struct completion { | 25 | struct completion { |
14 | unsigned int done; | 26 | unsigned int done; |
15 | wait_queue_head_t wait; | 27 | wait_queue_head_t wait; |
@@ -21,6 +33,14 @@ struct completion { | |||
21 | #define COMPLETION_INITIALIZER_ONSTACK(work) \ | 33 | #define COMPLETION_INITIALIZER_ONSTACK(work) \ |
22 | ({ init_completion(&work); work; }) | 34 | ({ init_completion(&work); work; }) |
23 | 35 | ||
36 | /** | ||
37 | * DECLARE_COMPLETION: - declare and initialize a completion structure | ||
38 | * @work: identifier for the completion structure | ||
39 | * | ||
40 | * This macro declares and initializes a completion structure. Generally used | ||
41 | * for static declarations. You should use the _ONSTACK variant for automatic | ||
42 | * variables. | ||
43 | */ | ||
24 | #define DECLARE_COMPLETION(work) \ | 44 | #define DECLARE_COMPLETION(work) \ |
25 | struct completion work = COMPLETION_INITIALIZER(work) | 45 | struct completion work = COMPLETION_INITIALIZER(work) |
26 | 46 | ||
@@ -29,6 +49,13 @@ struct completion { | |||
29 | * completions - so we use the _ONSTACK() variant for those that | 49 | * completions - so we use the _ONSTACK() variant for those that |
30 | * are on the kernel stack: | 50 | * are on the kernel stack: |
31 | */ | 51 | */ |
52 | /** | ||
53 | * DECLARE_COMPLETION_ONSTACK: - declare and initialize a completion structure | ||
54 | * @work: identifier for the completion structure | ||
55 | * | ||
56 | * This macro declares and initializes a completion structure on the kernel | ||
57 | * stack. | ||
58 | */ | ||
32 | #ifdef CONFIG_LOCKDEP | 59 | #ifdef CONFIG_LOCKDEP |
33 | # define DECLARE_COMPLETION_ONSTACK(work) \ | 60 | # define DECLARE_COMPLETION_ONSTACK(work) \ |
34 | struct completion work = COMPLETION_INITIALIZER_ONSTACK(work) | 61 | struct completion work = COMPLETION_INITIALIZER_ONSTACK(work) |
@@ -36,6 +63,13 @@ struct completion { | |||
36 | # define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work) | 63 | # define DECLARE_COMPLETION_ONSTACK(work) DECLARE_COMPLETION(work) |
37 | #endif | 64 | #endif |
38 | 65 | ||
66 | /** | ||
67 | * init_completion: - Initialize a dynamically allocated completion | ||
68 | * @x: completion structure that is to be initialized | ||
69 | * | ||
70 | * This inline function will initialize a dynamically created completion | ||
71 | * structure. | ||
72 | */ | ||
39 | static inline void init_completion(struct completion *x) | 73 | static inline void init_completion(struct completion *x) |
40 | { | 74 | { |
41 | x->done = 0; | 75 | x->done = 0; |
@@ -55,6 +89,13 @@ extern bool completion_done(struct completion *x); | |||
55 | extern void complete(struct completion *); | 89 | extern void complete(struct completion *); |
56 | extern void complete_all(struct completion *); | 90 | extern void complete_all(struct completion *); |
57 | 91 | ||
92 | /** | ||
93 | * INIT_COMPLETION: - reinitialize a completion structure | ||
94 | * @x: completion structure to be reinitialized | ||
95 | * | ||
96 | * This macro should be used to reinitialize a completion structure so it can | ||
97 | * be reused. This is especially important after complete_all() is used. | ||
98 | */ | ||
58 | #define INIT_COMPLETION(x) ((x).done = 0) | 99 | #define INIT_COMPLETION(x) ((x).done = 0) |
59 | 100 | ||
60 | 101 | ||
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index d7faf8808497..c2747ac2ae43 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -69,6 +69,7 @@ static inline void unregister_cpu_notifier(struct notifier_block *nb) | |||
69 | #endif | 69 | #endif |
70 | 70 | ||
71 | int cpu_up(unsigned int cpu); | 71 | int cpu_up(unsigned int cpu); |
72 | void notify_cpu_starting(unsigned int cpu); | ||
72 | extern void cpu_hotplug_init(void); | 73 | extern void cpu_hotplug_init(void); |
73 | extern void cpu_maps_update_begin(void); | 74 | extern void cpu_maps_update_begin(void); |
74 | extern void cpu_maps_update_done(void); | 75 | extern void cpu_maps_update_done(void); |
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h index 6fd5668aa572..1ee608fd7b77 100644 --- a/include/linux/cpufreq.h +++ b/include/linux/cpufreq.h | |||
@@ -187,7 +187,8 @@ extern int __cpufreq_driver_target(struct cpufreq_policy *policy, | |||
187 | unsigned int relation); | 187 | unsigned int relation); |
188 | 188 | ||
189 | 189 | ||
190 | extern int __cpufreq_driver_getavg(struct cpufreq_policy *policy); | 190 | extern int __cpufreq_driver_getavg(struct cpufreq_policy *policy, |
191 | unsigned int cpu); | ||
191 | 192 | ||
192 | int cpufreq_register_governor(struct cpufreq_governor *governor); | 193 | int cpufreq_register_governor(struct cpufreq_governor *governor); |
193 | void cpufreq_unregister_governor(struct cpufreq_governor *governor); | 194 | void cpufreq_unregister_governor(struct cpufreq_governor *governor); |
@@ -226,7 +227,9 @@ struct cpufreq_driver { | |||
226 | unsigned int (*get) (unsigned int cpu); | 227 | unsigned int (*get) (unsigned int cpu); |
227 | 228 | ||
228 | /* optional */ | 229 | /* optional */ |
229 | unsigned int (*getavg) (unsigned int cpu); | 230 | unsigned int (*getavg) (struct cpufreq_policy *policy, |
231 | unsigned int cpu); | ||
232 | |||
230 | int (*exit) (struct cpufreq_policy *policy); | 233 | int (*exit) (struct cpufreq_policy *policy); |
231 | int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg); | 234 | int (*suspend) (struct cpufreq_policy *policy, pm_message_t pmsg); |
232 | int (*resume) (struct cpufreq_policy *policy); | 235 | int (*resume) (struct cpufreq_policy *policy); |
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index c43dc47fdf75..3d2317e4af2e 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h | |||
@@ -38,6 +38,7 @@ | |||
38 | #define CRYPTO_ALG_TYPE_DIGEST 0x00000008 | 38 | #define CRYPTO_ALG_TYPE_DIGEST 0x00000008 |
39 | #define CRYPTO_ALG_TYPE_HASH 0x00000009 | 39 | #define CRYPTO_ALG_TYPE_HASH 0x00000009 |
40 | #define CRYPTO_ALG_TYPE_AHASH 0x0000000a | 40 | #define CRYPTO_ALG_TYPE_AHASH 0x0000000a |
41 | #define CRYPTO_ALG_TYPE_RNG 0x0000000c | ||
41 | 42 | ||
42 | #define CRYPTO_ALG_TYPE_HASH_MASK 0x0000000e | 43 | #define CRYPTO_ALG_TYPE_HASH_MASK 0x0000000e |
43 | #define CRYPTO_ALG_TYPE_AHASH_MASK 0x0000000c | 44 | #define CRYPTO_ALG_TYPE_AHASH_MASK 0x0000000c |
@@ -61,6 +62,14 @@ | |||
61 | #define CRYPTO_ALG_GENIV 0x00000200 | 62 | #define CRYPTO_ALG_GENIV 0x00000200 |
62 | 63 | ||
63 | /* | 64 | /* |
65 | * Set if the algorithm has passed automated run-time testing. Note that | ||
66 | * if there is no run-time testing for a given algorithm it is considered | ||
67 | * to have passed. | ||
68 | */ | ||
69 | |||
70 | #define CRYPTO_ALG_TESTED 0x00000400 | ||
71 | |||
72 | /* | ||
64 | * Transform masks and values (for crt_flags). | 73 | * Transform masks and values (for crt_flags). |
65 | */ | 74 | */ |
66 | #define CRYPTO_TFM_REQ_MASK 0x000fff00 | 75 | #define CRYPTO_TFM_REQ_MASK 0x000fff00 |
@@ -105,6 +114,7 @@ struct crypto_aead; | |||
105 | struct crypto_blkcipher; | 114 | struct crypto_blkcipher; |
106 | struct crypto_hash; | 115 | struct crypto_hash; |
107 | struct crypto_ahash; | 116 | struct crypto_ahash; |
117 | struct crypto_rng; | ||
108 | struct crypto_tfm; | 118 | struct crypto_tfm; |
109 | struct crypto_type; | 119 | struct crypto_type; |
110 | struct aead_givcrypt_request; | 120 | struct aead_givcrypt_request; |
@@ -290,6 +300,15 @@ struct compress_alg { | |||
290 | unsigned int slen, u8 *dst, unsigned int *dlen); | 300 | unsigned int slen, u8 *dst, unsigned int *dlen); |
291 | }; | 301 | }; |
292 | 302 | ||
303 | struct rng_alg { | ||
304 | int (*rng_make_random)(struct crypto_rng *tfm, u8 *rdata, | ||
305 | unsigned int dlen); | ||
306 | int (*rng_reset)(struct crypto_rng *tfm, u8 *seed, unsigned int slen); | ||
307 | |||
308 | unsigned int seedsize; | ||
309 | }; | ||
310 | |||
311 | |||
293 | #define cra_ablkcipher cra_u.ablkcipher | 312 | #define cra_ablkcipher cra_u.ablkcipher |
294 | #define cra_aead cra_u.aead | 313 | #define cra_aead cra_u.aead |
295 | #define cra_blkcipher cra_u.blkcipher | 314 | #define cra_blkcipher cra_u.blkcipher |
@@ -298,6 +317,7 @@ struct compress_alg { | |||
298 | #define cra_hash cra_u.hash | 317 | #define cra_hash cra_u.hash |
299 | #define cra_ahash cra_u.ahash | 318 | #define cra_ahash cra_u.ahash |
300 | #define cra_compress cra_u.compress | 319 | #define cra_compress cra_u.compress |
320 | #define cra_rng cra_u.rng | ||
301 | 321 | ||
302 | struct crypto_alg { | 322 | struct crypto_alg { |
303 | struct list_head cra_list; | 323 | struct list_head cra_list; |
@@ -325,6 +345,7 @@ struct crypto_alg { | |||
325 | struct hash_alg hash; | 345 | struct hash_alg hash; |
326 | struct ahash_alg ahash; | 346 | struct ahash_alg ahash; |
327 | struct compress_alg compress; | 347 | struct compress_alg compress; |
348 | struct rng_alg rng; | ||
328 | } cra_u; | 349 | } cra_u; |
329 | 350 | ||
330 | int (*cra_init)(struct crypto_tfm *tfm); | 351 | int (*cra_init)(struct crypto_tfm *tfm); |
@@ -430,6 +451,12 @@ struct compress_tfm { | |||
430 | u8 *dst, unsigned int *dlen); | 451 | u8 *dst, unsigned int *dlen); |
431 | }; | 452 | }; |
432 | 453 | ||
454 | struct rng_tfm { | ||
455 | int (*rng_gen_random)(struct crypto_rng *tfm, u8 *rdata, | ||
456 | unsigned int dlen); | ||
457 | int (*rng_reset)(struct crypto_rng *tfm, u8 *seed, unsigned int slen); | ||
458 | }; | ||
459 | |||
433 | #define crt_ablkcipher crt_u.ablkcipher | 460 | #define crt_ablkcipher crt_u.ablkcipher |
434 | #define crt_aead crt_u.aead | 461 | #define crt_aead crt_u.aead |
435 | #define crt_blkcipher crt_u.blkcipher | 462 | #define crt_blkcipher crt_u.blkcipher |
@@ -437,6 +464,7 @@ struct compress_tfm { | |||
437 | #define crt_hash crt_u.hash | 464 | #define crt_hash crt_u.hash |
438 | #define crt_ahash crt_u.ahash | 465 | #define crt_ahash crt_u.ahash |
439 | #define crt_compress crt_u.compress | 466 | #define crt_compress crt_u.compress |
467 | #define crt_rng crt_u.rng | ||
440 | 468 | ||
441 | struct crypto_tfm { | 469 | struct crypto_tfm { |
442 | 470 | ||
@@ -450,6 +478,7 @@ struct crypto_tfm { | |||
450 | struct hash_tfm hash; | 478 | struct hash_tfm hash; |
451 | struct ahash_tfm ahash; | 479 | struct ahash_tfm ahash; |
452 | struct compress_tfm compress; | 480 | struct compress_tfm compress; |
481 | struct rng_tfm rng; | ||
453 | } crt_u; | 482 | } crt_u; |
454 | 483 | ||
455 | struct crypto_alg *__crt_alg; | 484 | struct crypto_alg *__crt_alg; |
@@ -481,6 +510,10 @@ struct crypto_hash { | |||
481 | struct crypto_tfm base; | 510 | struct crypto_tfm base; |
482 | }; | 511 | }; |
483 | 512 | ||
513 | struct crypto_rng { | ||
514 | struct crypto_tfm base; | ||
515 | }; | ||
516 | |||
484 | enum { | 517 | enum { |
485 | CRYPTOA_UNSPEC, | 518 | CRYPTOA_UNSPEC, |
486 | CRYPTOA_ALG, | 519 | CRYPTOA_ALG, |
@@ -515,6 +548,8 @@ struct crypto_tfm *crypto_alloc_tfm(const char *alg_name, u32 tfm_flags); | |||
515 | struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask); | 548 | struct crypto_tfm *crypto_alloc_base(const char *alg_name, u32 type, u32 mask); |
516 | void crypto_free_tfm(struct crypto_tfm *tfm); | 549 | void crypto_free_tfm(struct crypto_tfm *tfm); |
517 | 550 | ||
551 | int alg_test(const char *driver, const char *alg, u32 type, u32 mask); | ||
552 | |||
518 | /* | 553 | /* |
519 | * Transform helpers which query the underlying algorithm. | 554 | * Transform helpers which query the underlying algorithm. |
520 | */ | 555 | */ |
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index a90222e3297d..08d783592b73 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -13,7 +13,6 @@ | |||
13 | 13 | ||
14 | struct dm_target; | 14 | struct dm_target; |
15 | struct dm_table; | 15 | struct dm_table; |
16 | struct dm_dev; | ||
17 | struct mapped_device; | 16 | struct mapped_device; |
18 | struct bio_vec; | 17 | struct bio_vec; |
19 | 18 | ||
@@ -84,6 +83,12 @@ void dm_error(const char *message); | |||
84 | */ | 83 | */ |
85 | void dm_set_device_limits(struct dm_target *ti, struct block_device *bdev); | 84 | void dm_set_device_limits(struct dm_target *ti, struct block_device *bdev); |
86 | 85 | ||
86 | struct dm_dev { | ||
87 | struct block_device *bdev; | ||
88 | int mode; | ||
89 | char name[16]; | ||
90 | }; | ||
91 | |||
87 | /* | 92 | /* |
88 | * Constructors should call these functions to ensure destination devices | 93 | * Constructors should call these functions to ensure destination devices |
89 | * are opened/closed correctly. | 94 | * are opened/closed correctly. |
@@ -202,6 +207,7 @@ int dm_copy_name_and_uuid(struct mapped_device *md, char *name, char *uuid); | |||
202 | struct gendisk *dm_disk(struct mapped_device *md); | 207 | struct gendisk *dm_disk(struct mapped_device *md); |
203 | int dm_suspended(struct mapped_device *md); | 208 | int dm_suspended(struct mapped_device *md); |
204 | int dm_noflush_suspending(struct dm_target *ti); | 209 | int dm_noflush_suspending(struct dm_target *ti); |
210 | union map_info *dm_get_mapinfo(struct bio *bio); | ||
205 | 211 | ||
206 | /* | 212 | /* |
207 | * Geometry functions. | 213 | * Geometry functions. |
@@ -232,6 +238,11 @@ int dm_table_add_target(struct dm_table *t, const char *type, | |||
232 | int dm_table_complete(struct dm_table *t); | 238 | int dm_table_complete(struct dm_table *t); |
233 | 239 | ||
234 | /* | 240 | /* |
241 | * Unplug all devices in a table. | ||
242 | */ | ||
243 | void dm_table_unplug_all(struct dm_table *t); | ||
244 | |||
245 | /* | ||
235 | * Table reference counting. | 246 | * Table reference counting. |
236 | */ | 247 | */ |
237 | struct dm_table *dm_get_table(struct mapped_device *md); | 248 | struct dm_table *dm_get_table(struct mapped_device *md); |
@@ -256,6 +267,11 @@ void dm_table_event(struct dm_table *t); | |||
256 | */ | 267 | */ |
257 | int dm_swap_table(struct mapped_device *md, struct dm_table *t); | 268 | int dm_swap_table(struct mapped_device *md, struct dm_table *t); |
258 | 269 | ||
270 | /* | ||
271 | * A wrapper around vmalloc. | ||
272 | */ | ||
273 | void *dm_vcalloc(unsigned long nmemb, unsigned long elem_size); | ||
274 | |||
259 | /*----------------------------------------------------------------- | 275 | /*----------------------------------------------------------------- |
260 | * Macros. | 276 | * Macros. |
261 | *---------------------------------------------------------------*/ | 277 | *---------------------------------------------------------------*/ |
diff --git a/include/linux/device.h b/include/linux/device.h index 4d8372d135df..246937c9cbc7 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -199,6 +199,11 @@ struct class { | |||
199 | struct class_private *p; | 199 | struct class_private *p; |
200 | }; | 200 | }; |
201 | 201 | ||
202 | struct class_dev_iter { | ||
203 | struct klist_iter ki; | ||
204 | const struct device_type *type; | ||
205 | }; | ||
206 | |||
202 | extern struct kobject *sysfs_dev_block_kobj; | 207 | extern struct kobject *sysfs_dev_block_kobj; |
203 | extern struct kobject *sysfs_dev_char_kobj; | 208 | extern struct kobject *sysfs_dev_char_kobj; |
204 | extern int __must_check __class_register(struct class *class, | 209 | extern int __must_check __class_register(struct class *class, |
@@ -213,6 +218,13 @@ extern void class_unregister(struct class *class); | |||
213 | __class_register(class, &__key); \ | 218 | __class_register(class, &__key); \ |
214 | }) | 219 | }) |
215 | 220 | ||
221 | extern void class_dev_iter_init(struct class_dev_iter *iter, | ||
222 | struct class *class, | ||
223 | struct device *start, | ||
224 | const struct device_type *type); | ||
225 | extern struct device *class_dev_iter_next(struct class_dev_iter *iter); | ||
226 | extern void class_dev_iter_exit(struct class_dev_iter *iter); | ||
227 | |||
216 | extern int class_for_each_device(struct class *class, struct device *start, | 228 | extern int class_for_each_device(struct class *class, struct device *start, |
217 | void *data, | 229 | void *data, |
218 | int (*fn)(struct device *dev, void *data)); | 230 | int (*fn)(struct device *dev, void *data)); |
@@ -396,7 +408,7 @@ struct device { | |||
396 | spinlock_t devres_lock; | 408 | spinlock_t devres_lock; |
397 | struct list_head devres_head; | 409 | struct list_head devres_head; |
398 | 410 | ||
399 | struct list_head node; | 411 | struct klist_node knode_class; |
400 | struct class *class; | 412 | struct class *class; |
401 | dev_t devt; /* dev_t, creates the sysfs "dev" */ | 413 | dev_t devt; /* dev_t, creates the sysfs "dev" */ |
402 | struct attribute_group **groups; /* optional groups */ | 414 | struct attribute_group **groups; /* optional groups */ |
diff --git a/include/linux/dlm.h b/include/linux/dlm.h index 203a025e30e5..b9cd38603fd8 100644 --- a/include/linux/dlm.h +++ b/include/linux/dlm.h | |||
@@ -2,7 +2,7 @@ | |||
2 | ******************************************************************************* | 2 | ******************************************************************************* |
3 | ** | 3 | ** |
4 | ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. | 4 | ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. |
5 | ** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved. | 5 | ** Copyright (C) 2004-2008 Red Hat, Inc. All rights reserved. |
6 | ** | 6 | ** |
7 | ** This copyrighted material is made available to anyone wishing to use, | 7 | ** This copyrighted material is made available to anyone wishing to use, |
8 | ** modify, copy, or redistribute it subject to the terms and conditions | 8 | ** modify, copy, or redistribute it subject to the terms and conditions |
@@ -65,9 +65,12 @@ struct dlm_lksb { | |||
65 | char * sb_lvbptr; | 65 | char * sb_lvbptr; |
66 | }; | 66 | }; |
67 | 67 | ||
68 | /* dlm_new_lockspace() flags */ | ||
69 | |||
68 | #define DLM_LSFL_NODIR 0x00000001 | 70 | #define DLM_LSFL_NODIR 0x00000001 |
69 | #define DLM_LSFL_TIMEWARN 0x00000002 | 71 | #define DLM_LSFL_TIMEWARN 0x00000002 |
70 | #define DLM_LSFL_FS 0x00000004 | 72 | #define DLM_LSFL_FS 0x00000004 |
73 | #define DLM_LSFL_NEWEXCL 0x00000008 | ||
71 | 74 | ||
72 | #ifdef __KERNEL__ | 75 | #ifdef __KERNEL__ |
73 | 76 | ||
diff --git a/include/linux/dlm_device.h b/include/linux/dlm_device.h index c6034508fed9..3060783c4191 100644 --- a/include/linux/dlm_device.h +++ b/include/linux/dlm_device.h | |||
@@ -26,7 +26,7 @@ | |||
26 | /* Version of the device interface */ | 26 | /* Version of the device interface */ |
27 | #define DLM_DEVICE_VERSION_MAJOR 6 | 27 | #define DLM_DEVICE_VERSION_MAJOR 6 |
28 | #define DLM_DEVICE_VERSION_MINOR 0 | 28 | #define DLM_DEVICE_VERSION_MINOR 0 |
29 | #define DLM_DEVICE_VERSION_PATCH 0 | 29 | #define DLM_DEVICE_VERSION_PATCH 1 |
30 | 30 | ||
31 | /* struct passed to the lock write */ | 31 | /* struct passed to the lock write */ |
32 | struct dlm_lock_params { | 32 | struct dlm_lock_params { |
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 952e0f857ac9..ba9114ec5d3a 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -48,6 +48,11 @@ static inline int is_device_dma_capable(struct device *dev) | |||
48 | return dev->dma_mask != NULL && *dev->dma_mask != DMA_MASK_NONE; | 48 | return dev->dma_mask != NULL && *dev->dma_mask != DMA_MASK_NONE; |
49 | } | 49 | } |
50 | 50 | ||
51 | static inline int is_buffer_dma_capable(u64 mask, dma_addr_t addr, size_t size) | ||
52 | { | ||
53 | return addr + size <= mask; | ||
54 | } | ||
55 | |||
51 | #ifdef CONFIG_HAS_DMA | 56 | #ifdef CONFIG_HAS_DMA |
52 | #include <asm/dma-mapping.h> | 57 | #include <asm/dma-mapping.h> |
53 | #else | 58 | #else |
@@ -58,6 +63,13 @@ static inline int is_device_dma_capable(struct device *dev) | |||
58 | #define dma_sync_single dma_sync_single_for_cpu | 63 | #define dma_sync_single dma_sync_single_for_cpu |
59 | #define dma_sync_sg dma_sync_sg_for_cpu | 64 | #define dma_sync_sg dma_sync_sg_for_cpu |
60 | 65 | ||
66 | static inline u64 dma_get_mask(struct device *dev) | ||
67 | { | ||
68 | if (dev && dev->dma_mask && *dev->dma_mask) | ||
69 | return *dev->dma_mask; | ||
70 | return DMA_32BIT_MASK; | ||
71 | } | ||
72 | |||
61 | extern u64 dma_get_required_mask(struct device *dev); | 73 | extern u64 dma_get_required_mask(struct device *dev); |
62 | 74 | ||
63 | static inline unsigned int dma_get_max_seg_size(struct device *dev) | 75 | static inline unsigned int dma_get_max_seg_size(struct device *dev) |
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 639624b55fbe..92f6f634e3e6 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
@@ -112,6 +112,7 @@ extern struct request *elv_latter_request(struct request_queue *, struct request | |||
112 | extern int elv_register_queue(struct request_queue *q); | 112 | extern int elv_register_queue(struct request_queue *q); |
113 | extern void elv_unregister_queue(struct request_queue *q); | 113 | extern void elv_unregister_queue(struct request_queue *q); |
114 | extern int elv_may_queue(struct request_queue *, int); | 114 | extern int elv_may_queue(struct request_queue *, int); |
115 | extern void elv_abort_queue(struct request_queue *); | ||
115 | extern void elv_completed_request(struct request_queue *, struct request *); | 116 | extern void elv_completed_request(struct request_queue *, struct request *); |
116 | extern int elv_set_request(struct request_queue *, struct request *, gfp_t); | 117 | extern int elv_set_request(struct request_queue *, struct request *, gfp_t); |
117 | extern void elv_put_request(struct request_queue *, struct request *); | 118 | extern void elv_put_request(struct request_queue *, struct request *); |
@@ -173,15 +174,15 @@ enum { | |||
173 | #define rb_entry_rq(node) rb_entry((node), struct request, rb_node) | 174 | #define rb_entry_rq(node) rb_entry((node), struct request, rb_node) |
174 | 175 | ||
175 | /* | 176 | /* |
176 | * Hack to reuse the donelist list_head as the fifo time holder while | 177 | * Hack to reuse the csd.list list_head as the fifo time holder while |
177 | * the request is in the io scheduler. Saves an unsigned long in rq. | 178 | * the request is in the io scheduler. Saves an unsigned long in rq. |
178 | */ | 179 | */ |
179 | #define rq_fifo_time(rq) ((unsigned long) (rq)->donelist.next) | 180 | #define rq_fifo_time(rq) ((unsigned long) (rq)->csd.list.next) |
180 | #define rq_set_fifo_time(rq,exp) ((rq)->donelist.next = (void *) (exp)) | 181 | #define rq_set_fifo_time(rq,exp) ((rq)->csd.list.next = (void *) (exp)) |
181 | #define rq_entry_fifo(ptr) list_entry((ptr), struct request, queuelist) | 182 | #define rq_entry_fifo(ptr) list_entry((ptr), struct request, queuelist) |
182 | #define rq_fifo_clear(rq) do { \ | 183 | #define rq_fifo_clear(rq) do { \ |
183 | list_del_init(&(rq)->queuelist); \ | 184 | list_del_init(&(rq)->queuelist); \ |
184 | INIT_LIST_HEAD(&(rq)->donelist); \ | 185 | INIT_LIST_HEAD(&(rq)->csd.list); \ |
185 | } while (0) | 186 | } while (0) |
186 | 187 | ||
187 | /* | 188 | /* |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 80171ee89a22..8120fa1bc235 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
@@ -837,6 +837,8 @@ extern void ext3_truncate (struct inode *); | |||
837 | extern void ext3_set_inode_flags(struct inode *); | 837 | extern void ext3_set_inode_flags(struct inode *); |
838 | extern void ext3_get_inode_flags(struct ext3_inode_info *); | 838 | extern void ext3_get_inode_flags(struct ext3_inode_info *); |
839 | extern void ext3_set_aops(struct inode *inode); | 839 | extern void ext3_set_aops(struct inode *inode); |
840 | extern int ext3_fiemap(struct inode *inode, struct fiemap_extent_info *fieinfo, | ||
841 | u64 start, u64 len); | ||
840 | 842 | ||
841 | /* ioctl.c */ | 843 | /* ioctl.c */ |
842 | extern int ext3_ioctl (struct inode *, struct file *, unsigned int, | 844 | extern int ext3_ioctl (struct inode *, struct file *, unsigned int, |
diff --git a/include/linux/fd.h b/include/linux/fd.h index b6bd41d2b460..f5d194af07a8 100644 --- a/include/linux/fd.h +++ b/include/linux/fd.h | |||
@@ -15,10 +15,16 @@ struct floppy_struct { | |||
15 | sect, /* sectors per track */ | 15 | sect, /* sectors per track */ |
16 | head, /* nr of heads */ | 16 | head, /* nr of heads */ |
17 | track, /* nr of tracks */ | 17 | track, /* nr of tracks */ |
18 | stretch; /* !=0 means double track steps */ | 18 | stretch; /* bit 0 !=0 means double track steps */ |
19 | /* bit 1 != 0 means swap sides */ | ||
20 | /* bits 2..9 give the first sector */ | ||
21 | /* number (the LSB is flipped) */ | ||
19 | #define FD_STRETCH 1 | 22 | #define FD_STRETCH 1 |
20 | #define FD_SWAPSIDES 2 | 23 | #define FD_SWAPSIDES 2 |
21 | #define FD_ZEROBASED 4 | 24 | #define FD_ZEROBASED 4 |
25 | #define FD_SECTBASEMASK 0x3FC | ||
26 | #define FD_MKSECTBASE(s) (((s) ^ 1) << 2) | ||
27 | #define FD_SECTBASE(floppy) ((((floppy)->stretch & FD_SECTBASEMASK) >> 2) ^ 1) | ||
22 | 28 | ||
23 | unsigned char gap, /* gap1 size */ | 29 | unsigned char gap, /* gap1 size */ |
24 | 30 | ||
diff --git a/include/linux/fiemap.h b/include/linux/fiemap.h new file mode 100644 index 000000000000..671decbd2aeb --- /dev/null +++ b/include/linux/fiemap.h | |||
@@ -0,0 +1,64 @@ | |||
1 | /* | ||
2 | * FS_IOC_FIEMAP ioctl infrastructure. | ||
3 | * | ||
4 | * Some portions copyright (C) 2007 Cluster File Systems, Inc | ||
5 | * | ||
6 | * Authors: Mark Fasheh <mfasheh@suse.com> | ||
7 | * Kalpak Shah <kalpak.shah@sun.com> | ||
8 | * Andreas Dilger <adilger@sun.com> | ||
9 | */ | ||
10 | |||
11 | #ifndef _LINUX_FIEMAP_H | ||
12 | #define _LINUX_FIEMAP_H | ||
13 | |||
14 | struct fiemap_extent { | ||
15 | __u64 fe_logical; /* logical offset in bytes for the start of | ||
16 | * the extent from the beginning of the file */ | ||
17 | __u64 fe_physical; /* physical offset in bytes for the start | ||
18 | * of the extent from the beginning of the disk */ | ||
19 | __u64 fe_length; /* length in bytes for this extent */ | ||
20 | __u64 fe_reserved64[2]; | ||
21 | __u32 fe_flags; /* FIEMAP_EXTENT_* flags for this extent */ | ||
22 | __u32 fe_reserved[3]; | ||
23 | }; | ||
24 | |||
25 | struct fiemap { | ||
26 | __u64 fm_start; /* logical offset (inclusive) at | ||
27 | * which to start mapping (in) */ | ||
28 | __u64 fm_length; /* logical length of mapping which | ||
29 | * userspace wants (in) */ | ||
30 | __u32 fm_flags; /* FIEMAP_FLAG_* flags for request (in/out) */ | ||
31 | __u32 fm_mapped_extents;/* number of extents that were mapped (out) */ | ||
32 | __u32 fm_extent_count; /* size of fm_extents array (in) */ | ||
33 | __u32 fm_reserved; | ||
34 | struct fiemap_extent fm_extents[0]; /* array of mapped extents (out) */ | ||
35 | }; | ||
36 | |||
37 | #define FIEMAP_MAX_OFFSET (~0ULL) | ||
38 | |||
39 | #define FIEMAP_FLAG_SYNC 0x00000001 /* sync file data before map */ | ||
40 | #define FIEMAP_FLAG_XATTR 0x00000002 /* map extended attribute tree */ | ||
41 | |||
42 | #define FIEMAP_FLAGS_COMPAT (FIEMAP_FLAG_SYNC | FIEMAP_FLAG_XATTR) | ||
43 | |||
44 | #define FIEMAP_EXTENT_LAST 0x00000001 /* Last extent in file. */ | ||
45 | #define FIEMAP_EXTENT_UNKNOWN 0x00000002 /* Data location unknown. */ | ||
46 | #define FIEMAP_EXTENT_DELALLOC 0x00000004 /* Location still pending. | ||
47 | * Sets EXTENT_UNKNOWN. */ | ||
48 | #define FIEMAP_EXTENT_ENCODED 0x00000008 /* Data can not be read | ||
49 | * while fs is unmounted */ | ||
50 | #define FIEMAP_EXTENT_DATA_ENCRYPTED 0x00000080 /* Data is encrypted by fs. | ||
51 | * Sets EXTENT_NO_BYPASS. */ | ||
52 | #define FIEMAP_EXTENT_NOT_ALIGNED 0x00000100 /* Extent offsets may not be | ||
53 | * block aligned. */ | ||
54 | #define FIEMAP_EXTENT_DATA_INLINE 0x00000200 /* Data mixed with metadata. | ||
55 | * Sets EXTENT_NOT_ALIGNED.*/ | ||
56 | #define FIEMAP_EXTENT_DATA_TAIL 0x00000400 /* Multiple files in block. | ||
57 | * Sets EXTENT_NOT_ALIGNED.*/ | ||
58 | #define FIEMAP_EXTENT_UNWRITTEN 0x00000800 /* Space allocated, but | ||
59 | * no data (i.e. zero). */ | ||
60 | #define FIEMAP_EXTENT_MERGED 0x00001000 /* File does not natively | ||
61 | * support extents. Result | ||
62 | * merged for efficiency. */ | ||
63 | |||
64 | #endif /* _LINUX_FIEMAP_H */ | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index 580b513668fe..44e3cb2f1966 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -86,7 +86,9 @@ extern int dir_notify_enable; | |||
86 | #define READ_META (READ | (1 << BIO_RW_META)) | 86 | #define READ_META (READ | (1 << BIO_RW_META)) |
87 | #define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) | 87 | #define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) |
88 | #define SWRITE_SYNC (SWRITE | (1 << BIO_RW_SYNC)) | 88 | #define SWRITE_SYNC (SWRITE | (1 << BIO_RW_SYNC)) |
89 | #define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER)) | 89 | #define WRITE_BARRIER (WRITE | (1 << BIO_RW_BARRIER)) |
90 | #define DISCARD_NOBARRIER (1 << BIO_RW_DISCARD) | ||
91 | #define DISCARD_BARRIER ((1 << BIO_RW_DISCARD) | (1 << BIO_RW_BARRIER)) | ||
90 | 92 | ||
91 | #define SEL_IN 1 | 93 | #define SEL_IN 1 |
92 | #define SEL_OUT 2 | 94 | #define SEL_OUT 2 |
@@ -222,6 +224,7 @@ extern int dir_notify_enable; | |||
222 | #define BLKTRACESTART _IO(0x12,116) | 224 | #define BLKTRACESTART _IO(0x12,116) |
223 | #define BLKTRACESTOP _IO(0x12,117) | 225 | #define BLKTRACESTOP _IO(0x12,117) |
224 | #define BLKTRACETEARDOWN _IO(0x12,118) | 226 | #define BLKTRACETEARDOWN _IO(0x12,118) |
227 | #define BLKDISCARD _IO(0x12,119) | ||
225 | 228 | ||
226 | #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ | 229 | #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ |
227 | #define FIBMAP _IO(0x00,1) /* bmap access */ | 230 | #define FIBMAP _IO(0x00,1) /* bmap access */ |
@@ -231,6 +234,7 @@ extern int dir_notify_enable; | |||
231 | #define FS_IOC_SETFLAGS _IOW('f', 2, long) | 234 | #define FS_IOC_SETFLAGS _IOW('f', 2, long) |
232 | #define FS_IOC_GETVERSION _IOR('v', 1, long) | 235 | #define FS_IOC_GETVERSION _IOR('v', 1, long) |
233 | #define FS_IOC_SETVERSION _IOW('v', 2, long) | 236 | #define FS_IOC_SETVERSION _IOW('v', 2, long) |
237 | #define FS_IOC_FIEMAP _IOWR('f', 11, struct fiemap) | ||
234 | #define FS_IOC32_GETFLAGS _IOR('f', 1, int) | 238 | #define FS_IOC32_GETFLAGS _IOR('f', 1, int) |
235 | #define FS_IOC32_SETFLAGS _IOW('f', 2, int) | 239 | #define FS_IOC32_SETFLAGS _IOW('f', 2, int) |
236 | #define FS_IOC32_GETVERSION _IOR('v', 1, int) | 240 | #define FS_IOC32_GETVERSION _IOR('v', 1, int) |
@@ -291,6 +295,7 @@ extern int dir_notify_enable; | |||
291 | #include <linux/mutex.h> | 295 | #include <linux/mutex.h> |
292 | #include <linux/capability.h> | 296 | #include <linux/capability.h> |
293 | #include <linux/semaphore.h> | 297 | #include <linux/semaphore.h> |
298 | #include <linux/fiemap.h> | ||
294 | 299 | ||
295 | #include <asm/atomic.h> | 300 | #include <asm/atomic.h> |
296 | #include <asm/byteorder.h> | 301 | #include <asm/byteorder.h> |
@@ -1179,6 +1184,20 @@ extern void dentry_unhash(struct dentry *dentry); | |||
1179 | extern int file_permission(struct file *, int); | 1184 | extern int file_permission(struct file *, int); |
1180 | 1185 | ||
1181 | /* | 1186 | /* |
1187 | * VFS FS_IOC_FIEMAP helper definitions. | ||
1188 | */ | ||
1189 | struct fiemap_extent_info { | ||
1190 | unsigned int fi_flags; /* Flags as passed from user */ | ||
1191 | unsigned int fi_extents_mapped; /* Number of mapped extents */ | ||
1192 | unsigned int fi_extents_max; /* Size of fiemap_extent array */ | ||
1193 | struct fiemap_extent *fi_extents_start; /* Start of fiemap_extent | ||
1194 | * array */ | ||
1195 | }; | ||
1196 | int fiemap_fill_next_extent(struct fiemap_extent_info *info, u64 logical, | ||
1197 | u64 phys, u64 len, u32 flags); | ||
1198 | int fiemap_check_flags(struct fiemap_extent_info *fieinfo, u32 fs_flags); | ||
1199 | |||
1200 | /* | ||
1182 | * File types | 1201 | * File types |
1183 | * | 1202 | * |
1184 | * NOTE! These match bits 12..15 of stat.st_mode | 1203 | * NOTE! These match bits 12..15 of stat.st_mode |
@@ -1287,6 +1306,8 @@ struct inode_operations { | |||
1287 | void (*truncate_range)(struct inode *, loff_t, loff_t); | 1306 | void (*truncate_range)(struct inode *, loff_t, loff_t); |
1288 | long (*fallocate)(struct inode *inode, int mode, loff_t offset, | 1307 | long (*fallocate)(struct inode *inode, int mode, loff_t offset, |
1289 | loff_t len); | 1308 | loff_t len); |
1309 | int (*fiemap)(struct inode *, struct fiemap_extent_info *, u64 start, | ||
1310 | u64 len); | ||
1290 | }; | 1311 | }; |
1291 | 1312 | ||
1292 | struct seq_file; | 1313 | struct seq_file; |
@@ -1682,6 +1703,7 @@ extern void chrdev_show(struct seq_file *,off_t); | |||
1682 | 1703 | ||
1683 | /* fs/block_dev.c */ | 1704 | /* fs/block_dev.c */ |
1684 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ | 1705 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ |
1706 | #define BDEVT_SIZE 10 /* Largest string for MAJ:MIN for blkdev */ | ||
1685 | 1707 | ||
1686 | #ifdef CONFIG_BLOCK | 1708 | #ifdef CONFIG_BLOCK |
1687 | #define BLKDEV_MAJOR_HASH_SIZE 255 | 1709 | #define BLKDEV_MAJOR_HASH_SIZE 255 |
@@ -1718,6 +1740,9 @@ extern int fs_may_remount_ro(struct super_block *); | |||
1718 | */ | 1740 | */ |
1719 | #define bio_data_dir(bio) ((bio)->bi_rw & 1) | 1741 | #define bio_data_dir(bio) ((bio)->bi_rw & 1) |
1720 | 1742 | ||
1743 | extern void check_disk_size_change(struct gendisk *disk, | ||
1744 | struct block_device *bdev); | ||
1745 | extern int revalidate_disk(struct gendisk *); | ||
1721 | extern int check_disk_change(struct block_device *); | 1746 | extern int check_disk_change(struct block_device *); |
1722 | extern int __invalidate_device(struct block_device *); | 1747 | extern int __invalidate_device(struct block_device *); |
1723 | extern int invalidate_partition(struct gendisk *, int); | 1748 | extern int invalidate_partition(struct gendisk *, int); |
@@ -1980,6 +2005,9 @@ extern int vfs_fstat(unsigned int, struct kstat *); | |||
1980 | 2005 | ||
1981 | extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, | 2006 | extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, |
1982 | unsigned long arg); | 2007 | unsigned long arg); |
2008 | extern int generic_block_fiemap(struct inode *inode, | ||
2009 | struct fiemap_extent_info *fieinfo, u64 start, | ||
2010 | u64 len, get_block_t *get_block); | ||
1983 | 2011 | ||
1984 | extern void get_filesystem(struct file_system_type *fs); | 2012 | extern void get_filesystem(struct file_system_type *fs); |
1985 | extern void put_filesystem(struct file_system_type *fs); | 2013 | extern void put_filesystem(struct file_system_type *fs); |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index be4f5e5bfe06..206cdf96c3a7 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -11,12 +11,15 @@ | |||
11 | 11 | ||
12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
13 | #include <linux/kdev_t.h> | 13 | #include <linux/kdev_t.h> |
14 | #include <linux/rcupdate.h> | ||
14 | 15 | ||
15 | #ifdef CONFIG_BLOCK | 16 | #ifdef CONFIG_BLOCK |
16 | 17 | ||
17 | #define kobj_to_dev(k) container_of(k, struct device, kobj) | 18 | #define kobj_to_dev(k) container_of((k), struct device, kobj) |
18 | #define dev_to_disk(device) container_of(device, struct gendisk, dev) | 19 | #define dev_to_disk(device) container_of((device), struct gendisk, part0.__dev) |
19 | #define dev_to_part(device) container_of(device, struct hd_struct, dev) | 20 | #define dev_to_part(device) container_of((device), struct hd_struct, __dev) |
21 | #define disk_to_dev(disk) (&(disk)->part0.__dev) | ||
22 | #define part_to_dev(part) (&((part)->__dev)) | ||
20 | 23 | ||
21 | extern struct device_type part_type; | 24 | extern struct device_type part_type; |
22 | extern struct kobject *block_depr; | 25 | extern struct kobject *block_depr; |
@@ -55,6 +58,9 @@ enum { | |||
55 | UNIXWARE_PARTITION = 0x63, /* Same as GNU_HURD and SCO Unix */ | 58 | UNIXWARE_PARTITION = 0x63, /* Same as GNU_HURD and SCO Unix */ |
56 | }; | 59 | }; |
57 | 60 | ||
61 | #define DISK_MAX_PARTS 256 | ||
62 | #define DISK_NAME_LEN 32 | ||
63 | |||
58 | #include <linux/major.h> | 64 | #include <linux/major.h> |
59 | #include <linux/device.h> | 65 | #include <linux/device.h> |
60 | #include <linux/smp.h> | 66 | #include <linux/smp.h> |
@@ -87,7 +93,7 @@ struct disk_stats { | |||
87 | struct hd_struct { | 93 | struct hd_struct { |
88 | sector_t start_sect; | 94 | sector_t start_sect; |
89 | sector_t nr_sects; | 95 | sector_t nr_sects; |
90 | struct device dev; | 96 | struct device __dev; |
91 | struct kobject *holder_dir; | 97 | struct kobject *holder_dir; |
92 | int policy, partno; | 98 | int policy, partno; |
93 | #ifdef CONFIG_FAIL_MAKE_REQUEST | 99 | #ifdef CONFIG_FAIL_MAKE_REQUEST |
@@ -100,6 +106,7 @@ struct hd_struct { | |||
100 | #else | 106 | #else |
101 | struct disk_stats dkstats; | 107 | struct disk_stats dkstats; |
102 | #endif | 108 | #endif |
109 | struct rcu_head rcu_head; | ||
103 | }; | 110 | }; |
104 | 111 | ||
105 | #define GENHD_FL_REMOVABLE 1 | 112 | #define GENHD_FL_REMOVABLE 1 |
@@ -108,100 +115,148 @@ struct hd_struct { | |||
108 | #define GENHD_FL_CD 8 | 115 | #define GENHD_FL_CD 8 |
109 | #define GENHD_FL_UP 16 | 116 | #define GENHD_FL_UP 16 |
110 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 | 117 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 |
111 | #define GENHD_FL_FAIL 64 | 118 | #define GENHD_FL_EXT_DEVT 64 /* allow extended devt */ |
119 | |||
120 | #define BLK_SCSI_MAX_CMDS (256) | ||
121 | #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) | ||
122 | |||
123 | struct blk_scsi_cmd_filter { | ||
124 | unsigned long read_ok[BLK_SCSI_CMD_PER_LONG]; | ||
125 | unsigned long write_ok[BLK_SCSI_CMD_PER_LONG]; | ||
126 | struct kobject kobj; | ||
127 | }; | ||
128 | |||
129 | struct disk_part_tbl { | ||
130 | struct rcu_head rcu_head; | ||
131 | int len; | ||
132 | struct hd_struct *part[]; | ||
133 | }; | ||
112 | 134 | ||
113 | struct gendisk { | 135 | struct gendisk { |
136 | /* major, first_minor and minors are input parameters only, | ||
137 | * don't use directly. Use disk_devt() and disk_max_parts(). | ||
138 | */ | ||
114 | int major; /* major number of driver */ | 139 | int major; /* major number of driver */ |
115 | int first_minor; | 140 | int first_minor; |
116 | int minors; /* maximum number of minors, =1 for | 141 | int minors; /* maximum number of minors, =1 for |
117 | * disks that can't be partitioned. */ | 142 | * disks that can't be partitioned. */ |
118 | char disk_name[32]; /* name of major driver */ | 143 | |
119 | struct hd_struct **part; /* [indexed by minor] */ | 144 | char disk_name[DISK_NAME_LEN]; /* name of major driver */ |
145 | |||
146 | /* Array of pointers to partitions indexed by partno. | ||
147 | * Protected with matching bdev lock but stat and other | ||
148 | * non-critical accesses use RCU. Always access through | ||
149 | * helpers. | ||
150 | */ | ||
151 | struct disk_part_tbl *part_tbl; | ||
152 | struct hd_struct part0; | ||
153 | |||
120 | struct block_device_operations *fops; | 154 | struct block_device_operations *fops; |
121 | struct request_queue *queue; | 155 | struct request_queue *queue; |
122 | void *private_data; | 156 | void *private_data; |
123 | sector_t capacity; | ||
124 | 157 | ||
125 | int flags; | 158 | int flags; |
126 | struct device *driverfs_dev; // FIXME: remove | 159 | struct device *driverfs_dev; // FIXME: remove |
127 | struct device dev; | ||
128 | struct kobject *holder_dir; | ||
129 | struct kobject *slave_dir; | 160 | struct kobject *slave_dir; |
130 | 161 | ||
131 | struct timer_rand_state *random; | 162 | struct timer_rand_state *random; |
132 | int policy; | ||
133 | 163 | ||
134 | atomic_t sync_io; /* RAID */ | 164 | atomic_t sync_io; /* RAID */ |
135 | unsigned long stamp; | ||
136 | int in_flight; | ||
137 | #ifdef CONFIG_SMP | ||
138 | struct disk_stats *dkstats; | ||
139 | #else | ||
140 | struct disk_stats dkstats; | ||
141 | #endif | ||
142 | struct work_struct async_notify; | 165 | struct work_struct async_notify; |
143 | #ifdef CONFIG_BLK_DEV_INTEGRITY | 166 | #ifdef CONFIG_BLK_DEV_INTEGRITY |
144 | struct blk_integrity *integrity; | 167 | struct blk_integrity *integrity; |
145 | #endif | 168 | #endif |
169 | int node_id; | ||
146 | }; | 170 | }; |
147 | 171 | ||
148 | /* | 172 | static inline struct gendisk *part_to_disk(struct hd_struct *part) |
149 | * Macros to operate on percpu disk statistics: | ||
150 | * | ||
151 | * The __ variants should only be called in critical sections. The full | ||
152 | * variants disable/enable preemption. | ||
153 | */ | ||
154 | static inline struct hd_struct *get_part(struct gendisk *gendiskp, | ||
155 | sector_t sector) | ||
156 | { | 173 | { |
157 | struct hd_struct *part; | 174 | if (likely(part)) { |
158 | int i; | 175 | if (part->partno) |
159 | for (i = 0; i < gendiskp->minors - 1; i++) { | 176 | return dev_to_disk(part_to_dev(part)->parent); |
160 | part = gendiskp->part[i]; | 177 | else |
161 | if (part && part->start_sect <= sector | 178 | return dev_to_disk(part_to_dev(part)); |
162 | && sector < part->start_sect + part->nr_sects) | ||
163 | return part; | ||
164 | } | 179 | } |
165 | return NULL; | 180 | return NULL; |
166 | } | 181 | } |
167 | 182 | ||
168 | #ifdef CONFIG_SMP | 183 | static inline int disk_max_parts(struct gendisk *disk) |
169 | #define __disk_stat_add(gendiskp, field, addnd) \ | 184 | { |
170 | (per_cpu_ptr(gendiskp->dkstats, smp_processor_id())->field += addnd) | 185 | if (disk->flags & GENHD_FL_EXT_DEVT) |
186 | return DISK_MAX_PARTS; | ||
187 | return disk->minors; | ||
188 | } | ||
171 | 189 | ||
172 | #define disk_stat_read(gendiskp, field) \ | 190 | static inline bool disk_partitionable(struct gendisk *disk) |
173 | ({ \ | 191 | { |
174 | typeof(gendiskp->dkstats->field) res = 0; \ | 192 | return disk_max_parts(disk) > 1; |
175 | int i; \ | 193 | } |
176 | for_each_possible_cpu(i) \ | ||
177 | res += per_cpu_ptr(gendiskp->dkstats, i)->field; \ | ||
178 | res; \ | ||
179 | }) | ||
180 | 194 | ||
181 | static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) { | 195 | static inline dev_t disk_devt(struct gendisk *disk) |
182 | int i; | 196 | { |
197 | return disk_to_dev(disk)->devt; | ||
198 | } | ||
183 | 199 | ||
184 | for_each_possible_cpu(i) | 200 | static inline dev_t part_devt(struct hd_struct *part) |
185 | memset(per_cpu_ptr(gendiskp->dkstats, i), value, | 201 | { |
186 | sizeof(struct disk_stats)); | 202 | return part_to_dev(part)->devt; |
187 | } | 203 | } |
188 | 204 | ||
189 | #define __part_stat_add(part, field, addnd) \ | 205 | extern struct hd_struct *disk_get_part(struct gendisk *disk, int partno); |
190 | (per_cpu_ptr(part->dkstats, smp_processor_id())->field += addnd) | ||
191 | 206 | ||
192 | #define __all_stat_add(gendiskp, part, field, addnd, sector) \ | 207 | static inline void disk_put_part(struct hd_struct *part) |
193 | ({ \ | 208 | { |
194 | if (part) \ | 209 | if (likely(part)) |
195 | __part_stat_add(part, field, addnd); \ | 210 | put_device(part_to_dev(part)); |
196 | __disk_stat_add(gendiskp, field, addnd); \ | 211 | } |
197 | }) | 212 | |
213 | /* | ||
214 | * Smarter partition iterator without context limits. | ||
215 | */ | ||
216 | #define DISK_PITER_REVERSE (1 << 0) /* iterate in the reverse direction */ | ||
217 | #define DISK_PITER_INCL_EMPTY (1 << 1) /* include 0-sized parts */ | ||
218 | #define DISK_PITER_INCL_PART0 (1 << 2) /* include partition 0 */ | ||
219 | |||
220 | struct disk_part_iter { | ||
221 | struct gendisk *disk; | ||
222 | struct hd_struct *part; | ||
223 | int idx; | ||
224 | unsigned int flags; | ||
225 | }; | ||
226 | |||
227 | extern void disk_part_iter_init(struct disk_part_iter *piter, | ||
228 | struct gendisk *disk, unsigned int flags); | ||
229 | extern struct hd_struct *disk_part_iter_next(struct disk_part_iter *piter); | ||
230 | extern void disk_part_iter_exit(struct disk_part_iter *piter); | ||
231 | |||
232 | extern struct hd_struct *disk_map_sector_rcu(struct gendisk *disk, | ||
233 | sector_t sector); | ||
234 | |||
235 | /* | ||
236 | * Macros to operate on percpu disk statistics: | ||
237 | * | ||
238 | * {disk|part|all}_stat_{add|sub|inc|dec}() modify the stat counters | ||
239 | * and should be called between disk_stat_lock() and | ||
240 | * disk_stat_unlock(). | ||
241 | * | ||
242 | * part_stat_read() can be called at any time. | ||
243 | * | ||
244 | * part_stat_{add|set_all}() and {init|free}_part_stats are for | ||
245 | * internal use only. | ||
246 | */ | ||
247 | #ifdef CONFIG_SMP | ||
248 | #define part_stat_lock() ({ rcu_read_lock(); get_cpu(); }) | ||
249 | #define part_stat_unlock() do { put_cpu(); rcu_read_unlock(); } while (0) | ||
250 | |||
251 | #define __part_stat_add(cpu, part, field, addnd) \ | ||
252 | (per_cpu_ptr((part)->dkstats, (cpu))->field += (addnd)) | ||
198 | 253 | ||
199 | #define part_stat_read(part, field) \ | 254 | #define part_stat_read(part, field) \ |
200 | ({ \ | 255 | ({ \ |
201 | typeof(part->dkstats->field) res = 0; \ | 256 | typeof((part)->dkstats->field) res = 0; \ |
202 | int i; \ | 257 | int i; \ |
203 | for_each_possible_cpu(i) \ | 258 | for_each_possible_cpu(i) \ |
204 | res += per_cpu_ptr(part->dkstats, i)->field; \ | 259 | res += per_cpu_ptr((part)->dkstats, i)->field; \ |
205 | res; \ | 260 | res; \ |
206 | }) | 261 | }) |
207 | 262 | ||
@@ -213,171 +268,107 @@ static inline void part_stat_set_all(struct hd_struct *part, int value) | |||
213 | memset(per_cpu_ptr(part->dkstats, i), value, | 268 | memset(per_cpu_ptr(part->dkstats, i), value, |
214 | sizeof(struct disk_stats)); | 269 | sizeof(struct disk_stats)); |
215 | } | 270 | } |
216 | |||
217 | #else /* !CONFIG_SMP */ | ||
218 | #define __disk_stat_add(gendiskp, field, addnd) \ | ||
219 | (gendiskp->dkstats.field += addnd) | ||
220 | #define disk_stat_read(gendiskp, field) (gendiskp->dkstats.field) | ||
221 | 271 | ||
222 | static inline void disk_stat_set_all(struct gendisk *gendiskp, int value) | 272 | static inline int init_part_stats(struct hd_struct *part) |
223 | { | 273 | { |
224 | memset(&gendiskp->dkstats, value, sizeof (struct disk_stats)); | 274 | part->dkstats = alloc_percpu(struct disk_stats); |
275 | if (!part->dkstats) | ||
276 | return 0; | ||
277 | return 1; | ||
225 | } | 278 | } |
226 | 279 | ||
227 | #define __part_stat_add(part, field, addnd) \ | 280 | static inline void free_part_stats(struct hd_struct *part) |
228 | (part->dkstats.field += addnd) | ||
229 | |||
230 | #define __all_stat_add(gendiskp, part, field, addnd, sector) \ | ||
231 | ({ \ | ||
232 | if (part) \ | ||
233 | part->dkstats.field += addnd; \ | ||
234 | __disk_stat_add(gendiskp, field, addnd); \ | ||
235 | }) | ||
236 | |||
237 | #define part_stat_read(part, field) (part->dkstats.field) | ||
238 | |||
239 | static inline void part_stat_set_all(struct hd_struct *part, int value) | ||
240 | { | 281 | { |
241 | memset(&part->dkstats, value, sizeof(struct disk_stats)); | 282 | free_percpu(part->dkstats); |
242 | } | 283 | } |
243 | 284 | ||
244 | #endif /* CONFIG_SMP */ | 285 | #else /* !CONFIG_SMP */ |
286 | #define part_stat_lock() ({ rcu_read_lock(); 0; }) | ||
287 | #define part_stat_unlock() rcu_read_unlock() | ||
245 | 288 | ||
246 | #define disk_stat_add(gendiskp, field, addnd) \ | 289 | #define __part_stat_add(cpu, part, field, addnd) \ |
247 | do { \ | 290 | ((part)->dkstats.field += addnd) |
248 | preempt_disable(); \ | 291 | |
249 | __disk_stat_add(gendiskp, field, addnd); \ | 292 | #define part_stat_read(part, field) ((part)->dkstats.field) |
250 | preempt_enable(); \ | ||
251 | } while (0) | ||
252 | |||
253 | #define __disk_stat_dec(gendiskp, field) __disk_stat_add(gendiskp, field, -1) | ||
254 | #define disk_stat_dec(gendiskp, field) disk_stat_add(gendiskp, field, -1) | ||
255 | |||
256 | #define __disk_stat_inc(gendiskp, field) __disk_stat_add(gendiskp, field, 1) | ||
257 | #define disk_stat_inc(gendiskp, field) disk_stat_add(gendiskp, field, 1) | ||
258 | |||
259 | #define __disk_stat_sub(gendiskp, field, subnd) \ | ||
260 | __disk_stat_add(gendiskp, field, -subnd) | ||
261 | #define disk_stat_sub(gendiskp, field, subnd) \ | ||
262 | disk_stat_add(gendiskp, field, -subnd) | ||
263 | |||
264 | #define part_stat_add(gendiskp, field, addnd) \ | ||
265 | do { \ | ||
266 | preempt_disable(); \ | ||
267 | __part_stat_add(gendiskp, field, addnd);\ | ||
268 | preempt_enable(); \ | ||
269 | } while (0) | ||
270 | |||
271 | #define __part_stat_dec(gendiskp, field) __part_stat_add(gendiskp, field, -1) | ||
272 | #define part_stat_dec(gendiskp, field) part_stat_add(gendiskp, field, -1) | ||
273 | |||
274 | #define __part_stat_inc(gendiskp, field) __part_stat_add(gendiskp, field, 1) | ||
275 | #define part_stat_inc(gendiskp, field) part_stat_add(gendiskp, field, 1) | ||
276 | |||
277 | #define __part_stat_sub(gendiskp, field, subnd) \ | ||
278 | __part_stat_add(gendiskp, field, -subnd) | ||
279 | #define part_stat_sub(gendiskp, field, subnd) \ | ||
280 | part_stat_add(gendiskp, field, -subnd) | ||
281 | |||
282 | #define all_stat_add(gendiskp, part, field, addnd, sector) \ | ||
283 | do { \ | ||
284 | preempt_disable(); \ | ||
285 | __all_stat_add(gendiskp, part, field, addnd, sector); \ | ||
286 | preempt_enable(); \ | ||
287 | } while (0) | ||
288 | |||
289 | #define __all_stat_dec(gendiskp, field, sector) \ | ||
290 | __all_stat_add(gendiskp, field, -1, sector) | ||
291 | #define all_stat_dec(gendiskp, field, sector) \ | ||
292 | all_stat_add(gendiskp, field, -1, sector) | ||
293 | |||
294 | #define __all_stat_inc(gendiskp, part, field, sector) \ | ||
295 | __all_stat_add(gendiskp, part, field, 1, sector) | ||
296 | #define all_stat_inc(gendiskp, part, field, sector) \ | ||
297 | all_stat_add(gendiskp, part, field, 1, sector) | ||
298 | |||
299 | #define __all_stat_sub(gendiskp, part, field, subnd, sector) \ | ||
300 | __all_stat_add(gendiskp, part, field, -subnd, sector) | ||
301 | #define all_stat_sub(gendiskp, part, field, subnd, sector) \ | ||
302 | all_stat_add(gendiskp, part, field, -subnd, sector) | ||
303 | |||
304 | /* Inlines to alloc and free disk stats in struct gendisk */ | ||
305 | #ifdef CONFIG_SMP | ||
306 | static inline int init_disk_stats(struct gendisk *disk) | ||
307 | { | ||
308 | disk->dkstats = alloc_percpu(struct disk_stats); | ||
309 | if (!disk->dkstats) | ||
310 | return 0; | ||
311 | return 1; | ||
312 | } | ||
313 | 293 | ||
314 | static inline void free_disk_stats(struct gendisk *disk) | 294 | static inline void part_stat_set_all(struct hd_struct *part, int value) |
315 | { | 295 | { |
316 | free_percpu(disk->dkstats); | 296 | memset(&part->dkstats, value, sizeof(struct disk_stats)); |
317 | } | 297 | } |
318 | 298 | ||
319 | static inline int init_part_stats(struct hd_struct *part) | 299 | static inline int init_part_stats(struct hd_struct *part) |
320 | { | 300 | { |
321 | part->dkstats = alloc_percpu(struct disk_stats); | ||
322 | if (!part->dkstats) | ||
323 | return 0; | ||
324 | return 1; | 301 | return 1; |
325 | } | 302 | } |
326 | 303 | ||
327 | static inline void free_part_stats(struct hd_struct *part) | 304 | static inline void free_part_stats(struct hd_struct *part) |
328 | { | 305 | { |
329 | free_percpu(part->dkstats); | ||
330 | } | ||
331 | |||
332 | #else /* CONFIG_SMP */ | ||
333 | static inline int init_disk_stats(struct gendisk *disk) | ||
334 | { | ||
335 | return 1; | ||
336 | } | 306 | } |
337 | 307 | ||
338 | static inline void free_disk_stats(struct gendisk *disk) | 308 | #endif /* CONFIG_SMP */ |
339 | { | ||
340 | } | ||
341 | 309 | ||
342 | static inline int init_part_stats(struct hd_struct *part) | 310 | #define part_stat_add(cpu, part, field, addnd) do { \ |
311 | __part_stat_add((cpu), (part), field, addnd); \ | ||
312 | if ((part)->partno) \ | ||
313 | __part_stat_add((cpu), &part_to_disk((part))->part0, \ | ||
314 | field, addnd); \ | ||
315 | } while (0) | ||
316 | |||
317 | #define part_stat_dec(cpu, gendiskp, field) \ | ||
318 | part_stat_add(cpu, gendiskp, field, -1) | ||
319 | #define part_stat_inc(cpu, gendiskp, field) \ | ||
320 | part_stat_add(cpu, gendiskp, field, 1) | ||
321 | #define part_stat_sub(cpu, gendiskp, field, subnd) \ | ||
322 | part_stat_add(cpu, gendiskp, field, -subnd) | ||
323 | |||
324 | static inline void part_inc_in_flight(struct hd_struct *part) | ||
343 | { | 325 | { |
344 | return 1; | 326 | part->in_flight++; |
327 | if (part->partno) | ||
328 | part_to_disk(part)->part0.in_flight++; | ||
345 | } | 329 | } |
346 | 330 | ||
347 | static inline void free_part_stats(struct hd_struct *part) | 331 | static inline void part_dec_in_flight(struct hd_struct *part) |
348 | { | 332 | { |
333 | part->in_flight--; | ||
334 | if (part->partno) | ||
335 | part_to_disk(part)->part0.in_flight--; | ||
349 | } | 336 | } |
350 | #endif /* CONFIG_SMP */ | ||
351 | 337 | ||
352 | /* drivers/block/ll_rw_blk.c */ | 338 | /* drivers/block/ll_rw_blk.c */ |
353 | extern void disk_round_stats(struct gendisk *disk); | 339 | extern void part_round_stats(int cpu, struct hd_struct *part); |
354 | extern void part_round_stats(struct hd_struct *part); | ||
355 | 340 | ||
356 | /* drivers/block/genhd.c */ | 341 | /* drivers/block/genhd.c */ |
357 | extern int get_blkdev_list(char *, int); | 342 | extern int get_blkdev_list(char *, int); |
358 | extern void add_disk(struct gendisk *disk); | 343 | extern void add_disk(struct gendisk *disk); |
359 | extern void del_gendisk(struct gendisk *gp); | 344 | extern void del_gendisk(struct gendisk *gp); |
360 | extern void unlink_gendisk(struct gendisk *gp); | 345 | extern void unlink_gendisk(struct gendisk *gp); |
361 | extern struct gendisk *get_gendisk(dev_t dev, int *part); | 346 | extern struct gendisk *get_gendisk(dev_t dev, int *partno); |
347 | extern struct block_device *bdget_disk(struct gendisk *disk, int partno); | ||
362 | 348 | ||
363 | extern void set_device_ro(struct block_device *bdev, int flag); | 349 | extern void set_device_ro(struct block_device *bdev, int flag); |
364 | extern void set_disk_ro(struct gendisk *disk, int flag); | 350 | extern void set_disk_ro(struct gendisk *disk, int flag); |
365 | 351 | ||
352 | static inline int get_disk_ro(struct gendisk *disk) | ||
353 | { | ||
354 | return disk->part0.policy; | ||
355 | } | ||
356 | |||
366 | /* drivers/char/random.c */ | 357 | /* drivers/char/random.c */ |
367 | extern void add_disk_randomness(struct gendisk *disk); | 358 | extern void add_disk_randomness(struct gendisk *disk); |
368 | extern void rand_initialize_disk(struct gendisk *disk); | 359 | extern void rand_initialize_disk(struct gendisk *disk); |
369 | 360 | ||
370 | static inline sector_t get_start_sect(struct block_device *bdev) | 361 | static inline sector_t get_start_sect(struct block_device *bdev) |
371 | { | 362 | { |
372 | return bdev->bd_contains == bdev ? 0 : bdev->bd_part->start_sect; | 363 | return bdev->bd_part->start_sect; |
373 | } | 364 | } |
374 | static inline sector_t get_capacity(struct gendisk *disk) | 365 | static inline sector_t get_capacity(struct gendisk *disk) |
375 | { | 366 | { |
376 | return disk->capacity; | 367 | return disk->part0.nr_sects; |
377 | } | 368 | } |
378 | static inline void set_capacity(struct gendisk *disk, sector_t size) | 369 | static inline void set_capacity(struct gendisk *disk, sector_t size) |
379 | { | 370 | { |
380 | disk->capacity = size; | 371 | disk->part0.nr_sects = size; |
381 | } | 372 | } |
382 | 373 | ||
383 | #ifdef CONFIG_SOLARIS_X86_PARTITION | 374 | #ifdef CONFIG_SOLARIS_X86_PARTITION |
@@ -527,9 +518,12 @@ struct unixware_disklabel { | |||
527 | #define ADDPART_FLAG_RAID 1 | 518 | #define ADDPART_FLAG_RAID 1 |
528 | #define ADDPART_FLAG_WHOLEDISK 2 | 519 | #define ADDPART_FLAG_WHOLEDISK 2 |
529 | 520 | ||
530 | extern dev_t blk_lookup_devt(const char *name, int part); | 521 | extern int blk_alloc_devt(struct hd_struct *part, dev_t *devt); |
531 | extern char *disk_name (struct gendisk *hd, int part, char *buf); | 522 | extern void blk_free_devt(dev_t devt); |
523 | extern dev_t blk_lookup_devt(const char *name, int partno); | ||
524 | extern char *disk_name (struct gendisk *hd, int partno, char *buf); | ||
532 | 525 | ||
526 | extern int disk_expand_part_tbl(struct gendisk *disk, int target); | ||
533 | extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev); | 527 | extern int rescan_partitions(struct gendisk *disk, struct block_device *bdev); |
534 | extern int __must_check add_partition(struct gendisk *, int, sector_t, sector_t, int); | 528 | extern int __must_check add_partition(struct gendisk *, int, sector_t, sector_t, int); |
535 | extern void delete_partition(struct gendisk *, int); | 529 | extern void delete_partition(struct gendisk *, int); |
@@ -546,16 +540,23 @@ extern void blk_register_region(dev_t devt, unsigned long range, | |||
546 | void *data); | 540 | void *data); |
547 | extern void blk_unregister_region(dev_t devt, unsigned long range); | 541 | extern void blk_unregister_region(dev_t devt, unsigned long range); |
548 | 542 | ||
549 | static inline struct block_device *bdget_disk(struct gendisk *disk, int index) | 543 | extern ssize_t part_size_show(struct device *dev, |
550 | { | 544 | struct device_attribute *attr, char *buf); |
551 | return bdget(MKDEV(disk->major, disk->first_minor) + index); | 545 | extern ssize_t part_stat_show(struct device *dev, |
552 | } | 546 | struct device_attribute *attr, char *buf); |
547 | #ifdef CONFIG_FAIL_MAKE_REQUEST | ||
548 | extern ssize_t part_fail_show(struct device *dev, | ||
549 | struct device_attribute *attr, char *buf); | ||
550 | extern ssize_t part_fail_store(struct device *dev, | ||
551 | struct device_attribute *attr, | ||
552 | const char *buf, size_t count); | ||
553 | #endif /* CONFIG_FAIL_MAKE_REQUEST */ | ||
553 | 554 | ||
554 | #else /* CONFIG_BLOCK */ | 555 | #else /* CONFIG_BLOCK */ |
555 | 556 | ||
556 | static inline void printk_all_partitions(void) { } | 557 | static inline void printk_all_partitions(void) { } |
557 | 558 | ||
558 | static inline dev_t blk_lookup_devt(const char *name, int part) | 559 | static inline dev_t blk_lookup_devt(const char *name, int partno) |
559 | { | 560 | { |
560 | dev_t devt = MKDEV(0, 0); | 561 | dev_t devt = MKDEV(0, 0); |
561 | return devt; | 562 | return devt; |
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h index c3c19f926e6f..14d0df0b5749 100644 --- a/include/linux/gfs2_ondisk.h +++ b/include/linux/gfs2_ondisk.h | |||
@@ -118,7 +118,11 @@ struct gfs2_sb { | |||
118 | 118 | ||
119 | char sb_lockproto[GFS2_LOCKNAME_LEN]; | 119 | char sb_lockproto[GFS2_LOCKNAME_LEN]; |
120 | char sb_locktable[GFS2_LOCKNAME_LEN]; | 120 | char sb_locktable[GFS2_LOCKNAME_LEN]; |
121 | /* In gfs1, quota and license dinodes followed */ | 121 | |
122 | struct gfs2_inum __pad3; /* Was quota inode in gfs1 */ | ||
123 | struct gfs2_inum __pad4; /* Was licence inode in gfs1 */ | ||
124 | #define GFS2_HAS_UUID 1 | ||
125 | __u8 sb_uuid[16]; /* The UUID, maybe 0 for backwards compat */ | ||
122 | }; | 126 | }; |
123 | 127 | ||
124 | /* | 128 | /* |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 6d93dce61cbb..2f245fe63bda 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -47,14 +47,22 @@ enum hrtimer_restart { | |||
47 | * HRTIMER_CB_IRQSAFE: Callback may run in hardirq context | 47 | * HRTIMER_CB_IRQSAFE: Callback may run in hardirq context |
48 | * HRTIMER_CB_IRQSAFE_NO_RESTART: Callback may run in hardirq context and | 48 | * HRTIMER_CB_IRQSAFE_NO_RESTART: Callback may run in hardirq context and |
49 | * does not restart the timer | 49 | * does not restart the timer |
50 | * HRTIMER_CB_IRQSAFE_NO_SOFTIRQ: Callback must run in hardirq context | 50 | * HRTIMER_CB_IRQSAFE_PERCPU: Callback must run in hardirq context |
51 | * Special mode for tick emultation | 51 | * Special mode for tick emulation and |
52 | * scheduler timer. Such timers are per | ||
53 | * cpu and not allowed to be migrated on | ||
54 | * cpu unplug. | ||
55 | * HRTIMER_CB_IRQSAFE_UNLOCKED: Callback should run in hardirq context | ||
56 | * with timer->base lock unlocked | ||
57 | * used for timers which call wakeup to | ||
58 | * avoid lock order problems with rq->lock | ||
52 | */ | 59 | */ |
53 | enum hrtimer_cb_mode { | 60 | enum hrtimer_cb_mode { |
54 | HRTIMER_CB_SOFTIRQ, | 61 | HRTIMER_CB_SOFTIRQ, |
55 | HRTIMER_CB_IRQSAFE, | 62 | HRTIMER_CB_IRQSAFE, |
56 | HRTIMER_CB_IRQSAFE_NO_RESTART, | 63 | HRTIMER_CB_IRQSAFE_NO_RESTART, |
57 | HRTIMER_CB_IRQSAFE_NO_SOFTIRQ, | 64 | HRTIMER_CB_IRQSAFE_PERCPU, |
65 | HRTIMER_CB_IRQSAFE_UNLOCKED, | ||
58 | }; | 66 | }; |
59 | 67 | ||
60 | /* | 68 | /* |
@@ -67,9 +75,10 @@ enum hrtimer_cb_mode { | |||
67 | * 0x02 callback function running | 75 | * 0x02 callback function running |
68 | * 0x04 callback pending (high resolution mode) | 76 | * 0x04 callback pending (high resolution mode) |
69 | * | 77 | * |
70 | * Special case: | 78 | * Special cases: |
71 | * 0x03 callback function running and enqueued | 79 | * 0x03 callback function running and enqueued |
72 | * (was requeued on another CPU) | 80 | * (was requeued on another CPU) |
81 | * 0x09 timer was migrated on CPU hotunplug | ||
73 | * The "callback function running and enqueued" status is only possible on | 82 | * The "callback function running and enqueued" status is only possible on |
74 | * SMP. It happens for example when a posix timer expired and the callback | 83 | * SMP. It happens for example when a posix timer expired and the callback |
75 | * queued a signal. Between dropping the lock which protects the posix timer | 84 | * queued a signal. Between dropping the lock which protects the posix timer |
@@ -87,6 +96,7 @@ enum hrtimer_cb_mode { | |||
87 | #define HRTIMER_STATE_ENQUEUED 0x01 | 96 | #define HRTIMER_STATE_ENQUEUED 0x01 |
88 | #define HRTIMER_STATE_CALLBACK 0x02 | 97 | #define HRTIMER_STATE_CALLBACK 0x02 |
89 | #define HRTIMER_STATE_PENDING 0x04 | 98 | #define HRTIMER_STATE_PENDING 0x04 |
99 | #define HRTIMER_STATE_MIGRATE 0x08 | ||
90 | 100 | ||
91 | /** | 101 | /** |
92 | * struct hrtimer - the basic hrtimer structure | 102 | * struct hrtimer - the basic hrtimer structure |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 1524829f73f2..a9d82d6e6bdd 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -8,7 +8,7 @@ | |||
8 | 8 | ||
9 | #include <linux/init.h> | 9 | #include <linux/init.h> |
10 | #include <linux/ioport.h> | 10 | #include <linux/ioport.h> |
11 | #include <linux/hdreg.h> | 11 | #include <linux/ata.h> |
12 | #include <linux/blkdev.h> | 12 | #include <linux/blkdev.h> |
13 | #include <linux/proc_fs.h> | 13 | #include <linux/proc_fs.h> |
14 | #include <linux/interrupt.h> | 14 | #include <linux/interrupt.h> |
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/device.h> | 17 | #include <linux/device.h> |
18 | #include <linux/pci.h> | 18 | #include <linux/pci.h> |
19 | #include <linux/completion.h> | 19 | #include <linux/completion.h> |
20 | #include <linux/pm.h> | ||
20 | #ifdef CONFIG_BLK_DEV_IDEACPI | 21 | #ifdef CONFIG_BLK_DEV_IDEACPI |
21 | #include <acpi/acpi.h> | 22 | #include <acpi/acpi.h> |
22 | #endif | 23 | #endif |
@@ -87,12 +88,13 @@ struct ide_io_ports { | |||
87 | }; | 88 | }; |
88 | 89 | ||
89 | #define OK_STAT(stat,good,bad) (((stat)&((good)|(bad)))==(good)) | 90 | #define OK_STAT(stat,good,bad) (((stat)&((good)|(bad)))==(good)) |
90 | #define BAD_R_STAT (BUSY_STAT | ERR_STAT) | ||
91 | #define BAD_W_STAT (BAD_R_STAT | WRERR_STAT) | ||
92 | #define BAD_STAT (BAD_R_STAT | DRQ_STAT) | ||
93 | #define DRIVE_READY (READY_STAT | SEEK_STAT) | ||
94 | 91 | ||
95 | #define BAD_CRC (ABRT_ERR | ICRC_ERR) | 92 | #define BAD_R_STAT (ATA_BUSY | ATA_ERR) |
93 | #define BAD_W_STAT (BAD_R_STAT | ATA_DF) | ||
94 | #define BAD_STAT (BAD_R_STAT | ATA_DRQ) | ||
95 | #define DRIVE_READY (ATA_DRDY | ATA_DSC) | ||
96 | |||
97 | #define BAD_CRC (ATA_ABORTED | ATA_ICRC) | ||
96 | 98 | ||
97 | #define SATA_NR_PORTS (3) /* 16 possible ?? */ | 99 | #define SATA_NR_PORTS (3) /* 16 possible ?? */ |
98 | 100 | ||
@@ -125,24 +127,41 @@ struct ide_io_ports { | |||
125 | #define PARTN_BITS 6 /* number of minor dev bits for partitions */ | 127 | #define PARTN_BITS 6 /* number of minor dev bits for partitions */ |
126 | #define MAX_DRIVES 2 /* per interface; 2 assumed by lots of code */ | 128 | #define MAX_DRIVES 2 /* per interface; 2 assumed by lots of code */ |
127 | #define SECTOR_SIZE 512 | 129 | #define SECTOR_SIZE 512 |
128 | #define SECTOR_WORDS (SECTOR_SIZE / 4) /* number of 32bit words per sector */ | 130 | |
129 | #define IDE_LARGE_SEEK(b1,b2,t) (((b1) > (b2) + (t)) || ((b2) > (b1) + (t))) | 131 | #define IDE_LARGE_SEEK(b1,b2,t) (((b1) > (b2) + (t)) || ((b2) > (b1) + (t))) |
130 | 132 | ||
131 | /* | 133 | /* |
132 | * Timeouts for various operations: | 134 | * Timeouts for various operations: |
133 | */ | 135 | */ |
134 | #define WAIT_DRQ (HZ/10) /* 100msec - spec allows up to 20ms */ | 136 | enum { |
135 | #define WAIT_READY (5*HZ) /* 5sec - some laptops are very slow */ | 137 | /* spec allows up to 20ms */ |
136 | #define WAIT_PIDENTIFY (10*HZ) /* 10sec - should be less than 3ms (?), if all ATAPI CD is closed at boot */ | 138 | WAIT_DRQ = HZ / 10, /* 100ms */ |
137 | #define WAIT_WORSTCASE (30*HZ) /* 30sec - worst case when spinning up */ | 139 | /* some laptops are very slow */ |
138 | #define WAIT_CMD (10*HZ) /* 10sec - maximum wait for an IRQ to happen */ | 140 | WAIT_READY = 5 * HZ, /* 5s */ |
139 | #define WAIT_MIN_SLEEP (2*HZ/100) /* 20msec - minimum sleep time */ | 141 | /* should be less than 3ms (?), if all ATAPI CD is closed at boot */ |
142 | WAIT_PIDENTIFY = 10 * HZ, /* 10s */ | ||
143 | /* worst case when spinning up */ | ||
144 | WAIT_WORSTCASE = 30 * HZ, /* 30s */ | ||
145 | /* maximum wait for an IRQ to happen */ | ||
146 | WAIT_CMD = 10 * HZ, /* 10s */ | ||
147 | /* Some drives require a longer IRQ timeout. */ | ||
148 | WAIT_FLOPPY_CMD = 50 * HZ, /* 50s */ | ||
149 | /* | ||
150 | * Some drives (for example, Seagate STT3401A Travan) require a very | ||
151 | * long timeout, because they don't return an interrupt or clear their | ||
152 | * BSY bit until after the command completes (even retension commands). | ||
153 | */ | ||
154 | WAIT_TAPE_CMD = 900 * HZ, /* 900s */ | ||
155 | /* minimum sleep time */ | ||
156 | WAIT_MIN_SLEEP = HZ / 50, /* 20ms */ | ||
157 | }; | ||
140 | 158 | ||
141 | /* | 159 | /* |
142 | * Op codes for special requests to be handled by ide_special_rq(). | 160 | * Op codes for special requests to be handled by ide_special_rq(). |
143 | * Values should be in the range of 0x20 to 0x3f. | 161 | * Values should be in the range of 0x20 to 0x3f. |
144 | */ | 162 | */ |
145 | #define REQ_DRIVE_RESET 0x20 | 163 | #define REQ_DRIVE_RESET 0x20 |
164 | #define REQ_DEVSET_EXEC 0x21 | ||
146 | 165 | ||
147 | /* | 166 | /* |
148 | * Check for an interrupt and acknowledge the interrupt status | 167 | * Check for an interrupt and acknowledge the interrupt status |
@@ -303,8 +322,8 @@ typedef enum { | |||
303 | ide_started, /* a drive operation was started, handler was set */ | 322 | ide_started, /* a drive operation was started, handler was set */ |
304 | } ide_startstop_t; | 323 | } ide_startstop_t; |
305 | 324 | ||
325 | struct ide_devset; | ||
306 | struct ide_driver_s; | 326 | struct ide_driver_s; |
307 | struct ide_settings_s; | ||
308 | 327 | ||
309 | #ifdef CONFIG_BLK_DEV_IDEACPI | 328 | #ifdef CONFIG_BLK_DEV_IDEACPI |
310 | struct ide_acpi_drive_link; | 329 | struct ide_acpi_drive_link; |
@@ -315,10 +334,10 @@ struct ide_acpi_hwif_link; | |||
315 | enum { | 334 | enum { |
316 | IDE_AFLAG_DRQ_INTERRUPT = (1 << 0), | 335 | IDE_AFLAG_DRQ_INTERRUPT = (1 << 0), |
317 | IDE_AFLAG_MEDIA_CHANGED = (1 << 1), | 336 | IDE_AFLAG_MEDIA_CHANGED = (1 << 1), |
318 | |||
319 | /* ide-cd */ | ||
320 | /* Drive cannot lock the door. */ | 337 | /* Drive cannot lock the door. */ |
321 | IDE_AFLAG_NO_DOORLOCK = (1 << 2), | 338 | IDE_AFLAG_NO_DOORLOCK = (1 << 2), |
339 | |||
340 | /* ide-cd */ | ||
322 | /* Drive cannot eject the disc. */ | 341 | /* Drive cannot eject the disc. */ |
323 | IDE_AFLAG_NO_EJECT = (1 << 3), | 342 | IDE_AFLAG_NO_EJECT = (1 << 3), |
324 | /* Drive is a pre ATAPI 1.2 drive. */ | 343 | /* Drive is a pre ATAPI 1.2 drive. */ |
@@ -354,19 +373,25 @@ enum { | |||
354 | IDE_AFLAG_CLIK_DRIVE = (1 << 19), | 373 | IDE_AFLAG_CLIK_DRIVE = (1 << 19), |
355 | /* Requires BH algorithm for packets */ | 374 | /* Requires BH algorithm for packets */ |
356 | IDE_AFLAG_ZIP_DRIVE = (1 << 20), | 375 | IDE_AFLAG_ZIP_DRIVE = (1 << 20), |
376 | /* Write protect */ | ||
377 | IDE_AFLAG_WP = (1 << 21), | ||
378 | /* Supports format progress report */ | ||
379 | IDE_AFLAG_SRFP = (1 << 22), | ||
357 | 380 | ||
358 | /* ide-tape */ | 381 | /* ide-tape */ |
359 | IDE_AFLAG_IGNORE_DSC = (1 << 21), | 382 | IDE_AFLAG_IGNORE_DSC = (1 << 23), |
360 | /* 0 When the tape position is unknown */ | 383 | /* 0 When the tape position is unknown */ |
361 | IDE_AFLAG_ADDRESS_VALID = (1 << 22), | 384 | IDE_AFLAG_ADDRESS_VALID = (1 << 24), |
362 | /* Device already opened */ | 385 | /* Device already opened */ |
363 | IDE_AFLAG_BUSY = (1 << 23), | 386 | IDE_AFLAG_BUSY = (1 << 25), |
364 | /* Attempt to auto-detect the current user block size */ | 387 | /* Attempt to auto-detect the current user block size */ |
365 | IDE_AFLAG_DETECT_BS = (1 << 24), | 388 | IDE_AFLAG_DETECT_BS = (1 << 26), |
366 | /* Currently on a filemark */ | 389 | /* Currently on a filemark */ |
367 | IDE_AFLAG_FILEMARK = (1 << 25), | 390 | IDE_AFLAG_FILEMARK = (1 << 27), |
368 | /* 0 = no tape is loaded, so we don't rewind after ejecting */ | 391 | /* 0 = no tape is loaded, so we don't rewind after ejecting */ |
369 | IDE_AFLAG_MEDIUM_PRESENT = (1 << 26) | 392 | IDE_AFLAG_MEDIUM_PRESENT = (1 << 28), |
393 | |||
394 | IDE_AFLAG_NO_AUTOCLOSE = (1 << 29), | ||
370 | }; | 395 | }; |
371 | 396 | ||
372 | struct ide_drive_s { | 397 | struct ide_drive_s { |
@@ -378,10 +403,10 @@ struct ide_drive_s { | |||
378 | struct request *rq; /* current request */ | 403 | struct request *rq; /* current request */ |
379 | struct ide_drive_s *next; /* circular list of hwgroup drives */ | 404 | struct ide_drive_s *next; /* circular list of hwgroup drives */ |
380 | void *driver_data; /* extra driver data */ | 405 | void *driver_data; /* extra driver data */ |
381 | struct hd_driveid *id; /* drive model identification info */ | 406 | u16 *id; /* identification info */ |
382 | #ifdef CONFIG_IDE_PROC_FS | 407 | #ifdef CONFIG_IDE_PROC_FS |
383 | struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ | 408 | struct proc_dir_entry *proc; /* /proc/ide/ directory entry */ |
384 | struct ide_settings_s *settings;/* /proc/ide/ drive settings */ | 409 | const struct ide_proc_devset *settings; /* /proc/ide/ drive settings */ |
385 | #endif | 410 | #endif |
386 | struct hwif_s *hwif; /* actually (ide_hwif_t *) */ | 411 | struct hwif_s *hwif; /* actually (ide_hwif_t *) */ |
387 | 412 | ||
@@ -393,16 +418,16 @@ struct ide_drive_s { | |||
393 | special_t special; /* special action flags */ | 418 | special_t special; /* special action flags */ |
394 | select_t select; /* basic drive/head select reg value */ | 419 | select_t select; /* basic drive/head select reg value */ |
395 | 420 | ||
396 | u8 keep_settings; /* restore settings after drive reset */ | ||
397 | u8 using_dma; /* disk is using dma for read/write */ | ||
398 | u8 retry_pio; /* retrying dma capable host in pio */ | 421 | u8 retry_pio; /* retrying dma capable host in pio */ |
399 | u8 state; /* retry state */ | 422 | u8 state; /* retry state */ |
400 | u8 waiting_for_dma; /* dma currently in progress */ | 423 | u8 waiting_for_dma; /* dma currently in progress */ |
401 | u8 unmask; /* okay to unmask other irqs */ | ||
402 | u8 noflush; /* don't attempt flushes */ | ||
403 | u8 dsc_overlap; /* DSC overlap */ | ||
404 | u8 nice1; /* give potential excess bandwidth */ | ||
405 | 424 | ||
425 | unsigned keep_settings : 1; /* restore settings after drive reset */ | ||
426 | unsigned using_dma : 1; /* disk is using dma for read/write */ | ||
427 | unsigned unmask : 1; /* okay to unmask other irqs */ | ||
428 | unsigned noflush : 1; /* don't attempt flushes */ | ||
429 | unsigned dsc_overlap : 1; /* DSC overlap */ | ||
430 | unsigned nice1 : 1; /* give potential excess bandwidth */ | ||
406 | unsigned present : 1; /* drive is physically present */ | 431 | unsigned present : 1; /* drive is physically present */ |
407 | unsigned dead : 1; /* device ejected hint */ | 432 | unsigned dead : 1; /* device ejected hint */ |
408 | unsigned id_read : 1; /* 1=id read from disk 0 = synthetic */ | 433 | unsigned id_read : 1; /* 1=id read from disk 0 = synthetic */ |
@@ -412,23 +437,22 @@ struct ide_drive_s { | |||
412 | unsigned forced_geom : 1; /* 1 if hdx=c,h,s was given at boot */ | 437 | unsigned forced_geom : 1; /* 1 if hdx=c,h,s was given at boot */ |
413 | unsigned no_unmask : 1; /* disallow setting unmask bit */ | 438 | unsigned no_unmask : 1; /* disallow setting unmask bit */ |
414 | unsigned no_io_32bit : 1; /* disallow enabling 32bit I/O */ | 439 | unsigned no_io_32bit : 1; /* disallow enabling 32bit I/O */ |
415 | unsigned atapi_overlap : 1; /* ATAPI overlap (not supported) */ | ||
416 | unsigned doorlocking : 1; /* for removable only: door lock/unlock works */ | 440 | unsigned doorlocking : 1; /* for removable only: door lock/unlock works */ |
417 | unsigned nodma : 1; /* disallow DMA */ | 441 | unsigned nodma : 1; /* disallow DMA */ |
418 | unsigned remap_0_to_1 : 1; /* 0=noremap, 1=remap 0->1 (for EZDrive) */ | ||
419 | unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */ | 442 | unsigned blocked : 1; /* 1=powermanagment told us not to do anything, so sleep nicely */ |
420 | unsigned scsi : 1; /* 0=default, 1=ide-scsi emulation */ | 443 | unsigned scsi : 1; /* 0=default, 1=ide-scsi emulation */ |
421 | unsigned sleeping : 1; /* 1=sleeping & sleep field valid */ | 444 | unsigned sleeping : 1; /* 1=sleeping & sleep field valid */ |
422 | unsigned post_reset : 1; | 445 | unsigned post_reset : 1; |
423 | unsigned udma33_warned : 1; | 446 | unsigned udma33_warned : 1; |
447 | unsigned addressing : 2; /* 0=28-bit, 1=48-bit, 2=48-bit doing 28-bit */ | ||
448 | unsigned wcache : 1; /* status of write cache */ | ||
449 | unsigned nowerr : 1; /* used for ignoring ATA_DF */ | ||
424 | 450 | ||
425 | u8 addressing; /* 0=28-bit, 1=48-bit, 2=48-bit doing 28-bit */ | ||
426 | u8 quirk_list; /* considered quirky, set for a specific host */ | 451 | u8 quirk_list; /* considered quirky, set for a specific host */ |
427 | u8 init_speed; /* transfer rate set at boot */ | 452 | u8 init_speed; /* transfer rate set at boot */ |
428 | u8 current_speed; /* current transfer rate set */ | 453 | u8 current_speed; /* current transfer rate set */ |
429 | u8 desired_speed; /* desired transfer rate set */ | 454 | u8 desired_speed; /* desired transfer rate set */ |
430 | u8 dn; /* now wide spread use */ | 455 | u8 dn; /* now wide spread use */ |
431 | u8 wcache; /* status of write cache */ | ||
432 | u8 acoustic; /* acoustic management */ | 456 | u8 acoustic; /* acoustic management */ |
433 | u8 media; /* disk, cdrom, tape, floppy, ... */ | 457 | u8 media; /* disk, cdrom, tape, floppy, ... */ |
434 | u8 ready_stat; /* min status value for drive ready */ | 458 | u8 ready_stat; /* min status value for drive ready */ |
@@ -436,9 +460,7 @@ struct ide_drive_s { | |||
436 | u8 mult_req; /* requested multiple sector setting */ | 460 | u8 mult_req; /* requested multiple sector setting */ |
437 | u8 tune_req; /* requested drive tuning setting */ | 461 | u8 tune_req; /* requested drive tuning setting */ |
438 | u8 io_32bit; /* 0=16-bit, 1=32-bit, 2/3=32bit+sync */ | 462 | u8 io_32bit; /* 0=16-bit, 1=32-bit, 2/3=32bit+sync */ |
439 | u8 bad_wstat; /* used for ignoring WRERR_STAT */ | 463 | u8 bad_wstat; /* used for ignoring ATA_DF */ |
440 | u8 nowerr; /* used for ignoring WRERR_STAT */ | ||
441 | u8 sect0; /* offset of first sector for DM6:DDO */ | ||
442 | u8 head; /* "real" number of heads */ | 464 | u8 head; /* "real" number of heads */ |
443 | u8 sect; /* "real" sectors per track */ | 465 | u8 sect; /* "real" sectors per track */ |
444 | u8 bios_head; /* BIOS/fdisk/LILO number of heads */ | 466 | u8 bios_head; /* BIOS/fdisk/LILO number of heads */ |
@@ -472,10 +494,6 @@ typedef struct ide_drive_s ide_drive_t; | |||
472 | 494 | ||
473 | #define to_ide_device(dev)container_of(dev, ide_drive_t, gendev) | 495 | #define to_ide_device(dev)container_of(dev, ide_drive_t, gendev) |
474 | 496 | ||
475 | #define IDE_CHIPSET_PCI_MASK \ | ||
476 | ((1<<ide_pci)|(1<<ide_cmd646)|(1<<ide_ali14xx)) | ||
477 | #define IDE_CHIPSET_IS_PCI(c) ((IDE_CHIPSET_PCI_MASK >> (c)) & 1) | ||
478 | |||
479 | struct ide_task_s; | 497 | struct ide_task_s; |
480 | struct ide_port_info; | 498 | struct ide_port_info; |
481 | 499 | ||
@@ -565,7 +583,6 @@ typedef struct hwif_s { | |||
565 | u8 major; /* our major number */ | 583 | u8 major; /* our major number */ |
566 | u8 index; /* 0 for ide0; 1 for ide1; ... */ | 584 | u8 index; /* 0 for ide0; 1 for ide1; ... */ |
567 | u8 channel; /* for dual-port chips: 0=primary, 1=secondary */ | 585 | u8 channel; /* for dual-port chips: 0=primary, 1=secondary */ |
568 | u8 bus_state; /* power state of the IDE bus */ | ||
569 | 586 | ||
570 | u32 host_flags; | 587 | u32 host_flags; |
571 | 588 | ||
@@ -643,6 +660,7 @@ struct ide_host { | |||
643 | ide_hwif_t *ports[MAX_HWIFS]; | 660 | ide_hwif_t *ports[MAX_HWIFS]; |
644 | unsigned int n_ports; | 661 | unsigned int n_ports; |
645 | struct device *dev[2]; | 662 | struct device *dev[2]; |
663 | unsigned int (*init_chipset)(struct pci_dev *); | ||
646 | unsigned long host_flags; | 664 | unsigned long host_flags; |
647 | void *host_priv; | 665 | void *host_priv; |
648 | }; | 666 | }; |
@@ -690,9 +708,61 @@ typedef struct ide_driver_s ide_driver_t; | |||
690 | 708 | ||
691 | extern struct mutex ide_setting_mtx; | 709 | extern struct mutex ide_setting_mtx; |
692 | 710 | ||
693 | int set_io_32bit(ide_drive_t *, int); | 711 | /* |
694 | int set_pio_mode(ide_drive_t *, int); | 712 | * configurable drive settings |
695 | int set_using_dma(ide_drive_t *, int); | 713 | */ |
714 | |||
715 | #define DS_SYNC (1 << 0) | ||
716 | |||
717 | struct ide_devset { | ||
718 | int (*get)(ide_drive_t *); | ||
719 | int (*set)(ide_drive_t *, int); | ||
720 | unsigned int flags; | ||
721 | }; | ||
722 | |||
723 | #define __DEVSET(_flags, _get, _set) { \ | ||
724 | .flags = _flags, \ | ||
725 | .get = _get, \ | ||
726 | .set = _set, \ | ||
727 | } | ||
728 | |||
729 | #define ide_devset_get(name, field) \ | ||
730 | static int get_##name(ide_drive_t *drive) \ | ||
731 | { \ | ||
732 | return drive->field; \ | ||
733 | } | ||
734 | |||
735 | #define ide_devset_set(name, field) \ | ||
736 | static int set_##name(ide_drive_t *drive, int arg) \ | ||
737 | { \ | ||
738 | drive->field = arg; \ | ||
739 | return 0; \ | ||
740 | } | ||
741 | |||
742 | #define __IDE_DEVSET(_name, _flags, _get, _set) \ | ||
743 | const struct ide_devset ide_devset_##_name = \ | ||
744 | __DEVSET(_flags, _get, _set) | ||
745 | |||
746 | #define IDE_DEVSET(_name, _flags, _get, _set) \ | ||
747 | static __IDE_DEVSET(_name, _flags, _get, _set) | ||
748 | |||
749 | #define ide_devset_rw(_name, _func) \ | ||
750 | IDE_DEVSET(_name, 0, get_##_func, set_##_func) | ||
751 | |||
752 | #define ide_devset_w(_name, _func) \ | ||
753 | IDE_DEVSET(_name, 0, NULL, set_##_func) | ||
754 | |||
755 | #define ide_devset_rw_sync(_name, _func) \ | ||
756 | IDE_DEVSET(_name, DS_SYNC, get_##_func, set_##_func) | ||
757 | |||
758 | #define ide_decl_devset(_name) \ | ||
759 | extern const struct ide_devset ide_devset_##_name | ||
760 | |||
761 | ide_decl_devset(io_32bit); | ||
762 | ide_decl_devset(keepsettings); | ||
763 | ide_decl_devset(pio_mode); | ||
764 | ide_decl_devset(unmaskirq); | ||
765 | ide_decl_devset(using_dma); | ||
696 | 766 | ||
697 | /* ATAPI packet command flags */ | 767 | /* ATAPI packet command flags */ |
698 | enum { | 768 | enum { |
@@ -708,6 +778,12 @@ enum { | |||
708 | PC_FLAG_TIMEDOUT = (1 << 7), | 778 | PC_FLAG_TIMEDOUT = (1 << 7), |
709 | }; | 779 | }; |
710 | 780 | ||
781 | /* | ||
782 | * With each packet command, we allocate a buffer of IDE_PC_BUFFER_SIZE bytes. | ||
783 | * This is used for several packet commands (not for READ/WRITE commands). | ||
784 | */ | ||
785 | #define IDE_PC_BUFFER_SIZE 256 | ||
786 | |||
711 | struct ide_atapi_pc { | 787 | struct ide_atapi_pc { |
712 | /* actual packet bytes */ | 788 | /* actual packet bytes */ |
713 | u8 c[12]; | 789 | u8 c[12]; |
@@ -737,7 +813,7 @@ struct ide_atapi_pc { | |||
737 | * those are more or less driver-specific and some of them are subject | 813 | * those are more or less driver-specific and some of them are subject |
738 | * to change/removal later. | 814 | * to change/removal later. |
739 | */ | 815 | */ |
740 | u8 pc_buf[256]; | 816 | u8 pc_buf[IDE_PC_BUFFER_SIZE]; |
741 | 817 | ||
742 | /* idetape only */ | 818 | /* idetape only */ |
743 | struct idetape_bh *bh; | 819 | struct idetape_bh *bh; |
@@ -755,37 +831,34 @@ struct ide_atapi_pc { | |||
755 | 831 | ||
756 | #ifdef CONFIG_IDE_PROC_FS | 832 | #ifdef CONFIG_IDE_PROC_FS |
757 | /* | 833 | /* |
758 | * configurable drive settings | 834 | * /proc/ide interface |
759 | */ | 835 | */ |
760 | 836 | ||
761 | #define TYPE_INT 0 | 837 | #define ide_devset_rw_field(_name, _field) \ |
762 | #define TYPE_BYTE 1 | 838 | ide_devset_get(_name, _field); \ |
763 | #define TYPE_SHORT 2 | 839 | ide_devset_set(_name, _field); \ |
840 | IDE_DEVSET(_name, DS_SYNC, get_##_name, set_##_name) | ||
841 | |||
842 | struct ide_proc_devset { | ||
843 | const char *name; | ||
844 | const struct ide_devset *setting; | ||
845 | int min, max; | ||
846 | int (*mulf)(ide_drive_t *); | ||
847 | int (*divf)(ide_drive_t *); | ||
848 | }; | ||
764 | 849 | ||
765 | #define SETTING_READ (1 << 0) | 850 | #define __IDE_PROC_DEVSET(_name, _min, _max, _mulf, _divf) { \ |
766 | #define SETTING_WRITE (1 << 1) | 851 | .name = __stringify(_name), \ |
767 | #define SETTING_RW (SETTING_READ | SETTING_WRITE) | 852 | .setting = &ide_devset_##_name, \ |
853 | .min = _min, \ | ||
854 | .max = _max, \ | ||
855 | .mulf = _mulf, \ | ||
856 | .divf = _divf, \ | ||
857 | } | ||
768 | 858 | ||
769 | typedef int (ide_procset_t)(ide_drive_t *, int); | 859 | #define IDE_PROC_DEVSET(_name, _min, _max) \ |
770 | typedef struct ide_settings_s { | 860 | __IDE_PROC_DEVSET(_name, _min, _max, NULL, NULL) |
771 | char *name; | ||
772 | int rw; | ||
773 | int data_type; | ||
774 | int min; | ||
775 | int max; | ||
776 | int mul_factor; | ||
777 | int div_factor; | ||
778 | void *data; | ||
779 | ide_procset_t *set; | ||
780 | int auto_remove; | ||
781 | struct ide_settings_s *next; | ||
782 | } ide_settings_t; | ||
783 | |||
784 | int ide_add_setting(ide_drive_t *, const char *, int, int, int, int, int, int, void *, ide_procset_t *set); | ||
785 | 861 | ||
786 | /* | ||
787 | * /proc/ide interface | ||
788 | */ | ||
789 | typedef struct { | 862 | typedef struct { |
790 | const char *name; | 863 | const char *name; |
791 | mode_t mode; | 864 | mode_t mode; |
@@ -802,8 +875,6 @@ void ide_proc_unregister_port(ide_hwif_t *); | |||
802 | void ide_proc_register_driver(ide_drive_t *, ide_driver_t *); | 875 | void ide_proc_register_driver(ide_drive_t *, ide_driver_t *); |
803 | void ide_proc_unregister_driver(ide_drive_t *, ide_driver_t *); | 876 | void ide_proc_unregister_driver(ide_drive_t *, ide_driver_t *); |
804 | 877 | ||
805 | void ide_add_generic_settings(ide_drive_t *); | ||
806 | |||
807 | read_proc_t proc_ide_read_capacity; | 878 | read_proc_t proc_ide_read_capacity; |
808 | read_proc_t proc_ide_read_geometry; | 879 | read_proc_t proc_ide_read_geometry; |
809 | 880 | ||
@@ -831,7 +902,6 @@ static inline void ide_proc_unregister_device(ide_drive_t *drive) { ; } | |||
831 | static inline void ide_proc_unregister_port(ide_hwif_t *hwif) { ; } | 902 | static inline void ide_proc_unregister_port(ide_hwif_t *hwif) { ; } |
832 | static inline void ide_proc_register_driver(ide_drive_t *drive, ide_driver_t *driver) { ; } | 903 | static inline void ide_proc_register_driver(ide_drive_t *drive, ide_driver_t *driver) { ; } |
833 | static inline void ide_proc_unregister_driver(ide_drive_t *drive, ide_driver_t *driver) { ; } | 904 | static inline void ide_proc_unregister_driver(ide_drive_t *drive, ide_driver_t *driver) { ; } |
834 | static inline void ide_add_generic_settings(ide_drive_t *drive) { ; } | ||
835 | #define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0; | 905 | #define PROC_IDE_READ_RETURN(page,start,off,count,eof,len) return 0; |
836 | #endif | 906 | #endif |
837 | 907 | ||
@@ -877,7 +947,6 @@ enum { | |||
877 | struct ide_driver_s { | 947 | struct ide_driver_s { |
878 | const char *version; | 948 | const char *version; |
879 | u8 media; | 949 | u8 media; |
880 | unsigned supports_dsc_overlap : 1; | ||
881 | ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t); | 950 | ide_startstop_t (*do_request)(ide_drive_t *, struct request *, sector_t); |
882 | int (*end_request)(ide_drive_t *, int, int); | 951 | int (*end_request)(ide_drive_t *, int, int); |
883 | ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8); | 952 | ide_startstop_t (*error)(ide_drive_t *, struct request *rq, u8, u8); |
@@ -887,7 +956,8 @@ struct ide_driver_s { | |||
887 | void (*resume)(ide_drive_t *); | 956 | void (*resume)(ide_drive_t *); |
888 | void (*shutdown)(ide_drive_t *); | 957 | void (*shutdown)(ide_drive_t *); |
889 | #ifdef CONFIG_IDE_PROC_FS | 958 | #ifdef CONFIG_IDE_PROC_FS |
890 | ide_proc_entry_t *proc; | 959 | ide_proc_entry_t *proc; |
960 | const struct ide_proc_devset *settings; | ||
891 | #endif | 961 | #endif |
892 | }; | 962 | }; |
893 | 963 | ||
@@ -896,7 +966,17 @@ struct ide_driver_s { | |||
896 | int ide_device_get(ide_drive_t *); | 966 | int ide_device_get(ide_drive_t *); |
897 | void ide_device_put(ide_drive_t *); | 967 | void ide_device_put(ide_drive_t *); |
898 | 968 | ||
899 | int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, unsigned, unsigned long); | 969 | struct ide_ioctl_devset { |
970 | unsigned int get_ioctl; | ||
971 | unsigned int set_ioctl; | ||
972 | const struct ide_devset *setting; | ||
973 | }; | ||
974 | |||
975 | int ide_setting_ioctl(ide_drive_t *, struct block_device *, unsigned int, | ||
976 | unsigned long, const struct ide_ioctl_devset *); | ||
977 | |||
978 | int generic_ide_ioctl(ide_drive_t *, struct file *, struct block_device *, | ||
979 | unsigned, unsigned long); | ||
900 | 980 | ||
901 | extern int ide_vlb_clk; | 981 | extern int ide_vlb_clk; |
902 | extern int ide_pci_clk; | 982 | extern int ide_pci_clk; |
@@ -918,14 +998,19 @@ ide_startstop_t __ide_error(ide_drive_t *, struct request *, u8, u8); | |||
918 | 998 | ||
919 | ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat); | 999 | ide_startstop_t ide_error (ide_drive_t *drive, const char *msg, byte stat); |
920 | 1000 | ||
921 | extern void ide_fix_driveid(struct hd_driveid *); | 1001 | void ide_fix_driveid(u16 *); |
922 | 1002 | ||
923 | extern void ide_fixstring(u8 *, const int, const int); | 1003 | extern void ide_fixstring(u8 *, const int, const int); |
924 | 1004 | ||
1005 | int ide_busy_sleep(ide_hwif_t *, unsigned long, int); | ||
1006 | |||
925 | int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long); | 1007 | int ide_wait_stat(ide_startstop_t *, ide_drive_t *, u8, u8, unsigned long); |
926 | 1008 | ||
927 | extern ide_startstop_t ide_do_reset (ide_drive_t *); | 1009 | extern ide_startstop_t ide_do_reset (ide_drive_t *); |
928 | 1010 | ||
1011 | extern int ide_devset_execute(ide_drive_t *drive, | ||
1012 | const struct ide_devset *setting, int arg); | ||
1013 | |||
929 | extern void ide_do_drive_cmd(ide_drive_t *, struct request *); | 1014 | extern void ide_do_drive_cmd(ide_drive_t *, struct request *); |
930 | 1015 | ||
931 | extern void ide_end_drive_cmd(ide_drive_t *, u8, u8); | 1016 | extern void ide_end_drive_cmd(ide_drive_t *, u8, u8); |
@@ -1049,6 +1134,8 @@ void ide_tf_read(ide_drive_t *, ide_task_t *); | |||
1049 | void ide_input_data(ide_drive_t *, struct request *, void *, unsigned int); | 1134 | void ide_input_data(ide_drive_t *, struct request *, void *, unsigned int); |
1050 | void ide_output_data(ide_drive_t *, struct request *, void *, unsigned int); | 1135 | void ide_output_data(ide_drive_t *, struct request *, void *, unsigned int); |
1051 | 1136 | ||
1137 | int ide_io_buffers(ide_drive_t *, struct ide_atapi_pc *, unsigned int, int); | ||
1138 | |||
1052 | extern void SELECT_DRIVE(ide_drive_t *); | 1139 | extern void SELECT_DRIVE(ide_drive_t *); |
1053 | void SELECT_MASK(ide_drive_t *, int); | 1140 | void SELECT_MASK(ide_drive_t *, int); |
1054 | 1141 | ||
@@ -1059,11 +1146,36 @@ extern int drive_is_ready(ide_drive_t *); | |||
1059 | 1146 | ||
1060 | void ide_pktcmd_tf_load(ide_drive_t *, u32, u16, u8); | 1147 | void ide_pktcmd_tf_load(ide_drive_t *, u32, u16, u8); |
1061 | 1148 | ||
1149 | int ide_check_atapi_device(ide_drive_t *, const char *); | ||
1150 | |||
1151 | void ide_init_pc(struct ide_atapi_pc *); | ||
1152 | |||
1153 | /* | ||
1154 | * Special requests for ide-tape block device strategy routine. | ||
1155 | * | ||
1156 | * In order to service a character device command, we add special requests to | ||
1157 | * the tail of our block device request queue and wait for their completion. | ||
1158 | */ | ||
1159 | enum { | ||
1160 | REQ_IDETAPE_PC1 = (1 << 0), /* packet command (first stage) */ | ||
1161 | REQ_IDETAPE_PC2 = (1 << 1), /* packet command (second stage) */ | ||
1162 | REQ_IDETAPE_READ = (1 << 2), | ||
1163 | REQ_IDETAPE_WRITE = (1 << 3), | ||
1164 | }; | ||
1165 | |||
1166 | void ide_queue_pc_head(ide_drive_t *, struct gendisk *, struct ide_atapi_pc *, | ||
1167 | struct request *); | ||
1168 | int ide_queue_pc_tail(ide_drive_t *, struct gendisk *, struct ide_atapi_pc *); | ||
1169 | |||
1170 | int ide_do_test_unit_ready(ide_drive_t *, struct gendisk *); | ||
1171 | int ide_do_start_stop(ide_drive_t *, struct gendisk *, int); | ||
1172 | int ide_set_media_lock(ide_drive_t *, struct gendisk *, int); | ||
1173 | |||
1062 | ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc, | 1174 | ide_startstop_t ide_pc_intr(ide_drive_t *drive, struct ide_atapi_pc *pc, |
1063 | ide_handler_t *handler, unsigned int timeout, ide_expiry_t *expiry, | 1175 | ide_handler_t *handler, unsigned int timeout, ide_expiry_t *expiry, |
1064 | void (*update_buffers)(ide_drive_t *, struct ide_atapi_pc *), | 1176 | void (*update_buffers)(ide_drive_t *, struct ide_atapi_pc *), |
1065 | void (*retry_pc)(ide_drive_t *), void (*dsc_handle)(ide_drive_t *), | 1177 | void (*retry_pc)(ide_drive_t *), void (*dsc_handle)(ide_drive_t *), |
1066 | void (*io_buffers)(ide_drive_t *, struct ide_atapi_pc *, unsigned int, | 1178 | int (*io_buffers)(ide_drive_t *, struct ide_atapi_pc *, unsigned int, |
1067 | int)); | 1179 | int)); |
1068 | ide_startstop_t ide_transfer_pc(ide_drive_t *, struct ide_atapi_pc *, | 1180 | ide_startstop_t ide_transfer_pc(ide_drive_t *, struct ide_atapi_pc *, |
1069 | ide_handler_t *, unsigned int, ide_expiry_t *); | 1181 | ide_handler_t *, unsigned int, ide_expiry_t *); |
@@ -1078,8 +1190,6 @@ int ide_raw_taskfile(ide_drive_t *, ide_task_t *, u8 *, u16); | |||
1078 | int ide_no_data_taskfile(ide_drive_t *, ide_task_t *); | 1190 | int ide_no_data_taskfile(ide_drive_t *, ide_task_t *); |
1079 | 1191 | ||
1080 | int ide_taskfile_ioctl(ide_drive_t *, unsigned int, unsigned long); | 1192 | int ide_taskfile_ioctl(ide_drive_t *, unsigned int, unsigned long); |
1081 | int ide_cmd_ioctl(ide_drive_t *, unsigned int, unsigned long); | ||
1082 | int ide_task_ioctl(ide_drive_t *, unsigned int, unsigned long); | ||
1083 | 1193 | ||
1084 | extern int ide_driveid_update(ide_drive_t *); | 1194 | extern int ide_driveid_update(ide_drive_t *); |
1085 | extern int ide_config_drive_speed(ide_drive_t *, u8); | 1195 | extern int ide_config_drive_speed(ide_drive_t *, u8); |
@@ -1090,7 +1200,6 @@ extern int ide_wait_not_busy(ide_hwif_t *hwif, unsigned long timeout); | |||
1090 | 1200 | ||
1091 | extern void ide_stall_queue(ide_drive_t *drive, unsigned long timeout); | 1201 | extern void ide_stall_queue(ide_drive_t *drive, unsigned long timeout); |
1092 | 1202 | ||
1093 | extern int ide_spin_wait_hwgroup(ide_drive_t *); | ||
1094 | extern void ide_timer_expiry(unsigned long); | 1203 | extern void ide_timer_expiry(unsigned long); |
1095 | extern irqreturn_t ide_intr(int irq, void *dev_id); | 1204 | extern irqreturn_t ide_intr(int irq, void *dev_id); |
1096 | extern void do_ide_request(struct request_queue *); | 1205 | extern void do_ide_request(struct request_queue *); |
@@ -1227,6 +1336,14 @@ int ide_pci_init_two(struct pci_dev *, struct pci_dev *, | |||
1227 | const struct ide_port_info *, void *); | 1336 | const struct ide_port_info *, void *); |
1228 | void ide_pci_remove(struct pci_dev *); | 1337 | void ide_pci_remove(struct pci_dev *); |
1229 | 1338 | ||
1339 | #ifdef CONFIG_PM | ||
1340 | int ide_pci_suspend(struct pci_dev *, pm_message_t); | ||
1341 | int ide_pci_resume(struct pci_dev *); | ||
1342 | #else | ||
1343 | #define ide_pci_suspend NULL | ||
1344 | #define ide_pci_resume NULL | ||
1345 | #endif | ||
1346 | |||
1230 | void ide_map_sg(ide_drive_t *, struct request *); | 1347 | void ide_map_sg(ide_drive_t *, struct request *); |
1231 | void ide_init_sg_cmd(ide_drive_t *, struct request *); | 1348 | void ide_init_sg_cmd(ide_drive_t *, struct request *); |
1232 | 1349 | ||
@@ -1238,7 +1355,7 @@ struct drive_list_entry { | |||
1238 | const char *id_firmware; | 1355 | const char *id_firmware; |
1239 | }; | 1356 | }; |
1240 | 1357 | ||
1241 | int ide_in_drive_list(struct hd_driveid *, const struct drive_list_entry *); | 1358 | int ide_in_drive_list(u16 *, const struct drive_list_entry *); |
1242 | 1359 | ||
1243 | #ifdef CONFIG_BLK_DEV_IDEDMA | 1360 | #ifdef CONFIG_BLK_DEV_IDEDMA |
1244 | int __ide_dma_bad_drive(ide_drive_t *); | 1361 | int __ide_dma_bad_drive(ide_drive_t *); |
@@ -1345,24 +1462,6 @@ const char *ide_xfer_verbose(u8 mode); | |||
1345 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); | 1462 | extern void ide_toggle_bounce(ide_drive_t *drive, int on); |
1346 | extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); | 1463 | extern int ide_set_xfer_rate(ide_drive_t *drive, u8 rate); |
1347 | 1464 | ||
1348 | static inline int ide_dev_has_iordy(struct hd_driveid *id) | ||
1349 | { | ||
1350 | return ((id->field_valid & 2) && (id->capability & 8)) ? 1 : 0; | ||
1351 | } | ||
1352 | |||
1353 | static inline int ide_dev_is_sata(struct hd_driveid *id) | ||
1354 | { | ||
1355 | /* | ||
1356 | * See if word 93 is 0 AND drive is at least ATA-5 compatible | ||
1357 | * verifying that word 80 by casting it to a signed type -- | ||
1358 | * this trick allows us to filter out the reserved values of | ||
1359 | * 0x0000 and 0xffff along with the earlier ATA revisions... | ||
1360 | */ | ||
1361 | if (id->hw_config == 0 && (short)id->major_rev_num >= 0x0020) | ||
1362 | return 1; | ||
1363 | return 0; | ||
1364 | } | ||
1365 | |||
1366 | u64 ide_get_lba_addr(struct ide_taskfile *, int); | 1465 | u64 ide_get_lba_addr(struct ide_taskfile *, int); |
1367 | u8 ide_dump_status(ide_drive_t *, const char *, u8); | 1466 | u8 ide_dump_status(ide_drive_t *, const char *, u8); |
1368 | 1467 | ||
@@ -1434,13 +1533,6 @@ extern struct mutex ide_cfg_mtx; | |||
1434 | extern struct bus_type ide_bus_type; | 1533 | extern struct bus_type ide_bus_type; |
1435 | extern struct class *ide_port_class; | 1534 | extern struct class *ide_port_class; |
1436 | 1535 | ||
1437 | /* check if CACHE FLUSH (EXT) command is supported (bits defined in ATA-6) */ | ||
1438 | #define ide_id_has_flush_cache(id) ((id)->cfs_enable_2 & 0x3000) | ||
1439 | |||
1440 | /* some Maxtor disks have bit 13 defined incorrectly so check bit 10 too */ | ||
1441 | #define ide_id_has_flush_cache_ext(id) \ | ||
1442 | (((id)->cfs_enable_2 & 0x2400) == 0x2400) | ||
1443 | |||
1444 | static inline void ide_dump_identify(u8 *id) | 1536 | static inline void ide_dump_identify(u8 *id) |
1445 | { | 1537 | { |
1446 | print_hex_dump(KERN_INFO, "", DUMP_PREFIX_NONE, 16, 2, id, 512, 0); | 1538 | print_hex_dump(KERN_INFO, "", DUMP_PREFIX_NONE, 16, 2, id, 512, 0); |
@@ -1451,10 +1543,10 @@ static inline int hwif_to_node(ide_hwif_t *hwif) | |||
1451 | return hwif->dev ? dev_to_node(hwif->dev) : -1; | 1543 | return hwif->dev ? dev_to_node(hwif->dev) : -1; |
1452 | } | 1544 | } |
1453 | 1545 | ||
1454 | static inline ide_drive_t *ide_get_paired_drive(ide_drive_t *drive) | 1546 | static inline ide_drive_t *ide_get_pair_dev(ide_drive_t *drive) |
1455 | { | 1547 | { |
1456 | ide_hwif_t *hwif = HWIF(drive); | 1548 | ide_drive_t *peer = &drive->hwif->drives[(drive->dn ^ 1) & 1]; |
1457 | 1549 | ||
1458 | return &hwif->drives[(drive->dn ^ 1) & 1]; | 1550 | return peer->present ? peer : NULL; |
1459 | } | 1551 | } |
1460 | #endif /* _IDE_H */ | 1552 | #endif /* _IDE_H */ |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 7f4df7c7659d..14126bc36641 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -471,6 +471,11 @@ struct ieee80211s_hdr { | |||
471 | u8 eaddr3[6]; | 471 | u8 eaddr3[6]; |
472 | } __attribute__ ((packed)); | 472 | } __attribute__ ((packed)); |
473 | 473 | ||
474 | /* Mesh flags */ | ||
475 | #define MESH_FLAGS_AE_A4 0x1 | ||
476 | #define MESH_FLAGS_AE_A5_A6 0x2 | ||
477 | #define MESH_FLAGS_PS_DEEP 0x4 | ||
478 | |||
474 | /** | 479 | /** |
475 | * struct ieee80211_quiet_ie | 480 | * struct ieee80211_quiet_ie |
476 | * | 481 | * |
@@ -643,6 +648,9 @@ struct ieee80211_mgmt { | |||
643 | } u; | 648 | } u; |
644 | } __attribute__ ((packed)); | 649 | } __attribute__ ((packed)); |
645 | 650 | ||
651 | /* mgmt header + 1 byte category code */ | ||
652 | #define IEEE80211_MIN_ACTION_SIZE offsetof(struct ieee80211_mgmt, u.action.u) | ||
653 | |||
646 | 654 | ||
647 | /* Control frames */ | 655 | /* Control frames */ |
648 | struct ieee80211_rts { | 656 | struct ieee80211_rts { |
@@ -708,12 +716,13 @@ struct ieee80211_ht_addt_info { | |||
708 | 716 | ||
709 | /* 802.11n HT capabilities masks */ | 717 | /* 802.11n HT capabilities masks */ |
710 | #define IEEE80211_HT_CAP_SUP_WIDTH 0x0002 | 718 | #define IEEE80211_HT_CAP_SUP_WIDTH 0x0002 |
711 | #define IEEE80211_HT_CAP_MIMO_PS 0x000C | 719 | #define IEEE80211_HT_CAP_SM_PS 0x000C |
712 | #define IEEE80211_HT_CAP_GRN_FLD 0x0010 | 720 | #define IEEE80211_HT_CAP_GRN_FLD 0x0010 |
713 | #define IEEE80211_HT_CAP_SGI_20 0x0020 | 721 | #define IEEE80211_HT_CAP_SGI_20 0x0020 |
714 | #define IEEE80211_HT_CAP_SGI_40 0x0040 | 722 | #define IEEE80211_HT_CAP_SGI_40 0x0040 |
715 | #define IEEE80211_HT_CAP_DELAY_BA 0x0400 | 723 | #define IEEE80211_HT_CAP_DELAY_BA 0x0400 |
716 | #define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 | 724 | #define IEEE80211_HT_CAP_MAX_AMSDU 0x0800 |
725 | #define IEEE80211_HT_CAP_DSSSCCK40 0x1000 | ||
717 | /* 802.11n HT capability AMPDU settings */ | 726 | /* 802.11n HT capability AMPDU settings */ |
718 | #define IEEE80211_HT_CAP_AMPDU_FACTOR 0x03 | 727 | #define IEEE80211_HT_CAP_AMPDU_FACTOR 0x03 |
719 | #define IEEE80211_HT_CAP_AMPDU_DENSITY 0x1C | 728 | #define IEEE80211_HT_CAP_AMPDU_DENSITY 0x1C |
@@ -736,11 +745,26 @@ struct ieee80211_ht_addt_info { | |||
736 | #define IEEE80211_HT_IE_NON_GF_STA_PRSNT 0x0004 | 745 | #define IEEE80211_HT_IE_NON_GF_STA_PRSNT 0x0004 |
737 | #define IEEE80211_HT_IE_NON_HT_STA_PRSNT 0x0010 | 746 | #define IEEE80211_HT_IE_NON_HT_STA_PRSNT 0x0010 |
738 | 747 | ||
739 | /* MIMO Power Save Modes */ | 748 | /* block-ack parameters */ |
740 | #define WLAN_HT_CAP_MIMO_PS_STATIC 0 | 749 | #define IEEE80211_ADDBA_PARAM_POLICY_MASK 0x0002 |
741 | #define WLAN_HT_CAP_MIMO_PS_DYNAMIC 1 | 750 | #define IEEE80211_ADDBA_PARAM_TID_MASK 0x003C |
742 | #define WLAN_HT_CAP_MIMO_PS_INVALID 2 | 751 | #define IEEE80211_ADDBA_PARAM_BUF_SIZE_MASK 0xFFA0 |
743 | #define WLAN_HT_CAP_MIMO_PS_DISABLED 3 | 752 | #define IEEE80211_DELBA_PARAM_TID_MASK 0xF000 |
753 | #define IEEE80211_DELBA_PARAM_INITIATOR_MASK 0x0800 | ||
754 | |||
755 | /* | ||
756 | * A-PMDU buffer sizes | ||
757 | * According to IEEE802.11n spec size varies from 8K to 64K (in powers of 2) | ||
758 | */ | ||
759 | #define IEEE80211_MIN_AMPDU_BUF 0x8 | ||
760 | #define IEEE80211_MAX_AMPDU_BUF 0x40 | ||
761 | |||
762 | |||
763 | /* Spatial Multiplexing Power Save Modes */ | ||
764 | #define WLAN_HT_CAP_SM_PS_STATIC 0 | ||
765 | #define WLAN_HT_CAP_SM_PS_DYNAMIC 1 | ||
766 | #define WLAN_HT_CAP_SM_PS_INVALID 2 | ||
767 | #define WLAN_HT_CAP_SM_PS_DISABLED 3 | ||
744 | 768 | ||
745 | /* Authentication algorithms */ | 769 | /* Authentication algorithms */ |
746 | #define WLAN_AUTH_OPEN 0 | 770 | #define WLAN_AUTH_OPEN 0 |
diff --git a/include/linux/if.h b/include/linux/if.h index 5c9d1fa93fef..65246846c844 100644 --- a/include/linux/if.h +++ b/include/linux/if.h | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/compiler.h> /* for "__user" et al */ | 24 | #include <linux/compiler.h> /* for "__user" et al */ |
25 | 25 | ||
26 | #define IFNAMSIZ 16 | 26 | #define IFNAMSIZ 16 |
27 | #define IFALIASZ 256 | ||
27 | #include <linux/hdlc/ioctl.h> | 28 | #include <linux/hdlc/ioctl.h> |
28 | 29 | ||
29 | /* Standard interface flags (netdevice->flags). */ | 30 | /* Standard interface flags (netdevice->flags). */ |
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index e157c1399b61..bf1a53b2682e 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
@@ -56,6 +56,7 @@ | |||
56 | #define ETH_P_DIAG 0x6005 /* DEC Diagnostics */ | 56 | #define ETH_P_DIAG 0x6005 /* DEC Diagnostics */ |
57 | #define ETH_P_CUST 0x6006 /* DEC Customer use */ | 57 | #define ETH_P_CUST 0x6006 /* DEC Customer use */ |
58 | #define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */ | 58 | #define ETH_P_SCA 0x6007 /* DEC Systems Comms Arch */ |
59 | #define ETH_P_TEB 0x6558 /* Trans Ether Bridging */ | ||
59 | #define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */ | 60 | #define ETH_P_RARP 0x8035 /* Reverse Addr Res packet */ |
60 | #define ETH_P_ATALK 0x809B /* Appletalk DDP */ | 61 | #define ETH_P_ATALK 0x809B /* Appletalk DDP */ |
61 | #define ETH_P_AARP 0x80F3 /* Appletalk AARP */ | 62 | #define ETH_P_AARP 0x80F3 /* Appletalk AARP */ |
@@ -74,8 +75,10 @@ | |||
74 | #define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport | 75 | #define ETH_P_ATMFATE 0x8884 /* Frame-based ATM Transport |
75 | * over Ethernet | 76 | * over Ethernet |
76 | */ | 77 | */ |
78 | #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ | ||
77 | #define ETH_P_AOE 0x88A2 /* ATA over Ethernet */ | 79 | #define ETH_P_AOE 0x88A2 /* ATA over Ethernet */ |
78 | #define ETH_P_TIPC 0x88CA /* TIPC */ | 80 | #define ETH_P_TIPC 0x88CA /* TIPC */ |
81 | #define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */ | ||
79 | 82 | ||
80 | /* | 83 | /* |
81 | * Non DIX types. Won't clash for 1500 types. | 84 | * Non DIX types. Won't clash for 1500 types. |
@@ -99,6 +102,9 @@ | |||
99 | #define ETH_P_ECONET 0x0018 /* Acorn Econet */ | 102 | #define ETH_P_ECONET 0x0018 /* Acorn Econet */ |
100 | #define ETH_P_HDLC 0x0019 /* HDLC frames */ | 103 | #define ETH_P_HDLC 0x0019 /* HDLC frames */ |
101 | #define ETH_P_ARCNET 0x001A /* 1A for ArcNet :-) */ | 104 | #define ETH_P_ARCNET 0x001A /* 1A for ArcNet :-) */ |
105 | #define ETH_P_DSA 0x001B /* Distributed Switch Arch. */ | ||
106 | #define ETH_P_TRAILER 0x001C /* Trailer switch tagging */ | ||
107 | #define ETH_P_PHONET 0x00F5 /* Nokia Phonet frames */ | ||
102 | 108 | ||
103 | /* | 109 | /* |
104 | * This is an Ethernet frame header. | 110 | * This is an Ethernet frame header. |
diff --git a/include/linux/if_link.h b/include/linux/if_link.h index 84c3492ae5cb..f9032c88716a 100644 --- a/include/linux/if_link.h +++ b/include/linux/if_link.h | |||
@@ -79,6 +79,7 @@ enum | |||
79 | IFLA_LINKINFO, | 79 | IFLA_LINKINFO, |
80 | #define IFLA_LINKINFO IFLA_LINKINFO | 80 | #define IFLA_LINKINFO IFLA_LINKINFO |
81 | IFLA_NET_NS_PID, | 81 | IFLA_NET_NS_PID, |
82 | IFLA_IFALIAS, | ||
82 | __IFLA_MAX | 83 | __IFLA_MAX |
83 | }; | 84 | }; |
84 | 85 | ||
diff --git a/include/linux/if_phonet.h b/include/linux/if_phonet.h new file mode 100644 index 000000000000..d70034bcec05 --- /dev/null +++ b/include/linux/if_phonet.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * File: if_phonet.h | ||
3 | * | ||
4 | * Phonet interface kernel definitions | ||
5 | * | ||
6 | * Copyright (C) 2008 Nokia Corporation. All rights reserved. | ||
7 | */ | ||
8 | #ifndef LINUX_IF_PHONET_H | ||
9 | #define LINUX_IF_PHONET_H | ||
10 | |||
11 | #define PHONET_MIN_MTU 6 /* pn_length = 0 */ | ||
12 | #define PHONET_MAX_MTU 65541 /* pn_length = 0xffff */ | ||
13 | #define PHONET_DEV_MTU PHONET_MAX_MTU | ||
14 | |||
15 | #ifdef __KERNEL__ | ||
16 | extern struct header_ops phonet_header_ops; | ||
17 | #endif | ||
18 | |||
19 | #endif | ||
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h index d4efe4014705..aeab2cb32a9c 100644 --- a/include/linux/if_tunnel.h +++ b/include/linux/if_tunnel.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _IF_TUNNEL_H_ | 2 | #define _IF_TUNNEL_H_ |
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/ip.h> | ||
5 | 6 | ||
6 | #define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0) | 7 | #define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0) |
7 | #define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1) | 8 | #define SIOCADDTUNNEL (SIOCDEVPRIVATE + 1) |
@@ -47,4 +48,22 @@ struct ip_tunnel_prl { | |||
47 | /* PRL flags */ | 48 | /* PRL flags */ |
48 | #define PRL_DEFAULT 0x0001 | 49 | #define PRL_DEFAULT 0x0001 |
49 | 50 | ||
51 | enum | ||
52 | { | ||
53 | IFLA_GRE_UNSPEC, | ||
54 | IFLA_GRE_LINK, | ||
55 | IFLA_GRE_IFLAGS, | ||
56 | IFLA_GRE_OFLAGS, | ||
57 | IFLA_GRE_IKEY, | ||
58 | IFLA_GRE_OKEY, | ||
59 | IFLA_GRE_LOCAL, | ||
60 | IFLA_GRE_REMOTE, | ||
61 | IFLA_GRE_TTL, | ||
62 | IFLA_GRE_TOS, | ||
63 | IFLA_GRE_PMTUDISC, | ||
64 | __IFLA_GRE_MAX, | ||
65 | }; | ||
66 | |||
67 | #define IFLA_GRE_MAX (__IFLA_GRE_MAX - 1) | ||
68 | |||
50 | #endif /* _IF_TUNNEL_H_ */ | 69 | #endif /* _IF_TUNNEL_H_ */ |
diff --git a/include/linux/in.h b/include/linux/in.h index 4065313cd7ee..db458beef19d 100644 --- a/include/linux/in.h +++ b/include/linux/in.h | |||
@@ -75,6 +75,7 @@ struct in_addr { | |||
75 | #define IP_IPSEC_POLICY 16 | 75 | #define IP_IPSEC_POLICY 16 |
76 | #define IP_XFRM_POLICY 17 | 76 | #define IP_XFRM_POLICY 17 |
77 | #define IP_PASSSEC 18 | 77 | #define IP_PASSSEC 18 |
78 | #define IP_TRANSPARENT 19 | ||
78 | 79 | ||
79 | /* BSD compatibility */ | 80 | /* BSD compatibility */ |
80 | #define IP_RECVRETOPTS IP_RETOPTS | 81 | #define IP_RECVRETOPTS IP_RETOPTS |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index c6f51ad52d5b..06fcdb45106b 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -25,6 +25,7 @@ struct in_device | |||
25 | struct in_ifaddr *ifa_list; /* IP ifaddr chain */ | 25 | struct in_ifaddr *ifa_list; /* IP ifaddr chain */ |
26 | rwlock_t mc_list_lock; | 26 | rwlock_t mc_list_lock; |
27 | struct ip_mc_list *mc_list; /* IP multicast filter chain */ | 27 | struct ip_mc_list *mc_list; /* IP multicast filter chain */ |
28 | int mc_count; /* Number of installed mcasts */ | ||
28 | spinlock_t mc_tomb_lock; | 29 | spinlock_t mc_tomb_lock; |
29 | struct ip_mc_list *mc_tomb; | 30 | struct ip_mc_list *mc_tomb; |
30 | unsigned long mr_v1_seen; | 31 | unsigned long mr_v1_seen; |
diff --git a/include/linux/iommu-helper.h b/include/linux/iommu-helper.h index c975caf75385..a6d0586e2bf7 100644 --- a/include/linux/iommu-helper.h +++ b/include/linux/iommu-helper.h | |||
@@ -1,6 +1,20 @@ | |||
1 | #ifndef _LINUX_IOMMU_HELPER_H | ||
2 | #define _LINUX_IOMMU_HELPER_H | ||
3 | |||
4 | static inline unsigned long iommu_device_max_index(unsigned long size, | ||
5 | unsigned long offset, | ||
6 | u64 dma_mask) | ||
7 | { | ||
8 | if (size + offset > dma_mask) | ||
9 | return dma_mask - offset + 1; | ||
10 | else | ||
11 | return size; | ||
12 | } | ||
13 | |||
1 | extern int iommu_is_span_boundary(unsigned int index, unsigned int nr, | 14 | extern int iommu_is_span_boundary(unsigned int index, unsigned int nr, |
2 | unsigned long shift, | 15 | unsigned long shift, |
3 | unsigned long boundary_size); | 16 | unsigned long boundary_size); |
17 | extern void iommu_area_reserve(unsigned long *map, unsigned long i, int len); | ||
4 | extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, | 18 | extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, |
5 | unsigned long start, unsigned int nr, | 19 | unsigned long start, unsigned int nr, |
6 | unsigned long shift, | 20 | unsigned long shift, |
@@ -8,3 +22,5 @@ extern unsigned long iommu_area_alloc(unsigned long *map, unsigned long size, | |||
8 | unsigned long align_mask); | 22 | unsigned long align_mask); |
9 | extern void iommu_area_free(unsigned long *map, unsigned long start, | 23 | extern void iommu_area_free(unsigned long *map, unsigned long start, |
10 | unsigned int nr); | 24 | unsigned int nr); |
25 | |||
26 | #endif | ||
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 350033e8f4e1..ee9bcc6f32b6 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -108,6 +108,9 @@ extern struct resource iomem_resource; | |||
108 | 108 | ||
109 | extern int request_resource(struct resource *root, struct resource *new); | 109 | extern int request_resource(struct resource *root, struct resource *new); |
110 | extern int release_resource(struct resource *new); | 110 | extern int release_resource(struct resource *new); |
111 | extern void reserve_region_with_split(struct resource *root, | ||
112 | resource_size_t start, resource_size_t end, | ||
113 | const char *name); | ||
111 | extern int insert_resource(struct resource *parent, struct resource *new); | 114 | extern int insert_resource(struct resource *parent, struct resource *new); |
112 | extern void insert_resource_expand_to_fit(struct resource *root, struct resource *new); | 115 | extern void insert_resource_expand_to_fit(struct resource *root, struct resource *new); |
113 | extern int allocate_resource(struct resource *root, struct resource *new, | 116 | extern int allocate_resource(struct resource *root, struct resource *new, |
diff --git a/include/linux/ip_vs.h b/include/linux/ip_vs.h index ec6eb49af2d8..0f434a28fb58 100644 --- a/include/linux/ip_vs.h +++ b/include/linux/ip_vs.h | |||
@@ -242,4 +242,164 @@ struct ip_vs_daemon_user { | |||
242 | int syncid; | 242 | int syncid; |
243 | }; | 243 | }; |
244 | 244 | ||
245 | /* | ||
246 | * | ||
247 | * IPVS Generic Netlink interface definitions | ||
248 | * | ||
249 | */ | ||
250 | |||
251 | /* Generic Netlink family info */ | ||
252 | |||
253 | #define IPVS_GENL_NAME "IPVS" | ||
254 | #define IPVS_GENL_VERSION 0x1 | ||
255 | |||
256 | struct ip_vs_flags { | ||
257 | __be32 flags; | ||
258 | __be32 mask; | ||
259 | }; | ||
260 | |||
261 | /* Generic Netlink command attributes */ | ||
262 | enum { | ||
263 | IPVS_CMD_UNSPEC = 0, | ||
264 | |||
265 | IPVS_CMD_NEW_SERVICE, /* add service */ | ||
266 | IPVS_CMD_SET_SERVICE, /* modify service */ | ||
267 | IPVS_CMD_DEL_SERVICE, /* delete service */ | ||
268 | IPVS_CMD_GET_SERVICE, /* get service info */ | ||
269 | |||
270 | IPVS_CMD_NEW_DEST, /* add destination */ | ||
271 | IPVS_CMD_SET_DEST, /* modify destination */ | ||
272 | IPVS_CMD_DEL_DEST, /* delete destination */ | ||
273 | IPVS_CMD_GET_DEST, /* get destination info */ | ||
274 | |||
275 | IPVS_CMD_NEW_DAEMON, /* start sync daemon */ | ||
276 | IPVS_CMD_DEL_DAEMON, /* stop sync daemon */ | ||
277 | IPVS_CMD_GET_DAEMON, /* get sync daemon status */ | ||
278 | |||
279 | IPVS_CMD_SET_CONFIG, /* set config settings */ | ||
280 | IPVS_CMD_GET_CONFIG, /* get config settings */ | ||
281 | |||
282 | IPVS_CMD_SET_INFO, /* only used in GET_INFO reply */ | ||
283 | IPVS_CMD_GET_INFO, /* get general IPVS info */ | ||
284 | |||
285 | IPVS_CMD_ZERO, /* zero all counters and stats */ | ||
286 | IPVS_CMD_FLUSH, /* flush services and dests */ | ||
287 | |||
288 | __IPVS_CMD_MAX, | ||
289 | }; | ||
290 | |||
291 | #define IPVS_CMD_MAX (__IPVS_CMD_MAX - 1) | ||
292 | |||
293 | /* Attributes used in the first level of commands */ | ||
294 | enum { | ||
295 | IPVS_CMD_ATTR_UNSPEC = 0, | ||
296 | IPVS_CMD_ATTR_SERVICE, /* nested service attribute */ | ||
297 | IPVS_CMD_ATTR_DEST, /* nested destination attribute */ | ||
298 | IPVS_CMD_ATTR_DAEMON, /* nested sync daemon attribute */ | ||
299 | IPVS_CMD_ATTR_TIMEOUT_TCP, /* TCP connection timeout */ | ||
300 | IPVS_CMD_ATTR_TIMEOUT_TCP_FIN, /* TCP FIN wait timeout */ | ||
301 | IPVS_CMD_ATTR_TIMEOUT_UDP, /* UDP timeout */ | ||
302 | __IPVS_CMD_ATTR_MAX, | ||
303 | }; | ||
304 | |||
305 | #define IPVS_CMD_ATTR_MAX (__IPVS_SVC_ATTR_MAX - 1) | ||
306 | |||
307 | /* | ||
308 | * Attributes used to describe a service | ||
309 | * | ||
310 | * Used inside nested attribute IPVS_CMD_ATTR_SERVICE | ||
311 | */ | ||
312 | enum { | ||
313 | IPVS_SVC_ATTR_UNSPEC = 0, | ||
314 | IPVS_SVC_ATTR_AF, /* address family */ | ||
315 | IPVS_SVC_ATTR_PROTOCOL, /* virtual service protocol */ | ||
316 | IPVS_SVC_ATTR_ADDR, /* virtual service address */ | ||
317 | IPVS_SVC_ATTR_PORT, /* virtual service port */ | ||
318 | IPVS_SVC_ATTR_FWMARK, /* firewall mark of service */ | ||
319 | |||
320 | IPVS_SVC_ATTR_SCHED_NAME, /* name of scheduler */ | ||
321 | IPVS_SVC_ATTR_FLAGS, /* virtual service flags */ | ||
322 | IPVS_SVC_ATTR_TIMEOUT, /* persistent timeout */ | ||
323 | IPVS_SVC_ATTR_NETMASK, /* persistent netmask */ | ||
324 | |||
325 | IPVS_SVC_ATTR_STATS, /* nested attribute for service stats */ | ||
326 | __IPVS_SVC_ATTR_MAX, | ||
327 | }; | ||
328 | |||
329 | #define IPVS_SVC_ATTR_MAX (__IPVS_SVC_ATTR_MAX - 1) | ||
330 | |||
331 | /* | ||
332 | * Attributes used to describe a destination (real server) | ||
333 | * | ||
334 | * Used inside nested attribute IPVS_CMD_ATTR_DEST | ||
335 | */ | ||
336 | enum { | ||
337 | IPVS_DEST_ATTR_UNSPEC = 0, | ||
338 | IPVS_DEST_ATTR_ADDR, /* real server address */ | ||
339 | IPVS_DEST_ATTR_PORT, /* real server port */ | ||
340 | |||
341 | IPVS_DEST_ATTR_FWD_METHOD, /* forwarding method */ | ||
342 | IPVS_DEST_ATTR_WEIGHT, /* destination weight */ | ||
343 | |||
344 | IPVS_DEST_ATTR_U_THRESH, /* upper threshold */ | ||
345 | IPVS_DEST_ATTR_L_THRESH, /* lower threshold */ | ||
346 | |||
347 | IPVS_DEST_ATTR_ACTIVE_CONNS, /* active connections */ | ||
348 | IPVS_DEST_ATTR_INACT_CONNS, /* inactive connections */ | ||
349 | IPVS_DEST_ATTR_PERSIST_CONNS, /* persistent connections */ | ||
350 | |||
351 | IPVS_DEST_ATTR_STATS, /* nested attribute for dest stats */ | ||
352 | __IPVS_DEST_ATTR_MAX, | ||
353 | }; | ||
354 | |||
355 | #define IPVS_DEST_ATTR_MAX (__IPVS_DEST_ATTR_MAX - 1) | ||
356 | |||
357 | /* | ||
358 | * Attributes describing a sync daemon | ||
359 | * | ||
360 | * Used inside nested attribute IPVS_CMD_ATTR_DAEMON | ||
361 | */ | ||
362 | enum { | ||
363 | IPVS_DAEMON_ATTR_UNSPEC = 0, | ||
364 | IPVS_DAEMON_ATTR_STATE, /* sync daemon state (master/backup) */ | ||
365 | IPVS_DAEMON_ATTR_MCAST_IFN, /* multicast interface name */ | ||
366 | IPVS_DAEMON_ATTR_SYNC_ID, /* SyncID we belong to */ | ||
367 | __IPVS_DAEMON_ATTR_MAX, | ||
368 | }; | ||
369 | |||
370 | #define IPVS_DAEMON_ATTR_MAX (__IPVS_DAEMON_ATTR_MAX - 1) | ||
371 | |||
372 | /* | ||
373 | * Attributes used to describe service or destination entry statistics | ||
374 | * | ||
375 | * Used inside nested attributes IPVS_SVC_ATTR_STATS and IPVS_DEST_ATTR_STATS | ||
376 | */ | ||
377 | enum { | ||
378 | IPVS_STATS_ATTR_UNSPEC = 0, | ||
379 | IPVS_STATS_ATTR_CONNS, /* connections scheduled */ | ||
380 | IPVS_STATS_ATTR_INPKTS, /* incoming packets */ | ||
381 | IPVS_STATS_ATTR_OUTPKTS, /* outgoing packets */ | ||
382 | IPVS_STATS_ATTR_INBYTES, /* incoming bytes */ | ||
383 | IPVS_STATS_ATTR_OUTBYTES, /* outgoing bytes */ | ||
384 | |||
385 | IPVS_STATS_ATTR_CPS, /* current connection rate */ | ||
386 | IPVS_STATS_ATTR_INPPS, /* current in packet rate */ | ||
387 | IPVS_STATS_ATTR_OUTPPS, /* current out packet rate */ | ||
388 | IPVS_STATS_ATTR_INBPS, /* current in byte rate */ | ||
389 | IPVS_STATS_ATTR_OUTBPS, /* current out byte rate */ | ||
390 | __IPVS_STATS_ATTR_MAX, | ||
391 | }; | ||
392 | |||
393 | #define IPVS_STATS_ATTR_MAX (__IPVS_STATS_ATTR_MAX - 1) | ||
394 | |||
395 | /* Attributes used in response to IPVS_CMD_GET_INFO command */ | ||
396 | enum { | ||
397 | IPVS_INFO_ATTR_UNSPEC = 0, | ||
398 | IPVS_INFO_ATTR_VERSION, /* IPVS version number */ | ||
399 | IPVS_INFO_ATTR_CONN_TAB_SIZE, /* size of connection hash table */ | ||
400 | __IPVS_INFO_ATTR_MAX, | ||
401 | }; | ||
402 | |||
403 | #define IPVS_INFO_ATTR_MAX (__IPVS_INFO_ATTR_MAX - 1) | ||
404 | |||
245 | #endif /* _IP_VS_H */ | 405 | #endif /* _IP_VS_H */ |
diff --git a/include/linux/isdn_ppp.h b/include/linux/isdn_ppp.h index 8687a7dc0632..4c218ee7587a 100644 --- a/include/linux/isdn_ppp.h +++ b/include/linux/isdn_ppp.h | |||
@@ -157,7 +157,7 @@ typedef struct { | |||
157 | 157 | ||
158 | typedef struct { | 158 | typedef struct { |
159 | int mp_mrru; /* unused */ | 159 | int mp_mrru; /* unused */ |
160 | struct sk_buff * frags; /* fragments sl list -- use skb->next */ | 160 | struct sk_buff_head frags; /* fragments sl list */ |
161 | long frames; /* number of frames in the frame list */ | 161 | long frames; /* number of frames in the frame list */ |
162 | unsigned int seq; /* last processed packet seq #: any packets | 162 | unsigned int seq; /* last processed packet seq #: any packets |
163 | * with smaller seq # will be dropped | 163 | * with smaller seq # will be dropped |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index 3dd209007098..66c3499478b5 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -850,7 +850,8 @@ struct journal_s | |||
850 | */ | 850 | */ |
851 | struct block_device *j_dev; | 851 | struct block_device *j_dev; |
852 | int j_blocksize; | 852 | int j_blocksize; |
853 | unsigned long long j_blk_offset; | 853 | unsigned long long j_blk_offset; |
854 | char j_devname[BDEVNAME_SIZE+24]; | ||
854 | 855 | ||
855 | /* | 856 | /* |
856 | * Device which holds the client fs. For internal journal this will be | 857 | * Device which holds the client fs. For internal journal this will be |
diff --git a/include/linux/klist.h b/include/linux/klist.h index 06c338ef7f1b..8ea98db223e5 100644 --- a/include/linux/klist.h +++ b/include/linux/klist.h | |||
@@ -38,7 +38,7 @@ extern void klist_init(struct klist *k, void (*get)(struct klist_node *), | |||
38 | void (*put)(struct klist_node *)); | 38 | void (*put)(struct klist_node *)); |
39 | 39 | ||
40 | struct klist_node { | 40 | struct klist_node { |
41 | struct klist *n_klist; | 41 | void *n_klist; /* never access directly */ |
42 | struct list_head n_node; | 42 | struct list_head n_node; |
43 | struct kref n_ref; | 43 | struct kref n_ref; |
44 | struct completion n_removed; | 44 | struct completion n_removed; |
@@ -57,7 +57,6 @@ extern int klist_node_attached(struct klist_node *n); | |||
57 | 57 | ||
58 | struct klist_iter { | 58 | struct klist_iter { |
59 | struct klist *i_klist; | 59 | struct klist *i_klist; |
60 | struct list_head *i_head; | ||
61 | struct klist_node *i_cur; | 60 | struct klist_node *i_cur; |
62 | }; | 61 | }; |
63 | 62 | ||
diff --git a/include/linux/lcd.h b/include/linux/lcd.h index 173febac6656..c67fecafff90 100644 --- a/include/linux/lcd.h +++ b/include/linux/lcd.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/device.h> | 11 | #include <linux/device.h> |
12 | #include <linux/mutex.h> | 12 | #include <linux/mutex.h> |
13 | #include <linux/notifier.h> | 13 | #include <linux/notifier.h> |
14 | #include <linux/fb.h> | ||
14 | 15 | ||
15 | /* Notes on locking: | 16 | /* Notes on locking: |
16 | * | 17 | * |
@@ -45,6 +46,8 @@ struct lcd_ops { | |||
45 | int (*get_contrast)(struct lcd_device *); | 46 | int (*get_contrast)(struct lcd_device *); |
46 | /* Set LCD panel contrast */ | 47 | /* Set LCD panel contrast */ |
47 | int (*set_contrast)(struct lcd_device *, int contrast); | 48 | int (*set_contrast)(struct lcd_device *, int contrast); |
49 | /* Set LCD panel mode (resolutions ...) */ | ||
50 | int (*set_mode)(struct lcd_device *, struct fb_videomode *); | ||
48 | /* Check if given framebuffer device is the one LCD is bound to; | 51 | /* Check if given framebuffer device is the one LCD is bound to; |
49 | return 0 if not, !=0 if it is. If NULL, lcd always matches the fb. */ | 52 | return 0 if not, !=0 if it is. If NULL, lcd always matches the fb. */ |
50 | int (*check_fb)(struct lcd_device *, struct fb_info *); | 53 | int (*check_fb)(struct lcd_device *, struct fb_info *); |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 225bfc5bd9ec..947cf84e555d 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -146,6 +146,7 @@ enum { | |||
146 | ATA_DFLAG_SPUNDOWN = (1 << 14), /* XXX: for spindown_compat */ | 146 | ATA_DFLAG_SPUNDOWN = (1 << 14), /* XXX: for spindown_compat */ |
147 | ATA_DFLAG_SLEEPING = (1 << 15), /* device is sleeping */ | 147 | ATA_DFLAG_SLEEPING = (1 << 15), /* device is sleeping */ |
148 | ATA_DFLAG_DUBIOUS_XFER = (1 << 16), /* data transfer not verified */ | 148 | ATA_DFLAG_DUBIOUS_XFER = (1 << 16), /* data transfer not verified */ |
149 | ATA_DFLAG_NO_UNLOAD = (1 << 17), /* device doesn't support unload */ | ||
149 | ATA_DFLAG_INIT_MASK = (1 << 24) - 1, | 150 | ATA_DFLAG_INIT_MASK = (1 << 24) - 1, |
150 | 151 | ||
151 | ATA_DFLAG_DETACH = (1 << 24), | 152 | ATA_DFLAG_DETACH = (1 << 24), |
@@ -244,6 +245,7 @@ enum { | |||
244 | ATA_TMOUT_BOOT = 30000, /* heuristic */ | 245 | ATA_TMOUT_BOOT = 30000, /* heuristic */ |
245 | ATA_TMOUT_BOOT_QUICK = 7000, /* heuristic */ | 246 | ATA_TMOUT_BOOT_QUICK = 7000, /* heuristic */ |
246 | ATA_TMOUT_INTERNAL_QUICK = 5000, | 247 | ATA_TMOUT_INTERNAL_QUICK = 5000, |
248 | ATA_TMOUT_MAX_PARK = 30000, | ||
247 | 249 | ||
248 | /* FIXME: GoVault needs 2s but we can't afford that without | 250 | /* FIXME: GoVault needs 2s but we can't afford that without |
249 | * parallel probing. 800ms is enough for iVDR disk | 251 | * parallel probing. 800ms is enough for iVDR disk |
@@ -319,8 +321,11 @@ enum { | |||
319 | ATA_EH_RESET = ATA_EH_SOFTRESET | ATA_EH_HARDRESET, | 321 | ATA_EH_RESET = ATA_EH_SOFTRESET | ATA_EH_HARDRESET, |
320 | ATA_EH_ENABLE_LINK = (1 << 3), | 322 | ATA_EH_ENABLE_LINK = (1 << 3), |
321 | ATA_EH_LPM = (1 << 4), /* link power management action */ | 323 | ATA_EH_LPM = (1 << 4), /* link power management action */ |
324 | ATA_EH_PARK = (1 << 5), /* unload heads and stop I/O */ | ||
322 | 325 | ||
323 | ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE, | 326 | ATA_EH_PERDEV_MASK = ATA_EH_REVALIDATE | ATA_EH_PARK, |
327 | ATA_EH_ALL_ACTIONS = ATA_EH_REVALIDATE | ATA_EH_RESET | | ||
328 | ATA_EH_ENABLE_LINK | ATA_EH_LPM, | ||
324 | 329 | ||
325 | /* ata_eh_info->flags */ | 330 | /* ata_eh_info->flags */ |
326 | ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */ | 331 | ATA_EHI_HOTPLUGGED = (1 << 0), /* could have been hotplugged */ |
@@ -452,6 +457,7 @@ enum link_pm { | |||
452 | MEDIUM_POWER, | 457 | MEDIUM_POWER, |
453 | }; | 458 | }; |
454 | extern struct device_attribute dev_attr_link_power_management_policy; | 459 | extern struct device_attribute dev_attr_link_power_management_policy; |
460 | extern struct device_attribute dev_attr_unload_heads; | ||
455 | extern struct device_attribute dev_attr_em_message_type; | 461 | extern struct device_attribute dev_attr_em_message_type; |
456 | extern struct device_attribute dev_attr_em_message; | 462 | extern struct device_attribute dev_attr_em_message; |
457 | extern struct device_attribute dev_attr_sw_activity; | 463 | extern struct device_attribute dev_attr_sw_activity; |
@@ -554,8 +560,8 @@ struct ata_ering { | |||
554 | struct ata_device { | 560 | struct ata_device { |
555 | struct ata_link *link; | 561 | struct ata_link *link; |
556 | unsigned int devno; /* 0 or 1 */ | 562 | unsigned int devno; /* 0 or 1 */ |
557 | unsigned long flags; /* ATA_DFLAG_xxx */ | ||
558 | unsigned int horkage; /* List of broken features */ | 563 | unsigned int horkage; /* List of broken features */ |
564 | unsigned long flags; /* ATA_DFLAG_xxx */ | ||
559 | struct scsi_device *sdev; /* attached SCSI device */ | 565 | struct scsi_device *sdev; /* attached SCSI device */ |
560 | #ifdef CONFIG_ATA_ACPI | 566 | #ifdef CONFIG_ATA_ACPI |
561 | acpi_handle acpi_handle; | 567 | acpi_handle acpi_handle; |
@@ -564,6 +570,7 @@ struct ata_device { | |||
564 | /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ | 570 | /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ |
565 | u64 n_sectors; /* size of device, if ATA */ | 571 | u64 n_sectors; /* size of device, if ATA */ |
566 | unsigned int class; /* ATA_DEV_xxx */ | 572 | unsigned int class; /* ATA_DEV_xxx */ |
573 | unsigned long unpark_deadline; | ||
567 | 574 | ||
568 | u8 pio_mode; | 575 | u8 pio_mode; |
569 | u8 dma_mode; | 576 | u8 dma_mode; |
@@ -621,6 +628,7 @@ struct ata_eh_context { | |||
621 | [ATA_EH_CMD_TIMEOUT_TABLE_SIZE]; | 628 | [ATA_EH_CMD_TIMEOUT_TABLE_SIZE]; |
622 | unsigned int classes[ATA_MAX_DEVICES]; | 629 | unsigned int classes[ATA_MAX_DEVICES]; |
623 | unsigned int did_probe_mask; | 630 | unsigned int did_probe_mask; |
631 | unsigned int unloaded_mask; | ||
624 | unsigned int saved_ncq_enabled; | 632 | unsigned int saved_ncq_enabled; |
625 | u8 saved_xfer_mode[ATA_MAX_DEVICES]; | 633 | u8 saved_xfer_mode[ATA_MAX_DEVICES]; |
626 | /* timestamp for the last reset attempt or success */ | 634 | /* timestamp for the last reset attempt or success */ |
@@ -688,7 +696,8 @@ struct ata_port { | |||
688 | unsigned int qc_active; | 696 | unsigned int qc_active; |
689 | int nr_active_links; /* #links with active qcs */ | 697 | int nr_active_links; /* #links with active qcs */ |
690 | 698 | ||
691 | struct ata_link link; /* host default link */ | 699 | struct ata_link link; /* host default link */ |
700 | struct ata_link *slave_link; /* see ata_slave_link_init() */ | ||
692 | 701 | ||
693 | int nr_pmp_links; /* nr of available PMP links */ | 702 | int nr_pmp_links; /* nr of available PMP links */ |
694 | struct ata_link *pmp_link; /* array of PMP links */ | 703 | struct ata_link *pmp_link; /* array of PMP links */ |
@@ -709,6 +718,7 @@ struct ata_port { | |||
709 | struct list_head eh_done_q; | 718 | struct list_head eh_done_q; |
710 | wait_queue_head_t eh_wait_q; | 719 | wait_queue_head_t eh_wait_q; |
711 | int eh_tries; | 720 | int eh_tries; |
721 | struct completion park_req_pending; | ||
712 | 722 | ||
713 | pm_message_t pm_mesg; | 723 | pm_message_t pm_mesg; |
714 | int *pm_result; | 724 | int *pm_result; |
@@ -772,8 +782,8 @@ struct ata_port_operations { | |||
772 | /* | 782 | /* |
773 | * Optional features | 783 | * Optional features |
774 | */ | 784 | */ |
775 | int (*scr_read)(struct ata_port *ap, unsigned int sc_reg, u32 *val); | 785 | int (*scr_read)(struct ata_link *link, unsigned int sc_reg, u32 *val); |
776 | int (*scr_write)(struct ata_port *ap, unsigned int sc_reg, u32 val); | 786 | int (*scr_write)(struct ata_link *link, unsigned int sc_reg, u32 val); |
777 | void (*pmp_attach)(struct ata_port *ap); | 787 | void (*pmp_attach)(struct ata_port *ap); |
778 | void (*pmp_detach)(struct ata_port *ap); | 788 | void (*pmp_detach)(struct ata_port *ap); |
779 | int (*enable_pm)(struct ata_port *ap, enum link_pm policy); | 789 | int (*enable_pm)(struct ata_port *ap, enum link_pm policy); |
@@ -895,6 +905,7 @@ extern void ata_port_disable(struct ata_port *); | |||
895 | extern struct ata_host *ata_host_alloc(struct device *dev, int max_ports); | 905 | extern struct ata_host *ata_host_alloc(struct device *dev, int max_ports); |
896 | extern struct ata_host *ata_host_alloc_pinfo(struct device *dev, | 906 | extern struct ata_host *ata_host_alloc_pinfo(struct device *dev, |
897 | const struct ata_port_info * const * ppi, int n_ports); | 907 | const struct ata_port_info * const * ppi, int n_ports); |
908 | extern int ata_slave_link_init(struct ata_port *ap); | ||
898 | extern int ata_host_start(struct ata_host *host); | 909 | extern int ata_host_start(struct ata_host *host); |
899 | extern int ata_host_register(struct ata_host *host, | 910 | extern int ata_host_register(struct ata_host *host, |
900 | struct scsi_host_template *sht); | 911 | struct scsi_host_template *sht); |
@@ -920,8 +931,8 @@ extern int sata_scr_valid(struct ata_link *link); | |||
920 | extern int sata_scr_read(struct ata_link *link, int reg, u32 *val); | 931 | extern int sata_scr_read(struct ata_link *link, int reg, u32 *val); |
921 | extern int sata_scr_write(struct ata_link *link, int reg, u32 val); | 932 | extern int sata_scr_write(struct ata_link *link, int reg, u32 val); |
922 | extern int sata_scr_write_flush(struct ata_link *link, int reg, u32 val); | 933 | extern int sata_scr_write_flush(struct ata_link *link, int reg, u32 val); |
923 | extern int ata_link_online(struct ata_link *link); | 934 | extern bool ata_link_online(struct ata_link *link); |
924 | extern int ata_link_offline(struct ata_link *link); | 935 | extern bool ata_link_offline(struct ata_link *link); |
925 | #ifdef CONFIG_PM | 936 | #ifdef CONFIG_PM |
926 | extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg); | 937 | extern int ata_host_suspend(struct ata_host *host, pm_message_t mesg); |
927 | extern void ata_host_resume(struct ata_host *host); | 938 | extern void ata_host_resume(struct ata_host *host); |
@@ -1098,6 +1109,7 @@ extern void ata_std_error_handler(struct ata_port *ap); | |||
1098 | */ | 1109 | */ |
1099 | extern const struct ata_port_operations ata_base_port_ops; | 1110 | extern const struct ata_port_operations ata_base_port_ops; |
1100 | extern const struct ata_port_operations sata_port_ops; | 1111 | extern const struct ata_port_operations sata_port_ops; |
1112 | extern struct device_attribute *ata_common_sdev_attrs[]; | ||
1101 | 1113 | ||
1102 | #define ATA_BASE_SHT(drv_name) \ | 1114 | #define ATA_BASE_SHT(drv_name) \ |
1103 | .module = THIS_MODULE, \ | 1115 | .module = THIS_MODULE, \ |
@@ -1112,7 +1124,8 @@ extern const struct ata_port_operations sata_port_ops; | |||
1112 | .proc_name = drv_name, \ | 1124 | .proc_name = drv_name, \ |
1113 | .slave_configure = ata_scsi_slave_config, \ | 1125 | .slave_configure = ata_scsi_slave_config, \ |
1114 | .slave_destroy = ata_scsi_slave_destroy, \ | 1126 | .slave_destroy = ata_scsi_slave_destroy, \ |
1115 | .bios_param = ata_std_bios_param | 1127 | .bios_param = ata_std_bios_param, \ |
1128 | .sdev_attrs = ata_common_sdev_attrs | ||
1116 | 1129 | ||
1117 | #define ATA_NCQ_SHT(drv_name) \ | 1130 | #define ATA_NCQ_SHT(drv_name) \ |
1118 | ATA_BASE_SHT(drv_name), \ | 1131 | ATA_BASE_SHT(drv_name), \ |
@@ -1134,7 +1147,7 @@ static inline bool sata_pmp_attached(struct ata_port *ap) | |||
1134 | 1147 | ||
1135 | static inline int ata_is_host_link(const struct ata_link *link) | 1148 | static inline int ata_is_host_link(const struct ata_link *link) |
1136 | { | 1149 | { |
1137 | return link == &link->ap->link; | 1150 | return link == &link->ap->link || link == link->ap->slave_link; |
1138 | } | 1151 | } |
1139 | #else /* CONFIG_SATA_PMP */ | 1152 | #else /* CONFIG_SATA_PMP */ |
1140 | static inline bool sata_pmp_supported(struct ata_port *ap) | 1153 | static inline bool sata_pmp_supported(struct ata_port *ap) |
@@ -1167,7 +1180,7 @@ static inline int sata_srst_pmp(struct ata_link *link) | |||
1167 | printk("%sata%u: "fmt, lv, (ap)->print_id , ##args) | 1180 | printk("%sata%u: "fmt, lv, (ap)->print_id , ##args) |
1168 | 1181 | ||
1169 | #define ata_link_printk(link, lv, fmt, args...) do { \ | 1182 | #define ata_link_printk(link, lv, fmt, args...) do { \ |
1170 | if (sata_pmp_attached((link)->ap)) \ | 1183 | if (sata_pmp_attached((link)->ap) || (link)->ap->slave_link) \ |
1171 | printk("%sata%u.%02u: "fmt, lv, (link)->ap->print_id, \ | 1184 | printk("%sata%u.%02u: "fmt, lv, (link)->ap->print_id, \ |
1172 | (link)->pmp , ##args); \ | 1185 | (link)->pmp , ##args); \ |
1173 | else \ | 1186 | else \ |
@@ -1265,34 +1278,17 @@ static inline int ata_link_active(struct ata_link *link) | |||
1265 | return ata_tag_valid(link->active_tag) || link->sactive; | 1278 | return ata_tag_valid(link->active_tag) || link->sactive; |
1266 | } | 1279 | } |
1267 | 1280 | ||
1268 | static inline struct ata_link *ata_port_first_link(struct ata_port *ap) | 1281 | extern struct ata_link *__ata_port_next_link(struct ata_port *ap, |
1269 | { | 1282 | struct ata_link *link, |
1270 | if (sata_pmp_attached(ap)) | 1283 | bool dev_only); |
1271 | return ap->pmp_link; | ||
1272 | return &ap->link; | ||
1273 | } | ||
1274 | |||
1275 | static inline struct ata_link *ata_port_next_link(struct ata_link *link) | ||
1276 | { | ||
1277 | struct ata_port *ap = link->ap; | ||
1278 | |||
1279 | if (ata_is_host_link(link)) { | ||
1280 | if (!sata_pmp_attached(ap)) | ||
1281 | return NULL; | ||
1282 | return ap->pmp_link; | ||
1283 | } | ||
1284 | |||
1285 | if (++link < ap->nr_pmp_links + ap->pmp_link) | ||
1286 | return link; | ||
1287 | return NULL; | ||
1288 | } | ||
1289 | 1284 | ||
1290 | #define __ata_port_for_each_link(lk, ap) \ | 1285 | #define __ata_port_for_each_link(link, ap) \ |
1291 | for ((lk) = &(ap)->link; (lk); (lk) = ata_port_next_link(lk)) | 1286 | for ((link) = __ata_port_next_link((ap), NULL, false); (link); \ |
1287 | (link) = __ata_port_next_link((ap), (link), false)) | ||
1292 | 1288 | ||
1293 | #define ata_port_for_each_link(link, ap) \ | 1289 | #define ata_port_for_each_link(link, ap) \ |
1294 | for ((link) = ata_port_first_link(ap); (link); \ | 1290 | for ((link) = __ata_port_next_link((ap), NULL, true); (link); \ |
1295 | (link) = ata_port_next_link(link)) | 1291 | (link) = __ata_port_next_link((ap), (link), true)) |
1296 | 1292 | ||
1297 | #define ata_link_for_each_dev(dev, link) \ | 1293 | #define ata_link_for_each_dev(dev, link) \ |
1298 | for ((dev) = (link)->device; \ | 1294 | for ((dev) = (link)->device; \ |
diff --git a/include/linux/major.h b/include/linux/major.h index 53d5fafd85c3..88249452b935 100644 --- a/include/linux/major.h +++ b/include/linux/major.h | |||
@@ -170,4 +170,6 @@ | |||
170 | 170 | ||
171 | #define VIOTAPE_MAJOR 230 | 171 | #define VIOTAPE_MAJOR 230 |
172 | 172 | ||
173 | #define BLOCK_EXT_MAJOR 259 | ||
174 | |||
173 | #endif | 175 | #endif |
diff --git a/include/linux/mtd/blktrans.h b/include/linux/mtd/blktrans.h index 310e61606415..8b4aa0523db7 100644 --- a/include/linux/mtd/blktrans.h +++ b/include/linux/mtd/blktrans.h | |||
@@ -41,6 +41,8 @@ struct mtd_blktrans_ops { | |||
41 | unsigned long block, char *buffer); | 41 | unsigned long block, char *buffer); |
42 | int (*writesect)(struct mtd_blktrans_dev *dev, | 42 | int (*writesect)(struct mtd_blktrans_dev *dev, |
43 | unsigned long block, char *buffer); | 43 | unsigned long block, char *buffer); |
44 | int (*discard)(struct mtd_blktrans_dev *dev, | ||
45 | unsigned long block, unsigned nr_blocks); | ||
44 | 46 | ||
45 | /* Block layer ioctls */ | 47 | /* Block layer ioctls */ |
46 | int (*getgeo)(struct mtd_blktrans_dev *dev, struct hd_geometry *geo); | 48 | int (*getgeo)(struct mtd_blktrans_dev *dev, struct hd_geometry *geo); |
diff --git a/include/linux/mv643xx_eth.h b/include/linux/mv643xx_eth.h index 12078577aef6..cbbbe9bfecad 100644 --- a/include/linux/mv643xx_eth.h +++ b/include/linux/mv643xx_eth.h | |||
@@ -17,9 +17,14 @@ | |||
17 | 17 | ||
18 | struct mv643xx_eth_shared_platform_data { | 18 | struct mv643xx_eth_shared_platform_data { |
19 | struct mbus_dram_target_info *dram; | 19 | struct mbus_dram_target_info *dram; |
20 | struct platform_device *shared_smi; | ||
20 | unsigned int t_clk; | 21 | unsigned int t_clk; |
21 | }; | 22 | }; |
22 | 23 | ||
24 | #define MV643XX_ETH_PHY_ADDR_DEFAULT 0 | ||
25 | #define MV643XX_ETH_PHY_ADDR(x) (0x80 | (x)) | ||
26 | #define MV643XX_ETH_PHY_NONE 0xff | ||
27 | |||
23 | struct mv643xx_eth_platform_data { | 28 | struct mv643xx_eth_platform_data { |
24 | /* | 29 | /* |
25 | * Pointer back to our parent instance, and our port number. | 30 | * Pointer back to our parent instance, and our port number. |
@@ -30,8 +35,6 @@ struct mv643xx_eth_platform_data { | |||
30 | /* | 35 | /* |
31 | * Whether a PHY is present, and if yes, at which address. | 36 | * Whether a PHY is present, and if yes, at which address. |
32 | */ | 37 | */ |
33 | struct platform_device *shared_smi; | ||
34 | int force_phy_addr; | ||
35 | int phy_addr; | 38 | int phy_addr; |
36 | 39 | ||
37 | /* | 40 | /* |
@@ -49,10 +52,10 @@ struct mv643xx_eth_platform_data { | |||
49 | int duplex; | 52 | int duplex; |
50 | 53 | ||
51 | /* | 54 | /* |
52 | * Which RX/TX queues to use. | 55 | * How many RX/TX queues to use. |
53 | */ | 56 | */ |
54 | int rx_queue_mask; | 57 | int rx_queue_count; |
55 | int tx_queue_mask; | 58 | int tx_queue_count; |
56 | 59 | ||
57 | /* | 60 | /* |
58 | * Override default RX/TX queue sizes if nonzero. | 61 | * Override default RX/TX queue sizes if nonzero. |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 488c56e649b5..d3ea3de70a8a 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -42,6 +42,7 @@ | |||
42 | #include <linux/workqueue.h> | 42 | #include <linux/workqueue.h> |
43 | 43 | ||
44 | #include <net/net_namespace.h> | 44 | #include <net/net_namespace.h> |
45 | #include <net/dsa.h> | ||
45 | 46 | ||
46 | struct vlan_group; | 47 | struct vlan_group; |
47 | struct ethtool_ops; | 48 | struct ethtool_ops; |
@@ -471,6 +472,8 @@ struct net_device | |||
471 | char name[IFNAMSIZ]; | 472 | char name[IFNAMSIZ]; |
472 | /* device name hash chain */ | 473 | /* device name hash chain */ |
473 | struct hlist_node name_hlist; | 474 | struct hlist_node name_hlist; |
475 | /* snmp alias */ | ||
476 | char *ifalias; | ||
474 | 477 | ||
475 | /* | 478 | /* |
476 | * I/O specific fields | 479 | * I/O specific fields |
@@ -605,6 +608,9 @@ struct net_device | |||
605 | 608 | ||
606 | /* Protocol specific pointers */ | 609 | /* Protocol specific pointers */ |
607 | 610 | ||
611 | #ifdef CONFIG_NET_DSA | ||
612 | void *dsa_ptr; /* dsa specific data */ | ||
613 | #endif | ||
608 | void *atalk_ptr; /* AppleTalk link */ | 614 | void *atalk_ptr; /* AppleTalk link */ |
609 | void *ip_ptr; /* IPv4 specific data */ | 615 | void *ip_ptr; /* IPv4 specific data */ |
610 | void *dn_ptr; /* DECnet specific data */ | 616 | void *dn_ptr; /* DECnet specific data */ |
@@ -796,6 +802,26 @@ void dev_net_set(struct net_device *dev, struct net *net) | |||
796 | #endif | 802 | #endif |
797 | } | 803 | } |
798 | 804 | ||
805 | static inline bool netdev_uses_dsa_tags(struct net_device *dev) | ||
806 | { | ||
807 | #ifdef CONFIG_NET_DSA_TAG_DSA | ||
808 | if (dev->dsa_ptr != NULL) | ||
809 | return dsa_uses_dsa_tags(dev->dsa_ptr); | ||
810 | #endif | ||
811 | |||
812 | return 0; | ||
813 | } | ||
814 | |||
815 | static inline bool netdev_uses_trailer_tags(struct net_device *dev) | ||
816 | { | ||
817 | #ifdef CONFIG_NET_DSA_TAG_TRAILER | ||
818 | if (dev->dsa_ptr != NULL) | ||
819 | return dsa_uses_trailer_tags(dev->dsa_ptr); | ||
820 | #endif | ||
821 | |||
822 | return 0; | ||
823 | } | ||
824 | |||
799 | /** | 825 | /** |
800 | * netdev_priv - access network device private data | 826 | * netdev_priv - access network device private data |
801 | * @dev: network device | 827 | * @dev: network device |
@@ -1223,7 +1249,8 @@ extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); | |||
1223 | extern int dev_ethtool(struct net *net, struct ifreq *); | 1249 | extern int dev_ethtool(struct net *net, struct ifreq *); |
1224 | extern unsigned dev_get_flags(const struct net_device *); | 1250 | extern unsigned dev_get_flags(const struct net_device *); |
1225 | extern int dev_change_flags(struct net_device *, unsigned); | 1251 | extern int dev_change_flags(struct net_device *, unsigned); |
1226 | extern int dev_change_name(struct net_device *, char *); | 1252 | extern int dev_change_name(struct net_device *, const char *); |
1253 | extern int dev_set_alias(struct net_device *, const char *, size_t); | ||
1227 | extern int dev_change_net_namespace(struct net_device *, | 1254 | extern int dev_change_net_namespace(struct net_device *, |
1228 | struct net *, const char *); | 1255 | struct net *, const char *); |
1229 | extern int dev_set_mtu(struct net_device *, int); | 1256 | extern int dev_set_mtu(struct net_device *, int); |
@@ -1667,7 +1694,7 @@ extern void dev_seq_stop(struct seq_file *seq, void *v); | |||
1667 | extern int netdev_class_create_file(struct class_attribute *class_attr); | 1694 | extern int netdev_class_create_file(struct class_attribute *class_attr); |
1668 | extern void netdev_class_remove_file(struct class_attribute *class_attr); | 1695 | extern void netdev_class_remove_file(struct class_attribute *class_attr); |
1669 | 1696 | ||
1670 | extern char *netdev_drivername(struct net_device *dev, char *buffer, int len); | 1697 | extern char *netdev_drivername(const struct net_device *dev, char *buffer, int len); |
1671 | 1698 | ||
1672 | extern void linkwatch_run_queue(void); | 1699 | extern void linkwatch_run_queue(void); |
1673 | 1700 | ||
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 0c5eb7ed8b3f..48cfe51bfddc 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -5,13 +5,11 @@ | |||
5 | #include <linux/init.h> | 5 | #include <linux/init.h> |
6 | #include <linux/skbuff.h> | 6 | #include <linux/skbuff.h> |
7 | #include <linux/net.h> | 7 | #include <linux/net.h> |
8 | #include <linux/netdevice.h> | ||
9 | #include <linux/if.h> | 8 | #include <linux/if.h> |
10 | #include <linux/in.h> | 9 | #include <linux/in.h> |
11 | #include <linux/in6.h> | 10 | #include <linux/in6.h> |
12 | #include <linux/wait.h> | 11 | #include <linux/wait.h> |
13 | #include <linux/list.h> | 12 | #include <linux/list.h> |
14 | #include <net/net_namespace.h> | ||
15 | #endif | 13 | #endif |
16 | #include <linux/types.h> | 14 | #include <linux/types.h> |
17 | #include <linux/compiler.h> | 15 | #include <linux/compiler.h> |
@@ -52,6 +50,16 @@ enum nf_inet_hooks { | |||
52 | NF_INET_NUMHOOKS | 50 | NF_INET_NUMHOOKS |
53 | }; | 51 | }; |
54 | 52 | ||
53 | enum { | ||
54 | NFPROTO_UNSPEC = 0, | ||
55 | NFPROTO_IPV4 = 2, | ||
56 | NFPROTO_ARP = 3, | ||
57 | NFPROTO_BRIDGE = 7, | ||
58 | NFPROTO_IPV6 = 10, | ||
59 | NFPROTO_DECNET = 12, | ||
60 | NFPROTO_NUMPROTO, | ||
61 | }; | ||
62 | |||
55 | union nf_inet_addr { | 63 | union nf_inet_addr { |
56 | __u32 all[4]; | 64 | __u32 all[4]; |
57 | __be32 ip; | 65 | __be32 ip; |
@@ -92,8 +100,8 @@ struct nf_hook_ops | |||
92 | /* User fills in from here down. */ | 100 | /* User fills in from here down. */ |
93 | nf_hookfn *hook; | 101 | nf_hookfn *hook; |
94 | struct module *owner; | 102 | struct module *owner; |
95 | int pf; | 103 | u_int8_t pf; |
96 | int hooknum; | 104 | unsigned int hooknum; |
97 | /* Hooks are ordered in ascending priority. */ | 105 | /* Hooks are ordered in ascending priority. */ |
98 | int priority; | 106 | int priority; |
99 | }; | 107 | }; |
@@ -102,7 +110,7 @@ struct nf_sockopt_ops | |||
102 | { | 110 | { |
103 | struct list_head list; | 111 | struct list_head list; |
104 | 112 | ||
105 | int pf; | 113 | u_int8_t pf; |
106 | 114 | ||
107 | /* Non-inclusive ranges: use 0/0/NULL to never get called. */ | 115 | /* Non-inclusive ranges: use 0/0/NULL to never get called. */ |
108 | int set_optmin; | 116 | int set_optmin; |
@@ -138,9 +146,9 @@ extern struct ctl_path nf_net_netfilter_sysctl_path[]; | |||
138 | extern struct ctl_path nf_net_ipv4_netfilter_sysctl_path[]; | 146 | extern struct ctl_path nf_net_ipv4_netfilter_sysctl_path[]; |
139 | #endif /* CONFIG_SYSCTL */ | 147 | #endif /* CONFIG_SYSCTL */ |
140 | 148 | ||
141 | extern struct list_head nf_hooks[NPROTO][NF_MAX_HOOKS]; | 149 | extern struct list_head nf_hooks[NFPROTO_NUMPROTO][NF_MAX_HOOKS]; |
142 | 150 | ||
143 | int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb, | 151 | int nf_hook_slow(u_int8_t pf, unsigned int hook, struct sk_buff *skb, |
144 | struct net_device *indev, struct net_device *outdev, | 152 | struct net_device *indev, struct net_device *outdev, |
145 | int (*okfn)(struct sk_buff *), int thresh); | 153 | int (*okfn)(struct sk_buff *), int thresh); |
146 | 154 | ||
@@ -151,7 +159,7 @@ int nf_hook_slow(int pf, unsigned int hook, struct sk_buff *skb, | |||
151 | * okfn must be invoked by the caller in this case. Any other return | 159 | * okfn must be invoked by the caller in this case. Any other return |
152 | * value indicates the packet has been consumed by the hook. | 160 | * value indicates the packet has been consumed by the hook. |
153 | */ | 161 | */ |
154 | static inline int nf_hook_thresh(int pf, unsigned int hook, | 162 | static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook, |
155 | struct sk_buff *skb, | 163 | struct sk_buff *skb, |
156 | struct net_device *indev, | 164 | struct net_device *indev, |
157 | struct net_device *outdev, | 165 | struct net_device *outdev, |
@@ -167,7 +175,7 @@ static inline int nf_hook_thresh(int pf, unsigned int hook, | |||
167 | return nf_hook_slow(pf, hook, skb, indev, outdev, okfn, thresh); | 175 | return nf_hook_slow(pf, hook, skb, indev, outdev, okfn, thresh); |
168 | } | 176 | } |
169 | 177 | ||
170 | static inline int nf_hook(int pf, unsigned int hook, struct sk_buff *skb, | 178 | static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb, |
171 | struct net_device *indev, struct net_device *outdev, | 179 | struct net_device *indev, struct net_device *outdev, |
172 | int (*okfn)(struct sk_buff *)) | 180 | int (*okfn)(struct sk_buff *)) |
173 | { | 181 | { |
@@ -212,14 +220,14 @@ __ret;}) | |||
212 | NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, INT_MIN) | 220 | NF_HOOK_THRESH(pf, hook, skb, indev, outdev, okfn, INT_MIN) |
213 | 221 | ||
214 | /* Call setsockopt() */ | 222 | /* Call setsockopt() */ |
215 | int nf_setsockopt(struct sock *sk, int pf, int optval, char __user *opt, | 223 | int nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt, |
216 | int len); | 224 | int len); |
217 | int nf_getsockopt(struct sock *sk, int pf, int optval, char __user *opt, | 225 | int nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, char __user *opt, |
218 | int *len); | 226 | int *len); |
219 | 227 | ||
220 | int compat_nf_setsockopt(struct sock *sk, int pf, int optval, | 228 | int compat_nf_setsockopt(struct sock *sk, u_int8_t pf, int optval, |
221 | char __user *opt, int len); | 229 | char __user *opt, int len); |
222 | int compat_nf_getsockopt(struct sock *sk, int pf, int optval, | 230 | int compat_nf_getsockopt(struct sock *sk, u_int8_t pf, int optval, |
223 | char __user *opt, int *len); | 231 | char __user *opt, int *len); |
224 | 232 | ||
225 | /* Call this before modifying an existing packet: ensures it is | 233 | /* Call this before modifying an existing packet: ensures it is |
@@ -247,7 +255,7 @@ struct nf_afinfo { | |||
247 | int route_key_size; | 255 | int route_key_size; |
248 | }; | 256 | }; |
249 | 257 | ||
250 | extern const struct nf_afinfo *nf_afinfo[NPROTO]; | 258 | extern const struct nf_afinfo *nf_afinfo[NFPROTO_NUMPROTO]; |
251 | static inline const struct nf_afinfo *nf_get_afinfo(unsigned short family) | 259 | static inline const struct nf_afinfo *nf_get_afinfo(unsigned short family) |
252 | { | 260 | { |
253 | return rcu_dereference(nf_afinfo[family]); | 261 | return rcu_dereference(nf_afinfo[family]); |
@@ -292,7 +300,7 @@ extern void nf_unregister_afinfo(const struct nf_afinfo *afinfo); | |||
292 | extern void (*ip_nat_decode_session)(struct sk_buff *, struct flowi *); | 300 | extern void (*ip_nat_decode_session)(struct sk_buff *, struct flowi *); |
293 | 301 | ||
294 | static inline void | 302 | static inline void |
295 | nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, int family) | 303 | nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family) |
296 | { | 304 | { |
297 | #ifdef CONFIG_NF_NAT_NEEDED | 305 | #ifdef CONFIG_NF_NAT_NEEDED |
298 | void (*decodefn)(struct sk_buff *, struct flowi *); | 306 | void (*decodefn)(struct sk_buff *, struct flowi *); |
@@ -315,7 +323,7 @@ extern struct proc_dir_entry *proc_net_netfilter; | |||
315 | #else /* !CONFIG_NETFILTER */ | 323 | #else /* !CONFIG_NETFILTER */ |
316 | #define NF_HOOK(pf, hook, skb, indev, outdev, okfn) (okfn)(skb) | 324 | #define NF_HOOK(pf, hook, skb, indev, outdev, okfn) (okfn)(skb) |
317 | #define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) (okfn)(skb) | 325 | #define NF_HOOK_COND(pf, hook, skb, indev, outdev, okfn, cond) (okfn)(skb) |
318 | static inline int nf_hook_thresh(int pf, unsigned int hook, | 326 | static inline int nf_hook_thresh(u_int8_t pf, unsigned int hook, |
319 | struct sk_buff *skb, | 327 | struct sk_buff *skb, |
320 | struct net_device *indev, | 328 | struct net_device *indev, |
321 | struct net_device *outdev, | 329 | struct net_device *outdev, |
@@ -324,7 +332,7 @@ static inline int nf_hook_thresh(int pf, unsigned int hook, | |||
324 | { | 332 | { |
325 | return okfn(skb); | 333 | return okfn(skb); |
326 | } | 334 | } |
327 | static inline int nf_hook(int pf, unsigned int hook, struct sk_buff *skb, | 335 | static inline int nf_hook(u_int8_t pf, unsigned int hook, struct sk_buff *skb, |
328 | struct net_device *indev, struct net_device *outdev, | 336 | struct net_device *indev, struct net_device *outdev, |
329 | int (*okfn)(struct sk_buff *)) | 337 | int (*okfn)(struct sk_buff *)) |
330 | { | 338 | { |
@@ -332,7 +340,9 @@ static inline int nf_hook(int pf, unsigned int hook, struct sk_buff *skb, | |||
332 | } | 340 | } |
333 | struct flowi; | 341 | struct flowi; |
334 | static inline void | 342 | static inline void |
335 | nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, int family) {} | 343 | nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl, u_int8_t family) |
344 | { | ||
345 | } | ||
336 | #endif /*CONFIG_NETFILTER*/ | 346 | #endif /*CONFIG_NETFILTER*/ |
337 | 347 | ||
338 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) | 348 | #if defined(CONFIG_NF_CONNTRACK) || defined(CONFIG_NF_CONNTRACK_MODULE) |
@@ -343,56 +353,5 @@ extern void (*nf_ct_destroy)(struct nf_conntrack *); | |||
343 | static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {} | 353 | static inline void nf_ct_attach(struct sk_buff *new, struct sk_buff *skb) {} |
344 | #endif | 354 | #endif |
345 | 355 | ||
346 | static inline struct net *nf_pre_routing_net(const struct net_device *in, | ||
347 | const struct net_device *out) | ||
348 | { | ||
349 | #ifdef CONFIG_NET_NS | ||
350 | return in->nd_net; | ||
351 | #else | ||
352 | return &init_net; | ||
353 | #endif | ||
354 | } | ||
355 | |||
356 | static inline struct net *nf_local_in_net(const struct net_device *in, | ||
357 | const struct net_device *out) | ||
358 | { | ||
359 | #ifdef CONFIG_NET_NS | ||
360 | return in->nd_net; | ||
361 | #else | ||
362 | return &init_net; | ||
363 | #endif | ||
364 | } | ||
365 | |||
366 | static inline struct net *nf_forward_net(const struct net_device *in, | ||
367 | const struct net_device *out) | ||
368 | { | ||
369 | #ifdef CONFIG_NET_NS | ||
370 | BUG_ON(in->nd_net != out->nd_net); | ||
371 | return in->nd_net; | ||
372 | #else | ||
373 | return &init_net; | ||
374 | #endif | ||
375 | } | ||
376 | |||
377 | static inline struct net *nf_local_out_net(const struct net_device *in, | ||
378 | const struct net_device *out) | ||
379 | { | ||
380 | #ifdef CONFIG_NET_NS | ||
381 | return out->nd_net; | ||
382 | #else | ||
383 | return &init_net; | ||
384 | #endif | ||
385 | } | ||
386 | |||
387 | static inline struct net *nf_post_routing_net(const struct net_device *in, | ||
388 | const struct net_device *out) | ||
389 | { | ||
390 | #ifdef CONFIG_NET_NS | ||
391 | return out->nd_net; | ||
392 | #else | ||
393 | return &init_net; | ||
394 | #endif | ||
395 | } | ||
396 | |||
397 | #endif /*__KERNEL__*/ | 356 | #endif /*__KERNEL__*/ |
398 | #endif /*__LINUX_NETFILTER_H*/ | 357 | #endif /*__LINUX_NETFILTER_H*/ |
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild index 3aff513d12c8..5a8af875bce2 100644 --- a/include/linux/netfilter/Kbuild +++ b/include/linux/netfilter/Kbuild | |||
@@ -32,6 +32,7 @@ header-y += xt_owner.h | |||
32 | header-y += xt_pkttype.h | 32 | header-y += xt_pkttype.h |
33 | header-y += xt_rateest.h | 33 | header-y += xt_rateest.h |
34 | header-y += xt_realm.h | 34 | header-y += xt_realm.h |
35 | header-y += xt_recent.h | ||
35 | header-y += xt_sctp.h | 36 | header-y += xt_sctp.h |
36 | header-y += xt_state.h | 37 | header-y += xt_state.h |
37 | header-y += xt_statistic.h | 38 | header-y += xt_statistic.h |
diff --git a/include/linux/netfilter/nf_conntrack_proto_gre.h b/include/linux/netfilter/nf_conntrack_proto_gre.h index 535e4219d2bb..2a10efda17fb 100644 --- a/include/linux/netfilter/nf_conntrack_proto_gre.h +++ b/include/linux/netfilter/nf_conntrack_proto_gre.h | |||
@@ -87,7 +87,7 @@ int nf_ct_gre_keymap_add(struct nf_conn *ct, enum ip_conntrack_dir dir, | |||
87 | /* delete keymap entries */ | 87 | /* delete keymap entries */ |
88 | void nf_ct_gre_keymap_destroy(struct nf_conn *ct); | 88 | void nf_ct_gre_keymap_destroy(struct nf_conn *ct); |
89 | 89 | ||
90 | extern void nf_ct_gre_keymap_flush(void); | 90 | extern void nf_ct_gre_keymap_flush(struct net *net); |
91 | extern void nf_nat_need_gre(void); | 91 | extern void nf_nat_need_gre(void); |
92 | 92 | ||
93 | #endif /* __KERNEL__ */ | 93 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 2326296b6f25..be41b609c88f 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -173,6 +173,98 @@ struct xt_counters_info | |||
173 | 173 | ||
174 | #include <linux/netdevice.h> | 174 | #include <linux/netdevice.h> |
175 | 175 | ||
176 | /** | ||
177 | * struct xt_match_param - parameters for match extensions' match functions | ||
178 | * | ||
179 | * @in: input netdevice | ||
180 | * @out: output netdevice | ||
181 | * @match: struct xt_match through which this function was invoked | ||
182 | * @matchinfo: per-match data | ||
183 | * @fragoff: packet is a fragment, this is the data offset | ||
184 | * @thoff: position of transport header relative to skb->data | ||
185 | * @hotdrop: drop packet if we had inspection problems | ||
186 | * @family: Actual NFPROTO_* through which the function is invoked | ||
187 | * (helpful when match->family == NFPROTO_UNSPEC) | ||
188 | */ | ||
189 | struct xt_match_param { | ||
190 | const struct net_device *in, *out; | ||
191 | const struct xt_match *match; | ||
192 | const void *matchinfo; | ||
193 | int fragoff; | ||
194 | unsigned int thoff; | ||
195 | bool *hotdrop; | ||
196 | u_int8_t family; | ||
197 | }; | ||
198 | |||
199 | /** | ||
200 | * struct xt_mtchk_param - parameters for match extensions' | ||
201 | * checkentry functions | ||
202 | * | ||
203 | * @table: table the rule is tried to be inserted into | ||
204 | * @entryinfo: the family-specific rule data | ||
205 | * (struct ipt_ip, ip6t_ip, ebt_entry) | ||
206 | * @match: struct xt_match through which this function was invoked | ||
207 | * @matchinfo: per-match data | ||
208 | * @hook_mask: via which hooks the new rule is reachable | ||
209 | */ | ||
210 | struct xt_mtchk_param { | ||
211 | const char *table; | ||
212 | const void *entryinfo; | ||
213 | const struct xt_match *match; | ||
214 | void *matchinfo; | ||
215 | unsigned int hook_mask; | ||
216 | u_int8_t family; | ||
217 | }; | ||
218 | |||
219 | /* Match destructor parameters */ | ||
220 | struct xt_mtdtor_param { | ||
221 | const struct xt_match *match; | ||
222 | void *matchinfo; | ||
223 | u_int8_t family; | ||
224 | }; | ||
225 | |||
226 | /** | ||
227 | * struct xt_target_param - parameters for target extensions' target functions | ||
228 | * | ||
229 | * @hooknum: hook through which this target was invoked | ||
230 | * @target: struct xt_target through which this function was invoked | ||
231 | * @targinfo: per-target data | ||
232 | * | ||
233 | * Other fields see above. | ||
234 | */ | ||
235 | struct xt_target_param { | ||
236 | const struct net_device *in, *out; | ||
237 | unsigned int hooknum; | ||
238 | const struct xt_target *target; | ||
239 | const void *targinfo; | ||
240 | u_int8_t family; | ||
241 | }; | ||
242 | |||
243 | /** | ||
244 | * struct xt_tgchk_param - parameters for target extensions' | ||
245 | * checkentry functions | ||
246 | * | ||
247 | * @entryinfo: the family-specific rule data | ||
248 | * (struct ipt_entry, ip6t_entry, arpt_entry, ebt_entry) | ||
249 | * | ||
250 | * Other fields see above. | ||
251 | */ | ||
252 | struct xt_tgchk_param { | ||
253 | const char *table; | ||
254 | void *entryinfo; | ||
255 | const struct xt_target *target; | ||
256 | void *targinfo; | ||
257 | unsigned int hook_mask; | ||
258 | u_int8_t family; | ||
259 | }; | ||
260 | |||
261 | /* Target destructor parameters */ | ||
262 | struct xt_tgdtor_param { | ||
263 | const struct xt_target *target; | ||
264 | void *targinfo; | ||
265 | u_int8_t family; | ||
266 | }; | ||
267 | |||
176 | struct xt_match | 268 | struct xt_match |
177 | { | 269 | { |
178 | struct list_head list; | 270 | struct list_head list; |
@@ -185,24 +277,13 @@ struct xt_match | |||
185 | non-linear skb, using skb_header_pointer and | 277 | non-linear skb, using skb_header_pointer and |
186 | skb_ip_make_writable. */ | 278 | skb_ip_make_writable. */ |
187 | bool (*match)(const struct sk_buff *skb, | 279 | bool (*match)(const struct sk_buff *skb, |
188 | const struct net_device *in, | 280 | const struct xt_match_param *); |
189 | const struct net_device *out, | ||
190 | const struct xt_match *match, | ||
191 | const void *matchinfo, | ||
192 | int offset, | ||
193 | unsigned int protoff, | ||
194 | bool *hotdrop); | ||
195 | 281 | ||
196 | /* Called when user tries to insert an entry of this type. */ | 282 | /* Called when user tries to insert an entry of this type. */ |
197 | /* Should return true or false. */ | 283 | bool (*checkentry)(const struct xt_mtchk_param *); |
198 | bool (*checkentry)(const char *tablename, | ||
199 | const void *ip, | ||
200 | const struct xt_match *match, | ||
201 | void *matchinfo, | ||
202 | unsigned int hook_mask); | ||
203 | 284 | ||
204 | /* Called when entry of this type deleted. */ | 285 | /* Called when entry of this type deleted. */ |
205 | void (*destroy)(const struct xt_match *match, void *matchinfo); | 286 | void (*destroy)(const struct xt_mtdtor_param *); |
206 | 287 | ||
207 | /* Called when userspace align differs from kernel space one */ | 288 | /* Called when userspace align differs from kernel space one */ |
208 | void (*compat_from_user)(void *dst, void *src); | 289 | void (*compat_from_user)(void *dst, void *src); |
@@ -235,24 +316,16 @@ struct xt_target | |||
235 | must now handle non-linear skbs, using skb_copy_bits and | 316 | must now handle non-linear skbs, using skb_copy_bits and |
236 | skb_ip_make_writable. */ | 317 | skb_ip_make_writable. */ |
237 | unsigned int (*target)(struct sk_buff *skb, | 318 | unsigned int (*target)(struct sk_buff *skb, |
238 | const struct net_device *in, | 319 | const struct xt_target_param *); |
239 | const struct net_device *out, | ||
240 | unsigned int hooknum, | ||
241 | const struct xt_target *target, | ||
242 | const void *targinfo); | ||
243 | 320 | ||
244 | /* Called when user tries to insert an entry of this type: | 321 | /* Called when user tries to insert an entry of this type: |
245 | hook_mask is a bitmask of hooks from which it can be | 322 | hook_mask is a bitmask of hooks from which it can be |
246 | called. */ | 323 | called. */ |
247 | /* Should return true or false. */ | 324 | /* Should return true or false. */ |
248 | bool (*checkentry)(const char *tablename, | 325 | bool (*checkentry)(const struct xt_tgchk_param *); |
249 | const void *entry, | ||
250 | const struct xt_target *target, | ||
251 | void *targinfo, | ||
252 | unsigned int hook_mask); | ||
253 | 326 | ||
254 | /* Called when entry of this type deleted. */ | 327 | /* Called when entry of this type deleted. */ |
255 | void (*destroy)(const struct xt_target *target, void *targinfo); | 328 | void (*destroy)(const struct xt_tgdtor_param *); |
256 | 329 | ||
257 | /* Called when userspace align differs from kernel space one */ | 330 | /* Called when userspace align differs from kernel space one */ |
258 | void (*compat_from_user)(void *dst, void *src); | 331 | void (*compat_from_user)(void *dst, void *src); |
@@ -292,7 +365,7 @@ struct xt_table | |||
292 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ | 365 | /* Set this to THIS_MODULE if you are a module, otherwise NULL */ |
293 | struct module *me; | 366 | struct module *me; |
294 | 367 | ||
295 | int af; /* address/protocol family */ | 368 | u_int8_t af; /* address/protocol family */ |
296 | }; | 369 | }; |
297 | 370 | ||
298 | #include <linux/netfilter_ipv4.h> | 371 | #include <linux/netfilter_ipv4.h> |
@@ -328,12 +401,10 @@ extern void xt_unregister_match(struct xt_match *target); | |||
328 | extern int xt_register_matches(struct xt_match *match, unsigned int n); | 401 | extern int xt_register_matches(struct xt_match *match, unsigned int n); |
329 | extern void xt_unregister_matches(struct xt_match *match, unsigned int n); | 402 | extern void xt_unregister_matches(struct xt_match *match, unsigned int n); |
330 | 403 | ||
331 | extern int xt_check_match(const struct xt_match *match, unsigned short family, | 404 | extern int xt_check_match(struct xt_mtchk_param *, |
332 | unsigned int size, const char *table, unsigned int hook, | 405 | unsigned int size, u_int8_t proto, bool inv_proto); |
333 | unsigned short proto, int inv_proto); | 406 | extern int xt_check_target(struct xt_tgchk_param *, |
334 | extern int xt_check_target(const struct xt_target *target, unsigned short family, | 407 | unsigned int size, u_int8_t proto, bool inv_proto); |
335 | unsigned int size, const char *table, unsigned int hook, | ||
336 | unsigned short proto, int inv_proto); | ||
337 | 408 | ||
338 | extern struct xt_table *xt_register_table(struct net *net, | 409 | extern struct xt_table *xt_register_table(struct net *net, |
339 | struct xt_table *table, | 410 | struct xt_table *table, |
@@ -346,19 +417,19 @@ extern struct xt_table_info *xt_replace_table(struct xt_table *table, | |||
346 | struct xt_table_info *newinfo, | 417 | struct xt_table_info *newinfo, |
347 | int *error); | 418 | int *error); |
348 | 419 | ||
349 | extern struct xt_match *xt_find_match(int af, const char *name, u8 revision); | 420 | extern struct xt_match *xt_find_match(u8 af, const char *name, u8 revision); |
350 | extern struct xt_target *xt_find_target(int af, const char *name, u8 revision); | 421 | extern struct xt_target *xt_find_target(u8 af, const char *name, u8 revision); |
351 | extern struct xt_target *xt_request_find_target(int af, const char *name, | 422 | extern struct xt_target *xt_request_find_target(u8 af, const char *name, |
352 | u8 revision); | 423 | u8 revision); |
353 | extern int xt_find_revision(int af, const char *name, u8 revision, int target, | 424 | extern int xt_find_revision(u8 af, const char *name, u8 revision, |
354 | int *err); | 425 | int target, int *err); |
355 | 426 | ||
356 | extern struct xt_table *xt_find_table_lock(struct net *net, int af, | 427 | extern struct xt_table *xt_find_table_lock(struct net *net, u_int8_t af, |
357 | const char *name); | 428 | const char *name); |
358 | extern void xt_table_unlock(struct xt_table *t); | 429 | extern void xt_table_unlock(struct xt_table *t); |
359 | 430 | ||
360 | extern int xt_proto_init(struct net *net, int af); | 431 | extern int xt_proto_init(struct net *net, u_int8_t af); |
361 | extern void xt_proto_fini(struct net *net, int af); | 432 | extern void xt_proto_fini(struct net *net, u_int8_t af); |
362 | 433 | ||
363 | extern struct xt_table_info *xt_alloc_table_info(unsigned int size); | 434 | extern struct xt_table_info *xt_alloc_table_info(unsigned int size); |
364 | extern void xt_free_table_info(struct xt_table_info *info); | 435 | extern void xt_free_table_info(struct xt_table_info *info); |
@@ -423,12 +494,12 @@ struct compat_xt_counters_info | |||
423 | #define COMPAT_XT_ALIGN(s) (((s) + (__alignof__(struct compat_xt_counters)-1)) \ | 494 | #define COMPAT_XT_ALIGN(s) (((s) + (__alignof__(struct compat_xt_counters)-1)) \ |
424 | & ~(__alignof__(struct compat_xt_counters)-1)) | 495 | & ~(__alignof__(struct compat_xt_counters)-1)) |
425 | 496 | ||
426 | extern void xt_compat_lock(int af); | 497 | extern void xt_compat_lock(u_int8_t af); |
427 | extern void xt_compat_unlock(int af); | 498 | extern void xt_compat_unlock(u_int8_t af); |
428 | 499 | ||
429 | extern int xt_compat_add_offset(int af, unsigned int offset, short delta); | 500 | extern int xt_compat_add_offset(u_int8_t af, unsigned int offset, short delta); |
430 | extern void xt_compat_flush_offsets(int af); | 501 | extern void xt_compat_flush_offsets(u_int8_t af); |
431 | extern short xt_compat_calc_jump(int af, unsigned int offset); | 502 | extern short xt_compat_calc_jump(u_int8_t af, unsigned int offset); |
432 | 503 | ||
433 | extern int xt_compat_match_offset(const struct xt_match *match); | 504 | extern int xt_compat_match_offset(const struct xt_match *match); |
434 | extern int xt_compat_match_from_user(struct xt_entry_match *m, | 505 | extern int xt_compat_match_from_user(struct xt_entry_match *m, |
diff --git a/include/linux/netfilter/xt_TPROXY.h b/include/linux/netfilter/xt_TPROXY.h new file mode 100644 index 000000000000..152e8f97132b --- /dev/null +++ b/include/linux/netfilter/xt_TPROXY.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef _XT_TPROXY_H_target | ||
2 | #define _XT_TPROXY_H_target | ||
3 | |||
4 | /* TPROXY target is capable of marking the packet to perform | ||
5 | * redirection. We can get rid of that whenever we get support for | ||
6 | * mutliple targets in the same rule. */ | ||
7 | struct xt_tproxy_target_info { | ||
8 | u_int32_t mark_mask; | ||
9 | u_int32_t mark_value; | ||
10 | __be32 laddr; | ||
11 | __be16 lport; | ||
12 | }; | ||
13 | |||
14 | #endif /* _XT_TPROXY_H_target */ | ||
diff --git a/include/linux/netfilter/xt_recent.h b/include/linux/netfilter/xt_recent.h new file mode 100644 index 000000000000..5cfeb81c6794 --- /dev/null +++ b/include/linux/netfilter/xt_recent.h | |||
@@ -0,0 +1,26 @@ | |||
1 | #ifndef _LINUX_NETFILTER_XT_RECENT_H | ||
2 | #define _LINUX_NETFILTER_XT_RECENT_H 1 | ||
3 | |||
4 | enum { | ||
5 | XT_RECENT_CHECK = 1 << 0, | ||
6 | XT_RECENT_SET = 1 << 1, | ||
7 | XT_RECENT_UPDATE = 1 << 2, | ||
8 | XT_RECENT_REMOVE = 1 << 3, | ||
9 | XT_RECENT_TTL = 1 << 4, | ||
10 | |||
11 | XT_RECENT_SOURCE = 0, | ||
12 | XT_RECENT_DEST = 1, | ||
13 | |||
14 | XT_RECENT_NAME_LEN = 200, | ||
15 | }; | ||
16 | |||
17 | struct xt_recent_mtinfo { | ||
18 | u_int32_t seconds; | ||
19 | u_int32_t hit_count; | ||
20 | u_int8_t check_set; | ||
21 | u_int8_t invert; | ||
22 | char name[XT_RECENT_NAME_LEN]; | ||
23 | u_int8_t side; | ||
24 | }; | ||
25 | |||
26 | #endif /* _LINUX_NETFILTER_XT_RECENT_H */ | ||
diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h index 892f5b7771c7..d45e29cd1cfb 100644 --- a/include/linux/netfilter_bridge/ebtables.h +++ b/include/linux/netfilter_bridge/ebtables.h | |||
@@ -31,6 +31,9 @@ | |||
31 | * The 4 lsb are more than enough to store the verdict. */ | 31 | * The 4 lsb are more than enough to store the verdict. */ |
32 | #define EBT_VERDICT_BITS 0x0000000F | 32 | #define EBT_VERDICT_BITS 0x0000000F |
33 | 33 | ||
34 | struct xt_match; | ||
35 | struct xt_target; | ||
36 | |||
34 | struct ebt_counter | 37 | struct ebt_counter |
35 | { | 38 | { |
36 | uint64_t pcnt; | 39 | uint64_t pcnt; |
@@ -121,7 +124,7 @@ struct ebt_entry_match | |||
121 | { | 124 | { |
122 | union { | 125 | union { |
123 | char name[EBT_FUNCTION_MAXNAMELEN]; | 126 | char name[EBT_FUNCTION_MAXNAMELEN]; |
124 | struct ebt_match *match; | 127 | struct xt_match *match; |
125 | } u; | 128 | } u; |
126 | /* size of data */ | 129 | /* size of data */ |
127 | unsigned int match_size; | 130 | unsigned int match_size; |
@@ -132,7 +135,7 @@ struct ebt_entry_watcher | |||
132 | { | 135 | { |
133 | union { | 136 | union { |
134 | char name[EBT_FUNCTION_MAXNAMELEN]; | 137 | char name[EBT_FUNCTION_MAXNAMELEN]; |
135 | struct ebt_watcher *watcher; | 138 | struct xt_target *watcher; |
136 | } u; | 139 | } u; |
137 | /* size of data */ | 140 | /* size of data */ |
138 | unsigned int watcher_size; | 141 | unsigned int watcher_size; |
@@ -143,7 +146,7 @@ struct ebt_entry_target | |||
143 | { | 146 | { |
144 | union { | 147 | union { |
145 | char name[EBT_FUNCTION_MAXNAMELEN]; | 148 | char name[EBT_FUNCTION_MAXNAMELEN]; |
146 | struct ebt_target *target; | 149 | struct xt_target *target; |
147 | } u; | 150 | } u; |
148 | /* size of data */ | 151 | /* size of data */ |
149 | unsigned int target_size; | 152 | unsigned int target_size; |
@@ -207,14 +210,17 @@ struct ebt_match | |||
207 | { | 210 | { |
208 | struct list_head list; | 211 | struct list_head list; |
209 | const char name[EBT_FUNCTION_MAXNAMELEN]; | 212 | const char name[EBT_FUNCTION_MAXNAMELEN]; |
210 | /* 0 == it matches */ | 213 | bool (*match)(const struct sk_buff *skb, const struct net_device *in, |
211 | int (*match)(const struct sk_buff *skb, const struct net_device *in, | 214 | const struct net_device *out, const struct xt_match *match, |
212 | const struct net_device *out, const void *matchdata, | 215 | const void *matchinfo, int offset, unsigned int protoff, |
213 | unsigned int datalen); | 216 | bool *hotdrop); |
214 | /* 0 == let it in */ | 217 | bool (*checkentry)(const char *table, const void *entry, |
215 | int (*check)(const char *tablename, unsigned int hookmask, | 218 | const struct xt_match *match, void *matchinfo, |
216 | const struct ebt_entry *e, void *matchdata, unsigned int datalen); | 219 | unsigned int hook_mask); |
217 | void (*destroy)(void *matchdata, unsigned int datalen); | 220 | void (*destroy)(const struct xt_match *match, void *matchinfo); |
221 | unsigned int matchsize; | ||
222 | u_int8_t revision; | ||
223 | u_int8_t family; | ||
218 | struct module *me; | 224 | struct module *me; |
219 | }; | 225 | }; |
220 | 226 | ||
@@ -222,13 +228,17 @@ struct ebt_watcher | |||
222 | { | 228 | { |
223 | struct list_head list; | 229 | struct list_head list; |
224 | const char name[EBT_FUNCTION_MAXNAMELEN]; | 230 | const char name[EBT_FUNCTION_MAXNAMELEN]; |
225 | void (*watcher)(const struct sk_buff *skb, unsigned int hooknr, | 231 | unsigned int (*target)(struct sk_buff *skb, |
226 | const struct net_device *in, const struct net_device *out, | 232 | const struct net_device *in, const struct net_device *out, |
227 | const void *watcherdata, unsigned int datalen); | 233 | unsigned int hook_num, const struct xt_target *target, |
228 | /* 0 == let it in */ | 234 | const void *targinfo); |
229 | int (*check)(const char *tablename, unsigned int hookmask, | 235 | bool (*checkentry)(const char *table, const void *entry, |
230 | const struct ebt_entry *e, void *watcherdata, unsigned int datalen); | 236 | const struct xt_target *target, void *targinfo, |
231 | void (*destroy)(void *watcherdata, unsigned int datalen); | 237 | unsigned int hook_mask); |
238 | void (*destroy)(const struct xt_target *target, void *targinfo); | ||
239 | unsigned int targetsize; | ||
240 | u_int8_t revision; | ||
241 | u_int8_t family; | ||
232 | struct module *me; | 242 | struct module *me; |
233 | }; | 243 | }; |
234 | 244 | ||
@@ -236,14 +246,18 @@ struct ebt_target | |||
236 | { | 246 | { |
237 | struct list_head list; | 247 | struct list_head list; |
238 | const char name[EBT_FUNCTION_MAXNAMELEN]; | 248 | const char name[EBT_FUNCTION_MAXNAMELEN]; |
239 | /* returns one of the standard verdicts */ | 249 | /* returns one of the standard EBT_* verdicts */ |
240 | int (*target)(struct sk_buff *skb, unsigned int hooknr, | 250 | unsigned int (*target)(struct sk_buff *skb, |
241 | const struct net_device *in, const struct net_device *out, | 251 | const struct net_device *in, const struct net_device *out, |
242 | const void *targetdata, unsigned int datalen); | 252 | unsigned int hook_num, const struct xt_target *target, |
243 | /* 0 == let it in */ | 253 | const void *targinfo); |
244 | int (*check)(const char *tablename, unsigned int hookmask, | 254 | bool (*checkentry)(const char *table, const void *entry, |
245 | const struct ebt_entry *e, void *targetdata, unsigned int datalen); | 255 | const struct xt_target *target, void *targinfo, |
246 | void (*destroy)(void *targetdata, unsigned int datalen); | 256 | unsigned int hook_mask); |
257 | void (*destroy)(const struct xt_target *target, void *targinfo); | ||
258 | unsigned int targetsize; | ||
259 | u_int8_t revision; | ||
260 | u_int8_t family; | ||
247 | struct module *me; | 261 | struct module *me; |
248 | }; | 262 | }; |
249 | 263 | ||
@@ -288,12 +302,6 @@ struct ebt_table | |||
288 | ~(__alignof__(struct ebt_replace)-1)) | 302 | ~(__alignof__(struct ebt_replace)-1)) |
289 | extern int ebt_register_table(struct ebt_table *table); | 303 | extern int ebt_register_table(struct ebt_table *table); |
290 | extern void ebt_unregister_table(struct ebt_table *table); | 304 | extern void ebt_unregister_table(struct ebt_table *table); |
291 | extern int ebt_register_match(struct ebt_match *match); | ||
292 | extern void ebt_unregister_match(struct ebt_match *match); | ||
293 | extern int ebt_register_watcher(struct ebt_watcher *watcher); | ||
294 | extern void ebt_unregister_watcher(struct ebt_watcher *watcher); | ||
295 | extern int ebt_register_target(struct ebt_target *target); | ||
296 | extern void ebt_unregister_target(struct ebt_target *target); | ||
297 | extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb, | 305 | extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb, |
298 | const struct net_device *in, const struct net_device *out, | 306 | const struct net_device *in, const struct net_device *out, |
299 | struct ebt_table *table); | 307 | struct ebt_table *table); |
@@ -302,9 +310,9 @@ extern unsigned int ebt_do_table(unsigned int hook, struct sk_buff *skb, | |||
302 | #define FWINV(bool,invflg) ((bool) ^ !!(info->invflags & invflg)) | 310 | #define FWINV(bool,invflg) ((bool) ^ !!(info->invflags & invflg)) |
303 | /* True if the hook mask denotes that the rule is in a base chain, | 311 | /* True if the hook mask denotes that the rule is in a base chain, |
304 | * used in the check() functions */ | 312 | * used in the check() functions */ |
305 | #define BASE_CHAIN (hookmask & (1 << NF_BR_NUMHOOKS)) | 313 | #define BASE_CHAIN (par->hook_mask & (1 << NF_BR_NUMHOOKS)) |
306 | /* Clear the bit in the hook mask that tells if the rule is on a base chain */ | 314 | /* Clear the bit in the hook mask that tells if the rule is on a base chain */ |
307 | #define CLEAR_BASE_CHAIN_BIT (hookmask &= ~(1 << NF_BR_NUMHOOKS)) | 315 | #define CLEAR_BASE_CHAIN_BIT (par->hook_mask &= ~(1 << NF_BR_NUMHOOKS)) |
308 | /* True if the target is not a standard target */ | 316 | /* True if the target is not a standard target */ |
309 | #define INVALID_TARGET (info->target < -NUM_STANDARD_TARGETS || info->target >= 0) | 317 | #define INVALID_TARGET (info->target < -NUM_STANDARD_TARGETS || info->target >= 0) |
310 | 318 | ||
diff --git a/include/linux/netfilter_ipv4/ipt_recent.h b/include/linux/netfilter_ipv4/ipt_recent.h index 6508a4592651..d636cca133c2 100644 --- a/include/linux/netfilter_ipv4/ipt_recent.h +++ b/include/linux/netfilter_ipv4/ipt_recent.h | |||
@@ -1,27 +1,21 @@ | |||
1 | #ifndef _IPT_RECENT_H | 1 | #ifndef _IPT_RECENT_H |
2 | #define _IPT_RECENT_H | 2 | #define _IPT_RECENT_H |
3 | 3 | ||
4 | #define RECENT_NAME "ipt_recent" | 4 | #include <linux/netfilter/xt_recent.h> |
5 | #define RECENT_VER "v0.3.1" | ||
6 | 5 | ||
7 | #define IPT_RECENT_CHECK 1 | 6 | #define ipt_recent_info xt_recent_mtinfo |
8 | #define IPT_RECENT_SET 2 | ||
9 | #define IPT_RECENT_UPDATE 4 | ||
10 | #define IPT_RECENT_REMOVE 8 | ||
11 | #define IPT_RECENT_TTL 16 | ||
12 | 7 | ||
13 | #define IPT_RECENT_SOURCE 0 | 8 | enum { |
14 | #define IPT_RECENT_DEST 1 | 9 | IPT_RECENT_CHECK = XT_RECENT_CHECK, |
10 | IPT_RECENT_SET = XT_RECENT_SET, | ||
11 | IPT_RECENT_UPDATE = XT_RECENT_UPDATE, | ||
12 | IPT_RECENT_REMOVE = XT_RECENT_REMOVE, | ||
13 | IPT_RECENT_TTL = XT_RECENT_TTL, | ||
15 | 14 | ||
16 | #define IPT_RECENT_NAME_LEN 200 | 15 | IPT_RECENT_SOURCE = XT_RECENT_SOURCE, |
16 | IPT_RECENT_DEST = XT_RECENT_DEST, | ||
17 | 17 | ||
18 | struct ipt_recent_info { | 18 | IPT_RECENT_NAME_LEN = XT_RECENT_NAME_LEN, |
19 | u_int32_t seconds; | ||
20 | u_int32_t hit_count; | ||
21 | u_int8_t check_set; | ||
22 | u_int8_t invert; | ||
23 | char name[IPT_RECENT_NAME_LEN]; | ||
24 | u_int8_t side; | ||
25 | }; | 19 | }; |
26 | 20 | ||
27 | #endif /*_IPT_RECENT_H*/ | 21 | #endif /*_IPT_RECENT_H*/ |
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index 2be7c63bc0f2..9bad65400fba 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -89,6 +89,22 @@ | |||
89 | * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC | 89 | * @NL80211_CMD_DEL_PATH: Remove a mesh path identified by %NL80211_ATTR_MAC |
90 | * or, if no MAC address given, all mesh paths, on the interface identified | 90 | * or, if no MAC address given, all mesh paths, on the interface identified |
91 | * by %NL80211_ATTR_IFINDEX. | 91 | * by %NL80211_ATTR_IFINDEX. |
92 | * @NL80211_CMD_SET_BSS: Set BSS attributes for BSS identified by | ||
93 | * %NL80211_ATTR_IFINDEX. | ||
94 | * | ||
95 | * @NL80211_CMD_SET_REG: Set current regulatory domain. CRDA sends this command | ||
96 | * after being queried by the kernel. CRDA replies by sending a regulatory | ||
97 | * domain structure which consists of %NL80211_ATTR_REG_ALPHA set to our | ||
98 | * current alpha2 if it found a match. It also provides | ||
99 | * NL80211_ATTR_REG_RULE_FLAGS, and a set of regulatory rules. Each | ||
100 | * regulatory rule is a nested set of attributes given by | ||
101 | * %NL80211_ATTR_REG_RULE_FREQ_[START|END] and | ||
102 | * %NL80211_ATTR_FREQ_RANGE_MAX_BW with an attached power rule given by | ||
103 | * %NL80211_ATTR_REG_RULE_POWER_MAX_ANT_GAIN and | ||
104 | * %NL80211_ATTR_REG_RULE_POWER_MAX_EIRP. | ||
105 | * @NL80211_CMD_REQ_SET_REG: ask the wireless core to set the regulatory domain | ||
106 | * to the the specified ISO/IEC 3166-1 alpha2 country code. The core will | ||
107 | * store this as a valid request and then query userspace for it. | ||
92 | * | 108 | * |
93 | * @NL80211_CMD_MAX: highest used command number | 109 | * @NL80211_CMD_MAX: highest used command number |
94 | * @__NL80211_CMD_AFTER_LAST: internal use | 110 | * @__NL80211_CMD_AFTER_LAST: internal use |
@@ -127,13 +143,23 @@ enum nl80211_commands { | |||
127 | NL80211_CMD_NEW_MPATH, | 143 | NL80211_CMD_NEW_MPATH, |
128 | NL80211_CMD_DEL_MPATH, | 144 | NL80211_CMD_DEL_MPATH, |
129 | 145 | ||
130 | /* add commands here */ | 146 | NL80211_CMD_SET_BSS, |
147 | |||
148 | NL80211_CMD_SET_REG, | ||
149 | NL80211_CMD_REQ_SET_REG, | ||
150 | |||
151 | /* add new commands above here */ | ||
131 | 152 | ||
132 | /* used to define NL80211_CMD_MAX below */ | 153 | /* used to define NL80211_CMD_MAX below */ |
133 | __NL80211_CMD_AFTER_LAST, | 154 | __NL80211_CMD_AFTER_LAST, |
134 | NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1 | 155 | NL80211_CMD_MAX = __NL80211_CMD_AFTER_LAST - 1 |
135 | }; | 156 | }; |
136 | 157 | ||
158 | /* | ||
159 | * Allow user space programs to use #ifdef on new commands by defining them | ||
160 | * here | ||
161 | */ | ||
162 | #define NL80211_CMD_SET_BSS NL80211_CMD_SET_BSS | ||
137 | 163 | ||
138 | /** | 164 | /** |
139 | * enum nl80211_attrs - nl80211 netlink attributes | 165 | * enum nl80211_attrs - nl80211 netlink attributes |
@@ -188,10 +214,34 @@ enum nl80211_commands { | |||
188 | * info given for %NL80211_CMD_GET_MPATH, nested attribute described at | 214 | * info given for %NL80211_CMD_GET_MPATH, nested attribute described at |
189 | * &enum nl80211_mpath_info. | 215 | * &enum nl80211_mpath_info. |
190 | * | 216 | * |
191 | * | ||
192 | * @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of | 217 | * @NL80211_ATTR_MNTR_FLAGS: flags, nested element with NLA_FLAG attributes of |
193 | * &enum nl80211_mntr_flags. | 218 | * &enum nl80211_mntr_flags. |
194 | * | 219 | * |
220 | * @NL80211_ATTR_REG_ALPHA2: an ISO-3166-alpha2 country code for which the | ||
221 | * current regulatory domain should be set to or is already set to. | ||
222 | * For example, 'CR', for Costa Rica. This attribute is used by the kernel | ||
223 | * to query the CRDA to retrieve one regulatory domain. This attribute can | ||
224 | * also be used by userspace to query the kernel for the currently set | ||
225 | * regulatory domain. We chose an alpha2 as that is also used by the | ||
226 | * IEEE-802.11d country information element to identify a country. | ||
227 | * Users can also simply ask the wireless core to set regulatory domain | ||
228 | * to a specific alpha2. | ||
229 | * @NL80211_ATTR_REG_RULES: a nested array of regulatory domain regulatory | ||
230 | * rules. | ||
231 | * | ||
232 | * @NL80211_ATTR_BSS_CTS_PROT: whether CTS protection is enabled (u8, 0 or 1) | ||
233 | * @NL80211_ATTR_BSS_SHORT_PREAMBLE: whether short preamble is enabled | ||
234 | * (u8, 0 or 1) | ||
235 | * @NL80211_ATTR_BSS_SHORT_SLOT_TIME: whether short slot time enabled | ||
236 | * (u8, 0 or 1) | ||
237 | * | ||
238 | * @NL80211_ATTR_HT_CAPABILITY: HT Capability information element (from | ||
239 | * association request when used with NL80211_CMD_NEW_STATION) | ||
240 | * | ||
241 | * @NL80211_ATTR_SUPPORTED_IFTYPES: nested attribute containing all | ||
242 | * supported interface types, each a flag attribute with the number | ||
243 | * of the interface mode. | ||
244 | * | ||
195 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 245 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
196 | * @__NL80211_ATTR_AFTER_LAST: internal use | 246 | * @__NL80211_ATTR_AFTER_LAST: internal use |
197 | */ | 247 | */ |
@@ -235,16 +285,35 @@ enum nl80211_attrs { | |||
235 | NL80211_ATTR_MPATH_NEXT_HOP, | 285 | NL80211_ATTR_MPATH_NEXT_HOP, |
236 | NL80211_ATTR_MPATH_INFO, | 286 | NL80211_ATTR_MPATH_INFO, |
237 | 287 | ||
288 | NL80211_ATTR_BSS_CTS_PROT, | ||
289 | NL80211_ATTR_BSS_SHORT_PREAMBLE, | ||
290 | NL80211_ATTR_BSS_SHORT_SLOT_TIME, | ||
291 | |||
292 | NL80211_ATTR_HT_CAPABILITY, | ||
293 | |||
294 | NL80211_ATTR_SUPPORTED_IFTYPES, | ||
295 | |||
296 | NL80211_ATTR_REG_ALPHA2, | ||
297 | NL80211_ATTR_REG_RULES, | ||
298 | |||
238 | /* add attributes here, update the policy in nl80211.c */ | 299 | /* add attributes here, update the policy in nl80211.c */ |
239 | 300 | ||
240 | __NL80211_ATTR_AFTER_LAST, | 301 | __NL80211_ATTR_AFTER_LAST, |
241 | NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 | 302 | NL80211_ATTR_MAX = __NL80211_ATTR_AFTER_LAST - 1 |
242 | }; | 303 | }; |
243 | 304 | ||
305 | /* | ||
306 | * Allow user space programs to use #ifdef on new attributes by defining them | ||
307 | * here | ||
308 | */ | ||
309 | #define NL80211_ATTR_HT_CAPABILITY NL80211_ATTR_HT_CAPABILITY | ||
310 | |||
244 | #define NL80211_MAX_SUPP_RATES 32 | 311 | #define NL80211_MAX_SUPP_RATES 32 |
312 | #define NL80211_MAX_SUPP_REG_RULES 32 | ||
245 | #define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0 | 313 | #define NL80211_TKIP_DATA_OFFSET_ENCR_KEY 0 |
246 | #define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16 | 314 | #define NL80211_TKIP_DATA_OFFSET_TX_MIC_KEY 16 |
247 | #define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 | 315 | #define NL80211_TKIP_DATA_OFFSET_RX_MIC_KEY 24 |
316 | #define NL80211_HT_CAPABILITY_LEN 26 | ||
248 | 317 | ||
249 | /** | 318 | /** |
250 | * enum nl80211_iftype - (virtual) interface types | 319 | * enum nl80211_iftype - (virtual) interface types |
@@ -436,6 +505,66 @@ enum nl80211_bitrate_attr { | |||
436 | }; | 505 | }; |
437 | 506 | ||
438 | /** | 507 | /** |
508 | * enum nl80211_reg_rule_attr - regulatory rule attributes | ||
509 | * @NL80211_ATTR_REG_RULE_FLAGS: a set of flags which specify additional | ||
510 | * considerations for a given frequency range. These are the | ||
511 | * &enum nl80211_reg_rule_flags. | ||
512 | * @NL80211_ATTR_FREQ_RANGE_START: starting frequencry for the regulatory | ||
513 | * rule in KHz. This is not a center of frequency but an actual regulatory | ||
514 | * band edge. | ||
515 | * @NL80211_ATTR_FREQ_RANGE_END: ending frequency for the regulatory rule | ||
516 | * in KHz. This is not a center a frequency but an actual regulatory | ||
517 | * band edge. | ||
518 | * @NL80211_ATTR_FREQ_RANGE_MAX_BW: maximum allowed bandwidth for this | ||
519 | * frequency range, in KHz. | ||
520 | * @NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN: the maximum allowed antenna gain | ||
521 | * for a given frequency range. The value is in mBi (100 * dBi). | ||
522 | * If you don't have one then don't send this. | ||
523 | * @NL80211_ATTR_POWER_RULE_MAX_EIRP: the maximum allowed EIRP for | ||
524 | * a given frequency range. The value is in mBm (100 * dBm). | ||
525 | */ | ||
526 | enum nl80211_reg_rule_attr { | ||
527 | __NL80211_REG_RULE_ATTR_INVALID, | ||
528 | NL80211_ATTR_REG_RULE_FLAGS, | ||
529 | |||
530 | NL80211_ATTR_FREQ_RANGE_START, | ||
531 | NL80211_ATTR_FREQ_RANGE_END, | ||
532 | NL80211_ATTR_FREQ_RANGE_MAX_BW, | ||
533 | |||
534 | NL80211_ATTR_POWER_RULE_MAX_ANT_GAIN, | ||
535 | NL80211_ATTR_POWER_RULE_MAX_EIRP, | ||
536 | |||
537 | /* keep last */ | ||
538 | __NL80211_REG_RULE_ATTR_AFTER_LAST, | ||
539 | NL80211_REG_RULE_ATTR_MAX = __NL80211_REG_RULE_ATTR_AFTER_LAST - 1 | ||
540 | }; | ||
541 | |||
542 | /** | ||
543 | * enum nl80211_reg_rule_flags - regulatory rule flags | ||
544 | * | ||
545 | * @NL80211_RRF_NO_OFDM: OFDM modulation not allowed | ||
546 | * @NL80211_RRF_NO_CCK: CCK modulation not allowed | ||
547 | * @NL80211_RRF_NO_INDOOR: indoor operation not allowed | ||
548 | * @NL80211_RRF_NO_OUTDOOR: outdoor operation not allowed | ||
549 | * @NL80211_RRF_DFS: DFS support is required to be used | ||
550 | * @NL80211_RRF_PTP_ONLY: this is only for Point To Point links | ||
551 | * @NL80211_RRF_PTMP_ONLY: this is only for Point To Multi Point links | ||
552 | * @NL80211_RRF_PASSIVE_SCAN: passive scan is required | ||
553 | * @NL80211_RRF_NO_IBSS: no IBSS is allowed | ||
554 | */ | ||
555 | enum nl80211_reg_rule_flags { | ||
556 | NL80211_RRF_NO_OFDM = 1<<0, | ||
557 | NL80211_RRF_NO_CCK = 1<<1, | ||
558 | NL80211_RRF_NO_INDOOR = 1<<2, | ||
559 | NL80211_RRF_NO_OUTDOOR = 1<<3, | ||
560 | NL80211_RRF_DFS = 1<<4, | ||
561 | NL80211_RRF_PTP_ONLY = 1<<5, | ||
562 | NL80211_RRF_PTMP_ONLY = 1<<6, | ||
563 | NL80211_RRF_PASSIVE_SCAN = 1<<7, | ||
564 | NL80211_RRF_NO_IBSS = 1<<8, | ||
565 | }; | ||
566 | |||
567 | /** | ||
439 | * enum nl80211_mntr_flags - monitor configuration flags | 568 | * enum nl80211_mntr_flags - monitor configuration flags |
440 | * | 569 | * |
441 | * Monitor configuration flags. | 570 | * Monitor configuration flags. |
diff --git a/include/linux/notifier.h b/include/linux/notifier.h index da2698b0fdd1..b86fa2ffca0c 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h | |||
@@ -213,9 +213,16 @@ static inline int notifier_to_errno(int ret) | |||
213 | #define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */ | 213 | #define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */ |
214 | #define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */ | 214 | #define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */ |
215 | #define CPU_DYING 0x0008 /* CPU (unsigned)v not running any task, | 215 | #define CPU_DYING 0x0008 /* CPU (unsigned)v not running any task, |
216 | * not handling interrupts, soon dead */ | 216 | * not handling interrupts, soon dead. |
217 | * Called on the dying cpu, interrupts | ||
218 | * are already disabled. Must not | ||
219 | * sleep, must not fail */ | ||
217 | #define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug | 220 | #define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug |
218 | * lock is dropped */ | 221 | * lock is dropped */ |
222 | #define CPU_STARTING 0x000A /* CPU (unsigned)v soon running. | ||
223 | * Called on the new cpu, just before | ||
224 | * enabling interrupts. Must not sleep, | ||
225 | * must not fail */ | ||
219 | 226 | ||
220 | /* Used for CPU hotplug events occuring while tasks are frozen due to a suspend | 227 | /* Used for CPU hotplug events occuring while tasks are frozen due to a suspend |
221 | * operation in progress | 228 | * operation in progress |
@@ -229,6 +236,7 @@ static inline int notifier_to_errno(int ret) | |||
229 | #define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN) | 236 | #define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN) |
230 | #define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN) | 237 | #define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN) |
231 | #define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN) | 238 | #define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN) |
239 | #define CPU_STARTING_FROZEN (CPU_STARTING | CPU_TASKS_FROZEN) | ||
232 | 240 | ||
233 | /* Hibernation and suspend events */ | 241 | /* Hibernation and suspend events */ |
234 | #define PM_HIBERNATION_PREPARE 0x0001 /* Going to hibernate */ | 242 | #define PM_HIBERNATION_PREPARE 0x0001 /* Going to hibernate */ |
diff --git a/include/linux/pci.h b/include/linux/pci.h index c0e14008a3c2..98dc6243a706 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -534,7 +534,7 @@ extern void pci_sort_breadthfirst(void); | |||
534 | #ifdef CONFIG_PCI_LEGACY | 534 | #ifdef CONFIG_PCI_LEGACY |
535 | struct pci_dev __deprecated *pci_find_device(unsigned int vendor, | 535 | struct pci_dev __deprecated *pci_find_device(unsigned int vendor, |
536 | unsigned int device, | 536 | unsigned int device, |
537 | const struct pci_dev *from); | 537 | struct pci_dev *from); |
538 | struct pci_dev __deprecated *pci_find_slot(unsigned int bus, | 538 | struct pci_dev __deprecated *pci_find_slot(unsigned int bus, |
539 | unsigned int devfn); | 539 | unsigned int devfn); |
540 | #endif /* CONFIG_PCI_LEGACY */ | 540 | #endif /* CONFIG_PCI_LEGACY */ |
@@ -550,7 +550,7 @@ struct pci_dev *pci_get_device(unsigned int vendor, unsigned int device, | |||
550 | struct pci_dev *from); | 550 | struct pci_dev *from); |
551 | struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device, | 551 | struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device, |
552 | unsigned int ss_vendor, unsigned int ss_device, | 552 | unsigned int ss_vendor, unsigned int ss_device, |
553 | const struct pci_dev *from); | 553 | struct pci_dev *from); |
554 | struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn); | 554 | struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn); |
555 | struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn); | 555 | struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn); |
556 | struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from); | 556 | struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from); |
@@ -816,7 +816,7 @@ _PCI_NOP_ALL(write,) | |||
816 | 816 | ||
817 | static inline struct pci_dev *pci_find_device(unsigned int vendor, | 817 | static inline struct pci_dev *pci_find_device(unsigned int vendor, |
818 | unsigned int device, | 818 | unsigned int device, |
819 | const struct pci_dev *from) | 819 | struct pci_dev *from) |
820 | { | 820 | { |
821 | return NULL; | 821 | return NULL; |
822 | } | 822 | } |
@@ -838,7 +838,7 @@ static inline struct pci_dev *pci_get_subsys(unsigned int vendor, | |||
838 | unsigned int device, | 838 | unsigned int device, |
839 | unsigned int ss_vendor, | 839 | unsigned int ss_vendor, |
840 | unsigned int ss_device, | 840 | unsigned int ss_device, |
841 | const struct pci_dev *from) | 841 | struct pci_dev *from) |
842 | { | 842 | { |
843 | return NULL; | 843 | return NULL; |
844 | } | 844 | } |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index f1624b396754..f63b5455801c 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -497,6 +497,16 @@ | |||
497 | #define PCI_DEVICE_ID_AMD_K8_NB_ADDRMAP 0x1101 | 497 | #define PCI_DEVICE_ID_AMD_K8_NB_ADDRMAP 0x1101 |
498 | #define PCI_DEVICE_ID_AMD_K8_NB_MEMCTL 0x1102 | 498 | #define PCI_DEVICE_ID_AMD_K8_NB_MEMCTL 0x1102 |
499 | #define PCI_DEVICE_ID_AMD_K8_NB_MISC 0x1103 | 499 | #define PCI_DEVICE_ID_AMD_K8_NB_MISC 0x1103 |
500 | #define PCI_DEVICE_ID_AMD_10H_NB_HT 0x1200 | ||
501 | #define PCI_DEVICE_ID_AMD_10H_NB_MAP 0x1201 | ||
502 | #define PCI_DEVICE_ID_AMD_10H_NB_DRAM 0x1202 | ||
503 | #define PCI_DEVICE_ID_AMD_10H_NB_MISC 0x1203 | ||
504 | #define PCI_DEVICE_ID_AMD_10H_NB_LINK 0x1204 | ||
505 | #define PCI_DEVICE_ID_AMD_11H_NB_HT 0x1300 | ||
506 | #define PCI_DEVICE_ID_AMD_11H_NB_MAP 0x1301 | ||
507 | #define PCI_DEVICE_ID_AMD_11H_NB_DRAM 0x1302 | ||
508 | #define PCI_DEVICE_ID_AMD_11H_NB_MISC 0x1303 | ||
509 | #define PCI_DEVICE_ID_AMD_11H_NB_LINK 0x1304 | ||
500 | #define PCI_DEVICE_ID_AMD_LANCE 0x2000 | 510 | #define PCI_DEVICE_ID_AMD_LANCE 0x2000 |
501 | #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 | 511 | #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 |
502 | #define PCI_DEVICE_ID_AMD_SCSI 0x2020 | 512 | #define PCI_DEVICE_ID_AMD_SCSI 0x2020 |
@@ -1411,6 +1421,8 @@ | |||
1411 | #define PCI_DEVICE_ID_EICON_MAESTRAQ_U 0xe013 | 1421 | #define PCI_DEVICE_ID_EICON_MAESTRAQ_U 0xe013 |
1412 | #define PCI_DEVICE_ID_EICON_MAESTRAP 0xe014 | 1422 | #define PCI_DEVICE_ID_EICON_MAESTRAP 0xe014 |
1413 | 1423 | ||
1424 | #define PCI_VENDOR_ID_CISCO 0x1137 | ||
1425 | |||
1414 | #define PCI_VENDOR_ID_ZIATECH 0x1138 | 1426 | #define PCI_VENDOR_ID_ZIATECH 0x1138 |
1415 | #define PCI_DEVICE_ID_ZIATECH_5550_HC 0x5550 | 1427 | #define PCI_DEVICE_ID_ZIATECH_5550_HC 0x5550 |
1416 | 1428 | ||
@@ -2213,6 +2225,7 @@ | |||
2213 | 2225 | ||
2214 | #define PCI_VENDOR_ID_ATTANSIC 0x1969 | 2226 | #define PCI_VENDOR_ID_ATTANSIC 0x1969 |
2215 | #define PCI_DEVICE_ID_ATTANSIC_L1 0x1048 | 2227 | #define PCI_DEVICE_ID_ATTANSIC_L1 0x1048 |
2228 | #define PCI_DEVICE_ID_ATTANSIC_L2 0x2048 | ||
2216 | 2229 | ||
2217 | #define PCI_VENDOR_ID_JMICRON 0x197B | 2230 | #define PCI_VENDOR_ID_JMICRON 0x197B |
2218 | #define PCI_DEVICE_ID_JMICRON_JMB360 0x2360 | 2231 | #define PCI_DEVICE_ID_JMICRON_JMB360 0x2360 |
@@ -2244,6 +2257,16 @@ | |||
2244 | #define PCI_DEVICE_ID_3DLABS_PERMEDIA2 0x0007 | 2257 | #define PCI_DEVICE_ID_3DLABS_PERMEDIA2 0x0007 |
2245 | #define PCI_DEVICE_ID_3DLABS_PERMEDIA2V 0x0009 | 2258 | #define PCI_DEVICE_ID_3DLABS_PERMEDIA2V 0x0009 |
2246 | 2259 | ||
2260 | #define PCI_VENDOR_ID_NETXEN 0x4040 | ||
2261 | #define PCI_DEVICE_ID_NX2031_10GXSR 0x0001 | ||
2262 | #define PCI_DEVICE_ID_NX2031_10GCX4 0x0002 | ||
2263 | #define PCI_DEVICE_ID_NX2031_4GCU 0x0003 | ||
2264 | #define PCI_DEVICE_ID_NX2031_IMEZ 0x0004 | ||
2265 | #define PCI_DEVICE_ID_NX2031_HMEZ 0x0005 | ||
2266 | #define PCI_DEVICE_ID_NX2031_XG_MGMT 0x0024 | ||
2267 | #define PCI_DEVICE_ID_NX2031_XG_MGMT2 0x0025 | ||
2268 | #define PCI_DEVICE_ID_NX3031 0x0100 | ||
2269 | |||
2247 | #define PCI_VENDOR_ID_AKS 0x416c | 2270 | #define PCI_VENDOR_ID_AKS 0x416c |
2248 | #define PCI_DEVICE_ID_AKS_ALADDINCARD 0x0100 | 2271 | #define PCI_DEVICE_ID_AKS_ALADDINCARD 0x0100 |
2249 | 2272 | ||
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index fac3337547eb..9f2a3751873a 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
@@ -23,12 +23,19 @@ | |||
23 | __attribute__((__section__(SHARED_ALIGNED_SECTION))) \ | 23 | __attribute__((__section__(SHARED_ALIGNED_SECTION))) \ |
24 | PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name \ | 24 | PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name \ |
25 | ____cacheline_aligned_in_smp | 25 | ____cacheline_aligned_in_smp |
26 | |||
27 | #define DEFINE_PER_CPU_PAGE_ALIGNED(type, name) \ | ||
28 | __attribute__((__section__(".data.percpu.page_aligned"))) \ | ||
29 | PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name | ||
26 | #else | 30 | #else |
27 | #define DEFINE_PER_CPU(type, name) \ | 31 | #define DEFINE_PER_CPU(type, name) \ |
28 | PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name | 32 | PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name |
29 | 33 | ||
30 | #define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \ | 34 | #define DEFINE_PER_CPU_SHARED_ALIGNED(type, name) \ |
31 | DEFINE_PER_CPU(type, name) | 35 | DEFINE_PER_CPU(type, name) |
36 | |||
37 | #define DEFINE_PER_CPU_PAGE_ALIGNED(type, name) \ | ||
38 | DEFINE_PER_CPU(type, name) | ||
32 | #endif | 39 | #endif |
33 | 40 | ||
34 | #define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var) | 41 | #define EXPORT_PER_CPU_SYMBOL(var) EXPORT_SYMBOL(per_cpu__##var) |
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h index 208388835357..9007ccdfc112 100644 --- a/include/linux/percpu_counter.h +++ b/include/linux/percpu_counter.h | |||
@@ -35,7 +35,7 @@ int percpu_counter_init_irq(struct percpu_counter *fbc, s64 amount); | |||
35 | void percpu_counter_destroy(struct percpu_counter *fbc); | 35 | void percpu_counter_destroy(struct percpu_counter *fbc); |
36 | void percpu_counter_set(struct percpu_counter *fbc, s64 amount); | 36 | void percpu_counter_set(struct percpu_counter *fbc, s64 amount); |
37 | void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch); | 37 | void __percpu_counter_add(struct percpu_counter *fbc, s64 amount, s32 batch); |
38 | s64 __percpu_counter_sum(struct percpu_counter *fbc, int set); | 38 | s64 __percpu_counter_sum(struct percpu_counter *fbc); |
39 | 39 | ||
40 | static inline void percpu_counter_add(struct percpu_counter *fbc, s64 amount) | 40 | static inline void percpu_counter_add(struct percpu_counter *fbc, s64 amount) |
41 | { | 41 | { |
@@ -44,19 +44,13 @@ static inline void percpu_counter_add(struct percpu_counter *fbc, s64 amount) | |||
44 | 44 | ||
45 | static inline s64 percpu_counter_sum_positive(struct percpu_counter *fbc) | 45 | static inline s64 percpu_counter_sum_positive(struct percpu_counter *fbc) |
46 | { | 46 | { |
47 | s64 ret = __percpu_counter_sum(fbc, 0); | 47 | s64 ret = __percpu_counter_sum(fbc); |
48 | return ret < 0 ? 0 : ret; | 48 | return ret < 0 ? 0 : ret; |
49 | } | 49 | } |
50 | 50 | ||
51 | static inline s64 percpu_counter_sum_and_set(struct percpu_counter *fbc) | ||
52 | { | ||
53 | return __percpu_counter_sum(fbc, 1); | ||
54 | } | ||
55 | |||
56 | |||
57 | static inline s64 percpu_counter_sum(struct percpu_counter *fbc) | 51 | static inline s64 percpu_counter_sum(struct percpu_counter *fbc) |
58 | { | 52 | { |
59 | return __percpu_counter_sum(fbc, 0); | 53 | return __percpu_counter_sum(fbc); |
60 | } | 54 | } |
61 | 55 | ||
62 | static inline s64 percpu_counter_read(struct percpu_counter *fbc) | 56 | static inline s64 percpu_counter_read(struct percpu_counter *fbc) |
diff --git a/include/linux/pfkeyv2.h b/include/linux/pfkeyv2.h index 700725ddcaae..01b262959f2e 100644 --- a/include/linux/pfkeyv2.h +++ b/include/linux/pfkeyv2.h | |||
@@ -226,6 +226,15 @@ struct sadb_x_sec_ctx { | |||
226 | } __attribute__((packed)); | 226 | } __attribute__((packed)); |
227 | /* sizeof(struct sadb_sec_ctx) = 8 */ | 227 | /* sizeof(struct sadb_sec_ctx) = 8 */ |
228 | 228 | ||
229 | /* Used by MIGRATE to pass addresses IKE will use to perform | ||
230 | * negotiation with the peer */ | ||
231 | struct sadb_x_kmaddress { | ||
232 | uint16_t sadb_x_kmaddress_len; | ||
233 | uint16_t sadb_x_kmaddress_exttype; | ||
234 | uint32_t sadb_x_kmaddress_reserved; | ||
235 | } __attribute__((packed)); | ||
236 | /* sizeof(struct sadb_x_kmaddress) == 8 */ | ||
237 | |||
229 | /* Message types */ | 238 | /* Message types */ |
230 | #define SADB_RESERVED 0 | 239 | #define SADB_RESERVED 0 |
231 | #define SADB_GETSPI 1 | 240 | #define SADB_GETSPI 1 |
@@ -346,7 +355,9 @@ struct sadb_x_sec_ctx { | |||
346 | #define SADB_X_EXT_NAT_T_DPORT 22 | 355 | #define SADB_X_EXT_NAT_T_DPORT 22 |
347 | #define SADB_X_EXT_NAT_T_OA 23 | 356 | #define SADB_X_EXT_NAT_T_OA 23 |
348 | #define SADB_X_EXT_SEC_CTX 24 | 357 | #define SADB_X_EXT_SEC_CTX 24 |
349 | #define SADB_EXT_MAX 24 | 358 | /* Used with MIGRATE to pass @ to IKE for negotiation */ |
359 | #define SADB_X_EXT_KMADDRESS 25 | ||
360 | #define SADB_EXT_MAX 25 | ||
350 | 361 | ||
351 | /* Identity Extension values */ | 362 | /* Identity Extension values */ |
352 | #define SADB_IDENTTYPE_RESERVED 0 | 363 | #define SADB_IDENTTYPE_RESERVED 0 |
diff --git a/include/linux/phonet.h b/include/linux/phonet.h new file mode 100644 index 000000000000..c9609f9aedac --- /dev/null +++ b/include/linux/phonet.h | |||
@@ -0,0 +1,170 @@ | |||
1 | /** | ||
2 | * file phonet.h | ||
3 | * | ||
4 | * Phonet sockets kernel interface | ||
5 | * | ||
6 | * Copyright (C) 2008 Nokia Corporation. All rights reserved. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * version 2 as published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, but | ||
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
20 | * 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef LINUX_PHONET_H | ||
24 | #define LINUX_PHONET_H | ||
25 | |||
26 | /* Automatic protocol selection */ | ||
27 | #define PN_PROTO_TRANSPORT 0 | ||
28 | /* Phonet datagram socket */ | ||
29 | #define PN_PROTO_PHONET 1 | ||
30 | /* Phonet pipe */ | ||
31 | #define PN_PROTO_PIPE 2 | ||
32 | #define PHONET_NPROTO 3 | ||
33 | |||
34 | /* Socket options for SOL_PNPIPE level */ | ||
35 | #define PNPIPE_ENCAP 1 | ||
36 | #define PNPIPE_IFINDEX 2 | ||
37 | |||
38 | #define PNADDR_ANY 0 | ||
39 | #define PNPORT_RESOURCE_ROUTING 0 | ||
40 | |||
41 | /* Values for PNPIPE_ENCAP option */ | ||
42 | #define PNPIPE_ENCAP_NONE 0 | ||
43 | #define PNPIPE_ENCAP_IP 1 | ||
44 | |||
45 | /* ioctls */ | ||
46 | #define SIOCPNGETOBJECT (SIOCPROTOPRIVATE + 0) | ||
47 | |||
48 | /* Phonet protocol header */ | ||
49 | struct phonethdr { | ||
50 | __u8 pn_rdev; | ||
51 | __u8 pn_sdev; | ||
52 | __u8 pn_res; | ||
53 | __be16 pn_length; | ||
54 | __u8 pn_robj; | ||
55 | __u8 pn_sobj; | ||
56 | } __attribute__((packed)); | ||
57 | |||
58 | /* Common Phonet payload header */ | ||
59 | struct phonetmsg { | ||
60 | __u8 pn_trans_id; /* transaction ID */ | ||
61 | __u8 pn_msg_id; /* message type */ | ||
62 | union { | ||
63 | struct { | ||
64 | __u8 pn_submsg_id; /* message subtype */ | ||
65 | __u8 pn_data[5]; | ||
66 | } base; | ||
67 | struct { | ||
68 | __u16 pn_e_res_id; /* extended resource ID */ | ||
69 | __u8 pn_e_submsg_id; /* message subtype */ | ||
70 | __u8 pn_e_data[3]; | ||
71 | } ext; | ||
72 | } pn_msg_u; | ||
73 | }; | ||
74 | #define PN_COMMON_MESSAGE 0xF0 | ||
75 | #define PN_PREFIX 0xE0 /* resource for extended messages */ | ||
76 | #define pn_submsg_id pn_msg_u.base.pn_submsg_id | ||
77 | #define pn_e_submsg_id pn_msg_u.ext.pn_e_submsg_id | ||
78 | #define pn_e_res_id pn_msg_u.ext.pn_e_res_id | ||
79 | #define pn_data pn_msg_u.base.pn_data | ||
80 | #define pn_e_data pn_msg_u.ext.pn_e_data | ||
81 | |||
82 | /* data for unreachable errors */ | ||
83 | #define PN_COMM_SERVICE_NOT_IDENTIFIED_RESP 0x01 | ||
84 | #define PN_COMM_ISA_ENTITY_NOT_REACHABLE_RESP 0x14 | ||
85 | #define pn_orig_msg_id pn_data[0] | ||
86 | #define pn_status pn_data[1] | ||
87 | #define pn_e_orig_msg_id pn_e_data[0] | ||
88 | #define pn_e_status pn_e_data[1] | ||
89 | |||
90 | /* Phonet socket address structure */ | ||
91 | struct sockaddr_pn { | ||
92 | sa_family_t spn_family; | ||
93 | __u8 spn_obj; | ||
94 | __u8 spn_dev; | ||
95 | __u8 spn_resource; | ||
96 | __u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3]; | ||
97 | } __attribute__ ((packed)); | ||
98 | |||
99 | static inline __u16 pn_object(__u8 addr, __u16 port) | ||
100 | { | ||
101 | return (addr << 8) | (port & 0x3ff); | ||
102 | } | ||
103 | |||
104 | static inline __u8 pn_obj(__u16 handle) | ||
105 | { | ||
106 | return handle & 0xff; | ||
107 | } | ||
108 | |||
109 | static inline __u8 pn_dev(__u16 handle) | ||
110 | { | ||
111 | return handle >> 8; | ||
112 | } | ||
113 | |||
114 | static inline __u16 pn_port(__u16 handle) | ||
115 | { | ||
116 | return handle & 0x3ff; | ||
117 | } | ||
118 | |||
119 | static inline __u8 pn_addr(__u16 handle) | ||
120 | { | ||
121 | return (handle >> 8) & 0xfc; | ||
122 | } | ||
123 | |||
124 | static inline void pn_sockaddr_set_addr(struct sockaddr_pn *spn, __u8 addr) | ||
125 | { | ||
126 | spn->spn_dev &= 0x03; | ||
127 | spn->spn_dev |= addr & 0xfc; | ||
128 | } | ||
129 | |||
130 | static inline void pn_sockaddr_set_port(struct sockaddr_pn *spn, __u16 port) | ||
131 | { | ||
132 | spn->spn_dev &= 0xfc; | ||
133 | spn->spn_dev |= (port >> 8) & 0x03; | ||
134 | spn->spn_obj = port & 0xff; | ||
135 | } | ||
136 | |||
137 | static inline void pn_sockaddr_set_object(struct sockaddr_pn *spn, | ||
138 | __u16 handle) | ||
139 | { | ||
140 | spn->spn_dev = pn_dev(handle); | ||
141 | spn->spn_obj = pn_obj(handle); | ||
142 | } | ||
143 | |||
144 | static inline void pn_sockaddr_set_resource(struct sockaddr_pn *spn, | ||
145 | __u8 resource) | ||
146 | { | ||
147 | spn->spn_resource = resource; | ||
148 | } | ||
149 | |||
150 | static inline __u8 pn_sockaddr_get_addr(const struct sockaddr_pn *spn) | ||
151 | { | ||
152 | return spn->spn_dev & 0xfc; | ||
153 | } | ||
154 | |||
155 | static inline __u16 pn_sockaddr_get_port(const struct sockaddr_pn *spn) | ||
156 | { | ||
157 | return ((spn->spn_dev & 0x03) << 8) | spn->spn_obj; | ||
158 | } | ||
159 | |||
160 | static inline __u16 pn_sockaddr_get_object(const struct sockaddr_pn *spn) | ||
161 | { | ||
162 | return pn_object(spn->spn_dev, spn->spn_obj); | ||
163 | } | ||
164 | |||
165 | static inline __u8 pn_sockaddr_get_resource(const struct sockaddr_pn *spn) | ||
166 | { | ||
167 | return spn->spn_resource; | ||
168 | } | ||
169 | |||
170 | #endif | ||
diff --git a/include/linux/phy.h b/include/linux/phy.h index 7224c4099a28..77c4ed60b982 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
@@ -99,7 +99,14 @@ struct mii_bus { | |||
99 | */ | 99 | */ |
100 | struct mutex mdio_lock; | 100 | struct mutex mdio_lock; |
101 | 101 | ||
102 | struct device *dev; | 102 | struct device *parent; |
103 | enum { | ||
104 | MDIOBUS_ALLOCATED = 1, | ||
105 | MDIOBUS_REGISTERED, | ||
106 | MDIOBUS_UNREGISTERED, | ||
107 | MDIOBUS_RELEASED, | ||
108 | } state; | ||
109 | struct device dev; | ||
103 | 110 | ||
104 | /* list of all PHYs on bus */ | 111 | /* list of all PHYs on bus */ |
105 | struct phy_device *phy_map[PHY_MAX_ADDR]; | 112 | struct phy_device *phy_map[PHY_MAX_ADDR]; |
@@ -113,6 +120,16 @@ struct mii_bus { | |||
113 | */ | 120 | */ |
114 | int *irq; | 121 | int *irq; |
115 | }; | 122 | }; |
123 | #define to_mii_bus(d) container_of(d, struct mii_bus, dev) | ||
124 | |||
125 | struct mii_bus *mdiobus_alloc(void); | ||
126 | int mdiobus_register(struct mii_bus *bus); | ||
127 | void mdiobus_unregister(struct mii_bus *bus); | ||
128 | void mdiobus_free(struct mii_bus *bus); | ||
129 | struct phy_device *mdiobus_scan(struct mii_bus *bus, int addr); | ||
130 | int mdiobus_read(struct mii_bus *bus, int addr, u16 regnum); | ||
131 | int mdiobus_write(struct mii_bus *bus, int addr, u16 regnum, u16 val); | ||
132 | |||
116 | 133 | ||
117 | #define PHY_INTERRUPT_DISABLED 0x0 | 134 | #define PHY_INTERRUPT_DISABLED 0x0 |
118 | #define PHY_INTERRUPT_ENABLED 0x80000000 | 135 | #define PHY_INTERRUPT_ENABLED 0x80000000 |
@@ -391,8 +408,35 @@ struct phy_fixup { | |||
391 | int (*run)(struct phy_device *phydev); | 408 | int (*run)(struct phy_device *phydev); |
392 | }; | 409 | }; |
393 | 410 | ||
394 | int phy_read(struct phy_device *phydev, u16 regnum); | 411 | /** |
395 | int phy_write(struct phy_device *phydev, u16 regnum, u16 val); | 412 | * phy_read - Convenience function for reading a given PHY register |
413 | * @phydev: the phy_device struct | ||
414 | * @regnum: register number to read | ||
415 | * | ||
416 | * NOTE: MUST NOT be called from interrupt context, | ||
417 | * because the bus read/write functions may wait for an interrupt | ||
418 | * to conclude the operation. | ||
419 | */ | ||
420 | static inline int phy_read(struct phy_device *phydev, u16 regnum) | ||
421 | { | ||
422 | return mdiobus_read(phydev->bus, phydev->addr, regnum); | ||
423 | } | ||
424 | |||
425 | /** | ||
426 | * phy_write - Convenience function for writing a given PHY register | ||
427 | * @phydev: the phy_device struct | ||
428 | * @regnum: register number to write | ||
429 | * @val: value to write to @regnum | ||
430 | * | ||
431 | * NOTE: MUST NOT be called from interrupt context, | ||
432 | * because the bus read/write functions may wait for an interrupt | ||
433 | * to conclude the operation. | ||
434 | */ | ||
435 | static inline int phy_write(struct phy_device *phydev, u16 regnum, u16 val) | ||
436 | { | ||
437 | return mdiobus_write(phydev->bus, phydev->addr, regnum, val); | ||
438 | } | ||
439 | |||
396 | int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id); | 440 | int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id); |
397 | struct phy_device* get_phy_device(struct mii_bus *bus, int addr); | 441 | struct phy_device* get_phy_device(struct mii_bus *bus, int addr); |
398 | int phy_clear_interrupt(struct phy_device *phydev); | 442 | int phy_clear_interrupt(struct phy_device *phydev); |
@@ -408,8 +452,6 @@ void phy_start(struct phy_device *phydev); | |||
408 | void phy_stop(struct phy_device *phydev); | 452 | void phy_stop(struct phy_device *phydev); |
409 | int phy_start_aneg(struct phy_device *phydev); | 453 | int phy_start_aneg(struct phy_device *phydev); |
410 | 454 | ||
411 | int mdiobus_register(struct mii_bus *bus); | ||
412 | void mdiobus_unregister(struct mii_bus *bus); | ||
413 | void phy_sanitize_settings(struct phy_device *phydev); | 455 | void phy_sanitize_settings(struct phy_device *phydev); |
414 | int phy_stop_interrupts(struct phy_device *phydev); | 456 | int phy_stop_interrupts(struct phy_device *phydev); |
415 | int phy_enable_interrupts(struct phy_device *phydev); | 457 | int phy_enable_interrupts(struct phy_device *phydev); |
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h index e5de421ac7b4..5d921fa91a5b 100644 --- a/include/linux/pkt_sched.h +++ b/include/linux/pkt_sched.h | |||
@@ -123,6 +123,13 @@ struct tc_prio_qopt | |||
123 | __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */ | 123 | __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */ |
124 | }; | 124 | }; |
125 | 125 | ||
126 | /* MULTIQ section */ | ||
127 | |||
128 | struct tc_multiq_qopt { | ||
129 | __u16 bands; /* Number of bands */ | ||
130 | __u16 max_bands; /* Maximum number of queues */ | ||
131 | }; | ||
132 | |||
126 | /* TBF section */ | 133 | /* TBF section */ |
127 | 134 | ||
128 | struct tc_tbf_qopt | 135 | struct tc_tbf_qopt |
diff --git a/include/linux/proportions.h b/include/linux/proportions.h index 5afc1b23346d..cf793bbbd05e 100644 --- a/include/linux/proportions.h +++ b/include/linux/proportions.h | |||
@@ -104,8 +104,8 @@ struct prop_local_single { | |||
104 | * snapshot of the last seen global state | 104 | * snapshot of the last seen global state |
105 | * and a lock protecting this state | 105 | * and a lock protecting this state |
106 | */ | 106 | */ |
107 | int shift; | ||
108 | unsigned long period; | 107 | unsigned long period; |
108 | int shift; | ||
109 | spinlock_t lock; /* protect the snapshot state */ | 109 | spinlock_t lock; /* protect the snapshot state */ |
110 | }; | 110 | }; |
111 | 111 | ||
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h index b160fb18e8d6..37aaf2b39863 100644 --- a/include/linux/ramfs.h +++ b/include/linux/ramfs.h | |||
@@ -6,6 +6,7 @@ extern int ramfs_get_sb(struct file_system_type *fs_type, | |||
6 | int flags, const char *dev_name, void *data, struct vfsmount *mnt); | 6 | int flags, const char *dev_name, void *data, struct vfsmount *mnt); |
7 | 7 | ||
8 | #ifndef CONFIG_MMU | 8 | #ifndef CONFIG_MMU |
9 | extern int ramfs_nommu_expand_for_mapping(struct inode *inode, size_t newsize); | ||
9 | extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file, | 10 | extern unsigned long ramfs_nommu_get_unmapped_area(struct file *file, |
10 | unsigned long addr, | 11 | unsigned long addr, |
11 | unsigned long len, | 12 | unsigned long len, |
diff --git a/include/linux/rcuclassic.h b/include/linux/rcuclassic.h index 4ab843622727..5f89b62e6983 100644 --- a/include/linux/rcuclassic.h +++ b/include/linux/rcuclassic.h | |||
@@ -40,12 +40,21 @@ | |||
40 | #include <linux/cpumask.h> | 40 | #include <linux/cpumask.h> |
41 | #include <linux/seqlock.h> | 41 | #include <linux/seqlock.h> |
42 | 42 | ||
43 | #ifdef CONFIG_RCU_CPU_STALL_DETECTOR | ||
44 | #define RCU_SECONDS_TILL_STALL_CHECK ( 3 * HZ) /* for rcp->jiffies_stall */ | ||
45 | #define RCU_SECONDS_TILL_STALL_RECHECK (30 * HZ) /* for rcp->jiffies_stall */ | ||
46 | #endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ | ||
43 | 47 | ||
44 | /* Global control variables for rcupdate callback mechanism. */ | 48 | /* Global control variables for rcupdate callback mechanism. */ |
45 | struct rcu_ctrlblk { | 49 | struct rcu_ctrlblk { |
46 | long cur; /* Current batch number. */ | 50 | long cur; /* Current batch number. */ |
47 | long completed; /* Number of the last completed batch */ | 51 | long completed; /* Number of the last completed batch */ |
48 | int next_pending; /* Is the next batch already waiting? */ | 52 | long pending; /* Number of the last pending batch */ |
53 | #ifdef CONFIG_RCU_CPU_STALL_DETECTOR | ||
54 | unsigned long gp_start; /* Time at which GP started in jiffies. */ | ||
55 | unsigned long jiffies_stall; | ||
56 | /* Time at which to check for CPU stalls. */ | ||
57 | #endif /* #ifdef CONFIG_RCU_CPU_STALL_DETECTOR */ | ||
49 | 58 | ||
50 | int signaled; | 59 | int signaled; |
51 | 60 | ||
@@ -66,11 +75,7 @@ static inline int rcu_batch_after(long a, long b) | |||
66 | return (a - b) > 0; | 75 | return (a - b) > 0; |
67 | } | 76 | } |
68 | 77 | ||
69 | /* | 78 | /* Per-CPU data for Read-Copy UPdate. */ |
70 | * Per-CPU data for Read-Copy UPdate. | ||
71 | * nxtlist - new callbacks are added here | ||
72 | * curlist - current batch for which quiescent cycle started if any | ||
73 | */ | ||
74 | struct rcu_data { | 79 | struct rcu_data { |
75 | /* 1) quiescent state handling : */ | 80 | /* 1) quiescent state handling : */ |
76 | long quiescbatch; /* Batch # for grace period */ | 81 | long quiescbatch; /* Batch # for grace period */ |
@@ -78,12 +83,24 @@ struct rcu_data { | |||
78 | int qs_pending; /* core waits for quiesc state */ | 83 | int qs_pending; /* core waits for quiesc state */ |
79 | 84 | ||
80 | /* 2) batch handling */ | 85 | /* 2) batch handling */ |
81 | long batch; /* Batch # for current RCU batch */ | 86 | /* |
87 | * if nxtlist is not NULL, then: | ||
88 | * batch: | ||
89 | * The batch # for the last entry of nxtlist | ||
90 | * [*nxttail[1], NULL = *nxttail[2]): | ||
91 | * Entries that batch # <= batch | ||
92 | * [*nxttail[0], *nxttail[1]): | ||
93 | * Entries that batch # <= batch - 1 | ||
94 | * [nxtlist, *nxttail[0]): | ||
95 | * Entries that batch # <= batch - 2 | ||
96 | * The grace period for these entries has completed, and | ||
97 | * the other grace-period-completed entries may be moved | ||
98 | * here temporarily in rcu_process_callbacks(). | ||
99 | */ | ||
100 | long batch; | ||
82 | struct rcu_head *nxtlist; | 101 | struct rcu_head *nxtlist; |
83 | struct rcu_head **nxttail; | 102 | struct rcu_head **nxttail[3]; |
84 | long qlen; /* # of queued callbacks */ | 103 | long qlen; /* # of queued callbacks */ |
85 | struct rcu_head *curlist; | ||
86 | struct rcu_head **curtail; | ||
87 | struct rcu_head *donelist; | 104 | struct rcu_head *donelist; |
88 | struct rcu_head **donetail; | 105 | struct rcu_head **donetail; |
89 | long blimit; /* Upper limit on a processed batch */ | 106 | long blimit; /* Upper limit on a processed batch */ |
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index eb4443c7e05b..e649bd3f2c97 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
@@ -198,20 +198,6 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
198 | at->prev = last; | 198 | at->prev = last; |
199 | } | 199 | } |
200 | 200 | ||
201 | /** | ||
202 | * list_for_each_rcu - iterate over an rcu-protected list | ||
203 | * @pos: the &struct list_head to use as a loop cursor. | ||
204 | * @head: the head for your list. | ||
205 | * | ||
206 | * This list-traversal primitive may safely run concurrently with | ||
207 | * the _rcu list-mutation primitives such as list_add_rcu() | ||
208 | * as long as the traversal is guarded by rcu_read_lock(). | ||
209 | */ | ||
210 | #define list_for_each_rcu(pos, head) \ | ||
211 | for (pos = rcu_dereference((head)->next); \ | ||
212 | prefetch(pos->next), pos != (head); \ | ||
213 | pos = rcu_dereference(pos->next)) | ||
214 | |||
215 | #define __list_for_each_rcu(pos, head) \ | 201 | #define __list_for_each_rcu(pos, head) \ |
216 | for (pos = rcu_dereference((head)->next); \ | 202 | for (pos = rcu_dereference((head)->next); \ |
217 | pos != (head); \ | 203 | pos != (head); \ |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index e8b4039cfb2f..86f1f5e43e33 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -133,6 +133,26 @@ struct rcu_head { | |||
133 | #define rcu_read_unlock_bh() __rcu_read_unlock_bh() | 133 | #define rcu_read_unlock_bh() __rcu_read_unlock_bh() |
134 | 134 | ||
135 | /** | 135 | /** |
136 | * rcu_read_lock_sched - mark the beginning of a RCU-classic critical section | ||
137 | * | ||
138 | * Should be used with either | ||
139 | * - synchronize_sched() | ||
140 | * or | ||
141 | * - call_rcu_sched() and rcu_barrier_sched() | ||
142 | * on the write-side to insure proper synchronization. | ||
143 | */ | ||
144 | #define rcu_read_lock_sched() preempt_disable() | ||
145 | |||
146 | /* | ||
147 | * rcu_read_unlock_sched - marks the end of a RCU-classic critical section | ||
148 | * | ||
149 | * See rcu_read_lock_sched for more information. | ||
150 | */ | ||
151 | #define rcu_read_unlock_sched() preempt_enable() | ||
152 | |||
153 | |||
154 | |||
155 | /** | ||
136 | * rcu_dereference - fetch an RCU-protected pointer in an | 156 | * rcu_dereference - fetch an RCU-protected pointer in an |
137 | * RCU read-side critical section. This pointer may later | 157 | * RCU read-side critical section. This pointer may later |
138 | * be safely dereferenced. | 158 | * be safely dereferenced. |
diff --git a/include/linux/rcupreempt.h b/include/linux/rcupreempt.h index 0967f03b0705..3e05c09b54a2 100644 --- a/include/linux/rcupreempt.h +++ b/include/linux/rcupreempt.h | |||
@@ -57,7 +57,13 @@ static inline void rcu_qsctr_inc(int cpu) | |||
57 | rdssp->sched_qs++; | 57 | rdssp->sched_qs++; |
58 | } | 58 | } |
59 | #define rcu_bh_qsctr_inc(cpu) | 59 | #define rcu_bh_qsctr_inc(cpu) |
60 | #define call_rcu_bh(head, rcu) call_rcu(head, rcu) | 60 | |
61 | /* | ||
62 | * Someone might want to pass call_rcu_bh as a function pointer. | ||
63 | * So this needs to just be a rename and not a macro function. | ||
64 | * (no parentheses) | ||
65 | */ | ||
66 | #define call_rcu_bh call_rcu | ||
61 | 67 | ||
62 | /** | 68 | /** |
63 | * call_rcu_sched - Queue RCU callback for invocation after sched grace period. | 69 | * call_rcu_sched - Queue RCU callback for invocation after sched grace period. |
@@ -111,7 +117,6 @@ extern struct rcupreempt_trace *rcupreempt_trace_cpu(int cpu); | |||
111 | struct softirq_action; | 117 | struct softirq_action; |
112 | 118 | ||
113 | #ifdef CONFIG_NO_HZ | 119 | #ifdef CONFIG_NO_HZ |
114 | DECLARE_PER_CPU(struct rcu_dyntick_sched, rcu_dyntick_sched); | ||
115 | 120 | ||
116 | static inline void rcu_enter_nohz(void) | 121 | static inline void rcu_enter_nohz(void) |
117 | { | 122 | { |
@@ -126,8 +131,8 @@ static inline void rcu_exit_nohz(void) | |||
126 | { | 131 | { |
127 | static DEFINE_RATELIMIT_STATE(rs, 10 * HZ, 1); | 132 | static DEFINE_RATELIMIT_STATE(rs, 10 * HZ, 1); |
128 | 133 | ||
129 | smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */ | ||
130 | __get_cpu_var(rcu_dyntick_sched).dynticks++; | 134 | __get_cpu_var(rcu_dyntick_sched).dynticks++; |
135 | smp_mb(); /* CPUs seeing ++ must see later RCU read-side crit sects */ | ||
131 | WARN_ON_RATELIMIT(!(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1), | 136 | WARN_ON_RATELIMIT(!(__get_cpu_var(rcu_dyntick_sched).dynticks & 0x1), |
132 | &rs); | 137 | &rs); |
133 | } | 138 | } |
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h index 741d1a62cc3f..4cd64b0d9825 100644 --- a/include/linux/rfkill.h +++ b/include/linux/rfkill.h | |||
@@ -49,6 +49,7 @@ enum rfkill_state { | |||
49 | RFKILL_STATE_SOFT_BLOCKED = 0, /* Radio output blocked */ | 49 | RFKILL_STATE_SOFT_BLOCKED = 0, /* Radio output blocked */ |
50 | RFKILL_STATE_UNBLOCKED = 1, /* Radio output allowed */ | 50 | RFKILL_STATE_UNBLOCKED = 1, /* Radio output allowed */ |
51 | RFKILL_STATE_HARD_BLOCKED = 2, /* Output blocked, non-overrideable */ | 51 | RFKILL_STATE_HARD_BLOCKED = 2, /* Output blocked, non-overrideable */ |
52 | RFKILL_STATE_MAX, /* marker for last valid state */ | ||
52 | }; | 53 | }; |
53 | 54 | ||
54 | /* | 55 | /* |
@@ -110,12 +111,14 @@ struct rfkill { | |||
110 | }; | 111 | }; |
111 | #define to_rfkill(d) container_of(d, struct rfkill, dev) | 112 | #define to_rfkill(d) container_of(d, struct rfkill, dev) |
112 | 113 | ||
113 | struct rfkill *rfkill_allocate(struct device *parent, enum rfkill_type type); | 114 | struct rfkill * __must_check rfkill_allocate(struct device *parent, |
115 | enum rfkill_type type); | ||
114 | void rfkill_free(struct rfkill *rfkill); | 116 | void rfkill_free(struct rfkill *rfkill); |
115 | int rfkill_register(struct rfkill *rfkill); | 117 | int __must_check rfkill_register(struct rfkill *rfkill); |
116 | void rfkill_unregister(struct rfkill *rfkill); | 118 | void rfkill_unregister(struct rfkill *rfkill); |
117 | 119 | ||
118 | int rfkill_force_state(struct rfkill *rfkill, enum rfkill_state state); | 120 | int rfkill_force_state(struct rfkill *rfkill, enum rfkill_state state); |
121 | int rfkill_set_default(enum rfkill_type type, enum rfkill_state state); | ||
119 | 122 | ||
120 | /** | 123 | /** |
121 | * rfkill_state_complement - return complementar state | 124 | * rfkill_state_complement - return complementar state |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index ca643b13b026..2b3d51c6ec9c 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -582,6 +582,10 @@ enum rtnetlink_groups { | |||
582 | #define RTNLGRP_IPV6_RULE RTNLGRP_IPV6_RULE | 582 | #define RTNLGRP_IPV6_RULE RTNLGRP_IPV6_RULE |
583 | RTNLGRP_ND_USEROPT, | 583 | RTNLGRP_ND_USEROPT, |
584 | #define RTNLGRP_ND_USEROPT RTNLGRP_ND_USEROPT | 584 | #define RTNLGRP_ND_USEROPT RTNLGRP_ND_USEROPT |
585 | RTNLGRP_PHONET_IFADDR, | ||
586 | #define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR | ||
587 | RTNLGRP_PHONET_ROUTE, | ||
588 | #define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE | ||
585 | __RTNLGRP_MAX | 589 | __RTNLGRP_MAX |
586 | }; | 590 | }; |
587 | #define RTNLGRP_MAX (__RTNLGRP_MAX - 1) | 591 | #define RTNLGRP_MAX (__RTNLGRP_MAX - 1) |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 3d9120c5ad15..5d0819ee442a 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -451,8 +451,8 @@ struct signal_struct { | |||
451 | * - everyone except group_exit_task is stopped during signal delivery | 451 | * - everyone except group_exit_task is stopped during signal delivery |
452 | * of fatal signals, group_exit_task processes the signal. | 452 | * of fatal signals, group_exit_task processes the signal. |
453 | */ | 453 | */ |
454 | struct task_struct *group_exit_task; | ||
455 | int notify_count; | 454 | int notify_count; |
455 | struct task_struct *group_exit_task; | ||
456 | 456 | ||
457 | /* thread group stop support, overloads group_exit_code too */ | 457 | /* thread group stop support, overloads group_exit_code too */ |
458 | int group_stop_count; | 458 | int group_stop_count; |
@@ -824,6 +824,9 @@ struct sched_domain { | |||
824 | unsigned int ttwu_move_affine; | 824 | unsigned int ttwu_move_affine; |
825 | unsigned int ttwu_move_balance; | 825 | unsigned int ttwu_move_balance; |
826 | #endif | 826 | #endif |
827 | #ifdef CONFIG_SCHED_DEBUG | ||
828 | char *name; | ||
829 | #endif | ||
827 | }; | 830 | }; |
828 | 831 | ||
829 | extern void partition_sched_domains(int ndoms_new, cpumask_t *doms_new, | 832 | extern void partition_sched_domains(int ndoms_new, cpumask_t *doms_new, |
@@ -897,7 +900,7 @@ struct sched_class { | |||
897 | void (*yield_task) (struct rq *rq); | 900 | void (*yield_task) (struct rq *rq); |
898 | int (*select_task_rq)(struct task_struct *p, int sync); | 901 | int (*select_task_rq)(struct task_struct *p, int sync); |
899 | 902 | ||
900 | void (*check_preempt_curr) (struct rq *rq, struct task_struct *p); | 903 | void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int sync); |
901 | 904 | ||
902 | struct task_struct * (*pick_next_task) (struct rq *rq); | 905 | struct task_struct * (*pick_next_task) (struct rq *rq); |
903 | void (*put_prev_task) (struct rq *rq, struct task_struct *p); | 906 | void (*put_prev_task) (struct rq *rq, struct task_struct *p); |
@@ -1010,8 +1013,8 @@ struct sched_entity { | |||
1010 | 1013 | ||
1011 | struct sched_rt_entity { | 1014 | struct sched_rt_entity { |
1012 | struct list_head run_list; | 1015 | struct list_head run_list; |
1013 | unsigned int time_slice; | ||
1014 | unsigned long timeout; | 1016 | unsigned long timeout; |
1017 | unsigned int time_slice; | ||
1015 | int nr_cpus_allowed; | 1018 | int nr_cpus_allowed; |
1016 | 1019 | ||
1017 | struct sched_rt_entity *back; | 1020 | struct sched_rt_entity *back; |
diff --git a/include/linux/security.h b/include/linux/security.h index 80c4d002864c..f5c4a51eb42e 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -1560,11 +1560,6 @@ struct security_operations { | |||
1560 | extern int security_init(void); | 1560 | extern int security_init(void); |
1561 | extern int security_module_enable(struct security_operations *ops); | 1561 | extern int security_module_enable(struct security_operations *ops); |
1562 | extern int register_security(struct security_operations *ops); | 1562 | extern int register_security(struct security_operations *ops); |
1563 | extern struct dentry *securityfs_create_file(const char *name, mode_t mode, | ||
1564 | struct dentry *parent, void *data, | ||
1565 | const struct file_operations *fops); | ||
1566 | extern struct dentry *securityfs_create_dir(const char *name, struct dentry *parent); | ||
1567 | extern void securityfs_remove(struct dentry *dentry); | ||
1568 | 1563 | ||
1569 | /* Security operations */ | 1564 | /* Security operations */ |
1570 | int security_ptrace_may_access(struct task_struct *child, unsigned int mode); | 1565 | int security_ptrace_may_access(struct task_struct *child, unsigned int mode); |
@@ -2424,25 +2419,6 @@ static inline int security_netlink_recv(struct sk_buff *skb, int cap) | |||
2424 | return cap_netlink_recv(skb, cap); | 2419 | return cap_netlink_recv(skb, cap); |
2425 | } | 2420 | } |
2426 | 2421 | ||
2427 | static inline struct dentry *securityfs_create_dir(const char *name, | ||
2428 | struct dentry *parent) | ||
2429 | { | ||
2430 | return ERR_PTR(-ENODEV); | ||
2431 | } | ||
2432 | |||
2433 | static inline struct dentry *securityfs_create_file(const char *name, | ||
2434 | mode_t mode, | ||
2435 | struct dentry *parent, | ||
2436 | void *data, | ||
2437 | const struct file_operations *fops) | ||
2438 | { | ||
2439 | return ERR_PTR(-ENODEV); | ||
2440 | } | ||
2441 | |||
2442 | static inline void securityfs_remove(struct dentry *dentry) | ||
2443 | { | ||
2444 | } | ||
2445 | |||
2446 | static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen) | 2422 | static inline int security_secid_to_secctx(u32 secid, char **secdata, u32 *seclen) |
2447 | { | 2423 | { |
2448 | return -EOPNOTSUPP; | 2424 | return -EOPNOTSUPP; |
@@ -2806,5 +2782,35 @@ static inline void security_audit_rule_free(void *lsmrule) | |||
2806 | #endif /* CONFIG_SECURITY */ | 2782 | #endif /* CONFIG_SECURITY */ |
2807 | #endif /* CONFIG_AUDIT */ | 2783 | #endif /* CONFIG_AUDIT */ |
2808 | 2784 | ||
2785 | #ifdef CONFIG_SECURITYFS | ||
2786 | |||
2787 | extern struct dentry *securityfs_create_file(const char *name, mode_t mode, | ||
2788 | struct dentry *parent, void *data, | ||
2789 | const struct file_operations *fops); | ||
2790 | extern struct dentry *securityfs_create_dir(const char *name, struct dentry *parent); | ||
2791 | extern void securityfs_remove(struct dentry *dentry); | ||
2792 | |||
2793 | #else /* CONFIG_SECURITYFS */ | ||
2794 | |||
2795 | static inline struct dentry *securityfs_create_dir(const char *name, | ||
2796 | struct dentry *parent) | ||
2797 | { | ||
2798 | return ERR_PTR(-ENODEV); | ||
2799 | } | ||
2800 | |||
2801 | static inline struct dentry *securityfs_create_file(const char *name, | ||
2802 | mode_t mode, | ||
2803 | struct dentry *parent, | ||
2804 | void *data, | ||
2805 | const struct file_operations *fops) | ||
2806 | { | ||
2807 | return ERR_PTR(-ENODEV); | ||
2808 | } | ||
2809 | |||
2810 | static inline void securityfs_remove(struct dentry *dentry) | ||
2811 | {} | ||
2812 | |||
2813 | #endif | ||
2814 | |||
2809 | #endif /* ! __LINUX_SECURITY_H */ | 2815 | #endif /* ! __LINUX_SECURITY_H */ |
2810 | 2816 | ||
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 909923717830..2725f4e5a9bf 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -146,8 +146,14 @@ struct skb_shared_info { | |||
146 | unsigned short gso_segs; | 146 | unsigned short gso_segs; |
147 | unsigned short gso_type; | 147 | unsigned short gso_type; |
148 | __be32 ip6_frag_id; | 148 | __be32 ip6_frag_id; |
149 | #ifdef CONFIG_HAS_DMA | ||
150 | unsigned int num_dma_maps; | ||
151 | #endif | ||
149 | struct sk_buff *frag_list; | 152 | struct sk_buff *frag_list; |
150 | skb_frag_t frags[MAX_SKB_FRAGS]; | 153 | skb_frag_t frags[MAX_SKB_FRAGS]; |
154 | #ifdef CONFIG_HAS_DMA | ||
155 | dma_addr_t dma_maps[MAX_SKB_FRAGS + 1]; | ||
156 | #endif | ||
151 | }; | 157 | }; |
152 | 158 | ||
153 | /* We divide dataref into two halves. The higher 16 bits hold references | 159 | /* We divide dataref into two halves. The higher 16 bits hold references |
@@ -353,6 +359,14 @@ struct sk_buff { | |||
353 | 359 | ||
354 | #include <asm/system.h> | 360 | #include <asm/system.h> |
355 | 361 | ||
362 | #ifdef CONFIG_HAS_DMA | ||
363 | #include <linux/dma-mapping.h> | ||
364 | extern int skb_dma_map(struct device *dev, struct sk_buff *skb, | ||
365 | enum dma_data_direction dir); | ||
366 | extern void skb_dma_unmap(struct device *dev, struct sk_buff *skb, | ||
367 | enum dma_data_direction dir); | ||
368 | #endif | ||
369 | |||
356 | extern void kfree_skb(struct sk_buff *skb); | 370 | extern void kfree_skb(struct sk_buff *skb); |
357 | extern void __kfree_skb(struct sk_buff *skb); | 371 | extern void __kfree_skb(struct sk_buff *skb); |
358 | extern struct sk_buff *__alloc_skb(unsigned int size, | 372 | extern struct sk_buff *__alloc_skb(unsigned int size, |
@@ -369,6 +383,8 @@ static inline struct sk_buff *alloc_skb_fclone(unsigned int size, | |||
369 | return __alloc_skb(size, priority, 1, -1); | 383 | return __alloc_skb(size, priority, 1, -1); |
370 | } | 384 | } |
371 | 385 | ||
386 | extern int skb_recycle_check(struct sk_buff *skb, int skb_size); | ||
387 | |||
372 | extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src); | 388 | extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src); |
373 | extern struct sk_buff *skb_clone(struct sk_buff *skb, | 389 | extern struct sk_buff *skb_clone(struct sk_buff *skb, |
374 | gfp_t priority); | 390 | gfp_t priority); |
@@ -459,6 +475,37 @@ static inline int skb_queue_empty(const struct sk_buff_head *list) | |||
459 | } | 475 | } |
460 | 476 | ||
461 | /** | 477 | /** |
478 | * skb_queue_is_last - check if skb is the last entry in the queue | ||
479 | * @list: queue head | ||
480 | * @skb: buffer | ||
481 | * | ||
482 | * Returns true if @skb is the last buffer on the list. | ||
483 | */ | ||
484 | static inline bool skb_queue_is_last(const struct sk_buff_head *list, | ||
485 | const struct sk_buff *skb) | ||
486 | { | ||
487 | return (skb->next == (struct sk_buff *) list); | ||
488 | } | ||
489 | |||
490 | /** | ||
491 | * skb_queue_next - return the next packet in the queue | ||
492 | * @list: queue head | ||
493 | * @skb: current buffer | ||
494 | * | ||
495 | * Return the next packet in @list after @skb. It is only valid to | ||
496 | * call this if skb_queue_is_last() evaluates to false. | ||
497 | */ | ||
498 | static inline struct sk_buff *skb_queue_next(const struct sk_buff_head *list, | ||
499 | const struct sk_buff *skb) | ||
500 | { | ||
501 | /* This BUG_ON may seem severe, but if we just return then we | ||
502 | * are going to dereference garbage. | ||
503 | */ | ||
504 | BUG_ON(skb_queue_is_last(list, skb)); | ||
505 | return skb->next; | ||
506 | } | ||
507 | |||
508 | /** | ||
462 | * skb_get - reference buffer | 509 | * skb_get - reference buffer |
463 | * @skb: buffer to reference | 510 | * @skb: buffer to reference |
464 | * | 511 | * |
@@ -646,6 +693,22 @@ static inline __u32 skb_queue_len(const struct sk_buff_head *list_) | |||
646 | return list_->qlen; | 693 | return list_->qlen; |
647 | } | 694 | } |
648 | 695 | ||
696 | /** | ||
697 | * __skb_queue_head_init - initialize non-spinlock portions of sk_buff_head | ||
698 | * @list: queue to initialize | ||
699 | * | ||
700 | * This initializes only the list and queue length aspects of | ||
701 | * an sk_buff_head object. This allows to initialize the list | ||
702 | * aspects of an sk_buff_head without reinitializing things like | ||
703 | * the spinlock. It can also be used for on-stack sk_buff_head | ||
704 | * objects where the spinlock is known to not be used. | ||
705 | */ | ||
706 | static inline void __skb_queue_head_init(struct sk_buff_head *list) | ||
707 | { | ||
708 | list->prev = list->next = (struct sk_buff *)list; | ||
709 | list->qlen = 0; | ||
710 | } | ||
711 | |||
649 | /* | 712 | /* |
650 | * This function creates a split out lock class for each invocation; | 713 | * This function creates a split out lock class for each invocation; |
651 | * this is needed for now since a whole lot of users of the skb-queue | 714 | * this is needed for now since a whole lot of users of the skb-queue |
@@ -657,8 +720,7 @@ static inline __u32 skb_queue_len(const struct sk_buff_head *list_) | |||
657 | static inline void skb_queue_head_init(struct sk_buff_head *list) | 720 | static inline void skb_queue_head_init(struct sk_buff_head *list) |
658 | { | 721 | { |
659 | spin_lock_init(&list->lock); | 722 | spin_lock_init(&list->lock); |
660 | list->prev = list->next = (struct sk_buff *)list; | 723 | __skb_queue_head_init(list); |
661 | list->qlen = 0; | ||
662 | } | 724 | } |
663 | 725 | ||
664 | static inline void skb_queue_head_init_class(struct sk_buff_head *list, | 726 | static inline void skb_queue_head_init_class(struct sk_buff_head *list, |
@@ -685,6 +747,83 @@ static inline void __skb_insert(struct sk_buff *newsk, | |||
685 | list->qlen++; | 747 | list->qlen++; |
686 | } | 748 | } |
687 | 749 | ||
750 | static inline void __skb_queue_splice(const struct sk_buff_head *list, | ||
751 | struct sk_buff *prev, | ||
752 | struct sk_buff *next) | ||
753 | { | ||
754 | struct sk_buff *first = list->next; | ||
755 | struct sk_buff *last = list->prev; | ||
756 | |||
757 | first->prev = prev; | ||
758 | prev->next = first; | ||
759 | |||
760 | last->next = next; | ||
761 | next->prev = last; | ||
762 | } | ||
763 | |||
764 | /** | ||
765 | * skb_queue_splice - join two skb lists, this is designed for stacks | ||
766 | * @list: the new list to add | ||
767 | * @head: the place to add it in the first list | ||
768 | */ | ||
769 | static inline void skb_queue_splice(const struct sk_buff_head *list, | ||
770 | struct sk_buff_head *head) | ||
771 | { | ||
772 | if (!skb_queue_empty(list)) { | ||
773 | __skb_queue_splice(list, (struct sk_buff *) head, head->next); | ||
774 | head->qlen += list->qlen; | ||
775 | } | ||
776 | } | ||
777 | |||
778 | /** | ||
779 | * skb_queue_splice - join two skb lists and reinitialise the emptied list | ||
780 | * @list: the new list to add | ||
781 | * @head: the place to add it in the first list | ||
782 | * | ||
783 | * The list at @list is reinitialised | ||
784 | */ | ||
785 | static inline void skb_queue_splice_init(struct sk_buff_head *list, | ||
786 | struct sk_buff_head *head) | ||
787 | { | ||
788 | if (!skb_queue_empty(list)) { | ||
789 | __skb_queue_splice(list, (struct sk_buff *) head, head->next); | ||
790 | head->qlen += list->qlen; | ||
791 | __skb_queue_head_init(list); | ||
792 | } | ||
793 | } | ||
794 | |||
795 | /** | ||
796 | * skb_queue_splice_tail - join two skb lists, each list being a queue | ||
797 | * @list: the new list to add | ||
798 | * @head: the place to add it in the first list | ||
799 | */ | ||
800 | static inline void skb_queue_splice_tail(const struct sk_buff_head *list, | ||
801 | struct sk_buff_head *head) | ||
802 | { | ||
803 | if (!skb_queue_empty(list)) { | ||
804 | __skb_queue_splice(list, head->prev, (struct sk_buff *) head); | ||
805 | head->qlen += list->qlen; | ||
806 | } | ||
807 | } | ||
808 | |||
809 | /** | ||
810 | * skb_queue_splice_tail - join two skb lists and reinitialise the emptied list | ||
811 | * @list: the new list to add | ||
812 | * @head: the place to add it in the first list | ||
813 | * | ||
814 | * Each of the lists is a queue. | ||
815 | * The list at @list is reinitialised | ||
816 | */ | ||
817 | static inline void skb_queue_splice_tail_init(struct sk_buff_head *list, | ||
818 | struct sk_buff_head *head) | ||
819 | { | ||
820 | if (!skb_queue_empty(list)) { | ||
821 | __skb_queue_splice(list, head->prev, (struct sk_buff *) head); | ||
822 | head->qlen += list->qlen; | ||
823 | __skb_queue_head_init(list); | ||
824 | } | ||
825 | } | ||
826 | |||
688 | /** | 827 | /** |
689 | * __skb_queue_after - queue a buffer at the list head | 828 | * __skb_queue_after - queue a buffer at the list head |
690 | * @list: list to use | 829 | * @list: list to use |
@@ -829,6 +968,9 @@ static inline void skb_fill_page_desc(struct sk_buff *skb, int i, | |||
829 | skb_shinfo(skb)->nr_frags = i + 1; | 968 | skb_shinfo(skb)->nr_frags = i + 1; |
830 | } | 969 | } |
831 | 970 | ||
971 | extern void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, | ||
972 | int off, int size); | ||
973 | |||
832 | #define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags) | 974 | #define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags) |
833 | #define SKB_FRAG_ASSERT(skb) BUG_ON(skb_shinfo(skb)->frag_list) | 975 | #define SKB_FRAG_ASSERT(skb) BUG_ON(skb_shinfo(skb)->frag_list) |
834 | #define SKB_LINEAR_ASSERT(skb) BUG_ON(skb_is_nonlinear(skb)) | 976 | #define SKB_LINEAR_ASSERT(skb) BUG_ON(skb_is_nonlinear(skb)) |
@@ -1243,6 +1385,26 @@ static inline struct sk_buff *netdev_alloc_skb(struct net_device *dev, | |||
1243 | return __netdev_alloc_skb(dev, length, GFP_ATOMIC); | 1385 | return __netdev_alloc_skb(dev, length, GFP_ATOMIC); |
1244 | } | 1386 | } |
1245 | 1387 | ||
1388 | extern struct page *__netdev_alloc_page(struct net_device *dev, gfp_t gfp_mask); | ||
1389 | |||
1390 | /** | ||
1391 | * netdev_alloc_page - allocate a page for ps-rx on a specific device | ||
1392 | * @dev: network device to receive on | ||
1393 | * | ||
1394 | * Allocate a new page node local to the specified device. | ||
1395 | * | ||
1396 | * %NULL is returned if there is no free memory. | ||
1397 | */ | ||
1398 | static inline struct page *netdev_alloc_page(struct net_device *dev) | ||
1399 | { | ||
1400 | return __netdev_alloc_page(dev, GFP_ATOMIC); | ||
1401 | } | ||
1402 | |||
1403 | static inline void netdev_free_page(struct net_device *dev, struct page *page) | ||
1404 | { | ||
1405 | __free_page(page); | ||
1406 | } | ||
1407 | |||
1246 | /** | 1408 | /** |
1247 | * skb_clone_writable - is the header of a clone writable | 1409 | * skb_clone_writable - is the header of a clone writable |
1248 | * @skb: buffer to check | 1410 | * @skb: buffer to check |
@@ -1434,6 +1596,15 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) | |||
1434 | skb != (struct sk_buff *)(queue); \ | 1596 | skb != (struct sk_buff *)(queue); \ |
1435 | skb = tmp, tmp = skb->next) | 1597 | skb = tmp, tmp = skb->next) |
1436 | 1598 | ||
1599 | #define skb_queue_walk_from(queue, skb) \ | ||
1600 | for (; prefetch(skb->next), (skb != (struct sk_buff *)(queue)); \ | ||
1601 | skb = skb->next) | ||
1602 | |||
1603 | #define skb_queue_walk_from_safe(queue, skb, tmp) \ | ||
1604 | for (tmp = skb->next; \ | ||
1605 | skb != (struct sk_buff *)(queue); \ | ||
1606 | skb = tmp, tmp = skb->next) | ||
1607 | |||
1437 | #define skb_queue_reverse_walk(queue, skb) \ | 1608 | #define skb_queue_reverse_walk(queue, skb) \ |
1438 | for (skb = (queue)->prev; \ | 1609 | for (skb = (queue)->prev; \ |
1439 | prefetch(skb->prev), (skb != (struct sk_buff *)(queue)); \ | 1610 | prefetch(skb->prev), (skb != (struct sk_buff *)(queue)); \ |
diff --git a/include/linux/smb.h b/include/linux/smb.h index caa43b2370cb..82fefddc5987 100644 --- a/include/linux/smb.h +++ b/include/linux/smb.h | |||
@@ -11,7 +11,9 @@ | |||
11 | 11 | ||
12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
13 | #include <linux/magic.h> | 13 | #include <linux/magic.h> |
14 | #ifdef __KERNEL__ | ||
14 | #include <linux/time.h> | 15 | #include <linux/time.h> |
16 | #endif | ||
15 | 17 | ||
16 | enum smb_protocol { | 18 | enum smb_protocol { |
17 | SMB_PROTOCOL_NONE, | 19 | SMB_PROTOCOL_NONE, |
diff --git a/include/linux/smc91x.h b/include/linux/smc91x.h index 3827b922ba1f..bc21db598c06 100644 --- a/include/linux/smc91x.h +++ b/include/linux/smc91x.h | |||
@@ -16,8 +16,19 @@ | |||
16 | 16 | ||
17 | #define SMC91X_USE_DMA (1 << 6) | 17 | #define SMC91X_USE_DMA (1 << 6) |
18 | 18 | ||
19 | #define RPC_LED_100_10 (0x00) /* LED = 100Mbps OR's with 10Mbps link detect */ | ||
20 | #define RPC_LED_RES (0x01) /* LED = Reserved */ | ||
21 | #define RPC_LED_10 (0x02) /* LED = 10Mbps link detect */ | ||
22 | #define RPC_LED_FD (0x03) /* LED = Full Duplex Mode */ | ||
23 | #define RPC_LED_TX_RX (0x04) /* LED = TX or RX packet occurred */ | ||
24 | #define RPC_LED_100 (0x05) /* LED = 100Mbps link dectect */ | ||
25 | #define RPC_LED_TX (0x06) /* LED = TX packet occurred */ | ||
26 | #define RPC_LED_RX (0x07) /* LED = RX packet occurred */ | ||
27 | |||
19 | struct smc91x_platdata { | 28 | struct smc91x_platdata { |
20 | unsigned long flags; | 29 | unsigned long flags; |
30 | unsigned char leda; | ||
31 | unsigned char ledb; | ||
21 | }; | 32 | }; |
22 | 33 | ||
23 | #endif /* __SMC91X_H__ */ | 34 | #endif /* __SMC91X_H__ */ |
diff --git a/include/linux/socket.h b/include/linux/socket.h index dc5086fe7736..20fc4bbfca42 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -190,7 +190,8 @@ struct ucred { | |||
190 | #define AF_IUCV 32 /* IUCV sockets */ | 190 | #define AF_IUCV 32 /* IUCV sockets */ |
191 | #define AF_RXRPC 33 /* RxRPC sockets */ | 191 | #define AF_RXRPC 33 /* RxRPC sockets */ |
192 | #define AF_ISDN 34 /* mISDN sockets */ | 192 | #define AF_ISDN 34 /* mISDN sockets */ |
193 | #define AF_MAX 35 /* For now.. */ | 193 | #define AF_PHONET 35 /* Phonet sockets */ |
194 | #define AF_MAX 36 /* For now.. */ | ||
194 | 195 | ||
195 | /* Protocol families, same as address families. */ | 196 | /* Protocol families, same as address families. */ |
196 | #define PF_UNSPEC AF_UNSPEC | 197 | #define PF_UNSPEC AF_UNSPEC |
@@ -227,6 +228,7 @@ struct ucred { | |||
227 | #define PF_IUCV AF_IUCV | 228 | #define PF_IUCV AF_IUCV |
228 | #define PF_RXRPC AF_RXRPC | 229 | #define PF_RXRPC AF_RXRPC |
229 | #define PF_ISDN AF_ISDN | 230 | #define PF_ISDN AF_ISDN |
231 | #define PF_PHONET AF_PHONET | ||
230 | #define PF_MAX AF_MAX | 232 | #define PF_MAX AF_MAX |
231 | 233 | ||
232 | /* Maximum queue length specifiable by listen. */ | 234 | /* Maximum queue length specifiable by listen. */ |
@@ -295,6 +297,7 @@ struct ucred { | |||
295 | #define SOL_RXRPC 272 | 297 | #define SOL_RXRPC 272 |
296 | #define SOL_PPPOL2TP 273 | 298 | #define SOL_PPPOL2TP 273 |
297 | #define SOL_BLUETOOTH 274 | 299 | #define SOL_BLUETOOTH 274 |
300 | #define SOL_PNPIPE 275 | ||
298 | 301 | ||
299 | /* IPX options */ | 302 | /* IPX options */ |
300 | #define IPX_TYPE 1 | 303 | #define IPX_TYPE 1 |
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h index daf744017a31..05eab2f11e63 100644 --- a/include/linux/spi/ads7846.h +++ b/include/linux/spi/ads7846.h | |||
@@ -43,6 +43,9 @@ struct ads7846_platform_data { | |||
43 | u16 debounce_tol; /* tolerance used for filtering */ | 43 | u16 debounce_tol; /* tolerance used for filtering */ |
44 | u16 debounce_rep; /* additional consecutive good readings | 44 | u16 debounce_rep; /* additional consecutive good readings |
45 | * required after the first two */ | 45 | * required after the first two */ |
46 | int gpio_pendown; /* the GPIO used to decide the pendown | ||
47 | * state if get_pendown_state == NULL | ||
48 | */ | ||
46 | int (*get_pendown_state)(void); | 49 | int (*get_pendown_state)(void); |
47 | int (*filter_init) (struct ads7846_platform_data *pdata, | 50 | int (*filter_init) (struct ads7846_platform_data *pdata, |
48 | void **filter_data); | 51 | void **filter_data); |
diff --git a/include/linux/spi/corgi_lcd.h b/include/linux/spi/corgi_lcd.h new file mode 100644 index 000000000000..6692b3418ccf --- /dev/null +++ b/include/linux/spi/corgi_lcd.h | |||
@@ -0,0 +1,20 @@ | |||
1 | #ifndef __LINUX_SPI_CORGI_LCD_H | ||
2 | #define __LINUX_SPI_CORGI_LCD_H | ||
3 | |||
4 | #define CORGI_LCD_MODE_QVGA 1 | ||
5 | #define CORGI_LCD_MODE_VGA 2 | ||
6 | |||
7 | struct corgi_lcd_platform_data { | ||
8 | int init_mode; | ||
9 | int max_intensity; | ||
10 | int default_intensity; | ||
11 | int limit_mask; | ||
12 | |||
13 | int gpio_backlight_on; /* -1 if n/a */ | ||
14 | int gpio_backlight_cont; /* -1 if n/a */ | ||
15 | |||
16 | void (*notify)(int intensity); | ||
17 | void (*kick_battery)(void); | ||
18 | }; | ||
19 | |||
20 | #endif /* __LINUX_SPI_CORGI_LCD_H */ | ||
diff --git a/include/linux/ssb/ssb_regs.h b/include/linux/ssb/ssb_regs.h index ebad0bac9801..99a0f991e850 100644 --- a/include/linux/ssb/ssb_regs.h +++ b/include/linux/ssb/ssb_regs.h | |||
@@ -245,8 +245,6 @@ | |||
245 | 245 | ||
246 | /* SPROM Revision 3 (inherits most data from rev 2) */ | 246 | /* SPROM Revision 3 (inherits most data from rev 2) */ |
247 | #define SSB_SPROM3_IL0MAC 0x104A /* 6 bytes MAC address for 802.11b/g */ | 247 | #define SSB_SPROM3_IL0MAC 0x104A /* 6 bytes MAC address for 802.11b/g */ |
248 | #define SSB_SPROM3_ET0MAC 0x1050 /* 6 bytes MAC address for Ethernet ?? */ | ||
249 | #define SSB_SPROM3_ET1MAC 0x1050 /* 6 bytes MAC address for 802.11a ?? */ | ||
250 | #define SSB_SPROM3_OFDMAPO 0x102C /* A-PHY OFDM Mid Power Offset (4 bytes, BigEndian) */ | 248 | #define SSB_SPROM3_OFDMAPO 0x102C /* A-PHY OFDM Mid Power Offset (4 bytes, BigEndian) */ |
251 | #define SSB_SPROM3_OFDMALPO 0x1030 /* A-PHY OFDM Low Power Offset (4 bytes, BigEndian) */ | 249 | #define SSB_SPROM3_OFDMALPO 0x1030 /* A-PHY OFDM Low Power Offset (4 bytes, BigEndian) */ |
252 | #define SSB_SPROM3_OFDMAHPO 0x1034 /* A-PHY OFDM High Power Offset (4 bytes, BigEndian) */ | 250 | #define SSB_SPROM3_OFDMAHPO 0x1034 /* A-PHY OFDM High Power Offset (4 bytes, BigEndian) */ |
@@ -267,8 +265,6 @@ | |||
267 | 265 | ||
268 | /* SPROM Revision 4 */ | 266 | /* SPROM Revision 4 */ |
269 | #define SSB_SPROM4_IL0MAC 0x104C /* 6 byte MAC address for a/b/g/n */ | 267 | #define SSB_SPROM4_IL0MAC 0x104C /* 6 byte MAC address for a/b/g/n */ |
270 | #define SSB_SPROM4_ET0MAC 0x1018 /* 6 bytes MAC address for Ethernet ?? */ | ||
271 | #define SSB_SPROM4_ET1MAC 0x1018 /* 6 bytes MAC address for 802.11a ?? */ | ||
272 | #define SSB_SPROM4_ETHPHY 0x105A /* Ethernet PHY settings ?? */ | 268 | #define SSB_SPROM4_ETHPHY 0x105A /* Ethernet PHY settings ?? */ |
273 | #define SSB_SPROM4_ETHPHY_ET0A 0x001F /* MII Address for enet0 */ | 269 | #define SSB_SPROM4_ETHPHY_ET0A 0x001F /* MII Address for enet0 */ |
274 | #define SSB_SPROM4_ETHPHY_ET1A 0x03E0 /* MII Address for enet1 */ | 270 | #define SSB_SPROM4_ETHPHY_ET1A 0x03E0 /* MII Address for enet1 */ |
@@ -316,6 +312,21 @@ | |||
316 | #define SSB_SPROM4_PA1B1 0x1090 | 312 | #define SSB_SPROM4_PA1B1 0x1090 |
317 | #define SSB_SPROM4_PA1B2 0x1092 | 313 | #define SSB_SPROM4_PA1B2 0x1092 |
318 | 314 | ||
315 | /* SPROM Revision 5 (inherits most data from rev 4) */ | ||
316 | #define SSB_SPROM5_BFLLO 0x104A /* Boardflags (low 16 bits) */ | ||
317 | #define SSB_SPROM5_BFLHI 0x104C /* Board Flags Hi */ | ||
318 | #define SSB_SPROM5_IL0MAC 0x1052 /* 6 byte MAC address for a/b/g/n */ | ||
319 | #define SSB_SPROM5_CCODE 0x1044 /* Country Code (2 bytes) */ | ||
320 | #define SSB_SPROM5_GPIOA 0x1076 /* Gen. Purpose IO # 0 and 1 */ | ||
321 | #define SSB_SPROM5_GPIOA_P0 0x00FF /* Pin 0 */ | ||
322 | #define SSB_SPROM5_GPIOA_P1 0xFF00 /* Pin 1 */ | ||
323 | #define SSB_SPROM5_GPIOA_P1_SHIFT 8 | ||
324 | #define SSB_SPROM5_GPIOB 0x1078 /* Gen. Purpose IO # 2 and 3 */ | ||
325 | #define SSB_SPROM5_GPIOB_P2 0x00FF /* Pin 2 */ | ||
326 | #define SSB_SPROM5_GPIOB_P3 0xFF00 /* Pin 3 */ | ||
327 | #define SSB_SPROM5_GPIOB_P3_SHIFT 8 | ||
328 | |||
329 | |||
319 | /* Values for SSB_SPROM1_BINF_CCODE */ | 330 | /* Values for SSB_SPROM1_BINF_CCODE */ |
320 | enum { | 331 | enum { |
321 | SSB_SPROM1CCODE_WORLD = 0, | 332 | SSB_SPROM1CCODE_WORLD = 0, |
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h index 5da9794b2d78..b106fd8e0d5c 100644 --- a/include/linux/stacktrace.h +++ b/include/linux/stacktrace.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef __LINUX_STACKTRACE_H | 1 | #ifndef __LINUX_STACKTRACE_H |
2 | #define __LINUX_STACKTRACE_H | 2 | #define __LINUX_STACKTRACE_H |
3 | 3 | ||
4 | struct task_struct; | ||
5 | |||
4 | #ifdef CONFIG_STACKTRACE | 6 | #ifdef CONFIG_STACKTRACE |
5 | struct stack_trace { | 7 | struct stack_trace { |
6 | unsigned int nr_entries, max_entries; | 8 | unsigned int nr_entries, max_entries; |
diff --git a/include/linux/string_helpers.h b/include/linux/string_helpers.h new file mode 100644 index 000000000000..a3eb2f65b656 --- /dev/null +++ b/include/linux/string_helpers.h | |||
@@ -0,0 +1,16 @@ | |||
1 | #ifndef _LINUX_STRING_HELPERS_H_ | ||
2 | #define _LINUX_STRING_HELPERS_H_ | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | |||
6 | /* Descriptions of the types of units to | ||
7 | * print in */ | ||
8 | enum string_size_units { | ||
9 | STRING_UNITS_10, /* use powers of 10^3 (standard SI) */ | ||
10 | STRING_UNITS_2, /* use binary powers of 2^10 */ | ||
11 | }; | ||
12 | |||
13 | int string_get_size(u64 size, enum string_size_units units, | ||
14 | char *buf, int len); | ||
15 | |||
16 | #endif | ||
diff --git a/include/linux/tc_act/Kbuild b/include/linux/tc_act/Kbuild index 6dac0d7365cc..76990937f4c9 100644 --- a/include/linux/tc_act/Kbuild +++ b/include/linux/tc_act/Kbuild | |||
@@ -3,3 +3,4 @@ header-y += tc_ipt.h | |||
3 | header-y += tc_mirred.h | 3 | header-y += tc_mirred.h |
4 | header-y += tc_pedit.h | 4 | header-y += tc_pedit.h |
5 | header-y += tc_nat.h | 5 | header-y += tc_nat.h |
6 | header-y += tc_skbedit.h | ||
diff --git a/include/linux/tc_act/tc_skbedit.h b/include/linux/tc_act/tc_skbedit.h new file mode 100644 index 000000000000..a14e461a7af7 --- /dev/null +++ b/include/linux/tc_act/tc_skbedit.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2008, Intel Corporation. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License along with | ||
14 | * this program; if not, write to the Free Software Foundation, Inc., 59 Temple | ||
15 | * Place - Suite 330, Boston, MA 02111-1307 USA. | ||
16 | * | ||
17 | * Author: Alexander Duyck <alexander.h.duyck@intel.com> | ||
18 | */ | ||
19 | |||
20 | #ifndef __LINUX_TC_SKBEDIT_H | ||
21 | #define __LINUX_TC_SKBEDIT_H | ||
22 | |||
23 | #include <linux/pkt_cls.h> | ||
24 | |||
25 | #define TCA_ACT_SKBEDIT 11 | ||
26 | |||
27 | #define SKBEDIT_F_PRIORITY 0x1 | ||
28 | #define SKBEDIT_F_QUEUE_MAPPING 0x2 | ||
29 | |||
30 | struct tc_skbedit { | ||
31 | tc_gen; | ||
32 | }; | ||
33 | |||
34 | enum { | ||
35 | TCA_SKBEDIT_UNSPEC, | ||
36 | TCA_SKBEDIT_TM, | ||
37 | TCA_SKBEDIT_PARMS, | ||
38 | TCA_SKBEDIT_PRIORITY, | ||
39 | TCA_SKBEDIT_QUEUE_MAPPING, | ||
40 | __TCA_SKBEDIT_MAX | ||
41 | }; | ||
42 | #define TCA_SKBEDIT_MAX (__TCA_SKBEDIT_MAX - 1) | ||
43 | |||
44 | #endif | ||
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 2e2557388e36..fe77e1499ab7 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -312,8 +312,11 @@ struct tcp_sock { | |||
312 | u32 retrans_out; /* Retransmitted packets out */ | 312 | u32 retrans_out; /* Retransmitted packets out */ |
313 | 313 | ||
314 | u16 urg_data; /* Saved octet of OOB data and control flags */ | 314 | u16 urg_data; /* Saved octet of OOB data and control flags */ |
315 | u8 urg_mode; /* In urgent mode */ | ||
316 | u8 ecn_flags; /* ECN status bits. */ | 315 | u8 ecn_flags; /* ECN status bits. */ |
316 | u8 reordering; /* Packet reordering metric. */ | ||
317 | u32 snd_up; /* Urgent pointer */ | ||
318 | |||
319 | u8 keepalive_probes; /* num of allowed keep alive probes */ | ||
317 | /* | 320 | /* |
318 | * Options received (usually on last packet, some only on SYN packets). | 321 | * Options received (usually on last packet, some only on SYN packets). |
319 | */ | 322 | */ |
@@ -342,7 +345,6 @@ struct tcp_sock { | |||
342 | struct sk_buff* lost_skb_hint; | 345 | struct sk_buff* lost_skb_hint; |
343 | struct sk_buff *scoreboard_skb_hint; | 346 | struct sk_buff *scoreboard_skb_hint; |
344 | struct sk_buff *retransmit_skb_hint; | 347 | struct sk_buff *retransmit_skb_hint; |
345 | struct sk_buff *forward_skb_hint; | ||
346 | 348 | ||
347 | struct sk_buff_head out_of_order_queue; /* Out of order segments go here */ | 349 | struct sk_buff_head out_of_order_queue; /* Out of order segments go here */ |
348 | 350 | ||
@@ -358,12 +360,10 @@ struct tcp_sock { | |||
358 | */ | 360 | */ |
359 | 361 | ||
360 | int lost_cnt_hint; | 362 | int lost_cnt_hint; |
361 | int retransmit_cnt_hint; | 363 | u32 retransmit_high; /* L-bits may be on up to this seqno */ |
362 | 364 | ||
363 | u32 lost_retrans_low; /* Sent seq after any rxmit (lowest) */ | 365 | u32 lost_retrans_low; /* Sent seq after any rxmit (lowest) */ |
364 | 366 | ||
365 | u8 reordering; /* Packet reordering metric. */ | ||
366 | u8 keepalive_probes; /* num of allowed keep alive probes */ | ||
367 | u32 prior_ssthresh; /* ssthresh saved at recovery start */ | 367 | u32 prior_ssthresh; /* ssthresh saved at recovery start */ |
368 | u32 high_seq; /* snd_nxt at onset of congestion */ | 368 | u32 high_seq; /* snd_nxt at onset of congestion */ |
369 | 369 | ||
@@ -375,8 +375,6 @@ struct tcp_sock { | |||
375 | u32 total_retrans; /* Total retransmits for entire connection */ | 375 | u32 total_retrans; /* Total retransmits for entire connection */ |
376 | 376 | ||
377 | u32 urg_seq; /* Seq of received urgent pointer */ | 377 | u32 urg_seq; /* Seq of received urgent pointer */ |
378 | u32 snd_up; /* Urgent pointer */ | ||
379 | |||
380 | unsigned int keepalive_time; /* time before keep alive takes place */ | 378 | unsigned int keepalive_time; /* time before keep alive takes place */ |
381 | unsigned int keepalive_intvl; /* time interval between keep alive probes */ | 379 | unsigned int keepalive_intvl; /* time interval between keep alive probes */ |
382 | 380 | ||
diff --git a/include/linux/tick.h b/include/linux/tick.h index 8cf8cfe2cc97..98921a3e1aa8 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h | |||
@@ -126,7 +126,7 @@ static inline ktime_t tick_nohz_get_sleep_length(void) | |||
126 | return len; | 126 | return len; |
127 | } | 127 | } |
128 | static inline void tick_nohz_stop_idle(int cpu) { } | 128 | static inline void tick_nohz_stop_idle(int cpu) { } |
129 | static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return 0; } | 129 | static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return -1; } |
130 | # endif /* !NO_HZ */ | 130 | # endif /* !NO_HZ */ |
131 | 131 | ||
132 | #endif | 132 | #endif |
diff --git a/include/linux/ucb1400.h b/include/linux/ucb1400.h new file mode 100644 index 000000000000..970473bf8d5a --- /dev/null +++ b/include/linux/ucb1400.h | |||
@@ -0,0 +1,161 @@ | |||
1 | /* | ||
2 | * Register definitions and functions for: | ||
3 | * Philips UCB1400 driver | ||
4 | * | ||
5 | * Based on ucb1400_ts: | ||
6 | * Author: Nicolas Pitre | ||
7 | * Created: September 25, 2006 | ||
8 | * Copyright: MontaVista Software, Inc. | ||
9 | * | ||
10 | * Spliting done by: Marek Vasut <marek.vasut@gmail.com> | ||
11 | * If something doesnt work and it worked before spliting, e-mail me, | ||
12 | * dont bother Nicolas please ;-) | ||
13 | * | ||
14 | * This program is free software; you can redistribute it and/or modify | ||
15 | * it under the terms of the GNU General Public License version 2 as | ||
16 | * published by the Free Software Foundation. | ||
17 | * | ||
18 | * This code is heavily based on ucb1x00-*.c copyrighted by Russell King | ||
19 | * covering the UCB1100, UCB1200 and UCB1300.. Support for the UCB1400 has | ||
20 | * been made separate from ucb1x00-core/ucb1x00-ts on Russell's request. | ||
21 | */ | ||
22 | |||
23 | #ifndef _LINUX__UCB1400_H | ||
24 | #define _LINUX__UCB1400_H | ||
25 | |||
26 | #include <sound/ac97_codec.h> | ||
27 | #include <linux/mutex.h> | ||
28 | #include <linux/platform_device.h> | ||
29 | |||
30 | /* | ||
31 | * UCB1400 AC-link registers | ||
32 | */ | ||
33 | |||
34 | #define UCB_IO_DATA 0x5a | ||
35 | #define UCB_IO_DIR 0x5c | ||
36 | #define UCB_IE_RIS 0x5e | ||
37 | #define UCB_IE_FAL 0x60 | ||
38 | #define UCB_IE_STATUS 0x62 | ||
39 | #define UCB_IE_CLEAR 0x62 | ||
40 | #define UCB_IE_ADC (1 << 11) | ||
41 | #define UCB_IE_TSPX (1 << 12) | ||
42 | |||
43 | #define UCB_TS_CR 0x64 | ||
44 | #define UCB_TS_CR_TSMX_POW (1 << 0) | ||
45 | #define UCB_TS_CR_TSPX_POW (1 << 1) | ||
46 | #define UCB_TS_CR_TSMY_POW (1 << 2) | ||
47 | #define UCB_TS_CR_TSPY_POW (1 << 3) | ||
48 | #define UCB_TS_CR_TSMX_GND (1 << 4) | ||
49 | #define UCB_TS_CR_TSPX_GND (1 << 5) | ||
50 | #define UCB_TS_CR_TSMY_GND (1 << 6) | ||
51 | #define UCB_TS_CR_TSPY_GND (1 << 7) | ||
52 | #define UCB_TS_CR_MODE_INT (0 << 8) | ||
53 | #define UCB_TS_CR_MODE_PRES (1 << 8) | ||
54 | #define UCB_TS_CR_MODE_POS (2 << 8) | ||
55 | #define UCB_TS_CR_BIAS_ENA (1 << 11) | ||
56 | #define UCB_TS_CR_TSPX_LOW (1 << 12) | ||
57 | #define UCB_TS_CR_TSMX_LOW (1 << 13) | ||
58 | |||
59 | #define UCB_ADC_CR 0x66 | ||
60 | #define UCB_ADC_SYNC_ENA (1 << 0) | ||
61 | #define UCB_ADC_VREFBYP_CON (1 << 1) | ||
62 | #define UCB_ADC_INP_TSPX (0 << 2) | ||
63 | #define UCB_ADC_INP_TSMX (1 << 2) | ||
64 | #define UCB_ADC_INP_TSPY (2 << 2) | ||
65 | #define UCB_ADC_INP_TSMY (3 << 2) | ||
66 | #define UCB_ADC_INP_AD0 (4 << 2) | ||
67 | #define UCB_ADC_INP_AD1 (5 << 2) | ||
68 | #define UCB_ADC_INP_AD2 (6 << 2) | ||
69 | #define UCB_ADC_INP_AD3 (7 << 2) | ||
70 | #define UCB_ADC_EXT_REF (1 << 5) | ||
71 | #define UCB_ADC_START (1 << 7) | ||
72 | #define UCB_ADC_ENA (1 << 15) | ||
73 | |||
74 | #define UCB_ADC_DATA 0x68 | ||
75 | #define UCB_ADC_DAT_VALID (1 << 15) | ||
76 | #define UCB_ADC_DAT_MASK 0x3ff | ||
77 | |||
78 | #define UCB_ID 0x7e | ||
79 | #define UCB_ID_1400 0x4304 | ||
80 | |||
81 | struct ucb1400_ts { | ||
82 | struct input_dev *ts_idev; | ||
83 | struct task_struct *ts_task; | ||
84 | int id; | ||
85 | wait_queue_head_t ts_wait; | ||
86 | unsigned int ts_restart:1; | ||
87 | int irq; | ||
88 | unsigned int irq_pending; /* not bit field shared */ | ||
89 | struct snd_ac97 *ac97; | ||
90 | }; | ||
91 | |||
92 | struct ucb1400 { | ||
93 | struct platform_device *ucb1400_ts; | ||
94 | }; | ||
95 | |||
96 | static inline u16 ucb1400_reg_read(struct snd_ac97 *ac97, u16 reg) | ||
97 | { | ||
98 | return ac97->bus->ops->read(ac97, reg); | ||
99 | } | ||
100 | |||
101 | static inline void ucb1400_reg_write(struct snd_ac97 *ac97, u16 reg, u16 val) | ||
102 | { | ||
103 | ac97->bus->ops->write(ac97, reg, val); | ||
104 | } | ||
105 | |||
106 | static inline u16 ucb1400_gpio_get_value(struct snd_ac97 *ac97, u16 gpio) | ||
107 | { | ||
108 | return ucb1400_reg_read(ac97, UCB_IO_DATA) & (1 << gpio); | ||
109 | } | ||
110 | |||
111 | static inline void ucb1400_gpio_set_value(struct snd_ac97 *ac97, u16 gpio, | ||
112 | u16 val) | ||
113 | { | ||
114 | ucb1400_reg_write(ac97, UCB_IO_DATA, val ? | ||
115 | ucb1400_reg_read(ac97, UCB_IO_DATA) | (1 << gpio) : | ||
116 | ucb1400_reg_read(ac97, UCB_IO_DATA) & ~(1 << gpio)); | ||
117 | } | ||
118 | |||
119 | static inline u16 ucb1400_gpio_get_direction(struct snd_ac97 *ac97, u16 gpio) | ||
120 | { | ||
121 | return ucb1400_reg_read(ac97, UCB_IO_DIR) & (1 << gpio); | ||
122 | } | ||
123 | |||
124 | static inline void ucb1400_gpio_set_direction(struct snd_ac97 *ac97, u16 gpio, | ||
125 | u16 dir) | ||
126 | { | ||
127 | ucb1400_reg_write(ac97, UCB_IO_DIR, dir ? | ||
128 | ucb1400_reg_read(ac97, UCB_IO_DIR) | (1 << gpio) : | ||
129 | ucb1400_reg_read(ac97, UCB_IO_DIR) & ~(1 << gpio)); | ||
130 | } | ||
131 | |||
132 | static inline void ucb1400_adc_enable(struct snd_ac97 *ac97) | ||
133 | { | ||
134 | ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA); | ||
135 | } | ||
136 | |||
137 | static unsigned int ucb1400_adc_read(struct snd_ac97 *ac97, u16 adc_channel, | ||
138 | int adcsync) | ||
139 | { | ||
140 | unsigned int val; | ||
141 | |||
142 | if (adcsync) | ||
143 | adc_channel |= UCB_ADC_SYNC_ENA; | ||
144 | |||
145 | ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA | adc_channel); | ||
146 | ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA | adc_channel | | ||
147 | UCB_ADC_START); | ||
148 | |||
149 | while (!((val = ucb1400_reg_read(ac97, UCB_ADC_DATA)) | ||
150 | & UCB_ADC_DAT_VALID)) | ||
151 | schedule_timeout_uninterruptible(1); | ||
152 | |||
153 | return val & UCB_ADC_DAT_MASK; | ||
154 | } | ||
155 | |||
156 | static inline void ucb1400_adc_disable(struct snd_ac97 *ac97) | ||
157 | { | ||
158 | ucb1400_reg_write(ac97, UCB_ADC_CR, 0); | ||
159 | } | ||
160 | |||
161 | #endif | ||
diff --git a/include/linux/wm97xx_batt.h b/include/linux/wm97xx_batt.h new file mode 100644 index 000000000000..9681d1ab0e4f --- /dev/null +++ b/include/linux/wm97xx_batt.h | |||
@@ -0,0 +1,26 @@ | |||
1 | #ifndef _LINUX_WM97XX_BAT_H | ||
2 | #define _LINUX_WM97XX_BAT_H | ||
3 | |||
4 | #include <linux/wm97xx.h> | ||
5 | |||
6 | struct wm97xx_batt_info { | ||
7 | int batt_aux; | ||
8 | int temp_aux; | ||
9 | int charge_gpio; | ||
10 | int min_voltage; | ||
11 | int max_voltage; | ||
12 | int batt_div; | ||
13 | int batt_mult; | ||
14 | int temp_div; | ||
15 | int temp_mult; | ||
16 | int batt_tech; | ||
17 | char *batt_name; | ||
18 | }; | ||
19 | |||
20 | #ifdef CONFIG_BATTERY_WM97XX | ||
21 | void __init wm97xx_bat_set_pdata(struct wm97xx_batt_info *data); | ||
22 | #else | ||
23 | static inline void wm97xx_bat_set_pdata(struct wm97xx_batt_info *data) {} | ||
24 | #endif | ||
25 | |||
26 | #endif | ||
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index fb0c215a3051..4bc1e6b86cb2 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
@@ -279,6 +279,7 @@ enum xfrm_attr_type_t { | |||
279 | XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */ | 279 | XFRMA_POLICY_TYPE, /* struct xfrm_userpolicy_type */ |
280 | XFRMA_MIGRATE, | 280 | XFRMA_MIGRATE, |
281 | XFRMA_ALG_AEAD, /* struct xfrm_algo_aead */ | 281 | XFRMA_ALG_AEAD, /* struct xfrm_algo_aead */ |
282 | XFRMA_KMADDRESS, /* struct xfrm_user_kmaddress */ | ||
282 | __XFRMA_MAX | 283 | __XFRMA_MAX |
283 | 284 | ||
284 | #define XFRMA_MAX (__XFRMA_MAX - 1) | 285 | #define XFRMA_MAX (__XFRMA_MAX - 1) |
@@ -415,6 +416,15 @@ struct xfrm_user_report { | |||
415 | struct xfrm_selector sel; | 416 | struct xfrm_selector sel; |
416 | }; | 417 | }; |
417 | 418 | ||
419 | /* Used by MIGRATE to pass addresses IKE should use to perform | ||
420 | * SA negotiation with the peer */ | ||
421 | struct xfrm_user_kmaddress { | ||
422 | xfrm_address_t local; | ||
423 | xfrm_address_t remote; | ||
424 | __u32 reserved; | ||
425 | __u16 family; | ||
426 | }; | ||
427 | |||
418 | struct xfrm_user_migrate { | 428 | struct xfrm_user_migrate { |
419 | xfrm_address_t old_daddr; | 429 | xfrm_address_t old_daddr; |
420 | xfrm_address_t old_saddr; | 430 | xfrm_address_t old_saddr; |