diff options
Diffstat (limited to 'include/linux')
269 files changed, 7511 insertions, 1496 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index b3afd2219ad2..334a3593cdfd 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -57,6 +57,7 @@ header-y += dlmconstants.h | |||
57 | header-y += dlm_device.h | 57 | header-y += dlm_device.h |
58 | header-y += dlm_netlink.h | 58 | header-y += dlm_netlink.h |
59 | header-y += dm-ioctl.h | 59 | header-y += dm-ioctl.h |
60 | header-y += dm-log-userspace.h | ||
60 | header-y += dn.h | 61 | header-y += dn.h |
61 | header-y += dqblk_xfs.h | 62 | header-y += dqblk_xfs.h |
62 | header-y += efs_fs_sb.h | 63 | header-y += efs_fs_sb.h |
@@ -308,9 +309,11 @@ unifdef-y += pmu.h | |||
308 | unifdef-y += poll.h | 309 | unifdef-y += poll.h |
309 | unifdef-y += ppp_defs.h | 310 | unifdef-y += ppp_defs.h |
310 | unifdef-y += ppp-comp.h | 311 | unifdef-y += ppp-comp.h |
312 | unifdef-y += pps.h | ||
311 | unifdef-y += ptrace.h | 313 | unifdef-y += ptrace.h |
312 | unifdef-y += quota.h | 314 | unifdef-y += quota.h |
313 | unifdef-y += random.h | 315 | unifdef-y += random.h |
316 | unifdef-y += rfkill.h | ||
314 | unifdef-y += irqnr.h | 317 | unifdef-y += irqnr.h |
315 | unifdef-y += reboot.h | 318 | unifdef-y += reboot.h |
316 | unifdef-y += reiserfs_fs.h | 319 | unifdef-y += reiserfs_fs.h |
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 51b4b0a5ce8c..34321cfffeab 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -113,9 +113,6 @@ void acpi_irq_stats_init(void); | |||
113 | extern u32 acpi_irq_handled; | 113 | extern u32 acpi_irq_handled; |
114 | extern u32 acpi_irq_not_handled; | 114 | extern u32 acpi_irq_not_handled; |
115 | 115 | ||
116 | extern struct acpi_mcfg_allocation *pci_mmcfg_config; | ||
117 | extern int pci_mmcfg_config_num; | ||
118 | |||
119 | extern int sbf_port; | 116 | extern int sbf_port; |
120 | extern unsigned long acpi_realmode_flags; | 117 | extern unsigned long acpi_realmode_flags; |
121 | 118 | ||
@@ -293,7 +290,10 @@ void __init acpi_s4_no_nvs(void); | |||
293 | OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL) | 290 | OSC_PCI_EXPRESS_CAP_STRUCTURE_CONTROL) |
294 | 291 | ||
295 | extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 flags); | 292 | extern acpi_status acpi_pci_osc_control_set(acpi_handle handle, u32 flags); |
293 | extern void acpi_early_init(void); | ||
294 | |||
296 | #else /* CONFIG_ACPI */ | 295 | #else /* CONFIG_ACPI */ |
296 | static inline void acpi_early_init(void) { } | ||
297 | 297 | ||
298 | static inline int early_acpi_boot_init(void) | 298 | static inline int early_acpi_boot_init(void) |
299 | { | 299 | { |
diff --git a/include/linux/adfs_fs.h b/include/linux/adfs_fs.h index ef788c2085a1..b19801f73890 100644 --- a/include/linux/adfs_fs.h +++ b/include/linux/adfs_fs.h | |||
@@ -41,8 +41,6 @@ struct adfs_discrecord { | |||
41 | #define ADFS_DR_SIZE_BITS (ADFS_DR_SIZE << 3) | 41 | #define ADFS_DR_SIZE_BITS (ADFS_DR_SIZE << 3) |
42 | 42 | ||
43 | #ifdef __KERNEL__ | 43 | #ifdef __KERNEL__ |
44 | #include <linux/adfs_fs_i.h> | ||
45 | #include <linux/adfs_fs_sb.h> | ||
46 | /* | 44 | /* |
47 | * Calculate the boot block checksum on an ADFS drive. Note that this will | 45 | * Calculate the boot block checksum on an ADFS drive. Note that this will |
48 | * appear to be correct if the sector contains all zeros, so also check that | 46 | * appear to be correct if the sector contains all zeros, so also check that |
@@ -60,17 +58,6 @@ static inline int adfs_checkbblk(unsigned char *ptr) | |||
60 | 58 | ||
61 | return (result & 0xff) != ptr[511]; | 59 | return (result & 0xff) != ptr[511]; |
62 | } | 60 | } |
63 | |||
64 | static inline struct adfs_sb_info *ADFS_SB(struct super_block *sb) | ||
65 | { | ||
66 | return sb->s_fs_info; | ||
67 | } | ||
68 | |||
69 | static inline struct adfs_inode_info *ADFS_I(struct inode *inode) | ||
70 | { | ||
71 | return container_of(inode, struct adfs_inode_info, vfs_inode); | ||
72 | } | ||
73 | |||
74 | #endif | 61 | #endif |
75 | 62 | ||
76 | #endif | 63 | #endif |
diff --git a/include/linux/adfs_fs_i.h b/include/linux/adfs_fs_i.h deleted file mode 100644 index cb543034e54f..000000000000 --- a/include/linux/adfs_fs_i.h +++ /dev/null | |||
@@ -1,24 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/linux/adfs_fs_i.h | ||
3 | * | ||
4 | * Copyright (C) 1997 Russell King | ||
5 | */ | ||
6 | |||
7 | #ifndef _ADFS_FS_I | ||
8 | #define _ADFS_FS_I | ||
9 | |||
10 | /* | ||
11 | * adfs file system inode data in memory | ||
12 | */ | ||
13 | struct adfs_inode_info { | ||
14 | loff_t mmu_private; | ||
15 | unsigned long parent_id; /* object id of parent */ | ||
16 | __u32 loadaddr; /* RISC OS load address */ | ||
17 | __u32 execaddr; /* RISC OS exec address */ | ||
18 | unsigned int filetype; /* RISC OS file type */ | ||
19 | unsigned int attr; /* RISC OS permissions */ | ||
20 | unsigned int stamped:1; /* RISC OS file has date/time */ | ||
21 | struct inode vfs_inode; | ||
22 | }; | ||
23 | |||
24 | #endif | ||
diff --git a/include/linux/adfs_fs_sb.h b/include/linux/adfs_fs_sb.h deleted file mode 100644 index d9bf05c02ccc..000000000000 --- a/include/linux/adfs_fs_sb.h +++ /dev/null | |||
@@ -1,38 +0,0 @@ | |||
1 | /* | ||
2 | * linux/include/linux/adfs_fs_sb.h | ||
3 | * | ||
4 | * Copyright (C) 1997-1999 Russell King | ||
5 | */ | ||
6 | |||
7 | #ifndef _ADFS_FS_SB | ||
8 | #define _ADFS_FS_SB | ||
9 | |||
10 | /* | ||
11 | * Forward-declare this | ||
12 | */ | ||
13 | struct adfs_discmap; | ||
14 | struct adfs_dir_ops; | ||
15 | |||
16 | /* | ||
17 | * ADFS file system superblock data in memory | ||
18 | */ | ||
19 | struct adfs_sb_info { | ||
20 | struct adfs_discmap *s_map; /* bh list containing map */ | ||
21 | struct adfs_dir_ops *s_dir; /* directory operations */ | ||
22 | |||
23 | uid_t s_uid; /* owner uid */ | ||
24 | gid_t s_gid; /* owner gid */ | ||
25 | umode_t s_owner_mask; /* ADFS owner perm -> unix perm */ | ||
26 | umode_t s_other_mask; /* ADFS other perm -> unix perm */ | ||
27 | |||
28 | __u32 s_ids_per_zone; /* max. no ids in one zone */ | ||
29 | __u32 s_idlen; /* length of ID in map */ | ||
30 | __u32 s_map_size; /* sector size of a map */ | ||
31 | unsigned long s_size; /* total size (in blocks) of this fs */ | ||
32 | signed int s_map2blk; /* shift left by this for map->sector */ | ||
33 | unsigned int s_log2sharesize;/* log2 share size */ | ||
34 | __le32 s_version; /* disc format version */ | ||
35 | unsigned int s_namelen; /* maximum number of characters in name */ | ||
36 | }; | ||
37 | |||
38 | #endif | ||
diff --git a/include/linux/agp_backend.h b/include/linux/agp_backend.h index 2b8df8b420fd..76fa794fdac0 100644 --- a/include/linux/agp_backend.h +++ b/include/linux/agp_backend.h | |||
@@ -70,7 +70,7 @@ struct agp_memory { | |||
70 | struct agp_memory *next; | 70 | struct agp_memory *next; |
71 | struct agp_memory *prev; | 71 | struct agp_memory *prev; |
72 | struct agp_bridge_data *bridge; | 72 | struct agp_bridge_data *bridge; |
73 | unsigned long *memory; | 73 | struct page **pages; |
74 | size_t page_count; | 74 | size_t page_count; |
75 | int key; | 75 | int key; |
76 | int num_scratch_pages; | 76 | int num_scratch_pages; |
diff --git a/include/linux/aio.h b/include/linux/aio.h index b16a957030f8..47f7d932a01d 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h | |||
@@ -121,9 +121,9 @@ struct kiocb { | |||
121 | 121 | ||
122 | /* | 122 | /* |
123 | * If the aio_resfd field of the userspace iocb is not zero, | 123 | * If the aio_resfd field of the userspace iocb is not zero, |
124 | * this is the underlying file* to deliver event to. | 124 | * this is the underlying eventfd context to deliver events to. |
125 | */ | 125 | */ |
126 | struct file *ki_eventfd; | 126 | struct eventfd_ctx *ki_eventfd; |
127 | }; | 127 | }; |
128 | 128 | ||
129 | #define is_sync_kiocb(iocb) ((iocb)->ki_key == KIOCB_SYNC_KEY) | 129 | #define is_sync_kiocb(iocb) ((iocb)->ki_key == KIOCB_SYNC_KEY) |
diff --git a/include/linux/amba/pl022.h b/include/linux/amba/pl022.h new file mode 100644 index 000000000000..dcad0ffd1755 --- /dev/null +++ b/include/linux/amba/pl022.h | |||
@@ -0,0 +1,264 @@ | |||
1 | /* | ||
2 | * include/linux/amba/pl022.h | ||
3 | * | ||
4 | * Copyright (C) 2008-2009 ST-Ericsson AB | ||
5 | * Copyright (C) 2006 STMicroelectronics Pvt. Ltd. | ||
6 | * | ||
7 | * Author: Linus Walleij <linus.walleij@stericsson.com> | ||
8 | * | ||
9 | * Initial version inspired by: | ||
10 | * linux-2.6.17-rc3-mm1/drivers/spi/pxa2xx_spi.c | ||
11 | * Initial adoption to PL022 by: | ||
12 | * Sachin Verma <sachin.verma@st.com> | ||
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 as published by | ||
16 | * the Free Software Foundation; either version 2 of the License, or | ||
17 | * (at your option) any later version. | ||
18 | * | ||
19 | * This program is distributed in the hope that it will be useful, | ||
20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
22 | * GNU General Public License for more details. | ||
23 | */ | ||
24 | |||
25 | #ifndef _SSP_PL022_H | ||
26 | #define _SSP_PL022_H | ||
27 | |||
28 | #include <linux/device.h> | ||
29 | |||
30 | /** | ||
31 | * whether SSP is in loopback mode or not | ||
32 | */ | ||
33 | enum ssp_loopback { | ||
34 | LOOPBACK_DISABLED, | ||
35 | LOOPBACK_ENABLED | ||
36 | }; | ||
37 | |||
38 | /** | ||
39 | * enum ssp_interface - interfaces allowed for this SSP Controller | ||
40 | * @SSP_INTERFACE_MOTOROLA_SPI: Motorola Interface | ||
41 | * @SSP_INTERFACE_TI_SYNC_SERIAL: Texas Instrument Synchronous Serial | ||
42 | * interface | ||
43 | * @SSP_INTERFACE_NATIONAL_MICROWIRE: National Semiconductor Microwire | ||
44 | * interface | ||
45 | * @SSP_INTERFACE_UNIDIRECTIONAL: Unidirectional interface (STn8810 | ||
46 | * &STn8815 only) | ||
47 | */ | ||
48 | enum ssp_interface { | ||
49 | SSP_INTERFACE_MOTOROLA_SPI, | ||
50 | SSP_INTERFACE_TI_SYNC_SERIAL, | ||
51 | SSP_INTERFACE_NATIONAL_MICROWIRE, | ||
52 | SSP_INTERFACE_UNIDIRECTIONAL | ||
53 | }; | ||
54 | |||
55 | /** | ||
56 | * enum ssp_hierarchy - whether SSP is configured as Master or Slave | ||
57 | */ | ||
58 | enum ssp_hierarchy { | ||
59 | SSP_MASTER, | ||
60 | SSP_SLAVE | ||
61 | }; | ||
62 | |||
63 | /** | ||
64 | * enum ssp_clock_params - clock parameters, to set SSP clock at a | ||
65 | * desired freq | ||
66 | */ | ||
67 | struct ssp_clock_params { | ||
68 | u8 cpsdvsr; /* value from 2 to 254 (even only!) */ | ||
69 | u8 scr; /* value from 0 to 255 */ | ||
70 | }; | ||
71 | |||
72 | /** | ||
73 | * enum ssp_rx_endian - endianess of Rx FIFO Data | ||
74 | */ | ||
75 | enum ssp_rx_endian { | ||
76 | SSP_RX_MSB, | ||
77 | SSP_RX_LSB | ||
78 | }; | ||
79 | |||
80 | /** | ||
81 | * enum ssp_tx_endian - endianess of Tx FIFO Data | ||
82 | */ | ||
83 | enum ssp_tx_endian { | ||
84 | SSP_TX_MSB, | ||
85 | SSP_TX_LSB | ||
86 | }; | ||
87 | |||
88 | /** | ||
89 | * enum ssp_data_size - number of bits in one data element | ||
90 | */ | ||
91 | enum ssp_data_size { | ||
92 | SSP_DATA_BITS_4 = 0x03, SSP_DATA_BITS_5, SSP_DATA_BITS_6, | ||
93 | SSP_DATA_BITS_7, SSP_DATA_BITS_8, SSP_DATA_BITS_9, | ||
94 | SSP_DATA_BITS_10, SSP_DATA_BITS_11, SSP_DATA_BITS_12, | ||
95 | SSP_DATA_BITS_13, SSP_DATA_BITS_14, SSP_DATA_BITS_15, | ||
96 | SSP_DATA_BITS_16, SSP_DATA_BITS_17, SSP_DATA_BITS_18, | ||
97 | SSP_DATA_BITS_19, SSP_DATA_BITS_20, SSP_DATA_BITS_21, | ||
98 | SSP_DATA_BITS_22, SSP_DATA_BITS_23, SSP_DATA_BITS_24, | ||
99 | SSP_DATA_BITS_25, SSP_DATA_BITS_26, SSP_DATA_BITS_27, | ||
100 | SSP_DATA_BITS_28, SSP_DATA_BITS_29, SSP_DATA_BITS_30, | ||
101 | SSP_DATA_BITS_31, SSP_DATA_BITS_32 | ||
102 | }; | ||
103 | |||
104 | /** | ||
105 | * enum ssp_mode - SSP mode of operation (Communication modes) | ||
106 | */ | ||
107 | enum ssp_mode { | ||
108 | INTERRUPT_TRANSFER, | ||
109 | POLLING_TRANSFER, | ||
110 | DMA_TRANSFER | ||
111 | }; | ||
112 | |||
113 | /** | ||
114 | * enum ssp_rx_level_trig - receive FIFO watermark level which triggers | ||
115 | * IT: Interrupt fires when _N_ or more elements in RX FIFO. | ||
116 | */ | ||
117 | enum ssp_rx_level_trig { | ||
118 | SSP_RX_1_OR_MORE_ELEM, | ||
119 | SSP_RX_4_OR_MORE_ELEM, | ||
120 | SSP_RX_8_OR_MORE_ELEM, | ||
121 | SSP_RX_16_OR_MORE_ELEM, | ||
122 | SSP_RX_32_OR_MORE_ELEM | ||
123 | }; | ||
124 | |||
125 | /** | ||
126 | * Transmit FIFO watermark level which triggers (IT Interrupt fires | ||
127 | * when _N_ or more empty locations in TX FIFO) | ||
128 | */ | ||
129 | enum ssp_tx_level_trig { | ||
130 | SSP_TX_1_OR_MORE_EMPTY_LOC, | ||
131 | SSP_TX_4_OR_MORE_EMPTY_LOC, | ||
132 | SSP_TX_8_OR_MORE_EMPTY_LOC, | ||
133 | SSP_TX_16_OR_MORE_EMPTY_LOC, | ||
134 | SSP_TX_32_OR_MORE_EMPTY_LOC | ||
135 | }; | ||
136 | |||
137 | /** | ||
138 | * enum SPI Clock Phase - clock phase (Motorola SPI interface only) | ||
139 | * @SSP_CLK_RISING_EDGE: Receive data on rising edge | ||
140 | * @SSP_CLK_FALLING_EDGE: Receive data on falling edge | ||
141 | */ | ||
142 | enum ssp_spi_clk_phase { | ||
143 | SSP_CLK_RISING_EDGE, | ||
144 | SSP_CLK_FALLING_EDGE | ||
145 | }; | ||
146 | |||
147 | /** | ||
148 | * enum SPI Clock Polarity - clock polarity (Motorola SPI interface only) | ||
149 | * @SSP_CLK_POL_IDLE_LOW: Low inactive level | ||
150 | * @SSP_CLK_POL_IDLE_HIGH: High inactive level | ||
151 | */ | ||
152 | enum ssp_spi_clk_pol { | ||
153 | SSP_CLK_POL_IDLE_LOW, | ||
154 | SSP_CLK_POL_IDLE_HIGH | ||
155 | }; | ||
156 | |||
157 | /** | ||
158 | * Microwire Conrol Lengths Command size in microwire format | ||
159 | */ | ||
160 | enum ssp_microwire_ctrl_len { | ||
161 | SSP_BITS_4 = 0x03, SSP_BITS_5, SSP_BITS_6, | ||
162 | SSP_BITS_7, SSP_BITS_8, SSP_BITS_9, | ||
163 | SSP_BITS_10, SSP_BITS_11, SSP_BITS_12, | ||
164 | SSP_BITS_13, SSP_BITS_14, SSP_BITS_15, | ||
165 | SSP_BITS_16, SSP_BITS_17, SSP_BITS_18, | ||
166 | SSP_BITS_19, SSP_BITS_20, SSP_BITS_21, | ||
167 | SSP_BITS_22, SSP_BITS_23, SSP_BITS_24, | ||
168 | SSP_BITS_25, SSP_BITS_26, SSP_BITS_27, | ||
169 | SSP_BITS_28, SSP_BITS_29, SSP_BITS_30, | ||
170 | SSP_BITS_31, SSP_BITS_32 | ||
171 | }; | ||
172 | |||
173 | /** | ||
174 | * enum Microwire Wait State | ||
175 | * @SSP_MWIRE_WAIT_ZERO: No wait state inserted after last command bit | ||
176 | * @SSP_MWIRE_WAIT_ONE: One wait state inserted after last command bit | ||
177 | */ | ||
178 | enum ssp_microwire_wait_state { | ||
179 | SSP_MWIRE_WAIT_ZERO, | ||
180 | SSP_MWIRE_WAIT_ONE | ||
181 | }; | ||
182 | |||
183 | /** | ||
184 | * enum Microwire - whether Full/Half Duplex | ||
185 | * @SSP_MICROWIRE_CHANNEL_FULL_DUPLEX: SSPTXD becomes bi-directional, | ||
186 | * SSPRXD not used | ||
187 | * @SSP_MICROWIRE_CHANNEL_HALF_DUPLEX: SSPTXD is an output, SSPRXD is | ||
188 | * an input. | ||
189 | */ | ||
190 | enum ssp_duplex { | ||
191 | SSP_MICROWIRE_CHANNEL_FULL_DUPLEX, | ||
192 | SSP_MICROWIRE_CHANNEL_HALF_DUPLEX | ||
193 | }; | ||
194 | |||
195 | /** | ||
196 | * CHIP select/deselect commands | ||
197 | */ | ||
198 | enum ssp_chip_select { | ||
199 | SSP_CHIP_SELECT, | ||
200 | SSP_CHIP_DESELECT | ||
201 | }; | ||
202 | |||
203 | |||
204 | /** | ||
205 | * struct pl022_ssp_master - device.platform_data for SPI controller devices. | ||
206 | * @num_chipselect: chipselects are used to distinguish individual | ||
207 | * SPI slaves, and are numbered from zero to num_chipselects - 1. | ||
208 | * each slave has a chipselect signal, but it's common that not | ||
209 | * every chipselect is connected to a slave. | ||
210 | * @enable_dma: if true enables DMA driven transfers. | ||
211 | */ | ||
212 | struct pl022_ssp_controller { | ||
213 | u16 bus_id; | ||
214 | u8 num_chipselect; | ||
215 | u8 enable_dma:1; | ||
216 | }; | ||
217 | |||
218 | /** | ||
219 | * struct ssp_config_chip - spi_board_info.controller_data for SPI | ||
220 | * slave devices, copied to spi_device.controller_data. | ||
221 | * | ||
222 | * @lbm: used for test purpose to internally connect RX and TX | ||
223 | * @iface: Interface type(Motorola, TI, Microwire, Universal) | ||
224 | * @hierarchy: sets whether interface is master or slave | ||
225 | * @slave_tx_disable: SSPTXD is disconnected (in slave mode only) | ||
226 | * @clk_freq: Tune freq parameters of SSP(when in master mode) | ||
227 | * @endian_rx: Endianess of Data in Rx FIFO | ||
228 | * @endian_tx: Endianess of Data in Tx FIFO | ||
229 | * @data_size: Width of data element(4 to 32 bits) | ||
230 | * @com_mode: communication mode: polling, Interrupt or DMA | ||
231 | * @rx_lev_trig: Rx FIFO watermark level (for IT & DMA mode) | ||
232 | * @tx_lev_trig: Tx FIFO watermark level (for IT & DMA mode) | ||
233 | * @clk_phase: Motorola SPI interface Clock phase | ||
234 | * @clk_pol: Motorola SPI interface Clock polarity | ||
235 | * @ctrl_len: Microwire interface: Control length | ||
236 | * @wait_state: Microwire interface: Wait state | ||
237 | * @duplex: Microwire interface: Full/Half duplex | ||
238 | * @cs_control: function pointer to board-specific function to | ||
239 | * assert/deassert I/O port to control HW generation of devices chip-select. | ||
240 | * @dma_xfer_type: Type of DMA xfer (Mem-to-periph or Periph-to-Periph) | ||
241 | * @dma_config: DMA configuration for SSP controller and peripheral | ||
242 | */ | ||
243 | struct pl022_config_chip { | ||
244 | struct device *dev; | ||
245 | enum ssp_loopback lbm; | ||
246 | enum ssp_interface iface; | ||
247 | enum ssp_hierarchy hierarchy; | ||
248 | bool slave_tx_disable; | ||
249 | struct ssp_clock_params clk_freq; | ||
250 | enum ssp_rx_endian endian_rx; | ||
251 | enum ssp_tx_endian endian_tx; | ||
252 | enum ssp_data_size data_size; | ||
253 | enum ssp_mode com_mode; | ||
254 | enum ssp_rx_level_trig rx_lev_trig; | ||
255 | enum ssp_tx_level_trig tx_lev_trig; | ||
256 | enum ssp_spi_clk_phase clk_phase; | ||
257 | enum ssp_spi_clk_pol clk_pol; | ||
258 | enum ssp_microwire_ctrl_len ctrl_len; | ||
259 | enum ssp_microwire_wait_state wait_state; | ||
260 | enum ssp_duplex duplex; | ||
261 | void (*cs_control) (u32 control); | ||
262 | }; | ||
263 | |||
264 | #endif /* _SSP_PL022_H */ | ||
diff --git a/include/linux/amba/pl061.h b/include/linux/amba/pl061.h new file mode 100644 index 000000000000..b4fbd9862606 --- /dev/null +++ b/include/linux/amba/pl061.h | |||
@@ -0,0 +1,15 @@ | |||
1 | /* platform data for the PL061 GPIO driver */ | ||
2 | |||
3 | struct pl061_platform_data { | ||
4 | /* number of the first GPIO */ | ||
5 | unsigned gpio_base; | ||
6 | |||
7 | /* number of the first IRQ. | ||
8 | * If the IRQ functionality in not desired this must be set to | ||
9 | * (unsigned) -1. | ||
10 | */ | ||
11 | unsigned irq_base; | ||
12 | |||
13 | u8 directions; /* startup directions, 1: out, 0: in */ | ||
14 | u8 values; /* startup values */ | ||
15 | }; | ||
diff --git a/include/linux/amba/serial.h b/include/linux/amba/serial.h index 64a982ea5d5f..5a5a7fd62490 100644 --- a/include/linux/amba/serial.h +++ b/include/linux/amba/serial.h | |||
@@ -114,6 +114,9 @@ | |||
114 | #define UART011_IFLS_TX4_8 (2 << 0) | 114 | #define UART011_IFLS_TX4_8 (2 << 0) |
115 | #define UART011_IFLS_TX6_8 (3 << 0) | 115 | #define UART011_IFLS_TX6_8 (3 << 0) |
116 | #define UART011_IFLS_TX7_8 (4 << 0) | 116 | #define UART011_IFLS_TX7_8 (4 << 0) |
117 | /* special values for ST vendor with deeper fifo */ | ||
118 | #define UART011_IFLS_RX_HALF (5 << 3) | ||
119 | #define UART011_IFLS_TX_HALF (5 << 0) | ||
117 | 120 | ||
118 | #define UART011_OEIM (1 << 10) /* overrun error interrupt mask */ | 121 | #define UART011_OEIM (1 << 10) /* overrun error interrupt mask */ |
119 | #define UART011_BEIM (1 << 9) /* break error interrupt mask */ | 122 | #define UART011_BEIM (1 << 9) /* break error interrupt mask */ |
diff --git a/include/linux/ata.h b/include/linux/ata.h index 915da43edee1..9c75921f0c16 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -800,6 +800,20 @@ static inline int ata_id_is_ssd(const u16 *id) | |||
800 | return id[ATA_ID_ROT_SPEED] == 0x01; | 800 | return id[ATA_ID_ROT_SPEED] == 0x01; |
801 | } | 801 | } |
802 | 802 | ||
803 | static inline int ata_id_pio_need_iordy(const u16 *id, const u8 pio) | ||
804 | { | ||
805 | /* CF spec. r4.1 Table 22 says no IORDY on PIO5 and PIO6. */ | ||
806 | if (pio > 4 && ata_id_is_cfa(id)) | ||
807 | return 0; | ||
808 | /* For PIO3 and higher it is mandatory. */ | ||
809 | if (pio > 2) | ||
810 | return 1; | ||
811 | /* Turn it on when possible. */ | ||
812 | if (ata_id_has_iordy(id)) | ||
813 | return 1; | ||
814 | return 0; | ||
815 | } | ||
816 | |||
803 | static inline int ata_drive_40wire(const u16 *dev_id) | 817 | static inline int ata_drive_40wire(const u16 *dev_id) |
804 | { | 818 | { |
805 | if (ata_id_is_sata(dev_id)) | 819 | if (ata_id_is_sata(dev_id)) |
diff --git a/include/linux/atmel-mci.h b/include/linux/atmel-mci.h index 2f1f95737acb..57b1846a3c87 100644 --- a/include/linux/atmel-mci.h +++ b/include/linux/atmel-mci.h | |||
@@ -10,6 +10,7 @@ | |||
10 | * @bus_width: Number of data lines wired up the slot | 10 | * @bus_width: Number of data lines wired up the slot |
11 | * @detect_pin: GPIO pin wired to the card detect switch | 11 | * @detect_pin: GPIO pin wired to the card detect switch |
12 | * @wp_pin: GPIO pin wired to the write protect sensor | 12 | * @wp_pin: GPIO pin wired to the write protect sensor |
13 | * @detect_is_active_high: The state of the detect pin when it is active | ||
13 | * | 14 | * |
14 | * If a given slot is not present on the board, @bus_width should be | 15 | * If a given slot is not present on the board, @bus_width should be |
15 | * set to 0. The other fields are ignored in this case. | 16 | * set to 0. The other fields are ignored in this case. |
@@ -24,6 +25,7 @@ struct mci_slot_pdata { | |||
24 | unsigned int bus_width; | 25 | unsigned int bus_width; |
25 | int detect_pin; | 26 | int detect_pin; |
26 | int wp_pin; | 27 | int wp_pin; |
28 | bool detect_is_active_high; | ||
27 | }; | 29 | }; |
28 | 30 | ||
29 | /** | 31 | /** |
diff --git a/include/linux/audit.h b/include/linux/audit.h index 4fa2810b675e..3c7a358241a7 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -599,6 +599,8 @@ extern void audit_log_untrustedstring(struct audit_buffer *ab, | |||
599 | extern void audit_log_d_path(struct audit_buffer *ab, | 599 | extern void audit_log_d_path(struct audit_buffer *ab, |
600 | const char *prefix, | 600 | const char *prefix, |
601 | struct path *path); | 601 | struct path *path); |
602 | extern void audit_log_key(struct audit_buffer *ab, | ||
603 | char *key); | ||
602 | extern void audit_log_lost(const char *message); | 604 | extern void audit_log_lost(const char *message); |
603 | extern int audit_update_lsm_rules(void); | 605 | extern int audit_update_lsm_rules(void); |
604 | 606 | ||
@@ -621,6 +623,7 @@ extern int audit_enabled; | |||
621 | #define audit_log_n_untrustedstring(a,n,s) do { ; } while (0) | 623 | #define audit_log_n_untrustedstring(a,n,s) do { ; } while (0) |
622 | #define audit_log_untrustedstring(a,s) do { ; } while (0) | 624 | #define audit_log_untrustedstring(a,s) do { ; } while (0) |
623 | #define audit_log_d_path(b, p, d) do { ; } while (0) | 625 | #define audit_log_d_path(b, p, d) do { ; } while (0) |
626 | #define audit_log_key(b, k) do { ; } while (0) | ||
624 | #define audit_enabled 0 | 627 | #define audit_enabled 0 |
625 | #endif | 628 | #endif |
626 | #endif | 629 | #endif |
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index 0ec2c594868e..1d52425a6118 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h | |||
@@ -229,9 +229,14 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi) | |||
229 | (1 << BDI_async_congested)); | 229 | (1 << BDI_async_congested)); |
230 | } | 230 | } |
231 | 231 | ||
232 | void clear_bdi_congested(struct backing_dev_info *bdi, int rw); | 232 | enum { |
233 | void set_bdi_congested(struct backing_dev_info *bdi, int rw); | 233 | BLK_RW_ASYNC = 0, |
234 | long congestion_wait(int rw, long timeout); | 234 | BLK_RW_SYNC = 1, |
235 | }; | ||
236 | |||
237 | void clear_bdi_congested(struct backing_dev_info *bdi, int sync); | ||
238 | void set_bdi_congested(struct backing_dev_info *bdi, int sync); | ||
239 | long congestion_wait(int sync, long timeout); | ||
235 | 240 | ||
236 | 241 | ||
237 | static inline bool bdi_cap_writeback_dirty(struct backing_dev_info *bdi) | 242 | static inline bool bdi_cap_writeback_dirty(struct backing_dev_info *bdi) |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 12737be58601..2892b710771c 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -319,7 +319,6 @@ static inline int bio_has_allocated_vec(struct bio *bio) | |||
319 | */ | 319 | */ |
320 | struct bio_integrity_payload { | 320 | struct bio_integrity_payload { |
321 | struct bio *bip_bio; /* parent bio */ | 321 | struct bio *bip_bio; /* parent bio */ |
322 | struct bio_vec *bip_vec; /* integrity data vector */ | ||
323 | 322 | ||
324 | sector_t bip_sector; /* virtual start sector */ | 323 | sector_t bip_sector; /* virtual start sector */ |
325 | 324 | ||
@@ -328,11 +327,12 @@ struct bio_integrity_payload { | |||
328 | 327 | ||
329 | unsigned int bip_size; | 328 | unsigned int bip_size; |
330 | 329 | ||
331 | unsigned short bip_pool; /* pool the ivec came from */ | 330 | unsigned short bip_slab; /* slab the bip came from */ |
332 | unsigned short bip_vcnt; /* # of integrity bio_vecs */ | 331 | unsigned short bip_vcnt; /* # of integrity bio_vecs */ |
333 | unsigned short bip_idx; /* current bip_vec index */ | 332 | unsigned short bip_idx; /* current bip_vec index */ |
334 | 333 | ||
335 | struct work_struct bip_work; /* I/O completion */ | 334 | struct work_struct bip_work; /* I/O completion */ |
335 | struct bio_vec bip_vec[0]; /* embedded bvec array */ | ||
336 | }; | 336 | }; |
337 | #endif /* CONFIG_BLK_DEV_INTEGRITY */ | 337 | #endif /* CONFIG_BLK_DEV_INTEGRITY */ |
338 | 338 | ||
@@ -430,6 +430,9 @@ struct bio_set { | |||
430 | unsigned int front_pad; | 430 | unsigned int front_pad; |
431 | 431 | ||
432 | mempool_t *bio_pool; | 432 | mempool_t *bio_pool; |
433 | #if defined(CONFIG_BLK_DEV_INTEGRITY) | ||
434 | mempool_t *bio_integrity_pool; | ||
435 | #endif | ||
433 | mempool_t *bvec_pool; | 436 | mempool_t *bvec_pool; |
434 | }; | 437 | }; |
435 | 438 | ||
@@ -590,6 +593,11 @@ static inline void bio_list_merge_head(struct bio_list *bl, | |||
590 | bl->head = bl2->head; | 593 | bl->head = bl2->head; |
591 | } | 594 | } |
592 | 595 | ||
596 | static inline struct bio *bio_list_peek(struct bio_list *bl) | ||
597 | { | ||
598 | return bl->head; | ||
599 | } | ||
600 | |||
593 | static inline struct bio *bio_list_pop(struct bio_list *bl) | 601 | static inline struct bio *bio_list_pop(struct bio_list *bl) |
594 | { | 602 | { |
595 | struct bio *bio = bl->head; | 603 | struct bio *bio = bl->head; |
@@ -629,8 +637,9 @@ static inline struct bio *bio_list_get(struct bio_list *bl) | |||
629 | 637 | ||
630 | #define bio_integrity(bio) (bio->bi_integrity != NULL) | 638 | #define bio_integrity(bio) (bio->bi_integrity != NULL) |
631 | 639 | ||
640 | extern struct bio_integrity_payload *bio_integrity_alloc_bioset(struct bio *, gfp_t, unsigned int, struct bio_set *); | ||
632 | extern struct bio_integrity_payload *bio_integrity_alloc(struct bio *, gfp_t, unsigned int); | 641 | extern struct bio_integrity_payload *bio_integrity_alloc(struct bio *, gfp_t, unsigned int); |
633 | extern void bio_integrity_free(struct bio *); | 642 | extern void bio_integrity_free(struct bio *, struct bio_set *); |
634 | extern int bio_integrity_add_page(struct bio *, struct page *, unsigned int, unsigned int); | 643 | extern int bio_integrity_add_page(struct bio *, struct page *, unsigned int, unsigned int); |
635 | extern int bio_integrity_enabled(struct bio *bio); | 644 | extern int bio_integrity_enabled(struct bio *bio); |
636 | extern int bio_integrity_set_tag(struct bio *, void *, unsigned int); | 645 | extern int bio_integrity_set_tag(struct bio *, void *, unsigned int); |
@@ -640,21 +649,27 @@ extern void bio_integrity_endio(struct bio *, int); | |||
640 | extern void bio_integrity_advance(struct bio *, unsigned int); | 649 | extern void bio_integrity_advance(struct bio *, unsigned int); |
641 | extern void bio_integrity_trim(struct bio *, unsigned int, unsigned int); | 650 | extern void bio_integrity_trim(struct bio *, unsigned int, unsigned int); |
642 | extern void bio_integrity_split(struct bio *, struct bio_pair *, int); | 651 | extern void bio_integrity_split(struct bio *, struct bio_pair *, int); |
643 | extern int bio_integrity_clone(struct bio *, struct bio *, gfp_t); | 652 | extern int bio_integrity_clone(struct bio *, struct bio *, gfp_t, struct bio_set *); |
653 | extern int bioset_integrity_create(struct bio_set *, int); | ||
654 | extern void bioset_integrity_free(struct bio_set *); | ||
655 | extern void bio_integrity_init(void); | ||
644 | 656 | ||
645 | #else /* CONFIG_BLK_DEV_INTEGRITY */ | 657 | #else /* CONFIG_BLK_DEV_INTEGRITY */ |
646 | 658 | ||
647 | #define bio_integrity(a) (0) | 659 | #define bio_integrity(a) (0) |
660 | #define bioset_integrity_create(a, b) (0) | ||
648 | #define bio_integrity_prep(a) (0) | 661 | #define bio_integrity_prep(a) (0) |
649 | #define bio_integrity_enabled(a) (0) | 662 | #define bio_integrity_enabled(a) (0) |
650 | #define bio_integrity_clone(a, b, c) (0) | 663 | #define bio_integrity_clone(a, b, c, d) (0) |
651 | #define bio_integrity_free(a) do { } while (0) | 664 | #define bioset_integrity_free(a) do { } while (0) |
665 | #define bio_integrity_free(a, b) do { } while (0) | ||
652 | #define bio_integrity_endio(a, b) do { } while (0) | 666 | #define bio_integrity_endio(a, b) do { } while (0) |
653 | #define bio_integrity_advance(a, b) do { } while (0) | 667 | #define bio_integrity_advance(a, b) do { } while (0) |
654 | #define bio_integrity_trim(a, b, c) do { } while (0) | 668 | #define bio_integrity_trim(a, b, c) do { } while (0) |
655 | #define bio_integrity_split(a, b, c) do { } while (0) | 669 | #define bio_integrity_split(a, b, c) do { } while (0) |
656 | #define bio_integrity_set_tag(a, b, c) do { } while (0) | 670 | #define bio_integrity_set_tag(a, b, c) do { } while (0) |
657 | #define bio_integrity_get_tag(a, b, c) do { } while (0) | 671 | #define bio_integrity_get_tag(a, b, c) do { } while (0) |
672 | #define bio_integrity_init(a) do { } while (0) | ||
658 | 673 | ||
659 | #endif /* CONFIG_BLK_DEV_INTEGRITY */ | 674 | #endif /* CONFIG_BLK_DEV_INTEGRITY */ |
660 | 675 | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index ebdfde8fe556..e7cb5dbf6c26 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -70,11 +70,6 @@ enum rq_cmd_type_bits { | |||
70 | REQ_TYPE_ATA_PC, | 70 | REQ_TYPE_ATA_PC, |
71 | }; | 71 | }; |
72 | 72 | ||
73 | enum { | ||
74 | BLK_RW_ASYNC = 0, | ||
75 | BLK_RW_SYNC = 1, | ||
76 | }; | ||
77 | |||
78 | /* | 73 | /* |
79 | * For request of type REQ_TYPE_LINUX_BLOCK, rq->cmd[0] is the opcode being | 74 | * For request of type REQ_TYPE_LINUX_BLOCK, rq->cmd[0] is the opcode being |
80 | * sent down (similar to how REQ_TYPE_BLOCK_PC means that ->cmd[] holds a | 75 | * sent down (similar to how REQ_TYPE_BLOCK_PC means that ->cmd[] holds a |
@@ -301,12 +296,6 @@ struct blk_queue_tag { | |||
301 | #define BLK_SCSI_MAX_CMDS (256) | 296 | #define BLK_SCSI_MAX_CMDS (256) |
302 | #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) | 297 | #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) |
303 | 298 | ||
304 | struct blk_cmd_filter { | ||
305 | unsigned long read_ok[BLK_SCSI_CMD_PER_LONG]; | ||
306 | unsigned long write_ok[BLK_SCSI_CMD_PER_LONG]; | ||
307 | struct kobject kobj; | ||
308 | }; | ||
309 | |||
310 | struct queue_limits { | 299 | struct queue_limits { |
311 | unsigned long bounce_pfn; | 300 | unsigned long bounce_pfn; |
312 | unsigned long seg_boundary_mask; | 301 | unsigned long seg_boundary_mask; |
@@ -445,7 +434,6 @@ struct request_queue | |||
445 | #if defined(CONFIG_BLK_DEV_BSG) | 434 | #if defined(CONFIG_BLK_DEV_BSG) |
446 | struct bsg_class_device bsg_dev; | 435 | struct bsg_class_device bsg_dev; |
447 | #endif | 436 | #endif |
448 | struct blk_cmd_filter cmd_filter; | ||
449 | }; | 437 | }; |
450 | 438 | ||
451 | #define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ | 439 | #define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ |
@@ -730,6 +718,7 @@ struct rq_map_data { | |||
730 | int nr_entries; | 718 | int nr_entries; |
731 | unsigned long offset; | 719 | unsigned long offset; |
732 | int null_mapped; | 720 | int null_mapped; |
721 | int from_user; | ||
733 | }; | 722 | }; |
734 | 723 | ||
735 | struct req_iterator { | 724 | struct req_iterator { |
@@ -786,18 +775,18 @@ extern int sg_scsi_ioctl(struct request_queue *, struct gendisk *, fmode_t, | |||
786 | * congested queues, and wake up anyone who was waiting for requests to be | 775 | * congested queues, and wake up anyone who was waiting for requests to be |
787 | * put back. | 776 | * put back. |
788 | */ | 777 | */ |
789 | static inline void blk_clear_queue_congested(struct request_queue *q, int rw) | 778 | static inline void blk_clear_queue_congested(struct request_queue *q, int sync) |
790 | { | 779 | { |
791 | clear_bdi_congested(&q->backing_dev_info, rw); | 780 | clear_bdi_congested(&q->backing_dev_info, sync); |
792 | } | 781 | } |
793 | 782 | ||
794 | /* | 783 | /* |
795 | * A queue has just entered congestion. Flag that in the queue's VM-visible | 784 | * A queue has just entered congestion. Flag that in the queue's VM-visible |
796 | * state flags and increment the global gounter of congested queues. | 785 | * state flags and increment the global gounter of congested queues. |
797 | */ | 786 | */ |
798 | static inline void blk_set_queue_congested(struct request_queue *q, int rw) | 787 | static inline void blk_set_queue_congested(struct request_queue *q, int sync) |
799 | { | 788 | { |
800 | set_bdi_congested(&q->backing_dev_info, rw); | 789 | set_bdi_congested(&q->backing_dev_info, sync); |
801 | } | 790 | } |
802 | 791 | ||
803 | extern void blk_start_queue(struct request_queue *q); | 792 | extern void blk_start_queue(struct request_queue *q); |
@@ -926,6 +915,7 @@ extern void blk_queue_alignment_offset(struct request_queue *q, | |||
926 | unsigned int alignment); | 915 | unsigned int alignment); |
927 | extern void blk_queue_io_min(struct request_queue *q, unsigned int min); | 916 | extern void blk_queue_io_min(struct request_queue *q, unsigned int min); |
928 | extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt); | 917 | extern void blk_queue_io_opt(struct request_queue *q, unsigned int opt); |
918 | extern void blk_set_default_limits(struct queue_limits *lim); | ||
929 | extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, | 919 | extern int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, |
930 | sector_t offset); | 920 | sector_t offset); |
931 | extern void disk_stack_limits(struct gendisk *disk, struct block_device *bdev, | 921 | extern void disk_stack_limits(struct gendisk *disk, struct block_device *bdev, |
@@ -997,13 +987,7 @@ static inline int sb_issue_discard(struct super_block *sb, | |||
997 | return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL); | 987 | return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL); |
998 | } | 988 | } |
999 | 989 | ||
1000 | /* | 990 | extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); |
1001 | * command filter functions | ||
1002 | */ | ||
1003 | extern int blk_verify_command(struct blk_cmd_filter *filter, | ||
1004 | unsigned char *cmd, fmode_t has_write_perm); | ||
1005 | extern void blk_unregister_filter(struct gendisk *disk); | ||
1006 | extern void blk_set_cmd_filter_defaults(struct blk_cmd_filter *filter); | ||
1007 | 991 | ||
1008 | #define MAX_PHYS_SEGMENTS 128 | 992 | #define MAX_PHYS_SEGMENTS 128 |
1009 | #define MAX_HW_SEGMENTS 128 | 993 | #define MAX_HW_SEGMENTS 128 |
@@ -1226,6 +1210,8 @@ struct block_device_operations { | |||
1226 | int (*direct_access) (struct block_device *, sector_t, | 1210 | int (*direct_access) (struct block_device *, sector_t, |
1227 | void **, unsigned long *); | 1211 | void **, unsigned long *); |
1228 | int (*media_changed) (struct gendisk *); | 1212 | int (*media_changed) (struct gendisk *); |
1213 | unsigned long long (*set_capacity) (struct gendisk *, | ||
1214 | unsigned long long); | ||
1229 | int (*revalidate_disk) (struct gendisk *); | 1215 | int (*revalidate_disk) (struct gendisk *); |
1230 | int (*getgeo)(struct block_device *, struct hd_geometry *); | 1216 | int (*getgeo)(struct block_device *, struct hd_geometry *); |
1231 | struct module *owner; | 1217 | struct module *owner; |
diff --git a/include/linux/bug.h b/include/linux/bug.h index 54398d2c6d8d..d276b5510c83 100644 --- a/include/linux/bug.h +++ b/include/linux/bug.h | |||
@@ -1,7 +1,6 @@ | |||
1 | #ifndef _LINUX_BUG_H | 1 | #ifndef _LINUX_BUG_H |
2 | #define _LINUX_BUG_H | 2 | #define _LINUX_BUG_H |
3 | 3 | ||
4 | #include <linux/module.h> | ||
5 | #include <asm/bug.h> | 4 | #include <asm/bug.h> |
6 | 5 | ||
7 | enum bug_trap_type { | 6 | enum bug_trap_type { |
@@ -24,10 +23,6 @@ const struct bug_entry *find_bug(unsigned long bugaddr); | |||
24 | 23 | ||
25 | enum bug_trap_type report_bug(unsigned long bug_addr, struct pt_regs *regs); | 24 | enum bug_trap_type report_bug(unsigned long bug_addr, struct pt_regs *regs); |
26 | 25 | ||
27 | int module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, | ||
28 | struct module *); | ||
29 | void module_bug_cleanup(struct module *); | ||
30 | |||
31 | /* These are defined by the architecture */ | 26 | /* These are defined by the architecture */ |
32 | int is_valid_bugaddr(unsigned long addr); | 27 | int is_valid_bugaddr(unsigned long addr); |
33 | 28 | ||
@@ -38,13 +33,6 @@ static inline enum bug_trap_type report_bug(unsigned long bug_addr, | |||
38 | { | 33 | { |
39 | return BUG_TRAP_TYPE_BUG; | 34 | return BUG_TRAP_TYPE_BUG; |
40 | } | 35 | } |
41 | static inline int module_bug_finalize(const Elf_Ehdr *hdr, | ||
42 | const Elf_Shdr *sechdrs, | ||
43 | struct module *mod) | ||
44 | { | ||
45 | return 0; | ||
46 | } | ||
47 | static inline void module_bug_cleanup(struct module *mod) {} | ||
48 | 36 | ||
49 | #endif /* CONFIG_GENERIC_BUG */ | 37 | #endif /* CONFIG_GENERIC_BUG */ |
50 | #endif /* _LINUX_BUG_H */ | 38 | #endif /* _LINUX_BUG_H */ |
diff --git a/include/linux/c2port.h b/include/linux/c2port.h index 7b5a2388ba67..2a5cd867c365 100644 --- a/include/linux/c2port.h +++ b/include/linux/c2port.h | |||
@@ -10,6 +10,7 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/device.h> | 12 | #include <linux/device.h> |
13 | #include <linux/kmemcheck.h> | ||
13 | 14 | ||
14 | #define C2PORT_NAME_LEN 32 | 15 | #define C2PORT_NAME_LEN 32 |
15 | 16 | ||
@@ -20,8 +21,10 @@ | |||
20 | /* Main struct */ | 21 | /* Main struct */ |
21 | struct c2port_ops; | 22 | struct c2port_ops; |
22 | struct c2port_device { | 23 | struct c2port_device { |
24 | kmemcheck_bitfield_begin(flags); | ||
23 | unsigned int access:1; | 25 | unsigned int access:1; |
24 | unsigned int flash_access:1; | 26 | unsigned int flash_access:1; |
27 | kmemcheck_bitfield_end(flags); | ||
25 | 28 | ||
26 | int id; | 29 | int id; |
27 | char name[C2PORT_NAME_LEN]; | 30 | char name[C2PORT_NAME_LEN]; |
diff --git a/include/linux/can/Kbuild b/include/linux/can/Kbuild index eff898aac02b..8cb05aae661c 100644 --- a/include/linux/can/Kbuild +++ b/include/linux/can/Kbuild | |||
@@ -1,3 +1,4 @@ | |||
1 | header-y += raw.h | 1 | header-y += raw.h |
2 | header-y += bcm.h | 2 | header-y += bcm.h |
3 | header-y += error.h | 3 | header-y += error.h |
4 | header-y += netlink.h | ||
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h new file mode 100644 index 000000000000..4a37a56f6cdd --- /dev/null +++ b/include/linux/can/dev.h | |||
@@ -0,0 +1,70 @@ | |||
1 | /* | ||
2 | * linux/can/dev.h | ||
3 | * | ||
4 | * Definitions for the CAN network device driver interface | ||
5 | * | ||
6 | * Copyright (C) 2006 Andrey Volkov <avolkov@varma-el.com> | ||
7 | * Varma Electronics Oy | ||
8 | * | ||
9 | * Copyright (C) 2008 Wolfgang Grandegger <wg@grandegger.com> | ||
10 | * | ||
11 | * Send feedback to <socketcan-users@lists.berlios.de> | ||
12 | */ | ||
13 | |||
14 | #ifndef CAN_DEV_H | ||
15 | #define CAN_DEV_H | ||
16 | |||
17 | #include <linux/can/netlink.h> | ||
18 | #include <linux/can/error.h> | ||
19 | |||
20 | /* | ||
21 | * CAN mode | ||
22 | */ | ||
23 | enum can_mode { | ||
24 | CAN_MODE_STOP = 0, | ||
25 | CAN_MODE_START, | ||
26 | CAN_MODE_SLEEP | ||
27 | }; | ||
28 | |||
29 | /* | ||
30 | * CAN common private data | ||
31 | */ | ||
32 | #define CAN_ECHO_SKB_MAX 4 | ||
33 | |||
34 | struct can_priv { | ||
35 | struct can_device_stats can_stats; | ||
36 | |||
37 | struct can_bittiming bittiming; | ||
38 | struct can_bittiming_const *bittiming_const; | ||
39 | struct can_clock clock; | ||
40 | |||
41 | enum can_state state; | ||
42 | u32 ctrlmode; | ||
43 | |||
44 | int restart_ms; | ||
45 | struct timer_list restart_timer; | ||
46 | |||
47 | struct sk_buff *echo_skb[CAN_ECHO_SKB_MAX]; | ||
48 | |||
49 | int (*do_set_bittiming)(struct net_device *dev); | ||
50 | int (*do_set_mode)(struct net_device *dev, enum can_mode mode); | ||
51 | int (*do_get_state)(const struct net_device *dev, | ||
52 | enum can_state *state); | ||
53 | }; | ||
54 | |||
55 | struct net_device *alloc_candev(int sizeof_priv); | ||
56 | void free_candev(struct net_device *dev); | ||
57 | |||
58 | int open_candev(struct net_device *dev); | ||
59 | void close_candev(struct net_device *dev); | ||
60 | |||
61 | int register_candev(struct net_device *dev); | ||
62 | void unregister_candev(struct net_device *dev); | ||
63 | |||
64 | int can_restart_now(struct net_device *dev); | ||
65 | void can_bus_off(struct net_device *dev); | ||
66 | |||
67 | void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev, int idx); | ||
68 | void can_get_echo_skb(struct net_device *dev, int idx); | ||
69 | |||
70 | #endif /* CAN_DEV_H */ | ||
diff --git a/include/linux/can/netlink.h b/include/linux/can/netlink.h new file mode 100644 index 000000000000..9ecbb7871c0e --- /dev/null +++ b/include/linux/can/netlink.h | |||
@@ -0,0 +1,113 @@ | |||
1 | /* | ||
2 | * linux/can/netlink.h | ||
3 | * | ||
4 | * Definitions for the CAN netlink interface | ||
5 | * | ||
6 | * Copyright (c) 2009 Wolfgang Grandegger <wg@grandegger.com> | ||
7 | * | ||
8 | * Send feedback to <socketcan-users@lists.berlios.de> | ||
9 | * | ||
10 | */ | ||
11 | |||
12 | #ifndef CAN_NETLINK_H | ||
13 | #define CAN_NETLINK_H | ||
14 | |||
15 | #include <linux/types.h> | ||
16 | |||
17 | /* | ||
18 | * CAN bit-timing parameters | ||
19 | * | ||
20 | * For futher information, please read chapter "8 BIT TIMING | ||
21 | * REQUIREMENTS" of the "Bosch CAN Specification version 2.0" | ||
22 | * at http://www.semiconductors.bosch.de/pdf/can2spec.pdf. | ||
23 | */ | ||
24 | struct can_bittiming { | ||
25 | __u32 bitrate; /* Bit-rate in bits/second */ | ||
26 | __u32 sample_point; /* Sample point in one-tenth of a percent */ | ||
27 | __u32 tq; /* Time quanta (TQ) in nanoseconds */ | ||
28 | __u32 prop_seg; /* Propagation segment in TQs */ | ||
29 | __u32 phase_seg1; /* Phase buffer segment 1 in TQs */ | ||
30 | __u32 phase_seg2; /* Phase buffer segment 2 in TQs */ | ||
31 | __u32 sjw; /* Synchronisation jump width in TQs */ | ||
32 | __u32 brp; /* Bit-rate prescaler */ | ||
33 | }; | ||
34 | |||
35 | /* | ||
36 | * CAN harware-dependent bit-timing constant | ||
37 | * | ||
38 | * Used for calculating and checking bit-timing parameters | ||
39 | */ | ||
40 | struct can_bittiming_const { | ||
41 | char name[16]; /* Name of the CAN controller hardware */ | ||
42 | __u32 tseg1_min; /* Time segement 1 = prop_seg + phase_seg1 */ | ||
43 | __u32 tseg1_max; | ||
44 | __u32 tseg2_min; /* Time segement 2 = phase_seg2 */ | ||
45 | __u32 tseg2_max; | ||
46 | __u32 sjw_max; /* Synchronisation jump width */ | ||
47 | __u32 brp_min; /* Bit-rate prescaler */ | ||
48 | __u32 brp_max; | ||
49 | __u32 brp_inc; | ||
50 | }; | ||
51 | |||
52 | /* | ||
53 | * CAN clock parameters | ||
54 | */ | ||
55 | struct can_clock { | ||
56 | __u32 freq; /* CAN system clock frequency in Hz */ | ||
57 | }; | ||
58 | |||
59 | /* | ||
60 | * CAN operational and error states | ||
61 | */ | ||
62 | enum can_state { | ||
63 | CAN_STATE_ERROR_ACTIVE = 0, /* RX/TX error count < 96 */ | ||
64 | CAN_STATE_ERROR_WARNING, /* RX/TX error count < 128 */ | ||
65 | CAN_STATE_ERROR_PASSIVE, /* RX/TX error count < 256 */ | ||
66 | CAN_STATE_BUS_OFF, /* RX/TX error count >= 256 */ | ||
67 | CAN_STATE_STOPPED, /* Device is stopped */ | ||
68 | CAN_STATE_SLEEPING, /* Device is sleeping */ | ||
69 | CAN_STATE_MAX | ||
70 | }; | ||
71 | |||
72 | /* | ||
73 | * CAN controller mode | ||
74 | */ | ||
75 | struct can_ctrlmode { | ||
76 | __u32 mask; | ||
77 | __u32 flags; | ||
78 | }; | ||
79 | |||
80 | #define CAN_CTRLMODE_LOOPBACK 0x1 /* Loopback mode */ | ||
81 | #define CAN_CTRLMODE_LISTENONLY 0x2 /* Listen-only mode */ | ||
82 | #define CAN_CTRLMODE_3_SAMPLES 0x4 /* Triple sampling mode */ | ||
83 | |||
84 | /* | ||
85 | * CAN device statistics | ||
86 | */ | ||
87 | struct can_device_stats { | ||
88 | __u32 bus_error; /* Bus errors */ | ||
89 | __u32 error_warning; /* Changes to error warning state */ | ||
90 | __u32 error_passive; /* Changes to error passive state */ | ||
91 | __u32 bus_off; /* Changes to bus off state */ | ||
92 | __u32 arbitration_lost; /* Arbitration lost errors */ | ||
93 | __u32 restarts; /* CAN controller re-starts */ | ||
94 | }; | ||
95 | |||
96 | /* | ||
97 | * CAN netlink interface | ||
98 | */ | ||
99 | enum { | ||
100 | IFLA_CAN_UNSPEC, | ||
101 | IFLA_CAN_BITTIMING, | ||
102 | IFLA_CAN_BITTIMING_CONST, | ||
103 | IFLA_CAN_CLOCK, | ||
104 | IFLA_CAN_STATE, | ||
105 | IFLA_CAN_CTRLMODE, | ||
106 | IFLA_CAN_RESTART_MS, | ||
107 | IFLA_CAN_RESTART, | ||
108 | __IFLA_CAN_MAX | ||
109 | }; | ||
110 | |||
111 | #define IFLA_CAN_MAX (__IFLA_CAN_MAX - 1) | ||
112 | |||
113 | #endif /* CAN_NETLINK_H */ | ||
diff --git a/include/linux/can/platform/sja1000.h b/include/linux/can/platform/sja1000.h new file mode 100644 index 000000000000..01ee2aeb048d --- /dev/null +++ b/include/linux/can/platform/sja1000.h | |||
@@ -0,0 +1,35 @@ | |||
1 | #ifndef _CAN_PLATFORM_SJA1000_H_ | ||
2 | #define _CAN_PLATFORM_SJA1000_H_ | ||
3 | |||
4 | /* clock divider register */ | ||
5 | #define CDR_CLKOUT_MASK 0x07 | ||
6 | #define CDR_CLK_OFF 0x08 /* Clock off (CLKOUT pin) */ | ||
7 | #define CDR_RXINPEN 0x20 /* TX1 output is RX irq output */ | ||
8 | #define CDR_CBP 0x40 /* CAN input comparator bypass */ | ||
9 | #define CDR_PELICAN 0x80 /* PeliCAN mode */ | ||
10 | |||
11 | /* output control register */ | ||
12 | #define OCR_MODE_BIPHASE 0x00 | ||
13 | #define OCR_MODE_TEST 0x01 | ||
14 | #define OCR_MODE_NORMAL 0x02 | ||
15 | #define OCR_MODE_CLOCK 0x03 | ||
16 | #define OCR_MODE_MASK 0x07 | ||
17 | #define OCR_TX0_INVERT 0x04 | ||
18 | #define OCR_TX0_PULLDOWN 0x08 | ||
19 | #define OCR_TX0_PULLUP 0x10 | ||
20 | #define OCR_TX0_PUSHPULL 0x18 | ||
21 | #define OCR_TX1_INVERT 0x20 | ||
22 | #define OCR_TX1_PULLDOWN 0x40 | ||
23 | #define OCR_TX1_PULLUP 0x80 | ||
24 | #define OCR_TX1_PUSHPULL 0xc0 | ||
25 | #define OCR_TX_MASK 0xfc | ||
26 | #define OCR_TX_SHIFT 2 | ||
27 | |||
28 | struct sja1000_platform_data { | ||
29 | u32 clock; /* CAN bus oscillator frequency in Hz */ | ||
30 | |||
31 | u8 ocr; /* output control register */ | ||
32 | u8 cdr; /* clock divider register */ | ||
33 | }; | ||
34 | |||
35 | #endif /* !_CAN_PLATFORM_SJA1000_H_ */ | ||
diff --git a/include/linux/cb710.h b/include/linux/cb710.h new file mode 100644 index 000000000000..63bc9a4d2926 --- /dev/null +++ b/include/linux/cb710.h | |||
@@ -0,0 +1,231 @@ | |||
1 | /* | ||
2 | * cb710/cb710.h | ||
3 | * | ||
4 | * Copyright by Michał Mirosław, 2008-2009 | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | #ifndef LINUX_CB710_DRIVER_H | ||
11 | #define LINUX_CB710_DRIVER_H | ||
12 | |||
13 | #include <linux/io.h> | ||
14 | #include <linux/interrupt.h> | ||
15 | #include <linux/spinlock.h> | ||
16 | #include <linux/pci.h> | ||
17 | #include <linux/platform_device.h> | ||
18 | #include <linux/mmc/host.h> | ||
19 | |||
20 | struct cb710_slot; | ||
21 | |||
22 | typedef int (*cb710_irq_handler_t)(struct cb710_slot *); | ||
23 | |||
24 | /* per-virtual-slot structure */ | ||
25 | struct cb710_slot { | ||
26 | struct platform_device pdev; | ||
27 | void __iomem *iobase; | ||
28 | cb710_irq_handler_t irq_handler; | ||
29 | }; | ||
30 | |||
31 | /* per-device structure */ | ||
32 | struct cb710_chip { | ||
33 | struct pci_dev *pdev; | ||
34 | void __iomem *iobase; | ||
35 | unsigned platform_id; | ||
36 | #ifdef CONFIG_CB710_DEBUG_ASSUMPTIONS | ||
37 | atomic_t slot_refs_count; | ||
38 | #endif | ||
39 | unsigned slot_mask; | ||
40 | unsigned slots; | ||
41 | spinlock_t irq_lock; | ||
42 | struct cb710_slot slot[0]; | ||
43 | }; | ||
44 | |||
45 | /* NOTE: cb710_chip.slots is modified only during device init/exit and | ||
46 | * they are all serialized wrt themselves */ | ||
47 | |||
48 | /* cb710_chip.slot_mask values */ | ||
49 | #define CB710_SLOT_MMC 1 | ||
50 | #define CB710_SLOT_MS 2 | ||
51 | #define CB710_SLOT_SM 4 | ||
52 | |||
53 | /* slot port accessors - so the logic is more clear in the code */ | ||
54 | #define CB710_PORT_ACCESSORS(t) \ | ||
55 | static inline void cb710_write_port_##t(struct cb710_slot *slot, \ | ||
56 | unsigned port, u##t value) \ | ||
57 | { \ | ||
58 | iowrite##t(value, slot->iobase + port); \ | ||
59 | } \ | ||
60 | \ | ||
61 | static inline u##t cb710_read_port_##t(struct cb710_slot *slot, \ | ||
62 | unsigned port) \ | ||
63 | { \ | ||
64 | return ioread##t(slot->iobase + port); \ | ||
65 | } \ | ||
66 | \ | ||
67 | static inline void cb710_modify_port_##t(struct cb710_slot *slot, \ | ||
68 | unsigned port, u##t set, u##t clear) \ | ||
69 | { \ | ||
70 | iowrite##t( \ | ||
71 | (ioread##t(slot->iobase + port) & ~clear)|set, \ | ||
72 | slot->iobase + port); \ | ||
73 | } | ||
74 | |||
75 | CB710_PORT_ACCESSORS(8) | ||
76 | CB710_PORT_ACCESSORS(16) | ||
77 | CB710_PORT_ACCESSORS(32) | ||
78 | |||
79 | void cb710_pci_update_config_reg(struct pci_dev *pdev, | ||
80 | int reg, uint32_t and, uint32_t xor); | ||
81 | void cb710_set_irq_handler(struct cb710_slot *slot, | ||
82 | cb710_irq_handler_t handler); | ||
83 | |||
84 | /* some device struct walking */ | ||
85 | |||
86 | static inline struct cb710_slot *cb710_pdev_to_slot( | ||
87 | struct platform_device *pdev) | ||
88 | { | ||
89 | return container_of(pdev, struct cb710_slot, pdev); | ||
90 | } | ||
91 | |||
92 | static inline struct cb710_chip *cb710_slot_to_chip(struct cb710_slot *slot) | ||
93 | { | ||
94 | return dev_get_drvdata(slot->pdev.dev.parent); | ||
95 | } | ||
96 | |||
97 | static inline struct device *cb710_slot_dev(struct cb710_slot *slot) | ||
98 | { | ||
99 | return &slot->pdev.dev; | ||
100 | } | ||
101 | |||
102 | static inline struct device *cb710_chip_dev(struct cb710_chip *chip) | ||
103 | { | ||
104 | return &chip->pdev->dev; | ||
105 | } | ||
106 | |||
107 | /* debugging aids */ | ||
108 | |||
109 | #ifdef CONFIG_CB710_DEBUG | ||
110 | void cb710_dump_regs(struct cb710_chip *chip, unsigned dump); | ||
111 | #else | ||
112 | #define cb710_dump_regs(c, d) do {} while (0) | ||
113 | #endif | ||
114 | |||
115 | #define CB710_DUMP_REGS_MMC 0x0F | ||
116 | #define CB710_DUMP_REGS_MS 0x30 | ||
117 | #define CB710_DUMP_REGS_SM 0xC0 | ||
118 | #define CB710_DUMP_REGS_ALL 0xFF | ||
119 | #define CB710_DUMP_REGS_MASK 0xFF | ||
120 | |||
121 | #define CB710_DUMP_ACCESS_8 0x100 | ||
122 | #define CB710_DUMP_ACCESS_16 0x200 | ||
123 | #define CB710_DUMP_ACCESS_32 0x400 | ||
124 | #define CB710_DUMP_ACCESS_ALL 0x700 | ||
125 | #define CB710_DUMP_ACCESS_MASK 0x700 | ||
126 | |||
127 | #endif /* LINUX_CB710_DRIVER_H */ | ||
128 | /* | ||
129 | * cb710/sgbuf2.h | ||
130 | * | ||
131 | * Copyright by Michał Mirosław, 2008-2009 | ||
132 | * | ||
133 | * This program is free software; you can redistribute it and/or modify | ||
134 | * it under the terms of the GNU General Public License version 2 as | ||
135 | * published by the Free Software Foundation. | ||
136 | */ | ||
137 | #ifndef LINUX_CB710_SG_H | ||
138 | #define LINUX_CB710_SG_H | ||
139 | |||
140 | #include <linux/highmem.h> | ||
141 | #include <linux/scatterlist.h> | ||
142 | |||
143 | /** | ||
144 | * cb710_sg_miter_stop_writing - stop mapping iteration after writing | ||
145 | * @miter: sg mapping iter to be stopped | ||
146 | * | ||
147 | * Description: | ||
148 | * Stops mapping iterator @miter. @miter should have been started | ||
149 | * started using sg_miter_start(). A stopped iteration can be | ||
150 | * resumed by calling sg_miter_next() on it. This is useful when | ||
151 | * resources (kmap) need to be released during iteration. | ||
152 | * | ||
153 | * This is a convenience wrapper that will be optimized out for arches | ||
154 | * that don't need flush_kernel_dcache_page(). | ||
155 | * | ||
156 | * Context: | ||
157 | * IRQ disabled if the SG_MITER_ATOMIC is set. Don't care otherwise. | ||
158 | */ | ||
159 | static inline void cb710_sg_miter_stop_writing(struct sg_mapping_iter *miter) | ||
160 | { | ||
161 | if (miter->page) | ||
162 | flush_kernel_dcache_page(miter->page); | ||
163 | sg_miter_stop(miter); | ||
164 | } | ||
165 | |||
166 | /* | ||
167 | * 32-bit PIO mapping sg iterator | ||
168 | * | ||
169 | * Hides scatterlist access issues - fragment boundaries, alignment, page | ||
170 | * mapping - for drivers using 32-bit-word-at-a-time-PIO (ie. PCI devices | ||
171 | * without DMA support). | ||
172 | * | ||
173 | * Best-case reading (transfer from device): | ||
174 | * sg_miter_start(); | ||
175 | * cb710_sg_dwiter_write_from_io(); | ||
176 | * cb710_sg_miter_stop_writing(); | ||
177 | * | ||
178 | * Best-case writing (transfer to device): | ||
179 | * sg_miter_start(); | ||
180 | * cb710_sg_dwiter_read_to_io(); | ||
181 | * sg_miter_stop(); | ||
182 | */ | ||
183 | |||
184 | uint32_t cb710_sg_dwiter_read_next_block(struct sg_mapping_iter *miter); | ||
185 | void cb710_sg_dwiter_write_next_block(struct sg_mapping_iter *miter, uint32_t data); | ||
186 | |||
187 | /** | ||
188 | * cb710_sg_dwiter_write_from_io - transfer data to mapped buffer from 32-bit IO port | ||
189 | * @miter: sg mapping iter | ||
190 | * @port: PIO port - IO or MMIO address | ||
191 | * @count: number of 32-bit words to transfer | ||
192 | * | ||
193 | * Description: | ||
194 | * Reads @count 32-bit words from register @port and stores it in | ||
195 | * buffer iterated by @miter. Data that would overflow the buffer | ||
196 | * is silently ignored. Iterator is advanced by 4*@count bytes | ||
197 | * or to the buffer's end whichever is closer. | ||
198 | * | ||
199 | * Context: | ||
200 | * IRQ disabled if the SG_MITER_ATOMIC is set. Don't care otherwise. | ||
201 | */ | ||
202 | static inline void cb710_sg_dwiter_write_from_io(struct sg_mapping_iter *miter, | ||
203 | void __iomem *port, size_t count) | ||
204 | { | ||
205 | while (count-- > 0) | ||
206 | cb710_sg_dwiter_write_next_block(miter, ioread32(port)); | ||
207 | } | ||
208 | |||
209 | /** | ||
210 | * cb710_sg_dwiter_read_to_io - transfer data to 32-bit IO port from mapped buffer | ||
211 | * @miter: sg mapping iter | ||
212 | * @port: PIO port - IO or MMIO address | ||
213 | * @count: number of 32-bit words to transfer | ||
214 | * | ||
215 | * Description: | ||
216 | * Writes @count 32-bit words to register @port from buffer iterated | ||
217 | * through @miter. If buffer ends before @count words are written | ||
218 | * missing data is replaced by zeroes. @miter is advanced by 4*@count | ||
219 | * bytes or to the buffer's end whichever is closer. | ||
220 | * | ||
221 | * Context: | ||
222 | * IRQ disabled if the SG_MITER_ATOMIC is set. Don't care otherwise. | ||
223 | */ | ||
224 | static inline void cb710_sg_dwiter_read_to_io(struct sg_mapping_iter *miter, | ||
225 | void __iomem *port, size_t count) | ||
226 | { | ||
227 | while (count-- > 0) | ||
228 | iowrite32(cb710_sg_dwiter_read_next_block(miter), port); | ||
229 | } | ||
230 | |||
231 | #endif /* LINUX_CB710_SG_H */ | ||
diff --git a/include/linux/clk.h b/include/linux/clk.h index 1db9bbf444a3..1d37f42ac294 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h | |||
@@ -142,4 +142,17 @@ struct clk *clk_get_parent(struct clk *clk); | |||
142 | */ | 142 | */ |
143 | struct clk *clk_get_sys(const char *dev_id, const char *con_id); | 143 | struct clk *clk_get_sys(const char *dev_id, const char *con_id); |
144 | 144 | ||
145 | /** | ||
146 | * clk_add_alias - add a new clock alias | ||
147 | * @alias: name for clock alias | ||
148 | * @alias_dev_name: device name | ||
149 | * @id: platform specific clock name | ||
150 | * @dev: device | ||
151 | * | ||
152 | * Allows using generic clock names for drivers by adding a new alias. | ||
153 | * Assumes clkdev, see clkdev.h for more info. | ||
154 | */ | ||
155 | int clk_add_alias(const char *alias, const char *alias_dev_name, char *id, | ||
156 | struct device *dev); | ||
157 | |||
145 | #endif | 158 | #endif |
diff --git a/include/linux/compiler-gcc3.h b/include/linux/compiler-gcc3.h index 8005effc04f1..b721129e0469 100644 --- a/include/linux/compiler-gcc3.h +++ b/include/linux/compiler-gcc3.h | |||
@@ -16,6 +16,12 @@ | |||
16 | #define __must_check __attribute__((warn_unused_result)) | 16 | #define __must_check __attribute__((warn_unused_result)) |
17 | #endif | 17 | #endif |
18 | 18 | ||
19 | #ifdef CONFIG_GCOV_KERNEL | ||
20 | # if __GNUC_MINOR__ < 4 | ||
21 | # error "GCOV profiling support for gcc versions below 3.4 not included" | ||
22 | # endif /* __GNUC_MINOR__ */ | ||
23 | #endif /* CONFIG_GCOV_KERNEL */ | ||
24 | |||
19 | /* | 25 | /* |
20 | * A trick to suppress uninitialized variable warning without generating any | 26 | * A trick to suppress uninitialized variable warning without generating any |
21 | * code | 27 | * code |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 37bcb50a4d7c..04fb5135b4e1 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -261,6 +261,11 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
261 | # define __section(S) __attribute__ ((__section__(#S))) | 261 | # define __section(S) __attribute__ ((__section__(#S))) |
262 | #endif | 262 | #endif |
263 | 263 | ||
264 | /* Are two types/vars the same type (ignoring qualifiers)? */ | ||
265 | #ifndef __same_type | ||
266 | # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) | ||
267 | #endif | ||
268 | |||
264 | /* | 269 | /* |
265 | * Prevent the compiler from merging or refetching accesses. The compiler | 270 | * Prevent the compiler from merging or refetching accesses. The compiler |
266 | * is also forbidden from reordering successive instances of ACCESS_ONCE(), | 271 | * is also forbidden from reordering successive instances of ACCESS_ONCE(), |
diff --git a/include/linux/connector.h b/include/linux/connector.h index b9966e64604e..b68d27850d51 100644 --- a/include/linux/connector.h +++ b/include/linux/connector.h | |||
@@ -41,8 +41,10 @@ | |||
41 | #define CN_IDX_BB 0x5 /* BlackBoard, from the TSP GPL sampling framework */ | 41 | #define CN_IDX_BB 0x5 /* BlackBoard, from the TSP GPL sampling framework */ |
42 | #define CN_DST_IDX 0x6 | 42 | #define CN_DST_IDX 0x6 |
43 | #define CN_DST_VAL 0x1 | 43 | #define CN_DST_VAL 0x1 |
44 | #define CN_IDX_DM 0x7 /* Device Mapper */ | ||
45 | #define CN_VAL_DM_USERSPACE_LOG 0x1 | ||
44 | 46 | ||
45 | #define CN_NETLINK_USERS 7 | 47 | #define CN_NETLINK_USERS 8 |
46 | 48 | ||
47 | /* | 49 | /* |
48 | * Maximum connector's message size. | 50 | * Maximum connector's message size. |
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index d71f7c0f931b..38fe59dc89ae 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h | |||
@@ -89,7 +89,6 @@ struct vc_data { | |||
89 | unsigned int vc_need_wrap : 1; | 89 | unsigned int vc_need_wrap : 1; |
90 | unsigned int vc_can_do_color : 1; | 90 | unsigned int vc_can_do_color : 1; |
91 | unsigned int vc_report_mouse : 2; | 91 | unsigned int vc_report_mouse : 2; |
92 | unsigned int vc_kmalloced : 1; | ||
93 | unsigned char vc_utf : 1; /* Unicode UTF-8 encoding */ | 92 | unsigned char vc_utf : 1; /* Unicode UTF-8 encoding */ |
94 | unsigned char vc_utf_count; | 93 | unsigned char vc_utf_count; |
95 | int vc_utf_char; | 94 | int vc_utf_char; |
diff --git a/include/linux/cpu.h b/include/linux/cpu.h index 2643d848df90..4d668e05d458 100644 --- a/include/linux/cpu.h +++ b/include/linux/cpu.h | |||
@@ -69,7 +69,6 @@ static inline void unregister_cpu_notifier(struct notifier_block *nb) | |||
69 | 69 | ||
70 | int cpu_up(unsigned int cpu); | 70 | int cpu_up(unsigned int cpu); |
71 | void notify_cpu_starting(unsigned int cpu); | 71 | void notify_cpu_starting(unsigned int cpu); |
72 | extern void cpu_hotplug_init(void); | ||
73 | extern void cpu_maps_update_begin(void); | 72 | extern void cpu_maps_update_begin(void); |
74 | extern void cpu_maps_update_done(void); | 73 | extern void cpu_maps_update_done(void); |
75 | 74 | ||
@@ -84,10 +83,6 @@ static inline void unregister_cpu_notifier(struct notifier_block *nb) | |||
84 | { | 83 | { |
85 | } | 84 | } |
86 | 85 | ||
87 | static inline void cpu_hotplug_init(void) | ||
88 | { | ||
89 | } | ||
90 | |||
91 | static inline void cpu_maps_update_begin(void) | 86 | static inline void cpu_maps_update_begin(void) |
92 | { | 87 | { |
93 | } | 88 | } |
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 05ea1dd7d681..a5740fc4d04b 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
@@ -18,7 +18,6 @@ | |||
18 | 18 | ||
19 | extern int number_of_cpusets; /* How many cpusets are defined in system? */ | 19 | extern int number_of_cpusets; /* How many cpusets are defined in system? */ |
20 | 20 | ||
21 | extern int cpuset_init_early(void); | ||
22 | extern int cpuset_init(void); | 21 | extern int cpuset_init(void); |
23 | extern void cpuset_init_smp(void); | 22 | extern void cpuset_init_smp(void); |
24 | extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask); | 23 | extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask); |
@@ -27,7 +26,6 @@ extern void cpuset_cpus_allowed_locked(struct task_struct *p, | |||
27 | extern nodemask_t cpuset_mems_allowed(struct task_struct *p); | 26 | extern nodemask_t cpuset_mems_allowed(struct task_struct *p); |
28 | #define cpuset_current_mems_allowed (current->mems_allowed) | 27 | #define cpuset_current_mems_allowed (current->mems_allowed) |
29 | void cpuset_init_current_mems_allowed(void); | 28 | void cpuset_init_current_mems_allowed(void); |
30 | void cpuset_update_task_memory_state(void); | ||
31 | int cpuset_nodemask_valid_mems_allowed(nodemask_t *nodemask); | 29 | int cpuset_nodemask_valid_mems_allowed(nodemask_t *nodemask); |
32 | 30 | ||
33 | extern int __cpuset_node_allowed_softwall(int node, gfp_t gfp_mask); | 31 | extern int __cpuset_node_allowed_softwall(int node, gfp_t gfp_mask); |
@@ -92,9 +90,13 @@ extern void rebuild_sched_domains(void); | |||
92 | 90 | ||
93 | extern void cpuset_print_task_mems_allowed(struct task_struct *p); | 91 | extern void cpuset_print_task_mems_allowed(struct task_struct *p); |
94 | 92 | ||
93 | static inline void set_mems_allowed(nodemask_t nodemask) | ||
94 | { | ||
95 | current->mems_allowed = nodemask; | ||
96 | } | ||
97 | |||
95 | #else /* !CONFIG_CPUSETS */ | 98 | #else /* !CONFIG_CPUSETS */ |
96 | 99 | ||
97 | static inline int cpuset_init_early(void) { return 0; } | ||
98 | static inline int cpuset_init(void) { return 0; } | 100 | static inline int cpuset_init(void) { return 0; } |
99 | static inline void cpuset_init_smp(void) {} | 101 | static inline void cpuset_init_smp(void) {} |
100 | 102 | ||
@@ -116,7 +118,6 @@ static inline nodemask_t cpuset_mems_allowed(struct task_struct *p) | |||
116 | 118 | ||
117 | #define cpuset_current_mems_allowed (node_states[N_HIGH_MEMORY]) | 119 | #define cpuset_current_mems_allowed (node_states[N_HIGH_MEMORY]) |
118 | static inline void cpuset_init_current_mems_allowed(void) {} | 120 | static inline void cpuset_init_current_mems_allowed(void) {} |
119 | static inline void cpuset_update_task_memory_state(void) {} | ||
120 | 121 | ||
121 | static inline int cpuset_nodemask_valid_mems_allowed(nodemask_t *nodemask) | 122 | static inline int cpuset_nodemask_valid_mems_allowed(nodemask_t *nodemask) |
122 | { | 123 | { |
@@ -188,6 +189,10 @@ static inline void cpuset_print_task_mems_allowed(struct task_struct *p) | |||
188 | { | 189 | { |
189 | } | 190 | } |
190 | 191 | ||
192 | static inline void set_mems_allowed(nodemask_t nodemask) | ||
193 | { | ||
194 | } | ||
195 | |||
191 | #endif /* !CONFIG_CPUSETS */ | 196 | #endif /* !CONFIG_CPUSETS */ |
192 | 197 | ||
193 | #endif /* _LINUX_CPUSET_H */ | 198 | #endif /* _LINUX_CPUSET_H */ |
diff --git a/include/linux/crash_dump.h b/include/linux/crash_dump.h index 2dac064d8359..0026f267da20 100644 --- a/include/linux/crash_dump.h +++ b/include/linux/crash_dump.h | |||
@@ -3,7 +3,6 @@ | |||
3 | 3 | ||
4 | #ifdef CONFIG_CRASH_DUMP | 4 | #ifdef CONFIG_CRASH_DUMP |
5 | #include <linux/kexec.h> | 5 | #include <linux/kexec.h> |
6 | #include <linux/smp_lock.h> | ||
7 | #include <linux/device.h> | 6 | #include <linux/device.h> |
8 | #include <linux/proc_fs.h> | 7 | #include <linux/proc_fs.h> |
9 | 8 | ||
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index 49c2362977fd..0d6310657f32 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/bio.h> | 11 | #include <linux/bio.h> |
12 | #include <linux/blkdev.h> | 12 | #include <linux/blkdev.h> |
13 | 13 | ||
14 | struct dm_dev; | ||
14 | struct dm_target; | 15 | struct dm_target; |
15 | struct dm_table; | 16 | struct dm_table; |
16 | struct mapped_device; | 17 | struct mapped_device; |
@@ -21,6 +22,7 @@ typedef enum { STATUSTYPE_INFO, STATUSTYPE_TABLE } status_type_t; | |||
21 | union map_info { | 22 | union map_info { |
22 | void *ptr; | 23 | void *ptr; |
23 | unsigned long long ll; | 24 | unsigned long long ll; |
25 | unsigned flush_request; | ||
24 | }; | 26 | }; |
25 | 27 | ||
26 | /* | 28 | /* |
@@ -80,6 +82,15 @@ typedef int (*dm_ioctl_fn) (struct dm_target *ti, unsigned int cmd, | |||
80 | typedef int (*dm_merge_fn) (struct dm_target *ti, struct bvec_merge_data *bvm, | 82 | typedef int (*dm_merge_fn) (struct dm_target *ti, struct bvec_merge_data *bvm, |
81 | struct bio_vec *biovec, int max_size); | 83 | struct bio_vec *biovec, int max_size); |
82 | 84 | ||
85 | typedef int (*iterate_devices_callout_fn) (struct dm_target *ti, | ||
86 | struct dm_dev *dev, | ||
87 | sector_t physical_start, | ||
88 | void *data); | ||
89 | |||
90 | typedef int (*dm_iterate_devices_fn) (struct dm_target *ti, | ||
91 | iterate_devices_callout_fn fn, | ||
92 | void *data); | ||
93 | |||
83 | /* | 94 | /* |
84 | * Returns: | 95 | * Returns: |
85 | * 0: The target can handle the next I/O immediately. | 96 | * 0: The target can handle the next I/O immediately. |
@@ -92,7 +103,8 @@ void dm_error(const char *message); | |||
92 | /* | 103 | /* |
93 | * Combine device limits. | 104 | * Combine device limits. |
94 | */ | 105 | */ |
95 | void dm_set_device_limits(struct dm_target *ti, struct block_device *bdev); | 106 | int dm_set_device_limits(struct dm_target *ti, struct dm_dev *dev, |
107 | sector_t start, void *data); | ||
96 | 108 | ||
97 | struct dm_dev { | 109 | struct dm_dev { |
98 | struct block_device *bdev; | 110 | struct block_device *bdev; |
@@ -138,23 +150,12 @@ struct target_type { | |||
138 | dm_ioctl_fn ioctl; | 150 | dm_ioctl_fn ioctl; |
139 | dm_merge_fn merge; | 151 | dm_merge_fn merge; |
140 | dm_busy_fn busy; | 152 | dm_busy_fn busy; |
153 | dm_iterate_devices_fn iterate_devices; | ||
141 | 154 | ||
142 | /* For internal device-mapper use. */ | 155 | /* For internal device-mapper use. */ |
143 | struct list_head list; | 156 | struct list_head list; |
144 | }; | 157 | }; |
145 | 158 | ||
146 | struct io_restrictions { | ||
147 | unsigned long bounce_pfn; | ||
148 | unsigned long seg_boundary_mask; | ||
149 | unsigned max_hw_sectors; | ||
150 | unsigned max_sectors; | ||
151 | unsigned max_segment_size; | ||
152 | unsigned short logical_block_size; | ||
153 | unsigned short max_hw_segments; | ||
154 | unsigned short max_phys_segments; | ||
155 | unsigned char no_cluster; /* inverted so that 0 is default */ | ||
156 | }; | ||
157 | |||
158 | struct dm_target { | 159 | struct dm_target { |
159 | struct dm_table *table; | 160 | struct dm_table *table; |
160 | struct target_type *type; | 161 | struct target_type *type; |
@@ -163,15 +164,18 @@ struct dm_target { | |||
163 | sector_t begin; | 164 | sector_t begin; |
164 | sector_t len; | 165 | sector_t len; |
165 | 166 | ||
166 | /* FIXME: turn this into a mask, and merge with io_restrictions */ | ||
167 | /* Always a power of 2 */ | 167 | /* Always a power of 2 */ |
168 | sector_t split_io; | 168 | sector_t split_io; |
169 | 169 | ||
170 | /* | 170 | /* |
171 | * These are automatically filled in by | 171 | * A number of zero-length barrier requests that will be submitted |
172 | * dm_table_get_device. | 172 | * to the target for the purpose of flushing cache. |
173 | * | ||
174 | * The request number will be placed in union map_info->flush_request. | ||
175 | * It is a responsibility of the target driver to remap these requests | ||
176 | * to the real underlying devices. | ||
173 | */ | 177 | */ |
174 | struct io_restrictions limits; | 178 | unsigned num_flush_requests; |
175 | 179 | ||
176 | /* target specific data */ | 180 | /* target specific data */ |
177 | void *private; | 181 | void *private; |
@@ -230,6 +234,7 @@ struct gendisk *dm_disk(struct mapped_device *md); | |||
230 | int dm_suspended(struct mapped_device *md); | 234 | int dm_suspended(struct mapped_device *md); |
231 | int dm_noflush_suspending(struct dm_target *ti); | 235 | int dm_noflush_suspending(struct dm_target *ti); |
232 | union map_info *dm_get_mapinfo(struct bio *bio); | 236 | union map_info *dm_get_mapinfo(struct bio *bio); |
237 | union map_info *dm_get_rq_mapinfo(struct request *rq); | ||
233 | 238 | ||
234 | /* | 239 | /* |
235 | * Geometry functions. | 240 | * Geometry functions. |
@@ -392,4 +397,12 @@ static inline unsigned long to_bytes(sector_t n) | |||
392 | return (n << SECTOR_SHIFT); | 397 | return (n << SECTOR_SHIFT); |
393 | } | 398 | } |
394 | 399 | ||
400 | /*----------------------------------------------------------------- | ||
401 | * Helper for block layer and dm core operations | ||
402 | *---------------------------------------------------------------*/ | ||
403 | void dm_dispatch_request(struct request *rq); | ||
404 | void dm_requeue_unmapped_request(struct request *rq); | ||
405 | void dm_kill_unmapped_request(struct request *rq, int error); | ||
406 | int dm_underlying_device_busy(struct request_queue *q); | ||
407 | |||
395 | #endif /* _LINUX_DEVICE_MAPPER_H */ | 408 | #endif /* _LINUX_DEVICE_MAPPER_H */ |
diff --git a/include/linux/device.h b/include/linux/device.h index 5d5c197bad45..aebb81036db2 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -25,8 +25,6 @@ | |||
25 | #include <asm/atomic.h> | 25 | #include <asm/atomic.h> |
26 | #include <asm/device.h> | 26 | #include <asm/device.h> |
27 | 27 | ||
28 | #define BUS_ID_SIZE 20 | ||
29 | |||
30 | struct device; | 28 | struct device; |
31 | struct device_private; | 29 | struct device_private; |
32 | struct device_driver; | 30 | struct device_driver; |
@@ -62,8 +60,6 @@ struct bus_type { | |||
62 | void (*shutdown)(struct device *dev); | 60 | void (*shutdown)(struct device *dev); |
63 | 61 | ||
64 | int (*suspend)(struct device *dev, pm_message_t state); | 62 | int (*suspend)(struct device *dev, pm_message_t state); |
65 | int (*suspend_late)(struct device *dev, pm_message_t state); | ||
66 | int (*resume_early)(struct device *dev); | ||
67 | int (*resume)(struct device *dev); | 63 | int (*resume)(struct device *dev); |
68 | 64 | ||
69 | struct dev_pm_ops *pm; | 65 | struct dev_pm_ops *pm; |
@@ -116,6 +112,8 @@ extern int bus_unregister_notifier(struct bus_type *bus, | |||
116 | #define BUS_NOTIFY_BOUND_DRIVER 0x00000003 /* driver bound to device */ | 112 | #define BUS_NOTIFY_BOUND_DRIVER 0x00000003 /* driver bound to device */ |
117 | #define BUS_NOTIFY_UNBIND_DRIVER 0x00000004 /* driver about to be | 113 | #define BUS_NOTIFY_UNBIND_DRIVER 0x00000004 /* driver about to be |
118 | unbound */ | 114 | unbound */ |
115 | #define BUS_NOTIFY_UNBOUND_DRIVER 0x00000005 /* driver is unbound | ||
116 | from the device */ | ||
119 | 117 | ||
120 | extern struct kset *bus_get_kset(struct bus_type *bus); | 118 | extern struct kset *bus_get_kset(struct bus_type *bus); |
121 | extern struct klist *bus_get_device_klist(struct bus_type *bus); | 119 | extern struct klist *bus_get_device_klist(struct bus_type *bus); |
@@ -194,6 +192,7 @@ struct class { | |||
194 | struct kobject *dev_kobj; | 192 | struct kobject *dev_kobj; |
195 | 193 | ||
196 | int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env); | 194 | int (*dev_uevent)(struct device *dev, struct kobj_uevent_env *env); |
195 | char *(*nodename)(struct device *dev); | ||
197 | 196 | ||
198 | void (*class_release)(struct class *class); | 197 | void (*class_release)(struct class *class); |
199 | void (*dev_release)(struct device *dev); | 198 | void (*dev_release)(struct device *dev); |
@@ -289,11 +288,9 @@ struct device_type { | |||
289 | const char *name; | 288 | const char *name; |
290 | struct attribute_group **groups; | 289 | struct attribute_group **groups; |
291 | int (*uevent)(struct device *dev, struct kobj_uevent_env *env); | 290 | int (*uevent)(struct device *dev, struct kobj_uevent_env *env); |
291 | char *(*nodename)(struct device *dev); | ||
292 | void (*release)(struct device *dev); | 292 | void (*release)(struct device *dev); |
293 | 293 | ||
294 | int (*suspend)(struct device *dev, pm_message_t state); | ||
295 | int (*resume)(struct device *dev); | ||
296 | |||
297 | struct dev_pm_ops *pm; | 294 | struct dev_pm_ops *pm; |
298 | }; | 295 | }; |
299 | 296 | ||
@@ -491,6 +488,7 @@ extern struct device *device_find_child(struct device *dev, void *data, | |||
491 | extern int device_rename(struct device *dev, char *new_name); | 488 | extern int device_rename(struct device *dev, char *new_name); |
492 | extern int device_move(struct device *dev, struct device *new_parent, | 489 | extern int device_move(struct device *dev, struct device *new_parent, |
493 | enum dpm_order dpm_order); | 490 | enum dpm_order dpm_order); |
491 | extern const char *device_get_nodename(struct device *dev, const char **tmp); | ||
494 | 492 | ||
495 | /* | 493 | /* |
496 | * Root device objects for grouping under /sys/devices | 494 | * Root device objects for grouping under /sys/devices |
diff --git a/include/linux/dlm.h b/include/linux/dlm.h index b9cd38603fd8..0b3518c42356 100644 --- a/include/linux/dlm.h +++ b/include/linux/dlm.h | |||
@@ -81,8 +81,8 @@ struct dlm_lksb { | |||
81 | * the cluster, the calling node joins it. | 81 | * the cluster, the calling node joins it. |
82 | */ | 82 | */ |
83 | 83 | ||
84 | int dlm_new_lockspace(char *name, int namelen, dlm_lockspace_t **lockspace, | 84 | int dlm_new_lockspace(const char *name, int namelen, |
85 | uint32_t flags, int lvblen); | 85 | dlm_lockspace_t **lockspace, uint32_t flags, int lvblen); |
86 | 86 | ||
87 | /* | 87 | /* |
88 | * dlm_release_lockspace | 88 | * dlm_release_lockspace |
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h index 48e44ee2b466..2ab84c83c31a 100644 --- a/include/linux/dm-ioctl.h +++ b/include/linux/dm-ioctl.h | |||
@@ -123,6 +123,16 @@ struct dm_ioctl { | |||
123 | __u32 target_count; /* in/out */ | 123 | __u32 target_count; /* in/out */ |
124 | __s32 open_count; /* out */ | 124 | __s32 open_count; /* out */ |
125 | __u32 flags; /* in/out */ | 125 | __u32 flags; /* in/out */ |
126 | |||
127 | /* | ||
128 | * event_nr holds either the event number (input and output) or the | ||
129 | * udev cookie value (input only). | ||
130 | * The DM_DEV_WAIT ioctl takes an event number as input. | ||
131 | * The DM_SUSPEND, DM_DEV_REMOVE and DM_DEV_RENAME ioctls | ||
132 | * use the field as a cookie to return in the DM_COOKIE | ||
133 | * variable with the uevents they issue. | ||
134 | * For output, the ioctls return the event number, not the cookie. | ||
135 | */ | ||
126 | __u32 event_nr; /* in/out */ | 136 | __u32 event_nr; /* in/out */ |
127 | __u32 padding; | 137 | __u32 padding; |
128 | 138 | ||
@@ -256,9 +266,9 @@ enum { | |||
256 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) | 266 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) |
257 | 267 | ||
258 | #define DM_VERSION_MAJOR 4 | 268 | #define DM_VERSION_MAJOR 4 |
259 | #define DM_VERSION_MINOR 14 | 269 | #define DM_VERSION_MINOR 15 |
260 | #define DM_VERSION_PATCHLEVEL 0 | 270 | #define DM_VERSION_PATCHLEVEL 0 |
261 | #define DM_VERSION_EXTRA "-ioctl (2008-04-23)" | 271 | #define DM_VERSION_EXTRA "-ioctl (2009-04-01)" |
262 | 272 | ||
263 | /* Status bits */ | 273 | /* Status bits */ |
264 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ | 274 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ |
diff --git a/include/linux/dm-log-userspace.h b/include/linux/dm-log-userspace.h new file mode 100644 index 000000000000..642e3017b51f --- /dev/null +++ b/include/linux/dm-log-userspace.h | |||
@@ -0,0 +1,386 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2006-2009 Red Hat, Inc. | ||
3 | * | ||
4 | * This file is released under the LGPL. | ||
5 | */ | ||
6 | |||
7 | #ifndef __DM_LOG_USERSPACE_H__ | ||
8 | #define __DM_LOG_USERSPACE_H__ | ||
9 | |||
10 | #include <linux/dm-ioctl.h> /* For DM_UUID_LEN */ | ||
11 | |||
12 | /* | ||
13 | * The device-mapper userspace log module consists of a kernel component and | ||
14 | * a user-space component. The kernel component implements the API defined | ||
15 | * in dm-dirty-log.h. Its purpose is simply to pass the parameters and | ||
16 | * return values of those API functions between kernel and user-space. | ||
17 | * | ||
18 | * Below are defined the 'request_types' - DM_ULOG_CTR, DM_ULOG_DTR, etc. | ||
19 | * These request types represent the different functions in the device-mapper | ||
20 | * dirty log API. Each of these is described in more detail below. | ||
21 | * | ||
22 | * The user-space program must listen for requests from the kernel (representing | ||
23 | * the various API functions) and process them. | ||
24 | * | ||
25 | * User-space begins by setting up the communication link (error checking | ||
26 | * removed for clarity): | ||
27 | * fd = socket(PF_NETLINK, SOCK_DGRAM, NETLINK_CONNECTOR); | ||
28 | * addr.nl_family = AF_NETLINK; | ||
29 | * addr.nl_groups = CN_IDX_DM; | ||
30 | * addr.nl_pid = 0; | ||
31 | * r = bind(fd, (struct sockaddr *) &addr, sizeof(addr)); | ||
32 | * opt = addr.nl_groups; | ||
33 | * setsockopt(fd, SOL_NETLINK, NETLINK_ADD_MEMBERSHIP, &opt, sizeof(opt)); | ||
34 | * | ||
35 | * User-space will then wait to receive requests form the kernel, which it | ||
36 | * will process as described below. The requests are received in the form, | ||
37 | * ((struct dm_ulog_request) + (additional data)). Depending on the request | ||
38 | * type, there may or may not be 'additional data'. In the descriptions below, | ||
39 | * you will see 'Payload-to-userspace' and 'Payload-to-kernel'. The | ||
40 | * 'Payload-to-userspace' is what the kernel sends in 'additional data' as | ||
41 | * necessary parameters to complete the request. The 'Payload-to-kernel' is | ||
42 | * the 'additional data' returned to the kernel that contains the necessary | ||
43 | * results of the request. The 'data_size' field in the dm_ulog_request | ||
44 | * structure denotes the availability and amount of payload data. | ||
45 | */ | ||
46 | |||
47 | /* | ||
48 | * DM_ULOG_CTR corresponds to (found in dm-dirty-log.h): | ||
49 | * int (*ctr)(struct dm_dirty_log *log, struct dm_target *ti, | ||
50 | * unsigned argc, char **argv); | ||
51 | * | ||
52 | * Payload-to-userspace: | ||
53 | * A single string containing all the argv arguments separated by ' 's | ||
54 | * Payload-to-kernel: | ||
55 | * None. ('data_size' in the dm_ulog_request struct should be 0.) | ||
56 | * | ||
57 | * The UUID contained in the dm_ulog_request structure is the reference that | ||
58 | * will be used by all request types to a specific log. The constructor must | ||
59 | * record this assotiation with instance created. | ||
60 | * | ||
61 | * When the request has been processed, user-space must return the | ||
62 | * dm_ulog_request to the kernel - setting the 'error' field and | ||
63 | * 'data_size' appropriately. | ||
64 | */ | ||
65 | #define DM_ULOG_CTR 1 | ||
66 | |||
67 | /* | ||
68 | * DM_ULOG_DTR corresponds to (found in dm-dirty-log.h): | ||
69 | * void (*dtr)(struct dm_dirty_log *log); | ||
70 | * | ||
71 | * Payload-to-userspace: | ||
72 | * A single string containing all the argv arguments separated by ' 's | ||
73 | * Payload-to-kernel: | ||
74 | * None. ('data_size' in the dm_ulog_request struct should be 0.) | ||
75 | * | ||
76 | * The UUID contained in the dm_ulog_request structure is all that is | ||
77 | * necessary to identify the log instance being destroyed. There is no | ||
78 | * payload data. | ||
79 | * | ||
80 | * When the request has been processed, user-space must return the | ||
81 | * dm_ulog_request to the kernel - setting the 'error' field and clearing | ||
82 | * 'data_size' appropriately. | ||
83 | */ | ||
84 | #define DM_ULOG_DTR 2 | ||
85 | |||
86 | /* | ||
87 | * DM_ULOG_PRESUSPEND corresponds to (found in dm-dirty-log.h): | ||
88 | * int (*presuspend)(struct dm_dirty_log *log); | ||
89 | * | ||
90 | * Payload-to-userspace: | ||
91 | * None. | ||
92 | * Payload-to-kernel: | ||
93 | * None. | ||
94 | * | ||
95 | * The UUID contained in the dm_ulog_request structure is all that is | ||
96 | * necessary to identify the log instance being presuspended. There is no | ||
97 | * payload data. | ||
98 | * | ||
99 | * When the request has been processed, user-space must return the | ||
100 | * dm_ulog_request to the kernel - setting the 'error' field and | ||
101 | * 'data_size' appropriately. | ||
102 | */ | ||
103 | #define DM_ULOG_PRESUSPEND 3 | ||
104 | |||
105 | /* | ||
106 | * DM_ULOG_POSTSUSPEND corresponds to (found in dm-dirty-log.h): | ||
107 | * int (*postsuspend)(struct dm_dirty_log *log); | ||
108 | * | ||
109 | * Payload-to-userspace: | ||
110 | * None. | ||
111 | * Payload-to-kernel: | ||
112 | * None. | ||
113 | * | ||
114 | * The UUID contained in the dm_ulog_request structure is all that is | ||
115 | * necessary to identify the log instance being postsuspended. There is no | ||
116 | * payload data. | ||
117 | * | ||
118 | * When the request has been processed, user-space must return the | ||
119 | * dm_ulog_request to the kernel - setting the 'error' field and | ||
120 | * 'data_size' appropriately. | ||
121 | */ | ||
122 | #define DM_ULOG_POSTSUSPEND 4 | ||
123 | |||
124 | /* | ||
125 | * DM_ULOG_RESUME corresponds to (found in dm-dirty-log.h): | ||
126 | * int (*resume)(struct dm_dirty_log *log); | ||
127 | * | ||
128 | * Payload-to-userspace: | ||
129 | * None. | ||
130 | * Payload-to-kernel: | ||
131 | * None. | ||
132 | * | ||
133 | * The UUID contained in the dm_ulog_request structure is all that is | ||
134 | * necessary to identify the log instance being resumed. There is no | ||
135 | * payload data. | ||
136 | * | ||
137 | * When the request has been processed, user-space must return the | ||
138 | * dm_ulog_request to the kernel - setting the 'error' field and | ||
139 | * 'data_size' appropriately. | ||
140 | */ | ||
141 | #define DM_ULOG_RESUME 5 | ||
142 | |||
143 | /* | ||
144 | * DM_ULOG_GET_REGION_SIZE corresponds to (found in dm-dirty-log.h): | ||
145 | * uint32_t (*get_region_size)(struct dm_dirty_log *log); | ||
146 | * | ||
147 | * Payload-to-userspace: | ||
148 | * None. | ||
149 | * Payload-to-kernel: | ||
150 | * uint64_t - contains the region size | ||
151 | * | ||
152 | * The region size is something that was determined at constructor time. | ||
153 | * It is returned in the payload area and 'data_size' is set to | ||
154 | * reflect this. | ||
155 | * | ||
156 | * When the request has been processed, user-space must return the | ||
157 | * dm_ulog_request to the kernel - setting the 'error' field appropriately. | ||
158 | */ | ||
159 | #define DM_ULOG_GET_REGION_SIZE 6 | ||
160 | |||
161 | /* | ||
162 | * DM_ULOG_IS_CLEAN corresponds to (found in dm-dirty-log.h): | ||
163 | * int (*is_clean)(struct dm_dirty_log *log, region_t region); | ||
164 | * | ||
165 | * Payload-to-userspace: | ||
166 | * uint64_t - the region to get clean status on | ||
167 | * Payload-to-kernel: | ||
168 | * int64_t - 1 if clean, 0 otherwise | ||
169 | * | ||
170 | * Payload is sizeof(uint64_t) and contains the region for which the clean | ||
171 | * status is being made. | ||
172 | * | ||
173 | * When the request has been processed, user-space must return the | ||
174 | * dm_ulog_request to the kernel - filling the payload with 0 (not clean) or | ||
175 | * 1 (clean), setting 'data_size' and 'error' appropriately. | ||
176 | */ | ||
177 | #define DM_ULOG_IS_CLEAN 7 | ||
178 | |||
179 | /* | ||
180 | * DM_ULOG_IN_SYNC corresponds to (found in dm-dirty-log.h): | ||
181 | * int (*in_sync)(struct dm_dirty_log *log, region_t region, | ||
182 | * int can_block); | ||
183 | * | ||
184 | * Payload-to-userspace: | ||
185 | * uint64_t - the region to get sync status on | ||
186 | * Payload-to-kernel: | ||
187 | * int64_t - 1 if in-sync, 0 otherwise | ||
188 | * | ||
189 | * Exactly the same as 'is_clean' above, except this time asking "has the | ||
190 | * region been recovered?" vs. "is the region not being modified?" | ||
191 | */ | ||
192 | #define DM_ULOG_IN_SYNC 8 | ||
193 | |||
194 | /* | ||
195 | * DM_ULOG_FLUSH corresponds to (found in dm-dirty-log.h): | ||
196 | * int (*flush)(struct dm_dirty_log *log); | ||
197 | * | ||
198 | * Payload-to-userspace: | ||
199 | * None. | ||
200 | * Payload-to-kernel: | ||
201 | * None. | ||
202 | * | ||
203 | * No incoming or outgoing payload. Simply flush log state to disk. | ||
204 | * | ||
205 | * When the request has been processed, user-space must return the | ||
206 | * dm_ulog_request to the kernel - setting the 'error' field and clearing | ||
207 | * 'data_size' appropriately. | ||
208 | */ | ||
209 | #define DM_ULOG_FLUSH 9 | ||
210 | |||
211 | /* | ||
212 | * DM_ULOG_MARK_REGION corresponds to (found in dm-dirty-log.h): | ||
213 | * void (*mark_region)(struct dm_dirty_log *log, region_t region); | ||
214 | * | ||
215 | * Payload-to-userspace: | ||
216 | * uint64_t [] - region(s) to mark | ||
217 | * Payload-to-kernel: | ||
218 | * None. | ||
219 | * | ||
220 | * Incoming payload contains the one or more regions to mark dirty. | ||
221 | * The number of regions contained in the payload can be determined from | ||
222 | * 'data_size/sizeof(uint64_t)'. | ||
223 | * | ||
224 | * When the request has been processed, user-space must return the | ||
225 | * dm_ulog_request to the kernel - setting the 'error' field and clearing | ||
226 | * 'data_size' appropriately. | ||
227 | */ | ||
228 | #define DM_ULOG_MARK_REGION 10 | ||
229 | |||
230 | /* | ||
231 | * DM_ULOG_CLEAR_REGION corresponds to (found in dm-dirty-log.h): | ||
232 | * void (*clear_region)(struct dm_dirty_log *log, region_t region); | ||
233 | * | ||
234 | * Payload-to-userspace: | ||
235 | * uint64_t [] - region(s) to clear | ||
236 | * Payload-to-kernel: | ||
237 | * None. | ||
238 | * | ||
239 | * Incoming payload contains the one or more regions to mark clean. | ||
240 | * The number of regions contained in the payload can be determined from | ||
241 | * 'data_size/sizeof(uint64_t)'. | ||
242 | * | ||
243 | * When the request has been processed, user-space must return the | ||
244 | * dm_ulog_request to the kernel - setting the 'error' field and clearing | ||
245 | * 'data_size' appropriately. | ||
246 | */ | ||
247 | #define DM_ULOG_CLEAR_REGION 11 | ||
248 | |||
249 | /* | ||
250 | * DM_ULOG_GET_RESYNC_WORK corresponds to (found in dm-dirty-log.h): | ||
251 | * int (*get_resync_work)(struct dm_dirty_log *log, region_t *region); | ||
252 | * | ||
253 | * Payload-to-userspace: | ||
254 | * None. | ||
255 | * Payload-to-kernel: | ||
256 | * { | ||
257 | * int64_t i; -- 1 if recovery necessary, 0 otherwise | ||
258 | * uint64_t r; -- The region to recover if i=1 | ||
259 | * } | ||
260 | * 'data_size' should be set appropriately. | ||
261 | * | ||
262 | * When the request has been processed, user-space must return the | ||
263 | * dm_ulog_request to the kernel - setting the 'error' field appropriately. | ||
264 | */ | ||
265 | #define DM_ULOG_GET_RESYNC_WORK 12 | ||
266 | |||
267 | /* | ||
268 | * DM_ULOG_SET_REGION_SYNC corresponds to (found in dm-dirty-log.h): | ||
269 | * void (*set_region_sync)(struct dm_dirty_log *log, | ||
270 | * region_t region, int in_sync); | ||
271 | * | ||
272 | * Payload-to-userspace: | ||
273 | * { | ||
274 | * uint64_t - region to set sync state on | ||
275 | * int64_t - 0 if not-in-sync, 1 if in-sync | ||
276 | * } | ||
277 | * Payload-to-kernel: | ||
278 | * None. | ||
279 | * | ||
280 | * When the request has been processed, user-space must return the | ||
281 | * dm_ulog_request to the kernel - setting the 'error' field and clearing | ||
282 | * 'data_size' appropriately. | ||
283 | */ | ||
284 | #define DM_ULOG_SET_REGION_SYNC 13 | ||
285 | |||
286 | /* | ||
287 | * DM_ULOG_GET_SYNC_COUNT corresponds to (found in dm-dirty-log.h): | ||
288 | * region_t (*get_sync_count)(struct dm_dirty_log *log); | ||
289 | * | ||
290 | * Payload-to-userspace: | ||
291 | * None. | ||
292 | * Payload-to-kernel: | ||
293 | * uint64_t - the number of in-sync regions | ||
294 | * | ||
295 | * No incoming payload. Kernel-bound payload contains the number of | ||
296 | * regions that are in-sync (in a size_t). | ||
297 | * | ||
298 | * When the request has been processed, user-space must return the | ||
299 | * dm_ulog_request to the kernel - setting the 'error' field and | ||
300 | * 'data_size' appropriately. | ||
301 | */ | ||
302 | #define DM_ULOG_GET_SYNC_COUNT 14 | ||
303 | |||
304 | /* | ||
305 | * DM_ULOG_STATUS_INFO corresponds to (found in dm-dirty-log.h): | ||
306 | * int (*status)(struct dm_dirty_log *log, STATUSTYPE_INFO, | ||
307 | * char *result, unsigned maxlen); | ||
308 | * | ||
309 | * Payload-to-userspace: | ||
310 | * None. | ||
311 | * Payload-to-kernel: | ||
312 | * Character string containing STATUSTYPE_INFO | ||
313 | * | ||
314 | * When the request has been processed, user-space must return the | ||
315 | * dm_ulog_request to the kernel - setting the 'error' field and | ||
316 | * 'data_size' appropriately. | ||
317 | */ | ||
318 | #define DM_ULOG_STATUS_INFO 15 | ||
319 | |||
320 | /* | ||
321 | * DM_ULOG_STATUS_TABLE corresponds to (found in dm-dirty-log.h): | ||
322 | * int (*status)(struct dm_dirty_log *log, STATUSTYPE_TABLE, | ||
323 | * char *result, unsigned maxlen); | ||
324 | * | ||
325 | * Payload-to-userspace: | ||
326 | * None. | ||
327 | * Payload-to-kernel: | ||
328 | * Character string containing STATUSTYPE_TABLE | ||
329 | * | ||
330 | * When the request has been processed, user-space must return the | ||
331 | * dm_ulog_request to the kernel - setting the 'error' field and | ||
332 | * 'data_size' appropriately. | ||
333 | */ | ||
334 | #define DM_ULOG_STATUS_TABLE 16 | ||
335 | |||
336 | /* | ||
337 | * DM_ULOG_IS_REMOTE_RECOVERING corresponds to (found in dm-dirty-log.h): | ||
338 | * int (*is_remote_recovering)(struct dm_dirty_log *log, region_t region); | ||
339 | * | ||
340 | * Payload-to-userspace: | ||
341 | * uint64_t - region to determine recovery status on | ||
342 | * Payload-to-kernel: | ||
343 | * { | ||
344 | * int64_t is_recovering; -- 0 if no, 1 if yes | ||
345 | * uint64_t in_sync_hint; -- lowest region still needing resync | ||
346 | * } | ||
347 | * | ||
348 | * When the request has been processed, user-space must return the | ||
349 | * dm_ulog_request to the kernel - setting the 'error' field and | ||
350 | * 'data_size' appropriately. | ||
351 | */ | ||
352 | #define DM_ULOG_IS_REMOTE_RECOVERING 17 | ||
353 | |||
354 | /* | ||
355 | * (DM_ULOG_REQUEST_MASK & request_type) to get the request type | ||
356 | * | ||
357 | * Payload-to-userspace: | ||
358 | * A single string containing all the argv arguments separated by ' 's | ||
359 | * Payload-to-kernel: | ||
360 | * None. ('data_size' in the dm_ulog_request struct should be 0.) | ||
361 | * | ||
362 | * We are reserving 8 bits of the 32-bit 'request_type' field for the | ||
363 | * various request types above. The remaining 24-bits are currently | ||
364 | * set to zero and are reserved for future use and compatibility concerns. | ||
365 | * | ||
366 | * User-space should always use DM_ULOG_REQUEST_TYPE to aquire the | ||
367 | * request type from the 'request_type' field to maintain forward compatibility. | ||
368 | */ | ||
369 | #define DM_ULOG_REQUEST_MASK 0xFF | ||
370 | #define DM_ULOG_REQUEST_TYPE(request_type) \ | ||
371 | (DM_ULOG_REQUEST_MASK & (request_type)) | ||
372 | |||
373 | struct dm_ulog_request { | ||
374 | char uuid[DM_UUID_LEN]; /* Ties a request to a specific mirror log */ | ||
375 | char padding[7]; /* Padding because DM_UUID_LEN = 129 */ | ||
376 | |||
377 | int32_t error; /* Used to report back processing errors */ | ||
378 | |||
379 | uint32_t seq; /* Sequence number for request */ | ||
380 | uint32_t request_type; /* DM_ULOG_* defined above */ | ||
381 | uint32_t data_size; /* How much data (not including this struct) */ | ||
382 | |||
383 | char data[0]; | ||
384 | }; | ||
385 | |||
386 | #endif /* __DM_LOG_USERSPACE_H__ */ | ||
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 8083b6a36a38..07dfd460d286 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -63,24 +63,26 @@ struct dma_map_ops { | |||
63 | 63 | ||
64 | #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) | 64 | #define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) |
65 | 65 | ||
66 | typedef u64 DMA_nnBIT_MASK __deprecated; | ||
67 | |||
66 | /* | 68 | /* |
67 | * NOTE: do not use the below macros in new code and do not add new definitions | 69 | * NOTE: do not use the below macros in new code and do not add new definitions |
68 | * here. | 70 | * here. |
69 | * | 71 | * |
70 | * Instead, just open-code DMA_BIT_MASK(n) within your driver | 72 | * Instead, just open-code DMA_BIT_MASK(n) within your driver |
71 | */ | 73 | */ |
72 | #define DMA_64BIT_MASK DMA_BIT_MASK(64) | 74 | #define DMA_64BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(64) |
73 | #define DMA_48BIT_MASK DMA_BIT_MASK(48) | 75 | #define DMA_48BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(48) |
74 | #define DMA_47BIT_MASK DMA_BIT_MASK(47) | 76 | #define DMA_47BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(47) |
75 | #define DMA_40BIT_MASK DMA_BIT_MASK(40) | 77 | #define DMA_40BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(40) |
76 | #define DMA_39BIT_MASK DMA_BIT_MASK(39) | 78 | #define DMA_39BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(39) |
77 | #define DMA_35BIT_MASK DMA_BIT_MASK(35) | 79 | #define DMA_35BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(35) |
78 | #define DMA_32BIT_MASK DMA_BIT_MASK(32) | 80 | #define DMA_32BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(32) |
79 | #define DMA_31BIT_MASK DMA_BIT_MASK(31) | 81 | #define DMA_31BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(31) |
80 | #define DMA_30BIT_MASK DMA_BIT_MASK(30) | 82 | #define DMA_30BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(30) |
81 | #define DMA_29BIT_MASK DMA_BIT_MASK(29) | 83 | #define DMA_29BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(29) |
82 | #define DMA_28BIT_MASK DMA_BIT_MASK(28) | 84 | #define DMA_28BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(28) |
83 | #define DMA_24BIT_MASK DMA_BIT_MASK(24) | 85 | #define DMA_24BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(24) |
84 | 86 | ||
85 | #define DMA_MASK_NONE 0x0ULL | 87 | #define DMA_MASK_NONE 0x0ULL |
86 | 88 | ||
@@ -107,9 +109,20 @@ static inline int is_buffer_dma_capable(u64 mask, dma_addr_t addr, size_t size) | |||
107 | #include <asm-generic/dma-mapping-broken.h> | 109 | #include <asm-generic/dma-mapping-broken.h> |
108 | #endif | 110 | #endif |
109 | 111 | ||
110 | /* Backwards compat, remove in 2.7.x */ | 112 | /* for backwards compatibility, removed soon */ |
111 | #define dma_sync_single dma_sync_single_for_cpu | 113 | static inline void __deprecated dma_sync_single(struct device *dev, |
112 | #define dma_sync_sg dma_sync_sg_for_cpu | 114 | dma_addr_t addr, size_t size, |
115 | enum dma_data_direction dir) | ||
116 | { | ||
117 | dma_sync_single_for_cpu(dev, addr, size, dir); | ||
118 | } | ||
119 | |||
120 | static inline void __deprecated dma_sync_sg(struct device *dev, | ||
121 | struct scatterlist *sg, int nelems, | ||
122 | enum dma_data_direction dir) | ||
123 | { | ||
124 | dma_sync_sg_for_cpu(dev, sg, nelems, dir); | ||
125 | } | ||
113 | 126 | ||
114 | static inline u64 dma_get_mask(struct device *dev) | 127 | static inline u64 dma_get_mask(struct device *dev) |
115 | { | 128 | { |
diff --git a/include/linux/dma_remapping.h b/include/linux/dma_remapping.h index 1a455f1f86d7..5619f8522738 100644 --- a/include/linux/dma_remapping.h +++ b/include/linux/dma_remapping.h | |||
@@ -13,6 +13,10 @@ | |||
13 | #define DMA_PTE_WRITE (2) | 13 | #define DMA_PTE_WRITE (2) |
14 | #define DMA_PTE_SNP (1 << 11) | 14 | #define DMA_PTE_SNP (1 << 11) |
15 | 15 | ||
16 | #define CONTEXT_TT_MULTI_LEVEL 0 | ||
17 | #define CONTEXT_TT_DEV_IOTLB 1 | ||
18 | #define CONTEXT_TT_PASS_THROUGH 2 | ||
19 | |||
16 | struct intel_iommu; | 20 | struct intel_iommu; |
17 | struct dmar_domain; | 21 | struct dmar_domain; |
18 | struct root_entry; | 22 | struct root_entry; |
@@ -21,11 +25,16 @@ extern void free_dmar_iommu(struct intel_iommu *iommu); | |||
21 | 25 | ||
22 | #ifdef CONFIG_DMAR | 26 | #ifdef CONFIG_DMAR |
23 | extern int iommu_calculate_agaw(struct intel_iommu *iommu); | 27 | extern int iommu_calculate_agaw(struct intel_iommu *iommu); |
28 | extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu); | ||
24 | #else | 29 | #else |
25 | static inline int iommu_calculate_agaw(struct intel_iommu *iommu) | 30 | static inline int iommu_calculate_agaw(struct intel_iommu *iommu) |
26 | { | 31 | { |
27 | return 0; | 32 | return 0; |
28 | } | 33 | } |
34 | static inline int iommu_calculate_max_sagaw(struct intel_iommu *iommu) | ||
35 | { | ||
36 | return 0; | ||
37 | } | ||
29 | #endif | 38 | #endif |
30 | 39 | ||
31 | extern int dmar_disabled; | 40 | extern int dmar_disabled; |
diff --git a/include/linux/dmar.h b/include/linux/dmar.h index 10ff5c498824..4a2b162c256a 100644 --- a/include/linux/dmar.h +++ b/include/linux/dmar.h | |||
@@ -126,6 +126,8 @@ extern int free_irte(int irq); | |||
126 | extern int irq_remapped(int irq); | 126 | extern int irq_remapped(int irq); |
127 | extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev); | 127 | extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev); |
128 | extern struct intel_iommu *map_ioapic_to_ir(int apic); | 128 | extern struct intel_iommu *map_ioapic_to_ir(int apic); |
129 | extern int set_ioapic_sid(struct irte *irte, int apic); | ||
130 | extern int set_msi_sid(struct irte *irte, struct pci_dev *dev); | ||
129 | #else | 131 | #else |
130 | static inline int alloc_irte(struct intel_iommu *iommu, int irq, u16 count) | 132 | static inline int alloc_irte(struct intel_iommu *iommu, int irq, u16 count) |
131 | { | 133 | { |
@@ -156,6 +158,15 @@ static inline struct intel_iommu *map_ioapic_to_ir(int apic) | |||
156 | { | 158 | { |
157 | return NULL; | 159 | return NULL; |
158 | } | 160 | } |
161 | static inline int set_ioapic_sid(struct irte *irte, int apic) | ||
162 | { | ||
163 | return 0; | ||
164 | } | ||
165 | static inline int set_msi_sid(struct irte *irte, struct pci_dev *dev) | ||
166 | { | ||
167 | return 0; | ||
168 | } | ||
169 | |||
159 | #define irq_remapped(irq) (0) | 170 | #define irq_remapped(irq) (0) |
160 | #define enable_intr_remapping(mode) (-1) | 171 | #define enable_intr_remapping(mode) (-1) |
161 | #define disable_intr_remapping() (0) | 172 | #define disable_intr_remapping() (0) |
@@ -188,6 +199,15 @@ struct dmar_rmrr_unit { | |||
188 | 199 | ||
189 | #define for_each_rmrr_units(rmrr) \ | 200 | #define for_each_rmrr_units(rmrr) \ |
190 | list_for_each_entry(rmrr, &dmar_rmrr_units, list) | 201 | list_for_each_entry(rmrr, &dmar_rmrr_units, list) |
202 | |||
203 | struct dmar_atsr_unit { | ||
204 | struct list_head list; /* list of ATSR units */ | ||
205 | struct acpi_dmar_header *hdr; /* ACPI header */ | ||
206 | struct pci_dev **devices; /* target devices */ | ||
207 | int devices_cnt; /* target device count */ | ||
208 | u8 include_all:1; /* include all ports */ | ||
209 | }; | ||
210 | |||
191 | /* Intel DMAR initialization functions */ | 211 | /* Intel DMAR initialization functions */ |
192 | extern int intel_iommu_init(void); | 212 | extern int intel_iommu_init(void); |
193 | #else | 213 | #else |
diff --git a/include/linux/efi.h b/include/linux/efi.h index bb66feb164bd..ce4581fbc08b 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
@@ -101,7 +101,7 @@ typedef struct { | |||
101 | u64 attribute; | 101 | u64 attribute; |
102 | } efi_memory_desc_t; | 102 | } efi_memory_desc_t; |
103 | 103 | ||
104 | typedef int (*efi_freemem_callback_t) (unsigned long start, unsigned long end, void *arg); | 104 | typedef int (*efi_freemem_callback_t) (u64 start, u64 end, void *arg); |
105 | 105 | ||
106 | /* | 106 | /* |
107 | * Types and defines for Time Services | 107 | * Types and defines for Time Services |
diff --git a/include/linux/eisa.h b/include/linux/eisa.h index e61c0be2a459..6925249a5ac6 100644 --- a/include/linux/eisa.h +++ b/include/linux/eisa.h | |||
@@ -78,12 +78,12 @@ static inline void eisa_driver_unregister (struct eisa_driver *edrv) { } | |||
78 | /* Mimics pci.h... */ | 78 | /* Mimics pci.h... */ |
79 | static inline void *eisa_get_drvdata (struct eisa_device *edev) | 79 | static inline void *eisa_get_drvdata (struct eisa_device *edev) |
80 | { | 80 | { |
81 | return edev->dev.driver_data; | 81 | return dev_get_drvdata(&edev->dev); |
82 | } | 82 | } |
83 | 83 | ||
84 | static inline void eisa_set_drvdata (struct eisa_device *edev, void *data) | 84 | static inline void eisa_set_drvdata (struct eisa_device *edev, void *data) |
85 | { | 85 | { |
86 | edev->dev.driver_data = data; | 86 | dev_set_drvdata(&edev->dev, data); |
87 | } | 87 | } |
88 | 88 | ||
89 | /* The EISA root device. There's rumours about machines with multiple | 89 | /* The EISA root device. There's rumours about machines with multiple |
diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h index 7605c5e9589f..00d6a68d0421 100644 --- a/include/linux/elfcore.h +++ b/include/linux/elfcore.h | |||
@@ -122,9 +122,10 @@ static inline void elf_core_copy_kernel_regs(elf_gregset_t *elfregs, struct pt_r | |||
122 | 122 | ||
123 | static inline int elf_core_copy_task_regs(struct task_struct *t, elf_gregset_t* elfregs) | 123 | static inline int elf_core_copy_task_regs(struct task_struct *t, elf_gregset_t* elfregs) |
124 | { | 124 | { |
125 | #ifdef ELF_CORE_COPY_TASK_REGS | 125 | #if defined (ELF_CORE_COPY_TASK_REGS) |
126 | |||
127 | return ELF_CORE_COPY_TASK_REGS(t, elfregs); | 126 | return ELF_CORE_COPY_TASK_REGS(t, elfregs); |
127 | #elif defined (task_pt_regs) | ||
128 | elf_core_copy_regs(elfregs, task_pt_regs(t)); | ||
128 | #endif | 129 | #endif |
129 | return 0; | 130 | return 0; |
130 | } | 131 | } |
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h index a1f17abba7dc..3d7a6687d247 100644 --- a/include/linux/etherdevice.h +++ b/include/linux/etherdevice.h | |||
@@ -182,6 +182,33 @@ static inline unsigned compare_ether_addr_64bits(const u8 addr1[6+2], | |||
182 | return compare_ether_addr(addr1, addr2); | 182 | return compare_ether_addr(addr1, addr2); |
183 | #endif | 183 | #endif |
184 | } | 184 | } |
185 | |||
186 | /** | ||
187 | * is_etherdev_addr - Tell if given Ethernet address belongs to the device. | ||
188 | * @dev: Pointer to a device structure | ||
189 | * @addr: Pointer to a six-byte array containing the Ethernet address | ||
190 | * | ||
191 | * Compare passed address with all addresses of the device. Return true if the | ||
192 | * address if one of the device addresses. | ||
193 | * | ||
194 | * Note that this function calls compare_ether_addr_64bits() so take care of | ||
195 | * the right padding. | ||
196 | */ | ||
197 | static inline bool is_etherdev_addr(const struct net_device *dev, | ||
198 | const u8 addr[6 + 2]) | ||
199 | { | ||
200 | struct netdev_hw_addr *ha; | ||
201 | int res = 1; | ||
202 | |||
203 | rcu_read_lock(); | ||
204 | for_each_dev_addr(dev, ha) { | ||
205 | res = compare_ether_addr_64bits(addr, ha->addr); | ||
206 | if (!res) | ||
207 | break; | ||
208 | } | ||
209 | rcu_read_unlock(); | ||
210 | return !res; | ||
211 | } | ||
185 | #endif /* __KERNEL__ */ | 212 | #endif /* __KERNEL__ */ |
186 | 213 | ||
187 | /** | 214 | /** |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 131b127b70f8..9b660bd2e2b3 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -26,11 +26,14 @@ struct ethtool_cmd { | |||
26 | __u8 phy_address; | 26 | __u8 phy_address; |
27 | __u8 transceiver; /* Which transceiver to use */ | 27 | __u8 transceiver; /* Which transceiver to use */ |
28 | __u8 autoneg; /* Enable or disable autonegotiation */ | 28 | __u8 autoneg; /* Enable or disable autonegotiation */ |
29 | __u8 mdio_support; | ||
29 | __u32 maxtxpkt; /* Tx pkts before generating tx int */ | 30 | __u32 maxtxpkt; /* Tx pkts before generating tx int */ |
30 | __u32 maxrxpkt; /* Rx pkts before generating rx int */ | 31 | __u32 maxrxpkt; /* Rx pkts before generating rx int */ |
31 | __u16 speed_hi; | 32 | __u16 speed_hi; |
32 | __u16 reserved2; | 33 | __u8 eth_tp_mdix; |
33 | __u32 reserved[3]; | 34 | __u8 reserved2; |
35 | __u32 lp_advertising; /* Features the link partner advertises */ | ||
36 | __u32 reserved[2]; | ||
34 | }; | 37 | }; |
35 | 38 | ||
36 | static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep, | 39 | static inline void ethtool_cmd_speed_set(struct ethtool_cmd *ep, |
@@ -563,6 +566,11 @@ struct ethtool_ops { | |||
563 | #define SUPPORTED_Pause (1 << 13) | 566 | #define SUPPORTED_Pause (1 << 13) |
564 | #define SUPPORTED_Asym_Pause (1 << 14) | 567 | #define SUPPORTED_Asym_Pause (1 << 14) |
565 | #define SUPPORTED_2500baseX_Full (1 << 15) | 568 | #define SUPPORTED_2500baseX_Full (1 << 15) |
569 | #define SUPPORTED_Backplane (1 << 16) | ||
570 | #define SUPPORTED_1000baseKX_Full (1 << 17) | ||
571 | #define SUPPORTED_10000baseKX4_Full (1 << 18) | ||
572 | #define SUPPORTED_10000baseKR_Full (1 << 19) | ||
573 | #define SUPPORTED_10000baseR_FEC (1 << 20) | ||
566 | 574 | ||
567 | /* Indicates what features are advertised by the interface. */ | 575 | /* Indicates what features are advertised by the interface. */ |
568 | #define ADVERTISED_10baseT_Half (1 << 0) | 576 | #define ADVERTISED_10baseT_Half (1 << 0) |
@@ -581,6 +589,11 @@ struct ethtool_ops { | |||
581 | #define ADVERTISED_Pause (1 << 13) | 589 | #define ADVERTISED_Pause (1 << 13) |
582 | #define ADVERTISED_Asym_Pause (1 << 14) | 590 | #define ADVERTISED_Asym_Pause (1 << 14) |
583 | #define ADVERTISED_2500baseX_Full (1 << 15) | 591 | #define ADVERTISED_2500baseX_Full (1 << 15) |
592 | #define ADVERTISED_Backplane (1 << 16) | ||
593 | #define ADVERTISED_1000baseKX_Full (1 << 17) | ||
594 | #define ADVERTISED_10000baseKX4_Full (1 << 18) | ||
595 | #define ADVERTISED_10000baseKR_Full (1 << 19) | ||
596 | #define ADVERTISED_10000baseR_FEC (1 << 20) | ||
584 | 597 | ||
585 | /* The following are all involved in forcing a particular link | 598 | /* The following are all involved in forcing a particular link |
586 | * mode for the device for setting things. When getting the | 599 | * mode for the device for setting things. When getting the |
@@ -605,6 +618,7 @@ struct ethtool_ops { | |||
605 | #define PORT_MII 0x02 | 618 | #define PORT_MII 0x02 |
606 | #define PORT_FIBRE 0x03 | 619 | #define PORT_FIBRE 0x03 |
607 | #define PORT_BNC 0x04 | 620 | #define PORT_BNC 0x04 |
621 | #define PORT_OTHER 0xff | ||
608 | 622 | ||
609 | /* Which transceiver to use. */ | 623 | /* Which transceiver to use. */ |
610 | #define XCVR_INTERNAL 0x00 | 624 | #define XCVR_INTERNAL 0x00 |
@@ -619,6 +633,11 @@ struct ethtool_ops { | |||
619 | #define AUTONEG_DISABLE 0x00 | 633 | #define AUTONEG_DISABLE 0x00 |
620 | #define AUTONEG_ENABLE 0x01 | 634 | #define AUTONEG_ENABLE 0x01 |
621 | 635 | ||
636 | /* Mode MDI or MDI-X */ | ||
637 | #define ETH_TP_MDI_INVALID 0x00 | ||
638 | #define ETH_TP_MDI 0x01 | ||
639 | #define ETH_TP_MDI_X 0x02 | ||
640 | |||
622 | /* Wake-On-Lan options. */ | 641 | /* Wake-On-Lan options. */ |
623 | #define WAKE_PHY (1 << 0) | 642 | #define WAKE_PHY (1 << 0) |
624 | #define WAKE_UCAST (1 << 1) | 643 | #define WAKE_UCAST (1 << 1) |
diff --git a/include/linux/eventfd.h b/include/linux/eventfd.h index f45a8ae5f828..3b85ba6479f4 100644 --- a/include/linux/eventfd.h +++ b/include/linux/eventfd.h | |||
@@ -8,10 +8,8 @@ | |||
8 | #ifndef _LINUX_EVENTFD_H | 8 | #ifndef _LINUX_EVENTFD_H |
9 | #define _LINUX_EVENTFD_H | 9 | #define _LINUX_EVENTFD_H |
10 | 10 | ||
11 | #ifdef CONFIG_EVENTFD | ||
12 | |||
13 | /* For O_CLOEXEC and O_NONBLOCK */ | ||
14 | #include <linux/fcntl.h> | 11 | #include <linux/fcntl.h> |
12 | #include <linux/file.h> | ||
15 | 13 | ||
16 | /* | 14 | /* |
17 | * CAREFUL: Check include/asm-generic/fcntl.h when defining | 15 | * CAREFUL: Check include/asm-generic/fcntl.h when defining |
@@ -27,16 +25,37 @@ | |||
27 | #define EFD_SHARED_FCNTL_FLAGS (O_CLOEXEC | O_NONBLOCK) | 25 | #define EFD_SHARED_FCNTL_FLAGS (O_CLOEXEC | O_NONBLOCK) |
28 | #define EFD_FLAGS_SET (EFD_SHARED_FCNTL_FLAGS | EFD_SEMAPHORE) | 26 | #define EFD_FLAGS_SET (EFD_SHARED_FCNTL_FLAGS | EFD_SEMAPHORE) |
29 | 27 | ||
28 | #ifdef CONFIG_EVENTFD | ||
29 | |||
30 | struct eventfd_ctx *eventfd_ctx_get(struct eventfd_ctx *ctx); | ||
31 | void eventfd_ctx_put(struct eventfd_ctx *ctx); | ||
30 | struct file *eventfd_fget(int fd); | 32 | struct file *eventfd_fget(int fd); |
31 | int eventfd_signal(struct file *file, int n); | 33 | struct eventfd_ctx *eventfd_ctx_fdget(int fd); |
34 | struct eventfd_ctx *eventfd_ctx_fileget(struct file *file); | ||
35 | int eventfd_signal(struct eventfd_ctx *ctx, int n); | ||
32 | 36 | ||
33 | #else /* CONFIG_EVENTFD */ | 37 | #else /* CONFIG_EVENTFD */ |
34 | 38 | ||
35 | #define eventfd_fget(fd) ERR_PTR(-ENOSYS) | 39 | /* |
36 | static inline int eventfd_signal(struct file *file, int n) | 40 | * Ugly ugly ugly error layer to support modules that uses eventfd but |
37 | { return 0; } | 41 | * pretend to work in !CONFIG_EVENTFD configurations. Namely, AIO. |
42 | */ | ||
43 | static inline struct eventfd_ctx *eventfd_ctx_fdget(int fd) | ||
44 | { | ||
45 | return ERR_PTR(-ENOSYS); | ||
46 | } | ||
47 | |||
48 | static inline int eventfd_signal(struct eventfd_ctx *ctx, int n) | ||
49 | { | ||
50 | return -ENOSYS; | ||
51 | } | ||
52 | |||
53 | static inline void eventfd_ctx_put(struct eventfd_ctx *ctx) | ||
54 | { | ||
55 | |||
56 | } | ||
38 | 57 | ||
39 | #endif /* CONFIG_EVENTFD */ | 58 | #endif |
40 | 59 | ||
41 | #endif /* _LINUX_EVENTFD_H */ | 60 | #endif /* _LINUX_EVENTFD_H */ |
42 | 61 | ||
diff --git a/include/linux/ext3_fs_i.h b/include/linux/ext3_fs_i.h index 7894dd0f3b77..ca1bfe90004f 100644 --- a/include/linux/ext3_fs_i.h +++ b/include/linux/ext3_fs_i.h | |||
@@ -103,10 +103,6 @@ struct ext3_inode_info { | |||
103 | */ | 103 | */ |
104 | struct rw_semaphore xattr_sem; | 104 | struct rw_semaphore xattr_sem; |
105 | #endif | 105 | #endif |
106 | #ifdef CONFIG_EXT3_FS_POSIX_ACL | ||
107 | struct posix_acl *i_acl; | ||
108 | struct posix_acl *i_default_acl; | ||
109 | #endif | ||
110 | 106 | ||
111 | struct list_head i_orphan; /* unlinked but open inodes */ | 107 | struct list_head i_orphan; /* unlinked but open inodes */ |
112 | 108 | ||
diff --git a/include/linux/falloc.h b/include/linux/falloc.h index 8e912ab6a072..3c155107d61f 100644 --- a/include/linux/falloc.h +++ b/include/linux/falloc.h | |||
@@ -3,4 +3,25 @@ | |||
3 | 3 | ||
4 | #define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */ | 4 | #define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */ |
5 | 5 | ||
6 | #ifdef __KERNEL__ | ||
7 | |||
8 | /* | ||
9 | * Space reservation ioctls and argument structure | ||
10 | * are designed to be compatible with the legacy XFS ioctls. | ||
11 | */ | ||
12 | struct space_resv { | ||
13 | __s16 l_type; | ||
14 | __s16 l_whence; | ||
15 | __s64 l_start; | ||
16 | __s64 l_len; /* len == 0 means until end of file */ | ||
17 | __s32 l_sysid; | ||
18 | __u32 l_pid; | ||
19 | __s32 l_pad[4]; /* reserved area */ | ||
20 | }; | ||
21 | |||
22 | #define FS_IOC_RESVSP _IOW('X', 40, struct space_resv) | ||
23 | #define FS_IOC_RESVSP64 _IOW('X', 42, struct space_resv) | ||
24 | |||
25 | #endif /* __KERNEL__ */ | ||
26 | |||
6 | #endif /* _FALLOC_H_ */ | 27 | #endif /* _FALLOC_H_ */ |
diff --git a/include/linux/fb.h b/include/linux/fb.h index 330c4b1bfcaa..f847df9e99b6 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -677,6 +677,9 @@ struct fb_ops { | |||
677 | /* get capability given var */ | 677 | /* get capability given var */ |
678 | void (*fb_get_caps)(struct fb_info *info, struct fb_blit_caps *caps, | 678 | void (*fb_get_caps)(struct fb_info *info, struct fb_blit_caps *caps, |
679 | struct fb_var_screeninfo *var); | 679 | struct fb_var_screeninfo *var); |
680 | |||
681 | /* teardown any resources to do with this framebuffer */ | ||
682 | void (*fb_destroy)(struct fb_info *info); | ||
680 | }; | 683 | }; |
681 | 684 | ||
682 | #ifdef CONFIG_FB_TILEBLITTING | 685 | #ifdef CONFIG_FB_TILEBLITTING |
@@ -786,6 +789,8 @@ struct fb_tile_ops { | |||
786 | #define FBINFO_MISC_USEREVENT 0x10000 /* event request | 789 | #define FBINFO_MISC_USEREVENT 0x10000 /* event request |
787 | from userspace */ | 790 | from userspace */ |
788 | #define FBINFO_MISC_TILEBLITTING 0x20000 /* use tile blitting */ | 791 | #define FBINFO_MISC_TILEBLITTING 0x20000 /* use tile blitting */ |
792 | #define FBINFO_MISC_FIRMWARE 0x40000 /* a replaceable firmware | ||
793 | inited framebuffer */ | ||
789 | 794 | ||
790 | /* A driver may set this flag to indicate that it does want a set_par to be | 795 | /* A driver may set this flag to indicate that it does want a set_par to be |
791 | * called every time when fbcon_switch is executed. The advantage is that with | 796 | * called every time when fbcon_switch is executed. The advantage is that with |
@@ -814,6 +819,7 @@ struct fb_info { | |||
814 | int node; | 819 | int node; |
815 | int flags; | 820 | int flags; |
816 | struct mutex lock; /* Lock for open/release/ioctl funcs */ | 821 | struct mutex lock; /* Lock for open/release/ioctl funcs */ |
822 | struct mutex mm_lock; /* Lock for fb_mmap and smem_* fields */ | ||
817 | struct fb_var_screeninfo var; /* Current var */ | 823 | struct fb_var_screeninfo var; /* Current var */ |
818 | struct fb_fix_screeninfo fix; /* Current fix */ | 824 | struct fb_fix_screeninfo fix; /* Current fix */ |
819 | struct fb_monspecs monspecs; /* Current Monitor specs */ | 825 | struct fb_monspecs monspecs; /* Current Monitor specs */ |
@@ -854,7 +860,12 @@ struct fb_info { | |||
854 | u32 state; /* Hardware state i.e suspend */ | 860 | u32 state; /* Hardware state i.e suspend */ |
855 | void *fbcon_par; /* fbcon use-only private area */ | 861 | void *fbcon_par; /* fbcon use-only private area */ |
856 | /* From here on everything is device dependent */ | 862 | /* From here on everything is device dependent */ |
857 | void *par; | 863 | void *par; |
864 | /* we need the PCI or similiar aperture base/size not | ||
865 | smem_start/size as smem_start may just be an object | ||
866 | allocated inside the aperture so may not actually overlap */ | ||
867 | resource_size_t aperture_base; | ||
868 | resource_size_t aperture_size; | ||
858 | }; | 869 | }; |
859 | 870 | ||
860 | #ifdef MODULE | 871 | #ifdef MODULE |
@@ -893,7 +904,7 @@ struct fb_info { | |||
893 | #define fb_writeq sbus_writeq | 904 | #define fb_writeq sbus_writeq |
894 | #define fb_memset sbus_memset_io | 905 | #define fb_memset sbus_memset_io |
895 | 906 | ||
896 | #elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || defined(__hppa__) || defined(__sh__) || defined(__powerpc__) || defined(__avr32__) | 907 | #elif defined(__i386__) || defined(__alpha__) || defined(__x86_64__) || defined(__hppa__) || defined(__sh__) || defined(__powerpc__) || defined(__avr32__) || defined(__bfin__) |
897 | 908 | ||
898 | #define fb_readb __raw_readb | 909 | #define fb_readb __raw_readb |
899 | #define fb_readw __raw_readw | 910 | #define fb_readw __raw_readw |
diff --git a/include/linux/firewire.h b/include/linux/firewire.h new file mode 100644 index 000000000000..192d1e43c43c --- /dev/null +++ b/include/linux/firewire.h | |||
@@ -0,0 +1,446 @@ | |||
1 | #ifndef _LINUX_FIREWIRE_H | ||
2 | #define _LINUX_FIREWIRE_H | ||
3 | |||
4 | #include <linux/completion.h> | ||
5 | #include <linux/device.h> | ||
6 | #include <linux/dma-mapping.h> | ||
7 | #include <linux/kernel.h> | ||
8 | #include <linux/kref.h> | ||
9 | #include <linux/list.h> | ||
10 | #include <linux/mutex.h> | ||
11 | #include <linux/spinlock.h> | ||
12 | #include <linux/sysfs.h> | ||
13 | #include <linux/timer.h> | ||
14 | #include <linux/types.h> | ||
15 | #include <linux/workqueue.h> | ||
16 | |||
17 | #include <asm/atomic.h> | ||
18 | #include <asm/byteorder.h> | ||
19 | |||
20 | #define fw_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, ## args) | ||
21 | #define fw_error(s, args...) printk(KERN_ERR KBUILD_MODNAME ": " s, ## args) | ||
22 | |||
23 | static inline void fw_memcpy_from_be32(void *_dst, void *_src, size_t size) | ||
24 | { | ||
25 | u32 *dst = _dst; | ||
26 | __be32 *src = _src; | ||
27 | int i; | ||
28 | |||
29 | for (i = 0; i < size / 4; i++) | ||
30 | dst[i] = be32_to_cpu(src[i]); | ||
31 | } | ||
32 | |||
33 | static inline void fw_memcpy_to_be32(void *_dst, void *_src, size_t size) | ||
34 | { | ||
35 | fw_memcpy_from_be32(_dst, _src, size); | ||
36 | } | ||
37 | #define CSR_REGISTER_BASE 0xfffff0000000ULL | ||
38 | |||
39 | /* register offsets are relative to CSR_REGISTER_BASE */ | ||
40 | #define CSR_STATE_CLEAR 0x0 | ||
41 | #define CSR_STATE_SET 0x4 | ||
42 | #define CSR_NODE_IDS 0x8 | ||
43 | #define CSR_RESET_START 0xc | ||
44 | #define CSR_SPLIT_TIMEOUT_HI 0x18 | ||
45 | #define CSR_SPLIT_TIMEOUT_LO 0x1c | ||
46 | #define CSR_CYCLE_TIME 0x200 | ||
47 | #define CSR_BUS_TIME 0x204 | ||
48 | #define CSR_BUSY_TIMEOUT 0x210 | ||
49 | #define CSR_BUS_MANAGER_ID 0x21c | ||
50 | #define CSR_BANDWIDTH_AVAILABLE 0x220 | ||
51 | #define CSR_CHANNELS_AVAILABLE 0x224 | ||
52 | #define CSR_CHANNELS_AVAILABLE_HI 0x224 | ||
53 | #define CSR_CHANNELS_AVAILABLE_LO 0x228 | ||
54 | #define CSR_BROADCAST_CHANNEL 0x234 | ||
55 | #define CSR_CONFIG_ROM 0x400 | ||
56 | #define CSR_CONFIG_ROM_END 0x800 | ||
57 | #define CSR_FCP_COMMAND 0xB00 | ||
58 | #define CSR_FCP_RESPONSE 0xD00 | ||
59 | #define CSR_FCP_END 0xF00 | ||
60 | #define CSR_TOPOLOGY_MAP 0x1000 | ||
61 | #define CSR_TOPOLOGY_MAP_END 0x1400 | ||
62 | #define CSR_SPEED_MAP 0x2000 | ||
63 | #define CSR_SPEED_MAP_END 0x3000 | ||
64 | |||
65 | #define CSR_OFFSET 0x40 | ||
66 | #define CSR_LEAF 0x80 | ||
67 | #define CSR_DIRECTORY 0xc0 | ||
68 | |||
69 | #define CSR_DESCRIPTOR 0x01 | ||
70 | #define CSR_VENDOR 0x03 | ||
71 | #define CSR_HARDWARE_VERSION 0x04 | ||
72 | #define CSR_NODE_CAPABILITIES 0x0c | ||
73 | #define CSR_UNIT 0x11 | ||
74 | #define CSR_SPECIFIER_ID 0x12 | ||
75 | #define CSR_VERSION 0x13 | ||
76 | #define CSR_DEPENDENT_INFO 0x14 | ||
77 | #define CSR_MODEL 0x17 | ||
78 | #define CSR_INSTANCE 0x18 | ||
79 | #define CSR_DIRECTORY_ID 0x20 | ||
80 | |||
81 | struct fw_csr_iterator { | ||
82 | u32 *p; | ||
83 | u32 *end; | ||
84 | }; | ||
85 | |||
86 | void fw_csr_iterator_init(struct fw_csr_iterator *ci, u32 *p); | ||
87 | int fw_csr_iterator_next(struct fw_csr_iterator *ci, int *key, int *value); | ||
88 | |||
89 | extern struct bus_type fw_bus_type; | ||
90 | |||
91 | struct fw_card_driver; | ||
92 | struct fw_node; | ||
93 | |||
94 | struct fw_card { | ||
95 | const struct fw_card_driver *driver; | ||
96 | struct device *device; | ||
97 | struct kref kref; | ||
98 | struct completion done; | ||
99 | |||
100 | int node_id; | ||
101 | int generation; | ||
102 | int current_tlabel; | ||
103 | u64 tlabel_mask; | ||
104 | struct list_head transaction_list; | ||
105 | struct timer_list flush_timer; | ||
106 | unsigned long reset_jiffies; | ||
107 | |||
108 | unsigned long long guid; | ||
109 | unsigned max_receive; | ||
110 | int link_speed; | ||
111 | int config_rom_generation; | ||
112 | |||
113 | spinlock_t lock; /* Take this lock when handling the lists in | ||
114 | * this struct. */ | ||
115 | struct fw_node *local_node; | ||
116 | struct fw_node *root_node; | ||
117 | struct fw_node *irm_node; | ||
118 | u8 color; /* must be u8 to match the definition in struct fw_node */ | ||
119 | int gap_count; | ||
120 | bool beta_repeaters_present; | ||
121 | |||
122 | int index; | ||
123 | |||
124 | struct list_head link; | ||
125 | |||
126 | /* Work struct for BM duties. */ | ||
127 | struct delayed_work work; | ||
128 | int bm_retries; | ||
129 | int bm_generation; | ||
130 | __be32 bm_transaction_data[2]; | ||
131 | |||
132 | bool broadcast_channel_allocated; | ||
133 | u32 broadcast_channel; | ||
134 | u32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4]; | ||
135 | }; | ||
136 | |||
137 | static inline struct fw_card *fw_card_get(struct fw_card *card) | ||
138 | { | ||
139 | kref_get(&card->kref); | ||
140 | |||
141 | return card; | ||
142 | } | ||
143 | |||
144 | void fw_card_release(struct kref *kref); | ||
145 | |||
146 | static inline void fw_card_put(struct fw_card *card) | ||
147 | { | ||
148 | kref_put(&card->kref, fw_card_release); | ||
149 | } | ||
150 | |||
151 | struct fw_attribute_group { | ||
152 | struct attribute_group *groups[2]; | ||
153 | struct attribute_group group; | ||
154 | struct attribute *attrs[12]; | ||
155 | }; | ||
156 | |||
157 | enum fw_device_state { | ||
158 | FW_DEVICE_INITIALIZING, | ||
159 | FW_DEVICE_RUNNING, | ||
160 | FW_DEVICE_GONE, | ||
161 | FW_DEVICE_SHUTDOWN, | ||
162 | }; | ||
163 | |||
164 | /* | ||
165 | * Note, fw_device.generation always has to be read before fw_device.node_id. | ||
166 | * Use SMP memory barriers to ensure this. Otherwise requests will be sent | ||
167 | * to an outdated node_id if the generation was updated in the meantime due | ||
168 | * to a bus reset. | ||
169 | * | ||
170 | * Likewise, fw-core will take care to update .node_id before .generation so | ||
171 | * that whenever fw_device.generation is current WRT the actual bus generation, | ||
172 | * fw_device.node_id is guaranteed to be current too. | ||
173 | * | ||
174 | * The same applies to fw_device.card->node_id vs. fw_device.generation. | ||
175 | * | ||
176 | * fw_device.config_rom and fw_device.config_rom_length may be accessed during | ||
177 | * the lifetime of any fw_unit belonging to the fw_device, before device_del() | ||
178 | * was called on the last fw_unit. Alternatively, they may be accessed while | ||
179 | * holding fw_device_rwsem. | ||
180 | */ | ||
181 | struct fw_device { | ||
182 | atomic_t state; | ||
183 | struct fw_node *node; | ||
184 | int node_id; | ||
185 | int generation; | ||
186 | unsigned max_speed; | ||
187 | struct fw_card *card; | ||
188 | struct device device; | ||
189 | |||
190 | struct mutex client_list_mutex; | ||
191 | struct list_head client_list; | ||
192 | |||
193 | u32 *config_rom; | ||
194 | size_t config_rom_length; | ||
195 | int config_rom_retries; | ||
196 | unsigned is_local:1; | ||
197 | unsigned max_rec:4; | ||
198 | unsigned cmc:1; | ||
199 | unsigned irmc:1; | ||
200 | unsigned bc_implemented:2; | ||
201 | |||
202 | struct delayed_work work; | ||
203 | struct fw_attribute_group attribute_group; | ||
204 | }; | ||
205 | |||
206 | static inline struct fw_device *fw_device(struct device *dev) | ||
207 | { | ||
208 | return container_of(dev, struct fw_device, device); | ||
209 | } | ||
210 | |||
211 | static inline int fw_device_is_shutdown(struct fw_device *device) | ||
212 | { | ||
213 | return atomic_read(&device->state) == FW_DEVICE_SHUTDOWN; | ||
214 | } | ||
215 | |||
216 | static inline struct fw_device *fw_device_get(struct fw_device *device) | ||
217 | { | ||
218 | get_device(&device->device); | ||
219 | |||
220 | return device; | ||
221 | } | ||
222 | |||
223 | static inline void fw_device_put(struct fw_device *device) | ||
224 | { | ||
225 | put_device(&device->device); | ||
226 | } | ||
227 | |||
228 | int fw_device_enable_phys_dma(struct fw_device *device); | ||
229 | |||
230 | /* | ||
231 | * fw_unit.directory must not be accessed after device_del(&fw_unit.device). | ||
232 | */ | ||
233 | struct fw_unit { | ||
234 | struct device device; | ||
235 | u32 *directory; | ||
236 | struct fw_attribute_group attribute_group; | ||
237 | }; | ||
238 | |||
239 | static inline struct fw_unit *fw_unit(struct device *dev) | ||
240 | { | ||
241 | return container_of(dev, struct fw_unit, device); | ||
242 | } | ||
243 | |||
244 | static inline struct fw_unit *fw_unit_get(struct fw_unit *unit) | ||
245 | { | ||
246 | get_device(&unit->device); | ||
247 | |||
248 | return unit; | ||
249 | } | ||
250 | |||
251 | static inline void fw_unit_put(struct fw_unit *unit) | ||
252 | { | ||
253 | put_device(&unit->device); | ||
254 | } | ||
255 | |||
256 | static inline struct fw_device *fw_parent_device(struct fw_unit *unit) | ||
257 | { | ||
258 | return fw_device(unit->device.parent); | ||
259 | } | ||
260 | |||
261 | struct ieee1394_device_id; | ||
262 | |||
263 | struct fw_driver { | ||
264 | struct device_driver driver; | ||
265 | /* Called when the parent device sits through a bus reset. */ | ||
266 | void (*update)(struct fw_unit *unit); | ||
267 | const struct ieee1394_device_id *id_table; | ||
268 | }; | ||
269 | |||
270 | struct fw_packet; | ||
271 | struct fw_request; | ||
272 | |||
273 | typedef void (*fw_packet_callback_t)(struct fw_packet *packet, | ||
274 | struct fw_card *card, int status); | ||
275 | typedef void (*fw_transaction_callback_t)(struct fw_card *card, int rcode, | ||
276 | void *data, size_t length, | ||
277 | void *callback_data); | ||
278 | /* | ||
279 | * Important note: The callback must guarantee that either fw_send_response() | ||
280 | * or kfree() is called on the @request. | ||
281 | */ | ||
282 | typedef void (*fw_address_callback_t)(struct fw_card *card, | ||
283 | struct fw_request *request, | ||
284 | int tcode, int destination, int source, | ||
285 | int generation, int speed, | ||
286 | unsigned long long offset, | ||
287 | void *data, size_t length, | ||
288 | void *callback_data); | ||
289 | |||
290 | struct fw_packet { | ||
291 | int speed; | ||
292 | int generation; | ||
293 | u32 header[4]; | ||
294 | size_t header_length; | ||
295 | void *payload; | ||
296 | size_t payload_length; | ||
297 | dma_addr_t payload_bus; | ||
298 | u32 timestamp; | ||
299 | |||
300 | /* | ||
301 | * This callback is called when the packet transmission has | ||
302 | * completed; for successful transmission, the status code is | ||
303 | * the ack received from the destination, otherwise it's a | ||
304 | * negative errno: ENOMEM, ESTALE, ETIMEDOUT, ENODEV, EIO. | ||
305 | * The callback can be called from tasklet context and thus | ||
306 | * must never block. | ||
307 | */ | ||
308 | fw_packet_callback_t callback; | ||
309 | int ack; | ||
310 | struct list_head link; | ||
311 | void *driver_data; | ||
312 | }; | ||
313 | |||
314 | struct fw_transaction { | ||
315 | int node_id; /* The generation is implied; it is always the current. */ | ||
316 | int tlabel; | ||
317 | int timestamp; | ||
318 | struct list_head link; | ||
319 | |||
320 | struct fw_packet packet; | ||
321 | |||
322 | /* | ||
323 | * The data passed to the callback is valid only during the | ||
324 | * callback. | ||
325 | */ | ||
326 | fw_transaction_callback_t callback; | ||
327 | void *callback_data; | ||
328 | }; | ||
329 | |||
330 | struct fw_address_handler { | ||
331 | u64 offset; | ||
332 | size_t length; | ||
333 | fw_address_callback_t address_callback; | ||
334 | void *callback_data; | ||
335 | struct list_head link; | ||
336 | }; | ||
337 | |||
338 | struct fw_address_region { | ||
339 | u64 start; | ||
340 | u64 end; | ||
341 | }; | ||
342 | |||
343 | extern const struct fw_address_region fw_high_memory_region; | ||
344 | |||
345 | int fw_core_add_address_handler(struct fw_address_handler *handler, | ||
346 | const struct fw_address_region *region); | ||
347 | void fw_core_remove_address_handler(struct fw_address_handler *handler); | ||
348 | void fw_send_response(struct fw_card *card, | ||
349 | struct fw_request *request, int rcode); | ||
350 | void fw_send_request(struct fw_card *card, struct fw_transaction *t, | ||
351 | int tcode, int destination_id, int generation, int speed, | ||
352 | unsigned long long offset, void *payload, size_t length, | ||
353 | fw_transaction_callback_t callback, void *callback_data); | ||
354 | int fw_cancel_transaction(struct fw_card *card, | ||
355 | struct fw_transaction *transaction); | ||
356 | int fw_run_transaction(struct fw_card *card, int tcode, int destination_id, | ||
357 | int generation, int speed, unsigned long long offset, | ||
358 | void *payload, size_t length); | ||
359 | |||
360 | static inline int fw_stream_packet_destination_id(int tag, int channel, int sy) | ||
361 | { | ||
362 | return tag << 14 | channel << 8 | sy; | ||
363 | } | ||
364 | |||
365 | struct fw_descriptor { | ||
366 | struct list_head link; | ||
367 | size_t length; | ||
368 | u32 immediate; | ||
369 | u32 key; | ||
370 | const u32 *data; | ||
371 | }; | ||
372 | |||
373 | int fw_core_add_descriptor(struct fw_descriptor *desc); | ||
374 | void fw_core_remove_descriptor(struct fw_descriptor *desc); | ||
375 | |||
376 | /* | ||
377 | * The iso packet format allows for an immediate header/payload part | ||
378 | * stored in 'header' immediately after the packet info plus an | ||
379 | * indirect payload part that is pointer to by the 'payload' field. | ||
380 | * Applications can use one or the other or both to implement simple | ||
381 | * low-bandwidth streaming (e.g. audio) or more advanced | ||
382 | * scatter-gather streaming (e.g. assembling video frame automatically). | ||
383 | */ | ||
384 | struct fw_iso_packet { | ||
385 | u16 payload_length; /* Length of indirect payload. */ | ||
386 | u32 interrupt:1; /* Generate interrupt on this packet */ | ||
387 | u32 skip:1; /* Set to not send packet at all. */ | ||
388 | u32 tag:2; | ||
389 | u32 sy:4; | ||
390 | u32 header_length:8; /* Length of immediate header. */ | ||
391 | u32 header[0]; | ||
392 | }; | ||
393 | |||
394 | #define FW_ISO_CONTEXT_TRANSMIT 0 | ||
395 | #define FW_ISO_CONTEXT_RECEIVE 1 | ||
396 | |||
397 | #define FW_ISO_CONTEXT_MATCH_TAG0 1 | ||
398 | #define FW_ISO_CONTEXT_MATCH_TAG1 2 | ||
399 | #define FW_ISO_CONTEXT_MATCH_TAG2 4 | ||
400 | #define FW_ISO_CONTEXT_MATCH_TAG3 8 | ||
401 | #define FW_ISO_CONTEXT_MATCH_ALL_TAGS 15 | ||
402 | |||
403 | /* | ||
404 | * An iso buffer is just a set of pages mapped for DMA in the | ||
405 | * specified direction. Since the pages are to be used for DMA, they | ||
406 | * are not mapped into the kernel virtual address space. We store the | ||
407 | * DMA address in the page private. The helper function | ||
408 | * fw_iso_buffer_map() will map the pages into a given vma. | ||
409 | */ | ||
410 | struct fw_iso_buffer { | ||
411 | enum dma_data_direction direction; | ||
412 | struct page **pages; | ||
413 | int page_count; | ||
414 | }; | ||
415 | |||
416 | int fw_iso_buffer_init(struct fw_iso_buffer *buffer, struct fw_card *card, | ||
417 | int page_count, enum dma_data_direction direction); | ||
418 | void fw_iso_buffer_destroy(struct fw_iso_buffer *buffer, struct fw_card *card); | ||
419 | |||
420 | struct fw_iso_context; | ||
421 | typedef void (*fw_iso_callback_t)(struct fw_iso_context *context, | ||
422 | u32 cycle, size_t header_length, | ||
423 | void *header, void *data); | ||
424 | struct fw_iso_context { | ||
425 | struct fw_card *card; | ||
426 | int type; | ||
427 | int channel; | ||
428 | int speed; | ||
429 | size_t header_size; | ||
430 | fw_iso_callback_t callback; | ||
431 | void *callback_data; | ||
432 | }; | ||
433 | |||
434 | struct fw_iso_context *fw_iso_context_create(struct fw_card *card, | ||
435 | int type, int channel, int speed, size_t header_size, | ||
436 | fw_iso_callback_t callback, void *callback_data); | ||
437 | int fw_iso_context_queue(struct fw_iso_context *ctx, | ||
438 | struct fw_iso_packet *packet, | ||
439 | struct fw_iso_buffer *buffer, | ||
440 | unsigned long payload); | ||
441 | int fw_iso_context_start(struct fw_iso_context *ctx, | ||
442 | int cycle, int sync, int tags); | ||
443 | int fw_iso_context_stop(struct fw_iso_context *ctx); | ||
444 | void fw_iso_context_destroy(struct fw_iso_context *ctx); | ||
445 | |||
446 | #endif /* _LINUX_FIREWIRE_H */ | ||
diff --git a/include/linux/firmware-map.h b/include/linux/firmware-map.h index cca686b39123..875451f1373a 100644 --- a/include/linux/firmware-map.h +++ b/include/linux/firmware-map.h | |||
@@ -24,21 +24,17 @@ | |||
24 | */ | 24 | */ |
25 | #ifdef CONFIG_FIRMWARE_MEMMAP | 25 | #ifdef CONFIG_FIRMWARE_MEMMAP |
26 | 26 | ||
27 | int firmware_map_add(resource_size_t start, resource_size_t end, | 27 | int firmware_map_add(u64 start, u64 end, const char *type); |
28 | const char *type); | 28 | int firmware_map_add_early(u64 start, u64 end, const char *type); |
29 | int firmware_map_add_early(resource_size_t start, resource_size_t end, | ||
30 | const char *type); | ||
31 | 29 | ||
32 | #else /* CONFIG_FIRMWARE_MEMMAP */ | 30 | #else /* CONFIG_FIRMWARE_MEMMAP */ |
33 | 31 | ||
34 | static inline int firmware_map_add(resource_size_t start, resource_size_t end, | 32 | static inline int firmware_map_add(u64 start, u64 end, const char *type) |
35 | const char *type) | ||
36 | { | 33 | { |
37 | return 0; | 34 | return 0; |
38 | } | 35 | } |
39 | 36 | ||
40 | static inline int firmware_map_add_early(resource_size_t start, | 37 | static inline int firmware_map_add_early(u64 start, u64 end, const char *type) |
41 | resource_size_t end, const char *type) | ||
42 | { | 38 | { |
43 | return 0; | 39 | return 0; |
44 | } | 40 | } |
diff --git a/include/linux/firmware.h b/include/linux/firmware.h index c8ecf5b2a207..d31544628436 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h | |||
@@ -5,7 +5,6 @@ | |||
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | #include <linux/compiler.h> | 6 | #include <linux/compiler.h> |
7 | 7 | ||
8 | #define FIRMWARE_NAME_MAX 30 | ||
9 | #define FW_ACTION_NOHOTPLUG 0 | 8 | #define FW_ACTION_NOHOTPLUG 0 |
10 | #define FW_ACTION_HOTPLUG 1 | 9 | #define FW_ACTION_HOTPLUG 1 |
11 | 10 | ||
diff --git a/include/linux/fs.h b/include/linux/fs.h index ede84fa7da5d..0872372184fe 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -710,6 +710,9 @@ static inline int mapping_writably_mapped(struct address_space *mapping) | |||
710 | #define i_size_ordered_init(inode) do { } while (0) | 710 | #define i_size_ordered_init(inode) do { } while (0) |
711 | #endif | 711 | #endif |
712 | 712 | ||
713 | struct posix_acl; | ||
714 | #define ACL_NOT_CACHED ((void *)(-1)) | ||
715 | |||
713 | struct inode { | 716 | struct inode { |
714 | struct hlist_node i_hash; | 717 | struct hlist_node i_hash; |
715 | struct list_head i_list; | 718 | struct list_head i_list; |
@@ -773,6 +776,10 @@ struct inode { | |||
773 | #ifdef CONFIG_SECURITY | 776 | #ifdef CONFIG_SECURITY |
774 | void *i_security; | 777 | void *i_security; |
775 | #endif | 778 | #endif |
779 | #ifdef CONFIG_FS_POSIX_ACL | ||
780 | struct posix_acl *i_acl; | ||
781 | struct posix_acl *i_default_acl; | ||
782 | #endif | ||
776 | void *i_private; /* fs or device private pointer */ | 783 | void *i_private; /* fs or device private pointer */ |
777 | }; | 784 | }; |
778 | 785 | ||
@@ -879,7 +886,7 @@ struct file_ra_state { | |||
879 | there are only # of pages ahead */ | 886 | there are only # of pages ahead */ |
880 | 887 | ||
881 | unsigned int ra_pages; /* Maximum readahead window */ | 888 | unsigned int ra_pages; /* Maximum readahead window */ |
882 | int mmap_miss; /* Cache miss stat for mmap accesses */ | 889 | unsigned int mmap_miss; /* Cache miss stat for mmap accesses */ |
883 | loff_t prev_pos; /* Cache last read() position */ | 890 | loff_t prev_pos; /* Cache last read() position */ |
884 | }; | 891 | }; |
885 | 892 | ||
@@ -1107,6 +1114,7 @@ extern void locks_copy_lock(struct file_lock *, struct file_lock *); | |||
1107 | extern void __locks_copy_lock(struct file_lock *, const struct file_lock *); | 1114 | extern void __locks_copy_lock(struct file_lock *, const struct file_lock *); |
1108 | extern void locks_remove_posix(struct file *, fl_owner_t); | 1115 | extern void locks_remove_posix(struct file *, fl_owner_t); |
1109 | extern void locks_remove_flock(struct file *); | 1116 | extern void locks_remove_flock(struct file *); |
1117 | extern void locks_release_private(struct file_lock *); | ||
1110 | extern void posix_test_lock(struct file *, struct file_lock *); | 1118 | extern void posix_test_lock(struct file *, struct file_lock *); |
1111 | extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *); | 1119 | extern int posix_lock_file(struct file *, struct file_lock *, struct file_lock *); |
1112 | extern int posix_lock_file_wait(struct file *, struct file_lock *); | 1120 | extern int posix_lock_file_wait(struct file *, struct file_lock *); |
@@ -1905,6 +1913,8 @@ static inline int break_lease(struct inode *inode, unsigned int mode) | |||
1905 | 1913 | ||
1906 | extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs, | 1914 | extern int do_truncate(struct dentry *, loff_t start, unsigned int time_attrs, |
1907 | struct file *filp); | 1915 | struct file *filp); |
1916 | extern int do_fallocate(struct file *file, int mode, loff_t offset, | ||
1917 | loff_t len); | ||
1908 | extern long do_sys_open(int dfd, const char __user *filename, int flags, | 1918 | extern long do_sys_open(int dfd, const char __user *filename, int flags, |
1909 | int mode); | 1919 | int mode); |
1910 | extern struct file *filp_open(const char *, int, int); | 1920 | extern struct file *filp_open(const char *, int, int); |
@@ -1913,14 +1923,19 @@ extern struct file * dentry_open(struct dentry *, struct vfsmount *, int, | |||
1913 | extern int filp_close(struct file *, fl_owner_t id); | 1923 | extern int filp_close(struct file *, fl_owner_t id); |
1914 | extern char * getname(const char __user *); | 1924 | extern char * getname(const char __user *); |
1915 | 1925 | ||
1926 | /* fs/ioctl.c */ | ||
1927 | |||
1928 | extern int ioctl_preallocate(struct file *filp, void __user *argp); | ||
1929 | |||
1916 | /* fs/dcache.c */ | 1930 | /* fs/dcache.c */ |
1917 | extern void __init vfs_caches_init_early(void); | 1931 | extern void __init vfs_caches_init_early(void); |
1918 | extern void __init vfs_caches_init(unsigned long); | 1932 | extern void __init vfs_caches_init(unsigned long); |
1919 | 1933 | ||
1920 | extern struct kmem_cache *names_cachep; | 1934 | extern struct kmem_cache *names_cachep; |
1921 | 1935 | ||
1922 | #define __getname() kmem_cache_alloc(names_cachep, GFP_KERNEL) | 1936 | #define __getname_gfp(gfp) kmem_cache_alloc(names_cachep, (gfp)) |
1923 | #define __putname(name) kmem_cache_free(names_cachep, (void *)(name)) | 1937 | #define __getname() __getname_gfp(GFP_KERNEL) |
1938 | #define __putname(name) kmem_cache_free(names_cachep, (void *)(name)) | ||
1924 | #ifndef CONFIG_AUDITSYSCALL | 1939 | #ifndef CONFIG_AUDITSYSCALL |
1925 | #define putname(name) __putname(name) | 1940 | #define putname(name) __putname(name) |
1926 | #else | 1941 | #else |
@@ -2036,9 +2051,6 @@ extern int __invalidate_device(struct block_device *); | |||
2036 | extern int invalidate_partition(struct gendisk *, int); | 2051 | extern int invalidate_partition(struct gendisk *, int); |
2037 | #endif | 2052 | #endif |
2038 | extern int invalidate_inodes(struct super_block *); | 2053 | extern int invalidate_inodes(struct super_block *); |
2039 | unsigned long __invalidate_mapping_pages(struct address_space *mapping, | ||
2040 | pgoff_t start, pgoff_t end, | ||
2041 | bool be_atomic); | ||
2042 | unsigned long invalidate_mapping_pages(struct address_space *mapping, | 2054 | unsigned long invalidate_mapping_pages(struct address_space *mapping, |
2043 | pgoff_t start, pgoff_t end); | 2055 | pgoff_t start, pgoff_t end); |
2044 | 2056 | ||
diff --git a/include/linux/fs_enet_pd.h b/include/linux/fs_enet_pd.h index 8300cab30f9a..51b793466ff3 100644 --- a/include/linux/fs_enet_pd.h +++ b/include/linux/fs_enet_pd.h | |||
@@ -17,6 +17,7 @@ | |||
17 | #define FS_ENET_PD_H | 17 | #define FS_ENET_PD_H |
18 | 18 | ||
19 | #include <linux/string.h> | 19 | #include <linux/string.h> |
20 | #include <linux/of_mdio.h> | ||
20 | #include <asm/types.h> | 21 | #include <asm/types.h> |
21 | 22 | ||
22 | #define FS_ENET_NAME "fs_enet" | 23 | #define FS_ENET_NAME "fs_enet" |
@@ -130,10 +131,7 @@ struct fs_platform_info { | |||
130 | 131 | ||
131 | u32 device_flags; | 132 | u32 device_flags; |
132 | 133 | ||
133 | int phy_addr; /* the phy address (-1 no phy) */ | 134 | struct device_node *phy_node; |
134 | char bus_id[16]; | ||
135 | int phy_irq; /* the phy irq (if it exists) */ | ||
136 | |||
137 | const struct fs_mii_bus_info *bus_info; | 135 | const struct fs_mii_bus_info *bus_info; |
138 | 136 | ||
139 | int rx_ring, tx_ring; /* number of buffers on rx */ | 137 | int rx_ring, tx_ring; /* number of buffers on rx */ |
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index 244677cc082b..43fc95d822d5 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h | |||
@@ -79,10 +79,6 @@ struct fsl_spi_platform_data { | |||
79 | u16 max_chipselect; | 79 | u16 max_chipselect; |
80 | void (*cs_control)(struct spi_device *spi, bool on); | 80 | void (*cs_control)(struct spi_device *spi, bool on); |
81 | u32 sysclk; | 81 | u32 sysclk; |
82 | |||
83 | /* Legacy hooks, used by mpc52xx_psc_spi driver. */ | ||
84 | void (*activate_cs)(u8 cs, u8 polarity); | ||
85 | void (*deactivate_cs)(u8 cs, u8 polarity); | ||
86 | }; | 82 | }; |
87 | 83 | ||
88 | struct mpc8xx_pcmcia_ops { | 84 | struct mpc8xx_pcmcia_ops { |
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h index 44848aa830dc..6c3de999fb34 100644 --- a/include/linux/fsnotify_backend.h +++ b/include/linux/fsnotify_backend.h | |||
@@ -280,7 +280,7 @@ static inline void __fsnotify_update_dcache_flags(struct dentry *dentry) | |||
280 | assert_spin_locked(&dentry->d_lock); | 280 | assert_spin_locked(&dentry->d_lock); |
281 | 281 | ||
282 | parent = dentry->d_parent; | 282 | parent = dentry->d_parent; |
283 | if (fsnotify_inode_watches_children(parent->d_inode)) | 283 | if (parent->d_inode && fsnotify_inode_watches_children(parent->d_inode)) |
284 | dentry->d_flags |= DCACHE_FSNOTIFY_PARENT_WATCHED; | 284 | dentry->d_flags |= DCACHE_FSNOTIFY_PARENT_WATCHED; |
285 | else | 285 | else |
286 | dentry->d_flags &= ~DCACHE_FSNOTIFY_PARENT_WATCHED; | 286 | dentry->d_flags &= ~DCACHE_FSNOTIFY_PARENT_WATCHED; |
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 39b95c56587e..dc3b1328aaeb 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
@@ -362,6 +362,7 @@ struct ftrace_ret_stack { | |||
362 | unsigned long func; | 362 | unsigned long func; |
363 | unsigned long long calltime; | 363 | unsigned long long calltime; |
364 | unsigned long long subtime; | 364 | unsigned long long subtime; |
365 | unsigned long fp; | ||
365 | }; | 366 | }; |
366 | 367 | ||
367 | /* | 368 | /* |
@@ -372,7 +373,8 @@ struct ftrace_ret_stack { | |||
372 | extern void return_to_handler(void); | 373 | extern void return_to_handler(void); |
373 | 374 | ||
374 | extern int | 375 | extern int |
375 | ftrace_push_return_trace(unsigned long ret, unsigned long func, int *depth); | 376 | ftrace_push_return_trace(unsigned long ret, unsigned long func, int *depth, |
377 | unsigned long frame_pointer); | ||
376 | 378 | ||
377 | /* | 379 | /* |
378 | * Sometimes we don't want to trace a function with the function | 380 | * Sometimes we don't want to trace a function with the function |
diff --git a/include/linux/fuse.h b/include/linux/fuse.h index 162e5defe683..cf593bf9fd32 100644 --- a/include/linux/fuse.h +++ b/include/linux/fuse.h | |||
@@ -25,6 +25,11 @@ | |||
25 | * - add IOCTL message | 25 | * - add IOCTL message |
26 | * - add unsolicited notification support | 26 | * - add unsolicited notification support |
27 | * - add POLL message and NOTIFY_POLL notification | 27 | * - add POLL message and NOTIFY_POLL notification |
28 | * | ||
29 | * 7.12 | ||
30 | * - add umask flag to input argument of open, mknod and mkdir | ||
31 | * - add notification messages for invalidation of inodes and | ||
32 | * directory entries | ||
28 | */ | 33 | */ |
29 | 34 | ||
30 | #ifndef _LINUX_FUSE_H | 35 | #ifndef _LINUX_FUSE_H |
@@ -36,7 +41,7 @@ | |||
36 | #define FUSE_KERNEL_VERSION 7 | 41 | #define FUSE_KERNEL_VERSION 7 |
37 | 42 | ||
38 | /** Minor version number of this interface */ | 43 | /** Minor version number of this interface */ |
39 | #define FUSE_KERNEL_MINOR_VERSION 11 | 44 | #define FUSE_KERNEL_MINOR_VERSION 12 |
40 | 45 | ||
41 | /** The node ID of the root inode */ | 46 | /** The node ID of the root inode */ |
42 | #define FUSE_ROOT_ID 1 | 47 | #define FUSE_ROOT_ID 1 |
@@ -112,6 +117,7 @@ struct fuse_file_lock { | |||
112 | * INIT request/reply flags | 117 | * INIT request/reply flags |
113 | * | 118 | * |
114 | * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".." | 119 | * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".." |
120 | * FUSE_DONT_MASK: don't apply umask to file mode on create operations | ||
115 | */ | 121 | */ |
116 | #define FUSE_ASYNC_READ (1 << 0) | 122 | #define FUSE_ASYNC_READ (1 << 0) |
117 | #define FUSE_POSIX_LOCKS (1 << 1) | 123 | #define FUSE_POSIX_LOCKS (1 << 1) |
@@ -119,6 +125,14 @@ struct fuse_file_lock { | |||
119 | #define FUSE_ATOMIC_O_TRUNC (1 << 3) | 125 | #define FUSE_ATOMIC_O_TRUNC (1 << 3) |
120 | #define FUSE_EXPORT_SUPPORT (1 << 4) | 126 | #define FUSE_EXPORT_SUPPORT (1 << 4) |
121 | #define FUSE_BIG_WRITES (1 << 5) | 127 | #define FUSE_BIG_WRITES (1 << 5) |
128 | #define FUSE_DONT_MASK (1 << 6) | ||
129 | |||
130 | /** | ||
131 | * CUSE INIT request/reply flags | ||
132 | * | ||
133 | * CUSE_UNRESTRICTED_IOCTL: use unrestricted ioctl | ||
134 | */ | ||
135 | #define CUSE_UNRESTRICTED_IOCTL (1 << 0) | ||
122 | 136 | ||
123 | /** | 137 | /** |
124 | * Release flags | 138 | * Release flags |
@@ -210,10 +224,15 @@ enum fuse_opcode { | |||
210 | FUSE_DESTROY = 38, | 224 | FUSE_DESTROY = 38, |
211 | FUSE_IOCTL = 39, | 225 | FUSE_IOCTL = 39, |
212 | FUSE_POLL = 40, | 226 | FUSE_POLL = 40, |
227 | |||
228 | /* CUSE specific operations */ | ||
229 | CUSE_INIT = 4096, | ||
213 | }; | 230 | }; |
214 | 231 | ||
215 | enum fuse_notify_code { | 232 | enum fuse_notify_code { |
216 | FUSE_NOTIFY_POLL = 1, | 233 | FUSE_NOTIFY_POLL = 1, |
234 | FUSE_NOTIFY_INVAL_INODE = 2, | ||
235 | FUSE_NOTIFY_INVAL_ENTRY = 3, | ||
217 | FUSE_NOTIFY_CODE_MAX, | 236 | FUSE_NOTIFY_CODE_MAX, |
218 | }; | 237 | }; |
219 | 238 | ||
@@ -252,14 +271,18 @@ struct fuse_attr_out { | |||
252 | struct fuse_attr attr; | 271 | struct fuse_attr attr; |
253 | }; | 272 | }; |
254 | 273 | ||
274 | #define FUSE_COMPAT_MKNOD_IN_SIZE 8 | ||
275 | |||
255 | struct fuse_mknod_in { | 276 | struct fuse_mknod_in { |
256 | __u32 mode; | 277 | __u32 mode; |
257 | __u32 rdev; | 278 | __u32 rdev; |
279 | __u32 umask; | ||
280 | __u32 padding; | ||
258 | }; | 281 | }; |
259 | 282 | ||
260 | struct fuse_mkdir_in { | 283 | struct fuse_mkdir_in { |
261 | __u32 mode; | 284 | __u32 mode; |
262 | __u32 padding; | 285 | __u32 umask; |
263 | }; | 286 | }; |
264 | 287 | ||
265 | struct fuse_rename_in { | 288 | struct fuse_rename_in { |
@@ -291,7 +314,14 @@ struct fuse_setattr_in { | |||
291 | 314 | ||
292 | struct fuse_open_in { | 315 | struct fuse_open_in { |
293 | __u32 flags; | 316 | __u32 flags; |
317 | __u32 unused; | ||
318 | }; | ||
319 | |||
320 | struct fuse_create_in { | ||
321 | __u32 flags; | ||
294 | __u32 mode; | 322 | __u32 mode; |
323 | __u32 umask; | ||
324 | __u32 padding; | ||
295 | }; | 325 | }; |
296 | 326 | ||
297 | struct fuse_open_out { | 327 | struct fuse_open_out { |
@@ -401,6 +431,27 @@ struct fuse_init_out { | |||
401 | __u32 max_write; | 431 | __u32 max_write; |
402 | }; | 432 | }; |
403 | 433 | ||
434 | #define CUSE_INIT_INFO_MAX 4096 | ||
435 | |||
436 | struct cuse_init_in { | ||
437 | __u32 major; | ||
438 | __u32 minor; | ||
439 | __u32 unused; | ||
440 | __u32 flags; | ||
441 | }; | ||
442 | |||
443 | struct cuse_init_out { | ||
444 | __u32 major; | ||
445 | __u32 minor; | ||
446 | __u32 unused; | ||
447 | __u32 flags; | ||
448 | __u32 max_read; | ||
449 | __u32 max_write; | ||
450 | __u32 dev_major; /* chardev major */ | ||
451 | __u32 dev_minor; /* chardev minor */ | ||
452 | __u32 spare[10]; | ||
453 | }; | ||
454 | |||
404 | struct fuse_interrupt_in { | 455 | struct fuse_interrupt_in { |
405 | __u64 unique; | 456 | __u64 unique; |
406 | }; | 457 | }; |
@@ -477,4 +528,16 @@ struct fuse_dirent { | |||
477 | #define FUSE_DIRENT_SIZE(d) \ | 528 | #define FUSE_DIRENT_SIZE(d) \ |
478 | FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) | 529 | FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) |
479 | 530 | ||
531 | struct fuse_notify_inval_inode_out { | ||
532 | __u64 ino; | ||
533 | __s64 off; | ||
534 | __s64 len; | ||
535 | }; | ||
536 | |||
537 | struct fuse_notify_inval_entry_out { | ||
538 | __u64 parent; | ||
539 | __u32 namelen; | ||
540 | __u32 padding; | ||
541 | }; | ||
542 | |||
480 | #endif /* _LINUX_FUSE_H */ | 543 | #endif /* _LINUX_FUSE_H */ |
diff --git a/include/linux/gameport.h b/include/linux/gameport.h index 0cd825f7363a..1bc08541c2b9 100644 --- a/include/linux/gameport.h +++ b/include/linux/gameport.h | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | #ifdef __KERNEL__ | 12 | #ifdef __KERNEL__ |
13 | #include <asm/io.h> | 13 | #include <asm/io.h> |
14 | #include <linux/types.h> | ||
14 | #include <linux/list.h> | 15 | #include <linux/list.h> |
15 | #include <linux/mutex.h> | 16 | #include <linux/mutex.h> |
16 | #include <linux/device.h> | 17 | #include <linux/device.h> |
@@ -62,7 +63,7 @@ struct gameport_driver { | |||
62 | 63 | ||
63 | struct device_driver driver; | 64 | struct device_driver driver; |
64 | 65 | ||
65 | unsigned int ignore; | 66 | bool ignore; |
66 | }; | 67 | }; |
67 | #define to_gameport_driver(d) container_of(d, struct gameport_driver, driver) | 68 | #define to_gameport_driver(d) container_of(d, struct gameport_driver, driver) |
68 | 69 | ||
diff --git a/include/linux/gcd.h b/include/linux/gcd.h new file mode 100644 index 000000000000..69f5e8a01bad --- /dev/null +++ b/include/linux/gcd.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef _GCD_H | ||
2 | #define _GCD_H | ||
3 | |||
4 | #include <linux/compiler.h> | ||
5 | |||
6 | unsigned long gcd(unsigned long a, unsigned long b) __attribute_const__; | ||
7 | |||
8 | #endif /* _GCD_H */ | ||
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 149fda264c86..45fc320a53c6 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -114,6 +114,7 @@ struct hd_struct { | |||
114 | #define GENHD_FL_UP 16 | 114 | #define GENHD_FL_UP 16 |
115 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 | 115 | #define GENHD_FL_SUPPRESS_PARTITION_INFO 32 |
116 | #define GENHD_FL_EXT_DEVT 64 /* allow extended devt */ | 116 | #define GENHD_FL_EXT_DEVT 64 /* allow extended devt */ |
117 | #define GENHD_FL_NATIVE_CAPACITY 128 | ||
117 | 118 | ||
118 | #define BLK_SCSI_MAX_CMDS (256) | 119 | #define BLK_SCSI_MAX_CMDS (256) |
119 | #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) | 120 | #define BLK_SCSI_CMD_PER_LONG (BLK_SCSI_MAX_CMDS / (sizeof(long) * 8)) |
@@ -141,7 +142,7 @@ struct gendisk { | |||
141 | * disks that can't be partitioned. */ | 142 | * disks that can't be partitioned. */ |
142 | 143 | ||
143 | char disk_name[DISK_NAME_LEN]; /* name of major driver */ | 144 | char disk_name[DISK_NAME_LEN]; /* name of major driver */ |
144 | 145 | char *(*nodename)(struct gendisk *gd); | |
145 | /* Array of pointers to partitions indexed by partno. | 146 | /* Array of pointers to partitions indexed by partno. |
146 | * Protected with matching bdev lock but stat and other | 147 | * Protected with matching bdev lock but stat and other |
147 | * non-critical accesses use RCU. Always access through | 148 | * non-critical accesses use RCU. Always access through |
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 0bbc15f54536..7c777a0da17a 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/stddef.h> | 5 | #include <linux/stddef.h> |
6 | #include <linux/linkage.h> | 6 | #include <linux/linkage.h> |
7 | #include <linux/topology.h> | 7 | #include <linux/topology.h> |
8 | #include <linux/mmdebug.h> | ||
8 | 9 | ||
9 | struct vm_area_struct; | 10 | struct vm_area_struct; |
10 | 11 | ||
@@ -20,7 +21,8 @@ struct vm_area_struct; | |||
20 | #define __GFP_DMA ((__force gfp_t)0x01u) | 21 | #define __GFP_DMA ((__force gfp_t)0x01u) |
21 | #define __GFP_HIGHMEM ((__force gfp_t)0x02u) | 22 | #define __GFP_HIGHMEM ((__force gfp_t)0x02u) |
22 | #define __GFP_DMA32 ((__force gfp_t)0x04u) | 23 | #define __GFP_DMA32 ((__force gfp_t)0x04u) |
23 | 24 | #define __GFP_MOVABLE ((__force gfp_t)0x08u) /* Page is movable */ | |
25 | #define GFP_ZONEMASK (__GFP_DMA|__GFP_HIGHMEM|__GFP_DMA32|__GFP_MOVABLE) | ||
24 | /* | 26 | /* |
25 | * Action modifiers - doesn't change the zoning | 27 | * Action modifiers - doesn't change the zoning |
26 | * | 28 | * |
@@ -50,9 +52,20 @@ struct vm_area_struct; | |||
50 | #define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */ | 52 | #define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */ |
51 | #define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */ | 53 | #define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */ |
52 | #define __GFP_RECLAIMABLE ((__force gfp_t)0x80000u) /* Page is reclaimable */ | 54 | #define __GFP_RECLAIMABLE ((__force gfp_t)0x80000u) /* Page is reclaimable */ |
53 | #define __GFP_MOVABLE ((__force gfp_t)0x100000u) /* Page is movable */ | ||
54 | 55 | ||
55 | #define __GFP_BITS_SHIFT 21 /* Room for 21 __GFP_FOO bits */ | 56 | #ifdef CONFIG_KMEMCHECK |
57 | #define __GFP_NOTRACK ((__force gfp_t)0x200000u) /* Don't track with kmemcheck */ | ||
58 | #else | ||
59 | #define __GFP_NOTRACK ((__force gfp_t)0) | ||
60 | #endif | ||
61 | |||
62 | /* | ||
63 | * This may seem redundant, but it's a way of annotating false positives vs. | ||
64 | * allocations that simply cannot be supported (e.g. page tables). | ||
65 | */ | ||
66 | #define __GFP_NOTRACK_FALSE_POSITIVE (__GFP_NOTRACK) | ||
67 | |||
68 | #define __GFP_BITS_SHIFT 22 /* Room for 22 __GFP_FOO bits */ | ||
56 | #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) | 69 | #define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) |
57 | 70 | ||
58 | /* This equals 0, but use constants in case they ever change */ | 71 | /* This equals 0, but use constants in case they ever change */ |
@@ -85,6 +98,9 @@ struct vm_area_struct; | |||
85 | __GFP_NOWARN|__GFP_REPEAT|__GFP_NOFAIL|\ | 98 | __GFP_NOWARN|__GFP_REPEAT|__GFP_NOFAIL|\ |
86 | __GFP_NORETRY|__GFP_NOMEMALLOC) | 99 | __GFP_NORETRY|__GFP_NOMEMALLOC) |
87 | 100 | ||
101 | /* Control slab gfp mask during early boot */ | ||
102 | #define GFP_BOOT_MASK __GFP_BITS_MASK & ~(__GFP_WAIT|__GFP_IO|__GFP_FS) | ||
103 | |||
88 | /* Control allocation constraints */ | 104 | /* Control allocation constraints */ |
89 | #define GFP_CONSTRAINT_MASK (__GFP_HARDWALL|__GFP_THISNODE) | 105 | #define GFP_CONSTRAINT_MASK (__GFP_HARDWALL|__GFP_THISNODE) |
90 | 106 | ||
@@ -112,24 +128,105 @@ static inline int allocflags_to_migratetype(gfp_t gfp_flags) | |||
112 | ((gfp_flags & __GFP_RECLAIMABLE) != 0); | 128 | ((gfp_flags & __GFP_RECLAIMABLE) != 0); |
113 | } | 129 | } |
114 | 130 | ||
115 | static inline enum zone_type gfp_zone(gfp_t flags) | 131 | #ifdef CONFIG_HIGHMEM |
116 | { | 132 | #define OPT_ZONE_HIGHMEM ZONE_HIGHMEM |
133 | #else | ||
134 | #define OPT_ZONE_HIGHMEM ZONE_NORMAL | ||
135 | #endif | ||
136 | |||
117 | #ifdef CONFIG_ZONE_DMA | 137 | #ifdef CONFIG_ZONE_DMA |
118 | if (flags & __GFP_DMA) | 138 | #define OPT_ZONE_DMA ZONE_DMA |
119 | return ZONE_DMA; | 139 | #else |
140 | #define OPT_ZONE_DMA ZONE_NORMAL | ||
120 | #endif | 141 | #endif |
142 | |||
121 | #ifdef CONFIG_ZONE_DMA32 | 143 | #ifdef CONFIG_ZONE_DMA32 |
122 | if (flags & __GFP_DMA32) | 144 | #define OPT_ZONE_DMA32 ZONE_DMA32 |
123 | return ZONE_DMA32; | 145 | #else |
146 | #define OPT_ZONE_DMA32 ZONE_NORMAL | ||
124 | #endif | 147 | #endif |
125 | if ((flags & (__GFP_HIGHMEM | __GFP_MOVABLE)) == | 148 | |
126 | (__GFP_HIGHMEM | __GFP_MOVABLE)) | 149 | /* |
127 | return ZONE_MOVABLE; | 150 | * GFP_ZONE_TABLE is a word size bitstring that is used for looking up the |
128 | #ifdef CONFIG_HIGHMEM | 151 | * zone to use given the lowest 4 bits of gfp_t. Entries are ZONE_SHIFT long |
129 | if (flags & __GFP_HIGHMEM) | 152 | * and there are 16 of them to cover all possible combinations of |
130 | return ZONE_HIGHMEM; | 153 | * __GFP_DMA, __GFP_DMA32, __GFP_MOVABLE and __GFP_HIGHMEM |
154 | * | ||
155 | * The zone fallback order is MOVABLE=>HIGHMEM=>NORMAL=>DMA32=>DMA. | ||
156 | * But GFP_MOVABLE is not only a zone specifier but also an allocation | ||
157 | * policy. Therefore __GFP_MOVABLE plus another zone selector is valid. | ||
158 | * Only 1bit of the lowest 3 bit (DMA,DMA32,HIGHMEM) can be set to "1". | ||
159 | * | ||
160 | * bit result | ||
161 | * ================= | ||
162 | * 0x0 => NORMAL | ||
163 | * 0x1 => DMA or NORMAL | ||
164 | * 0x2 => HIGHMEM or NORMAL | ||
165 | * 0x3 => BAD (DMA+HIGHMEM) | ||
166 | * 0x4 => DMA32 or DMA or NORMAL | ||
167 | * 0x5 => BAD (DMA+DMA32) | ||
168 | * 0x6 => BAD (HIGHMEM+DMA32) | ||
169 | * 0x7 => BAD (HIGHMEM+DMA32+DMA) | ||
170 | * 0x8 => NORMAL (MOVABLE+0) | ||
171 | * 0x9 => DMA or NORMAL (MOVABLE+DMA) | ||
172 | * 0xa => MOVABLE (Movable is valid only if HIGHMEM is set too) | ||
173 | * 0xb => BAD (MOVABLE+HIGHMEM+DMA) | ||
174 | * 0xc => DMA32 (MOVABLE+HIGHMEM+DMA32) | ||
175 | * 0xd => BAD (MOVABLE+DMA32+DMA) | ||
176 | * 0xe => BAD (MOVABLE+DMA32+HIGHMEM) | ||
177 | * 0xf => BAD (MOVABLE+DMA32+HIGHMEM+DMA) | ||
178 | * | ||
179 | * ZONES_SHIFT must be <= 2 on 32 bit platforms. | ||
180 | */ | ||
181 | |||
182 | #if 16 * ZONES_SHIFT > BITS_PER_LONG | ||
183 | #error ZONES_SHIFT too large to create GFP_ZONE_TABLE integer | ||
131 | #endif | 184 | #endif |
132 | return ZONE_NORMAL; | 185 | |
186 | #define GFP_ZONE_TABLE ( \ | ||
187 | (ZONE_NORMAL << 0 * ZONES_SHIFT) \ | ||
188 | | (OPT_ZONE_DMA << __GFP_DMA * ZONES_SHIFT) \ | ||
189 | | (OPT_ZONE_HIGHMEM << __GFP_HIGHMEM * ZONES_SHIFT) \ | ||
190 | | (OPT_ZONE_DMA32 << __GFP_DMA32 * ZONES_SHIFT) \ | ||
191 | | (ZONE_NORMAL << __GFP_MOVABLE * ZONES_SHIFT) \ | ||
192 | | (OPT_ZONE_DMA << (__GFP_MOVABLE | __GFP_DMA) * ZONES_SHIFT) \ | ||
193 | | (ZONE_MOVABLE << (__GFP_MOVABLE | __GFP_HIGHMEM) * ZONES_SHIFT)\ | ||
194 | | (OPT_ZONE_DMA32 << (__GFP_MOVABLE | __GFP_DMA32) * ZONES_SHIFT)\ | ||
195 | ) | ||
196 | |||
197 | /* | ||
198 | * GFP_ZONE_BAD is a bitmap for all combination of __GFP_DMA, __GFP_DMA32 | ||
199 | * __GFP_HIGHMEM and __GFP_MOVABLE that are not permitted. One flag per | ||
200 | * entry starting with bit 0. Bit is set if the combination is not | ||
201 | * allowed. | ||
202 | */ | ||
203 | #define GFP_ZONE_BAD ( \ | ||
204 | 1 << (__GFP_DMA | __GFP_HIGHMEM) \ | ||
205 | | 1 << (__GFP_DMA | __GFP_DMA32) \ | ||
206 | | 1 << (__GFP_DMA32 | __GFP_HIGHMEM) \ | ||
207 | | 1 << (__GFP_DMA | __GFP_DMA32 | __GFP_HIGHMEM) \ | ||
208 | | 1 << (__GFP_MOVABLE | __GFP_HIGHMEM | __GFP_DMA) \ | ||
209 | | 1 << (__GFP_MOVABLE | __GFP_DMA32 | __GFP_DMA) \ | ||
210 | | 1 << (__GFP_MOVABLE | __GFP_DMA32 | __GFP_HIGHMEM) \ | ||
211 | | 1 << (__GFP_MOVABLE | __GFP_DMA32 | __GFP_DMA | __GFP_HIGHMEM)\ | ||
212 | ) | ||
213 | |||
214 | static inline enum zone_type gfp_zone(gfp_t flags) | ||
215 | { | ||
216 | enum zone_type z; | ||
217 | int bit = flags & GFP_ZONEMASK; | ||
218 | |||
219 | z = (GFP_ZONE_TABLE >> (bit * ZONES_SHIFT)) & | ||
220 | ((1 << ZONES_SHIFT) - 1); | ||
221 | |||
222 | if (__builtin_constant_p(bit)) | ||
223 | BUILD_BUG_ON((GFP_ZONE_BAD >> bit) & 1); | ||
224 | else { | ||
225 | #ifdef CONFIG_DEBUG_VM | ||
226 | BUG_ON((GFP_ZONE_BAD >> bit) & 1); | ||
227 | #endif | ||
228 | } | ||
229 | return z; | ||
133 | } | 230 | } |
134 | 231 | ||
135 | /* | 232 | /* |
@@ -169,30 +266,19 @@ static inline void arch_alloc_page(struct page *page, int order) { } | |||
169 | #endif | 266 | #endif |
170 | 267 | ||
171 | struct page * | 268 | struct page * |
172 | __alloc_pages_internal(gfp_t gfp_mask, unsigned int order, | 269 | __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, |
173 | struct zonelist *zonelist, nodemask_t *nodemask); | 270 | struct zonelist *zonelist, nodemask_t *nodemask); |
174 | 271 | ||
175 | static inline struct page * | 272 | static inline struct page * |
176 | __alloc_pages(gfp_t gfp_mask, unsigned int order, | 273 | __alloc_pages(gfp_t gfp_mask, unsigned int order, |
177 | struct zonelist *zonelist) | 274 | struct zonelist *zonelist) |
178 | { | 275 | { |
179 | return __alloc_pages_internal(gfp_mask, order, zonelist, NULL); | 276 | return __alloc_pages_nodemask(gfp_mask, order, zonelist, NULL); |
180 | } | 277 | } |
181 | 278 | ||
182 | static inline struct page * | ||
183 | __alloc_pages_nodemask(gfp_t gfp_mask, unsigned int order, | ||
184 | struct zonelist *zonelist, nodemask_t *nodemask) | ||
185 | { | ||
186 | return __alloc_pages_internal(gfp_mask, order, zonelist, nodemask); | ||
187 | } | ||
188 | |||
189 | |||
190 | static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, | 279 | static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, |
191 | unsigned int order) | 280 | unsigned int order) |
192 | { | 281 | { |
193 | if (unlikely(order >= MAX_ORDER)) | ||
194 | return NULL; | ||
195 | |||
196 | /* Unknown node is current node */ | 282 | /* Unknown node is current node */ |
197 | if (nid < 0) | 283 | if (nid < 0) |
198 | nid = numa_node_id(); | 284 | nid = numa_node_id(); |
@@ -200,15 +286,20 @@ static inline struct page *alloc_pages_node(int nid, gfp_t gfp_mask, | |||
200 | return __alloc_pages(gfp_mask, order, node_zonelist(nid, gfp_mask)); | 286 | return __alloc_pages(gfp_mask, order, node_zonelist(nid, gfp_mask)); |
201 | } | 287 | } |
202 | 288 | ||
289 | static inline struct page *alloc_pages_exact_node(int nid, gfp_t gfp_mask, | ||
290 | unsigned int order) | ||
291 | { | ||
292 | VM_BUG_ON(nid < 0 || nid >= MAX_NUMNODES); | ||
293 | |||
294 | return __alloc_pages(gfp_mask, order, node_zonelist(nid, gfp_mask)); | ||
295 | } | ||
296 | |||
203 | #ifdef CONFIG_NUMA | 297 | #ifdef CONFIG_NUMA |
204 | extern struct page *alloc_pages_current(gfp_t gfp_mask, unsigned order); | 298 | extern struct page *alloc_pages_current(gfp_t gfp_mask, unsigned order); |
205 | 299 | ||
206 | static inline struct page * | 300 | static inline struct page * |
207 | alloc_pages(gfp_t gfp_mask, unsigned int order) | 301 | alloc_pages(gfp_t gfp_mask, unsigned int order) |
208 | { | 302 | { |
209 | if (unlikely(order >= MAX_ORDER)) | ||
210 | return NULL; | ||
211 | |||
212 | return alloc_pages_current(gfp_mask, order); | 303 | return alloc_pages_current(gfp_mask, order); |
213 | } | 304 | } |
214 | extern struct page *alloc_page_vma(gfp_t gfp_mask, | 305 | extern struct page *alloc_page_vma(gfp_t gfp_mask, |
@@ -245,4 +336,23 @@ void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp); | |||
245 | void drain_all_pages(void); | 336 | void drain_all_pages(void); |
246 | void drain_local_pages(void *dummy); | 337 | void drain_local_pages(void *dummy); |
247 | 338 | ||
339 | extern bool oom_killer_disabled; | ||
340 | |||
341 | static inline void oom_killer_disable(void) | ||
342 | { | ||
343 | oom_killer_disabled = true; | ||
344 | } | ||
345 | |||
346 | static inline void oom_killer_enable(void) | ||
347 | { | ||
348 | oom_killer_disabled = false; | ||
349 | } | ||
350 | |||
351 | extern gfp_t gfp_allowed_mask; | ||
352 | |||
353 | static inline void set_gfp_allowed_mask(gfp_t mask) | ||
354 | { | ||
355 | gfp_allowed_mask = mask; | ||
356 | } | ||
357 | |||
248 | #endif /* __LINUX_GFP_H */ | 358 | #endif /* __LINUX_GFP_H */ |
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 45257475623c..8246c697863d 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -2,7 +2,9 @@ | |||
2 | #define LINUX_HARDIRQ_H | 2 | #define LINUX_HARDIRQ_H |
3 | 3 | ||
4 | #include <linux/preempt.h> | 4 | #include <linux/preempt.h> |
5 | #ifdef CONFIG_PREEMPT | ||
5 | #include <linux/smp_lock.h> | 6 | #include <linux/smp_lock.h> |
7 | #endif | ||
6 | #include <linux/lockdep.h> | 8 | #include <linux/lockdep.h> |
7 | #include <linux/ftrace_irq.h> | 9 | #include <linux/ftrace_irq.h> |
8 | #include <asm/hardirq.h> | 10 | #include <asm/hardirq.h> |
diff --git a/include/linux/hid.h b/include/linux/hid.h index 60fa52913f89..a0ebdace7baa 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -238,6 +238,42 @@ struct hid_item { | |||
238 | #define HID_GD_RIGHT 0x00010092 | 238 | #define HID_GD_RIGHT 0x00010092 |
239 | #define HID_GD_LEFT 0x00010093 | 239 | #define HID_GD_LEFT 0x00010093 |
240 | 240 | ||
241 | #define HID_DG_DIGITIZER 0x000d0001 | ||
242 | #define HID_DG_PEN 0x000d0002 | ||
243 | #define HID_DG_LIGHTPEN 0x000d0003 | ||
244 | #define HID_DG_TOUCHSCREEN 0x000d0004 | ||
245 | #define HID_DG_TOUCHPAD 0x000d0005 | ||
246 | #define HID_DG_STYLUS 0x000d0020 | ||
247 | #define HID_DG_PUCK 0x000d0021 | ||
248 | #define HID_DG_FINGER 0x000d0022 | ||
249 | #define HID_DG_TIPPRESSURE 0x000d0030 | ||
250 | #define HID_DG_BARRELPRESSURE 0x000d0031 | ||
251 | #define HID_DG_INRANGE 0x000d0032 | ||
252 | #define HID_DG_TOUCH 0x000d0033 | ||
253 | #define HID_DG_UNTOUCH 0x000d0034 | ||
254 | #define HID_DG_TAP 0x000d0035 | ||
255 | #define HID_DG_TABLETFUNCTIONKEY 0x000d0039 | ||
256 | #define HID_DG_PROGRAMCHANGEKEY 0x000d003a | ||
257 | #define HID_DG_INVERT 0x000d003c | ||
258 | #define HID_DG_TIPSWITCH 0x000d0042 | ||
259 | #define HID_DG_TIPSWITCH2 0x000d0043 | ||
260 | #define HID_DG_BARRELSWITCH 0x000d0044 | ||
261 | #define HID_DG_ERASER 0x000d0045 | ||
262 | #define HID_DG_TABLETPICK 0x000d0046 | ||
263 | /* | ||
264 | * as of May 20, 2009 the usages below are not yet in the official USB spec | ||
265 | * but are being pushed by Microsft as described in their paper "Digitizer | ||
266 | * Drivers for Windows Touch and Pen-Based Computers" | ||
267 | */ | ||
268 | #define HID_DG_CONFIDENCE 0x000d0047 | ||
269 | #define HID_DG_WIDTH 0x000d0048 | ||
270 | #define HID_DG_HEIGHT 0x000d0049 | ||
271 | #define HID_DG_CONTACTID 0x000d0051 | ||
272 | #define HID_DG_INPUTMODE 0x000d0052 | ||
273 | #define HID_DG_DEVICEINDEX 0x000d0053 | ||
274 | #define HID_DG_CONTACTCOUNT 0x000d0054 | ||
275 | #define HID_DG_CONTACTMAX 0x000d0055 | ||
276 | |||
241 | /* | 277 | /* |
242 | * HID report types --- Ouch! HID spec says 1 2 3! | 278 | * HID report types --- Ouch! HID spec says 1 2 3! |
243 | */ | 279 | */ |
diff --git a/include/linux/highmem.h b/include/linux/highmem.h index 1fcb7126a01f..211ff4497269 100644 --- a/include/linux/highmem.h +++ b/include/linux/highmem.h | |||
@@ -55,7 +55,9 @@ static inline void *kmap(struct page *page) | |||
55 | return page_address(page); | 55 | return page_address(page); |
56 | } | 56 | } |
57 | 57 | ||
58 | #define kunmap(page) do { (void) (page); } while (0) | 58 | static inline void kunmap(struct page *page) |
59 | { | ||
60 | } | ||
59 | 61 | ||
60 | static inline void *kmap_atomic(struct page *page, enum km_type idx) | 62 | static inline void *kmap_atomic(struct page *page, enum km_type idx) |
61 | { | 63 | { |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 0d2f7c8a33d6..4759917adc71 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #include <linux/list.h> | 21 | #include <linux/list.h> |
22 | #include <linux/wait.h> | 22 | #include <linux/wait.h> |
23 | #include <linux/percpu.h> | 23 | #include <linux/percpu.h> |
24 | #include <linux/timer.h> | ||
24 | 25 | ||
25 | 26 | ||
26 | struct hrtimer_clock_base; | 27 | struct hrtimer_clock_base; |
@@ -30,8 +31,11 @@ struct hrtimer_cpu_base; | |||
30 | * Mode arguments of xxx_hrtimer functions: | 31 | * Mode arguments of xxx_hrtimer functions: |
31 | */ | 32 | */ |
32 | enum hrtimer_mode { | 33 | enum hrtimer_mode { |
33 | HRTIMER_MODE_ABS, /* Time value is absolute */ | 34 | HRTIMER_MODE_ABS = 0x0, /* Time value is absolute */ |
34 | HRTIMER_MODE_REL, /* Time value is relative to now */ | 35 | HRTIMER_MODE_REL = 0x1, /* Time value is relative to now */ |
36 | HRTIMER_MODE_PINNED = 0x02, /* Timer is bound to CPU */ | ||
37 | HRTIMER_MODE_ABS_PINNED = 0x02, | ||
38 | HRTIMER_MODE_REL_PINNED = 0x03, | ||
35 | }; | 39 | }; |
36 | 40 | ||
37 | /* | 41 | /* |
@@ -444,6 +448,8 @@ extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf, | |||
444 | 448 | ||
445 | static inline void timer_stats_account_hrtimer(struct hrtimer *timer) | 449 | static inline void timer_stats_account_hrtimer(struct hrtimer *timer) |
446 | { | 450 | { |
451 | if (likely(!timer->start_site)) | ||
452 | return; | ||
447 | timer_stats_update_stats(timer, timer->start_pid, timer->start_site, | 453 | timer_stats_update_stats(timer, timer->start_pid, timer->start_site, |
448 | timer->function, timer->start_comm, 0); | 454 | timer->function, timer->start_comm, 0); |
449 | } | 455 | } |
@@ -453,6 +459,8 @@ extern void __timer_stats_hrtimer_set_start_info(struct hrtimer *timer, | |||
453 | 459 | ||
454 | static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer) | 460 | static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer) |
455 | { | 461 | { |
462 | if (likely(!timer_stats_active)) | ||
463 | return; | ||
456 | __timer_stats_hrtimer_set_start_info(timer, __builtin_return_address(0)); | 464 | __timer_stats_hrtimer_set_start_info(timer, __builtin_return_address(0)); |
457 | } | 465 | } |
458 | 466 | ||
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 03be7f29ca01..2723513a5651 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h | |||
@@ -11,6 +11,8 @@ | |||
11 | 11 | ||
12 | struct ctl_table; | 12 | struct ctl_table; |
13 | 13 | ||
14 | int PageHuge(struct page *page); | ||
15 | |||
14 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | 16 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) |
15 | { | 17 | { |
16 | return vma->vm_flags & VM_HUGETLB; | 18 | return vma->vm_flags & VM_HUGETLB; |
@@ -31,7 +33,7 @@ void hugetlb_report_meminfo(struct seq_file *); | |||
31 | int hugetlb_report_node_meminfo(int, char *); | 33 | int hugetlb_report_node_meminfo(int, char *); |
32 | unsigned long hugetlb_total_pages(void); | 34 | unsigned long hugetlb_total_pages(void); |
33 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, | 35 | int hugetlb_fault(struct mm_struct *mm, struct vm_area_struct *vma, |
34 | unsigned long address, int write_access); | 36 | unsigned long address, unsigned int flags); |
35 | int hugetlb_reserve_pages(struct inode *inode, long from, long to, | 37 | int hugetlb_reserve_pages(struct inode *inode, long from, long to, |
36 | struct vm_area_struct *vma, | 38 | struct vm_area_struct *vma, |
37 | int acctflags); | 39 | int acctflags); |
@@ -61,6 +63,11 @@ void hugetlb_change_protection(struct vm_area_struct *vma, | |||
61 | 63 | ||
62 | #else /* !CONFIG_HUGETLB_PAGE */ | 64 | #else /* !CONFIG_HUGETLB_PAGE */ |
63 | 65 | ||
66 | static inline int PageHuge(struct page *page) | ||
67 | { | ||
68 | return 0; | ||
69 | } | ||
70 | |||
64 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) | 71 | static inline int is_vm_hugetlb_page(struct vm_area_struct *vma) |
65 | { | 72 | { |
66 | return 0; | 73 | return 0; |
@@ -91,7 +98,7 @@ static inline void hugetlb_report_meminfo(struct seq_file *m) | |||
91 | #define pud_huge(x) 0 | 98 | #define pud_huge(x) 0 |
92 | #define is_hugepage_only_range(mm, addr, len) 0 | 99 | #define is_hugepage_only_range(mm, addr, len) 0 |
93 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) | 100 | #define hugetlb_free_pgd_range(tlb, addr, end, floor, ceiling) ({BUG(); 0; }) |
94 | #define hugetlb_fault(mm, vma, addr, write) ({ BUG(); 0; }) | 101 | #define hugetlb_fault(mm, vma, addr, flags) ({ BUG(); 0; }) |
95 | 102 | ||
96 | #define hugetlb_change_protection(vma, address, end, newprot) | 103 | #define hugetlb_change_protection(vma, address, end, newprot) |
97 | 104 | ||
diff --git a/include/linux/i2c-ocores.h b/include/linux/i2c-ocores.h index 8ed591b0887e..4d5e57ff6614 100644 --- a/include/linux/i2c-ocores.h +++ b/include/linux/i2c-ocores.h | |||
@@ -14,6 +14,8 @@ | |||
14 | struct ocores_i2c_platform_data { | 14 | struct ocores_i2c_platform_data { |
15 | u32 regstep; /* distance between registers */ | 15 | u32 regstep; /* distance between registers */ |
16 | u32 clock_khz; /* input clock in kHz */ | 16 | u32 clock_khz; /* input clock in kHz */ |
17 | u8 num_devices; /* number of devices in the devices list */ | ||
18 | struct i2c_board_info const *devices; /* devices connected to the bus */ | ||
17 | }; | 19 | }; |
18 | 20 | ||
19 | #endif /* _LINUX_I2C_OCORES_H */ | 21 | #endif /* _LINUX_I2C_OCORES_H */ |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index ad2580596033..f4784c0fe975 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -47,6 +47,7 @@ struct i2c_driver; | |||
47 | union i2c_smbus_data; | 47 | union i2c_smbus_data; |
48 | struct i2c_board_info; | 48 | struct i2c_board_info; |
49 | 49 | ||
50 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | ||
50 | /* | 51 | /* |
51 | * The master routines are the ones normally used to transmit data to devices | 52 | * The master routines are the ones normally used to transmit data to devices |
52 | * on a bus (or read from them). Apart from two basic transfer functions to | 53 | * on a bus (or read from them). Apart from two basic transfer functions to |
@@ -93,6 +94,7 @@ extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client *client, | |||
93 | extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, | 94 | extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, |
94 | u8 command, u8 length, | 95 | u8 command, u8 length, |
95 | const u8 *values); | 96 | const u8 *values); |
97 | #endif /* I2C */ | ||
96 | 98 | ||
97 | /** | 99 | /** |
98 | * struct i2c_driver - represent an I2C device driver | 100 | * struct i2c_driver - represent an I2C device driver |
@@ -100,9 +102,8 @@ extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, | |||
100 | * @class: What kind of i2c device we instantiate (for detect) | 102 | * @class: What kind of i2c device we instantiate (for detect) |
101 | * @attach_adapter: Callback for bus addition (for legacy drivers) | 103 | * @attach_adapter: Callback for bus addition (for legacy drivers) |
102 | * @detach_adapter: Callback for bus removal (for legacy drivers) | 104 | * @detach_adapter: Callback for bus removal (for legacy drivers) |
103 | * @detach_client: Callback for device removal (for legacy drivers) | 105 | * @probe: Callback for device binding |
104 | * @probe: Callback for device binding (new-style drivers) | 106 | * @remove: Callback for device unbinding |
105 | * @remove: Callback for device unbinding (new-style drivers) | ||
106 | * @shutdown: Callback for device shutdown | 107 | * @shutdown: Callback for device shutdown |
107 | * @suspend: Callback for device suspend | 108 | * @suspend: Callback for device suspend |
108 | * @resume: Callback for device resume | 109 | * @resume: Callback for device resume |
@@ -137,26 +138,14 @@ struct i2c_driver { | |||
137 | int id; | 138 | int id; |
138 | unsigned int class; | 139 | unsigned int class; |
139 | 140 | ||
140 | /* Notifies the driver that a new bus has appeared. This routine | 141 | /* Notifies the driver that a new bus has appeared or is about to be |
141 | * can be used by the driver to test if the bus meets its conditions | 142 | * removed. You should avoid using this if you can, it will probably |
142 | * & seek for the presence of the chip(s) it supports. If found, it | 143 | * be removed in a near future. |
143 | * registers the client(s) that are on the bus to the i2c admin. via | ||
144 | * i2c_attach_client. (LEGACY I2C DRIVERS ONLY) | ||
145 | */ | 144 | */ |
146 | int (*attach_adapter)(struct i2c_adapter *); | 145 | int (*attach_adapter)(struct i2c_adapter *); |
147 | int (*detach_adapter)(struct i2c_adapter *); | 146 | int (*detach_adapter)(struct i2c_adapter *); |
148 | 147 | ||
149 | /* tells the driver that a client is about to be deleted & gives it | 148 | /* Standard driver model interfaces */ |
150 | * the chance to remove its private data. Also, if the client struct | ||
151 | * has been dynamically allocated by the driver in the function above, | ||
152 | * it must be freed here. (LEGACY I2C DRIVERS ONLY) | ||
153 | */ | ||
154 | int (*detach_client)(struct i2c_client *) __deprecated; | ||
155 | |||
156 | /* Standard driver model interfaces, for "new style" i2c drivers. | ||
157 | * With the driver model, device enumeration is NEVER done by drivers; | ||
158 | * it's done by infrastructure. (NEW STYLE DRIVERS ONLY) | ||
159 | */ | ||
160 | int (*probe)(struct i2c_client *, const struct i2c_device_id *); | 149 | int (*probe)(struct i2c_client *, const struct i2c_device_id *); |
161 | int (*remove)(struct i2c_client *); | 150 | int (*remove)(struct i2c_client *); |
162 | 151 | ||
@@ -191,9 +180,8 @@ struct i2c_driver { | |||
191 | * @driver: device's driver, hence pointer to access routines | 180 | * @driver: device's driver, hence pointer to access routines |
192 | * @dev: Driver model device node for the slave. | 181 | * @dev: Driver model device node for the slave. |
193 | * @irq: indicates the IRQ generated by this device (if any) | 182 | * @irq: indicates the IRQ generated by this device (if any) |
194 | * @list: list of active/busy clients (DEPRECATED) | 183 | * @detected: member of an i2c_driver.clients list or i2c-core's |
195 | * @detected: member of an i2c_driver.clients list | 184 | * userspace_devices list |
196 | * @released: used to synchronize client releases & detaches and references | ||
197 | * | 185 | * |
198 | * An i2c_client identifies a single device (i.e. chip) connected to an | 186 | * An i2c_client identifies a single device (i.e. chip) connected to an |
199 | * i2c bus. The behaviour exposed to Linux is defined by the driver | 187 | * i2c bus. The behaviour exposed to Linux is defined by the driver |
@@ -209,9 +197,7 @@ struct i2c_client { | |||
209 | struct i2c_driver *driver; /* and our access routines */ | 197 | struct i2c_driver *driver; /* and our access routines */ |
210 | struct device dev; /* the device structure */ | 198 | struct device dev; /* the device structure */ |
211 | int irq; /* irq issued by device */ | 199 | int irq; /* irq issued by device */ |
212 | struct list_head list; /* DEPRECATED */ | ||
213 | struct list_head detected; | 200 | struct list_head detected; |
214 | struct completion released; | ||
215 | }; | 201 | }; |
216 | #define to_i2c_client(d) container_of(d, struct i2c_client, dev) | 202 | #define to_i2c_client(d) container_of(d, struct i2c_client, dev) |
217 | 203 | ||
@@ -248,11 +234,10 @@ static inline void i2c_set_clientdata(struct i2c_client *dev, void *data) | |||
248 | * that, such as chip type, configuration, associated IRQ, and so on. | 234 | * that, such as chip type, configuration, associated IRQ, and so on. |
249 | * | 235 | * |
250 | * i2c_board_info is used to build tables of information listing I2C devices | 236 | * i2c_board_info is used to build tables of information listing I2C devices |
251 | * that are present. This information is used to grow the driver model tree | 237 | * that are present. This information is used to grow the driver model tree. |
252 | * for "new style" I2C drivers. For mainboards this is done statically using | 238 | * For mainboards this is done statically using i2c_register_board_info(); |
253 | * i2c_register_board_info(); bus numbers identify adapters that aren't | 239 | * bus numbers identify adapters that aren't yet available. For add-on boards, |
254 | * yet available. For add-on boards, i2c_new_device() does this dynamically | 240 | * i2c_new_device() does this dynamically with the adapter already known. |
255 | * with the adapter already known. | ||
256 | */ | 241 | */ |
257 | struct i2c_board_info { | 242 | struct i2c_board_info { |
258 | char type[I2C_NAME_SIZE]; | 243 | char type[I2C_NAME_SIZE]; |
@@ -277,6 +262,7 @@ struct i2c_board_info { | |||
277 | .type = dev_type, .addr = (dev_addr) | 262 | .type = dev_type, .addr = (dev_addr) |
278 | 263 | ||
279 | 264 | ||
265 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | ||
280 | /* Add-on boards should register/unregister their devices; e.g. a board | 266 | /* Add-on boards should register/unregister their devices; e.g. a board |
281 | * with integrated I2C, a config eeprom, sensors, and a codec that's | 267 | * with integrated I2C, a config eeprom, sensors, and a codec that's |
282 | * used in conjunction with the primary hardware. | 268 | * used in conjunction with the primary hardware. |
@@ -300,6 +286,7 @@ extern struct i2c_client * | |||
300 | i2c_new_dummy(struct i2c_adapter *adap, u16 address); | 286 | i2c_new_dummy(struct i2c_adapter *adap, u16 address); |
301 | 287 | ||
302 | extern void i2c_unregister_device(struct i2c_client *); | 288 | extern void i2c_unregister_device(struct i2c_client *); |
289 | #endif /* I2C */ | ||
303 | 290 | ||
304 | /* Mainboard arch_initcall() code should register all its I2C devices. | 291 | /* Mainboard arch_initcall() code should register all its I2C devices. |
305 | * This is done at arch_initcall time, before declaring any i2c adapters. | 292 | * This is done at arch_initcall time, before declaring any i2c adapters. |
@@ -316,7 +303,7 @@ i2c_register_board_info(int busnum, struct i2c_board_info const *info, | |||
316 | { | 303 | { |
317 | return 0; | 304 | return 0; |
318 | } | 305 | } |
319 | #endif | 306 | #endif /* I2C_BOARDINFO */ |
320 | 307 | ||
321 | /* | 308 | /* |
322 | * The following structs are for those who like to implement new bus drivers: | 309 | * The following structs are for those who like to implement new bus drivers: |
@@ -352,21 +339,15 @@ struct i2c_adapter { | |||
352 | const struct i2c_algorithm *algo; /* the algorithm to access the bus */ | 339 | const struct i2c_algorithm *algo; /* the algorithm to access the bus */ |
353 | void *algo_data; | 340 | void *algo_data; |
354 | 341 | ||
355 | /* --- administration stuff. */ | ||
356 | int (*client_register)(struct i2c_client *) __deprecated; | ||
357 | int (*client_unregister)(struct i2c_client *) __deprecated; | ||
358 | |||
359 | /* data fields that are valid for all devices */ | 342 | /* data fields that are valid for all devices */ |
360 | u8 level; /* nesting level for lockdep */ | 343 | u8 level; /* nesting level for lockdep */ |
361 | struct mutex bus_lock; | 344 | struct mutex bus_lock; |
362 | struct mutex clist_lock; | ||
363 | 345 | ||
364 | int timeout; /* in jiffies */ | 346 | int timeout; /* in jiffies */ |
365 | int retries; | 347 | int retries; |
366 | struct device dev; /* the adapter device */ | 348 | struct device dev; /* the adapter device */ |
367 | 349 | ||
368 | int nr; | 350 | int nr; |
369 | struct list_head clients; /* DEPRECATED */ | ||
370 | char name[48]; | 351 | char name[48]; |
371 | struct completion dev_released; | 352 | struct completion dev_released; |
372 | }; | 353 | }; |
@@ -412,11 +393,16 @@ struct i2c_client_address_data { | |||
412 | /* The numbers to use to set I2C bus address */ | 393 | /* The numbers to use to set I2C bus address */ |
413 | #define ANY_I2C_BUS 0xffff | 394 | #define ANY_I2C_BUS 0xffff |
414 | 395 | ||
396 | /* Construct an I2C_CLIENT_END-terminated array of i2c addresses */ | ||
397 | #define I2C_ADDRS(addr, addrs...) \ | ||
398 | ((const unsigned short []){ addr, ## addrs, I2C_CLIENT_END }) | ||
399 | |||
415 | 400 | ||
416 | /* ----- functions exported by i2c.o */ | 401 | /* ----- functions exported by i2c.o */ |
417 | 402 | ||
418 | /* administration... | 403 | /* administration... |
419 | */ | 404 | */ |
405 | #if defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE) | ||
420 | extern int i2c_add_adapter(struct i2c_adapter *); | 406 | extern int i2c_add_adapter(struct i2c_adapter *); |
421 | extern int i2c_del_adapter(struct i2c_adapter *); | 407 | extern int i2c_del_adapter(struct i2c_adapter *); |
422 | extern int i2c_add_numbered_adapter(struct i2c_adapter *); | 408 | extern int i2c_add_numbered_adapter(struct i2c_adapter *); |
@@ -429,11 +415,6 @@ static inline int i2c_add_driver(struct i2c_driver *driver) | |||
429 | return i2c_register_driver(THIS_MODULE, driver); | 415 | return i2c_register_driver(THIS_MODULE, driver); |
430 | } | 416 | } |
431 | 417 | ||
432 | /* These are deprecated, your driver should use the standard .probe() | ||
433 | * and .remove() methods instead. */ | ||
434 | extern int __deprecated i2c_attach_client(struct i2c_client *); | ||
435 | extern int __deprecated i2c_detach_client(struct i2c_client *); | ||
436 | |||
437 | extern struct i2c_client *i2c_use_client(struct i2c_client *client); | 418 | extern struct i2c_client *i2c_use_client(struct i2c_client *client); |
438 | extern void i2c_release_client(struct i2c_client *client); | 419 | extern void i2c_release_client(struct i2c_client *client); |
439 | 420 | ||
@@ -442,14 +423,6 @@ extern void i2c_release_client(struct i2c_client *client); | |||
442 | extern void i2c_clients_command(struct i2c_adapter *adap, | 423 | extern void i2c_clients_command(struct i2c_adapter *adap, |
443 | unsigned int cmd, void *arg); | 424 | unsigned int cmd, void *arg); |
444 | 425 | ||
445 | /* Detect function. It iterates over all possible addresses itself. | ||
446 | * It will only call found_proc if some client is connected at the | ||
447 | * specific address (unless a 'force' matched); | ||
448 | */ | ||
449 | extern int i2c_probe(struct i2c_adapter *adapter, | ||
450 | const struct i2c_client_address_data *address_data, | ||
451 | int (*found_proc) (struct i2c_adapter *, int, int)); | ||
452 | |||
453 | extern struct i2c_adapter *i2c_get_adapter(int id); | 426 | extern struct i2c_adapter *i2c_get_adapter(int id); |
454 | extern void i2c_put_adapter(struct i2c_adapter *adap); | 427 | extern void i2c_put_adapter(struct i2c_adapter *adap); |
455 | 428 | ||
@@ -471,6 +444,7 @@ static inline int i2c_adapter_id(struct i2c_adapter *adap) | |||
471 | { | 444 | { |
472 | return adap->nr; | 445 | return adap->nr; |
473 | } | 446 | } |
447 | #endif /* I2C */ | ||
474 | #endif /* __KERNEL__ */ | 448 | #endif /* __KERNEL__ */ |
475 | 449 | ||
476 | /** | 450 | /** |
diff --git a/include/linux/i2c/lm8323.h b/include/linux/i2c/lm8323.h new file mode 100644 index 000000000000..478d668bc590 --- /dev/null +++ b/include/linux/i2c/lm8323.h | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * lm8323.h - Configuration for LM8323 keypad driver. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation (version 2 of the License only). | ||
7 | * | ||
8 | * This program is distributed in the hope that it will be useful, | ||
9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
11 | * GNU General Public License for more details. | ||
12 | * | ||
13 | * You should have received a copy of the GNU General Public License | ||
14 | * along with this program; if not, write to the Free Software | ||
15 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
16 | */ | ||
17 | |||
18 | #ifndef __LINUX_LM8323_H | ||
19 | #define __LINUX_LM8323_H | ||
20 | |||
21 | #include <linux/types.h> | ||
22 | |||
23 | /* | ||
24 | * Largest keycode that the chip can send, plus one, | ||
25 | * so keys can be mapped directly at the index of the | ||
26 | * LM8323 keycode instead of subtracting one. | ||
27 | */ | ||
28 | #define LM8323_KEYMAP_SIZE (0x7f + 1) | ||
29 | |||
30 | #define LM8323_NUM_PWMS 3 | ||
31 | |||
32 | struct lm8323_platform_data { | ||
33 | int debounce_time; /* Time to watch for key bouncing, in ms. */ | ||
34 | int active_time; /* Idle time until sleep, in ms. */ | ||
35 | |||
36 | int size_x; | ||
37 | int size_y; | ||
38 | bool repeat; | ||
39 | const unsigned short *keymap; | ||
40 | |||
41 | const char *pwm_names[LM8323_NUM_PWMS]; | ||
42 | |||
43 | const char *name; /* Device name. */ | ||
44 | }; | ||
45 | |||
46 | #endif /* __LINUX_LM8323_H */ | ||
diff --git a/include/linux/i2c/pca953x.h b/include/linux/i2c/pca953x.h index 3c7361217df8..81736d6a8db7 100644 --- a/include/linux/i2c/pca953x.h +++ b/include/linux/i2c/pca953x.h | |||
@@ -15,4 +15,5 @@ struct pca953x_platform_data { | |||
15 | int (*teardown)(struct i2c_client *client, | 15 | int (*teardown)(struct i2c_client *client, |
16 | unsigned gpio, unsigned ngpio, | 16 | unsigned gpio, unsigned ngpio, |
17 | void *context); | 17 | void *context); |
18 | char **names; | ||
18 | }; | 19 | }; |
diff --git a/include/linux/icmpv6.h b/include/linux/icmpv6.h index 10d701eec484..b6a85183c333 100644 --- a/include/linux/icmpv6.h +++ b/include/linux/icmpv6.h | |||
@@ -175,16 +175,16 @@ struct icmp6_filter { | |||
175 | 175 | ||
176 | 176 | ||
177 | extern void icmpv6_send(struct sk_buff *skb, | 177 | extern void icmpv6_send(struct sk_buff *skb, |
178 | int type, int code, | 178 | u8 type, u8 code, |
179 | __u32 info, | 179 | __u32 info, |
180 | struct net_device *dev); | 180 | struct net_device *dev); |
181 | 181 | ||
182 | extern int icmpv6_init(void); | 182 | extern int icmpv6_init(void); |
183 | extern int icmpv6_err_convert(int type, int code, | 183 | extern int icmpv6_err_convert(u8 type, u8 code, |
184 | int *err); | 184 | int *err); |
185 | extern void icmpv6_cleanup(void); | 185 | extern void icmpv6_cleanup(void); |
186 | extern void icmpv6_param_prob(struct sk_buff *skb, | 186 | extern void icmpv6_param_prob(struct sk_buff *skb, |
187 | int code, int pos); | 187 | u8 code, int pos); |
188 | 188 | ||
189 | struct flowi; | 189 | struct flowi; |
190 | struct in6_addr; | 190 | struct in6_addr; |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 867cb68d8461..edc93a6d931d 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -157,12 +157,6 @@ enum { | |||
157 | #define REQ_UNPARK_HEADS 0x23 | 157 | #define REQ_UNPARK_HEADS 0x23 |
158 | 158 | ||
159 | /* | 159 | /* |
160 | * Check for an interrupt and acknowledge the interrupt status | ||
161 | */ | ||
162 | struct hwif_s; | ||
163 | typedef int (ide_ack_intr_t)(struct hwif_s *); | ||
164 | |||
165 | /* | ||
166 | * hwif_chipset_t is used to keep track of the specific hardware | 160 | * hwif_chipset_t is used to keep track of the specific hardware |
167 | * chipset used by each IDE interface, if known. | 161 | * chipset used by each IDE interface, if known. |
168 | */ | 162 | */ |
@@ -178,20 +172,18 @@ typedef u8 hwif_chipset_t; | |||
178 | /* | 172 | /* |
179 | * Structure to hold all information about the location of this port | 173 | * Structure to hold all information about the location of this port |
180 | */ | 174 | */ |
181 | typedef struct hw_regs_s { | 175 | struct ide_hw { |
182 | union { | 176 | union { |
183 | struct ide_io_ports io_ports; | 177 | struct ide_io_ports io_ports; |
184 | unsigned long io_ports_array[IDE_NR_PORTS]; | 178 | unsigned long io_ports_array[IDE_NR_PORTS]; |
185 | }; | 179 | }; |
186 | 180 | ||
187 | int irq; /* our irq number */ | 181 | int irq; /* our irq number */ |
188 | ide_ack_intr_t *ack_intr; /* acknowledge interrupt */ | ||
189 | hwif_chipset_t chipset; | ||
190 | struct device *dev, *parent; | 182 | struct device *dev, *parent; |
191 | unsigned long config; | 183 | unsigned long config; |
192 | } hw_regs_t; | 184 | }; |
193 | 185 | ||
194 | static inline void ide_std_init_ports(hw_regs_t *hw, | 186 | static inline void ide_std_init_ports(struct ide_hw *hw, |
195 | unsigned long io_addr, | 187 | unsigned long io_addr, |
196 | unsigned long ctl_addr) | 188 | unsigned long ctl_addr) |
197 | { | 189 | { |
@@ -218,21 +210,12 @@ static inline void ide_std_init_ports(hw_regs_t *hw, | |||
218 | 210 | ||
219 | /* | 211 | /* |
220 | * Special Driver Flags | 212 | * Special Driver Flags |
221 | * | ||
222 | * set_geometry : respecify drive geometry | ||
223 | * recalibrate : seek to cyl 0 | ||
224 | * set_multmode : set multmode count | ||
225 | * reserved : unused | ||
226 | */ | 213 | */ |
227 | typedef union { | 214 | enum { |
228 | unsigned all : 8; | 215 | IDE_SFLAG_SET_GEOMETRY = (1 << 0), |
229 | struct { | 216 | IDE_SFLAG_RECALIBRATE = (1 << 1), |
230 | unsigned set_geometry : 1; | 217 | IDE_SFLAG_SET_MULTMODE = (1 << 2), |
231 | unsigned recalibrate : 1; | 218 | }; |
232 | unsigned set_multmode : 1; | ||
233 | unsigned reserved : 5; | ||
234 | } b; | ||
235 | } special_t; | ||
236 | 219 | ||
237 | /* | 220 | /* |
238 | * Status returned from various ide_ functions | 221 | * Status returned from various ide_ functions |
@@ -341,11 +324,6 @@ enum { | |||
341 | PC_FLAG_WRITING = (1 << 6), | 324 | PC_FLAG_WRITING = (1 << 6), |
342 | }; | 325 | }; |
343 | 326 | ||
344 | /* | ||
345 | * With each packet command, we allocate a buffer of IDE_PC_BUFFER_SIZE bytes. | ||
346 | * This is used for several packet commands (not for READ/WRITE commands). | ||
347 | */ | ||
348 | #define IDE_PC_BUFFER_SIZE 64 | ||
349 | #define ATAPI_WAIT_PC (60 * HZ) | 327 | #define ATAPI_WAIT_PC (60 * HZ) |
350 | 328 | ||
351 | struct ide_atapi_pc { | 329 | struct ide_atapi_pc { |
@@ -357,12 +335,6 @@ struct ide_atapi_pc { | |||
357 | 335 | ||
358 | /* bytes to transfer */ | 336 | /* bytes to transfer */ |
359 | int req_xfer; | 337 | int req_xfer; |
360 | /* bytes actually transferred */ | ||
361 | int xferred; | ||
362 | |||
363 | /* data buffer */ | ||
364 | u8 *buf; | ||
365 | int buf_size; | ||
366 | 338 | ||
367 | /* the corresponding request */ | 339 | /* the corresponding request */ |
368 | struct request *rq; | 340 | struct request *rq; |
@@ -373,8 +345,6 @@ struct ide_atapi_pc { | |||
373 | * those are more or less driver-specific and some of them are subject | 345 | * those are more or less driver-specific and some of them are subject |
374 | * to change/removal later. | 346 | * to change/removal later. |
375 | */ | 347 | */ |
376 | u8 pc_buf[IDE_PC_BUFFER_SIZE]; | ||
377 | |||
378 | unsigned long timeout; | 348 | unsigned long timeout; |
379 | }; | 349 | }; |
380 | 350 | ||
@@ -391,6 +361,7 @@ struct ide_drive_s; | |||
391 | struct ide_disk_ops { | 361 | struct ide_disk_ops { |
392 | int (*check)(struct ide_drive_s *, const char *); | 362 | int (*check)(struct ide_drive_s *, const char *); |
393 | int (*get_capacity)(struct ide_drive_s *); | 363 | int (*get_capacity)(struct ide_drive_s *); |
364 | u64 (*set_capacity)(struct ide_drive_s *, u64); | ||
394 | void (*setup)(struct ide_drive_s *); | 365 | void (*setup)(struct ide_drive_s *); |
395 | void (*flush)(struct ide_drive_s *); | 366 | void (*flush)(struct ide_drive_s *); |
396 | int (*init_media)(struct ide_drive_s *, struct gendisk *); | 367 | int (*init_media)(struct ide_drive_s *, struct gendisk *); |
@@ -468,6 +439,8 @@ enum { | |||
468 | IDE_DFLAG_NICE1 = (1 << 5), | 439 | IDE_DFLAG_NICE1 = (1 << 5), |
469 | /* device is physically present */ | 440 | /* device is physically present */ |
470 | IDE_DFLAG_PRESENT = (1 << 6), | 441 | IDE_DFLAG_PRESENT = (1 << 6), |
442 | /* disable Host Protected Area */ | ||
443 | IDE_DFLAG_NOHPA = (1 << 7), | ||
471 | /* id read from device (synthetic if not set) */ | 444 | /* id read from device (synthetic if not set) */ |
472 | IDE_DFLAG_ID_READ = (1 << 8), | 445 | IDE_DFLAG_ID_READ = (1 << 8), |
473 | IDE_DFLAG_NOPROBE = (1 << 9), | 446 | IDE_DFLAG_NOPROBE = (1 << 9), |
@@ -506,6 +479,7 @@ enum { | |||
506 | /* write protect */ | 479 | /* write protect */ |
507 | IDE_DFLAG_WP = (1 << 29), | 480 | IDE_DFLAG_WP = (1 << 29), |
508 | IDE_DFLAG_FORMAT_IN_PROGRESS = (1 << 30), | 481 | IDE_DFLAG_FORMAT_IN_PROGRESS = (1 << 30), |
482 | IDE_DFLAG_NIEN_QUIRK = (1 << 31), | ||
509 | }; | 483 | }; |
510 | 484 | ||
511 | struct ide_drive_s { | 485 | struct ide_drive_s { |
@@ -530,14 +504,13 @@ struct ide_drive_s { | |||
530 | unsigned long sleep; /* sleep until this time */ | 504 | unsigned long sleep; /* sleep until this time */ |
531 | unsigned long timeout; /* max time to wait for irq */ | 505 | unsigned long timeout; /* max time to wait for irq */ |
532 | 506 | ||
533 | special_t special; /* special action flags */ | 507 | u8 special_flags; /* special action flags */ |
534 | 508 | ||
535 | u8 select; /* basic drive/head select reg value */ | 509 | u8 select; /* basic drive/head select reg value */ |
536 | u8 retry_pio; /* retrying dma capable host in pio */ | 510 | u8 retry_pio; /* retrying dma capable host in pio */ |
537 | u8 waiting_for_dma; /* dma currently in progress */ | 511 | u8 waiting_for_dma; /* dma currently in progress */ |
538 | u8 dma; /* atapi dma flag */ | 512 | u8 dma; /* atapi dma flag */ |
539 | 513 | ||
540 | u8 quirk_list; /* considered quirky, set for a specific host */ | ||
541 | u8 init_speed; /* transfer rate set at boot */ | 514 | u8 init_speed; /* transfer rate set at boot */ |
542 | u8 current_speed; /* current transfer rate set */ | 515 | u8 current_speed; /* current transfer rate set */ |
543 | u8 desired_speed; /* desired transfer rate set */ | 516 | u8 desired_speed; /* desired transfer rate set */ |
@@ -559,11 +532,10 @@ struct ide_drive_s { | |||
559 | 532 | ||
560 | unsigned int bios_cyl; /* BIOS/fdisk/LILO number of cyls */ | 533 | unsigned int bios_cyl; /* BIOS/fdisk/LILO number of cyls */ |
561 | unsigned int cyl; /* "real" number of cyls */ | 534 | unsigned int cyl; /* "real" number of cyls */ |
562 | unsigned int drive_data; /* used by set_pio_mode/dev_select() */ | 535 | void *drive_data; /* used by set_pio_mode/dev_select() */ |
563 | unsigned int failures; /* current failure count */ | 536 | unsigned int failures; /* current failure count */ |
564 | unsigned int max_failures; /* maximum allowed failure count */ | 537 | unsigned int max_failures; /* maximum allowed failure count */ |
565 | u64 probed_capacity;/* initial reported media capacity (ide-cd only currently) */ | 538 | u64 probed_capacity;/* initial/native media capacity */ |
566 | |||
567 | u64 capacity64; /* total number of sectors */ | 539 | u64 capacity64; /* total number of sectors */ |
568 | 540 | ||
569 | int lun; /* logical unit */ | 541 | int lun; /* logical unit */ |
@@ -657,6 +629,7 @@ struct ide_port_ops { | |||
657 | void (*maskproc)(ide_drive_t *, int); | 629 | void (*maskproc)(ide_drive_t *, int); |
658 | void (*quirkproc)(ide_drive_t *); | 630 | void (*quirkproc)(ide_drive_t *); |
659 | void (*clear_irq)(ide_drive_t *); | 631 | void (*clear_irq)(ide_drive_t *); |
632 | int (*test_irq)(struct hwif_s *); | ||
660 | 633 | ||
661 | u8 (*mdma_filter)(ide_drive_t *); | 634 | u8 (*mdma_filter)(ide_drive_t *); |
662 | u8 (*udma_filter)(ide_drive_t *); | 635 | u8 (*udma_filter)(ide_drive_t *); |
@@ -682,6 +655,10 @@ struct ide_dma_ops { | |||
682 | u8 (*dma_sff_read_status)(struct hwif_s *); | 655 | u8 (*dma_sff_read_status)(struct hwif_s *); |
683 | }; | 656 | }; |
684 | 657 | ||
658 | enum { | ||
659 | IDE_PFLAG_PROBING = (1 << 0), | ||
660 | }; | ||
661 | |||
685 | struct ide_host; | 662 | struct ide_host; |
686 | 663 | ||
687 | typedef struct hwif_s { | 664 | typedef struct hwif_s { |
@@ -698,6 +675,8 @@ typedef struct hwif_s { | |||
698 | 675 | ||
699 | ide_drive_t *devices[MAX_DRIVES + 1]; | 676 | ide_drive_t *devices[MAX_DRIVES + 1]; |
700 | 677 | ||
678 | unsigned long port_flags; | ||
679 | |||
701 | u8 major; /* our major number */ | 680 | u8 major; /* our major number */ |
702 | u8 index; /* 0 for ide0; 1 for ide1; ... */ | 681 | u8 index; /* 0 for ide0; 1 for ide1; ... */ |
703 | u8 channel; /* for dual-port chips: 0=primary, 1=secondary */ | 682 | u8 channel; /* for dual-port chips: 0=primary, 1=secondary */ |
@@ -716,8 +695,6 @@ typedef struct hwif_s { | |||
716 | 695 | ||
717 | struct device *dev; | 696 | struct device *dev; |
718 | 697 | ||
719 | ide_ack_intr_t *ack_intr; | ||
720 | |||
721 | void (*rw_disk)(ide_drive_t *, struct request *); | 698 | void (*rw_disk)(ide_drive_t *, struct request *); |
722 | 699 | ||
723 | const struct ide_tp_ops *tp_ops; | 700 | const struct ide_tp_ops *tp_ops; |
@@ -1085,7 +1062,6 @@ int generic_ide_ioctl(ide_drive_t *, struct block_device *, unsigned, unsigned l | |||
1085 | extern int ide_vlb_clk; | 1062 | extern int ide_vlb_clk; |
1086 | extern int ide_pci_clk; | 1063 | extern int ide_pci_clk; |
1087 | 1064 | ||
1088 | unsigned int ide_rq_bytes(struct request *); | ||
1089 | int ide_end_rq(ide_drive_t *, struct request *, int, unsigned int); | 1065 | int ide_end_rq(ide_drive_t *, struct request *, int, unsigned int); |
1090 | void ide_kill_rq(ide_drive_t *, struct request *); | 1066 | void ide_kill_rq(ide_drive_t *, struct request *); |
1091 | 1067 | ||
@@ -1138,6 +1114,8 @@ void SELECT_MASK(ide_drive_t *, int); | |||
1138 | u8 ide_read_error(ide_drive_t *); | 1114 | u8 ide_read_error(ide_drive_t *); |
1139 | void ide_read_bcount_and_ireason(ide_drive_t *, u16 *, u8 *); | 1115 | void ide_read_bcount_and_ireason(ide_drive_t *, u16 *, u8 *); |
1140 | 1116 | ||
1117 | int ide_check_ireason(ide_drive_t *, struct request *, int, int, int); | ||
1118 | |||
1141 | int ide_check_atapi_device(ide_drive_t *, const char *); | 1119 | int ide_check_atapi_device(ide_drive_t *, const char *); |
1142 | 1120 | ||
1143 | void ide_init_pc(struct ide_atapi_pc *); | 1121 | void ide_init_pc(struct ide_atapi_pc *); |
@@ -1162,7 +1140,8 @@ enum { | |||
1162 | REQ_IDETAPE_WRITE = (1 << 3), | 1140 | REQ_IDETAPE_WRITE = (1 << 3), |
1163 | }; | 1141 | }; |
1164 | 1142 | ||
1165 | int ide_queue_pc_tail(ide_drive_t *, struct gendisk *, struct ide_atapi_pc *); | 1143 | int ide_queue_pc_tail(ide_drive_t *, struct gendisk *, struct ide_atapi_pc *, |
1144 | void *, unsigned int); | ||
1166 | 1145 | ||
1167 | int ide_do_test_unit_ready(ide_drive_t *, struct gendisk *); | 1146 | int ide_do_test_unit_ready(ide_drive_t *, struct gendisk *); |
1168 | int ide_do_start_stop(ide_drive_t *, struct gendisk *, int); | 1147 | int ide_do_start_stop(ide_drive_t *, struct gendisk *, int); |
@@ -1222,7 +1201,7 @@ static inline int ide_pci_is_in_compatibility_mode(struct pci_dev *dev) | |||
1222 | } | 1201 | } |
1223 | 1202 | ||
1224 | void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, | 1203 | void ide_pci_setup_ports(struct pci_dev *, const struct ide_port_info *, |
1225 | hw_regs_t *, hw_regs_t **); | 1204 | struct ide_hw *, struct ide_hw **); |
1226 | void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); | 1205 | void ide_setup_pci_noise(struct pci_dev *, const struct ide_port_info *); |
1227 | 1206 | ||
1228 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI | 1207 | #ifdef CONFIG_BLK_DEV_IDEDMA_PCI |
@@ -1381,7 +1360,6 @@ int ide_in_drive_list(u16 *, const struct drive_list_entry *); | |||
1381 | #ifdef CONFIG_BLK_DEV_IDEDMA | 1360 | #ifdef CONFIG_BLK_DEV_IDEDMA |
1382 | int ide_dma_good_drive(ide_drive_t *); | 1361 | int ide_dma_good_drive(ide_drive_t *); |
1383 | int __ide_dma_bad_drive(ide_drive_t *); | 1362 | int __ide_dma_bad_drive(ide_drive_t *); |
1384 | int ide_id_dma_bug(ide_drive_t *); | ||
1385 | 1363 | ||
1386 | u8 ide_find_dma_mode(ide_drive_t *, u8); | 1364 | u8 ide_find_dma_mode(ide_drive_t *, u8); |
1387 | 1365 | ||
@@ -1422,7 +1400,6 @@ void ide_dma_lost_irq(ide_drive_t *); | |||
1422 | ide_startstop_t ide_dma_timeout_retry(ide_drive_t *, int); | 1400 | ide_startstop_t ide_dma_timeout_retry(ide_drive_t *, int); |
1423 | 1401 | ||
1424 | #else | 1402 | #else |
1425 | static inline int ide_id_dma_bug(ide_drive_t *drive) { return 0; } | ||
1426 | static inline u8 ide_find_dma_mode(ide_drive_t *drive, u8 speed) { return 0; } | 1403 | static inline u8 ide_find_dma_mode(ide_drive_t *drive, u8 speed) { return 0; } |
1427 | static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; } | 1404 | static inline u8 ide_max_dma_mode(ide_drive_t *drive) { return 0; } |
1428 | static inline void ide_dma_off_quietly(ide_drive_t *drive) { ; } | 1405 | static inline void ide_dma_off_quietly(ide_drive_t *drive) { ; } |
@@ -1442,6 +1419,7 @@ static inline void ide_dma_unmap_sg(ide_drive_t *drive, | |||
1442 | 1419 | ||
1443 | #ifdef CONFIG_BLK_DEV_IDEACPI | 1420 | #ifdef CONFIG_BLK_DEV_IDEACPI |
1444 | int ide_acpi_init(void); | 1421 | int ide_acpi_init(void); |
1422 | bool ide_port_acpi(ide_hwif_t *hwif); | ||
1445 | extern int ide_acpi_exec_tfs(ide_drive_t *drive); | 1423 | extern int ide_acpi_exec_tfs(ide_drive_t *drive); |
1446 | extern void ide_acpi_get_timing(ide_hwif_t *hwif); | 1424 | extern void ide_acpi_get_timing(ide_hwif_t *hwif); |
1447 | extern void ide_acpi_push_timing(ide_hwif_t *hwif); | 1425 | extern void ide_acpi_push_timing(ide_hwif_t *hwif); |
@@ -1450,6 +1428,7 @@ void ide_acpi_port_init_devices(ide_hwif_t *); | |||
1450 | extern void ide_acpi_set_state(ide_hwif_t *hwif, int on); | 1428 | extern void ide_acpi_set_state(ide_hwif_t *hwif, int on); |
1451 | #else | 1429 | #else |
1452 | static inline int ide_acpi_init(void) { return 0; } | 1430 | static inline int ide_acpi_init(void) { return 0; } |
1431 | static inline bool ide_port_acpi(ide_hwif_t *hwif) { return 0; } | ||
1453 | static inline int ide_acpi_exec_tfs(ide_drive_t *drive) { return 0; } | 1432 | static inline int ide_acpi_exec_tfs(ide_drive_t *drive) { return 0; } |
1454 | static inline void ide_acpi_get_timing(ide_hwif_t *hwif) { ; } | 1433 | static inline void ide_acpi_get_timing(ide_hwif_t *hwif) { ; } |
1455 | static inline void ide_acpi_push_timing(ide_hwif_t *hwif) { ; } | 1434 | static inline void ide_acpi_push_timing(ide_hwif_t *hwif) { ; } |
@@ -1461,16 +1440,18 @@ static inline void ide_acpi_set_state(ide_hwif_t *hwif, int on) {} | |||
1461 | void ide_register_region(struct gendisk *); | 1440 | void ide_register_region(struct gendisk *); |
1462 | void ide_unregister_region(struct gendisk *); | 1441 | void ide_unregister_region(struct gendisk *); |
1463 | 1442 | ||
1443 | void ide_check_nien_quirk_list(ide_drive_t *); | ||
1464 | void ide_undecoded_slave(ide_drive_t *); | 1444 | void ide_undecoded_slave(ide_drive_t *); |
1465 | 1445 | ||
1466 | void ide_port_apply_params(ide_hwif_t *); | 1446 | void ide_port_apply_params(ide_hwif_t *); |
1467 | int ide_sysfs_register_port(ide_hwif_t *); | 1447 | int ide_sysfs_register_port(ide_hwif_t *); |
1468 | 1448 | ||
1469 | struct ide_host *ide_host_alloc(const struct ide_port_info *, hw_regs_t **); | 1449 | struct ide_host *ide_host_alloc(const struct ide_port_info *, struct ide_hw **, |
1450 | unsigned int); | ||
1470 | void ide_host_free(struct ide_host *); | 1451 | void ide_host_free(struct ide_host *); |
1471 | int ide_host_register(struct ide_host *, const struct ide_port_info *, | 1452 | int ide_host_register(struct ide_host *, const struct ide_port_info *, |
1472 | hw_regs_t **); | 1453 | struct ide_hw **); |
1473 | int ide_host_add(const struct ide_port_info *, hw_regs_t **, | 1454 | int ide_host_add(const struct ide_port_info *, struct ide_hw **, unsigned int, |
1474 | struct ide_host **); | 1455 | struct ide_host **); |
1475 | void ide_host_remove(struct ide_host *); | 1456 | void ide_host_remove(struct ide_host *); |
1476 | int ide_legacy_device_add(const struct ide_port_info *, unsigned long); | 1457 | int ide_legacy_device_add(const struct ide_port_info *, unsigned long); |
@@ -1530,6 +1511,7 @@ int ide_timing_compute(ide_drive_t *, u8, struct ide_timing *, int, int); | |||
1530 | int ide_scan_pio_blacklist(char *); | 1511 | int ide_scan_pio_blacklist(char *); |
1531 | const char *ide_xfer_verbose(u8); | 1512 | const char *ide_xfer_verbose(u8); |
1532 | u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8); | 1513 | u8 ide_get_best_pio_mode(ide_drive_t *, u8, u8); |
1514 | int ide_pio_need_iordy(ide_drive_t *, const u8); | ||
1533 | int ide_set_pio_mode(ide_drive_t *, u8); | 1515 | int ide_set_pio_mode(ide_drive_t *, u8); |
1534 | int ide_set_dma_mode(ide_drive_t *, u8); | 1516 | int ide_set_dma_mode(ide_drive_t *, u8); |
1535 | void ide_set_pio(ide_drive_t *, u8); | 1517 | void ide_set_pio(ide_drive_t *, u8); |
@@ -1567,6 +1549,16 @@ static inline ide_drive_t *ide_get_pair_dev(ide_drive_t *drive) | |||
1567 | return (peer->dev_flags & IDE_DFLAG_PRESENT) ? peer : NULL; | 1549 | return (peer->dev_flags & IDE_DFLAG_PRESENT) ? peer : NULL; |
1568 | } | 1550 | } |
1569 | 1551 | ||
1552 | static inline void *ide_get_drivedata(ide_drive_t *drive) | ||
1553 | { | ||
1554 | return drive->drive_data; | ||
1555 | } | ||
1556 | |||
1557 | static inline void ide_set_drivedata(ide_drive_t *drive, void *data) | ||
1558 | { | ||
1559 | drive->drive_data = data; | ||
1560 | } | ||
1561 | |||
1570 | #define ide_port_for_each_dev(i, dev, port) \ | 1562 | #define ide_port_for_each_dev(i, dev, port) \ |
1571 | for ((i) = 0; ((dev) = (port)->devices[i]) || (i) < MAX_DRIVES; (i)++) | 1563 | for ((i) = 0; ((dev) = (port)->devices[i]) || (i) < MAX_DRIVES; (i)++) |
1572 | 1564 | ||
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 4b501b48ce86..a9173d5434d1 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -493,6 +493,7 @@ struct ieee80211s_hdr { | |||
493 | /* Mesh flags */ | 493 | /* Mesh flags */ |
494 | #define MESH_FLAGS_AE_A4 0x1 | 494 | #define MESH_FLAGS_AE_A4 0x1 |
495 | #define MESH_FLAGS_AE_A5_A6 0x2 | 495 | #define MESH_FLAGS_AE_A5_A6 0x2 |
496 | #define MESH_FLAGS_AE 0x3 | ||
496 | #define MESH_FLAGS_PS_DEEP 0x4 | 497 | #define MESH_FLAGS_PS_DEEP 0x4 |
497 | 498 | ||
498 | /** | 499 | /** |
@@ -540,10 +541,10 @@ struct ieee80211_tim_ie { | |||
540 | u8 dtim_period; | 541 | u8 dtim_period; |
541 | u8 bitmap_ctrl; | 542 | u8 bitmap_ctrl; |
542 | /* variable size: 1 - 251 bytes */ | 543 | /* variable size: 1 - 251 bytes */ |
543 | u8 virtual_map[0]; | 544 | u8 virtual_map[1]; |
544 | } __attribute__ ((packed)); | 545 | } __attribute__ ((packed)); |
545 | 546 | ||
546 | #define WLAN_SA_QUERY_TR_ID_LEN 16 | 547 | #define WLAN_SA_QUERY_TR_ID_LEN 2 |
547 | 548 | ||
548 | struct ieee80211_mgmt { | 549 | struct ieee80211_mgmt { |
549 | __le16 frame_control; | 550 | __le16 frame_control; |
@@ -1068,8 +1069,12 @@ enum ieee80211_category { | |||
1068 | WLAN_CATEGORY_DLS = 2, | 1069 | WLAN_CATEGORY_DLS = 2, |
1069 | WLAN_CATEGORY_BACK = 3, | 1070 | WLAN_CATEGORY_BACK = 3, |
1070 | WLAN_CATEGORY_PUBLIC = 4, | 1071 | WLAN_CATEGORY_PUBLIC = 4, |
1072 | WLAN_CATEGORY_HT = 7, | ||
1071 | WLAN_CATEGORY_SA_QUERY = 8, | 1073 | WLAN_CATEGORY_SA_QUERY = 8, |
1074 | WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION = 9, | ||
1072 | WLAN_CATEGORY_WMM = 17, | 1075 | WLAN_CATEGORY_WMM = 17, |
1076 | WLAN_CATEGORY_VENDOR_SPECIFIC_PROTECTED = 126, | ||
1077 | WLAN_CATEGORY_VENDOR_SPECIFIC = 127, | ||
1073 | }; | 1078 | }; |
1074 | 1079 | ||
1075 | /* SPECTRUM_MGMT action code */ | 1080 | /* SPECTRUM_MGMT action code */ |
@@ -1081,6 +1086,15 @@ enum ieee80211_spectrum_mgmt_actioncode { | |||
1081 | WLAN_ACTION_SPCT_CHL_SWITCH = 4, | 1086 | WLAN_ACTION_SPCT_CHL_SWITCH = 4, |
1082 | }; | 1087 | }; |
1083 | 1088 | ||
1089 | /* Security key length */ | ||
1090 | enum ieee80211_key_len { | ||
1091 | WLAN_KEY_LEN_WEP40 = 5, | ||
1092 | WLAN_KEY_LEN_WEP104 = 13, | ||
1093 | WLAN_KEY_LEN_CCMP = 16, | ||
1094 | WLAN_KEY_LEN_TKIP = 32, | ||
1095 | WLAN_KEY_LEN_AES_CMAC = 16, | ||
1096 | }; | ||
1097 | |||
1084 | /* | 1098 | /* |
1085 | * IEEE 802.11-2007 7.3.2.9 Country information element | 1099 | * IEEE 802.11-2007 7.3.2.9 Country information element |
1086 | * | 1100 | * |
@@ -1261,7 +1275,9 @@ static inline bool ieee80211_is_robust_mgmt_frame(struct ieee80211_hdr *hdr) | |||
1261 | if (ieee80211_has_protected(hdr->frame_control)) | 1275 | if (ieee80211_has_protected(hdr->frame_control)) |
1262 | return true; | 1276 | return true; |
1263 | category = ((u8 *) hdr) + 24; | 1277 | category = ((u8 *) hdr) + 24; |
1264 | return *category != WLAN_CATEGORY_PUBLIC; | 1278 | return *category != WLAN_CATEGORY_PUBLIC && |
1279 | *category != WLAN_CATEGORY_HT && | ||
1280 | *category != WLAN_CATEGORY_VENDOR_SPECIFIC; | ||
1265 | } | 1281 | } |
1266 | 1282 | ||
1267 | return false; | 1283 | return false; |
@@ -1383,4 +1399,43 @@ static inline int ieee80211_freq_to_ofdm_chan(int s_freq, int freq) | |||
1383 | return -1; | 1399 | return -1; |
1384 | } | 1400 | } |
1385 | 1401 | ||
1402 | /** | ||
1403 | * ieee80211_tu_to_usec - convert time units (TU) to microseconds | ||
1404 | * @tu: the TUs | ||
1405 | */ | ||
1406 | static inline unsigned long ieee80211_tu_to_usec(unsigned long tu) | ||
1407 | { | ||
1408 | return 1024 * tu; | ||
1409 | } | ||
1410 | |||
1411 | /** | ||
1412 | * ieee80211_check_tim - check if AID bit is set in TIM | ||
1413 | * @tim: the TIM IE | ||
1414 | * @tim_len: length of the TIM IE | ||
1415 | * @aid: the AID to look for | ||
1416 | */ | ||
1417 | static inline bool ieee80211_check_tim(struct ieee80211_tim_ie *tim, | ||
1418 | u8 tim_len, u16 aid) | ||
1419 | { | ||
1420 | u8 mask; | ||
1421 | u8 index, indexn1, indexn2; | ||
1422 | |||
1423 | if (unlikely(!tim || tim_len < sizeof(*tim))) | ||
1424 | return false; | ||
1425 | |||
1426 | aid &= 0x3fff; | ||
1427 | index = aid / 8; | ||
1428 | mask = 1 << (aid & 7); | ||
1429 | |||
1430 | indexn1 = tim->bitmap_ctrl & 0xfe; | ||
1431 | indexn2 = tim_len + indexn1 - 4; | ||
1432 | |||
1433 | if (index < indexn1 || index > indexn2) | ||
1434 | return false; | ||
1435 | |||
1436 | index -= indexn1; | ||
1437 | |||
1438 | return !!(tim->virtual_map[index] & mask); | ||
1439 | } | ||
1440 | |||
1386 | #endif /* LINUX_IEEE80211_H */ | 1441 | #endif /* LINUX_IEEE80211_H */ |
diff --git a/include/linux/if.h b/include/linux/if.h index 1108f3e099e3..b9a6229f3be7 100644 --- a/include/linux/if.h +++ b/include/linux/if.h | |||
@@ -67,6 +67,9 @@ | |||
67 | #define IFF_ISATAP 0x80 /* ISATAP interface (RFC4214) */ | 67 | #define IFF_ISATAP 0x80 /* ISATAP interface (RFC4214) */ |
68 | #define IFF_MASTER_ARPMON 0x100 /* bonding master, ARP mon in use */ | 68 | #define IFF_MASTER_ARPMON 0x100 /* bonding master, ARP mon in use */ |
69 | #define IFF_WAN_HDLC 0x200 /* WAN HDLC device */ | 69 | #define IFF_WAN_HDLC 0x200 /* WAN HDLC device */ |
70 | #define IFF_XMIT_DST_RELEASE 0x400 /* dev_hard_start_xmit() is allowed to | ||
71 | * release skb->dst | ||
72 | */ | ||
70 | 73 | ||
71 | #define IF_GET_IFACE 0x0001 /* for querying only */ | 74 | #define IF_GET_IFACE 0x0001 /* for querying only */ |
72 | #define IF_GET_PROTO 0x0002 | 75 | #define IF_GET_PROTO 0x0002 |
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h index 5ff89809a581..b554300ef8bf 100644 --- a/include/linux/if_arp.h +++ b/include/linux/if_arp.h | |||
@@ -86,6 +86,8 @@ | |||
86 | #define ARPHRD_IEEE80211 801 /* IEEE 802.11 */ | 86 | #define ARPHRD_IEEE80211 801 /* IEEE 802.11 */ |
87 | #define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */ | 87 | #define ARPHRD_IEEE80211_PRISM 802 /* IEEE 802.11 + Prism2 header */ |
88 | #define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */ | 88 | #define ARPHRD_IEEE80211_RADIOTAP 803 /* IEEE 802.11 + radiotap header */ |
89 | #define ARPHRD_IEEE802154 804 | ||
90 | #define ARPHRD_IEEE802154_PHY 805 | ||
89 | 91 | ||
90 | #define ARPHRD_PHONET 820 /* PhoNet media type */ | 92 | #define ARPHRD_PHONET 820 /* PhoNet media type */ |
91 | #define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */ | 93 | #define ARPHRD_PHONET_PIPE 821 /* PhoNet pipe header */ |
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index cfe4fe1b7132..70fdba2bbf71 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
@@ -78,7 +78,9 @@ | |||
78 | #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ | 78 | #define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ |
79 | #define ETH_P_AOE 0x88A2 /* ATA over Ethernet */ | 79 | #define ETH_P_AOE 0x88A2 /* ATA over Ethernet */ |
80 | #define ETH_P_TIPC 0x88CA /* TIPC */ | 80 | #define ETH_P_TIPC 0x88CA /* TIPC */ |
81 | #define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */ | ||
81 | #define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */ | 82 | #define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */ |
83 | #define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */ | ||
82 | #define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */ | 84 | #define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */ |
83 | 85 | ||
84 | /* | 86 | /* |
@@ -106,6 +108,7 @@ | |||
106 | #define ETH_P_DSA 0x001B /* Distributed Switch Arch. */ | 108 | #define ETH_P_DSA 0x001B /* Distributed Switch Arch. */ |
107 | #define ETH_P_TRAILER 0x001C /* Trailer switch tagging */ | 109 | #define ETH_P_TRAILER 0x001C /* Trailer switch tagging */ |
108 | #define ETH_P_PHONET 0x00F5 /* Nokia Phonet frames */ | 110 | #define ETH_P_PHONET 0x00F5 /* Nokia Phonet frames */ |
111 | #define ETH_P_IEEE802154 0x00F6 /* IEEE802.15.4 frame */ | ||
109 | 112 | ||
110 | /* | 113 | /* |
111 | * This is an Ethernet frame header. | 114 | * This is an Ethernet frame header. |
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h index 18db0668065a..dea7d6b7cf98 100644 --- a/include/linux/if_packet.h +++ b/include/linux/if_packet.h | |||
@@ -46,6 +46,8 @@ struct sockaddr_ll | |||
46 | #define PACKET_VERSION 10 | 46 | #define PACKET_VERSION 10 |
47 | #define PACKET_HDRLEN 11 | 47 | #define PACKET_HDRLEN 11 |
48 | #define PACKET_RESERVE 12 | 48 | #define PACKET_RESERVE 12 |
49 | #define PACKET_TX_RING 13 | ||
50 | #define PACKET_LOSS 14 | ||
49 | 51 | ||
50 | struct tpacket_stats | 52 | struct tpacket_stats |
51 | { | 53 | { |
@@ -63,14 +65,22 @@ struct tpacket_auxdata | |||
63 | __u16 tp_vlan_tci; | 65 | __u16 tp_vlan_tci; |
64 | }; | 66 | }; |
65 | 67 | ||
68 | /* Rx ring - header status */ | ||
69 | #define TP_STATUS_KERNEL 0x0 | ||
70 | #define TP_STATUS_USER 0x1 | ||
71 | #define TP_STATUS_COPY 0x2 | ||
72 | #define TP_STATUS_LOSING 0x4 | ||
73 | #define TP_STATUS_CSUMNOTREADY 0x8 | ||
74 | |||
75 | /* Tx ring - header status */ | ||
76 | #define TP_STATUS_AVAILABLE 0x0 | ||
77 | #define TP_STATUS_SEND_REQUEST 0x1 | ||
78 | #define TP_STATUS_SENDING 0x2 | ||
79 | #define TP_STATUS_WRONG_FORMAT 0x4 | ||
80 | |||
66 | struct tpacket_hdr | 81 | struct tpacket_hdr |
67 | { | 82 | { |
68 | unsigned long tp_status; | 83 | unsigned long tp_status; |
69 | #define TP_STATUS_KERNEL 0 | ||
70 | #define TP_STATUS_USER 1 | ||
71 | #define TP_STATUS_COPY 2 | ||
72 | #define TP_STATUS_LOSING 4 | ||
73 | #define TP_STATUS_CSUMNOTREADY 8 | ||
74 | unsigned int tp_len; | 84 | unsigned int tp_len; |
75 | unsigned int tp_snaplen; | 85 | unsigned int tp_snaplen; |
76 | unsigned short tp_mac; | 86 | unsigned short tp_mac; |
@@ -135,5 +145,6 @@ struct packet_mreq | |||
135 | #define PACKET_MR_MULTICAST 0 | 145 | #define PACKET_MR_MULTICAST 0 |
136 | #define PACKET_MR_PROMISC 1 | 146 | #define PACKET_MR_PROMISC 1 |
137 | #define PACKET_MR_ALLMULTI 2 | 147 | #define PACKET_MR_ALLMULTI 2 |
148 | #define PACKET_MR_UNICAST 3 | ||
138 | 149 | ||
139 | #endif | 150 | #endif |
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h index 049d6c9428db..915ba5789f0e 100644 --- a/include/linux/if_tun.h +++ b/include/linux/if_tun.h | |||
@@ -55,6 +55,7 @@ | |||
55 | #define IFF_NO_PI 0x1000 | 55 | #define IFF_NO_PI 0x1000 |
56 | #define IFF_ONE_QUEUE 0x2000 | 56 | #define IFF_ONE_QUEUE 0x2000 |
57 | #define IFF_VNET_HDR 0x4000 | 57 | #define IFF_VNET_HDR 0x4000 |
58 | #define IFF_TUN_EXCL 0x8000 | ||
58 | 59 | ||
59 | /* Features for GSO (TUNSETOFFLOAD). */ | 60 | /* Features for GSO (TUNSETOFFLOAD). */ |
60 | #define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */ | 61 | #define TUN_F_CSUM 0x01 /* You can hand me unchecksummed packets. */ |
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h index 5a9aae4adb44..5eb9b0f857e0 100644 --- a/include/linux/if_tunnel.h +++ b/include/linux/if_tunnel.h | |||
@@ -44,7 +44,7 @@ struct ip_tunnel_prl { | |||
44 | __u16 flags; | 44 | __u16 flags; |
45 | __u16 __reserved; | 45 | __u16 __reserved; |
46 | __u32 datalen; | 46 | __u32 datalen; |
47 | __u32 __reserved2; | 47 | __u32 rs_delay; |
48 | /* data follows */ | 48 | /* data follows */ |
49 | }; | 49 | }; |
50 | 50 | ||
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index e1ff5b14310e..7ff9af1d0f05 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -118,8 +118,7 @@ extern int vlan_hwaccel_do_receive(struct sk_buff *skb); | |||
118 | extern int vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, | 118 | extern int vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, |
119 | unsigned int vlan_tci, struct sk_buff *skb); | 119 | unsigned int vlan_tci, struct sk_buff *skb); |
120 | extern int vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp, | 120 | extern int vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp, |
121 | unsigned int vlan_tci, | 121 | unsigned int vlan_tci); |
122 | struct napi_gro_fraginfo *info); | ||
123 | 122 | ||
124 | #else | 123 | #else |
125 | static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev) | 124 | static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev) |
@@ -154,8 +153,7 @@ static inline int vlan_gro_receive(struct napi_struct *napi, | |||
154 | } | 153 | } |
155 | 154 | ||
156 | static inline int vlan_gro_frags(struct napi_struct *napi, | 155 | static inline int vlan_gro_frags(struct napi_struct *napi, |
157 | struct vlan_group *grp, unsigned int vlan_tci, | 156 | struct vlan_group *grp, unsigned int vlan_tci) |
158 | struct napi_gro_fraginfo *info) | ||
159 | { | 157 | { |
160 | return NET_RX_DROP; | 158 | return NET_RX_DROP; |
161 | } | 159 | } |
diff --git a/include/linux/ima.h b/include/linux/ima.h index b1b827d091a9..0e3f2a4c25f6 100644 --- a/include/linux/ima.h +++ b/include/linux/ima.h | |||
@@ -24,6 +24,7 @@ extern int ima_path_check(struct path *path, int mask, int update_counts); | |||
24 | extern void ima_file_free(struct file *file); | 24 | extern void ima_file_free(struct file *file); |
25 | extern int ima_file_mmap(struct file *file, unsigned long prot); | 25 | extern int ima_file_mmap(struct file *file, unsigned long prot); |
26 | extern void ima_counts_get(struct file *file); | 26 | extern void ima_counts_get(struct file *file); |
27 | extern void ima_counts_put(struct path *path, int mask); | ||
27 | 28 | ||
28 | #else | 29 | #else |
29 | static inline int ima_bprm_check(struct linux_binprm *bprm) | 30 | static inline int ima_bprm_check(struct linux_binprm *bprm) |
@@ -60,5 +61,10 @@ static inline void ima_counts_get(struct file *file) | |||
60 | { | 61 | { |
61 | return; | 62 | return; |
62 | } | 63 | } |
64 | |||
65 | static inline void ima_counts_put(struct path *path, int mask) | ||
66 | { | ||
67 | return; | ||
68 | } | ||
63 | #endif /* CONFIG_IMA_H */ | 69 | #endif /* CONFIG_IMA_H */ |
64 | #endif /* _LINUX_IMA_H */ | 70 | #endif /* _LINUX_IMA_H */ |
diff --git a/include/linux/in.h b/include/linux/in.h index d60122a3a088..cf196da04ec9 100644 --- a/include/linux/in.h +++ b/include/linux/in.h | |||
@@ -107,6 +107,7 @@ struct in_addr { | |||
107 | #define MCAST_JOIN_SOURCE_GROUP 46 | 107 | #define MCAST_JOIN_SOURCE_GROUP 46 |
108 | #define MCAST_LEAVE_SOURCE_GROUP 47 | 108 | #define MCAST_LEAVE_SOURCE_GROUP 47 |
109 | #define MCAST_MSFILTER 48 | 109 | #define MCAST_MSFILTER 48 |
110 | #define IP_MULTICAST_ALL 49 | ||
110 | 111 | ||
111 | #define MCAST_EXCLUDE 0 | 112 | #define MCAST_EXCLUDE 0 |
112 | #define MCAST_INCLUDE 1 | 113 | #define MCAST_INCLUDE 1 |
diff --git a/include/linux/init.h b/include/linux/init.h index 0e06c176f185..13b633ed695e 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -2,8 +2,6 @@ | |||
2 | #define _LINUX_INIT_H | 2 | #define _LINUX_INIT_H |
3 | 3 | ||
4 | #include <linux/compiler.h> | 4 | #include <linux/compiler.h> |
5 | #include <linux/section-names.h> | ||
6 | #include <linux/stringify.h> | ||
7 | 5 | ||
8 | /* These macros are used to mark some functions or | 6 | /* These macros are used to mark some functions or |
9 | * initialized data (doesn't apply to uninitialized data) | 7 | * initialized data (doesn't apply to uninitialized data) |
@@ -31,7 +29,7 @@ | |||
31 | * sign followed by value, e.g.: | 29 | * sign followed by value, e.g.: |
32 | * | 30 | * |
33 | * static int init_variable __initdata = 0; | 31 | * static int init_variable __initdata = 0; |
34 | * static char linux_logo[] __initdata = { 0x32, 0x36, ... }; | 32 | * static const char linux_logo[] __initconst = { 0x32, 0x36, ... }; |
35 | * | 33 | * |
36 | * Don't forget to initialize data not at file scope, i.e. within a function, | 34 | * Don't forget to initialize data not at file scope, i.e. within a function, |
37 | * as gcc otherwise puts the data into the bss section and not into the init | 35 | * as gcc otherwise puts the data into the bss section and not into the init |
@@ -101,7 +99,7 @@ | |||
101 | #define __memexitconst __section(.memexit.rodata) | 99 | #define __memexitconst __section(.memexit.rodata) |
102 | 100 | ||
103 | /* For assembly routines */ | 101 | /* For assembly routines */ |
104 | #define __HEAD .section __stringify(HEAD_TEXT_SECTION),"ax" | 102 | #define __HEAD .section ".head.text","ax" |
105 | #define __INIT .section ".init.text","ax" | 103 | #define __INIT .section ".init.text","ax" |
106 | #define __FINIT .previous | 104 | #define __FINIT .previous |
107 | 105 | ||
@@ -136,6 +134,9 @@ typedef void (*exitcall_t)(void); | |||
136 | extern initcall_t __con_initcall_start[], __con_initcall_end[]; | 134 | extern initcall_t __con_initcall_start[], __con_initcall_end[]; |
137 | extern initcall_t __security_initcall_start[], __security_initcall_end[]; | 135 | extern initcall_t __security_initcall_start[], __security_initcall_end[]; |
138 | 136 | ||
137 | /* Used for contructor calls. */ | ||
138 | typedef void (*ctor_fn_t)(void); | ||
139 | |||
139 | /* Defined in init/main.c */ | 140 | /* Defined in init/main.c */ |
140 | extern int do_one_initcall(initcall_t fn); | 141 | extern int do_one_initcall(initcall_t fn); |
141 | extern char __initdata boot_command_line[]; | 142 | extern char __initdata boot_command_line[]; |
@@ -225,7 +226,8 @@ struct obs_kernel_param { | |||
225 | * obs_kernel_param "array" too far apart in .init.setup. | 226 | * obs_kernel_param "array" too far apart in .init.setup. |
226 | */ | 227 | */ |
227 | #define __setup_param(str, unique_id, fn, early) \ | 228 | #define __setup_param(str, unique_id, fn, early) \ |
228 | static char __setup_str_##unique_id[] __initdata __aligned(1) = str; \ | 229 | static const char __setup_str_##unique_id[] __initconst \ |
230 | __aligned(1) = str; \ | ||
229 | static struct obs_kernel_param __setup_##unique_id \ | 231 | static struct obs_kernel_param __setup_##unique_id \ |
230 | __used __section(.init.setup) \ | 232 | __used __section(.init.setup) \ |
231 | __attribute__((aligned((sizeof(long))))) \ | 233 | __attribute__((aligned((sizeof(long))))) \ |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 28b1f30601b5..7fc01b13be43 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -15,18 +15,6 @@ | |||
15 | extern struct files_struct init_files; | 15 | extern struct files_struct init_files; |
16 | extern struct fs_struct init_fs; | 16 | extern struct fs_struct init_fs; |
17 | 17 | ||
18 | #define INIT_MM(name) \ | ||
19 | { \ | ||
20 | .mm_rb = RB_ROOT, \ | ||
21 | .pgd = swapper_pg_dir, \ | ||
22 | .mm_users = ATOMIC_INIT(2), \ | ||
23 | .mm_count = ATOMIC_INIT(1), \ | ||
24 | .mmap_sem = __RWSEM_INITIALIZER(name.mmap_sem), \ | ||
25 | .page_table_lock = __SPIN_LOCK_UNLOCKED(name.page_table_lock), \ | ||
26 | .mmlist = LIST_HEAD_INIT(name.mmlist), \ | ||
27 | .cpu_vm_mask = CPU_MASK_ALL, \ | ||
28 | } | ||
29 | |||
30 | #define INIT_SIGNALS(sig) { \ | 18 | #define INIT_SIGNALS(sig) { \ |
31 | .count = ATOMIC_INIT(1), \ | 19 | .count = ATOMIC_INIT(1), \ |
32 | .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ | 20 | .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ |
@@ -195,5 +183,8 @@ extern struct cred init_cred; | |||
195 | LIST_HEAD_INIT(cpu_timers[2]), \ | 183 | LIST_HEAD_INIT(cpu_timers[2]), \ |
196 | } | 184 | } |
197 | 185 | ||
186 | /* Attach to the init_task data structure for proper alignment */ | ||
187 | #define __init_task_data __attribute__((__section__(".data.init_task"))) | ||
188 | |||
198 | 189 | ||
199 | #endif | 190 | #endif |
diff --git a/include/linux/input.h b/include/linux/input.h index 6fed4f6a9c9e..8b3bc3e0d146 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -53,6 +53,7 @@ struct input_absinfo { | |||
53 | __s32 maximum; | 53 | __s32 maximum; |
54 | __s32 fuzz; | 54 | __s32 fuzz; |
55 | __s32 flat; | 55 | __s32 flat; |
56 | __s32 resolution; | ||
56 | }; | 57 | }; |
57 | 58 | ||
58 | #define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */ | 59 | #define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */ |
@@ -1109,6 +1110,7 @@ struct input_dev { | |||
1109 | int absmin[ABS_MAX + 1]; | 1110 | int absmin[ABS_MAX + 1]; |
1110 | int absfuzz[ABS_MAX + 1]; | 1111 | int absfuzz[ABS_MAX + 1]; |
1111 | int absflat[ABS_MAX + 1]; | 1112 | int absflat[ABS_MAX + 1]; |
1113 | int absres[ABS_MAX + 1]; | ||
1112 | 1114 | ||
1113 | int (*open)(struct input_dev *dev); | 1115 | int (*open)(struct input_dev *dev); |
1114 | void (*close)(struct input_dev *dev); | 1116 | void (*close)(struct input_dev *dev); |
diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h new file mode 100644 index 000000000000..7964516c6954 --- /dev/null +++ b/include/linux/input/matrix_keypad.h | |||
@@ -0,0 +1,65 @@ | |||
1 | #ifndef _MATRIX_KEYPAD_H | ||
2 | #define _MATRIX_KEYPAD_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <linux/input.h> | ||
6 | |||
7 | #define MATRIX_MAX_ROWS 16 | ||
8 | #define MATRIX_MAX_COLS 16 | ||
9 | |||
10 | #define KEY(row, col, val) ((((row) & (MATRIX_MAX_ROWS - 1)) << 24) |\ | ||
11 | (((col) & (MATRIX_MAX_COLS - 1)) << 16) |\ | ||
12 | (val & 0xffff)) | ||
13 | |||
14 | #define KEY_ROW(k) (((k) >> 24) & 0xff) | ||
15 | #define KEY_COL(k) (((k) >> 16) & 0xff) | ||
16 | #define KEY_VAL(k) ((k) & 0xffff) | ||
17 | |||
18 | /** | ||
19 | * struct matrix_keymap_data - keymap for matrix keyboards | ||
20 | * @keymap: pointer to array of uint32 values encoded with KEY() macro | ||
21 | * representing keymap | ||
22 | * @keymap_size: number of entries (initialized) in this keymap | ||
23 | * @max_keymap_size: maximum size of keymap supported by the device | ||
24 | * | ||
25 | * This structure is supposed to be used by platform code to supply | ||
26 | * keymaps to drivers that implement matrix-like keypads/keyboards. | ||
27 | */ | ||
28 | struct matrix_keymap_data { | ||
29 | const uint32_t *keymap; | ||
30 | unsigned int keymap_size; | ||
31 | unsigned int max_keymap_size; | ||
32 | }; | ||
33 | |||
34 | /** | ||
35 | * struct matrix_keypad_platform_data - platform-dependent keypad data | ||
36 | * @keymap_data: pointer to &matrix_keymap_data | ||
37 | * @row_gpios: array of gpio numbers reporesenting rows | ||
38 | * @col_gpios: array of gpio numbers reporesenting colums | ||
39 | * @num_row_gpios: actual number of row gpios used by device | ||
40 | * @num_col_gpios: actual number of col gpios used by device | ||
41 | * @col_scan_delay_us: delay, measured in microseconds, that is | ||
42 | * needed before we can keypad after activating column gpio | ||
43 | * @debounce_ms: debounce interval in milliseconds | ||
44 | * | ||
45 | * This structure represents platform-specific data that use used by | ||
46 | * matrix_keypad driver to perform proper initialization. | ||
47 | */ | ||
48 | struct matrix_keypad_platform_data { | ||
49 | const struct matrix_keymap_data *keymap_data; | ||
50 | |||
51 | unsigned int row_gpios[MATRIX_MAX_ROWS]; | ||
52 | unsigned int col_gpios[MATRIX_MAX_COLS]; | ||
53 | unsigned int num_row_gpios; | ||
54 | unsigned int num_col_gpios; | ||
55 | |||
56 | unsigned int col_scan_delay_us; | ||
57 | |||
58 | /* key debounce interval in milli-second */ | ||
59 | unsigned int debounce_ms; | ||
60 | |||
61 | bool active_low; | ||
62 | bool wakeup; | ||
63 | }; | ||
64 | |||
65 | #endif /* _MATRIX_KEYPAD_H */ | ||
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h index aa8c53171233..482dc91fd53a 100644 --- a/include/linux/intel-iommu.h +++ b/include/linux/intel-iommu.h | |||
@@ -53,6 +53,7 @@ | |||
53 | #define DMAR_PHMLIMIT_REG 0x78 /* pmrr high limit */ | 53 | #define DMAR_PHMLIMIT_REG 0x78 /* pmrr high limit */ |
54 | #define DMAR_IQH_REG 0x80 /* Invalidation queue head register */ | 54 | #define DMAR_IQH_REG 0x80 /* Invalidation queue head register */ |
55 | #define DMAR_IQT_REG 0x88 /* Invalidation queue tail register */ | 55 | #define DMAR_IQT_REG 0x88 /* Invalidation queue tail register */ |
56 | #define DMAR_IQ_SHIFT 4 /* Invalidation queue head/tail shift */ | ||
56 | #define DMAR_IQA_REG 0x90 /* Invalidation queue addr register */ | 57 | #define DMAR_IQA_REG 0x90 /* Invalidation queue addr register */ |
57 | #define DMAR_ICS_REG 0x98 /* Invalidation complete status register */ | 58 | #define DMAR_ICS_REG 0x98 /* Invalidation complete status register */ |
58 | #define DMAR_IRTA_REG 0xb8 /* Interrupt remapping table addr register */ | 59 | #define DMAR_IRTA_REG 0xb8 /* Interrupt remapping table addr register */ |
@@ -120,8 +121,10 @@ static inline void dmar_writeq(void __iomem *addr, u64 val) | |||
120 | (ecap_iotlb_offset(e) + ecap_niotlb_iunits(e) * 16) | 121 | (ecap_iotlb_offset(e) + ecap_niotlb_iunits(e) * 16) |
121 | #define ecap_coherent(e) ((e) & 0x1) | 122 | #define ecap_coherent(e) ((e) & 0x1) |
122 | #define ecap_qis(e) ((e) & 0x2) | 123 | #define ecap_qis(e) ((e) & 0x2) |
124 | #define ecap_pass_through(e) ((e >> 6) & 0x1) | ||
123 | #define ecap_eim_support(e) ((e >> 4) & 0x1) | 125 | #define ecap_eim_support(e) ((e >> 4) & 0x1) |
124 | #define ecap_ir_support(e) ((e >> 3) & 0x1) | 126 | #define ecap_ir_support(e) ((e >> 3) & 0x1) |
127 | #define ecap_dev_iotlb_support(e) (((e) >> 2) & 0x1) | ||
125 | #define ecap_max_handle_mask(e) ((e >> 20) & 0xf) | 128 | #define ecap_max_handle_mask(e) ((e >> 20) & 0xf) |
126 | #define ecap_sc_support(e) ((e >> 7) & 0x1) /* Snooping Control */ | 129 | #define ecap_sc_support(e) ((e >> 7) & 0x1) /* Snooping Control */ |
127 | 130 | ||
@@ -197,6 +200,8 @@ static inline void dmar_writeq(void __iomem *addr, u64 val) | |||
197 | #define DMA_FSTS_PPF ((u32)2) | 200 | #define DMA_FSTS_PPF ((u32)2) |
198 | #define DMA_FSTS_PFO ((u32)1) | 201 | #define DMA_FSTS_PFO ((u32)1) |
199 | #define DMA_FSTS_IQE (1 << 4) | 202 | #define DMA_FSTS_IQE (1 << 4) |
203 | #define DMA_FSTS_ICE (1 << 5) | ||
204 | #define DMA_FSTS_ITE (1 << 6) | ||
200 | #define dma_fsts_fault_record_index(s) (((s) >> 8) & 0xff) | 205 | #define dma_fsts_fault_record_index(s) (((s) >> 8) & 0xff) |
201 | 206 | ||
202 | /* FRCD_REG, 32 bits access */ | 207 | /* FRCD_REG, 32 bits access */ |
@@ -225,7 +230,8 @@ do { \ | |||
225 | enum { | 230 | enum { |
226 | QI_FREE, | 231 | QI_FREE, |
227 | QI_IN_USE, | 232 | QI_IN_USE, |
228 | QI_DONE | 233 | QI_DONE, |
234 | QI_ABORT | ||
229 | }; | 235 | }; |
230 | 236 | ||
231 | #define QI_CC_TYPE 0x1 | 237 | #define QI_CC_TYPE 0x1 |
@@ -254,6 +260,12 @@ enum { | |||
254 | #define QI_CC_DID(did) (((u64)did) << 16) | 260 | #define QI_CC_DID(did) (((u64)did) << 16) |
255 | #define QI_CC_GRAN(gran) (((u64)gran) >> (DMA_CCMD_INVL_GRANU_OFFSET-4)) | 261 | #define QI_CC_GRAN(gran) (((u64)gran) >> (DMA_CCMD_INVL_GRANU_OFFSET-4)) |
256 | 262 | ||
263 | #define QI_DEV_IOTLB_SID(sid) ((u64)((sid) & 0xffff) << 32) | ||
264 | #define QI_DEV_IOTLB_QDEP(qdep) (((qdep) & 0x1f) << 16) | ||
265 | #define QI_DEV_IOTLB_ADDR(addr) ((u64)(addr) & VTD_PAGE_MASK) | ||
266 | #define QI_DEV_IOTLB_SIZE 1 | ||
267 | #define QI_DEV_IOTLB_MAX_INVS 32 | ||
268 | |||
257 | struct qi_desc { | 269 | struct qi_desc { |
258 | u64 low, high; | 270 | u64 low, high; |
259 | }; | 271 | }; |
@@ -280,10 +292,10 @@ struct ir_table { | |||
280 | #endif | 292 | #endif |
281 | 293 | ||
282 | struct iommu_flush { | 294 | struct iommu_flush { |
283 | int (*flush_context)(struct intel_iommu *iommu, u16 did, u16 sid, u8 fm, | 295 | void (*flush_context)(struct intel_iommu *iommu, u16 did, u16 sid, |
284 | u64 type, int non_present_entry_flush); | 296 | u8 fm, u64 type); |
285 | int (*flush_iotlb)(struct intel_iommu *iommu, u16 did, u64 addr, | 297 | void (*flush_iotlb)(struct intel_iommu *iommu, u16 did, u64 addr, |
286 | unsigned int size_order, u64 type, int non_present_entry_flush); | 298 | unsigned int size_order, u64 type); |
287 | }; | 299 | }; |
288 | 300 | ||
289 | enum { | 301 | enum { |
@@ -302,6 +314,7 @@ struct intel_iommu { | |||
302 | spinlock_t register_lock; /* protect register handling */ | 314 | spinlock_t register_lock; /* protect register handling */ |
303 | int seq_id; /* sequence id of the iommu */ | 315 | int seq_id; /* sequence id of the iommu */ |
304 | int agaw; /* agaw of this iommu */ | 316 | int agaw; /* agaw of this iommu */ |
317 | int msagaw; /* max sagaw of this iommu */ | ||
305 | unsigned int irq; | 318 | unsigned int irq; |
306 | unsigned char name[13]; /* Device Name */ | 319 | unsigned char name[13]; /* Device Name */ |
307 | 320 | ||
@@ -329,6 +342,7 @@ static inline void __iommu_flush_cache( | |||
329 | } | 342 | } |
330 | 343 | ||
331 | extern struct dmar_drhd_unit * dmar_find_matched_drhd_unit(struct pci_dev *dev); | 344 | extern struct dmar_drhd_unit * dmar_find_matched_drhd_unit(struct pci_dev *dev); |
345 | extern int dmar_find_matched_atsr_unit(struct pci_dev *dev); | ||
332 | 346 | ||
333 | extern int alloc_iommu(struct dmar_drhd_unit *drhd); | 347 | extern int alloc_iommu(struct dmar_drhd_unit *drhd); |
334 | extern void free_iommu(struct intel_iommu *iommu); | 348 | extern void free_iommu(struct intel_iommu *iommu); |
@@ -337,11 +351,12 @@ extern void dmar_disable_qi(struct intel_iommu *iommu); | |||
337 | extern int dmar_reenable_qi(struct intel_iommu *iommu); | 351 | extern int dmar_reenable_qi(struct intel_iommu *iommu); |
338 | extern void qi_global_iec(struct intel_iommu *iommu); | 352 | extern void qi_global_iec(struct intel_iommu *iommu); |
339 | 353 | ||
340 | extern int qi_flush_context(struct intel_iommu *iommu, u16 did, u16 sid, | 354 | extern void qi_flush_context(struct intel_iommu *iommu, u16 did, u16 sid, |
341 | u8 fm, u64 type, int non_present_entry_flush); | 355 | u8 fm, u64 type); |
342 | extern int qi_flush_iotlb(struct intel_iommu *iommu, u16 did, u64 addr, | 356 | extern void qi_flush_iotlb(struct intel_iommu *iommu, u16 did, u64 addr, |
343 | unsigned int size_order, u64 type, | 357 | unsigned int size_order, u64 type); |
344 | int non_present_entry_flush); | 358 | extern void qi_flush_dev_iotlb(struct intel_iommu *iommu, u16 sid, u16 qdep, |
359 | u64 addr, unsigned mask); | ||
345 | 360 | ||
346 | extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu); | 361 | extern int qi_submit_sync(struct qi_desc *desc, struct intel_iommu *iommu); |
347 | 362 | ||
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index ff374ceface0..35e7df1e9f30 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -14,6 +14,7 @@ | |||
14 | #include <linux/irqflags.h> | 14 | #include <linux/irqflags.h> |
15 | #include <linux/smp.h> | 15 | #include <linux/smp.h> |
16 | #include <linux/percpu.h> | 16 | #include <linux/percpu.h> |
17 | #include <linux/hrtimer.h> | ||
17 | 18 | ||
18 | #include <asm/atomic.h> | 19 | #include <asm/atomic.h> |
19 | #include <asm/ptrace.h> | 20 | #include <asm/ptrace.h> |
@@ -64,11 +65,13 @@ | |||
64 | * IRQTF_RUNTHREAD - signals that the interrupt handler thread should run | 65 | * IRQTF_RUNTHREAD - signals that the interrupt handler thread should run |
65 | * IRQTF_DIED - handler thread died | 66 | * IRQTF_DIED - handler thread died |
66 | * IRQTF_WARNED - warning "IRQ_WAKE_THREAD w/o thread_fn" has been printed | 67 | * IRQTF_WARNED - warning "IRQ_WAKE_THREAD w/o thread_fn" has been printed |
68 | * IRQTF_AFFINITY - irq thread is requested to adjust affinity | ||
67 | */ | 69 | */ |
68 | enum { | 70 | enum { |
69 | IRQTF_RUNTHREAD, | 71 | IRQTF_RUNTHREAD, |
70 | IRQTF_DIED, | 72 | IRQTF_DIED, |
71 | IRQTF_WARNED, | 73 | IRQTF_WARNED, |
74 | IRQTF_AFFINITY, | ||
72 | }; | 75 | }; |
73 | 76 | ||
74 | typedef irqreturn_t (*irq_handler_t)(int, void *); | 77 | typedef irqreturn_t (*irq_handler_t)(int, void *); |
@@ -183,6 +186,7 @@ extern void disable_irq(unsigned int irq); | |||
183 | extern void enable_irq(unsigned int irq); | 186 | extern void enable_irq(unsigned int irq); |
184 | 187 | ||
185 | /* The following three functions are for the core kernel use only. */ | 188 | /* The following three functions are for the core kernel use only. */ |
189 | #ifdef CONFIG_GENERIC_HARDIRQS | ||
186 | extern void suspend_device_irqs(void); | 190 | extern void suspend_device_irqs(void); |
187 | extern void resume_device_irqs(void); | 191 | extern void resume_device_irqs(void); |
188 | #ifdef CONFIG_PM_SLEEP | 192 | #ifdef CONFIG_PM_SLEEP |
@@ -190,6 +194,11 @@ extern int check_wakeup_irqs(void); | |||
190 | #else | 194 | #else |
191 | static inline int check_wakeup_irqs(void) { return 0; } | 195 | static inline int check_wakeup_irqs(void) { return 0; } |
192 | #endif | 196 | #endif |
197 | #else | ||
198 | static inline void suspend_device_irqs(void) { }; | ||
199 | static inline void resume_device_irqs(void) { }; | ||
200 | static inline int check_wakeup_irqs(void) { return 0; } | ||
201 | #endif | ||
193 | 202 | ||
194 | #if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_HARDIRQS) | 203 | #if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_HARDIRQS) |
195 | 204 | ||
@@ -466,6 +475,20 @@ static inline void tasklet_hi_schedule(struct tasklet_struct *t) | |||
466 | __tasklet_hi_schedule(t); | 475 | __tasklet_hi_schedule(t); |
467 | } | 476 | } |
468 | 477 | ||
478 | extern void __tasklet_hi_schedule_first(struct tasklet_struct *t); | ||
479 | |||
480 | /* | ||
481 | * This version avoids touching any other tasklets. Needed for kmemcheck | ||
482 | * in order not to take any page faults while enqueueing this tasklet; | ||
483 | * consider VERY carefully whether you really need this or | ||
484 | * tasklet_hi_schedule()... | ||
485 | */ | ||
486 | static inline void tasklet_hi_schedule_first(struct tasklet_struct *t) | ||
487 | { | ||
488 | if (!test_and_set_bit(TASKLET_STATE_SCHED, &t->state)) | ||
489 | __tasklet_hi_schedule_first(t); | ||
490 | } | ||
491 | |||
469 | 492 | ||
470 | static inline void tasklet_disable_nosync(struct tasklet_struct *t) | 493 | static inline void tasklet_disable_nosync(struct tasklet_struct *t) |
471 | { | 494 | { |
@@ -497,6 +520,31 @@ extern void tasklet_kill_immediate(struct tasklet_struct *t, unsigned int cpu); | |||
497 | extern void tasklet_init(struct tasklet_struct *t, | 520 | extern void tasklet_init(struct tasklet_struct *t, |
498 | void (*func)(unsigned long), unsigned long data); | 521 | void (*func)(unsigned long), unsigned long data); |
499 | 522 | ||
523 | struct tasklet_hrtimer { | ||
524 | struct hrtimer timer; | ||
525 | struct tasklet_struct tasklet; | ||
526 | enum hrtimer_restart (*function)(struct hrtimer *); | ||
527 | }; | ||
528 | |||
529 | extern void | ||
530 | tasklet_hrtimer_init(struct tasklet_hrtimer *ttimer, | ||
531 | enum hrtimer_restart (*function)(struct hrtimer *), | ||
532 | clockid_t which_clock, enum hrtimer_mode mode); | ||
533 | |||
534 | static inline | ||
535 | int tasklet_hrtimer_start(struct tasklet_hrtimer *ttimer, ktime_t time, | ||
536 | const enum hrtimer_mode mode) | ||
537 | { | ||
538 | return hrtimer_start(&ttimer->timer, time, mode); | ||
539 | } | ||
540 | |||
541 | static inline | ||
542 | void tasklet_hrtimer_cancel(struct tasklet_hrtimer *ttimer) | ||
543 | { | ||
544 | hrtimer_cancel(&ttimer->timer); | ||
545 | tasklet_kill(&ttimer->tasklet); | ||
546 | } | ||
547 | |||
500 | /* | 548 | /* |
501 | * Autoprobing for irqs: | 549 | * Autoprobing for irqs: |
502 | * | 550 | * |
diff --git a/include/linux/ioport.h b/include/linux/ioport.h index 32e4b2f72294..786e7b8cece9 100644 --- a/include/linux/ioport.h +++ b/include/linux/ioport.h | |||
@@ -49,6 +49,8 @@ struct resource_list { | |||
49 | #define IORESOURCE_SIZEALIGN 0x00020000 /* size indicates alignment */ | 49 | #define IORESOURCE_SIZEALIGN 0x00020000 /* size indicates alignment */ |
50 | #define IORESOURCE_STARTALIGN 0x00040000 /* start field is alignment */ | 50 | #define IORESOURCE_STARTALIGN 0x00040000 /* start field is alignment */ |
51 | 51 | ||
52 | #define IORESOURCE_MEM_64 0x00100000 | ||
53 | |||
52 | #define IORESOURCE_EXCLUSIVE 0x08000000 /* Userland may not map this resource */ | 54 | #define IORESOURCE_EXCLUSIVE 0x08000000 /* Userland may not map this resource */ |
53 | #define IORESOURCE_DISABLED 0x10000000 | 55 | #define IORESOURCE_DISABLED 0x10000000 |
54 | #define IORESOURCE_UNSET 0x20000000 | 56 | #define IORESOURCE_UNSET 0x20000000 |
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h index 3bf40e246a80..e408722a84c7 100644 --- a/include/linux/ipc_namespace.h +++ b/include/linux/ipc_namespace.h | |||
@@ -94,13 +94,8 @@ static inline int mq_init_ns(struct ipc_namespace *ns) { return 0; } | |||
94 | #endif | 94 | #endif |
95 | 95 | ||
96 | #if defined(CONFIG_IPC_NS) | 96 | #if defined(CONFIG_IPC_NS) |
97 | extern void free_ipc_ns(struct ipc_namespace *ns); | ||
98 | extern struct ipc_namespace *copy_ipcs(unsigned long flags, | 97 | extern struct ipc_namespace *copy_ipcs(unsigned long flags, |
99 | struct ipc_namespace *ns); | 98 | struct ipc_namespace *ns); |
100 | extern void free_ipcs(struct ipc_namespace *ns, struct ipc_ids *ids, | ||
101 | void (*free)(struct ipc_namespace *, | ||
102 | struct kern_ipc_perm *)); | ||
103 | |||
104 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) | 99 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) |
105 | { | 100 | { |
106 | if (ns) | 101 | if (ns) |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index 476d9464ac82..c662efa68289 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -169,6 +169,12 @@ struct ipv6_devconf { | |||
169 | __s32 accept_dad; | 169 | __s32 accept_dad; |
170 | void *sysctl; | 170 | void *sysctl; |
171 | }; | 171 | }; |
172 | |||
173 | struct ipv6_params { | ||
174 | __s32 disable_ipv6; | ||
175 | __s32 autoconf; | ||
176 | }; | ||
177 | extern struct ipv6_params ipv6_defaults; | ||
172 | #endif | 178 | #endif |
173 | 179 | ||
174 | /* index values for the variables in ipv6_devconf */ | 180 | /* index values for the variables in ipv6_devconf */ |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 1e50c34f0062..cb2e77a3f7f7 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -157,7 +157,7 @@ struct irq_2_iommu; | |||
157 | * @irqs_unhandled: stats field for spurious unhandled interrupts | 157 | * @irqs_unhandled: stats field for spurious unhandled interrupts |
158 | * @lock: locking for SMP | 158 | * @lock: locking for SMP |
159 | * @affinity: IRQ affinity on SMP | 159 | * @affinity: IRQ affinity on SMP |
160 | * @cpu: cpu index useful for balancing | 160 | * @node: node index useful for balancing |
161 | * @pending_mask: pending rebalanced interrupts | 161 | * @pending_mask: pending rebalanced interrupts |
162 | * @threads_active: number of irqaction threads currently running | 162 | * @threads_active: number of irqaction threads currently running |
163 | * @wait_for_threads: wait queue for sync_irq to wait for threaded handlers | 163 | * @wait_for_threads: wait queue for sync_irq to wait for threaded handlers |
@@ -423,7 +423,7 @@ extern int set_irq_msi(unsigned int irq, struct msi_desc *entry); | |||
423 | /** | 423 | /** |
424 | * alloc_desc_masks - allocate cpumasks for irq_desc | 424 | * alloc_desc_masks - allocate cpumasks for irq_desc |
425 | * @desc: pointer to irq_desc struct | 425 | * @desc: pointer to irq_desc struct |
426 | * @cpu: cpu which will be handling the cpumasks | 426 | * @node: node which will be handling the cpumasks |
427 | * @boot: true if need bootmem | 427 | * @boot: true if need bootmem |
428 | * | 428 | * |
429 | * Allocates affinity and pending_mask cpumask if required. | 429 | * Allocates affinity and pending_mask cpumask if required. |
diff --git a/include/linux/isdn/capilli.h b/include/linux/isdn/capilli.h index 35e9b0fd014b..7acb87a44872 100644 --- a/include/linux/isdn/capilli.h +++ b/include/linux/isdn/capilli.h | |||
@@ -79,7 +79,7 @@ int attach_capi_ctr(struct capi_ctr *); | |||
79 | int detach_capi_ctr(struct capi_ctr *); | 79 | int detach_capi_ctr(struct capi_ctr *); |
80 | 80 | ||
81 | void capi_ctr_ready(struct capi_ctr * card); | 81 | void capi_ctr_ready(struct capi_ctr * card); |
82 | void capi_ctr_reseted(struct capi_ctr * card); | 82 | void capi_ctr_down(struct capi_ctr * card); |
83 | void capi_ctr_suspend_output(struct capi_ctr * card); | 83 | void capi_ctr_suspend_output(struct capi_ctr * card); |
84 | void capi_ctr_resume_output(struct capi_ctr * card); | 84 | void capi_ctr_resume_output(struct capi_ctr * card); |
85 | void capi_ctr_handle_message(struct capi_ctr * card, u16 appl, struct sk_buff *skb); | 85 | void capi_ctr_handle_message(struct capi_ctr * card, u16 appl, struct sk_buff *skb); |
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h index cc02393bfce8..d97eb652d6ca 100644 --- a/include/linux/jbd2.h +++ b/include/linux/jbd2.h | |||
@@ -1315,6 +1315,12 @@ extern int jbd_blocks_per_page(struct inode *inode); | |||
1315 | #define BUFFER_TRACE2(bh, bh2, info) do {} while (0) | 1315 | #define BUFFER_TRACE2(bh, bh2, info) do {} while (0) |
1316 | #define JBUFFER_TRACE(jh, info) do {} while (0) | 1316 | #define JBUFFER_TRACE(jh, info) do {} while (0) |
1317 | 1317 | ||
1318 | /* | ||
1319 | * jbd2_dev_to_name is a utility function used by the jbd2 and ext4 | ||
1320 | * tracing infrastructure to map a dev_t to a device name. | ||
1321 | */ | ||
1322 | extern const char *jbd2_dev_to_name(dev_t device); | ||
1323 | |||
1318 | #endif /* __KERNEL__ */ | 1324 | #endif /* __KERNEL__ */ |
1319 | 1325 | ||
1320 | #endif /* _LINUX_JBD2_H */ | 1326 | #endif /* _LINUX_JBD2_H */ |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 883cd44ff765..d6320a3e8def 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -58,7 +58,7 @@ extern const char linux_proc_banner[]; | |||
58 | #define _RET_IP_ (unsigned long)__builtin_return_address(0) | 58 | #define _RET_IP_ (unsigned long)__builtin_return_address(0) |
59 | #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; }) | 59 | #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; }) |
60 | 60 | ||
61 | #ifdef CONFIG_LBD | 61 | #ifdef CONFIG_LBDAF |
62 | # include <asm/div64.h> | 62 | # include <asm/div64.h> |
63 | # define sector_div(a, b) do_div(a, b) | 63 | # define sector_div(a, b) do_div(a, b) |
64 | #else | 64 | #else |
@@ -97,12 +97,14 @@ extern const char linux_proc_banner[]; | |||
97 | #define KERN_INFO "<6>" /* informational */ | 97 | #define KERN_INFO "<6>" /* informational */ |
98 | #define KERN_DEBUG "<7>" /* debug-level messages */ | 98 | #define KERN_DEBUG "<7>" /* debug-level messages */ |
99 | 99 | ||
100 | /* Use the default kernel loglevel */ | ||
101 | #define KERN_DEFAULT "<d>" | ||
100 | /* | 102 | /* |
101 | * Annotation for a "continued" line of log printout (only done after a | 103 | * Annotation for a "continued" line of log printout (only done after a |
102 | * line that had no enclosing \n). Only to be used by core/arch code | 104 | * line that had no enclosing \n). Only to be used by core/arch code |
103 | * during early bootup (a continued line is not SMP-safe otherwise). | 105 | * during early bootup (a continued line is not SMP-safe otherwise). |
104 | */ | 106 | */ |
105 | #define KERN_CONT "" | 107 | #define KERN_CONT "<c>" |
106 | 108 | ||
107 | extern int console_printk[]; | 109 | extern int console_printk[]; |
108 | 110 | ||
@@ -301,6 +303,7 @@ extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in | |||
301 | extern int panic_timeout; | 303 | extern int panic_timeout; |
302 | extern int panic_on_oops; | 304 | extern int panic_on_oops; |
303 | extern int panic_on_unrecovered_nmi; | 305 | extern int panic_on_unrecovered_nmi; |
306 | extern int panic_on_io_nmi; | ||
304 | extern const char *print_tainted(void); | 307 | extern const char *print_tainted(void); |
305 | extern void add_taint(unsigned flag); | 308 | extern void add_taint(unsigned flag); |
306 | extern int test_taint(unsigned flag); | 309 | extern int test_taint(unsigned flag); |
@@ -406,7 +409,7 @@ static inline char *pack_hex_byte(char *buf, u8 byte) | |||
406 | * | 409 | * |
407 | * Use tracing_on/tracing_off when you want to quickly turn on or off | 410 | * Use tracing_on/tracing_off when you want to quickly turn on or off |
408 | * tracing. It simply enables or disables the recording of the trace events. | 411 | * tracing. It simply enables or disables the recording of the trace events. |
409 | * This also corresponds to the user space debugfs/tracing/tracing_on | 412 | * This also corresponds to the user space /sys/kernel/debug/tracing/tracing_on |
410 | * file, which gives a means for the kernel and userspace to interact. | 413 | * file, which gives a means for the kernel and userspace to interact. |
411 | * Place a tracing_off() in the kernel where you want tracing to end. | 414 | * Place a tracing_off() in the kernel where you want tracing to end. |
412 | * From user space, examine the trace, and then echo 1 > tracing_on | 415 | * From user space, examine the trace, and then echo 1 > tracing_on |
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index a77c6007dc99..348fa8874b52 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h | |||
@@ -5,6 +5,7 @@ | |||
5 | #include <linux/threads.h> | 5 | #include <linux/threads.h> |
6 | #include <linux/percpu.h> | 6 | #include <linux/percpu.h> |
7 | #include <linux/cpumask.h> | 7 | #include <linux/cpumask.h> |
8 | #include <linux/interrupt.h> | ||
8 | #include <asm/irq.h> | 9 | #include <asm/irq.h> |
9 | #include <asm/cputime.h> | 10 | #include <asm/cputime.h> |
10 | 11 | ||
@@ -31,6 +32,7 @@ struct kernel_stat { | |||
31 | #ifndef CONFIG_GENERIC_HARDIRQS | 32 | #ifndef CONFIG_GENERIC_HARDIRQS |
32 | unsigned int irqs[NR_IRQS]; | 33 | unsigned int irqs[NR_IRQS]; |
33 | #endif | 34 | #endif |
35 | unsigned int softirqs[NR_SOFTIRQS]; | ||
34 | }; | 36 | }; |
35 | 37 | ||
36 | DECLARE_PER_CPU(struct kernel_stat, kstat); | 38 | DECLARE_PER_CPU(struct kernel_stat, kstat); |
@@ -67,6 +69,16 @@ extern unsigned int kstat_irqs_cpu(unsigned int irq, int cpu); | |||
67 | 69 | ||
68 | #endif | 70 | #endif |
69 | 71 | ||
72 | static inline void kstat_incr_softirqs_this_cpu(unsigned int irq) | ||
73 | { | ||
74 | kstat_this_cpu.softirqs[irq]++; | ||
75 | } | ||
76 | |||
77 | static inline unsigned int kstat_softirqs_cpu(unsigned int irq, int cpu) | ||
78 | { | ||
79 | return kstat_cpu(cpu).softirqs[irq]; | ||
80 | } | ||
81 | |||
70 | /* | 82 | /* |
71 | * Number of interrupts per specific IRQ source, since bootup | 83 | * Number of interrupts per specific IRQ source, since bootup |
72 | */ | 84 | */ |
diff --git a/include/linux/keyboard.h b/include/linux/keyboard.h index a3c984d780f0..33a63f62d57f 100644 --- a/include/linux/keyboard.h +++ b/include/linux/keyboard.h | |||
@@ -56,6 +56,7 @@ extern int unregister_keyboard_notifier(struct notifier_block *nb); | |||
56 | #define KT_ASCII 9 | 56 | #define KT_ASCII 9 |
57 | #define KT_LOCK 10 | 57 | #define KT_LOCK 10 |
58 | #define KT_SLOCK 12 | 58 | #define KT_SLOCK 12 |
59 | #define KT_DEAD2 13 | ||
59 | #define KT_BRL 14 | 60 | #define KT_BRL 14 |
60 | 61 | ||
61 | #define K(t,v) (((t)<<8)|(v)) | 62 | #define K(t,v) (((t)<<8)|(v)) |
diff --git a/include/linux/kmemcheck.h b/include/linux/kmemcheck.h new file mode 100644 index 000000000000..47b39b7c7e84 --- /dev/null +++ b/include/linux/kmemcheck.h | |||
@@ -0,0 +1,153 @@ | |||
1 | #ifndef LINUX_KMEMCHECK_H | ||
2 | #define LINUX_KMEMCHECK_H | ||
3 | |||
4 | #include <linux/mm_types.h> | ||
5 | #include <linux/types.h> | ||
6 | |||
7 | #ifdef CONFIG_KMEMCHECK | ||
8 | extern int kmemcheck_enabled; | ||
9 | |||
10 | /* The slab-related functions. */ | ||
11 | void kmemcheck_alloc_shadow(struct page *page, int order, gfp_t flags, int node); | ||
12 | void kmemcheck_free_shadow(struct page *page, int order); | ||
13 | void kmemcheck_slab_alloc(struct kmem_cache *s, gfp_t gfpflags, void *object, | ||
14 | size_t size); | ||
15 | void kmemcheck_slab_free(struct kmem_cache *s, void *object, size_t size); | ||
16 | |||
17 | void kmemcheck_pagealloc_alloc(struct page *p, unsigned int order, | ||
18 | gfp_t gfpflags); | ||
19 | |||
20 | void kmemcheck_show_pages(struct page *p, unsigned int n); | ||
21 | void kmemcheck_hide_pages(struct page *p, unsigned int n); | ||
22 | |||
23 | bool kmemcheck_page_is_tracked(struct page *p); | ||
24 | |||
25 | void kmemcheck_mark_unallocated(void *address, unsigned int n); | ||
26 | void kmemcheck_mark_uninitialized(void *address, unsigned int n); | ||
27 | void kmemcheck_mark_initialized(void *address, unsigned int n); | ||
28 | void kmemcheck_mark_freed(void *address, unsigned int n); | ||
29 | |||
30 | void kmemcheck_mark_unallocated_pages(struct page *p, unsigned int n); | ||
31 | void kmemcheck_mark_uninitialized_pages(struct page *p, unsigned int n); | ||
32 | void kmemcheck_mark_initialized_pages(struct page *p, unsigned int n); | ||
33 | |||
34 | int kmemcheck_show_addr(unsigned long address); | ||
35 | int kmemcheck_hide_addr(unsigned long address); | ||
36 | |||
37 | #else | ||
38 | #define kmemcheck_enabled 0 | ||
39 | |||
40 | static inline void | ||
41 | kmemcheck_alloc_shadow(struct page *page, int order, gfp_t flags, int node) | ||
42 | { | ||
43 | } | ||
44 | |||
45 | static inline void | ||
46 | kmemcheck_free_shadow(struct page *page, int order) | ||
47 | { | ||
48 | } | ||
49 | |||
50 | static inline void | ||
51 | kmemcheck_slab_alloc(struct kmem_cache *s, gfp_t gfpflags, void *object, | ||
52 | size_t size) | ||
53 | { | ||
54 | } | ||
55 | |||
56 | static inline void kmemcheck_slab_free(struct kmem_cache *s, void *object, | ||
57 | size_t size) | ||
58 | { | ||
59 | } | ||
60 | |||
61 | static inline void kmemcheck_pagealloc_alloc(struct page *p, | ||
62 | unsigned int order, gfp_t gfpflags) | ||
63 | { | ||
64 | } | ||
65 | |||
66 | static inline bool kmemcheck_page_is_tracked(struct page *p) | ||
67 | { | ||
68 | return false; | ||
69 | } | ||
70 | |||
71 | static inline void kmemcheck_mark_unallocated(void *address, unsigned int n) | ||
72 | { | ||
73 | } | ||
74 | |||
75 | static inline void kmemcheck_mark_uninitialized(void *address, unsigned int n) | ||
76 | { | ||
77 | } | ||
78 | |||
79 | static inline void kmemcheck_mark_initialized(void *address, unsigned int n) | ||
80 | { | ||
81 | } | ||
82 | |||
83 | static inline void kmemcheck_mark_freed(void *address, unsigned int n) | ||
84 | { | ||
85 | } | ||
86 | |||
87 | static inline void kmemcheck_mark_unallocated_pages(struct page *p, | ||
88 | unsigned int n) | ||
89 | { | ||
90 | } | ||
91 | |||
92 | static inline void kmemcheck_mark_uninitialized_pages(struct page *p, | ||
93 | unsigned int n) | ||
94 | { | ||
95 | } | ||
96 | |||
97 | static inline void kmemcheck_mark_initialized_pages(struct page *p, | ||
98 | unsigned int n) | ||
99 | { | ||
100 | } | ||
101 | |||
102 | #endif /* CONFIG_KMEMCHECK */ | ||
103 | |||
104 | /* | ||
105 | * Bitfield annotations | ||
106 | * | ||
107 | * How to use: If you have a struct using bitfields, for example | ||
108 | * | ||
109 | * struct a { | ||
110 | * int x:8, y:8; | ||
111 | * }; | ||
112 | * | ||
113 | * then this should be rewritten as | ||
114 | * | ||
115 | * struct a { | ||
116 | * kmemcheck_bitfield_begin(flags); | ||
117 | * int x:8, y:8; | ||
118 | * kmemcheck_bitfield_end(flags); | ||
119 | * }; | ||
120 | * | ||
121 | * Now the "flags_begin" and "flags_end" members may be used to refer to the | ||
122 | * beginning and end, respectively, of the bitfield (and things like | ||
123 | * &x.flags_begin is allowed). As soon as the struct is allocated, the bit- | ||
124 | * fields should be annotated: | ||
125 | * | ||
126 | * struct a *a = kmalloc(sizeof(struct a), GFP_KERNEL); | ||
127 | * kmemcheck_annotate_bitfield(a, flags); | ||
128 | * | ||
129 | * Note: We provide the same definitions for both kmemcheck and non- | ||
130 | * kmemcheck kernels. This makes it harder to introduce accidental errors. It | ||
131 | * is also allowed to pass NULL pointers to kmemcheck_annotate_bitfield(). | ||
132 | */ | ||
133 | #define kmemcheck_bitfield_begin(name) \ | ||
134 | int name##_begin[0]; | ||
135 | |||
136 | #define kmemcheck_bitfield_end(name) \ | ||
137 | int name##_end[0]; | ||
138 | |||
139 | #define kmemcheck_annotate_bitfield(ptr, name) \ | ||
140 | do if (ptr) { \ | ||
141 | int _n = (long) &((ptr)->name##_end) \ | ||
142 | - (long) &((ptr)->name##_begin); \ | ||
143 | BUILD_BUG_ON(_n < 0); \ | ||
144 | \ | ||
145 | kmemcheck_mark_initialized(&((ptr)->name##_begin), _n); \ | ||
146 | } while (0) | ||
147 | |||
148 | #define kmemcheck_annotate_variable(var) \ | ||
149 | do { \ | ||
150 | kmemcheck_mark_initialized(&(var), sizeof(var)); \ | ||
151 | } while (0) \ | ||
152 | |||
153 | #endif /* LINUX_KMEMCHECK_H */ | ||
diff --git a/include/linux/kmemleak.h b/include/linux/kmemleak.h index 7796aed6cdd5..6a63807f714e 100644 --- a/include/linux/kmemleak.h +++ b/include/linux/kmemleak.h | |||
@@ -27,6 +27,7 @@ extern void kmemleak_init(void); | |||
27 | extern void kmemleak_alloc(const void *ptr, size_t size, int min_count, | 27 | extern void kmemleak_alloc(const void *ptr, size_t size, int min_count, |
28 | gfp_t gfp); | 28 | gfp_t gfp); |
29 | extern void kmemleak_free(const void *ptr); | 29 | extern void kmemleak_free(const void *ptr); |
30 | extern void kmemleak_free_part(const void *ptr, size_t size); | ||
30 | extern void kmemleak_padding(const void *ptr, unsigned long offset, | 31 | extern void kmemleak_padding(const void *ptr, unsigned long offset, |
31 | size_t size); | 32 | size_t size); |
32 | extern void kmemleak_not_leak(const void *ptr); | 33 | extern void kmemleak_not_leak(const void *ptr); |
@@ -71,6 +72,9 @@ static inline void kmemleak_alloc_recursive(const void *ptr, size_t size, | |||
71 | static inline void kmemleak_free(const void *ptr) | 72 | static inline void kmemleak_free(const void *ptr) |
72 | { | 73 | { |
73 | } | 74 | } |
75 | static inline void kmemleak_free_part(const void *ptr, size_t size) | ||
76 | { | ||
77 | } | ||
74 | static inline void kmemleak_free_recursive(const void *ptr, unsigned long flags) | 78 | static inline void kmemleak_free_recursive(const void *ptr, unsigned long flags) |
75 | { | 79 | { |
76 | } | 80 | } |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index aacc5449f586..16713dc672e4 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -125,6 +125,7 @@ struct kvm_kernel_irq_routing_entry { | |||
125 | struct kvm { | 125 | struct kvm { |
126 | struct mutex lock; /* protects the vcpus array and APIC accesses */ | 126 | struct mutex lock; /* protects the vcpus array and APIC accesses */ |
127 | spinlock_t mmu_lock; | 127 | spinlock_t mmu_lock; |
128 | spinlock_t requests_lock; | ||
128 | struct rw_semaphore slots_lock; | 129 | struct rw_semaphore slots_lock; |
129 | struct mm_struct *mm; /* userspace tied to this vm */ | 130 | struct mm_struct *mm; /* userspace tied to this vm */ |
130 | int nmemslots; | 131 | int nmemslots; |
diff --git a/include/linux/leds-lp3944.h b/include/linux/leds-lp3944.h new file mode 100644 index 000000000000..afc9f9fd70f5 --- /dev/null +++ b/include/linux/leds-lp3944.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * leds-lp3944.h - platform data structure for lp3944 led controller | ||
3 | * | ||
4 | * Copyright (C) 2009 Antonio Ospite <ospite@studenti.unina.it> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | * | ||
10 | */ | ||
11 | |||
12 | #ifndef __LINUX_LEDS_LP3944_H | ||
13 | #define __LINUX_LEDS_LP3944_H | ||
14 | |||
15 | #include <linux/leds.h> | ||
16 | #include <linux/workqueue.h> | ||
17 | |||
18 | #define LP3944_LED0 0 | ||
19 | #define LP3944_LED1 1 | ||
20 | #define LP3944_LED2 2 | ||
21 | #define LP3944_LED3 3 | ||
22 | #define LP3944_LED4 4 | ||
23 | #define LP3944_LED5 5 | ||
24 | #define LP3944_LED6 6 | ||
25 | #define LP3944_LED7 7 | ||
26 | #define LP3944_LEDS_MAX 8 | ||
27 | |||
28 | #define LP3944_LED_STATUS_MASK 0x03 | ||
29 | enum lp3944_status { | ||
30 | LP3944_LED_STATUS_OFF = 0x0, | ||
31 | LP3944_LED_STATUS_ON = 0x1, | ||
32 | LP3944_LED_STATUS_DIM0 = 0x2, | ||
33 | LP3944_LED_STATUS_DIM1 = 0x3 | ||
34 | }; | ||
35 | |||
36 | enum lp3944_type { | ||
37 | LP3944_LED_TYPE_NONE, | ||
38 | LP3944_LED_TYPE_LED, | ||
39 | LP3944_LED_TYPE_LED_INVERTED, | ||
40 | }; | ||
41 | |||
42 | struct lp3944_led { | ||
43 | char *name; | ||
44 | enum lp3944_type type; | ||
45 | enum lp3944_status status; | ||
46 | }; | ||
47 | |||
48 | struct lp3944_platform_data { | ||
49 | struct lp3944_led leds[LP3944_LEDS_MAX]; | ||
50 | u8 leds_size; | ||
51 | }; | ||
52 | |||
53 | #endif /* __LINUX_LEDS_LP3944_H */ | ||
diff --git a/include/linux/leds.h b/include/linux/leds.h index 376fe07732ea..d8bf9665e70c 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
@@ -45,7 +45,10 @@ struct led_classdev { | |||
45 | /* Get LED brightness level */ | 45 | /* Get LED brightness level */ |
46 | enum led_brightness (*brightness_get)(struct led_classdev *led_cdev); | 46 | enum led_brightness (*brightness_get)(struct led_classdev *led_cdev); |
47 | 47 | ||
48 | /* Activate hardware accelerated blink */ | 48 | /* Activate hardware accelerated blink, delays are in |
49 | * miliseconds and if none is provided then a sensible default | ||
50 | * should be chosen. The call can adjust the timings if it can't | ||
51 | * match the values specified exactly. */ | ||
49 | int (*blink_set)(struct led_classdev *led_cdev, | 52 | int (*blink_set)(struct led_classdev *led_cdev, |
50 | unsigned long *delay_on, | 53 | unsigned long *delay_on, |
51 | unsigned long *delay_off); | 54 | unsigned long *delay_off); |
@@ -141,9 +144,14 @@ struct gpio_led { | |||
141 | const char *name; | 144 | const char *name; |
142 | const char *default_trigger; | 145 | const char *default_trigger; |
143 | unsigned gpio; | 146 | unsigned gpio; |
144 | u8 active_low : 1; | 147 | unsigned active_low : 1; |
145 | u8 retain_state_suspended : 1; | 148 | unsigned retain_state_suspended : 1; |
149 | unsigned default_state : 2; | ||
150 | /* default_state should be one of LEDS_GPIO_DEFSTATE_(ON|OFF|KEEP) */ | ||
146 | }; | 151 | }; |
152 | #define LEDS_GPIO_DEFSTATE_OFF 0 | ||
153 | #define LEDS_GPIO_DEFSTATE_ON 1 | ||
154 | #define LEDS_GPIO_DEFSTATE_KEEP 2 | ||
147 | 155 | ||
148 | struct gpio_led_platform_data { | 156 | struct gpio_led_platform_data { |
149 | int num_leds; | 157 | int num_leds; |
diff --git a/include/linux/lguest.h b/include/linux/lguest.h index 175e63f4a8c0..dbf2479e808e 100644 --- a/include/linux/lguest.h +++ b/include/linux/lguest.h | |||
@@ -11,7 +11,7 @@ | |||
11 | #define LG_CLOCK_MIN_DELTA 100UL | 11 | #define LG_CLOCK_MIN_DELTA 100UL |
12 | #define LG_CLOCK_MAX_DELTA ULONG_MAX | 12 | #define LG_CLOCK_MAX_DELTA ULONG_MAX |
13 | 13 | ||
14 | /*G:032 The second method of communicating with the Host is to via "struct | 14 | /*G:031 The second method of communicating with the Host is to via "struct |
15 | * lguest_data". Once the Guest's initialization hypercall tells the Host where | 15 | * lguest_data". Once the Guest's initialization hypercall tells the Host where |
16 | * this is, the Guest and Host both publish information in it. :*/ | 16 | * this is, the Guest and Host both publish information in it. :*/ |
17 | struct lguest_data | 17 | struct lguest_data |
@@ -30,6 +30,10 @@ struct lguest_data | |||
30 | /* Wallclock time set by the Host. */ | 30 | /* Wallclock time set by the Host. */ |
31 | struct timespec time; | 31 | struct timespec time; |
32 | 32 | ||
33 | /* Interrupt pending set by the Host. The Guest should do a hypercall | ||
34 | * if it re-enables interrupts and sees this set (to X86_EFLAGS_IF). */ | ||
35 | int irq_pending; | ||
36 | |||
33 | /* Async hypercall ring. Instead of directly making hypercalls, we can | 37 | /* Async hypercall ring. Instead of directly making hypercalls, we can |
34 | * place them in here for processing the next time the Host wants. | 38 | * place them in here for processing the next time the Host wants. |
35 | * This batching can be quite efficient. */ | 39 | * This batching can be quite efficient. */ |
diff --git a/include/linux/lguest_launcher.h b/include/linux/lguest_launcher.h index a53407a4165c..bfefbdf7498a 100644 --- a/include/linux/lguest_launcher.h +++ b/include/linux/lguest_launcher.h | |||
@@ -57,7 +57,8 @@ enum lguest_req | |||
57 | LHREQ_INITIALIZE, /* + base, pfnlimit, start */ | 57 | LHREQ_INITIALIZE, /* + base, pfnlimit, start */ |
58 | LHREQ_GETDMA, /* No longer used */ | 58 | LHREQ_GETDMA, /* No longer used */ |
59 | LHREQ_IRQ, /* + irq */ | 59 | LHREQ_IRQ, /* + irq */ |
60 | LHREQ_BREAK, /* + on/off flag (on blocks until someone does off) */ | 60 | LHREQ_BREAK, /* No longer used */ |
61 | LHREQ_EVENTFD, /* + address, fd. */ | ||
61 | }; | 62 | }; |
62 | 63 | ||
63 | /* The alignment to use between consumer and producer parts of vring. | 64 | /* The alignment to use between consumer and producer parts of vring. |
diff --git a/include/linux/libata.h b/include/linux/libata.h index 3d501db36a26..79b6d7fd4ac2 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -385,6 +385,7 @@ enum { | |||
385 | not multiple of 16 bytes */ | 385 | not multiple of 16 bytes */ |
386 | ATA_HORKAGE_FIRMWARE_WARN = (1 << 12), /* firmware update warning */ | 386 | ATA_HORKAGE_FIRMWARE_WARN = (1 << 12), /* firmware update warning */ |
387 | ATA_HORKAGE_1_5_GBPS = (1 << 13), /* force 1.5 Gbps */ | 387 | ATA_HORKAGE_1_5_GBPS = (1 << 13), /* force 1.5 Gbps */ |
388 | ATA_HORKAGE_NOSETXFER = (1 << 14), /* skip SETXFER, SATA only */ | ||
388 | 389 | ||
389 | /* DMA mask for user DMA control: User visible values; DO NOT | 390 | /* DMA mask for user DMA control: User visible values; DO NOT |
390 | renumber */ | 391 | renumber */ |
diff --git a/include/linux/linkage.h b/include/linux/linkage.h index fee9e59649c1..691f59171c6c 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h | |||
@@ -22,6 +22,15 @@ | |||
22 | #define __page_aligned_bss __section(.bss.page_aligned) __aligned(PAGE_SIZE) | 22 | #define __page_aligned_bss __section(.bss.page_aligned) __aligned(PAGE_SIZE) |
23 | 23 | ||
24 | /* | 24 | /* |
25 | * For assembly routines. | ||
26 | * | ||
27 | * Note when using these that you must specify the appropriate | ||
28 | * alignment directives yourself | ||
29 | */ | ||
30 | #define __PAGE_ALIGNED_DATA .section ".data.page_aligned", "aw" | ||
31 | #define __PAGE_ALIGNED_BSS .section ".bss.page_aligned", "aw" | ||
32 | |||
33 | /* | ||
25 | * This is used by architectures to keep arguments on the stack | 34 | * This is used by architectures to keep arguments on the stack |
26 | * untouched by the compiler by keeping them live until the end. | 35 | * untouched by the compiler by keeping them live until the end. |
27 | * The argument stack may be owned by the assembly-language | 36 | * The argument stack may be owned by the assembly-language |
diff --git a/include/linux/linux_logo.h b/include/linux/linux_logo.h index 08a92969c76e..ca5bd91d12e1 100644 --- a/include/linux/linux_logo.h +++ b/include/linux/linux_logo.h | |||
@@ -32,6 +32,22 @@ struct linux_logo { | |||
32 | const unsigned char *data; | 32 | const unsigned char *data; |
33 | }; | 33 | }; |
34 | 34 | ||
35 | extern const struct linux_logo logo_linux_mono; | ||
36 | extern const struct linux_logo logo_linux_vga16; | ||
37 | extern const struct linux_logo logo_linux_clut224; | ||
38 | extern const struct linux_logo logo_blackfin_vga16; | ||
39 | extern const struct linux_logo logo_blackfin_clut224; | ||
40 | extern const struct linux_logo logo_dec_clut224; | ||
41 | extern const struct linux_logo logo_mac_clut224; | ||
42 | extern const struct linux_logo logo_parisc_clut224; | ||
43 | extern const struct linux_logo logo_sgi_clut224; | ||
44 | extern const struct linux_logo logo_sun_clut224; | ||
45 | extern const struct linux_logo logo_superh_mono; | ||
46 | extern const struct linux_logo logo_superh_vga16; | ||
47 | extern const struct linux_logo logo_superh_clut224; | ||
48 | extern const struct linux_logo logo_m32r_clut224; | ||
49 | extern const struct linux_logo logo_spe_clut224; | ||
50 | |||
35 | extern const struct linux_logo *fb_find_logo(int depth); | 51 | extern const struct linux_logo *fb_find_logo(int depth); |
36 | #ifdef CONFIG_FB_LOGO_EXTRA | 52 | #ifdef CONFIG_FB_LOGO_EXTRA |
37 | extern void fb_append_extra_logo(const struct linux_logo *logo, | 53 | extern void fb_append_extra_logo(const struct linux_logo *logo, |
diff --git a/include/linux/lis3lv02d.h b/include/linux/lis3lv02d.h new file mode 100644 index 000000000000..ad651f4e45ac --- /dev/null +++ b/include/linux/lis3lv02d.h | |||
@@ -0,0 +1,39 @@ | |||
1 | #ifndef __LIS3LV02D_H_ | ||
2 | #define __LIS3LV02D_H_ | ||
3 | |||
4 | struct lis3lv02d_platform_data { | ||
5 | /* please note: the 'click' feature is only supported for | ||
6 | * LIS[32]02DL variants of the chip and will be ignored for | ||
7 | * others */ | ||
8 | #define LIS3_CLICK_SINGLE_X (1 << 0) | ||
9 | #define LIS3_CLICK_DOUBLE_X (1 << 1) | ||
10 | #define LIS3_CLICK_SINGLE_Y (1 << 2) | ||
11 | #define LIS3_CLICK_DOUBLE_Y (1 << 3) | ||
12 | #define LIS3_CLICK_SINGLE_Z (1 << 4) | ||
13 | #define LIS3_CLICK_DOUBLE_Z (1 << 5) | ||
14 | unsigned char click_flags; | ||
15 | unsigned char click_thresh_x; | ||
16 | unsigned char click_thresh_y; | ||
17 | unsigned char click_thresh_z; | ||
18 | unsigned char click_time_limit; | ||
19 | unsigned char click_latency; | ||
20 | unsigned char click_window; | ||
21 | |||
22 | #define LIS3_IRQ1_DISABLE (0 << 0) | ||
23 | #define LIS3_IRQ1_FF_WU_1 (1 << 0) | ||
24 | #define LIS3_IRQ1_FF_WU_2 (2 << 0) | ||
25 | #define LIS3_IRQ1_FF_WU_12 (3 << 0) | ||
26 | #define LIS3_IRQ1_DATA_READY (4 << 0) | ||
27 | #define LIS3_IRQ1_CLICK (7 << 0) | ||
28 | #define LIS3_IRQ2_DISABLE (0 << 3) | ||
29 | #define LIS3_IRQ2_FF_WU_1 (1 << 3) | ||
30 | #define LIS3_IRQ2_FF_WU_2 (2 << 3) | ||
31 | #define LIS3_IRQ2_FF_WU_12 (3 << 3) | ||
32 | #define LIS3_IRQ2_DATA_READY (4 << 3) | ||
33 | #define LIS3_IRQ2_CLICK (7 << 3) | ||
34 | #define LIS3_IRQ_OPEN_DRAIN (1 << 6) | ||
35 | #define LIS3_IRQ_ACTIVE_HIGH (1 << 7) | ||
36 | unsigned char irq_cfg; | ||
37 | }; | ||
38 | |||
39 | #endif /* __LIS3LV02D_H_ */ | ||
diff --git a/include/linux/list_nulls.h b/include/linux/list_nulls.h index 93150ecf3ea4..5d10ae364b5e 100644 --- a/include/linux/list_nulls.h +++ b/include/linux/list_nulls.h | |||
@@ -56,6 +56,18 @@ static inline int hlist_nulls_empty(const struct hlist_nulls_head *h) | |||
56 | return is_a_nulls(h->first); | 56 | return is_a_nulls(h->first); |
57 | } | 57 | } |
58 | 58 | ||
59 | static inline void hlist_nulls_add_head(struct hlist_nulls_node *n, | ||
60 | struct hlist_nulls_head *h) | ||
61 | { | ||
62 | struct hlist_nulls_node *first = h->first; | ||
63 | |||
64 | n->next = first; | ||
65 | n->pprev = &h->first; | ||
66 | h->first = n; | ||
67 | if (!is_a_nulls(first)) | ||
68 | first->pprev = &n->next; | ||
69 | } | ||
70 | |||
59 | static inline void __hlist_nulls_del(struct hlist_nulls_node *n) | 71 | static inline void __hlist_nulls_del(struct hlist_nulls_node *n) |
60 | { | 72 | { |
61 | struct hlist_nulls_node *next = n->next; | 73 | struct hlist_nulls_node *next = n->next; |
@@ -65,6 +77,12 @@ static inline void __hlist_nulls_del(struct hlist_nulls_node *n) | |||
65 | next->pprev = pprev; | 77 | next->pprev = pprev; |
66 | } | 78 | } |
67 | 79 | ||
80 | static inline void hlist_nulls_del(struct hlist_nulls_node *n) | ||
81 | { | ||
82 | __hlist_nulls_del(n); | ||
83 | n->pprev = LIST_POISON2; | ||
84 | } | ||
85 | |||
68 | /** | 86 | /** |
69 | * hlist_nulls_for_each_entry - iterate over list of given type | 87 | * hlist_nulls_for_each_entry - iterate over list of given type |
70 | * @tpos: the type * to use as a loop cursor. | 88 | * @tpos: the type * to use as a loop cursor. |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 51855dfd8adb..c325b187966b 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
@@ -195,7 +195,7 @@ extern struct svc_procedure nlmsvc_procedures4[]; | |||
195 | extern int nlmsvc_grace_period; | 195 | extern int nlmsvc_grace_period; |
196 | extern unsigned long nlmsvc_timeout; | 196 | extern unsigned long nlmsvc_timeout; |
197 | extern int nsm_use_hostnames; | 197 | extern int nsm_use_hostnames; |
198 | extern int nsm_local_state; | 198 | extern u32 nsm_local_state; |
199 | 199 | ||
200 | /* | 200 | /* |
201 | * Lockd client functions | 201 | * Lockd client functions |
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index da5a5a1f4cd2..b25d1b53df0d 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
@@ -258,6 +258,16 @@ extern void lockdep_init_map(struct lockdep_map *lock, const char *name, | |||
258 | #define lockdep_set_subclass(lock, sub) \ | 258 | #define lockdep_set_subclass(lock, sub) \ |
259 | lockdep_init_map(&(lock)->dep_map, #lock, \ | 259 | lockdep_init_map(&(lock)->dep_map, #lock, \ |
260 | (lock)->dep_map.key, sub) | 260 | (lock)->dep_map.key, sub) |
261 | /* | ||
262 | * Compare locking classes | ||
263 | */ | ||
264 | #define lockdep_match_class(lock, key) lockdep_match_key(&(lock)->dep_map, key) | ||
265 | |||
266 | static inline int lockdep_match_key(struct lockdep_map *lock, | ||
267 | struct lock_class_key *key) | ||
268 | { | ||
269 | return lock->key == key; | ||
270 | } | ||
261 | 271 | ||
262 | /* | 272 | /* |
263 | * Acquire a lock. | 273 | * Acquire a lock. |
@@ -326,6 +336,11 @@ static inline void lockdep_on(void) | |||
326 | #define lockdep_set_class_and_subclass(lock, key, sub) \ | 336 | #define lockdep_set_class_and_subclass(lock, key, sub) \ |
327 | do { (void)(key); } while (0) | 337 | do { (void)(key); } while (0) |
328 | #define lockdep_set_subclass(lock, sub) do { } while (0) | 338 | #define lockdep_set_subclass(lock, sub) do { } while (0) |
339 | /* | ||
340 | * We don't define lockdep_match_class() and lockdep_match_key() for !LOCKDEP | ||
341 | * case since the result is not well defined and the caller should rather | ||
342 | * #ifdef the call himself. | ||
343 | */ | ||
329 | 344 | ||
330 | # define INIT_LOCKDEP | 345 | # define INIT_LOCKDEP |
331 | # define lockdep_reset() do { debug_locks = 1; } while (0) | 346 | # define lockdep_reset() do { debug_locks = 1; } while (0) |
diff --git a/include/linux/mISDNdsp.h b/include/linux/mISDNdsp.h index 6b71d2dce508..41d1eeb9b3bd 100644 --- a/include/linux/mISDNdsp.h +++ b/include/linux/mISDNdsp.h | |||
@@ -12,7 +12,8 @@ struct mISDN_dsp_element { | |||
12 | void *(*new)(const char *arg); | 12 | void *(*new)(const char *arg); |
13 | void (*free)(void *p); | 13 | void (*free)(void *p); |
14 | void (*process_tx)(void *p, unsigned char *data, int len); | 14 | void (*process_tx)(void *p, unsigned char *data, int len); |
15 | void (*process_rx)(void *p, unsigned char *data, int len); | 15 | void (*process_rx)(void *p, unsigned char *data, int len, |
16 | unsigned int txlen); | ||
16 | int num_args; | 17 | int num_args; |
17 | struct mISDN_dsp_element_arg | 18 | struct mISDN_dsp_element_arg |
18 | *args; | 19 | *args; |
@@ -24,6 +25,7 @@ extern void mISDN_dsp_element_unregister(struct mISDN_dsp_element *elem); | |||
24 | struct dsp_features { | 25 | struct dsp_features { |
25 | int hfc_id; /* unique id to identify the chip (or -1) */ | 26 | int hfc_id; /* unique id to identify the chip (or -1) */ |
26 | int hfc_dtmf; /* set if HFCmulti card supports dtmf */ | 27 | int hfc_dtmf; /* set if HFCmulti card supports dtmf */ |
28 | int hfc_conf; /* set if HFCmulti card supports conferences */ | ||
27 | int hfc_loops; /* set if card supports tone loops */ | 29 | int hfc_loops; /* set if card supports tone loops */ |
28 | int hfc_echocanhw; /* set if card supports echocancelation*/ | 30 | int hfc_echocanhw; /* set if card supports echocancelation*/ |
29 | int pcm_id; /* unique id to identify the pcm bus (or -1) */ | 31 | int pcm_id; /* unique id to identify the pcm bus (or -1) */ |
diff --git a/include/linux/mISDNhw.h b/include/linux/mISDNhw.h index 97ffdc1d3442..7f9831da847f 100644 --- a/include/linux/mISDNhw.h +++ b/include/linux/mISDNhw.h | |||
@@ -89,11 +89,6 @@ struct dchannel { | |||
89 | void (*phfunc) (struct dchannel *); | 89 | void (*phfunc) (struct dchannel *); |
90 | u_int state; | 90 | u_int state; |
91 | void *l1; | 91 | void *l1; |
92 | /* HW access */ | ||
93 | u_char (*read_reg) (void *, u_char); | ||
94 | void (*write_reg) (void *, u_char, u_char); | ||
95 | void (*read_fifo) (void *, u_char *, int); | ||
96 | void (*write_fifo) (void *, u_char *, int); | ||
97 | void *hw; | 92 | void *hw; |
98 | int slot; /* multiport card channel slot */ | 93 | int slot; /* multiport card channel slot */ |
99 | struct timer_list timer; | 94 | struct timer_list timer; |
@@ -151,11 +146,6 @@ struct bchannel { | |||
151 | u_long Flags; | 146 | u_long Flags; |
152 | struct work_struct workq; | 147 | struct work_struct workq; |
153 | u_int state; | 148 | u_int state; |
154 | /* HW access */ | ||
155 | u_char (*read_reg) (void *, u_char); | ||
156 | void (*write_reg) (void *, u_char, u_char); | ||
157 | void (*read_fifo) (void *, u_char *, int); | ||
158 | void (*write_fifo) (void *, u_char *, int); | ||
159 | void *hw; | 149 | void *hw; |
160 | int slot; /* multiport card channel slot */ | 150 | int slot; /* multiport card channel slot */ |
161 | struct timer_list timer; | 151 | struct timer_list timer; |
@@ -185,7 +175,7 @@ extern int dchannel_senddata(struct dchannel *, struct sk_buff *); | |||
185 | extern int bchannel_senddata(struct bchannel *, struct sk_buff *); | 175 | extern int bchannel_senddata(struct bchannel *, struct sk_buff *); |
186 | extern void recv_Dchannel(struct dchannel *); | 176 | extern void recv_Dchannel(struct dchannel *); |
187 | extern void recv_Echannel(struct dchannel *, struct dchannel *); | 177 | extern void recv_Echannel(struct dchannel *, struct dchannel *); |
188 | extern void recv_Bchannel(struct bchannel *); | 178 | extern void recv_Bchannel(struct bchannel *, unsigned int id); |
189 | extern void recv_Dchannel_skb(struct dchannel *, struct sk_buff *); | 179 | extern void recv_Dchannel_skb(struct dchannel *, struct sk_buff *); |
190 | extern void recv_Bchannel_skb(struct bchannel *, struct sk_buff *); | 180 | extern void recv_Bchannel_skb(struct bchannel *, struct sk_buff *); |
191 | extern void confirm_Bsend(struct bchannel *bch); | 181 | extern void confirm_Bsend(struct bchannel *bch); |
diff --git a/include/linux/mISDNif.h b/include/linux/mISDNif.h index 5da3d95b27f1..45100b39a7cf 100644 --- a/include/linux/mISDNif.h +++ b/include/linux/mISDNif.h | |||
@@ -229,6 +229,7 @@ | |||
229 | #define OPTION_L2_PTP 2 | 229 | #define OPTION_L2_PTP 2 |
230 | #define OPTION_L2_FIXEDTEI 3 | 230 | #define OPTION_L2_FIXEDTEI 3 |
231 | #define OPTION_L2_CLEANUP 4 | 231 | #define OPTION_L2_CLEANUP 4 |
232 | #define OPTION_L1_HOLD 5 | ||
232 | 233 | ||
233 | /* should be in sync with linux/kobject.h:KOBJ_NAME_LEN */ | 234 | /* should be in sync with linux/kobject.h:KOBJ_NAME_LEN */ |
234 | #define MISDN_MAX_IDLEN 20 | 235 | #define MISDN_MAX_IDLEN 20 |
@@ -291,19 +292,19 @@ struct mISDN_devrename { | |||
291 | 292 | ||
292 | /* MPH_INFORMATION_REQ payload */ | 293 | /* MPH_INFORMATION_REQ payload */ |
293 | struct ph_info_ch { | 294 | struct ph_info_ch { |
294 | __u32 protocol; | 295 | __u32 protocol; |
295 | __u64 Flags; | 296 | __u64 Flags; |
296 | }; | 297 | }; |
297 | 298 | ||
298 | struct ph_info_dch { | 299 | struct ph_info_dch { |
299 | struct ph_info_ch ch; | 300 | struct ph_info_ch ch; |
300 | __u16 state; | 301 | __u16 state; |
301 | __u16 num_bch; | 302 | __u16 num_bch; |
302 | }; | 303 | }; |
303 | 304 | ||
304 | struct ph_info { | 305 | struct ph_info { |
305 | struct ph_info_dch dch; | 306 | struct ph_info_dch dch; |
306 | struct ph_info_ch bch[]; | 307 | struct ph_info_ch bch[]; |
307 | }; | 308 | }; |
308 | 309 | ||
309 | /* timer device ioctl */ | 310 | /* timer device ioctl */ |
@@ -317,6 +318,7 @@ struct ph_info { | |||
317 | #define IMCTRLREQ _IOR('I', 69, int) | 318 | #define IMCTRLREQ _IOR('I', 69, int) |
318 | #define IMCLEAR_L2 _IOR('I', 70, int) | 319 | #define IMCLEAR_L2 _IOR('I', 70, int) |
319 | #define IMSETDEVNAME _IOR('I', 71, struct mISDN_devrename) | 320 | #define IMSETDEVNAME _IOR('I', 71, struct mISDN_devrename) |
321 | #define IMHOLD_L1 _IOR('I', 72, int) | ||
320 | 322 | ||
321 | static inline int | 323 | static inline int |
322 | test_channelmap(u_int nr, u_char *map) | 324 | test_channelmap(u_int nr, u_char *map) |
@@ -362,7 +364,8 @@ clear_channelmap(u_int nr, u_char *map) | |||
362 | #define MISDN_CTRL_HFC_RECEIVE_ON 0x4006 | 364 | #define MISDN_CTRL_HFC_RECEIVE_ON 0x4006 |
363 | #define MISDN_CTRL_HFC_ECHOCAN_ON 0x4007 | 365 | #define MISDN_CTRL_HFC_ECHOCAN_ON 0x4007 |
364 | #define MISDN_CTRL_HFC_ECHOCAN_OFF 0x4008 | 366 | #define MISDN_CTRL_HFC_ECHOCAN_OFF 0x4008 |
365 | 367 | #define MISDN_CTRL_HFC_WD_INIT 0x4009 | |
368 | #define MISDN_CTRL_HFC_WD_RESET 0x400A | ||
366 | 369 | ||
367 | /* socket options */ | 370 | /* socket options */ |
368 | #define MISDN_TIME_STAMP 0x0001 | 371 | #define MISDN_TIME_STAMP 0x0001 |
diff --git a/include/linux/major.h b/include/linux/major.h index 058ec15dd060..6a8ca98c9a96 100644 --- a/include/linux/major.h +++ b/include/linux/major.h | |||
@@ -145,6 +145,7 @@ | |||
145 | #define UNIX98_PTY_MAJOR_COUNT 8 | 145 | #define UNIX98_PTY_MAJOR_COUNT 8 |
146 | #define UNIX98_PTY_SLAVE_MAJOR (UNIX98_PTY_MASTER_MAJOR+UNIX98_PTY_MAJOR_COUNT) | 146 | #define UNIX98_PTY_SLAVE_MAJOR (UNIX98_PTY_MASTER_MAJOR+UNIX98_PTY_MAJOR_COUNT) |
147 | 147 | ||
148 | #define DRBD_MAJOR 147 | ||
148 | #define RTF_MAJOR 150 | 149 | #define RTF_MAJOR 150 |
149 | #define RAW_MAJOR 162 | 150 | #define RAW_MAJOR 162 |
150 | 151 | ||
diff --git a/include/linux/max17040_battery.h b/include/linux/max17040_battery.h new file mode 100644 index 000000000000..ad97b06cf930 --- /dev/null +++ b/include/linux/max17040_battery.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 Samsung Electronics | ||
3 | * Minkyu Kang <mk7.kang@samsung.com> | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License version 2 as | ||
7 | * published by the Free Software Foundation. | ||
8 | */ | ||
9 | |||
10 | #ifndef __MAX17040_BATTERY_H_ | ||
11 | #define __MAX17040_BATTERY_H_ | ||
12 | |||
13 | struct max17040_platform_data { | ||
14 | int (*battery_online)(void); | ||
15 | int (*charger_online)(void); | ||
16 | int (*charger_enable)(void); | ||
17 | }; | ||
18 | |||
19 | #endif | ||
diff --git a/include/linux/mdio.h b/include/linux/mdio.h new file mode 100644 index 000000000000..cfdf1df2875e --- /dev/null +++ b/include/linux/mdio.h | |||
@@ -0,0 +1,356 @@ | |||
1 | /* | ||
2 | * linux/mdio.h: definitions for MDIO (clause 45) transceivers | ||
3 | * Copyright 2006-2009 Solarflare Communications Inc. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms of the GNU General Public License version 2 as published | ||
7 | * by the Free Software Foundation, incorporated herein by reference. | ||
8 | */ | ||
9 | |||
10 | #ifndef __LINUX_MDIO_H__ | ||
11 | #define __LINUX_MDIO_H__ | ||
12 | |||
13 | #include <linux/mii.h> | ||
14 | |||
15 | /* MDIO Manageable Devices (MMDs). */ | ||
16 | #define MDIO_MMD_PMAPMD 1 /* Physical Medium Attachment/ | ||
17 | * Physical Medium Dependent */ | ||
18 | #define MDIO_MMD_WIS 2 /* WAN Interface Sublayer */ | ||
19 | #define MDIO_MMD_PCS 3 /* Physical Coding Sublayer */ | ||
20 | #define MDIO_MMD_PHYXS 4 /* PHY Extender Sublayer */ | ||
21 | #define MDIO_MMD_DTEXS 5 /* DTE Extender Sublayer */ | ||
22 | #define MDIO_MMD_TC 6 /* Transmission Convergence */ | ||
23 | #define MDIO_MMD_AN 7 /* Auto-Negotiation */ | ||
24 | #define MDIO_MMD_C22EXT 29 /* Clause 22 extension */ | ||
25 | #define MDIO_MMD_VEND1 30 /* Vendor specific 1 */ | ||
26 | #define MDIO_MMD_VEND2 31 /* Vendor specific 2 */ | ||
27 | |||
28 | /* Generic MDIO registers. */ | ||
29 | #define MDIO_CTRL1 MII_BMCR | ||
30 | #define MDIO_STAT1 MII_BMSR | ||
31 | #define MDIO_DEVID1 MII_PHYSID1 | ||
32 | #define MDIO_DEVID2 MII_PHYSID2 | ||
33 | #define MDIO_SPEED 4 /* Speed ability */ | ||
34 | #define MDIO_DEVS1 5 /* Devices in package */ | ||
35 | #define MDIO_DEVS2 6 | ||
36 | #define MDIO_CTRL2 7 /* 10G control 2 */ | ||
37 | #define MDIO_STAT2 8 /* 10G status 2 */ | ||
38 | #define MDIO_PMA_TXDIS 9 /* 10G PMA/PMD transmit disable */ | ||
39 | #define MDIO_PMA_RXDET 10 /* 10G PMA/PMD receive signal detect */ | ||
40 | #define MDIO_PMA_EXTABLE 11 /* 10G PMA/PMD extended ability */ | ||
41 | #define MDIO_PKGID1 14 /* Package identifier */ | ||
42 | #define MDIO_PKGID2 15 | ||
43 | #define MDIO_AN_ADVERTISE 16 /* AN advertising (base page) */ | ||
44 | #define MDIO_AN_LPA 19 /* AN LP abilities (base page) */ | ||
45 | #define MDIO_PHYXS_LNSTAT 24 /* PHY XGXS lane state */ | ||
46 | |||
47 | /* Media-dependent registers. */ | ||
48 | #define MDIO_PMA_10GBT_SWAPPOL 130 /* 10GBASE-T pair swap & polarity */ | ||
49 | #define MDIO_PMA_10GBT_TXPWR 131 /* 10GBASE-T TX power control */ | ||
50 | #define MDIO_PMA_10GBT_SNR 133 /* 10GBASE-T SNR margin, lane A. | ||
51 | * Lanes B-D are numbered 134-136. */ | ||
52 | #define MDIO_PMA_10GBR_FECABLE 170 /* 10GBASE-R FEC ability */ | ||
53 | #define MDIO_PCS_10GBX_STAT1 24 /* 10GBASE-X PCS status 1 */ | ||
54 | #define MDIO_PCS_10GBRT_STAT1 32 /* 10GBASE-R/-T PCS status 1 */ | ||
55 | #define MDIO_PCS_10GBRT_STAT2 33 /* 10GBASE-R/-T PCS status 2 */ | ||
56 | #define MDIO_AN_10GBT_CTRL 32 /* 10GBASE-T auto-negotiation control */ | ||
57 | #define MDIO_AN_10GBT_STAT 33 /* 10GBASE-T auto-negotiation status */ | ||
58 | |||
59 | /* LASI (Link Alarm Status Interrupt) registers, defined by XENPAK MSA. */ | ||
60 | #define MDIO_PMA_LASI_RXCTRL 0x9000 /* RX_ALARM control */ | ||
61 | #define MDIO_PMA_LASI_TXCTRL 0x9001 /* TX_ALARM control */ | ||
62 | #define MDIO_PMA_LASI_CTRL 0x9002 /* LASI control */ | ||
63 | #define MDIO_PMA_LASI_RXSTAT 0x9003 /* RX_ALARM status */ | ||
64 | #define MDIO_PMA_LASI_TXSTAT 0x9004 /* TX_ALARM status */ | ||
65 | #define MDIO_PMA_LASI_STAT 0x9005 /* LASI status */ | ||
66 | |||
67 | /* Control register 1. */ | ||
68 | /* Enable extended speed selection */ | ||
69 | #define MDIO_CTRL1_SPEEDSELEXT (BMCR_SPEED1000 | BMCR_SPEED100) | ||
70 | /* All speed selection bits */ | ||
71 | #define MDIO_CTRL1_SPEEDSEL (MDIO_CTRL1_SPEEDSELEXT | 0x003c) | ||
72 | #define MDIO_CTRL1_FULLDPLX BMCR_FULLDPLX | ||
73 | #define MDIO_CTRL1_LPOWER BMCR_PDOWN | ||
74 | #define MDIO_CTRL1_RESET BMCR_RESET | ||
75 | #define MDIO_PMA_CTRL1_LOOPBACK 0x0001 | ||
76 | #define MDIO_PMA_CTRL1_SPEED1000 BMCR_SPEED1000 | ||
77 | #define MDIO_PMA_CTRL1_SPEED100 BMCR_SPEED100 | ||
78 | #define MDIO_PCS_CTRL1_LOOPBACK BMCR_LOOPBACK | ||
79 | #define MDIO_PHYXS_CTRL1_LOOPBACK BMCR_LOOPBACK | ||
80 | #define MDIO_AN_CTRL1_RESTART BMCR_ANRESTART | ||
81 | #define MDIO_AN_CTRL1_ENABLE BMCR_ANENABLE | ||
82 | #define MDIO_AN_CTRL1_XNP 0x2000 /* Enable extended next page */ | ||
83 | |||
84 | /* 10 Gb/s */ | ||
85 | #define MDIO_CTRL1_SPEED10G (MDIO_CTRL1_SPEEDSELEXT | 0x00) | ||
86 | /* 10PASS-TS/2BASE-TL */ | ||
87 | #define MDIO_CTRL1_SPEED10P2B (MDIO_CTRL1_SPEEDSELEXT | 0x04) | ||
88 | |||
89 | /* Status register 1. */ | ||
90 | #define MDIO_STAT1_LPOWERABLE 0x0002 /* Low-power ability */ | ||
91 | #define MDIO_STAT1_LSTATUS BMSR_LSTATUS | ||
92 | #define MDIO_STAT1_FAULT 0x0080 /* Fault */ | ||
93 | #define MDIO_AN_STAT1_LPABLE 0x0001 /* Link partner AN ability */ | ||
94 | #define MDIO_AN_STAT1_ABLE BMSR_ANEGCAPABLE | ||
95 | #define MDIO_AN_STAT1_RFAULT BMSR_RFAULT | ||
96 | #define MDIO_AN_STAT1_COMPLETE BMSR_ANEGCOMPLETE | ||
97 | #define MDIO_AN_STAT1_PAGE 0x0040 /* Page received */ | ||
98 | #define MDIO_AN_STAT1_XNP 0x0080 /* Extended next page status */ | ||
99 | |||
100 | /* Speed register. */ | ||
101 | #define MDIO_SPEED_10G 0x0001 /* 10G capable */ | ||
102 | #define MDIO_PMA_SPEED_2B 0x0002 /* 2BASE-TL capable */ | ||
103 | #define MDIO_PMA_SPEED_10P 0x0004 /* 10PASS-TS capable */ | ||
104 | #define MDIO_PMA_SPEED_1000 0x0010 /* 1000M capable */ | ||
105 | #define MDIO_PMA_SPEED_100 0x0020 /* 100M capable */ | ||
106 | #define MDIO_PMA_SPEED_10 0x0040 /* 10M capable */ | ||
107 | #define MDIO_PCS_SPEED_10P2B 0x0002 /* 10PASS-TS/2BASE-TL capable */ | ||
108 | |||
109 | /* Device present registers. */ | ||
110 | #define MDIO_DEVS_PRESENT(devad) (1 << (devad)) | ||
111 | #define MDIO_DEVS_PMAPMD MDIO_DEVS_PRESENT(MDIO_MMD_PMAPMD) | ||
112 | #define MDIO_DEVS_WIS MDIO_DEVS_PRESENT(MDIO_MMD_WIS) | ||
113 | #define MDIO_DEVS_PCS MDIO_DEVS_PRESENT(MDIO_MMD_PCS) | ||
114 | #define MDIO_DEVS_PHYXS MDIO_DEVS_PRESENT(MDIO_MMD_PHYXS) | ||
115 | #define MDIO_DEVS_DTEXS MDIO_DEVS_PRESENT(MDIO_MMD_DTEXS) | ||
116 | #define MDIO_DEVS_TC MDIO_DEVS_PRESENT(MDIO_MMD_TC) | ||
117 | #define MDIO_DEVS_AN MDIO_DEVS_PRESENT(MDIO_MMD_AN) | ||
118 | #define MDIO_DEVS_C22EXT MDIO_DEVS_PRESENT(MDIO_MMD_C22EXT) | ||
119 | |||
120 | /* Control register 2. */ | ||
121 | #define MDIO_PMA_CTRL2_TYPE 0x000f /* PMA/PMD type selection */ | ||
122 | #define MDIO_PMA_CTRL2_10GBCX4 0x0000 /* 10GBASE-CX4 type */ | ||
123 | #define MDIO_PMA_CTRL2_10GBEW 0x0001 /* 10GBASE-EW type */ | ||
124 | #define MDIO_PMA_CTRL2_10GBLW 0x0002 /* 10GBASE-LW type */ | ||
125 | #define MDIO_PMA_CTRL2_10GBSW 0x0003 /* 10GBASE-SW type */ | ||
126 | #define MDIO_PMA_CTRL2_10GBLX4 0x0004 /* 10GBASE-LX4 type */ | ||
127 | #define MDIO_PMA_CTRL2_10GBER 0x0005 /* 10GBASE-ER type */ | ||
128 | #define MDIO_PMA_CTRL2_10GBLR 0x0006 /* 10GBASE-LR type */ | ||
129 | #define MDIO_PMA_CTRL2_10GBSR 0x0007 /* 10GBASE-SR type */ | ||
130 | #define MDIO_PMA_CTRL2_10GBLRM 0x0008 /* 10GBASE-LRM type */ | ||
131 | #define MDIO_PMA_CTRL2_10GBT 0x0009 /* 10GBASE-T type */ | ||
132 | #define MDIO_PMA_CTRL2_10GBKX4 0x000a /* 10GBASE-KX4 type */ | ||
133 | #define MDIO_PMA_CTRL2_10GBKR 0x000b /* 10GBASE-KR type */ | ||
134 | #define MDIO_PMA_CTRL2_1000BT 0x000c /* 1000BASE-T type */ | ||
135 | #define MDIO_PMA_CTRL2_1000BKX 0x000d /* 1000BASE-KX type */ | ||
136 | #define MDIO_PMA_CTRL2_100BTX 0x000e /* 100BASE-TX type */ | ||
137 | #define MDIO_PMA_CTRL2_10BT 0x000f /* 10BASE-T type */ | ||
138 | #define MDIO_PCS_CTRL2_TYPE 0x0003 /* PCS type selection */ | ||
139 | #define MDIO_PCS_CTRL2_10GBR 0x0000 /* 10GBASE-R type */ | ||
140 | #define MDIO_PCS_CTRL2_10GBX 0x0001 /* 10GBASE-X type */ | ||
141 | #define MDIO_PCS_CTRL2_10GBW 0x0002 /* 10GBASE-W type */ | ||
142 | #define MDIO_PCS_CTRL2_10GBT 0x0003 /* 10GBASE-T type */ | ||
143 | |||
144 | /* Status register 2. */ | ||
145 | #define MDIO_STAT2_RXFAULT 0x0400 /* Receive fault */ | ||
146 | #define MDIO_STAT2_TXFAULT 0x0800 /* Transmit fault */ | ||
147 | #define MDIO_STAT2_DEVPRST 0xc000 /* Device present */ | ||
148 | #define MDIO_STAT2_DEVPRST_VAL 0x8000 /* Device present value */ | ||
149 | #define MDIO_PMA_STAT2_LBABLE 0x0001 /* PMA loopback ability */ | ||
150 | #define MDIO_PMA_STAT2_10GBEW 0x0002 /* 10GBASE-EW ability */ | ||
151 | #define MDIO_PMA_STAT2_10GBLW 0x0004 /* 10GBASE-LW ability */ | ||
152 | #define MDIO_PMA_STAT2_10GBSW 0x0008 /* 10GBASE-SW ability */ | ||
153 | #define MDIO_PMA_STAT2_10GBLX4 0x0010 /* 10GBASE-LX4 ability */ | ||
154 | #define MDIO_PMA_STAT2_10GBER 0x0020 /* 10GBASE-ER ability */ | ||
155 | #define MDIO_PMA_STAT2_10GBLR 0x0040 /* 10GBASE-LR ability */ | ||
156 | #define MDIO_PMA_STAT2_10GBSR 0x0080 /* 10GBASE-SR ability */ | ||
157 | #define MDIO_PMD_STAT2_TXDISAB 0x0100 /* PMD TX disable ability */ | ||
158 | #define MDIO_PMA_STAT2_EXTABLE 0x0200 /* Extended abilities */ | ||
159 | #define MDIO_PMA_STAT2_RXFLTABLE 0x1000 /* Receive fault ability */ | ||
160 | #define MDIO_PMA_STAT2_TXFLTABLE 0x2000 /* Transmit fault ability */ | ||
161 | #define MDIO_PCS_STAT2_10GBR 0x0001 /* 10GBASE-R capable */ | ||
162 | #define MDIO_PCS_STAT2_10GBX 0x0002 /* 10GBASE-X capable */ | ||
163 | #define MDIO_PCS_STAT2_10GBW 0x0004 /* 10GBASE-W capable */ | ||
164 | #define MDIO_PCS_STAT2_RXFLTABLE 0x1000 /* Receive fault ability */ | ||
165 | #define MDIO_PCS_STAT2_TXFLTABLE 0x2000 /* Transmit fault ability */ | ||
166 | |||
167 | /* Transmit disable register. */ | ||
168 | #define MDIO_PMD_TXDIS_GLOBAL 0x0001 /* Global PMD TX disable */ | ||
169 | #define MDIO_PMD_TXDIS_0 0x0002 /* PMD TX disable 0 */ | ||
170 | #define MDIO_PMD_TXDIS_1 0x0004 /* PMD TX disable 1 */ | ||
171 | #define MDIO_PMD_TXDIS_2 0x0008 /* PMD TX disable 2 */ | ||
172 | #define MDIO_PMD_TXDIS_3 0x0010 /* PMD TX disable 3 */ | ||
173 | |||
174 | /* Receive signal detect register. */ | ||
175 | #define MDIO_PMD_RXDET_GLOBAL 0x0001 /* Global PMD RX signal detect */ | ||
176 | #define MDIO_PMD_RXDET_0 0x0002 /* PMD RX signal detect 0 */ | ||
177 | #define MDIO_PMD_RXDET_1 0x0004 /* PMD RX signal detect 1 */ | ||
178 | #define MDIO_PMD_RXDET_2 0x0008 /* PMD RX signal detect 2 */ | ||
179 | #define MDIO_PMD_RXDET_3 0x0010 /* PMD RX signal detect 3 */ | ||
180 | |||
181 | /* Extended abilities register. */ | ||
182 | #define MDIO_PMA_EXTABLE_10GCX4 0x0001 /* 10GBASE-CX4 ability */ | ||
183 | #define MDIO_PMA_EXTABLE_10GBLRM 0x0002 /* 10GBASE-LRM ability */ | ||
184 | #define MDIO_PMA_EXTABLE_10GBT 0x0004 /* 10GBASE-T ability */ | ||
185 | #define MDIO_PMA_EXTABLE_10GBKX4 0x0008 /* 10GBASE-KX4 ability */ | ||
186 | #define MDIO_PMA_EXTABLE_10GBKR 0x0010 /* 10GBASE-KR ability */ | ||
187 | #define MDIO_PMA_EXTABLE_1000BT 0x0020 /* 1000BASE-T ability */ | ||
188 | #define MDIO_PMA_EXTABLE_1000BKX 0x0040 /* 1000BASE-KX ability */ | ||
189 | #define MDIO_PMA_EXTABLE_100BTX 0x0080 /* 100BASE-TX ability */ | ||
190 | #define MDIO_PMA_EXTABLE_10BT 0x0100 /* 10BASE-T ability */ | ||
191 | |||
192 | /* PHY XGXS lane state register. */ | ||
193 | #define MDIO_PHYXS_LNSTAT_SYNC0 0x0001 | ||
194 | #define MDIO_PHYXS_LNSTAT_SYNC1 0x0002 | ||
195 | #define MDIO_PHYXS_LNSTAT_SYNC2 0x0004 | ||
196 | #define MDIO_PHYXS_LNSTAT_SYNC3 0x0008 | ||
197 | #define MDIO_PHYXS_LNSTAT_ALIGN 0x1000 | ||
198 | |||
199 | /* PMA 10GBASE-T pair swap & polarity */ | ||
200 | #define MDIO_PMA_10GBT_SWAPPOL_ABNX 0x0001 /* Pair A/B uncrossed */ | ||
201 | #define MDIO_PMA_10GBT_SWAPPOL_CDNX 0x0002 /* Pair C/D uncrossed */ | ||
202 | #define MDIO_PMA_10GBT_SWAPPOL_AREV 0x0100 /* Pair A polarity reversed */ | ||
203 | #define MDIO_PMA_10GBT_SWAPPOL_BREV 0x0200 /* Pair B polarity reversed */ | ||
204 | #define MDIO_PMA_10GBT_SWAPPOL_CREV 0x0400 /* Pair C polarity reversed */ | ||
205 | #define MDIO_PMA_10GBT_SWAPPOL_DREV 0x0800 /* Pair D polarity reversed */ | ||
206 | |||
207 | /* PMA 10GBASE-T TX power register. */ | ||
208 | #define MDIO_PMA_10GBT_TXPWR_SHORT 0x0001 /* Short-reach mode */ | ||
209 | |||
210 | /* PMA 10GBASE-T SNR registers. */ | ||
211 | /* Value is SNR margin in dB, clamped to range [-127, 127], plus 0x8000. */ | ||
212 | #define MDIO_PMA_10GBT_SNR_BIAS 0x8000 | ||
213 | #define MDIO_PMA_10GBT_SNR_MAX 127 | ||
214 | |||
215 | /* PMA 10GBASE-R FEC ability register. */ | ||
216 | #define MDIO_PMA_10GBR_FECABLE_ABLE 0x0001 /* FEC ability */ | ||
217 | #define MDIO_PMA_10GBR_FECABLE_ERRABLE 0x0002 /* FEC error indic. ability */ | ||
218 | |||
219 | /* PCS 10GBASE-R/-T status register 1. */ | ||
220 | #define MDIO_PCS_10GBRT_STAT1_BLKLK 0x0001 /* Block lock attained */ | ||
221 | |||
222 | /* PCS 10GBASE-R/-T status register 2. */ | ||
223 | #define MDIO_PCS_10GBRT_STAT2_ERR 0x00ff | ||
224 | #define MDIO_PCS_10GBRT_STAT2_BER 0x3f00 | ||
225 | |||
226 | /* AN 10GBASE-T control register. */ | ||
227 | #define MDIO_AN_10GBT_CTRL_ADV10G 0x1000 /* Advertise 10GBASE-T */ | ||
228 | |||
229 | /* AN 10GBASE-T status register. */ | ||
230 | #define MDIO_AN_10GBT_STAT_LPTRR 0x0200 /* LP training reset req. */ | ||
231 | #define MDIO_AN_10GBT_STAT_LPLTABLE 0x0400 /* LP loop timing ability */ | ||
232 | #define MDIO_AN_10GBT_STAT_LP10G 0x0800 /* LP is 10GBT capable */ | ||
233 | #define MDIO_AN_10GBT_STAT_REMOK 0x1000 /* Remote OK */ | ||
234 | #define MDIO_AN_10GBT_STAT_LOCOK 0x2000 /* Local OK */ | ||
235 | #define MDIO_AN_10GBT_STAT_MS 0x4000 /* Master/slave config */ | ||
236 | #define MDIO_AN_10GBT_STAT_MSFLT 0x8000 /* Master/slave config fault */ | ||
237 | |||
238 | /* LASI RX_ALARM control/status registers. */ | ||
239 | #define MDIO_PMA_LASI_RX_PHYXSLFLT 0x0001 /* PHY XS RX local fault */ | ||
240 | #define MDIO_PMA_LASI_RX_PCSLFLT 0x0008 /* PCS RX local fault */ | ||
241 | #define MDIO_PMA_LASI_RX_PMALFLT 0x0010 /* PMA/PMD RX local fault */ | ||
242 | #define MDIO_PMA_LASI_RX_OPTICPOWERFLT 0x0020 /* RX optical power fault */ | ||
243 | #define MDIO_PMA_LASI_RX_WISLFLT 0x0200 /* WIS local fault */ | ||
244 | |||
245 | /* LASI TX_ALARM control/status registers. */ | ||
246 | #define MDIO_PMA_LASI_TX_PHYXSLFLT 0x0001 /* PHY XS TX local fault */ | ||
247 | #define MDIO_PMA_LASI_TX_PCSLFLT 0x0008 /* PCS TX local fault */ | ||
248 | #define MDIO_PMA_LASI_TX_PMALFLT 0x0010 /* PMA/PMD TX local fault */ | ||
249 | #define MDIO_PMA_LASI_TX_LASERPOWERFLT 0x0080 /* Laser output power fault */ | ||
250 | #define MDIO_PMA_LASI_TX_LASERTEMPFLT 0x0100 /* Laser temperature fault */ | ||
251 | #define MDIO_PMA_LASI_TX_LASERBICURRFLT 0x0200 /* Laser bias current fault */ | ||
252 | |||
253 | /* LASI control/status registers. */ | ||
254 | #define MDIO_PMA_LASI_LSALARM 0x0001 /* LS_ALARM enable/status */ | ||
255 | #define MDIO_PMA_LASI_TXALARM 0x0002 /* TX_ALARM enable/status */ | ||
256 | #define MDIO_PMA_LASI_RXALARM 0x0004 /* RX_ALARM enable/status */ | ||
257 | |||
258 | /* Mapping between MDIO PRTAD/DEVAD and mii_ioctl_data::phy_id */ | ||
259 | |||
260 | #define MDIO_PHY_ID_C45 0x8000 | ||
261 | #define MDIO_PHY_ID_PRTAD 0x03e0 | ||
262 | #define MDIO_PHY_ID_DEVAD 0x001f | ||
263 | #define MDIO_PHY_ID_C45_MASK \ | ||
264 | (MDIO_PHY_ID_C45 | MDIO_PHY_ID_PRTAD | MDIO_PHY_ID_DEVAD) | ||
265 | |||
266 | static inline __u16 mdio_phy_id_c45(int prtad, int devad) | ||
267 | { | ||
268 | return MDIO_PHY_ID_C45 | (prtad << 5) | devad; | ||
269 | } | ||
270 | |||
271 | static inline bool mdio_phy_id_is_c45(int phy_id) | ||
272 | { | ||
273 | return (phy_id & MDIO_PHY_ID_C45) && !(phy_id & ~MDIO_PHY_ID_C45_MASK); | ||
274 | } | ||
275 | |||
276 | static inline __u16 mdio_phy_id_prtad(int phy_id) | ||
277 | { | ||
278 | return (phy_id & MDIO_PHY_ID_PRTAD) >> 5; | ||
279 | } | ||
280 | |||
281 | static inline __u16 mdio_phy_id_devad(int phy_id) | ||
282 | { | ||
283 | return phy_id & MDIO_PHY_ID_DEVAD; | ||
284 | } | ||
285 | |||
286 | #define MDIO_SUPPORTS_C22 1 | ||
287 | #define MDIO_SUPPORTS_C45 2 | ||
288 | |||
289 | #ifdef __KERNEL__ | ||
290 | |||
291 | /** | ||
292 | * struct mdio_if_info - Ethernet controller MDIO interface | ||
293 | * @prtad: PRTAD of the PHY (%MDIO_PRTAD_NONE if not present/unknown) | ||
294 | * @mmds: Mask of MMDs expected to be present in the PHY. This must be | ||
295 | * non-zero unless @prtad = %MDIO_PRTAD_NONE. | ||
296 | * @mode_support: MDIO modes supported. If %MDIO_SUPPORTS_C22 is set then | ||
297 | * MII register access will be passed through with @devad = | ||
298 | * %MDIO_DEVAD_NONE. If %MDIO_EMULATE_C22 is set then access to | ||
299 | * commonly used clause 22 registers will be translated into | ||
300 | * clause 45 registers. | ||
301 | * @dev: Net device structure | ||
302 | * @mdio_read: Register read function; returns value or negative error code | ||
303 | * @mdio_write: Register write function; returns 0 or negative error code | ||
304 | */ | ||
305 | struct mdio_if_info { | ||
306 | int prtad; | ||
307 | u32 __bitwise mmds; | ||
308 | unsigned mode_support; | ||
309 | |||
310 | struct net_device *dev; | ||
311 | int (*mdio_read)(struct net_device *dev, int prtad, int devad, | ||
312 | u16 addr); | ||
313 | int (*mdio_write)(struct net_device *dev, int prtad, int devad, | ||
314 | u16 addr, u16 val); | ||
315 | }; | ||
316 | |||
317 | #define MDIO_PRTAD_NONE (-1) | ||
318 | #define MDIO_DEVAD_NONE (-1) | ||
319 | #define MDIO_EMULATE_C22 4 | ||
320 | |||
321 | struct ethtool_cmd; | ||
322 | struct ethtool_pauseparam; | ||
323 | extern int mdio45_probe(struct mdio_if_info *mdio, int prtad); | ||
324 | extern int mdio_set_flag(const struct mdio_if_info *mdio, | ||
325 | int prtad, int devad, u16 addr, int mask, | ||
326 | bool sense); | ||
327 | extern int mdio45_links_ok(const struct mdio_if_info *mdio, u32 mmds); | ||
328 | extern int mdio45_nway_restart(const struct mdio_if_info *mdio); | ||
329 | extern void mdio45_ethtool_gset_npage(const struct mdio_if_info *mdio, | ||
330 | struct ethtool_cmd *ecmd, | ||
331 | u32 npage_adv, u32 npage_lpa); | ||
332 | extern void | ||
333 | mdio45_ethtool_spauseparam_an(const struct mdio_if_info *mdio, | ||
334 | const struct ethtool_pauseparam *ecmd); | ||
335 | |||
336 | /** | ||
337 | * mdio45_ethtool_gset - get settings for ETHTOOL_GSET | ||
338 | * @mdio: MDIO interface | ||
339 | * @ecmd: Ethtool request structure | ||
340 | * | ||
341 | * Since the CSRs for auto-negotiation using next pages are not fully | ||
342 | * standardised, this function does not attempt to decode them. Use | ||
343 | * mdio45_ethtool_gset_npage() to specify advertisement bits from next | ||
344 | * pages. | ||
345 | */ | ||
346 | static inline void mdio45_ethtool_gset(const struct mdio_if_info *mdio, | ||
347 | struct ethtool_cmd *ecmd) | ||
348 | { | ||
349 | mdio45_ethtool_gset_npage(mdio, ecmd, 0, 0); | ||
350 | } | ||
351 | |||
352 | extern int mdio_mii_ioctl(const struct mdio_if_info *mdio, | ||
353 | struct mii_ioctl_data *mii_data, int cmd); | ||
354 | |||
355 | #endif /* __KERNEL__ */ | ||
356 | #endif /* __LINUX_MDIO_H__ */ | ||
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h index 25b9ca93d232..e46a0734ab6e 100644 --- a/include/linux/memcontrol.h +++ b/include/linux/memcontrol.h | |||
@@ -94,6 +94,7 @@ extern void mem_cgroup_note_reclaim_priority(struct mem_cgroup *mem, | |||
94 | extern void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, | 94 | extern void mem_cgroup_record_reclaim_priority(struct mem_cgroup *mem, |
95 | int priority); | 95 | int priority); |
96 | int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg); | 96 | int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg); |
97 | int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg); | ||
97 | unsigned long mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg, | 98 | unsigned long mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg, |
98 | struct zone *zone, | 99 | struct zone *zone, |
99 | enum lru_list lru); | 100 | enum lru_list lru); |
@@ -116,7 +117,7 @@ static inline bool mem_cgroup_disabled(void) | |||
116 | } | 117 | } |
117 | 118 | ||
118 | extern bool mem_cgroup_oom_called(struct task_struct *task); | 119 | extern bool mem_cgroup_oom_called(struct task_struct *task); |
119 | 120 | void mem_cgroup_update_mapped_file_stat(struct page *page, int val); | |
120 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ | 121 | #else /* CONFIG_CGROUP_MEM_RES_CTLR */ |
121 | struct mem_cgroup; | 122 | struct mem_cgroup; |
122 | 123 | ||
@@ -239,6 +240,12 @@ mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg) | |||
239 | return 1; | 240 | return 1; |
240 | } | 241 | } |
241 | 242 | ||
243 | static inline int | ||
244 | mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg) | ||
245 | { | ||
246 | return 1; | ||
247 | } | ||
248 | |||
242 | static inline unsigned long | 249 | static inline unsigned long |
243 | mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg, struct zone *zone, | 250 | mem_cgroup_zone_nr_pages(struct mem_cgroup *memcg, struct zone *zone, |
244 | enum lru_list lru) | 251 | enum lru_list lru) |
@@ -264,6 +271,11 @@ mem_cgroup_print_oom_info(struct mem_cgroup *memcg, struct task_struct *p) | |||
264 | { | 271 | { |
265 | } | 272 | } |
266 | 273 | ||
274 | static inline void mem_cgroup_update_mapped_file_stat(struct page *page, | ||
275 | int val) | ||
276 | { | ||
277 | } | ||
278 | |||
267 | #endif /* CONFIG_CGROUP_MEM_CONT */ | 279 | #endif /* CONFIG_CGROUP_MEM_CONT */ |
268 | 280 | ||
269 | #endif /* _LINUX_MEMCONTROL_H */ | 281 | #endif /* _LINUX_MEMCONTROL_H */ |
diff --git a/include/linux/mfd/ab3100.h b/include/linux/mfd/ab3100.h new file mode 100644 index 000000000000..7a3f316e3848 --- /dev/null +++ b/include/linux/mfd/ab3100.h | |||
@@ -0,0 +1,103 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2007-2009 ST-Ericsson AB | ||
3 | * License terms: GNU General Public License (GPL) version 2 | ||
4 | * AB3100 core access functions | ||
5 | * Author: Linus Walleij <linus.walleij@stericsson.com> | ||
6 | */ | ||
7 | |||
8 | #include <linux/device.h> | ||
9 | |||
10 | #ifndef MFD_AB3100_H | ||
11 | #define MFD_AB3100_H | ||
12 | |||
13 | #define ABUNKNOWN 0 | ||
14 | #define AB3000 1 | ||
15 | #define AB3100 2 | ||
16 | |||
17 | /* | ||
18 | * AB3100, EVENTA1, A2 and A3 event register flags | ||
19 | * these are catenated into a single 32-bit flag in the code | ||
20 | * for event notification broadcasts. | ||
21 | */ | ||
22 | #define AB3100_EVENTA1_ONSWA (0x01<<16) | ||
23 | #define AB3100_EVENTA1_ONSWB (0x02<<16) | ||
24 | #define AB3100_EVENTA1_ONSWC (0x04<<16) | ||
25 | #define AB3100_EVENTA1_DCIO (0x08<<16) | ||
26 | #define AB3100_EVENTA1_OVER_TEMP (0x10<<16) | ||
27 | #define AB3100_EVENTA1_SIM_OFF (0x20<<16) | ||
28 | #define AB3100_EVENTA1_VBUS (0x40<<16) | ||
29 | #define AB3100_EVENTA1_VSET_USB (0x80<<16) | ||
30 | |||
31 | #define AB3100_EVENTA2_READY_TX (0x01<<8) | ||
32 | #define AB3100_EVENTA2_READY_RX (0x02<<8) | ||
33 | #define AB3100_EVENTA2_OVERRUN_ERROR (0x04<<8) | ||
34 | #define AB3100_EVENTA2_FRAMING_ERROR (0x08<<8) | ||
35 | #define AB3100_EVENTA2_CHARG_OVERCURRENT (0x10<<8) | ||
36 | #define AB3100_EVENTA2_MIDR (0x20<<8) | ||
37 | #define AB3100_EVENTA2_BATTERY_REM (0x40<<8) | ||
38 | #define AB3100_EVENTA2_ALARM (0x80<<8) | ||
39 | |||
40 | #define AB3100_EVENTA3_ADC_TRIG5 (0x01) | ||
41 | #define AB3100_EVENTA3_ADC_TRIG4 (0x02) | ||
42 | #define AB3100_EVENTA3_ADC_TRIG3 (0x04) | ||
43 | #define AB3100_EVENTA3_ADC_TRIG2 (0x08) | ||
44 | #define AB3100_EVENTA3_ADC_TRIGVBAT (0x10) | ||
45 | #define AB3100_EVENTA3_ADC_TRIGVTX (0x20) | ||
46 | #define AB3100_EVENTA3_ADC_TRIG1 (0x40) | ||
47 | #define AB3100_EVENTA3_ADC_TRIG0 (0x80) | ||
48 | |||
49 | /* AB3100, STR register flags */ | ||
50 | #define AB3100_STR_ONSWA (0x01) | ||
51 | #define AB3100_STR_ONSWB (0x02) | ||
52 | #define AB3100_STR_ONSWC (0x04) | ||
53 | #define AB3100_STR_DCIO (0x08) | ||
54 | #define AB3100_STR_BOOT_MODE (0x10) | ||
55 | #define AB3100_STR_SIM_OFF (0x20) | ||
56 | #define AB3100_STR_BATT_REMOVAL (0x40) | ||
57 | #define AB3100_STR_VBUS (0x80) | ||
58 | |||
59 | /** | ||
60 | * struct ab3100 | ||
61 | * @access_mutex: lock out concurrent accesses to the AB3100 registers | ||
62 | * @dev: pointer to the containing device | ||
63 | * @i2c_client: I2C client for this chip | ||
64 | * @testreg_client: secondary client for test registers | ||
65 | * @chip_name: name of this chip variant | ||
66 | * @chip_id: 8 bit chip ID for this chip variant | ||
67 | * @work: an event handling worker | ||
68 | * @event_subscribers: event subscribers are listed here | ||
69 | * @startup_events: a copy of the first reading of the event registers | ||
70 | * @startup_events_read: whether the first events have been read | ||
71 | * | ||
72 | * This struct is PRIVATE and devices using it should NOT | ||
73 | * access ANY fields. It is used as a token for calling the | ||
74 | * AB3100 functions. | ||
75 | */ | ||
76 | struct ab3100 { | ||
77 | struct mutex access_mutex; | ||
78 | struct device *dev; | ||
79 | struct i2c_client *i2c_client; | ||
80 | struct i2c_client *testreg_client; | ||
81 | char chip_name[32]; | ||
82 | u8 chip_id; | ||
83 | struct work_struct work; | ||
84 | struct blocking_notifier_head event_subscribers; | ||
85 | u32 startup_events; | ||
86 | bool startup_events_read; | ||
87 | }; | ||
88 | |||
89 | int ab3100_set_register(struct ab3100 *ab3100, u8 reg, u8 regval); | ||
90 | int ab3100_get_register(struct ab3100 *ab3100, u8 reg, u8 *regval); | ||
91 | int ab3100_get_register_page(struct ab3100 *ab3100, | ||
92 | u8 first_reg, u8 *regvals, u8 numregs); | ||
93 | int ab3100_mask_and_set_register(struct ab3100 *ab3100, | ||
94 | u8 reg, u8 andmask, u8 ormask); | ||
95 | u8 ab3100_get_chip_type(struct ab3100 *ab3100); | ||
96 | int ab3100_event_register(struct ab3100 *ab3100, | ||
97 | struct notifier_block *nb); | ||
98 | int ab3100_event_unregister(struct ab3100 *ab3100, | ||
99 | struct notifier_block *nb); | ||
100 | int ab3100_event_registers_startup_state_get(struct ab3100 *ab3100, | ||
101 | u32 *fatevent); | ||
102 | |||
103 | #endif | ||
diff --git a/include/linux/mfd/asic3.h b/include/linux/mfd/asic3.h index 322cd6deb9f0..de3c4ad19afb 100644 --- a/include/linux/mfd/asic3.h +++ b/include/linux/mfd/asic3.h | |||
@@ -30,6 +30,13 @@ struct asic3_platform_data { | |||
30 | #define ASIC3_NUM_GPIOS 64 | 30 | #define ASIC3_NUM_GPIOS 64 |
31 | #define ASIC3_NR_IRQS ASIC3_NUM_GPIOS + 6 | 31 | #define ASIC3_NR_IRQS ASIC3_NUM_GPIOS + 6 |
32 | 32 | ||
33 | #define ASIC3_IRQ_LED0 64 | ||
34 | #define ASIC3_IRQ_LED1 65 | ||
35 | #define ASIC3_IRQ_LED2 66 | ||
36 | #define ASIC3_IRQ_SPI 67 | ||
37 | #define ASIC3_IRQ_SMBUS 68 | ||
38 | #define ASIC3_IRQ_OWM 69 | ||
39 | |||
33 | #define ASIC3_TO_GPIO(gpio) (NR_BUILTIN_GPIO + (gpio)) | 40 | #define ASIC3_TO_GPIO(gpio) (NR_BUILTIN_GPIO + (gpio)) |
34 | 41 | ||
35 | #define ASIC3_GPIO_BANK_A 0 | 42 | #define ASIC3_GPIO_BANK_A 0 |
@@ -227,8 +234,8 @@ struct asic3_platform_data { | |||
227 | 234 | ||
228 | 235 | ||
229 | /* Basic control of the SD ASIC */ | 236 | /* Basic control of the SD ASIC */ |
230 | #define ASIC3_SDHWCTRL_Base 0x0E00 | 237 | #define ASIC3_SDHWCTRL_BASE 0x0E00 |
231 | #define ASIC3_SDHWCTRL_SDConf 0x00 | 238 | #define ASIC3_SDHWCTRL_SDCONF 0x00 |
232 | 239 | ||
233 | #define ASIC3_SDHWCTRL_SUSPEND (1 << 0) /* 1=suspend all SD operations */ | 240 | #define ASIC3_SDHWCTRL_SUSPEND (1 << 0) /* 1=suspend all SD operations */ |
234 | #define ASIC3_SDHWCTRL_CLKSEL (1 << 1) /* 1=SDICK, 0=HCLK */ | 241 | #define ASIC3_SDHWCTRL_CLKSEL (1 << 1) /* 1=SDICK, 0=HCLK */ |
@@ -242,10 +249,10 @@ struct asic3_platform_data { | |||
242 | /* SD card power supply ctrl 1=enable */ | 249 | /* SD card power supply ctrl 1=enable */ |
243 | #define ASIC3_SDHWCTRL_SDPWR (1 << 6) | 250 | #define ASIC3_SDHWCTRL_SDPWR (1 << 6) |
244 | 251 | ||
245 | #define ASIC3_EXTCF_Base 0x1100 | 252 | #define ASIC3_EXTCF_BASE 0x1100 |
246 | 253 | ||
247 | #define ASIC3_EXTCF_Select 0x00 | 254 | #define ASIC3_EXTCF_SELECT 0x00 |
248 | #define ASIC3_EXTCF_Reset 0x04 | 255 | #define ASIC3_EXTCF_RESET 0x04 |
249 | 256 | ||
250 | #define ASIC3_EXTCF_SMOD0 (1 << 0) /* slot number of mode 0 */ | 257 | #define ASIC3_EXTCF_SMOD0 (1 << 0) /* slot number of mode 0 */ |
251 | #define ASIC3_EXTCF_SMOD1 (1 << 1) /* slot number of mode 1 */ | 258 | #define ASIC3_EXTCF_SMOD1 (1 << 1) /* slot number of mode 1 */ |
@@ -279,222 +286,9 @@ struct asic3_platform_data { | |||
279 | * SDIO_CTRL Control registers for SDIO operations | 286 | * SDIO_CTRL Control registers for SDIO operations |
280 | * | 287 | * |
281 | *****************************************************************************/ | 288 | *****************************************************************************/ |
282 | #define ASIC3_SD_CONFIG_Base 0x0400 /* Assumes 32 bit addressing */ | 289 | #define ASIC3_SD_CONFIG_BASE 0x0400 /* Assumes 32 bit addressing */ |
283 | 290 | #define ASIC3_SD_CTRL_BASE 0x1000 | |
284 | #define ASIC3_SD_CONFIG_Command 0x08 /* R/W: Command */ | 291 | #define ASIC3_SDIO_CTRL_BASE 0x1200 |
285 | |||
286 | /* [0:8] SD Control Register Base Address */ | ||
287 | #define ASIC3_SD_CONFIG_Addr0 0x20 | ||
288 | |||
289 | /* [9:31] SD Control Register Base Address */ | ||
290 | #define ASIC3_SD_CONFIG_Addr1 0x24 | ||
291 | |||
292 | /* R/O: interrupt assigned to pin */ | ||
293 | #define ASIC3_SD_CONFIG_IntPin 0x78 | ||
294 | |||
295 | /* | ||
296 | * Set to 0x1f to clock SD controller, 0 otherwise. | ||
297 | * At 0x82 - Gated Clock Ctrl | ||
298 | */ | ||
299 | #define ASIC3_SD_CONFIG_ClkStop 0x80 | ||
300 | |||
301 | /* Control clock of SD controller */ | ||
302 | #define ASIC3_SD_CONFIG_ClockMode 0x84 | ||
303 | #define ASIC3_SD_CONFIG_SDHC_PinStatus 0x88 /* R/0: SD pins status */ | ||
304 | #define ASIC3_SD_CONFIG_SDHC_Power1 0x90 /* Power1 - manual pwr ctrl */ | ||
305 | |||
306 | /* auto power up after card inserted */ | ||
307 | #define ASIC3_SD_CONFIG_SDHC_Power2 0x92 | ||
308 | |||
309 | /* auto power down when card removed */ | ||
310 | #define ASIC3_SD_CONFIG_SDHC_Power3 0x94 | ||
311 | #define ASIC3_SD_CONFIG_SDHC_CardDetect 0x98 | ||
312 | #define ASIC3_SD_CONFIG_SDHC_Slot 0xA0 /* R/O: support slot number */ | ||
313 | #define ASIC3_SD_CONFIG_SDHC_ExtGateClk1 0x1E0 /* Not used */ | ||
314 | #define ASIC3_SD_CONFIG_SDHC_ExtGateClk2 0x1E2 /* Not used*/ | ||
315 | |||
316 | /* GPIO Output Reg. , at 0x1EA - GPIO Output Enable Reg. */ | ||
317 | #define ASIC3_SD_CONFIG_SDHC_GPIO_OutAndEnable 0x1E8 | ||
318 | #define ASIC3_SD_CONFIG_SDHC_GPIO_Status 0x1EC /* GPIO Status Reg. */ | ||
319 | |||
320 | /* Bit 1: double buffer/single buffer */ | ||
321 | #define ASIC3_SD_CONFIG_SDHC_ExtGateClk3 0x1F0 | ||
322 | |||
323 | /* Memory access enable (set to 1 to access SD Controller) */ | ||
324 | #define SD_CONFIG_COMMAND_MAE (1<<1) | ||
325 | |||
326 | #define SD_CONFIG_CLK_ENABLE_ALL 0x1f | ||
327 | |||
328 | #define SD_CONFIG_POWER1_PC_33V 0x0200 /* Set for 3.3 volts */ | ||
329 | #define SD_CONFIG_POWER1_PC_OFF 0x0000 /* Turn off power */ | ||
330 | |||
331 | /* two bits - number of cycles for card detection */ | ||
332 | #define SD_CONFIG_CARDDETECTMODE_CLK ((x) & 0x3) | ||
333 | |||
334 | |||
335 | #define ASIC3_SD_CTRL_Base 0x1000 | ||
336 | |||
337 | #define ASIC3_SD_CTRL_Cmd 0x00 | ||
338 | #define ASIC3_SD_CTRL_Arg0 0x08 | ||
339 | #define ASIC3_SD_CTRL_Arg1 0x0C | ||
340 | #define ASIC3_SD_CTRL_StopInternal 0x10 | ||
341 | #define ASIC3_SD_CTRL_TransferSectorCount 0x14 | ||
342 | #define ASIC3_SD_CTRL_Response0 0x18 | ||
343 | #define ASIC3_SD_CTRL_Response1 0x1C | ||
344 | #define ASIC3_SD_CTRL_Response2 0x20 | ||
345 | #define ASIC3_SD_CTRL_Response3 0x24 | ||
346 | #define ASIC3_SD_CTRL_Response4 0x28 | ||
347 | #define ASIC3_SD_CTRL_Response5 0x2C | ||
348 | #define ASIC3_SD_CTRL_Response6 0x30 | ||
349 | #define ASIC3_SD_CTRL_Response7 0x34 | ||
350 | #define ASIC3_SD_CTRL_CardStatus 0x38 | ||
351 | #define ASIC3_SD_CTRL_BufferCtrl 0x3C | ||
352 | #define ASIC3_SD_CTRL_IntMaskCard 0x40 | ||
353 | #define ASIC3_SD_CTRL_IntMaskBuffer 0x44 | ||
354 | #define ASIC3_SD_CTRL_CardClockCtrl 0x48 | ||
355 | #define ASIC3_SD_CTRL_MemCardXferDataLen 0x4C | ||
356 | #define ASIC3_SD_CTRL_MemCardOptionSetup 0x50 | ||
357 | #define ASIC3_SD_CTRL_ErrorStatus0 0x58 | ||
358 | #define ASIC3_SD_CTRL_ErrorStatus1 0x5C | ||
359 | #define ASIC3_SD_CTRL_DataPort 0x60 | ||
360 | #define ASIC3_SD_CTRL_TransactionCtrl 0x68 | ||
361 | #define ASIC3_SD_CTRL_SoftwareReset 0x1C0 | ||
362 | |||
363 | #define SD_CTRL_SOFTWARE_RESET_CLEAR (1<<0) | ||
364 | |||
365 | #define SD_CTRL_TRANSACTIONCONTROL_SET (1<<8) | ||
366 | |||
367 | #define SD_CTRL_CARDCLOCKCONTROL_FOR_SD_CARD (1<<15) | ||
368 | #define SD_CTRL_CARDCLOCKCONTROL_ENABLE_CLOCK (1<<8) | ||
369 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_512 (1<<7) | ||
370 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_256 (1<<6) | ||
371 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_128 (1<<5) | ||
372 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_64 (1<<4) | ||
373 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_32 (1<<3) | ||
374 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_16 (1<<2) | ||
375 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_8 (1<<1) | ||
376 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_4 (1<<0) | ||
377 | #define SD_CTRL_CARDCLOCKCONTROL_CLK_DIV_2 (0<<0) | ||
378 | |||
379 | #define MEM_CARD_OPTION_REQUIRED 0x000e | ||
380 | #define MEM_CARD_OPTION_DATA_RESPONSE_TIMEOUT(x) (((x) & 0x0f) << 4) | ||
381 | #define MEM_CARD_OPTION_C2_MODULE_NOT_PRESENT (1<<14) | ||
382 | #define MEM_CARD_OPTION_DATA_XFR_WIDTH_1 (1<<15) | ||
383 | #define MEM_CARD_OPTION_DATA_XFR_WIDTH_4 0 | ||
384 | |||
385 | #define SD_CTRL_COMMAND_INDEX(x) ((x) & 0x3f) | ||
386 | #define SD_CTRL_COMMAND_TYPE_CMD (0 << 6) | ||
387 | #define SD_CTRL_COMMAND_TYPE_ACMD (1 << 6) | ||
388 | #define SD_CTRL_COMMAND_TYPE_AUTHENTICATION (2 << 6) | ||
389 | #define SD_CTRL_COMMAND_RESPONSE_TYPE_NORMAL (0 << 8) | ||
390 | #define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R1 (4 << 8) | ||
391 | #define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R1B (5 << 8) | ||
392 | #define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R2 (6 << 8) | ||
393 | #define SD_CTRL_COMMAND_RESPONSE_TYPE_EXT_R3 (7 << 8) | ||
394 | #define SD_CTRL_COMMAND_DATA_PRESENT (1 << 11) | ||
395 | #define SD_CTRL_COMMAND_TRANSFER_READ (1 << 12) | ||
396 | #define SD_CTRL_COMMAND_TRANSFER_WRITE (0 << 12) | ||
397 | #define SD_CTRL_COMMAND_MULTI_BLOCK (1 << 13) | ||
398 | #define SD_CTRL_COMMAND_SECURITY_CMD (1 << 14) | ||
399 | |||
400 | #define SD_CTRL_STOP_INTERNAL_ISSSUE_CMD12 (1 << 0) | ||
401 | #define SD_CTRL_STOP_INTERNAL_AUTO_ISSUE_CMD12 (1 << 8) | ||
402 | |||
403 | #define SD_CTRL_CARDSTATUS_RESPONSE_END (1 << 0) | ||
404 | #define SD_CTRL_CARDSTATUS_RW_END (1 << 2) | ||
405 | #define SD_CTRL_CARDSTATUS_CARD_REMOVED_0 (1 << 3) | ||
406 | #define SD_CTRL_CARDSTATUS_CARD_INSERTED_0 (1 << 4) | ||
407 | #define SD_CTRL_CARDSTATUS_SIGNAL_STATE_PRESENT_0 (1 << 5) | ||
408 | #define SD_CTRL_CARDSTATUS_WRITE_PROTECT (1 << 7) | ||
409 | #define SD_CTRL_CARDSTATUS_CARD_REMOVED_3 (1 << 8) | ||
410 | #define SD_CTRL_CARDSTATUS_CARD_INSERTED_3 (1 << 9) | ||
411 | #define SD_CTRL_CARDSTATUS_SIGNAL_STATE_PRESENT_3 (1 << 10) | ||
412 | |||
413 | #define SD_CTRL_BUFFERSTATUS_CMD_INDEX_ERROR (1 << 0) | ||
414 | #define SD_CTRL_BUFFERSTATUS_CRC_ERROR (1 << 1) | ||
415 | #define SD_CTRL_BUFFERSTATUS_STOP_BIT_END_ERROR (1 << 2) | ||
416 | #define SD_CTRL_BUFFERSTATUS_DATA_TIMEOUT (1 << 3) | ||
417 | #define SD_CTRL_BUFFERSTATUS_BUFFER_OVERFLOW (1 << 4) | ||
418 | #define SD_CTRL_BUFFERSTATUS_BUFFER_UNDERFLOW (1 << 5) | ||
419 | #define SD_CTRL_BUFFERSTATUS_CMD_TIMEOUT (1 << 6) | ||
420 | #define SD_CTRL_BUFFERSTATUS_UNK7 (1 << 7) | ||
421 | #define SD_CTRL_BUFFERSTATUS_BUFFER_READ_ENABLE (1 << 8) | ||
422 | #define SD_CTRL_BUFFERSTATUS_BUFFER_WRITE_ENABLE (1 << 9) | ||
423 | #define SD_CTRL_BUFFERSTATUS_ILLEGAL_FUNCTION (1 << 13) | ||
424 | #define SD_CTRL_BUFFERSTATUS_CMD_BUSY (1 << 14) | ||
425 | #define SD_CTRL_BUFFERSTATUS_ILLEGAL_ACCESS (1 << 15) | ||
426 | |||
427 | #define SD_CTRL_INTMASKCARD_RESPONSE_END (1 << 0) | ||
428 | #define SD_CTRL_INTMASKCARD_RW_END (1 << 2) | ||
429 | #define SD_CTRL_INTMASKCARD_CARD_REMOVED_0 (1 << 3) | ||
430 | #define SD_CTRL_INTMASKCARD_CARD_INSERTED_0 (1 << 4) | ||
431 | #define SD_CTRL_INTMASKCARD_SIGNAL_STATE_PRESENT_0 (1 << 5) | ||
432 | #define SD_CTRL_INTMASKCARD_UNK6 (1 << 6) | ||
433 | #define SD_CTRL_INTMASKCARD_WRITE_PROTECT (1 << 7) | ||
434 | #define SD_CTRL_INTMASKCARD_CARD_REMOVED_3 (1 << 8) | ||
435 | #define SD_CTRL_INTMASKCARD_CARD_INSERTED_3 (1 << 9) | ||
436 | #define SD_CTRL_INTMASKCARD_SIGNAL_STATE_PRESENT_3 (1 << 10) | ||
437 | |||
438 | #define SD_CTRL_INTMASKBUFFER_CMD_INDEX_ERROR (1 << 0) | ||
439 | #define SD_CTRL_INTMASKBUFFER_CRC_ERROR (1 << 1) | ||
440 | #define SD_CTRL_INTMASKBUFFER_STOP_BIT_END_ERROR (1 << 2) | ||
441 | #define SD_CTRL_INTMASKBUFFER_DATA_TIMEOUT (1 << 3) | ||
442 | #define SD_CTRL_INTMASKBUFFER_BUFFER_OVERFLOW (1 << 4) | ||
443 | #define SD_CTRL_INTMASKBUFFER_BUFFER_UNDERFLOW (1 << 5) | ||
444 | #define SD_CTRL_INTMASKBUFFER_CMD_TIMEOUT (1 << 6) | ||
445 | #define SD_CTRL_INTMASKBUFFER_UNK7 (1 << 7) | ||
446 | #define SD_CTRL_INTMASKBUFFER_BUFFER_READ_ENABLE (1 << 8) | ||
447 | #define SD_CTRL_INTMASKBUFFER_BUFFER_WRITE_ENABLE (1 << 9) | ||
448 | #define SD_CTRL_INTMASKBUFFER_ILLEGAL_FUNCTION (1 << 13) | ||
449 | #define SD_CTRL_INTMASKBUFFER_CMD_BUSY (1 << 14) | ||
450 | #define SD_CTRL_INTMASKBUFFER_ILLEGAL_ACCESS (1 << 15) | ||
451 | |||
452 | #define SD_CTRL_DETAIL0_RESPONSE_CMD_ERROR (1 << 0) | ||
453 | #define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_RESPONSE_NON_CMD12 (1 << 2) | ||
454 | #define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_RESPONSE_CMD12 (1 << 3) | ||
455 | #define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_READ_DATA (1 << 4) | ||
456 | #define SD_CTRL_DETAIL0_END_BIT_ERROR_FOR_WRITE_CRC_STATUS (1 << 5) | ||
457 | #define SD_CTRL_DETAIL0_CRC_ERROR_FOR_RESPONSE_NON_CMD12 (1 << 8) | ||
458 | #define SD_CTRL_DETAIL0_CRC_ERROR_FOR_RESPONSE_CMD12 (1 << 9) | ||
459 | #define SD_CTRL_DETAIL0_CRC_ERROR_FOR_READ_DATA (1 << 10) | ||
460 | #define SD_CTRL_DETAIL0_CRC_ERROR_FOR_WRITE_CMD (1 << 11) | ||
461 | |||
462 | #define SD_CTRL_DETAIL1_NO_CMD_RESPONSE (1 << 0) | ||
463 | #define SD_CTRL_DETAIL1_TIMEOUT_READ_DATA (1 << 4) | ||
464 | #define SD_CTRL_DETAIL1_TIMEOUT_CRS_STATUS (1 << 5) | ||
465 | #define SD_CTRL_DETAIL1_TIMEOUT_CRC_BUSY (1 << 6) | ||
466 | |||
467 | #define ASIC3_SDIO_CTRL_Base 0x1200 | ||
468 | |||
469 | #define ASIC3_SDIO_CTRL_Cmd 0x00 | ||
470 | #define ASIC3_SDIO_CTRL_CardPortSel 0x04 | ||
471 | #define ASIC3_SDIO_CTRL_Arg0 0x08 | ||
472 | #define ASIC3_SDIO_CTRL_Arg1 0x0C | ||
473 | #define ASIC3_SDIO_CTRL_TransferBlockCount 0x14 | ||
474 | #define ASIC3_SDIO_CTRL_Response0 0x18 | ||
475 | #define ASIC3_SDIO_CTRL_Response1 0x1C | ||
476 | #define ASIC3_SDIO_CTRL_Response2 0x20 | ||
477 | #define ASIC3_SDIO_CTRL_Response3 0x24 | ||
478 | #define ASIC3_SDIO_CTRL_Response4 0x28 | ||
479 | #define ASIC3_SDIO_CTRL_Response5 0x2C | ||
480 | #define ASIC3_SDIO_CTRL_Response6 0x30 | ||
481 | #define ASIC3_SDIO_CTRL_Response7 0x34 | ||
482 | #define ASIC3_SDIO_CTRL_CardStatus 0x38 | ||
483 | #define ASIC3_SDIO_CTRL_BufferCtrl 0x3C | ||
484 | #define ASIC3_SDIO_CTRL_IntMaskCard 0x40 | ||
485 | #define ASIC3_SDIO_CTRL_IntMaskBuffer 0x44 | ||
486 | #define ASIC3_SDIO_CTRL_CardXferDataLen 0x4C | ||
487 | #define ASIC3_SDIO_CTRL_CardOptionSetup 0x50 | ||
488 | #define ASIC3_SDIO_CTRL_ErrorStatus0 0x54 | ||
489 | #define ASIC3_SDIO_CTRL_ErrorStatus1 0x58 | ||
490 | #define ASIC3_SDIO_CTRL_DataPort 0x60 | ||
491 | #define ASIC3_SDIO_CTRL_TransactionCtrl 0x68 | ||
492 | #define ASIC3_SDIO_CTRL_CardIntCtrl 0x6C | ||
493 | #define ASIC3_SDIO_CTRL_ClocknWaitCtrl 0x70 | ||
494 | #define ASIC3_SDIO_CTRL_HostInformation 0x74 | ||
495 | #define ASIC3_SDIO_CTRL_ErrorCtrl 0x78 | ||
496 | #define ASIC3_SDIO_CTRL_LEDCtrl 0x7C | ||
497 | #define ASIC3_SDIO_CTRL_SoftwareReset 0x1C0 | ||
498 | 292 | ||
499 | #define ASIC3_MAP_SIZE_32BIT 0x2000 | 293 | #define ASIC3_MAP_SIZE_32BIT 0x2000 |
500 | #define ASIC3_MAP_SIZE_16BIT 0x1000 | 294 | #define ASIC3_MAP_SIZE_16BIT 0x1000 |
diff --git a/include/linux/mfd/ezx-pcap.h b/include/linux/mfd/ezx-pcap.h new file mode 100644 index 000000000000..c12c3c0932bf --- /dev/null +++ b/include/linux/mfd/ezx-pcap.h | |||
@@ -0,0 +1,256 @@ | |||
1 | /* | ||
2 | * Copyright 2009 Daniel Ribeiro <drwyrm@gmail.com> | ||
3 | * | ||
4 | * For further information, please see http://wiki.openezx.org/PCAP2 | ||
5 | */ | ||
6 | |||
7 | #ifndef EZX_PCAP_H | ||
8 | #define EZX_PCAP_H | ||
9 | |||
10 | struct pcap_subdev { | ||
11 | int id; | ||
12 | const char *name; | ||
13 | void *platform_data; | ||
14 | }; | ||
15 | |||
16 | struct pcap_platform_data { | ||
17 | unsigned int irq_base; | ||
18 | unsigned int config; | ||
19 | void (*init) (void *); /* board specific init */ | ||
20 | int num_subdevs; | ||
21 | struct pcap_subdev *subdevs; | ||
22 | }; | ||
23 | |||
24 | struct pcap_chip; | ||
25 | |||
26 | int ezx_pcap_write(struct pcap_chip *, u8, u32); | ||
27 | int ezx_pcap_read(struct pcap_chip *, u8, u32 *); | ||
28 | int pcap_to_irq(struct pcap_chip *, int); | ||
29 | int pcap_adc_async(struct pcap_chip *, u8, u32, u8[], void *, void *); | ||
30 | int pcap_adc_sync(struct pcap_chip *, u8, u32, u8[], u16[]); | ||
31 | |||
32 | #define PCAP_SECOND_PORT 1 | ||
33 | #define PCAP_CS_AH 2 | ||
34 | |||
35 | #define PCAP_REGISTER_WRITE_OP_BIT 0x80000000 | ||
36 | #define PCAP_REGISTER_READ_OP_BIT 0x00000000 | ||
37 | |||
38 | #define PCAP_REGISTER_VALUE_MASK 0x01ffffff | ||
39 | #define PCAP_REGISTER_ADDRESS_MASK 0x7c000000 | ||
40 | #define PCAP_REGISTER_ADDRESS_SHIFT 26 | ||
41 | #define PCAP_REGISTER_NUMBER 32 | ||
42 | #define PCAP_CLEAR_INTERRUPT_REGISTER 0x01ffffff | ||
43 | #define PCAP_MASK_ALL_INTERRUPT 0x01ffffff | ||
44 | |||
45 | /* registers acessible by both pcap ports */ | ||
46 | #define PCAP_REG_ISR 0x0 /* Interrupt Status */ | ||
47 | #define PCAP_REG_MSR 0x1 /* Interrupt Mask */ | ||
48 | #define PCAP_REG_PSTAT 0x2 /* Processor Status */ | ||
49 | #define PCAP_REG_VREG2 0x6 /* Regulator Bank 2 Control */ | ||
50 | #define PCAP_REG_AUXVREG 0x7 /* Auxiliary Regulator Control */ | ||
51 | #define PCAP_REG_BATT 0x8 /* Battery Control */ | ||
52 | #define PCAP_REG_ADC 0x9 /* AD Control */ | ||
53 | #define PCAP_REG_ADR 0xa /* AD Result */ | ||
54 | #define PCAP_REG_CODEC 0xb /* Audio Codec Control */ | ||
55 | #define PCAP_REG_RX_AMPS 0xc /* RX Audio Amplifiers Control */ | ||
56 | #define PCAP_REG_ST_DAC 0xd /* Stereo DAC Control */ | ||
57 | #define PCAP_REG_BUSCTRL 0x14 /* Connectivity Control */ | ||
58 | #define PCAP_REG_PERIPH 0x15 /* Peripheral Control */ | ||
59 | #define PCAP_REG_LOWPWR 0x18 /* Regulator Low Power Control */ | ||
60 | #define PCAP_REG_TX_AMPS 0x1a /* TX Audio Amplifiers Control */ | ||
61 | #define PCAP_REG_GP 0x1b /* General Purpose */ | ||
62 | #define PCAP_REG_TEST1 0x1c | ||
63 | #define PCAP_REG_TEST2 0x1d | ||
64 | #define PCAP_REG_VENDOR_TEST1 0x1e | ||
65 | #define PCAP_REG_VENDOR_TEST2 0x1f | ||
66 | |||
67 | /* registers acessible by pcap port 1 only (a1200, e2 & e6) */ | ||
68 | #define PCAP_REG_INT_SEL 0x3 /* Interrupt Select */ | ||
69 | #define PCAP_REG_SWCTRL 0x4 /* Switching Regulator Control */ | ||
70 | #define PCAP_REG_VREG1 0x5 /* Regulator Bank 1 Control */ | ||
71 | #define PCAP_REG_RTC_TOD 0xe /* RTC Time of Day */ | ||
72 | #define PCAP_REG_RTC_TODA 0xf /* RTC Time of Day Alarm */ | ||
73 | #define PCAP_REG_RTC_DAY 0x10 /* RTC Day */ | ||
74 | #define PCAP_REG_RTC_DAYA 0x11 /* RTC Day Alarm */ | ||
75 | #define PCAP_REG_MTRTMR 0x12 /* AD Monitor Timer */ | ||
76 | #define PCAP_REG_PWR 0x13 /* Power Control */ | ||
77 | #define PCAP_REG_AUXVREG_MASK 0x16 /* Auxiliary Regulator Mask */ | ||
78 | #define PCAP_REG_VENDOR_REV 0x17 | ||
79 | #define PCAP_REG_PERIPH_MASK 0x19 /* Peripheral Mask */ | ||
80 | |||
81 | /* PCAP2 Interrupts */ | ||
82 | #define PCAP_NIRQS 23 | ||
83 | #define PCAP_IRQ_ADCDONE 0 /* ADC done port 1 */ | ||
84 | #define PCAP_IRQ_TS 1 /* Touch Screen */ | ||
85 | #define PCAP_IRQ_1HZ 2 /* 1HZ timer */ | ||
86 | #define PCAP_IRQ_WH 3 /* ADC above high limit */ | ||
87 | #define PCAP_IRQ_WL 4 /* ADC below low limit */ | ||
88 | #define PCAP_IRQ_TODA 5 /* Time of day alarm */ | ||
89 | #define PCAP_IRQ_USB4V 6 /* USB above 4V */ | ||
90 | #define PCAP_IRQ_ONOFF 7 /* On/Off button */ | ||
91 | #define PCAP_IRQ_ONOFF2 8 /* On/Off button 2 */ | ||
92 | #define PCAP_IRQ_USB1V 9 /* USB above 1V */ | ||
93 | #define PCAP_IRQ_MOBPORT 10 | ||
94 | #define PCAP_IRQ_MIC 11 /* Mic attach/HS button */ | ||
95 | #define PCAP_IRQ_HS 12 /* Headset attach */ | ||
96 | #define PCAP_IRQ_ST 13 | ||
97 | #define PCAP_IRQ_PC 14 /* Power Cut */ | ||
98 | #define PCAP_IRQ_WARM 15 | ||
99 | #define PCAP_IRQ_EOL 16 /* Battery End Of Life */ | ||
100 | #define PCAP_IRQ_CLK 17 | ||
101 | #define PCAP_IRQ_SYSRST 18 /* System Reset */ | ||
102 | #define PCAP_IRQ_DUMMY 19 | ||
103 | #define PCAP_IRQ_ADCDONE2 20 /* ADC done port 2 */ | ||
104 | #define PCAP_IRQ_SOFTRESET 21 | ||
105 | #define PCAP_IRQ_MNEXB 22 | ||
106 | |||
107 | /* voltage regulators */ | ||
108 | #define V1 0 | ||
109 | #define V2 1 | ||
110 | #define V3 2 | ||
111 | #define V4 3 | ||
112 | #define V5 4 | ||
113 | #define V6 5 | ||
114 | #define V7 6 | ||
115 | #define V8 7 | ||
116 | #define V9 8 | ||
117 | #define V10 9 | ||
118 | #define VAUX1 10 | ||
119 | #define VAUX2 11 | ||
120 | #define VAUX3 12 | ||
121 | #define VAUX4 13 | ||
122 | #define VSIM 14 | ||
123 | #define VSIM2 15 | ||
124 | #define VVIB 16 | ||
125 | #define SW1 17 | ||
126 | #define SW2 18 | ||
127 | #define SW3 19 | ||
128 | #define SW1S 20 | ||
129 | #define SW2S 21 | ||
130 | |||
131 | #define PCAP_BATT_DAC_MASK 0x000000ff | ||
132 | #define PCAP_BATT_DAC_SHIFT 0 | ||
133 | #define PCAP_BATT_B_FDBK (1 << 8) | ||
134 | #define PCAP_BATT_EXT_ISENSE (1 << 9) | ||
135 | #define PCAP_BATT_V_COIN_MASK 0x00003c00 | ||
136 | #define PCAP_BATT_V_COIN_SHIFT 10 | ||
137 | #define PCAP_BATT_I_COIN (1 << 14) | ||
138 | #define PCAP_BATT_COIN_CH_EN (1 << 15) | ||
139 | #define PCAP_BATT_EOL_SEL_MASK 0x000e0000 | ||
140 | #define PCAP_BATT_EOL_SEL_SHIFT 17 | ||
141 | #define PCAP_BATT_EOL_CMP_EN (1 << 20) | ||
142 | #define PCAP_BATT_BATT_DET_EN (1 << 21) | ||
143 | #define PCAP_BATT_THERMBIAS_CTRL (1 << 22) | ||
144 | |||
145 | #define PCAP_ADC_ADEN (1 << 0) | ||
146 | #define PCAP_ADC_RAND (1 << 1) | ||
147 | #define PCAP_ADC_AD_SEL1 (1 << 2) | ||
148 | #define PCAP_ADC_AD_SEL2 (1 << 3) | ||
149 | #define PCAP_ADC_ADA1_MASK 0x00000070 | ||
150 | #define PCAP_ADC_ADA1_SHIFT 4 | ||
151 | #define PCAP_ADC_ADA2_MASK 0x00000380 | ||
152 | #define PCAP_ADC_ADA2_SHIFT 7 | ||
153 | #define PCAP_ADC_ATO_MASK 0x00003c00 | ||
154 | #define PCAP_ADC_ATO_SHIFT 10 | ||
155 | #define PCAP_ADC_ATOX (1 << 14) | ||
156 | #define PCAP_ADC_MTR1 (1 << 15) | ||
157 | #define PCAP_ADC_MTR2 (1 << 16) | ||
158 | #define PCAP_ADC_TS_M_MASK 0x000e0000 | ||
159 | #define PCAP_ADC_TS_M_SHIFT 17 | ||
160 | #define PCAP_ADC_TS_REF_LOWPWR (1 << 20) | ||
161 | #define PCAP_ADC_TS_REFENB (1 << 21) | ||
162 | #define PCAP_ADC_BATT_I_POLARITY (1 << 22) | ||
163 | #define PCAP_ADC_BATT_I_ADC (1 << 23) | ||
164 | |||
165 | #define PCAP_ADC_BANK_0 0 | ||
166 | #define PCAP_ADC_BANK_1 1 | ||
167 | /* ADC bank 0 */ | ||
168 | #define PCAP_ADC_CH_COIN 0 | ||
169 | #define PCAP_ADC_CH_BATT 1 | ||
170 | #define PCAP_ADC_CH_BPLUS 2 | ||
171 | #define PCAP_ADC_CH_MOBPORTB 3 | ||
172 | #define PCAP_ADC_CH_TEMPERATURE 4 | ||
173 | #define PCAP_ADC_CH_CHARGER_ID 5 | ||
174 | #define PCAP_ADC_CH_AD6 6 | ||
175 | /* ADC bank 1 */ | ||
176 | #define PCAP_ADC_CH_AD7 0 | ||
177 | #define PCAP_ADC_CH_AD8 1 | ||
178 | #define PCAP_ADC_CH_AD9 2 | ||
179 | #define PCAP_ADC_CH_TS_X1 3 | ||
180 | #define PCAP_ADC_CH_TS_X2 4 | ||
181 | #define PCAP_ADC_CH_TS_Y1 5 | ||
182 | #define PCAP_ADC_CH_TS_Y2 6 | ||
183 | |||
184 | #define PCAP_ADC_T_NOW 0 | ||
185 | #define PCAP_ADC_T_IN_BURST 1 | ||
186 | #define PCAP_ADC_T_OUT_BURST 2 | ||
187 | |||
188 | #define PCAP_ADC_ATO_IN_BURST 6 | ||
189 | #define PCAP_ADC_ATO_OUT_BURST 0 | ||
190 | |||
191 | #define PCAP_ADC_TS_M_XY 1 | ||
192 | #define PCAP_ADC_TS_M_PRESSURE 2 | ||
193 | #define PCAP_ADC_TS_M_PLATE_X 3 | ||
194 | #define PCAP_ADC_TS_M_PLATE_Y 4 | ||
195 | #define PCAP_ADC_TS_M_STANDBY 5 | ||
196 | #define PCAP_ADC_TS_M_NONTS 6 | ||
197 | |||
198 | #define PCAP_ADR_ADD1_MASK 0x000003ff | ||
199 | #define PCAP_ADR_ADD1_SHIFT 0 | ||
200 | #define PCAP_ADR_ADD2_MASK 0x000ffc00 | ||
201 | #define PCAP_ADR_ADD2_SHIFT 10 | ||
202 | #define PCAP_ADR_ADINC1 (1 << 20) | ||
203 | #define PCAP_ADR_ADINC2 (1 << 21) | ||
204 | #define PCAP_ADR_ASC (1 << 22) | ||
205 | #define PCAP_ADR_ONESHOT (1 << 23) | ||
206 | |||
207 | #define PCAP_BUSCTRL_FSENB (1 << 0) | ||
208 | #define PCAP_BUSCTRL_USB_SUSPEND (1 << 1) | ||
209 | #define PCAP_BUSCTRL_USB_PU (1 << 2) | ||
210 | #define PCAP_BUSCTRL_USB_PD (1 << 3) | ||
211 | #define PCAP_BUSCTRL_VUSB_EN (1 << 4) | ||
212 | #define PCAP_BUSCTRL_USB_PS (1 << 5) | ||
213 | #define PCAP_BUSCTRL_VUSB_MSTR_EN (1 << 6) | ||
214 | #define PCAP_BUSCTRL_VBUS_PD_ENB (1 << 7) | ||
215 | #define PCAP_BUSCTRL_CURRLIM (1 << 8) | ||
216 | #define PCAP_BUSCTRL_RS232ENB (1 << 9) | ||
217 | #define PCAP_BUSCTRL_RS232_DIR (1 << 10) | ||
218 | #define PCAP_BUSCTRL_SE0_CONN (1 << 11) | ||
219 | #define PCAP_BUSCTRL_USB_PDM (1 << 12) | ||
220 | #define PCAP_BUSCTRL_BUS_PRI_ADJ (1 << 24) | ||
221 | |||
222 | /* leds */ | ||
223 | #define PCAP_LED0 0 | ||
224 | #define PCAP_LED1 1 | ||
225 | #define PCAP_BL0 2 | ||
226 | #define PCAP_BL1 3 | ||
227 | #define PCAP_VIB 4 | ||
228 | #define PCAP_LED_3MA 0 | ||
229 | #define PCAP_LED_4MA 1 | ||
230 | #define PCAP_LED_5MA 2 | ||
231 | #define PCAP_LED_9MA 3 | ||
232 | #define PCAP_LED_GPIO_VAL_MASK 0x00ffffff | ||
233 | #define PCAP_LED_GPIO_EN 0x01000000 | ||
234 | #define PCAP_LED_GPIO_INVERT 0x02000000 | ||
235 | #define PCAP_LED_T_MASK 0xf | ||
236 | #define PCAP_LED_C_MASK 0x3 | ||
237 | #define PCAP_BL_MASK 0x1f | ||
238 | #define PCAP_BL0_SHIFT 0 | ||
239 | #define PCAP_LED0_EN (1 << 5) | ||
240 | #define PCAP_LED1_EN (1 << 6) | ||
241 | #define PCAP_LED0_T_SHIFT 7 | ||
242 | #define PCAP_LED1_T_SHIFT 11 | ||
243 | #define PCAP_LED0_C_SHIFT 15 | ||
244 | #define PCAP_LED1_C_SHIFT 17 | ||
245 | #define PCAP_BL1_SHIFT 20 | ||
246 | #define PCAP_VIB_MASK 0x3 | ||
247 | #define PCAP_VIB_SHIFT 20 | ||
248 | #define PCAP_VIB_EN (1 << 19) | ||
249 | |||
250 | /* RTC */ | ||
251 | #define PCAP_RTC_DAY_MASK 0x3fff | ||
252 | #define PCAP_RTC_TOD_MASK 0xffff | ||
253 | #define PCAP_RTC_PC_MASK 0x7 | ||
254 | #define SEC_PER_DAY 86400 | ||
255 | |||
256 | #endif | ||
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h index 516d955ab8a1..6b9c5d06690c 100644 --- a/include/linux/mfd/tmio.h +++ b/include/linux/mfd/tmio.h | |||
@@ -19,6 +19,13 @@ | |||
19 | } while (0) | 19 | } while (0) |
20 | 20 | ||
21 | /* | 21 | /* |
22 | * data for the MMC controller | ||
23 | */ | ||
24 | struct tmio_mmc_data { | ||
25 | const unsigned int hclk; | ||
26 | }; | ||
27 | |||
28 | /* | ||
22 | * data for the NAND controller | 29 | * data for the NAND controller |
23 | */ | 30 | */ |
24 | struct tmio_nand_data { | 31 | struct tmio_nand_data { |
diff --git a/include/linux/mg_disk.h b/include/linux/mg_disk.h new file mode 100644 index 000000000000..e11f4d9f1c2e --- /dev/null +++ b/include/linux/mg_disk.h | |||
@@ -0,0 +1,45 @@ | |||
1 | /* | ||
2 | * include/linux/mg_disk.c | ||
3 | * | ||
4 | * Private data for mflash platform driver | ||
5 | * | ||
6 | * (c) 2008 mGine Co.,LTD | ||
7 | * (c) 2008 unsik Kim <donari75@gmail.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License version 2 as | ||
11 | * published by the Free Software Foundation. | ||
12 | */ | ||
13 | |||
14 | #ifndef __MG_DISK_H__ | ||
15 | #define __MG_DISK_H__ | ||
16 | |||
17 | /* name for platform device */ | ||
18 | #define MG_DEV_NAME "mg_disk" | ||
19 | |||
20 | /* names of GPIO resource */ | ||
21 | #define MG_RST_PIN "mg_rst" | ||
22 | /* except MG_BOOT_DEV, reset-out pin should be assigned */ | ||
23 | #define MG_RSTOUT_PIN "mg_rstout" | ||
24 | |||
25 | /* device attribution */ | ||
26 | /* use mflash as boot device */ | ||
27 | #define MG_BOOT_DEV (1 << 0) | ||
28 | /* use mflash as storage device */ | ||
29 | #define MG_STORAGE_DEV (1 << 1) | ||
30 | /* same as MG_STORAGE_DEV, but bootloader already done reset sequence */ | ||
31 | #define MG_STORAGE_DEV_SKIP_RST (1 << 2) | ||
32 | |||
33 | /* private driver data */ | ||
34 | struct mg_drv_data { | ||
35 | /* disk resource */ | ||
36 | u32 use_polling; | ||
37 | |||
38 | /* device attribution */ | ||
39 | u32 dev_attr; | ||
40 | |||
41 | /* internally used */ | ||
42 | void *host; | ||
43 | }; | ||
44 | |||
45 | #endif | ||
diff --git a/include/linux/mii.h b/include/linux/mii.h index ad748588faf1..359fba880274 100644 --- a/include/linux/mii.h +++ b/include/linux/mii.h | |||
@@ -240,6 +240,22 @@ static inline unsigned int mii_duplex (unsigned int duplex_lock, | |||
240 | } | 240 | } |
241 | 241 | ||
242 | /** | 242 | /** |
243 | * mii_advertise_flowctrl - get flow control advertisement flags | ||
244 | * @cap: Flow control capabilities (FLOW_CTRL_RX, FLOW_CTRL_TX or both) | ||
245 | */ | ||
246 | static inline u16 mii_advertise_flowctrl(int cap) | ||
247 | { | ||
248 | u16 adv = 0; | ||
249 | |||
250 | if (cap & FLOW_CTRL_RX) | ||
251 | adv = ADVERTISE_PAUSE_CAP | ADVERTISE_PAUSE_ASYM; | ||
252 | if (cap & FLOW_CTRL_TX) | ||
253 | adv ^= ADVERTISE_PAUSE_ASYM; | ||
254 | |||
255 | return adv; | ||
256 | } | ||
257 | |||
258 | /** | ||
243 | * mii_resolve_flowctrl_fdx | 259 | * mii_resolve_flowctrl_fdx |
244 | * @lcladv: value of MII ADVERTISE register | 260 | * @lcladv: value of MII ADVERTISE register |
245 | * @rmtadv: value of MII LPA register | 261 | * @rmtadv: value of MII LPA register |
@@ -250,18 +266,12 @@ static inline u8 mii_resolve_flowctrl_fdx(u16 lcladv, u16 rmtadv) | |||
250 | { | 266 | { |
251 | u8 cap = 0; | 267 | u8 cap = 0; |
252 | 268 | ||
253 | if (lcladv & ADVERTISE_PAUSE_CAP) { | 269 | if (lcladv & rmtadv & ADVERTISE_PAUSE_CAP) { |
254 | if (lcladv & ADVERTISE_PAUSE_ASYM) { | 270 | cap = FLOW_CTRL_TX | FLOW_CTRL_RX; |
255 | if (rmtadv & LPA_PAUSE_CAP) | 271 | } else if (lcladv & rmtadv & ADVERTISE_PAUSE_ASYM) { |
256 | cap = FLOW_CTRL_TX | FLOW_CTRL_RX; | 272 | if (lcladv & ADVERTISE_PAUSE_CAP) |
257 | else if (rmtadv & LPA_PAUSE_ASYM) | 273 | cap = FLOW_CTRL_RX; |
258 | cap = FLOW_CTRL_RX; | 274 | else if (rmtadv & ADVERTISE_PAUSE_CAP) |
259 | } else { | ||
260 | if (rmtadv & LPA_PAUSE_CAP) | ||
261 | cap = FLOW_CTRL_TX | FLOW_CTRL_RX; | ||
262 | } | ||
263 | } else if (lcladv & ADVERTISE_PAUSE_ASYM) { | ||
264 | if ((rmtadv & LPA_PAUSE_CAP) && (rmtadv & LPA_PAUSE_ASYM)) | ||
265 | cap = FLOW_CTRL_TX; | 275 | cap = FLOW_CTRL_TX; |
266 | } | 276 | } |
267 | 277 | ||
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h index beb6ec99cfef..052117744629 100644 --- a/include/linux/miscdevice.h +++ b/include/linux/miscdevice.h | |||
@@ -41,6 +41,7 @@ struct miscdevice { | |||
41 | struct list_head list; | 41 | struct list_head list; |
42 | struct device *parent; | 42 | struct device *parent; |
43 | struct device *this_device; | 43 | struct device *this_device; |
44 | const char *devnode; | ||
44 | }; | 45 | }; |
45 | 46 | ||
46 | extern int misc_register(struct miscdevice * misc); | 47 | extern int misc_register(struct miscdevice * misc); |
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h index 3aff8a6a389e..ce7cc6c7bcbb 100644 --- a/include/linux/mlx4/device.h +++ b/include/linux/mlx4/device.h | |||
@@ -210,6 +210,7 @@ struct mlx4_caps { | |||
210 | int num_comp_vectors; | 210 | int num_comp_vectors; |
211 | int num_mpts; | 211 | int num_mpts; |
212 | int num_mtt_segs; | 212 | int num_mtt_segs; |
213 | int mtts_per_seg; | ||
213 | int fmr_reserved_mtts; | 214 | int fmr_reserved_mtts; |
214 | int reserved_mtts; | 215 | int reserved_mtts; |
215 | int reserved_mrws; | 216 | int reserved_mrws; |
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h index bf8f11982dae..9f29d86e5dc9 100644 --- a/include/linux/mlx4/qp.h +++ b/include/linux/mlx4/qp.h | |||
@@ -165,6 +165,7 @@ enum { | |||
165 | MLX4_WQE_CTRL_IP_CSUM = 1 << 4, | 165 | MLX4_WQE_CTRL_IP_CSUM = 1 << 4, |
166 | MLX4_WQE_CTRL_TCP_UDP_CSUM = 1 << 5, | 166 | MLX4_WQE_CTRL_TCP_UDP_CSUM = 1 << 5, |
167 | MLX4_WQE_CTRL_INS_VLAN = 1 << 6, | 167 | MLX4_WQE_CTRL_INS_VLAN = 1 << 6, |
168 | MLX4_WQE_CTRL_STRONG_ORDER = 1 << 7, | ||
168 | }; | 169 | }; |
169 | 170 | ||
170 | struct mlx4_wqe_ctrl_seg { | 171 | struct mlx4_wqe_ctrl_seg { |
diff --git a/include/linux/mm.h b/include/linux/mm.h index ad613ed66ab0..ba3a7cb1eaa0 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -7,7 +7,6 @@ | |||
7 | 7 | ||
8 | #include <linux/gfp.h> | 8 | #include <linux/gfp.h> |
9 | #include <linux/list.h> | 9 | #include <linux/list.h> |
10 | #include <linux/mmdebug.h> | ||
11 | #include <linux/mmzone.h> | 10 | #include <linux/mmzone.h> |
12 | #include <linux/rbtree.h> | 11 | #include <linux/rbtree.h> |
13 | #include <linux/prio_tree.h> | 12 | #include <linux/prio_tree.h> |
@@ -725,7 +724,7 @@ static inline int shmem_lock(struct file *file, int lock, | |||
725 | return 0; | 724 | return 0; |
726 | } | 725 | } |
727 | #endif | 726 | #endif |
728 | struct file *shmem_file_setup(char *name, loff_t size, unsigned long flags); | 727 | struct file *shmem_file_setup(const char *name, loff_t size, unsigned long flags); |
729 | 728 | ||
730 | int shmem_zero_setup(struct vm_area_struct *); | 729 | int shmem_zero_setup(struct vm_area_struct *); |
731 | 730 | ||
@@ -793,6 +792,8 @@ int copy_page_range(struct mm_struct *dst, struct mm_struct *src, | |||
793 | struct vm_area_struct *vma); | 792 | struct vm_area_struct *vma); |
794 | void unmap_mapping_range(struct address_space *mapping, | 793 | void unmap_mapping_range(struct address_space *mapping, |
795 | loff_t const holebegin, loff_t const holelen, int even_cows); | 794 | loff_t const holebegin, loff_t const holelen, int even_cows); |
795 | int follow_pfn(struct vm_area_struct *vma, unsigned long address, | ||
796 | unsigned long *pfn); | ||
796 | int follow_phys(struct vm_area_struct *vma, unsigned long address, | 797 | int follow_phys(struct vm_area_struct *vma, unsigned long address, |
797 | unsigned int flags, unsigned long *prot, resource_size_t *phys); | 798 | unsigned int flags, unsigned long *prot, resource_size_t *phys); |
798 | int generic_access_phys(struct vm_area_struct *vma, unsigned long addr, | 799 | int generic_access_phys(struct vm_area_struct *vma, unsigned long addr, |
@@ -809,11 +810,11 @@ extern int vmtruncate_range(struct inode * inode, loff_t offset, loff_t end); | |||
809 | 810 | ||
810 | #ifdef CONFIG_MMU | 811 | #ifdef CONFIG_MMU |
811 | extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, | 812 | extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, |
812 | unsigned long address, int write_access); | 813 | unsigned long address, unsigned int flags); |
813 | #else | 814 | #else |
814 | static inline int handle_mm_fault(struct mm_struct *mm, | 815 | static inline int handle_mm_fault(struct mm_struct *mm, |
815 | struct vm_area_struct *vma, unsigned long address, | 816 | struct vm_area_struct *vma, unsigned long address, |
816 | int write_access) | 817 | unsigned int flags) |
817 | { | 818 | { |
818 | /* should never happen if there's no MMU */ | 819 | /* should never happen if there's no MMU */ |
819 | BUG(); | 820 | BUG(); |
@@ -824,8 +825,11 @@ static inline int handle_mm_fault(struct mm_struct *mm, | |||
824 | extern int make_pages_present(unsigned long addr, unsigned long end); | 825 | extern int make_pages_present(unsigned long addr, unsigned long end); |
825 | extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); | 826 | extern int access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write); |
826 | 827 | ||
827 | int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, | 828 | int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, |
828 | int len, int write, int force, struct page **pages, struct vm_area_struct **vmas); | 829 | unsigned long start, int nr_pages, int write, int force, |
830 | struct page **pages, struct vm_area_struct **vmas); | ||
831 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, | ||
832 | struct page **pages); | ||
829 | 833 | ||
830 | extern int try_to_release_page(struct page * page, gfp_t gfp_mask); | 834 | extern int try_to_release_page(struct page * page, gfp_t gfp_mask); |
831 | extern void do_invalidatepage(struct page *page, unsigned long offset); | 835 | extern void do_invalidatepage(struct page *page, unsigned long offset); |
@@ -850,17 +854,10 @@ extern int mprotect_fixup(struct vm_area_struct *vma, | |||
850 | unsigned long end, unsigned long newflags); | 854 | unsigned long end, unsigned long newflags); |
851 | 855 | ||
852 | /* | 856 | /* |
853 | * get_user_pages_fast provides equivalent functionality to get_user_pages, | 857 | * doesn't attempt to fault and will return short. |
854 | * operating on current and current->mm (force=0 and doesn't return any vmas). | ||
855 | * | ||
856 | * get_user_pages_fast may take mmap_sem and page tables, so no assumptions | ||
857 | * can be made about locking. get_user_pages_fast is to be implemented in a | ||
858 | * way that is advantageous (vs get_user_pages()) when the user memory area is | ||
859 | * already faulted in and present in ptes. However if the pages have to be | ||
860 | * faulted in, it may turn out to be slightly slower). | ||
861 | */ | 858 | */ |
862 | int get_user_pages_fast(unsigned long start, int nr_pages, int write, | 859 | int __get_user_pages_fast(unsigned long start, int nr_pages, int write, |
863 | struct page **pages); | 860 | struct page **pages); |
864 | 861 | ||
865 | /* | 862 | /* |
866 | * A callback you can register to apply pressure to ageable caches. | 863 | * A callback you can register to apply pressure to ageable caches. |
@@ -1061,7 +1058,8 @@ extern int __meminit __early_pfn_to_nid(unsigned long pfn); | |||
1061 | extern void set_dma_reserve(unsigned long new_dma_reserve); | 1058 | extern void set_dma_reserve(unsigned long new_dma_reserve); |
1062 | extern void memmap_init_zone(unsigned long, int, unsigned long, | 1059 | extern void memmap_init_zone(unsigned long, int, unsigned long, |
1063 | unsigned long, enum memmap_context); | 1060 | unsigned long, enum memmap_context); |
1064 | extern void setup_per_zone_pages_min(void); | 1061 | extern void setup_per_zone_wmarks(void); |
1062 | extern void calculate_zone_inactive_ratio(struct zone *zone); | ||
1065 | extern void mem_init(void); | 1063 | extern void mem_init(void); |
1066 | extern void __init mmap_init(void); | 1064 | extern void __init mmap_init(void); |
1067 | extern void show_mem(void); | 1065 | extern void show_mem(void); |
@@ -1178,8 +1176,6 @@ void task_dirty_inc(struct task_struct *tsk); | |||
1178 | #define VM_MAX_READAHEAD 128 /* kbytes */ | 1176 | #define VM_MAX_READAHEAD 128 /* kbytes */ |
1179 | #define VM_MIN_READAHEAD 16 /* kbytes (includes current page) */ | 1177 | #define VM_MIN_READAHEAD 16 /* kbytes (includes current page) */ |
1180 | 1178 | ||
1181 | int do_page_cache_readahead(struct address_space *mapping, struct file *filp, | ||
1182 | pgoff_t offset, unsigned long nr_to_read); | ||
1183 | int force_page_cache_readahead(struct address_space *mapping, struct file *filp, | 1179 | int force_page_cache_readahead(struct address_space *mapping, struct file *filp, |
1184 | pgoff_t offset, unsigned long nr_to_read); | 1180 | pgoff_t offset, unsigned long nr_to_read); |
1185 | 1181 | ||
@@ -1197,6 +1193,9 @@ void page_cache_async_readahead(struct address_space *mapping, | |||
1197 | unsigned long size); | 1193 | unsigned long size); |
1198 | 1194 | ||
1199 | unsigned long max_sane_readahead(unsigned long nr); | 1195 | unsigned long max_sane_readahead(unsigned long nr); |
1196 | unsigned long ra_submit(struct file_ra_state *ra, | ||
1197 | struct address_space *mapping, | ||
1198 | struct file *filp); | ||
1200 | 1199 | ||
1201 | /* Do stack extension */ | 1200 | /* Do stack extension */ |
1202 | extern int expand_stack(struct vm_area_struct *vma, unsigned long address); | 1201 | extern int expand_stack(struct vm_area_struct *vma, unsigned long address); |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h index 0e80e26ecf21..7acc8439d9b3 100644 --- a/include/linux/mm_types.h +++ b/include/linux/mm_types.h | |||
@@ -98,6 +98,14 @@ struct page { | |||
98 | #ifdef CONFIG_WANT_PAGE_DEBUG_FLAGS | 98 | #ifdef CONFIG_WANT_PAGE_DEBUG_FLAGS |
99 | unsigned long debug_flags; /* Use atomic bitops on this */ | 99 | unsigned long debug_flags; /* Use atomic bitops on this */ |
100 | #endif | 100 | #endif |
101 | |||
102 | #ifdef CONFIG_KMEMCHECK | ||
103 | /* | ||
104 | * kmemcheck wants to track the status of each byte in a page; this | ||
105 | * is a pointer to such a status block. NULL if not tracked. | ||
106 | */ | ||
107 | void *shadow; | ||
108 | #endif | ||
101 | }; | 109 | }; |
102 | 110 | ||
103 | /* | 111 | /* |
@@ -232,6 +240,8 @@ struct mm_struct { | |||
232 | 240 | ||
233 | unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ | 241 | unsigned long saved_auxv[AT_VECTOR_SIZE]; /* for /proc/PID/auxv */ |
234 | 242 | ||
243 | s8 oom_adj; /* OOM kill score adjustment (bit shift) */ | ||
244 | |||
235 | cpumask_t cpu_vm_mask; | 245 | cpumask_t cpu_vm_mask; |
236 | 246 | ||
237 | /* Architecture-specific MM context */ | 247 | /* Architecture-specific MM context */ |
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h index ea1bf5ba092f..39751c8cde9c 100644 --- a/include/linux/mmc/sdio_ids.h +++ b/include/linux/mmc/sdio_ids.h | |||
@@ -25,5 +25,15 @@ | |||
25 | 25 | ||
26 | #define SDIO_VENDOR_ID_MARVELL 0x02df | 26 | #define SDIO_VENDOR_ID_MARVELL 0x02df |
27 | #define SDIO_DEVICE_ID_MARVELL_LIBERTAS 0x9103 | 27 | #define SDIO_DEVICE_ID_MARVELL_LIBERTAS 0x9103 |
28 | #define SDIO_DEVICE_ID_MARVELL_8688WLAN 0x9104 | ||
29 | #define SDIO_DEVICE_ID_MARVELL_8688BT 0x9105 | ||
30 | |||
31 | #define SDIO_VENDOR_ID_SIANO 0x039a | ||
32 | #define SDIO_DEVICE_ID_SIANO_NOVA_B0 0x0201 | ||
33 | #define SDIO_DEVICE_ID_SIANO_NICE 0x0202 | ||
34 | #define SDIO_DEVICE_ID_SIANO_VEGA_A0 0x0300 | ||
35 | #define SDIO_DEVICE_ID_SIANO_VENICE 0x0301 | ||
36 | #define SDIO_DEVICE_ID_SIANO_NOVA_A0 0x1100 | ||
37 | #define SDIO_DEVICE_ID_SIANO_STELLAR 0x5347 | ||
28 | 38 | ||
29 | #endif | 39 | #endif |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index a47c879e1304..889598537370 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -50,9 +50,6 @@ extern int page_group_by_mobility_disabled; | |||
50 | 50 | ||
51 | static inline int get_pageblock_migratetype(struct page *page) | 51 | static inline int get_pageblock_migratetype(struct page *page) |
52 | { | 52 | { |
53 | if (unlikely(page_group_by_mobility_disabled)) | ||
54 | return MIGRATE_UNMOVABLE; | ||
55 | |||
56 | return get_pageblock_flags_group(page, PB_migrate, PB_migrate_end); | 53 | return get_pageblock_flags_group(page, PB_migrate, PB_migrate_end); |
57 | } | 54 | } |
58 | 55 | ||
@@ -86,13 +83,8 @@ enum zone_stat_item { | |||
86 | NR_ACTIVE_ANON, /* " " " " " */ | 83 | NR_ACTIVE_ANON, /* " " " " " */ |
87 | NR_INACTIVE_FILE, /* " " " " " */ | 84 | NR_INACTIVE_FILE, /* " " " " " */ |
88 | NR_ACTIVE_FILE, /* " " " " " */ | 85 | NR_ACTIVE_FILE, /* " " " " " */ |
89 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
90 | NR_UNEVICTABLE, /* " " " " " */ | 86 | NR_UNEVICTABLE, /* " " " " " */ |
91 | NR_MLOCK, /* mlock()ed pages found and moved off LRU */ | 87 | NR_MLOCK, /* mlock()ed pages found and moved off LRU */ |
92 | #else | ||
93 | NR_UNEVICTABLE = NR_ACTIVE_FILE, /* avoid compiler errors in dead code */ | ||
94 | NR_MLOCK = NR_ACTIVE_FILE, | ||
95 | #endif | ||
96 | NR_ANON_PAGES, /* Mapped anonymous pages */ | 88 | NR_ANON_PAGES, /* Mapped anonymous pages */ |
97 | NR_FILE_MAPPED, /* pagecache pages mapped into pagetables. | 89 | NR_FILE_MAPPED, /* pagecache pages mapped into pagetables. |
98 | only modified from process context */ | 90 | only modified from process context */ |
@@ -135,11 +127,7 @@ enum lru_list { | |||
135 | LRU_ACTIVE_ANON = LRU_BASE + LRU_ACTIVE, | 127 | LRU_ACTIVE_ANON = LRU_BASE + LRU_ACTIVE, |
136 | LRU_INACTIVE_FILE = LRU_BASE + LRU_FILE, | 128 | LRU_INACTIVE_FILE = LRU_BASE + LRU_FILE, |
137 | LRU_ACTIVE_FILE = LRU_BASE + LRU_FILE + LRU_ACTIVE, | 129 | LRU_ACTIVE_FILE = LRU_BASE + LRU_FILE + LRU_ACTIVE, |
138 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
139 | LRU_UNEVICTABLE, | 130 | LRU_UNEVICTABLE, |
140 | #else | ||
141 | LRU_UNEVICTABLE = LRU_ACTIVE_FILE, /* avoid compiler errors in dead code */ | ||
142 | #endif | ||
143 | NR_LRU_LISTS | 131 | NR_LRU_LISTS |
144 | }; | 132 | }; |
145 | 133 | ||
@@ -159,13 +147,20 @@ static inline int is_active_lru(enum lru_list l) | |||
159 | 147 | ||
160 | static inline int is_unevictable_lru(enum lru_list l) | 148 | static inline int is_unevictable_lru(enum lru_list l) |
161 | { | 149 | { |
162 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
163 | return (l == LRU_UNEVICTABLE); | 150 | return (l == LRU_UNEVICTABLE); |
164 | #else | ||
165 | return 0; | ||
166 | #endif | ||
167 | } | 151 | } |
168 | 152 | ||
153 | enum zone_watermarks { | ||
154 | WMARK_MIN, | ||
155 | WMARK_LOW, | ||
156 | WMARK_HIGH, | ||
157 | NR_WMARK | ||
158 | }; | ||
159 | |||
160 | #define min_wmark_pages(z) (z->watermark[WMARK_MIN]) | ||
161 | #define low_wmark_pages(z) (z->watermark[WMARK_LOW]) | ||
162 | #define high_wmark_pages(z) (z->watermark[WMARK_HIGH]) | ||
163 | |||
169 | struct per_cpu_pages { | 164 | struct per_cpu_pages { |
170 | int count; /* number of pages in the list */ | 165 | int count; /* number of pages in the list */ |
171 | int high; /* high watermark, emptying needed */ | 166 | int high; /* high watermark, emptying needed */ |
@@ -278,7 +273,10 @@ struct zone_reclaim_stat { | |||
278 | 273 | ||
279 | struct zone { | 274 | struct zone { |
280 | /* Fields commonly accessed by the page allocator */ | 275 | /* Fields commonly accessed by the page allocator */ |
281 | unsigned long pages_min, pages_low, pages_high; | 276 | |
277 | /* zone watermarks, access with *_wmark_pages(zone) macros */ | ||
278 | unsigned long watermark[NR_WMARK]; | ||
279 | |||
282 | /* | 280 | /* |
283 | * We don't know if the memory that we're going to allocate will be freeable | 281 | * We don't know if the memory that we're going to allocate will be freeable |
284 | * or/and it will be released eventually, so to avoid totally wasting several | 282 | * or/and it will be released eventually, so to avoid totally wasting several |
@@ -323,9 +321,9 @@ struct zone { | |||
323 | 321 | ||
324 | /* Fields commonly accessed by the page reclaim scanner */ | 322 | /* Fields commonly accessed by the page reclaim scanner */ |
325 | spinlock_t lru_lock; | 323 | spinlock_t lru_lock; |
326 | struct { | 324 | struct zone_lru { |
327 | struct list_head list; | 325 | struct list_head list; |
328 | unsigned long nr_scan; | 326 | unsigned long nr_saved_scan; /* accumulated for batching */ |
329 | } lru[NR_LRU_LISTS]; | 327 | } lru[NR_LRU_LISTS]; |
330 | 328 | ||
331 | struct zone_reclaim_stat reclaim_stat; | 329 | struct zone_reclaim_stat reclaim_stat; |
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h index 3a059298cc19..d74785c2393a 100644 --- a/include/linux/mnt_namespace.h +++ b/include/linux/mnt_namespace.h | |||
@@ -2,10 +2,9 @@ | |||
2 | #define _NAMESPACE_H_ | 2 | #define _NAMESPACE_H_ |
3 | #ifdef __KERNEL__ | 3 | #ifdef __KERNEL__ |
4 | 4 | ||
5 | #include <linux/mount.h> | 5 | #include <linux/path.h> |
6 | #include <linux/sched.h> | ||
7 | #include <linux/nsproxy.h> | ||
8 | #include <linux/seq_file.h> | 6 | #include <linux/seq_file.h> |
7 | #include <linux/wait.h> | ||
9 | 8 | ||
10 | struct mnt_namespace { | 9 | struct mnt_namespace { |
11 | atomic_t count; | 10 | atomic_t count; |
@@ -24,24 +23,10 @@ struct proc_mounts { | |||
24 | 23 | ||
25 | struct fs_struct; | 24 | struct fs_struct; |
26 | 25 | ||
26 | extern struct mnt_namespace *create_mnt_ns(struct vfsmount *mnt); | ||
27 | extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *, | 27 | extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *, |
28 | struct fs_struct *); | 28 | struct fs_struct *); |
29 | extern void __put_mnt_ns(struct mnt_namespace *ns); | 29 | extern void put_mnt_ns(struct mnt_namespace *ns); |
30 | |||
31 | static inline void put_mnt_ns(struct mnt_namespace *ns) | ||
32 | { | ||
33 | if (atomic_dec_and_lock(&ns->count, &vfsmount_lock)) | ||
34 | /* releases vfsmount_lock */ | ||
35 | __put_mnt_ns(ns); | ||
36 | } | ||
37 | |||
38 | static inline void exit_mnt_ns(struct task_struct *p) | ||
39 | { | ||
40 | struct mnt_namespace *ns = p->nsproxy->mnt_ns; | ||
41 | if (ns) | ||
42 | put_mnt_ns(ns); | ||
43 | } | ||
44 | |||
45 | static inline void get_mnt_ns(struct mnt_namespace *ns) | 30 | static inline void get_mnt_ns(struct mnt_namespace *ns) |
46 | { | 31 | { |
47 | atomic_inc(&ns->count); | 32 | atomic_inc(&ns->count); |
diff --git a/include/linux/module.h b/include/linux/module.h index a8f2c0aa4c32..098bdb7bfacf 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -77,6 +77,7 @@ search_extable(const struct exception_table_entry *first, | |||
77 | void sort_extable(struct exception_table_entry *start, | 77 | void sort_extable(struct exception_table_entry *start, |
78 | struct exception_table_entry *finish); | 78 | struct exception_table_entry *finish); |
79 | void sort_main_extable(void); | 79 | void sort_main_extable(void); |
80 | void trim_init_extable(struct module *m); | ||
80 | 81 | ||
81 | #ifdef MODULE | 82 | #ifdef MODULE |
82 | #define MODULE_GENERIC_TABLE(gtype,name) \ | 83 | #define MODULE_GENERIC_TABLE(gtype,name) \ |
@@ -362,6 +363,12 @@ struct module | |||
362 | local_t ref; | 363 | local_t ref; |
363 | #endif | 364 | #endif |
364 | #endif | 365 | #endif |
366 | |||
367 | #ifdef CONFIG_CONSTRUCTORS | ||
368 | /* Constructor functions. */ | ||
369 | ctor_fn_t *ctors; | ||
370 | unsigned int num_ctors; | ||
371 | #endif | ||
365 | }; | 372 | }; |
366 | #ifndef MODULE_ARCH_INIT | 373 | #ifndef MODULE_ARCH_INIT |
367 | #define MODULE_ARCH_INIT {} | 374 | #define MODULE_ARCH_INIT {} |
@@ -696,4 +703,21 @@ static inline void module_remove_modinfo_attrs(struct module *mod) | |||
696 | 703 | ||
697 | #define __MODULE_STRING(x) __stringify(x) | 704 | #define __MODULE_STRING(x) __stringify(x) |
698 | 705 | ||
706 | |||
707 | #ifdef CONFIG_GENERIC_BUG | ||
708 | int module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, | ||
709 | struct module *); | ||
710 | void module_bug_cleanup(struct module *); | ||
711 | |||
712 | #else /* !CONFIG_GENERIC_BUG */ | ||
713 | |||
714 | static inline int module_bug_finalize(const Elf_Ehdr *hdr, | ||
715 | const Elf_Shdr *sechdrs, | ||
716 | struct module *mod) | ||
717 | { | ||
718 | return 0; | ||
719 | } | ||
720 | static inline void module_bug_cleanup(struct module *mod) {} | ||
721 | #endif /* CONFIG_GENERIC_BUG */ | ||
722 | |||
699 | #endif /* _LINUX_MODULE_H */ | 723 | #endif /* _LINUX_MODULE_H */ |
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h index a4f0b931846c..6547c3cdbc4c 100644 --- a/include/linux/moduleparam.h +++ b/include/linux/moduleparam.h | |||
@@ -36,9 +36,14 @@ typedef int (*param_set_fn)(const char *val, struct kernel_param *kp); | |||
36 | /* Returns length written or -errno. Buffer is 4k (ie. be short!) */ | 36 | /* Returns length written or -errno. Buffer is 4k (ie. be short!) */ |
37 | typedef int (*param_get_fn)(char *buffer, struct kernel_param *kp); | 37 | typedef int (*param_get_fn)(char *buffer, struct kernel_param *kp); |
38 | 38 | ||
39 | /* Flag bits for kernel_param.flags */ | ||
40 | #define KPARAM_KMALLOCED 1 | ||
41 | #define KPARAM_ISBOOL 2 | ||
42 | |||
39 | struct kernel_param { | 43 | struct kernel_param { |
40 | const char *name; | 44 | const char *name; |
41 | unsigned int perm; | 45 | u16 perm; |
46 | u16 flags; | ||
42 | param_set_fn set; | 47 | param_set_fn set; |
43 | param_get_fn get; | 48 | param_get_fn get; |
44 | union { | 49 | union { |
@@ -79,7 +84,7 @@ struct kparam_array | |||
79 | parameters. perm sets the visibility in sysfs: 000 means it's | 84 | parameters. perm sets the visibility in sysfs: 000 means it's |
80 | not there, read bits mean it's readable, write bits mean it's | 85 | not there, read bits mean it's readable, write bits mean it's |
81 | writable. */ | 86 | writable. */ |
82 | #define __module_param_call(prefix, name, set, get, arg, perm) \ | 87 | #define __module_param_call(prefix, name, set, get, arg, isbool, perm) \ |
83 | /* Default value instead of permissions? */ \ | 88 | /* Default value instead of permissions? */ \ |
84 | static int __param_perm_check_##name __attribute__((unused)) = \ | 89 | static int __param_perm_check_##name __attribute__((unused)) = \ |
85 | BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)) \ | 90 | BUILD_BUG_ON_ZERO((perm) < 0 || (perm) > 0777 || ((perm) & 2)) \ |
@@ -88,10 +93,13 @@ struct kparam_array | |||
88 | static struct kernel_param __moduleparam_const __param_##name \ | 93 | static struct kernel_param __moduleparam_const __param_##name \ |
89 | __used \ | 94 | __used \ |
90 | __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \ | 95 | __attribute__ ((unused,__section__ ("__param"),aligned(sizeof(void *)))) \ |
91 | = { __param_str_##name, perm, set, get, { arg } } | 96 | = { __param_str_##name, perm, isbool ? KPARAM_ISBOOL : 0, \ |
97 | set, get, { arg } } | ||
92 | 98 | ||
93 | #define module_param_call(name, set, get, arg, perm) \ | 99 | #define module_param_call(name, set, get, arg, perm) \ |
94 | __module_param_call(MODULE_PARAM_PREFIX, name, set, get, arg, perm) | 100 | __module_param_call(MODULE_PARAM_PREFIX, \ |
101 | name, set, get, arg, \ | ||
102 | __same_type(*(arg), bool), perm) | ||
95 | 103 | ||
96 | /* Helper functions: type is byte, short, ushort, int, uint, long, | 104 | /* Helper functions: type is byte, short, ushort, int, uint, long, |
97 | ulong, charp, bool or invbool, or XXX if you define param_get_XXX, | 105 | ulong, charp, bool or invbool, or XXX if you define param_get_XXX, |
@@ -120,15 +128,16 @@ struct kparam_array | |||
120 | #define core_param(name, var, type, perm) \ | 128 | #define core_param(name, var, type, perm) \ |
121 | param_check_##type(name, &(var)); \ | 129 | param_check_##type(name, &(var)); \ |
122 | __module_param_call("", name, param_set_##type, param_get_##type, \ | 130 | __module_param_call("", name, param_set_##type, param_get_##type, \ |
123 | &var, perm) | 131 | &var, __same_type(var, bool), perm) |
124 | #endif /* !MODULE */ | 132 | #endif /* !MODULE */ |
125 | 133 | ||
126 | /* Actually copy string: maxlen param is usually sizeof(string). */ | 134 | /* Actually copy string: maxlen param is usually sizeof(string). */ |
127 | #define module_param_string(name, string, len, perm) \ | 135 | #define module_param_string(name, string, len, perm) \ |
128 | static const struct kparam_string __param_string_##name \ | 136 | static const struct kparam_string __param_string_##name \ |
129 | = { len, string }; \ | 137 | = { len, string }; \ |
130 | module_param_call(name, param_set_copystring, param_get_string, \ | 138 | __module_param_call(MODULE_PARAM_PREFIX, name, \ |
131 | .str = &__param_string_##name, perm); \ | 139 | param_set_copystring, param_get_string, \ |
140 | .str = &__param_string_##name, 0, perm); \ | ||
132 | __MODULE_PARM_TYPE(name, "string") | 141 | __MODULE_PARM_TYPE(name, "string") |
133 | 142 | ||
134 | /* Called on module insert or kernel boot */ | 143 | /* Called on module insert or kernel boot */ |
@@ -186,21 +195,30 @@ extern int param_set_charp(const char *val, struct kernel_param *kp); | |||
186 | extern int param_get_charp(char *buffer, struct kernel_param *kp); | 195 | extern int param_get_charp(char *buffer, struct kernel_param *kp); |
187 | #define param_check_charp(name, p) __param_check(name, p, char *) | 196 | #define param_check_charp(name, p) __param_check(name, p, char *) |
188 | 197 | ||
198 | /* For historical reasons "bool" parameters can be (unsigned) "int". */ | ||
189 | extern int param_set_bool(const char *val, struct kernel_param *kp); | 199 | extern int param_set_bool(const char *val, struct kernel_param *kp); |
190 | extern int param_get_bool(char *buffer, struct kernel_param *kp); | 200 | extern int param_get_bool(char *buffer, struct kernel_param *kp); |
191 | #define param_check_bool(name, p) __param_check(name, p, int) | 201 | #define param_check_bool(name, p) \ |
202 | static inline void __check_##name(void) \ | ||
203 | { \ | ||
204 | BUILD_BUG_ON(!__same_type(*(p), bool) && \ | ||
205 | !__same_type(*(p), unsigned int) && \ | ||
206 | !__same_type(*(p), int)); \ | ||
207 | } | ||
192 | 208 | ||
193 | extern int param_set_invbool(const char *val, struct kernel_param *kp); | 209 | extern int param_set_invbool(const char *val, struct kernel_param *kp); |
194 | extern int param_get_invbool(char *buffer, struct kernel_param *kp); | 210 | extern int param_get_invbool(char *buffer, struct kernel_param *kp); |
195 | #define param_check_invbool(name, p) __param_check(name, p, int) | 211 | #define param_check_invbool(name, p) __param_check(name, p, bool) |
196 | 212 | ||
197 | /* Comma-separated array: *nump is set to number they actually specified. */ | 213 | /* Comma-separated array: *nump is set to number they actually specified. */ |
198 | #define module_param_array_named(name, array, type, nump, perm) \ | 214 | #define module_param_array_named(name, array, type, nump, perm) \ |
199 | static const struct kparam_array __param_arr_##name \ | 215 | static const struct kparam_array __param_arr_##name \ |
200 | = { ARRAY_SIZE(array), nump, param_set_##type, param_get_##type,\ | 216 | = { ARRAY_SIZE(array), nump, param_set_##type, param_get_##type,\ |
201 | sizeof(array[0]), array }; \ | 217 | sizeof(array[0]), array }; \ |
202 | module_param_call(name, param_array_set, param_array_get, \ | 218 | __module_param_call(MODULE_PARAM_PREFIX, name, \ |
203 | .arr = &__param_arr_##name, perm); \ | 219 | param_array_set, param_array_get, \ |
220 | .arr = &__param_arr_##name, \ | ||
221 | __same_type(array[0], bool), perm); \ | ||
204 | __MODULE_PARM_TYPE(name, "array of " #type) | 222 | __MODULE_PARM_TYPE(name, "array of " #type) |
205 | 223 | ||
206 | #define module_param_array(name, type, nump, perm) \ | 224 | #define module_param_array(name, type, nump, perm) \ |
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 7efb9be34662..4030ebada49e 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -563,6 +563,7 @@ extern int nand_do_read(struct mtd_info *mtd, loff_t from, size_t len, | |||
563 | * @options: Option flags, e.g. 16bit buswidth | 563 | * @options: Option flags, e.g. 16bit buswidth |
564 | * @ecclayout: ecc layout info structure | 564 | * @ecclayout: ecc layout info structure |
565 | * @part_probe_types: NULL-terminated array of probe types | 565 | * @part_probe_types: NULL-terminated array of probe types |
566 | * @set_parts: platform specific function to set partitions | ||
566 | * @priv: hardware controller specific settings | 567 | * @priv: hardware controller specific settings |
567 | */ | 568 | */ |
568 | struct platform_nand_chip { | 569 | struct platform_nand_chip { |
@@ -574,26 +575,41 @@ struct platform_nand_chip { | |||
574 | int chip_delay; | 575 | int chip_delay; |
575 | unsigned int options; | 576 | unsigned int options; |
576 | const char **part_probe_types; | 577 | const char **part_probe_types; |
578 | void (*set_parts)(uint64_t size, | ||
579 | struct platform_nand_chip *chip); | ||
577 | void *priv; | 580 | void *priv; |
578 | }; | 581 | }; |
579 | 582 | ||
583 | /* Keep gcc happy */ | ||
584 | struct platform_device; | ||
585 | |||
580 | /** | 586 | /** |
581 | * struct platform_nand_ctrl - controller level device structure | 587 | * struct platform_nand_ctrl - controller level device structure |
588 | * @probe: platform specific function to probe/setup hardware | ||
589 | * @remove: platform specific function to remove/teardown hardware | ||
582 | * @hwcontrol: platform specific hardware control structure | 590 | * @hwcontrol: platform specific hardware control structure |
583 | * @dev_ready: platform specific function to read ready/busy pin | 591 | * @dev_ready: platform specific function to read ready/busy pin |
584 | * @select_chip: platform specific chip select function | 592 | * @select_chip: platform specific chip select function |
585 | * @cmd_ctrl: platform specific function for controlling | 593 | * @cmd_ctrl: platform specific function for controlling |
586 | * ALE/CLE/nCE. Also used to write command and address | 594 | * ALE/CLE/nCE. Also used to write command and address |
595 | * @write_buf: platform specific function for write buffer | ||
596 | * @read_buf: platform specific function for read buffer | ||
587 | * @priv: private data to transport driver specific settings | 597 | * @priv: private data to transport driver specific settings |
588 | * | 598 | * |
589 | * All fields are optional and depend on the hardware driver requirements | 599 | * All fields are optional and depend on the hardware driver requirements |
590 | */ | 600 | */ |
591 | struct platform_nand_ctrl { | 601 | struct platform_nand_ctrl { |
602 | int (*probe)(struct platform_device *pdev); | ||
603 | void (*remove)(struct platform_device *pdev); | ||
592 | void (*hwcontrol)(struct mtd_info *mtd, int cmd); | 604 | void (*hwcontrol)(struct mtd_info *mtd, int cmd); |
593 | int (*dev_ready)(struct mtd_info *mtd); | 605 | int (*dev_ready)(struct mtd_info *mtd); |
594 | void (*select_chip)(struct mtd_info *mtd, int chip); | 606 | void (*select_chip)(struct mtd_info *mtd, int chip); |
595 | void (*cmd_ctrl)(struct mtd_info *mtd, int dat, | 607 | void (*cmd_ctrl)(struct mtd_info *mtd, int dat, |
596 | unsigned int ctrl); | 608 | unsigned int ctrl); |
609 | void (*write_buf)(struct mtd_info *mtd, | ||
610 | const uint8_t *buf, int len); | ||
611 | void (*read_buf)(struct mtd_info *mtd, | ||
612 | uint8_t *buf, int len); | ||
597 | void *priv; | 613 | void *priv; |
598 | }; | 614 | }; |
599 | 615 | ||
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h index 9aa2a9149b58..8ed873374381 100644 --- a/include/linux/mtd/onenand.h +++ b/include/linux/mtd/onenand.h | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/mtd/onenand_regs.h> | 17 | #include <linux/mtd/onenand_regs.h> |
18 | #include <linux/mtd/bbm.h> | 18 | #include <linux/mtd/bbm.h> |
19 | 19 | ||
20 | #define MAX_DIES 2 | ||
20 | #define MAX_BUFFERRAM 2 | 21 | #define MAX_BUFFERRAM 2 |
21 | 22 | ||
22 | /* Scan and identify a OneNAND device */ | 23 | /* Scan and identify a OneNAND device */ |
@@ -51,7 +52,12 @@ struct onenand_bufferram { | |||
51 | /** | 52 | /** |
52 | * struct onenand_chip - OneNAND Private Flash Chip Data | 53 | * struct onenand_chip - OneNAND Private Flash Chip Data |
53 | * @base: [BOARDSPECIFIC] address to access OneNAND | 54 | * @base: [BOARDSPECIFIC] address to access OneNAND |
55 | * @dies: [INTERN][FLEX-ONENAND] number of dies on chip | ||
56 | * @boundary: [INTERN][FLEX-ONENAND] Boundary of the dies | ||
57 | * @diesize: [INTERN][FLEX-ONENAND] Size of the dies | ||
54 | * @chipsize: [INTERN] the size of one chip for multichip arrays | 58 | * @chipsize: [INTERN] the size of one chip for multichip arrays |
59 | * FIXME For Flex-OneNAND, chipsize holds maximum possible | ||
60 | * device size ie when all blocks are considered MLC | ||
55 | * @device_id: [INTERN] device ID | 61 | * @device_id: [INTERN] device ID |
56 | * @density_mask: chip density, used for DDP devices | 62 | * @density_mask: chip density, used for DDP devices |
57 | * @verstion_id: [INTERN] version ID | 63 | * @verstion_id: [INTERN] version ID |
@@ -68,6 +74,8 @@ struct onenand_bufferram { | |||
68 | * @command: [REPLACEABLE] hardware specific function for writing | 74 | * @command: [REPLACEABLE] hardware specific function for writing |
69 | * commands to the chip | 75 | * commands to the chip |
70 | * @wait: [REPLACEABLE] hardware specific function for wait on ready | 76 | * @wait: [REPLACEABLE] hardware specific function for wait on ready |
77 | * @bbt_wait: [REPLACEABLE] hardware specific function for bbt wait on ready | ||
78 | * @unlock_all: [REPLACEABLE] hardware specific function for unlock all | ||
71 | * @read_bufferram: [REPLACEABLE] hardware specific function for BufferRAM Area | 79 | * @read_bufferram: [REPLACEABLE] hardware specific function for BufferRAM Area |
72 | * @write_bufferram: [REPLACEABLE] hardware specific function for BufferRAM Area | 80 | * @write_bufferram: [REPLACEABLE] hardware specific function for BufferRAM Area |
73 | * @read_word: [REPLACEABLE] hardware specific function for read | 81 | * @read_word: [REPLACEABLE] hardware specific function for read |
@@ -92,9 +100,13 @@ struct onenand_bufferram { | |||
92 | */ | 100 | */ |
93 | struct onenand_chip { | 101 | struct onenand_chip { |
94 | void __iomem *base; | 102 | void __iomem *base; |
103 | unsigned dies; | ||
104 | unsigned boundary[MAX_DIES]; | ||
105 | loff_t diesize[MAX_DIES]; | ||
95 | unsigned int chipsize; | 106 | unsigned int chipsize; |
96 | unsigned int device_id; | 107 | unsigned int device_id; |
97 | unsigned int version_id; | 108 | unsigned int version_id; |
109 | unsigned int technology; | ||
98 | unsigned int density_mask; | 110 | unsigned int density_mask; |
99 | unsigned int options; | 111 | unsigned int options; |
100 | 112 | ||
@@ -108,6 +120,8 @@ struct onenand_chip { | |||
108 | 120 | ||
109 | int (*command)(struct mtd_info *mtd, int cmd, loff_t address, size_t len); | 121 | int (*command)(struct mtd_info *mtd, int cmd, loff_t address, size_t len); |
110 | int (*wait)(struct mtd_info *mtd, int state); | 122 | int (*wait)(struct mtd_info *mtd, int state); |
123 | int (*bbt_wait)(struct mtd_info *mtd, int state); | ||
124 | void (*unlock_all)(struct mtd_info *mtd); | ||
111 | int (*read_bufferram)(struct mtd_info *mtd, int area, | 125 | int (*read_bufferram)(struct mtd_info *mtd, int area, |
112 | unsigned char *buffer, int offset, size_t count); | 126 | unsigned char *buffer, int offset, size_t count); |
113 | int (*write_bufferram)(struct mtd_info *mtd, int area, | 127 | int (*write_bufferram)(struct mtd_info *mtd, int area, |
@@ -145,6 +159,8 @@ struct onenand_chip { | |||
145 | #define ONENAND_SET_BUFFERRAM0(this) (this->bufferram_index = 0) | 159 | #define ONENAND_SET_BUFFERRAM0(this) (this->bufferram_index = 0) |
146 | #define ONENAND_SET_BUFFERRAM1(this) (this->bufferram_index = 1) | 160 | #define ONENAND_SET_BUFFERRAM1(this) (this->bufferram_index = 1) |
147 | 161 | ||
162 | #define FLEXONENAND(this) \ | ||
163 | (this->device_id & DEVICE_IS_FLEXONENAND) | ||
148 | #define ONENAND_GET_SYS_CFG1(this) \ | 164 | #define ONENAND_GET_SYS_CFG1(this) \ |
149 | (this->read_word(this->base + ONENAND_REG_SYS_CFG1)) | 165 | (this->read_word(this->base + ONENAND_REG_SYS_CFG1)) |
150 | #define ONENAND_SET_SYS_CFG1(v, this) \ | 166 | #define ONENAND_SET_SYS_CFG1(v, this) \ |
@@ -153,6 +169,9 @@ struct onenand_chip { | |||
153 | #define ONENAND_IS_DDP(this) \ | 169 | #define ONENAND_IS_DDP(this) \ |
154 | (this->device_id & ONENAND_DEVICE_IS_DDP) | 170 | (this->device_id & ONENAND_DEVICE_IS_DDP) |
155 | 171 | ||
172 | #define ONENAND_IS_MLC(this) \ | ||
173 | (this->technology & ONENAND_TECHNOLOGY_IS_MLC) | ||
174 | |||
156 | #ifdef CONFIG_MTD_ONENAND_2X_PROGRAM | 175 | #ifdef CONFIG_MTD_ONENAND_2X_PROGRAM |
157 | #define ONENAND_IS_2PLANE(this) \ | 176 | #define ONENAND_IS_2PLANE(this) \ |
158 | (this->options & ONENAND_HAS_2PLANE) | 177 | (this->options & ONENAND_HAS_2PLANE) |
@@ -169,6 +188,7 @@ struct onenand_chip { | |||
169 | #define ONENAND_HAS_CONT_LOCK (0x0001) | 188 | #define ONENAND_HAS_CONT_LOCK (0x0001) |
170 | #define ONENAND_HAS_UNLOCK_ALL (0x0002) | 189 | #define ONENAND_HAS_UNLOCK_ALL (0x0002) |
171 | #define ONENAND_HAS_2PLANE (0x0004) | 190 | #define ONENAND_HAS_2PLANE (0x0004) |
191 | #define ONENAND_SKIP_UNLOCK_CHECK (0x0100) | ||
172 | #define ONENAND_PAGEBUF_ALLOC (0x1000) | 192 | #define ONENAND_PAGEBUF_ALLOC (0x1000) |
173 | #define ONENAND_OOBBUF_ALLOC (0x2000) | 193 | #define ONENAND_OOBBUF_ALLOC (0x2000) |
174 | 194 | ||
@@ -176,6 +196,7 @@ struct onenand_chip { | |||
176 | * OneNAND Flash Manufacturer ID Codes | 196 | * OneNAND Flash Manufacturer ID Codes |
177 | */ | 197 | */ |
178 | #define ONENAND_MFR_SAMSUNG 0xec | 198 | #define ONENAND_MFR_SAMSUNG 0xec |
199 | #define ONENAND_MFR_NUMONYX 0x20 | ||
179 | 200 | ||
180 | /** | 201 | /** |
181 | * struct onenand_manufacturers - NAND Flash Manufacturer ID Structure | 202 | * struct onenand_manufacturers - NAND Flash Manufacturer ID Structure |
@@ -189,5 +210,8 @@ struct onenand_manufacturers { | |||
189 | 210 | ||
190 | int onenand_bbt_read_oob(struct mtd_info *mtd, loff_t from, | 211 | int onenand_bbt_read_oob(struct mtd_info *mtd, loff_t from, |
191 | struct mtd_oob_ops *ops); | 212 | struct mtd_oob_ops *ops); |
213 | unsigned onenand_block(struct onenand_chip *this, loff_t addr); | ||
214 | loff_t onenand_addr(struct onenand_chip *this, int block); | ||
215 | int flexonenand_region(struct mtd_info *mtd, loff_t addr); | ||
192 | 216 | ||
193 | #endif /* __LINUX_MTD_ONENAND_H */ | 217 | #endif /* __LINUX_MTD_ONENAND_H */ |
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h index 0c6bbe28f38c..86a6bbef6465 100644 --- a/include/linux/mtd/onenand_regs.h +++ b/include/linux/mtd/onenand_regs.h | |||
@@ -67,6 +67,9 @@ | |||
67 | /* | 67 | /* |
68 | * Device ID Register F001h (R) | 68 | * Device ID Register F001h (R) |
69 | */ | 69 | */ |
70 | #define DEVICE_IS_FLEXONENAND (1 << 9) | ||
71 | #define FLEXONENAND_PI_MASK (0x3ff) | ||
72 | #define FLEXONENAND_PI_UNLOCK_SHIFT (14) | ||
70 | #define ONENAND_DEVICE_DENSITY_MASK (0xf) | 73 | #define ONENAND_DEVICE_DENSITY_MASK (0xf) |
71 | #define ONENAND_DEVICE_DENSITY_SHIFT (4) | 74 | #define ONENAND_DEVICE_DENSITY_SHIFT (4) |
72 | #define ONENAND_DEVICE_IS_DDP (1 << 3) | 75 | #define ONENAND_DEVICE_IS_DDP (1 << 3) |
@@ -84,6 +87,11 @@ | |||
84 | #define ONENAND_VERSION_PROCESS_SHIFT (8) | 87 | #define ONENAND_VERSION_PROCESS_SHIFT (8) |
85 | 88 | ||
86 | /* | 89 | /* |
90 | * Technology Register F006h (R) | ||
91 | */ | ||
92 | #define ONENAND_TECHNOLOGY_IS_MLC (1 << 0) | ||
93 | |||
94 | /* | ||
87 | * Start Address 1 F100h (R/W) & Start Address 2 F101h (R/W) | 95 | * Start Address 1 F100h (R/W) & Start Address 2 F101h (R/W) |
88 | */ | 96 | */ |
89 | #define ONENAND_DDP_SHIFT (15) | 97 | #define ONENAND_DDP_SHIFT (15) |
@@ -93,7 +101,8 @@ | |||
93 | /* | 101 | /* |
94 | * Start Address 8 F107h (R/W) | 102 | * Start Address 8 F107h (R/W) |
95 | */ | 103 | */ |
96 | #define ONENAND_FPA_MASK (0x3f) | 104 | /* Note: It's actually 0x3f in case of SLC */ |
105 | #define ONENAND_FPA_MASK (0x7f) | ||
97 | #define ONENAND_FPA_SHIFT (2) | 106 | #define ONENAND_FPA_SHIFT (2) |
98 | #define ONENAND_FSA_MASK (0x03) | 107 | #define ONENAND_FSA_MASK (0x03) |
99 | 108 | ||
@@ -105,7 +114,8 @@ | |||
105 | #define ONENAND_BSA_BOOTRAM (0 << 2) | 114 | #define ONENAND_BSA_BOOTRAM (0 << 2) |
106 | #define ONENAND_BSA_DATARAM0 (2 << 2) | 115 | #define ONENAND_BSA_DATARAM0 (2 << 2) |
107 | #define ONENAND_BSA_DATARAM1 (3 << 2) | 116 | #define ONENAND_BSA_DATARAM1 (3 << 2) |
108 | #define ONENAND_BSC_MASK (0x03) | 117 | /* Note: It's actually 0x03 in case of SLC */ |
118 | #define ONENAND_BSC_MASK (0x07) | ||
109 | 119 | ||
110 | /* | 120 | /* |
111 | * Command Register F220h (R/W) | 121 | * Command Register F220h (R/W) |
@@ -124,9 +134,13 @@ | |||
124 | #define ONENAND_CMD_RESET (0xF0) | 134 | #define ONENAND_CMD_RESET (0xF0) |
125 | #define ONENAND_CMD_OTP_ACCESS (0x65) | 135 | #define ONENAND_CMD_OTP_ACCESS (0x65) |
126 | #define ONENAND_CMD_READID (0x90) | 136 | #define ONENAND_CMD_READID (0x90) |
137 | #define FLEXONENAND_CMD_PI_UPDATE (0x05) | ||
138 | #define FLEXONENAND_CMD_PI_ACCESS (0x66) | ||
139 | #define FLEXONENAND_CMD_RECOVER_LSB (0x05) | ||
127 | 140 | ||
128 | /* NOTE: Those are not *REAL* commands */ | 141 | /* NOTE: Those are not *REAL* commands */ |
129 | #define ONENAND_CMD_BUFFERRAM (0x1978) | 142 | #define ONENAND_CMD_BUFFERRAM (0x1978) |
143 | #define FLEXONENAND_CMD_READ_PI (0x1985) | ||
130 | 144 | ||
131 | /* | 145 | /* |
132 | * System Configuration 1 Register F221h (R, R/W) | 146 | * System Configuration 1 Register F221h (R, R/W) |
@@ -192,10 +206,12 @@ | |||
192 | #define ONENAND_ECC_1BIT_ALL (0x5555) | 206 | #define ONENAND_ECC_1BIT_ALL (0x5555) |
193 | #define ONENAND_ECC_2BIT (1 << 1) | 207 | #define ONENAND_ECC_2BIT (1 << 1) |
194 | #define ONENAND_ECC_2BIT_ALL (0xAAAA) | 208 | #define ONENAND_ECC_2BIT_ALL (0xAAAA) |
209 | #define FLEXONENAND_UNCORRECTABLE_ERROR (0x1010) | ||
195 | 210 | ||
196 | /* | 211 | /* |
197 | * One-Time Programmable (OTP) | 212 | * One-Time Programmable (OTP) |
198 | */ | 213 | */ |
214 | #define FLEXONENAND_OTP_LOCK_OFFSET (2048) | ||
199 | #define ONENAND_OTP_LOCK_OFFSET (14) | 215 | #define ONENAND_OTP_LOCK_OFFSET (14) |
200 | 216 | ||
201 | #endif /* __ONENAND_REG_H */ | 217 | #endif /* __ONENAND_REG_H */ |
diff --git a/include/linux/mtd/partitions.h b/include/linux/mtd/partitions.h index 7535a74083b9..af6dcb992bc3 100644 --- a/include/linux/mtd/partitions.h +++ b/include/linux/mtd/partitions.h | |||
@@ -40,7 +40,6 @@ struct mtd_partition { | |||
40 | uint64_t offset; /* offset within the master MTD space */ | 40 | uint64_t offset; /* offset within the master MTD space */ |
41 | uint32_t mask_flags; /* master MTD flags to mask out for this partition */ | 41 | uint32_t mask_flags; /* master MTD flags to mask out for this partition */ |
42 | struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only)*/ | 42 | struct nand_ecclayout *ecclayout; /* out of band layout for this partition (NAND only)*/ |
43 | struct mtd_info **mtdp; /* pointer to store the MTD object */ | ||
44 | }; | 43 | }; |
45 | 44 | ||
46 | #define MTDPART_OFS_NXTBLK (-2) | 45 | #define MTDPART_OFS_NXTBLK (-2) |
diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h index 6316fafe5c2a..6913b71d9ab2 100644 --- a/include/linux/mtd/ubi.h +++ b/include/linux/mtd/ubi.h | |||
@@ -132,6 +132,39 @@ struct ubi_device_info { | |||
132 | dev_t cdev; | 132 | dev_t cdev; |
133 | }; | 133 | }; |
134 | 134 | ||
135 | /* | ||
136 | * enum - volume notification types. | ||
137 | * @UBI_VOLUME_ADDED: volume has been added | ||
138 | * @UBI_VOLUME_REMOVED: start volume volume | ||
139 | * @UBI_VOLUME_RESIZED: volume size has been re-sized | ||
140 | * @UBI_VOLUME_RENAMED: volume name has been re-named | ||
141 | * @UBI_VOLUME_UPDATED: volume name has been updated | ||
142 | * | ||
143 | * These constants define which type of event has happened when a volume | ||
144 | * notification function is invoked. | ||
145 | */ | ||
146 | enum { | ||
147 | UBI_VOLUME_ADDED, | ||
148 | UBI_VOLUME_REMOVED, | ||
149 | UBI_VOLUME_RESIZED, | ||
150 | UBI_VOLUME_RENAMED, | ||
151 | UBI_VOLUME_UPDATED, | ||
152 | }; | ||
153 | |||
154 | /* | ||
155 | * struct ubi_notification - UBI notification description structure. | ||
156 | * @di: UBI device description object | ||
157 | * @vi: UBI volume description object | ||
158 | * | ||
159 | * UBI notifiers are called with a pointer to an object of this type. The | ||
160 | * object describes the notification. Namely, it provides a description of the | ||
161 | * UBI device and UBI volume the notification informs about. | ||
162 | */ | ||
163 | struct ubi_notification { | ||
164 | struct ubi_device_info di; | ||
165 | struct ubi_volume_info vi; | ||
166 | }; | ||
167 | |||
135 | /* UBI descriptor given to users when they open UBI volumes */ | 168 | /* UBI descriptor given to users when they open UBI volumes */ |
136 | struct ubi_volume_desc; | 169 | struct ubi_volume_desc; |
137 | 170 | ||
@@ -141,6 +174,10 @@ void ubi_get_volume_info(struct ubi_volume_desc *desc, | |||
141 | struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode); | 174 | struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode); |
142 | struct ubi_volume_desc *ubi_open_volume_nm(int ubi_num, const char *name, | 175 | struct ubi_volume_desc *ubi_open_volume_nm(int ubi_num, const char *name, |
143 | int mode); | 176 | int mode); |
177 | int ubi_register_volume_notifier(struct notifier_block *nb, | ||
178 | int ignore_existing); | ||
179 | int ubi_unregister_volume_notifier(struct notifier_block *nb); | ||
180 | |||
144 | void ubi_close_volume(struct ubi_volume_desc *desc); | 181 | void ubi_close_volume(struct ubi_volume_desc *desc); |
145 | int ubi_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset, | 182 | int ubi_leb_read(struct ubi_volume_desc *desc, int lnum, char *buf, int offset, |
146 | int len, int check); | 183 | int len, int check); |
diff --git a/include/linux/net_dropmon.h b/include/linux/net_dropmon.h index 0e2e100c44a2..3ceb0cc1bc78 100644 --- a/include/linux/net_dropmon.h +++ b/include/linux/net_dropmon.h | |||
@@ -3,12 +3,20 @@ | |||
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/netlink.h> | 5 | #include <linux/netlink.h> |
6 | #include <linux/types.h> | ||
6 | 7 | ||
7 | struct net_dm_drop_point { | 8 | struct net_dm_drop_point { |
8 | __u8 pc[8]; | 9 | __u8 pc[8]; |
9 | __u32 count; | 10 | __u32 count; |
10 | }; | 11 | }; |
11 | 12 | ||
13 | #define is_drop_point_hw(x) do {\ | ||
14 | int ____i, ____j;\ | ||
15 | for (____i = 0; ____i < 8; i ____i++)\ | ||
16 | ____j |= x[____i];\ | ||
17 | ____j;\ | ||
18 | } while (0) | ||
19 | |||
12 | #define NET_DM_CFG_VERSION 0 | 20 | #define NET_DM_CFG_VERSION 0 |
13 | #define NET_DM_CFG_ALERT_COUNT 1 | 21 | #define NET_DM_CFG_ALERT_COUNT 1 |
14 | #define NET_DM_CFG_ALERT_DELAY 2 | 22 | #define NET_DM_CFG_ALERT_DELAY 2 |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 5a96a1a406e9..d4a4d9867794 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -39,9 +39,11 @@ | |||
39 | 39 | ||
40 | #include <linux/device.h> | 40 | #include <linux/device.h> |
41 | #include <linux/percpu.h> | 41 | #include <linux/percpu.h> |
42 | #include <linux/rculist.h> | ||
42 | #include <linux/dmaengine.h> | 43 | #include <linux/dmaengine.h> |
43 | #include <linux/workqueue.h> | 44 | #include <linux/workqueue.h> |
44 | 45 | ||
46 | #include <linux/ethtool.h> | ||
45 | #include <net/net_namespace.h> | 47 | #include <net/net_namespace.h> |
46 | #include <net/dsa.h> | 48 | #include <net/dsa.h> |
47 | #ifdef CONFIG_DCB | 49 | #ifdef CONFIG_DCB |
@@ -49,7 +51,6 @@ | |||
49 | #endif | 51 | #endif |
50 | 52 | ||
51 | struct vlan_group; | 53 | struct vlan_group; |
52 | struct ethtool_ops; | ||
53 | struct netpoll_info; | 54 | struct netpoll_info; |
54 | /* 802.11 specific */ | 55 | /* 802.11 specific */ |
55 | struct wireless_dev; | 56 | struct wireless_dev; |
@@ -210,6 +211,24 @@ struct dev_addr_list | |||
210 | #define dmi_users da_users | 211 | #define dmi_users da_users |
211 | #define dmi_gusers da_gusers | 212 | #define dmi_gusers da_gusers |
212 | 213 | ||
214 | struct netdev_hw_addr { | ||
215 | struct list_head list; | ||
216 | unsigned char addr[MAX_ADDR_LEN]; | ||
217 | unsigned char type; | ||
218 | #define NETDEV_HW_ADDR_T_LAN 1 | ||
219 | #define NETDEV_HW_ADDR_T_SAN 2 | ||
220 | #define NETDEV_HW_ADDR_T_SLAVE 3 | ||
221 | #define NETDEV_HW_ADDR_T_UNICAST 4 | ||
222 | int refcount; | ||
223 | bool synced; | ||
224 | struct rcu_head rcu_head; | ||
225 | }; | ||
226 | |||
227 | struct netdev_hw_addr_list { | ||
228 | struct list_head list; | ||
229 | int count; | ||
230 | }; | ||
231 | |||
213 | struct hh_cache | 232 | struct hh_cache |
214 | { | 233 | { |
215 | struct hh_cache *hh_next; /* Next entry */ | 234 | struct hh_cache *hh_next; /* Next entry */ |
@@ -447,12 +466,25 @@ enum netdev_queue_state_t | |||
447 | }; | 466 | }; |
448 | 467 | ||
449 | struct netdev_queue { | 468 | struct netdev_queue { |
469 | /* | ||
470 | * read mostly part | ||
471 | */ | ||
450 | struct net_device *dev; | 472 | struct net_device *dev; |
451 | struct Qdisc *qdisc; | 473 | struct Qdisc *qdisc; |
452 | unsigned long state; | 474 | unsigned long state; |
453 | spinlock_t _xmit_lock; | ||
454 | int xmit_lock_owner; | ||
455 | struct Qdisc *qdisc_sleeping; | 475 | struct Qdisc *qdisc_sleeping; |
476 | /* | ||
477 | * write mostly part | ||
478 | */ | ||
479 | spinlock_t _xmit_lock ____cacheline_aligned_in_smp; | ||
480 | int xmit_lock_owner; | ||
481 | /* | ||
482 | * please use this field instead of dev->trans_start | ||
483 | */ | ||
484 | unsigned long trans_start; | ||
485 | unsigned long tx_bytes; | ||
486 | unsigned long tx_packets; | ||
487 | unsigned long tx_dropped; | ||
456 | } ____cacheline_aligned_in_smp; | 488 | } ____cacheline_aligned_in_smp; |
457 | 489 | ||
458 | 490 | ||
@@ -670,7 +702,9 @@ struct net_device | |||
670 | #define NETIF_F_GRO 16384 /* Generic receive offload */ | 702 | #define NETIF_F_GRO 16384 /* Generic receive offload */ |
671 | #define NETIF_F_LRO 32768 /* large receive offload */ | 703 | #define NETIF_F_LRO 32768 /* large receive offload */ |
672 | 704 | ||
705 | /* the GSO_MASK reserves bits 16 through 23 */ | ||
673 | #define NETIF_F_FCOE_CRC (1 << 24) /* FCoE CRC32 */ | 706 | #define NETIF_F_FCOE_CRC (1 << 24) /* FCoE CRC32 */ |
707 | #define NETIF_F_SCTP_CSUM (1 << 25) /* SCTP checksum offload */ | ||
674 | 708 | ||
675 | /* Segmentation offload features */ | 709 | /* Segmentation offload features */ |
676 | #define NETIF_F_GSO_SHIFT 16 | 710 | #define NETIF_F_GSO_SHIFT 16 |
@@ -747,10 +781,10 @@ struct net_device | |||
747 | unsigned char addr_len; /* hardware address length */ | 781 | unsigned char addr_len; /* hardware address length */ |
748 | unsigned short dev_id; /* for shared network cards */ | 782 | unsigned short dev_id; /* for shared network cards */ |
749 | 783 | ||
750 | spinlock_t addr_list_lock; | 784 | struct netdev_hw_addr_list uc; /* Secondary unicast |
751 | struct dev_addr_list *uc_list; /* Secondary unicast mac addresses */ | 785 | mac addresses */ |
752 | int uc_count; /* Number of installed ucasts */ | ||
753 | int uc_promisc; | 786 | int uc_promisc; |
787 | spinlock_t addr_list_lock; | ||
754 | struct dev_addr_list *mc_list; /* Multicast mac addresses */ | 788 | struct dev_addr_list *mc_list; /* Multicast mac addresses */ |
755 | int mc_count; /* Number of installed mcasts */ | 789 | int mc_count; /* Number of installed mcasts */ |
756 | unsigned int promiscuity; | 790 | unsigned int promiscuity; |
@@ -776,8 +810,12 @@ struct net_device | |||
776 | */ | 810 | */ |
777 | unsigned long last_rx; /* Time of last Rx */ | 811 | unsigned long last_rx; /* Time of last Rx */ |
778 | /* Interface address info used in eth_type_trans() */ | 812 | /* Interface address info used in eth_type_trans() */ |
779 | unsigned char dev_addr[MAX_ADDR_LEN]; /* hw address, (before bcast | 813 | unsigned char *dev_addr; /* hw address, (before bcast |
780 | because most packets are unicast) */ | 814 | because most packets are |
815 | unicast) */ | ||
816 | |||
817 | struct netdev_hw_addr_list dev_addrs; /* list of device | ||
818 | hw addresses */ | ||
781 | 819 | ||
782 | unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ | 820 | unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ |
783 | 821 | ||
@@ -797,6 +835,11 @@ struct net_device | |||
797 | * One part is mostly used on xmit path (device) | 835 | * One part is mostly used on xmit path (device) |
798 | */ | 836 | */ |
799 | /* These may be needed for future network-power-down code. */ | 837 | /* These may be needed for future network-power-down code. */ |
838 | |||
839 | /* | ||
840 | * trans_start here is expensive for high speed devices on SMP, | ||
841 | * please use netdev_queue->trans_start instead. | ||
842 | */ | ||
800 | unsigned long trans_start; /* Time (in jiffies) of last Tx */ | 843 | unsigned long trans_start; /* Time (in jiffies) of last Tx */ |
801 | 844 | ||
802 | int watchdog_timeo; /* used by dev_watchdog() */ | 845 | int watchdog_timeo; /* used by dev_watchdog() */ |
@@ -867,49 +910,10 @@ struct net_device | |||
867 | /* max exchange id for FCoE LRO by ddp */ | 910 | /* max exchange id for FCoE LRO by ddp */ |
868 | unsigned int fcoe_ddp_xid; | 911 | unsigned int fcoe_ddp_xid; |
869 | #endif | 912 | #endif |
870 | |||
871 | #ifdef CONFIG_COMPAT_NET_DEV_OPS | ||
872 | struct { | ||
873 | int (*init)(struct net_device *dev); | ||
874 | void (*uninit)(struct net_device *dev); | ||
875 | int (*open)(struct net_device *dev); | ||
876 | int (*stop)(struct net_device *dev); | ||
877 | int (*hard_start_xmit) (struct sk_buff *skb, | ||
878 | struct net_device *dev); | ||
879 | u16 (*select_queue)(struct net_device *dev, | ||
880 | struct sk_buff *skb); | ||
881 | void (*change_rx_flags)(struct net_device *dev, | ||
882 | int flags); | ||
883 | void (*set_rx_mode)(struct net_device *dev); | ||
884 | void (*set_multicast_list)(struct net_device *dev); | ||
885 | int (*set_mac_address)(struct net_device *dev, | ||
886 | void *addr); | ||
887 | int (*validate_addr)(struct net_device *dev); | ||
888 | int (*do_ioctl)(struct net_device *dev, | ||
889 | struct ifreq *ifr, int cmd); | ||
890 | int (*set_config)(struct net_device *dev, | ||
891 | struct ifmap *map); | ||
892 | int (*change_mtu)(struct net_device *dev, int new_mtu); | ||
893 | int (*neigh_setup)(struct net_device *dev, | ||
894 | struct neigh_parms *); | ||
895 | void (*tx_timeout) (struct net_device *dev); | ||
896 | struct net_device_stats* (*get_stats)(struct net_device *dev); | ||
897 | void (*vlan_rx_register)(struct net_device *dev, | ||
898 | struct vlan_group *grp); | ||
899 | void (*vlan_rx_add_vid)(struct net_device *dev, | ||
900 | unsigned short vid); | ||
901 | void (*vlan_rx_kill_vid)(struct net_device *dev, | ||
902 | unsigned short vid); | ||
903 | #ifdef CONFIG_NET_POLL_CONTROLLER | ||
904 | void (*poll_controller)(struct net_device *dev); | ||
905 | #endif | ||
906 | }; | ||
907 | #endif | ||
908 | }; | 913 | }; |
909 | #define to_net_dev(d) container_of(d, struct net_device, dev) | 914 | #define to_net_dev(d) container_of(d, struct net_device, dev) |
910 | 915 | ||
911 | #define NETDEV_ALIGN 32 | 916 | #define NETDEV_ALIGN 32 |
912 | #define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1) | ||
913 | 917 | ||
914 | static inline | 918 | static inline |
915 | struct netdev_queue *netdev_get_tx_queue(const struct net_device *dev, | 919 | struct netdev_queue *netdev_get_tx_queue(const struct net_device *dev, |
@@ -980,9 +984,7 @@ static inline bool netdev_uses_trailer_tags(struct net_device *dev) | |||
980 | */ | 984 | */ |
981 | static inline void *netdev_priv(const struct net_device *dev) | 985 | static inline void *netdev_priv(const struct net_device *dev) |
982 | { | 986 | { |
983 | return (char *)dev + ((sizeof(struct net_device) | 987 | return (char *)dev + ALIGN(sizeof(struct net_device), NETDEV_ALIGN); |
984 | + NETDEV_ALIGN_CONST) | ||
985 | & ~NETDEV_ALIGN_CONST); | ||
986 | } | 988 | } |
987 | 989 | ||
988 | /* Set the sysfs physical device reference for the network logical device | 990 | /* Set the sysfs physical device reference for the network logical device |
@@ -1012,6 +1014,12 @@ void netif_napi_add(struct net_device *dev, struct napi_struct *napi, | |||
1012 | void netif_napi_del(struct napi_struct *napi); | 1014 | void netif_napi_del(struct napi_struct *napi); |
1013 | 1015 | ||
1014 | struct napi_gro_cb { | 1016 | struct napi_gro_cb { |
1017 | /* Virtual address of skb_shinfo(skb)->frags[0].page + offset. */ | ||
1018 | void *frag0; | ||
1019 | |||
1020 | /* Length of frag0. */ | ||
1021 | unsigned int frag0_len; | ||
1022 | |||
1015 | /* This indicates where we are processing relative to skb->data. */ | 1023 | /* This indicates where we are processing relative to skb->data. */ |
1016 | int data_offset; | 1024 | int data_offset; |
1017 | 1025 | ||
@@ -1047,14 +1055,6 @@ struct packet_type { | |||
1047 | struct list_head list; | 1055 | struct list_head list; |
1048 | }; | 1056 | }; |
1049 | 1057 | ||
1050 | struct napi_gro_fraginfo { | ||
1051 | skb_frag_t frags[MAX_SKB_FRAGS]; | ||
1052 | unsigned int nr_frags; | ||
1053 | unsigned int ip_summed; | ||
1054 | unsigned int len; | ||
1055 | __wsum csum; | ||
1056 | }; | ||
1057 | |||
1058 | #include <linux/interrupt.h> | 1058 | #include <linux/interrupt.h> |
1059 | #include <linux/notifier.h> | 1059 | #include <linux/notifier.h> |
1060 | 1060 | ||
@@ -1119,9 +1119,9 @@ extern int dev_restart(struct net_device *dev); | |||
1119 | #ifdef CONFIG_NETPOLL_TRAP | 1119 | #ifdef CONFIG_NETPOLL_TRAP |
1120 | extern int netpoll_trap(void); | 1120 | extern int netpoll_trap(void); |
1121 | #endif | 1121 | #endif |
1122 | extern void *skb_gro_header(struct sk_buff *skb, unsigned int hlen); | ||
1123 | extern int skb_gro_receive(struct sk_buff **head, | 1122 | extern int skb_gro_receive(struct sk_buff **head, |
1124 | struct sk_buff *skb); | 1123 | struct sk_buff *skb); |
1124 | extern void skb_gro_reset_offset(struct sk_buff *skb); | ||
1125 | 1125 | ||
1126 | static inline unsigned int skb_gro_offset(const struct sk_buff *skb) | 1126 | static inline unsigned int skb_gro_offset(const struct sk_buff *skb) |
1127 | { | 1127 | { |
@@ -1138,16 +1138,34 @@ static inline void skb_gro_pull(struct sk_buff *skb, unsigned int len) | |||
1138 | NAPI_GRO_CB(skb)->data_offset += len; | 1138 | NAPI_GRO_CB(skb)->data_offset += len; |
1139 | } | 1139 | } |
1140 | 1140 | ||
1141 | static inline void skb_gro_reset_offset(struct sk_buff *skb) | 1141 | static inline void *skb_gro_header_fast(struct sk_buff *skb, |
1142 | unsigned int offset) | ||
1143 | { | ||
1144 | return NAPI_GRO_CB(skb)->frag0 + offset; | ||
1145 | } | ||
1146 | |||
1147 | static inline int skb_gro_header_hard(struct sk_buff *skb, unsigned int hlen) | ||
1148 | { | ||
1149 | return NAPI_GRO_CB(skb)->frag0_len < hlen; | ||
1150 | } | ||
1151 | |||
1152 | static inline void *skb_gro_header_slow(struct sk_buff *skb, unsigned int hlen, | ||
1153 | unsigned int offset) | ||
1142 | { | 1154 | { |
1143 | NAPI_GRO_CB(skb)->data_offset = 0; | 1155 | NAPI_GRO_CB(skb)->frag0 = NULL; |
1156 | NAPI_GRO_CB(skb)->frag0_len = 0; | ||
1157 | return pskb_may_pull(skb, hlen) ? skb->data + offset : NULL; | ||
1144 | } | 1158 | } |
1145 | 1159 | ||
1146 | static inline void *skb_gro_mac_header(struct sk_buff *skb) | 1160 | static inline void *skb_gro_mac_header(struct sk_buff *skb) |
1147 | { | 1161 | { |
1148 | return skb_mac_header(skb) < skb->data ? skb_mac_header(skb) : | 1162 | return NAPI_GRO_CB(skb)->frag0 ?: skb_mac_header(skb); |
1149 | page_address(skb_shinfo(skb)->frags[0].page) + | 1163 | } |
1150 | skb_shinfo(skb)->frags[0].page_offset; | 1164 | |
1165 | static inline void *skb_gro_network_header(struct sk_buff *skb) | ||
1166 | { | ||
1167 | return (NAPI_GRO_CB(skb)->frag0 ?: skb->data) + | ||
1168 | skb_network_offset(skb); | ||
1151 | } | 1169 | } |
1152 | 1170 | ||
1153 | static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, | 1171 | static inline int dev_hard_header(struct sk_buff *skb, struct net_device *dev, |
@@ -1442,12 +1460,18 @@ extern int napi_gro_receive(struct napi_struct *napi, | |||
1442 | struct sk_buff *skb); | 1460 | struct sk_buff *skb); |
1443 | extern void napi_reuse_skb(struct napi_struct *napi, | 1461 | extern void napi_reuse_skb(struct napi_struct *napi, |
1444 | struct sk_buff *skb); | 1462 | struct sk_buff *skb); |
1445 | extern struct sk_buff * napi_fraginfo_skb(struct napi_struct *napi, | 1463 | extern struct sk_buff * napi_get_frags(struct napi_struct *napi); |
1446 | struct napi_gro_fraginfo *info); | ||
1447 | extern int napi_frags_finish(struct napi_struct *napi, | 1464 | extern int napi_frags_finish(struct napi_struct *napi, |
1448 | struct sk_buff *skb, int ret); | 1465 | struct sk_buff *skb, int ret); |
1449 | extern int napi_gro_frags(struct napi_struct *napi, | 1466 | extern struct sk_buff * napi_frags_skb(struct napi_struct *napi); |
1450 | struct napi_gro_fraginfo *info); | 1467 | extern int napi_gro_frags(struct napi_struct *napi); |
1468 | |||
1469 | static inline void napi_free_frags(struct napi_struct *napi) | ||
1470 | { | ||
1471 | kfree_skb(napi->skb); | ||
1472 | napi->skb = NULL; | ||
1473 | } | ||
1474 | |||
1451 | extern void netif_nit_deliver(struct sk_buff *skb); | 1475 | extern void netif_nit_deliver(struct sk_buff *skb); |
1452 | extern int dev_valid_name(const char *name); | 1476 | extern int dev_valid_name(const char *name); |
1453 | extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); | 1477 | extern int dev_ioctl(struct net *net, unsigned int cmd, void __user *); |
@@ -1514,6 +1538,8 @@ static inline int netif_carrier_ok(const struct net_device *dev) | |||
1514 | return !test_bit(__LINK_STATE_NOCARRIER, &dev->state); | 1538 | return !test_bit(__LINK_STATE_NOCARRIER, &dev->state); |
1515 | } | 1539 | } |
1516 | 1540 | ||
1541 | extern unsigned long dev_trans_start(struct net_device *dev); | ||
1542 | |||
1517 | extern void __netdev_watchdog_up(struct net_device *dev); | 1543 | extern void __netdev_watchdog_up(struct net_device *dev); |
1518 | 1544 | ||
1519 | extern void netif_carrier_on(struct net_device *dev); | 1545 | extern void netif_carrier_on(struct net_device *dev); |
@@ -1671,6 +1697,12 @@ static inline void __netif_tx_unlock_bh(struct netdev_queue *txq) | |||
1671 | spin_unlock_bh(&txq->_xmit_lock); | 1697 | spin_unlock_bh(&txq->_xmit_lock); |
1672 | } | 1698 | } |
1673 | 1699 | ||
1700 | static inline void txq_trans_update(struct netdev_queue *txq) | ||
1701 | { | ||
1702 | if (txq->xmit_lock_owner != -1) | ||
1703 | txq->trans_start = jiffies; | ||
1704 | } | ||
1705 | |||
1674 | /** | 1706 | /** |
1675 | * netif_tx_lock - grab network device transmit lock | 1707 | * netif_tx_lock - grab network device transmit lock |
1676 | * @dev: network device | 1708 | * @dev: network device |
@@ -1778,6 +1810,13 @@ static inline void netif_addr_unlock_bh(struct net_device *dev) | |||
1778 | spin_unlock_bh(&dev->addr_list_lock); | 1810 | spin_unlock_bh(&dev->addr_list_lock); |
1779 | } | 1811 | } |
1780 | 1812 | ||
1813 | /* | ||
1814 | * dev_addrs walker. Should be used only for read access. Call with | ||
1815 | * rcu_read_lock held. | ||
1816 | */ | ||
1817 | #define for_each_dev_addr(dev, ha) \ | ||
1818 | list_for_each_entry_rcu(ha, &dev->dev_addrs.list, list) | ||
1819 | |||
1781 | /* These functions live elsewhere (drivers/net/net_init.c, but related) */ | 1820 | /* These functions live elsewhere (drivers/net/net_init.c, but related) */ |
1782 | 1821 | ||
1783 | extern void ether_setup(struct net_device *dev); | 1822 | extern void ether_setup(struct net_device *dev); |
@@ -1790,11 +1829,24 @@ extern struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name, | |||
1790 | alloc_netdev_mq(sizeof_priv, name, setup, 1) | 1829 | alloc_netdev_mq(sizeof_priv, name, setup, 1) |
1791 | extern int register_netdev(struct net_device *dev); | 1830 | extern int register_netdev(struct net_device *dev); |
1792 | extern void unregister_netdev(struct net_device *dev); | 1831 | extern void unregister_netdev(struct net_device *dev); |
1832 | |||
1833 | /* Functions used for device addresses handling */ | ||
1834 | extern int dev_addr_add(struct net_device *dev, unsigned char *addr, | ||
1835 | unsigned char addr_type); | ||
1836 | extern int dev_addr_del(struct net_device *dev, unsigned char *addr, | ||
1837 | unsigned char addr_type); | ||
1838 | extern int dev_addr_add_multiple(struct net_device *to_dev, | ||
1839 | struct net_device *from_dev, | ||
1840 | unsigned char addr_type); | ||
1841 | extern int dev_addr_del_multiple(struct net_device *to_dev, | ||
1842 | struct net_device *from_dev, | ||
1843 | unsigned char addr_type); | ||
1844 | |||
1793 | /* Functions used for secondary unicast and multicast support */ | 1845 | /* Functions used for secondary unicast and multicast support */ |
1794 | extern void dev_set_rx_mode(struct net_device *dev); | 1846 | extern void dev_set_rx_mode(struct net_device *dev); |
1795 | extern void __dev_set_rx_mode(struct net_device *dev); | 1847 | extern void __dev_set_rx_mode(struct net_device *dev); |
1796 | extern int dev_unicast_delete(struct net_device *dev, void *addr, int alen); | 1848 | extern int dev_unicast_delete(struct net_device *dev, void *addr); |
1797 | extern int dev_unicast_add(struct net_device *dev, void *addr, int alen); | 1849 | extern int dev_unicast_add(struct net_device *dev, void *addr); |
1798 | extern int dev_unicast_sync(struct net_device *to, struct net_device *from); | 1850 | extern int dev_unicast_sync(struct net_device *to, struct net_device *from); |
1799 | extern void dev_unicast_unsync(struct net_device *to, struct net_device *from); | 1851 | extern void dev_unicast_unsync(struct net_device *to, struct net_device *from); |
1800 | extern int dev_mc_delete(struct net_device *dev, void *addr, int alen, int all); | 1852 | extern int dev_mc_delete(struct net_device *dev, void *addr, int alen, int all); |
@@ -1856,15 +1908,14 @@ static inline int net_gso_ok(int features, int gso_type) | |||
1856 | 1908 | ||
1857 | static inline int skb_gso_ok(struct sk_buff *skb, int features) | 1909 | static inline int skb_gso_ok(struct sk_buff *skb, int features) |
1858 | { | 1910 | { |
1859 | return net_gso_ok(features, skb_shinfo(skb)->gso_type); | 1911 | return net_gso_ok(features, skb_shinfo(skb)->gso_type) && |
1912 | (!skb_has_frags(skb) || (features & NETIF_F_FRAGLIST)); | ||
1860 | } | 1913 | } |
1861 | 1914 | ||
1862 | static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) | 1915 | static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) |
1863 | { | 1916 | { |
1864 | return skb_is_gso(skb) && | 1917 | return skb_is_gso(skb) && |
1865 | (!skb_gso_ok(skb, dev->features) || | 1918 | (!skb_gso_ok(skb, dev->features) || |
1866 | (skb_shinfo(skb)->frag_list && | ||
1867 | !(dev->features & NETIF_F_FRAGLIST)) || | ||
1868 | unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); | 1919 | unlikely(skb->ip_summed != CHECKSUM_PARTIAL)); |
1869 | } | 1920 | } |
1870 | 1921 | ||
@@ -1874,6 +1925,16 @@ static inline void netif_set_gso_max_size(struct net_device *dev, | |||
1874 | dev->gso_max_size = size; | 1925 | dev->gso_max_size = size; |
1875 | } | 1926 | } |
1876 | 1927 | ||
1928 | static inline void skb_bond_set_mac_by_master(struct sk_buff *skb, | ||
1929 | struct net_device *master) | ||
1930 | { | ||
1931 | if (skb->pkt_type == PACKET_HOST) { | ||
1932 | u16 *dest = (u16 *) eth_hdr(skb)->h_dest; | ||
1933 | |||
1934 | memcpy(dest, master->dev_addr, ETH_ALEN); | ||
1935 | } | ||
1936 | } | ||
1937 | |||
1877 | /* On bonding slaves other than the currently active slave, suppress | 1938 | /* On bonding slaves other than the currently active slave, suppress |
1878 | * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and | 1939 | * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and |
1879 | * ARP on active-backup slaves with arp_validate enabled. | 1940 | * ARP on active-backup slaves with arp_validate enabled. |
@@ -1887,6 +1948,14 @@ static inline int skb_bond_should_drop(struct sk_buff *skb) | |||
1887 | if (master->priv_flags & IFF_MASTER_ARPMON) | 1948 | if (master->priv_flags & IFF_MASTER_ARPMON) |
1888 | dev->last_rx = jiffies; | 1949 | dev->last_rx = jiffies; |
1889 | 1950 | ||
1951 | if ((master->priv_flags & IFF_MASTER_ALB) && master->br_port) { | ||
1952 | /* Do address unmangle. The local destination address | ||
1953 | * will be always the one master has. Provides the right | ||
1954 | * functionality in a bridge. | ||
1955 | */ | ||
1956 | skb_bond_set_mac_by_master(skb, master); | ||
1957 | } | ||
1958 | |||
1890 | if (dev->priv_flags & IFF_SLAVE_INACTIVE) { | 1959 | if (dev->priv_flags & IFF_SLAVE_INACTIVE) { |
1891 | if ((dev->priv_flags & IFF_SLAVE_NEEDARP) && | 1960 | if ((dev->priv_flags & IFF_SLAVE_NEEDARP) && |
1892 | skb->protocol == __cpu_to_be16(ETH_P_ARP)) | 1961 | skb->protocol == __cpu_to_be16(ETH_P_ARP)) |
@@ -1908,6 +1977,28 @@ static inline int skb_bond_should_drop(struct sk_buff *skb) | |||
1908 | } | 1977 | } |
1909 | 1978 | ||
1910 | extern struct pernet_operations __net_initdata loopback_net_ops; | 1979 | extern struct pernet_operations __net_initdata loopback_net_ops; |
1980 | |||
1981 | static inline int dev_ethtool_get_settings(struct net_device *dev, | ||
1982 | struct ethtool_cmd *cmd) | ||
1983 | { | ||
1984 | if (!dev->ethtool_ops || !dev->ethtool_ops->get_settings) | ||
1985 | return -EOPNOTSUPP; | ||
1986 | return dev->ethtool_ops->get_settings(dev, cmd); | ||
1987 | } | ||
1988 | |||
1989 | static inline u32 dev_ethtool_get_rx_csum(struct net_device *dev) | ||
1990 | { | ||
1991 | if (!dev->ethtool_ops || !dev->ethtool_ops->get_rx_csum) | ||
1992 | return 0; | ||
1993 | return dev->ethtool_ops->get_rx_csum(dev); | ||
1994 | } | ||
1995 | |||
1996 | static inline u32 dev_ethtool_get_flags(struct net_device *dev) | ||
1997 | { | ||
1998 | if (!dev->ethtool_ops || !dev->ethtool_ops->get_flags) | ||
1999 | return 0; | ||
2000 | return dev->ethtool_ops->get_flags(dev); | ||
2001 | } | ||
1911 | #endif /* __KERNEL__ */ | 2002 | #endif /* __KERNEL__ */ |
1912 | 2003 | ||
1913 | #endif /* _LINUX_DEV_H */ | 2004 | #endif /* _LINUX_NETDEVICE_H */ |
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild index af9d2fb97212..2aea50399c0b 100644 --- a/include/linux/netfilter/Kbuild +++ b/include/linux/netfilter/Kbuild | |||
@@ -33,6 +33,7 @@ header-y += xt_limit.h | |||
33 | header-y += xt_mac.h | 33 | header-y += xt_mac.h |
34 | header-y += xt_mark.h | 34 | header-y += xt_mark.h |
35 | header-y += xt_multiport.h | 35 | header-y += xt_multiport.h |
36 | header-y += xt_osf.h | ||
36 | header-y += xt_owner.h | 37 | header-y += xt_owner.h |
37 | header-y += xt_pkttype.h | 38 | header-y += xt_pkttype.h |
38 | header-y += xt_quota.h | 39 | header-y += xt_quota.h |
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h index 885cbe282260..a8248ee422b7 100644 --- a/include/linux/netfilter/nf_conntrack_common.h +++ b/include/linux/netfilter/nf_conntrack_common.h | |||
@@ -75,75 +75,6 @@ enum ip_conntrack_status { | |||
75 | IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT), | 75 | IPS_FIXED_TIMEOUT = (1 << IPS_FIXED_TIMEOUT_BIT), |
76 | }; | 76 | }; |
77 | 77 | ||
78 | /* Connection tracking event bits */ | ||
79 | enum ip_conntrack_events | ||
80 | { | ||
81 | /* New conntrack */ | ||
82 | IPCT_NEW_BIT = 0, | ||
83 | IPCT_NEW = (1 << IPCT_NEW_BIT), | ||
84 | |||
85 | /* Expected connection */ | ||
86 | IPCT_RELATED_BIT = 1, | ||
87 | IPCT_RELATED = (1 << IPCT_RELATED_BIT), | ||
88 | |||
89 | /* Destroyed conntrack */ | ||
90 | IPCT_DESTROY_BIT = 2, | ||
91 | IPCT_DESTROY = (1 << IPCT_DESTROY_BIT), | ||
92 | |||
93 | /* Timer has been refreshed */ | ||
94 | IPCT_REFRESH_BIT = 3, | ||
95 | IPCT_REFRESH = (1 << IPCT_REFRESH_BIT), | ||
96 | |||
97 | /* Status has changed */ | ||
98 | IPCT_STATUS_BIT = 4, | ||
99 | IPCT_STATUS = (1 << IPCT_STATUS_BIT), | ||
100 | |||
101 | /* Update of protocol info */ | ||
102 | IPCT_PROTOINFO_BIT = 5, | ||
103 | IPCT_PROTOINFO = (1 << IPCT_PROTOINFO_BIT), | ||
104 | |||
105 | /* Volatile protocol info */ | ||
106 | IPCT_PROTOINFO_VOLATILE_BIT = 6, | ||
107 | IPCT_PROTOINFO_VOLATILE = (1 << IPCT_PROTOINFO_VOLATILE_BIT), | ||
108 | |||
109 | /* New helper for conntrack */ | ||
110 | IPCT_HELPER_BIT = 7, | ||
111 | IPCT_HELPER = (1 << IPCT_HELPER_BIT), | ||
112 | |||
113 | /* Update of helper info */ | ||
114 | IPCT_HELPINFO_BIT = 8, | ||
115 | IPCT_HELPINFO = (1 << IPCT_HELPINFO_BIT), | ||
116 | |||
117 | /* Volatile helper info */ | ||
118 | IPCT_HELPINFO_VOLATILE_BIT = 9, | ||
119 | IPCT_HELPINFO_VOLATILE = (1 << IPCT_HELPINFO_VOLATILE_BIT), | ||
120 | |||
121 | /* NAT info */ | ||
122 | IPCT_NATINFO_BIT = 10, | ||
123 | IPCT_NATINFO = (1 << IPCT_NATINFO_BIT), | ||
124 | |||
125 | /* Counter highest bit has been set, unused */ | ||
126 | IPCT_COUNTER_FILLING_BIT = 11, | ||
127 | IPCT_COUNTER_FILLING = (1 << IPCT_COUNTER_FILLING_BIT), | ||
128 | |||
129 | /* Mark is set */ | ||
130 | IPCT_MARK_BIT = 12, | ||
131 | IPCT_MARK = (1 << IPCT_MARK_BIT), | ||
132 | |||
133 | /* NAT sequence adjustment */ | ||
134 | IPCT_NATSEQADJ_BIT = 13, | ||
135 | IPCT_NATSEQADJ = (1 << IPCT_NATSEQADJ_BIT), | ||
136 | |||
137 | /* Secmark is set */ | ||
138 | IPCT_SECMARK_BIT = 14, | ||
139 | IPCT_SECMARK = (1 << IPCT_SECMARK_BIT), | ||
140 | }; | ||
141 | |||
142 | enum ip_conntrack_expect_events { | ||
143 | IPEXP_NEW_BIT = 0, | ||
144 | IPEXP_NEW = (1 << IPEXP_NEW_BIT), | ||
145 | }; | ||
146 | |||
147 | #ifdef __KERNEL__ | 78 | #ifdef __KERNEL__ |
148 | struct ip_conntrack_stat | 79 | struct ip_conntrack_stat |
149 | { | 80 | { |
diff --git a/include/linux/netfilter/nf_conntrack_tcp.h b/include/linux/netfilter/nf_conntrack_tcp.h index b2f384d42611..4352feed2377 100644 --- a/include/linux/netfilter/nf_conntrack_tcp.h +++ b/include/linux/netfilter/nf_conntrack_tcp.h | |||
@@ -15,7 +15,8 @@ enum tcp_conntrack { | |||
15 | TCP_CONNTRACK_LAST_ACK, | 15 | TCP_CONNTRACK_LAST_ACK, |
16 | TCP_CONNTRACK_TIME_WAIT, | 16 | TCP_CONNTRACK_TIME_WAIT, |
17 | TCP_CONNTRACK_CLOSE, | 17 | TCP_CONNTRACK_CLOSE, |
18 | TCP_CONNTRACK_LISTEN, | 18 | TCP_CONNTRACK_LISTEN, /* obsolete */ |
19 | #define TCP_CONNTRACK_SYN_SENT2 TCP_CONNTRACK_LISTEN | ||
19 | TCP_CONNTRACK_MAX, | 20 | TCP_CONNTRACK_MAX, |
20 | TCP_CONNTRACK_IGNORE | 21 | TCP_CONNTRACK_IGNORE |
21 | }; | 22 | }; |
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index c600083cbdf5..bff4d5741d98 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
@@ -46,7 +46,8 @@ struct nfgenmsg { | |||
46 | #define NFNL_SUBSYS_CTNETLINK_EXP 2 | 46 | #define NFNL_SUBSYS_CTNETLINK_EXP 2 |
47 | #define NFNL_SUBSYS_QUEUE 3 | 47 | #define NFNL_SUBSYS_QUEUE 3 |
48 | #define NFNL_SUBSYS_ULOG 4 | 48 | #define NFNL_SUBSYS_ULOG 4 |
49 | #define NFNL_SUBSYS_COUNT 5 | 49 | #define NFNL_SUBSYS_OSF 5 |
50 | #define NFNL_SUBSYS_COUNT 6 | ||
50 | 51 | ||
51 | #ifdef __KERNEL__ | 52 | #ifdef __KERNEL__ |
52 | 53 | ||
@@ -75,7 +76,7 @@ extern int nfnetlink_subsys_unregister(const struct nfnetlink_subsystem *n); | |||
75 | 76 | ||
76 | extern int nfnetlink_has_listeners(unsigned int group); | 77 | extern int nfnetlink_has_listeners(unsigned int group); |
77 | extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, | 78 | extern int nfnetlink_send(struct sk_buff *skb, u32 pid, unsigned group, |
78 | int echo); | 79 | int echo, gfp_t flags); |
79 | extern void nfnetlink_set_err(u32 pid, u32 group, int error); | 80 | extern void nfnetlink_set_err(u32 pid, u32 group, int error); |
80 | extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags); | 81 | extern int nfnetlink_unicast(struct sk_buff *skb, u_int32_t pid, int flags); |
81 | 82 | ||
diff --git a/include/linux/netfilter/nfnetlink_conntrack.h b/include/linux/netfilter/nfnetlink_conntrack.h index 1a865e48b8eb..ed4ef8d0b11b 100644 --- a/include/linux/netfilter/nfnetlink_conntrack.h +++ b/include/linux/netfilter/nfnetlink_conntrack.h | |||
@@ -101,6 +101,7 @@ enum ctattr_protoinfo_dccp { | |||
101 | CTA_PROTOINFO_DCCP_UNSPEC, | 101 | CTA_PROTOINFO_DCCP_UNSPEC, |
102 | CTA_PROTOINFO_DCCP_STATE, | 102 | CTA_PROTOINFO_DCCP_STATE, |
103 | CTA_PROTOINFO_DCCP_ROLE, | 103 | CTA_PROTOINFO_DCCP_ROLE, |
104 | CTA_PROTOINFO_DCCP_HANDSHAKE_SEQ, | ||
104 | __CTA_PROTOINFO_DCCP_MAX, | 105 | __CTA_PROTOINFO_DCCP_MAX, |
105 | }; | 106 | }; |
106 | #define CTA_PROTOINFO_DCCP_MAX (__CTA_PROTOINFO_DCCP_MAX - 1) | 107 | #define CTA_PROTOINFO_DCCP_MAX (__CTA_PROTOINFO_DCCP_MAX - 1) |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index c9efe039dc57..1030b7593898 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -184,9 +184,10 @@ struct xt_counters_info | |||
184 | * @matchinfo: per-match data | 184 | * @matchinfo: per-match data |
185 | * @fragoff: packet is a fragment, this is the data offset | 185 | * @fragoff: packet is a fragment, this is the data offset |
186 | * @thoff: position of transport header relative to skb->data | 186 | * @thoff: position of transport header relative to skb->data |
187 | * @hotdrop: drop packet if we had inspection problems | 187 | * @hook: hook number given packet came from |
188 | * @family: Actual NFPROTO_* through which the function is invoked | 188 | * @family: Actual NFPROTO_* through which the function is invoked |
189 | * (helpful when match->family == NFPROTO_UNSPEC) | 189 | * (helpful when match->family == NFPROTO_UNSPEC) |
190 | * @hotdrop: drop packet if we had inspection problems | ||
190 | */ | 191 | */ |
191 | struct xt_match_param { | 192 | struct xt_match_param { |
192 | const struct net_device *in, *out; | 193 | const struct net_device *in, *out; |
@@ -194,8 +195,9 @@ struct xt_match_param { | |||
194 | const void *matchinfo; | 195 | const void *matchinfo; |
195 | int fragoff; | 196 | int fragoff; |
196 | unsigned int thoff; | 197 | unsigned int thoff; |
197 | bool *hotdrop; | 198 | unsigned int hooknum; |
198 | u_int8_t family; | 199 | u_int8_t family; |
200 | bool *hotdrop; | ||
199 | }; | 201 | }; |
200 | 202 | ||
201 | /** | 203 | /** |
diff --git a/include/linux/netfilter/xt_NFQUEUE.h b/include/linux/netfilter/xt_NFQUEUE.h index 982a89f78272..2584f4a777de 100644 --- a/include/linux/netfilter/xt_NFQUEUE.h +++ b/include/linux/netfilter/xt_NFQUEUE.h | |||
@@ -15,4 +15,9 @@ struct xt_NFQ_info { | |||
15 | __u16 queuenum; | 15 | __u16 queuenum; |
16 | }; | 16 | }; |
17 | 17 | ||
18 | struct xt_NFQ_info_v1 { | ||
19 | __u16 queuenum; | ||
20 | __u16 queues_total; | ||
21 | }; | ||
22 | |||
18 | #endif /* _XT_NFQ_TARGET_H */ | 23 | #endif /* _XT_NFQ_TARGET_H */ |
diff --git a/include/linux/netfilter/xt_conntrack.h b/include/linux/netfilter/xt_conntrack.h index 3430c7751948..7ae05338e94c 100644 --- a/include/linux/netfilter/xt_conntrack.h +++ b/include/linux/netfilter/xt_conntrack.h | |||
@@ -81,4 +81,17 @@ struct xt_conntrack_mtinfo1 { | |||
81 | __u8 state_mask, status_mask; | 81 | __u8 state_mask, status_mask; |
82 | }; | 82 | }; |
83 | 83 | ||
84 | struct xt_conntrack_mtinfo2 { | ||
85 | union nf_inet_addr origsrc_addr, origsrc_mask; | ||
86 | union nf_inet_addr origdst_addr, origdst_mask; | ||
87 | union nf_inet_addr replsrc_addr, replsrc_mask; | ||
88 | union nf_inet_addr repldst_addr, repldst_mask; | ||
89 | __u32 expires_min, expires_max; | ||
90 | __u16 l4proto; | ||
91 | __be16 origsrc_port, origdst_port; | ||
92 | __be16 replsrc_port, repldst_port; | ||
93 | __u16 match_flags, invert_flags; | ||
94 | __u16 state_mask, status_mask; | ||
95 | }; | ||
96 | |||
84 | #endif /*_XT_CONNTRACK_H*/ | 97 | #endif /*_XT_CONNTRACK_H*/ |
diff --git a/include/linux/netfilter/xt_osf.h b/include/linux/netfilter/xt_osf.h new file mode 100644 index 000000000000..18afa495f973 --- /dev/null +++ b/include/linux/netfilter/xt_osf.h | |||
@@ -0,0 +1,135 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2003+ Evgeniy Polyakov <johnpol@2ka.mxt.ru> | ||
3 | * | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify | ||
6 | * it under the terms of the GNU General Public License as published by | ||
7 | * the Free Software Foundation; either version 2 of the License, or | ||
8 | * (at your option) any later version. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License | ||
16 | * along with this program; if not, write to the Free Software | ||
17 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
18 | */ | ||
19 | |||
20 | #ifndef _XT_OSF_H | ||
21 | #define _XT_OSF_H | ||
22 | |||
23 | #include <linux/types.h> | ||
24 | |||
25 | #define MAXGENRELEN 32 | ||
26 | |||
27 | #define XT_OSF_GENRE (1<<0) | ||
28 | #define XT_OSF_TTL (1<<1) | ||
29 | #define XT_OSF_LOG (1<<2) | ||
30 | #define XT_OSF_INVERT (1<<3) | ||
31 | |||
32 | #define XT_OSF_LOGLEVEL_ALL 0 /* log all matched fingerprints */ | ||
33 | #define XT_OSF_LOGLEVEL_FIRST 1 /* log only the first matced fingerprint */ | ||
34 | #define XT_OSF_LOGLEVEL_ALL_KNOWN 2 /* do not log unknown packets */ | ||
35 | |||
36 | #define XT_OSF_TTL_TRUE 0 /* True ip and fingerprint TTL comparison */ | ||
37 | #define XT_OSF_TTL_LESS 1 /* Check if ip TTL is less than fingerprint one */ | ||
38 | #define XT_OSF_TTL_NOCHECK 2 /* Do not compare ip and fingerprint TTL at all */ | ||
39 | |||
40 | struct xt_osf_info { | ||
41 | char genre[MAXGENRELEN]; | ||
42 | __u32 len; | ||
43 | __u32 flags; | ||
44 | __u32 loglevel; | ||
45 | __u32 ttl; | ||
46 | }; | ||
47 | |||
48 | /* | ||
49 | * Wildcard MSS (kind of). | ||
50 | * It is used to implement a state machine for the different wildcard values | ||
51 | * of the MSS and window sizes. | ||
52 | */ | ||
53 | struct xt_osf_wc { | ||
54 | __u32 wc; | ||
55 | __u32 val; | ||
56 | }; | ||
57 | |||
58 | /* | ||
59 | * This struct represents IANA options | ||
60 | * http://www.iana.org/assignments/tcp-parameters | ||
61 | */ | ||
62 | struct xt_osf_opt { | ||
63 | __u16 kind, length; | ||
64 | struct xt_osf_wc wc; | ||
65 | }; | ||
66 | |||
67 | struct xt_osf_user_finger { | ||
68 | struct xt_osf_wc wss; | ||
69 | |||
70 | __u8 ttl, df; | ||
71 | __u16 ss, mss; | ||
72 | __u16 opt_num; | ||
73 | |||
74 | char genre[MAXGENRELEN]; | ||
75 | char version[MAXGENRELEN]; | ||
76 | char subtype[MAXGENRELEN]; | ||
77 | |||
78 | /* MAX_IPOPTLEN is maximum if all options are NOPs or EOLs */ | ||
79 | struct xt_osf_opt opt[MAX_IPOPTLEN]; | ||
80 | }; | ||
81 | |||
82 | struct xt_osf_nlmsg { | ||
83 | struct xt_osf_user_finger f; | ||
84 | struct iphdr ip; | ||
85 | struct tcphdr tcp; | ||
86 | }; | ||
87 | |||
88 | /* Defines for IANA option kinds */ | ||
89 | |||
90 | enum iana_options { | ||
91 | OSFOPT_EOL = 0, /* End of options */ | ||
92 | OSFOPT_NOP, /* NOP */ | ||
93 | OSFOPT_MSS, /* Maximum segment size */ | ||
94 | OSFOPT_WSO, /* Window scale option */ | ||
95 | OSFOPT_SACKP, /* SACK permitted */ | ||
96 | OSFOPT_SACK, /* SACK */ | ||
97 | OSFOPT_ECHO, | ||
98 | OSFOPT_ECHOREPLY, | ||
99 | OSFOPT_TS, /* Timestamp option */ | ||
100 | OSFOPT_POCP, /* Partial Order Connection Permitted */ | ||
101 | OSFOPT_POSP, /* Partial Order Service Profile */ | ||
102 | |||
103 | /* Others are not used in the current OSF */ | ||
104 | OSFOPT_EMPTY = 255, | ||
105 | }; | ||
106 | |||
107 | /* | ||
108 | * Initial window size option state machine: multiple of mss, mtu or | ||
109 | * plain numeric value. Can also be made as plain numeric value which | ||
110 | * is not a multiple of specified value. | ||
111 | */ | ||
112 | enum xt_osf_window_size_options { | ||
113 | OSF_WSS_PLAIN = 0, | ||
114 | OSF_WSS_MSS, | ||
115 | OSF_WSS_MTU, | ||
116 | OSF_WSS_MODULO, | ||
117 | OSF_WSS_MAX, | ||
118 | }; | ||
119 | |||
120 | /* | ||
121 | * Add/remove fingerprint from the kernel. | ||
122 | */ | ||
123 | enum xt_osf_msg_types { | ||
124 | OSF_MSG_ADD, | ||
125 | OSF_MSG_REMOVE, | ||
126 | OSF_MSG_MAX, | ||
127 | }; | ||
128 | |||
129 | enum xt_osf_attr_type { | ||
130 | OSF_ATTR_UNSPEC, | ||
131 | OSF_ATTR_FINGER, | ||
132 | OSF_ATTR_MAX, | ||
133 | }; | ||
134 | |||
135 | #endif /* _XT_OSF_H */ | ||
diff --git a/include/linux/netfilter/xt_socket.h b/include/linux/netfilter/xt_socket.h new file mode 100644 index 000000000000..6f475b8ff34b --- /dev/null +++ b/include/linux/netfilter/xt_socket.h | |||
@@ -0,0 +1,12 @@ | |||
1 | #ifndef _XT_SOCKET_H | ||
2 | #define _XT_SOCKET_H | ||
3 | |||
4 | enum { | ||
5 | XT_SOCKET_TRANSPARENT = 1 << 0, | ||
6 | }; | ||
7 | |||
8 | struct xt_socket_mtinfo1 { | ||
9 | __u8 flags; | ||
10 | }; | ||
11 | |||
12 | #endif /* _XT_SOCKET_H */ | ||
diff --git a/include/linux/nfs.h b/include/linux/nfs.h index 214d499718f7..f387919bbc59 100644 --- a/include/linux/nfs.h +++ b/include/linux/nfs.h | |||
@@ -25,8 +25,9 @@ | |||
25 | #define NFSMODE_SOCK 0140000 | 25 | #define NFSMODE_SOCK 0140000 |
26 | #define NFSMODE_FIFO 0010000 | 26 | #define NFSMODE_FIFO 0010000 |
27 | 27 | ||
28 | #define NFS_MNT_PROGRAM 100005 | 28 | #define NFS_MNT_PROGRAM 100005 |
29 | #define NFS_MNT_PORT 627 | 29 | #define NFS_MNT_VERSION 1 |
30 | #define NFS_MNT3_VERSION 3 | ||
30 | 31 | ||
31 | /* | 32 | /* |
32 | * NFS stats. The good thing with these values is that NFSv3 errors are | 33 | * NFS stats. The good thing with these values is that NFSv3 errors are |
diff --git a/include/linux/nfs2.h b/include/linux/nfs2.h index 0ed9517138fc..fde24b30cc9e 100644 --- a/include/linux/nfs2.h +++ b/include/linux/nfs2.h | |||
@@ -64,11 +64,4 @@ struct nfs2_fh { | |||
64 | #define NFSPROC_READDIR 16 | 64 | #define NFSPROC_READDIR 16 |
65 | #define NFSPROC_STATFS 17 | 65 | #define NFSPROC_STATFS 17 |
66 | 66 | ||
67 | #define NFS_MNT_PROGRAM 100005 | ||
68 | #define NFS_MNT_VERSION 1 | ||
69 | #define MNTPROC_NULL 0 | ||
70 | #define MNTPROC_MNT 1 | ||
71 | #define MNTPROC_UMNT 3 | ||
72 | #define MNTPROC_UMNTALL 4 | ||
73 | |||
74 | #endif /* _LINUX_NFS2_H */ | 67 | #endif /* _LINUX_NFS2_H */ |
diff --git a/include/linux/nfs3.h b/include/linux/nfs3.h index 539f3b550eab..ac33806ec7f9 100644 --- a/include/linux/nfs3.h +++ b/include/linux/nfs3.h | |||
@@ -88,12 +88,7 @@ struct nfs3_fh { | |||
88 | #define NFS3PROC_PATHCONF 20 | 88 | #define NFS3PROC_PATHCONF 20 |
89 | #define NFS3PROC_COMMIT 21 | 89 | #define NFS3PROC_COMMIT 21 |
90 | 90 | ||
91 | #define NFS_MNT3_PROGRAM 100005 | ||
92 | #define NFS_MNT3_VERSION 3 | 91 | #define NFS_MNT3_VERSION 3 |
93 | #define MOUNTPROC3_NULL 0 | ||
94 | #define MOUNTPROC3_MNT 1 | ||
95 | #define MOUNTPROC3_UMNT 3 | ||
96 | #define MOUNTPROC3_UMNTALL 4 | ||
97 | 92 | ||
98 | 93 | ||
99 | #if defined(__KERNEL__) | 94 | #if defined(__KERNEL__) |
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h index e3f0cbcbd0db..bd2eba530667 100644 --- a/include/linux/nfs4.h +++ b/include/linux/nfs4.h | |||
@@ -21,6 +21,7 @@ | |||
21 | #define NFS4_FHSIZE 128 | 21 | #define NFS4_FHSIZE 128 |
22 | #define NFS4_MAXPATHLEN PATH_MAX | 22 | #define NFS4_MAXPATHLEN PATH_MAX |
23 | #define NFS4_MAXNAMLEN NAME_MAX | 23 | #define NFS4_MAXNAMLEN NAME_MAX |
24 | #define NFS4_OPAQUE_LIMIT 1024 | ||
24 | #define NFS4_MAX_SESSIONID_LEN 16 | 25 | #define NFS4_MAX_SESSIONID_LEN 16 |
25 | 26 | ||
26 | #define NFS4_ACCESS_READ 0x0001 | 27 | #define NFS4_ACCESS_READ 0x0001 |
@@ -130,6 +131,16 @@ | |||
130 | 131 | ||
131 | #define NFS4_MAX_UINT64 (~(u64)0) | 132 | #define NFS4_MAX_UINT64 (~(u64)0) |
132 | 133 | ||
134 | /* An NFS4 sessions server must support at least NFS4_MAX_OPS operations. | ||
135 | * If a compound requires more operations, adjust NFS4_MAX_OPS accordingly. | ||
136 | */ | ||
137 | #define NFS4_MAX_OPS 8 | ||
138 | |||
139 | /* Our NFS4 client back channel server only wants the cb_sequene and the | ||
140 | * actual operation per compound | ||
141 | */ | ||
142 | #define NFS4_MAX_BACK_CHANNEL_OPS 2 | ||
143 | |||
133 | enum nfs4_acl_whotype { | 144 | enum nfs4_acl_whotype { |
134 | NFS4_ACL_WHO_NAMED = 0, | 145 | NFS4_ACL_WHO_NAMED = 0, |
135 | NFS4_ACL_WHO_OWNER, | 146 | NFS4_ACL_WHO_OWNER, |
@@ -462,6 +473,13 @@ enum lock_type4 { | |||
462 | #define NFSPROC4_NULL 0 | 473 | #define NFSPROC4_NULL 0 |
463 | #define NFSPROC4_COMPOUND 1 | 474 | #define NFSPROC4_COMPOUND 1 |
464 | #define NFS4_MINOR_VERSION 0 | 475 | #define NFS4_MINOR_VERSION 0 |
476 | |||
477 | #if defined(CONFIG_NFS_V4_1) | ||
478 | #define NFS4_MAX_MINOR_VERSION 1 | ||
479 | #else | ||
480 | #define NFS4_MAX_MINOR_VERSION 0 | ||
481 | #endif /* CONFIG_NFS_V4_1 */ | ||
482 | |||
465 | #define NFS4_DEBUG 1 | 483 | #define NFS4_DEBUG 1 |
466 | 484 | ||
467 | /* Index of predefined Linux client operations */ | 485 | /* Index of predefined Linux client operations */ |
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h index 6ad75948cbf7..19fe15d12042 100644 --- a/include/linux/nfs_fs_sb.h +++ b/include/linux/nfs_fs_sb.h | |||
@@ -4,11 +4,17 @@ | |||
4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
5 | #include <linux/backing-dev.h> | 5 | #include <linux/backing-dev.h> |
6 | #include <linux/wait.h> | 6 | #include <linux/wait.h> |
7 | #include <linux/nfs_xdr.h> | ||
8 | #include <linux/sunrpc/xprt.h> | ||
7 | 9 | ||
8 | #include <asm/atomic.h> | 10 | #include <asm/atomic.h> |
9 | 11 | ||
12 | struct nfs4_session; | ||
10 | struct nfs_iostats; | 13 | struct nfs_iostats; |
11 | struct nlm_host; | 14 | struct nlm_host; |
15 | struct nfs4_sequence_args; | ||
16 | struct nfs4_sequence_res; | ||
17 | struct nfs_server; | ||
12 | 18 | ||
13 | /* | 19 | /* |
14 | * The nfs_client identifies our client state to the server. | 20 | * The nfs_client identifies our client state to the server. |
@@ -18,6 +24,7 @@ struct nfs_client { | |||
18 | int cl_cons_state; /* current construction state (-ve: init error) */ | 24 | int cl_cons_state; /* current construction state (-ve: init error) */ |
19 | #define NFS_CS_READY 0 /* ready to be used */ | 25 | #define NFS_CS_READY 0 /* ready to be used */ |
20 | #define NFS_CS_INITING 1 /* busy initialising */ | 26 | #define NFS_CS_INITING 1 /* busy initialising */ |
27 | #define NFS_CS_SESSION_INITING 2 /* busy initialising session */ | ||
21 | unsigned long cl_res_state; /* NFS resources state */ | 28 | unsigned long cl_res_state; /* NFS resources state */ |
22 | #define NFS_CS_CALLBACK 1 /* - callback started */ | 29 | #define NFS_CS_CALLBACK 1 /* - callback started */ |
23 | #define NFS_CS_IDMAP 2 /* - idmap started */ | 30 | #define NFS_CS_IDMAP 2 /* - idmap started */ |
@@ -32,6 +39,7 @@ struct nfs_client { | |||
32 | const struct nfs_rpc_ops *rpc_ops; /* NFS protocol vector */ | 39 | const struct nfs_rpc_ops *rpc_ops; /* NFS protocol vector */ |
33 | int cl_proto; /* Network transport protocol */ | 40 | int cl_proto; /* Network transport protocol */ |
34 | 41 | ||
42 | u32 cl_minorversion;/* NFSv4 minorversion */ | ||
35 | struct rpc_cred *cl_machine_cred; | 43 | struct rpc_cred *cl_machine_cred; |
36 | 44 | ||
37 | #ifdef CONFIG_NFS_V4 | 45 | #ifdef CONFIG_NFS_V4 |
@@ -63,7 +71,22 @@ struct nfs_client { | |||
63 | */ | 71 | */ |
64 | char cl_ipaddr[48]; | 72 | char cl_ipaddr[48]; |
65 | unsigned char cl_id_uniquifier; | 73 | unsigned char cl_id_uniquifier; |
66 | #endif | 74 | int (* cl_call_sync)(struct nfs_server *server, |
75 | struct rpc_message *msg, | ||
76 | struct nfs4_sequence_args *args, | ||
77 | struct nfs4_sequence_res *res, | ||
78 | int cache_reply); | ||
79 | #endif /* CONFIG_NFS_V4 */ | ||
80 | |||
81 | #ifdef CONFIG_NFS_V4_1 | ||
82 | /* clientid returned from EXCHANGE_ID, used by session operations */ | ||
83 | u64 cl_ex_clid; | ||
84 | /* The sequence id to use for the next CREATE_SESSION */ | ||
85 | u32 cl_seqid; | ||
86 | /* The flags used for obtaining the clientid during EXCHANGE_ID */ | ||
87 | u32 cl_exchange_flags; | ||
88 | struct nfs4_session *cl_session; /* sharred session */ | ||
89 | #endif /* CONFIG_NFS_V4_1 */ | ||
67 | 90 | ||
68 | #ifdef CONFIG_NFS_FSCACHE | 91 | #ifdef CONFIG_NFS_FSCACHE |
69 | struct fscache_cookie *fscache; /* client index cache cookie */ | 92 | struct fscache_cookie *fscache; /* client index cache cookie */ |
@@ -145,4 +168,46 @@ struct nfs_server { | |||
145 | #define NFS_CAP_ACLS (1U << 3) | 168 | #define NFS_CAP_ACLS (1U << 3) |
146 | #define NFS_CAP_ATOMIC_OPEN (1U << 4) | 169 | #define NFS_CAP_ATOMIC_OPEN (1U << 4) |
147 | 170 | ||
171 | |||
172 | /* maximum number of slots to use */ | ||
173 | #define NFS4_MAX_SLOT_TABLE RPC_MAX_SLOT_TABLE | ||
174 | |||
175 | #if defined(CONFIG_NFS_V4_1) | ||
176 | |||
177 | /* Sessions */ | ||
178 | #define SLOT_TABLE_SZ (NFS4_MAX_SLOT_TABLE/(8*sizeof(long))) | ||
179 | struct nfs4_slot_table { | ||
180 | struct nfs4_slot *slots; /* seqid per slot */ | ||
181 | unsigned long used_slots[SLOT_TABLE_SZ]; /* used/unused bitmap */ | ||
182 | spinlock_t slot_tbl_lock; | ||
183 | struct rpc_wait_queue slot_tbl_waitq; /* allocators may wait here */ | ||
184 | int max_slots; /* # slots in table */ | ||
185 | int highest_used_slotid; /* sent to server on each SEQ. | ||
186 | * op for dynamic resizing */ | ||
187 | }; | ||
188 | |||
189 | static inline int slot_idx(struct nfs4_slot_table *tbl, struct nfs4_slot *sp) | ||
190 | { | ||
191 | return sp - tbl->slots; | ||
192 | } | ||
193 | |||
194 | /* | ||
195 | * Session related parameters | ||
196 | */ | ||
197 | struct nfs4_session { | ||
198 | struct nfs4_sessionid sess_id; | ||
199 | u32 flags; | ||
200 | unsigned long session_state; | ||
201 | u32 hash_alg; | ||
202 | u32 ssv_len; | ||
203 | |||
204 | /* The fore and back channel */ | ||
205 | struct nfs4_channel_attrs fc_attrs; | ||
206 | struct nfs4_slot_table fc_slot_table; | ||
207 | struct nfs4_channel_attrs bc_attrs; | ||
208 | struct nfs4_slot_table bc_slot_table; | ||
209 | struct nfs_client *clp; | ||
210 | }; | ||
211 | |||
212 | #endif /* CONFIG_NFS_V4_1 */ | ||
148 | #endif | 213 | #endif |
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h index b89c34e40bc2..62f63fb0c4c8 100644 --- a/include/linux/nfs_xdr.h +++ b/include/linux/nfs_xdr.h | |||
@@ -145,6 +145,44 @@ struct nfs4_change_info { | |||
145 | }; | 145 | }; |
146 | 146 | ||
147 | struct nfs_seqid; | 147 | struct nfs_seqid; |
148 | |||
149 | /* nfs41 sessions channel attributes */ | ||
150 | struct nfs4_channel_attrs { | ||
151 | u32 headerpadsz; | ||
152 | u32 max_rqst_sz; | ||
153 | u32 max_resp_sz; | ||
154 | u32 max_resp_sz_cached; | ||
155 | u32 max_ops; | ||
156 | u32 max_reqs; | ||
157 | }; | ||
158 | |||
159 | /* nfs41 sessions slot seqid */ | ||
160 | struct nfs4_slot { | ||
161 | u32 seq_nr; | ||
162 | }; | ||
163 | |||
164 | struct nfs4_sequence_args { | ||
165 | struct nfs4_session *sa_session; | ||
166 | u8 sa_slotid; | ||
167 | u8 sa_cache_this; | ||
168 | }; | ||
169 | |||
170 | struct nfs4_sequence_res { | ||
171 | struct nfs4_session *sr_session; | ||
172 | u8 sr_slotid; /* slot used to send request */ | ||
173 | unsigned long sr_renewal_time; | ||
174 | int sr_status; /* sequence operation status */ | ||
175 | }; | ||
176 | |||
177 | struct nfs4_get_lease_time_args { | ||
178 | struct nfs4_sequence_args la_seq_args; | ||
179 | }; | ||
180 | |||
181 | struct nfs4_get_lease_time_res { | ||
182 | struct nfs_fsinfo *lr_fsinfo; | ||
183 | struct nfs4_sequence_res lr_seq_res; | ||
184 | }; | ||
185 | |||
148 | /* | 186 | /* |
149 | * Arguments to the open call. | 187 | * Arguments to the open call. |
150 | */ | 188 | */ |
@@ -165,6 +203,7 @@ struct nfs_openargs { | |||
165 | const struct nfs_server *server; /* Needed for ID mapping */ | 203 | const struct nfs_server *server; /* Needed for ID mapping */ |
166 | const u32 * bitmask; | 204 | const u32 * bitmask; |
167 | __u32 claim; | 205 | __u32 claim; |
206 | struct nfs4_sequence_args seq_args; | ||
168 | }; | 207 | }; |
169 | 208 | ||
170 | struct nfs_openres { | 209 | struct nfs_openres { |
@@ -181,6 +220,7 @@ struct nfs_openres { | |||
181 | __u32 do_recall; | 220 | __u32 do_recall; |
182 | __u64 maxsize; | 221 | __u64 maxsize; |
183 | __u32 attrset[NFS4_BITMAP_SIZE]; | 222 | __u32 attrset[NFS4_BITMAP_SIZE]; |
223 | struct nfs4_sequence_res seq_res; | ||
184 | }; | 224 | }; |
185 | 225 | ||
186 | /* | 226 | /* |
@@ -206,6 +246,7 @@ struct nfs_closeargs { | |||
206 | struct nfs_seqid * seqid; | 246 | struct nfs_seqid * seqid; |
207 | fmode_t fmode; | 247 | fmode_t fmode; |
208 | const u32 * bitmask; | 248 | const u32 * bitmask; |
249 | struct nfs4_sequence_args seq_args; | ||
209 | }; | 250 | }; |
210 | 251 | ||
211 | struct nfs_closeres { | 252 | struct nfs_closeres { |
@@ -213,6 +254,7 @@ struct nfs_closeres { | |||
213 | struct nfs_fattr * fattr; | 254 | struct nfs_fattr * fattr; |
214 | struct nfs_seqid * seqid; | 255 | struct nfs_seqid * seqid; |
215 | const struct nfs_server *server; | 256 | const struct nfs_server *server; |
257 | struct nfs4_sequence_res seq_res; | ||
216 | }; | 258 | }; |
217 | /* | 259 | /* |
218 | * * Arguments to the lock,lockt, and locku call. | 260 | * * Arguments to the lock,lockt, and locku call. |
@@ -233,12 +275,14 @@ struct nfs_lock_args { | |||
233 | unsigned char block : 1; | 275 | unsigned char block : 1; |
234 | unsigned char reclaim : 1; | 276 | unsigned char reclaim : 1; |
235 | unsigned char new_lock_owner : 1; | 277 | unsigned char new_lock_owner : 1; |
278 | struct nfs4_sequence_args seq_args; | ||
236 | }; | 279 | }; |
237 | 280 | ||
238 | struct nfs_lock_res { | 281 | struct nfs_lock_res { |
239 | nfs4_stateid stateid; | 282 | nfs4_stateid stateid; |
240 | struct nfs_seqid * lock_seqid; | 283 | struct nfs_seqid * lock_seqid; |
241 | struct nfs_seqid * open_seqid; | 284 | struct nfs_seqid * open_seqid; |
285 | struct nfs4_sequence_res seq_res; | ||
242 | }; | 286 | }; |
243 | 287 | ||
244 | struct nfs_locku_args { | 288 | struct nfs_locku_args { |
@@ -246,32 +290,38 @@ struct nfs_locku_args { | |||
246 | struct file_lock * fl; | 290 | struct file_lock * fl; |
247 | struct nfs_seqid * seqid; | 291 | struct nfs_seqid * seqid; |
248 | nfs4_stateid * stateid; | 292 | nfs4_stateid * stateid; |
293 | struct nfs4_sequence_args seq_args; | ||
249 | }; | 294 | }; |
250 | 295 | ||
251 | struct nfs_locku_res { | 296 | struct nfs_locku_res { |
252 | nfs4_stateid stateid; | 297 | nfs4_stateid stateid; |
253 | struct nfs_seqid * seqid; | 298 | struct nfs_seqid * seqid; |
299 | struct nfs4_sequence_res seq_res; | ||
254 | }; | 300 | }; |
255 | 301 | ||
256 | struct nfs_lockt_args { | 302 | struct nfs_lockt_args { |
257 | struct nfs_fh * fh; | 303 | struct nfs_fh * fh; |
258 | struct file_lock * fl; | 304 | struct file_lock * fl; |
259 | struct nfs_lowner lock_owner; | 305 | struct nfs_lowner lock_owner; |
306 | struct nfs4_sequence_args seq_args; | ||
260 | }; | 307 | }; |
261 | 308 | ||
262 | struct nfs_lockt_res { | 309 | struct nfs_lockt_res { |
263 | struct file_lock * denied; /* LOCK, LOCKT failed */ | 310 | struct file_lock * denied; /* LOCK, LOCKT failed */ |
311 | struct nfs4_sequence_res seq_res; | ||
264 | }; | 312 | }; |
265 | 313 | ||
266 | struct nfs4_delegreturnargs { | 314 | struct nfs4_delegreturnargs { |
267 | const struct nfs_fh *fhandle; | 315 | const struct nfs_fh *fhandle; |
268 | const nfs4_stateid *stateid; | 316 | const nfs4_stateid *stateid; |
269 | const u32 * bitmask; | 317 | const u32 * bitmask; |
318 | struct nfs4_sequence_args seq_args; | ||
270 | }; | 319 | }; |
271 | 320 | ||
272 | struct nfs4_delegreturnres { | 321 | struct nfs4_delegreturnres { |
273 | struct nfs_fattr * fattr; | 322 | struct nfs_fattr * fattr; |
274 | const struct nfs_server *server; | 323 | const struct nfs_server *server; |
324 | struct nfs4_sequence_res seq_res; | ||
275 | }; | 325 | }; |
276 | 326 | ||
277 | /* | 327 | /* |
@@ -284,12 +334,14 @@ struct nfs_readargs { | |||
284 | __u32 count; | 334 | __u32 count; |
285 | unsigned int pgbase; | 335 | unsigned int pgbase; |
286 | struct page ** pages; | 336 | struct page ** pages; |
337 | struct nfs4_sequence_args seq_args; | ||
287 | }; | 338 | }; |
288 | 339 | ||
289 | struct nfs_readres { | 340 | struct nfs_readres { |
290 | struct nfs_fattr * fattr; | 341 | struct nfs_fattr * fattr; |
291 | __u32 count; | 342 | __u32 count; |
292 | int eof; | 343 | int eof; |
344 | struct nfs4_sequence_res seq_res; | ||
293 | }; | 345 | }; |
294 | 346 | ||
295 | /* | 347 | /* |
@@ -304,6 +356,7 @@ struct nfs_writeargs { | |||
304 | unsigned int pgbase; | 356 | unsigned int pgbase; |
305 | struct page ** pages; | 357 | struct page ** pages; |
306 | const u32 * bitmask; | 358 | const u32 * bitmask; |
359 | struct nfs4_sequence_args seq_args; | ||
307 | }; | 360 | }; |
308 | 361 | ||
309 | struct nfs_writeverf { | 362 | struct nfs_writeverf { |
@@ -316,6 +369,7 @@ struct nfs_writeres { | |||
316 | struct nfs_writeverf * verf; | 369 | struct nfs_writeverf * verf; |
317 | __u32 count; | 370 | __u32 count; |
318 | const struct nfs_server *server; | 371 | const struct nfs_server *server; |
372 | struct nfs4_sequence_res seq_res; | ||
319 | }; | 373 | }; |
320 | 374 | ||
321 | /* | 375 | /* |
@@ -325,12 +379,14 @@ struct nfs_removeargs { | |||
325 | const struct nfs_fh *fh; | 379 | const struct nfs_fh *fh; |
326 | struct qstr name; | 380 | struct qstr name; |
327 | const u32 * bitmask; | 381 | const u32 * bitmask; |
382 | struct nfs4_sequence_args seq_args; | ||
328 | }; | 383 | }; |
329 | 384 | ||
330 | struct nfs_removeres { | 385 | struct nfs_removeres { |
331 | const struct nfs_server *server; | 386 | const struct nfs_server *server; |
332 | struct nfs4_change_info cinfo; | 387 | struct nfs4_change_info cinfo; |
333 | struct nfs_fattr dir_attr; | 388 | struct nfs_fattr dir_attr; |
389 | struct nfs4_sequence_res seq_res; | ||
334 | }; | 390 | }; |
335 | 391 | ||
336 | /* | 392 | /* |
@@ -383,6 +439,7 @@ struct nfs_setattrargs { | |||
383 | struct iattr * iap; | 439 | struct iattr * iap; |
384 | const struct nfs_server * server; /* Needed for name mapping */ | 440 | const struct nfs_server * server; /* Needed for name mapping */ |
385 | const u32 * bitmask; | 441 | const u32 * bitmask; |
442 | struct nfs4_sequence_args seq_args; | ||
386 | }; | 443 | }; |
387 | 444 | ||
388 | struct nfs_setaclargs { | 445 | struct nfs_setaclargs { |
@@ -390,6 +447,11 @@ struct nfs_setaclargs { | |||
390 | size_t acl_len; | 447 | size_t acl_len; |
391 | unsigned int acl_pgbase; | 448 | unsigned int acl_pgbase; |
392 | struct page ** acl_pages; | 449 | struct page ** acl_pages; |
450 | struct nfs4_sequence_args seq_args; | ||
451 | }; | ||
452 | |||
453 | struct nfs_setaclres { | ||
454 | struct nfs4_sequence_res seq_res; | ||
393 | }; | 455 | }; |
394 | 456 | ||
395 | struct nfs_getaclargs { | 457 | struct nfs_getaclargs { |
@@ -397,11 +459,18 @@ struct nfs_getaclargs { | |||
397 | size_t acl_len; | 459 | size_t acl_len; |
398 | unsigned int acl_pgbase; | 460 | unsigned int acl_pgbase; |
399 | struct page ** acl_pages; | 461 | struct page ** acl_pages; |
462 | struct nfs4_sequence_args seq_args; | ||
463 | }; | ||
464 | |||
465 | struct nfs_getaclres { | ||
466 | size_t acl_len; | ||
467 | struct nfs4_sequence_res seq_res; | ||
400 | }; | 468 | }; |
401 | 469 | ||
402 | struct nfs_setattrres { | 470 | struct nfs_setattrres { |
403 | struct nfs_fattr * fattr; | 471 | struct nfs_fattr * fattr; |
404 | const struct nfs_server * server; | 472 | const struct nfs_server * server; |
473 | struct nfs4_sequence_res seq_res; | ||
405 | }; | 474 | }; |
406 | 475 | ||
407 | struct nfs_linkargs { | 476 | struct nfs_linkargs { |
@@ -583,6 +652,7 @@ struct nfs4_accessargs { | |||
583 | const struct nfs_fh * fh; | 652 | const struct nfs_fh * fh; |
584 | const u32 * bitmask; | 653 | const u32 * bitmask; |
585 | u32 access; | 654 | u32 access; |
655 | struct nfs4_sequence_args seq_args; | ||
586 | }; | 656 | }; |
587 | 657 | ||
588 | struct nfs4_accessres { | 658 | struct nfs4_accessres { |
@@ -590,6 +660,7 @@ struct nfs4_accessres { | |||
590 | struct nfs_fattr * fattr; | 660 | struct nfs_fattr * fattr; |
591 | u32 supported; | 661 | u32 supported; |
592 | u32 access; | 662 | u32 access; |
663 | struct nfs4_sequence_res seq_res; | ||
593 | }; | 664 | }; |
594 | 665 | ||
595 | struct nfs4_create_arg { | 666 | struct nfs4_create_arg { |
@@ -609,6 +680,7 @@ struct nfs4_create_arg { | |||
609 | const struct iattr * attrs; | 680 | const struct iattr * attrs; |
610 | const struct nfs_fh * dir_fh; | 681 | const struct nfs_fh * dir_fh; |
611 | const u32 * bitmask; | 682 | const u32 * bitmask; |
683 | struct nfs4_sequence_args seq_args; | ||
612 | }; | 684 | }; |
613 | 685 | ||
614 | struct nfs4_create_res { | 686 | struct nfs4_create_res { |
@@ -617,21 +689,30 @@ struct nfs4_create_res { | |||
617 | struct nfs_fattr * fattr; | 689 | struct nfs_fattr * fattr; |
618 | struct nfs4_change_info dir_cinfo; | 690 | struct nfs4_change_info dir_cinfo; |
619 | struct nfs_fattr * dir_fattr; | 691 | struct nfs_fattr * dir_fattr; |
692 | struct nfs4_sequence_res seq_res; | ||
620 | }; | 693 | }; |
621 | 694 | ||
622 | struct nfs4_fsinfo_arg { | 695 | struct nfs4_fsinfo_arg { |
623 | const struct nfs_fh * fh; | 696 | const struct nfs_fh * fh; |
624 | const u32 * bitmask; | 697 | const u32 * bitmask; |
698 | struct nfs4_sequence_args seq_args; | ||
699 | }; | ||
700 | |||
701 | struct nfs4_fsinfo_res { | ||
702 | struct nfs_fsinfo *fsinfo; | ||
703 | struct nfs4_sequence_res seq_res; | ||
625 | }; | 704 | }; |
626 | 705 | ||
627 | struct nfs4_getattr_arg { | 706 | struct nfs4_getattr_arg { |
628 | const struct nfs_fh * fh; | 707 | const struct nfs_fh * fh; |
629 | const u32 * bitmask; | 708 | const u32 * bitmask; |
709 | struct nfs4_sequence_args seq_args; | ||
630 | }; | 710 | }; |
631 | 711 | ||
632 | struct nfs4_getattr_res { | 712 | struct nfs4_getattr_res { |
633 | const struct nfs_server * server; | 713 | const struct nfs_server * server; |
634 | struct nfs_fattr * fattr; | 714 | struct nfs_fattr * fattr; |
715 | struct nfs4_sequence_res seq_res; | ||
635 | }; | 716 | }; |
636 | 717 | ||
637 | struct nfs4_link_arg { | 718 | struct nfs4_link_arg { |
@@ -639,6 +720,7 @@ struct nfs4_link_arg { | |||
639 | const struct nfs_fh * dir_fh; | 720 | const struct nfs_fh * dir_fh; |
640 | const struct qstr * name; | 721 | const struct qstr * name; |
641 | const u32 * bitmask; | 722 | const u32 * bitmask; |
723 | struct nfs4_sequence_args seq_args; | ||
642 | }; | 724 | }; |
643 | 725 | ||
644 | struct nfs4_link_res { | 726 | struct nfs4_link_res { |
@@ -646,6 +728,7 @@ struct nfs4_link_res { | |||
646 | struct nfs_fattr * fattr; | 728 | struct nfs_fattr * fattr; |
647 | struct nfs4_change_info cinfo; | 729 | struct nfs4_change_info cinfo; |
648 | struct nfs_fattr * dir_attr; | 730 | struct nfs_fattr * dir_attr; |
731 | struct nfs4_sequence_res seq_res; | ||
649 | }; | 732 | }; |
650 | 733 | ||
651 | 734 | ||
@@ -653,21 +736,30 @@ struct nfs4_lookup_arg { | |||
653 | const struct nfs_fh * dir_fh; | 736 | const struct nfs_fh * dir_fh; |
654 | const struct qstr * name; | 737 | const struct qstr * name; |
655 | const u32 * bitmask; | 738 | const u32 * bitmask; |
739 | struct nfs4_sequence_args seq_args; | ||
656 | }; | 740 | }; |
657 | 741 | ||
658 | struct nfs4_lookup_res { | 742 | struct nfs4_lookup_res { |
659 | const struct nfs_server * server; | 743 | const struct nfs_server * server; |
660 | struct nfs_fattr * fattr; | 744 | struct nfs_fattr * fattr; |
661 | struct nfs_fh * fh; | 745 | struct nfs_fh * fh; |
746 | struct nfs4_sequence_res seq_res; | ||
662 | }; | 747 | }; |
663 | 748 | ||
664 | struct nfs4_lookup_root_arg { | 749 | struct nfs4_lookup_root_arg { |
665 | const u32 * bitmask; | 750 | const u32 * bitmask; |
751 | struct nfs4_sequence_args seq_args; | ||
666 | }; | 752 | }; |
667 | 753 | ||
668 | struct nfs4_pathconf_arg { | 754 | struct nfs4_pathconf_arg { |
669 | const struct nfs_fh * fh; | 755 | const struct nfs_fh * fh; |
670 | const u32 * bitmask; | 756 | const u32 * bitmask; |
757 | struct nfs4_sequence_args seq_args; | ||
758 | }; | ||
759 | |||
760 | struct nfs4_pathconf_res { | ||
761 | struct nfs_pathconf *pathconf; | ||
762 | struct nfs4_sequence_res seq_res; | ||
671 | }; | 763 | }; |
672 | 764 | ||
673 | struct nfs4_readdir_arg { | 765 | struct nfs4_readdir_arg { |
@@ -678,11 +770,13 @@ struct nfs4_readdir_arg { | |||
678 | struct page ** pages; /* zero-copy data */ | 770 | struct page ** pages; /* zero-copy data */ |
679 | unsigned int pgbase; /* zero-copy data */ | 771 | unsigned int pgbase; /* zero-copy data */ |
680 | const u32 * bitmask; | 772 | const u32 * bitmask; |
773 | struct nfs4_sequence_args seq_args; | ||
681 | }; | 774 | }; |
682 | 775 | ||
683 | struct nfs4_readdir_res { | 776 | struct nfs4_readdir_res { |
684 | nfs4_verifier verifier; | 777 | nfs4_verifier verifier; |
685 | unsigned int pgbase; | 778 | unsigned int pgbase; |
779 | struct nfs4_sequence_res seq_res; | ||
686 | }; | 780 | }; |
687 | 781 | ||
688 | struct nfs4_readlink { | 782 | struct nfs4_readlink { |
@@ -690,6 +784,11 @@ struct nfs4_readlink { | |||
690 | unsigned int pgbase; | 784 | unsigned int pgbase; |
691 | unsigned int pglen; /* zero-copy data */ | 785 | unsigned int pglen; /* zero-copy data */ |
692 | struct page ** pages; /* zero-copy data */ | 786 | struct page ** pages; /* zero-copy data */ |
787 | struct nfs4_sequence_args seq_args; | ||
788 | }; | ||
789 | |||
790 | struct nfs4_readlink_res { | ||
791 | struct nfs4_sequence_res seq_res; | ||
693 | }; | 792 | }; |
694 | 793 | ||
695 | struct nfs4_rename_arg { | 794 | struct nfs4_rename_arg { |
@@ -698,6 +797,7 @@ struct nfs4_rename_arg { | |||
698 | const struct qstr * old_name; | 797 | const struct qstr * old_name; |
699 | const struct qstr * new_name; | 798 | const struct qstr * new_name; |
700 | const u32 * bitmask; | 799 | const u32 * bitmask; |
800 | struct nfs4_sequence_args seq_args; | ||
701 | }; | 801 | }; |
702 | 802 | ||
703 | struct nfs4_rename_res { | 803 | struct nfs4_rename_res { |
@@ -706,6 +806,7 @@ struct nfs4_rename_res { | |||
706 | struct nfs_fattr * old_fattr; | 806 | struct nfs_fattr * old_fattr; |
707 | struct nfs4_change_info new_cinfo; | 807 | struct nfs4_change_info new_cinfo; |
708 | struct nfs_fattr * new_fattr; | 808 | struct nfs_fattr * new_fattr; |
809 | struct nfs4_sequence_res seq_res; | ||
709 | }; | 810 | }; |
710 | 811 | ||
711 | #define NFS4_SETCLIENTID_NAMELEN (127) | 812 | #define NFS4_SETCLIENTID_NAMELEN (127) |
@@ -724,6 +825,17 @@ struct nfs4_setclientid { | |||
724 | struct nfs4_statfs_arg { | 825 | struct nfs4_statfs_arg { |
725 | const struct nfs_fh * fh; | 826 | const struct nfs_fh * fh; |
726 | const u32 * bitmask; | 827 | const u32 * bitmask; |
828 | struct nfs4_sequence_args seq_args; | ||
829 | }; | ||
830 | |||
831 | struct nfs4_statfs_res { | ||
832 | struct nfs_fsstat *fsstat; | ||
833 | struct nfs4_sequence_res seq_res; | ||
834 | }; | ||
835 | |||
836 | struct nfs4_server_caps_arg { | ||
837 | struct nfs_fh *fhandle; | ||
838 | struct nfs4_sequence_args seq_args; | ||
727 | }; | 839 | }; |
728 | 840 | ||
729 | struct nfs4_server_caps_res { | 841 | struct nfs4_server_caps_res { |
@@ -731,6 +843,7 @@ struct nfs4_server_caps_res { | |||
731 | u32 acl_bitmask; | 843 | u32 acl_bitmask; |
732 | u32 has_links; | 844 | u32 has_links; |
733 | u32 has_symlinks; | 845 | u32 has_symlinks; |
846 | struct nfs4_sequence_res seq_res; | ||
734 | }; | 847 | }; |
735 | 848 | ||
736 | struct nfs4_string { | 849 | struct nfs4_string { |
@@ -765,10 +878,68 @@ struct nfs4_fs_locations_arg { | |||
765 | const struct qstr *name; | 878 | const struct qstr *name; |
766 | struct page *page; | 879 | struct page *page; |
767 | const u32 *bitmask; | 880 | const u32 *bitmask; |
881 | struct nfs4_sequence_args seq_args; | ||
882 | }; | ||
883 | |||
884 | struct nfs4_fs_locations_res { | ||
885 | struct nfs4_fs_locations *fs_locations; | ||
886 | struct nfs4_sequence_res seq_res; | ||
768 | }; | 887 | }; |
769 | 888 | ||
770 | #endif /* CONFIG_NFS_V4 */ | 889 | #endif /* CONFIG_NFS_V4 */ |
771 | 890 | ||
891 | struct nfstime4 { | ||
892 | u64 seconds; | ||
893 | u32 nseconds; | ||
894 | }; | ||
895 | |||
896 | #ifdef CONFIG_NFS_V4_1 | ||
897 | struct nfs_impl_id4 { | ||
898 | u32 domain_len; | ||
899 | char *domain; | ||
900 | u32 name_len; | ||
901 | char *name; | ||
902 | struct nfstime4 date; | ||
903 | }; | ||
904 | |||
905 | #define NFS4_EXCHANGE_ID_LEN (48) | ||
906 | struct nfs41_exchange_id_args { | ||
907 | struct nfs_client *client; | ||
908 | nfs4_verifier *verifier; | ||
909 | unsigned int id_len; | ||
910 | char id[NFS4_EXCHANGE_ID_LEN]; | ||
911 | u32 flags; | ||
912 | }; | ||
913 | |||
914 | struct server_owner { | ||
915 | uint64_t minor_id; | ||
916 | uint32_t major_id_sz; | ||
917 | char major_id[NFS4_OPAQUE_LIMIT]; | ||
918 | }; | ||
919 | |||
920 | struct server_scope { | ||
921 | uint32_t server_scope_sz; | ||
922 | char server_scope[NFS4_OPAQUE_LIMIT]; | ||
923 | }; | ||
924 | |||
925 | struct nfs41_exchange_id_res { | ||
926 | struct nfs_client *client; | ||
927 | u32 flags; | ||
928 | }; | ||
929 | |||
930 | struct nfs41_create_session_args { | ||
931 | struct nfs_client *client; | ||
932 | uint32_t flags; | ||
933 | uint32_t cb_program; | ||
934 | struct nfs4_channel_attrs fc_attrs; /* Fore Channel */ | ||
935 | struct nfs4_channel_attrs bc_attrs; /* Back Channel */ | ||
936 | }; | ||
937 | |||
938 | struct nfs41_create_session_res { | ||
939 | struct nfs_client *client; | ||
940 | }; | ||
941 | #endif /* CONFIG_NFS_V4_1 */ | ||
942 | |||
772 | struct nfs_page; | 943 | struct nfs_page; |
773 | 944 | ||
774 | #define NFS_PAGEVEC_SIZE (8U) | 945 | #define NFS_PAGEVEC_SIZE (8U) |
diff --git a/include/linux/nfsd/cache.h b/include/linux/nfsd/cache.h index 5bccaab81056..3a3f58934f5e 100644 --- a/include/linux/nfsd/cache.h +++ b/include/linux/nfsd/cache.h | |||
@@ -14,8 +14,7 @@ | |||
14 | #include <linux/uio.h> | 14 | #include <linux/uio.h> |
15 | 15 | ||
16 | /* | 16 | /* |
17 | * Representation of a reply cache entry. The first two members *must* | 17 | * Representation of a reply cache entry. |
18 | * be hash_next and hash_prev. | ||
19 | */ | 18 | */ |
20 | struct svc_cacherep { | 19 | struct svc_cacherep { |
21 | struct hlist_node c_hash; | 20 | struct hlist_node c_hash; |
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h index afa19016c4a8..8f641c908450 100644 --- a/include/linux/nfsd/nfsfh.h +++ b/include/linux/nfsd/nfsfh.h | |||
@@ -151,9 +151,15 @@ typedef struct svc_fh { | |||
151 | __u64 fh_pre_size; /* size before operation */ | 151 | __u64 fh_pre_size; /* size before operation */ |
152 | struct timespec fh_pre_mtime; /* mtime before oper */ | 152 | struct timespec fh_pre_mtime; /* mtime before oper */ |
153 | struct timespec fh_pre_ctime; /* ctime before oper */ | 153 | struct timespec fh_pre_ctime; /* ctime before oper */ |
154 | /* | ||
155 | * pre-op nfsv4 change attr: note must check IS_I_VERSION(inode) | ||
156 | * to find out if it is valid. | ||
157 | */ | ||
158 | u64 fh_pre_change; | ||
154 | 159 | ||
155 | /* Post-op attributes saved in fh_unlock */ | 160 | /* Post-op attributes saved in fh_unlock */ |
156 | struct kstat fh_post_attr; /* full attrs after operation */ | 161 | struct kstat fh_post_attr; /* full attrs after operation */ |
162 | u64 fh_post_change; /* nfsv4 change; see above */ | ||
157 | #endif /* CONFIG_NFSD_V3 */ | 163 | #endif /* CONFIG_NFSD_V3 */ |
158 | 164 | ||
159 | } svc_fh; | 165 | } svc_fh; |
@@ -298,6 +304,7 @@ fill_pre_wcc(struct svc_fh *fhp) | |||
298 | fhp->fh_pre_mtime = inode->i_mtime; | 304 | fhp->fh_pre_mtime = inode->i_mtime; |
299 | fhp->fh_pre_ctime = inode->i_ctime; | 305 | fhp->fh_pre_ctime = inode->i_ctime; |
300 | fhp->fh_pre_size = inode->i_size; | 306 | fhp->fh_pre_size = inode->i_size; |
307 | fhp->fh_pre_change = inode->i_version; | ||
301 | fhp->fh_pre_saved = 1; | 308 | fhp->fh_pre_saved = 1; |
302 | } | 309 | } |
303 | } | 310 | } |
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h index 4d61c873feed..57ab2ed08459 100644 --- a/include/linux/nfsd/state.h +++ b/include/linux/nfsd/state.h | |||
@@ -41,7 +41,6 @@ | |||
41 | #include <linux/kref.h> | 41 | #include <linux/kref.h> |
42 | #include <linux/sunrpc/clnt.h> | 42 | #include <linux/sunrpc/clnt.h> |
43 | 43 | ||
44 | #define NFS4_OPAQUE_LIMIT 1024 | ||
45 | typedef struct { | 44 | typedef struct { |
46 | u32 cl_boot; | 45 | u32 cl_boot; |
47 | u32 cl_id; | 46 | u32 cl_id; |
@@ -61,15 +60,6 @@ typedef struct { | |||
61 | #define si_stateownerid si_opaque.so_stateownerid | 60 | #define si_stateownerid si_opaque.so_stateownerid |
62 | #define si_fileid si_opaque.so_fileid | 61 | #define si_fileid si_opaque.so_fileid |
63 | 62 | ||
64 | |||
65 | struct nfs4_cb_recall { | ||
66 | u32 cbr_ident; | ||
67 | int cbr_trunc; | ||
68 | stateid_t cbr_stateid; | ||
69 | struct knfsd_fh cbr_fh; | ||
70 | struct nfs4_delegation *cbr_dp; | ||
71 | }; | ||
72 | |||
73 | struct nfs4_delegation { | 63 | struct nfs4_delegation { |
74 | struct list_head dl_perfile; | 64 | struct list_head dl_perfile; |
75 | struct list_head dl_perclnt; | 65 | struct list_head dl_perclnt; |
@@ -81,22 +71,25 @@ struct nfs4_delegation { | |||
81 | struct file *dl_vfs_file; | 71 | struct file *dl_vfs_file; |
82 | u32 dl_type; | 72 | u32 dl_type; |
83 | time_t dl_time; | 73 | time_t dl_time; |
84 | struct nfs4_cb_recall dl_recall; | 74 | /* For recall: */ |
75 | u32 dl_ident; | ||
76 | stateid_t dl_stateid; | ||
77 | struct knfsd_fh dl_fh; | ||
78 | int dl_retries; | ||
85 | }; | 79 | }; |
86 | 80 | ||
87 | #define dl_stateid dl_recall.cbr_stateid | ||
88 | #define dl_fh dl_recall.cbr_fh | ||
89 | |||
90 | /* client delegation callback info */ | 81 | /* client delegation callback info */ |
91 | struct nfs4_callback { | 82 | struct nfs4_cb_conn { |
92 | /* SETCLIENTID info */ | 83 | /* SETCLIENTID info */ |
93 | u32 cb_addr; | 84 | u32 cb_addr; |
94 | unsigned short cb_port; | 85 | unsigned short cb_port; |
95 | u32 cb_prog; | 86 | u32 cb_prog; |
96 | u32 cb_ident; | 87 | u32 cb_minorversion; |
88 | u32 cb_ident; /* minorversion 0 only */ | ||
97 | /* RPC client info */ | 89 | /* RPC client info */ |
98 | atomic_t cb_set; /* successful CB_NULL call */ | 90 | atomic_t cb_set; /* successful CB_NULL call */ |
99 | struct rpc_clnt * cb_client; | 91 | struct rpc_clnt * cb_client; |
92 | struct rpc_cred * cb_cred; | ||
100 | }; | 93 | }; |
101 | 94 | ||
102 | /* Maximum number of slots per session. 128 is useful for long haul TCP */ | 95 | /* Maximum number of slots per session. 128 is useful for long haul TCP */ |
@@ -122,6 +115,17 @@ struct nfsd4_slot { | |||
122 | struct nfsd4_cache_entry sl_cache_entry; | 115 | struct nfsd4_cache_entry sl_cache_entry; |
123 | }; | 116 | }; |
124 | 117 | ||
118 | struct nfsd4_channel_attrs { | ||
119 | u32 headerpadsz; | ||
120 | u32 maxreq_sz; | ||
121 | u32 maxresp_sz; | ||
122 | u32 maxresp_cached; | ||
123 | u32 maxops; | ||
124 | u32 maxreqs; | ||
125 | u32 nr_rdma_attrs; | ||
126 | u32 rdma_attrs; | ||
127 | }; | ||
128 | |||
125 | struct nfsd4_session { | 129 | struct nfsd4_session { |
126 | struct kref se_ref; | 130 | struct kref se_ref; |
127 | struct list_head se_hash; /* hash by sessionid */ | 131 | struct list_head se_hash; /* hash by sessionid */ |
@@ -129,11 +133,8 @@ struct nfsd4_session { | |||
129 | u32 se_flags; | 133 | u32 se_flags; |
130 | struct nfs4_client *se_client; /* for expire_client */ | 134 | struct nfs4_client *se_client; /* for expire_client */ |
131 | struct nfs4_sessionid se_sessionid; | 135 | struct nfs4_sessionid se_sessionid; |
132 | u32 se_fmaxreq_sz; | 136 | struct nfsd4_channel_attrs se_fchannel; |
133 | u32 se_fmaxresp_sz; | 137 | struct nfsd4_channel_attrs se_bchannel; |
134 | u32 se_fmaxresp_cached; | ||
135 | u32 se_fmaxops; | ||
136 | u32 se_fnumslots; | ||
137 | struct nfsd4_slot se_slots[]; /* forward channel slots */ | 138 | struct nfsd4_slot se_slots[]; /* forward channel slots */ |
138 | }; | 139 | }; |
139 | 140 | ||
@@ -185,7 +186,7 @@ struct nfs4_client { | |||
185 | struct svc_cred cl_cred; /* setclientid principal */ | 186 | struct svc_cred cl_cred; /* setclientid principal */ |
186 | clientid_t cl_clientid; /* generated by server */ | 187 | clientid_t cl_clientid; /* generated by server */ |
187 | nfs4_verifier cl_confirm; /* generated by server */ | 188 | nfs4_verifier cl_confirm; /* generated by server */ |
188 | struct nfs4_callback cl_callback; /* callback info */ | 189 | struct nfs4_cb_conn cl_cb_conn; /* callback info */ |
189 | atomic_t cl_count; /* ref count */ | 190 | atomic_t cl_count; /* ref count */ |
190 | u32 cl_firststate; /* recovery dir creation */ | 191 | u32 cl_firststate; /* recovery dir creation */ |
191 | 192 | ||
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h index f80d6013fdc3..2bacf7535069 100644 --- a/include/linux/nfsd/xdr4.h +++ b/include/linux/nfsd/xdr4.h | |||
@@ -64,10 +64,13 @@ static inline bool nfsd4_has_session(struct nfsd4_compound_state *cs) | |||
64 | 64 | ||
65 | struct nfsd4_change_info { | 65 | struct nfsd4_change_info { |
66 | u32 atomic; | 66 | u32 atomic; |
67 | bool change_supported; | ||
67 | u32 before_ctime_sec; | 68 | u32 before_ctime_sec; |
68 | u32 before_ctime_nsec; | 69 | u32 before_ctime_nsec; |
70 | u64 before_change; | ||
69 | u32 after_ctime_sec; | 71 | u32 after_ctime_sec; |
70 | u32 after_ctime_nsec; | 72 | u32 after_ctime_nsec; |
73 | u64 after_change; | ||
71 | }; | 74 | }; |
72 | 75 | ||
73 | struct nfsd4_access { | 76 | struct nfsd4_access { |
@@ -363,17 +366,6 @@ struct nfsd4_exchange_id { | |||
363 | int spa_how; | 366 | int spa_how; |
364 | }; | 367 | }; |
365 | 368 | ||
366 | struct nfsd4_channel_attrs { | ||
367 | u32 headerpadsz; | ||
368 | u32 maxreq_sz; | ||
369 | u32 maxresp_sz; | ||
370 | u32 maxresp_cached; | ||
371 | u32 maxops; | ||
372 | u32 maxreqs; | ||
373 | u32 nr_rdma_attrs; | ||
374 | u32 rdma_attrs; | ||
375 | }; | ||
376 | |||
377 | struct nfsd4_create_session { | 369 | struct nfsd4_create_session { |
378 | clientid_t clientid; | 370 | clientid_t clientid; |
379 | struct nfs4_sessionid sessionid; | 371 | struct nfs4_sessionid sessionid; |
@@ -503,10 +495,16 @@ set_change_info(struct nfsd4_change_info *cinfo, struct svc_fh *fhp) | |||
503 | { | 495 | { |
504 | BUG_ON(!fhp->fh_pre_saved || !fhp->fh_post_saved); | 496 | BUG_ON(!fhp->fh_pre_saved || !fhp->fh_post_saved); |
505 | cinfo->atomic = 1; | 497 | cinfo->atomic = 1; |
506 | cinfo->before_ctime_sec = fhp->fh_pre_ctime.tv_sec; | 498 | cinfo->change_supported = IS_I_VERSION(fhp->fh_dentry->d_inode); |
507 | cinfo->before_ctime_nsec = fhp->fh_pre_ctime.tv_nsec; | 499 | if (cinfo->change_supported) { |
508 | cinfo->after_ctime_sec = fhp->fh_post_attr.ctime.tv_sec; | 500 | cinfo->before_change = fhp->fh_pre_change; |
509 | cinfo->after_ctime_nsec = fhp->fh_post_attr.ctime.tv_nsec; | 501 | cinfo->after_change = fhp->fh_post_change; |
502 | } else { | ||
503 | cinfo->before_ctime_sec = fhp->fh_pre_ctime.tv_sec; | ||
504 | cinfo->before_ctime_nsec = fhp->fh_pre_ctime.tv_nsec; | ||
505 | cinfo->after_ctime_sec = fhp->fh_post_attr.ctime.tv_sec; | ||
506 | cinfo->after_ctime_nsec = fhp->fh_post_attr.ctime.tv_nsec; | ||
507 | } | ||
510 | } | 508 | } |
511 | 509 | ||
512 | int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *); | 510 | int nfs4svc_encode_voidres(struct svc_rqst *, __be32 *, void *); |
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index cbe8ce3bf486..dbea93b694e5 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -7,7 +7,7 @@ | |||
7 | * Copyright 2008 Michael Wu <flamingice@sourmilk.net> | 7 | * Copyright 2008 Michael Wu <flamingice@sourmilk.net> |
8 | * Copyright 2008 Luis Carlos Cobo <luisca@cozybit.com> | 8 | * Copyright 2008 Luis Carlos Cobo <luisca@cozybit.com> |
9 | * Copyright 2008 Michael Buesch <mb@bu3sch.de> | 9 | * Copyright 2008 Michael Buesch <mb@bu3sch.de> |
10 | * Copyright 2008 Luis R. Rodriguez <lrodriguez@atheros.com> | 10 | * Copyright 2008, 2009 Luis R. Rodriguez <lrodriguez@atheros.com> |
11 | * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com> | 11 | * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com> |
12 | * Copyright 2008 Colin McCabe <colin@cozybit.com> | 12 | * Copyright 2008 Colin McCabe <colin@cozybit.com> |
13 | * | 13 | * |
@@ -25,6 +25,8 @@ | |||
25 | * | 25 | * |
26 | */ | 26 | */ |
27 | 27 | ||
28 | #include <linux/types.h> | ||
29 | |||
28 | /** | 30 | /** |
29 | * DOC: Station handling | 31 | * DOC: Station handling |
30 | * | 32 | * |
@@ -46,8 +48,10 @@ | |||
46 | * to get a list of all present wiphys. | 48 | * to get a list of all present wiphys. |
47 | * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or | 49 | * @NL80211_CMD_SET_WIPHY: set wiphy parameters, needs %NL80211_ATTR_WIPHY or |
48 | * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME, | 50 | * %NL80211_ATTR_IFINDEX; can be used to set %NL80211_ATTR_WIPHY_NAME, |
49 | * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ, and/or | 51 | * %NL80211_ATTR_WIPHY_TXQ_PARAMS, %NL80211_ATTR_WIPHY_FREQ, |
50 | * %NL80211_ATTR_WIPHY_CHANNEL_TYPE. | 52 | * %NL80211_ATTR_WIPHY_CHANNEL_TYPE, %NL80211_ATTR_WIPHY_RETRY_SHORT, |
53 | * %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD, | ||
54 | * and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD. | ||
51 | * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request | 55 | * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request |
52 | * or rename notification. Has attributes %NL80211_ATTR_WIPHY and | 56 | * or rename notification. Has attributes %NL80211_ATTR_WIPHY and |
53 | * %NL80211_ATTR_WIPHY_NAME. | 57 | * %NL80211_ATTR_WIPHY_NAME. |
@@ -75,8 +79,8 @@ | |||
75 | * @NL80211_CMD_SET_KEY: Set key attributes %NL80211_ATTR_KEY_DEFAULT, | 79 | * @NL80211_CMD_SET_KEY: Set key attributes %NL80211_ATTR_KEY_DEFAULT, |
76 | * %NL80211_ATTR_KEY_DEFAULT_MGMT, or %NL80211_ATTR_KEY_THRESHOLD. | 80 | * %NL80211_ATTR_KEY_DEFAULT_MGMT, or %NL80211_ATTR_KEY_THRESHOLD. |
77 | * @NL80211_CMD_NEW_KEY: add a key with given %NL80211_ATTR_KEY_DATA, | 81 | * @NL80211_CMD_NEW_KEY: add a key with given %NL80211_ATTR_KEY_DATA, |
78 | * %NL80211_ATTR_KEY_IDX, %NL80211_ATTR_MAC and %NL80211_ATTR_KEY_CIPHER | 82 | * %NL80211_ATTR_KEY_IDX, %NL80211_ATTR_MAC, %NL80211_ATTR_KEY_CIPHER, |
79 | * attributes. | 83 | * and %NL80211_ATTR_KEY_SEQ attributes. |
80 | * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX | 84 | * @NL80211_CMD_DEL_KEY: delete a key identified by %NL80211_ATTR_KEY_IDX |
81 | * or %NL80211_ATTR_MAC. | 85 | * or %NL80211_ATTR_MAC. |
82 | * | 86 | * |
@@ -166,6 +170,22 @@ | |||
166 | * set (%NL80211_ATTR_REG_TYPE), if the type of regulatory domain is | 170 | * set (%NL80211_ATTR_REG_TYPE), if the type of regulatory domain is |
167 | * %NL80211_REG_TYPE_COUNTRY the alpha2 to which we have moved on | 171 | * %NL80211_REG_TYPE_COUNTRY the alpha2 to which we have moved on |
168 | * to (%NL80211_ATTR_REG_ALPHA2). | 172 | * to (%NL80211_ATTR_REG_ALPHA2). |
173 | * @NL80211_CMD_REG_BEACON_HINT: indicates to userspace that an AP beacon | ||
174 | * has been found while world roaming thus enabling active scan or | ||
175 | * any mode of operation that initiates TX (beacons) on a channel | ||
176 | * where we would not have been able to do either before. As an example | ||
177 | * if you are world roaming (regulatory domain set to world or if your | ||
178 | * driver is using a custom world roaming regulatory domain) and while | ||
179 | * doing a passive scan on the 5 GHz band you find an AP there (if not | ||
180 | * on a DFS channel) you will now be able to actively scan for that AP | ||
181 | * or use AP mode on your card on that same channel. Note that this will | ||
182 | * never be used for channels 1-11 on the 2 GHz band as they are always | ||
183 | * enabled world wide. This beacon hint is only sent if your device had | ||
184 | * either disabled active scanning or beaconing on a channel. We send to | ||
185 | * userspace the wiphy on which we removed a restriction from | ||
186 | * (%NL80211_ATTR_WIPHY) and the channel on which this occurred | ||
187 | * before (%NL80211_ATTR_FREQ_BEFORE) and after (%NL80211_ATTR_FREQ_AFTER) | ||
188 | * the beacon hint was processed. | ||
169 | * | 189 | * |
170 | * @NL80211_CMD_AUTHENTICATE: authentication request and notification. | 190 | * @NL80211_CMD_AUTHENTICATE: authentication request and notification. |
171 | * This command is used both as a command (request to authenticate) and | 191 | * This command is used both as a command (request to authenticate) and |
@@ -185,8 +205,12 @@ | |||
185 | * frame, i.e., it was for the local STA and was received in correct | 205 | * frame, i.e., it was for the local STA and was received in correct |
186 | * state. This is similar to MLME-AUTHENTICATE.confirm primitive in the | 206 | * state. This is similar to MLME-AUTHENTICATE.confirm primitive in the |
187 | * MLME SAP interface (kernel providing MLME, userspace SME). The | 207 | * MLME SAP interface (kernel providing MLME, userspace SME). The |
188 | * included NL80211_ATTR_FRAME attribute contains the management frame | 208 | * included %NL80211_ATTR_FRAME attribute contains the management frame |
189 | * (including both the header and frame body, but not FCS). | 209 | * (including both the header and frame body, but not FCS). This event is |
210 | * also used to indicate if the authentication attempt timed out. In that | ||
211 | * case the %NL80211_ATTR_FRAME attribute is replaced with a | ||
212 | * %NL80211_ATTR_TIMED_OUT flag (and %NL80211_ATTR_MAC to indicate which | ||
213 | * pending authentication timed out). | ||
190 | * @NL80211_CMD_ASSOCIATE: association request and notification; like | 214 | * @NL80211_CMD_ASSOCIATE: association request and notification; like |
191 | * NL80211_CMD_AUTHENTICATE but for Association and Reassociation | 215 | * NL80211_CMD_AUTHENTICATE but for Association and Reassociation |
192 | * (similar to MLME-ASSOCIATE.request, MLME-REASSOCIATE.request, | 216 | * (similar to MLME-ASSOCIATE.request, MLME-REASSOCIATE.request, |
@@ -199,6 +223,25 @@ | |||
199 | * NL80211_CMD_AUTHENTICATE but for Disassociation frames (similar to | 223 | * NL80211_CMD_AUTHENTICATE but for Disassociation frames (similar to |
200 | * MLME-DISASSOCIATE.request and MLME-DISASSOCIATE.indication primitives). | 224 | * MLME-DISASSOCIATE.request and MLME-DISASSOCIATE.indication primitives). |
201 | * | 225 | * |
226 | * @NL80211_CMD_MICHAEL_MIC_FAILURE: notification of a locally detected Michael | ||
227 | * MIC (part of TKIP) failure; sent on the "mlme" multicast group; the | ||
228 | * event includes %NL80211_ATTR_MAC to describe the source MAC address of | ||
229 | * the frame with invalid MIC, %NL80211_ATTR_KEY_TYPE to show the key | ||
230 | * type, %NL80211_ATTR_KEY_IDX to indicate the key identifier, and | ||
231 | * %NL80211_ATTR_KEY_SEQ to indicate the TSC value of the frame; this | ||
232 | * event matches with MLME-MICHAELMICFAILURE.indication() primitive | ||
233 | * | ||
234 | * @NL80211_CMD_JOIN_IBSS: Join a new IBSS -- given at least an SSID and a | ||
235 | * FREQ attribute (for the initial frequency if no peer can be found) | ||
236 | * and optionally a MAC (as BSSID) and FREQ_FIXED attribute if those | ||
237 | * should be fixed rather than automatically determined. Can only be | ||
238 | * executed on a network interface that is UP, and fixed BSSID/FREQ | ||
239 | * may be rejected. Another optional parameter is the beacon interval, | ||
240 | * given in the %NL80211_ATTR_BEACON_INTERVAL attribute, which if not | ||
241 | * given defaults to 100 TU (102.4ms). | ||
242 | * @NL80211_CMD_LEAVE_IBSS: Leave the IBSS -- no special arguments, the IBSS is | ||
243 | * determined by the network interface. | ||
244 | * | ||
202 | * @NL80211_CMD_MAX: highest used command number | 245 | * @NL80211_CMD_MAX: highest used command number |
203 | * @__NL80211_CMD_AFTER_LAST: internal use | 246 | * @__NL80211_CMD_AFTER_LAST: internal use |
204 | */ | 247 | */ |
@@ -260,6 +303,13 @@ enum nl80211_commands { | |||
260 | NL80211_CMD_DEAUTHENTICATE, | 303 | NL80211_CMD_DEAUTHENTICATE, |
261 | NL80211_CMD_DISASSOCIATE, | 304 | NL80211_CMD_DISASSOCIATE, |
262 | 305 | ||
306 | NL80211_CMD_MICHAEL_MIC_FAILURE, | ||
307 | |||
308 | NL80211_CMD_REG_BEACON_HINT, | ||
309 | |||
310 | NL80211_CMD_JOIN_IBSS, | ||
311 | NL80211_CMD_LEAVE_IBSS, | ||
312 | |||
263 | /* add new commands above here */ | 313 | /* add new commands above here */ |
264 | 314 | ||
265 | /* used to define NL80211_CMD_MAX below */ | 315 | /* used to define NL80211_CMD_MAX below */ |
@@ -278,6 +328,7 @@ enum nl80211_commands { | |||
278 | #define NL80211_CMD_ASSOCIATE NL80211_CMD_ASSOCIATE | 328 | #define NL80211_CMD_ASSOCIATE NL80211_CMD_ASSOCIATE |
279 | #define NL80211_CMD_DEAUTHENTICATE NL80211_CMD_DEAUTHENTICATE | 329 | #define NL80211_CMD_DEAUTHENTICATE NL80211_CMD_DEAUTHENTICATE |
280 | #define NL80211_CMD_DISASSOCIATE NL80211_CMD_DISASSOCIATE | 330 | #define NL80211_CMD_DISASSOCIATE NL80211_CMD_DISASSOCIATE |
331 | #define NL80211_CMD_REG_BEACON_HINT NL80211_CMD_REG_BEACON_HINT | ||
281 | 332 | ||
282 | /** | 333 | /** |
283 | * enum nl80211_attrs - nl80211 netlink attributes | 334 | * enum nl80211_attrs - nl80211 netlink attributes |
@@ -296,6 +347,18 @@ enum nl80211_commands { | |||
296 | * NL80211_CHAN_HT20 = HT20 only | 347 | * NL80211_CHAN_HT20 = HT20 only |
297 | * NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel | 348 | * NL80211_CHAN_HT40MINUS = secondary channel is below the primary channel |
298 | * NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel | 349 | * NL80211_CHAN_HT40PLUS = secondary channel is above the primary channel |
350 | * @NL80211_ATTR_WIPHY_RETRY_SHORT: TX retry limit for frames whose length is | ||
351 | * less than or equal to the RTS threshold; allowed range: 1..255; | ||
352 | * dot11ShortRetryLimit; u8 | ||
353 | * @NL80211_ATTR_WIPHY_RETRY_LONG: TX retry limit for frames whose length is | ||
354 | * greater than the RTS threshold; allowed range: 1..255; | ||
355 | * dot11ShortLongLimit; u8 | ||
356 | * @NL80211_ATTR_WIPHY_FRAG_THRESHOLD: fragmentation threshold, i.e., maximum | ||
357 | * length in octets for frames; allowed range: 256..8000, disable | ||
358 | * fragmentation with (u32)-1; dot11FragmentationThreshold; u32 | ||
359 | * @NL80211_ATTR_WIPHY_RTS_THRESHOLD: RTS threshold (TX frames with length | ||
360 | * larger than or equal to this use RTS/CTS handshake); allowed range: | ||
361 | * 0..65536, disable with (u32)-1; dot11RTSThreshold; u32 | ||
299 | * | 362 | * |
300 | * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on | 363 | * @NL80211_ATTR_IFINDEX: network interface index of the device to operate on |
301 | * @NL80211_ATTR_IFNAME: network interface name | 364 | * @NL80211_ATTR_IFNAME: network interface name |
@@ -319,7 +382,7 @@ enum nl80211_commands { | |||
319 | * | 382 | * |
320 | * @NL80211_ATTR_STA_AID: Association ID for the station (u16) | 383 | * @NL80211_ATTR_STA_AID: Association ID for the station (u16) |
321 | * @NL80211_ATTR_STA_FLAGS: flags, nested element with NLA_FLAG attributes of | 384 | * @NL80211_ATTR_STA_FLAGS: flags, nested element with NLA_FLAG attributes of |
322 | * &enum nl80211_sta_flags. | 385 | * &enum nl80211_sta_flags (deprecated, use %NL80211_ATTR_STA_FLAGS2) |
323 | * @NL80211_ATTR_STA_LISTEN_INTERVAL: listen interval as defined by | 386 | * @NL80211_ATTR_STA_LISTEN_INTERVAL: listen interval as defined by |
324 | * IEEE 802.11 7.3.1.6 (u16). | 387 | * IEEE 802.11 7.3.1.6 (u16). |
325 | * @NL80211_ATTR_STA_SUPPORTED_RATES: supported rates, array of supported | 388 | * @NL80211_ATTR_STA_SUPPORTED_RATES: supported rates, array of supported |
@@ -380,6 +443,8 @@ enum nl80211_commands { | |||
380 | * | 443 | * |
381 | * @NL80211_ATTR_MAX_NUM_SCAN_SSIDS: number of SSIDs you can scan with | 444 | * @NL80211_ATTR_MAX_NUM_SCAN_SSIDS: number of SSIDs you can scan with |
382 | * a single scan request, a wiphy attribute. | 445 | * a single scan request, a wiphy attribute. |
446 | * @NL80211_ATTR_MAX_SCAN_IE_LEN: maximum length of information elements | ||
447 | * that can be added to a scan request | ||
383 | * | 448 | * |
384 | * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz) | 449 | * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz) |
385 | * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive | 450 | * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive |
@@ -408,6 +473,44 @@ enum nl80211_commands { | |||
408 | * @NL80211_ATTR_REASON_CODE: ReasonCode for %NL80211_CMD_DEAUTHENTICATE and | 473 | * @NL80211_ATTR_REASON_CODE: ReasonCode for %NL80211_CMD_DEAUTHENTICATE and |
409 | * %NL80211_CMD_DISASSOCIATE, u16 | 474 | * %NL80211_CMD_DISASSOCIATE, u16 |
410 | * | 475 | * |
476 | * @NL80211_ATTR_KEY_TYPE: Key Type, see &enum nl80211_key_type, represented as | ||
477 | * a u32 | ||
478 | * | ||
479 | * @NL80211_ATTR_FREQ_BEFORE: A channel which has suffered a regulatory change | ||
480 | * due to considerations from a beacon hint. This attribute reflects | ||
481 | * the state of the channel _before_ the beacon hint processing. This | ||
482 | * attributes consists of a nested attribute containing | ||
483 | * NL80211_FREQUENCY_ATTR_* | ||
484 | * @NL80211_ATTR_FREQ_AFTER: A channel which has suffered a regulatory change | ||
485 | * due to considerations from a beacon hint. This attribute reflects | ||
486 | * the state of the channel _after_ the beacon hint processing. This | ||
487 | * attributes consists of a nested attribute containing | ||
488 | * NL80211_FREQUENCY_ATTR_* | ||
489 | * | ||
490 | * @NL80211_ATTR_CIPHER_SUITES: a set of u32 values indicating the supported | ||
491 | * cipher suites | ||
492 | * | ||
493 | * @NL80211_ATTR_FREQ_FIXED: a flag indicating the IBSS should not try to look | ||
494 | * for other networks on different channels | ||
495 | * | ||
496 | * @NL80211_ATTR_TIMED_OUT: a flag indicating than an operation timed out; this | ||
497 | * is used, e.g., with %NL80211_CMD_AUTHENTICATE event | ||
498 | * | ||
499 | * @NL80211_ATTR_USE_MFP: Whether management frame protection (IEEE 802.11w) is | ||
500 | * used for the association (&enum nl80211_mfp, represented as a u32); | ||
501 | * this attribute can be used | ||
502 | * with %NL80211_CMD_ASSOCIATE request | ||
503 | * | ||
504 | * @NL80211_ATTR_STA_FLAGS2: Attribute containing a | ||
505 | * &struct nl80211_sta_flag_update. | ||
506 | * | ||
507 | * @NL80211_ATTR_CONTROL_PORT: A flag indicating whether user space controls | ||
508 | * IEEE 802.1X port, i.e., sets/clears %NL80211_STA_FLAG_AUTHORIZED, in | ||
509 | * station mode. If the flag is included in %NL80211_CMD_ASSOCIATE | ||
510 | * request, the driver will assume that the port is unauthorized until | ||
511 | * authorized by user space. Otherwise, port is marked authorized by | ||
512 | * default in station mode. | ||
513 | * | ||
411 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 514 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
412 | * @__NL80211_ATTR_AFTER_LAST: internal use | 515 | * @__NL80211_ATTR_AFTER_LAST: internal use |
413 | */ | 516 | */ |
@@ -492,6 +595,30 @@ enum nl80211_attrs { | |||
492 | NL80211_ATTR_AUTH_TYPE, | 595 | NL80211_ATTR_AUTH_TYPE, |
493 | NL80211_ATTR_REASON_CODE, | 596 | NL80211_ATTR_REASON_CODE, |
494 | 597 | ||
598 | NL80211_ATTR_KEY_TYPE, | ||
599 | |||
600 | NL80211_ATTR_MAX_SCAN_IE_LEN, | ||
601 | NL80211_ATTR_CIPHER_SUITES, | ||
602 | |||
603 | NL80211_ATTR_FREQ_BEFORE, | ||
604 | NL80211_ATTR_FREQ_AFTER, | ||
605 | |||
606 | NL80211_ATTR_FREQ_FIXED, | ||
607 | |||
608 | |||
609 | NL80211_ATTR_WIPHY_RETRY_SHORT, | ||
610 | NL80211_ATTR_WIPHY_RETRY_LONG, | ||
611 | NL80211_ATTR_WIPHY_FRAG_THRESHOLD, | ||
612 | NL80211_ATTR_WIPHY_RTS_THRESHOLD, | ||
613 | |||
614 | NL80211_ATTR_TIMED_OUT, | ||
615 | |||
616 | NL80211_ATTR_USE_MFP, | ||
617 | |||
618 | NL80211_ATTR_STA_FLAGS2, | ||
619 | |||
620 | NL80211_ATTR_CONTROL_PORT, | ||
621 | |||
495 | /* add attributes here, update the policy in nl80211.c */ | 622 | /* add attributes here, update the policy in nl80211.c */ |
496 | 623 | ||
497 | __NL80211_ATTR_AFTER_LAST, | 624 | __NL80211_ATTR_AFTER_LAST, |
@@ -581,6 +708,18 @@ enum nl80211_sta_flags { | |||
581 | }; | 708 | }; |
582 | 709 | ||
583 | /** | 710 | /** |
711 | * struct nl80211_sta_flag_update - station flags mask/set | ||
712 | * @mask: mask of station flags to set | ||
713 | * @set: which values to set them to | ||
714 | * | ||
715 | * Both mask and set contain bits as per &enum nl80211_sta_flags. | ||
716 | */ | ||
717 | struct nl80211_sta_flag_update { | ||
718 | __u32 mask; | ||
719 | __u32 set; | ||
720 | } __attribute__((packed)); | ||
721 | |||
722 | /** | ||
584 | * enum nl80211_rate_info - bitrate information | 723 | * enum nl80211_rate_info - bitrate information |
585 | * | 724 | * |
586 | * These attribute types are used with %NL80211_STA_INFO_TXRATE | 725 | * These attribute types are used with %NL80211_STA_INFO_TXRATE |
@@ -1062,4 +1201,27 @@ enum nl80211_auth_type { | |||
1062 | NL80211_AUTHTYPE_FT, | 1201 | NL80211_AUTHTYPE_FT, |
1063 | NL80211_AUTHTYPE_NETWORK_EAP, | 1202 | NL80211_AUTHTYPE_NETWORK_EAP, |
1064 | }; | 1203 | }; |
1204 | |||
1205 | /** | ||
1206 | * enum nl80211_key_type - Key Type | ||
1207 | * @NL80211_KEYTYPE_GROUP: Group (broadcast/multicast) key | ||
1208 | * @NL80211_KEYTYPE_PAIRWISE: Pairwise (unicast/individual) key | ||
1209 | * @NL80211_KEYTYPE_PEERKEY: PeerKey (DLS) | ||
1210 | */ | ||
1211 | enum nl80211_key_type { | ||
1212 | NL80211_KEYTYPE_GROUP, | ||
1213 | NL80211_KEYTYPE_PAIRWISE, | ||
1214 | NL80211_KEYTYPE_PEERKEY, | ||
1215 | }; | ||
1216 | |||
1217 | /** | ||
1218 | * enum nl80211_mfp - Management frame protection state | ||
1219 | * @NL80211_MFP_NO: Management frame protection not used | ||
1220 | * @NL80211_MFP_REQUIRED: Management frame protection required | ||
1221 | */ | ||
1222 | enum nl80211_mfp { | ||
1223 | NL80211_MFP_NO, | ||
1224 | NL80211_MFP_REQUIRED, | ||
1225 | }; | ||
1226 | |||
1065 | #endif /* __LINUX_NL80211_H */ | 1227 | #endif /* __LINUX_NL80211_H */ |
diff --git a/include/linux/nl802154.h b/include/linux/nl802154.h new file mode 100644 index 000000000000..2cda00ccfcca --- /dev/null +++ b/include/linux/nl802154.h | |||
@@ -0,0 +1,119 @@ | |||
1 | /* | ||
2 | * nl802154.h | ||
3 | * | ||
4 | * Copyright (C) 2007, 2008, 2009 Siemens AG | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 | ||
8 | * as published by the Free Software Foundation. | ||
9 | * | ||
10 | * This program is distributed in the hope that it will be useful, | ||
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | * You should have received a copy of the GNU General Public License along | ||
16 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
17 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||
18 | * | ||
19 | */ | ||
20 | |||
21 | #ifndef NL802154_H | ||
22 | #define NL802154_H | ||
23 | |||
24 | #define IEEE802154_NL_NAME "802.15.4 MAC" | ||
25 | #define IEEE802154_MCAST_COORD_NAME "coordinator" | ||
26 | #define IEEE802154_MCAST_BEACON_NAME "beacon" | ||
27 | |||
28 | enum { | ||
29 | __IEEE802154_ATTR_INVALID, | ||
30 | |||
31 | IEEE802154_ATTR_DEV_NAME, | ||
32 | IEEE802154_ATTR_DEV_INDEX, | ||
33 | |||
34 | IEEE802154_ATTR_STATUS, | ||
35 | |||
36 | IEEE802154_ATTR_SHORT_ADDR, | ||
37 | IEEE802154_ATTR_HW_ADDR, | ||
38 | IEEE802154_ATTR_PAN_ID, | ||
39 | |||
40 | IEEE802154_ATTR_CHANNEL, | ||
41 | |||
42 | IEEE802154_ATTR_COORD_SHORT_ADDR, | ||
43 | IEEE802154_ATTR_COORD_HW_ADDR, | ||
44 | IEEE802154_ATTR_COORD_PAN_ID, | ||
45 | |||
46 | IEEE802154_ATTR_SRC_SHORT_ADDR, | ||
47 | IEEE802154_ATTR_SRC_HW_ADDR, | ||
48 | IEEE802154_ATTR_SRC_PAN_ID, | ||
49 | |||
50 | IEEE802154_ATTR_DEST_SHORT_ADDR, | ||
51 | IEEE802154_ATTR_DEST_HW_ADDR, | ||
52 | IEEE802154_ATTR_DEST_PAN_ID, | ||
53 | |||
54 | IEEE802154_ATTR_CAPABILITY, | ||
55 | IEEE802154_ATTR_REASON, | ||
56 | IEEE802154_ATTR_SCAN_TYPE, | ||
57 | IEEE802154_ATTR_CHANNELS, | ||
58 | IEEE802154_ATTR_DURATION, | ||
59 | IEEE802154_ATTR_ED_LIST, | ||
60 | IEEE802154_ATTR_BCN_ORD, | ||
61 | IEEE802154_ATTR_SF_ORD, | ||
62 | IEEE802154_ATTR_PAN_COORD, | ||
63 | IEEE802154_ATTR_BAT_EXT, | ||
64 | IEEE802154_ATTR_COORD_REALIGN, | ||
65 | IEEE802154_ATTR_SEC, | ||
66 | |||
67 | __IEEE802154_ATTR_MAX, | ||
68 | }; | ||
69 | |||
70 | #define IEEE802154_ATTR_MAX (__IEEE802154_ATTR_MAX - 1) | ||
71 | |||
72 | extern struct nla_policy ieee802154_policy[]; | ||
73 | |||
74 | /* commands */ | ||
75 | /* REQ should be responded with CONF | ||
76 | * and INDIC with RESP | ||
77 | */ | ||
78 | enum { | ||
79 | __IEEE802154_COMMAND_INVALID, | ||
80 | |||
81 | IEEE802154_ASSOCIATE_REQ, | ||
82 | IEEE802154_ASSOCIATE_CONF, | ||
83 | IEEE802154_DISASSOCIATE_REQ, | ||
84 | IEEE802154_DISASSOCIATE_CONF, | ||
85 | IEEE802154_GET_REQ, | ||
86 | IEEE802154_GET_CONF, | ||
87 | IEEE802154_RESET_REQ, | ||
88 | IEEE802154_RESET_CONF, | ||
89 | IEEE802154_SCAN_REQ, | ||
90 | IEEE802154_SCAN_CONF, | ||
91 | IEEE802154_SET_REQ, | ||
92 | IEEE802154_SET_CONF, | ||
93 | IEEE802154_START_REQ, | ||
94 | IEEE802154_START_CONF, | ||
95 | IEEE802154_SYNC_REQ, | ||
96 | IEEE802154_POLL_REQ, | ||
97 | IEEE802154_POLL_CONF, | ||
98 | |||
99 | IEEE802154_ASSOCIATE_INDIC, | ||
100 | IEEE802154_ASSOCIATE_RESP, | ||
101 | IEEE802154_DISASSOCIATE_INDIC, | ||
102 | IEEE802154_BEACON_NOTIFY_INDIC, | ||
103 | IEEE802154_ORPHAN_INDIC, | ||
104 | IEEE802154_ORPHAN_RESP, | ||
105 | IEEE802154_COMM_STATUS_INDIC, | ||
106 | IEEE802154_SYNC_LOSS_INDIC, | ||
107 | |||
108 | IEEE802154_GTS_REQ, /* Not supported yet */ | ||
109 | IEEE802154_GTS_INDIC, /* Not supported yet */ | ||
110 | IEEE802154_GTS_CONF, /* Not supported yet */ | ||
111 | IEEE802154_RX_ENABLE_REQ, /* Not supported yet */ | ||
112 | IEEE802154_RX_ENABLE_CONF, /* Not supported yet */ | ||
113 | |||
114 | __IEEE802154_CMD_MAX, | ||
115 | }; | ||
116 | |||
117 | #define IEEE802154_CMD_MAX (__IEEE802154_CMD_MAX - 1) | ||
118 | |||
119 | #endif | ||
diff --git a/include/linux/nls.h b/include/linux/nls.h index 52b1a76c1b43..d47beef08dfd 100644 --- a/include/linux/nls.h +++ b/include/linux/nls.h | |||
@@ -3,8 +3,23 @@ | |||
3 | 3 | ||
4 | #include <linux/init.h> | 4 | #include <linux/init.h> |
5 | 5 | ||
6 | /* unicode character */ | 6 | /* Unicode has changed over the years. Unicode code points no longer |
7 | typedef __u16 wchar_t; | 7 | * fit into 16 bits; as of Unicode 5 valid code points range from 0 |
8 | * to 0x10ffff (17 planes, where each plane holds 65536 code points). | ||
9 | * | ||
10 | * The original decision to represent Unicode characters as 16-bit | ||
11 | * wchar_t values is now outdated. But plane 0 still includes the | ||
12 | * most commonly used characters, so we will retain it. The newer | ||
13 | * 32-bit unicode_t type can be used when it is necessary to | ||
14 | * represent the full Unicode character set. | ||
15 | */ | ||
16 | |||
17 | /* Plane-0 Unicode character */ | ||
18 | typedef u16 wchar_t; | ||
19 | #define MAX_WCHAR_T 0xffff | ||
20 | |||
21 | /* Arbitrary Unicode character */ | ||
22 | typedef u32 unicode_t; | ||
8 | 23 | ||
9 | struct nls_table { | 24 | struct nls_table { |
10 | const char *charset; | 25 | const char *charset; |
@@ -21,6 +36,13 @@ struct nls_table { | |||
21 | /* this value hold the maximum octet of charset */ | 36 | /* this value hold the maximum octet of charset */ |
22 | #define NLS_MAX_CHARSET_SIZE 6 /* for UTF-8 */ | 37 | #define NLS_MAX_CHARSET_SIZE 6 /* for UTF-8 */ |
23 | 38 | ||
39 | /* Byte order for UTF-16 strings */ | ||
40 | enum utf16_endian { | ||
41 | UTF16_HOST_ENDIAN, | ||
42 | UTF16_LITTLE_ENDIAN, | ||
43 | UTF16_BIG_ENDIAN | ||
44 | }; | ||
45 | |||
24 | /* nls.c */ | 46 | /* nls.c */ |
25 | extern int register_nls(struct nls_table *); | 47 | extern int register_nls(struct nls_table *); |
26 | extern int unregister_nls(struct nls_table *); | 48 | extern int unregister_nls(struct nls_table *); |
@@ -28,10 +50,11 @@ extern struct nls_table *load_nls(char *); | |||
28 | extern void unload_nls(struct nls_table *); | 50 | extern void unload_nls(struct nls_table *); |
29 | extern struct nls_table *load_nls_default(void); | 51 | extern struct nls_table *load_nls_default(void); |
30 | 52 | ||
31 | extern int utf8_mbtowc(wchar_t *, const __u8 *, int); | 53 | extern int utf8_to_utf32(const u8 *s, int len, unicode_t *pu); |
32 | extern int utf8_mbstowcs(wchar_t *, const __u8 *, int); | 54 | extern int utf32_to_utf8(unicode_t u, u8 *s, int maxlen); |
33 | extern int utf8_wctomb(__u8 *, wchar_t, int); | 55 | extern int utf8s_to_utf16s(const u8 *s, int len, wchar_t *pwcs); |
34 | extern int utf8_wcstombs(__u8 *, const wchar_t *, int); | 56 | extern int utf16s_to_utf8s(const wchar_t *pwcs, int len, |
57 | enum utf16_endian endian, u8 *s, int maxlen); | ||
35 | 58 | ||
36 | static inline unsigned char nls_tolower(struct nls_table *t, unsigned char c) | 59 | static inline unsigned char nls_tolower(struct nls_table *t, unsigned char c) |
37 | { | 60 | { |
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index 848025cd7087..829b94b156f2 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h | |||
@@ -408,6 +408,19 @@ static inline int num_node_state(enum node_states state) | |||
408 | #define next_online_node(nid) next_node((nid), node_states[N_ONLINE]) | 408 | #define next_online_node(nid) next_node((nid), node_states[N_ONLINE]) |
409 | 409 | ||
410 | extern int nr_node_ids; | 410 | extern int nr_node_ids; |
411 | extern int nr_online_nodes; | ||
412 | |||
413 | static inline void node_set_online(int nid) | ||
414 | { | ||
415 | node_set_state(nid, N_ONLINE); | ||
416 | nr_online_nodes = num_node_state(N_ONLINE); | ||
417 | } | ||
418 | |||
419 | static inline void node_set_offline(int nid) | ||
420 | { | ||
421 | node_clear_state(nid, N_ONLINE); | ||
422 | nr_online_nodes = num_node_state(N_ONLINE); | ||
423 | } | ||
411 | #else | 424 | #else |
412 | 425 | ||
413 | static inline int node_state(int node, enum node_states state) | 426 | static inline int node_state(int node, enum node_states state) |
@@ -434,7 +447,10 @@ static inline int num_node_state(enum node_states state) | |||
434 | #define first_online_node 0 | 447 | #define first_online_node 0 |
435 | #define next_online_node(nid) (MAX_NUMNODES) | 448 | #define next_online_node(nid) (MAX_NUMNODES) |
436 | #define nr_node_ids 1 | 449 | #define nr_node_ids 1 |
450 | #define nr_online_nodes 1 | ||
437 | 451 | ||
452 | #define node_set_online(node) node_set_state((node), N_ONLINE) | ||
453 | #define node_set_offline(node) node_clear_state((node), N_ONLINE) | ||
438 | #endif | 454 | #endif |
439 | 455 | ||
440 | #define node_online_map node_states[N_ONLINE] | 456 | #define node_online_map node_states[N_ONLINE] |
@@ -454,9 +470,6 @@ static inline int num_node_state(enum node_states state) | |||
454 | #define node_online(node) node_state((node), N_ONLINE) | 470 | #define node_online(node) node_state((node), N_ONLINE) |
455 | #define node_possible(node) node_state((node), N_POSSIBLE) | 471 | #define node_possible(node) node_state((node), N_POSSIBLE) |
456 | 472 | ||
457 | #define node_set_online(node) node_set_state((node), N_ONLINE) | ||
458 | #define node_set_offline(node) node_clear_state((node), N_ONLINE) | ||
459 | |||
460 | #define for_each_node(node) for_each_node_state(node, N_POSSIBLE) | 473 | #define for_each_node(node) for_each_node_state(node, N_POSSIBLE) |
461 | #define for_each_online_node(node) for_each_node_state(node, N_ONLINE) | 474 | #define for_each_online_node(node) for_each_node_state(node, N_ONLINE) |
462 | 475 | ||
diff --git a/include/linux/notifier.h b/include/linux/notifier.h index b86fa2ffca0c..81bc252dc8ac 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h | |||
@@ -198,6 +198,7 @@ static inline int notifier_to_errno(int ret) | |||
198 | #define NETDEV_CHANGENAME 0x000A | 198 | #define NETDEV_CHANGENAME 0x000A |
199 | #define NETDEV_FEAT_CHANGE 0x000B | 199 | #define NETDEV_FEAT_CHANGE 0x000B |
200 | #define NETDEV_BONDING_FAILOVER 0x000C | 200 | #define NETDEV_BONDING_FAILOVER 0x000C |
201 | #define NETDEV_PRE_UP 0x000D | ||
201 | 202 | ||
202 | #define SYS_DOWN 0x0001 /* Notify of system down */ | 203 | #define SYS_DOWN 0x0001 /* Notify of system down */ |
203 | #define SYS_RESTART SYS_DOWN | 204 | #define SYS_RESTART SYS_DOWN |
diff --git a/include/linux/of.h b/include/linux/of.h index 6a7efa242f5e..7be2d1043c16 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -77,6 +77,9 @@ extern int of_n_size_cells(struct device_node *np); | |||
77 | extern const struct of_device_id *of_match_node( | 77 | extern const struct of_device_id *of_match_node( |
78 | const struct of_device_id *matches, const struct device_node *node); | 78 | const struct of_device_id *matches, const struct device_node *node); |
79 | extern int of_modalias_node(struct device_node *node, char *modalias, int len); | 79 | extern int of_modalias_node(struct device_node *node, char *modalias, int len); |
80 | extern struct device_node *of_parse_phandle(struct device_node *np, | ||
81 | const char *phandle_name, | ||
82 | int index); | ||
80 | extern int of_parse_phandles_with_args(struct device_node *np, | 83 | extern int of_parse_phandles_with_args(struct device_node *np, |
81 | const char *list_name, const char *cells_name, int index, | 84 | const char *list_name, const char *cells_name, int index, |
82 | struct device_node **out_node, const void **out_args); | 85 | struct device_node **out_node, const void **out_args); |
diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h new file mode 100644 index 000000000000..c9663c690303 --- /dev/null +++ b/include/linux/of_mdio.h | |||
@@ -0,0 +1,22 @@ | |||
1 | /* | ||
2 | * OF helpers for the MDIO (Ethernet PHY) API | ||
3 | * | ||
4 | * Copyright (c) 2009 Secret Lab Technologies, Ltd. | ||
5 | * | ||
6 | * This file is released under the GPLv2 | ||
7 | */ | ||
8 | |||
9 | #ifndef __LINUX_OF_MDIO_H | ||
10 | #define __LINUX_OF_MDIO_H | ||
11 | |||
12 | #include <linux/phy.h> | ||
13 | #include <linux/of.h> | ||
14 | |||
15 | extern int of_mdiobus_register(struct mii_bus *mdio, struct device_node *np); | ||
16 | extern struct phy_device *of_phy_find_device(struct device_node *phy_np); | ||
17 | extern struct phy_device *of_phy_connect(struct net_device *dev, | ||
18 | struct device_node *phy_np, | ||
19 | void (*hndlr)(struct net_device *), | ||
20 | u32 flags, phy_interface_t iface); | ||
21 | |||
22 | #endif /* __LINUX_OF_MDIO_H */ | ||
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 62214c7d2d93..e2e5ce543595 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -95,9 +95,7 @@ enum pageflags { | |||
95 | PG_reclaim, /* To be reclaimed asap */ | 95 | PG_reclaim, /* To be reclaimed asap */ |
96 | PG_buddy, /* Page is free, on buddy lists */ | 96 | PG_buddy, /* Page is free, on buddy lists */ |
97 | PG_swapbacked, /* Page is backed by RAM/swap */ | 97 | PG_swapbacked, /* Page is backed by RAM/swap */ |
98 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
99 | PG_unevictable, /* Page is "unevictable" */ | 98 | PG_unevictable, /* Page is "unevictable" */ |
100 | #endif | ||
101 | #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT | 99 | #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT |
102 | PG_mlocked, /* Page is vma mlocked */ | 100 | PG_mlocked, /* Page is vma mlocked */ |
103 | #endif | 101 | #endif |
@@ -120,7 +118,6 @@ enum pageflags { | |||
120 | PG_savepinned = PG_dirty, | 118 | PG_savepinned = PG_dirty, |
121 | 119 | ||
122 | /* SLOB */ | 120 | /* SLOB */ |
123 | PG_slob_page = PG_active, | ||
124 | PG_slob_free = PG_private, | 121 | PG_slob_free = PG_private, |
125 | 122 | ||
126 | /* SLUB */ | 123 | /* SLUB */ |
@@ -203,7 +200,6 @@ PAGEFLAG(SavePinned, savepinned); /* Xen */ | |||
203 | PAGEFLAG(Reserved, reserved) __CLEARPAGEFLAG(Reserved, reserved) | 200 | PAGEFLAG(Reserved, reserved) __CLEARPAGEFLAG(Reserved, reserved) |
204 | PAGEFLAG(SwapBacked, swapbacked) __CLEARPAGEFLAG(SwapBacked, swapbacked) | 201 | PAGEFLAG(SwapBacked, swapbacked) __CLEARPAGEFLAG(SwapBacked, swapbacked) |
205 | 202 | ||
206 | __PAGEFLAG(SlobPage, slob_page) | ||
207 | __PAGEFLAG(SlobFree, slob_free) | 203 | __PAGEFLAG(SlobFree, slob_free) |
208 | 204 | ||
209 | __PAGEFLAG(SlubFrozen, slub_frozen) | 205 | __PAGEFLAG(SlubFrozen, slub_frozen) |
@@ -248,14 +244,8 @@ PAGEFLAG_FALSE(SwapCache) | |||
248 | SETPAGEFLAG_NOOP(SwapCache) CLEARPAGEFLAG_NOOP(SwapCache) | 244 | SETPAGEFLAG_NOOP(SwapCache) CLEARPAGEFLAG_NOOP(SwapCache) |
249 | #endif | 245 | #endif |
250 | 246 | ||
251 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
252 | PAGEFLAG(Unevictable, unevictable) __CLEARPAGEFLAG(Unevictable, unevictable) | 247 | PAGEFLAG(Unevictable, unevictable) __CLEARPAGEFLAG(Unevictable, unevictable) |
253 | TESTCLEARFLAG(Unevictable, unevictable) | 248 | TESTCLEARFLAG(Unevictable, unevictable) |
254 | #else | ||
255 | PAGEFLAG_FALSE(Unevictable) TESTCLEARFLAG_FALSE(Unevictable) | ||
256 | SETPAGEFLAG_NOOP(Unevictable) CLEARPAGEFLAG_NOOP(Unevictable) | ||
257 | __CLEARPAGEFLAG_NOOP(Unevictable) | ||
258 | #endif | ||
259 | 249 | ||
260 | #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT | 250 | #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT |
261 | #define MLOCK_PAGES 1 | 251 | #define MLOCK_PAGES 1 |
@@ -382,12 +372,6 @@ static inline void __ClearPageTail(struct page *page) | |||
382 | 372 | ||
383 | #endif /* !PAGEFLAGS_EXTENDED */ | 373 | #endif /* !PAGEFLAGS_EXTENDED */ |
384 | 374 | ||
385 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
386 | #define __PG_UNEVICTABLE (1 << PG_unevictable) | ||
387 | #else | ||
388 | #define __PG_UNEVICTABLE 0 | ||
389 | #endif | ||
390 | |||
391 | #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT | 375 | #ifdef CONFIG_HAVE_MLOCKED_PAGE_BIT |
392 | #define __PG_MLOCKED (1 << PG_mlocked) | 376 | #define __PG_MLOCKED (1 << PG_mlocked) |
393 | #else | 377 | #else |
@@ -403,7 +387,7 @@ static inline void __ClearPageTail(struct page *page) | |||
403 | 1 << PG_private | 1 << PG_private_2 | \ | 387 | 1 << PG_private | 1 << PG_private_2 | \ |
404 | 1 << PG_buddy | 1 << PG_writeback | 1 << PG_reserved | \ | 388 | 1 << PG_buddy | 1 << PG_writeback | 1 << PG_reserved | \ |
405 | 1 << PG_slab | 1 << PG_swapcache | 1 << PG_active | \ | 389 | 1 << PG_slab | 1 << PG_swapcache | 1 << PG_active | \ |
406 | __PG_UNEVICTABLE | __PG_MLOCKED) | 390 | 1 << PG_unevictable | __PG_MLOCKED) |
407 | 391 | ||
408 | /* | 392 | /* |
409 | * Flags checked when a page is prepped for return by the page allocator. | 393 | * Flags checked when a page is prepped for return by the page allocator. |
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h index 7339c7bf7331..13f126c89ae8 100644 --- a/include/linux/page_cgroup.h +++ b/include/linux/page_cgroup.h | |||
@@ -18,7 +18,19 @@ struct page_cgroup { | |||
18 | }; | 18 | }; |
19 | 19 | ||
20 | void __meminit pgdat_page_cgroup_init(struct pglist_data *pgdat); | 20 | void __meminit pgdat_page_cgroup_init(struct pglist_data *pgdat); |
21 | void __init page_cgroup_init(void); | 21 | |
22 | #ifdef CONFIG_SPARSEMEM | ||
23 | static inline void __init page_cgroup_init_flatmem(void) | ||
24 | { | ||
25 | } | ||
26 | extern void __init page_cgroup_init(void); | ||
27 | #else | ||
28 | void __init page_cgroup_init_flatmem(void); | ||
29 | static inline void __init page_cgroup_init(void) | ||
30 | { | ||
31 | } | ||
32 | #endif | ||
33 | |||
22 | struct page_cgroup *lookup_page_cgroup(struct page *page); | 34 | struct page_cgroup *lookup_page_cgroup(struct page *page); |
23 | 35 | ||
24 | enum { | 36 | enum { |
@@ -87,6 +99,10 @@ static inline void page_cgroup_init(void) | |||
87 | { | 99 | { |
88 | } | 100 | } |
89 | 101 | ||
102 | static inline void __init page_cgroup_init_flatmem(void) | ||
103 | { | ||
104 | } | ||
105 | |||
90 | #endif | 106 | #endif |
91 | 107 | ||
92 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP | 108 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP |
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 34da5230faab..aec3252afcf5 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h | |||
@@ -22,9 +22,7 @@ enum mapping_flags { | |||
22 | AS_EIO = __GFP_BITS_SHIFT + 0, /* IO error on async write */ | 22 | AS_EIO = __GFP_BITS_SHIFT + 0, /* IO error on async write */ |
23 | AS_ENOSPC = __GFP_BITS_SHIFT + 1, /* ENOSPC on async write */ | 23 | AS_ENOSPC = __GFP_BITS_SHIFT + 1, /* ENOSPC on async write */ |
24 | AS_MM_ALL_LOCKS = __GFP_BITS_SHIFT + 2, /* under mm_take_all_locks() */ | 24 | AS_MM_ALL_LOCKS = __GFP_BITS_SHIFT + 2, /* under mm_take_all_locks() */ |
25 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
26 | AS_UNEVICTABLE = __GFP_BITS_SHIFT + 3, /* e.g., ramdisk, SHM_LOCK */ | 25 | AS_UNEVICTABLE = __GFP_BITS_SHIFT + 3, /* e.g., ramdisk, SHM_LOCK */ |
27 | #endif | ||
28 | }; | 26 | }; |
29 | 27 | ||
30 | static inline void mapping_set_error(struct address_space *mapping, int error) | 28 | static inline void mapping_set_error(struct address_space *mapping, int error) |
@@ -37,8 +35,6 @@ static inline void mapping_set_error(struct address_space *mapping, int error) | |||
37 | } | 35 | } |
38 | } | 36 | } |
39 | 37 | ||
40 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
41 | |||
42 | static inline void mapping_set_unevictable(struct address_space *mapping) | 38 | static inline void mapping_set_unevictable(struct address_space *mapping) |
43 | { | 39 | { |
44 | set_bit(AS_UNEVICTABLE, &mapping->flags); | 40 | set_bit(AS_UNEVICTABLE, &mapping->flags); |
@@ -55,14 +51,6 @@ static inline int mapping_unevictable(struct address_space *mapping) | |||
55 | return test_bit(AS_UNEVICTABLE, &mapping->flags); | 51 | return test_bit(AS_UNEVICTABLE, &mapping->flags); |
56 | return !!mapping; | 52 | return !!mapping; |
57 | } | 53 | } |
58 | #else | ||
59 | static inline void mapping_set_unevictable(struct address_space *mapping) { } | ||
60 | static inline void mapping_clear_unevictable(struct address_space *mapping) { } | ||
61 | static inline int mapping_unevictable(struct address_space *mapping) | ||
62 | { | ||
63 | return 0; | ||
64 | } | ||
65 | #endif | ||
66 | 54 | ||
67 | static inline gfp_t mapping_gfp_mask(struct address_space * mapping) | 55 | static inline gfp_t mapping_gfp_mask(struct address_space * mapping) |
68 | { | 56 | { |
diff --git a/include/linux/pci-acpi.h b/include/linux/pci-acpi.h index 092e82e0048c..93a7c08f869d 100644 --- a/include/linux/pci-acpi.h +++ b/include/linux/pci-acpi.h | |||
@@ -15,7 +15,7 @@ static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) | |||
15 | { | 15 | { |
16 | struct pci_bus *pbus = pdev->bus; | 16 | struct pci_bus *pbus = pdev->bus; |
17 | /* Find a PCI root bus */ | 17 | /* Find a PCI root bus */ |
18 | while (pbus->parent) | 18 | while (!pci_is_root_bus(pbus)) |
19 | pbus = pbus->parent; | 19 | pbus = pbus->parent; |
20 | return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus), | 20 | return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus), |
21 | pbus->number); | 21 | pbus->number); |
@@ -23,7 +23,7 @@ static inline acpi_handle acpi_find_root_bridge_handle(struct pci_dev *pdev) | |||
23 | 23 | ||
24 | static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus) | 24 | static inline acpi_handle acpi_pci_get_bridge_handle(struct pci_bus *pbus) |
25 | { | 25 | { |
26 | if (pbus->parent) | 26 | if (!pci_is_root_bus(pbus)) |
27 | return DEVICE_ACPI_HANDLE(&(pbus->self->dev)); | 27 | return DEVICE_ACPI_HANDLE(&(pbus->self->dev)); |
28 | return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus), | 28 | return acpi_get_pci_rootbridge_handle(pci_domain_nr(pbus), |
29 | pbus->number); | 29 | pbus->number); |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 72698d89e767..115fb7ba5089 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -124,6 +124,14 @@ typedef int __bitwise pci_power_t; | |||
124 | #define PCI_UNKNOWN ((pci_power_t __force) 5) | 124 | #define PCI_UNKNOWN ((pci_power_t __force) 5) |
125 | #define PCI_POWER_ERROR ((pci_power_t __force) -1) | 125 | #define PCI_POWER_ERROR ((pci_power_t __force) -1) |
126 | 126 | ||
127 | /* Remember to update this when the list above changes! */ | ||
128 | extern const char *pci_power_names[]; | ||
129 | |||
130 | static inline const char *pci_power_name(pci_power_t state) | ||
131 | { | ||
132 | return pci_power_names[1 + (int) state]; | ||
133 | } | ||
134 | |||
127 | #define PCI_PM_D2_DELAY 200 | 135 | #define PCI_PM_D2_DELAY 200 |
128 | #define PCI_PM_D3_WAIT 10 | 136 | #define PCI_PM_D3_WAIT 10 |
129 | #define PCI_PM_BUS_WAIT 50 | 137 | #define PCI_PM_BUS_WAIT 50 |
@@ -188,6 +196,7 @@ struct pci_cap_saved_state { | |||
188 | struct pcie_link_state; | 196 | struct pcie_link_state; |
189 | struct pci_vpd; | 197 | struct pci_vpd; |
190 | struct pci_sriov; | 198 | struct pci_sriov; |
199 | struct pci_ats; | ||
191 | 200 | ||
192 | /* | 201 | /* |
193 | * The pci_dev structure is used to describe PCI devices. | 202 | * The pci_dev structure is used to describe PCI devices. |
@@ -285,6 +294,7 @@ struct pci_dev { | |||
285 | struct pci_sriov *sriov; /* SR-IOV capability related */ | 294 | struct pci_sriov *sriov; /* SR-IOV capability related */ |
286 | struct pci_dev *physfn; /* the PF this VF is associated with */ | 295 | struct pci_dev *physfn; /* the PF this VF is associated with */ |
287 | }; | 296 | }; |
297 | struct pci_ats *ats; /* Address Translation Service */ | ||
288 | #endif | 298 | #endif |
289 | }; | 299 | }; |
290 | 300 | ||
@@ -599,8 +609,6 @@ extern void pci_sort_breadthfirst(void); | |||
599 | struct pci_dev __deprecated *pci_find_device(unsigned int vendor, | 609 | struct pci_dev __deprecated *pci_find_device(unsigned int vendor, |
600 | unsigned int device, | 610 | unsigned int device, |
601 | struct pci_dev *from); | 611 | struct pci_dev *from); |
602 | struct pci_dev __deprecated *pci_find_slot(unsigned int bus, | ||
603 | unsigned int devfn); | ||
604 | #endif /* CONFIG_PCI_LEGACY */ | 612 | #endif /* CONFIG_PCI_LEGACY */ |
605 | 613 | ||
606 | enum pci_lost_interrupt_reason { | 614 | enum pci_lost_interrupt_reason { |
@@ -639,6 +647,7 @@ int pci_bus_write_config_word(struct pci_bus *bus, unsigned int devfn, | |||
639 | int where, u16 val); | 647 | int where, u16 val); |
640 | int pci_bus_write_config_dword(struct pci_bus *bus, unsigned int devfn, | 648 | int pci_bus_write_config_dword(struct pci_bus *bus, unsigned int devfn, |
641 | int where, u32 val); | 649 | int where, u32 val); |
650 | struct pci_ops *pci_bus_set_ops(struct pci_bus *bus, struct pci_ops *ops); | ||
642 | 651 | ||
643 | static inline int pci_read_config_byte(struct pci_dev *dev, int where, u8 *val) | 652 | static inline int pci_read_config_byte(struct pci_dev *dev, int where, u8 *val) |
644 | { | 653 | { |
@@ -703,8 +712,8 @@ int pcix_get_mmrbc(struct pci_dev *dev); | |||
703 | int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc); | 712 | int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc); |
704 | int pcie_get_readrq(struct pci_dev *dev); | 713 | int pcie_get_readrq(struct pci_dev *dev); |
705 | int pcie_set_readrq(struct pci_dev *dev, int rq); | 714 | int pcie_set_readrq(struct pci_dev *dev, int rq); |
715 | int __pci_reset_function(struct pci_dev *dev); | ||
706 | int pci_reset_function(struct pci_dev *dev); | 716 | int pci_reset_function(struct pci_dev *dev); |
707 | int pci_execute_reset_function(struct pci_dev *dev); | ||
708 | void pci_update_resource(struct pci_dev *dev, int resno); | 717 | void pci_update_resource(struct pci_dev *dev, int resno); |
709 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); | 718 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); |
710 | int pci_select_bars(struct pci_dev *dev, unsigned long flags); | 719 | int pci_select_bars(struct pci_dev *dev, unsigned long flags); |
@@ -724,7 +733,7 @@ int pci_set_power_state(struct pci_dev *dev, pci_power_t state); | |||
724 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); | 733 | pci_power_t pci_choose_state(struct pci_dev *dev, pm_message_t state); |
725 | bool pci_pme_capable(struct pci_dev *dev, pci_power_t state); | 734 | bool pci_pme_capable(struct pci_dev *dev, pci_power_t state); |
726 | void pci_pme_active(struct pci_dev *dev, bool enable); | 735 | void pci_pme_active(struct pci_dev *dev, bool enable); |
727 | int pci_enable_wake(struct pci_dev *dev, pci_power_t state, int enable); | 736 | int pci_enable_wake(struct pci_dev *dev, pci_power_t state, bool enable); |
728 | int pci_wake_from_d3(struct pci_dev *dev, bool enable); | 737 | int pci_wake_from_d3(struct pci_dev *dev, bool enable); |
729 | pci_power_t pci_target_state(struct pci_dev *dev); | 738 | pci_power_t pci_target_state(struct pci_dev *dev); |
730 | int pci_prepare_to_sleep(struct pci_dev *dev); | 739 | int pci_prepare_to_sleep(struct pci_dev *dev); |
@@ -790,7 +799,7 @@ const struct pci_device_id *pci_match_id(const struct pci_device_id *ids, | |||
790 | int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, | 799 | int pci_scan_bridge(struct pci_bus *bus, struct pci_dev *dev, int max, |
791 | int pass); | 800 | int pass); |
792 | 801 | ||
793 | void pci_walk_bus(struct pci_bus *top, void (*cb)(struct pci_dev *, void *), | 802 | void pci_walk_bus(struct pci_bus *top, int (*cb)(struct pci_dev *, void *), |
794 | void *userdata); | 803 | void *userdata); |
795 | int pci_cfg_space_size_ext(struct pci_dev *dev); | 804 | int pci_cfg_space_size_ext(struct pci_dev *dev); |
796 | int pci_cfg_space_size(struct pci_dev *dev); | 805 | int pci_cfg_space_size(struct pci_dev *dev); |
@@ -880,6 +889,17 @@ static inline int pcie_aspm_enabled(void) | |||
880 | extern int pcie_aspm_enabled(void); | 889 | extern int pcie_aspm_enabled(void); |
881 | #endif | 890 | #endif |
882 | 891 | ||
892 | #ifndef CONFIG_PCIE_ECRC | ||
893 | static inline void pcie_set_ecrc_checking(struct pci_dev *dev) | ||
894 | { | ||
895 | return; | ||
896 | } | ||
897 | static inline void pcie_ecrc_get_policy(char *str) {}; | ||
898 | #else | ||
899 | extern void pcie_set_ecrc_checking(struct pci_dev *dev); | ||
900 | extern void pcie_ecrc_get_policy(char *str); | ||
901 | #endif | ||
902 | |||
883 | #define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) | 903 | #define pci_enable_msi(pdev) pci_enable_msi_block(pdev, 1) |
884 | 904 | ||
885 | #ifdef CONFIG_HT_IRQ | 905 | #ifdef CONFIG_HT_IRQ |
@@ -936,12 +956,6 @@ static inline struct pci_dev *pci_find_device(unsigned int vendor, | |||
936 | return NULL; | 956 | return NULL; |
937 | } | 957 | } |
938 | 958 | ||
939 | static inline struct pci_dev *pci_find_slot(unsigned int bus, | ||
940 | unsigned int devfn) | ||
941 | { | ||
942 | return NULL; | ||
943 | } | ||
944 | |||
945 | static inline struct pci_dev *pci_get_device(unsigned int vendor, | 959 | static inline struct pci_dev *pci_get_device(unsigned int vendor, |
946 | unsigned int device, | 960 | unsigned int device, |
947 | struct pci_dev *from) | 961 | struct pci_dev *from) |
@@ -1097,6 +1111,10 @@ static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, | |||
1097 | 1111 | ||
1098 | #include <asm/pci.h> | 1112 | #include <asm/pci.h> |
1099 | 1113 | ||
1114 | #ifndef PCIBIOS_MAX_MEM_32 | ||
1115 | #define PCIBIOS_MAX_MEM_32 (-1) | ||
1116 | #endif | ||
1117 | |||
1100 | /* these helpers provide future and backwards compatibility | 1118 | /* these helpers provide future and backwards compatibility |
1101 | * for accessing popular PCI BAR info */ | 1119 | * for accessing popular PCI BAR info */ |
1102 | #define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start) | 1120 | #define pci_resource_start(dev, bar) ((dev)->resource[(bar)].start) |
@@ -1127,7 +1145,7 @@ static inline void pci_set_drvdata(struct pci_dev *pdev, void *data) | |||
1127 | /* If you want to know what to call your pci_dev, ask this function. | 1145 | /* If you want to know what to call your pci_dev, ask this function. |
1128 | * Again, it's a wrapper around the generic device. | 1146 | * Again, it's a wrapper around the generic device. |
1129 | */ | 1147 | */ |
1130 | static inline const char *pci_name(struct pci_dev *pdev) | 1148 | static inline const char *pci_name(const struct pci_dev *pdev) |
1131 | { | 1149 | { |
1132 | return dev_name(&pdev->dev); | 1150 | return dev_name(&pdev->dev); |
1133 | } | 1151 | } |
@@ -1253,5 +1271,10 @@ static inline irqreturn_t pci_sriov_migration(struct pci_dev *dev) | |||
1253 | } | 1271 | } |
1254 | #endif | 1272 | #endif |
1255 | 1273 | ||
1274 | #if defined(CONFIG_HOTPLUG_PCI) || defined(CONFIG_HOTPLUG_PCI_MODULE) | ||
1275 | extern void pci_hp_create_module_link(struct pci_slot *pci_slot); | ||
1276 | extern void pci_hp_remove_module_link(struct pci_slot *pci_slot); | ||
1277 | #endif | ||
1278 | |||
1256 | #endif /* __KERNEL__ */ | 1279 | #endif /* __KERNEL__ */ |
1257 | #endif /* LINUX_PCI_H */ | 1280 | #endif /* LINUX_PCI_H */ |
diff --git a/include/linux/pci_hotplug.h b/include/linux/pci_hotplug.h index 20998746518e..4391741b99dc 100644 --- a/include/linux/pci_hotplug.h +++ b/include/linux/pci_hotplug.h | |||
@@ -66,17 +66,10 @@ enum pcie_link_speed { | |||
66 | PCIE_LNK_SPEED_UNKNOWN = 0xFF, | 66 | PCIE_LNK_SPEED_UNKNOWN = 0xFF, |
67 | }; | 67 | }; |
68 | 68 | ||
69 | struct hotplug_slot; | ||
70 | struct hotplug_slot_attribute { | ||
71 | struct attribute attr; | ||
72 | ssize_t (*show)(struct hotplug_slot *, char *); | ||
73 | ssize_t (*store)(struct hotplug_slot *, const char *, size_t); | ||
74 | }; | ||
75 | #define to_hotplug_attr(n) container_of(n, struct hotplug_slot_attribute, attr); | ||
76 | |||
77 | /** | 69 | /** |
78 | * struct hotplug_slot_ops -the callbacks that the hotplug pci core can use | 70 | * struct hotplug_slot_ops -the callbacks that the hotplug pci core can use |
79 | * @owner: The module owner of this structure | 71 | * @owner: The module owner of this structure |
72 | * @mod_name: The module name (KBUILD_MODNAME) of this structure | ||
80 | * @enable_slot: Called when the user wants to enable a specific pci slot | 73 | * @enable_slot: Called when the user wants to enable a specific pci slot |
81 | * @disable_slot: Called when the user wants to disable a specific pci slot | 74 | * @disable_slot: Called when the user wants to disable a specific pci slot |
82 | * @set_attention_status: Called to set the specific slot's attention LED to | 75 | * @set_attention_status: Called to set the specific slot's attention LED to |
@@ -109,6 +102,7 @@ struct hotplug_slot_attribute { | |||
109 | */ | 102 | */ |
110 | struct hotplug_slot_ops { | 103 | struct hotplug_slot_ops { |
111 | struct module *owner; | 104 | struct module *owner; |
105 | const char *mod_name; | ||
112 | int (*enable_slot) (struct hotplug_slot *slot); | 106 | int (*enable_slot) (struct hotplug_slot *slot); |
113 | int (*disable_slot) (struct hotplug_slot *slot); | 107 | int (*disable_slot) (struct hotplug_slot *slot); |
114 | int (*set_attention_status) (struct hotplug_slot *slot, u8 value); | 108 | int (*set_attention_status) (struct hotplug_slot *slot, u8 value); |
@@ -167,12 +161,21 @@ static inline const char *hotplug_slot_name(const struct hotplug_slot *slot) | |||
167 | return pci_slot_name(slot->pci_slot); | 161 | return pci_slot_name(slot->pci_slot); |
168 | } | 162 | } |
169 | 163 | ||
170 | extern int pci_hp_register(struct hotplug_slot *, struct pci_bus *, int nr, | 164 | extern int __pci_hp_register(struct hotplug_slot *slot, struct pci_bus *pbus, |
171 | const char *name); | 165 | int nr, const char *name, |
166 | struct module *owner, const char *mod_name); | ||
172 | extern int pci_hp_deregister(struct hotplug_slot *slot); | 167 | extern int pci_hp_deregister(struct hotplug_slot *slot); |
173 | extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot, | 168 | extern int __must_check pci_hp_change_slot_info (struct hotplug_slot *slot, |
174 | struct hotplug_slot_info *info); | 169 | struct hotplug_slot_info *info); |
175 | 170 | ||
171 | static inline int pci_hp_register(struct hotplug_slot *slot, | ||
172 | struct pci_bus *pbus, | ||
173 | int devnr, const char *name) | ||
174 | { | ||
175 | return __pci_hp_register(slot, pbus, devnr, name, | ||
176 | THIS_MODULE, KBUILD_MODNAME); | ||
177 | } | ||
178 | |||
176 | /* PCI Setting Record (Type 0) */ | 179 | /* PCI Setting Record (Type 0) */ |
177 | struct hpp_type0 { | 180 | struct hpp_type0 { |
178 | u32 revision; | 181 | u32 revision; |
@@ -226,7 +229,6 @@ struct hotplug_params { | |||
226 | extern acpi_status acpi_get_hp_params_from_firmware(struct pci_bus *bus, | 229 | extern acpi_status acpi_get_hp_params_from_firmware(struct pci_bus *bus, |
227 | struct hotplug_params *hpp); | 230 | struct hotplug_params *hpp); |
228 | int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags); | 231 | int acpi_get_hp_hw_control_from_firmware(struct pci_dev *dev, u32 flags); |
229 | int acpi_root_bridge(acpi_handle handle); | ||
230 | int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle); | 232 | int acpi_pci_check_ejectable(struct pci_bus *pbus, acpi_handle handle); |
231 | int acpi_pci_detect_ejectable(struct pci_bus *pbus); | 233 | int acpi_pci_detect_ejectable(struct pci_bus *pbus); |
232 | #endif | 234 | #endif |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index d7d1c41a0b17..73b46b6b904f 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -104,6 +104,7 @@ | |||
104 | #define PCI_CLASS_SERIAL_USB_UHCI 0x0c0300 | 104 | #define PCI_CLASS_SERIAL_USB_UHCI 0x0c0300 |
105 | #define PCI_CLASS_SERIAL_USB_OHCI 0x0c0310 | 105 | #define PCI_CLASS_SERIAL_USB_OHCI 0x0c0310 |
106 | #define PCI_CLASS_SERIAL_USB_EHCI 0x0c0320 | 106 | #define PCI_CLASS_SERIAL_USB_EHCI 0x0c0320 |
107 | #define PCI_CLASS_SERIAL_USB_XHCI 0x0c0330 | ||
107 | #define PCI_CLASS_SERIAL_FIBER 0x0c04 | 108 | #define PCI_CLASS_SERIAL_FIBER 0x0c04 |
108 | #define PCI_CLASS_SERIAL_SMBUS 0x0c05 | 109 | #define PCI_CLASS_SERIAL_SMBUS 0x0c05 |
109 | 110 | ||
@@ -1005,6 +1006,7 @@ | |||
1005 | #define PCI_DEVICE_ID_PLX_PCI200SYN 0x3196 | 1006 | #define PCI_DEVICE_ID_PLX_PCI200SYN 0x3196 |
1006 | #define PCI_DEVICE_ID_PLX_9030 0x9030 | 1007 | #define PCI_DEVICE_ID_PLX_9030 0x9030 |
1007 | #define PCI_DEVICE_ID_PLX_9050 0x9050 | 1008 | #define PCI_DEVICE_ID_PLX_9050 0x9050 |
1009 | #define PCI_DEVICE_ID_PLX_9056 0x9056 | ||
1008 | #define PCI_DEVICE_ID_PLX_9080 0x9080 | 1010 | #define PCI_DEVICE_ID_PLX_9080 0x9080 |
1009 | #define PCI_DEVICE_ID_PLX_GTEK_SERIAL2 0xa001 | 1011 | #define PCI_DEVICE_ID_PLX_GTEK_SERIAL2 0xa001 |
1010 | 1012 | ||
@@ -1066,8 +1068,6 @@ | |||
1066 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SMBUS 0x0034 | 1068 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SMBUS 0x0034 |
1067 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE 0x0035 | 1069 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_IDE 0x0035 |
1068 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA 0x0036 | 1070 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA 0x0036 |
1069 | #define PCI_DEVICE_ID_NVIDIA_NVENET_10 0x0037 | ||
1070 | #define PCI_DEVICE_ID_NVIDIA_NVENET_11 0x0038 | ||
1071 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA2 0x003e | 1071 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP04_SATA2 0x003e |
1072 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE_6800_ULTRA 0x0040 | 1072 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE_6800_ULTRA 0x0040 |
1073 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE_6800 0x0041 | 1073 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE_6800 0x0041 |
@@ -1078,21 +1078,16 @@ | |||
1078 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE 0x0053 | 1078 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_IDE 0x0053 |
1079 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA 0x0054 | 1079 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA 0x0054 |
1080 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA2 0x0055 | 1080 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_CK804_SATA2 0x0055 |
1081 | #define PCI_DEVICE_ID_NVIDIA_NVENET_8 0x0056 | ||
1082 | #define PCI_DEVICE_ID_NVIDIA_NVENET_9 0x0057 | ||
1083 | #define PCI_DEVICE_ID_NVIDIA_CK804_AUDIO 0x0059 | 1081 | #define PCI_DEVICE_ID_NVIDIA_CK804_AUDIO 0x0059 |
1084 | #define PCI_DEVICE_ID_NVIDIA_CK804_PCIE 0x005d | 1082 | #define PCI_DEVICE_ID_NVIDIA_CK804_PCIE 0x005d |
1085 | #define PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS 0x0064 | 1083 | #define PCI_DEVICE_ID_NVIDIA_NFORCE2_SMBUS 0x0064 |
1086 | #define PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE 0x0065 | 1084 | #define PCI_DEVICE_ID_NVIDIA_NFORCE2_IDE 0x0065 |
1087 | #define PCI_DEVICE_ID_NVIDIA_NVENET_2 0x0066 | ||
1088 | #define PCI_DEVICE_ID_NVIDIA_MCP2_MODEM 0x0069 | 1085 | #define PCI_DEVICE_ID_NVIDIA_MCP2_MODEM 0x0069 |
1089 | #define PCI_DEVICE_ID_NVIDIA_MCP2_AUDIO 0x006a | 1086 | #define PCI_DEVICE_ID_NVIDIA_MCP2_AUDIO 0x006a |
1090 | #define PCI_DEVICE_ID_NVIDIA_NFORCE2S_SMBUS 0x0084 | 1087 | #define PCI_DEVICE_ID_NVIDIA_NFORCE2S_SMBUS 0x0084 |
1091 | #define PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE 0x0085 | 1088 | #define PCI_DEVICE_ID_NVIDIA_NFORCE2S_IDE 0x0085 |
1092 | #define PCI_DEVICE_ID_NVIDIA_NVENET_4 0x0086 | ||
1093 | #define PCI_DEVICE_ID_NVIDIA_MCP2S_MODEM 0x0089 | 1089 | #define PCI_DEVICE_ID_NVIDIA_MCP2S_MODEM 0x0089 |
1094 | #define PCI_DEVICE_ID_NVIDIA_CK8_AUDIO 0x008a | 1090 | #define PCI_DEVICE_ID_NVIDIA_CK8_AUDIO 0x008a |
1095 | #define PCI_DEVICE_ID_NVIDIA_NVENET_5 0x008c | ||
1096 | #define PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA 0x008e | 1091 | #define PCI_DEVICE_ID_NVIDIA_NFORCE2S_SATA 0x008e |
1097 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE_7800_GT 0x0090 | 1092 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE_7800_GT 0x0090 |
1098 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE_7800_GTX 0x0091 | 1093 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE_7800_GTX 0x0091 |
@@ -1108,15 +1103,12 @@ | |||
1108 | #define PCI_DEVICE_ID_NVIDIA_NFORCE3 0x00d1 | 1103 | #define PCI_DEVICE_ID_NVIDIA_NFORCE3 0x00d1 |
1109 | #define PCI_DEVICE_ID_NVIDIA_NFORCE3_SMBUS 0x00d4 | 1104 | #define PCI_DEVICE_ID_NVIDIA_NFORCE3_SMBUS 0x00d4 |
1110 | #define PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE 0x00d5 | 1105 | #define PCI_DEVICE_ID_NVIDIA_NFORCE3_IDE 0x00d5 |
1111 | #define PCI_DEVICE_ID_NVIDIA_NVENET_3 0x00d6 | ||
1112 | #define PCI_DEVICE_ID_NVIDIA_MCP3_MODEM 0x00d9 | 1106 | #define PCI_DEVICE_ID_NVIDIA_MCP3_MODEM 0x00d9 |
1113 | #define PCI_DEVICE_ID_NVIDIA_MCP3_AUDIO 0x00da | 1107 | #define PCI_DEVICE_ID_NVIDIA_MCP3_AUDIO 0x00da |
1114 | #define PCI_DEVICE_ID_NVIDIA_NVENET_7 0x00df | ||
1115 | #define PCI_DEVICE_ID_NVIDIA_NFORCE3S 0x00e1 | 1108 | #define PCI_DEVICE_ID_NVIDIA_NFORCE3S 0x00e1 |
1116 | #define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA 0x00e3 | 1109 | #define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA 0x00e3 |
1117 | #define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SMBUS 0x00e4 | 1110 | #define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SMBUS 0x00e4 |
1118 | #define PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE 0x00e5 | 1111 | #define PCI_DEVICE_ID_NVIDIA_NFORCE3S_IDE 0x00e5 |
1119 | #define PCI_DEVICE_ID_NVIDIA_NVENET_6 0x00e6 | ||
1120 | #define PCI_DEVICE_ID_NVIDIA_CK8S_AUDIO 0x00ea | 1112 | #define PCI_DEVICE_ID_NVIDIA_CK8S_AUDIO 0x00ea |
1121 | #define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2 0x00ee | 1113 | #define PCI_DEVICE_ID_NVIDIA_NFORCE3S_SATA2 0x00ee |
1122 | #define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6800_ALT1 0x00f0 | 1114 | #define PCIE_DEVICE_ID_NVIDIA_GEFORCE_6800_ALT1 0x00f0 |
@@ -1176,7 +1168,6 @@ | |||
1176 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_SMBUS 0x01b4 | 1168 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_SMBUS 0x01b4 |
1177 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_IDE 0x01bc | 1169 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_IDE 0x01bc |
1178 | #define PCI_DEVICE_ID_NVIDIA_MCP1_MODEM 0x01c1 | 1170 | #define PCI_DEVICE_ID_NVIDIA_MCP1_MODEM 0x01c1 |
1179 | #define PCI_DEVICE_ID_NVIDIA_NVENET_1 0x01c3 | ||
1180 | #define PCI_DEVICE_ID_NVIDIA_NFORCE2 0x01e0 | 1171 | #define PCI_DEVICE_ID_NVIDIA_NFORCE2 0x01e0 |
1181 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE3 0x0200 | 1172 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE3 0x0200 |
1182 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE3_1 0x0201 | 1173 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE3_1 0x0201 |
@@ -1199,8 +1190,6 @@ | |||
1199 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E | 1190 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_IDE 0x036E |
1200 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA 0x037E | 1191 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA 0x037E |
1201 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2 0x037F | 1192 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP55_SATA2 0x037F |
1202 | #define PCI_DEVICE_ID_NVIDIA_NVENET_12 0x0268 | ||
1203 | #define PCI_DEVICE_ID_NVIDIA_NVENET_13 0x0269 | ||
1204 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800 0x0280 | 1193 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800 0x0280 |
1205 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800_8X 0x0281 | 1194 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800_8X 0x0281 |
1206 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800SE 0x0282 | 1195 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE4_TI_4800SE 0x0282 |
@@ -1247,46 +1236,21 @@ | |||
1247 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5700_2 0x0348 | 1236 | #define PCI_DEVICE_ID_NVIDIA_GEFORCE_FX_GO5700_2 0x0348 |
1248 | #define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_GO1000 0x034C | 1237 | #define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_GO1000 0x034C |
1249 | #define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_1100 0x034E | 1238 | #define PCI_DEVICE_ID_NVIDIA_QUADRO_FX_1100 0x034E |
1250 | #define PCI_DEVICE_ID_NVIDIA_NVENET_14 0x0372 | ||
1251 | #define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373 | 1239 | #define PCI_DEVICE_ID_NVIDIA_NVENET_15 0x0373 |
1252 | #define PCI_DEVICE_ID_NVIDIA_NVENET_16 0x03E5 | ||
1253 | #define PCI_DEVICE_ID_NVIDIA_NVENET_17 0x03E6 | ||
1254 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA 0x03E7 | 1240 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA 0x03E7 |
1255 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SMBUS 0x03EB | 1241 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SMBUS 0x03EB |
1256 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE 0x03EC | 1242 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_IDE 0x03EC |
1257 | #define PCI_DEVICE_ID_NVIDIA_NVENET_18 0x03EE | ||
1258 | #define PCI_DEVICE_ID_NVIDIA_NVENET_19 0x03EF | ||
1259 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2 0x03F6 | 1243 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA2 0x03F6 |
1260 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3 0x03F7 | 1244 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP61_SATA3 0x03F7 |
1261 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_SMBUS 0x0446 | 1245 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_SMBUS 0x0446 |
1262 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE 0x0448 | 1246 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP65_IDE 0x0448 |
1263 | #define PCI_DEVICE_ID_NVIDIA_NVENET_20 0x0450 | ||
1264 | #define PCI_DEVICE_ID_NVIDIA_NVENET_21 0x0451 | ||
1265 | #define PCI_DEVICE_ID_NVIDIA_NVENET_22 0x0452 | ||
1266 | #define PCI_DEVICE_ID_NVIDIA_NVENET_23 0x0453 | ||
1267 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_SMBUS 0x0542 | 1247 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_SMBUS 0x0542 |
1268 | #define PCI_DEVICE_ID_NVIDIA_NVENET_24 0x054C | ||
1269 | #define PCI_DEVICE_ID_NVIDIA_NVENET_25 0x054D | ||
1270 | #define PCI_DEVICE_ID_NVIDIA_NVENET_26 0x054E | ||
1271 | #define PCI_DEVICE_ID_NVIDIA_NVENET_27 0x054F | ||
1272 | #define PCI_DEVICE_ID_NVIDIA_NVENET_28 0x07DC | ||
1273 | #define PCI_DEVICE_ID_NVIDIA_NVENET_29 0x07DD | ||
1274 | #define PCI_DEVICE_ID_NVIDIA_NVENET_30 0x07DE | ||
1275 | #define PCI_DEVICE_ID_NVIDIA_NVENET_31 0x07DF | ||
1276 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE 0x0560 | 1248 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP67_IDE 0x0560 |
1277 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE 0x056C | 1249 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_IDE 0x056C |
1278 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP78S_SMBUS 0x0752 | 1250 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP78S_SMBUS 0x0752 |
1279 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE 0x0759 | 1251 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP77_IDE 0x0759 |
1280 | #define PCI_DEVICE_ID_NVIDIA_NVENET_32 0x0760 | ||
1281 | #define PCI_DEVICE_ID_NVIDIA_NVENET_33 0x0761 | ||
1282 | #define PCI_DEVICE_ID_NVIDIA_NVENET_34 0x0762 | ||
1283 | #define PCI_DEVICE_ID_NVIDIA_NVENET_35 0x0763 | ||
1284 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_SMBUS 0x07D8 | 1252 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP73_SMBUS 0x07D8 |
1285 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP79_SMBUS 0x0AA2 | 1253 | #define PCI_DEVICE_ID_NVIDIA_NFORCE_MCP79_SMBUS 0x0AA2 |
1286 | #define PCI_DEVICE_ID_NVIDIA_NVENET_36 0x0AB0 | ||
1287 | #define PCI_DEVICE_ID_NVIDIA_NVENET_37 0x0AB1 | ||
1288 | #define PCI_DEVICE_ID_NVIDIA_NVENET_38 0x0AB2 | ||
1289 | #define PCI_DEVICE_ID_NVIDIA_NVENET_39 0x0AB3 | ||
1290 | 1254 | ||
1291 | #define PCI_VENDOR_ID_IMS 0x10e0 | 1255 | #define PCI_VENDOR_ID_IMS 0x10e0 |
1292 | #define PCI_DEVICE_ID_IMS_TT128 0x9128 | 1256 | #define PCI_DEVICE_ID_IMS_TT128 0x9128 |
@@ -1314,6 +1278,13 @@ | |||
1314 | 1278 | ||
1315 | #define PCI_VENDOR_ID_CREATIVE 0x1102 /* duplicate: ECTIVA */ | 1279 | #define PCI_VENDOR_ID_CREATIVE 0x1102 /* duplicate: ECTIVA */ |
1316 | #define PCI_DEVICE_ID_CREATIVE_EMU10K1 0x0002 | 1280 | #define PCI_DEVICE_ID_CREATIVE_EMU10K1 0x0002 |
1281 | #define PCI_DEVICE_ID_CREATIVE_20K1 0x0005 | ||
1282 | #define PCI_DEVICE_ID_CREATIVE_20K2 0x000b | ||
1283 | #define PCI_SUBDEVICE_ID_CREATIVE_SB0760 0x0024 | ||
1284 | #define PCI_SUBDEVICE_ID_CREATIVE_SB08801 0x0041 | ||
1285 | #define PCI_SUBDEVICE_ID_CREATIVE_SB08802 0x0042 | ||
1286 | #define PCI_SUBDEVICE_ID_CREATIVE_SB08803 0x0043 | ||
1287 | #define PCI_SUBDEVICE_ID_CREATIVE_HENDRIX 0x6000 | ||
1317 | 1288 | ||
1318 | #define PCI_VENDOR_ID_ECTIVA 0x1102 /* duplicate: CREATIVE */ | 1289 | #define PCI_VENDOR_ID_ECTIVA 0x1102 /* duplicate: CREATIVE */ |
1319 | #define PCI_DEVICE_ID_ECTIVA_EV1938 0x8938 | 1290 | #define PCI_DEVICE_ID_ECTIVA_EV1938 0x8938 |
@@ -1847,6 +1818,10 @@ | |||
1847 | #define PCI_SUBDEVICE_ID_HYPERCOPE_METRO 0x0107 | 1818 | #define PCI_SUBDEVICE_ID_HYPERCOPE_METRO 0x0107 |
1848 | #define PCI_SUBDEVICE_ID_HYPERCOPE_CHAMP2 0x0108 | 1819 | #define PCI_SUBDEVICE_ID_HYPERCOPE_CHAMP2 0x0108 |
1849 | 1820 | ||
1821 | #define PCI_VENDOR_ID_DIGIGRAM 0x1369 | ||
1822 | #define PCI_SUBDEVICE_ID_DIGIGRAM_LX6464ES_SERIAL_SUBSYSTEM 0xc001 | ||
1823 | #define PCI_SUBDEVICE_ID_DIGIGRAM_LX6464ES_CAE_SERIAL_SUBSYSTEM 0xc002 | ||
1824 | |||
1850 | #define PCI_VENDOR_ID_KAWASAKI 0x136b | 1825 | #define PCI_VENDOR_ID_KAWASAKI 0x136b |
1851 | #define PCI_DEVICE_ID_MCHIP_KL5A72002 0xff01 | 1826 | #define PCI_DEVICE_ID_MCHIP_KL5A72002 0xff01 |
1852 | 1827 | ||
@@ -1914,6 +1889,8 @@ | |||
1914 | #define PCI_SUBDEVICE_ID_CCD_SWYX4S 0xB540 | 1889 | #define PCI_SUBDEVICE_ID_CCD_SWYX4S 0xB540 |
1915 | #define PCI_SUBDEVICE_ID_CCD_JH4S20 0xB550 | 1890 | #define PCI_SUBDEVICE_ID_CCD_JH4S20 0xB550 |
1916 | #define PCI_SUBDEVICE_ID_CCD_IOB8ST_1 0xB552 | 1891 | #define PCI_SUBDEVICE_ID_CCD_IOB8ST_1 0xB552 |
1892 | #define PCI_SUBDEVICE_ID_CCD_JHSE1 0xB553 | ||
1893 | #define PCI_SUBDEVICE_ID_CCD_JH8S 0xB55B | ||
1917 | #define PCI_SUBDEVICE_ID_CCD_BN4S 0xB560 | 1894 | #define PCI_SUBDEVICE_ID_CCD_BN4S 0xB560 |
1918 | #define PCI_SUBDEVICE_ID_CCD_BN8S 0xB562 | 1895 | #define PCI_SUBDEVICE_ID_CCD_BN8S 0xB562 |
1919 | #define PCI_SUBDEVICE_ID_CCD_BNE1 0xB563 | 1896 | #define PCI_SUBDEVICE_ID_CCD_BNE1 0xB563 |
@@ -2115,6 +2092,7 @@ | |||
2115 | #define PCI_VENDOR_ID_MAINPINE 0x1522 | 2092 | #define PCI_VENDOR_ID_MAINPINE 0x1522 |
2116 | #define PCI_DEVICE_ID_MAINPINE_PBRIDGE 0x0100 | 2093 | #define PCI_DEVICE_ID_MAINPINE_PBRIDGE 0x0100 |
2117 | #define PCI_VENDOR_ID_ENE 0x1524 | 2094 | #define PCI_VENDOR_ID_ENE 0x1524 |
2095 | #define PCI_DEVICE_ID_ENE_CB710_FLASH 0x0510 | ||
2118 | #define PCI_DEVICE_ID_ENE_CB712_SD 0x0550 | 2096 | #define PCI_DEVICE_ID_ENE_CB712_SD 0x0550 |
2119 | #define PCI_DEVICE_ID_ENE_CB712_SD_2 0x0551 | 2097 | #define PCI_DEVICE_ID_ENE_CB712_SD_2 0x0551 |
2120 | #define PCI_DEVICE_ID_ENE_CB714_SD 0x0750 | 2098 | #define PCI_DEVICE_ID_ENE_CB714_SD 0x0750 |
@@ -2276,6 +2254,8 @@ | |||
2276 | #define PCI_DEVICE_ID_MPC8547E 0x0018 | 2254 | #define PCI_DEVICE_ID_MPC8547E 0x0018 |
2277 | #define PCI_DEVICE_ID_MPC8545E 0x0019 | 2255 | #define PCI_DEVICE_ID_MPC8545E 0x0019 |
2278 | #define PCI_DEVICE_ID_MPC8545 0x001a | 2256 | #define PCI_DEVICE_ID_MPC8545 0x001a |
2257 | #define PCI_DEVICE_ID_MPC8569E 0x0061 | ||
2258 | #define PCI_DEVICE_ID_MPC8569 0x0060 | ||
2279 | #define PCI_DEVICE_ID_MPC8568E 0x0020 | 2259 | #define PCI_DEVICE_ID_MPC8568E 0x0020 |
2280 | #define PCI_DEVICE_ID_MPC8568 0x0021 | 2260 | #define PCI_DEVICE_ID_MPC8568 0x0021 |
2281 | #define PCI_DEVICE_ID_MPC8567E 0x0022 | 2261 | #define PCI_DEVICE_ID_MPC8567E 0x0022 |
@@ -2288,6 +2268,8 @@ | |||
2288 | #define PCI_DEVICE_ID_MPC8572 0x0041 | 2268 | #define PCI_DEVICE_ID_MPC8572 0x0041 |
2289 | #define PCI_DEVICE_ID_MPC8536E 0x0050 | 2269 | #define PCI_DEVICE_ID_MPC8536E 0x0050 |
2290 | #define PCI_DEVICE_ID_MPC8536 0x0051 | 2270 | #define PCI_DEVICE_ID_MPC8536 0x0051 |
2271 | #define PCI_DEVICE_ID_P2020E 0x0070 | ||
2272 | #define PCI_DEVICE_ID_P2020 0x0071 | ||
2291 | #define PCI_DEVICE_ID_MPC8641 0x7010 | 2273 | #define PCI_DEVICE_ID_MPC8641 0x7010 |
2292 | #define PCI_DEVICE_ID_MPC8641D 0x7011 | 2274 | #define PCI_DEVICE_ID_MPC8641D 0x7011 |
2293 | #define PCI_DEVICE_ID_MPC8610 0x7018 | 2275 | #define PCI_DEVICE_ID_MPC8610 0x7018 |
@@ -2315,6 +2297,8 @@ | |||
2315 | 2297 | ||
2316 | #define PCI_VENDOR_ID_QMI 0x1a32 | 2298 | #define PCI_VENDOR_ID_QMI 0x1a32 |
2317 | 2299 | ||
2300 | #define PCI_VENDOR_ID_AZWAVE 0x1a3b | ||
2301 | |||
2318 | #define PCI_VENDOR_ID_TEKRAM 0x1de1 | 2302 | #define PCI_VENDOR_ID_TEKRAM 0x1de1 |
2319 | #define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29 | 2303 | #define PCI_DEVICE_ID_TEKRAM_DC290 0xdc29 |
2320 | 2304 | ||
@@ -2661,6 +2645,7 @@ | |||
2661 | #define PCI_DEVICE_ID_NETMOS_9835 0x9835 | 2645 | #define PCI_DEVICE_ID_NETMOS_9835 0x9835 |
2662 | #define PCI_DEVICE_ID_NETMOS_9845 0x9845 | 2646 | #define PCI_DEVICE_ID_NETMOS_9845 0x9845 |
2663 | #define PCI_DEVICE_ID_NETMOS_9855 0x9855 | 2647 | #define PCI_DEVICE_ID_NETMOS_9855 0x9855 |
2648 | #define PCI_DEVICE_ID_NETMOS_9901 0x9901 | ||
2664 | 2649 | ||
2665 | #define PCI_VENDOR_ID_3COM_2 0xa727 | 2650 | #define PCI_VENDOR_ID_3COM_2 0xa727 |
2666 | 2651 | ||
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index 616bf8b3c8b5..fcaee42c7ac2 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
@@ -295,8 +295,9 @@ | |||
295 | #define PCI_MSI_ADDRESS_LO 4 /* Lower 32 bits */ | 295 | #define PCI_MSI_ADDRESS_LO 4 /* Lower 32 bits */ |
296 | #define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */ | 296 | #define PCI_MSI_ADDRESS_HI 8 /* Upper 32 bits (if PCI_MSI_FLAGS_64BIT set) */ |
297 | #define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */ | 297 | #define PCI_MSI_DATA_32 8 /* 16 bits of data for 32-bit devices */ |
298 | #define PCI_MSI_MASK_32 12 /* Mask bits register for 32-bit devices */ | ||
298 | #define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ | 299 | #define PCI_MSI_DATA_64 12 /* 16 bits of data for 64-bit devices */ |
299 | #define PCI_MSI_MASK_BIT 16 /* Mask bits register */ | 300 | #define PCI_MSI_MASK_64 16 /* Mask bits register for 64-bit devices */ |
300 | 301 | ||
301 | /* MSI-X registers (these are at offset PCI_MSIX_FLAGS) */ | 302 | /* MSI-X registers (these are at offset PCI_MSIX_FLAGS) */ |
302 | #define PCI_MSIX_FLAGS 2 | 303 | #define PCI_MSIX_FLAGS 2 |
@@ -304,7 +305,6 @@ | |||
304 | #define PCI_MSIX_FLAGS_ENABLE (1 << 15) | 305 | #define PCI_MSIX_FLAGS_ENABLE (1 << 15) |
305 | #define PCI_MSIX_FLAGS_MASKALL (1 << 14) | 306 | #define PCI_MSIX_FLAGS_MASKALL (1 << 14) |
306 | #define PCI_MSIX_FLAGS_BIRMASK (7 << 0) | 307 | #define PCI_MSIX_FLAGS_BIRMASK (7 << 0) |
307 | #define PCI_MSIX_FLAGS_BITMASK (1 << 0) | ||
308 | 308 | ||
309 | /* CompactPCI Hotswap Register */ | 309 | /* CompactPCI Hotswap Register */ |
310 | 310 | ||
@@ -502,6 +502,7 @@ | |||
502 | #define PCI_EXT_CAP_ID_DSN 3 | 502 | #define PCI_EXT_CAP_ID_DSN 3 |
503 | #define PCI_EXT_CAP_ID_PWR 4 | 503 | #define PCI_EXT_CAP_ID_PWR 4 |
504 | #define PCI_EXT_CAP_ID_ARI 14 | 504 | #define PCI_EXT_CAP_ID_ARI 14 |
505 | #define PCI_EXT_CAP_ID_ATS 15 | ||
505 | #define PCI_EXT_CAP_ID_SRIOV 16 | 506 | #define PCI_EXT_CAP_ID_SRIOV 16 |
506 | 507 | ||
507 | /* Advanced Error Reporting */ | 508 | /* Advanced Error Reporting */ |
@@ -620,6 +621,15 @@ | |||
620 | #define PCI_ARI_CTRL_ACS 0x0002 /* ACS Function Groups Enable */ | 621 | #define PCI_ARI_CTRL_ACS 0x0002 /* ACS Function Groups Enable */ |
621 | #define PCI_ARI_CTRL_FG(x) (((x) >> 4) & 7) /* Function Group */ | 622 | #define PCI_ARI_CTRL_FG(x) (((x) >> 4) & 7) /* Function Group */ |
622 | 623 | ||
624 | /* Address Translation Service */ | ||
625 | #define PCI_ATS_CAP 0x04 /* ATS Capability Register */ | ||
626 | #define PCI_ATS_CAP_QDEP(x) ((x) & 0x1f) /* Invalidate Queue Depth */ | ||
627 | #define PCI_ATS_MAX_QDEP 32 /* Max Invalidate Queue Depth */ | ||
628 | #define PCI_ATS_CTRL 0x06 /* ATS Control Register */ | ||
629 | #define PCI_ATS_CTRL_ENABLE 0x8000 /* ATS Enable */ | ||
630 | #define PCI_ATS_CTRL_STU(x) ((x) & 0x1f) /* Smallest Translation Unit */ | ||
631 | #define PCI_ATS_MIN_STU 12 /* shift of minimum STU block */ | ||
632 | |||
623 | /* Single Root I/O Virtualization */ | 633 | /* Single Root I/O Virtualization */ |
624 | #define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */ | 634 | #define PCI_SRIOV_CAP 0x04 /* SR-IOV Capabilities */ |
625 | #define PCI_SRIOV_CAP_VFM 0x01 /* VF Migration Capable */ | 635 | #define PCI_SRIOV_CAP_VFM 0x01 /* VF Migration Capable */ |
diff --git a/include/linux/percpu-defs.h b/include/linux/percpu-defs.h index 8f921d74f49f..68438e18fff4 100644 --- a/include/linux/percpu-defs.h +++ b/include/linux/percpu-defs.h | |||
@@ -24,7 +24,8 @@ | |||
24 | 24 | ||
25 | #define DEFINE_PER_CPU_SECTION(type, name, section) \ | 25 | #define DEFINE_PER_CPU_SECTION(type, name, section) \ |
26 | __attribute__((__section__(PER_CPU_BASE_SECTION section))) \ | 26 | __attribute__((__section__(PER_CPU_BASE_SECTION section))) \ |
27 | PER_CPU_ATTRIBUTES __typeof__(type) per_cpu__##name | 27 | PER_CPU_ATTRIBUTES PER_CPU_DEF_ATTRIBUTES \ |
28 | __typeof__(type) per_cpu__##name | ||
28 | 29 | ||
29 | /* | 30 | /* |
30 | * Variant on the per-CPU variable declaration/definition theme used for | 31 | * Variant on the per-CPU variable declaration/definition theme used for |
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h index 6e133954e2e4..bd15d7a5f5ce 100644 --- a/include/linux/perf_counter.h +++ b/include/linux/perf_counter.h | |||
@@ -120,6 +120,9 @@ enum perf_counter_sample_format { | |||
120 | PERF_SAMPLE_ID = 1U << 6, | 120 | PERF_SAMPLE_ID = 1U << 6, |
121 | PERF_SAMPLE_CPU = 1U << 7, | 121 | PERF_SAMPLE_CPU = 1U << 7, |
122 | PERF_SAMPLE_PERIOD = 1U << 8, | 122 | PERF_SAMPLE_PERIOD = 1U << 8, |
123 | PERF_SAMPLE_STREAM_ID = 1U << 9, | ||
124 | |||
125 | PERF_SAMPLE_MAX = 1U << 10, /* non-ABI */ | ||
123 | }; | 126 | }; |
124 | 127 | ||
125 | /* | 128 | /* |
@@ -131,17 +134,26 @@ enum perf_counter_read_format { | |||
131 | PERF_FORMAT_TOTAL_TIME_ENABLED = 1U << 0, | 134 | PERF_FORMAT_TOTAL_TIME_ENABLED = 1U << 0, |
132 | PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1, | 135 | PERF_FORMAT_TOTAL_TIME_RUNNING = 1U << 1, |
133 | PERF_FORMAT_ID = 1U << 2, | 136 | PERF_FORMAT_ID = 1U << 2, |
137 | |||
138 | PERF_FORMAT_MAX = 1U << 3, /* non-ABI */ | ||
134 | }; | 139 | }; |
135 | 140 | ||
141 | #define PERF_ATTR_SIZE_VER0 64 /* sizeof first published struct */ | ||
142 | |||
136 | /* | 143 | /* |
137 | * Hardware event to monitor via a performance monitoring counter: | 144 | * Hardware event to monitor via a performance monitoring counter: |
138 | */ | 145 | */ |
139 | struct perf_counter_attr { | 146 | struct perf_counter_attr { |
147 | |||
140 | /* | 148 | /* |
141 | * Major type: hardware/software/tracepoint/etc. | 149 | * Major type: hardware/software/tracepoint/etc. |
142 | */ | 150 | */ |
143 | __u32 type; | 151 | __u32 type; |
144 | __u32 __reserved_1; | 152 | |
153 | /* | ||
154 | * Size of the attr structure, for fwd/bwd compat. | ||
155 | */ | ||
156 | __u32 size; | ||
145 | 157 | ||
146 | /* | 158 | /* |
147 | * Type specific configuration information. | 159 | * Type specific configuration information. |
@@ -167,13 +179,15 @@ struct perf_counter_attr { | |||
167 | mmap : 1, /* include mmap data */ | 179 | mmap : 1, /* include mmap data */ |
168 | comm : 1, /* include comm data */ | 180 | comm : 1, /* include comm data */ |
169 | freq : 1, /* use freq, not period */ | 181 | freq : 1, /* use freq, not period */ |
182 | inherit_stat : 1, /* per task counts */ | ||
183 | enable_on_exec : 1, /* next exec enables */ | ||
170 | 184 | ||
171 | __reserved_2 : 53; | 185 | __reserved_1 : 51; |
172 | 186 | ||
173 | __u32 wakeup_events; /* wakeup every n events */ | 187 | __u32 wakeup_events; /* wakeup every n events */ |
174 | __u32 __reserved_3; | 188 | __u32 __reserved_2; |
175 | 189 | ||
176 | __u64 __reserved_4; | 190 | __u64 __reserved_3; |
177 | }; | 191 | }; |
178 | 192 | ||
179 | /* | 193 | /* |
@@ -221,14 +235,28 @@ struct perf_counter_mmap_page { | |||
221 | __u32 lock; /* seqlock for synchronization */ | 235 | __u32 lock; /* seqlock for synchronization */ |
222 | __u32 index; /* hardware counter identifier */ | 236 | __u32 index; /* hardware counter identifier */ |
223 | __s64 offset; /* add to hardware counter value */ | 237 | __s64 offset; /* add to hardware counter value */ |
238 | __u64 time_enabled; /* time counter active */ | ||
239 | __u64 time_running; /* time counter on cpu */ | ||
240 | |||
241 | /* | ||
242 | * Hole for extension of the self monitor capabilities | ||
243 | */ | ||
244 | |||
245 | __u64 __reserved[123]; /* align to 1k */ | ||
224 | 246 | ||
225 | /* | 247 | /* |
226 | * Control data for the mmap() data buffer. | 248 | * Control data for the mmap() data buffer. |
227 | * | 249 | * |
228 | * User-space reading this value should issue an rmb(), on SMP capable | 250 | * User-space reading the @data_head value should issue an rmb(), on |
229 | * platforms, after reading this value -- see perf_counter_wakeup(). | 251 | * SMP capable platforms, after reading this value -- see |
252 | * perf_counter_wakeup(). | ||
253 | * | ||
254 | * When the mapping is PROT_WRITE the @data_tail value should be | ||
255 | * written by userspace to reflect the last read data. In this case | ||
256 | * the kernel will not over-write unread data. | ||
230 | */ | 257 | */ |
231 | __u64 data_head; /* head in the data section */ | 258 | __u64 data_head; /* head in the data section */ |
259 | __u64 data_tail; /* user-space written tail */ | ||
232 | }; | 260 | }; |
233 | 261 | ||
234 | #define PERF_EVENT_MISC_CPUMODE_MASK (3 << 0) | 262 | #define PERF_EVENT_MISC_CPUMODE_MASK (3 << 0) |
@@ -236,7 +264,6 @@ struct perf_counter_mmap_page { | |||
236 | #define PERF_EVENT_MISC_KERNEL (1 << 0) | 264 | #define PERF_EVENT_MISC_KERNEL (1 << 0) |
237 | #define PERF_EVENT_MISC_USER (2 << 0) | 265 | #define PERF_EVENT_MISC_USER (2 << 0) |
238 | #define PERF_EVENT_MISC_HYPERVISOR (3 << 0) | 266 | #define PERF_EVENT_MISC_HYPERVISOR (3 << 0) |
239 | #define PERF_EVENT_MISC_OVERFLOW (1 << 2) | ||
240 | 267 | ||
241 | struct perf_event_header { | 268 | struct perf_event_header { |
242 | __u32 type; | 269 | __u32 type; |
@@ -264,29 +291,29 @@ enum perf_event_type { | |||
264 | 291 | ||
265 | /* | 292 | /* |
266 | * struct { | 293 | * struct { |
267 | * struct perf_event_header header; | 294 | * struct perf_event_header header; |
268 | * | 295 | * u64 id; |
269 | * u32 pid, tid; | 296 | * u64 lost; |
270 | * char comm[]; | ||
271 | * }; | 297 | * }; |
272 | */ | 298 | */ |
273 | PERF_EVENT_COMM = 3, | 299 | PERF_EVENT_LOST = 2, |
274 | 300 | ||
275 | /* | 301 | /* |
276 | * struct { | 302 | * struct { |
277 | * struct perf_event_header header; | 303 | * struct perf_event_header header; |
278 | * u64 time; | 304 | * |
279 | * u64 id; | 305 | * u32 pid, tid; |
280 | * u64 sample_period; | 306 | * char comm[]; |
281 | * }; | 307 | * }; |
282 | */ | 308 | */ |
283 | PERF_EVENT_PERIOD = 4, | 309 | PERF_EVENT_COMM = 3, |
284 | 310 | ||
285 | /* | 311 | /* |
286 | * struct { | 312 | * struct { |
287 | * struct perf_event_header header; | 313 | * struct perf_event_header header; |
288 | * u64 time; | 314 | * u64 time; |
289 | * u64 id; | 315 | * u64 id; |
316 | * u64 stream_id; | ||
290 | * }; | 317 | * }; |
291 | */ | 318 | */ |
292 | PERF_EVENT_THROTTLE = 5, | 319 | PERF_EVENT_THROTTLE = 5, |
@@ -301,29 +328,52 @@ enum perf_event_type { | |||
301 | PERF_EVENT_FORK = 7, | 328 | PERF_EVENT_FORK = 7, |
302 | 329 | ||
303 | /* | 330 | /* |
304 | * When header.misc & PERF_EVENT_MISC_OVERFLOW the event_type field | 331 | * struct { |
305 | * will be PERF_RECORD_* | 332 | * struct perf_event_header header; |
306 | * | 333 | * u32 pid, tid; |
334 | * u64 value; | ||
335 | * { u64 time_enabled; } && PERF_FORMAT_ENABLED | ||
336 | * { u64 time_running; } && PERF_FORMAT_RUNNING | ||
337 | * { u64 parent_id; } && PERF_FORMAT_ID | ||
338 | * }; | ||
339 | */ | ||
340 | PERF_EVENT_READ = 8, | ||
341 | |||
342 | /* | ||
307 | * struct { | 343 | * struct { |
308 | * struct perf_event_header header; | 344 | * struct perf_event_header header; |
309 | * | 345 | * |
310 | * { u64 ip; } && PERF_RECORD_IP | 346 | * { u64 ip; } && PERF_SAMPLE_IP |
311 | * { u32 pid, tid; } && PERF_RECORD_TID | 347 | * { u32 pid, tid; } && PERF_SAMPLE_TID |
312 | * { u64 time; } && PERF_RECORD_TIME | 348 | * { u64 time; } && PERF_SAMPLE_TIME |
313 | * { u64 addr; } && PERF_RECORD_ADDR | 349 | * { u64 addr; } && PERF_SAMPLE_ADDR |
314 | * { u64 config; } && PERF_RECORD_CONFIG | 350 | * { u64 id; } && PERF_SAMPLE_ID |
315 | * { u32 cpu, res; } && PERF_RECORD_CPU | 351 | * { u64 stream_id;} && PERF_SAMPLE_STREAM_ID |
352 | * { u32 cpu, res; } && PERF_SAMPLE_CPU | ||
353 | * { u64 period; } && PERF_SAMPLE_PERIOD | ||
316 | * | 354 | * |
317 | * { u64 nr; | 355 | * { u64 nr; |
318 | * { u64 id, val; } cnt[nr]; } && PERF_RECORD_GROUP | 356 | * { u64 id, val; } cnt[nr]; } && PERF_SAMPLE_GROUP |
319 | * | 357 | * |
320 | * { u16 nr, | 358 | * { u64 nr, |
321 | * hv, | 359 | * u64 ips[nr]; } && PERF_SAMPLE_CALLCHAIN |
322 | * kernel, | ||
323 | * user; | ||
324 | * u64 ips[nr]; } && PERF_RECORD_CALLCHAIN | ||
325 | * }; | 360 | * }; |
326 | */ | 361 | */ |
362 | PERF_EVENT_SAMPLE = 9, | ||
363 | |||
364 | PERF_EVENT_MAX, /* non-ABI */ | ||
365 | }; | ||
366 | |||
367 | enum perf_callchain_context { | ||
368 | PERF_CONTEXT_HV = (__u64)-32, | ||
369 | PERF_CONTEXT_KERNEL = (__u64)-128, | ||
370 | PERF_CONTEXT_USER = (__u64)-512, | ||
371 | |||
372 | PERF_CONTEXT_GUEST = (__u64)-2048, | ||
373 | PERF_CONTEXT_GUEST_KERNEL = (__u64)-2176, | ||
374 | PERF_CONTEXT_GUEST_USER = (__u64)-2560, | ||
375 | |||
376 | PERF_CONTEXT_MAX = (__u64)-4095, | ||
327 | }; | 377 | }; |
328 | 378 | ||
329 | #ifdef __KERNEL__ | 379 | #ifdef __KERNEL__ |
@@ -345,6 +395,13 @@ enum perf_event_type { | |||
345 | #include <linux/pid_namespace.h> | 395 | #include <linux/pid_namespace.h> |
346 | #include <asm/atomic.h> | 396 | #include <asm/atomic.h> |
347 | 397 | ||
398 | #define PERF_MAX_STACK_DEPTH 255 | ||
399 | |||
400 | struct perf_callchain_entry { | ||
401 | __u64 nr; | ||
402 | __u64 ip[PERF_MAX_STACK_DEPTH]; | ||
403 | }; | ||
404 | |||
348 | struct task_struct; | 405 | struct task_struct; |
349 | 406 | ||
350 | /** | 407 | /** |
@@ -403,6 +460,7 @@ struct file; | |||
403 | struct perf_mmap_data { | 460 | struct perf_mmap_data { |
404 | struct rcu_head rcu_head; | 461 | struct rcu_head rcu_head; |
405 | int nr_pages; /* nr of data pages */ | 462 | int nr_pages; /* nr of data pages */ |
463 | int writable; /* are we writable */ | ||
406 | int nr_locked; /* nr pages mlocked */ | 464 | int nr_locked; /* nr pages mlocked */ |
407 | 465 | ||
408 | atomic_t poll; /* POLL_ for wakeups */ | 466 | atomic_t poll; /* POLL_ for wakeups */ |
@@ -412,8 +470,8 @@ struct perf_mmap_data { | |||
412 | atomic_long_t done_head; /* completed head */ | 470 | atomic_long_t done_head; /* completed head */ |
413 | 471 | ||
414 | atomic_t lock; /* concurrent writes */ | 472 | atomic_t lock; /* concurrent writes */ |
415 | |||
416 | atomic_t wakeup; /* needs a wakeup */ | 473 | atomic_t wakeup; /* needs a wakeup */ |
474 | atomic_t lost; /* nr records lost */ | ||
417 | 475 | ||
418 | struct perf_counter_mmap_page *user_page; | 476 | struct perf_counter_mmap_page *user_page; |
419 | void *data_pages[0]; | 477 | void *data_pages[0]; |
@@ -539,6 +597,7 @@ struct perf_counter_context { | |||
539 | int nr_counters; | 597 | int nr_counters; |
540 | int nr_active; | 598 | int nr_active; |
541 | int is_active; | 599 | int is_active; |
600 | int nr_stat; | ||
542 | atomic_t refcount; | 601 | atomic_t refcount; |
543 | struct task_struct *task; | 602 | struct task_struct *task; |
544 | 603 | ||
@@ -593,6 +652,7 @@ extern void perf_counter_task_tick(struct task_struct *task, int cpu); | |||
593 | extern int perf_counter_init_task(struct task_struct *child); | 652 | extern int perf_counter_init_task(struct task_struct *child); |
594 | extern void perf_counter_exit_task(struct task_struct *child); | 653 | extern void perf_counter_exit_task(struct task_struct *child); |
595 | extern void perf_counter_free_task(struct task_struct *task); | 654 | extern void perf_counter_free_task(struct task_struct *task); |
655 | extern void set_perf_counter_pending(void); | ||
596 | extern void perf_counter_do_pending(void); | 656 | extern void perf_counter_do_pending(void); |
597 | extern void perf_counter_print_debug(void); | 657 | extern void perf_counter_print_debug(void); |
598 | extern void __perf_disable(void); | 658 | extern void __perf_disable(void); |
@@ -621,10 +681,20 @@ extern int perf_counter_overflow(struct perf_counter *counter, int nmi, | |||
621 | static inline int is_software_counter(struct perf_counter *counter) | 681 | static inline int is_software_counter(struct perf_counter *counter) |
622 | { | 682 | { |
623 | return (counter->attr.type != PERF_TYPE_RAW) && | 683 | return (counter->attr.type != PERF_TYPE_RAW) && |
624 | (counter->attr.type != PERF_TYPE_HARDWARE); | 684 | (counter->attr.type != PERF_TYPE_HARDWARE) && |
685 | (counter->attr.type != PERF_TYPE_HW_CACHE); | ||
625 | } | 686 | } |
626 | 687 | ||
627 | extern void perf_swcounter_event(u32, u64, int, struct pt_regs *, u64); | 688 | extern atomic_t perf_swcounter_enabled[PERF_COUNT_SW_MAX]; |
689 | |||
690 | extern void __perf_swcounter_event(u32, u64, int, struct pt_regs *, u64); | ||
691 | |||
692 | static inline void | ||
693 | perf_swcounter_event(u32 event, u64 nr, int nmi, struct pt_regs *regs, u64 addr) | ||
694 | { | ||
695 | if (atomic_read(&perf_swcounter_enabled[event])) | ||
696 | __perf_swcounter_event(event, nr, nmi, regs, addr); | ||
697 | } | ||
628 | 698 | ||
629 | extern void __perf_counter_mmap(struct vm_area_struct *vma); | 699 | extern void __perf_counter_mmap(struct vm_area_struct *vma); |
630 | 700 | ||
@@ -637,18 +707,6 @@ static inline void perf_counter_mmap(struct vm_area_struct *vma) | |||
637 | extern void perf_counter_comm(struct task_struct *tsk); | 707 | extern void perf_counter_comm(struct task_struct *tsk); |
638 | extern void perf_counter_fork(struct task_struct *tsk); | 708 | extern void perf_counter_fork(struct task_struct *tsk); |
639 | 709 | ||
640 | extern void perf_counter_task_migration(struct task_struct *task, int cpu); | ||
641 | |||
642 | #define MAX_STACK_DEPTH 255 | ||
643 | |||
644 | struct perf_callchain_entry { | ||
645 | u16 nr; | ||
646 | u16 hv; | ||
647 | u16 kernel; | ||
648 | u16 user; | ||
649 | u64 ip[MAX_STACK_DEPTH]; | ||
650 | }; | ||
651 | |||
652 | extern struct perf_callchain_entry *perf_callchain(struct pt_regs *regs); | 710 | extern struct perf_callchain_entry *perf_callchain(struct pt_regs *regs); |
653 | 711 | ||
654 | extern int sysctl_perf_counter_paranoid; | 712 | extern int sysctl_perf_counter_paranoid; |
@@ -689,8 +747,6 @@ static inline void perf_counter_mmap(struct vm_area_struct *vma) { } | |||
689 | static inline void perf_counter_comm(struct task_struct *tsk) { } | 747 | static inline void perf_counter_comm(struct task_struct *tsk) { } |
690 | static inline void perf_counter_fork(struct task_struct *tsk) { } | 748 | static inline void perf_counter_fork(struct task_struct *tsk) { } |
691 | static inline void perf_counter_init(void) { } | 749 | static inline void perf_counter_init(void) { } |
692 | static inline void perf_counter_task_migration(struct task_struct *task, | ||
693 | int cpu) { } | ||
694 | #endif | 750 | #endif |
695 | 751 | ||
696 | #endif /* __KERNEL__ */ | 752 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/personality.h b/include/linux/personality.h index a84e9ff9b27e..126120819a0d 100644 --- a/include/linux/personality.h +++ b/include/linux/personality.h | |||
@@ -40,7 +40,10 @@ enum { | |||
40 | * Security-relevant compatibility flags that must be | 40 | * Security-relevant compatibility flags that must be |
41 | * cleared upon setuid or setgid exec: | 41 | * cleared upon setuid or setgid exec: |
42 | */ | 42 | */ |
43 | #define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC|ADDR_NO_RANDOMIZE) | 43 | #define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC | \ |
44 | ADDR_NO_RANDOMIZE | \ | ||
45 | ADDR_COMPAT_LAYOUT | \ | ||
46 | MMAP_PAGE_ZERO) | ||
44 | 47 | ||
45 | /* | 48 | /* |
46 | * Personality types. | 49 | * Personality types. |
diff --git a/include/linux/phy.h b/include/linux/phy.h index 97e40cb6b588..b1368b8f6572 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h | |||
@@ -79,7 +79,7 @@ typedef enum { | |||
79 | * Need to be a little smaller than phydev->dev.bus_id to leave room | 79 | * Need to be a little smaller than phydev->dev.bus_id to leave room |
80 | * for the ":%02x" | 80 | * for the ":%02x" |
81 | */ | 81 | */ |
82 | #define MII_BUS_ID_SIZE (BUS_ID_SIZE - 3) | 82 | #define MII_BUS_ID_SIZE (20 - 3) |
83 | 83 | ||
84 | /* | 84 | /* |
85 | * The Bus class for PHYs. Devices which provide access to | 85 | * The Bus class for PHYs. Devices which provide access to |
@@ -407,7 +407,7 @@ struct phy_driver { | |||
407 | /* A Structure for boards to register fixups with the PHY Lib */ | 407 | /* A Structure for boards to register fixups with the PHY Lib */ |
408 | struct phy_fixup { | 408 | struct phy_fixup { |
409 | struct list_head list; | 409 | struct list_head list; |
410 | char bus_id[BUS_ID_SIZE]; | 410 | char bus_id[20]; |
411 | u32 phy_uid; | 411 | u32 phy_uid; |
412 | u32 phy_uid_mask; | 412 | u32 phy_uid_mask; |
413 | int (*run)(struct phy_device *phydev); | 413 | int (*run)(struct phy_device *phydev); |
@@ -444,10 +444,16 @@ static inline int phy_write(struct phy_device *phydev, u16 regnum, u16 val) | |||
444 | 444 | ||
445 | int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id); | 445 | int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id); |
446 | struct phy_device* get_phy_device(struct mii_bus *bus, int addr); | 446 | struct phy_device* get_phy_device(struct mii_bus *bus, int addr); |
447 | int phy_device_register(struct phy_device *phy); | ||
447 | int phy_clear_interrupt(struct phy_device *phydev); | 448 | int phy_clear_interrupt(struct phy_device *phydev); |
448 | int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); | 449 | int phy_config_interrupt(struct phy_device *phydev, u32 interrupts); |
450 | int phy_attach_direct(struct net_device *dev, struct phy_device *phydev, | ||
451 | u32 flags, phy_interface_t interface); | ||
449 | struct phy_device * phy_attach(struct net_device *dev, | 452 | struct phy_device * phy_attach(struct net_device *dev, |
450 | const char *bus_id, u32 flags, phy_interface_t interface); | 453 | const char *bus_id, u32 flags, phy_interface_t interface); |
454 | int phy_connect_direct(struct net_device *dev, struct phy_device *phydev, | ||
455 | void (*handler)(struct net_device *), u32 flags, | ||
456 | phy_interface_t interface); | ||
451 | struct phy_device * phy_connect(struct net_device *dev, const char *bus_id, | 457 | struct phy_device * phy_connect(struct net_device *dev, const char *bus_id, |
452 | void (*handler)(struct net_device *), u32 flags, | 458 | void (*handler)(struct net_device *), u32 flags, |
453 | phy_interface_t interface); | 459 | phy_interface_t interface); |
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index b67bb5d7b221..8dc5123b6305 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
@@ -36,8 +36,8 @@ extern struct device platform_bus; | |||
36 | 36 | ||
37 | extern struct resource *platform_get_resource(struct platform_device *, unsigned int, unsigned int); | 37 | extern struct resource *platform_get_resource(struct platform_device *, unsigned int, unsigned int); |
38 | extern int platform_get_irq(struct platform_device *, unsigned int); | 38 | extern int platform_get_irq(struct platform_device *, unsigned int); |
39 | extern struct resource *platform_get_resource_byname(struct platform_device *, unsigned int, char *); | 39 | extern struct resource *platform_get_resource_byname(struct platform_device *, unsigned int, const char *); |
40 | extern int platform_get_irq_byname(struct platform_device *, char *); | 40 | extern int platform_get_irq_byname(struct platform_device *, const char *); |
41 | extern int platform_add_devices(struct platform_device **, int); | 41 | extern int platform_add_devices(struct platform_device **, int); |
42 | 42 | ||
43 | extern struct platform_device *platform_device_register_simple(const char *, int id, | 43 | extern struct platform_device *platform_device_register_simple(const char *, int id, |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 1d4e2d289821..b3f74764a586 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -382,14 +382,13 @@ struct dev_pm_info { | |||
382 | #ifdef CONFIG_PM_SLEEP | 382 | #ifdef CONFIG_PM_SLEEP |
383 | extern void device_pm_lock(void); | 383 | extern void device_pm_lock(void); |
384 | extern int sysdev_resume(void); | 384 | extern int sysdev_resume(void); |
385 | extern void device_power_up(pm_message_t state); | 385 | extern void dpm_resume_noirq(pm_message_t state); |
386 | extern void device_resume(pm_message_t state); | 386 | extern void dpm_resume_end(pm_message_t state); |
387 | 387 | ||
388 | extern void device_pm_unlock(void); | 388 | extern void device_pm_unlock(void); |
389 | extern int sysdev_suspend(pm_message_t state); | 389 | extern int sysdev_suspend(pm_message_t state); |
390 | extern int device_power_down(pm_message_t state); | 390 | extern int dpm_suspend_noirq(pm_message_t state); |
391 | extern int device_suspend(pm_message_t state); | 391 | extern int dpm_suspend_start(pm_message_t state); |
392 | extern int device_prepare_suspend(pm_message_t state); | ||
393 | 392 | ||
394 | extern void __suspend_report_result(const char *function, void *fn, int ret); | 393 | extern void __suspend_report_result(const char *function, void *fn, int ret); |
395 | 394 | ||
@@ -403,7 +402,7 @@ extern void __suspend_report_result(const char *function, void *fn, int ret); | |||
403 | #define device_pm_lock() do {} while (0) | 402 | #define device_pm_lock() do {} while (0) |
404 | #define device_pm_unlock() do {} while (0) | 403 | #define device_pm_unlock() do {} while (0) |
405 | 404 | ||
406 | static inline int device_suspend(pm_message_t state) | 405 | static inline int dpm_suspend_start(pm_message_t state) |
407 | { | 406 | { |
408 | return 0; | 407 | return 0; |
409 | } | 408 | } |
diff --git a/include/linux/pnp.h b/include/linux/pnp.h index ca3c88773028..b063c7328ba5 100644 --- a/include/linux/pnp.h +++ b/include/linux/pnp.h | |||
@@ -446,6 +446,7 @@ int pnp_start_dev(struct pnp_dev *dev); | |||
446 | int pnp_stop_dev(struct pnp_dev *dev); | 446 | int pnp_stop_dev(struct pnp_dev *dev); |
447 | int pnp_activate_dev(struct pnp_dev *dev); | 447 | int pnp_activate_dev(struct pnp_dev *dev); |
448 | int pnp_disable_dev(struct pnp_dev *dev); | 448 | int pnp_disable_dev(struct pnp_dev *dev); |
449 | int pnp_range_reserved(resource_size_t start, resource_size_t end); | ||
449 | 450 | ||
450 | /* protocol helpers */ | 451 | /* protocol helpers */ |
451 | int pnp_is_active(struct pnp_dev *dev); | 452 | int pnp_is_active(struct pnp_dev *dev); |
@@ -476,6 +477,7 @@ static inline int pnp_start_dev(struct pnp_dev *dev) { return -ENODEV; } | |||
476 | static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; } | 477 | static inline int pnp_stop_dev(struct pnp_dev *dev) { return -ENODEV; } |
477 | static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; } | 478 | static inline int pnp_activate_dev(struct pnp_dev *dev) { return -ENODEV; } |
478 | static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; } | 479 | static inline int pnp_disable_dev(struct pnp_dev *dev) { return -ENODEV; } |
480 | static inline int pnp_range_reserved(resource_size_t start, resource_size_t end) { return 0;} | ||
479 | 481 | ||
480 | /* protocol helpers */ | 482 | /* protocol helpers */ |
481 | static inline int pnp_is_active(struct pnp_dev *dev) { return 0; } | 483 | static inline int pnp_is_active(struct pnp_dev *dev) { return 0; } |
diff --git a/include/linux/poll.h b/include/linux/poll.h index 8c24ef8d9976..fa287f25138d 100644 --- a/include/linux/poll.h +++ b/include/linux/poll.h | |||
@@ -32,6 +32,7 @@ typedef void (*poll_queue_proc)(struct file *, wait_queue_head_t *, struct poll_ | |||
32 | 32 | ||
33 | typedef struct poll_table_struct { | 33 | typedef struct poll_table_struct { |
34 | poll_queue_proc qproc; | 34 | poll_queue_proc qproc; |
35 | unsigned long key; | ||
35 | } poll_table; | 36 | } poll_table; |
36 | 37 | ||
37 | static inline void poll_wait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p) | 38 | static inline void poll_wait(struct file * filp, wait_queue_head_t * wait_address, poll_table *p) |
@@ -43,10 +44,12 @@ static inline void poll_wait(struct file * filp, wait_queue_head_t * wait_addres | |||
43 | static inline void init_poll_funcptr(poll_table *pt, poll_queue_proc qproc) | 44 | static inline void init_poll_funcptr(poll_table *pt, poll_queue_proc qproc) |
44 | { | 45 | { |
45 | pt->qproc = qproc; | 46 | pt->qproc = qproc; |
47 | pt->key = ~0UL; /* all events enabled */ | ||
46 | } | 48 | } |
47 | 49 | ||
48 | struct poll_table_entry { | 50 | struct poll_table_entry { |
49 | struct file *filp; | 51 | struct file *filp; |
52 | unsigned long key; | ||
50 | wait_queue_t wait; | 53 | wait_queue_t wait; |
51 | wait_queue_head_t *wait_address; | 54 | wait_queue_head_t *wait_address; |
52 | }; | 55 | }; |
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h index 4bc241290c24..065a3652a3ea 100644 --- a/include/linux/posix_acl.h +++ b/include/linux/posix_acl.h | |||
@@ -83,4 +83,78 @@ extern int posix_acl_chmod_masq(struct posix_acl *, mode_t); | |||
83 | extern struct posix_acl *get_posix_acl(struct inode *, int); | 83 | extern struct posix_acl *get_posix_acl(struct inode *, int); |
84 | extern int set_posix_acl(struct inode *, int, struct posix_acl *); | 84 | extern int set_posix_acl(struct inode *, int, struct posix_acl *); |
85 | 85 | ||
86 | #ifdef CONFIG_FS_POSIX_ACL | ||
87 | static inline struct posix_acl *get_cached_acl(struct inode *inode, int type) | ||
88 | { | ||
89 | struct posix_acl **p, *acl; | ||
90 | switch (type) { | ||
91 | case ACL_TYPE_ACCESS: | ||
92 | p = &inode->i_acl; | ||
93 | break; | ||
94 | case ACL_TYPE_DEFAULT: | ||
95 | p = &inode->i_default_acl; | ||
96 | break; | ||
97 | default: | ||
98 | return ERR_PTR(-EINVAL); | ||
99 | } | ||
100 | acl = ACCESS_ONCE(*p); | ||
101 | if (acl) { | ||
102 | spin_lock(&inode->i_lock); | ||
103 | acl = *p; | ||
104 | if (acl != ACL_NOT_CACHED) | ||
105 | acl = posix_acl_dup(acl); | ||
106 | spin_unlock(&inode->i_lock); | ||
107 | } | ||
108 | return acl; | ||
109 | } | ||
110 | |||
111 | static inline void set_cached_acl(struct inode *inode, | ||
112 | int type, | ||
113 | struct posix_acl *acl) | ||
114 | { | ||
115 | struct posix_acl *old = NULL; | ||
116 | spin_lock(&inode->i_lock); | ||
117 | switch (type) { | ||
118 | case ACL_TYPE_ACCESS: | ||
119 | old = inode->i_acl; | ||
120 | inode->i_acl = posix_acl_dup(acl); | ||
121 | break; | ||
122 | case ACL_TYPE_DEFAULT: | ||
123 | old = inode->i_default_acl; | ||
124 | inode->i_default_acl = posix_acl_dup(acl); | ||
125 | break; | ||
126 | } | ||
127 | spin_unlock(&inode->i_lock); | ||
128 | if (old != ACL_NOT_CACHED) | ||
129 | posix_acl_release(old); | ||
130 | } | ||
131 | |||
132 | static inline void forget_cached_acl(struct inode *inode, int type) | ||
133 | { | ||
134 | struct posix_acl *old = NULL; | ||
135 | spin_lock(&inode->i_lock); | ||
136 | switch (type) { | ||
137 | case ACL_TYPE_ACCESS: | ||
138 | old = inode->i_acl; | ||
139 | inode->i_acl = ACL_NOT_CACHED; | ||
140 | break; | ||
141 | case ACL_TYPE_DEFAULT: | ||
142 | old = inode->i_default_acl; | ||
143 | inode->i_default_acl = ACL_NOT_CACHED; | ||
144 | break; | ||
145 | } | ||
146 | spin_unlock(&inode->i_lock); | ||
147 | if (old != ACL_NOT_CACHED) | ||
148 | posix_acl_release(old); | ||
149 | } | ||
150 | #endif | ||
151 | |||
152 | static inline void cache_no_acl(struct inode *inode) | ||
153 | { | ||
154 | #ifdef CONFIG_FS_POSIX_ACL | ||
155 | inode->i_acl = NULL; | ||
156 | inode->i_default_acl = NULL; | ||
157 | #endif | ||
158 | } | ||
159 | |||
86 | #endif /* __LINUX_POSIX_ACL_H */ | 160 | #endif /* __LINUX_POSIX_ACL_H */ |
diff --git a/include/linux/pps.h b/include/linux/pps.h new file mode 100644 index 000000000000..cfe5c7214ec6 --- /dev/null +++ b/include/linux/pps.h | |||
@@ -0,0 +1,122 @@ | |||
1 | /* | ||
2 | * PPS API header | ||
3 | * | ||
4 | * Copyright (C) 2005-2009 Rodolfo Giometti <giometti@linux.it> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
19 | */ | ||
20 | |||
21 | |||
22 | #ifndef _PPS_H_ | ||
23 | #define _PPS_H_ | ||
24 | |||
25 | #define PPS_VERSION "5.3.6" | ||
26 | #define PPS_MAX_SOURCES 16 /* should be enough... */ | ||
27 | |||
28 | /* Implementation note: the logical states ``assert'' and ``clear'' | ||
29 | * are implemented in terms of the chip register, i.e. ``assert'' | ||
30 | * means the bit is set. */ | ||
31 | |||
32 | /* | ||
33 | * 3.2 New data structures | ||
34 | */ | ||
35 | |||
36 | #define PPS_API_VERS_1 1 | ||
37 | #define PPS_API_VERS PPS_API_VERS_1 /* we use API version 1 */ | ||
38 | #define PPS_MAX_NAME_LEN 32 | ||
39 | |||
40 | /* 32-bit vs. 64-bit compatibility. | ||
41 | * | ||
42 | * 0n i386, the alignment of a uint64_t is only 4 bytes, while on most other | ||
43 | * architectures it's 8 bytes. On i386, there will be no padding between the | ||
44 | * two consecutive 'struct pps_ktime' members of struct pps_kinfo and struct | ||
45 | * pps_kparams. But on most platforms there will be padding to ensure correct | ||
46 | * alignment. | ||
47 | * | ||
48 | * The simple fix is probably to add an explicit padding. | ||
49 | * [David Woodhouse] | ||
50 | */ | ||
51 | struct pps_ktime { | ||
52 | __s64 sec; | ||
53 | __s32 nsec; | ||
54 | __u32 flags; | ||
55 | }; | ||
56 | #define PPS_TIME_INVALID (1<<0) /* used to specify timeout==NULL */ | ||
57 | |||
58 | struct pps_kinfo { | ||
59 | __u32 assert_sequence; /* seq. num. of assert event */ | ||
60 | __u32 clear_sequence; /* seq. num. of clear event */ | ||
61 | struct pps_ktime assert_tu; /* time of assert event */ | ||
62 | struct pps_ktime clear_tu; /* time of clear event */ | ||
63 | int current_mode; /* current mode bits */ | ||
64 | }; | ||
65 | |||
66 | struct pps_kparams { | ||
67 | int api_version; /* API version # */ | ||
68 | int mode; /* mode bits */ | ||
69 | struct pps_ktime assert_off_tu; /* offset compensation for assert */ | ||
70 | struct pps_ktime clear_off_tu; /* offset compensation for clear */ | ||
71 | }; | ||
72 | |||
73 | /* | ||
74 | * 3.3 Mode bit definitions | ||
75 | */ | ||
76 | |||
77 | /* Device/implementation parameters */ | ||
78 | #define PPS_CAPTUREASSERT 0x01 /* capture assert events */ | ||
79 | #define PPS_CAPTURECLEAR 0x02 /* capture clear events */ | ||
80 | #define PPS_CAPTUREBOTH 0x03 /* capture assert and clear events */ | ||
81 | |||
82 | #define PPS_OFFSETASSERT 0x10 /* apply compensation for assert ev. */ | ||
83 | #define PPS_OFFSETCLEAR 0x20 /* apply compensation for clear ev. */ | ||
84 | |||
85 | #define PPS_CANWAIT 0x100 /* can we wait for an event? */ | ||
86 | #define PPS_CANPOLL 0x200 /* bit reserved for future use */ | ||
87 | |||
88 | /* Kernel actions */ | ||
89 | #define PPS_ECHOASSERT 0x40 /* feed back assert event to output */ | ||
90 | #define PPS_ECHOCLEAR 0x80 /* feed back clear event to output */ | ||
91 | |||
92 | /* Timestamp formats */ | ||
93 | #define PPS_TSFMT_TSPEC 0x1000 /* select timespec format */ | ||
94 | #define PPS_TSFMT_NTPFP 0x2000 /* select NTP format */ | ||
95 | |||
96 | /* | ||
97 | * 3.4.4 New functions: disciplining the kernel timebase | ||
98 | */ | ||
99 | |||
100 | /* Kernel consumers */ | ||
101 | #define PPS_KC_HARDPPS 0 /* hardpps() (or equivalent) */ | ||
102 | #define PPS_KC_HARDPPS_PLL 1 /* hardpps() constrained to | ||
103 | use a phase-locked loop */ | ||
104 | #define PPS_KC_HARDPPS_FLL 2 /* hardpps() constrained to | ||
105 | use a frequency-locked loop */ | ||
106 | /* | ||
107 | * Here begins the implementation-specific part! | ||
108 | */ | ||
109 | |||
110 | struct pps_fdata { | ||
111 | struct pps_kinfo info; | ||
112 | struct pps_ktime timeout; | ||
113 | }; | ||
114 | |||
115 | #include <linux/ioctl.h> | ||
116 | |||
117 | #define PPS_GETPARAMS _IOR('p', 0xa1, struct pps_kparams *) | ||
118 | #define PPS_SETPARAMS _IOW('p', 0xa2, struct pps_kparams *) | ||
119 | #define PPS_GETCAP _IOR('p', 0xa3, int *) | ||
120 | #define PPS_FETCH _IOWR('p', 0xa4, struct pps_fdata *) | ||
121 | |||
122 | #endif /* _PPS_H_ */ | ||
diff --git a/include/linux/pps_kernel.h b/include/linux/pps_kernel.h new file mode 100644 index 000000000000..e0a193f830ef --- /dev/null +++ b/include/linux/pps_kernel.h | |||
@@ -0,0 +1,89 @@ | |||
1 | /* | ||
2 | * PPS API kernel header | ||
3 | * | ||
4 | * Copyright (C) 2009 Rodolfo Giometti <giometti@linux.it> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
19 | */ | ||
20 | |||
21 | #include <linux/pps.h> | ||
22 | |||
23 | #include <linux/cdev.h> | ||
24 | #include <linux/device.h> | ||
25 | #include <linux/time.h> | ||
26 | |||
27 | /* | ||
28 | * Global defines | ||
29 | */ | ||
30 | |||
31 | /* The specific PPS source info */ | ||
32 | struct pps_source_info { | ||
33 | char name[PPS_MAX_NAME_LEN]; /* simbolic name */ | ||
34 | char path[PPS_MAX_NAME_LEN]; /* path of connected device */ | ||
35 | int mode; /* PPS's allowed mode */ | ||
36 | |||
37 | void (*echo)(int source, int event, void *data); /* PPS echo function */ | ||
38 | |||
39 | struct module *owner; | ||
40 | struct device *dev; | ||
41 | }; | ||
42 | |||
43 | /* The main struct */ | ||
44 | struct pps_device { | ||
45 | struct pps_source_info info; /* PSS source info */ | ||
46 | |||
47 | struct pps_kparams params; /* PPS's current params */ | ||
48 | |||
49 | __u32 assert_sequence; /* PPS' assert event seq # */ | ||
50 | __u32 clear_sequence; /* PPS' clear event seq # */ | ||
51 | struct pps_ktime assert_tu; | ||
52 | struct pps_ktime clear_tu; | ||
53 | int current_mode; /* PPS mode at event time */ | ||
54 | |||
55 | int go; /* PPS event is arrived? */ | ||
56 | wait_queue_head_t queue; /* PPS event queue */ | ||
57 | |||
58 | unsigned int id; /* PPS source unique ID */ | ||
59 | struct cdev cdev; | ||
60 | struct device *dev; | ||
61 | int devno; | ||
62 | struct fasync_struct *async_queue; /* fasync method */ | ||
63 | spinlock_t lock; | ||
64 | |||
65 | atomic_t usage; /* usage count */ | ||
66 | }; | ||
67 | |||
68 | /* | ||
69 | * Global variables | ||
70 | */ | ||
71 | |||
72 | extern spinlock_t pps_idr_lock; | ||
73 | extern struct idr pps_idr; | ||
74 | extern struct timespec pps_irq_ts[]; | ||
75 | |||
76 | extern struct device_attribute pps_attrs[]; | ||
77 | |||
78 | /* | ||
79 | * Exported functions | ||
80 | */ | ||
81 | |||
82 | struct pps_device *pps_get_source(int source); | ||
83 | extern void pps_put_source(struct pps_device *pps); | ||
84 | extern int pps_register_source(struct pps_source_info *info, | ||
85 | int default_params); | ||
86 | extern void pps_unregister_source(int source); | ||
87 | extern int pps_register_cdev(struct pps_device *pps); | ||
88 | extern void pps_unregister_cdev(struct pps_device *pps); | ||
89 | extern void pps_event(int source, struct pps_ktime *ts, int event, void *data); | ||
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 59e133d39d50..7456d7d87a19 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -81,7 +81,6 @@ | |||
81 | 81 | ||
82 | 82 | ||
83 | extern long arch_ptrace(struct task_struct *child, long request, long addr, long data); | 83 | extern long arch_ptrace(struct task_struct *child, long request, long addr, long data); |
84 | extern struct task_struct *ptrace_get_task_struct(pid_t pid); | ||
85 | extern int ptrace_traceme(void); | 84 | extern int ptrace_traceme(void); |
86 | extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); | 85 | extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); |
87 | extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); | 86 | extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); |
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h index 7bc457593684..26361c4c037a 100644 --- a/include/linux/quotaops.h +++ b/include/linux/quotaops.h | |||
@@ -7,7 +7,6 @@ | |||
7 | #ifndef _LINUX_QUOTAOPS_ | 7 | #ifndef _LINUX_QUOTAOPS_ |
8 | #define _LINUX_QUOTAOPS_ | 8 | #define _LINUX_QUOTAOPS_ |
9 | 9 | ||
10 | #include <linux/smp_lock.h> | ||
11 | #include <linux/fs.h> | 10 | #include <linux/fs.h> |
12 | 11 | ||
13 | static inline struct quota_info *sb_dqopt(struct super_block *sb) | 12 | static inline struct quota_info *sb_dqopt(struct super_block *sb) |
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h index 355f6e80db0d..c5da74918096 100644 --- a/include/linux/radix-tree.h +++ b/include/linux/radix-tree.h | |||
@@ -167,6 +167,8 @@ radix_tree_gang_lookup_slot(struct radix_tree_root *root, void ***results, | |||
167 | unsigned long first_index, unsigned int max_items); | 167 | unsigned long first_index, unsigned int max_items); |
168 | unsigned long radix_tree_next_hole(struct radix_tree_root *root, | 168 | unsigned long radix_tree_next_hole(struct radix_tree_root *root, |
169 | unsigned long index, unsigned long max_scan); | 169 | unsigned long index, unsigned long max_scan); |
170 | unsigned long radix_tree_prev_hole(struct radix_tree_root *root, | ||
171 | unsigned long index, unsigned long max_scan); | ||
170 | int radix_tree_preload(gfp_t gfp_mask); | 172 | int radix_tree_preload(gfp_t gfp_mask); |
171 | void radix_tree_init(void); | 173 | void radix_tree_init(void); |
172 | void *radix_tree_tag_set(struct radix_tree_root *root, | 174 | void *radix_tree_tag_set(struct radix_tree_root *root, |
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h index 6ba830fa8538..ffa2efbbe382 100644 --- a/include/linux/raid/md_p.h +++ b/include/linux/raid/md_p.h | |||
@@ -232,7 +232,7 @@ struct mdp_superblock_1 { | |||
232 | __le64 reshape_position; /* next address in array-space for reshape */ | 232 | __le64 reshape_position; /* next address in array-space for reshape */ |
233 | __le32 delta_disks; /* change in number of raid_disks */ | 233 | __le32 delta_disks; /* change in number of raid_disks */ |
234 | __le32 new_layout; /* new layout */ | 234 | __le32 new_layout; /* new layout */ |
235 | __le32 new_chunk; /* new chunk size (bytes) */ | 235 | __le32 new_chunk; /* new chunk size (512byte sectors) */ |
236 | __u8 pad1[128-124]; /* set to 0 when written */ | 236 | __u8 pad1[128-124]; /* set to 0 when written */ |
237 | 237 | ||
238 | /* constant this-device information - 64 bytes */ | 238 | /* constant this-device information - 64 bytes */ |
diff --git a/include/linux/regulator/lp3971.h b/include/linux/regulator/lp3971.h new file mode 100644 index 000000000000..61401649fe7d --- /dev/null +++ b/include/linux/regulator/lp3971.h | |||
@@ -0,0 +1,51 @@ | |||
1 | /* | ||
2 | * National Semiconductors LP3971 PMIC chip client interface | ||
3 | * | ||
4 | * Copyright (C) 2009 Samsung Electronics | ||
5 | * Author: Marek Szyprowski <m.szyprowski@samsung.com> | ||
6 | * | ||
7 | * Based on wm8400.h | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2 of the License, or | ||
12 | * (at your option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
22 | */ | ||
23 | |||
24 | #ifndef __LINUX_REGULATOR_LP3971_H | ||
25 | #define __LINUX_REGULATOR_LP3971_H | ||
26 | |||
27 | #include <linux/regulator/machine.h> | ||
28 | |||
29 | #define LP3971_LDO1 0 | ||
30 | #define LP3971_LDO2 1 | ||
31 | #define LP3971_LDO3 2 | ||
32 | #define LP3971_LDO4 3 | ||
33 | #define LP3971_LDO5 4 | ||
34 | |||
35 | #define LP3971_DCDC1 5 | ||
36 | #define LP3971_DCDC2 6 | ||
37 | #define LP3971_DCDC3 7 | ||
38 | |||
39 | #define LP3971_NUM_REGULATORS 8 | ||
40 | |||
41 | struct lp3971_regulator_subdev { | ||
42 | int id; | ||
43 | struct regulator_init_data *initdata; | ||
44 | }; | ||
45 | |||
46 | struct lp3971_platform_data { | ||
47 | int num_regulators; | ||
48 | struct lp3971_regulator_subdev *regulators; | ||
49 | }; | ||
50 | |||
51 | #endif | ||
diff --git a/include/linux/regulator/max1586.h b/include/linux/regulator/max1586.h new file mode 100644 index 000000000000..44563192bf16 --- /dev/null +++ b/include/linux/regulator/max1586.h | |||
@@ -0,0 +1,63 @@ | |||
1 | /* | ||
2 | * max1586.h -- Voltage regulation for the Maxim 1586 | ||
3 | * | ||
4 | * Copyright (C) 2008 Robert Jarzmik | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License, or | ||
9 | * (at your option) any later version. | ||
10 | * | ||
11 | * This program is distributed in the hope that it will be useful, | ||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
14 | * GNU General Public License for more details. | ||
15 | * | ||
16 | * You should have received a copy of the GNU General Public License | ||
17 | * along with this program; if not, write to the Free Software | ||
18 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
19 | */ | ||
20 | |||
21 | #ifndef REGULATOR_MAX1586 | ||
22 | #define REGULATOR_MAX1586 | ||
23 | |||
24 | #include <linux/regulator/machine.h> | ||
25 | |||
26 | #define MAX1586_V3 0 | ||
27 | #define MAX1586_V6 1 | ||
28 | |||
29 | /* precalculated values for v3_gain */ | ||
30 | #define MAX1586_GAIN_NO_R24 1000000 /* 700000 .. 1475000 mV */ | ||
31 | #define MAX1586_GAIN_R24_3k32 1051098 /* 735768 .. 1550369 mV */ | ||
32 | #define MAX1586_GAIN_R24_5k11 1078648 /* 755053 .. 1591005 mV */ | ||
33 | #define MAX1586_GAIN_R24_7k5 1115432 /* 780802 .. 1645262 mV */ | ||
34 | |||
35 | /** | ||
36 | * max1586_subdev_data - regulator data | ||
37 | * @id: regulator Id (either MAX1586_V3 or MAX1586_V6) | ||
38 | * @name: regulator cute name (example for V3: "vcc_core") | ||
39 | * @platform_data: regulator init data (contraints, supplies, ...) | ||
40 | */ | ||
41 | struct max1586_subdev_data { | ||
42 | int id; | ||
43 | char *name; | ||
44 | struct regulator_init_data *platform_data; | ||
45 | }; | ||
46 | |||
47 | /** | ||
48 | * max1586_platform_data - platform data for max1586 | ||
49 | * @num_subdevs: number of regultors used (may be 1 or 2) | ||
50 | * @subdevs: regulator used | ||
51 | * At most, there will be a regulator for V3 and one for V6 voltages. | ||
52 | * @v3_gain: gain on the V3 voltage output multiplied by 1e6. | ||
53 | * This can be calculated as ((1 + R24/R25 + R24/185.5kOhm) * 1e6) | ||
54 | * for an external resistor configuration as described in the | ||
55 | * data sheet (R25=100kOhm). | ||
56 | */ | ||
57 | struct max1586_platform_data { | ||
58 | int num_subdevs; | ||
59 | struct max1586_subdev_data *subdevs; | ||
60 | int v3_gain; | ||
61 | }; | ||
62 | |||
63 | #endif | ||
diff --git a/include/linux/regulator/userspace-consumer.h b/include/linux/regulator/userspace-consumer.h new file mode 100644 index 000000000000..b4554ce9d4bb --- /dev/null +++ b/include/linux/regulator/userspace-consumer.h | |||
@@ -0,0 +1,25 @@ | |||
1 | #ifndef __REGULATOR_PLATFORM_CONSUMER_H_ | ||
2 | #define __REGULATOR_PLATFORM_CONSUMER_H_ | ||
3 | |||
4 | struct regulator_consumer_supply; | ||
5 | |||
6 | /** | ||
7 | * struct regulator_userspace_consumer_data - line consumer | ||
8 | * initialisation data. | ||
9 | * | ||
10 | * @name: Name for the consumer line | ||
11 | * @num_supplies: Number of supplies feeding the line | ||
12 | * @supplies: Supplies configuration. | ||
13 | * @init_on: Set if the regulators supplying the line should be | ||
14 | * enabled during initialisation | ||
15 | */ | ||
16 | struct regulator_userspace_consumer_data { | ||
17 | const char *name; | ||
18 | |||
19 | int num_supplies; | ||
20 | struct regulator_bulk_data *supplies; | ||
21 | |||
22 | bool init_on; | ||
23 | }; | ||
24 | |||
25 | #endif /* __REGULATOR_PLATFORM_CONSUMER_H_ */ | ||
diff --git a/include/linux/reiserfs_acl.h b/include/linux/reiserfs_acl.h index 8cc65757e47a..b4448853900e 100644 --- a/include/linux/reiserfs_acl.h +++ b/include/linux/reiserfs_acl.h | |||
@@ -56,15 +56,6 @@ int reiserfs_cache_default_acl(struct inode *dir); | |||
56 | extern struct xattr_handler reiserfs_posix_acl_default_handler; | 56 | extern struct xattr_handler reiserfs_posix_acl_default_handler; |
57 | extern struct xattr_handler reiserfs_posix_acl_access_handler; | 57 | extern struct xattr_handler reiserfs_posix_acl_access_handler; |
58 | 58 | ||
59 | static inline void reiserfs_init_acl_access(struct inode *inode) | ||
60 | { | ||
61 | REISERFS_I(inode)->i_acl_access = NULL; | ||
62 | } | ||
63 | |||
64 | static inline void reiserfs_init_acl_default(struct inode *inode) | ||
65 | { | ||
66 | REISERFS_I(inode)->i_acl_default = NULL; | ||
67 | } | ||
68 | #else | 59 | #else |
69 | 60 | ||
70 | #define reiserfs_cache_default_acl(inode) 0 | 61 | #define reiserfs_cache_default_acl(inode) 0 |
@@ -86,12 +77,4 @@ reiserfs_inherit_default_acl(struct reiserfs_transaction_handle *th, | |||
86 | { | 77 | { |
87 | return 0; | 78 | return 0; |
88 | } | 79 | } |
89 | |||
90 | static inline void reiserfs_init_acl_access(struct inode *inode) | ||
91 | { | ||
92 | } | ||
93 | |||
94 | static inline void reiserfs_init_acl_default(struct inode *inode) | ||
95 | { | ||
96 | } | ||
97 | #endif | 80 | #endif |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 2245c78d5876..dd31e7bae35c 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -660,23 +660,54 @@ static inline void set_le_key_k_type(int version, struct reiserfs_key *key, | |||
660 | cpu_to_le32(type2uniqueness(type))) | 660 | cpu_to_le32(type2uniqueness(type))) |
661 | : (void)(set_offset_v2_k_type(&(key->u.k_offset_v2), type)); | 661 | : (void)(set_offset_v2_k_type(&(key->u.k_offset_v2), type)); |
662 | } | 662 | } |
663 | |||
663 | static inline void set_le_ih_k_type(struct item_head *ih, int type) | 664 | static inline void set_le_ih_k_type(struct item_head *ih, int type) |
664 | { | 665 | { |
665 | set_le_key_k_type(ih_version(ih), &(ih->ih_key), type); | 666 | set_le_key_k_type(ih_version(ih), &(ih->ih_key), type); |
666 | } | 667 | } |
667 | 668 | ||
668 | #define is_direntry_le_key(version,key) (le_key_k_type (version, key) == TYPE_DIRENTRY) | 669 | static inline int is_direntry_le_key(int version, struct reiserfs_key *key) |
669 | #define is_direct_le_key(version,key) (le_key_k_type (version, key) == TYPE_DIRECT) | 670 | { |
670 | #define is_indirect_le_key(version,key) (le_key_k_type (version, key) == TYPE_INDIRECT) | 671 | return le_key_k_type(version, key) == TYPE_DIRENTRY; |
671 | #define is_statdata_le_key(version,key) (le_key_k_type (version, key) == TYPE_STAT_DATA) | 672 | } |
673 | |||
674 | static inline int is_direct_le_key(int version, struct reiserfs_key *key) | ||
675 | { | ||
676 | return le_key_k_type(version, key) == TYPE_DIRECT; | ||
677 | } | ||
678 | |||
679 | static inline int is_indirect_le_key(int version, struct reiserfs_key *key) | ||
680 | { | ||
681 | return le_key_k_type(version, key) == TYPE_INDIRECT; | ||
682 | } | ||
683 | |||
684 | static inline int is_statdata_le_key(int version, struct reiserfs_key *key) | ||
685 | { | ||
686 | return le_key_k_type(version, key) == TYPE_STAT_DATA; | ||
687 | } | ||
672 | 688 | ||
673 | // | 689 | // |
674 | // item header has version. | 690 | // item header has version. |
675 | // | 691 | // |
676 | #define is_direntry_le_ih(ih) is_direntry_le_key (ih_version (ih), &((ih)->ih_key)) | 692 | static inline int is_direntry_le_ih(struct item_head *ih) |
677 | #define is_direct_le_ih(ih) is_direct_le_key (ih_version (ih), &((ih)->ih_key)) | 693 | { |
678 | #define is_indirect_le_ih(ih) is_indirect_le_key (ih_version(ih), &((ih)->ih_key)) | 694 | return is_direntry_le_key(ih_version(ih), &ih->ih_key); |
679 | #define is_statdata_le_ih(ih) is_statdata_le_key (ih_version (ih), &((ih)->ih_key)) | 695 | } |
696 | |||
697 | static inline int is_direct_le_ih(struct item_head *ih) | ||
698 | { | ||
699 | return is_direct_le_key(ih_version(ih), &ih->ih_key); | ||
700 | } | ||
701 | |||
702 | static inline int is_indirect_le_ih(struct item_head *ih) | ||
703 | { | ||
704 | return is_indirect_le_key(ih_version(ih), &ih->ih_key); | ||
705 | } | ||
706 | |||
707 | static inline int is_statdata_le_ih(struct item_head *ih) | ||
708 | { | ||
709 | return is_statdata_le_key(ih_version(ih), &ih->ih_key); | ||
710 | } | ||
680 | 711 | ||
681 | // | 712 | // |
682 | // key is pointer to cpu key, result is cpu | 713 | // key is pointer to cpu key, result is cpu |
diff --git a/include/linux/reiserfs_fs_i.h b/include/linux/reiserfs_fs_i.h index 76360b36ac33..89f4d3abbf5a 100644 --- a/include/linux/reiserfs_fs_i.h +++ b/include/linux/reiserfs_fs_i.h | |||
@@ -54,10 +54,6 @@ struct reiserfs_inode_info { | |||
54 | unsigned int i_trans_id; | 54 | unsigned int i_trans_id; |
55 | struct reiserfs_journal_list *i_jl; | 55 | struct reiserfs_journal_list *i_jl; |
56 | struct mutex i_mmap; | 56 | struct mutex i_mmap; |
57 | #ifdef CONFIG_REISERFS_FS_POSIX_ACL | ||
58 | struct posix_acl *i_acl_access; | ||
59 | struct posix_acl *i_acl_default; | ||
60 | #endif | ||
61 | #ifdef CONFIG_REISERFS_FS_XATTR | 57 | #ifdef CONFIG_REISERFS_FS_XATTR |
62 | struct rw_semaphore i_xattr_sem; | 58 | struct rw_semaphore i_xattr_sem; |
63 | #endif | 59 | #endif |
diff --git a/include/linux/res_counter.h b/include/linux/res_counter.h index 4c5bcf6ca7e8..511f42fc6816 100644 --- a/include/linux/res_counter.h +++ b/include/linux/res_counter.h | |||
@@ -49,6 +49,8 @@ struct res_counter { | |||
49 | struct res_counter *parent; | 49 | struct res_counter *parent; |
50 | }; | 50 | }; |
51 | 51 | ||
52 | #define RESOURCE_MAX (unsigned long long)LLONG_MAX | ||
53 | |||
52 | /** | 54 | /** |
53 | * Helpers to interact with userspace | 55 | * Helpers to interact with userspace |
54 | * res_counter_read_u64() - returns the value of the specified member. | 56 | * res_counter_read_u64() - returns the value of the specified member. |
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h index 164332cbb77c..2ce29831feb6 100644 --- a/include/linux/rfkill.h +++ b/include/linux/rfkill.h | |||
@@ -4,6 +4,7 @@ | |||
4 | /* | 4 | /* |
5 | * Copyright (C) 2006 - 2007 Ivo van Doorn | 5 | * Copyright (C) 2006 - 2007 Ivo van Doorn |
6 | * Copyright (C) 2007 Dmitry Torokhov | 6 | * Copyright (C) 2007 Dmitry Torokhov |
7 | * Copyright 2009 Johannes Berg <johannes@sipsolutions.net> | ||
7 | * | 8 | * |
8 | * This program is free software; you can redistribute it and/or modify | 9 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License as published by | 10 | * it under the terms of the GNU General Public License as published by |
@@ -22,131 +23,353 @@ | |||
22 | */ | 23 | */ |
23 | 24 | ||
24 | #include <linux/types.h> | 25 | #include <linux/types.h> |
25 | #include <linux/kernel.h> | 26 | |
26 | #include <linux/list.h> | 27 | /* define userspace visible states */ |
27 | #include <linux/mutex.h> | 28 | #define RFKILL_STATE_SOFT_BLOCKED 0 |
28 | #include <linux/device.h> | 29 | #define RFKILL_STATE_UNBLOCKED 1 |
29 | #include <linux/leds.h> | 30 | #define RFKILL_STATE_HARD_BLOCKED 2 |
30 | 31 | ||
31 | /** | 32 | /** |
32 | * enum rfkill_type - type of rfkill switch. | 33 | * enum rfkill_type - type of rfkill switch. |
33 | * RFKILL_TYPE_WLAN: switch is on a 802.11 wireless network device. | 34 | * |
34 | * RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device. | 35 | * @RFKILL_TYPE_ALL: toggles all switches (userspace only) |
35 | * RFKILL_TYPE_UWB: switch is on a ultra wideband device. | 36 | * @RFKILL_TYPE_WLAN: switch is on a 802.11 wireless network device. |
36 | * RFKILL_TYPE_WIMAX: switch is on a WiMAX device. | 37 | * @RFKILL_TYPE_BLUETOOTH: switch is on a bluetooth device. |
37 | * RFKILL_TYPE_WWAN: switch is on a wireless WAN device. | 38 | * @RFKILL_TYPE_UWB: switch is on a ultra wideband device. |
39 | * @RFKILL_TYPE_WIMAX: switch is on a WiMAX device. | ||
40 | * @RFKILL_TYPE_WWAN: switch is on a wireless WAN device. | ||
41 | * @NUM_RFKILL_TYPES: number of defined rfkill types | ||
38 | */ | 42 | */ |
39 | enum rfkill_type { | 43 | enum rfkill_type { |
40 | RFKILL_TYPE_WLAN , | 44 | RFKILL_TYPE_ALL = 0, |
45 | RFKILL_TYPE_WLAN, | ||
41 | RFKILL_TYPE_BLUETOOTH, | 46 | RFKILL_TYPE_BLUETOOTH, |
42 | RFKILL_TYPE_UWB, | 47 | RFKILL_TYPE_UWB, |
43 | RFKILL_TYPE_WIMAX, | 48 | RFKILL_TYPE_WIMAX, |
44 | RFKILL_TYPE_WWAN, | 49 | RFKILL_TYPE_WWAN, |
45 | RFKILL_TYPE_MAX, | 50 | NUM_RFKILL_TYPES, |
46 | }; | 51 | }; |
47 | 52 | ||
48 | enum rfkill_state { | 53 | /** |
49 | RFKILL_STATE_SOFT_BLOCKED = 0, /* Radio output blocked */ | 54 | * enum rfkill_operation - operation types |
50 | RFKILL_STATE_UNBLOCKED = 1, /* Radio output allowed */ | 55 | * @RFKILL_OP_ADD: a device was added |
51 | RFKILL_STATE_HARD_BLOCKED = 2, /* Output blocked, non-overrideable */ | 56 | * @RFKILL_OP_DEL: a device was removed |
52 | RFKILL_STATE_MAX, /* marker for last valid state */ | 57 | * @RFKILL_OP_CHANGE: a device's state changed -- userspace changes one device |
58 | * @RFKILL_OP_CHANGE_ALL: userspace changes all devices (of a type, or all) | ||
59 | */ | ||
60 | enum rfkill_operation { | ||
61 | RFKILL_OP_ADD = 0, | ||
62 | RFKILL_OP_DEL, | ||
63 | RFKILL_OP_CHANGE, | ||
64 | RFKILL_OP_CHANGE_ALL, | ||
53 | }; | 65 | }; |
54 | 66 | ||
55 | /* | 67 | /** |
56 | * These are DEPRECATED, drivers using them should be verified to | 68 | * struct rfkill_event - events for userspace on /dev/rfkill |
57 | * comply with the rfkill usage guidelines in Documentation/rfkill.txt | 69 | * @idx: index of dev rfkill |
58 | * and then converted to use the new names for rfkill_state | 70 | * @type: type of the rfkill struct |
59 | */ | 71 | * @op: operation code |
60 | #define RFKILL_STATE_OFF RFKILL_STATE_SOFT_BLOCKED | 72 | * @hard: hard state (0/1) |
61 | #define RFKILL_STATE_ON RFKILL_STATE_UNBLOCKED | 73 | * @soft: soft state (0/1) |
62 | 74 | * | |
63 | /** | 75 | * Structure used for userspace communication on /dev/rfkill, |
64 | * struct rfkill - rfkill control structure. | 76 | * used for events from the kernel and control to the kernel. |
65 | * @name: Name of the switch. | 77 | */ |
66 | * @type: Radio type which the button controls, the value stored | 78 | struct rfkill_event { |
67 | * here should be a value from enum rfkill_type. | 79 | __u32 idx; |
68 | * @state: State of the switch, "UNBLOCKED" means radio can operate. | 80 | __u8 type; |
69 | * @user_claim_unsupported: Whether the hardware supports exclusive | 81 | __u8 op; |
70 | * RF-kill control by userspace. Set this before registering. | 82 | __u8 soft, hard; |
71 | * @user_claim: Set when the switch is controlled exlusively by userspace. | 83 | } __packed; |
72 | * @mutex: Guards switch state transitions. It serializes callbacks | ||
73 | * and also protects the state. | ||
74 | * @data: Pointer to the RF button drivers private data which will be | ||
75 | * passed along when toggling radio state. | ||
76 | * @toggle_radio(): Mandatory handler to control state of the radio. | ||
77 | * only RFKILL_STATE_SOFT_BLOCKED and RFKILL_STATE_UNBLOCKED are | ||
78 | * valid parameters. | ||
79 | * @get_state(): handler to read current radio state from hardware, | ||
80 | * may be called from atomic context, should return 0 on success. | ||
81 | * Either this handler OR judicious use of rfkill_force_state() is | ||
82 | * MANDATORY for any driver capable of RFKILL_STATE_HARD_BLOCKED. | ||
83 | * @led_trigger: A LED trigger for this button's LED. | ||
84 | * @dev: Device structure integrating the switch into device tree. | ||
85 | * @node: Used to place switch into list of all switches known to the | ||
86 | * the system. | ||
87 | * | ||
88 | * This structure represents a RF switch located on a network device. | ||
89 | */ | ||
90 | struct rfkill { | ||
91 | const char *name; | ||
92 | enum rfkill_type type; | ||
93 | |||
94 | bool user_claim_unsupported; | ||
95 | bool user_claim; | ||
96 | |||
97 | /* the mutex serializes callbacks and also protects | ||
98 | * the state */ | ||
99 | struct mutex mutex; | ||
100 | enum rfkill_state state; | ||
101 | void *data; | ||
102 | int (*toggle_radio)(void *data, enum rfkill_state state); | ||
103 | int (*get_state)(void *data, enum rfkill_state *state); | ||
104 | 84 | ||
105 | #ifdef CONFIG_RFKILL_LEDS | 85 | /* ioctl for turning off rfkill-input (if present) */ |
106 | struct led_trigger led_trigger; | 86 | #define RFKILL_IOC_MAGIC 'R' |
107 | #endif | 87 | #define RFKILL_IOC_NOINPUT 1 |
88 | #define RFKILL_IOCTL_NOINPUT _IO(RFKILL_IOC_MAGIC, RFKILL_IOC_NOINPUT) | ||
108 | 89 | ||
109 | struct device dev; | 90 | /* and that's all userspace gets */ |
110 | struct list_head node; | 91 | #ifdef __KERNEL__ |
111 | enum rfkill_state state_for_resume; | 92 | /* don't allow anyone to use these in the kernel */ |
93 | enum rfkill_user_states { | ||
94 | RFKILL_USER_STATE_SOFT_BLOCKED = RFKILL_STATE_SOFT_BLOCKED, | ||
95 | RFKILL_USER_STATE_UNBLOCKED = RFKILL_STATE_UNBLOCKED, | ||
96 | RFKILL_USER_STATE_HARD_BLOCKED = RFKILL_STATE_HARD_BLOCKED, | ||
112 | }; | 97 | }; |
113 | #define to_rfkill(d) container_of(d, struct rfkill, dev) | 98 | #undef RFKILL_STATE_SOFT_BLOCKED |
99 | #undef RFKILL_STATE_UNBLOCKED | ||
100 | #undef RFKILL_STATE_HARD_BLOCKED | ||
101 | |||
102 | #include <linux/kernel.h> | ||
103 | #include <linux/list.h> | ||
104 | #include <linux/mutex.h> | ||
105 | #include <linux/device.h> | ||
106 | #include <linux/leds.h> | ||
107 | #include <linux/err.h> | ||
108 | |||
109 | /* this is opaque */ | ||
110 | struct rfkill; | ||
111 | |||
112 | /** | ||
113 | * struct rfkill_ops - rfkill driver methods | ||
114 | * | ||
115 | * @poll: poll the rfkill block state(s) -- only assign this method | ||
116 | * when you need polling. When called, simply call one of the | ||
117 | * rfkill_set{,_hw,_sw}_state family of functions. If the hw | ||
118 | * is getting unblocked you need to take into account the return | ||
119 | * value of those functions to make sure the software block is | ||
120 | * properly used. | ||
121 | * @query: query the rfkill block state(s) and call exactly one of the | ||
122 | * rfkill_set{,_hw,_sw}_state family of functions. Assign this | ||
123 | * method if input events can cause hardware state changes to make | ||
124 | * the rfkill core query your driver before setting a requested | ||
125 | * block. | ||
126 | * @set_block: turn the transmitter on (blocked == false) or off | ||
127 | * (blocked == true) -- ignore and return 0 when hard blocked. | ||
128 | * This callback must be assigned. | ||
129 | */ | ||
130 | struct rfkill_ops { | ||
131 | void (*poll)(struct rfkill *rfkill, void *data); | ||
132 | void (*query)(struct rfkill *rfkill, void *data); | ||
133 | int (*set_block)(void *data, bool blocked); | ||
134 | }; | ||
135 | |||
136 | #if defined(CONFIG_RFKILL) || defined(CONFIG_RFKILL_MODULE) | ||
137 | /** | ||
138 | * rfkill_alloc - allocate rfkill structure | ||
139 | * @name: name of the struct -- the string is not copied internally | ||
140 | * @parent: device that has rf switch on it | ||
141 | * @type: type of the switch (RFKILL_TYPE_*) | ||
142 | * @ops: rfkill methods | ||
143 | * @ops_data: data passed to each method | ||
144 | * | ||
145 | * This function should be called by the transmitter driver to allocate an | ||
146 | * rfkill structure. Returns %NULL on failure. | ||
147 | */ | ||
148 | struct rfkill * __must_check rfkill_alloc(const char *name, | ||
149 | struct device *parent, | ||
150 | const enum rfkill_type type, | ||
151 | const struct rfkill_ops *ops, | ||
152 | void *ops_data); | ||
114 | 153 | ||
115 | struct rfkill * __must_check rfkill_allocate(struct device *parent, | 154 | /** |
116 | enum rfkill_type type); | 155 | * rfkill_register - Register a rfkill structure. |
117 | void rfkill_free(struct rfkill *rfkill); | 156 | * @rfkill: rfkill structure to be registered |
157 | * | ||
158 | * This function should be called by the transmitter driver to register | ||
159 | * the rfkill structure. Before calling this function the driver needs | ||
160 | * to be ready to service method calls from rfkill. | ||
161 | * | ||
162 | * If rfkill_init_sw_state() is not called before registration, | ||
163 | * set_block() will be called to initialize the software blocked state | ||
164 | * to a default value. | ||
165 | * | ||
166 | * If the hardware blocked state is not set before registration, | ||
167 | * it is assumed to be unblocked. | ||
168 | */ | ||
118 | int __must_check rfkill_register(struct rfkill *rfkill); | 169 | int __must_check rfkill_register(struct rfkill *rfkill); |
170 | |||
171 | /** | ||
172 | * rfkill_pause_polling(struct rfkill *rfkill) | ||
173 | * | ||
174 | * Pause polling -- say transmitter is off for other reasons. | ||
175 | * NOTE: not necessary for suspend/resume -- in that case the | ||
176 | * core stops polling anyway | ||
177 | */ | ||
178 | void rfkill_pause_polling(struct rfkill *rfkill); | ||
179 | |||
180 | /** | ||
181 | * rfkill_resume_polling(struct rfkill *rfkill) | ||
182 | * | ||
183 | * Pause polling -- say transmitter is off for other reasons. | ||
184 | * NOTE: not necessary for suspend/resume -- in that case the | ||
185 | * core stops polling anyway | ||
186 | */ | ||
187 | void rfkill_resume_polling(struct rfkill *rfkill); | ||
188 | |||
189 | |||
190 | /** | ||
191 | * rfkill_unregister - Unregister a rfkill structure. | ||
192 | * @rfkill: rfkill structure to be unregistered | ||
193 | * | ||
194 | * This function should be called by the network driver during device | ||
195 | * teardown to destroy rfkill structure. Until it returns, the driver | ||
196 | * needs to be able to service method calls. | ||
197 | */ | ||
119 | void rfkill_unregister(struct rfkill *rfkill); | 198 | void rfkill_unregister(struct rfkill *rfkill); |
120 | 199 | ||
121 | int rfkill_force_state(struct rfkill *rfkill, enum rfkill_state state); | 200 | /** |
122 | int rfkill_set_default(enum rfkill_type type, enum rfkill_state state); | 201 | * rfkill_destroy - free rfkill structure |
202 | * @rfkill: rfkill structure to be destroyed | ||
203 | * | ||
204 | * Destroys the rfkill structure. | ||
205 | */ | ||
206 | void rfkill_destroy(struct rfkill *rfkill); | ||
207 | |||
208 | /** | ||
209 | * rfkill_set_hw_state - Set the internal rfkill hardware block state | ||
210 | * @rfkill: pointer to the rfkill class to modify. | ||
211 | * @state: the current hardware block state to set | ||
212 | * | ||
213 | * rfkill drivers that get events when the hard-blocked state changes | ||
214 | * use this function to notify the rfkill core (and through that also | ||
215 | * userspace) of the current state. They should also use this after | ||
216 | * resume if the state could have changed. | ||
217 | * | ||
218 | * You need not (but may) call this function if poll_state is assigned. | ||
219 | * | ||
220 | * This function can be called in any context, even from within rfkill | ||
221 | * callbacks. | ||
222 | * | ||
223 | * The function returns the combined block state (true if transmitter | ||
224 | * should be blocked) so that drivers need not keep track of the soft | ||
225 | * block state -- which they might not be able to. | ||
226 | */ | ||
227 | bool __must_check rfkill_set_hw_state(struct rfkill *rfkill, bool blocked); | ||
228 | |||
229 | /** | ||
230 | * rfkill_set_sw_state - Set the internal rfkill software block state | ||
231 | * @rfkill: pointer to the rfkill class to modify. | ||
232 | * @state: the current software block state to set | ||
233 | * | ||
234 | * rfkill drivers that get events when the soft-blocked state changes | ||
235 | * (yes, some platforms directly act on input but allow changing again) | ||
236 | * use this function to notify the rfkill core (and through that also | ||
237 | * userspace) of the current state. | ||
238 | * | ||
239 | * Drivers should also call this function after resume if the state has | ||
240 | * been changed by the user. This only makes sense for "persistent" | ||
241 | * devices (see rfkill_init_sw_state()). | ||
242 | * | ||
243 | * This function can be called in any context, even from within rfkill | ||
244 | * callbacks. | ||
245 | * | ||
246 | * The function returns the combined block state (true if transmitter | ||
247 | * should be blocked). | ||
248 | */ | ||
249 | bool rfkill_set_sw_state(struct rfkill *rfkill, bool blocked); | ||
250 | |||
251 | /** | ||
252 | * rfkill_init_sw_state - Initialize persistent software block state | ||
253 | * @rfkill: pointer to the rfkill class to modify. | ||
254 | * @state: the current software block state to set | ||
255 | * | ||
256 | * rfkill drivers that preserve their software block state over power off | ||
257 | * use this function to notify the rfkill core (and through that also | ||
258 | * userspace) of their initial state. It should only be used before | ||
259 | * registration. | ||
260 | * | ||
261 | * In addition, it marks the device as "persistent", an attribute which | ||
262 | * can be read by userspace. Persistent devices are expected to preserve | ||
263 | * their own state when suspended. | ||
264 | */ | ||
265 | void rfkill_init_sw_state(struct rfkill *rfkill, bool blocked); | ||
266 | |||
267 | /** | ||
268 | * rfkill_set_states - Set the internal rfkill block states | ||
269 | * @rfkill: pointer to the rfkill class to modify. | ||
270 | * @sw: the current software block state to set | ||
271 | * @hw: the current hardware block state to set | ||
272 | * | ||
273 | * This function can be called in any context, even from within rfkill | ||
274 | * callbacks. | ||
275 | */ | ||
276 | void rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw); | ||
123 | 277 | ||
124 | /** | 278 | /** |
125 | * rfkill_state_complement - return complementar state | 279 | * rfkill_blocked - query rfkill block |
126 | * @state: state to return the complement of | ||
127 | * | 280 | * |
128 | * Returns RFKILL_STATE_SOFT_BLOCKED if @state is RFKILL_STATE_UNBLOCKED, | 281 | * @rfkill: rfkill struct to query |
129 | * returns RFKILL_STATE_UNBLOCKED otherwise. | ||
130 | */ | 282 | */ |
131 | static inline enum rfkill_state rfkill_state_complement(enum rfkill_state state) | 283 | bool rfkill_blocked(struct rfkill *rfkill); |
284 | #else /* !RFKILL */ | ||
285 | static inline struct rfkill * __must_check | ||
286 | rfkill_alloc(const char *name, | ||
287 | struct device *parent, | ||
288 | const enum rfkill_type type, | ||
289 | const struct rfkill_ops *ops, | ||
290 | void *ops_data) | ||
291 | { | ||
292 | return ERR_PTR(-ENODEV); | ||
293 | } | ||
294 | |||
295 | static inline int __must_check rfkill_register(struct rfkill *rfkill) | ||
296 | { | ||
297 | if (rfkill == ERR_PTR(-ENODEV)) | ||
298 | return 0; | ||
299 | return -EINVAL; | ||
300 | } | ||
301 | |||
302 | static inline void rfkill_pause_polling(struct rfkill *rfkill) | ||
303 | { | ||
304 | } | ||
305 | |||
306 | static inline void rfkill_resume_polling(struct rfkill *rfkill) | ||
307 | { | ||
308 | } | ||
309 | |||
310 | static inline void rfkill_unregister(struct rfkill *rfkill) | ||
311 | { | ||
312 | } | ||
313 | |||
314 | static inline void rfkill_destroy(struct rfkill *rfkill) | ||
132 | { | 315 | { |
133 | return (state == RFKILL_STATE_UNBLOCKED) ? | ||
134 | RFKILL_STATE_SOFT_BLOCKED : RFKILL_STATE_UNBLOCKED; | ||
135 | } | 316 | } |
136 | 317 | ||
318 | static inline bool rfkill_set_hw_state(struct rfkill *rfkill, bool blocked) | ||
319 | { | ||
320 | return blocked; | ||
321 | } | ||
322 | |||
323 | static inline bool rfkill_set_sw_state(struct rfkill *rfkill, bool blocked) | ||
324 | { | ||
325 | return blocked; | ||
326 | } | ||
327 | |||
328 | static inline void rfkill_init_sw_state(struct rfkill *rfkill, bool blocked) | ||
329 | { | ||
330 | } | ||
331 | |||
332 | static inline void rfkill_set_states(struct rfkill *rfkill, bool sw, bool hw) | ||
333 | { | ||
334 | } | ||
335 | |||
336 | static inline bool rfkill_blocked(struct rfkill *rfkill) | ||
337 | { | ||
338 | return false; | ||
339 | } | ||
340 | #endif /* RFKILL || RFKILL_MODULE */ | ||
341 | |||
342 | |||
343 | #ifdef CONFIG_RFKILL_LEDS | ||
137 | /** | 344 | /** |
138 | * rfkill_get_led_name - Get the LED trigger name for the button's LED. | 345 | * rfkill_get_led_trigger_name - Get the LED trigger name for the button's LED. |
139 | * This function might return a NULL pointer if registering of the | 346 | * This function might return a NULL pointer if registering of the |
140 | * LED trigger failed. | 347 | * LED trigger failed. Use this as "default_trigger" for the LED. |
141 | * Use this as "default_trigger" for the LED. | ||
142 | */ | 348 | */ |
143 | static inline char *rfkill_get_led_name(struct rfkill *rfkill) | 349 | const char *rfkill_get_led_trigger_name(struct rfkill *rfkill); |
144 | { | 350 | |
145 | #ifdef CONFIG_RFKILL_LEDS | 351 | /** |
146 | return (char *)(rfkill->led_trigger.name); | 352 | * rfkill_set_led_trigger_name -- set the LED trigger name |
353 | * @rfkill: rfkill struct | ||
354 | * @name: LED trigger name | ||
355 | * | ||
356 | * This function sets the LED trigger name of the radio LED | ||
357 | * trigger that rfkill creates. It is optional, but if called | ||
358 | * must be called before rfkill_register() to be effective. | ||
359 | */ | ||
360 | void rfkill_set_led_trigger_name(struct rfkill *rfkill, const char *name); | ||
147 | #else | 361 | #else |
362 | static inline const char *rfkill_get_led_trigger_name(struct rfkill *rfkill) | ||
363 | { | ||
148 | return NULL; | 364 | return NULL; |
149 | #endif | ||
150 | } | 365 | } |
151 | 366 | ||
367 | static inline void | ||
368 | rfkill_set_led_trigger_name(struct rfkill *rfkill, const char *name) | ||
369 | { | ||
370 | } | ||
371 | #endif | ||
372 | |||
373 | #endif /* __KERNEL__ */ | ||
374 | |||
152 | #endif /* RFKILL_H */ | 375 | #endif /* RFKILL_H */ |
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h index 8670f1575fe1..29f8599e6bea 100644 --- a/include/linux/ring_buffer.h +++ b/include/linux/ring_buffer.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _LINUX_RING_BUFFER_H | 1 | #ifndef _LINUX_RING_BUFFER_H |
2 | #define _LINUX_RING_BUFFER_H | 2 | #define _LINUX_RING_BUFFER_H |
3 | 3 | ||
4 | #include <linux/kmemcheck.h> | ||
4 | #include <linux/mm.h> | 5 | #include <linux/mm.h> |
5 | #include <linux/seq_file.h> | 6 | #include <linux/seq_file.h> |
6 | 7 | ||
@@ -11,7 +12,10 @@ struct ring_buffer_iter; | |||
11 | * Don't refer to this struct directly, use functions below. | 12 | * Don't refer to this struct directly, use functions below. |
12 | */ | 13 | */ |
13 | struct ring_buffer_event { | 14 | struct ring_buffer_event { |
15 | kmemcheck_bitfield_begin(bitfield); | ||
14 | u32 type_len:5, time_delta:27; | 16 | u32 type_len:5, time_delta:27; |
17 | kmemcheck_bitfield_end(bitfield); | ||
18 | |||
15 | u32 array[]; | 19 | u32 array[]; |
16 | }; | 20 | }; |
17 | 21 | ||
diff --git a/include/linux/rmap.h b/include/linux/rmap.h index b35bc0e19cd9..bf116d0dbf23 100644 --- a/include/linux/rmap.h +++ b/include/linux/rmap.h | |||
@@ -83,7 +83,8 @@ static inline void page_dup_rmap(struct page *page, struct vm_area_struct *vma, | |||
83 | /* | 83 | /* |
84 | * Called from mm/vmscan.c to handle paging out | 84 | * Called from mm/vmscan.c to handle paging out |
85 | */ | 85 | */ |
86 | int page_referenced(struct page *, int is_locked, struct mem_cgroup *cnt); | 86 | int page_referenced(struct page *, int is_locked, |
87 | struct mem_cgroup *cnt, unsigned long *vm_flags); | ||
87 | int try_to_unmap(struct page *, int ignore_refs); | 88 | int try_to_unmap(struct page *, int ignore_refs); |
88 | 89 | ||
89 | /* | 90 | /* |
@@ -105,18 +106,11 @@ unsigned long page_address_in_vma(struct page *, struct vm_area_struct *); | |||
105 | */ | 106 | */ |
106 | int page_mkclean(struct page *); | 107 | int page_mkclean(struct page *); |
107 | 108 | ||
108 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
109 | /* | 109 | /* |
110 | * called in munlock()/munmap() path to check for other vmas holding | 110 | * called in munlock()/munmap() path to check for other vmas holding |
111 | * the page mlocked. | 111 | * the page mlocked. |
112 | */ | 112 | */ |
113 | int try_to_munlock(struct page *); | 113 | int try_to_munlock(struct page *); |
114 | #else | ||
115 | static inline int try_to_munlock(struct page *page) | ||
116 | { | ||
117 | return 0; /* a.k.a. SWAP_SUCCESS */ | ||
118 | } | ||
119 | #endif | ||
120 | 114 | ||
121 | #else /* !CONFIG_MMU */ | 115 | #else /* !CONFIG_MMU */ |
122 | 116 | ||
@@ -124,7 +118,14 @@ static inline int try_to_munlock(struct page *page) | |||
124 | #define anon_vma_prepare(vma) (0) | 118 | #define anon_vma_prepare(vma) (0) |
125 | #define anon_vma_link(vma) do {} while (0) | 119 | #define anon_vma_link(vma) do {} while (0) |
126 | 120 | ||
127 | #define page_referenced(page,l,cnt) TestClearPageReferenced(page) | 121 | static inline int page_referenced(struct page *page, int is_locked, |
122 | struct mem_cgroup *cnt, | ||
123 | unsigned long *vm_flags) | ||
124 | { | ||
125 | *vm_flags = 0; | ||
126 | return TestClearPageReferenced(page); | ||
127 | } | ||
128 | |||
128 | #define try_to_unmap(page, refs) SWAP_FAIL | 129 | #define try_to_unmap(page, refs) SWAP_FAIL |
129 | 130 | ||
130 | static inline int page_mkclean(struct page *page) | 131 | static inline int page_mkclean(struct page *page) |
diff --git a/include/linux/rotary_encoder.h b/include/linux/rotary_encoder.h index 12d63a30c347..215278b8df2a 100644 --- a/include/linux/rotary_encoder.h +++ b/include/linux/rotary_encoder.h | |||
@@ -8,6 +8,8 @@ struct rotary_encoder_platform_data { | |||
8 | unsigned int gpio_b; | 8 | unsigned int gpio_b; |
9 | unsigned int inverted_a; | 9 | unsigned int inverted_a; |
10 | unsigned int inverted_b; | 10 | unsigned int inverted_b; |
11 | bool relative_axis; | ||
12 | bool rollover; | ||
11 | }; | 13 | }; |
12 | 14 | ||
13 | #endif /* __ROTARY_ENCODER_H__ */ | 15 | #endif /* __ROTARY_ENCODER_H__ */ |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 4896fdfec913..3ab08e4bb6b8 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -92,7 +92,6 @@ struct sched_param { | |||
92 | 92 | ||
93 | #include <asm/processor.h> | 93 | #include <asm/processor.h> |
94 | 94 | ||
95 | struct mem_cgroup; | ||
96 | struct exec_domain; | 95 | struct exec_domain; |
97 | struct futex_pi_state; | 96 | struct futex_pi_state; |
98 | struct robust_list_head; | 97 | struct robust_list_head; |
@@ -210,7 +209,7 @@ extern unsigned long long time_sync_thresh; | |||
210 | ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) | 209 | ((task->state & (__TASK_STOPPED | __TASK_TRACED)) != 0) |
211 | #define task_contributes_to_load(task) \ | 210 | #define task_contributes_to_load(task) \ |
212 | ((task->state & TASK_UNINTERRUPTIBLE) != 0 && \ | 211 | ((task->state & TASK_UNINTERRUPTIBLE) != 0 && \ |
213 | (task->flags & PF_FROZEN) == 0) | 212 | (task->flags & PF_FREEZING) == 0) |
214 | 213 | ||
215 | #define __set_task_state(tsk, state_value) \ | 214 | #define __set_task_state(tsk, state_value) \ |
216 | do { (tsk)->state = (state_value); } while (0) | 215 | do { (tsk)->state = (state_value); } while (0) |
@@ -261,6 +260,7 @@ extern void task_rq_unlock_wait(struct task_struct *p); | |||
261 | extern cpumask_var_t nohz_cpu_mask; | 260 | extern cpumask_var_t nohz_cpu_mask; |
262 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) | 261 | #if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) |
263 | extern int select_nohz_load_balancer(int cpu); | 262 | extern int select_nohz_load_balancer(int cpu); |
263 | extern int get_nohz_load_balancer(void); | ||
264 | #else | 264 | #else |
265 | static inline int select_nohz_load_balancer(int cpu) | 265 | static inline int select_nohz_load_balancer(int cpu) |
266 | { | 266 | { |
@@ -349,8 +349,20 @@ extern int mutex_spin_on_owner(struct mutex *lock, struct thread_info *owner); | |||
349 | struct nsproxy; | 349 | struct nsproxy; |
350 | struct user_namespace; | 350 | struct user_namespace; |
351 | 351 | ||
352 | /* Maximum number of active map areas.. This is a random (large) number */ | 352 | /* |
353 | #define DEFAULT_MAX_MAP_COUNT 65536 | 353 | * Default maximum number of active map areas, this limits the number of vmas |
354 | * per mm struct. Users can overwrite this number by sysctl but there is a | ||
355 | * problem. | ||
356 | * | ||
357 | * When a program's coredump is generated as ELF format, a section is created | ||
358 | * per a vma. In ELF, the number of sections is represented in unsigned short. | ||
359 | * This means the number of sections should be smaller than 65535 at coredump. | ||
360 | * Because the kernel adds some informative sections to a image of program at | ||
361 | * generating coredump, we need some margin. The number of extra sections is | ||
362 | * 1-3 now and depends on arch. We use "5" as safe margin, here. | ||
363 | */ | ||
364 | #define MAPCOUNT_ELF_CORE_MARGIN (5) | ||
365 | #define DEFAULT_MAX_MAP_COUNT (USHORT_MAX - MAPCOUNT_ELF_CORE_MARGIN) | ||
354 | 366 | ||
355 | extern int sysctl_max_map_count; | 367 | extern int sysctl_max_map_count; |
356 | 368 | ||
@@ -486,6 +498,15 @@ struct task_cputime { | |||
486 | .sum_exec_runtime = 0, \ | 498 | .sum_exec_runtime = 0, \ |
487 | } | 499 | } |
488 | 500 | ||
501 | /* | ||
502 | * Disable preemption until the scheduler is running. | ||
503 | * Reset by start_kernel()->sched_init()->init_idle(). | ||
504 | * | ||
505 | * We include PREEMPT_ACTIVE to avoid cond_resched() from working | ||
506 | * before the scheduler is active -- see should_resched(). | ||
507 | */ | ||
508 | #define INIT_PREEMPT_COUNT (1 + PREEMPT_ACTIVE) | ||
509 | |||
489 | /** | 510 | /** |
490 | * struct thread_group_cputimer - thread group interval timer counts | 511 | * struct thread_group_cputimer - thread group interval timer counts |
491 | * @cputime: thread group interval timers. | 512 | * @cputime: thread group interval timers. |
@@ -673,7 +694,7 @@ struct user_struct { | |||
673 | struct task_group *tg; | 694 | struct task_group *tg; |
674 | #ifdef CONFIG_SYSFS | 695 | #ifdef CONFIG_SYSFS |
675 | struct kobject kobj; | 696 | struct kobject kobj; |
676 | struct work_struct work; | 697 | struct delayed_work work; |
677 | #endif | 698 | #endif |
678 | #endif | 699 | #endif |
679 | 700 | ||
@@ -1177,7 +1198,6 @@ struct task_struct { | |||
1177 | * a short time | 1198 | * a short time |
1178 | */ | 1199 | */ |
1179 | unsigned char fpu_counter; | 1200 | unsigned char fpu_counter; |
1180 | s8 oomkilladj; /* OOM kill score adjustment (bit shift). */ | ||
1181 | #ifdef CONFIG_BLK_DEV_IO_TRACE | 1201 | #ifdef CONFIG_BLK_DEV_IO_TRACE |
1182 | unsigned int btrace_seq; | 1202 | unsigned int btrace_seq; |
1183 | #endif | 1203 | #endif |
@@ -1317,7 +1337,8 @@ struct task_struct { | |||
1317 | /* Thread group tracking */ | 1337 | /* Thread group tracking */ |
1318 | u32 parent_exec_id; | 1338 | u32 parent_exec_id; |
1319 | u32 self_exec_id; | 1339 | u32 self_exec_id; |
1320 | /* Protection of (de-)allocation: mm, files, fs, tty, keyrings */ | 1340 | /* Protection of (de-)allocation: mm, files, fs, tty, keyrings, mems_allowed, |
1341 | * mempolicy */ | ||
1321 | spinlock_t alloc_lock; | 1342 | spinlock_t alloc_lock; |
1322 | 1343 | ||
1323 | #ifdef CONFIG_GENERIC_HARDIRQS | 1344 | #ifdef CONFIG_GENERIC_HARDIRQS |
@@ -1385,8 +1406,7 @@ struct task_struct { | |||
1385 | cputime_t acct_timexpd; /* stime + utime since last update */ | 1406 | cputime_t acct_timexpd; /* stime + utime since last update */ |
1386 | #endif | 1407 | #endif |
1387 | #ifdef CONFIG_CPUSETS | 1408 | #ifdef CONFIG_CPUSETS |
1388 | nodemask_t mems_allowed; | 1409 | nodemask_t mems_allowed; /* Protected by alloc_lock */ |
1389 | int cpuset_mems_generation; | ||
1390 | int cpuset_mem_spread_rotor; | 1410 | int cpuset_mem_spread_rotor; |
1391 | #endif | 1411 | #endif |
1392 | #ifdef CONFIG_CGROUPS | 1412 | #ifdef CONFIG_CGROUPS |
@@ -1409,7 +1429,7 @@ struct task_struct { | |||
1409 | struct list_head perf_counter_list; | 1429 | struct list_head perf_counter_list; |
1410 | #endif | 1430 | #endif |
1411 | #ifdef CONFIG_NUMA | 1431 | #ifdef CONFIG_NUMA |
1412 | struct mempolicy *mempolicy; | 1432 | struct mempolicy *mempolicy; /* Protected by alloc_lock */ |
1413 | short il_next; | 1433 | short il_next; |
1414 | #endif | 1434 | #endif |
1415 | atomic_t fs_excl; /* holding fs exclusive resources */ | 1435 | atomic_t fs_excl; /* holding fs exclusive resources */ |
@@ -1660,6 +1680,7 @@ extern cputime_t task_gtime(struct task_struct *p); | |||
1660 | #define PF_MEMALLOC 0x00000800 /* Allocating memory */ | 1680 | #define PF_MEMALLOC 0x00000800 /* Allocating memory */ |
1661 | #define PF_FLUSHER 0x00001000 /* responsible for disk writeback */ | 1681 | #define PF_FLUSHER 0x00001000 /* responsible for disk writeback */ |
1662 | #define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */ | 1682 | #define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */ |
1683 | #define PF_FREEZING 0x00004000 /* freeze in progress. do not account to load */ | ||
1663 | #define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ | 1684 | #define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ |
1664 | #define PF_FROZEN 0x00010000 /* frozen for system suspend */ | 1685 | #define PF_FROZEN 0x00010000 /* frozen for system suspend */ |
1665 | #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ | 1686 | #define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */ |
@@ -1796,11 +1817,23 @@ extern unsigned int sysctl_sched_child_runs_first; | |||
1796 | extern unsigned int sysctl_sched_features; | 1817 | extern unsigned int sysctl_sched_features; |
1797 | extern unsigned int sysctl_sched_migration_cost; | 1818 | extern unsigned int sysctl_sched_migration_cost; |
1798 | extern unsigned int sysctl_sched_nr_migrate; | 1819 | extern unsigned int sysctl_sched_nr_migrate; |
1820 | extern unsigned int sysctl_timer_migration; | ||
1799 | 1821 | ||
1800 | int sched_nr_latency_handler(struct ctl_table *table, int write, | 1822 | int sched_nr_latency_handler(struct ctl_table *table, int write, |
1801 | struct file *file, void __user *buffer, size_t *length, | 1823 | struct file *file, void __user *buffer, size_t *length, |
1802 | loff_t *ppos); | 1824 | loff_t *ppos); |
1803 | #endif | 1825 | #endif |
1826 | #ifdef CONFIG_SCHED_DEBUG | ||
1827 | static inline unsigned int get_sysctl_timer_migration(void) | ||
1828 | { | ||
1829 | return sysctl_timer_migration; | ||
1830 | } | ||
1831 | #else | ||
1832 | static inline unsigned int get_sysctl_timer_migration(void) | ||
1833 | { | ||
1834 | return 1; | ||
1835 | } | ||
1836 | #endif | ||
1804 | extern unsigned int sysctl_sched_rt_period; | 1837 | extern unsigned int sysctl_sched_rt_period; |
1805 | extern int sysctl_sched_rt_runtime; | 1838 | extern int sysctl_sched_rt_runtime; |
1806 | 1839 | ||
@@ -1867,9 +1900,6 @@ extern struct pid_namespace init_pid_ns; | |||
1867 | /* | 1900 | /* |
1868 | * find a task by one of its numerical ids | 1901 | * find a task by one of its numerical ids |
1869 | * | 1902 | * |
1870 | * find_task_by_pid_type_ns(): | ||
1871 | * it is the most generic call - it finds a task by all id, | ||
1872 | * type and namespace specified | ||
1873 | * find_task_by_pid_ns(): | 1903 | * find_task_by_pid_ns(): |
1874 | * finds a task by its pid in the specified namespace | 1904 | * finds a task by its pid in the specified namespace |
1875 | * find_task_by_vpid(): | 1905 | * find_task_by_vpid(): |
@@ -1878,9 +1908,6 @@ extern struct pid_namespace init_pid_ns; | |||
1878 | * see also find_vpid() etc in include/linux/pid.h | 1908 | * see also find_vpid() etc in include/linux/pid.h |
1879 | */ | 1909 | */ |
1880 | 1910 | ||
1881 | extern struct task_struct *find_task_by_pid_type_ns(int type, int pid, | ||
1882 | struct pid_namespace *ns); | ||
1883 | |||
1884 | extern struct task_struct *find_task_by_vpid(pid_t nr); | 1911 | extern struct task_struct *find_task_by_vpid(pid_t nr); |
1885 | extern struct task_struct *find_task_by_pid_ns(pid_t nr, | 1912 | extern struct task_struct *find_task_by_pid_ns(pid_t nr, |
1886 | struct pid_namespace *ns); | 1913 | struct pid_namespace *ns); |
@@ -2212,6 +2239,12 @@ static inline int test_tsk_need_resched(struct task_struct *tsk) | |||
2212 | return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED)); | 2239 | return unlikely(test_tsk_thread_flag(tsk,TIF_NEED_RESCHED)); |
2213 | } | 2240 | } |
2214 | 2241 | ||
2242 | static inline int restart_syscall(void) | ||
2243 | { | ||
2244 | set_tsk_thread_flag(current, TIF_SIGPENDING); | ||
2245 | return -ERESTARTNOINTR; | ||
2246 | } | ||
2247 | |||
2215 | static inline int signal_pending(struct task_struct *p) | 2248 | static inline int signal_pending(struct task_struct *p) |
2216 | { | 2249 | { |
2217 | return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING)); | 2250 | return unlikely(test_tsk_thread_flag(p,TIF_SIGPENDING)); |
diff --git a/include/linux/sctp.h b/include/linux/sctp.h index c2731bfe04d8..b464b9d3d242 100644 --- a/include/linux/sctp.h +++ b/include/linux/sctp.h | |||
@@ -487,17 +487,17 @@ typedef enum { | |||
487 | * | 487 | * |
488 | * Value Cause Code | 488 | * Value Cause Code |
489 | * --------- ---------------- | 489 | * --------- ---------------- |
490 | * 0x0100 Request to Delete Last Remaining IP Address. | 490 | * 0x00A0 Request to Delete Last Remaining IP Address. |
491 | * 0x0101 Operation Refused Due to Resource Shortage. | 491 | * 0x00A1 Operation Refused Due to Resource Shortage. |
492 | * 0x0102 Request to Delete Source IP Address. | 492 | * 0x00A2 Request to Delete Source IP Address. |
493 | * 0x0103 Association Aborted due to illegal ASCONF-ACK | 493 | * 0x00A3 Association Aborted due to illegal ASCONF-ACK |
494 | * 0x0104 Request refused - no authorization. | 494 | * 0x00A4 Request refused - no authorization. |
495 | */ | 495 | */ |
496 | SCTP_ERROR_DEL_LAST_IP = cpu_to_be16(0x0100), | 496 | SCTP_ERROR_DEL_LAST_IP = cpu_to_be16(0x00A0), |
497 | SCTP_ERROR_RSRC_LOW = cpu_to_be16(0x0101), | 497 | SCTP_ERROR_RSRC_LOW = cpu_to_be16(0x00A1), |
498 | SCTP_ERROR_DEL_SRC_IP = cpu_to_be16(0x0102), | 498 | SCTP_ERROR_DEL_SRC_IP = cpu_to_be16(0x00A2), |
499 | SCTP_ERROR_ASCONF_ACK = cpu_to_be16(0x0103), | 499 | SCTP_ERROR_ASCONF_ACK = cpu_to_be16(0x00A3), |
500 | SCTP_ERROR_REQ_REFUSED = cpu_to_be16(0x0104), | 500 | SCTP_ERROR_REQ_REFUSED = cpu_to_be16(0x00A4), |
501 | 501 | ||
502 | /* AUTH Section 4. New Error Cause | 502 | /* AUTH Section 4. New Error Cause |
503 | * | 503 | * |
diff --git a/include/linux/section-names.h b/include/linux/section-names.h deleted file mode 100644 index c956f4eb2adf..000000000000 --- a/include/linux/section-names.h +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #ifndef __LINUX_SECTION_NAMES_H | ||
2 | #define __LINUX_SECTION_NAMES_H | ||
3 | |||
4 | #define HEAD_TEXT_SECTION .head.text | ||
5 | |||
6 | #endif /* !__LINUX_SECTION_NAMES_H */ | ||
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h index 004f3b3342c5..0c6a86b79596 100644 --- a/include/linux/seq_file.h +++ b/include/linux/seq_file.h | |||
@@ -43,6 +43,7 @@ int seq_release(struct inode *, struct file *); | |||
43 | int seq_escape(struct seq_file *, const char *, const char *); | 43 | int seq_escape(struct seq_file *, const char *, const char *); |
44 | int seq_putc(struct seq_file *m, char c); | 44 | int seq_putc(struct seq_file *m, char c); |
45 | int seq_puts(struct seq_file *m, const char *s); | 45 | int seq_puts(struct seq_file *m, const char *s); |
46 | int seq_write(struct seq_file *seq, const void *data, size_t len); | ||
46 | 47 | ||
47 | int seq_printf(struct seq_file *, const char *, ...) | 48 | int seq_printf(struct seq_file *, const char *, ...) |
48 | __attribute__ ((format (printf,2,3))); | 49 | __attribute__ ((format (printf,2,3))); |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 6fd80c4243f1..23d2fb051f97 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -171,6 +171,9 @@ | |||
171 | /* Timberdale UART */ | 171 | /* Timberdale UART */ |
172 | #define PORT_TIMBUART 87 | 172 | #define PORT_TIMBUART 87 |
173 | 173 | ||
174 | /* Qualcomm MSM SoCs */ | ||
175 | #define PORT_MSM 88 | ||
176 | |||
174 | #ifdef __KERNEL__ | 177 | #ifdef __KERNEL__ |
175 | 178 | ||
176 | #include <linux/compiler.h> | 179 | #include <linux/compiler.h> |
diff --git a/include/linux/serial_reg.h b/include/linux/serial_reg.h index 96c0d93fc2ca..850db2e80510 100644 --- a/include/linux/serial_reg.h +++ b/include/linux/serial_reg.h | |||
@@ -323,6 +323,7 @@ | |||
323 | #define UART_OMAP_MVER 0x14 /* Module version register */ | 323 | #define UART_OMAP_MVER 0x14 /* Module version register */ |
324 | #define UART_OMAP_SYSC 0x15 /* System configuration register */ | 324 | #define UART_OMAP_SYSC 0x15 /* System configuration register */ |
325 | #define UART_OMAP_SYSS 0x16 /* System status register */ | 325 | #define UART_OMAP_SYSS 0x16 /* System status register */ |
326 | #define UART_OMAP_WER 0x17 /* Wake-up enable register */ | ||
326 | 327 | ||
327 | #endif /* _LINUX_SERIAL_REG_H */ | 328 | #endif /* _LINUX_SERIAL_REG_H */ |
328 | 329 | ||
diff --git a/include/linux/serio.h b/include/linux/serio.h index e0417e4d3f15..126d24c9eaa8 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h | |||
@@ -15,6 +15,7 @@ | |||
15 | 15 | ||
16 | #ifdef __KERNEL__ | 16 | #ifdef __KERNEL__ |
17 | 17 | ||
18 | #include <linux/types.h> | ||
18 | #include <linux/interrupt.h> | 19 | #include <linux/interrupt.h> |
19 | #include <linux/list.h> | 20 | #include <linux/list.h> |
20 | #include <linux/spinlock.h> | 21 | #include <linux/spinlock.h> |
@@ -28,7 +29,10 @@ struct serio { | |||
28 | char name[32]; | 29 | char name[32]; |
29 | char phys[32]; | 30 | char phys[32]; |
30 | 31 | ||
31 | unsigned int manual_bind; | 32 | bool manual_bind; |
33 | bool registered; /* port has been fully registered with driver core */ | ||
34 | bool suspended; /* port is suspended */ | ||
35 | |||
32 | 36 | ||
33 | struct serio_device_id id; | 37 | struct serio_device_id id; |
34 | 38 | ||
@@ -47,7 +51,6 @@ struct serio { | |||
47 | struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */ | 51 | struct mutex drv_mutex; /* protects serio->drv so attributes can pin driver */ |
48 | 52 | ||
49 | struct device dev; | 53 | struct device dev; |
50 | unsigned int registered; /* port has been fully registered with driver core */ | ||
51 | 54 | ||
52 | struct list_head node; | 55 | struct list_head node; |
53 | }; | 56 | }; |
@@ -58,7 +61,7 @@ struct serio_driver { | |||
58 | char *description; | 61 | char *description; |
59 | 62 | ||
60 | struct serio_device_id *id_table; | 63 | struct serio_device_id *id_table; |
61 | unsigned int manual_bind; | 64 | bool manual_bind; |
62 | 65 | ||
63 | void (*write_wakeup)(struct serio *); | 66 | void (*write_wakeup)(struct serio *); |
64 | irqreturn_t (*interrupt)(struct serio *, unsigned char, unsigned int); | 67 | irqreturn_t (*interrupt)(struct serio *, unsigned char, unsigned int); |
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index fd83f2584b15..abff6c9b413c 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h | |||
@@ -19,10 +19,6 @@ struct shmem_inode_info { | |||
19 | swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* first blocks */ | 19 | swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* first blocks */ |
20 | struct list_head swaplist; /* chain of maybes on swap */ | 20 | struct list_head swaplist; /* chain of maybes on swap */ |
21 | struct inode vfs_inode; | 21 | struct inode vfs_inode; |
22 | #ifdef CONFIG_TMPFS_POSIX_ACL | ||
23 | struct posix_acl *i_acl; | ||
24 | struct posix_acl *i_default_acl; | ||
25 | #endif | ||
26 | }; | 22 | }; |
27 | 23 | ||
28 | struct shmem_sb_info { | 24 | struct shmem_sb_info { |
@@ -45,7 +41,6 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode) | |||
45 | #ifdef CONFIG_TMPFS_POSIX_ACL | 41 | #ifdef CONFIG_TMPFS_POSIX_ACL |
46 | int shmem_permission(struct inode *, int); | 42 | int shmem_permission(struct inode *, int); |
47 | int shmem_acl_init(struct inode *, struct inode *); | 43 | int shmem_acl_init(struct inode *, struct inode *); |
48 | void shmem_acl_destroy_inode(struct inode *); | ||
49 | 44 | ||
50 | extern struct xattr_handler shmem_xattr_acl_access_handler; | 45 | extern struct xattr_handler shmem_xattr_acl_access_handler; |
51 | extern struct xattr_handler shmem_xattr_acl_default_handler; | 46 | extern struct xattr_handler shmem_xattr_acl_default_handler; |
@@ -57,9 +52,6 @@ static inline int shmem_acl_init(struct inode *inode, struct inode *dir) | |||
57 | { | 52 | { |
58 | return 0; | 53 | return 0; |
59 | } | 54 | } |
60 | static inline void shmem_acl_destroy_inode(struct inode *inode) | ||
61 | { | ||
62 | } | ||
63 | #endif /* CONFIG_TMPFS_POSIX_ACL */ | 55 | #endif /* CONFIG_TMPFS_POSIX_ACL */ |
64 | 56 | ||
65 | #endif | 57 | #endif |
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 5fd389162f01..f2c69a2cca17 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #define _LINUX_SKBUFF_H | 15 | #define _LINUX_SKBUFF_H |
16 | 16 | ||
17 | #include <linux/kernel.h> | 17 | #include <linux/kernel.h> |
18 | #include <linux/kmemcheck.h> | ||
18 | #include <linux/compiler.h> | 19 | #include <linux/compiler.h> |
19 | #include <linux/time.h> | 20 | #include <linux/time.h> |
20 | #include <linux/cache.h> | 21 | #include <linux/cache.h> |
@@ -189,20 +190,23 @@ struct skb_shared_info { | |||
189 | atomic_t dataref; | 190 | atomic_t dataref; |
190 | unsigned short nr_frags; | 191 | unsigned short nr_frags; |
191 | unsigned short gso_size; | 192 | unsigned short gso_size; |
193 | #ifdef CONFIG_HAS_DMA | ||
194 | dma_addr_t dma_head; | ||
195 | #endif | ||
192 | /* Warning: this field is not always filled in (UFO)! */ | 196 | /* Warning: this field is not always filled in (UFO)! */ |
193 | unsigned short gso_segs; | 197 | unsigned short gso_segs; |
194 | unsigned short gso_type; | 198 | unsigned short gso_type; |
195 | __be32 ip6_frag_id; | 199 | __be32 ip6_frag_id; |
196 | union skb_shared_tx tx_flags; | 200 | union skb_shared_tx tx_flags; |
197 | #ifdef CONFIG_HAS_DMA | ||
198 | unsigned int num_dma_maps; | ||
199 | #endif | ||
200 | struct sk_buff *frag_list; | 201 | struct sk_buff *frag_list; |
201 | struct skb_shared_hwtstamps hwtstamps; | 202 | struct skb_shared_hwtstamps hwtstamps; |
202 | skb_frag_t frags[MAX_SKB_FRAGS]; | 203 | skb_frag_t frags[MAX_SKB_FRAGS]; |
203 | #ifdef CONFIG_HAS_DMA | 204 | #ifdef CONFIG_HAS_DMA |
204 | dma_addr_t dma_maps[MAX_SKB_FRAGS + 1]; | 205 | dma_addr_t dma_maps[MAX_SKB_FRAGS]; |
205 | #endif | 206 | #endif |
207 | /* Intermediate layers must ensure that destructor_arg | ||
208 | * remains valid until skb destructor */ | ||
209 | void * destructor_arg; | ||
206 | }; | 210 | }; |
207 | 211 | ||
208 | /* We divide dataref into two halves. The higher 16 bits hold references | 212 | /* We divide dataref into two halves. The higher 16 bits hold references |
@@ -261,7 +265,7 @@ typedef unsigned char *sk_buff_data_t; | |||
261 | * @transport_header: Transport layer header | 265 | * @transport_header: Transport layer header |
262 | * @network_header: Network layer header | 266 | * @network_header: Network layer header |
263 | * @mac_header: Link layer header | 267 | * @mac_header: Link layer header |
264 | * @dst: destination entry | 268 | * @_skb_dst: destination entry |
265 | * @sp: the security path, used for xfrm | 269 | * @sp: the security path, used for xfrm |
266 | * @cb: Control buffer. Free for use by every layer. Put private vars here | 270 | * @cb: Control buffer. Free for use by every layer. Put private vars here |
267 | * @len: Length of actual data | 271 | * @len: Length of actual data |
@@ -301,9 +305,6 @@ typedef unsigned char *sk_buff_data_t; | |||
301 | * @tc_verd: traffic control verdict | 305 | * @tc_verd: traffic control verdict |
302 | * @ndisc_nodetype: router type (from link layer) | 306 | * @ndisc_nodetype: router type (from link layer) |
303 | * @do_not_encrypt: set to prevent encryption of this frame | 307 | * @do_not_encrypt: set to prevent encryption of this frame |
304 | * @requeue: set to indicate that the wireless core should attempt | ||
305 | * a software retry on this frame if we failed to | ||
306 | * receive an ACK for it | ||
307 | * @dma_cookie: a cookie to one of several possible DMA operations | 308 | * @dma_cookie: a cookie to one of several possible DMA operations |
308 | * done by skb DMA functions | 309 | * done by skb DMA functions |
309 | * @secmark: security marking | 310 | * @secmark: security marking |
@@ -319,10 +320,7 @@ struct sk_buff { | |||
319 | ktime_t tstamp; | 320 | ktime_t tstamp; |
320 | struct net_device *dev; | 321 | struct net_device *dev; |
321 | 322 | ||
322 | union { | 323 | unsigned long _skb_dst; |
323 | struct dst_entry *dst; | ||
324 | struct rtable *rtable; | ||
325 | }; | ||
326 | #ifdef CONFIG_XFRM | 324 | #ifdef CONFIG_XFRM |
327 | struct sec_path *sp; | 325 | struct sec_path *sp; |
328 | #endif | 326 | #endif |
@@ -346,6 +344,7 @@ struct sk_buff { | |||
346 | }; | 344 | }; |
347 | }; | 345 | }; |
348 | __u32 priority; | 346 | __u32 priority; |
347 | kmemcheck_bitfield_begin(flags1); | ||
349 | __u8 local_df:1, | 348 | __u8 local_df:1, |
350 | cloned:1, | 349 | cloned:1, |
351 | ip_summed:2, | 350 | ip_summed:2, |
@@ -356,6 +355,7 @@ struct sk_buff { | |||
356 | ipvs_property:1, | 355 | ipvs_property:1, |
357 | peeked:1, | 356 | peeked:1, |
358 | nf_trace:1; | 357 | nf_trace:1; |
358 | kmemcheck_bitfield_end(flags1); | ||
359 | __be16 protocol; | 359 | __be16 protocol; |
360 | 360 | ||
361 | void (*destructor)(struct sk_buff *skb); | 361 | void (*destructor)(struct sk_buff *skb); |
@@ -375,13 +375,16 @@ struct sk_buff { | |||
375 | __u16 tc_verd; /* traffic control verdict */ | 375 | __u16 tc_verd; /* traffic control verdict */ |
376 | #endif | 376 | #endif |
377 | #endif | 377 | #endif |
378 | |||
379 | kmemcheck_bitfield_begin(flags2); | ||
378 | #ifdef CONFIG_IPV6_NDISC_NODETYPE | 380 | #ifdef CONFIG_IPV6_NDISC_NODETYPE |
379 | __u8 ndisc_nodetype:2; | 381 | __u8 ndisc_nodetype:2; |
380 | #endif | 382 | #endif |
381 | #if defined(CONFIG_MAC80211) || defined(CONFIG_MAC80211_MODULE) | 383 | #if defined(CONFIG_MAC80211) || defined(CONFIG_MAC80211_MODULE) |
382 | __u8 do_not_encrypt:1; | 384 | __u8 do_not_encrypt:1; |
383 | __u8 requeue:1; | ||
384 | #endif | 385 | #endif |
386 | kmemcheck_bitfield_end(flags2); | ||
387 | |||
385 | /* 0/13/14 bit hole */ | 388 | /* 0/13/14 bit hole */ |
386 | 389 | ||
387 | #ifdef CONFIG_NET_DMA | 390 | #ifdef CONFIG_NET_DMA |
@@ -423,6 +426,21 @@ extern void skb_dma_unmap(struct device *dev, struct sk_buff *skb, | |||
423 | enum dma_data_direction dir); | 426 | enum dma_data_direction dir); |
424 | #endif | 427 | #endif |
425 | 428 | ||
429 | static inline struct dst_entry *skb_dst(const struct sk_buff *skb) | ||
430 | { | ||
431 | return (struct dst_entry *)skb->_skb_dst; | ||
432 | } | ||
433 | |||
434 | static inline void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst) | ||
435 | { | ||
436 | skb->_skb_dst = (unsigned long)dst; | ||
437 | } | ||
438 | |||
439 | static inline struct rtable *skb_rtable(const struct sk_buff *skb) | ||
440 | { | ||
441 | return (struct rtable *)skb_dst(skb); | ||
442 | } | ||
443 | |||
426 | extern void kfree_skb(struct sk_buff *skb); | 444 | extern void kfree_skb(struct sk_buff *skb); |
427 | extern void consume_skb(struct sk_buff *skb); | 445 | extern void consume_skb(struct sk_buff *skb); |
428 | extern void __kfree_skb(struct sk_buff *skb); | 446 | extern void __kfree_skb(struct sk_buff *skb); |
@@ -1062,7 +1080,7 @@ extern void skb_add_rx_frag(struct sk_buff *skb, int i, struct page *page, | |||
1062 | int off, int size); | 1080 | int off, int size); |
1063 | 1081 | ||
1064 | #define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags) | 1082 | #define SKB_PAGE_ASSERT(skb) BUG_ON(skb_shinfo(skb)->nr_frags) |
1065 | #define SKB_FRAG_ASSERT(skb) BUG_ON(skb_shinfo(skb)->frag_list) | 1083 | #define SKB_FRAG_ASSERT(skb) BUG_ON(skb_has_frags(skb)) |
1066 | #define SKB_LINEAR_ASSERT(skb) BUG_ON(skb_is_nonlinear(skb)) | 1084 | #define SKB_LINEAR_ASSERT(skb) BUG_ON(skb_is_nonlinear(skb)) |
1067 | 1085 | ||
1068 | #ifdef NET_SKBUFF_DATA_USES_OFFSET | 1086 | #ifdef NET_SKBUFF_DATA_USES_OFFSET |
@@ -1324,12 +1342,12 @@ static inline int skb_network_offset(const struct sk_buff *skb) | |||
1324 | * shifting the start of the packet by 2 bytes. Drivers should do this | 1342 | * shifting the start of the packet by 2 bytes. Drivers should do this |
1325 | * with: | 1343 | * with: |
1326 | * | 1344 | * |
1327 | * skb_reserve(NET_IP_ALIGN); | 1345 | * skb_reserve(skb, NET_IP_ALIGN); |
1328 | * | 1346 | * |
1329 | * The downside to this alignment of the IP header is that the DMA is now | 1347 | * The downside to this alignment of the IP header is that the DMA is now |
1330 | * unaligned. On some architectures the cost of an unaligned DMA is high | 1348 | * unaligned. On some architectures the cost of an unaligned DMA is high |
1331 | * and this cost outweighs the gains made by aligning the IP header. | 1349 | * and this cost outweighs the gains made by aligning the IP header. |
1332 | * | 1350 | * |
1333 | * Since this trade off varies between architectures, we allow NET_IP_ALIGN | 1351 | * Since this trade off varies between architectures, we allow NET_IP_ALIGN |
1334 | * to be overridden. | 1352 | * to be overridden. |
1335 | */ | 1353 | */ |
@@ -1701,6 +1719,25 @@ static inline int pskb_trim_rcsum(struct sk_buff *skb, unsigned int len) | |||
1701 | skb = skb->prev) | 1719 | skb = skb->prev) |
1702 | 1720 | ||
1703 | 1721 | ||
1722 | static inline bool skb_has_frags(const struct sk_buff *skb) | ||
1723 | { | ||
1724 | return skb_shinfo(skb)->frag_list != NULL; | ||
1725 | } | ||
1726 | |||
1727 | static inline void skb_frag_list_init(struct sk_buff *skb) | ||
1728 | { | ||
1729 | skb_shinfo(skb)->frag_list = NULL; | ||
1730 | } | ||
1731 | |||
1732 | static inline void skb_frag_add_head(struct sk_buff *skb, struct sk_buff *frag) | ||
1733 | { | ||
1734 | frag->next = skb_shinfo(skb)->frag_list; | ||
1735 | skb_shinfo(skb)->frag_list = frag; | ||
1736 | } | ||
1737 | |||
1738 | #define skb_walk_frags(skb, iter) \ | ||
1739 | for (iter = skb_shinfo(skb)->frag_list; iter; iter = iter->next) | ||
1740 | |||
1704 | extern struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags, | 1741 | extern struct sk_buff *__skb_recv_datagram(struct sock *sk, unsigned flags, |
1705 | int *peeked, int *err); | 1742 | int *peeked, int *err); |
1706 | extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, | 1743 | extern struct sk_buff *skb_recv_datagram(struct sock *sk, unsigned flags, |
@@ -1715,8 +1752,14 @@ extern int skb_copy_and_csum_datagram_iovec(struct sk_buff *skb, | |||
1715 | struct iovec *iov); | 1752 | struct iovec *iov); |
1716 | extern int skb_copy_datagram_from_iovec(struct sk_buff *skb, | 1753 | extern int skb_copy_datagram_from_iovec(struct sk_buff *skb, |
1717 | int offset, | 1754 | int offset, |
1718 | struct iovec *from, | 1755 | const struct iovec *from, |
1756 | int from_offset, | ||
1719 | int len); | 1757 | int len); |
1758 | extern int skb_copy_datagram_const_iovec(const struct sk_buff *from, | ||
1759 | int offset, | ||
1760 | const struct iovec *to, | ||
1761 | int to_offset, | ||
1762 | int size); | ||
1720 | extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); | 1763 | extern void skb_free_datagram(struct sock *sk, struct sk_buff *skb); |
1721 | extern int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, | 1764 | extern int skb_kill_datagram(struct sock *sk, struct sk_buff *skb, |
1722 | unsigned int flags); | 1765 | unsigned int flags); |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 48803064cedf..2da8372519f5 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -64,6 +64,13 @@ | |||
64 | 64 | ||
65 | #define SLAB_NOLEAKTRACE 0x00800000UL /* Avoid kmemleak tracing */ | 65 | #define SLAB_NOLEAKTRACE 0x00800000UL /* Avoid kmemleak tracing */ |
66 | 66 | ||
67 | /* Don't track use of uninitialized memory */ | ||
68 | #ifdef CONFIG_KMEMCHECK | ||
69 | # define SLAB_NOTRACK 0x01000000UL | ||
70 | #else | ||
71 | # define SLAB_NOTRACK 0x00000000UL | ||
72 | #endif | ||
73 | |||
67 | /* The following flags affect the page allocator grouping pages by mobility */ | 74 | /* The following flags affect the page allocator grouping pages by mobility */ |
68 | #define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */ | 75 | #define SLAB_RECLAIM_ACCOUNT 0x00020000UL /* Objects are reclaimable */ |
69 | #define SLAB_TEMPORARY SLAB_RECLAIM_ACCOUNT /* Objects are short-lived */ | 76 | #define SLAB_TEMPORARY SLAB_RECLAIM_ACCOUNT /* Objects are short-lived */ |
@@ -319,4 +326,6 @@ static inline void *kzalloc_node(size_t size, gfp_t flags, int node) | |||
319 | return kmalloc_node(size, flags | __GFP_ZERO, node); | 326 | return kmalloc_node(size, flags | __GFP_ZERO, node); |
320 | } | 327 | } |
321 | 328 | ||
329 | void __init kmem_cache_init_late(void); | ||
330 | |||
322 | #endif /* _LINUX_SLAB_H */ | 331 | #endif /* _LINUX_SLAB_H */ |
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h index 713f841ecaa9..850d057500de 100644 --- a/include/linux/slab_def.h +++ b/include/linux/slab_def.h | |||
@@ -16,6 +16,87 @@ | |||
16 | #include <linux/compiler.h> | 16 | #include <linux/compiler.h> |
17 | #include <linux/kmemtrace.h> | 17 | #include <linux/kmemtrace.h> |
18 | 18 | ||
19 | /* | ||
20 | * struct kmem_cache | ||
21 | * | ||
22 | * manages a cache. | ||
23 | */ | ||
24 | |||
25 | struct kmem_cache { | ||
26 | /* 1) per-cpu data, touched during every alloc/free */ | ||
27 | struct array_cache *array[NR_CPUS]; | ||
28 | /* 2) Cache tunables. Protected by cache_chain_mutex */ | ||
29 | unsigned int batchcount; | ||
30 | unsigned int limit; | ||
31 | unsigned int shared; | ||
32 | |||
33 | unsigned int buffer_size; | ||
34 | u32 reciprocal_buffer_size; | ||
35 | /* 3) touched by every alloc & free from the backend */ | ||
36 | |||
37 | unsigned int flags; /* constant flags */ | ||
38 | unsigned int num; /* # of objs per slab */ | ||
39 | |||
40 | /* 4) cache_grow/shrink */ | ||
41 | /* order of pgs per slab (2^n) */ | ||
42 | unsigned int gfporder; | ||
43 | |||
44 | /* force GFP flags, e.g. GFP_DMA */ | ||
45 | gfp_t gfpflags; | ||
46 | |||
47 | size_t colour; /* cache colouring range */ | ||
48 | unsigned int colour_off; /* colour offset */ | ||
49 | struct kmem_cache *slabp_cache; | ||
50 | unsigned int slab_size; | ||
51 | unsigned int dflags; /* dynamic flags */ | ||
52 | |||
53 | /* constructor func */ | ||
54 | void (*ctor)(void *obj); | ||
55 | |||
56 | /* 5) cache creation/removal */ | ||
57 | const char *name; | ||
58 | struct list_head next; | ||
59 | |||
60 | /* 6) statistics */ | ||
61 | #ifdef CONFIG_DEBUG_SLAB | ||
62 | unsigned long num_active; | ||
63 | unsigned long num_allocations; | ||
64 | unsigned long high_mark; | ||
65 | unsigned long grown; | ||
66 | unsigned long reaped; | ||
67 | unsigned long errors; | ||
68 | unsigned long max_freeable; | ||
69 | unsigned long node_allocs; | ||
70 | unsigned long node_frees; | ||
71 | unsigned long node_overflow; | ||
72 | atomic_t allochit; | ||
73 | atomic_t allocmiss; | ||
74 | atomic_t freehit; | ||
75 | atomic_t freemiss; | ||
76 | |||
77 | /* | ||
78 | * If debugging is enabled, then the allocator can add additional | ||
79 | * fields and/or padding to every object. buffer_size contains the total | ||
80 | * object size including these internal fields, the following two | ||
81 | * variables contain the offset to the user object and its size. | ||
82 | */ | ||
83 | int obj_offset; | ||
84 | int obj_size; | ||
85 | #endif /* CONFIG_DEBUG_SLAB */ | ||
86 | |||
87 | /* | ||
88 | * We put nodelists[] at the end of kmem_cache, because we want to size | ||
89 | * this array to nr_node_ids slots instead of MAX_NUMNODES | ||
90 | * (see kmem_cache_init()) | ||
91 | * We still use [MAX_NUMNODES] and not [1] or [0] because cache_cache | ||
92 | * is statically defined, so we reserve the max number of nodes. | ||
93 | */ | ||
94 | struct kmem_list3 *nodelists[MAX_NUMNODES]; | ||
95 | /* | ||
96 | * Do not add fields after nodelists[] | ||
97 | */ | ||
98 | }; | ||
99 | |||
19 | /* Size description struct for general caches. */ | 100 | /* Size description struct for general caches. */ |
20 | struct cache_sizes { | 101 | struct cache_sizes { |
21 | size_t cs_size; | 102 | size_t cs_size; |
diff --git a/include/linux/slob_def.h b/include/linux/slob_def.h index 0ec00b39d006..bb5368df4be8 100644 --- a/include/linux/slob_def.h +++ b/include/linux/slob_def.h | |||
@@ -34,4 +34,9 @@ static __always_inline void *__kmalloc(size_t size, gfp_t flags) | |||
34 | return kmalloc(size, flags); | 34 | return kmalloc(size, flags); |
35 | } | 35 | } |
36 | 36 | ||
37 | static inline void kmem_cache_init_late(void) | ||
38 | { | ||
39 | /* Nothing to do */ | ||
40 | } | ||
41 | |||
37 | #endif /* __LINUX_SLOB_DEF_H */ | 42 | #endif /* __LINUX_SLOB_DEF_H */ |
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h index be5d40c43bd2..c1c862b1d01a 100644 --- a/include/linux/slub_def.h +++ b/include/linux/slub_def.h | |||
@@ -11,6 +11,7 @@ | |||
11 | #include <linux/workqueue.h> | 11 | #include <linux/workqueue.h> |
12 | #include <linux/kobject.h> | 12 | #include <linux/kobject.h> |
13 | #include <linux/kmemtrace.h> | 13 | #include <linux/kmemtrace.h> |
14 | #include <linux/kmemleak.h> | ||
14 | 15 | ||
15 | enum stat_item { | 16 | enum stat_item { |
16 | ALLOC_FASTPATH, /* Allocation from cpu slab */ | 17 | ALLOC_FASTPATH, /* Allocation from cpu slab */ |
@@ -233,6 +234,7 @@ static __always_inline void *kmalloc_large(size_t size, gfp_t flags) | |||
233 | unsigned int order = get_order(size); | 234 | unsigned int order = get_order(size); |
234 | void *ret = (void *) __get_free_pages(flags | __GFP_COMP, order); | 235 | void *ret = (void *) __get_free_pages(flags | __GFP_COMP, order); |
235 | 236 | ||
237 | kmemleak_alloc(ret, size, 1, flags); | ||
236 | trace_kmalloc(_THIS_IP_, ret, size, PAGE_SIZE << order, flags); | 238 | trace_kmalloc(_THIS_IP_, ret, size, PAGE_SIZE << order, flags); |
237 | 239 | ||
238 | return ret; | 240 | return ret; |
@@ -302,4 +304,6 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) | |||
302 | } | 304 | } |
303 | #endif | 305 | #endif |
304 | 306 | ||
307 | void __init kmem_cache_init_late(void); | ||
308 | |||
305 | #endif /* _LINUX_SLUB_DEF_H */ | 309 | #endif /* _LINUX_SLUB_DEF_H */ |
diff --git a/include/linux/smp.h b/include/linux/smp.h index a69db820eed6..9e3d8af09207 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -177,7 +177,6 @@ static inline void init_call_single_data(void) | |||
177 | 177 | ||
178 | #define get_cpu() ({ preempt_disable(); smp_processor_id(); }) | 178 | #define get_cpu() ({ preempt_disable(); smp_processor_id(); }) |
179 | #define put_cpu() preempt_enable() | 179 | #define put_cpu() preempt_enable() |
180 | #define put_cpu_no_resched() preempt_enable_no_resched() | ||
181 | 180 | ||
182 | /* | 181 | /* |
183 | * Callback to arch code if there's nosmp or maxcpus=0 on the | 182 | * Callback to arch code if there's nosmp or maxcpus=0 on the |
diff --git a/include/linux/smsc911x.h b/include/linux/smsc911x.h index b32725075d71..5241e4fb4eca 100644 --- a/include/linux/smsc911x.h +++ b/include/linux/smsc911x.h | |||
@@ -47,4 +47,14 @@ struct smsc911x_platform_config { | |||
47 | #define SMSC911X_FORCE_EXTERNAL_PHY (BIT(3)) | 47 | #define SMSC911X_FORCE_EXTERNAL_PHY (BIT(3)) |
48 | #define SMSC911X_SAVE_MAC_ADDRESS (BIT(4)) | 48 | #define SMSC911X_SAVE_MAC_ADDRESS (BIT(4)) |
49 | 49 | ||
50 | /* | ||
51 | * SMSC911X_SWAP_FIFO: | ||
52 | * Enables software byte swap for fifo data. Should only be used as a | ||
53 | * "last resort" in the case of big endian mode on boards with incorrectly | ||
54 | * routed data bus to older devices such as LAN9118. Newer devices such as | ||
55 | * LAN9221 can handle this in hardware, there are registers to control | ||
56 | * this swapping but the driver doesn't currently use them. | ||
57 | */ | ||
58 | #define SMSC911X_SWAP_FIFO (BIT(5)) | ||
59 | |||
50 | #endif /* __LINUX_SMSC911X_H__ */ | 60 | #endif /* __LINUX_SMSC911X_H__ */ |
diff --git a/include/linux/snmp.h b/include/linux/snmp.h index aee3f1e1d1ce..0f953fe40413 100644 --- a/include/linux/snmp.h +++ b/include/linux/snmp.h | |||
@@ -18,7 +18,7 @@ | |||
18 | enum | 18 | enum |
19 | { | 19 | { |
20 | IPSTATS_MIB_NUM = 0, | 20 | IPSTATS_MIB_NUM = 0, |
21 | IPSTATS_MIB_INRECEIVES, /* InReceives */ | 21 | IPSTATS_MIB_INPKTS, /* InReceives */ |
22 | IPSTATS_MIB_INHDRERRORS, /* InHdrErrors */ | 22 | IPSTATS_MIB_INHDRERRORS, /* InHdrErrors */ |
23 | IPSTATS_MIB_INTOOBIGERRORS, /* InTooBigErrors */ | 23 | IPSTATS_MIB_INTOOBIGERRORS, /* InTooBigErrors */ |
24 | IPSTATS_MIB_INNOROUTES, /* InNoRoutes */ | 24 | IPSTATS_MIB_INNOROUTES, /* InNoRoutes */ |
@@ -28,7 +28,7 @@ enum | |||
28 | IPSTATS_MIB_INDISCARDS, /* InDiscards */ | 28 | IPSTATS_MIB_INDISCARDS, /* InDiscards */ |
29 | IPSTATS_MIB_INDELIVERS, /* InDelivers */ | 29 | IPSTATS_MIB_INDELIVERS, /* InDelivers */ |
30 | IPSTATS_MIB_OUTFORWDATAGRAMS, /* OutForwDatagrams */ | 30 | IPSTATS_MIB_OUTFORWDATAGRAMS, /* OutForwDatagrams */ |
31 | IPSTATS_MIB_OUTREQUESTS, /* OutRequests */ | 31 | IPSTATS_MIB_OUTPKTS, /* OutRequests */ |
32 | IPSTATS_MIB_OUTDISCARDS, /* OutDiscards */ | 32 | IPSTATS_MIB_OUTDISCARDS, /* OutDiscards */ |
33 | IPSTATS_MIB_OUTNOROUTES, /* OutNoRoutes */ | 33 | IPSTATS_MIB_OUTNOROUTES, /* OutNoRoutes */ |
34 | IPSTATS_MIB_REASMTIMEOUT, /* ReasmTimeout */ | 34 | IPSTATS_MIB_REASMTIMEOUT, /* ReasmTimeout */ |
@@ -42,6 +42,12 @@ enum | |||
42 | IPSTATS_MIB_OUTMCASTPKTS, /* OutMcastPkts */ | 42 | IPSTATS_MIB_OUTMCASTPKTS, /* OutMcastPkts */ |
43 | IPSTATS_MIB_INBCASTPKTS, /* InBcastPkts */ | 43 | IPSTATS_MIB_INBCASTPKTS, /* InBcastPkts */ |
44 | IPSTATS_MIB_OUTBCASTPKTS, /* OutBcastPkts */ | 44 | IPSTATS_MIB_OUTBCASTPKTS, /* OutBcastPkts */ |
45 | IPSTATS_MIB_INOCTETS, /* InOctets */ | ||
46 | IPSTATS_MIB_OUTOCTETS, /* OutOctets */ | ||
47 | IPSTATS_MIB_INMCASTOCTETS, /* InMcastOctets */ | ||
48 | IPSTATS_MIB_OUTMCASTOCTETS, /* OutMcastOctets */ | ||
49 | IPSTATS_MIB_INBCASTOCTETS, /* InBcastOctets */ | ||
50 | IPSTATS_MIB_OUTBCASTOCTETS, /* OutBcastOctets */ | ||
45 | __IPSTATS_MIB_MAX | 51 | __IPSTATS_MIB_MAX |
46 | }; | 52 | }; |
47 | 53 | ||
diff --git a/include/linux/socket.h b/include/linux/socket.h index 421afb4d29b0..3b461dffe244 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -194,7 +194,8 @@ struct ucred { | |||
194 | #define AF_RXRPC 33 /* RxRPC sockets */ | 194 | #define AF_RXRPC 33 /* RxRPC sockets */ |
195 | #define AF_ISDN 34 /* mISDN sockets */ | 195 | #define AF_ISDN 34 /* mISDN sockets */ |
196 | #define AF_PHONET 35 /* Phonet sockets */ | 196 | #define AF_PHONET 35 /* Phonet sockets */ |
197 | #define AF_MAX 36 /* For now.. */ | 197 | #define AF_IEEE802154 36 /* IEEE802154 sockets */ |
198 | #define AF_MAX 37 /* For now.. */ | ||
198 | 199 | ||
199 | /* Protocol families, same as address families. */ | 200 | /* Protocol families, same as address families. */ |
200 | #define PF_UNSPEC AF_UNSPEC | 201 | #define PF_UNSPEC AF_UNSPEC |
@@ -233,6 +234,7 @@ struct ucred { | |||
233 | #define PF_RXRPC AF_RXRPC | 234 | #define PF_RXRPC AF_RXRPC |
234 | #define PF_ISDN AF_ISDN | 235 | #define PF_ISDN AF_ISDN |
235 | #define PF_PHONET AF_PHONET | 236 | #define PF_PHONET AF_PHONET |
237 | #define PF_IEEE802154 AF_IEEE802154 | ||
236 | #define PF_MAX AF_MAX | 238 | #define PF_MAX AF_MAX |
237 | 239 | ||
238 | /* Maximum queue length specifiable by listen. */ | 240 | /* Maximum queue length specifiable by listen. */ |
@@ -303,14 +305,15 @@ struct ucred { | |||
303 | #define SOL_BLUETOOTH 274 | 305 | #define SOL_BLUETOOTH 274 |
304 | #define SOL_PNPIPE 275 | 306 | #define SOL_PNPIPE 275 |
305 | #define SOL_RDS 276 | 307 | #define SOL_RDS 276 |
308 | #define SOL_IUCV 277 | ||
306 | 309 | ||
307 | /* IPX options */ | 310 | /* IPX options */ |
308 | #define IPX_TYPE 1 | 311 | #define IPX_TYPE 1 |
309 | 312 | ||
310 | #ifdef __KERNEL__ | 313 | #ifdef __KERNEL__ |
311 | extern int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len); | 314 | extern int memcpy_fromiovec(unsigned char *kdata, struct iovec *iov, int len); |
312 | extern int memcpy_fromiovecend(unsigned char *kdata, struct iovec *iov, | 315 | extern int memcpy_fromiovecend(unsigned char *kdata, const struct iovec *iov, |
313 | int offset, int len); | 316 | int offset, int len); |
314 | extern int csum_partial_copy_fromiovecend(unsigned char *kdata, | 317 | extern int csum_partial_copy_fromiovecend(unsigned char *kdata, |
315 | struct iovec *iov, | 318 | struct iovec *iov, |
316 | int offset, | 319 | int offset, |
@@ -318,6 +321,8 @@ extern int csum_partial_copy_fromiovecend(unsigned char *kdata, | |||
318 | 321 | ||
319 | extern int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode); | 322 | extern int verify_iovec(struct msghdr *m, struct iovec *iov, struct sockaddr *address, int mode); |
320 | extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); | 323 | extern int memcpy_toiovec(struct iovec *v, unsigned char *kdata, int len); |
324 | extern int memcpy_toiovecend(const struct iovec *v, unsigned char *kdata, | ||
325 | int offset, int len); | ||
321 | extern int move_addr_to_user(struct sockaddr *kaddr, int klen, void __user *uaddr, int __user *ulen); | 326 | extern int move_addr_to_user(struct sockaddr *kaddr, int klen, void __user *uaddr, int __user *ulen); |
322 | extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr *kaddr); | 327 | extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr *kaddr); |
323 | extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); | 328 | extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); |
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h index 2ea20320c093..51948eb6927a 100644 --- a/include/linux/spi/ads7846.h +++ b/include/linux/spi/ads7846.h | |||
@@ -17,6 +17,7 @@ struct ads7846_platform_data { | |||
17 | u16 vref_mv; /* external vref value, milliVolts */ | 17 | u16 vref_mv; /* external vref value, milliVolts */ |
18 | bool keep_vref_on; /* set to keep vref on for differential | 18 | bool keep_vref_on; /* set to keep vref on for differential |
19 | * measurements as well */ | 19 | * measurements as well */ |
20 | bool swap_xy; /* swap x and y axes */ | ||
20 | 21 | ||
21 | /* Settling time of the analog signals; a function of Vcc and the | 22 | /* Settling time of the analog signals; a function of Vcc and the |
22 | * capacitance on the X/Y drivers. If set to non-zero, two samples | 23 | * capacitance on the X/Y drivers. If set to non-zero, two samples |
diff --git a/include/linux/spi/libertas_spi.h b/include/linux/spi/libertas_spi.h index 79506f5f9e67..1b5d5384fcd3 100644 --- a/include/linux/spi/libertas_spi.h +++ b/include/linux/spi/libertas_spi.h | |||
@@ -22,9 +22,6 @@ struct libertas_spi_platform_data { | |||
22 | * speed, you may want to use 0 here. */ | 22 | * speed, you may want to use 0 here. */ |
23 | u16 use_dummy_writes; | 23 | u16 use_dummy_writes; |
24 | 24 | ||
25 | /* GPIO number to use as chip select */ | ||
26 | u16 gpio_cs; | ||
27 | |||
28 | /* Board specific setup/teardown */ | 25 | /* Board specific setup/teardown */ |
29 | int (*setup)(struct spi_device *spi); | 26 | int (*setup)(struct spi_device *spi); |
30 | int (*teardown)(struct spi_device *spi); | 27 | int (*teardown)(struct spi_device *spi); |
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h index a0faa18f7b1b..c47c4b4da97e 100644 --- a/include/linux/spi/spi.h +++ b/include/linux/spi/spi.h | |||
@@ -80,6 +80,8 @@ struct spi_device { | |||
80 | #define SPI_LSB_FIRST 0x08 /* per-word bits-on-wire */ | 80 | #define SPI_LSB_FIRST 0x08 /* per-word bits-on-wire */ |
81 | #define SPI_3WIRE 0x10 /* SI/SO signals shared */ | 81 | #define SPI_3WIRE 0x10 /* SI/SO signals shared */ |
82 | #define SPI_LOOP 0x20 /* loopback mode */ | 82 | #define SPI_LOOP 0x20 /* loopback mode */ |
83 | #define SPI_NO_CS 0x40 /* 1 dev/bus, no chipselect */ | ||
84 | #define SPI_READY 0x80 /* slave pulls low to pause */ | ||
83 | u8 bits_per_word; | 85 | u8 bits_per_word; |
84 | int irq; | 86 | int irq; |
85 | void *controller_state; | 87 | void *controller_state; |
@@ -245,6 +247,13 @@ struct spi_master { | |||
245 | */ | 247 | */ |
246 | u16 dma_alignment; | 248 | u16 dma_alignment; |
247 | 249 | ||
250 | /* spi_device.mode flags understood by this controller driver */ | ||
251 | u16 mode_bits; | ||
252 | |||
253 | /* other constraints relevant to this driver */ | ||
254 | u16 flags; | ||
255 | #define SPI_MASTER_HALF_DUPLEX BIT(0) /* can't do full duplex */ | ||
256 | |||
248 | /* Setup mode and clock, etc (spi driver may call many times). | 257 | /* Setup mode and clock, etc (spi driver may call many times). |
249 | * | 258 | * |
250 | * IMPORTANT: this may be called when transfers to another | 259 | * IMPORTANT: this may be called when transfers to another |
@@ -523,30 +532,7 @@ static inline void spi_message_free(struct spi_message *m) | |||
523 | kfree(m); | 532 | kfree(m); |
524 | } | 533 | } |
525 | 534 | ||
526 | /** | 535 | extern int spi_setup(struct spi_device *spi); |
527 | * spi_setup - setup SPI mode and clock rate | ||
528 | * @spi: the device whose settings are being modified | ||
529 | * Context: can sleep, and no requests are queued to the device | ||
530 | * | ||
531 | * SPI protocol drivers may need to update the transfer mode if the | ||
532 | * device doesn't work with its default. They may likewise need | ||
533 | * to update clock rates or word sizes from initial values. This function | ||
534 | * changes those settings, and must be called from a context that can sleep. | ||
535 | * Except for SPI_CS_HIGH, which takes effect immediately, the changes take | ||
536 | * effect the next time the device is selected and data is transferred to | ||
537 | * or from it. When this function returns, the spi device is deselected. | ||
538 | * | ||
539 | * Note that this call will fail if the protocol driver specifies an option | ||
540 | * that the underlying controller or its driver does not support. For | ||
541 | * example, not all hardware supports wire transfers using nine bit words, | ||
542 | * LSB-first wire encoding, or active-high chipselects. | ||
543 | */ | ||
544 | static inline int | ||
545 | spi_setup(struct spi_device *spi) | ||
546 | { | ||
547 | return spi->master->setup(spi); | ||
548 | } | ||
549 | |||
550 | 536 | ||
551 | /** | 537 | /** |
552 | * spi_async - asynchronous SPI transfer | 538 | * spi_async - asynchronous SPI transfer |
diff --git a/include/linux/spi/spidev.h b/include/linux/spi/spidev.h index 95251ccd5a07..bf0570a84f7a 100644 --- a/include/linux/spi/spidev.h +++ b/include/linux/spi/spidev.h | |||
@@ -40,6 +40,8 @@ | |||
40 | #define SPI_LSB_FIRST 0x08 | 40 | #define SPI_LSB_FIRST 0x08 |
41 | #define SPI_3WIRE 0x10 | 41 | #define SPI_3WIRE 0x10 |
42 | #define SPI_LOOP 0x20 | 42 | #define SPI_LOOP 0x20 |
43 | #define SPI_NO_CS 0x40 | ||
44 | #define SPI_READY 0x80 | ||
43 | 45 | ||
44 | /*---------------------------------------------------------------------------*/ | 46 | /*---------------------------------------------------------------------------*/ |
45 | 47 | ||
diff --git a/include/linux/spi/wl12xx.h b/include/linux/spi/wl12xx.h new file mode 100644 index 000000000000..11430cab2aad --- /dev/null +++ b/include/linux/spi/wl12xx.h | |||
@@ -0,0 +1,31 @@ | |||
1 | /* | ||
2 | * This file is part of wl12xx | ||
3 | * | ||
4 | * Copyright (C) 2009 Nokia Corporation | ||
5 | * | ||
6 | * Contact: Kalle Valo <kalle.valo@nokia.com> | ||
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 | |||
24 | #ifndef _LINUX_SPI_WL12XX_H | ||
25 | #define _LINUX_SPI_WL12XX_H | ||
26 | |||
27 | struct wl12xx_platform_data { | ||
28 | void (*set_power)(bool enable); | ||
29 | }; | ||
30 | |||
31 | #endif | ||
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 252b245cfcf4..4be57ab03478 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
@@ -132,6 +132,11 @@ do { \ | |||
132 | #endif /*__raw_spin_is_contended*/ | 132 | #endif /*__raw_spin_is_contended*/ |
133 | #endif | 133 | #endif |
134 | 134 | ||
135 | /* The lock does not imply full memory barrier. */ | ||
136 | #ifndef ARCH_HAS_SMP_MB_AFTER_LOCK | ||
137 | static inline void smp_mb__after_lock(void) { smp_mb(); } | ||
138 | #endif | ||
139 | |||
135 | /** | 140 | /** |
136 | * spin_unlock_wait - wait until the spinlock gets unlocked | 141 | * spin_unlock_wait - wait until the spinlock gets unlocked |
137 | * @lock: the spinlock in question. | 142 | * @lock: the spinlock in question. |
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h index 1a8cecc4f38c..51efbef38fb0 100644 --- a/include/linux/stacktrace.h +++ b/include/linux/stacktrace.h | |||
@@ -4,6 +4,8 @@ | |||
4 | struct task_struct; | 4 | struct task_struct; |
5 | 5 | ||
6 | #ifdef CONFIG_STACKTRACE | 6 | #ifdef CONFIG_STACKTRACE |
7 | struct task_struct; | ||
8 | |||
7 | struct stack_trace { | 9 | struct stack_trace { |
8 | unsigned int nr_entries, max_entries; | 10 | unsigned int nr_entries, max_entries; |
9 | unsigned long *entries; | 11 | unsigned long *entries; |
@@ -11,6 +13,7 @@ struct stack_trace { | |||
11 | }; | 13 | }; |
12 | 14 | ||
13 | extern void save_stack_trace(struct stack_trace *trace); | 15 | extern void save_stack_trace(struct stack_trace *trace); |
16 | extern void save_stack_trace_bp(struct stack_trace *trace, unsigned long bp); | ||
14 | extern void save_stack_trace_tsk(struct task_struct *tsk, | 17 | extern void save_stack_trace_tsk(struct task_struct *tsk, |
15 | struct stack_trace *trace); | 18 | struct stack_trace *trace); |
16 | 19 | ||
diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h new file mode 100644 index 000000000000..6508f0dc0eff --- /dev/null +++ b/include/linux/sunrpc/bc_xprt.h | |||
@@ -0,0 +1,49 @@ | |||
1 | /****************************************************************************** | ||
2 | |||
3 | (c) 2008 NetApp. All Rights Reserved. | ||
4 | |||
5 | NetApp provides this source code under the GPL v2 License. | ||
6 | The GPL v2 license is available at | ||
7 | http://opensource.org/licenses/gpl-license.php. | ||
8 | |||
9 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
10 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
11 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR | ||
12 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR | ||
13 | CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, | ||
14 | EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, | ||
15 | PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR | ||
16 | PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF | ||
17 | LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING | ||
18 | NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
19 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
20 | |||
21 | ******************************************************************************/ | ||
22 | |||
23 | /* | ||
24 | * Functions to create and manage the backchannel | ||
25 | */ | ||
26 | |||
27 | #ifndef _LINUX_SUNRPC_BC_XPRT_H | ||
28 | #define _LINUX_SUNRPC_BC_XPRT_H | ||
29 | |||
30 | #include <linux/sunrpc/svcsock.h> | ||
31 | #include <linux/sunrpc/xprt.h> | ||
32 | #include <linux/sunrpc/sched.h> | ||
33 | |||
34 | #ifdef CONFIG_NFS_V4_1 | ||
35 | struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt); | ||
36 | void xprt_free_bc_request(struct rpc_rqst *req); | ||
37 | int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); | ||
38 | void xprt_destroy_backchannel(struct rpc_xprt *, int max_reqs); | ||
39 | void bc_release_request(struct rpc_task *); | ||
40 | int bc_send(struct rpc_rqst *req); | ||
41 | #else /* CONFIG_NFS_V4_1 */ | ||
42 | static inline int xprt_setup_backchannel(struct rpc_xprt *xprt, | ||
43 | unsigned int min_reqs) | ||
44 | { | ||
45 | return 0; | ||
46 | } | ||
47 | #endif /* CONFIG_NFS_V4_1 */ | ||
48 | #endif /* _LINUX_SUNRPC_BC_XPRT_H */ | ||
49 | |||
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h index c39a21040dcb..37881f1a0bd7 100644 --- a/include/linux/sunrpc/clnt.h +++ b/include/linux/sunrpc/clnt.h | |||
@@ -143,6 +143,7 @@ int rpc_call_sync(struct rpc_clnt *clnt, | |||
143 | const struct rpc_message *msg, int flags); | 143 | const struct rpc_message *msg, int flags); |
144 | struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred, | 144 | struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred, |
145 | int flags); | 145 | int flags); |
146 | void rpc_restart_call_prepare(struct rpc_task *); | ||
146 | void rpc_restart_call(struct rpc_task *); | 147 | void rpc_restart_call(struct rpc_task *); |
147 | void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); | 148 | void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); |
148 | size_t rpc_max_payload(struct rpc_clnt *); | 149 | size_t rpc_max_payload(struct rpc_clnt *); |
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h index 64981a2f1cae..401097781fc0 100644 --- a/include/linux/sunrpc/sched.h +++ b/include/linux/sunrpc/sched.h | |||
@@ -210,6 +210,8 @@ struct rpc_wait_queue { | |||
210 | */ | 210 | */ |
211 | struct rpc_task *rpc_new_task(const struct rpc_task_setup *); | 211 | struct rpc_task *rpc_new_task(const struct rpc_task_setup *); |
212 | struct rpc_task *rpc_run_task(const struct rpc_task_setup *); | 212 | struct rpc_task *rpc_run_task(const struct rpc_task_setup *); |
213 | struct rpc_task *rpc_run_bc_task(struct rpc_rqst *req, | ||
214 | const struct rpc_call_ops *ops); | ||
213 | void rpc_put_task(struct rpc_task *); | 215 | void rpc_put_task(struct rpc_task *); |
214 | void rpc_exit_task(struct rpc_task *); | 216 | void rpc_exit_task(struct rpc_task *); |
215 | void rpc_release_calldata(const struct rpc_call_ops *, void *); | 217 | void rpc_release_calldata(const struct rpc_call_ops *, void *); |
@@ -237,6 +239,7 @@ void rpc_show_tasks(void); | |||
237 | int rpc_init_mempool(void); | 239 | int rpc_init_mempool(void); |
238 | void rpc_destroy_mempool(void); | 240 | void rpc_destroy_mempool(void); |
239 | extern struct workqueue_struct *rpciod_workqueue; | 241 | extern struct workqueue_struct *rpciod_workqueue; |
242 | void rpc_prepare_task(struct rpc_task *task); | ||
240 | 243 | ||
241 | static inline void rpc_exit(struct rpc_task *task, int status) | 244 | static inline void rpc_exit(struct rpc_task *task, int status) |
242 | { | 245 | { |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 2a30775959e9..ea8009695c69 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -96,6 +96,15 @@ struct svc_serv { | |||
96 | svc_thread_fn sv_function; /* main function for threads */ | 96 | svc_thread_fn sv_function; /* main function for threads */ |
97 | unsigned int sv_drc_max_pages; /* Total pages for DRC */ | 97 | unsigned int sv_drc_max_pages; /* Total pages for DRC */ |
98 | unsigned int sv_drc_pages_used;/* DRC pages used */ | 98 | unsigned int sv_drc_pages_used;/* DRC pages used */ |
99 | #if defined(CONFIG_NFS_V4_1) | ||
100 | struct list_head sv_cb_list; /* queue for callback requests | ||
101 | * that arrive over the same | ||
102 | * connection */ | ||
103 | spinlock_t sv_cb_lock; /* protects the svc_cb_list */ | ||
104 | wait_queue_head_t sv_cb_waitq; /* sleep here if there are no | ||
105 | * entries in the svc_cb_list */ | ||
106 | struct svc_xprt *bc_xprt; | ||
107 | #endif /* CONFIG_NFS_V4_1 */ | ||
99 | }; | 108 | }; |
100 | 109 | ||
101 | /* | 110 | /* |
@@ -411,6 +420,8 @@ int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int); | |||
411 | int svc_pool_stats_open(struct svc_serv *serv, struct file *file); | 420 | int svc_pool_stats_open(struct svc_serv *serv, struct file *file); |
412 | void svc_destroy(struct svc_serv *); | 421 | void svc_destroy(struct svc_serv *); |
413 | int svc_process(struct svc_rqst *); | 422 | int svc_process(struct svc_rqst *); |
423 | int bc_svc_process(struct svc_serv *, struct rpc_rqst *, | ||
424 | struct svc_rqst *); | ||
414 | int svc_register(const struct svc_serv *, const int, | 425 | int svc_register(const struct svc_serv *, const int, |
415 | const unsigned short, const unsigned short); | 426 | const unsigned short, const unsigned short); |
416 | 427 | ||
diff --git a/include/linux/sunrpc/svc_xprt.h b/include/linux/sunrpc/svc_xprt.h index 0d9cb6ef28b0..2223ae0b5ed5 100644 --- a/include/linux/sunrpc/svc_xprt.h +++ b/include/linux/sunrpc/svc_xprt.h | |||
@@ -83,7 +83,7 @@ int svc_port_is_privileged(struct sockaddr *sin); | |||
83 | int svc_print_xprts(char *buf, int maxlen); | 83 | int svc_print_xprts(char *buf, int maxlen); |
84 | struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name, | 84 | struct svc_xprt *svc_find_xprt(struct svc_serv *serv, const char *xcl_name, |
85 | const sa_family_t af, const unsigned short port); | 85 | const sa_family_t af, const unsigned short port); |
86 | int svc_xprt_names(struct svc_serv *serv, char *buf, int buflen); | 86 | int svc_xprt_names(struct svc_serv *serv, char *buf, const int buflen); |
87 | 87 | ||
88 | static inline void svc_xprt_get(struct svc_xprt *xprt) | 88 | static inline void svc_xprt_get(struct svc_xprt *xprt) |
89 | { | 89 | { |
@@ -118,7 +118,7 @@ static inline unsigned short svc_addr_port(const struct sockaddr *sa) | |||
118 | return 0; | 118 | return 0; |
119 | } | 119 | } |
120 | 120 | ||
121 | static inline size_t svc_addr_len(struct sockaddr *sa) | 121 | static inline size_t svc_addr_len(const struct sockaddr *sa) |
122 | { | 122 | { |
123 | switch (sa->sa_family) { | 123 | switch (sa->sa_family) { |
124 | case AF_INET: | 124 | case AF_INET: |
@@ -126,7 +126,8 @@ static inline size_t svc_addr_len(struct sockaddr *sa) | |||
126 | case AF_INET6: | 126 | case AF_INET6: |
127 | return sizeof(struct sockaddr_in6); | 127 | return sizeof(struct sockaddr_in6); |
128 | } | 128 | } |
129 | return -EAFNOSUPPORT; | 129 | |
130 | return 0; | ||
130 | } | 131 | } |
131 | 132 | ||
132 | static inline unsigned short svc_xprt_local_port(const struct svc_xprt *xprt) | 133 | static inline unsigned short svc_xprt_local_port(const struct svc_xprt *xprt) |
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index 483e10380aae..04dba23c59f2 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h | |||
@@ -38,10 +38,15 @@ int svc_recv(struct svc_rqst *, long); | |||
38 | int svc_send(struct svc_rqst *); | 38 | int svc_send(struct svc_rqst *); |
39 | void svc_drop(struct svc_rqst *); | 39 | void svc_drop(struct svc_rqst *); |
40 | void svc_sock_update_bufs(struct svc_serv *serv); | 40 | void svc_sock_update_bufs(struct svc_serv *serv); |
41 | int svc_sock_names(char *buf, struct svc_serv *serv, char *toclose); | 41 | int svc_sock_names(struct svc_serv *serv, char *buf, |
42 | int svc_addsock(struct svc_serv *serv, int fd, char *name_return); | 42 | const size_t buflen, |
43 | const char *toclose); | ||
44 | int svc_addsock(struct svc_serv *serv, const int fd, | ||
45 | char *name_return, const size_t len); | ||
43 | void svc_init_xprt_sock(void); | 46 | void svc_init_xprt_sock(void); |
44 | void svc_cleanup_xprt_sock(void); | 47 | void svc_cleanup_xprt_sock(void); |
48 | struct svc_xprt *svc_sock_create(struct svc_serv *serv, int prot); | ||
49 | void svc_sock_destroy(struct svc_xprt *); | ||
45 | 50 | ||
46 | /* | 51 | /* |
47 | * svc_makesock socket characteristics | 52 | * svc_makesock socket characteristics |
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index d8910b68e1bd..b99c625fddfe 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
@@ -12,7 +12,6 @@ | |||
12 | #include <linux/uio.h> | 12 | #include <linux/uio.h> |
13 | #include <asm/byteorder.h> | 13 | #include <asm/byteorder.h> |
14 | #include <linux/scatterlist.h> | 14 | #include <linux/scatterlist.h> |
15 | #include <linux/smp_lock.h> | ||
16 | 15 | ||
17 | /* | 16 | /* |
18 | * Buffer adjustment | 17 | * Buffer adjustment |
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index 08afe43118f4..1175d58efc2e 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -67,7 +67,8 @@ struct rpc_rqst { | |||
67 | struct rpc_task * rq_task; /* RPC task data */ | 67 | struct rpc_task * rq_task; /* RPC task data */ |
68 | __be32 rq_xid; /* request XID */ | 68 | __be32 rq_xid; /* request XID */ |
69 | int rq_cong; /* has incremented xprt->cong */ | 69 | int rq_cong; /* has incremented xprt->cong */ |
70 | int rq_received; /* receive completed */ | 70 | int rq_reply_bytes_recvd; /* number of reply */ |
71 | /* bytes received */ | ||
71 | u32 rq_seqno; /* gss seq no. used on req. */ | 72 | u32 rq_seqno; /* gss seq no. used on req. */ |
72 | int rq_enc_pages_num; | 73 | int rq_enc_pages_num; |
73 | struct page **rq_enc_pages; /* scratch pages for use by | 74 | struct page **rq_enc_pages; /* scratch pages for use by |
@@ -97,6 +98,12 @@ struct rpc_rqst { | |||
97 | 98 | ||
98 | unsigned long rq_xtime; /* when transmitted */ | 99 | unsigned long rq_xtime; /* when transmitted */ |
99 | int rq_ntrans; | 100 | int rq_ntrans; |
101 | |||
102 | #if defined(CONFIG_NFS_V4_1) | ||
103 | struct list_head rq_bc_list; /* Callback service list */ | ||
104 | unsigned long rq_bc_pa_state; /* Backchannel prealloc state */ | ||
105 | struct list_head rq_bc_pa_list; /* Backchannel prealloc list */ | ||
106 | #endif /* CONFIG_NFS_V4_1 */ | ||
100 | }; | 107 | }; |
101 | #define rq_svec rq_snd_buf.head | 108 | #define rq_svec rq_snd_buf.head |
102 | #define rq_slen rq_snd_buf.len | 109 | #define rq_slen rq_snd_buf.len |
@@ -174,6 +181,15 @@ struct rpc_xprt { | |||
174 | spinlock_t reserve_lock; /* lock slot table */ | 181 | spinlock_t reserve_lock; /* lock slot table */ |
175 | u32 xid; /* Next XID value to use */ | 182 | u32 xid; /* Next XID value to use */ |
176 | struct rpc_task * snd_task; /* Task blocked in send */ | 183 | struct rpc_task * snd_task; /* Task blocked in send */ |
184 | #if defined(CONFIG_NFS_V4_1) | ||
185 | struct svc_serv *bc_serv; /* The RPC service which will */ | ||
186 | /* process the callback */ | ||
187 | unsigned int bc_alloc_count; /* Total number of preallocs */ | ||
188 | spinlock_t bc_pa_lock; /* Protects the preallocated | ||
189 | * items */ | ||
190 | struct list_head bc_pa_list; /* List of preallocated | ||
191 | * backchannel rpc_rqst's */ | ||
192 | #endif /* CONFIG_NFS_V4_1 */ | ||
177 | struct list_head recv; | 193 | struct list_head recv; |
178 | 194 | ||
179 | struct { | 195 | struct { |
@@ -192,6 +208,26 @@ struct rpc_xprt { | |||
192 | const char *address_strings[RPC_DISPLAY_MAX]; | 208 | const char *address_strings[RPC_DISPLAY_MAX]; |
193 | }; | 209 | }; |
194 | 210 | ||
211 | #if defined(CONFIG_NFS_V4_1) | ||
212 | /* | ||
213 | * Backchannel flags | ||
214 | */ | ||
215 | #define RPC_BC_PA_IN_USE 0x0001 /* Preallocated backchannel */ | ||
216 | /* buffer in use */ | ||
217 | #endif /* CONFIG_NFS_V4_1 */ | ||
218 | |||
219 | #if defined(CONFIG_NFS_V4_1) | ||
220 | static inline int bc_prealloc(struct rpc_rqst *req) | ||
221 | { | ||
222 | return test_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state); | ||
223 | } | ||
224 | #else | ||
225 | static inline int bc_prealloc(struct rpc_rqst *req) | ||
226 | { | ||
227 | return 0; | ||
228 | } | ||
229 | #endif /* CONFIG_NFS_V4_1 */ | ||
230 | |||
195 | struct xprt_create { | 231 | struct xprt_create { |
196 | int ident; /* XPRT_TRANSPORT identifier */ | 232 | int ident; /* XPRT_TRANSPORT identifier */ |
197 | struct sockaddr * srcaddr; /* optional local address */ | 233 | struct sockaddr * srcaddr; /* optional local address */ |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index 795032edfc46..cd15df6c63cd 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -245,11 +245,6 @@ extern unsigned long get_safe_page(gfp_t gfp_mask); | |||
245 | 245 | ||
246 | extern void hibernation_set_ops(struct platform_hibernation_ops *ops); | 246 | extern void hibernation_set_ops(struct platform_hibernation_ops *ops); |
247 | extern int hibernate(void); | 247 | extern int hibernate(void); |
248 | extern int hibernate_nvs_register(unsigned long start, unsigned long size); | ||
249 | extern int hibernate_nvs_alloc(void); | ||
250 | extern void hibernate_nvs_free(void); | ||
251 | extern void hibernate_nvs_save(void); | ||
252 | extern void hibernate_nvs_restore(void); | ||
253 | extern bool system_entering_hibernation(void); | 248 | extern bool system_entering_hibernation(void); |
254 | #else /* CONFIG_HIBERNATION */ | 249 | #else /* CONFIG_HIBERNATION */ |
255 | static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } | 250 | static inline int swsusp_page_is_forbidden(struct page *p) { return 0; } |
@@ -258,6 +253,16 @@ static inline void swsusp_unset_page_free(struct page *p) {} | |||
258 | 253 | ||
259 | static inline void hibernation_set_ops(struct platform_hibernation_ops *ops) {} | 254 | static inline void hibernation_set_ops(struct platform_hibernation_ops *ops) {} |
260 | static inline int hibernate(void) { return -ENOSYS; } | 255 | static inline int hibernate(void) { return -ENOSYS; } |
256 | static inline bool system_entering_hibernation(void) { return false; } | ||
257 | #endif /* CONFIG_HIBERNATION */ | ||
258 | |||
259 | #ifdef CONFIG_HIBERNATION_NVS | ||
260 | extern int hibernate_nvs_register(unsigned long start, unsigned long size); | ||
261 | extern int hibernate_nvs_alloc(void); | ||
262 | extern void hibernate_nvs_free(void); | ||
263 | extern void hibernate_nvs_save(void); | ||
264 | extern void hibernate_nvs_restore(void); | ||
265 | #else /* CONFIG_HIBERNATION_NVS */ | ||
261 | static inline int hibernate_nvs_register(unsigned long a, unsigned long b) | 266 | static inline int hibernate_nvs_register(unsigned long a, unsigned long b) |
262 | { | 267 | { |
263 | return 0; | 268 | return 0; |
@@ -266,8 +271,7 @@ static inline int hibernate_nvs_alloc(void) { return 0; } | |||
266 | static inline void hibernate_nvs_free(void) {} | 271 | static inline void hibernate_nvs_free(void) {} |
267 | static inline void hibernate_nvs_save(void) {} | 272 | static inline void hibernate_nvs_save(void) {} |
268 | static inline void hibernate_nvs_restore(void) {} | 273 | static inline void hibernate_nvs_restore(void) {} |
269 | static inline bool system_entering_hibernation(void) { return false; } | 274 | #endif /* CONFIG_HIBERNATION_NVS */ |
270 | #endif /* CONFIG_HIBERNATION */ | ||
271 | 275 | ||
272 | #ifdef CONFIG_PM_SLEEP | 276 | #ifdef CONFIG_PM_SLEEP |
273 | void save_processor_state(void); | 277 | void save_processor_state(void); |
diff --git a/include/linux/swap.h b/include/linux/swap.h index d476aad3ff57..7c15334f3ff2 100644 --- a/include/linux/swap.h +++ b/include/linux/swap.h | |||
@@ -129,9 +129,10 @@ enum { | |||
129 | 129 | ||
130 | #define SWAP_CLUSTER_MAX 32 | 130 | #define SWAP_CLUSTER_MAX 32 |
131 | 131 | ||
132 | #define SWAP_MAP_MAX 0x7fff | 132 | #define SWAP_MAP_MAX 0x7ffe |
133 | #define SWAP_MAP_BAD 0x8000 | 133 | #define SWAP_MAP_BAD 0x7fff |
134 | 134 | #define SWAP_HAS_CACHE 0x8000 /* There is a swap cache of entry. */ | |
135 | #define SWAP_COUNT_MASK (~SWAP_HAS_CACHE) | ||
135 | /* | 136 | /* |
136 | * The in-memory structure used to track swap areas. | 137 | * The in-memory structure used to track swap areas. |
137 | */ | 138 | */ |
@@ -235,7 +236,6 @@ static inline int zone_reclaim(struct zone *z, gfp_t mask, unsigned int order) | |||
235 | } | 236 | } |
236 | #endif | 237 | #endif |
237 | 238 | ||
238 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
239 | extern int page_evictable(struct page *page, struct vm_area_struct *vma); | 239 | extern int page_evictable(struct page *page, struct vm_area_struct *vma); |
240 | extern void scan_mapping_unevictable_pages(struct address_space *); | 240 | extern void scan_mapping_unevictable_pages(struct address_space *); |
241 | 241 | ||
@@ -244,24 +244,6 @@ extern int scan_unevictable_handler(struct ctl_table *, int, struct file *, | |||
244 | void __user *, size_t *, loff_t *); | 244 | void __user *, size_t *, loff_t *); |
245 | extern int scan_unevictable_register_node(struct node *node); | 245 | extern int scan_unevictable_register_node(struct node *node); |
246 | extern void scan_unevictable_unregister_node(struct node *node); | 246 | extern void scan_unevictable_unregister_node(struct node *node); |
247 | #else | ||
248 | static inline int page_evictable(struct page *page, | ||
249 | struct vm_area_struct *vma) | ||
250 | { | ||
251 | return 1; | ||
252 | } | ||
253 | |||
254 | static inline void scan_mapping_unevictable_pages(struct address_space *mapping) | ||
255 | { | ||
256 | } | ||
257 | |||
258 | static inline int scan_unevictable_register_node(struct node *node) | ||
259 | { | ||
260 | return 0; | ||
261 | } | ||
262 | |||
263 | static inline void scan_unevictable_unregister_node(struct node *node) { } | ||
264 | #endif | ||
265 | 247 | ||
266 | extern int kswapd_run(int nid); | 248 | extern int kswapd_run(int nid); |
267 | 249 | ||
@@ -274,7 +256,7 @@ extern void swap_unplug_io_fn(struct backing_dev_info *, struct page *); | |||
274 | 256 | ||
275 | #ifdef CONFIG_SWAP | 257 | #ifdef CONFIG_SWAP |
276 | /* linux/mm/page_io.c */ | 258 | /* linux/mm/page_io.c */ |
277 | extern int swap_readpage(struct file *, struct page *); | 259 | extern int swap_readpage(struct page *); |
278 | extern int swap_writepage(struct page *page, struct writeback_control *wbc); | 260 | extern int swap_writepage(struct page *page, struct writeback_control *wbc); |
279 | extern void end_swap_bio_read(struct bio *bio, int err); | 261 | extern void end_swap_bio_read(struct bio *bio, int err); |
280 | 262 | ||
@@ -300,9 +282,11 @@ extern long total_swap_pages; | |||
300 | extern void si_swapinfo(struct sysinfo *); | 282 | extern void si_swapinfo(struct sysinfo *); |
301 | extern swp_entry_t get_swap_page(void); | 283 | extern swp_entry_t get_swap_page(void); |
302 | extern swp_entry_t get_swap_page_of_type(int); | 284 | extern swp_entry_t get_swap_page_of_type(int); |
303 | extern int swap_duplicate(swp_entry_t); | 285 | extern void swap_duplicate(swp_entry_t); |
286 | extern int swapcache_prepare(swp_entry_t); | ||
304 | extern int valid_swaphandles(swp_entry_t, unsigned long *); | 287 | extern int valid_swaphandles(swp_entry_t, unsigned long *); |
305 | extern void swap_free(swp_entry_t); | 288 | extern void swap_free(swp_entry_t); |
289 | extern void swapcache_free(swp_entry_t, struct page *page); | ||
306 | extern int free_swap_and_cache(swp_entry_t); | 290 | extern int free_swap_and_cache(swp_entry_t); |
307 | extern int swap_type_of(dev_t, sector_t, struct block_device **); | 291 | extern int swap_type_of(dev_t, sector_t, struct block_device **); |
308 | extern unsigned int count_swap_pages(int, int); | 292 | extern unsigned int count_swap_pages(int, int); |
@@ -314,8 +298,8 @@ extern int try_to_free_swap(struct page *); | |||
314 | struct backing_dev_info; | 298 | struct backing_dev_info; |
315 | 299 | ||
316 | /* linux/mm/thrash.c */ | 300 | /* linux/mm/thrash.c */ |
317 | extern struct mm_struct * swap_token_mm; | 301 | extern struct mm_struct *swap_token_mm; |
318 | extern void grab_swap_token(void); | 302 | extern void grab_swap_token(struct mm_struct *); |
319 | extern void __put_swap_token(struct mm_struct *); | 303 | extern void __put_swap_token(struct mm_struct *); |
320 | 304 | ||
321 | static inline int has_swap_token(struct mm_struct *mm) | 305 | static inline int has_swap_token(struct mm_struct *mm) |
@@ -335,10 +319,11 @@ static inline void disable_swap_token(void) | |||
335 | } | 319 | } |
336 | 320 | ||
337 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR | 321 | #ifdef CONFIG_CGROUP_MEM_RES_CTLR |
338 | extern void mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent); | 322 | extern void |
323 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout); | ||
339 | #else | 324 | #else |
340 | static inline void | 325 | static inline void |
341 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent) | 326 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout) |
342 | { | 327 | { |
343 | } | 328 | } |
344 | #endif | 329 | #endif |
@@ -370,12 +355,20 @@ static inline void show_swap_cache_info(void) | |||
370 | } | 355 | } |
371 | 356 | ||
372 | #define free_swap_and_cache(swp) is_migration_entry(swp) | 357 | #define free_swap_and_cache(swp) is_migration_entry(swp) |
373 | #define swap_duplicate(swp) is_migration_entry(swp) | 358 | #define swapcache_prepare(swp) is_migration_entry(swp) |
359 | |||
360 | static inline void swap_duplicate(swp_entry_t swp) | ||
361 | { | ||
362 | } | ||
374 | 363 | ||
375 | static inline void swap_free(swp_entry_t swp) | 364 | static inline void swap_free(swp_entry_t swp) |
376 | { | 365 | { |
377 | } | 366 | } |
378 | 367 | ||
368 | static inline void swapcache_free(swp_entry_t swp, struct page *page) | ||
369 | { | ||
370 | } | ||
371 | |||
379 | static inline struct page *swapin_readahead(swp_entry_t swp, gfp_t gfp_mask, | 372 | static inline struct page *swapin_readahead(swp_entry_t swp, gfp_t gfp_mask, |
380 | struct vm_area_struct *vma, unsigned long addr) | 373 | struct vm_area_struct *vma, unsigned long addr) |
381 | { | 374 | { |
@@ -426,16 +419,10 @@ static inline swp_entry_t get_swap_page(void) | |||
426 | } | 419 | } |
427 | 420 | ||
428 | /* linux/mm/thrash.c */ | 421 | /* linux/mm/thrash.c */ |
429 | #define put_swap_token(x) do { } while(0) | 422 | #define put_swap_token(mm) do { } while (0) |
430 | #define grab_swap_token() do { } while(0) | 423 | #define grab_swap_token(mm) do { } while (0) |
431 | #define has_swap_token(x) 0 | 424 | #define has_swap_token(mm) 0 |
432 | #define disable_swap_token() do { } while(0) | 425 | #define disable_swap_token() do { } while (0) |
433 | |||
434 | static inline int mem_cgroup_cache_charge_swapin(struct page *page, | ||
435 | struct mm_struct *mm, gfp_t mask, bool locked) | ||
436 | { | ||
437 | return 0; | ||
438 | } | ||
439 | 426 | ||
440 | static inline void | 427 | static inline void |
441 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent) | 428 | mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent) |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index c6c84ad8bd71..80de7003d8c2 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -321,6 +321,8 @@ asmlinkage long sys_rt_sigtimedwait(const sigset_t __user *uthese, | |||
321 | siginfo_t __user *uinfo, | 321 | siginfo_t __user *uinfo, |
322 | const struct timespec __user *uts, | 322 | const struct timespec __user *uts, |
323 | size_t sigsetsize); | 323 | size_t sigsetsize); |
324 | asmlinkage long sys_rt_tgsigqueueinfo(pid_t tgid, pid_t pid, int sig, | ||
325 | siginfo_t __user *uinfo); | ||
324 | asmlinkage long sys_kill(int pid, int sig); | 326 | asmlinkage long sys_kill(int pid, int sig); |
325 | asmlinkage long sys_tgkill(int tgid, int pid, int sig); | 327 | asmlinkage long sys_tgkill(int tgid, int pid, int sig); |
326 | asmlinkage long sys_tkill(int pid, int sig); | 328 | asmlinkage long sys_tkill(int pid, int sig); |
@@ -434,6 +436,7 @@ asmlinkage long sys_fcntl(unsigned int fd, unsigned int cmd, unsigned long arg); | |||
434 | asmlinkage long sys_fcntl64(unsigned int fd, | 436 | asmlinkage long sys_fcntl64(unsigned int fd, |
435 | unsigned int cmd, unsigned long arg); | 437 | unsigned int cmd, unsigned long arg); |
436 | #endif | 438 | #endif |
439 | asmlinkage long sys_pipe(int __user *fildes); | ||
437 | asmlinkage long sys_pipe2(int __user *fildes, int flags); | 440 | asmlinkage long sys_pipe2(int __user *fildes, int flags); |
438 | asmlinkage long sys_dup(unsigned int fildes); | 441 | asmlinkage long sys_dup(unsigned int fildes); |
439 | asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd); | 442 | asmlinkage long sys_dup2(unsigned int oldfd, unsigned int newfd); |
@@ -751,13 +754,11 @@ asmlinkage long sys_pselect6(int, fd_set __user *, fd_set __user *, | |||
751 | asmlinkage long sys_ppoll(struct pollfd __user *, unsigned int, | 754 | asmlinkage long sys_ppoll(struct pollfd __user *, unsigned int, |
752 | struct timespec __user *, const sigset_t __user *, | 755 | struct timespec __user *, const sigset_t __user *, |
753 | size_t); | 756 | size_t); |
754 | asmlinkage long sys_pipe2(int __user *, int); | ||
755 | asmlinkage long sys_pipe(int __user *); | ||
756 | 757 | ||
757 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]); | 758 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]); |
758 | 759 | ||
759 | 760 | ||
760 | asmlinkage long sys_perf_counter_open( | 761 | asmlinkage long sys_perf_counter_open( |
761 | const struct perf_counter_attr __user *attr_uptr, | 762 | struct perf_counter_attr __user *attr_uptr, |
762 | pid_t pid, int cpu, int group_fd, unsigned long flags); | 763 | pid_t pid, int cpu, int group_fd, unsigned long flags); |
763 | #endif | 764 | #endif |
diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h index 98a1d8cfb73d..99adcdc0d3ca 100644 --- a/include/linux/sysrq.h +++ b/include/linux/sysrq.h | |||
@@ -14,6 +14,8 @@ | |||
14 | #ifndef _LINUX_SYSRQ_H | 14 | #ifndef _LINUX_SYSRQ_H |
15 | #define _LINUX_SYSRQ_H | 15 | #define _LINUX_SYSRQ_H |
16 | 16 | ||
17 | #include <linux/errno.h> | ||
18 | |||
17 | struct pt_regs; | 19 | struct pt_regs; |
18 | struct tty_struct; | 20 | struct tty_struct; |
19 | 21 | ||
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 9d5078bd23a3..8afac76cd748 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -377,7 +377,7 @@ struct tcp_sock { | |||
377 | unsigned int keepalive_time; /* time before keep alive takes place */ | 377 | unsigned int keepalive_time; /* time before keep alive takes place */ |
378 | unsigned int keepalive_intvl; /* time interval between keep alive probes */ | 378 | unsigned int keepalive_intvl; /* time interval between keep alive probes */ |
379 | 379 | ||
380 | unsigned long last_synq_overflow; | 380 | int linger2; |
381 | 381 | ||
382 | /* Receiver side RTT estimation */ | 382 | /* Receiver side RTT estimation */ |
383 | struct { | 383 | struct { |
@@ -406,8 +406,6 @@ struct tcp_sock { | |||
406 | /* TCP MD5 Signagure Option information */ | 406 | /* TCP MD5 Signagure Option information */ |
407 | struct tcp_md5sig_info *md5sig_info; | 407 | struct tcp_md5sig_info *md5sig_info; |
408 | #endif | 408 | #endif |
409 | |||
410 | int linger2; | ||
411 | }; | 409 | }; |
412 | 410 | ||
413 | static inline struct tcp_sock *tcp_sk(const struct sock *sk) | 411 | static inline struct tcp_sock *tcp_sk(const struct sock *sk) |
diff --git a/include/linux/tick.h b/include/linux/tick.h index 469b82d88b3b..0482229c07db 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h | |||
@@ -97,10 +97,12 @@ extern void tick_clock_notify(void); | |||
97 | extern int tick_check_oneshot_change(int allow_nohz); | 97 | extern int tick_check_oneshot_change(int allow_nohz); |
98 | extern struct tick_sched *tick_get_tick_sched(int cpu); | 98 | extern struct tick_sched *tick_get_tick_sched(int cpu); |
99 | extern void tick_check_idle(int cpu); | 99 | extern void tick_check_idle(int cpu); |
100 | extern int tick_oneshot_mode_active(void); | ||
100 | # else | 101 | # else |
101 | static inline void tick_clock_notify(void) { } | 102 | static inline void tick_clock_notify(void) { } |
102 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } | 103 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } |
103 | static inline void tick_check_idle(int cpu) { } | 104 | static inline void tick_check_idle(int cpu) { } |
105 | static inline int tick_oneshot_mode_active(void) { return 0; } | ||
104 | # endif | 106 | # endif |
105 | 107 | ||
106 | #else /* CONFIG_GENERIC_CLOCKEVENTS */ | 108 | #else /* CONFIG_GENERIC_CLOCKEVENTS */ |
@@ -109,6 +111,7 @@ static inline void tick_cancel_sched_timer(int cpu) { } | |||
109 | static inline void tick_clock_notify(void) { } | 111 | static inline void tick_clock_notify(void) { } |
110 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } | 112 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } |
111 | static inline void tick_check_idle(int cpu) { } | 113 | static inline void tick_check_idle(int cpu) { } |
114 | static inline int tick_oneshot_mode_active(void) { return 0; } | ||
112 | #endif /* !CONFIG_GENERIC_CLOCKEVENTS */ | 115 | #endif /* !CONFIG_GENERIC_CLOCKEVENTS */ |
113 | 116 | ||
114 | # ifdef CONFIG_NO_HZ | 117 | # ifdef CONFIG_NO_HZ |
diff --git a/include/linux/timer.h b/include/linux/timer.h index 6cdb6f3331f1..be62ec2ebea5 100644 --- a/include/linux/timer.h +++ b/include/linux/timer.h | |||
@@ -163,7 +163,10 @@ extern void add_timer_on(struct timer_list *timer, int cpu); | |||
163 | extern int del_timer(struct timer_list * timer); | 163 | extern int del_timer(struct timer_list * timer); |
164 | extern int mod_timer(struct timer_list *timer, unsigned long expires); | 164 | extern int mod_timer(struct timer_list *timer, unsigned long expires); |
165 | extern int mod_timer_pending(struct timer_list *timer, unsigned long expires); | 165 | extern int mod_timer_pending(struct timer_list *timer, unsigned long expires); |
166 | extern int mod_timer_pinned(struct timer_list *timer, unsigned long expires); | ||
166 | 167 | ||
168 | #define TIMER_NOT_PINNED 0 | ||
169 | #define TIMER_PINNED 1 | ||
167 | /* | 170 | /* |
168 | * The jiffies value which is added to now, when there is no timer | 171 | * The jiffies value which is added to now, when there is no timer |
169 | * in the timer wheel: | 172 | * in the timer wheel: |
@@ -187,6 +190,8 @@ extern unsigned long get_next_timer_interrupt(unsigned long now); | |||
187 | */ | 190 | */ |
188 | #ifdef CONFIG_TIMER_STATS | 191 | #ifdef CONFIG_TIMER_STATS |
189 | 192 | ||
193 | extern int timer_stats_active; | ||
194 | |||
190 | #define TIMER_STATS_FLAG_DEFERRABLE 0x1 | 195 | #define TIMER_STATS_FLAG_DEFERRABLE 0x1 |
191 | 196 | ||
192 | extern void init_timer_stats(void); | 197 | extern void init_timer_stats(void); |
@@ -200,6 +205,8 @@ extern void __timer_stats_timer_set_start_info(struct timer_list *timer, | |||
200 | 205 | ||
201 | static inline void timer_stats_timer_set_start_info(struct timer_list *timer) | 206 | static inline void timer_stats_timer_set_start_info(struct timer_list *timer) |
202 | { | 207 | { |
208 | if (likely(!timer_stats_active)) | ||
209 | return; | ||
203 | __timer_stats_timer_set_start_info(timer, __builtin_return_address(0)); | 210 | __timer_stats_timer_set_start_info(timer, __builtin_return_address(0)); |
204 | } | 211 | } |
205 | 212 | ||
diff --git a/include/linux/timex.h b/include/linux/timex.h index aa3475fcff64..e6967d10d9e5 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
@@ -170,17 +170,37 @@ struct timex { | |||
170 | #include <asm/timex.h> | 170 | #include <asm/timex.h> |
171 | 171 | ||
172 | /* | 172 | /* |
173 | * SHIFT_KG and SHIFT_KF establish the damping of the PLL and are chosen | 173 | * SHIFT_PLL is used as a dampening factor to define how much we |
174 | * for a slightly underdamped convergence characteristic. SHIFT_KH | 174 | * adjust the frequency correction for a given offset in PLL mode. |
175 | * establishes the damping of the FLL and is chosen by wisdom and black | 175 | * It also used in dampening the offset correction, to define how |
176 | * art. | 176 | * much of the current value in time_offset we correct for each |
177 | * second. Changing this value changes the stiffness of the ntp | ||
178 | * adjustment code. A lower value makes it more flexible, reducing | ||
179 | * NTP convergence time. A higher value makes it stiffer, increasing | ||
180 | * convergence time, but making the clock more stable. | ||
177 | * | 181 | * |
178 | * MAXTC establishes the maximum time constant of the PLL. With the | 182 | * In David Mills' nanokernel reference implementation SHIFT_PLL is 4. |
179 | * SHIFT_KG and SHIFT_KF values given and a time constant range from | 183 | * However this seems to increase convergence time much too long. |
180 | * zero to MAXTC, the PLL will converge in 15 minutes to 16 hours, | 184 | * |
181 | * respectively. | 185 | * https://lists.ntp.org/pipermail/hackers/2008-January/003487.html |
186 | * | ||
187 | * In the above mailing list discussion, it seems the value of 4 | ||
188 | * was appropriate for other Unix systems with HZ=100, and that | ||
189 | * SHIFT_PLL should be decreased as HZ increases. However, Linux's | ||
190 | * clock steering implementation is HZ independent. | ||
191 | * | ||
192 | * Through experimentation, a SHIFT_PLL value of 2 was found to allow | ||
193 | * for fast convergence (very similar to the NTPv3 code used prior to | ||
194 | * v2.6.19), with good clock stability. | ||
195 | * | ||
196 | * | ||
197 | * SHIFT_FLL is used as a dampening factor to define how much we | ||
198 | * adjust the frequency correction for a given offset in FLL mode. | ||
199 | * In David Mills' nanokernel reference implementation SHIFT_FLL is 2. | ||
200 | * | ||
201 | * MAXTC establishes the maximum time constant of the PLL. | ||
182 | */ | 202 | */ |
183 | #define SHIFT_PLL 4 /* PLL frequency factor (shift) */ | 203 | #define SHIFT_PLL 2 /* PLL frequency factor (shift) */ |
184 | #define SHIFT_FLL 2 /* FLL frequency factor (shift) */ | 204 | #define SHIFT_FLL 2 /* FLL frequency factor (shift) */ |
185 | #define MAXTC 10 /* maximum time constant (shift) */ | 205 | #define MAXTC 10 /* maximum time constant (shift) */ |
186 | 206 | ||
@@ -192,10 +212,10 @@ struct timex { | |||
192 | #define SHIFT_USEC 16 /* frequency offset scale (shift) */ | 212 | #define SHIFT_USEC 16 /* frequency offset scale (shift) */ |
193 | #define PPM_SCALE ((s64)NSEC_PER_USEC << (NTP_SCALE_SHIFT - SHIFT_USEC)) | 213 | #define PPM_SCALE ((s64)NSEC_PER_USEC << (NTP_SCALE_SHIFT - SHIFT_USEC)) |
194 | #define PPM_SCALE_INV_SHIFT 19 | 214 | #define PPM_SCALE_INV_SHIFT 19 |
195 | #define PPM_SCALE_INV ((1ll << (PPM_SCALE_INV_SHIFT + NTP_SCALE_SHIFT)) / \ | 215 | #define PPM_SCALE_INV ((1LL << (PPM_SCALE_INV_SHIFT + NTP_SCALE_SHIFT)) / \ |
196 | PPM_SCALE + 1) | 216 | PPM_SCALE + 1) |
197 | 217 | ||
198 | #define MAXPHASE 500000000l /* max phase error (ns) */ | 218 | #define MAXPHASE 500000000L /* max phase error (ns) */ |
199 | #define MAXFREQ 500000 /* max frequency error (ns/s) */ | 219 | #define MAXFREQ 500000 /* max frequency error (ns/s) */ |
200 | #define MAXFREQ_SCALED ((s64)MAXFREQ << NTP_SCALE_SHIFT) | 220 | #define MAXFREQ_SCALED ((s64)MAXFREQ << NTP_SCALE_SHIFT) |
201 | #define MINSEC 256 /* min interval between updates (s) */ | 221 | #define MINSEC 256 /* min interval between updates (s) */ |
@@ -260,6 +280,9 @@ extern int do_adjtimex(struct timex *); | |||
260 | 280 | ||
261 | int read_current_timer(unsigned long *timer_val); | 281 | int read_current_timer(unsigned long *timer_val); |
262 | 282 | ||
283 | /* The clock frequency of the i8253/i8254 PIT */ | ||
284 | #define PIT_TICK_RATE 1193182ul | ||
285 | |||
263 | #endif /* KERNEL */ | 286 | #endif /* KERNEL */ |
264 | 287 | ||
265 | #endif /* LINUX_TIMEX_H */ | 288 | #endif /* LINUX_TIMEX_H */ |
diff --git a/include/linux/trace_seq.h b/include/linux/trace_seq.h index c68bccba2074..c134dd1fe6b6 100644 --- a/include/linux/trace_seq.h +++ b/include/linux/trace_seq.h | |||
@@ -3,6 +3,8 @@ | |||
3 | 3 | ||
4 | #include <linux/fs.h> | 4 | #include <linux/fs.h> |
5 | 5 | ||
6 | #include <asm/page.h> | ||
7 | |||
6 | /* | 8 | /* |
7 | * Trace sequences are used to allow a function to call several other functions | 9 | * Trace sequences are used to allow a function to call several other functions |
8 | * to create a string of data to use (up to a max of PAGE_SIZE. | 10 | * to create a string of data to use (up to a max of PAGE_SIZE. |
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h index eb96603d92db..17ba82efa483 100644 --- a/include/linux/tracehook.h +++ b/include/linux/tracehook.h | |||
@@ -143,7 +143,7 @@ static inline void tracehook_report_syscall_exit(struct pt_regs *regs, int step) | |||
143 | * | 143 | * |
144 | * Return %LSM_UNSAFE_* bits applied to an exec because of tracing. | 144 | * Return %LSM_UNSAFE_* bits applied to an exec because of tracing. |
145 | * | 145 | * |
146 | * Called with task_lock() held on @task. | 146 | * @task->cred_guard_mutex is held by the caller through the do_execve(). |
147 | */ | 147 | */ |
148 | static inline int tracehook_unsafe_exec(struct task_struct *task) | 148 | static inline int tracehook_unsafe_exec(struct task_struct *task) |
149 | { | 149 | { |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 14df7e635d43..b9dc4ca0246f 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -198,7 +198,7 @@ static inline void tracepoint_synchronize_unregister(void) | |||
198 | * * This is how the trace record is structured and will | 198 | * * This is how the trace record is structured and will |
199 | * * be saved into the ring buffer. These are the fields | 199 | * * be saved into the ring buffer. These are the fields |
200 | * * that will be exposed to user-space in | 200 | * * that will be exposed to user-space in |
201 | * * /debug/tracing/events/<*>/format. | 201 | * * /sys/kernel/debug/tracing/events/<*>/format. |
202 | * * | 202 | * * |
203 | * * The declared 'local variable' is called '__entry' | 203 | * * The declared 'local variable' is called '__entry' |
204 | * * | 204 | * * |
@@ -258,7 +258,7 @@ static inline void tracepoint_synchronize_unregister(void) | |||
258 | * tracepoint callback (this is used by programmatic plugins and | 258 | * tracepoint callback (this is used by programmatic plugins and |
259 | * can also by used by generic instrumentation like SystemTap), and | 259 | * can also by used by generic instrumentation like SystemTap), and |
260 | * it is also used to expose a structured trace record in | 260 | * it is also used to expose a structured trace record in |
261 | * /debug/tracing/events/. | 261 | * /sys/kernel/debug/tracing/events/. |
262 | */ | 262 | */ |
263 | 263 | ||
264 | #define TRACE_EVENT(name, proto, args, struct, assign, print) \ | 264 | #define TRACE_EVENT(name, proto, args, struct, assign, print) \ |
diff --git a/include/linux/types.h b/include/linux/types.h index 5abe354020f9..c42724f8c802 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -131,7 +131,7 @@ typedef __s64 int64_t; | |||
131 | * | 131 | * |
132 | * blkcnt_t is the type of the inode's block count. | 132 | * blkcnt_t is the type of the inode's block count. |
133 | */ | 133 | */ |
134 | #ifdef CONFIG_LBD | 134 | #ifdef CONFIG_LBDAF |
135 | typedef u64 sector_t; | 135 | typedef u64 sector_t; |
136 | typedef u64 blkcnt_t; | 136 | typedef u64 blkcnt_t; |
137 | #else | 137 | #else |
diff --git a/include/linux/ucb1400.h b/include/linux/ucb1400.h index 970473bf8d5a..ed889f4168f3 100644 --- a/include/linux/ucb1400.h +++ b/include/linux/ucb1400.h | |||
@@ -134,28 +134,13 @@ static inline void ucb1400_adc_enable(struct snd_ac97 *ac97) | |||
134 | ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA); | 134 | ucb1400_reg_write(ac97, UCB_ADC_CR, UCB_ADC_ENA); |
135 | } | 135 | } |
136 | 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) | 137 | static inline void ucb1400_adc_disable(struct snd_ac97 *ac97) |
157 | { | 138 | { |
158 | ucb1400_reg_write(ac97, UCB_ADC_CR, 0); | 139 | ucb1400_reg_write(ac97, UCB_ADC_CR, 0); |
159 | } | 140 | } |
160 | 141 | ||
142 | |||
143 | unsigned int ucb1400_adc_read(struct snd_ac97 *ac97, u16 adc_channel, | ||
144 | int adcsync); | ||
145 | |||
161 | #endif | 146 | #endif |
diff --git a/include/linux/ultrasound.h b/include/linux/ultrasound.h index 6b7703e75cec..71339dc531c5 100644 --- a/include/linux/ultrasound.h +++ b/include/linux/ultrasound.h | |||
@@ -34,7 +34,7 @@ | |||
34 | * _GUS_VOICEOFF - Stops voice (no parameters) | 34 | * _GUS_VOICEOFF - Stops voice (no parameters) |
35 | * _GUS_VOICEFADE - Stops the voice smoothly. | 35 | * _GUS_VOICEFADE - Stops the voice smoothly. |
36 | * _GUS_VOICEMODE - Alters the voice mode, don't start or stop voice (P1=voice mode) | 36 | * _GUS_VOICEMODE - Alters the voice mode, don't start or stop voice (P1=voice mode) |
37 | * _GUS_VOICEBALA - Sets voice balence (P1, 0=left, 7=middle and 15=right, default 7) | 37 | * _GUS_VOICEBALA - Sets voice balance (P1, 0=left, 7=middle and 15=right, default 7) |
38 | * _GUS_VOICEFREQ - Sets voice (sample) playback frequency (P1=Hz) | 38 | * _GUS_VOICEFREQ - Sets voice (sample) playback frequency (P1=Hz) |
39 | * _GUS_VOICEVOL - Sets voice volume (P1=volume, 0xfff=max, 0xeff=half, 0x000=off) | 39 | * _GUS_VOICEVOL - Sets voice volume (P1=volume, 0xfff=max, 0xeff=half, 0x000=off) |
40 | * _GUS_VOICEVOL2 - Sets voice volume (P1=volume, 0xfff=max, 0xeff=half, 0x000=off) | 40 | * _GUS_VOICEVOL2 - Sets voice volume (P1=volume, 0xfff=max, 0xeff=half, 0x000=off) |
diff --git a/include/linux/usb.h b/include/linux/usb.h index 3aa2cd1f8d08..b1e3c2fbfe11 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -36,6 +36,7 @@ struct wusb_dev; | |||
36 | * - configs have one (often) or more interfaces; | 36 | * - configs have one (often) or more interfaces; |
37 | * - interfaces have one (usually) or more settings; | 37 | * - interfaces have one (usually) or more settings; |
38 | * - each interface setting has zero or (usually) more endpoints. | 38 | * - each interface setting has zero or (usually) more endpoints. |
39 | * - a SuperSpeed endpoint has a companion descriptor | ||
39 | * | 40 | * |
40 | * And there might be other descriptors mixed in with those. | 41 | * And there might be other descriptors mixed in with those. |
41 | * | 42 | * |
@@ -44,6 +45,19 @@ struct wusb_dev; | |||
44 | 45 | ||
45 | struct ep_device; | 46 | struct ep_device; |
46 | 47 | ||
48 | /* For SS devices */ | ||
49 | /** | ||
50 | * struct usb_host_ss_ep_comp - Valid for SuperSpeed devices only | ||
51 | * @desc: endpoint companion descriptor, wMaxPacketSize in native byteorder | ||
52 | * @extra: descriptors following this endpoint companion descriptor | ||
53 | * @extralen: how many bytes of "extra" are valid | ||
54 | */ | ||
55 | struct usb_host_ss_ep_comp { | ||
56 | struct usb_ss_ep_comp_descriptor desc; | ||
57 | unsigned char *extra; /* Extra descriptors */ | ||
58 | int extralen; | ||
59 | }; | ||
60 | |||
47 | /** | 61 | /** |
48 | * struct usb_host_endpoint - host-side endpoint descriptor and queue | 62 | * struct usb_host_endpoint - host-side endpoint descriptor and queue |
49 | * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder | 63 | * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder |
@@ -51,6 +65,7 @@ struct ep_device; | |||
51 | * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH) | 65 | * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH) |
52 | * with one or more transfer descriptors (TDs) per urb | 66 | * with one or more transfer descriptors (TDs) per urb |
53 | * @ep_dev: ep_device for sysfs info | 67 | * @ep_dev: ep_device for sysfs info |
68 | * @ss_ep_comp: companion descriptor information for this endpoint | ||
54 | * @extra: descriptors following this endpoint in the configuration | 69 | * @extra: descriptors following this endpoint in the configuration |
55 | * @extralen: how many bytes of "extra" are valid | 70 | * @extralen: how many bytes of "extra" are valid |
56 | * @enabled: URBs may be submitted to this endpoint | 71 | * @enabled: URBs may be submitted to this endpoint |
@@ -63,6 +78,7 @@ struct usb_host_endpoint { | |||
63 | struct list_head urb_list; | 78 | struct list_head urb_list; |
64 | void *hcpriv; | 79 | void *hcpriv; |
65 | struct ep_device *ep_dev; /* For sysfs info */ | 80 | struct ep_device *ep_dev; /* For sysfs info */ |
81 | struct usb_host_ss_ep_comp *ss_ep_comp; /* For SS devices */ | ||
66 | 82 | ||
67 | unsigned char *extra; /* Extra descriptors */ | 83 | unsigned char *extra; /* Extra descriptors */ |
68 | int extralen; | 84 | int extralen; |
@@ -336,7 +352,6 @@ struct usb_bus { | |||
336 | #ifdef CONFIG_USB_DEVICEFS | 352 | #ifdef CONFIG_USB_DEVICEFS |
337 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */ | 353 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */ |
338 | #endif | 354 | #endif |
339 | struct device *dev; /* device for this bus */ | ||
340 | 355 | ||
341 | #if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE) | 356 | #if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE) |
342 | struct mon_bus *mon_bus; /* non-null when associated */ | 357 | struct mon_bus *mon_bus; /* non-null when associated */ |
@@ -363,6 +378,7 @@ struct usb_tt; | |||
363 | * struct usb_device - kernel's representation of a USB device | 378 | * struct usb_device - kernel's representation of a USB device |
364 | * @devnum: device number; address on a USB bus | 379 | * @devnum: device number; address on a USB bus |
365 | * @devpath: device ID string for use in messages (e.g., /port/...) | 380 | * @devpath: device ID string for use in messages (e.g., /port/...) |
381 | * @route: tree topology hex string for use with xHCI | ||
366 | * @state: device state: configured, not attached, etc. | 382 | * @state: device state: configured, not attached, etc. |
367 | * @speed: device speed: high/full/low (or error) | 383 | * @speed: device speed: high/full/low (or error) |
368 | * @tt: Transaction Translator info; used with low/full speed dev, highspeed hub | 384 | * @tt: Transaction Translator info; used with low/full speed dev, highspeed hub |
@@ -420,6 +436,7 @@ struct usb_tt; | |||
420 | * @skip_sys_resume: skip the next system resume | 436 | * @skip_sys_resume: skip the next system resume |
421 | * @wusb_dev: if this is a Wireless USB device, link to the WUSB | 437 | * @wusb_dev: if this is a Wireless USB device, link to the WUSB |
422 | * specific data for the device. | 438 | * specific data for the device. |
439 | * @slot_id: Slot ID assigned by xHCI | ||
423 | * | 440 | * |
424 | * Notes: | 441 | * Notes: |
425 | * Usbcore drivers should not set usbdev->state directly. Instead use | 442 | * Usbcore drivers should not set usbdev->state directly. Instead use |
@@ -428,6 +445,7 @@ struct usb_tt; | |||
428 | struct usb_device { | 445 | struct usb_device { |
429 | int devnum; | 446 | int devnum; |
430 | char devpath [16]; | 447 | char devpath [16]; |
448 | u32 route; | ||
431 | enum usb_device_state state; | 449 | enum usb_device_state state; |
432 | enum usb_device_speed speed; | 450 | enum usb_device_speed speed; |
433 | 451 | ||
@@ -503,6 +521,7 @@ struct usb_device { | |||
503 | unsigned skip_sys_resume:1; | 521 | unsigned skip_sys_resume:1; |
504 | #endif | 522 | #endif |
505 | struct wusb_dev *wusb_dev; | 523 | struct wusb_dev *wusb_dev; |
524 | int slot_id; | ||
506 | }; | 525 | }; |
507 | #define to_usb_device(d) container_of(d, struct usb_device, dev) | 526 | #define to_usb_device(d) container_of(d, struct usb_device, dev) |
508 | 527 | ||
@@ -903,6 +922,8 @@ extern struct bus_type usb_bus_type; | |||
903 | /** | 922 | /** |
904 | * struct usb_class_driver - identifies a USB driver that wants to use the USB major number | 923 | * struct usb_class_driver - identifies a USB driver that wants to use the USB major number |
905 | * @name: the usb class device name for this driver. Will show up in sysfs. | 924 | * @name: the usb class device name for this driver. Will show up in sysfs. |
925 | * @nodename: Callback to provide a naming hint for a possible | ||
926 | * device node to create. | ||
906 | * @fops: pointer to the struct file_operations of this driver. | 927 | * @fops: pointer to the struct file_operations of this driver. |
907 | * @minor_base: the start of the minor range for this driver. | 928 | * @minor_base: the start of the minor range for this driver. |
908 | * | 929 | * |
@@ -912,6 +933,7 @@ extern struct bus_type usb_bus_type; | |||
912 | */ | 933 | */ |
913 | struct usb_class_driver { | 934 | struct usb_class_driver { |
914 | char *name; | 935 | char *name; |
936 | char *(*nodename)(struct device *dev); | ||
915 | const struct file_operations *fops; | 937 | const struct file_operations *fops; |
916 | int minor_base; | 938 | int minor_base; |
917 | }; | 939 | }; |
@@ -1024,6 +1046,8 @@ typedef void (*usb_complete_t)(struct urb *); | |||
1024 | * the device driver is saying that it provided this DMA address, | 1046 | * the device driver is saying that it provided this DMA address, |
1025 | * which the host controller driver should use in preference to the | 1047 | * which the host controller driver should use in preference to the |
1026 | * transfer_buffer. | 1048 | * transfer_buffer. |
1049 | * @sg: scatter gather buffer list | ||
1050 | * @num_sgs: number of entries in the sg list | ||
1027 | * @transfer_buffer_length: How big is transfer_buffer. The transfer may | 1051 | * @transfer_buffer_length: How big is transfer_buffer. The transfer may |
1028 | * be broken up into chunks according to the current maximum packet | 1052 | * be broken up into chunks according to the current maximum packet |
1029 | * size for the endpoint, which is a function of the configuration | 1053 | * size for the endpoint, which is a function of the configuration |
@@ -1041,7 +1065,9 @@ typedef void (*usb_complete_t)(struct urb *); | |||
1041 | * @setup_dma: For control transfers with URB_NO_SETUP_DMA_MAP set, the | 1065 | * @setup_dma: For control transfers with URB_NO_SETUP_DMA_MAP set, the |
1042 | * device driver has provided this DMA address for the setup packet. | 1066 | * device driver has provided this DMA address for the setup packet. |
1043 | * The host controller driver should use this in preference to | 1067 | * The host controller driver should use this in preference to |
1044 | * setup_packet. | 1068 | * setup_packet, but the HCD may chose to ignore the address if it must |
1069 | * copy the setup packet into internal structures. Therefore, setup_packet | ||
1070 | * must always point to a valid buffer. | ||
1045 | * @start_frame: Returns the initial frame for isochronous transfers. | 1071 | * @start_frame: Returns the initial frame for isochronous transfers. |
1046 | * @number_of_packets: Lists the number of ISO transfer buffers. | 1072 | * @number_of_packets: Lists the number of ISO transfer buffers. |
1047 | * @interval: Specifies the polling interval for interrupt or isochronous | 1073 | * @interval: Specifies the polling interval for interrupt or isochronous |
@@ -1177,6 +1203,8 @@ struct urb { | |||
1177 | unsigned int transfer_flags; /* (in) URB_SHORT_NOT_OK | ...*/ | 1203 | unsigned int transfer_flags; /* (in) URB_SHORT_NOT_OK | ...*/ |
1178 | void *transfer_buffer; /* (in) associated data buffer */ | 1204 | void *transfer_buffer; /* (in) associated data buffer */ |
1179 | dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */ | 1205 | dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */ |
1206 | struct usb_sg_request *sg; /* (in) scatter gather buffer list */ | ||
1207 | int num_sgs; /* (in) number of entries in the sg list */ | ||
1180 | u32 transfer_buffer_length; /* (in) data buffer length */ | 1208 | u32 transfer_buffer_length; /* (in) data buffer length */ |
1181 | u32 actual_length; /* (return) actual transfer length */ | 1209 | u32 actual_length; /* (return) actual transfer length */ |
1182 | unsigned char *setup_packet; /* (in) setup packet (control only) */ | 1210 | unsigned char *setup_packet; /* (in) setup packet (control only) */ |
@@ -1422,8 +1450,8 @@ struct usb_sg_request { | |||
1422 | int status; | 1450 | int status; |
1423 | size_t bytes; | 1451 | size_t bytes; |
1424 | 1452 | ||
1425 | /* | 1453 | /* private: |
1426 | * members below are private: to usbcore, | 1454 | * members below are private to usbcore, |
1427 | * and are not provided for driver access! | 1455 | * and are not provided for driver access! |
1428 | */ | 1456 | */ |
1429 | spinlock_t lock; | 1457 | spinlock_t lock; |
@@ -1558,6 +1586,9 @@ extern void usb_unregister_notify(struct notifier_block *nb); | |||
1558 | #define err(format, arg...) printk(KERN_ERR KBUILD_MODNAME ": " \ | 1586 | #define err(format, arg...) printk(KERN_ERR KBUILD_MODNAME ": " \ |
1559 | format "\n" , ## arg) | 1587 | format "\n" , ## arg) |
1560 | 1588 | ||
1589 | /* debugfs stuff */ | ||
1590 | extern struct dentry *usb_debug_root; | ||
1591 | |||
1561 | #endif /* __KERNEL__ */ | 1592 | #endif /* __KERNEL__ */ |
1562 | 1593 | ||
1563 | #endif | 1594 | #endif |
diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h index 8cb025fef634..b5744bc218ab 100644 --- a/include/linux/usb/audio.h +++ b/include/linux/usb/audio.h | |||
@@ -24,10 +24,75 @@ | |||
24 | #define USB_SUBCLASS_AUDIOCONTROL 0x01 | 24 | #define USB_SUBCLASS_AUDIOCONTROL 0x01 |
25 | #define USB_SUBCLASS_AUDIOSTREAMING 0x02 | 25 | #define USB_SUBCLASS_AUDIOSTREAMING 0x02 |
26 | #define USB_SUBCLASS_MIDISTREAMING 0x03 | 26 | #define USB_SUBCLASS_MIDISTREAMING 0x03 |
27 | #define USB_SUBCLASS_VENDOR_SPEC 0xff | ||
27 | 28 | ||
29 | /* A.5 Audio Class-Specific AC interface Descriptor Subtypes*/ | ||
30 | #define HEADER 0x01 | ||
31 | #define INPUT_TERMINAL 0x02 | ||
32 | #define OUTPUT_TERMINAL 0x03 | ||
33 | #define MIXER_UNIT 0x04 | ||
34 | #define SELECTOR_UNIT 0x05 | ||
35 | #define FEATURE_UNIT 0x06 | ||
36 | #define PROCESSING_UNIT 0x07 | ||
37 | #define EXTENSION_UNIT 0x08 | ||
38 | |||
39 | #define AS_GENERAL 0x01 | ||
40 | #define FORMAT_TYPE 0x02 | ||
41 | #define FORMAT_SPECIFIC 0x03 | ||
42 | |||
43 | #define EP_GENERAL 0x01 | ||
44 | |||
45 | #define MS_GENERAL 0x01 | ||
46 | #define MIDI_IN_JACK 0x02 | ||
47 | #define MIDI_OUT_JACK 0x03 | ||
48 | |||
49 | /* endpoint attributes */ | ||
50 | #define EP_ATTR_MASK 0x0c | ||
51 | #define EP_ATTR_ASYNC 0x04 | ||
52 | #define EP_ATTR_ADAPTIVE 0x08 | ||
53 | #define EP_ATTR_SYNC 0x0c | ||
54 | |||
55 | /* cs endpoint attributes */ | ||
56 | #define EP_CS_ATTR_SAMPLE_RATE 0x01 | ||
57 | #define EP_CS_ATTR_PITCH_CONTROL 0x02 | ||
58 | #define EP_CS_ATTR_FILL_MAX 0x80 | ||
59 | |||
60 | /* Audio Class specific Request Codes */ | ||
61 | #define USB_AUDIO_SET_INTF 0x21 | ||
62 | #define USB_AUDIO_SET_ENDPOINT 0x22 | ||
63 | #define USB_AUDIO_GET_INTF 0xa1 | ||
64 | #define USB_AUDIO_GET_ENDPOINT 0xa2 | ||
65 | |||
66 | #define SET_ 0x00 | ||
67 | #define GET_ 0x80 | ||
68 | |||
69 | #define _CUR 0x1 | ||
70 | #define _MIN 0x2 | ||
71 | #define _MAX 0x3 | ||
72 | #define _RES 0x4 | ||
73 | #define _MEM 0x5 | ||
74 | |||
75 | #define SET_CUR (SET_ | _CUR) | ||
76 | #define GET_CUR (GET_ | _CUR) | ||
77 | #define SET_MIN (SET_ | _MIN) | ||
78 | #define GET_MIN (GET_ | _MIN) | ||
79 | #define SET_MAX (SET_ | _MAX) | ||
80 | #define GET_MAX (GET_ | _MAX) | ||
81 | #define SET_RES (SET_ | _RES) | ||
82 | #define GET_RES (GET_ | _RES) | ||
83 | #define SET_MEM (SET_ | _MEM) | ||
84 | #define GET_MEM (GET_ | _MEM) | ||
85 | |||
86 | #define GET_STAT 0xff | ||
87 | |||
88 | #define USB_AC_TERMINAL_UNDEFINED 0x100 | ||
89 | #define USB_AC_TERMINAL_STREAMING 0x101 | ||
90 | #define USB_AC_TERMINAL_VENDOR_SPEC 0x1FF | ||
91 | |||
92 | /* Terminal Control Selectors */ | ||
28 | /* 4.3.2 Class-Specific AC Interface Descriptor */ | 93 | /* 4.3.2 Class-Specific AC Interface Descriptor */ |
29 | struct usb_ac_header_descriptor { | 94 | struct usb_ac_header_descriptor { |
30 | __u8 bLength; /* 8+n */ | 95 | __u8 bLength; /* 8 + n */ |
31 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | 96 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ |
32 | __u8 bDescriptorSubtype; /* USB_MS_HEADER */ | 97 | __u8 bDescriptorSubtype; /* USB_MS_HEADER */ |
33 | __le16 bcdADC; /* 0x0100 */ | 98 | __le16 bcdADC; /* 0x0100 */ |
@@ -36,7 +101,7 @@ struct usb_ac_header_descriptor { | |||
36 | __u8 baInterfaceNr[]; /* [n] */ | 101 | __u8 baInterfaceNr[]; /* [n] */ |
37 | } __attribute__ ((packed)); | 102 | } __attribute__ ((packed)); |
38 | 103 | ||
39 | #define USB_DT_AC_HEADER_SIZE(n) (8+(n)) | 104 | #define USB_DT_AC_HEADER_SIZE(n) (8 + (n)) |
40 | 105 | ||
41 | /* As above, but more useful for defining your own descriptors: */ | 106 | /* As above, but more useful for defining your own descriptors: */ |
42 | #define DECLARE_USB_AC_HEADER_DESCRIPTOR(n) \ | 107 | #define DECLARE_USB_AC_HEADER_DESCRIPTOR(n) \ |
@@ -50,4 +115,200 @@ struct usb_ac_header_descriptor_##n { \ | |||
50 | __u8 baInterfaceNr[n]; \ | 115 | __u8 baInterfaceNr[n]; \ |
51 | } __attribute__ ((packed)) | 116 | } __attribute__ ((packed)) |
52 | 117 | ||
118 | /* 4.3.2.1 Input Terminal Descriptor */ | ||
119 | struct usb_input_terminal_descriptor { | ||
120 | __u8 bLength; /* in bytes: 12 */ | ||
121 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ | ||
122 | __u8 bDescriptorSubtype; /* INPUT_TERMINAL descriptor subtype */ | ||
123 | __u8 bTerminalID; /* Constant uniquely terminal ID */ | ||
124 | __le16 wTerminalType; /* USB Audio Terminal Types */ | ||
125 | __u8 bAssocTerminal; /* ID of the Output Terminal associated */ | ||
126 | __u8 bNrChannels; /* Number of logical output channels */ | ||
127 | __le16 wChannelConfig; | ||
128 | __u8 iChannelNames; | ||
129 | __u8 iTerminal; | ||
130 | } __attribute__ ((packed)); | ||
131 | |||
132 | #define USB_DT_AC_INPUT_TERMINAL_SIZE 12 | ||
133 | |||
134 | #define USB_AC_INPUT_TERMINAL_UNDEFINED 0x200 | ||
135 | #define USB_AC_INPUT_TERMINAL_MICROPHONE 0x201 | ||
136 | #define USB_AC_INPUT_TERMINAL_DESKTOP_MICROPHONE 0x202 | ||
137 | #define USB_AC_INPUT_TERMINAL_PERSONAL_MICROPHONE 0x203 | ||
138 | #define USB_AC_INPUT_TERMINAL_OMNI_DIR_MICROPHONE 0x204 | ||
139 | #define USB_AC_INPUT_TERMINAL_MICROPHONE_ARRAY 0x205 | ||
140 | #define USB_AC_INPUT_TERMINAL_PROC_MICROPHONE_ARRAY 0x206 | ||
141 | |||
142 | /* 4.3.2.2 Output Terminal Descriptor */ | ||
143 | struct usb_output_terminal_descriptor { | ||
144 | __u8 bLength; /* in bytes: 9 */ | ||
145 | __u8 bDescriptorType; /* CS_INTERFACE descriptor type */ | ||
146 | __u8 bDescriptorSubtype; /* OUTPUT_TERMINAL descriptor subtype */ | ||
147 | __u8 bTerminalID; /* Constant uniquely terminal ID */ | ||
148 | __le16 wTerminalType; /* USB Audio Terminal Types */ | ||
149 | __u8 bAssocTerminal; /* ID of the Input Terminal associated */ | ||
150 | __u8 bSourceID; /* ID of the connected Unit or Terminal*/ | ||
151 | __u8 iTerminal; | ||
152 | } __attribute__ ((packed)); | ||
153 | |||
154 | #define USB_DT_AC_OUTPUT_TERMINAL_SIZE 9 | ||
155 | |||
156 | #define USB_AC_OUTPUT_TERMINAL_UNDEFINED 0x300 | ||
157 | #define USB_AC_OUTPUT_TERMINAL_SPEAKER 0x301 | ||
158 | #define USB_AC_OUTPUT_TERMINAL_HEADPHONES 0x302 | ||
159 | #define USB_AC_OUTPUT_TERMINAL_HEAD_MOUNTED_DISPLAY_AUDIO 0x303 | ||
160 | #define USB_AC_OUTPUT_TERMINAL_DESKTOP_SPEAKER 0x304 | ||
161 | #define USB_AC_OUTPUT_TERMINAL_ROOM_SPEAKER 0x305 | ||
162 | #define USB_AC_OUTPUT_TERMINAL_COMMUNICATION_SPEAKER 0x306 | ||
163 | #define USB_AC_OUTPUT_TERMINAL_LOW_FREQ_EFFECTS_SPEAKER 0x307 | ||
164 | |||
165 | /* Set bControlSize = 2 as default setting */ | ||
166 | #define USB_DT_AC_FEATURE_UNIT_SIZE(ch) (7 + ((ch) + 1) * 2) | ||
167 | |||
168 | /* As above, but more useful for defining your own descriptors: */ | ||
169 | #define DECLARE_USB_AC_FEATURE_UNIT_DESCRIPTOR(ch) \ | ||
170 | struct usb_ac_feature_unit_descriptor_##ch { \ | ||
171 | __u8 bLength; \ | ||
172 | __u8 bDescriptorType; \ | ||
173 | __u8 bDescriptorSubtype; \ | ||
174 | __u8 bUnitID; \ | ||
175 | __u8 bSourceID; \ | ||
176 | __u8 bControlSize; \ | ||
177 | __le16 bmaControls[ch + 1]; \ | ||
178 | __u8 iFeature; \ | ||
179 | } __attribute__ ((packed)) | ||
180 | |||
181 | /* 4.5.2 Class-Specific AS Interface Descriptor */ | ||
182 | struct usb_as_header_descriptor { | ||
183 | __u8 bLength; /* in bytes: 7 */ | ||
184 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | ||
185 | __u8 bDescriptorSubtype; /* AS_GENERAL */ | ||
186 | __u8 bTerminalLink; /* Terminal ID of connected Terminal */ | ||
187 | __u8 bDelay; /* Delay introduced by the data path */ | ||
188 | __le16 wFormatTag; /* The Audio Data Format */ | ||
189 | } __attribute__ ((packed)); | ||
190 | |||
191 | #define USB_DT_AS_HEADER_SIZE 7 | ||
192 | |||
193 | #define USB_AS_AUDIO_FORMAT_TYPE_I_UNDEFINED 0x0 | ||
194 | #define USB_AS_AUDIO_FORMAT_TYPE_I_PCM 0x1 | ||
195 | #define USB_AS_AUDIO_FORMAT_TYPE_I_PCM8 0x2 | ||
196 | #define USB_AS_AUDIO_FORMAT_TYPE_I_IEEE_FLOAT 0x3 | ||
197 | #define USB_AS_AUDIO_FORMAT_TYPE_I_ALAW 0x4 | ||
198 | #define USB_AS_AUDIO_FORMAT_TYPE_I_MULAW 0x5 | ||
199 | |||
200 | struct usb_as_format_type_i_continuous_descriptor { | ||
201 | __u8 bLength; /* in bytes: 8 + (ns * 3) */ | ||
202 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | ||
203 | __u8 bDescriptorSubtype; /* FORMAT_TYPE */ | ||
204 | __u8 bFormatType; /* FORMAT_TYPE_1 */ | ||
205 | __u8 bNrChannels; /* physical channels in the stream */ | ||
206 | __u8 bSubframeSize; /* */ | ||
207 | __u8 bBitResolution; | ||
208 | __u8 bSamFreqType; | ||
209 | __u8 tLowerSamFreq[3]; | ||
210 | __u8 tUpperSamFreq[3]; | ||
211 | } __attribute__ ((packed)); | ||
212 | |||
213 | #define USB_AS_FORMAT_TYPE_I_CONTINUOUS_DESC_SIZE 14 | ||
214 | |||
215 | struct usb_as_formate_type_i_discrete_descriptor { | ||
216 | __u8 bLength; /* in bytes: 8 + (ns * 3) */ | ||
217 | __u8 bDescriptorType; /* USB_DT_CS_INTERFACE */ | ||
218 | __u8 bDescriptorSubtype; /* FORMAT_TYPE */ | ||
219 | __u8 bFormatType; /* FORMAT_TYPE_1 */ | ||
220 | __u8 bNrChannels; /* physical channels in the stream */ | ||
221 | __u8 bSubframeSize; /* */ | ||
222 | __u8 bBitResolution; | ||
223 | __u8 bSamFreqType; | ||
224 | __u8 tSamFreq[][3]; | ||
225 | } __attribute__ ((packed)); | ||
226 | |||
227 | #define DECLARE_USB_AS_FORMAT_TYPE_I_DISCRETE_DESC(n) \ | ||
228 | struct usb_as_formate_type_i_discrete_descriptor_##n { \ | ||
229 | __u8 bLength; \ | ||
230 | __u8 bDescriptorType; \ | ||
231 | __u8 bDescriptorSubtype; \ | ||
232 | __u8 bFormatType; \ | ||
233 | __u8 bNrChannels; \ | ||
234 | __u8 bSubframeSize; \ | ||
235 | __u8 bBitResolution; \ | ||
236 | __u8 bSamFreqType; \ | ||
237 | __u8 tSamFreq[n][3]; \ | ||
238 | } __attribute__ ((packed)) | ||
239 | |||
240 | #define USB_AS_FORMAT_TYPE_I_DISCRETE_DESC_SIZE(n) (8 + (n * 3)) | ||
241 | |||
242 | #define USB_AS_FORMAT_TYPE_UNDEFINED 0x0 | ||
243 | #define USB_AS_FORMAT_TYPE_I 0x1 | ||
244 | #define USB_AS_FORMAT_TYPE_II 0x2 | ||
245 | #define USB_AS_FORMAT_TYPE_III 0x3 | ||
246 | |||
247 | #define USB_AS_ENDPOINT_ASYNC (1 << 2) | ||
248 | #define USB_AS_ENDPOINT_ADAPTIVE (2 << 2) | ||
249 | #define USB_AS_ENDPOINT_SYNC (3 << 2) | ||
250 | |||
251 | struct usb_as_iso_endpoint_descriptor { | ||
252 | __u8 bLength; /* in bytes: 7 */ | ||
253 | __u8 bDescriptorType; /* USB_DT_CS_ENDPOINT */ | ||
254 | __u8 bDescriptorSubtype; /* EP_GENERAL */ | ||
255 | __u8 bmAttributes; | ||
256 | __u8 bLockDelayUnits; | ||
257 | __le16 wLockDelay; | ||
258 | }; | ||
259 | #define USB_AS_ISO_ENDPOINT_DESC_SIZE 7 | ||
260 | |||
261 | #define FU_CONTROL_UNDEFINED 0x00 | ||
262 | #define MUTE_CONTROL 0x01 | ||
263 | #define VOLUME_CONTROL 0x02 | ||
264 | #define BASS_CONTROL 0x03 | ||
265 | #define MID_CONTROL 0x04 | ||
266 | #define TREBLE_CONTROL 0x05 | ||
267 | #define GRAPHIC_EQUALIZER_CONTROL 0x06 | ||
268 | #define AUTOMATIC_GAIN_CONTROL 0x07 | ||
269 | #define DELAY_CONTROL 0x08 | ||
270 | #define BASS_BOOST_CONTROL 0x09 | ||
271 | #define LOUDNESS_CONTROL 0x0a | ||
272 | |||
273 | #define FU_MUTE (1 << (MUTE_CONTROL - 1)) | ||
274 | #define FU_VOLUME (1 << (VOLUME_CONTROL - 1)) | ||
275 | #define FU_BASS (1 << (BASS_CONTROL - 1)) | ||
276 | #define FU_MID (1 << (MID_CONTROL - 1)) | ||
277 | #define FU_TREBLE (1 << (TREBLE_CONTROL - 1)) | ||
278 | #define FU_GRAPHIC_EQ (1 << (GRAPHIC_EQUALIZER_CONTROL - 1)) | ||
279 | #define FU_AUTO_GAIN (1 << (AUTOMATIC_GAIN_CONTROL - 1)) | ||
280 | #define FU_DELAY (1 << (DELAY_CONTROL - 1)) | ||
281 | #define FU_BASS_BOOST (1 << (BASS_BOOST_CONTROL - 1)) | ||
282 | #define FU_LOUDNESS (1 << (LOUDNESS_CONTROL - 1)) | ||
283 | |||
284 | struct usb_audio_control { | ||
285 | struct list_head list; | ||
286 | const char *name; | ||
287 | u8 type; | ||
288 | int data[5]; | ||
289 | int (*set)(struct usb_audio_control *con, u8 cmd, int value); | ||
290 | int (*get)(struct usb_audio_control *con, u8 cmd); | ||
291 | }; | ||
292 | |||
293 | static inline int generic_set_cmd(struct usb_audio_control *con, u8 cmd, int value) | ||
294 | { | ||
295 | con->data[cmd] = value; | ||
296 | |||
297 | return 0; | ||
298 | } | ||
299 | |||
300 | static inline int generic_get_cmd(struct usb_audio_control *con, u8 cmd) | ||
301 | { | ||
302 | return con->data[cmd]; | ||
303 | } | ||
304 | |||
305 | struct usb_audio_control_selector { | ||
306 | struct list_head list; | ||
307 | struct list_head control; | ||
308 | u8 id; | ||
309 | const char *name; | ||
310 | u8 type; | ||
311 | struct usb_descriptor_header *desc; | ||
312 | }; | ||
313 | |||
53 | #endif /* __LINUX_USB_AUDIO_H */ | 314 | #endif /* __LINUX_USB_AUDIO_H */ |
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h index b145119a90da..93223638f702 100644 --- a/include/linux/usb/ch9.h +++ b/include/linux/usb/ch9.h | |||
@@ -191,6 +191,8 @@ struct usb_ctrlrequest { | |||
191 | #define USB_DT_WIRE_ADAPTER 0x21 | 191 | #define USB_DT_WIRE_ADAPTER 0x21 |
192 | #define USB_DT_RPIPE 0x22 | 192 | #define USB_DT_RPIPE 0x22 |
193 | #define USB_DT_CS_RADIO_CONTROL 0x23 | 193 | #define USB_DT_CS_RADIO_CONTROL 0x23 |
194 | /* From the USB 3.0 spec */ | ||
195 | #define USB_DT_SS_ENDPOINT_COMP 0x30 | ||
194 | 196 | ||
195 | /* Conventional codes for class-specific descriptors. The convention is | 197 | /* Conventional codes for class-specific descriptors. The convention is |
196 | * defined in the USB "Common Class" Spec (3.11). Individual class specs | 198 | * defined in the USB "Common Class" Spec (3.11). Individual class specs |
@@ -535,6 +537,20 @@ static inline int usb_endpoint_is_isoc_out( | |||
535 | 537 | ||
536 | /*-------------------------------------------------------------------------*/ | 538 | /*-------------------------------------------------------------------------*/ |
537 | 539 | ||
540 | /* USB_DT_SS_ENDPOINT_COMP: SuperSpeed Endpoint Companion descriptor */ | ||
541 | struct usb_ss_ep_comp_descriptor { | ||
542 | __u8 bLength; | ||
543 | __u8 bDescriptorType; | ||
544 | |||
545 | __u8 bMaxBurst; | ||
546 | __u8 bmAttributes; | ||
547 | __u16 wBytesPerInterval; | ||
548 | } __attribute__ ((packed)); | ||
549 | |||
550 | #define USB_DT_SS_EP_COMP_SIZE 6 | ||
551 | |||
552 | /*-------------------------------------------------------------------------*/ | ||
553 | |||
538 | /* USB_DT_DEVICE_QUALIFIER: Device Qualifier descriptor */ | 554 | /* USB_DT_DEVICE_QUALIFIER: Device Qualifier descriptor */ |
539 | struct usb_qualifier_descriptor { | 555 | struct usb_qualifier_descriptor { |
540 | __u8 bLength; | 556 | __u8 bLength; |
@@ -752,6 +768,7 @@ enum usb_device_speed { | |||
752 | USB_SPEED_LOW, USB_SPEED_FULL, /* usb 1.1 */ | 768 | USB_SPEED_LOW, USB_SPEED_FULL, /* usb 1.1 */ |
753 | USB_SPEED_HIGH, /* usb 2.0 */ | 769 | USB_SPEED_HIGH, /* usb 2.0 */ |
754 | USB_SPEED_VARIABLE, /* wireless (usb 2.5) */ | 770 | USB_SPEED_VARIABLE, /* wireless (usb 2.5) */ |
771 | USB_SPEED_SUPER, /* usb 3.0 */ | ||
755 | }; | 772 | }; |
756 | 773 | ||
757 | enum usb_device_state { | 774 | enum usb_device_state { |
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index acd7b0f06c8a..4f6bb3d2160e 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
@@ -124,6 +124,7 @@ struct usb_function { | |||
124 | void (*suspend)(struct usb_function *); | 124 | void (*suspend)(struct usb_function *); |
125 | void (*resume)(struct usb_function *); | 125 | void (*resume)(struct usb_function *); |
126 | 126 | ||
127 | /* private: */ | ||
127 | /* internals */ | 128 | /* internals */ |
128 | struct list_head list; | 129 | struct list_head list; |
129 | }; | 130 | }; |
@@ -219,6 +220,7 @@ struct usb_configuration { | |||
219 | 220 | ||
220 | struct usb_composite_dev *cdev; | 221 | struct usb_composite_dev *cdev; |
221 | 222 | ||
223 | /* private: */ | ||
222 | /* internals */ | 224 | /* internals */ |
223 | struct list_head list; | 225 | struct list_head list; |
224 | struct list_head functions; | 226 | struct list_head functions; |
@@ -321,6 +323,7 @@ struct usb_composite_dev { | |||
321 | 323 | ||
322 | struct usb_configuration *config; | 324 | struct usb_configuration *config; |
323 | 325 | ||
326 | /* private: */ | ||
324 | /* internals */ | 327 | /* internals */ |
325 | struct usb_device_descriptor desc; | 328 | struct usb_device_descriptor desc; |
326 | struct list_head configs; | 329 | struct list_head configs; |
diff --git a/include/linux/usb/langwell_udc.h b/include/linux/usb/langwell_udc.h new file mode 100644 index 000000000000..c949178a6530 --- /dev/null +++ b/include/linux/usb/langwell_udc.h | |||
@@ -0,0 +1,310 @@ | |||
1 | /* | ||
2 | * Intel Langwell USB Device Controller driver | ||
3 | * Copyright (C) 2008-2009, Intel Corporation. | ||
4 | * | ||
5 | * This program is free software; you can redistribute it and/or modify it | ||
6 | * under the terms and conditions of the GNU General Public License, | ||
7 | * version 2, as published by the Free Software Foundation. | ||
8 | * | ||
9 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
10 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
11 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
12 | * more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License along with | ||
15 | * this program; if not, write to the Free Software Foundation, Inc., | ||
16 | * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. | ||
17 | * | ||
18 | */ | ||
19 | |||
20 | #ifndef __LANGWELL_UDC_H | ||
21 | #define __LANGWELL_UDC_H | ||
22 | |||
23 | |||
24 | /* MACRO defines */ | ||
25 | #define CAP_REG_OFFSET 0x0 | ||
26 | #define OP_REG_OFFSET 0x28 | ||
27 | |||
28 | #define DMA_ADDR_INVALID (~(dma_addr_t)0) | ||
29 | |||
30 | #define DQH_ALIGNMENT 2048 | ||
31 | #define DTD_ALIGNMENT 64 | ||
32 | #define DMA_BOUNDARY 4096 | ||
33 | |||
34 | #define EP0_MAX_PKT_SIZE 64 | ||
35 | #define EP_DIR_IN 1 | ||
36 | #define EP_DIR_OUT 0 | ||
37 | |||
38 | #define FLUSH_TIMEOUT 1000 | ||
39 | #define RESET_TIMEOUT 1000 | ||
40 | #define SETUPSTAT_TIMEOUT 100 | ||
41 | #define PRIME_TIMEOUT 100 | ||
42 | |||
43 | |||
44 | /* device memory space registers */ | ||
45 | |||
46 | /* Capability Registers, BAR0 + CAP_REG_OFFSET */ | ||
47 | struct langwell_cap_regs { | ||
48 | /* offset: 0x0 */ | ||
49 | u8 caplength; /* offset of Operational Register */ | ||
50 | u8 _reserved3; | ||
51 | u16 hciversion; /* H: BCD encoding of host version */ | ||
52 | u32 hcsparams; /* H: host port steering logic capability */ | ||
53 | u32 hccparams; /* H: host multiple mode control capability */ | ||
54 | #define HCC_LEN BIT(17) /* Link power management (LPM) capability */ | ||
55 | u8 _reserved4[0x20-0xc]; | ||
56 | /* offset: 0x20 */ | ||
57 | u16 dciversion; /* BCD encoding of device version */ | ||
58 | u8 _reserved5[0x24-0x22]; | ||
59 | u32 dccparams; /* overall device controller capability */ | ||
60 | #define HOSTCAP BIT(8) /* host capable */ | ||
61 | #define DEVCAP BIT(7) /* device capable */ | ||
62 | #define DEN(d) \ | ||
63 | (((d)>>0)&0x1f) /* bits 4:0, device endpoint number */ | ||
64 | } __attribute__ ((packed)); | ||
65 | |||
66 | |||
67 | /* Operational Registers, BAR0 + OP_REG_OFFSET */ | ||
68 | struct langwell_op_regs { | ||
69 | /* offset: 0x28 */ | ||
70 | u32 extsts; | ||
71 | #define EXTS_TI1 BIT(4) /* general purpose timer interrupt 1 */ | ||
72 | #define EXTS_TI1TI0 BIT(3) /* general purpose timer interrupt 0 */ | ||
73 | #define EXTS_TI1UPI BIT(2) /* USB host periodic interrupt */ | ||
74 | #define EXTS_TI1UAI BIT(1) /* USB host asynchronous interrupt */ | ||
75 | #define EXTS_TI1NAKI BIT(0) /* NAK interrupt */ | ||
76 | u32 extintr; | ||
77 | #define EXTI_TIE1 BIT(4) /* general purpose timer interrupt enable 1 */ | ||
78 | #define EXTI_TIE0 BIT(3) /* general purpose timer interrupt enable 0 */ | ||
79 | #define EXTI_UPIE BIT(2) /* USB host periodic interrupt enable */ | ||
80 | #define EXTI_UAIE BIT(1) /* USB host asynchronous interrupt enable */ | ||
81 | #define EXTI_NAKE BIT(0) /* NAK interrupt enable */ | ||
82 | /* offset: 0x30 */ | ||
83 | u32 usbcmd; | ||
84 | #define CMD_HIRD(u) \ | ||
85 | (((u)>>24)&0xf) /* bits 27:24, host init resume duration */ | ||
86 | #define CMD_ITC(u) \ | ||
87 | (((u)>>16)&0xff) /* bits 23:16, interrupt threshold control */ | ||
88 | #define CMD_PPE BIT(15) /* per-port change events enable */ | ||
89 | #define CMD_ATDTW BIT(14) /* add dTD tripwire */ | ||
90 | #define CMD_SUTW BIT(13) /* setup tripwire */ | ||
91 | #define CMD_ASPE BIT(11) /* asynchronous schedule park mode enable */ | ||
92 | #define CMD_FS2 BIT(10) /* frame list size */ | ||
93 | #define CMD_ASP1 BIT(9) /* asynchronous schedule park mode count */ | ||
94 | #define CMD_ASP0 BIT(8) | ||
95 | #define CMD_LR BIT(7) /* light host/device controller reset */ | ||
96 | #define CMD_IAA BIT(6) /* interrupt on async advance doorbell */ | ||
97 | #define CMD_ASE BIT(5) /* asynchronous schedule enable */ | ||
98 | #define CMD_PSE BIT(4) /* periodic schedule enable */ | ||
99 | #define CMD_FS1 BIT(3) | ||
100 | #define CMD_FS0 BIT(2) | ||
101 | #define CMD_RST BIT(1) /* controller reset */ | ||
102 | #define CMD_RUNSTOP BIT(0) /* run/stop */ | ||
103 | u32 usbsts; | ||
104 | #define STS_PPCI(u) \ | ||
105 | (((u)>>16)&0xffff) /* bits 31:16, port-n change detect */ | ||
106 | #define STS_AS BIT(15) /* asynchronous schedule status */ | ||
107 | #define STS_PS BIT(14) /* periodic schedule status */ | ||
108 | #define STS_RCL BIT(13) /* reclamation */ | ||
109 | #define STS_HCH BIT(12) /* HC halted */ | ||
110 | #define STS_ULPII BIT(10) /* ULPI interrupt */ | ||
111 | #define STS_SLI BIT(8) /* DC suspend */ | ||
112 | #define STS_SRI BIT(7) /* SOF received */ | ||
113 | #define STS_URI BIT(6) /* USB reset received */ | ||
114 | #define STS_AAI BIT(5) /* interrupt on async advance */ | ||
115 | #define STS_SEI BIT(4) /* system error */ | ||
116 | #define STS_FRI BIT(3) /* frame list rollover */ | ||
117 | #define STS_PCI BIT(2) /* port change detect */ | ||
118 | #define STS_UEI BIT(1) /* USB error interrupt */ | ||
119 | #define STS_UI BIT(0) /* USB interrupt */ | ||
120 | u32 usbintr; | ||
121 | /* bits 31:16, per-port interrupt enable */ | ||
122 | #define INTR_PPCE(u) (((u)>>16)&0xffff) | ||
123 | #define INTR_ULPIE BIT(10) /* ULPI enable */ | ||
124 | #define INTR_SLE BIT(8) /* DC sleep/suspend enable */ | ||
125 | #define INTR_SRE BIT(7) /* SOF received enable */ | ||
126 | #define INTR_URE BIT(6) /* USB reset enable */ | ||
127 | #define INTR_AAE BIT(5) /* interrupt on async advance enable */ | ||
128 | #define INTR_SEE BIT(4) /* system error enable */ | ||
129 | #define INTR_FRE BIT(3) /* frame list rollover enable */ | ||
130 | #define INTR_PCE BIT(2) /* port change detect enable */ | ||
131 | #define INTR_UEE BIT(1) /* USB error interrupt enable */ | ||
132 | #define INTR_UE BIT(0) /* USB interrupt enable */ | ||
133 | u32 frindex; /* frame index */ | ||
134 | #define FRINDEX_MASK (0x3fff << 0) | ||
135 | u32 ctrldssegment; /* not used */ | ||
136 | u32 deviceaddr; | ||
137 | #define USBADR_SHIFT 25 | ||
138 | #define USBADR(d) \ | ||
139 | (((d)>>25)&0x7f) /* bits 31:25, device address */ | ||
140 | #define USBADR_MASK (0x7f << 25) | ||
141 | #define USBADRA BIT(24) /* device address advance */ | ||
142 | u32 endpointlistaddr;/* endpoint list top memory address */ | ||
143 | /* bits 31:11, endpoint list pointer */ | ||
144 | #define EPBASE(d) (((d)>>11)&0x1fffff) | ||
145 | #define ENDPOINTLISTADDR_MASK (0x1fffff << 11) | ||
146 | u32 ttctrl; /* H: TT operatin, not used */ | ||
147 | /* offset: 0x50 */ | ||
148 | u32 burstsize; /* burst size of data movement */ | ||
149 | #define TXPBURST(b) \ | ||
150 | (((b)>>8)&0xff) /* bits 15:8, TX burst length */ | ||
151 | #define RXPBURST(b) \ | ||
152 | (((b)>>0)&0xff) /* bits 7:0, RX burst length */ | ||
153 | u32 txfilltuning; /* TX tuning */ | ||
154 | u32 txttfilltuning; /* H: TX TT tuning */ | ||
155 | u32 ic_usb; /* control the IC_USB FS/LS transceiver */ | ||
156 | /* offset: 0x60 */ | ||
157 | u32 ulpi_viewport; /* indirect access to ULPI PHY */ | ||
158 | #define ULPIWU BIT(31) /* ULPI wakeup */ | ||
159 | #define ULPIRUN BIT(30) /* ULPI read/write run */ | ||
160 | #define ULPIRW BIT(29) /* ULPI read/write control */ | ||
161 | #define ULPISS BIT(27) /* ULPI sync state */ | ||
162 | #define ULPIPORT(u) \ | ||
163 | (((u)>>24)&7) /* bits 26:24, ULPI port number */ | ||
164 | #define ULPIADDR(u) \ | ||
165 | (((u)>>16)&0xff) /* bits 23:16, ULPI data address */ | ||
166 | #define ULPIDATRD(u) \ | ||
167 | (((u)>>8)&0xff) /* bits 15:8, ULPI data read */ | ||
168 | #define ULPIDATWR(u) \ | ||
169 | (((u)>>0)&0xff) /* bits 7:0, ULPI date write */ | ||
170 | u8 _reserved6[0x70-0x64]; | ||
171 | /* offset: 0x70 */ | ||
172 | u32 configflag; /* H: not used */ | ||
173 | u32 portsc1; /* port status */ | ||
174 | #define DA(p) \ | ||
175 | (((p)>>25)&0x7f) /* bits 31:25, device address */ | ||
176 | #define PORTS_SSTS (BIT(24) | BIT(23)) /* suspend status */ | ||
177 | #define PORTS_WKOC BIT(22) /* wake on over-current enable */ | ||
178 | #define PORTS_WKDS BIT(21) /* wake on disconnect enable */ | ||
179 | #define PORTS_WKCN BIT(20) /* wake on connect enable */ | ||
180 | #define PORTS_PTC(p) (((p)>>16)&0xf) /* bits 19:16, port test control */ | ||
181 | #define PORTS_PIC (BIT(15) | BIT(14)) /* port indicator control */ | ||
182 | #define PORTS_PO BIT(13) /* port owner */ | ||
183 | #define PORTS_PP BIT(12) /* port power */ | ||
184 | #define PORTS_LS (BIT(11) | BIT(10)) /* line status */ | ||
185 | #define PORTS_SLP BIT(9) /* suspend using L1 */ | ||
186 | #define PORTS_PR BIT(8) /* port reset */ | ||
187 | #define PORTS_SUSP BIT(7) /* suspend */ | ||
188 | #define PORTS_FPR BIT(6) /* force port resume */ | ||
189 | #define PORTS_OCC BIT(5) /* over-current change */ | ||
190 | #define PORTS_OCA BIT(4) /* over-current active */ | ||
191 | #define PORTS_PEC BIT(3) /* port enable/disable change */ | ||
192 | #define PORTS_PE BIT(2) /* port enable/disable */ | ||
193 | #define PORTS_CSC BIT(1) /* connect status change */ | ||
194 | #define PORTS_CCS BIT(0) /* current connect status */ | ||
195 | u8 _reserved7[0xb4-0x78]; | ||
196 | /* offset: 0xb4 */ | ||
197 | u32 devlc; /* control LPM and each USB port behavior */ | ||
198 | /* bits 31:29, parallel transceiver select */ | ||
199 | #define LPM_PTS(d) (((d)>>29)&7) | ||
200 | #define LPM_STS BIT(28) /* serial transceiver select */ | ||
201 | #define LPM_PTW BIT(27) /* parallel transceiver width */ | ||
202 | #define LPM_PSPD(d) (((d)>>25)&3) /* bits 26:25, port speed */ | ||
203 | #define LPM_PSPD_MASK (BIT(26) | BIT(25)) | ||
204 | #define LPM_SPEED_FULL 0 | ||
205 | #define LPM_SPEED_LOW 1 | ||
206 | #define LPM_SPEED_HIGH 2 | ||
207 | #define LPM_SRT BIT(24) /* shorten reset time */ | ||
208 | #define LPM_PFSC BIT(23) /* port force full speed connect */ | ||
209 | #define LPM_PHCD BIT(22) /* PHY low power suspend clock disable */ | ||
210 | #define LPM_STL BIT(16) /* STALL reply to LPM token */ | ||
211 | #define LPM_BA(d) \ | ||
212 | (((d)>>1)&0x7ff) /* bits 11:1, BmAttributes */ | ||
213 | #define LPM_NYT_ACK BIT(0) /* NYET/ACK reply to LPM token */ | ||
214 | u8 _reserved8[0xf4-0xb8]; | ||
215 | /* offset: 0xf4 */ | ||
216 | u32 otgsc; /* On-The-Go status and control */ | ||
217 | #define OTGSC_DPIE BIT(30) /* data pulse interrupt enable */ | ||
218 | #define OTGSC_MSE BIT(29) /* 1 ms timer interrupt enable */ | ||
219 | #define OTGSC_BSEIE BIT(28) /* B session end interrupt enable */ | ||
220 | #define OTGSC_BSVIE BIT(27) /* B session valid interrupt enable */ | ||
221 | #define OTGSC_ASVIE BIT(26) /* A session valid interrupt enable */ | ||
222 | #define OTGSC_AVVIE BIT(25) /* A VBUS valid interrupt enable */ | ||
223 | #define OTGSC_IDIE BIT(24) /* USB ID interrupt enable */ | ||
224 | #define OTGSC_DPIS BIT(22) /* data pulse interrupt status */ | ||
225 | #define OTGSC_MSS BIT(21) /* 1 ms timer interrupt status */ | ||
226 | #define OTGSC_BSEIS BIT(20) /* B session end interrupt status */ | ||
227 | #define OTGSC_BSVIS BIT(19) /* B session valid interrupt status */ | ||
228 | #define OTGSC_ASVIS BIT(18) /* A session valid interrupt status */ | ||
229 | #define OTGSC_AVVIS BIT(17) /* A VBUS valid interrupt status */ | ||
230 | #define OTGSC_IDIS BIT(16) /* USB ID interrupt status */ | ||
231 | #define OTGSC_DPS BIT(14) /* data bus pulsing status */ | ||
232 | #define OTGSC_MST BIT(13) /* 1 ms timer toggle */ | ||
233 | #define OTGSC_BSE BIT(12) /* B session end */ | ||
234 | #define OTGSC_BSV BIT(11) /* B session valid */ | ||
235 | #define OTGSC_ASV BIT(10) /* A session valid */ | ||
236 | #define OTGSC_AVV BIT(9) /* A VBUS valid */ | ||
237 | #define OTGSC_USBID BIT(8) /* USB ID */ | ||
238 | #define OTGSC_HABA BIT(7) /* hw assist B-disconnect to A-connect */ | ||
239 | #define OTGSC_HADP BIT(6) /* hw assist data pulse */ | ||
240 | #define OTGSC_IDPU BIT(5) /* ID pullup */ | ||
241 | #define OTGSC_DP BIT(4) /* data pulsing */ | ||
242 | #define OTGSC_OT BIT(3) /* OTG termination */ | ||
243 | #define OTGSC_HAAR BIT(2) /* hw assist auto reset */ | ||
244 | #define OTGSC_VC BIT(1) /* VBUS charge */ | ||
245 | #define OTGSC_VD BIT(0) /* VBUS discharge */ | ||
246 | u32 usbmode; | ||
247 | #define MODE_VBPS BIT(5) /* R/W VBUS power select */ | ||
248 | #define MODE_SDIS BIT(4) /* R/W stream disable mode */ | ||
249 | #define MODE_SLOM BIT(3) /* R/W setup lockout mode */ | ||
250 | #define MODE_ENSE BIT(2) /* endian select */ | ||
251 | #define MODE_CM(u) (((u)>>0)&3) /* bits 1:0, controller mode */ | ||
252 | #define MODE_IDLE 0 | ||
253 | #define MODE_DEVICE 2 | ||
254 | #define MODE_HOST 3 | ||
255 | u8 _reserved9[0x100-0xfc]; | ||
256 | /* offset: 0x100 */ | ||
257 | u32 endptnak; | ||
258 | #define EPTN(e) \ | ||
259 | (((e)>>16)&0xffff) /* bits 31:16, TX endpoint NAK */ | ||
260 | #define EPRN(e) \ | ||
261 | (((e)>>0)&0xffff) /* bits 15:0, RX endpoint NAK */ | ||
262 | u32 endptnaken; | ||
263 | #define EPTNE(e) \ | ||
264 | (((e)>>16)&0xffff) /* bits 31:16, TX endpoint NAK enable */ | ||
265 | #define EPRNE(e) \ | ||
266 | (((e)>>0)&0xffff) /* bits 15:0, RX endpoint NAK enable */ | ||
267 | u32 endptsetupstat; | ||
268 | #define SETUPSTAT_MASK (0xffff << 0) /* bits 15:0 */ | ||
269 | #define EP0SETUPSTAT_MASK 1 | ||
270 | u32 endptprime; | ||
271 | /* bits 31:16, prime endpoint transmit buffer */ | ||
272 | #define PETB(e) (((e)>>16)&0xffff) | ||
273 | /* bits 15:0, prime endpoint receive buffer */ | ||
274 | #define PERB(e) (((e)>>0)&0xffff) | ||
275 | /* offset: 0x110 */ | ||
276 | u32 endptflush; | ||
277 | /* bits 31:16, flush endpoint transmit buffer */ | ||
278 | #define FETB(e) (((e)>>16)&0xffff) | ||
279 | /* bits 15:0, flush endpoint receive buffer */ | ||
280 | #define FERB(e) (((e)>>0)&0xffff) | ||
281 | u32 endptstat; | ||
282 | /* bits 31:16, endpoint transmit buffer ready */ | ||
283 | #define ETBR(e) (((e)>>16)&0xffff) | ||
284 | /* bits 15:0, endpoint receive buffer ready */ | ||
285 | #define ERBR(e) (((e)>>0)&0xffff) | ||
286 | u32 endptcomplete; | ||
287 | /* bits 31:16, endpoint transmit complete event */ | ||
288 | #define ETCE(e) (((e)>>16)&0xffff) | ||
289 | /* bits 15:0, endpoint receive complete event */ | ||
290 | #define ERCE(e) (((e)>>0)&0xffff) | ||
291 | /* offset: 0x11c */ | ||
292 | u32 endptctrl[16]; | ||
293 | #define EPCTRL_TXE BIT(23) /* TX endpoint enable */ | ||
294 | #define EPCTRL_TXR BIT(22) /* TX data toggle reset */ | ||
295 | #define EPCTRL_TXI BIT(21) /* TX data toggle inhibit */ | ||
296 | #define EPCTRL_TXT(e) (((e)>>18)&3) /* bits 19:18, TX endpoint type */ | ||
297 | #define EPCTRL_TXT_SHIFT 18 | ||
298 | #define EPCTRL_TXD BIT(17) /* TX endpoint data source */ | ||
299 | #define EPCTRL_TXS BIT(16) /* TX endpoint STALL */ | ||
300 | #define EPCTRL_RXE BIT(7) /* RX endpoint enable */ | ||
301 | #define EPCTRL_RXR BIT(6) /* RX data toggle reset */ | ||
302 | #define EPCTRL_RXI BIT(5) /* RX data toggle inhibit */ | ||
303 | #define EPCTRL_RXT(e) (((e)>>2)&3) /* bits 3:2, RX endpoint type */ | ||
304 | #define EPCTRL_RXT_SHIFT 2 /* bits 19:18, TX endpoint type */ | ||
305 | #define EPCTRL_RXD BIT(1) /* RX endpoint data sink */ | ||
306 | #define EPCTRL_RXS BIT(0) /* RX endpoint STALL */ | ||
307 | } __attribute__ ((packed)); | ||
308 | |||
309 | #endif /* __LANGWELL_UDC_H */ | ||
310 | |||
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index 1aaa826396a1..2443c0e7a80c 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
@@ -80,10 +80,10 @@ struct otg_transceiver { | |||
80 | 80 | ||
81 | /* for board-specific init logic */ | 81 | /* for board-specific init logic */ |
82 | extern int otg_set_transceiver(struct otg_transceiver *); | 82 | extern int otg_set_transceiver(struct otg_transceiver *); |
83 | #ifdef CONFIG_NOP_USB_XCEIV | 83 | |
84 | /* sometimes transceivers are accessed only through e.g. ULPI */ | ||
84 | extern void usb_nop_xceiv_register(void); | 85 | extern void usb_nop_xceiv_register(void); |
85 | extern void usb_nop_xceiv_unregister(void); | 86 | extern void usb_nop_xceiv_unregister(void); |
86 | #endif | ||
87 | 87 | ||
88 | 88 | ||
89 | /* for usb host and peripheral controller drivers */ | 89 | /* for usb host and peripheral controller drivers */ |
diff --git a/include/linux/usb/r8a66597.h b/include/linux/usb/r8a66597.h new file mode 100644 index 000000000000..e9f0384fa20c --- /dev/null +++ b/include/linux/usb/r8a66597.h | |||
@@ -0,0 +1,44 @@ | |||
1 | /* | ||
2 | * R8A66597 driver platform data | ||
3 | * | ||
4 | * Copyright (C) 2009 Renesas Solutions Corp. | ||
5 | * | ||
6 | * Author : Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> | ||
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 as published by | ||
10 | * the Free Software Foundation; version 2 of the License. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU 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 02110-1301 USA | ||
20 | * | ||
21 | */ | ||
22 | |||
23 | #ifndef __LINUX_USB_R8A66597_H | ||
24 | #define __LINUX_USB_R8A66597_H | ||
25 | |||
26 | #define R8A66597_PLATDATA_XTAL_12MHZ 0x01 | ||
27 | #define R8A66597_PLATDATA_XTAL_24MHZ 0x02 | ||
28 | #define R8A66597_PLATDATA_XTAL_48MHZ 0x03 | ||
29 | |||
30 | struct r8a66597_platdata { | ||
31 | /* This ops can controll port power instead of DVSTCTR register. */ | ||
32 | void (*port_power)(int port, int power); | ||
33 | |||
34 | /* (external controller only) set R8A66597_PLATDATA_XTAL_nnMHZ */ | ||
35 | unsigned xtal:2; | ||
36 | |||
37 | /* set one = 3.3V, set zero = 1.5V */ | ||
38 | unsigned vif:1; | ||
39 | |||
40 | /* set one = big endian, set zero = little endian */ | ||
41 | unsigned endian:1; | ||
42 | }; | ||
43 | #endif | ||
44 | |||
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h index 8cdfed738fe4..0ec50ba62139 100644 --- a/include/linux/usb/serial.h +++ b/include/linux/usb/serial.h | |||
@@ -15,6 +15,7 @@ | |||
15 | 15 | ||
16 | #include <linux/kref.h> | 16 | #include <linux/kref.h> |
17 | #include <linux/mutex.h> | 17 | #include <linux/mutex.h> |
18 | #include <linux/sysrq.h> | ||
18 | 19 | ||
19 | #define SERIAL_TTY_MAJOR 188 /* Nice legal number now */ | 20 | #define SERIAL_TTY_MAJOR 188 /* Nice legal number now */ |
20 | #define SERIAL_TTY_MINORS 254 /* loads of devices :) */ | 21 | #define SERIAL_TTY_MINORS 254 /* loads of devices :) */ |
@@ -26,6 +27,13 @@ | |||
26 | /* parity check flag */ | 27 | /* parity check flag */ |
27 | #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) | 28 | #define RELEVANT_IFLAG(iflag) (iflag & (IGNBRK|BRKINT|IGNPAR|PARMRK|INPCK)) |
28 | 29 | ||
30 | enum port_dev_state { | ||
31 | PORT_UNREGISTERED, | ||
32 | PORT_REGISTERING, | ||
33 | PORT_REGISTERED, | ||
34 | PORT_UNREGISTERING, | ||
35 | }; | ||
36 | |||
29 | /** | 37 | /** |
30 | * usb_serial_port: structure for the specific ports of a device. | 38 | * usb_serial_port: structure for the specific ports of a device. |
31 | * @serial: pointer back to the struct usb_serial owner of this port. | 39 | * @serial: pointer back to the struct usb_serial owner of this port. |
@@ -91,12 +99,17 @@ struct usb_serial_port { | |||
91 | int write_urb_busy; | 99 | int write_urb_busy; |
92 | __u8 bulk_out_endpointAddress; | 100 | __u8 bulk_out_endpointAddress; |
93 | 101 | ||
102 | int tx_bytes_flight; | ||
103 | int urbs_in_flight; | ||
104 | |||
94 | wait_queue_head_t write_wait; | 105 | wait_queue_head_t write_wait; |
95 | struct work_struct work; | 106 | struct work_struct work; |
96 | char throttled; | 107 | char throttled; |
97 | char throttle_req; | 108 | char throttle_req; |
98 | char console; | 109 | char console; |
110 | unsigned long sysrq; /* sysrq timeout */ | ||
99 | struct device dev; | 111 | struct device dev; |
112 | enum port_dev_state dev_state; | ||
100 | }; | 113 | }; |
101 | #define to_usb_serial_port(d) container_of(d, struct usb_serial_port, dev) | 114 | #define to_usb_serial_port(d) container_of(d, struct usb_serial_port, dev) |
102 | 115 | ||
@@ -181,8 +194,10 @@ static inline void usb_set_serial_data(struct usb_serial *serial, void *data) | |||
181 | * This will be called when the struct usb_serial structure is fully set | 194 | * This will be called when the struct usb_serial structure is fully set |
182 | * set up. Do any local initialization of the device, or any private | 195 | * set up. Do any local initialization of the device, or any private |
183 | * memory structure allocation at this point in time. | 196 | * memory structure allocation at this point in time. |
184 | * @shutdown: pointer to the driver's shutdown function. This will be | 197 | * @disconnect: pointer to the driver's disconnect function. This will be |
185 | * called when the device is removed from the system. | 198 | * called when the device is unplugged or unbound from the driver. |
199 | * @release: pointer to the driver's release function. This will be called | ||
200 | * when the usb_serial data structure is about to be destroyed. | ||
186 | * @usb_driver: pointer to the struct usb_driver that controls this | 201 | * @usb_driver: pointer to the struct usb_driver that controls this |
187 | * device. This is necessary to allow dynamic ids to be added to | 202 | * device. This is necessary to allow dynamic ids to be added to |
188 | * the driver from sysfs. | 203 | * the driver from sysfs. |
@@ -207,12 +222,14 @@ struct usb_serial_driver { | |||
207 | struct device_driver driver; | 222 | struct device_driver driver; |
208 | struct usb_driver *usb_driver; | 223 | struct usb_driver *usb_driver; |
209 | struct usb_dynids dynids; | 224 | struct usb_dynids dynids; |
225 | int max_in_flight_urbs; | ||
210 | 226 | ||
211 | int (*probe)(struct usb_serial *serial, const struct usb_device_id *id); | 227 | int (*probe)(struct usb_serial *serial, const struct usb_device_id *id); |
212 | int (*attach)(struct usb_serial *serial); | 228 | int (*attach)(struct usb_serial *serial); |
213 | int (*calc_num_ports) (struct usb_serial *serial); | 229 | int (*calc_num_ports) (struct usb_serial *serial); |
214 | 230 | ||
215 | void (*shutdown)(struct usb_serial *serial); | 231 | void (*disconnect)(struct usb_serial *serial); |
232 | void (*release)(struct usb_serial *serial); | ||
216 | 233 | ||
217 | int (*port_probe)(struct usb_serial_port *port); | 234 | int (*port_probe)(struct usb_serial_port *port); |
218 | int (*port_remove)(struct usb_serial_port *port); | 235 | int (*port_remove)(struct usb_serial_port *port); |
@@ -294,9 +311,17 @@ extern void usb_serial_generic_read_bulk_callback(struct urb *urb); | |||
294 | extern void usb_serial_generic_write_bulk_callback(struct urb *urb); | 311 | extern void usb_serial_generic_write_bulk_callback(struct urb *urb); |
295 | extern void usb_serial_generic_throttle(struct tty_struct *tty); | 312 | extern void usb_serial_generic_throttle(struct tty_struct *tty); |
296 | extern void usb_serial_generic_unthrottle(struct tty_struct *tty); | 313 | extern void usb_serial_generic_unthrottle(struct tty_struct *tty); |
297 | extern void usb_serial_generic_shutdown(struct usb_serial *serial); | 314 | extern void usb_serial_generic_disconnect(struct usb_serial *serial); |
315 | extern void usb_serial_generic_release(struct usb_serial *serial); | ||
298 | extern int usb_serial_generic_register(int debug); | 316 | extern int usb_serial_generic_register(int debug); |
299 | extern void usb_serial_generic_deregister(void); | 317 | extern void usb_serial_generic_deregister(void); |
318 | extern void usb_serial_generic_resubmit_read_urb(struct usb_serial_port *port, | ||
319 | gfp_t mem_flags); | ||
320 | extern int usb_serial_handle_sysrq_char(struct tty_struct *tty, | ||
321 | struct usb_serial_port *port, | ||
322 | unsigned int ch); | ||
323 | extern int usb_serial_handle_break(struct usb_serial_port *port); | ||
324 | |||
300 | 325 | ||
301 | extern int usb_serial_bus_register(struct usb_serial_driver *device); | 326 | extern int usb_serial_bus_register(struct usb_serial_driver *device); |
302 | extern void usb_serial_bus_deregister(struct usb_serial_driver *device); | 327 | extern void usb_serial_bus_deregister(struct usb_serial_driver *device); |
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index 36fabb95c7d3..310e18a880ff 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
@@ -42,7 +42,6 @@ struct usbnet { | |||
42 | 42 | ||
43 | /* protocol/interface state */ | 43 | /* protocol/interface state */ |
44 | struct net_device *net; | 44 | struct net_device *net; |
45 | struct net_device_stats stats; | ||
46 | int msg_enable; | 45 | int msg_enable; |
47 | unsigned long data [5]; | 46 | unsigned long data [5]; |
48 | u32 xid; | 47 | u32 xid; |
@@ -183,6 +182,7 @@ extern void usbnet_tx_timeout (struct net_device *net); | |||
183 | extern int usbnet_change_mtu (struct net_device *net, int new_mtu); | 182 | extern int usbnet_change_mtu (struct net_device *net, int new_mtu); |
184 | 183 | ||
185 | extern int usbnet_get_endpoints(struct usbnet *, struct usb_interface *); | 184 | extern int usbnet_get_endpoints(struct usbnet *, struct usb_interface *); |
185 | extern int usbnet_get_ethernet_addr(struct usbnet *, int); | ||
186 | extern void usbnet_defer_kevent (struct usbnet *, int); | 186 | extern void usbnet_defer_kevent (struct usbnet *, int); |
187 | extern void usbnet_skb_return (struct usbnet *, struct sk_buff *); | 187 | extern void usbnet_skb_return (struct usbnet *, struct sk_buff *); |
188 | extern void usbnet_unlink_rx_urbs(struct usbnet *); | 188 | extern void usbnet_unlink_rx_urbs(struct usbnet *); |
diff --git a/include/linux/utsname.h b/include/linux/utsname.h index 11232676bfff..3656b300de3a 100644 --- a/include/linux/utsname.h +++ b/include/linux/utsname.h | |||
@@ -22,12 +22,12 @@ struct old_utsname { | |||
22 | }; | 22 | }; |
23 | 23 | ||
24 | struct new_utsname { | 24 | struct new_utsname { |
25 | char sysname[65]; | 25 | char sysname[__NEW_UTS_LEN + 1]; |
26 | char nodename[65]; | 26 | char nodename[__NEW_UTS_LEN + 1]; |
27 | char release[65]; | 27 | char release[__NEW_UTS_LEN + 1]; |
28 | char version[65]; | 28 | char version[__NEW_UTS_LEN + 1]; |
29 | char machine[65]; | 29 | char machine[__NEW_UTS_LEN + 1]; |
30 | char domainname[65]; | 30 | char domainname[__NEW_UTS_LEN + 1]; |
31 | }; | 31 | }; |
32 | 32 | ||
33 | #ifdef __KERNEL__ | 33 | #ifdef __KERNEL__ |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index ebb2ea6b4995..95846d988011 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -318,6 +318,8 @@ struct v4l2_pix_format { | |||
318 | /* see http://www.siliconimaging.com/RGB%20Bayer.htm */ | 318 | /* see http://www.siliconimaging.com/RGB%20Bayer.htm */ |
319 | #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ | 319 | #define V4L2_PIX_FMT_SBGGR8 v4l2_fourcc('B', 'A', '8', '1') /* 8 BGBG.. GRGR.. */ |
320 | #define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ | 320 | #define V4L2_PIX_FMT_SGBRG8 v4l2_fourcc('G', 'B', 'R', 'G') /* 8 GBGB.. RGRG.. */ |
321 | #define V4L2_PIX_FMT_SGRBG8 v4l2_fourcc('G', 'R', 'B', 'G') /* 8 GRGR.. BGBG.. */ | ||
322 | |||
321 | /* | 323 | /* |
322 | * 10bit raw bayer, expanded to 16 bits | 324 | * 10bit raw bayer, expanded to 16 bits |
323 | * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb... | 325 | * xxxxrrrrrrrrrrxxxxgggggggggg xxxxggggggggggxxxxbbbbbbbbbb... |
@@ -347,7 +349,9 @@ struct v4l2_pix_format { | |||
347 | #define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */ | 349 | #define V4L2_PIX_FMT_MR97310A v4l2_fourcc('M', '3', '1', '0') /* compressed BGGR bayer */ |
348 | #define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */ | 350 | #define V4L2_PIX_FMT_SQ905C v4l2_fourcc('9', '0', '5', 'C') /* compressed RGGB bayer */ |
349 | #define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ | 351 | #define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ |
350 | #define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */ | 352 | #define V4L2_PIX_FMT_YVYU v4l2_fourcc('Y', 'V', 'Y', 'U') /* 16 YVU 4:2:2 */ |
353 | #define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */ | ||
354 | #define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */ | ||
351 | 355 | ||
352 | /* | 356 | /* |
353 | * F O R M A T E N U M E R A T I O N | 357 | * F O R M A T E N U M E R A T I O N |
@@ -893,9 +897,10 @@ enum v4l2_colorfx { | |||
893 | V4L2_COLORFX_BW = 1, | 897 | V4L2_COLORFX_BW = 1, |
894 | V4L2_COLORFX_SEPIA = 2, | 898 | V4L2_COLORFX_SEPIA = 2, |
895 | }; | 899 | }; |
900 | #define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32) | ||
896 | 901 | ||
897 | /* last CID + 1 */ | 902 | /* last CID + 1 */ |
898 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+32) | 903 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+33) |
899 | 904 | ||
900 | /* MPEG-class control IDs defined by V4L2 */ | 905 | /* MPEG-class control IDs defined by V4L2 */ |
901 | #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) | 906 | #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) |
diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 06005fa9e982..4fca4f5440ba 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h | |||
@@ -10,14 +10,17 @@ | |||
10 | 10 | ||
11 | /** | 11 | /** |
12 | * virtqueue - a queue to register buffers for sending or receiving. | 12 | * virtqueue - a queue to register buffers for sending or receiving. |
13 | * @list: the chain of virtqueues for this device | ||
13 | * @callback: the function to call when buffers are consumed (can be NULL). | 14 | * @callback: the function to call when buffers are consumed (can be NULL). |
15 | * @name: the name of this virtqueue (mainly for debugging) | ||
14 | * @vdev: the virtio device this queue was created for. | 16 | * @vdev: the virtio device this queue was created for. |
15 | * @vq_ops: the operations for this virtqueue (see below). | 17 | * @vq_ops: the operations for this virtqueue (see below). |
16 | * @priv: a pointer for the virtqueue implementation to use. | 18 | * @priv: a pointer for the virtqueue implementation to use. |
17 | */ | 19 | */ |
18 | struct virtqueue | 20 | struct virtqueue { |
19 | { | 21 | struct list_head list; |
20 | void (*callback)(struct virtqueue *vq); | 22 | void (*callback)(struct virtqueue *vq); |
23 | const char *name; | ||
21 | struct virtio_device *vdev; | 24 | struct virtio_device *vdev; |
22 | struct virtqueue_ops *vq_ops; | 25 | struct virtqueue_ops *vq_ops; |
23 | void *priv; | 26 | void *priv; |
@@ -76,15 +79,16 @@ struct virtqueue_ops { | |||
76 | * @dev: underlying device. | 79 | * @dev: underlying device. |
77 | * @id: the device type identification (used to match it with a driver). | 80 | * @id: the device type identification (used to match it with a driver). |
78 | * @config: the configuration ops for this device. | 81 | * @config: the configuration ops for this device. |
82 | * @vqs: the list of virtqueues for this device. | ||
79 | * @features: the features supported by both driver and device. | 83 | * @features: the features supported by both driver and device. |
80 | * @priv: private pointer for the driver's use. | 84 | * @priv: private pointer for the driver's use. |
81 | */ | 85 | */ |
82 | struct virtio_device | 86 | struct virtio_device { |
83 | { | ||
84 | int index; | 87 | int index; |
85 | struct device dev; | 88 | struct device dev; |
86 | struct virtio_device_id id; | 89 | struct virtio_device_id id; |
87 | struct virtio_config_ops *config; | 90 | struct virtio_config_ops *config; |
91 | struct list_head vqs; | ||
88 | /* Note that this is a Linux set_bit-style bitmap. */ | 92 | /* Note that this is a Linux set_bit-style bitmap. */ |
89 | unsigned long features[1]; | 93 | unsigned long features[1]; |
90 | void *priv; | 94 | void *priv; |
@@ -99,8 +103,7 @@ void unregister_virtio_device(struct virtio_device *dev); | |||
99 | * @id_table: the ids serviced by this driver. | 103 | * @id_table: the ids serviced by this driver. |
100 | * @feature_table: an array of feature numbers supported by this device. | 104 | * @feature_table: an array of feature numbers supported by this device. |
101 | * @feature_table_size: number of entries in the feature table array. | 105 | * @feature_table_size: number of entries in the feature table array. |
102 | * @probe: the function to call when a device is found. Returns a token for | 106 | * @probe: the function to call when a device is found. Returns 0 or -errno. |
103 | * remove, or PTR_ERR(). | ||
104 | * @remove: the function when a device is removed. | 107 | * @remove: the function when a device is removed. |
105 | * @config_changed: optional function to call when the device configuration | 108 | * @config_changed: optional function to call when the device configuration |
106 | * changes; may be called in interrupt context. | 109 | * changes; may be called in interrupt context. |
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h index bf8ec283b232..99f514575f6a 100644 --- a/include/linux/virtio_config.h +++ b/include/linux/virtio_config.h | |||
@@ -29,6 +29,7 @@ | |||
29 | #define VIRTIO_F_NOTIFY_ON_EMPTY 24 | 29 | #define VIRTIO_F_NOTIFY_ON_EMPTY 24 |
30 | 30 | ||
31 | #ifdef __KERNEL__ | 31 | #ifdef __KERNEL__ |
32 | #include <linux/err.h> | ||
32 | #include <linux/virtio.h> | 33 | #include <linux/virtio.h> |
33 | 34 | ||
34 | /** | 35 | /** |
@@ -49,15 +50,26 @@ | |||
49 | * @set_status: write the status byte | 50 | * @set_status: write the status byte |
50 | * vdev: the virtio_device | 51 | * vdev: the virtio_device |
51 | * status: the new status byte | 52 | * status: the new status byte |
53 | * @request_vqs: request the specified number of virtqueues | ||
54 | * vdev: the virtio_device | ||
55 | * max_vqs: the max number of virtqueues we want | ||
56 | * If supplied, must call before any virtqueues are instantiated. | ||
57 | * To modify the max number of virtqueues after request_vqs has been | ||
58 | * called, call free_vqs and then request_vqs with a new value. | ||
59 | * @free_vqs: cleanup resources allocated by request_vqs | ||
60 | * vdev: the virtio_device | ||
61 | * If supplied, must call after all virtqueues have been deleted. | ||
52 | * @reset: reset the device | 62 | * @reset: reset the device |
53 | * vdev: the virtio device | 63 | * vdev: the virtio device |
54 | * After this, status and feature negotiation must be done again | 64 | * After this, status and feature negotiation must be done again |
55 | * @find_vq: find a virtqueue and instantiate it. | 65 | * @find_vqs: find virtqueues and instantiate them. |
56 | * vdev: the virtio_device | 66 | * vdev: the virtio_device |
57 | * index: the 0-based virtqueue number in case there's more than one. | 67 | * nvqs: the number of virtqueues to find |
58 | * callback: the virqtueue callback | 68 | * vqs: on success, includes new virtqueues |
59 | * Returns the new virtqueue or ERR_PTR() (eg. -ENOENT). | 69 | * callbacks: array of callbacks, for each virtqueue |
60 | * @del_vq: free a virtqueue found by find_vq(). | 70 | * names: array of virtqueue names (mainly for debugging) |
71 | * Returns 0 on success or error status | ||
72 | * @del_vqs: free virtqueues found by find_vqs(). | ||
61 | * @get_features: get the array of feature bits for this device. | 73 | * @get_features: get the array of feature bits for this device. |
62 | * vdev: the virtio_device | 74 | * vdev: the virtio_device |
63 | * Returns the first 32 feature bits (all we currently need). | 75 | * Returns the first 32 feature bits (all we currently need). |
@@ -66,6 +78,7 @@ | |||
66 | * This gives the final feature bits for the device: it can change | 78 | * This gives the final feature bits for the device: it can change |
67 | * the dev->feature bits if it wants. | 79 | * the dev->feature bits if it wants. |
68 | */ | 80 | */ |
81 | typedef void vq_callback_t(struct virtqueue *); | ||
69 | struct virtio_config_ops | 82 | struct virtio_config_ops |
70 | { | 83 | { |
71 | void (*get)(struct virtio_device *vdev, unsigned offset, | 84 | void (*get)(struct virtio_device *vdev, unsigned offset, |
@@ -75,10 +88,11 @@ struct virtio_config_ops | |||
75 | u8 (*get_status)(struct virtio_device *vdev); | 88 | u8 (*get_status)(struct virtio_device *vdev); |
76 | void (*set_status)(struct virtio_device *vdev, u8 status); | 89 | void (*set_status)(struct virtio_device *vdev, u8 status); |
77 | void (*reset)(struct virtio_device *vdev); | 90 | void (*reset)(struct virtio_device *vdev); |
78 | struct virtqueue *(*find_vq)(struct virtio_device *vdev, | 91 | int (*find_vqs)(struct virtio_device *, unsigned nvqs, |
79 | unsigned index, | 92 | struct virtqueue *vqs[], |
80 | void (*callback)(struct virtqueue *)); | 93 | vq_callback_t *callbacks[], |
81 | void (*del_vq)(struct virtqueue *vq); | 94 | const char *names[]); |
95 | void (*del_vqs)(struct virtio_device *); | ||
82 | u32 (*get_features)(struct virtio_device *vdev); | 96 | u32 (*get_features)(struct virtio_device *vdev); |
83 | void (*finalize_features)(struct virtio_device *vdev); | 97 | void (*finalize_features)(struct virtio_device *vdev); |
84 | }; | 98 | }; |
@@ -99,7 +113,9 @@ static inline bool virtio_has_feature(const struct virtio_device *vdev, | |||
99 | if (__builtin_constant_p(fbit)) | 113 | if (__builtin_constant_p(fbit)) |
100 | BUILD_BUG_ON(fbit >= 32); | 114 | BUILD_BUG_ON(fbit >= 32); |
101 | 115 | ||
102 | virtio_check_driver_offered_feature(vdev, fbit); | 116 | if (fbit < VIRTIO_TRANSPORT_F_START) |
117 | virtio_check_driver_offered_feature(vdev, fbit); | ||
118 | |||
103 | return test_bit(fbit, vdev->features); | 119 | return test_bit(fbit, vdev->features); |
104 | } | 120 | } |
105 | 121 | ||
@@ -126,5 +142,18 @@ static inline int virtio_config_buf(struct virtio_device *vdev, | |||
126 | vdev->config->get(vdev, offset, buf, len); | 142 | vdev->config->get(vdev, offset, buf, len); |
127 | return 0; | 143 | return 0; |
128 | } | 144 | } |
145 | |||
146 | static inline | ||
147 | struct virtqueue *virtio_find_single_vq(struct virtio_device *vdev, | ||
148 | vq_callback_t *c, const char *n) | ||
149 | { | ||
150 | vq_callback_t *callbacks[] = { c }; | ||
151 | const char *names[] = { n }; | ||
152 | struct virtqueue *vq; | ||
153 | int err = vdev->config->find_vqs(vdev, 1, &vq, callbacks, names); | ||
154 | if (err < 0) | ||
155 | return ERR_PTR(err); | ||
156 | return vq; | ||
157 | } | ||
129 | #endif /* __KERNEL__ */ | 158 | #endif /* __KERNEL__ */ |
130 | #endif /* _LINUX_VIRTIO_CONFIG_H */ | 159 | #endif /* _LINUX_VIRTIO_CONFIG_H */ |
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h index cec79adbe3ea..9c543d6ac535 100644 --- a/include/linux/virtio_net.h +++ b/include/linux/virtio_net.h | |||
@@ -27,6 +27,7 @@ | |||
27 | #define VIRTIO_NET_F_CTRL_VQ 17 /* Control channel available */ | 27 | #define VIRTIO_NET_F_CTRL_VQ 17 /* Control channel available */ |
28 | #define VIRTIO_NET_F_CTRL_RX 18 /* Control channel RX mode support */ | 28 | #define VIRTIO_NET_F_CTRL_RX 18 /* Control channel RX mode support */ |
29 | #define VIRTIO_NET_F_CTRL_VLAN 19 /* Control channel VLAN filtering */ | 29 | #define VIRTIO_NET_F_CTRL_VLAN 19 /* Control channel VLAN filtering */ |
30 | #define VIRTIO_NET_F_CTRL_RX_EXTRA 20 /* Extra RX mode control support */ | ||
30 | 31 | ||
31 | #define VIRTIO_NET_S_LINK_UP 1 /* Link is up */ | 32 | #define VIRTIO_NET_S_LINK_UP 1 /* Link is up */ |
32 | 33 | ||
@@ -81,14 +82,19 @@ typedef __u8 virtio_net_ctrl_ack; | |||
81 | #define VIRTIO_NET_ERR 1 | 82 | #define VIRTIO_NET_ERR 1 |
82 | 83 | ||
83 | /* | 84 | /* |
84 | * Control the RX mode, ie. promisucous and allmulti. PROMISC and | 85 | * Control the RX mode, ie. promisucous, allmulti, etc... |
85 | * ALLMULTI commands require an "out" sg entry containing a 1 byte | 86 | * All commands require an "out" sg entry containing a 1 byte |
86 | * state value, zero = disable, non-zero = enable. These commands | 87 | * state value, zero = disable, non-zero = enable. Commands |
87 | * are supported with the VIRTIO_NET_F_CTRL_RX feature. | 88 | * 0 and 1 are supported with the VIRTIO_NET_F_CTRL_RX feature. |
89 | * Commands 2-5 are added with VIRTIO_NET_F_CTRL_RX_EXTRA. | ||
88 | */ | 90 | */ |
89 | #define VIRTIO_NET_CTRL_RX 0 | 91 | #define VIRTIO_NET_CTRL_RX 0 |
90 | #define VIRTIO_NET_CTRL_RX_PROMISC 0 | 92 | #define VIRTIO_NET_CTRL_RX_PROMISC 0 |
91 | #define VIRTIO_NET_CTRL_RX_ALLMULTI 1 | 93 | #define VIRTIO_NET_CTRL_RX_ALLMULTI 1 |
94 | #define VIRTIO_NET_CTRL_RX_ALLUNI 2 | ||
95 | #define VIRTIO_NET_CTRL_RX_NOMULTI 3 | ||
96 | #define VIRTIO_NET_CTRL_RX_NOUNI 4 | ||
97 | #define VIRTIO_NET_CTRL_RX_NOBCAST 5 | ||
92 | 98 | ||
93 | /* | 99 | /* |
94 | * Control the MAC filter table. | 100 | * Control the MAC filter table. |
diff --git a/include/linux/virtio_pci.h b/include/linux/virtio_pci.h index cd0fd5d181a6..9a3d7c48c622 100644 --- a/include/linux/virtio_pci.h +++ b/include/linux/virtio_pci.h | |||
@@ -47,9 +47,17 @@ | |||
47 | /* The bit of the ISR which indicates a device configuration change. */ | 47 | /* The bit of the ISR which indicates a device configuration change. */ |
48 | #define VIRTIO_PCI_ISR_CONFIG 0x2 | 48 | #define VIRTIO_PCI_ISR_CONFIG 0x2 |
49 | 49 | ||
50 | /* MSI-X registers: only enabled if MSI-X is enabled. */ | ||
51 | /* A 16-bit vector for configuration changes. */ | ||
52 | #define VIRTIO_MSI_CONFIG_VECTOR 20 | ||
53 | /* A 16-bit vector for selected queue notifications. */ | ||
54 | #define VIRTIO_MSI_QUEUE_VECTOR 22 | ||
55 | /* Vector value used to disable MSI for queue */ | ||
56 | #define VIRTIO_MSI_NO_VECTOR 0xffff | ||
57 | |||
50 | /* The remaining space is defined by each driver as the per-driver | 58 | /* The remaining space is defined by each driver as the per-driver |
51 | * configuration space */ | 59 | * configuration space */ |
52 | #define VIRTIO_PCI_CONFIG 20 | 60 | #define VIRTIO_PCI_CONFIG(dev) ((dev)->msix_enabled ? 24 : 20) |
53 | 61 | ||
54 | /* Virtio ABI version, this must match exactly */ | 62 | /* Virtio ABI version, this must match exactly */ |
55 | #define VIRTIO_PCI_ABI_VERSION 0 | 63 | #define VIRTIO_PCI_ABI_VERSION 0 |
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h index 71e03722fb59..693e0ec5afa6 100644 --- a/include/linux/virtio_ring.h +++ b/include/linux/virtio_ring.h | |||
@@ -14,6 +14,8 @@ | |||
14 | #define VRING_DESC_F_NEXT 1 | 14 | #define VRING_DESC_F_NEXT 1 |
15 | /* This marks a buffer as write-only (otherwise read-only). */ | 15 | /* This marks a buffer as write-only (otherwise read-only). */ |
16 | #define VRING_DESC_F_WRITE 2 | 16 | #define VRING_DESC_F_WRITE 2 |
17 | /* This means the buffer contains a list of buffer descriptors. */ | ||
18 | #define VRING_DESC_F_INDIRECT 4 | ||
17 | 19 | ||
18 | /* The Host uses this in used->flags to advise the Guest: don't kick me when | 20 | /* The Host uses this in used->flags to advise the Guest: don't kick me when |
19 | * you add a buffer. It's unreliable, so it's simply an optimization. Guest | 21 | * you add a buffer. It's unreliable, so it's simply an optimization. Guest |
@@ -24,6 +26,9 @@ | |||
24 | * optimization. */ | 26 | * optimization. */ |
25 | #define VRING_AVAIL_F_NO_INTERRUPT 1 | 27 | #define VRING_AVAIL_F_NO_INTERRUPT 1 |
26 | 28 | ||
29 | /* We support indirect buffer descriptors */ | ||
30 | #define VIRTIO_RING_F_INDIRECT_DESC 28 | ||
31 | |||
27 | /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ | 32 | /* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ |
28 | struct vring_desc | 33 | struct vring_desc |
29 | { | 34 | { |
@@ -119,7 +124,8 @@ struct virtqueue *vring_new_virtqueue(unsigned int num, | |||
119 | struct virtio_device *vdev, | 124 | struct virtio_device *vdev, |
120 | void *pages, | 125 | void *pages, |
121 | void (*notify)(struct virtqueue *vq), | 126 | void (*notify)(struct virtqueue *vq), |
122 | void (*callback)(struct virtqueue *vq)); | 127 | void (*callback)(struct virtqueue *vq), |
128 | const char *name); | ||
123 | void vring_del_virtqueue(struct virtqueue *vq); | 129 | void vring_del_virtqueue(struct virtqueue *vq); |
124 | /* Filter out transport-specific feature bits. */ | 130 | /* Filter out transport-specific feature bits. */ |
125 | void vring_transport_features(struct virtio_device *vdev); | 131 | void vring_transport_features(struct virtio_device *vdev); |
diff --git a/include/linux/vlynq.h b/include/linux/vlynq.h new file mode 100644 index 000000000000..8f6a95882b09 --- /dev/null +++ b/include/linux/vlynq.h | |||
@@ -0,0 +1,161 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2006, 2007 Eugene Konev <ejka@openwrt.org> | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify | ||
5 | * it under the terms of the GNU General Public License as published by | ||
6 | * the Free Software Foundation; either version 2 of the License, or | ||
7 | * (at your option) any later version. | ||
8 | * | ||
9 | * This program is distributed in the hope that it will be useful, | ||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | * GNU General Public License for more details. | ||
13 | * | ||
14 | * You should have received a copy of the GNU General Public License | ||
15 | * along with this program; if not, write to the Free Software | ||
16 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
17 | */ | ||
18 | |||
19 | #ifndef __VLYNQ_H__ | ||
20 | #define __VLYNQ_H__ | ||
21 | |||
22 | #include <linux/device.h> | ||
23 | #include <linux/module.h> | ||
24 | #include <linux/types.h> | ||
25 | |||
26 | #define VLYNQ_NUM_IRQS 32 | ||
27 | |||
28 | struct vlynq_mapping { | ||
29 | u32 size; | ||
30 | u32 offset; | ||
31 | }; | ||
32 | |||
33 | enum vlynq_divisor { | ||
34 | vlynq_div_auto = 0, | ||
35 | vlynq_ldiv1, | ||
36 | vlynq_ldiv2, | ||
37 | vlynq_ldiv3, | ||
38 | vlynq_ldiv4, | ||
39 | vlynq_ldiv5, | ||
40 | vlynq_ldiv6, | ||
41 | vlynq_ldiv7, | ||
42 | vlynq_ldiv8, | ||
43 | vlynq_rdiv1, | ||
44 | vlynq_rdiv2, | ||
45 | vlynq_rdiv3, | ||
46 | vlynq_rdiv4, | ||
47 | vlynq_rdiv5, | ||
48 | vlynq_rdiv6, | ||
49 | vlynq_rdiv7, | ||
50 | vlynq_rdiv8, | ||
51 | vlynq_div_external | ||
52 | }; | ||
53 | |||
54 | struct vlynq_device_id { | ||
55 | u32 id; | ||
56 | enum vlynq_divisor divisor; | ||
57 | unsigned long driver_data; | ||
58 | }; | ||
59 | |||
60 | struct vlynq_regs; | ||
61 | struct vlynq_device { | ||
62 | u32 id, dev_id; | ||
63 | int local_irq; | ||
64 | int remote_irq; | ||
65 | enum vlynq_divisor divisor; | ||
66 | u32 regs_start, regs_end; | ||
67 | u32 mem_start, mem_end; | ||
68 | u32 irq_start, irq_end; | ||
69 | int irq; | ||
70 | int enabled; | ||
71 | struct vlynq_regs *local; | ||
72 | struct vlynq_regs *remote; | ||
73 | struct device dev; | ||
74 | }; | ||
75 | |||
76 | struct vlynq_driver { | ||
77 | char *name; | ||
78 | struct vlynq_device_id *id_table; | ||
79 | int (*probe)(struct vlynq_device *dev, struct vlynq_device_id *id); | ||
80 | void (*remove)(struct vlynq_device *dev); | ||
81 | struct device_driver driver; | ||
82 | }; | ||
83 | |||
84 | struct plat_vlynq_ops { | ||
85 | int (*on)(struct vlynq_device *dev); | ||
86 | void (*off)(struct vlynq_device *dev); | ||
87 | }; | ||
88 | |||
89 | static inline struct vlynq_driver *to_vlynq_driver(struct device_driver *drv) | ||
90 | { | ||
91 | return container_of(drv, struct vlynq_driver, driver); | ||
92 | } | ||
93 | |||
94 | static inline struct vlynq_device *to_vlynq_device(struct device *device) | ||
95 | { | ||
96 | return container_of(device, struct vlynq_device, dev); | ||
97 | } | ||
98 | |||
99 | extern struct bus_type vlynq_bus_type; | ||
100 | |||
101 | extern int __vlynq_register_driver(struct vlynq_driver *driver, | ||
102 | struct module *owner); | ||
103 | |||
104 | static inline int vlynq_register_driver(struct vlynq_driver *driver) | ||
105 | { | ||
106 | return __vlynq_register_driver(driver, THIS_MODULE); | ||
107 | } | ||
108 | |||
109 | static inline void *vlynq_get_drvdata(struct vlynq_device *dev) | ||
110 | { | ||
111 | return dev_get_drvdata(&dev->dev); | ||
112 | } | ||
113 | |||
114 | static inline void vlynq_set_drvdata(struct vlynq_device *dev, void *data) | ||
115 | { | ||
116 | dev_set_drvdata(&dev->dev, data); | ||
117 | } | ||
118 | |||
119 | static inline u32 vlynq_mem_start(struct vlynq_device *dev) | ||
120 | { | ||
121 | return dev->mem_start; | ||
122 | } | ||
123 | |||
124 | static inline u32 vlynq_mem_end(struct vlynq_device *dev) | ||
125 | { | ||
126 | return dev->mem_end; | ||
127 | } | ||
128 | |||
129 | static inline u32 vlynq_mem_len(struct vlynq_device *dev) | ||
130 | { | ||
131 | return dev->mem_end - dev->mem_start + 1; | ||
132 | } | ||
133 | |||
134 | static inline int vlynq_virq_to_irq(struct vlynq_device *dev, int virq) | ||
135 | { | ||
136 | int irq = dev->irq_start + virq; | ||
137 | if ((irq < dev->irq_start) || (irq > dev->irq_end)) | ||
138 | return -EINVAL; | ||
139 | |||
140 | return irq; | ||
141 | } | ||
142 | |||
143 | static inline int vlynq_irq_to_virq(struct vlynq_device *dev, int irq) | ||
144 | { | ||
145 | if ((irq < dev->irq_start) || (irq > dev->irq_end)) | ||
146 | return -EINVAL; | ||
147 | |||
148 | return irq - dev->irq_start; | ||
149 | } | ||
150 | |||
151 | extern void vlynq_unregister_driver(struct vlynq_driver *driver); | ||
152 | extern int vlynq_enable_device(struct vlynq_device *dev); | ||
153 | extern void vlynq_disable_device(struct vlynq_device *dev); | ||
154 | extern int vlynq_set_local_mapping(struct vlynq_device *dev, u32 tx_offset, | ||
155 | struct vlynq_mapping *mapping); | ||
156 | extern int vlynq_set_remote_mapping(struct vlynq_device *dev, u32 tx_offset, | ||
157 | struct vlynq_mapping *mapping); | ||
158 | extern int vlynq_set_local_irq(struct vlynq_device *dev, int virq); | ||
159 | extern int vlynq_set_remote_irq(struct vlynq_device *dev, int virq); | ||
160 | |||
161 | #endif /* __VLYNQ_H__ */ | ||
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 524cd1b28ecb..81a97cf8f0a0 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
@@ -36,12 +36,14 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, | |||
36 | FOR_ALL_ZONES(PGSTEAL), | 36 | FOR_ALL_ZONES(PGSTEAL), |
37 | FOR_ALL_ZONES(PGSCAN_KSWAPD), | 37 | FOR_ALL_ZONES(PGSCAN_KSWAPD), |
38 | FOR_ALL_ZONES(PGSCAN_DIRECT), | 38 | FOR_ALL_ZONES(PGSCAN_DIRECT), |
39 | #ifdef CONFIG_NUMA | ||
40 | PGSCAN_ZONE_RECLAIM_FAILED, | ||
41 | #endif | ||
39 | PGINODESTEAL, SLABS_SCANNED, KSWAPD_STEAL, KSWAPD_INODESTEAL, | 42 | PGINODESTEAL, SLABS_SCANNED, KSWAPD_STEAL, KSWAPD_INODESTEAL, |
40 | PAGEOUTRUN, ALLOCSTALL, PGROTATED, | 43 | PAGEOUTRUN, ALLOCSTALL, PGROTATED, |
41 | #ifdef CONFIG_HUGETLB_PAGE | 44 | #ifdef CONFIG_HUGETLB_PAGE |
42 | HTLB_BUDDY_PGALLOC, HTLB_BUDDY_PGALLOC_FAIL, | 45 | HTLB_BUDDY_PGALLOC, HTLB_BUDDY_PGALLOC_FAIL, |
43 | #endif | 46 | #endif |
44 | #ifdef CONFIG_UNEVICTABLE_LRU | ||
45 | UNEVICTABLE_PGCULLED, /* culled to noreclaim list */ | 47 | UNEVICTABLE_PGCULLED, /* culled to noreclaim list */ |
46 | UNEVICTABLE_PGSCANNED, /* scanned for reclaimability */ | 48 | UNEVICTABLE_PGSCANNED, /* scanned for reclaimability */ |
47 | UNEVICTABLE_PGRESCUED, /* rescued from noreclaim list */ | 49 | UNEVICTABLE_PGRESCUED, /* rescued from noreclaim list */ |
@@ -50,7 +52,6 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, | |||
50 | UNEVICTABLE_PGCLEARED, /* on COW, page truncate */ | 52 | UNEVICTABLE_PGCLEARED, /* on COW, page truncate */ |
51 | UNEVICTABLE_PGSTRANDED, /* unable to isolate on unlock */ | 53 | UNEVICTABLE_PGSTRANDED, /* unable to isolate on unlock */ |
52 | UNEVICTABLE_MLOCKFREED, | 54 | UNEVICTABLE_MLOCKFREED, |
53 | #endif | ||
54 | NR_VM_EVENT_ITEMS | 55 | NR_VM_EVENT_ITEMS |
55 | }; | 56 | }; |
56 | 57 | ||
diff --git a/include/linux/w1-gpio.h b/include/linux/w1-gpio.h index 9797fec7748a..3adeff82212f 100644 --- a/include/linux/w1-gpio.h +++ b/include/linux/w1-gpio.h | |||
@@ -18,6 +18,7 @@ | |||
18 | struct w1_gpio_platform_data { | 18 | struct w1_gpio_platform_data { |
19 | unsigned int pin; | 19 | unsigned int pin; |
20 | unsigned int is_open_drain:1; | 20 | unsigned int is_open_drain:1; |
21 | void (*enable_external_pullup)(int enable); | ||
21 | }; | 22 | }; |
22 | 23 | ||
23 | #endif /* _LINUX_W1_GPIO_H */ | 24 | #endif /* _LINUX_W1_GPIO_H */ |
diff --git a/include/linux/wimax.h b/include/linux/wimax.h index c89de7f4e5b9..4fdcc5635518 100644 --- a/include/linux/wimax.h +++ b/include/linux/wimax.h | |||
@@ -59,7 +59,7 @@ enum { | |||
59 | * M - Major: change if removing or modifying an existing call. | 59 | * M - Major: change if removing or modifying an existing call. |
60 | * m - minor: change when adding a new call | 60 | * m - minor: change when adding a new call |
61 | */ | 61 | */ |
62 | WIMAX_GNL_VERSION = 00, | 62 | WIMAX_GNL_VERSION = 01, |
63 | /* Generic NetLink attributes */ | 63 | /* Generic NetLink attributes */ |
64 | WIMAX_GNL_ATTR_INVALID = 0x00, | 64 | WIMAX_GNL_ATTR_INVALID = 0x00, |
65 | WIMAX_GNL_ATTR_MAX = 10, | 65 | WIMAX_GNL_ATTR_MAX = 10, |
@@ -78,6 +78,7 @@ enum { | |||
78 | WIMAX_GNL_OP_RFKILL, /* Run wimax_rfkill() */ | 78 | WIMAX_GNL_OP_RFKILL, /* Run wimax_rfkill() */ |
79 | WIMAX_GNL_OP_RESET, /* Run wimax_rfkill() */ | 79 | WIMAX_GNL_OP_RESET, /* Run wimax_rfkill() */ |
80 | WIMAX_GNL_RE_STATE_CHANGE, /* Report: status change */ | 80 | WIMAX_GNL_RE_STATE_CHANGE, /* Report: status change */ |
81 | WIMAX_GNL_OP_STATE_GET, /* Request for current state */ | ||
81 | }; | 82 | }; |
82 | 83 | ||
83 | 84 | ||
@@ -113,6 +114,10 @@ enum { | |||
113 | WIMAX_GNL_RESET_IFIDX = 1, | 114 | WIMAX_GNL_RESET_IFIDX = 1, |
114 | }; | 115 | }; |
115 | 116 | ||
117 | /* Atributes for wimax_state_get() */ | ||
118 | enum { | ||
119 | WIMAX_GNL_STGET_IFIDX = 1, | ||
120 | }; | ||
116 | 121 | ||
117 | /* | 122 | /* |
118 | * Attributes for the Report State Change | 123 | * Attributes for the Report State Change |
diff --git a/include/linux/wimax/i2400m.h b/include/linux/wimax/i2400m.h index d5148a7889a6..433693ef2bb0 100644 --- a/include/linux/wimax/i2400m.h +++ b/include/linux/wimax/i2400m.h | |||
@@ -266,7 +266,7 @@ enum i2400m_ro_type { | |||
266 | 266 | ||
267 | /* Misc constants */ | 267 | /* Misc constants */ |
268 | enum { | 268 | enum { |
269 | I2400M_PL_PAD = 16, /* Payload data size alignment */ | 269 | I2400M_PL_ALIGN = 16, /* Payload data size alignment */ |
270 | I2400M_PL_SIZE_MAX = 0x3EFF, | 270 | I2400M_PL_SIZE_MAX = 0x3EFF, |
271 | I2400M_MAX_PLS_IN_MSG = 60, | 271 | I2400M_MAX_PLS_IN_MSG = 60, |
272 | /* protocol barkers: sync sequences; for notifications they | 272 | /* protocol barkers: sync sequences; for notifications they |