diff options
Diffstat (limited to 'include/linux')
247 files changed, 5024 insertions, 2446 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 1df2ac30a4d2..5114ff18101d 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -46,6 +46,7 @@ header-y += coff.h | |||
46 | header-y += comstats.h | 46 | header-y += comstats.h |
47 | header-y += consolemap.h | 47 | header-y += consolemap.h |
48 | header-y += cycx_cfm.h | 48 | header-y += cycx_cfm.h |
49 | header-y += dlm_device.h | ||
49 | header-y += dm-ioctl.h | 50 | header-y += dm-ioctl.h |
50 | header-y += dn.h | 51 | header-y += dn.h |
51 | header-y += dqblk_v1.h | 52 | header-y += dqblk_v1.h |
@@ -58,6 +59,7 @@ header-y += elf-em.h | |||
58 | header-y += fadvise.h | 59 | header-y += fadvise.h |
59 | header-y += fd.h | 60 | header-y += fd.h |
60 | header-y += fdreg.h | 61 | header-y += fdreg.h |
62 | header-y += fib_rules.h | ||
61 | header-y += ftape-header-segment.h | 63 | header-y += ftape-header-segment.h |
62 | header-y += ftape-vendors.h | 64 | header-y += ftape-vendors.h |
63 | header-y += fuse.h | 65 | header-y += fuse.h |
@@ -70,6 +72,7 @@ header-y += hysdn_if.h | |||
70 | header-y += i2c-dev.h | 72 | header-y += i2c-dev.h |
71 | header-y += i8k.h | 73 | header-y += i8k.h |
72 | header-y += icmp.h | 74 | header-y += icmp.h |
75 | header-y += if_addr.h | ||
73 | header-y += if_arcnet.h | 76 | header-y += if_arcnet.h |
74 | header-y += if_arp.h | 77 | header-y += if_arp.h |
75 | header-y += if_bonding.h | 78 | header-y += if_bonding.h |
@@ -79,6 +82,7 @@ header-y += if_fddi.h | |||
79 | header-y += if.h | 82 | header-y += if.h |
80 | header-y += if_hippi.h | 83 | header-y += if_hippi.h |
81 | header-y += if_infiniband.h | 84 | header-y += if_infiniband.h |
85 | header-y += if_link.h | ||
82 | header-y += if_packet.h | 86 | header-y += if_packet.h |
83 | header-y += if_plip.h | 87 | header-y += if_plip.h |
84 | header-y += if_ppp.h | 88 | header-y += if_ppp.h |
@@ -96,11 +100,11 @@ header-y += ipx.h | |||
96 | header-y += irda.h | 100 | header-y += irda.h |
97 | header-y += isdn_divertif.h | 101 | header-y += isdn_divertif.h |
98 | header-y += iso_fs.h | 102 | header-y += iso_fs.h |
99 | header-y += ite_gpio.h | ||
100 | header-y += ixjuser.h | 103 | header-y += ixjuser.h |
101 | header-y += jffs2.h | 104 | header-y += jffs2.h |
102 | header-y += keyctl.h | 105 | header-y += keyctl.h |
103 | header-y += limits.h | 106 | header-y += limits.h |
107 | header-y += lock_dlm_plock.h | ||
104 | header-y += magic.h | 108 | header-y += magic.h |
105 | header-y += major.h | 109 | header-y += major.h |
106 | header-y += matroxfb.h | 110 | header-y += matroxfb.h |
@@ -110,6 +114,7 @@ header-y += mmtimer.h | |||
110 | header-y += mqueue.h | 114 | header-y += mqueue.h |
111 | header-y += mtio.h | 115 | header-y += mtio.h |
112 | header-y += ncp_no.h | 116 | header-y += ncp_no.h |
117 | header-y += neighbour.h | ||
113 | header-y += netfilter_arp.h | 118 | header-y += netfilter_arp.h |
114 | header-y += netrom.h | 119 | header-y += netrom.h |
115 | header-y += nfs2.h | 120 | header-y += nfs2.h |
@@ -152,12 +157,10 @@ header-y += toshiba.h | |||
152 | header-y += ultrasound.h | 157 | header-y += ultrasound.h |
153 | header-y += un.h | 158 | header-y += un.h |
154 | header-y += utime.h | 159 | header-y += utime.h |
155 | header-y += utsname.h | ||
156 | header-y += video_decoder.h | 160 | header-y += video_decoder.h |
157 | header-y += video_encoder.h | 161 | header-y += video_encoder.h |
158 | header-y += videotext.h | 162 | header-y += videotext.h |
159 | header-y += vt.h | 163 | header-y += vt.h |
160 | header-y += wavefront.h | ||
161 | header-y += wireless.h | 164 | header-y += wireless.h |
162 | header-y += xattr.h | 165 | header-y += xattr.h |
163 | header-y += x25.h | 166 | header-y += x25.h |
@@ -190,6 +193,7 @@ unifdef-y += cyclades.h | |||
190 | unifdef-y += dccp.h | 193 | unifdef-y += dccp.h |
191 | unifdef-y += dirent.h | 194 | unifdef-y += dirent.h |
192 | unifdef-y += divert.h | 195 | unifdef-y += divert.h |
196 | unifdef-y += dlm.h | ||
193 | unifdef-y += elfcore.h | 197 | unifdef-y += elfcore.h |
194 | unifdef-y += errno.h | 198 | unifdef-y += errno.h |
195 | unifdef-y += errqueue.h | 199 | unifdef-y += errqueue.h |
@@ -206,6 +210,7 @@ unifdef-y += ftape.h | |||
206 | unifdef-y += gameport.h | 210 | unifdef-y += gameport.h |
207 | unifdef-y += generic_serial.h | 211 | unifdef-y += generic_serial.h |
208 | unifdef-y += genhd.h | 212 | unifdef-y += genhd.h |
213 | unifdef-y += gfs2_ondisk.h | ||
209 | unifdef-y += hayesesp.h | 214 | unifdef-y += hayesesp.h |
210 | unifdef-y += hdlcdrv.h | 215 | unifdef-y += hdlcdrv.h |
211 | unifdef-y += hdlc.h | 216 | unifdef-y += hdlc.h |
@@ -329,6 +334,7 @@ unifdef-y += unistd.h | |||
329 | unifdef-y += usb_ch9.h | 334 | unifdef-y += usb_ch9.h |
330 | unifdef-y += usbdevice_fs.h | 335 | unifdef-y += usbdevice_fs.h |
331 | unifdef-y += user.h | 336 | unifdef-y += user.h |
337 | unifdef-y += utsname.h | ||
332 | unifdef-y += videodev2.h | 338 | unifdef-y += videodev2.h |
333 | unifdef-y += videodev.h | 339 | unifdef-y += videodev.h |
334 | unifdef-y += wait.h | 340 | unifdef-y += wait.h |
diff --git a/include/linux/ac97_codec.h b/include/linux/ac97_codec.h index 2ed2fd855133..22eb9367235a 100644 --- a/include/linux/ac97_codec.h +++ b/include/linux/ac97_codec.h | |||
@@ -331,8 +331,6 @@ extern int ac97_read_proc (char *page_out, char **start, off_t off, | |||
331 | extern int ac97_probe_codec(struct ac97_codec *); | 331 | extern int ac97_probe_codec(struct ac97_codec *); |
332 | extern unsigned int ac97_set_adc_rate(struct ac97_codec *codec, unsigned int rate); | 332 | extern unsigned int ac97_set_adc_rate(struct ac97_codec *codec, unsigned int rate); |
333 | extern unsigned int ac97_set_dac_rate(struct ac97_codec *codec, unsigned int rate); | 333 | extern unsigned int ac97_set_dac_rate(struct ac97_codec *codec, unsigned int rate); |
334 | extern int ac97_save_state(struct ac97_codec *codec); | ||
335 | extern int ac97_restore_state(struct ac97_codec *codec); | ||
336 | 334 | ||
337 | extern struct ac97_codec *ac97_alloc_codec(void); | 335 | extern struct ac97_codec *ac97_alloc_codec(void); |
338 | extern void ac97_release_codec(struct ac97_codec *codec); | 336 | extern void ac97_release_codec(struct ac97_codec *codec); |
@@ -346,9 +344,6 @@ struct ac97_driver { | |||
346 | void (*remove) (struct ac97_codec *codec, struct ac97_driver *driver); | 344 | void (*remove) (struct ac97_codec *codec, struct ac97_driver *driver); |
347 | }; | 345 | }; |
348 | 346 | ||
349 | extern int ac97_register_driver(struct ac97_driver *driver); | ||
350 | extern void ac97_unregister_driver(struct ac97_driver *driver); | ||
351 | |||
352 | /* quirk types */ | 347 | /* quirk types */ |
353 | enum { | 348 | enum { |
354 | AC97_TUNE_DEFAULT = -1, /* use default from quirk list (not valid in list) */ | 349 | AC97_TUNE_DEFAULT = -1, /* use default from quirk list (not valid in list) */ |
diff --git a/include/linux/acct.h b/include/linux/acct.h index e86bae7324d2..0496d1f09952 100644 --- a/include/linux/acct.h +++ b/include/linux/acct.h | |||
@@ -124,16 +124,12 @@ extern void acct_auto_close(struct super_block *sb); | |||
124 | extern void acct_init_pacct(struct pacct_struct *pacct); | 124 | extern void acct_init_pacct(struct pacct_struct *pacct); |
125 | extern void acct_collect(long exitcode, int group_dead); | 125 | extern void acct_collect(long exitcode, int group_dead); |
126 | extern void acct_process(void); | 126 | extern void acct_process(void); |
127 | extern void acct_update_integrals(struct task_struct *tsk); | ||
128 | extern void acct_clear_integrals(struct task_struct *tsk); | ||
129 | #else | 127 | #else |
130 | #define acct_auto_close_mnt(x) do { } while (0) | 128 | #define acct_auto_close_mnt(x) do { } while (0) |
131 | #define acct_auto_close(x) do { } while (0) | 129 | #define acct_auto_close(x) do { } while (0) |
132 | #define acct_init_pacct(x) do { } while (0) | 130 | #define acct_init_pacct(x) do { } while (0) |
133 | #define acct_collect(x,y) do { } while (0) | 131 | #define acct_collect(x,y) do { } while (0) |
134 | #define acct_process() do { } while (0) | 132 | #define acct_process() do { } while (0) |
135 | #define acct_update_integrals(x) do { } while (0) | ||
136 | #define acct_clear_integrals(task) do { } while (0) | ||
137 | #endif | 133 | #endif |
138 | 134 | ||
139 | /* | 135 | /* |
diff --git a/include/linux/aer.h b/include/linux/aer.h new file mode 100644 index 000000000000..402e178b38eb --- /dev/null +++ b/include/linux/aer.h | |||
@@ -0,0 +1,24 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2006 Intel Corp. | ||
3 | * Tom Long Nguyen (tom.l.nguyen@intel.com) | ||
4 | * Zhang Yanmin (yanmin.zhang@intel.com) | ||
5 | */ | ||
6 | |||
7 | #ifndef _AER_H_ | ||
8 | #define _AER_H_ | ||
9 | |||
10 | #if defined(CONFIG_PCIEAER) | ||
11 | /* pci-e port driver needs this function to enable aer */ | ||
12 | extern int pci_enable_pcie_error_reporting(struct pci_dev *dev); | ||
13 | extern int pci_find_aer_capability(struct pci_dev *dev); | ||
14 | extern int pci_disable_pcie_error_reporting(struct pci_dev *dev); | ||
15 | extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev); | ||
16 | #else | ||
17 | #define pci_enable_pcie_error_reporting(dev) do { } while (0) | ||
18 | #define pci_find_aer_capability(dev) do { } while (0) | ||
19 | #define pci_disable_pcie_error_reporting(dev) do { } while (0) | ||
20 | #define pci_cleanup_aer_uncorrect_error_status(dev) do { } while (0) | ||
21 | #endif | ||
22 | |||
23 | #endif //_AER_H_ | ||
24 | |||
diff --git a/include/linux/aio.h b/include/linux/aio.h index 00c8efa95cc3..0d71c0041f13 100644 --- a/include/linux/aio.h +++ b/include/linux/aio.h | |||
@@ -4,8 +4,10 @@ | |||
4 | #include <linux/list.h> | 4 | #include <linux/list.h> |
5 | #include <linux/workqueue.h> | 5 | #include <linux/workqueue.h> |
6 | #include <linux/aio_abi.h> | 6 | #include <linux/aio_abi.h> |
7 | #include <linux/uio.h> | ||
7 | 8 | ||
8 | #include <asm/atomic.h> | 9 | #include <asm/atomic.h> |
10 | #include <linux/uio.h> | ||
9 | 11 | ||
10 | #define AIO_MAXSEGS 4 | 12 | #define AIO_MAXSEGS 4 |
11 | #define AIO_KIOGRP_NR_ATOMIC 8 | 13 | #define AIO_KIOGRP_NR_ATOMIC 8 |
@@ -110,8 +112,10 @@ struct kiocb { | |||
110 | char __user *ki_buf; /* remaining iocb->aio_buf */ | 112 | char __user *ki_buf; /* remaining iocb->aio_buf */ |
111 | size_t ki_left; /* remaining bytes */ | 113 | size_t ki_left; /* remaining bytes */ |
112 | long ki_retried; /* just for testing */ | 114 | long ki_retried; /* just for testing */ |
113 | long ki_kicked; /* just for testing */ | 115 | struct iovec ki_inline_vec; /* inline vector */ |
114 | long ki_queued; /* just for testing */ | 116 | struct iovec *ki_iovec; |
117 | unsigned long ki_nr_segs; | ||
118 | unsigned long ki_cur_seg; | ||
115 | 119 | ||
116 | struct list_head ki_list; /* the aio core uses this | 120 | struct list_head ki_list; /* the aio core uses this |
117 | * for cancellation */ | 121 | * for cancellation */ |
@@ -213,11 +217,11 @@ int FASTCALL(io_submit_one(struct kioctx *ctx, struct iocb __user *user_iocb, | |||
213 | struct iocb *iocb)); | 217 | struct iocb *iocb)); |
214 | 218 | ||
215 | #define get_ioctx(kioctx) do { \ | 219 | #define get_ioctx(kioctx) do { \ |
216 | BUG_ON(unlikely(atomic_read(&(kioctx)->users) <= 0)); \ | 220 | BUG_ON(atomic_read(&(kioctx)->users) <= 0); \ |
217 | atomic_inc(&(kioctx)->users); \ | 221 | atomic_inc(&(kioctx)->users); \ |
218 | } while (0) | 222 | } while (0) |
219 | #define put_ioctx(kioctx) do { \ | 223 | #define put_ioctx(kioctx) do { \ |
220 | BUG_ON(unlikely(atomic_read(&(kioctx)->users) <= 0)); \ | 224 | BUG_ON(atomic_read(&(kioctx)->users) <= 0); \ |
221 | if (unlikely(atomic_dec_and_test(&(kioctx)->users))) \ | 225 | if (unlikely(atomic_dec_and_test(&(kioctx)->users))) \ |
222 | __put_ioctx(kioctx); \ | 226 | __put_ioctx(kioctx); \ |
223 | } while (0) | 227 | } while (0) |
diff --git a/include/linux/aio_abi.h b/include/linux/aio_abi.h index 30fdcc89d142..e3ca0a485cc6 100644 --- a/include/linux/aio_abi.h +++ b/include/linux/aio_abi.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* linux/aio_abi.h | 1 | /* include/linux/aio_abi.h |
2 | * | 2 | * |
3 | * Copyright 2000,2001,2002 Red Hat. | 3 | * Copyright 2000,2001,2002 Red Hat. |
4 | * | 4 | * |
@@ -41,6 +41,8 @@ enum { | |||
41 | * IOCB_CMD_POLL = 5, | 41 | * IOCB_CMD_POLL = 5, |
42 | */ | 42 | */ |
43 | IOCB_CMD_NOOP = 6, | 43 | IOCB_CMD_NOOP = 6, |
44 | IOCB_CMD_PREADV = 7, | ||
45 | IOCB_CMD_PWRITEV = 8, | ||
44 | }; | 46 | }; |
45 | 47 | ||
46 | /* read() from /dev/aio returns these structures. */ | 48 | /* read() from /dev/aio returns these structures. */ |
diff --git a/include/linux/atalk.h b/include/linux/atalk.h index 6ba3aa8a81f4..75b8baca08f3 100644 --- a/include/linux/atalk.h +++ b/include/linux/atalk.h | |||
@@ -88,15 +88,7 @@ static inline struct atalk_sock *at_sk(struct sock *sk) | |||
88 | #include <asm/byteorder.h> | 88 | #include <asm/byteorder.h> |
89 | 89 | ||
90 | struct ddpehdr { | 90 | struct ddpehdr { |
91 | #ifdef __LITTLE_ENDIAN_BITFIELD | 91 | __be16 deh_len_hops; /* lower 10 bits are length, next 4 - hops */ |
92 | __u16 deh_len:10, | ||
93 | deh_hops:4, | ||
94 | deh_pad:2; | ||
95 | #else | ||
96 | __u16 deh_pad:2, | ||
97 | deh_hops:4, | ||
98 | deh_len:10; | ||
99 | #endif | ||
100 | __be16 deh_sum; | 92 | __be16 deh_sum; |
101 | __be16 deh_dnet; | 93 | __be16 deh_dnet; |
102 | __be16 deh_snet; | 94 | __be16 deh_snet; |
@@ -112,36 +104,6 @@ static __inline__ struct ddpehdr *ddp_hdr(struct sk_buff *skb) | |||
112 | return (struct ddpehdr *)skb->h.raw; | 104 | return (struct ddpehdr *)skb->h.raw; |
113 | } | 105 | } |
114 | 106 | ||
115 | /* | ||
116 | * Don't drop the struct into the struct above. You'll get some | ||
117 | * surprise padding. | ||
118 | */ | ||
119 | struct ddpebits { | ||
120 | #ifdef __LITTLE_ENDIAN_BITFIELD | ||
121 | __u16 deh_len:10, | ||
122 | deh_hops:4, | ||
123 | deh_pad:2; | ||
124 | #else | ||
125 | __u16 deh_pad:2, | ||
126 | deh_hops:4, | ||
127 | deh_len:10; | ||
128 | #endif | ||
129 | }; | ||
130 | |||
131 | /* Short form header */ | ||
132 | struct ddpshdr { | ||
133 | #ifdef __LITTLE_ENDIAN_BITFIELD | ||
134 | __u16 dsh_len:10, | ||
135 | dsh_pad:6; | ||
136 | #else | ||
137 | __u16 dsh_pad:6, | ||
138 | dsh_len:10; | ||
139 | #endif | ||
140 | __u8 dsh_dport; | ||
141 | __u8 dsh_sport; | ||
142 | /* And netatalk apps expect to stick the type in themselves */ | ||
143 | }; | ||
144 | |||
145 | /* AppleTalk AARP headers */ | 107 | /* AppleTalk AARP headers */ |
146 | struct elapaarp { | 108 | struct elapaarp { |
147 | __be16 hw_type; | 109 | __be16 hw_type; |
diff --git a/include/linux/atmlec.h b/include/linux/atmlec.h index f267f2442766..6f5a1bab8f50 100644 --- a/include/linux/atmlec.h +++ b/include/linux/atmlec.h | |||
@@ -1,9 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * | 2 | * ATM Lan Emulation Daemon driver interface |
3 | * ATM Lan Emulation Daemon vs. driver interface | ||
4 | * | ||
5 | * mkiiskila@yahoo.com | ||
6 | * | 3 | * |
4 | * Marko Kiiskila <mkiiskila@yahoo.com> | ||
7 | */ | 5 | */ |
8 | 6 | ||
9 | #ifndef _ATMLEC_H_ | 7 | #ifndef _ATMLEC_H_ |
@@ -13,76 +11,87 @@ | |||
13 | #include <linux/atmioc.h> | 11 | #include <linux/atmioc.h> |
14 | #include <linux/atm.h> | 12 | #include <linux/atm.h> |
15 | #include <linux/if_ether.h> | 13 | #include <linux/if_ether.h> |
14 | |||
16 | /* ATM lec daemon control socket */ | 15 | /* ATM lec daemon control socket */ |
17 | #define ATMLEC_CTRL _IO('a',ATMIOC_LANE) | 16 | #define ATMLEC_CTRL _IO('a', ATMIOC_LANE) |
18 | #define ATMLEC_DATA _IO('a',ATMIOC_LANE+1) | 17 | #define ATMLEC_DATA _IO('a', ATMIOC_LANE+1) |
19 | #define ATMLEC_MCAST _IO('a',ATMIOC_LANE+2) | 18 | #define ATMLEC_MCAST _IO('a', ATMIOC_LANE+2) |
20 | 19 | ||
21 | /* Maximum number of LEC interfaces (tweakable) */ | 20 | /* Maximum number of LEC interfaces (tweakable) */ |
22 | #define MAX_LEC_ITF 48 | 21 | #define MAX_LEC_ITF 48 |
23 | 22 | ||
24 | /* From the total of MAX_LEC_ITF, last NUM_TR_DEVS are reserved for Token Ring. | 23 | /* |
24 | * From the total of MAX_LEC_ITF, last NUM_TR_DEVS are reserved for Token Ring. | ||
25 | * E.g. if MAX_LEC_ITF = 48 and NUM_TR_DEVS = 8, then lec0-lec39 are for | 25 | * E.g. if MAX_LEC_ITF = 48 and NUM_TR_DEVS = 8, then lec0-lec39 are for |
26 | * Ethernet ELANs and lec40-lec47 are for Token Ring ELANS. | 26 | * Ethernet ELANs and lec40-lec47 are for Token Ring ELANS. |
27 | */ | 27 | */ |
28 | #define NUM_TR_DEVS 8 | 28 | #define NUM_TR_DEVS 8 |
29 | 29 | ||
30 | typedef enum { | 30 | typedef enum { |
31 | l_set_mac_addr, l_del_mac_addr, | 31 | l_set_mac_addr, |
32 | l_svc_setup, | 32 | l_del_mac_addr, |
33 | l_addr_delete, l_topology_change, | 33 | l_svc_setup, |
34 | l_flush_complete, l_arp_update, | 34 | l_addr_delete, |
35 | l_narp_req, /* LANE2 mandates the use of this */ | 35 | l_topology_change, |
36 | l_config, l_flush_tran_id, | 36 | l_flush_complete, |
37 | l_set_lecid, l_arp_xmt, | 37 | l_arp_update, |
38 | l_rdesc_arp_xmt, | 38 | l_narp_req, /* LANE2 mandates the use of this */ |
39 | l_associate_req, | 39 | l_config, |
40 | l_should_bridge /* should we bridge this MAC? */ | 40 | l_flush_tran_id, |
41 | l_set_lecid, | ||
42 | l_arp_xmt, | ||
43 | l_rdesc_arp_xmt, | ||
44 | l_associate_req, | ||
45 | l_should_bridge /* should we bridge this MAC? */ | ||
41 | } atmlec_msg_type; | 46 | } atmlec_msg_type; |
42 | 47 | ||
43 | #define ATMLEC_MSG_TYPE_MAX l_should_bridge | 48 | #define ATMLEC_MSG_TYPE_MAX l_should_bridge |
44 | 49 | ||
45 | struct atmlec_config_msg { | 50 | struct atmlec_config_msg { |
46 | unsigned int maximum_unknown_frame_count; | 51 | unsigned int maximum_unknown_frame_count; |
47 | unsigned int max_unknown_frame_time; | 52 | unsigned int max_unknown_frame_time; |
48 | unsigned short max_retry_count; | 53 | unsigned short max_retry_count; |
49 | unsigned int aging_time; | 54 | unsigned int aging_time; |
50 | unsigned int forward_delay_time; | 55 | unsigned int forward_delay_time; |
51 | unsigned int arp_response_time; | 56 | unsigned int arp_response_time; |
52 | unsigned int flush_timeout; | 57 | unsigned int flush_timeout; |
53 | unsigned int path_switching_delay; | 58 | unsigned int path_switching_delay; |
54 | unsigned int lane_version; /* LANE2: 1 for LANEv1, 2 for LANEv2 */ | 59 | unsigned int lane_version; /* LANE2: 1 for LANEv1, 2 for LANEv2 */ |
55 | int mtu; | 60 | int mtu; |
56 | int is_proxy; | 61 | int is_proxy; |
57 | }; | 62 | }; |
58 | 63 | ||
59 | struct atmlec_msg { | 64 | struct atmlec_msg { |
60 | atmlec_msg_type type; | 65 | atmlec_msg_type type; |
61 | int sizeoftlvs; /* LANE2: if != 0, tlvs follow */ | 66 | int sizeoftlvs; /* LANE2: if != 0, tlvs follow */ |
62 | union { | 67 | union { |
63 | struct { | 68 | struct { |
64 | unsigned char mac_addr[ETH_ALEN]; | 69 | unsigned char mac_addr[ETH_ALEN]; |
65 | unsigned char atm_addr[ATM_ESA_LEN]; | 70 | unsigned char atm_addr[ATM_ESA_LEN]; |
66 | unsigned int flag;/* Topology_change flag, | 71 | unsigned int flag; /* |
67 | remoteflag, permanent flag, | 72 | * Topology_change flag, |
68 | lecid, transaction id */ | 73 | * remoteflag, permanent flag, |
69 | unsigned int targetless_le_arp; /* LANE2 */ | 74 | * lecid, transaction id |
70 | unsigned int no_source_le_narp; /* LANE2 */ | 75 | */ |
71 | } normal; | 76 | unsigned int targetless_le_arp; /* LANE2 */ |
72 | struct atmlec_config_msg config; | 77 | unsigned int no_source_le_narp; /* LANE2 */ |
73 | struct { | 78 | } normal; |
74 | uint16_t lec_id; /* requestor lec_id */ | 79 | struct atmlec_config_msg config; |
75 | uint32_t tran_id; /* transaction id */ | 80 | struct { |
76 | unsigned char mac_addr[ETH_ALEN]; /* dst mac addr */ | 81 | uint16_t lec_id; /* requestor lec_id */ |
77 | unsigned char atm_addr[ATM_ESA_LEN]; /* reqestor ATM addr */ | 82 | uint32_t tran_id; /* transaction id */ |
78 | } proxy; | 83 | unsigned char mac_addr[ETH_ALEN]; /* dst mac addr */ |
79 | /* For mapping LE_ARP requests to responses. Filled by */ | 84 | unsigned char atm_addr[ATM_ESA_LEN]; /* reqestor ATM addr */ |
80 | } content; /* zeppelin, returned by kernel. Used only when proxying */ | 85 | } proxy; /* |
86 | * For mapping LE_ARP requests to responses. Filled by | ||
87 | * zeppelin, returned by kernel. Used only when proxying | ||
88 | */ | ||
89 | } content; | ||
81 | } __ATM_API_ALIGN; | 90 | } __ATM_API_ALIGN; |
82 | 91 | ||
83 | struct atmlec_ioc { | 92 | struct atmlec_ioc { |
84 | int dev_num; | 93 | int dev_num; |
85 | unsigned char atm_addr[ATM_ESA_LEN]; | 94 | unsigned char atm_addr[ATM_ESA_LEN]; |
86 | unsigned char receive; /* 1= receive vcc, 0 = send vcc */ | 95 | unsigned char receive; /* 1= receive vcc, 0 = send vcc */ |
87 | }; | 96 | }; |
88 | #endif /* _ATMLEC_H_ */ | 97 | #endif /* _ATMLEC_H_ */ |
diff --git a/include/linux/audit.h b/include/linux/audit.h index 40a6c26294ae..b2ca666d9997 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h | |||
@@ -75,7 +75,7 @@ | |||
75 | #define AUDIT_DAEMON_CONFIG 1203 /* Daemon config change */ | 75 | #define AUDIT_DAEMON_CONFIG 1203 /* Daemon config change */ |
76 | 76 | ||
77 | #define AUDIT_SYSCALL 1300 /* Syscall event */ | 77 | #define AUDIT_SYSCALL 1300 /* Syscall event */ |
78 | #define AUDIT_FS_WATCH 1301 /* Filesystem watch event */ | 78 | /* #define AUDIT_FS_WATCH 1301 * Deprecated */ |
79 | #define AUDIT_PATH 1302 /* Filename path information */ | 79 | #define AUDIT_PATH 1302 /* Filename path information */ |
80 | #define AUDIT_IPC 1303 /* IPC record */ | 80 | #define AUDIT_IPC 1303 /* IPC record */ |
81 | #define AUDIT_SOCKETCALL 1304 /* sys_socketcall arguments */ | 81 | #define AUDIT_SOCKETCALL 1304 /* sys_socketcall arguments */ |
@@ -88,6 +88,7 @@ | |||
88 | #define AUDIT_MQ_SENDRECV 1313 /* POSIX MQ send/receive record type */ | 88 | #define AUDIT_MQ_SENDRECV 1313 /* POSIX MQ send/receive record type */ |
89 | #define AUDIT_MQ_NOTIFY 1314 /* POSIX MQ notify record type */ | 89 | #define AUDIT_MQ_NOTIFY 1314 /* POSIX MQ notify record type */ |
90 | #define AUDIT_MQ_GETSETATTR 1315 /* POSIX MQ get/set attribute record type */ | 90 | #define AUDIT_MQ_GETSETATTR 1315 /* POSIX MQ get/set attribute record type */ |
91 | #define AUDIT_KERNEL_OTHER 1316 /* For use by 3rd party modules */ | ||
91 | 92 | ||
92 | #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ | 93 | #define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ |
93 | #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ | 94 | #define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ |
@@ -95,6 +96,11 @@ | |||
95 | #define AUDIT_MAC_POLICY_LOAD 1403 /* Policy file load */ | 96 | #define AUDIT_MAC_POLICY_LOAD 1403 /* Policy file load */ |
96 | #define AUDIT_MAC_STATUS 1404 /* Changed enforcing,permissive,off */ | 97 | #define AUDIT_MAC_STATUS 1404 /* Changed enforcing,permissive,off */ |
97 | #define AUDIT_MAC_CONFIG_CHANGE 1405 /* Changes to booleans */ | 98 | #define AUDIT_MAC_CONFIG_CHANGE 1405 /* Changes to booleans */ |
99 | #define AUDIT_MAC_UNLBL_ALLOW 1406 /* NetLabel: allow unlabeled traffic */ | ||
100 | #define AUDIT_MAC_CIPSOV4_ADD 1407 /* NetLabel: add CIPSOv4 DOI entry */ | ||
101 | #define AUDIT_MAC_CIPSOV4_DEL 1408 /* NetLabel: del CIPSOv4 DOI entry */ | ||
102 | #define AUDIT_MAC_MAP_ADD 1409 /* NetLabel: add LSM domain mapping */ | ||
103 | #define AUDIT_MAC_MAP_DEL 1410 /* NetLabel: del LSM domain mapping */ | ||
98 | 104 | ||
99 | #define AUDIT_FIRST_KERN_ANOM_MSG 1700 | 105 | #define AUDIT_FIRST_KERN_ANOM_MSG 1700 |
100 | #define AUDIT_LAST_KERN_ANOM_MSG 1799 | 106 | #define AUDIT_LAST_KERN_ANOM_MSG 1799 |
diff --git a/include/linux/awe_voice.h b/include/linux/awe_voice.h index 4bf9f33048e2..bf33f17bea99 100644 --- a/include/linux/awe_voice.h +++ b/include/linux/awe_voice.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * sound/awe_voice.h | 2 | * include/linux/awe_voice.h |
3 | * | 3 | * |
4 | * Voice information definitions for the low level driver for the | 4 | * Voice information definitions for the low level driver for the |
5 | * AWE32/SB32/AWE64 wave table synth. | 5 | * AWE32/SB32/AWE64 wave table synth. |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 76bdaeab6f62..092dbd0e7658 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -70,7 +70,8 @@ typedef void (bio_destructor_t) (struct bio *); | |||
70 | * stacking drivers) | 70 | * stacking drivers) |
71 | */ | 71 | */ |
72 | struct bio { | 72 | struct bio { |
73 | sector_t bi_sector; | 73 | sector_t bi_sector; /* device address in 512 byte |
74 | sectors */ | ||
74 | struct bio *bi_next; /* request queue link */ | 75 | struct bio *bi_next; /* request queue link */ |
75 | struct block_device *bi_bdev; | 76 | struct block_device *bi_bdev; |
76 | unsigned long bi_flags; /* status, command, etc */ | 77 | unsigned long bi_flags; /* status, command, etc */ |
@@ -148,6 +149,7 @@ struct bio { | |||
148 | #define BIO_RW_BARRIER 2 | 149 | #define BIO_RW_BARRIER 2 |
149 | #define BIO_RW_FAILFAST 3 | 150 | #define BIO_RW_FAILFAST 3 |
150 | #define BIO_RW_SYNC 4 | 151 | #define BIO_RW_SYNC 4 |
152 | #define BIO_RW_META 5 | ||
151 | 153 | ||
152 | /* | 154 | /* |
153 | * upper 16 bits of bi_rw define the io priority of this bio | 155 | * upper 16 bits of bi_rw define the io priority of this bio |
@@ -178,6 +180,7 @@ struct bio { | |||
178 | #define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC)) | 180 | #define bio_sync(bio) ((bio)->bi_rw & (1 << BIO_RW_SYNC)) |
179 | #define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST)) | 181 | #define bio_failfast(bio) ((bio)->bi_rw & (1 << BIO_RW_FAILFAST)) |
180 | #define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD)) | 182 | #define bio_rw_ahead(bio) ((bio)->bi_rw & (1 << BIO_RW_AHEAD)) |
183 | #define bio_rw_meta(bio) ((bio)->bi_rw & (1 << BIO_RW_META)) | ||
181 | 184 | ||
182 | /* | 185 | /* |
183 | * will die | 186 | * will die |
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index c773ee545ebd..26f7856ff812 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _LINUX_BLKDEV_H | 1 | #ifndef _LINUX_BLKDEV_H |
2 | #define _LINUX_BLKDEV_H | 2 | #define _LINUX_BLKDEV_H |
3 | 3 | ||
4 | #include <linux/sched.h> | ||
4 | #include <linux/major.h> | 5 | #include <linux/major.h> |
5 | #include <linux/genhd.h> | 6 | #include <linux/genhd.h> |
6 | #include <linux/list.h> | 7 | #include <linux/list.h> |
@@ -16,6 +17,22 @@ | |||
16 | 17 | ||
17 | #include <asm/scatterlist.h> | 18 | #include <asm/scatterlist.h> |
18 | 19 | ||
20 | #ifdef CONFIG_LBD | ||
21 | # include <asm/div64.h> | ||
22 | # define sector_div(a, b) do_div(a, b) | ||
23 | #else | ||
24 | # define sector_div(n, b)( \ | ||
25 | { \ | ||
26 | int _res; \ | ||
27 | _res = (n) % (b); \ | ||
28 | (n) /= (b); \ | ||
29 | _res; \ | ||
30 | } \ | ||
31 | ) | ||
32 | #endif | ||
33 | |||
34 | #ifdef CONFIG_BLOCK | ||
35 | |||
19 | struct scsi_ioctl_command; | 36 | struct scsi_ioctl_command; |
20 | 37 | ||
21 | struct request_queue; | 38 | struct request_queue; |
@@ -90,7 +107,7 @@ struct io_context { | |||
90 | atomic_t refcount; | 107 | atomic_t refcount; |
91 | struct task_struct *task; | 108 | struct task_struct *task; |
92 | 109 | ||
93 | int (*set_ioprio)(struct io_context *, unsigned int); | 110 | unsigned int ioprio_changed; |
94 | 111 | ||
95 | /* | 112 | /* |
96 | * For request batching | 113 | * For request batching |
@@ -104,8 +121,7 @@ struct io_context { | |||
104 | 121 | ||
105 | void put_io_context(struct io_context *ioc); | 122 | void put_io_context(struct io_context *ioc); |
106 | void exit_io_context(void); | 123 | void exit_io_context(void); |
107 | struct io_context *current_io_context(gfp_t gfp_flags); | 124 | struct io_context *get_io_context(gfp_t gfp_flags, int node); |
108 | struct io_context *get_io_context(gfp_t gfp_flags); | ||
109 | void copy_io_context(struct io_context **pdst, struct io_context **psrc); | 125 | void copy_io_context(struct io_context **pdst, struct io_context **psrc); |
110 | void swap_io_context(struct io_context **ioc1, struct io_context **ioc2); | 126 | void swap_io_context(struct io_context **ioc1, struct io_context **ioc2); |
111 | 127 | ||
@@ -120,6 +136,90 @@ struct request_list { | |||
120 | wait_queue_head_t wait[2]; | 136 | wait_queue_head_t wait[2]; |
121 | }; | 137 | }; |
122 | 138 | ||
139 | /* | ||
140 | * request command types | ||
141 | */ | ||
142 | enum rq_cmd_type_bits { | ||
143 | REQ_TYPE_FS = 1, /* fs request */ | ||
144 | REQ_TYPE_BLOCK_PC, /* scsi command */ | ||
145 | REQ_TYPE_SENSE, /* sense request */ | ||
146 | REQ_TYPE_PM_SUSPEND, /* suspend request */ | ||
147 | REQ_TYPE_PM_RESUME, /* resume request */ | ||
148 | REQ_TYPE_PM_SHUTDOWN, /* shutdown request */ | ||
149 | REQ_TYPE_FLUSH, /* flush request */ | ||
150 | REQ_TYPE_SPECIAL, /* driver defined type */ | ||
151 | REQ_TYPE_LINUX_BLOCK, /* generic block layer message */ | ||
152 | /* | ||
153 | * for ATA/ATAPI devices. this really doesn't belong here, ide should | ||
154 | * use REQ_TYPE_SPECIAL and use rq->cmd[0] with the range of driver | ||
155 | * private REQ_LB opcodes to differentiate what type of request this is | ||
156 | */ | ||
157 | REQ_TYPE_ATA_CMD, | ||
158 | REQ_TYPE_ATA_TASK, | ||
159 | REQ_TYPE_ATA_TASKFILE, | ||
160 | }; | ||
161 | |||
162 | /* | ||
163 | * For request of type REQ_TYPE_LINUX_BLOCK, rq->cmd[0] is the opcode being | ||
164 | * sent down (similar to how REQ_TYPE_BLOCK_PC means that ->cmd[] holds a | ||
165 | * SCSI cdb. | ||
166 | * | ||
167 | * 0x00 -> 0x3f are driver private, to be used for whatever purpose they need, | ||
168 | * typically to differentiate REQ_TYPE_SPECIAL requests. | ||
169 | * | ||
170 | */ | ||
171 | enum { | ||
172 | /* | ||
173 | * just examples for now | ||
174 | */ | ||
175 | REQ_LB_OP_EJECT = 0x40, /* eject request */ | ||
176 | REQ_LB_OP_FLUSH = 0x41, /* flush device */ | ||
177 | }; | ||
178 | |||
179 | /* | ||
180 | * request type modified bits. first three bits match BIO_RW* bits, important | ||
181 | */ | ||
182 | enum rq_flag_bits { | ||
183 | __REQ_RW, /* not set, read. set, write */ | ||
184 | __REQ_FAILFAST, /* no low level driver retries */ | ||
185 | __REQ_SORTED, /* elevator knows about this request */ | ||
186 | __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ | ||
187 | __REQ_HARDBARRIER, /* may not be passed by drive either */ | ||
188 | __REQ_FUA, /* forced unit access */ | ||
189 | __REQ_NOMERGE, /* don't touch this for merging */ | ||
190 | __REQ_STARTED, /* drive already may have started this one */ | ||
191 | __REQ_DONTPREP, /* don't call prep for this one */ | ||
192 | __REQ_QUEUED, /* uses queueing */ | ||
193 | __REQ_ELVPRIV, /* elevator private data attached */ | ||
194 | __REQ_FAILED, /* set if the request failed */ | ||
195 | __REQ_QUIET, /* don't worry about errors */ | ||
196 | __REQ_PREEMPT, /* set for "ide_preempt" requests */ | ||
197 | __REQ_ORDERED_COLOR, /* is before or after barrier */ | ||
198 | __REQ_RW_SYNC, /* request is sync (O_DIRECT) */ | ||
199 | __REQ_ALLOCED, /* request came from our alloc pool */ | ||
200 | __REQ_RW_META, /* metadata io request */ | ||
201 | __REQ_NR_BITS, /* stops here */ | ||
202 | }; | ||
203 | |||
204 | #define REQ_RW (1 << __REQ_RW) | ||
205 | #define REQ_FAILFAST (1 << __REQ_FAILFAST) | ||
206 | #define REQ_SORTED (1 << __REQ_SORTED) | ||
207 | #define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) | ||
208 | #define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER) | ||
209 | #define REQ_FUA (1 << __REQ_FUA) | ||
210 | #define REQ_NOMERGE (1 << __REQ_NOMERGE) | ||
211 | #define REQ_STARTED (1 << __REQ_STARTED) | ||
212 | #define REQ_DONTPREP (1 << __REQ_DONTPREP) | ||
213 | #define REQ_QUEUED (1 << __REQ_QUEUED) | ||
214 | #define REQ_ELVPRIV (1 << __REQ_ELVPRIV) | ||
215 | #define REQ_FAILED (1 << __REQ_FAILED) | ||
216 | #define REQ_QUIET (1 << __REQ_QUIET) | ||
217 | #define REQ_PREEMPT (1 << __REQ_PREEMPT) | ||
218 | #define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR) | ||
219 | #define REQ_RW_SYNC (1 << __REQ_RW_SYNC) | ||
220 | #define REQ_ALLOCED (1 << __REQ_ALLOCED) | ||
221 | #define REQ_RW_META (1 << __REQ_RW_META) | ||
222 | |||
123 | #define BLK_MAX_CDB 16 | 223 | #define BLK_MAX_CDB 16 |
124 | 224 | ||
125 | /* | 225 | /* |
@@ -129,30 +229,46 @@ struct request { | |||
129 | struct list_head queuelist; | 229 | struct list_head queuelist; |
130 | struct list_head donelist; | 230 | struct list_head donelist; |
131 | 231 | ||
132 | unsigned long flags; /* see REQ_ bits below */ | 232 | request_queue_t *q; |
233 | |||
234 | unsigned int cmd_flags; | ||
235 | enum rq_cmd_type_bits cmd_type; | ||
133 | 236 | ||
134 | /* Maintain bio traversal state for part by part I/O submission. | 237 | /* Maintain bio traversal state for part by part I/O submission. |
135 | * hard_* are block layer internals, no driver should touch them! | 238 | * hard_* are block layer internals, no driver should touch them! |
136 | */ | 239 | */ |
137 | 240 | ||
138 | sector_t sector; /* next sector to submit */ | 241 | sector_t sector; /* next sector to submit */ |
242 | sector_t hard_sector; /* next sector to complete */ | ||
139 | unsigned long nr_sectors; /* no. of sectors left to submit */ | 243 | unsigned long nr_sectors; /* no. of sectors left to submit */ |
244 | unsigned long hard_nr_sectors; /* no. of sectors left to complete */ | ||
140 | /* no. of sectors left to submit in the current segment */ | 245 | /* no. of sectors left to submit in the current segment */ |
141 | unsigned int current_nr_sectors; | 246 | unsigned int current_nr_sectors; |
142 | 247 | ||
143 | sector_t hard_sector; /* next sector to complete */ | ||
144 | unsigned long hard_nr_sectors; /* no. of sectors left to complete */ | ||
145 | /* no. of sectors left to complete in the current segment */ | 248 | /* no. of sectors left to complete in the current segment */ |
146 | unsigned int hard_cur_sectors; | 249 | unsigned int hard_cur_sectors; |
147 | 250 | ||
148 | struct bio *bio; | 251 | struct bio *bio; |
149 | struct bio *biotail; | 252 | struct bio *biotail; |
150 | 253 | ||
254 | struct hlist_node hash; /* merge hash */ | ||
255 | /* | ||
256 | * The rb_node is only used inside the io scheduler, requests | ||
257 | * are pruned when moved to the dispatch queue. So let the | ||
258 | * completion_data share space with the rb_node. | ||
259 | */ | ||
260 | union { | ||
261 | struct rb_node rb_node; /* sort/lookup */ | ||
262 | void *completion_data; | ||
263 | }; | ||
264 | |||
265 | /* | ||
266 | * two pointers are available for the IO schedulers, if they need | ||
267 | * more they have to dynamically allocate it. | ||
268 | */ | ||
151 | void *elevator_private; | 269 | void *elevator_private; |
152 | void *completion_data; | 270 | void *elevator_private2; |
153 | 271 | ||
154 | int rq_status; /* should split this into a few status bits */ | ||
155 | int errors; | ||
156 | struct gendisk *rq_disk; | 272 | struct gendisk *rq_disk; |
157 | unsigned long start_time; | 273 | unsigned long start_time; |
158 | 274 | ||
@@ -170,15 +286,13 @@ struct request { | |||
170 | 286 | ||
171 | unsigned short ioprio; | 287 | unsigned short ioprio; |
172 | 288 | ||
289 | void *special; | ||
290 | char *buffer; | ||
291 | |||
173 | int tag; | 292 | int tag; |
293 | int errors; | ||
174 | 294 | ||
175 | int ref_count; | 295 | int ref_count; |
176 | request_queue_t *q; | ||
177 | struct request_list *rl; | ||
178 | |||
179 | struct completion *waiting; | ||
180 | void *special; | ||
181 | char *buffer; | ||
182 | 296 | ||
183 | /* | 297 | /* |
184 | * when request is used as a packet command carrier | 298 | * when request is used as a packet command carrier |
@@ -195,80 +309,14 @@ struct request { | |||
195 | int retries; | 309 | int retries; |
196 | 310 | ||
197 | /* | 311 | /* |
198 | * completion callback. end_io_data should be folded in with waiting | 312 | * completion callback. |
199 | */ | 313 | */ |
200 | rq_end_io_fn *end_io; | 314 | rq_end_io_fn *end_io; |
201 | void *end_io_data; | 315 | void *end_io_data; |
202 | }; | 316 | }; |
203 | 317 | ||
204 | /* | 318 | /* |
205 | * first three bits match BIO_RW* bits, important | 319 | * State information carried for REQ_TYPE_PM_SUSPEND and REQ_TYPE_PM_RESUME |
206 | */ | ||
207 | enum rq_flag_bits { | ||
208 | __REQ_RW, /* not set, read. set, write */ | ||
209 | __REQ_FAILFAST, /* no low level driver retries */ | ||
210 | __REQ_SORTED, /* elevator knows about this request */ | ||
211 | __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ | ||
212 | __REQ_HARDBARRIER, /* may not be passed by drive either */ | ||
213 | __REQ_FUA, /* forced unit access */ | ||
214 | __REQ_CMD, /* is a regular fs rw request */ | ||
215 | __REQ_NOMERGE, /* don't touch this for merging */ | ||
216 | __REQ_STARTED, /* drive already may have started this one */ | ||
217 | __REQ_DONTPREP, /* don't call prep for this one */ | ||
218 | __REQ_QUEUED, /* uses queueing */ | ||
219 | __REQ_ELVPRIV, /* elevator private data attached */ | ||
220 | /* | ||
221 | * for ATA/ATAPI devices | ||
222 | */ | ||
223 | __REQ_PC, /* packet command (special) */ | ||
224 | __REQ_BLOCK_PC, /* queued down pc from block layer */ | ||
225 | __REQ_SENSE, /* sense retrival */ | ||
226 | |||
227 | __REQ_FAILED, /* set if the request failed */ | ||
228 | __REQ_QUIET, /* don't worry about errors */ | ||
229 | __REQ_SPECIAL, /* driver suplied command */ | ||
230 | __REQ_DRIVE_CMD, | ||
231 | __REQ_DRIVE_TASK, | ||
232 | __REQ_DRIVE_TASKFILE, | ||
233 | __REQ_PREEMPT, /* set for "ide_preempt" requests */ | ||
234 | __REQ_PM_SUSPEND, /* suspend request */ | ||
235 | __REQ_PM_RESUME, /* resume request */ | ||
236 | __REQ_PM_SHUTDOWN, /* shutdown request */ | ||
237 | __REQ_ORDERED_COLOR, /* is before or after barrier */ | ||
238 | __REQ_RW_SYNC, /* request is sync (O_DIRECT) */ | ||
239 | __REQ_NR_BITS, /* stops here */ | ||
240 | }; | ||
241 | |||
242 | #define REQ_RW (1 << __REQ_RW) | ||
243 | #define REQ_FAILFAST (1 << __REQ_FAILFAST) | ||
244 | #define REQ_SORTED (1 << __REQ_SORTED) | ||
245 | #define REQ_SOFTBARRIER (1 << __REQ_SOFTBARRIER) | ||
246 | #define REQ_HARDBARRIER (1 << __REQ_HARDBARRIER) | ||
247 | #define REQ_FUA (1 << __REQ_FUA) | ||
248 | #define REQ_CMD (1 << __REQ_CMD) | ||
249 | #define REQ_NOMERGE (1 << __REQ_NOMERGE) | ||
250 | #define REQ_STARTED (1 << __REQ_STARTED) | ||
251 | #define REQ_DONTPREP (1 << __REQ_DONTPREP) | ||
252 | #define REQ_QUEUED (1 << __REQ_QUEUED) | ||
253 | #define REQ_ELVPRIV (1 << __REQ_ELVPRIV) | ||
254 | #define REQ_PC (1 << __REQ_PC) | ||
255 | #define REQ_BLOCK_PC (1 << __REQ_BLOCK_PC) | ||
256 | #define REQ_SENSE (1 << __REQ_SENSE) | ||
257 | #define REQ_FAILED (1 << __REQ_FAILED) | ||
258 | #define REQ_QUIET (1 << __REQ_QUIET) | ||
259 | #define REQ_SPECIAL (1 << __REQ_SPECIAL) | ||
260 | #define REQ_DRIVE_CMD (1 << __REQ_DRIVE_CMD) | ||
261 | #define REQ_DRIVE_TASK (1 << __REQ_DRIVE_TASK) | ||
262 | #define REQ_DRIVE_TASKFILE (1 << __REQ_DRIVE_TASKFILE) | ||
263 | #define REQ_PREEMPT (1 << __REQ_PREEMPT) | ||
264 | #define REQ_PM_SUSPEND (1 << __REQ_PM_SUSPEND) | ||
265 | #define REQ_PM_RESUME (1 << __REQ_PM_RESUME) | ||
266 | #define REQ_PM_SHUTDOWN (1 << __REQ_PM_SHUTDOWN) | ||
267 | #define REQ_ORDERED_COLOR (1 << __REQ_ORDERED_COLOR) | ||
268 | #define REQ_RW_SYNC (1 << __REQ_RW_SYNC) | ||
269 | |||
270 | /* | ||
271 | * State information carried for REQ_PM_SUSPEND and REQ_PM_RESUME | ||
272 | * requests. Some step values could eventually be made generic. | 320 | * requests. Some step values could eventually be made generic. |
273 | */ | 321 | */ |
274 | struct request_pm_state | 322 | struct request_pm_state |
@@ -417,9 +465,9 @@ struct request_queue | |||
417 | unsigned int sg_timeout; | 465 | unsigned int sg_timeout; |
418 | unsigned int sg_reserved_size; | 466 | unsigned int sg_reserved_size; |
419 | int node; | 467 | int node; |
420 | 468 | #ifdef CONFIG_BLK_DEV_IO_TRACE | |
421 | struct blk_trace *blk_trace; | 469 | struct blk_trace *blk_trace; |
422 | 470 | #endif | |
423 | /* | 471 | /* |
424 | * reserved for flush operations | 472 | * reserved for flush operations |
425 | */ | 473 | */ |
@@ -432,9 +480,6 @@ struct request_queue | |||
432 | struct mutex sysfs_lock; | 480 | struct mutex sysfs_lock; |
433 | }; | 481 | }; |
434 | 482 | ||
435 | #define RQ_INACTIVE (-1) | ||
436 | #define RQ_ACTIVE 1 | ||
437 | |||
438 | #define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ | 483 | #define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ |
439 | #define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ | 484 | #define QUEUE_FLAG_QUEUED 1 /* uses generic tag queueing */ |
440 | #define QUEUE_FLAG_STOPPED 2 /* queue is stopped */ | 485 | #define QUEUE_FLAG_STOPPED 2 /* queue is stopped */ |
@@ -490,25 +535,34 @@ enum { | |||
490 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) | 535 | #define blk_queue_stopped(q) test_bit(QUEUE_FLAG_STOPPED, &(q)->queue_flags) |
491 | #define blk_queue_flushing(q) ((q)->ordseq) | 536 | #define blk_queue_flushing(q) ((q)->ordseq) |
492 | 537 | ||
493 | #define blk_fs_request(rq) ((rq)->flags & REQ_CMD) | 538 | #define blk_fs_request(rq) ((rq)->cmd_type == REQ_TYPE_FS) |
494 | #define blk_pc_request(rq) ((rq)->flags & REQ_BLOCK_PC) | 539 | #define blk_pc_request(rq) ((rq)->cmd_type == REQ_TYPE_BLOCK_PC) |
495 | #define blk_noretry_request(rq) ((rq)->flags & REQ_FAILFAST) | 540 | #define blk_special_request(rq) ((rq)->cmd_type == REQ_TYPE_SPECIAL) |
496 | #define blk_rq_started(rq) ((rq)->flags & REQ_STARTED) | 541 | #define blk_sense_request(rq) ((rq)->cmd_type == REQ_TYPE_SENSE) |
542 | |||
543 | #define blk_noretry_request(rq) ((rq)->cmd_flags & REQ_FAILFAST) | ||
544 | #define blk_rq_started(rq) ((rq)->cmd_flags & REQ_STARTED) | ||
497 | 545 | ||
498 | #define blk_account_rq(rq) (blk_rq_started(rq) && blk_fs_request(rq)) | 546 | #define blk_account_rq(rq) (blk_rq_started(rq) && blk_fs_request(rq)) |
499 | 547 | ||
500 | #define blk_pm_suspend_request(rq) ((rq)->flags & REQ_PM_SUSPEND) | 548 | #define blk_pm_suspend_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_SUSPEND) |
501 | #define blk_pm_resume_request(rq) ((rq)->flags & REQ_PM_RESUME) | 549 | #define blk_pm_resume_request(rq) ((rq)->cmd_type == REQ_TYPE_PM_RESUME) |
502 | #define blk_pm_request(rq) \ | 550 | #define blk_pm_request(rq) \ |
503 | ((rq)->flags & (REQ_PM_SUSPEND | REQ_PM_RESUME)) | 551 | (blk_pm_suspend_request(rq) || blk_pm_resume_request(rq)) |
504 | 552 | ||
505 | #define blk_sorted_rq(rq) ((rq)->flags & REQ_SORTED) | 553 | #define blk_sorted_rq(rq) ((rq)->cmd_flags & REQ_SORTED) |
506 | #define blk_barrier_rq(rq) ((rq)->flags & REQ_HARDBARRIER) | 554 | #define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER) |
507 | #define blk_fua_rq(rq) ((rq)->flags & REQ_FUA) | 555 | #define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) |
508 | 556 | ||
509 | #define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist) | 557 | #define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist) |
510 | 558 | ||
511 | #define rq_data_dir(rq) ((rq)->flags & 1) | 559 | #define rq_data_dir(rq) ((rq)->cmd_flags & 1) |
560 | |||
561 | /* | ||
562 | * We regard a request as sync, if it's a READ or a SYNC write. | ||
563 | */ | ||
564 | #define rq_is_sync(rq) (rq_data_dir((rq)) == READ || (rq)->cmd_flags & REQ_RW_SYNC) | ||
565 | #define rq_is_meta(rq) ((rq)->cmd_flags & REQ_RW_META) | ||
512 | 566 | ||
513 | static inline int blk_queue_full(struct request_queue *q, int rw) | 567 | static inline int blk_queue_full(struct request_queue *q, int rw) |
514 | { | 568 | { |
@@ -541,13 +595,7 @@ static inline void blk_clear_queue_full(struct request_queue *q, int rw) | |||
541 | #define RQ_NOMERGE_FLAGS \ | 595 | #define RQ_NOMERGE_FLAGS \ |
542 | (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER) | 596 | (REQ_NOMERGE | REQ_STARTED | REQ_HARDBARRIER | REQ_SOFTBARRIER) |
543 | #define rq_mergeable(rq) \ | 597 | #define rq_mergeable(rq) \ |
544 | (!((rq)->flags & RQ_NOMERGE_FLAGS) && blk_fs_request((rq))) | 598 | (!((rq)->cmd_flags & RQ_NOMERGE_FLAGS) && blk_fs_request((rq))) |
545 | |||
546 | /* | ||
547 | * noop, requests are automagically marked as active/inactive by I/O | ||
548 | * scheduler -- see elv_next_request | ||
549 | */ | ||
550 | #define blk_queue_headactive(q, head_active) | ||
551 | 599 | ||
552 | /* | 600 | /* |
553 | * q->prep_rq_fn return values | 601 | * q->prep_rq_fn return values |
@@ -586,11 +634,6 @@ static inline void blk_queue_bounce(request_queue_t *q, struct bio **bio) | |||
586 | if ((rq->bio)) \ | 634 | if ((rq->bio)) \ |
587 | for (_bio = (rq)->bio; _bio; _bio = _bio->bi_next) | 635 | for (_bio = (rq)->bio; _bio; _bio = _bio->bi_next) |
588 | 636 | ||
589 | struct sec_size { | ||
590 | unsigned block_size; | ||
591 | unsigned block_size_bits; | ||
592 | }; | ||
593 | |||
594 | extern int blk_register_queue(struct gendisk *disk); | 637 | extern int blk_register_queue(struct gendisk *disk); |
595 | extern void blk_unregister_queue(struct gendisk *disk); | 638 | extern void blk_unregister_queue(struct gendisk *disk); |
596 | extern void register_disk(struct gendisk *dev); | 639 | extern void register_disk(struct gendisk *dev); |
@@ -612,6 +655,7 @@ extern void blk_stop_queue(request_queue_t *q); | |||
612 | extern void blk_sync_queue(struct request_queue *q); | 655 | extern void blk_sync_queue(struct request_queue *q); |
613 | extern void __blk_stop_queue(request_queue_t *q); | 656 | extern void __blk_stop_queue(request_queue_t *q); |
614 | extern void blk_run_queue(request_queue_t *); | 657 | extern void blk_run_queue(request_queue_t *); |
658 | extern void blk_start_queueing(request_queue_t *); | ||
615 | extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); | 659 | extern void blk_queue_activity_fn(request_queue_t *, activity_fn *, void *); |
616 | extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int); | 660 | extern int blk_rq_map_user(request_queue_t *, struct request *, void __user *, unsigned int); |
617 | extern int blk_rq_unmap_user(struct bio *, unsigned int); | 661 | extern int blk_rq_unmap_user(struct bio *, unsigned int); |
@@ -655,16 +699,6 @@ extern void end_that_request_last(struct request *, int); | |||
655 | extern void end_request(struct request *req, int uptodate); | 699 | extern void end_request(struct request *req, int uptodate); |
656 | extern void blk_complete_request(struct request *); | 700 | extern void blk_complete_request(struct request *); |
657 | 701 | ||
658 | static inline int rq_all_done(struct request *rq, unsigned int nr_bytes) | ||
659 | { | ||
660 | if (blk_fs_request(rq)) | ||
661 | return (nr_bytes >= (rq->hard_nr_sectors << 9)); | ||
662 | else if (blk_pc_request(rq)) | ||
663 | return nr_bytes >= rq->data_len; | ||
664 | |||
665 | return 0; | ||
666 | } | ||
667 | |||
668 | /* | 702 | /* |
669 | * end_that_request_first/chunk() takes an uptodate argument. we account | 703 | * end_that_request_first/chunk() takes an uptodate argument. we account |
670 | * any value <= as an io error. 0 means -EIO for compatability reasons, | 704 | * any value <= as an io error. 0 means -EIO for compatability reasons, |
@@ -679,21 +713,6 @@ static inline void blkdev_dequeue_request(struct request *req) | |||
679 | } | 713 | } |
680 | 714 | ||
681 | /* | 715 | /* |
682 | * This should be in elevator.h, but that requires pulling in rq and q | ||
683 | */ | ||
684 | static inline void elv_dispatch_add_tail(struct request_queue *q, | ||
685 | struct request *rq) | ||
686 | { | ||
687 | if (q->last_merge == rq) | ||
688 | q->last_merge = NULL; | ||
689 | q->nr_sorted--; | ||
690 | |||
691 | q->end_sector = rq_end_sector(rq); | ||
692 | q->boundary_rq = rq; | ||
693 | list_add_tail(&rq->queuelist, &q->queue_head); | ||
694 | } | ||
695 | |||
696 | /* | ||
697 | * Access functions for manipulating queue properties | 716 | * Access functions for manipulating queue properties |
698 | */ | 717 | */ |
699 | extern request_queue_t *blk_init_queue_node(request_fn_proc *rfn, | 718 | extern request_queue_t *blk_init_queue_node(request_fn_proc *rfn, |
@@ -737,7 +756,7 @@ extern void blk_put_queue(request_queue_t *); | |||
737 | */ | 756 | */ |
738 | #define blk_queue_tag_depth(q) ((q)->queue_tags->busy) | 757 | #define blk_queue_tag_depth(q) ((q)->queue_tags->busy) |
739 | #define blk_queue_tag_queue(q) ((q)->queue_tags->busy < (q)->queue_tags->max_depth) | 758 | #define blk_queue_tag_queue(q) ((q)->queue_tags->busy < (q)->queue_tags->max_depth) |
740 | #define blk_rq_tagged(rq) ((rq)->flags & REQ_QUEUED) | 759 | #define blk_rq_tagged(rq) ((rq)->cmd_flags & REQ_QUEUED) |
741 | extern int blk_queue_start_tag(request_queue_t *, struct request *); | 760 | extern int blk_queue_start_tag(request_queue_t *, struct request *); |
742 | extern struct request *blk_queue_find_tag(request_queue_t *, int); | 761 | extern struct request *blk_queue_find_tag(request_queue_t *, int); |
743 | extern void blk_queue_end_tag(request_queue_t *, struct request *); | 762 | extern void blk_queue_end_tag(request_queue_t *, struct request *); |
@@ -750,6 +769,14 @@ extern struct blk_queue_tag *blk_init_tags(int); | |||
750 | extern void blk_free_tags(struct blk_queue_tag *); | 769 | extern void blk_free_tags(struct blk_queue_tag *); |
751 | extern void blk_congestion_end(int rw); | 770 | extern void blk_congestion_end(int rw); |
752 | 771 | ||
772 | static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt, | ||
773 | int tag) | ||
774 | { | ||
775 | if (unlikely(bqt == NULL || tag >= bqt->real_max_depth)) | ||
776 | return NULL; | ||
777 | return bqt->tag_index[tag]; | ||
778 | } | ||
779 | |||
753 | extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *); | 780 | extern void blk_rq_bio_prep(request_queue_t *, struct request *, struct bio *); |
754 | extern int blkdev_issue_flush(struct block_device *, sector_t *); | 781 | extern int blkdev_issue_flush(struct block_device *, sector_t *); |
755 | 782 | ||
@@ -787,14 +814,6 @@ static inline int queue_dma_alignment(request_queue_t *q) | |||
787 | return retval; | 814 | return retval; |
788 | } | 815 | } |
789 | 816 | ||
790 | static inline int bdev_dma_aligment(struct block_device *bdev) | ||
791 | { | ||
792 | return queue_dma_alignment(bdev_get_queue(bdev)); | ||
793 | } | ||
794 | |||
795 | #define blk_finished_io(nsects) do { } while (0) | ||
796 | #define blk_started_io(nsects) do { } while (0) | ||
797 | |||
798 | /* assumes size > 256 */ | 817 | /* assumes size > 256 */ |
799 | static inline unsigned int blksize_bits(unsigned int size) | 818 | static inline unsigned int blksize_bits(unsigned int size) |
800 | { | 819 | { |
@@ -824,24 +843,32 @@ struct work_struct; | |||
824 | int kblockd_schedule_work(struct work_struct *work); | 843 | int kblockd_schedule_work(struct work_struct *work); |
825 | void kblockd_flush(void); | 844 | void kblockd_flush(void); |
826 | 845 | ||
827 | #ifdef CONFIG_LBD | ||
828 | # include <asm/div64.h> | ||
829 | # define sector_div(a, b) do_div(a, b) | ||
830 | #else | ||
831 | # define sector_div(n, b)( \ | ||
832 | { \ | ||
833 | int _res; \ | ||
834 | _res = (n) % (b); \ | ||
835 | (n) /= (b); \ | ||
836 | _res; \ | ||
837 | } \ | ||
838 | ) | ||
839 | #endif | ||
840 | |||
841 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ | 846 | #define MODULE_ALIAS_BLOCKDEV(major,minor) \ |
842 | MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) | 847 | MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) |
843 | #define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \ | 848 | #define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \ |
844 | MODULE_ALIAS("block-major-" __stringify(major) "-*") | 849 | MODULE_ALIAS("block-major-" __stringify(major) "-*") |
845 | 850 | ||
846 | 851 | ||
852 | #else /* CONFIG_BLOCK */ | ||
853 | /* | ||
854 | * stubs for when the block layer is configured out | ||
855 | */ | ||
856 | #define buffer_heads_over_limit 0 | ||
857 | |||
858 | static inline long blk_congestion_wait(int rw, long timeout) | ||
859 | { | ||
860 | return io_schedule_timeout(timeout); | ||
861 | } | ||
862 | |||
863 | static inline long nr_blockdev_pages(void) | ||
864 | { | ||
865 | return 0; | ||
866 | } | ||
867 | |||
868 | static inline void exit_io_context(void) | ||
869 | { | ||
870 | } | ||
871 | |||
872 | #endif /* CONFIG_BLOCK */ | ||
873 | |||
847 | #endif | 874 | #endif |
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h index 7520cc1ff9e2..b99a714fcac6 100644 --- a/include/linux/blktrace_api.h +++ b/include/linux/blktrace_api.h | |||
@@ -20,6 +20,7 @@ enum blktrace_cat { | |||
20 | BLK_TC_PC = 1 << 9, /* pc requests */ | 20 | BLK_TC_PC = 1 << 9, /* pc requests */ |
21 | BLK_TC_NOTIFY = 1 << 10, /* special message */ | 21 | BLK_TC_NOTIFY = 1 << 10, /* special message */ |
22 | BLK_TC_AHEAD = 1 << 11, /* readahead */ | 22 | BLK_TC_AHEAD = 1 << 11, /* readahead */ |
23 | BLK_TC_META = 1 << 12, /* metadata */ | ||
23 | 24 | ||
24 | BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ | 25 | BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ |
25 | }; | 26 | }; |
@@ -148,7 +149,7 @@ static inline void blk_add_trace_rq(struct request_queue *q, struct request *rq, | |||
148 | u32 what) | 149 | u32 what) |
149 | { | 150 | { |
150 | struct blk_trace *bt = q->blk_trace; | 151 | struct blk_trace *bt = q->blk_trace; |
151 | int rw = rq->flags & 0x03; | 152 | int rw = rq->cmd_flags & 0x03; |
152 | 153 | ||
153 | if (likely(!bt)) | 154 | if (likely(!bt)) |
154 | return; | 155 | return; |
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h index 737e407d0cd1..131ffd37e716 100644 --- a/include/linux/buffer_head.h +++ b/include/linux/buffer_head.h | |||
@@ -14,6 +14,8 @@ | |||
14 | #include <linux/wait.h> | 14 | #include <linux/wait.h> |
15 | #include <asm/atomic.h> | 15 | #include <asm/atomic.h> |
16 | 16 | ||
17 | #ifdef CONFIG_BLOCK | ||
18 | |||
17 | enum bh_state_bits { | 19 | enum bh_state_bits { |
18 | BH_Uptodate, /* Contains valid data */ | 20 | BH_Uptodate, /* Contains valid data */ |
19 | BH_Dirty, /* Is dirty */ | 21 | BH_Dirty, /* Is dirty */ |
@@ -190,9 +192,7 @@ extern int buffer_heads_over_limit; | |||
190 | * Generic address_space_operations implementations for buffer_head-backed | 192 | * Generic address_space_operations implementations for buffer_head-backed |
191 | * address_spaces. | 193 | * address_spaces. |
192 | */ | 194 | */ |
193 | int try_to_release_page(struct page * page, gfp_t gfp_mask); | ||
194 | void block_invalidatepage(struct page *page, unsigned long offset); | 195 | void block_invalidatepage(struct page *page, unsigned long offset); |
195 | void do_invalidatepage(struct page *page, unsigned long offset); | ||
196 | int block_write_full_page(struct page *page, get_block_t *get_block, | 196 | int block_write_full_page(struct page *page, get_block_t *get_block, |
197 | struct writeback_control *wbc); | 197 | struct writeback_control *wbc); |
198 | int block_read_full_page(struct page*, get_block_t*); | 198 | int block_read_full_page(struct page*, get_block_t*); |
@@ -302,4 +302,19 @@ static inline void lock_buffer(struct buffer_head *bh) | |||
302 | __lock_buffer(bh); | 302 | __lock_buffer(bh); |
303 | } | 303 | } |
304 | 304 | ||
305 | extern int __set_page_dirty_buffers(struct page *page); | ||
306 | |||
307 | #else /* CONFIG_BLOCK */ | ||
308 | |||
309 | static inline void buffer_init(void) {} | ||
310 | static inline int try_to_free_buffers(struct page *page) { return 1; } | ||
311 | static inline int sync_blockdev(struct block_device *bdev) { return 0; } | ||
312 | static inline int inode_has_buffers(struct inode *inode) { return 0; } | ||
313 | static inline void invalidate_inode_buffers(struct inode *inode) {} | ||
314 | static inline int remove_inode_buffers(struct inode *inode) { return 1; } | ||
315 | static inline int sync_mapping_buffers(struct address_space *mapping) { return 0; } | ||
316 | static inline void invalidate_bdev(struct block_device *bdev, int destroy_dirty_buffers) {} | ||
317 | |||
318 | |||
319 | #endif /* CONFIG_BLOCK */ | ||
305 | #endif /* _LINUX_BUFFER_HEAD_H */ | 320 | #endif /* _LINUX_BUFFER_HEAD_H */ |
diff --git a/include/linux/cdev.h b/include/linux/cdev.h index 2216638962d2..ee5f53f2ca15 100644 --- a/include/linux/cdev.h +++ b/include/linux/cdev.h | |||
@@ -23,5 +23,7 @@ void cdev_del(struct cdev *); | |||
23 | 23 | ||
24 | void cd_forget(struct inode *); | 24 | void cd_forget(struct inode *); |
25 | 25 | ||
26 | extern struct backing_dev_info directly_mappable_cdev_bdi; | ||
27 | |||
26 | #endif | 28 | #endif |
27 | #endif | 29 | #endif |
diff --git a/include/linux/compat.h b/include/linux/compat.h index 9760753e662b..ef5cd192784c 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -13,6 +13,7 @@ | |||
13 | 13 | ||
14 | #include <asm/compat.h> | 14 | #include <asm/compat.h> |
15 | #include <asm/siginfo.h> | 15 | #include <asm/siginfo.h> |
16 | #include <asm/signal.h> | ||
16 | 17 | ||
17 | #define compat_jiffies_to_clock_t(x) \ | 18 | #define compat_jiffies_to_clock_t(x) \ |
18 | (((unsigned long)(x) * COMPAT_USER_HZ) / HZ) | 19 | (((unsigned long)(x) * COMPAT_USER_HZ) / HZ) |
@@ -227,6 +228,7 @@ static inline int compat_timespec_compare(struct compat_timespec *lhs, | |||
227 | asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); | 228 | asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp); |
228 | 229 | ||
229 | extern int compat_printk(const char *fmt, ...); | 230 | extern int compat_printk(const char *fmt, ...); |
231 | extern void sigset_from_compat(sigset_t *set, compat_sigset_t *compat); | ||
230 | 232 | ||
231 | #endif /* CONFIG_COMPAT */ | 233 | #endif /* CONFIG_COMPAT */ |
232 | #endif /* _LINUX_COMPAT_H */ | 234 | #endif /* _LINUX_COMPAT_H */ |
diff --git a/include/linux/compat_ioctl.h b/include/linux/compat_ioctl.h index bea0255196c4..4e1663d7691e 100644 --- a/include/linux/compat_ioctl.h +++ b/include/linux/compat_ioctl.h | |||
@@ -90,6 +90,7 @@ COMPATIBLE_IOCTL(FDTWADDLE) | |||
90 | COMPATIBLE_IOCTL(FDFMTTRK) | 90 | COMPATIBLE_IOCTL(FDFMTTRK) |
91 | COMPATIBLE_IOCTL(FDRAWCMD) | 91 | COMPATIBLE_IOCTL(FDRAWCMD) |
92 | /* 0x12 */ | 92 | /* 0x12 */ |
93 | #ifdef CONFIG_BLOCK | ||
93 | COMPATIBLE_IOCTL(BLKRASET) | 94 | COMPATIBLE_IOCTL(BLKRASET) |
94 | COMPATIBLE_IOCTL(BLKROSET) | 95 | COMPATIBLE_IOCTL(BLKROSET) |
95 | COMPATIBLE_IOCTL(BLKROGET) | 96 | COMPATIBLE_IOCTL(BLKROGET) |
@@ -103,6 +104,7 @@ COMPATIBLE_IOCTL(BLKTRACESETUP) | |||
103 | COMPATIBLE_IOCTL(BLKTRACETEARDOWN) | 104 | COMPATIBLE_IOCTL(BLKTRACETEARDOWN) |
104 | ULONG_IOCTL(BLKRASET) | 105 | ULONG_IOCTL(BLKRASET) |
105 | ULONG_IOCTL(BLKFRASET) | 106 | ULONG_IOCTL(BLKFRASET) |
107 | #endif | ||
106 | /* RAID */ | 108 | /* RAID */ |
107 | COMPATIBLE_IOCTL(RAID_VERSION) | 109 | COMPATIBLE_IOCTL(RAID_VERSION) |
108 | COMPATIBLE_IOCTL(GET_ARRAY_INFO) | 110 | COMPATIBLE_IOCTL(GET_ARRAY_INFO) |
@@ -120,10 +122,10 @@ COMPATIBLE_IOCTL(PROTECT_ARRAY) | |||
120 | ULONG_IOCTL(HOT_ADD_DISK) | 122 | ULONG_IOCTL(HOT_ADD_DISK) |
121 | ULONG_IOCTL(SET_DISK_FAULTY) | 123 | ULONG_IOCTL(SET_DISK_FAULTY) |
122 | COMPATIBLE_IOCTL(RUN_ARRAY) | 124 | COMPATIBLE_IOCTL(RUN_ARRAY) |
123 | ULONG_IOCTL(START_ARRAY) | ||
124 | COMPATIBLE_IOCTL(STOP_ARRAY) | 125 | COMPATIBLE_IOCTL(STOP_ARRAY) |
125 | COMPATIBLE_IOCTL(STOP_ARRAY_RO) | 126 | COMPATIBLE_IOCTL(STOP_ARRAY_RO) |
126 | COMPATIBLE_IOCTL(RESTART_ARRAY_RW) | 127 | COMPATIBLE_IOCTL(RESTART_ARRAY_RW) |
128 | ULONG_IOCTL(SET_BITMAP_FILE) | ||
127 | /* DM */ | 129 | /* DM */ |
128 | COMPATIBLE_IOCTL(DM_VERSION_32) | 130 | COMPATIBLE_IOCTL(DM_VERSION_32) |
129 | COMPATIBLE_IOCTL(DM_REMOVE_ALL_32) | 131 | COMPATIBLE_IOCTL(DM_REMOVE_ALL_32) |
@@ -395,12 +397,6 @@ COMPATIBLE_IOCTL(DVD_WRITE_STRUCT) | |||
395 | COMPATIBLE_IOCTL(DVD_AUTH) | 397 | COMPATIBLE_IOCTL(DVD_AUTH) |
396 | /* pktcdvd */ | 398 | /* pktcdvd */ |
397 | COMPATIBLE_IOCTL(PACKET_CTRL_CMD) | 399 | COMPATIBLE_IOCTL(PACKET_CTRL_CMD) |
398 | /* Big L */ | ||
399 | ULONG_IOCTL(LOOP_SET_FD) | ||
400 | ULONG_IOCTL(LOOP_CHANGE_FD) | ||
401 | COMPATIBLE_IOCTL(LOOP_CLR_FD) | ||
402 | COMPATIBLE_IOCTL(LOOP_GET_STATUS64) | ||
403 | COMPATIBLE_IOCTL(LOOP_SET_STATUS64) | ||
404 | /* Big A */ | 400 | /* Big A */ |
405 | /* sparc only */ | 401 | /* sparc only */ |
406 | /* Big Q for sound/OSS */ | 402 | /* Big Q for sound/OSS */ |
@@ -573,18 +569,6 @@ COMPATIBLE_IOCTL(RAW_SETBIND) | |||
573 | COMPATIBLE_IOCTL(RAW_GETBIND) | 569 | COMPATIBLE_IOCTL(RAW_GETBIND) |
574 | /* SMB ioctls which do not need any translations */ | 570 | /* SMB ioctls which do not need any translations */ |
575 | COMPATIBLE_IOCTL(SMB_IOC_NEWCONN) | 571 | COMPATIBLE_IOCTL(SMB_IOC_NEWCONN) |
576 | /* NCP ioctls which do not need any translations */ | ||
577 | COMPATIBLE_IOCTL(NCP_IOC_CONN_LOGGED_IN) | ||
578 | COMPATIBLE_IOCTL(NCP_IOC_SIGN_INIT) | ||
579 | COMPATIBLE_IOCTL(NCP_IOC_SIGN_WANTED) | ||
580 | COMPATIBLE_IOCTL(NCP_IOC_SET_SIGN_WANTED) | ||
581 | COMPATIBLE_IOCTL(NCP_IOC_LOCKUNLOCK) | ||
582 | COMPATIBLE_IOCTL(NCP_IOC_GETROOT) | ||
583 | COMPATIBLE_IOCTL(NCP_IOC_SETROOT) | ||
584 | COMPATIBLE_IOCTL(NCP_IOC_GETCHARSETS) | ||
585 | COMPATIBLE_IOCTL(NCP_IOC_SETCHARSETS) | ||
586 | COMPATIBLE_IOCTL(NCP_IOC_GETDENTRYTTL) | ||
587 | COMPATIBLE_IOCTL(NCP_IOC_SETDENTRYTTL) | ||
588 | /* Little a */ | 572 | /* Little a */ |
589 | COMPATIBLE_IOCTL(ATMSIGD_CTRL) | 573 | COMPATIBLE_IOCTL(ATMSIGD_CTRL) |
590 | COMPATIBLE_IOCTL(ATMARPD_CTRL) | 574 | COMPATIBLE_IOCTL(ATMARPD_CTRL) |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 9b4f11094937..538423d4a865 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -10,11 +10,11 @@ | |||
10 | # define __force __attribute__((force)) | 10 | # define __force __attribute__((force)) |
11 | # define __nocast __attribute__((nocast)) | 11 | # define __nocast __attribute__((nocast)) |
12 | # define __iomem __attribute__((noderef, address_space(2))) | 12 | # define __iomem __attribute__((noderef, address_space(2))) |
13 | # define __acquires(x) __attribute__((context(0,1))) | 13 | # define __acquires(x) __attribute__((context(x,0,1))) |
14 | # define __releases(x) __attribute__((context(1,0))) | 14 | # define __releases(x) __attribute__((context(x,1,0))) |
15 | # define __acquire(x) __context__(1) | 15 | # define __acquire(x) __context__(x,1) |
16 | # define __release(x) __context__(-1) | 16 | # define __release(x) __context__(x,-1) |
17 | # define __cond_lock(x) ((x) ? ({ __context__(1); 1; }) : 0) | 17 | # define __cond_lock(x,c) ((c) ? ({ __acquire(x); 1; }) : 0) |
18 | extern void __chk_user_ptr(void __user *); | 18 | extern void __chk_user_ptr(void __user *); |
19 | extern void __chk_io_ptr(void __iomem *); | 19 | extern void __chk_io_ptr(void __iomem *); |
20 | #else | 20 | #else |
@@ -31,7 +31,7 @@ extern void __chk_io_ptr(void __iomem *); | |||
31 | # define __releases(x) | 31 | # define __releases(x) |
32 | # define __acquire(x) (void)0 | 32 | # define __acquire(x) (void)0 |
33 | # define __release(x) (void)0 | 33 | # define __release(x) (void)0 |
34 | # define __cond_lock(x) (x) | 34 | # define __cond_lock(x,c) (c) |
35 | #endif | 35 | #endif |
36 | 36 | ||
37 | #ifdef __KERNEL__ | 37 | #ifdef __KERNEL__ |
@@ -99,6 +99,11 @@ extern void __chk_io_ptr(void __iomem *); | |||
99 | #define __must_check | 99 | #define __must_check |
100 | #endif | 100 | #endif |
101 | 101 | ||
102 | #ifndef CONFIG_ENABLE_MUST_CHECK | ||
103 | #undef __must_check | ||
104 | #define __must_check | ||
105 | #endif | ||
106 | |||
102 | /* | 107 | /* |
103 | * Allow us to avoid 'defined but not used' warnings on functions and data, | 108 | * Allow us to avoid 'defined but not used' warnings on functions and data, |
104 | * as well as force them to be emitted to the assembly file. | 109 | * as well as force them to be emitted to the assembly file. |
diff --git a/include/linux/config.h b/include/linux/config.h index a91f5e55b525..479ffb0a22d8 100644 --- a/include/linux/config.h +++ b/include/linux/config.h | |||
@@ -3,6 +3,7 @@ | |||
3 | /* This file is no longer in use and kept only for backward compatibility. | 3 | /* This file is no longer in use and kept only for backward compatibility. |
4 | * autoconf.h is now included via -imacros on the commandline | 4 | * autoconf.h is now included via -imacros on the commandline |
5 | */ | 5 | */ |
6 | #warning Including config.h is deprecated. | ||
6 | #include <linux/autoconf.h> | 7 | #include <linux/autoconf.h> |
7 | 8 | ||
8 | #endif | 9 | #endif |
diff --git a/include/linux/console.h b/include/linux/console.h index 76a1807726eb..7d0420274de0 100644 --- a/include/linux/console.h +++ b/include/linux/console.h | |||
@@ -129,6 +129,9 @@ static inline void suspend_console(void) {} | |||
129 | static inline void resume_console(void) {} | 129 | static inline void resume_console(void) {} |
130 | #endif /* CONFIG_DISABLE_CONSOLE_SUSPEND */ | 130 | #endif /* CONFIG_DISABLE_CONSOLE_SUSPEND */ |
131 | 131 | ||
132 | int mda_console_init(void); | ||
133 | void prom_con_init(void); | ||
134 | |||
132 | /* Some debug stub to catch some of the obvious races in the VT code */ | 135 | /* Some debug stub to catch some of the obvious races in the VT code */ |
133 | #if 1 | 136 | #if 1 |
134 | #define WARN_CONSOLE_UNLOCKED() WARN_ON(!is_console_locked() && !oops_in_progress) | 137 | #define WARN_CONSOLE_UNLOCKED() WARN_ON(!is_console_locked() && !oops_in_progress) |
diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index 25423f79bf9f..ed6c0fee1ac7 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h | |||
@@ -54,7 +54,7 @@ struct vc_data { | |||
54 | struct tty_struct *vc_tty; /* TTY we are attached to */ | 54 | struct tty_struct *vc_tty; /* TTY we are attached to */ |
55 | /* data for manual vt switching */ | 55 | /* data for manual vt switching */ |
56 | struct vt_mode vt_mode; | 56 | struct vt_mode vt_mode; |
57 | int vt_pid; | 57 | struct pid *vt_pid; |
58 | int vt_newvt; | 58 | int vt_newvt; |
59 | wait_queue_head_t paste_wait; | 59 | wait_queue_head_t paste_wait; |
60 | /* mode flags */ | 60 | /* mode flags */ |
diff --git a/include/linux/consolemap.h b/include/linux/consolemap.h index 65842efc1b70..82c9a1f11020 100644 --- a/include/linux/consolemap.h +++ b/include/linux/consolemap.h | |||
@@ -13,3 +13,4 @@ struct vc_data; | |||
13 | extern unsigned char inverse_translate(struct vc_data *conp, int glyph); | 13 | extern unsigned char inverse_translate(struct vc_data *conp, int glyph); |
14 | extern unsigned short *set_translate(int m, struct vc_data *vc); | 14 | extern unsigned short *set_translate(int m, struct vc_data *vc); |
15 | extern int conv_uni_to_pc(struct vc_data *conp, long ucs); | 15 | extern int conv_uni_to_pc(struct vc_data *conp, long ucs); |
16 | void console_map_init(void); | ||
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h index 9354722a9217..4d8adf663681 100644 --- a/include/linux/cpuset.h +++ b/include/linux/cpuset.h | |||
@@ -63,6 +63,8 @@ static inline int cpuset_do_slab_mem_spread(void) | |||
63 | return current->flags & PF_SPREAD_SLAB; | 63 | return current->flags & PF_SPREAD_SLAB; |
64 | } | 64 | } |
65 | 65 | ||
66 | extern void cpuset_track_online_nodes(void); | ||
67 | |||
66 | #else /* !CONFIG_CPUSETS */ | 68 | #else /* !CONFIG_CPUSETS */ |
67 | 69 | ||
68 | static inline int cpuset_init_early(void) { return 0; } | 70 | static inline int cpuset_init_early(void) { return 0; } |
@@ -126,6 +128,8 @@ static inline int cpuset_do_slab_mem_spread(void) | |||
126 | return 0; | 128 | return 0; |
127 | } | 129 | } |
128 | 130 | ||
131 | static inline void cpuset_track_online_nodes(void) {} | ||
132 | |||
129 | #endif /* !CONFIG_CPUSETS */ | 133 | #endif /* !CONFIG_CPUSETS */ |
130 | 134 | ||
131 | #endif /* _LINUX_CPUSET_H */ | 135 | #endif /* _LINUX_CPUSET_H */ |
diff --git a/include/linux/cramfs_fs.h b/include/linux/cramfs_fs.h index a41f38428c37..1dba681e428d 100644 --- a/include/linux/cramfs_fs.h +++ b/include/linux/cramfs_fs.h | |||
@@ -87,6 +87,6 @@ struct cramfs_super { | |||
87 | /* Uncompression interfaces to the underlying zlib */ | 87 | /* Uncompression interfaces to the underlying zlib */ |
88 | int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen); | 88 | int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen); |
89 | int cramfs_uncompress_init(void); | 89 | int cramfs_uncompress_init(void); |
90 | int cramfs_uncompress_exit(void); | 90 | void cramfs_uncompress_exit(void); |
91 | 91 | ||
92 | #endif | 92 | #endif |
diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h index 88dafa246d87..952bee79a8f3 100644 --- a/include/linux/debug_locks.h +++ b/include/linux/debug_locks.h | |||
@@ -43,6 +43,8 @@ extern int debug_locks_off(void); | |||
43 | # define locking_selftest() do { } while (0) | 43 | # define locking_selftest() do { } while (0) |
44 | #endif | 44 | #endif |
45 | 45 | ||
46 | struct task_struct; | ||
47 | |||
46 | #ifdef CONFIG_LOCKDEP | 48 | #ifdef CONFIG_LOCKDEP |
47 | extern void debug_show_all_locks(void); | 49 | extern void debug_show_all_locks(void); |
48 | extern void debug_show_held_locks(struct task_struct *task); | 50 | extern void debug_show_held_locks(struct task_struct *task); |
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h index e3d1c33d1558..03ef41c1eaac 100644 --- a/include/linux/device-mapper.h +++ b/include/linux/device-mapper.h | |||
@@ -55,8 +55,10 @@ typedef int (*dm_endio_fn) (struct dm_target *ti, | |||
55 | struct bio *bio, int error, | 55 | struct bio *bio, int error, |
56 | union map_info *map_context); | 56 | union map_info *map_context); |
57 | 57 | ||
58 | typedef void (*dm_flush_fn) (struct dm_target *ti); | ||
58 | typedef void (*dm_presuspend_fn) (struct dm_target *ti); | 59 | typedef void (*dm_presuspend_fn) (struct dm_target *ti); |
59 | typedef void (*dm_postsuspend_fn) (struct dm_target *ti); | 60 | typedef void (*dm_postsuspend_fn) (struct dm_target *ti); |
61 | typedef int (*dm_preresume_fn) (struct dm_target *ti); | ||
60 | typedef void (*dm_resume_fn) (struct dm_target *ti); | 62 | typedef void (*dm_resume_fn) (struct dm_target *ti); |
61 | 63 | ||
62 | typedef int (*dm_status_fn) (struct dm_target *ti, status_type_t status_type, | 64 | typedef int (*dm_status_fn) (struct dm_target *ti, status_type_t status_type, |
@@ -64,9 +66,18 @@ typedef int (*dm_status_fn) (struct dm_target *ti, status_type_t status_type, | |||
64 | 66 | ||
65 | typedef int (*dm_message_fn) (struct dm_target *ti, unsigned argc, char **argv); | 67 | typedef int (*dm_message_fn) (struct dm_target *ti, unsigned argc, char **argv); |
66 | 68 | ||
69 | typedef int (*dm_ioctl_fn) (struct dm_target *ti, struct inode *inode, | ||
70 | struct file *filp, unsigned int cmd, | ||
71 | unsigned long arg); | ||
72 | |||
67 | void dm_error(const char *message); | 73 | void dm_error(const char *message); |
68 | 74 | ||
69 | /* | 75 | /* |
76 | * Combine device limits. | ||
77 | */ | ||
78 | void dm_set_device_limits(struct dm_target *ti, struct block_device *bdev); | ||
79 | |||
80 | /* | ||
70 | * Constructors should call these functions to ensure destination devices | 81 | * Constructors should call these functions to ensure destination devices |
71 | * are opened/closed correctly. | 82 | * are opened/closed correctly. |
72 | * FIXME: too many arguments. | 83 | * FIXME: too many arguments. |
@@ -86,11 +97,14 @@ struct target_type { | |||
86 | dm_dtr_fn dtr; | 97 | dm_dtr_fn dtr; |
87 | dm_map_fn map; | 98 | dm_map_fn map; |
88 | dm_endio_fn end_io; | 99 | dm_endio_fn end_io; |
100 | dm_flush_fn flush; | ||
89 | dm_presuspend_fn presuspend; | 101 | dm_presuspend_fn presuspend; |
90 | dm_postsuspend_fn postsuspend; | 102 | dm_postsuspend_fn postsuspend; |
103 | dm_preresume_fn preresume; | ||
91 | dm_resume_fn resume; | 104 | dm_resume_fn resume; |
92 | dm_status_fn status; | 105 | dm_status_fn status; |
93 | dm_message_fn message; | 106 | dm_message_fn message; |
107 | dm_ioctl_fn ioctl; | ||
94 | }; | 108 | }; |
95 | 109 | ||
96 | struct io_restrictions { | 110 | struct io_restrictions { |
diff --git a/include/linux/device.h b/include/linux/device.h index 1e5f30da98bc..662e6a10144e 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/kobject.h> | 15 | #include <linux/kobject.h> |
16 | #include <linux/klist.h> | 16 | #include <linux/klist.h> |
17 | #include <linux/list.h> | 17 | #include <linux/list.h> |
18 | #include <linux/compiler.h> | ||
18 | #include <linux/types.h> | 19 | #include <linux/types.h> |
19 | #include <linux/module.h> | 20 | #include <linux/module.h> |
20 | #include <linux/pm.h> | 21 | #include <linux/pm.h> |
@@ -51,14 +52,17 @@ struct bus_type { | |||
51 | int (*probe)(struct device * dev); | 52 | int (*probe)(struct device * dev); |
52 | int (*remove)(struct device * dev); | 53 | int (*remove)(struct device * dev); |
53 | void (*shutdown)(struct device * dev); | 54 | void (*shutdown)(struct device * dev); |
54 | int (*suspend)(struct device * dev, pm_message_t state); | 55 | |
55 | int (*resume)(struct device * dev); | 56 | int (*suspend)(struct device * dev, pm_message_t state); |
57 | int (*suspend_late)(struct device * dev, pm_message_t state); | ||
58 | int (*resume_early)(struct device * dev); | ||
59 | int (*resume)(struct device * dev); | ||
56 | }; | 60 | }; |
57 | 61 | ||
58 | extern int bus_register(struct bus_type * bus); | 62 | extern int __must_check bus_register(struct bus_type * bus); |
59 | extern void bus_unregister(struct bus_type * bus); | 63 | extern void bus_unregister(struct bus_type * bus); |
60 | 64 | ||
61 | extern void bus_rescan_devices(struct bus_type * bus); | 65 | extern int __must_check bus_rescan_devices(struct bus_type * bus); |
62 | 66 | ||
63 | /* iterator helpers for buses */ | 67 | /* iterator helpers for buses */ |
64 | 68 | ||
@@ -67,9 +71,9 @@ int bus_for_each_dev(struct bus_type * bus, struct device * start, void * data, | |||
67 | struct device * bus_find_device(struct bus_type *bus, struct device *start, | 71 | struct device * bus_find_device(struct bus_type *bus, struct device *start, |
68 | void *data, int (*match)(struct device *, void *)); | 72 | void *data, int (*match)(struct device *, void *)); |
69 | 73 | ||
70 | int bus_for_each_drv(struct bus_type * bus, struct device_driver * start, | 74 | int __must_check bus_for_each_drv(struct bus_type *bus, |
71 | void * data, int (*fn)(struct device_driver *, void *)); | 75 | struct device_driver *start, void *data, |
72 | 76 | int (*fn)(struct device_driver *, void *)); | |
73 | 77 | ||
74 | /* driverfs interface for exporting bus attributes */ | 78 | /* driverfs interface for exporting bus attributes */ |
75 | 79 | ||
@@ -82,7 +86,8 @@ struct bus_attribute { | |||
82 | #define BUS_ATTR(_name,_mode,_show,_store) \ | 86 | #define BUS_ATTR(_name,_mode,_show,_store) \ |
83 | struct bus_attribute bus_attr_##_name = __ATTR(_name,_mode,_show,_store) | 87 | struct bus_attribute bus_attr_##_name = __ATTR(_name,_mode,_show,_store) |
84 | 88 | ||
85 | extern int bus_create_file(struct bus_type *, struct bus_attribute *); | 89 | extern int __must_check bus_create_file(struct bus_type *, |
90 | struct bus_attribute *); | ||
86 | extern void bus_remove_file(struct bus_type *, struct bus_attribute *); | 91 | extern void bus_remove_file(struct bus_type *, struct bus_attribute *); |
87 | 92 | ||
88 | struct device_driver { | 93 | struct device_driver { |
@@ -101,16 +106,18 @@ struct device_driver { | |||
101 | void (*shutdown) (struct device * dev); | 106 | void (*shutdown) (struct device * dev); |
102 | int (*suspend) (struct device * dev, pm_message_t state); | 107 | int (*suspend) (struct device * dev, pm_message_t state); |
103 | int (*resume) (struct device * dev); | 108 | int (*resume) (struct device * dev); |
109 | |||
110 | unsigned int multithread_probe:1; | ||
104 | }; | 111 | }; |
105 | 112 | ||
106 | 113 | ||
107 | extern int driver_register(struct device_driver * drv); | 114 | extern int __must_check driver_register(struct device_driver * drv); |
108 | extern void driver_unregister(struct device_driver * drv); | 115 | extern void driver_unregister(struct device_driver * drv); |
109 | 116 | ||
110 | extern struct device_driver * get_driver(struct device_driver * drv); | 117 | extern struct device_driver * get_driver(struct device_driver * drv); |
111 | extern void put_driver(struct device_driver * drv); | 118 | extern void put_driver(struct device_driver * drv); |
112 | extern struct device_driver *driver_find(const char *name, struct bus_type *bus); | 119 | extern struct device_driver *driver_find(const char *name, struct bus_type *bus); |
113 | 120 | extern int driver_probe_done(void); | |
114 | 121 | ||
115 | /* driverfs interface for exporting driver attributes */ | 122 | /* driverfs interface for exporting driver attributes */ |
116 | 123 | ||
@@ -123,16 +130,17 @@ struct driver_attribute { | |||
123 | #define DRIVER_ATTR(_name,_mode,_show,_store) \ | 130 | #define DRIVER_ATTR(_name,_mode,_show,_store) \ |
124 | struct driver_attribute driver_attr_##_name = __ATTR(_name,_mode,_show,_store) | 131 | struct driver_attribute driver_attr_##_name = __ATTR(_name,_mode,_show,_store) |
125 | 132 | ||
126 | extern int driver_create_file(struct device_driver *, struct driver_attribute *); | 133 | extern int __must_check driver_create_file(struct device_driver *, |
134 | struct driver_attribute *); | ||
127 | extern void driver_remove_file(struct device_driver *, struct driver_attribute *); | 135 | extern void driver_remove_file(struct device_driver *, struct driver_attribute *); |
128 | 136 | ||
129 | extern int driver_for_each_device(struct device_driver * drv, struct device * start, | 137 | extern int __must_check driver_for_each_device(struct device_driver * drv, |
130 | void * data, int (*fn)(struct device *, void *)); | 138 | struct device *start, void *data, |
139 | int (*fn)(struct device *, void *)); | ||
131 | struct device * driver_find_device(struct device_driver *drv, | 140 | struct device * driver_find_device(struct device_driver *drv, |
132 | struct device *start, void *data, | 141 | struct device *start, void *data, |
133 | int (*match)(struct device *, void *)); | 142 | int (*match)(struct device *, void *)); |
134 | 143 | ||
135 | |||
136 | /* | 144 | /* |
137 | * device classes | 145 | * device classes |
138 | */ | 146 | */ |
@@ -146,17 +154,26 @@ struct class { | |||
146 | struct list_head interfaces; | 154 | struct list_head interfaces; |
147 | struct semaphore sem; /* locks both the children and interfaces lists */ | 155 | struct semaphore sem; /* locks both the children and interfaces lists */ |
148 | 156 | ||
157 | struct kobject *virtual_dir; | ||
158 | |||
149 | struct class_attribute * class_attrs; | 159 | struct class_attribute * class_attrs; |
150 | struct class_device_attribute * class_dev_attrs; | 160 | struct class_device_attribute * class_dev_attrs; |
161 | struct device_attribute * dev_attrs; | ||
151 | 162 | ||
152 | int (*uevent)(struct class_device *dev, char **envp, | 163 | int (*uevent)(struct class_device *dev, char **envp, |
153 | int num_envp, char *buffer, int buffer_size); | 164 | int num_envp, char *buffer, int buffer_size); |
165 | int (*dev_uevent)(struct device *dev, char **envp, int num_envp, | ||
166 | char *buffer, int buffer_size); | ||
154 | 167 | ||
155 | void (*release)(struct class_device *dev); | 168 | void (*release)(struct class_device *dev); |
156 | void (*class_release)(struct class *class); | 169 | void (*class_release)(struct class *class); |
170 | void (*dev_release)(struct device *dev); | ||
171 | |||
172 | int (*suspend)(struct device *, pm_message_t state); | ||
173 | int (*resume)(struct device *); | ||
157 | }; | 174 | }; |
158 | 175 | ||
159 | extern int class_register(struct class *); | 176 | extern int __must_check class_register(struct class *); |
160 | extern void class_unregister(struct class *); | 177 | extern void class_unregister(struct class *); |
161 | 178 | ||
162 | 179 | ||
@@ -169,7 +186,8 @@ struct class_attribute { | |||
169 | #define CLASS_ATTR(_name,_mode,_show,_store) \ | 186 | #define CLASS_ATTR(_name,_mode,_show,_store) \ |
170 | struct class_attribute class_attr_##_name = __ATTR(_name,_mode,_show,_store) | 187 | struct class_attribute class_attr_##_name = __ATTR(_name,_mode,_show,_store) |
171 | 188 | ||
172 | extern int class_create_file(struct class *, const struct class_attribute *); | 189 | extern int __must_check class_create_file(struct class *, |
190 | const struct class_attribute *); | ||
173 | extern void class_remove_file(struct class *, const struct class_attribute *); | 191 | extern void class_remove_file(struct class *, const struct class_attribute *); |
174 | 192 | ||
175 | struct class_device_attribute { | 193 | struct class_device_attribute { |
@@ -182,7 +200,7 @@ struct class_device_attribute { | |||
182 | struct class_device_attribute class_device_attr_##_name = \ | 200 | struct class_device_attribute class_device_attr_##_name = \ |
183 | __ATTR(_name,_mode,_show,_store) | 201 | __ATTR(_name,_mode,_show,_store) |
184 | 202 | ||
185 | extern int class_device_create_file(struct class_device *, | 203 | extern int __must_check class_device_create_file(struct class_device *, |
186 | const struct class_device_attribute *); | 204 | const struct class_device_attribute *); |
187 | 205 | ||
188 | /** | 206 | /** |
@@ -242,10 +260,10 @@ class_set_devdata (struct class_device *dev, void *data) | |||
242 | } | 260 | } |
243 | 261 | ||
244 | 262 | ||
245 | extern int class_device_register(struct class_device *); | 263 | extern int __must_check class_device_register(struct class_device *); |
246 | extern void class_device_unregister(struct class_device *); | 264 | extern void class_device_unregister(struct class_device *); |
247 | extern void class_device_initialize(struct class_device *); | 265 | extern void class_device_initialize(struct class_device *); |
248 | extern int class_device_add(struct class_device *); | 266 | extern int __must_check class_device_add(struct class_device *); |
249 | extern void class_device_del(struct class_device *); | 267 | extern void class_device_del(struct class_device *); |
250 | 268 | ||
251 | extern int class_device_rename(struct class_device *, char *); | 269 | extern int class_device_rename(struct class_device *, char *); |
@@ -255,7 +273,7 @@ extern void class_device_put(struct class_device *); | |||
255 | 273 | ||
256 | extern void class_device_remove_file(struct class_device *, | 274 | extern void class_device_remove_file(struct class_device *, |
257 | const struct class_device_attribute *); | 275 | const struct class_device_attribute *); |
258 | extern int class_device_create_bin_file(struct class_device *, | 276 | extern int __must_check class_device_create_bin_file(struct class_device *, |
259 | struct bin_attribute *); | 277 | struct bin_attribute *); |
260 | extern void class_device_remove_bin_file(struct class_device *, | 278 | extern void class_device_remove_bin_file(struct class_device *, |
261 | struct bin_attribute *); | 279 | struct bin_attribute *); |
@@ -266,22 +284,23 @@ struct class_interface { | |||
266 | 284 | ||
267 | int (*add) (struct class_device *, struct class_interface *); | 285 | int (*add) (struct class_device *, struct class_interface *); |
268 | void (*remove) (struct class_device *, struct class_interface *); | 286 | void (*remove) (struct class_device *, struct class_interface *); |
287 | int (*add_dev) (struct device *, struct class_interface *); | ||
288 | void (*remove_dev) (struct device *, struct class_interface *); | ||
269 | }; | 289 | }; |
270 | 290 | ||
271 | extern int class_interface_register(struct class_interface *); | 291 | extern int __must_check class_interface_register(struct class_interface *); |
272 | extern void class_interface_unregister(struct class_interface *); | 292 | extern void class_interface_unregister(struct class_interface *); |
273 | 293 | ||
274 | extern struct class *class_create(struct module *owner, char *name); | 294 | extern struct class *class_create(struct module *owner, const char *name); |
275 | extern void class_destroy(struct class *cls); | 295 | extern void class_destroy(struct class *cls); |
276 | extern struct class_device *class_device_create(struct class *cls, | 296 | extern struct class_device *class_device_create(struct class *cls, |
277 | struct class_device *parent, | 297 | struct class_device *parent, |
278 | dev_t devt, | 298 | dev_t devt, |
279 | struct device *device, | 299 | struct device *device, |
280 | char *fmt, ...) | 300 | const char *fmt, ...) |
281 | __attribute__((format(printf,5,6))); | 301 | __attribute__((format(printf,5,6))); |
282 | extern void class_device_destroy(struct class *cls, dev_t devt); | 302 | extern void class_device_destroy(struct class *cls, dev_t devt); |
283 | 303 | ||
284 | |||
285 | /* interface for exporting device attributes */ | 304 | /* interface for exporting device attributes */ |
286 | struct device_attribute { | 305 | struct device_attribute { |
287 | struct attribute attr; | 306 | struct attribute attr; |
@@ -294,8 +313,13 @@ struct device_attribute { | |||
294 | #define DEVICE_ATTR(_name,_mode,_show,_store) \ | 313 | #define DEVICE_ATTR(_name,_mode,_show,_store) \ |
295 | struct device_attribute dev_attr_##_name = __ATTR(_name,_mode,_show,_store) | 314 | struct device_attribute dev_attr_##_name = __ATTR(_name,_mode,_show,_store) |
296 | 315 | ||
297 | extern int device_create_file(struct device *device, struct device_attribute * entry); | 316 | extern int __must_check device_create_file(struct device *device, |
317 | struct device_attribute * entry); | ||
298 | extern void device_remove_file(struct device * dev, struct device_attribute * attr); | 318 | extern void device_remove_file(struct device * dev, struct device_attribute * attr); |
319 | extern int __must_check device_create_bin_file(struct device *dev, | ||
320 | struct bin_attribute *attr); | ||
321 | extern void device_remove_bin_file(struct device *dev, | ||
322 | struct bin_attribute *attr); | ||
299 | struct device { | 323 | struct device { |
300 | struct klist klist_children; | 324 | struct klist klist_children; |
301 | struct klist_node knode_parent; /* node in sibling list */ | 325 | struct klist_node knode_parent; /* node in sibling list */ |
@@ -305,6 +329,7 @@ struct device { | |||
305 | 329 | ||
306 | struct kobject kobj; | 330 | struct kobject kobj; |
307 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ | 331 | char bus_id[BUS_ID_SIZE]; /* position on parent bus */ |
332 | unsigned is_registered:1; | ||
308 | struct device_attribute uevent_attr; | 333 | struct device_attribute uevent_attr; |
309 | struct device_attribute *devt_attr; | 334 | struct device_attribute *devt_attr; |
310 | 335 | ||
@@ -338,6 +363,7 @@ struct device { | |||
338 | struct list_head node; | 363 | struct list_head node; |
339 | struct class *class; /* optional*/ | 364 | struct class *class; /* optional*/ |
340 | dev_t devt; /* dev_t, creates the sysfs "dev" */ | 365 | dev_t devt; /* dev_t, creates the sysfs "dev" */ |
366 | struct attribute_group **groups; /* optional groups */ | ||
341 | 367 | ||
342 | void (*release)(struct device * dev); | 368 | void (*release)(struct device * dev); |
343 | }; | 369 | }; |
@@ -356,38 +382,41 @@ dev_set_drvdata (struct device *dev, void *data) | |||
356 | 382 | ||
357 | static inline int device_is_registered(struct device *dev) | 383 | static inline int device_is_registered(struct device *dev) |
358 | { | 384 | { |
359 | return klist_node_attached(&dev->knode_bus); | 385 | return dev->is_registered; |
360 | } | 386 | } |
361 | 387 | ||
362 | /* | 388 | /* |
363 | * High level routines for use by the bus drivers | 389 | * High level routines for use by the bus drivers |
364 | */ | 390 | */ |
365 | extern int device_register(struct device * dev); | 391 | extern int __must_check device_register(struct device * dev); |
366 | extern void device_unregister(struct device * dev); | 392 | extern void device_unregister(struct device * dev); |
367 | extern void device_initialize(struct device * dev); | 393 | extern void device_initialize(struct device * dev); |
368 | extern int device_add(struct device * dev); | 394 | extern int __must_check device_add(struct device * dev); |
369 | extern void device_del(struct device * dev); | 395 | extern void device_del(struct device * dev); |
370 | extern int device_for_each_child(struct device *, void *, | 396 | extern int __must_check device_for_each_child(struct device *, void *, |
371 | int (*fn)(struct device *, void *)); | 397 | int (*fn)(struct device *, void *)); |
398 | extern int device_rename(struct device *dev, char *new_name); | ||
372 | 399 | ||
373 | /* | 400 | /* |
374 | * Manual binding of a device to driver. See drivers/base/bus.c | 401 | * Manual binding of a device to driver. See drivers/base/bus.c |
375 | * for information on use. | 402 | * for information on use. |
376 | */ | 403 | */ |
377 | extern void device_bind_driver(struct device * dev); | 404 | extern int __must_check device_bind_driver(struct device *dev); |
378 | extern void device_release_driver(struct device * dev); | 405 | extern void device_release_driver(struct device * dev); |
379 | extern int device_attach(struct device * dev); | 406 | extern int __must_check device_attach(struct device * dev); |
380 | extern void driver_attach(struct device_driver * drv); | 407 | extern int __must_check driver_attach(struct device_driver *drv); |
381 | extern void device_reprobe(struct device *dev); | 408 | extern int __must_check device_reprobe(struct device *dev); |
382 | 409 | ||
383 | /* | 410 | /* |
384 | * Easy functions for dynamically creating devices on the fly | 411 | * Easy functions for dynamically creating devices on the fly |
385 | */ | 412 | */ |
386 | extern struct device *device_create(struct class *cls, struct device *parent, | 413 | extern struct device *device_create(struct class *cls, struct device *parent, |
387 | dev_t devt, char *fmt, ...) | 414 | dev_t devt, const char *fmt, ...) |
388 | __attribute__((format(printf,4,5))); | 415 | __attribute__((format(printf,4,5))); |
389 | extern void device_destroy(struct class *cls, dev_t devt); | 416 | extern void device_destroy(struct class *cls, dev_t devt); |
390 | 417 | ||
418 | extern int virtual_device_parent(struct device *dev); | ||
419 | |||
391 | /* | 420 | /* |
392 | * Platform "fixup" functions - allow the platform to have their say | 421 | * Platform "fixup" functions - allow the platform to have their say |
393 | * about devices and actions that the general device layer doesn't | 422 | * about devices and actions that the general device layer doesn't |
@@ -412,7 +441,7 @@ extern void device_shutdown(void); | |||
412 | 441 | ||
413 | 442 | ||
414 | /* drivers/base/firmware.c */ | 443 | /* drivers/base/firmware.c */ |
415 | extern int firmware_register(struct subsystem *); | 444 | extern int __must_check firmware_register(struct subsystem *); |
416 | extern void firmware_unregister(struct subsystem *); | 445 | extern void firmware_unregister(struct subsystem *); |
417 | 446 | ||
418 | /* debugging and troubleshooting/diagnostic helpers. */ | 447 | /* debugging and troubleshooting/diagnostic helpers. */ |
diff --git a/include/linux/dlm.h b/include/linux/dlm.h new file mode 100644 index 000000000000..1b1dcb9a40bb --- /dev/null +++ b/include/linux/dlm.h | |||
@@ -0,0 +1,302 @@ | |||
1 | /****************************************************************************** | ||
2 | ******************************************************************************* | ||
3 | ** | ||
4 | ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. | ||
5 | ** Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved. | ||
6 | ** | ||
7 | ** This copyrighted material is made available to anyone wishing to use, | ||
8 | ** modify, copy, or redistribute it subject to the terms and conditions | ||
9 | ** of the GNU General Public License v.2. | ||
10 | ** | ||
11 | ******************************************************************************* | ||
12 | ******************************************************************************/ | ||
13 | |||
14 | #ifndef __DLM_DOT_H__ | ||
15 | #define __DLM_DOT_H__ | ||
16 | |||
17 | /* | ||
18 | * Interface to Distributed Lock Manager (DLM) | ||
19 | * routines and structures to use DLM lockspaces | ||
20 | */ | ||
21 | |||
22 | /* | ||
23 | * Lock Modes | ||
24 | */ | ||
25 | |||
26 | #define DLM_LOCK_IV -1 /* invalid */ | ||
27 | #define DLM_LOCK_NL 0 /* null */ | ||
28 | #define DLM_LOCK_CR 1 /* concurrent read */ | ||
29 | #define DLM_LOCK_CW 2 /* concurrent write */ | ||
30 | #define DLM_LOCK_PR 3 /* protected read */ | ||
31 | #define DLM_LOCK_PW 4 /* protected write */ | ||
32 | #define DLM_LOCK_EX 5 /* exclusive */ | ||
33 | |||
34 | /* | ||
35 | * Maximum size in bytes of a dlm_lock name | ||
36 | */ | ||
37 | |||
38 | #define DLM_RESNAME_MAXLEN 64 | ||
39 | |||
40 | /* | ||
41 | * Flags to dlm_lock | ||
42 | * | ||
43 | * DLM_LKF_NOQUEUE | ||
44 | * | ||
45 | * Do not queue the lock request on the wait queue if it cannot be granted | ||
46 | * immediately. If the lock cannot be granted because of this flag, DLM will | ||
47 | * either return -EAGAIN from the dlm_lock call or will return 0 from | ||
48 | * dlm_lock and -EAGAIN in the lock status block when the AST is executed. | ||
49 | * | ||
50 | * DLM_LKF_CANCEL | ||
51 | * | ||
52 | * Used to cancel a pending lock request or conversion. A converting lock is | ||
53 | * returned to its previously granted mode. | ||
54 | * | ||
55 | * DLM_LKF_CONVERT | ||
56 | * | ||
57 | * Indicates a lock conversion request. For conversions the name and namelen | ||
58 | * are ignored and the lock ID in the LKSB is used to identify the lock. | ||
59 | * | ||
60 | * DLM_LKF_VALBLK | ||
61 | * | ||
62 | * Requests DLM to return the current contents of the lock value block in the | ||
63 | * lock status block. When this flag is set in a lock conversion from PW or EX | ||
64 | * modes, DLM assigns the value specified in the lock status block to the lock | ||
65 | * value block of the lock resource. The LVB is a DLM_LVB_LEN size array | ||
66 | * containing application-specific information. | ||
67 | * | ||
68 | * DLM_LKF_QUECVT | ||
69 | * | ||
70 | * Force a conversion request to be queued, even if it is compatible with | ||
71 | * the granted modes of other locks on the same resource. | ||
72 | * | ||
73 | * DLM_LKF_IVVALBLK | ||
74 | * | ||
75 | * Invalidate the lock value block. | ||
76 | * | ||
77 | * DLM_LKF_CONVDEADLK | ||
78 | * | ||
79 | * Allows the dlm to resolve conversion deadlocks internally by demoting the | ||
80 | * granted mode of a converting lock to NL. The DLM_SBF_DEMOTED flag is | ||
81 | * returned for a conversion that's been effected by this. | ||
82 | * | ||
83 | * DLM_LKF_PERSISTENT | ||
84 | * | ||
85 | * Only relevant to locks originating in userspace. A persistent lock will not | ||
86 | * be removed if the process holding the lock exits. | ||
87 | * | ||
88 | * DLM_LKF_NODLKWT | ||
89 | * DLM_LKF_NODLCKBLK | ||
90 | * | ||
91 | * net yet implemented | ||
92 | * | ||
93 | * DLM_LKF_EXPEDITE | ||
94 | * | ||
95 | * Used only with new requests for NL mode locks. Tells the lock manager | ||
96 | * to grant the lock, ignoring other locks in convert and wait queues. | ||
97 | * | ||
98 | * DLM_LKF_NOQUEUEBAST | ||
99 | * | ||
100 | * Send blocking AST's before returning -EAGAIN to the caller. It is only | ||
101 | * used along with the NOQUEUE flag. Blocking AST's are not sent for failed | ||
102 | * NOQUEUE requests otherwise. | ||
103 | * | ||
104 | * DLM_LKF_HEADQUE | ||
105 | * | ||
106 | * Add a lock to the head of the convert or wait queue rather than the tail. | ||
107 | * | ||
108 | * DLM_LKF_NOORDER | ||
109 | * | ||
110 | * Disregard the standard grant order rules and grant a lock as soon as it | ||
111 | * is compatible with other granted locks. | ||
112 | * | ||
113 | * DLM_LKF_ORPHAN | ||
114 | * | ||
115 | * not yet implemented | ||
116 | * | ||
117 | * DLM_LKF_ALTPR | ||
118 | * | ||
119 | * If the requested mode cannot be granted immediately, try to grant the lock | ||
120 | * in PR mode instead. If this alternate mode is granted instead of the | ||
121 | * requested mode, DLM_SBF_ALTMODE is returned in the lksb. | ||
122 | * | ||
123 | * DLM_LKF_ALTCW | ||
124 | * | ||
125 | * The same as ALTPR, but the alternate mode is CW. | ||
126 | * | ||
127 | * DLM_LKF_FORCEUNLOCK | ||
128 | * | ||
129 | * Unlock the lock even if it is converting or waiting or has sublocks. | ||
130 | * Only really for use by the userland device.c code. | ||
131 | * | ||
132 | */ | ||
133 | |||
134 | #define DLM_LKF_NOQUEUE 0x00000001 | ||
135 | #define DLM_LKF_CANCEL 0x00000002 | ||
136 | #define DLM_LKF_CONVERT 0x00000004 | ||
137 | #define DLM_LKF_VALBLK 0x00000008 | ||
138 | #define DLM_LKF_QUECVT 0x00000010 | ||
139 | #define DLM_LKF_IVVALBLK 0x00000020 | ||
140 | #define DLM_LKF_CONVDEADLK 0x00000040 | ||
141 | #define DLM_LKF_PERSISTENT 0x00000080 | ||
142 | #define DLM_LKF_NODLCKWT 0x00000100 | ||
143 | #define DLM_LKF_NODLCKBLK 0x00000200 | ||
144 | #define DLM_LKF_EXPEDITE 0x00000400 | ||
145 | #define DLM_LKF_NOQUEUEBAST 0x00000800 | ||
146 | #define DLM_LKF_HEADQUE 0x00001000 | ||
147 | #define DLM_LKF_NOORDER 0x00002000 | ||
148 | #define DLM_LKF_ORPHAN 0x00004000 | ||
149 | #define DLM_LKF_ALTPR 0x00008000 | ||
150 | #define DLM_LKF_ALTCW 0x00010000 | ||
151 | #define DLM_LKF_FORCEUNLOCK 0x00020000 | ||
152 | |||
153 | /* | ||
154 | * Some return codes that are not in errno.h | ||
155 | */ | ||
156 | |||
157 | #define DLM_ECANCEL 0x10001 | ||
158 | #define DLM_EUNLOCK 0x10002 | ||
159 | |||
160 | typedef void dlm_lockspace_t; | ||
161 | |||
162 | /* | ||
163 | * Lock status block | ||
164 | * | ||
165 | * Use this structure to specify the contents of the lock value block. For a | ||
166 | * conversion request, this structure is used to specify the lock ID of the | ||
167 | * lock. DLM writes the status of the lock request and the lock ID assigned | ||
168 | * to the request in the lock status block. | ||
169 | * | ||
170 | * sb_lkid: the returned lock ID. It is set on new (non-conversion) requests. | ||
171 | * It is available when dlm_lock returns. | ||
172 | * | ||
173 | * sb_lvbptr: saves or returns the contents of the lock's LVB according to rules | ||
174 | * shown for the DLM_LKF_VALBLK flag. | ||
175 | * | ||
176 | * sb_flags: DLM_SBF_DEMOTED is returned if in the process of promoting a lock, | ||
177 | * it was first demoted to NL to avoid conversion deadlock. | ||
178 | * DLM_SBF_VALNOTVALID is returned if the resource's LVB is marked invalid. | ||
179 | * | ||
180 | * sb_status: the returned status of the lock request set prior to AST | ||
181 | * execution. Possible return values: | ||
182 | * | ||
183 | * 0 if lock request was successful | ||
184 | * -EAGAIN if request would block and is flagged DLM_LKF_NOQUEUE | ||
185 | * -ENOMEM if there is no memory to process request | ||
186 | * -EINVAL if there are invalid parameters | ||
187 | * -DLM_EUNLOCK if unlock request was successful | ||
188 | * -DLM_ECANCEL if a cancel completed successfully | ||
189 | */ | ||
190 | |||
191 | #define DLM_SBF_DEMOTED 0x01 | ||
192 | #define DLM_SBF_VALNOTVALID 0x02 | ||
193 | #define DLM_SBF_ALTMODE 0x04 | ||
194 | |||
195 | struct dlm_lksb { | ||
196 | int sb_status; | ||
197 | uint32_t sb_lkid; | ||
198 | char sb_flags; | ||
199 | char * sb_lvbptr; | ||
200 | }; | ||
201 | |||
202 | |||
203 | #ifdef __KERNEL__ | ||
204 | |||
205 | #define DLM_LSFL_NODIR 0x00000001 | ||
206 | |||
207 | /* | ||
208 | * dlm_new_lockspace | ||
209 | * | ||
210 | * Starts a lockspace with the given name. If the named lockspace exists in | ||
211 | * the cluster, the calling node joins it. | ||
212 | */ | ||
213 | |||
214 | int dlm_new_lockspace(char *name, int namelen, dlm_lockspace_t **lockspace, | ||
215 | uint32_t flags, int lvblen); | ||
216 | |||
217 | /* | ||
218 | * dlm_release_lockspace | ||
219 | * | ||
220 | * Stop a lockspace. | ||
221 | */ | ||
222 | |||
223 | int dlm_release_lockspace(dlm_lockspace_t *lockspace, int force); | ||
224 | |||
225 | /* | ||
226 | * dlm_lock | ||
227 | * | ||
228 | * Make an asyncronous request to acquire or convert a lock on a named | ||
229 | * resource. | ||
230 | * | ||
231 | * lockspace: context for the request | ||
232 | * mode: the requested mode of the lock (DLM_LOCK_) | ||
233 | * lksb: lock status block for input and async return values | ||
234 | * flags: input flags (DLM_LKF_) | ||
235 | * name: name of the resource to lock, can be binary | ||
236 | * namelen: the length in bytes of the resource name (MAX_RESNAME_LEN) | ||
237 | * parent: the lock ID of a parent lock or 0 if none | ||
238 | * lockast: function DLM executes when it completes processing the request | ||
239 | * astarg: argument passed to lockast and bast functions | ||
240 | * bast: function DLM executes when this lock later blocks another request | ||
241 | * | ||
242 | * Returns: | ||
243 | * 0 if request is successfully queued for processing | ||
244 | * -EINVAL if any input parameters are invalid | ||
245 | * -EAGAIN if request would block and is flagged DLM_LKF_NOQUEUE | ||
246 | * -ENOMEM if there is no memory to process request | ||
247 | * -ENOTCONN if there is a communication error | ||
248 | * | ||
249 | * If the call to dlm_lock returns an error then the operation has failed and | ||
250 | * the AST routine will not be called. If dlm_lock returns 0 it is still | ||
251 | * possible that the lock operation will fail. The AST routine will be called | ||
252 | * when the locking is complete and the status is returned in the lksb. | ||
253 | * | ||
254 | * If the AST routines or parameter are passed to a conversion operation then | ||
255 | * they will overwrite those values that were passed to a previous dlm_lock | ||
256 | * call. | ||
257 | * | ||
258 | * AST routines should not block (at least not for long), but may make | ||
259 | * any locking calls they please. | ||
260 | */ | ||
261 | |||
262 | int dlm_lock(dlm_lockspace_t *lockspace, | ||
263 | int mode, | ||
264 | struct dlm_lksb *lksb, | ||
265 | uint32_t flags, | ||
266 | void *name, | ||
267 | unsigned int namelen, | ||
268 | uint32_t parent_lkid, | ||
269 | void (*lockast) (void *astarg), | ||
270 | void *astarg, | ||
271 | void (*bast) (void *astarg, int mode)); | ||
272 | |||
273 | /* | ||
274 | * dlm_unlock | ||
275 | * | ||
276 | * Asynchronously release a lock on a resource. The AST routine is called | ||
277 | * when the resource is successfully unlocked. | ||
278 | * | ||
279 | * lockspace: context for the request | ||
280 | * lkid: the lock ID as returned in the lksb | ||
281 | * flags: input flags (DLM_LKF_) | ||
282 | * lksb: if NULL the lksb parameter passed to last lock request is used | ||
283 | * astarg: the arg used with the completion ast for the unlock | ||
284 | * | ||
285 | * Returns: | ||
286 | * 0 if request is successfully queued for processing | ||
287 | * -EINVAL if any input parameters are invalid | ||
288 | * -ENOTEMPTY if the lock still has sublocks | ||
289 | * -EBUSY if the lock is waiting for a remote lock operation | ||
290 | * -ENOTCONN if there is a communication error | ||
291 | */ | ||
292 | |||
293 | int dlm_unlock(dlm_lockspace_t *lockspace, | ||
294 | uint32_t lkid, | ||
295 | uint32_t flags, | ||
296 | struct dlm_lksb *lksb, | ||
297 | void *astarg); | ||
298 | |||
299 | #endif /* __KERNEL__ */ | ||
300 | |||
301 | #endif /* __DLM_DOT_H__ */ | ||
302 | |||
diff --git a/include/linux/dlm_device.h b/include/linux/dlm_device.h new file mode 100644 index 000000000000..2a2dd189b9fd --- /dev/null +++ b/include/linux/dlm_device.h | |||
@@ -0,0 +1,86 @@ | |||
1 | /****************************************************************************** | ||
2 | ******************************************************************************* | ||
3 | ** | ||
4 | ** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. | ||
5 | ** Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved. | ||
6 | ** | ||
7 | ** This copyrighted material is made available to anyone wishing to use, | ||
8 | ** modify, copy, or redistribute it subject to the terms and conditions | ||
9 | ** of the GNU General Public License v.2. | ||
10 | ** | ||
11 | ******************************************************************************* | ||
12 | ******************************************************************************/ | ||
13 | |||
14 | /* This is the device interface for dlm, most users will use a library | ||
15 | * interface. | ||
16 | */ | ||
17 | |||
18 | #define DLM_USER_LVB_LEN 32 | ||
19 | |||
20 | /* Version of the device interface */ | ||
21 | #define DLM_DEVICE_VERSION_MAJOR 5 | ||
22 | #define DLM_DEVICE_VERSION_MINOR 0 | ||
23 | #define DLM_DEVICE_VERSION_PATCH 0 | ||
24 | |||
25 | /* struct passed to the lock write */ | ||
26 | struct dlm_lock_params { | ||
27 | __u8 mode; | ||
28 | __u8 namelen; | ||
29 | __u16 flags; | ||
30 | __u32 lkid; | ||
31 | __u32 parent; | ||
32 | void __user *castparam; | ||
33 | void __user *castaddr; | ||
34 | void __user *bastparam; | ||
35 | void __user *bastaddr; | ||
36 | struct dlm_lksb __user *lksb; | ||
37 | char lvb[DLM_USER_LVB_LEN]; | ||
38 | char name[0]; | ||
39 | }; | ||
40 | |||
41 | struct dlm_lspace_params { | ||
42 | __u32 flags; | ||
43 | __u32 minor; | ||
44 | char name[0]; | ||
45 | }; | ||
46 | |||
47 | struct dlm_write_request { | ||
48 | __u32 version[3]; | ||
49 | __u8 cmd; | ||
50 | __u8 is64bit; | ||
51 | __u8 unused[2]; | ||
52 | |||
53 | union { | ||
54 | struct dlm_lock_params lock; | ||
55 | struct dlm_lspace_params lspace; | ||
56 | } i; | ||
57 | }; | ||
58 | |||
59 | /* struct read from the "device" fd, | ||
60 | consists mainly of userspace pointers for the library to use */ | ||
61 | struct dlm_lock_result { | ||
62 | __u32 length; | ||
63 | void __user * user_astaddr; | ||
64 | void __user * user_astparam; | ||
65 | struct dlm_lksb __user * user_lksb; | ||
66 | struct dlm_lksb lksb; | ||
67 | __u8 bast_mode; | ||
68 | __u8 unused[3]; | ||
69 | /* Offsets may be zero if no data is present */ | ||
70 | __u32 lvb_offset; | ||
71 | }; | ||
72 | |||
73 | /* Commands passed to the device */ | ||
74 | #define DLM_USER_LOCK 1 | ||
75 | #define DLM_USER_UNLOCK 2 | ||
76 | #define DLM_USER_QUERY 3 | ||
77 | #define DLM_USER_CREATE_LOCKSPACE 4 | ||
78 | #define DLM_USER_REMOVE_LOCKSPACE 5 | ||
79 | |||
80 | /* Arbitrary length restriction */ | ||
81 | #define MAX_LS_NAME_LEN 64 | ||
82 | |||
83 | /* Lockspace flags */ | ||
84 | #define DLM_USER_LSFLG_AUTOFREE 1 | ||
85 | #define DLM_USER_LSFLG_FORCEFREE 2 | ||
86 | |||
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h index 9623bb625090..8853fc4d1c5e 100644 --- a/include/linux/dm-ioctl.h +++ b/include/linux/dm-ioctl.h | |||
@@ -285,9 +285,9 @@ typedef char ioctl_struct[308]; | |||
285 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) | 285 | #define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) |
286 | 286 | ||
287 | #define DM_VERSION_MAJOR 4 | 287 | #define DM_VERSION_MAJOR 4 |
288 | #define DM_VERSION_MINOR 7 | 288 | #define DM_VERSION_MINOR 10 |
289 | #define DM_VERSION_PATCHLEVEL 0 | 289 | #define DM_VERSION_PATCHLEVEL 0 |
290 | #define DM_VERSION_EXTRA "-ioctl (2006-06-24)" | 290 | #define DM_VERSION_EXTRA "-ioctl (2006-09-14)" |
291 | 291 | ||
292 | /* Status bits */ | 292 | /* Status bits */ |
293 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ | 293 | #define DM_READONLY_FLAG (1 << 0) /* In/Out */ |
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h index 635690cf3e3d..ff203c465fed 100644 --- a/include/linux/dma-mapping.h +++ b/include/linux/dma-mapping.h | |||
@@ -24,6 +24,13 @@ enum dma_data_direction { | |||
24 | #define DMA_28BIT_MASK 0x000000000fffffffULL | 24 | #define DMA_28BIT_MASK 0x000000000fffffffULL |
25 | #define DMA_24BIT_MASK 0x0000000000ffffffULL | 25 | #define DMA_24BIT_MASK 0x0000000000ffffffULL |
26 | 26 | ||
27 | static inline int valid_dma_direction(int dma_direction) | ||
28 | { | ||
29 | return ((dma_direction == DMA_BIDIRECTIONAL) || | ||
30 | (dma_direction == DMA_TO_DEVICE) || | ||
31 | (dma_direction == DMA_FROM_DEVICE)); | ||
32 | } | ||
33 | |||
27 | #include <asm/dma-mapping.h> | 34 | #include <asm/dma-mapping.h> |
28 | 35 | ||
29 | /* Backwards compat, remove in 2.7.x */ | 36 | /* Backwards compat, remove in 2.7.x */ |
diff --git a/include/linux/dmi.h b/include/linux/dmi.h index b2cd2071d432..38dc403be70b 100644 --- a/include/linux/dmi.h +++ b/include/linux/dmi.h | |||
@@ -27,7 +27,8 @@ enum dmi_device_type { | |||
27 | DMI_DEV_TYPE_ETHERNET, | 27 | DMI_DEV_TYPE_ETHERNET, |
28 | DMI_DEV_TYPE_TOKENRING, | 28 | DMI_DEV_TYPE_TOKENRING, |
29 | DMI_DEV_TYPE_SOUND, | 29 | DMI_DEV_TYPE_SOUND, |
30 | DMI_DEV_TYPE_IPMI = -1 | 30 | DMI_DEV_TYPE_IPMI = -1, |
31 | DMI_DEV_TYPE_OEM_STRING = -2 | ||
31 | }; | 32 | }; |
32 | 33 | ||
33 | struct dmi_header { | 34 | struct dmi_header { |
diff --git a/include/linux/edd.h b/include/linux/edd.h index 162512b886f7..b2b3e68aa512 100644 --- a/include/linux/edd.h +++ b/include/linux/edd.h | |||
@@ -52,6 +52,7 @@ | |||
52 | #define EDD_CL_EQUALS 0x3d646465 /* "edd=" */ | 52 | #define EDD_CL_EQUALS 0x3d646465 /* "edd=" */ |
53 | #define EDD_CL_OFF 0x666f /* "of" for off */ | 53 | #define EDD_CL_OFF 0x666f /* "of" for off */ |
54 | #define EDD_CL_SKIP 0x6b73 /* "sk" for skipmbr */ | 54 | #define EDD_CL_SKIP 0x6b73 /* "sk" for skipmbr */ |
55 | #define EDD_CL_ON 0x6e6f /* "on" for on */ | ||
55 | 56 | ||
56 | #ifndef __ASSEMBLY__ | 57 | #ifndef __ASSEMBLY__ |
57 | 58 | ||
diff --git a/include/linux/eisa.h b/include/linux/eisa.h index 4079242dced8..1ff7c1392525 100644 --- a/include/linux/eisa.h +++ b/include/linux/eisa.h | |||
@@ -3,8 +3,8 @@ | |||
3 | 3 | ||
4 | #include <linux/ioport.h> | 4 | #include <linux/ioport.h> |
5 | #include <linux/device.h> | 5 | #include <linux/device.h> |
6 | #include <linux/mod_devicetable.h> | ||
6 | 7 | ||
7 | #define EISA_SIG_LEN 8 | ||
8 | #define EISA_MAX_SLOTS 8 | 8 | #define EISA_MAX_SLOTS 8 |
9 | 9 | ||
10 | #define EISA_MAX_RESOURCES 4 | 10 | #define EISA_MAX_RESOURCES 4 |
@@ -27,12 +27,6 @@ | |||
27 | #define EISA_CONFIG_ENABLED 1 | 27 | #define EISA_CONFIG_ENABLED 1 |
28 | #define EISA_CONFIG_FORCED 2 | 28 | #define EISA_CONFIG_FORCED 2 |
29 | 29 | ||
30 | /* The EISA signature, in ASCII form, null terminated */ | ||
31 | struct eisa_device_id { | ||
32 | char sig[EISA_SIG_LEN]; | ||
33 | unsigned long driver_data; | ||
34 | }; | ||
35 | |||
36 | /* There is not much we can say about an EISA device, apart from | 30 | /* There is not much we can say about an EISA device, apart from |
37 | * signature, slot number, and base address. dma_mask is set by | 31 | * signature, slot number, and base address. dma_mask is set by |
38 | * default to parent device mask..*/ | 32 | * default to parent device mask..*/ |
diff --git a/include/linux/elevator.h b/include/linux/elevator.h index 1713ace808bf..b3370ef5164d 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h | |||
@@ -1,12 +1,16 @@ | |||
1 | #ifndef _LINUX_ELEVATOR_H | 1 | #ifndef _LINUX_ELEVATOR_H |
2 | #define _LINUX_ELEVATOR_H | 2 | #define _LINUX_ELEVATOR_H |
3 | 3 | ||
4 | #include <linux/percpu.h> | ||
5 | |||
6 | #ifdef CONFIG_BLOCK | ||
7 | |||
4 | typedef int (elevator_merge_fn) (request_queue_t *, struct request **, | 8 | typedef int (elevator_merge_fn) (request_queue_t *, struct request **, |
5 | struct bio *); | 9 | struct bio *); |
6 | 10 | ||
7 | typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struct request *); | 11 | typedef void (elevator_merge_req_fn) (request_queue_t *, struct request *, struct request *); |
8 | 12 | ||
9 | typedef void (elevator_merged_fn) (request_queue_t *, struct request *); | 13 | typedef void (elevator_merged_fn) (request_queue_t *, struct request *, int); |
10 | 14 | ||
11 | typedef int (elevator_dispatch_fn) (request_queue_t *, int); | 15 | typedef int (elevator_dispatch_fn) (request_queue_t *, int); |
12 | 16 | ||
@@ -14,9 +18,9 @@ typedef void (elevator_add_req_fn) (request_queue_t *, struct request *); | |||
14 | typedef int (elevator_queue_empty_fn) (request_queue_t *); | 18 | typedef int (elevator_queue_empty_fn) (request_queue_t *); |
15 | typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *); | 19 | typedef struct request *(elevator_request_list_fn) (request_queue_t *, struct request *); |
16 | typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *); | 20 | typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *); |
17 | typedef int (elevator_may_queue_fn) (request_queue_t *, int, struct bio *); | 21 | typedef int (elevator_may_queue_fn) (request_queue_t *, int); |
18 | 22 | ||
19 | typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, struct bio *, gfp_t); | 23 | typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, gfp_t); |
20 | typedef void (elevator_put_req_fn) (request_queue_t *, struct request *); | 24 | typedef void (elevator_put_req_fn) (request_queue_t *, struct request *); |
21 | typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *); | 25 | typedef void (elevator_activate_req_fn) (request_queue_t *, struct request *); |
22 | typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); | 26 | typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *); |
@@ -82,19 +86,21 @@ struct elevator_queue | |||
82 | struct kobject kobj; | 86 | struct kobject kobj; |
83 | struct elevator_type *elevator_type; | 87 | struct elevator_type *elevator_type; |
84 | struct mutex sysfs_lock; | 88 | struct mutex sysfs_lock; |
89 | struct hlist_head *hash; | ||
85 | }; | 90 | }; |
86 | 91 | ||
87 | /* | 92 | /* |
88 | * block elevator interface | 93 | * block elevator interface |
89 | */ | 94 | */ |
90 | extern void elv_dispatch_sort(request_queue_t *, struct request *); | 95 | extern void elv_dispatch_sort(request_queue_t *, struct request *); |
96 | extern void elv_dispatch_add_tail(request_queue_t *, struct request *); | ||
91 | extern void elv_add_request(request_queue_t *, struct request *, int, int); | 97 | extern void elv_add_request(request_queue_t *, struct request *, int, int); |
92 | extern void __elv_add_request(request_queue_t *, struct request *, int, int); | 98 | extern void __elv_add_request(request_queue_t *, struct request *, int, int); |
93 | extern void elv_insert(request_queue_t *, struct request *, int); | 99 | extern void elv_insert(request_queue_t *, struct request *, int); |
94 | extern int elv_merge(request_queue_t *, struct request **, struct bio *); | 100 | extern int elv_merge(request_queue_t *, struct request **, struct bio *); |
95 | extern void elv_merge_requests(request_queue_t *, struct request *, | 101 | extern void elv_merge_requests(request_queue_t *, struct request *, |
96 | struct request *); | 102 | struct request *); |
97 | extern void elv_merged_request(request_queue_t *, struct request *); | 103 | extern void elv_merged_request(request_queue_t *, struct request *, int); |
98 | extern void elv_dequeue_request(request_queue_t *, struct request *); | 104 | extern void elv_dequeue_request(request_queue_t *, struct request *); |
99 | extern void elv_requeue_request(request_queue_t *, struct request *); | 105 | extern void elv_requeue_request(request_queue_t *, struct request *); |
100 | extern int elv_queue_empty(request_queue_t *); | 106 | extern int elv_queue_empty(request_queue_t *); |
@@ -103,9 +109,9 @@ extern struct request *elv_former_request(request_queue_t *, struct request *); | |||
103 | extern struct request *elv_latter_request(request_queue_t *, struct request *); | 109 | extern struct request *elv_latter_request(request_queue_t *, struct request *); |
104 | extern int elv_register_queue(request_queue_t *q); | 110 | extern int elv_register_queue(request_queue_t *q); |
105 | extern void elv_unregister_queue(request_queue_t *q); | 111 | extern void elv_unregister_queue(request_queue_t *q); |
106 | extern int elv_may_queue(request_queue_t *, int, struct bio *); | 112 | extern int elv_may_queue(request_queue_t *, int); |
107 | extern void elv_completed_request(request_queue_t *, struct request *); | 113 | extern void elv_completed_request(request_queue_t *, struct request *); |
108 | extern int elv_set_request(request_queue_t *, struct request *, struct bio *, gfp_t); | 114 | extern int elv_set_request(request_queue_t *, struct request *, gfp_t); |
109 | extern void elv_put_request(request_queue_t *, struct request *); | 115 | extern void elv_put_request(request_queue_t *, struct request *); |
110 | 116 | ||
111 | /* | 117 | /* |
@@ -125,6 +131,19 @@ extern void elevator_exit(elevator_t *); | |||
125 | extern int elv_rq_merge_ok(struct request *, struct bio *); | 131 | extern int elv_rq_merge_ok(struct request *, struct bio *); |
126 | 132 | ||
127 | /* | 133 | /* |
134 | * Helper functions. | ||
135 | */ | ||
136 | extern struct request *elv_rb_former_request(request_queue_t *, struct request *); | ||
137 | extern struct request *elv_rb_latter_request(request_queue_t *, struct request *); | ||
138 | |||
139 | /* | ||
140 | * rb support functions. | ||
141 | */ | ||
142 | extern struct request *elv_rb_add(struct rb_root *, struct request *); | ||
143 | extern void elv_rb_del(struct rb_root *, struct request *); | ||
144 | extern struct request *elv_rb_find(struct rb_root *, sector_t); | ||
145 | |||
146 | /* | ||
128 | * Return values from elevator merger | 147 | * Return values from elevator merger |
129 | */ | 148 | */ |
130 | #define ELEVATOR_NO_MERGE 0 | 149 | #define ELEVATOR_NO_MERGE 0 |
@@ -149,5 +168,42 @@ enum { | |||
149 | }; | 168 | }; |
150 | 169 | ||
151 | #define rq_end_sector(rq) ((rq)->sector + (rq)->nr_sectors) | 170 | #define rq_end_sector(rq) ((rq)->sector + (rq)->nr_sectors) |
171 | #define rb_entry_rq(node) rb_entry((node), struct request, rb_node) | ||
172 | |||
173 | /* | ||
174 | * Hack to reuse the donelist list_head as the fifo time holder while | ||
175 | * the request is in the io scheduler. Saves an unsigned long in rq. | ||
176 | */ | ||
177 | #define rq_fifo_time(rq) ((unsigned long) (rq)->donelist.next) | ||
178 | #define rq_set_fifo_time(rq,exp) ((rq)->donelist.next = (void *) (exp)) | ||
179 | #define rq_entry_fifo(ptr) list_entry((ptr), struct request, queuelist) | ||
180 | #define rq_fifo_clear(rq) do { \ | ||
181 | list_del_init(&(rq)->queuelist); \ | ||
182 | INIT_LIST_HEAD(&(rq)->donelist); \ | ||
183 | } while (0) | ||
152 | 184 | ||
185 | /* | ||
186 | * io context count accounting | ||
187 | */ | ||
188 | #define elv_ioc_count_mod(name, __val) \ | ||
189 | do { \ | ||
190 | preempt_disable(); \ | ||
191 | __get_cpu_var(name) += (__val); \ | ||
192 | preempt_enable(); \ | ||
193 | } while (0) | ||
194 | |||
195 | #define elv_ioc_count_inc(name) elv_ioc_count_mod(name, 1) | ||
196 | #define elv_ioc_count_dec(name) elv_ioc_count_mod(name, -1) | ||
197 | |||
198 | #define elv_ioc_count_read(name) \ | ||
199 | ({ \ | ||
200 | unsigned long __val = 0; \ | ||
201 | int __cpu; \ | ||
202 | smp_wmb(); \ | ||
203 | for_each_possible_cpu(__cpu) \ | ||
204 | __val += per_cpu(name, __cpu); \ | ||
205 | __val; \ | ||
206 | }) | ||
207 | |||
208 | #endif /* CONFIG_BLOCK */ | ||
153 | #endif | 209 | #endif |
diff --git a/include/linux/err.h b/include/linux/err.h index cd3b367f7445..1ab1d44f8d3b 100644 --- a/include/linux/err.h +++ b/include/linux/err.h | |||
@@ -15,6 +15,8 @@ | |||
15 | */ | 15 | */ |
16 | #define MAX_ERRNO 4095 | 16 | #define MAX_ERRNO 4095 |
17 | 17 | ||
18 | #ifndef __ASSEMBLY__ | ||
19 | |||
18 | #define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO) | 20 | #define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO) |
19 | 21 | ||
20 | static inline void *ERR_PTR(long error) | 22 | static inline void *ERR_PTR(long error) |
@@ -32,4 +34,6 @@ static inline long IS_ERR(const void *ptr) | |||
32 | return IS_ERR_VALUE((unsigned long)ptr); | 34 | return IS_ERR_VALUE((unsigned long)ptr); |
33 | } | 35 | } |
34 | 36 | ||
37 | #endif | ||
38 | |||
35 | #endif /* _LINUX_ERR_H */ | 39 | #endif /* _LINUX_ERR_H */ |
diff --git a/include/linux/errqueue.h b/include/linux/errqueue.h index 408118a07763..92f8d4fab32b 100644 --- a/include/linux/errqueue.h +++ b/include/linux/errqueue.h | |||
@@ -38,7 +38,7 @@ struct sock_exterr_skb | |||
38 | } header; | 38 | } header; |
39 | struct sock_extended_err ee; | 39 | struct sock_extended_err ee; |
40 | u16 addr_offset; | 40 | u16 addr_offset; |
41 | u16 port; | 41 | __be16 port; |
42 | }; | 42 | }; |
43 | 43 | ||
44 | #endif | 44 | #endif |
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h index 33a1aa107329..153d755376a4 100644 --- a/include/linux/ext2_fs.h +++ b/include/linux/ext2_fs.h | |||
@@ -165,41 +165,49 @@ struct ext2_group_desc | |||
165 | #define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1) | 165 | #define EXT2_N_BLOCKS (EXT2_TIND_BLOCK + 1) |
166 | 166 | ||
167 | /* | 167 | /* |
168 | * Inode flags | 168 | * Inode flags (GETFLAGS/SETFLAGS) |
169 | */ | 169 | */ |
170 | #define EXT2_SECRM_FL 0x00000001 /* Secure deletion */ | 170 | #define EXT2_SECRM_FL FS_SECRM_FL /* Secure deletion */ |
171 | #define EXT2_UNRM_FL 0x00000002 /* Undelete */ | 171 | #define EXT2_UNRM_FL FS_UNRM_FL /* Undelete */ |
172 | #define EXT2_COMPR_FL 0x00000004 /* Compress file */ | 172 | #define EXT2_COMPR_FL FS_COMPR_FL /* Compress file */ |
173 | #define EXT2_SYNC_FL 0x00000008 /* Synchronous updates */ | 173 | #define EXT2_SYNC_FL FS_SYNC_FL /* Synchronous updates */ |
174 | #define EXT2_IMMUTABLE_FL 0x00000010 /* Immutable file */ | 174 | #define EXT2_IMMUTABLE_FL FS_IMMUTABLE_FL /* Immutable file */ |
175 | #define EXT2_APPEND_FL 0x00000020 /* writes to file may only append */ | 175 | #define EXT2_APPEND_FL FS_APPEND_FL /* writes to file may only append */ |
176 | #define EXT2_NODUMP_FL 0x00000040 /* do not dump file */ | 176 | #define EXT2_NODUMP_FL FS_NODUMP_FL /* do not dump file */ |
177 | #define EXT2_NOATIME_FL 0x00000080 /* do not update atime */ | 177 | #define EXT2_NOATIME_FL FS_NOATIME_FL /* do not update atime */ |
178 | /* Reserved for compression usage... */ | 178 | /* Reserved for compression usage... */ |
179 | #define EXT2_DIRTY_FL 0x00000100 | 179 | #define EXT2_DIRTY_FL FS_DIRTY_FL |
180 | #define EXT2_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */ | 180 | #define EXT2_COMPRBLK_FL FS_COMPRBLK_FL /* One or more compressed clusters */ |
181 | #define EXT2_NOCOMP_FL 0x00000400 /* Don't compress */ | 181 | #define EXT2_NOCOMP_FL FS_NOCOMP_FL /* Don't compress */ |
182 | #define EXT2_ECOMPR_FL 0x00000800 /* Compression error */ | 182 | #define EXT2_ECOMPR_FL FS_ECOMPR_FL /* Compression error */ |
183 | /* End compression flags --- maybe not all used */ | 183 | /* End compression flags --- maybe not all used */ |
184 | #define EXT2_BTREE_FL 0x00001000 /* btree format dir */ | 184 | #define EXT2_BTREE_FL FS_BTREE_FL /* btree format dir */ |
185 | #define EXT2_INDEX_FL 0x00001000 /* hash-indexed directory */ | 185 | #define EXT2_INDEX_FL FS_INDEX_FL /* hash-indexed directory */ |
186 | #define EXT2_IMAGIC_FL 0x00002000 /* AFS directory */ | 186 | #define EXT2_IMAGIC_FL FS_IMAGIC_FL /* AFS directory */ |
187 | #define EXT2_JOURNAL_DATA_FL 0x00004000 /* Reserved for ext3 */ | 187 | #define EXT2_JOURNAL_DATA_FL FS_JOURNAL_DATA_FL /* Reserved for ext3 */ |
188 | #define EXT2_NOTAIL_FL 0x00008000 /* file tail should not be merged */ | 188 | #define EXT2_NOTAIL_FL FS_NOTAIL_FL /* file tail should not be merged */ |
189 | #define EXT2_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */ | 189 | #define EXT2_DIRSYNC_FL FS_DIRSYNC_FL /* dirsync behaviour (directories only) */ |
190 | #define EXT2_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/ | 190 | #define EXT2_TOPDIR_FL FS_TOPDIR_FL /* Top of directory hierarchies*/ |
191 | #define EXT2_RESERVED_FL 0x80000000 /* reserved for ext2 lib */ | 191 | #define EXT2_RESERVED_FL FS_RESERVED_FL /* reserved for ext2 lib */ |
192 | 192 | ||
193 | #define EXT2_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */ | 193 | #define EXT2_FL_USER_VISIBLE FS_FL_USER_VISIBLE /* User visible flags */ |
194 | #define EXT2_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */ | 194 | #define EXT2_FL_USER_MODIFIABLE FS_FL_USER_MODIFIABLE /* User modifiable flags */ |
195 | 195 | ||
196 | /* | 196 | /* |
197 | * ioctl commands | 197 | * ioctl commands |
198 | */ | 198 | */ |
199 | #define EXT2_IOC_GETFLAGS _IOR('f', 1, long) | 199 | #define EXT2_IOC_GETFLAGS FS_IOC_GETFLAGS |
200 | #define EXT2_IOC_SETFLAGS _IOW('f', 2, long) | 200 | #define EXT2_IOC_SETFLAGS FS_IOC_SETFLAGS |
201 | #define EXT2_IOC_GETVERSION _IOR('v', 1, long) | 201 | #define EXT2_IOC_GETVERSION FS_IOC_GETVERSION |
202 | #define EXT2_IOC_SETVERSION _IOW('v', 2, long) | 202 | #define EXT2_IOC_SETVERSION FS_IOC_SETVERSION |
203 | |||
204 | /* | ||
205 | * ioctl commands in 32 bit emulation | ||
206 | */ | ||
207 | #define EXT2_IOC32_GETFLAGS FS_IOC32_GETFLAGS | ||
208 | #define EXT2_IOC32_SETFLAGS FS_IOC32_SETFLAGS | ||
209 | #define EXT2_IOC32_GETVERSION FS_IOC32_GETVERSION | ||
210 | #define EXT2_IOC32_SETVERSION FS_IOC32_SETVERSION | ||
203 | 211 | ||
204 | /* | 212 | /* |
205 | * Structure of an inode on the disk | 213 | * Structure of an inode on the disk |
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h index 0eed918b3816..11cca1bdc0c7 100644 --- a/include/linux/ext3_fs.h +++ b/include/linux/ext3_fs.h | |||
@@ -216,14 +216,14 @@ struct ext3_new_group_data { | |||
216 | /* | 216 | /* |
217 | * ioctl commands | 217 | * ioctl commands |
218 | */ | 218 | */ |
219 | #define EXT3_IOC_GETFLAGS _IOR('f', 1, long) | 219 | #define EXT3_IOC_GETFLAGS FS_IOC_GETFLAGS |
220 | #define EXT3_IOC_SETFLAGS _IOW('f', 2, long) | 220 | #define EXT3_IOC_SETFLAGS FS_IOC_SETFLAGS |
221 | #define EXT3_IOC_GETVERSION _IOR('f', 3, long) | 221 | #define EXT3_IOC_GETVERSION _IOR('f', 3, long) |
222 | #define EXT3_IOC_SETVERSION _IOW('f', 4, long) | 222 | #define EXT3_IOC_SETVERSION _IOW('f', 4, long) |
223 | #define EXT3_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long) | 223 | #define EXT3_IOC_GROUP_EXTEND _IOW('f', 7, unsigned long) |
224 | #define EXT3_IOC_GROUP_ADD _IOW('f', 8,struct ext3_new_group_input) | 224 | #define EXT3_IOC_GROUP_ADD _IOW('f', 8,struct ext3_new_group_input) |
225 | #define EXT3_IOC_GETVERSION_OLD _IOR('v', 1, long) | 225 | #define EXT3_IOC_GETVERSION_OLD FS_IOC_GETVERSION |
226 | #define EXT3_IOC_SETVERSION_OLD _IOW('v', 2, long) | 226 | #define EXT3_IOC_SETVERSION_OLD FS_IOC_SETVERSION |
227 | #ifdef CONFIG_JBD_DEBUG | 227 | #ifdef CONFIG_JBD_DEBUG |
228 | #define EXT3_IOC_WAIT_FOR_READONLY _IOR('f', 99, long) | 228 | #define EXT3_IOC_WAIT_FOR_READONLY _IOR('f', 99, long) |
229 | #endif | 229 | #endif |
@@ -231,6 +231,23 @@ struct ext3_new_group_data { | |||
231 | #define EXT3_IOC_SETRSVSZ _IOW('f', 6, long) | 231 | #define EXT3_IOC_SETRSVSZ _IOW('f', 6, long) |
232 | 232 | ||
233 | /* | 233 | /* |
234 | * ioctl commands in 32 bit emulation | ||
235 | */ | ||
236 | #define EXT3_IOC32_GETFLAGS FS_IOC32_GETFLAGS | ||
237 | #define EXT3_IOC32_SETFLAGS FS_IOC32_SETFLAGS | ||
238 | #define EXT3_IOC32_GETVERSION _IOR('f', 3, int) | ||
239 | #define EXT3_IOC32_SETVERSION _IOW('f', 4, int) | ||
240 | #define EXT3_IOC32_GETRSVSZ _IOR('f', 5, int) | ||
241 | #define EXT3_IOC32_SETRSVSZ _IOW('f', 6, int) | ||
242 | #define EXT3_IOC32_GROUP_EXTEND _IOW('f', 7, unsigned int) | ||
243 | #ifdef CONFIG_JBD_DEBUG | ||
244 | #define EXT3_IOC32_WAIT_FOR_READONLY _IOR('f', 99, int) | ||
245 | #endif | ||
246 | #define EXT3_IOC32_GETVERSION_OLD FS_IOC32_GETVERSION | ||
247 | #define EXT3_IOC32_SETVERSION_OLD FS_IOC32_SETVERSION | ||
248 | |||
249 | |||
250 | /* | ||
234 | * Mount options | 251 | * Mount options |
235 | */ | 252 | */ |
236 | struct ext3_mount_options { | 253 | struct ext3_mount_options { |
@@ -460,7 +477,7 @@ struct ext3_super_block { | |||
460 | */ | 477 | */ |
461 | __u8 s_prealloc_blocks; /* Nr of blocks to try to preallocate*/ | 478 | __u8 s_prealloc_blocks; /* Nr of blocks to try to preallocate*/ |
462 | __u8 s_prealloc_dir_blocks; /* Nr to preallocate for dirs */ | 479 | __u8 s_prealloc_dir_blocks; /* Nr to preallocate for dirs */ |
463 | __u16 s_reserved_gdt_blocks; /* Per group desc for online growth */ | 480 | __le16 s_reserved_gdt_blocks; /* Per group desc for online growth */ |
464 | /* | 481 | /* |
465 | * Journaling support valid if EXT3_FEATURE_COMPAT_HAS_JOURNAL set. | 482 | * Journaling support valid if EXT3_FEATURE_COMPAT_HAS_JOURNAL set. |
466 | */ | 483 | */ |
@@ -473,7 +490,7 @@ struct ext3_super_block { | |||
473 | __u8 s_reserved_char_pad; | 490 | __u8 s_reserved_char_pad; |
474 | __u16 s_reserved_word_pad; | 491 | __u16 s_reserved_word_pad; |
475 | __le32 s_default_mount_opts; | 492 | __le32 s_default_mount_opts; |
476 | __le32 s_first_meta_bg; /* First metablock block group */ | 493 | __le32 s_first_meta_bg; /* First metablock block group */ |
477 | __u32 s_reserved[190]; /* Padding to the end of the block */ | 494 | __u32 s_reserved[190]; /* Padding to the end of the block */ |
478 | }; | 495 | }; |
479 | 496 | ||
@@ -812,6 +829,7 @@ extern void ext3_set_aops(struct inode *inode); | |||
812 | /* ioctl.c */ | 829 | /* ioctl.c */ |
813 | extern int ext3_ioctl (struct inode *, struct file *, unsigned int, | 830 | extern int ext3_ioctl (struct inode *, struct file *, unsigned int, |
814 | unsigned long); | 831 | unsigned long); |
832 | extern long ext3_compat_ioctl (struct file *, unsigned int, unsigned long); | ||
815 | 833 | ||
816 | /* namei.c */ | 834 | /* namei.c */ |
817 | extern int ext3_orphan_add(handle_t *, struct inode *); | 835 | extern int ext3_orphan_add(handle_t *, struct inode *); |
diff --git a/include/linux/ext3_fs_i.h b/include/linux/ext3_fs_i.h index 2f18b9511f21..4395e5206746 100644 --- a/include/linux/ext3_fs_i.h +++ b/include/linux/ext3_fs_i.h | |||
@@ -35,7 +35,7 @@ struct ext3_reserve_window { | |||
35 | }; | 35 | }; |
36 | 36 | ||
37 | struct ext3_reserve_window_node { | 37 | struct ext3_reserve_window_node { |
38 | struct rb_node rsv_node; | 38 | struct rb_node rsv_node; |
39 | __u32 rsv_goal_size; | 39 | __u32 rsv_goal_size; |
40 | __u32 rsv_alloc_hit; | 40 | __u32 rsv_alloc_hit; |
41 | struct ext3_reserve_window rsv_window; | 41 | struct ext3_reserve_window rsv_window; |
diff --git a/include/linux/ext3_jbd.h b/include/linux/ext3_jbd.h index c8307c02dd07..ce0e6109aff0 100644 --- a/include/linux/ext3_jbd.h +++ b/include/linux/ext3_jbd.h | |||
@@ -23,7 +23,7 @@ | |||
23 | 23 | ||
24 | /* Define the number of blocks we need to account to a transaction to | 24 | /* Define the number of blocks we need to account to a transaction to |
25 | * modify one block of data. | 25 | * modify one block of data. |
26 | * | 26 | * |
27 | * We may have to touch one inode, one bitmap buffer, up to three | 27 | * We may have to touch one inode, one bitmap buffer, up to three |
28 | * indirection blocks, the group and superblock summaries, and the data | 28 | * indirection blocks, the group and superblock summaries, and the data |
29 | * block to complete the transaction. */ | 29 | * block to complete the transaction. */ |
@@ -88,16 +88,16 @@ | |||
88 | #endif | 88 | #endif |
89 | 89 | ||
90 | int | 90 | int |
91 | ext3_mark_iloc_dirty(handle_t *handle, | 91 | ext3_mark_iloc_dirty(handle_t *handle, |
92 | struct inode *inode, | 92 | struct inode *inode, |
93 | struct ext3_iloc *iloc); | 93 | struct ext3_iloc *iloc); |
94 | 94 | ||
95 | /* | 95 | /* |
96 | * On success, We end up with an outstanding reference count against | 96 | * On success, We end up with an outstanding reference count against |
97 | * iloc->bh. This _must_ be cleaned up later. | 97 | * iloc->bh. This _must_ be cleaned up later. |
98 | */ | 98 | */ |
99 | 99 | ||
100 | int ext3_reserve_inode_write(handle_t *handle, struct inode *inode, | 100 | int ext3_reserve_inode_write(handle_t *handle, struct inode *inode, |
101 | struct ext3_iloc *iloc); | 101 | struct ext3_iloc *iloc); |
102 | 102 | ||
103 | int ext3_mark_inode_dirty(handle_t *handle, struct inode *inode); | 103 | int ext3_mark_inode_dirty(handle_t *handle, struct inode *inode); |
diff --git a/include/linux/fb.h b/include/linux/fb.h index 2f335e966011..3e69241e6a81 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _LINUX_FB_H | 2 | #define _LINUX_FB_H |
3 | 3 | ||
4 | #include <asm/types.h> | 4 | #include <asm/types.h> |
5 | #include <linux/i2c.h> | ||
5 | 6 | ||
6 | /* Definitions of frame buffers */ | 7 | /* Definitions of frame buffers */ |
7 | 8 | ||
@@ -775,6 +776,7 @@ struct fb_info { | |||
775 | struct fb_ops *fbops; | 776 | struct fb_ops *fbops; |
776 | struct device *device; | 777 | struct device *device; |
777 | struct class_device *class_device; /* sysfs per device attrs */ | 778 | struct class_device *class_device; /* sysfs per device attrs */ |
779 | int class_flag; /* private sysfs flags */ | ||
778 | #ifdef CONFIG_FB_TILEBLITTING | 780 | #ifdef CONFIG_FB_TILEBLITTING |
779 | struct fb_tile_ops *tileops; /* Tile Blitting */ | 781 | struct fb_tile_ops *tileops; /* Tile Blitting */ |
780 | #endif | 782 | #endif |
@@ -940,6 +942,7 @@ extern void fb_edid_to_monspecs(unsigned char *edid, | |||
940 | struct fb_monspecs *specs); | 942 | struct fb_monspecs *specs); |
941 | extern void fb_destroy_modedb(struct fb_videomode *modedb); | 943 | extern void fb_destroy_modedb(struct fb_videomode *modedb); |
942 | extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb); | 944 | extern int fb_find_mode_cvt(struct fb_videomode *mode, int margins, int rb); |
945 | extern unsigned char *fb_ddc_read(struct i2c_adapter *adapter); | ||
943 | 946 | ||
944 | /* drivers/video/modedb.c */ | 947 | /* drivers/video/modedb.c */ |
945 | #define VESA_MODEDB_SIZE 34 | 948 | #define VESA_MODEDB_SIZE 34 |
diff --git a/include/linux/file.h b/include/linux/file.h index 9f7c2513866f..74183e6f7f45 100644 --- a/include/linux/file.h +++ b/include/linux/file.h | |||
@@ -112,5 +112,6 @@ struct task_struct; | |||
112 | 112 | ||
113 | struct files_struct *get_files_struct(struct task_struct *); | 113 | struct files_struct *get_files_struct(struct task_struct *); |
114 | void FASTCALL(put_files_struct(struct files_struct *fs)); | 114 | void FASTCALL(put_files_struct(struct files_struct *fs)); |
115 | void reset_files_struct(struct task_struct *, struct files_struct *); | ||
115 | 116 | ||
116 | #endif /* __LINUX_FILE_H */ | 117 | #endif /* __LINUX_FILE_H */ |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 1d3e601ece73..34406ed467c3 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -79,8 +79,8 @@ extern int dir_notify_enable; | |||
79 | #define WRITE 1 | 79 | #define WRITE 1 |
80 | #define READA 2 /* read-ahead - don't block if no resources */ | 80 | #define READA 2 /* read-ahead - don't block if no resources */ |
81 | #define SWRITE 3 /* for ll_rw_block() - wait for buffer lock */ | 81 | #define SWRITE 3 /* for ll_rw_block() - wait for buffer lock */ |
82 | #define SPECIAL 4 /* For non-blockdevice requests in request queue */ | ||
83 | #define READ_SYNC (READ | (1 << BIO_RW_SYNC)) | 82 | #define READ_SYNC (READ | (1 << BIO_RW_SYNC)) |
83 | #define READ_META (READ | (1 << BIO_RW_META)) | ||
84 | #define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) | 84 | #define WRITE_SYNC (WRITE | (1 << BIO_RW_SYNC)) |
85 | #define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER)) | 85 | #define WRITE_BARRIER ((1 << BIO_RW) | (1 << BIO_RW_BARRIER)) |
86 | 86 | ||
@@ -217,6 +217,47 @@ extern int dir_notify_enable; | |||
217 | #define FIBMAP _IO(0x00,1) /* bmap access */ | 217 | #define FIBMAP _IO(0x00,1) /* bmap access */ |
218 | #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ | 218 | #define FIGETBSZ _IO(0x00,2) /* get the block size used for bmap */ |
219 | 219 | ||
220 | #define FS_IOC_GETFLAGS _IOR('f', 1, long) | ||
221 | #define FS_IOC_SETFLAGS _IOW('f', 2, long) | ||
222 | #define FS_IOC_GETVERSION _IOR('v', 1, long) | ||
223 | #define FS_IOC_SETVERSION _IOW('v', 2, long) | ||
224 | #define FS_IOC32_GETFLAGS _IOR('f', 1, int) | ||
225 | #define FS_IOC32_SETFLAGS _IOW('f', 2, int) | ||
226 | #define FS_IOC32_GETVERSION _IOR('v', 1, int) | ||
227 | #define FS_IOC32_SETVERSION _IOW('v', 2, int) | ||
228 | |||
229 | /* | ||
230 | * Inode flags (FS_IOC_GETFLAGS / FS_IOC_SETFLAGS) | ||
231 | */ | ||
232 | #define FS_SECRM_FL 0x00000001 /* Secure deletion */ | ||
233 | #define FS_UNRM_FL 0x00000002 /* Undelete */ | ||
234 | #define FS_COMPR_FL 0x00000004 /* Compress file */ | ||
235 | #define FS_SYNC_FL 0x00000008 /* Synchronous updates */ | ||
236 | #define FS_IMMUTABLE_FL 0x00000010 /* Immutable file */ | ||
237 | #define FS_APPEND_FL 0x00000020 /* writes to file may only append */ | ||
238 | #define FS_NODUMP_FL 0x00000040 /* do not dump file */ | ||
239 | #define FS_NOATIME_FL 0x00000080 /* do not update atime */ | ||
240 | /* Reserved for compression usage... */ | ||
241 | #define FS_DIRTY_FL 0x00000100 | ||
242 | #define FS_COMPRBLK_FL 0x00000200 /* One or more compressed clusters */ | ||
243 | #define FS_NOCOMP_FL 0x00000400 /* Don't compress */ | ||
244 | #define FS_ECOMPR_FL 0x00000800 /* Compression error */ | ||
245 | /* End compression flags --- maybe not all used */ | ||
246 | #define FS_BTREE_FL 0x00001000 /* btree format dir */ | ||
247 | #define FS_INDEX_FL 0x00001000 /* hash-indexed directory */ | ||
248 | #define FS_IMAGIC_FL 0x00002000 /* AFS directory */ | ||
249 | #define FS_JOURNAL_DATA_FL 0x00004000 /* Reserved for ext3 */ | ||
250 | #define FS_NOTAIL_FL 0x00008000 /* file tail should not be merged */ | ||
251 | #define FS_DIRSYNC_FL 0x00010000 /* dirsync behaviour (directories only) */ | ||
252 | #define FS_TOPDIR_FL 0x00020000 /* Top of directory hierarchies*/ | ||
253 | #define FS_EXTENT_FL 0x00080000 /* Extents */ | ||
254 | #define FS_DIRECTIO_FL 0x00100000 /* Use direct i/o */ | ||
255 | #define FS_RESERVED_FL 0x80000000 /* reserved for ext2 lib */ | ||
256 | |||
257 | #define FS_FL_USER_VISIBLE 0x0003DFFF /* User visible flags */ | ||
258 | #define FS_FL_USER_MODIFIABLE 0x000380FF /* User modifiable flags */ | ||
259 | |||
260 | |||
220 | #define SYNC_FILE_RANGE_WAIT_BEFORE 1 | 261 | #define SYNC_FILE_RANGE_WAIT_BEFORE 1 |
221 | #define SYNC_FILE_RANGE_WRITE 2 | 262 | #define SYNC_FILE_RANGE_WRITE 2 |
222 | #define SYNC_FILE_RANGE_WAIT_AFTER 4 | 263 | #define SYNC_FILE_RANGE_WAIT_AFTER 4 |
@@ -512,7 +553,6 @@ struct inode { | |||
512 | struct timespec i_mtime; | 553 | struct timespec i_mtime; |
513 | struct timespec i_ctime; | 554 | struct timespec i_ctime; |
514 | unsigned int i_blkbits; | 555 | unsigned int i_blkbits; |
515 | unsigned long i_blksize; | ||
516 | unsigned long i_version; | 556 | unsigned long i_version; |
517 | blkcnt_t i_blocks; | 557 | blkcnt_t i_blocks; |
518 | unsigned short i_bytes; | 558 | unsigned short i_bytes; |
@@ -528,11 +568,12 @@ struct inode { | |||
528 | #ifdef CONFIG_QUOTA | 568 | #ifdef CONFIG_QUOTA |
529 | struct dquot *i_dquot[MAXQUOTAS]; | 569 | struct dquot *i_dquot[MAXQUOTAS]; |
530 | #endif | 570 | #endif |
531 | /* These three should probably be a union */ | ||
532 | struct list_head i_devices; | 571 | struct list_head i_devices; |
533 | struct pipe_inode_info *i_pipe; | 572 | union { |
534 | struct block_device *i_bdev; | 573 | struct pipe_inode_info *i_pipe; |
535 | struct cdev *i_cdev; | 574 | struct block_device *i_bdev; |
575 | struct cdev *i_cdev; | ||
576 | }; | ||
536 | int i_cindex; | 577 | int i_cindex; |
537 | 578 | ||
538 | __u32 i_generation; | 579 | __u32 i_generation; |
@@ -553,10 +594,10 @@ struct inode { | |||
553 | unsigned int i_flags; | 594 | unsigned int i_flags; |
554 | 595 | ||
555 | atomic_t i_writecount; | 596 | atomic_t i_writecount; |
597 | #ifdef CONFIG_SECURITY | ||
556 | void *i_security; | 598 | void *i_security; |
557 | union { | 599 | #endif |
558 | void *generic_ip; | 600 | void *i_private; /* fs or device private pointer */ |
559 | } u; | ||
560 | #ifdef __NEED_I_SIZE_ORDERED | 601 | #ifdef __NEED_I_SIZE_ORDERED |
561 | seqcount_t i_size_seqcount; | 602 | seqcount_t i_size_seqcount; |
562 | #endif | 603 | #endif |
@@ -645,9 +686,9 @@ extern struct block_device *I_BDEV(struct inode *inode); | |||
645 | 686 | ||
646 | struct fown_struct { | 687 | struct fown_struct { |
647 | rwlock_t lock; /* protects pid, uid, euid fields */ | 688 | rwlock_t lock; /* protects pid, uid, euid fields */ |
648 | int pid; /* pid or -pgrp where SIGIO should be sent */ | 689 | struct pid *pid; /* pid or -pgrp where SIGIO should be sent */ |
690 | enum pid_type pid_type; /* Kind of process group SIGIO should be sent to */ | ||
649 | uid_t uid, euid; /* uid/euid of process setting the owner */ | 691 | uid_t uid, euid; /* uid/euid of process setting the owner */ |
650 | void *security; | ||
651 | int signum; /* posix.1b rt signal to be delivered on IO */ | 692 | int signum; /* posix.1b rt signal to be delivered on IO */ |
652 | }; | 693 | }; |
653 | 694 | ||
@@ -690,8 +731,9 @@ struct file { | |||
690 | struct file_ra_state f_ra; | 731 | struct file_ra_state f_ra; |
691 | 732 | ||
692 | unsigned long f_version; | 733 | unsigned long f_version; |
734 | #ifdef CONFIG_SECURITY | ||
693 | void *f_security; | 735 | void *f_security; |
694 | 736 | #endif | |
695 | /* needed for tty driver, and maybe others */ | 737 | /* needed for tty driver, and maybe others */ |
696 | void *private_data; | 738 | void *private_data; |
697 | 739 | ||
@@ -841,8 +883,10 @@ extern void kill_fasync(struct fasync_struct **, int, int); | |||
841 | /* only for net: no internal synchronization */ | 883 | /* only for net: no internal synchronization */ |
842 | extern void __kill_fasync(struct fasync_struct *, int, int); | 884 | extern void __kill_fasync(struct fasync_struct *, int, int); |
843 | 885 | ||
886 | extern int __f_setown(struct file *filp, struct pid *, enum pid_type, int force); | ||
844 | extern int f_setown(struct file *filp, unsigned long arg, int force); | 887 | extern int f_setown(struct file *filp, unsigned long arg, int force); |
845 | extern void f_delown(struct file *filp); | 888 | extern void f_delown(struct file *filp); |
889 | extern pid_t f_getown(struct file *filp); | ||
846 | extern int send_sigurg(struct fown_struct *fown); | 890 | extern int send_sigurg(struct fown_struct *fown); |
847 | 891 | ||
848 | /* | 892 | /* |
@@ -879,7 +923,9 @@ struct super_block { | |||
879 | int s_syncing; | 923 | int s_syncing; |
880 | int s_need_sync_fs; | 924 | int s_need_sync_fs; |
881 | atomic_t s_active; | 925 | atomic_t s_active; |
926 | #ifdef CONFIG_SECURITY | ||
882 | void *s_security; | 927 | void *s_security; |
928 | #endif | ||
883 | struct xattr_handler **s_xattr; | 929 | struct xattr_handler **s_xattr; |
884 | 930 | ||
885 | struct list_head s_inodes; /* all inodes */ | 931 | struct list_head s_inodes; /* all inodes */ |
@@ -1005,7 +1051,7 @@ int generic_osync_inode(struct inode *, struct address_space *, int); | |||
1005 | * This allows the kernel to read directories into kernel space or | 1051 | * This allows the kernel to read directories into kernel space or |
1006 | * to have different dirent layouts depending on the binary type. | 1052 | * to have different dirent layouts depending on the binary type. |
1007 | */ | 1053 | */ |
1008 | typedef int (*filldir_t)(void *, const char *, int, loff_t, ino_t, unsigned); | 1054 | typedef int (*filldir_t)(void *, const char *, int, loff_t, u64, unsigned); |
1009 | 1055 | ||
1010 | struct block_device_operations { | 1056 | struct block_device_operations { |
1011 | int (*open) (struct inode *, struct file *); | 1057 | int (*open) (struct inode *, struct file *); |
@@ -1056,9 +1102,9 @@ struct file_operations { | |||
1056 | struct module *owner; | 1102 | struct module *owner; |
1057 | loff_t (*llseek) (struct file *, loff_t, int); | 1103 | loff_t (*llseek) (struct file *, loff_t, int); |
1058 | ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); | 1104 | ssize_t (*read) (struct file *, char __user *, size_t, loff_t *); |
1059 | ssize_t (*aio_read) (struct kiocb *, char __user *, size_t, loff_t); | ||
1060 | ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); | 1105 | ssize_t (*write) (struct file *, const char __user *, size_t, loff_t *); |
1061 | ssize_t (*aio_write) (struct kiocb *, const char __user *, size_t, loff_t); | 1106 | ssize_t (*aio_read) (struct kiocb *, const struct iovec *, unsigned long, loff_t); |
1107 | ssize_t (*aio_write) (struct kiocb *, const struct iovec *, unsigned long, loff_t); | ||
1062 | int (*readdir) (struct file *, void *, filldir_t); | 1108 | int (*readdir) (struct file *, void *, filldir_t); |
1063 | unsigned int (*poll) (struct file *, struct poll_table_struct *); | 1109 | unsigned int (*poll) (struct file *, struct poll_table_struct *); |
1064 | int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long); | 1110 | int (*ioctl) (struct inode *, struct file *, unsigned int, unsigned long); |
@@ -1072,8 +1118,6 @@ struct file_operations { | |||
1072 | int (*aio_fsync) (struct kiocb *, int datasync); | 1118 | int (*aio_fsync) (struct kiocb *, int datasync); |
1073 | int (*fasync) (int, struct file *, int); | 1119 | int (*fasync) (int, struct file *, int); |
1074 | int (*lock) (struct file *, int, struct file_lock *); | 1120 | int (*lock) (struct file *, int, struct file_lock *); |
1075 | ssize_t (*readv) (struct file *, const struct iovec *, unsigned long, loff_t *); | ||
1076 | ssize_t (*writev) (struct file *, const struct iovec *, unsigned long, loff_t *); | ||
1077 | ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void *); | 1121 | ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void *); |
1078 | ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); | 1122 | ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); |
1079 | unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); | 1123 | unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); |
@@ -1111,6 +1155,11 @@ struct inode_operations { | |||
1111 | 1155 | ||
1112 | struct seq_file; | 1156 | struct seq_file; |
1113 | 1157 | ||
1158 | ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector, | ||
1159 | unsigned long nr_segs, unsigned long fast_segs, | ||
1160 | struct iovec *fast_pointer, | ||
1161 | struct iovec **ret_pointer); | ||
1162 | |||
1114 | extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *); | 1163 | extern ssize_t vfs_read(struct file *, char __user *, size_t, loff_t *); |
1115 | extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *); | 1164 | extern ssize_t vfs_write(struct file *, const char __user *, size_t, loff_t *); |
1116 | extern ssize_t vfs_readv(struct file *, const struct iovec __user *, | 1165 | extern ssize_t vfs_readv(struct file *, const struct iovec __user *, |
@@ -1145,9 +1194,10 @@ struct super_operations { | |||
1145 | 1194 | ||
1146 | int (*show_options)(struct seq_file *, struct vfsmount *); | 1195 | int (*show_options)(struct seq_file *, struct vfsmount *); |
1147 | int (*show_stats)(struct seq_file *, struct vfsmount *); | 1196 | int (*show_stats)(struct seq_file *, struct vfsmount *); |
1148 | 1197 | #ifdef CONFIG_QUOTA | |
1149 | ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); | 1198 | ssize_t (*quota_read)(struct super_block *, int, char *, size_t, loff_t); |
1150 | ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); | 1199 | ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); |
1200 | #endif | ||
1151 | }; | 1201 | }; |
1152 | 1202 | ||
1153 | /* Inode state bits. Protected by inode_lock. */ | 1203 | /* Inode state bits. Protected by inode_lock. */ |
@@ -1174,15 +1224,30 @@ static inline void mark_inode_dirty_sync(struct inode *inode) | |||
1174 | __mark_inode_dirty(inode, I_DIRTY_SYNC); | 1224 | __mark_inode_dirty(inode, I_DIRTY_SYNC); |
1175 | } | 1225 | } |
1176 | 1226 | ||
1177 | static inline void inode_inc_link_count(struct inode *inode) | 1227 | static inline void inc_nlink(struct inode *inode) |
1178 | { | 1228 | { |
1179 | inode->i_nlink++; | 1229 | inode->i_nlink++; |
1230 | } | ||
1231 | |||
1232 | static inline void inode_inc_link_count(struct inode *inode) | ||
1233 | { | ||
1234 | inc_nlink(inode); | ||
1180 | mark_inode_dirty(inode); | 1235 | mark_inode_dirty(inode); |
1181 | } | 1236 | } |
1182 | 1237 | ||
1183 | static inline void inode_dec_link_count(struct inode *inode) | 1238 | static inline void drop_nlink(struct inode *inode) |
1184 | { | 1239 | { |
1185 | inode->i_nlink--; | 1240 | inode->i_nlink--; |
1241 | } | ||
1242 | |||
1243 | static inline void clear_nlink(struct inode *inode) | ||
1244 | { | ||
1245 | inode->i_nlink = 0; | ||
1246 | } | ||
1247 | |||
1248 | static inline void inode_dec_link_count(struct inode *inode) | ||
1249 | { | ||
1250 | drop_nlink(inode); | ||
1186 | mark_inode_dirty(inode); | 1251 | mark_inode_dirty(inode); |
1187 | } | 1252 | } |
1188 | 1253 | ||
@@ -1440,6 +1505,7 @@ extern void __init vfs_caches_init(unsigned long); | |||
1440 | extern void putname(const char *name); | 1505 | extern void putname(const char *name); |
1441 | #endif | 1506 | #endif |
1442 | 1507 | ||
1508 | #ifdef CONFIG_BLOCK | ||
1443 | extern int register_blkdev(unsigned int, const char *); | 1509 | extern int register_blkdev(unsigned int, const char *); |
1444 | extern int unregister_blkdev(unsigned int, const char *); | 1510 | extern int unregister_blkdev(unsigned int, const char *); |
1445 | extern struct block_device *bdget(dev_t); | 1511 | extern struct block_device *bdget(dev_t); |
@@ -1448,13 +1514,20 @@ extern void bd_forget(struct inode *inode); | |||
1448 | extern void bdput(struct block_device *); | 1514 | extern void bdput(struct block_device *); |
1449 | extern struct block_device *open_by_devnum(dev_t, unsigned); | 1515 | extern struct block_device *open_by_devnum(dev_t, unsigned); |
1450 | extern struct block_device *open_partition_by_devnum(dev_t, unsigned); | 1516 | extern struct block_device *open_partition_by_devnum(dev_t, unsigned); |
1451 | extern const struct file_operations def_blk_fops; | ||
1452 | extern const struct address_space_operations def_blk_aops; | 1517 | extern const struct address_space_operations def_blk_aops; |
1518 | #else | ||
1519 | static inline void bd_forget(struct inode *inode) {} | ||
1520 | #endif | ||
1521 | extern const struct file_operations def_blk_fops; | ||
1453 | extern const struct file_operations def_chr_fops; | 1522 | extern const struct file_operations def_chr_fops; |
1454 | extern const struct file_operations bad_sock_fops; | 1523 | extern const struct file_operations bad_sock_fops; |
1455 | extern const struct file_operations def_fifo_fops; | 1524 | extern const struct file_operations def_fifo_fops; |
1525 | #ifdef CONFIG_BLOCK | ||
1456 | extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); | 1526 | extern int ioctl_by_bdev(struct block_device *, unsigned, unsigned long); |
1457 | extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); | 1527 | extern int blkdev_ioctl(struct inode *, struct file *, unsigned, unsigned long); |
1528 | extern int blkdev_driver_ioctl(struct inode *inode, struct file *file, | ||
1529 | struct gendisk *disk, unsigned cmd, | ||
1530 | unsigned long arg); | ||
1458 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); | 1531 | extern long compat_blkdev_ioctl(struct file *, unsigned, unsigned long); |
1459 | extern int blkdev_get(struct block_device *, mode_t, unsigned); | 1532 | extern int blkdev_get(struct block_device *, mode_t, unsigned); |
1460 | extern int blkdev_put(struct block_device *); | 1533 | extern int blkdev_put(struct block_device *); |
@@ -1468,6 +1541,7 @@ extern void bd_release_from_disk(struct block_device *, struct gendisk *); | |||
1468 | #define bd_claim_by_disk(bdev, holder, disk) bd_claim(bdev, holder) | 1541 | #define bd_claim_by_disk(bdev, holder, disk) bd_claim(bdev, holder) |
1469 | #define bd_release_from_disk(bdev, disk) bd_release(bdev) | 1542 | #define bd_release_from_disk(bdev, disk) bd_release(bdev) |
1470 | #endif | 1543 | #endif |
1544 | #endif | ||
1471 | 1545 | ||
1472 | /* fs/char_dev.c */ | 1546 | /* fs/char_dev.c */ |
1473 | #define CHRDEV_MAJOR_HASH_SIZE 255 | 1547 | #define CHRDEV_MAJOR_HASH_SIZE 255 |
@@ -1481,14 +1555,19 @@ extern int chrdev_open(struct inode *, struct file *); | |||
1481 | extern void chrdev_show(struct seq_file *,off_t); | 1555 | extern void chrdev_show(struct seq_file *,off_t); |
1482 | 1556 | ||
1483 | /* fs/block_dev.c */ | 1557 | /* fs/block_dev.c */ |
1484 | #define BLKDEV_MAJOR_HASH_SIZE 255 | ||
1485 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ | 1558 | #define BDEVNAME_SIZE 32 /* Largest string for a blockdev identifier */ |
1559 | |||
1560 | #ifdef CONFIG_BLOCK | ||
1561 | #define BLKDEV_MAJOR_HASH_SIZE 255 | ||
1486 | extern const char *__bdevname(dev_t, char *buffer); | 1562 | extern const char *__bdevname(dev_t, char *buffer); |
1487 | extern const char *bdevname(struct block_device *bdev, char *buffer); | 1563 | extern const char *bdevname(struct block_device *bdev, char *buffer); |
1488 | extern struct block_device *lookup_bdev(const char *); | 1564 | extern struct block_device *lookup_bdev(const char *); |
1489 | extern struct block_device *open_bdev_excl(const char *, int, void *); | 1565 | extern struct block_device *open_bdev_excl(const char *, int, void *); |
1490 | extern void close_bdev_excl(struct block_device *); | 1566 | extern void close_bdev_excl(struct block_device *); |
1491 | extern void blkdev_show(struct seq_file *,off_t); | 1567 | extern void blkdev_show(struct seq_file *,off_t); |
1568 | #else | ||
1569 | #define BLKDEV_MAJOR_HASH_SIZE 0 | ||
1570 | #endif | ||
1492 | 1571 | ||
1493 | extern void init_special_inode(struct inode *, umode_t, dev_t); | 1572 | extern void init_special_inode(struct inode *, umode_t, dev_t); |
1494 | 1573 | ||
@@ -1502,6 +1581,7 @@ extern const struct file_operations rdwr_fifo_fops; | |||
1502 | 1581 | ||
1503 | extern int fs_may_remount_ro(struct super_block *); | 1582 | extern int fs_may_remount_ro(struct super_block *); |
1504 | 1583 | ||
1584 | #ifdef CONFIG_BLOCK | ||
1505 | /* | 1585 | /* |
1506 | * return READ, READA, or WRITE | 1586 | * return READ, READA, or WRITE |
1507 | */ | 1587 | */ |
@@ -1513,9 +1593,10 @@ extern int fs_may_remount_ro(struct super_block *); | |||
1513 | #define bio_data_dir(bio) ((bio)->bi_rw & 1) | 1593 | #define bio_data_dir(bio) ((bio)->bi_rw & 1) |
1514 | 1594 | ||
1515 | extern int check_disk_change(struct block_device *); | 1595 | extern int check_disk_change(struct block_device *); |
1516 | extern int invalidate_inodes(struct super_block *); | ||
1517 | extern int __invalidate_device(struct block_device *); | 1596 | extern int __invalidate_device(struct block_device *); |
1518 | extern int invalidate_partition(struct gendisk *, int); | 1597 | extern int invalidate_partition(struct gendisk *, int); |
1598 | #endif | ||
1599 | extern int invalidate_inodes(struct super_block *); | ||
1519 | unsigned long invalidate_mapping_pages(struct address_space *mapping, | 1600 | unsigned long invalidate_mapping_pages(struct address_space *mapping, |
1520 | pgoff_t start, pgoff_t end); | 1601 | pgoff_t start, pgoff_t end); |
1521 | unsigned long invalidate_inode_pages(struct address_space *mapping); | 1602 | unsigned long invalidate_inode_pages(struct address_space *mapping); |
@@ -1543,11 +1624,14 @@ extern int __filemap_fdatawrite_range(struct address_space *mapping, | |||
1543 | extern long do_fsync(struct file *file, int datasync); | 1624 | extern long do_fsync(struct file *file, int datasync); |
1544 | extern void sync_supers(void); | 1625 | extern void sync_supers(void); |
1545 | extern void sync_filesystems(int wait); | 1626 | extern void sync_filesystems(int wait); |
1627 | extern void __fsync_super(struct super_block *sb); | ||
1546 | extern void emergency_sync(void); | 1628 | extern void emergency_sync(void); |
1547 | extern void emergency_remount(void); | 1629 | extern void emergency_remount(void); |
1548 | extern int do_remount_sb(struct super_block *sb, int flags, | 1630 | extern int do_remount_sb(struct super_block *sb, int flags, |
1549 | void *data, int force); | 1631 | void *data, int force); |
1632 | #ifdef CONFIG_BLOCK | ||
1550 | extern sector_t bmap(struct inode *, sector_t); | 1633 | extern sector_t bmap(struct inode *, sector_t); |
1634 | #endif | ||
1551 | extern int notify_change(struct dentry *, struct iattr *); | 1635 | extern int notify_change(struct dentry *, struct iattr *); |
1552 | extern int permission(struct inode *, int, struct nameidata *); | 1636 | extern int permission(struct inode *, int, struct nameidata *); |
1553 | extern int generic_permission(struct inode *, int, | 1637 | extern int generic_permission(struct inode *, int, |
@@ -1565,6 +1649,9 @@ static inline void allow_write_access(struct file *file) | |||
1565 | atomic_inc(&file->f_dentry->d_inode->i_writecount); | 1649 | atomic_inc(&file->f_dentry->d_inode->i_writecount); |
1566 | } | 1650 | } |
1567 | extern int do_pipe(int *); | 1651 | extern int do_pipe(int *); |
1652 | extern struct file *create_read_pipe(struct file *f); | ||
1653 | extern struct file *create_write_pipe(void); | ||
1654 | extern void free_write_pipe(struct file *); | ||
1568 | 1655 | ||
1569 | extern int open_namei(int dfd, const char *, int, int, struct nameidata *); | 1656 | extern int open_namei(int dfd, const char *, int, int, struct nameidata *); |
1570 | extern int may_open(struct nameidata *, int, int); | 1657 | extern int may_open(struct nameidata *, int, int); |
@@ -1630,9 +1717,11 @@ static inline void insert_inode_hash(struct inode *inode) { | |||
1630 | extern struct file * get_empty_filp(void); | 1717 | extern struct file * get_empty_filp(void); |
1631 | extern void file_move(struct file *f, struct list_head *list); | 1718 | extern void file_move(struct file *f, struct list_head *list); |
1632 | extern void file_kill(struct file *f); | 1719 | extern void file_kill(struct file *f); |
1720 | #ifdef CONFIG_BLOCK | ||
1633 | struct bio; | 1721 | struct bio; |
1634 | extern void submit_bio(int, struct bio *); | 1722 | extern void submit_bio(int, struct bio *); |
1635 | extern int bdev_read_only(struct block_device *); | 1723 | extern int bdev_read_only(struct block_device *); |
1724 | #endif | ||
1636 | extern int set_blocksize(struct block_device *, int); | 1725 | extern int set_blocksize(struct block_device *, int); |
1637 | extern int sb_set_blocksize(struct super_block *, int); | 1726 | extern int sb_set_blocksize(struct super_block *, int); |
1638 | extern int sb_min_blocksize(struct super_block *, int); | 1727 | extern int sb_min_blocksize(struct super_block *, int); |
@@ -1641,22 +1730,17 @@ extern int generic_file_mmap(struct file *, struct vm_area_struct *); | |||
1641 | extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); | 1730 | extern int generic_file_readonly_mmap(struct file *, struct vm_area_struct *); |
1642 | extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); | 1731 | extern int file_read_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); |
1643 | extern int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); | 1732 | extern int file_send_actor(read_descriptor_t * desc, struct page *page, unsigned long offset, unsigned long size); |
1644 | extern ssize_t generic_file_read(struct file *, char __user *, size_t, loff_t *); | ||
1645 | int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); | 1733 | int generic_write_checks(struct file *file, loff_t *pos, size_t *count, int isblk); |
1646 | extern ssize_t generic_file_write(struct file *, const char __user *, size_t, loff_t *); | 1734 | extern ssize_t generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t); |
1647 | extern ssize_t generic_file_aio_read(struct kiocb *, char __user *, size_t, loff_t); | 1735 | extern ssize_t generic_file_aio_write(struct kiocb *, const struct iovec *, unsigned long, loff_t); |
1648 | extern ssize_t __generic_file_aio_read(struct kiocb *, const struct iovec *, unsigned long, loff_t *); | ||
1649 | extern ssize_t generic_file_aio_write(struct kiocb *, const char __user *, size_t, loff_t); | ||
1650 | extern ssize_t generic_file_aio_write_nolock(struct kiocb *, const struct iovec *, | 1736 | extern ssize_t generic_file_aio_write_nolock(struct kiocb *, const struct iovec *, |
1651 | unsigned long, loff_t *); | 1737 | unsigned long, loff_t); |
1652 | extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *, | 1738 | extern ssize_t generic_file_direct_write(struct kiocb *, const struct iovec *, |
1653 | unsigned long *, loff_t, loff_t *, size_t, size_t); | 1739 | unsigned long *, loff_t, loff_t *, size_t, size_t); |
1654 | extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *, | 1740 | extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *, |
1655 | unsigned long, loff_t, loff_t *, size_t, ssize_t); | 1741 | unsigned long, loff_t, loff_t *, size_t, ssize_t); |
1656 | extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); | 1742 | extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); |
1657 | extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); | 1743 | extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); |
1658 | ssize_t generic_file_write_nolock(struct file *file, const struct iovec *iov, | ||
1659 | unsigned long nr_segs, loff_t *ppos); | ||
1660 | extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *); | 1744 | extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *); |
1661 | extern void do_generic_mapping_read(struct address_space *mapping, | 1745 | extern void do_generic_mapping_read(struct address_space *mapping, |
1662 | struct file_ra_state *, struct file *, | 1746 | struct file_ra_state *, struct file *, |
@@ -1674,10 +1758,6 @@ extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out, | |||
1674 | 1758 | ||
1675 | extern void | 1759 | extern void |
1676 | file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); | 1760 | file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); |
1677 | extern ssize_t generic_file_readv(struct file *filp, const struct iovec *iov, | ||
1678 | unsigned long nr_segs, loff_t *ppos); | ||
1679 | ssize_t generic_file_writev(struct file *filp, const struct iovec *iov, | ||
1680 | unsigned long nr_segs, loff_t *ppos); | ||
1681 | extern loff_t no_llseek(struct file *file, loff_t offset, int origin); | 1761 | extern loff_t no_llseek(struct file *file, loff_t offset, int origin); |
1682 | extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); | 1762 | extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); |
1683 | extern loff_t remote_llseek(struct file *file, loff_t offset, int origin); | 1763 | extern loff_t remote_llseek(struct file *file, loff_t offset, int origin); |
@@ -1713,6 +1793,7 @@ static inline void do_generic_file_read(struct file * filp, loff_t *ppos, | |||
1713 | actor); | 1793 | actor); |
1714 | } | 1794 | } |
1715 | 1795 | ||
1796 | #ifdef CONFIG_BLOCK | ||
1716 | ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, | 1797 | ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, |
1717 | struct block_device *bdev, const struct iovec *iov, loff_t offset, | 1798 | struct block_device *bdev, const struct iovec *iov, loff_t offset, |
1718 | unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io, | 1799 | unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io, |
@@ -1750,6 +1831,7 @@ static inline ssize_t blockdev_direct_IO_own_locking(int rw, struct kiocb *iocb, | |||
1750 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, | 1831 | return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, |
1751 | nr_segs, get_block, end_io, DIO_OWN_LOCKING); | 1832 | nr_segs, get_block, end_io, DIO_OWN_LOCKING); |
1752 | } | 1833 | } |
1834 | #endif | ||
1753 | 1835 | ||
1754 | extern const struct file_operations generic_ro_fops; | 1836 | extern const struct file_operations generic_ro_fops; |
1755 | 1837 | ||
diff --git a/include/linux/fs_enet_pd.h b/include/linux/fs_enet_pd.h index 74ed35a00a94..543cd3cd9e77 100644 --- a/include/linux/fs_enet_pd.h +++ b/include/linux/fs_enet_pd.h | |||
@@ -55,6 +55,30 @@ static inline int fs_get_scc_index(enum fs_id id) | |||
55 | return -1; | 55 | return -1; |
56 | } | 56 | } |
57 | 57 | ||
58 | static inline int fs_fec_index2id(int index) | ||
59 | { | ||
60 | int id = fsid_fec1 + index - 1; | ||
61 | if (id >= fsid_fec1 && id <= fsid_fec2) | ||
62 | return id; | ||
63 | return FS_MAX_INDEX; | ||
64 | } | ||
65 | |||
66 | static inline int fs_fcc_index2id(int index) | ||
67 | { | ||
68 | int id = fsid_fcc1 + index - 1; | ||
69 | if (id >= fsid_fcc1 && id <= fsid_fcc3) | ||
70 | return id; | ||
71 | return FS_MAX_INDEX; | ||
72 | } | ||
73 | |||
74 | static inline int fs_scc_index2id(int index) | ||
75 | { | ||
76 | int id = fsid_scc1 + index - 1; | ||
77 | if (id >= fsid_scc1 && id <= fsid_scc4) | ||
78 | return id; | ||
79 | return FS_MAX_INDEX; | ||
80 | } | ||
81 | |||
58 | enum fs_mii_method { | 82 | enum fs_mii_method { |
59 | fsmii_fixed, | 83 | fsmii_fixed, |
60 | fsmii_fec, | 84 | fsmii_fec, |
@@ -87,18 +111,21 @@ struct fs_mii_bb_platform_info { | |||
87 | }; | 111 | }; |
88 | 112 | ||
89 | struct fs_platform_info { | 113 | struct fs_platform_info { |
90 | 114 | ||
91 | void(*init_ioports)(void); | 115 | void(*init_ioports)(struct fs_platform_info *); |
92 | /* device specific information */ | 116 | /* device specific information */ |
93 | int fs_no; /* controller index */ | 117 | int fs_no; /* controller index */ |
118 | char fs_type[4]; /* controller type */ | ||
94 | 119 | ||
95 | u32 cp_page; /* CPM page */ | 120 | u32 cp_page; /* CPM page */ |
96 | u32 cp_block; /* CPM sblock */ | 121 | u32 cp_block; /* CPM sblock */ |
97 | 122 | ||
98 | u32 clk_trx; /* some stuff for pins & mux configuration*/ | 123 | u32 clk_trx; /* some stuff for pins & mux configuration*/ |
124 | u32 clk_rx; | ||
125 | u32 clk_tx; | ||
99 | u32 clk_route; | 126 | u32 clk_route; |
100 | u32 clk_mask; | 127 | u32 clk_mask; |
101 | 128 | ||
102 | u32 mem_offset; | 129 | u32 mem_offset; |
103 | u32 dpram_offset; | 130 | u32 dpram_offset; |
104 | u32 fcc_regs_c; | 131 | u32 fcc_regs_c; |
@@ -124,4 +151,16 @@ struct fs_mii_fec_platform_info { | |||
124 | u32 irq[32]; | 151 | u32 irq[32]; |
125 | u32 mii_speed; | 152 | u32 mii_speed; |
126 | }; | 153 | }; |
154 | |||
155 | static inline int fs_get_id(struct fs_platform_info *fpi) | ||
156 | { | ||
157 | if(strstr(fpi->fs_type, "SCC")) | ||
158 | return fs_scc_index2id(fpi->fs_no); | ||
159 | if(strstr(fpi->fs_type, "FCC")) | ||
160 | return fs_fcc_index2id(fpi->fs_no); | ||
161 | if(strstr(fpi->fs_type, "FEC")) | ||
162 | return fs_fec_index2id(fpi->fs_no); | ||
163 | return fpi->fs_no; | ||
164 | } | ||
165 | |||
127 | #endif | 166 | #endif |
diff --git a/include/linux/fs_uart_pd.h b/include/linux/fs_uart_pd.h index f5975126b712..809bb9ffc788 100644 --- a/include/linux/fs_uart_pd.h +++ b/include/linux/fs_uart_pd.h | |||
@@ -46,15 +46,27 @@ static inline int fs_uart_id_fsid2smc(int id) | |||
46 | } | 46 | } |
47 | 47 | ||
48 | struct fs_uart_platform_info { | 48 | struct fs_uart_platform_info { |
49 | void(*init_ioports)(void); | 49 | void(*init_ioports)(struct fs_uart_platform_info *); |
50 | /* device specific information */ | 50 | /* device specific information */ |
51 | int fs_no; /* controller index */ | 51 | int fs_no; /* controller index */ |
52 | char fs_type[4]; /* controller type */ | ||
52 | u32 uart_clk; | 53 | u32 uart_clk; |
53 | u8 tx_num_fifo; | 54 | u8 tx_num_fifo; |
54 | u8 tx_buf_size; | 55 | u8 tx_buf_size; |
55 | u8 rx_num_fifo; | 56 | u8 rx_num_fifo; |
56 | u8 rx_buf_size; | 57 | u8 rx_buf_size; |
57 | u8 brg; | 58 | u8 brg; |
59 | u8 clk_rx; | ||
60 | u8 clk_tx; | ||
58 | }; | 61 | }; |
59 | 62 | ||
63 | static inline int fs_uart_get_id(struct fs_uart_platform_info *fpi) | ||
64 | { | ||
65 | if(strstr(fpi->fs_type, "SMC")) | ||
66 | return fs_uart_id_smc2fsid(fpi->fs_no); | ||
67 | if(strstr(fpi->fs_type, "SCC")) | ||
68 | return fs_uart_id_scc2fsid(fpi->fs_no); | ||
69 | return fpi->fs_no; | ||
70 | } | ||
71 | |||
60 | #endif | 72 | #endif |
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h index 16fbe59edeb1..3da29e2d524a 100644 --- a/include/linux/fsl_devices.h +++ b/include/linux/fsl_devices.h | |||
@@ -46,18 +46,17 @@ | |||
46 | 46 | ||
47 | struct gianfar_platform_data { | 47 | struct gianfar_platform_data { |
48 | /* device specific information */ | 48 | /* device specific information */ |
49 | u32 device_flags; | 49 | u32 device_flags; |
50 | |||
51 | /* board specific information */ | 50 | /* board specific information */ |
52 | u32 board_flags; | 51 | u32 board_flags; |
53 | u32 bus_id; | 52 | u32 bus_id; |
54 | u32 phy_id; | 53 | u32 phy_id; |
55 | u8 mac_addr[6]; | 54 | u8 mac_addr[6]; |
56 | }; | 55 | }; |
57 | 56 | ||
58 | struct gianfar_mdio_data { | 57 | struct gianfar_mdio_data { |
59 | /* board specific information */ | 58 | /* board specific information */ |
60 | int irq[32]; | 59 | int irq[32]; |
61 | }; | 60 | }; |
62 | 61 | ||
63 | /* Flags related to gianfar device features */ | 62 | /* Flags related to gianfar device features */ |
@@ -76,14 +75,13 @@ struct gianfar_mdio_data { | |||
76 | 75 | ||
77 | struct fsl_i2c_platform_data { | 76 | struct fsl_i2c_platform_data { |
78 | /* device specific information */ | 77 | /* device specific information */ |
79 | u32 device_flags; | 78 | u32 device_flags; |
80 | }; | 79 | }; |
81 | 80 | ||
82 | /* Flags related to I2C device features */ | 81 | /* Flags related to I2C device features */ |
83 | #define FSL_I2C_DEV_SEPARATE_DFSRR 0x00000001 | 82 | #define FSL_I2C_DEV_SEPARATE_DFSRR 0x00000001 |
84 | #define FSL_I2C_DEV_CLOCK_5200 0x00000002 | 83 | #define FSL_I2C_DEV_CLOCK_5200 0x00000002 |
85 | 84 | ||
86 | |||
87 | enum fsl_usb2_operating_modes { | 85 | enum fsl_usb2_operating_modes { |
88 | FSL_USB2_MPH_HOST, | 86 | FSL_USB2_MPH_HOST, |
89 | FSL_USB2_DR_HOST, | 87 | FSL_USB2_DR_HOST, |
@@ -101,9 +99,9 @@ enum fsl_usb2_phy_modes { | |||
101 | 99 | ||
102 | struct fsl_usb2_platform_data { | 100 | struct fsl_usb2_platform_data { |
103 | /* board specific information */ | 101 | /* board specific information */ |
104 | enum fsl_usb2_operating_modes operating_mode; | 102 | enum fsl_usb2_operating_modes operating_mode; |
105 | enum fsl_usb2_phy_modes phy_mode; | 103 | enum fsl_usb2_phy_modes phy_mode; |
106 | unsigned int port_enables; | 104 | unsigned int port_enables; |
107 | }; | 105 | }; |
108 | 106 | ||
109 | /* Flags in fsl_usb2_mph_platform_data */ | 107 | /* Flags in fsl_usb2_mph_platform_data */ |
@@ -121,5 +119,44 @@ struct fsl_spi_platform_data { | |||
121 | u32 sysclk; | 119 | u32 sysclk; |
122 | }; | 120 | }; |
123 | 121 | ||
124 | #endif /* _FSL_DEVICE_H_ */ | 122 | /* Ethernet interface (phy management and speed) |
125 | #endif /* __KERNEL__ */ | 123 | */ |
124 | enum enet_interface { | ||
125 | ENET_10_MII, /* 10 Base T, MII interface */ | ||
126 | ENET_10_RMII, /* 10 Base T, RMII interface */ | ||
127 | ENET_10_RGMII, /* 10 Base T, RGMII interface */ | ||
128 | ENET_100_MII, /* 100 Base T, MII interface */ | ||
129 | ENET_100_RMII, /* 100 Base T, RMII interface */ | ||
130 | ENET_100_RGMII, /* 100 Base T, RGMII interface */ | ||
131 | ENET_1000_GMII, /* 1000 Base T, GMII interface */ | ||
132 | ENET_1000_RGMII, /* 1000 Base T, RGMII interface */ | ||
133 | ENET_1000_TBI, /* 1000 Base T, TBI interface */ | ||
134 | ENET_1000_RTBI /* 1000 Base T, RTBI interface */ | ||
135 | }; | ||
136 | |||
137 | struct ucc_geth_platform_data { | ||
138 | /* device specific information */ | ||
139 | u32 device_flags; | ||
140 | u32 phy_reg_addr; | ||
141 | |||
142 | /* board specific information */ | ||
143 | u32 board_flags; | ||
144 | u8 rx_clock; | ||
145 | u8 tx_clock; | ||
146 | u32 phy_id; | ||
147 | enum enet_interface phy_interface; | ||
148 | u32 phy_interrupt; | ||
149 | u8 mac_addr[6]; | ||
150 | }; | ||
151 | |||
152 | /* Flags related to UCC Gigabit Ethernet device features */ | ||
153 | #define FSL_UGETH_DEV_HAS_GIGABIT 0x00000001 | ||
154 | #define FSL_UGETH_DEV_HAS_COALESCE 0x00000002 | ||
155 | #define FSL_UGETH_DEV_HAS_RMON 0x00000004 | ||
156 | |||
157 | /* Flags in ucc_geth_platform_data */ | ||
158 | #define FSL_UGETH_BRD_HAS_PHY_INTR 0x00000001 | ||
159 | /* if not set use a timer */ | ||
160 | |||
161 | #endif /* _FSL_DEVICE_H_ */ | ||
162 | #endif /* __KERNEL__ */ | ||
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h index 690c42803d2e..9869ef3674ac 100644 --- a/include/linux/genalloc.h +++ b/include/linux/genalloc.h | |||
@@ -31,5 +31,6 @@ struct gen_pool_chunk { | |||
31 | 31 | ||
32 | extern struct gen_pool *gen_pool_create(int, int); | 32 | extern struct gen_pool *gen_pool_create(int, int); |
33 | extern int gen_pool_add(struct gen_pool *, unsigned long, size_t, int); | 33 | extern int gen_pool_add(struct gen_pool *, unsigned long, size_t, int); |
34 | extern void gen_pool_destroy(struct gen_pool *); | ||
34 | extern unsigned long gen_pool_alloc(struct gen_pool *, size_t); | 35 | extern unsigned long gen_pool_alloc(struct gen_pool *, size_t); |
35 | extern void gen_pool_free(struct gen_pool *, unsigned long, size_t); | 36 | extern void gen_pool_free(struct gen_pool *, unsigned long, size_t); |
diff --git a/include/linux/generic_acl.h b/include/linux/generic_acl.h new file mode 100644 index 000000000000..80764f40be75 --- /dev/null +++ b/include/linux/generic_acl.h | |||
@@ -0,0 +1,36 @@ | |||
1 | /* | ||
2 | * fs/generic_acl.c | ||
3 | * | ||
4 | * (C) 2005 Andreas Gruenbacher <agruen@suse.de> | ||
5 | * | ||
6 | * This file is released under the GPL. | ||
7 | */ | ||
8 | |||
9 | #ifndef GENERIC_ACL_H | ||
10 | #define GENERIC_ACL_H | ||
11 | |||
12 | #include <linux/posix_acl.h> | ||
13 | #include <linux/posix_acl_xattr.h> | ||
14 | |||
15 | /** | ||
16 | * struct generic_acl_operations - filesystem operations | ||
17 | * | ||
18 | * Filesystems must make these operations available to the generic | ||
19 | * operations. | ||
20 | */ | ||
21 | struct generic_acl_operations { | ||
22 | struct posix_acl *(*getacl)(struct inode *, int); | ||
23 | void (*setacl)(struct inode *, int, struct posix_acl *); | ||
24 | }; | ||
25 | |||
26 | size_t generic_acl_list(struct inode *, struct generic_acl_operations *, int, | ||
27 | char *, size_t); | ||
28 | int generic_acl_get(struct inode *, struct generic_acl_operations *, int, | ||
29 | void *, size_t); | ||
30 | int generic_acl_set(struct inode *, struct generic_acl_operations *, int, | ||
31 | const void *, size_t); | ||
32 | int generic_acl_init(struct inode *, struct inode *, | ||
33 | struct generic_acl_operations *); | ||
34 | int generic_acl_chmod(struct inode *, struct generic_acl_operations *); | ||
35 | |||
36 | #endif | ||
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index e4af57e87c17..41f276fdd185 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -11,6 +11,8 @@ | |||
11 | 11 | ||
12 | #include <linux/types.h> | 12 | #include <linux/types.h> |
13 | 13 | ||
14 | #ifdef CONFIG_BLOCK | ||
15 | |||
14 | enum { | 16 | enum { |
15 | /* These three have identical behaviour; use the second one if DOS FDISK gets | 17 | /* These three have identical behaviour; use the second one if DOS FDISK gets |
16 | confused about extended/logical partitions starting past cylinder 1023. */ | 18 | confused about extended/logical partitions starting past cylinder 1023. */ |
@@ -420,3 +422,5 @@ static inline struct block_device *bdget_disk(struct gendisk *disk, int index) | |||
420 | #endif | 422 | #endif |
421 | 423 | ||
422 | #endif | 424 | #endif |
425 | |||
426 | #endif | ||
diff --git a/include/linux/getcpu.h b/include/linux/getcpu.h new file mode 100644 index 000000000000..c7372d7a97be --- /dev/null +++ b/include/linux/getcpu.h | |||
@@ -0,0 +1,18 @@ | |||
1 | #ifndef _LINUX_GETCPU_H | ||
2 | #define _LINUX_GETCPU_H 1 | ||
3 | |||
4 | /* Cache for getcpu() to speed it up. Results might be a short time | ||
5 | out of date, but will be faster. | ||
6 | |||
7 | User programs should not refer to the contents of this structure. | ||
8 | I repeat they should not refer to it. If they do they will break | ||
9 | in future kernels. | ||
10 | |||
11 | It is only a private cache for vgetcpu(). It will change in future kernels. | ||
12 | The user program must store this information per thread (__thread) | ||
13 | If you want 100% accurate information pass NULL instead. */ | ||
14 | struct getcpu_cache { | ||
15 | unsigned long blob[128 / sizeof(long)]; | ||
16 | }; | ||
17 | |||
18 | #endif | ||
diff --git a/include/linux/gfp.h b/include/linux/gfp.h index 8b34aabfe4c6..bf2b6bc3f6fd 100644 --- a/include/linux/gfp.h +++ b/include/linux/gfp.h | |||
@@ -67,7 +67,12 @@ struct vm_area_struct; | |||
67 | #define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \ | 67 | #define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \ |
68 | __GFP_HIGHMEM) | 68 | __GFP_HIGHMEM) |
69 | 69 | ||
70 | #ifdef CONFIG_NUMA | ||
70 | #define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) | 71 | #define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) |
72 | #else | ||
73 | #define GFP_THISNODE 0 | ||
74 | #endif | ||
75 | |||
71 | 76 | ||
72 | /* Flag - indicates that the buffer will be suitable for DMA. Ignored on some | 77 | /* Flag - indicates that the buffer will be suitable for DMA. Ignored on some |
73 | platforms, used as appropriate on others */ | 78 | platforms, used as appropriate on others */ |
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h new file mode 100644 index 000000000000..a7ae7c177cac --- /dev/null +++ b/include/linux/gfs2_ondisk.h | |||
@@ -0,0 +1,443 @@ | |||
1 | /* | ||
2 | * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. | ||
3 | * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. | ||
4 | * | ||
5 | * This copyrighted material is made available to anyone wishing to use, | ||
6 | * modify, copy, or redistribute it subject to the terms and conditions | ||
7 | * of the GNU General Public License v.2. | ||
8 | */ | ||
9 | |||
10 | #ifndef __GFS2_ONDISK_DOT_H__ | ||
11 | #define __GFS2_ONDISK_DOT_H__ | ||
12 | |||
13 | #define GFS2_MAGIC 0x01161970 | ||
14 | #define GFS2_BASIC_BLOCK 512 | ||
15 | #define GFS2_BASIC_BLOCK_SHIFT 9 | ||
16 | |||
17 | /* Lock numbers of the LM_TYPE_NONDISK type */ | ||
18 | |||
19 | #define GFS2_MOUNT_LOCK 0 | ||
20 | #define GFS2_LIVE_LOCK 1 | ||
21 | #define GFS2_TRANS_LOCK 2 | ||
22 | #define GFS2_RENAME_LOCK 3 | ||
23 | |||
24 | /* Format numbers for various metadata types */ | ||
25 | |||
26 | #define GFS2_FORMAT_NONE 0 | ||
27 | #define GFS2_FORMAT_SB 100 | ||
28 | #define GFS2_FORMAT_RG 200 | ||
29 | #define GFS2_FORMAT_RB 300 | ||
30 | #define GFS2_FORMAT_DI 400 | ||
31 | #define GFS2_FORMAT_IN 500 | ||
32 | #define GFS2_FORMAT_LF 600 | ||
33 | #define GFS2_FORMAT_JD 700 | ||
34 | #define GFS2_FORMAT_LH 800 | ||
35 | #define GFS2_FORMAT_LD 900 | ||
36 | #define GFS2_FORMAT_LB 1000 | ||
37 | #define GFS2_FORMAT_EA 1600 | ||
38 | #define GFS2_FORMAT_ED 1700 | ||
39 | #define GFS2_FORMAT_QC 1400 | ||
40 | /* These are format numbers for entities contained in files */ | ||
41 | #define GFS2_FORMAT_RI 1100 | ||
42 | #define GFS2_FORMAT_DE 1200 | ||
43 | #define GFS2_FORMAT_QU 1500 | ||
44 | /* These are part of the superblock */ | ||
45 | #define GFS2_FORMAT_FS 1801 | ||
46 | #define GFS2_FORMAT_MULTI 1900 | ||
47 | |||
48 | /* | ||
49 | * An on-disk inode number | ||
50 | */ | ||
51 | |||
52 | struct gfs2_inum { | ||
53 | __be64 no_formal_ino; | ||
54 | __be64 no_addr; | ||
55 | }; | ||
56 | |||
57 | static inline int gfs2_inum_equal(const struct gfs2_inum *ino1, | ||
58 | const struct gfs2_inum *ino2) | ||
59 | { | ||
60 | return ino1->no_formal_ino == ino2->no_formal_ino && | ||
61 | ino1->no_addr == ino2->no_addr; | ||
62 | } | ||
63 | |||
64 | /* | ||
65 | * Generic metadata head structure | ||
66 | * Every inplace buffer logged in the journal must start with this. | ||
67 | */ | ||
68 | |||
69 | #define GFS2_METATYPE_NONE 0 | ||
70 | #define GFS2_METATYPE_SB 1 | ||
71 | #define GFS2_METATYPE_RG 2 | ||
72 | #define GFS2_METATYPE_RB 3 | ||
73 | #define GFS2_METATYPE_DI 4 | ||
74 | #define GFS2_METATYPE_IN 5 | ||
75 | #define GFS2_METATYPE_LF 6 | ||
76 | #define GFS2_METATYPE_JD 7 | ||
77 | #define GFS2_METATYPE_LH 8 | ||
78 | #define GFS2_METATYPE_LD 9 | ||
79 | #define GFS2_METATYPE_LB 12 | ||
80 | #define GFS2_METATYPE_EA 10 | ||
81 | #define GFS2_METATYPE_ED 11 | ||
82 | #define GFS2_METATYPE_QC 14 | ||
83 | |||
84 | struct gfs2_meta_header { | ||
85 | __be32 mh_magic; | ||
86 | __be32 mh_type; | ||
87 | __be64 __pad0; /* Was generation number in gfs1 */ | ||
88 | __be32 mh_format; | ||
89 | __be32 __pad1; /* Was incarnation number in gfs1 */ | ||
90 | }; | ||
91 | |||
92 | /* | ||
93 | * super-block structure | ||
94 | * | ||
95 | * It's probably good if SIZEOF_SB <= GFS2_BASIC_BLOCK (512 bytes) | ||
96 | * | ||
97 | * Order is important, need to be able to read old superblocks to do on-disk | ||
98 | * version upgrades. | ||
99 | */ | ||
100 | |||
101 | /* Address of superblock in GFS2 basic blocks */ | ||
102 | #define GFS2_SB_ADDR 128 | ||
103 | |||
104 | /* The lock number for the superblock (must be zero) */ | ||
105 | #define GFS2_SB_LOCK 0 | ||
106 | |||
107 | /* Requirement: GFS2_LOCKNAME_LEN % 8 == 0 | ||
108 | Includes: the fencing zero at the end */ | ||
109 | #define GFS2_LOCKNAME_LEN 64 | ||
110 | |||
111 | struct gfs2_sb { | ||
112 | struct gfs2_meta_header sb_header; | ||
113 | |||
114 | __be32 sb_fs_format; | ||
115 | __be32 sb_multihost_format; | ||
116 | __u32 __pad0; /* Was superblock flags in gfs1 */ | ||
117 | |||
118 | __be32 sb_bsize; | ||
119 | __be32 sb_bsize_shift; | ||
120 | __u32 __pad1; /* Was journal segment size in gfs1 */ | ||
121 | |||
122 | struct gfs2_inum sb_master_dir; /* Was jindex dinode in gfs1 */ | ||
123 | struct gfs2_inum __pad2; /* Was rindex dinode in gfs1 */ | ||
124 | struct gfs2_inum sb_root_dir; | ||
125 | |||
126 | char sb_lockproto[GFS2_LOCKNAME_LEN]; | ||
127 | char sb_locktable[GFS2_LOCKNAME_LEN]; | ||
128 | /* In gfs1, quota and license dinodes followed */ | ||
129 | }; | ||
130 | |||
131 | /* | ||
132 | * resource index structure | ||
133 | */ | ||
134 | |||
135 | struct gfs2_rindex { | ||
136 | __be64 ri_addr; /* grp block disk address */ | ||
137 | __be32 ri_length; /* length of rgrp header in fs blocks */ | ||
138 | __u32 __pad; | ||
139 | |||
140 | __be64 ri_data0; /* first data location */ | ||
141 | __be32 ri_data; /* num of data blocks in rgrp */ | ||
142 | |||
143 | __be32 ri_bitbytes; /* number of bytes in data bitmaps */ | ||
144 | |||
145 | __u8 ri_reserved[64]; | ||
146 | }; | ||
147 | |||
148 | /* | ||
149 | * resource group header structure | ||
150 | */ | ||
151 | |||
152 | /* Number of blocks per byte in rgrp */ | ||
153 | #define GFS2_NBBY 4 | ||
154 | #define GFS2_BIT_SIZE 2 | ||
155 | #define GFS2_BIT_MASK 0x00000003 | ||
156 | |||
157 | #define GFS2_BLKST_FREE 0 | ||
158 | #define GFS2_BLKST_USED 1 | ||
159 | #define GFS2_BLKST_UNLINKED 2 | ||
160 | #define GFS2_BLKST_DINODE 3 | ||
161 | |||
162 | #define GFS2_RGF_JOURNAL 0x00000001 | ||
163 | #define GFS2_RGF_METAONLY 0x00000002 | ||
164 | #define GFS2_RGF_DATAONLY 0x00000004 | ||
165 | #define GFS2_RGF_NOALLOC 0x00000008 | ||
166 | |||
167 | struct gfs2_rgrp { | ||
168 | struct gfs2_meta_header rg_header; | ||
169 | |||
170 | __be32 rg_flags; | ||
171 | __be32 rg_free; | ||
172 | __be32 rg_dinodes; | ||
173 | __be32 __pad; | ||
174 | __be64 rg_igeneration; | ||
175 | |||
176 | __u8 rg_reserved[80]; /* Several fields from gfs1 now reserved */ | ||
177 | }; | ||
178 | |||
179 | /* | ||
180 | * quota structure | ||
181 | */ | ||
182 | |||
183 | struct gfs2_quota { | ||
184 | __be64 qu_limit; | ||
185 | __be64 qu_warn; | ||
186 | __be64 qu_value; | ||
187 | __u8 qu_reserved[64]; | ||
188 | }; | ||
189 | |||
190 | /* | ||
191 | * dinode structure | ||
192 | */ | ||
193 | |||
194 | #define GFS2_MAX_META_HEIGHT 10 | ||
195 | #define GFS2_DIR_MAX_DEPTH 17 | ||
196 | |||
197 | #define DT2IF(dt) (((dt) << 12) & S_IFMT) | ||
198 | #define IF2DT(sif) (((sif) & S_IFMT) >> 12) | ||
199 | |||
200 | enum { | ||
201 | gfs2fl_Jdata = 0, | ||
202 | gfs2fl_ExHash = 1, | ||
203 | gfs2fl_Unused = 2, | ||
204 | gfs2fl_EaIndirect = 3, | ||
205 | gfs2fl_Directio = 4, | ||
206 | gfs2fl_Immutable = 5, | ||
207 | gfs2fl_AppendOnly = 6, | ||
208 | gfs2fl_NoAtime = 7, | ||
209 | gfs2fl_Sync = 8, | ||
210 | gfs2fl_System = 9, | ||
211 | gfs2fl_TruncInProg = 29, | ||
212 | gfs2fl_InheritDirectio = 30, | ||
213 | gfs2fl_InheritJdata = 31, | ||
214 | }; | ||
215 | |||
216 | /* Dinode flags */ | ||
217 | #define GFS2_DIF_JDATA 0x00000001 | ||
218 | #define GFS2_DIF_EXHASH 0x00000002 | ||
219 | #define GFS2_DIF_UNUSED 0x00000004 /* only in gfs1 */ | ||
220 | #define GFS2_DIF_EA_INDIRECT 0x00000008 | ||
221 | #define GFS2_DIF_DIRECTIO 0x00000010 | ||
222 | #define GFS2_DIF_IMMUTABLE 0x00000020 | ||
223 | #define GFS2_DIF_APPENDONLY 0x00000040 | ||
224 | #define GFS2_DIF_NOATIME 0x00000080 | ||
225 | #define GFS2_DIF_SYNC 0x00000100 | ||
226 | #define GFS2_DIF_SYSTEM 0x00000200 /* New in gfs2 */ | ||
227 | #define GFS2_DIF_TRUNC_IN_PROG 0x20000000 /* New in gfs2 */ | ||
228 | #define GFS2_DIF_INHERIT_DIRECTIO 0x40000000 | ||
229 | #define GFS2_DIF_INHERIT_JDATA 0x80000000 | ||
230 | |||
231 | struct gfs2_dinode { | ||
232 | struct gfs2_meta_header di_header; | ||
233 | |||
234 | struct gfs2_inum di_num; | ||
235 | |||
236 | __be32 di_mode; /* mode of file */ | ||
237 | __be32 di_uid; /* owner's user id */ | ||
238 | __be32 di_gid; /* owner's group id */ | ||
239 | __be32 di_nlink; /* number of links to this file */ | ||
240 | __be64 di_size; /* number of bytes in file */ | ||
241 | __be64 di_blocks; /* number of blocks in file */ | ||
242 | __be64 di_atime; /* time last accessed */ | ||
243 | __be64 di_mtime; /* time last modified */ | ||
244 | __be64 di_ctime; /* time last changed */ | ||
245 | __be32 di_major; /* device major number */ | ||
246 | __be32 di_minor; /* device minor number */ | ||
247 | |||
248 | /* This section varies from gfs1. Padding added to align with | ||
249 | * remainder of dinode | ||
250 | */ | ||
251 | __be64 di_goal_meta; /* rgrp to alloc from next */ | ||
252 | __be64 di_goal_data; /* data block goal */ | ||
253 | __be64 di_generation; /* generation number for NFS */ | ||
254 | |||
255 | __be32 di_flags; /* GFS2_DIF_... */ | ||
256 | __be32 di_payload_format; /* GFS2_FORMAT_... */ | ||
257 | __u16 __pad1; /* Was ditype in gfs1 */ | ||
258 | __be16 di_height; /* height of metadata */ | ||
259 | __u32 __pad2; /* Unused incarnation number from gfs1 */ | ||
260 | |||
261 | /* These only apply to directories */ | ||
262 | __u16 __pad3; /* Padding */ | ||
263 | __be16 di_depth; /* Number of bits in the table */ | ||
264 | __be32 di_entries; /* The number of entries in the directory */ | ||
265 | |||
266 | struct gfs2_inum __pad4; /* Unused even in current gfs1 */ | ||
267 | |||
268 | __be64 di_eattr; /* extended attribute block number */ | ||
269 | |||
270 | __u8 di_reserved[56]; | ||
271 | }; | ||
272 | |||
273 | /* | ||
274 | * directory structure - many of these per directory file | ||
275 | */ | ||
276 | |||
277 | #define GFS2_FNAMESIZE 255 | ||
278 | #define GFS2_DIRENT_SIZE(name_len) ((sizeof(struct gfs2_dirent) + (name_len) + 7) & ~7) | ||
279 | |||
280 | struct gfs2_dirent { | ||
281 | struct gfs2_inum de_inum; | ||
282 | __be32 de_hash; | ||
283 | __be16 de_rec_len; | ||
284 | __be16 de_name_len; | ||
285 | __be16 de_type; | ||
286 | __u8 __pad[14]; | ||
287 | }; | ||
288 | |||
289 | /* | ||
290 | * Header of leaf directory nodes | ||
291 | */ | ||
292 | |||
293 | struct gfs2_leaf { | ||
294 | struct gfs2_meta_header lf_header; | ||
295 | |||
296 | __be16 lf_depth; /* Depth of leaf */ | ||
297 | __be16 lf_entries; /* Number of dirents in leaf */ | ||
298 | __be32 lf_dirent_format; /* Format of the dirents */ | ||
299 | __be64 lf_next; /* Next leaf, if overflow */ | ||
300 | |||
301 | __u8 lf_reserved[64]; | ||
302 | }; | ||
303 | |||
304 | /* | ||
305 | * Extended attribute header format | ||
306 | */ | ||
307 | |||
308 | #define GFS2_EA_MAX_NAME_LEN 255 | ||
309 | #define GFS2_EA_MAX_DATA_LEN 65536 | ||
310 | |||
311 | #define GFS2_EATYPE_UNUSED 0 | ||
312 | #define GFS2_EATYPE_USR 1 | ||
313 | #define GFS2_EATYPE_SYS 2 | ||
314 | #define GFS2_EATYPE_SECURITY 3 | ||
315 | |||
316 | #define GFS2_EATYPE_LAST 3 | ||
317 | #define GFS2_EATYPE_VALID(x) ((x) <= GFS2_EATYPE_LAST) | ||
318 | |||
319 | #define GFS2_EAFLAG_LAST 0x01 /* last ea in block */ | ||
320 | |||
321 | struct gfs2_ea_header { | ||
322 | __be32 ea_rec_len; | ||
323 | __be32 ea_data_len; | ||
324 | __u8 ea_name_len; /* no NULL pointer after the string */ | ||
325 | __u8 ea_type; /* GFS2_EATYPE_... */ | ||
326 | __u8 ea_flags; /* GFS2_EAFLAG_... */ | ||
327 | __u8 ea_num_ptrs; | ||
328 | __u32 __pad; | ||
329 | }; | ||
330 | |||
331 | /* | ||
332 | * Log header structure | ||
333 | */ | ||
334 | |||
335 | #define GFS2_LOG_HEAD_UNMOUNT 0x00000001 /* log is clean */ | ||
336 | |||
337 | struct gfs2_log_header { | ||
338 | struct gfs2_meta_header lh_header; | ||
339 | |||
340 | __be64 lh_sequence; /* Sequence number of this transaction */ | ||
341 | __be32 lh_flags; /* GFS2_LOG_HEAD_... */ | ||
342 | __be32 lh_tail; /* Block number of log tail */ | ||
343 | __be32 lh_blkno; | ||
344 | __be32 lh_hash; | ||
345 | }; | ||
346 | |||
347 | /* | ||
348 | * Log type descriptor | ||
349 | */ | ||
350 | |||
351 | #define GFS2_LOG_DESC_METADATA 300 | ||
352 | /* ld_data1 is the number of metadata blocks in the descriptor. | ||
353 | ld_data2 is unused. */ | ||
354 | |||
355 | #define GFS2_LOG_DESC_REVOKE 301 | ||
356 | /* ld_data1 is the number of revoke blocks in the descriptor. | ||
357 | ld_data2 is unused. */ | ||
358 | |||
359 | #define GFS2_LOG_DESC_JDATA 302 | ||
360 | /* ld_data1 is the number of data blocks in the descriptor. | ||
361 | ld_data2 is unused. */ | ||
362 | |||
363 | struct gfs2_log_descriptor { | ||
364 | struct gfs2_meta_header ld_header; | ||
365 | |||
366 | __be32 ld_type; /* GFS2_LOG_DESC_... */ | ||
367 | __be32 ld_length; /* Number of buffers in this chunk */ | ||
368 | __be32 ld_data1; /* descriptor-specific field */ | ||
369 | __be32 ld_data2; /* descriptor-specific field */ | ||
370 | |||
371 | __u8 ld_reserved[32]; | ||
372 | }; | ||
373 | |||
374 | /* | ||
375 | * Inum Range | ||
376 | * Describe a range of formal inode numbers allocated to | ||
377 | * one machine to assign to inodes. | ||
378 | */ | ||
379 | |||
380 | #define GFS2_INUM_QUANTUM 1048576 | ||
381 | |||
382 | struct gfs2_inum_range { | ||
383 | __be64 ir_start; | ||
384 | __be64 ir_length; | ||
385 | }; | ||
386 | |||
387 | /* | ||
388 | * Statfs change | ||
389 | * Describes an change to the pool of free and allocated | ||
390 | * blocks. | ||
391 | */ | ||
392 | |||
393 | struct gfs2_statfs_change { | ||
394 | __be64 sc_total; | ||
395 | __be64 sc_free; | ||
396 | __be64 sc_dinodes; | ||
397 | }; | ||
398 | |||
399 | /* | ||
400 | * Quota change | ||
401 | * Describes an allocation change for a particular | ||
402 | * user or group. | ||
403 | */ | ||
404 | |||
405 | #define GFS2_QCF_USER 0x00000001 | ||
406 | |||
407 | struct gfs2_quota_change { | ||
408 | __be64 qc_change; | ||
409 | __be32 qc_flags; /* GFS2_QCF_... */ | ||
410 | __be32 qc_id; | ||
411 | }; | ||
412 | |||
413 | #ifdef __KERNEL__ | ||
414 | /* Translation functions */ | ||
415 | |||
416 | extern void gfs2_inum_in(struct gfs2_inum *no, const void *buf); | ||
417 | extern void gfs2_inum_out(const struct gfs2_inum *no, void *buf); | ||
418 | extern void gfs2_sb_in(struct gfs2_sb *sb, const void *buf); | ||
419 | extern void gfs2_rindex_in(struct gfs2_rindex *ri, const void *buf); | ||
420 | extern void gfs2_rindex_out(const struct gfs2_rindex *ri, void *buf); | ||
421 | extern void gfs2_rgrp_in(struct gfs2_rgrp *rg, const void *buf); | ||
422 | extern void gfs2_rgrp_out(const struct gfs2_rgrp *rg, void *buf); | ||
423 | extern void gfs2_quota_in(struct gfs2_quota *qu, const void *buf); | ||
424 | extern void gfs2_quota_out(const struct gfs2_quota *qu, void *buf); | ||
425 | extern void gfs2_dinode_in(struct gfs2_dinode *di, const void *buf); | ||
426 | extern void gfs2_dinode_out(const struct gfs2_dinode *di, void *buf); | ||
427 | extern void gfs2_ea_header_in(struct gfs2_ea_header *ea, const void *buf); | ||
428 | extern void gfs2_ea_header_out(const struct gfs2_ea_header *ea, void *buf); | ||
429 | extern void gfs2_log_header_in(struct gfs2_log_header *lh, const void *buf); | ||
430 | extern void gfs2_inum_range_in(struct gfs2_inum_range *ir, const void *buf); | ||
431 | extern void gfs2_inum_range_out(const struct gfs2_inum_range *ir, void *buf); | ||
432 | extern void gfs2_statfs_change_in(struct gfs2_statfs_change *sc, const void *buf); | ||
433 | extern void gfs2_statfs_change_out(const struct gfs2_statfs_change *sc, void *buf); | ||
434 | extern void gfs2_quota_change_in(struct gfs2_quota_change *qc, const void *buf); | ||
435 | |||
436 | /* Printing functions */ | ||
437 | |||
438 | extern void gfs2_rindex_print(const struct gfs2_rindex *ri); | ||
439 | extern void gfs2_dinode_print(const struct gfs2_dinode *di); | ||
440 | |||
441 | #endif /* __KERNEL__ */ | ||
442 | |||
443 | #endif /* __GFS2_ONDISK_DOT_H__ */ | ||
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 50d8b5744cf6..612472aaa79c 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -28,11 +28,16 @@ | |||
28 | 28 | ||
29 | #ifndef HARDIRQ_BITS | 29 | #ifndef HARDIRQ_BITS |
30 | #define HARDIRQ_BITS 12 | 30 | #define HARDIRQ_BITS 12 |
31 | |||
32 | #ifndef MAX_HARDIRQS_PER_CPU | ||
33 | #define MAX_HARDIRQS_PER_CPU NR_IRQS | ||
34 | #endif | ||
35 | |||
31 | /* | 36 | /* |
32 | * The hardirq mask has to be large enough to have space for potentially | 37 | * The hardirq mask has to be large enough to have space for potentially |
33 | * all IRQ sources in the system nesting on a single CPU. | 38 | * all IRQ sources in the system nesting on a single CPU. |
34 | */ | 39 | */ |
35 | #if (1 << HARDIRQ_BITS) < NR_IRQS | 40 | #if (1 << HARDIRQ_BITS) < MAX_HARDIRQS_PER_CPU |
36 | # error HARDIRQ_BITS is too low! | 41 | # error HARDIRQ_BITS is too low! |
37 | #endif | 42 | #endif |
38 | #endif | 43 | #endif |
diff --git a/include/linux/harrier_defs.h b/include/linux/harrier_defs.h index 685b252e16cc..efef11db790f 100644 --- a/include/linux/harrier_defs.h +++ b/include/linux/harrier_defs.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * asm-ppc/harrier_defs.h | 2 | * include/linux/harrier_defs.h |
3 | * | 3 | * |
4 | * Definitions for Motorola MCG Harrier North Bridge & Memory controller | 4 | * Definitions for Motorola MCG Harrier North Bridge & Memory controller |
5 | * | 5 | * |
diff --git a/include/linux/hdlc.h b/include/linux/hdlc.h index d5ebbb29aeae..d4b333938f73 100644 --- a/include/linux/hdlc.h +++ b/include/linux/hdlc.h | |||
@@ -11,95 +11,46 @@ | |||
11 | #ifndef __HDLC_H | 11 | #ifndef __HDLC_H |
12 | #define __HDLC_H | 12 | #define __HDLC_H |
13 | 13 | ||
14 | #define GENERIC_HDLC_VERSION 4 /* For synchronization with sethdlc utility */ | ||
15 | |||
16 | #define CLOCK_DEFAULT 0 /* Default setting */ | ||
17 | #define CLOCK_EXT 1 /* External TX and RX clock - DTE */ | ||
18 | #define CLOCK_INT 2 /* Internal TX and RX clock - DCE */ | ||
19 | #define CLOCK_TXINT 3 /* Internal TX and external RX clock */ | ||
20 | #define CLOCK_TXFROMRX 4 /* TX clock derived from external RX clock */ | ||
21 | |||
22 | |||
23 | #define ENCODING_DEFAULT 0 /* Default setting */ | ||
24 | #define ENCODING_NRZ 1 | ||
25 | #define ENCODING_NRZI 2 | ||
26 | #define ENCODING_FM_MARK 3 | ||
27 | #define ENCODING_FM_SPACE 4 | ||
28 | #define ENCODING_MANCHESTER 5 | ||
29 | |||
30 | |||
31 | #define PARITY_DEFAULT 0 /* Default setting */ | ||
32 | #define PARITY_NONE 1 /* No parity */ | ||
33 | #define PARITY_CRC16_PR0 2 /* CRC16, initial value 0x0000 */ | ||
34 | #define PARITY_CRC16_PR1 3 /* CRC16, initial value 0xFFFF */ | ||
35 | #define PARITY_CRC16_PR0_CCITT 4 /* CRC16, initial 0x0000, ITU-T version */ | ||
36 | #define PARITY_CRC16_PR1_CCITT 5 /* CRC16, initial 0xFFFF, ITU-T version */ | ||
37 | #define PARITY_CRC32_PR0_CCITT 6 /* CRC32, initial value 0x00000000 */ | ||
38 | #define PARITY_CRC32_PR1_CCITT 7 /* CRC32, initial value 0xFFFFFFFF */ | ||
39 | |||
40 | #define LMI_DEFAULT 0 /* Default setting */ | ||
41 | #define LMI_NONE 1 /* No LMI, all PVCs are static */ | ||
42 | #define LMI_ANSI 2 /* ANSI Annex D */ | ||
43 | #define LMI_CCITT 3 /* ITU-T Annex A */ | ||
44 | #define LMI_CISCO 4 /* The "original" LMI, aka Gang of Four */ | ||
45 | 14 | ||
46 | #define HDLC_MAX_MTU 1500 /* Ethernet 1500 bytes */ | 15 | #define HDLC_MAX_MTU 1500 /* Ethernet 1500 bytes */ |
16 | #if 0 | ||
47 | #define HDLC_MAX_MRU (HDLC_MAX_MTU + 10 + 14 + 4) /* for ETH+VLAN over FR */ | 17 | #define HDLC_MAX_MRU (HDLC_MAX_MTU + 10 + 14 + 4) /* for ETH+VLAN over FR */ |
18 | #else | ||
19 | #define HDLC_MAX_MRU 1600 /* as required for FR network */ | ||
20 | #endif | ||
48 | 21 | ||
49 | 22 | ||
50 | #ifdef __KERNEL__ | 23 | #ifdef __KERNEL__ |
51 | 24 | ||
52 | #include <linux/skbuff.h> | 25 | #include <linux/skbuff.h> |
53 | #include <linux/netdevice.h> | 26 | #include <linux/netdevice.h> |
54 | #include <net/syncppp.h> | ||
55 | #include <linux/hdlc/ioctl.h> | 27 | #include <linux/hdlc/ioctl.h> |
56 | 28 | ||
57 | 29 | ||
58 | typedef struct { /* Used in Cisco and PPP mode */ | 30 | /* Used by all network devices here, pointed to by netdev_priv(dev) */ |
59 | u8 address; | 31 | struct hdlc_device_desc { |
60 | u8 control; | 32 | int (*netif_rx)(struct sk_buff *skb); |
61 | u16 protocol; | ||
62 | }__attribute__ ((packed)) hdlc_header; | ||
63 | |||
64 | |||
65 | |||
66 | typedef struct { | ||
67 | u32 type; /* code */ | ||
68 | u32 par1; | ||
69 | u32 par2; | ||
70 | u16 rel; /* reliability */ | ||
71 | u32 time; | ||
72 | }__attribute__ ((packed)) cisco_packet; | ||
73 | #define CISCO_PACKET_LEN 18 | ||
74 | #define CISCO_BIG_PACKET_LEN 20 | ||
75 | |||
76 | |||
77 | |||
78 | typedef struct pvc_device_struct { | ||
79 | struct net_device *master; | ||
80 | struct net_device *main; | ||
81 | struct net_device *ether; /* bridged Ethernet interface */ | ||
82 | struct pvc_device_struct *next; /* Sorted in ascending DLCI order */ | ||
83 | int dlci; | ||
84 | int open_count; | ||
85 | |||
86 | struct { | ||
87 | unsigned int new: 1; | ||
88 | unsigned int active: 1; | ||
89 | unsigned int exist: 1; | ||
90 | unsigned int deleted: 1; | ||
91 | unsigned int fecn: 1; | ||
92 | unsigned int becn: 1; | ||
93 | unsigned int bandwidth; /* Cisco LMI reporting only */ | ||
94 | }state; | ||
95 | }pvc_device; | ||
96 | |||
97 | |||
98 | |||
99 | typedef struct hdlc_device_struct { | ||
100 | /* To be initialized by hardware driver */ | ||
101 | struct net_device_stats stats; | 33 | struct net_device_stats stats; |
102 | 34 | }; | |
35 | |||
36 | /* This structure is a private property of HDLC protocols. | ||
37 | Hardware drivers have no interest here */ | ||
38 | |||
39 | struct hdlc_proto { | ||
40 | int (*open)(struct net_device *dev); | ||
41 | void (*close)(struct net_device *dev); | ||
42 | void (*start)(struct net_device *dev); /* if open & DCD */ | ||
43 | void (*stop)(struct net_device *dev); /* if open & !DCD */ | ||
44 | void (*detach)(struct net_device *dev); | ||
45 | int (*ioctl)(struct net_device *dev, struct ifreq *ifr); | ||
46 | unsigned short (*type_trans)(struct sk_buff *skb, | ||
47 | struct net_device *dev); | ||
48 | struct module *module; | ||
49 | struct hdlc_proto *next; /* next protocol in the list */ | ||
50 | }; | ||
51 | |||
52 | |||
53 | typedef struct hdlc_device { | ||
103 | /* used by HDLC layer to take control over HDLC device from hw driver*/ | 54 | /* used by HDLC layer to take control over HDLC device from hw driver*/ |
104 | int (*attach)(struct net_device *dev, | 55 | int (*attach)(struct net_device *dev, |
105 | unsigned short encoding, unsigned short parity); | 56 | unsigned short encoding, unsigned short parity); |
@@ -107,82 +58,18 @@ typedef struct hdlc_device_struct { | |||
107 | /* hardware driver must handle this instead of dev->hard_start_xmit */ | 58 | /* hardware driver must handle this instead of dev->hard_start_xmit */ |
108 | int (*xmit)(struct sk_buff *skb, struct net_device *dev); | 59 | int (*xmit)(struct sk_buff *skb, struct net_device *dev); |
109 | 60 | ||
110 | |||
111 | /* Things below are for HDLC layer internal use only */ | 61 | /* Things below are for HDLC layer internal use only */ |
112 | struct { | 62 | const struct hdlc_proto *proto; |
113 | int (*open)(struct net_device *dev); | ||
114 | void (*close)(struct net_device *dev); | ||
115 | |||
116 | /* if open & DCD */ | ||
117 | void (*start)(struct net_device *dev); | ||
118 | /* if open & !DCD */ | ||
119 | void (*stop)(struct net_device *dev); | ||
120 | |||
121 | void (*detach)(struct hdlc_device_struct *hdlc); | ||
122 | int (*netif_rx)(struct sk_buff *skb); | ||
123 | unsigned short (*type_trans)(struct sk_buff *skb, | ||
124 | struct net_device *dev); | ||
125 | int id; /* IF_PROTO_HDLC/CISCO/FR/etc. */ | ||
126 | }proto; | ||
127 | |||
128 | int carrier; | 63 | int carrier; |
129 | int open; | 64 | int open; |
130 | spinlock_t state_lock; | 65 | spinlock_t state_lock; |
131 | 66 | void *state; | |
132 | union { | ||
133 | struct { | ||
134 | fr_proto settings; | ||
135 | pvc_device *first_pvc; | ||
136 | int dce_pvc_count; | ||
137 | |||
138 | struct timer_list timer; | ||
139 | unsigned long last_poll; | ||
140 | int reliable; | ||
141 | int dce_changed; | ||
142 | int request; | ||
143 | int fullrep_sent; | ||
144 | u32 last_errors; /* last errors bit list */ | ||
145 | u8 n391cnt; | ||
146 | u8 txseq; /* TX sequence number */ | ||
147 | u8 rxseq; /* RX sequence number */ | ||
148 | }fr; | ||
149 | |||
150 | struct { | ||
151 | cisco_proto settings; | ||
152 | |||
153 | struct timer_list timer; | ||
154 | unsigned long last_poll; | ||
155 | int up; | ||
156 | int request_sent; | ||
157 | u32 txseq; /* TX sequence number */ | ||
158 | u32 rxseq; /* RX sequence number */ | ||
159 | }cisco; | ||
160 | |||
161 | struct { | ||
162 | raw_hdlc_proto settings; | ||
163 | }raw_hdlc; | ||
164 | |||
165 | struct { | ||
166 | struct ppp_device pppdev; | ||
167 | struct ppp_device *syncppp_ptr; | ||
168 | int (*old_change_mtu)(struct net_device *dev, | ||
169 | int new_mtu); | ||
170 | }ppp; | ||
171 | }state; | ||
172 | void *priv; | 67 | void *priv; |
173 | }hdlc_device; | 68 | }hdlc_device; |
174 | 69 | ||
175 | 70 | ||
176 | 71 | ||
177 | int hdlc_raw_ioctl(struct net_device *dev, struct ifreq *ifr); | 72 | /* Exported from hdlc module */ |
178 | int hdlc_raw_eth_ioctl(struct net_device *dev, struct ifreq *ifr); | ||
179 | int hdlc_cisco_ioctl(struct net_device *dev, struct ifreq *ifr); | ||
180 | int hdlc_ppp_ioctl(struct net_device *dev, struct ifreq *ifr); | ||
181 | int hdlc_fr_ioctl(struct net_device *dev, struct ifreq *ifr); | ||
182 | int hdlc_x25_ioctl(struct net_device *dev, struct ifreq *ifr); | ||
183 | |||
184 | |||
185 | /* Exported from hdlc.o */ | ||
186 | 73 | ||
187 | /* Called by hardware driver when a user requests HDLC service */ | 74 | /* Called by hardware driver when a user requests HDLC service */ |
188 | int hdlc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); | 75 | int hdlc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); |
@@ -191,17 +78,21 @@ int hdlc_ioctl(struct net_device *dev, struct ifreq *ifr, int cmd); | |||
191 | #define register_hdlc_device(dev) register_netdev(dev) | 78 | #define register_hdlc_device(dev) register_netdev(dev) |
192 | void unregister_hdlc_device(struct net_device *dev); | 79 | void unregister_hdlc_device(struct net_device *dev); |
193 | 80 | ||
81 | |||
82 | void register_hdlc_protocol(struct hdlc_proto *proto); | ||
83 | void unregister_hdlc_protocol(struct hdlc_proto *proto); | ||
84 | |||
194 | struct net_device *alloc_hdlcdev(void *priv); | 85 | struct net_device *alloc_hdlcdev(void *priv); |
195 | 86 | ||
196 | static __inline__ hdlc_device* dev_to_hdlc(struct net_device *dev) | 87 | |
88 | static __inline__ struct hdlc_device_desc* dev_to_desc(struct net_device *dev) | ||
197 | { | 89 | { |
198 | return netdev_priv(dev); | 90 | return netdev_priv(dev); |
199 | } | 91 | } |
200 | 92 | ||
201 | 93 | static __inline__ hdlc_device* dev_to_hdlc(struct net_device *dev) | |
202 | static __inline__ pvc_device* dev_to_pvc(struct net_device *dev) | ||
203 | { | 94 | { |
204 | return (pvc_device*)dev->priv; | 95 | return netdev_priv(dev) + sizeof(struct hdlc_device_desc); |
205 | } | 96 | } |
206 | 97 | ||
207 | 98 | ||
@@ -225,18 +116,14 @@ int hdlc_open(struct net_device *dev); | |||
225 | /* Must be called by hardware driver when HDLC device is being closed */ | 116 | /* Must be called by hardware driver when HDLC device is being closed */ |
226 | void hdlc_close(struct net_device *dev); | 117 | void hdlc_close(struct net_device *dev); |
227 | 118 | ||
119 | int attach_hdlc_protocol(struct net_device *dev, struct hdlc_proto *proto, | ||
120 | int (*rx)(struct sk_buff *skb), size_t size); | ||
228 | /* May be used by hardware driver to gain control over HDLC device */ | 121 | /* May be used by hardware driver to gain control over HDLC device */ |
229 | static __inline__ void hdlc_proto_detach(hdlc_device *hdlc) | 122 | void detach_hdlc_protocol(struct net_device *dev); |
230 | { | ||
231 | if (hdlc->proto.detach) | ||
232 | hdlc->proto.detach(hdlc); | ||
233 | hdlc->proto.detach = NULL; | ||
234 | } | ||
235 | |||
236 | 123 | ||
237 | static __inline__ struct net_device_stats *hdlc_stats(struct net_device *dev) | 124 | static __inline__ struct net_device_stats *hdlc_stats(struct net_device *dev) |
238 | { | 125 | { |
239 | return &dev_to_hdlc(dev)->stats; | 126 | return &dev_to_desc(dev)->stats; |
240 | } | 127 | } |
241 | 128 | ||
242 | 129 | ||
@@ -248,8 +135,8 @@ static __inline__ __be16 hdlc_type_trans(struct sk_buff *skb, | |||
248 | skb->mac.raw = skb->data; | 135 | skb->mac.raw = skb->data; |
249 | skb->dev = dev; | 136 | skb->dev = dev; |
250 | 137 | ||
251 | if (hdlc->proto.type_trans) | 138 | if (hdlc->proto->type_trans) |
252 | return hdlc->proto.type_trans(skb, dev); | 139 | return hdlc->proto->type_trans(skb, dev); |
253 | else | 140 | else |
254 | return htons(ETH_P_HDLC); | 141 | return htons(ETH_P_HDLC); |
255 | } | 142 | } |
diff --git a/include/linux/hdlc/ioctl.h b/include/linux/hdlc/ioctl.h index 78430ba3ea69..583972364357 100644 --- a/include/linux/hdlc/ioctl.h +++ b/include/linux/hdlc/ioctl.h | |||
@@ -1,6 +1,39 @@ | |||
1 | #ifndef __HDLC_IOCTL_H__ | 1 | #ifndef __HDLC_IOCTL_H__ |
2 | #define __HDLC_IOCTL_H__ | 2 | #define __HDLC_IOCTL_H__ |
3 | 3 | ||
4 | |||
5 | #define GENERIC_HDLC_VERSION 4 /* For synchronization with sethdlc utility */ | ||
6 | |||
7 | #define CLOCK_DEFAULT 0 /* Default setting */ | ||
8 | #define CLOCK_EXT 1 /* External TX and RX clock - DTE */ | ||
9 | #define CLOCK_INT 2 /* Internal TX and RX clock - DCE */ | ||
10 | #define CLOCK_TXINT 3 /* Internal TX and external RX clock */ | ||
11 | #define CLOCK_TXFROMRX 4 /* TX clock derived from external RX clock */ | ||
12 | |||
13 | |||
14 | #define ENCODING_DEFAULT 0 /* Default setting */ | ||
15 | #define ENCODING_NRZ 1 | ||
16 | #define ENCODING_NRZI 2 | ||
17 | #define ENCODING_FM_MARK 3 | ||
18 | #define ENCODING_FM_SPACE 4 | ||
19 | #define ENCODING_MANCHESTER 5 | ||
20 | |||
21 | |||
22 | #define PARITY_DEFAULT 0 /* Default setting */ | ||
23 | #define PARITY_NONE 1 /* No parity */ | ||
24 | #define PARITY_CRC16_PR0 2 /* CRC16, initial value 0x0000 */ | ||
25 | #define PARITY_CRC16_PR1 3 /* CRC16, initial value 0xFFFF */ | ||
26 | #define PARITY_CRC16_PR0_CCITT 4 /* CRC16, initial 0x0000, ITU-T version */ | ||
27 | #define PARITY_CRC16_PR1_CCITT 5 /* CRC16, initial 0xFFFF, ITU-T version */ | ||
28 | #define PARITY_CRC32_PR0_CCITT 6 /* CRC32, initial value 0x00000000 */ | ||
29 | #define PARITY_CRC32_PR1_CCITT 7 /* CRC32, initial value 0xFFFFFFFF */ | ||
30 | |||
31 | #define LMI_DEFAULT 0 /* Default setting */ | ||
32 | #define LMI_NONE 1 /* No LMI, all PVCs are static */ | ||
33 | #define LMI_ANSI 2 /* ANSI Annex D */ | ||
34 | #define LMI_CCITT 3 /* ITU-T Annex A */ | ||
35 | #define LMI_CISCO 4 /* The "original" LMI, aka Gang of Four */ | ||
36 | |||
4 | typedef struct { | 37 | typedef struct { |
5 | unsigned int clock_rate; /* bits per second */ | 38 | unsigned int clock_rate; /* bits per second */ |
6 | unsigned int clock_type; /* internal, external, TX-internal etc. */ | 39 | unsigned int clock_type; /* internal, external, TX-internal etc. */ |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index 4fc379de6c2f..fca93025ab51 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -138,6 +138,7 @@ extern long hrtimer_nanosleep(struct timespec *rqtp, | |||
138 | struct timespec __user *rmtp, | 138 | struct timespec __user *rmtp, |
139 | const enum hrtimer_mode mode, | 139 | const enum hrtimer_mode mode, |
140 | const clockid_t clockid); | 140 | const clockid_t clockid); |
141 | extern long hrtimer_nanosleep_restart(struct restart_block *restart_block); | ||
141 | 142 | ||
142 | extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl, | 143 | extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl, |
143 | struct task_struct *tsk); | 144 | struct task_struct *tsk); |
diff --git a/include/linux/htirq.h b/include/linux/htirq.h new file mode 100644 index 000000000000..1f15ce279a23 --- /dev/null +++ b/include/linux/htirq.h | |||
@@ -0,0 +1,15 @@ | |||
1 | #ifndef LINUX_HTIRQ_H | ||
2 | #define LINUX_HTIRQ_H | ||
3 | |||
4 | /* Helper functions.. */ | ||
5 | void write_ht_irq_low(unsigned int irq, u32 data); | ||
6 | void write_ht_irq_high(unsigned int irq, u32 data); | ||
7 | u32 read_ht_irq_low(unsigned int irq); | ||
8 | u32 read_ht_irq_high(unsigned int irq); | ||
9 | void mask_ht_irq(unsigned int irq); | ||
10 | void unmask_ht_irq(unsigned int irq); | ||
11 | |||
12 | /* The arch hook for getting things started */ | ||
13 | int arch_setup_ht_irq(unsigned int irq, struct pci_dev *dev); | ||
14 | |||
15 | #endif /* LINUX_HTIRQ_H */ | ||
diff --git a/include/linux/i2c-algo-bit.h b/include/linux/i2c-algo-bit.h index c0e7fab28ce3..c8f8df25c7e0 100644 --- a/include/linux/i2c-algo-bit.h +++ b/include/linux/i2c-algo-bit.h | |||
@@ -40,7 +40,6 @@ struct i2c_algo_bit_data { | |||
40 | /* local settings */ | 40 | /* local settings */ |
41 | int udelay; /* half-clock-cycle time in microsecs */ | 41 | int udelay; /* half-clock-cycle time in microsecs */ |
42 | /* i.e. clock is (500 / udelay) KHz */ | 42 | /* i.e. clock is (500 / udelay) KHz */ |
43 | int mdelay; /* in millisecs, unused */ | ||
44 | int timeout; /* in jiffies */ | 43 | int timeout; /* in jiffies */ |
45 | }; | 44 | }; |
46 | 45 | ||
diff --git a/include/linux/i2c-algo-pcf.h b/include/linux/i2c-algo-pcf.h index 18b0adf57a3d..9908f3fc4839 100644 --- a/include/linux/i2c-algo-pcf.h +++ b/include/linux/i2c-algo-pcf.h | |||
@@ -35,7 +35,6 @@ struct i2c_algo_pcf_data { | |||
35 | 35 | ||
36 | /* local settings */ | 36 | /* local settings */ |
37 | int udelay; | 37 | int udelay; |
38 | int mdelay; | ||
39 | int timeout; | 38 | int timeout; |
40 | }; | 39 | }; |
41 | 40 | ||
diff --git a/include/linux/i2c-algo-sibyte.h b/include/linux/i2c-algo-sibyte.h deleted file mode 100644 index 03914ded8614..000000000000 --- a/include/linux/i2c-algo-sibyte.h +++ /dev/null | |||
@@ -1,33 +0,0 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2001,2002,2003 Broadcom Corporation | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or | ||
5 | * modify it under the terms of the GNU General Public License | ||
6 | * as published by the Free Software Foundation; either version 2 | ||
7 | * of the License, or (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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
17 | */ | ||
18 | |||
19 | #ifndef I2C_ALGO_SIBYTE_H | ||
20 | #define I2C_ALGO_SIBYTE_H 1 | ||
21 | |||
22 | #include <linux/i2c.h> | ||
23 | |||
24 | struct i2c_algo_sibyte_data { | ||
25 | void *data; /* private data */ | ||
26 | int bus; /* which bus */ | ||
27 | void *reg_base; /* CSR base */ | ||
28 | }; | ||
29 | |||
30 | int i2c_sibyte_add_bus(struct i2c_adapter *, int speed); | ||
31 | int i2c_sibyte_del_bus(struct i2c_adapter *); | ||
32 | |||
33 | #endif /* I2C_ALGO_SIBYTE_H */ | ||
diff --git a/include/linux/i2c-id.h b/include/linux/i2c-id.h index 9418519a55d1..0a8f750cbede 100644 --- a/include/linux/i2c-id.h +++ b/include/linux/i2c-id.h | |||
@@ -193,6 +193,7 @@ | |||
193 | #define I2C_HW_B_RADEON 0x01001e /* radeon framebuffer driver */ | 193 | #define I2C_HW_B_RADEON 0x01001e /* radeon framebuffer driver */ |
194 | #define I2C_HW_B_EM28XX 0x01001f /* em28xx video capture cards */ | 194 | #define I2C_HW_B_EM28XX 0x01001f /* em28xx video capture cards */ |
195 | #define I2C_HW_B_CX2341X 0x010020 /* Conexant CX2341X MPEG encoder cards */ | 195 | #define I2C_HW_B_CX2341X 0x010020 /* Conexant CX2341X MPEG encoder cards */ |
196 | #define I2C_HW_B_INTELFB 0x010021 /* intel framebuffer driver */ | ||
196 | 197 | ||
197 | /* --- PCF 8584 based algorithms */ | 198 | /* --- PCF 8584 based algorithms */ |
198 | #define I2C_HW_P_LP 0x020000 /* Parallel port interface */ | 199 | #define I2C_HW_P_LP 0x020000 /* Parallel port interface */ |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index eb0628a7ecc6..9b5d04768c2c 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -64,14 +64,6 @@ extern int i2c_master_recv(struct i2c_client *,char* ,int); | |||
64 | */ | 64 | */ |
65 | extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num); | 65 | extern int i2c_transfer(struct i2c_adapter *adap, struct i2c_msg *msgs, int num); |
66 | 66 | ||
67 | /* | ||
68 | * Some adapter types (i.e. PCF 8584 based ones) may support slave behaviuor. | ||
69 | * This is not tested/implemented yet and will change in the future. | ||
70 | */ | ||
71 | extern int i2c_slave_send(struct i2c_client *,char*,int); | ||
72 | extern int i2c_slave_recv(struct i2c_client *,char*,int); | ||
73 | |||
74 | |||
75 | 67 | ||
76 | /* This is the very generalized SMBus access routine. You probably do not | 68 | /* This is the very generalized SMBus access routine. You probably do not |
77 | want to use this, though; one of the functions below may be much easier, | 69 | want to use this, though; one of the functions below may be much easier, |
@@ -201,10 +193,6 @@ struct i2c_algorithm { | |||
201 | unsigned short flags, char read_write, | 193 | unsigned short flags, char read_write, |
202 | u8 command, int size, union i2c_smbus_data * data); | 194 | u8 command, int size, union i2c_smbus_data * data); |
203 | 195 | ||
204 | /* --- these optional/future use for some adapter types.*/ | ||
205 | int (*slave_send)(struct i2c_adapter *,char*,int); | ||
206 | int (*slave_recv)(struct i2c_adapter *,char*,int); | ||
207 | |||
208 | /* --- ioctl like call to set div. parameters. */ | 196 | /* --- ioctl like call to set div. parameters. */ |
209 | int (*algo_control)(struct i2c_adapter *, unsigned int, unsigned long); | 197 | int (*algo_control)(struct i2c_adapter *, unsigned int, unsigned long); |
210 | 198 | ||
@@ -220,7 +208,7 @@ struct i2c_adapter { | |||
220 | struct module *owner; | 208 | struct module *owner; |
221 | unsigned int id; | 209 | unsigned int id; |
222 | unsigned int class; | 210 | unsigned int class; |
223 | struct i2c_algorithm *algo;/* the algorithm to access the bus */ | 211 | const struct i2c_algorithm *algo; /* the algorithm to access the bus */ |
224 | void *algo_data; | 212 | void *algo_data; |
225 | 213 | ||
226 | /* --- administration stuff. */ | 214 | /* --- administration stuff. */ |
diff --git a/include/linux/icmp.h b/include/linux/icmp.h index f0b571f1060b..878cfe4e587f 100644 --- a/include/linux/icmp.h +++ b/include/linux/icmp.h | |||
@@ -68,16 +68,16 @@ | |||
68 | struct icmphdr { | 68 | struct icmphdr { |
69 | __u8 type; | 69 | __u8 type; |
70 | __u8 code; | 70 | __u8 code; |
71 | __u16 checksum; | 71 | __be16 checksum; |
72 | union { | 72 | union { |
73 | struct { | 73 | struct { |
74 | __u16 id; | 74 | __be16 id; |
75 | __u16 sequence; | 75 | __be16 sequence; |
76 | } echo; | 76 | } echo; |
77 | __u32 gateway; | 77 | __be32 gateway; |
78 | struct { | 78 | struct { |
79 | __u16 __unused; | 79 | __be16 __unused; |
80 | __u16 mtu; | 80 | __be16 mtu; |
81 | } frag; | 81 | } frag; |
82 | } un; | 82 | } un; |
83 | }; | 83 | }; |
diff --git a/include/linux/ide.h b/include/linux/ide.h index 99620451d958..07d8d725541f 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -251,7 +251,8 @@ static inline void ide_std_init_ports(hw_regs_t *hw, | |||
251 | 251 | ||
252 | #include <asm/ide.h> | 252 | #include <asm/ide.h> |
253 | 253 | ||
254 | #ifndef MAX_HWIFS | 254 | #if !defined(MAX_HWIFS) || defined(CONFIG_EMBEDDED) |
255 | #undef MAX_HWIFS | ||
255 | #define MAX_HWIFS CONFIG_IDE_MAX_HWIFS | 256 | #define MAX_HWIFS CONFIG_IDE_MAX_HWIFS |
256 | #endif | 257 | #endif |
257 | 258 | ||
@@ -773,12 +774,13 @@ typedef struct hwif_s { | |||
773 | unsigned long dma_status; /* dma status register */ | 774 | unsigned long dma_status; /* dma status register */ |
774 | unsigned long dma_vendor3; /* dma vendor 3 register */ | 775 | unsigned long dma_vendor3; /* dma vendor 3 register */ |
775 | unsigned long dma_prdtable; /* actual prd table address */ | 776 | unsigned long dma_prdtable; /* actual prd table address */ |
776 | unsigned long dma_base2; /* extended base addr for dma ports */ | ||
777 | 777 | ||
778 | unsigned dma_extra; /* extra addr for dma ports */ | ||
779 | unsigned long config_data; /* for use by chipset-specific code */ | 778 | unsigned long config_data; /* for use by chipset-specific code */ |
780 | unsigned long select_data; /* for use by chipset-specific code */ | 779 | unsigned long select_data; /* for use by chipset-specific code */ |
781 | 780 | ||
781 | unsigned long extra_base; /* extra addr for dma ports */ | ||
782 | unsigned extra_ports; /* number of extra dma ports */ | ||
783 | |||
782 | unsigned noprobe : 1; /* don't probe for this interface */ | 784 | unsigned noprobe : 1; /* don't probe for this interface */ |
783 | unsigned present : 1; /* this interface exists */ | 785 | unsigned present : 1; /* this interface exists */ |
784 | unsigned hold : 1; /* this interface is always present */ | 786 | unsigned hold : 1; /* this interface is always present */ |
@@ -823,6 +825,9 @@ typedef struct hwgroup_s { | |||
823 | unsigned int sleeping : 1; | 825 | unsigned int sleeping : 1; |
824 | /* BOOL: polling active & poll_timeout field valid */ | 826 | /* BOOL: polling active & poll_timeout field valid */ |
825 | unsigned int polling : 1; | 827 | unsigned int polling : 1; |
828 | /* BOOL: in a polling reset situation. Must not trigger another reset yet */ | ||
829 | unsigned int resetting : 1; | ||
830 | |||
826 | /* current drive */ | 831 | /* current drive */ |
827 | ide_drive_t *drive; | 832 | ide_drive_t *drive; |
828 | /* ptr to current hwif in linked-list */ | 833 | /* ptr to current hwif in linked-list */ |
@@ -1190,7 +1195,6 @@ extern int ideprobe_init(void); | |||
1190 | extern void ide_scan_pcibus(int scan_direction) __init; | 1195 | extern void ide_scan_pcibus(int scan_direction) __init; |
1191 | extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner); | 1196 | extern int __ide_pci_register_driver(struct pci_driver *driver, struct module *owner); |
1192 | #define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE) | 1197 | #define ide_pci_register_driver(d) __ide_pci_register_driver(d, THIS_MODULE) |
1193 | extern void ide_pci_unregister_driver(struct pci_driver *driver); | ||
1194 | void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, ata_index_t *); | 1198 | void ide_pci_setup_ports(struct pci_dev *, struct ide_pci_device_s *, int, ata_index_t *); |
1195 | extern void ide_setup_pci_noise (struct pci_dev *dev, struct ide_pci_device_s *d); | 1199 | extern void ide_setup_pci_noise (struct pci_dev *dev, struct ide_pci_device_s *d); |
1196 | 1200 | ||
diff --git a/include/linux/if.h b/include/linux/if.h index cd080d765324..32bf419351f1 100644 --- a/include/linux/if.h +++ b/include/linux/if.h | |||
@@ -59,6 +59,8 @@ | |||
59 | #define IFF_SLAVE_INACTIVE 0x4 /* bonding slave not the curr. active */ | 59 | #define IFF_SLAVE_INACTIVE 0x4 /* bonding slave not the curr. active */ |
60 | #define IFF_MASTER_8023AD 0x8 /* bonding master, 802.3ad. */ | 60 | #define IFF_MASTER_8023AD 0x8 /* bonding master, 802.3ad. */ |
61 | #define IFF_MASTER_ALB 0x10 /* bonding master, balance-alb. */ | 61 | #define IFF_MASTER_ALB 0x10 /* bonding master, balance-alb. */ |
62 | #define IFF_BONDING 0x20 /* bonding master or slave */ | ||
63 | #define IFF_SLAVE_NEEDARP 0x40 /* need ARPs for validation */ | ||
62 | 64 | ||
63 | #define IF_GET_IFACE 0x0001 /* for querying only */ | 65 | #define IF_GET_IFACE 0x0001 /* for querying only */ |
64 | #define IF_GET_PROTO 0x0002 | 66 | #define IF_GET_PROTO 0x0002 |
@@ -212,134 +214,4 @@ struct ifconf | |||
212 | #define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */ | 214 | #define ifc_buf ifc_ifcu.ifcu_buf /* buffer address */ |
213 | #define ifc_req ifc_ifcu.ifcu_req /* array of structures */ | 215 | #define ifc_req ifc_ifcu.ifcu_req /* array of structures */ |
214 | 216 | ||
215 | /* The struct should be in sync with struct net_device_stats */ | ||
216 | struct rtnl_link_stats | ||
217 | { | ||
218 | __u32 rx_packets; /* total packets received */ | ||
219 | __u32 tx_packets; /* total packets transmitted */ | ||
220 | __u32 rx_bytes; /* total bytes received */ | ||
221 | __u32 tx_bytes; /* total bytes transmitted */ | ||
222 | __u32 rx_errors; /* bad packets received */ | ||
223 | __u32 tx_errors; /* packet transmit problems */ | ||
224 | __u32 rx_dropped; /* no space in linux buffers */ | ||
225 | __u32 tx_dropped; /* no space available in linux */ | ||
226 | __u32 multicast; /* multicast packets received */ | ||
227 | __u32 collisions; | ||
228 | |||
229 | /* detailed rx_errors: */ | ||
230 | __u32 rx_length_errors; | ||
231 | __u32 rx_over_errors; /* receiver ring buff overflow */ | ||
232 | __u32 rx_crc_errors; /* recved pkt with crc error */ | ||
233 | __u32 rx_frame_errors; /* recv'd frame alignment error */ | ||
234 | __u32 rx_fifo_errors; /* recv'r fifo overrun */ | ||
235 | __u32 rx_missed_errors; /* receiver missed packet */ | ||
236 | |||
237 | /* detailed tx_errors */ | ||
238 | __u32 tx_aborted_errors; | ||
239 | __u32 tx_carrier_errors; | ||
240 | __u32 tx_fifo_errors; | ||
241 | __u32 tx_heartbeat_errors; | ||
242 | __u32 tx_window_errors; | ||
243 | |||
244 | /* for cslip etc */ | ||
245 | __u32 rx_compressed; | ||
246 | __u32 tx_compressed; | ||
247 | }; | ||
248 | |||
249 | /* The struct should be in sync with struct ifmap */ | ||
250 | struct rtnl_link_ifmap | ||
251 | { | ||
252 | __u64 mem_start; | ||
253 | __u64 mem_end; | ||
254 | __u64 base_addr; | ||
255 | __u16 irq; | ||
256 | __u8 dma; | ||
257 | __u8 port; | ||
258 | }; | ||
259 | |||
260 | enum | ||
261 | { | ||
262 | IFLA_UNSPEC, | ||
263 | IFLA_ADDRESS, | ||
264 | IFLA_BROADCAST, | ||
265 | IFLA_IFNAME, | ||
266 | IFLA_MTU, | ||
267 | IFLA_LINK, | ||
268 | IFLA_QDISC, | ||
269 | IFLA_STATS, | ||
270 | IFLA_COST, | ||
271 | #define IFLA_COST IFLA_COST | ||
272 | IFLA_PRIORITY, | ||
273 | #define IFLA_PRIORITY IFLA_PRIORITY | ||
274 | IFLA_MASTER, | ||
275 | #define IFLA_MASTER IFLA_MASTER | ||
276 | IFLA_WIRELESS, /* Wireless Extension event - see wireless.h */ | ||
277 | #define IFLA_WIRELESS IFLA_WIRELESS | ||
278 | IFLA_PROTINFO, /* Protocol specific information for a link */ | ||
279 | #define IFLA_PROTINFO IFLA_PROTINFO | ||
280 | IFLA_TXQLEN, | ||
281 | #define IFLA_TXQLEN IFLA_TXQLEN | ||
282 | IFLA_MAP, | ||
283 | #define IFLA_MAP IFLA_MAP | ||
284 | IFLA_WEIGHT, | ||
285 | #define IFLA_WEIGHT IFLA_WEIGHT | ||
286 | IFLA_OPERSTATE, | ||
287 | IFLA_LINKMODE, | ||
288 | __IFLA_MAX | ||
289 | }; | ||
290 | |||
291 | |||
292 | #define IFLA_MAX (__IFLA_MAX - 1) | ||
293 | |||
294 | /* ifi_flags. | ||
295 | |||
296 | IFF_* flags. | ||
297 | |||
298 | The only change is: | ||
299 | IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are | ||
300 | more not changeable by user. They describe link media | ||
301 | characteristics and set by device driver. | ||
302 | |||
303 | Comments: | ||
304 | - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid | ||
305 | - If neither of these three flags are set; | ||
306 | the interface is NBMA. | ||
307 | |||
308 | - IFF_MULTICAST does not mean anything special: | ||
309 | multicasts can be used on all not-NBMA links. | ||
310 | IFF_MULTICAST means that this media uses special encapsulation | ||
311 | for multicast frames. Apparently, all IFF_POINTOPOINT and | ||
312 | IFF_BROADCAST devices are able to use multicasts too. | ||
313 | */ | ||
314 | |||
315 | /* IFLA_LINK. | ||
316 | For usual devices it is equal ifi_index. | ||
317 | If it is a "virtual interface" (f.e. tunnel), ifi_link | ||
318 | can point to real physical interface (f.e. for bandwidth calculations), | ||
319 | or maybe 0, what means, that real media is unknown (usual | ||
320 | for IPIP tunnels, when route to endpoint is allowed to change) | ||
321 | */ | ||
322 | |||
323 | /* Subtype attributes for IFLA_PROTINFO */ | ||
324 | enum | ||
325 | { | ||
326 | IFLA_INET6_UNSPEC, | ||
327 | IFLA_INET6_FLAGS, /* link flags */ | ||
328 | IFLA_INET6_CONF, /* sysctl parameters */ | ||
329 | IFLA_INET6_STATS, /* statistics */ | ||
330 | IFLA_INET6_MCAST, /* MC things. What of them? */ | ||
331 | IFLA_INET6_CACHEINFO, /* time values and max reasm size */ | ||
332 | __IFLA_INET6_MAX | ||
333 | }; | ||
334 | |||
335 | #define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1) | ||
336 | |||
337 | struct ifla_cacheinfo | ||
338 | { | ||
339 | __u32 max_reasm_len; | ||
340 | __u32 tstamp; /* ipv6InterfaceTable updated timestamp */ | ||
341 | __u32 reachable_time; | ||
342 | __u32 retrans_time; | ||
343 | }; | ||
344 | |||
345 | #endif /* _LINUX_IF_H */ | 217 | #endif /* _LINUX_IF_H */ |
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h index a8b1a2071838..7f5714214ee3 100644 --- a/include/linux/if_arp.h +++ b/include/linux/if_arp.h | |||
@@ -130,11 +130,11 @@ struct arpreq_old { | |||
130 | 130 | ||
131 | struct arphdr | 131 | struct arphdr |
132 | { | 132 | { |
133 | unsigned short ar_hrd; /* format of hardware address */ | 133 | __be16 ar_hrd; /* format of hardware address */ |
134 | unsigned short ar_pro; /* format of protocol address */ | 134 | __be16 ar_pro; /* format of protocol address */ |
135 | unsigned char ar_hln; /* length of hardware address */ | 135 | unsigned char ar_hln; /* length of hardware address */ |
136 | unsigned char ar_pln; /* length of protocol address */ | 136 | unsigned char ar_pln; /* length of protocol address */ |
137 | unsigned short ar_op; /* ARP opcode (command) */ | 137 | __be16 ar_op; /* ARP opcode (command) */ |
138 | 138 | ||
139 | #if 0 | 139 | #if 0 |
140 | /* | 140 | /* |
diff --git a/include/linux/if_link.h b/include/linux/if_link.h new file mode 100644 index 000000000000..e963a077e6f5 --- /dev/null +++ b/include/linux/if_link.h | |||
@@ -0,0 +1,136 @@ | |||
1 | #ifndef _LINUX_IF_LINK_H | ||
2 | #define _LINUX_IF_LINK_H | ||
3 | |||
4 | #include <linux/netlink.h> | ||
5 | |||
6 | /* The struct should be in sync with struct net_device_stats */ | ||
7 | struct rtnl_link_stats | ||
8 | { | ||
9 | __u32 rx_packets; /* total packets received */ | ||
10 | __u32 tx_packets; /* total packets transmitted */ | ||
11 | __u32 rx_bytes; /* total bytes received */ | ||
12 | __u32 tx_bytes; /* total bytes transmitted */ | ||
13 | __u32 rx_errors; /* bad packets received */ | ||
14 | __u32 tx_errors; /* packet transmit problems */ | ||
15 | __u32 rx_dropped; /* no space in linux buffers */ | ||
16 | __u32 tx_dropped; /* no space available in linux */ | ||
17 | __u32 multicast; /* multicast packets received */ | ||
18 | __u32 collisions; | ||
19 | |||
20 | /* detailed rx_errors: */ | ||
21 | __u32 rx_length_errors; | ||
22 | __u32 rx_over_errors; /* receiver ring buff overflow */ | ||
23 | __u32 rx_crc_errors; /* recved pkt with crc error */ | ||
24 | __u32 rx_frame_errors; /* recv'd frame alignment error */ | ||
25 | __u32 rx_fifo_errors; /* recv'r fifo overrun */ | ||
26 | __u32 rx_missed_errors; /* receiver missed packet */ | ||
27 | |||
28 | /* detailed tx_errors */ | ||
29 | __u32 tx_aborted_errors; | ||
30 | __u32 tx_carrier_errors; | ||
31 | __u32 tx_fifo_errors; | ||
32 | __u32 tx_heartbeat_errors; | ||
33 | __u32 tx_window_errors; | ||
34 | |||
35 | /* for cslip etc */ | ||
36 | __u32 rx_compressed; | ||
37 | __u32 tx_compressed; | ||
38 | }; | ||
39 | |||
40 | /* The struct should be in sync with struct ifmap */ | ||
41 | struct rtnl_link_ifmap | ||
42 | { | ||
43 | __u64 mem_start; | ||
44 | __u64 mem_end; | ||
45 | __u64 base_addr; | ||
46 | __u16 irq; | ||
47 | __u8 dma; | ||
48 | __u8 port; | ||
49 | }; | ||
50 | |||
51 | enum | ||
52 | { | ||
53 | IFLA_UNSPEC, | ||
54 | IFLA_ADDRESS, | ||
55 | IFLA_BROADCAST, | ||
56 | IFLA_IFNAME, | ||
57 | IFLA_MTU, | ||
58 | IFLA_LINK, | ||
59 | IFLA_QDISC, | ||
60 | IFLA_STATS, | ||
61 | IFLA_COST, | ||
62 | #define IFLA_COST IFLA_COST | ||
63 | IFLA_PRIORITY, | ||
64 | #define IFLA_PRIORITY IFLA_PRIORITY | ||
65 | IFLA_MASTER, | ||
66 | #define IFLA_MASTER IFLA_MASTER | ||
67 | IFLA_WIRELESS, /* Wireless Extension event - see wireless.h */ | ||
68 | #define IFLA_WIRELESS IFLA_WIRELESS | ||
69 | IFLA_PROTINFO, /* Protocol specific information for a link */ | ||
70 | #define IFLA_PROTINFO IFLA_PROTINFO | ||
71 | IFLA_TXQLEN, | ||
72 | #define IFLA_TXQLEN IFLA_TXQLEN | ||
73 | IFLA_MAP, | ||
74 | #define IFLA_MAP IFLA_MAP | ||
75 | IFLA_WEIGHT, | ||
76 | #define IFLA_WEIGHT IFLA_WEIGHT | ||
77 | IFLA_OPERSTATE, | ||
78 | IFLA_LINKMODE, | ||
79 | __IFLA_MAX | ||
80 | }; | ||
81 | |||
82 | |||
83 | #define IFLA_MAX (__IFLA_MAX - 1) | ||
84 | |||
85 | /* ifi_flags. | ||
86 | |||
87 | IFF_* flags. | ||
88 | |||
89 | The only change is: | ||
90 | IFF_LOOPBACK, IFF_BROADCAST and IFF_POINTOPOINT are | ||
91 | more not changeable by user. They describe link media | ||
92 | characteristics and set by device driver. | ||
93 | |||
94 | Comments: | ||
95 | - Combination IFF_BROADCAST|IFF_POINTOPOINT is invalid | ||
96 | - If neither of these three flags are set; | ||
97 | the interface is NBMA. | ||
98 | |||
99 | - IFF_MULTICAST does not mean anything special: | ||
100 | multicasts can be used on all not-NBMA links. | ||
101 | IFF_MULTICAST means that this media uses special encapsulation | ||
102 | for multicast frames. Apparently, all IFF_POINTOPOINT and | ||
103 | IFF_BROADCAST devices are able to use multicasts too. | ||
104 | */ | ||
105 | |||
106 | /* IFLA_LINK. | ||
107 | For usual devices it is equal ifi_index. | ||
108 | If it is a "virtual interface" (f.e. tunnel), ifi_link | ||
109 | can point to real physical interface (f.e. for bandwidth calculations), | ||
110 | or maybe 0, what means, that real media is unknown (usual | ||
111 | for IPIP tunnels, when route to endpoint is allowed to change) | ||
112 | */ | ||
113 | |||
114 | /* Subtype attributes for IFLA_PROTINFO */ | ||
115 | enum | ||
116 | { | ||
117 | IFLA_INET6_UNSPEC, | ||
118 | IFLA_INET6_FLAGS, /* link flags */ | ||
119 | IFLA_INET6_CONF, /* sysctl parameters */ | ||
120 | IFLA_INET6_STATS, /* statistics */ | ||
121 | IFLA_INET6_MCAST, /* MC things. What of them? */ | ||
122 | IFLA_INET6_CACHEINFO, /* time values and max reasm size */ | ||
123 | __IFLA_INET6_MAX | ||
124 | }; | ||
125 | |||
126 | #define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1) | ||
127 | |||
128 | struct ifla_cacheinfo | ||
129 | { | ||
130 | __u32 max_reasm_len; | ||
131 | __u32 tstamp; /* ipv6InterfaceTable updated timestamp */ | ||
132 | __u32 reachable_time; | ||
133 | __u32 retrans_time; | ||
134 | }; | ||
135 | |||
136 | #endif /* _LINUX_IF_LINK_H */ | ||
diff --git a/include/linux/igmp.h b/include/linux/igmp.h index 899c3d4776f3..03f43e2893a4 100644 --- a/include/linux/igmp.h +++ b/include/linux/igmp.h | |||
@@ -30,8 +30,8 @@ struct igmphdr | |||
30 | { | 30 | { |
31 | __u8 type; | 31 | __u8 type; |
32 | __u8 code; /* For newer IGMP */ | 32 | __u8 code; /* For newer IGMP */ |
33 | __u16 csum; | 33 | __be16 csum; |
34 | __u32 group; | 34 | __be32 group; |
35 | }; | 35 | }; |
36 | 36 | ||
37 | /* V3 group record types [grec_type] */ | 37 | /* V3 group record types [grec_type] */ |
@@ -45,25 +45,25 @@ struct igmphdr | |||
45 | struct igmpv3_grec { | 45 | struct igmpv3_grec { |
46 | __u8 grec_type; | 46 | __u8 grec_type; |
47 | __u8 grec_auxwords; | 47 | __u8 grec_auxwords; |
48 | __u16 grec_nsrcs; | 48 | __be16 grec_nsrcs; |
49 | __u32 grec_mca; | 49 | __be32 grec_mca; |
50 | __u32 grec_src[0]; | 50 | __be32 grec_src[0]; |
51 | }; | 51 | }; |
52 | 52 | ||
53 | struct igmpv3_report { | 53 | struct igmpv3_report { |
54 | __u8 type; | 54 | __u8 type; |
55 | __u8 resv1; | 55 | __u8 resv1; |
56 | __u16 csum; | 56 | __be16 csum; |
57 | __u16 resv2; | 57 | __be16 resv2; |
58 | __u16 ngrec; | 58 | __be16 ngrec; |
59 | struct igmpv3_grec grec[0]; | 59 | struct igmpv3_grec grec[0]; |
60 | }; | 60 | }; |
61 | 61 | ||
62 | struct igmpv3_query { | 62 | struct igmpv3_query { |
63 | __u8 type; | 63 | __u8 type; |
64 | __u8 code; | 64 | __u8 code; |
65 | __u16 csum; | 65 | __be16 csum; |
66 | __u32 group; | 66 | __be32 group; |
67 | #if defined(__LITTLE_ENDIAN_BITFIELD) | 67 | #if defined(__LITTLE_ENDIAN_BITFIELD) |
68 | __u8 qrv:3, | 68 | __u8 qrv:3, |
69 | suppress:1, | 69 | suppress:1, |
@@ -76,8 +76,8 @@ struct igmpv3_query { | |||
76 | #error "Please fix <asm/byteorder.h>" | 76 | #error "Please fix <asm/byteorder.h>" |
77 | #endif | 77 | #endif |
78 | __u8 qqic; | 78 | __u8 qqic; |
79 | __u16 nsrcs; | 79 | __be16 nsrcs; |
80 | __u32 srcs[0]; | 80 | __be32 srcs[0]; |
81 | }; | 81 | }; |
82 | 82 | ||
83 | #define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */ | 83 | #define IGMP_HOST_MEMBERSHIP_QUERY 0x11 /* From RFC1112 */ |
@@ -136,11 +136,11 @@ struct ip_sf_socklist | |||
136 | { | 136 | { |
137 | unsigned int sl_max; | 137 | unsigned int sl_max; |
138 | unsigned int sl_count; | 138 | unsigned int sl_count; |
139 | __u32 sl_addr[0]; | 139 | __be32 sl_addr[0]; |
140 | }; | 140 | }; |
141 | 141 | ||
142 | #define IP_SFLSIZE(count) (sizeof(struct ip_sf_socklist) + \ | 142 | #define IP_SFLSIZE(count) (sizeof(struct ip_sf_socklist) + \ |
143 | (count) * sizeof(__u32)) | 143 | (count) * sizeof(__be32)) |
144 | 144 | ||
145 | #define IP_SFBLOCK 10 /* allocate this many at once */ | 145 | #define IP_SFBLOCK 10 /* allocate this many at once */ |
146 | 146 | ||
@@ -159,7 +159,7 @@ struct ip_mc_socklist | |||
159 | struct ip_sf_list | 159 | struct ip_sf_list |
160 | { | 160 | { |
161 | struct ip_sf_list *sf_next; | 161 | struct ip_sf_list *sf_next; |
162 | __u32 sf_inaddr; | 162 | __be32 sf_inaddr; |
163 | unsigned long sf_count[2]; /* include/exclude counts */ | 163 | unsigned long sf_count[2]; /* include/exclude counts */ |
164 | unsigned char sf_gsresp; /* include in g & s response? */ | 164 | unsigned char sf_gsresp; /* include in g & s response? */ |
165 | unsigned char sf_oldin; /* change state */ | 165 | unsigned char sf_oldin; /* change state */ |
@@ -197,7 +197,7 @@ struct ip_mc_list | |||
197 | #define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value) | 197 | #define IGMPV3_QQIC(value) IGMPV3_EXP(0x80, 4, 3, value) |
198 | #define IGMPV3_MRC(value) IGMPV3_EXP(0x80, 4, 3, value) | 198 | #define IGMPV3_MRC(value) IGMPV3_EXP(0x80, 4, 3, value) |
199 | 199 | ||
200 | extern int ip_check_mc(struct in_device *dev, u32 mc_addr, u32 src_addr, u16 proto); | 200 | extern int ip_check_mc(struct in_device *dev, __be32 mc_addr, __be32 src_addr, u16 proto); |
201 | extern int igmp_rcv(struct sk_buff *); | 201 | extern int igmp_rcv(struct sk_buff *); |
202 | extern int ip_mc_join_group(struct sock *sk, struct ip_mreqn *imr); | 202 | extern int ip_mc_join_group(struct sock *sk, struct ip_mreqn *imr); |
203 | extern int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr); | 203 | extern int ip_mc_leave_group(struct sock *sk, struct ip_mreqn *imr); |
@@ -209,13 +209,13 @@ extern int ip_mc_msfget(struct sock *sk, struct ip_msfilter *msf, | |||
209 | struct ip_msfilter __user *optval, int __user *optlen); | 209 | struct ip_msfilter __user *optval, int __user *optlen); |
210 | extern int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf, | 210 | extern int ip_mc_gsfget(struct sock *sk, struct group_filter *gsf, |
211 | struct group_filter __user *optval, int __user *optlen); | 211 | struct group_filter __user *optval, int __user *optlen); |
212 | extern int ip_mc_sf_allow(struct sock *sk, u32 local, u32 rmt, int dif); | 212 | extern int ip_mc_sf_allow(struct sock *sk, __be32 local, __be32 rmt, int dif); |
213 | extern void ip_mr_init(void); | 213 | extern void ip_mr_init(void); |
214 | extern void ip_mc_init_dev(struct in_device *); | 214 | extern void ip_mc_init_dev(struct in_device *); |
215 | extern void ip_mc_destroy_dev(struct in_device *); | 215 | extern void ip_mc_destroy_dev(struct in_device *); |
216 | extern void ip_mc_up(struct in_device *); | 216 | extern void ip_mc_up(struct in_device *); |
217 | extern void ip_mc_down(struct in_device *); | 217 | extern void ip_mc_down(struct in_device *); |
218 | extern void ip_mc_dec_group(struct in_device *in_dev, u32 addr); | 218 | extern void ip_mc_dec_group(struct in_device *in_dev, __be32 addr); |
219 | extern void ip_mc_inc_group(struct in_device *in_dev, u32 addr); | 219 | extern void ip_mc_inc_group(struct in_device *in_dev, __be32 addr); |
220 | #endif | 220 | #endif |
221 | #endif | 221 | #endif |
diff --git a/include/linux/in.h b/include/linux/in.h index bcaca8399aed..2619859f6e1b 100644 --- a/include/linux/in.h +++ b/include/linux/in.h | |||
@@ -40,6 +40,7 @@ enum { | |||
40 | 40 | ||
41 | IPPROTO_ESP = 50, /* Encapsulation Security Payload protocol */ | 41 | IPPROTO_ESP = 50, /* Encapsulation Security Payload protocol */ |
42 | IPPROTO_AH = 51, /* Authentication Header protocol */ | 42 | IPPROTO_AH = 51, /* Authentication Header protocol */ |
43 | IPPROTO_BEETPH = 94, /* IP option pseudo header for BEET */ | ||
43 | IPPROTO_PIM = 103, /* Protocol Independent Multicast */ | 44 | IPPROTO_PIM = 103, /* Protocol Independent Multicast */ |
44 | 45 | ||
45 | IPPROTO_COMP = 108, /* Compression Header protocol */ | 46 | IPPROTO_COMP = 108, /* Compression Header protocol */ |
@@ -123,17 +124,17 @@ struct ip_mreqn | |||
123 | }; | 124 | }; |
124 | 125 | ||
125 | struct ip_mreq_source { | 126 | struct ip_mreq_source { |
126 | __u32 imr_multiaddr; | 127 | __be32 imr_multiaddr; |
127 | __u32 imr_interface; | 128 | __be32 imr_interface; |
128 | __u32 imr_sourceaddr; | 129 | __be32 imr_sourceaddr; |
129 | }; | 130 | }; |
130 | 131 | ||
131 | struct ip_msfilter { | 132 | struct ip_msfilter { |
132 | __u32 imsf_multiaddr; | 133 | __be32 imsf_multiaddr; |
133 | __u32 imsf_interface; | 134 | __be32 imsf_interface; |
134 | __u32 imsf_fmode; | 135 | __u32 imsf_fmode; |
135 | __u32 imsf_numsrc; | 136 | __u32 imsf_numsrc; |
136 | __u32 imsf_slist[1]; | 137 | __be32 imsf_slist[1]; |
137 | }; | 138 | }; |
138 | 139 | ||
139 | #define IP_MSFILTER_SIZE(numsrc) \ | 140 | #define IP_MSFILTER_SIZE(numsrc) \ |
diff --git a/include/linux/in6.h b/include/linux/in6.h index d776829b443f..9be6a4756f0b 100644 --- a/include/linux/in6.h +++ b/include/linux/in6.h | |||
@@ -32,8 +32,8 @@ struct in6_addr | |||
32 | union | 32 | union |
33 | { | 33 | { |
34 | __u8 u6_addr8[16]; | 34 | __u8 u6_addr8[16]; |
35 | __u16 u6_addr16[8]; | 35 | __be16 u6_addr16[8]; |
36 | __u32 u6_addr32[4]; | 36 | __be32 u6_addr32[4]; |
37 | } in6_u; | 37 | } in6_u; |
38 | #define s6_addr in6_u.u6_addr8 | 38 | #define s6_addr in6_u.u6_addr8 |
39 | #define s6_addr16 in6_u.u6_addr16 | 39 | #define s6_addr16 in6_u.u6_addr16 |
@@ -53,7 +53,7 @@ extern const struct in6_addr in6addr_loopback; | |||
53 | 53 | ||
54 | struct sockaddr_in6 { | 54 | struct sockaddr_in6 { |
55 | unsigned short int sin6_family; /* AF_INET6 */ | 55 | unsigned short int sin6_family; /* AF_INET6 */ |
56 | __u16 sin6_port; /* Transport layer port # */ | 56 | __be16 sin6_port; /* Transport layer port # */ |
57 | __u32 sin6_flowinfo; /* IPv6 flow information */ | 57 | __u32 sin6_flowinfo; /* IPv6 flow information */ |
58 | struct in6_addr sin6_addr; /* IPv6 address */ | 58 | struct in6_addr sin6_addr; /* IPv6 address */ |
59 | __u32 sin6_scope_id; /* scope id (new in RFC2553) */ | 59 | __u32 sin6_scope_id; /* scope id (new in RFC2553) */ |
diff --git a/include/linux/inet_diag.h b/include/linux/inet_diag.h index a4606e5810e5..6e8bc548635a 100644 --- a/include/linux/inet_diag.h +++ b/include/linux/inet_diag.h | |||
@@ -9,10 +9,10 @@ | |||
9 | 9 | ||
10 | /* Socket identity */ | 10 | /* Socket identity */ |
11 | struct inet_diag_sockid { | 11 | struct inet_diag_sockid { |
12 | __u16 idiag_sport; | 12 | __be16 idiag_sport; |
13 | __u16 idiag_dport; | 13 | __be16 idiag_dport; |
14 | __u32 idiag_src[4]; | 14 | __be32 idiag_src[4]; |
15 | __u32 idiag_dst[4]; | 15 | __be32 idiag_dst[4]; |
16 | __u32 idiag_if; | 16 | __u32 idiag_if; |
17 | __u32 idiag_cookie[2]; | 17 | __u32 idiag_cookie[2]; |
18 | #define INET_DIAG_NOCOOKIE (~0U) | 18 | #define INET_DIAG_NOCOOKIE (~0U) |
@@ -67,7 +67,7 @@ struct inet_diag_hostcond { | |||
67 | __u8 family; | 67 | __u8 family; |
68 | __u8 prefix_len; | 68 | __u8 prefix_len; |
69 | int port; | 69 | int port; |
70 | __u32 addr[0]; | 70 | __be32 addr[0]; |
71 | }; | 71 | }; |
72 | 72 | ||
73 | /* Base info structure. It contains socket identity (addrs/ports/cookie) | 73 | /* Base info structure. It contains socket identity (addrs/ports/cookie) |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index 92297ff24e85..5a0ab04627bc 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -90,11 +90,11 @@ struct in_ifaddr | |||
90 | struct in_ifaddr *ifa_next; | 90 | struct in_ifaddr *ifa_next; |
91 | struct in_device *ifa_dev; | 91 | struct in_device *ifa_dev; |
92 | struct rcu_head rcu_head; | 92 | struct rcu_head rcu_head; |
93 | u32 ifa_local; | 93 | __be32 ifa_local; |
94 | u32 ifa_address; | 94 | __be32 ifa_address; |
95 | u32 ifa_mask; | 95 | __be32 ifa_mask; |
96 | u32 ifa_broadcast; | 96 | __be32 ifa_broadcast; |
97 | u32 ifa_anycast; | 97 | __be32 ifa_anycast; |
98 | unsigned char ifa_scope; | 98 | unsigned char ifa_scope; |
99 | unsigned char ifa_flags; | 99 | unsigned char ifa_flags; |
100 | unsigned char ifa_prefixlen; | 100 | unsigned char ifa_prefixlen; |
@@ -104,18 +104,18 @@ struct in_ifaddr | |||
104 | extern int register_inetaddr_notifier(struct notifier_block *nb); | 104 | extern int register_inetaddr_notifier(struct notifier_block *nb); |
105 | extern int unregister_inetaddr_notifier(struct notifier_block *nb); | 105 | extern int unregister_inetaddr_notifier(struct notifier_block *nb); |
106 | 106 | ||
107 | extern struct net_device *ip_dev_find(u32 addr); | 107 | extern struct net_device *ip_dev_find(__be32 addr); |
108 | extern int inet_addr_onlink(struct in_device *in_dev, u32 a, u32 b); | 108 | extern int inet_addr_onlink(struct in_device *in_dev, __be32 a, __be32 b); |
109 | extern int devinet_ioctl(unsigned int cmd, void __user *); | 109 | extern int devinet_ioctl(unsigned int cmd, void __user *); |
110 | extern void devinet_init(void); | 110 | extern void devinet_init(void); |
111 | extern struct in_device *inetdev_init(struct net_device *dev); | 111 | extern struct in_device *inetdev_init(struct net_device *dev); |
112 | extern struct in_device *inetdev_by_index(int); | 112 | extern struct in_device *inetdev_by_index(int); |
113 | extern u32 inet_select_addr(const struct net_device *dev, u32 dst, int scope); | 113 | extern __be32 inet_select_addr(const struct net_device *dev, __be32 dst, int scope); |
114 | extern u32 inet_confirm_addr(const struct net_device *dev, u32 dst, u32 local, int scope); | 114 | extern __be32 inet_confirm_addr(const struct net_device *dev, __be32 dst, __be32 local, int scope); |
115 | extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, u32 prefix, u32 mask); | 115 | extern struct in_ifaddr *inet_ifa_byprefix(struct in_device *in_dev, __be32 prefix, __be32 mask); |
116 | extern void inet_forward_change(void); | 116 | extern void inet_forward_change(void); |
117 | 117 | ||
118 | static __inline__ int inet_ifa_match(u32 addr, struct in_ifaddr *ifa) | 118 | static __inline__ int inet_ifa_match(__be32 addr, struct in_ifaddr *ifa) |
119 | { | 119 | { |
120 | return !((addr^ifa->ifa_address)&ifa->ifa_mask); | 120 | return !((addr^ifa->ifa_address)&ifa->ifa_mask); |
121 | } | 121 | } |
@@ -183,7 +183,7 @@ static inline void in_dev_put(struct in_device *idev) | |||
183 | 183 | ||
184 | #endif /* __KERNEL__ */ | 184 | #endif /* __KERNEL__ */ |
185 | 185 | ||
186 | static __inline__ __u32 inet_make_mask(int logmask) | 186 | static __inline__ __be32 inet_make_mask(int logmask) |
187 | { | 187 | { |
188 | if (logmask) | 188 | if (logmask) |
189 | return htonl(~((1<<(32-logmask))-1)); | 189 | return htonl(~((1<<(32-logmask))-1)); |
diff --git a/include/linux/init.h b/include/linux/init.h index 6667785dd1ff..e92b1455d7af 100644 --- a/include/linux/init.h +++ b/include/linux/init.h | |||
@@ -68,6 +68,7 @@ extern initcall_t __security_initcall_start[], __security_initcall_end[]; | |||
68 | 68 | ||
69 | /* Defined in init/main.c */ | 69 | /* Defined in init/main.c */ |
70 | extern char saved_command_line[]; | 70 | extern char saved_command_line[]; |
71 | extern unsigned int reset_devices; | ||
71 | 72 | ||
72 | /* used by init/main.c */ | 73 | /* used by init/main.c */ |
73 | extern void setup_arch(char **); | 74 | extern void setup_arch(char **); |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 60aac2cea0cf..33c5daacc743 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -4,7 +4,9 @@ | |||
4 | #include <linux/file.h> | 4 | #include <linux/file.h> |
5 | #include <linux/rcupdate.h> | 5 | #include <linux/rcupdate.h> |
6 | #include <linux/irqflags.h> | 6 | #include <linux/irqflags.h> |
7 | #include <linux/utsname.h> | ||
7 | #include <linux/lockdep.h> | 8 | #include <linux/lockdep.h> |
9 | #include <linux/ipc.h> | ||
8 | 10 | ||
9 | #define INIT_FDTABLE \ | 11 | #define INIT_FDTABLE \ |
10 | { \ | 12 | { \ |
@@ -68,6 +70,15 @@ | |||
68 | .session = 1, \ | 70 | .session = 1, \ |
69 | } | 71 | } |
70 | 72 | ||
73 | extern struct nsproxy init_nsproxy; | ||
74 | #define INIT_NSPROXY(nsproxy) { \ | ||
75 | .count = ATOMIC_INIT(1), \ | ||
76 | .nslock = SPIN_LOCK_UNLOCKED, \ | ||
77 | .uts_ns = &init_uts_ns, \ | ||
78 | .namespace = NULL, \ | ||
79 | INIT_IPC_NS(ipc_ns) \ | ||
80 | } | ||
81 | |||
71 | #define INIT_SIGHAND(sighand) { \ | 82 | #define INIT_SIGHAND(sighand) { \ |
72 | .count = ATOMIC_INIT(1), \ | 83 | .count = ATOMIC_INIT(1), \ |
73 | .action = { { { .sa_handler = NULL, } }, }, \ | 84 | .action = { { { .sa_handler = NULL, } }, }, \ |
@@ -117,6 +128,7 @@ extern struct group_info init_groups; | |||
117 | .files = &init_files, \ | 128 | .files = &init_files, \ |
118 | .signal = &init_signals, \ | 129 | .signal = &init_signals, \ |
119 | .sighand = &init_sighand, \ | 130 | .sighand = &init_sighand, \ |
131 | .nsproxy = &init_nsproxy, \ | ||
120 | .pending = { \ | 132 | .pending = { \ |
121 | .list = LIST_HEAD_INIT(tsk.pending.list), \ | 133 | .list = LIST_HEAD_INIT(tsk.pending.list), \ |
122 | .signal = {{0}}}, \ | 134 | .signal = {{0}}}, \ |
diff --git a/include/linux/input.h b/include/linux/input.h index b3253ab72ff7..5770105471dd 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -349,6 +349,9 @@ struct input_absinfo { | |||
349 | 349 | ||
350 | #define KEY_BATTERY 236 | 350 | #define KEY_BATTERY 236 |
351 | 351 | ||
352 | #define KEY_BLUETOOTH 237 | ||
353 | #define KEY_WLAN 238 | ||
354 | |||
352 | #define KEY_UNKNOWN 240 | 355 | #define KEY_UNKNOWN 240 |
353 | 356 | ||
354 | #define BTN_MISC 0x100 | 357 | #define BTN_MISC 0x100 |
@@ -645,6 +648,7 @@ struct input_absinfo { | |||
645 | #define BUS_USB 0x03 | 648 | #define BUS_USB 0x03 |
646 | #define BUS_HIL 0x04 | 649 | #define BUS_HIL 0x04 |
647 | #define BUS_BLUETOOTH 0x05 | 650 | #define BUS_BLUETOOTH 0x05 |
651 | #define BUS_VIRTUAL 0x06 | ||
648 | 652 | ||
649 | #define BUS_ISA 0x10 | 653 | #define BUS_ISA 0x10 |
650 | #define BUS_I8042 0x11 | 654 | #define BUS_I8042 0x11 |
@@ -667,98 +671,167 @@ struct input_absinfo { | |||
667 | 671 | ||
668 | /* | 672 | /* |
669 | * Structures used in ioctls to upload effects to a device | 673 | * Structures used in ioctls to upload effects to a device |
670 | * The first structures are not passed directly by using ioctls. | 674 | * They are pieces of a bigger structure (called ff_effect) |
671 | * They are sub-structures of the actually sent structure (called ff_effect) | 675 | */ |
676 | |||
677 | /* | ||
678 | * All duration values are expressed in ms. Values above 32767 ms (0x7fff) | ||
679 | * should not be used and have unspecified results. | ||
672 | */ | 680 | */ |
673 | 681 | ||
682 | /** | ||
683 | * struct ff_replay - defines scheduling of the effect | ||
684 | * @length: duration of the effect | ||
685 | * @delay: delay before effect should start playing | ||
686 | */ | ||
674 | struct ff_replay { | 687 | struct ff_replay { |
675 | __u16 length; /* Duration of an effect in ms. All other times are also expressed in ms */ | 688 | __u16 length; |
676 | __u16 delay; /* Time to wait before to start playing an effect */ | 689 | __u16 delay; |
677 | }; | 690 | }; |
678 | 691 | ||
692 | /** | ||
693 | * struct ff_trigger - defines what triggers the effect | ||
694 | * @button: number of the button triggering the effect | ||
695 | * @interval: controls how soon the effect can be re-triggered | ||
696 | */ | ||
679 | struct ff_trigger { | 697 | struct ff_trigger { |
680 | __u16 button; /* Number of button triggering an effect */ | 698 | __u16 button; |
681 | __u16 interval; /* Time to wait before an effect can be re-triggered (ms) */ | 699 | __u16 interval; |
682 | }; | 700 | }; |
683 | 701 | ||
702 | /** | ||
703 | * struct ff_envelope - generic effect envelope | ||
704 | * @attack_length: duration of the attack (ms) | ||
705 | * @attack_level: level at the beginning of the attack | ||
706 | * @fade_length: duration of fade (ms) | ||
707 | * @fade_level: level at the end of fade | ||
708 | * | ||
709 | * The @attack_level and @fade_level are absolute values; when applying | ||
710 | * envelope force-feedback core will convert to positive/negative | ||
711 | * value based on polarity of the default level of the effect. | ||
712 | * Valid range for the attack and fade levels is 0x0000 - 0x7fff | ||
713 | */ | ||
684 | struct ff_envelope { | 714 | struct ff_envelope { |
685 | __u16 attack_length; /* Duration of attack (ms) */ | 715 | __u16 attack_length; |
686 | __u16 attack_level; /* Level at beginning of attack */ | 716 | __u16 attack_level; |
687 | __u16 fade_length; /* Duration of fade (ms) */ | 717 | __u16 fade_length; |
688 | __u16 fade_level; /* Level at end of fade */ | 718 | __u16 fade_level; |
689 | }; | 719 | }; |
690 | 720 | ||
691 | /* FF_CONSTANT */ | 721 | /** |
722 | * struct ff_constant_effect - defines parameters of a constant effect | ||
723 | * @level: strength of the effect; may be negative | ||
724 | * @envelope: envelope data | ||
725 | */ | ||
692 | struct ff_constant_effect { | 726 | struct ff_constant_effect { |
693 | __s16 level; /* Strength of effect. Negative values are OK */ | 727 | __s16 level; |
694 | struct ff_envelope envelope; | 728 | struct ff_envelope envelope; |
695 | }; | 729 | }; |
696 | 730 | ||
697 | /* FF_RAMP */ | 731 | /** |
732 | * struct ff_ramp_effect - defines parameters of a ramp effect | ||
733 | * @start_level: beginning strength of the effect; may be negative | ||
734 | * @end_level: final strength of the effect; may be negative | ||
735 | * @envelope: envelope data | ||
736 | */ | ||
698 | struct ff_ramp_effect { | 737 | struct ff_ramp_effect { |
699 | __s16 start_level; | 738 | __s16 start_level; |
700 | __s16 end_level; | 739 | __s16 end_level; |
701 | struct ff_envelope envelope; | 740 | struct ff_envelope envelope; |
702 | }; | 741 | }; |
703 | 742 | ||
704 | /* FF_SPRING of FF_FRICTION */ | 743 | /** |
744 | * struct ff_condition_effect - defines a spring or friction effect | ||
745 | * @right_saturation: maximum level when joystick moved all way to the right | ||
746 | * @left_saturation: same for the left side | ||
747 | * @right_coeff: controls how fast the force grows when the joystick moves | ||
748 | * to the right | ||
749 | * @left_coeff: same for the left side | ||
750 | * @deadband: size of the dead zone, where no force is produced | ||
751 | * @center: position of the dead zone | ||
752 | */ | ||
705 | struct ff_condition_effect { | 753 | struct ff_condition_effect { |
706 | __u16 right_saturation; /* Max level when joystick is on the right */ | 754 | __u16 right_saturation; |
707 | __u16 left_saturation; /* Max level when joystick in on the left */ | 755 | __u16 left_saturation; |
708 | |||
709 | __s16 right_coeff; /* Indicates how fast the force grows when the | ||
710 | joystick moves to the right */ | ||
711 | __s16 left_coeff; /* Same for left side */ | ||
712 | 756 | ||
713 | __u16 deadband; /* Size of area where no force is produced */ | 757 | __s16 right_coeff; |
714 | __s16 center; /* Position of dead zone */ | 758 | __s16 left_coeff; |
715 | 759 | ||
760 | __u16 deadband; | ||
761 | __s16 center; | ||
716 | }; | 762 | }; |
717 | 763 | ||
718 | /* FF_PERIODIC */ | 764 | /** |
765 | * struct ff_periodic_effect - defines parameters of a periodic effect | ||
766 | * @waveform: kind of the effect (wave) | ||
767 | * @period: period of the wave (ms) | ||
768 | * @magnitude: peak value | ||
769 | * @offset: mean value of the wave (roughly) | ||
770 | * @phase: 'horizontal' shift | ||
771 | * @envelope: envelope data | ||
772 | * @custom_len: number of samples (FF_CUSTOM only) | ||
773 | * @custom_data: buffer of samples (FF_CUSTOM only) | ||
774 | * | ||
775 | * Known waveforms - FF_SQUARE, FF_TRIANGLE, FF_SINE, FF_SAW_UP, | ||
776 | * FF_SAW_DOWN, FF_CUSTOM. The exact syntax FF_CUSTOM is undefined | ||
777 | * for the time being as no driver supports it yet. | ||
778 | * | ||
779 | * Note: the data pointed by custom_data is copied by the driver. | ||
780 | * You can therefore dispose of the memory after the upload/update. | ||
781 | */ | ||
719 | struct ff_periodic_effect { | 782 | struct ff_periodic_effect { |
720 | __u16 waveform; /* Kind of wave (sine, square...) */ | 783 | __u16 waveform; |
721 | __u16 period; /* in ms */ | 784 | __u16 period; |
722 | __s16 magnitude; /* Peak value */ | 785 | __s16 magnitude; |
723 | __s16 offset; /* Mean value of wave (roughly) */ | 786 | __s16 offset; |
724 | __u16 phase; /* 'Horizontal' shift */ | 787 | __u16 phase; |
725 | 788 | ||
726 | struct ff_envelope envelope; | 789 | struct ff_envelope envelope; |
727 | 790 | ||
728 | /* Only used if waveform == FF_CUSTOM */ | 791 | __u32 custom_len; |
729 | __u32 custom_len; /* Number of samples */ | 792 | __s16 *custom_data; |
730 | __s16 *custom_data; /* Buffer of samples */ | ||
731 | /* Note: the data pointed by custom_data is copied by the driver. You can | ||
732 | * therefore dispose of the memory after the upload/update */ | ||
733 | }; | 793 | }; |
734 | 794 | ||
735 | /* FF_RUMBLE */ | 795 | /** |
736 | /* Some rumble pads have two motors of different weight. | 796 | * struct ff_rumble_effect - defines parameters of a periodic effect |
737 | strong_magnitude represents the magnitude of the vibration generated | 797 | * @strong_magnitude: magnitude of the heavy motor |
738 | by the heavy motor. | 798 | * @weak_magnitude: magnitude of the light one |
739 | */ | 799 | * |
800 | * Some rumble pads have two motors of different weight. Strong_magnitude | ||
801 | * represents the magnitude of the vibration generated by the heavy one. | ||
802 | */ | ||
740 | struct ff_rumble_effect { | 803 | struct ff_rumble_effect { |
741 | __u16 strong_magnitude; /* Magnitude of the heavy motor */ | 804 | __u16 strong_magnitude; |
742 | __u16 weak_magnitude; /* Magnitude of the light one */ | 805 | __u16 weak_magnitude; |
743 | }; | 806 | }; |
744 | 807 | ||
745 | /* | 808 | /** |
746 | * Structure sent through ioctl from the application to the driver | 809 | * struct ff_effect - defines force feedback effect |
810 | * @type: type of the effect (FF_CONSTANT, FF_PERIODIC, FF_RAMP, FF_SPRING, | ||
811 | * FF_FRICTION, FF_DAMPER, FF_RUMBLE, FF_INERTIA, or FF_CUSTOM) | ||
812 | * @id: an unique id assigned to an effect | ||
813 | * @direction: direction of the effect | ||
814 | * @trigger: trigger conditions (struct ff_trigger) | ||
815 | * @replay: scheduling of the effect (struct ff_replay) | ||
816 | * @u: effect-specific structure (one of ff_constant_effect, ff_ramp_effect, | ||
817 | * ff_periodic_effect, ff_condition_effect, ff_rumble_effect) further | ||
818 | * defining effect parameters | ||
819 | * | ||
820 | * This structure is sent through ioctl from the application to the driver. | ||
821 | * To create a new effect aplication should set its @id to -1; the kernel | ||
822 | * will return assigned @id which can later be used to update or delete | ||
823 | * this effect. | ||
824 | * | ||
825 | * Direction of the effect is encoded as follows: | ||
826 | * 0 deg -> 0x0000 (down) | ||
827 | * 90 deg -> 0x4000 (left) | ||
828 | * 180 deg -> 0x8000 (up) | ||
829 | * 270 deg -> 0xC000 (right) | ||
747 | */ | 830 | */ |
748 | struct ff_effect { | 831 | struct ff_effect { |
749 | __u16 type; | 832 | __u16 type; |
750 | /* Following field denotes the unique id assigned to an effect. | ||
751 | * If user sets if to -1, a new effect is created, and its id is returned in the same field | ||
752 | * Else, the user sets it to the effect id it wants to update. | ||
753 | */ | ||
754 | __s16 id; | 833 | __s16 id; |
755 | 834 | __u16 direction; | |
756 | __u16 direction; /* Direction. 0 deg -> 0x0000 (down) | ||
757 | 90 deg -> 0x4000 (left) | ||
758 | 180 deg -> 0x8000 (up) | ||
759 | 270 deg -> 0xC000 (right) | ||
760 | */ | ||
761 | |||
762 | struct ff_trigger trigger; | 835 | struct ff_trigger trigger; |
763 | struct ff_replay replay; | 836 | struct ff_replay replay; |
764 | 837 | ||
@@ -784,6 +857,9 @@ struct ff_effect { | |||
784 | #define FF_INERTIA 0x56 | 857 | #define FF_INERTIA 0x56 |
785 | #define FF_RAMP 0x57 | 858 | #define FF_RAMP 0x57 |
786 | 859 | ||
860 | #define FF_EFFECT_MIN FF_RUMBLE | ||
861 | #define FF_EFFECT_MAX FF_RAMP | ||
862 | |||
787 | /* | 863 | /* |
788 | * Force feedback periodic effect types | 864 | * Force feedback periodic effect types |
789 | */ | 865 | */ |
@@ -795,6 +871,9 @@ struct ff_effect { | |||
795 | #define FF_SAW_DOWN 0x5c | 871 | #define FF_SAW_DOWN 0x5c |
796 | #define FF_CUSTOM 0x5d | 872 | #define FF_CUSTOM 0x5d |
797 | 873 | ||
874 | #define FF_WAVEFORM_MIN FF_SQUARE | ||
875 | #define FF_WAVEFORM_MAX FF_CUSTOM | ||
876 | |||
798 | /* | 877 | /* |
799 | * Set ff device properties | 878 | * Set ff device properties |
800 | */ | 879 | */ |
@@ -864,12 +943,13 @@ struct input_dev { | |||
864 | unsigned long sndbit[NBITS(SND_MAX)]; | 943 | unsigned long sndbit[NBITS(SND_MAX)]; |
865 | unsigned long ffbit[NBITS(FF_MAX)]; | 944 | unsigned long ffbit[NBITS(FF_MAX)]; |
866 | unsigned long swbit[NBITS(SW_MAX)]; | 945 | unsigned long swbit[NBITS(SW_MAX)]; |
867 | int ff_effects_max; | ||
868 | 946 | ||
869 | unsigned int keycodemax; | 947 | unsigned int keycodemax; |
870 | unsigned int keycodesize; | 948 | unsigned int keycodesize; |
871 | void *keycode; | 949 | void *keycode; |
872 | 950 | ||
951 | struct ff_device *ff; | ||
952 | |||
873 | unsigned int repeat_key; | 953 | unsigned int repeat_key; |
874 | struct timer_list timer; | 954 | struct timer_list timer; |
875 | 955 | ||
@@ -895,8 +975,6 @@ struct input_dev { | |||
895 | void (*close)(struct input_dev *dev); | 975 | void (*close)(struct input_dev *dev); |
896 | int (*flush)(struct input_dev *dev, struct file *file); | 976 | int (*flush)(struct input_dev *dev, struct file *file); |
897 | int (*event)(struct input_dev *dev, unsigned int type, unsigned int code, int value); | 977 | int (*event)(struct input_dev *dev, unsigned int type, unsigned int code, int value); |
898 | int (*upload_effect)(struct input_dev *dev, struct ff_effect *effect); | ||
899 | int (*erase_effect)(struct input_dev *dev, int effect_id); | ||
900 | 978 | ||
901 | struct input_handle *grab; | 979 | struct input_handle *grab; |
902 | 980 | ||
@@ -904,9 +982,6 @@ struct input_dev { | |||
904 | unsigned int users; | 982 | unsigned int users; |
905 | 983 | ||
906 | struct class_device cdev; | 984 | struct class_device cdev; |
907 | struct device *dev; /* will be removed soon */ | ||
908 | |||
909 | int dynalloc; /* temporarily */ | ||
910 | 985 | ||
911 | struct list_head h_list; | 986 | struct list_head h_list; |
912 | struct list_head node; | 987 | struct list_head node; |
@@ -985,16 +1060,16 @@ struct input_handler { | |||
985 | void *private; | 1060 | void *private; |
986 | 1061 | ||
987 | void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value); | 1062 | void (*event)(struct input_handle *handle, unsigned int type, unsigned int code, int value); |
988 | struct input_handle* (*connect)(struct input_handler *handler, struct input_dev *dev, struct input_device_id *id); | 1063 | struct input_handle* (*connect)(struct input_handler *handler, struct input_dev *dev, const struct input_device_id *id); |
989 | void (*disconnect)(struct input_handle *handle); | 1064 | void (*disconnect)(struct input_handle *handle); |
990 | void (*start)(struct input_handle *handle); | 1065 | void (*start)(struct input_handle *handle); |
991 | 1066 | ||
992 | const struct file_operations *fops; | 1067 | const struct file_operations *fops; |
993 | int minor; | 1068 | int minor; |
994 | char *name; | 1069 | const char *name; |
995 | 1070 | ||
996 | struct input_device_id *id_table; | 1071 | const struct input_device_id *id_table; |
997 | struct input_device_id *blacklist; | 1072 | const struct input_device_id *blacklist; |
998 | 1073 | ||
999 | struct list_head h_list; | 1074 | struct list_head h_list; |
1000 | struct list_head node; | 1075 | struct list_head node; |
@@ -1005,7 +1080,7 @@ struct input_handle { | |||
1005 | void *private; | 1080 | void *private; |
1006 | 1081 | ||
1007 | int open; | 1082 | int open; |
1008 | char *name; | 1083 | const char *name; |
1009 | 1084 | ||
1010 | struct input_dev *dev; | 1085 | struct input_dev *dev; |
1011 | struct input_handler *handler; | 1086 | struct input_handler *handler; |
@@ -1019,12 +1094,6 @@ struct input_handle { | |||
1019 | #define to_handle(n) container_of(n,struct input_handle,d_node) | 1094 | #define to_handle(n) container_of(n,struct input_handle,d_node) |
1020 | #define to_handle_h(n) container_of(n,struct input_handle,h_node) | 1095 | #define to_handle_h(n) container_of(n,struct input_handle,h_node) |
1021 | 1096 | ||
1022 | static inline void init_input_dev(struct input_dev *dev) | ||
1023 | { | ||
1024 | INIT_LIST_HEAD(&dev->h_list); | ||
1025 | INIT_LIST_HEAD(&dev->node); | ||
1026 | } | ||
1027 | |||
1028 | struct input_dev *input_allocate_device(void); | 1097 | struct input_dev *input_allocate_device(void); |
1029 | void input_free_device(struct input_dev *dev); | 1098 | void input_free_device(struct input_dev *dev); |
1030 | 1099 | ||
@@ -1041,7 +1110,7 @@ static inline void input_put_device(struct input_dev *dev) | |||
1041 | int input_register_device(struct input_dev *); | 1110 | int input_register_device(struct input_dev *); |
1042 | void input_unregister_device(struct input_dev *); | 1111 | void input_unregister_device(struct input_dev *); |
1043 | 1112 | ||
1044 | void input_register_handler(struct input_handler *); | 1113 | int input_register_handler(struct input_handler *); |
1045 | void input_unregister_handler(struct input_handler *); | 1114 | void input_unregister_handler(struct input_handler *); |
1046 | 1115 | ||
1047 | int input_grab_device(struct input_handle *); | 1116 | int input_grab_device(struct input_handle *); |
@@ -1070,11 +1139,6 @@ static inline void input_report_abs(struct input_dev *dev, unsigned int code, in | |||
1070 | input_event(dev, EV_ABS, code, value); | 1139 | input_event(dev, EV_ABS, code, value); |
1071 | } | 1140 | } |
1072 | 1141 | ||
1073 | static inline void input_report_ff(struct input_dev *dev, unsigned int code, int value) | ||
1074 | { | ||
1075 | input_event(dev, EV_FF, code, value); | ||
1076 | } | ||
1077 | |||
1078 | static inline void input_report_ff_status(struct input_dev *dev, unsigned int code, int value) | 1142 | static inline void input_report_ff_status(struct input_dev *dev, unsigned int code, int value) |
1079 | { | 1143 | { |
1080 | input_event(dev, EV_FF_STATUS, code, value); | 1144 | input_event(dev, EV_FF_STATUS, code, value); |
@@ -1108,5 +1172,61 @@ static inline void input_set_abs_params(struct input_dev *dev, int axis, int min | |||
1108 | 1172 | ||
1109 | extern struct class input_class; | 1173 | extern struct class input_class; |
1110 | 1174 | ||
1175 | /** | ||
1176 | * struct ff_device - force-feedback part of an input device | ||
1177 | * @upload: Called to upload an new effect into device | ||
1178 | * @erase: Called to erase an effect from device | ||
1179 | * @playback: Called to request device to start playing specified effect | ||
1180 | * @set_gain: Called to set specified gain | ||
1181 | * @set_autocenter: Called to auto-center device | ||
1182 | * @destroy: called by input core when parent input device is being | ||
1183 | * destroyed | ||
1184 | * @private: driver-specific data, will be freed automatically | ||
1185 | * @ffbit: bitmap of force feedback capabilities truly supported by | ||
1186 | * device (not emulated like ones in input_dev->ffbit) | ||
1187 | * @mutex: mutex for serializing access to the device | ||
1188 | * @max_effects: maximum number of effects supported by device | ||
1189 | * @effects: pointer to an array of effects currently loaded into device | ||
1190 | * @effect_owners: array of effect owners; when file handle owning | ||
1191 | * an effect gets closed the effcet is automatically erased | ||
1192 | * | ||
1193 | * Every force-feedback device must implement upload() and playback() | ||
1194 | * methods; erase() is optional. set_gain() and set_autocenter() need | ||
1195 | * only be implemented if driver sets up FF_GAIN and FF_AUTOCENTER | ||
1196 | * bits. | ||
1197 | */ | ||
1198 | struct ff_device { | ||
1199 | int (*upload)(struct input_dev *dev, struct ff_effect *effect, | ||
1200 | struct ff_effect *old); | ||
1201 | int (*erase)(struct input_dev *dev, int effect_id); | ||
1202 | |||
1203 | int (*playback)(struct input_dev *dev, int effect_id, int value); | ||
1204 | void (*set_gain)(struct input_dev *dev, u16 gain); | ||
1205 | void (*set_autocenter)(struct input_dev *dev, u16 magnitude); | ||
1206 | |||
1207 | void (*destroy)(struct ff_device *); | ||
1208 | |||
1209 | void *private; | ||
1210 | |||
1211 | unsigned long ffbit[NBITS(FF_MAX)]; | ||
1212 | |||
1213 | struct mutex mutex; | ||
1214 | |||
1215 | int max_effects; | ||
1216 | struct ff_effect *effects; | ||
1217 | struct file *effect_owners[]; | ||
1218 | }; | ||
1219 | |||
1220 | int input_ff_create(struct input_dev *dev, int max_effects); | ||
1221 | void input_ff_destroy(struct input_dev *dev); | ||
1222 | |||
1223 | int input_ff_event(struct input_dev *dev, unsigned int type, unsigned int code, int value); | ||
1224 | |||
1225 | int input_ff_upload(struct input_dev *dev, struct ff_effect *effect, struct file *file); | ||
1226 | int input_ff_erase(struct input_dev *dev, int effect_id, struct file *file); | ||
1227 | |||
1228 | int input_ff_create_memless(struct input_dev *dev, void *data, | ||
1229 | int (*play_effect)(struct input_dev *, void *, struct ff_effect *)); | ||
1230 | |||
1111 | #endif | 1231 | #endif |
1112 | #endif | 1232 | #endif |
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index d5afee95fd43..1f97e3d92639 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -123,6 +123,14 @@ static inline void disable_irq_nosync_lockdep(unsigned int irq) | |||
123 | #endif | 123 | #endif |
124 | } | 124 | } |
125 | 125 | ||
126 | static inline void disable_irq_nosync_lockdep_irqsave(unsigned int irq, unsigned long *flags) | ||
127 | { | ||
128 | disable_irq_nosync(irq); | ||
129 | #ifdef CONFIG_LOCKDEP | ||
130 | local_irq_save(*flags); | ||
131 | #endif | ||
132 | } | ||
133 | |||
126 | static inline void disable_irq_lockdep(unsigned int irq) | 134 | static inline void disable_irq_lockdep(unsigned int irq) |
127 | { | 135 | { |
128 | disable_irq(irq); | 136 | disable_irq(irq); |
@@ -139,6 +147,14 @@ static inline void enable_irq_lockdep(unsigned int irq) | |||
139 | enable_irq(irq); | 147 | enable_irq(irq); |
140 | } | 148 | } |
141 | 149 | ||
150 | static inline void enable_irq_lockdep_irqrestore(unsigned int irq, unsigned long *flags) | ||
151 | { | ||
152 | #ifdef CONFIG_LOCKDEP | ||
153 | local_irq_restore(*flags); | ||
154 | #endif | ||
155 | enable_irq(irq); | ||
156 | } | ||
157 | |||
142 | /* IRQ wakeup (PM) control: */ | 158 | /* IRQ wakeup (PM) control: */ |
143 | extern int set_irq_wake(unsigned int irq, unsigned int on); | 159 | extern int set_irq_wake(unsigned int irq, unsigned int on); |
144 | 160 | ||
diff --git a/include/linux/io.h b/include/linux/io.h index 420e2fdf26f6..aa3f5af670b5 100644 --- a/include/linux/io.h +++ b/include/linux/io.h | |||
@@ -19,8 +19,12 @@ | |||
19 | #define _LINUX_IO_H | 19 | #define _LINUX_IO_H |
20 | 20 | ||
21 | #include <asm/io.h> | 21 | #include <asm/io.h> |
22 | #include <asm/page.h> | ||
22 | 23 | ||
23 | void __iowrite32_copy(void __iomem *to, const void *from, size_t count); | 24 | void __iowrite32_copy(void __iomem *to, const void *from, size_t count); |
24 | void __iowrite64_copy(void __iomem *to, const void *from, size_t count); | 25 | void __iowrite64_copy(void __iomem *to, const void *from, size_t count); |
25 | 26 | ||
27 | int ioremap_page_range(unsigned long addr, unsigned long end, | ||
28 | unsigned long phys_addr, pgprot_t prot); | ||
29 | |||
26 | #endif /* _LINUX_IO_H */ | 30 | #endif /* _LINUX_IO_H */ |
diff --git a/include/linux/ip.h b/include/linux/ip.h index 2f4600146f83..ecee9bb27d0e 100644 --- a/include/linux/ip.h +++ b/include/linux/ip.h | |||
@@ -80,6 +80,8 @@ | |||
80 | #define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */ | 80 | #define IPOPT_TS_TSANDADDR 1 /* timestamps and addresses */ |
81 | #define IPOPT_TS_PRESPEC 3 /* specified modules only */ | 81 | #define IPOPT_TS_PRESPEC 3 /* specified modules only */ |
82 | 82 | ||
83 | #define IPV4_BEET_PHMAXLEN 8 | ||
84 | |||
83 | struct iphdr { | 85 | struct iphdr { |
84 | #if defined(__LITTLE_ENDIAN_BITFIELD) | 86 | #if defined(__LITTLE_ENDIAN_BITFIELD) |
85 | __u8 ihl:4, | 87 | __u8 ihl:4, |
@@ -96,7 +98,7 @@ struct iphdr { | |||
96 | __be16 frag_off; | 98 | __be16 frag_off; |
97 | __u8 ttl; | 99 | __u8 ttl; |
98 | __u8 protocol; | 100 | __u8 protocol; |
99 | __u16 check; | 101 | __be16 check; |
100 | __be32 saddr; | 102 | __be32 saddr; |
101 | __be32 daddr; | 103 | __be32 daddr; |
102 | /*The options start here. */ | 104 | /*The options start here. */ |
@@ -105,22 +107,29 @@ struct iphdr { | |||
105 | struct ip_auth_hdr { | 107 | struct ip_auth_hdr { |
106 | __u8 nexthdr; | 108 | __u8 nexthdr; |
107 | __u8 hdrlen; /* This one is measured in 32 bit units! */ | 109 | __u8 hdrlen; /* This one is measured in 32 bit units! */ |
108 | __u16 reserved; | 110 | __be16 reserved; |
109 | __u32 spi; | 111 | __be32 spi; |
110 | __u32 seq_no; /* Sequence number */ | 112 | __be32 seq_no; /* Sequence number */ |
111 | __u8 auth_data[0]; /* Variable len but >=4. Mind the 64 bit alignment! */ | 113 | __u8 auth_data[0]; /* Variable len but >=4. Mind the 64 bit alignment! */ |
112 | }; | 114 | }; |
113 | 115 | ||
114 | struct ip_esp_hdr { | 116 | struct ip_esp_hdr { |
115 | __u32 spi; | 117 | __be32 spi; |
116 | __u32 seq_no; /* Sequence number */ | 118 | __be32 seq_no; /* Sequence number */ |
117 | __u8 enc_data[0]; /* Variable len but >=8. Mind the 64 bit alignment! */ | 119 | __u8 enc_data[0]; /* Variable len but >=8. Mind the 64 bit alignment! */ |
118 | }; | 120 | }; |
119 | 121 | ||
120 | struct ip_comp_hdr { | 122 | struct ip_comp_hdr { |
121 | __u8 nexthdr; | 123 | __u8 nexthdr; |
122 | __u8 flags; | 124 | __u8 flags; |
123 | __u16 cpi; | 125 | __be16 cpi; |
126 | }; | ||
127 | |||
128 | struct ip_beet_phdr { | ||
129 | __u8 nexthdr; | ||
130 | __u8 hdrlen; | ||
131 | __u8 padlen; | ||
132 | __u8 reserved; | ||
124 | }; | 133 | }; |
125 | 134 | ||
126 | #endif /* _LINUX_IP_H */ | 135 | #endif /* _LINUX_IP_H */ |
diff --git a/include/linux/ipc.h b/include/linux/ipc.h index b291189737e7..636094c29b16 100644 --- a/include/linux/ipc.h +++ b/include/linux/ipc.h | |||
@@ -51,6 +51,8 @@ struct ipc_perm | |||
51 | 51 | ||
52 | #ifdef __KERNEL__ | 52 | #ifdef __KERNEL__ |
53 | 53 | ||
54 | #include <linux/kref.h> | ||
55 | |||
54 | #define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */ | 56 | #define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */ |
55 | 57 | ||
56 | /* used by in-kernel data structures */ | 58 | /* used by in-kernel data structures */ |
@@ -68,6 +70,59 @@ struct kern_ipc_perm | |||
68 | void *security; | 70 | void *security; |
69 | }; | 71 | }; |
70 | 72 | ||
73 | struct ipc_ids; | ||
74 | struct ipc_namespace { | ||
75 | struct kref kref; | ||
76 | struct ipc_ids *ids[3]; | ||
77 | |||
78 | int sem_ctls[4]; | ||
79 | int used_sems; | ||
80 | |||
81 | int msg_ctlmax; | ||
82 | int msg_ctlmnb; | ||
83 | int msg_ctlmni; | ||
84 | |||
85 | size_t shm_ctlmax; | ||
86 | size_t shm_ctlall; | ||
87 | int shm_ctlmni; | ||
88 | int shm_tot; | ||
89 | }; | ||
90 | |||
91 | extern struct ipc_namespace init_ipc_ns; | ||
92 | |||
93 | #ifdef CONFIG_SYSVIPC | ||
94 | #define INIT_IPC_NS(ns) .ns = &init_ipc_ns, | ||
95 | #else | ||
96 | #define INIT_IPC_NS(ns) | ||
97 | #endif | ||
98 | |||
99 | #ifdef CONFIG_IPC_NS | ||
100 | extern void free_ipc_ns(struct kref *kref); | ||
101 | extern int copy_ipcs(unsigned long flags, struct task_struct *tsk); | ||
102 | extern int unshare_ipcs(unsigned long flags, struct ipc_namespace **ns); | ||
103 | #else | ||
104 | static inline int copy_ipcs(unsigned long flags, struct task_struct *tsk) | ||
105 | { | ||
106 | return 0; | ||
107 | } | ||
108 | #endif | ||
109 | |||
110 | static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) | ||
111 | { | ||
112 | #ifdef CONFIG_IPC_NS | ||
113 | if (ns) | ||
114 | kref_get(&ns->kref); | ||
115 | #endif | ||
116 | return ns; | ||
117 | } | ||
118 | |||
119 | static inline void put_ipc_ns(struct ipc_namespace *ns) | ||
120 | { | ||
121 | #ifdef CONFIG_IPC_NS | ||
122 | kref_put(&ns->kref, free_ipc_ns); | ||
123 | #endif | ||
124 | } | ||
125 | |||
71 | #endif /* __KERNEL__ */ | 126 | #endif /* __KERNEL__ */ |
72 | 127 | ||
73 | #endif /* _LINUX_IPC_H */ | 128 | #endif /* _LINUX_IPC_H */ |
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h index d09fbeabf1dc..796ca009fd46 100644 --- a/include/linux/ipmi.h +++ b/include/linux/ipmi.h | |||
@@ -148,6 +148,13 @@ struct ipmi_lan_addr | |||
148 | #define IPMI_BMC_CHANNEL 0xf | 148 | #define IPMI_BMC_CHANNEL 0xf |
149 | #define IPMI_NUM_CHANNELS 0x10 | 149 | #define IPMI_NUM_CHANNELS 0x10 |
150 | 150 | ||
151 | /* | ||
152 | * Used to signify an "all channel" bitmask. This is more than the | ||
153 | * actual number of channels because this is used in userland and | ||
154 | * will cover us if the number of channels is extended. | ||
155 | */ | ||
156 | #define IPMI_CHAN_ALL (~0) | ||
157 | |||
151 | 158 | ||
152 | /* | 159 | /* |
153 | * A raw IPMI message without any addressing. This covers both | 160 | * A raw IPMI message without any addressing. This covers both |
@@ -350,18 +357,21 @@ int ipmi_request_supply_msgs(ipmi_user_t user, | |||
350 | 357 | ||
351 | /* | 358 | /* |
352 | * When commands come in to the SMS, the user can register to receive | 359 | * When commands come in to the SMS, the user can register to receive |
353 | * them. Only one user can be listening on a specific netfn/cmd pair | 360 | * them. Only one user can be listening on a specific netfn/cmd/chan tuple |
354 | * at a time, you will get an EBUSY error if the command is already | 361 | * at a time, you will get an EBUSY error if the command is already |
355 | * registered. If a command is received that does not have a user | 362 | * registered. If a command is received that does not have a user |
356 | * registered, the driver will automatically return the proper | 363 | * registered, the driver will automatically return the proper |
357 | * error. | 364 | * error. Channels are specified as a bitfield, use IPMI_CHAN_ALL to |
365 | * mean all channels. | ||
358 | */ | 366 | */ |
359 | int ipmi_register_for_cmd(ipmi_user_t user, | 367 | int ipmi_register_for_cmd(ipmi_user_t user, |
360 | unsigned char netfn, | 368 | unsigned char netfn, |
361 | unsigned char cmd); | 369 | unsigned char cmd, |
370 | unsigned int chans); | ||
362 | int ipmi_unregister_for_cmd(ipmi_user_t user, | 371 | int ipmi_unregister_for_cmd(ipmi_user_t user, |
363 | unsigned char netfn, | 372 | unsigned char netfn, |
364 | unsigned char cmd); | 373 | unsigned char cmd, |
374 | unsigned int chans); | ||
365 | 375 | ||
366 | /* | 376 | /* |
367 | * Allow run-to-completion mode to be set for the interface of | 377 | * Allow run-to-completion mode to be set for the interface of |
@@ -571,6 +581,36 @@ struct ipmi_cmdspec | |||
571 | #define IPMICTL_UNREGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 15, \ | 581 | #define IPMICTL_UNREGISTER_FOR_CMD _IOR(IPMI_IOC_MAGIC, 15, \ |
572 | struct ipmi_cmdspec) | 582 | struct ipmi_cmdspec) |
573 | 583 | ||
584 | /* | ||
585 | * Register to get commands from other entities on specific channels. | ||
586 | * This way, you can only listen on specific channels, or have messages | ||
587 | * from some channels go to one place and other channels to someplace | ||
588 | * else. The chans field is a bitmask, (1 << channel) for each channel. | ||
589 | * It may be IPMI_CHAN_ALL for all channels. | ||
590 | */ | ||
591 | struct ipmi_cmdspec_chans | ||
592 | { | ||
593 | unsigned int netfn; | ||
594 | unsigned int cmd; | ||
595 | unsigned int chans; | ||
596 | }; | ||
597 | |||
598 | /* | ||
599 | * Register to receive a specific command on specific channels. error values: | ||
600 | * - EFAULT - an address supplied was invalid. | ||
601 | * - EBUSY - One of the netfn/cmd/chans supplied was already in use. | ||
602 | * - ENOMEM - could not allocate memory for the entry. | ||
603 | */ | ||
604 | #define IPMICTL_REGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 28, \ | ||
605 | struct ipmi_cmdspec_chans) | ||
606 | /* | ||
607 | * Unregister some netfn/cmd/chans. error values: | ||
608 | * - EFAULT - an address supplied was invalid. | ||
609 | * - ENOENT - None of the netfn/cmd/chans were found registered for this user. | ||
610 | */ | ||
611 | #define IPMICTL_UNREGISTER_FOR_CMD_CHANS _IOR(IPMI_IOC_MAGIC, 29, \ | ||
612 | struct ipmi_cmdspec_chans) | ||
613 | |||
574 | /* | 614 | /* |
575 | * Set whether this interface receives events. Note that the first | 615 | * Set whether this interface receives events. Note that the first |
576 | * user registered for events will get all pending events for the | 616 | * user registered for events will get all pending events for the |
diff --git a/include/linux/ipsec.h b/include/linux/ipsec.h index d3c527616b5e..d17a6302a0e9 100644 --- a/include/linux/ipsec.h +++ b/include/linux/ipsec.h | |||
@@ -12,7 +12,8 @@ | |||
12 | enum { | 12 | enum { |
13 | IPSEC_MODE_ANY = 0, /* We do not support this for SA */ | 13 | IPSEC_MODE_ANY = 0, /* We do not support this for SA */ |
14 | IPSEC_MODE_TRANSPORT = 1, | 14 | IPSEC_MODE_TRANSPORT = 1, |
15 | IPSEC_MODE_TUNNEL = 2 | 15 | IPSEC_MODE_TUNNEL = 2, |
16 | IPSEC_MODE_BEET = 3 | ||
16 | }; | 17 | }; |
17 | 18 | ||
18 | enum { | 19 | enum { |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index caca57df0d7d..4f435c59de06 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -99,22 +99,22 @@ struct ipv6_destopt_hao { | |||
99 | struct ipv6_auth_hdr { | 99 | struct ipv6_auth_hdr { |
100 | __u8 nexthdr; | 100 | __u8 nexthdr; |
101 | __u8 hdrlen; /* This one is measured in 32 bit units! */ | 101 | __u8 hdrlen; /* This one is measured in 32 bit units! */ |
102 | __u16 reserved; | 102 | __be16 reserved; |
103 | __u32 spi; | 103 | __be32 spi; |
104 | __u32 seq_no; /* Sequence number */ | 104 | __be32 seq_no; /* Sequence number */ |
105 | __u8 auth_data[0]; /* Length variable but >=4. Mind the 64 bit alignment! */ | 105 | __u8 auth_data[0]; /* Length variable but >=4. Mind the 64 bit alignment! */ |
106 | }; | 106 | }; |
107 | 107 | ||
108 | struct ipv6_esp_hdr { | 108 | struct ipv6_esp_hdr { |
109 | __u32 spi; | 109 | __be32 spi; |
110 | __u32 seq_no; /* Sequence number */ | 110 | __be32 seq_no; /* Sequence number */ |
111 | __u8 enc_data[0]; /* Length variable but >=8. Mind the 64 bit alignment! */ | 111 | __u8 enc_data[0]; /* Length variable but >=8. Mind the 64 bit alignment! */ |
112 | }; | 112 | }; |
113 | 113 | ||
114 | struct ipv6_comp_hdr { | 114 | struct ipv6_comp_hdr { |
115 | __u8 nexthdr; | 115 | __u8 nexthdr; |
116 | __u8 flags; | 116 | __u8 flags; |
117 | __u16 cpi; | 117 | __be16 cpi; |
118 | }; | 118 | }; |
119 | 119 | ||
120 | /* | 120 | /* |
@@ -136,7 +136,7 @@ struct ipv6hdr { | |||
136 | #endif | 136 | #endif |
137 | __u8 flow_lbl[3]; | 137 | __u8 flow_lbl[3]; |
138 | 138 | ||
139 | __u16 payload_len; | 139 | __be16 payload_len; |
140 | __u8 nexthdr; | 140 | __u8 nexthdr; |
141 | __u8 hop_limit; | 141 | __u8 hop_limit; |
142 | 142 | ||
@@ -461,7 +461,7 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk) | |||
461 | 461 | ||
462 | #define INET6_MATCH(__sk, __hash, __saddr, __daddr, __ports, __dif)\ | 462 | #define INET6_MATCH(__sk, __hash, __saddr, __daddr, __ports, __dif)\ |
463 | (((__sk)->sk_hash == (__hash)) && \ | 463 | (((__sk)->sk_hash == (__hash)) && \ |
464 | ((*((__u32 *)&(inet_sk(__sk)->dport))) == (__ports)) && \ | 464 | ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ |
465 | ((__sk)->sk_family == AF_INET6) && \ | 465 | ((__sk)->sk_family == AF_INET6) && \ |
466 | ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ | 466 | ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ |
467 | ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ | 467 | ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ |
diff --git a/include/linux/irq.h b/include/linux/irq.h index 48d3cb3b6a47..6f463606c318 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -59,6 +59,7 @@ | |||
59 | #define IRQ_NOAUTOEN 0x08000000 /* IRQ will not be enabled on request irq */ | 59 | #define IRQ_NOAUTOEN 0x08000000 /* IRQ will not be enabled on request irq */ |
60 | #define IRQ_DELAYED_DISABLE 0x10000000 /* IRQ disable (masking) happens delayed. */ | 60 | #define IRQ_DELAYED_DISABLE 0x10000000 /* IRQ disable (masking) happens delayed. */ |
61 | #define IRQ_WAKEUP 0x20000000 /* IRQ triggers system wakeup */ | 61 | #define IRQ_WAKEUP 0x20000000 /* IRQ triggers system wakeup */ |
62 | #define IRQ_MOVE_PENDING 0x40000000 /* need to re-target IRQ destination */ | ||
62 | 63 | ||
63 | struct proc_dir_entry; | 64 | struct proc_dir_entry; |
64 | 65 | ||
@@ -132,7 +133,6 @@ struct irq_chip { | |||
132 | * @affinity: IRQ affinity on SMP | 133 | * @affinity: IRQ affinity on SMP |
133 | * @cpu: cpu index useful for balancing | 134 | * @cpu: cpu index useful for balancing |
134 | * @pending_mask: pending rebalanced interrupts | 135 | * @pending_mask: pending rebalanced interrupts |
135 | * @move_irq: need to re-target IRQ destination | ||
136 | * @dir: /proc/irq/ procfs entry | 136 | * @dir: /proc/irq/ procfs entry |
137 | * @affinity_entry: /proc/irq/smp_affinity procfs entry on SMP | 137 | * @affinity_entry: /proc/irq/smp_affinity procfs entry on SMP |
138 | * | 138 | * |
@@ -159,7 +159,6 @@ struct irq_desc { | |||
159 | #endif | 159 | #endif |
160 | #if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE) | 160 | #if defined(CONFIG_GENERIC_PENDING_IRQ) || defined(CONFIG_IRQBALANCE) |
161 | cpumask_t pending_mask; | 161 | cpumask_t pending_mask; |
162 | unsigned int move_irq; /* need to re-target IRQ dest */ | ||
163 | #endif | 162 | #endif |
164 | #ifdef CONFIG_PROC_FS | 163 | #ifdef CONFIG_PROC_FS |
165 | struct proc_dir_entry *dir; | 164 | struct proc_dir_entry *dir; |
@@ -206,36 +205,7 @@ static inline void set_native_irq_info(int irq, cpumask_t mask) | |||
206 | 205 | ||
207 | void set_pending_irq(unsigned int irq, cpumask_t mask); | 206 | void set_pending_irq(unsigned int irq, cpumask_t mask); |
208 | void move_native_irq(int irq); | 207 | void move_native_irq(int irq); |
209 | 208 | void move_masked_irq(int irq); | |
210 | #ifdef CONFIG_PCI_MSI | ||
211 | /* | ||
212 | * Wonder why these are dummies? | ||
213 | * For e.g the set_ioapic_affinity_vector() calls the set_ioapic_affinity_irq() | ||
214 | * counter part after translating the vector to irq info. We need to perform | ||
215 | * this operation on the real irq, when we dont use vector, i.e when | ||
216 | * pci_use_vector() is false. | ||
217 | */ | ||
218 | static inline void move_irq(int irq) | ||
219 | { | ||
220 | } | ||
221 | |||
222 | static inline void set_irq_info(int irq, cpumask_t mask) | ||
223 | { | ||
224 | } | ||
225 | |||
226 | #else /* CONFIG_PCI_MSI */ | ||
227 | |||
228 | static inline void move_irq(int irq) | ||
229 | { | ||
230 | move_native_irq(irq); | ||
231 | } | ||
232 | |||
233 | static inline void set_irq_info(int irq, cpumask_t mask) | ||
234 | { | ||
235 | set_native_irq_info(irq, mask); | ||
236 | } | ||
237 | |||
238 | #endif /* CONFIG_PCI_MSI */ | ||
239 | 209 | ||
240 | #else /* CONFIG_GENERIC_PENDING_IRQ || CONFIG_IRQBALANCE */ | 210 | #else /* CONFIG_GENERIC_PENDING_IRQ || CONFIG_IRQBALANCE */ |
241 | 211 | ||
@@ -247,21 +217,20 @@ static inline void move_native_irq(int irq) | |||
247 | { | 217 | { |
248 | } | 218 | } |
249 | 219 | ||
250 | static inline void set_pending_irq(unsigned int irq, cpumask_t mask) | 220 | static inline void move_masked_irq(int irq) |
251 | { | 221 | { |
252 | } | 222 | } |
253 | 223 | ||
254 | static inline void set_irq_info(int irq, cpumask_t mask) | 224 | static inline void set_pending_irq(unsigned int irq, cpumask_t mask) |
255 | { | 225 | { |
256 | set_native_irq_info(irq, mask); | ||
257 | } | 226 | } |
258 | 227 | ||
259 | #endif /* CONFIG_GENERIC_PENDING_IRQ */ | 228 | #endif /* CONFIG_GENERIC_PENDING_IRQ */ |
260 | 229 | ||
261 | #else /* CONFIG_SMP */ | 230 | #else /* CONFIG_SMP */ |
262 | 231 | ||
263 | #define move_irq(x) | ||
264 | #define move_native_irq(x) | 232 | #define move_native_irq(x) |
233 | #define move_masked_irq(x) | ||
265 | 234 | ||
266 | #endif /* CONFIG_SMP */ | 235 | #endif /* CONFIG_SMP */ |
267 | 236 | ||
@@ -399,8 +368,22 @@ set_irq_chained_handler(unsigned int irq, | |||
399 | __set_irq_handler(irq, handle, 1); | 368 | __set_irq_handler(irq, handle, 1); |
400 | } | 369 | } |
401 | 370 | ||
402 | /* Set/get chip/data for an IRQ: */ | 371 | /* Handle dynamic irq creation and destruction */ |
372 | extern int create_irq(void); | ||
373 | extern void destroy_irq(unsigned int irq); | ||
403 | 374 | ||
375 | /* Test to see if a driver has successfully requested an irq */ | ||
376 | static inline int irq_has_action(unsigned int irq) | ||
377 | { | ||
378 | struct irq_desc *desc = irq_desc + irq; | ||
379 | return desc->action != NULL; | ||
380 | } | ||
381 | |||
382 | /* Dynamic irq helper functions */ | ||
383 | extern void dynamic_irq_init(unsigned int irq); | ||
384 | extern void dynamic_irq_cleanup(unsigned int irq); | ||
385 | |||
386 | /* Set/get chip/data for an IRQ: */ | ||
404 | extern int set_irq_chip(unsigned int irq, struct irq_chip *chip); | 387 | extern int set_irq_chip(unsigned int irq, struct irq_chip *chip); |
405 | extern int set_irq_data(unsigned int irq, void *data); | 388 | extern int set_irq_data(unsigned int irq, void *data); |
406 | extern int set_irq_chip_data(unsigned int irq, void *data); | 389 | extern int set_irq_chip_data(unsigned int irq, void *data); |
diff --git a/include/linux/ite_gpio.h b/include/linux/ite_gpio.h deleted file mode 100644 index b123a14292d3..000000000000 --- a/include/linux/ite_gpio.h +++ /dev/null | |||
@@ -1,66 +0,0 @@ | |||
1 | /* | ||
2 | * FILE NAME ite_gpio.h | ||
3 | * | ||
4 | * BRIEF MODULE DESCRIPTION | ||
5 | * Generic gpio. | ||
6 | * | ||
7 | * Author: MontaVista Software, Inc. <source@mvista.com> | ||
8 | * Hai-Pao Fan <haipao@mvista.com> | ||
9 | * | ||
10 | * Copyright 2001 MontaVista Software Inc. | ||
11 | * | ||
12 | * This program is free software; you can redistribute it and/or modify it | ||
13 | * under the terms of the GNU General Public License as published by the | ||
14 | * Free Software Foundation; either version 2 of the License, or (at your | ||
15 | * option) any later version. | ||
16 | * | ||
17 | * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED | ||
18 | * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF | ||
19 | * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN | ||
20 | * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
21 | * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT | ||
22 | * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF | ||
23 | * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON | ||
24 | * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
25 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
26 | * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
27 | * | ||
28 | * You should have received a copy of the GNU General Public License along | ||
29 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
30 | * 675 Mass Ave, Cambridge, MA 02139, USA. | ||
31 | */ | ||
32 | |||
33 | #ifndef __ITE_GPIO_H | ||
34 | #define __ITE_GPIO_H | ||
35 | |||
36 | #include <linux/ioctl.h> | ||
37 | |||
38 | struct ite_gpio_ioctl_data { | ||
39 | __u32 device; | ||
40 | __u32 mask; | ||
41 | __u32 data; | ||
42 | }; | ||
43 | |||
44 | #define ITE_GPIO_IOCTL_BASE 'Z' | ||
45 | |||
46 | #define ITE_GPIO_IN _IOWR(ITE_GPIO_IOCTL_BASE, 0, struct ite_gpio_ioctl_data) | ||
47 | #define ITE_GPIO_OUT _IOW (ITE_GPIO_IOCTL_BASE, 1, struct ite_gpio_ioctl_data) | ||
48 | #define ITE_GPIO_INT_CTRL _IOW (ITE_GPIO_IOCTL_BASE, 2, struct ite_gpio_ioctl_data) | ||
49 | #define ITE_GPIO_IN_STATUS _IOW (ITE_GPIO_IOCTL_BASE, 3, struct ite_gpio_ioctl_data) | ||
50 | #define ITE_GPIO_OUT_STATUS _IOW (ITE_GPIO_IOCTL_BASE, 4, struct ite_gpio_ioctl_data) | ||
51 | #define ITE_GPIO_GEN_CTRL _IOW (ITE_GPIO_IOCTL_BASE, 5, struct ite_gpio_ioctl_data) | ||
52 | #define ITE_GPIO_INT_WAIT _IOW (ITE_GPIO_IOCTL_BASE, 6, struct ite_gpio_ioctl_data) | ||
53 | |||
54 | #define ITE_GPIO_PORTA 0x01 | ||
55 | #define ITE_GPIO_PORTB 0x02 | ||
56 | #define ITE_GPIO_PORTC 0x04 | ||
57 | |||
58 | extern int ite_gpio_in(__u32 device, __u32 mask, volatile __u32 *data); | ||
59 | extern int ite_gpio_out(__u32 device, __u32 mask, __u32 data); | ||
60 | extern int ite_gpio_int_ctrl(__u32 device, __u32 mask, __u32 data); | ||
61 | extern int ite_gpio_in_status(__u32 device, __u32 mask, volatile __u32 *data); | ||
62 | extern int ite_gpio_out_status(__u32 device, __u32 mask, __u32 data); | ||
63 | extern int ite_gpio_gen_ctrl(__u32 device, __u32 mask, __u32 data); | ||
64 | extern int ite_gpio_int_wait(__u32 device, __u32 mask, __u32 data); | ||
65 | |||
66 | #endif | ||
diff --git a/include/linux/jbd.h b/include/linux/jbd.h index a04c154c5207..fe89444b1c6f 100644 --- a/include/linux/jbd.h +++ b/include/linux/jbd.h | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/linux/jbd.h | 2 | * linux/include/linux/jbd.h |
3 | * | 3 | * |
4 | * Written by Stephen C. Tweedie <sct@redhat.com> | 4 | * Written by Stephen C. Tweedie <sct@redhat.com> |
5 | * | 5 | * |
6 | * Copyright 1998-2000 Red Hat, Inc --- All Rights Reserved | 6 | * Copyright 1998-2000 Red Hat, Inc --- All Rights Reserved |
@@ -64,7 +64,7 @@ extern int journal_enable_debug; | |||
64 | if ((n) <= journal_enable_debug) { \ | 64 | if ((n) <= journal_enable_debug) { \ |
65 | printk (KERN_DEBUG "(%s, %d): %s: ", \ | 65 | printk (KERN_DEBUG "(%s, %d): %s: ", \ |
66 | __FILE__, __LINE__, __FUNCTION__); \ | 66 | __FILE__, __LINE__, __FUNCTION__); \ |
67 | printk (f, ## a); \ | 67 | printk (f, ## a); \ |
68 | } \ | 68 | } \ |
69 | } while (0) | 69 | } while (0) |
70 | #else | 70 | #else |
@@ -97,8 +97,8 @@ extern void jbd_slab_free(void *ptr, size_t size); | |||
97 | * number of outstanding buffers possible at any time. When the | 97 | * number of outstanding buffers possible at any time. When the |
98 | * operation completes, any buffer credits not used are credited back to | 98 | * operation completes, any buffer credits not used are credited back to |
99 | * the transaction, so that at all times we know how many buffers the | 99 | * the transaction, so that at all times we know how many buffers the |
100 | * outstanding updates on a transaction might possibly touch. | 100 | * outstanding updates on a transaction might possibly touch. |
101 | * | 101 | * |
102 | * This is an opaque datatype. | 102 | * This is an opaque datatype. |
103 | **/ | 103 | **/ |
104 | typedef struct handle_s handle_t; /* Atomic operation type */ | 104 | typedef struct handle_s handle_t; /* Atomic operation type */ |
@@ -108,7 +108,7 @@ typedef struct handle_s handle_t; /* Atomic operation type */ | |||
108 | * typedef journal_t - The journal_t maintains all of the journaling state information for a single filesystem. | 108 | * typedef journal_t - The journal_t maintains all of the journaling state information for a single filesystem. |
109 | * | 109 | * |
110 | * journal_t is linked to from the fs superblock structure. | 110 | * journal_t is linked to from the fs superblock structure. |
111 | * | 111 | * |
112 | * We use the journal_t to keep track of all outstanding transaction | 112 | * We use the journal_t to keep track of all outstanding transaction |
113 | * activity on the filesystem, and to manage the state of the log | 113 | * activity on the filesystem, and to manage the state of the log |
114 | * writing process. | 114 | * writing process. |
@@ -128,7 +128,7 @@ typedef struct journal_s journal_t; /* Journal control structure */ | |||
128 | * On-disk structures | 128 | * On-disk structures |
129 | */ | 129 | */ |
130 | 130 | ||
131 | /* | 131 | /* |
132 | * Descriptor block types: | 132 | * Descriptor block types: |
133 | */ | 133 | */ |
134 | 134 | ||
@@ -149,8 +149,8 @@ typedef struct journal_header_s | |||
149 | } journal_header_t; | 149 | } journal_header_t; |
150 | 150 | ||
151 | 151 | ||
152 | /* | 152 | /* |
153 | * The block tag: used to describe a single buffer in the journal | 153 | * The block tag: used to describe a single buffer in the journal |
154 | */ | 154 | */ |
155 | typedef struct journal_block_tag_s | 155 | typedef struct journal_block_tag_s |
156 | { | 156 | { |
@@ -158,9 +158,9 @@ typedef struct journal_block_tag_s | |||
158 | __be32 t_flags; /* See below */ | 158 | __be32 t_flags; /* See below */ |
159 | } journal_block_tag_t; | 159 | } journal_block_tag_t; |
160 | 160 | ||
161 | /* | 161 | /* |
162 | * The revoke descriptor: used on disk to describe a series of blocks to | 162 | * The revoke descriptor: used on disk to describe a series of blocks to |
163 | * be revoked from the log | 163 | * be revoked from the log |
164 | */ | 164 | */ |
165 | typedef struct journal_revoke_header_s | 165 | typedef struct journal_revoke_header_s |
166 | { | 166 | { |
@@ -201,9 +201,9 @@ typedef struct journal_superblock_s | |||
201 | 201 | ||
202 | /* 0x0024 */ | 202 | /* 0x0024 */ |
203 | /* Remaining fields are only valid in a version-2 superblock */ | 203 | /* Remaining fields are only valid in a version-2 superblock */ |
204 | __be32 s_feature_compat; /* compatible feature set */ | 204 | __be32 s_feature_compat; /* compatible feature set */ |
205 | __be32 s_feature_incompat; /* incompatible feature set */ | 205 | __be32 s_feature_incompat; /* incompatible feature set */ |
206 | __be32 s_feature_ro_compat; /* readonly-compatible feature set */ | 206 | __be32 s_feature_ro_compat; /* readonly-compatible feature set */ |
207 | /* 0x0030 */ | 207 | /* 0x0030 */ |
208 | __u8 s_uuid[16]; /* 128-bit uuid for journal */ | 208 | __u8 s_uuid[16]; /* 128-bit uuid for journal */ |
209 | 209 | ||
@@ -374,10 +374,10 @@ struct jbd_revoke_table_s; | |||
374 | **/ | 374 | **/ |
375 | 375 | ||
376 | /* Docbook can't yet cope with the bit fields, but will leave the documentation | 376 | /* Docbook can't yet cope with the bit fields, but will leave the documentation |
377 | * in so it can be fixed later. | 377 | * in so it can be fixed later. |
378 | */ | 378 | */ |
379 | 379 | ||
380 | struct handle_s | 380 | struct handle_s |
381 | { | 381 | { |
382 | /* Which compound transaction is this update a part of? */ | 382 | /* Which compound transaction is this update a part of? */ |
383 | transaction_t *h_transaction; | 383 | transaction_t *h_transaction; |
@@ -435,7 +435,7 @@ struct handle_s | |||
435 | * | 435 | * |
436 | */ | 436 | */ |
437 | 437 | ||
438 | struct transaction_s | 438 | struct transaction_s |
439 | { | 439 | { |
440 | /* Pointer to the journal for this transaction. [no locking] */ | 440 | /* Pointer to the journal for this transaction. [no locking] */ |
441 | journal_t *t_journal; | 441 | journal_t *t_journal; |
@@ -455,7 +455,7 @@ struct transaction_s | |||
455 | T_RUNDOWN, | 455 | T_RUNDOWN, |
456 | T_FLUSH, | 456 | T_FLUSH, |
457 | T_COMMIT, | 457 | T_COMMIT, |
458 | T_FINISHED | 458 | T_FINISHED |
459 | } t_state; | 459 | } t_state; |
460 | 460 | ||
461 | /* | 461 | /* |
@@ -569,7 +569,7 @@ struct transaction_s | |||
569 | * journal_t. | 569 | * journal_t. |
570 | * @j_flags: General journaling state flags | 570 | * @j_flags: General journaling state flags |
571 | * @j_errno: Is there an outstanding uncleared error on the journal (from a | 571 | * @j_errno: Is there an outstanding uncleared error on the journal (from a |
572 | * prior abort)? | 572 | * prior abort)? |
573 | * @j_sb_buffer: First part of superblock buffer | 573 | * @j_sb_buffer: First part of superblock buffer |
574 | * @j_superblock: Second part of superblock buffer | 574 | * @j_superblock: Second part of superblock buffer |
575 | * @j_format_version: Version of the superblock format | 575 | * @j_format_version: Version of the superblock format |
@@ -583,7 +583,7 @@ struct transaction_s | |||
583 | * @j_wait_transaction_locked: Wait queue for waiting for a locked transaction | 583 | * @j_wait_transaction_locked: Wait queue for waiting for a locked transaction |
584 | * to start committing, or for a barrier lock to be released | 584 | * to start committing, or for a barrier lock to be released |
585 | * @j_wait_logspace: Wait queue for waiting for checkpointing to complete | 585 | * @j_wait_logspace: Wait queue for waiting for checkpointing to complete |
586 | * @j_wait_done_commit: Wait queue for waiting for commit to complete | 586 | * @j_wait_done_commit: Wait queue for waiting for commit to complete |
587 | * @j_wait_checkpoint: Wait queue to trigger checkpointing | 587 | * @j_wait_checkpoint: Wait queue to trigger checkpointing |
588 | * @j_wait_commit: Wait queue to trigger commit | 588 | * @j_wait_commit: Wait queue to trigger commit |
589 | * @j_wait_updates: Wait queue to wait for updates to complete | 589 | * @j_wait_updates: Wait queue to wait for updates to complete |
@@ -592,7 +592,7 @@ struct transaction_s | |||
592 | * @j_tail: Journal tail - identifies the oldest still-used block in the | 592 | * @j_tail: Journal tail - identifies the oldest still-used block in the |
593 | * journal. | 593 | * journal. |
594 | * @j_free: Journal free - how many free blocks are there in the journal? | 594 | * @j_free: Journal free - how many free blocks are there in the journal? |
595 | * @j_first: The block number of the first usable block | 595 | * @j_first: The block number of the first usable block |
596 | * @j_last: The block number one beyond the last usable block | 596 | * @j_last: The block number one beyond the last usable block |
597 | * @j_dev: Device where we store the journal | 597 | * @j_dev: Device where we store the journal |
598 | * @j_blocksize: blocksize for the location where we store the journal. | 598 | * @j_blocksize: blocksize for the location where we store the journal. |
@@ -604,12 +604,12 @@ struct transaction_s | |||
604 | * @j_list_lock: Protects the buffer lists and internal buffer state. | 604 | * @j_list_lock: Protects the buffer lists and internal buffer state. |
605 | * @j_inode: Optional inode where we store the journal. If present, all journal | 605 | * @j_inode: Optional inode where we store the journal. If present, all journal |
606 | * block numbers are mapped into this inode via bmap(). | 606 | * block numbers are mapped into this inode via bmap(). |
607 | * @j_tail_sequence: Sequence number of the oldest transaction in the log | 607 | * @j_tail_sequence: Sequence number of the oldest transaction in the log |
608 | * @j_transaction_sequence: Sequence number of the next transaction to grant | 608 | * @j_transaction_sequence: Sequence number of the next transaction to grant |
609 | * @j_commit_sequence: Sequence number of the most recently committed | 609 | * @j_commit_sequence: Sequence number of the most recently committed |
610 | * transaction | 610 | * transaction |
611 | * @j_commit_request: Sequence number of the most recent transaction wanting | 611 | * @j_commit_request: Sequence number of the most recent transaction wanting |
612 | * commit | 612 | * commit |
613 | * @j_uuid: Uuid of client object. | 613 | * @j_uuid: Uuid of client object. |
614 | * @j_task: Pointer to the current commit thread for this journal | 614 | * @j_task: Pointer to the current commit thread for this journal |
615 | * @j_max_transaction_buffers: Maximum number of metadata buffers to allow in a | 615 | * @j_max_transaction_buffers: Maximum number of metadata buffers to allow in a |
@@ -699,7 +699,7 @@ struct journal_s | |||
699 | wait_queue_head_t j_wait_updates; | 699 | wait_queue_head_t j_wait_updates; |
700 | 700 | ||
701 | /* Semaphore for locking against concurrent checkpoints */ | 701 | /* Semaphore for locking against concurrent checkpoints */ |
702 | struct mutex j_checkpoint_mutex; | 702 | struct mutex j_checkpoint_mutex; |
703 | 703 | ||
704 | /* | 704 | /* |
705 | * Journal head: identifies the first unused block in the journal. | 705 | * Journal head: identifies the first unused block in the journal. |
@@ -732,7 +732,7 @@ struct journal_s | |||
732 | */ | 732 | */ |
733 | struct block_device *j_dev; | 733 | struct block_device *j_dev; |
734 | int j_blocksize; | 734 | int j_blocksize; |
735 | unsigned int j_blk_offset; | 735 | unsigned long j_blk_offset; |
736 | 736 | ||
737 | /* | 737 | /* |
738 | * Device which holds the client fs. For internal journal this will be | 738 | * Device which holds the client fs. For internal journal this will be |
@@ -823,8 +823,8 @@ struct journal_s | |||
823 | void *j_private; | 823 | void *j_private; |
824 | }; | 824 | }; |
825 | 825 | ||
826 | /* | 826 | /* |
827 | * Journal flag definitions | 827 | * Journal flag definitions |
828 | */ | 828 | */ |
829 | #define JFS_UNMOUNT 0x001 /* Journal thread is being destroyed */ | 829 | #define JFS_UNMOUNT 0x001 /* Journal thread is being destroyed */ |
830 | #define JFS_ABORT 0x002 /* Journaling has been aborted for errors. */ | 830 | #define JFS_ABORT 0x002 /* Journaling has been aborted for errors. */ |
@@ -833,7 +833,7 @@ struct journal_s | |||
833 | #define JFS_LOADED 0x010 /* The journal superblock has been loaded */ | 833 | #define JFS_LOADED 0x010 /* The journal superblock has been loaded */ |
834 | #define JFS_BARRIER 0x020 /* Use IDE barriers */ | 834 | #define JFS_BARRIER 0x020 /* Use IDE barriers */ |
835 | 835 | ||
836 | /* | 836 | /* |
837 | * Function declarations for the journaling transaction and buffer | 837 | * Function declarations for the journaling transaction and buffer |
838 | * management | 838 | * management |
839 | */ | 839 | */ |
@@ -862,11 +862,11 @@ int __journal_remove_checkpoint(struct journal_head *); | |||
862 | void __journal_insert_checkpoint(struct journal_head *, transaction_t *); | 862 | void __journal_insert_checkpoint(struct journal_head *, transaction_t *); |
863 | 863 | ||
864 | /* Buffer IO */ | 864 | /* Buffer IO */ |
865 | extern int | 865 | extern int |
866 | journal_write_metadata_buffer(transaction_t *transaction, | 866 | journal_write_metadata_buffer(transaction_t *transaction, |
867 | struct journal_head *jh_in, | 867 | struct journal_head *jh_in, |
868 | struct journal_head **jh_out, | 868 | struct journal_head **jh_out, |
869 | int blocknr); | 869 | unsigned long blocknr); |
870 | 870 | ||
871 | /* Transaction locking */ | 871 | /* Transaction locking */ |
872 | extern void __wait_on_journal (journal_t *); | 872 | extern void __wait_on_journal (journal_t *); |
@@ -890,7 +890,7 @@ static inline handle_t *journal_current_handle(void) | |||
890 | /* The journaling code user interface: | 890 | /* The journaling code user interface: |
891 | * | 891 | * |
892 | * Create and destroy handles | 892 | * Create and destroy handles |
893 | * Register buffer modifications against the current transaction. | 893 | * Register buffer modifications against the current transaction. |
894 | */ | 894 | */ |
895 | 895 | ||
896 | extern handle_t *journal_start(journal_t *, int nblocks); | 896 | extern handle_t *journal_start(journal_t *, int nblocks); |
@@ -917,11 +917,11 @@ extern journal_t * journal_init_dev(struct block_device *bdev, | |||
917 | int start, int len, int bsize); | 917 | int start, int len, int bsize); |
918 | extern journal_t * journal_init_inode (struct inode *); | 918 | extern journal_t * journal_init_inode (struct inode *); |
919 | extern int journal_update_format (journal_t *); | 919 | extern int journal_update_format (journal_t *); |
920 | extern int journal_check_used_features | 920 | extern int journal_check_used_features |
921 | (journal_t *, unsigned long, unsigned long, unsigned long); | 921 | (journal_t *, unsigned long, unsigned long, unsigned long); |
922 | extern int journal_check_available_features | 922 | extern int journal_check_available_features |
923 | (journal_t *, unsigned long, unsigned long, unsigned long); | 923 | (journal_t *, unsigned long, unsigned long, unsigned long); |
924 | extern int journal_set_features | 924 | extern int journal_set_features |
925 | (journal_t *, unsigned long, unsigned long, unsigned long); | 925 | (journal_t *, unsigned long, unsigned long, unsigned long); |
926 | extern int journal_create (journal_t *); | 926 | extern int journal_create (journal_t *); |
927 | extern int journal_load (journal_t *journal); | 927 | extern int journal_load (journal_t *journal); |
@@ -977,7 +977,6 @@ extern void journal_write_revoke_records(journal_t *, transaction_t *); | |||
977 | extern int journal_set_revoke(journal_t *, unsigned long, tid_t); | 977 | extern int journal_set_revoke(journal_t *, unsigned long, tid_t); |
978 | extern int journal_test_revoke(journal_t *, unsigned long, tid_t); | 978 | extern int journal_test_revoke(journal_t *, unsigned long, tid_t); |
979 | extern void journal_clear_revoke(journal_t *); | 979 | extern void journal_clear_revoke(journal_t *); |
980 | extern void journal_brelse_array(struct buffer_head *b[], int n); | ||
981 | extern void journal_switch_revoke_table(journal_t *journal); | 980 | extern void journal_switch_revoke_table(journal_t *journal); |
982 | 981 | ||
983 | /* | 982 | /* |
@@ -1015,7 +1014,7 @@ do { \ | |||
1015 | * bit, when set, indicates that we have had a fatal error somewhere, | 1014 | * bit, when set, indicates that we have had a fatal error somewhere, |
1016 | * either inside the journaling layer or indicated to us by the client | 1015 | * either inside the journaling layer or indicated to us by the client |
1017 | * (eg. ext3), and that we and should not commit any further | 1016 | * (eg. ext3), and that we and should not commit any further |
1018 | * transactions. | 1017 | * transactions. |
1019 | */ | 1018 | */ |
1020 | 1019 | ||
1021 | static inline int is_journal_aborted(journal_t *journal) | 1020 | static inline int is_journal_aborted(journal_t *journal) |
@@ -1082,7 +1081,7 @@ static inline int jbd_space_needed(journal_t *journal) | |||
1082 | #define BJ_Reserved 7 /* Buffer is reserved for access by journal */ | 1081 | #define BJ_Reserved 7 /* Buffer is reserved for access by journal */ |
1083 | #define BJ_Locked 8 /* Locked for I/O during commit */ | 1082 | #define BJ_Locked 8 /* Locked for I/O during commit */ |
1084 | #define BJ_Types 9 | 1083 | #define BJ_Types 9 |
1085 | 1084 | ||
1086 | extern int jbd_blocks_per_page(struct inode *inode); | 1085 | extern int jbd_blocks_per_page(struct inode *inode); |
1087 | 1086 | ||
1088 | #ifdef __KERNEL__ | 1087 | #ifdef __KERNEL__ |
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index 329ebcffa106..c8d5f207c3d4 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h | |||
@@ -115,6 +115,21 @@ static inline u64 get_jiffies_64(void) | |||
115 | ((long)(a) - (long)(b) >= 0)) | 115 | ((long)(a) - (long)(b) >= 0)) |
116 | #define time_before_eq(a,b) time_after_eq(b,a) | 116 | #define time_before_eq(a,b) time_after_eq(b,a) |
117 | 117 | ||
118 | /* Same as above, but does so with platform independent 64bit types. | ||
119 | * These must be used when utilizing jiffies_64 (i.e. return value of | ||
120 | * get_jiffies_64() */ | ||
121 | #define time_after64(a,b) \ | ||
122 | (typecheck(__u64, a) && \ | ||
123 | typecheck(__u64, b) && \ | ||
124 | ((__s64)(b) - (__s64)(a) < 0)) | ||
125 | #define time_before64(a,b) time_after64(b,a) | ||
126 | |||
127 | #define time_after_eq64(a,b) \ | ||
128 | (typecheck(__u64, a) && \ | ||
129 | typecheck(__u64, b) && \ | ||
130 | ((__s64)(a) - (__s64)(b) >= 0)) | ||
131 | #define time_before_eq64(a,b) time_after_eq64(b,a) | ||
132 | |||
118 | /* | 133 | /* |
119 | * Have the 32 bit jiffies value wrap 5 minutes after boot | 134 | * Have the 32 bit jiffies value wrap 5 minutes after boot |
120 | * so jiffies wrap bugs show up earlier. | 135 | * so jiffies wrap bugs show up earlier. |
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h index 849043ce4ed6..1cebcbc28b47 100644 --- a/include/linux/kallsyms.h +++ b/include/linux/kallsyms.h | |||
@@ -12,6 +12,10 @@ | |||
12 | /* Lookup the address for a symbol. Returns 0 if not found. */ | 12 | /* Lookup the address for a symbol. Returns 0 if not found. */ |
13 | unsigned long kallsyms_lookup_name(const char *name); | 13 | unsigned long kallsyms_lookup_name(const char *name); |
14 | 14 | ||
15 | extern int kallsyms_lookup_size_offset(unsigned long addr, | ||
16 | unsigned long *symbolsize, | ||
17 | unsigned long *offset); | ||
18 | |||
15 | /* Lookup an address. modname is set to NULL if it's in the kernel. */ | 19 | /* Lookup an address. modname is set to NULL if it's in the kernel. */ |
16 | const char *kallsyms_lookup(unsigned long addr, | 20 | const char *kallsyms_lookup(unsigned long addr, |
17 | unsigned long *symbolsize, | 21 | unsigned long *symbolsize, |
@@ -28,6 +32,13 @@ static inline unsigned long kallsyms_lookup_name(const char *name) | |||
28 | return 0; | 32 | return 0; |
29 | } | 33 | } |
30 | 34 | ||
35 | static inline int kallsyms_lookup_size_offset(unsigned long addr, | ||
36 | unsigned long *symbolsize, | ||
37 | unsigned long *offset) | ||
38 | { | ||
39 | return 0; | ||
40 | } | ||
41 | |||
31 | static inline const char *kallsyms_lookup(unsigned long addr, | 42 | static inline const char *kallsyms_lookup(unsigned long addr, |
32 | unsigned long *symbolsize, | 43 | unsigned long *symbolsize, |
33 | unsigned long *offset, | 44 | unsigned long *offset, |
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index e44a37e2c71c..80f39cab470a 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -187,6 +187,7 @@ extern void bust_spinlocks(int yes); | |||
187 | extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ | 187 | extern int oops_in_progress; /* If set, an oops, panic(), BUG() or die() is in progress */ |
188 | extern int panic_timeout; | 188 | extern int panic_timeout; |
189 | extern int panic_on_oops; | 189 | extern int panic_on_oops; |
190 | extern int panic_on_unrecovered_nmi; | ||
190 | extern int tainted; | 191 | extern int tainted; |
191 | extern const char *print_tainted(void); | 192 | extern const char *print_tainted(void); |
192 | extern void add_taint(unsigned); | 193 | extern void add_taint(unsigned); |
@@ -215,8 +216,10 @@ extern void dump_stack(void); | |||
215 | #define pr_debug(fmt,arg...) \ | 216 | #define pr_debug(fmt,arg...) \ |
216 | printk(KERN_DEBUG fmt,##arg) | 217 | printk(KERN_DEBUG fmt,##arg) |
217 | #else | 218 | #else |
218 | #define pr_debug(fmt,arg...) \ | 219 | static inline int __attribute__ ((format (printf, 1, 2))) pr_debug(const char * fmt, ...) |
219 | do { } while (0) | 220 | { |
221 | return 0; | ||
222 | } | ||
220 | #endif | 223 | #endif |
221 | 224 | ||
222 | #define pr_info(fmt,arg...) \ | 225 | #define pr_info(fmt,arg...) \ |
@@ -349,4 +352,11 @@ struct sysinfo { | |||
349 | /* Trap pasters of __FUNCTION__ at compile-time */ | 352 | /* Trap pasters of __FUNCTION__ at compile-time */ |
350 | #define __FUNCTION__ (__func__) | 353 | #define __FUNCTION__ (__func__) |
351 | 354 | ||
355 | /* This helps us to avoid #ifdef CONFIG_NUMA */ | ||
356 | #ifdef CONFIG_NUMA | ||
357 | #define NUMA_BUILD 1 | ||
358 | #else | ||
359 | #define NUMA_BUILD 0 | ||
360 | #endif | ||
361 | |||
352 | #endif | 362 | #endif |
diff --git a/include/linux/kmod.h b/include/linux/kmod.h index 0db22a1ab474..10f505c8431d 100644 --- a/include/linux/kmod.h +++ b/include/linux/kmod.h | |||
@@ -47,4 +47,8 @@ call_usermodehelper(char *path, char **argv, char **envp, int wait) | |||
47 | 47 | ||
48 | extern void usermodehelper_init(void); | 48 | extern void usermodehelper_init(void); |
49 | 49 | ||
50 | struct file; | ||
51 | extern int call_usermodehelper_pipe(char *path, char *argv[], char *envp[], | ||
52 | struct file **filp); | ||
53 | |||
50 | #endif /* __LINUX_KMOD_H__ */ | 54 | #endif /* __LINUX_KMOD_H__ */ |
diff --git a/include/linux/kobject.h b/include/linux/kobject.h index 2d229327959e..bcd9cd173c2c 100644 --- a/include/linux/kobject.h +++ b/include/linux/kobject.h | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/types.h> | 20 | #include <linux/types.h> |
21 | #include <linux/list.h> | 21 | #include <linux/list.h> |
22 | #include <linux/sysfs.h> | 22 | #include <linux/sysfs.h> |
23 | #include <linux/compiler.h> | ||
23 | #include <linux/spinlock.h> | 24 | #include <linux/spinlock.h> |
24 | #include <linux/rwsem.h> | 25 | #include <linux/rwsem.h> |
25 | #include <linux/kref.h> | 26 | #include <linux/kref.h> |
@@ -71,12 +72,12 @@ static inline const char * kobject_name(const struct kobject * kobj) | |||
71 | extern void kobject_init(struct kobject *); | 72 | extern void kobject_init(struct kobject *); |
72 | extern void kobject_cleanup(struct kobject *); | 73 | extern void kobject_cleanup(struct kobject *); |
73 | 74 | ||
74 | extern int kobject_add(struct kobject *); | 75 | extern int __must_check kobject_add(struct kobject *); |
75 | extern void kobject_del(struct kobject *); | 76 | extern void kobject_del(struct kobject *); |
76 | 77 | ||
77 | extern int kobject_rename(struct kobject *, const char *new_name); | 78 | extern int __must_check kobject_rename(struct kobject *, const char *new_name); |
78 | 79 | ||
79 | extern int kobject_register(struct kobject *); | 80 | extern int __must_check kobject_register(struct kobject *); |
80 | extern void kobject_unregister(struct kobject *); | 81 | extern void kobject_unregister(struct kobject *); |
81 | 82 | ||
82 | extern struct kobject * kobject_get(struct kobject *); | 83 | extern struct kobject * kobject_get(struct kobject *); |
@@ -128,8 +129,8 @@ struct kset { | |||
128 | 129 | ||
129 | 130 | ||
130 | extern void kset_init(struct kset * k); | 131 | extern void kset_init(struct kset * k); |
131 | extern int kset_add(struct kset * k); | 132 | extern int __must_check kset_add(struct kset * k); |
132 | extern int kset_register(struct kset * k); | 133 | extern int __must_check kset_register(struct kset * k); |
133 | extern void kset_unregister(struct kset * k); | 134 | extern void kset_unregister(struct kset * k); |
134 | 135 | ||
135 | static inline struct kset * to_kset(struct kobject * kobj) | 136 | static inline struct kset * to_kset(struct kobject * kobj) |
@@ -239,7 +240,7 @@ extern struct subsystem hypervisor_subsys; | |||
239 | (obj)->subsys.kset.kobj.kset = &(_subsys).kset | 240 | (obj)->subsys.kset.kobj.kset = &(_subsys).kset |
240 | 241 | ||
241 | extern void subsystem_init(struct subsystem *); | 242 | extern void subsystem_init(struct subsystem *); |
242 | extern int subsystem_register(struct subsystem *); | 243 | extern int __must_check subsystem_register(struct subsystem *); |
243 | extern void subsystem_unregister(struct subsystem *); | 244 | extern void subsystem_unregister(struct subsystem *); |
244 | 245 | ||
245 | static inline struct subsystem * subsys_get(struct subsystem * s) | 246 | static inline struct subsystem * subsys_get(struct subsystem * s) |
@@ -258,7 +259,8 @@ struct subsys_attribute { | |||
258 | ssize_t (*store)(struct subsystem *, const char *, size_t); | 259 | ssize_t (*store)(struct subsystem *, const char *, size_t); |
259 | }; | 260 | }; |
260 | 261 | ||
261 | extern int subsys_create_file(struct subsystem * , struct subsys_attribute *); | 262 | extern int __must_check subsys_create_file(struct subsystem * , |
263 | struct subsys_attribute *); | ||
262 | 264 | ||
263 | #if defined(CONFIG_HOTPLUG) | 265 | #if defined(CONFIG_HOTPLUG) |
264 | void kobject_uevent(struct kobject *kobj, enum kobject_action action); | 266 | void kobject_uevent(struct kobject *kobj, enum kobject_action action); |
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 8bf6702da2a0..ac4c0559f751 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
@@ -77,6 +77,12 @@ struct kprobe { | |||
77 | /* location of the probe point */ | 77 | /* location of the probe point */ |
78 | kprobe_opcode_t *addr; | 78 | kprobe_opcode_t *addr; |
79 | 79 | ||
80 | /* Allow user to indicate symbol name of the probe point */ | ||
81 | char *symbol_name; | ||
82 | |||
83 | /* Offset into the symbol */ | ||
84 | unsigned int offset; | ||
85 | |||
80 | /* Called before addr is executed. */ | 86 | /* Called before addr is executed. */ |
81 | kprobe_pre_handler_t pre_handler; | 87 | kprobe_pre_handler_t pre_handler; |
82 | 88 | ||
@@ -196,7 +202,7 @@ void unregister_kretprobe(struct kretprobe *rp); | |||
196 | struct kretprobe_instance *get_free_rp_inst(struct kretprobe *rp); | 202 | struct kretprobe_instance *get_free_rp_inst(struct kretprobe *rp); |
197 | void add_rp_inst(struct kretprobe_instance *ri); | 203 | void add_rp_inst(struct kretprobe_instance *ri); |
198 | void kprobe_flush_task(struct task_struct *tk); | 204 | void kprobe_flush_task(struct task_struct *tk); |
199 | void recycle_rp_inst(struct kretprobe_instance *ri); | 205 | void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head); |
200 | #else /* CONFIG_KPROBES */ | 206 | #else /* CONFIG_KPROBES */ |
201 | 207 | ||
202 | #define __kprobes /**/ | 208 | #define __kprobes /**/ |
diff --git a/include/linux/latency.h b/include/linux/latency.h new file mode 100644 index 000000000000..c08b52bb55b0 --- /dev/null +++ b/include/linux/latency.h | |||
@@ -0,0 +1,25 @@ | |||
1 | /* | ||
2 | * latency.h: Explicit system-wide latency-expectation infrastructure | ||
3 | * | ||
4 | * (C) Copyright 2006 Intel Corporation | ||
5 | * Author: Arjan van de Ven <arjan@linux.intel.com> | ||
6 | * | ||
7 | */ | ||
8 | |||
9 | #ifndef _INCLUDE_GUARD_LATENCY_H_ | ||
10 | #define _INCLUDE_GUARD_LATENCY_H_ | ||
11 | |||
12 | #include <linux/notifier.h> | ||
13 | |||
14 | void set_acceptable_latency(char *identifier, int usecs); | ||
15 | void modify_acceptable_latency(char *identifier, int usecs); | ||
16 | void remove_acceptable_latency(char *identifier); | ||
17 | void synchronize_acceptable_latency(void); | ||
18 | int system_latency_constraint(void); | ||
19 | |||
20 | int register_latency_notifier(struct notifier_block * nb); | ||
21 | int unregister_latency_notifier(struct notifier_block * nb); | ||
22 | |||
23 | #define INFINITE_LATENCY 1000000 | ||
24 | |||
25 | #endif | ||
diff --git a/include/linux/leds.h b/include/linux/leds.h index dc23c7c639f3..88afceffb7cb 100644 --- a/include/linux/leds.h +++ b/include/linux/leds.h | |||
@@ -12,6 +12,9 @@ | |||
12 | #ifndef __LINUX_LEDS_H_INCLUDED | 12 | #ifndef __LINUX_LEDS_H_INCLUDED |
13 | #define __LINUX_LEDS_H_INCLUDED | 13 | #define __LINUX_LEDS_H_INCLUDED |
14 | 14 | ||
15 | #include <linux/list.h> | ||
16 | #include <linux/spinlock.h> | ||
17 | |||
15 | struct device; | 18 | struct device; |
16 | struct class_device; | 19 | struct class_device; |
17 | /* | 20 | /* |
diff --git a/include/linux/libata.h b/include/linux/libata.h index d6a3d4b345fc..d1af1dbeaeb4 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -109,6 +109,10 @@ static inline u32 ata_msg_init(int dval, int default_msg_enable_bits) | |||
109 | #define ATA_TAG_POISON 0xfafbfcfdU | 109 | #define ATA_TAG_POISON 0xfafbfcfdU |
110 | 110 | ||
111 | /* move to PCI layer? */ | 111 | /* move to PCI layer? */ |
112 | #define PCI_VDEVICE(vendor, device) \ | ||
113 | PCI_VENDOR_ID_##vendor, (device), \ | ||
114 | PCI_ANY_ID, PCI_ANY_ID, 0, 0 | ||
115 | |||
112 | static inline struct device *pci_dev_to_dev(struct pci_dev *pdev) | 116 | static inline struct device *pci_dev_to_dev(struct pci_dev *pdev) |
113 | { | 117 | { |
114 | return &pdev->dev; | 118 | return &pdev->dev; |
@@ -138,8 +142,9 @@ enum { | |||
138 | ATA_DFLAG_NCQ = (1 << 3), /* device supports NCQ */ | 142 | ATA_DFLAG_NCQ = (1 << 3), /* device supports NCQ */ |
139 | ATA_DFLAG_CFG_MASK = (1 << 8) - 1, | 143 | ATA_DFLAG_CFG_MASK = (1 << 8) - 1, |
140 | 144 | ||
141 | ATA_DFLAG_PIO = (1 << 8), /* device currently in PIO mode */ | 145 | ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ |
142 | ATA_DFLAG_SUSPENDED = (1 << 9), /* device suspended */ | 146 | ATA_DFLAG_NCQ_OFF = (1 << 9), /* devied limited to non-NCQ mode */ |
147 | ATA_DFLAG_SUSPENDED = (1 << 10), /* device suspended */ | ||
143 | ATA_DFLAG_INIT_MASK = (1 << 16) - 1, | 148 | ATA_DFLAG_INIT_MASK = (1 << 16) - 1, |
144 | 149 | ||
145 | ATA_DFLAG_DETACH = (1 << 16), | 150 | ATA_DFLAG_DETACH = (1 << 16), |
diff --git a/include/linux/libps2.h b/include/linux/libps2.h index 08a450a9dbf7..f6f301e2b0f5 100644 --- a/include/linux/libps2.h +++ b/include/linux/libps2.h | |||
@@ -47,5 +47,6 @@ int ps2_schedule_command(struct ps2dev *ps2dev, unsigned char *param, int comman | |||
47 | int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data); | 47 | int ps2_handle_ack(struct ps2dev *ps2dev, unsigned char data); |
48 | int ps2_handle_response(struct ps2dev *ps2dev, unsigned char data); | 48 | int ps2_handle_response(struct ps2dev *ps2dev, unsigned char data); |
49 | void ps2_cmd_aborted(struct ps2dev *ps2dev); | 49 | void ps2_cmd_aborted(struct ps2dev *ps2dev); |
50 | int ps2_is_keyboard_id(char id); | ||
50 | 51 | ||
51 | #endif /* _LIBPS2_H */ | 52 | #endif /* _LIBPS2_H */ |
diff --git a/include/linux/linkage.h b/include/linux/linkage.h index 932021f872d5..6c9873f88287 100644 --- a/include/linux/linkage.h +++ b/include/linux/linkage.h | |||
@@ -35,9 +35,13 @@ | |||
35 | #endif | 35 | #endif |
36 | 36 | ||
37 | #define KPROBE_ENTRY(name) \ | 37 | #define KPROBE_ENTRY(name) \ |
38 | .section .kprobes.text, "ax"; \ | 38 | .pushsection .kprobes.text, "ax"; \ |
39 | ENTRY(name) | 39 | ENTRY(name) |
40 | 40 | ||
41 | #define KPROBE_END(name) \ | ||
42 | END(name); \ | ||
43 | .popsection | ||
44 | |||
41 | #ifndef END | 45 | #ifndef END |
42 | #define END(name) \ | 46 | #define END(name) \ |
43 | .size name, .-name | 47 | .size name, .-name |
diff --git a/include/linux/list.h b/include/linux/list.h index 65a5b5ceda49..a9c90287c0ff 100644 --- a/include/linux/list.h +++ b/include/linux/list.h | |||
@@ -39,6 +39,7 @@ static inline void INIT_LIST_HEAD(struct list_head *list) | |||
39 | * This is only for internal list manipulation where we know | 39 | * This is only for internal list manipulation where we know |
40 | * the prev/next entries already! | 40 | * the prev/next entries already! |
41 | */ | 41 | */ |
42 | #ifndef CONFIG_DEBUG_LIST | ||
42 | static inline void __list_add(struct list_head *new, | 43 | static inline void __list_add(struct list_head *new, |
43 | struct list_head *prev, | 44 | struct list_head *prev, |
44 | struct list_head *next) | 45 | struct list_head *next) |
@@ -48,6 +49,11 @@ static inline void __list_add(struct list_head *new, | |||
48 | new->prev = prev; | 49 | new->prev = prev; |
49 | prev->next = new; | 50 | prev->next = new; |
50 | } | 51 | } |
52 | #else | ||
53 | extern void __list_add(struct list_head *new, | ||
54 | struct list_head *prev, | ||
55 | struct list_head *next); | ||
56 | #endif | ||
51 | 57 | ||
52 | /** | 58 | /** |
53 | * list_add - add a new entry | 59 | * list_add - add a new entry |
@@ -57,10 +63,15 @@ static inline void __list_add(struct list_head *new, | |||
57 | * Insert a new entry after the specified head. | 63 | * Insert a new entry after the specified head. |
58 | * This is good for implementing stacks. | 64 | * This is good for implementing stacks. |
59 | */ | 65 | */ |
66 | #ifndef CONFIG_DEBUG_LIST | ||
60 | static inline void list_add(struct list_head *new, struct list_head *head) | 67 | static inline void list_add(struct list_head *new, struct list_head *head) |
61 | { | 68 | { |
62 | __list_add(new, head, head->next); | 69 | __list_add(new, head, head->next); |
63 | } | 70 | } |
71 | #else | ||
72 | extern void list_add(struct list_head *new, struct list_head *head); | ||
73 | #endif | ||
74 | |||
64 | 75 | ||
65 | /** | 76 | /** |
66 | * list_add_tail - add a new entry | 77 | * list_add_tail - add a new entry |
@@ -153,12 +164,16 @@ static inline void __list_del(struct list_head * prev, struct list_head * next) | |||
153 | * Note: list_empty on entry does not return true after this, the entry is | 164 | * Note: list_empty on entry does not return true after this, the entry is |
154 | * in an undefined state. | 165 | * in an undefined state. |
155 | */ | 166 | */ |
167 | #ifndef CONFIG_DEBUG_LIST | ||
156 | static inline void list_del(struct list_head *entry) | 168 | static inline void list_del(struct list_head *entry) |
157 | { | 169 | { |
158 | __list_del(entry->prev, entry->next); | 170 | __list_del(entry->prev, entry->next); |
159 | entry->next = LIST_POISON1; | 171 | entry->next = LIST_POISON1; |
160 | entry->prev = LIST_POISON2; | 172 | entry->prev = LIST_POISON2; |
161 | } | 173 | } |
174 | #else | ||
175 | extern void list_del(struct list_head *entry); | ||
176 | #endif | ||
162 | 177 | ||
163 | /** | 178 | /** |
164 | * list_del_rcu - deletes entry from list without re-initialization | 179 | * list_del_rcu - deletes entry from list without re-initialization |
diff --git a/include/linux/lm_interface.h b/include/linux/lm_interface.h new file mode 100644 index 000000000000..1418fdc9ac02 --- /dev/null +++ b/include/linux/lm_interface.h | |||
@@ -0,0 +1,273 @@ | |||
1 | /* | ||
2 | * Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. | ||
3 | * Copyright (C) 2004-2006 Red Hat, Inc. All rights reserved. | ||
4 | * | ||
5 | * This copyrighted material is made available to anyone wishing to use, | ||
6 | * modify, copy, or redistribute it subject to the terms and conditions | ||
7 | * of the GNU General Public License version 2. | ||
8 | */ | ||
9 | |||
10 | #ifndef __LM_INTERFACE_DOT_H__ | ||
11 | #define __LM_INTERFACE_DOT_H__ | ||
12 | |||
13 | |||
14 | typedef void (*lm_callback_t) (void *ptr, unsigned int type, void *data); | ||
15 | |||
16 | /* | ||
17 | * lm_mount() flags | ||
18 | * | ||
19 | * LM_MFLAG_SPECTATOR | ||
20 | * GFS is asking to join the filesystem's lockspace, but it doesn't want to | ||
21 | * modify the filesystem. The lock module shouldn't assign a journal to the FS | ||
22 | * mount. It shouldn't send recovery callbacks to the FS mount. If the node | ||
23 | * dies or withdraws, all locks can be wiped immediately. | ||
24 | */ | ||
25 | |||
26 | #define LM_MFLAG_SPECTATOR 0x00000001 | ||
27 | |||
28 | /* | ||
29 | * lm_lockstruct flags | ||
30 | * | ||
31 | * LM_LSFLAG_LOCAL | ||
32 | * The lock_nolock module returns LM_LSFLAG_LOCAL to GFS, indicating that GFS | ||
33 | * can make single-node optimizations. | ||
34 | */ | ||
35 | |||
36 | #define LM_LSFLAG_LOCAL 0x00000001 | ||
37 | |||
38 | /* | ||
39 | * lm_lockname types | ||
40 | */ | ||
41 | |||
42 | #define LM_TYPE_RESERVED 0x00 | ||
43 | #define LM_TYPE_NONDISK 0x01 | ||
44 | #define LM_TYPE_INODE 0x02 | ||
45 | #define LM_TYPE_RGRP 0x03 | ||
46 | #define LM_TYPE_META 0x04 | ||
47 | #define LM_TYPE_IOPEN 0x05 | ||
48 | #define LM_TYPE_FLOCK 0x06 | ||
49 | #define LM_TYPE_PLOCK 0x07 | ||
50 | #define LM_TYPE_QUOTA 0x08 | ||
51 | #define LM_TYPE_JOURNAL 0x09 | ||
52 | |||
53 | /* | ||
54 | * lm_lock() states | ||
55 | * | ||
56 | * SHARED is compatible with SHARED, not with DEFERRED or EX. | ||
57 | * DEFERRED is compatible with DEFERRED, not with SHARED or EX. | ||
58 | */ | ||
59 | |||
60 | #define LM_ST_UNLOCKED 0 | ||
61 | #define LM_ST_EXCLUSIVE 1 | ||
62 | #define LM_ST_DEFERRED 2 | ||
63 | #define LM_ST_SHARED 3 | ||
64 | |||
65 | /* | ||
66 | * lm_lock() flags | ||
67 | * | ||
68 | * LM_FLAG_TRY | ||
69 | * Don't wait to acquire the lock if it can't be granted immediately. | ||
70 | * | ||
71 | * LM_FLAG_TRY_1CB | ||
72 | * Send one blocking callback if TRY is set and the lock is not granted. | ||
73 | * | ||
74 | * LM_FLAG_NOEXP | ||
75 | * GFS sets this flag on lock requests it makes while doing journal recovery. | ||
76 | * These special requests should not be blocked due to the recovery like | ||
77 | * ordinary locks would be. | ||
78 | * | ||
79 | * LM_FLAG_ANY | ||
80 | * A SHARED request may also be granted in DEFERRED, or a DEFERRED request may | ||
81 | * also be granted in SHARED. The preferred state is whichever is compatible | ||
82 | * with other granted locks, or the specified state if no other locks exist. | ||
83 | * | ||
84 | * LM_FLAG_PRIORITY | ||
85 | * Override fairness considerations. Suppose a lock is held in a shared state | ||
86 | * and there is a pending request for the deferred state. A shared lock | ||
87 | * request with the priority flag would be allowed to bypass the deferred | ||
88 | * request and directly join the other shared lock. A shared lock request | ||
89 | * without the priority flag might be forced to wait until the deferred | ||
90 | * requested had acquired and released the lock. | ||
91 | */ | ||
92 | |||
93 | #define LM_FLAG_TRY 0x00000001 | ||
94 | #define LM_FLAG_TRY_1CB 0x00000002 | ||
95 | #define LM_FLAG_NOEXP 0x00000004 | ||
96 | #define LM_FLAG_ANY 0x00000008 | ||
97 | #define LM_FLAG_PRIORITY 0x00000010 | ||
98 | |||
99 | /* | ||
100 | * lm_lock() and lm_async_cb return flags | ||
101 | * | ||
102 | * LM_OUT_ST_MASK | ||
103 | * Masks the lower two bits of lock state in the returned value. | ||
104 | * | ||
105 | * LM_OUT_CACHEABLE | ||
106 | * The lock hasn't been released so GFS can continue to cache data for it. | ||
107 | * | ||
108 | * LM_OUT_CANCELED | ||
109 | * The lock request was canceled. | ||
110 | * | ||
111 | * LM_OUT_ASYNC | ||
112 | * The result of the request will be returned in an LM_CB_ASYNC callback. | ||
113 | */ | ||
114 | |||
115 | #define LM_OUT_ST_MASK 0x00000003 | ||
116 | #define LM_OUT_CACHEABLE 0x00000004 | ||
117 | #define LM_OUT_CANCELED 0x00000008 | ||
118 | #define LM_OUT_ASYNC 0x00000080 | ||
119 | #define LM_OUT_ERROR 0x00000100 | ||
120 | |||
121 | /* | ||
122 | * lm_callback_t types | ||
123 | * | ||
124 | * LM_CB_NEED_E LM_CB_NEED_D LM_CB_NEED_S | ||
125 | * Blocking callback, a remote node is requesting the given lock in | ||
126 | * EXCLUSIVE, DEFERRED, or SHARED. | ||
127 | * | ||
128 | * LM_CB_NEED_RECOVERY | ||
129 | * The given journal needs to be recovered. | ||
130 | * | ||
131 | * LM_CB_DROPLOCKS | ||
132 | * Reduce the number of cached locks. | ||
133 | * | ||
134 | * LM_CB_ASYNC | ||
135 | * The given lock has been granted. | ||
136 | */ | ||
137 | |||
138 | #define LM_CB_NEED_E 257 | ||
139 | #define LM_CB_NEED_D 258 | ||
140 | #define LM_CB_NEED_S 259 | ||
141 | #define LM_CB_NEED_RECOVERY 260 | ||
142 | #define LM_CB_DROPLOCKS 261 | ||
143 | #define LM_CB_ASYNC 262 | ||
144 | |||
145 | /* | ||
146 | * lm_recovery_done() messages | ||
147 | */ | ||
148 | |||
149 | #define LM_RD_GAVEUP 308 | ||
150 | #define LM_RD_SUCCESS 309 | ||
151 | |||
152 | |||
153 | struct lm_lockname { | ||
154 | u64 ln_number; | ||
155 | unsigned int ln_type; | ||
156 | }; | ||
157 | |||
158 | #define lm_name_equal(name1, name2) \ | ||
159 | (((name1)->ln_number == (name2)->ln_number) && \ | ||
160 | ((name1)->ln_type == (name2)->ln_type)) \ | ||
161 | |||
162 | struct lm_async_cb { | ||
163 | struct lm_lockname lc_name; | ||
164 | int lc_ret; | ||
165 | }; | ||
166 | |||
167 | struct lm_lockstruct; | ||
168 | |||
169 | struct lm_lockops { | ||
170 | const char *lm_proto_name; | ||
171 | |||
172 | /* | ||
173 | * Mount/Unmount | ||
174 | */ | ||
175 | |||
176 | int (*lm_mount) (char *table_name, char *host_data, | ||
177 | lm_callback_t cb, void *cb_data, | ||
178 | unsigned int min_lvb_size, int flags, | ||
179 | struct lm_lockstruct *lockstruct, | ||
180 | struct kobject *fskobj); | ||
181 | |||
182 | void (*lm_others_may_mount) (void *lockspace); | ||
183 | |||
184 | void (*lm_unmount) (void *lockspace); | ||
185 | |||
186 | void (*lm_withdraw) (void *lockspace); | ||
187 | |||
188 | /* | ||
189 | * Lock oriented operations | ||
190 | */ | ||
191 | |||
192 | int (*lm_get_lock) (void *lockspace, struct lm_lockname *name, void **lockp); | ||
193 | |||
194 | void (*lm_put_lock) (void *lock); | ||
195 | |||
196 | unsigned int (*lm_lock) (void *lock, unsigned int cur_state, | ||
197 | unsigned int req_state, unsigned int flags); | ||
198 | |||
199 | unsigned int (*lm_unlock) (void *lock, unsigned int cur_state); | ||
200 | |||
201 | void (*lm_cancel) (void *lock); | ||
202 | |||
203 | int (*lm_hold_lvb) (void *lock, char **lvbp); | ||
204 | void (*lm_unhold_lvb) (void *lock, char *lvb); | ||
205 | |||
206 | /* | ||
207 | * Posix Lock oriented operations | ||
208 | */ | ||
209 | |||
210 | int (*lm_plock_get) (void *lockspace, struct lm_lockname *name, | ||
211 | struct file *file, struct file_lock *fl); | ||
212 | |||
213 | int (*lm_plock) (void *lockspace, struct lm_lockname *name, | ||
214 | struct file *file, int cmd, struct file_lock *fl); | ||
215 | |||
216 | int (*lm_punlock) (void *lockspace, struct lm_lockname *name, | ||
217 | struct file *file, struct file_lock *fl); | ||
218 | |||
219 | /* | ||
220 | * Client oriented operations | ||
221 | */ | ||
222 | |||
223 | void (*lm_recovery_done) (void *lockspace, unsigned int jid, | ||
224 | unsigned int message); | ||
225 | |||
226 | struct module *lm_owner; | ||
227 | }; | ||
228 | |||
229 | /* | ||
230 | * lm_mount() return values | ||
231 | * | ||
232 | * ls_jid - the journal ID this node should use | ||
233 | * ls_first - this node is the first to mount the file system | ||
234 | * ls_lvb_size - size in bytes of lock value blocks | ||
235 | * ls_lockspace - lock module's context for this file system | ||
236 | * ls_ops - lock module's functions | ||
237 | * ls_flags - lock module features | ||
238 | */ | ||
239 | |||
240 | struct lm_lockstruct { | ||
241 | unsigned int ls_jid; | ||
242 | unsigned int ls_first; | ||
243 | unsigned int ls_lvb_size; | ||
244 | void *ls_lockspace; | ||
245 | const struct lm_lockops *ls_ops; | ||
246 | int ls_flags; | ||
247 | }; | ||
248 | |||
249 | /* | ||
250 | * Lock module bottom interface. A lock module makes itself available to GFS | ||
251 | * with these functions. | ||
252 | */ | ||
253 | |||
254 | int gfs2_register_lockproto(const struct lm_lockops *proto); | ||
255 | void gfs2_unregister_lockproto(const struct lm_lockops *proto); | ||
256 | |||
257 | /* | ||
258 | * Lock module top interface. GFS calls these functions when mounting or | ||
259 | * unmounting a file system. | ||
260 | */ | ||
261 | |||
262 | int gfs2_mount_lockproto(char *proto_name, char *table_name, char *host_data, | ||
263 | lm_callback_t cb, void *cb_data, | ||
264 | unsigned int min_lvb_size, int flags, | ||
265 | struct lm_lockstruct *lockstruct, | ||
266 | struct kobject *fskobj); | ||
267 | |||
268 | void gfs2_unmount_lockproto(struct lm_lockstruct *lockstruct); | ||
269 | |||
270 | void gfs2_withdraw_lockproto(struct lm_lockstruct *lockstruct); | ||
271 | |||
272 | #endif /* __LM_INTERFACE_DOT_H__ */ | ||
273 | |||
diff --git a/include/linux/lock_dlm_plock.h b/include/linux/lock_dlm_plock.h new file mode 100644 index 000000000000..fc3415113973 --- /dev/null +++ b/include/linux/lock_dlm_plock.h | |||
@@ -0,0 +1,41 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2005 Red Hat, Inc. All rights reserved. | ||
3 | * | ||
4 | * This copyrighted material is made available to anyone wishing to use, | ||
5 | * modify, copy, or redistribute it subject to the terms and conditions | ||
6 | * of the GNU General Public License v.2. | ||
7 | */ | ||
8 | |||
9 | #ifndef __LOCK_DLM_PLOCK_DOT_H__ | ||
10 | #define __LOCK_DLM_PLOCK_DOT_H__ | ||
11 | |||
12 | #define GDLM_PLOCK_MISC_NAME "lock_dlm_plock" | ||
13 | |||
14 | #define GDLM_PLOCK_VERSION_MAJOR 1 | ||
15 | #define GDLM_PLOCK_VERSION_MINOR 1 | ||
16 | #define GDLM_PLOCK_VERSION_PATCH 0 | ||
17 | |||
18 | enum { | ||
19 | GDLM_PLOCK_OP_LOCK = 1, | ||
20 | GDLM_PLOCK_OP_UNLOCK, | ||
21 | GDLM_PLOCK_OP_GET, | ||
22 | }; | ||
23 | |||
24 | struct gdlm_plock_info { | ||
25 | __u32 version[3]; | ||
26 | __u8 optype; | ||
27 | __u8 ex; | ||
28 | __u8 wait; | ||
29 | __u8 pad; | ||
30 | __u32 pid; | ||
31 | __s32 nodeid; | ||
32 | __s32 rv; | ||
33 | __u32 fsid; | ||
34 | __u64 number; | ||
35 | __u64 start; | ||
36 | __u64 end; | ||
37 | __u64 owner; | ||
38 | }; | ||
39 | |||
40 | #endif | ||
41 | |||
diff --git a/include/linux/lockd/bind.h b/include/linux/lockd/bind.h index b054debef2e0..81e3a185f951 100644 --- a/include/linux/lockd/bind.h +++ b/include/linux/lockd/bind.h | |||
@@ -30,7 +30,7 @@ extern struct nlmsvc_binding * nlmsvc_ops; | |||
30 | * Functions exported by the lockd module | 30 | * Functions exported by the lockd module |
31 | */ | 31 | */ |
32 | extern int nlmclnt_proc(struct inode *, int, struct file_lock *); | 32 | extern int nlmclnt_proc(struct inode *, int, struct file_lock *); |
33 | extern int lockd_up(void); | 33 | extern int lockd_up(int proto); |
34 | extern void lockd_down(void); | 34 | extern void lockd_down(void); |
35 | 35 | ||
36 | #endif /* LINUX_LOCKD_BIND_H */ | 36 | #endif /* LINUX_LOCKD_BIND_H */ |
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h index 0d92c468d55a..2909619c0295 100644 --- a/include/linux/lockd/lockd.h +++ b/include/linux/lockd/lockd.h | |||
@@ -37,17 +37,15 @@ | |||
37 | * Lockd host handle (used both by the client and server personality). | 37 | * Lockd host handle (used both by the client and server personality). |
38 | */ | 38 | */ |
39 | struct nlm_host { | 39 | struct nlm_host { |
40 | struct nlm_host * h_next; /* linked list (hash table) */ | 40 | struct hlist_node h_hash; /* doubly linked list */ |
41 | struct sockaddr_in h_addr; /* peer address */ | 41 | struct sockaddr_in h_addr; /* peer address */ |
42 | struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */ | 42 | struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */ |
43 | char h_name[20]; /* remote hostname */ | 43 | char * h_name; /* remote hostname */ |
44 | u32 h_version; /* interface version */ | 44 | u32 h_version; /* interface version */ |
45 | unsigned short h_proto; /* transport proto */ | 45 | unsigned short h_proto; /* transport proto */ |
46 | unsigned short h_reclaiming : 1, | 46 | unsigned short h_reclaiming : 1, |
47 | h_server : 1, /* server side, not client side */ | 47 | h_server : 1, /* server side, not client side */ |
48 | h_inuse : 1, | 48 | h_inuse : 1; |
49 | h_killed : 1, | ||
50 | h_monitored : 1; | ||
51 | wait_queue_head_t h_gracewait; /* wait while reclaiming */ | 49 | wait_queue_head_t h_gracewait; /* wait while reclaiming */ |
52 | struct rw_semaphore h_rwsem; /* Reboot recovery lock */ | 50 | struct rw_semaphore h_rwsem; /* Reboot recovery lock */ |
53 | u32 h_state; /* pseudo-state counter */ | 51 | u32 h_state; /* pseudo-state counter */ |
@@ -61,6 +59,16 @@ struct nlm_host { | |||
61 | spinlock_t h_lock; | 59 | spinlock_t h_lock; |
62 | struct list_head h_granted; /* Locks in GRANTED state */ | 60 | struct list_head h_granted; /* Locks in GRANTED state */ |
63 | struct list_head h_reclaim; /* Locks in RECLAIM state */ | 61 | struct list_head h_reclaim; /* Locks in RECLAIM state */ |
62 | struct nsm_handle * h_nsmhandle; /* NSM status handle */ | ||
63 | }; | ||
64 | |||
65 | struct nsm_handle { | ||
66 | struct list_head sm_link; | ||
67 | atomic_t sm_count; | ||
68 | char * sm_name; | ||
69 | struct sockaddr_in sm_addr; | ||
70 | unsigned int sm_monitored : 1, | ||
71 | sm_sticky : 1; /* don't unmonitor */ | ||
64 | }; | 72 | }; |
65 | 73 | ||
66 | /* | 74 | /* |
@@ -80,7 +88,7 @@ struct nlm_wait; | |||
80 | /* | 88 | /* |
81 | * Memory chunk for NLM client RPC request. | 89 | * Memory chunk for NLM client RPC request. |
82 | */ | 90 | */ |
83 | #define NLMCLNT_OHSIZE (sizeof(system_utsname.nodename)+10) | 91 | #define NLMCLNT_OHSIZE (sizeof(utsname()->nodename)+10) |
84 | struct nlm_rqst { | 92 | struct nlm_rqst { |
85 | unsigned int a_flags; /* initial RPC task flags */ | 93 | unsigned int a_flags; /* initial RPC task flags */ |
86 | struct nlm_host * a_host; /* host handle */ | 94 | struct nlm_host * a_host; /* host handle */ |
@@ -96,15 +104,14 @@ struct nlm_rqst { | |||
96 | * an NFS client. | 104 | * an NFS client. |
97 | */ | 105 | */ |
98 | struct nlm_file { | 106 | struct nlm_file { |
99 | struct nlm_file * f_next; /* linked list */ | 107 | struct hlist_node f_list; /* linked list */ |
100 | struct nfs_fh f_handle; /* NFS file handle */ | 108 | struct nfs_fh f_handle; /* NFS file handle */ |
101 | struct file * f_file; /* VFS file pointer */ | 109 | struct file * f_file; /* VFS file pointer */ |
102 | struct nlm_share * f_shares; /* DOS shares */ | 110 | struct nlm_share * f_shares; /* DOS shares */ |
103 | struct nlm_block * f_blocks; /* blocked locks */ | 111 | struct list_head f_blocks; /* blocked locks */ |
104 | unsigned int f_locks; /* guesstimate # of locks */ | 112 | unsigned int f_locks; /* guesstimate # of locks */ |
105 | unsigned int f_count; /* reference count */ | 113 | unsigned int f_count; /* reference count */ |
106 | struct semaphore f_sema; /* avoid concurrent access */ | 114 | struct mutex f_mutex; /* avoid concurrent access */ |
107 | int f_hash; /* hash of f_handle */ | ||
108 | }; | 115 | }; |
109 | 116 | ||
110 | /* | 117 | /* |
@@ -114,26 +121,18 @@ struct nlm_file { | |||
114 | #define NLM_NEVER (~(unsigned long) 0) | 121 | #define NLM_NEVER (~(unsigned long) 0) |
115 | struct nlm_block { | 122 | struct nlm_block { |
116 | struct kref b_count; /* Reference count */ | 123 | struct kref b_count; /* Reference count */ |
117 | struct nlm_block * b_next; /* linked list (all blocks) */ | 124 | struct list_head b_list; /* linked list of all blocks */ |
118 | struct nlm_block * b_fnext; /* linked list (per file) */ | 125 | struct list_head b_flist; /* linked list (per file) */ |
119 | struct nlm_rqst * b_call; /* RPC args & callback info */ | 126 | struct nlm_rqst * b_call; /* RPC args & callback info */ |
120 | struct svc_serv * b_daemon; /* NLM service */ | 127 | struct svc_serv * b_daemon; /* NLM service */ |
121 | struct nlm_host * b_host; /* host handle for RPC clnt */ | 128 | struct nlm_host * b_host; /* host handle for RPC clnt */ |
122 | unsigned long b_when; /* next re-xmit */ | 129 | unsigned long b_when; /* next re-xmit */ |
123 | unsigned int b_id; /* block id */ | 130 | unsigned int b_id; /* block id */ |
124 | unsigned char b_queued; /* re-queued */ | ||
125 | unsigned char b_granted; /* VFS granted lock */ | 131 | unsigned char b_granted; /* VFS granted lock */ |
126 | struct nlm_file * b_file; /* file in question */ | 132 | struct nlm_file * b_file; /* file in question */ |
127 | }; | 133 | }; |
128 | 134 | ||
129 | /* | 135 | /* |
130 | * Valid actions for nlmsvc_traverse_files | ||
131 | */ | ||
132 | #define NLM_ACT_CHECK 0 /* check for locks */ | ||
133 | #define NLM_ACT_MARK 1 /* mark & sweep */ | ||
134 | #define NLM_ACT_UNLOCK 2 /* release all locks */ | ||
135 | |||
136 | /* | ||
137 | * Global variables | 136 | * Global variables |
138 | */ | 137 | */ |
139 | extern struct rpc_program nlm_program; | 138 | extern struct rpc_program nlm_program; |
@@ -143,6 +142,7 @@ extern struct svc_procedure nlmsvc_procedures4[]; | |||
143 | #endif | 142 | #endif |
144 | extern int nlmsvc_grace_period; | 143 | extern int nlmsvc_grace_period; |
145 | extern unsigned long nlmsvc_timeout; | 144 | extern unsigned long nlmsvc_timeout; |
145 | extern int nsm_use_hostnames; | ||
146 | 146 | ||
147 | /* | 147 | /* |
148 | * Lockd client functions | 148 | * Lockd client functions |
@@ -155,22 +155,31 @@ struct nlm_wait * nlmclnt_prepare_block(struct nlm_host *host, struct file_lock | |||
155 | void nlmclnt_finish_block(struct nlm_wait *block); | 155 | void nlmclnt_finish_block(struct nlm_wait *block); |
156 | int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout); | 156 | int nlmclnt_block(struct nlm_wait *block, struct nlm_rqst *req, long timeout); |
157 | u32 nlmclnt_grant(const struct sockaddr_in *addr, const struct nlm_lock *); | 157 | u32 nlmclnt_grant(const struct sockaddr_in *addr, const struct nlm_lock *); |
158 | void nlmclnt_recovery(struct nlm_host *, u32); | 158 | void nlmclnt_recovery(struct nlm_host *); |
159 | int nlmclnt_reclaim(struct nlm_host *, struct file_lock *); | 159 | int nlmclnt_reclaim(struct nlm_host *, struct file_lock *); |
160 | void nlmclnt_next_cookie(struct nlm_cookie *); | ||
160 | 161 | ||
161 | /* | 162 | /* |
162 | * Host cache | 163 | * Host cache |
163 | */ | 164 | */ |
164 | struct nlm_host * nlmclnt_lookup_host(struct sockaddr_in *, int, int); | 165 | struct nlm_host * nlmclnt_lookup_host(const struct sockaddr_in *, int, int, const char *, int); |
165 | struct nlm_host * nlmsvc_lookup_host(struct svc_rqst *); | 166 | struct nlm_host * nlmsvc_lookup_host(struct svc_rqst *, const char *, int); |
166 | struct nlm_host * nlm_lookup_host(int server, struct sockaddr_in *, int, int); | 167 | struct nlm_host * nlm_lookup_host(int server, const struct sockaddr_in *, int, int, const char *, int); |
167 | struct rpc_clnt * nlm_bind_host(struct nlm_host *); | 168 | struct rpc_clnt * nlm_bind_host(struct nlm_host *); |
168 | void nlm_rebind_host(struct nlm_host *); | 169 | void nlm_rebind_host(struct nlm_host *); |
169 | struct nlm_host * nlm_get_host(struct nlm_host *); | 170 | struct nlm_host * nlm_get_host(struct nlm_host *); |
170 | void nlm_release_host(struct nlm_host *); | 171 | void nlm_release_host(struct nlm_host *); |
171 | void nlm_shutdown_hosts(void); | 172 | void nlm_shutdown_hosts(void); |
172 | extern struct nlm_host *nlm_find_client(void); | 173 | extern void nlm_host_rebooted(const struct sockaddr_in *, const char *, int, u32); |
174 | struct nsm_handle *nsm_find(const struct sockaddr_in *, const char *, int); | ||
175 | void nsm_release(struct nsm_handle *); | ||
176 | |||
173 | 177 | ||
178 | /* | ||
179 | * This is used in garbage collection and resource reclaim | ||
180 | * A return value != 0 means destroy the lock/block/share | ||
181 | */ | ||
182 | typedef int (*nlm_host_match_fn_t)(struct nlm_host *cur, struct nlm_host *ref); | ||
174 | 183 | ||
175 | /* | 184 | /* |
176 | * Server-side lock handling | 185 | * Server-side lock handling |
@@ -183,8 +192,8 @@ u32 nlmsvc_testlock(struct nlm_file *, struct nlm_lock *, | |||
183 | u32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *); | 192 | u32 nlmsvc_cancel_blocked(struct nlm_file *, struct nlm_lock *); |
184 | unsigned long nlmsvc_retry_blocked(void); | 193 | unsigned long nlmsvc_retry_blocked(void); |
185 | void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *, | 194 | void nlmsvc_traverse_blocks(struct nlm_host *, struct nlm_file *, |
186 | int action); | 195 | nlm_host_match_fn_t match); |
187 | void nlmsvc_grant_reply(struct svc_rqst *, struct nlm_cookie *, u32); | 196 | void nlmsvc_grant_reply(struct nlm_cookie *, u32); |
188 | 197 | ||
189 | /* | 198 | /* |
190 | * File handling for the server personality | 199 | * File handling for the server personality |
diff --git a/include/linux/lockd/share.h b/include/linux/lockd/share.h index c75a424ebe4c..cd7816e74c05 100644 --- a/include/linux/lockd/share.h +++ b/include/linux/lockd/share.h | |||
@@ -25,6 +25,7 @@ u32 nlmsvc_share_file(struct nlm_host *, struct nlm_file *, | |||
25 | struct nlm_args *); | 25 | struct nlm_args *); |
26 | u32 nlmsvc_unshare_file(struct nlm_host *, struct nlm_file *, | 26 | u32 nlmsvc_unshare_file(struct nlm_host *, struct nlm_file *, |
27 | struct nlm_args *); | 27 | struct nlm_args *); |
28 | void nlmsvc_traverse_shares(struct nlm_host *, struct nlm_file *, int); | 28 | void nlmsvc_traverse_shares(struct nlm_host *, struct nlm_file *, |
29 | nlm_host_match_fn_t); | ||
29 | 30 | ||
30 | #endif /* LINUX_LOCKD_SHARE_H */ | 31 | #endif /* LINUX_LOCKD_SHARE_H */ |
diff --git a/include/linux/lockd/sm_inter.h b/include/linux/lockd/sm_inter.h index 1080bb6ae315..fc61d40964da 100644 --- a/include/linux/lockd/sm_inter.h +++ b/include/linux/lockd/sm_inter.h | |||
@@ -28,7 +28,8 @@ struct nsm_args { | |||
28 | u32 prog; /* RPC callback info */ | 28 | u32 prog; /* RPC callback info */ |
29 | u32 vers; | 29 | u32 vers; |
30 | u32 proc; | 30 | u32 proc; |
31 | u32 proto; /* protocol (udp/tcp) plus server/client flag */ | 31 | |
32 | char * mon_name; | ||
32 | }; | 33 | }; |
33 | 34 | ||
34 | /* | 35 | /* |
@@ -41,6 +42,6 @@ struct nsm_res { | |||
41 | 42 | ||
42 | int nsm_monitor(struct nlm_host *); | 43 | int nsm_monitor(struct nlm_host *); |
43 | int nsm_unmonitor(struct nlm_host *); | 44 | int nsm_unmonitor(struct nlm_host *); |
44 | extern u32 nsm_local_state; | 45 | extern int nsm_local_state; |
45 | 46 | ||
46 | #endif /* LINUX_LOCKD_SM_INTER_H */ | 47 | #endif /* LINUX_LOCKD_SM_INTER_H */ |
diff --git a/include/linux/lockd/xdr4.h b/include/linux/lockd/xdr4.h index cee36e7c0548..3cc1ae25009b 100644 --- a/include/linux/lockd/xdr4.h +++ b/include/linux/lockd/xdr4.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/linux/lockd/xdr.h | 2 | * linux/include/linux/lockd/xdr4.h |
3 | * | 3 | * |
4 | * XDR types for the NLM protocol | 4 | * XDR types for the NLM protocol |
5 | * | 5 | * |
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h index c040a8c969aa..1314ca0f29be 100644 --- a/include/linux/lockdep.h +++ b/include/linux/lockdep.h | |||
@@ -8,13 +8,13 @@ | |||
8 | #ifndef __LINUX_LOCKDEP_H | 8 | #ifndef __LINUX_LOCKDEP_H |
9 | #define __LINUX_LOCKDEP_H | 9 | #define __LINUX_LOCKDEP_H |
10 | 10 | ||
11 | #ifdef CONFIG_LOCKDEP | ||
12 | |||
11 | #include <linux/linkage.h> | 13 | #include <linux/linkage.h> |
12 | #include <linux/list.h> | 14 | #include <linux/list.h> |
13 | #include <linux/debug_locks.h> | 15 | #include <linux/debug_locks.h> |
14 | #include <linux/stacktrace.h> | 16 | #include <linux/stacktrace.h> |
15 | 17 | ||
16 | #ifdef CONFIG_LOCKDEP | ||
17 | |||
18 | /* | 18 | /* |
19 | * Lock-class usage-state bits: | 19 | * Lock-class usage-state bits: |
20 | */ | 20 | */ |
diff --git a/include/linux/loop.h b/include/linux/loop.h index e76c7611d6cc..191a595055f0 100644 --- a/include/linux/loop.h +++ b/include/linux/loop.h | |||
@@ -59,10 +59,9 @@ struct loop_device { | |||
59 | struct bio *lo_bio; | 59 | struct bio *lo_bio; |
60 | struct bio *lo_biotail; | 60 | struct bio *lo_biotail; |
61 | int lo_state; | 61 | int lo_state; |
62 | struct completion lo_done; | ||
63 | struct completion lo_bh_done; | ||
64 | struct mutex lo_ctl_mutex; | 62 | struct mutex lo_ctl_mutex; |
65 | int lo_pending; | 63 | struct task_struct *lo_thread; |
64 | wait_queue_head_t lo_event; | ||
66 | 65 | ||
67 | request_queue_t *lo_queue; | 66 | request_queue_t *lo_queue; |
68 | }; | 67 | }; |
diff --git a/include/linux/memory.h b/include/linux/memory.h index 8f04143ca363..654ef5544878 100644 --- a/include/linux/memory.h +++ b/include/linux/memory.h | |||
@@ -57,7 +57,7 @@ struct memory_block { | |||
57 | struct notifier_block; | 57 | struct notifier_block; |
58 | struct mem_section; | 58 | struct mem_section; |
59 | 59 | ||
60 | #ifndef CONFIG_MEMORY_HOTPLUG | 60 | #ifndef CONFIG_MEMORY_HOTPLUG_SPARSE |
61 | static inline int memory_dev_init(void) | 61 | static inline int memory_dev_init(void) |
62 | { | 62 | { |
63 | return 0; | 63 | return 0; |
@@ -78,7 +78,7 @@ extern int remove_memory_block(unsigned long, struct mem_section *, int); | |||
78 | #define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) | 78 | #define CONFIG_MEM_BLOCK_SIZE (PAGES_PER_SECTION<<PAGE_SHIFT) |
79 | 79 | ||
80 | 80 | ||
81 | #endif /* CONFIG_MEMORY_HOTPLUG */ | 81 | #endif /* CONFIG_MEMORY_HOTPLUG_SPARSE */ |
82 | 82 | ||
83 | #define hotplug_memory_notifier(fn, pri) { \ | 83 | #define hotplug_memory_notifier(fn, pri) { \ |
84 | static struct notifier_block fn##_mem_nb = \ | 84 | static struct notifier_block fn##_mem_nb = \ |
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h index 218501cfaeb9..7b54666cea8e 100644 --- a/include/linux/memory_hotplug.h +++ b/include/linux/memory_hotplug.h | |||
@@ -172,5 +172,7 @@ static inline int __remove_pages(struct zone *zone, unsigned long start_pfn, | |||
172 | extern int add_memory(int nid, u64 start, u64 size); | 172 | extern int add_memory(int nid, u64 start, u64 size); |
173 | extern int arch_add_memory(int nid, u64 start, u64 size); | 173 | extern int arch_add_memory(int nid, u64 start, u64 size); |
174 | extern int remove_memory(u64 start, u64 size); | 174 | extern int remove_memory(u64 start, u64 size); |
175 | extern int sparse_add_one_section(struct zone *zone, unsigned long start_pfn, | ||
176 | int nr_pages); | ||
175 | 177 | ||
176 | #endif /* __LINUX_MEMORY_HOTPLUG_H */ | 178 | #endif /* __LINUX_MEMORY_HOTPLUG_H */ |
diff --git a/include/linux/mm.h b/include/linux/mm.h index 856f0ee7e84a..b7966ab8cb6a 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/mutex.h> | 16 | #include <linux/mutex.h> |
17 | #include <linux/debug_locks.h> | 17 | #include <linux/debug_locks.h> |
18 | #include <linux/backing-dev.h> | 18 | #include <linux/backing-dev.h> |
19 | #include <linux/mm_types.h> | ||
19 | 20 | ||
20 | struct mempolicy; | 21 | struct mempolicy; |
21 | struct anon_vma; | 22 | struct anon_vma; |
@@ -198,6 +199,7 @@ struct vm_operations_struct { | |||
198 | void (*open)(struct vm_area_struct * area); | 199 | void (*open)(struct vm_area_struct * area); |
199 | void (*close)(struct vm_area_struct * area); | 200 | void (*close)(struct vm_area_struct * area); |
200 | struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int *type); | 201 | struct page * (*nopage)(struct vm_area_struct * area, unsigned long address, int *type); |
202 | unsigned long (*nopfn)(struct vm_area_struct * area, unsigned long address); | ||
201 | int (*populate)(struct vm_area_struct * area, unsigned long address, unsigned long len, pgprot_t prot, unsigned long pgoff, int nonblock); | 203 | int (*populate)(struct vm_area_struct * area, unsigned long address, unsigned long len, pgprot_t prot, unsigned long pgoff, int nonblock); |
202 | 204 | ||
203 | /* notification that a previously read-only page is about to become | 205 | /* notification that a previously read-only page is about to become |
@@ -215,62 +217,6 @@ struct vm_operations_struct { | |||
215 | struct mmu_gather; | 217 | struct mmu_gather; |
216 | struct inode; | 218 | struct inode; |
217 | 219 | ||
218 | /* | ||
219 | * Each physical page in the system has a struct page associated with | ||
220 | * it to keep track of whatever it is we are using the page for at the | ||
221 | * moment. Note that we have no way to track which tasks are using | ||
222 | * a page, though if it is a pagecache page, rmap structures can tell us | ||
223 | * who is mapping it. | ||
224 | */ | ||
225 | struct page { | ||
226 | unsigned long flags; /* Atomic flags, some possibly | ||
227 | * updated asynchronously */ | ||
228 | atomic_t _count; /* Usage count, see below. */ | ||
229 | atomic_t _mapcount; /* Count of ptes mapped in mms, | ||
230 | * to show when page is mapped | ||
231 | * & limit reverse map searches. | ||
232 | */ | ||
233 | union { | ||
234 | struct { | ||
235 | unsigned long private; /* Mapping-private opaque data: | ||
236 | * usually used for buffer_heads | ||
237 | * if PagePrivate set; used for | ||
238 | * swp_entry_t if PageSwapCache; | ||
239 | * indicates order in the buddy | ||
240 | * system if PG_buddy is set. | ||
241 | */ | ||
242 | struct address_space *mapping; /* If low bit clear, points to | ||
243 | * inode address_space, or NULL. | ||
244 | * If page mapped as anonymous | ||
245 | * memory, low bit is set, and | ||
246 | * it points to anon_vma object: | ||
247 | * see PAGE_MAPPING_ANON below. | ||
248 | */ | ||
249 | }; | ||
250 | #if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS | ||
251 | spinlock_t ptl; | ||
252 | #endif | ||
253 | }; | ||
254 | pgoff_t index; /* Our offset within mapping. */ | ||
255 | struct list_head lru; /* Pageout list, eg. active_list | ||
256 | * protected by zone->lru_lock ! | ||
257 | */ | ||
258 | /* | ||
259 | * On machines where all RAM is mapped into kernel address space, | ||
260 | * we can simply calculate the virtual address. On machines with | ||
261 | * highmem some memory is mapped into kernel virtual memory | ||
262 | * dynamically, so we need a place to store that address. | ||
263 | * Note that this field could be 16 bits on x86 ... ;) | ||
264 | * | ||
265 | * Architectures with slow multiplication can define | ||
266 | * WANT_PAGE_VIRTUAL in asm/page.h | ||
267 | */ | ||
268 | #if defined(WANT_PAGE_VIRTUAL) | ||
269 | void *virtual; /* Kernel virtual address (NULL if | ||
270 | not kmapped, ie. highmem) */ | ||
271 | #endif /* WANT_PAGE_VIRTUAL */ | ||
272 | }; | ||
273 | |||
274 | #define page_private(page) ((page)->private) | 220 | #define page_private(page) ((page)->private) |
275 | #define set_page_private(page, v) ((page)->private = (v)) | 221 | #define set_page_private(page, v) ((page)->private = (v)) |
276 | 222 | ||
@@ -501,7 +447,11 @@ static inline struct zone *page_zone(struct page *page) | |||
501 | 447 | ||
502 | static inline unsigned long zone_to_nid(struct zone *zone) | 448 | static inline unsigned long zone_to_nid(struct zone *zone) |
503 | { | 449 | { |
504 | return zone->zone_pgdat->node_id; | 450 | #ifdef CONFIG_NUMA |
451 | return zone->node; | ||
452 | #else | ||
453 | return 0; | ||
454 | #endif | ||
505 | } | 455 | } |
506 | 456 | ||
507 | static inline unsigned long page_to_nid(struct page *page) | 457 | static inline unsigned long page_to_nid(struct page *page) |
@@ -546,11 +496,6 @@ static inline void set_page_links(struct page *page, enum zone_type zone, | |||
546 | */ | 496 | */ |
547 | #include <linux/vmstat.h> | 497 | #include <linux/vmstat.h> |
548 | 498 | ||
549 | #ifndef CONFIG_DISCONTIGMEM | ||
550 | /* The array of struct pages - for discontigmem use pgdat->lmem_map */ | ||
551 | extern struct page *mem_map; | ||
552 | #endif | ||
553 | |||
554 | static __always_inline void *lowmem_page_address(struct page *page) | 499 | static __always_inline void *lowmem_page_address(struct page *page) |
555 | { | 500 | { |
556 | return __va(page_to_pfn(page) << PAGE_SHIFT); | 501 | return __va(page_to_pfn(page) << PAGE_SHIFT); |
@@ -650,6 +595,12 @@ static inline int page_mapped(struct page *page) | |||
650 | #define NOPAGE_OOM ((struct page *) (-1)) | 595 | #define NOPAGE_OOM ((struct page *) (-1)) |
651 | 596 | ||
652 | /* | 597 | /* |
598 | * Error return values for the *_nopfn functions | ||
599 | */ | ||
600 | #define NOPFN_SIGBUS ((unsigned long) -1) | ||
601 | #define NOPFN_OOM ((unsigned long) -2) | ||
602 | |||
603 | /* | ||
653 | * Different kinds of faults, as returned by handle_mm_fault(). | 604 | * Different kinds of faults, as returned by handle_mm_fault(). |
654 | * Used to decide whether a process gets delivered SIGBUS or | 605 | * Used to decide whether a process gets delivered SIGBUS or |
655 | * just gets major/minor fault counters bumped up. | 606 | * just gets major/minor fault counters bumped up. |
@@ -792,7 +743,9 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm, unsigned long | |||
792 | int len, int write, int force, struct page **pages, struct vm_area_struct **vmas); | 743 | int len, int write, int force, struct page **pages, struct vm_area_struct **vmas); |
793 | void print_bad_pte(struct vm_area_struct *, pte_t, unsigned long); | 744 | void print_bad_pte(struct vm_area_struct *, pte_t, unsigned long); |
794 | 745 | ||
795 | int __set_page_dirty_buffers(struct page *page); | 746 | extern int try_to_release_page(struct page * page, gfp_t gfp_mask); |
747 | extern void do_invalidatepage(struct page *page, unsigned long offset); | ||
748 | |||
796 | int __set_page_dirty_nobuffers(struct page *page); | 749 | int __set_page_dirty_nobuffers(struct page *page); |
797 | int redirty_page_for_writepage(struct writeback_control *wbc, | 750 | int redirty_page_for_writepage(struct writeback_control *wbc, |
798 | struct page *page); | 751 | struct page *page); |
@@ -937,12 +890,64 @@ extern void free_area_init(unsigned long * zones_size); | |||
937 | extern void free_area_init_node(int nid, pg_data_t *pgdat, | 890 | extern void free_area_init_node(int nid, pg_data_t *pgdat, |
938 | unsigned long * zones_size, unsigned long zone_start_pfn, | 891 | unsigned long * zones_size, unsigned long zone_start_pfn, |
939 | unsigned long *zholes_size); | 892 | unsigned long *zholes_size); |
893 | #ifdef CONFIG_ARCH_POPULATES_NODE_MAP | ||
894 | /* | ||
895 | * With CONFIG_ARCH_POPULATES_NODE_MAP set, an architecture may initialise its | ||
896 | * zones, allocate the backing mem_map and account for memory holes in a more | ||
897 | * architecture independent manner. This is a substitute for creating the | ||
898 | * zone_sizes[] and zholes_size[] arrays and passing them to | ||
899 | * free_area_init_node() | ||
900 | * | ||
901 | * An architecture is expected to register range of page frames backed by | ||
902 | * physical memory with add_active_range() before calling | ||
903 | * free_area_init_nodes() passing in the PFN each zone ends at. At a basic | ||
904 | * usage, an architecture is expected to do something like | ||
905 | * | ||
906 | * unsigned long max_zone_pfns[MAX_NR_ZONES] = {max_dma, max_normal_pfn, | ||
907 | * max_highmem_pfn}; | ||
908 | * for_each_valid_physical_page_range() | ||
909 | * add_active_range(node_id, start_pfn, end_pfn) | ||
910 | * free_area_init_nodes(max_zone_pfns); | ||
911 | * | ||
912 | * If the architecture guarantees that there are no holes in the ranges | ||
913 | * registered with add_active_range(), free_bootmem_active_regions() | ||
914 | * will call free_bootmem_node() for each registered physical page range. | ||
915 | * Similarly sparse_memory_present_with_active_regions() calls | ||
916 | * memory_present() for each range when SPARSEMEM is enabled. | ||
917 | * | ||
918 | * See mm/page_alloc.c for more information on each function exposed by | ||
919 | * CONFIG_ARCH_POPULATES_NODE_MAP | ||
920 | */ | ||
921 | extern void free_area_init_nodes(unsigned long *max_zone_pfn); | ||
922 | extern void add_active_range(unsigned int nid, unsigned long start_pfn, | ||
923 | unsigned long end_pfn); | ||
924 | extern void shrink_active_range(unsigned int nid, unsigned long old_end_pfn, | ||
925 | unsigned long new_end_pfn); | ||
926 | extern void push_node_boundaries(unsigned int nid, unsigned long start_pfn, | ||
927 | unsigned long end_pfn); | ||
928 | extern void remove_all_active_ranges(void); | ||
929 | extern unsigned long absent_pages_in_range(unsigned long start_pfn, | ||
930 | unsigned long end_pfn); | ||
931 | extern void get_pfn_range_for_nid(unsigned int nid, | ||
932 | unsigned long *start_pfn, unsigned long *end_pfn); | ||
933 | extern unsigned long find_min_pfn_with_active_regions(void); | ||
934 | extern unsigned long find_max_pfn_with_active_regions(void); | ||
935 | extern void free_bootmem_with_active_regions(int nid, | ||
936 | unsigned long max_low_pfn); | ||
937 | extern void sparse_memory_present_with_active_regions(int nid); | ||
938 | #ifndef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID | ||
939 | extern int early_pfn_to_nid(unsigned long pfn); | ||
940 | #endif /* CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID */ | ||
941 | #endif /* CONFIG_ARCH_POPULATES_NODE_MAP */ | ||
942 | extern void set_dma_reserve(unsigned long new_dma_reserve); | ||
940 | extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long); | 943 | extern void memmap_init_zone(unsigned long, int, unsigned long, unsigned long); |
941 | extern void setup_per_zone_pages_min(void); | 944 | extern void setup_per_zone_pages_min(void); |
942 | extern void mem_init(void); | 945 | extern void mem_init(void); |
943 | extern void show_mem(void); | 946 | extern void show_mem(void); |
944 | extern void si_meminfo(struct sysinfo * val); | 947 | extern void si_meminfo(struct sysinfo * val); |
945 | extern void si_meminfo_node(struct sysinfo *val, int nid); | 948 | extern void si_meminfo_node(struct sysinfo *val, int nid); |
949 | extern void zonetable_add(struct zone *zone, int nid, enum zone_type zid, | ||
950 | unsigned long pfn, unsigned long size); | ||
946 | 951 | ||
947 | #ifdef CONFIG_NUMA | 952 | #ifdef CONFIG_NUMA |
948 | extern void setup_per_cpu_pageset(void); | 953 | extern void setup_per_cpu_pageset(void); |
@@ -1130,7 +1135,7 @@ void drop_slab(void); | |||
1130 | extern int randomize_va_space; | 1135 | extern int randomize_va_space; |
1131 | #endif | 1136 | #endif |
1132 | 1137 | ||
1133 | const char *arch_vma_name(struct vm_area_struct *vma); | 1138 | __attribute__((weak)) const char *arch_vma_name(struct vm_area_struct *vma); |
1134 | 1139 | ||
1135 | #endif /* __KERNEL__ */ | 1140 | #endif /* __KERNEL__ */ |
1136 | #endif /* _LINUX_MM_H */ | 1141 | #endif /* _LINUX_MM_H */ |
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h new file mode 100644 index 000000000000..c3852fd4a1cc --- /dev/null +++ b/include/linux/mm_types.h | |||
@@ -0,0 +1,67 @@ | |||
1 | #ifndef _LINUX_MM_TYPES_H | ||
2 | #define _LINUX_MM_TYPES_H | ||
3 | |||
4 | #include <linux/types.h> | ||
5 | #include <linux/threads.h> | ||
6 | #include <linux/list.h> | ||
7 | #include <linux/spinlock.h> | ||
8 | |||
9 | struct address_space; | ||
10 | |||
11 | /* | ||
12 | * Each physical page in the system has a struct page associated with | ||
13 | * it to keep track of whatever it is we are using the page for at the | ||
14 | * moment. Note that we have no way to track which tasks are using | ||
15 | * a page, though if it is a pagecache page, rmap structures can tell us | ||
16 | * who is mapping it. | ||
17 | */ | ||
18 | struct page { | ||
19 | unsigned long flags; /* Atomic flags, some possibly | ||
20 | * updated asynchronously */ | ||
21 | atomic_t _count; /* Usage count, see below. */ | ||
22 | atomic_t _mapcount; /* Count of ptes mapped in mms, | ||
23 | * to show when page is mapped | ||
24 | * & limit reverse map searches. | ||
25 | */ | ||
26 | union { | ||
27 | struct { | ||
28 | unsigned long private; /* Mapping-private opaque data: | ||
29 | * usually used for buffer_heads | ||
30 | * if PagePrivate set; used for | ||
31 | * swp_entry_t if PageSwapCache; | ||
32 | * indicates order in the buddy | ||
33 | * system if PG_buddy is set. | ||
34 | */ | ||
35 | struct address_space *mapping; /* If low bit clear, points to | ||
36 | * inode address_space, or NULL. | ||
37 | * If page mapped as anonymous | ||
38 | * memory, low bit is set, and | ||
39 | * it points to anon_vma object: | ||
40 | * see PAGE_MAPPING_ANON below. | ||
41 | */ | ||
42 | }; | ||
43 | #if NR_CPUS >= CONFIG_SPLIT_PTLOCK_CPUS | ||
44 | spinlock_t ptl; | ||
45 | #endif | ||
46 | }; | ||
47 | pgoff_t index; /* Our offset within mapping. */ | ||
48 | struct list_head lru; /* Pageout list, eg. active_list | ||
49 | * protected by zone->lru_lock ! | ||
50 | */ | ||
51 | /* | ||
52 | * On machines where all RAM is mapped into kernel address space, | ||
53 | * we can simply calculate the virtual address. On machines with | ||
54 | * highmem some memory is mapped into kernel virtual memory | ||
55 | * dynamically, so we need a place to store that address. | ||
56 | * Note that this field could be 16 bits on x86 ... ;) | ||
57 | * | ||
58 | * Architectures with slow multiplication can define | ||
59 | * WANT_PAGE_VIRTUAL in asm/page.h | ||
60 | */ | ||
61 | #if defined(WANT_PAGE_VIRTUAL) | ||
62 | void *virtual; /* Kernel virtual address (NULL if | ||
63 | not kmapped, ie. highmem) */ | ||
64 | #endif /* WANT_PAGE_VIRTUAL */ | ||
65 | }; | ||
66 | |||
67 | #endif /* _LINUX_MM_TYPES_H */ | ||
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h index ba095aebedff..587264a58d56 100644 --- a/include/linux/mmc/host.h +++ b/include/linux/mmc/host.h | |||
@@ -85,6 +85,8 @@ struct mmc_host { | |||
85 | unsigned long caps; /* Host capabilities */ | 85 | unsigned long caps; /* Host capabilities */ |
86 | 86 | ||
87 | #define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */ | 87 | #define MMC_CAP_4_BIT_DATA (1 << 0) /* Can the host do 4 bit transfers */ |
88 | #define MMC_CAP_MULTIWRITE (1 << 1) /* Can accurately report bytes sent to card on error */ | ||
89 | #define MMC_CAP_BYTEBLOCK (1 << 2) /* Can do non-log2 block sizes */ | ||
88 | 90 | ||
89 | /* host specific block data */ | 91 | /* host specific block data */ |
90 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ | 92 | unsigned int max_seg_size; /* see blk_queue_max_segment_size */ |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 627e2c08ce41..a3594dfd6963 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
@@ -68,7 +68,6 @@ struct mmc_command { | |||
68 | struct mmc_data { | 68 | struct mmc_data { |
69 | unsigned int timeout_ns; /* data timeout (in ns, max 80ms) */ | 69 | unsigned int timeout_ns; /* data timeout (in ns, max 80ms) */ |
70 | unsigned int timeout_clks; /* data timeout (in clocks) */ | 70 | unsigned int timeout_clks; /* data timeout (in clocks) */ |
71 | unsigned int blksz_bits; /* data block size */ | ||
72 | unsigned int blksz; /* data block size */ | 71 | unsigned int blksz; /* data block size */ |
73 | unsigned int blocks; /* number of blocks */ | 72 | unsigned int blocks; /* number of blocks */ |
74 | unsigned int error; /* data error */ | 73 | unsigned int error; /* data error */ |
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 3693f1a52788..59855b8718a0 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h | |||
@@ -58,6 +58,7 @@ enum zone_stat_item { | |||
58 | NR_WRITEBACK, | 58 | NR_WRITEBACK, |
59 | NR_UNSTABLE_NFS, /* NFS unstable pages */ | 59 | NR_UNSTABLE_NFS, /* NFS unstable pages */ |
60 | NR_BOUNCE, | 60 | NR_BOUNCE, |
61 | NR_VMSCAN_WRITE, | ||
61 | #ifdef CONFIG_NUMA | 62 | #ifdef CONFIG_NUMA |
62 | NUMA_HIT, /* allocated in intended node */ | 63 | NUMA_HIT, /* allocated in intended node */ |
63 | NUMA_MISS, /* allocated in non intended node */ | 64 | NUMA_MISS, /* allocated in non intended node */ |
@@ -167,6 +168,7 @@ struct zone { | |||
167 | unsigned long lowmem_reserve[MAX_NR_ZONES]; | 168 | unsigned long lowmem_reserve[MAX_NR_ZONES]; |
168 | 169 | ||
169 | #ifdef CONFIG_NUMA | 170 | #ifdef CONFIG_NUMA |
171 | int node; | ||
170 | /* | 172 | /* |
171 | * zone reclaim becomes active if more unmapped pages exist. | 173 | * zone reclaim becomes active if more unmapped pages exist. |
172 | */ | 174 | */ |
@@ -305,6 +307,18 @@ struct zonelist { | |||
305 | struct zone *zones[MAX_NUMNODES * MAX_NR_ZONES + 1]; // NULL delimited | 307 | struct zone *zones[MAX_NUMNODES * MAX_NR_ZONES + 1]; // NULL delimited |
306 | }; | 308 | }; |
307 | 309 | ||
310 | #ifdef CONFIG_ARCH_POPULATES_NODE_MAP | ||
311 | struct node_active_region { | ||
312 | unsigned long start_pfn; | ||
313 | unsigned long end_pfn; | ||
314 | int nid; | ||
315 | }; | ||
316 | #endif /* CONFIG_ARCH_POPULATES_NODE_MAP */ | ||
317 | |||
318 | #ifndef CONFIG_DISCONTIGMEM | ||
319 | /* The array of struct pages - for discontigmem use pgdat->lmem_map */ | ||
320 | extern struct page *mem_map; | ||
321 | #endif | ||
308 | 322 | ||
309 | /* | 323 | /* |
310 | * The pg_data_t structure is used in machines with CONFIG_DISCONTIGMEM | 324 | * The pg_data_t structure is used in machines with CONFIG_DISCONTIGMEM |
@@ -518,7 +532,8 @@ extern struct zone *next_zone(struct zone *zone); | |||
518 | 532 | ||
519 | #endif | 533 | #endif |
520 | 534 | ||
521 | #ifndef CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID | 535 | #if !defined(CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID) && \ |
536 | !defined(CONFIG_ARCH_POPULATES_NODE_MAP) | ||
522 | #define early_pfn_to_nid(nid) (0UL) | 537 | #define early_pfn_to_nid(nid) (0UL) |
523 | #endif | 538 | #endif |
524 | 539 | ||
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h index f7ca0b09075d..e0c393cc7240 100644 --- a/include/linux/mod_devicetable.h +++ b/include/linux/mod_devicetable.h | |||
@@ -308,4 +308,16 @@ struct input_device_id { | |||
308 | kernel_ulong_t driver_info; | 308 | kernel_ulong_t driver_info; |
309 | }; | 309 | }; |
310 | 310 | ||
311 | /* EISA */ | ||
312 | |||
313 | #define EISA_SIG_LEN 8 | ||
314 | |||
315 | /* The EISA signature, in ASCII form, null terminated */ | ||
316 | struct eisa_device_id { | ||
317 | char sig[EISA_SIG_LEN]; | ||
318 | kernel_ulong_t driver_data; | ||
319 | }; | ||
320 | |||
321 | #define EISA_DEVICE_MODALIAS_FMT "eisa:s%s" | ||
322 | |||
311 | #endif /* LINUX_MOD_DEVICETABLE_H */ | 323 | #endif /* LINUX_MOD_DEVICETABLE_H */ |
diff --git a/include/linux/module.h b/include/linux/module.h index d4486cc2e7fe..4b2d8091a410 100644 --- a/include/linux/module.h +++ b/include/linux/module.h | |||
@@ -232,17 +232,17 @@ enum module_state | |||
232 | }; | 232 | }; |
233 | 233 | ||
234 | /* Similar stuff for section attributes. */ | 234 | /* Similar stuff for section attributes. */ |
235 | #define MODULE_SECT_NAME_LEN 32 | ||
236 | struct module_sect_attr | 235 | struct module_sect_attr |
237 | { | 236 | { |
238 | struct module_attribute mattr; | 237 | struct module_attribute mattr; |
239 | char name[MODULE_SECT_NAME_LEN]; | 238 | char *name; |
240 | unsigned long address; | 239 | unsigned long address; |
241 | }; | 240 | }; |
242 | 241 | ||
243 | struct module_sect_attrs | 242 | struct module_sect_attrs |
244 | { | 243 | { |
245 | struct attribute_group grp; | 244 | struct attribute_group grp; |
245 | int nsections; | ||
246 | struct module_sect_attr attrs[0]; | 246 | struct module_sect_attr attrs[0]; |
247 | }; | 247 | }; |
248 | 248 | ||
@@ -320,6 +320,8 @@ struct module | |||
320 | /* Am I GPL-compatible */ | 320 | /* Am I GPL-compatible */ |
321 | int license_gplok; | 321 | int license_gplok; |
322 | 322 | ||
323 | unsigned int taints; /* same bits as kernel:tainted */ | ||
324 | |||
323 | #ifdef CONFIG_MODULE_UNLOAD | 325 | #ifdef CONFIG_MODULE_UNLOAD |
324 | /* Reference counts */ | 326 | /* Reference counts */ |
325 | struct module_ref ref[NR_CPUS]; | 327 | struct module_ref ref[NR_CPUS]; |
diff --git a/include/linux/mpage.h b/include/linux/mpage.h index 3ca880463c47..cc5fb75af78a 100644 --- a/include/linux/mpage.h +++ b/include/linux/mpage.h | |||
@@ -9,6 +9,7 @@ | |||
9 | * (And no, it doesn't do the #ifdef __MPAGE_H thing, and it doesn't do | 9 | * (And no, it doesn't do the #ifdef __MPAGE_H thing, and it doesn't do |
10 | * nested includes. Get it right in the .c file). | 10 | * nested includes. Get it right in the .c file). |
11 | */ | 11 | */ |
12 | #ifdef CONFIG_BLOCK | ||
12 | 13 | ||
13 | struct writeback_control; | 14 | struct writeback_control; |
14 | typedef int (writepage_t)(struct page *page, struct writeback_control *wbc); | 15 | typedef int (writepage_t)(struct page *page, struct writeback_control *wbc); |
@@ -21,8 +22,4 @@ int mpage_writepages(struct address_space *mapping, | |||
21 | int mpage_writepage(struct page *page, get_block_t *get_block, | 22 | int mpage_writepage(struct page *page, get_block_t *get_block, |
22 | struct writeback_control *wbc); | 23 | struct writeback_control *wbc); |
23 | 24 | ||
24 | static inline int | 25 | #endif |
25 | generic_writepages(struct address_space *mapping, struct writeback_control *wbc) | ||
26 | { | ||
27 | return mpage_writepages(mapping, wbc, NULL); | ||
28 | } | ||
diff --git a/include/linux/mroute.h b/include/linux/mroute.h index e05d54a90743..7da2cee8e132 100644 --- a/include/linux/mroute.h +++ b/include/linux/mroute.h | |||
@@ -142,7 +142,7 @@ struct vif_device | |||
142 | unsigned long rate_limit; /* Traffic shaping (NI) */ | 142 | unsigned long rate_limit; /* Traffic shaping (NI) */ |
143 | unsigned char threshold; /* TTL threshold */ | 143 | unsigned char threshold; /* TTL threshold */ |
144 | unsigned short flags; /* Control flags */ | 144 | unsigned short flags; /* Control flags */ |
145 | __u32 local,remote; /* Addresses(remote for tunnels)*/ | 145 | __be32 local,remote; /* Addresses(remote for tunnels)*/ |
146 | int link; /* Physical interface index */ | 146 | int link; /* Physical interface index */ |
147 | }; | 147 | }; |
148 | 148 | ||
@@ -151,8 +151,8 @@ struct vif_device | |||
151 | struct mfc_cache | 151 | struct mfc_cache |
152 | { | 152 | { |
153 | struct mfc_cache *next; /* Next entry on cache line */ | 153 | struct mfc_cache *next; /* Next entry on cache line */ |
154 | __u32 mfc_mcastgrp; /* Group the entry belongs to */ | 154 | __be32 mfc_mcastgrp; /* Group the entry belongs to */ |
155 | __u32 mfc_origin; /* Source of packet */ | 155 | __be32 mfc_origin; /* Source of packet */ |
156 | vifi_t mfc_parent; /* Source interface */ | 156 | vifi_t mfc_parent; /* Source interface */ |
157 | int mfc_flags; /* Flags on line */ | 157 | int mfc_flags; /* Flags on line */ |
158 | 158 | ||
@@ -179,9 +179,9 @@ struct mfc_cache | |||
179 | #define MFC_LINES 64 | 179 | #define MFC_LINES 64 |
180 | 180 | ||
181 | #ifdef __BIG_ENDIAN | 181 | #ifdef __BIG_ENDIAN |
182 | #define MFC_HASH(a,b) ((((a)>>24)^((b)>>26))&(MFC_LINES-1)) | 182 | #define MFC_HASH(a,b) (((((__force u32)(__be32)a)>>24)^(((__force u32)(__be32)b)>>26))&(MFC_LINES-1)) |
183 | #else | 183 | #else |
184 | #define MFC_HASH(a,b) (((a)^((b)>>2))&(MFC_LINES-1)) | 184 | #define MFC_HASH(a,b) ((((__force u32)(__be32)a)^(((__force u32)(__be32)b)>>2))&(MFC_LINES-1)) |
185 | #endif | 185 | #endif |
186 | 186 | ||
187 | #endif | 187 | #endif |
@@ -213,8 +213,8 @@ struct pimreghdr | |||
213 | { | 213 | { |
214 | __u8 type; | 214 | __u8 type; |
215 | __u8 reserved; | 215 | __u8 reserved; |
216 | __u16 csum; | 216 | __be16 csum; |
217 | __u32 flags; | 217 | __be32 flags; |
218 | }; | 218 | }; |
219 | 219 | ||
220 | extern int pim_rcv_v1(struct sk_buff *); | 220 | extern int pim_rcv_v1(struct sk_buff *); |
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h index bae62d62dc3e..ce6c85815cbd 100644 --- a/include/linux/msdos_fs.h +++ b/include/linux/msdos_fs.h | |||
@@ -204,6 +204,7 @@ struct fat_mount_options { | |||
204 | unicode_xlate:1, /* create escape sequences for unhandled Unicode */ | 204 | unicode_xlate:1, /* create escape sequences for unhandled Unicode */ |
205 | numtail:1, /* Does first alias have a numeric '~1' type tail? */ | 205 | numtail:1, /* Does first alias have a numeric '~1' type tail? */ |
206 | atari:1, /* Use Atari GEMDOS variation of MS-DOS fs */ | 206 | atari:1, /* Use Atari GEMDOS variation of MS-DOS fs */ |
207 | flush:1, /* write things quickly */ | ||
207 | nocase:1; /* Does this need case conversion? 0=need case conversion*/ | 208 | nocase:1; /* Does this need case conversion? 0=need case conversion*/ |
208 | }; | 209 | }; |
209 | 210 | ||
@@ -412,6 +413,8 @@ extern int fat_sync_inode(struct inode *inode); | |||
412 | extern int fat_fill_super(struct super_block *sb, void *data, int silent, | 413 | extern int fat_fill_super(struct super_block *sb, void *data, int silent, |
413 | struct inode_operations *fs_dir_inode_ops, int isvfat); | 414 | struct inode_operations *fs_dir_inode_ops, int isvfat); |
414 | 415 | ||
416 | extern int fat_flush_inodes(struct super_block *sb, struct inode *i1, | ||
417 | struct inode *i2); | ||
415 | /* fat/misc.c */ | 418 | /* fat/misc.c */ |
416 | extern void fat_fs_panic(struct super_block *s, const char *fmt, ...); | 419 | extern void fat_fs_panic(struct super_block *s, const char *fmt, ...); |
417 | extern void fat_clusters_flush(struct super_block *sb); | 420 | extern void fat_clusters_flush(struct super_block *sb); |
diff --git a/include/linux/msi.h b/include/linux/msi.h new file mode 100644 index 000000000000..c7ef94343673 --- /dev/null +++ b/include/linux/msi.h | |||
@@ -0,0 +1,49 @@ | |||
1 | #ifndef LINUX_MSI_H | ||
2 | #define LINUX_MSI_H | ||
3 | |||
4 | struct msi_msg { | ||
5 | u32 address_lo; /* low 32 bits of msi message address */ | ||
6 | u32 address_hi; /* high 32 bits of msi message address */ | ||
7 | u32 data; /* 16 bits of msi message data */ | ||
8 | }; | ||
9 | |||
10 | /* Heper functions */ | ||
11 | extern void mask_msi_irq(unsigned int irq); | ||
12 | extern void unmask_msi_irq(unsigned int irq); | ||
13 | extern void read_msi_msg(unsigned int irq, struct msi_msg *msg); | ||
14 | |||
15 | extern void write_msi_msg(unsigned int irq, struct msi_msg *msg); | ||
16 | |||
17 | struct msi_desc { | ||
18 | struct { | ||
19 | __u8 type : 5; /* {0: unused, 5h:MSI, 11h:MSI-X} */ | ||
20 | __u8 maskbit : 1; /* mask-pending bit supported ? */ | ||
21 | __u8 unused : 1; | ||
22 | __u8 is_64 : 1; /* Address size: 0=32bit 1=64bit */ | ||
23 | __u8 pos; /* Location of the msi capability */ | ||
24 | __u16 entry_nr; /* specific enabled entry */ | ||
25 | unsigned default_irq; /* default pre-assigned irq */ | ||
26 | }msi_attrib; | ||
27 | |||
28 | struct { | ||
29 | __u16 head; | ||
30 | __u16 tail; | ||
31 | }link; | ||
32 | |||
33 | void __iomem *mask_base; | ||
34 | struct pci_dev *dev; | ||
35 | |||
36 | #ifdef CONFIG_PM | ||
37 | /* PM save area for MSIX address/data */ | ||
38 | struct msi_msg msg_save; | ||
39 | #endif | ||
40 | }; | ||
41 | |||
42 | /* | ||
43 | * The arch hook for setup up msi irqs | ||
44 | */ | ||
45 | int arch_setup_msi_irq(unsigned int irq, struct pci_dev *dev); | ||
46 | void arch_teardown_msi_irq(unsigned int irq); | ||
47 | |||
48 | |||
49 | #endif /* LINUX_MSI_H */ | ||
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h index 0b4cd2fa64aa..70420bbae82b 100644 --- a/include/linux/mtd/nand.h +++ b/include/linux/mtd/nand.h | |||
@@ -27,9 +27,17 @@ | |||
27 | struct mtd_info; | 27 | struct mtd_info; |
28 | /* Scan and identify a NAND device */ | 28 | /* Scan and identify a NAND device */ |
29 | extern int nand_scan (struct mtd_info *mtd, int max_chips); | 29 | extern int nand_scan (struct mtd_info *mtd, int max_chips); |
30 | /* Separate phases of nand_scan(), allowing board driver to intervene | ||
31 | * and override command or ECC setup according to flash type */ | ||
32 | extern int nand_scan_ident(struct mtd_info *mtd, int max_chips); | ||
33 | extern int nand_scan_tail(struct mtd_info *mtd); | ||
34 | |||
30 | /* Free resources held by the NAND device */ | 35 | /* Free resources held by the NAND device */ |
31 | extern void nand_release (struct mtd_info *mtd); | 36 | extern void nand_release (struct mtd_info *mtd); |
32 | 37 | ||
38 | /* Internal helper for board drivers which need to override command function */ | ||
39 | extern void nand_wait_ready(struct mtd_info *mtd); | ||
40 | |||
33 | /* The maximum number of NAND chips in an array */ | 41 | /* The maximum number of NAND chips in an array */ |
34 | #define NAND_MAX_CHIPS 8 | 42 | #define NAND_MAX_CHIPS 8 |
35 | 43 | ||
@@ -178,7 +186,9 @@ typedef enum { | |||
178 | #define NAND_USE_FLASH_BBT 0x00010000 | 186 | #define NAND_USE_FLASH_BBT 0x00010000 |
179 | /* This option skips the bbt scan during initialization. */ | 187 | /* This option skips the bbt scan during initialization. */ |
180 | #define NAND_SKIP_BBTSCAN 0x00020000 | 188 | #define NAND_SKIP_BBTSCAN 0x00020000 |
181 | 189 | /* This option is defined if the board driver allocates its own buffers | |
190 | (e.g. because it needs them DMA-coherent */ | ||
191 | #define NAND_OWN_BUFFERS 0x00040000 | ||
182 | /* Options set by nand scan */ | 192 | /* Options set by nand scan */ |
183 | /* Nand scan has allocated controller struct */ | 193 | /* Nand scan has allocated controller struct */ |
184 | #define NAND_CONTROLLER_ALLOC 0x80000000 | 194 | #define NAND_CONTROLLER_ALLOC 0x80000000 |
@@ -228,6 +238,8 @@ struct nand_hw_control { | |||
228 | * be provided if an hardware ECC is available | 238 | * be provided if an hardware ECC is available |
229 | * @calculate: function for ecc calculation or readback from ecc hardware | 239 | * @calculate: function for ecc calculation or readback from ecc hardware |
230 | * @correct: function for ecc correction, matching to ecc generator (sw/hw) | 240 | * @correct: function for ecc correction, matching to ecc generator (sw/hw) |
241 | * @read_page_raw: function to read a raw page without ECC | ||
242 | * @write_page_raw: function to write a raw page without ECC | ||
231 | * @read_page: function to read a page according to the ecc generator requirements | 243 | * @read_page: function to read a page according to the ecc generator requirements |
232 | * @write_page: function to write a page according to the ecc generator requirements | 244 | * @write_page: function to write a page according to the ecc generator requirements |
233 | * @read_oob: function to read chip OOB data | 245 | * @read_oob: function to read chip OOB data |
@@ -249,6 +261,12 @@ struct nand_ecc_ctrl { | |||
249 | int (*correct)(struct mtd_info *mtd, uint8_t *dat, | 261 | int (*correct)(struct mtd_info *mtd, uint8_t *dat, |
250 | uint8_t *read_ecc, | 262 | uint8_t *read_ecc, |
251 | uint8_t *calc_ecc); | 263 | uint8_t *calc_ecc); |
264 | int (*read_page_raw)(struct mtd_info *mtd, | ||
265 | struct nand_chip *chip, | ||
266 | uint8_t *buf); | ||
267 | void (*write_page_raw)(struct mtd_info *mtd, | ||
268 | struct nand_chip *chip, | ||
269 | const uint8_t *buf); | ||
252 | int (*read_page)(struct mtd_info *mtd, | 270 | int (*read_page)(struct mtd_info *mtd, |
253 | struct nand_chip *chip, | 271 | struct nand_chip *chip, |
254 | uint8_t *buf); | 272 | uint8_t *buf); |
@@ -337,6 +355,7 @@ struct nand_buffers { | |||
337 | * @priv: [OPTIONAL] pointer to private chip date | 355 | * @priv: [OPTIONAL] pointer to private chip date |
338 | * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks | 356 | * @errstat: [OPTIONAL] hardware specific function to perform additional error status checks |
339 | * (determine if errors are correctable) | 357 | * (determine if errors are correctable) |
358 | * @write_page [REPLACEABLE] High-level page write function | ||
340 | */ | 359 | */ |
341 | 360 | ||
342 | struct nand_chip { | 361 | struct nand_chip { |
@@ -359,6 +378,8 @@ struct nand_chip { | |||
359 | void (*erase_cmd)(struct mtd_info *mtd, int page); | 378 | void (*erase_cmd)(struct mtd_info *mtd, int page); |
360 | int (*scan_bbt)(struct mtd_info *mtd); | 379 | int (*scan_bbt)(struct mtd_info *mtd); |
361 | int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page); | 380 | int (*errstat)(struct mtd_info *mtd, struct nand_chip *this, int state, int status, int page); |
381 | int (*write_page)(struct mtd_info *mtd, struct nand_chip *chip, | ||
382 | const uint8_t *buf, int page, int cached, int raw); | ||
362 | 383 | ||
363 | int chip_delay; | 384 | int chip_delay; |
364 | unsigned int options; | 385 | unsigned int options; |
@@ -380,7 +401,7 @@ struct nand_chip { | |||
380 | struct nand_ecclayout *ecclayout; | 401 | struct nand_ecclayout *ecclayout; |
381 | 402 | ||
382 | struct nand_ecc_ctrl ecc; | 403 | struct nand_ecc_ctrl ecc; |
383 | struct nand_buffers buffers; | 404 | struct nand_buffers *buffers; |
384 | struct nand_hw_control hwcontrol; | 405 | struct nand_hw_control hwcontrol; |
385 | 406 | ||
386 | struct mtd_oob_ops ops; | 407 | struct mtd_oob_ops ops; |
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h index 1f4972155249..6f045b586e76 100644 --- a/include/linux/mtd/onenand.h +++ b/include/linux/mtd/onenand.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/linux/mtd/onenand.h | 2 | * linux/include/linux/mtd/onenand.h |
3 | * | 3 | * |
4 | * Copyright (C) 2005 Samsung Electronics | 4 | * Copyright (C) 2005-2006 Samsung Electronics |
5 | * Kyungmin Park <kyungmin.park@samsung.com> | 5 | * Kyungmin Park <kyungmin.park@samsung.com> |
6 | * | 6 | * |
7 | * This program is free software; you can redistribute it and/or modify | 7 | * This program is free software; you can redistribute it and/or modify |
@@ -96,6 +96,7 @@ struct onenand_chip { | |||
96 | void __iomem *base; | 96 | void __iomem *base; |
97 | unsigned int chipsize; | 97 | unsigned int chipsize; |
98 | unsigned int device_id; | 98 | unsigned int device_id; |
99 | unsigned int version_id; | ||
99 | unsigned int density_mask; | 100 | unsigned int density_mask; |
100 | unsigned int options; | 101 | unsigned int options; |
101 | 102 | ||
@@ -149,7 +150,8 @@ struct onenand_chip { | |||
149 | /* | 150 | /* |
150 | * Options bits | 151 | * Options bits |
151 | */ | 152 | */ |
152 | #define ONENAND_CONT_LOCK (0x0001) | 153 | #define ONENAND_HAS_CONT_LOCK (0x0001) |
154 | #define ONENAND_HAS_UNLOCK_ALL (0x0002) | ||
153 | #define ONENAND_PAGEBUF_ALLOC (0x1000) | 155 | #define ONENAND_PAGEBUF_ALLOC (0x1000) |
154 | 156 | ||
155 | /* | 157 | /* |
diff --git a/include/linux/mtd/onenand_regs.h b/include/linux/mtd/onenand_regs.h index 4a72818d2545..9e409fe6ded6 100644 --- a/include/linux/mtd/onenand_regs.h +++ b/include/linux/mtd/onenand_regs.h | |||
@@ -3,7 +3,7 @@ | |||
3 | * | 3 | * |
4 | * OneNAND Register header file | 4 | * OneNAND Register header file |
5 | * | 5 | * |
6 | * Copyright (C) 2005 Samsung Electronics | 6 | * Copyright (C) 2005-2006 Samsung Electronics |
7 | * | 7 | * |
8 | * This program is free software; you can redistribute it and/or modify | 8 | * This program is free software; you can redistribute it and/or modify |
9 | * it under the terms of the GNU General Public License version 2 as | 9 | * it under the terms of the GNU General Public License version 2 as |
@@ -72,6 +72,7 @@ | |||
72 | #define ONENAND_DEVICE_VCC_MASK (0x3) | 72 | #define ONENAND_DEVICE_VCC_MASK (0x3) |
73 | 73 | ||
74 | #define ONENAND_DEVICE_DENSITY_512Mb (0x002) | 74 | #define ONENAND_DEVICE_DENSITY_512Mb (0x002) |
75 | #define ONENAND_DEVICE_DENSITY_1Gb (0x003) | ||
75 | 76 | ||
76 | /* | 77 | /* |
77 | * Version ID Register F002h (R) | 78 | * Version ID Register F002h (R) |
@@ -110,6 +111,7 @@ | |||
110 | #define ONENAND_CMD_UNLOCK (0x23) | 111 | #define ONENAND_CMD_UNLOCK (0x23) |
111 | #define ONENAND_CMD_LOCK (0x2A) | 112 | #define ONENAND_CMD_LOCK (0x2A) |
112 | #define ONENAND_CMD_LOCK_TIGHT (0x2C) | 113 | #define ONENAND_CMD_LOCK_TIGHT (0x2C) |
114 | #define ONENAND_CMD_UNLOCK_ALL (0x27) | ||
113 | #define ONENAND_CMD_ERASE (0x94) | 115 | #define ONENAND_CMD_ERASE (0x94) |
114 | #define ONENAND_CMD_RESET (0xF0) | 116 | #define ONENAND_CMD_RESET (0xF0) |
115 | #define ONENAND_CMD_OTP_ACCESS (0x65) | 117 | #define ONENAND_CMD_OTP_ACCESS (0x65) |
diff --git a/include/linux/mtd/plat-ram.h b/include/linux/mtd/plat-ram.h index 2332eda07e0e..9667863bd7e3 100644 --- a/include/linux/mtd/plat-ram.h +++ b/include/linux/mtd/plat-ram.h | |||
@@ -1,4 +1,4 @@ | |||
1 | /* linux/include/mtd/plat-ram.h | 1 | /* linux/include/linux/mtd/plat-ram.h |
2 | * | 2 | * |
3 | * (c) 2004 Simtec Electronics | 3 | * (c) 2004 Simtec Electronics |
4 | * http://www.simtec.co.uk/products/SWLINUX/ | 4 | * http://www.simtec.co.uk/products/SWLINUX/ |
diff --git a/include/linux/namei.h b/include/linux/namei.h index 45511a5918d3..f5f19606effb 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -1,6 +1,7 @@ | |||
1 | #ifndef _LINUX_NAMEI_H | 1 | #ifndef _LINUX_NAMEI_H |
2 | #define _LINUX_NAMEI_H | 2 | #define _LINUX_NAMEI_H |
3 | 3 | ||
4 | #include <linux/dcache.h> | ||
4 | #include <linux/linkage.h> | 5 | #include <linux/linkage.h> |
5 | 6 | ||
6 | struct vfsmount; | 7 | struct vfsmount; |
@@ -54,6 +55,7 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND}; | |||
54 | #define LOOKUP_OPEN (0x0100) | 55 | #define LOOKUP_OPEN (0x0100) |
55 | #define LOOKUP_CREATE (0x0200) | 56 | #define LOOKUP_CREATE (0x0200) |
56 | #define LOOKUP_ACCESS (0x0400) | 57 | #define LOOKUP_ACCESS (0x0400) |
58 | #define LOOKUP_CHDIR (0x0800) | ||
57 | 59 | ||
58 | extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *)); | 60 | extern int FASTCALL(__user_walk(const char __user *, unsigned, struct nameidata *)); |
59 | extern int FASTCALL(__user_walk_fd(int dfd, const char __user *, unsigned, struct nameidata *)); | 61 | extern int FASTCALL(__user_walk_fd(int dfd, const char __user *, unsigned, struct nameidata *)); |
diff --git a/include/linux/namespace.h b/include/linux/namespace.h index 3abc8e3b4879..d137009f0b2b 100644 --- a/include/linux/namespace.h +++ b/include/linux/namespace.h | |||
@@ -4,6 +4,7 @@ | |||
4 | 4 | ||
5 | #include <linux/mount.h> | 5 | #include <linux/mount.h> |
6 | #include <linux/sched.h> | 6 | #include <linux/sched.h> |
7 | #include <linux/nsproxy.h> | ||
7 | 8 | ||
8 | struct namespace { | 9 | struct namespace { |
9 | atomic_t count; | 10 | atomic_t count; |
@@ -26,11 +27,8 @@ static inline void put_namespace(struct namespace *namespace) | |||
26 | 27 | ||
27 | static inline void exit_namespace(struct task_struct *p) | 28 | static inline void exit_namespace(struct task_struct *p) |
28 | { | 29 | { |
29 | struct namespace *namespace = p->namespace; | 30 | struct namespace *namespace = p->nsproxy->namespace; |
30 | if (namespace) { | 31 | if (namespace) { |
31 | task_lock(p); | ||
32 | p->namespace = NULL; | ||
33 | task_unlock(p); | ||
34 | put_namespace(namespace); | 32 | put_namespace(namespace); |
35 | } | 33 | } |
36 | } | 34 | } |
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h index 02e352be717e..0ea7f89e613c 100644 --- a/include/linux/ncp_fs.h +++ b/include/linux/ncp_fs.h | |||
@@ -212,6 +212,7 @@ void ncp_date_unix2dos(int unix_date, __le16 * time, __le16 * date); | |||
212 | 212 | ||
213 | /* linux/fs/ncpfs/ioctl.c */ | 213 | /* linux/fs/ncpfs/ioctl.c */ |
214 | int ncp_ioctl(struct inode *, struct file *, unsigned int, unsigned long); | 214 | int ncp_ioctl(struct inode *, struct file *, unsigned int, unsigned long); |
215 | long ncp_compat_ioctl(struct file *, unsigned int, unsigned long); | ||
215 | 216 | ||
216 | /* linux/fs/ncpfs/sock.c */ | 217 | /* linux/fs/ncpfs/sock.c */ |
217 | int ncp_request2(struct ncp_server *server, int function, | 218 | int ncp_request2(struct ncp_server *server, int function, |
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 43289127b458..9264139bd8df 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -187,7 +187,7 @@ struct hh_cache | |||
187 | { | 187 | { |
188 | struct hh_cache *hh_next; /* Next entry */ | 188 | struct hh_cache *hh_next; /* Next entry */ |
189 | atomic_t hh_refcnt; /* number of users */ | 189 | atomic_t hh_refcnt; /* number of users */ |
190 | unsigned short hh_type; /* protocol identifier, f.e ETH_P_IP | 190 | __be16 hh_type; /* protocol identifier, f.e ETH_P_IP |
191 | * NOTE: For VLANs, this will be the | 191 | * NOTE: For VLANs, this will be the |
192 | * encapuslated type. --BLG | 192 | * encapuslated type. --BLG |
193 | */ | 193 | */ |
@@ -334,7 +334,6 @@ struct net_device | |||
334 | 334 | ||
335 | 335 | ||
336 | struct net_device_stats* (*get_stats)(struct net_device *dev); | 336 | struct net_device_stats* (*get_stats)(struct net_device *dev); |
337 | struct iw_statistics* (*get_wireless_stats)(struct net_device *dev); | ||
338 | 337 | ||
339 | /* List of functions to handle Wireless Extensions (instead of ioctl). | 338 | /* List of functions to handle Wireless Extensions (instead of ioctl). |
340 | * See <net/iw_handler.h> for details. Jean II */ | 339 | * See <net/iw_handler.h> for details. Jean II */ |
@@ -1016,7 +1015,8 @@ static inline int netif_needs_gso(struct net_device *dev, struct sk_buff *skb) | |||
1016 | } | 1015 | } |
1017 | 1016 | ||
1018 | /* On bonding slaves other than the currently active slave, suppress | 1017 | /* On bonding slaves other than the currently active slave, suppress |
1019 | * duplicates except for 802.3ad ETH_P_SLOW and alb non-mcast/bcast. | 1018 | * duplicates except for 802.3ad ETH_P_SLOW, alb non-mcast/bcast, and |
1019 | * ARP on active-backup slaves with arp_validate enabled. | ||
1020 | */ | 1020 | */ |
1021 | static inline int skb_bond_should_drop(struct sk_buff *skb) | 1021 | static inline int skb_bond_should_drop(struct sk_buff *skb) |
1022 | { | 1022 | { |
@@ -1025,6 +1025,10 @@ static inline int skb_bond_should_drop(struct sk_buff *skb) | |||
1025 | 1025 | ||
1026 | if (master && | 1026 | if (master && |
1027 | (dev->priv_flags & IFF_SLAVE_INACTIVE)) { | 1027 | (dev->priv_flags & IFF_SLAVE_INACTIVE)) { |
1028 | if ((dev->priv_flags & IFF_SLAVE_NEEDARP) && | ||
1029 | skb->protocol == __constant_htons(ETH_P_ARP)) | ||
1030 | return 0; | ||
1031 | |||
1028 | if (master->priv_flags & IFF_MASTER_ALB) { | 1032 | if (master->priv_flags & IFF_MASTER_ALB) { |
1029 | if (skb->pkt_type != PACKET_BROADCAST && | 1033 | if (skb->pkt_type != PACKET_BROADCAST && |
1030 | skb->pkt_type != PACKET_MULTICAST) | 1034 | skb->pkt_type != PACKET_MULTICAST) |
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h index 149e87c9ab13..44e39b61d9e7 100644 --- a/include/linux/netfilter_arp/arp_tables.h +++ b/include/linux/netfilter_arp/arp_tables.h | |||
@@ -46,11 +46,11 @@ struct arpt_arp { | |||
46 | struct arpt_devaddr_info tgt_devaddr; | 46 | struct arpt_devaddr_info tgt_devaddr; |
47 | 47 | ||
48 | /* ARP operation code. */ | 48 | /* ARP operation code. */ |
49 | u_int16_t arpop, arpop_mask; | 49 | __be16 arpop, arpop_mask; |
50 | 50 | ||
51 | /* ARP hardware address and protocol address format. */ | 51 | /* ARP hardware address and protocol address format. */ |
52 | u_int16_t arhrd, arhrd_mask; | 52 | __be16 arhrd, arhrd_mask; |
53 | u_int16_t arpro, arpro_mask; | 53 | __be16 arpro, arpro_mask; |
54 | 54 | ||
55 | /* The protocol address length is only accepted if it is 4 | 55 | /* The protocol address length is only accepted if it is 4 |
56 | * so there is no use in offering a way to do filtering on it. | 56 | * so there is no use in offering a way to do filtering on it. |
diff --git a/include/linux/netfilter_bridge/ebt_mark_t.h b/include/linux/netfilter_bridge/ebt_mark_t.h index 110fec6a40a2..6270f6f33693 100644 --- a/include/linux/netfilter_bridge/ebt_mark_t.h +++ b/include/linux/netfilter_bridge/ebt_mark_t.h | |||
@@ -1,6 +1,18 @@ | |||
1 | #ifndef __LINUX_BRIDGE_EBT_MARK_T_H | 1 | #ifndef __LINUX_BRIDGE_EBT_MARK_T_H |
2 | #define __LINUX_BRIDGE_EBT_MARK_T_H | 2 | #define __LINUX_BRIDGE_EBT_MARK_T_H |
3 | 3 | ||
4 | /* The target member is reused for adding new actions, the | ||
5 | * value of the real target is -1 to -NUM_STANDARD_TARGETS. | ||
6 | * For backward compatibility, the 4 lsb (2 would be enough, | ||
7 | * but let's play it safe) are kept to designate this target. | ||
8 | * The remaining bits designate the action. By making the set | ||
9 | * action 0xfffffff0, the result will look ok for older | ||
10 | * versions. [September 2006] */ | ||
11 | #define MARK_SET_VALUE (0xfffffff0) | ||
12 | #define MARK_OR_VALUE (0xffffffe0) | ||
13 | #define MARK_AND_VALUE (0xffffffd0) | ||
14 | #define MARK_XOR_VALUE (0xffffffc0) | ||
15 | |||
4 | struct ebt_mark_t_info | 16 | struct ebt_mark_t_info |
5 | { | 17 | { |
6 | unsigned long mark; | 18 | unsigned long mark; |
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h index ce02c984f3ba..5b63a231a76b 100644 --- a/include/linux/netfilter_ipv4.h +++ b/include/linux/netfilter_ipv4.h | |||
@@ -77,7 +77,7 @@ enum nf_ip_hook_priorities { | |||
77 | #define SO_ORIGINAL_DST 80 | 77 | #define SO_ORIGINAL_DST 80 |
78 | 78 | ||
79 | #ifdef __KERNEL__ | 79 | #ifdef __KERNEL__ |
80 | extern int ip_route_me_harder(struct sk_buff **pskb); | 80 | extern int ip_route_me_harder(struct sk_buff **pskb, unsigned addr_type); |
81 | extern int ip_xfrm_me_harder(struct sk_buff **pskb); | 81 | extern int ip_xfrm_me_harder(struct sk_buff **pskb); |
82 | extern unsigned int nf_ip_checksum(struct sk_buff *skb, unsigned int hook, | 82 | extern unsigned int nf_ip_checksum(struct sk_buff *skb, unsigned int hook, |
83 | unsigned int dataoff, u_int8_t protocol); | 83 | unsigned int dataoff, u_int8_t protocol); |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack.h b/include/linux/netfilter_ipv4/ip_conntrack.h index 51dbec1892c8..64e868034c4a 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack.h +++ b/include/linux/netfilter_ipv4/ip_conntrack.h | |||
@@ -157,7 +157,7 @@ struct ip_conntrack_expect | |||
157 | unsigned int flags; | 157 | unsigned int flags; |
158 | 158 | ||
159 | #ifdef CONFIG_IP_NF_NAT_NEEDED | 159 | #ifdef CONFIG_IP_NF_NAT_NEEDED |
160 | u_int32_t saved_ip; | 160 | __be32 saved_ip; |
161 | /* This is the original per-proto part, used to map the | 161 | /* This is the original per-proto part, used to map the |
162 | * expected connection the way the recipient expects. */ | 162 | * expected connection the way the recipient expects. */ |
163 | union ip_conntrack_manip_proto saved_proto; | 163 | union ip_conntrack_manip_proto saved_proto; |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_h323.h b/include/linux/netfilter_ipv4/ip_conntrack_h323.h index 3cbff7379002..943cc6a4871d 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_h323.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_h323.h | |||
@@ -30,7 +30,7 @@ struct ip_ct_h323_master { | |||
30 | struct ip_conntrack_expect; | 30 | struct ip_conntrack_expect; |
31 | 31 | ||
32 | extern int get_h225_addr(unsigned char *data, TransportAddress * addr, | 32 | extern int get_h225_addr(unsigned char *data, TransportAddress * addr, |
33 | u_int32_t * ip, u_int16_t * port); | 33 | __be32 * ip, u_int16_t * port); |
34 | extern void ip_conntrack_h245_expect(struct ip_conntrack *new, | 34 | extern void ip_conntrack_h245_expect(struct ip_conntrack *new, |
35 | struct ip_conntrack_expect *this); | 35 | struct ip_conntrack_expect *this); |
36 | extern void ip_conntrack_q931_expect(struct ip_conntrack *new, | 36 | extern void ip_conntrack_q931_expect(struct ip_conntrack *new, |
@@ -38,11 +38,11 @@ extern void ip_conntrack_q931_expect(struct ip_conntrack *new, | |||
38 | extern int (*set_h245_addr_hook) (struct sk_buff ** pskb, | 38 | extern int (*set_h245_addr_hook) (struct sk_buff ** pskb, |
39 | unsigned char **data, int dataoff, | 39 | unsigned char **data, int dataoff, |
40 | H245_TransportAddress * addr, | 40 | H245_TransportAddress * addr, |
41 | u_int32_t ip, u_int16_t port); | 41 | __be32 ip, u_int16_t port); |
42 | extern int (*set_h225_addr_hook) (struct sk_buff ** pskb, | 42 | extern int (*set_h225_addr_hook) (struct sk_buff ** pskb, |
43 | unsigned char **data, int dataoff, | 43 | unsigned char **data, int dataoff, |
44 | TransportAddress * addr, | 44 | TransportAddress * addr, |
45 | u_int32_t ip, u_int16_t port); | 45 | __be32 ip, u_int16_t port); |
46 | extern int (*set_sig_addr_hook) (struct sk_buff ** pskb, | 46 | extern int (*set_sig_addr_hook) (struct sk_buff ** pskb, |
47 | struct ip_conntrack * ct, | 47 | struct ip_conntrack * ct, |
48 | enum ip_conntrack_info ctinfo, | 48 | enum ip_conntrack_info ctinfo, |
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h index 2fdabdb4c0ef..c228bde74c33 100644 --- a/include/linux/netfilter_ipv4/ip_conntrack_tuple.h +++ b/include/linux/netfilter_ipv4/ip_conntrack_tuple.h | |||
@@ -23,13 +23,13 @@ union ip_conntrack_manip_proto | |||
23 | __be16 port; | 23 | __be16 port; |
24 | } tcp; | 24 | } tcp; |
25 | struct { | 25 | struct { |
26 | u_int16_t port; | 26 | __be16 port; |
27 | } udp; | 27 | } udp; |
28 | struct { | 28 | struct { |
29 | u_int16_t id; | 29 | __be16 id; |
30 | } icmp; | 30 | } icmp; |
31 | struct { | 31 | struct { |
32 | u_int16_t port; | 32 | __be16 port; |
33 | } sctp; | 33 | } sctp; |
34 | struct { | 34 | struct { |
35 | __be16 key; /* key is 32bit, pptp only uses 16 */ | 35 | __be16 key; /* key is 32bit, pptp only uses 16 */ |
@@ -39,7 +39,7 @@ union ip_conntrack_manip_proto | |||
39 | /* The manipulable part of the tuple. */ | 39 | /* The manipulable part of the tuple. */ |
40 | struct ip_conntrack_manip | 40 | struct ip_conntrack_manip |
41 | { | 41 | { |
42 | u_int32_t ip; | 42 | __be32 ip; |
43 | union ip_conntrack_manip_proto u; | 43 | union ip_conntrack_manip_proto u; |
44 | }; | 44 | }; |
45 | 45 | ||
@@ -50,22 +50,22 @@ struct ip_conntrack_tuple | |||
50 | 50 | ||
51 | /* These are the parts of the tuple which are fixed. */ | 51 | /* These are the parts of the tuple which are fixed. */ |
52 | struct { | 52 | struct { |
53 | u_int32_t ip; | 53 | __be32 ip; |
54 | union { | 54 | union { |
55 | /* Add other protocols here. */ | 55 | /* Add other protocols here. */ |
56 | u_int16_t all; | 56 | u_int16_t all; |
57 | 57 | ||
58 | struct { | 58 | struct { |
59 | u_int16_t port; | 59 | __be16 port; |
60 | } tcp; | 60 | } tcp; |
61 | struct { | 61 | struct { |
62 | u_int16_t port; | 62 | __be16 port; |
63 | } udp; | 63 | } udp; |
64 | struct { | 64 | struct { |
65 | u_int8_t type, code; | 65 | u_int8_t type, code; |
66 | } icmp; | 66 | } icmp; |
67 | struct { | 67 | struct { |
68 | u_int16_t port; | 68 | __be16 port; |
69 | } sctp; | 69 | } sctp; |
70 | struct { | 70 | struct { |
71 | __be16 key; /* key is 32bit, | 71 | __be16 key; /* key is 32bit, |
diff --git a/include/linux/netfilter_ipv4/ip_nat.h b/include/linux/netfilter_ipv4/ip_nat.h index 98f8407e4cb5..bdf553620ca1 100644 --- a/include/linux/netfilter_ipv4/ip_nat.h +++ b/include/linux/netfilter_ipv4/ip_nat.h | |||
@@ -33,7 +33,7 @@ struct ip_nat_range | |||
33 | unsigned int flags; | 33 | unsigned int flags; |
34 | 34 | ||
35 | /* Inclusive: network order. */ | 35 | /* Inclusive: network order. */ |
36 | u_int32_t min_ip, max_ip; | 36 | __be32 min_ip, max_ip; |
37 | 37 | ||
38 | /* Inclusive: network order */ | 38 | /* Inclusive: network order */ |
39 | union ip_conntrack_manip_proto min, max; | 39 | union ip_conntrack_manip_proto min, max; |
diff --git a/include/linux/netfilter_ipv4/ip_queue.h b/include/linux/netfilter_ipv4/ip_queue.h index aa08d68c4841..a03507f465f8 100644 --- a/include/linux/netfilter_ipv4/ip_queue.h +++ b/include/linux/netfilter_ipv4/ip_queue.h | |||
@@ -26,7 +26,7 @@ typedef struct ipq_packet_msg { | |||
26 | unsigned int hook; /* Netfilter hook we rode in on */ | 26 | unsigned int hook; /* Netfilter hook we rode in on */ |
27 | char indev_name[IFNAMSIZ]; /* Name of incoming interface */ | 27 | char indev_name[IFNAMSIZ]; /* Name of incoming interface */ |
28 | char outdev_name[IFNAMSIZ]; /* Name of outgoing interface */ | 28 | char outdev_name[IFNAMSIZ]; /* Name of outgoing interface */ |
29 | unsigned short hw_protocol; /* Hardware protocol (network order) */ | 29 | __be16 hw_protocol; /* Hardware protocol (network order) */ |
30 | unsigned short hw_type; /* Hardware type */ | 30 | unsigned short hw_type; /* Hardware type */ |
31 | unsigned char hw_addrlen; /* Hardware address length */ | 31 | unsigned char hw_addrlen; /* Hardware address length */ |
32 | unsigned char hw_addr[8]; /* Hardware address */ | 32 | unsigned char hw_addr[8]; /* Hardware address */ |
diff --git a/include/linux/netfilter_ipv4/ipt_iprange.h b/include/linux/netfilter_ipv4/ipt_iprange.h index 3ecb3bd63676..34ab0fb736e2 100644 --- a/include/linux/netfilter_ipv4/ipt_iprange.h +++ b/include/linux/netfilter_ipv4/ipt_iprange.h | |||
@@ -8,7 +8,7 @@ | |||
8 | 8 | ||
9 | struct ipt_iprange { | 9 | struct ipt_iprange { |
10 | /* Inclusive: network order. */ | 10 | /* Inclusive: network order. */ |
11 | u_int32_t min_ip, max_ip; | 11 | __be32 min_ip, max_ip; |
12 | }; | 12 | }; |
13 | 13 | ||
14 | struct ipt_iprange_info | 14 | struct ipt_iprange_info |
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h index 36f5bcf513b0..76ff54846ada 100644 --- a/include/linux/nfs_fs.h +++ b/include/linux/nfs_fs.h | |||
@@ -315,10 +315,6 @@ extern void nfs_end_data_update(struct inode *); | |||
315 | extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); | 315 | extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); |
316 | extern void put_nfs_open_context(struct nfs_open_context *ctx); | 316 | extern void put_nfs_open_context(struct nfs_open_context *ctx); |
317 | extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode); | 317 | extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, int mode); |
318 | extern struct vfsmount *nfs_do_submount(const struct vfsmount *mnt_parent, | ||
319 | const struct dentry *dentry, | ||
320 | struct nfs_fh *fh, | ||
321 | struct nfs_fattr *fattr); | ||
322 | 318 | ||
323 | /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ | 319 | /* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ |
324 | extern u32 root_nfs_parse_addr(char *name); /*__init*/ | 320 | extern u32 root_nfs_parse_addr(char *name); /*__init*/ |
@@ -371,10 +367,12 @@ extern int nfs3_removexattr (struct dentry *, const char *name); | |||
371 | */ | 367 | */ |
372 | extern ssize_t nfs_direct_IO(int, struct kiocb *, const struct iovec *, loff_t, | 368 | extern ssize_t nfs_direct_IO(int, struct kiocb *, const struct iovec *, loff_t, |
373 | unsigned long); | 369 | unsigned long); |
374 | extern ssize_t nfs_file_direct_read(struct kiocb *iocb, char __user *buf, | 370 | extern ssize_t nfs_file_direct_read(struct kiocb *iocb, |
375 | size_t count, loff_t pos); | 371 | const struct iovec *iov, unsigned long nr_segs, |
376 | extern ssize_t nfs_file_direct_write(struct kiocb *iocb, const char __user *buf, | 372 | loff_t pos); |
377 | size_t count, loff_t pos); | 373 | extern ssize_t nfs_file_direct_write(struct kiocb *iocb, |
374 | const struct iovec *iov, unsigned long nr_segs, | ||
375 | loff_t pos); | ||
378 | 376 | ||
379 | /* | 377 | /* |
380 | * linux/fs/nfs/dir.c | 378 | * linux/fs/nfs/dir.c |
diff --git a/include/linux/nfsd/const.h b/include/linux/nfsd/const.h index b75bb1b38d09..f0cc77790527 100644 --- a/include/linux/nfsd/const.h +++ b/include/linux/nfsd/const.h | |||
@@ -20,17 +20,31 @@ | |||
20 | #define NFSSVC_MAXVERS 3 | 20 | #define NFSSVC_MAXVERS 3 |
21 | 21 | ||
22 | /* | 22 | /* |
23 | * Maximum blocksize supported by daemon currently at 32K | 23 | * Maximum blocksizes supported by daemon under various circumstances. |
24 | */ | 24 | */ |
25 | #define NFSSVC_MAXBLKSIZE (32*1024) | 25 | #define NFSSVC_MAXBLKSIZE RPCSVC_MAXPAYLOAD |
26 | /* NFSv2 is limited by the protocol specification, see RFC 1094 */ | ||
27 | #define NFSSVC_MAXBLKSIZE_V2 (8*1024) | ||
26 | 28 | ||
27 | #ifdef __KERNEL__ | 29 | #ifdef __KERNEL__ |
28 | 30 | ||
31 | #include <linux/sunrpc/msg_prot.h> | ||
32 | |||
29 | #ifndef NFS_SUPER_MAGIC | 33 | #ifndef NFS_SUPER_MAGIC |
30 | # define NFS_SUPER_MAGIC 0x6969 | 34 | # define NFS_SUPER_MAGIC 0x6969 |
31 | #endif | 35 | #endif |
32 | 36 | ||
33 | #define NFSD_BUFSIZE (1024 + NFSSVC_MAXBLKSIZE) | 37 | /* |
38 | * Largest number of bytes we need to allocate for an NFS | ||
39 | * call or reply. Used to control buffer sizes. We use | ||
40 | * the length of v3 WRITE, READDIR and READDIR replies | ||
41 | * which are an RPC header, up to 26 XDR units of reply | ||
42 | * data, and some page data. | ||
43 | * | ||
44 | * Note that accuracy here doesn't matter too much as the | ||
45 | * size is rounded up to a page size when allocating space. | ||
46 | */ | ||
47 | #define NFSD_BUFSIZE ((RPC_MAX_HEADER_WITH_AUTH+26)*XDR_UNIT + NFSSVC_MAXBLKSIZE) | ||
34 | 48 | ||
35 | #ifdef CONFIG_NFSD_V4 | 49 | #ifdef CONFIG_NFSD_V4 |
36 | # define NFSSVC_XDRSIZE NFS4_SVC_XDRSIZE | 50 | # define NFSSVC_XDRSIZE NFS4_SVC_XDRSIZE |
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h index d2a8abb5011a..6e78ea969f49 100644 --- a/include/linux/nfsd/export.h +++ b/include/linux/nfsd/export.h | |||
@@ -45,15 +45,36 @@ | |||
45 | 45 | ||
46 | #ifdef __KERNEL__ | 46 | #ifdef __KERNEL__ |
47 | 47 | ||
48 | /* | ||
49 | * FS Locations | ||
50 | */ | ||
51 | |||
52 | #define MAX_FS_LOCATIONS 128 | ||
53 | |||
54 | struct nfsd4_fs_location { | ||
55 | char *hosts; /* colon separated list of hosts */ | ||
56 | char *path; /* slash separated list of path components */ | ||
57 | }; | ||
58 | |||
59 | struct nfsd4_fs_locations { | ||
60 | uint32_t locations_count; | ||
61 | struct nfsd4_fs_location *locations; | ||
62 | /* If we're not actually serving this data ourselves (only providing a | ||
63 | * list of replicas that do serve it) then we set "migrated": */ | ||
64 | int migrated; | ||
65 | }; | ||
66 | |||
48 | struct svc_export { | 67 | struct svc_export { |
49 | struct cache_head h; | 68 | struct cache_head h; |
50 | struct auth_domain * ex_client; | 69 | struct auth_domain * ex_client; |
51 | int ex_flags; | 70 | int ex_flags; |
52 | struct vfsmount * ex_mnt; | 71 | struct vfsmount * ex_mnt; |
53 | struct dentry * ex_dentry; | 72 | struct dentry * ex_dentry; |
73 | char * ex_path; | ||
54 | uid_t ex_anon_uid; | 74 | uid_t ex_anon_uid; |
55 | gid_t ex_anon_gid; | 75 | gid_t ex_anon_gid; |
56 | int ex_fsid; | 76 | int ex_fsid; |
77 | struct nfsd4_fs_locations ex_fslocs; | ||
57 | }; | 78 | }; |
58 | 79 | ||
59 | /* an "export key" (expkey) maps a filehandlefragement to an | 80 | /* an "export key" (expkey) maps a filehandlefragement to an |
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h index 2dcad295fece..d0d4aae7085f 100644 --- a/include/linux/nfsd/nfsd.h +++ b/include/linux/nfsd/nfsd.h | |||
@@ -140,6 +140,12 @@ struct posix_acl *nfsd_get_posix_acl(struct svc_fh *, int); | |||
140 | int nfsd_set_posix_acl(struct svc_fh *, int, struct posix_acl *); | 140 | int nfsd_set_posix_acl(struct svc_fh *, int, struct posix_acl *); |
141 | #endif | 141 | #endif |
142 | 142 | ||
143 | enum vers_op {NFSD_SET, NFSD_CLEAR, NFSD_TEST, NFSD_AVAIL }; | ||
144 | int nfsd_vers(int vers, enum vers_op change); | ||
145 | void nfsd_reset_versions(void); | ||
146 | int nfsd_create_serv(void); | ||
147 | |||
148 | extern int nfsd_max_blksize; | ||
143 | 149 | ||
144 | /* | 150 | /* |
145 | * NFSv4 State | 151 | * NFSv4 State |
@@ -210,6 +216,7 @@ void nfsd_lockd_shutdown(void); | |||
210 | #define nfserr_clid_inuse __constant_htonl(NFSERR_CLID_INUSE) | 216 | #define nfserr_clid_inuse __constant_htonl(NFSERR_CLID_INUSE) |
211 | #define nfserr_stale_clientid __constant_htonl(NFSERR_STALE_CLIENTID) | 217 | #define nfserr_stale_clientid __constant_htonl(NFSERR_STALE_CLIENTID) |
212 | #define nfserr_resource __constant_htonl(NFSERR_RESOURCE) | 218 | #define nfserr_resource __constant_htonl(NFSERR_RESOURCE) |
219 | #define nfserr_moved __constant_htonl(NFSERR_MOVED) | ||
213 | #define nfserr_nofilehandle __constant_htonl(NFSERR_NOFILEHANDLE) | 220 | #define nfserr_nofilehandle __constant_htonl(NFSERR_NOFILEHANDLE) |
214 | #define nfserr_minor_vers_mismatch __constant_htonl(NFSERR_MINOR_VERS_MISMATCH) | 221 | #define nfserr_minor_vers_mismatch __constant_htonl(NFSERR_MINOR_VERS_MISMATCH) |
215 | #define nfserr_share_denied __constant_htonl(NFSERR_SHARE_DENIED) | 222 | #define nfserr_share_denied __constant_htonl(NFSERR_SHARE_DENIED) |
@@ -286,7 +293,6 @@ static inline int is_fsid(struct svc_fh *fh, struct knfsd_fh *reffh) | |||
286 | /* | 293 | /* |
287 | * The following attributes are currently not supported by the NFSv4 server: | 294 | * The following attributes are currently not supported by the NFSv4 server: |
288 | * ARCHIVE (deprecated anyway) | 295 | * ARCHIVE (deprecated anyway) |
289 | * FS_LOCATIONS (will be supported eventually) | ||
290 | * HIDDEN (unlikely to be supported any time soon) | 296 | * HIDDEN (unlikely to be supported any time soon) |
291 | * MIMETYPE (unlikely to be supported any time soon) | 297 | * MIMETYPE (unlikely to be supported any time soon) |
292 | * QUOTA_* (will be supported in a forthcoming patch) | 298 | * QUOTA_* (will be supported in a forthcoming patch) |
@@ -302,7 +308,7 @@ static inline int is_fsid(struct svc_fh *fh, struct knfsd_fh *reffh) | |||
302 | | FATTR4_WORD0_ACLSUPPORT | FATTR4_WORD0_CANSETTIME | FATTR4_WORD0_CASE_INSENSITIVE \ | 308 | | FATTR4_WORD0_ACLSUPPORT | FATTR4_WORD0_CANSETTIME | FATTR4_WORD0_CASE_INSENSITIVE \ |
303 | | FATTR4_WORD0_CASE_PRESERVING | FATTR4_WORD0_CHOWN_RESTRICTED \ | 309 | | FATTR4_WORD0_CASE_PRESERVING | FATTR4_WORD0_CHOWN_RESTRICTED \ |
304 | | FATTR4_WORD0_FILEHANDLE | FATTR4_WORD0_FILEID | FATTR4_WORD0_FILES_AVAIL \ | 310 | | FATTR4_WORD0_FILEHANDLE | FATTR4_WORD0_FILEID | FATTR4_WORD0_FILES_AVAIL \ |
305 | | FATTR4_WORD0_FILES_FREE | FATTR4_WORD0_FILES_TOTAL | FATTR4_WORD0_HOMOGENEOUS \ | 311 | | FATTR4_WORD0_FILES_FREE | FATTR4_WORD0_FILES_TOTAL | FATTR4_WORD0_FS_LOCATIONS | FATTR4_WORD0_HOMOGENEOUS \ |
306 | | FATTR4_WORD0_MAXFILESIZE | FATTR4_WORD0_MAXLINK | FATTR4_WORD0_MAXNAME \ | 312 | | FATTR4_WORD0_MAXFILESIZE | FATTR4_WORD0_MAXLINK | FATTR4_WORD0_MAXNAME \ |
307 | | FATTR4_WORD0_MAXREAD | FATTR4_WORD0_MAXWRITE | FATTR4_WORD0_ACL) | 313 | | FATTR4_WORD0_MAXREAD | FATTR4_WORD0_MAXWRITE | FATTR4_WORD0_ACL) |
308 | 314 | ||
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h index f9edcd2ff3c8..069257ea99a0 100644 --- a/include/linux/nfsd/nfsfh.h +++ b/include/linux/nfsd/nfsfh.h | |||
@@ -269,14 +269,8 @@ fill_post_wcc(struct svc_fh *fhp) | |||
269 | fhp->fh_post_uid = inode->i_uid; | 269 | fhp->fh_post_uid = inode->i_uid; |
270 | fhp->fh_post_gid = inode->i_gid; | 270 | fhp->fh_post_gid = inode->i_gid; |
271 | fhp->fh_post_size = inode->i_size; | 271 | fhp->fh_post_size = inode->i_size; |
272 | if (inode->i_blksize) { | 272 | fhp->fh_post_blksize = BLOCK_SIZE; |
273 | fhp->fh_post_blksize = inode->i_blksize; | 273 | fhp->fh_post_blocks = inode->i_blocks; |
274 | fhp->fh_post_blocks = inode->i_blocks; | ||
275 | } else { | ||
276 | fhp->fh_post_blksize = BLOCK_SIZE; | ||
277 | /* how much do we care for accuracy with MinixFS? */ | ||
278 | fhp->fh_post_blocks = (inode->i_size+511) >> 9; | ||
279 | } | ||
280 | fhp->fh_post_rdev[0] = htonl((u32)imajor(inode)); | 274 | fhp->fh_post_rdev[0] = htonl((u32)imajor(inode)); |
281 | fhp->fh_post_rdev[1] = htonl((u32)iminor(inode)); | 275 | fhp->fh_post_rdev[1] = htonl((u32)iminor(inode)); |
282 | fhp->fh_post_atime = inode->i_atime; | 276 | fhp->fh_post_atime = inode->i_atime; |
@@ -296,8 +290,9 @@ fill_post_wcc(struct svc_fh *fhp) | |||
296 | * vfs.c:nfsd_rename as it needs to grab 2 i_mutex's at once | 290 | * vfs.c:nfsd_rename as it needs to grab 2 i_mutex's at once |
297 | * so, any changes here should be reflected there. | 291 | * so, any changes here should be reflected there. |
298 | */ | 292 | */ |
293 | |||
299 | static inline void | 294 | static inline void |
300 | fh_lock(struct svc_fh *fhp) | 295 | fh_lock_nested(struct svc_fh *fhp, unsigned int subclass) |
301 | { | 296 | { |
302 | struct dentry *dentry = fhp->fh_dentry; | 297 | struct dentry *dentry = fhp->fh_dentry; |
303 | struct inode *inode; | 298 | struct inode *inode; |
@@ -316,11 +311,17 @@ fh_lock(struct svc_fh *fhp) | |||
316 | } | 311 | } |
317 | 312 | ||
318 | inode = dentry->d_inode; | 313 | inode = dentry->d_inode; |
319 | mutex_lock(&inode->i_mutex); | 314 | mutex_lock_nested(&inode->i_mutex, subclass); |
320 | fill_pre_wcc(fhp); | 315 | fill_pre_wcc(fhp); |
321 | fhp->fh_locked = 1; | 316 | fhp->fh_locked = 1; |
322 | } | 317 | } |
323 | 318 | ||
319 | static inline void | ||
320 | fh_lock(struct svc_fh *fhp) | ||
321 | { | ||
322 | fh_lock_nested(fhp, I_MUTEX_NORMAL); | ||
323 | } | ||
324 | |||
324 | /* | 325 | /* |
325 | * Unlock a file handle/inode | 326 | * Unlock a file handle/inode |
326 | */ | 327 | */ |
diff --git a/include/linux/nfsd/stats.h b/include/linux/nfsd/stats.h index 28a82fdd922f..7678cfbe9960 100644 --- a/include/linux/nfsd/stats.h +++ b/include/linux/nfsd/stats.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/nfsd/stats.h | 2 | * linux/include/linux/nfsd/stats.h |
3 | * | 3 | * |
4 | * Statistics for NFS server. | 4 | * Statistics for NFS server. |
5 | * | 5 | * |
diff --git a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h index dae0faea2807..8bcddccb6c42 100644 --- a/include/linux/nfsd/syscall.h +++ b/include/linux/nfsd/syscall.h | |||
@@ -38,21 +38,6 @@ | |||
38 | #define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */ | 38 | #define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */ |
39 | #define NFSCTL_GETFS 8 /* get an fh by path with max FH len */ | 39 | #define NFSCTL_GETFS 8 /* get an fh by path with max FH len */ |
40 | 40 | ||
41 | /* | ||
42 | * Macros used to set version | ||
43 | */ | ||
44 | #define NFSCTL_VERSET(_cltbits, _v) ((_cltbits) |= (1 << (_v))) | ||
45 | #define NFSCTL_VERUNSET(_cltbits, _v) ((_cltbits) &= ~(1 << (_v))) | ||
46 | #define NFSCTL_VERISSET(_cltbits, _v) ((_cltbits) & (1 << (_v))) | ||
47 | |||
48 | #if defined(CONFIG_NFSD_V4) | ||
49 | #define NFSCTL_VERALL (0x1c /* 0b011100 */) | ||
50 | #elif defined(CONFIG_NFSD_V3) | ||
51 | #define NFSCTL_VERALL (0x0c /* 0b001100 */) | ||
52 | #else | ||
53 | #define NFSCTL_VERALL (0x04 /* 0b000100 */) | ||
54 | #endif | ||
55 | |||
56 | /* SVC */ | 41 | /* SVC */ |
57 | struct nfsctl_svc { | 42 | struct nfsctl_svc { |
58 | unsigned short svc_port; | 43 | unsigned short svc_port; |
@@ -134,8 +119,6 @@ extern int exp_delclient(struct nfsctl_client *ncp); | |||
134 | extern int exp_export(struct nfsctl_export *nxp); | 119 | extern int exp_export(struct nfsctl_export *nxp); |
135 | extern int exp_unexport(struct nfsctl_export *nxp); | 120 | extern int exp_unexport(struct nfsctl_export *nxp); |
136 | 121 | ||
137 | extern unsigned int nfsd_versbits; | ||
138 | |||
139 | #endif /* __KERNEL__ */ | 122 | #endif /* __KERNEL__ */ |
140 | 123 | ||
141 | #endif /* NFSD_SYSCALL_H */ | 124 | #endif /* NFSD_SYSCALL_H */ |
diff --git a/include/linux/nfsd/xdr.h b/include/linux/nfsd/xdr.h index 3f4f7142bbe3..0e53de87d886 100644 --- a/include/linux/nfsd/xdr.h +++ b/include/linux/nfsd/xdr.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/inxlude/linux/nfsd/xdr.h | 2 | * linux/include/linux/nfsd/xdr.h |
3 | * | 3 | * |
4 | * XDR types for nfsd. This is mainly a typing exercise. | 4 | * XDR types for nfsd. This is mainly a typing exercise. |
5 | */ | 5 | */ |
@@ -30,7 +30,6 @@ struct nfsd_readargs { | |||
30 | struct svc_fh fh; | 30 | struct svc_fh fh; |
31 | __u32 offset; | 31 | __u32 offset; |
32 | __u32 count; | 32 | __u32 count; |
33 | struct kvec vec[RPCSVC_MAXPAGES]; | ||
34 | int vlen; | 33 | int vlen; |
35 | }; | 34 | }; |
36 | 35 | ||
@@ -38,7 +37,6 @@ struct nfsd_writeargs { | |||
38 | svc_fh fh; | 37 | svc_fh fh; |
39 | __u32 offset; | 38 | __u32 offset; |
40 | int len; | 39 | int len; |
41 | struct kvec vec[RPCSVC_MAXPAGES]; | ||
42 | int vlen; | 40 | int vlen; |
43 | }; | 41 | }; |
44 | 42 | ||
diff --git a/include/linux/nfsd/xdr3.h b/include/linux/nfsd/xdr3.h index a4322741f8b9..474d882dc2f3 100644 --- a/include/linux/nfsd/xdr3.h +++ b/include/linux/nfsd/xdr3.h | |||
@@ -33,7 +33,6 @@ struct nfsd3_readargs { | |||
33 | struct svc_fh fh; | 33 | struct svc_fh fh; |
34 | __u64 offset; | 34 | __u64 offset; |
35 | __u32 count; | 35 | __u32 count; |
36 | struct kvec vec[RPCSVC_MAXPAGES]; | ||
37 | int vlen; | 36 | int vlen; |
38 | }; | 37 | }; |
39 | 38 | ||
@@ -43,7 +42,6 @@ struct nfsd3_writeargs { | |||
43 | __u32 count; | 42 | __u32 count; |
44 | int stable; | 43 | int stable; |
45 | __u32 len; | 44 | __u32 len; |
46 | struct kvec vec[RPCSVC_MAXPAGES]; | ||
47 | int vlen; | 45 | int vlen; |
48 | }; | 46 | }; |
49 | 47 | ||
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h index 77adba7d2281..66e642762a07 100644 --- a/include/linux/nfsd/xdr4.h +++ b/include/linux/nfsd/xdr4.h | |||
@@ -241,7 +241,6 @@ struct nfsd4_read { | |||
241 | stateid_t rd_stateid; /* request */ | 241 | stateid_t rd_stateid; /* request */ |
242 | u64 rd_offset; /* request */ | 242 | u64 rd_offset; /* request */ |
243 | u32 rd_length; /* request */ | 243 | u32 rd_length; /* request */ |
244 | struct kvec rd_iov[RPCSVC_MAXPAGES]; | ||
245 | int rd_vlen; | 244 | int rd_vlen; |
246 | struct file *rd_filp; | 245 | struct file *rd_filp; |
247 | 246 | ||
@@ -326,7 +325,6 @@ struct nfsd4_write { | |||
326 | u64 wr_offset; /* request */ | 325 | u64 wr_offset; /* request */ |
327 | u32 wr_stable_how; /* request */ | 326 | u32 wr_stable_how; /* request */ |
328 | u32 wr_buflen; /* request */ | 327 | u32 wr_buflen; /* request */ |
329 | struct kvec wr_vec[RPCSVC_MAXPAGES]; /* request */ | ||
330 | int wr_vlen; | 328 | int wr_vlen; |
331 | 329 | ||
332 | u32 wr_bytes_written; /* response */ | 330 | u32 wr_bytes_written; /* response */ |
diff --git a/include/linux/nmi.h b/include/linux/nmi.h index c8f4d2f627d7..e16904e28c3a 100644 --- a/include/linux/nmi.h +++ b/include/linux/nmi.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #ifndef LINUX_NMI_H | 4 | #ifndef LINUX_NMI_H |
5 | #define LINUX_NMI_H | 5 | #define LINUX_NMI_H |
6 | 6 | ||
7 | #include <linux/sched.h> | ||
7 | #include <asm/irq.h> | 8 | #include <asm/irq.h> |
8 | 9 | ||
9 | /** | 10 | /** |
@@ -16,7 +17,7 @@ | |||
16 | #ifdef ARCH_HAS_NMI_WATCHDOG | 17 | #ifdef ARCH_HAS_NMI_WATCHDOG |
17 | extern void touch_nmi_watchdog(void); | 18 | extern void touch_nmi_watchdog(void); |
18 | #else | 19 | #else |
19 | # define touch_nmi_watchdog() do { } while(0) | 20 | # define touch_nmi_watchdog() touch_softlockup_watchdog() |
20 | #endif | 21 | #endif |
21 | 22 | ||
22 | #endif | 23 | #endif |
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h index 1a9ef3e627d1..5dce5c21822c 100644 --- a/include/linux/nodemask.h +++ b/include/linux/nodemask.h | |||
@@ -352,6 +352,7 @@ extern nodemask_t node_possible_map; | |||
352 | #define node_possible(node) node_isset((node), node_possible_map) | 352 | #define node_possible(node) node_isset((node), node_possible_map) |
353 | #define first_online_node first_node(node_online_map) | 353 | #define first_online_node first_node(node_online_map) |
354 | #define next_online_node(nid) next_node((nid), node_online_map) | 354 | #define next_online_node(nid) next_node((nid), node_online_map) |
355 | int highest_possible_node_id(void); | ||
355 | #else | 356 | #else |
356 | #define num_online_nodes() 1 | 357 | #define num_online_nodes() 1 |
357 | #define num_possible_nodes() 1 | 358 | #define num_possible_nodes() 1 |
@@ -359,6 +360,7 @@ extern nodemask_t node_possible_map; | |||
359 | #define node_possible(node) ((node) == 0) | 360 | #define node_possible(node) ((node) == 0) |
360 | #define first_online_node 0 | 361 | #define first_online_node 0 |
361 | #define next_online_node(nid) (MAX_NUMNODES) | 362 | #define next_online_node(nid) (MAX_NUMNODES) |
363 | #define highest_possible_node_id() 0 | ||
362 | #endif | 364 | #endif |
363 | 365 | ||
364 | #define any_online_node(mask) \ | 366 | #define any_online_node(mask) \ |
diff --git a/include/linux/notifier.h b/include/linux/notifier.h index 7ff386a6ae87..10a43ed0527e 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h | |||
@@ -12,9 +12,10 @@ | |||
12 | #include <linux/errno.h> | 12 | #include <linux/errno.h> |
13 | #include <linux/mutex.h> | 13 | #include <linux/mutex.h> |
14 | #include <linux/rwsem.h> | 14 | #include <linux/rwsem.h> |
15 | #include <linux/srcu.h> | ||
15 | 16 | ||
16 | /* | 17 | /* |
17 | * Notifier chains are of three types: | 18 | * Notifier chains are of four types: |
18 | * | 19 | * |
19 | * Atomic notifier chains: Chain callbacks run in interrupt/atomic | 20 | * Atomic notifier chains: Chain callbacks run in interrupt/atomic |
20 | * context. Callouts are not allowed to block. | 21 | * context. Callouts are not allowed to block. |
@@ -23,13 +24,27 @@ | |||
23 | * Raw notifier chains: There are no restrictions on callbacks, | 24 | * Raw notifier chains: There are no restrictions on callbacks, |
24 | * registration, or unregistration. All locking and protection | 25 | * registration, or unregistration. All locking and protection |
25 | * must be provided by the caller. | 26 | * must be provided by the caller. |
27 | * SRCU notifier chains: A variant of blocking notifier chains, with | ||
28 | * the same restrictions. | ||
26 | * | 29 | * |
27 | * atomic_notifier_chain_register() may be called from an atomic context, | 30 | * atomic_notifier_chain_register() may be called from an atomic context, |
28 | * but blocking_notifier_chain_register() must be called from a process | 31 | * but blocking_notifier_chain_register() and srcu_notifier_chain_register() |
29 | * context. Ditto for the corresponding _unregister() routines. | 32 | * must be called from a process context. Ditto for the corresponding |
33 | * _unregister() routines. | ||
30 | * | 34 | * |
31 | * atomic_notifier_chain_unregister() and blocking_notifier_chain_unregister() | 35 | * atomic_notifier_chain_unregister(), blocking_notifier_chain_unregister(), |
32 | * _must not_ be called from within the call chain. | 36 | * and srcu_notifier_chain_unregister() _must not_ be called from within |
37 | * the call chain. | ||
38 | * | ||
39 | * SRCU notifier chains are an alternative form of blocking notifier chains. | ||
40 | * They use SRCU (Sleepable Read-Copy Update) instead of rw-semaphores for | ||
41 | * protection of the chain links. This means there is _very_ low overhead | ||
42 | * in srcu_notifier_call_chain(): no cache bounces and no memory barriers. | ||
43 | * As compensation, srcu_notifier_chain_unregister() is rather expensive. | ||
44 | * SRCU notifier chains should be used when the chain will be called very | ||
45 | * often but notifier_blocks will seldom be removed. Also, SRCU notifier | ||
46 | * chains are slightly more difficult to use because they require special | ||
47 | * runtime initialization. | ||
33 | */ | 48 | */ |
34 | 49 | ||
35 | struct notifier_block { | 50 | struct notifier_block { |
@@ -52,6 +67,12 @@ struct raw_notifier_head { | |||
52 | struct notifier_block *head; | 67 | struct notifier_block *head; |
53 | }; | 68 | }; |
54 | 69 | ||
70 | struct srcu_notifier_head { | ||
71 | struct mutex mutex; | ||
72 | struct srcu_struct srcu; | ||
73 | struct notifier_block *head; | ||
74 | }; | ||
75 | |||
55 | #define ATOMIC_INIT_NOTIFIER_HEAD(name) do { \ | 76 | #define ATOMIC_INIT_NOTIFIER_HEAD(name) do { \ |
56 | spin_lock_init(&(name)->lock); \ | 77 | spin_lock_init(&(name)->lock); \ |
57 | (name)->head = NULL; \ | 78 | (name)->head = NULL; \ |
@@ -64,6 +85,11 @@ struct raw_notifier_head { | |||
64 | (name)->head = NULL; \ | 85 | (name)->head = NULL; \ |
65 | } while (0) | 86 | } while (0) |
66 | 87 | ||
88 | /* srcu_notifier_heads must be initialized and cleaned up dynamically */ | ||
89 | extern void srcu_init_notifier_head(struct srcu_notifier_head *nh); | ||
90 | #define srcu_cleanup_notifier_head(name) \ | ||
91 | cleanup_srcu_struct(&(name)->srcu); | ||
92 | |||
67 | #define ATOMIC_NOTIFIER_INIT(name) { \ | 93 | #define ATOMIC_NOTIFIER_INIT(name) { \ |
68 | .lock = __SPIN_LOCK_UNLOCKED(name.lock), \ | 94 | .lock = __SPIN_LOCK_UNLOCKED(name.lock), \ |
69 | .head = NULL } | 95 | .head = NULL } |
@@ -72,6 +98,7 @@ struct raw_notifier_head { | |||
72 | .head = NULL } | 98 | .head = NULL } |
73 | #define RAW_NOTIFIER_INIT(name) { \ | 99 | #define RAW_NOTIFIER_INIT(name) { \ |
74 | .head = NULL } | 100 | .head = NULL } |
101 | /* srcu_notifier_heads cannot be initialized statically */ | ||
75 | 102 | ||
76 | #define ATOMIC_NOTIFIER_HEAD(name) \ | 103 | #define ATOMIC_NOTIFIER_HEAD(name) \ |
77 | struct atomic_notifier_head name = \ | 104 | struct atomic_notifier_head name = \ |
@@ -91,6 +118,8 @@ extern int blocking_notifier_chain_register(struct blocking_notifier_head *, | |||
91 | struct notifier_block *); | 118 | struct notifier_block *); |
92 | extern int raw_notifier_chain_register(struct raw_notifier_head *, | 119 | extern int raw_notifier_chain_register(struct raw_notifier_head *, |
93 | struct notifier_block *); | 120 | struct notifier_block *); |
121 | extern int srcu_notifier_chain_register(struct srcu_notifier_head *, | ||
122 | struct notifier_block *); | ||
94 | 123 | ||
95 | extern int atomic_notifier_chain_unregister(struct atomic_notifier_head *, | 124 | extern int atomic_notifier_chain_unregister(struct atomic_notifier_head *, |
96 | struct notifier_block *); | 125 | struct notifier_block *); |
@@ -98,6 +127,8 @@ extern int blocking_notifier_chain_unregister(struct blocking_notifier_head *, | |||
98 | struct notifier_block *); | 127 | struct notifier_block *); |
99 | extern int raw_notifier_chain_unregister(struct raw_notifier_head *, | 128 | extern int raw_notifier_chain_unregister(struct raw_notifier_head *, |
100 | struct notifier_block *); | 129 | struct notifier_block *); |
130 | extern int srcu_notifier_chain_unregister(struct srcu_notifier_head *, | ||
131 | struct notifier_block *); | ||
101 | 132 | ||
102 | extern int atomic_notifier_call_chain(struct atomic_notifier_head *, | 133 | extern int atomic_notifier_call_chain(struct atomic_notifier_head *, |
103 | unsigned long val, void *v); | 134 | unsigned long val, void *v); |
@@ -105,6 +136,8 @@ extern int blocking_notifier_call_chain(struct blocking_notifier_head *, | |||
105 | unsigned long val, void *v); | 136 | unsigned long val, void *v); |
106 | extern int raw_notifier_call_chain(struct raw_notifier_head *, | 137 | extern int raw_notifier_call_chain(struct raw_notifier_head *, |
107 | unsigned long val, void *v); | 138 | unsigned long val, void *v); |
139 | extern int srcu_notifier_call_chain(struct srcu_notifier_head *, | ||
140 | unsigned long val, void *v); | ||
108 | 141 | ||
109 | #define NOTIFY_DONE 0x0000 /* Don't care */ | 142 | #define NOTIFY_DONE 0x0000 /* Don't care */ |
110 | #define NOTIFY_OK 0x0001 /* Suits me */ | 143 | #define NOTIFY_OK 0x0001 /* Suits me */ |
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h new file mode 100644 index 000000000000..f6baecdeecd6 --- /dev/null +++ b/include/linux/nsproxy.h | |||
@@ -0,0 +1,52 @@ | |||
1 | #ifndef _LINUX_NSPROXY_H | ||
2 | #define _LINUX_NSPROXY_H | ||
3 | |||
4 | #include <linux/spinlock.h> | ||
5 | #include <linux/sched.h> | ||
6 | |||
7 | struct namespace; | ||
8 | struct uts_namespace; | ||
9 | struct ipc_namespace; | ||
10 | |||
11 | /* | ||
12 | * A structure to contain pointers to all per-process | ||
13 | * namespaces - fs (mount), uts, network, sysvipc, etc. | ||
14 | * | ||
15 | * 'count' is the number of tasks holding a reference. | ||
16 | * The count for each namespace, then, will be the number | ||
17 | * of nsproxies pointing to it, not the number of tasks. | ||
18 | * | ||
19 | * The nsproxy is shared by tasks which share all namespaces. | ||
20 | * As soon as a single namespace is cloned or unshared, the | ||
21 | * nsproxy is copied. | ||
22 | */ | ||
23 | struct nsproxy { | ||
24 | atomic_t count; | ||
25 | spinlock_t nslock; | ||
26 | struct uts_namespace *uts_ns; | ||
27 | struct ipc_namespace *ipc_ns; | ||
28 | struct namespace *namespace; | ||
29 | }; | ||
30 | extern struct nsproxy init_nsproxy; | ||
31 | |||
32 | struct nsproxy *dup_namespaces(struct nsproxy *orig); | ||
33 | int copy_namespaces(int flags, struct task_struct *tsk); | ||
34 | void get_task_namespaces(struct task_struct *tsk); | ||
35 | void free_nsproxy(struct nsproxy *ns); | ||
36 | |||
37 | static inline void put_nsproxy(struct nsproxy *ns) | ||
38 | { | ||
39 | if (atomic_dec_and_test(&ns->count)) { | ||
40 | free_nsproxy(ns); | ||
41 | } | ||
42 | } | ||
43 | |||
44 | static inline void exit_task_namespaces(struct task_struct *p) | ||
45 | { | ||
46 | struct nsproxy *ns = p->nsproxy; | ||
47 | if (ns) { | ||
48 | put_nsproxy(ns); | ||
49 | p->nsproxy = NULL; | ||
50 | } | ||
51 | } | ||
52 | #endif | ||
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h index 9d7921dd50f0..4830a3bedfb2 100644 --- a/include/linux/page-flags.h +++ b/include/linux/page-flags.h | |||
@@ -128,12 +128,11 @@ | |||
128 | 128 | ||
129 | #define PageUptodate(page) test_bit(PG_uptodate, &(page)->flags) | 129 | #define PageUptodate(page) test_bit(PG_uptodate, &(page)->flags) |
130 | #ifdef CONFIG_S390 | 130 | #ifdef CONFIG_S390 |
131 | #define SetPageUptodate(_page) \ | 131 | static inline void SetPageUptodate(struct page *page) |
132 | do { \ | 132 | { |
133 | struct page *__page = (_page); \ | 133 | if (!test_and_set_bit(PG_uptodate, &page->flags)) |
134 | if (!test_and_set_bit(PG_uptodate, &__page->flags)) \ | 134 | page_test_and_clear_dirty(page); |
135 | page_test_and_clear_dirty(_page); \ | 135 | } |
136 | } while (0) | ||
137 | #else | 136 | #else |
138 | #define SetPageUptodate(page) set_bit(PG_uptodate, &(page)->flags) | 137 | #define SetPageUptodate(page) set_bit(PG_uptodate, &(page)->flags) |
139 | #endif | 138 | #endif |
diff --git a/include/linux/pci.h b/include/linux/pci.h index 8565b81d7fbc..5c604f5fad67 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -49,6 +49,7 @@ | |||
49 | #include <linux/types.h> | 49 | #include <linux/types.h> |
50 | #include <linux/ioport.h> | 50 | #include <linux/ioport.h> |
51 | #include <linux/list.h> | 51 | #include <linux/list.h> |
52 | #include <linux/compiler.h> | ||
52 | #include <linux/errno.h> | 53 | #include <linux/errno.h> |
53 | #include <linux/device.h> | 54 | #include <linux/device.h> |
54 | 55 | ||
@@ -346,6 +347,8 @@ struct pci_driver { | |||
346 | int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */ | 347 | int (*probe) (struct pci_dev *dev, const struct pci_device_id *id); /* New device inserted */ |
347 | void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ | 348 | void (*remove) (struct pci_dev *dev); /* Device removed (NULL if not a hot-plug capable driver) */ |
348 | int (*suspend) (struct pci_dev *dev, pm_message_t state); /* Device suspended */ | 349 | int (*suspend) (struct pci_dev *dev, pm_message_t state); /* Device suspended */ |
350 | int (*suspend_late) (struct pci_dev *dev, pm_message_t state); | ||
351 | int (*resume_early) (struct pci_dev *dev); | ||
349 | int (*resume) (struct pci_dev *dev); /* Device woken up */ | 352 | int (*resume) (struct pci_dev *dev); /* Device woken up */ |
350 | int (*enable_wake) (struct pci_dev *dev, pci_power_t state, int enable); /* Enable wake event */ | 353 | int (*enable_wake) (struct pci_dev *dev, pci_power_t state, int enable); /* Enable wake event */ |
351 | void (*shutdown) (struct pci_dev *dev); | 354 | void (*shutdown) (struct pci_dev *dev); |
@@ -353,6 +356,8 @@ struct pci_driver { | |||
353 | struct pci_error_handlers *err_handler; | 356 | struct pci_error_handlers *err_handler; |
354 | struct device_driver driver; | 357 | struct device_driver driver; |
355 | struct pci_dynids dynids; | 358 | struct pci_dynids dynids; |
359 | |||
360 | int multithread_probe; | ||
356 | }; | 361 | }; |
357 | 362 | ||
358 | #define to_pci_driver(drv) container_of(drv,struct pci_driver, driver) | 363 | #define to_pci_driver(drv) container_of(drv,struct pci_driver, driver) |
@@ -401,7 +406,7 @@ extern struct list_head pci_root_buses; /* list of all known PCI buses */ | |||
401 | extern struct list_head pci_devices; /* list of all devices */ | 406 | extern struct list_head pci_devices; /* list of all devices */ |
402 | 407 | ||
403 | void pcibios_fixup_bus(struct pci_bus *); | 408 | void pcibios_fixup_bus(struct pci_bus *); |
404 | int pcibios_enable_device(struct pci_dev *, int mask); | 409 | int __must_check pcibios_enable_device(struct pci_dev *, int mask); |
405 | char *pcibios_setup (char *str); | 410 | char *pcibios_setup (char *str); |
406 | 411 | ||
407 | /* Used only when drivers/pci/setup.c is used */ | 412 | /* Used only when drivers/pci/setup.c is used */ |
@@ -428,7 +433,7 @@ int pci_scan_slot(struct pci_bus *bus, int devfn); | |||
428 | struct pci_dev * pci_scan_single_device(struct pci_bus *bus, int devfn); | 433 | struct pci_dev * pci_scan_single_device(struct pci_bus *bus, int devfn); |
429 | void pci_device_add(struct pci_dev *dev, struct pci_bus *bus); | 434 | void pci_device_add(struct pci_dev *dev, struct pci_bus *bus); |
430 | unsigned int pci_scan_child_bus(struct pci_bus *bus); | 435 | unsigned int pci_scan_child_bus(struct pci_bus *bus); |
431 | void pci_bus_add_device(struct pci_dev *dev); | 436 | int __must_check pci_bus_add_device(struct pci_dev *dev); |
432 | void pci_read_bridge_bases(struct pci_bus *child); | 437 | void pci_read_bridge_bases(struct pci_bus *child); |
433 | struct resource *pci_find_parent_resource(const struct pci_dev *dev, struct resource *res); | 438 | struct resource *pci_find_parent_resource(const struct pci_dev *dev, struct resource *res); |
434 | int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge); | 439 | int pci_get_interrupt_pin(struct pci_dev *dev, struct pci_dev **bridge); |
@@ -436,6 +441,7 @@ extern struct pci_dev *pci_dev_get(struct pci_dev *dev); | |||
436 | extern void pci_dev_put(struct pci_dev *dev); | 441 | extern void pci_dev_put(struct pci_dev *dev); |
437 | extern void pci_remove_bus(struct pci_bus *b); | 442 | extern void pci_remove_bus(struct pci_bus *b); |
438 | extern void pci_remove_bus_device(struct pci_dev *dev); | 443 | extern void pci_remove_bus_device(struct pci_dev *dev); |
444 | extern void pci_stop_bus_device(struct pci_dev *dev); | ||
439 | void pci_setup_cardbus(struct pci_bus *bus); | 445 | void pci_setup_cardbus(struct pci_bus *bus); |
440 | 446 | ||
441 | /* Generic PCI functions exported to card drivers */ | 447 | /* Generic PCI functions exported to card drivers */ |
@@ -488,19 +494,19 @@ static inline int pci_write_config_dword(struct pci_dev *dev, int where, u32 val | |||
488 | return pci_bus_write_config_dword (dev->bus, dev->devfn, where, val); | 494 | return pci_bus_write_config_dword (dev->bus, dev->devfn, where, val); |
489 | } | 495 | } |
490 | 496 | ||
491 | int pci_enable_device(struct pci_dev *dev); | 497 | int __must_check pci_enable_device(struct pci_dev *dev); |
492 | int pci_enable_device_bars(struct pci_dev *dev, int mask); | 498 | int __must_check pci_enable_device_bars(struct pci_dev *dev, int mask); |
493 | void pci_disable_device(struct pci_dev *dev); | 499 | void pci_disable_device(struct pci_dev *dev); |
494 | void pci_set_master(struct pci_dev *dev); | 500 | void pci_set_master(struct pci_dev *dev); |
495 | #define HAVE_PCI_SET_MWI | 501 | #define HAVE_PCI_SET_MWI |
496 | int pci_set_mwi(struct pci_dev *dev); | 502 | int __must_check pci_set_mwi(struct pci_dev *dev); |
497 | void pci_clear_mwi(struct pci_dev *dev); | 503 | void pci_clear_mwi(struct pci_dev *dev); |
498 | void pci_intx(struct pci_dev *dev, int enable); | 504 | void pci_intx(struct pci_dev *dev, int enable); |
499 | int pci_set_dma_mask(struct pci_dev *dev, u64 mask); | 505 | int pci_set_dma_mask(struct pci_dev *dev, u64 mask); |
500 | int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); | 506 | int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); |
501 | void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); | 507 | void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); |
502 | int pci_assign_resource(struct pci_dev *dev, int i); | 508 | int __must_check pci_assign_resource(struct pci_dev *dev, int i); |
503 | int pci_assign_resource_fixed(struct pci_dev *dev, int i); | 509 | int __must_check pci_assign_resource_fixed(struct pci_dev *dev, int i); |
504 | void pci_restore_bars(struct pci_dev *dev); | 510 | void pci_restore_bars(struct pci_dev *dev); |
505 | 511 | ||
506 | /* ROM control related routines */ | 512 | /* ROM control related routines */ |
@@ -526,23 +532,24 @@ void pdev_sort_resources(struct pci_dev *, struct resource_list *); | |||
526 | void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), | 532 | void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), |
527 | int (*)(struct pci_dev *, u8, u8)); | 533 | int (*)(struct pci_dev *, u8, u8)); |
528 | #define HAVE_PCI_REQ_REGIONS 2 | 534 | #define HAVE_PCI_REQ_REGIONS 2 |
529 | int pci_request_regions(struct pci_dev *, const char *); | 535 | int __must_check pci_request_regions(struct pci_dev *, const char *); |
530 | void pci_release_regions(struct pci_dev *); | 536 | void pci_release_regions(struct pci_dev *); |
531 | int pci_request_region(struct pci_dev *, int, const char *); | 537 | int __must_check pci_request_region(struct pci_dev *, int, const char *); |
532 | void pci_release_region(struct pci_dev *, int); | 538 | void pci_release_region(struct pci_dev *, int); |
533 | 539 | ||
534 | /* drivers/pci/bus.c */ | 540 | /* drivers/pci/bus.c */ |
535 | int pci_bus_alloc_resource(struct pci_bus *bus, struct resource *res, | 541 | int __must_check pci_bus_alloc_resource(struct pci_bus *bus, |
536 | resource_size_t size, resource_size_t align, | 542 | struct resource *res, resource_size_t size, |
537 | resource_size_t min, unsigned int type_mask, | 543 | resource_size_t align, resource_size_t min, |
538 | void (*alignf)(void *, struct resource *, | 544 | unsigned int type_mask, |
539 | resource_size_t, resource_size_t), | 545 | void (*alignf)(void *, struct resource *, |
540 | void *alignf_data); | 546 | resource_size_t, resource_size_t), |
547 | void *alignf_data); | ||
541 | void pci_enable_bridges(struct pci_bus *bus); | 548 | void pci_enable_bridges(struct pci_bus *bus); |
542 | 549 | ||
543 | /* Proper probing supporting hot-pluggable devices */ | 550 | /* Proper probing supporting hot-pluggable devices */ |
544 | int __pci_register_driver(struct pci_driver *, struct module *); | 551 | int __must_check __pci_register_driver(struct pci_driver *, struct module *); |
545 | static inline int pci_register_driver(struct pci_driver *driver) | 552 | static inline int __must_check pci_register_driver(struct pci_driver *driver) |
546 | { | 553 | { |
547 | return __pci_register_driver(driver, THIS_MODULE); | 554 | return __pci_register_driver(driver, THIS_MODULE); |
548 | } | 555 | } |
@@ -588,6 +595,7 @@ struct msix_entry { | |||
588 | u16 entry; /* driver uses to specify entry, OS writes */ | 595 | u16 entry; /* driver uses to specify entry, OS writes */ |
589 | }; | 596 | }; |
590 | 597 | ||
598 | |||
591 | #ifndef CONFIG_PCI_MSI | 599 | #ifndef CONFIG_PCI_MSI |
592 | static inline void pci_scan_msi_device(struct pci_dev *dev) {} | 600 | static inline void pci_scan_msi_device(struct pci_dev *dev) {} |
593 | static inline int pci_enable_msi(struct pci_dev *dev) {return -1;} | 601 | static inline int pci_enable_msi(struct pci_dev *dev) {return -1;} |
@@ -606,6 +614,12 @@ extern void pci_disable_msix(struct pci_dev *dev); | |||
606 | extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); | 614 | extern void msi_remove_pci_irq_vectors(struct pci_dev *dev); |
607 | #endif | 615 | #endif |
608 | 616 | ||
617 | #ifdef CONFIG_HT_IRQ | ||
618 | /* The functions a driver should call */ | ||
619 | int ht_create_irq(struct pci_dev *dev, int idx); | ||
620 | void ht_destroy_irq(unsigned int irq); | ||
621 | #endif /* CONFIG_HT_IRQ */ | ||
622 | |||
609 | extern void pci_block_user_cfg_access(struct pci_dev *dev); | 623 | extern void pci_block_user_cfg_access(struct pci_dev *dev); |
610 | extern void pci_unblock_user_cfg_access(struct pci_dev *dev); | 624 | extern void pci_unblock_user_cfg_access(struct pci_dev *dev); |
611 | 625 | ||
@@ -780,12 +794,13 @@ enum pci_fixup_pass { | |||
780 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); | 794 | void pci_fixup_device(enum pci_fixup_pass pass, struct pci_dev *dev); |
781 | 795 | ||
782 | extern int pci_pci_problems; | 796 | extern int pci_pci_problems; |
783 | #define PCIPCI_FAIL 1 | 797 | #define PCIPCI_FAIL 1 /* No PCI PCI DMA */ |
784 | #define PCIPCI_TRITON 2 | 798 | #define PCIPCI_TRITON 2 |
785 | #define PCIPCI_NATOMA 4 | 799 | #define PCIPCI_NATOMA 4 |
786 | #define PCIPCI_VIAETBF 8 | 800 | #define PCIPCI_VIAETBF 8 |
787 | #define PCIPCI_VSFX 16 | 801 | #define PCIPCI_VSFX 16 |
788 | #define PCIPCI_ALIMAGIK 32 | 802 | #define PCIPCI_ALIMAGIK 32 /* Need low latency setting */ |
803 | #define PCIAGP_FAIL 64 /* No PCI to AGP DMA */ | ||
789 | 804 | ||
790 | #endif /* __KERNEL__ */ | 805 | #endif /* __KERNEL__ */ |
791 | #endif /* LINUX_PCI_H */ | 806 | #endif /* LINUX_PCI_H */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 6a1e09834559..f069df245469 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -479,6 +479,7 @@ | |||
479 | 479 | ||
480 | #define PCI_VENDOR_ID_AMD 0x1022 | 480 | #define PCI_VENDOR_ID_AMD 0x1022 |
481 | #define PCI_DEVICE_ID_AMD_K8_NB 0x1100 | 481 | #define PCI_DEVICE_ID_AMD_K8_NB 0x1100 |
482 | #define PCI_DEVICE_ID_AMD_K8_NB_MISC 0x1103 | ||
482 | #define PCI_DEVICE_ID_AMD_LANCE 0x2000 | 483 | #define PCI_DEVICE_ID_AMD_LANCE 0x2000 |
483 | #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 | 484 | #define PCI_DEVICE_ID_AMD_LANCE_HOME 0x2001 |
484 | #define PCI_DEVICE_ID_AMD_SCSI 0x2020 | 485 | #define PCI_DEVICE_ID_AMD_SCSI 0x2020 |
@@ -506,6 +507,7 @@ | |||
506 | #define PCI_DEVICE_ID_AMD_8151_0 0x7454 | 507 | #define PCI_DEVICE_ID_AMD_8151_0 0x7454 |
507 | #define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450 | 508 | #define PCI_DEVICE_ID_AMD_8131_BRIDGE 0x7450 |
508 | #define PCI_DEVICE_ID_AMD_8131_APIC 0x7451 | 509 | #define PCI_DEVICE_ID_AMD_8131_APIC 0x7451 |
510 | #define PCI_DEVICE_ID_AMD_8132_BRIDGE 0x7458 | ||
509 | #define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 | 511 | #define PCI_DEVICE_ID_AMD_CS5536_ISA 0x2090 |
510 | #define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 | 512 | #define PCI_DEVICE_ID_AMD_CS5536_FLASH 0x2091 |
511 | #define PCI_DEVICE_ID_AMD_CS5536_AUDIO 0x2093 | 513 | #define PCI_DEVICE_ID_AMD_CS5536_AUDIO 0x2093 |
@@ -1411,6 +1413,7 @@ | |||
1411 | #define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009 | 1413 | #define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009 |
1412 | #define PCI_DEVICE_ID_SERVERWORKS_GCNB_LE 0x0017 | 1414 | #define PCI_DEVICE_ID_SERVERWORKS_GCNB_LE 0x0017 |
1413 | #define PCI_DEVICE_ID_SERVERWORKS_EPB 0x0103 | 1415 | #define PCI_DEVICE_ID_SERVERWORKS_EPB 0x0103 |
1416 | #define PCI_DEVICE_ID_SERVERWORKS_HT2000_PCIE 0x0132 | ||
1414 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200 | 1417 | #define PCI_DEVICE_ID_SERVERWORKS_OSB4 0x0200 |
1415 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201 | 1418 | #define PCI_DEVICE_ID_SERVERWORKS_CSB5 0x0201 |
1416 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6 0x0203 | 1419 | #define PCI_DEVICE_ID_SERVERWORKS_CSB6 0x0203 |
@@ -1482,9 +1485,6 @@ | |||
1482 | #define PCI_DEVICE_ID_MARVELL_GT64260 0x6430 | 1485 | #define PCI_DEVICE_ID_MARVELL_GT64260 0x6430 |
1483 | #define PCI_DEVICE_ID_MARVELL_MV64360 0x6460 | 1486 | #define PCI_DEVICE_ID_MARVELL_MV64360 0x6460 |
1484 | #define PCI_DEVICE_ID_MARVELL_MV64460 0x6480 | 1487 | #define PCI_DEVICE_ID_MARVELL_MV64460 0x6480 |
1485 | #define PCI_DEVICE_ID_MARVELL_GT96100 0x9652 | ||
1486 | #define PCI_DEVICE_ID_MARVELL_GT96100A 0x9653 | ||
1487 | |||
1488 | 1488 | ||
1489 | #define PCI_VENDOR_ID_V3 0x11b0 | 1489 | #define PCI_VENDOR_ID_V3 0x11b0 |
1490 | #define PCI_DEVICE_ID_V3_V960 0x0001 | 1490 | #define PCI_DEVICE_ID_V3_V960 0x0001 |
@@ -1615,8 +1615,6 @@ | |||
1615 | #define PCI_VENDOR_ID_ROCKWELL 0x127A | 1615 | #define PCI_VENDOR_ID_ROCKWELL 0x127A |
1616 | 1616 | ||
1617 | #define PCI_VENDOR_ID_ITE 0x1283 | 1617 | #define PCI_VENDOR_ID_ITE 0x1283 |
1618 | #define PCI_DEVICE_ID_ITE_IT8172G 0x8172 | ||
1619 | #define PCI_DEVICE_ID_ITE_IT8172G_AUDIO 0x0801 | ||
1620 | #define PCI_DEVICE_ID_ITE_8211 0x8211 | 1618 | #define PCI_DEVICE_ID_ITE_8211 0x8211 |
1621 | #define PCI_DEVICE_ID_ITE_8212 0x8212 | 1619 | #define PCI_DEVICE_ID_ITE_8212 0x8212 |
1622 | #define PCI_DEVICE_ID_ITE_8872 0x8872 | 1620 | #define PCI_DEVICE_ID_ITE_8872 0x8872 |
@@ -1883,6 +1881,8 @@ | |||
1883 | #define PCI_DEVICE_ID_PANACOM_QUADMODEM 0x0400 | 1881 | #define PCI_DEVICE_ID_PANACOM_QUADMODEM 0x0400 |
1884 | #define PCI_DEVICE_ID_PANACOM_DUALMODEM 0x0402 | 1882 | #define PCI_DEVICE_ID_PANACOM_DUALMODEM 0x0402 |
1885 | 1883 | ||
1884 | #define PCI_VENDOR_ID_SIPACKETS 0x14d9 | ||
1885 | #define PCI_DEVICE_ID_SP1011 0x0010 | ||
1886 | 1886 | ||
1887 | #define PCI_VENDOR_ID_AFAVLAB 0x14db | 1887 | #define PCI_VENDOR_ID_AFAVLAB 0x14db |
1888 | #define PCI_DEVICE_ID_AFAVLAB_P028 0x2180 | 1888 | #define PCI_DEVICE_ID_AFAVLAB_P028 0x2180 |
@@ -1905,6 +1905,7 @@ | |||
1905 | #define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 | 1905 | #define PCI_DEVICE_ID_TIGON3_5705_2 0x1654 |
1906 | #define PCI_DEVICE_ID_TIGON3_5720 0x1658 | 1906 | #define PCI_DEVICE_ID_TIGON3_5720 0x1658 |
1907 | #define PCI_DEVICE_ID_TIGON3_5721 0x1659 | 1907 | #define PCI_DEVICE_ID_TIGON3_5721 0x1659 |
1908 | #define PCI_DEVICE_ID_TIGON3_5722 0x165a | ||
1908 | #define PCI_DEVICE_ID_TIGON3_5705M 0x165d | 1909 | #define PCI_DEVICE_ID_TIGON3_5705M 0x165d |
1909 | #define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e | 1910 | #define PCI_DEVICE_ID_TIGON3_5705M_2 0x165e |
1910 | #define PCI_DEVICE_ID_TIGON3_5714 0x1668 | 1911 | #define PCI_DEVICE_ID_TIGON3_5714 0x1668 |
@@ -1914,6 +1915,7 @@ | |||
1914 | #define PCI_DEVICE_ID_TIGON3_5705F 0x166e | 1915 | #define PCI_DEVICE_ID_TIGON3_5705F 0x166e |
1915 | #define PCI_DEVICE_ID_TIGON3_5754M 0x1672 | 1916 | #define PCI_DEVICE_ID_TIGON3_5754M 0x1672 |
1916 | #define PCI_DEVICE_ID_TIGON3_5755M 0x1673 | 1917 | #define PCI_DEVICE_ID_TIGON3_5755M 0x1673 |
1918 | #define PCI_DEVICE_ID_TIGON3_5756 0x1674 | ||
1917 | #define PCI_DEVICE_ID_TIGON3_5750 0x1676 | 1919 | #define PCI_DEVICE_ID_TIGON3_5750 0x1676 |
1918 | #define PCI_DEVICE_ID_TIGON3_5751 0x1677 | 1920 | #define PCI_DEVICE_ID_TIGON3_5751 0x1677 |
1919 | #define PCI_DEVICE_ID_TIGON3_5715 0x1678 | 1921 | #define PCI_DEVICE_ID_TIGON3_5715 0x1678 |
@@ -1943,6 +1945,8 @@ | |||
1943 | #define PCI_DEVICE_ID_TIGON3_5901 0x170d | 1945 | #define PCI_DEVICE_ID_TIGON3_5901 0x170d |
1944 | #define PCI_DEVICE_ID_BCM4401B1 0x170c | 1946 | #define PCI_DEVICE_ID_BCM4401B1 0x170c |
1945 | #define PCI_DEVICE_ID_TIGON3_5901_2 0x170e | 1947 | #define PCI_DEVICE_ID_TIGON3_5901_2 0x170e |
1948 | #define PCI_DEVICE_ID_TIGON3_5906 0x1712 | ||
1949 | #define PCI_DEVICE_ID_TIGON3_5906M 0x1713 | ||
1946 | #define PCI_DEVICE_ID_BCM4401 0x4401 | 1950 | #define PCI_DEVICE_ID_BCM4401 0x4401 |
1947 | #define PCI_DEVICE_ID_BCM4401B0 0x4402 | 1951 | #define PCI_DEVICE_ID_BCM4401B0 0x4402 |
1948 | 1952 | ||
@@ -1993,6 +1997,7 @@ | |||
1993 | #define PCI_DEVICE_ID_FARSITE_TE1C 0x1612 | 1997 | #define PCI_DEVICE_ID_FARSITE_TE1C 0x1612 |
1994 | 1998 | ||
1995 | #define PCI_VENDOR_ID_SIBYTE 0x166d | 1999 | #define PCI_VENDOR_ID_SIBYTE 0x166d |
2000 | #define PCI_DEVICE_ID_BCM1250_PCI 0x0001 | ||
1996 | #define PCI_DEVICE_ID_BCM1250_HT 0x0002 | 2001 | #define PCI_DEVICE_ID_BCM1250_HT 0x0002 |
1997 | 2002 | ||
1998 | #define PCI_VENDOR_ID_NETCELL 0x169c | 2003 | #define PCI_VENDOR_ID_NETCELL 0x169c |
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index 96930cb5927c..c312a12ad2d6 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
@@ -12,6 +12,11 @@ | |||
12 | * PCI Local Bus Specification | 12 | * PCI Local Bus Specification |
13 | * PCI to PCI Bridge Specification | 13 | * PCI to PCI Bridge Specification |
14 | * PCI System Design Guide | 14 | * PCI System Design Guide |
15 | * | ||
16 | * For hypertransport information, please consult the following manuals | ||
17 | * from http://www.hypertransport.org | ||
18 | * | ||
19 | * The Hypertransport I/O Link Specification | ||
15 | */ | 20 | */ |
16 | 21 | ||
17 | #ifndef LINUX_PCI_REGS_H | 22 | #ifndef LINUX_PCI_REGS_H |
@@ -196,7 +201,7 @@ | |||
196 | #define PCI_CAP_ID_MSI 0x05 /* Message Signalled Interrupts */ | 201 | #define PCI_CAP_ID_MSI 0x05 /* Message Signalled Interrupts */ |
197 | #define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */ | 202 | #define PCI_CAP_ID_CHSWP 0x06 /* CompactPCI HotSwap */ |
198 | #define PCI_CAP_ID_PCIX 0x07 /* PCI-X */ | 203 | #define PCI_CAP_ID_PCIX 0x07 /* PCI-X */ |
199 | #define PCI_CAP_ID_HT_IRQCONF 0x08 /* HyperTransport IRQ Configuration */ | 204 | #define PCI_CAP_ID_HT 0x08 /* HyperTransport */ |
200 | #define PCI_CAP_ID_VNDR 0x09 /* Vendor specific capability */ | 205 | #define PCI_CAP_ID_VNDR 0x09 /* Vendor specific capability */ |
201 | #define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */ | 206 | #define PCI_CAP_ID_SHPC 0x0C /* PCI Standard Hot-Plug Controller */ |
202 | #define PCI_CAP_ID_EXP 0x10 /* PCI Express */ | 207 | #define PCI_CAP_ID_EXP 0x10 /* PCI Express */ |
@@ -463,4 +468,20 @@ | |||
463 | #define PCI_PWR_CAP 12 /* Capability */ | 468 | #define PCI_PWR_CAP 12 /* Capability */ |
464 | #define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */ | 469 | #define PCI_PWR_CAP_BUDGET(x) ((x) & 1) /* Included in system budget */ |
465 | 470 | ||
471 | /* Hypertransport sub capability types */ | ||
472 | #define HT_CAPTYPE_SLAVE 0x00 /* Slave/Primary link configuration */ | ||
473 | #define HT_CAPTYPE_HOST 0x20 /* Host/Secondary link configuration */ | ||
474 | #define HT_CAPTYPE_IRQ 0x80 /* IRQ Configuration */ | ||
475 | #define HT_CAPTYPE_REMAPPING_40 0xA0 /* 40 bit address remapping */ | ||
476 | #define HT_CAPTYPE_REMAPPING_64 0xA2 /* 64 bit address remapping */ | ||
477 | #define HT_CAPTYPE_UNITID_CLUMP 0x90 /* Unit ID clumping */ | ||
478 | #define HT_CAPTYPE_EXTCONF 0x98 /* Extended Configuration Space Access */ | ||
479 | #define HT_CAPTYPE_MSI_MAPPING 0xA8 /* MSI Mapping Capability */ | ||
480 | #define HT_CAPTYPE_DIRECT_ROUTE 0xB0 /* Direct routing configuration */ | ||
481 | #define HT_CAPTYPE_VCSET 0xB8 /* Virtual Channel configuration */ | ||
482 | #define HT_CAPTYPE_ERROR_RETRY 0xC0 /* Retry on error configuration */ | ||
483 | #define HT_CAPTYPE_GEN3 0xD0 /* Generation 3 hypertransport configuration */ | ||
484 | #define HT_CAPTYPE_PM 0xE0 /* Hypertransport powermanagement configuration */ | ||
485 | |||
486 | |||
466 | #endif /* LINUX_PCI_REGS_H */ | 487 | #endif /* LINUX_PCI_REGS_H */ |
diff --git a/include/linux/pcieport_if.h b/include/linux/pcieport_if.h index b44e01a70914..6cd91e3f9820 100644 --- a/include/linux/pcieport_if.h +++ b/include/linux/pcieport_if.h | |||
@@ -62,6 +62,12 @@ struct pcie_port_service_driver { | |||
62 | int (*suspend) (struct pcie_device *dev, pm_message_t state); | 62 | int (*suspend) (struct pcie_device *dev, pm_message_t state); |
63 | int (*resume) (struct pcie_device *dev); | 63 | int (*resume) (struct pcie_device *dev); |
64 | 64 | ||
65 | /* Service Error Recovery Handler */ | ||
66 | struct pci_error_handlers *err_handler; | ||
67 | |||
68 | /* Link Reset Capability - AER service driver specific */ | ||
69 | pci_ers_result_t (*reset_link) (struct pci_dev *dev); | ||
70 | |||
65 | const struct pcie_port_service_id *id_table; | 71 | const struct pcie_port_service_id *id_table; |
66 | struct device_driver driver; | 72 | struct device_driver driver; |
67 | }; | 73 | }; |
diff --git a/include/linux/percpu.h b/include/linux/percpu.h index 3835a9642f13..46ec72fa2c84 100644 --- a/include/linux/percpu.h +++ b/include/linux/percpu.h | |||
@@ -74,7 +74,7 @@ static inline int __percpu_populate_mask(void *__pdata, size_t size, gfp_t gfp, | |||
74 | return 0; | 74 | return 0; |
75 | } | 75 | } |
76 | 76 | ||
77 | static inline void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask) | 77 | static __always_inline void *__percpu_alloc_mask(size_t size, gfp_t gfp, cpumask_t *mask) |
78 | { | 78 | { |
79 | return kzalloc(size, gfp); | 79 | return kzalloc(size, gfp); |
80 | } | 80 | } |
diff --git a/include/linux/pid.h b/include/linux/pid.h index 29960b03bef7..2c0007d17218 100644 --- a/include/linux/pid.h +++ b/include/linux/pid.h | |||
@@ -68,6 +68,8 @@ extern struct task_struct *FASTCALL(pid_task(struct pid *pid, enum pid_type)); | |||
68 | extern struct task_struct *FASTCALL(get_pid_task(struct pid *pid, | 68 | extern struct task_struct *FASTCALL(get_pid_task(struct pid *pid, |
69 | enum pid_type)); | 69 | enum pid_type)); |
70 | 70 | ||
71 | extern struct pid *get_task_pid(struct task_struct *task, enum pid_type type); | ||
72 | |||
71 | /* | 73 | /* |
72 | * attach_pid() and detach_pid() must be called with the tasklist_lock | 74 | * attach_pid() and detach_pid() must be called with the tasklist_lock |
73 | * write-held. | 75 | * write-held. |
@@ -76,6 +78,8 @@ extern int FASTCALL(attach_pid(struct task_struct *task, | |||
76 | enum pid_type type, int nr)); | 78 | enum pid_type type, int nr)); |
77 | 79 | ||
78 | extern void FASTCALL(detach_pid(struct task_struct *task, enum pid_type)); | 80 | extern void FASTCALL(detach_pid(struct task_struct *task, enum pid_type)); |
81 | extern void FASTCALL(transfer_pid(struct task_struct *old, | ||
82 | struct task_struct *new, enum pid_type)); | ||
79 | 83 | ||
80 | /* | 84 | /* |
81 | * look up a PID in the hash table. Must be called with the tasklist_lock | 85 | * look up a PID in the hash table. Must be called with the tasklist_lock |
@@ -87,33 +91,42 @@ extern struct pid *FASTCALL(find_pid(int nr)); | |||
87 | * Lookup a PID in the hash table, and return with it's count elevated. | 91 | * Lookup a PID in the hash table, and return with it's count elevated. |
88 | */ | 92 | */ |
89 | extern struct pid *find_get_pid(int nr); | 93 | extern struct pid *find_get_pid(int nr); |
94 | extern struct pid *find_ge_pid(int nr); | ||
90 | 95 | ||
91 | extern struct pid *alloc_pid(void); | 96 | extern struct pid *alloc_pid(void); |
92 | extern void FASTCALL(free_pid(struct pid *pid)); | 97 | extern void FASTCALL(free_pid(struct pid *pid)); |
93 | 98 | ||
94 | #define pid_next(task, type) \ | 99 | static inline pid_t pid_nr(struct pid *pid) |
95 | ((task)->pids[(type)].node.next) | 100 | { |
96 | 101 | pid_t nr = 0; | |
97 | #define pid_next_task(task, type) \ | 102 | if (pid) |
98 | hlist_entry(pid_next(task, type), struct task_struct, \ | 103 | nr = pid->nr; |
99 | pids[(type)].node) | 104 | return nr; |
105 | } | ||
100 | 106 | ||
101 | 107 | ||
102 | /* We could use hlist_for_each_entry_rcu here but it takes more arguments | ||
103 | * than the do_each_task_pid/while_each_task_pid. So we roll our own | ||
104 | * to preserve the existing interface. | ||
105 | */ | ||
106 | #define do_each_task_pid(who, type, task) \ | 108 | #define do_each_task_pid(who, type, task) \ |
107 | if ((task = find_task_by_pid_type(type, who))) { \ | 109 | do { \ |
108 | prefetch(pid_next(task, type)); \ | 110 | struct hlist_node *pos___; \ |
109 | do { | 111 | struct pid *pid___ = find_pid(who); \ |
112 | if (pid___ != NULL) \ | ||
113 | hlist_for_each_entry_rcu((task), pos___, \ | ||
114 | &pid___->tasks[type], pids[type].node) { | ||
110 | 115 | ||
111 | #define while_each_task_pid(who, type, task) \ | 116 | #define while_each_task_pid(who, type, task) \ |
112 | } while (pid_next(task, type) && ({ \ | 117 | } \ |
113 | task = pid_next_task(task, type); \ | 118 | } while (0) |
114 | rcu_dereference(task); \ | 119 | |
115 | prefetch(pid_next(task, type)); \ | 120 | |
116 | 1; }) ); \ | 121 | #define do_each_pid_task(pid, type, task) \ |
117 | } | 122 | do { \ |
123 | struct hlist_node *pos___; \ | ||
124 | if (pid != NULL) \ | ||
125 | hlist_for_each_entry_rcu((task), pos___, \ | ||
126 | &pid->tasks[type], pids[type].node) { | ||
127 | |||
128 | #define while_each_pid_task(pid, type, task) \ | ||
129 | } \ | ||
130 | } while (0) | ||
118 | 131 | ||
119 | #endif /* _LINUX_PID_H */ | 132 | #endif /* _LINUX_PID_H */ |
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 782090c68932..29cd6dee13db 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
@@ -49,6 +49,8 @@ struct platform_driver { | |||
49 | int (*remove)(struct platform_device *); | 49 | int (*remove)(struct platform_device *); |
50 | void (*shutdown)(struct platform_device *); | 50 | void (*shutdown)(struct platform_device *); |
51 | int (*suspend)(struct platform_device *, pm_message_t state); | 51 | int (*suspend)(struct platform_device *, pm_message_t state); |
52 | int (*suspend_late)(struct platform_device *, pm_message_t state); | ||
53 | int (*resume_early)(struct platform_device *); | ||
52 | int (*resume)(struct platform_device *); | 54 | int (*resume)(struct platform_device *); |
53 | struct device_driver driver; | 55 | struct device_driver driver; |
54 | }; | 56 | }; |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 658c1b93d5bb..6b27e07aef19 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -142,29 +142,61 @@ typedef struct pm_message { | |||
142 | } pm_message_t; | 142 | } pm_message_t; |
143 | 143 | ||
144 | /* | 144 | /* |
145 | * There are 4 important states driver can be in: | 145 | * Several driver power state transitions are externally visible, affecting |
146 | * ON -- driver is working | 146 | * the state of pending I/O queues and (for drivers that touch hardware) |
147 | * FREEZE -- stop operations and apply whatever policy is applicable to a | 147 | * interrupts, wakeups, DMA, and other hardware state. There may also be |
148 | * suspended driver of that class, freeze queues for block like IDE | 148 | * internal transitions to various low power modes, which are transparent |
149 | * does, drop packets for ethernet, etc... stop DMA engine too etc... | 149 | * to the rest of the driver stack (such as a driver that's ON gating off |
150 | * so a consistent image can be saved; but do not power any hardware | 150 | * clocks which are not in active use). |
151 | * down. | ||
152 | * SUSPEND - like FREEZE, but hardware is doing as much powersaving as | ||
153 | * possible. Roughly pci D3. | ||
154 | * | 151 | * |
155 | * Unfortunately, current drivers only recognize numeric values 0 (ON) and 3 | 152 | * One transition is triggered by resume(), after a suspend() call; the |
156 | * (SUSPEND). We'll need to fix the drivers. So yes, putting 3 to all different | 153 | * message is implicit: |
157 | * defines is intentional, and will go away as soon as drivers are fixed. Also | 154 | * |
158 | * note that typedef is neccessary, we'll probably want to switch to | 155 | * ON Driver starts working again, responding to hardware events |
159 | * typedef struct pm_message_t { int event; int flags; } pm_message_t | 156 | * and software requests. The hardware may have gone through |
160 | * or something similar soon. | 157 | * a power-off reset, or it may have maintained state from the |
158 | * previous suspend() which the driver will rely on while | ||
159 | * resuming. On most platforms, there are no restrictions on | ||
160 | * availability of resources like clocks during resume(). | ||
161 | * | ||
162 | * Other transitions are triggered by messages sent using suspend(). All | ||
163 | * these transitions quiesce the driver, so that I/O queues are inactive. | ||
164 | * That commonly entails turning off IRQs and DMA; there may be rules | ||
165 | * about how to quiesce that are specific to the bus or the device's type. | ||
166 | * (For example, network drivers mark the link state.) Other details may | ||
167 | * differ according to the message: | ||
168 | * | ||
169 | * SUSPEND Quiesce, enter a low power device state appropriate for | ||
170 | * the upcoming system state (such as PCI_D3hot), and enable | ||
171 | * wakeup events as appropriate. | ||
172 | * | ||
173 | * FREEZE Quiesce operations so that a consistent image can be saved; | ||
174 | * but do NOT otherwise enter a low power device state, and do | ||
175 | * NOT emit system wakeup events. | ||
176 | * | ||
177 | * PRETHAW Quiesce as if for FREEZE; additionally, prepare for restoring | ||
178 | * the system from a snapshot taken after an earlier FREEZE. | ||
179 | * Some drivers will need to reset their hardware state instead | ||
180 | * of preserving it, to ensure that it's never mistaken for the | ||
181 | * state which that earlier snapshot had set up. | ||
182 | * | ||
183 | * A minimally power-aware driver treats all messages as SUSPEND, fully | ||
184 | * reinitializes its device during resume() -- whether or not it was reset | ||
185 | * during the suspend/resume cycle -- and can't issue wakeup events. | ||
186 | * | ||
187 | * More power-aware drivers may also use low power states at runtime as | ||
188 | * well as during system sleep states like PM_SUSPEND_STANDBY. They may | ||
189 | * be able to use wakeup events to exit from runtime low-power states, | ||
190 | * or from system low-power states such as standby or suspend-to-RAM. | ||
161 | */ | 191 | */ |
162 | 192 | ||
163 | #define PM_EVENT_ON 0 | 193 | #define PM_EVENT_ON 0 |
164 | #define PM_EVENT_FREEZE 1 | 194 | #define PM_EVENT_FREEZE 1 |
165 | #define PM_EVENT_SUSPEND 2 | 195 | #define PM_EVENT_SUSPEND 2 |
196 | #define PM_EVENT_PRETHAW 3 | ||
166 | 197 | ||
167 | #define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, }) | 198 | #define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, }) |
199 | #define PMSG_PRETHAW ((struct pm_message){ .event = PM_EVENT_PRETHAW, }) | ||
168 | #define PMSG_SUSPEND ((struct pm_message){ .event = PM_EVENT_SUSPEND, }) | 200 | #define PMSG_SUSPEND ((struct pm_message){ .event = PM_EVENT_SUSPEND, }) |
169 | #define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, }) | 201 | #define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, }) |
170 | 202 | ||
@@ -190,6 +222,7 @@ extern void device_resume(void); | |||
190 | extern suspend_disk_method_t pm_disk_mode; | 222 | extern suspend_disk_method_t pm_disk_mode; |
191 | 223 | ||
192 | extern int device_suspend(pm_message_t state); | 224 | extern int device_suspend(pm_message_t state); |
225 | extern int device_prepare_suspend(pm_message_t state); | ||
193 | 226 | ||
194 | #define device_set_wakeup_enable(dev,val) \ | 227 | #define device_set_wakeup_enable(dev,val) \ |
195 | ((dev)->power.should_wakeup = !!(val)) | 228 | ((dev)->power.should_wakeup = !!(val)) |
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h index 95572c434bc9..a7dd38f30ade 100644 --- a/include/linux/posix-timers.h +++ b/include/linux/posix-timers.h | |||
@@ -72,6 +72,7 @@ struct k_clock { | |||
72 | int (*timer_create) (struct k_itimer *timer); | 72 | int (*timer_create) (struct k_itimer *timer); |
73 | int (*nsleep) (const clockid_t which_clock, int flags, | 73 | int (*nsleep) (const clockid_t which_clock, int flags, |
74 | struct timespec *, struct timespec __user *); | 74 | struct timespec *, struct timespec __user *); |
75 | long (*nsleep_restart) (struct restart_block *restart_block); | ||
75 | int (*timer_set) (struct k_itimer * timr, int flags, | 76 | int (*timer_set) (struct k_itimer * timr, int flags, |
76 | struct itimerspec * new_setting, | 77 | struct itimerspec * new_setting, |
77 | struct itimerspec * old_setting); | 78 | struct itimerspec * old_setting); |
@@ -97,6 +98,7 @@ int posix_cpu_clock_set(const clockid_t which_clock, const struct timespec *ts); | |||
97 | int posix_cpu_timer_create(struct k_itimer *timer); | 98 | int posix_cpu_timer_create(struct k_itimer *timer); |
98 | int posix_cpu_nsleep(const clockid_t which_clock, int flags, | 99 | int posix_cpu_nsleep(const clockid_t which_clock, int flags, |
99 | struct timespec *rqtp, struct timespec __user *rmtp); | 100 | struct timespec *rqtp, struct timespec __user *rmtp); |
101 | long posix_cpu_nsleep_restart(struct restart_block *restart_block); | ||
100 | int posix_cpu_timer_set(struct k_itimer *timer, int flags, | 102 | int posix_cpu_timer_set(struct k_itimer *timer, int flags, |
101 | struct itimerspec *new, struct itimerspec *old); | 103 | struct itimerspec *new, struct itimerspec *old); |
102 | int posix_cpu_timer_del(struct k_itimer *timer); | 104 | int posix_cpu_timer_del(struct k_itimer *timer); |
@@ -111,4 +113,6 @@ void posix_cpu_timers_exit_group(struct task_struct *task); | |||
111 | void set_process_cpu_timer(struct task_struct *task, unsigned int clock_idx, | 113 | void set_process_cpu_timer(struct task_struct *task, unsigned int clock_idx, |
112 | cputime_t *newval, cputime_t *oldval); | 114 | cputime_t *newval, cputime_t *oldval); |
113 | 115 | ||
116 | long clock_nanosleep_restart(struct restart_block *restart_block); | ||
117 | |||
114 | #endif | 118 | #endif |
diff --git a/include/linux/ppdev.h b/include/linux/ppdev.h index f376a7598a78..dc18c5d23ebe 100644 --- a/include/linux/ppdev.h +++ b/include/linux/ppdev.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/drivers/char/ppdev.h | 2 | * linux/include/linux/ppdev.h |
3 | * | 3 | * |
4 | * User-space parallel port device driver (header file). | 4 | * User-space parallel port device driver (header file). |
5 | * | 5 | * |
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h index 3435ca38dd14..87dec8fe6de9 100644 --- a/include/linux/proc_fs.h +++ b/include/linux/proc_fs.h | |||
@@ -244,13 +244,15 @@ static inline void kclist_add(struct kcore_list *new, void *addr, size_t size) | |||
244 | extern void kclist_add(struct kcore_list *, void *, size_t); | 244 | extern void kclist_add(struct kcore_list *, void *, size_t); |
245 | #endif | 245 | #endif |
246 | 246 | ||
247 | union proc_op { | ||
248 | int (*proc_get_link)(struct inode *, struct dentry **, struct vfsmount **); | ||
249 | int (*proc_read)(struct task_struct *task, char *page); | ||
250 | }; | ||
251 | |||
247 | struct proc_inode { | 252 | struct proc_inode { |
248 | struct pid *pid; | 253 | struct pid *pid; |
249 | int fd; | 254 | int fd; |
250 | union { | 255 | union proc_op op; |
251 | int (*proc_get_link)(struct inode *, struct dentry **, struct vfsmount **); | ||
252 | int (*proc_read)(struct task_struct *task, char *page); | ||
253 | } op; | ||
254 | struct proc_dir_entry *pde; | 256 | struct proc_dir_entry *pde; |
255 | struct inode vfs_inode; | 257 | struct inode vfs_inode; |
256 | }; | 258 | }; |
@@ -268,7 +270,9 @@ static inline struct proc_dir_entry *PDE(const struct inode *inode) | |||
268 | struct proc_maps_private { | 270 | struct proc_maps_private { |
269 | struct pid *pid; | 271 | struct pid *pid; |
270 | struct task_struct *task; | 272 | struct task_struct *task; |
273 | #ifdef CONFIG_MMU | ||
271 | struct vm_area_struct *tail_vma; | 274 | struct vm_area_struct *tail_vma; |
275 | #endif | ||
272 | }; | 276 | }; |
273 | 277 | ||
274 | #endif /* _LINUX_PROC_FS_H */ | 278 | #endif /* _LINUX_PROC_FS_H */ |
diff --git a/include/linux/pspace.h b/include/linux/pspace.h new file mode 100644 index 000000000000..91d48b8b2d99 --- /dev/null +++ b/include/linux/pspace.h | |||
@@ -0,0 +1,23 @@ | |||
1 | #ifndef _LINUX_PSPACE_H | ||
2 | #define _LINUX_PSPACE_H | ||
3 | |||
4 | #include <linux/sched.h> | ||
5 | #include <linux/mm.h> | ||
6 | #include <linux/threads.h> | ||
7 | #include <linux/pid.h> | ||
8 | |||
9 | struct pidmap { | ||
10 | atomic_t nr_free; | ||
11 | void *page; | ||
12 | }; | ||
13 | |||
14 | #define PIDMAP_ENTRIES ((PID_MAX_LIMIT + 8*PAGE_SIZE - 1)/PAGE_SIZE/8) | ||
15 | |||
16 | struct pspace { | ||
17 | struct pidmap pidmap[PIDMAP_ENTRIES]; | ||
18 | int last_pid; | ||
19 | }; | ||
20 | |||
21 | extern struct pspace init_pspace; | ||
22 | |||
23 | #endif /* _LINUX_PSPACE_H */ | ||
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h index 8b2749a259dc..eeb1976ef7bf 100644 --- a/include/linux/ptrace.h +++ b/include/linux/ptrace.h | |||
@@ -16,8 +16,8 @@ | |||
16 | #define PTRACE_KILL 8 | 16 | #define PTRACE_KILL 8 |
17 | #define PTRACE_SINGLESTEP 9 | 17 | #define PTRACE_SINGLESTEP 9 |
18 | 18 | ||
19 | #define PTRACE_ATTACH 0x10 | 19 | #define PTRACE_ATTACH 16 |
20 | #define PTRACE_DETACH 0x11 | 20 | #define PTRACE_DETACH 17 |
21 | 21 | ||
22 | #define PTRACE_SYSCALL 24 | 22 | #define PTRACE_SYSCALL 24 |
23 | 23 | ||
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h index 63df898fe2e9..84d887751855 100644 --- a/include/linux/raid/bitmap.h +++ b/include/linux/raid/bitmap.h | |||
@@ -265,6 +265,8 @@ int bitmap_update_sb(struct bitmap *bitmap); | |||
265 | int bitmap_setallbits(struct bitmap *bitmap); | 265 | int bitmap_setallbits(struct bitmap *bitmap); |
266 | void bitmap_write_all(struct bitmap *bitmap); | 266 | void bitmap_write_all(struct bitmap *bitmap); |
267 | 267 | ||
268 | void bitmap_dirty_bits(struct bitmap *bitmap, unsigned long s, unsigned long e); | ||
269 | |||
268 | /* these are exported */ | 270 | /* these are exported */ |
269 | int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, | 271 | int bitmap_startwrite(struct bitmap *bitmap, sector_t offset, |
270 | unsigned long sectors, int behind); | 272 | unsigned long sectors, int behind); |
diff --git a/include/linux/raid/md.h b/include/linux/raid/md.h index eb3e547c8fee..866a1e2b0ce0 100644 --- a/include/linux/raid/md.h +++ b/include/linux/raid/md.h | |||
@@ -53,6 +53,8 @@ | |||
53 | #include <linux/raid/md_u.h> | 53 | #include <linux/raid/md_u.h> |
54 | #include <linux/raid/md_k.h> | 54 | #include <linux/raid/md_k.h> |
55 | 55 | ||
56 | #ifdef CONFIG_MD | ||
57 | |||
56 | /* | 58 | /* |
57 | * Different major versions are not compatible. | 59 | * Different major versions are not compatible. |
58 | * Different minor versions are only downward compatible. | 60 | * Different minor versions are only downward compatible. |
@@ -93,7 +95,7 @@ extern int sync_page_io(struct block_device *bdev, sector_t sector, int size, | |||
93 | extern void md_do_sync(mddev_t *mddev); | 95 | extern void md_do_sync(mddev_t *mddev); |
94 | extern void md_new_event(mddev_t *mddev); | 96 | extern void md_new_event(mddev_t *mddev); |
95 | 97 | ||
96 | extern void md_update_sb(mddev_t * mddev); | ||
97 | 98 | ||
99 | #endif /* CONFIG_MD */ | ||
98 | #endif | 100 | #endif |
99 | 101 | ||
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h index d28890295852..8245c282168b 100644 --- a/include/linux/raid/md_k.h +++ b/include/linux/raid/md_k.h | |||
@@ -18,6 +18,8 @@ | |||
18 | /* and dm-bio-list.h is not under include/linux because.... ??? */ | 18 | /* and dm-bio-list.h is not under include/linux because.... ??? */ |
19 | #include "../../../drivers/md/dm-bio-list.h" | 19 | #include "../../../drivers/md/dm-bio-list.h" |
20 | 20 | ||
21 | #ifdef CONFIG_BLOCK | ||
22 | |||
21 | #define LEVEL_MULTIPATH (-4) | 23 | #define LEVEL_MULTIPATH (-4) |
22 | #define LEVEL_LINEAR (-1) | 24 | #define LEVEL_LINEAR (-1) |
23 | #define LEVEL_FAULTY (-5) | 25 | #define LEVEL_FAULTY (-5) |
@@ -29,18 +31,15 @@ | |||
29 | #define LEVEL_NONE (-1000000) | 31 | #define LEVEL_NONE (-1000000) |
30 | 32 | ||
31 | #define MaxSector (~(sector_t)0) | 33 | #define MaxSector (~(sector_t)0) |
32 | #define MD_THREAD_NAME_MAX 14 | ||
33 | 34 | ||
34 | typedef struct mddev_s mddev_t; | 35 | typedef struct mddev_s mddev_t; |
35 | typedef struct mdk_rdev_s mdk_rdev_t; | 36 | typedef struct mdk_rdev_s mdk_rdev_t; |
36 | 37 | ||
37 | #define MAX_MD_DEVS 256 /* Max number of md dev */ | ||
38 | |||
39 | /* | 38 | /* |
40 | * options passed in raidrun: | 39 | * options passed in raidrun: |
41 | */ | 40 | */ |
42 | 41 | ||
43 | /* Currently this must fix in an 'int' */ | 42 | /* Currently this must fit in an 'int' */ |
44 | #define MAX_CHUNK_SIZE (1<<30) | 43 | #define MAX_CHUNK_SIZE (1<<30) |
45 | 44 | ||
46 | /* | 45 | /* |
@@ -114,7 +113,11 @@ struct mddev_s | |||
114 | dev_t unit; | 113 | dev_t unit; |
115 | int md_minor; | 114 | int md_minor; |
116 | struct list_head disks; | 115 | struct list_head disks; |
117 | int sb_dirty; | 116 | unsigned long flags; |
117 | #define MD_CHANGE_DEVS 0 /* Some device status has changed */ | ||
118 | #define MD_CHANGE_CLEAN 1 /* transition to or from 'clean' */ | ||
119 | #define MD_CHANGE_PENDING 2 /* superblock update in progress */ | ||
120 | |||
118 | int ro; | 121 | int ro; |
119 | 122 | ||
120 | struct gendisk *gendisk; | 123 | struct gendisk *gendisk; |
@@ -362,5 +365,6 @@ static inline void safe_put_page(struct page *p) | |||
362 | if (p) put_page(p); | 365 | if (p) put_page(p); |
363 | } | 366 | } |
364 | 367 | ||
368 | #endif /* CONFIG_BLOCK */ | ||
365 | #endif | 369 | #endif |
366 | 370 | ||
diff --git a/include/linux/raid/md_u.h b/include/linux/raid/md_u.h index 81da20ccec4d..7192035fc4b0 100644 --- a/include/linux/raid/md_u.h +++ b/include/linux/raid/md_u.h | |||
@@ -41,7 +41,7 @@ | |||
41 | 41 | ||
42 | /* usage */ | 42 | /* usage */ |
43 | #define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t) | 43 | #define RUN_ARRAY _IOW (MD_MAJOR, 0x30, mdu_param_t) |
44 | #define START_ARRAY _IO (MD_MAJOR, 0x31) | 44 | /* 0x31 was START_ARRAY */ |
45 | #define STOP_ARRAY _IO (MD_MAJOR, 0x32) | 45 | #define STOP_ARRAY _IO (MD_MAJOR, 0x32) |
46 | #define STOP_ARRAY_RO _IO (MD_MAJOR, 0x33) | 46 | #define STOP_ARRAY_RO _IO (MD_MAJOR, 0x33) |
47 | #define RESTART_ARRAY_RW _IO (MD_MAJOR, 0x34) | 47 | #define RESTART_ARRAY_RW _IO (MD_MAJOR, 0x34) |
diff --git a/include/linux/raid/raid1.h b/include/linux/raid/raid1.h index 3009c813d83d..0a9ba7c3302e 100644 --- a/include/linux/raid/raid1.h +++ b/include/linux/raid/raid1.h | |||
@@ -30,7 +30,6 @@ struct r1_private_data_s { | |||
30 | mddev_t *mddev; | 30 | mddev_t *mddev; |
31 | mirror_info_t *mirrors; | 31 | mirror_info_t *mirrors; |
32 | int raid_disks; | 32 | int raid_disks; |
33 | int working_disks; | ||
34 | int last_used; | 33 | int last_used; |
35 | sector_t next_seq_sect; | 34 | sector_t next_seq_sect; |
36 | spinlock_t device_lock; | 35 | spinlock_t device_lock; |
diff --git a/include/linux/raid/raid10.h b/include/linux/raid/raid10.h index c41e56a7c090..e9091cfeb286 100644 --- a/include/linux/raid/raid10.h +++ b/include/linux/raid/raid10.h | |||
@@ -16,7 +16,6 @@ struct r10_private_data_s { | |||
16 | mddev_t *mddev; | 16 | mddev_t *mddev; |
17 | mirror_info_t *mirrors; | 17 | mirror_info_t *mirrors; |
18 | int raid_disks; | 18 | int raid_disks; |
19 | int working_disks; | ||
20 | spinlock_t device_lock; | 19 | spinlock_t device_lock; |
21 | 20 | ||
22 | /* geometry */ | 21 | /* geometry */ |
diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h index 20ed4c997636..f13299a15591 100644 --- a/include/linux/raid/raid5.h +++ b/include/linux/raid/raid5.h | |||
@@ -195,8 +195,9 @@ struct stripe_head { | |||
195 | * it to the count of prereading stripes. | 195 | * it to the count of prereading stripes. |
196 | * When write is initiated, or the stripe refcnt == 0 (just in case) we | 196 | * When write is initiated, or the stripe refcnt == 0 (just in case) we |
197 | * clear the PREREAD_ACTIVE flag and decrement the count | 197 | * clear the PREREAD_ACTIVE flag and decrement the count |
198 | * Whenever the delayed queue is empty and the device is not plugged, we | 198 | * Whenever the 'handle' queue is empty and the device is not plugged, we |
199 | * move any strips from delayed to handle and clear the DELAYED flag and set PREREAD_ACTIVE. | 199 | * move any strips from delayed to handle and clear the DELAYED flag and set |
200 | * PREREAD_ACTIVE. | ||
200 | * In stripe_handle, if we find pre-reading is necessary, we do it if | 201 | * In stripe_handle, if we find pre-reading is necessary, we do it if |
201 | * PREREAD_ACTIVE is set, else we set DELAYED which will send it to the delayed queue. | 202 | * PREREAD_ACTIVE is set, else we set DELAYED which will send it to the delayed queue. |
202 | * HANDLE gets cleared if stripe_handle leave nothing locked. | 203 | * HANDLE gets cleared if stripe_handle leave nothing locked. |
@@ -213,7 +214,7 @@ struct raid5_private_data { | |||
213 | struct disk_info *spare; | 214 | struct disk_info *spare; |
214 | int chunk_size, level, algorithm; | 215 | int chunk_size, level, algorithm; |
215 | int max_degraded; | 216 | int max_degraded; |
216 | int raid_disks, working_disks, failed_disks; | 217 | int raid_disks; |
217 | int max_nr_stripes; | 218 | int max_nr_stripes; |
218 | 219 | ||
219 | /* used during an expand */ | 220 | /* used during an expand */ |
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h index 00b340ba6612..b160fb18e8d6 100644 --- a/include/linux/ramfs.h +++ b/include/linux/ramfs.h | |||
@@ -17,5 +17,6 @@ extern int ramfs_nommu_mmap(struct file *file, struct vm_area_struct *vma); | |||
17 | 17 | ||
18 | extern const struct file_operations ramfs_file_operations; | 18 | extern const struct file_operations ramfs_file_operations; |
19 | extern struct vm_operations_struct generic_file_vm_ops; | 19 | extern struct vm_operations_struct generic_file_vm_ops; |
20 | extern int __init init_rootfs(void); | ||
20 | 21 | ||
21 | #endif | 22 | #endif |
diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h index 8d5382e62c08..344bc3495ddb 100644 --- a/include/linux/rbtree.h +++ b/include/linux/rbtree.h | |||
@@ -133,7 +133,7 @@ static inline void rb_set_color(struct rb_node *rb, int color) | |||
133 | #define rb_entry(ptr, type, member) container_of(ptr, type, member) | 133 | #define rb_entry(ptr, type, member) container_of(ptr, type, member) |
134 | 134 | ||
135 | #define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL) | 135 | #define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL) |
136 | #define RB_EMPTY_NODE(node) (rb_parent(node) != node) | 136 | #define RB_EMPTY_NODE(node) (rb_parent(node) == node) |
137 | #define RB_CLEAR_NODE(node) (rb_set_parent(node, node)) | 137 | #define RB_CLEAR_NODE(node) (rb_set_parent(node, node)) |
138 | 138 | ||
139 | extern void rb_insert_color(struct rb_node *, struct rb_root *); | 139 | extern void rb_insert_color(struct rb_node *, struct rb_root *); |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index b4ca73d65891..c6b7485eac7c 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -19,7 +19,7 @@ | |||
19 | * | 19 | * |
20 | * Author: Dipankar Sarma <dipankar@in.ibm.com> | 20 | * Author: Dipankar Sarma <dipankar@in.ibm.com> |
21 | * | 21 | * |
22 | * Based on the original work by Paul McKenney <paul.mckenney@us.ibm.com> | 22 | * Based on the original work by Paul McKenney <paulmck@us.ibm.com> |
23 | * and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen. | 23 | * and inputs from Rusty Russell, Andrea Arcangeli and Andi Kleen. |
24 | * Papers: | 24 | * Papers: |
25 | * http://www.rdrop.com/users/paulmck/paper/rclockpdcsproof.pdf | 25 | * http://www.rdrop.com/users/paulmck/paper/rclockpdcsproof.pdf |
@@ -66,6 +66,8 @@ struct rcu_ctrlblk { | |||
66 | long completed; /* Number of the last completed batch */ | 66 | long completed; /* Number of the last completed batch */ |
67 | int next_pending; /* Is the next batch already waiting? */ | 67 | int next_pending; /* Is the next batch already waiting? */ |
68 | 68 | ||
69 | int signaled; | ||
70 | |||
69 | spinlock_t lock ____cacheline_internodealigned_in_smp; | 71 | spinlock_t lock ____cacheline_internodealigned_in_smp; |
70 | cpumask_t cpumask; /* CPUs that need to switch in order */ | 72 | cpumask_t cpumask; /* CPUs that need to switch in order */ |
71 | /* for current batch to proceed. */ | 73 | /* for current batch to proceed. */ |
@@ -106,9 +108,6 @@ struct rcu_data { | |||
106 | long blimit; /* Upper limit on a processed batch */ | 108 | long blimit; /* Upper limit on a processed batch */ |
107 | int cpu; | 109 | int cpu; |
108 | struct rcu_head barrier; | 110 | struct rcu_head barrier; |
109 | #ifdef CONFIG_SMP | ||
110 | long last_rs_qlen; /* qlen during the last resched */ | ||
111 | #endif | ||
112 | }; | 111 | }; |
113 | 112 | ||
114 | DECLARE_PER_CPU(struct rcu_data, rcu_data); | 113 | DECLARE_PER_CPU(struct rcu_data, rcu_data); |
diff --git a/include/linux/reiserfs_acl.h b/include/linux/reiserfs_acl.h index 806ec5b06707..fe00f781a622 100644 --- a/include/linux/reiserfs_acl.h +++ b/include/linux/reiserfs_acl.h | |||
@@ -56,6 +56,16 @@ extern int reiserfs_xattr_posix_acl_init(void) __init; | |||
56 | extern int reiserfs_xattr_posix_acl_exit(void); | 56 | extern int reiserfs_xattr_posix_acl_exit(void); |
57 | extern struct reiserfs_xattr_handler posix_acl_default_handler; | 57 | extern struct reiserfs_xattr_handler posix_acl_default_handler; |
58 | extern struct reiserfs_xattr_handler posix_acl_access_handler; | 58 | extern struct reiserfs_xattr_handler posix_acl_access_handler; |
59 | |||
60 | static inline void reiserfs_init_acl_access(struct inode *inode) | ||
61 | { | ||
62 | REISERFS_I(inode)->i_acl_access = NULL; | ||
63 | } | ||
64 | |||
65 | static inline void reiserfs_init_acl_default(struct inode *inode) | ||
66 | { | ||
67 | REISERFS_I(inode)->i_acl_default = NULL; | ||
68 | } | ||
59 | #else | 69 | #else |
60 | 70 | ||
61 | #define reiserfs_cache_default_acl(inode) 0 | 71 | #define reiserfs_cache_default_acl(inode) 0 |
@@ -87,4 +97,11 @@ reiserfs_inherit_default_acl(const struct inode *dir, struct dentry *dentry, | |||
87 | return 0; | 97 | return 0; |
88 | } | 98 | } |
89 | 99 | ||
100 | static inline void reiserfs_init_acl_access(struct inode *inode) | ||
101 | { | ||
102 | } | ||
103 | |||
104 | static inline void reiserfs_init_acl_default(struct inode *inode) | ||
105 | { | ||
106 | } | ||
90 | #endif | 107 | #endif |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index 28493ffaafe7..7bc6bfb86253 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -807,21 +807,19 @@ struct stat_data_v1 { | |||
807 | #define set_sd_v1_first_direct_byte(sdp,v) \ | 807 | #define set_sd_v1_first_direct_byte(sdp,v) \ |
808 | ((sdp)->sd_first_direct_byte = cpu_to_le32(v)) | 808 | ((sdp)->sd_first_direct_byte = cpu_to_le32(v)) |
809 | 809 | ||
810 | #include <linux/ext2_fs.h> | ||
811 | |||
812 | /* inode flags stored in sd_attrs (nee sd_reserved) */ | 810 | /* inode flags stored in sd_attrs (nee sd_reserved) */ |
813 | 811 | ||
814 | /* we want common flags to have the same values as in ext2, | 812 | /* we want common flags to have the same values as in ext2, |
815 | so chattr(1) will work without problems */ | 813 | so chattr(1) will work without problems */ |
816 | #define REISERFS_IMMUTABLE_FL EXT2_IMMUTABLE_FL | 814 | #define REISERFS_IMMUTABLE_FL FS_IMMUTABLE_FL |
817 | #define REISERFS_APPEND_FL EXT2_APPEND_FL | 815 | #define REISERFS_APPEND_FL FS_APPEND_FL |
818 | #define REISERFS_SYNC_FL EXT2_SYNC_FL | 816 | #define REISERFS_SYNC_FL FS_SYNC_FL |
819 | #define REISERFS_NOATIME_FL EXT2_NOATIME_FL | 817 | #define REISERFS_NOATIME_FL FS_NOATIME_FL |
820 | #define REISERFS_NODUMP_FL EXT2_NODUMP_FL | 818 | #define REISERFS_NODUMP_FL FS_NODUMP_FL |
821 | #define REISERFS_SECRM_FL EXT2_SECRM_FL | 819 | #define REISERFS_SECRM_FL FS_SECRM_FL |
822 | #define REISERFS_UNRM_FL EXT2_UNRM_FL | 820 | #define REISERFS_UNRM_FL FS_UNRM_FL |
823 | #define REISERFS_COMPR_FL EXT2_COMPR_FL | 821 | #define REISERFS_COMPR_FL FS_COMPR_FL |
824 | #define REISERFS_NOTAIL_FL EXT2_NOTAIL_FL | 822 | #define REISERFS_NOTAIL_FL FS_NOTAIL_FL |
825 | 823 | ||
826 | /* persistent flags that file inherits from the parent directory */ | 824 | /* persistent flags that file inherits from the parent directory */ |
827 | #define REISERFS_INHERIT_MASK ( REISERFS_IMMUTABLE_FL | \ | 825 | #define REISERFS_INHERIT_MASK ( REISERFS_IMMUTABLE_FL | \ |
@@ -2075,6 +2073,10 @@ void reiserfs_init_alloc_options(struct super_block *s); | |||
2075 | */ | 2073 | */ |
2076 | __le32 reiserfs_choose_packing(struct inode *dir); | 2074 | __le32 reiserfs_choose_packing(struct inode *dir); |
2077 | 2075 | ||
2076 | int reiserfs_init_bitmap_cache(struct super_block *sb); | ||
2077 | void reiserfs_free_bitmap_cache(struct super_block *sb); | ||
2078 | void reiserfs_cache_bitmap_metadata(struct super_block *sb, struct buffer_head *bh, struct reiserfs_bitmap_info *info); | ||
2079 | struct buffer_head *reiserfs_read_bitmap_block(struct super_block *sb, unsigned int bitmap); | ||
2078 | int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value); | 2080 | int is_reusable(struct super_block *s, b_blocknr_t block, int bit_value); |
2079 | void reiserfs_free_block(struct reiserfs_transaction_handle *th, struct inode *, | 2081 | void reiserfs_free_block(struct reiserfs_transaction_handle *th, struct inode *, |
2080 | b_blocknr_t, int for_unformatted); | 2082 | b_blocknr_t, int for_unformatted); |
@@ -2163,15 +2165,24 @@ __u32 r5_hash(const signed char *msg, int len); | |||
2163 | /* prototypes from ioctl.c */ | 2165 | /* prototypes from ioctl.c */ |
2164 | int reiserfs_ioctl(struct inode *inode, struct file *filp, | 2166 | int reiserfs_ioctl(struct inode *inode, struct file *filp, |
2165 | unsigned int cmd, unsigned long arg); | 2167 | unsigned int cmd, unsigned long arg); |
2168 | long reiserfs_compat_ioctl(struct file *filp, | ||
2169 | unsigned int cmd, unsigned long arg); | ||
2166 | 2170 | ||
2167 | /* ioctl's command */ | 2171 | /* ioctl's command */ |
2168 | #define REISERFS_IOC_UNPACK _IOW(0xCD,1,long) | 2172 | #define REISERFS_IOC_UNPACK _IOW(0xCD,1,long) |
2169 | /* define following flags to be the same as in ext2, so that chattr(1), | 2173 | /* define following flags to be the same as in ext2, so that chattr(1), |
2170 | lsattr(1) will work with us. */ | 2174 | lsattr(1) will work with us. */ |
2171 | #define REISERFS_IOC_GETFLAGS EXT2_IOC_GETFLAGS | 2175 | #define REISERFS_IOC_GETFLAGS FS_IOC_GETFLAGS |
2172 | #define REISERFS_IOC_SETFLAGS EXT2_IOC_SETFLAGS | 2176 | #define REISERFS_IOC_SETFLAGS FS_IOC_SETFLAGS |
2173 | #define REISERFS_IOC_GETVERSION EXT2_IOC_GETVERSION | 2177 | #define REISERFS_IOC_GETVERSION FS_IOC_GETVERSION |
2174 | #define REISERFS_IOC_SETVERSION EXT2_IOC_SETVERSION | 2178 | #define REISERFS_IOC_SETVERSION FS_IOC_SETVERSION |
2179 | |||
2180 | /* the 32 bit compat definitions with int argument */ | ||
2181 | #define REISERFS_IOC32_UNPACK _IOW(0xCD, 1, int) | ||
2182 | #define REISERFS_IOC32_GETFLAGS FS_IOC32_GETFLAGS | ||
2183 | #define REISERFS_IOC32_SETFLAGS FS_IOC32_SETFLAGS | ||
2184 | #define REISERFS_IOC32_GETVERSION FS_IOC32_GETVERSION | ||
2185 | #define REISERFS_IOC32_SETVERSION FS_IOC32_SETVERSION | ||
2175 | 2186 | ||
2176 | /* Locking primitives */ | 2187 | /* Locking primitives */ |
2177 | /* Right now we are still falling back to (un)lock_kernel, but eventually that | 2188 | /* Right now we are still falling back to (un)lock_kernel, but eventually that |
diff --git a/include/linux/reiserfs_fs_i.h b/include/linux/reiserfs_fs_i.h index 149be8d9a0c9..5b3b297aa2c5 100644 --- a/include/linux/reiserfs_fs_i.h +++ b/include/linux/reiserfs_fs_i.h | |||
@@ -52,10 +52,13 @@ struct reiserfs_inode_info { | |||
52 | ** flushed */ | 52 | ** flushed */ |
53 | unsigned long i_trans_id; | 53 | unsigned long i_trans_id; |
54 | struct reiserfs_journal_list *i_jl; | 54 | struct reiserfs_journal_list *i_jl; |
55 | 55 | #ifdef CONFIG_REISERFS_FS_POSIX_ACL | |
56 | struct posix_acl *i_acl_access; | 56 | struct posix_acl *i_acl_access; |
57 | struct posix_acl *i_acl_default; | 57 | struct posix_acl *i_acl_default; |
58 | #endif | ||
59 | #ifdef CONFIG_REISERFS_FS_XATTR | ||
58 | struct rw_semaphore xattr_sem; | 60 | struct rw_semaphore xattr_sem; |
61 | #endif | ||
59 | struct inode vfs_inode; | 62 | struct inode vfs_inode; |
60 | }; | 63 | }; |
61 | 64 | ||
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h index 31b4c0bd4fa0..73e0becec086 100644 --- a/include/linux/reiserfs_fs_sb.h +++ b/include/linux/reiserfs_fs_sb.h | |||
@@ -267,7 +267,6 @@ struct reiserfs_bitmap_info { | |||
267 | // FIXME: Won't work with block sizes > 8K | 267 | // FIXME: Won't work with block sizes > 8K |
268 | __u16 first_zero_hint; | 268 | __u16 first_zero_hint; |
269 | __u16 free_count; | 269 | __u16 free_count; |
270 | struct buffer_head *bh; /* the actual bitmap */ | ||
271 | }; | 270 | }; |
272 | 271 | ||
273 | struct proc_dir_entry; | 272 | struct proc_dir_entry; |
@@ -414,6 +413,7 @@ struct reiserfs_sb_info { | |||
414 | /* Definitions of reiserfs on-disk properties: */ | 413 | /* Definitions of reiserfs on-disk properties: */ |
415 | #define REISERFS_3_5 0 | 414 | #define REISERFS_3_5 0 |
416 | #define REISERFS_3_6 1 | 415 | #define REISERFS_3_6 1 |
416 | #define REISERFS_OLD_FORMAT 2 | ||
417 | 417 | ||
418 | enum reiserfs_mount_options { | 418 | enum reiserfs_mount_options { |
419 | /* Mount options */ | 419 | /* Mount options */ |
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h index 5e961035c725..966c35851b2e 100644 --- a/include/linux/reiserfs_xattr.h +++ b/include/linux/reiserfs_xattr.h | |||
@@ -97,6 +97,11 @@ static inline void reiserfs_mark_inode_private(struct inode *inode) | |||
97 | inode->i_flags |= S_PRIVATE; | 97 | inode->i_flags |= S_PRIVATE; |
98 | } | 98 | } |
99 | 99 | ||
100 | static inline void reiserfs_init_xattr_rwsem(struct inode *inode) | ||
101 | { | ||
102 | init_rwsem(&REISERFS_I(inode)->xattr_sem); | ||
103 | } | ||
104 | |||
100 | #else | 105 | #else |
101 | 106 | ||
102 | #define is_reiserfs_priv_object(inode) 0 | 107 | #define is_reiserfs_priv_object(inode) 0 |
@@ -129,6 +134,9 @@ static inline int reiserfs_xattr_init(struct super_block *sb, int mount_flags) | |||
129 | sb->s_flags = (sb->s_flags & ~MS_POSIXACL); /* to be sure */ | 134 | sb->s_flags = (sb->s_flags & ~MS_POSIXACL); /* to be sure */ |
130 | return 0; | 135 | return 0; |
131 | }; | 136 | }; |
137 | static inline void reiserfs_init_xattr_rwsem(struct inode *inode) | ||
138 | { | ||
139 | } | ||
132 | #endif | 140 | #endif |
133 | 141 | ||
134 | #endif /* __KERNEL__ */ | 142 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/rtc.h b/include/linux/rtc.h index 5371e4e74595..b89f09357054 100644 --- a/include/linux/rtc.h +++ b/include/linux/rtc.h | |||
@@ -141,7 +141,7 @@ struct rtc_device | |||
141 | int id; | 141 | int id; |
142 | char name[RTC_DEVICE_NAME_SIZE]; | 142 | char name[RTC_DEVICE_NAME_SIZE]; |
143 | 143 | ||
144 | struct rtc_class_ops *ops; | 144 | const struct rtc_class_ops *ops; |
145 | struct mutex ops_lock; | 145 | struct mutex ops_lock; |
146 | 146 | ||
147 | struct class_device *rtc_dev; | 147 | struct class_device *rtc_dev; |
@@ -172,7 +172,7 @@ struct rtc_device | |||
172 | 172 | ||
173 | extern struct rtc_device *rtc_device_register(const char *name, | 173 | extern struct rtc_device *rtc_device_register(const char *name, |
174 | struct device *dev, | 174 | struct device *dev, |
175 | struct rtc_class_ops *ops, | 175 | const struct rtc_class_ops *ops, |
176 | struct module *owner); | 176 | struct module *owner); |
177 | extern void rtc_device_unregister(struct rtc_device *rdev); | 177 | extern void rtc_device_unregister(struct rtc_device *rdev); |
178 | extern int rtc_interface_register(struct class_interface *intf); | 178 | extern int rtc_interface_register(struct class_interface *intf); |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 9c92dc8b9a08..3a18addaed4c 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -2,7 +2,7 @@ | |||
2 | #define __LINUX_RTNETLINK_H | 2 | #define __LINUX_RTNETLINK_H |
3 | 3 | ||
4 | #include <linux/netlink.h> | 4 | #include <linux/netlink.h> |
5 | #include <linux/if.h> | 5 | #include <linux/if_link.h> |
6 | 6 | ||
7 | /**** | 7 | /**** |
8 | * Routing/neighbour discovery messages. | 8 | * Routing/neighbour discovery messages. |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 34ed0d99b1bd..331f4502e92b 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -24,6 +24,8 @@ | |||
24 | #define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */ | 24 | #define CLONE_UNTRACED 0x00800000 /* set if the tracing process can't force CLONE_PTRACE on this clone */ |
25 | #define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */ | 25 | #define CLONE_CHILD_SETTID 0x01000000 /* set the TID in the child */ |
26 | #define CLONE_STOPPED 0x02000000 /* Start in stopped state */ | 26 | #define CLONE_STOPPED 0x02000000 /* Start in stopped state */ |
27 | #define CLONE_NEWUTS 0x04000000 /* New utsname group? */ | ||
28 | #define CLONE_NEWIPC 0x08000000 /* New ipcs */ | ||
27 | 29 | ||
28 | /* | 30 | /* |
29 | * Scheduling policies | 31 | * Scheduling policies |
@@ -118,7 +120,6 @@ extern unsigned long avenrun[]; /* Load averages */ | |||
118 | 120 | ||
119 | extern unsigned long total_forks; | 121 | extern unsigned long total_forks; |
120 | extern int nr_threads; | 122 | extern int nr_threads; |
121 | extern int last_pid; | ||
122 | DECLARE_PER_CPU(unsigned long, process_counts); | 123 | DECLARE_PER_CPU(unsigned long, process_counts); |
123 | extern int nr_processes(void); | 124 | extern int nr_processes(void); |
124 | extern unsigned long nr_running(void); | 125 | extern unsigned long nr_running(void); |
@@ -148,6 +149,7 @@ extern unsigned long weighted_cpuload(const int cpu); | |||
148 | #define EXIT_DEAD 32 | 149 | #define EXIT_DEAD 32 |
149 | /* in tsk->state again */ | 150 | /* in tsk->state again */ |
150 | #define TASK_NONINTERACTIVE 64 | 151 | #define TASK_NONINTERACTIVE 64 |
152 | #define TASK_DEAD 128 | ||
151 | 153 | ||
152 | #define __set_task_state(tsk, state_value) \ | 154 | #define __set_task_state(tsk, state_value) \ |
153 | do { (tsk)->state = (state_value); } while (0) | 155 | do { (tsk)->state = (state_value); } while (0) |
@@ -238,7 +240,7 @@ extern signed long schedule_timeout_interruptible(signed long timeout); | |||
238 | extern signed long schedule_timeout_uninterruptible(signed long timeout); | 240 | extern signed long schedule_timeout_uninterruptible(signed long timeout); |
239 | asmlinkage void schedule(void); | 241 | asmlinkage void schedule(void); |
240 | 242 | ||
241 | struct namespace; | 243 | struct nsproxy; |
242 | 244 | ||
243 | /* Maximum number of active map areas.. This is a random (large) number */ | 245 | /* Maximum number of active map areas.. This is a random (large) number */ |
244 | #define DEFAULT_MAX_MAP_COUNT 65536 | 246 | #define DEFAULT_MAX_MAP_COUNT 65536 |
@@ -504,8 +506,8 @@ struct signal_struct { | |||
504 | #define rt_prio(prio) unlikely((prio) < MAX_RT_PRIO) | 506 | #define rt_prio(prio) unlikely((prio) < MAX_RT_PRIO) |
505 | #define rt_task(p) rt_prio((p)->prio) | 507 | #define rt_task(p) rt_prio((p)->prio) |
506 | #define batch_task(p) (unlikely((p)->policy == SCHED_BATCH)) | 508 | #define batch_task(p) (unlikely((p)->policy == SCHED_BATCH)) |
507 | #define has_rt_policy(p) \ | 509 | #define is_rt_policy(p) ((p) != SCHED_NORMAL && (p) != SCHED_BATCH) |
508 | unlikely((p)->policy != SCHED_NORMAL && (p)->policy != SCHED_BATCH) | 510 | #define has_rt_policy(p) unlikely(is_rt_policy((p)->policy)) |
509 | 511 | ||
510 | /* | 512 | /* |
511 | * Some day this will be a full-fledged user tracking system.. | 513 | * Some day this will be a full-fledged user tracking system.. |
@@ -623,9 +625,17 @@ enum idle_type | |||
623 | #define SD_WAKE_BALANCE 64 /* Perform balancing at task wakeup */ | 625 | #define SD_WAKE_BALANCE 64 /* Perform balancing at task wakeup */ |
624 | #define SD_SHARE_CPUPOWER 128 /* Domain members share cpu power */ | 626 | #define SD_SHARE_CPUPOWER 128 /* Domain members share cpu power */ |
625 | #define SD_POWERSAVINGS_BALANCE 256 /* Balance for power savings */ | 627 | #define SD_POWERSAVINGS_BALANCE 256 /* Balance for power savings */ |
628 | #define SD_SHARE_PKG_RESOURCES 512 /* Domain members share cpu pkg resources */ | ||
626 | 629 | ||
627 | #define BALANCE_FOR_POWER ((sched_mc_power_savings || sched_smt_power_savings) \ | 630 | #define BALANCE_FOR_MC_POWER \ |
628 | ? SD_POWERSAVINGS_BALANCE : 0) | 631 | (sched_smt_power_savings ? SD_POWERSAVINGS_BALANCE : 0) |
632 | |||
633 | #define BALANCE_FOR_PKG_POWER \ | ||
634 | ((sched_mc_power_savings || sched_smt_power_savings) ? \ | ||
635 | SD_POWERSAVINGS_BALANCE : 0) | ||
636 | |||
637 | #define test_sd_parent(sd, flag) ((sd->parent && \ | ||
638 | (sd->parent->flags & flag)) ? 1 : 0) | ||
629 | 639 | ||
630 | 640 | ||
631 | struct sched_group { | 641 | struct sched_group { |
@@ -642,6 +652,7 @@ struct sched_group { | |||
642 | struct sched_domain { | 652 | struct sched_domain { |
643 | /* These fields must be setup */ | 653 | /* These fields must be setup */ |
644 | struct sched_domain *parent; /* top domain must be null terminated */ | 654 | struct sched_domain *parent; /* top domain must be null terminated */ |
655 | struct sched_domain *child; /* bottom domain must be null terminated */ | ||
645 | struct sched_group *groups; /* the balancing groups of the domain */ | 656 | struct sched_group *groups; /* the balancing groups of the domain */ |
646 | cpumask_t span; /* span of all CPUs in this domain */ | 657 | cpumask_t span; /* span of all CPUs in this domain */ |
647 | unsigned long min_interval; /* Minimum balance interval ms */ | 658 | unsigned long min_interval; /* Minimum balance interval ms */ |
@@ -709,7 +720,6 @@ extern unsigned int max_cache_size; | |||
709 | 720 | ||
710 | 721 | ||
711 | struct io_context; /* See blkdev.h */ | 722 | struct io_context; /* See blkdev.h */ |
712 | void exit_io_context(void); | ||
713 | struct cpuset; | 723 | struct cpuset; |
714 | 724 | ||
715 | #define NGROUPS_SMALL 32 | 725 | #define NGROUPS_SMALL 32 |
@@ -754,6 +764,7 @@ static inline void prefetch_stack(struct task_struct *t) { } | |||
754 | struct audit_context; /* See audit.c */ | 764 | struct audit_context; /* See audit.c */ |
755 | struct mempolicy; | 765 | struct mempolicy; |
756 | struct pipe_inode_info; | 766 | struct pipe_inode_info; |
767 | struct uts_namespace; | ||
757 | 768 | ||
758 | enum sleep_type { | 769 | enum sleep_type { |
759 | SLEEP_NORMAL, | 770 | SLEEP_NORMAL, |
@@ -784,8 +795,9 @@ struct task_struct { | |||
784 | struct prio_array *array; | 795 | struct prio_array *array; |
785 | 796 | ||
786 | unsigned short ioprio; | 797 | unsigned short ioprio; |
798 | #ifdef CONFIG_BLK_DEV_IO_TRACE | ||
787 | unsigned int btrace_seq; | 799 | unsigned int btrace_seq; |
788 | 800 | #endif | |
789 | unsigned long sleep_avg; | 801 | unsigned long sleep_avg; |
790 | unsigned long long timestamp, last_ran; | 802 | unsigned long long timestamp, last_ran; |
791 | unsigned long long sched_time; /* sched_clock time spent running */ | 803 | unsigned long long sched_time; /* sched_clock time spent running */ |
@@ -819,6 +831,11 @@ struct task_struct { | |||
819 | unsigned did_exec:1; | 831 | unsigned did_exec:1; |
820 | pid_t pid; | 832 | pid_t pid; |
821 | pid_t tgid; | 833 | pid_t tgid; |
834 | |||
835 | #ifdef CONFIG_CC_STACKPROTECTOR | ||
836 | /* Canary value for the -fstack-protector gcc feature */ | ||
837 | unsigned long stack_canary; | ||
838 | #endif | ||
822 | /* | 839 | /* |
823 | * pointers to (original) parent process, youngest child, younger sibling, | 840 | * pointers to (original) parent process, youngest child, younger sibling, |
824 | * older sibling, respectively. (p->father can be replaced with | 841 | * older sibling, respectively. (p->father can be replaced with |
@@ -865,6 +882,15 @@ struct task_struct { | |||
865 | struct key *thread_keyring; /* keyring private to this thread */ | 882 | struct key *thread_keyring; /* keyring private to this thread */ |
866 | unsigned char jit_keyring; /* default keyring to attach requested keys to */ | 883 | unsigned char jit_keyring; /* default keyring to attach requested keys to */ |
867 | #endif | 884 | #endif |
885 | /* | ||
886 | * fpu_counter contains the number of consecutive context switches | ||
887 | * that the FPU is used. If this is over a threshold, the lazy fpu | ||
888 | * saving becomes unlazy to save the trap. This is an unsigned char | ||
889 | * so that after 256 times the counter wraps and the behavior turns | ||
890 | * lazy again; this to deal with bursty apps that only use FPU for | ||
891 | * a short time | ||
892 | */ | ||
893 | unsigned char fpu_counter; | ||
868 | int oomkilladj; /* OOM kill score adjustment (bit shift). */ | 894 | int oomkilladj; /* OOM kill score adjustment (bit shift). */ |
869 | char comm[TASK_COMM_LEN]; /* executable name excluding path | 895 | char comm[TASK_COMM_LEN]; /* executable name excluding path |
870 | - access with [gs]et_task_comm (which lock | 896 | - access with [gs]et_task_comm (which lock |
@@ -872,16 +898,18 @@ struct task_struct { | |||
872 | - initialized normally by flush_old_exec */ | 898 | - initialized normally by flush_old_exec */ |
873 | /* file system info */ | 899 | /* file system info */ |
874 | int link_count, total_link_count; | 900 | int link_count, total_link_count; |
901 | #ifdef CONFIG_SYSVIPC | ||
875 | /* ipc stuff */ | 902 | /* ipc stuff */ |
876 | struct sysv_sem sysvsem; | 903 | struct sysv_sem sysvsem; |
904 | #endif | ||
877 | /* CPU-specific state of this task */ | 905 | /* CPU-specific state of this task */ |
878 | struct thread_struct thread; | 906 | struct thread_struct thread; |
879 | /* filesystem information */ | 907 | /* filesystem information */ |
880 | struct fs_struct *fs; | 908 | struct fs_struct *fs; |
881 | /* open file information */ | 909 | /* open file information */ |
882 | struct files_struct *files; | 910 | struct files_struct *files; |
883 | /* namespace */ | 911 | /* namespaces */ |
884 | struct namespace *namespace; | 912 | struct nsproxy *nsproxy; |
885 | /* signal handlers */ | 913 | /* signal handlers */ |
886 | struct signal_struct *signal; | 914 | struct signal_struct *signal; |
887 | struct sighand_struct *sighand; | 915 | struct sighand_struct *sighand; |
@@ -964,10 +992,10 @@ struct task_struct { | |||
964 | wait_queue_t *io_wait; | 992 | wait_queue_t *io_wait; |
965 | /* i/o counters(bytes read/written, #syscalls */ | 993 | /* i/o counters(bytes read/written, #syscalls */ |
966 | u64 rchar, wchar, syscr, syscw; | 994 | u64 rchar, wchar, syscr, syscw; |
967 | #if defined(CONFIG_BSD_PROCESS_ACCT) | 995 | #if defined(CONFIG_TASK_XACCT) |
968 | u64 acct_rss_mem1; /* accumulated rss usage */ | 996 | u64 acct_rss_mem1; /* accumulated rss usage */ |
969 | u64 acct_vm_mem1; /* accumulated virtual memory usage */ | 997 | u64 acct_vm_mem1; /* accumulated virtual memory usage */ |
970 | clock_t acct_stimexpd; /* clock_t-converted stime since last update */ | 998 | cputime_t acct_stimexpd;/* stime since last update */ |
971 | #endif | 999 | #endif |
972 | #ifdef CONFIG_NUMA | 1000 | #ifdef CONFIG_NUMA |
973 | struct mempolicy *mempolicy; | 1001 | struct mempolicy *mempolicy; |
@@ -1003,6 +1031,26 @@ static inline pid_t process_group(struct task_struct *tsk) | |||
1003 | return tsk->signal->pgrp; | 1031 | return tsk->signal->pgrp; |
1004 | } | 1032 | } |
1005 | 1033 | ||
1034 | static inline struct pid *task_pid(struct task_struct *task) | ||
1035 | { | ||
1036 | return task->pids[PIDTYPE_PID].pid; | ||
1037 | } | ||
1038 | |||
1039 | static inline struct pid *task_tgid(struct task_struct *task) | ||
1040 | { | ||
1041 | return task->group_leader->pids[PIDTYPE_PID].pid; | ||
1042 | } | ||
1043 | |||
1044 | static inline struct pid *task_pgrp(struct task_struct *task) | ||
1045 | { | ||
1046 | return task->group_leader->pids[PIDTYPE_PGID].pid; | ||
1047 | } | ||
1048 | |||
1049 | static inline struct pid *task_session(struct task_struct *task) | ||
1050 | { | ||
1051 | return task->group_leader->pids[PIDTYPE_SID].pid; | ||
1052 | } | ||
1053 | |||
1006 | /** | 1054 | /** |
1007 | * pid_alive - check that a task structure is not stale | 1055 | * pid_alive - check that a task structure is not stale |
1008 | * @p: Task structure to be checked. | 1056 | * @p: Task structure to be checked. |
@@ -1016,6 +1064,18 @@ static inline int pid_alive(struct task_struct *p) | |||
1016 | return p->pids[PIDTYPE_PID].pid != NULL; | 1064 | return p->pids[PIDTYPE_PID].pid != NULL; |
1017 | } | 1065 | } |
1018 | 1066 | ||
1067 | /** | ||
1068 | * is_init - check if a task structure is the first user space | ||
1069 | * task the kernel created. | ||
1070 | * @p: Task structure to be checked. | ||
1071 | */ | ||
1072 | static inline int is_init(struct task_struct *tsk) | ||
1073 | { | ||
1074 | return tsk->pid == 1; | ||
1075 | } | ||
1076 | |||
1077 | extern struct pid *cad_pid; | ||
1078 | |||
1019 | extern void free_task(struct task_struct *tsk); | 1079 | extern void free_task(struct task_struct *tsk); |
1020 | #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) | 1080 | #define get_task_struct(tsk) do { atomic_inc(&(tsk)->usage); } while(0) |
1021 | 1081 | ||
@@ -1034,7 +1094,6 @@ static inline void put_task_struct(struct task_struct *t) | |||
1034 | /* Not implemented yet, only for 486*/ | 1094 | /* Not implemented yet, only for 486*/ |
1035 | #define PF_STARTING 0x00000002 /* being created */ | 1095 | #define PF_STARTING 0x00000002 /* being created */ |
1036 | #define PF_EXITING 0x00000004 /* getting shut down */ | 1096 | #define PF_EXITING 0x00000004 /* getting shut down */ |
1037 | #define PF_DEAD 0x00000008 /* Dead */ | ||
1038 | #define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ | 1097 | #define PF_FORKNOEXEC 0x00000040 /* forked but didn't exec */ |
1039 | #define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ | 1098 | #define PF_SUPERPRIV 0x00000100 /* used super-user privileges */ |
1040 | #define PF_DUMPCORE 0x00000200 /* dumped core */ | 1099 | #define PF_DUMPCORE 0x00000200 /* dumped core */ |
@@ -1179,7 +1238,7 @@ extern void switch_uid(struct user_struct *); | |||
1179 | 1238 | ||
1180 | #include <asm/current.h> | 1239 | #include <asm/current.h> |
1181 | 1240 | ||
1182 | extern void do_timer(struct pt_regs *); | 1241 | extern void do_timer(unsigned long ticks); |
1183 | 1242 | ||
1184 | extern int FASTCALL(wake_up_state(struct task_struct * tsk, unsigned int state)); | 1243 | extern int FASTCALL(wake_up_state(struct task_struct * tsk, unsigned int state)); |
1185 | extern int FASTCALL(wake_up_process(struct task_struct * tsk)); | 1244 | extern int FASTCALL(wake_up_process(struct task_struct * tsk)); |
@@ -1221,10 +1280,15 @@ extern int send_sig_info(int, struct siginfo *, struct task_struct *); | |||
1221 | extern int send_group_sig_info(int, struct siginfo *, struct task_struct *); | 1280 | extern int send_group_sig_info(int, struct siginfo *, struct task_struct *); |
1222 | extern int force_sigsegv(int, struct task_struct *); | 1281 | extern int force_sigsegv(int, struct task_struct *); |
1223 | extern int force_sig_info(int, struct siginfo *, struct task_struct *); | 1282 | extern int force_sig_info(int, struct siginfo *, struct task_struct *); |
1283 | extern int __kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp); | ||
1284 | extern int kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp); | ||
1285 | extern int kill_pid_info(int sig, struct siginfo *info, struct pid *pid); | ||
1286 | extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_t, u32); | ||
1287 | extern int kill_pgrp(struct pid *pid, int sig, int priv); | ||
1288 | extern int kill_pid(struct pid *pid, int sig, int priv); | ||
1224 | extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); | 1289 | extern int __kill_pg_info(int sig, struct siginfo *info, pid_t pgrp); |
1225 | extern int kill_pg_info(int, struct siginfo *, pid_t); | 1290 | extern int kill_pg_info(int, struct siginfo *, pid_t); |
1226 | extern int kill_proc_info(int, struct siginfo *, pid_t); | 1291 | extern int kill_proc_info(int, struct siginfo *, pid_t); |
1227 | extern int kill_proc_info_as_uid(int, struct siginfo *, pid_t, uid_t, uid_t, u32); | ||
1228 | extern void do_notify_parent(struct task_struct *, int); | 1292 | extern void do_notify_parent(struct task_struct *, int); |
1229 | extern void force_sig(int, struct task_struct *); | 1293 | extern void force_sig(int, struct task_struct *); |
1230 | extern void force_sig_specific(int, struct task_struct *); | 1294 | extern void force_sig_specific(int, struct task_struct *); |
@@ -1239,6 +1303,11 @@ extern int send_group_sigqueue(int, struct sigqueue *, struct task_struct *); | |||
1239 | extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *); | 1303 | extern int do_sigaction(int, struct k_sigaction *, struct k_sigaction *); |
1240 | extern int do_sigaltstack(const stack_t __user *, stack_t __user *, unsigned long); | 1304 | extern int do_sigaltstack(const stack_t __user *, stack_t __user *, unsigned long); |
1241 | 1305 | ||
1306 | static inline int kill_cad_pid(int sig, int priv) | ||
1307 | { | ||
1308 | return kill_pid(cad_pid, sig, priv); | ||
1309 | } | ||
1310 | |||
1242 | /* These can be the second arg to send_sig_info/send_group_sig_info. */ | 1311 | /* These can be the second arg to send_sig_info/send_group_sig_info. */ |
1243 | #define SEND_SIG_NOINFO ((struct siginfo *) 0) | 1312 | #define SEND_SIG_NOINFO ((struct siginfo *) 0) |
1244 | #define SEND_SIG_PRIV ((struct siginfo *) 1) | 1313 | #define SEND_SIG_PRIV ((struct siginfo *) 1) |
@@ -1332,6 +1401,17 @@ extern void wait_task_inactive(struct task_struct * p); | |||
1332 | /* de_thread depends on thread_group_leader not being a pid based check */ | 1401 | /* de_thread depends on thread_group_leader not being a pid based check */ |
1333 | #define thread_group_leader(p) (p == p->group_leader) | 1402 | #define thread_group_leader(p) (p == p->group_leader) |
1334 | 1403 | ||
1404 | /* Do to the insanities of de_thread it is possible for a process | ||
1405 | * to have the pid of the thread group leader without actually being | ||
1406 | * the thread group leader. For iteration through the pids in proc | ||
1407 | * all we care about is that we have a task with the appropriate | ||
1408 | * pid, we don't actually care if we have the right task. | ||
1409 | */ | ||
1410 | static inline int has_group_leader_pid(struct task_struct *p) | ||
1411 | { | ||
1412 | return p->pid == p->tgid; | ||
1413 | } | ||
1414 | |||
1335 | static inline struct task_struct *next_thread(const struct task_struct *p) | 1415 | static inline struct task_struct *next_thread(const struct task_struct *p) |
1336 | { | 1416 | { |
1337 | return list_entry(rcu_dereference(p->thread_group.next), | 1417 | return list_entry(rcu_dereference(p->thread_group.next), |
diff --git a/include/linux/scx200.h b/include/linux/scx200.h index 693c0557e70b..de466e11e271 100644 --- a/include/linux/scx200.h +++ b/include/linux/scx200.h | |||
@@ -32,7 +32,7 @@ extern unsigned scx200_cb_base; | |||
32 | 32 | ||
33 | /* High Resolution Timer */ | 33 | /* High Resolution Timer */ |
34 | #define SCx200_TIMER_OFFSET 0x08 | 34 | #define SCx200_TIMER_OFFSET 0x08 |
35 | #define SCx200_TIMER_SIZE 0x05 | 35 | #define SCx200_TIMER_SIZE 0x06 |
36 | 36 | ||
37 | /* Clock Generators */ | 37 | /* Clock Generators */ |
38 | #define SCx200_CLOCKGEN_OFFSET 0x10 | 38 | #define SCx200_CLOCKGEN_OFFSET 0x10 |
diff --git a/include/linux/scx200_gpio.h b/include/linux/scx200_gpio.h index 90dd069cc145..1a82d30c4b17 100644 --- a/include/linux/scx200_gpio.h +++ b/include/linux/scx200_gpio.h | |||
@@ -4,6 +4,7 @@ u32 scx200_gpio_configure(unsigned index, u32 set, u32 clear); | |||
4 | 4 | ||
5 | extern unsigned scx200_gpio_base; | 5 | extern unsigned scx200_gpio_base; |
6 | extern long scx200_gpio_shadow[2]; | 6 | extern long scx200_gpio_shadow[2]; |
7 | extern struct nsc_gpio_ops scx200_gpio_ops; | ||
7 | 8 | ||
8 | #define scx200_gpio_present() (scx200_gpio_base!=0) | 9 | #define scx200_gpio_present() (scx200_gpio_base!=0) |
9 | 10 | ||
diff --git a/include/linux/security.h b/include/linux/security.h index 9f56fb8a4a6c..9b5fea81f55e 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -1595,6 +1595,7 @@ static inline void security_sb_post_pivotroot (struct nameidata *old_nd, | |||
1595 | 1595 | ||
1596 | static inline int security_inode_alloc (struct inode *inode) | 1596 | static inline int security_inode_alloc (struct inode *inode) |
1597 | { | 1597 | { |
1598 | inode->i_security = NULL; | ||
1598 | return security_ops->inode_alloc_security (inode); | 1599 | return security_ops->inode_alloc_security (inode); |
1599 | } | 1600 | } |
1600 | 1601 | ||
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index 86501a3de2ac..b661c19f3f72 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -67,8 +67,8 @@ | |||
67 | /* Parisc type numbers. */ | 67 | /* Parisc type numbers. */ |
68 | #define PORT_MUX 48 | 68 | #define PORT_MUX 48 |
69 | 69 | ||
70 | /* Atmel AT91xxx SoC */ | 70 | /* Atmel AT91 / AT32 SoC */ |
71 | #define PORT_AT91 49 | 71 | #define PORT_ATMEL 49 |
72 | 72 | ||
73 | /* Macintosh Zilog type numbers */ | 73 | /* Macintosh Zilog type numbers */ |
74 | #define PORT_MAC_ZILOG 50 /* m68k : not yet implemented */ | 74 | #define PORT_MAC_ZILOG 50 /* m68k : not yet implemented */ |
@@ -319,6 +319,7 @@ struct uart_info { | |||
319 | #define UIF_CTS_FLOW ((__force uif_t) (1 << 26)) | 319 | #define UIF_CTS_FLOW ((__force uif_t) (1 << 26)) |
320 | #define UIF_NORMAL_ACTIVE ((__force uif_t) (1 << 29)) | 320 | #define UIF_NORMAL_ACTIVE ((__force uif_t) (1 << 29)) |
321 | #define UIF_INITIALIZED ((__force uif_t) (1 << 31)) | 321 | #define UIF_INITIALIZED ((__force uif_t) (1 << 31)) |
322 | #define UIF_SUSPENDED ((__force uif_t) (1 << 30)) | ||
322 | 323 | ||
323 | int blocked_open; | 324 | int blocked_open; |
324 | 325 | ||
@@ -414,7 +415,7 @@ uart_handle_sysrq_char(struct uart_port *port, unsigned int ch, | |||
414 | #ifdef SUPPORT_SYSRQ | 415 | #ifdef SUPPORT_SYSRQ |
415 | if (port->sysrq) { | 416 | if (port->sysrq) { |
416 | if (ch && time_before(jiffies, port->sysrq)) { | 417 | if (ch && time_before(jiffies, port->sysrq)) { |
417 | handle_sysrq(ch, regs, NULL); | 418 | handle_sysrq(ch, regs, port->info->tty); |
418 | port->sysrq = 0; | 419 | port->sysrq = 0; |
419 | return 1; | 420 | return 1; |
420 | } | 421 | } |
diff --git a/include/linux/serio.h b/include/linux/serio.h index 6348e8330897..c9069310b6ac 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h | |||
@@ -217,5 +217,8 @@ static inline void serio_unpin_driver(struct serio *serio) | |||
217 | #define SERIO_LKKBD 0x28 | 217 | #define SERIO_LKKBD 0x28 |
218 | #define SERIO_ELO 0x29 | 218 | #define SERIO_ELO 0x29 |
219 | #define SERIO_MICROTOUCH 0x30 | 219 | #define SERIO_MICROTOUCH 0x30 |
220 | #define SERIO_PENMOUNT 0x31 | ||
221 | #define SERIO_TOUCHRIGHT 0x32 | ||
222 | #define SERIO_TOUCHWIN 0x33 | ||
220 | 223 | ||
221 | #endif | 224 | #endif |
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h index c057f0b32318..f3c51899117f 100644 --- a/include/linux/shmem_fs.h +++ b/include/linux/shmem_fs.h | |||
@@ -19,6 +19,10 @@ 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 | ||
22 | }; | 26 | }; |
23 | 27 | ||
24 | struct shmem_sb_info { | 28 | struct shmem_sb_info { |
@@ -36,4 +40,24 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode) | |||
36 | return container_of(inode, struct shmem_inode_info, vfs_inode); | 40 | return container_of(inode, struct shmem_inode_info, vfs_inode); |
37 | } | 41 | } |
38 | 42 | ||
43 | #ifdef CONFIG_TMPFS_POSIX_ACL | ||
44 | int shmem_permission(struct inode *, int, struct nameidata *); | ||
45 | int shmem_acl_init(struct inode *, struct inode *); | ||
46 | void shmem_acl_destroy_inode(struct inode *); | ||
47 | |||
48 | extern struct xattr_handler shmem_xattr_acl_access_handler; | ||
49 | extern struct xattr_handler shmem_xattr_acl_default_handler; | ||
50 | |||
51 | extern struct generic_acl_operations shmem_acl_ops; | ||
52 | |||
53 | #else | ||
54 | static inline int shmem_acl_init(struct inode *inode, struct inode *dir) | ||
55 | { | ||
56 | return 0; | ||
57 | } | ||
58 | static inline void shmem_acl_destroy_inode(struct inode *inode) | ||
59 | { | ||
60 | } | ||
61 | #endif /* CONFIG_TMPFS_POSIX_ACL */ | ||
62 | |||
39 | #endif | 63 | #endif |
diff --git a/include/linux/slab.h b/include/linux/slab.h index 66d6eb78d1c6..c4947b8a2c03 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/mm/slab.h | 2 | * linux/include/linux/slab.h |
3 | * Written by Mark Hemment, 1996. | 3 | * Written by Mark Hemment, 1996. |
4 | * (markhe@nextd.demon.co.uk) | 4 | * (markhe@nextd.demon.co.uk) |
5 | */ | 5 | */ |
@@ -60,7 +60,7 @@ extern void __init kmem_cache_init(void); | |||
60 | extern kmem_cache_t *kmem_cache_create(const char *, size_t, size_t, unsigned long, | 60 | extern kmem_cache_t *kmem_cache_create(const char *, size_t, size_t, unsigned long, |
61 | void (*)(void *, kmem_cache_t *, unsigned long), | 61 | void (*)(void *, kmem_cache_t *, unsigned long), |
62 | void (*)(void *, kmem_cache_t *, unsigned long)); | 62 | void (*)(void *, kmem_cache_t *, unsigned long)); |
63 | extern int kmem_cache_destroy(kmem_cache_t *); | 63 | extern void kmem_cache_destroy(kmem_cache_t *); |
64 | extern int kmem_cache_shrink(kmem_cache_t *); | 64 | extern int kmem_cache_shrink(kmem_cache_t *); |
65 | extern void *kmem_cache_alloc(kmem_cache_t *, gfp_t); | 65 | extern void *kmem_cache_alloc(kmem_cache_t *, gfp_t); |
66 | extern void *kmem_cache_zalloc(struct kmem_cache *, gfp_t); | 66 | extern void *kmem_cache_zalloc(struct kmem_cache *, gfp_t); |
@@ -77,13 +77,6 @@ struct cache_sizes { | |||
77 | extern struct cache_sizes malloc_sizes[]; | 77 | extern struct cache_sizes malloc_sizes[]; |
78 | 78 | ||
79 | extern void *__kmalloc(size_t, gfp_t); | 79 | extern void *__kmalloc(size_t, gfp_t); |
80 | #ifndef CONFIG_DEBUG_SLAB | ||
81 | #define ____kmalloc(size, flags) __kmalloc(size, flags) | ||
82 | #else | ||
83 | extern void *__kmalloc_track_caller(size_t, gfp_t, void*); | ||
84 | #define ____kmalloc(size, flags) \ | ||
85 | __kmalloc_track_caller(size, flags, __builtin_return_address(0)) | ||
86 | #endif | ||
87 | 80 | ||
88 | /** | 81 | /** |
89 | * kmalloc - allocate memory | 82 | * kmalloc - allocate memory |
@@ -153,6 +146,23 @@ found: | |||
153 | return __kmalloc(size, flags); | 146 | return __kmalloc(size, flags); |
154 | } | 147 | } |
155 | 148 | ||
149 | /* | ||
150 | * kmalloc_track_caller is a special version of kmalloc that records the | ||
151 | * calling function of the routine calling it for slab leak tracking instead | ||
152 | * of just the calling function (confusing, eh?). | ||
153 | * It's useful when the call to kmalloc comes from a widely-used standard | ||
154 | * allocator where we care about the real place the memory allocation | ||
155 | * request comes from. | ||
156 | */ | ||
157 | #ifndef CONFIG_DEBUG_SLAB | ||
158 | #define kmalloc_track_caller(size, flags) \ | ||
159 | __kmalloc(size, flags) | ||
160 | #else | ||
161 | extern void *__kmalloc_track_caller(size_t, gfp_t, void*); | ||
162 | #define kmalloc_track_caller(size, flags) \ | ||
163 | __kmalloc_track_caller(size, flags, __builtin_return_address(0)) | ||
164 | #endif | ||
165 | |||
156 | extern void *__kzalloc(size_t, gfp_t); | 166 | extern void *__kzalloc(size_t, gfp_t); |
157 | 167 | ||
158 | /** | 168 | /** |
@@ -249,7 +259,7 @@ struct kmem_cache *kmem_cache_create(const char *c, size_t, size_t, | |||
249 | unsigned long, | 259 | unsigned long, |
250 | void (*)(void *, struct kmem_cache *, unsigned long), | 260 | void (*)(void *, struct kmem_cache *, unsigned long), |
251 | void (*)(void *, struct kmem_cache *, unsigned long)); | 261 | void (*)(void *, struct kmem_cache *, unsigned long)); |
252 | int kmem_cache_destroy(struct kmem_cache *c); | 262 | void kmem_cache_destroy(struct kmem_cache *c); |
253 | void *kmem_cache_alloc(struct kmem_cache *c, gfp_t flags); | 263 | void *kmem_cache_alloc(struct kmem_cache *c, gfp_t flags); |
254 | void *kmem_cache_zalloc(struct kmem_cache *, gfp_t); | 264 | void *kmem_cache_zalloc(struct kmem_cache *, gfp_t); |
255 | void kmem_cache_free(struct kmem_cache *c, void *b); | 265 | void kmem_cache_free(struct kmem_cache *c, void *b); |
@@ -271,7 +281,7 @@ static inline void *kcalloc(size_t n, size_t size, gfp_t flags) | |||
271 | #define kmem_cache_alloc_node(c, f, n) kmem_cache_alloc(c, f) | 281 | #define kmem_cache_alloc_node(c, f, n) kmem_cache_alloc(c, f) |
272 | #define kmalloc_node(s, f, n) kmalloc(s, f) | 282 | #define kmalloc_node(s, f, n) kmalloc(s, f) |
273 | #define kzalloc(s, f) __kzalloc(s, f) | 283 | #define kzalloc(s, f) __kzalloc(s, f) |
274 | #define ____kmalloc kmalloc | 284 | #define kmalloc_track_caller kmalloc |
275 | 285 | ||
276 | #endif /* CONFIG_SLOB */ | 286 | #endif /* CONFIG_SLOB */ |
277 | 287 | ||
diff --git a/include/linux/smb.h b/include/linux/smb.h index 6df3b1501559..f098dff93f6b 100644 --- a/include/linux/smb.h +++ b/include/linux/smb.h | |||
@@ -89,7 +89,6 @@ struct smb_fattr { | |||
89 | struct timespec f_atime; | 89 | struct timespec f_atime; |
90 | struct timespec f_mtime; | 90 | struct timespec f_mtime; |
91 | struct timespec f_ctime; | 91 | struct timespec f_ctime; |
92 | unsigned long f_blksize; | ||
93 | unsigned long f_blocks; | 92 | unsigned long f_blocks; |
94 | int f_unix; | 93 | int f_unix; |
95 | }; | 94 | }; |
diff --git a/include/linux/sound.h b/include/linux/sound.h index f63d8342ffa3..9e2a94feed6b 100644 --- a/include/linux/sound.h +++ b/include/linux/sound.h | |||
@@ -35,10 +35,8 @@ extern int register_sound_special_device(const struct file_operations *fops, int | |||
35 | extern int register_sound_mixer(const struct file_operations *fops, int dev); | 35 | extern int register_sound_mixer(const struct file_operations *fops, int dev); |
36 | extern int register_sound_midi(const struct file_operations *fops, int dev); | 36 | extern int register_sound_midi(const struct file_operations *fops, int dev); |
37 | extern int register_sound_dsp(const struct file_operations *fops, int dev); | 37 | extern int register_sound_dsp(const struct file_operations *fops, int dev); |
38 | extern int register_sound_synth(const struct file_operations *fops, int dev); | ||
39 | 38 | ||
40 | extern void unregister_sound_special(int unit); | 39 | extern void unregister_sound_special(int unit); |
41 | extern void unregister_sound_mixer(int unit); | 40 | extern void unregister_sound_mixer(int unit); |
42 | extern void unregister_sound_midi(int unit); | 41 | extern void unregister_sound_midi(int unit); |
43 | extern void unregister_sound_dsp(int unit); | 42 | extern void unregister_sound_dsp(int unit); |
44 | extern void unregister_sound_synth(int unit); | ||
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index 31473db92d3b..b800d2d68b32 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
@@ -167,9 +167,9 @@ do { \ | |||
167 | * regardless of whether CONFIG_SMP or CONFIG_PREEMPT are set. The various | 167 | * regardless of whether CONFIG_SMP or CONFIG_PREEMPT are set. The various |
168 | * methods are defined as nops in the case they are not required. | 168 | * methods are defined as nops in the case they are not required. |
169 | */ | 169 | */ |
170 | #define spin_trylock(lock) __cond_lock(_spin_trylock(lock)) | 170 | #define spin_trylock(lock) __cond_lock(lock, _spin_trylock(lock)) |
171 | #define read_trylock(lock) __cond_lock(_read_trylock(lock)) | 171 | #define read_trylock(lock) __cond_lock(lock, _read_trylock(lock)) |
172 | #define write_trylock(lock) __cond_lock(_write_trylock(lock)) | 172 | #define write_trylock(lock) __cond_lock(lock, _write_trylock(lock)) |
173 | 173 | ||
174 | #define spin_lock(lock) _spin_lock(lock) | 174 | #define spin_lock(lock) _spin_lock(lock) |
175 | 175 | ||
@@ -236,19 +236,19 @@ do { \ | |||
236 | _write_unlock_irqrestore(lock, flags) | 236 | _write_unlock_irqrestore(lock, flags) |
237 | #define write_unlock_bh(lock) _write_unlock_bh(lock) | 237 | #define write_unlock_bh(lock) _write_unlock_bh(lock) |
238 | 238 | ||
239 | #define spin_trylock_bh(lock) __cond_lock(_spin_trylock_bh(lock)) | 239 | #define spin_trylock_bh(lock) __cond_lock(lock, _spin_trylock_bh(lock)) |
240 | 240 | ||
241 | #define spin_trylock_irq(lock) \ | 241 | #define spin_trylock_irq(lock) \ |
242 | ({ \ | 242 | ({ \ |
243 | local_irq_disable(); \ | 243 | local_irq_disable(); \ |
244 | _spin_trylock(lock) ? \ | 244 | spin_trylock(lock) ? \ |
245 | 1 : ({ local_irq_enable(); 0; }); \ | 245 | 1 : ({ local_irq_enable(); 0; }); \ |
246 | }) | 246 | }) |
247 | 247 | ||
248 | #define spin_trylock_irqsave(lock, flags) \ | 248 | #define spin_trylock_irqsave(lock, flags) \ |
249 | ({ \ | 249 | ({ \ |
250 | local_irq_save(flags); \ | 250 | local_irq_save(flags); \ |
251 | _spin_trylock(lock) ? \ | 251 | spin_trylock(lock) ? \ |
252 | 1 : ({ local_irq_restore(flags); 0; }); \ | 252 | 1 : ({ local_irq_restore(flags); 0; }); \ |
253 | }) | 253 | }) |
254 | 254 | ||
@@ -264,7 +264,7 @@ do { \ | |||
264 | */ | 264 | */ |
265 | extern int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock); | 265 | extern int _atomic_dec_and_lock(atomic_t *atomic, spinlock_t *lock); |
266 | #define atomic_dec_and_lock(atomic, lock) \ | 266 | #define atomic_dec_and_lock(atomic, lock) \ |
267 | __cond_lock(_atomic_dec_and_lock(atomic, lock)) | 267 | __cond_lock(lock, _atomic_dec_and_lock(atomic, lock)) |
268 | 268 | ||
269 | /** | 269 | /** |
270 | * spin_can_lock - would spin_trylock() succeed? | 270 | * spin_can_lock - would spin_trylock() succeed? |
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h index b2c4f8299464..8828b8155e9c 100644 --- a/include/linux/spinlock_api_smp.h +++ b/include/linux/spinlock_api_smp.h | |||
@@ -19,41 +19,41 @@ int in_lock_functions(unsigned long addr); | |||
19 | 19 | ||
20 | #define assert_spin_locked(x) BUG_ON(!spin_is_locked(x)) | 20 | #define assert_spin_locked(x) BUG_ON(!spin_is_locked(x)) |
21 | 21 | ||
22 | void __lockfunc _spin_lock(spinlock_t *lock) __acquires(spinlock_t); | 22 | void __lockfunc _spin_lock(spinlock_t *lock) __acquires(lock); |
23 | void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass) | 23 | void __lockfunc _spin_lock_nested(spinlock_t *lock, int subclass) |
24 | __acquires(spinlock_t); | 24 | __acquires(lock); |
25 | void __lockfunc _read_lock(rwlock_t *lock) __acquires(rwlock_t); | 25 | void __lockfunc _read_lock(rwlock_t *lock) __acquires(lock); |
26 | void __lockfunc _write_lock(rwlock_t *lock) __acquires(rwlock_t); | 26 | void __lockfunc _write_lock(rwlock_t *lock) __acquires(lock); |
27 | void __lockfunc _spin_lock_bh(spinlock_t *lock) __acquires(spinlock_t); | 27 | void __lockfunc _spin_lock_bh(spinlock_t *lock) __acquires(lock); |
28 | void __lockfunc _read_lock_bh(rwlock_t *lock) __acquires(rwlock_t); | 28 | void __lockfunc _read_lock_bh(rwlock_t *lock) __acquires(lock); |
29 | void __lockfunc _write_lock_bh(rwlock_t *lock) __acquires(rwlock_t); | 29 | void __lockfunc _write_lock_bh(rwlock_t *lock) __acquires(lock); |
30 | void __lockfunc _spin_lock_irq(spinlock_t *lock) __acquires(spinlock_t); | 30 | void __lockfunc _spin_lock_irq(spinlock_t *lock) __acquires(lock); |
31 | void __lockfunc _read_lock_irq(rwlock_t *lock) __acquires(rwlock_t); | 31 | void __lockfunc _read_lock_irq(rwlock_t *lock) __acquires(lock); |
32 | void __lockfunc _write_lock_irq(rwlock_t *lock) __acquires(rwlock_t); | 32 | void __lockfunc _write_lock_irq(rwlock_t *lock) __acquires(lock); |
33 | unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock) | 33 | unsigned long __lockfunc _spin_lock_irqsave(spinlock_t *lock) |
34 | __acquires(spinlock_t); | 34 | __acquires(lock); |
35 | unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock) | 35 | unsigned long __lockfunc _read_lock_irqsave(rwlock_t *lock) |
36 | __acquires(rwlock_t); | 36 | __acquires(lock); |
37 | unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock) | 37 | unsigned long __lockfunc _write_lock_irqsave(rwlock_t *lock) |
38 | __acquires(rwlock_t); | 38 | __acquires(lock); |
39 | int __lockfunc _spin_trylock(spinlock_t *lock); | 39 | int __lockfunc _spin_trylock(spinlock_t *lock); |
40 | int __lockfunc _read_trylock(rwlock_t *lock); | 40 | int __lockfunc _read_trylock(rwlock_t *lock); |
41 | int __lockfunc _write_trylock(rwlock_t *lock); | 41 | int __lockfunc _write_trylock(rwlock_t *lock); |
42 | int __lockfunc _spin_trylock_bh(spinlock_t *lock); | 42 | int __lockfunc _spin_trylock_bh(spinlock_t *lock); |
43 | void __lockfunc _spin_unlock(spinlock_t *lock) __releases(spinlock_t); | 43 | void __lockfunc _spin_unlock(spinlock_t *lock) __releases(lock); |
44 | void __lockfunc _read_unlock(rwlock_t *lock) __releases(rwlock_t); | 44 | void __lockfunc _read_unlock(rwlock_t *lock) __releases(lock); |
45 | void __lockfunc _write_unlock(rwlock_t *lock) __releases(rwlock_t); | 45 | void __lockfunc _write_unlock(rwlock_t *lock) __releases(lock); |
46 | void __lockfunc _spin_unlock_bh(spinlock_t *lock) __releases(spinlock_t); | 46 | void __lockfunc _spin_unlock_bh(spinlock_t *lock) __releases(lock); |
47 | void __lockfunc _read_unlock_bh(rwlock_t *lock) __releases(rwlock_t); | 47 | void __lockfunc _read_unlock_bh(rwlock_t *lock) __releases(lock); |
48 | void __lockfunc _write_unlock_bh(rwlock_t *lock) __releases(rwlock_t); | 48 | void __lockfunc _write_unlock_bh(rwlock_t *lock) __releases(lock); |
49 | void __lockfunc _spin_unlock_irq(spinlock_t *lock) __releases(spinlock_t); | 49 | void __lockfunc _spin_unlock_irq(spinlock_t *lock) __releases(lock); |
50 | void __lockfunc _read_unlock_irq(rwlock_t *lock) __releases(rwlock_t); | 50 | void __lockfunc _read_unlock_irq(rwlock_t *lock) __releases(lock); |
51 | void __lockfunc _write_unlock_irq(rwlock_t *lock) __releases(rwlock_t); | 51 | void __lockfunc _write_unlock_irq(rwlock_t *lock) __releases(lock); |
52 | void __lockfunc _spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags) | 52 | void __lockfunc _spin_unlock_irqrestore(spinlock_t *lock, unsigned long flags) |
53 | __releases(spinlock_t); | 53 | __releases(lock); |
54 | void __lockfunc _read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | 54 | void __lockfunc _read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) |
55 | __releases(rwlock_t); | 55 | __releases(lock); |
56 | void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | 56 | void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) |
57 | __releases(rwlock_t); | 57 | __releases(lock); |
58 | 58 | ||
59 | #endif /* __LINUX_SPINLOCK_API_SMP_H */ | 59 | #endif /* __LINUX_SPINLOCK_API_SMP_H */ |
diff --git a/include/linux/srcu.h b/include/linux/srcu.h new file mode 100644 index 000000000000..aca0eee53930 --- /dev/null +++ b/include/linux/srcu.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * Sleepable Read-Copy Update mechanism for mutual exclusion | ||
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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
17 | * | ||
18 | * Copyright (C) IBM Corporation, 2006 | ||
19 | * | ||
20 | * Author: Paul McKenney <paulmck@us.ibm.com> | ||
21 | * | ||
22 | * For detailed explanation of Read-Copy Update mechanism see - | ||
23 | * Documentation/RCU/ *.txt | ||
24 | * | ||
25 | */ | ||
26 | |||
27 | #ifndef _LINUX_SRCU_H | ||
28 | #define _LINUX_SRCU_H | ||
29 | |||
30 | struct srcu_struct_array { | ||
31 | int c[2]; | ||
32 | }; | ||
33 | |||
34 | struct srcu_struct { | ||
35 | int completed; | ||
36 | struct srcu_struct_array *per_cpu_ref; | ||
37 | struct mutex mutex; | ||
38 | }; | ||
39 | |||
40 | #ifndef CONFIG_PREEMPT | ||
41 | #define srcu_barrier() barrier() | ||
42 | #else /* #ifndef CONFIG_PREEMPT */ | ||
43 | #define srcu_barrier() | ||
44 | #endif /* #else #ifndef CONFIG_PREEMPT */ | ||
45 | |||
46 | int init_srcu_struct(struct srcu_struct *sp); | ||
47 | void cleanup_srcu_struct(struct srcu_struct *sp); | ||
48 | int srcu_read_lock(struct srcu_struct *sp) __acquires(sp); | ||
49 | void srcu_read_unlock(struct srcu_struct *sp, int idx) __releases(sp); | ||
50 | void synchronize_srcu(struct srcu_struct *sp); | ||
51 | long srcu_batches_completed(struct srcu_struct *sp); | ||
52 | |||
53 | #endif | ||
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h index 9cc81e572224..50e2b01e517c 100644 --- a/include/linux/stacktrace.h +++ b/include/linux/stacktrace.h | |||
@@ -5,15 +5,16 @@ | |||
5 | struct stack_trace { | 5 | struct stack_trace { |
6 | unsigned int nr_entries, max_entries; | 6 | unsigned int nr_entries, max_entries; |
7 | unsigned long *entries; | 7 | unsigned long *entries; |
8 | int skip; /* input argument: How many entries to skip */ | ||
9 | int all_contexts; /* input argument: if true do than one stack */ | ||
8 | }; | 10 | }; |
9 | 11 | ||
10 | extern void save_stack_trace(struct stack_trace *trace, | 12 | extern void save_stack_trace(struct stack_trace *trace, |
11 | struct task_struct *task, int all_contexts, | 13 | struct task_struct *task); |
12 | unsigned int skip); | ||
13 | 14 | ||
14 | extern void print_stack_trace(struct stack_trace *trace, int spaces); | 15 | extern void print_stack_trace(struct stack_trace *trace, int spaces); |
15 | #else | 16 | #else |
16 | # define save_stack_trace(trace, task, all, skip) do { } while (0) | 17 | # define save_stack_trace(trace, task) do { } while (0) |
17 | # define print_stack_trace(trace) do { } while (0) | 18 | # define print_stack_trace(trace) do { } while (0) |
18 | #endif | 19 | #endif |
19 | 20 | ||
diff --git a/include/linux/stat.h b/include/linux/stat.h index 8669291352db..679ef0d70b6b 100644 --- a/include/linux/stat.h +++ b/include/linux/stat.h | |||
@@ -57,7 +57,7 @@ | |||
57 | #include <linux/time.h> | 57 | #include <linux/time.h> |
58 | 58 | ||
59 | struct kstat { | 59 | struct kstat { |
60 | unsigned long ino; | 60 | u64 ino; |
61 | dev_t dev; | 61 | dev_t dev; |
62 | umode_t mode; | 62 | umode_t mode; |
63 | unsigned int nlink; | 63 | unsigned int nlink; |
diff --git a/include/linux/stddef.h b/include/linux/stddef.h index ea65dfb60cd8..6a40c76bdcf1 100644 --- a/include/linux/stddef.h +++ b/include/linux/stddef.h | |||
@@ -11,6 +11,12 @@ | |||
11 | #endif | 11 | #endif |
12 | 12 | ||
13 | #ifdef __KERNEL__ | 13 | #ifdef __KERNEL__ |
14 | |||
15 | enum { | ||
16 | false = 0, | ||
17 | true = 1 | ||
18 | }; | ||
19 | |||
14 | #undef offsetof | 20 | #undef offsetof |
15 | #ifdef __compiler_offsetof | 21 | #ifdef __compiler_offsetof |
16 | #define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER) | 22 | #define offsetof(TYPE,MEMBER) __compiler_offsetof(TYPE,MEMBER) |
diff --git a/include/linux/string.h b/include/linux/string.h index e4c755860316..4f69ef9e6eb5 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
@@ -99,6 +99,7 @@ extern void * memchr(const void *,int,__kernel_size_t); | |||
99 | #endif | 99 | #endif |
100 | 100 | ||
101 | extern char *kstrdup(const char *s, gfp_t gfp); | 101 | extern char *kstrdup(const char *s, gfp_t gfp); |
102 | extern void *kmemdup(const void *src, size_t len, gfp_t gfp); | ||
102 | 103 | ||
103 | #ifdef __cplusplus | 104 | #ifdef __cplusplus |
104 | } | 105 | } |
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h index a6de332e57d4..534cdc7be58d 100644 --- a/include/linux/sunrpc/auth.h +++ b/include/linux/sunrpc/auth.h | |||
@@ -20,9 +20,6 @@ | |||
20 | /* size of the nodename buffer */ | 20 | /* size of the nodename buffer */ |
21 | #define UNX_MAXNODENAME 32 | 21 | #define UNX_MAXNODENAME 32 |
22 | 22 | ||
23 | /* Maximum size (in bytes) of an rpc credential or verifier */ | ||
24 | #define RPC_MAX_AUTH_SIZE (400) | ||
25 | |||
26 | /* Work around the lack of a VFS credential */ | 23 | /* Work around the lack of a VFS credential */ |
27 | struct auth_cred { | 24 | struct auth_cred { |
28 | uid_t uid; | 25 | uid_t uid; |
@@ -109,13 +106,13 @@ struct rpc_credops { | |||
109 | void (*crdestroy)(struct rpc_cred *); | 106 | void (*crdestroy)(struct rpc_cred *); |
110 | 107 | ||
111 | int (*crmatch)(struct auth_cred *, struct rpc_cred *, int); | 108 | int (*crmatch)(struct auth_cred *, struct rpc_cred *, int); |
112 | u32 * (*crmarshal)(struct rpc_task *, u32 *); | 109 | __be32 * (*crmarshal)(struct rpc_task *, __be32 *); |
113 | int (*crrefresh)(struct rpc_task *); | 110 | int (*crrefresh)(struct rpc_task *); |
114 | u32 * (*crvalidate)(struct rpc_task *, u32 *); | 111 | __be32 * (*crvalidate)(struct rpc_task *, __be32 *); |
115 | int (*crwrap_req)(struct rpc_task *, kxdrproc_t, | 112 | int (*crwrap_req)(struct rpc_task *, kxdrproc_t, |
116 | void *, u32 *, void *); | 113 | void *, __be32 *, void *); |
117 | int (*crunwrap_resp)(struct rpc_task *, kxdrproc_t, | 114 | int (*crunwrap_resp)(struct rpc_task *, kxdrproc_t, |
118 | void *, u32 *, void *); | 115 | void *, __be32 *, void *); |
119 | }; | 116 | }; |
120 | 117 | ||
121 | extern struct rpc_authops authunix_ops; | 118 | extern struct rpc_authops authunix_ops; |
@@ -134,10 +131,10 @@ struct rpc_cred * rpcauth_bindcred(struct rpc_task *); | |||
134 | void rpcauth_holdcred(struct rpc_task *); | 131 | void rpcauth_holdcred(struct rpc_task *); |
135 | void put_rpccred(struct rpc_cred *); | 132 | void put_rpccred(struct rpc_cred *); |
136 | void rpcauth_unbindcred(struct rpc_task *); | 133 | void rpcauth_unbindcred(struct rpc_task *); |
137 | u32 * rpcauth_marshcred(struct rpc_task *, u32 *); | 134 | __be32 * rpcauth_marshcred(struct rpc_task *, __be32 *); |
138 | u32 * rpcauth_checkverf(struct rpc_task *, u32 *); | 135 | __be32 * rpcauth_checkverf(struct rpc_task *, __be32 *); |
139 | int rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp, u32 *data, void *obj); | 136 | int rpcauth_wrap_req(struct rpc_task *task, kxdrproc_t encode, void *rqstp, __be32 *data, void *obj); |
140 | int rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp, u32 *data, void *obj); | 137 | int rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp, __be32 *data, void *obj); |
141 | int rpcauth_refreshcred(struct rpc_task *); | 138 | int rpcauth_refreshcred(struct rpc_task *); |
142 | void rpcauth_invalcred(struct rpc_task *); | 139 | void rpcauth_invalcred(struct rpc_task *); |
143 | int rpcauth_uptodatecred(struct rpc_task *); | 140 | int rpcauth_uptodatecred(struct rpc_task *); |
diff --git a/include/linux/sunrpc/auth_gss.h b/include/linux/sunrpc/auth_gss.h index 03084dc4bb6a..97b62e97dd8d 100644 --- a/include/linux/sunrpc/auth_gss.h +++ b/include/linux/sunrpc/auth_gss.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/linux/auth_gss.h | 2 | * linux/include/linux/sunrpc/auth_gss.h |
3 | * | 3 | * |
4 | * Declarations for RPCSEC_GSS | 4 | * Declarations for RPCSEC_GSS |
5 | * | 5 | * |
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h index b5612c958cce..3699dff7db8f 100644 --- a/include/linux/sunrpc/cache.h +++ b/include/linux/sunrpc/cache.h | |||
@@ -163,6 +163,17 @@ static inline void cache_put(struct cache_head *h, struct cache_detail *cd) | |||
163 | kref_put(&h->ref, cd->cache_put); | 163 | kref_put(&h->ref, cd->cache_put); |
164 | } | 164 | } |
165 | 165 | ||
166 | static inline int cache_valid(struct cache_head *h) | ||
167 | { | ||
168 | /* If an item has been unhashed pending removal when | ||
169 | * the refcount drops to 0, the expiry_time will be | ||
170 | * set to 0. We don't want to consider such items | ||
171 | * valid in this context even though CACHE_VALID is | ||
172 | * set. | ||
173 | */ | ||
174 | return (h->expiry_time != 0 && test_bit(CACHE_VALID, &h->flags)); | ||
175 | } | ||
176 | |||
166 | extern int cache_check(struct cache_detail *detail, | 177 | extern int cache_check(struct cache_detail *detail, |
167 | struct cache_head *h, struct cache_req *rqstp); | 178 | struct cache_head *h, struct cache_req *rqstp); |
168 | extern void cache_flush(void); | 179 | extern void cache_flush(void); |
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h index 6e112cc5cdda..5eca9e442051 100644 --- a/include/linux/sunrpc/gss_api.h +++ b/include/linux/sunrpc/gss_api.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/linux/gss_api.h | 2 | * linux/include/linux/sunrpc/gss_api.h |
3 | * | 3 | * |
4 | * Somewhat simplified version of the gss api. | 4 | * Somewhat simplified version of the gss api. |
5 | * | 5 | * |
diff --git a/include/linux/sunrpc/msg_prot.h b/include/linux/sunrpc/msg_prot.h index f43f237360ae..1e65f2dd80e5 100644 --- a/include/linux/sunrpc/msg_prot.h +++ b/include/linux/sunrpc/msg_prot.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/net/sunrpc/msg_prot.h | 2 | * linux/include/linux/sunrpc/msg_prot.h |
3 | * | 3 | * |
4 | * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de> | 4 | * Copyright (C) 1996, Olaf Kirch <okir@monad.swb.de> |
5 | */ | 5 | */ |
@@ -11,6 +11,9 @@ | |||
11 | 11 | ||
12 | #define RPC_VERSION 2 | 12 | #define RPC_VERSION 2 |
13 | 13 | ||
14 | /* size of an XDR encoding unit in bytes, i.e. 32bit */ | ||
15 | #define XDR_UNIT (4) | ||
16 | |||
14 | /* spec defines authentication flavor as an unsigned 32 bit integer */ | 17 | /* spec defines authentication flavor as an unsigned 32 bit integer */ |
15 | typedef u32 rpc_authflavor_t; | 18 | typedef u32 rpc_authflavor_t; |
16 | 19 | ||
@@ -34,6 +37,9 @@ enum rpc_auth_flavors { | |||
34 | RPC_AUTH_GSS_SPKMP = 390011, | 37 | RPC_AUTH_GSS_SPKMP = 390011, |
35 | }; | 38 | }; |
36 | 39 | ||
40 | /* Maximum size (in bytes) of an rpc credential or verifier */ | ||
41 | #define RPC_MAX_AUTH_SIZE (400) | ||
42 | |||
37 | enum rpc_msg_type { | 43 | enum rpc_msg_type { |
38 | RPC_CALL = 0, | 44 | RPC_CALL = 0, |
39 | RPC_REPLY = 1 | 45 | RPC_REPLY = 1 |
@@ -95,11 +101,45 @@ enum rpc_auth_stat { | |||
95 | * 2GB. | 101 | * 2GB. |
96 | */ | 102 | */ |
97 | 103 | ||
98 | typedef u32 rpc_fraghdr; | 104 | typedef __be32 rpc_fraghdr; |
99 | 105 | ||
100 | #define RPC_LAST_STREAM_FRAGMENT (1U << 31) | 106 | #define RPC_LAST_STREAM_FRAGMENT (1U << 31) |
101 | #define RPC_FRAGMENT_SIZE_MASK (~RPC_LAST_STREAM_FRAGMENT) | 107 | #define RPC_FRAGMENT_SIZE_MASK (~RPC_LAST_STREAM_FRAGMENT) |
102 | #define RPC_MAX_FRAGMENT_SIZE ((1U << 31) - 1) | 108 | #define RPC_MAX_FRAGMENT_SIZE ((1U << 31) - 1) |
103 | 109 | ||
110 | /* | ||
111 | * RPC call and reply header size as number of 32bit words (verifier | ||
112 | * size computed separately, see below) | ||
113 | */ | ||
114 | #define RPC_CALLHDRSIZE (6) | ||
115 | #define RPC_REPHDRSIZE (4) | ||
116 | |||
117 | |||
118 | /* | ||
119 | * Maximum RPC header size, including authentication, | ||
120 | * as number of 32bit words (see RFCs 1831, 1832). | ||
121 | * | ||
122 | * xid 1 xdr unit = 4 bytes | ||
123 | * mtype 1 | ||
124 | * rpc_version 1 | ||
125 | * program 1 | ||
126 | * prog_version 1 | ||
127 | * procedure 1 | ||
128 | * cred { | ||
129 | * flavor 1 | ||
130 | * length 1 | ||
131 | * body<RPC_MAX_AUTH_SIZE> 100 xdr units = 400 bytes | ||
132 | * } | ||
133 | * verf { | ||
134 | * flavor 1 | ||
135 | * length 1 | ||
136 | * body<RPC_MAX_AUTH_SIZE> 100 xdr units = 400 bytes | ||
137 | * } | ||
138 | * TOTAL 210 xdr units = 840 bytes | ||
139 | */ | ||
140 | #define RPC_MAX_HEADER_WITH_AUTH \ | ||
141 | (RPC_CALLHDRSIZE + 2*(2+RPC_MAX_AUTH_SIZE/4)) | ||
142 | |||
143 | |||
104 | #endif /* __KERNEL__ */ | 144 | #endif /* __KERNEL__ */ |
105 | #endif /* _LINUX_SUNRPC_MSGPROT_H_ */ | 145 | #endif /* _LINUX_SUNRPC_MSGPROT_H_ */ |
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h index 7b27c09b5604..d6288e89fd9d 100644 --- a/include/linux/sunrpc/svc.h +++ b/include/linux/sunrpc/svc.h | |||
@@ -13,11 +13,36 @@ | |||
13 | #include <linux/in.h> | 13 | #include <linux/in.h> |
14 | #include <linux/sunrpc/types.h> | 14 | #include <linux/sunrpc/types.h> |
15 | #include <linux/sunrpc/xdr.h> | 15 | #include <linux/sunrpc/xdr.h> |
16 | #include <linux/sunrpc/auth.h> | ||
16 | #include <linux/sunrpc/svcauth.h> | 17 | #include <linux/sunrpc/svcauth.h> |
17 | #include <linux/wait.h> | 18 | #include <linux/wait.h> |
18 | #include <linux/mm.h> | 19 | #include <linux/mm.h> |
19 | 20 | ||
20 | /* | 21 | /* |
22 | * This is the RPC server thread function prototype | ||
23 | */ | ||
24 | typedef void (*svc_thread_fn)(struct svc_rqst *); | ||
25 | |||
26 | /* | ||
27 | * | ||
28 | * RPC service thread pool. | ||
29 | * | ||
30 | * Pool of threads and temporary sockets. Generally there is only | ||
31 | * a single one of these per RPC service, but on NUMA machines those | ||
32 | * services that can benefit from it (i.e. nfs but not lockd) will | ||
33 | * have one pool per NUMA node. This optimisation reduces cross- | ||
34 | * node traffic on multi-node NUMA NFS servers. | ||
35 | */ | ||
36 | struct svc_pool { | ||
37 | unsigned int sp_id; /* pool id; also node id on NUMA */ | ||
38 | spinlock_t sp_lock; /* protects all fields */ | ||
39 | struct list_head sp_threads; /* idle server threads */ | ||
40 | struct list_head sp_sockets; /* pending sockets */ | ||
41 | unsigned int sp_nrthreads; /* # of threads in pool */ | ||
42 | struct list_head sp_all_threads; /* all server threads */ | ||
43 | } ____cacheline_aligned_in_smp; | ||
44 | |||
45 | /* | ||
21 | * RPC service. | 46 | * RPC service. |
22 | * | 47 | * |
23 | * An RPC service is a ``daemon,'' possibly multithreaded, which | 48 | * An RPC service is a ``daemon,'' possibly multithreaded, which |
@@ -28,8 +53,6 @@ | |||
28 | * We currently do not support more than one RPC program per daemon. | 53 | * We currently do not support more than one RPC program per daemon. |
29 | */ | 54 | */ |
30 | struct svc_serv { | 55 | struct svc_serv { |
31 | struct list_head sv_threads; /* idle server threads */ | ||
32 | struct list_head sv_sockets; /* pending sockets */ | ||
33 | struct svc_program * sv_program; /* RPC program */ | 56 | struct svc_program * sv_program; /* RPC program */ |
34 | struct svc_stat * sv_stats; /* RPC statistics */ | 57 | struct svc_stat * sv_stats; /* RPC statistics */ |
35 | spinlock_t sv_lock; | 58 | spinlock_t sv_lock; |
@@ -40,16 +63,61 @@ struct svc_serv { | |||
40 | struct list_head sv_permsocks; /* all permanent sockets */ | 63 | struct list_head sv_permsocks; /* all permanent sockets */ |
41 | struct list_head sv_tempsocks; /* all temporary sockets */ | 64 | struct list_head sv_tempsocks; /* all temporary sockets */ |
42 | int sv_tmpcnt; /* count of temporary sockets */ | 65 | int sv_tmpcnt; /* count of temporary sockets */ |
66 | struct timer_list sv_temptimer; /* timer for aging temporary sockets */ | ||
43 | 67 | ||
44 | char * sv_name; /* service name */ | 68 | char * sv_name; /* service name */ |
69 | |||
70 | unsigned int sv_nrpools; /* number of thread pools */ | ||
71 | struct svc_pool * sv_pools; /* array of thread pools */ | ||
72 | |||
73 | void (*sv_shutdown)(struct svc_serv *serv); | ||
74 | /* Callback to use when last thread | ||
75 | * exits. | ||
76 | */ | ||
77 | |||
78 | struct module * sv_module; /* optional module to count when | ||
79 | * adding threads */ | ||
80 | svc_thread_fn sv_function; /* main function for threads */ | ||
81 | int sv_kill_signal; /* signal to kill threads */ | ||
45 | }; | 82 | }; |
46 | 83 | ||
47 | /* | 84 | /* |
85 | * We use sv_nrthreads as a reference count. svc_destroy() drops | ||
86 | * this refcount, so we need to bump it up around operations that | ||
87 | * change the number of threads. Horrible, but there it is. | ||
88 | * Should be called with the BKL held. | ||
89 | */ | ||
90 | static inline void svc_get(struct svc_serv *serv) | ||
91 | { | ||
92 | serv->sv_nrthreads++; | ||
93 | } | ||
94 | |||
95 | /* | ||
48 | * Maximum payload size supported by a kernel RPC server. | 96 | * Maximum payload size supported by a kernel RPC server. |
49 | * This is use to determine the max number of pages nfsd is | 97 | * This is use to determine the max number of pages nfsd is |
50 | * willing to return in a single READ operation. | 98 | * willing to return in a single READ operation. |
99 | * | ||
100 | * These happen to all be powers of 2, which is not strictly | ||
101 | * necessary but helps enforce the real limitation, which is | ||
102 | * that they should be multiples of PAGE_CACHE_SIZE. | ||
103 | * | ||
104 | * For UDP transports, a block plus NFS,RPC, and UDP headers | ||
105 | * has to fit into the IP datagram limit of 64K. The largest | ||
106 | * feasible number for all known page sizes is probably 48K, | ||
107 | * but we choose 32K here. This is the same as the historical | ||
108 | * Linux limit; someone who cares more about NFS/UDP performance | ||
109 | * can test a larger number. | ||
110 | * | ||
111 | * For TCP transports we have more freedom. A size of 1MB is | ||
112 | * chosen to match the client limit. Other OSes are known to | ||
113 | * have larger limits, but those numbers are probably beyond | ||
114 | * the point of diminishing returns. | ||
51 | */ | 115 | */ |
52 | #define RPCSVC_MAXPAYLOAD (64*1024u) | 116 | #define RPCSVC_MAXPAYLOAD (1*1024*1024u) |
117 | #define RPCSVC_MAXPAYLOAD_TCP RPCSVC_MAXPAYLOAD | ||
118 | #define RPCSVC_MAXPAYLOAD_UDP (32*1024u) | ||
119 | |||
120 | extern u32 svc_max_payload(const struct svc_rqst *rqstp); | ||
53 | 121 | ||
54 | /* | 122 | /* |
55 | * RPC Requsts and replies are stored in one or more pages. | 123 | * RPC Requsts and replies are stored in one or more pages. |
@@ -78,43 +146,61 @@ struct svc_serv { | |||
78 | */ | 146 | */ |
79 | #define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 2) | 147 | #define RPCSVC_MAXPAGES ((RPCSVC_MAXPAYLOAD+PAGE_SIZE-1)/PAGE_SIZE + 2) |
80 | 148 | ||
81 | static inline u32 svc_getu32(struct kvec *iov) | 149 | static inline u32 svc_getnl(struct kvec *iov) |
150 | { | ||
151 | __be32 val, *vp; | ||
152 | vp = iov->iov_base; | ||
153 | val = *vp++; | ||
154 | iov->iov_base = (void*)vp; | ||
155 | iov->iov_len -= sizeof(__be32); | ||
156 | return ntohl(val); | ||
157 | } | ||
158 | |||
159 | static inline void svc_putnl(struct kvec *iov, u32 val) | ||
160 | { | ||
161 | __be32 *vp = iov->iov_base + iov->iov_len; | ||
162 | *vp = htonl(val); | ||
163 | iov->iov_len += sizeof(__be32); | ||
164 | } | ||
165 | |||
166 | static inline __be32 svc_getu32(struct kvec *iov) | ||
82 | { | 167 | { |
83 | u32 val, *vp; | 168 | __be32 val, *vp; |
84 | vp = iov->iov_base; | 169 | vp = iov->iov_base; |
85 | val = *vp++; | 170 | val = *vp++; |
86 | iov->iov_base = (void*)vp; | 171 | iov->iov_base = (void*)vp; |
87 | iov->iov_len -= sizeof(u32); | 172 | iov->iov_len -= sizeof(__be32); |
88 | return val; | 173 | return val; |
89 | } | 174 | } |
90 | 175 | ||
91 | static inline void svc_ungetu32(struct kvec *iov) | 176 | static inline void svc_ungetu32(struct kvec *iov) |
92 | { | 177 | { |
93 | u32 *vp = (u32 *)iov->iov_base; | 178 | __be32 *vp = (__be32 *)iov->iov_base; |
94 | iov->iov_base = (void *)(vp - 1); | 179 | iov->iov_base = (void *)(vp - 1); |
95 | iov->iov_len += sizeof(*vp); | 180 | iov->iov_len += sizeof(*vp); |
96 | } | 181 | } |
97 | 182 | ||
98 | static inline void svc_putu32(struct kvec *iov, u32 val) | 183 | static inline void svc_putu32(struct kvec *iov, __be32 val) |
99 | { | 184 | { |
100 | u32 *vp = iov->iov_base + iov->iov_len; | 185 | __be32 *vp = iov->iov_base + iov->iov_len; |
101 | *vp = val; | 186 | *vp = val; |
102 | iov->iov_len += sizeof(u32); | 187 | iov->iov_len += sizeof(__be32); |
103 | } | 188 | } |
104 | 189 | ||
105 | 190 | ||
106 | /* | 191 | /* |
107 | * The context of a single thread, including the request currently being | 192 | * The context of a single thread, including the request currently being |
108 | * processed. | 193 | * processed. |
109 | * NOTE: First two items must be prev/next. | ||
110 | */ | 194 | */ |
111 | struct svc_rqst { | 195 | struct svc_rqst { |
112 | struct list_head rq_list; /* idle list */ | 196 | struct list_head rq_list; /* idle list */ |
197 | struct list_head rq_all; /* all threads list */ | ||
113 | struct svc_sock * rq_sock; /* socket */ | 198 | struct svc_sock * rq_sock; /* socket */ |
114 | struct sockaddr_in rq_addr; /* peer address */ | 199 | struct sockaddr_in rq_addr; /* peer address */ |
115 | int rq_addrlen; | 200 | int rq_addrlen; |
116 | 201 | ||
117 | struct svc_serv * rq_server; /* RPC service definition */ | 202 | struct svc_serv * rq_server; /* RPC service definition */ |
203 | struct svc_pool * rq_pool; /* thread pool */ | ||
118 | struct svc_procedure * rq_procinfo; /* procedure info */ | 204 | struct svc_procedure * rq_procinfo; /* procedure info */ |
119 | struct auth_ops * rq_authop; /* authentication flavour */ | 205 | struct auth_ops * rq_authop; /* authentication flavour */ |
120 | struct svc_cred rq_cred; /* auth info */ | 206 | struct svc_cred rq_cred; /* auth info */ |
@@ -123,14 +209,13 @@ struct svc_rqst { | |||
123 | 209 | ||
124 | struct xdr_buf rq_arg; | 210 | struct xdr_buf rq_arg; |
125 | struct xdr_buf rq_res; | 211 | struct xdr_buf rq_res; |
126 | struct page * rq_argpages[RPCSVC_MAXPAGES]; | 212 | struct page * rq_pages[RPCSVC_MAXPAGES]; |
127 | struct page * rq_respages[RPCSVC_MAXPAGES]; | 213 | struct page * *rq_respages; /* points into rq_pages */ |
128 | int rq_restailpage; | 214 | int rq_resused; /* number of pages used for result */ |
129 | short rq_argused; /* pages used for argument */ | 215 | |
130 | short rq_arghi; /* pages available in argument page list */ | 216 | struct kvec rq_vec[RPCSVC_MAXPAGES]; /* generally useful.. */ |
131 | short rq_resused; /* pages used for result */ | 217 | |
132 | 218 | __be32 rq_xid; /* transmission id */ | |
133 | u32 rq_xid; /* transmission id */ | ||
134 | u32 rq_prog; /* program number */ | 219 | u32 rq_prog; /* program number */ |
135 | u32 rq_vers; /* program version */ | 220 | u32 rq_vers; /* program version */ |
136 | u32 rq_proc; /* procedure number */ | 221 | u32 rq_proc; /* procedure number */ |
@@ -139,7 +224,7 @@ struct svc_rqst { | |||
139 | rq_secure : 1; /* secure port */ | 224 | rq_secure : 1; /* secure port */ |
140 | 225 | ||
141 | 226 | ||
142 | __u32 rq_daddr; /* dest addr of request - reply from here */ | 227 | __be32 rq_daddr; /* dest addr of request - reply from here */ |
143 | 228 | ||
144 | void * rq_argp; /* decoded arguments */ | 229 | void * rq_argp; /* decoded arguments */ |
145 | void * rq_resp; /* xdr'd results */ | 230 | void * rq_resp; /* xdr'd results */ |
@@ -163,13 +248,14 @@ struct svc_rqst { | |||
163 | * to prevent encrypting page | 248 | * to prevent encrypting page |
164 | * cache pages */ | 249 | * cache pages */ |
165 | wait_queue_head_t rq_wait; /* synchronization */ | 250 | wait_queue_head_t rq_wait; /* synchronization */ |
251 | struct task_struct *rq_task; /* service thread */ | ||
166 | }; | 252 | }; |
167 | 253 | ||
168 | /* | 254 | /* |
169 | * Check buffer bounds after decoding arguments | 255 | * Check buffer bounds after decoding arguments |
170 | */ | 256 | */ |
171 | static inline int | 257 | static inline int |
172 | xdr_argsize_check(struct svc_rqst *rqstp, u32 *p) | 258 | xdr_argsize_check(struct svc_rqst *rqstp, __be32 *p) |
173 | { | 259 | { |
174 | char *cp = (char *)p; | 260 | char *cp = (char *)p; |
175 | struct kvec *vec = &rqstp->rq_arg.head[0]; | 261 | struct kvec *vec = &rqstp->rq_arg.head[0]; |
@@ -178,7 +264,7 @@ xdr_argsize_check(struct svc_rqst *rqstp, u32 *p) | |||
178 | } | 264 | } |
179 | 265 | ||
180 | static inline int | 266 | static inline int |
181 | xdr_ressize_check(struct svc_rqst *rqstp, u32 *p) | 267 | xdr_ressize_check(struct svc_rqst *rqstp, __be32 *p) |
182 | { | 268 | { |
183 | struct kvec *vec = &rqstp->rq_res.head[0]; | 269 | struct kvec *vec = &rqstp->rq_res.head[0]; |
184 | char *cp = (char*)p; | 270 | char *cp = (char*)p; |
@@ -188,71 +274,26 @@ xdr_ressize_check(struct svc_rqst *rqstp, u32 *p) | |||
188 | return vec->iov_len <= PAGE_SIZE; | 274 | return vec->iov_len <= PAGE_SIZE; |
189 | } | 275 | } |
190 | 276 | ||
191 | static inline struct page * | 277 | static inline void svc_free_res_pages(struct svc_rqst *rqstp) |
192 | svc_take_res_page(struct svc_rqst *rqstp) | ||
193 | { | ||
194 | if (rqstp->rq_arghi <= rqstp->rq_argused) | ||
195 | return NULL; | ||
196 | rqstp->rq_arghi--; | ||
197 | rqstp->rq_respages[rqstp->rq_resused] = | ||
198 | rqstp->rq_argpages[rqstp->rq_arghi]; | ||
199 | return rqstp->rq_respages[rqstp->rq_resused++]; | ||
200 | } | ||
201 | |||
202 | static inline void svc_take_page(struct svc_rqst *rqstp) | ||
203 | { | ||
204 | if (rqstp->rq_arghi <= rqstp->rq_argused) { | ||
205 | WARN_ON(1); | ||
206 | return; | ||
207 | } | ||
208 | rqstp->rq_arghi--; | ||
209 | rqstp->rq_respages[rqstp->rq_resused] = | ||
210 | rqstp->rq_argpages[rqstp->rq_arghi]; | ||
211 | rqstp->rq_resused++; | ||
212 | } | ||
213 | |||
214 | static inline void svc_pushback_allpages(struct svc_rqst *rqstp) | ||
215 | { | ||
216 | while (rqstp->rq_resused) { | ||
217 | if (rqstp->rq_respages[--rqstp->rq_resused] == NULL) | ||
218 | continue; | ||
219 | rqstp->rq_argpages[rqstp->rq_arghi++] = | ||
220 | rqstp->rq_respages[rqstp->rq_resused]; | ||
221 | rqstp->rq_respages[rqstp->rq_resused] = NULL; | ||
222 | } | ||
223 | } | ||
224 | |||
225 | static inline void svc_pushback_unused_pages(struct svc_rqst *rqstp) | ||
226 | { | 278 | { |
227 | while (rqstp->rq_resused && | 279 | while (rqstp->rq_resused) { |
228 | rqstp->rq_res.pages != &rqstp->rq_respages[rqstp->rq_resused]) { | 280 | struct page **pp = (rqstp->rq_respages + |
229 | 281 | --rqstp->rq_resused); | |
230 | if (rqstp->rq_respages[--rqstp->rq_resused] != NULL) { | 282 | if (*pp) { |
231 | rqstp->rq_argpages[rqstp->rq_arghi++] = | 283 | put_page(*pp); |
232 | rqstp->rq_respages[rqstp->rq_resused]; | 284 | *pp = NULL; |
233 | rqstp->rq_respages[rqstp->rq_resused] = NULL; | ||
234 | } | 285 | } |
235 | } | 286 | } |
236 | } | 287 | } |
237 | 288 | ||
238 | static inline void svc_free_allpages(struct svc_rqst *rqstp) | ||
239 | { | ||
240 | while (rqstp->rq_resused) { | ||
241 | if (rqstp->rq_respages[--rqstp->rq_resused] == NULL) | ||
242 | continue; | ||
243 | put_page(rqstp->rq_respages[rqstp->rq_resused]); | ||
244 | rqstp->rq_respages[rqstp->rq_resused] = NULL; | ||
245 | } | ||
246 | } | ||
247 | |||
248 | struct svc_deferred_req { | 289 | struct svc_deferred_req { |
249 | u32 prot; /* protocol (UDP or TCP) */ | 290 | u32 prot; /* protocol (UDP or TCP) */ |
250 | struct sockaddr_in addr; | 291 | struct sockaddr_in addr; |
251 | struct svc_sock *svsk; /* where reply must go */ | 292 | struct svc_sock *svsk; /* where reply must go */ |
252 | u32 daddr; /* where reply must come from */ | 293 | __be32 daddr; /* where reply must come from */ |
253 | struct cache_deferred_req handle; | 294 | struct cache_deferred_req handle; |
254 | int argslen; | 295 | int argslen; |
255 | u32 args[0]; | 296 | __be32 args[0]; |
256 | }; | 297 | }; |
257 | 298 | ||
258 | /* | 299 | /* |
@@ -280,11 +321,14 @@ struct svc_version { | |||
280 | struct svc_procedure * vs_proc; /* per-procedure info */ | 321 | struct svc_procedure * vs_proc; /* per-procedure info */ |
281 | u32 vs_xdrsize; /* xdrsize needed for this version */ | 322 | u32 vs_xdrsize; /* xdrsize needed for this version */ |
282 | 323 | ||
324 | unsigned int vs_hidden : 1; /* Don't register with portmapper. | ||
325 | * Only used for nfsacl so far. */ | ||
326 | |||
283 | /* Override dispatch function (e.g. when caching replies). | 327 | /* Override dispatch function (e.g. when caching replies). |
284 | * A return value of 0 means drop the request. | 328 | * A return value of 0 means drop the request. |
285 | * vs_dispatch == NULL means use default dispatcher. | 329 | * vs_dispatch == NULL means use default dispatcher. |
286 | */ | 330 | */ |
287 | int (*vs_dispatch)(struct svc_rqst *, u32 *); | 331 | int (*vs_dispatch)(struct svc_rqst *, __be32 *); |
288 | }; | 332 | }; |
289 | 333 | ||
290 | /* | 334 | /* |
@@ -304,20 +348,21 @@ struct svc_procedure { | |||
304 | }; | 348 | }; |
305 | 349 | ||
306 | /* | 350 | /* |
307 | * This is the RPC server thread function prototype | ||
308 | */ | ||
309 | typedef void (*svc_thread_fn)(struct svc_rqst *); | ||
310 | |||
311 | /* | ||
312 | * Function prototypes. | 351 | * Function prototypes. |
313 | */ | 352 | */ |
314 | struct svc_serv * svc_create(struct svc_program *, unsigned int); | 353 | struct svc_serv * svc_create(struct svc_program *, unsigned int, |
354 | void (*shutdown)(struct svc_serv*)); | ||
315 | int svc_create_thread(svc_thread_fn, struct svc_serv *); | 355 | int svc_create_thread(svc_thread_fn, struct svc_serv *); |
316 | void svc_exit_thread(struct svc_rqst *); | 356 | void svc_exit_thread(struct svc_rqst *); |
357 | struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int, | ||
358 | void (*shutdown)(struct svc_serv*), | ||
359 | svc_thread_fn, int sig, struct module *); | ||
360 | int svc_set_num_threads(struct svc_serv *, struct svc_pool *, int); | ||
317 | void svc_destroy(struct svc_serv *); | 361 | void svc_destroy(struct svc_serv *); |
318 | int svc_process(struct svc_serv *, struct svc_rqst *); | 362 | int svc_process(struct svc_rqst *); |
319 | int svc_register(struct svc_serv *, int, unsigned short); | 363 | int svc_register(struct svc_serv *, int, unsigned short); |
320 | void svc_wake_up(struct svc_serv *); | 364 | void svc_wake_up(struct svc_serv *); |
321 | void svc_reserve(struct svc_rqst *rqstp, int space); | 365 | void svc_reserve(struct svc_rqst *rqstp, int space); |
366 | struct svc_pool * svc_pool_for_cpu(struct svc_serv *serv, int cpu); | ||
322 | 367 | ||
323 | #endif /* SUNRPC_SVC_H */ | 368 | #endif /* SUNRPC_SVC_H */ |
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h index 2fe2087edd66..de92619b0826 100644 --- a/include/linux/sunrpc/svcauth.h +++ b/include/linux/sunrpc/svcauth.h | |||
@@ -95,7 +95,7 @@ struct auth_ops { | |||
95 | char * name; | 95 | char * name; |
96 | struct module *owner; | 96 | struct module *owner; |
97 | int flavour; | 97 | int flavour; |
98 | int (*accept)(struct svc_rqst *rq, u32 *authp); | 98 | int (*accept)(struct svc_rqst *rq, __be32 *authp); |
99 | int (*release)(struct svc_rqst *rq); | 99 | int (*release)(struct svc_rqst *rq); |
100 | void (*domain_release)(struct auth_domain *); | 100 | void (*domain_release)(struct auth_domain *); |
101 | int (*set_client)(struct svc_rqst *rq); | 101 | int (*set_client)(struct svc_rqst *rq); |
@@ -112,7 +112,7 @@ struct auth_ops { | |||
112 | #define SVC_COMPLETE 9 | 112 | #define SVC_COMPLETE 9 |
113 | 113 | ||
114 | 114 | ||
115 | extern int svc_authenticate(struct svc_rqst *rqstp, u32 *authp); | 115 | extern int svc_authenticate(struct svc_rqst *rqstp, __be32 *authp); |
116 | extern int svc_authorise(struct svc_rqst *rqstp); | 116 | extern int svc_authorise(struct svc_rqst *rqstp); |
117 | extern int svc_set_client(struct svc_rqst *rqstp); | 117 | extern int svc_set_client(struct svc_rqst *rqstp); |
118 | extern int svc_auth_register(rpc_authflavor_t flavor, struct auth_ops *aops); | 118 | extern int svc_auth_register(rpc_authflavor_t flavor, struct auth_ops *aops); |
@@ -126,6 +126,7 @@ extern struct auth_domain *auth_domain_find(char *name); | |||
126 | extern struct auth_domain *auth_unix_lookup(struct in_addr addr); | 126 | extern struct auth_domain *auth_unix_lookup(struct in_addr addr); |
127 | extern int auth_unix_forget_old(struct auth_domain *dom); | 127 | extern int auth_unix_forget_old(struct auth_domain *dom); |
128 | extern void svcauth_unix_purge(void); | 128 | extern void svcauth_unix_purge(void); |
129 | extern void svcauth_unix_info_release(void *); | ||
129 | 130 | ||
130 | static inline unsigned long hash_str(char *name, int bits) | 131 | static inline unsigned long hash_str(char *name, int bits) |
131 | { | 132 | { |
diff --git a/include/linux/sunrpc/svcauth_gss.h b/include/linux/sunrpc/svcauth_gss.h index 3a2206f61de0..5a5db16ab660 100644 --- a/include/linux/sunrpc/svcauth_gss.h +++ b/include/linux/sunrpc/svcauth_gss.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/include/linux/svcauth_gss.h | 2 | * linux/include/linux/sunrpc/svcauth_gss.h |
3 | * | 3 | * |
4 | * Bruce Fields <bfields@umich.edu> | 4 | * Bruce Fields <bfields@umich.edu> |
5 | * Copyright (c) 2002 The Regents of the Unviersity of Michigan | 5 | * Copyright (c) 2002 The Regents of the Unviersity of Michigan |
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h index b4acb3d37c3f..98b21ad370fd 100644 --- a/include/linux/sunrpc/svcsock.h +++ b/include/linux/sunrpc/svcsock.h | |||
@@ -20,8 +20,9 @@ struct svc_sock { | |||
20 | struct socket * sk_sock; /* berkeley socket layer */ | 20 | struct socket * sk_sock; /* berkeley socket layer */ |
21 | struct sock * sk_sk; /* INET layer */ | 21 | struct sock * sk_sk; /* INET layer */ |
22 | 22 | ||
23 | struct svc_pool * sk_pool; /* current pool iff queued */ | ||
23 | struct svc_serv * sk_server; /* service for this socket */ | 24 | struct svc_serv * sk_server; /* service for this socket */ |
24 | unsigned int sk_inuse; /* use count */ | 25 | atomic_t sk_inuse; /* use count */ |
25 | unsigned long sk_flags; | 26 | unsigned long sk_flags; |
26 | #define SK_BUSY 0 /* enqueued/receiving */ | 27 | #define SK_BUSY 0 /* enqueued/receiving */ |
27 | #define SK_CONN 1 /* conn pending */ | 28 | #define SK_CONN 1 /* conn pending */ |
@@ -31,9 +32,12 @@ struct svc_sock { | |||
31 | #define SK_DEAD 6 /* socket closed */ | 32 | #define SK_DEAD 6 /* socket closed */ |
32 | #define SK_CHNGBUF 7 /* need to change snd/rcv buffer sizes */ | 33 | #define SK_CHNGBUF 7 /* need to change snd/rcv buffer sizes */ |
33 | #define SK_DEFERRED 8 /* request on sk_deferred */ | 34 | #define SK_DEFERRED 8 /* request on sk_deferred */ |
35 | #define SK_OLD 9 /* used for temp socket aging mark+sweep */ | ||
36 | #define SK_DETACHED 10 /* detached from tempsocks list */ | ||
34 | 37 | ||
35 | int sk_reserved; /* space on outq that is reserved */ | 38 | atomic_t sk_reserved; /* space on outq that is reserved */ |
36 | 39 | ||
40 | spinlock_t sk_defer_lock; /* protects sk_deferred */ | ||
37 | struct list_head sk_deferred; /* deferred requests that need to | 41 | struct list_head sk_deferred; /* deferred requests that need to |
38 | * be revisted */ | 42 | * be revisted */ |
39 | struct mutex sk_mutex; /* to serialize sending data */ | 43 | struct mutex sk_mutex; /* to serialize sending data */ |
@@ -50,6 +54,9 @@ struct svc_sock { | |||
50 | int sk_reclen; /* length of record */ | 54 | int sk_reclen; /* length of record */ |
51 | int sk_tcplen; /* current read length */ | 55 | int sk_tcplen; /* current read length */ |
52 | time_t sk_lastrecv; /* time of last received request */ | 56 | time_t sk_lastrecv; /* time of last received request */ |
57 | |||
58 | /* cache of various info for TCP sockets */ | ||
59 | void *sk_info_authunix; | ||
53 | }; | 60 | }; |
54 | 61 | ||
55 | /* | 62 | /* |
@@ -57,9 +64,14 @@ struct svc_sock { | |||
57 | */ | 64 | */ |
58 | int svc_makesock(struct svc_serv *, int, unsigned short); | 65 | int svc_makesock(struct svc_serv *, int, unsigned short); |
59 | void svc_delete_socket(struct svc_sock *); | 66 | void svc_delete_socket(struct svc_sock *); |
60 | int svc_recv(struct svc_serv *, struct svc_rqst *, long); | 67 | int svc_recv(struct svc_rqst *, long); |
61 | int svc_send(struct svc_rqst *); | 68 | int svc_send(struct svc_rqst *); |
62 | void svc_drop(struct svc_rqst *); | 69 | void svc_drop(struct svc_rqst *); |
63 | void svc_sock_update_bufs(struct svc_serv *serv); | 70 | void svc_sock_update_bufs(struct svc_serv *serv); |
71 | int svc_sock_names(char *buf, struct svc_serv *serv, char *toclose); | ||
72 | int svc_addsock(struct svc_serv *serv, | ||
73 | int fd, | ||
74 | char *name_return, | ||
75 | int *proto); | ||
64 | 76 | ||
65 | #endif /* SUNRPC_SVCSOCK_H */ | 77 | #endif /* SUNRPC_SVCSOCK_H */ |
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h index e6d3d349506c..953723b09bc6 100644 --- a/include/linux/sunrpc/xdr.h +++ b/include/linux/sunrpc/xdr.h | |||
@@ -32,7 +32,7 @@ struct xdr_netobj { | |||
32 | * side) or svc_rqst pointer (server side). | 32 | * side) or svc_rqst pointer (server side). |
33 | * Encode functions always assume there's enough room in the buffer. | 33 | * Encode functions always assume there's enough room in the buffer. |
34 | */ | 34 | */ |
35 | typedef int (*kxdrproc_t)(void *rqstp, u32 *data, void *obj); | 35 | typedef int (*kxdrproc_t)(void *rqstp, __be32 *data, void *obj); |
36 | 36 | ||
37 | /* | 37 | /* |
38 | * Basic structure for transmission/reception of a client XDR message. | 38 | * Basic structure for transmission/reception of a client XDR message. |
@@ -88,19 +88,19 @@ struct xdr_buf { | |||
88 | /* | 88 | /* |
89 | * Miscellaneous XDR helper functions | 89 | * Miscellaneous XDR helper functions |
90 | */ | 90 | */ |
91 | u32 * xdr_encode_opaque_fixed(u32 *p, const void *ptr, unsigned int len); | 91 | __be32 *xdr_encode_opaque_fixed(__be32 *p, const void *ptr, unsigned int len); |
92 | u32 * xdr_encode_opaque(u32 *p, const void *ptr, unsigned int len); | 92 | __be32 *xdr_encode_opaque(__be32 *p, const void *ptr, unsigned int len); |
93 | u32 * xdr_encode_string(u32 *p, const char *s); | 93 | __be32 *xdr_encode_string(__be32 *p, const char *s); |
94 | u32 * xdr_decode_string_inplace(u32 *p, char **sp, int *lenp, int maxlen); | 94 | __be32 *xdr_decode_string_inplace(__be32 *p, char **sp, int *lenp, int maxlen); |
95 | u32 * xdr_encode_netobj(u32 *p, const struct xdr_netobj *); | 95 | __be32 *xdr_encode_netobj(__be32 *p, const struct xdr_netobj *); |
96 | u32 * xdr_decode_netobj(u32 *p, struct xdr_netobj *); | 96 | __be32 *xdr_decode_netobj(__be32 *p, struct xdr_netobj *); |
97 | 97 | ||
98 | void xdr_encode_pages(struct xdr_buf *, struct page **, unsigned int, | 98 | void xdr_encode_pages(struct xdr_buf *, struct page **, unsigned int, |
99 | unsigned int); | 99 | unsigned int); |
100 | void xdr_inline_pages(struct xdr_buf *, unsigned int, | 100 | void xdr_inline_pages(struct xdr_buf *, unsigned int, |
101 | struct page **, unsigned int, unsigned int); | 101 | struct page **, unsigned int, unsigned int); |
102 | 102 | ||
103 | static inline u32 *xdr_encode_array(u32 *p, const void *s, unsigned int len) | 103 | static inline __be32 *xdr_encode_array(__be32 *p, const void *s, unsigned int len) |
104 | { | 104 | { |
105 | return xdr_encode_opaque(p, s, len); | 105 | return xdr_encode_opaque(p, s, len); |
106 | } | 106 | } |
@@ -108,16 +108,16 @@ static inline u32 *xdr_encode_array(u32 *p, const void *s, unsigned int len) | |||
108 | /* | 108 | /* |
109 | * Decode 64bit quantities (NFSv3 support) | 109 | * Decode 64bit quantities (NFSv3 support) |
110 | */ | 110 | */ |
111 | static inline u32 * | 111 | static inline __be32 * |
112 | xdr_encode_hyper(u32 *p, __u64 val) | 112 | xdr_encode_hyper(__be32 *p, __u64 val) |
113 | { | 113 | { |
114 | *p++ = htonl(val >> 32); | 114 | *p++ = htonl(val >> 32); |
115 | *p++ = htonl(val & 0xFFFFFFFF); | 115 | *p++ = htonl(val & 0xFFFFFFFF); |
116 | return p; | 116 | return p; |
117 | } | 117 | } |
118 | 118 | ||
119 | static inline u32 * | 119 | static inline __be32 * |
120 | xdr_decode_hyper(u32 *p, __u64 *valp) | 120 | xdr_decode_hyper(__be32 *p, __u64 *valp) |
121 | { | 121 | { |
122 | *valp = ((__u64) ntohl(*p++)) << 32; | 122 | *valp = ((__u64) ntohl(*p++)) << 32; |
123 | *valp |= ntohl(*p++); | 123 | *valp |= ntohl(*p++); |
@@ -128,7 +128,7 @@ xdr_decode_hyper(u32 *p, __u64 *valp) | |||
128 | * Adjust kvec to reflect end of xdr'ed data (RPC client XDR) | 128 | * Adjust kvec to reflect end of xdr'ed data (RPC client XDR) |
129 | */ | 129 | */ |
130 | static inline int | 130 | static inline int |
131 | xdr_adjust_iovec(struct kvec *iov, u32 *p) | 131 | xdr_adjust_iovec(struct kvec *iov, __be32 *p) |
132 | { | 132 | { |
133 | return iov->iov_len = ((u8 *) p - (u8 *) iov->iov_base); | 133 | return iov->iov_len = ((u8 *) p - (u8 *) iov->iov_base); |
134 | } | 134 | } |
@@ -180,19 +180,19 @@ extern int xdr_encode_array2(struct xdr_buf *buf, unsigned int base, | |||
180 | * Provide some simple tools for XDR buffer overflow-checking etc. | 180 | * Provide some simple tools for XDR buffer overflow-checking etc. |
181 | */ | 181 | */ |
182 | struct xdr_stream { | 182 | struct xdr_stream { |
183 | uint32_t *p; /* start of available buffer */ | 183 | __be32 *p; /* start of available buffer */ |
184 | struct xdr_buf *buf; /* XDR buffer to read/write */ | 184 | struct xdr_buf *buf; /* XDR buffer to read/write */ |
185 | 185 | ||
186 | uint32_t *end; /* end of available buffer space */ | 186 | __be32 *end; /* end of available buffer space */ |
187 | struct kvec *iov; /* pointer to the current kvec */ | 187 | struct kvec *iov; /* pointer to the current kvec */ |
188 | }; | 188 | }; |
189 | 189 | ||
190 | extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, uint32_t *p); | 190 | extern void xdr_init_encode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); |
191 | extern uint32_t *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes); | 191 | extern __be32 *xdr_reserve_space(struct xdr_stream *xdr, size_t nbytes); |
192 | extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, | 192 | extern void xdr_write_pages(struct xdr_stream *xdr, struct page **pages, |
193 | unsigned int base, unsigned int len); | 193 | unsigned int base, unsigned int len); |
194 | extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, uint32_t *p); | 194 | extern void xdr_init_decode(struct xdr_stream *xdr, struct xdr_buf *buf, __be32 *p); |
195 | extern uint32_t *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); | 195 | extern __be32 *xdr_inline_decode(struct xdr_stream *xdr, size_t nbytes); |
196 | extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len); | 196 | extern void xdr_read_pages(struct xdr_stream *xdr, unsigned int len); |
197 | extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len); | 197 | extern void xdr_enter_page(struct xdr_stream *xdr, unsigned int len); |
198 | 198 | ||
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h index bdeba8538c71..60394fbc4c70 100644 --- a/include/linux/sunrpc/xprt.h +++ b/include/linux/sunrpc/xprt.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/kref.h> | 15 | #include <linux/kref.h> |
16 | #include <linux/sunrpc/sched.h> | 16 | #include <linux/sunrpc/sched.h> |
17 | #include <linux/sunrpc/xdr.h> | 17 | #include <linux/sunrpc/xdr.h> |
18 | #include <linux/sunrpc/msg_prot.h> | ||
18 | 19 | ||
19 | extern unsigned int xprt_udp_slot_table_entries; | 20 | extern unsigned int xprt_udp_slot_table_entries; |
20 | extern unsigned int xprt_tcp_slot_table_entries; | 21 | extern unsigned int xprt_tcp_slot_table_entries; |
@@ -24,13 +25,6 @@ extern unsigned int xprt_tcp_slot_table_entries; | |||
24 | #define RPC_MAX_SLOT_TABLE (128U) | 25 | #define RPC_MAX_SLOT_TABLE (128U) |
25 | 26 | ||
26 | /* | 27 | /* |
27 | * RPC call and reply header size as number of 32bit words (verifier | ||
28 | * size computed separately) | ||
29 | */ | ||
30 | #define RPC_CALLHDRSIZE 6 | ||
31 | #define RPC_REPHDRSIZE 4 | ||
32 | |||
33 | /* | ||
34 | * Parameters for choosing a free port | 28 | * Parameters for choosing a free port |
35 | */ | 29 | */ |
36 | extern unsigned int xprt_min_resvport; | 30 | extern unsigned int xprt_min_resvport; |
@@ -79,7 +73,7 @@ struct rpc_rqst { | |||
79 | * This is the private part | 73 | * This is the private part |
80 | */ | 74 | */ |
81 | struct rpc_task * rq_task; /* RPC task data */ | 75 | struct rpc_task * rq_task; /* RPC task data */ |
82 | __u32 rq_xid; /* request XID */ | 76 | __be32 rq_xid; /* request XID */ |
83 | int rq_cong; /* has incremented xprt->cong */ | 77 | int rq_cong; /* has incremented xprt->cong */ |
84 | int rq_received; /* receive completed */ | 78 | int rq_received; /* receive completed */ |
85 | u32 rq_seqno; /* gss seq no. used on req. */ | 79 | u32 rq_seqno; /* gss seq no. used on req. */ |
@@ -171,9 +165,9 @@ struct rpc_xprt { | |||
171 | /* | 165 | /* |
172 | * State of TCP reply receive stuff | 166 | * State of TCP reply receive stuff |
173 | */ | 167 | */ |
174 | u32 tcp_recm, /* Fragment header */ | 168 | __be32 tcp_recm, /* Fragment header */ |
175 | tcp_xid, /* Current XID */ | 169 | tcp_xid; /* Current XID */ |
176 | tcp_reclen, /* fragment length */ | 170 | u32 tcp_reclen, /* fragment length */ |
177 | tcp_offset; /* fragment offset */ | 171 | tcp_offset; /* fragment offset */ |
178 | unsigned long tcp_copied, /* copied to request */ | 172 | unsigned long tcp_copied, /* copied to request */ |
179 | tcp_flags; | 173 | tcp_flags; |
@@ -253,7 +247,7 @@ void xprt_release(struct rpc_task *task); | |||
253 | struct rpc_xprt * xprt_get(struct rpc_xprt *xprt); | 247 | struct rpc_xprt * xprt_get(struct rpc_xprt *xprt); |
254 | void xprt_put(struct rpc_xprt *xprt); | 248 | void xprt_put(struct rpc_xprt *xprt); |
255 | 249 | ||
256 | static inline u32 *xprt_skip_transport_header(struct rpc_xprt *xprt, u32 *p) | 250 | static inline __be32 *xprt_skip_transport_header(struct rpc_xprt *xprt, __be32 *p) |
257 | { | 251 | { |
258 | return p + xprt->tsh_size; | 252 | return p + xprt->tsh_size; |
259 | } | 253 | } |
@@ -268,7 +262,7 @@ void xprt_wait_for_buffer_space(struct rpc_task *task); | |||
268 | void xprt_write_space(struct rpc_xprt *xprt); | 262 | void xprt_write_space(struct rpc_xprt *xprt); |
269 | void xprt_update_rtt(struct rpc_task *task); | 263 | void xprt_update_rtt(struct rpc_task *task); |
270 | void xprt_adjust_cwnd(struct rpc_task *task, int result); | 264 | void xprt_adjust_cwnd(struct rpc_task *task, int result); |
271 | struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, u32 xid); | 265 | struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid); |
272 | void xprt_complete_rqst(struct rpc_task *task, int copied); | 266 | void xprt_complete_rqst(struct rpc_task *task, int copied); |
273 | void xprt_release_rqst_cong(struct rpc_task *task); | 267 | void xprt_release_rqst_cong(struct rpc_task *task); |
274 | void xprt_disconnect(struct rpc_xprt *xprt); | 268 | void xprt_disconnect(struct rpc_xprt *xprt); |
diff --git a/include/linux/synclink.h b/include/linux/synclink.h index 0577f5284cbc..c8b042667af1 100644 --- a/include/linux/synclink.h +++ b/include/linux/synclink.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * SyncLink Multiprotocol Serial Adapter Driver | 2 | * SyncLink Multiprotocol Serial Adapter Driver |
3 | * | 3 | * |
4 | * $Id: synclink.h,v 3.13 2006/05/23 18:25:06 paulkf Exp $ | 4 | * $Id: synclink.h,v 3.14 2006/07/17 20:15:43 paulkf Exp $ |
5 | * | 5 | * |
6 | * Copyright (C) 1998-2000 by Microgate Corporation | 6 | * Copyright (C) 1998-2000 by Microgate Corporation |
7 | * | 7 | * |
@@ -124,6 +124,8 @@ | |||
124 | 124 | ||
125 | #define MGSL_MODE_ASYNC 1 | 125 | #define MGSL_MODE_ASYNC 1 |
126 | #define MGSL_MODE_HDLC 2 | 126 | #define MGSL_MODE_HDLC 2 |
127 | #define MGSL_MODE_MONOSYNC 3 | ||
128 | #define MGSL_MODE_BISYNC 4 | ||
127 | #define MGSL_MODE_RAW 6 | 129 | #define MGSL_MODE_RAW 6 |
128 | 130 | ||
129 | #define MGSL_BUS_TYPE_ISA 1 | 131 | #define MGSL_BUS_TYPE_ISA 1 |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index 008f04c56737..3efcfc7e9c6c 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -53,6 +53,7 @@ struct mq_attr; | |||
53 | struct compat_stat; | 53 | struct compat_stat; |
54 | struct compat_timeval; | 54 | struct compat_timeval; |
55 | struct robust_list_head; | 55 | struct robust_list_head; |
56 | struct getcpu_cache; | ||
56 | 57 | ||
57 | #include <linux/types.h> | 58 | #include <linux/types.h> |
58 | #include <linux/aio_abi.h> | 59 | #include <linux/aio_abi.h> |
@@ -596,5 +597,8 @@ asmlinkage long sys_get_robust_list(int pid, | |||
596 | size_t __user *len_ptr); | 597 | size_t __user *len_ptr); |
597 | asmlinkage long sys_set_robust_list(struct robust_list_head __user *head, | 598 | asmlinkage long sys_set_robust_list(struct robust_list_head __user *head, |
598 | size_t len); | 599 | size_t len); |
600 | asmlinkage long sys_getcpu(unsigned __user *cpu, unsigned __user *node, struct getcpu_cache __user *cache); | ||
601 | |||
602 | int kernel_execve(const char *filename, char *const argv[], char *const envp[]); | ||
599 | 603 | ||
600 | #endif | 604 | #endif |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index eca555781d05..1b24bd45e080 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -150,6 +150,8 @@ enum | |||
150 | KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */ | 150 | KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */ |
151 | KERN_COMPAT_LOG=73, /* int: print compat layer messages */ | 151 | KERN_COMPAT_LOG=73, /* int: print compat layer messages */ |
152 | KERN_MAX_LOCK_DEPTH=74, | 152 | KERN_MAX_LOCK_DEPTH=74, |
153 | KERN_NMI_WATCHDOG=75, /* int: enable/disable nmi watchdog */ | ||
154 | KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */ | ||
153 | }; | 155 | }; |
154 | 156 | ||
155 | 157 | ||
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h index 1ea5d3cda6ae..6d5c43d31dec 100644 --- a/include/linux/sysfs.h +++ b/include/linux/sysfs.h | |||
@@ -10,6 +10,7 @@ | |||
10 | #ifndef _SYSFS_H_ | 10 | #ifndef _SYSFS_H_ |
11 | #define _SYSFS_H_ | 11 | #define _SYSFS_H_ |
12 | 12 | ||
13 | #include <linux/compiler.h> | ||
13 | #include <asm/atomic.h> | 14 | #include <asm/atomic.h> |
14 | 15 | ||
15 | struct kobject; | 16 | struct kobject; |
@@ -86,40 +87,44 @@ struct sysfs_dirent { | |||
86 | 87 | ||
87 | #ifdef CONFIG_SYSFS | 88 | #ifdef CONFIG_SYSFS |
88 | 89 | ||
89 | extern int | 90 | extern int __must_check |
90 | sysfs_create_dir(struct kobject *); | 91 | sysfs_create_dir(struct kobject *); |
91 | 92 | ||
92 | extern void | 93 | extern void |
93 | sysfs_remove_dir(struct kobject *); | 94 | sysfs_remove_dir(struct kobject *); |
94 | 95 | ||
95 | extern int | 96 | extern int __must_check |
96 | sysfs_rename_dir(struct kobject *, const char *new_name); | 97 | sysfs_rename_dir(struct kobject *, const char *new_name); |
97 | 98 | ||
98 | extern int | 99 | extern int __must_check |
99 | sysfs_create_file(struct kobject *, const struct attribute *); | 100 | sysfs_create_file(struct kobject *, const struct attribute *); |
100 | 101 | ||
101 | extern int | 102 | extern int __must_check |
102 | sysfs_update_file(struct kobject *, const struct attribute *); | 103 | sysfs_update_file(struct kobject *, const struct attribute *); |
103 | 104 | ||
104 | extern int | 105 | extern int __must_check |
105 | sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode); | 106 | sysfs_chmod_file(struct kobject *kobj, struct attribute *attr, mode_t mode); |
106 | 107 | ||
107 | extern void | 108 | extern void |
108 | sysfs_remove_file(struct kobject *, const struct attribute *); | 109 | sysfs_remove_file(struct kobject *, const struct attribute *); |
109 | 110 | ||
110 | extern int | 111 | extern int __must_check |
111 | sysfs_create_link(struct kobject * kobj, struct kobject * target, const char * name); | 112 | sysfs_create_link(struct kobject * kobj, struct kobject * target, const char * name); |
112 | 113 | ||
113 | extern void | 114 | extern void |
114 | sysfs_remove_link(struct kobject *, const char * name); | 115 | sysfs_remove_link(struct kobject *, const char * name); |
115 | 116 | ||
116 | int sysfs_create_bin_file(struct kobject * kobj, struct bin_attribute * attr); | 117 | int __must_check sysfs_create_bin_file(struct kobject *kobj, |
117 | int sysfs_remove_bin_file(struct kobject * kobj, struct bin_attribute * attr); | 118 | struct bin_attribute *attr); |
119 | void sysfs_remove_bin_file(struct kobject *kobj, struct bin_attribute *attr); | ||
118 | 120 | ||
119 | int sysfs_create_group(struct kobject *, const struct attribute_group *); | 121 | int __must_check sysfs_create_group(struct kobject *, |
122 | const struct attribute_group *); | ||
120 | void sysfs_remove_group(struct kobject *, const struct attribute_group *); | 123 | void sysfs_remove_group(struct kobject *, const struct attribute_group *); |
121 | void sysfs_notify(struct kobject * k, char *dir, char *attr); | 124 | void sysfs_notify(struct kobject * k, char *dir, char *attr); |
122 | 125 | ||
126 | extern int __must_check sysfs_init(void); | ||
127 | |||
123 | #else /* CONFIG_SYSFS */ | 128 | #else /* CONFIG_SYSFS */ |
124 | 129 | ||
125 | static inline int sysfs_create_dir(struct kobject * k) | 130 | static inline int sysfs_create_dir(struct kobject * k) |
@@ -191,6 +196,11 @@ static inline void sysfs_notify(struct kobject * k, char *dir, char *attr) | |||
191 | { | 196 | { |
192 | } | 197 | } |
193 | 198 | ||
199 | static inline int __must_check sysfs_init(void) | ||
200 | { | ||
201 | return 0; | ||
202 | } | ||
203 | |||
194 | #endif /* CONFIG_SYSFS */ | 204 | #endif /* CONFIG_SYSFS */ |
195 | 205 | ||
196 | #endif /* _SYSFS_H_ */ | 206 | #endif /* _SYSFS_H_ */ |
diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h index 4812ff60561c..e657e523b9bf 100644 --- a/include/linux/sysrq.h +++ b/include/linux/sysrq.h | |||
@@ -11,6 +11,8 @@ | |||
11 | * based upon discusions in irc://irc.openprojects.net/#kernelnewbies | 11 | * based upon discusions in irc://irc.openprojects.net/#kernelnewbies |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #ifndef _LINUX_SYSRQ_H | ||
15 | #define _LINUX_SYSRQ_H | ||
14 | 16 | ||
15 | struct pt_regs; | 17 | struct pt_regs; |
16 | struct tty_struct; | 18 | struct tty_struct; |
@@ -57,3 +59,5 @@ static inline int __reterr(void) | |||
57 | #define unregister_sysrq_key(ig,nore) __reterr() | 59 | #define unregister_sysrq_key(ig,nore) __reterr() |
58 | 60 | ||
59 | #endif | 61 | #endif |
62 | |||
63 | #endif /* _LINUX_SYSRQ_H */ | ||
diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h index f1cb6cddd19d..45248806ae9c 100644 --- a/include/linux/taskstats.h +++ b/include/linux/taskstats.h | |||
@@ -2,6 +2,7 @@ | |||
2 | * | 2 | * |
3 | * Copyright (C) Shailabh Nagar, IBM Corp. 2006 | 3 | * Copyright (C) Shailabh Nagar, IBM Corp. 2006 |
4 | * (C) Balbir Singh, IBM Corp. 2006 | 4 | * (C) Balbir Singh, IBM Corp. 2006 |
5 | * (C) Jay Lan, SGI, 2006 | ||
5 | * | 6 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 7 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms of version 2.1 of the GNU Lesser General Public License | 8 | * under the terms of version 2.1 of the GNU Lesser General Public License |
@@ -29,16 +30,25 @@ | |||
29 | * c) add new fields after version comment; maintain 64-bit alignment | 30 | * c) add new fields after version comment; maintain 64-bit alignment |
30 | */ | 31 | */ |
31 | 32 | ||
32 | #define TASKSTATS_VERSION 1 | 33 | |
34 | #define TASKSTATS_VERSION 2 | ||
35 | #define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN | ||
36 | * in linux/sched.h */ | ||
33 | 37 | ||
34 | struct taskstats { | 38 | struct taskstats { |
35 | 39 | ||
36 | /* Version 1 */ | 40 | /* The version number of this struct. This field is always set to |
41 | * TAKSTATS_VERSION, which is defined in <linux/taskstats.h>. | ||
42 | * Each time the struct is changed, the value should be incremented. | ||
43 | */ | ||
37 | __u16 version; | 44 | __u16 version; |
38 | __u16 padding[3]; /* Userspace should not interpret the padding | 45 | __u32 ac_exitcode; /* Exit status */ |
39 | * field which can be replaced by useful | 46 | |
40 | * fields if struct taskstats is extended. | 47 | /* The accounting flags of a task as defined in <linux/acct.h> |
41 | */ | 48 | * Defined values are AFORK, ASU, ACOMPAT, ACORE, and AXSIG. |
49 | */ | ||
50 | __u8 ac_flag; /* Record flags */ | ||
51 | __u8 ac_nice; /* task_nice */ | ||
42 | 52 | ||
43 | /* Delay accounting fields start | 53 | /* Delay accounting fields start |
44 | * | 54 | * |
@@ -88,6 +98,48 @@ struct taskstats { | |||
88 | __u64 cpu_run_virtual_total; | 98 | __u64 cpu_run_virtual_total; |
89 | /* Delay accounting fields end */ | 99 | /* Delay accounting fields end */ |
90 | /* version 1 ends here */ | 100 | /* version 1 ends here */ |
101 | |||
102 | /* Basic Accounting Fields start */ | ||
103 | char ac_comm[TS_COMM_LEN]; /* Command name */ | ||
104 | __u8 ac_sched; /* Scheduling discipline */ | ||
105 | __u8 ac_pad[3]; | ||
106 | __u32 ac_uid; /* User ID */ | ||
107 | __u32 ac_gid; /* Group ID */ | ||
108 | __u32 ac_pid; /* Process ID */ | ||
109 | __u32 ac_ppid; /* Parent process ID */ | ||
110 | __u32 ac_btime; /* Begin time [sec since 1970] */ | ||
111 | __u64 ac_etime; /* Elapsed time [usec] */ | ||
112 | __u64 ac_utime; /* User CPU time [usec] */ | ||
113 | __u64 ac_stime; /* SYstem CPU time [usec] */ | ||
114 | __u64 ac_minflt; /* Minor Page Fault Count */ | ||
115 | __u64 ac_majflt; /* Major Page Fault Count */ | ||
116 | /* Basic Accounting Fields end */ | ||
117 | |||
118 | /* Extended accounting fields start */ | ||
119 | /* Accumulated RSS usage in duration of a task, in MBytes-usecs. | ||
120 | * The current rss usage is added to this counter every time | ||
121 | * a tick is charged to a task's system time. So, at the end we | ||
122 | * will have memory usage multiplied by system time. Thus an | ||
123 | * average usage per system time unit can be calculated. | ||
124 | */ | ||
125 | __u64 coremem; /* accumulated RSS usage in MB-usec */ | ||
126 | /* Accumulated virtual memory usage in duration of a task. | ||
127 | * Same as acct_rss_mem1 above except that we keep track of VM usage. | ||
128 | */ | ||
129 | __u64 virtmem; /* accumulated VM usage in MB-usec */ | ||
130 | |||
131 | /* High watermark of RSS and virtual memory usage in duration of | ||
132 | * a task, in KBytes. | ||
133 | */ | ||
134 | __u64 hiwater_rss; /* High-watermark of RSS usage, in KB */ | ||
135 | __u64 hiwater_vm; /* High-water VM usage, in KB */ | ||
136 | |||
137 | /* The following four fields are I/O statistics of a task. */ | ||
138 | __u64 read_char; /* bytes read */ | ||
139 | __u64 write_char; /* bytes written */ | ||
140 | __u64 read_syscalls; /* read syscalls */ | ||
141 | __u64 write_syscalls; /* write syscalls */ | ||
142 | /* Extended accounting fields end */ | ||
91 | }; | 143 | }; |
92 | 144 | ||
93 | 145 | ||
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 8ebf497907f8..0e058a2d1c6d 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -21,10 +21,10 @@ | |||
21 | #include <asm/byteorder.h> | 21 | #include <asm/byteorder.h> |
22 | 22 | ||
23 | struct tcphdr { | 23 | struct tcphdr { |
24 | __u16 source; | 24 | __be16 source; |
25 | __u16 dest; | 25 | __be16 dest; |
26 | __u32 seq; | 26 | __be32 seq; |
27 | __u32 ack_seq; | 27 | __be32 ack_seq; |
28 | #if defined(__LITTLE_ENDIAN_BITFIELD) | 28 | #if defined(__LITTLE_ENDIAN_BITFIELD) |
29 | __u16 res1:4, | 29 | __u16 res1:4, |
30 | doff:4, | 30 | doff:4, |
@@ -50,9 +50,9 @@ struct tcphdr { | |||
50 | #else | 50 | #else |
51 | #error "Adjust your <asm/byteorder.h> defines" | 51 | #error "Adjust your <asm/byteorder.h> defines" |
52 | #endif | 52 | #endif |
53 | __u16 window; | 53 | __be16 window; |
54 | __u16 check; | 54 | __be16 check; |
55 | __u16 urg_ptr; | 55 | __be16 urg_ptr; |
56 | }; | 56 | }; |
57 | 57 | ||
58 | /* | 58 | /* |
@@ -62,7 +62,7 @@ struct tcphdr { | |||
62 | */ | 62 | */ |
63 | union tcp_word_hdr { | 63 | union tcp_word_hdr { |
64 | struct tcphdr hdr; | 64 | struct tcphdr hdr; |
65 | __u32 words[5]; | 65 | __be32 words[5]; |
66 | }; | 66 | }; |
67 | 67 | ||
68 | #define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3]) | 68 | #define tcp_flag_word(tp) ( ((union tcp_word_hdr *)(tp))->words [3]) |
@@ -166,6 +166,11 @@ struct tcp_info | |||
166 | #include <net/inet_timewait_sock.h> | 166 | #include <net/inet_timewait_sock.h> |
167 | 167 | ||
168 | /* This defines a selective acknowledgement block. */ | 168 | /* This defines a selective acknowledgement block. */ |
169 | struct tcp_sack_block_wire { | ||
170 | __be32 start_seq; | ||
171 | __be32 end_seq; | ||
172 | }; | ||
173 | |||
169 | struct tcp_sack_block { | 174 | struct tcp_sack_block { |
170 | __u32 start_seq; | 175 | __u32 start_seq; |
171 | __u32 end_seq; | 176 | __u32 end_seq; |
@@ -211,7 +216,7 @@ struct tcp_sock { | |||
211 | * Header prediction flags | 216 | * Header prediction flags |
212 | * 0x5?10 << 16 + snd_wnd in net byte order | 217 | * 0x5?10 << 16 + snd_wnd in net byte order |
213 | */ | 218 | */ |
214 | __u32 pred_flags; | 219 | __be32 pred_flags; |
215 | 220 | ||
216 | /* | 221 | /* |
217 | * RFC793 variables by their proper names. This means you can | 222 | * RFC793 variables by their proper names. This means you can |
diff --git a/include/linux/tifm.h b/include/linux/tifm.h new file mode 100644 index 000000000000..203dd5e11ecb --- /dev/null +++ b/include/linux/tifm.h | |||
@@ -0,0 +1,158 @@ | |||
1 | /* | ||
2 | * tifm.h - TI FlashMedia driver | ||
3 | * | ||
4 | * Copyright (C) 2006 Alex Dubov <oakad@yahoo.com> | ||
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 _TIFM_H | ||
13 | #define _TIFM_H | ||
14 | |||
15 | #include <linux/spinlock.h> | ||
16 | #include <linux/interrupt.h> | ||
17 | #include <linux/wait.h> | ||
18 | #include <linux/delay.h> | ||
19 | #include <linux/pci.h> | ||
20 | |||
21 | /* Host registers (relative to pci base address): */ | ||
22 | enum { | ||
23 | FM_SET_INTERRUPT_ENABLE = 0x008, | ||
24 | FM_CLEAR_INTERRUPT_ENABLE = 0x00c, | ||
25 | FM_INTERRUPT_STATUS = 0x014 }; | ||
26 | |||
27 | /* Socket registers (relative to socket base address): */ | ||
28 | enum { | ||
29 | SOCK_CONTROL = 0x004, | ||
30 | SOCK_PRESENT_STATE = 0x008, | ||
31 | SOCK_DMA_ADDRESS = 0x00c, | ||
32 | SOCK_DMA_CONTROL = 0x010, | ||
33 | SOCK_DMA_FIFO_INT_ENABLE_SET = 0x014, | ||
34 | SOCK_DMA_FIFO_INT_ENABLE_CLEAR = 0x018, | ||
35 | SOCK_DMA_FIFO_STATUS = 0x020, | ||
36 | SOCK_FIFO_CONTROL = 0x024, | ||
37 | SOCK_FIFO_PAGE_SIZE = 0x028, | ||
38 | SOCK_MMCSD_COMMAND = 0x104, | ||
39 | SOCK_MMCSD_ARG_LOW = 0x108, | ||
40 | SOCK_MMCSD_ARG_HIGH = 0x10c, | ||
41 | SOCK_MMCSD_CONFIG = 0x110, | ||
42 | SOCK_MMCSD_STATUS = 0x114, | ||
43 | SOCK_MMCSD_INT_ENABLE = 0x118, | ||
44 | SOCK_MMCSD_COMMAND_TO = 0x11c, | ||
45 | SOCK_MMCSD_DATA_TO = 0x120, | ||
46 | SOCK_MMCSD_DATA = 0x124, | ||
47 | SOCK_MMCSD_BLOCK_LEN = 0x128, | ||
48 | SOCK_MMCSD_NUM_BLOCKS = 0x12c, | ||
49 | SOCK_MMCSD_BUFFER_CONFIG = 0x130, | ||
50 | SOCK_MMCSD_SPI_CONFIG = 0x134, | ||
51 | SOCK_MMCSD_SDIO_MODE_CONFIG = 0x138, | ||
52 | SOCK_MMCSD_RESPONSE = 0x144, | ||
53 | SOCK_MMCSD_SDIO_SR = 0x164, | ||
54 | SOCK_MMCSD_SYSTEM_CONTROL = 0x168, | ||
55 | SOCK_MMCSD_SYSTEM_STATUS = 0x16c, | ||
56 | SOCK_MS_COMMAND = 0x184, | ||
57 | SOCK_MS_DATA = 0x188, | ||
58 | SOCK_MS_STATUS = 0x18c, | ||
59 | SOCK_MS_SYSTEM = 0x190, | ||
60 | SOCK_FIFO_ACCESS = 0x200 }; | ||
61 | |||
62 | |||
63 | #define TIFM_IRQ_ENABLE 0x80000000 | ||
64 | #define TIFM_IRQ_SOCKMASK 0x00000001 | ||
65 | #define TIFM_IRQ_CARDMASK 0x00000100 | ||
66 | #define TIFM_IRQ_FIFOMASK 0x00010000 | ||
67 | #define TIFM_IRQ_SETALL 0xffffffff | ||
68 | #define TIFM_IRQ_SETALLSOCK 0x0000000f | ||
69 | |||
70 | #define TIFM_CTRL_LED 0x00000040 | ||
71 | #define TIFM_CTRL_FAST_CLK 0x00000100 | ||
72 | |||
73 | #define TIFM_SOCK_STATE_OCCUPIED 0x00000008 | ||
74 | #define TIFM_SOCK_STATE_POWERED 0x00000080 | ||
75 | |||
76 | #define TIFM_FIFO_ENABLE 0x00000001 /* Meaning of this constant is unverified */ | ||
77 | #define TIFM_FIFO_INT_SETALL 0x0000ffff | ||
78 | #define TIFM_FIFO_INTMASK 0x00000005 /* Meaning of this constant is unverified */ | ||
79 | |||
80 | #define TIFM_DMA_RESET 0x00000002 /* Meaning of this constant is unverified */ | ||
81 | #define TIFM_DMA_TX 0x00008000 /* Meaning of this constant is unverified */ | ||
82 | #define TIFM_DMA_EN 0x00000001 /* Meaning of this constant is unverified */ | ||
83 | |||
84 | typedef enum {FM_NULL = 0, FM_XD = 0x01, FM_MS = 0x02, FM_SD = 0x03} tifm_media_id; | ||
85 | |||
86 | struct tifm_driver; | ||
87 | struct tifm_dev { | ||
88 | char __iomem *addr; | ||
89 | spinlock_t lock; | ||
90 | tifm_media_id media_id; | ||
91 | char wq_name[KOBJ_NAME_LEN]; | ||
92 | struct workqueue_struct *wq; | ||
93 | |||
94 | unsigned int (*signal_irq)(struct tifm_dev *sock, | ||
95 | unsigned int sock_irq_status); | ||
96 | |||
97 | struct tifm_driver *drv; | ||
98 | struct device dev; | ||
99 | }; | ||
100 | |||
101 | struct tifm_driver { | ||
102 | tifm_media_id *id_table; | ||
103 | int (*probe)(struct tifm_dev *dev); | ||
104 | void (*remove)(struct tifm_dev *dev); | ||
105 | |||
106 | struct device_driver driver; | ||
107 | }; | ||
108 | |||
109 | struct tifm_adapter { | ||
110 | char __iomem *addr; | ||
111 | unsigned int irq_status; | ||
112 | unsigned int insert_mask; | ||
113 | unsigned int remove_mask; | ||
114 | spinlock_t lock; | ||
115 | unsigned int id; | ||
116 | unsigned int max_sockets; | ||
117 | char wq_name[KOBJ_NAME_LEN]; | ||
118 | unsigned int inhibit_new_cards; | ||
119 | struct workqueue_struct *wq; | ||
120 | struct work_struct media_inserter; | ||
121 | struct work_struct media_remover; | ||
122 | struct tifm_dev **sockets; | ||
123 | struct class_device cdev; | ||
124 | struct device *dev; | ||
125 | |||
126 | void (*eject)(struct tifm_adapter *fm, struct tifm_dev *sock); | ||
127 | }; | ||
128 | |||
129 | struct tifm_adapter *tifm_alloc_adapter(void); | ||
130 | void tifm_free_device(struct device *dev); | ||
131 | void tifm_free_adapter(struct tifm_adapter *fm); | ||
132 | int tifm_add_adapter(struct tifm_adapter *fm); | ||
133 | void tifm_remove_adapter(struct tifm_adapter *fm); | ||
134 | struct tifm_dev *tifm_alloc_device(struct tifm_adapter *fm, unsigned int id); | ||
135 | int tifm_register_driver(struct tifm_driver *drv); | ||
136 | void tifm_unregister_driver(struct tifm_driver *drv); | ||
137 | void tifm_eject(struct tifm_dev *sock); | ||
138 | int tifm_map_sg(struct tifm_dev *sock, struct scatterlist *sg, int nents, | ||
139 | int direction); | ||
140 | void tifm_unmap_sg(struct tifm_dev *sock, struct scatterlist *sg, int nents, | ||
141 | int direction); | ||
142 | |||
143 | |||
144 | static inline void *tifm_get_drvdata(struct tifm_dev *dev) | ||
145 | { | ||
146 | return dev_get_drvdata(&dev->dev); | ||
147 | } | ||
148 | |||
149 | static inline void tifm_set_drvdata(struct tifm_dev *dev, void *data) | ||
150 | { | ||
151 | dev_set_drvdata(&dev->dev, data); | ||
152 | } | ||
153 | |||
154 | struct tifm_device_id { | ||
155 | tifm_media_id media_id; | ||
156 | }; | ||
157 | |||
158 | #endif | ||
diff --git a/include/linux/timex.h b/include/linux/timex.h index d543d3871e38..049dfe4a11f2 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
@@ -69,34 +69,28 @@ | |||
69 | * zero to MAXTC, the PLL will converge in 15 minutes to 16 hours, | 69 | * zero to MAXTC, the PLL will converge in 15 minutes to 16 hours, |
70 | * respectively. | 70 | * respectively. |
71 | */ | 71 | */ |
72 | #define SHIFT_KG 6 /* phase factor (shift) */ | 72 | #define SHIFT_PLL 4 /* PLL frequency factor (shift) */ |
73 | #define SHIFT_KF 16 /* PLL frequency factor (shift) */ | 73 | #define SHIFT_FLL 2 /* FLL frequency factor (shift) */ |
74 | #define SHIFT_KH 2 /* FLL frequency factor (shift) */ | 74 | #define MAXTC 10 /* maximum time constant (shift) */ |
75 | #define MAXTC 6 /* maximum time constant (shift) */ | ||
76 | 75 | ||
77 | /* | 76 | /* |
78 | * The SHIFT_SCALE define establishes the decimal point of the time_phase | 77 | * The SHIFT_UPDATE define establishes the decimal point of the |
79 | * variable which serves as an extension to the low-order bits of the | 78 | * time_offset variable which represents the current offset with |
80 | * system clock variable. The SHIFT_UPDATE define establishes the decimal | 79 | * respect to standard time. |
81 | * point of the time_offset variable which represents the current offset | ||
82 | * with respect to standard time. The FINENSEC define represents 1 nsec in | ||
83 | * scaled units. | ||
84 | * | 80 | * |
85 | * SHIFT_USEC defines the scaling (shift) of the time_freq and | 81 | * SHIFT_USEC defines the scaling (shift) of the time_freq and |
86 | * time_tolerance variables, which represent the current frequency | 82 | * time_tolerance variables, which represent the current frequency |
87 | * offset and maximum frequency tolerance. | 83 | * offset and maximum frequency tolerance. |
88 | * | ||
89 | * FINENSEC is 1 ns in SHIFT_UPDATE units of the time_phase variable. | ||
90 | */ | 84 | */ |
91 | #define SHIFT_SCALE 22 /* phase scale (shift) */ | 85 | #define SHIFT_UPDATE (SHIFT_HZ + 1) /* time offset scale (shift) */ |
92 | #define SHIFT_UPDATE (SHIFT_KG + MAXTC) /* time offset scale (shift) */ | ||
93 | #define SHIFT_USEC 16 /* frequency offset scale (shift) */ | 86 | #define SHIFT_USEC 16 /* frequency offset scale (shift) */ |
94 | #define FINENSEC (1L << (SHIFT_SCALE - 10)) /* ~1 ns in phase units */ | 87 | #define SHIFT_NSEC 12 /* kernel frequency offset scale */ |
95 | 88 | ||
96 | #define MAXPHASE 512000L /* max phase error (us) */ | 89 | #define MAXPHASE 512000L /* max phase error (us) */ |
97 | #define MAXFREQ (512L << SHIFT_USEC) /* max frequency error (ppm) */ | 90 | #define MAXFREQ (512L << SHIFT_USEC) /* max frequency error (ppm) */ |
98 | #define MINSEC 16L /* min interval between updates (s) */ | 91 | #define MAXFREQ_NSEC (512000L << SHIFT_NSEC) /* max frequency error (ppb) */ |
99 | #define MAXSEC 1200L /* max interval between updates (s) */ | 92 | #define MINSEC 256 /* min interval between updates (s) */ |
93 | #define MAXSEC 2048 /* max interval between updates (s) */ | ||
100 | #define NTP_PHASE_LIMIT (MAXPHASE << 5) /* beyond max. dispersion */ | 94 | #define NTP_PHASE_LIMIT (MAXPHASE << 5) /* beyond max. dispersion */ |
101 | 95 | ||
102 | /* | 96 | /* |
@@ -204,33 +198,15 @@ extern int tickadj; /* amount of adjustment per tick */ | |||
204 | /* | 198 | /* |
205 | * phase-lock loop variables | 199 | * phase-lock loop variables |
206 | */ | 200 | */ |
207 | extern int time_state; /* clock status */ | ||
208 | extern int time_status; /* clock synchronization status bits */ | 201 | extern int time_status; /* clock synchronization status bits */ |
209 | extern long time_offset; /* time adjustment (us) */ | ||
210 | extern long time_constant; /* pll time constant */ | ||
211 | extern long time_tolerance; /* frequency tolerance (ppm) */ | ||
212 | extern long time_precision; /* clock precision (us) */ | ||
213 | extern long time_maxerror; /* maximum error */ | 202 | extern long time_maxerror; /* maximum error */ |
214 | extern long time_esterror; /* estimated error */ | 203 | extern long time_esterror; /* estimated error */ |
215 | 204 | ||
216 | extern long time_freq; /* frequency offset (scaled ppm) */ | 205 | extern long time_freq; /* frequency offset (scaled ppm) */ |
217 | extern long time_reftime; /* time at last adjustment (s) */ | ||
218 | 206 | ||
219 | extern long time_adjust; /* The amount of adjtime left */ | 207 | extern long time_adjust; /* The amount of adjtime left */ |
220 | extern long time_next_adjust; /* Value for time_adjust at next tick */ | ||
221 | 208 | ||
222 | /** | 209 | extern void ntp_clear(void); |
223 | * ntp_clear - Clears the NTP state variables | ||
224 | * | ||
225 | * Must be called while holding a write on the xtime_lock | ||
226 | */ | ||
227 | static inline void ntp_clear(void) | ||
228 | { | ||
229 | time_adjust = 0; /* stop active adjtime() */ | ||
230 | time_status |= STA_UNSYNC; | ||
231 | time_maxerror = NTP_PHASE_LIMIT; | ||
232 | time_esterror = NTP_PHASE_LIMIT; | ||
233 | } | ||
234 | 210 | ||
235 | /** | 211 | /** |
236 | * ntp_synced - Returns 1 if the NTP status is not UNSYNC | 212 | * ntp_synced - Returns 1 if the NTP status is not UNSYNC |
@@ -294,11 +270,15 @@ extern void register_time_interpolator(struct time_interpolator *); | |||
294 | extern void unregister_time_interpolator(struct time_interpolator *); | 270 | extern void unregister_time_interpolator(struct time_interpolator *); |
295 | extern void time_interpolator_reset(void); | 271 | extern void time_interpolator_reset(void); |
296 | extern unsigned long time_interpolator_get_offset(void); | 272 | extern unsigned long time_interpolator_get_offset(void); |
273 | extern void time_interpolator_update(long delta_nsec); | ||
297 | 274 | ||
298 | #else /* !CONFIG_TIME_INTERPOLATION */ | 275 | #else /* !CONFIG_TIME_INTERPOLATION */ |
299 | 276 | ||
300 | static inline void | 277 | static inline void time_interpolator_reset(void) |
301 | time_interpolator_reset(void) | 278 | { |
279 | } | ||
280 | |||
281 | static inline void time_interpolator_update(long delta_nsec) | ||
302 | { | 282 | { |
303 | } | 283 | } |
304 | 284 | ||
@@ -309,6 +289,8 @@ time_interpolator_reset(void) | |||
309 | /* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */ | 289 | /* Returns how long ticks are at present, in ns / 2^(SHIFT_SCALE-10). */ |
310 | extern u64 current_tick_length(void); | 290 | extern u64 current_tick_length(void); |
311 | 291 | ||
292 | extern void second_overflow(void); | ||
293 | extern void update_ntp_one_tick(void); | ||
312 | extern int do_adjtimex(struct timex *); | 294 | extern int do_adjtimex(struct timex *); |
313 | 295 | ||
314 | #endif /* KERNEL */ | 296 | #endif /* KERNEL */ |
diff --git a/include/linux/topology.h b/include/linux/topology.h index ec1eca85290a..da508d1998e4 100644 --- a/include/linux/topology.h +++ b/include/linux/topology.h | |||
@@ -89,6 +89,7 @@ | |||
89 | #define SD_SIBLING_INIT (struct sched_domain) { \ | 89 | #define SD_SIBLING_INIT (struct sched_domain) { \ |
90 | .span = CPU_MASK_NONE, \ | 90 | .span = CPU_MASK_NONE, \ |
91 | .parent = NULL, \ | 91 | .parent = NULL, \ |
92 | .child = NULL, \ | ||
92 | .groups = NULL, \ | 93 | .groups = NULL, \ |
93 | .min_interval = 1, \ | 94 | .min_interval = 1, \ |
94 | .max_interval = 2, \ | 95 | .max_interval = 2, \ |
@@ -114,11 +115,44 @@ | |||
114 | #endif | 115 | #endif |
115 | #endif /* CONFIG_SCHED_SMT */ | 116 | #endif /* CONFIG_SCHED_SMT */ |
116 | 117 | ||
118 | #ifdef CONFIG_SCHED_MC | ||
119 | /* Common values for MC siblings. for now mostly derived from SD_CPU_INIT */ | ||
120 | #ifndef SD_MC_INIT | ||
121 | #define SD_MC_INIT (struct sched_domain) { \ | ||
122 | .span = CPU_MASK_NONE, \ | ||
123 | .parent = NULL, \ | ||
124 | .child = NULL, \ | ||
125 | .groups = NULL, \ | ||
126 | .min_interval = 1, \ | ||
127 | .max_interval = 4, \ | ||
128 | .busy_factor = 64, \ | ||
129 | .imbalance_pct = 125, \ | ||
130 | .cache_nice_tries = 1, \ | ||
131 | .per_cpu_gain = 100, \ | ||
132 | .busy_idx = 2, \ | ||
133 | .idle_idx = 1, \ | ||
134 | .newidle_idx = 2, \ | ||
135 | .wake_idx = 1, \ | ||
136 | .forkexec_idx = 1, \ | ||
137 | .flags = SD_LOAD_BALANCE \ | ||
138 | | SD_BALANCE_NEWIDLE \ | ||
139 | | SD_BALANCE_EXEC \ | ||
140 | | SD_WAKE_AFFINE \ | ||
141 | | SD_SHARE_PKG_RESOURCES\ | ||
142 | | BALANCE_FOR_MC_POWER, \ | ||
143 | .last_balance = jiffies, \ | ||
144 | .balance_interval = 1, \ | ||
145 | .nr_balance_failed = 0, \ | ||
146 | } | ||
147 | #endif | ||
148 | #endif /* CONFIG_SCHED_MC */ | ||
149 | |||
117 | /* Common values for CPUs */ | 150 | /* Common values for CPUs */ |
118 | #ifndef SD_CPU_INIT | 151 | #ifndef SD_CPU_INIT |
119 | #define SD_CPU_INIT (struct sched_domain) { \ | 152 | #define SD_CPU_INIT (struct sched_domain) { \ |
120 | .span = CPU_MASK_NONE, \ | 153 | .span = CPU_MASK_NONE, \ |
121 | .parent = NULL, \ | 154 | .parent = NULL, \ |
155 | .child = NULL, \ | ||
122 | .groups = NULL, \ | 156 | .groups = NULL, \ |
123 | .min_interval = 1, \ | 157 | .min_interval = 1, \ |
124 | .max_interval = 4, \ | 158 | .max_interval = 4, \ |
@@ -135,7 +169,7 @@ | |||
135 | | SD_BALANCE_NEWIDLE \ | 169 | | SD_BALANCE_NEWIDLE \ |
136 | | SD_BALANCE_EXEC \ | 170 | | SD_BALANCE_EXEC \ |
137 | | SD_WAKE_AFFINE \ | 171 | | SD_WAKE_AFFINE \ |
138 | | BALANCE_FOR_POWER, \ | 172 | | BALANCE_FOR_PKG_POWER,\ |
139 | .last_balance = jiffies, \ | 173 | .last_balance = jiffies, \ |
140 | .balance_interval = 1, \ | 174 | .balance_interval = 1, \ |
141 | .nr_balance_failed = 0, \ | 175 | .nr_balance_failed = 0, \ |
@@ -146,6 +180,7 @@ | |||
146 | #define SD_ALLNODES_INIT (struct sched_domain) { \ | 180 | #define SD_ALLNODES_INIT (struct sched_domain) { \ |
147 | .span = CPU_MASK_NONE, \ | 181 | .span = CPU_MASK_NONE, \ |
148 | .parent = NULL, \ | 182 | .parent = NULL, \ |
183 | .child = NULL, \ | ||
149 | .groups = NULL, \ | 184 | .groups = NULL, \ |
150 | .min_interval = 64, \ | 185 | .min_interval = 64, \ |
151 | .max_interval = 64*num_online_cpus(), \ | 186 | .max_interval = 64*num_online_cpus(), \ |
@@ -165,15 +200,6 @@ | |||
165 | .nr_balance_failed = 0, \ | 200 | .nr_balance_failed = 0, \ |
166 | } | 201 | } |
167 | 202 | ||
168 | #ifdef CONFIG_SCHED_MC | ||
169 | #ifndef SD_MC_INIT | ||
170 | /* for now its same as SD_CPU_INIT. | ||
171 | * TBD: Tune Domain parameters! | ||
172 | */ | ||
173 | #define SD_MC_INIT SD_CPU_INIT | ||
174 | #endif | ||
175 | #endif | ||
176 | |||
177 | #ifdef CONFIG_NUMA | 203 | #ifdef CONFIG_NUMA |
178 | #ifndef SD_NODE_INIT | 204 | #ifndef SD_NODE_INIT |
179 | #error Please define an appropriate SD_NODE_INIT in include/asm/topology.h!!! | 205 | #error Please define an appropriate SD_NODE_INIT in include/asm/topology.h!!! |
diff --git a/include/linux/trdevice.h b/include/linux/trdevice.h index 99e02ef54c47..bfc84a7aecc5 100644 --- a/include/linux/trdevice.h +++ b/include/linux/trdevice.h | |||
@@ -28,7 +28,7 @@ | |||
28 | #include <linux/if_tr.h> | 28 | #include <linux/if_tr.h> |
29 | 29 | ||
30 | #ifdef __KERNEL__ | 30 | #ifdef __KERNEL__ |
31 | extern unsigned short tr_type_trans(struct sk_buff *skb, struct net_device *dev); | 31 | extern __be16 tr_type_trans(struct sk_buff *skb, struct net_device *dev); |
32 | extern void tr_source_route(struct sk_buff *skb, struct trh_hdr *trh, struct net_device *dev); | 32 | extern void tr_source_route(struct sk_buff *skb, struct trh_hdr *trh, struct net_device *dev); |
33 | extern struct net_device *alloc_trdev(int sizeof_priv); | 33 | extern struct net_device *alloc_trdev(int sizeof_priv); |
34 | 34 | ||
diff --git a/include/linux/tsacct_kern.h b/include/linux/tsacct_kern.h new file mode 100644 index 000000000000..7e50ac795b0b --- /dev/null +++ b/include/linux/tsacct_kern.h | |||
@@ -0,0 +1,34 @@ | |||
1 | /* | ||
2 | * tsacct_kern.h - kernel header for system accounting over taskstats interface | ||
3 | * | ||
4 | * Copyright (C) Jay Lan SGI | ||
5 | */ | ||
6 | |||
7 | #ifndef _LINUX_TSACCT_KERN_H | ||
8 | #define _LINUX_TSACCT_KERN_H | ||
9 | |||
10 | #include <linux/taskstats.h> | ||
11 | |||
12 | #ifdef CONFIG_TASKSTATS | ||
13 | extern void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk); | ||
14 | #else | ||
15 | static inline void bacct_add_tsk(struct taskstats *stats, struct task_struct *tsk) | ||
16 | {} | ||
17 | #endif /* CONFIG_TASKSTATS */ | ||
18 | |||
19 | #ifdef CONFIG_TASK_XACCT | ||
20 | extern void xacct_add_tsk(struct taskstats *stats, struct task_struct *p); | ||
21 | extern void acct_update_integrals(struct task_struct *tsk); | ||
22 | extern void acct_clear_integrals(struct task_struct *tsk); | ||
23 | #else | ||
24 | static inline void xacct_add_tsk(struct taskstats *stats, struct task_struct *p) | ||
25 | {} | ||
26 | static inline void acct_update_integrals(struct task_struct *tsk) | ||
27 | {} | ||
28 | static inline void acct_clear_integrals(struct task_struct *tsk) | ||
29 | {} | ||
30 | #endif /* CONFIG_TASK_XACCT */ | ||
31 | |||
32 | #endif | ||
33 | |||
34 | |||
diff --git a/include/linux/tty.h b/include/linux/tty.h index 04827ca65781..44091c0db0b4 100644 --- a/include/linux/tty.h +++ b/include/linux/tty.h | |||
@@ -174,7 +174,7 @@ struct tty_struct { | |||
174 | struct tty_driver *driver; | 174 | struct tty_driver *driver; |
175 | int index; | 175 | int index; |
176 | struct tty_ldisc ldisc; | 176 | struct tty_ldisc ldisc; |
177 | struct semaphore termios_sem; | 177 | struct mutex termios_mutex; |
178 | struct termios *termios, *termios_locked; | 178 | struct termios *termios, *termios_locked; |
179 | char name[64]; | 179 | char name[64]; |
180 | int pgrp; | 180 | int pgrp; |
@@ -190,7 +190,6 @@ struct tty_struct { | |||
190 | struct tty_struct *link; | 190 | struct tty_struct *link; |
191 | struct fasync_struct *fasync; | 191 | struct fasync_struct *fasync; |
192 | struct tty_bufhead buf; | 192 | struct tty_bufhead buf; |
193 | int max_flip_cnt; | ||
194 | int alt_speed; /* For magic substitution of 38400 bps */ | 193 | int alt_speed; /* For magic substitution of 38400 bps */ |
195 | wait_queue_head_t write_wait; | 194 | wait_queue_head_t write_wait; |
196 | wait_queue_head_t read_wait; | 195 | wait_queue_head_t read_wait; |
@@ -308,6 +307,9 @@ extern void tty_ldisc_put(int); | |||
308 | extern void tty_wakeup(struct tty_struct *tty); | 307 | extern void tty_wakeup(struct tty_struct *tty); |
309 | extern void tty_ldisc_flush(struct tty_struct *tty); | 308 | extern void tty_ldisc_flush(struct tty_struct *tty); |
310 | 309 | ||
310 | extern int tty_ioctl(struct inode *inode, struct file *file, unsigned int cmd, | ||
311 | unsigned long arg); | ||
312 | |||
311 | extern struct mutex tty_mutex; | 313 | extern struct mutex tty_mutex; |
312 | 314 | ||
313 | /* n_tty.c */ | 315 | /* n_tty.c */ |
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h index 58c961c9e170..5c8473bb6882 100644 --- a/include/linux/tty_driver.h +++ b/include/linux/tty_driver.h | |||
@@ -219,7 +219,8 @@ extern struct list_head tty_drivers; | |||
219 | 219 | ||
220 | struct tty_driver *alloc_tty_driver(int lines); | 220 | struct tty_driver *alloc_tty_driver(int lines); |
221 | void put_tty_driver(struct tty_driver *driver); | 221 | void put_tty_driver(struct tty_driver *driver); |
222 | void tty_set_operations(struct tty_driver *driver, struct tty_operations *op); | 222 | void tty_set_operations(struct tty_driver *driver, |
223 | const struct tty_operations *op); | ||
223 | 224 | ||
224 | /* tty driver magic number */ | 225 | /* tty driver magic number */ |
225 | #define TTY_DRIVER_MAGIC 0x5402 | 226 | #define TTY_DRIVER_MAGIC 0x5402 |
diff --git a/include/linux/types.h b/include/linux/types.h index 3f235660a3cd..750f085fa564 100644 --- a/include/linux/types.h +++ b/include/linux/types.h | |||
@@ -33,6 +33,8 @@ typedef __kernel_clockid_t clockid_t; | |||
33 | typedef __kernel_mqd_t mqd_t; | 33 | typedef __kernel_mqd_t mqd_t; |
34 | 34 | ||
35 | #ifdef __KERNEL__ | 35 | #ifdef __KERNEL__ |
36 | typedef _Bool bool; | ||
37 | |||
36 | typedef __kernel_uid32_t uid_t; | 38 | typedef __kernel_uid32_t uid_t; |
37 | typedef __kernel_gid32_t gid_t; | 39 | typedef __kernel_gid32_t gid_t; |
38 | typedef __kernel_uid16_t uid16_t; | 40 | typedef __kernel_uid16_t uid16_t; |
@@ -127,8 +129,12 @@ typedef __s64 int64_t; | |||
127 | /* this is a special 64bit data type that is 8-byte aligned */ | 129 | /* this is a special 64bit data type that is 8-byte aligned */ |
128 | #define aligned_u64 unsigned long long __attribute__((aligned(8))) | 130 | #define aligned_u64 unsigned long long __attribute__((aligned(8))) |
129 | 131 | ||
130 | /* | 132 | /** |
131 | * The type used for indexing onto a disc or disc partition. | 133 | * The type used for indexing onto a disc or disc partition. |
134 | * | ||
135 | * Linux always considers sectors to be 512 bytes long independently | ||
136 | * of the devices real block size. | ||
137 | * | ||
132 | * If required, asm/types.h can override it and define | 138 | * If required, asm/types.h can override it and define |
133 | * HAVE_SECTOR_T | 139 | * HAVE_SECTOR_T |
134 | */ | 140 | */ |
diff --git a/include/linux/uaccess.h b/include/linux/uaccess.h index 391e7ed1eb3f..a48d7f11c7be 100644 --- a/include/linux/uaccess.h +++ b/include/linux/uaccess.h | |||
@@ -19,4 +19,26 @@ static inline unsigned long __copy_from_user_nocache(void *to, | |||
19 | 19 | ||
20 | #endif /* ARCH_HAS_NOCACHE_UACCESS */ | 20 | #endif /* ARCH_HAS_NOCACHE_UACCESS */ |
21 | 21 | ||
22 | /** | ||
23 | * probe_kernel_address(): safely attempt to read from a location | ||
24 | * @addr: address to read from - its type is type typeof(retval)* | ||
25 | * @retval: read into this variable | ||
26 | * | ||
27 | * Safely read from address @addr into variable @revtal. If a kernel fault | ||
28 | * happens, handle that and return -EFAULT. | ||
29 | * We ensure that the __get_user() is executed in atomic context so that | ||
30 | * do_page_fault() doesn't attempt to take mmap_sem. This makes | ||
31 | * probe_kernel_address() suitable for use within regions where the caller | ||
32 | * already holds mmap_sem, or other locks which nest inside mmap_sem. | ||
33 | */ | ||
34 | #define probe_kernel_address(addr, retval) \ | ||
35 | ({ \ | ||
36 | long ret; \ | ||
37 | \ | ||
38 | inc_preempt_count(); \ | ||
39 | ret = __get_user(retval, addr); \ | ||
40 | dec_preempt_count(); \ | ||
41 | ret; \ | ||
42 | }) | ||
43 | |||
22 | #endif /* __LINUX_UACCESS_H__ */ | 44 | #endif /* __LINUX_UACCESS_H__ */ |
diff --git a/include/linux/udp.h b/include/linux/udp.h index 90223f057d50..014b41d1e308 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h | |||
@@ -20,10 +20,10 @@ | |||
20 | #include <linux/types.h> | 20 | #include <linux/types.h> |
21 | 21 | ||
22 | struct udphdr { | 22 | struct udphdr { |
23 | __u16 source; | 23 | __be16 source; |
24 | __u16 dest; | 24 | __be16 dest; |
25 | __u16 len; | 25 | __be16 len; |
26 | __u16 check; | 26 | __be16 check; |
27 | }; | 27 | }; |
28 | 28 | ||
29 | /* UDP socket options */ | 29 | /* UDP socket options */ |
diff --git a/include/linux/uinput.h b/include/linux/uinput.h index 7168302f9844..1fd61eeed664 100644 --- a/include/linux/uinput.h +++ b/include/linux/uinput.h | |||
@@ -22,12 +22,18 @@ | |||
22 | * Author: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org> | 22 | * Author: Aristeu Sergio Rozanski Filho <aris@cathedrallabs.org> |
23 | * | 23 | * |
24 | * Changes/Revisions: | 24 | * Changes/Revisions: |
25 | * 0.3 24/05/2006 (Anssi Hannula <anssi.hannulagmail.com>) | ||
26 | * - update ff support for the changes in kernel interface | ||
27 | * - add UINPUT_VERSION | ||
25 | * 0.2 16/10/2004 (Micah Dowty <micah@navi.cx>) | 28 | * 0.2 16/10/2004 (Micah Dowty <micah@navi.cx>) |
26 | * - added force feedback support | 29 | * - added force feedback support |
27 | * - added UI_SET_PHYS | 30 | * - added UI_SET_PHYS |
28 | * 0.1 20/06/2002 | 31 | * 0.1 20/06/2002 |
29 | * - first public version | 32 | * - first public version |
30 | */ | 33 | */ |
34 | |||
35 | #define UINPUT_VERSION 3 | ||
36 | |||
31 | #ifdef __KERNEL__ | 37 | #ifdef __KERNEL__ |
32 | #define UINPUT_MINOR 223 | 38 | #define UINPUT_MINOR 223 |
33 | #define UINPUT_NAME "uinput" | 39 | #define UINPUT_NAME "uinput" |
@@ -45,7 +51,10 @@ struct uinput_request { | |||
45 | 51 | ||
46 | union { | 52 | union { |
47 | int effect_id; | 53 | int effect_id; |
48 | struct ff_effect* effect; | 54 | struct { |
55 | struct ff_effect *effect; | ||
56 | struct ff_effect *old; | ||
57 | } upload; | ||
49 | } u; | 58 | } u; |
50 | }; | 59 | }; |
51 | 60 | ||
@@ -58,6 +67,7 @@ struct uinput_device { | |||
58 | unsigned char head; | 67 | unsigned char head; |
59 | unsigned char tail; | 68 | unsigned char tail; |
60 | struct input_event buff[UINPUT_BUFFER_SIZE]; | 69 | struct input_event buff[UINPUT_BUFFER_SIZE]; |
70 | int ff_effects_max; | ||
61 | 71 | ||
62 | struct uinput_request *requests[UINPUT_NUM_REQUESTS]; | 72 | struct uinput_request *requests[UINPUT_NUM_REQUESTS]; |
63 | wait_queue_head_t requests_waitq; | 73 | wait_queue_head_t requests_waitq; |
@@ -69,6 +79,7 @@ struct uinput_ff_upload { | |||
69 | int request_id; | 79 | int request_id; |
70 | int retval; | 80 | int retval; |
71 | struct ff_effect effect; | 81 | struct ff_effect effect; |
82 | struct ff_effect old; | ||
72 | }; | 83 | }; |
73 | 84 | ||
74 | struct uinput_ff_erase { | 85 | struct uinput_ff_erase { |
@@ -98,33 +109,33 @@ struct uinput_ff_erase { | |||
98 | #define UI_BEGIN_FF_ERASE _IOWR(UINPUT_IOCTL_BASE, 202, struct uinput_ff_erase) | 109 | #define UI_BEGIN_FF_ERASE _IOWR(UINPUT_IOCTL_BASE, 202, struct uinput_ff_erase) |
99 | #define UI_END_FF_ERASE _IOW(UINPUT_IOCTL_BASE, 203, struct uinput_ff_erase) | 110 | #define UI_END_FF_ERASE _IOW(UINPUT_IOCTL_BASE, 203, struct uinput_ff_erase) |
100 | 111 | ||
101 | /* To write a force-feedback-capable driver, the upload_effect | 112 | /* |
113 | * To write a force-feedback-capable driver, the upload_effect | ||
102 | * and erase_effect callbacks in input_dev must be implemented. | 114 | * and erase_effect callbacks in input_dev must be implemented. |
103 | * The uinput driver will generate a fake input event when one of | 115 | * The uinput driver will generate a fake input event when one of |
104 | * these callbacks are invoked. The userspace code then uses | 116 | * these callbacks are invoked. The userspace code then uses |
105 | * ioctls to retrieve additional parameters and send the return code. | 117 | * ioctls to retrieve additional parameters and send the return code. |
106 | * The callback blocks until this return code is sent. | 118 | * The callback blocks until this return code is sent. |
107 | * | 119 | * |
108 | * The described callback mechanism is only used if EV_FF is set. | 120 | * The described callback mechanism is only used if ff_effects_max |
109 | * Otherwise, default implementations of upload_effect and erase_effect | 121 | * is set. |
110 | * are used. | ||
111 | * | 122 | * |
112 | * To implement upload_effect(): | 123 | * To implement upload_effect(): |
113 | * 1. Wait for an event with type==EV_UINPUT and code==UI_FF_UPLOAD. | 124 | * 1. Wait for an event with type == EV_UINPUT and code == UI_FF_UPLOAD. |
114 | * A request ID will be given in 'value'. | 125 | * A request ID will be given in 'value'. |
115 | * 2. Allocate a uinput_ff_upload struct, fill in request_id with | 126 | * 2. Allocate a uinput_ff_upload struct, fill in request_id with |
116 | * the 'value' from the EV_UINPUT event. | 127 | * the 'value' from the EV_UINPUT event. |
117 | * 3. Issue a UI_BEGIN_FF_UPLOAD ioctl, giving it the | 128 | * 3. Issue a UI_BEGIN_FF_UPLOAD ioctl, giving it the |
118 | * uinput_ff_upload struct. It will be filled in with the | 129 | * uinput_ff_upload struct. It will be filled in with the |
119 | * ff_effect passed to upload_effect(). | 130 | * ff_effects passed to upload_effect(). |
120 | * 4. Perform the effect upload, and place the modified ff_effect | 131 | * 4. Perform the effect upload, and place a return code back into |
121 | * and a return code back into the uinput_ff_upload struct. | 132 | the uinput_ff_upload struct. |
122 | * 5. Issue a UI_END_FF_UPLOAD ioctl, also giving it the | 133 | * 5. Issue a UI_END_FF_UPLOAD ioctl, also giving it the |
123 | * uinput_ff_upload_effect struct. This will complete execution | 134 | * uinput_ff_upload_effect struct. This will complete execution |
124 | * of our upload_effect() handler. | 135 | * of our upload_effect() handler. |
125 | * | 136 | * |
126 | * To implement erase_effect(): | 137 | * To implement erase_effect(): |
127 | * 1. Wait for an event with type==EV_UINPUT and code==UI_FF_ERASE. | 138 | * 1. Wait for an event with type == EV_UINPUT and code == UI_FF_ERASE. |
128 | * A request ID will be given in 'value'. | 139 | * A request ID will be given in 'value'. |
129 | * 2. Allocate a uinput_ff_erase struct, fill in request_id with | 140 | * 2. Allocate a uinput_ff_erase struct, fill in request_id with |
130 | * the 'value' from the EV_UINPUT event. | 141 | * the 'value' from the EV_UINPUT event. |
@@ -133,13 +144,13 @@ struct uinput_ff_erase { | |||
133 | * effect ID passed to erase_effect(). | 144 | * effect ID passed to erase_effect(). |
134 | * 4. Perform the effect erasure, and place a return code back | 145 | * 4. Perform the effect erasure, and place a return code back |
135 | * into the uinput_ff_erase struct. | 146 | * into the uinput_ff_erase struct. |
136 | * and a return code back into the uinput_ff_erase struct. | ||
137 | * 5. Issue a UI_END_FF_ERASE ioctl, also giving it the | 147 | * 5. Issue a UI_END_FF_ERASE ioctl, also giving it the |
138 | * uinput_ff_erase_effect struct. This will complete execution | 148 | * uinput_ff_erase_effect struct. This will complete execution |
139 | * of our erase_effect() handler. | 149 | * of our erase_effect() handler. |
140 | */ | 150 | */ |
141 | 151 | ||
142 | /* This is the new event type, used only by uinput. | 152 | /* |
153 | * This is the new event type, used only by uinput. | ||
143 | * 'code' is UI_FF_UPLOAD or UI_FF_ERASE, and 'value' | 154 | * 'code' is UI_FF_UPLOAD or UI_FF_ERASE, and 'value' |
144 | * is the unique request ID. This number was picked | 155 | * is the unique request ID. This number was picked |
145 | * arbitrarily, above EV_MAX (since the input system | 156 | * arbitrarily, above EV_MAX (since the input system |
diff --git a/include/linux/unistd.h b/include/linux/unistd.h index c18c60f3254e..aa8d5b5e2e3e 100644 --- a/include/linux/unistd.h +++ b/include/linux/unistd.h | |||
@@ -1,12 +1,8 @@ | |||
1 | #ifndef _LINUX_UNISTD_H_ | 1 | #ifndef _LINUX_UNISTD_H_ |
2 | #define _LINUX_UNISTD_H_ | 2 | #define _LINUX_UNISTD_H_ |
3 | 3 | ||
4 | #ifdef __KERNEL__ | ||
5 | extern int errno; | ||
6 | #endif | ||
7 | |||
8 | /* | 4 | /* |
9 | * Include machine specific syscallX macros | 5 | * Include machine specific syscall numbers |
10 | */ | 6 | */ |
11 | #include <asm/unistd.h> | 7 | #include <asm/unistd.h> |
12 | 8 | ||
diff --git a/include/linux/unwind.h b/include/linux/unwind.h index ce48e2cd37a2..73e1751d03dd 100644 --- a/include/linux/unwind.h +++ b/include/linux/unwind.h | |||
@@ -12,8 +12,6 @@ | |||
12 | * is not much point in implementing the full Dwarf2 unwind API. | 12 | * is not much point in implementing the full Dwarf2 unwind API. |
13 | */ | 13 | */ |
14 | 14 | ||
15 | #include <linux/config.h> | ||
16 | |||
17 | struct module; | 15 | struct module; |
18 | 16 | ||
19 | #ifdef CONFIG_STACK_UNWIND | 17 | #ifdef CONFIG_STACK_UNWIND |
diff --git a/include/linux/usb.h b/include/linux/usb.h index d2bd0c8e0154..190cc1b78fe2 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/fs.h> /* for struct file_operations */ | 19 | #include <linux/fs.h> /* for struct file_operations */ |
20 | #include <linux/completion.h> /* for struct completion */ | 20 | #include <linux/completion.h> /* for struct completion */ |
21 | #include <linux/sched.h> /* for current && schedule_timeout */ | 21 | #include <linux/sched.h> /* for current && schedule_timeout */ |
22 | #include <linux/mutex.h> /* for struct mutex */ | ||
22 | 23 | ||
23 | struct usb_device; | 24 | struct usb_device; |
24 | struct usb_driver; | 25 | struct usb_driver; |
@@ -102,8 +103,13 @@ enum usb_interface_condition { | |||
102 | * number from the USB core by calling usb_register_dev(). | 103 | * number from the USB core by calling usb_register_dev(). |
103 | * @condition: binding state of the interface: not bound, binding | 104 | * @condition: binding state of the interface: not bound, binding |
104 | * (in probe()), bound to a driver, or unbinding (in disconnect()) | 105 | * (in probe()), bound to a driver, or unbinding (in disconnect()) |
106 | * @is_active: flag set when the interface is bound and not suspended. | ||
107 | * @needs_remote_wakeup: flag set when the driver requires remote-wakeup | ||
108 | * capability during autosuspend. | ||
105 | * @dev: driver model's view of this device | 109 | * @dev: driver model's view of this device |
106 | * @class_dev: driver model's class view of this device. | 110 | * @class_dev: driver model's class view of this device. |
111 | * @pm_usage_cnt: PM usage counter for this interface; autosuspend is not | ||
112 | * allowed unless the counter is 0. | ||
107 | * | 113 | * |
108 | * USB device drivers attach to interfaces on a physical device. Each | 114 | * USB device drivers attach to interfaces on a physical device. Each |
109 | * interface encapsulates a single high level function, such as feeding | 115 | * interface encapsulates a single high level function, such as feeding |
@@ -142,8 +148,12 @@ struct usb_interface { | |||
142 | int minor; /* minor number this interface is | 148 | int minor; /* minor number this interface is |
143 | * bound to */ | 149 | * bound to */ |
144 | enum usb_interface_condition condition; /* state of binding */ | 150 | enum usb_interface_condition condition; /* state of binding */ |
151 | unsigned is_active:1; /* the interface is not suspended */ | ||
152 | unsigned needs_remote_wakeup:1; /* driver requires remote wakeup */ | ||
153 | |||
145 | struct device dev; /* interface specific device info */ | 154 | struct device dev; /* interface specific device info */ |
146 | struct class_device *class_dev; | 155 | struct class_device *class_dev; |
156 | int pm_usage_cnt; /* usage counter for autosuspend */ | ||
147 | }; | 157 | }; |
148 | #define to_usb_interface(d) container_of(d, struct usb_interface, dev) | 158 | #define to_usb_interface(d) container_of(d, struct usb_interface, dev) |
149 | #define interface_to_usbdev(intf) \ | 159 | #define interface_to_usbdev(intf) \ |
@@ -254,8 +264,6 @@ int __usb_get_extra_descriptor(char *buffer, unsigned size, | |||
254 | 264 | ||
255 | /* ----------------------------------------------------------------------- */ | 265 | /* ----------------------------------------------------------------------- */ |
256 | 266 | ||
257 | struct usb_operations; | ||
258 | |||
259 | /* USB device number allocation bitmap */ | 267 | /* USB device number allocation bitmap */ |
260 | struct usb_devmap { | 268 | struct usb_devmap { |
261 | unsigned long devicemap[128 / (8*sizeof(unsigned long))]; | 269 | unsigned long devicemap[128 / (8*sizeof(unsigned long))]; |
@@ -268,6 +276,7 @@ struct usb_bus { | |||
268 | struct device *controller; /* host/master side hardware */ | 276 | struct device *controller; /* host/master side hardware */ |
269 | int busnum; /* Bus number (in order of reg) */ | 277 | int busnum; /* Bus number (in order of reg) */ |
270 | char *bus_name; /* stable id (PCI slot_name etc) */ | 278 | char *bus_name; /* stable id (PCI slot_name etc) */ |
279 | u8 uses_dma; /* Does the host controller use DMA? */ | ||
271 | u8 otg_port; /* 0, or number of OTG/HNP port */ | 280 | u8 otg_port; /* 0, or number of OTG/HNP port */ |
272 | unsigned is_b_host:1; /* true during some HNP roleswitches */ | 281 | unsigned is_b_host:1; /* true during some HNP roleswitches */ |
273 | unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ | 282 | unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ |
@@ -276,10 +285,8 @@ struct usb_bus { | |||
276 | * round-robin allocation */ | 285 | * round-robin allocation */ |
277 | 286 | ||
278 | struct usb_devmap devmap; /* device address allocation map */ | 287 | struct usb_devmap devmap; /* device address allocation map */ |
279 | struct usb_operations *op; /* Operations (specific to the HC) */ | ||
280 | struct usb_device *root_hub; /* Root hub */ | 288 | struct usb_device *root_hub; /* Root hub */ |
281 | struct list_head bus_list; /* list of busses */ | 289 | struct list_head bus_list; /* list of busses */ |
282 | void *hcpriv; /* Host Controller private data */ | ||
283 | 290 | ||
284 | int bandwidth_allocated; /* on this bus: how much of the time | 291 | int bandwidth_allocated; /* on this bus: how much of the time |
285 | * reserved for periodic (intr/iso) | 292 | * reserved for periodic (intr/iso) |
@@ -294,8 +301,6 @@ struct usb_bus { | |||
294 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */ | 301 | struct dentry *usbfs_dentry; /* usbfs dentry entry for the bus */ |
295 | 302 | ||
296 | struct class_device *class_dev; /* class device for this bus */ | 303 | struct class_device *class_dev; /* class device for this bus */ |
297 | struct kref kref; /* reference counting for this bus */ | ||
298 | void (*release)(struct usb_bus *bus); | ||
299 | 304 | ||
300 | #if defined(CONFIG_USB_MON) | 305 | #if defined(CONFIG_USB_MON) |
301 | struct mon_bus *mon_bus; /* non-null when associated */ | 306 | struct mon_bus *mon_bus; /* non-null when associated */ |
@@ -350,6 +355,7 @@ struct usb_device { | |||
350 | 355 | ||
351 | unsigned short bus_mA; /* Current available from the bus */ | 356 | unsigned short bus_mA; /* Current available from the bus */ |
352 | u8 portnum; /* Parent port number (origin 1) */ | 357 | u8 portnum; /* Parent port number (origin 1) */ |
358 | u8 level; /* Number of USB hub ancestors */ | ||
353 | 359 | ||
354 | int have_langid; /* whether string_langid is valid */ | 360 | int have_langid; /* whether string_langid is valid */ |
355 | int string_langid; /* language ID for strings */ | 361 | int string_langid; /* language ID for strings */ |
@@ -373,6 +379,15 @@ struct usb_device { | |||
373 | 379 | ||
374 | int maxchild; /* Number of ports if hub */ | 380 | int maxchild; /* Number of ports if hub */ |
375 | struct usb_device *children[USB_MAXCHILDREN]; | 381 | struct usb_device *children[USB_MAXCHILDREN]; |
382 | |||
383 | int pm_usage_cnt; /* usage counter for autosuspend */ | ||
384 | #ifdef CONFIG_PM | ||
385 | struct work_struct autosuspend; /* for delayed autosuspends */ | ||
386 | struct mutex pm_mutex; /* protects PM operations */ | ||
387 | |||
388 | unsigned auto_pm:1; /* autosuspend/resume in progress */ | ||
389 | unsigned do_remote_wakeup:1; /* remote wakeup should be enabled */ | ||
390 | #endif | ||
376 | }; | 391 | }; |
377 | #define to_usb_device(d) container_of(d, struct usb_device, dev) | 392 | #define to_usb_device(d) container_of(d, struct usb_device, dev) |
378 | 393 | ||
@@ -384,7 +399,7 @@ extern void usb_put_dev(struct usb_device *dev); | |||
384 | #define usb_unlock_device(udev) up(&(udev)->dev.sem) | 399 | #define usb_unlock_device(udev) up(&(udev)->dev.sem) |
385 | #define usb_trylock_device(udev) down_trylock(&(udev)->dev.sem) | 400 | #define usb_trylock_device(udev) down_trylock(&(udev)->dev.sem) |
386 | extern int usb_lock_device_for_reset(struct usb_device *udev, | 401 | extern int usb_lock_device_for_reset(struct usb_device *udev, |
387 | struct usb_interface *iface); | 402 | const struct usb_interface *iface); |
388 | 403 | ||
389 | /* USB port reset for device reinitialization */ | 404 | /* USB port reset for device reinitialization */ |
390 | extern int usb_reset_device(struct usb_device *dev); | 405 | extern int usb_reset_device(struct usb_device *dev); |
@@ -393,6 +408,17 @@ extern int usb_reset_composite_device(struct usb_device *dev, | |||
393 | 408 | ||
394 | extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); | 409 | extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); |
395 | 410 | ||
411 | /* USB autosuspend and autoresume */ | ||
412 | #ifdef CONFIG_USB_SUSPEND | ||
413 | extern int usb_autopm_get_interface(struct usb_interface *intf); | ||
414 | extern void usb_autopm_put_interface(struct usb_interface *intf); | ||
415 | |||
416 | #else | ||
417 | #define usb_autopm_get_interface(intf) 0 | ||
418 | #define usb_autopm_put_interface(intf) do {} while (0) | ||
419 | #endif | ||
420 | |||
421 | |||
396 | /*-------------------------------------------------------------------------*/ | 422 | /*-------------------------------------------------------------------------*/ |
397 | 423 | ||
398 | /* for drivers using iso endpoints */ | 424 | /* for drivers using iso endpoints */ |
@@ -423,10 +449,10 @@ const struct usb_device_id *usb_match_id(struct usb_interface *interface, | |||
423 | 449 | ||
424 | extern struct usb_interface *usb_find_interface(struct usb_driver *drv, | 450 | extern struct usb_interface *usb_find_interface(struct usb_driver *drv, |
425 | int minor); | 451 | int minor); |
426 | extern struct usb_interface *usb_ifnum_to_if(struct usb_device *dev, | 452 | extern struct usb_interface *usb_ifnum_to_if(const struct usb_device *dev, |
427 | unsigned ifnum); | 453 | unsigned ifnum); |
428 | extern struct usb_host_interface *usb_altnum_to_altsetting( | 454 | extern struct usb_host_interface *usb_altnum_to_altsetting( |
429 | struct usb_interface *intf, unsigned int altnum); | 455 | const struct usb_interface *intf, unsigned int altnum); |
430 | 456 | ||
431 | 457 | ||
432 | /** | 458 | /** |
@@ -464,6 +490,20 @@ static inline int usb_make_path (struct usb_device *dev, char *buf, | |||
464 | 490 | ||
465 | /*-------------------------------------------------------------------------*/ | 491 | /*-------------------------------------------------------------------------*/ |
466 | 492 | ||
493 | extern int usb_endpoint_dir_in(const struct usb_endpoint_descriptor *epd); | ||
494 | extern int usb_endpoint_dir_out(const struct usb_endpoint_descriptor *epd); | ||
495 | extern int usb_endpoint_xfer_bulk(const struct usb_endpoint_descriptor *epd); | ||
496 | extern int usb_endpoint_xfer_int(const struct usb_endpoint_descriptor *epd); | ||
497 | extern int usb_endpoint_xfer_isoc(const struct usb_endpoint_descriptor *epd); | ||
498 | extern int usb_endpoint_is_bulk_in(const struct usb_endpoint_descriptor *epd); | ||
499 | extern int usb_endpoint_is_bulk_out(const struct usb_endpoint_descriptor *epd); | ||
500 | extern int usb_endpoint_is_int_in(const struct usb_endpoint_descriptor *epd); | ||
501 | extern int usb_endpoint_is_int_out(const struct usb_endpoint_descriptor *epd); | ||
502 | extern int usb_endpoint_is_isoc_in(const struct usb_endpoint_descriptor *epd); | ||
503 | extern int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor *epd); | ||
504 | |||
505 | /*-------------------------------------------------------------------------*/ | ||
506 | |||
467 | #define USB_DEVICE_ID_MATCH_DEVICE \ | 507 | #define USB_DEVICE_ID_MATCH_DEVICE \ |
468 | (USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT) | 508 | (USB_DEVICE_ID_MATCH_VENDOR | USB_DEVICE_ID_MATCH_PRODUCT) |
469 | #define USB_DEVICE_ID_MATCH_DEV_RANGE \ | 509 | #define USB_DEVICE_ID_MATCH_DEV_RANGE \ |
@@ -540,7 +580,17 @@ struct usb_dynids { | |||
540 | }; | 580 | }; |
541 | 581 | ||
542 | /** | 582 | /** |
543 | * struct usb_driver - identifies USB driver to usbcore | 583 | * struct usbdrv_wrap - wrapper for driver-model structure |
584 | * @driver: The driver-model core driver structure. | ||
585 | * @for_devices: Non-zero for device drivers, 0 for interface drivers. | ||
586 | */ | ||
587 | struct usbdrv_wrap { | ||
588 | struct device_driver driver; | ||
589 | int for_devices; | ||
590 | }; | ||
591 | |||
592 | /** | ||
593 | * struct usb_driver - identifies USB interface driver to usbcore | ||
544 | * @name: The driver name should be unique among USB drivers, | 594 | * @name: The driver name should be unique among USB drivers, |
545 | * and should normally be the same as the module name. | 595 | * and should normally be the same as the module name. |
546 | * @probe: Called to see if the driver is willing to manage a particular | 596 | * @probe: Called to see if the driver is willing to manage a particular |
@@ -567,12 +617,14 @@ struct usb_dynids { | |||
567 | * or your driver's probe function will never get called. | 617 | * or your driver's probe function will never get called. |
568 | * @dynids: used internally to hold the list of dynamically added device | 618 | * @dynids: used internally to hold the list of dynamically added device |
569 | * ids for this driver. | 619 | * ids for this driver. |
570 | * @driver: the driver model core driver structure. | 620 | * @drvwrap: Driver-model core structure wrapper. |
571 | * @no_dynamic_id: if set to 1, the USB core will not allow dynamic ids to be | 621 | * @no_dynamic_id: if set to 1, the USB core will not allow dynamic ids to be |
572 | * added to this driver by preventing the sysfs file from being created. | 622 | * added to this driver by preventing the sysfs file from being created. |
623 | * @supports_autosuspend: if set to 0, the USB core will not allow autosuspend | ||
624 | * for interfaces bound to this driver. | ||
573 | * | 625 | * |
574 | * USB drivers must provide a name, probe() and disconnect() methods, | 626 | * USB interface drivers must provide a name, probe() and disconnect() |
575 | * and an id_table. Other driver fields are optional. | 627 | * methods, and an id_table. Other driver fields are optional. |
576 | * | 628 | * |
577 | * The id_table is used in hotplugging. It holds a set of descriptors, | 629 | * The id_table is used in hotplugging. It holds a set of descriptors, |
578 | * and specialized data may be associated with each entry. That table | 630 | * and specialized data may be associated with each entry. That table |
@@ -606,10 +658,44 @@ struct usb_driver { | |||
606 | const struct usb_device_id *id_table; | 658 | const struct usb_device_id *id_table; |
607 | 659 | ||
608 | struct usb_dynids dynids; | 660 | struct usb_dynids dynids; |
609 | struct device_driver driver; | 661 | struct usbdrv_wrap drvwrap; |
610 | unsigned int no_dynamic_id:1; | 662 | unsigned int no_dynamic_id:1; |
663 | unsigned int supports_autosuspend:1; | ||
611 | }; | 664 | }; |
612 | #define to_usb_driver(d) container_of(d, struct usb_driver, driver) | 665 | #define to_usb_driver(d) container_of(d, struct usb_driver, drvwrap.driver) |
666 | |||
667 | /** | ||
668 | * struct usb_device_driver - identifies USB device driver to usbcore | ||
669 | * @name: The driver name should be unique among USB drivers, | ||
670 | * and should normally be the same as the module name. | ||
671 | * @probe: Called to see if the driver is willing to manage a particular | ||
672 | * device. If it is, probe returns zero and uses dev_set_drvdata() | ||
673 | * to associate driver-specific data with the device. If unwilling | ||
674 | * to manage the device, return a negative errno value. | ||
675 | * @disconnect: Called when the device is no longer accessible, usually | ||
676 | * because it has been (or is being) disconnected or the driver's | ||
677 | * module is being unloaded. | ||
678 | * @suspend: Called when the device is going to be suspended by the system. | ||
679 | * @resume: Called when the device is being resumed by the system. | ||
680 | * @drvwrap: Driver-model core structure wrapper. | ||
681 | * @supports_autosuspend: if set to 0, the USB core will not allow autosuspend | ||
682 | * for devices bound to this driver. | ||
683 | * | ||
684 | * USB drivers must provide all the fields listed above except drvwrap. | ||
685 | */ | ||
686 | struct usb_device_driver { | ||
687 | const char *name; | ||
688 | |||
689 | int (*probe) (struct usb_device *udev); | ||
690 | void (*disconnect) (struct usb_device *udev); | ||
691 | |||
692 | int (*suspend) (struct usb_device *udev, pm_message_t message); | ||
693 | int (*resume) (struct usb_device *udev); | ||
694 | struct usbdrv_wrap drvwrap; | ||
695 | unsigned int supports_autosuspend:1; | ||
696 | }; | ||
697 | #define to_usb_device_driver(d) container_of(d, struct usb_device_driver, \ | ||
698 | drvwrap.driver) | ||
613 | 699 | ||
614 | extern struct bus_type usb_bus_type; | 700 | extern struct bus_type usb_bus_type; |
615 | 701 | ||
@@ -633,13 +719,17 @@ struct usb_class_driver { | |||
633 | * use these in module_init()/module_exit() | 719 | * use these in module_init()/module_exit() |
634 | * and don't forget MODULE_DEVICE_TABLE(usb, ...) | 720 | * and don't forget MODULE_DEVICE_TABLE(usb, ...) |
635 | */ | 721 | */ |
636 | int usb_register_driver(struct usb_driver *, struct module *); | 722 | extern int usb_register_driver(struct usb_driver *, struct module *); |
637 | static inline int usb_register(struct usb_driver *driver) | 723 | static inline int usb_register(struct usb_driver *driver) |
638 | { | 724 | { |
639 | return usb_register_driver(driver, THIS_MODULE); | 725 | return usb_register_driver(driver, THIS_MODULE); |
640 | } | 726 | } |
641 | extern void usb_deregister(struct usb_driver *); | 727 | extern void usb_deregister(struct usb_driver *); |
642 | 728 | ||
729 | extern int usb_register_device_driver(struct usb_device_driver *, | ||
730 | struct module *); | ||
731 | extern void usb_deregister_device_driver(struct usb_device_driver *); | ||
732 | |||
643 | extern int usb_register_dev(struct usb_interface *intf, | 733 | extern int usb_register_dev(struct usb_interface *intf, |
644 | struct usb_class_driver *class_driver); | 734 | struct usb_class_driver *class_driver); |
645 | extern void usb_deregister_dev(struct usb_interface *intf, | 735 | extern void usb_deregister_dev(struct usb_interface *intf, |
@@ -885,7 +975,7 @@ struct urb | |||
885 | * @setup_packet: pointer to the setup_packet buffer | 975 | * @setup_packet: pointer to the setup_packet buffer |
886 | * @transfer_buffer: pointer to the transfer buffer | 976 | * @transfer_buffer: pointer to the transfer buffer |
887 | * @buffer_length: length of the transfer buffer | 977 | * @buffer_length: length of the transfer buffer |
888 | * @complete: pointer to the usb_complete_t function | 978 | * @complete_fn: pointer to the usb_complete_t function |
889 | * @context: what to set the urb context to. | 979 | * @context: what to set the urb context to. |
890 | * | 980 | * |
891 | * Initializes a control urb with the proper information needed to submit | 981 | * Initializes a control urb with the proper information needed to submit |
@@ -897,7 +987,7 @@ static inline void usb_fill_control_urb (struct urb *urb, | |||
897 | unsigned char *setup_packet, | 987 | unsigned char *setup_packet, |
898 | void *transfer_buffer, | 988 | void *transfer_buffer, |
899 | int buffer_length, | 989 | int buffer_length, |
900 | usb_complete_t complete, | 990 | usb_complete_t complete_fn, |
901 | void *context) | 991 | void *context) |
902 | { | 992 | { |
903 | spin_lock_init(&urb->lock); | 993 | spin_lock_init(&urb->lock); |
@@ -906,7 +996,7 @@ static inline void usb_fill_control_urb (struct urb *urb, | |||
906 | urb->setup_packet = setup_packet; | 996 | urb->setup_packet = setup_packet; |
907 | urb->transfer_buffer = transfer_buffer; | 997 | urb->transfer_buffer = transfer_buffer; |
908 | urb->transfer_buffer_length = buffer_length; | 998 | urb->transfer_buffer_length = buffer_length; |
909 | urb->complete = complete; | 999 | urb->complete = complete_fn; |
910 | urb->context = context; | 1000 | urb->context = context; |
911 | } | 1001 | } |
912 | 1002 | ||
@@ -917,7 +1007,7 @@ static inline void usb_fill_control_urb (struct urb *urb, | |||
917 | * @pipe: the endpoint pipe | 1007 | * @pipe: the endpoint pipe |
918 | * @transfer_buffer: pointer to the transfer buffer | 1008 | * @transfer_buffer: pointer to the transfer buffer |
919 | * @buffer_length: length of the transfer buffer | 1009 | * @buffer_length: length of the transfer buffer |
920 | * @complete: pointer to the usb_complete_t function | 1010 | * @complete_fn: pointer to the usb_complete_t function |
921 | * @context: what to set the urb context to. | 1011 | * @context: what to set the urb context to. |
922 | * | 1012 | * |
923 | * Initializes a bulk urb with the proper information needed to submit it | 1013 | * Initializes a bulk urb with the proper information needed to submit it |
@@ -928,7 +1018,7 @@ static inline void usb_fill_bulk_urb (struct urb *urb, | |||
928 | unsigned int pipe, | 1018 | unsigned int pipe, |
929 | void *transfer_buffer, | 1019 | void *transfer_buffer, |
930 | int buffer_length, | 1020 | int buffer_length, |
931 | usb_complete_t complete, | 1021 | usb_complete_t complete_fn, |
932 | void *context) | 1022 | void *context) |
933 | { | 1023 | { |
934 | spin_lock_init(&urb->lock); | 1024 | spin_lock_init(&urb->lock); |
@@ -936,7 +1026,7 @@ static inline void usb_fill_bulk_urb (struct urb *urb, | |||
936 | urb->pipe = pipe; | 1026 | urb->pipe = pipe; |
937 | urb->transfer_buffer = transfer_buffer; | 1027 | urb->transfer_buffer = transfer_buffer; |
938 | urb->transfer_buffer_length = buffer_length; | 1028 | urb->transfer_buffer_length = buffer_length; |
939 | urb->complete = complete; | 1029 | urb->complete = complete_fn; |
940 | urb->context = context; | 1030 | urb->context = context; |
941 | } | 1031 | } |
942 | 1032 | ||
@@ -947,7 +1037,7 @@ static inline void usb_fill_bulk_urb (struct urb *urb, | |||
947 | * @pipe: the endpoint pipe | 1037 | * @pipe: the endpoint pipe |
948 | * @transfer_buffer: pointer to the transfer buffer | 1038 | * @transfer_buffer: pointer to the transfer buffer |
949 | * @buffer_length: length of the transfer buffer | 1039 | * @buffer_length: length of the transfer buffer |
950 | * @complete: pointer to the usb_complete_t function | 1040 | * @complete_fn: pointer to the usb_complete_t function |
951 | * @context: what to set the urb context to. | 1041 | * @context: what to set the urb context to. |
952 | * @interval: what to set the urb interval to, encoded like | 1042 | * @interval: what to set the urb interval to, encoded like |
953 | * the endpoint descriptor's bInterval value. | 1043 | * the endpoint descriptor's bInterval value. |
@@ -963,7 +1053,7 @@ static inline void usb_fill_int_urb (struct urb *urb, | |||
963 | unsigned int pipe, | 1053 | unsigned int pipe, |
964 | void *transfer_buffer, | 1054 | void *transfer_buffer, |
965 | int buffer_length, | 1055 | int buffer_length, |
966 | usb_complete_t complete, | 1056 | usb_complete_t complete_fn, |
967 | void *context, | 1057 | void *context, |
968 | int interval) | 1058 | int interval) |
969 | { | 1059 | { |
@@ -972,7 +1062,7 @@ static inline void usb_fill_int_urb (struct urb *urb, | |||
972 | urb->pipe = pipe; | 1062 | urb->pipe = pipe; |
973 | urb->transfer_buffer = transfer_buffer; | 1063 | urb->transfer_buffer = transfer_buffer; |
974 | urb->transfer_buffer_length = buffer_length; | 1064 | urb->transfer_buffer_length = buffer_length; |
975 | urb->complete = complete; | 1065 | urb->complete = complete_fn; |
976 | urb->context = context; | 1066 | urb->context = context; |
977 | if (dev->speed == USB_SPEED_HIGH) | 1067 | if (dev->speed == USB_SPEED_HIGH) |
978 | urb->interval = 1 << (interval - 1); | 1068 | urb->interval = 1 << (interval - 1); |
@@ -990,7 +1080,6 @@ extern int usb_submit_urb(struct urb *urb, gfp_t mem_flags); | |||
990 | extern int usb_unlink_urb(struct urb *urb); | 1080 | extern int usb_unlink_urb(struct urb *urb); |
991 | extern void usb_kill_urb(struct urb *urb); | 1081 | extern void usb_kill_urb(struct urb *urb); |
992 | 1082 | ||
993 | #define HAVE_USB_BUFFERS | ||
994 | void *usb_buffer_alloc (struct usb_device *dev, size_t size, | 1083 | void *usb_buffer_alloc (struct usb_device *dev, size_t size, |
995 | gfp_t mem_flags, dma_addr_t *dma); | 1084 | gfp_t mem_flags, dma_addr_t *dma); |
996 | void usb_buffer_free (struct usb_device *dev, size_t size, | 1085 | void usb_buffer_free (struct usb_device *dev, size_t size, |
@@ -1003,14 +1092,14 @@ void usb_buffer_unmap (struct urb *urb); | |||
1003 | #endif | 1092 | #endif |
1004 | 1093 | ||
1005 | struct scatterlist; | 1094 | struct scatterlist; |
1006 | int usb_buffer_map_sg (struct usb_device *dev, unsigned pipe, | 1095 | int usb_buffer_map_sg(const struct usb_device *dev, unsigned pipe, |
1007 | struct scatterlist *sg, int nents); | 1096 | struct scatterlist *sg, int nents); |
1008 | #if 0 | 1097 | #if 0 |
1009 | void usb_buffer_dmasync_sg (struct usb_device *dev, unsigned pipe, | 1098 | void usb_buffer_dmasync_sg(const struct usb_device *dev, unsigned pipe, |
1010 | struct scatterlist *sg, int n_hw_ents); | 1099 | struct scatterlist *sg, int n_hw_ents); |
1011 | #endif | 1100 | #endif |
1012 | void usb_buffer_unmap_sg (struct usb_device *dev, unsigned pipe, | 1101 | void usb_buffer_unmap_sg(const struct usb_device *dev, unsigned pipe, |
1013 | struct scatterlist *sg, int n_hw_ents); | 1102 | struct scatterlist *sg, int n_hw_ents); |
1014 | 1103 | ||
1015 | /*-------------------------------------------------------------------* | 1104 | /*-------------------------------------------------------------------* |
1016 | * SYNCHRONOUS CALL SUPPORT * | 1105 | * SYNCHRONOUS CALL SUPPORT * |
@@ -1038,6 +1127,9 @@ extern int usb_clear_halt(struct usb_device *dev, int pipe); | |||
1038 | extern int usb_reset_configuration(struct usb_device *dev); | 1127 | extern int usb_reset_configuration(struct usb_device *dev); |
1039 | extern int usb_set_interface(struct usb_device *dev, int ifnum, int alternate); | 1128 | extern int usb_set_interface(struct usb_device *dev, int ifnum, int alternate); |
1040 | 1129 | ||
1130 | /* this request isn't really synchronous, but it belongs with the others */ | ||
1131 | extern int usb_driver_set_configuration(struct usb_device *udev, int config); | ||
1132 | |||
1041 | /* | 1133 | /* |
1042 | * timeouts, in milliseconds, used for sending/receiving control messages | 1134 | * timeouts, in milliseconds, used for sending/receiving control messages |
1043 | * they typically complete within a few frames (msec) after they're issued | 1135 | * they typically complete within a few frames (msec) after they're issued |
diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h new file mode 100644 index 000000000000..6bd235994dc2 --- /dev/null +++ b/include/linux/usb/audio.h | |||
@@ -0,0 +1,53 @@ | |||
1 | /* | ||
2 | * <linux/usb/audio.h> -- USB Audio definitions. | ||
3 | * | ||
4 | * Copyright (C) 2006 Thumtronics Pty Ltd. | ||
5 | * Developed for Thumtronics by Grey Innovation | ||
6 | * Ben Williamson <ben.williamson@greyinnovation.com> | ||
7 | * | ||
8 | * This software is distributed under the terms of the GNU General Public | ||
9 | * License ("GPL") version 2, as published by the Free Software Foundation. | ||
10 | * | ||
11 | * This file holds USB constants and structures defined | ||
12 | * by the USB Device Class Definition for Audio Devices. | ||
13 | * Comments below reference relevant sections of that document: | ||
14 | * | ||
15 | * http://www.usb.org/developers/devclass_docs/audio10.pdf | ||
16 | */ | ||
17 | |||
18 | #ifndef __LINUX_USB_AUDIO_H | ||
19 | #define __LINUX_USB_AUDIO_H | ||
20 | |||
21 | #include <linux/types.h> | ||
22 | |||
23 | /* A.2 Audio Interface Subclass Codes */ | ||
24 | #define USB_SUBCLASS_AUDIOCONTROL 0x01 | ||
25 | #define USB_SUBCLASS_AUDIOSTREAMING 0x02 | ||
26 | #define USB_SUBCLASS_MIDISTREAMING 0x03 | ||
27 | |||
28 | /* 4.3.2 Class-Specific AC Interface Descriptor */ | ||
29 | struct usb_ac_header_descriptor { | ||
30 | __u8 bLength; // 8+n | ||
31 | __u8 bDescriptorType; // USB_DT_CS_INTERFACE | ||
32 | __u8 bDescriptorSubtype; // USB_MS_HEADER | ||
33 | __le16 bcdADC; // 0x0100 | ||
34 | __le16 wTotalLength; // includes Unit and Terminal desc. | ||
35 | __u8 bInCollection; // n | ||
36 | __u8 baInterfaceNr[]; // [n] | ||
37 | } __attribute__ ((packed)); | ||
38 | |||
39 | #define USB_DT_AC_HEADER_SIZE(n) (8+(n)) | ||
40 | |||
41 | /* As above, but more useful for defining your own descriptors: */ | ||
42 | #define DECLARE_USB_AC_HEADER_DESCRIPTOR(n) \ | ||
43 | struct usb_ac_header_descriptor_##n { \ | ||
44 | __u8 bLength; \ | ||
45 | __u8 bDescriptorType; \ | ||
46 | __u8 bDescriptorSubtype; \ | ||
47 | __le16 bcdADC; \ | ||
48 | __le16 wTotalLength; \ | ||
49 | __u8 bInCollection; \ | ||
50 | __u8 baInterfaceNr[n]; \ | ||
51 | } __attribute__ ((packed)) | ||
52 | |||
53 | #endif | ||
diff --git a/include/linux/usb/midi.h b/include/linux/usb/midi.h new file mode 100644 index 000000000000..11a97d5ffd34 --- /dev/null +++ b/include/linux/usb/midi.h | |||
@@ -0,0 +1,112 @@ | |||
1 | /* | ||
2 | * <linux/usb/midi.h> -- USB MIDI definitions. | ||
3 | * | ||
4 | * Copyright (C) 2006 Thumtronics Pty Ltd. | ||
5 | * Developed for Thumtronics by Grey Innovation | ||
6 | * Ben Williamson <ben.williamson@greyinnovation.com> | ||
7 | * | ||
8 | * This software is distributed under the terms of the GNU General Public | ||
9 | * License ("GPL") version 2, as published by the Free Software Foundation. | ||
10 | * | ||
11 | * This file holds USB constants and structures defined | ||
12 | * by the USB Device Class Definition for MIDI Devices. | ||
13 | * Comments below reference relevant sections of that document: | ||
14 | * | ||
15 | * http://www.usb.org/developers/devclass_docs/midi10.pdf | ||
16 | */ | ||
17 | |||
18 | #ifndef __LINUX_USB_MIDI_H | ||
19 | #define __LINUX_USB_MIDI_H | ||
20 | |||
21 | #include <linux/types.h> | ||
22 | |||
23 | /* A.1 MS Class-Specific Interface Descriptor Subtypes */ | ||
24 | #define USB_MS_HEADER 0x01 | ||
25 | #define USB_MS_MIDI_IN_JACK 0x02 | ||
26 | #define USB_MS_MIDI_OUT_JACK 0x03 | ||
27 | #define USB_MS_ELEMENT 0x04 | ||
28 | |||
29 | /* A.2 MS Class-Specific Endpoint Descriptor Subtypes */ | ||
30 | #define USB_MS_GENERAL 0x01 | ||
31 | |||
32 | /* A.3 MS MIDI IN and OUT Jack Types */ | ||
33 | #define USB_MS_EMBEDDED 0x01 | ||
34 | #define USB_MS_EXTERNAL 0x02 | ||
35 | |||
36 | /* 6.1.2.1 Class-Specific MS Interface Header Descriptor */ | ||
37 | struct usb_ms_header_descriptor { | ||
38 | __u8 bLength; | ||
39 | __u8 bDescriptorType; | ||
40 | __u8 bDescriptorSubtype; | ||
41 | __le16 bcdMSC; | ||
42 | __le16 wTotalLength; | ||
43 | } __attribute__ ((packed)); | ||
44 | |||
45 | #define USB_DT_MS_HEADER_SIZE 7 | ||
46 | |||
47 | /* 6.1.2.2 MIDI IN Jack Descriptor */ | ||
48 | struct usb_midi_in_jack_descriptor { | ||
49 | __u8 bLength; | ||
50 | __u8 bDescriptorType; // USB_DT_CS_INTERFACE | ||
51 | __u8 bDescriptorSubtype; // USB_MS_MIDI_IN_JACK | ||
52 | __u8 bJackType; // USB_MS_EMBEDDED/EXTERNAL | ||
53 | __u8 bJackID; | ||
54 | __u8 iJack; | ||
55 | } __attribute__ ((packed)); | ||
56 | |||
57 | #define USB_DT_MIDI_IN_SIZE 6 | ||
58 | |||
59 | struct usb_midi_source_pin { | ||
60 | __u8 baSourceID; | ||
61 | __u8 baSourcePin; | ||
62 | } __attribute__ ((packed)); | ||
63 | |||
64 | /* 6.1.2.3 MIDI OUT Jack Descriptor */ | ||
65 | struct usb_midi_out_jack_descriptor { | ||
66 | __u8 bLength; | ||
67 | __u8 bDescriptorType; // USB_DT_CS_INTERFACE | ||
68 | __u8 bDescriptorSubtype; // USB_MS_MIDI_OUT_JACK | ||
69 | __u8 bJackType; // USB_MS_EMBEDDED/EXTERNAL | ||
70 | __u8 bJackID; | ||
71 | __u8 bNrInputPins; // p | ||
72 | struct usb_midi_source_pin pins[]; // [p] | ||
73 | /*__u8 iJack; -- ommitted due to variable-sized pins[] */ | ||
74 | } __attribute__ ((packed)); | ||
75 | |||
76 | #define USB_DT_MIDI_OUT_SIZE(p) (7 + 2 * (p)) | ||
77 | |||
78 | /* As above, but more useful for defining your own descriptors: */ | ||
79 | #define DECLARE_USB_MIDI_OUT_JACK_DESCRIPTOR(p) \ | ||
80 | struct usb_midi_out_jack_descriptor_##p { \ | ||
81 | __u8 bLength; \ | ||
82 | __u8 bDescriptorType; \ | ||
83 | __u8 bDescriptorSubtype; \ | ||
84 | __u8 bJackType; \ | ||
85 | __u8 bJackID; \ | ||
86 | __u8 bNrInputPins; \ | ||
87 | struct usb_midi_source_pin pins[p]; \ | ||
88 | __u8 iJack; \ | ||
89 | } __attribute__ ((packed)) | ||
90 | |||
91 | /* 6.2.2 Class-Specific MS Bulk Data Endpoint Descriptor */ | ||
92 | struct usb_ms_endpoint_descriptor { | ||
93 | __u8 bLength; // 4+n | ||
94 | __u8 bDescriptorType; // USB_DT_CS_ENDPOINT | ||
95 | __u8 bDescriptorSubtype; // USB_MS_GENERAL | ||
96 | __u8 bNumEmbMIDIJack; // n | ||
97 | __u8 baAssocJackID[]; // [n] | ||
98 | } __attribute__ ((packed)); | ||
99 | |||
100 | #define USB_DT_MS_ENDPOINT_SIZE(n) (4 + (n)) | ||
101 | |||
102 | /* As above, but more useful for defining your own descriptors: */ | ||
103 | #define DECLARE_USB_MS_ENDPOINT_DESCRIPTOR(n) \ | ||
104 | struct usb_ms_endpoint_descriptor_##n { \ | ||
105 | __u8 bLength; \ | ||
106 | __u8 bDescriptorType; \ | ||
107 | __u8 bDescriptorSubtype; \ | ||
108 | __u8 bNumEmbMIDIJack; \ | ||
109 | __u8 baAssocJackID[n]; \ | ||
110 | } __attribute__ ((packed)) | ||
111 | |||
112 | #endif | ||
diff --git a/include/linux/usb_otg.h b/include/linux/usb/otg.h index f827f6e203c2..9897f7a818c5 100644 --- a/include/linux/usb_otg.h +++ b/include/linux/usb/otg.h | |||
@@ -1,4 +1,4 @@ | |||
1 | // include/linux/usb_otg.h | 1 | // include/linux/usb/otg.h |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * These APIs may be used between USB controllers. USB device drivers | 4 | * These APIs may be used between USB controllers. USB device drivers |
@@ -52,7 +52,7 @@ struct otg_transceiver { | |||
52 | u16 port_change; | 52 | u16 port_change; |
53 | 53 | ||
54 | /* bind/unbind the host controller */ | 54 | /* bind/unbind the host controller */ |
55 | int (*set_host)(struct otg_transceiver *otg, | 55 | int (*set_host)(struct otg_transceiver *otg, |
56 | struct usb_bus *host); | 56 | struct usb_bus *host); |
57 | 57 | ||
58 | /* bind/unbind the peripheral controller */ | 58 | /* bind/unbind the peripheral controller */ |
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h index e7fc5fed5b98..2ae76fe52ff7 100644 --- a/include/linux/usb_usual.h +++ b/include/linux/usb_usual.h | |||
@@ -108,6 +108,9 @@ enum { US_DO_ALL_FLAGS }; | |||
108 | #ifdef CONFIG_USB_STORAGE_ALAUDA | 108 | #ifdef CONFIG_USB_STORAGE_ALAUDA |
109 | #define US_PR_ALAUDA 0xf4 /* Alauda chipsets */ | 109 | #define US_PR_ALAUDA 0xf4 /* Alauda chipsets */ |
110 | #endif | 110 | #endif |
111 | #ifdef CONFIG_USB_STORAGE_KARMA | ||
112 | #define US_PR_KARMA 0xf5 /* Rio Karma */ | ||
113 | #endif | ||
111 | 114 | ||
112 | #define US_PR_DEVICE 0xff /* Use device's value */ | 115 | #define US_PR_DEVICE 0xff /* Use device's value */ |
113 | 116 | ||
diff --git a/include/linux/utime.h b/include/linux/utime.h index c6bf27b7897e..640be6a1959e 100644 --- a/include/linux/utime.h +++ b/include/linux/utime.h | |||
@@ -1,6 +1,8 @@ | |||
1 | #ifndef _LINUX_UTIME_H | 1 | #ifndef _LINUX_UTIME_H |
2 | #define _LINUX_UTIME_H | 2 | #define _LINUX_UTIME_H |
3 | 3 | ||
4 | #include <linux/types.h> | ||
5 | |||
4 | struct utimbuf { | 6 | struct utimbuf { |
5 | time_t actime; | 7 | time_t actime; |
6 | time_t modtime; | 8 | time_t modtime; |
diff --git a/include/linux/utsname.h b/include/linux/utsname.h index 13e1da0c538d..a4555fe3754c 100644 --- a/include/linux/utsname.h +++ b/include/linux/utsname.h | |||
@@ -30,7 +30,65 @@ struct new_utsname { | |||
30 | char domainname[65]; | 30 | char domainname[65]; |
31 | }; | 31 | }; |
32 | 32 | ||
33 | extern struct new_utsname system_utsname; | 33 | #ifdef __KERNEL__ |
34 | 34 | ||
35 | extern struct rw_semaphore uts_sem; | 35 | #include <linux/sched.h> |
36 | #include <linux/kref.h> | ||
37 | #include <linux/nsproxy.h> | ||
38 | #include <asm/atomic.h> | ||
39 | |||
40 | struct uts_namespace { | ||
41 | struct kref kref; | ||
42 | struct new_utsname name; | ||
43 | }; | ||
44 | extern struct uts_namespace init_uts_ns; | ||
45 | |||
46 | static inline void get_uts_ns(struct uts_namespace *ns) | ||
47 | { | ||
48 | kref_get(&ns->kref); | ||
49 | } | ||
50 | |||
51 | #ifdef CONFIG_UTS_NS | ||
52 | extern int unshare_utsname(unsigned long unshare_flags, | ||
53 | struct uts_namespace **new_uts); | ||
54 | extern int copy_utsname(int flags, struct task_struct *tsk); | ||
55 | extern void free_uts_ns(struct kref *kref); | ||
56 | |||
57 | static inline void put_uts_ns(struct uts_namespace *ns) | ||
58 | { | ||
59 | kref_put(&ns->kref, free_uts_ns); | ||
60 | } | ||
61 | #else | ||
62 | static inline int unshare_utsname(unsigned long unshare_flags, | ||
63 | struct uts_namespace **new_uts) | ||
64 | { | ||
65 | if (unshare_flags & CLONE_NEWUTS) | ||
66 | return -EINVAL; | ||
67 | |||
68 | return 0; | ||
69 | } | ||
70 | |||
71 | static inline int copy_utsname(int flags, struct task_struct *tsk) | ||
72 | { | ||
73 | return 0; | ||
74 | } | ||
75 | static inline void put_uts_ns(struct uts_namespace *ns) | ||
76 | { | ||
77 | } | ||
36 | #endif | 78 | #endif |
79 | |||
80 | static inline struct new_utsname *utsname(void) | ||
81 | { | ||
82 | return ¤t->nsproxy->uts_ns->name; | ||
83 | } | ||
84 | |||
85 | static inline struct new_utsname *init_utsname(void) | ||
86 | { | ||
87 | return &init_uts_ns.name; | ||
88 | } | ||
89 | |||
90 | extern struct rw_semaphore uts_sem; | ||
91 | |||
92 | #endif /* __KERNEL__ */ | ||
93 | |||
94 | #endif /* _LINUX_UTSNAME_H */ | ||
diff --git a/include/linux/vermagic.h b/include/linux/vermagic.h index 46919f9f5eb3..4d0909e53595 100644 --- a/include/linux/vermagic.h +++ b/include/linux/vermagic.h | |||
@@ -24,5 +24,5 @@ | |||
24 | #define VERMAGIC_STRING \ | 24 | #define VERMAGIC_STRING \ |
25 | UTS_RELEASE " " \ | 25 | UTS_RELEASE " " \ |
26 | MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT \ | 26 | MODULE_VERMAGIC_SMP MODULE_VERMAGIC_PREEMPT \ |
27 | MODULE_VERMAGIC_MODULE_UNLOAD MODULE_ARCH_VERMAGIC \ | 27 | MODULE_VERMAGIC_MODULE_UNLOAD MODULE_ARCH_VERMAGIC |
28 | "gcc-" __stringify(__GNUC__) "." __stringify(__GNUC_MINOR__) | 28 | |
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index e3715d774197..c5fdf6259548 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -276,6 +276,82 @@ struct v4l2_fmtdesc | |||
276 | 276 | ||
277 | #define V4L2_FMT_FLAG_COMPRESSED 0x0001 | 277 | #define V4L2_FMT_FLAG_COMPRESSED 0x0001 |
278 | 278 | ||
279 | #if 1 | ||
280 | /* Experimental Frame Size and frame rate enumeration */ | ||
281 | /* | ||
282 | * F R A M E S I Z E E N U M E R A T I O N | ||
283 | */ | ||
284 | enum v4l2_frmsizetypes | ||
285 | { | ||
286 | V4L2_FRMSIZE_TYPE_DISCRETE = 1, | ||
287 | V4L2_FRMSIZE_TYPE_CONTINUOUS = 2, | ||
288 | V4L2_FRMSIZE_TYPE_STEPWISE = 3, | ||
289 | }; | ||
290 | |||
291 | struct v4l2_frmsize_discrete | ||
292 | { | ||
293 | __u32 width; /* Frame width [pixel] */ | ||
294 | __u32 height; /* Frame height [pixel] */ | ||
295 | }; | ||
296 | |||
297 | struct v4l2_frmsize_stepwise | ||
298 | { | ||
299 | __u32 min_width; /* Minimum frame width [pixel] */ | ||
300 | __u32 max_width; /* Maximum frame width [pixel] */ | ||
301 | __u32 step_width; /* Frame width step size [pixel] */ | ||
302 | __u32 min_height; /* Minimum frame height [pixel] */ | ||
303 | __u32 max_height; /* Maximum frame height [pixel] */ | ||
304 | __u32 step_height; /* Frame height step size [pixel] */ | ||
305 | }; | ||
306 | |||
307 | struct v4l2_frmsizeenum | ||
308 | { | ||
309 | __u32 index; /* Frame size number */ | ||
310 | __u32 pixel_format; /* Pixel format */ | ||
311 | __u32 type; /* Frame size type the device supports. */ | ||
312 | |||
313 | union { /* Frame size */ | ||
314 | struct v4l2_frmsize_discrete discrete; | ||
315 | struct v4l2_frmsize_stepwise stepwise; | ||
316 | }; | ||
317 | |||
318 | __u32 reserved[2]; /* Reserved space for future use */ | ||
319 | }; | ||
320 | |||
321 | /* | ||
322 | * F R A M E R A T E E N U M E R A T I O N | ||
323 | */ | ||
324 | enum v4l2_frmivaltypes | ||
325 | { | ||
326 | V4L2_FRMIVAL_TYPE_DISCRETE = 1, | ||
327 | V4L2_FRMIVAL_TYPE_CONTINUOUS = 2, | ||
328 | V4L2_FRMIVAL_TYPE_STEPWISE = 3, | ||
329 | }; | ||
330 | |||
331 | struct v4l2_frmival_stepwise | ||
332 | { | ||
333 | struct v4l2_fract min; /* Minimum frame interval [s] */ | ||
334 | struct v4l2_fract max; /* Maximum frame interval [s] */ | ||
335 | struct v4l2_fract step; /* Frame interval step size [s] */ | ||
336 | }; | ||
337 | |||
338 | struct v4l2_frmivalenum | ||
339 | { | ||
340 | __u32 index; /* Frame format index */ | ||
341 | __u32 pixel_format; /* Pixel format */ | ||
342 | __u32 width; /* Frame width */ | ||
343 | __u32 height; /* Frame height */ | ||
344 | __u32 type; /* Frame interval type the device supports. */ | ||
345 | |||
346 | union { /* Frame interval */ | ||
347 | struct v4l2_fract discrete; | ||
348 | struct v4l2_frmival_stepwise stepwise; | ||
349 | }; | ||
350 | |||
351 | __u32 reserved[2]; /* Reserved space for future use */ | ||
352 | }; | ||
353 | #endif | ||
354 | |||
279 | /* | 355 | /* |
280 | * T I M E C O D E | 356 | * T I M E C O D E |
281 | */ | 357 | */ |
@@ -1135,7 +1211,8 @@ struct v4l2_sliced_vbi_cap | |||
1135 | (equals frame lines 313-336 for 625 line video | 1211 | (equals frame lines 313-336 for 625 line video |
1136 | standards, 263-286 for 525 line standards) */ | 1212 | standards, 263-286 for 525 line standards) */ |
1137 | __u16 service_lines[2][24]; | 1213 | __u16 service_lines[2][24]; |
1138 | __u32 reserved[4]; /* must be 0 */ | 1214 | enum v4l2_buf_type type; |
1215 | __u32 reserved[3]; /* must be 0 */ | ||
1139 | }; | 1216 | }; |
1140 | 1217 | ||
1141 | struct v4l2_sliced_vbi_data | 1218 | struct v4l2_sliced_vbi_data |
@@ -1242,12 +1319,16 @@ struct v4l2_streamparm | |||
1242 | #define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority) | 1319 | #define VIDIOC_G_PRIORITY _IOR ('V', 67, enum v4l2_priority) |
1243 | #define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority) | 1320 | #define VIDIOC_S_PRIORITY _IOW ('V', 68, enum v4l2_priority) |
1244 | #if 1 | 1321 | #if 1 |
1245 | #define VIDIOC_G_SLICED_VBI_CAP _IOR ('V', 69, struct v4l2_sliced_vbi_cap) | 1322 | #define VIDIOC_G_SLICED_VBI_CAP _IOWR ('V', 69, struct v4l2_sliced_vbi_cap) |
1246 | #endif | 1323 | #endif |
1247 | #define VIDIOC_LOG_STATUS _IO ('V', 70) | 1324 | #define VIDIOC_LOG_STATUS _IO ('V', 70) |
1248 | #define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls) | 1325 | #define VIDIOC_G_EXT_CTRLS _IOWR ('V', 71, struct v4l2_ext_controls) |
1249 | #define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls) | 1326 | #define VIDIOC_S_EXT_CTRLS _IOWR ('V', 72, struct v4l2_ext_controls) |
1250 | #define VIDIOC_TRY_EXT_CTRLS _IOWR ('V', 73, struct v4l2_ext_controls) | 1327 | #define VIDIOC_TRY_EXT_CTRLS _IOWR ('V', 73, struct v4l2_ext_controls) |
1328 | #if 1 | ||
1329 | #define VIDIOC_ENUM_FRAMESIZES _IOWR ('V', 74, struct v4l2_frmsizeenum) | ||
1330 | #define VIDIOC_ENUM_FRAMEINTERVALS _IOWR ('V', 75, struct v4l2_frmivalenum) | ||
1331 | #endif | ||
1251 | 1332 | ||
1252 | #ifdef __OLD_VIDIOC_ | 1333 | #ifdef __OLD_VIDIOC_ |
1253 | /* for compatibility, will go away some day */ | 1334 | /* for compatibility, will go away some day */ |
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h index dee88c6b6fa7..ce5f1482e6be 100644 --- a/include/linux/vmalloc.h +++ b/include/linux/vmalloc.h | |||
@@ -62,7 +62,6 @@ extern struct vm_struct *__get_vm_area(unsigned long size, unsigned long flags, | |||
62 | extern struct vm_struct *get_vm_area_node(unsigned long size, | 62 | extern struct vm_struct *get_vm_area_node(unsigned long size, |
63 | unsigned long flags, int node); | 63 | unsigned long flags, int node); |
64 | extern struct vm_struct *remove_vm_area(void *addr); | 64 | extern struct vm_struct *remove_vm_area(void *addr); |
65 | extern struct vm_struct *__remove_vm_area(void *addr); | ||
66 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, | 65 | extern int map_vm_area(struct vm_struct *area, pgprot_t prot, |
67 | struct page ***pages); | 66 | struct page ***pages); |
68 | extern void unmap_vm_area(struct vm_struct *area); | 67 | extern void unmap_vm_area(struct vm_struct *area); |
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h index 176c7f797339..c89df55f6e03 100644 --- a/include/linux/vmstat.h +++ b/include/linux/vmstat.h | |||
@@ -3,7 +3,6 @@ | |||
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/percpu.h> | 5 | #include <linux/percpu.h> |
6 | #include <linux/config.h> | ||
7 | #include <linux/mmzone.h> | 6 | #include <linux/mmzone.h> |
8 | #include <asm/atomic.h> | 7 | #include <asm/atomic.h> |
9 | 8 | ||
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index 918a29763aea..37a1a41f5b65 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
@@ -33,7 +33,8 @@ extern int fg_console, last_console, want_console; | |||
33 | int vc_allocate(unsigned int console); | 33 | int vc_allocate(unsigned int console); |
34 | int vc_cons_allocated(unsigned int console); | 34 | int vc_cons_allocated(unsigned int console); |
35 | int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines); | 35 | int vc_resize(struct vc_data *vc, unsigned int cols, unsigned int lines); |
36 | void vc_disallocate(unsigned int console); | 36 | int vc_lock_resize(struct vc_data *vc, unsigned int cols, unsigned int lines); |
37 | void vc_deallocate(unsigned int console); | ||
37 | void reset_palette(struct vc_data *vc); | 38 | void reset_palette(struct vc_data *vc); |
38 | void do_blank_screen(int entering_gfx); | 39 | void do_blank_screen(int entering_gfx); |
39 | void do_unblank_screen(int leaving_gfx); | 40 | void do_unblank_screen(int leaving_gfx); |
@@ -83,4 +84,11 @@ void reset_vc(struct vc_data *vc); | |||
83 | extern char con_buf[CON_BUF_SIZE]; | 84 | extern char con_buf[CON_BUF_SIZE]; |
84 | extern struct semaphore con_buf_sem; | 85 | extern struct semaphore con_buf_sem; |
85 | 86 | ||
87 | struct vt_spawn_console { | ||
88 | spinlock_t lock; | ||
89 | struct pid *pid; | ||
90 | int sig; | ||
91 | }; | ||
92 | extern struct vt_spawn_console vt_spawn_con; | ||
93 | |||
86 | #endif /* _VT_KERN_H */ | 94 | #endif /* _VT_KERN_H */ |
diff --git a/include/linux/wavefront.h b/include/linux/wavefront.h deleted file mode 100644 index 51ab3c933acd..000000000000 --- a/include/linux/wavefront.h +++ /dev/null | |||
@@ -1,675 +0,0 @@ | |||
1 | #ifndef __wavefront_h__ | ||
2 | #define __wavefront_h__ | ||
3 | |||
4 | /* WaveFront header file. | ||
5 | * | ||
6 | * Copyright (C) by Paul Barton-Davis 1998 | ||
7 | * | ||
8 | * This program is distributed under the GNU GENERAL PUBLIC LICENSE (GPL) | ||
9 | * Version 2 (June 1991). See the "COPYING" file distributed with this software | ||
10 | * for more info. | ||
11 | */ | ||
12 | |||
13 | #if (!defined(__GNUC__) && !defined(__GNUG__)) | ||
14 | |||
15 | You will not be able to compile this file correctly without gcc, because | ||
16 | it is necessary to pack the "wavefront_alias" structure to a size | ||
17 | of 22 bytes, corresponding to 16-bit alignment (as would have been | ||
18 | the case on the original platform, MS-DOS). If this is not done, | ||
19 | then WavePatch-format files cannot be read/written correctly. | ||
20 | The method used to do this here ("__attribute__((packed)") is | ||
21 | completely compiler dependent. | ||
22 | |||
23 | All other wavefront_* types end up aligned to 32 bit values and | ||
24 | still have the same (correct) size. | ||
25 | |||
26 | #else | ||
27 | |||
28 | /* However, note that as of G++ 2.7.3.2, g++ was unable to | ||
29 | correctly parse *type* __attribute__ tags. It will do the | ||
30 | right thing if we use the "packed" attribute on each struct | ||
31 | member, which has the same semantics anyway. | ||
32 | */ | ||
33 | |||
34 | #endif /* __GNUC__ */ | ||
35 | |||
36 | /***************************** WARNING ******************************** | ||
37 | PLEASE DO NOT MODIFY THIS FILE IN ANY WAY THAT AFFECTS ITS ABILITY TO | ||
38 | BE USED WITH EITHER C *OR* C++. | ||
39 | **********************************************************************/ | ||
40 | |||
41 | #ifndef NUM_MIDIKEYS | ||
42 | #define NUM_MIDIKEYS 128 | ||
43 | #endif /* NUM_MIDIKEYS */ | ||
44 | |||
45 | #ifndef NUM_MIDICHANNELS | ||
46 | #define NUM_MIDICHANNELS 16 | ||
47 | #endif /* NUM_MIDICHANNELS */ | ||
48 | |||
49 | /* These are very useful/important. the original wavefront interface | ||
50 | was developed on a 16 bit system, where sizeof(int) = 2 | ||
51 | bytes. Defining things like this makes the code much more portable, and | ||
52 | easier to understand without having to toggle back and forth | ||
53 | between a 16-bit view of the world and a 32-bit one. | ||
54 | */ | ||
55 | |||
56 | typedef short INT16; | ||
57 | typedef unsigned short UINT16; | ||
58 | typedef int INT32; | ||
59 | typedef unsigned int UINT32; | ||
60 | typedef char CHAR8; | ||
61 | typedef unsigned char UCHAR8; | ||
62 | |||
63 | /* Pseudo-commands not part of the WaveFront command set. | ||
64 | These are used for various driver controls and direct | ||
65 | hardware control. | ||
66 | */ | ||
67 | |||
68 | #define WFC_DEBUG_DRIVER 0 | ||
69 | #define WFC_FX_IOCTL 1 | ||
70 | #define WFC_PATCH_STATUS 2 | ||
71 | #define WFC_PROGRAM_STATUS 3 | ||
72 | #define WFC_SAMPLE_STATUS 4 | ||
73 | #define WFC_DISABLE_INTERRUPTS 5 | ||
74 | #define WFC_ENABLE_INTERRUPTS 6 | ||
75 | #define WFC_INTERRUPT_STATUS 7 | ||
76 | #define WFC_ROMSAMPLES_RDONLY 8 | ||
77 | #define WFC_IDENTIFY_SLOT_TYPE 9 | ||
78 | |||
79 | /* Wavefront synth commands | ||
80 | */ | ||
81 | |||
82 | #define WFC_DOWNLOAD_SAMPLE 0x80 | ||
83 | #define WFC_DOWNLOAD_BLOCK 0x81 | ||
84 | #define WFC_DOWNLOAD_MULTISAMPLE 0x82 | ||
85 | #define WFC_DOWNLOAD_SAMPLE_ALIAS 0x83 | ||
86 | #define WFC_DELETE_SAMPLE 0x84 | ||
87 | #define WFC_REPORT_FREE_MEMORY 0x85 | ||
88 | #define WFC_DOWNLOAD_PATCH 0x86 | ||
89 | #define WFC_DOWNLOAD_PROGRAM 0x87 | ||
90 | #define WFC_SET_SYNTHVOL 0x89 | ||
91 | #define WFC_SET_NVOICES 0x8B | ||
92 | #define WFC_DOWNLOAD_DRUM 0x90 | ||
93 | #define WFC_GET_SYNTHVOL 0x92 | ||
94 | #define WFC_GET_NVOICES 0x94 | ||
95 | #define WFC_DISABLE_CHANNEL 0x9A | ||
96 | #define WFC_ENABLE_CHANNEL 0x9B | ||
97 | #define WFC_MISYNTH_OFF 0x9D | ||
98 | #define WFC_MISYNTH_ON 0x9E | ||
99 | #define WFC_FIRMWARE_VERSION 0x9F | ||
100 | #define WFC_GET_NSAMPLES 0xA0 | ||
101 | #define WFC_DISABLE_DRUM_PROGRAM 0xA2 | ||
102 | #define WFC_UPLOAD_PATCH 0xA3 | ||
103 | #define WFC_UPLOAD_PROGRAM 0xA4 | ||
104 | #define WFC_SET_TUNING 0xA6 | ||
105 | #define WFC_GET_TUNING 0xA7 | ||
106 | #define WFC_VMIDI_ON 0xA8 | ||
107 | #define WFC_VMIDI_OFF 0xA9 | ||
108 | #define WFC_MIDI_STATUS 0xAA | ||
109 | #define WFC_GET_CHANNEL_STATUS 0xAB | ||
110 | #define WFC_DOWNLOAD_SAMPLE_HEADER 0xAC | ||
111 | #define WFC_UPLOAD_SAMPLE_HEADER 0xAD | ||
112 | #define WFC_UPLOAD_MULTISAMPLE 0xAE | ||
113 | #define WFC_UPLOAD_SAMPLE_ALIAS 0xAF | ||
114 | #define WFC_IDENTIFY_SAMPLE_TYPE 0xB0 | ||
115 | #define WFC_DOWNLOAD_EDRUM_PROGRAM 0xB1 | ||
116 | #define WFC_UPLOAD_EDRUM_PROGRAM 0xB2 | ||
117 | #define WFC_SET_EDRUM_CHANNEL 0xB3 | ||
118 | #define WFC_INSTOUT_LEVELS 0xB4 | ||
119 | #define WFC_PEAKOUT_LEVELS 0xB5 | ||
120 | #define WFC_REPORT_CHANNEL_PROGRAMS 0xB6 | ||
121 | #define WFC_HARDWARE_VERSION 0xCF | ||
122 | #define WFC_UPLOAD_SAMPLE_PARAMS 0xD7 | ||
123 | #define WFC_DOWNLOAD_OS 0xF1 | ||
124 | #define WFC_NOOP 0xFF | ||
125 | |||
126 | #define WF_MAX_SAMPLE 512 | ||
127 | #define WF_MAX_PATCH 256 | ||
128 | #define WF_MAX_PROGRAM 128 | ||
129 | |||
130 | #define WF_SECTION_MAX 44 /* longest OS section length */ | ||
131 | |||
132 | /* # of bytes we send to the board when sending it various kinds of | ||
133 | substantive data, such as samples, patches and programs. | ||
134 | */ | ||
135 | |||
136 | #define WF_PROGRAM_BYTES 32 | ||
137 | #define WF_PATCH_BYTES 132 | ||
138 | #define WF_SAMPLE_BYTES 27 | ||
139 | #define WF_SAMPLE_HDR_BYTES 25 | ||
140 | #define WF_ALIAS_BYTES 25 | ||
141 | #define WF_DRUM_BYTES 9 | ||
142 | #define WF_MSAMPLE_BYTES 259 /* (MIDI_KEYS * 2) + 3 */ | ||
143 | |||
144 | #define WF_ACK 0x80 | ||
145 | #define WF_DMA_ACK 0x81 | ||
146 | |||
147 | /* OR-values for MIDI status bits */ | ||
148 | |||
149 | #define WF_MIDI_VIRTUAL_ENABLED 0x1 | ||
150 | #define WF_MIDI_VIRTUAL_IS_EXTERNAL 0x2 | ||
151 | #define WF_MIDI_IN_TO_SYNTH_DISABLED 0x4 | ||
152 | |||
153 | /* slot indexes for struct address_info: makes code a little more mnemonic */ | ||
154 | |||
155 | #define WF_SYNTH_SLOT 0 | ||
156 | #define WF_INTERNAL_MIDI_SLOT 1 | ||
157 | #define WF_EXTERNAL_MIDI_SLOT 2 | ||
158 | |||
159 | /* Magic MIDI bytes used to switch I/O streams on the ICS2115 MPU401 | ||
160 | emulation. Note these NEVER show up in output from the device and | ||
161 | should NEVER be used in input unless Virtual MIDI mode has been | ||
162 | disabled. If they do show up as input, the results are unpredictable. | ||
163 | */ | ||
164 | |||
165 | #define WF_EXTERNAL_SWITCH 0xFD | ||
166 | #define WF_INTERNAL_SWITCH 0xF9 | ||
167 | |||
168 | /* Debugging flags */ | ||
169 | |||
170 | #define WF_DEBUG_CMD 0x1 | ||
171 | #define WF_DEBUG_DATA 0x2 | ||
172 | #define WF_DEBUG_LOAD_PATCH 0x4 | ||
173 | #define WF_DEBUG_IO 0x8 | ||
174 | |||
175 | /* WavePatch file format stuff */ | ||
176 | |||
177 | #define WF_WAVEPATCH_VERSION 120; /* Current version number (1.2) */ | ||
178 | #define WF_MAX_COMMENT 64 /* Comment length */ | ||
179 | #define WF_NUM_LAYERS 4 | ||
180 | #define WF_NAME_LENGTH 32 | ||
181 | #define WF_SOURCE_LENGTH 260 | ||
182 | |||
183 | #define BankFileID "Bank" | ||
184 | #define DrumkitFileID "DrumKit" | ||
185 | #define ProgramFileID "Program" | ||
186 | |||
187 | struct wf_envelope | ||
188 | { | ||
189 | UCHAR8 attack_time:7; | ||
190 | UCHAR8 Unused1:1; | ||
191 | |||
192 | UCHAR8 decay1_time:7; | ||
193 | UCHAR8 Unused2:1; | ||
194 | |||
195 | UCHAR8 decay2_time:7; | ||
196 | UCHAR8 Unused3:1; | ||
197 | |||
198 | UCHAR8 sustain_time:7; | ||
199 | UCHAR8 Unused4:1; | ||
200 | |||
201 | UCHAR8 release_time:7; | ||
202 | UCHAR8 Unused5:1; | ||
203 | |||
204 | UCHAR8 release2_time:7; | ||
205 | UCHAR8 Unused6:1; | ||
206 | |||
207 | CHAR8 attack_level; | ||
208 | CHAR8 decay1_level; | ||
209 | CHAR8 decay2_level; | ||
210 | CHAR8 sustain_level; | ||
211 | CHAR8 release_level; | ||
212 | |||
213 | UCHAR8 attack_velocity:7; | ||
214 | UCHAR8 Unused7:1; | ||
215 | |||
216 | UCHAR8 volume_velocity:7; | ||
217 | UCHAR8 Unused8:1; | ||
218 | |||
219 | UCHAR8 keyboard_scaling:7; | ||
220 | UCHAR8 Unused9:1; | ||
221 | }; | ||
222 | typedef struct wf_envelope wavefront_envelope; | ||
223 | |||
224 | struct wf_lfo | ||
225 | { | ||
226 | UCHAR8 sample_number; | ||
227 | |||
228 | UCHAR8 frequency:7; | ||
229 | UCHAR8 Unused1:1; | ||
230 | |||
231 | UCHAR8 am_src:4; | ||
232 | UCHAR8 fm_src:4; | ||
233 | |||
234 | CHAR8 fm_amount; | ||
235 | CHAR8 am_amount; | ||
236 | CHAR8 start_level; | ||
237 | CHAR8 end_level; | ||
238 | |||
239 | UCHAR8 ramp_delay:7; | ||
240 | UCHAR8 wave_restart:1; /* for LFO2 only */ | ||
241 | |||
242 | UCHAR8 ramp_time:7; | ||
243 | UCHAR8 Unused2:1; | ||
244 | }; | ||
245 | typedef struct wf_lfo wavefront_lfo; | ||
246 | |||
247 | struct wf_patch | ||
248 | { | ||
249 | INT16 frequency_bias; /* ** THIS IS IN MOTOROLA FORMAT!! ** */ | ||
250 | |||
251 | UCHAR8 amplitude_bias:7; | ||
252 | UCHAR8 Unused1:1; | ||
253 | |||
254 | UCHAR8 portamento:7; | ||
255 | UCHAR8 Unused2:1; | ||
256 | |||
257 | UCHAR8 sample_number; | ||
258 | |||
259 | UCHAR8 pitch_bend:4; | ||
260 | UCHAR8 sample_msb:1; | ||
261 | UCHAR8 Unused3:3; | ||
262 | |||
263 | UCHAR8 mono:1; | ||
264 | UCHAR8 retrigger:1; | ||
265 | UCHAR8 nohold:1; | ||
266 | UCHAR8 restart:1; | ||
267 | UCHAR8 filterconfig:2; /* SDK says "not used" */ | ||
268 | UCHAR8 reuse:1; | ||
269 | UCHAR8 reset_lfo:1; | ||
270 | |||
271 | UCHAR8 fm_src2:4; | ||
272 | UCHAR8 fm_src1:4; | ||
273 | |||
274 | CHAR8 fm_amount1; | ||
275 | CHAR8 fm_amount2; | ||
276 | |||
277 | UCHAR8 am_src:4; | ||
278 | UCHAR8 Unused4:4; | ||
279 | |||
280 | CHAR8 am_amount; | ||
281 | |||
282 | UCHAR8 fc1_mode:4; | ||
283 | UCHAR8 fc2_mode:4; | ||
284 | |||
285 | CHAR8 fc1_mod_amount; | ||
286 | CHAR8 fc1_keyboard_scaling; | ||
287 | CHAR8 fc1_bias; | ||
288 | CHAR8 fc2_mod_amount; | ||
289 | CHAR8 fc2_keyboard_scaling; | ||
290 | CHAR8 fc2_bias; | ||
291 | |||
292 | UCHAR8 randomizer:7; | ||
293 | UCHAR8 Unused5:1; | ||
294 | |||
295 | struct wf_envelope envelope1; | ||
296 | struct wf_envelope envelope2; | ||
297 | struct wf_lfo lfo1; | ||
298 | struct wf_lfo lfo2; | ||
299 | }; | ||
300 | typedef struct wf_patch wavefront_patch; | ||
301 | |||
302 | struct wf_layer | ||
303 | { | ||
304 | UCHAR8 patch_number; | ||
305 | |||
306 | UCHAR8 mix_level:7; | ||
307 | UCHAR8 mute:1; | ||
308 | |||
309 | UCHAR8 split_point:7; | ||
310 | UCHAR8 play_below:1; | ||
311 | |||
312 | UCHAR8 pan_mod_src:2; | ||
313 | UCHAR8 pan_or_mod:1; | ||
314 | UCHAR8 pan:4; | ||
315 | UCHAR8 split_type:1; | ||
316 | }; | ||
317 | typedef struct wf_layer wavefront_layer; | ||
318 | |||
319 | struct wf_program | ||
320 | { | ||
321 | struct wf_layer layer[WF_NUM_LAYERS]; | ||
322 | }; | ||
323 | typedef struct wf_program wavefront_program; | ||
324 | |||
325 | struct wf_sample_offset | ||
326 | { | ||
327 | INT32 Fraction:4; | ||
328 | INT32 Integer:20; | ||
329 | INT32 Unused:8; | ||
330 | }; | ||
331 | typedef struct wf_sample_offset wavefront_sample_offset; | ||
332 | |||
333 | /* Sample slot types */ | ||
334 | |||
335 | #define WF_ST_SAMPLE 0 | ||
336 | #define WF_ST_MULTISAMPLE 1 | ||
337 | #define WF_ST_ALIAS 2 | ||
338 | #define WF_ST_EMPTY 3 | ||
339 | |||
340 | /* pseudo's */ | ||
341 | |||
342 | #define WF_ST_DRUM 4 | ||
343 | #define WF_ST_PROGRAM 5 | ||
344 | #define WF_ST_PATCH 6 | ||
345 | #define WF_ST_SAMPLEHDR 7 | ||
346 | |||
347 | #define WF_ST_MASK 0xf | ||
348 | |||
349 | /* Flags for slot status. These occupy the upper bits of the same byte | ||
350 | as a sample type. | ||
351 | */ | ||
352 | |||
353 | #define WF_SLOT_USED 0x80 /* XXX don't rely on this being accurate */ | ||
354 | #define WF_SLOT_FILLED 0x40 | ||
355 | #define WF_SLOT_ROM 0x20 | ||
356 | |||
357 | #define WF_SLOT_MASK 0xf0 | ||
358 | |||
359 | /* channel constants */ | ||
360 | |||
361 | #define WF_CH_MONO 0 | ||
362 | #define WF_CH_LEFT 1 | ||
363 | #define WF_CH_RIGHT 2 | ||
364 | |||
365 | /* Sample formats */ | ||
366 | |||
367 | #define LINEAR_16BIT 0 | ||
368 | #define WHITE_NOISE 1 | ||
369 | #define LINEAR_8BIT 2 | ||
370 | #define MULAW_8BIT 3 | ||
371 | |||
372 | #define WF_SAMPLE_IS_8BIT(smpl) ((smpl)->SampleResolution&2) | ||
373 | |||
374 | |||
375 | /* | ||
376 | |||
377 | Because most/all of the sample data we pass in via pointers has | ||
378 | never been copied (just mmap-ed into user space straight from the | ||
379 | disk), it would be nice to allow handling of multi-channel sample | ||
380 | data without forcing user-level extraction of the relevant bytes. | ||
381 | |||
382 | So, we need a way of specifying which channel to use (the WaveFront | ||
383 | only handles mono samples in a given slot), and the only way to do | ||
384 | this without using some struct other than wavefront_sample as the | ||
385 | interface is the awful hack of using the unused bits in a | ||
386 | wavefront_sample: | ||
387 | |||
388 | Val Meaning | ||
389 | --- ------- | ||
390 | 0 no channel selection (use channel 1, sample is MONO) | ||
391 | 1 use first channel, and skip one | ||
392 | 2 use second channel, and skip one | ||
393 | 3 use third channel, and skip two | ||
394 | 4 use fourth channel, skip three | ||
395 | 5 use fifth channel, skip four | ||
396 | 6 use six channel, skip five | ||
397 | |||
398 | |||
399 | This can handle up to 4 channels, and anyone downloading >4 channels | ||
400 | of sample data just to select one of them needs to find some tools | ||
401 | like sox ... | ||
402 | |||
403 | NOTE: values 0, 1 and 2 correspond to WF_CH_* above. This is | ||
404 | important. | ||
405 | |||
406 | */ | ||
407 | |||
408 | #define WF_SET_CHANNEL(samp,chn) \ | ||
409 | (samp)->Unused1 = chn & 0x1; \ | ||
410 | (samp)->Unused2 = chn & 0x2; \ | ||
411 | (samp)->Unused3 = chn & 0x4 | ||
412 | |||
413 | #define WF_GET_CHANNEL(samp) \ | ||
414 | (((samp)->Unused3 << 2)|((samp)->Unused2<<1)|(samp)->Unused1) | ||
415 | |||
416 | typedef struct wf_sample { | ||
417 | struct wf_sample_offset sampleStartOffset; | ||
418 | struct wf_sample_offset loopStartOffset; | ||
419 | struct wf_sample_offset loopEndOffset; | ||
420 | struct wf_sample_offset sampleEndOffset; | ||
421 | INT16 FrequencyBias; | ||
422 | UCHAR8 SampleResolution:2; /* sample_format */ | ||
423 | UCHAR8 Unused1:1; | ||
424 | UCHAR8 Loop:1; | ||
425 | UCHAR8 Bidirectional:1; | ||
426 | UCHAR8 Unused2:1; | ||
427 | UCHAR8 Reverse:1; | ||
428 | UCHAR8 Unused3:1; | ||
429 | } wavefront_sample; | ||
430 | |||
431 | typedef struct wf_multisample { | ||
432 | INT16 NumberOfSamples; /* log2 of the number of samples */ | ||
433 | INT16 SampleNumber[NUM_MIDIKEYS]; | ||
434 | } wavefront_multisample; | ||
435 | |||
436 | typedef struct wf_alias { | ||
437 | INT16 OriginalSample; | ||
438 | |||
439 | struct wf_sample_offset sampleStartOffset; | ||
440 | struct wf_sample_offset loopStartOffset; | ||
441 | struct wf_sample_offset sampleEndOffset; | ||
442 | struct wf_sample_offset loopEndOffset; | ||
443 | |||
444 | INT16 FrequencyBias; | ||
445 | |||
446 | UCHAR8 SampleResolution:2; | ||
447 | UCHAR8 Unused1:1; | ||
448 | UCHAR8 Loop:1; | ||
449 | UCHAR8 Bidirectional:1; | ||
450 | UCHAR8 Unused2:1; | ||
451 | UCHAR8 Reverse:1; | ||
452 | UCHAR8 Unused3:1; | ||
453 | |||
454 | /* This structure is meant to be padded only to 16 bits on their | ||
455 | original. Of course, whoever wrote their documentation didn't | ||
456 | realize that sizeof(struct) can be >= | ||
457 | sum(sizeof(struct-fields)) and so thought that giving a C level | ||
458 | description of the structs used in WavePatch files was | ||
459 | sufficient. I suppose it was, as long as you remember the | ||
460 | standard 16->32 bit issues. | ||
461 | */ | ||
462 | |||
463 | UCHAR8 sixteen_bit_padding; | ||
464 | } __attribute__((packed)) wavefront_alias; | ||
465 | |||
466 | typedef struct wf_drum { | ||
467 | UCHAR8 PatchNumber; | ||
468 | UCHAR8 MixLevel:7; | ||
469 | UCHAR8 Unmute:1; | ||
470 | UCHAR8 Group:4; | ||
471 | UCHAR8 Unused1:4; | ||
472 | UCHAR8 PanModSource:2; | ||
473 | UCHAR8 PanModulated:1; | ||
474 | UCHAR8 PanAmount:4; | ||
475 | UCHAR8 Unused2:1; | ||
476 | } wavefront_drum; | ||
477 | |||
478 | typedef struct wf_drumkit { | ||
479 | struct wf_drum drum[NUM_MIDIKEYS]; | ||
480 | } wavefront_drumkit; | ||
481 | |||
482 | typedef struct wf_channel_programs { | ||
483 | UCHAR8 Program[NUM_MIDICHANNELS]; | ||
484 | } wavefront_channel_programs; | ||
485 | |||
486 | /* How to get MIDI channel status from the data returned by | ||
487 | a WFC_GET_CHANNEL_STATUS command (a struct wf_channel_programs) | ||
488 | */ | ||
489 | |||
490 | #define WF_CHANNEL_STATUS(ch,wcp) (wcp)[(ch/7)] & (1<<((ch)%7)) | ||
491 | |||
492 | typedef union wf_any { | ||
493 | wavefront_sample s; | ||
494 | wavefront_multisample ms; | ||
495 | wavefront_alias a; | ||
496 | wavefront_program pr; | ||
497 | wavefront_patch p; | ||
498 | wavefront_drum d; | ||
499 | } wavefront_any; | ||
500 | |||
501 | /* Hannu Solvainen hoped that his "patch_info" struct in soundcard.h | ||
502 | might work for other wave-table based patch loading situations. | ||
503 | Alas, his fears were correct. The WaveFront doesn't even come with | ||
504 | just "patches", but several different kind of structures that | ||
505 | control the sound generation process. | ||
506 | */ | ||
507 | |||
508 | typedef struct wf_patch_info { | ||
509 | |||
510 | /* the first two fields are used by the OSS "patch loading" interface | ||
511 | only, and are unused by the current user-level library. | ||
512 | */ | ||
513 | |||
514 | INT16 key; /* Use WAVEFRONT_PATCH here */ | ||
515 | UINT16 devno; /* fill in when sending */ | ||
516 | UCHAR8 subkey; /* WF_ST_{SAMPLE,ALIAS,etc.} */ | ||
517 | |||
518 | #define WAVEFRONT_FIND_FREE_SAMPLE_SLOT 999 | ||
519 | |||
520 | UINT16 number; /* patch/sample/prog number */ | ||
521 | |||
522 | UINT32 size; /* size of any data included in | ||
523 | one of the fields in `hdrptr', or | ||
524 | as `dataptr'. | ||
525 | |||
526 | NOTE: for actual samples, this is | ||
527 | the size of the *SELECTED CHANNEL* | ||
528 | even if more data is actually available. | ||
529 | |||
530 | So, a stereo sample (2 channels) of | ||
531 | 6000 bytes total has `size' = 3000. | ||
532 | |||
533 | See the macros and comments for | ||
534 | WF_{GET,SET}_CHANNEL above. | ||
535 | |||
536 | */ | ||
537 | wavefront_any __user *hdrptr; /* user-space ptr to hdr bytes */ | ||
538 | UINT16 __user *dataptr; /* actual sample data */ | ||
539 | |||
540 | wavefront_any hdr; /* kernel-space copy of hdr bytes */ | ||
541 | } wavefront_patch_info; | ||
542 | |||
543 | /* The maximum number of bytes we will ever move to or from user space | ||
544 | in response to a WFC_* command. This obviously doesn't cover | ||
545 | actual sample data. | ||
546 | */ | ||
547 | |||
548 | #define WF_MAX_READ sizeof(wavefront_multisample) | ||
549 | #define WF_MAX_WRITE sizeof(wavefront_multisample) | ||
550 | |||
551 | /* | ||
552 | This allows us to execute any WF command except the download/upload | ||
553 | ones, which are handled differently due to copyin/copyout issues as | ||
554 | well as data-nybbling to/from the card. | ||
555 | */ | ||
556 | |||
557 | typedef struct wavefront_control { | ||
558 | int cmd; /* WFC_* */ | ||
559 | char status; /* return status to user-space */ | ||
560 | unsigned char rbuf[WF_MAX_READ]; /* bytes read from card */ | ||
561 | unsigned char wbuf[WF_MAX_WRITE]; /* bytes written to card */ | ||
562 | } wavefront_control; | ||
563 | |||
564 | #define WFCTL_WFCMD 0x1 | ||
565 | #define WFCTL_LOAD_SPP 0x2 | ||
566 | |||
567 | /* Modulator table */ | ||
568 | |||
569 | #define WF_MOD_LFO1 0 | ||
570 | #define WF_MOD_LFO2 1 | ||
571 | #define WF_MOD_ENV1 2 | ||
572 | #define WF_MOD_ENV2 3 | ||
573 | #define WF_MOD_KEYBOARD 4 | ||
574 | #define WF_MOD_LOGKEY 5 | ||
575 | #define WF_MOD_VELOCITY 6 | ||
576 | #define WF_MOD_LOGVEL 7 | ||
577 | #define WF_MOD_RANDOM 8 | ||
578 | #define WF_MOD_PRESSURE 9 | ||
579 | #define WF_MOD_MOD_WHEEL 10 | ||
580 | #define WF_MOD_1 WF_MOD_MOD_WHEEL | ||
581 | #define WF_MOD_BREATH 11 | ||
582 | #define WF_MOD_2 WF_MOD_BREATH | ||
583 | #define WF_MOD_FOOT 12 | ||
584 | #define WF_MOD_4 WF_MOD_FOOT | ||
585 | #define WF_MOD_VOLUME 13 | ||
586 | #define WF_MOD_7 WF_MOD_VOLUME | ||
587 | #define WF_MOD_PAN 14 | ||
588 | #define WF_MOD_10 WF_MOD_PAN | ||
589 | #define WF_MOD_EXPR 15 | ||
590 | #define WF_MOD_11 WF_MOD_EXPR | ||
591 | |||
592 | /* FX-related material */ | ||
593 | |||
594 | typedef struct wf_fx_info { | ||
595 | int request; /* see list below */ | ||
596 | int data[4]; /* we don't need much */ | ||
597 | } wavefront_fx_info; | ||
598 | |||
599 | /* support for each of these will be forthcoming once I or someone | ||
600 | else has figured out which of the addresses on page 6 and page 7 of | ||
601 | the YSS225 control each parameter. Incidentally, these come from | ||
602 | the Windows driver interface, but again, Turtle Beach didn't | ||
603 | document the API to use them. | ||
604 | */ | ||
605 | |||
606 | #define WFFX_SETOUTGAIN 0 | ||
607 | #define WFFX_SETSTEREOOUTGAIN 1 | ||
608 | #define WFFX_SETREVERBIN1GAIN 2 | ||
609 | #define WFFX_SETREVERBIN2GAIN 3 | ||
610 | #define WFFX_SETREVERBIN3GAIN 4 | ||
611 | #define WFFX_SETCHORUSINPORT 5 | ||
612 | #define WFFX_SETREVERBIN1PORT 6 | ||
613 | #define WFFX_SETREVERBIN2PORT 7 | ||
614 | #define WFFX_SETREVERBIN3PORT 8 | ||
615 | #define WFFX_SETEFFECTPORT 9 | ||
616 | #define WFFX_SETAUXPORT 10 | ||
617 | #define WFFX_SETREVERBTYPE 11 | ||
618 | #define WFFX_SETREVERBDELAY 12 | ||
619 | #define WFFX_SETCHORUSLFO 13 | ||
620 | #define WFFX_SETCHORUSPMD 14 | ||
621 | #define WFFX_SETCHORUSAMD 15 | ||
622 | #define WFFX_SETEFFECT 16 | ||
623 | #define WFFX_SETBASEALL 17 | ||
624 | #define WFFX_SETREVERBALL 18 | ||
625 | #define WFFX_SETCHORUSALL 20 | ||
626 | #define WFFX_SETREVERBDEF 22 | ||
627 | #define WFFX_SETCHORUSDEF 23 | ||
628 | #define WFFX_DELAYSETINGAIN 24 | ||
629 | #define WFFX_DELAYSETFBGAIN 25 | ||
630 | #define WFFX_DELAYSETFBLPF 26 | ||
631 | #define WFFX_DELAYSETGAIN 27 | ||
632 | #define WFFX_DELAYSETTIME 28 | ||
633 | #define WFFX_DELAYSETFBTIME 29 | ||
634 | #define WFFX_DELAYSETALL 30 | ||
635 | #define WFFX_DELAYSETDEF 32 | ||
636 | #define WFFX_SDELAYSETINGAIN 33 | ||
637 | #define WFFX_SDELAYSETFBGAIN 34 | ||
638 | #define WFFX_SDELAYSETFBLPF 35 | ||
639 | #define WFFX_SDELAYSETGAIN 36 | ||
640 | #define WFFX_SDELAYSETTIME 37 | ||
641 | #define WFFX_SDELAYSETFBTIME 38 | ||
642 | #define WFFX_SDELAYSETALL 39 | ||
643 | #define WFFX_SDELAYSETDEF 41 | ||
644 | #define WFFX_DEQSETINGAIN 42 | ||
645 | #define WFFX_DEQSETFILTER 43 | ||
646 | #define WFFX_DEQSETALL 44 | ||
647 | #define WFFX_DEQSETDEF 46 | ||
648 | #define WFFX_MUTE 47 | ||
649 | #define WFFX_FLANGESETBALANCE 48 | ||
650 | #define WFFX_FLANGESETDELAY 49 | ||
651 | #define WFFX_FLANGESETDWFFX_TH 50 | ||
652 | #define WFFX_FLANGESETFBGAIN 51 | ||
653 | #define WFFX_FLANGESETINGAIN 52 | ||
654 | #define WFFX_FLANGESETLFO 53 | ||
655 | #define WFFX_FLANGESETALL 54 | ||
656 | #define WFFX_FLANGESETDEF 56 | ||
657 | #define WFFX_PITCHSETSHIFT 57 | ||
658 | #define WFFX_PITCHSETBALANCE 58 | ||
659 | #define WFFX_PITCHSETALL 59 | ||
660 | #define WFFX_PITCHSETDEF 61 | ||
661 | #define WFFX_SRSSETINGAIN 62 | ||
662 | #define WFFX_SRSSETSPACE 63 | ||
663 | #define WFFX_SRSSETCENTER 64 | ||
664 | #define WFFX_SRSSETGAIN 65 | ||
665 | #define WFFX_SRSSETMODE 66 | ||
666 | #define WFFX_SRSSETDEF 68 | ||
667 | |||
668 | /* Allow direct user-space control over FX memory/coefficient data. | ||
669 | In theory this could be used to download the FX microprogram, | ||
670 | but it would be a little slower, and involve some weird code. | ||
671 | */ | ||
672 | |||
673 | #define WFFX_MEMSET 69 | ||
674 | |||
675 | #endif /* __wavefront_h__ */ | ||
diff --git a/include/linux/wireless.h b/include/linux/wireless.h index 13588564b42b..a50a0130fd9e 100644 --- a/include/linux/wireless.h +++ b/include/linux/wireless.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * This file define a set of standard wireless extensions | 2 | * This file define a set of standard wireless extensions |
3 | * | 3 | * |
4 | * Version : 20 17.2.06 | 4 | * Version : 21 14.3.06 |
5 | * | 5 | * |
6 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> | 6 | * Authors : Jean Tourrilhes - HPL - <jt@hpl.hp.com> |
7 | * Copyright (c) 1997-2006 Jean Tourrilhes, All Rights Reserved. | 7 | * Copyright (c) 1997-2006 Jean Tourrilhes, All Rights Reserved. |
@@ -69,9 +69,14 @@ | |||
69 | 69 | ||
70 | /***************************** INCLUDES *****************************/ | 70 | /***************************** INCLUDES *****************************/ |
71 | 71 | ||
72 | /* This header is used in user-space, therefore need to be sanitised | ||
73 | * for that purpose. Those includes are usually not compatible with glibc. | ||
74 | * To know which includes to use in user-space, check iwlib.h. */ | ||
75 | #ifdef __KERNEL__ | ||
72 | #include <linux/types.h> /* for "caddr_t" et al */ | 76 | #include <linux/types.h> /* for "caddr_t" et al */ |
73 | #include <linux/socket.h> /* for "struct sockaddr" et al */ | 77 | #include <linux/socket.h> /* for "struct sockaddr" et al */ |
74 | #include <linux/if.h> /* for IFNAMSIZ and co... */ | 78 | #include <linux/if.h> /* for IFNAMSIZ and co... */ |
79 | #endif /* __KERNEL__ */ | ||
75 | 80 | ||
76 | /***************************** VERSION *****************************/ | 81 | /***************************** VERSION *****************************/ |
77 | /* | 82 | /* |
@@ -80,7 +85,7 @@ | |||
80 | * (there is some stuff that will be added in the future...) | 85 | * (there is some stuff that will be added in the future...) |
81 | * I just plan to increment with each new version. | 86 | * I just plan to increment with each new version. |
82 | */ | 87 | */ |
83 | #define WIRELESS_EXT 20 | 88 | #define WIRELESS_EXT 21 |
84 | 89 | ||
85 | /* | 90 | /* |
86 | * Changes : | 91 | * Changes : |
@@ -208,6 +213,14 @@ | |||
208 | * V19 to V20 | 213 | * V19 to V20 |
209 | * ---------- | 214 | * ---------- |
210 | * - RtNetlink requests support (SET/GET) | 215 | * - RtNetlink requests support (SET/GET) |
216 | * | ||
217 | * V20 to V21 | ||
218 | * ---------- | ||
219 | * - Remove (struct net_device *)->get_wireless_stats() | ||
220 | * - Change length in ESSID and NICK to strlen() instead of strlen()+1 | ||
221 | * - Add IW_RETRY_SHORT/IW_RETRY_LONG retry modifiers | ||
222 | * - Power/Retry relative values no longer * 100000 | ||
223 | * - Add explicit flag to tell stats are in 802.11k RCPI : IW_QUAL_RCPI | ||
211 | */ | 224 | */ |
212 | 225 | ||
213 | /**************************** CONSTANTS ****************************/ | 226 | /**************************** CONSTANTS ****************************/ |
@@ -448,6 +461,7 @@ | |||
448 | #define IW_QUAL_QUAL_INVALID 0x10 /* Driver doesn't provide value */ | 461 | #define IW_QUAL_QUAL_INVALID 0x10 /* Driver doesn't provide value */ |
449 | #define IW_QUAL_LEVEL_INVALID 0x20 | 462 | #define IW_QUAL_LEVEL_INVALID 0x20 |
450 | #define IW_QUAL_NOISE_INVALID 0x40 | 463 | #define IW_QUAL_NOISE_INVALID 0x40 |
464 | #define IW_QUAL_RCPI 0x80 /* Level + Noise are 802.11k RCPI */ | ||
451 | #define IW_QUAL_ALL_INVALID 0x70 | 465 | #define IW_QUAL_ALL_INVALID 0x70 |
452 | 466 | ||
453 | /* Frequency flags */ | 467 | /* Frequency flags */ |
@@ -500,10 +514,12 @@ | |||
500 | #define IW_RETRY_TYPE 0xF000 /* Type of parameter */ | 514 | #define IW_RETRY_TYPE 0xF000 /* Type of parameter */ |
501 | #define IW_RETRY_LIMIT 0x1000 /* Maximum number of retries*/ | 515 | #define IW_RETRY_LIMIT 0x1000 /* Maximum number of retries*/ |
502 | #define IW_RETRY_LIFETIME 0x2000 /* Maximum duration of retries in us */ | 516 | #define IW_RETRY_LIFETIME 0x2000 /* Maximum duration of retries in us */ |
503 | #define IW_RETRY_MODIFIER 0x000F /* Modify a parameter */ | 517 | #define IW_RETRY_MODIFIER 0x00FF /* Modify a parameter */ |
504 | #define IW_RETRY_MIN 0x0001 /* Value is a minimum */ | 518 | #define IW_RETRY_MIN 0x0001 /* Value is a minimum */ |
505 | #define IW_RETRY_MAX 0x0002 /* Value is a maximum */ | 519 | #define IW_RETRY_MAX 0x0002 /* Value is a maximum */ |
506 | #define IW_RETRY_RELATIVE 0x0004 /* Value is not in seconds/ms/us */ | 520 | #define IW_RETRY_RELATIVE 0x0004 /* Value is not in seconds/ms/us */ |
521 | #define IW_RETRY_SHORT 0x0010 /* Value is for short packets */ | ||
522 | #define IW_RETRY_LONG 0x0020 /* Value is for long packets */ | ||
507 | 523 | ||
508 | /* Scanning request flags */ | 524 | /* Scanning request flags */ |
509 | #define IW_SCAN_DEFAULT 0x0000 /* Default scan of the driver */ | 525 | #define IW_SCAN_DEFAULT 0x0000 /* Default scan of the driver */ |
@@ -1017,7 +1033,7 @@ struct iw_range | |||
1017 | /* Note : this frequency list doesn't need to fit channel numbers, | 1033 | /* Note : this frequency list doesn't need to fit channel numbers, |
1018 | * because each entry contain its channel index */ | 1034 | * because each entry contain its channel index */ |
1019 | 1035 | ||
1020 | __u32 enc_capa; /* IW_ENC_CAPA_* bit field */ | 1036 | __u32 enc_capa; /* IW_ENC_CAPA_* bit field */ |
1021 | }; | 1037 | }; |
1022 | 1038 | ||
1023 | /* | 1039 | /* |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 56a23a0e7f2e..a341c8032866 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * include/linux/writeback.h. | 2 | * include/linux/writeback.h |
3 | */ | 3 | */ |
4 | #ifndef WRITEBACK_H | 4 | #ifndef WRITEBACK_H |
5 | #define WRITEBACK_H | 5 | #define WRITEBACK_H |
@@ -111,12 +111,15 @@ balance_dirty_pages_ratelimited(struct address_space *mapping) | |||
111 | } | 111 | } |
112 | 112 | ||
113 | int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0); | 113 | int pdflush_operation(void (*fn)(unsigned long), unsigned long arg0); |
114 | extern int generic_writepages(struct address_space *mapping, | ||
115 | struct writeback_control *wbc); | ||
114 | int do_writepages(struct address_space *mapping, struct writeback_control *wbc); | 116 | int do_writepages(struct address_space *mapping, struct writeback_control *wbc); |
115 | int sync_page_range(struct inode *inode, struct address_space *mapping, | 117 | int sync_page_range(struct inode *inode, struct address_space *mapping, |
116 | loff_t pos, loff_t count); | 118 | loff_t pos, loff_t count); |
117 | int sync_page_range_nolock(struct inode *inode, struct address_space *mapping, | 119 | int sync_page_range_nolock(struct inode *inode, struct address_space *mapping, |
118 | loff_t pos, loff_t count); | 120 | loff_t pos, loff_t count); |
119 | void set_page_dirty_balance(struct page *page); | 121 | void set_page_dirty_balance(struct page *page); |
122 | void writeback_set_ratelimit(void); | ||
120 | 123 | ||
121 | /* pdflush.c */ | 124 | /* pdflush.c */ |
122 | extern int nr_pdflush_threads; /* Global so it can be exported to sysctl | 125 | extern int nr_pdflush_threads; /* Global so it can be exported to sysctl |
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index 14ecd19f4cdc..8ae7f744917b 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
@@ -12,8 +12,8 @@ | |||
12 | */ | 12 | */ |
13 | typedef union | 13 | typedef union |
14 | { | 14 | { |
15 | __u32 a4; | 15 | __be32 a4; |
16 | __u32 a6[4]; | 16 | __be32 a6[4]; |
17 | } xfrm_address_t; | 17 | } xfrm_address_t; |
18 | 18 | ||
19 | /* Ident of a specific xfrm_state. It is used on input to lookup | 19 | /* Ident of a specific xfrm_state. It is used on input to lookup |
@@ -23,7 +23,7 @@ typedef union | |||
23 | struct xfrm_id | 23 | struct xfrm_id |
24 | { | 24 | { |
25 | xfrm_address_t daddr; | 25 | xfrm_address_t daddr; |
26 | __u32 spi; | 26 | __be32 spi; |
27 | __u8 proto; | 27 | __u8 proto; |
28 | }; | 28 | }; |
29 | 29 | ||
@@ -49,10 +49,10 @@ struct xfrm_selector | |||
49 | { | 49 | { |
50 | xfrm_address_t daddr; | 50 | xfrm_address_t daddr; |
51 | xfrm_address_t saddr; | 51 | xfrm_address_t saddr; |
52 | __u16 dport; | 52 | __be16 dport; |
53 | __u16 dport_mask; | 53 | __be16 dport_mask; |
54 | __u16 sport; | 54 | __be16 sport; |
55 | __u16 sport_mask; | 55 | __be16 sport_mask; |
56 | __u16 family; | 56 | __u16 family; |
57 | __u8 prefixlen_d; | 57 | __u8 prefixlen_d; |
58 | __u8 prefixlen_s; | 58 | __u8 prefixlen_s; |
@@ -129,7 +129,8 @@ enum | |||
129 | #define XFRM_MODE_TUNNEL 1 | 129 | #define XFRM_MODE_TUNNEL 1 |
130 | #define XFRM_MODE_ROUTEOPTIMIZATION 2 | 130 | #define XFRM_MODE_ROUTEOPTIMIZATION 2 |
131 | #define XFRM_MODE_IN_TRIGGER 3 | 131 | #define XFRM_MODE_IN_TRIGGER 3 |
132 | #define XFRM_MODE_MAX 4 | 132 | #define XFRM_MODE_BEET 4 |
133 | #define XFRM_MODE_MAX 5 | ||
133 | 134 | ||
134 | /* Netlink configuration messages. */ | 135 | /* Netlink configuration messages. */ |
135 | enum { | 136 | enum { |
@@ -281,7 +282,7 @@ struct xfrm_usersa_info { | |||
281 | 282 | ||
282 | struct xfrm_usersa_id { | 283 | struct xfrm_usersa_id { |
283 | xfrm_address_t daddr; | 284 | xfrm_address_t daddr; |
284 | __u32 spi; | 285 | __be32 spi; |
285 | __u16 family; | 286 | __u16 family; |
286 | __u8 proto; | 287 | __u8 proto; |
287 | }; | 288 | }; |