diff options
Diffstat (limited to 'include')
421 files changed, 10169 insertions, 3995 deletions
diff --git a/include/acpi/acpi_hest.h b/include/acpi/acpi_hest.h new file mode 100644 index 000000000000..63194d03cb2d --- /dev/null +++ b/include/acpi/acpi_hest.h | |||
@@ -0,0 +1,12 @@ | |||
1 | #ifndef __ACPI_HEST_H | ||
2 | #define __ACPI_HEST_H | ||
3 | |||
4 | #include <linux/pci.h> | ||
5 | |||
6 | #ifdef CONFIG_ACPI | ||
7 | extern int acpi_hest_firmware_first_pci(struct pci_dev *pci); | ||
8 | #else | ||
9 | static inline int acpi_hest_firmware_first_pci(struct pci_dev *pci) { return 0; } | ||
10 | #endif | ||
11 | |||
12 | #endif | ||
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h index e723b0fd8e41..5e1ad3cd1bbd 100644 --- a/include/acpi/acpixf.h +++ b/include/acpi/acpixf.h | |||
@@ -47,7 +47,7 @@ | |||
47 | 47 | ||
48 | /* Current ACPICA subsystem version in YYYYMMDD format */ | 48 | /* Current ACPICA subsystem version in YYYYMMDD format */ |
49 | 49 | ||
50 | #define ACPI_CA_VERSION 0x20090903 | 50 | #define ACPI_CA_VERSION 0x20091112 |
51 | 51 | ||
52 | #include "actypes.h" | 52 | #include "actypes.h" |
53 | #include "actbl.h" | 53 | #include "actbl.h" |
@@ -154,7 +154,8 @@ acpi_status | |||
154 | acpi_walk_namespace(acpi_object_type type, | 154 | acpi_walk_namespace(acpi_object_type type, |
155 | acpi_handle start_object, | 155 | acpi_handle start_object, |
156 | u32 max_depth, | 156 | u32 max_depth, |
157 | acpi_walk_callback user_function, | 157 | acpi_walk_callback pre_order_visit, |
158 | acpi_walk_callback post_order_visit, | ||
158 | void *context, void **return_value); | 159 | void *context, void **return_value); |
159 | 160 | ||
160 | acpi_status | 161 | acpi_status |
diff --git a/include/asm-generic/cacheflush.h b/include/asm-generic/cacheflush.h index ba4ec39a1131..57b5c3c82e86 100644 --- a/include/asm-generic/cacheflush.h +++ b/include/asm-generic/cacheflush.h | |||
@@ -13,6 +13,7 @@ | |||
13 | #define flush_cache_dup_mm(mm) do { } while (0) | 13 | #define flush_cache_dup_mm(mm) do { } while (0) |
14 | #define flush_cache_range(vma, start, end) do { } while (0) | 14 | #define flush_cache_range(vma, start, end) do { } while (0) |
15 | #define flush_cache_page(vma, vmaddr, pfn) do { } while (0) | 15 | #define flush_cache_page(vma, vmaddr, pfn) do { } while (0) |
16 | #define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE 0 | ||
16 | #define flush_dcache_page(page) do { } while (0) | 17 | #define flush_dcache_page(page) do { } while (0) |
17 | #define flush_dcache_mmap_lock(mapping) do { } while (0) | 18 | #define flush_dcache_mmap_lock(mapping) do { } while (0) |
18 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) | 19 | #define flush_dcache_mmap_unlock(mapping) do { } while (0) |
diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h index 4c8d0afae711..fb2d63f13f4c 100644 --- a/include/asm-generic/memory_model.h +++ b/include/asm-generic/memory_model.h | |||
@@ -47,7 +47,7 @@ | |||
47 | 47 | ||
48 | #elif defined(CONFIG_SPARSEMEM_VMEMMAP) | 48 | #elif defined(CONFIG_SPARSEMEM_VMEMMAP) |
49 | 49 | ||
50 | /* memmap is virtually contigious. */ | 50 | /* memmap is virtually contiguous. */ |
51 | #define __pfn_to_page(pfn) (vmemmap + (pfn)) | 51 | #define __pfn_to_page(pfn) (vmemmap + (pfn)) |
52 | #define __page_to_pfn(page) (unsigned long)((page) - vmemmap) | 52 | #define __page_to_pfn(page) (unsigned long)((page) - vmemmap) |
53 | 53 | ||
diff --git a/include/asm-generic/socket.h b/include/asm-generic/socket.h index 538991cef6f0..9a6115e7cf63 100644 --- a/include/asm-generic/socket.h +++ b/include/asm-generic/socket.h | |||
@@ -63,4 +63,5 @@ | |||
63 | #define SO_PROTOCOL 38 | 63 | #define SO_PROTOCOL 38 |
64 | #define SO_DOMAIN 39 | 64 | #define SO_DOMAIN 39 |
65 | 65 | ||
66 | #define SO_RXQ_OVFL 40 | ||
66 | #endif /* __ASM_GENERIC_SOCKET_H */ | 67 | #endif /* __ASM_GENERIC_SOCKET_H */ |
diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h index d76b66acea95..7c38c147e5e6 100644 --- a/include/asm-generic/unistd.h +++ b/include/asm-generic/unistd.h | |||
@@ -631,7 +631,7 @@ __SYSCALL(__NR_perf_event_open, sys_perf_event_open) | |||
631 | * these are provided for both review and as a porting | 631 | * these are provided for both review and as a porting |
632 | * help for the C library version. | 632 | * help for the C library version. |
633 | * | 633 | * |
634 | * Last chance: are any of these important enought to | 634 | * Last chance: are any of these important enough to |
635 | * enable by default? | 635 | * enable by default? |
636 | */ | 636 | */ |
637 | #ifdef __ARCH_WANT_SYSCALL_NO_AT | 637 | #ifdef __ARCH_WANT_SYSCALL_NO_AT |
diff --git a/include/crypto/algapi.h b/include/crypto/algapi.h index 1ffb53f74d37..fc0d575c71e0 100644 --- a/include/crypto/algapi.h +++ b/include/crypto/algapi.h | |||
@@ -106,7 +106,6 @@ struct blkcipher_walk { | |||
106 | extern const struct crypto_type crypto_ablkcipher_type; | 106 | extern const struct crypto_type crypto_ablkcipher_type; |
107 | extern const struct crypto_type crypto_aead_type; | 107 | extern const struct crypto_type crypto_aead_type; |
108 | extern const struct crypto_type crypto_blkcipher_type; | 108 | extern const struct crypto_type crypto_blkcipher_type; |
109 | extern const struct crypto_type crypto_hash_type; | ||
110 | 109 | ||
111 | void crypto_mod_put(struct crypto_alg *alg); | 110 | void crypto_mod_put(struct crypto_alg *alg); |
112 | 111 | ||
diff --git a/include/crypto/cryptd.h b/include/crypto/cryptd.h index 2f65a6e8ea4d..1c96b255017c 100644 --- a/include/crypto/cryptd.h +++ b/include/crypto/cryptd.h | |||
@@ -39,6 +39,7 @@ static inline struct cryptd_ahash *__cryptd_ahash_cast( | |||
39 | struct cryptd_ahash *cryptd_alloc_ahash(const char *alg_name, | 39 | struct cryptd_ahash *cryptd_alloc_ahash(const char *alg_name, |
40 | u32 type, u32 mask); | 40 | u32 type, u32 mask); |
41 | struct crypto_shash *cryptd_ahash_child(struct cryptd_ahash *tfm); | 41 | struct crypto_shash *cryptd_ahash_child(struct cryptd_ahash *tfm); |
42 | struct shash_desc *cryptd_shash_desc(struct ahash_request *req); | ||
42 | void cryptd_free_ahash(struct cryptd_ahash *tfm); | 43 | void cryptd_free_ahash(struct cryptd_ahash *tfm); |
43 | 44 | ||
44 | #endif | 45 | #endif |
diff --git a/include/drm/Kbuild b/include/drm/Kbuild index b940fdfa3b25..cfa6af43c9ea 100644 --- a/include/drm/Kbuild +++ b/include/drm/Kbuild | |||
@@ -8,3 +8,4 @@ unifdef-y += radeon_drm.h | |||
8 | unifdef-y += sis_drm.h | 8 | unifdef-y += sis_drm.h |
9 | unifdef-y += savage_drm.h | 9 | unifdef-y += savage_drm.h |
10 | unifdef-y += via_drm.h | 10 | unifdef-y += via_drm.h |
11 | unifdef-y += nouveau_drm.h | ||
diff --git a/include/drm/drm.h b/include/drm/drm.h index 7cb50bdde46d..e3f46e0cb7dc 100644 --- a/include/drm/drm.h +++ b/include/drm/drm.h | |||
@@ -36,17 +36,27 @@ | |||
36 | #ifndef _DRM_H_ | 36 | #ifndef _DRM_H_ |
37 | #define _DRM_H_ | 37 | #define _DRM_H_ |
38 | 38 | ||
39 | #if defined(__linux__) | ||
40 | |||
39 | #include <linux/types.h> | 41 | #include <linux/types.h> |
40 | #include <asm/ioctl.h> /* For _IO* macros */ | 42 | #include <asm/ioctl.h> |
41 | #define DRM_IOCTL_NR(n) _IOC_NR(n) | 43 | typedef unsigned int drm_handle_t; |
42 | #define DRM_IOC_VOID _IOC_NONE | ||
43 | #define DRM_IOC_READ _IOC_READ | ||
44 | #define DRM_IOC_WRITE _IOC_WRITE | ||
45 | #define DRM_IOC_READWRITE _IOC_READ|_IOC_WRITE | ||
46 | #define DRM_IOC(dir, group, nr, size) _IOC(dir, group, nr, size) | ||
47 | 44 | ||
48 | #define DRM_MAJOR 226 | 45 | #else /* One of the BSDs */ |
49 | #define DRM_MAX_MINOR 15 | 46 | |
47 | #include <sys/ioccom.h> | ||
48 | #include <sys/types.h> | ||
49 | typedef int8_t __s8; | ||
50 | typedef uint8_t __u8; | ||
51 | typedef int16_t __s16; | ||
52 | typedef uint16_t __u16; | ||
53 | typedef int32_t __s32; | ||
54 | typedef uint32_t __u32; | ||
55 | typedef int64_t __s64; | ||
56 | typedef uint64_t __u64; | ||
57 | typedef unsigned long drm_handle_t; | ||
58 | |||
59 | #endif | ||
50 | 60 | ||
51 | #define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */ | 61 | #define DRM_NAME "drm" /**< Name in kernel, /dev, and /proc */ |
52 | #define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */ | 62 | #define DRM_MIN_ORDER 5 /**< At least 2^5 bytes = 32 bytes */ |
@@ -59,7 +69,6 @@ | |||
59 | #define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT) | 69 | #define _DRM_LOCK_IS_CONT(lock) ((lock) & _DRM_LOCK_CONT) |
60 | #define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT)) | 70 | #define _DRM_LOCKING_CONTEXT(lock) ((lock) & ~(_DRM_LOCK_HELD|_DRM_LOCK_CONT)) |
61 | 71 | ||
62 | typedef unsigned int drm_handle_t; | ||
63 | typedef unsigned int drm_context_t; | 72 | typedef unsigned int drm_context_t; |
64 | typedef unsigned int drm_drawable_t; | 73 | typedef unsigned int drm_drawable_t; |
65 | typedef unsigned int drm_magic_t; | 74 | typedef unsigned int drm_magic_t; |
@@ -454,6 +463,7 @@ struct drm_irq_busid { | |||
454 | enum drm_vblank_seq_type { | 463 | enum drm_vblank_seq_type { |
455 | _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */ | 464 | _DRM_VBLANK_ABSOLUTE = 0x0, /**< Wait for specific vblank sequence number */ |
456 | _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */ | 465 | _DRM_VBLANK_RELATIVE = 0x1, /**< Wait for given number of vblanks */ |
466 | _DRM_VBLANK_EVENT = 0x4000000, /**< Send event instead of blocking */ | ||
457 | _DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */ | 467 | _DRM_VBLANK_FLIP = 0x8000000, /**< Scheduled buffer swap should flip */ |
458 | _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */ | 468 | _DRM_VBLANK_NEXTONMISS = 0x10000000, /**< If missed, wait for next vblank */ |
459 | _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ | 469 | _DRM_VBLANK_SECONDARY = 0x20000000, /**< Secondary display controller */ |
@@ -461,8 +471,8 @@ enum drm_vblank_seq_type { | |||
461 | }; | 471 | }; |
462 | 472 | ||
463 | #define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE) | 473 | #define _DRM_VBLANK_TYPES_MASK (_DRM_VBLANK_ABSOLUTE | _DRM_VBLANK_RELATIVE) |
464 | #define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_SIGNAL | _DRM_VBLANK_SECONDARY | \ | 474 | #define _DRM_VBLANK_FLAGS_MASK (_DRM_VBLANK_EVENT | _DRM_VBLANK_SIGNAL | \ |
465 | _DRM_VBLANK_NEXTONMISS) | 475 | _DRM_VBLANK_SECONDARY | _DRM_VBLANK_NEXTONMISS) |
466 | 476 | ||
467 | struct drm_wait_vblank_request { | 477 | struct drm_wait_vblank_request { |
468 | enum drm_vblank_seq_type type; | 478 | enum drm_vblank_seq_type type; |
@@ -686,6 +696,8 @@ struct drm_gem_open { | |||
686 | #define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd) | 696 | #define DRM_IOCTL_MODE_GETFB DRM_IOWR(0xAD, struct drm_mode_fb_cmd) |
687 | #define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd) | 697 | #define DRM_IOCTL_MODE_ADDFB DRM_IOWR(0xAE, struct drm_mode_fb_cmd) |
688 | #define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int) | 698 | #define DRM_IOCTL_MODE_RMFB DRM_IOWR(0xAF, unsigned int) |
699 | #define DRM_IOCTL_MODE_PAGE_FLIP DRM_IOWR(0xB0, struct drm_mode_crtc_page_flip) | ||
700 | #define DRM_IOCTL_MODE_DIRTYFB DRM_IOWR(0xB1, struct drm_mode_fb_dirty_cmd) | ||
689 | 701 | ||
690 | /** | 702 | /** |
691 | * Device specific ioctls should only be in their respective headers | 703 | * Device specific ioctls should only be in their respective headers |
@@ -698,6 +710,35 @@ struct drm_gem_open { | |||
698 | #define DRM_COMMAND_BASE 0x40 | 710 | #define DRM_COMMAND_BASE 0x40 |
699 | #define DRM_COMMAND_END 0xA0 | 711 | #define DRM_COMMAND_END 0xA0 |
700 | 712 | ||
713 | /** | ||
714 | * Header for events written back to userspace on the drm fd. The | ||
715 | * type defines the type of event, the length specifies the total | ||
716 | * length of the event (including the header), and user_data is | ||
717 | * typically a 64 bit value passed with the ioctl that triggered the | ||
718 | * event. A read on the drm fd will always only return complete | ||
719 | * events, that is, if for example the read buffer is 100 bytes, and | ||
720 | * there are two 64 byte events pending, only one will be returned. | ||
721 | * | ||
722 | * Event types 0 - 0x7fffffff are generic drm events, 0x80000000 and | ||
723 | * up are chipset specific. | ||
724 | */ | ||
725 | struct drm_event { | ||
726 | __u32 type; | ||
727 | __u32 length; | ||
728 | }; | ||
729 | |||
730 | #define DRM_EVENT_VBLANK 0x01 | ||
731 | #define DRM_EVENT_FLIP_COMPLETE 0x02 | ||
732 | |||
733 | struct drm_event_vblank { | ||
734 | struct drm_event base; | ||
735 | __u64 user_data; | ||
736 | __u32 tv_sec; | ||
737 | __u32 tv_usec; | ||
738 | __u32 sequence; | ||
739 | __u32 reserved; | ||
740 | }; | ||
741 | |||
701 | /* typedef area */ | 742 | /* typedef area */ |
702 | #ifndef __KERNEL__ | 743 | #ifndef __KERNEL__ |
703 | typedef struct drm_clip_rect drm_clip_rect_t; | 744 | typedef struct drm_clip_rect drm_clip_rect_t; |
diff --git a/include/drm/drmP.h b/include/drm/drmP.h index c8e64bbadbcf..19ef8ebdc662 100644 --- a/include/drm/drmP.h +++ b/include/drm/drmP.h | |||
@@ -245,16 +245,6 @@ extern void drm_ut_debug_printk(unsigned int request_level, | |||
245 | 245 | ||
246 | #endif | 246 | #endif |
247 | 247 | ||
248 | #define DRM_PROC_LIMIT (PAGE_SIZE-80) | ||
249 | |||
250 | #define DRM_PROC_PRINT(fmt, arg...) \ | ||
251 | len += sprintf(&buf[len], fmt , ##arg); \ | ||
252 | if (len > DRM_PROC_LIMIT) { *eof = 1; return len - offset; } | ||
253 | |||
254 | #define DRM_PROC_PRINT_RET(ret, fmt, arg...) \ | ||
255 | len += sprintf(&buf[len], fmt , ##arg); \ | ||
256 | if (len > DRM_PROC_LIMIT) { ret; *eof = 1; return len - offset; } | ||
257 | |||
258 | /*@}*/ | 248 | /*@}*/ |
259 | 249 | ||
260 | /***********************************************************************/ | 250 | /***********************************************************************/ |
@@ -265,19 +255,8 @@ extern void drm_ut_debug_printk(unsigned int request_level, | |||
265 | 255 | ||
266 | #define DRM_LEFTCOUNT(x) (((x)->rp + (x)->count - (x)->wp) % ((x)->count + 1)) | 256 | #define DRM_LEFTCOUNT(x) (((x)->rp + (x)->count - (x)->wp) % ((x)->count + 1)) |
267 | #define DRM_BUFCOUNT(x) ((x)->count - DRM_LEFTCOUNT(x)) | 257 | #define DRM_BUFCOUNT(x) ((x)->count - DRM_LEFTCOUNT(x)) |
268 | #define DRM_WAITCOUNT(dev,idx) DRM_BUFCOUNT(&dev->queuelist[idx]->waitlist) | ||
269 | 258 | ||
270 | #define DRM_IF_VERSION(maj, min) (maj << 16 | min) | 259 | #define DRM_IF_VERSION(maj, min) (maj << 16 | min) |
271 | /** | ||
272 | * Get the private SAREA mapping. | ||
273 | * | ||
274 | * \param _dev DRM device. | ||
275 | * \param _ctx context number. | ||
276 | * \param _map output mapping. | ||
277 | */ | ||
278 | #define DRM_GET_PRIV_SAREA(_dev, _ctx, _map) do { \ | ||
279 | (_map) = (_dev)->context_sareas[_ctx]; \ | ||
280 | } while(0) | ||
281 | 260 | ||
282 | /** | 261 | /** |
283 | * Test that the hardware lock is held by the caller, returning otherwise. | 262 | * Test that the hardware lock is held by the caller, returning otherwise. |
@@ -297,18 +276,6 @@ do { \ | |||
297 | } while (0) | 276 | } while (0) |
298 | 277 | ||
299 | /** | 278 | /** |
300 | * Copy and IOCTL return string to user space | ||
301 | */ | ||
302 | #define DRM_COPY( name, value ) \ | ||
303 | len = strlen( value ); \ | ||
304 | if ( len > name##_len ) len = name##_len; \ | ||
305 | name##_len = strlen( value ); \ | ||
306 | if ( len && name ) { \ | ||
307 | if ( copy_to_user( name, value, len ) ) \ | ||
308 | return -EFAULT; \ | ||
309 | } | ||
310 | |||
311 | /** | ||
312 | * Ioctl function type. | 279 | * Ioctl function type. |
313 | * | 280 | * |
314 | * \param inode device inode. | 281 | * \param inode device inode. |
@@ -322,6 +289,9 @@ typedef int drm_ioctl_t(struct drm_device *dev, void *data, | |||
322 | typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd, | 289 | typedef int drm_ioctl_compat_t(struct file *filp, unsigned int cmd, |
323 | unsigned long arg); | 290 | unsigned long arg); |
324 | 291 | ||
292 | #define DRM_IOCTL_NR(n) _IOC_NR(n) | ||
293 | #define DRM_MAJOR 226 | ||
294 | |||
325 | #define DRM_AUTH 0x1 | 295 | #define DRM_AUTH 0x1 |
326 | #define DRM_MASTER 0x2 | 296 | #define DRM_MASTER 0x2 |
327 | #define DRM_ROOT_ONLY 0x4 | 297 | #define DRM_ROOT_ONLY 0x4 |
@@ -426,6 +396,14 @@ struct drm_buf_entry { | |||
426 | struct drm_freelist freelist; | 396 | struct drm_freelist freelist; |
427 | }; | 397 | }; |
428 | 398 | ||
399 | /* Event queued up for userspace to read */ | ||
400 | struct drm_pending_event { | ||
401 | struct drm_event *event; | ||
402 | struct list_head link; | ||
403 | struct drm_file *file_priv; | ||
404 | void (*destroy)(struct drm_pending_event *event); | ||
405 | }; | ||
406 | |||
429 | /** File private data */ | 407 | /** File private data */ |
430 | struct drm_file { | 408 | struct drm_file { |
431 | int authenticated; | 409 | int authenticated; |
@@ -449,6 +427,10 @@ struct drm_file { | |||
449 | struct drm_master *master; /* master this node is currently associated with | 427 | struct drm_master *master; /* master this node is currently associated with |
450 | N.B. not always minor->master */ | 428 | N.B. not always minor->master */ |
451 | struct list_head fbs; | 429 | struct list_head fbs; |
430 | |||
431 | wait_queue_head_t event_wait; | ||
432 | struct list_head event_list; | ||
433 | int event_space; | ||
452 | }; | 434 | }; |
453 | 435 | ||
454 | /** Wait queue */ | 436 | /** Wait queue */ |
@@ -795,6 +777,15 @@ struct drm_driver { | |||
795 | /* Master routines */ | 777 | /* Master routines */ |
796 | int (*master_create)(struct drm_device *dev, struct drm_master *master); | 778 | int (*master_create)(struct drm_device *dev, struct drm_master *master); |
797 | void (*master_destroy)(struct drm_device *dev, struct drm_master *master); | 779 | void (*master_destroy)(struct drm_device *dev, struct drm_master *master); |
780 | /** | ||
781 | * master_set is called whenever the minor master is set. | ||
782 | * master_drop is called whenever the minor master is dropped. | ||
783 | */ | ||
784 | |||
785 | int (*master_set)(struct drm_device *dev, struct drm_file *file_priv, | ||
786 | bool from_open); | ||
787 | void (*master_drop)(struct drm_device *dev, struct drm_file *file_priv, | ||
788 | bool from_release); | ||
798 | 789 | ||
799 | int (*proc_init)(struct drm_minor *minor); | 790 | int (*proc_init)(struct drm_minor *minor); |
800 | void (*proc_cleanup)(struct drm_minor *minor); | 791 | void (*proc_cleanup)(struct drm_minor *minor); |
@@ -900,6 +891,12 @@ struct drm_minor { | |||
900 | struct drm_mode_group mode_group; | 891 | struct drm_mode_group mode_group; |
901 | }; | 892 | }; |
902 | 893 | ||
894 | struct drm_pending_vblank_event { | ||
895 | struct drm_pending_event base; | ||
896 | int pipe; | ||
897 | struct drm_event_vblank event; | ||
898 | }; | ||
899 | |||
903 | /** | 900 | /** |
904 | * DRM device structure. This structure represent a complete card that | 901 | * DRM device structure. This structure represent a complete card that |
905 | * may contain multiple heads. | 902 | * may contain multiple heads. |
@@ -999,6 +996,12 @@ struct drm_device { | |||
999 | 996 | ||
1000 | u32 max_vblank_count; /**< size of vblank counter register */ | 997 | u32 max_vblank_count; /**< size of vblank counter register */ |
1001 | 998 | ||
999 | /** | ||
1000 | * List of events | ||
1001 | */ | ||
1002 | struct list_head vblank_event_list; | ||
1003 | spinlock_t event_lock; | ||
1004 | |||
1002 | /*@} */ | 1005 | /*@} */ |
1003 | cycles_t ctx_start; | 1006 | cycles_t ctx_start; |
1004 | cycles_t lck_start; | 1007 | cycles_t lck_start; |
@@ -1135,6 +1138,8 @@ extern int drm_lastclose(struct drm_device *dev); | |||
1135 | extern int drm_open(struct inode *inode, struct file *filp); | 1138 | extern int drm_open(struct inode *inode, struct file *filp); |
1136 | extern int drm_stub_open(struct inode *inode, struct file *filp); | 1139 | extern int drm_stub_open(struct inode *inode, struct file *filp); |
1137 | extern int drm_fasync(int fd, struct file *filp, int on); | 1140 | extern int drm_fasync(int fd, struct file *filp, int on); |
1141 | extern ssize_t drm_read(struct file *filp, char __user *buffer, | ||
1142 | size_t count, loff_t *offset); | ||
1138 | extern int drm_release(struct inode *inode, struct file *filp); | 1143 | extern int drm_release(struct inode *inode, struct file *filp); |
1139 | 1144 | ||
1140 | /* Mapping support (drm_vm.h) */ | 1145 | /* Mapping support (drm_vm.h) */ |
@@ -1295,6 +1300,7 @@ extern u32 drm_vblank_count(struct drm_device *dev, int crtc); | |||
1295 | extern void drm_handle_vblank(struct drm_device *dev, int crtc); | 1300 | extern void drm_handle_vblank(struct drm_device *dev, int crtc); |
1296 | extern int drm_vblank_get(struct drm_device *dev, int crtc); | 1301 | extern int drm_vblank_get(struct drm_device *dev, int crtc); |
1297 | extern void drm_vblank_put(struct drm_device *dev, int crtc); | 1302 | extern void drm_vblank_put(struct drm_device *dev, int crtc); |
1303 | extern void drm_vblank_off(struct drm_device *dev, int crtc); | ||
1298 | extern void drm_vblank_cleanup(struct drm_device *dev); | 1304 | extern void drm_vblank_cleanup(struct drm_device *dev); |
1299 | /* Modesetting support */ | 1305 | /* Modesetting support */ |
1300 | extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc); | 1306 | extern void drm_vblank_pre_modeset(struct drm_device *dev, int crtc); |
@@ -1519,14 +1525,27 @@ static __inline__ void drm_core_dropmap(struct drm_local_map *map) | |||
1519 | 1525 | ||
1520 | static __inline__ void *drm_calloc_large(size_t nmemb, size_t size) | 1526 | static __inline__ void *drm_calloc_large(size_t nmemb, size_t size) |
1521 | { | 1527 | { |
1528 | if (size != 0 && nmemb > ULONG_MAX / size) | ||
1529 | return NULL; | ||
1530 | |||
1522 | if (size * nmemb <= PAGE_SIZE) | 1531 | if (size * nmemb <= PAGE_SIZE) |
1523 | return kcalloc(nmemb, size, GFP_KERNEL); | 1532 | return kcalloc(nmemb, size, GFP_KERNEL); |
1524 | 1533 | ||
1534 | return __vmalloc(size * nmemb, | ||
1535 | GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO, PAGE_KERNEL); | ||
1536 | } | ||
1537 | |||
1538 | /* Modeled after cairo's malloc_ab, it's like calloc but without the zeroing. */ | ||
1539 | static __inline__ void *drm_malloc_ab(size_t nmemb, size_t size) | ||
1540 | { | ||
1525 | if (size != 0 && nmemb > ULONG_MAX / size) | 1541 | if (size != 0 && nmemb > ULONG_MAX / size) |
1526 | return NULL; | 1542 | return NULL; |
1527 | 1543 | ||
1544 | if (size * nmemb <= PAGE_SIZE) | ||
1545 | return kmalloc(nmemb * size, GFP_KERNEL); | ||
1546 | |||
1528 | return __vmalloc(size * nmemb, | 1547 | return __vmalloc(size * nmemb, |
1529 | GFP_KERNEL | __GFP_HIGHMEM | __GFP_ZERO, PAGE_KERNEL); | 1548 | GFP_KERNEL | __GFP_HIGHMEM, PAGE_KERNEL); |
1530 | } | 1549 | } |
1531 | 1550 | ||
1532 | static __inline void drm_free_large(void *ptr) | 1551 | static __inline void drm_free_large(void *ptr) |
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h index b69347b8904f..fdf43abc36db 100644 --- a/include/drm/drm_crtc.h +++ b/include/drm/drm_crtc.h | |||
@@ -123,7 +123,7 @@ struct drm_display_mode { | |||
123 | int type; | 123 | int type; |
124 | 124 | ||
125 | /* Proposed mode values */ | 125 | /* Proposed mode values */ |
126 | int clock; | 126 | int clock; /* in kHz */ |
127 | int hdisplay; | 127 | int hdisplay; |
128 | int hsync_start; | 128 | int hsync_start; |
129 | int hsync_end; | 129 | int hsync_end; |
@@ -164,8 +164,8 @@ struct drm_display_mode { | |||
164 | int *private; | 164 | int *private; |
165 | int private_flags; | 165 | int private_flags; |
166 | 166 | ||
167 | int vrefresh; | 167 | int vrefresh; /* in Hz */ |
168 | float hsync; | 168 | int hsync; /* in kHz */ |
169 | }; | 169 | }; |
170 | 170 | ||
171 | enum drm_connector_status { | 171 | enum drm_connector_status { |
@@ -242,6 +242,21 @@ struct drm_framebuffer_funcs { | |||
242 | int (*create_handle)(struct drm_framebuffer *fb, | 242 | int (*create_handle)(struct drm_framebuffer *fb, |
243 | struct drm_file *file_priv, | 243 | struct drm_file *file_priv, |
244 | unsigned int *handle); | 244 | unsigned int *handle); |
245 | /** | ||
246 | * Optinal callback for the dirty fb ioctl. | ||
247 | * | ||
248 | * Userspace can notify the driver via this callback | ||
249 | * that a area of the framebuffer has changed and should | ||
250 | * be flushed to the display hardware. | ||
251 | * | ||
252 | * See documentation in drm_mode.h for the struct | ||
253 | * drm_mode_fb_dirty_cmd for more information as all | ||
254 | * the semantics and arguments have a one to one mapping | ||
255 | * on this function. | ||
256 | */ | ||
257 | int (*dirty)(struct drm_framebuffer *framebuffer, unsigned flags, | ||
258 | unsigned color, struct drm_clip_rect *clips, | ||
259 | unsigned num_clips); | ||
245 | }; | 260 | }; |
246 | 261 | ||
247 | struct drm_framebuffer { | 262 | struct drm_framebuffer { |
@@ -256,7 +271,7 @@ struct drm_framebuffer { | |||
256 | unsigned int depth; | 271 | unsigned int depth; |
257 | int bits_per_pixel; | 272 | int bits_per_pixel; |
258 | int flags; | 273 | int flags; |
259 | void *fbdev; | 274 | struct fb_info *fbdev; |
260 | u32 pseudo_palette[17]; | 275 | u32 pseudo_palette[17]; |
261 | struct list_head filp_head; | 276 | struct list_head filp_head; |
262 | /* if you are using the helper */ | 277 | /* if you are using the helper */ |
@@ -290,6 +305,7 @@ struct drm_property { | |||
290 | struct drm_crtc; | 305 | struct drm_crtc; |
291 | struct drm_connector; | 306 | struct drm_connector; |
292 | struct drm_encoder; | 307 | struct drm_encoder; |
308 | struct drm_pending_vblank_event; | ||
293 | 309 | ||
294 | /** | 310 | /** |
295 | * drm_crtc_funcs - control CRTCs for a given device | 311 | * drm_crtc_funcs - control CRTCs for a given device |
@@ -333,6 +349,19 @@ struct drm_crtc_funcs { | |||
333 | void (*destroy)(struct drm_crtc *crtc); | 349 | void (*destroy)(struct drm_crtc *crtc); |
334 | 350 | ||
335 | int (*set_config)(struct drm_mode_set *set); | 351 | int (*set_config)(struct drm_mode_set *set); |
352 | |||
353 | /* | ||
354 | * Flip to the given framebuffer. This implements the page | ||
355 | * flip ioctl descibed in drm_mode.h, specifically, the | ||
356 | * implementation must return immediately and block all | ||
357 | * rendering to the current fb until the flip has completed. | ||
358 | * If userspace set the event flag in the ioctl, the event | ||
359 | * argument will point to an event to send back when the flip | ||
360 | * completes, otherwise it will be NULL. | ||
361 | */ | ||
362 | int (*page_flip)(struct drm_crtc *crtc, | ||
363 | struct drm_framebuffer *fb, | ||
364 | struct drm_pending_vblank_event *event); | ||
336 | }; | 365 | }; |
337 | 366 | ||
338 | /** | 367 | /** |
@@ -596,6 +625,7 @@ struct drm_mode_config { | |||
596 | /* Optional properties */ | 625 | /* Optional properties */ |
597 | struct drm_property *scaling_mode_property; | 626 | struct drm_property *scaling_mode_property; |
598 | struct drm_property *dithering_mode_property; | 627 | struct drm_property *dithering_mode_property; |
628 | struct drm_property *dirty_info_property; | ||
599 | }; | 629 | }; |
600 | 630 | ||
601 | #define obj_to_crtc(x) container_of(x, struct drm_crtc, base) | 631 | #define obj_to_crtc(x) container_of(x, struct drm_crtc, base) |
@@ -667,6 +697,7 @@ extern void drm_mode_validate_size(struct drm_device *dev, | |||
667 | extern void drm_mode_prune_invalid(struct drm_device *dev, | 697 | extern void drm_mode_prune_invalid(struct drm_device *dev, |
668 | struct list_head *mode_list, bool verbose); | 698 | struct list_head *mode_list, bool verbose); |
669 | extern void drm_mode_sort(struct list_head *mode_list); | 699 | extern void drm_mode_sort(struct list_head *mode_list); |
700 | extern int drm_mode_hsync(struct drm_display_mode *mode); | ||
670 | extern int drm_mode_vrefresh(struct drm_display_mode *mode); | 701 | extern int drm_mode_vrefresh(struct drm_display_mode *mode); |
671 | extern void drm_mode_set_crtcinfo(struct drm_display_mode *p, | 702 | extern void drm_mode_set_crtcinfo(struct drm_display_mode *p, |
672 | int adjust_flags); | 703 | int adjust_flags); |
@@ -703,6 +734,7 @@ extern int drm_mode_create_tv_properties(struct drm_device *dev, int num_formats | |||
703 | char *formats[]); | 734 | char *formats[]); |
704 | extern int drm_mode_create_scaling_mode_property(struct drm_device *dev); | 735 | extern int drm_mode_create_scaling_mode_property(struct drm_device *dev); |
705 | extern int drm_mode_create_dithering_property(struct drm_device *dev); | 736 | extern int drm_mode_create_dithering_property(struct drm_device *dev); |
737 | extern int drm_mode_create_dirty_info_property(struct drm_device *dev); | ||
706 | extern char *drm_get_encoder_name(struct drm_encoder *encoder); | 738 | extern char *drm_get_encoder_name(struct drm_encoder *encoder); |
707 | 739 | ||
708 | extern int drm_mode_connector_attach_encoder(struct drm_connector *connector, | 740 | extern int drm_mode_connector_attach_encoder(struct drm_connector *connector, |
@@ -711,7 +743,8 @@ extern void drm_mode_connector_detach_encoder(struct drm_connector *connector, | |||
711 | struct drm_encoder *encoder); | 743 | struct drm_encoder *encoder); |
712 | extern bool drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc, | 744 | extern bool drm_mode_crtc_set_gamma_size(struct drm_crtc *crtc, |
713 | int gamma_size); | 745 | int gamma_size); |
714 | extern void *drm_mode_object_find(struct drm_device *dev, uint32_t id, uint32_t type); | 746 | extern struct drm_mode_object *drm_mode_object_find(struct drm_device *dev, |
747 | uint32_t id, uint32_t type); | ||
715 | /* IOCTLs */ | 748 | /* IOCTLs */ |
716 | extern int drm_mode_getresources(struct drm_device *dev, | 749 | extern int drm_mode_getresources(struct drm_device *dev, |
717 | void *data, struct drm_file *file_priv); | 750 | void *data, struct drm_file *file_priv); |
@@ -730,6 +763,8 @@ extern int drm_mode_rmfb(struct drm_device *dev, | |||
730 | void *data, struct drm_file *file_priv); | 763 | void *data, struct drm_file *file_priv); |
731 | extern int drm_mode_getfb(struct drm_device *dev, | 764 | extern int drm_mode_getfb(struct drm_device *dev, |
732 | void *data, struct drm_file *file_priv); | 765 | void *data, struct drm_file *file_priv); |
766 | extern int drm_mode_dirtyfb_ioctl(struct drm_device *dev, | ||
767 | void *data, struct drm_file *file_priv); | ||
733 | extern int drm_mode_addmode_ioctl(struct drm_device *dev, | 768 | extern int drm_mode_addmode_ioctl(struct drm_device *dev, |
734 | void *data, struct drm_file *file_priv); | 769 | void *data, struct drm_file *file_priv); |
735 | extern int drm_mode_rmmode_ioctl(struct drm_device *dev, | 770 | extern int drm_mode_rmmode_ioctl(struct drm_device *dev, |
@@ -756,6 +791,8 @@ extern int drm_mode_gamma_get_ioctl(struct drm_device *dev, | |||
756 | extern int drm_mode_gamma_set_ioctl(struct drm_device *dev, | 791 | extern int drm_mode_gamma_set_ioctl(struct drm_device *dev, |
757 | void *data, struct drm_file *file_priv); | 792 | void *data, struct drm_file *file_priv); |
758 | extern bool drm_detect_hdmi_monitor(struct edid *edid); | 793 | extern bool drm_detect_hdmi_monitor(struct edid *edid); |
794 | extern int drm_mode_page_flip_ioctl(struct drm_device *dev, | ||
795 | void *data, struct drm_file *file_priv); | ||
759 | extern struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, | 796 | extern struct drm_display_mode *drm_cvt_mode(struct drm_device *dev, |
760 | int hdisplay, int vdisplay, int vrefresh, | 797 | int hdisplay, int vdisplay, int vrefresh, |
761 | bool reduced, bool interlaced, bool margins); | 798 | bool reduced, bool interlaced, bool margins); |
diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h new file mode 100644 index 000000000000..a49e791db0b0 --- /dev/null +++ b/include/drm/drm_dp_helper.h | |||
@@ -0,0 +1,180 @@ | |||
1 | /* | ||
2 | * Copyright © 2008 Keith Packard | ||
3 | * | ||
4 | * Permission to use, copy, modify, distribute, and sell this software and its | ||
5 | * documentation for any purpose is hereby granted without fee, provided that | ||
6 | * the above copyright notice appear in all copies and that both that copyright | ||
7 | * notice and this permission notice appear in supporting documentation, and | ||
8 | * that the name of the copyright holders not be used in advertising or | ||
9 | * publicity pertaining to distribution of the software without specific, | ||
10 | * written prior permission. The copyright holders make no representations | ||
11 | * about the suitability of this software for any purpose. It is provided "as | ||
12 | * is" without express or implied warranty. | ||
13 | * | ||
14 | * THE COPYRIGHT HOLDERS DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, | ||
15 | * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO | ||
16 | * EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY SPECIAL, INDIRECT OR | ||
17 | * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, | ||
18 | * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER | ||
19 | * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE | ||
20 | * OF THIS SOFTWARE. | ||
21 | */ | ||
22 | |||
23 | #ifndef _DRM_DP_HELPER_H_ | ||
24 | #define _DRM_DP_HELPER_H_ | ||
25 | |||
26 | /* From the VESA DisplayPort spec */ | ||
27 | |||
28 | #define AUX_NATIVE_WRITE 0x8 | ||
29 | #define AUX_NATIVE_READ 0x9 | ||
30 | #define AUX_I2C_WRITE 0x0 | ||
31 | #define AUX_I2C_READ 0x1 | ||
32 | #define AUX_I2C_STATUS 0x2 | ||
33 | #define AUX_I2C_MOT 0x4 | ||
34 | |||
35 | #define AUX_NATIVE_REPLY_ACK (0x0 << 4) | ||
36 | #define AUX_NATIVE_REPLY_NACK (0x1 << 4) | ||
37 | #define AUX_NATIVE_REPLY_DEFER (0x2 << 4) | ||
38 | #define AUX_NATIVE_REPLY_MASK (0x3 << 4) | ||
39 | |||
40 | #define AUX_I2C_REPLY_ACK (0x0 << 6) | ||
41 | #define AUX_I2C_REPLY_NACK (0x1 << 6) | ||
42 | #define AUX_I2C_REPLY_DEFER (0x2 << 6) | ||
43 | #define AUX_I2C_REPLY_MASK (0x3 << 6) | ||
44 | |||
45 | /* AUX CH addresses */ | ||
46 | /* DPCD */ | ||
47 | #define DP_DPCD_REV 0x000 | ||
48 | |||
49 | #define DP_MAX_LINK_RATE 0x001 | ||
50 | |||
51 | #define DP_MAX_LANE_COUNT 0x002 | ||
52 | # define DP_MAX_LANE_COUNT_MASK 0x1f | ||
53 | # define DP_ENHANCED_FRAME_CAP (1 << 7) | ||
54 | |||
55 | #define DP_MAX_DOWNSPREAD 0x003 | ||
56 | # define DP_NO_AUX_HANDSHAKE_LINK_TRAINING (1 << 6) | ||
57 | |||
58 | #define DP_NORP 0x004 | ||
59 | |||
60 | #define DP_DOWNSTREAMPORT_PRESENT 0x005 | ||
61 | # define DP_DWN_STRM_PORT_PRESENT (1 << 0) | ||
62 | # define DP_DWN_STRM_PORT_TYPE_MASK 0x06 | ||
63 | /* 00b = DisplayPort */ | ||
64 | /* 01b = Analog */ | ||
65 | /* 10b = TMDS or HDMI */ | ||
66 | /* 11b = Other */ | ||
67 | # define DP_FORMAT_CONVERSION (1 << 3) | ||
68 | |||
69 | #define DP_MAIN_LINK_CHANNEL_CODING 0x006 | ||
70 | |||
71 | /* link configuration */ | ||
72 | #define DP_LINK_BW_SET 0x100 | ||
73 | # define DP_LINK_BW_1_62 0x06 | ||
74 | # define DP_LINK_BW_2_7 0x0a | ||
75 | |||
76 | #define DP_LANE_COUNT_SET 0x101 | ||
77 | # define DP_LANE_COUNT_MASK 0x0f | ||
78 | # define DP_LANE_COUNT_ENHANCED_FRAME_EN (1 << 7) | ||
79 | |||
80 | #define DP_TRAINING_PATTERN_SET 0x102 | ||
81 | # define DP_TRAINING_PATTERN_DISABLE 0 | ||
82 | # define DP_TRAINING_PATTERN_1 1 | ||
83 | # define DP_TRAINING_PATTERN_2 2 | ||
84 | # define DP_TRAINING_PATTERN_MASK 0x3 | ||
85 | |||
86 | # define DP_LINK_QUAL_PATTERN_DISABLE (0 << 2) | ||
87 | # define DP_LINK_QUAL_PATTERN_D10_2 (1 << 2) | ||
88 | # define DP_LINK_QUAL_PATTERN_ERROR_RATE (2 << 2) | ||
89 | # define DP_LINK_QUAL_PATTERN_PRBS7 (3 << 2) | ||
90 | # define DP_LINK_QUAL_PATTERN_MASK (3 << 2) | ||
91 | |||
92 | # define DP_RECOVERED_CLOCK_OUT_EN (1 << 4) | ||
93 | # define DP_LINK_SCRAMBLING_DISABLE (1 << 5) | ||
94 | |||
95 | # define DP_SYMBOL_ERROR_COUNT_BOTH (0 << 6) | ||
96 | # define DP_SYMBOL_ERROR_COUNT_DISPARITY (1 << 6) | ||
97 | # define DP_SYMBOL_ERROR_COUNT_SYMBOL (2 << 6) | ||
98 | # define DP_SYMBOL_ERROR_COUNT_MASK (3 << 6) | ||
99 | |||
100 | #define DP_TRAINING_LANE0_SET 0x103 | ||
101 | #define DP_TRAINING_LANE1_SET 0x104 | ||
102 | #define DP_TRAINING_LANE2_SET 0x105 | ||
103 | #define DP_TRAINING_LANE3_SET 0x106 | ||
104 | |||
105 | # define DP_TRAIN_VOLTAGE_SWING_MASK 0x3 | ||
106 | # define DP_TRAIN_VOLTAGE_SWING_SHIFT 0 | ||
107 | # define DP_TRAIN_MAX_SWING_REACHED (1 << 2) | ||
108 | # define DP_TRAIN_VOLTAGE_SWING_400 (0 << 0) | ||
109 | # define DP_TRAIN_VOLTAGE_SWING_600 (1 << 0) | ||
110 | # define DP_TRAIN_VOLTAGE_SWING_800 (2 << 0) | ||
111 | # define DP_TRAIN_VOLTAGE_SWING_1200 (3 << 0) | ||
112 | |||
113 | # define DP_TRAIN_PRE_EMPHASIS_MASK (3 << 3) | ||
114 | # define DP_TRAIN_PRE_EMPHASIS_0 (0 << 3) | ||
115 | # define DP_TRAIN_PRE_EMPHASIS_3_5 (1 << 3) | ||
116 | # define DP_TRAIN_PRE_EMPHASIS_6 (2 << 3) | ||
117 | # define DP_TRAIN_PRE_EMPHASIS_9_5 (3 << 3) | ||
118 | |||
119 | # define DP_TRAIN_PRE_EMPHASIS_SHIFT 3 | ||
120 | # define DP_TRAIN_MAX_PRE_EMPHASIS_REACHED (1 << 5) | ||
121 | |||
122 | #define DP_DOWNSPREAD_CTRL 0x107 | ||
123 | # define DP_SPREAD_AMP_0_5 (1 << 4) | ||
124 | |||
125 | #define DP_MAIN_LINK_CHANNEL_CODING_SET 0x108 | ||
126 | # define DP_SET_ANSI_8B10B (1 << 0) | ||
127 | |||
128 | #define DP_LANE0_1_STATUS 0x202 | ||
129 | #define DP_LANE2_3_STATUS 0x203 | ||
130 | # define DP_LANE_CR_DONE (1 << 0) | ||
131 | # define DP_LANE_CHANNEL_EQ_DONE (1 << 1) | ||
132 | # define DP_LANE_SYMBOL_LOCKED (1 << 2) | ||
133 | |||
134 | #define DP_CHANNEL_EQ_BITS (DP_LANE_CR_DONE | \ | ||
135 | DP_LANE_CHANNEL_EQ_DONE | \ | ||
136 | DP_LANE_SYMBOL_LOCKED) | ||
137 | |||
138 | #define DP_LANE_ALIGN_STATUS_UPDATED 0x204 | ||
139 | |||
140 | #define DP_INTERLANE_ALIGN_DONE (1 << 0) | ||
141 | #define DP_DOWNSTREAM_PORT_STATUS_CHANGED (1 << 6) | ||
142 | #define DP_LINK_STATUS_UPDATED (1 << 7) | ||
143 | |||
144 | #define DP_SINK_STATUS 0x205 | ||
145 | |||
146 | #define DP_RECEIVE_PORT_0_STATUS (1 << 0) | ||
147 | #define DP_RECEIVE_PORT_1_STATUS (1 << 1) | ||
148 | |||
149 | #define DP_ADJUST_REQUEST_LANE0_1 0x206 | ||
150 | #define DP_ADJUST_REQUEST_LANE2_3 0x207 | ||
151 | # define DP_ADJUST_VOLTAGE_SWING_LANE0_MASK 0x03 | ||
152 | # define DP_ADJUST_VOLTAGE_SWING_LANE0_SHIFT 0 | ||
153 | # define DP_ADJUST_PRE_EMPHASIS_LANE0_MASK 0x0c | ||
154 | # define DP_ADJUST_PRE_EMPHASIS_LANE0_SHIFT 2 | ||
155 | # define DP_ADJUST_VOLTAGE_SWING_LANE1_MASK 0x30 | ||
156 | # define DP_ADJUST_VOLTAGE_SWING_LANE1_SHIFT 4 | ||
157 | # define DP_ADJUST_PRE_EMPHASIS_LANE1_MASK 0xc0 | ||
158 | # define DP_ADJUST_PRE_EMPHASIS_LANE1_SHIFT 6 | ||
159 | |||
160 | #define DP_SET_POWER 0x600 | ||
161 | # define DP_SET_POWER_D0 0x1 | ||
162 | # define DP_SET_POWER_D3 0x2 | ||
163 | |||
164 | #define MODE_I2C_START 1 | ||
165 | #define MODE_I2C_WRITE 2 | ||
166 | #define MODE_I2C_READ 4 | ||
167 | #define MODE_I2C_STOP 8 | ||
168 | |||
169 | struct i2c_algo_dp_aux_data { | ||
170 | bool running; | ||
171 | u16 address; | ||
172 | int (*aux_ch) (struct i2c_adapter *adapter, | ||
173 | int mode, uint8_t write_byte, | ||
174 | uint8_t *read_byte); | ||
175 | }; | ||
176 | |||
177 | int | ||
178 | i2c_dp_aux_add_bus(struct i2c_adapter *adapter); | ||
179 | |||
180 | #endif /* _DRM_DP_HELPER_H_ */ | ||
diff --git a/include/drm/drm_edid.h b/include/drm/drm_edid.h index 7d6c9a2dfcbb..d33c3e038606 100644 --- a/include/drm/drm_edid.h +++ b/include/drm/drm_edid.h | |||
@@ -106,6 +106,10 @@ struct detailed_data_color_point { | |||
106 | u8 wpindex2[3]; | 106 | u8 wpindex2[3]; |
107 | } __attribute__((packed)); | 107 | } __attribute__((packed)); |
108 | 108 | ||
109 | struct cvt_timing { | ||
110 | u8 code[3]; | ||
111 | } __attribute__((packed)); | ||
112 | |||
109 | struct detailed_non_pixel { | 113 | struct detailed_non_pixel { |
110 | u8 pad1; | 114 | u8 pad1; |
111 | u8 type; /* ff=serial, fe=string, fd=monitor range, fc=monitor name | 115 | u8 type; /* ff=serial, fe=string, fd=monitor range, fc=monitor name |
@@ -117,9 +121,13 @@ struct detailed_non_pixel { | |||
117 | struct detailed_data_monitor_range range; | 121 | struct detailed_data_monitor_range range; |
118 | struct detailed_data_wpindex color; | 122 | struct detailed_data_wpindex color; |
119 | struct std_timing timings[5]; | 123 | struct std_timing timings[5]; |
124 | struct cvt_timing cvt[4]; | ||
120 | } data; | 125 | } data; |
121 | } __attribute__((packed)); | 126 | } __attribute__((packed)); |
122 | 127 | ||
128 | #define EDID_DETAIL_EST_TIMINGS 0xf7 | ||
129 | #define EDID_DETAIL_CVT_3BYTE 0xf8 | ||
130 | #define EDID_DETAIL_COLOR_MGMT_DATA 0xf9 | ||
123 | #define EDID_DETAIL_STD_MODES 0xfa | 131 | #define EDID_DETAIL_STD_MODES 0xfa |
124 | #define EDID_DETAIL_MONITOR_CPDATA 0xfb | 132 | #define EDID_DETAIL_MONITOR_CPDATA 0xfb |
125 | #define EDID_DETAIL_MONITOR_NAME 0xfc | 133 | #define EDID_DETAIL_MONITOR_NAME 0xfc |
diff --git a/include/drm/drm_mm.h b/include/drm/drm_mm.h index 62329f9a42cb..4c10be39a43b 100644 --- a/include/drm/drm_mm.h +++ b/include/drm/drm_mm.h | |||
@@ -66,6 +66,13 @@ extern struct drm_mm_node *drm_mm_get_block_generic(struct drm_mm_node *node, | |||
66 | unsigned long size, | 66 | unsigned long size, |
67 | unsigned alignment, | 67 | unsigned alignment, |
68 | int atomic); | 68 | int atomic); |
69 | extern struct drm_mm_node *drm_mm_get_block_range_generic( | ||
70 | struct drm_mm_node *node, | ||
71 | unsigned long size, | ||
72 | unsigned alignment, | ||
73 | unsigned long start, | ||
74 | unsigned long end, | ||
75 | int atomic); | ||
69 | static inline struct drm_mm_node *drm_mm_get_block(struct drm_mm_node *parent, | 76 | static inline struct drm_mm_node *drm_mm_get_block(struct drm_mm_node *parent, |
70 | unsigned long size, | 77 | unsigned long size, |
71 | unsigned alignment) | 78 | unsigned alignment) |
@@ -78,11 +85,38 @@ static inline struct drm_mm_node *drm_mm_get_block_atomic(struct drm_mm_node *pa | |||
78 | { | 85 | { |
79 | return drm_mm_get_block_generic(parent, size, alignment, 1); | 86 | return drm_mm_get_block_generic(parent, size, alignment, 1); |
80 | } | 87 | } |
88 | static inline struct drm_mm_node *drm_mm_get_block_range( | ||
89 | struct drm_mm_node *parent, | ||
90 | unsigned long size, | ||
91 | unsigned alignment, | ||
92 | unsigned long start, | ||
93 | unsigned long end) | ||
94 | { | ||
95 | return drm_mm_get_block_range_generic(parent, size, alignment, | ||
96 | start, end, 0); | ||
97 | } | ||
98 | static inline struct drm_mm_node *drm_mm_get_block_atomic_range( | ||
99 | struct drm_mm_node *parent, | ||
100 | unsigned long size, | ||
101 | unsigned alignment, | ||
102 | unsigned long start, | ||
103 | unsigned long end) | ||
104 | { | ||
105 | return drm_mm_get_block_range_generic(parent, size, alignment, | ||
106 | start, end, 1); | ||
107 | } | ||
81 | extern void drm_mm_put_block(struct drm_mm_node *cur); | 108 | extern void drm_mm_put_block(struct drm_mm_node *cur); |
82 | extern struct drm_mm_node *drm_mm_search_free(const struct drm_mm *mm, | 109 | extern struct drm_mm_node *drm_mm_search_free(const struct drm_mm *mm, |
83 | unsigned long size, | 110 | unsigned long size, |
84 | unsigned alignment, | 111 | unsigned alignment, |
85 | int best_match); | 112 | int best_match); |
113 | extern struct drm_mm_node *drm_mm_search_free_in_range( | ||
114 | const struct drm_mm *mm, | ||
115 | unsigned long size, | ||
116 | unsigned alignment, | ||
117 | unsigned long start, | ||
118 | unsigned long end, | ||
119 | int best_match); | ||
86 | extern int drm_mm_init(struct drm_mm *mm, unsigned long start, | 120 | extern int drm_mm_init(struct drm_mm *mm, unsigned long start, |
87 | unsigned long size); | 121 | unsigned long size); |
88 | extern void drm_mm_takedown(struct drm_mm *mm); | 122 | extern void drm_mm_takedown(struct drm_mm *mm); |
@@ -99,6 +133,7 @@ static inline struct drm_mm *drm_get_mm(struct drm_mm_node *block) | |||
99 | return block->mm; | 133 | return block->mm; |
100 | } | 134 | } |
101 | 135 | ||
136 | extern void drm_mm_debug_table(struct drm_mm *mm, const char *prefix); | ||
102 | #ifdef CONFIG_DEBUG_FS | 137 | #ifdef CONFIG_DEBUG_FS |
103 | int drm_mm_dump_table(struct seq_file *m, struct drm_mm *mm); | 138 | int drm_mm_dump_table(struct seq_file *m, struct drm_mm *mm); |
104 | #endif | 139 | #endif |
diff --git a/include/drm/drm_mode.h b/include/drm/drm_mode.h index 1f908416aedb..43009bc2e757 100644 --- a/include/drm/drm_mode.h +++ b/include/drm/drm_mode.h | |||
@@ -27,9 +27,6 @@ | |||
27 | #ifndef _DRM_MODE_H | 27 | #ifndef _DRM_MODE_H |
28 | #define _DRM_MODE_H | 28 | #define _DRM_MODE_H |
29 | 29 | ||
30 | #include <linux/kernel.h> | ||
31 | #include <linux/types.h> | ||
32 | |||
33 | #define DRM_DISPLAY_INFO_LEN 32 | 30 | #define DRM_DISPLAY_INFO_LEN 32 |
34 | #define DRM_CONNECTOR_NAME_LEN 32 | 31 | #define DRM_CONNECTOR_NAME_LEN 32 |
35 | #define DRM_DISPLAY_MODE_LEN 32 | 32 | #define DRM_DISPLAY_MODE_LEN 32 |
@@ -78,6 +75,11 @@ | |||
78 | #define DRM_MODE_DITHERING_OFF 0 | 75 | #define DRM_MODE_DITHERING_OFF 0 |
79 | #define DRM_MODE_DITHERING_ON 1 | 76 | #define DRM_MODE_DITHERING_ON 1 |
80 | 77 | ||
78 | /* Dirty info options */ | ||
79 | #define DRM_MODE_DIRTY_OFF 0 | ||
80 | #define DRM_MODE_DIRTY_ON 1 | ||
81 | #define DRM_MODE_DIRTY_ANNOTATE 2 | ||
82 | |||
81 | struct drm_mode_modeinfo { | 83 | struct drm_mode_modeinfo { |
82 | __u32 clock; | 84 | __u32 clock; |
83 | __u16 hdisplay, hsync_start, hsync_end, htotal, hskew; | 85 | __u16 hdisplay, hsync_start, hsync_end, htotal, hskew; |
@@ -225,6 +227,45 @@ struct drm_mode_fb_cmd { | |||
225 | __u32 handle; | 227 | __u32 handle; |
226 | }; | 228 | }; |
227 | 229 | ||
230 | #define DRM_MODE_FB_DIRTY_ANNOTATE_COPY 0x01 | ||
231 | #define DRM_MODE_FB_DIRTY_ANNOTATE_FILL 0x02 | ||
232 | #define DRM_MODE_FB_DIRTY_FLAGS 0x03 | ||
233 | |||
234 | /* | ||
235 | * Mark a region of a framebuffer as dirty. | ||
236 | * | ||
237 | * Some hardware does not automatically update display contents | ||
238 | * as a hardware or software draw to a framebuffer. This ioctl | ||
239 | * allows userspace to tell the kernel and the hardware what | ||
240 | * regions of the framebuffer have changed. | ||
241 | * | ||
242 | * The kernel or hardware is free to update more then just the | ||
243 | * region specified by the clip rects. The kernel or hardware | ||
244 | * may also delay and/or coalesce several calls to dirty into a | ||
245 | * single update. | ||
246 | * | ||
247 | * Userspace may annotate the updates, the annotates are a | ||
248 | * promise made by the caller that the change is either a copy | ||
249 | * of pixels or a fill of a single color in the region specified. | ||
250 | * | ||
251 | * If the DRM_MODE_FB_DIRTY_ANNOTATE_COPY flag is given then | ||
252 | * the number of updated regions are half of num_clips given, | ||
253 | * where the clip rects are paired in src and dst. The width and | ||
254 | * height of each one of the pairs must match. | ||
255 | * | ||
256 | * If the DRM_MODE_FB_DIRTY_ANNOTATE_FILL flag is given the caller | ||
257 | * promises that the region specified of the clip rects is filled | ||
258 | * completely with a single color as given in the color argument. | ||
259 | */ | ||
260 | |||
261 | struct drm_mode_fb_dirty_cmd { | ||
262 | __u32 fb_id; | ||
263 | __u32 flags; | ||
264 | __u32 color; | ||
265 | __u32 num_clips; | ||
266 | __u64 clips_ptr; | ||
267 | }; | ||
268 | |||
228 | struct drm_mode_mode_cmd { | 269 | struct drm_mode_mode_cmd { |
229 | __u32 connector_id; | 270 | __u32 connector_id; |
230 | struct drm_mode_modeinfo mode; | 271 | struct drm_mode_modeinfo mode; |
@@ -268,4 +309,37 @@ struct drm_mode_crtc_lut { | |||
268 | __u64 blue; | 309 | __u64 blue; |
269 | }; | 310 | }; |
270 | 311 | ||
312 | #define DRM_MODE_PAGE_FLIP_EVENT 0x01 | ||
313 | #define DRM_MODE_PAGE_FLIP_FLAGS DRM_MODE_PAGE_FLIP_EVENT | ||
314 | |||
315 | /* | ||
316 | * Request a page flip on the specified crtc. | ||
317 | * | ||
318 | * This ioctl will ask KMS to schedule a page flip for the specified | ||
319 | * crtc. Once any pending rendering targeting the specified fb (as of | ||
320 | * ioctl time) has completed, the crtc will be reprogrammed to display | ||
321 | * that fb after the next vertical refresh. The ioctl returns | ||
322 | * immediately, but subsequent rendering to the current fb will block | ||
323 | * in the execbuffer ioctl until the page flip happens. If a page | ||
324 | * flip is already pending as the ioctl is called, EBUSY will be | ||
325 | * returned. | ||
326 | * | ||
327 | * The ioctl supports one flag, DRM_MODE_PAGE_FLIP_EVENT, which will | ||
328 | * request that drm sends back a vblank event (see drm.h: struct | ||
329 | * drm_event_vblank) when the page flip is done. The user_data field | ||
330 | * passed in with this ioctl will be returned as the user_data field | ||
331 | * in the vblank event struct. | ||
332 | * | ||
333 | * The reserved field must be zero until we figure out something | ||
334 | * clever to use it for. | ||
335 | */ | ||
336 | |||
337 | struct drm_mode_crtc_page_flip { | ||
338 | __u32 crtc_id; | ||
339 | __u32 fb_id; | ||
340 | __u32 flags; | ||
341 | __u32 reserved; | ||
342 | __u64 user_data; | ||
343 | }; | ||
344 | |||
271 | #endif | 345 | #endif |
diff --git a/include/drm/drm_os_linux.h b/include/drm/drm_os_linux.h index 26641e95e0a4..393369147a2d 100644 --- a/include/drm/drm_os_linux.h +++ b/include/drm/drm_os_linux.h | |||
@@ -123,5 +123,5 @@ do { \ | |||
123 | remove_wait_queue(&(queue), &entry); \ | 123 | remove_wait_queue(&(queue), &entry); \ |
124 | } while (0) | 124 | } while (0) |
125 | 125 | ||
126 | #define DRM_WAKEUP( queue ) wake_up_interruptible( queue ) | 126 | #define DRM_WAKEUP( queue ) wake_up( queue ) |
127 | #define DRM_INIT_WAITQUEUE( queue ) init_waitqueue_head( queue ) | 127 | #define DRM_INIT_WAITQUEUE( queue ) init_waitqueue_head( queue ) |
diff --git a/include/drm/i2c/ch7006.h b/include/drm/i2c/ch7006.h new file mode 100644 index 000000000000..8390b437a1f8 --- /dev/null +++ b/include/drm/i2c/ch7006.h | |||
@@ -0,0 +1,86 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2009 Francisco Jerez. | ||
3 | * All Rights Reserved. | ||
4 | * | ||
5 | * Permission is hereby granted, free of charge, to any person obtaining | ||
6 | * a copy of this software and associated documentation files (the | ||
7 | * "Software"), to deal in the Software without restriction, including | ||
8 | * without limitation the rights to use, copy, modify, merge, publish, | ||
9 | * distribute, sublicense, and/or sell copies of the Software, and to | ||
10 | * permit persons to whom the Software is furnished to do so, subject to | ||
11 | * the following conditions: | ||
12 | * | ||
13 | * The above copyright notice and this permission notice (including the | ||
14 | * next paragraph) shall be included in all copies or substantial | ||
15 | * portions of the Software. | ||
16 | * | ||
17 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
18 | * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||
19 | * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. | ||
20 | * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE | ||
21 | * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||
22 | * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||
23 | * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
24 | * | ||
25 | */ | ||
26 | |||
27 | #ifndef __DRM_I2C_CH7006_H__ | ||
28 | #define __DRM_I2C_CH7006_H__ | ||
29 | |||
30 | /** | ||
31 | * struct ch7006_encoder_params | ||
32 | * | ||
33 | * Describes how the ch7006 is wired up with the GPU. It should be | ||
34 | * used as the @params parameter of its @set_config method. | ||
35 | * | ||
36 | * See "http://www.chrontel.com/pdf/7006.pdf" for their precise | ||
37 | * meaning. | ||
38 | */ | ||
39 | struct ch7006_encoder_params { | ||
40 | enum { | ||
41 | CH7006_FORMAT_RGB16 = 0, | ||
42 | CH7006_FORMAT_YCrCb24m16, | ||
43 | CH7006_FORMAT_RGB24m16, | ||
44 | CH7006_FORMAT_RGB15, | ||
45 | CH7006_FORMAT_RGB24m12C, | ||
46 | CH7006_FORMAT_RGB24m12I, | ||
47 | CH7006_FORMAT_RGB24m8, | ||
48 | CH7006_FORMAT_RGB16m8, | ||
49 | CH7006_FORMAT_RGB15m8, | ||
50 | CH7006_FORMAT_YCrCb24m8, | ||
51 | } input_format; | ||
52 | |||
53 | enum { | ||
54 | CH7006_CLOCK_SLAVE = 0, | ||
55 | CH7006_CLOCK_MASTER, | ||
56 | } clock_mode; | ||
57 | |||
58 | enum { | ||
59 | CH7006_CLOCK_EDGE_NEG = 0, | ||
60 | CH7006_CLOCK_EDGE_POS, | ||
61 | } clock_edge; | ||
62 | |||
63 | int xcm, pcm; | ||
64 | |||
65 | enum { | ||
66 | CH7006_SYNC_SLAVE = 0, | ||
67 | CH7006_SYNC_MASTER, | ||
68 | } sync_direction; | ||
69 | |||
70 | enum { | ||
71 | CH7006_SYNC_SEPARATED = 0, | ||
72 | CH7006_SYNC_EMBEDDED, | ||
73 | } sync_encoding; | ||
74 | |||
75 | enum { | ||
76 | CH7006_POUT_1_8V = 0, | ||
77 | CH7006_POUT_3_3V, | ||
78 | } pout_level; | ||
79 | |||
80 | enum { | ||
81 | CH7006_ACTIVE_HSYNC = 0, | ||
82 | CH7006_ACTIVE_DSTART, | ||
83 | } active_detect; | ||
84 | }; | ||
85 | |||
86 | #endif | ||
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index 7e0cb1da92e6..ec3f5e80a5df 100644 --- a/include/drm/i915_drm.h +++ b/include/drm/i915_drm.h | |||
@@ -27,11 +27,11 @@ | |||
27 | #ifndef _I915_DRM_H_ | 27 | #ifndef _I915_DRM_H_ |
28 | #define _I915_DRM_H_ | 28 | #define _I915_DRM_H_ |
29 | 29 | ||
30 | #include "drm.h" | ||
31 | |||
30 | /* Please note that modifications to all structs defined here are | 32 | /* Please note that modifications to all structs defined here are |
31 | * subject to backwards-compatibility constraints. | 33 | * subject to backwards-compatibility constraints. |
32 | */ | 34 | */ |
33 | #include <linux/types.h> | ||
34 | #include "drm.h" | ||
35 | 35 | ||
36 | /* Each region is a minimum of 16k, and there are at most 255 of them. | 36 | /* Each region is a minimum of 16k, and there are at most 255 of them. |
37 | */ | 37 | */ |
@@ -186,6 +186,8 @@ typedef struct _drm_i915_sarea { | |||
186 | #define DRM_I915_GEM_MMAP_GTT 0x24 | 186 | #define DRM_I915_GEM_MMAP_GTT 0x24 |
187 | #define DRM_I915_GET_PIPE_FROM_CRTC_ID 0x25 | 187 | #define DRM_I915_GET_PIPE_FROM_CRTC_ID 0x25 |
188 | #define DRM_I915_GEM_MADVISE 0x26 | 188 | #define DRM_I915_GEM_MADVISE 0x26 |
189 | #define DRM_I915_OVERLAY_PUT_IMAGE 0x27 | ||
190 | #define DRM_I915_OVERLAY_ATTRS 0x28 | ||
189 | 191 | ||
190 | #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) | 192 | #define DRM_IOCTL_I915_INIT DRM_IOW( DRM_COMMAND_BASE + DRM_I915_INIT, drm_i915_init_t) |
191 | #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) | 193 | #define DRM_IOCTL_I915_FLUSH DRM_IO ( DRM_COMMAND_BASE + DRM_I915_FLUSH) |
@@ -221,8 +223,10 @@ typedef struct _drm_i915_sarea { | |||
221 | #define DRM_IOCTL_I915_GEM_SET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_SET_TILING, struct drm_i915_gem_set_tiling) | 223 | #define DRM_IOCTL_I915_GEM_SET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_SET_TILING, struct drm_i915_gem_set_tiling) |
222 | #define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling) | 224 | #define DRM_IOCTL_I915_GEM_GET_TILING DRM_IOWR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_TILING, struct drm_i915_gem_get_tiling) |
223 | #define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture) | 225 | #define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture) |
224 | #define DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_PIPE_FROM_CRTC_ID, struct drm_intel_get_pipe_from_crtc_id) | 226 | #define DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_PIPE_FROM_CRTC_ID, struct drm_i915_get_pipe_from_crtc_id) |
225 | #define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise) | 227 | #define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise) |
228 | #define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_IOCTL_I915_OVERLAY_ATTRS, struct drm_intel_overlay_put_image) | ||
229 | #define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs) | ||
226 | 230 | ||
227 | /* Allow drivers to submit batchbuffers directly to hardware, relying | 231 | /* Allow drivers to submit batchbuffers directly to hardware, relying |
228 | * on the security mechanisms provided by hardware. | 232 | * on the security mechanisms provided by hardware. |
@@ -266,6 +270,8 @@ typedef struct drm_i915_irq_wait { | |||
266 | #define I915_PARAM_CHIPSET_ID 4 | 270 | #define I915_PARAM_CHIPSET_ID 4 |
267 | #define I915_PARAM_HAS_GEM 5 | 271 | #define I915_PARAM_HAS_GEM 5 |
268 | #define I915_PARAM_NUM_FENCES_AVAIL 6 | 272 | #define I915_PARAM_NUM_FENCES_AVAIL 6 |
273 | #define I915_PARAM_HAS_OVERLAY 7 | ||
274 | #define I915_PARAM_HAS_PAGEFLIPPING 8 | ||
269 | 275 | ||
270 | typedef struct drm_i915_getparam { | 276 | typedef struct drm_i915_getparam { |
271 | int param; | 277 | int param; |
@@ -686,4 +692,70 @@ struct drm_i915_gem_madvise { | |||
686 | __u32 retained; | 692 | __u32 retained; |
687 | }; | 693 | }; |
688 | 694 | ||
695 | /* flags */ | ||
696 | #define I915_OVERLAY_TYPE_MASK 0xff | ||
697 | #define I915_OVERLAY_YUV_PLANAR 0x01 | ||
698 | #define I915_OVERLAY_YUV_PACKED 0x02 | ||
699 | #define I915_OVERLAY_RGB 0x03 | ||
700 | |||
701 | #define I915_OVERLAY_DEPTH_MASK 0xff00 | ||
702 | #define I915_OVERLAY_RGB24 0x1000 | ||
703 | #define I915_OVERLAY_RGB16 0x2000 | ||
704 | #define I915_OVERLAY_RGB15 0x3000 | ||
705 | #define I915_OVERLAY_YUV422 0x0100 | ||
706 | #define I915_OVERLAY_YUV411 0x0200 | ||
707 | #define I915_OVERLAY_YUV420 0x0300 | ||
708 | #define I915_OVERLAY_YUV410 0x0400 | ||
709 | |||
710 | #define I915_OVERLAY_SWAP_MASK 0xff0000 | ||
711 | #define I915_OVERLAY_NO_SWAP 0x000000 | ||
712 | #define I915_OVERLAY_UV_SWAP 0x010000 | ||
713 | #define I915_OVERLAY_Y_SWAP 0x020000 | ||
714 | #define I915_OVERLAY_Y_AND_UV_SWAP 0x030000 | ||
715 | |||
716 | #define I915_OVERLAY_FLAGS_MASK 0xff000000 | ||
717 | #define I915_OVERLAY_ENABLE 0x01000000 | ||
718 | |||
719 | struct drm_intel_overlay_put_image { | ||
720 | /* various flags and src format description */ | ||
721 | __u32 flags; | ||
722 | /* source picture description */ | ||
723 | __u32 bo_handle; | ||
724 | /* stride values and offsets are in bytes, buffer relative */ | ||
725 | __u16 stride_Y; /* stride for packed formats */ | ||
726 | __u16 stride_UV; | ||
727 | __u32 offset_Y; /* offset for packet formats */ | ||
728 | __u32 offset_U; | ||
729 | __u32 offset_V; | ||
730 | /* in pixels */ | ||
731 | __u16 src_width; | ||
732 | __u16 src_height; | ||
733 | /* to compensate the scaling factors for partially covered surfaces */ | ||
734 | __u16 src_scan_width; | ||
735 | __u16 src_scan_height; | ||
736 | /* output crtc description */ | ||
737 | __u32 crtc_id; | ||
738 | __u16 dst_x; | ||
739 | __u16 dst_y; | ||
740 | __u16 dst_width; | ||
741 | __u16 dst_height; | ||
742 | }; | ||
743 | |||
744 | /* flags */ | ||
745 | #define I915_OVERLAY_UPDATE_ATTRS (1<<0) | ||
746 | #define I915_OVERLAY_UPDATE_GAMMA (1<<1) | ||
747 | struct drm_intel_overlay_attrs { | ||
748 | __u32 flags; | ||
749 | __u32 color_key; | ||
750 | __s32 brightness; | ||
751 | __u32 contrast; | ||
752 | __u32 saturation; | ||
753 | __u32 gamma0; | ||
754 | __u32 gamma1; | ||
755 | __u32 gamma2; | ||
756 | __u32 gamma3; | ||
757 | __u32 gamma4; | ||
758 | __u32 gamma5; | ||
759 | }; | ||
760 | |||
689 | #endif /* _I915_DRM_H_ */ | 761 | #endif /* _I915_DRM_H_ */ |
diff --git a/include/drm/mga_drm.h b/include/drm/mga_drm.h index 325fd6fb4a42..3ffbc4798afa 100644 --- a/include/drm/mga_drm.h +++ b/include/drm/mga_drm.h | |||
@@ -35,7 +35,7 @@ | |||
35 | #ifndef __MGA_DRM_H__ | 35 | #ifndef __MGA_DRM_H__ |
36 | #define __MGA_DRM_H__ | 36 | #define __MGA_DRM_H__ |
37 | 37 | ||
38 | #include <linux/types.h> | 38 | #include "drm.h" |
39 | 39 | ||
40 | /* WARNING: If you change any of these defines, make sure to change the | 40 | /* WARNING: If you change any of these defines, make sure to change the |
41 | * defines in the Xserver file (mga_sarea.h) | 41 | * defines in the Xserver file (mga_sarea.h) |
diff --git a/include/drm/nouveau_drm.h b/include/drm/nouveau_drm.h new file mode 100644 index 000000000000..1e67c441ea82 --- /dev/null +++ b/include/drm/nouveau_drm.h | |||
@@ -0,0 +1,220 @@ | |||
1 | /* | ||
2 | * Copyright 2005 Stephane Marchesin. | ||
3 | * All Rights Reserved. | ||
4 | * | ||
5 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
6 | * copy of this software and associated documentation files (the "Software"), | ||
7 | * to deal in the Software without restriction, including without limitation | ||
8 | * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
9 | * and/or sell copies of the Software, and to permit persons to whom the | ||
10 | * Software is furnished to do so, subject to the following conditions: | ||
11 | * | ||
12 | * The above copyright notice and this permission notice (including the next | ||
13 | * paragraph) shall be included in all copies or substantial portions of the | ||
14 | * Software. | ||
15 | * | ||
16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
19 | * VA LINUX SYSTEMS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR | ||
20 | * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, | ||
21 | * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
22 | * OTHER DEALINGS IN THE SOFTWARE. | ||
23 | */ | ||
24 | |||
25 | #ifndef __NOUVEAU_DRM_H__ | ||
26 | #define __NOUVEAU_DRM_H__ | ||
27 | |||
28 | #define NOUVEAU_DRM_HEADER_PATCHLEVEL 15 | ||
29 | |||
30 | struct drm_nouveau_channel_alloc { | ||
31 | uint32_t fb_ctxdma_handle; | ||
32 | uint32_t tt_ctxdma_handle; | ||
33 | |||
34 | int channel; | ||
35 | |||
36 | /* Notifier memory */ | ||
37 | uint32_t notifier_handle; | ||
38 | |||
39 | /* DRM-enforced subchannel assignments */ | ||
40 | struct { | ||
41 | uint32_t handle; | ||
42 | uint32_t grclass; | ||
43 | } subchan[8]; | ||
44 | uint32_t nr_subchan; | ||
45 | }; | ||
46 | |||
47 | struct drm_nouveau_channel_free { | ||
48 | int channel; | ||
49 | }; | ||
50 | |||
51 | struct drm_nouveau_grobj_alloc { | ||
52 | int channel; | ||
53 | uint32_t handle; | ||
54 | int class; | ||
55 | }; | ||
56 | |||
57 | struct drm_nouveau_notifierobj_alloc { | ||
58 | uint32_t channel; | ||
59 | uint32_t handle; | ||
60 | uint32_t size; | ||
61 | uint32_t offset; | ||
62 | }; | ||
63 | |||
64 | struct drm_nouveau_gpuobj_free { | ||
65 | int channel; | ||
66 | uint32_t handle; | ||
67 | }; | ||
68 | |||
69 | /* FIXME : maybe unify {GET,SET}PARAMs */ | ||
70 | #define NOUVEAU_GETPARAM_PCI_VENDOR 3 | ||
71 | #define NOUVEAU_GETPARAM_PCI_DEVICE 4 | ||
72 | #define NOUVEAU_GETPARAM_BUS_TYPE 5 | ||
73 | #define NOUVEAU_GETPARAM_FB_PHYSICAL 6 | ||
74 | #define NOUVEAU_GETPARAM_AGP_PHYSICAL 7 | ||
75 | #define NOUVEAU_GETPARAM_FB_SIZE 8 | ||
76 | #define NOUVEAU_GETPARAM_AGP_SIZE 9 | ||
77 | #define NOUVEAU_GETPARAM_PCI_PHYSICAL 10 | ||
78 | #define NOUVEAU_GETPARAM_CHIPSET_ID 11 | ||
79 | #define NOUVEAU_GETPARAM_VM_VRAM_BASE 12 | ||
80 | struct drm_nouveau_getparam { | ||
81 | uint64_t param; | ||
82 | uint64_t value; | ||
83 | }; | ||
84 | |||
85 | struct drm_nouveau_setparam { | ||
86 | uint64_t param; | ||
87 | uint64_t value; | ||
88 | }; | ||
89 | |||
90 | #define NOUVEAU_GEM_DOMAIN_CPU (1 << 0) | ||
91 | #define NOUVEAU_GEM_DOMAIN_VRAM (1 << 1) | ||
92 | #define NOUVEAU_GEM_DOMAIN_GART (1 << 2) | ||
93 | #define NOUVEAU_GEM_DOMAIN_MAPPABLE (1 << 3) | ||
94 | |||
95 | struct drm_nouveau_gem_info { | ||
96 | uint32_t handle; | ||
97 | uint32_t domain; | ||
98 | uint64_t size; | ||
99 | uint64_t offset; | ||
100 | uint64_t map_handle; | ||
101 | uint32_t tile_mode; | ||
102 | uint32_t tile_flags; | ||
103 | }; | ||
104 | |||
105 | struct drm_nouveau_gem_new { | ||
106 | struct drm_nouveau_gem_info info; | ||
107 | uint32_t channel_hint; | ||
108 | uint32_t align; | ||
109 | }; | ||
110 | |||
111 | struct drm_nouveau_gem_pushbuf_bo { | ||
112 | uint64_t user_priv; | ||
113 | uint32_t handle; | ||
114 | uint32_t read_domains; | ||
115 | uint32_t write_domains; | ||
116 | uint32_t valid_domains; | ||
117 | uint32_t presumed_ok; | ||
118 | uint32_t presumed_domain; | ||
119 | uint64_t presumed_offset; | ||
120 | }; | ||
121 | |||
122 | #define NOUVEAU_GEM_RELOC_LOW (1 << 0) | ||
123 | #define NOUVEAU_GEM_RELOC_HIGH (1 << 1) | ||
124 | #define NOUVEAU_GEM_RELOC_OR (1 << 2) | ||
125 | struct drm_nouveau_gem_pushbuf_reloc { | ||
126 | uint32_t bo_index; | ||
127 | uint32_t reloc_index; | ||
128 | uint32_t flags; | ||
129 | uint32_t data; | ||
130 | uint32_t vor; | ||
131 | uint32_t tor; | ||
132 | }; | ||
133 | |||
134 | #define NOUVEAU_GEM_MAX_BUFFERS 1024 | ||
135 | #define NOUVEAU_GEM_MAX_RELOCS 1024 | ||
136 | |||
137 | struct drm_nouveau_gem_pushbuf { | ||
138 | uint32_t channel; | ||
139 | uint32_t nr_dwords; | ||
140 | uint32_t nr_buffers; | ||
141 | uint32_t nr_relocs; | ||
142 | uint64_t dwords; | ||
143 | uint64_t buffers; | ||
144 | uint64_t relocs; | ||
145 | }; | ||
146 | |||
147 | struct drm_nouveau_gem_pushbuf_call { | ||
148 | uint32_t channel; | ||
149 | uint32_t handle; | ||
150 | uint32_t offset; | ||
151 | uint32_t nr_buffers; | ||
152 | uint32_t nr_relocs; | ||
153 | uint32_t nr_dwords; | ||
154 | uint64_t buffers; | ||
155 | uint64_t relocs; | ||
156 | uint32_t suffix0; | ||
157 | uint32_t suffix1; | ||
158 | /* below only accessed for CALL2 */ | ||
159 | uint64_t vram_available; | ||
160 | uint64_t gart_available; | ||
161 | }; | ||
162 | |||
163 | struct drm_nouveau_gem_pin { | ||
164 | uint32_t handle; | ||
165 | uint32_t domain; | ||
166 | uint64_t offset; | ||
167 | }; | ||
168 | |||
169 | struct drm_nouveau_gem_unpin { | ||
170 | uint32_t handle; | ||
171 | }; | ||
172 | |||
173 | #define NOUVEAU_GEM_CPU_PREP_NOWAIT 0x00000001 | ||
174 | #define NOUVEAU_GEM_CPU_PREP_NOBLOCK 0x00000002 | ||
175 | #define NOUVEAU_GEM_CPU_PREP_WRITE 0x00000004 | ||
176 | struct drm_nouveau_gem_cpu_prep { | ||
177 | uint32_t handle; | ||
178 | uint32_t flags; | ||
179 | }; | ||
180 | |||
181 | struct drm_nouveau_gem_cpu_fini { | ||
182 | uint32_t handle; | ||
183 | }; | ||
184 | |||
185 | struct drm_nouveau_gem_tile { | ||
186 | uint32_t handle; | ||
187 | uint32_t offset; | ||
188 | uint32_t size; | ||
189 | uint32_t tile_mode; | ||
190 | uint32_t tile_flags; | ||
191 | }; | ||
192 | |||
193 | enum nouveau_bus_type { | ||
194 | NV_AGP = 0, | ||
195 | NV_PCI = 1, | ||
196 | NV_PCIE = 2, | ||
197 | }; | ||
198 | |||
199 | struct drm_nouveau_sarea { | ||
200 | }; | ||
201 | |||
202 | #define DRM_NOUVEAU_CARD_INIT 0x00 | ||
203 | #define DRM_NOUVEAU_GETPARAM 0x01 | ||
204 | #define DRM_NOUVEAU_SETPARAM 0x02 | ||
205 | #define DRM_NOUVEAU_CHANNEL_ALLOC 0x03 | ||
206 | #define DRM_NOUVEAU_CHANNEL_FREE 0x04 | ||
207 | #define DRM_NOUVEAU_GROBJ_ALLOC 0x05 | ||
208 | #define DRM_NOUVEAU_NOTIFIEROBJ_ALLOC 0x06 | ||
209 | #define DRM_NOUVEAU_GPUOBJ_FREE 0x07 | ||
210 | #define DRM_NOUVEAU_GEM_NEW 0x40 | ||
211 | #define DRM_NOUVEAU_GEM_PUSHBUF 0x41 | ||
212 | #define DRM_NOUVEAU_GEM_PUSHBUF_CALL 0x42 | ||
213 | #define DRM_NOUVEAU_GEM_PIN 0x43 /* !KMS only */ | ||
214 | #define DRM_NOUVEAU_GEM_UNPIN 0x44 /* !KMS only */ | ||
215 | #define DRM_NOUVEAU_GEM_CPU_PREP 0x45 | ||
216 | #define DRM_NOUVEAU_GEM_CPU_FINI 0x46 | ||
217 | #define DRM_NOUVEAU_GEM_INFO 0x47 | ||
218 | #define DRM_NOUVEAU_GEM_PUSHBUF_CALL2 0x48 | ||
219 | |||
220 | #endif /* __NOUVEAU_DRM_H__ */ | ||
diff --git a/include/drm/radeon_drm.h b/include/drm/radeon_drm.h index 3b9932ab1756..39537f3cf98a 100644 --- a/include/drm/radeon_drm.h +++ b/include/drm/radeon_drm.h | |||
@@ -33,7 +33,7 @@ | |||
33 | #ifndef __RADEON_DRM_H__ | 33 | #ifndef __RADEON_DRM_H__ |
34 | #define __RADEON_DRM_H__ | 34 | #define __RADEON_DRM_H__ |
35 | 35 | ||
36 | #include <linux/types.h> | 36 | #include "drm.h" |
37 | 37 | ||
38 | /* WARNING: If you change any of these defines, make sure to change the | 38 | /* WARNING: If you change any of these defines, make sure to change the |
39 | * defines in the X server file (radeon_sarea.h) | 39 | * defines in the X server file (radeon_sarea.h) |
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h index 491146170522..81eb9f45883c 100644 --- a/include/drm/ttm/ttm_bo_api.h +++ b/include/drm/ttm/ttm_bo_api.h | |||
@@ -44,6 +44,29 @@ struct ttm_bo_device; | |||
44 | 44 | ||
45 | struct drm_mm_node; | 45 | struct drm_mm_node; |
46 | 46 | ||
47 | |||
48 | /** | ||
49 | * struct ttm_placement | ||
50 | * | ||
51 | * @fpfn: first valid page frame number to put the object | ||
52 | * @lpfn: last valid page frame number to put the object | ||
53 | * @num_placement: number of prefered placements | ||
54 | * @placement: prefered placements | ||
55 | * @num_busy_placement: number of prefered placements when need to evict buffer | ||
56 | * @busy_placement: prefered placements when need to evict buffer | ||
57 | * | ||
58 | * Structure indicating the placement you request for an object. | ||
59 | */ | ||
60 | struct ttm_placement { | ||
61 | unsigned fpfn; | ||
62 | unsigned lpfn; | ||
63 | unsigned num_placement; | ||
64 | const uint32_t *placement; | ||
65 | unsigned num_busy_placement; | ||
66 | const uint32_t *busy_placement; | ||
67 | }; | ||
68 | |||
69 | |||
47 | /** | 70 | /** |
48 | * struct ttm_mem_reg | 71 | * struct ttm_mem_reg |
49 | * | 72 | * |
@@ -109,10 +132,6 @@ struct ttm_tt; | |||
109 | * the object is destroyed. | 132 | * the object is destroyed. |
110 | * @event_queue: Queue for processes waiting on buffer object status change. | 133 | * @event_queue: Queue for processes waiting on buffer object status change. |
111 | * @lock: spinlock protecting mostly synchronization members. | 134 | * @lock: spinlock protecting mostly synchronization members. |
112 | * @proposed_placement: Proposed placement for the buffer. Changed only by the | ||
113 | * creator prior to validation as opposed to bo->mem.proposed_flags which is | ||
114 | * changed by the implementation prior to a buffer move if it wants to outsmart | ||
115 | * the buffer creator / user. This latter happens, for example, at eviction. | ||
116 | * @mem: structure describing current placement. | 135 | * @mem: structure describing current placement. |
117 | * @persistant_swap_storage: Usually the swap storage is deleted for buffers | 136 | * @persistant_swap_storage: Usually the swap storage is deleted for buffers |
118 | * pinned in physical memory. If this behaviour is not desired, this member | 137 | * pinned in physical memory. If this behaviour is not desired, this member |
@@ -177,7 +196,6 @@ struct ttm_buffer_object { | |||
177 | * Members protected by the bo::reserved lock. | 196 | * Members protected by the bo::reserved lock. |
178 | */ | 197 | */ |
179 | 198 | ||
180 | uint32_t proposed_placement; | ||
181 | struct ttm_mem_reg mem; | 199 | struct ttm_mem_reg mem; |
182 | struct file *persistant_swap_storage; | 200 | struct file *persistant_swap_storage; |
183 | struct ttm_tt *ttm; | 201 | struct ttm_tt *ttm; |
@@ -285,29 +303,30 @@ ttm_bo_reference(struct ttm_buffer_object *bo) | |||
285 | * Note: It might be necessary to block validations before the | 303 | * Note: It might be necessary to block validations before the |
286 | * wait by reserving the buffer. | 304 | * wait by reserving the buffer. |
287 | * Returns -EBUSY if no_wait is true and the buffer is busy. | 305 | * Returns -EBUSY if no_wait is true and the buffer is busy. |
288 | * Returns -ERESTART if interrupted by a signal. | 306 | * Returns -ERESTARTSYS if interrupted by a signal. |
289 | */ | 307 | */ |
290 | extern int ttm_bo_wait(struct ttm_buffer_object *bo, bool lazy, | 308 | extern int ttm_bo_wait(struct ttm_buffer_object *bo, bool lazy, |
291 | bool interruptible, bool no_wait); | 309 | bool interruptible, bool no_wait); |
292 | /** | 310 | /** |
293 | * ttm_buffer_object_validate | 311 | * ttm_bo_validate |
294 | * | 312 | * |
295 | * @bo: The buffer object. | 313 | * @bo: The buffer object. |
296 | * @proposed_placement: Proposed_placement for the buffer object. | 314 | * @placement: Proposed placement for the buffer object. |
297 | * @interruptible: Sleep interruptible if sleeping. | 315 | * @interruptible: Sleep interruptible if sleeping. |
298 | * @no_wait: Return immediately if the buffer is busy. | 316 | * @no_wait: Return immediately if the buffer is busy. |
299 | * | 317 | * |
300 | * Changes placement and caching policy of the buffer object | 318 | * Changes placement and caching policy of the buffer object |
301 | * according to bo::proposed_flags. | 319 | * according proposed placement. |
302 | * Returns | 320 | * Returns |
303 | * -EINVAL on invalid proposed_flags. | 321 | * -EINVAL on invalid proposed placement. |
304 | * -ENOMEM on out-of-memory condition. | 322 | * -ENOMEM on out-of-memory condition. |
305 | * -EBUSY if no_wait is true and buffer busy. | 323 | * -EBUSY if no_wait is true and buffer busy. |
306 | * -ERESTART if interrupted by a signal. | 324 | * -ERESTARTSYS if interrupted by a signal. |
307 | */ | 325 | */ |
308 | extern int ttm_buffer_object_validate(struct ttm_buffer_object *bo, | 326 | extern int ttm_bo_validate(struct ttm_buffer_object *bo, |
309 | uint32_t proposed_placement, | 327 | struct ttm_placement *placement, |
310 | bool interruptible, bool no_wait); | 328 | bool interruptible, bool no_wait); |
329 | |||
311 | /** | 330 | /** |
312 | * ttm_bo_unref | 331 | * ttm_bo_unref |
313 | * | 332 | * |
@@ -328,7 +347,7 @@ extern void ttm_bo_unref(struct ttm_buffer_object **bo); | |||
328 | * waiting for buffer idle. This lock is recursive. | 347 | * waiting for buffer idle. This lock is recursive. |
329 | * Returns | 348 | * Returns |
330 | * -EBUSY if the buffer is busy and no_wait is true. | 349 | * -EBUSY if the buffer is busy and no_wait is true. |
331 | * -ERESTART if interrupted by a signal. | 350 | * -ERESTARTSYS if interrupted by a signal. |
332 | */ | 351 | */ |
333 | 352 | ||
334 | extern int | 353 | extern int |
@@ -343,7 +362,7 @@ ttm_bo_synccpu_write_grab(struct ttm_buffer_object *bo, bool no_wait); | |||
343 | extern void ttm_bo_synccpu_write_release(struct ttm_buffer_object *bo); | 362 | extern void ttm_bo_synccpu_write_release(struct ttm_buffer_object *bo); |
344 | 363 | ||
345 | /** | 364 | /** |
346 | * ttm_buffer_object_init | 365 | * ttm_bo_init |
347 | * | 366 | * |
348 | * @bdev: Pointer to a ttm_bo_device struct. | 367 | * @bdev: Pointer to a ttm_bo_device struct. |
349 | * @bo: Pointer to a ttm_buffer_object to be initialized. | 368 | * @bo: Pointer to a ttm_buffer_object to be initialized. |
@@ -371,20 +390,20 @@ extern void ttm_bo_synccpu_write_release(struct ttm_buffer_object *bo); | |||
371 | * Returns | 390 | * Returns |
372 | * -ENOMEM: Out of memory. | 391 | * -ENOMEM: Out of memory. |
373 | * -EINVAL: Invalid placement flags. | 392 | * -EINVAL: Invalid placement flags. |
374 | * -ERESTART: Interrupted by signal while sleeping waiting for resources. | 393 | * -ERESTARTSYS: Interrupted by signal while sleeping waiting for resources. |
375 | */ | 394 | */ |
376 | 395 | ||
377 | extern int ttm_buffer_object_init(struct ttm_bo_device *bdev, | 396 | extern int ttm_bo_init(struct ttm_bo_device *bdev, |
378 | struct ttm_buffer_object *bo, | 397 | struct ttm_buffer_object *bo, |
379 | unsigned long size, | 398 | unsigned long size, |
380 | enum ttm_bo_type type, | 399 | enum ttm_bo_type type, |
381 | uint32_t flags, | 400 | struct ttm_placement *placement, |
382 | uint32_t page_alignment, | 401 | uint32_t page_alignment, |
383 | unsigned long buffer_start, | 402 | unsigned long buffer_start, |
384 | bool interrubtible, | 403 | bool interrubtible, |
385 | struct file *persistant_swap_storage, | 404 | struct file *persistant_swap_storage, |
386 | size_t acc_size, | 405 | size_t acc_size, |
387 | void (*destroy) (struct ttm_buffer_object *)); | 406 | void (*destroy) (struct ttm_buffer_object *)); |
388 | /** | 407 | /** |
389 | * ttm_bo_synccpu_object_init | 408 | * ttm_bo_synccpu_object_init |
390 | * | 409 | * |
@@ -405,47 +424,43 @@ extern int ttm_buffer_object_init(struct ttm_bo_device *bdev, | |||
405 | * GEM user interface. | 424 | * GEM user interface. |
406 | * @p_bo: On successful completion *p_bo points to the created object. | 425 | * @p_bo: On successful completion *p_bo points to the created object. |
407 | * | 426 | * |
408 | * This function allocates a ttm_buffer_object, and then calls | 427 | * This function allocates a ttm_buffer_object, and then calls ttm_bo_init |
409 | * ttm_buffer_object_init on that object. | 428 | * on that object. The destroy function is set to kfree(). |
410 | * The destroy function is set to kfree(). | ||
411 | * Returns | 429 | * Returns |
412 | * -ENOMEM: Out of memory. | 430 | * -ENOMEM: Out of memory. |
413 | * -EINVAL: Invalid placement flags. | 431 | * -EINVAL: Invalid placement flags. |
414 | * -ERESTART: Interrupted by signal while waiting for resources. | 432 | * -ERESTARTSYS: Interrupted by signal while waiting for resources. |
415 | */ | 433 | */ |
416 | 434 | ||
417 | extern int ttm_buffer_object_create(struct ttm_bo_device *bdev, | 435 | extern int ttm_bo_create(struct ttm_bo_device *bdev, |
418 | unsigned long size, | 436 | unsigned long size, |
419 | enum ttm_bo_type type, | 437 | enum ttm_bo_type type, |
420 | uint32_t flags, | 438 | struct ttm_placement *placement, |
421 | uint32_t page_alignment, | 439 | uint32_t page_alignment, |
422 | unsigned long buffer_start, | 440 | unsigned long buffer_start, |
423 | bool interruptible, | 441 | bool interruptible, |
424 | struct file *persistant_swap_storage, | 442 | struct file *persistant_swap_storage, |
425 | struct ttm_buffer_object **p_bo); | 443 | struct ttm_buffer_object **p_bo); |
426 | 444 | ||
427 | /** | 445 | /** |
428 | * ttm_bo_check_placement | 446 | * ttm_bo_check_placement |
429 | * | 447 | * |
430 | * @bo: the buffer object. | 448 | * @bo: the buffer object. |
431 | * @set_flags: placement flags to set. | 449 | * @placement: placements |
432 | * @clr_flags: placement flags to clear. | ||
433 | * | 450 | * |
434 | * Performs minimal validity checking on an intended change of | 451 | * Performs minimal validity checking on an intended change of |
435 | * placement flags. | 452 | * placement flags. |
436 | * Returns | 453 | * Returns |
437 | * -EINVAL: Intended change is invalid or not allowed. | 454 | * -EINVAL: Intended change is invalid or not allowed. |
438 | */ | 455 | */ |
439 | |||
440 | extern int ttm_bo_check_placement(struct ttm_buffer_object *bo, | 456 | extern int ttm_bo_check_placement(struct ttm_buffer_object *bo, |
441 | uint32_t set_flags, uint32_t clr_flags); | 457 | struct ttm_placement *placement); |
442 | 458 | ||
443 | /** | 459 | /** |
444 | * ttm_bo_init_mm | 460 | * ttm_bo_init_mm |
445 | * | 461 | * |
446 | * @bdev: Pointer to a ttm_bo_device struct. | 462 | * @bdev: Pointer to a ttm_bo_device struct. |
447 | * @mem_type: The memory type. | 463 | * @mem_type: The memory type. |
448 | * @p_offset: offset for managed area in pages. | ||
449 | * @p_size: size managed area in pages. | 464 | * @p_size: size managed area in pages. |
450 | * | 465 | * |
451 | * Initialize a manager for a given memory type. | 466 | * Initialize a manager for a given memory type. |
@@ -458,7 +473,7 @@ extern int ttm_bo_check_placement(struct ttm_buffer_object *bo, | |||
458 | */ | 473 | */ |
459 | 474 | ||
460 | extern int ttm_bo_init_mm(struct ttm_bo_device *bdev, unsigned type, | 475 | extern int ttm_bo_init_mm(struct ttm_bo_device *bdev, unsigned type, |
461 | unsigned long p_offset, unsigned long p_size); | 476 | unsigned long p_size); |
462 | /** | 477 | /** |
463 | * ttm_bo_clean_mm | 478 | * ttm_bo_clean_mm |
464 | * | 479 | * |
@@ -503,7 +518,7 @@ extern int ttm_bo_clean_mm(struct ttm_bo_device *bdev, unsigned mem_type); | |||
503 | * | 518 | * |
504 | * Returns: | 519 | * Returns: |
505 | * -EINVAL: Invalid or uninitialized memory type. | 520 | * -EINVAL: Invalid or uninitialized memory type. |
506 | * -ERESTART: The call was interrupted by a signal while waiting to | 521 | * -ERESTARTSYS: The call was interrupted by a signal while waiting to |
507 | * evict a buffer. | 522 | * evict a buffer. |
508 | */ | 523 | */ |
509 | 524 | ||
@@ -606,7 +621,7 @@ extern int ttm_bo_mmap(struct file *filp, struct vm_area_struct *vma, | |||
606 | * be called from the fops::read and fops::write method. | 621 | * be called from the fops::read and fops::write method. |
607 | * Returns: | 622 | * Returns: |
608 | * See man (2) write, man(2) read. In particular, | 623 | * See man (2) write, man(2) read. In particular, |
609 | * the function may return -EINTR if | 624 | * the function may return -ERESTARTSYS if |
610 | * interrupted by a signal. | 625 | * interrupted by a signal. |
611 | */ | 626 | */ |
612 | 627 | ||
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h index e8cd6d20aed2..ff7664e0c3cd 100644 --- a/include/drm/ttm/ttm_bo_driver.h +++ b/include/drm/ttm/ttm_bo_driver.h | |||
@@ -242,12 +242,6 @@ struct ttm_mem_type_manager { | |||
242 | /** | 242 | /** |
243 | * struct ttm_bo_driver | 243 | * struct ttm_bo_driver |
244 | * | 244 | * |
245 | * @mem_type_prio: Priority array of memory types to place a buffer object in | ||
246 | * if it fits without evicting buffers from any of these memory types. | ||
247 | * @mem_busy_prio: Priority array of memory types to place a buffer object in | ||
248 | * if it needs to evict buffers to make room. | ||
249 | * @num_mem_type_prio: Number of elements in the @mem_type_prio array. | ||
250 | * @num_mem_busy_prio: Number of elements in the @num_mem_busy_prio array. | ||
251 | * @create_ttm_backend_entry: Callback to create a struct ttm_backend. | 245 | * @create_ttm_backend_entry: Callback to create a struct ttm_backend. |
252 | * @invalidate_caches: Callback to invalidate read caches when a buffer object | 246 | * @invalidate_caches: Callback to invalidate read caches when a buffer object |
253 | * has been evicted. | 247 | * has been evicted. |
@@ -265,11 +259,6 @@ struct ttm_mem_type_manager { | |||
265 | */ | 259 | */ |
266 | 260 | ||
267 | struct ttm_bo_driver { | 261 | struct ttm_bo_driver { |
268 | const uint32_t *mem_type_prio; | ||
269 | const uint32_t *mem_busy_prio; | ||
270 | uint32_t num_mem_type_prio; | ||
271 | uint32_t num_mem_busy_prio; | ||
272 | |||
273 | /** | 262 | /** |
274 | * struct ttm_bo_driver member create_ttm_backend_entry | 263 | * struct ttm_bo_driver member create_ttm_backend_entry |
275 | * | 264 | * |
@@ -306,7 +295,8 @@ struct ttm_bo_driver { | |||
306 | * finished, they'll end up in bo->mem.flags | 295 | * finished, they'll end up in bo->mem.flags |
307 | */ | 296 | */ |
308 | 297 | ||
309 | uint32_t(*evict_flags) (struct ttm_buffer_object *bo); | 298 | void(*evict_flags) (struct ttm_buffer_object *bo, |
299 | struct ttm_placement *placement); | ||
310 | /** | 300 | /** |
311 | * struct ttm_bo_driver member move: | 301 | * struct ttm_bo_driver member move: |
312 | * | 302 | * |
@@ -545,6 +535,15 @@ extern int ttm_tt_set_user(struct ttm_tt *ttm, | |||
545 | extern int ttm_tt_bind(struct ttm_tt *ttm, struct ttm_mem_reg *bo_mem); | 535 | extern int ttm_tt_bind(struct ttm_tt *ttm, struct ttm_mem_reg *bo_mem); |
546 | 536 | ||
547 | /** | 537 | /** |
538 | * ttm_tt_populate: | ||
539 | * | ||
540 | * @ttm: The struct ttm_tt to contain the backing pages. | ||
541 | * | ||
542 | * Add backing pages to all of @ttm | ||
543 | */ | ||
544 | extern int ttm_tt_populate(struct ttm_tt *ttm); | ||
545 | |||
546 | /** | ||
548 | * ttm_ttm_destroy: | 547 | * ttm_ttm_destroy: |
549 | * | 548 | * |
550 | * @ttm: The struct ttm_tt. | 549 | * @ttm: The struct ttm_tt. |
@@ -639,12 +638,12 @@ extern bool ttm_mem_reg_is_pci(struct ttm_bo_device *bdev, | |||
639 | * -EBUSY: No space available (only if no_wait == 1). | 638 | * -EBUSY: No space available (only if no_wait == 1). |
640 | * -ENOMEM: Could not allocate memory for the buffer object, either due to | 639 | * -ENOMEM: Could not allocate memory for the buffer object, either due to |
641 | * fragmentation or concurrent allocators. | 640 | * fragmentation or concurrent allocators. |
642 | * -ERESTART: An interruptible sleep was interrupted by a signal. | 641 | * -ERESTARTSYS: An interruptible sleep was interrupted by a signal. |
643 | */ | 642 | */ |
644 | extern int ttm_bo_mem_space(struct ttm_buffer_object *bo, | 643 | extern int ttm_bo_mem_space(struct ttm_buffer_object *bo, |
645 | uint32_t proposed_placement, | 644 | struct ttm_placement *placement, |
646 | struct ttm_mem_reg *mem, | 645 | struct ttm_mem_reg *mem, |
647 | bool interruptible, bool no_wait); | 646 | bool interruptible, bool no_wait); |
648 | /** | 647 | /** |
649 | * ttm_bo_wait_for_cpu | 648 | * ttm_bo_wait_for_cpu |
650 | * | 649 | * |
@@ -654,7 +653,7 @@ extern int ttm_bo_mem_space(struct ttm_buffer_object *bo, | |||
654 | * Wait until a buffer object is no longer sync'ed for CPU access. | 653 | * Wait until a buffer object is no longer sync'ed for CPU access. |
655 | * Returns: | 654 | * Returns: |
656 | * -EBUSY: Buffer object was sync'ed for CPU access. (only if no_wait == 1). | 655 | * -EBUSY: Buffer object was sync'ed for CPU access. (only if no_wait == 1). |
657 | * -ERESTART: An interruptible sleep was interrupted by a signal. | 656 | * -ERESTARTSYS: An interruptible sleep was interrupted by a signal. |
658 | */ | 657 | */ |
659 | 658 | ||
660 | extern int ttm_bo_wait_cpu(struct ttm_buffer_object *bo, bool no_wait); | 659 | extern int ttm_bo_wait_cpu(struct ttm_buffer_object *bo, bool no_wait); |
@@ -758,7 +757,7 @@ extern void ttm_bo_unmap_virtual(struct ttm_buffer_object *bo); | |||
758 | * -EAGAIN: The reservation may cause a deadlock. | 757 | * -EAGAIN: The reservation may cause a deadlock. |
759 | * Release all buffer reservations, wait for @bo to become unreserved and | 758 | * Release all buffer reservations, wait for @bo to become unreserved and |
760 | * try again. (only if use_sequence == 1). | 759 | * try again. (only if use_sequence == 1). |
761 | * -ERESTART: A wait for the buffer to become unreserved was interrupted by | 760 | * -ERESTARTSYS: A wait for the buffer to become unreserved was interrupted by |
762 | * a signal. Release all buffer reservations and return to user-space. | 761 | * a signal. Release all buffer reservations and return to user-space. |
763 | */ | 762 | */ |
764 | extern int ttm_bo_reserve(struct ttm_buffer_object *bo, | 763 | extern int ttm_bo_reserve(struct ttm_buffer_object *bo, |
@@ -799,7 +798,7 @@ extern int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo, | |||
799 | * | 798 | * |
800 | * Returns: | 799 | * Returns: |
801 | * -EBUSY: If no_wait == 1 and the buffer is already reserved. | 800 | * -EBUSY: If no_wait == 1 and the buffer is already reserved. |
802 | * -ERESTART: If interruptible == 1 and the process received a signal | 801 | * -ERESTARTSYS: If interruptible == 1 and the process received a signal |
803 | * while sleeping. | 802 | * while sleeping. |
804 | */ | 803 | */ |
805 | extern int ttm_bo_block_reservation(struct ttm_buffer_object *bo, | 804 | extern int ttm_bo_block_reservation(struct ttm_buffer_object *bo, |
diff --git a/include/drm/ttm/ttm_execbuf_util.h b/include/drm/ttm/ttm_execbuf_util.h new file mode 100644 index 000000000000..cd2c475da9ea --- /dev/null +++ b/include/drm/ttm/ttm_execbuf_util.h | |||
@@ -0,0 +1,107 @@ | |||
1 | /************************************************************************** | ||
2 | * | ||
3 | * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA | ||
4 | * All Rights Reserved. | ||
5 | * | ||
6 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
7 | * copy of this software and associated documentation files (the | ||
8 | * "Software"), to deal in the Software without restriction, including | ||
9 | * without limitation the rights to use, copy, modify, merge, publish, | ||
10 | * distribute, sub license, and/or sell copies of the Software, and to | ||
11 | * permit persons to whom the Software is furnished to do so, subject to | ||
12 | * the following conditions: | ||
13 | * | ||
14 | * The above copyright notice and this permission notice (including the | ||
15 | * next paragraph) shall be included in all copies or substantial portions | ||
16 | * of the Software. | ||
17 | * | ||
18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
20 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL | ||
21 | * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, | ||
22 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
23 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE | ||
24 | * USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
25 | * | ||
26 | **************************************************************************/ | ||
27 | /* | ||
28 | * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com> | ||
29 | */ | ||
30 | |||
31 | #ifndef _TTM_EXECBUF_UTIL_H_ | ||
32 | #define _TTM_EXECBUF_UTIL_H_ | ||
33 | |||
34 | #include "ttm/ttm_bo_api.h" | ||
35 | #include <linux/list.h> | ||
36 | |||
37 | /** | ||
38 | * struct ttm_validate_buffer | ||
39 | * | ||
40 | * @head: list head for thread-private list. | ||
41 | * @bo: refcounted buffer object pointer. | ||
42 | * @new_sync_obj_arg: New sync_obj_arg for @bo, to be used once | ||
43 | * adding a new sync object. | ||
44 | * @reservied: Indicates whether @bo has been reserved for validation. | ||
45 | */ | ||
46 | |||
47 | struct ttm_validate_buffer { | ||
48 | struct list_head head; | ||
49 | struct ttm_buffer_object *bo; | ||
50 | void *new_sync_obj_arg; | ||
51 | bool reserved; | ||
52 | }; | ||
53 | |||
54 | /** | ||
55 | * function ttm_eu_backoff_reservation | ||
56 | * | ||
57 | * @list: thread private list of ttm_validate_buffer structs. | ||
58 | * | ||
59 | * Undoes all buffer validation reservations for bos pointed to by | ||
60 | * the list entries. | ||
61 | */ | ||
62 | |||
63 | extern void ttm_eu_backoff_reservation(struct list_head *list); | ||
64 | |||
65 | /** | ||
66 | * function ttm_eu_reserve_buffers | ||
67 | * | ||
68 | * @list: thread private list of ttm_validate_buffer structs. | ||
69 | * @val_seq: A unique sequence number. | ||
70 | * | ||
71 | * Tries to reserve bos pointed to by the list entries for validation. | ||
72 | * If the function returns 0, all buffers are marked as "unfenced", | ||
73 | * taken off the lru lists and are not synced for write CPU usage. | ||
74 | * | ||
75 | * If the function detects a deadlock due to multiple threads trying to | ||
76 | * reserve the same buffers in reverse order, all threads except one will | ||
77 | * back off and retry. This function may sleep while waiting for | ||
78 | * CPU write reservations to be cleared, and for other threads to | ||
79 | * unreserve their buffers. | ||
80 | * | ||
81 | * This function may return -ERESTART or -EAGAIN if the calling process | ||
82 | * receives a signal while waiting. In that case, no buffers on the list | ||
83 | * will be reserved upon return. | ||
84 | * | ||
85 | * Buffers reserved by this function should be unreserved by | ||
86 | * a call to either ttm_eu_backoff_reservation() or | ||
87 | * ttm_eu_fence_buffer_objects() when command submission is complete or | ||
88 | * has failed. | ||
89 | */ | ||
90 | |||
91 | extern int ttm_eu_reserve_buffers(struct list_head *list, uint32_t val_seq); | ||
92 | |||
93 | /** | ||
94 | * function ttm_eu_fence_buffer_objects. | ||
95 | * | ||
96 | * @list: thread private list of ttm_validate_buffer structs. | ||
97 | * @sync_obj: The new sync object for the buffers. | ||
98 | * | ||
99 | * This function should be called when command submission is complete, and | ||
100 | * it will add a new sync object to bos pointed to by entries on @list. | ||
101 | * It also unreserves all buffers, putting them on lru lists. | ||
102 | * | ||
103 | */ | ||
104 | |||
105 | extern void ttm_eu_fence_buffer_objects(struct list_head *list, void *sync_obj); | ||
106 | |||
107 | #endif | ||
diff --git a/include/drm/ttm/ttm_lock.h b/include/drm/ttm/ttm_lock.h new file mode 100644 index 000000000000..81ba0b0b891a --- /dev/null +++ b/include/drm/ttm/ttm_lock.h | |||
@@ -0,0 +1,247 @@ | |||
1 | /************************************************************************** | ||
2 | * | ||
3 | * Copyright (c) 2007-2009 VMware, Inc., Palo Alto, CA., USA | ||
4 | * All Rights Reserved. | ||
5 | * | ||
6 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
7 | * copy of this software and associated documentation files (the | ||
8 | * "Software"), to deal in the Software without restriction, including | ||
9 | * without limitation the rights to use, copy, modify, merge, publish, | ||
10 | * distribute, sub license, and/or sell copies of the Software, and to | ||
11 | * permit persons to whom the Software is furnished to do so, subject to | ||
12 | * the following conditions: | ||
13 | * | ||
14 | * The above copyright notice and this permission notice (including the | ||
15 | * next paragraph) shall be included in all copies or substantial portions | ||
16 | * of the Software. | ||
17 | * | ||
18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
20 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL | ||
21 | * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, | ||
22 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
23 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE | ||
24 | * USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
25 | * | ||
26 | **************************************************************************/ | ||
27 | /* | ||
28 | * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com> | ||
29 | */ | ||
30 | |||
31 | /** @file ttm_lock.h | ||
32 | * This file implements a simple replacement for the buffer manager use | ||
33 | * of the DRM heavyweight hardware lock. | ||
34 | * The lock is a read-write lock. Taking it in read mode and write mode | ||
35 | * is relatively fast, and intended for in-kernel use only. | ||
36 | * | ||
37 | * The vt mode is used only when there is a need to block all | ||
38 | * user-space processes from validating buffers. | ||
39 | * It's allowed to leave kernel space with the vt lock held. | ||
40 | * If a user-space process dies while having the vt-lock, | ||
41 | * it will be released during the file descriptor release. The vt lock | ||
42 | * excludes write lock and read lock. | ||
43 | * | ||
44 | * The suspend mode is used to lock out all TTM users when preparing for | ||
45 | * and executing suspend operations. | ||
46 | * | ||
47 | */ | ||
48 | |||
49 | #ifndef _TTM_LOCK_H_ | ||
50 | #define _TTM_LOCK_H_ | ||
51 | |||
52 | #include "ttm/ttm_object.h" | ||
53 | #include <linux/wait.h> | ||
54 | #include <asm/atomic.h> | ||
55 | |||
56 | /** | ||
57 | * struct ttm_lock | ||
58 | * | ||
59 | * @base: ttm base object used solely to release the lock if the client | ||
60 | * holding the lock dies. | ||
61 | * @queue: Queue for processes waiting for lock change-of-status. | ||
62 | * @lock: Spinlock protecting some lock members. | ||
63 | * @rw: Read-write lock counter. Protected by @lock. | ||
64 | * @flags: Lock state. Protected by @lock. | ||
65 | * @kill_takers: Boolean whether to kill takers of the lock. | ||
66 | * @signal: Signal to send when kill_takers is true. | ||
67 | */ | ||
68 | |||
69 | struct ttm_lock { | ||
70 | struct ttm_base_object base; | ||
71 | wait_queue_head_t queue; | ||
72 | spinlock_t lock; | ||
73 | int32_t rw; | ||
74 | uint32_t flags; | ||
75 | bool kill_takers; | ||
76 | int signal; | ||
77 | struct ttm_object_file *vt_holder; | ||
78 | }; | ||
79 | |||
80 | |||
81 | /** | ||
82 | * ttm_lock_init | ||
83 | * | ||
84 | * @lock: Pointer to a struct ttm_lock | ||
85 | * Initializes the lock. | ||
86 | */ | ||
87 | extern void ttm_lock_init(struct ttm_lock *lock); | ||
88 | |||
89 | /** | ||
90 | * ttm_read_unlock | ||
91 | * | ||
92 | * @lock: Pointer to a struct ttm_lock | ||
93 | * | ||
94 | * Releases a read lock. | ||
95 | */ | ||
96 | extern void ttm_read_unlock(struct ttm_lock *lock); | ||
97 | |||
98 | /** | ||
99 | * ttm_read_lock | ||
100 | * | ||
101 | * @lock: Pointer to a struct ttm_lock | ||
102 | * @interruptible: Interruptible sleeping while waiting for a lock. | ||
103 | * | ||
104 | * Takes the lock in read mode. | ||
105 | * Returns: | ||
106 | * -ERESTARTSYS If interrupted by a signal and interruptible is true. | ||
107 | */ | ||
108 | extern int ttm_read_lock(struct ttm_lock *lock, bool interruptible); | ||
109 | |||
110 | /** | ||
111 | * ttm_read_trylock | ||
112 | * | ||
113 | * @lock: Pointer to a struct ttm_lock | ||
114 | * @interruptible: Interruptible sleeping while waiting for a lock. | ||
115 | * | ||
116 | * Tries to take the lock in read mode. If the lock is already held | ||
117 | * in write mode, the function will return -EBUSY. If the lock is held | ||
118 | * in vt or suspend mode, the function will sleep until these modes | ||
119 | * are unlocked. | ||
120 | * | ||
121 | * Returns: | ||
122 | * -EBUSY The lock was already held in write mode. | ||
123 | * -ERESTARTSYS If interrupted by a signal and interruptible is true. | ||
124 | */ | ||
125 | extern int ttm_read_trylock(struct ttm_lock *lock, bool interruptible); | ||
126 | |||
127 | /** | ||
128 | * ttm_write_unlock | ||
129 | * | ||
130 | * @lock: Pointer to a struct ttm_lock | ||
131 | * | ||
132 | * Releases a write lock. | ||
133 | */ | ||
134 | extern void ttm_write_unlock(struct ttm_lock *lock); | ||
135 | |||
136 | /** | ||
137 | * ttm_write_lock | ||
138 | * | ||
139 | * @lock: Pointer to a struct ttm_lock | ||
140 | * @interruptible: Interruptible sleeping while waiting for a lock. | ||
141 | * | ||
142 | * Takes the lock in write mode. | ||
143 | * Returns: | ||
144 | * -ERESTARTSYS If interrupted by a signal and interruptible is true. | ||
145 | */ | ||
146 | extern int ttm_write_lock(struct ttm_lock *lock, bool interruptible); | ||
147 | |||
148 | /** | ||
149 | * ttm_lock_downgrade | ||
150 | * | ||
151 | * @lock: Pointer to a struct ttm_lock | ||
152 | * | ||
153 | * Downgrades a write lock to a read lock. | ||
154 | */ | ||
155 | extern void ttm_lock_downgrade(struct ttm_lock *lock); | ||
156 | |||
157 | /** | ||
158 | * ttm_suspend_lock | ||
159 | * | ||
160 | * @lock: Pointer to a struct ttm_lock | ||
161 | * | ||
162 | * Takes the lock in suspend mode. Excludes read and write mode. | ||
163 | */ | ||
164 | extern void ttm_suspend_lock(struct ttm_lock *lock); | ||
165 | |||
166 | /** | ||
167 | * ttm_suspend_unlock | ||
168 | * | ||
169 | * @lock: Pointer to a struct ttm_lock | ||
170 | * | ||
171 | * Releases a suspend lock | ||
172 | */ | ||
173 | extern void ttm_suspend_unlock(struct ttm_lock *lock); | ||
174 | |||
175 | /** | ||
176 | * ttm_vt_lock | ||
177 | * | ||
178 | * @lock: Pointer to a struct ttm_lock | ||
179 | * @interruptible: Interruptible sleeping while waiting for a lock. | ||
180 | * @tfile: Pointer to a struct ttm_object_file to register the lock with. | ||
181 | * | ||
182 | * Takes the lock in vt mode. | ||
183 | * Returns: | ||
184 | * -ERESTARTSYS If interrupted by a signal and interruptible is true. | ||
185 | * -ENOMEM: Out of memory when locking. | ||
186 | */ | ||
187 | extern int ttm_vt_lock(struct ttm_lock *lock, bool interruptible, | ||
188 | struct ttm_object_file *tfile); | ||
189 | |||
190 | /** | ||
191 | * ttm_vt_unlock | ||
192 | * | ||
193 | * @lock: Pointer to a struct ttm_lock | ||
194 | * | ||
195 | * Releases a vt lock. | ||
196 | * Returns: | ||
197 | * -EINVAL If the lock was not held. | ||
198 | */ | ||
199 | extern int ttm_vt_unlock(struct ttm_lock *lock); | ||
200 | |||
201 | /** | ||
202 | * ttm_write_unlock | ||
203 | * | ||
204 | * @lock: Pointer to a struct ttm_lock | ||
205 | * | ||
206 | * Releases a write lock. | ||
207 | */ | ||
208 | extern void ttm_write_unlock(struct ttm_lock *lock); | ||
209 | |||
210 | /** | ||
211 | * ttm_write_lock | ||
212 | * | ||
213 | * @lock: Pointer to a struct ttm_lock | ||
214 | * @interruptible: Interruptible sleeping while waiting for a lock. | ||
215 | * | ||
216 | * Takes the lock in write mode. | ||
217 | * Returns: | ||
218 | * -ERESTARTSYS If interrupted by a signal and interruptible is true. | ||
219 | */ | ||
220 | extern int ttm_write_lock(struct ttm_lock *lock, bool interruptible); | ||
221 | |||
222 | /** | ||
223 | * ttm_lock_set_kill | ||
224 | * | ||
225 | * @lock: Pointer to a struct ttm_lock | ||
226 | * @val: Boolean whether to kill processes taking the lock. | ||
227 | * @signal: Signal to send to the process taking the lock. | ||
228 | * | ||
229 | * The kill-when-taking-lock functionality is used to kill processes that keep | ||
230 | * on using the TTM functionality when its resources has been taken down, for | ||
231 | * example when the X server exits. A typical sequence would look like this: | ||
232 | * - X server takes lock in write mode. | ||
233 | * - ttm_lock_set_kill() is called with @val set to true. | ||
234 | * - As part of X server exit, TTM resources are taken down. | ||
235 | * - X server releases the lock on file release. | ||
236 | * - Another dri client wants to render, takes the lock and is killed. | ||
237 | * | ||
238 | */ | ||
239 | static inline void ttm_lock_set_kill(struct ttm_lock *lock, bool val, | ||
240 | int signal) | ||
241 | { | ||
242 | lock->kill_takers = val; | ||
243 | if (val) | ||
244 | lock->signal = signal; | ||
245 | } | ||
246 | |||
247 | #endif | ||
diff --git a/include/drm/ttm/ttm_memory.h b/include/drm/ttm/ttm_memory.h index 6983a7cf4da4..b199170b3c2c 100644 --- a/include/drm/ttm/ttm_memory.h +++ b/include/drm/ttm/ttm_memory.h | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/wait.h> | 33 | #include <linux/wait.h> |
34 | #include <linux/errno.h> | 34 | #include <linux/errno.h> |
35 | #include <linux/kobject.h> | 35 | #include <linux/kobject.h> |
36 | #include <linux/mm.h> | ||
36 | 37 | ||
37 | /** | 38 | /** |
38 | * struct ttm_mem_shrink - callback to shrink TTM memory usage. | 39 | * struct ttm_mem_shrink - callback to shrink TTM memory usage. |
diff --git a/include/drm/ttm/ttm_object.h b/include/drm/ttm/ttm_object.h new file mode 100644 index 000000000000..703ca4db0a29 --- /dev/null +++ b/include/drm/ttm/ttm_object.h | |||
@@ -0,0 +1,267 @@ | |||
1 | /************************************************************************** | ||
2 | * | ||
3 | * Copyright (c) 2006-2009 VMware, Inc., Palo Alto, CA., USA | ||
4 | * All Rights Reserved. | ||
5 | * | ||
6 | * Permission is hereby granted, free of charge, to any person obtaining a | ||
7 | * copy of this software and associated documentation files (the | ||
8 | * "Software"), to deal in the Software without restriction, including | ||
9 | * without limitation the rights to use, copy, modify, merge, publish, | ||
10 | * distribute, sub license, and/or sell copies of the Software, and to | ||
11 | * permit persons to whom the Software is furnished to do so, subject to | ||
12 | * the following conditions: | ||
13 | * | ||
14 | * The above copyright notice and this permission notice (including the | ||
15 | * next paragraph) shall be included in all copies or substantial portions | ||
16 | * of the Software. | ||
17 | * | ||
18 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
19 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
20 | * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL | ||
21 | * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, | ||
22 | * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR | ||
23 | * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE | ||
24 | * USE OR OTHER DEALINGS IN THE SOFTWARE. | ||
25 | * | ||
26 | **************************************************************************/ | ||
27 | /* | ||
28 | * Authors: Thomas Hellstrom <thellstrom-at-vmware-dot-com> | ||
29 | */ | ||
30 | /** @file ttm_object.h | ||
31 | * | ||
32 | * Base- and reference object implementation for the various | ||
33 | * ttm objects. Implements reference counting, minimal security checks | ||
34 | * and release on file close. | ||
35 | */ | ||
36 | |||
37 | #ifndef _TTM_OBJECT_H_ | ||
38 | #define _TTM_OBJECT_H_ | ||
39 | |||
40 | #include <linux/list.h> | ||
41 | #include "drm_hashtab.h" | ||
42 | #include <linux/kref.h> | ||
43 | #include <ttm/ttm_memory.h> | ||
44 | |||
45 | /** | ||
46 | * enum ttm_ref_type | ||
47 | * | ||
48 | * Describes what type of reference a ref object holds. | ||
49 | * | ||
50 | * TTM_REF_USAGE is a simple refcount on a base object. | ||
51 | * | ||
52 | * TTM_REF_SYNCCPU_READ is a SYNCCPU_READ reference on a | ||
53 | * buffer object. | ||
54 | * | ||
55 | * TTM_REF_SYNCCPU_WRITE is a SYNCCPU_WRITE reference on a | ||
56 | * buffer object. | ||
57 | * | ||
58 | */ | ||
59 | |||
60 | enum ttm_ref_type { | ||
61 | TTM_REF_USAGE, | ||
62 | TTM_REF_SYNCCPU_READ, | ||
63 | TTM_REF_SYNCCPU_WRITE, | ||
64 | TTM_REF_NUM | ||
65 | }; | ||
66 | |||
67 | /** | ||
68 | * enum ttm_object_type | ||
69 | * | ||
70 | * One entry per ttm object type. | ||
71 | * Device-specific types should use the | ||
72 | * ttm_driver_typex types. | ||
73 | */ | ||
74 | |||
75 | enum ttm_object_type { | ||
76 | ttm_fence_type, | ||
77 | ttm_buffer_type, | ||
78 | ttm_lock_type, | ||
79 | ttm_driver_type0 = 256, | ||
80 | ttm_driver_type1 | ||
81 | }; | ||
82 | |||
83 | struct ttm_object_file; | ||
84 | struct ttm_object_device; | ||
85 | |||
86 | /** | ||
87 | * struct ttm_base_object | ||
88 | * | ||
89 | * @hash: hash entry for the per-device object hash. | ||
90 | * @type: derived type this object is base class for. | ||
91 | * @shareable: Other ttm_object_files can access this object. | ||
92 | * | ||
93 | * @tfile: Pointer to ttm_object_file of the creator. | ||
94 | * NULL if the object was not created by a user request. | ||
95 | * (kernel object). | ||
96 | * | ||
97 | * @refcount: Number of references to this object, not | ||
98 | * including the hash entry. A reference to a base object can | ||
99 | * only be held by a ref object. | ||
100 | * | ||
101 | * @refcount_release: A function to be called when there are | ||
102 | * no more references to this object. This function should | ||
103 | * destroy the object (or make sure destruction eventually happens), | ||
104 | * and when it is called, the object has | ||
105 | * already been taken out of the per-device hash. The parameter | ||
106 | * "base" should be set to NULL by the function. | ||
107 | * | ||
108 | * @ref_obj_release: A function to be called when a reference object | ||
109 | * with another ttm_ref_type than TTM_REF_USAGE is deleted. | ||
110 | * this function may, for example, release a lock held by a user-space | ||
111 | * process. | ||
112 | * | ||
113 | * This struct is intended to be used as a base struct for objects that | ||
114 | * are visible to user-space. It provides a global name, race-safe | ||
115 | * access and refcounting, minimal access contol and hooks for unref actions. | ||
116 | */ | ||
117 | |||
118 | struct ttm_base_object { | ||
119 | struct drm_hash_item hash; | ||
120 | enum ttm_object_type object_type; | ||
121 | bool shareable; | ||
122 | struct ttm_object_file *tfile; | ||
123 | struct kref refcount; | ||
124 | void (*refcount_release) (struct ttm_base_object **base); | ||
125 | void (*ref_obj_release) (struct ttm_base_object *base, | ||
126 | enum ttm_ref_type ref_type); | ||
127 | }; | ||
128 | |||
129 | /** | ||
130 | * ttm_base_object_init | ||
131 | * | ||
132 | * @tfile: Pointer to a struct ttm_object_file. | ||
133 | * @base: The struct ttm_base_object to initialize. | ||
134 | * @shareable: This object is shareable with other applcations. | ||
135 | * (different @tfile pointers.) | ||
136 | * @type: The object type. | ||
137 | * @refcount_release: See the struct ttm_base_object description. | ||
138 | * @ref_obj_release: See the struct ttm_base_object description. | ||
139 | * | ||
140 | * Initializes a struct ttm_base_object. | ||
141 | */ | ||
142 | |||
143 | extern int ttm_base_object_init(struct ttm_object_file *tfile, | ||
144 | struct ttm_base_object *base, | ||
145 | bool shareable, | ||
146 | enum ttm_object_type type, | ||
147 | void (*refcount_release) (struct ttm_base_object | ||
148 | **), | ||
149 | void (*ref_obj_release) (struct ttm_base_object | ||
150 | *, | ||
151 | enum ttm_ref_type | ||
152 | ref_type)); | ||
153 | |||
154 | /** | ||
155 | * ttm_base_object_lookup | ||
156 | * | ||
157 | * @tfile: Pointer to a struct ttm_object_file. | ||
158 | * @key: Hash key | ||
159 | * | ||
160 | * Looks up a struct ttm_base_object with the key @key. | ||
161 | * Also verifies that the object is visible to the application, by | ||
162 | * comparing the @tfile argument and checking the object shareable flag. | ||
163 | */ | ||
164 | |||
165 | extern struct ttm_base_object *ttm_base_object_lookup(struct ttm_object_file | ||
166 | *tfile, uint32_t key); | ||
167 | |||
168 | /** | ||
169 | * ttm_base_object_unref | ||
170 | * | ||
171 | * @p_base: Pointer to a pointer referncing a struct ttm_base_object. | ||
172 | * | ||
173 | * Decrements the base object refcount and clears the pointer pointed to by | ||
174 | * p_base. | ||
175 | */ | ||
176 | |||
177 | extern void ttm_base_object_unref(struct ttm_base_object **p_base); | ||
178 | |||
179 | /** | ||
180 | * ttm_ref_object_add. | ||
181 | * | ||
182 | * @tfile: A struct ttm_object_file representing the application owning the | ||
183 | * ref_object. | ||
184 | * @base: The base object to reference. | ||
185 | * @ref_type: The type of reference. | ||
186 | * @existed: Upon completion, indicates that an identical reference object | ||
187 | * already existed, and the refcount was upped on that object instead. | ||
188 | * | ||
189 | * Adding a ref object to a base object is basically like referencing the | ||
190 | * base object, but a user-space application holds the reference. When the | ||
191 | * file corresponding to @tfile is closed, all its reference objects are | ||
192 | * deleted. A reference object can have different types depending on what | ||
193 | * it's intended for. It can be refcounting to prevent object destruction, | ||
194 | * When user-space takes a lock, it can add a ref object to that lock to | ||
195 | * make sure the lock is released if the application dies. A ref object | ||
196 | * will hold a single reference on a base object. | ||
197 | */ | ||
198 | extern int ttm_ref_object_add(struct ttm_object_file *tfile, | ||
199 | struct ttm_base_object *base, | ||
200 | enum ttm_ref_type ref_type, bool *existed); | ||
201 | /** | ||
202 | * ttm_ref_object_base_unref | ||
203 | * | ||
204 | * @key: Key representing the base object. | ||
205 | * @ref_type: Ref type of the ref object to be dereferenced. | ||
206 | * | ||
207 | * Unreference a ref object with type @ref_type | ||
208 | * on the base object identified by @key. If there are no duplicate | ||
209 | * references, the ref object will be destroyed and the base object | ||
210 | * will be unreferenced. | ||
211 | */ | ||
212 | extern int ttm_ref_object_base_unref(struct ttm_object_file *tfile, | ||
213 | unsigned long key, | ||
214 | enum ttm_ref_type ref_type); | ||
215 | |||
216 | /** | ||
217 | * ttm_object_file_init - initialize a struct ttm_object file | ||
218 | * | ||
219 | * @tdev: A struct ttm_object device this file is initialized on. | ||
220 | * @hash_order: Order of the hash table used to hold the reference objects. | ||
221 | * | ||
222 | * This is typically called by the file_ops::open function. | ||
223 | */ | ||
224 | |||
225 | extern struct ttm_object_file *ttm_object_file_init(struct ttm_object_device | ||
226 | *tdev, | ||
227 | unsigned int hash_order); | ||
228 | |||
229 | /** | ||
230 | * ttm_object_file_release - release data held by a ttm_object_file | ||
231 | * | ||
232 | * @p_tfile: Pointer to pointer to the ttm_object_file object to release. | ||
233 | * *p_tfile will be set to NULL by this function. | ||
234 | * | ||
235 | * Releases all data associated by a ttm_object_file. | ||
236 | * Typically called from file_ops::release. The caller must | ||
237 | * ensure that there are no concurrent users of tfile. | ||
238 | */ | ||
239 | |||
240 | extern void ttm_object_file_release(struct ttm_object_file **p_tfile); | ||
241 | |||
242 | /** | ||
243 | * ttm_object device init - initialize a struct ttm_object_device | ||
244 | * | ||
245 | * @hash_order: Order of hash table used to hash the base objects. | ||
246 | * | ||
247 | * This function is typically called on device initialization to prepare | ||
248 | * data structures needed for ttm base and ref objects. | ||
249 | */ | ||
250 | |||
251 | extern struct ttm_object_device *ttm_object_device_init | ||
252 | (struct ttm_mem_global *mem_glob, unsigned int hash_order); | ||
253 | |||
254 | /** | ||
255 | * ttm_object_device_release - release data held by a ttm_object_device | ||
256 | * | ||
257 | * @p_tdev: Pointer to pointer to the ttm_object_device object to release. | ||
258 | * *p_tdev will be set to NULL by this function. | ||
259 | * | ||
260 | * Releases all data associated by a ttm_object_device. | ||
261 | * Typically called from driver::unload before the destruction of the | ||
262 | * device private data structure. | ||
263 | */ | ||
264 | |||
265 | extern void ttm_object_device_release(struct ttm_object_device **p_tdev); | ||
266 | |||
267 | #endif | ||
diff --git a/include/drm/via_drm.h b/include/drm/via_drm.h index 170786e5c2ff..fd11a5bd892d 100644 --- a/include/drm/via_drm.h +++ b/include/drm/via_drm.h | |||
@@ -24,7 +24,7 @@ | |||
24 | #ifndef _VIA_DRM_H_ | 24 | #ifndef _VIA_DRM_H_ |
25 | #define _VIA_DRM_H_ | 25 | #define _VIA_DRM_H_ |
26 | 26 | ||
27 | #include <linux/types.h> | 27 | #include "drm.h" |
28 | 28 | ||
29 | /* WARNING: These defines must be the same as what the Xserver uses. | 29 | /* WARNING: These defines must be the same as what the Xserver uses. |
30 | * if you change them, you must change the defines in the Xserver. | 30 | * if you change them, you must change the defines in the Xserver. |
diff --git a/include/linux/Kbuild b/include/linux/Kbuild index 1feed71551c9..5a5385749e16 100644 --- a/include/linux/Kbuild +++ b/include/linux/Kbuild | |||
@@ -330,6 +330,7 @@ unifdef-y += scc.h | |||
330 | unifdef-y += sched.h | 330 | unifdef-y += sched.h |
331 | unifdef-y += screen_info.h | 331 | unifdef-y += screen_info.h |
332 | unifdef-y += sdla.h | 332 | unifdef-y += sdla.h |
333 | unifdef-y += securebits.h | ||
333 | unifdef-y += selinux_netlink.h | 334 | unifdef-y += selinux_netlink.h |
334 | unifdef-y += sem.h | 335 | unifdef-y += sem.h |
335 | unifdef-y += serial_core.h | 336 | unifdef-y += serial_core.h |
diff --git a/include/linux/ata.h b/include/linux/ata.h index 4fb357312b3b..38a6948ce0c2 100644 --- a/include/linux/ata.h +++ b/include/linux/ata.h | |||
@@ -75,6 +75,7 @@ enum { | |||
75 | ATA_ID_EIDE_DMA_TIME = 66, | 75 | ATA_ID_EIDE_DMA_TIME = 66, |
76 | ATA_ID_EIDE_PIO = 67, | 76 | ATA_ID_EIDE_PIO = 67, |
77 | ATA_ID_EIDE_PIO_IORDY = 68, | 77 | ATA_ID_EIDE_PIO_IORDY = 68, |
78 | ATA_ID_ADDITIONAL_SUPP = 69, | ||
78 | ATA_ID_QUEUE_DEPTH = 75, | 79 | ATA_ID_QUEUE_DEPTH = 75, |
79 | ATA_ID_MAJOR_VER = 80, | 80 | ATA_ID_MAJOR_VER = 80, |
80 | ATA_ID_COMMAND_SET_1 = 82, | 81 | ATA_ID_COMMAND_SET_1 = 82, |
@@ -87,6 +88,7 @@ enum { | |||
87 | ATA_ID_HW_CONFIG = 93, | 88 | ATA_ID_HW_CONFIG = 93, |
88 | ATA_ID_SPG = 98, | 89 | ATA_ID_SPG = 98, |
89 | ATA_ID_LBA_CAPACITY_2 = 100, | 90 | ATA_ID_LBA_CAPACITY_2 = 100, |
91 | ATA_ID_SECTOR_SIZE = 106, | ||
90 | ATA_ID_LAST_LUN = 126, | 92 | ATA_ID_LAST_LUN = 126, |
91 | ATA_ID_DLF = 128, | 93 | ATA_ID_DLF = 128, |
92 | ATA_ID_CSFO = 129, | 94 | ATA_ID_CSFO = 129, |
@@ -638,6 +640,18 @@ static inline int ata_id_flush_ext_enabled(const u16 *id) | |||
638 | return (id[ATA_ID_CFS_ENABLE_2] & 0x2400) == 0x2400; | 640 | return (id[ATA_ID_CFS_ENABLE_2] & 0x2400) == 0x2400; |
639 | } | 641 | } |
640 | 642 | ||
643 | static inline int ata_id_has_large_logical_sectors(const u16 *id) | ||
644 | { | ||
645 | if ((id[ATA_ID_SECTOR_SIZE] & 0xc000) != 0x4000) | ||
646 | return 0; | ||
647 | return id[ATA_ID_SECTOR_SIZE] & (1 << 13); | ||
648 | } | ||
649 | |||
650 | static inline u8 ata_id_logical_per_physical_sectors(const u16 *id) | ||
651 | { | ||
652 | return id[ATA_ID_SECTOR_SIZE] & 0xf; | ||
653 | } | ||
654 | |||
641 | static inline int ata_id_has_lba48(const u16 *id) | 655 | static inline int ata_id_has_lba48(const u16 *id) |
642 | { | 656 | { |
643 | if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) | 657 | if ((id[ATA_ID_COMMAND_SET_2] & 0xC000) != 0x4000) |
@@ -803,6 +817,16 @@ static inline int ata_id_has_trim(const u16 *id) | |||
803 | return 0; | 817 | return 0; |
804 | } | 818 | } |
805 | 819 | ||
820 | static inline int ata_id_has_zero_after_trim(const u16 *id) | ||
821 | { | ||
822 | /* DSM supported, deterministic read, and read zero after trim set */ | ||
823 | if (ata_id_has_trim(id) && | ||
824 | (id[ATA_ID_ADDITIONAL_SUPP] & 0x4020) == 0x4020) | ||
825 | return 1; | ||
826 | |||
827 | return 0; | ||
828 | } | ||
829 | |||
806 | static inline int ata_id_current_chs_valid(const u16 *id) | 830 | static inline int ata_id_current_chs_valid(const u16 *id) |
807 | { | 831 | { |
808 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command | 832 | /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command |
@@ -958,17 +982,17 @@ static inline void ata_id_to_hd_driveid(u16 *id) | |||
958 | } | 982 | } |
959 | 983 | ||
960 | /* | 984 | /* |
961 | * Write up to 'max' LBA Range Entries to the buffer that will cover the | 985 | * Write LBA Range Entries to the buffer that will cover the extent from |
962 | * extent from sector to sector + count. This is used for TRIM and for | 986 | * sector to sector + count. This is used for TRIM and for ADD LBA(S) |
963 | * ADD LBA(S) TO NV CACHE PINNED SET. | 987 | * TO NV CACHE PINNED SET. |
964 | */ | 988 | */ |
965 | static inline unsigned ata_set_lba_range_entries(void *_buffer, unsigned max, | 989 | static inline unsigned ata_set_lba_range_entries(void *_buffer, |
966 | u64 sector, unsigned long count) | 990 | unsigned buf_size, u64 sector, unsigned long count) |
967 | { | 991 | { |
968 | __le64 *buffer = _buffer; | 992 | __le64 *buffer = _buffer; |
969 | unsigned i = 0; | 993 | unsigned i = 0, used_bytes; |
970 | 994 | ||
971 | while (i < max) { | 995 | while (i < buf_size / 8 ) { /* 6-byte LBA + 2-byte range per entry */ |
972 | u64 entry = sector | | 996 | u64 entry = sector | |
973 | ((u64)(count > 0xffff ? 0xffff : count) << 48); | 997 | ((u64)(count > 0xffff ? 0xffff : count) << 48); |
974 | buffer[i++] = __cpu_to_le64(entry); | 998 | buffer[i++] = __cpu_to_le64(entry); |
@@ -978,9 +1002,9 @@ static inline unsigned ata_set_lba_range_entries(void *_buffer, unsigned max, | |||
978 | sector += 0xffff; | 1002 | sector += 0xffff; |
979 | } | 1003 | } |
980 | 1004 | ||
981 | max = ALIGN(i * 8, 512); | 1005 | used_bytes = ALIGN(i * 8, 512); |
982 | memset(buffer + i, 0, max - i * 8); | 1006 | memset(buffer + i, 0, used_bytes - i * 8); |
983 | return max; | 1007 | return used_bytes; |
984 | } | 1008 | } |
985 | 1009 | ||
986 | static inline int is_multi_taskfile(struct ata_taskfile *tf) | 1010 | static inline int is_multi_taskfile(struct ata_taskfile *tf) |
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h index b449e738533a..fcbc26af00e4 100644 --- a/include/linux/backing-dev.h +++ b/include/linux/backing-dev.h | |||
@@ -331,4 +331,17 @@ static inline int bdi_sched_wait(void *word) | |||
331 | return 0; | 331 | return 0; |
332 | } | 332 | } |
333 | 333 | ||
334 | static inline void blk_run_backing_dev(struct backing_dev_info *bdi, | ||
335 | struct page *page) | ||
336 | { | ||
337 | if (bdi && bdi->unplug_io_fn) | ||
338 | bdi->unplug_io_fn(bdi, page); | ||
339 | } | ||
340 | |||
341 | static inline void blk_run_address_space(struct address_space *mapping) | ||
342 | { | ||
343 | if (mapping) | ||
344 | blk_run_backing_dev(mapping->backing_dev_info, NULL); | ||
345 | } | ||
346 | |||
334 | #endif /* _LINUX_BACKING_DEV_H */ | 347 | #endif /* _LINUX_BACKING_DEV_H */ |
diff --git a/include/linux/bio.h b/include/linux/bio.h index 5be93f18d842..7fc5606e6ea5 100644 --- a/include/linux/bio.h +++ b/include/linux/bio.h | |||
@@ -391,6 +391,18 @@ extern struct bio *bio_copy_kern(struct request_queue *, void *, unsigned int, | |||
391 | gfp_t, int); | 391 | gfp_t, int); |
392 | extern void bio_set_pages_dirty(struct bio *bio); | 392 | extern void bio_set_pages_dirty(struct bio *bio); |
393 | extern void bio_check_pages_dirty(struct bio *bio); | 393 | extern void bio_check_pages_dirty(struct bio *bio); |
394 | |||
395 | #ifndef ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE | ||
396 | # error "You should define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE for your platform" | ||
397 | #endif | ||
398 | #if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE | ||
399 | extern void bio_flush_dcache_pages(struct bio *bi); | ||
400 | #else | ||
401 | static inline void bio_flush_dcache_pages(struct bio *bi) | ||
402 | { | ||
403 | } | ||
404 | #endif | ||
405 | |||
394 | extern struct bio *bio_copy_user(struct request_queue *, struct rq_map_data *, | 406 | extern struct bio *bio_copy_user(struct request_queue *, struct rq_map_data *, |
395 | unsigned long, unsigned int, int, gfp_t); | 407 | unsigned long, unsigned int, int, gfp_t); |
396 | extern struct bio *bio_copy_user_iov(struct request_queue *, | 408 | extern struct bio *bio_copy_user_iov(struct request_queue *, |
@@ -450,11 +462,8 @@ extern struct biovec_slab bvec_slabs[BIOVEC_NR_POOLS] __read_mostly; | |||
450 | /* | 462 | /* |
451 | * remember never ever reenable interrupts between a bvec_kmap_irq and | 463 | * remember never ever reenable interrupts between a bvec_kmap_irq and |
452 | * bvec_kunmap_irq! | 464 | * bvec_kunmap_irq! |
453 | * | ||
454 | * This function MUST be inlined - it plays with the CPU interrupt flags. | ||
455 | */ | 465 | */ |
456 | static __always_inline char *bvec_kmap_irq(struct bio_vec *bvec, | 466 | static inline char *bvec_kmap_irq(struct bio_vec *bvec, unsigned long *flags) |
457 | unsigned long *flags) | ||
458 | { | 467 | { |
459 | unsigned long addr; | 468 | unsigned long addr; |
460 | 469 | ||
@@ -470,8 +479,7 @@ static __always_inline char *bvec_kmap_irq(struct bio_vec *bvec, | |||
470 | return (char *) addr + bvec->bv_offset; | 479 | return (char *) addr + bvec->bv_offset; |
471 | } | 480 | } |
472 | 481 | ||
473 | static __always_inline void bvec_kunmap_irq(char *buffer, | 482 | static inline void bvec_kunmap_irq(char *buffer, unsigned long *flags) |
474 | unsigned long *flags) | ||
475 | { | 483 | { |
476 | unsigned long ptr = (unsigned long) buffer & PAGE_MASK; | 484 | unsigned long ptr = (unsigned long) buffer & PAGE_MASK; |
477 | 485 | ||
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 221cecd86bd3..784a919aa0d0 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h | |||
@@ -312,13 +312,17 @@ struct queue_limits { | |||
312 | unsigned int io_min; | 312 | unsigned int io_min; |
313 | unsigned int io_opt; | 313 | unsigned int io_opt; |
314 | unsigned int max_discard_sectors; | 314 | unsigned int max_discard_sectors; |
315 | unsigned int discard_granularity; | ||
316 | unsigned int discard_alignment; | ||
315 | 317 | ||
316 | unsigned short logical_block_size; | 318 | unsigned short logical_block_size; |
317 | unsigned short max_hw_segments; | 319 | unsigned short max_hw_segments; |
318 | unsigned short max_phys_segments; | 320 | unsigned short max_phys_segments; |
319 | 321 | ||
320 | unsigned char misaligned; | 322 | unsigned char misaligned; |
323 | unsigned char discard_misaligned; | ||
321 | unsigned char no_cluster; | 324 | unsigned char no_cluster; |
325 | signed char discard_zeroes_data; | ||
322 | }; | 326 | }; |
323 | 327 | ||
324 | struct request_queue | 328 | struct request_queue |
@@ -749,6 +753,17 @@ struct req_iterator { | |||
749 | #define rq_iter_last(rq, _iter) \ | 753 | #define rq_iter_last(rq, _iter) \ |
750 | (_iter.bio->bi_next == NULL && _iter.i == _iter.bio->bi_vcnt-1) | 754 | (_iter.bio->bi_next == NULL && _iter.i == _iter.bio->bi_vcnt-1) |
751 | 755 | ||
756 | #ifndef ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE | ||
757 | # error "You should define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE for your platform" | ||
758 | #endif | ||
759 | #if ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE | ||
760 | extern void rq_flush_dcache_pages(struct request *rq); | ||
761 | #else | ||
762 | static inline void rq_flush_dcache_pages(struct request *rq) | ||
763 | { | ||
764 | } | ||
765 | #endif | ||
766 | |||
752 | extern int blk_register_queue(struct gendisk *disk); | 767 | extern int blk_register_queue(struct gendisk *disk); |
753 | extern void blk_unregister_queue(struct gendisk *disk); | 768 | extern void blk_unregister_queue(struct gendisk *disk); |
754 | extern void register_disk(struct gendisk *dev); | 769 | extern void register_disk(struct gendisk *dev); |
@@ -823,19 +838,6 @@ static inline struct request_queue *bdev_get_queue(struct block_device *bdev) | |||
823 | return bdev->bd_disk->queue; | 838 | return bdev->bd_disk->queue; |
824 | } | 839 | } |
825 | 840 | ||
826 | static inline void blk_run_backing_dev(struct backing_dev_info *bdi, | ||
827 | struct page *page) | ||
828 | { | ||
829 | if (bdi && bdi->unplug_io_fn) | ||
830 | bdi->unplug_io_fn(bdi, page); | ||
831 | } | ||
832 | |||
833 | static inline void blk_run_address_space(struct address_space *mapping) | ||
834 | { | ||
835 | if (mapping) | ||
836 | blk_run_backing_dev(mapping->backing_dev_info, NULL); | ||
837 | } | ||
838 | |||
839 | /* | 841 | /* |
840 | * blk_rq_pos() : the current sector | 842 | * blk_rq_pos() : the current sector |
841 | * blk_rq_bytes() : bytes left in the entire request | 843 | * blk_rq_bytes() : bytes left in the entire request |
@@ -1134,6 +1136,34 @@ static inline int bdev_alignment_offset(struct block_device *bdev) | |||
1134 | return q->limits.alignment_offset; | 1136 | return q->limits.alignment_offset; |
1135 | } | 1137 | } |
1136 | 1138 | ||
1139 | static inline int queue_discard_alignment(struct request_queue *q) | ||
1140 | { | ||
1141 | if (q->limits.discard_misaligned) | ||
1142 | return -1; | ||
1143 | |||
1144 | return q->limits.discard_alignment; | ||
1145 | } | ||
1146 | |||
1147 | static inline int queue_sector_discard_alignment(struct request_queue *q, | ||
1148 | sector_t sector) | ||
1149 | { | ||
1150 | return ((sector << 9) - q->limits.discard_alignment) | ||
1151 | & (q->limits.discard_granularity - 1); | ||
1152 | } | ||
1153 | |||
1154 | static inline unsigned int queue_discard_zeroes_data(struct request_queue *q) | ||
1155 | { | ||
1156 | if (q->limits.discard_zeroes_data == 1) | ||
1157 | return 1; | ||
1158 | |||
1159 | return 0; | ||
1160 | } | ||
1161 | |||
1162 | static inline unsigned int bdev_discard_zeroes_data(struct block_device *bdev) | ||
1163 | { | ||
1164 | return queue_discard_zeroes_data(bdev_get_queue(bdev)); | ||
1165 | } | ||
1166 | |||
1137 | static inline int queue_dma_alignment(struct request_queue *q) | 1167 | static inline int queue_dma_alignment(struct request_queue *q) |
1138 | { | 1168 | { |
1139 | return q ? q->dma_alignment : 511; | 1169 | return q ? q->dma_alignment : 511; |
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index dd97fb8408a8..b10ec49ee2dd 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -53,6 +53,7 @@ extern void free_bootmem_node(pg_data_t *pgdat, | |||
53 | unsigned long addr, | 53 | unsigned long addr, |
54 | unsigned long size); | 54 | unsigned long size); |
55 | extern void free_bootmem(unsigned long addr, unsigned long size); | 55 | extern void free_bootmem(unsigned long addr, unsigned long size); |
56 | extern void free_bootmem_late(unsigned long addr, unsigned long size); | ||
56 | 57 | ||
57 | /* | 58 | /* |
58 | * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, | 59 | * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, |
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h index 9b64b6d67873..2b31b91f5871 100644 --- a/include/linux/brcmphy.h +++ b/include/linux/brcmphy.h | |||
@@ -1,6 +1,13 @@ | |||
1 | #define PHY_BRCM_WIRESPEED_ENABLE 0x00000001 | 1 | #define PHY_BCM_FLAGS_MODE_COPPER 0x00000001 |
2 | #define PHY_BRCM_AUTO_PWRDWN_ENABLE 0x00000002 | 2 | #define PHY_BCM_FLAGS_MODE_1000BX 0x00000002 |
3 | #define PHY_BRCM_APD_CLK125_ENABLE 0x00000004 | 3 | #define PHY_BCM_FLAGS_INTF_SGMII 0x00000010 |
4 | #define PHY_BRCM_STD_IBND_DISABLE 0x00000008 | 4 | #define PHY_BCM_FLAGS_INTF_XAUI 0x00000020 |
5 | #define PHY_BRCM_EXT_IBND_RX_ENABLE 0x00000010 | 5 | #define PHY_BRCM_WIRESPEED_ENABLE 0x00000100 |
6 | #define PHY_BRCM_EXT_IBND_TX_ENABLE 0x00000020 | 6 | #define PHY_BRCM_AUTO_PWRDWN_ENABLE 0x00000200 |
7 | #define PHY_BRCM_RX_REFCLK_UNUSED 0x00000400 | ||
8 | #define PHY_BRCM_STD_IBND_DISABLE 0x00000800 | ||
9 | #define PHY_BRCM_EXT_IBND_RX_ENABLE 0x00001000 | ||
10 | #define PHY_BRCM_EXT_IBND_TX_ENABLE 0x00002000 | ||
11 | #define PHY_BRCM_CLEAR_RGMII_MODE 0x00004000 | ||
12 | #define PHY_BRCM_DIS_TXCRXC_NOENRGY 0x00008000 | ||
13 | #define PHY_BCM_FLAGS_VALID 0x80000000 | ||
diff --git a/include/linux/can/core.h b/include/linux/can/core.h index 25085cbadcfc..6c507bea275f 100644 --- a/include/linux/can/core.h +++ b/include/linux/can/core.h | |||
@@ -32,14 +32,12 @@ | |||
32 | * struct can_proto - CAN protocol structure | 32 | * struct can_proto - CAN protocol structure |
33 | * @type: type argument in socket() syscall, e.g. SOCK_DGRAM. | 33 | * @type: type argument in socket() syscall, e.g. SOCK_DGRAM. |
34 | * @protocol: protocol number in socket() syscall. | 34 | * @protocol: protocol number in socket() syscall. |
35 | * @capability: capability needed to open the socket, or -1 for no restriction. | ||
36 | * @ops: pointer to struct proto_ops for sock->ops. | 35 | * @ops: pointer to struct proto_ops for sock->ops. |
37 | * @prot: pointer to struct proto structure. | 36 | * @prot: pointer to struct proto structure. |
38 | */ | 37 | */ |
39 | struct can_proto { | 38 | struct can_proto { |
40 | int type; | 39 | int type; |
41 | int protocol; | 40 | int protocol; |
42 | int capability; | ||
43 | struct proto_ops *ops; | 41 | struct proto_ops *ops; |
44 | struct proto *prot; | 42 | struct proto *prot; |
45 | }; | 43 | }; |
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h index 5824b20b5fcb..1ed2a5cc03f5 100644 --- a/include/linux/can/dev.h +++ b/include/linux/can/dev.h | |||
@@ -29,8 +29,6 @@ enum can_mode { | |||
29 | /* | 29 | /* |
30 | * CAN common private data | 30 | * CAN common private data |
31 | */ | 31 | */ |
32 | #define CAN_ECHO_SKB_MAX 4 | ||
33 | |||
34 | struct can_priv { | 32 | struct can_priv { |
35 | struct can_device_stats can_stats; | 33 | struct can_device_stats can_stats; |
36 | 34 | ||
@@ -44,15 +42,16 @@ struct can_priv { | |||
44 | int restart_ms; | 42 | int restart_ms; |
45 | struct timer_list restart_timer; | 43 | struct timer_list restart_timer; |
46 | 44 | ||
47 | struct sk_buff *echo_skb[CAN_ECHO_SKB_MAX]; | ||
48 | |||
49 | int (*do_set_bittiming)(struct net_device *dev); | 45 | int (*do_set_bittiming)(struct net_device *dev); |
50 | int (*do_set_mode)(struct net_device *dev, enum can_mode mode); | 46 | int (*do_set_mode)(struct net_device *dev, enum can_mode mode); |
51 | int (*do_get_state)(const struct net_device *dev, | 47 | int (*do_get_state)(const struct net_device *dev, |
52 | enum can_state *state); | 48 | enum can_state *state); |
49 | |||
50 | unsigned int echo_skb_max; | ||
51 | struct sk_buff **echo_skb; | ||
53 | }; | 52 | }; |
54 | 53 | ||
55 | struct net_device *alloc_candev(int sizeof_priv); | 54 | struct net_device *alloc_candev(int sizeof_priv, unsigned int echo_skb_max); |
56 | void free_candev(struct net_device *dev); | 55 | void free_candev(struct net_device *dev); |
57 | 56 | ||
58 | int open_candev(struct net_device *dev); | 57 | int open_candev(struct net_device *dev); |
@@ -64,8 +63,13 @@ void unregister_candev(struct net_device *dev); | |||
64 | int can_restart_now(struct net_device *dev); | 63 | int can_restart_now(struct net_device *dev); |
65 | void can_bus_off(struct net_device *dev); | 64 | void can_bus_off(struct net_device *dev); |
66 | 65 | ||
67 | void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev, int idx); | 66 | void can_put_echo_skb(struct sk_buff *skb, struct net_device *dev, |
68 | void can_get_echo_skb(struct net_device *dev, int idx); | 67 | unsigned int idx); |
69 | void can_free_echo_skb(struct net_device *dev, int idx); | 68 | void can_get_echo_skb(struct net_device *dev, unsigned int idx); |
69 | void can_free_echo_skb(struct net_device *dev, unsigned int idx); | ||
70 | |||
71 | struct sk_buff *alloc_can_skb(struct net_device *dev, struct can_frame **cf); | ||
72 | struct sk_buff *alloc_can_err_skb(struct net_device *dev, | ||
73 | struct can_frame **cf); | ||
70 | 74 | ||
71 | #endif /* CAN_DEV_H */ | 75 | #endif /* CAN_DEV_H */ |
diff --git a/include/linux/can/platform/mcp251x.h b/include/linux/can/platform/mcp251x.h new file mode 100644 index 000000000000..1448177d86d5 --- /dev/null +++ b/include/linux/can/platform/mcp251x.h | |||
@@ -0,0 +1,36 @@ | |||
1 | #ifndef __CAN_PLATFORM_MCP251X_H__ | ||
2 | #define __CAN_PLATFORM_MCP251X_H__ | ||
3 | |||
4 | /* | ||
5 | * | ||
6 | * CAN bus driver for Microchip 251x CAN Controller with SPI Interface | ||
7 | * | ||
8 | */ | ||
9 | |||
10 | #include <linux/spi/spi.h> | ||
11 | |||
12 | /** | ||
13 | * struct mcp251x_platform_data - MCP251X SPI CAN controller platform data | ||
14 | * @oscillator_frequency: - oscillator frequency in Hz | ||
15 | * @model: - actual type of chip | ||
16 | * @board_specific_setup: - called before probing the chip (power,reset) | ||
17 | * @transceiver_enable: - called to power on/off the transceiver | ||
18 | * @power_enable: - called to power on/off the mcp *and* the | ||
19 | * transceiver | ||
20 | * | ||
21 | * Please note that you should define power_enable or transceiver_enable or | ||
22 | * none of them. Defining both of them is no use. | ||
23 | * | ||
24 | */ | ||
25 | |||
26 | struct mcp251x_platform_data { | ||
27 | unsigned long oscillator_frequency; | ||
28 | int model; | ||
29 | #define CAN_MCP251X_MCP2510 0 | ||
30 | #define CAN_MCP251X_MCP2515 1 | ||
31 | int (*board_specific_setup)(struct spi_device *spi); | ||
32 | int (*transceiver_enable)(int enable); | ||
33 | int (*power_enable) (int enable); | ||
34 | }; | ||
35 | |||
36 | #endif /* __CAN_PLATFORM_MCP251X_H__ */ | ||
diff --git a/include/linux/can/platform/ti_hecc.h b/include/linux/can/platform/ti_hecc.h new file mode 100644 index 000000000000..4688c7bb1bd1 --- /dev/null +++ b/include/linux/can/platform/ti_hecc.h | |||
@@ -0,0 +1,40 @@ | |||
1 | /* | ||
2 | * TI HECC (High End CAN Controller) driver platform header | ||
3 | * | ||
4 | * Copyright (C) 2009 Texas Instruments Incorporated - http://www.ti.com/ | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or | ||
7 | * modify it under the terms of the GNU General Public License as | ||
8 | * published by the Free Software Foundation version 2. | ||
9 | * | ||
10 | * This program is distributed as is WITHOUT ANY WARRANTY of any | ||
11 | * kind, whether express or implied; without even the implied warranty | ||
12 | * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
13 | * GNU General Public License for more details. | ||
14 | * | ||
15 | */ | ||
16 | |||
17 | /** | ||
18 | * struct hecc_platform_data - HECC Platform Data | ||
19 | * | ||
20 | * @scc_hecc_offset: mostly 0 - should really never change | ||
21 | * @scc_ram_offset: SCC RAM offset | ||
22 | * @hecc_ram_offset: HECC RAM offset | ||
23 | * @mbx_offset: Mailbox RAM offset | ||
24 | * @int_line: Interrupt line to use - 0 or 1 | ||
25 | * @version: version for future use | ||
26 | * | ||
27 | * Platform data structure to get all platform specific settings. | ||
28 | * this structure also accounts the fact that the IP may have different | ||
29 | * RAM and mailbox offsets for different SOC's | ||
30 | */ | ||
31 | struct ti_hecc_platform_data { | ||
32 | u32 scc_hecc_offset; | ||
33 | u32 scc_ram_offset; | ||
34 | u32 hecc_ram_offset; | ||
35 | u32 mbx_offset; | ||
36 | u32 int_line; | ||
37 | u32 version; | ||
38 | }; | ||
39 | |||
40 | |||
diff --git a/include/linux/capability.h b/include/linux/capability.h index c8f2a5f70ed5..39e5ff512fbe 100644 --- a/include/linux/capability.h +++ b/include/linux/capability.h | |||
@@ -92,9 +92,7 @@ struct vfs_cap_data { | |||
92 | #define _KERNEL_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_3 | 92 | #define _KERNEL_CAPABILITY_VERSION _LINUX_CAPABILITY_VERSION_3 |
93 | #define _KERNEL_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_3 | 93 | #define _KERNEL_CAPABILITY_U32S _LINUX_CAPABILITY_U32S_3 |
94 | 94 | ||
95 | #ifdef CONFIG_SECURITY_FILE_CAPABILITIES | ||
96 | extern int file_caps_enabled; | 95 | extern int file_caps_enabled; |
97 | #endif | ||
98 | 96 | ||
99 | typedef struct kernel_cap_struct { | 97 | typedef struct kernel_cap_struct { |
100 | __u32 cap[_KERNEL_CAPABILITY_U32S]; | 98 | __u32 cap[_KERNEL_CAPABILITY_U32S]; |
diff --git a/include/linux/cciss_ioctl.h b/include/linux/cciss_ioctl.h index cb57c30081a8..eb130b4d8e72 100644 --- a/include/linux/cciss_ioctl.h +++ b/include/linux/cciss_ioctl.h | |||
@@ -39,7 +39,7 @@ typedef __u32 DriverVer_type; | |||
39 | #ifndef CCISS_CMD_H | 39 | #ifndef CCISS_CMD_H |
40 | // This defines are duplicated in cciss_cmd.h in the driver directory | 40 | // This defines are duplicated in cciss_cmd.h in the driver directory |
41 | 41 | ||
42 | //general boundary defintions | 42 | //general boundary definitions |
43 | #define SENSEINFOBYTES 32//note that this value may vary between host implementations | 43 | #define SENSEINFOBYTES 32//note that this value may vary between host implementations |
44 | 44 | ||
45 | //Command Status value | 45 | //Command Status value |
diff --git a/include/linux/cgroup_subsys.h b/include/linux/cgroup_subsys.h index 9c8d31bacf46..ccefff02b6cb 100644 --- a/include/linux/cgroup_subsys.h +++ b/include/linux/cgroup_subsys.h | |||
@@ -60,3 +60,9 @@ SUBSYS(net_cls) | |||
60 | #endif | 60 | #endif |
61 | 61 | ||
62 | /* */ | 62 | /* */ |
63 | |||
64 | #ifdef CONFIG_BLK_CGROUP | ||
65 | SUBSYS(blkio) | ||
66 | #endif | ||
67 | |||
68 | /* */ | ||
diff --git a/include/linux/chio.h b/include/linux/chio.h index 519248d8b2b6..d9bac7f97282 100644 --- a/include/linux/chio.h +++ b/include/linux/chio.h | |||
@@ -21,7 +21,7 @@ | |||
21 | * query vendor-specific element types | 21 | * query vendor-specific element types |
22 | * | 22 | * |
23 | * accessing elements works by specifing type and unit of the element. | 23 | * accessing elements works by specifing type and unit of the element. |
24 | * for eample, storage elements are addressed with type = CHET_ST and | 24 | * for example, storage elements are addressed with type = CHET_ST and |
25 | * unit = 0 .. cp_nslots-1 | 25 | * unit = 0 .. cp_nslots-1 |
26 | * | 26 | * |
27 | */ | 27 | */ |
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h index 3a1dbba4d3ae..0cf725bdd2a1 100644 --- a/include/linux/clockchips.h +++ b/include/linux/clockchips.h | |||
@@ -77,10 +77,10 @@ enum clock_event_nofitiers { | |||
77 | struct clock_event_device { | 77 | struct clock_event_device { |
78 | const char *name; | 78 | const char *name; |
79 | unsigned int features; | 79 | unsigned int features; |
80 | unsigned long max_delta_ns; | 80 | u64 max_delta_ns; |
81 | unsigned long min_delta_ns; | 81 | u64 min_delta_ns; |
82 | unsigned long mult; | 82 | u32 mult; |
83 | int shift; | 83 | u32 shift; |
84 | int rating; | 84 | int rating; |
85 | int irq; | 85 | int irq; |
86 | const struct cpumask *cpumask; | 86 | const struct cpumask *cpumask; |
@@ -116,8 +116,8 @@ static inline unsigned long div_sc(unsigned long ticks, unsigned long nsec, | |||
116 | } | 116 | } |
117 | 117 | ||
118 | /* Clock event layer functions */ | 118 | /* Clock event layer functions */ |
119 | extern unsigned long clockevent_delta2ns(unsigned long latch, | 119 | extern u64 clockevent_delta2ns(unsigned long latch, |
120 | struct clock_event_device *evt); | 120 | struct clock_event_device *evt); |
121 | extern void clockevents_register_device(struct clock_event_device *dev); | 121 | extern void clockevents_register_device(struct clock_event_device *dev); |
122 | 122 | ||
123 | extern void clockevents_exchange_device(struct clock_event_device *old, | 123 | extern void clockevents_exchange_device(struct clock_event_device *old, |
@@ -130,6 +130,13 @@ extern int clockevents_program_event(struct clock_event_device *dev, | |||
130 | 130 | ||
131 | extern void clockevents_handle_noop(struct clock_event_device *dev); | 131 | extern void clockevents_handle_noop(struct clock_event_device *dev); |
132 | 132 | ||
133 | static inline void | ||
134 | clockevents_calc_mult_shift(struct clock_event_device *ce, u32 freq, u32 minsec) | ||
135 | { | ||
136 | return clocks_calc_mult_shift(&ce->mult, &ce->shift, NSEC_PER_SEC, | ||
137 | freq, minsec); | ||
138 | } | ||
139 | |||
133 | #ifdef CONFIG_GENERIC_CLOCKEVENTS | 140 | #ifdef CONFIG_GENERIC_CLOCKEVENTS |
134 | extern void clockevents_notify(unsigned long reason, void *arg); | 141 | extern void clockevents_notify(unsigned long reason, void *arg); |
135 | #else | 142 | #else |
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h index 83d2fbd81b93..8a4a130cc196 100644 --- a/include/linux/clocksource.h +++ b/include/linux/clocksource.h | |||
@@ -151,6 +151,7 @@ extern u64 timecounter_cyc2time(struct timecounter *tc, | |||
151 | * subtraction of non 64 bit counters | 151 | * subtraction of non 64 bit counters |
152 | * @mult: cycle to nanosecond multiplier | 152 | * @mult: cycle to nanosecond multiplier |
153 | * @shift: cycle to nanosecond divisor (power of two) | 153 | * @shift: cycle to nanosecond divisor (power of two) |
154 | * @max_idle_ns: max idle time permitted by the clocksource (nsecs) | ||
154 | * @flags: flags describing special properties | 155 | * @flags: flags describing special properties |
155 | * @vread: vsyscall based read | 156 | * @vread: vsyscall based read |
156 | * @resume: resume function for the clocksource, if necessary | 157 | * @resume: resume function for the clocksource, if necessary |
@@ -168,6 +169,7 @@ struct clocksource { | |||
168 | cycle_t mask; | 169 | cycle_t mask; |
169 | u32 mult; | 170 | u32 mult; |
170 | u32 shift; | 171 | u32 shift; |
172 | u64 max_idle_ns; | ||
171 | unsigned long flags; | 173 | unsigned long flags; |
172 | cycle_t (*vread)(void); | 174 | cycle_t (*vread)(void); |
173 | void (*resume)(void); | 175 | void (*resume)(void); |
@@ -279,11 +281,23 @@ extern void clocksource_resume(void); | |||
279 | extern struct clocksource * __init __weak clocksource_default_clock(void); | 281 | extern struct clocksource * __init __weak clocksource_default_clock(void); |
280 | extern void clocksource_mark_unstable(struct clocksource *cs); | 282 | extern void clocksource_mark_unstable(struct clocksource *cs); |
281 | 283 | ||
284 | extern void | ||
285 | clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec); | ||
286 | |||
287 | static inline void | ||
288 | clocksource_calc_mult_shift(struct clocksource *cs, u32 freq, u32 minsec) | ||
289 | { | ||
290 | return clocks_calc_mult_shift(&cs->mult, &cs->shift, freq, | ||
291 | NSEC_PER_SEC, minsec); | ||
292 | } | ||
293 | |||
282 | #ifdef CONFIG_GENERIC_TIME_VSYSCALL | 294 | #ifdef CONFIG_GENERIC_TIME_VSYSCALL |
283 | extern void update_vsyscall(struct timespec *ts, struct clocksource *c); | 295 | extern void |
296 | update_vsyscall(struct timespec *ts, struct clocksource *c, u32 mult); | ||
284 | extern void update_vsyscall_tz(void); | 297 | extern void update_vsyscall_tz(void); |
285 | #else | 298 | #else |
286 | static inline void update_vsyscall(struct timespec *ts, struct clocksource *c) | 299 | static inline void |
300 | update_vsyscall(struct timespec *ts, struct clocksource *c, u32 mult) | ||
287 | { | 301 | { |
288 | } | 302 | } |
289 | 303 | ||
diff --git a/include/linux/compat.h b/include/linux/compat.h index af931ee43dd8..ef68119a4fd2 100644 --- a/include/linux/compat.h +++ b/include/linux/compat.h | |||
@@ -10,6 +10,8 @@ | |||
10 | #include <linux/stat.h> | 10 | #include <linux/stat.h> |
11 | #include <linux/param.h> /* for HZ */ | 11 | #include <linux/param.h> /* for HZ */ |
12 | #include <linux/sem.h> | 12 | #include <linux/sem.h> |
13 | #include <linux/socket.h> | ||
14 | #include <linux/if.h> | ||
13 | 15 | ||
14 | #include <asm/compat.h> | 16 | #include <asm/compat.h> |
15 | #include <asm/siginfo.h> | 17 | #include <asm/siginfo.h> |
@@ -154,6 +156,48 @@ typedef struct compat_sigevent { | |||
154 | } _sigev_un; | 156 | } _sigev_un; |
155 | } compat_sigevent_t; | 157 | } compat_sigevent_t; |
156 | 158 | ||
159 | struct compat_ifmap { | ||
160 | compat_ulong_t mem_start; | ||
161 | compat_ulong_t mem_end; | ||
162 | unsigned short base_addr; | ||
163 | unsigned char irq; | ||
164 | unsigned char dma; | ||
165 | unsigned char port; | ||
166 | }; | ||
167 | |||
168 | struct compat_if_settings | ||
169 | { | ||
170 | unsigned int type; /* Type of physical device or protocol */ | ||
171 | unsigned int size; /* Size of the data allocated by the caller */ | ||
172 | compat_uptr_t ifs_ifsu; /* union of pointers */ | ||
173 | }; | ||
174 | |||
175 | struct compat_ifreq { | ||
176 | union { | ||
177 | char ifrn_name[IFNAMSIZ]; /* if name, e.g. "en0" */ | ||
178 | } ifr_ifrn; | ||
179 | union { | ||
180 | struct sockaddr ifru_addr; | ||
181 | struct sockaddr ifru_dstaddr; | ||
182 | struct sockaddr ifru_broadaddr; | ||
183 | struct sockaddr ifru_netmask; | ||
184 | struct sockaddr ifru_hwaddr; | ||
185 | short ifru_flags; | ||
186 | compat_int_t ifru_ivalue; | ||
187 | compat_int_t ifru_mtu; | ||
188 | struct compat_ifmap ifru_map; | ||
189 | char ifru_slave[IFNAMSIZ]; /* Just fits the size */ | ||
190 | char ifru_newname[IFNAMSIZ]; | ||
191 | compat_caddr_t ifru_data; | ||
192 | struct compat_if_settings ifru_settings; | ||
193 | } ifr_ifru; | ||
194 | }; | ||
195 | |||
196 | struct compat_ifconf { | ||
197 | compat_int_t ifc_len; /* size of buffer */ | ||
198 | compat_caddr_t ifcbuf; | ||
199 | }; | ||
200 | |||
157 | struct compat_robust_list { | 201 | struct compat_robust_list { |
158 | compat_uptr_t next; | 202 | compat_uptr_t next; |
159 | }; | 203 | }; |
diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h index a3ed7cb8ca34..73dcf804bc94 100644 --- a/include/linux/compiler-gcc.h +++ b/include/linux/compiler-gcc.h | |||
@@ -79,6 +79,7 @@ | |||
79 | #define noinline __attribute__((noinline)) | 79 | #define noinline __attribute__((noinline)) |
80 | #define __attribute_const__ __attribute__((__const__)) | 80 | #define __attribute_const__ __attribute__((__const__)) |
81 | #define __maybe_unused __attribute__((unused)) | 81 | #define __maybe_unused __attribute__((unused)) |
82 | #define __always_unused __attribute__((unused)) | ||
82 | 83 | ||
83 | #define __gcc_header(x) #x | 84 | #define __gcc_header(x) #x |
84 | #define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h) | 85 | #define _gcc_header(x) __gcc_header(linux/compiler-gcc##x.h) |
diff --git a/include/linux/compiler-gcc4.h b/include/linux/compiler-gcc4.h index 450fa597c94d..94dea3ffbfa1 100644 --- a/include/linux/compiler-gcc4.h +++ b/include/linux/compiler-gcc4.h | |||
@@ -36,4 +36,26 @@ | |||
36 | the kernel context */ | 36 | the kernel context */ |
37 | #define __cold __attribute__((__cold__)) | 37 | #define __cold __attribute__((__cold__)) |
38 | 38 | ||
39 | |||
40 | #if __GNUC_MINOR__ >= 5 | ||
41 | /* | ||
42 | * Mark a position in code as unreachable. This can be used to | ||
43 | * suppress control flow warnings after asm blocks that transfer | ||
44 | * control elsewhere. | ||
45 | * | ||
46 | * Early snapshots of gcc 4.5 don't support this and we can't detect | ||
47 | * this in the preprocessor, but we can live with this because they're | ||
48 | * unreleased. Really, we need to have autoconf for the kernel. | ||
49 | */ | ||
50 | #define unreachable() __builtin_unreachable() | ||
51 | #endif | ||
52 | |||
53 | #endif | ||
54 | |||
55 | #if __GNUC_MINOR__ > 0 | ||
56 | #define __compiletime_object_size(obj) __builtin_object_size(obj, 0) | ||
57 | #endif | ||
58 | #if __GNUC_MINOR__ >= 4 | ||
59 | #define __compiletime_warning(message) __attribute__((warning(message))) | ||
60 | #define __compiletime_error(message) __attribute__((error(message))) | ||
39 | #endif | 61 | #endif |
diff --git a/include/linux/compiler.h b/include/linux/compiler.h index 04fb5135b4e1..5be3dab4a695 100644 --- a/include/linux/compiler.h +++ b/include/linux/compiler.h | |||
@@ -144,6 +144,11 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
144 | # define barrier() __memory_barrier() | 144 | # define barrier() __memory_barrier() |
145 | #endif | 145 | #endif |
146 | 146 | ||
147 | /* Unreachable code */ | ||
148 | #ifndef unreachable | ||
149 | # define unreachable() do { } while (1) | ||
150 | #endif | ||
151 | |||
147 | #ifndef RELOC_HIDE | 152 | #ifndef RELOC_HIDE |
148 | # define RELOC_HIDE(ptr, off) \ | 153 | # define RELOC_HIDE(ptr, off) \ |
149 | ({ unsigned long __ptr; \ | 154 | ({ unsigned long __ptr; \ |
@@ -213,6 +218,10 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
213 | # define __maybe_unused /* unimplemented */ | 218 | # define __maybe_unused /* unimplemented */ |
214 | #endif | 219 | #endif |
215 | 220 | ||
221 | #ifndef __always_unused | ||
222 | # define __always_unused /* unimplemented */ | ||
223 | #endif | ||
224 | |||
216 | #ifndef noinline | 225 | #ifndef noinline |
217 | #define noinline | 226 | #define noinline |
218 | #endif | 227 | #endif |
@@ -266,6 +275,17 @@ void ftrace_likely_update(struct ftrace_branch_data *f, int val, int expect); | |||
266 | # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) | 275 | # define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b)) |
267 | #endif | 276 | #endif |
268 | 277 | ||
278 | /* Compile time object size, -1 for unknown */ | ||
279 | #ifndef __compiletime_object_size | ||
280 | # define __compiletime_object_size(obj) -1 | ||
281 | #endif | ||
282 | #ifndef __compiletime_warning | ||
283 | # define __compiletime_warning(message) | ||
284 | #endif | ||
285 | #ifndef __compiletime_error | ||
286 | # define __compiletime_error(message) | ||
287 | #endif | ||
288 | |||
269 | /* | 289 | /* |
270 | * Prevent the compiler from merging or refetching accesses. The compiler | 290 | * Prevent the compiler from merging or refetching accesses. The compiler |
271 | * is also forbidden from reordering successive instances of ACCESS_ONCE(), | 291 | * is also forbidden from reordering successive instances of ACCESS_ONCE(), |
diff --git a/include/linux/connector.h b/include/linux/connector.h index 3a14615fd35c..72ba63eb83c5 100644 --- a/include/linux/connector.h +++ b/include/linux/connector.h | |||
@@ -43,6 +43,8 @@ | |||
43 | #define CN_DST_VAL 0x1 | 43 | #define CN_DST_VAL 0x1 |
44 | #define CN_IDX_DM 0x7 /* Device Mapper */ | 44 | #define CN_IDX_DM 0x7 /* Device Mapper */ |
45 | #define CN_VAL_DM_USERSPACE_LOG 0x1 | 45 | #define CN_VAL_DM_USERSPACE_LOG 0x1 |
46 | #define CN_IDX_DRBD 0x8 | ||
47 | #define CN_VAL_DRBD 0x1 | ||
46 | 48 | ||
47 | #define CN_NETLINK_USERS 8 | 49 | #define CN_NETLINK_USERS 8 |
48 | 50 | ||
diff --git a/include/linux/crypto.h b/include/linux/crypto.h index fd929889e8dc..24d2e30f1b46 100644 --- a/include/linux/crypto.h +++ b/include/linux/crypto.h | |||
@@ -250,29 +250,6 @@ struct cipher_alg { | |||
250 | void (*cia_decrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); | 250 | void (*cia_decrypt)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); |
251 | }; | 251 | }; |
252 | 252 | ||
253 | struct digest_alg { | ||
254 | unsigned int dia_digestsize; | ||
255 | void (*dia_init)(struct crypto_tfm *tfm); | ||
256 | void (*dia_update)(struct crypto_tfm *tfm, const u8 *data, | ||
257 | unsigned int len); | ||
258 | void (*dia_final)(struct crypto_tfm *tfm, u8 *out); | ||
259 | int (*dia_setkey)(struct crypto_tfm *tfm, const u8 *key, | ||
260 | unsigned int keylen); | ||
261 | }; | ||
262 | |||
263 | struct hash_alg { | ||
264 | int (*init)(struct hash_desc *desc); | ||
265 | int (*update)(struct hash_desc *desc, struct scatterlist *sg, | ||
266 | unsigned int nbytes); | ||
267 | int (*final)(struct hash_desc *desc, u8 *out); | ||
268 | int (*digest)(struct hash_desc *desc, struct scatterlist *sg, | ||
269 | unsigned int nbytes, u8 *out); | ||
270 | int (*setkey)(struct crypto_hash *tfm, const u8 *key, | ||
271 | unsigned int keylen); | ||
272 | |||
273 | unsigned int digestsize; | ||
274 | }; | ||
275 | |||
276 | struct compress_alg { | 253 | struct compress_alg { |
277 | int (*coa_compress)(struct crypto_tfm *tfm, const u8 *src, | 254 | int (*coa_compress)(struct crypto_tfm *tfm, const u8 *src, |
278 | unsigned int slen, u8 *dst, unsigned int *dlen); | 255 | unsigned int slen, u8 *dst, unsigned int *dlen); |
@@ -293,8 +270,6 @@ struct rng_alg { | |||
293 | #define cra_aead cra_u.aead | 270 | #define cra_aead cra_u.aead |
294 | #define cra_blkcipher cra_u.blkcipher | 271 | #define cra_blkcipher cra_u.blkcipher |
295 | #define cra_cipher cra_u.cipher | 272 | #define cra_cipher cra_u.cipher |
296 | #define cra_digest cra_u.digest | ||
297 | #define cra_hash cra_u.hash | ||
298 | #define cra_compress cra_u.compress | 273 | #define cra_compress cra_u.compress |
299 | #define cra_rng cra_u.rng | 274 | #define cra_rng cra_u.rng |
300 | 275 | ||
@@ -320,8 +295,6 @@ struct crypto_alg { | |||
320 | struct aead_alg aead; | 295 | struct aead_alg aead; |
321 | struct blkcipher_alg blkcipher; | 296 | struct blkcipher_alg blkcipher; |
322 | struct cipher_alg cipher; | 297 | struct cipher_alg cipher; |
323 | struct digest_alg digest; | ||
324 | struct hash_alg hash; | ||
325 | struct compress_alg compress; | 298 | struct compress_alg compress; |
326 | struct rng_alg rng; | 299 | struct rng_alg rng; |
327 | } cra_u; | 300 | } cra_u; |
diff --git a/include/linux/cryptohash.h b/include/linux/cryptohash.h index c118b2ad9807..ec78a4bbe1d5 100644 --- a/include/linux/cryptohash.h +++ b/include/linux/cryptohash.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define __CRYPTOHASH_H | 2 | #define __CRYPTOHASH_H |
3 | 3 | ||
4 | #define SHA_DIGEST_WORDS 5 | 4 | #define SHA_DIGEST_WORDS 5 |
5 | #define SHA_MESSAGE_BYTES (512 /*bits*/ / 8) | ||
5 | #define SHA_WORKSPACE_WORDS 80 | 6 | #define SHA_WORKSPACE_WORDS 80 |
6 | 7 | ||
7 | void sha_init(__u32 *buf); | 8 | void sha_init(__u32 *buf); |
diff --git a/include/linux/device.h b/include/linux/device.h index 2ea3e4921812..2a73d9bcbc9c 100644 --- a/include/linux/device.h +++ b/include/linux/device.h | |||
@@ -558,7 +558,7 @@ extern void wait_for_device_probe(void); | |||
558 | #ifdef CONFIG_DEVTMPFS | 558 | #ifdef CONFIG_DEVTMPFS |
559 | extern int devtmpfs_create_node(struct device *dev); | 559 | extern int devtmpfs_create_node(struct device *dev); |
560 | extern int devtmpfs_delete_node(struct device *dev); | 560 | extern int devtmpfs_delete_node(struct device *dev); |
561 | extern int devtmpfs_mount(const char *mountpoint); | 561 | extern int devtmpfs_mount(const char *mntdir); |
562 | #else | 562 | #else |
563 | static inline int devtmpfs_create_node(struct device *dev) { return 0; } | 563 | static inline int devtmpfs_create_node(struct device *dev) { return 0; } |
564 | static inline int devtmpfs_delete_node(struct device *dev) { return 0; } | 564 | static inline int devtmpfs_delete_node(struct device *dev) { return 0; } |
diff --git a/include/linux/dm-log-userspace.h b/include/linux/dm-log-userspace.h index 8a1f972c0fe9..0c3c3a2110c4 100644 --- a/include/linux/dm-log-userspace.h +++ b/include/linux/dm-log-userspace.h | |||
@@ -363,7 +363,7 @@ | |||
363 | * various request types above. The remaining 24-bits are currently | 363 | * various request types above. The remaining 24-bits are currently |
364 | * set to zero and are reserved for future use and compatibility concerns. | 364 | * set to zero and are reserved for future use and compatibility concerns. |
365 | * | 365 | * |
366 | * User-space should always use DM_ULOG_REQUEST_TYPE to aquire the | 366 | * User-space should always use DM_ULOG_REQUEST_TYPE to acquire the |
367 | * request type from the 'request_type' field to maintain forward compatibility. | 367 | * request type from the 'request_type' field to maintain forward compatibility. |
368 | */ | 368 | */ |
369 | #define DM_ULOG_REQUEST_MASK 0xFF | 369 | #define DM_ULOG_REQUEST_MASK 0xFF |
diff --git a/include/linux/dmar.h b/include/linux/dmar.h index 4a2b162c256a..d7cecc90ed34 100644 --- a/include/linux/dmar.h +++ b/include/linux/dmar.h | |||
@@ -126,7 +126,9 @@ extern int free_irte(int irq); | |||
126 | extern int irq_remapped(int irq); | 126 | extern int irq_remapped(int irq); |
127 | extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev); | 127 | extern struct intel_iommu *map_dev_to_ir(struct pci_dev *dev); |
128 | extern struct intel_iommu *map_ioapic_to_ir(int apic); | 128 | extern struct intel_iommu *map_ioapic_to_ir(int apic); |
129 | extern struct intel_iommu *map_hpet_to_ir(u8 id); | ||
129 | extern int set_ioapic_sid(struct irte *irte, int apic); | 130 | extern int set_ioapic_sid(struct irte *irte, int apic); |
131 | extern int set_hpet_sid(struct irte *irte, u8 id); | ||
130 | extern int set_msi_sid(struct irte *irte, struct pci_dev *dev); | 132 | extern int set_msi_sid(struct irte *irte, struct pci_dev *dev); |
131 | #else | 133 | #else |
132 | static inline int alloc_irte(struct intel_iommu *iommu, int irq, u16 count) | 134 | static inline int alloc_irte(struct intel_iommu *iommu, int irq, u16 count) |
@@ -158,10 +160,18 @@ static inline struct intel_iommu *map_ioapic_to_ir(int apic) | |||
158 | { | 160 | { |
159 | return NULL; | 161 | return NULL; |
160 | } | 162 | } |
163 | static inline struct intel_iommu *map_hpet_to_ir(unsigned int hpet_id) | ||
164 | { | ||
165 | return NULL; | ||
166 | } | ||
161 | static inline int set_ioapic_sid(struct irte *irte, int apic) | 167 | static inline int set_ioapic_sid(struct irte *irte, int apic) |
162 | { | 168 | { |
163 | return 0; | 169 | return 0; |
164 | } | 170 | } |
171 | static inline int set_hpet_sid(struct irte *irte, u8 id) | ||
172 | { | ||
173 | return -1; | ||
174 | } | ||
165 | static inline int set_msi_sid(struct irte *irte, struct pci_dev *dev) | 175 | static inline int set_msi_sid(struct irte *irte, struct pci_dev *dev) |
166 | { | 176 | { |
167 | return 0; | 177 | return 0; |
@@ -208,16 +218,9 @@ struct dmar_atsr_unit { | |||
208 | u8 include_all:1; /* include all ports */ | 218 | u8 include_all:1; /* include all ports */ |
209 | }; | 219 | }; |
210 | 220 | ||
211 | /* Intel DMAR initialization functions */ | ||
212 | extern int intel_iommu_init(void); | 221 | extern int intel_iommu_init(void); |
213 | #else | 222 | #else /* !CONFIG_DMAR: */ |
214 | static inline int intel_iommu_init(void) | 223 | static inline int intel_iommu_init(void) { return -ENODEV; } |
215 | { | 224 | #endif /* CONFIG_DMAR */ |
216 | #ifdef CONFIG_INTR_REMAP | 225 | |
217 | return dmar_dev_scope_init(); | ||
218 | #else | ||
219 | return -ENODEV; | ||
220 | #endif | ||
221 | } | ||
222 | #endif /* !CONFIG_DMAR */ | ||
223 | #endif /* __DMAR_H__ */ | 226 | #endif /* __DMAR_H__ */ |
diff --git a/include/linux/dn.h b/include/linux/dn.h index fe9990823193..9c50445462d9 100644 --- a/include/linux/dn.h +++ b/include/linux/dn.h | |||
@@ -71,14 +71,12 @@ | |||
71 | /* Structures */ | 71 | /* Structures */ |
72 | 72 | ||
73 | 73 | ||
74 | struct dn_naddr | 74 | struct dn_naddr { |
75 | { | ||
76 | __le16 a_len; | 75 | __le16 a_len; |
77 | __u8 a_addr[DN_MAXADDL]; /* Two bytes little endian */ | 76 | __u8 a_addr[DN_MAXADDL]; /* Two bytes little endian */ |
78 | }; | 77 | }; |
79 | 78 | ||
80 | struct sockaddr_dn | 79 | struct sockaddr_dn { |
81 | { | ||
82 | __u16 sdn_family; | 80 | __u16 sdn_family; |
83 | __u8 sdn_flags; | 81 | __u8 sdn_flags; |
84 | __u8 sdn_objnum; | 82 | __u8 sdn_objnum; |
@@ -101,8 +99,7 @@ struct optdata_dn { | |||
101 | __u8 opt_data[16]; /* User data */ | 99 | __u8 opt_data[16]; /* User data */ |
102 | }; | 100 | }; |
103 | 101 | ||
104 | struct accessdata_dn | 102 | struct accessdata_dn { |
105 | { | ||
106 | __u8 acc_accl; | 103 | __u8 acc_accl; |
107 | __u8 acc_acc[DN_MAXACCL]; | 104 | __u8 acc_acc[DN_MAXACCL]; |
108 | __u8 acc_passl; | 105 | __u8 acc_passl; |
diff --git a/include/linux/drbd.h b/include/linux/drbd.h new file mode 100644 index 000000000000..e84f4733cb55 --- /dev/null +++ b/include/linux/drbd.h | |||
@@ -0,0 +1,343 @@ | |||
1 | /* | ||
2 | drbd.h | ||
3 | Kernel module for 2.6.x Kernels | ||
4 | |||
5 | This file is part of DRBD by Philipp Reisner and Lars Ellenberg. | ||
6 | |||
7 | Copyright (C) 2001-2008, LINBIT Information Technologies GmbH. | ||
8 | Copyright (C) 2001-2008, Philipp Reisner <philipp.reisner@linbit.com>. | ||
9 | Copyright (C) 2001-2008, Lars Ellenberg <lars.ellenberg@linbit.com>. | ||
10 | |||
11 | drbd is free software; you can redistribute it and/or modify | ||
12 | it under the terms of the GNU General Public License as published by | ||
13 | the Free Software Foundation; either version 2, or (at your option) | ||
14 | any later version. | ||
15 | |||
16 | drbd is distributed in the hope that it will be useful, | ||
17 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
18 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
19 | GNU General Public License for more details. | ||
20 | |||
21 | You should have received a copy of the GNU General Public License | ||
22 | along with drbd; see the file COPYING. If not, write to | ||
23 | the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
24 | |||
25 | */ | ||
26 | #ifndef DRBD_H | ||
27 | #define DRBD_H | ||
28 | #include <linux/connector.h> | ||
29 | #include <asm/types.h> | ||
30 | |||
31 | #ifdef __KERNEL__ | ||
32 | #include <linux/types.h> | ||
33 | #include <asm/byteorder.h> | ||
34 | #else | ||
35 | #include <sys/types.h> | ||
36 | #include <sys/wait.h> | ||
37 | #include <limits.h> | ||
38 | |||
39 | /* Altough the Linux source code makes a difference between | ||
40 | generic endianness and the bitfields' endianness, there is no | ||
41 | architecture as of Linux-2.6.24-rc4 where the bitfileds' endianness | ||
42 | does not match the generic endianness. */ | ||
43 | |||
44 | #if __BYTE_ORDER == __LITTLE_ENDIAN | ||
45 | #define __LITTLE_ENDIAN_BITFIELD | ||
46 | #elif __BYTE_ORDER == __BIG_ENDIAN | ||
47 | #define __BIG_ENDIAN_BITFIELD | ||
48 | #else | ||
49 | # error "sorry, weird endianness on this box" | ||
50 | #endif | ||
51 | |||
52 | #endif | ||
53 | |||
54 | |||
55 | extern const char *drbd_buildtag(void); | ||
56 | #define REL_VERSION "8.3.6" | ||
57 | #define API_VERSION 88 | ||
58 | #define PRO_VERSION_MIN 86 | ||
59 | #define PRO_VERSION_MAX 91 | ||
60 | |||
61 | |||
62 | enum drbd_io_error_p { | ||
63 | EP_PASS_ON, /* FIXME should the better be named "Ignore"? */ | ||
64 | EP_CALL_HELPER, | ||
65 | EP_DETACH | ||
66 | }; | ||
67 | |||
68 | enum drbd_fencing_p { | ||
69 | FP_DONT_CARE, | ||
70 | FP_RESOURCE, | ||
71 | FP_STONITH | ||
72 | }; | ||
73 | |||
74 | enum drbd_disconnect_p { | ||
75 | DP_RECONNECT, | ||
76 | DP_DROP_NET_CONF, | ||
77 | DP_FREEZE_IO | ||
78 | }; | ||
79 | |||
80 | enum drbd_after_sb_p { | ||
81 | ASB_DISCONNECT, | ||
82 | ASB_DISCARD_YOUNGER_PRI, | ||
83 | ASB_DISCARD_OLDER_PRI, | ||
84 | ASB_DISCARD_ZERO_CHG, | ||
85 | ASB_DISCARD_LEAST_CHG, | ||
86 | ASB_DISCARD_LOCAL, | ||
87 | ASB_DISCARD_REMOTE, | ||
88 | ASB_CONSENSUS, | ||
89 | ASB_DISCARD_SECONDARY, | ||
90 | ASB_CALL_HELPER, | ||
91 | ASB_VIOLENTLY | ||
92 | }; | ||
93 | |||
94 | /* KEEP the order, do not delete or insert. Only append. */ | ||
95 | enum drbd_ret_codes { | ||
96 | ERR_CODE_BASE = 100, | ||
97 | NO_ERROR = 101, | ||
98 | ERR_LOCAL_ADDR = 102, | ||
99 | ERR_PEER_ADDR = 103, | ||
100 | ERR_OPEN_DISK = 104, | ||
101 | ERR_OPEN_MD_DISK = 105, | ||
102 | ERR_DISK_NOT_BDEV = 107, | ||
103 | ERR_MD_NOT_BDEV = 108, | ||
104 | ERR_DISK_TO_SMALL = 111, | ||
105 | ERR_MD_DISK_TO_SMALL = 112, | ||
106 | ERR_BDCLAIM_DISK = 114, | ||
107 | ERR_BDCLAIM_MD_DISK = 115, | ||
108 | ERR_MD_IDX_INVALID = 116, | ||
109 | ERR_IO_MD_DISK = 118, | ||
110 | ERR_MD_INVALID = 119, | ||
111 | ERR_AUTH_ALG = 120, | ||
112 | ERR_AUTH_ALG_ND = 121, | ||
113 | ERR_NOMEM = 122, | ||
114 | ERR_DISCARD = 123, | ||
115 | ERR_DISK_CONFIGURED = 124, | ||
116 | ERR_NET_CONFIGURED = 125, | ||
117 | ERR_MANDATORY_TAG = 126, | ||
118 | ERR_MINOR_INVALID = 127, | ||
119 | ERR_INTR = 129, /* EINTR */ | ||
120 | ERR_RESIZE_RESYNC = 130, | ||
121 | ERR_NO_PRIMARY = 131, | ||
122 | ERR_SYNC_AFTER = 132, | ||
123 | ERR_SYNC_AFTER_CYCLE = 133, | ||
124 | ERR_PAUSE_IS_SET = 134, | ||
125 | ERR_PAUSE_IS_CLEAR = 135, | ||
126 | ERR_PACKET_NR = 137, | ||
127 | ERR_NO_DISK = 138, | ||
128 | ERR_NOT_PROTO_C = 139, | ||
129 | ERR_NOMEM_BITMAP = 140, | ||
130 | ERR_INTEGRITY_ALG = 141, /* DRBD 8.2 only */ | ||
131 | ERR_INTEGRITY_ALG_ND = 142, /* DRBD 8.2 only */ | ||
132 | ERR_CPU_MASK_PARSE = 143, /* DRBD 8.2 only */ | ||
133 | ERR_CSUMS_ALG = 144, /* DRBD 8.2 only */ | ||
134 | ERR_CSUMS_ALG_ND = 145, /* DRBD 8.2 only */ | ||
135 | ERR_VERIFY_ALG = 146, /* DRBD 8.2 only */ | ||
136 | ERR_VERIFY_ALG_ND = 147, /* DRBD 8.2 only */ | ||
137 | ERR_CSUMS_RESYNC_RUNNING= 148, /* DRBD 8.2 only */ | ||
138 | ERR_VERIFY_RUNNING = 149, /* DRBD 8.2 only */ | ||
139 | ERR_DATA_NOT_CURRENT = 150, | ||
140 | ERR_CONNECTED = 151, /* DRBD 8.3 only */ | ||
141 | ERR_PERM = 152, | ||
142 | |||
143 | /* insert new ones above this line */ | ||
144 | AFTER_LAST_ERR_CODE | ||
145 | }; | ||
146 | |||
147 | #define DRBD_PROT_A 1 | ||
148 | #define DRBD_PROT_B 2 | ||
149 | #define DRBD_PROT_C 3 | ||
150 | |||
151 | enum drbd_role { | ||
152 | R_UNKNOWN = 0, | ||
153 | R_PRIMARY = 1, /* role */ | ||
154 | R_SECONDARY = 2, /* role */ | ||
155 | R_MASK = 3, | ||
156 | }; | ||
157 | |||
158 | /* The order of these constants is important. | ||
159 | * The lower ones (<C_WF_REPORT_PARAMS) indicate | ||
160 | * that there is no socket! | ||
161 | * >=C_WF_REPORT_PARAMS ==> There is a socket | ||
162 | */ | ||
163 | enum drbd_conns { | ||
164 | C_STANDALONE, | ||
165 | C_DISCONNECTING, /* Temporal state on the way to StandAlone. */ | ||
166 | C_UNCONNECTED, /* >= C_UNCONNECTED -> inc_net() succeeds */ | ||
167 | |||
168 | /* These temporal states are all used on the way | ||
169 | * from >= C_CONNECTED to Unconnected. | ||
170 | * The 'disconnect reason' states | ||
171 | * I do not allow to change beween them. */ | ||
172 | C_TIMEOUT, | ||
173 | C_BROKEN_PIPE, | ||
174 | C_NETWORK_FAILURE, | ||
175 | C_PROTOCOL_ERROR, | ||
176 | C_TEAR_DOWN, | ||
177 | |||
178 | C_WF_CONNECTION, | ||
179 | C_WF_REPORT_PARAMS, /* we have a socket */ | ||
180 | C_CONNECTED, /* we have introduced each other */ | ||
181 | C_STARTING_SYNC_S, /* starting full sync by admin request. */ | ||
182 | C_STARTING_SYNC_T, /* stariing full sync by admin request. */ | ||
183 | C_WF_BITMAP_S, | ||
184 | C_WF_BITMAP_T, | ||
185 | C_WF_SYNC_UUID, | ||
186 | |||
187 | /* All SyncStates are tested with this comparison | ||
188 | * xx >= C_SYNC_SOURCE && xx <= C_PAUSED_SYNC_T */ | ||
189 | C_SYNC_SOURCE, | ||
190 | C_SYNC_TARGET, | ||
191 | C_VERIFY_S, | ||
192 | C_VERIFY_T, | ||
193 | C_PAUSED_SYNC_S, | ||
194 | C_PAUSED_SYNC_T, | ||
195 | C_MASK = 31 | ||
196 | }; | ||
197 | |||
198 | enum drbd_disk_state { | ||
199 | D_DISKLESS, | ||
200 | D_ATTACHING, /* In the process of reading the meta-data */ | ||
201 | D_FAILED, /* Becomes D_DISKLESS as soon as we told it the peer */ | ||
202 | /* when >= D_FAILED it is legal to access mdev->bc */ | ||
203 | D_NEGOTIATING, /* Late attaching state, we need to talk to the peer */ | ||
204 | D_INCONSISTENT, | ||
205 | D_OUTDATED, | ||
206 | D_UNKNOWN, /* Only used for the peer, never for myself */ | ||
207 | D_CONSISTENT, /* Might be D_OUTDATED, might be D_UP_TO_DATE ... */ | ||
208 | D_UP_TO_DATE, /* Only this disk state allows applications' IO ! */ | ||
209 | D_MASK = 15 | ||
210 | }; | ||
211 | |||
212 | union drbd_state { | ||
213 | /* According to gcc's docs is the ... | ||
214 | * The order of allocation of bit-fields within a unit (C90 6.5.2.1, C99 6.7.2.1). | ||
215 | * Determined by ABI. | ||
216 | * pointed out by Maxim Uvarov q<muvarov@ru.mvista.com> | ||
217 | * even though we transmit as "cpu_to_be32(state)", | ||
218 | * the offsets of the bitfields still need to be swapped | ||
219 | * on different endianess. | ||
220 | */ | ||
221 | struct { | ||
222 | #if defined(__LITTLE_ENDIAN_BITFIELD) | ||
223 | unsigned role:2 ; /* 3/4 primary/secondary/unknown */ | ||
224 | unsigned peer:2 ; /* 3/4 primary/secondary/unknown */ | ||
225 | unsigned conn:5 ; /* 17/32 cstates */ | ||
226 | unsigned disk:4 ; /* 8/16 from D_DISKLESS to D_UP_TO_DATE */ | ||
227 | unsigned pdsk:4 ; /* 8/16 from D_DISKLESS to D_UP_TO_DATE */ | ||
228 | unsigned susp:1 ; /* 2/2 IO suspended no/yes */ | ||
229 | unsigned aftr_isp:1 ; /* isp .. imposed sync pause */ | ||
230 | unsigned peer_isp:1 ; | ||
231 | unsigned user_isp:1 ; | ||
232 | unsigned _pad:11; /* 0 unused */ | ||
233 | #elif defined(__BIG_ENDIAN_BITFIELD) | ||
234 | unsigned _pad:11; /* 0 unused */ | ||
235 | unsigned user_isp:1 ; | ||
236 | unsigned peer_isp:1 ; | ||
237 | unsigned aftr_isp:1 ; /* isp .. imposed sync pause */ | ||
238 | unsigned susp:1 ; /* 2/2 IO suspended no/yes */ | ||
239 | unsigned pdsk:4 ; /* 8/16 from D_DISKLESS to D_UP_TO_DATE */ | ||
240 | unsigned disk:4 ; /* 8/16 from D_DISKLESS to D_UP_TO_DATE */ | ||
241 | unsigned conn:5 ; /* 17/32 cstates */ | ||
242 | unsigned peer:2 ; /* 3/4 primary/secondary/unknown */ | ||
243 | unsigned role:2 ; /* 3/4 primary/secondary/unknown */ | ||
244 | #else | ||
245 | # error "this endianess is not supported" | ||
246 | #endif | ||
247 | }; | ||
248 | unsigned int i; | ||
249 | }; | ||
250 | |||
251 | enum drbd_state_ret_codes { | ||
252 | SS_CW_NO_NEED = 4, | ||
253 | SS_CW_SUCCESS = 3, | ||
254 | SS_NOTHING_TO_DO = 2, | ||
255 | SS_SUCCESS = 1, | ||
256 | SS_UNKNOWN_ERROR = 0, /* Used to sleep longer in _drbd_request_state */ | ||
257 | SS_TWO_PRIMARIES = -1, | ||
258 | SS_NO_UP_TO_DATE_DISK = -2, | ||
259 | SS_NO_LOCAL_DISK = -4, | ||
260 | SS_NO_REMOTE_DISK = -5, | ||
261 | SS_CONNECTED_OUTDATES = -6, | ||
262 | SS_PRIMARY_NOP = -7, | ||
263 | SS_RESYNC_RUNNING = -8, | ||
264 | SS_ALREADY_STANDALONE = -9, | ||
265 | SS_CW_FAILED_BY_PEER = -10, | ||
266 | SS_IS_DISKLESS = -11, | ||
267 | SS_DEVICE_IN_USE = -12, | ||
268 | SS_NO_NET_CONFIG = -13, | ||
269 | SS_NO_VERIFY_ALG = -14, /* drbd-8.2 only */ | ||
270 | SS_NEED_CONNECTION = -15, /* drbd-8.2 only */ | ||
271 | SS_LOWER_THAN_OUTDATED = -16, | ||
272 | SS_NOT_SUPPORTED = -17, /* drbd-8.2 only */ | ||
273 | SS_IN_TRANSIENT_STATE = -18, /* Retry after the next state change */ | ||
274 | SS_CONCURRENT_ST_CHG = -19, /* Concurrent cluster side state change! */ | ||
275 | SS_AFTER_LAST_ERROR = -20, /* Keep this at bottom */ | ||
276 | }; | ||
277 | |||
278 | /* from drbd_strings.c */ | ||
279 | extern const char *drbd_conn_str(enum drbd_conns); | ||
280 | extern const char *drbd_role_str(enum drbd_role); | ||
281 | extern const char *drbd_disk_str(enum drbd_disk_state); | ||
282 | extern const char *drbd_set_st_err_str(enum drbd_state_ret_codes); | ||
283 | |||
284 | #define SHARED_SECRET_MAX 64 | ||
285 | |||
286 | #define MDF_CONSISTENT (1 << 0) | ||
287 | #define MDF_PRIMARY_IND (1 << 1) | ||
288 | #define MDF_CONNECTED_IND (1 << 2) | ||
289 | #define MDF_FULL_SYNC (1 << 3) | ||
290 | #define MDF_WAS_UP_TO_DATE (1 << 4) | ||
291 | #define MDF_PEER_OUT_DATED (1 << 5) | ||
292 | #define MDF_CRASHED_PRIMARY (1 << 6) | ||
293 | |||
294 | enum drbd_uuid_index { | ||
295 | UI_CURRENT, | ||
296 | UI_BITMAP, | ||
297 | UI_HISTORY_START, | ||
298 | UI_HISTORY_END, | ||
299 | UI_SIZE, /* nl-packet: number of dirty bits */ | ||
300 | UI_FLAGS, /* nl-packet: flags */ | ||
301 | UI_EXTENDED_SIZE /* Everything. */ | ||
302 | }; | ||
303 | |||
304 | enum drbd_timeout_flag { | ||
305 | UT_DEFAULT = 0, | ||
306 | UT_DEGRADED = 1, | ||
307 | UT_PEER_OUTDATED = 2, | ||
308 | }; | ||
309 | |||
310 | #define UUID_JUST_CREATED ((__u64)4) | ||
311 | |||
312 | #define DRBD_MAGIC 0x83740267 | ||
313 | #define BE_DRBD_MAGIC __constant_cpu_to_be32(DRBD_MAGIC) | ||
314 | |||
315 | /* these are of type "int" */ | ||
316 | #define DRBD_MD_INDEX_INTERNAL -1 | ||
317 | #define DRBD_MD_INDEX_FLEX_EXT -2 | ||
318 | #define DRBD_MD_INDEX_FLEX_INT -3 | ||
319 | |||
320 | /* Start of the new netlink/connector stuff */ | ||
321 | |||
322 | #define DRBD_NL_CREATE_DEVICE 0x01 | ||
323 | #define DRBD_NL_SET_DEFAULTS 0x02 | ||
324 | |||
325 | |||
326 | /* For searching a vacant cn_idx value */ | ||
327 | #define CN_IDX_STEP 6977 | ||
328 | |||
329 | struct drbd_nl_cfg_req { | ||
330 | int packet_type; | ||
331 | unsigned int drbd_minor; | ||
332 | int flags; | ||
333 | unsigned short tag_list[]; | ||
334 | }; | ||
335 | |||
336 | struct drbd_nl_cfg_reply { | ||
337 | int packet_type; | ||
338 | unsigned int minor; | ||
339 | int ret_code; /* enum ret_code or set_st_err_t */ | ||
340 | unsigned short tag_list[]; /* only used with get_* calls */ | ||
341 | }; | ||
342 | |||
343 | #endif | ||
diff --git a/include/linux/drbd_limits.h b/include/linux/drbd_limits.h new file mode 100644 index 000000000000..51f47a586ad8 --- /dev/null +++ b/include/linux/drbd_limits.h | |||
@@ -0,0 +1,137 @@ | |||
1 | /* | ||
2 | drbd_limits.h | ||
3 | This file is part of DRBD by Philipp Reisner and Lars Ellenberg. | ||
4 | */ | ||
5 | |||
6 | /* | ||
7 | * Our current limitations. | ||
8 | * Some of them are hard limits, | ||
9 | * some of them are arbitrary range limits, that make it easier to provide | ||
10 | * feedback about nonsense settings for certain configurable values. | ||
11 | */ | ||
12 | |||
13 | #ifndef DRBD_LIMITS_H | ||
14 | #define DRBD_LIMITS_H 1 | ||
15 | |||
16 | #define DEBUG_RANGE_CHECK 0 | ||
17 | |||
18 | #define DRBD_MINOR_COUNT_MIN 1 | ||
19 | #define DRBD_MINOR_COUNT_MAX 255 | ||
20 | |||
21 | #define DRBD_DIALOG_REFRESH_MIN 0 | ||
22 | #define DRBD_DIALOG_REFRESH_MAX 600 | ||
23 | |||
24 | /* valid port number */ | ||
25 | #define DRBD_PORT_MIN 1 | ||
26 | #define DRBD_PORT_MAX 0xffff | ||
27 | |||
28 | /* startup { */ | ||
29 | /* if you want more than 3.4 days, disable */ | ||
30 | #define DRBD_WFC_TIMEOUT_MIN 0 | ||
31 | #define DRBD_WFC_TIMEOUT_MAX 300000 | ||
32 | #define DRBD_WFC_TIMEOUT_DEF 0 | ||
33 | |||
34 | #define DRBD_DEGR_WFC_TIMEOUT_MIN 0 | ||
35 | #define DRBD_DEGR_WFC_TIMEOUT_MAX 300000 | ||
36 | #define DRBD_DEGR_WFC_TIMEOUT_DEF 0 | ||
37 | |||
38 | #define DRBD_OUTDATED_WFC_TIMEOUT_MIN 0 | ||
39 | #define DRBD_OUTDATED_WFC_TIMEOUT_MAX 300000 | ||
40 | #define DRBD_OUTDATED_WFC_TIMEOUT_DEF 0 | ||
41 | /* }*/ | ||
42 | |||
43 | /* net { */ | ||
44 | /* timeout, unit centi seconds | ||
45 | * more than one minute timeout is not usefull */ | ||
46 | #define DRBD_TIMEOUT_MIN 1 | ||
47 | #define DRBD_TIMEOUT_MAX 600 | ||
48 | #define DRBD_TIMEOUT_DEF 60 /* 6 seconds */ | ||
49 | |||
50 | /* active connection retries when C_WF_CONNECTION */ | ||
51 | #define DRBD_CONNECT_INT_MIN 1 | ||
52 | #define DRBD_CONNECT_INT_MAX 120 | ||
53 | #define DRBD_CONNECT_INT_DEF 10 /* seconds */ | ||
54 | |||
55 | /* keep-alive probes when idle */ | ||
56 | #define DRBD_PING_INT_MIN 1 | ||
57 | #define DRBD_PING_INT_MAX 120 | ||
58 | #define DRBD_PING_INT_DEF 10 | ||
59 | |||
60 | /* timeout for the ping packets.*/ | ||
61 | #define DRBD_PING_TIMEO_MIN 1 | ||
62 | #define DRBD_PING_TIMEO_MAX 100 | ||
63 | #define DRBD_PING_TIMEO_DEF 5 | ||
64 | |||
65 | /* max number of write requests between write barriers */ | ||
66 | #define DRBD_MAX_EPOCH_SIZE_MIN 1 | ||
67 | #define DRBD_MAX_EPOCH_SIZE_MAX 20000 | ||
68 | #define DRBD_MAX_EPOCH_SIZE_DEF 2048 | ||
69 | |||
70 | /* I don't think that a tcp send buffer of more than 10M is usefull */ | ||
71 | #define DRBD_SNDBUF_SIZE_MIN 0 | ||
72 | #define DRBD_SNDBUF_SIZE_MAX (10<<20) | ||
73 | #define DRBD_SNDBUF_SIZE_DEF 0 | ||
74 | |||
75 | #define DRBD_RCVBUF_SIZE_MIN 0 | ||
76 | #define DRBD_RCVBUF_SIZE_MAX (10<<20) | ||
77 | #define DRBD_RCVBUF_SIZE_DEF 0 | ||
78 | |||
79 | /* @4k PageSize -> 128kB - 512MB */ | ||
80 | #define DRBD_MAX_BUFFERS_MIN 32 | ||
81 | #define DRBD_MAX_BUFFERS_MAX 131072 | ||
82 | #define DRBD_MAX_BUFFERS_DEF 2048 | ||
83 | |||
84 | /* @4k PageSize -> 4kB - 512MB */ | ||
85 | #define DRBD_UNPLUG_WATERMARK_MIN 1 | ||
86 | #define DRBD_UNPLUG_WATERMARK_MAX 131072 | ||
87 | #define DRBD_UNPLUG_WATERMARK_DEF (DRBD_MAX_BUFFERS_DEF/16) | ||
88 | |||
89 | /* 0 is disabled. | ||
90 | * 200 should be more than enough even for very short timeouts */ | ||
91 | #define DRBD_KO_COUNT_MIN 0 | ||
92 | #define DRBD_KO_COUNT_MAX 200 | ||
93 | #define DRBD_KO_COUNT_DEF 0 | ||
94 | /* } */ | ||
95 | |||
96 | /* syncer { */ | ||
97 | /* FIXME allow rate to be zero? */ | ||
98 | #define DRBD_RATE_MIN 1 | ||
99 | /* channel bonding 10 GbE, or other hardware */ | ||
100 | #define DRBD_RATE_MAX (4 << 20) | ||
101 | #define DRBD_RATE_DEF 250 /* kb/second */ | ||
102 | |||
103 | /* less than 7 would hit performance unneccessarily. | ||
104 | * 3833 is the largest prime that still does fit | ||
105 | * into 64 sectors of activity log */ | ||
106 | #define DRBD_AL_EXTENTS_MIN 7 | ||
107 | #define DRBD_AL_EXTENTS_MAX 3833 | ||
108 | #define DRBD_AL_EXTENTS_DEF 127 | ||
109 | |||
110 | #define DRBD_AFTER_MIN -1 | ||
111 | #define DRBD_AFTER_MAX 255 | ||
112 | #define DRBD_AFTER_DEF -1 | ||
113 | |||
114 | /* } */ | ||
115 | |||
116 | /* drbdsetup XY resize -d Z | ||
117 | * you are free to reduce the device size to nothing, if you want to. | ||
118 | * the upper limit with 64bit kernel, enough ram and flexible meta data | ||
119 | * is 16 TB, currently. */ | ||
120 | /* DRBD_MAX_SECTORS */ | ||
121 | #define DRBD_DISK_SIZE_SECT_MIN 0 | ||
122 | #define DRBD_DISK_SIZE_SECT_MAX (16 * (2LLU << 30)) | ||
123 | #define DRBD_DISK_SIZE_SECT_DEF 0 /* = disabled = no user size... */ | ||
124 | |||
125 | #define DRBD_ON_IO_ERROR_DEF EP_PASS_ON | ||
126 | #define DRBD_FENCING_DEF FP_DONT_CARE | ||
127 | #define DRBD_AFTER_SB_0P_DEF ASB_DISCONNECT | ||
128 | #define DRBD_AFTER_SB_1P_DEF ASB_DISCONNECT | ||
129 | #define DRBD_AFTER_SB_2P_DEF ASB_DISCONNECT | ||
130 | #define DRBD_RR_CONFLICT_DEF ASB_DISCONNECT | ||
131 | |||
132 | #define DRBD_MAX_BIO_BVECS_MIN 0 | ||
133 | #define DRBD_MAX_BIO_BVECS_MAX 128 | ||
134 | #define DRBD_MAX_BIO_BVECS_DEF 0 | ||
135 | |||
136 | #undef RANGE | ||
137 | #endif | ||
diff --git a/include/linux/drbd_nl.h b/include/linux/drbd_nl.h new file mode 100644 index 000000000000..db5721ad50d1 --- /dev/null +++ b/include/linux/drbd_nl.h | |||
@@ -0,0 +1,137 @@ | |||
1 | /* | ||
2 | PAKET( name, | ||
3 | TYPE ( pn, pr, member ) | ||
4 | ... | ||
5 | ) | ||
6 | |||
7 | You may never reissue one of the pn arguments | ||
8 | */ | ||
9 | |||
10 | #if !defined(NL_PACKET) || !defined(NL_STRING) || !defined(NL_INTEGER) || !defined(NL_BIT) || !defined(NL_INT64) | ||
11 | #error "The macros NL_PACKET, NL_STRING, NL_INTEGER, NL_INT64 and NL_BIT needs to be defined" | ||
12 | #endif | ||
13 | |||
14 | NL_PACKET(primary, 1, | ||
15 | NL_BIT( 1, T_MAY_IGNORE, overwrite_peer) | ||
16 | ) | ||
17 | |||
18 | NL_PACKET(secondary, 2, ) | ||
19 | |||
20 | NL_PACKET(disk_conf, 3, | ||
21 | NL_INT64( 2, T_MAY_IGNORE, disk_size) | ||
22 | NL_STRING( 3, T_MANDATORY, backing_dev, 128) | ||
23 | NL_STRING( 4, T_MANDATORY, meta_dev, 128) | ||
24 | NL_INTEGER( 5, T_MANDATORY, meta_dev_idx) | ||
25 | NL_INTEGER( 6, T_MAY_IGNORE, on_io_error) | ||
26 | NL_INTEGER( 7, T_MAY_IGNORE, fencing) | ||
27 | NL_BIT( 37, T_MAY_IGNORE, use_bmbv) | ||
28 | NL_BIT( 53, T_MAY_IGNORE, no_disk_flush) | ||
29 | NL_BIT( 54, T_MAY_IGNORE, no_md_flush) | ||
30 | /* 55 max_bio_size was available in 8.2.6rc2 */ | ||
31 | NL_INTEGER( 56, T_MAY_IGNORE, max_bio_bvecs) | ||
32 | NL_BIT( 57, T_MAY_IGNORE, no_disk_barrier) | ||
33 | NL_BIT( 58, T_MAY_IGNORE, no_disk_drain) | ||
34 | ) | ||
35 | |||
36 | NL_PACKET(detach, 4, ) | ||
37 | |||
38 | NL_PACKET(net_conf, 5, | ||
39 | NL_STRING( 8, T_MANDATORY, my_addr, 128) | ||
40 | NL_STRING( 9, T_MANDATORY, peer_addr, 128) | ||
41 | NL_STRING( 10, T_MAY_IGNORE, shared_secret, SHARED_SECRET_MAX) | ||
42 | NL_STRING( 11, T_MAY_IGNORE, cram_hmac_alg, SHARED_SECRET_MAX) | ||
43 | NL_STRING( 44, T_MAY_IGNORE, integrity_alg, SHARED_SECRET_MAX) | ||
44 | NL_INTEGER( 14, T_MAY_IGNORE, timeout) | ||
45 | NL_INTEGER( 15, T_MANDATORY, wire_protocol) | ||
46 | NL_INTEGER( 16, T_MAY_IGNORE, try_connect_int) | ||
47 | NL_INTEGER( 17, T_MAY_IGNORE, ping_int) | ||
48 | NL_INTEGER( 18, T_MAY_IGNORE, max_epoch_size) | ||
49 | NL_INTEGER( 19, T_MAY_IGNORE, max_buffers) | ||
50 | NL_INTEGER( 20, T_MAY_IGNORE, unplug_watermark) | ||
51 | NL_INTEGER( 21, T_MAY_IGNORE, sndbuf_size) | ||
52 | NL_INTEGER( 22, T_MAY_IGNORE, ko_count) | ||
53 | NL_INTEGER( 24, T_MAY_IGNORE, after_sb_0p) | ||
54 | NL_INTEGER( 25, T_MAY_IGNORE, after_sb_1p) | ||
55 | NL_INTEGER( 26, T_MAY_IGNORE, after_sb_2p) | ||
56 | NL_INTEGER( 39, T_MAY_IGNORE, rr_conflict) | ||
57 | NL_INTEGER( 40, T_MAY_IGNORE, ping_timeo) | ||
58 | NL_INTEGER( 67, T_MAY_IGNORE, rcvbuf_size) | ||
59 | /* 59 addr_family was available in GIT, never released */ | ||
60 | NL_BIT( 60, T_MANDATORY, mind_af) | ||
61 | NL_BIT( 27, T_MAY_IGNORE, want_lose) | ||
62 | NL_BIT( 28, T_MAY_IGNORE, two_primaries) | ||
63 | NL_BIT( 41, T_MAY_IGNORE, always_asbp) | ||
64 | NL_BIT( 61, T_MAY_IGNORE, no_cork) | ||
65 | NL_BIT( 62, T_MANDATORY, auto_sndbuf_size) | ||
66 | ) | ||
67 | |||
68 | NL_PACKET(disconnect, 6, ) | ||
69 | |||
70 | NL_PACKET(resize, 7, | ||
71 | NL_INT64( 29, T_MAY_IGNORE, resize_size) | ||
72 | ) | ||
73 | |||
74 | NL_PACKET(syncer_conf, 8, | ||
75 | NL_INTEGER( 30, T_MAY_IGNORE, rate) | ||
76 | NL_INTEGER( 31, T_MAY_IGNORE, after) | ||
77 | NL_INTEGER( 32, T_MAY_IGNORE, al_extents) | ||
78 | NL_STRING( 52, T_MAY_IGNORE, verify_alg, SHARED_SECRET_MAX) | ||
79 | NL_STRING( 51, T_MAY_IGNORE, cpu_mask, 32) | ||
80 | NL_STRING( 64, T_MAY_IGNORE, csums_alg, SHARED_SECRET_MAX) | ||
81 | NL_BIT( 65, T_MAY_IGNORE, use_rle) | ||
82 | ) | ||
83 | |||
84 | NL_PACKET(invalidate, 9, ) | ||
85 | NL_PACKET(invalidate_peer, 10, ) | ||
86 | NL_PACKET(pause_sync, 11, ) | ||
87 | NL_PACKET(resume_sync, 12, ) | ||
88 | NL_PACKET(suspend_io, 13, ) | ||
89 | NL_PACKET(resume_io, 14, ) | ||
90 | NL_PACKET(outdate, 15, ) | ||
91 | NL_PACKET(get_config, 16, ) | ||
92 | NL_PACKET(get_state, 17, | ||
93 | NL_INTEGER( 33, T_MAY_IGNORE, state_i) | ||
94 | ) | ||
95 | |||
96 | NL_PACKET(get_uuids, 18, | ||
97 | NL_STRING( 34, T_MAY_IGNORE, uuids, (UI_SIZE*sizeof(__u64))) | ||
98 | NL_INTEGER( 35, T_MAY_IGNORE, uuids_flags) | ||
99 | ) | ||
100 | |||
101 | NL_PACKET(get_timeout_flag, 19, | ||
102 | NL_BIT( 36, T_MAY_IGNORE, use_degraded) | ||
103 | ) | ||
104 | |||
105 | NL_PACKET(call_helper, 20, | ||
106 | NL_STRING( 38, T_MAY_IGNORE, helper, 32) | ||
107 | ) | ||
108 | |||
109 | /* Tag nr 42 already allocated in drbd-8.1 development. */ | ||
110 | |||
111 | NL_PACKET(sync_progress, 23, | ||
112 | NL_INTEGER( 43, T_MAY_IGNORE, sync_progress) | ||
113 | ) | ||
114 | |||
115 | NL_PACKET(dump_ee, 24, | ||
116 | NL_STRING( 45, T_MAY_IGNORE, dump_ee_reason, 32) | ||
117 | NL_STRING( 46, T_MAY_IGNORE, seen_digest, SHARED_SECRET_MAX) | ||
118 | NL_STRING( 47, T_MAY_IGNORE, calc_digest, SHARED_SECRET_MAX) | ||
119 | NL_INT64( 48, T_MAY_IGNORE, ee_sector) | ||
120 | NL_INT64( 49, T_MAY_IGNORE, ee_block_id) | ||
121 | NL_STRING( 50, T_MAY_IGNORE, ee_data, 32 << 10) | ||
122 | ) | ||
123 | |||
124 | NL_PACKET(start_ov, 25, | ||
125 | NL_INT64( 66, T_MAY_IGNORE, start_sector) | ||
126 | ) | ||
127 | |||
128 | NL_PACKET(new_c_uuid, 26, | ||
129 | NL_BIT( 63, T_MANDATORY, clear_bm) | ||
130 | ) | ||
131 | |||
132 | #undef NL_PACKET | ||
133 | #undef NL_INTEGER | ||
134 | #undef NL_INT64 | ||
135 | #undef NL_BIT | ||
136 | #undef NL_STRING | ||
137 | |||
diff --git a/include/linux/drbd_tag_magic.h b/include/linux/drbd_tag_magic.h new file mode 100644 index 000000000000..fcdff8410e99 --- /dev/null +++ b/include/linux/drbd_tag_magic.h | |||
@@ -0,0 +1,83 @@ | |||
1 | #ifndef DRBD_TAG_MAGIC_H | ||
2 | #define DRBD_TAG_MAGIC_H | ||
3 | |||
4 | #define TT_END 0 | ||
5 | #define TT_REMOVED 0xE000 | ||
6 | |||
7 | /* declare packet_type enums */ | ||
8 | enum packet_types { | ||
9 | #define NL_PACKET(name, number, fields) P_ ## name = number, | ||
10 | #define NL_INTEGER(pn, pr, member) | ||
11 | #define NL_INT64(pn, pr, member) | ||
12 | #define NL_BIT(pn, pr, member) | ||
13 | #define NL_STRING(pn, pr, member, len) | ||
14 | #include "drbd_nl.h" | ||
15 | P_nl_after_last_packet, | ||
16 | }; | ||
17 | |||
18 | /* These struct are used to deduce the size of the tag lists: */ | ||
19 | #define NL_PACKET(name, number, fields) \ | ||
20 | struct name ## _tag_len_struct { fields }; | ||
21 | #define NL_INTEGER(pn, pr, member) \ | ||
22 | int member; int tag_and_len ## member; | ||
23 | #define NL_INT64(pn, pr, member) \ | ||
24 | __u64 member; int tag_and_len ## member; | ||
25 | #define NL_BIT(pn, pr, member) \ | ||
26 | unsigned char member:1; int tag_and_len ## member; | ||
27 | #define NL_STRING(pn, pr, member, len) \ | ||
28 | unsigned char member[len]; int member ## _len; \ | ||
29 | int tag_and_len ## member; | ||
30 | #include "linux/drbd_nl.h" | ||
31 | |||
32 | /* declate tag-list-sizes */ | ||
33 | static const int tag_list_sizes[] = { | ||
34 | #define NL_PACKET(name, number, fields) 2 fields , | ||
35 | #define NL_INTEGER(pn, pr, member) + 4 + 4 | ||
36 | #define NL_INT64(pn, pr, member) + 4 + 8 | ||
37 | #define NL_BIT(pn, pr, member) + 4 + 1 | ||
38 | #define NL_STRING(pn, pr, member, len) + 4 + (len) | ||
39 | #include "drbd_nl.h" | ||
40 | }; | ||
41 | |||
42 | /* The two highest bits are used for the tag type */ | ||
43 | #define TT_MASK 0xC000 | ||
44 | #define TT_INTEGER 0x0000 | ||
45 | #define TT_INT64 0x4000 | ||
46 | #define TT_BIT 0x8000 | ||
47 | #define TT_STRING 0xC000 | ||
48 | /* The next bit indicates if processing of the tag is mandatory */ | ||
49 | #define T_MANDATORY 0x2000 | ||
50 | #define T_MAY_IGNORE 0x0000 | ||
51 | #define TN_MASK 0x1fff | ||
52 | /* The remaining 13 bits are used to enumerate the tags */ | ||
53 | |||
54 | #define tag_type(T) ((T) & TT_MASK) | ||
55 | #define tag_number(T) ((T) & TN_MASK) | ||
56 | |||
57 | /* declare tag enums */ | ||
58 | #define NL_PACKET(name, number, fields) fields | ||
59 | enum drbd_tags { | ||
60 | #define NL_INTEGER(pn, pr, member) T_ ## member = pn | TT_INTEGER | pr , | ||
61 | #define NL_INT64(pn, pr, member) T_ ## member = pn | TT_INT64 | pr , | ||
62 | #define NL_BIT(pn, pr, member) T_ ## member = pn | TT_BIT | pr , | ||
63 | #define NL_STRING(pn, pr, member, len) T_ ## member = pn | TT_STRING | pr , | ||
64 | #include "drbd_nl.h" | ||
65 | }; | ||
66 | |||
67 | struct tag { | ||
68 | const char *name; | ||
69 | int type_n_flags; | ||
70 | int max_len; | ||
71 | }; | ||
72 | |||
73 | /* declare tag names */ | ||
74 | #define NL_PACKET(name, number, fields) fields | ||
75 | static const struct tag tag_descriptions[] = { | ||
76 | #define NL_INTEGER(pn, pr, member) [ pn ] = { #member, TT_INTEGER | pr, sizeof(int) }, | ||
77 | #define NL_INT64(pn, pr, member) [ pn ] = { #member, TT_INT64 | pr, sizeof(__u64) }, | ||
78 | #define NL_BIT(pn, pr, member) [ pn ] = { #member, TT_BIT | pr, sizeof(int) }, | ||
79 | #define NL_STRING(pn, pr, member, len) [ pn ] = { #member, TT_STRING | pr, (len) }, | ||
80 | #include "drbd_nl.h" | ||
81 | }; | ||
82 | |||
83 | #endif | ||
diff --git a/include/linux/errqueue.h b/include/linux/errqueue.h index ec12cc74366f..034072cea853 100644 --- a/include/linux/errqueue.h +++ b/include/linux/errqueue.h | |||
@@ -3,8 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | 5 | ||
6 | struct sock_extended_err | 6 | struct sock_extended_err { |
7 | { | ||
8 | __u32 ee_errno; | 7 | __u32 ee_errno; |
9 | __u8 ee_origin; | 8 | __u8 ee_origin; |
10 | __u8 ee_type; | 9 | __u8 ee_type; |
@@ -31,8 +30,7 @@ struct sock_extended_err | |||
31 | 30 | ||
32 | #define SKB_EXT_ERR(skb) ((struct sock_exterr_skb *) ((skb)->cb)) | 31 | #define SKB_EXT_ERR(skb) ((struct sock_exterr_skb *) ((skb)->cb)) |
33 | 32 | ||
34 | struct sock_exterr_skb | 33 | struct sock_exterr_skb { |
35 | { | ||
36 | union { | 34 | union { |
37 | struct inet_skb_parm h4; | 35 | struct inet_skb_parm h4; |
38 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 36 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) |
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h index 15e4eb713694..ef4a2d84d922 100644 --- a/include/linux/ethtool.h +++ b/include/linux/ethtool.h | |||
@@ -49,13 +49,14 @@ static inline __u32 ethtool_cmd_speed(struct ethtool_cmd *ep) | |||
49 | return (ep->speed_hi << 16) | ep->speed; | 49 | return (ep->speed_hi << 16) | ep->speed; |
50 | } | 50 | } |
51 | 51 | ||
52 | #define ETHTOOL_FWVERS_LEN 32 | ||
52 | #define ETHTOOL_BUSINFO_LEN 32 | 53 | #define ETHTOOL_BUSINFO_LEN 32 |
53 | /* these strings are set to whatever the driver author decides... */ | 54 | /* these strings are set to whatever the driver author decides... */ |
54 | struct ethtool_drvinfo { | 55 | struct ethtool_drvinfo { |
55 | __u32 cmd; | 56 | __u32 cmd; |
56 | char driver[32]; /* driver short name, "tulip", "eepro100" */ | 57 | char driver[32]; /* driver short name, "tulip", "eepro100" */ |
57 | char version[32]; /* driver version string */ | 58 | char version[32]; /* driver version string */ |
58 | char fw_version[32]; /* firmware version string, if applicable */ | 59 | char fw_version[ETHTOOL_FWVERS_LEN]; /* firmware version string */ |
59 | char bus_info[ETHTOOL_BUSINFO_LEN]; /* Bus info for this IF. */ | 60 | char bus_info[ETHTOOL_BUSINFO_LEN]; /* Bus info for this IF. */ |
60 | /* For PCI devices, use pci_name(pci_dev). */ | 61 | /* For PCI devices, use pci_name(pci_dev). */ |
61 | char reserved1[32]; | 62 | char reserved1[32]; |
@@ -495,13 +496,10 @@ struct ethtool_ops { | |||
495 | u32 (*get_priv_flags)(struct net_device *); | 496 | u32 (*get_priv_flags)(struct net_device *); |
496 | int (*set_priv_flags)(struct net_device *, u32); | 497 | int (*set_priv_flags)(struct net_device *, u32); |
497 | int (*get_sset_count)(struct net_device *, int); | 498 | int (*get_sset_count)(struct net_device *, int); |
498 | |||
499 | /* the following hooks are obsolete */ | ||
500 | int (*self_test_count)(struct net_device *);/* use get_sset_count */ | ||
501 | int (*get_stats_count)(struct net_device *);/* use get_sset_count */ | ||
502 | int (*get_rxnfc)(struct net_device *, struct ethtool_rxnfc *, void *); | 499 | int (*get_rxnfc)(struct net_device *, struct ethtool_rxnfc *, void *); |
503 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); | 500 | int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); |
504 | int (*flash_device)(struct net_device *, struct ethtool_flash *); | 501 | int (*flash_device)(struct net_device *, struct ethtool_flash *); |
502 | int (*reset)(struct net_device *, u32 *); | ||
505 | }; | 503 | }; |
506 | #endif /* __KERNEL__ */ | 504 | #endif /* __KERNEL__ */ |
507 | 505 | ||
@@ -559,6 +557,7 @@ struct ethtool_ops { | |||
559 | #define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */ | 557 | #define ETHTOOL_SRXCLSRLDEL 0x00000031 /* Delete RX classification rule */ |
560 | #define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */ | 558 | #define ETHTOOL_SRXCLSRLINS 0x00000032 /* Insert RX classification rule */ |
561 | #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ | 559 | #define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ |
560 | #define ETHTOOL_RESET 0x00000034 /* Reset hardware */ | ||
562 | 561 | ||
563 | /* compatibility with older code */ | 562 | /* compatibility with older code */ |
564 | #define SPARC_ETH_GSET ETHTOOL_GSET | 563 | #define SPARC_ETH_GSET ETHTOOL_GSET |
@@ -633,6 +632,8 @@ struct ethtool_ops { | |||
633 | #define PORT_MII 0x02 | 632 | #define PORT_MII 0x02 |
634 | #define PORT_FIBRE 0x03 | 633 | #define PORT_FIBRE 0x03 |
635 | #define PORT_BNC 0x04 | 634 | #define PORT_BNC 0x04 |
635 | #define PORT_DA 0x05 | ||
636 | #define PORT_NONE 0xef | ||
636 | #define PORT_OTHER 0xff | 637 | #define PORT_OTHER 0xff |
637 | 638 | ||
638 | /* Which transceiver to use. */ | 639 | /* Which transceiver to use. */ |
@@ -676,6 +677,8 @@ struct ethtool_ops { | |||
676 | #define AH_V6_FLOW 0x0b | 677 | #define AH_V6_FLOW 0x0b |
677 | #define ESP_V6_FLOW 0x0c | 678 | #define ESP_V6_FLOW 0x0c |
678 | #define IP_USER_FLOW 0x0d | 679 | #define IP_USER_FLOW 0x0d |
680 | #define IPV4_FLOW 0x10 | ||
681 | #define IPV6_FLOW 0x11 | ||
679 | 682 | ||
680 | /* L3-L4 network traffic flow hash options */ | 683 | /* L3-L4 network traffic flow hash options */ |
681 | #define RXH_L2DA (1 << 1) | 684 | #define RXH_L2DA (1 << 1) |
@@ -689,4 +692,34 @@ struct ethtool_ops { | |||
689 | 692 | ||
690 | #define RX_CLS_FLOW_DISC 0xffffffffffffffffULL | 693 | #define RX_CLS_FLOW_DISC 0xffffffffffffffffULL |
691 | 694 | ||
695 | /* Reset flags */ | ||
696 | /* The reset() operation must clear the flags for the components which | ||
697 | * were actually reset. On successful return, the flags indicate the | ||
698 | * components which were not reset, either because they do not exist | ||
699 | * in the hardware or because they cannot be reset independently. The | ||
700 | * driver must never reset any components that were not requested. | ||
701 | */ | ||
702 | enum ethtool_reset_flags { | ||
703 | /* These flags represent components dedicated to the interface | ||
704 | * the command is addressed to. Shift any flag left by | ||
705 | * ETH_RESET_SHARED_SHIFT to reset a shared component of the | ||
706 | * same type. | ||
707 | */ | ||
708 | ETH_RESET_MGMT = 1 << 0, /* Management processor */ | ||
709 | ETH_RESET_IRQ = 1 << 1, /* Interrupt requester */ | ||
710 | ETH_RESET_DMA = 1 << 2, /* DMA engine */ | ||
711 | ETH_RESET_FILTER = 1 << 3, /* Filtering/flow direction */ | ||
712 | ETH_RESET_OFFLOAD = 1 << 4, /* Protocol offload */ | ||
713 | ETH_RESET_MAC = 1 << 5, /* Media access controller */ | ||
714 | ETH_RESET_PHY = 1 << 6, /* Transceiver/PHY */ | ||
715 | ETH_RESET_RAM = 1 << 7, /* RAM shared between | ||
716 | * multiple components */ | ||
717 | |||
718 | ETH_RESET_DEDICATED = 0x0000ffff, /* All components dedicated to | ||
719 | * this interface */ | ||
720 | ETH_RESET_ALL = 0xffffffff, /* All components used by this | ||
721 | * interface, even if shared */ | ||
722 | }; | ||
723 | #define ETH_RESET_SHARED_SHIFT 16 | ||
724 | |||
692 | #endif /* _LINUX_ETHTOOL_H */ | 725 | #endif /* _LINUX_ETHTOOL_H */ |
diff --git a/include/linux/fb.h b/include/linux/fb.h index de9c722e7b90..369767bd873e 100644 --- a/include/linux/fb.h +++ b/include/linux/fb.h | |||
@@ -763,6 +763,7 @@ struct fb_tile_ops { | |||
763 | * takes over; acceleration engine should be in a quiescent state */ | 763 | * takes over; acceleration engine should be in a quiescent state */ |
764 | 764 | ||
765 | /* hints */ | 765 | /* hints */ |
766 | #define FBINFO_VIRTFB 0x0004 /* FB is System RAM, not device. */ | ||
766 | #define FBINFO_PARTIAL_PAN_OK 0x0040 /* otw use pan only for double-buffering */ | 767 | #define FBINFO_PARTIAL_PAN_OK 0x0040 /* otw use pan only for double-buffering */ |
767 | #define FBINFO_READS_FAST 0x0080 /* soft-copy faster than rendering */ | 768 | #define FBINFO_READS_FAST 0x0080 /* soft-copy faster than rendering */ |
768 | 769 | ||
diff --git a/include/linux/fib_rules.h b/include/linux/fib_rules.h index 87b606b63f1e..51da65b68b85 100644 --- a/include/linux/fib_rules.h +++ b/include/linux/fib_rules.h | |||
@@ -8,13 +8,14 @@ | |||
8 | #define FIB_RULE_PERMANENT 0x00000001 | 8 | #define FIB_RULE_PERMANENT 0x00000001 |
9 | #define FIB_RULE_INVERT 0x00000002 | 9 | #define FIB_RULE_INVERT 0x00000002 |
10 | #define FIB_RULE_UNRESOLVED 0x00000004 | 10 | #define FIB_RULE_UNRESOLVED 0x00000004 |
11 | #define FIB_RULE_DEV_DETACHED 0x00000008 | 11 | #define FIB_RULE_IIF_DETACHED 0x00000008 |
12 | #define FIB_RULE_DEV_DETACHED FIB_RULE_IIF_DETACHED | ||
13 | #define FIB_RULE_OIF_DETACHED 0x00000010 | ||
12 | 14 | ||
13 | /* try to find source address in routing lookups */ | 15 | /* try to find source address in routing lookups */ |
14 | #define FIB_RULE_FIND_SADDR 0x00010000 | 16 | #define FIB_RULE_FIND_SADDR 0x00010000 |
15 | 17 | ||
16 | struct fib_rule_hdr | 18 | struct fib_rule_hdr { |
17 | { | ||
18 | __u8 family; | 19 | __u8 family; |
19 | __u8 dst_len; | 20 | __u8 dst_len; |
20 | __u8 src_len; | 21 | __u8 src_len; |
@@ -28,12 +29,12 @@ struct fib_rule_hdr | |||
28 | __u32 flags; | 29 | __u32 flags; |
29 | }; | 30 | }; |
30 | 31 | ||
31 | enum | 32 | enum { |
32 | { | ||
33 | FRA_UNSPEC, | 33 | FRA_UNSPEC, |
34 | FRA_DST, /* destination address */ | 34 | FRA_DST, /* destination address */ |
35 | FRA_SRC, /* source address */ | 35 | FRA_SRC, /* source address */ |
36 | FRA_IFNAME, /* interface name */ | 36 | FRA_IIFNAME, /* interface name */ |
37 | #define FRA_IFNAME FRA_IIFNAME | ||
37 | FRA_GOTO, /* target to jump to (FR_ACT_GOTO) */ | 38 | FRA_GOTO, /* target to jump to (FR_ACT_GOTO) */ |
38 | FRA_UNUSED2, | 39 | FRA_UNUSED2, |
39 | FRA_PRIORITY, /* priority/preference */ | 40 | FRA_PRIORITY, /* priority/preference */ |
@@ -47,13 +48,13 @@ enum | |||
47 | FRA_UNUSED8, | 48 | FRA_UNUSED8, |
48 | FRA_TABLE, /* Extended table id */ | 49 | FRA_TABLE, /* Extended table id */ |
49 | FRA_FWMASK, /* mask for netfilter mark */ | 50 | FRA_FWMASK, /* mask for netfilter mark */ |
51 | FRA_OIFNAME, | ||
50 | __FRA_MAX | 52 | __FRA_MAX |
51 | }; | 53 | }; |
52 | 54 | ||
53 | #define FRA_MAX (__FRA_MAX - 1) | 55 | #define FRA_MAX (__FRA_MAX - 1) |
54 | 56 | ||
55 | enum | 57 | enum { |
56 | { | ||
57 | FR_ACT_UNSPEC, | 58 | FR_ACT_UNSPEC, |
58 | FR_ACT_TO_TBL, /* Pass to fixed table */ | 59 | FR_ACT_TO_TBL, /* Pass to fixed table */ |
59 | FR_ACT_GOTO, /* Jump to another rule */ | 60 | FR_ACT_GOTO, /* Jump to another rule */ |
diff --git a/include/linux/filter.h b/include/linux/filter.h index 1354aaf6abbe..29a0e3db9f43 100644 --- a/include/linux/filter.h +++ b/include/linux/filter.h | |||
@@ -23,16 +23,14 @@ | |||
23 | * the BPF code definitions which need to match so you can share filters | 23 | * the BPF code definitions which need to match so you can share filters |
24 | */ | 24 | */ |
25 | 25 | ||
26 | struct sock_filter /* Filter block */ | 26 | struct sock_filter { /* Filter block */ |
27 | { | ||
28 | __u16 code; /* Actual filter code */ | 27 | __u16 code; /* Actual filter code */ |
29 | __u8 jt; /* Jump true */ | 28 | __u8 jt; /* Jump true */ |
30 | __u8 jf; /* Jump false */ | 29 | __u8 jf; /* Jump false */ |
31 | __u32 k; /* Generic multiuse field */ | 30 | __u32 k; /* Generic multiuse field */ |
32 | }; | 31 | }; |
33 | 32 | ||
34 | struct sock_fprog /* Required for SO_ATTACH_FILTER. */ | 33 | struct sock_fprog { /* Required for SO_ATTACH_FILTER. */ |
35 | { | ||
36 | unsigned short len; /* Number of filter blocks */ | 34 | unsigned short len; /* Number of filter blocks */ |
37 | struct sock_filter __user *filter; | 35 | struct sock_filter __user *filter; |
38 | }; | 36 | }; |
@@ -123,7 +121,9 @@ struct sock_fprog /* Required for SO_ATTACH_FILTER. */ | |||
123 | #define SKF_AD_IFINDEX 8 | 121 | #define SKF_AD_IFINDEX 8 |
124 | #define SKF_AD_NLATTR 12 | 122 | #define SKF_AD_NLATTR 12 |
125 | #define SKF_AD_NLATTR_NEST 16 | 123 | #define SKF_AD_NLATTR_NEST 16 |
126 | #define SKF_AD_MAX 20 | 124 | #define SKF_AD_MARK 20 |
125 | #define SKF_AD_QUEUE 24 | ||
126 | #define SKF_AD_MAX 28 | ||
127 | #define SKF_NET_OFF (-0x100000) | 127 | #define SKF_NET_OFF (-0x100000) |
128 | #define SKF_LL_OFF (-0x200000) | 128 | #define SKF_LL_OFF (-0x200000) |
129 | 129 | ||
diff --git a/include/linux/firewire.h b/include/linux/firewire.h index 7e1d4dec83e7..9416a461b696 100644 --- a/include/linux/firewire.h +++ b/include/linux/firewire.h | |||
@@ -20,20 +20,6 @@ | |||
20 | #define fw_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, ## args) | 20 | #define fw_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, ## args) |
21 | #define fw_error(s, args...) printk(KERN_ERR KBUILD_MODNAME ": " s, ## args) | 21 | #define fw_error(s, args...) printk(KERN_ERR KBUILD_MODNAME ": " s, ## args) |
22 | 22 | ||
23 | static inline void fw_memcpy_from_be32(void *_dst, void *_src, size_t size) | ||
24 | { | ||
25 | u32 *dst = _dst; | ||
26 | __be32 *src = _src; | ||
27 | int i; | ||
28 | |||
29 | for (i = 0; i < size / 4; i++) | ||
30 | dst[i] = be32_to_cpu(src[i]); | ||
31 | } | ||
32 | |||
33 | static inline void fw_memcpy_to_be32(void *_dst, void *_src, size_t size) | ||
34 | { | ||
35 | fw_memcpy_from_be32(_dst, _src, size); | ||
36 | } | ||
37 | #define CSR_REGISTER_BASE 0xfffff0000000ULL | 23 | #define CSR_REGISTER_BASE 0xfffff0000000ULL |
38 | 24 | ||
39 | /* register offsets are relative to CSR_REGISTER_BASE */ | 25 | /* register offsets are relative to CSR_REGISTER_BASE */ |
@@ -131,7 +117,7 @@ struct fw_card { | |||
131 | 117 | ||
132 | bool broadcast_channel_allocated; | 118 | bool broadcast_channel_allocated; |
133 | u32 broadcast_channel; | 119 | u32 broadcast_channel; |
134 | u32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4]; | 120 | __be32 topology_map[(CSR_TOPOLOGY_MAP_END - CSR_TOPOLOGY_MAP) / 4]; |
135 | }; | 121 | }; |
136 | 122 | ||
137 | struct fw_attribute_group { | 123 | struct fw_attribute_group { |
@@ -281,6 +267,7 @@ struct fw_packet { | |||
281 | void *payload; | 267 | void *payload; |
282 | size_t payload_length; | 268 | size_t payload_length; |
283 | dma_addr_t payload_bus; | 269 | dma_addr_t payload_bus; |
270 | bool payload_mapped; | ||
284 | u32 timestamp; | 271 | u32 timestamp; |
285 | 272 | ||
286 | /* | 273 | /* |
diff --git a/include/linux/firmware.h b/include/linux/firmware.h index d31544628436..043811f0d277 100644 --- a/include/linux/firmware.h +++ b/include/linux/firmware.h | |||
@@ -4,6 +4,7 @@ | |||
4 | #include <linux/module.h> | 4 | #include <linux/module.h> |
5 | #include <linux/types.h> | 5 | #include <linux/types.h> |
6 | #include <linux/compiler.h> | 6 | #include <linux/compiler.h> |
7 | #include <linux/gfp.h> | ||
7 | 8 | ||
8 | #define FW_ACTION_NOHOTPLUG 0 | 9 | #define FW_ACTION_NOHOTPLUG 0 |
9 | #define FW_ACTION_HOTPLUG 1 | 10 | #define FW_ACTION_HOTPLUG 1 |
@@ -38,7 +39,7 @@ int request_firmware(const struct firmware **fw, const char *name, | |||
38 | struct device *device); | 39 | struct device *device); |
39 | int request_firmware_nowait( | 40 | int request_firmware_nowait( |
40 | struct module *module, int uevent, | 41 | struct module *module, int uevent, |
41 | const char *name, struct device *device, void *context, | 42 | const char *name, struct device *device, gfp_t gfp, void *context, |
42 | void (*cont)(const struct firmware *fw, void *context)); | 43 | void (*cont)(const struct firmware *fw, void *context)); |
43 | 44 | ||
44 | void release_firmware(const struct firmware *fw); | 45 | void release_firmware(const struct firmware *fw); |
@@ -51,7 +52,7 @@ static inline int request_firmware(const struct firmware **fw, | |||
51 | } | 52 | } |
52 | static inline int request_firmware_nowait( | 53 | static inline int request_firmware_nowait( |
53 | struct module *module, int uevent, | 54 | struct module *module, int uevent, |
54 | const char *name, struct device *device, void *context, | 55 | const char *name, struct device *device, gfp_t gfp, void *context, |
55 | void (*cont)(const struct firmware *fw, void *context)) | 56 | void (*cont)(const struct firmware *fw, void *context)) |
56 | { | 57 | { |
57 | return -EINVAL; | 58 | return -EINVAL; |
diff --git a/include/linux/fs.h b/include/linux/fs.h index 2620a8c63571..891f7d642e5c 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -129,7 +129,7 @@ struct inodes_stat_t { | |||
129 | * WRITE_SYNC Like WRITE_SYNC_PLUG, but also unplugs the device | 129 | * WRITE_SYNC Like WRITE_SYNC_PLUG, but also unplugs the device |
130 | * immediately after submission. The write equivalent | 130 | * immediately after submission. The write equivalent |
131 | * of READ_SYNC. | 131 | * of READ_SYNC. |
132 | * WRITE_ODIRECT Special case write for O_DIRECT only. | 132 | * WRITE_ODIRECT_PLUG Special case write for O_DIRECT only. |
133 | * SWRITE_SYNC | 133 | * SWRITE_SYNC |
134 | * SWRITE_SYNC_PLUG Like WRITE_SYNC/WRITE_SYNC_PLUG, but locks the buffer. | 134 | * SWRITE_SYNC_PLUG Like WRITE_SYNC/WRITE_SYNC_PLUG, but locks the buffer. |
135 | * See SWRITE. | 135 | * See SWRITE. |
@@ -151,7 +151,7 @@ struct inodes_stat_t { | |||
151 | #define READ_META (READ | (1 << BIO_RW_META)) | 151 | #define READ_META (READ | (1 << BIO_RW_META)) |
152 | #define WRITE_SYNC_PLUG (WRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE)) | 152 | #define WRITE_SYNC_PLUG (WRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE)) |
153 | #define WRITE_SYNC (WRITE_SYNC_PLUG | (1 << BIO_RW_UNPLUG)) | 153 | #define WRITE_SYNC (WRITE_SYNC_PLUG | (1 << BIO_RW_UNPLUG)) |
154 | #define WRITE_ODIRECT (WRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_UNPLUG)) | 154 | #define WRITE_ODIRECT_PLUG (WRITE | (1 << BIO_RW_SYNCIO)) |
155 | #define SWRITE_SYNC_PLUG \ | 155 | #define SWRITE_SYNC_PLUG \ |
156 | (SWRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE)) | 156 | (SWRITE | (1 << BIO_RW_SYNCIO) | (1 << BIO_RW_NOIDLE)) |
157 | #define SWRITE_SYNC (SWRITE_SYNC_PLUG | (1 << BIO_RW_UNPLUG)) | 157 | #define SWRITE_SYNC (SWRITE_SYNC_PLUG | (1 << BIO_RW_UNPLUG)) |
@@ -304,6 +304,7 @@ struct inodes_stat_t { | |||
304 | #define BLKIOOPT _IO(0x12,121) | 304 | #define BLKIOOPT _IO(0x12,121) |
305 | #define BLKALIGNOFF _IO(0x12,122) | 305 | #define BLKALIGNOFF _IO(0x12,122) |
306 | #define BLKPBSZGET _IO(0x12,123) | 306 | #define BLKPBSZGET _IO(0x12,123) |
307 | #define BLKDISCARDZEROES _IO(0x12,124) | ||
307 | 308 | ||
308 | #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ | 309 | #define BMAP_IOCTL 1 /* obsolete - kept for compatibility */ |
309 | #define FIBMAP _IO(0x00,1) /* bmap access */ | 310 | #define FIBMAP _IO(0x00,1) /* bmap access */ |
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h index 4ec5e67e18cf..47bbdf9c38d0 100644 --- a/include/linux/ftrace_event.h +++ b/include/linux/ftrace_event.h | |||
@@ -117,12 +117,12 @@ struct ftrace_event_call { | |||
117 | struct dentry *dir; | 117 | struct dentry *dir; |
118 | struct trace_event *event; | 118 | struct trace_event *event; |
119 | int enabled; | 119 | int enabled; |
120 | int (*regfunc)(void *); | 120 | int (*regfunc)(struct ftrace_event_call *); |
121 | void (*unregfunc)(void *); | 121 | void (*unregfunc)(struct ftrace_event_call *); |
122 | int id; | 122 | int id; |
123 | int (*raw_init)(void); | 123 | int (*raw_init)(struct ftrace_event_call *); |
124 | int (*show_format)(struct ftrace_event_call *call, | 124 | int (*show_format)(struct ftrace_event_call *, |
125 | struct trace_seq *s); | 125 | struct trace_seq *); |
126 | int (*define_fields)(struct ftrace_event_call *); | 126 | int (*define_fields)(struct ftrace_event_call *); |
127 | struct list_head fields; | 127 | struct list_head fields; |
128 | int filter_active; | 128 | int filter_active; |
@@ -131,20 +131,20 @@ struct ftrace_event_call { | |||
131 | void *data; | 131 | void *data; |
132 | 132 | ||
133 | atomic_t profile_count; | 133 | atomic_t profile_count; |
134 | int (*profile_enable)(void); | 134 | int (*profile_enable)(struct ftrace_event_call *); |
135 | void (*profile_disable)(void); | 135 | void (*profile_disable)(struct ftrace_event_call *); |
136 | }; | 136 | }; |
137 | 137 | ||
138 | #define FTRACE_MAX_PROFILE_SIZE 2048 | 138 | #define FTRACE_MAX_PROFILE_SIZE 2048 |
139 | 139 | ||
140 | extern char *trace_profile_buf; | 140 | extern char *perf_trace_buf; |
141 | extern char *trace_profile_buf_nmi; | 141 | extern char *perf_trace_buf_nmi; |
142 | 142 | ||
143 | #define MAX_FILTER_PRED 32 | 143 | #define MAX_FILTER_PRED 32 |
144 | #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ | 144 | #define MAX_FILTER_STR_VAL 256 /* Should handle KSYM_SYMBOL_LEN */ |
145 | 145 | ||
146 | extern void destroy_preds(struct ftrace_event_call *call); | 146 | extern void destroy_preds(struct ftrace_event_call *call); |
147 | extern int filter_match_preds(struct ftrace_event_call *call, void *rec); | 147 | extern int filter_match_preds(struct event_filter *filter, void *rec); |
148 | extern int filter_current_check_discard(struct ring_buffer *buffer, | 148 | extern int filter_current_check_discard(struct ring_buffer *buffer, |
149 | struct ftrace_event_call *call, | 149 | struct ftrace_event_call *call, |
150 | void *rec, | 150 | void *rec, |
@@ -157,11 +157,12 @@ enum { | |||
157 | FILTER_PTR_STRING, | 157 | FILTER_PTR_STRING, |
158 | }; | 158 | }; |
159 | 159 | ||
160 | extern int trace_define_field(struct ftrace_event_call *call, | ||
161 | const char *type, const char *name, | ||
162 | int offset, int size, int is_signed, | ||
163 | int filter_type); | ||
164 | extern int trace_define_common_fields(struct ftrace_event_call *call); | 160 | extern int trace_define_common_fields(struct ftrace_event_call *call); |
161 | extern int trace_define_field(struct ftrace_event_call *call, const char *type, | ||
162 | const char *name, int offset, int size, | ||
163 | int is_signed, int filter_type); | ||
164 | extern int trace_add_event_call(struct ftrace_event_call *call); | ||
165 | extern void trace_remove_event_call(struct ftrace_event_call *call); | ||
165 | 166 | ||
166 | #define is_signed_type(type) (((type)(-1)) < 0) | 167 | #define is_signed_type(type) (((type)(-1)) < 0) |
167 | 168 | ||
@@ -186,4 +187,13 @@ do { \ | |||
186 | __trace_printk(ip, fmt, ##args); \ | 187 | __trace_printk(ip, fmt, ##args); \ |
187 | } while (0) | 188 | } while (0) |
188 | 189 | ||
190 | #ifdef CONFIG_EVENT_PROFILE | ||
191 | struct perf_event; | ||
192 | extern int ftrace_profile_enable(int event_id); | ||
193 | extern void ftrace_profile_disable(int event_id); | ||
194 | extern int ftrace_profile_set_filter(struct perf_event *event, int event_id, | ||
195 | char *filter_str); | ||
196 | extern void ftrace_profile_free_filter(struct perf_event *event); | ||
197 | #endif | ||
198 | |||
189 | #endif /* _LINUX_FTRACE_EVENT_H */ | 199 | #endif /* _LINUX_FTRACE_EVENT_H */ |
diff --git a/include/linux/gen_stats.h b/include/linux/gen_stats.h index 710e901085d0..552c8a0a12d1 100644 --- a/include/linux/gen_stats.h +++ b/include/linux/gen_stats.h | |||
@@ -18,13 +18,11 @@ enum { | |||
18 | * @bytes: number of seen bytes | 18 | * @bytes: number of seen bytes |
19 | * @packets: number of seen packets | 19 | * @packets: number of seen packets |
20 | */ | 20 | */ |
21 | struct gnet_stats_basic | 21 | struct gnet_stats_basic { |
22 | { | ||
23 | __u64 bytes; | 22 | __u64 bytes; |
24 | __u32 packets; | 23 | __u32 packets; |
25 | }; | 24 | }; |
26 | struct gnet_stats_basic_packed | 25 | struct gnet_stats_basic_packed { |
27 | { | ||
28 | __u64 bytes; | 26 | __u64 bytes; |
29 | __u32 packets; | 27 | __u32 packets; |
30 | } __attribute__ ((packed)); | 28 | } __attribute__ ((packed)); |
@@ -34,8 +32,7 @@ struct gnet_stats_basic_packed | |||
34 | * @bps: current byte rate | 32 | * @bps: current byte rate |
35 | * @pps: current packet rate | 33 | * @pps: current packet rate |
36 | */ | 34 | */ |
37 | struct gnet_stats_rate_est | 35 | struct gnet_stats_rate_est { |
38 | { | ||
39 | __u32 bps; | 36 | __u32 bps; |
40 | __u32 pps; | 37 | __u32 pps; |
41 | }; | 38 | }; |
@@ -48,8 +45,7 @@ struct gnet_stats_rate_est | |||
48 | * @requeues: number of requeues | 45 | * @requeues: number of requeues |
49 | * @overlimits: number of enqueues over the limit | 46 | * @overlimits: number of enqueues over the limit |
50 | */ | 47 | */ |
51 | struct gnet_stats_queue | 48 | struct gnet_stats_queue { |
52 | { | ||
53 | __u32 qlen; | 49 | __u32 qlen; |
54 | __u32 backlog; | 50 | __u32 backlog; |
55 | __u32 drops; | 51 | __u32 drops; |
@@ -62,8 +58,7 @@ struct gnet_stats_queue | |||
62 | * @interval: sampling period | 58 | * @interval: sampling period |
63 | * @ewma_log: the log of measurement window weight | 59 | * @ewma_log: the log of measurement window weight |
64 | */ | 60 | */ |
65 | struct gnet_estimator | 61 | struct gnet_estimator { |
66 | { | ||
67 | signed char interval; | 62 | signed char interval; |
68 | unsigned char ewma_log; | 63 | unsigned char ewma_log; |
69 | }; | 64 | }; |
diff --git a/include/linux/genhd.h b/include/linux/genhd.h index 297df45ffd0a..c6c0c41af35f 100644 --- a/include/linux/genhd.h +++ b/include/linux/genhd.h | |||
@@ -91,6 +91,7 @@ struct hd_struct { | |||
91 | sector_t start_sect; | 91 | sector_t start_sect; |
92 | sector_t nr_sects; | 92 | sector_t nr_sects; |
93 | sector_t alignment_offset; | 93 | sector_t alignment_offset; |
94 | unsigned int discard_alignment; | ||
94 | struct device __dev; | 95 | struct device __dev; |
95 | struct kobject *holder_dir; | 96 | struct kobject *holder_dir; |
96 | int policy, partno; | 97 | int policy, partno; |
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h index b80c88dedbbb..81f90a59cda6 100644 --- a/include/linux/gfs2_ondisk.h +++ b/include/linux/gfs2_ondisk.h | |||
@@ -81,7 +81,11 @@ struct gfs2_meta_header { | |||
81 | __be32 mh_type; | 81 | __be32 mh_type; |
82 | __be64 __pad0; /* Was generation number in gfs1 */ | 82 | __be64 __pad0; /* Was generation number in gfs1 */ |
83 | __be32 mh_format; | 83 | __be32 mh_format; |
84 | __be32 __pad1; /* Was incarnation number in gfs1 */ | 84 | /* This union is to keep userspace happy */ |
85 | union { | ||
86 | __be32 mh_jid; /* Was incarnation number in gfs1 */ | ||
87 | __be32 __pad1; | ||
88 | }; | ||
85 | }; | 89 | }; |
86 | 90 | ||
87 | /* | 91 | /* |
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h index 6d527ee82b2b..d5b387669dab 100644 --- a/include/linux/hardirq.h +++ b/include/linux/hardirq.h | |||
@@ -139,10 +139,34 @@ static inline void account_system_vtime(struct task_struct *tsk) | |||
139 | #endif | 139 | #endif |
140 | 140 | ||
141 | #if defined(CONFIG_NO_HZ) | 141 | #if defined(CONFIG_NO_HZ) |
142 | #if defined(CONFIG_TINY_RCU) | ||
143 | extern void rcu_enter_nohz(void); | ||
144 | extern void rcu_exit_nohz(void); | ||
145 | |||
146 | static inline void rcu_irq_enter(void) | ||
147 | { | ||
148 | rcu_exit_nohz(); | ||
149 | } | ||
150 | |||
151 | static inline void rcu_irq_exit(void) | ||
152 | { | ||
153 | rcu_enter_nohz(); | ||
154 | } | ||
155 | |||
156 | static inline void rcu_nmi_enter(void) | ||
157 | { | ||
158 | } | ||
159 | |||
160 | static inline void rcu_nmi_exit(void) | ||
161 | { | ||
162 | } | ||
163 | |||
164 | #else | ||
142 | extern void rcu_irq_enter(void); | 165 | extern void rcu_irq_enter(void); |
143 | extern void rcu_irq_exit(void); | 166 | extern void rcu_irq_exit(void); |
144 | extern void rcu_nmi_enter(void); | 167 | extern void rcu_nmi_enter(void); |
145 | extern void rcu_nmi_exit(void); | 168 | extern void rcu_nmi_exit(void); |
169 | #endif | ||
146 | #else | 170 | #else |
147 | # define rcu_irq_enter() do { } while (0) | 171 | # define rcu_irq_enter() do { } while (0) |
148 | # define rcu_irq_exit() do { } while (0) | 172 | # define rcu_irq_exit() do { } while (0) |
diff --git a/include/linux/hid.h b/include/linux/hid.h index 10f628416740..87093652dda8 100644 --- a/include/linux/hid.h +++ b/include/linux/hid.h | |||
@@ -312,6 +312,7 @@ struct hid_item { | |||
312 | #define HID_QUIRK_MULTI_INPUT 0x00000040 | 312 | #define HID_QUIRK_MULTI_INPUT 0x00000040 |
313 | #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 | 313 | #define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 |
314 | #define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 | 314 | #define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 |
315 | #define HID_QUIRK_NO_INIT_REPORTS 0x20000000 | ||
315 | 316 | ||
316 | /* | 317 | /* |
317 | * This is the global environment of the parser. This information is | 318 | * This is the global environment of the parser. This information is |
diff --git a/include/linux/hpet.h b/include/linux/hpet.h index 79f63a27bcef..219ca4f6bea6 100644 --- a/include/linux/hpet.h +++ b/include/linux/hpet.h | |||
@@ -126,4 +126,6 @@ struct hpet_info { | |||
126 | #define HPET_DPI _IO('h', 0x05) /* disable periodic */ | 126 | #define HPET_DPI _IO('h', 0x05) /* disable periodic */ |
127 | #define HPET_IRQFREQ _IOW('h', 0x6, unsigned long) /* IRQFREQ usec */ | 127 | #define HPET_IRQFREQ _IOW('h', 0x6, unsigned long) /* IRQFREQ usec */ |
128 | 128 | ||
129 | #define MAX_HPET_TBS 8 /* maximum hpet timer blocks */ | ||
130 | |||
129 | #endif /* !__HPET__ */ | 131 | #endif /* !__HPET__ */ |
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h index ff037f0b1b4e..9bace4b9f4fe 100644 --- a/include/linux/hrtimer.h +++ b/include/linux/hrtimer.h | |||
@@ -446,7 +446,7 @@ extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf, | |||
446 | 446 | ||
447 | static inline void timer_stats_account_hrtimer(struct hrtimer *timer) | 447 | static inline void timer_stats_account_hrtimer(struct hrtimer *timer) |
448 | { | 448 | { |
449 | if (likely(!timer->start_site)) | 449 | if (likely(!timer_stats_active)) |
450 | return; | 450 | return; |
451 | timer_stats_update_stats(timer, timer->start_pid, timer->start_site, | 451 | timer_stats_update_stats(timer, timer->start_pid, timer->start_site, |
452 | timer->function, timer->start_comm, 0); | 452 | timer->function, timer->start_comm, 0); |
@@ -457,8 +457,6 @@ extern void __timer_stats_hrtimer_set_start_info(struct hrtimer *timer, | |||
457 | 457 | ||
458 | static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer) | 458 | static inline void timer_stats_hrtimer_set_start_info(struct hrtimer *timer) |
459 | { | 459 | { |
460 | if (likely(!timer_stats_active)) | ||
461 | return; | ||
462 | __timer_stats_hrtimer_set_start_info(timer, __builtin_return_address(0)); | 460 | __timer_stats_hrtimer_set_start_info(timer, __builtin_return_address(0)); |
463 | } | 461 | } |
464 | 462 | ||
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h new file mode 100644 index 000000000000..a03daed08c59 --- /dev/null +++ b/include/linux/hw_breakpoint.h | |||
@@ -0,0 +1,131 @@ | |||
1 | #ifndef _LINUX_HW_BREAKPOINT_H | ||
2 | #define _LINUX_HW_BREAKPOINT_H | ||
3 | |||
4 | enum { | ||
5 | HW_BREAKPOINT_LEN_1 = 1, | ||
6 | HW_BREAKPOINT_LEN_2 = 2, | ||
7 | HW_BREAKPOINT_LEN_4 = 4, | ||
8 | HW_BREAKPOINT_LEN_8 = 8, | ||
9 | }; | ||
10 | |||
11 | enum { | ||
12 | HW_BREAKPOINT_R = 1, | ||
13 | HW_BREAKPOINT_W = 2, | ||
14 | HW_BREAKPOINT_X = 4, | ||
15 | }; | ||
16 | |||
17 | #ifdef __KERNEL__ | ||
18 | |||
19 | #include <linux/perf_event.h> | ||
20 | |||
21 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | ||
22 | |||
23 | /* As it's for in-kernel or ptrace use, we want it to be pinned */ | ||
24 | #define DEFINE_BREAKPOINT_ATTR(name) \ | ||
25 | struct perf_event_attr name = { \ | ||
26 | .type = PERF_TYPE_BREAKPOINT, \ | ||
27 | .size = sizeof(name), \ | ||
28 | .pinned = 1, \ | ||
29 | }; | ||
30 | |||
31 | static inline void hw_breakpoint_init(struct perf_event_attr *attr) | ||
32 | { | ||
33 | attr->type = PERF_TYPE_BREAKPOINT; | ||
34 | attr->size = sizeof(*attr); | ||
35 | attr->pinned = 1; | ||
36 | } | ||
37 | |||
38 | static inline unsigned long hw_breakpoint_addr(struct perf_event *bp) | ||
39 | { | ||
40 | return bp->attr.bp_addr; | ||
41 | } | ||
42 | |||
43 | static inline int hw_breakpoint_type(struct perf_event *bp) | ||
44 | { | ||
45 | return bp->attr.bp_type; | ||
46 | } | ||
47 | |||
48 | static inline int hw_breakpoint_len(struct perf_event *bp) | ||
49 | { | ||
50 | return bp->attr.bp_len; | ||
51 | } | ||
52 | |||
53 | extern struct perf_event * | ||
54 | register_user_hw_breakpoint(struct perf_event_attr *attr, | ||
55 | perf_callback_t triggered, | ||
56 | struct task_struct *tsk); | ||
57 | |||
58 | /* FIXME: only change from the attr, and don't unregister */ | ||
59 | extern struct perf_event * | ||
60 | modify_user_hw_breakpoint(struct perf_event *bp, | ||
61 | struct perf_event_attr *attr, | ||
62 | perf_callback_t triggered, | ||
63 | struct task_struct *tsk); | ||
64 | |||
65 | /* | ||
66 | * Kernel breakpoints are not associated with any particular thread. | ||
67 | */ | ||
68 | extern struct perf_event * | ||
69 | register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, | ||
70 | perf_callback_t triggered, | ||
71 | int cpu); | ||
72 | |||
73 | extern struct perf_event ** | ||
74 | register_wide_hw_breakpoint(struct perf_event_attr *attr, | ||
75 | perf_callback_t triggered); | ||
76 | |||
77 | extern int register_perf_hw_breakpoint(struct perf_event *bp); | ||
78 | extern int __register_perf_hw_breakpoint(struct perf_event *bp); | ||
79 | extern void unregister_hw_breakpoint(struct perf_event *bp); | ||
80 | extern void unregister_wide_hw_breakpoint(struct perf_event **cpu_events); | ||
81 | |||
82 | extern int reserve_bp_slot(struct perf_event *bp); | ||
83 | extern void release_bp_slot(struct perf_event *bp); | ||
84 | |||
85 | extern void flush_ptrace_hw_breakpoint(struct task_struct *tsk); | ||
86 | |||
87 | static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp) | ||
88 | { | ||
89 | return &bp->hw.info; | ||
90 | } | ||
91 | |||
92 | #else /* !CONFIG_HAVE_HW_BREAKPOINT */ | ||
93 | |||
94 | static inline struct perf_event * | ||
95 | register_user_hw_breakpoint(struct perf_event_attr *attr, | ||
96 | perf_callback_t triggered, | ||
97 | struct task_struct *tsk) { return NULL; } | ||
98 | static inline struct perf_event * | ||
99 | modify_user_hw_breakpoint(struct perf_event *bp, | ||
100 | struct perf_event_attr *attr, | ||
101 | perf_callback_t triggered, | ||
102 | struct task_struct *tsk) { return NULL; } | ||
103 | static inline struct perf_event * | ||
104 | register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, | ||
105 | perf_callback_t triggered, | ||
106 | int cpu) { return NULL; } | ||
107 | static inline struct perf_event ** | ||
108 | register_wide_hw_breakpoint(struct perf_event_attr *attr, | ||
109 | perf_callback_t triggered) { return NULL; } | ||
110 | static inline int | ||
111 | register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; } | ||
112 | static inline int | ||
113 | __register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; } | ||
114 | static inline void unregister_hw_breakpoint(struct perf_event *bp) { } | ||
115 | static inline void | ||
116 | unregister_wide_hw_breakpoint(struct perf_event **cpu_events) { } | ||
117 | static inline int | ||
118 | reserve_bp_slot(struct perf_event *bp) {return -ENOSYS; } | ||
119 | static inline void release_bp_slot(struct perf_event *bp) { } | ||
120 | |||
121 | static inline void flush_ptrace_hw_breakpoint(struct task_struct *tsk) { } | ||
122 | |||
123 | static inline struct arch_hw_breakpoint *counter_arch_bp(struct perf_event *bp) | ||
124 | { | ||
125 | return NULL; | ||
126 | } | ||
127 | |||
128 | #endif /* CONFIG_HAVE_HW_BREAKPOINT */ | ||
129 | #endif /* __KERNEL__ */ | ||
130 | |||
131 | #endif /* _LINUX_HW_BREAKPOINT_H */ | ||
diff --git a/include/linux/hw_random.h b/include/linux/hw_random.h index 7244456e7e65..9bede7633f74 100644 --- a/include/linux/hw_random.h +++ b/include/linux/hw_random.h | |||
@@ -22,10 +22,12 @@ | |||
22 | * @cleanup: Cleanup callback (can be NULL). | 22 | * @cleanup: Cleanup callback (can be NULL). |
23 | * @data_present: Callback to determine if data is available | 23 | * @data_present: Callback to determine if data is available |
24 | * on the RNG. If NULL, it is assumed that | 24 | * on the RNG. If NULL, it is assumed that |
25 | * there is always data available. | 25 | * there is always data available. *OBSOLETE* |
26 | * @data_read: Read data from the RNG device. | 26 | * @data_read: Read data from the RNG device. |
27 | * Returns the number of lower random bytes in "data". | 27 | * Returns the number of lower random bytes in "data". |
28 | * Must not be NULL. | 28 | * Must not be NULL. *OSOLETE* |
29 | * @read: New API. drivers can fill up to max bytes of data | ||
30 | * into the buffer. The buffer is aligned for any type. | ||
29 | * @priv: Private data, for use by the RNG driver. | 31 | * @priv: Private data, for use by the RNG driver. |
30 | */ | 32 | */ |
31 | struct hwrng { | 33 | struct hwrng { |
@@ -34,6 +36,7 @@ struct hwrng { | |||
34 | void (*cleanup)(struct hwrng *rng); | 36 | void (*cleanup)(struct hwrng *rng); |
35 | int (*data_present)(struct hwrng *rng, int wait); | 37 | int (*data_present)(struct hwrng *rng, int wait); |
36 | int (*data_read)(struct hwrng *rng, u32 *data); | 38 | int (*data_read)(struct hwrng *rng, u32 *data); |
39 | int (*read)(struct hwrng *rng, void *data, size_t max, bool wait); | ||
37 | unsigned long priv; | 40 | unsigned long priv; |
38 | 41 | ||
39 | /* internal. */ | 42 | /* internal. */ |
diff --git a/include/linux/i2c.h b/include/linux/i2c.h index 7b40cda57a70..419ab546b266 100644 --- a/include/linux/i2c.h +++ b/include/linux/i2c.h | |||
@@ -110,7 +110,7 @@ extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client *client, | |||
110 | * @driver: Device driver model driver | 110 | * @driver: Device driver model driver |
111 | * @id_table: List of I2C devices supported by this driver | 111 | * @id_table: List of I2C devices supported by this driver |
112 | * @detect: Callback for device detection | 112 | * @detect: Callback for device detection |
113 | * @address_data: The I2C addresses to probe, ignore or force (for detect) | 113 | * @address_data: The I2C addresses to probe (for detect) |
114 | * @clients: List of detected clients we created (for i2c-core use only) | 114 | * @clients: List of detected clients we created (for i2c-core use only) |
115 | * | 115 | * |
116 | * The driver.owner field should be set to the module owner of this driver. | 116 | * The driver.owner field should be set to the module owner of this driver. |
@@ -338,8 +338,7 @@ struct i2c_adapter { | |||
338 | void *algo_data; | 338 | void *algo_data; |
339 | 339 | ||
340 | /* data fields that are valid for all devices */ | 340 | /* data fields that are valid for all devices */ |
341 | u8 level; /* nesting level for lockdep */ | 341 | struct rt_mutex bus_lock; |
342 | struct mutex bus_lock; | ||
343 | 342 | ||
344 | int timeout; /* in jiffies */ | 343 | int timeout; /* in jiffies */ |
345 | int retries; | 344 | int retries; |
@@ -367,7 +366,7 @@ static inline void i2c_set_adapdata(struct i2c_adapter *dev, void *data) | |||
367 | */ | 366 | */ |
368 | static inline void i2c_lock_adapter(struct i2c_adapter *adapter) | 367 | static inline void i2c_lock_adapter(struct i2c_adapter *adapter) |
369 | { | 368 | { |
370 | mutex_lock(&adapter->bus_lock); | 369 | rt_mutex_lock(&adapter->bus_lock); |
371 | } | 370 | } |
372 | 371 | ||
373 | /** | 372 | /** |
@@ -376,7 +375,7 @@ static inline void i2c_lock_adapter(struct i2c_adapter *adapter) | |||
376 | */ | 375 | */ |
377 | static inline void i2c_unlock_adapter(struct i2c_adapter *adapter) | 376 | static inline void i2c_unlock_adapter(struct i2c_adapter *adapter) |
378 | { | 377 | { |
379 | mutex_unlock(&adapter->bus_lock); | 378 | rt_mutex_unlock(&adapter->bus_lock); |
380 | } | 379 | } |
381 | 380 | ||
382 | /*flags for the client struct: */ | 381 | /*flags for the client struct: */ |
@@ -398,9 +397,6 @@ static inline void i2c_unlock_adapter(struct i2c_adapter *adapter) | |||
398 | */ | 397 | */ |
399 | struct i2c_client_address_data { | 398 | struct i2c_client_address_data { |
400 | const unsigned short *normal_i2c; | 399 | const unsigned short *normal_i2c; |
401 | const unsigned short *probe; | ||
402 | const unsigned short *ignore; | ||
403 | const unsigned short * const *forces; | ||
404 | }; | 400 | }; |
405 | 401 | ||
406 | /* Internal numbers to terminate lists */ | 402 | /* Internal numbers to terminate lists */ |
@@ -614,134 +610,48 @@ union i2c_smbus_data { | |||
614 | module_param_array(var, short, &var##_num, 0); \ | 610 | module_param_array(var, short, &var##_num, 0); \ |
615 | MODULE_PARM_DESC(var, desc) | 611 | MODULE_PARM_DESC(var, desc) |
616 | 612 | ||
617 | #define I2C_CLIENT_MODULE_PARM_FORCE(name) \ | ||
618 | I2C_CLIENT_MODULE_PARM(force_##name, \ | ||
619 | "List of adapter,address pairs which are " \ | ||
620 | "unquestionably assumed to contain a `" \ | ||
621 | # name "' chip") | ||
622 | |||
623 | |||
624 | #define I2C_CLIENT_INSMOD_COMMON \ | 613 | #define I2C_CLIENT_INSMOD_COMMON \ |
625 | I2C_CLIENT_MODULE_PARM(probe, "List of adapter,address pairs to scan " \ | ||
626 | "additionally"); \ | ||
627 | I2C_CLIENT_MODULE_PARM(ignore, "List of adapter,address pairs not to " \ | ||
628 | "scan"); \ | ||
629 | static const struct i2c_client_address_data addr_data = { \ | 614 | static const struct i2c_client_address_data addr_data = { \ |
630 | .normal_i2c = normal_i2c, \ | 615 | .normal_i2c = normal_i2c, \ |
631 | .probe = probe, \ | ||
632 | .ignore = ignore, \ | ||
633 | .forces = forces, \ | ||
634 | } | 616 | } |
635 | 617 | ||
636 | #define I2C_CLIENT_FORCE_TEXT \ | ||
637 | "List of adapter,address pairs to boldly assume to be present" | ||
638 | |||
639 | /* These are the ones you want to use in your own drivers. Pick the one | 618 | /* These are the ones you want to use in your own drivers. Pick the one |
640 | which matches the number of devices the driver differenciates between. */ | 619 | which matches the number of devices the driver differenciates between. */ |
641 | #define I2C_CLIENT_INSMOD \ | 620 | #define I2C_CLIENT_INSMOD \ |
642 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ | ||
643 | static const unsigned short * const forces[] = { force, NULL }; \ | ||
644 | I2C_CLIENT_INSMOD_COMMON | 621 | I2C_CLIENT_INSMOD_COMMON |
645 | 622 | ||
646 | #define I2C_CLIENT_INSMOD_1(chip1) \ | 623 | #define I2C_CLIENT_INSMOD_1(chip1) \ |
647 | enum chips { any_chip, chip1 }; \ | 624 | enum chips { any_chip, chip1 }; \ |
648 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ | ||
649 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
650 | static const unsigned short * const forces[] = { force, \ | ||
651 | force_##chip1, NULL }; \ | ||
652 | I2C_CLIENT_INSMOD_COMMON | 625 | I2C_CLIENT_INSMOD_COMMON |
653 | 626 | ||
654 | #define I2C_CLIENT_INSMOD_2(chip1, chip2) \ | 627 | #define I2C_CLIENT_INSMOD_2(chip1, chip2) \ |
655 | enum chips { any_chip, chip1, chip2 }; \ | 628 | enum chips { any_chip, chip1, chip2 }; \ |
656 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ | ||
657 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
658 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
659 | static const unsigned short * const forces[] = { force, \ | ||
660 | force_##chip1, force_##chip2, NULL }; \ | ||
661 | I2C_CLIENT_INSMOD_COMMON | 629 | I2C_CLIENT_INSMOD_COMMON |
662 | 630 | ||
663 | #define I2C_CLIENT_INSMOD_3(chip1, chip2, chip3) \ | 631 | #define I2C_CLIENT_INSMOD_3(chip1, chip2, chip3) \ |
664 | enum chips { any_chip, chip1, chip2, chip3 }; \ | 632 | enum chips { any_chip, chip1, chip2, chip3 }; \ |
665 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ | ||
666 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
667 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
668 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | ||
669 | static const unsigned short * const forces[] = { force, \ | ||
670 | force_##chip1, force_##chip2, force_##chip3, NULL }; \ | ||
671 | I2C_CLIENT_INSMOD_COMMON | 633 | I2C_CLIENT_INSMOD_COMMON |
672 | 634 | ||
673 | #define I2C_CLIENT_INSMOD_4(chip1, chip2, chip3, chip4) \ | 635 | #define I2C_CLIENT_INSMOD_4(chip1, chip2, chip3, chip4) \ |
674 | enum chips { any_chip, chip1, chip2, chip3, chip4 }; \ | 636 | enum chips { any_chip, chip1, chip2, chip3, chip4 }; \ |
675 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ | ||
676 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
677 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
678 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | ||
679 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ | ||
680 | static const unsigned short * const forces[] = { force, \ | ||
681 | force_##chip1, force_##chip2, force_##chip3, \ | ||
682 | force_##chip4, NULL}; \ | ||
683 | I2C_CLIENT_INSMOD_COMMON | 637 | I2C_CLIENT_INSMOD_COMMON |
684 | 638 | ||
685 | #define I2C_CLIENT_INSMOD_5(chip1, chip2, chip3, chip4, chip5) \ | 639 | #define I2C_CLIENT_INSMOD_5(chip1, chip2, chip3, chip4, chip5) \ |
686 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \ | 640 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5 }; \ |
687 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ | ||
688 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
689 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
690 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | ||
691 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ | ||
692 | I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ | ||
693 | static const unsigned short * const forces[] = { force, \ | ||
694 | force_##chip1, force_##chip2, force_##chip3, \ | ||
695 | force_##chip4, force_##chip5, NULL }; \ | ||
696 | I2C_CLIENT_INSMOD_COMMON | 641 | I2C_CLIENT_INSMOD_COMMON |
697 | 642 | ||
698 | #define I2C_CLIENT_INSMOD_6(chip1, chip2, chip3, chip4, chip5, chip6) \ | 643 | #define I2C_CLIENT_INSMOD_6(chip1, chip2, chip3, chip4, chip5, chip6) \ |
699 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \ | 644 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6 }; \ |
700 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ | ||
701 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
702 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
703 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | ||
704 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ | ||
705 | I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ | ||
706 | I2C_CLIENT_MODULE_PARM_FORCE(chip6); \ | ||
707 | static const unsigned short * const forces[] = { force, \ | ||
708 | force_##chip1, force_##chip2, force_##chip3, \ | ||
709 | force_##chip4, force_##chip5, force_##chip6, NULL }; \ | ||
710 | I2C_CLIENT_INSMOD_COMMON | 645 | I2C_CLIENT_INSMOD_COMMON |
711 | 646 | ||
712 | #define I2C_CLIENT_INSMOD_7(chip1, chip2, chip3, chip4, chip5, chip6, chip7) \ | 647 | #define I2C_CLIENT_INSMOD_7(chip1, chip2, chip3, chip4, chip5, chip6, chip7) \ |
713 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ | 648 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ |
714 | chip7 }; \ | 649 | chip7 }; \ |
715 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ | ||
716 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
717 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
718 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | ||
719 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ | ||
720 | I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ | ||
721 | I2C_CLIENT_MODULE_PARM_FORCE(chip6); \ | ||
722 | I2C_CLIENT_MODULE_PARM_FORCE(chip7); \ | ||
723 | static const unsigned short * const forces[] = { force, \ | ||
724 | force_##chip1, force_##chip2, force_##chip3, \ | ||
725 | force_##chip4, force_##chip5, force_##chip6, \ | ||
726 | force_##chip7, NULL }; \ | ||
727 | I2C_CLIENT_INSMOD_COMMON | 650 | I2C_CLIENT_INSMOD_COMMON |
728 | 651 | ||
729 | #define I2C_CLIENT_INSMOD_8(chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8) \ | 652 | #define I2C_CLIENT_INSMOD_8(chip1, chip2, chip3, chip4, chip5, chip6, chip7, chip8) \ |
730 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ | 653 | enum chips { any_chip, chip1, chip2, chip3, chip4, chip5, chip6, \ |
731 | chip7, chip8 }; \ | 654 | chip7, chip8 }; \ |
732 | I2C_CLIENT_MODULE_PARM(force, I2C_CLIENT_FORCE_TEXT); \ | ||
733 | I2C_CLIENT_MODULE_PARM_FORCE(chip1); \ | ||
734 | I2C_CLIENT_MODULE_PARM_FORCE(chip2); \ | ||
735 | I2C_CLIENT_MODULE_PARM_FORCE(chip3); \ | ||
736 | I2C_CLIENT_MODULE_PARM_FORCE(chip4); \ | ||
737 | I2C_CLIENT_MODULE_PARM_FORCE(chip5); \ | ||
738 | I2C_CLIENT_MODULE_PARM_FORCE(chip6); \ | ||
739 | I2C_CLIENT_MODULE_PARM_FORCE(chip7); \ | ||
740 | I2C_CLIENT_MODULE_PARM_FORCE(chip8); \ | ||
741 | static const unsigned short * const forces[] = { force, \ | ||
742 | force_##chip1, force_##chip2, force_##chip3, \ | ||
743 | force_##chip4, force_##chip5, force_##chip6, \ | ||
744 | force_##chip7, force_##chip8, NULL }; \ | ||
745 | I2C_CLIENT_INSMOD_COMMON | 655 | I2C_CLIENT_INSMOD_COMMON |
746 | #endif /* __KERNEL__ */ | 656 | #endif /* __KERNEL__ */ |
747 | #endif /* _LINUX_I2C_H */ | 657 | #endif /* _LINUX_I2C_H */ |
diff --git a/include/linux/i2c/twl4030.h b/include/linux/i2c/twl4030.h index 508824ee35e6..5306a759cbde 100644 --- a/include/linux/i2c/twl4030.h +++ b/include/linux/i2c/twl4030.h | |||
@@ -401,6 +401,24 @@ struct twl4030_power_data { | |||
401 | 401 | ||
402 | extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); | 402 | extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); |
403 | 403 | ||
404 | struct twl4030_codec_audio_data { | ||
405 | unsigned int audio_mclk; | ||
406 | unsigned int ramp_delay_value; | ||
407 | unsigned int hs_extmute:1; | ||
408 | void (*set_hs_extmute)(int mute); | ||
409 | }; | ||
410 | |||
411 | struct twl4030_codec_vibra_data { | ||
412 | unsigned int audio_mclk; | ||
413 | unsigned int coexist; | ||
414 | }; | ||
415 | |||
416 | struct twl4030_codec_data { | ||
417 | unsigned int audio_mclk; | ||
418 | struct twl4030_codec_audio_data *audio; | ||
419 | struct twl4030_codec_vibra_data *vibra; | ||
420 | }; | ||
421 | |||
404 | struct twl4030_platform_data { | 422 | struct twl4030_platform_data { |
405 | unsigned irq_base, irq_end; | 423 | unsigned irq_base, irq_end; |
406 | struct twl4030_bci_platform_data *bci; | 424 | struct twl4030_bci_platform_data *bci; |
@@ -409,6 +427,7 @@ struct twl4030_platform_data { | |||
409 | struct twl4030_keypad_data *keypad; | 427 | struct twl4030_keypad_data *keypad; |
410 | struct twl4030_usb_data *usb; | 428 | struct twl4030_usb_data *usb; |
411 | struct twl4030_power_data *power; | 429 | struct twl4030_power_data *power; |
430 | struct twl4030_codec_data *codec; | ||
412 | 431 | ||
413 | /* LDO regulators */ | 432 | /* LDO regulators */ |
414 | struct regulator_init_data *vdac; | 433 | struct regulator_init_data *vdac; |
diff --git a/include/linux/i82593.h b/include/linux/i82593.h new file mode 100644 index 000000000000..afac5c7a323d --- /dev/null +++ b/include/linux/i82593.h | |||
@@ -0,0 +1,229 @@ | |||
1 | /* | ||
2 | * Definitions for Intel 82593 CSMA/CD Core LAN Controller | ||
3 | * The definitions are taken from the 1992 users manual with Intel | ||
4 | * order number 297125-001. | ||
5 | * | ||
6 | * /usr/src/pc/RCS/i82593.h,v 1.1 1996/07/17 15:23:12 root Exp | ||
7 | * | ||
8 | * Copyright 1994, Anders Klemets <klemets@it.kth.se> | ||
9 | * | ||
10 | * HISTORY | ||
11 | * i82593.h,v | ||
12 | * Revision 1.4 2005/11/4 09:15:00 baroniunas | ||
13 | * Modified copyright with permission of author as follows: | ||
14 | * | ||
15 | * "If I82539.H is the only file with my copyright statement | ||
16 | * that is included in the Source Forge project, then you have | ||
17 | * my approval to change the copyright statement to be a GPL | ||
18 | * license, in the way you proposed on October 10." | ||
19 | * | ||
20 | * Revision 1.1 1996/07/17 15:23:12 root | ||
21 | * Initial revision | ||
22 | * | ||
23 | * Revision 1.3 1995/04/05 15:13:58 adj | ||
24 | * Initial alpha release | ||
25 | * | ||
26 | * Revision 1.2 1994/06/16 23:57:31 klemets | ||
27 | * Mirrored all the fields in the configuration block. | ||
28 | * | ||
29 | * Revision 1.1 1994/06/02 20:25:34 klemets | ||
30 | * Initial revision | ||
31 | * | ||
32 | * | ||
33 | */ | ||
34 | #ifndef _I82593_H | ||
35 | #define _I82593_H | ||
36 | |||
37 | /* Intel 82593 CSMA/CD Core LAN Controller */ | ||
38 | |||
39 | /* Port 0 Command Register definitions */ | ||
40 | |||
41 | /* Execution operations */ | ||
42 | #define OP0_NOP 0 /* CHNL = 0 */ | ||
43 | #define OP0_SWIT_TO_PORT_1 0 /* CHNL = 1 */ | ||
44 | #define OP0_IA_SETUP 1 | ||
45 | #define OP0_CONFIGURE 2 | ||
46 | #define OP0_MC_SETUP 3 | ||
47 | #define OP0_TRANSMIT 4 | ||
48 | #define OP0_TDR 5 | ||
49 | #define OP0_DUMP 6 | ||
50 | #define OP0_DIAGNOSE 7 | ||
51 | #define OP0_TRANSMIT_NO_CRC 9 | ||
52 | #define OP0_RETRANSMIT 12 | ||
53 | #define OP0_ABORT 13 | ||
54 | /* Reception operations */ | ||
55 | #define OP0_RCV_ENABLE 8 | ||
56 | #define OP0_RCV_DISABLE 10 | ||
57 | #define OP0_STOP_RCV 11 | ||
58 | /* Status pointer control operations */ | ||
59 | #define OP0_FIX_PTR 15 /* CHNL = 1 */ | ||
60 | #define OP0_RLS_PTR 15 /* CHNL = 0 */ | ||
61 | #define OP0_RESET 14 | ||
62 | |||
63 | #define CR0_CHNL (1 << 4) /* 0=Channel 0, 1=Channel 1 */ | ||
64 | #define CR0_STATUS_0 0x00 | ||
65 | #define CR0_STATUS_1 0x20 | ||
66 | #define CR0_STATUS_2 0x40 | ||
67 | #define CR0_STATUS_3 0x60 | ||
68 | #define CR0_INT_ACK (1 << 7) /* 0=No ack, 1=acknowledge */ | ||
69 | |||
70 | /* Port 0 Status Register definitions */ | ||
71 | |||
72 | #define SR0_NO_RESULT 0 /* dummy */ | ||
73 | #define SR0_EVENT_MASK 0x0f | ||
74 | #define SR0_IA_SETUP_DONE 1 | ||
75 | #define SR0_CONFIGURE_DONE 2 | ||
76 | #define SR0_MC_SETUP_DONE 3 | ||
77 | #define SR0_TRANSMIT_DONE 4 | ||
78 | #define SR0_TDR_DONE 5 | ||
79 | #define SR0_DUMP_DONE 6 | ||
80 | #define SR0_DIAGNOSE_PASSED 7 | ||
81 | #define SR0_TRANSMIT_NO_CRC_DONE 9 | ||
82 | #define SR0_RETRANSMIT_DONE 12 | ||
83 | #define SR0_EXECUTION_ABORTED 13 | ||
84 | #define SR0_END_OF_FRAME 8 | ||
85 | #define SR0_RECEPTION_ABORTED 10 | ||
86 | #define SR0_DIAGNOSE_FAILED 15 | ||
87 | #define SR0_STOP_REG_HIT 11 | ||
88 | |||
89 | #define SR0_CHNL (1 << 4) | ||
90 | #define SR0_EXECUTION (1 << 5) | ||
91 | #define SR0_RECEPTION (1 << 6) | ||
92 | #define SR0_INTERRUPT (1 << 7) | ||
93 | #define SR0_BOTH_RX_TX (SR0_EXECUTION | SR0_RECEPTION) | ||
94 | |||
95 | #define SR3_EXEC_STATE_MASK 0x03 | ||
96 | #define SR3_EXEC_IDLE 0 | ||
97 | #define SR3_TX_ABORT_IN_PROGRESS 1 | ||
98 | #define SR3_EXEC_ACTIVE 2 | ||
99 | #define SR3_ABORT_IN_PROGRESS 3 | ||
100 | #define SR3_EXEC_CHNL (1 << 2) | ||
101 | #define SR3_STP_ON_NO_RSRC (1 << 3) | ||
102 | #define SR3_RCVING_NO_RSRC (1 << 4) | ||
103 | #define SR3_RCV_STATE_MASK 0x60 | ||
104 | #define SR3_RCV_IDLE 0x00 | ||
105 | #define SR3_RCV_READY 0x20 | ||
106 | #define SR3_RCV_ACTIVE 0x40 | ||
107 | #define SR3_RCV_STOP_IN_PROG 0x60 | ||
108 | #define SR3_RCV_CHNL (1 << 7) | ||
109 | |||
110 | /* Port 1 Command Register definitions */ | ||
111 | |||
112 | #define OP1_NOP 0 | ||
113 | #define OP1_SWIT_TO_PORT_0 1 | ||
114 | #define OP1_INT_DISABLE 2 | ||
115 | #define OP1_INT_ENABLE 3 | ||
116 | #define OP1_SET_TS 5 | ||
117 | #define OP1_RST_TS 7 | ||
118 | #define OP1_POWER_DOWN 8 | ||
119 | #define OP1_RESET_RING_MNGMT 11 | ||
120 | #define OP1_RESET 14 | ||
121 | #define OP1_SEL_RST 15 | ||
122 | |||
123 | #define CR1_STATUS_4 0x00 | ||
124 | #define CR1_STATUS_5 0x20 | ||
125 | #define CR1_STATUS_6 0x40 | ||
126 | #define CR1_STOP_REG_UPDATE (1 << 7) | ||
127 | |||
128 | /* Receive frame status bits */ | ||
129 | |||
130 | #define RX_RCLD (1 << 0) | ||
131 | #define RX_IA_MATCH (1 << 1) | ||
132 | #define RX_NO_AD_MATCH (1 << 2) | ||
133 | #define RX_NO_SFD (1 << 3) | ||
134 | #define RX_SRT_FRM (1 << 7) | ||
135 | #define RX_OVRRUN (1 << 8) | ||
136 | #define RX_ALG_ERR (1 << 10) | ||
137 | #define RX_CRC_ERR (1 << 11) | ||
138 | #define RX_LEN_ERR (1 << 12) | ||
139 | #define RX_RCV_OK (1 << 13) | ||
140 | #define RX_TYP_LEN (1 << 15) | ||
141 | |||
142 | /* Transmit status bits */ | ||
143 | |||
144 | #define TX_NCOL_MASK 0x0f | ||
145 | #define TX_FRTL (1 << 4) | ||
146 | #define TX_MAX_COL (1 << 5) | ||
147 | #define TX_HRT_BEAT (1 << 6) | ||
148 | #define TX_DEFER (1 << 7) | ||
149 | #define TX_UND_RUN (1 << 8) | ||
150 | #define TX_LOST_CTS (1 << 9) | ||
151 | #define TX_LOST_CRS (1 << 10) | ||
152 | #define TX_LTCOL (1 << 11) | ||
153 | #define TX_OK (1 << 13) | ||
154 | #define TX_COLL (1 << 15) | ||
155 | |||
156 | struct i82593_conf_block { | ||
157 | u_char fifo_limit : 4, | ||
158 | forgnesi : 1, | ||
159 | fifo_32 : 1, | ||
160 | d6mod : 1, | ||
161 | throttle_enb : 1; | ||
162 | u_char throttle : 6, | ||
163 | cntrxint : 1, | ||
164 | contin : 1; | ||
165 | u_char addr_len : 3, | ||
166 | acloc : 1, | ||
167 | preamb_len : 2, | ||
168 | loopback : 2; | ||
169 | u_char lin_prio : 3, | ||
170 | tbofstop : 1, | ||
171 | exp_prio : 3, | ||
172 | bof_met : 1; | ||
173 | u_char : 4, | ||
174 | ifrm_spc : 4; | ||
175 | u_char : 5, | ||
176 | slottim_low : 3; | ||
177 | u_char slottim_hi : 3, | ||
178 | : 1, | ||
179 | max_retr : 4; | ||
180 | u_char prmisc : 1, | ||
181 | bc_dis : 1, | ||
182 | : 1, | ||
183 | crs_1 : 1, | ||
184 | nocrc_ins : 1, | ||
185 | crc_1632 : 1, | ||
186 | : 1, | ||
187 | crs_cdt : 1; | ||
188 | u_char cs_filter : 3, | ||
189 | crs_src : 1, | ||
190 | cd_filter : 3, | ||
191 | : 1; | ||
192 | u_char : 2, | ||
193 | min_fr_len : 6; | ||
194 | u_char lng_typ : 1, | ||
195 | lng_fld : 1, | ||
196 | rxcrc_xf : 1, | ||
197 | artx : 1, | ||
198 | sarec : 1, | ||
199 | tx_jabber : 1, /* why is this called max_len in the manual? */ | ||
200 | hash_1 : 1, | ||
201 | lbpkpol : 1; | ||
202 | u_char : 6, | ||
203 | fdx : 1, | ||
204 | : 1; | ||
205 | u_char dummy_6 : 6, /* supposed to be ones */ | ||
206 | mult_ia : 1, | ||
207 | dis_bof : 1; | ||
208 | u_char dummy_1 : 1, /* supposed to be one */ | ||
209 | tx_ifs_retrig : 2, | ||
210 | mc_all : 1, | ||
211 | rcv_mon : 2, | ||
212 | frag_acpt : 1, | ||
213 | tstrttrs : 1; | ||
214 | u_char fretx : 1, | ||
215 | runt_eop : 1, | ||
216 | hw_sw_pin : 1, | ||
217 | big_endn : 1, | ||
218 | syncrqs : 1, | ||
219 | sttlen : 1, | ||
220 | tx_eop : 1, | ||
221 | rx_eop : 1; | ||
222 | u_char rbuf_size : 5, | ||
223 | rcvstop : 1, | ||
224 | : 2; | ||
225 | }; | ||
226 | |||
227 | #define I82593_MAX_MULTICAST_ADDRESSES 128 /* Hardware hashed filter */ | ||
228 | |||
229 | #endif /* _I82593_H */ | ||
diff --git a/include/linux/ide.h b/include/linux/ide.h index e4135d6e0556..0ec612959042 100644 --- a/include/linux/ide.h +++ b/include/linux/ide.h | |||
@@ -125,8 +125,8 @@ struct ide_io_ports { | |||
125 | * Timeouts for various operations: | 125 | * Timeouts for various operations: |
126 | */ | 126 | */ |
127 | enum { | 127 | enum { |
128 | /* spec allows up to 20ms */ | 128 | /* spec allows up to 20ms, but CF cards and SSD drives need more */ |
129 | WAIT_DRQ = HZ / 10, /* 100ms */ | 129 | WAIT_DRQ = 1 * HZ, /* 1s */ |
130 | /* some laptops are very slow */ | 130 | /* some laptops are very slow */ |
131 | WAIT_READY = 5 * HZ, /* 5s */ | 131 | WAIT_READY = 5 * HZ, /* 5s */ |
132 | /* should be less than 3ms (?), if all ATAPI CD is closed at boot */ | 132 | /* should be less than 3ms (?), if all ATAPI CD is closed at boot */ |
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h index 52e15e079c61..d9724a28c0c2 100644 --- a/include/linux/ieee80211.h +++ b/include/linux/ieee80211.h | |||
@@ -115,7 +115,6 @@ | |||
115 | #define IEEE80211_MAX_SSID_LEN 32 | 115 | #define IEEE80211_MAX_SSID_LEN 32 |
116 | 116 | ||
117 | #define IEEE80211_MAX_MESH_ID_LEN 32 | 117 | #define IEEE80211_MAX_MESH_ID_LEN 32 |
118 | #define IEEE80211_MESH_CONFIG_LEN 24 | ||
119 | 118 | ||
120 | #define IEEE80211_QOS_CTL_LEN 2 | 119 | #define IEEE80211_QOS_CTL_LEN 2 |
121 | #define IEEE80211_QOS_CTL_TID_MASK 0x000F | 120 | #define IEEE80211_QOS_CTL_TID_MASK 0x000F |
@@ -472,7 +471,7 @@ static inline int ieee80211_is_cfendack(__le16 fc) | |||
472 | } | 471 | } |
473 | 472 | ||
474 | /** | 473 | /** |
475 | * ieee80211_is_nullfunc - check if FTYPE=IEEE80211_FTYPE_DATA and STYPE=IEEE80211_STYPE_NULLFUNC | 474 | * ieee80211_is_nullfunc - check if frame is a regular (non-QoS) nullfunc frame |
476 | * @fc: frame control bytes in little-endian byteorder | 475 | * @fc: frame control bytes in little-endian byteorder |
477 | */ | 476 | */ |
478 | static inline int ieee80211_is_nullfunc(__le16 fc) | 477 | static inline int ieee80211_is_nullfunc(__le16 fc) |
@@ -481,6 +480,16 @@ static inline int ieee80211_is_nullfunc(__le16 fc) | |||
481 | cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC); | 480 | cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_NULLFUNC); |
482 | } | 481 | } |
483 | 482 | ||
483 | /** | ||
484 | * ieee80211_is_qos_nullfunc - check if frame is a QoS nullfunc frame | ||
485 | * @fc: frame control bytes in little-endian byteorder | ||
486 | */ | ||
487 | static inline int ieee80211_is_qos_nullfunc(__le16 fc) | ||
488 | { | ||
489 | return (fc & cpu_to_le16(IEEE80211_FCTL_FTYPE | IEEE80211_FCTL_STYPE)) == | ||
490 | cpu_to_le16(IEEE80211_FTYPE_DATA | IEEE80211_STYPE_QOS_NULLFUNC); | ||
491 | } | ||
492 | |||
484 | struct ieee80211s_hdr { | 493 | struct ieee80211s_hdr { |
485 | u8 flags; | 494 | u8 flags; |
486 | u8 ttl; | 495 | u8 ttl; |
@@ -544,6 +553,35 @@ struct ieee80211_tim_ie { | |||
544 | u8 virtual_map[1]; | 553 | u8 virtual_map[1]; |
545 | } __attribute__ ((packed)); | 554 | } __attribute__ ((packed)); |
546 | 555 | ||
556 | /** | ||
557 | * struct ieee80211_meshconf_ie | ||
558 | * | ||
559 | * This structure refers to "Mesh Configuration information element" | ||
560 | */ | ||
561 | struct ieee80211_meshconf_ie { | ||
562 | u8 meshconf_psel; | ||
563 | u8 meshconf_pmetric; | ||
564 | u8 meshconf_congest; | ||
565 | u8 meshconf_synch; | ||
566 | u8 meshconf_auth; | ||
567 | u8 meshconf_form; | ||
568 | u8 meshconf_cap; | ||
569 | } __attribute__ ((packed)); | ||
570 | |||
571 | /** | ||
572 | * struct ieee80211_rann_ie | ||
573 | * | ||
574 | * This structure refers to "Root Announcement information element" | ||
575 | */ | ||
576 | struct ieee80211_rann_ie { | ||
577 | u8 rann_flags; | ||
578 | u8 rann_hopcount; | ||
579 | u8 rann_ttl; | ||
580 | u8 rann_addr[6]; | ||
581 | u32 rann_seq; | ||
582 | u32 rann_metric; | ||
583 | } __attribute__ ((packed)); | ||
584 | |||
547 | #define WLAN_SA_QUERY_TR_ID_LEN 2 | 585 | #define WLAN_SA_QUERY_TR_ID_LEN 2 |
548 | 586 | ||
549 | struct ieee80211_mgmt { | 587 | struct ieee80211_mgmt { |
@@ -1060,6 +1098,7 @@ enum ieee80211_eid { | |||
1060 | WLAN_EID_PREQ = 68, | 1098 | WLAN_EID_PREQ = 68, |
1061 | WLAN_EID_PREP = 69, | 1099 | WLAN_EID_PREP = 69, |
1062 | WLAN_EID_PERR = 70, | 1100 | WLAN_EID_PERR = 70, |
1101 | WLAN_EID_RANN = 49, /* compatible with FreeBSD */ | ||
1063 | /* 802.11h */ | 1102 | /* 802.11h */ |
1064 | WLAN_EID_PWR_CONSTRAINT = 32, | 1103 | WLAN_EID_PWR_CONSTRAINT = 32, |
1065 | WLAN_EID_PWR_CAPABILITY = 33, | 1104 | WLAN_EID_PWR_CAPABILITY = 33, |
@@ -1227,6 +1266,8 @@ enum ieee80211_sa_query_action { | |||
1227 | 1266 | ||
1228 | #define WLAN_MAX_KEY_LEN 32 | 1267 | #define WLAN_MAX_KEY_LEN 32 |
1229 | 1268 | ||
1269 | #define WLAN_PMKID_LEN 16 | ||
1270 | |||
1230 | /** | 1271 | /** |
1231 | * ieee80211_get_qos_ctl - get pointer to qos control bytes | 1272 | * ieee80211_get_qos_ctl - get pointer to qos control bytes |
1232 | * @hdr: the frame | 1273 | * @hdr: the frame |
diff --git a/include/linux/if.h b/include/linux/if.h index b9a6229f3be7..3a9f410a296b 100644 --- a/include/linux/if.h +++ b/include/linux/if.h | |||
@@ -70,6 +70,7 @@ | |||
70 | #define IFF_XMIT_DST_RELEASE 0x400 /* dev_hard_start_xmit() is allowed to | 70 | #define IFF_XMIT_DST_RELEASE 0x400 /* dev_hard_start_xmit() is allowed to |
71 | * release skb->dst | 71 | * release skb->dst |
72 | */ | 72 | */ |
73 | #define IFF_DONT_BRIDGE 0x800 /* disallow bridging this ether dev */ | ||
73 | 74 | ||
74 | #define IF_GET_IFACE 0x0001 /* for querying only */ | 75 | #define IF_GET_IFACE 0x0001 /* for querying only */ |
75 | #define IF_GET_PROTO 0x0002 | 76 | #define IF_GET_PROTO 0x0002 |
@@ -125,8 +126,7 @@ enum { | |||
125 | * being very small might be worth keeping for clean configuration. | 126 | * being very small might be worth keeping for clean configuration. |
126 | */ | 127 | */ |
127 | 128 | ||
128 | struct ifmap | 129 | struct ifmap { |
129 | { | ||
130 | unsigned long mem_start; | 130 | unsigned long mem_start; |
131 | unsigned long mem_end; | 131 | unsigned long mem_end; |
132 | unsigned short base_addr; | 132 | unsigned short base_addr; |
@@ -136,8 +136,7 @@ struct ifmap | |||
136 | /* 3 bytes spare */ | 136 | /* 3 bytes spare */ |
137 | }; | 137 | }; |
138 | 138 | ||
139 | struct if_settings | 139 | struct if_settings { |
140 | { | ||
141 | unsigned int type; /* Type of physical device or protocol */ | 140 | unsigned int type; /* Type of physical device or protocol */ |
142 | unsigned int size; /* Size of the data allocated by the caller */ | 141 | unsigned int size; /* Size of the data allocated by the caller */ |
143 | union { | 142 | union { |
@@ -161,8 +160,7 @@ struct if_settings | |||
161 | * remainder may be interface specific. | 160 | * remainder may be interface specific. |
162 | */ | 161 | */ |
163 | 162 | ||
164 | struct ifreq | 163 | struct ifreq { |
165 | { | ||
166 | #define IFHWADDRLEN 6 | 164 | #define IFHWADDRLEN 6 |
167 | union | 165 | union |
168 | { | 166 | { |
@@ -211,11 +209,9 @@ struct ifreq | |||
211 | * must know all networks accessible). | 209 | * must know all networks accessible). |
212 | */ | 210 | */ |
213 | 211 | ||
214 | struct ifconf | 212 | struct ifconf { |
215 | { | ||
216 | int ifc_len; /* size of buffer */ | 213 | int ifc_len; /* size of buffer */ |
217 | union | 214 | union { |
218 | { | ||
219 | char __user *ifcu_buf; | 215 | char __user *ifcu_buf; |
220 | struct ifreq __user *ifcu_req; | 216 | struct ifreq __user *ifcu_req; |
221 | } ifc_ifcu; | 217 | } ifc_ifcu; |
diff --git a/include/linux/if_addr.h b/include/linux/if_addr.h index fd9740466757..23357ab81a77 100644 --- a/include/linux/if_addr.h +++ b/include/linux/if_addr.h | |||
@@ -4,8 +4,7 @@ | |||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/netlink.h> | 5 | #include <linux/netlink.h> |
6 | 6 | ||
7 | struct ifaddrmsg | 7 | struct ifaddrmsg { |
8 | { | ||
9 | __u8 ifa_family; | 8 | __u8 ifa_family; |
10 | __u8 ifa_prefixlen; /* The prefix length */ | 9 | __u8 ifa_prefixlen; /* The prefix length */ |
11 | __u8 ifa_flags; /* Flags */ | 10 | __u8 ifa_flags; /* Flags */ |
@@ -20,8 +19,7 @@ struct ifaddrmsg | |||
20 | * but for point-to-point IFA_ADDRESS is DESTINATION address, | 19 | * but for point-to-point IFA_ADDRESS is DESTINATION address, |
21 | * local address is supplied in IFA_LOCAL attribute. | 20 | * local address is supplied in IFA_LOCAL attribute. |
22 | */ | 21 | */ |
23 | enum | 22 | enum { |
24 | { | ||
25 | IFA_UNSPEC, | 23 | IFA_UNSPEC, |
26 | IFA_ADDRESS, | 24 | IFA_ADDRESS, |
27 | IFA_LOCAL, | 25 | IFA_LOCAL, |
@@ -47,8 +45,7 @@ enum | |||
47 | #define IFA_F_TENTATIVE 0x40 | 45 | #define IFA_F_TENTATIVE 0x40 |
48 | #define IFA_F_PERMANENT 0x80 | 46 | #define IFA_F_PERMANENT 0x80 |
49 | 47 | ||
50 | struct ifa_cacheinfo | 48 | struct ifa_cacheinfo { |
51 | { | ||
52 | __u32 ifa_prefered; | 49 | __u32 ifa_prefered; |
53 | __u32 ifa_valid; | 50 | __u32 ifa_valid; |
54 | __u32 cstamp; /* created timestamp, hundredths of seconds */ | 51 | __u32 cstamp; /* created timestamp, hundredths of seconds */ |
diff --git a/include/linux/if_addrlabel.h b/include/linux/if_addrlabel.h index 89571f65d6de..54580c298187 100644 --- a/include/linux/if_addrlabel.h +++ b/include/linux/if_addrlabel.h | |||
@@ -12,8 +12,7 @@ | |||
12 | 12 | ||
13 | #include <linux/types.h> | 13 | #include <linux/types.h> |
14 | 14 | ||
15 | struct ifaddrlblmsg | 15 | struct ifaddrlblmsg { |
16 | { | ||
17 | __u8 ifal_family; /* Address family */ | 16 | __u8 ifal_family; /* Address family */ |
18 | __u8 __ifal_reserved; /* Reserved */ | 17 | __u8 __ifal_reserved; /* Reserved */ |
19 | __u8 ifal_prefixlen; /* Prefix length */ | 18 | __u8 ifal_prefixlen; /* Prefix length */ |
@@ -22,8 +21,7 @@ struct ifaddrlblmsg | |||
22 | __u32 ifal_seq; /* sequence number */ | 21 | __u32 ifal_seq; /* sequence number */ |
23 | }; | 22 | }; |
24 | 23 | ||
25 | enum | 24 | enum { |
26 | { | ||
27 | IFAL_ADDRESS = 1, | 25 | IFAL_ADDRESS = 1, |
28 | IFAL_LABEL = 2, | 26 | IFAL_LABEL = 2, |
29 | __IFAL_MAX | 27 | __IFAL_MAX |
diff --git a/include/linux/if_arcnet.h b/include/linux/if_arcnet.h index 0835debab115..46e34bd0e783 100644 --- a/include/linux/if_arcnet.h +++ b/include/linux/if_arcnet.h | |||
@@ -56,8 +56,7 @@ | |||
56 | /* | 56 | /* |
57 | * The RFC1201-specific components of an arcnet packet header. | 57 | * The RFC1201-specific components of an arcnet packet header. |
58 | */ | 58 | */ |
59 | struct arc_rfc1201 | 59 | struct arc_rfc1201 { |
60 | { | ||
61 | __u8 proto; /* protocol ID field - varies */ | 60 | __u8 proto; /* protocol ID field - varies */ |
62 | __u8 split_flag; /* for use with split packets */ | 61 | __u8 split_flag; /* for use with split packets */ |
63 | __be16 sequence; /* sequence number */ | 62 | __be16 sequence; /* sequence number */ |
@@ -69,8 +68,7 @@ struct arc_rfc1201 | |||
69 | /* | 68 | /* |
70 | * The RFC1051-specific components. | 69 | * The RFC1051-specific components. |
71 | */ | 70 | */ |
72 | struct arc_rfc1051 | 71 | struct arc_rfc1051 { |
73 | { | ||
74 | __u8 proto; /* ARC_P_RFC1051_ARP/RFC1051_IP */ | 72 | __u8 proto; /* ARC_P_RFC1051_ARP/RFC1051_IP */ |
75 | __u8 payload[0]; /* 507 bytes */ | 73 | __u8 payload[0]; /* 507 bytes */ |
76 | }; | 74 | }; |
@@ -81,8 +79,7 @@ struct arc_rfc1051 | |||
81 | * The ethernet-encap-specific components. We have a real ethernet header | 79 | * The ethernet-encap-specific components. We have a real ethernet header |
82 | * and some data. | 80 | * and some data. |
83 | */ | 81 | */ |
84 | struct arc_eth_encap | 82 | struct arc_eth_encap { |
85 | { | ||
86 | __u8 proto; /* Always ARC_P_ETHER */ | 83 | __u8 proto; /* Always ARC_P_ETHER */ |
87 | struct ethhdr eth; /* standard ethernet header (yuck!) */ | 84 | struct ethhdr eth; /* standard ethernet header (yuck!) */ |
88 | __u8 payload[0]; /* 493 bytes */ | 85 | __u8 payload[0]; /* 493 bytes */ |
@@ -90,8 +87,7 @@ struct arc_eth_encap | |||
90 | #define ETH_ENCAP_HDR_SIZE 14 | 87 | #define ETH_ENCAP_HDR_SIZE 14 |
91 | 88 | ||
92 | 89 | ||
93 | struct arc_cap | 90 | struct arc_cap { |
94 | { | ||
95 | __u8 proto; | 91 | __u8 proto; |
96 | __u8 cookie[sizeof(int)]; /* Actually NOT sent over the network */ | 92 | __u8 cookie[sizeof(int)]; /* Actually NOT sent over the network */ |
97 | union { | 93 | union { |
@@ -108,8 +104,7 @@ struct arc_cap | |||
108 | * the _end_ of the 512-byte buffer. We hide this complexity inside the | 104 | * the _end_ of the 512-byte buffer. We hide this complexity inside the |
109 | * driver. | 105 | * driver. |
110 | */ | 106 | */ |
111 | struct arc_hardware | 107 | struct arc_hardware { |
112 | { | ||
113 | __u8 source, /* source ARCnet - filled in automagically */ | 108 | __u8 source, /* source ARCnet - filled in automagically */ |
114 | dest, /* destination ARCnet - 0 for broadcast */ | 109 | dest, /* destination ARCnet - 0 for broadcast */ |
115 | offset[2]; /* offset bytes (some weird semantics) */ | 110 | offset[2]; /* offset bytes (some weird semantics) */ |
@@ -120,8 +115,7 @@ struct arc_hardware | |||
120 | * This is an ARCnet frame header, as seen by the kernel (and userspace, | 115 | * This is an ARCnet frame header, as seen by the kernel (and userspace, |
121 | * when you do a raw packet capture). | 116 | * when you do a raw packet capture). |
122 | */ | 117 | */ |
123 | struct archdr | 118 | struct archdr { |
124 | { | ||
125 | /* hardware requirements */ | 119 | /* hardware requirements */ |
126 | struct arc_hardware hard; | 120 | struct arc_hardware hard; |
127 | 121 | ||
diff --git a/include/linux/if_arp.h b/include/linux/if_arp.h index 282eb37e2dec..e80b7f88f7c6 100644 --- a/include/linux/if_arp.h +++ b/include/linux/if_arp.h | |||
@@ -133,8 +133,7 @@ struct arpreq_old { | |||
133 | * This structure defines an ethernet arp header. | 133 | * This structure defines an ethernet arp header. |
134 | */ | 134 | */ |
135 | 135 | ||
136 | struct arphdr | 136 | struct arphdr { |
137 | { | ||
138 | __be16 ar_hrd; /* format of hardware address */ | 137 | __be16 ar_hrd; /* format of hardware address */ |
139 | __be16 ar_pro; /* format of protocol address */ | 138 | __be16 ar_pro; /* format of protocol address */ |
140 | unsigned char ar_hln; /* length of hardware address */ | 139 | unsigned char ar_hln; /* length of hardware address */ |
diff --git a/include/linux/if_bonding.h b/include/linux/if_bonding.h index 65c2d247068b..cd525fae3c98 100644 --- a/include/linux/if_bonding.h +++ b/include/linux/if_bonding.h | |||
@@ -94,8 +94,7 @@ typedef struct ifbond { | |||
94 | __s32 miimon; | 94 | __s32 miimon; |
95 | } ifbond; | 95 | } ifbond; |
96 | 96 | ||
97 | typedef struct ifslave | 97 | typedef struct ifslave { |
98 | { | ||
99 | __s32 slave_id; /* Used as an IN param to the BOND_SLAVE_INFO_QUERY ioctl */ | 98 | __s32 slave_id; /* Used as an IN param to the BOND_SLAVE_INFO_QUERY ioctl */ |
100 | char slave_name[IFNAMSIZ]; | 99 | char slave_name[IFNAMSIZ]; |
101 | __s8 link; | 100 | __s8 link; |
diff --git a/include/linux/if_bridge.h b/include/linux/if_bridge.h index 6badb3e2c4e4..938b7e81df95 100644 --- a/include/linux/if_bridge.h +++ b/include/linux/if_bridge.h | |||
@@ -49,8 +49,7 @@ | |||
49 | #define BR_STATE_FORWARDING 3 | 49 | #define BR_STATE_FORWARDING 3 |
50 | #define BR_STATE_BLOCKING 4 | 50 | #define BR_STATE_BLOCKING 4 |
51 | 51 | ||
52 | struct __bridge_info | 52 | struct __bridge_info { |
53 | { | ||
54 | __u64 designated_root; | 53 | __u64 designated_root; |
55 | __u64 bridge_id; | 54 | __u64 bridge_id; |
56 | __u32 root_path_cost; | 55 | __u32 root_path_cost; |
@@ -72,8 +71,7 @@ struct __bridge_info | |||
72 | __u32 gc_timer_value; | 71 | __u32 gc_timer_value; |
73 | }; | 72 | }; |
74 | 73 | ||
75 | struct __port_info | 74 | struct __port_info { |
76 | { | ||
77 | __u64 designated_root; | 75 | __u64 designated_root; |
78 | __u64 designated_bridge; | 76 | __u64 designated_bridge; |
79 | __u16 port_id; | 77 | __u16 port_id; |
@@ -89,8 +87,7 @@ struct __port_info | |||
89 | __u32 hold_timer_value; | 87 | __u32 hold_timer_value; |
90 | }; | 88 | }; |
91 | 89 | ||
92 | struct __fdb_entry | 90 | struct __fdb_entry { |
93 | { | ||
94 | __u8 mac_addr[6]; | 91 | __u8 mac_addr[6]; |
95 | __u8 port_no; | 92 | __u8 port_no; |
96 | __u8 is_local; | 93 | __u8 is_local; |
diff --git a/include/linux/if_ec.h b/include/linux/if_ec.h index e7499aa79783..d85f9f48129f 100644 --- a/include/linux/if_ec.h +++ b/include/linux/if_ec.h | |||
@@ -5,14 +5,12 @@ | |||
5 | 5 | ||
6 | /* User visible stuff. Glibc provides its own but libc5 folk will use these */ | 6 | /* User visible stuff. Glibc provides its own but libc5 folk will use these */ |
7 | 7 | ||
8 | struct ec_addr | 8 | struct ec_addr { |
9 | { | ||
10 | unsigned char station; /* Station number. */ | 9 | unsigned char station; /* Station number. */ |
11 | unsigned char net; /* Network number. */ | 10 | unsigned char net; /* Network number. */ |
12 | }; | 11 | }; |
13 | 12 | ||
14 | struct sockaddr_ec | 13 | struct sockaddr_ec { |
15 | { | ||
16 | unsigned short sec_family; | 14 | unsigned short sec_family; |
17 | unsigned char port; /* Port number. */ | 15 | unsigned char port; /* Port number. */ |
18 | unsigned char cb; /* Control/flag byte. */ | 16 | unsigned char cb; /* Control/flag byte. */ |
@@ -37,8 +35,7 @@ struct sockaddr_ec | |||
37 | #define EC_HLEN 6 | 35 | #define EC_HLEN 6 |
38 | 36 | ||
39 | /* This is what an Econet frame looks like on the wire. */ | 37 | /* This is what an Econet frame looks like on the wire. */ |
40 | struct ec_framehdr | 38 | struct ec_framehdr { |
41 | { | ||
42 | unsigned char dst_stn; | 39 | unsigned char dst_stn; |
43 | unsigned char dst_net; | 40 | unsigned char dst_net; |
44 | unsigned char src_stn; | 41 | unsigned char src_stn; |
@@ -62,8 +59,7 @@ static inline struct econet_sock *ec_sk(const struct sock *sk) | |||
62 | return (struct econet_sock *)sk; | 59 | return (struct econet_sock *)sk; |
63 | } | 60 | } |
64 | 61 | ||
65 | struct ec_device | 62 | struct ec_device { |
66 | { | ||
67 | unsigned char station, net; /* Econet protocol address */ | 63 | unsigned char station, net; /* Econet protocol address */ |
68 | }; | 64 | }; |
69 | 65 | ||
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index 580b6004d00e..005e1525ab86 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h | |||
@@ -136,10 +136,6 @@ extern struct ctl_table ether_table[]; | |||
136 | 136 | ||
137 | extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); | 137 | extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len); |
138 | 138 | ||
139 | /* | ||
140 | * Display a 6 byte device address (MAC) in a readable format. | ||
141 | */ | ||
142 | extern char *print_mac(char *buf, const unsigned char *addr) __deprecated; | ||
143 | #define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" | 139 | #define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x" |
144 | #define MAC_BUF_SIZE 18 | 140 | #define MAC_BUF_SIZE 18 |
145 | #define DECLARE_MAC_BUF(var) char var[MAC_BUF_SIZE] | 141 | #define DECLARE_MAC_BUF(var) char var[MAC_BUF_SIZE] |
diff --git a/include/linux/if_fddi.h b/include/linux/if_fddi.h index 45de1046dbbf..5459c5c09930 100644 --- a/include/linux/if_fddi.h +++ b/include/linux/if_fddi.h | |||
@@ -63,36 +63,32 @@ | |||
63 | #define FDDI_UI_CMD 0x03 | 63 | #define FDDI_UI_CMD 0x03 |
64 | 64 | ||
65 | /* Define 802.2 Type 1 header */ | 65 | /* Define 802.2 Type 1 header */ |
66 | struct fddi_8022_1_hdr | 66 | struct fddi_8022_1_hdr { |
67 | { | ||
68 | __u8 dsap; /* destination service access point */ | 67 | __u8 dsap; /* destination service access point */ |
69 | __u8 ssap; /* source service access point */ | 68 | __u8 ssap; /* source service access point */ |
70 | __u8 ctrl; /* control byte #1 */ | 69 | __u8 ctrl; /* control byte #1 */ |
71 | } __attribute__ ((packed)); | 70 | } __attribute__ ((packed)); |
72 | 71 | ||
73 | /* Define 802.2 Type 2 header */ | 72 | /* Define 802.2 Type 2 header */ |
74 | struct fddi_8022_2_hdr | 73 | struct fddi_8022_2_hdr { |
75 | { | ||
76 | __u8 dsap; /* destination service access point */ | 74 | __u8 dsap; /* destination service access point */ |
77 | __u8 ssap; /* source service access point */ | 75 | __u8 ssap; /* source service access point */ |
78 | __u8 ctrl_1; /* control byte #1 */ | 76 | __u8 ctrl_1; /* control byte #1 */ |
79 | __u8 ctrl_2; /* control byte #2 */ | 77 | __u8 ctrl_2; /* control byte #2 */ |
80 | } __attribute__ ((packed)); | 78 | } __attribute__ ((packed)); |
81 | 79 | ||
82 | /* Define 802.2 SNAP header */ | 80 | /* Define 802.2 SNAP header */ |
83 | #define FDDI_K_OUI_LEN 3 | 81 | #define FDDI_K_OUI_LEN 3 |
84 | struct fddi_snap_hdr | 82 | struct fddi_snap_hdr { |
85 | { | ||
86 | __u8 dsap; /* always 0xAA */ | 83 | __u8 dsap; /* always 0xAA */ |
87 | __u8 ssap; /* always 0xAA */ | 84 | __u8 ssap; /* always 0xAA */ |
88 | __u8 ctrl; /* always 0x03 */ | 85 | __u8 ctrl; /* always 0x03 */ |
89 | __u8 oui[FDDI_K_OUI_LEN]; /* organizational universal id */ | 86 | __u8 oui[FDDI_K_OUI_LEN]; /* organizational universal id */ |
90 | __be16 ethertype; /* packet type ID field */ | 87 | __be16 ethertype; /* packet type ID field */ |
91 | } __attribute__ ((packed)); | 88 | } __attribute__ ((packed)); |
92 | 89 | ||
93 | /* Define FDDI LLC frame header */ | 90 | /* Define FDDI LLC frame header */ |
94 | struct fddihdr | 91 | struct fddihdr { |
95 | { | ||
96 | __u8 fc; /* frame control */ | 92 | __u8 fc; /* frame control */ |
97 | __u8 daddr[FDDI_K_ALEN]; /* destination address */ | 93 | __u8 daddr[FDDI_K_ALEN]; /* destination address */ |
98 | __u8 saddr[FDDI_K_ALEN]; /* source address */ | 94 | __u8 saddr[FDDI_K_ALEN]; /* source address */ |
@@ -102,7 +98,7 @@ struct fddihdr | |||
102 | struct fddi_8022_2_hdr llc_8022_2; | 98 | struct fddi_8022_2_hdr llc_8022_2; |
103 | struct fddi_snap_hdr llc_snap; | 99 | struct fddi_snap_hdr llc_snap; |
104 | } hdr; | 100 | } hdr; |
105 | } __attribute__ ((packed)); | 101 | } __attribute__ ((packed)); |
106 | 102 | ||
107 | #ifdef __KERNEL__ | 103 | #ifdef __KERNEL__ |
108 | #include <linux/netdevice.h> | 104 | #include <linux/netdevice.h> |
@@ -197,7 +193,7 @@ struct fddi_statistics { | |||
197 | __u32 port_pc_withhold[2]; | 193 | __u32 port_pc_withhold[2]; |
198 | __u32 port_ler_flag[2]; | 194 | __u32 port_ler_flag[2]; |
199 | __u32 port_hardware_present[2]; | 195 | __u32 port_hardware_present[2]; |
200 | }; | 196 | }; |
201 | #endif /* __KERNEL__ */ | 197 | #endif /* __KERNEL__ */ |
202 | 198 | ||
203 | #endif /* _LINUX_IF_FDDI_H */ | 199 | #endif /* _LINUX_IF_FDDI_H */ |
diff --git a/include/linux/if_hippi.h b/include/linux/if_hippi.h index 4a7c9940b080..8d038eb8db5c 100644 --- a/include/linux/if_hippi.h +++ b/include/linux/if_hippi.h | |||
@@ -51,8 +51,7 @@ | |||
51 | * HIPPI statistics collection data. | 51 | * HIPPI statistics collection data. |
52 | */ | 52 | */ |
53 | 53 | ||
54 | struct hipnet_statistics | 54 | struct hipnet_statistics { |
55 | { | ||
56 | int rx_packets; /* total packets received */ | 55 | int rx_packets; /* total packets received */ |
57 | int tx_packets; /* total packets transmitted */ | 56 | int tx_packets; /* total packets transmitted */ |
58 | int rx_errors; /* bad packets received */ | 57 | int rx_errors; /* bad packets received */ |
@@ -77,8 +76,7 @@ struct hipnet_statistics | |||
77 | }; | 76 | }; |
78 | 77 | ||
79 | 78 | ||
80 | struct hippi_fp_hdr | 79 | struct hippi_fp_hdr { |
81 | { | ||
82 | #if 0 | 80 | #if 0 |
83 | __u8 ulp; /* must contain 4 */ | 81 | __u8 ulp; /* must contain 4 */ |
84 | #if defined (__BIG_ENDIAN_BITFIELD) | 82 | #if defined (__BIG_ENDIAN_BITFIELD) |
@@ -108,8 +106,7 @@ struct hippi_fp_hdr | |||
108 | __be32 d2_size; | 106 | __be32 d2_size; |
109 | } __attribute__ ((packed)); | 107 | } __attribute__ ((packed)); |
110 | 108 | ||
111 | struct hippi_le_hdr | 109 | struct hippi_le_hdr { |
112 | { | ||
113 | #if defined (__BIG_ENDIAN_BITFIELD) | 110 | #if defined (__BIG_ENDIAN_BITFIELD) |
114 | __u8 fc:3; | 111 | __u8 fc:3; |
115 | __u8 double_wide:1; | 112 | __u8 double_wide:1; |
@@ -139,8 +136,7 @@ struct hippi_le_hdr | |||
139 | * Looks like the dsap and ssap fields have been swapped by mistake in | 136 | * Looks like the dsap and ssap fields have been swapped by mistake in |
140 | * RFC 2067 "IP over HIPPI". | 137 | * RFC 2067 "IP over HIPPI". |
141 | */ | 138 | */ |
142 | struct hippi_snap_hdr | 139 | struct hippi_snap_hdr { |
143 | { | ||
144 | __u8 dsap; /* always 0xAA */ | 140 | __u8 dsap; /* always 0xAA */ |
145 | __u8 ssap; /* always 0xAA */ | 141 | __u8 ssap; /* always 0xAA */ |
146 | __u8 ctrl; /* always 0x03 */ | 142 | __u8 ctrl; /* always 0x03 */ |
@@ -148,8 +144,7 @@ struct hippi_snap_hdr | |||
148 | __be16 ethertype; /* packet type ID field */ | 144 | __be16 ethertype; /* packet type ID field */ |
149 | } __attribute__ ((packed)); | 145 | } __attribute__ ((packed)); |
150 | 146 | ||
151 | struct hippi_hdr | 147 | struct hippi_hdr { |
152 | { | ||
153 | struct hippi_fp_hdr fp; | 148 | struct hippi_fp_hdr fp; |
154 | struct hippi_le_hdr le; | 149 | struct hippi_le_hdr le; |
155 | struct hippi_snap_hdr snap; | 150 | struct hippi_snap_hdr snap; |
diff --git a/include/linux/if_link.h b/include/linux/if_link.h index 176c5182c515..6674791622ca 100644 --- a/include/linux/if_link.h +++ b/include/linux/if_link.h | |||
@@ -5,8 +5,7 @@ | |||
5 | #include <linux/netlink.h> | 5 | #include <linux/netlink.h> |
6 | 6 | ||
7 | /* The struct should be in sync with struct net_device_stats */ | 7 | /* The struct should be in sync with struct net_device_stats */ |
8 | struct rtnl_link_stats | 8 | struct rtnl_link_stats { |
9 | { | ||
10 | __u32 rx_packets; /* total packets received */ | 9 | __u32 rx_packets; /* total packets received */ |
11 | __u32 tx_packets; /* total packets transmitted */ | 10 | __u32 tx_packets; /* total packets transmitted */ |
12 | __u32 rx_bytes; /* total bytes received */ | 11 | __u32 rx_bytes; /* total bytes received */ |
@@ -39,8 +38,7 @@ struct rtnl_link_stats | |||
39 | }; | 38 | }; |
40 | 39 | ||
41 | /* The struct should be in sync with struct ifmap */ | 40 | /* The struct should be in sync with struct ifmap */ |
42 | struct rtnl_link_ifmap | 41 | struct rtnl_link_ifmap { |
43 | { | ||
44 | __u64 mem_start; | 42 | __u64 mem_start; |
45 | __u64 mem_end; | 43 | __u64 mem_end; |
46 | __u64 base_addr; | 44 | __u64 base_addr; |
@@ -49,8 +47,7 @@ struct rtnl_link_ifmap | |||
49 | __u8 port; | 47 | __u8 port; |
50 | }; | 48 | }; |
51 | 49 | ||
52 | enum | 50 | enum { |
53 | { | ||
54 | IFLA_UNSPEC, | 51 | IFLA_UNSPEC, |
55 | IFLA_ADDRESS, | 52 | IFLA_ADDRESS, |
56 | IFLA_BROADCAST, | 53 | IFLA_BROADCAST, |
@@ -123,8 +120,7 @@ enum | |||
123 | */ | 120 | */ |
124 | 121 | ||
125 | /* Subtype attributes for IFLA_PROTINFO */ | 122 | /* Subtype attributes for IFLA_PROTINFO */ |
126 | enum | 123 | enum { |
127 | { | ||
128 | IFLA_INET6_UNSPEC, | 124 | IFLA_INET6_UNSPEC, |
129 | IFLA_INET6_FLAGS, /* link flags */ | 125 | IFLA_INET6_FLAGS, /* link flags */ |
130 | IFLA_INET6_CONF, /* sysctl parameters */ | 126 | IFLA_INET6_CONF, /* sysctl parameters */ |
@@ -137,16 +133,14 @@ enum | |||
137 | 133 | ||
138 | #define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1) | 134 | #define IFLA_INET6_MAX (__IFLA_INET6_MAX - 1) |
139 | 135 | ||
140 | struct ifla_cacheinfo | 136 | struct ifla_cacheinfo { |
141 | { | ||
142 | __u32 max_reasm_len; | 137 | __u32 max_reasm_len; |
143 | __u32 tstamp; /* ipv6InterfaceTable updated timestamp */ | 138 | __u32 tstamp; /* ipv6InterfaceTable updated timestamp */ |
144 | __u32 reachable_time; | 139 | __u32 reachable_time; |
145 | __u32 retrans_time; | 140 | __u32 retrans_time; |
146 | }; | 141 | }; |
147 | 142 | ||
148 | enum | 143 | enum { |
149 | { | ||
150 | IFLA_INFO_UNSPEC, | 144 | IFLA_INFO_UNSPEC, |
151 | IFLA_INFO_KIND, | 145 | IFLA_INFO_KIND, |
152 | IFLA_INFO_DATA, | 146 | IFLA_INFO_DATA, |
@@ -158,8 +152,7 @@ enum | |||
158 | 152 | ||
159 | /* VLAN section */ | 153 | /* VLAN section */ |
160 | 154 | ||
161 | enum | 155 | enum { |
162 | { | ||
163 | IFLA_VLAN_UNSPEC, | 156 | IFLA_VLAN_UNSPEC, |
164 | IFLA_VLAN_ID, | 157 | IFLA_VLAN_ID, |
165 | IFLA_VLAN_FLAGS, | 158 | IFLA_VLAN_FLAGS, |
@@ -175,8 +168,7 @@ struct ifla_vlan_flags { | |||
175 | __u32 mask; | 168 | __u32 mask; |
176 | }; | 169 | }; |
177 | 170 | ||
178 | enum | 171 | enum { |
179 | { | ||
180 | IFLA_VLAN_QOS_UNSPEC, | 172 | IFLA_VLAN_QOS_UNSPEC, |
181 | IFLA_VLAN_QOS_MAPPING, | 173 | IFLA_VLAN_QOS_MAPPING, |
182 | __IFLA_VLAN_QOS_MAX | 174 | __IFLA_VLAN_QOS_MAX |
@@ -184,10 +176,24 @@ enum | |||
184 | 176 | ||
185 | #define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1) | 177 | #define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1) |
186 | 178 | ||
187 | struct ifla_vlan_qos_mapping | 179 | struct ifla_vlan_qos_mapping { |
188 | { | ||
189 | __u32 from; | 180 | __u32 from; |
190 | __u32 to; | 181 | __u32 to; |
191 | }; | 182 | }; |
192 | 183 | ||
184 | /* MACVLAN section */ | ||
185 | enum { | ||
186 | IFLA_MACVLAN_UNSPEC, | ||
187 | IFLA_MACVLAN_MODE, | ||
188 | __IFLA_MACVLAN_MAX, | ||
189 | }; | ||
190 | |||
191 | #define IFLA_MACVLAN_MAX (__IFLA_MACVLAN_MAX - 1) | ||
192 | |||
193 | enum macvlan_mode { | ||
194 | MACVLAN_MODE_PRIVATE = 1, /* don't talk to other macvlans */ | ||
195 | MACVLAN_MODE_VEPA = 2, /* talk to other ports through ext bridge */ | ||
196 | MACVLAN_MODE_BRIDGE = 4, /* talk to bridge ports directly */ | ||
197 | }; | ||
198 | |||
193 | #endif /* _LINUX_IF_LINK_H */ | 199 | #endif /* _LINUX_IF_LINK_H */ |
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h index dea7d6b7cf98..4021d47cc437 100644 --- a/include/linux/if_packet.h +++ b/include/linux/if_packet.h | |||
@@ -3,15 +3,13 @@ | |||
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | 5 | ||
6 | struct sockaddr_pkt | 6 | struct sockaddr_pkt { |
7 | { | ||
8 | unsigned short spkt_family; | 7 | unsigned short spkt_family; |
9 | unsigned char spkt_device[14]; | 8 | unsigned char spkt_device[14]; |
10 | __be16 spkt_protocol; | 9 | __be16 spkt_protocol; |
11 | }; | 10 | }; |
12 | 11 | ||
13 | struct sockaddr_ll | 12 | struct sockaddr_ll { |
14 | { | ||
15 | unsigned short sll_family; | 13 | unsigned short sll_family; |
16 | __be16 sll_protocol; | 14 | __be16 sll_protocol; |
17 | int sll_ifindex; | 15 | int sll_ifindex; |
@@ -49,14 +47,12 @@ struct sockaddr_ll | |||
49 | #define PACKET_TX_RING 13 | 47 | #define PACKET_TX_RING 13 |
50 | #define PACKET_LOSS 14 | 48 | #define PACKET_LOSS 14 |
51 | 49 | ||
52 | struct tpacket_stats | 50 | struct tpacket_stats { |
53 | { | ||
54 | unsigned int tp_packets; | 51 | unsigned int tp_packets; |
55 | unsigned int tp_drops; | 52 | unsigned int tp_drops; |
56 | }; | 53 | }; |
57 | 54 | ||
58 | struct tpacket_auxdata | 55 | struct tpacket_auxdata { |
59 | { | ||
60 | __u32 tp_status; | 56 | __u32 tp_status; |
61 | __u32 tp_len; | 57 | __u32 tp_len; |
62 | __u32 tp_snaplen; | 58 | __u32 tp_snaplen; |
@@ -78,8 +74,7 @@ struct tpacket_auxdata | |||
78 | #define TP_STATUS_SENDING 0x2 | 74 | #define TP_STATUS_SENDING 0x2 |
79 | #define TP_STATUS_WRONG_FORMAT 0x4 | 75 | #define TP_STATUS_WRONG_FORMAT 0x4 |
80 | 76 | ||
81 | struct tpacket_hdr | 77 | struct tpacket_hdr { |
82 | { | ||
83 | unsigned long tp_status; | 78 | unsigned long tp_status; |
84 | unsigned int tp_len; | 79 | unsigned int tp_len; |
85 | unsigned int tp_snaplen; | 80 | unsigned int tp_snaplen; |
@@ -93,8 +88,7 @@ struct tpacket_hdr | |||
93 | #define TPACKET_ALIGN(x) (((x)+TPACKET_ALIGNMENT-1)&~(TPACKET_ALIGNMENT-1)) | 88 | #define TPACKET_ALIGN(x) (((x)+TPACKET_ALIGNMENT-1)&~(TPACKET_ALIGNMENT-1)) |
94 | #define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll)) | 89 | #define TPACKET_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket_hdr)) + sizeof(struct sockaddr_ll)) |
95 | 90 | ||
96 | struct tpacket2_hdr | 91 | struct tpacket2_hdr { |
97 | { | ||
98 | __u32 tp_status; | 92 | __u32 tp_status; |
99 | __u32 tp_len; | 93 | __u32 tp_len; |
100 | __u32 tp_snaplen; | 94 | __u32 tp_snaplen; |
@@ -107,8 +101,7 @@ struct tpacket2_hdr | |||
107 | 101 | ||
108 | #define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll)) | 102 | #define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll)) |
109 | 103 | ||
110 | enum tpacket_versions | 104 | enum tpacket_versions { |
111 | { | ||
112 | TPACKET_V1, | 105 | TPACKET_V1, |
113 | TPACKET_V2, | 106 | TPACKET_V2, |
114 | }; | 107 | }; |
@@ -126,16 +119,14 @@ enum tpacket_versions | |||
126 | - Pad to align to TPACKET_ALIGNMENT=16 | 119 | - Pad to align to TPACKET_ALIGNMENT=16 |
127 | */ | 120 | */ |
128 | 121 | ||
129 | struct tpacket_req | 122 | struct tpacket_req { |
130 | { | ||
131 | unsigned int tp_block_size; /* Minimal size of contiguous block */ | 123 | unsigned int tp_block_size; /* Minimal size of contiguous block */ |
132 | unsigned int tp_block_nr; /* Number of blocks */ | 124 | unsigned int tp_block_nr; /* Number of blocks */ |
133 | unsigned int tp_frame_size; /* Size of frame */ | 125 | unsigned int tp_frame_size; /* Size of frame */ |
134 | unsigned int tp_frame_nr; /* Total number of frames */ | 126 | unsigned int tp_frame_nr; /* Total number of frames */ |
135 | }; | 127 | }; |
136 | 128 | ||
137 | struct packet_mreq | 129 | struct packet_mreq { |
138 | { | ||
139 | int mr_ifindex; | 130 | int mr_ifindex; |
140 | unsigned short mr_type; | 131 | unsigned short mr_type; |
141 | unsigned short mr_alen; | 132 | unsigned short mr_alen; |
diff --git a/include/linux/if_plip.h b/include/linux/if_plip.h index 153a649915a2..6298c7e88b2b 100644 --- a/include/linux/if_plip.h +++ b/include/linux/if_plip.h | |||
@@ -15,8 +15,7 @@ | |||
15 | 15 | ||
16 | #define SIOCDEVPLIP SIOCDEVPRIVATE | 16 | #define SIOCDEVPLIP SIOCDEVPRIVATE |
17 | 17 | ||
18 | struct plipconf | 18 | struct plipconf { |
19 | { | ||
20 | unsigned short pcmd; | 19 | unsigned short pcmd; |
21 | unsigned long nibble; | 20 | unsigned long nibble; |
22 | unsigned long trigger; | 21 | unsigned long trigger; |
diff --git a/include/linux/if_pppol2tp.h b/include/linux/if_pppol2tp.h index 3a14b088c8ec..c58baea4a25b 100644 --- a/include/linux/if_pppol2tp.h +++ b/include/linux/if_pppol2tp.h | |||
@@ -24,8 +24,7 @@ | |||
24 | /* Structure used to connect() the socket to a particular tunnel UDP | 24 | /* Structure used to connect() the socket to a particular tunnel UDP |
25 | * socket. | 25 | * socket. |
26 | */ | 26 | */ |
27 | struct pppol2tp_addr | 27 | struct pppol2tp_addr { |
28 | { | ||
29 | __kernel_pid_t pid; /* pid that owns the fd. | 28 | __kernel_pid_t pid; /* pid that owns the fd. |
30 | * 0 => current */ | 29 | * 0 => current */ |
31 | int fd; /* FD of UDP socket to use */ | 30 | int fd; /* FD of UDP socket to use */ |
diff --git a/include/linux/if_tunnel.h b/include/linux/if_tunnel.h index 5a9aae4adb44..1822d635be6b 100644 --- a/include/linux/if_tunnel.h +++ b/include/linux/if_tunnel.h | |||
@@ -5,6 +5,7 @@ | |||
5 | 5 | ||
6 | #ifdef __KERNEL__ | 6 | #ifdef __KERNEL__ |
7 | #include <linux/ip.h> | 7 | #include <linux/ip.h> |
8 | #include <linux/in6.h> | ||
8 | #endif | 9 | #endif |
9 | 10 | ||
10 | #define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0) | 11 | #define SIOCGETTUNNEL (SIOCDEVPRIVATE + 0) |
@@ -15,6 +16,10 @@ | |||
15 | #define SIOCADDPRL (SIOCDEVPRIVATE + 5) | 16 | #define SIOCADDPRL (SIOCDEVPRIVATE + 5) |
16 | #define SIOCDELPRL (SIOCDEVPRIVATE + 6) | 17 | #define SIOCDELPRL (SIOCDEVPRIVATE + 6) |
17 | #define SIOCCHGPRL (SIOCDEVPRIVATE + 7) | 18 | #define SIOCCHGPRL (SIOCDEVPRIVATE + 7) |
19 | #define SIOCGET6RD (SIOCDEVPRIVATE + 8) | ||
20 | #define SIOCADD6RD (SIOCDEVPRIVATE + 9) | ||
21 | #define SIOCDEL6RD (SIOCDEVPRIVATE + 10) | ||
22 | #define SIOCCHG6RD (SIOCDEVPRIVATE + 11) | ||
18 | 23 | ||
19 | #define GRE_CSUM __cpu_to_be16(0x8000) | 24 | #define GRE_CSUM __cpu_to_be16(0x8000) |
20 | #define GRE_ROUTING __cpu_to_be16(0x4000) | 25 | #define GRE_ROUTING __cpu_to_be16(0x4000) |
@@ -25,8 +30,7 @@ | |||
25 | #define GRE_FLAGS __cpu_to_be16(0x00F8) | 30 | #define GRE_FLAGS __cpu_to_be16(0x00F8) |
26 | #define GRE_VERSION __cpu_to_be16(0x0007) | 31 | #define GRE_VERSION __cpu_to_be16(0x0007) |
27 | 32 | ||
28 | struct ip_tunnel_parm | 33 | struct ip_tunnel_parm { |
29 | { | ||
30 | char name[IFNAMSIZ]; | 34 | char name[IFNAMSIZ]; |
31 | int link; | 35 | int link; |
32 | __be16 i_flags; | 36 | __be16 i_flags; |
@@ -51,8 +55,14 @@ struct ip_tunnel_prl { | |||
51 | /* PRL flags */ | 55 | /* PRL flags */ |
52 | #define PRL_DEFAULT 0x0001 | 56 | #define PRL_DEFAULT 0x0001 |
53 | 57 | ||
54 | enum | 58 | struct ip_tunnel_6rd { |
55 | { | 59 | struct in6_addr prefix; |
60 | __be32 relay_prefix; | ||
61 | __u16 prefixlen; | ||
62 | __u16 relay_prefixlen; | ||
63 | }; | ||
64 | |||
65 | enum { | ||
56 | IFLA_GRE_UNSPEC, | 66 | IFLA_GRE_UNSPEC, |
57 | IFLA_GRE_LINK, | 67 | IFLA_GRE_LINK, |
58 | IFLA_GRE_IFLAGS, | 68 | IFLA_GRE_IFLAGS, |
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h index 7ff9af1d0f05..3d870fda8c4f 100644 --- a/include/linux/if_vlan.h +++ b/include/linux/if_vlan.h | |||
@@ -63,7 +63,11 @@ static inline struct vlan_ethhdr *vlan_eth_hdr(const struct sk_buff *skb) | |||
63 | return (struct vlan_ethhdr *)skb_mac_header(skb); | 63 | return (struct vlan_ethhdr *)skb_mac_header(skb); |
64 | } | 64 | } |
65 | 65 | ||
66 | #define VLAN_VID_MASK 0xfff | 66 | #define VLAN_PRIO_MASK 0xe000 /* Priority Code Point */ |
67 | #define VLAN_PRIO_SHIFT 13 | ||
68 | #define VLAN_CFI_MASK 0x1000 /* Canonical Format Indicator */ | ||
69 | #define VLAN_TAG_PRESENT VLAN_CFI_MASK | ||
70 | #define VLAN_VID_MASK 0x0fff /* VLAN Identifier */ | ||
67 | 71 | ||
68 | /* found in socket.c */ | 72 | /* found in socket.c */ |
69 | extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *)); | 73 | extern void vlan_ioctl_set(int (*hook)(struct net *, void __user *)); |
@@ -81,6 +85,7 @@ struct vlan_group { | |||
81 | * the vlan is attached to. | 85 | * the vlan is attached to. |
82 | */ | 86 | */ |
83 | unsigned int nr_vlans; | 87 | unsigned int nr_vlans; |
88 | int killall; | ||
84 | struct hlist_node hlist; /* linked list */ | 89 | struct hlist_node hlist; /* linked list */ |
85 | struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS]; | 90 | struct net_device **vlan_devices_arrays[VLAN_GROUP_ARRAY_SPLIT_PARTS]; |
86 | struct rcu_head rcu; | 91 | struct rcu_head rcu; |
@@ -105,8 +110,8 @@ static inline void vlan_group_set_device(struct vlan_group *vg, | |||
105 | array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev; | 110 | array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev; |
106 | } | 111 | } |
107 | 112 | ||
108 | #define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci) | 113 | #define vlan_tx_tag_present(__skb) ((__skb)->vlan_tci & VLAN_TAG_PRESENT) |
109 | #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci) | 114 | #define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) |
110 | 115 | ||
111 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) | 116 | #if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) |
112 | extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); | 117 | extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); |
@@ -115,10 +120,12 @@ extern u16 vlan_dev_vlan_id(const struct net_device *dev); | |||
115 | extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, | 120 | extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp, |
116 | u16 vlan_tci, int polling); | 121 | u16 vlan_tci, int polling); |
117 | extern int vlan_hwaccel_do_receive(struct sk_buff *skb); | 122 | extern int vlan_hwaccel_do_receive(struct sk_buff *skb); |
118 | extern int vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, | 123 | extern gro_result_t |
119 | unsigned int vlan_tci, struct sk_buff *skb); | 124 | vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, |
120 | extern int vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp, | 125 | unsigned int vlan_tci, struct sk_buff *skb); |
121 | unsigned int vlan_tci); | 126 | extern gro_result_t |
127 | vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp, | ||
128 | unsigned int vlan_tci); | ||
122 | 129 | ||
123 | #else | 130 | #else |
124 | static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev) | 131 | static inline struct net_device *vlan_dev_real_dev(const struct net_device *dev) |
@@ -145,17 +152,18 @@ static inline int vlan_hwaccel_do_receive(struct sk_buff *skb) | |||
145 | return 0; | 152 | return 0; |
146 | } | 153 | } |
147 | 154 | ||
148 | static inline int vlan_gro_receive(struct napi_struct *napi, | 155 | static inline gro_result_t |
149 | struct vlan_group *grp, | 156 | vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp, |
150 | unsigned int vlan_tci, struct sk_buff *skb) | 157 | unsigned int vlan_tci, struct sk_buff *skb) |
151 | { | 158 | { |
152 | return NET_RX_DROP; | 159 | return GRO_DROP; |
153 | } | 160 | } |
154 | 161 | ||
155 | static inline int vlan_gro_frags(struct napi_struct *napi, | 162 | static inline gro_result_t |
156 | struct vlan_group *grp, unsigned int vlan_tci) | 163 | vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp, |
164 | unsigned int vlan_tci) | ||
157 | { | 165 | { |
158 | return NET_RX_DROP; | 166 | return GRO_DROP; |
159 | } | 167 | } |
160 | #endif | 168 | #endif |
161 | 169 | ||
@@ -231,7 +239,7 @@ static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci) | |||
231 | static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, | 239 | static inline struct sk_buff *__vlan_hwaccel_put_tag(struct sk_buff *skb, |
232 | u16 vlan_tci) | 240 | u16 vlan_tci) |
233 | { | 241 | { |
234 | skb->vlan_tci = vlan_tci; | 242 | skb->vlan_tci = VLAN_TAG_PRESENT | vlan_tci; |
235 | return skb; | 243 | return skb; |
236 | } | 244 | } |
237 | 245 | ||
@@ -284,7 +292,7 @@ static inline int __vlan_hwaccel_get_tag(const struct sk_buff *skb, | |||
284 | u16 *vlan_tci) | 292 | u16 *vlan_tci) |
285 | { | 293 | { |
286 | if (vlan_tx_tag_present(skb)) { | 294 | if (vlan_tx_tag_present(skb)) { |
287 | *vlan_tci = skb->vlan_tci; | 295 | *vlan_tci = vlan_tx_tag_get(skb); |
288 | return 0; | 296 | return 0; |
289 | } else { | 297 | } else { |
290 | *vlan_tci = 0; | 298 | *vlan_tci = 0; |
@@ -331,6 +339,7 @@ enum vlan_ioctl_cmds { | |||
331 | enum vlan_flags { | 339 | enum vlan_flags { |
332 | VLAN_FLAG_REORDER_HDR = 0x1, | 340 | VLAN_FLAG_REORDER_HDR = 0x1, |
333 | VLAN_FLAG_GVRP = 0x2, | 341 | VLAN_FLAG_GVRP = 0x2, |
342 | VLAN_FLAG_LOOSE_BINDING = 0x4, | ||
334 | }; | 343 | }; |
335 | 344 | ||
336 | enum vlan_name_types { | 345 | enum vlan_name_types { |
diff --git a/include/linux/igmp.h b/include/linux/igmp.h index fe158e0e20e6..724c27e5d173 100644 --- a/include/linux/igmp.h +++ b/include/linux/igmp.h | |||
@@ -27,8 +27,7 @@ | |||
27 | * Header in on cable format | 27 | * Header in on cable format |
28 | */ | 28 | */ |
29 | 29 | ||
30 | struct igmphdr | 30 | struct igmphdr { |
31 | { | ||
32 | __u8 type; | 31 | __u8 type; |
33 | __u8 code; /* For newer IGMP */ | 32 | __u8 code; /* For newer IGMP */ |
34 | __sum16 csum; | 33 | __sum16 csum; |
@@ -151,8 +150,7 @@ static inline struct igmpv3_query * | |||
151 | extern int sysctl_igmp_max_memberships; | 150 | extern int sysctl_igmp_max_memberships; |
152 | extern int sysctl_igmp_max_msf; | 151 | extern int sysctl_igmp_max_msf; |
153 | 152 | ||
154 | struct ip_sf_socklist | 153 | struct ip_sf_socklist { |
155 | { | ||
156 | unsigned int sl_max; | 154 | unsigned int sl_max; |
157 | unsigned int sl_count; | 155 | unsigned int sl_count; |
158 | __be32 sl_addr[0]; | 156 | __be32 sl_addr[0]; |
@@ -167,16 +165,14 @@ struct ip_sf_socklist | |||
167 | this list never used in fast path code | 165 | this list never used in fast path code |
168 | */ | 166 | */ |
169 | 167 | ||
170 | struct ip_mc_socklist | 168 | struct ip_mc_socklist { |
171 | { | ||
172 | struct ip_mc_socklist *next; | 169 | struct ip_mc_socklist *next; |
173 | struct ip_mreqn multi; | 170 | struct ip_mreqn multi; |
174 | unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ | 171 | unsigned int sfmode; /* MCAST_{INCLUDE,EXCLUDE} */ |
175 | struct ip_sf_socklist *sflist; | 172 | struct ip_sf_socklist *sflist; |
176 | }; | 173 | }; |
177 | 174 | ||
178 | struct ip_sf_list | 175 | struct ip_sf_list { |
179 | { | ||
180 | struct ip_sf_list *sf_next; | 176 | struct ip_sf_list *sf_next; |
181 | __be32 sf_inaddr; | 177 | __be32 sf_inaddr; |
182 | unsigned long sf_count[2]; /* include/exclude counts */ | 178 | unsigned long sf_count[2]; /* include/exclude counts */ |
@@ -185,8 +181,7 @@ struct ip_sf_list | |||
185 | unsigned char sf_crcount; /* retrans. left to send */ | 181 | unsigned char sf_crcount; /* retrans. left to send */ |
186 | }; | 182 | }; |
187 | 183 | ||
188 | struct ip_mc_list | 184 | struct ip_mc_list { |
189 | { | ||
190 | struct in_device *interface; | 185 | struct in_device *interface; |
191 | __be32 multiaddr; | 186 | __be32 multiaddr; |
192 | struct ip_sf_list *sources; | 187 | struct ip_sf_list *sources; |
diff --git a/include/linux/in.h b/include/linux/in.h index cf196da04ec9..b615649db129 100644 --- a/include/linux/in.h +++ b/include/linux/in.h | |||
@@ -118,14 +118,12 @@ struct in_addr { | |||
118 | 118 | ||
119 | /* Request struct for multicast socket ops */ | 119 | /* Request struct for multicast socket ops */ |
120 | 120 | ||
121 | struct ip_mreq | 121 | struct ip_mreq { |
122 | { | ||
123 | struct in_addr imr_multiaddr; /* IP multicast address of group */ | 122 | struct in_addr imr_multiaddr; /* IP multicast address of group */ |
124 | struct in_addr imr_interface; /* local IP address of interface */ | 123 | struct in_addr imr_interface; /* local IP address of interface */ |
125 | }; | 124 | }; |
126 | 125 | ||
127 | struct ip_mreqn | 126 | struct ip_mreqn { |
128 | { | ||
129 | struct in_addr imr_multiaddr; /* IP multicast address of group */ | 127 | struct in_addr imr_multiaddr; /* IP multicast address of group */ |
130 | struct in_addr imr_address; /* local IP address of interface */ | 128 | struct in_addr imr_address; /* local IP address of interface */ |
131 | int imr_ifindex; /* Interface index */ | 129 | int imr_ifindex; /* Interface index */ |
@@ -149,21 +147,18 @@ struct ip_msfilter { | |||
149 | (sizeof(struct ip_msfilter) - sizeof(__u32) \ | 147 | (sizeof(struct ip_msfilter) - sizeof(__u32) \ |
150 | + (numsrc) * sizeof(__u32)) | 148 | + (numsrc) * sizeof(__u32)) |
151 | 149 | ||
152 | struct group_req | 150 | struct group_req { |
153 | { | ||
154 | __u32 gr_interface; /* interface index */ | 151 | __u32 gr_interface; /* interface index */ |
155 | struct __kernel_sockaddr_storage gr_group; /* group address */ | 152 | struct __kernel_sockaddr_storage gr_group; /* group address */ |
156 | }; | 153 | }; |
157 | 154 | ||
158 | struct group_source_req | 155 | struct group_source_req { |
159 | { | ||
160 | __u32 gsr_interface; /* interface index */ | 156 | __u32 gsr_interface; /* interface index */ |
161 | struct __kernel_sockaddr_storage gsr_group; /* group address */ | 157 | struct __kernel_sockaddr_storage gsr_group; /* group address */ |
162 | struct __kernel_sockaddr_storage gsr_source; /* source address */ | 158 | struct __kernel_sockaddr_storage gsr_source; /* source address */ |
163 | }; | 159 | }; |
164 | 160 | ||
165 | struct group_filter | 161 | struct group_filter { |
166 | { | ||
167 | __u32 gf_interface; /* interface index */ | 162 | __u32 gf_interface; /* interface index */ |
168 | struct __kernel_sockaddr_storage gf_group; /* multicast address */ | 163 | struct __kernel_sockaddr_storage gf_group; /* multicast address */ |
169 | __u32 gf_fmode; /* filter mode */ | 164 | __u32 gf_fmode; /* filter mode */ |
@@ -175,8 +170,7 @@ struct group_filter | |||
175 | (sizeof(struct group_filter) - sizeof(struct __kernel_sockaddr_storage) \ | 170 | (sizeof(struct group_filter) - sizeof(struct __kernel_sockaddr_storage) \ |
176 | + (numsrc) * sizeof(struct __kernel_sockaddr_storage)) | 171 | + (numsrc) * sizeof(struct __kernel_sockaddr_storage)) |
177 | 172 | ||
178 | struct in_pktinfo | 173 | struct in_pktinfo { |
179 | { | ||
180 | int ipi_ifindex; | 174 | int ipi_ifindex; |
181 | struct in_addr ipi_spec_dst; | 175 | struct in_addr ipi_spec_dst; |
182 | struct in_addr ipi_addr; | 176 | struct in_addr ipi_addr; |
diff --git a/include/linux/in6.h b/include/linux/in6.h index 718bf21c5754..bd55c6e46b2e 100644 --- a/include/linux/in6.h +++ b/include/linux/in6.h | |||
@@ -27,10 +27,8 @@ | |||
27 | * IPv6 address structure | 27 | * IPv6 address structure |
28 | */ | 28 | */ |
29 | 29 | ||
30 | struct in6_addr | 30 | struct in6_addr { |
31 | { | 31 | union { |
32 | union | ||
33 | { | ||
34 | __u8 u6_addr8[16]; | 32 | __u8 u6_addr8[16]; |
35 | __be16 u6_addr16[8]; | 33 | __be16 u6_addr16[8]; |
36 | __be32 u6_addr32[4]; | 34 | __be32 u6_addr32[4]; |
@@ -75,8 +73,7 @@ struct ipv6_mreq { | |||
75 | 73 | ||
76 | #define ipv6mr_acaddr ipv6mr_multiaddr | 74 | #define ipv6mr_acaddr ipv6mr_multiaddr |
77 | 75 | ||
78 | struct in6_flowlabel_req | 76 | struct in6_flowlabel_req { |
79 | { | ||
80 | struct in6_addr flr_dst; | 77 | struct in6_addr flr_dst; |
81 | __be32 flr_label; | 78 | __be32 flr_label; |
82 | __u8 flr_action; | 79 | __u8 flr_action; |
@@ -113,7 +110,7 @@ struct in6_flowlabel_req | |||
113 | #define IPV6_FLOWINFO_FLOWLABEL 0x000fffff | 110 | #define IPV6_FLOWINFO_FLOWLABEL 0x000fffff |
114 | #define IPV6_FLOWINFO_PRIORITY 0x0ff00000 | 111 | #define IPV6_FLOWINFO_PRIORITY 0x0ff00000 |
115 | 112 | ||
116 | /* These defintions are obsolete */ | 113 | /* These definitions are obsolete */ |
117 | #define IPV6_PRIORITY_UNCHARACTERIZED 0x0000 | 114 | #define IPV6_PRIORITY_UNCHARACTERIZED 0x0000 |
118 | #define IPV6_PRIORITY_FILLER 0x0100 | 115 | #define IPV6_PRIORITY_FILLER 0x0100 |
119 | #define IPV6_PRIORITY_UNATTENDED 0x0200 | 116 | #define IPV6_PRIORITY_UNATTENDED 0x0200 |
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h index ad27c7da8798..699e85c01a4d 100644 --- a/include/linux/inetdevice.h +++ b/include/linux/inetdevice.h | |||
@@ -10,15 +10,13 @@ | |||
10 | #include <linux/timer.h> | 10 | #include <linux/timer.h> |
11 | #include <linux/sysctl.h> | 11 | #include <linux/sysctl.h> |
12 | 12 | ||
13 | struct ipv4_devconf | 13 | struct ipv4_devconf { |
14 | { | ||
15 | void *sysctl; | 14 | void *sysctl; |
16 | int data[__NET_IPV4_CONF_MAX - 1]; | 15 | int data[__NET_IPV4_CONF_MAX - 1]; |
17 | DECLARE_BITMAP(state, __NET_IPV4_CONF_MAX - 1); | 16 | DECLARE_BITMAP(state, __NET_IPV4_CONF_MAX - 1); |
18 | }; | 17 | }; |
19 | 18 | ||
20 | struct in_device | 19 | struct in_device { |
21 | { | ||
22 | struct net_device *dev; | 20 | struct net_device *dev; |
23 | atomic_t refcnt; | 21 | atomic_t refcnt; |
24 | int dead; | 22 | int dead; |
@@ -85,6 +83,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) | |||
85 | #define IN_DEV_RPFILTER(in_dev) IN_DEV_MAXCONF((in_dev), RP_FILTER) | 83 | #define IN_DEV_RPFILTER(in_dev) IN_DEV_MAXCONF((in_dev), RP_FILTER) |
86 | #define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \ | 84 | #define IN_DEV_SOURCE_ROUTE(in_dev) IN_DEV_ANDCONF((in_dev), \ |
87 | ACCEPT_SOURCE_ROUTE) | 85 | ACCEPT_SOURCE_ROUTE) |
86 | #define IN_DEV_ACCEPT_LOCAL(in_dev) IN_DEV_ORCONF((in_dev), ACCEPT_LOCAL) | ||
88 | #define IN_DEV_BOOTP_RELAY(in_dev) IN_DEV_ANDCONF((in_dev), BOOTP_RELAY) | 87 | #define IN_DEV_BOOTP_RELAY(in_dev) IN_DEV_ANDCONF((in_dev), BOOTP_RELAY) |
89 | 88 | ||
90 | #define IN_DEV_LOG_MARTIANS(in_dev) IN_DEV_ORCONF((in_dev), LOG_MARTIANS) | 89 | #define IN_DEV_LOG_MARTIANS(in_dev) IN_DEV_ORCONF((in_dev), LOG_MARTIANS) |
@@ -110,8 +109,7 @@ static inline void ipv4_devconf_setall(struct in_device *in_dev) | |||
110 | #define IN_DEV_ARP_IGNORE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_IGNORE) | 109 | #define IN_DEV_ARP_IGNORE(in_dev) IN_DEV_MAXCONF((in_dev), ARP_IGNORE) |
111 | #define IN_DEV_ARP_NOTIFY(in_dev) IN_DEV_MAXCONF((in_dev), ARP_NOTIFY) | 110 | #define IN_DEV_ARP_NOTIFY(in_dev) IN_DEV_MAXCONF((in_dev), ARP_NOTIFY) |
112 | 111 | ||
113 | struct in_ifaddr | 112 | struct in_ifaddr { |
114 | { | ||
115 | struct in_ifaddr *ifa_next; | 113 | struct in_ifaddr *ifa_next; |
116 | struct in_device *ifa_dev; | 114 | struct in_device *ifa_dev; |
117 | struct rcu_head rcu_head; | 115 | struct rcu_head rcu_head; |
diff --git a/include/linux/init_task.h b/include/linux/init_task.h index 21a6f5d9af22..8d10aa7fd4c9 100644 --- a/include/linux/init_task.h +++ b/include/linux/init_task.h | |||
@@ -83,16 +83,12 @@ extern struct group_info init_groups; | |||
83 | #define INIT_IDS | 83 | #define INIT_IDS |
84 | #endif | 84 | #endif |
85 | 85 | ||
86 | #ifdef CONFIG_SECURITY_FILE_CAPABILITIES | ||
87 | /* | 86 | /* |
88 | * Because of the reduced scope of CAP_SETPCAP when filesystem | 87 | * Because of the reduced scope of CAP_SETPCAP when filesystem |
89 | * capabilities are in effect, it is safe to allow CAP_SETPCAP to | 88 | * capabilities are in effect, it is safe to allow CAP_SETPCAP to |
90 | * be available in the default configuration. | 89 | * be available in the default configuration. |
91 | */ | 90 | */ |
92 | # define CAP_INIT_BSET CAP_FULL_SET | 91 | # define CAP_INIT_BSET CAP_FULL_SET |
93 | #else | ||
94 | # define CAP_INIT_BSET CAP_INIT_EFF_SET | ||
95 | #endif | ||
96 | 92 | ||
97 | #ifdef CONFIG_TREE_PREEMPT_RCU | 93 | #ifdef CONFIG_TREE_PREEMPT_RCU |
98 | #define INIT_TASK_RCU_PREEMPT(tsk) \ | 94 | #define INIT_TASK_RCU_PREEMPT(tsk) \ |
diff --git a/include/linux/input-polldev.h b/include/linux/input-polldev.h index 597a0077b3c5..5e3dddf8f562 100644 --- a/include/linux/input-polldev.h +++ b/include/linux/input-polldev.h | |||
@@ -14,12 +14,19 @@ | |||
14 | 14 | ||
15 | /** | 15 | /** |
16 | * struct input_polled_dev - simple polled input device | 16 | * struct input_polled_dev - simple polled input device |
17 | * @private: private driver data | 17 | * @private: private driver data. |
18 | * @flush: driver-supplied method that flushes device's state upon | 18 | * @open: driver-supplied method that prepares device for polling |
19 | * opening (optional) | 19 | * (enabled the device and maybe flushes device state). |
20 | * @close: driver-supplied method that is called when device is no | ||
21 | * longer being polled. Used to put device into low power mode. | ||
20 | * @poll: driver-supplied method that polls the device and posts | 22 | * @poll: driver-supplied method that polls the device and posts |
21 | * input events (mandatory). | 23 | * input events (mandatory). |
22 | * @poll_interval: specifies how often the poll() method shoudl be called. | 24 | * @poll_interval: specifies how often the poll() method should be called. |
25 | * Defaults to 500 msec unless overriden when registering the device. | ||
26 | * @poll_interval_max: specifies upper bound for the poll interval. | ||
27 | * Defaults to the initial value of @poll_interval. | ||
28 | * @poll_interval_min: specifies lower bound for the poll interval. | ||
29 | * Defaults to 0. | ||
23 | * @input: input device structire associated with the polled device. | 30 | * @input: input device structire associated with the polled device. |
24 | * Must be properly initialized by the driver (id, name, phys, bits). | 31 | * Must be properly initialized by the driver (id, name, phys, bits). |
25 | * | 32 | * |
@@ -30,11 +37,16 @@ | |||
30 | struct input_polled_dev { | 37 | struct input_polled_dev { |
31 | void *private; | 38 | void *private; |
32 | 39 | ||
33 | void (*flush)(struct input_polled_dev *dev); | 40 | void (*open)(struct input_polled_dev *dev); |
41 | void (*close)(struct input_polled_dev *dev); | ||
34 | void (*poll)(struct input_polled_dev *dev); | 42 | void (*poll)(struct input_polled_dev *dev); |
35 | unsigned int poll_interval; /* msec */ | 43 | unsigned int poll_interval; /* msec */ |
44 | unsigned int poll_interval_max; /* msec */ | ||
45 | unsigned int poll_interval_min; /* msec */ | ||
36 | 46 | ||
37 | struct input_dev *input; | 47 | struct input_dev *input; |
48 | |||
49 | /* private: */ | ||
38 | struct delayed_work work; | 50 | struct delayed_work work; |
39 | }; | 51 | }; |
40 | 52 | ||
diff --git a/include/linux/input.h b/include/linux/input.h index c2b1a7d244d9..7be8a6537b57 100644 --- a/include/linux/input.h +++ b/include/linux/input.h | |||
@@ -595,6 +595,8 @@ struct input_absinfo { | |||
595 | #define KEY_NUMERIC_STAR 0x20a | 595 | #define KEY_NUMERIC_STAR 0x20a |
596 | #define KEY_NUMERIC_POUND 0x20b | 596 | #define KEY_NUMERIC_POUND 0x20b |
597 | 597 | ||
598 | #define KEY_CAMERA_FOCUS 0x210 | ||
599 | |||
598 | /* We avoid low common keys in module aliases so they don't get huge. */ | 600 | /* We avoid low common keys in module aliases so they don't get huge. */ |
599 | #define KEY_MIN_INTERESTING KEY_MUTE | 601 | #define KEY_MIN_INTERESTING KEY_MUTE |
600 | #define KEY_MAX 0x2ff | 602 | #define KEY_MAX 0x2ff |
@@ -677,6 +679,9 @@ struct input_absinfo { | |||
677 | #define SW_LINEOUT_INSERT 0x06 /* set = inserted */ | 679 | #define SW_LINEOUT_INSERT 0x06 /* set = inserted */ |
678 | #define SW_JACK_PHYSICAL_INSERT 0x07 /* set = mechanical switch set */ | 680 | #define SW_JACK_PHYSICAL_INSERT 0x07 /* set = mechanical switch set */ |
679 | #define SW_VIDEOOUT_INSERT 0x08 /* set = inserted */ | 681 | #define SW_VIDEOOUT_INSERT 0x08 /* set = inserted */ |
682 | #define SW_CAMERA_LENS_COVER 0x09 /* set = lens covered */ | ||
683 | #define SW_KEYPAD_SLIDE 0x0a /* set = keypad slide out */ | ||
684 | #define SW_FRONT_PROXIMITY 0x0b /* set = front proximity sensor active */ | ||
680 | #define SW_MAX 0x0f | 685 | #define SW_MAX 0x0f |
681 | #define SW_CNT (SW_MAX+1) | 686 | #define SW_CNT (SW_MAX+1) |
682 | 687 | ||
@@ -890,7 +895,7 @@ struct ff_periodic_effect { | |||
890 | struct ff_envelope envelope; | 895 | struct ff_envelope envelope; |
891 | 896 | ||
892 | __u32 custom_len; | 897 | __u32 custom_len; |
893 | __s16 *custom_data; | 898 | __s16 __user *custom_data; |
894 | }; | 899 | }; |
895 | 900 | ||
896 | /** | 901 | /** |
@@ -1016,9 +1021,12 @@ struct ff_effect { | |||
1016 | * @keycodesize: size of elements in keycode table | 1021 | * @keycodesize: size of elements in keycode table |
1017 | * @keycode: map of scancodes to keycodes for this device | 1022 | * @keycode: map of scancodes to keycodes for this device |
1018 | * @setkeycode: optional method to alter current keymap, used to implement | 1023 | * @setkeycode: optional method to alter current keymap, used to implement |
1019 | * sparse keymaps. If not supplied default mechanism will be used | 1024 | * sparse keymaps. If not supplied default mechanism will be used. |
1025 | * The method is being called while holding event_lock and thus must | ||
1026 | * not sleep | ||
1020 | * @getkeycode: optional method to retrieve current keymap. If not supplied | 1027 | * @getkeycode: optional method to retrieve current keymap. If not supplied |
1021 | * default mechanism will be used | 1028 | * default mechanism will be used. The method is being called while |
1029 | * holding event_lock and thus must not sleep | ||
1022 | * @ff: force feedback structure associated with the device if device | 1030 | * @ff: force feedback structure associated with the device if device |
1023 | * supports force feedback effects | 1031 | * supports force feedback effects |
1024 | * @repeat_key: stores key code of the last key pressed; used to implement | 1032 | * @repeat_key: stores key code of the last key pressed; used to implement |
@@ -1035,6 +1043,7 @@ struct ff_effect { | |||
1035 | * @absmin: minimum values for events coming from absolute axes | 1043 | * @absmin: minimum values for events coming from absolute axes |
1036 | * @absfuzz: describes noisiness for axes | 1044 | * @absfuzz: describes noisiness for axes |
1037 | * @absflat: size of the center flat position (used by joydev) | 1045 | * @absflat: size of the center flat position (used by joydev) |
1046 | * @absres: resolution used for events coming form absolute axes | ||
1038 | * @open: this method is called when the very first user calls | 1047 | * @open: this method is called when the very first user calls |
1039 | * input_open_device(). The driver must prepare the device | 1048 | * input_open_device(). The driver must prepare the device |
1040 | * to start generating events (start polling thread, | 1049 | * to start generating events (start polling thread, |
@@ -1289,6 +1298,9 @@ void input_unregister_device(struct input_dev *); | |||
1289 | int __must_check input_register_handler(struct input_handler *); | 1298 | int __must_check input_register_handler(struct input_handler *); |
1290 | void input_unregister_handler(struct input_handler *); | 1299 | void input_unregister_handler(struct input_handler *); |
1291 | 1300 | ||
1301 | int input_handler_for_each_handle(struct input_handler *, void *data, | ||
1302 | int (*fn)(struct input_handle *, void *)); | ||
1303 | |||
1292 | int input_register_handle(struct input_handle *); | 1304 | int input_register_handle(struct input_handle *); |
1293 | void input_unregister_handle(struct input_handle *); | 1305 | void input_unregister_handle(struct input_handle *); |
1294 | 1306 | ||
diff --git a/include/linux/input/matrix_keypad.h b/include/linux/input/matrix_keypad.h index b3cd42d50e16..3bd018baae20 100644 --- a/include/linux/input/matrix_keypad.h +++ b/include/linux/input/matrix_keypad.h | |||
@@ -41,6 +41,9 @@ struct matrix_keymap_data { | |||
41 | * @col_scan_delay_us: delay, measured in microseconds, that is | 41 | * @col_scan_delay_us: delay, measured in microseconds, that is |
42 | * needed before we can keypad after activating column gpio | 42 | * needed before we can keypad after activating column gpio |
43 | * @debounce_ms: debounce interval in milliseconds | 43 | * @debounce_ms: debounce interval in milliseconds |
44 | * @active_low: gpio polarity | ||
45 | * @wakeup: controls whether the device should be set up as wakeup | ||
46 | * source | ||
44 | * | 47 | * |
45 | * This structure represents platform-specific data that use used by | 48 | * This structure represents platform-specific data that use used by |
46 | * matrix_keypad driver to perform proper initialization. | 49 | * matrix_keypad driver to perform proper initialization. |
diff --git a/include/linux/input/sh_keysc.h b/include/linux/input/sh_keysc.h new file mode 100644 index 000000000000..c211b5cf08e6 --- /dev/null +++ b/include/linux/input/sh_keysc.h | |||
@@ -0,0 +1,14 @@ | |||
1 | #ifndef __SH_KEYSC_H__ | ||
2 | #define __SH_KEYSC_H__ | ||
3 | |||
4 | #define SH_KEYSC_MAXKEYS 30 | ||
5 | |||
6 | struct sh_keysc_info { | ||
7 | enum { SH_KEYSC_MODE_1, SH_KEYSC_MODE_2, SH_KEYSC_MODE_3 } mode; | ||
8 | int scan_timing; /* 0 -> 7, see KYCR1, SCN[2:0] */ | ||
9 | int delay; | ||
10 | int kycr2_delay; | ||
11 | int keycodes[SH_KEYSC_MAXKEYS]; | ||
12 | }; | ||
13 | |||
14 | #endif /* __SH_KEYSC_H__ */ | ||
diff --git a/include/linux/input/sparse-keymap.h b/include/linux/input/sparse-keymap.h new file mode 100644 index 000000000000..52db62064c6e --- /dev/null +++ b/include/linux/input/sparse-keymap.h | |||
@@ -0,0 +1,62 @@ | |||
1 | #ifndef _SPARSE_KEYMAP_H | ||
2 | #define _SPARSE_KEYMAP_H | ||
3 | |||
4 | /* | ||
5 | * Copyright (c) 2009 Dmitry Torokhov | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify it | ||
8 | * under the terms of the GNU General Public License version 2 as published by | ||
9 | * the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #define KE_END 0 /* Indicates end of keymap */ | ||
13 | #define KE_KEY 1 /* Ordinary key/button */ | ||
14 | #define KE_SW 2 /* Switch (predetermined value) */ | ||
15 | #define KE_VSW 3 /* Switch (value supplied at runtime) */ | ||
16 | #define KE_IGNORE 4 /* Known entry that should be ignored */ | ||
17 | #define KE_LAST KE_IGNORE | ||
18 | |||
19 | /** | ||
20 | * struct key_entry - keymap entry for use in sparse keymap | ||
21 | * @type: Type of the key entry (KE_KEY, KE_SW, KE_VSW, KE_END); | ||
22 | * drivers are allowed to extend the list with their own | ||
23 | * private definitions. | ||
24 | * @code: Device-specific data identifying the button/switch | ||
25 | * @keycode: KEY_* code assigned to a key/button | ||
26 | * @sw.code: SW_* code assigned to a switch | ||
27 | * @sw.value: Value that should be sent in an input even when KE_SW | ||
28 | * switch is toggled. KE_VSW switches ignore this field and | ||
29 | * expect driver to supply value for the event. | ||
30 | * | ||
31 | * This structure defines an entry in a sparse keymap used by some | ||
32 | * input devices for which traditional table-based approach is not | ||
33 | * suitable. | ||
34 | */ | ||
35 | struct key_entry { | ||
36 | int type; /* See KE_* above */ | ||
37 | u32 code; | ||
38 | union { | ||
39 | u16 keycode; /* For KE_KEY */ | ||
40 | struct { /* For KE_SW, KE_VSW */ | ||
41 | u8 code; | ||
42 | u8 value; /* For KE_SW, ignored by KE_VSW */ | ||
43 | } sw; | ||
44 | }; | ||
45 | }; | ||
46 | |||
47 | struct key_entry *sparse_keymap_entry_from_scancode(struct input_dev *dev, | ||
48 | unsigned int code); | ||
49 | struct key_entry *sparse_keymap_entry_from_keycode(struct input_dev *dev, | ||
50 | unsigned int code); | ||
51 | int sparse_keymap_setup(struct input_dev *dev, | ||
52 | const struct key_entry *keymap, | ||
53 | int (*setup)(struct input_dev *, struct key_entry *)); | ||
54 | void sparse_keymap_free(struct input_dev *dev); | ||
55 | |||
56 | void sparse_keymap_report_entry(struct input_dev *dev, const struct key_entry *ke, | ||
57 | unsigned int value, bool autorelease); | ||
58 | |||
59 | bool sparse_keymap_report_event(struct input_dev *dev, unsigned int code, | ||
60 | unsigned int value, bool autorelease); | ||
61 | |||
62 | #endif /* _SPARSE_KEYMAP_H */ | ||
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h index 7ca72b74eec7..75f3f00ac1e5 100644 --- a/include/linux/interrupt.h +++ b/include/linux/interrupt.h | |||
@@ -603,12 +603,6 @@ static inline void init_irq_proc(void) | |||
603 | } | 603 | } |
604 | #endif | 604 | #endif |
605 | 605 | ||
606 | #if defined(CONFIG_GENERIC_HARDIRQS) && defined(CONFIG_DEBUG_SHIRQ) | ||
607 | extern void debug_poll_all_shared_irqs(void); | ||
608 | #else | ||
609 | static inline void debug_poll_all_shared_irqs(void) { } | ||
610 | #endif | ||
611 | |||
612 | struct seq_file; | 606 | struct seq_file; |
613 | int show_interrupts(struct seq_file *p, void *v); | 607 | int show_interrupts(struct seq_file *p, void *v); |
614 | 608 | ||
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h index 4da4a75c3f1e..a63235996309 100644 --- a/include/linux/iocontext.h +++ b/include/linux/iocontext.h | |||
@@ -40,16 +40,11 @@ struct cfq_io_context { | |||
40 | struct io_context *ioc; | 40 | struct io_context *ioc; |
41 | 41 | ||
42 | unsigned long last_end_request; | 42 | unsigned long last_end_request; |
43 | sector_t last_request_pos; | ||
44 | 43 | ||
45 | unsigned long ttime_total; | 44 | unsigned long ttime_total; |
46 | unsigned long ttime_samples; | 45 | unsigned long ttime_samples; |
47 | unsigned long ttime_mean; | 46 | unsigned long ttime_mean; |
48 | 47 | ||
49 | unsigned int seek_samples; | ||
50 | u64 seek_total; | ||
51 | sector_t seek_mean; | ||
52 | |||
53 | struct list_head queue_list; | 48 | struct list_head queue_list; |
54 | struct hlist_node cic_list; | 49 | struct hlist_node cic_list; |
55 | 50 | ||
@@ -73,6 +68,10 @@ struct io_context { | |||
73 | unsigned short ioprio; | 68 | unsigned short ioprio; |
74 | unsigned short ioprio_changed; | 69 | unsigned short ioprio_changed; |
75 | 70 | ||
71 | #ifdef CONFIG_BLK_CGROUP | ||
72 | unsigned short cgroup_changed; | ||
73 | #endif | ||
74 | |||
76 | /* | 75 | /* |
77 | * For request batching | 76 | * For request batching |
78 | */ | 77 | */ |
@@ -99,14 +98,15 @@ static inline struct io_context *ioc_task_link(struct io_context *ioc) | |||
99 | return NULL; | 98 | return NULL; |
100 | } | 99 | } |
101 | 100 | ||
101 | struct task_struct; | ||
102 | #ifdef CONFIG_BLOCK | 102 | #ifdef CONFIG_BLOCK |
103 | int put_io_context(struct io_context *ioc); | 103 | int put_io_context(struct io_context *ioc); |
104 | void exit_io_context(void); | 104 | void exit_io_context(struct task_struct *task); |
105 | struct io_context *get_io_context(gfp_t gfp_flags, int node); | 105 | struct io_context *get_io_context(gfp_t gfp_flags, int node); |
106 | struct io_context *alloc_io_context(gfp_t gfp_flags, int node); | 106 | struct io_context *alloc_io_context(gfp_t gfp_flags, int node); |
107 | void copy_io_context(struct io_context **pdst, struct io_context **psrc); | 107 | void copy_io_context(struct io_context **pdst, struct io_context **psrc); |
108 | #else | 108 | #else |
109 | static inline void exit_io_context(void) | 109 | static inline void exit_io_context(struct task_struct *task) |
110 | { | 110 | { |
111 | } | 111 | } |
112 | 112 | ||
diff --git a/include/linux/ip_vs.h b/include/linux/ip_vs.h index 148265e63e8d..dfc170362842 100644 --- a/include/linux/ip_vs.h +++ b/include/linux/ip_vs.h | |||
@@ -127,8 +127,7 @@ struct ip_vs_dest_user { | |||
127 | /* | 127 | /* |
128 | * IPVS statistics object (for user space) | 128 | * IPVS statistics object (for user space) |
129 | */ | 129 | */ |
130 | struct ip_vs_stats_user | 130 | struct ip_vs_stats_user { |
131 | { | ||
132 | __u32 conns; /* connections scheduled */ | 131 | __u32 conns; /* connections scheduled */ |
133 | __u32 inpkts; /* incoming packets */ | 132 | __u32 inpkts; /* incoming packets */ |
134 | __u32 outpkts; /* outgoing packets */ | 133 | __u32 outpkts; /* outgoing packets */ |
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h index c662efa68289..e0cc9a7db2b5 100644 --- a/include/linux/ipv6.h +++ b/include/linux/ipv6.h | |||
@@ -167,6 +167,7 @@ struct ipv6_devconf { | |||
167 | #endif | 167 | #endif |
168 | __s32 disable_ipv6; | 168 | __s32 disable_ipv6; |
169 | __s32 accept_dad; | 169 | __s32 accept_dad; |
170 | __s32 force_tllao; | ||
170 | void *sysctl; | 171 | void *sysctl; |
171 | }; | 172 | }; |
172 | 173 | ||
@@ -207,6 +208,7 @@ enum { | |||
207 | DEVCONF_MC_FORWARDING, | 208 | DEVCONF_MC_FORWARDING, |
208 | DEVCONF_DISABLE_IPV6, | 209 | DEVCONF_DISABLE_IPV6, |
209 | DEVCONF_ACCEPT_DAD, | 210 | DEVCONF_ACCEPT_DAD, |
211 | DEVCONF_FORCE_TLLAO, | ||
210 | DEVCONF_MAX | 212 | DEVCONF_MAX |
211 | }; | 213 | }; |
212 | 214 | ||
@@ -503,7 +505,7 @@ static inline struct raw6_sock *raw6_sk(const struct sock *sk) | |||
503 | 505 | ||
504 | #define INET6_MATCH(__sk, __net, __hash, __saddr, __daddr, __ports, __dif)\ | 506 | #define INET6_MATCH(__sk, __net, __hash, __saddr, __daddr, __ports, __dif)\ |
505 | (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net) && \ | 507 | (((__sk)->sk_hash == (__hash)) && sock_net((__sk)) == (__net) && \ |
506 | ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ | 508 | ((*((__portpair *)&(inet_sk(__sk)->inet_dport))) == (__ports)) && \ |
507 | ((__sk)->sk_family == AF_INET6) && \ | 509 | ((__sk)->sk_family == AF_INET6) && \ |
508 | ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ | 510 | ipv6_addr_equal(&inet6_sk(__sk)->daddr, (__saddr)) && \ |
509 | ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ | 511 | ipv6_addr_equal(&inet6_sk(__sk)->rcv_saddr, (__daddr)) && \ |
diff --git a/include/linux/irq.h b/include/linux/irq.h index ae9653dbcd78..a287cfc0b1a6 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h | |||
@@ -282,7 +282,7 @@ extern irqreturn_t handle_IRQ_event(unsigned int irq, struct irqaction *action); | |||
282 | 282 | ||
283 | /* | 283 | /* |
284 | * Built-in IRQ handlers for various IRQ types, | 284 | * Built-in IRQ handlers for various IRQ types, |
285 | * callable via desc->chip->handle_irq() | 285 | * callable via desc->handle_irq() |
286 | */ | 286 | */ |
287 | extern void handle_level_irq(unsigned int irq, struct irq_desc *desc); | 287 | extern void handle_level_irq(unsigned int irq, struct irq_desc *desc); |
288 | extern void handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc); | 288 | extern void handle_fasteoi_irq(unsigned int irq, struct irq_desc *desc); |
diff --git a/include/linux/irqflags.h b/include/linux/irqflags.h index b02a3f1d46a0..006bf45eae30 100644 --- a/include/linux/irqflags.h +++ b/include/linux/irqflags.h | |||
@@ -124,6 +124,6 @@ | |||
124 | typecheck(unsigned long, flags); \ | 124 | typecheck(unsigned long, flags); \ |
125 | raw_irqs_disabled_flags(flags); \ | 125 | raw_irqs_disabled_flags(flags); \ |
126 | }) | 126 | }) |
127 | #endif /* CONFIG_X86 */ | 127 | #endif /* CONFIG_TRACE_IRQFLAGS_SUPPORT */ |
128 | 128 | ||
129 | #endif | 129 | #endif |
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h index 1a9cf78bfce5..6811f4bfc6e7 100644 --- a/include/linux/jiffies.h +++ b/include/linux/jiffies.h | |||
@@ -307,6 +307,7 @@ extern clock_t jiffies_to_clock_t(long x); | |||
307 | extern unsigned long clock_t_to_jiffies(unsigned long x); | 307 | extern unsigned long clock_t_to_jiffies(unsigned long x); |
308 | extern u64 jiffies_64_to_clock_t(u64 x); | 308 | extern u64 jiffies_64_to_clock_t(u64 x); |
309 | extern u64 nsec_to_clock_t(u64 x); | 309 | extern u64 nsec_to_clock_t(u64 x); |
310 | extern unsigned long nsecs_to_jiffies(u64 n); | ||
310 | 311 | ||
311 | #define TIMESTAMP_SIZE 30 | 312 | #define TIMESTAMP_SIZE 30 |
312 | 313 | ||
diff --git a/include/linux/kernel.h b/include/linux/kernel.h index f4e3184fa054..3fa4c590cf12 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h | |||
@@ -15,7 +15,6 @@ | |||
15 | #include <linux/bitops.h> | 15 | #include <linux/bitops.h> |
16 | #include <linux/log2.h> | 16 | #include <linux/log2.h> |
17 | #include <linux/typecheck.h> | 17 | #include <linux/typecheck.h> |
18 | #include <linux/ratelimit.h> | ||
19 | #include <linux/dynamic_debug.h> | 18 | #include <linux/dynamic_debug.h> |
20 | #include <asm/byteorder.h> | 19 | #include <asm/byteorder.h> |
21 | #include <asm/bug.h> | 20 | #include <asm/bug.h> |
@@ -241,8 +240,8 @@ asmlinkage int vprintk(const char *fmt, va_list args) | |||
241 | asmlinkage int printk(const char * fmt, ...) | 240 | asmlinkage int printk(const char * fmt, ...) |
242 | __attribute__ ((format (printf, 1, 2))) __cold; | 241 | __attribute__ ((format (printf, 1, 2))) __cold; |
243 | 242 | ||
244 | extern struct ratelimit_state printk_ratelimit_state; | 243 | extern int __printk_ratelimit(const char *func); |
245 | extern int printk_ratelimit(void); | 244 | #define printk_ratelimit() __printk_ratelimit(__func__) |
246 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, | 245 | extern bool printk_timed_ratelimit(unsigned long *caller_jiffies, |
247 | unsigned int interval_msec); | 246 | unsigned int interval_msec); |
248 | 247 | ||
diff --git a/include/linux/kernel_stat.h b/include/linux/kernel_stat.h index 348fa8874b52..c059044bc6dc 100644 --- a/include/linux/kernel_stat.h +++ b/include/linux/kernel_stat.h | |||
@@ -25,6 +25,7 @@ struct cpu_usage_stat { | |||
25 | cputime64_t iowait; | 25 | cputime64_t iowait; |
26 | cputime64_t steal; | 26 | cputime64_t steal; |
27 | cputime64_t guest; | 27 | cputime64_t guest; |
28 | cputime64_t guest_nice; | ||
28 | }; | 29 | }; |
29 | 30 | ||
30 | struct kernel_stat { | 31 | struct kernel_stat { |
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h index 3a46b7b7abb2..1b672f74a32f 100644 --- a/include/linux/kprobes.h +++ b/include/linux/kprobes.h | |||
@@ -296,6 +296,8 @@ void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head); | |||
296 | int disable_kprobe(struct kprobe *kp); | 296 | int disable_kprobe(struct kprobe *kp); |
297 | int enable_kprobe(struct kprobe *kp); | 297 | int enable_kprobe(struct kprobe *kp); |
298 | 298 | ||
299 | void dump_kprobe(struct kprobe *kp); | ||
300 | |||
299 | #else /* !CONFIG_KPROBES: */ | 301 | #else /* !CONFIG_KPROBES: */ |
300 | 302 | ||
301 | static inline int kprobes_built_in(void) | 303 | static inline int kprobes_built_in(void) |
diff --git a/include/linux/kvm.h b/include/linux/kvm.h index f8f8900fc5ec..2d241da07236 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h | |||
@@ -14,12 +14,76 @@ | |||
14 | 14 | ||
15 | #define KVM_API_VERSION 12 | 15 | #define KVM_API_VERSION 12 |
16 | 16 | ||
17 | /* for KVM_TRACE_ENABLE, deprecated */ | 17 | /* *** Deprecated interfaces *** */ |
18 | |||
19 | #define KVM_TRC_SHIFT 16 | ||
20 | |||
21 | #define KVM_TRC_ENTRYEXIT (1 << KVM_TRC_SHIFT) | ||
22 | #define KVM_TRC_HANDLER (1 << (KVM_TRC_SHIFT + 1)) | ||
23 | |||
24 | #define KVM_TRC_VMENTRY (KVM_TRC_ENTRYEXIT + 0x01) | ||
25 | #define KVM_TRC_VMEXIT (KVM_TRC_ENTRYEXIT + 0x02) | ||
26 | #define KVM_TRC_PAGE_FAULT (KVM_TRC_HANDLER + 0x01) | ||
27 | |||
28 | #define KVM_TRC_HEAD_SIZE 12 | ||
29 | #define KVM_TRC_CYCLE_SIZE 8 | ||
30 | #define KVM_TRC_EXTRA_MAX 7 | ||
31 | |||
32 | #define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02) | ||
33 | #define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03) | ||
34 | #define KVM_TRC_PEND_INTR (KVM_TRC_HANDLER + 0x04) | ||
35 | #define KVM_TRC_IO_READ (KVM_TRC_HANDLER + 0x05) | ||
36 | #define KVM_TRC_IO_WRITE (KVM_TRC_HANDLER + 0x06) | ||
37 | #define KVM_TRC_CR_READ (KVM_TRC_HANDLER + 0x07) | ||
38 | #define KVM_TRC_CR_WRITE (KVM_TRC_HANDLER + 0x08) | ||
39 | #define KVM_TRC_DR_READ (KVM_TRC_HANDLER + 0x09) | ||
40 | #define KVM_TRC_DR_WRITE (KVM_TRC_HANDLER + 0x0A) | ||
41 | #define KVM_TRC_MSR_READ (KVM_TRC_HANDLER + 0x0B) | ||
42 | #define KVM_TRC_MSR_WRITE (KVM_TRC_HANDLER + 0x0C) | ||
43 | #define KVM_TRC_CPUID (KVM_TRC_HANDLER + 0x0D) | ||
44 | #define KVM_TRC_INTR (KVM_TRC_HANDLER + 0x0E) | ||
45 | #define KVM_TRC_NMI (KVM_TRC_HANDLER + 0x0F) | ||
46 | #define KVM_TRC_VMMCALL (KVM_TRC_HANDLER + 0x10) | ||
47 | #define KVM_TRC_HLT (KVM_TRC_HANDLER + 0x11) | ||
48 | #define KVM_TRC_CLTS (KVM_TRC_HANDLER + 0x12) | ||
49 | #define KVM_TRC_LMSW (KVM_TRC_HANDLER + 0x13) | ||
50 | #define KVM_TRC_APIC_ACCESS (KVM_TRC_HANDLER + 0x14) | ||
51 | #define KVM_TRC_TDP_FAULT (KVM_TRC_HANDLER + 0x15) | ||
52 | #define KVM_TRC_GTLB_WRITE (KVM_TRC_HANDLER + 0x16) | ||
53 | #define KVM_TRC_STLB_WRITE (KVM_TRC_HANDLER + 0x17) | ||
54 | #define KVM_TRC_STLB_INVAL (KVM_TRC_HANDLER + 0x18) | ||
55 | #define KVM_TRC_PPC_INSTR (KVM_TRC_HANDLER + 0x19) | ||
56 | |||
18 | struct kvm_user_trace_setup { | 57 | struct kvm_user_trace_setup { |
19 | __u32 buf_size; /* sub_buffer size of each per-cpu */ | 58 | __u32 buf_size; |
20 | __u32 buf_nr; /* the number of sub_buffers of each per-cpu */ | 59 | __u32 buf_nr; |
60 | }; | ||
61 | |||
62 | #define __KVM_DEPRECATED_MAIN_W_0x06 \ | ||
63 | _IOW(KVMIO, 0x06, struct kvm_user_trace_setup) | ||
64 | #define __KVM_DEPRECATED_MAIN_0x07 _IO(KVMIO, 0x07) | ||
65 | #define __KVM_DEPRECATED_MAIN_0x08 _IO(KVMIO, 0x08) | ||
66 | |||
67 | #define __KVM_DEPRECATED_VM_R_0x70 _IOR(KVMIO, 0x70, struct kvm_assigned_irq) | ||
68 | |||
69 | struct kvm_breakpoint { | ||
70 | __u32 enabled; | ||
71 | __u32 padding; | ||
72 | __u64 address; | ||
73 | }; | ||
74 | |||
75 | struct kvm_debug_guest { | ||
76 | __u32 enabled; | ||
77 | __u32 pad; | ||
78 | struct kvm_breakpoint breakpoints[4]; | ||
79 | __u32 singlestep; | ||
21 | }; | 80 | }; |
22 | 81 | ||
82 | #define __KVM_DEPRECATED_VCPU_W_0x87 _IOW(KVMIO, 0x87, struct kvm_debug_guest) | ||
83 | |||
84 | /* *** End of deprecated interfaces *** */ | ||
85 | |||
86 | |||
23 | /* for KVM_CREATE_MEMORY_REGION */ | 87 | /* for KVM_CREATE_MEMORY_REGION */ |
24 | struct kvm_memory_region { | 88 | struct kvm_memory_region { |
25 | __u32 slot; | 89 | __u32 slot; |
@@ -99,6 +163,7 @@ struct kvm_pit_config { | |||
99 | 163 | ||
100 | /* For KVM_EXIT_INTERNAL_ERROR */ | 164 | /* For KVM_EXIT_INTERNAL_ERROR */ |
101 | #define KVM_INTERNAL_ERROR_EMULATION 1 | 165 | #define KVM_INTERNAL_ERROR_EMULATION 1 |
166 | #define KVM_INTERNAL_ERROR_SIMUL_EX 2 | ||
102 | 167 | ||
103 | /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ | 168 | /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ |
104 | struct kvm_run { | 169 | struct kvm_run { |
@@ -116,6 +181,11 @@ struct kvm_run { | |||
116 | __u64 cr8; | 181 | __u64 cr8; |
117 | __u64 apic_base; | 182 | __u64 apic_base; |
118 | 183 | ||
184 | #ifdef __KVM_S390 | ||
185 | /* the processor status word for s390 */ | ||
186 | __u64 psw_mask; /* psw upper half */ | ||
187 | __u64 psw_addr; /* psw lower half */ | ||
188 | #endif | ||
119 | union { | 189 | union { |
120 | /* KVM_EXIT_UNKNOWN */ | 190 | /* KVM_EXIT_UNKNOWN */ |
121 | struct { | 191 | struct { |
@@ -167,8 +237,6 @@ struct kvm_run { | |||
167 | /* KVM_EXIT_S390_SIEIC */ | 237 | /* KVM_EXIT_S390_SIEIC */ |
168 | struct { | 238 | struct { |
169 | __u8 icptcode; | 239 | __u8 icptcode; |
170 | __u64 mask; /* psw upper half */ | ||
171 | __u64 addr; /* psw lower half */ | ||
172 | __u16 ipa; | 240 | __u16 ipa; |
173 | __u32 ipb; | 241 | __u32 ipb; |
174 | } s390_sieic; | 242 | } s390_sieic; |
@@ -187,6 +255,9 @@ struct kvm_run { | |||
187 | } dcr; | 255 | } dcr; |
188 | struct { | 256 | struct { |
189 | __u32 suberror; | 257 | __u32 suberror; |
258 | /* Available with KVM_CAP_INTERNAL_ERROR_DATA: */ | ||
259 | __u32 ndata; | ||
260 | __u64 data[16]; | ||
190 | } internal; | 261 | } internal; |
191 | /* Fix the size of the union. */ | 262 | /* Fix the size of the union. */ |
192 | char padding[256]; | 263 | char padding[256]; |
@@ -329,24 +400,6 @@ struct kvm_ioeventfd { | |||
329 | __u8 pad[36]; | 400 | __u8 pad[36]; |
330 | }; | 401 | }; |
331 | 402 | ||
332 | #define KVM_TRC_SHIFT 16 | ||
333 | /* | ||
334 | * kvm trace categories | ||
335 | */ | ||
336 | #define KVM_TRC_ENTRYEXIT (1 << KVM_TRC_SHIFT) | ||
337 | #define KVM_TRC_HANDLER (1 << (KVM_TRC_SHIFT + 1)) /* only 12 bits */ | ||
338 | |||
339 | /* | ||
340 | * kvm trace action | ||
341 | */ | ||
342 | #define KVM_TRC_VMENTRY (KVM_TRC_ENTRYEXIT + 0x01) | ||
343 | #define KVM_TRC_VMEXIT (KVM_TRC_ENTRYEXIT + 0x02) | ||
344 | #define KVM_TRC_PAGE_FAULT (KVM_TRC_HANDLER + 0x01) | ||
345 | |||
346 | #define KVM_TRC_HEAD_SIZE 12 | ||
347 | #define KVM_TRC_CYCLE_SIZE 8 | ||
348 | #define KVM_TRC_EXTRA_MAX 7 | ||
349 | |||
350 | #define KVMIO 0xAE | 403 | #define KVMIO 0xAE |
351 | 404 | ||
352 | /* | 405 | /* |
@@ -367,12 +420,10 @@ struct kvm_ioeventfd { | |||
367 | */ | 420 | */ |
368 | #define KVM_GET_VCPU_MMAP_SIZE _IO(KVMIO, 0x04) /* in bytes */ | 421 | #define KVM_GET_VCPU_MMAP_SIZE _IO(KVMIO, 0x04) /* in bytes */ |
369 | #define KVM_GET_SUPPORTED_CPUID _IOWR(KVMIO, 0x05, struct kvm_cpuid2) | 422 | #define KVM_GET_SUPPORTED_CPUID _IOWR(KVMIO, 0x05, struct kvm_cpuid2) |
370 | /* | 423 | #define KVM_TRACE_ENABLE __KVM_DEPRECATED_MAIN_W_0x06 |
371 | * ioctls for kvm trace | 424 | #define KVM_TRACE_PAUSE __KVM_DEPRECATED_MAIN_0x07 |
372 | */ | 425 | #define KVM_TRACE_DISABLE __KVM_DEPRECATED_MAIN_0x08 |
373 | #define KVM_TRACE_ENABLE _IOW(KVMIO, 0x06, struct kvm_user_trace_setup) | 426 | |
374 | #define KVM_TRACE_PAUSE _IO(KVMIO, 0x07) | ||
375 | #define KVM_TRACE_DISABLE _IO(KVMIO, 0x08) | ||
376 | /* | 427 | /* |
377 | * Extension capability list. | 428 | * Extension capability list. |
378 | */ | 429 | */ |
@@ -436,6 +487,15 @@ struct kvm_ioeventfd { | |||
436 | #endif | 487 | #endif |
437 | #define KVM_CAP_IOEVENTFD 36 | 488 | #define KVM_CAP_IOEVENTFD 36 |
438 | #define KVM_CAP_SET_IDENTITY_MAP_ADDR 37 | 489 | #define KVM_CAP_SET_IDENTITY_MAP_ADDR 37 |
490 | #ifdef __KVM_HAVE_XEN_HVM | ||
491 | #define KVM_CAP_XEN_HVM 38 | ||
492 | #endif | ||
493 | #define KVM_CAP_ADJUST_CLOCK 39 | ||
494 | #define KVM_CAP_INTERNAL_ERROR_DATA 40 | ||
495 | #ifdef __KVM_HAVE_VCPU_EVENTS | ||
496 | #define KVM_CAP_VCPU_EVENTS 41 | ||
497 | #endif | ||
498 | #define KVM_CAP_S390_PSW 42 | ||
439 | 499 | ||
440 | #ifdef KVM_CAP_IRQ_ROUTING | 500 | #ifdef KVM_CAP_IRQ_ROUTING |
441 | 501 | ||
@@ -488,6 +548,18 @@ struct kvm_x86_mce { | |||
488 | }; | 548 | }; |
489 | #endif | 549 | #endif |
490 | 550 | ||
551 | #ifdef KVM_CAP_XEN_HVM | ||
552 | struct kvm_xen_hvm_config { | ||
553 | __u32 flags; | ||
554 | __u32 msr; | ||
555 | __u64 blob_addr_32; | ||
556 | __u64 blob_addr_64; | ||
557 | __u8 blob_size_32; | ||
558 | __u8 blob_size_64; | ||
559 | __u8 pad2[30]; | ||
560 | }; | ||
561 | #endif | ||
562 | |||
491 | #define KVM_IRQFD_FLAG_DEASSIGN (1 << 0) | 563 | #define KVM_IRQFD_FLAG_DEASSIGN (1 << 0) |
492 | 564 | ||
493 | struct kvm_irqfd { | 565 | struct kvm_irqfd { |
@@ -497,55 +569,66 @@ struct kvm_irqfd { | |||
497 | __u8 pad[20]; | 569 | __u8 pad[20]; |
498 | }; | 570 | }; |
499 | 571 | ||
572 | struct kvm_clock_data { | ||
573 | __u64 clock; | ||
574 | __u32 flags; | ||
575 | __u32 pad[9]; | ||
576 | }; | ||
577 | |||
500 | /* | 578 | /* |
501 | * ioctls for VM fds | 579 | * ioctls for VM fds |
502 | */ | 580 | */ |
503 | #define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region) | 581 | #define KVM_SET_MEMORY_REGION _IOW(KVMIO, 0x40, struct kvm_memory_region) |
504 | /* | 582 | /* |
505 | * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns | 583 | * KVM_CREATE_VCPU receives as a parameter the vcpu slot, and returns |
506 | * a vcpu fd. | 584 | * a vcpu fd. |
507 | */ | 585 | */ |
508 | #define KVM_CREATE_VCPU _IO(KVMIO, 0x41) | 586 | #define KVM_CREATE_VCPU _IO(KVMIO, 0x41) |
509 | #define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log) | 587 | #define KVM_GET_DIRTY_LOG _IOW(KVMIO, 0x42, struct kvm_dirty_log) |
510 | #define KVM_SET_MEMORY_ALIAS _IOW(KVMIO, 0x43, struct kvm_memory_alias) | 588 | #define KVM_SET_MEMORY_ALIAS _IOW(KVMIO, 0x43, struct kvm_memory_alias) |
511 | #define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44) | 589 | #define KVM_SET_NR_MMU_PAGES _IO(KVMIO, 0x44) |
512 | #define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45) | 590 | #define KVM_GET_NR_MMU_PAGES _IO(KVMIO, 0x45) |
513 | #define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46,\ | 591 | #define KVM_SET_USER_MEMORY_REGION _IOW(KVMIO, 0x46, \ |
514 | struct kvm_userspace_memory_region) | 592 | struct kvm_userspace_memory_region) |
515 | #define KVM_SET_TSS_ADDR _IO(KVMIO, 0x47) | 593 | #define KVM_SET_TSS_ADDR _IO(KVMIO, 0x47) |
516 | #define KVM_SET_IDENTITY_MAP_ADDR _IOW(KVMIO, 0x48, __u64) | 594 | #define KVM_SET_IDENTITY_MAP_ADDR _IOW(KVMIO, 0x48, __u64) |
517 | /* Device model IOC */ | 595 | /* Device model IOC */ |
518 | #define KVM_CREATE_IRQCHIP _IO(KVMIO, 0x60) | 596 | #define KVM_CREATE_IRQCHIP _IO(KVMIO, 0x60) |
519 | #define KVM_IRQ_LINE _IOW(KVMIO, 0x61, struct kvm_irq_level) | 597 | #define KVM_IRQ_LINE _IOW(KVMIO, 0x61, struct kvm_irq_level) |
520 | #define KVM_GET_IRQCHIP _IOWR(KVMIO, 0x62, struct kvm_irqchip) | 598 | #define KVM_GET_IRQCHIP _IOWR(KVMIO, 0x62, struct kvm_irqchip) |
521 | #define KVM_SET_IRQCHIP _IOR(KVMIO, 0x63, struct kvm_irqchip) | 599 | #define KVM_SET_IRQCHIP _IOR(KVMIO, 0x63, struct kvm_irqchip) |
522 | #define KVM_CREATE_PIT _IO(KVMIO, 0x64) | 600 | #define KVM_CREATE_PIT _IO(KVMIO, 0x64) |
523 | #define KVM_GET_PIT _IOWR(KVMIO, 0x65, struct kvm_pit_state) | 601 | #define KVM_GET_PIT _IOWR(KVMIO, 0x65, struct kvm_pit_state) |
524 | #define KVM_SET_PIT _IOR(KVMIO, 0x66, struct kvm_pit_state) | 602 | #define KVM_SET_PIT _IOR(KVMIO, 0x66, struct kvm_pit_state) |
525 | #define KVM_IRQ_LINE_STATUS _IOWR(KVMIO, 0x67, struct kvm_irq_level) | 603 | #define KVM_IRQ_LINE_STATUS _IOWR(KVMIO, 0x67, struct kvm_irq_level) |
526 | #define KVM_REGISTER_COALESCED_MMIO \ | 604 | #define KVM_REGISTER_COALESCED_MMIO \ |
527 | _IOW(KVMIO, 0x67, struct kvm_coalesced_mmio_zone) | 605 | _IOW(KVMIO, 0x67, struct kvm_coalesced_mmio_zone) |
528 | #define KVM_UNREGISTER_COALESCED_MMIO \ | 606 | #define KVM_UNREGISTER_COALESCED_MMIO \ |
529 | _IOW(KVMIO, 0x68, struct kvm_coalesced_mmio_zone) | 607 | _IOW(KVMIO, 0x68, struct kvm_coalesced_mmio_zone) |
530 | #define KVM_ASSIGN_PCI_DEVICE _IOR(KVMIO, 0x69, \ | 608 | #define KVM_ASSIGN_PCI_DEVICE _IOR(KVMIO, 0x69, \ |
531 | struct kvm_assigned_pci_dev) | 609 | struct kvm_assigned_pci_dev) |
532 | #define KVM_SET_GSI_ROUTING _IOW(KVMIO, 0x6a, struct kvm_irq_routing) | 610 | #define KVM_SET_GSI_ROUTING _IOW(KVMIO, 0x6a, struct kvm_irq_routing) |
533 | /* deprecated, replaced by KVM_ASSIGN_DEV_IRQ */ | 611 | /* deprecated, replaced by KVM_ASSIGN_DEV_IRQ */ |
534 | #define KVM_ASSIGN_IRQ _IOR(KVMIO, 0x70, \ | 612 | #define KVM_ASSIGN_IRQ __KVM_DEPRECATED_VM_R_0x70 |
535 | struct kvm_assigned_irq) | 613 | #define KVM_ASSIGN_DEV_IRQ _IOW(KVMIO, 0x70, struct kvm_assigned_irq) |
536 | #define KVM_ASSIGN_DEV_IRQ _IOW(KVMIO, 0x70, struct kvm_assigned_irq) | 614 | #define KVM_REINJECT_CONTROL _IO(KVMIO, 0x71) |
537 | #define KVM_REINJECT_CONTROL _IO(KVMIO, 0x71) | 615 | #define KVM_DEASSIGN_PCI_DEVICE _IOW(KVMIO, 0x72, \ |
538 | #define KVM_DEASSIGN_PCI_DEVICE _IOW(KVMIO, 0x72, \ | 616 | struct kvm_assigned_pci_dev) |
539 | struct kvm_assigned_pci_dev) | 617 | #define KVM_ASSIGN_SET_MSIX_NR _IOW(KVMIO, 0x73, \ |
540 | #define KVM_ASSIGN_SET_MSIX_NR \ | 618 | struct kvm_assigned_msix_nr) |
541 | _IOW(KVMIO, 0x73, struct kvm_assigned_msix_nr) | 619 | #define KVM_ASSIGN_SET_MSIX_ENTRY _IOW(KVMIO, 0x74, \ |
542 | #define KVM_ASSIGN_SET_MSIX_ENTRY \ | 620 | struct kvm_assigned_msix_entry) |
543 | _IOW(KVMIO, 0x74, struct kvm_assigned_msix_entry) | 621 | #define KVM_DEASSIGN_DEV_IRQ _IOW(KVMIO, 0x75, struct kvm_assigned_irq) |
544 | #define KVM_DEASSIGN_DEV_IRQ _IOW(KVMIO, 0x75, struct kvm_assigned_irq) | 622 | #define KVM_IRQFD _IOW(KVMIO, 0x76, struct kvm_irqfd) |
545 | #define KVM_IRQFD _IOW(KVMIO, 0x76, struct kvm_irqfd) | 623 | #define KVM_CREATE_PIT2 _IOW(KVMIO, 0x77, struct kvm_pit_config) |
546 | #define KVM_CREATE_PIT2 _IOW(KVMIO, 0x77, struct kvm_pit_config) | 624 | #define KVM_SET_BOOT_CPU_ID _IO(KVMIO, 0x78) |
547 | #define KVM_SET_BOOT_CPU_ID _IO(KVMIO, 0x78) | 625 | #define KVM_IOEVENTFD _IOW(KVMIO, 0x79, struct kvm_ioeventfd) |
548 | #define KVM_IOEVENTFD _IOW(KVMIO, 0x79, struct kvm_ioeventfd) | 626 | #define KVM_XEN_HVM_CONFIG _IOW(KVMIO, 0x7a, struct kvm_xen_hvm_config) |
627 | #define KVM_SET_CLOCK _IOW(KVMIO, 0x7b, struct kvm_clock_data) | ||
628 | #define KVM_GET_CLOCK _IOR(KVMIO, 0x7c, struct kvm_clock_data) | ||
629 | /* Available with KVM_CAP_PIT_STATE2 */ | ||
630 | #define KVM_GET_PIT2 _IOR(KVMIO, 0x9f, struct kvm_pit_state2) | ||
631 | #define KVM_SET_PIT2 _IOW(KVMIO, 0xa0, struct kvm_pit_state2) | ||
549 | 632 | ||
550 | /* | 633 | /* |
551 | * ioctls for vcpu fds | 634 | * ioctls for vcpu fds |
@@ -558,7 +641,7 @@ struct kvm_irqfd { | |||
558 | #define KVM_TRANSLATE _IOWR(KVMIO, 0x85, struct kvm_translation) | 641 | #define KVM_TRANSLATE _IOWR(KVMIO, 0x85, struct kvm_translation) |
559 | #define KVM_INTERRUPT _IOW(KVMIO, 0x86, struct kvm_interrupt) | 642 | #define KVM_INTERRUPT _IOW(KVMIO, 0x86, struct kvm_interrupt) |
560 | /* KVM_DEBUG_GUEST is no longer supported, use KVM_SET_GUEST_DEBUG instead */ | 643 | /* KVM_DEBUG_GUEST is no longer supported, use KVM_SET_GUEST_DEBUG instead */ |
561 | #define KVM_DEBUG_GUEST __KVM_DEPRECATED_DEBUG_GUEST | 644 | #define KVM_DEBUG_GUEST __KVM_DEPRECATED_VCPU_W_0x87 |
562 | #define KVM_GET_MSRS _IOWR(KVMIO, 0x88, struct kvm_msrs) | 645 | #define KVM_GET_MSRS _IOWR(KVMIO, 0x88, struct kvm_msrs) |
563 | #define KVM_SET_MSRS _IOW(KVMIO, 0x89, struct kvm_msrs) | 646 | #define KVM_SET_MSRS _IOW(KVMIO, 0x89, struct kvm_msrs) |
564 | #define KVM_SET_CPUID _IOW(KVMIO, 0x8a, struct kvm_cpuid) | 647 | #define KVM_SET_CPUID _IOW(KVMIO, 0x8a, struct kvm_cpuid) |
@@ -570,7 +653,7 @@ struct kvm_irqfd { | |||
570 | #define KVM_SET_CPUID2 _IOW(KVMIO, 0x90, struct kvm_cpuid2) | 653 | #define KVM_SET_CPUID2 _IOW(KVMIO, 0x90, struct kvm_cpuid2) |
571 | #define KVM_GET_CPUID2 _IOWR(KVMIO, 0x91, struct kvm_cpuid2) | 654 | #define KVM_GET_CPUID2 _IOWR(KVMIO, 0x91, struct kvm_cpuid2) |
572 | /* Available with KVM_CAP_VAPIC */ | 655 | /* Available with KVM_CAP_VAPIC */ |
573 | #define KVM_TPR_ACCESS_REPORTING _IOWR(KVMIO, 0x92, struct kvm_tpr_access_ctl) | 656 | #define KVM_TPR_ACCESS_REPORTING _IOWR(KVMIO, 0x92, struct kvm_tpr_access_ctl) |
574 | /* Available with KVM_CAP_VAPIC */ | 657 | /* Available with KVM_CAP_VAPIC */ |
575 | #define KVM_SET_VAPIC_ADDR _IOW(KVMIO, 0x93, struct kvm_vapic_addr) | 658 | #define KVM_SET_VAPIC_ADDR _IOW(KVMIO, 0x93, struct kvm_vapic_addr) |
576 | /* valid for virtual machine (for floating interrupt)_and_ vcpu */ | 659 | /* valid for virtual machine (for floating interrupt)_and_ vcpu */ |
@@ -582,66 +665,23 @@ struct kvm_irqfd { | |||
582 | /* initial ipl psw for s390 */ | 665 | /* initial ipl psw for s390 */ |
583 | #define KVM_S390_SET_INITIAL_PSW _IOW(KVMIO, 0x96, struct kvm_s390_psw) | 666 | #define KVM_S390_SET_INITIAL_PSW _IOW(KVMIO, 0x96, struct kvm_s390_psw) |
584 | /* initial reset for s390 */ | 667 | /* initial reset for s390 */ |
585 | #define KVM_S390_INITIAL_RESET _IO(KVMIO, 0x97) | 668 | #define KVM_S390_INITIAL_RESET _IO(KVMIO, 0x97) |
586 | #define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state) | 669 | #define KVM_GET_MP_STATE _IOR(KVMIO, 0x98, struct kvm_mp_state) |
587 | #define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state) | 670 | #define KVM_SET_MP_STATE _IOW(KVMIO, 0x99, struct kvm_mp_state) |
588 | /* Available with KVM_CAP_NMI */ | 671 | /* Available with KVM_CAP_NMI */ |
589 | #define KVM_NMI _IO(KVMIO, 0x9a) | 672 | #define KVM_NMI _IO(KVMIO, 0x9a) |
590 | /* Available with KVM_CAP_SET_GUEST_DEBUG */ | 673 | /* Available with KVM_CAP_SET_GUEST_DEBUG */ |
591 | #define KVM_SET_GUEST_DEBUG _IOW(KVMIO, 0x9b, struct kvm_guest_debug) | 674 | #define KVM_SET_GUEST_DEBUG _IOW(KVMIO, 0x9b, struct kvm_guest_debug) |
592 | /* MCE for x86 */ | 675 | /* MCE for x86 */ |
593 | #define KVM_X86_SETUP_MCE _IOW(KVMIO, 0x9c, __u64) | 676 | #define KVM_X86_SETUP_MCE _IOW(KVMIO, 0x9c, __u64) |
594 | #define KVM_X86_GET_MCE_CAP_SUPPORTED _IOR(KVMIO, 0x9d, __u64) | 677 | #define KVM_X86_GET_MCE_CAP_SUPPORTED _IOR(KVMIO, 0x9d, __u64) |
595 | #define KVM_X86_SET_MCE _IOW(KVMIO, 0x9e, struct kvm_x86_mce) | 678 | #define KVM_X86_SET_MCE _IOW(KVMIO, 0x9e, struct kvm_x86_mce) |
596 | 679 | /* IA64 stack access */ | |
597 | /* | ||
598 | * Deprecated interfaces | ||
599 | */ | ||
600 | struct kvm_breakpoint { | ||
601 | __u32 enabled; | ||
602 | __u32 padding; | ||
603 | __u64 address; | ||
604 | }; | ||
605 | |||
606 | struct kvm_debug_guest { | ||
607 | __u32 enabled; | ||
608 | __u32 pad; | ||
609 | struct kvm_breakpoint breakpoints[4]; | ||
610 | __u32 singlestep; | ||
611 | }; | ||
612 | |||
613 | #define __KVM_DEPRECATED_DEBUG_GUEST _IOW(KVMIO, 0x87, struct kvm_debug_guest) | ||
614 | |||
615 | #define KVM_IA64_VCPU_GET_STACK _IOR(KVMIO, 0x9a, void *) | 680 | #define KVM_IA64_VCPU_GET_STACK _IOR(KVMIO, 0x9a, void *) |
616 | #define KVM_IA64_VCPU_SET_STACK _IOW(KVMIO, 0x9b, void *) | 681 | #define KVM_IA64_VCPU_SET_STACK _IOW(KVMIO, 0x9b, void *) |
617 | 682 | /* Available with KVM_CAP_VCPU_EVENTS */ | |
618 | #define KVM_GET_PIT2 _IOR(KVMIO, 0x9f, struct kvm_pit_state2) | 683 | #define KVM_GET_VCPU_EVENTS _IOR(KVMIO, 0x9f, struct kvm_vcpu_events) |
619 | #define KVM_SET_PIT2 _IOW(KVMIO, 0xa0, struct kvm_pit_state2) | 684 | #define KVM_SET_VCPU_EVENTS _IOW(KVMIO, 0xa0, struct kvm_vcpu_events) |
620 | |||
621 | #define KVM_TRC_INJ_VIRQ (KVM_TRC_HANDLER + 0x02) | ||
622 | #define KVM_TRC_REDELIVER_EVT (KVM_TRC_HANDLER + 0x03) | ||
623 | #define KVM_TRC_PEND_INTR (KVM_TRC_HANDLER + 0x04) | ||
624 | #define KVM_TRC_IO_READ (KVM_TRC_HANDLER + 0x05) | ||
625 | #define KVM_TRC_IO_WRITE (KVM_TRC_HANDLER + 0x06) | ||
626 | #define KVM_TRC_CR_READ (KVM_TRC_HANDLER + 0x07) | ||
627 | #define KVM_TRC_CR_WRITE (KVM_TRC_HANDLER + 0x08) | ||
628 | #define KVM_TRC_DR_READ (KVM_TRC_HANDLER + 0x09) | ||
629 | #define KVM_TRC_DR_WRITE (KVM_TRC_HANDLER + 0x0A) | ||
630 | #define KVM_TRC_MSR_READ (KVM_TRC_HANDLER + 0x0B) | ||
631 | #define KVM_TRC_MSR_WRITE (KVM_TRC_HANDLER + 0x0C) | ||
632 | #define KVM_TRC_CPUID (KVM_TRC_HANDLER + 0x0D) | ||
633 | #define KVM_TRC_INTR (KVM_TRC_HANDLER + 0x0E) | ||
634 | #define KVM_TRC_NMI (KVM_TRC_HANDLER + 0x0F) | ||
635 | #define KVM_TRC_VMMCALL (KVM_TRC_HANDLER + 0x10) | ||
636 | #define KVM_TRC_HLT (KVM_TRC_HANDLER + 0x11) | ||
637 | #define KVM_TRC_CLTS (KVM_TRC_HANDLER + 0x12) | ||
638 | #define KVM_TRC_LMSW (KVM_TRC_HANDLER + 0x13) | ||
639 | #define KVM_TRC_APIC_ACCESS (KVM_TRC_HANDLER + 0x14) | ||
640 | #define KVM_TRC_TDP_FAULT (KVM_TRC_HANDLER + 0x15) | ||
641 | #define KVM_TRC_GTLB_WRITE (KVM_TRC_HANDLER + 0x16) | ||
642 | #define KVM_TRC_STLB_WRITE (KVM_TRC_HANDLER + 0x17) | ||
643 | #define KVM_TRC_STLB_INVAL (KVM_TRC_HANDLER + 0x18) | ||
644 | #define KVM_TRC_PPC_INSTR (KVM_TRC_HANDLER + 0x19) | ||
645 | 685 | ||
646 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) | 686 | #define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) |
647 | 687 | ||
@@ -696,4 +736,4 @@ struct kvm_assigned_msix_entry { | |||
696 | __u16 padding[3]; | 736 | __u16 padding[3]; |
697 | }; | 737 | }; |
698 | 738 | ||
699 | #endif | 739 | #endif /* __LINUX_KVM_H */ |
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h index b7bbb5ddd7ae..bd5a616d9373 100644 --- a/include/linux/kvm_host.h +++ b/include/linux/kvm_host.h | |||
@@ -120,7 +120,7 @@ struct kvm_kernel_irq_routing_entry { | |||
120 | u32 gsi; | 120 | u32 gsi; |
121 | u32 type; | 121 | u32 type; |
122 | int (*set)(struct kvm_kernel_irq_routing_entry *e, | 122 | int (*set)(struct kvm_kernel_irq_routing_entry *e, |
123 | struct kvm *kvm, int level); | 123 | struct kvm *kvm, int irq_source_id, int level); |
124 | union { | 124 | union { |
125 | struct { | 125 | struct { |
126 | unsigned irqchip; | 126 | unsigned irqchip; |
@@ -128,9 +128,28 @@ struct kvm_kernel_irq_routing_entry { | |||
128 | } irqchip; | 128 | } irqchip; |
129 | struct msi_msg msi; | 129 | struct msi_msg msi; |
130 | }; | 130 | }; |
131 | struct list_head link; | 131 | struct hlist_node link; |
132 | }; | ||
133 | |||
134 | #ifdef __KVM_HAVE_IOAPIC | ||
135 | |||
136 | struct kvm_irq_routing_table { | ||
137 | int chip[KVM_NR_IRQCHIPS][KVM_IOAPIC_NUM_PINS]; | ||
138 | struct kvm_kernel_irq_routing_entry *rt_entries; | ||
139 | u32 nr_rt_entries; | ||
140 | /* | ||
141 | * Array indexed by gsi. Each entry contains list of irq chips | ||
142 | * the gsi is connected to. | ||
143 | */ | ||
144 | struct hlist_head map[0]; | ||
132 | }; | 145 | }; |
133 | 146 | ||
147 | #else | ||
148 | |||
149 | struct kvm_irq_routing_table {}; | ||
150 | |||
151 | #endif | ||
152 | |||
134 | struct kvm { | 153 | struct kvm { |
135 | spinlock_t mmu_lock; | 154 | spinlock_t mmu_lock; |
136 | spinlock_t requests_lock; | 155 | spinlock_t requests_lock; |
@@ -166,8 +185,9 @@ struct kvm { | |||
166 | 185 | ||
167 | struct mutex irq_lock; | 186 | struct mutex irq_lock; |
168 | #ifdef CONFIG_HAVE_KVM_IRQCHIP | 187 | #ifdef CONFIG_HAVE_KVM_IRQCHIP |
169 | struct list_head irq_routing; /* of kvm_kernel_irq_routing_entry */ | 188 | struct kvm_irq_routing_table *irq_routing; |
170 | struct hlist_head mask_notifier_list; | 189 | struct hlist_head mask_notifier_list; |
190 | struct hlist_head irq_ack_notifier_list; | ||
171 | #endif | 191 | #endif |
172 | 192 | ||
173 | #ifdef KVM_ARCH_WANT_MMU_NOTIFIER | 193 | #ifdef KVM_ARCH_WANT_MMU_NOTIFIER |
@@ -266,6 +286,7 @@ int kvm_is_visible_gfn(struct kvm *kvm, gfn_t gfn); | |||
266 | void mark_page_dirty(struct kvm *kvm, gfn_t gfn); | 286 | void mark_page_dirty(struct kvm *kvm, gfn_t gfn); |
267 | 287 | ||
268 | void kvm_vcpu_block(struct kvm_vcpu *vcpu); | 288 | void kvm_vcpu_block(struct kvm_vcpu *vcpu); |
289 | void kvm_vcpu_on_spin(struct kvm_vcpu *vcpu); | ||
269 | void kvm_resched(struct kvm_vcpu *vcpu); | 290 | void kvm_resched(struct kvm_vcpu *vcpu); |
270 | void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); | 291 | void kvm_load_guest_fpu(struct kvm_vcpu *vcpu); |
271 | void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); | 292 | void kvm_put_guest_fpu(struct kvm_vcpu *vcpu); |
@@ -325,7 +346,7 @@ int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu); | |||
325 | void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu); | 346 | void kvm_arch_vcpu_destroy(struct kvm_vcpu *vcpu); |
326 | 347 | ||
327 | int kvm_arch_vcpu_reset(struct kvm_vcpu *vcpu); | 348 | int kvm_arch_vcpu_reset(struct kvm_vcpu *vcpu); |
328 | void kvm_arch_hardware_enable(void *garbage); | 349 | int kvm_arch_hardware_enable(void *garbage); |
329 | void kvm_arch_hardware_disable(void *garbage); | 350 | void kvm_arch_hardware_disable(void *garbage); |
330 | int kvm_arch_hardware_setup(void); | 351 | int kvm_arch_hardware_setup(void); |
331 | void kvm_arch_hardware_unsetup(void); | 352 | void kvm_arch_hardware_unsetup(void); |
@@ -390,7 +411,12 @@ void kvm_unregister_irq_mask_notifier(struct kvm *kvm, int irq, | |||
390 | struct kvm_irq_mask_notifier *kimn); | 411 | struct kvm_irq_mask_notifier *kimn); |
391 | void kvm_fire_mask_notifiers(struct kvm *kvm, int irq, bool mask); | 412 | void kvm_fire_mask_notifiers(struct kvm *kvm, int irq, bool mask); |
392 | 413 | ||
393 | int kvm_set_irq(struct kvm *kvm, int irq_source_id, int irq, int level); | 414 | #ifdef __KVM_HAVE_IOAPIC |
415 | void kvm_get_intr_delivery_bitmask(struct kvm_ioapic *ioapic, | ||
416 | union kvm_ioapic_redirect_entry *entry, | ||
417 | unsigned long *deliver_bitmask); | ||
418 | #endif | ||
419 | int kvm_set_irq(struct kvm *kvm, int irq_source_id, u32 irq, int level); | ||
394 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); | 420 | void kvm_notify_acked_irq(struct kvm *kvm, unsigned irqchip, unsigned pin); |
395 | void kvm_register_irq_ack_notifier(struct kvm *kvm, | 421 | void kvm_register_irq_ack_notifier(struct kvm *kvm, |
396 | struct kvm_irq_ack_notifier *kian); | 422 | struct kvm_irq_ack_notifier *kian); |
@@ -552,4 +578,21 @@ static inline bool kvm_vcpu_is_bsp(struct kvm_vcpu *vcpu) | |||
552 | return vcpu->kvm->bsp_vcpu_id == vcpu->vcpu_id; | 578 | return vcpu->kvm->bsp_vcpu_id == vcpu->vcpu_id; |
553 | } | 579 | } |
554 | #endif | 580 | #endif |
581 | |||
582 | #ifdef __KVM_HAVE_DEVICE_ASSIGNMENT | ||
583 | |||
584 | long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl, | ||
585 | unsigned long arg); | ||
586 | |||
587 | #else | ||
588 | |||
589 | static inline long kvm_vm_ioctl_assigned_device(struct kvm *kvm, unsigned ioctl, | ||
590 | unsigned long arg) | ||
591 | { | ||
592 | return -ENOTTY; | ||
593 | } | ||
594 | |||
555 | #endif | 595 | #endif |
596 | |||
597 | #endif | ||
598 | |||
diff --git a/include/linux/libata.h b/include/linux/libata.h index 87698640c091..6a9c4ddd3d95 100644 --- a/include/linux/libata.h +++ b/include/linux/libata.h | |||
@@ -365,7 +365,7 @@ enum { | |||
365 | /* This should match the actual table size of | 365 | /* This should match the actual table size of |
366 | * ata_eh_cmd_timeout_table in libata-eh.c. | 366 | * ata_eh_cmd_timeout_table in libata-eh.c. |
367 | */ | 367 | */ |
368 | ATA_EH_CMD_TIMEOUT_TABLE_SIZE = 5, | 368 | ATA_EH_CMD_TIMEOUT_TABLE_SIZE = 6, |
369 | 369 | ||
370 | /* Horkage types. May be set by libata or controller on drives | 370 | /* Horkage types. May be set by libata or controller on drives |
371 | (some horkage may be drive/controller pair dependant */ | 371 | (some horkage may be drive/controller pair dependant */ |
@@ -595,6 +595,7 @@ struct ata_device { | |||
595 | unsigned int horkage; /* List of broken features */ | 595 | unsigned int horkage; /* List of broken features */ |
596 | unsigned long flags; /* ATA_DFLAG_xxx */ | 596 | unsigned long flags; /* ATA_DFLAG_xxx */ |
597 | struct scsi_device *sdev; /* attached SCSI device */ | 597 | struct scsi_device *sdev; /* attached SCSI device */ |
598 | void *private_data; | ||
598 | #ifdef CONFIG_ATA_ACPI | 599 | #ifdef CONFIG_ATA_ACPI |
599 | acpi_handle acpi_handle; | 600 | acpi_handle acpi_handle; |
600 | union acpi_object *gtf_cache; | 601 | union acpi_object *gtf_cache; |
@@ -1023,7 +1024,7 @@ extern int ata_std_bios_param(struct scsi_device *sdev, | |||
1023 | extern int ata_scsi_slave_config(struct scsi_device *sdev); | 1024 | extern int ata_scsi_slave_config(struct scsi_device *sdev); |
1024 | extern void ata_scsi_slave_destroy(struct scsi_device *sdev); | 1025 | extern void ata_scsi_slave_destroy(struct scsi_device *sdev); |
1025 | extern int ata_scsi_change_queue_depth(struct scsi_device *sdev, | 1026 | extern int ata_scsi_change_queue_depth(struct scsi_device *sdev, |
1026 | int queue_depth); | 1027 | int queue_depth, int reason); |
1027 | extern struct ata_device *ata_dev_pair(struct ata_device *adev); | 1028 | extern struct ata_device *ata_dev_pair(struct ata_device *adev); |
1028 | extern int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev); | 1029 | extern int ata_do_set_mode(struct ata_link *link, struct ata_device **r_failed_dev); |
1029 | 1030 | ||
diff --git a/include/linux/lru_cache.h b/include/linux/lru_cache.h new file mode 100644 index 000000000000..3a2b2d9b0472 --- /dev/null +++ b/include/linux/lru_cache.h | |||
@@ -0,0 +1,294 @@ | |||
1 | /* | ||
2 | lru_cache.c | ||
3 | |||
4 | This file is part of DRBD by Philipp Reisner and Lars Ellenberg. | ||
5 | |||
6 | Copyright (C) 2003-2008, LINBIT Information Technologies GmbH. | ||
7 | Copyright (C) 2003-2008, Philipp Reisner <philipp.reisner@linbit.com>. | ||
8 | Copyright (C) 2003-2008, Lars Ellenberg <lars.ellenberg@linbit.com>. | ||
9 | |||
10 | drbd is free software; you can redistribute it and/or modify | ||
11 | it under the terms of the GNU General Public License as published by | ||
12 | the Free Software Foundation; either version 2, or (at your option) | ||
13 | any later version. | ||
14 | |||
15 | drbd is distributed in the hope that it will be useful, | ||
16 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | GNU General Public License for more details. | ||
19 | |||
20 | You should have received a copy of the GNU General Public License | ||
21 | along with drbd; see the file COPYING. If not, write to | ||
22 | the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | ||
23 | |||
24 | */ | ||
25 | |||
26 | #ifndef LRU_CACHE_H | ||
27 | #define LRU_CACHE_H | ||
28 | |||
29 | #include <linux/list.h> | ||
30 | #include <linux/slab.h> | ||
31 | #include <linux/bitops.h> | ||
32 | #include <linux/string.h> /* for memset */ | ||
33 | #include <linux/seq_file.h> | ||
34 | |||
35 | /* | ||
36 | This header file (and its .c file; kernel-doc of functions see there) | ||
37 | define a helper framework to easily keep track of index:label associations, | ||
38 | and changes to an "active set" of objects, as well as pending transactions, | ||
39 | to persistently record those changes. | ||
40 | |||
41 | We use an LRU policy if it is necessary to "cool down" a region currently in | ||
42 | the active set before we can "heat" a previously unused region. | ||
43 | |||
44 | Because of this later property, it is called "lru_cache". | ||
45 | As it actually Tracks Objects in an Active SeT, we could also call it | ||
46 | toast (incidentally that is what may happen to the data on the | ||
47 | backend storage uppon next resync, if we don't get it right). | ||
48 | |||
49 | What for? | ||
50 | |||
51 | We replicate IO (more or less synchronously) to local and remote disk. | ||
52 | |||
53 | For crash recovery after replication node failure, | ||
54 | we need to resync all regions that have been target of in-flight WRITE IO | ||
55 | (in use, or "hot", regions), as we don't know wether or not those WRITEs have | ||
56 | made it to stable storage. | ||
57 | |||
58 | To avoid a "full resync", we need to persistently track these regions. | ||
59 | |||
60 | This is known as "write intent log", and can be implemented as on-disk | ||
61 | (coarse or fine grained) bitmap, or other meta data. | ||
62 | |||
63 | To avoid the overhead of frequent extra writes to this meta data area, | ||
64 | usually the condition is softened to regions that _may_ have been target of | ||
65 | in-flight WRITE IO, e.g. by only lazily clearing the on-disk write-intent | ||
66 | bitmap, trading frequency of meta data transactions against amount of | ||
67 | (possibly unneccessary) resync traffic. | ||
68 | |||
69 | If we set a hard limit on the area that may be "hot" at any given time, we | ||
70 | limit the amount of resync traffic needed for crash recovery. | ||
71 | |||
72 | For recovery after replication link failure, | ||
73 | we need to resync all blocks that have been changed on the other replica | ||
74 | in the mean time, or, if both replica have been changed independently [*], | ||
75 | all blocks that have been changed on either replica in the mean time. | ||
76 | [*] usually as a result of a cluster split-brain and insufficient protection. | ||
77 | but there are valid use cases to do this on purpose. | ||
78 | |||
79 | Tracking those blocks can be implemented as "dirty bitmap". | ||
80 | Having it fine-grained reduces the amount of resync traffic. | ||
81 | It should also be persistent, to allow for reboots (or crashes) | ||
82 | while the replication link is down. | ||
83 | |||
84 | There are various possible implementations for persistently storing | ||
85 | write intent log information, three of which are mentioned here. | ||
86 | |||
87 | "Chunk dirtying" | ||
88 | The on-disk "dirty bitmap" may be re-used as "write-intent" bitmap as well. | ||
89 | To reduce the frequency of bitmap updates for write-intent log purposes, | ||
90 | one could dirty "chunks" (of some size) at a time of the (fine grained) | ||
91 | on-disk bitmap, while keeping the in-memory "dirty" bitmap as clean as | ||
92 | possible, flushing it to disk again when a previously "hot" (and on-disk | ||
93 | dirtied as full chunk) area "cools down" again (no IO in flight anymore, | ||
94 | and none expected in the near future either). | ||
95 | |||
96 | "Explicit (coarse) write intent bitmap" | ||
97 | An other implementation could chose a (probably coarse) explicit bitmap, | ||
98 | for write-intent log purposes, additionally to the fine grained dirty bitmap. | ||
99 | |||
100 | "Activity log" | ||
101 | Yet an other implementation may keep track of the hot regions, by starting | ||
102 | with an empty set, and writing down a journal of region numbers that have | ||
103 | become "hot", or have "cooled down" again. | ||
104 | |||
105 | To be able to use a ring buffer for this journal of changes to the active | ||
106 | set, we not only record the actual changes to that set, but also record the | ||
107 | not changing members of the set in a round robin fashion. To do so, we use a | ||
108 | fixed (but configurable) number of slots which we can identify by index, and | ||
109 | associate region numbers (labels) with these indices. | ||
110 | For each transaction recording a change to the active set, we record the | ||
111 | change itself (index: -old_label, +new_label), and which index is associated | ||
112 | with which label (index: current_label) within a certain sliding window that | ||
113 | is moved further over the available indices with each such transaction. | ||
114 | |||
115 | Thus, for crash recovery, if the ringbuffer is sufficiently large, we can | ||
116 | accurately reconstruct the active set. | ||
117 | |||
118 | Sufficiently large depends only on maximum number of active objects, and the | ||
119 | size of the sliding window recording "index: current_label" associations within | ||
120 | each transaction. | ||
121 | |||
122 | This is what we call the "activity log". | ||
123 | |||
124 | Currently we need one activity log transaction per single label change, which | ||
125 | does not give much benefit over the "dirty chunks of bitmap" approach, other | ||
126 | than potentially less seeks. | ||
127 | |||
128 | We plan to change the transaction format to support multiple changes per | ||
129 | transaction, which then would reduce several (disjoint, "random") updates to | ||
130 | the bitmap into one transaction to the activity log ring buffer. | ||
131 | */ | ||
132 | |||
133 | /* this defines an element in a tracked set | ||
134 | * .colision is for hash table lookup. | ||
135 | * When we process a new IO request, we know its sector, thus can deduce the | ||
136 | * region number (label) easily. To do the label -> object lookup without a | ||
137 | * full list walk, we use a simple hash table. | ||
138 | * | ||
139 | * .list is on one of three lists: | ||
140 | * in_use: currently in use (refcnt > 0, lc_number != LC_FREE) | ||
141 | * lru: unused but ready to be reused or recycled | ||
142 | * (ts_refcnt == 0, lc_number != LC_FREE), | ||
143 | * free: unused but ready to be recycled | ||
144 | * (ts_refcnt == 0, lc_number == LC_FREE), | ||
145 | * | ||
146 | * an element is said to be "in the active set", | ||
147 | * if either on "in_use" or "lru", i.e. lc_number != LC_FREE. | ||
148 | * | ||
149 | * DRBD currently (May 2009) only uses 61 elements on the resync lru_cache | ||
150 | * (total memory usage 2 pages), and up to 3833 elements on the act_log | ||
151 | * lru_cache, totalling ~215 kB for 64bit architechture, ~53 pages. | ||
152 | * | ||
153 | * We usually do not actually free these objects again, but only "recycle" | ||
154 | * them, as the change "index: -old_label, +LC_FREE" would need a transaction | ||
155 | * as well. Which also means that using a kmem_cache to allocate the objects | ||
156 | * from wastes some resources. | ||
157 | * But it avoids high order page allocations in kmalloc. | ||
158 | */ | ||
159 | struct lc_element { | ||
160 | struct hlist_node colision; | ||
161 | struct list_head list; /* LRU list or free list */ | ||
162 | unsigned refcnt; | ||
163 | /* back "pointer" into ts_cache->element[index], | ||
164 | * for paranoia, and for "ts_element_to_index" */ | ||
165 | unsigned lc_index; | ||
166 | /* if we want to track a larger set of objects, | ||
167 | * it needs to become arch independend u64 */ | ||
168 | unsigned lc_number; | ||
169 | |||
170 | /* special label when on free list */ | ||
171 | #define LC_FREE (~0U) | ||
172 | }; | ||
173 | |||
174 | struct lru_cache { | ||
175 | /* the least recently used item is kept at lru->prev */ | ||
176 | struct list_head lru; | ||
177 | struct list_head free; | ||
178 | struct list_head in_use; | ||
179 | |||
180 | /* the pre-created kmem cache to allocate the objects from */ | ||
181 | struct kmem_cache *lc_cache; | ||
182 | |||
183 | /* size of tracked objects, used to memset(,0,) them in lc_reset */ | ||
184 | size_t element_size; | ||
185 | /* offset of struct lc_element member in the tracked object */ | ||
186 | size_t element_off; | ||
187 | |||
188 | /* number of elements (indices) */ | ||
189 | unsigned int nr_elements; | ||
190 | /* Arbitrary limit on maximum tracked objects. Practical limit is much | ||
191 | * lower due to allocation failures, probably. For typical use cases, | ||
192 | * nr_elements should be a few thousand at most. | ||
193 | * This also limits the maximum value of ts_element.ts_index, allowing the | ||
194 | * 8 high bits of .ts_index to be overloaded with flags in the future. */ | ||
195 | #define LC_MAX_ACTIVE (1<<24) | ||
196 | |||
197 | /* statistics */ | ||
198 | unsigned used; /* number of lelements currently on in_use list */ | ||
199 | unsigned long hits, misses, starving, dirty, changed; | ||
200 | |||
201 | /* see below: flag-bits for lru_cache */ | ||
202 | unsigned long flags; | ||
203 | |||
204 | /* when changing the label of an index element */ | ||
205 | unsigned int new_number; | ||
206 | |||
207 | /* for paranoia when changing the label of an index element */ | ||
208 | struct lc_element *changing_element; | ||
209 | |||
210 | void *lc_private; | ||
211 | const char *name; | ||
212 | |||
213 | /* nr_elements there */ | ||
214 | struct hlist_head *lc_slot; | ||
215 | struct lc_element **lc_element; | ||
216 | }; | ||
217 | |||
218 | |||
219 | /* flag-bits for lru_cache */ | ||
220 | enum { | ||
221 | /* debugging aid, to catch concurrent access early. | ||
222 | * user needs to guarantee exclusive access by proper locking! */ | ||
223 | __LC_PARANOIA, | ||
224 | /* if we need to change the set, but currently there is a changing | ||
225 | * transaction pending, we are "dirty", and must deferr further | ||
226 | * changing requests */ | ||
227 | __LC_DIRTY, | ||
228 | /* if we need to change the set, but currently there is no free nor | ||
229 | * unused element available, we are "starving", and must not give out | ||
230 | * further references, to guarantee that eventually some refcnt will | ||
231 | * drop to zero and we will be able to make progress again, changing | ||
232 | * the set, writing the transaction. | ||
233 | * if the statistics say we are frequently starving, | ||
234 | * nr_elements is too small. */ | ||
235 | __LC_STARVING, | ||
236 | }; | ||
237 | #define LC_PARANOIA (1<<__LC_PARANOIA) | ||
238 | #define LC_DIRTY (1<<__LC_DIRTY) | ||
239 | #define LC_STARVING (1<<__LC_STARVING) | ||
240 | |||
241 | extern struct lru_cache *lc_create(const char *name, struct kmem_cache *cache, | ||
242 | unsigned e_count, size_t e_size, size_t e_off); | ||
243 | extern void lc_reset(struct lru_cache *lc); | ||
244 | extern void lc_destroy(struct lru_cache *lc); | ||
245 | extern void lc_set(struct lru_cache *lc, unsigned int enr, int index); | ||
246 | extern void lc_del(struct lru_cache *lc, struct lc_element *element); | ||
247 | |||
248 | extern struct lc_element *lc_try_get(struct lru_cache *lc, unsigned int enr); | ||
249 | extern struct lc_element *lc_find(struct lru_cache *lc, unsigned int enr); | ||
250 | extern struct lc_element *lc_get(struct lru_cache *lc, unsigned int enr); | ||
251 | extern unsigned int lc_put(struct lru_cache *lc, struct lc_element *e); | ||
252 | extern void lc_changed(struct lru_cache *lc, struct lc_element *e); | ||
253 | |||
254 | struct seq_file; | ||
255 | extern size_t lc_seq_printf_stats(struct seq_file *seq, struct lru_cache *lc); | ||
256 | |||
257 | extern void lc_seq_dump_details(struct seq_file *seq, struct lru_cache *lc, char *utext, | ||
258 | void (*detail) (struct seq_file *, struct lc_element *)); | ||
259 | |||
260 | /** | ||
261 | * lc_try_lock - can be used to stop lc_get() from changing the tracked set | ||
262 | * @lc: the lru cache to operate on | ||
263 | * | ||
264 | * Note that the reference counts and order on the active and lru lists may | ||
265 | * still change. Returns true if we aquired the lock. | ||
266 | */ | ||
267 | static inline int lc_try_lock(struct lru_cache *lc) | ||
268 | { | ||
269 | return !test_and_set_bit(__LC_DIRTY, &lc->flags); | ||
270 | } | ||
271 | |||
272 | /** | ||
273 | * lc_unlock - unlock @lc, allow lc_get() to change the set again | ||
274 | * @lc: the lru cache to operate on | ||
275 | */ | ||
276 | static inline void lc_unlock(struct lru_cache *lc) | ||
277 | { | ||
278 | clear_bit(__LC_DIRTY, &lc->flags); | ||
279 | smp_mb__after_clear_bit(); | ||
280 | } | ||
281 | |||
282 | static inline int lc_is_used(struct lru_cache *lc, unsigned int enr) | ||
283 | { | ||
284 | struct lc_element *e = lc_find(lc, enr); | ||
285 | return e && e->refcnt; | ||
286 | } | ||
287 | |||
288 | #define lc_entry(ptr, type, member) \ | ||
289 | container_of(ptr, type, member) | ||
290 | |||
291 | extern struct lc_element *lc_element_by_index(struct lru_cache *lc, unsigned i); | ||
292 | extern unsigned int lc_index_of(struct lru_cache *lc, struct lc_element *e); | ||
293 | |||
294 | #endif | ||
diff --git a/include/linux/lsm_audit.h b/include/linux/lsm_audit.h index 190c37854870..f78f83d7663f 100644 --- a/include/linux/lsm_audit.h +++ b/include/linux/lsm_audit.h | |||
@@ -26,14 +26,15 @@ | |||
26 | 26 | ||
27 | /* Auxiliary data to use in generating the audit record. */ | 27 | /* Auxiliary data to use in generating the audit record. */ |
28 | struct common_audit_data { | 28 | struct common_audit_data { |
29 | char type; | 29 | char type; |
30 | #define LSM_AUDIT_DATA_FS 1 | 30 | #define LSM_AUDIT_DATA_FS 1 |
31 | #define LSM_AUDIT_DATA_NET 2 | 31 | #define LSM_AUDIT_DATA_NET 2 |
32 | #define LSM_AUDIT_DATA_CAP 3 | 32 | #define LSM_AUDIT_DATA_CAP 3 |
33 | #define LSM_AUDIT_DATA_IPC 4 | 33 | #define LSM_AUDIT_DATA_IPC 4 |
34 | #define LSM_AUDIT_DATA_TASK 5 | 34 | #define LSM_AUDIT_DATA_TASK 5 |
35 | #define LSM_AUDIT_DATA_KEY 6 | 35 | #define LSM_AUDIT_DATA_KEY 6 |
36 | #define LSM_AUDIT_NO_AUDIT 7 | 36 | #define LSM_AUDIT_NO_AUDIT 7 |
37 | #define LSM_AUDIT_DATA_KMOD 8 | ||
37 | struct task_struct *tsk; | 38 | struct task_struct *tsk; |
38 | union { | 39 | union { |
39 | struct { | 40 | struct { |
@@ -66,6 +67,7 @@ struct common_audit_data { | |||
66 | char *key_desc; | 67 | char *key_desc; |
67 | } key_struct; | 68 | } key_struct; |
68 | #endif | 69 | #endif |
70 | char *kmod_name; | ||
69 | } u; | 71 | } u; |
70 | /* this union contains LSM specific data */ | 72 | /* this union contains LSM specific data */ |
71 | union { | 73 | union { |
diff --git a/include/linux/mfd/da903x.h b/include/linux/mfd/da903x.h index c63b65c94429..0aa3a1a49ee3 100644 --- a/include/linux/mfd/da903x.h +++ b/include/linux/mfd/da903x.h | |||
@@ -96,6 +96,10 @@ struct da9034_touch_pdata { | |||
96 | int y_inverted; | 96 | int y_inverted; |
97 | }; | 97 | }; |
98 | 98 | ||
99 | struct da9034_backlight_pdata { | ||
100 | int output_current; /* output current of WLED, from 0-31 (in mA) */ | ||
101 | }; | ||
102 | |||
99 | /* DA9030 battery charger data */ | 103 | /* DA9030 battery charger data */ |
100 | struct power_supply_info; | 104 | struct power_supply_info; |
101 | 105 | ||
diff --git a/include/linux/mfd/ezx-pcap.h b/include/linux/mfd/ezx-pcap.h index e5124ceea769..3402042ddc31 100644 --- a/include/linux/mfd/ezx-pcap.h +++ b/include/linux/mfd/ezx-pcap.h | |||
@@ -45,7 +45,7 @@ void pcap_set_ts_bits(struct pcap_chip *, u32); | |||
45 | #define PCAP_CLEAR_INTERRUPT_REGISTER 0x01ffffff | 45 | #define PCAP_CLEAR_INTERRUPT_REGISTER 0x01ffffff |
46 | #define PCAP_MASK_ALL_INTERRUPT 0x01ffffff | 46 | #define PCAP_MASK_ALL_INTERRUPT 0x01ffffff |
47 | 47 | ||
48 | /* registers acessible by both pcap ports */ | 48 | /* registers accessible by both pcap ports */ |
49 | #define PCAP_REG_ISR 0x0 /* Interrupt Status */ | 49 | #define PCAP_REG_ISR 0x0 /* Interrupt Status */ |
50 | #define PCAP_REG_MSR 0x1 /* Interrupt Mask */ | 50 | #define PCAP_REG_MSR 0x1 /* Interrupt Mask */ |
51 | #define PCAP_REG_PSTAT 0x2 /* Processor Status */ | 51 | #define PCAP_REG_PSTAT 0x2 /* Processor Status */ |
@@ -67,7 +67,7 @@ void pcap_set_ts_bits(struct pcap_chip *, u32); | |||
67 | #define PCAP_REG_VENDOR_TEST1 0x1e | 67 | #define PCAP_REG_VENDOR_TEST1 0x1e |
68 | #define PCAP_REG_VENDOR_TEST2 0x1f | 68 | #define PCAP_REG_VENDOR_TEST2 0x1f |
69 | 69 | ||
70 | /* registers acessible by pcap port 1 only (a1200, e2 & e6) */ | 70 | /* registers accessible by pcap port 1 only (a1200, e2 & e6) */ |
71 | #define PCAP_REG_INT_SEL 0x3 /* Interrupt Select */ | 71 | #define PCAP_REG_INT_SEL 0x3 /* Interrupt Select */ |
72 | #define PCAP_REG_SWCTRL 0x4 /* Switching Regulator Control */ | 72 | #define PCAP_REG_SWCTRL 0x4 /* Switching Regulator Control */ |
73 | #define PCAP_REG_VREG1 0x5 /* Regulator Bank 1 Control */ | 73 | #define PCAP_REG_VREG1 0x5 /* Regulator Bank 1 Control */ |
diff --git a/include/linux/mfd/mcp.h b/include/linux/mfd/mcp.h new file mode 100644 index 000000000000..ee496708e38b --- /dev/null +++ b/include/linux/mfd/mcp.h | |||
@@ -0,0 +1,69 @@ | |||
1 | /* | ||
2 | * linux/drivers/mfd/mcp.h | ||
3 | * | ||
4 | * Copyright (C) 2001 Russell King, All Rights Reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License. | ||
9 | */ | ||
10 | #ifndef MCP_H | ||
11 | #define MCP_H | ||
12 | |||
13 | #include <mach/dma.h> | ||
14 | |||
15 | struct mcp_ops; | ||
16 | |||
17 | struct mcp { | ||
18 | struct module *owner; | ||
19 | struct mcp_ops *ops; | ||
20 | spinlock_t lock; | ||
21 | int use_count; | ||
22 | unsigned int sclk_rate; | ||
23 | unsigned int rw_timeout; | ||
24 | dma_device_t dma_audio_rd; | ||
25 | dma_device_t dma_audio_wr; | ||
26 | dma_device_t dma_telco_rd; | ||
27 | dma_device_t dma_telco_wr; | ||
28 | struct device attached_device; | ||
29 | int gpio_base; | ||
30 | }; | ||
31 | |||
32 | struct mcp_ops { | ||
33 | void (*set_telecom_divisor)(struct mcp *, unsigned int); | ||
34 | void (*set_audio_divisor)(struct mcp *, unsigned int); | ||
35 | void (*reg_write)(struct mcp *, unsigned int, unsigned int); | ||
36 | unsigned int (*reg_read)(struct mcp *, unsigned int); | ||
37 | void (*enable)(struct mcp *); | ||
38 | void (*disable)(struct mcp *); | ||
39 | }; | ||
40 | |||
41 | void mcp_set_telecom_divisor(struct mcp *, unsigned int); | ||
42 | void mcp_set_audio_divisor(struct mcp *, unsigned int); | ||
43 | void mcp_reg_write(struct mcp *, unsigned int, unsigned int); | ||
44 | unsigned int mcp_reg_read(struct mcp *, unsigned int); | ||
45 | void mcp_enable(struct mcp *); | ||
46 | void mcp_disable(struct mcp *); | ||
47 | #define mcp_get_sclk_rate(mcp) ((mcp)->sclk_rate) | ||
48 | |||
49 | struct mcp *mcp_host_alloc(struct device *, size_t); | ||
50 | int mcp_host_register(struct mcp *); | ||
51 | void mcp_host_unregister(struct mcp *); | ||
52 | |||
53 | struct mcp_driver { | ||
54 | struct device_driver drv; | ||
55 | int (*probe)(struct mcp *); | ||
56 | void (*remove)(struct mcp *); | ||
57 | int (*suspend)(struct mcp *, pm_message_t); | ||
58 | int (*resume)(struct mcp *); | ||
59 | }; | ||
60 | |||
61 | int mcp_driver_register(struct mcp_driver *); | ||
62 | void mcp_driver_unregister(struct mcp_driver *); | ||
63 | |||
64 | #define mcp_get_drvdata(mcp) dev_get_drvdata(&(mcp)->attached_device) | ||
65 | #define mcp_set_drvdata(mcp,d) dev_set_drvdata(&(mcp)->attached_device, d) | ||
66 | |||
67 | #define mcp_priv(mcp) ((void *)((mcp)+1)) | ||
68 | |||
69 | #endif | ||
diff --git a/include/linux/mfd/sh_mobile_sdhi.h b/include/linux/mfd/sh_mobile_sdhi.h new file mode 100644 index 000000000000..3bcd7163485c --- /dev/null +++ b/include/linux/mfd/sh_mobile_sdhi.h | |||
@@ -0,0 +1,8 @@ | |||
1 | #ifndef __SH_MOBILE_SDHI_H__ | ||
2 | #define __SH_MOBILE_SDHI_H__ | ||
3 | |||
4 | struct sh_mobile_sdhi_info { | ||
5 | void (*set_pwr)(struct platform_device *pdev, int state); | ||
6 | }; | ||
7 | |||
8 | #endif /* __SH_MOBILE_SDHI_H__ */ | ||
diff --git a/include/linux/mfd/twl4030-codec.h b/include/linux/mfd/twl4030-codec.h new file mode 100644 index 000000000000..2ec317c68e59 --- /dev/null +++ b/include/linux/mfd/twl4030-codec.h | |||
@@ -0,0 +1,272 @@ | |||
1 | /* | ||
2 | * MFD driver for twl4030 codec submodule | ||
3 | * | ||
4 | * Author: Peter Ujfalusi <peter.ujfalusi@nokia.com> | ||
5 | * | ||
6 | * Copyright: (C) 2009 Nokia Corporation | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, but | ||
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
20 | * 02110-1301 USA | ||
21 | * | ||
22 | */ | ||
23 | |||
24 | #ifndef __TWL4030_CODEC_H__ | ||
25 | #define __TWL4030_CODEC_H__ | ||
26 | |||
27 | /* Codec registers */ | ||
28 | #define TWL4030_REG_CODEC_MODE 0x01 | ||
29 | #define TWL4030_REG_OPTION 0x02 | ||
30 | #define TWL4030_REG_UNKNOWN 0x03 | ||
31 | #define TWL4030_REG_MICBIAS_CTL 0x04 | ||
32 | #define TWL4030_REG_ANAMICL 0x05 | ||
33 | #define TWL4030_REG_ANAMICR 0x06 | ||
34 | #define TWL4030_REG_AVADC_CTL 0x07 | ||
35 | #define TWL4030_REG_ADCMICSEL 0x08 | ||
36 | #define TWL4030_REG_DIGMIXING 0x09 | ||
37 | #define TWL4030_REG_ATXL1PGA 0x0A | ||
38 | #define TWL4030_REG_ATXR1PGA 0x0B | ||
39 | #define TWL4030_REG_AVTXL2PGA 0x0C | ||
40 | #define TWL4030_REG_AVTXR2PGA 0x0D | ||
41 | #define TWL4030_REG_AUDIO_IF 0x0E | ||
42 | #define TWL4030_REG_VOICE_IF 0x0F | ||
43 | #define TWL4030_REG_ARXR1PGA 0x10 | ||
44 | #define TWL4030_REG_ARXL1PGA 0x11 | ||
45 | #define TWL4030_REG_ARXR2PGA 0x12 | ||
46 | #define TWL4030_REG_ARXL2PGA 0x13 | ||
47 | #define TWL4030_REG_VRXPGA 0x14 | ||
48 | #define TWL4030_REG_VSTPGA 0x15 | ||
49 | #define TWL4030_REG_VRX2ARXPGA 0x16 | ||
50 | #define TWL4030_REG_AVDAC_CTL 0x17 | ||
51 | #define TWL4030_REG_ARX2VTXPGA 0x18 | ||
52 | #define TWL4030_REG_ARXL1_APGA_CTL 0x19 | ||
53 | #define TWL4030_REG_ARXR1_APGA_CTL 0x1A | ||
54 | #define TWL4030_REG_ARXL2_APGA_CTL 0x1B | ||
55 | #define TWL4030_REG_ARXR2_APGA_CTL 0x1C | ||
56 | #define TWL4030_REG_ATX2ARXPGA 0x1D | ||
57 | #define TWL4030_REG_BT_IF 0x1E | ||
58 | #define TWL4030_REG_BTPGA 0x1F | ||
59 | #define TWL4030_REG_BTSTPGA 0x20 | ||
60 | #define TWL4030_REG_EAR_CTL 0x21 | ||
61 | #define TWL4030_REG_HS_SEL 0x22 | ||
62 | #define TWL4030_REG_HS_GAIN_SET 0x23 | ||
63 | #define TWL4030_REG_HS_POPN_SET 0x24 | ||
64 | #define TWL4030_REG_PREDL_CTL 0x25 | ||
65 | #define TWL4030_REG_PREDR_CTL 0x26 | ||
66 | #define TWL4030_REG_PRECKL_CTL 0x27 | ||
67 | #define TWL4030_REG_PRECKR_CTL 0x28 | ||
68 | #define TWL4030_REG_HFL_CTL 0x29 | ||
69 | #define TWL4030_REG_HFR_CTL 0x2A | ||
70 | #define TWL4030_REG_ALC_CTL 0x2B | ||
71 | #define TWL4030_REG_ALC_SET1 0x2C | ||
72 | #define TWL4030_REG_ALC_SET2 0x2D | ||
73 | #define TWL4030_REG_BOOST_CTL 0x2E | ||
74 | #define TWL4030_REG_SOFTVOL_CTL 0x2F | ||
75 | #define TWL4030_REG_DTMF_FREQSEL 0x30 | ||
76 | #define TWL4030_REG_DTMF_TONEXT1H 0x31 | ||
77 | #define TWL4030_REG_DTMF_TONEXT1L 0x32 | ||
78 | #define TWL4030_REG_DTMF_TONEXT2H 0x33 | ||
79 | #define TWL4030_REG_DTMF_TONEXT2L 0x34 | ||
80 | #define TWL4030_REG_DTMF_TONOFF 0x35 | ||
81 | #define TWL4030_REG_DTMF_WANONOFF 0x36 | ||
82 | #define TWL4030_REG_I2S_RX_SCRAMBLE_H 0x37 | ||
83 | #define TWL4030_REG_I2S_RX_SCRAMBLE_M 0x38 | ||
84 | #define TWL4030_REG_I2S_RX_SCRAMBLE_L 0x39 | ||
85 | #define TWL4030_REG_APLL_CTL 0x3A | ||
86 | #define TWL4030_REG_DTMF_CTL 0x3B | ||
87 | #define TWL4030_REG_DTMF_PGA_CTL2 0x3C | ||
88 | #define TWL4030_REG_DTMF_PGA_CTL1 0x3D | ||
89 | #define TWL4030_REG_MISC_SET_1 0x3E | ||
90 | #define TWL4030_REG_PCMBTMUX 0x3F | ||
91 | #define TWL4030_REG_RX_PATH_SEL 0x43 | ||
92 | #define TWL4030_REG_VDL_APGA_CTL 0x44 | ||
93 | #define TWL4030_REG_VIBRA_CTL 0x45 | ||
94 | #define TWL4030_REG_VIBRA_SET 0x46 | ||
95 | #define TWL4030_REG_VIBRA_PWM_SET 0x47 | ||
96 | #define TWL4030_REG_ANAMIC_GAIN 0x48 | ||
97 | #define TWL4030_REG_MISC_SET_2 0x49 | ||
98 | |||
99 | /* Bitfield Definitions */ | ||
100 | |||
101 | /* TWL4030_CODEC_MODE (0x01) Fields */ | ||
102 | #define TWL4030_APLL_RATE 0xF0 | ||
103 | #define TWL4030_APLL_RATE_8000 0x00 | ||
104 | #define TWL4030_APLL_RATE_11025 0x10 | ||
105 | #define TWL4030_APLL_RATE_12000 0x20 | ||
106 | #define TWL4030_APLL_RATE_16000 0x40 | ||
107 | #define TWL4030_APLL_RATE_22050 0x50 | ||
108 | #define TWL4030_APLL_RATE_24000 0x60 | ||
109 | #define TWL4030_APLL_RATE_32000 0x80 | ||
110 | #define TWL4030_APLL_RATE_44100 0x90 | ||
111 | #define TWL4030_APLL_RATE_48000 0xA0 | ||
112 | #define TWL4030_APLL_RATE_96000 0xE0 | ||
113 | #define TWL4030_SEL_16K 0x08 | ||
114 | #define TWL4030_CODECPDZ 0x02 | ||
115 | #define TWL4030_OPT_MODE 0x01 | ||
116 | #define TWL4030_OPTION_1 (1 << 0) | ||
117 | #define TWL4030_OPTION_2 (0 << 0) | ||
118 | |||
119 | /* TWL4030_OPTION (0x02) Fields */ | ||
120 | #define TWL4030_ATXL1_EN (1 << 0) | ||
121 | #define TWL4030_ATXR1_EN (1 << 1) | ||
122 | #define TWL4030_ATXL2_VTXL_EN (1 << 2) | ||
123 | #define TWL4030_ATXR2_VTXR_EN (1 << 3) | ||
124 | #define TWL4030_ARXL1_VRX_EN (1 << 4) | ||
125 | #define TWL4030_ARXR1_EN (1 << 5) | ||
126 | #define TWL4030_ARXL2_EN (1 << 6) | ||
127 | #define TWL4030_ARXR2_EN (1 << 7) | ||
128 | |||
129 | /* TWL4030_REG_MICBIAS_CTL (0x04) Fields */ | ||
130 | #define TWL4030_MICBIAS2_CTL 0x40 | ||
131 | #define TWL4030_MICBIAS1_CTL 0x20 | ||
132 | #define TWL4030_HSMICBIAS_EN 0x04 | ||
133 | #define TWL4030_MICBIAS2_EN 0x02 | ||
134 | #define TWL4030_MICBIAS1_EN 0x01 | ||
135 | |||
136 | /* ANAMICL (0x05) Fields */ | ||
137 | #define TWL4030_CNCL_OFFSET_START 0x80 | ||
138 | #define TWL4030_OFFSET_CNCL_SEL 0x60 | ||
139 | #define TWL4030_OFFSET_CNCL_SEL_ARX1 0x00 | ||
140 | #define TWL4030_OFFSET_CNCL_SEL_ARX2 0x20 | ||
141 | #define TWL4030_OFFSET_CNCL_SEL_VRX 0x40 | ||
142 | #define TWL4030_OFFSET_CNCL_SEL_ALL 0x60 | ||
143 | #define TWL4030_MICAMPL_EN 0x10 | ||
144 | #define TWL4030_CKMIC_EN 0x08 | ||
145 | #define TWL4030_AUXL_EN 0x04 | ||
146 | #define TWL4030_HSMIC_EN 0x02 | ||
147 | #define TWL4030_MAINMIC_EN 0x01 | ||
148 | |||
149 | /* ANAMICR (0x06) Fields */ | ||
150 | #define TWL4030_MICAMPR_EN 0x10 | ||
151 | #define TWL4030_AUXR_EN 0x04 | ||
152 | #define TWL4030_SUBMIC_EN 0x01 | ||
153 | |||
154 | /* AVADC_CTL (0x07) Fields */ | ||
155 | #define TWL4030_ADCL_EN 0x08 | ||
156 | #define TWL4030_AVADC_CLK_PRIORITY 0x04 | ||
157 | #define TWL4030_ADCR_EN 0x02 | ||
158 | |||
159 | /* TWL4030_REG_ADCMICSEL (0x08) Fields */ | ||
160 | #define TWL4030_DIGMIC1_EN 0x08 | ||
161 | #define TWL4030_TX2IN_SEL 0x04 | ||
162 | #define TWL4030_DIGMIC0_EN 0x02 | ||
163 | #define TWL4030_TX1IN_SEL 0x01 | ||
164 | |||
165 | /* AUDIO_IF (0x0E) Fields */ | ||
166 | #define TWL4030_AIF_SLAVE_EN 0x80 | ||
167 | #define TWL4030_DATA_WIDTH 0x60 | ||
168 | #define TWL4030_DATA_WIDTH_16S_16W 0x00 | ||
169 | #define TWL4030_DATA_WIDTH_32S_16W 0x40 | ||
170 | #define TWL4030_DATA_WIDTH_32S_24W 0x60 | ||
171 | #define TWL4030_AIF_FORMAT 0x18 | ||
172 | #define TWL4030_AIF_FORMAT_CODEC 0x00 | ||
173 | #define TWL4030_AIF_FORMAT_LEFT 0x08 | ||
174 | #define TWL4030_AIF_FORMAT_RIGHT 0x10 | ||
175 | #define TWL4030_AIF_FORMAT_TDM 0x18 | ||
176 | #define TWL4030_AIF_TRI_EN 0x04 | ||
177 | #define TWL4030_CLK256FS_EN 0x02 | ||
178 | #define TWL4030_AIF_EN 0x01 | ||
179 | |||
180 | /* VOICE_IF (0x0F) Fields */ | ||
181 | #define TWL4030_VIF_SLAVE_EN 0x80 | ||
182 | #define TWL4030_VIF_DIN_EN 0x40 | ||
183 | #define TWL4030_VIF_DOUT_EN 0x20 | ||
184 | #define TWL4030_VIF_SWAP 0x10 | ||
185 | #define TWL4030_VIF_FORMAT 0x08 | ||
186 | #define TWL4030_VIF_TRI_EN 0x04 | ||
187 | #define TWL4030_VIF_SUB_EN 0x02 | ||
188 | #define TWL4030_VIF_EN 0x01 | ||
189 | |||
190 | /* EAR_CTL (0x21) */ | ||
191 | #define TWL4030_EAR_GAIN 0x30 | ||
192 | |||
193 | /* HS_GAIN_SET (0x23) Fields */ | ||
194 | #define TWL4030_HSR_GAIN 0x0C | ||
195 | #define TWL4030_HSR_GAIN_PWR_DOWN 0x00 | ||
196 | #define TWL4030_HSR_GAIN_PLUS_6DB 0x04 | ||
197 | #define TWL4030_HSR_GAIN_0DB 0x08 | ||
198 | #define TWL4030_HSR_GAIN_MINUS_6DB 0x0C | ||
199 | #define TWL4030_HSL_GAIN 0x03 | ||
200 | #define TWL4030_HSL_GAIN_PWR_DOWN 0x00 | ||
201 | #define TWL4030_HSL_GAIN_PLUS_6DB 0x01 | ||
202 | #define TWL4030_HSL_GAIN_0DB 0x02 | ||
203 | #define TWL4030_HSL_GAIN_MINUS_6DB 0x03 | ||
204 | |||
205 | /* HS_POPN_SET (0x24) Fields */ | ||
206 | #define TWL4030_VMID_EN 0x40 | ||
207 | #define TWL4030_EXTMUTE 0x20 | ||
208 | #define TWL4030_RAMP_DELAY 0x1C | ||
209 | #define TWL4030_RAMP_DELAY_20MS 0x00 | ||
210 | #define TWL4030_RAMP_DELAY_40MS 0x04 | ||
211 | #define TWL4030_RAMP_DELAY_81MS 0x08 | ||
212 | #define TWL4030_RAMP_DELAY_161MS 0x0C | ||
213 | #define TWL4030_RAMP_DELAY_323MS 0x10 | ||
214 | #define TWL4030_RAMP_DELAY_645MS 0x14 | ||
215 | #define TWL4030_RAMP_DELAY_1291MS 0x18 | ||
216 | #define TWL4030_RAMP_DELAY_2581MS 0x1C | ||
217 | #define TWL4030_RAMP_EN 0x02 | ||
218 | |||
219 | /* PREDL_CTL (0x25) */ | ||
220 | #define TWL4030_PREDL_GAIN 0x30 | ||
221 | |||
222 | /* PREDR_CTL (0x26) */ | ||
223 | #define TWL4030_PREDR_GAIN 0x30 | ||
224 | |||
225 | /* PRECKL_CTL (0x27) */ | ||
226 | #define TWL4030_PRECKL_GAIN 0x30 | ||
227 | |||
228 | /* PRECKR_CTL (0x28) */ | ||
229 | #define TWL4030_PRECKR_GAIN 0x30 | ||
230 | |||
231 | /* HFL_CTL (0x29, 0x2A) Fields */ | ||
232 | #define TWL4030_HF_CTL_HB_EN 0x04 | ||
233 | #define TWL4030_HF_CTL_LOOP_EN 0x08 | ||
234 | #define TWL4030_HF_CTL_RAMP_EN 0x10 | ||
235 | #define TWL4030_HF_CTL_REF_EN 0x20 | ||
236 | |||
237 | /* APLL_CTL (0x3A) Fields */ | ||
238 | #define TWL4030_APLL_EN 0x10 | ||
239 | #define TWL4030_APLL_INFREQ 0x0F | ||
240 | #define TWL4030_APLL_INFREQ_19200KHZ 0x05 | ||
241 | #define TWL4030_APLL_INFREQ_26000KHZ 0x06 | ||
242 | #define TWL4030_APLL_INFREQ_38400KHZ 0x0F | ||
243 | |||
244 | /* REG_MISC_SET_1 (0x3E) Fields */ | ||
245 | #define TWL4030_CLK64_EN 0x80 | ||
246 | #define TWL4030_SCRAMBLE_EN 0x40 | ||
247 | #define TWL4030_FMLOOP_EN 0x20 | ||
248 | #define TWL4030_SMOOTH_ANAVOL_EN 0x02 | ||
249 | #define TWL4030_DIGMIC_LR_SWAP_EN 0x01 | ||
250 | |||
251 | /* VIBRA_CTL (0x45) */ | ||
252 | #define TWL4030_VIBRA_EN 0x01 | ||
253 | #define TWL4030_VIBRA_DIR 0x02 | ||
254 | #define TWL4030_VIBRA_AUDIO_SEL_L1 (0x00 << 2) | ||
255 | #define TWL4030_VIBRA_AUDIO_SEL_R1 (0x01 << 2) | ||
256 | #define TWL4030_VIBRA_AUDIO_SEL_L2 (0x02 << 2) | ||
257 | #define TWL4030_VIBRA_AUDIO_SEL_R2 (0x03 << 2) | ||
258 | #define TWL4030_VIBRA_SEL 0x10 | ||
259 | #define TWL4030_VIBRA_DIR_SEL 0x20 | ||
260 | |||
261 | /* TWL4030 codec resource IDs */ | ||
262 | enum twl4030_codec_res { | ||
263 | TWL4030_CODEC_RES_POWER = 0, | ||
264 | TWL4030_CODEC_RES_APLL, | ||
265 | TWL4030_CODEC_RES_MAX, | ||
266 | }; | ||
267 | |||
268 | int twl4030_codec_disable_resource(enum twl4030_codec_res id); | ||
269 | int twl4030_codec_enable_resource(enum twl4030_codec_res id); | ||
270 | unsigned int twl4030_codec_get_mclk(void); | ||
271 | |||
272 | #endif /* End of __TWL4030_CODEC_H__ */ | ||
diff --git a/include/linux/mfd/ucb1x00.h b/include/linux/mfd/ucb1x00.h new file mode 100644 index 000000000000..aa9c3789bed4 --- /dev/null +++ b/include/linux/mfd/ucb1x00.h | |||
@@ -0,0 +1,258 @@ | |||
1 | /* | ||
2 | * linux/include/mfd/ucb1x00.h | ||
3 | * | ||
4 | * Copyright (C) 2001 Russell King, All Rights Reserved. | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License as published by | ||
8 | * the Free Software Foundation; either version 2 of the License. | ||
9 | */ | ||
10 | #ifndef UCB1200_H | ||
11 | #define UCB1200_H | ||
12 | |||
13 | #include <linux/mfd/mcp.h> | ||
14 | #include <linux/gpio.h> | ||
15 | |||
16 | #define UCB_IO_DATA 0x00 | ||
17 | #define UCB_IO_DIR 0x01 | ||
18 | |||
19 | #define UCB_IO_0 (1 << 0) | ||
20 | #define UCB_IO_1 (1 << 1) | ||
21 | #define UCB_IO_2 (1 << 2) | ||
22 | #define UCB_IO_3 (1 << 3) | ||
23 | #define UCB_IO_4 (1 << 4) | ||
24 | #define UCB_IO_5 (1 << 5) | ||
25 | #define UCB_IO_6 (1 << 6) | ||
26 | #define UCB_IO_7 (1 << 7) | ||
27 | #define UCB_IO_8 (1 << 8) | ||
28 | #define UCB_IO_9 (1 << 9) | ||
29 | |||
30 | #define UCB_IE_RIS 0x02 | ||
31 | #define UCB_IE_FAL 0x03 | ||
32 | #define UCB_IE_STATUS 0x04 | ||
33 | #define UCB_IE_CLEAR 0x04 | ||
34 | #define UCB_IE_ADC (1 << 11) | ||
35 | #define UCB_IE_TSPX (1 << 12) | ||
36 | #define UCB_IE_TSMX (1 << 13) | ||
37 | #define UCB_IE_TCLIP (1 << 14) | ||
38 | #define UCB_IE_ACLIP (1 << 15) | ||
39 | |||
40 | #define UCB_IRQ_TSPX 12 | ||
41 | |||
42 | #define UCB_TC_A 0x05 | ||
43 | #define UCB_TC_A_LOOP (1 << 7) /* UCB1200 */ | ||
44 | #define UCB_TC_A_AMPL (1 << 7) /* UCB1300 */ | ||
45 | |||
46 | #define UCB_TC_B 0x06 | ||
47 | #define UCB_TC_B_VOICE_ENA (1 << 3) | ||
48 | #define UCB_TC_B_CLIP (1 << 4) | ||
49 | #define UCB_TC_B_ATT (1 << 6) | ||
50 | #define UCB_TC_B_SIDE_ENA (1 << 11) | ||
51 | #define UCB_TC_B_MUTE (1 << 13) | ||
52 | #define UCB_TC_B_IN_ENA (1 << 14) | ||
53 | #define UCB_TC_B_OUT_ENA (1 << 15) | ||
54 | |||
55 | #define UCB_AC_A 0x07 | ||
56 | #define UCB_AC_B 0x08 | ||
57 | #define UCB_AC_B_LOOP (1 << 8) | ||
58 | #define UCB_AC_B_MUTE (1 << 13) | ||
59 | #define UCB_AC_B_IN_ENA (1 << 14) | ||
60 | #define UCB_AC_B_OUT_ENA (1 << 15) | ||
61 | |||
62 | #define UCB_TS_CR 0x09 | ||
63 | #define UCB_TS_CR_TSMX_POW (1 << 0) | ||
64 | #define UCB_TS_CR_TSPX_POW (1 << 1) | ||
65 | #define UCB_TS_CR_TSMY_POW (1 << 2) | ||
66 | #define UCB_TS_CR_TSPY_POW (1 << 3) | ||
67 | #define UCB_TS_CR_TSMX_GND (1 << 4) | ||
68 | #define UCB_TS_CR_TSPX_GND (1 << 5) | ||
69 | #define UCB_TS_CR_TSMY_GND (1 << 6) | ||
70 | #define UCB_TS_CR_TSPY_GND (1 << 7) | ||
71 | #define UCB_TS_CR_MODE_INT (0 << 8) | ||
72 | #define UCB_TS_CR_MODE_PRES (1 << 8) | ||
73 | #define UCB_TS_CR_MODE_POS (2 << 8) | ||
74 | #define UCB_TS_CR_BIAS_ENA (1 << 11) | ||
75 | #define UCB_TS_CR_TSPX_LOW (1 << 12) | ||
76 | #define UCB_TS_CR_TSMX_LOW (1 << 13) | ||
77 | |||
78 | #define UCB_ADC_CR 0x0a | ||
79 | #define UCB_ADC_SYNC_ENA (1 << 0) | ||
80 | #define UCB_ADC_VREFBYP_CON (1 << 1) | ||
81 | #define UCB_ADC_INP_TSPX (0 << 2) | ||
82 | #define UCB_ADC_INP_TSMX (1 << 2) | ||
83 | #define UCB_ADC_INP_TSPY (2 << 2) | ||
84 | #define UCB_ADC_INP_TSMY (3 << 2) | ||
85 | #define UCB_ADC_INP_AD0 (4 << 2) | ||
86 | #define UCB_ADC_INP_AD1 (5 << 2) | ||
87 | #define UCB_ADC_INP_AD2 (6 << 2) | ||
88 | #define UCB_ADC_INP_AD3 (7 << 2) | ||
89 | #define UCB_ADC_EXT_REF (1 << 5) | ||
90 | #define UCB_ADC_START (1 << 7) | ||
91 | #define UCB_ADC_ENA (1 << 15) | ||
92 | |||
93 | #define UCB_ADC_DATA 0x0b | ||
94 | #define UCB_ADC_DAT_VAL (1 << 15) | ||
95 | #define UCB_ADC_DAT(x) (((x) & 0x7fe0) >> 5) | ||
96 | |||
97 | #define UCB_ID 0x0c | ||
98 | #define UCB_ID_1200 0x1004 | ||
99 | #define UCB_ID_1300 0x1005 | ||
100 | #define UCB_ID_TC35143 0x9712 | ||
101 | |||
102 | #define UCB_MODE 0x0d | ||
103 | #define UCB_MODE_DYN_VFLAG_ENA (1 << 12) | ||
104 | #define UCB_MODE_AUD_OFF_CAN (1 << 13) | ||
105 | |||
106 | |||
107 | struct ucb1x00_irq { | ||
108 | void *devid; | ||
109 | void (*fn)(int, void *); | ||
110 | }; | ||
111 | |||
112 | struct ucb1x00 { | ||
113 | spinlock_t lock; | ||
114 | struct mcp *mcp; | ||
115 | unsigned int irq; | ||
116 | struct semaphore adc_sem; | ||
117 | spinlock_t io_lock; | ||
118 | u16 id; | ||
119 | u16 io_dir; | ||
120 | u16 io_out; | ||
121 | u16 adc_cr; | ||
122 | u16 irq_fal_enbl; | ||
123 | u16 irq_ris_enbl; | ||
124 | struct ucb1x00_irq irq_handler[16]; | ||
125 | struct device dev; | ||
126 | struct list_head node; | ||
127 | struct list_head devs; | ||
128 | struct gpio_chip gpio; | ||
129 | }; | ||
130 | |||
131 | struct ucb1x00_driver; | ||
132 | |||
133 | struct ucb1x00_dev { | ||
134 | struct list_head dev_node; | ||
135 | struct list_head drv_node; | ||
136 | struct ucb1x00 *ucb; | ||
137 | struct ucb1x00_driver *drv; | ||
138 | void *priv; | ||
139 | }; | ||
140 | |||
141 | struct ucb1x00_driver { | ||
142 | struct list_head node; | ||
143 | struct list_head devs; | ||
144 | int (*add)(struct ucb1x00_dev *dev); | ||
145 | void (*remove)(struct ucb1x00_dev *dev); | ||
146 | int (*suspend)(struct ucb1x00_dev *dev, pm_message_t state); | ||
147 | int (*resume)(struct ucb1x00_dev *dev); | ||
148 | }; | ||
149 | |||
150 | #define classdev_to_ucb1x00(cd) container_of(cd, struct ucb1x00, dev) | ||
151 | |||
152 | int ucb1x00_register_driver(struct ucb1x00_driver *); | ||
153 | void ucb1x00_unregister_driver(struct ucb1x00_driver *); | ||
154 | |||
155 | /** | ||
156 | * ucb1x00_clkrate - return the UCB1x00 SIB clock rate | ||
157 | * @ucb: UCB1x00 structure describing chip | ||
158 | * | ||
159 | * Return the SIB clock rate in Hz. | ||
160 | */ | ||
161 | static inline unsigned int ucb1x00_clkrate(struct ucb1x00 *ucb) | ||
162 | { | ||
163 | return mcp_get_sclk_rate(ucb->mcp); | ||
164 | } | ||
165 | |||
166 | /** | ||
167 | * ucb1x00_enable - enable the UCB1x00 SIB clock | ||
168 | * @ucb: UCB1x00 structure describing chip | ||
169 | * | ||
170 | * Enable the SIB clock. This can be called multiple times. | ||
171 | */ | ||
172 | static inline void ucb1x00_enable(struct ucb1x00 *ucb) | ||
173 | { | ||
174 | mcp_enable(ucb->mcp); | ||
175 | } | ||
176 | |||
177 | /** | ||
178 | * ucb1x00_disable - disable the UCB1x00 SIB clock | ||
179 | * @ucb: UCB1x00 structure describing chip | ||
180 | * | ||
181 | * Disable the SIB clock. The SIB clock will only be disabled | ||
182 | * when the number of ucb1x00_enable calls match the number of | ||
183 | * ucb1x00_disable calls. | ||
184 | */ | ||
185 | static inline void ucb1x00_disable(struct ucb1x00 *ucb) | ||
186 | { | ||
187 | mcp_disable(ucb->mcp); | ||
188 | } | ||
189 | |||
190 | /** | ||
191 | * ucb1x00_reg_write - write a UCB1x00 register | ||
192 | * @ucb: UCB1x00 structure describing chip | ||
193 | * @reg: UCB1x00 4-bit register index to write | ||
194 | * @val: UCB1x00 16-bit value to write | ||
195 | * | ||
196 | * Write the UCB1x00 register @reg with value @val. The SIB | ||
197 | * clock must be running for this function to return. | ||
198 | */ | ||
199 | static inline void ucb1x00_reg_write(struct ucb1x00 *ucb, unsigned int reg, unsigned int val) | ||
200 | { | ||
201 | mcp_reg_write(ucb->mcp, reg, val); | ||
202 | } | ||
203 | |||
204 | /** | ||
205 | * ucb1x00_reg_read - read a UCB1x00 register | ||
206 | * @ucb: UCB1x00 structure describing chip | ||
207 | * @reg: UCB1x00 4-bit register index to write | ||
208 | * | ||
209 | * Read the UCB1x00 register @reg and return its value. The SIB | ||
210 | * clock must be running for this function to return. | ||
211 | */ | ||
212 | static inline unsigned int ucb1x00_reg_read(struct ucb1x00 *ucb, unsigned int reg) | ||
213 | { | ||
214 | return mcp_reg_read(ucb->mcp, reg); | ||
215 | } | ||
216 | /** | ||
217 | * ucb1x00_set_audio_divisor - | ||
218 | * @ucb: UCB1x00 structure describing chip | ||
219 | * @div: SIB clock divisor | ||
220 | */ | ||
221 | static inline void ucb1x00_set_audio_divisor(struct ucb1x00 *ucb, unsigned int div) | ||
222 | { | ||
223 | mcp_set_audio_divisor(ucb->mcp, div); | ||
224 | } | ||
225 | |||
226 | /** | ||
227 | * ucb1x00_set_telecom_divisor - | ||
228 | * @ucb: UCB1x00 structure describing chip | ||
229 | * @div: SIB clock divisor | ||
230 | */ | ||
231 | static inline void ucb1x00_set_telecom_divisor(struct ucb1x00 *ucb, unsigned int div) | ||
232 | { | ||
233 | mcp_set_telecom_divisor(ucb->mcp, div); | ||
234 | } | ||
235 | |||
236 | void ucb1x00_io_set_dir(struct ucb1x00 *ucb, unsigned int, unsigned int); | ||
237 | void ucb1x00_io_write(struct ucb1x00 *ucb, unsigned int, unsigned int); | ||
238 | unsigned int ucb1x00_io_read(struct ucb1x00 *ucb); | ||
239 | |||
240 | #define UCB_NOSYNC (0) | ||
241 | #define UCB_SYNC (1) | ||
242 | |||
243 | unsigned int ucb1x00_adc_read(struct ucb1x00 *ucb, int adc_channel, int sync); | ||
244 | void ucb1x00_adc_enable(struct ucb1x00 *ucb); | ||
245 | void ucb1x00_adc_disable(struct ucb1x00 *ucb); | ||
246 | |||
247 | /* | ||
248 | * Which edges of the IRQ do you want to control today? | ||
249 | */ | ||
250 | #define UCB_RISING (1 << 0) | ||
251 | #define UCB_FALLING (1 << 1) | ||
252 | |||
253 | int ucb1x00_hook_irq(struct ucb1x00 *ucb, unsigned int idx, void (*fn)(int, void *), void *devid); | ||
254 | void ucb1x00_enable_irq(struct ucb1x00 *ucb, unsigned int idx, int edges); | ||
255 | void ucb1x00_disable_irq(struct ucb1x00 *ucb, unsigned int idx, int edges); | ||
256 | int ucb1x00_free_irq(struct ucb1x00 *ucb, unsigned int idx, void *devid); | ||
257 | |||
258 | #endif | ||
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h index 2dbfb5a05994..33b2ea09a4ad 100644 --- a/include/linux/mmc/sdio_ids.h +++ b/include/linux/mmc/sdio_ids.h | |||
@@ -28,6 +28,7 @@ | |||
28 | #define SDIO_DEVICE_ID_INTEL_IWMC3200TOP 0x1404 | 28 | #define SDIO_DEVICE_ID_INTEL_IWMC3200TOP 0x1404 |
29 | #define SDIO_DEVICE_ID_INTEL_IWMC3200GPS 0x1405 | 29 | #define SDIO_DEVICE_ID_INTEL_IWMC3200GPS 0x1405 |
30 | #define SDIO_DEVICE_ID_INTEL_IWMC3200BT 0x1406 | 30 | #define SDIO_DEVICE_ID_INTEL_IWMC3200BT 0x1406 |
31 | #define SDIO_DEVICE_ID_INTEL_IWMC3200WIMAX_2G5 0x1407 | ||
31 | 32 | ||
32 | #define SDIO_VENDOR_ID_MARVELL 0x02df | 33 | #define SDIO_VENDOR_ID_MARVELL 0x02df |
33 | #define SDIO_DEVICE_ID_MARVELL_LIBERTAS 0x9103 | 34 | #define SDIO_DEVICE_ID_MARVELL_LIBERTAS 0x9103 |
diff --git a/include/linux/mroute.h b/include/linux/mroute.h index 08bc776d05e2..c5f3d53548e2 100644 --- a/include/linux/mroute.h +++ b/include/linux/mroute.h | |||
@@ -59,20 +59,24 @@ struct vifctl { | |||
59 | unsigned char vifc_flags; /* VIFF_ flags */ | 59 | unsigned char vifc_flags; /* VIFF_ flags */ |
60 | unsigned char vifc_threshold; /* ttl limit */ | 60 | unsigned char vifc_threshold; /* ttl limit */ |
61 | unsigned int vifc_rate_limit; /* Rate limiter values (NI) */ | 61 | unsigned int vifc_rate_limit; /* Rate limiter values (NI) */ |
62 | struct in_addr vifc_lcl_addr; /* Our address */ | 62 | union { |
63 | struct in_addr vifc_lcl_addr; /* Local interface address */ | ||
64 | int vifc_lcl_ifindex; /* Local interface index */ | ||
65 | }; | ||
63 | struct in_addr vifc_rmt_addr; /* IPIP tunnel addr */ | 66 | struct in_addr vifc_rmt_addr; /* IPIP tunnel addr */ |
64 | }; | 67 | }; |
65 | 68 | ||
66 | #define VIFF_TUNNEL 0x1 /* IPIP tunnel */ | 69 | #define VIFF_TUNNEL 0x1 /* IPIP tunnel */ |
67 | #define VIFF_SRCRT 0x2 /* NI */ | 70 | #define VIFF_SRCRT 0x2 /* NI */ |
68 | #define VIFF_REGISTER 0x4 /* register vif */ | 71 | #define VIFF_REGISTER 0x4 /* register vif */ |
72 | #define VIFF_USE_IFINDEX 0x8 /* use vifc_lcl_ifindex instead of | ||
73 | vifc_lcl_addr to find an interface */ | ||
69 | 74 | ||
70 | /* | 75 | /* |
71 | * Cache manipulation structures for mrouted and PIMd | 76 | * Cache manipulation structures for mrouted and PIMd |
72 | */ | 77 | */ |
73 | 78 | ||
74 | struct mfcctl | 79 | struct mfcctl { |
75 | { | ||
76 | struct in_addr mfcc_origin; /* Origin of mcast */ | 80 | struct in_addr mfcc_origin; /* Origin of mcast */ |
77 | struct in_addr mfcc_mcastgrp; /* Group in question */ | 81 | struct in_addr mfcc_mcastgrp; /* Group in question */ |
78 | vifi_t mfcc_parent; /* Where it arrived */ | 82 | vifi_t mfcc_parent; /* Where it arrived */ |
@@ -87,8 +91,7 @@ struct mfcctl | |||
87 | * Group count retrieval for mrouted | 91 | * Group count retrieval for mrouted |
88 | */ | 92 | */ |
89 | 93 | ||
90 | struct sioc_sg_req | 94 | struct sioc_sg_req { |
91 | { | ||
92 | struct in_addr src; | 95 | struct in_addr src; |
93 | struct in_addr grp; | 96 | struct in_addr grp; |
94 | unsigned long pktcnt; | 97 | unsigned long pktcnt; |
@@ -100,8 +103,7 @@ struct sioc_sg_req | |||
100 | * To get vif packet counts | 103 | * To get vif packet counts |
101 | */ | 104 | */ |
102 | 105 | ||
103 | struct sioc_vif_req | 106 | struct sioc_vif_req { |
104 | { | ||
105 | vifi_t vifi; /* Which iface */ | 107 | vifi_t vifi; /* Which iface */ |
106 | unsigned long icount; /* In packets */ | 108 | unsigned long icount; /* In packets */ |
107 | unsigned long ocount; /* Out packets */ | 109 | unsigned long ocount; /* Out packets */ |
@@ -114,8 +116,7 @@ struct sioc_vif_req | |||
114 | * data. Magically happens to be like an IP packet as per the original | 116 | * data. Magically happens to be like an IP packet as per the original |
115 | */ | 117 | */ |
116 | 118 | ||
117 | struct igmpmsg | 119 | struct igmpmsg { |
118 | { | ||
119 | __u32 unused1,unused2; | 120 | __u32 unused1,unused2; |
120 | unsigned char im_msgtype; /* What is this */ | 121 | unsigned char im_msgtype; /* What is this */ |
121 | unsigned char im_mbz; /* Must be zero */ | 122 | unsigned char im_mbz; /* Must be zero */ |
@@ -176,8 +177,7 @@ static inline int ip_mr_init(void) | |||
176 | } | 177 | } |
177 | #endif | 178 | #endif |
178 | 179 | ||
179 | struct vif_device | 180 | struct vif_device { |
180 | { | ||
181 | struct net_device *dev; /* Device we are using */ | 181 | struct net_device *dev; /* Device we are using */ |
182 | unsigned long bytes_in,bytes_out; | 182 | unsigned long bytes_in,bytes_out; |
183 | unsigned long pkt_in,pkt_out; /* Statistics */ | 183 | unsigned long pkt_in,pkt_out; /* Statistics */ |
@@ -190,8 +190,7 @@ struct vif_device | |||
190 | 190 | ||
191 | #define VIFF_STATIC 0x8000 | 191 | #define VIFF_STATIC 0x8000 |
192 | 192 | ||
193 | struct mfc_cache | 193 | struct mfc_cache { |
194 | { | ||
195 | struct mfc_cache *next; /* Next entry on cache line */ | 194 | struct mfc_cache *next; /* Next entry on cache line */ |
196 | #ifdef CONFIG_NET_NS | 195 | #ifdef CONFIG_NET_NS |
197 | struct net *mfc_net; | 196 | struct net *mfc_net; |
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h index b191865a6ca3..2caa1a8e525d 100644 --- a/include/linux/mroute6.h +++ b/include/linux/mroute6.h | |||
@@ -75,8 +75,7 @@ struct mif6ctl { | |||
75 | * Cache manipulation structures for mrouted and PIMd | 75 | * Cache manipulation structures for mrouted and PIMd |
76 | */ | 76 | */ |
77 | 77 | ||
78 | struct mf6cctl | 78 | struct mf6cctl { |
79 | { | ||
80 | struct sockaddr_in6 mf6cc_origin; /* Origin of mcast */ | 79 | struct sockaddr_in6 mf6cc_origin; /* Origin of mcast */ |
81 | struct sockaddr_in6 mf6cc_mcastgrp; /* Group in question */ | 80 | struct sockaddr_in6 mf6cc_mcastgrp; /* Group in question */ |
82 | mifi_t mf6cc_parent; /* Where it arrived */ | 81 | mifi_t mf6cc_parent; /* Where it arrived */ |
@@ -87,8 +86,7 @@ struct mf6cctl | |||
87 | * Group count retrieval for pim6sd | 86 | * Group count retrieval for pim6sd |
88 | */ | 87 | */ |
89 | 88 | ||
90 | struct sioc_sg_req6 | 89 | struct sioc_sg_req6 { |
91 | { | ||
92 | struct sockaddr_in6 src; | 90 | struct sockaddr_in6 src; |
93 | struct sockaddr_in6 grp; | 91 | struct sockaddr_in6 grp; |
94 | unsigned long pktcnt; | 92 | unsigned long pktcnt; |
@@ -100,8 +98,7 @@ struct sioc_sg_req6 | |||
100 | * To get vif packet counts | 98 | * To get vif packet counts |
101 | */ | 99 | */ |
102 | 100 | ||
103 | struct sioc_mif_req6 | 101 | struct sioc_mif_req6 { |
104 | { | ||
105 | mifi_t mifi; /* Which iface */ | 102 | mifi_t mifi; /* Which iface */ |
106 | unsigned long icount; /* In packets */ | 103 | unsigned long icount; /* In packets */ |
107 | unsigned long ocount; /* Out packets */ | 104 | unsigned long ocount; /* Out packets */ |
@@ -172,8 +169,7 @@ static inline void ip6_mr_cleanup(void) | |||
172 | } | 169 | } |
173 | #endif | 170 | #endif |
174 | 171 | ||
175 | struct mif_device | 172 | struct mif_device { |
176 | { | ||
177 | struct net_device *dev; /* Device we are using */ | 173 | struct net_device *dev; /* Device we are using */ |
178 | unsigned long bytes_in,bytes_out; | 174 | unsigned long bytes_in,bytes_out; |
179 | unsigned long pkt_in,pkt_out; /* Statistics */ | 175 | unsigned long pkt_in,pkt_out; /* Statistics */ |
@@ -185,8 +181,7 @@ struct mif_device | |||
185 | 181 | ||
186 | #define VIFF_STATIC 0x8000 | 182 | #define VIFF_STATIC 0x8000 |
187 | 183 | ||
188 | struct mfc6_cache | 184 | struct mfc6_cache { |
189 | { | ||
190 | struct mfc6_cache *next; /* Next entry on cache line */ | 185 | struct mfc6_cache *next; /* Next entry on cache line */ |
191 | #ifdef CONFIG_NET_NS | 186 | #ifdef CONFIG_NET_NS |
192 | struct net *mfc6_net; | 187 | struct net *mfc6_net; |
diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h index 6913b71d9ab2..b31bd9e9bca3 100644 --- a/include/linux/mtd/ubi.h +++ b/include/linux/mtd/ubi.h | |||
@@ -174,6 +174,8 @@ void ubi_get_volume_info(struct ubi_volume_desc *desc, | |||
174 | struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode); | 174 | struct ubi_volume_desc *ubi_open_volume(int ubi_num, int vol_id, int mode); |
175 | struct ubi_volume_desc *ubi_open_volume_nm(int ubi_num, const char *name, | 175 | struct ubi_volume_desc *ubi_open_volume_nm(int ubi_num, const char *name, |
176 | int mode); | 176 | int mode); |
177 | struct ubi_volume_desc *ubi_open_volume_path(const char *pathname, int mode); | ||
178 | |||
177 | int ubi_register_volume_notifier(struct notifier_block *nb, | 179 | int ubi_register_volume_notifier(struct notifier_block *nb, |
178 | int ignore_existing); | 180 | int ignore_existing); |
179 | int ubi_unregister_volume_notifier(struct notifier_block *nb); | 181 | int ubi_unregister_volume_notifier(struct notifier_block *nb); |
diff --git a/include/linux/namei.h b/include/linux/namei.h index ec0f607b364a..028946750289 100644 --- a/include/linux/namei.h +++ b/include/linux/namei.h | |||
@@ -76,7 +76,6 @@ extern struct file *nameidata_to_filp(struct nameidata *nd, int flags); | |||
76 | extern void release_open_intent(struct nameidata *); | 76 | extern void release_open_intent(struct nameidata *); |
77 | 77 | ||
78 | extern struct dentry *lookup_one_len(const char *, struct dentry *, int); | 78 | extern struct dentry *lookup_one_len(const char *, struct dentry *, int); |
79 | extern struct dentry *lookup_one_noperm(const char *, struct dentry *); | ||
80 | 79 | ||
81 | extern int follow_down(struct path *); | 80 | extern int follow_down(struct path *); |
82 | extern int follow_up(struct path *); | 81 | extern int follow_up(struct path *); |
diff --git a/include/linux/neighbour.h b/include/linux/neighbour.h index 12c9de138451..a7003b7a695d 100644 --- a/include/linux/neighbour.h +++ b/include/linux/neighbour.h | |||
@@ -4,8 +4,7 @@ | |||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/netlink.h> | 5 | #include <linux/netlink.h> |
6 | 6 | ||
7 | struct ndmsg | 7 | struct ndmsg { |
8 | { | ||
9 | __u8 ndm_family; | 8 | __u8 ndm_family; |
10 | __u8 ndm_pad1; | 9 | __u8 ndm_pad1; |
11 | __u16 ndm_pad2; | 10 | __u16 ndm_pad2; |
@@ -15,8 +14,7 @@ struct ndmsg | |||
15 | __u8 ndm_type; | 14 | __u8 ndm_type; |
16 | }; | 15 | }; |
17 | 16 | ||
18 | enum | 17 | enum { |
19 | { | ||
20 | NDA_UNSPEC, | 18 | NDA_UNSPEC, |
21 | NDA_DST, | 19 | NDA_DST, |
22 | NDA_LLADDR, | 20 | NDA_LLADDR, |
@@ -56,8 +54,7 @@ enum | |||
56 | NUD_PERMANENT is also cannot be deleted by garbage collectors. | 54 | NUD_PERMANENT is also cannot be deleted by garbage collectors. |
57 | */ | 55 | */ |
58 | 56 | ||
59 | struct nda_cacheinfo | 57 | struct nda_cacheinfo { |
60 | { | ||
61 | __u32 ndm_confirmed; | 58 | __u32 ndm_confirmed; |
62 | __u32 ndm_used; | 59 | __u32 ndm_used; |
63 | __u32 ndm_updated; | 60 | __u32 ndm_updated; |
@@ -89,8 +86,7 @@ struct nda_cacheinfo | |||
89 | * device. | 86 | * device. |
90 | ****/ | 87 | ****/ |
91 | 88 | ||
92 | struct ndt_stats | 89 | struct ndt_stats { |
93 | { | ||
94 | __u64 ndts_allocs; | 90 | __u64 ndts_allocs; |
95 | __u64 ndts_destroys; | 91 | __u64 ndts_destroys; |
96 | __u64 ndts_hash_grows; | 92 | __u64 ndts_hash_grows; |
@@ -124,15 +120,13 @@ enum { | |||
124 | }; | 120 | }; |
125 | #define NDTPA_MAX (__NDTPA_MAX - 1) | 121 | #define NDTPA_MAX (__NDTPA_MAX - 1) |
126 | 122 | ||
127 | struct ndtmsg | 123 | struct ndtmsg { |
128 | { | ||
129 | __u8 ndtm_family; | 124 | __u8 ndtm_family; |
130 | __u8 ndtm_pad1; | 125 | __u8 ndtm_pad1; |
131 | __u16 ndtm_pad2; | 126 | __u16 ndtm_pad2; |
132 | }; | 127 | }; |
133 | 128 | ||
134 | struct ndt_config | 129 | struct ndt_config { |
135 | { | ||
136 | __u16 ndtc_key_len; | 130 | __u16 ndtc_key_len; |
137 | __u16 ndtc_entry_size; | 131 | __u16 ndtc_entry_size; |
138 | __u32 ndtc_entries; | 132 | __u32 ndtc_entries; |
diff --git a/include/linux/net.h b/include/linux/net.h index 529a0931711d..5e8083cacc8b 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -41,6 +41,7 @@ | |||
41 | #define SYS_SENDMSG 16 /* sys_sendmsg(2) */ | 41 | #define SYS_SENDMSG 16 /* sys_sendmsg(2) */ |
42 | #define SYS_RECVMSG 17 /* sys_recvmsg(2) */ | 42 | #define SYS_RECVMSG 17 /* sys_recvmsg(2) */ |
43 | #define SYS_ACCEPT4 18 /* sys_accept4(2) */ | 43 | #define SYS_ACCEPT4 18 /* sys_accept4(2) */ |
44 | #define SYS_RECVMMSG 19 /* sys_recvmmsg(2) */ | ||
44 | 45 | ||
45 | typedef enum { | 46 | typedef enum { |
46 | SS_FREE = 0, /* not allocated */ | 47 | SS_FREE = 0, /* not allocated */ |
@@ -198,9 +199,13 @@ struct proto_ops { | |||
198 | struct pipe_inode_info *pipe, size_t len, unsigned int flags); | 199 | struct pipe_inode_info *pipe, size_t len, unsigned int flags); |
199 | }; | 200 | }; |
200 | 201 | ||
202 | #define DECLARE_SOCKADDR(type, dst, src) \ | ||
203 | type dst = ({ __sockaddr_check_size(sizeof(*dst)); (type) src; }) | ||
204 | |||
201 | struct net_proto_family { | 205 | struct net_proto_family { |
202 | int family; | 206 | int family; |
203 | int (*create)(struct net *net, struct socket *sock, int protocol); | 207 | int (*create)(struct net *net, struct socket *sock, |
208 | int protocol, int kern); | ||
204 | struct module *owner; | 209 | struct module *owner; |
205 | }; | 210 | }; |
206 | 211 | ||
@@ -263,89 +268,6 @@ extern int kernel_sock_ioctl(struct socket *sock, int cmd, unsigned long arg); | |||
263 | extern int kernel_sock_shutdown(struct socket *sock, | 268 | extern int kernel_sock_shutdown(struct socket *sock, |
264 | enum sock_shutdown_cmd how); | 269 | enum sock_shutdown_cmd how); |
265 | 270 | ||
266 | #ifndef CONFIG_SMP | ||
267 | #define SOCKOPS_WRAPPED(name) name | ||
268 | #define SOCKOPS_WRAP(name, fam) | ||
269 | #else | ||
270 | |||
271 | #define SOCKOPS_WRAPPED(name) __unlocked_##name | ||
272 | |||
273 | #define SOCKCALL_WRAP(name, call, parms, args) \ | ||
274 | static int __lock_##name##_##call parms \ | ||
275 | { \ | ||
276 | int ret; \ | ||
277 | lock_kernel(); \ | ||
278 | ret = __unlocked_##name##_ops.call args ;\ | ||
279 | unlock_kernel(); \ | ||
280 | return ret; \ | ||
281 | } | ||
282 | |||
283 | #define SOCKCALL_UWRAP(name, call, parms, args) \ | ||
284 | static unsigned int __lock_##name##_##call parms \ | ||
285 | { \ | ||
286 | int ret; \ | ||
287 | lock_kernel(); \ | ||
288 | ret = __unlocked_##name##_ops.call args ;\ | ||
289 | unlock_kernel(); \ | ||
290 | return ret; \ | ||
291 | } | ||
292 | |||
293 | |||
294 | #define SOCKOPS_WRAP(name, fam) \ | ||
295 | SOCKCALL_WRAP(name, release, (struct socket *sock), (sock)) \ | ||
296 | SOCKCALL_WRAP(name, bind, (struct socket *sock, struct sockaddr *uaddr, int addr_len), \ | ||
297 | (sock, uaddr, addr_len)) \ | ||
298 | SOCKCALL_WRAP(name, connect, (struct socket *sock, struct sockaddr * uaddr, \ | ||
299 | int addr_len, int flags), \ | ||
300 | (sock, uaddr, addr_len, flags)) \ | ||
301 | SOCKCALL_WRAP(name, socketpair, (struct socket *sock1, struct socket *sock2), \ | ||
302 | (sock1, sock2)) \ | ||
303 | SOCKCALL_WRAP(name, accept, (struct socket *sock, struct socket *newsock, \ | ||
304 | int flags), (sock, newsock, flags)) \ | ||
305 | SOCKCALL_WRAP(name, getname, (struct socket *sock, struct sockaddr *uaddr, \ | ||
306 | int *addr_len, int peer), (sock, uaddr, addr_len, peer)) \ | ||
307 | SOCKCALL_UWRAP(name, poll, (struct file *file, struct socket *sock, struct poll_table_struct *wait), \ | ||
308 | (file, sock, wait)) \ | ||
309 | SOCKCALL_WRAP(name, ioctl, (struct socket *sock, unsigned int cmd, \ | ||
310 | unsigned long arg), (sock, cmd, arg)) \ | ||
311 | SOCKCALL_WRAP(name, compat_ioctl, (struct socket *sock, unsigned int cmd, \ | ||
312 | unsigned long arg), (sock, cmd, arg)) \ | ||
313 | SOCKCALL_WRAP(name, listen, (struct socket *sock, int len), (sock, len)) \ | ||
314 | SOCKCALL_WRAP(name, shutdown, (struct socket *sock, int flags), (sock, flags)) \ | ||
315 | SOCKCALL_WRAP(name, setsockopt, (struct socket *sock, int level, int optname, \ | ||
316 | char __user *optval, unsigned int optlen), (sock, level, optname, optval, optlen)) \ | ||
317 | SOCKCALL_WRAP(name, getsockopt, (struct socket *sock, int level, int optname, \ | ||
318 | char __user *optval, int __user *optlen), (sock, level, optname, optval, optlen)) \ | ||
319 | SOCKCALL_WRAP(name, sendmsg, (struct kiocb *iocb, struct socket *sock, struct msghdr *m, size_t len), \ | ||
320 | (iocb, sock, m, len)) \ | ||
321 | SOCKCALL_WRAP(name, recvmsg, (struct kiocb *iocb, struct socket *sock, struct msghdr *m, size_t len, int flags), \ | ||
322 | (iocb, sock, m, len, flags)) \ | ||
323 | SOCKCALL_WRAP(name, mmap, (struct file *file, struct socket *sock, struct vm_area_struct *vma), \ | ||
324 | (file, sock, vma)) \ | ||
325 | \ | ||
326 | static const struct proto_ops name##_ops = { \ | ||
327 | .family = fam, \ | ||
328 | .owner = THIS_MODULE, \ | ||
329 | .release = __lock_##name##_release, \ | ||
330 | .bind = __lock_##name##_bind, \ | ||
331 | .connect = __lock_##name##_connect, \ | ||
332 | .socketpair = __lock_##name##_socketpair, \ | ||
333 | .accept = __lock_##name##_accept, \ | ||
334 | .getname = __lock_##name##_getname, \ | ||
335 | .poll = __lock_##name##_poll, \ | ||
336 | .ioctl = __lock_##name##_ioctl, \ | ||
337 | .compat_ioctl = __lock_##name##_compat_ioctl, \ | ||
338 | .listen = __lock_##name##_listen, \ | ||
339 | .shutdown = __lock_##name##_shutdown, \ | ||
340 | .setsockopt = __lock_##name##_setsockopt, \ | ||
341 | .getsockopt = __lock_##name##_getsockopt, \ | ||
342 | .sendmsg = __lock_##name##_sendmsg, \ | ||
343 | .recvmsg = __lock_##name##_recvmsg, \ | ||
344 | .mmap = __lock_##name##_mmap, \ | ||
345 | }; | ||
346 | |||
347 | #endif | ||
348 | |||
349 | #define MODULE_ALIAS_NETPROTO(proto) \ | 271 | #define MODULE_ALIAS_NETPROTO(proto) \ |
350 | MODULE_ALIAS("net-pf-" __stringify(proto)) | 272 | MODULE_ALIAS("net-pf-" __stringify(proto)) |
351 | 273 | ||
@@ -358,6 +280,7 @@ static const struct proto_ops name##_ops = { \ | |||
358 | 280 | ||
359 | #ifdef CONFIG_SYSCTL | 281 | #ifdef CONFIG_SYSCTL |
360 | #include <linux/sysctl.h> | 282 | #include <linux/sysctl.h> |
283 | #include <linux/ratelimit.h> | ||
361 | extern struct ratelimit_state net_ratelimit_state; | 284 | extern struct ratelimit_state net_ratelimit_state; |
362 | #endif | 285 | #endif |
363 | 286 | ||
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 812a5f3c2abe..a3fccc85b1a0 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h | |||
@@ -63,30 +63,69 @@ struct wireless_dev; | |||
63 | #define HAVE_FREE_NETDEV /* free_netdev() */ | 63 | #define HAVE_FREE_NETDEV /* free_netdev() */ |
64 | #define HAVE_NETDEV_PRIV /* netdev_priv() */ | 64 | #define HAVE_NETDEV_PRIV /* netdev_priv() */ |
65 | 65 | ||
66 | #define NET_XMIT_SUCCESS 0 | ||
67 | #define NET_XMIT_DROP 1 /* skb dropped */ | ||
68 | #define NET_XMIT_CN 2 /* congestion notification */ | ||
69 | #define NET_XMIT_POLICED 3 /* skb is shot by police */ | ||
70 | #define NET_XMIT_MASK 0xFFFF /* qdisc flags in net/sch_generic.h */ | ||
71 | |||
72 | /* Backlog congestion levels */ | 66 | /* Backlog congestion levels */ |
73 | #define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ | 67 | #define NET_RX_SUCCESS 0 /* keep 'em coming, baby */ |
74 | #define NET_RX_DROP 1 /* packet dropped */ | 68 | #define NET_RX_DROP 1 /* packet dropped */ |
69 | |||
70 | /* | ||
71 | * Transmit return codes: transmit return codes originate from three different | ||
72 | * namespaces: | ||
73 | * | ||
74 | * - qdisc return codes | ||
75 | * - driver transmit return codes | ||
76 | * - errno values | ||
77 | * | ||
78 | * Drivers are allowed to return any one of those in their hard_start_xmit() | ||
79 | * function. Real network devices commonly used with qdiscs should only return | ||
80 | * the driver transmit return codes though - when qdiscs are used, the actual | ||
81 | * transmission happens asynchronously, so the value is not propagated to | ||
82 | * higher layers. Virtual network devices transmit synchronously, in this case | ||
83 | * the driver transmit return codes are consumed by dev_queue_xmit(), all | ||
84 | * others are propagated to higher layers. | ||
85 | */ | ||
86 | |||
87 | /* qdisc ->enqueue() return codes. */ | ||
88 | #define NET_XMIT_SUCCESS 0x00 | ||
89 | #define NET_XMIT_DROP 0x01 /* skb dropped */ | ||
90 | #define NET_XMIT_CN 0x02 /* congestion notification */ | ||
91 | #define NET_XMIT_POLICED 0x03 /* skb is shot by police */ | ||
92 | #define NET_XMIT_MASK 0x0f /* qdisc flags in net/sch_generic.h */ | ||
75 | 93 | ||
76 | /* NET_XMIT_CN is special. It does not guarantee that this packet is lost. It | 94 | /* NET_XMIT_CN is special. It does not guarantee that this packet is lost. It |
77 | * indicates that the device will soon be dropping packets, or already drops | 95 | * indicates that the device will soon be dropping packets, or already drops |
78 | * some packets of the same priority; prompting us to send less aggressively. */ | 96 | * some packets of the same priority; prompting us to send less aggressively. */ |
79 | #define net_xmit_eval(e) ((e) == NET_XMIT_CN? 0 : (e)) | 97 | #define net_xmit_eval(e) ((e) == NET_XMIT_CN ? 0 : (e)) |
80 | #define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0) | 98 | #define net_xmit_errno(e) ((e) != NET_XMIT_CN ? -ENOBUFS : 0) |
81 | 99 | ||
82 | /* Driver transmit return codes */ | 100 | /* Driver transmit return codes */ |
101 | #define NETDEV_TX_MASK 0xf0 | ||
102 | |||
83 | enum netdev_tx { | 103 | enum netdev_tx { |
84 | NETDEV_TX_OK = 0, /* driver took care of packet */ | 104 | __NETDEV_TX_MIN = INT_MIN, /* make sure enum is signed */ |
85 | NETDEV_TX_BUSY, /* driver tx path was busy*/ | 105 | NETDEV_TX_OK = 0x00, /* driver took care of packet */ |
86 | NETDEV_TX_LOCKED = -1, /* driver tx lock was already taken */ | 106 | NETDEV_TX_BUSY = 0x10, /* driver tx path was busy*/ |
107 | NETDEV_TX_LOCKED = 0x20, /* driver tx lock was already taken */ | ||
87 | }; | 108 | }; |
88 | typedef enum netdev_tx netdev_tx_t; | 109 | typedef enum netdev_tx netdev_tx_t; |
89 | 110 | ||
111 | /* | ||
112 | * Current order: NETDEV_TX_MASK > NET_XMIT_MASK >= 0 is significant; | ||
113 | * hard_start_xmit() return < NET_XMIT_MASK means skb was consumed. | ||
114 | */ | ||
115 | static inline bool dev_xmit_complete(int rc) | ||
116 | { | ||
117 | /* | ||
118 | * Positive cases with an skb consumed by a driver: | ||
119 | * - successful transmission (rc == NETDEV_TX_OK) | ||
120 | * - error while transmitting (rc < 0) | ||
121 | * - error while queueing to a different device (rc & NET_XMIT_MASK) | ||
122 | */ | ||
123 | if (likely(rc < NET_XMIT_MASK)) | ||
124 | return true; | ||
125 | |||
126 | return false; | ||
127 | } | ||
128 | |||
90 | #endif | 129 | #endif |
91 | 130 | ||
92 | #define MAX_ADDR_LEN 32 /* Largest hardware address length */ | 131 | #define MAX_ADDR_LEN 32 /* Largest hardware address length */ |
@@ -125,8 +164,7 @@ typedef enum netdev_tx netdev_tx_t; | |||
125 | * with byte counters. | 164 | * with byte counters. |
126 | */ | 165 | */ |
127 | 166 | ||
128 | struct net_device_stats | 167 | struct net_device_stats { |
129 | { | ||
130 | unsigned long rx_packets; /* total packets received */ | 168 | unsigned long rx_packets; /* total packets received */ |
131 | unsigned long tx_packets; /* total packets transmitted */ | 169 | unsigned long tx_packets; /* total packets transmitted */ |
132 | unsigned long rx_bytes; /* total bytes received */ | 170 | unsigned long rx_bytes; /* total bytes received */ |
@@ -179,8 +217,7 @@ struct neighbour; | |||
179 | struct neigh_parms; | 217 | struct neigh_parms; |
180 | struct sk_buff; | 218 | struct sk_buff; |
181 | 219 | ||
182 | struct netif_rx_stats | 220 | struct netif_rx_stats { |
183 | { | ||
184 | unsigned total; | 221 | unsigned total; |
185 | unsigned dropped; | 222 | unsigned dropped; |
186 | unsigned time_squeeze; | 223 | unsigned time_squeeze; |
@@ -189,8 +226,7 @@ struct netif_rx_stats | |||
189 | 226 | ||
190 | DECLARE_PER_CPU(struct netif_rx_stats, netdev_rx_stat); | 227 | DECLARE_PER_CPU(struct netif_rx_stats, netdev_rx_stat); |
191 | 228 | ||
192 | struct dev_addr_list | 229 | struct dev_addr_list { |
193 | { | ||
194 | struct dev_addr_list *next; | 230 | struct dev_addr_list *next; |
195 | u8 da_addr[MAX_ADDR_LEN]; | 231 | u8 da_addr[MAX_ADDR_LEN]; |
196 | u8 da_addrlen; | 232 | u8 da_addrlen; |
@@ -227,8 +263,7 @@ struct netdev_hw_addr_list { | |||
227 | int count; | 263 | int count; |
228 | }; | 264 | }; |
229 | 265 | ||
230 | struct hh_cache | 266 | struct hh_cache { |
231 | { | ||
232 | struct hh_cache *hh_next; /* Next entry */ | 267 | struct hh_cache *hh_next; /* Next entry */ |
233 | atomic_t hh_refcnt; /* number of users */ | 268 | atomic_t hh_refcnt; /* number of users */ |
234 | /* | 269 | /* |
@@ -291,8 +326,7 @@ struct header_ops { | |||
291 | * code. | 326 | * code. |
292 | */ | 327 | */ |
293 | 328 | ||
294 | enum netdev_state_t | 329 | enum netdev_state_t { |
295 | { | ||
296 | __LINK_STATE_START, | 330 | __LINK_STATE_START, |
297 | __LINK_STATE_PRESENT, | 331 | __LINK_STATE_PRESENT, |
298 | __LINK_STATE_NOCARRIER, | 332 | __LINK_STATE_NOCARRIER, |
@@ -341,20 +375,20 @@ struct napi_struct { | |||
341 | struct sk_buff *skb; | 375 | struct sk_buff *skb; |
342 | }; | 376 | }; |
343 | 377 | ||
344 | enum | 378 | enum { |
345 | { | ||
346 | NAPI_STATE_SCHED, /* Poll is scheduled */ | 379 | NAPI_STATE_SCHED, /* Poll is scheduled */ |
347 | NAPI_STATE_DISABLE, /* Disable pending */ | 380 | NAPI_STATE_DISABLE, /* Disable pending */ |
348 | NAPI_STATE_NPSVC, /* Netpoll - don't dequeue from poll_list */ | 381 | NAPI_STATE_NPSVC, /* Netpoll - don't dequeue from poll_list */ |
349 | }; | 382 | }; |
350 | 383 | ||
351 | enum { | 384 | enum gro_result { |
352 | GRO_MERGED, | 385 | GRO_MERGED, |
353 | GRO_MERGED_FREE, | 386 | GRO_MERGED_FREE, |
354 | GRO_HELD, | 387 | GRO_HELD, |
355 | GRO_NORMAL, | 388 | GRO_NORMAL, |
356 | GRO_DROP, | 389 | GRO_DROP, |
357 | }; | 390 | }; |
391 | typedef enum gro_result gro_result_t; | ||
358 | 392 | ||
359 | extern void __napi_schedule(struct napi_struct *n); | 393 | extern void __napi_schedule(struct napi_struct *n); |
360 | 394 | ||
@@ -457,8 +491,7 @@ static inline void napi_synchronize(const struct napi_struct *n) | |||
457 | # define napi_synchronize(n) barrier() | 491 | # define napi_synchronize(n) barrier() |
458 | #endif | 492 | #endif |
459 | 493 | ||
460 | enum netdev_queue_state_t | 494 | enum netdev_queue_state_t { |
461 | { | ||
462 | __QUEUE_STATE_XOFF, | 495 | __QUEUE_STATE_XOFF, |
463 | __QUEUE_STATE_FROZEN, | 496 | __QUEUE_STATE_FROZEN, |
464 | }; | 497 | }; |
@@ -635,6 +668,10 @@ struct net_device_ops { | |||
635 | unsigned int sgc); | 668 | unsigned int sgc); |
636 | int (*ndo_fcoe_ddp_done)(struct net_device *dev, | 669 | int (*ndo_fcoe_ddp_done)(struct net_device *dev, |
637 | u16 xid); | 670 | u16 xid); |
671 | #define NETDEV_FCOE_WWNN 0 | ||
672 | #define NETDEV_FCOE_WWPN 1 | ||
673 | int (*ndo_fcoe_get_wwn)(struct net_device *dev, | ||
674 | u64 *wwn, int type); | ||
638 | #endif | 675 | #endif |
639 | }; | 676 | }; |
640 | 677 | ||
@@ -648,8 +685,7 @@ struct net_device_ops { | |||
648 | * moves out. | 685 | * moves out. |
649 | */ | 686 | */ |
650 | 687 | ||
651 | struct net_device | 688 | struct net_device { |
652 | { | ||
653 | 689 | ||
654 | /* | 690 | /* |
655 | * This is the first field of the "visible" part of this structure | 691 | * This is the first field of the "visible" part of this structure |
@@ -683,6 +719,7 @@ struct net_device | |||
683 | 719 | ||
684 | struct list_head dev_list; | 720 | struct list_head dev_list; |
685 | struct list_head napi_list; | 721 | struct list_head napi_list; |
722 | struct list_head unreg_list; | ||
686 | 723 | ||
687 | /* Net device features */ | 724 | /* Net device features */ |
688 | unsigned long features; | 725 | unsigned long features; |
@@ -859,7 +896,7 @@ struct net_device | |||
859 | /* device index hash chain */ | 896 | /* device index hash chain */ |
860 | struct hlist_node index_hlist; | 897 | struct hlist_node index_hlist; |
861 | 898 | ||
862 | struct net_device *link_watch_next; | 899 | struct list_head link_watch_list; |
863 | 900 | ||
864 | /* register/unregister state machine */ | 901 | /* register/unregister state machine */ |
865 | enum { NETREG_UNINITIALIZED=0, | 902 | enum { NETREG_UNINITIALIZED=0, |
@@ -894,8 +931,8 @@ struct net_device | |||
894 | 931 | ||
895 | /* class/net/name entry */ | 932 | /* class/net/name entry */ |
896 | struct device dev; | 933 | struct device dev; |
897 | /* space for optional statistics and wireless sysfs groups */ | 934 | /* space for optional device, statistics, and wireless sysfs groups */ |
898 | const struct attribute_group *sysfs_groups[3]; | 935 | const struct attribute_group *sysfs_groups[4]; |
899 | 936 | ||
900 | /* rtnetlink link ops */ | 937 | /* rtnetlink link ops */ |
901 | const struct rtnl_link_ops *rtnl_link_ops; | 938 | const struct rtnl_link_ops *rtnl_link_ops; |
@@ -909,7 +946,7 @@ struct net_device | |||
909 | 946 | ||
910 | #ifdef CONFIG_DCB | 947 | #ifdef CONFIG_DCB |
911 | /* Data Center Bridging netlink ops */ | 948 | /* Data Center Bridging netlink ops */ |
912 | struct dcbnl_rtnl_ops *dcbnl_ops; | 949 | const struct dcbnl_rtnl_ops *dcbnl_ops; |
913 | #endif | 950 | #endif |
914 | 951 | ||
915 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) | 952 | #if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) |
@@ -1075,10 +1112,16 @@ extern rwlock_t dev_base_lock; /* Device list lock */ | |||
1075 | 1112 | ||
1076 | #define for_each_netdev(net, d) \ | 1113 | #define for_each_netdev(net, d) \ |
1077 | list_for_each_entry(d, &(net)->dev_base_head, dev_list) | 1114 | list_for_each_entry(d, &(net)->dev_base_head, dev_list) |
1115 | #define for_each_netdev_reverse(net, d) \ | ||
1116 | list_for_each_entry_reverse(d, &(net)->dev_base_head, dev_list) | ||
1117 | #define for_each_netdev_rcu(net, d) \ | ||
1118 | list_for_each_entry_rcu(d, &(net)->dev_base_head, dev_list) | ||
1078 | #define for_each_netdev_safe(net, d, n) \ | 1119 | #define for_each_netdev_safe(net, d, n) \ |
1079 | list_for_each_entry_safe(d, n, &(net)->dev_base_head, dev_list) | 1120 | list_for_each_entry_safe(d, n, &(net)->dev_base_head, dev_list) |
1080 | #define for_each_netdev_continue(net, d) \ | 1121 | #define for_each_netdev_continue(net, d) \ |
1081 | list_for_each_entry_continue(d, &(net)->dev_base_head, dev_list) | 1122 | list_for_each_entry_continue(d, &(net)->dev_base_head, dev_list) |
1123 | #define for_each_netdev_continue_rcu(net, d) \ | ||
1124 | list_for_each_entry_continue_rcu(d, &(net)->dev_base_head, dev_list) | ||
1082 | #define net_device_entry(lh) list_entry(lh, struct net_device, dev_list) | 1125 | #define net_device_entry(lh) list_entry(lh, struct net_device, dev_list) |
1083 | 1126 | ||
1084 | static inline struct net_device *next_net_device(struct net_device *dev) | 1127 | static inline struct net_device *next_net_device(struct net_device *dev) |
@@ -1091,6 +1134,16 @@ static inline struct net_device *next_net_device(struct net_device *dev) | |||
1091 | return lh == &net->dev_base_head ? NULL : net_device_entry(lh); | 1134 | return lh == &net->dev_base_head ? NULL : net_device_entry(lh); |
1092 | } | 1135 | } |
1093 | 1136 | ||
1137 | static inline struct net_device *next_net_device_rcu(struct net_device *dev) | ||
1138 | { | ||
1139 | struct list_head *lh; | ||
1140 | struct net *net; | ||
1141 | |||
1142 | net = dev_net(dev); | ||
1143 | lh = rcu_dereference(dev->dev_list.next); | ||
1144 | return lh == &net->dev_base_head ? NULL : net_device_entry(lh); | ||
1145 | } | ||
1146 | |||
1094 | static inline struct net_device *first_net_device(struct net *net) | 1147 | static inline struct net_device *first_net_device(struct net *net) |
1095 | { | 1148 | { |
1096 | return list_empty(&net->dev_base_head) ? NULL : | 1149 | return list_empty(&net->dev_base_head) ? NULL : |
@@ -1109,6 +1162,7 @@ extern void __dev_remove_pack(struct packet_type *pt); | |||
1109 | extern struct net_device *dev_get_by_flags(struct net *net, unsigned short flags, | 1162 | extern struct net_device *dev_get_by_flags(struct net *net, unsigned short flags, |
1110 | unsigned short mask); | 1163 | unsigned short mask); |
1111 | extern struct net_device *dev_get_by_name(struct net *net, const char *name); | 1164 | extern struct net_device *dev_get_by_name(struct net *net, const char *name); |
1165 | extern struct net_device *dev_get_by_name_rcu(struct net *net, const char *name); | ||
1112 | extern struct net_device *__dev_get_by_name(struct net *net, const char *name); | 1166 | extern struct net_device *__dev_get_by_name(struct net *net, const char *name); |
1113 | extern int dev_alloc_name(struct net_device *dev, const char *name); | 1167 | extern int dev_alloc_name(struct net_device *dev, const char *name); |
1114 | extern int dev_open(struct net_device *dev); | 1168 | extern int dev_open(struct net_device *dev); |
@@ -1116,7 +1170,14 @@ extern int dev_close(struct net_device *dev); | |||
1116 | extern void dev_disable_lro(struct net_device *dev); | 1170 | extern void dev_disable_lro(struct net_device *dev); |
1117 | extern int dev_queue_xmit(struct sk_buff *skb); | 1171 | extern int dev_queue_xmit(struct sk_buff *skb); |
1118 | extern int register_netdevice(struct net_device *dev); | 1172 | extern int register_netdevice(struct net_device *dev); |
1119 | extern void unregister_netdevice(struct net_device *dev); | 1173 | extern void unregister_netdevice_queue(struct net_device *dev, |
1174 | struct list_head *head); | ||
1175 | extern void unregister_netdevice_many(struct list_head *head); | ||
1176 | static inline void unregister_netdevice(struct net_device *dev) | ||
1177 | { | ||
1178 | unregister_netdevice_queue(dev, NULL); | ||
1179 | } | ||
1180 | |||
1120 | extern void free_netdev(struct net_device *dev); | 1181 | extern void free_netdev(struct net_device *dev); |
1121 | extern void synchronize_net(void); | 1182 | extern void synchronize_net(void); |
1122 | extern int register_netdevice_notifier(struct notifier_block *nb); | 1183 | extern int register_netdevice_notifier(struct notifier_block *nb); |
@@ -1127,6 +1188,7 @@ extern void netdev_resync_ops(struct net_device *dev); | |||
1127 | extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); | 1188 | extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev); |
1128 | extern struct net_device *dev_get_by_index(struct net *net, int ifindex); | 1189 | extern struct net_device *dev_get_by_index(struct net *net, int ifindex); |
1129 | extern struct net_device *__dev_get_by_index(struct net *net, int ifindex); | 1190 | extern struct net_device *__dev_get_by_index(struct net *net, int ifindex); |
1191 | extern struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex); | ||
1130 | extern int dev_restart(struct net_device *dev); | 1192 | extern int dev_restart(struct net_device *dev); |
1131 | #ifdef CONFIG_NETPOLL_TRAP | 1193 | #ifdef CONFIG_NETPOLL_TRAP |
1132 | extern int netpoll_trap(void); | 1194 | extern int netpoll_trap(void); |
@@ -1212,8 +1274,7 @@ static inline int unregister_gifconf(unsigned int family) | |||
1212 | * Incoming packets are placed on per-cpu queues so that | 1274 | * Incoming packets are placed on per-cpu queues so that |
1213 | * no locking is needed. | 1275 | * no locking is needed. |
1214 | */ | 1276 | */ |
1215 | struct softnet_data | 1277 | struct softnet_data { |
1216 | { | ||
1217 | struct Qdisc *output_queue; | 1278 | struct Qdisc *output_queue; |
1218 | struct sk_buff_head input_pkt_queue; | 1279 | struct sk_buff_head input_pkt_queue; |
1219 | struct list_head poll_list; | 1280 | struct list_head poll_list; |
@@ -1467,18 +1528,19 @@ extern int netif_rx_ni(struct sk_buff *skb); | |||
1467 | #define HAVE_NETIF_RECEIVE_SKB 1 | 1528 | #define HAVE_NETIF_RECEIVE_SKB 1 |
1468 | extern int netif_receive_skb(struct sk_buff *skb); | 1529 | extern int netif_receive_skb(struct sk_buff *skb); |
1469 | extern void napi_gro_flush(struct napi_struct *napi); | 1530 | extern void napi_gro_flush(struct napi_struct *napi); |
1470 | extern int dev_gro_receive(struct napi_struct *napi, | 1531 | extern gro_result_t dev_gro_receive(struct napi_struct *napi, |
1471 | struct sk_buff *skb); | 1532 | struct sk_buff *skb); |
1472 | extern int napi_skb_finish(int ret, struct sk_buff *skb); | 1533 | extern gro_result_t napi_skb_finish(gro_result_t ret, struct sk_buff *skb); |
1473 | extern int napi_gro_receive(struct napi_struct *napi, | 1534 | extern gro_result_t napi_gro_receive(struct napi_struct *napi, |
1474 | struct sk_buff *skb); | 1535 | struct sk_buff *skb); |
1475 | extern void napi_reuse_skb(struct napi_struct *napi, | 1536 | extern void napi_reuse_skb(struct napi_struct *napi, |
1476 | struct sk_buff *skb); | 1537 | struct sk_buff *skb); |
1477 | extern struct sk_buff * napi_get_frags(struct napi_struct *napi); | 1538 | extern struct sk_buff * napi_get_frags(struct napi_struct *napi); |
1478 | extern int napi_frags_finish(struct napi_struct *napi, | 1539 | extern gro_result_t napi_frags_finish(struct napi_struct *napi, |
1479 | struct sk_buff *skb, int ret); | 1540 | struct sk_buff *skb, |
1541 | gro_result_t ret); | ||
1480 | extern struct sk_buff * napi_frags_skb(struct napi_struct *napi); | 1542 | extern struct sk_buff * napi_frags_skb(struct napi_struct *napi); |
1481 | extern int napi_gro_frags(struct napi_struct *napi); | 1543 | extern gro_result_t napi_gro_frags(struct napi_struct *napi); |
1482 | 1544 | ||
1483 | static inline void napi_free_frags(struct napi_struct *napi) | 1545 | static inline void napi_free_frags(struct napi_struct *napi) |
1484 | { | 1546 | { |
@@ -1502,6 +1564,8 @@ extern int dev_set_mac_address(struct net_device *, | |||
1502 | extern int dev_hard_start_xmit(struct sk_buff *skb, | 1564 | extern int dev_hard_start_xmit(struct sk_buff *skb, |
1503 | struct net_device *dev, | 1565 | struct net_device *dev, |
1504 | struct netdev_queue *txq); | 1566 | struct netdev_queue *txq); |
1567 | extern int dev_forward_skb(struct net_device *dev, | ||
1568 | struct sk_buff *skb); | ||
1505 | 1569 | ||
1506 | extern int netdev_budget; | 1570 | extern int netdev_budget; |
1507 | 1571 | ||
@@ -1540,6 +1604,7 @@ static inline void dev_hold(struct net_device *dev) | |||
1540 | */ | 1604 | */ |
1541 | 1605 | ||
1542 | extern void linkwatch_fire_event(struct net_device *dev); | 1606 | extern void linkwatch_fire_event(struct net_device *dev); |
1607 | extern void linkwatch_forget_dev(struct net_device *dev); | ||
1543 | 1608 | ||
1544 | /** | 1609 | /** |
1545 | * netif_carrier_ok - test if carrier present | 1610 | * netif_carrier_ok - test if carrier present |
@@ -1609,7 +1674,8 @@ static inline int netif_dormant(const struct net_device *dev) | |||
1609 | * | 1674 | * |
1610 | * Check if carrier is operational | 1675 | * Check if carrier is operational |
1611 | */ | 1676 | */ |
1612 | static inline int netif_oper_up(const struct net_device *dev) { | 1677 | static inline int netif_oper_up(const struct net_device *dev) |
1678 | { | ||
1613 | return (dev->operstate == IF_OPER_UP || | 1679 | return (dev->operstate == IF_OPER_UP || |
1614 | dev->operstate == IF_OPER_UNKNOWN /* backward compat */); | 1680 | dev->operstate == IF_OPER_UNKNOWN /* backward compat */); |
1615 | } | 1681 | } |
@@ -1880,6 +1946,7 @@ extern void netdev_features_change(struct net_device *dev); | |||
1880 | extern void dev_load(struct net *net, const char *name); | 1946 | extern void dev_load(struct net *net, const char *name); |
1881 | extern void dev_mcast_init(void); | 1947 | extern void dev_mcast_init(void); |
1882 | extern const struct net_device_stats *dev_get_stats(struct net_device *dev); | 1948 | extern const struct net_device_stats *dev_get_stats(struct net_device *dev); |
1949 | extern void dev_txq_stats_fold(const struct net_device *dev, struct net_device_stats *stats); | ||
1883 | 1950 | ||
1884 | extern int netdev_max_backlog; | 1951 | extern int netdev_max_backlog; |
1885 | extern int weight_p; | 1952 | extern int weight_p; |
@@ -1914,6 +1981,9 @@ unsigned long netdev_increment_features(unsigned long all, unsigned long one, | |||
1914 | unsigned long mask); | 1981 | unsigned long mask); |
1915 | unsigned long netdev_fix_features(unsigned long features, const char *name); | 1982 | unsigned long netdev_fix_features(unsigned long features, const char *name); |
1916 | 1983 | ||
1984 | void netif_stacked_transfer_operstate(const struct net_device *rootdev, | ||
1985 | struct net_device *dev); | ||
1986 | |||
1917 | static inline int net_gso_ok(int features, int gso_type) | 1987 | static inline int net_gso_ok(int features, int gso_type) |
1918 | { | 1988 | { |
1919 | int feature = gso_type << NETIF_F_GSO_SHIFT; | 1989 | int feature = gso_type << NETIF_F_GSO_SHIFT; |
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h index 6132b5e6d9d3..48c54960773c 100644 --- a/include/linux/netfilter.h +++ b/include/linux/netfilter.h | |||
@@ -93,8 +93,7 @@ typedef unsigned int nf_hookfn(unsigned int hooknum, | |||
93 | const struct net_device *out, | 93 | const struct net_device *out, |
94 | int (*okfn)(struct sk_buff *)); | 94 | int (*okfn)(struct sk_buff *)); |
95 | 95 | ||
96 | struct nf_hook_ops | 96 | struct nf_hook_ops { |
97 | { | ||
98 | struct list_head list; | 97 | struct list_head list; |
99 | 98 | ||
100 | /* User fills in from here down. */ | 99 | /* User fills in from here down. */ |
@@ -106,8 +105,7 @@ struct nf_hook_ops | |||
106 | int priority; | 105 | int priority; |
107 | }; | 106 | }; |
108 | 107 | ||
109 | struct nf_sockopt_ops | 108 | struct nf_sockopt_ops { |
110 | { | ||
111 | struct list_head list; | 109 | struct list_head list; |
112 | 110 | ||
113 | u_int8_t pf; | 111 | u_int8_t pf; |
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h index a8248ee422b7..a374787ed9b0 100644 --- a/include/linux/netfilter/nf_conntrack_common.h +++ b/include/linux/netfilter/nf_conntrack_common.h | |||
@@ -3,8 +3,7 @@ | |||
3 | /* Connection state tracking for netfilter. This is separated from, | 3 | /* Connection state tracking for netfilter. This is separated from, |
4 | but required by, the NAT layer; it can also be used by an iptables | 4 | but required by, the NAT layer; it can also be used by an iptables |
5 | extension. */ | 5 | extension. */ |
6 | enum ip_conntrack_info | 6 | enum ip_conntrack_info { |
7 | { | ||
8 | /* Part of an established connection (either direction). */ | 7 | /* Part of an established connection (either direction). */ |
9 | IP_CT_ESTABLISHED, | 8 | IP_CT_ESTABLISHED, |
10 | 9 | ||
@@ -76,8 +75,7 @@ enum ip_conntrack_status { | |||
76 | }; | 75 | }; |
77 | 76 | ||
78 | #ifdef __KERNEL__ | 77 | #ifdef __KERNEL__ |
79 | struct ip_conntrack_stat | 78 | struct ip_conntrack_stat { |
80 | { | ||
81 | unsigned int searched; | 79 | unsigned int searched; |
82 | unsigned int found; | 80 | unsigned int found; |
83 | unsigned int new; | 81 | unsigned int new; |
diff --git a/include/linux/netfilter/nf_conntrack_ftp.h b/include/linux/netfilter/nf_conntrack_ftp.h index 47727d7546ea..3e3aa08980c3 100644 --- a/include/linux/netfilter/nf_conntrack_ftp.h +++ b/include/linux/netfilter/nf_conntrack_ftp.h | |||
@@ -3,8 +3,7 @@ | |||
3 | /* FTP tracking. */ | 3 | /* FTP tracking. */ |
4 | 4 | ||
5 | /* This enum is exposed to userspace */ | 5 | /* This enum is exposed to userspace */ |
6 | enum nf_ct_ftp_type | 6 | enum nf_ct_ftp_type { |
7 | { | ||
8 | /* PORT command from client */ | 7 | /* PORT command from client */ |
9 | NF_CT_FTP_PORT, | 8 | NF_CT_FTP_PORT, |
10 | /* PASV response from server */ | 9 | /* PASV response from server */ |
diff --git a/include/linux/netfilter/nf_conntrack_sctp.h b/include/linux/netfilter/nf_conntrack_sctp.h index 768f78c4ac53..ceeefe6681b5 100644 --- a/include/linux/netfilter/nf_conntrack_sctp.h +++ b/include/linux/netfilter/nf_conntrack_sctp.h | |||
@@ -16,8 +16,7 @@ enum sctp_conntrack { | |||
16 | SCTP_CONNTRACK_MAX | 16 | SCTP_CONNTRACK_MAX |
17 | }; | 17 | }; |
18 | 18 | ||
19 | struct ip_ct_sctp | 19 | struct ip_ct_sctp { |
20 | { | ||
21 | enum sctp_conntrack state; | 20 | enum sctp_conntrack state; |
22 | 21 | ||
23 | __be32 vtag[IP_CT_DIR_MAX]; | 22 | __be32 vtag[IP_CT_DIR_MAX]; |
diff --git a/include/linux/netfilter/nf_conntrack_tcp.h b/include/linux/netfilter/nf_conntrack_tcp.h index 4352feed2377..6e135f97e59a 100644 --- a/include/linux/netfilter/nf_conntrack_tcp.h +++ b/include/linux/netfilter/nf_conntrack_tcp.h | |||
@@ -55,8 +55,7 @@ struct ip_ct_tcp_state { | |||
55 | u_int8_t flags; /* per direction options */ | 55 | u_int8_t flags; /* per direction options */ |
56 | }; | 56 | }; |
57 | 57 | ||
58 | struct ip_ct_tcp | 58 | struct ip_ct_tcp { |
59 | { | ||
60 | struct ip_ct_tcp_state seen[2]; /* connection parameters per direction */ | 59 | struct ip_ct_tcp_state seen[2]; /* connection parameters per direction */ |
61 | u_int8_t state; /* state of the connection (enum tcp_conntrack) */ | 60 | u_int8_t state; /* state of the connection (enum tcp_conntrack) */ |
62 | /* For detecting stale connections */ | 61 | /* For detecting stale connections */ |
@@ -67,6 +66,9 @@ struct ip_ct_tcp | |||
67 | u_int32_t last_ack; /* Last sequence number seen in opposite dir */ | 66 | u_int32_t last_ack; /* Last sequence number seen in opposite dir */ |
68 | u_int32_t last_end; /* Last seq + len */ | 67 | u_int32_t last_end; /* Last seq + len */ |
69 | u_int16_t last_win; /* Last window advertisement seen in dir */ | 68 | u_int16_t last_win; /* Last window advertisement seen in dir */ |
69 | /* For SYN packets while we may be out-of-sync */ | ||
70 | u_int8_t last_wscale; /* Last window scaling factor seen */ | ||
71 | u_int8_t last_flags; /* Last flags set */ | ||
70 | }; | 72 | }; |
71 | 73 | ||
72 | #endif /* __KERNEL__ */ | 74 | #endif /* __KERNEL__ */ |
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h index 9f00da287f2c..49d321f3ccd2 100644 --- a/include/linux/netfilter/nfnetlink.h +++ b/include/linux/netfilter/nfnetlink.h | |||
@@ -55,8 +55,7 @@ struct nfgenmsg { | |||
55 | #include <linux/capability.h> | 55 | #include <linux/capability.h> |
56 | #include <net/netlink.h> | 56 | #include <net/netlink.h> |
57 | 57 | ||
58 | struct nfnl_callback | 58 | struct nfnl_callback { |
59 | { | ||
60 | int (*call)(struct sock *nl, struct sk_buff *skb, | 59 | int (*call)(struct sock *nl, struct sk_buff *skb, |
61 | const struct nlmsghdr *nlh, | 60 | const struct nlmsghdr *nlh, |
62 | const struct nlattr * const cda[]); | 61 | const struct nlattr * const cda[]); |
@@ -64,8 +63,7 @@ struct nfnl_callback | |||
64 | const u_int16_t attr_count; /* number of nlattr's */ | 63 | const u_int16_t attr_count; /* number of nlattr's */ |
65 | }; | 64 | }; |
66 | 65 | ||
67 | struct nfnetlink_subsystem | 66 | struct nfnetlink_subsystem { |
68 | { | ||
69 | const char *name; | 67 | const char *name; |
70 | __u8 subsys_id; /* nfnetlink subsystem ID */ | 68 | __u8 subsys_id; /* nfnetlink subsystem ID */ |
71 | __u8 cb_count; /* number of callbacks */ | 69 | __u8 cb_count; /* number of callbacks */ |
diff --git a/include/linux/netfilter/nfnetlink_compat.h b/include/linux/netfilter/nfnetlink_compat.h index eda55cabceec..ffb95036bbd4 100644 --- a/include/linux/netfilter/nfnetlink_compat.h +++ b/include/linux/netfilter/nfnetlink_compat.h | |||
@@ -21,8 +21,7 @@ | |||
21 | * ! nfnetlink use the same attributes methods. - J. Schulist. | 21 | * ! nfnetlink use the same attributes methods. - J. Schulist. |
22 | */ | 22 | */ |
23 | 23 | ||
24 | struct nfattr | 24 | struct nfattr { |
25 | { | ||
26 | __u16 nfa_len; | 25 | __u16 nfa_len; |
27 | __u16 nfa_type; /* we use 15 bits for the type, and the highest | 26 | __u16 nfa_type; /* we use 15 bits for the type, and the highest |
28 | * bit to indicate whether the payload is nested */ | 27 | * bit to indicate whether the payload is nested */ |
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h index 812cb153cabb..378f27ae7772 100644 --- a/include/linux/netfilter/x_tables.h +++ b/include/linux/netfilter/x_tables.h | |||
@@ -6,8 +6,7 @@ | |||
6 | #define XT_FUNCTION_MAXNAMELEN 30 | 6 | #define XT_FUNCTION_MAXNAMELEN 30 |
7 | #define XT_TABLE_MAXNAMELEN 32 | 7 | #define XT_TABLE_MAXNAMELEN 32 |
8 | 8 | ||
9 | struct xt_entry_match | 9 | struct xt_entry_match { |
10 | { | ||
11 | union { | 10 | union { |
12 | struct { | 11 | struct { |
13 | __u16 match_size; | 12 | __u16 match_size; |
@@ -31,8 +30,7 @@ struct xt_entry_match | |||
31 | unsigned char data[0]; | 30 | unsigned char data[0]; |
32 | }; | 31 | }; |
33 | 32 | ||
34 | struct xt_entry_target | 33 | struct xt_entry_target { |
35 | { | ||
36 | union { | 34 | union { |
37 | struct { | 35 | struct { |
38 | __u16 target_size; | 36 | __u16 target_size; |
@@ -64,16 +62,14 @@ struct xt_entry_target | |||
64 | }, \ | 62 | }, \ |
65 | } | 63 | } |
66 | 64 | ||
67 | struct xt_standard_target | 65 | struct xt_standard_target { |
68 | { | ||
69 | struct xt_entry_target target; | 66 | struct xt_entry_target target; |
70 | int verdict; | 67 | int verdict; |
71 | }; | 68 | }; |
72 | 69 | ||
73 | /* The argument to IPT_SO_GET_REVISION_*. Returns highest revision | 70 | /* The argument to IPT_SO_GET_REVISION_*. Returns highest revision |
74 | * kernel supports, if >= revision. */ | 71 | * kernel supports, if >= revision. */ |
75 | struct xt_get_revision | 72 | struct xt_get_revision { |
76 | { | ||
77 | char name[XT_FUNCTION_MAXNAMELEN-1]; | 73 | char name[XT_FUNCTION_MAXNAMELEN-1]; |
78 | 74 | ||
79 | __u8 revision; | 75 | __u8 revision; |
@@ -90,8 +86,7 @@ struct xt_get_revision | |||
90 | * ip6t_entry and arpt_entry. This sucks, and it is a hack. It will be my | 86 | * ip6t_entry and arpt_entry. This sucks, and it is a hack. It will be my |
91 | * personal pleasure to remove it -HW | 87 | * personal pleasure to remove it -HW |
92 | */ | 88 | */ |
93 | struct _xt_align | 89 | struct _xt_align { |
94 | { | ||
95 | __u8 u8; | 90 | __u8 u8; |
96 | __u16 u16; | 91 | __u16 u16; |
97 | __u32 u32; | 92 | __u32 u32; |
@@ -109,14 +104,12 @@ struct _xt_align | |||
109 | #define SET_COUNTER(c,b,p) do { (c).bcnt = (b); (c).pcnt = (p); } while(0) | 104 | #define SET_COUNTER(c,b,p) do { (c).bcnt = (b); (c).pcnt = (p); } while(0) |
110 | #define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0) | 105 | #define ADD_COUNTER(c,b,p) do { (c).bcnt += (b); (c).pcnt += (p); } while(0) |
111 | 106 | ||
112 | struct xt_counters | 107 | struct xt_counters { |
113 | { | ||
114 | __u64 pcnt, bcnt; /* Packet and byte counters */ | 108 | __u64 pcnt, bcnt; /* Packet and byte counters */ |
115 | }; | 109 | }; |
116 | 110 | ||
117 | /* The argument to IPT_SO_ADD_COUNTERS. */ | 111 | /* The argument to IPT_SO_ADD_COUNTERS. */ |
118 | struct xt_counters_info | 112 | struct xt_counters_info { |
119 | { | ||
120 | /* Which table. */ | 113 | /* Which table. */ |
121 | char name[XT_TABLE_MAXNAMELEN]; | 114 | char name[XT_TABLE_MAXNAMELEN]; |
122 | 115 | ||
@@ -269,8 +262,7 @@ struct xt_tgdtor_param { | |||
269 | u_int8_t family; | 262 | u_int8_t family; |
270 | }; | 263 | }; |
271 | 264 | ||
272 | struct xt_match | 265 | struct xt_match { |
273 | { | ||
274 | struct list_head list; | 266 | struct list_head list; |
275 | 267 | ||
276 | const char name[XT_FUNCTION_MAXNAMELEN-1]; | 268 | const char name[XT_FUNCTION_MAXNAMELEN-1]; |
@@ -310,8 +302,7 @@ struct xt_match | |||
310 | }; | 302 | }; |
311 | 303 | ||
312 | /* Registration hooks for targets. */ | 304 | /* Registration hooks for targets. */ |
313 | struct xt_target | 305 | struct xt_target { |
314 | { | ||
315 | struct list_head list; | 306 | struct list_head list; |
316 | 307 | ||
317 | const char name[XT_FUNCTION_MAXNAMELEN-1]; | 308 | const char name[XT_FUNCTION_MAXNAMELEN-1]; |
@@ -349,8 +340,7 @@ struct xt_target | |||
349 | }; | 340 | }; |
350 | 341 | ||
351 | /* Furniture shopping... */ | 342 | /* Furniture shopping... */ |
352 | struct xt_table | 343 | struct xt_table { |
353 | { | ||
354 | struct list_head list; | 344 | struct list_head list; |
355 | 345 | ||
356 | /* What hooks you will enter on */ | 346 | /* What hooks you will enter on */ |
@@ -371,8 +361,7 @@ struct xt_table | |||
371 | #include <linux/netfilter_ipv4.h> | 361 | #include <linux/netfilter_ipv4.h> |
372 | 362 | ||
373 | /* The table itself */ | 363 | /* The table itself */ |
374 | struct xt_table_info | 364 | struct xt_table_info { |
375 | { | ||
376 | /* Size per table */ | 365 | /* Size per table */ |
377 | unsigned int size; | 366 | unsigned int size; |
378 | /* Number of entries: FIXME. --RR */ | 367 | /* Number of entries: FIXME. --RR */ |
@@ -528,8 +517,7 @@ static inline unsigned long ifname_compare_aligned(const char *_a, | |||
528 | #ifdef CONFIG_COMPAT | 517 | #ifdef CONFIG_COMPAT |
529 | #include <net/compat.h> | 518 | #include <net/compat.h> |
530 | 519 | ||
531 | struct compat_xt_entry_match | 520 | struct compat_xt_entry_match { |
532 | { | ||
533 | union { | 521 | union { |
534 | struct { | 522 | struct { |
535 | u_int16_t match_size; | 523 | u_int16_t match_size; |
@@ -545,8 +533,7 @@ struct compat_xt_entry_match | |||
545 | unsigned char data[0]; | 533 | unsigned char data[0]; |
546 | }; | 534 | }; |
547 | 535 | ||
548 | struct compat_xt_entry_target | 536 | struct compat_xt_entry_target { |
549 | { | ||
550 | union { | 537 | union { |
551 | struct { | 538 | struct { |
552 | u_int16_t target_size; | 539 | u_int16_t target_size; |
@@ -566,8 +553,7 @@ struct compat_xt_entry_target | |||
566 | * need to change whole approach in order to calculate align as function of | 553 | * need to change whole approach in order to calculate align as function of |
567 | * current task alignment */ | 554 | * current task alignment */ |
568 | 555 | ||
569 | struct compat_xt_counters | 556 | struct compat_xt_counters { |
570 | { | ||
571 | #if defined(CONFIG_X86_64) || defined(CONFIG_IA64) | 557 | #if defined(CONFIG_X86_64) || defined(CONFIG_IA64) |
572 | u_int32_t cnt[4]; | 558 | u_int32_t cnt[4]; |
573 | #else | 559 | #else |
@@ -575,8 +561,7 @@ struct compat_xt_counters | |||
575 | #endif | 561 | #endif |
576 | }; | 562 | }; |
577 | 563 | ||
578 | struct compat_xt_counters_info | 564 | struct compat_xt_counters_info { |
579 | { | ||
580 | char name[XT_TABLE_MAXNAMELEN]; | 565 | char name[XT_TABLE_MAXNAMELEN]; |
581 | compat_uint_t num_counters; | 566 | compat_uint_t num_counters; |
582 | struct compat_xt_counters counters[0]; | 567 | struct compat_xt_counters counters[0]; |
diff --git a/include/linux/netfilter/xt_connbytes.h b/include/linux/netfilter/xt_connbytes.h index 52bd6153b996..92fcbb0d193e 100644 --- a/include/linux/netfilter/xt_connbytes.h +++ b/include/linux/netfilter/xt_connbytes.h | |||
@@ -15,8 +15,7 @@ enum xt_connbytes_direction { | |||
15 | XT_CONNBYTES_DIR_BOTH, | 15 | XT_CONNBYTES_DIR_BOTH, |
16 | }; | 16 | }; |
17 | 17 | ||
18 | struct xt_connbytes_info | 18 | struct xt_connbytes_info { |
19 | { | ||
20 | struct { | 19 | struct { |
21 | aligned_u64 from; /* count to be matched */ | 20 | aligned_u64 from; /* count to be matched */ |
22 | aligned_u64 to; /* count to be matched */ | 21 | aligned_u64 to; /* count to be matched */ |
diff --git a/include/linux/netfilter/xt_esp.h b/include/linux/netfilter/xt_esp.h index ef6fa4747d0a..ee6882408000 100644 --- a/include/linux/netfilter/xt_esp.h +++ b/include/linux/netfilter/xt_esp.h | |||
@@ -3,8 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | 5 | ||
6 | struct xt_esp | 6 | struct xt_esp { |
7 | { | ||
8 | __u32 spis[2]; /* Security Parameter Index */ | 7 | __u32 spis[2]; /* Security Parameter Index */ |
9 | __u8 invflags; /* Inverse flags */ | 8 | __u8 invflags; /* Inverse flags */ |
10 | }; | 9 | }; |
diff --git a/include/linux/netfilter/xt_multiport.h b/include/linux/netfilter/xt_multiport.h index 185db499fcbc..5b7e72dfffc5 100644 --- a/include/linux/netfilter/xt_multiport.h +++ b/include/linux/netfilter/xt_multiport.h | |||
@@ -3,8 +3,7 @@ | |||
3 | 3 | ||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | 5 | ||
6 | enum xt_multiport_flags | 6 | enum xt_multiport_flags { |
7 | { | ||
8 | XT_MULTIPORT_SOURCE, | 7 | XT_MULTIPORT_SOURCE, |
9 | XT_MULTIPORT_DESTINATION, | 8 | XT_MULTIPORT_DESTINATION, |
10 | XT_MULTIPORT_EITHER | 9 | XT_MULTIPORT_EITHER |
@@ -13,15 +12,13 @@ enum xt_multiport_flags | |||
13 | #define XT_MULTI_PORTS 15 | 12 | #define XT_MULTI_PORTS 15 |
14 | 13 | ||
15 | /* Must fit inside union xt_matchinfo: 16 bytes */ | 14 | /* Must fit inside union xt_matchinfo: 16 bytes */ |
16 | struct xt_multiport | 15 | struct xt_multiport { |
17 | { | ||
18 | __u8 flags; /* Type of comparison */ | 16 | __u8 flags; /* Type of comparison */ |
19 | __u8 count; /* Number of ports */ | 17 | __u8 count; /* Number of ports */ |
20 | __u16 ports[XT_MULTI_PORTS]; /* Ports */ | 18 | __u16 ports[XT_MULTI_PORTS]; /* Ports */ |
21 | }; | 19 | }; |
22 | 20 | ||
23 | struct xt_multiport_v1 | 21 | struct xt_multiport_v1 { |
24 | { | ||
25 | __u8 flags; /* Type of comparison */ | 22 | __u8 flags; /* Type of comparison */ |
26 | __u8 count; /* Number of ports */ | 23 | __u8 count; /* Number of ports */ |
27 | __u16 ports[XT_MULTI_PORTS]; /* Ports */ | 24 | __u16 ports[XT_MULTI_PORTS]; /* Ports */ |
diff --git a/include/linux/netfilter/xt_policy.h b/include/linux/netfilter/xt_policy.h index 7bb64e7c853d..be8ead05c316 100644 --- a/include/linux/netfilter/xt_policy.h +++ b/include/linux/netfilter/xt_policy.h | |||
@@ -5,22 +5,19 @@ | |||
5 | 5 | ||
6 | #define XT_POLICY_MAX_ELEM 4 | 6 | #define XT_POLICY_MAX_ELEM 4 |
7 | 7 | ||
8 | enum xt_policy_flags | 8 | enum xt_policy_flags { |
9 | { | ||
10 | XT_POLICY_MATCH_IN = 0x1, | 9 | XT_POLICY_MATCH_IN = 0x1, |
11 | XT_POLICY_MATCH_OUT = 0x2, | 10 | XT_POLICY_MATCH_OUT = 0x2, |
12 | XT_POLICY_MATCH_NONE = 0x4, | 11 | XT_POLICY_MATCH_NONE = 0x4, |
13 | XT_POLICY_MATCH_STRICT = 0x8, | 12 | XT_POLICY_MATCH_STRICT = 0x8, |
14 | }; | 13 | }; |
15 | 14 | ||
16 | enum xt_policy_modes | 15 | enum xt_policy_modes { |
17 | { | ||
18 | XT_POLICY_MODE_TRANSPORT, | 16 | XT_POLICY_MODE_TRANSPORT, |
19 | XT_POLICY_MODE_TUNNEL | 17 | XT_POLICY_MODE_TUNNEL |
20 | }; | 18 | }; |
21 | 19 | ||
22 | struct xt_policy_spec | 20 | struct xt_policy_spec { |
23 | { | ||
24 | __u8 saddr:1, | 21 | __u8 saddr:1, |
25 | daddr:1, | 22 | daddr:1, |
26 | proto:1, | 23 | proto:1, |
@@ -30,15 +27,13 @@ struct xt_policy_spec | |||
30 | }; | 27 | }; |
31 | 28 | ||
32 | #ifndef __KERNEL__ | 29 | #ifndef __KERNEL__ |
33 | union xt_policy_addr | 30 | union xt_policy_addr { |
34 | { | ||
35 | struct in_addr a4; | 31 | struct in_addr a4; |
36 | struct in6_addr a6; | 32 | struct in6_addr a6; |
37 | }; | 33 | }; |
38 | #endif | 34 | #endif |
39 | 35 | ||
40 | struct xt_policy_elem | 36 | struct xt_policy_elem { |
41 | { | ||
42 | union { | 37 | union { |
43 | #ifdef __KERNEL__ | 38 | #ifdef __KERNEL__ |
44 | struct { | 39 | struct { |
@@ -65,8 +60,7 @@ struct xt_policy_elem | |||
65 | struct xt_policy_spec invert; | 60 | struct xt_policy_spec invert; |
66 | }; | 61 | }; |
67 | 62 | ||
68 | struct xt_policy_info | 63 | struct xt_policy_info { |
69 | { | ||
70 | struct xt_policy_elem pol[XT_POLICY_MAX_ELEM]; | 64 | struct xt_policy_elem pol[XT_POLICY_MAX_ELEM]; |
71 | __u16 flags; | 65 | __u16 flags; |
72 | __u16 len; | 66 | __u16 len; |
diff --git a/include/linux/netfilter/xt_state.h b/include/linux/netfilter/xt_state.h index c06f32edee07..7b32de886613 100644 --- a/include/linux/netfilter/xt_state.h +++ b/include/linux/netfilter/xt_state.h | |||
@@ -6,8 +6,7 @@ | |||
6 | 6 | ||
7 | #define XT_STATE_UNTRACKED (1 << (IP_CT_NUMBER + 1)) | 7 | #define XT_STATE_UNTRACKED (1 << (IP_CT_NUMBER + 1)) |
8 | 8 | ||
9 | struct xt_state_info | 9 | struct xt_state_info { |
10 | { | ||
11 | unsigned int statemask; | 10 | unsigned int statemask; |
12 | }; | 11 | }; |
13 | #endif /*_XT_STATE_H*/ | 12 | #endif /*_XT_STATE_H*/ |
diff --git a/include/linux/netfilter/xt_string.h b/include/linux/netfilter/xt_string.h index ecbb95fc89ed..235347c02eab 100644 --- a/include/linux/netfilter/xt_string.h +++ b/include/linux/netfilter/xt_string.h | |||
@@ -11,8 +11,7 @@ enum { | |||
11 | XT_STRING_FLAG_IGNORECASE = 0x02 | 11 | XT_STRING_FLAG_IGNORECASE = 0x02 |
12 | }; | 12 | }; |
13 | 13 | ||
14 | struct xt_string_info | 14 | struct xt_string_info { |
15 | { | ||
16 | __u16 from_offset; | 15 | __u16 from_offset; |
17 | __u16 to_offset; | 16 | __u16 to_offset; |
18 | char algo[XT_STRING_MAX_ALGO_NAME_SIZE]; | 17 | char algo[XT_STRING_MAX_ALGO_NAME_SIZE]; |
diff --git a/include/linux/netfilter/xt_tcpudp.h b/include/linux/netfilter/xt_tcpudp.h index a490a0bc1d29..38aa7b399021 100644 --- a/include/linux/netfilter/xt_tcpudp.h +++ b/include/linux/netfilter/xt_tcpudp.h | |||
@@ -4,8 +4,7 @@ | |||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | 5 | ||
6 | /* TCP matching stuff */ | 6 | /* TCP matching stuff */ |
7 | struct xt_tcp | 7 | struct xt_tcp { |
8 | { | ||
9 | __u16 spts[2]; /* Source port range. */ | 8 | __u16 spts[2]; /* Source port range. */ |
10 | __u16 dpts[2]; /* Destination port range. */ | 9 | __u16 dpts[2]; /* Destination port range. */ |
11 | __u8 option; /* TCP Option iff non-zero*/ | 10 | __u8 option; /* TCP Option iff non-zero*/ |
@@ -22,8 +21,7 @@ struct xt_tcp | |||
22 | #define XT_TCP_INV_MASK 0x0F /* All possible flags. */ | 21 | #define XT_TCP_INV_MASK 0x0F /* All possible flags. */ |
23 | 22 | ||
24 | /* UDP matching stuff */ | 23 | /* UDP matching stuff */ |
25 | struct xt_udp | 24 | struct xt_udp { |
26 | { | ||
27 | __u16 spts[2]; /* Source port range. */ | 25 | __u16 spts[2]; /* Source port range. */ |
28 | __u16 dpts[2]; /* Destination port range. */ | 26 | __u16 dpts[2]; /* Destination port range. */ |
29 | __u8 invflags; /* Inverse flags */ | 27 | __u8 invflags; /* Inverse flags */ |
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h index 6fe3e6aa10db..f2336523a9df 100644 --- a/include/linux/netfilter_arp/arp_tables.h +++ b/include/linux/netfilter_arp/arp_tables.h | |||
@@ -132,8 +132,7 @@ struct arpt_entry | |||
132 | #define ARPT_RETURN XT_RETURN | 132 | #define ARPT_RETURN XT_RETURN |
133 | 133 | ||
134 | /* The argument to ARPT_SO_GET_INFO */ | 134 | /* The argument to ARPT_SO_GET_INFO */ |
135 | struct arpt_getinfo | 135 | struct arpt_getinfo { |
136 | { | ||
137 | /* Which table: caller fills this in. */ | 136 | /* Which table: caller fills this in. */ |
138 | char name[ARPT_TABLE_MAXNAMELEN]; | 137 | char name[ARPT_TABLE_MAXNAMELEN]; |
139 | 138 | ||
@@ -155,8 +154,7 @@ struct arpt_getinfo | |||
155 | }; | 154 | }; |
156 | 155 | ||
157 | /* The argument to ARPT_SO_SET_REPLACE. */ | 156 | /* The argument to ARPT_SO_SET_REPLACE. */ |
158 | struct arpt_replace | 157 | struct arpt_replace { |
159 | { | ||
160 | /* Which table. */ | 158 | /* Which table. */ |
161 | char name[ARPT_TABLE_MAXNAMELEN]; | 159 | char name[ARPT_TABLE_MAXNAMELEN]; |
162 | 160 | ||
@@ -191,8 +189,7 @@ struct arpt_replace | |||
191 | #define arpt_counters xt_counters | 189 | #define arpt_counters xt_counters |
192 | 190 | ||
193 | /* The argument to ARPT_SO_GET_ENTRIES. */ | 191 | /* The argument to ARPT_SO_GET_ENTRIES. */ |
194 | struct arpt_get_entries | 192 | struct arpt_get_entries { |
195 | { | ||
196 | /* Which table: user fills this in. */ | 193 | /* Which table: user fills this in. */ |
197 | char name[ARPT_TABLE_MAXNAMELEN]; | 194 | char name[ARPT_TABLE_MAXNAMELEN]; |
198 | 195 | ||
@@ -224,20 +221,17 @@ static __inline__ struct arpt_entry_target *arpt_get_target(struct arpt_entry *e | |||
224 | #ifdef __KERNEL__ | 221 | #ifdef __KERNEL__ |
225 | 222 | ||
226 | /* Standard entry. */ | 223 | /* Standard entry. */ |
227 | struct arpt_standard | 224 | struct arpt_standard { |
228 | { | ||
229 | struct arpt_entry entry; | 225 | struct arpt_entry entry; |
230 | struct arpt_standard_target target; | 226 | struct arpt_standard_target target; |
231 | }; | 227 | }; |
232 | 228 | ||
233 | struct arpt_error_target | 229 | struct arpt_error_target { |
234 | { | ||
235 | struct arpt_entry_target target; | 230 | struct arpt_entry_target target; |
236 | char errorname[ARPT_FUNCTION_MAXNAMELEN]; | 231 | char errorname[ARPT_FUNCTION_MAXNAMELEN]; |
237 | }; | 232 | }; |
238 | 233 | ||
239 | struct arpt_error | 234 | struct arpt_error { |
240 | { | ||
241 | struct arpt_entry entry; | 235 | struct arpt_entry entry; |
242 | struct arpt_error_target target; | 236 | struct arpt_error_target target; |
243 | }; | 237 | }; |
@@ -279,8 +273,7 @@ extern unsigned int arpt_do_table(struct sk_buff *skb, | |||
279 | #ifdef CONFIG_COMPAT | 273 | #ifdef CONFIG_COMPAT |
280 | #include <net/compat.h> | 274 | #include <net/compat.h> |
281 | 275 | ||
282 | struct compat_arpt_entry | 276 | struct compat_arpt_entry { |
283 | { | ||
284 | struct arpt_arp arp; | 277 | struct arpt_arp arp; |
285 | u_int16_t target_offset; | 278 | u_int16_t target_offset; |
286 | u_int16_t next_offset; | 279 | u_int16_t next_offset; |
diff --git a/include/linux/netfilter_bridge/ebt_802_3.h b/include/linux/netfilter_bridge/ebt_802_3.h index a11b0c2017fd..c73ef0b18bdc 100644 --- a/include/linux/netfilter_bridge/ebt_802_3.h +++ b/include/linux/netfilter_bridge/ebt_802_3.h | |||
@@ -58,8 +58,7 @@ static inline struct ebt_802_3_hdr *ebt_802_3_hdr(const struct sk_buff *skb) | |||
58 | } | 58 | } |
59 | #endif | 59 | #endif |
60 | 60 | ||
61 | struct ebt_802_3_info | 61 | struct ebt_802_3_info { |
62 | { | ||
63 | uint8_t sap; | 62 | uint8_t sap; |
64 | __be16 type; | 63 | __be16 type; |
65 | uint8_t bitmask; | 64 | uint8_t bitmask; |
diff --git a/include/linux/netfilter_bridge/ebt_among.h b/include/linux/netfilter_bridge/ebt_among.h index 7654069233ca..0009558609a7 100644 --- a/include/linux/netfilter_bridge/ebt_among.h +++ b/include/linux/netfilter_bridge/ebt_among.h | |||
@@ -29,14 +29,12 @@ | |||
29 | * Yes, it is a memory overhead, but in 2003 AD, who cares? | 29 | * Yes, it is a memory overhead, but in 2003 AD, who cares? |
30 | */ | 30 | */ |
31 | 31 | ||
32 | struct ebt_mac_wormhash_tuple | 32 | struct ebt_mac_wormhash_tuple { |
33 | { | ||
34 | uint32_t cmp[2]; | 33 | uint32_t cmp[2]; |
35 | __be32 ip; | 34 | __be32 ip; |
36 | }; | 35 | }; |
37 | 36 | ||
38 | struct ebt_mac_wormhash | 37 | struct ebt_mac_wormhash { |
39 | { | ||
40 | int table[257]; | 38 | int table[257]; |
41 | int poolsize; | 39 | int poolsize; |
42 | struct ebt_mac_wormhash_tuple pool[0]; | 40 | struct ebt_mac_wormhash_tuple pool[0]; |
@@ -45,8 +43,7 @@ struct ebt_mac_wormhash | |||
45 | #define ebt_mac_wormhash_size(x) ((x) ? sizeof(struct ebt_mac_wormhash) \ | 43 | #define ebt_mac_wormhash_size(x) ((x) ? sizeof(struct ebt_mac_wormhash) \ |
46 | + (x)->poolsize * sizeof(struct ebt_mac_wormhash_tuple) : 0) | 44 | + (x)->poolsize * sizeof(struct ebt_mac_wormhash_tuple) : 0) |
47 | 45 | ||
48 | struct ebt_among_info | 46 | struct ebt_among_info { |
49 | { | ||
50 | int wh_dst_ofs; | 47 | int wh_dst_ofs; |
51 | int wh_src_ofs; | 48 | int wh_src_ofs; |
52 | int bitmask; | 49 | int bitmask; |
diff --git a/include/linux/netfilter_bridge/ebt_arpreply.h b/include/linux/netfilter_bridge/ebt_arpreply.h index 96a8339960e0..7e77896e1fbf 100644 --- a/include/linux/netfilter_bridge/ebt_arpreply.h +++ b/include/linux/netfilter_bridge/ebt_arpreply.h | |||
@@ -1,8 +1,7 @@ | |||
1 | #ifndef __LINUX_BRIDGE_EBT_ARPREPLY_H | 1 | #ifndef __LINUX_BRIDGE_EBT_ARPREPLY_H |
2 | #define __LINUX_BRIDGE_EBT_ARPREPLY_H | 2 | #define __LINUX_BRIDGE_EBT_ARPREPLY_H |
3 | 3 | ||
4 | struct ebt_arpreply_info | 4 | struct ebt_arpreply_info { |
5 | { | ||
6 | unsigned char mac[ETH_ALEN]; | 5 | unsigned char mac[ETH_ALEN]; |
7 | int target; | 6 | int target; |
8 | }; | 7 | }; |
diff --git a/include/linux/netfilter_bridge/ebt_ip.h b/include/linux/netfilter_bridge/ebt_ip.h index d6847475bf2e..6a708fb92241 100644 --- a/include/linux/netfilter_bridge/ebt_ip.h +++ b/include/linux/netfilter_bridge/ebt_ip.h | |||
@@ -26,8 +26,7 @@ | |||
26 | #define EBT_IP_MATCH "ip" | 26 | #define EBT_IP_MATCH "ip" |
27 | 27 | ||
28 | /* the same values are used for the invflags */ | 28 | /* the same values are used for the invflags */ |
29 | struct ebt_ip_info | 29 | struct ebt_ip_info { |
30 | { | ||
31 | __be32 saddr; | 30 | __be32 saddr; |
32 | __be32 daddr; | 31 | __be32 daddr; |
33 | __be32 smsk; | 32 | __be32 smsk; |
diff --git a/include/linux/netfilter_bridge/ebt_ip6.h b/include/linux/netfilter_bridge/ebt_ip6.h index 2273c3ae33ca..e5de98701519 100644 --- a/include/linux/netfilter_bridge/ebt_ip6.h +++ b/include/linux/netfilter_bridge/ebt_ip6.h | |||
@@ -23,8 +23,7 @@ | |||
23 | #define EBT_IP6_MATCH "ip6" | 23 | #define EBT_IP6_MATCH "ip6" |
24 | 24 | ||
25 | /* the same values are used for the invflags */ | 25 | /* the same values are used for the invflags */ |
26 | struct ebt_ip6_info | 26 | struct ebt_ip6_info { |
27 | { | ||
28 | struct in6_addr saddr; | 27 | struct in6_addr saddr; |
29 | struct in6_addr daddr; | 28 | struct in6_addr daddr; |
30 | struct in6_addr smsk; | 29 | struct in6_addr smsk; |
diff --git a/include/linux/netfilter_bridge/ebt_limit.h b/include/linux/netfilter_bridge/ebt_limit.h index d8b65000afe4..4bf76b751676 100644 --- a/include/linux/netfilter_bridge/ebt_limit.h +++ b/include/linux/netfilter_bridge/ebt_limit.h | |||
@@ -9,8 +9,7 @@ | |||
9 | /* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490 | 9 | /* 1/10,000 sec period => max of 10,000/sec. Min rate is then 429490 |
10 | seconds, or one every 59 hours. */ | 10 | seconds, or one every 59 hours. */ |
11 | 11 | ||
12 | struct ebt_limit_info | 12 | struct ebt_limit_info { |
13 | { | ||
14 | u_int32_t avg; /* Average secs between packets * scale */ | 13 | u_int32_t avg; /* Average secs between packets * scale */ |
15 | u_int32_t burst; /* Period multiplier for upper limit. */ | 14 | u_int32_t burst; /* Period multiplier for upper limit. */ |
16 | 15 | ||
diff --git a/include/linux/netfilter_bridge/ebt_log.h b/include/linux/netfilter_bridge/ebt_log.h index b76e653157e5..cc2cdfb764bc 100644 --- a/include/linux/netfilter_bridge/ebt_log.h +++ b/include/linux/netfilter_bridge/ebt_log.h | |||
@@ -9,8 +9,7 @@ | |||
9 | #define EBT_LOG_PREFIX_SIZE 30 | 9 | #define EBT_LOG_PREFIX_SIZE 30 |
10 | #define EBT_LOG_WATCHER "log" | 10 | #define EBT_LOG_WATCHER "log" |
11 | 11 | ||
12 | struct ebt_log_info | 12 | struct ebt_log_info { |
13 | { | ||
14 | uint8_t loglevel; | 13 | uint8_t loglevel; |
15 | uint8_t prefix[EBT_LOG_PREFIX_SIZE]; | 14 | uint8_t prefix[EBT_LOG_PREFIX_SIZE]; |
16 | uint32_t bitmask; | 15 | uint32_t bitmask; |
diff --git a/include/linux/netfilter_bridge/ebt_mark_m.h b/include/linux/netfilter_bridge/ebt_mark_m.h index 301524ff1065..9ceb10ec0ed6 100644 --- a/include/linux/netfilter_bridge/ebt_mark_m.h +++ b/include/linux/netfilter_bridge/ebt_mark_m.h | |||
@@ -4,8 +4,7 @@ | |||
4 | #define EBT_MARK_AND 0x01 | 4 | #define EBT_MARK_AND 0x01 |
5 | #define EBT_MARK_OR 0x02 | 5 | #define EBT_MARK_OR 0x02 |
6 | #define EBT_MARK_MASK (EBT_MARK_AND | EBT_MARK_OR) | 6 | #define EBT_MARK_MASK (EBT_MARK_AND | EBT_MARK_OR) |
7 | struct ebt_mark_m_info | 7 | struct ebt_mark_m_info { |
8 | { | ||
9 | unsigned long mark, mask; | 8 | unsigned long mark, mask; |
10 | uint8_t invert; | 9 | uint8_t invert; |
11 | uint8_t bitmask; | 10 | uint8_t bitmask; |
diff --git a/include/linux/netfilter_bridge/ebt_mark_t.h b/include/linux/netfilter_bridge/ebt_mark_t.h index 6270f6f33693..7d5a268a4311 100644 --- a/include/linux/netfilter_bridge/ebt_mark_t.h +++ b/include/linux/netfilter_bridge/ebt_mark_t.h | |||
@@ -13,8 +13,7 @@ | |||
13 | #define MARK_AND_VALUE (0xffffffd0) | 13 | #define MARK_AND_VALUE (0xffffffd0) |
14 | #define MARK_XOR_VALUE (0xffffffc0) | 14 | #define MARK_XOR_VALUE (0xffffffc0) |
15 | 15 | ||
16 | struct ebt_mark_t_info | 16 | struct ebt_mark_t_info { |
17 | { | ||
18 | unsigned long mark; | 17 | unsigned long mark; |
19 | /* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */ | 18 | /* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */ |
20 | int target; | 19 | int target; |
diff --git a/include/linux/netfilter_bridge/ebt_nat.h b/include/linux/netfilter_bridge/ebt_nat.h index 435b886a51aa..5e74e3b03bd6 100644 --- a/include/linux/netfilter_bridge/ebt_nat.h +++ b/include/linux/netfilter_bridge/ebt_nat.h | |||
@@ -2,8 +2,7 @@ | |||
2 | #define __LINUX_BRIDGE_EBT_NAT_H | 2 | #define __LINUX_BRIDGE_EBT_NAT_H |
3 | 3 | ||
4 | #define NAT_ARP_BIT (0x00000010) | 4 | #define NAT_ARP_BIT (0x00000010) |
5 | struct ebt_nat_info | 5 | struct ebt_nat_info { |
6 | { | ||
7 | unsigned char mac[ETH_ALEN]; | 6 | unsigned char mac[ETH_ALEN]; |
8 | /* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */ | 7 | /* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */ |
9 | int target; | 8 | int target; |
diff --git a/include/linux/netfilter_bridge/ebt_pkttype.h b/include/linux/netfilter_bridge/ebt_pkttype.h index 0d64bbb29c66..51a799840931 100644 --- a/include/linux/netfilter_bridge/ebt_pkttype.h +++ b/include/linux/netfilter_bridge/ebt_pkttype.h | |||
@@ -1,8 +1,7 @@ | |||
1 | #ifndef __LINUX_BRIDGE_EBT_PKTTYPE_H | 1 | #ifndef __LINUX_BRIDGE_EBT_PKTTYPE_H |
2 | #define __LINUX_BRIDGE_EBT_PKTTYPE_H | 2 | #define __LINUX_BRIDGE_EBT_PKTTYPE_H |
3 | 3 | ||
4 | struct ebt_pkttype_info | 4 | struct ebt_pkttype_info { |
5 | { | ||
6 | uint8_t pkt_type; | 5 | uint8_t pkt_type; |
7 | uint8_t invert; | 6 | uint8_t invert; |
8 | }; | 7 | }; |
diff --git a/include/linux/netfilter_bridge/ebt_redirect.h b/include/linux/netfilter_bridge/ebt_redirect.h index 5c67990fce39..dd9622ce8488 100644 --- a/include/linux/netfilter_bridge/ebt_redirect.h +++ b/include/linux/netfilter_bridge/ebt_redirect.h | |||
@@ -1,8 +1,7 @@ | |||
1 | #ifndef __LINUX_BRIDGE_EBT_REDIRECT_H | 1 | #ifndef __LINUX_BRIDGE_EBT_REDIRECT_H |
2 | #define __LINUX_BRIDGE_EBT_REDIRECT_H | 2 | #define __LINUX_BRIDGE_EBT_REDIRECT_H |
3 | 3 | ||
4 | struct ebt_redirect_info | 4 | struct ebt_redirect_info { |
5 | { | ||
6 | /* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */ | 5 | /* EBT_ACCEPT, EBT_DROP, EBT_CONTINUE or EBT_RETURN */ |
7 | int target; | 6 | int target; |
8 | }; | 7 | }; |
diff --git a/include/linux/netfilter_bridge/ebt_stp.h b/include/linux/netfilter_bridge/ebt_stp.h index e5fd67850f4d..e503a0aa2728 100644 --- a/include/linux/netfilter_bridge/ebt_stp.h +++ b/include/linux/netfilter_bridge/ebt_stp.h | |||
@@ -20,8 +20,7 @@ | |||
20 | 20 | ||
21 | #define EBT_STP_MATCH "stp" | 21 | #define EBT_STP_MATCH "stp" |
22 | 22 | ||
23 | struct ebt_stp_config_info | 23 | struct ebt_stp_config_info { |
24 | { | ||
25 | uint8_t flags; | 24 | uint8_t flags; |
26 | uint16_t root_priol, root_priou; | 25 | uint16_t root_priol, root_priou; |
27 | char root_addr[6], root_addrmsk[6]; | 26 | char root_addr[6], root_addrmsk[6]; |
@@ -35,8 +34,7 @@ struct ebt_stp_config_info | |||
35 | uint16_t forward_delayl, forward_delayu; | 34 | uint16_t forward_delayl, forward_delayu; |
36 | }; | 35 | }; |
37 | 36 | ||
38 | struct ebt_stp_info | 37 | struct ebt_stp_info { |
39 | { | ||
40 | uint8_t type; | 38 | uint8_t type; |
41 | struct ebt_stp_config_info config; | 39 | struct ebt_stp_config_info config; |
42 | uint16_t bitmask; | 40 | uint16_t bitmask; |
diff --git a/include/linux/netfilter_bridge/ebtables.h b/include/linux/netfilter_bridge/ebtables.h index ea281e6a2048..3cc40c131cc3 100644 --- a/include/linux/netfilter_bridge/ebtables.h +++ b/include/linux/netfilter_bridge/ebtables.h | |||
@@ -34,14 +34,12 @@ | |||
34 | struct xt_match; | 34 | struct xt_match; |
35 | struct xt_target; | 35 | struct xt_target; |
36 | 36 | ||
37 | struct ebt_counter | 37 | struct ebt_counter { |
38 | { | ||
39 | uint64_t pcnt; | 38 | uint64_t pcnt; |
40 | uint64_t bcnt; | 39 | uint64_t bcnt; |
41 | }; | 40 | }; |
42 | 41 | ||
43 | struct ebt_replace | 42 | struct ebt_replace { |
44 | { | ||
45 | char name[EBT_TABLE_MAXNAMELEN]; | 43 | char name[EBT_TABLE_MAXNAMELEN]; |
46 | unsigned int valid_hooks; | 44 | unsigned int valid_hooks; |
47 | /* nr of rules in the table */ | 45 | /* nr of rules in the table */ |
@@ -57,8 +55,7 @@ struct ebt_replace | |||
57 | char __user *entries; | 55 | char __user *entries; |
58 | }; | 56 | }; |
59 | 57 | ||
60 | struct ebt_replace_kernel | 58 | struct ebt_replace_kernel { |
61 | { | ||
62 | char name[EBT_TABLE_MAXNAMELEN]; | 59 | char name[EBT_TABLE_MAXNAMELEN]; |
63 | unsigned int valid_hooks; | 60 | unsigned int valid_hooks; |
64 | /* nr of rules in the table */ | 61 | /* nr of rules in the table */ |
@@ -120,8 +117,7 @@ struct ebt_entries { | |||
120 | #define EBT_INV_MASK (EBT_IPROTO | EBT_IIN | EBT_IOUT | EBT_ILOGICALIN \ | 117 | #define EBT_INV_MASK (EBT_IPROTO | EBT_IIN | EBT_IOUT | EBT_ILOGICALIN \ |
121 | | EBT_ILOGICALOUT | EBT_ISOURCE | EBT_IDEST) | 118 | | EBT_ILOGICALOUT | EBT_ISOURCE | EBT_IDEST) |
122 | 119 | ||
123 | struct ebt_entry_match | 120 | struct ebt_entry_match { |
124 | { | ||
125 | union { | 121 | union { |
126 | char name[EBT_FUNCTION_MAXNAMELEN]; | 122 | char name[EBT_FUNCTION_MAXNAMELEN]; |
127 | struct xt_match *match; | 123 | struct xt_match *match; |
@@ -131,8 +127,7 @@ struct ebt_entry_match | |||
131 | unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace)))); | 127 | unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace)))); |
132 | }; | 128 | }; |
133 | 129 | ||
134 | struct ebt_entry_watcher | 130 | struct ebt_entry_watcher { |
135 | { | ||
136 | union { | 131 | union { |
137 | char name[EBT_FUNCTION_MAXNAMELEN]; | 132 | char name[EBT_FUNCTION_MAXNAMELEN]; |
138 | struct xt_target *watcher; | 133 | struct xt_target *watcher; |
@@ -142,8 +137,7 @@ struct ebt_entry_watcher | |||
142 | unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace)))); | 137 | unsigned char data[0] __attribute__ ((aligned (__alignof__(struct ebt_replace)))); |
143 | }; | 138 | }; |
144 | 139 | ||
145 | struct ebt_entry_target | 140 | struct ebt_entry_target { |
146 | { | ||
147 | union { | 141 | union { |
148 | char name[EBT_FUNCTION_MAXNAMELEN]; | 142 | char name[EBT_FUNCTION_MAXNAMELEN]; |
149 | struct xt_target *target; | 143 | struct xt_target *target; |
@@ -154,8 +148,7 @@ struct ebt_entry_target | |||
154 | }; | 148 | }; |
155 | 149 | ||
156 | #define EBT_STANDARD_TARGET "standard" | 150 | #define EBT_STANDARD_TARGET "standard" |
157 | struct ebt_standard_target | 151 | struct ebt_standard_target { |
158 | { | ||
159 | struct ebt_entry_target target; | 152 | struct ebt_entry_target target; |
160 | int verdict; | 153 | int verdict; |
161 | }; | 154 | }; |
@@ -206,8 +199,7 @@ struct ebt_entry { | |||
206 | #define EBT_MATCH 0 | 199 | #define EBT_MATCH 0 |
207 | #define EBT_NOMATCH 1 | 200 | #define EBT_NOMATCH 1 |
208 | 201 | ||
209 | struct ebt_match | 202 | struct ebt_match { |
210 | { | ||
211 | struct list_head list; | 203 | struct list_head list; |
212 | const char name[EBT_FUNCTION_MAXNAMELEN]; | 204 | const char name[EBT_FUNCTION_MAXNAMELEN]; |
213 | bool (*match)(const struct sk_buff *skb, const struct net_device *in, | 205 | bool (*match)(const struct sk_buff *skb, const struct net_device *in, |
@@ -224,8 +216,7 @@ struct ebt_match | |||
224 | struct module *me; | 216 | struct module *me; |
225 | }; | 217 | }; |
226 | 218 | ||
227 | struct ebt_watcher | 219 | struct ebt_watcher { |
228 | { | ||
229 | struct list_head list; | 220 | struct list_head list; |
230 | const char name[EBT_FUNCTION_MAXNAMELEN]; | 221 | const char name[EBT_FUNCTION_MAXNAMELEN]; |
231 | unsigned int (*target)(struct sk_buff *skb, | 222 | unsigned int (*target)(struct sk_buff *skb, |
@@ -242,8 +233,7 @@ struct ebt_watcher | |||
242 | struct module *me; | 233 | struct module *me; |
243 | }; | 234 | }; |
244 | 235 | ||
245 | struct ebt_target | 236 | struct ebt_target { |
246 | { | ||
247 | struct list_head list; | 237 | struct list_head list; |
248 | const char name[EBT_FUNCTION_MAXNAMELEN]; | 238 | const char name[EBT_FUNCTION_MAXNAMELEN]; |
249 | /* returns one of the standard EBT_* verdicts */ | 239 | /* returns one of the standard EBT_* verdicts */ |
@@ -262,15 +252,13 @@ struct ebt_target | |||
262 | }; | 252 | }; |
263 | 253 | ||
264 | /* used for jumping from and into user defined chains (udc) */ | 254 | /* used for jumping from and into user defined chains (udc) */ |
265 | struct ebt_chainstack | 255 | struct ebt_chainstack { |
266 | { | ||
267 | struct ebt_entries *chaininfo; /* pointer to chain data */ | 256 | struct ebt_entries *chaininfo; /* pointer to chain data */ |
268 | struct ebt_entry *e; /* pointer to entry data */ | 257 | struct ebt_entry *e; /* pointer to entry data */ |
269 | unsigned int n; /* n'th entry */ | 258 | unsigned int n; /* n'th entry */ |
270 | }; | 259 | }; |
271 | 260 | ||
272 | struct ebt_table_info | 261 | struct ebt_table_info { |
273 | { | ||
274 | /* total size of the entries */ | 262 | /* total size of the entries */ |
275 | unsigned int entries_size; | 263 | unsigned int entries_size; |
276 | unsigned int nentries; | 264 | unsigned int nentries; |
@@ -282,8 +270,7 @@ struct ebt_table_info | |||
282 | struct ebt_counter counters[0] ____cacheline_aligned; | 270 | struct ebt_counter counters[0] ____cacheline_aligned; |
283 | }; | 271 | }; |
284 | 272 | ||
285 | struct ebt_table | 273 | struct ebt_table { |
286 | { | ||
287 | struct list_head list; | 274 | struct list_head list; |
288 | char name[EBT_TABLE_MAXNAMELEN]; | 275 | char name[EBT_TABLE_MAXNAMELEN]; |
289 | struct ebt_replace_kernel *table; | 276 | struct ebt_replace_kernel *table; |
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h index 61fafc868a7b..27b3f5807305 100644 --- a/include/linux/netfilter_ipv4/ip_tables.h +++ b/include/linux/netfilter_ipv4/ip_tables.h | |||
@@ -76,8 +76,7 @@ struct ipt_ip { | |||
76 | /* This structure defines each of the firewall rules. Consists of 3 | 76 | /* This structure defines each of the firewall rules. Consists of 3 |
77 | parts which are 1) general IP header stuff 2) match specific | 77 | parts which are 1) general IP header stuff 2) match specific |
78 | stuff 3) the target to perform if the rule matches */ | 78 | stuff 3) the target to perform if the rule matches */ |
79 | struct ipt_entry | 79 | struct ipt_entry { |
80 | { | ||
81 | struct ipt_ip ip; | 80 | struct ipt_ip ip; |
82 | 81 | ||
83 | /* Mark with fields that we care about. */ | 82 | /* Mark with fields that we care about. */ |
@@ -135,8 +134,7 @@ struct ipt_entry | |||
135 | #define IPT_UDP_INV_MASK XT_UDP_INV_MASK | 134 | #define IPT_UDP_INV_MASK XT_UDP_INV_MASK |
136 | 135 | ||
137 | /* ICMP matching stuff */ | 136 | /* ICMP matching stuff */ |
138 | struct ipt_icmp | 137 | struct ipt_icmp { |
139 | { | ||
140 | u_int8_t type; /* type to match */ | 138 | u_int8_t type; /* type to match */ |
141 | u_int8_t code[2]; /* range of code */ | 139 | u_int8_t code[2]; /* range of code */ |
142 | u_int8_t invflags; /* Inverse flags */ | 140 | u_int8_t invflags; /* Inverse flags */ |
@@ -146,8 +144,7 @@ struct ipt_icmp | |||
146 | #define IPT_ICMP_INV 0x01 /* Invert the sense of type/code test */ | 144 | #define IPT_ICMP_INV 0x01 /* Invert the sense of type/code test */ |
147 | 145 | ||
148 | /* The argument to IPT_SO_GET_INFO */ | 146 | /* The argument to IPT_SO_GET_INFO */ |
149 | struct ipt_getinfo | 147 | struct ipt_getinfo { |
150 | { | ||
151 | /* Which table: caller fills this in. */ | 148 | /* Which table: caller fills this in. */ |
152 | char name[IPT_TABLE_MAXNAMELEN]; | 149 | char name[IPT_TABLE_MAXNAMELEN]; |
153 | 150 | ||
@@ -169,8 +166,7 @@ struct ipt_getinfo | |||
169 | }; | 166 | }; |
170 | 167 | ||
171 | /* The argument to IPT_SO_SET_REPLACE. */ | 168 | /* The argument to IPT_SO_SET_REPLACE. */ |
172 | struct ipt_replace | 169 | struct ipt_replace { |
173 | { | ||
174 | /* Which table. */ | 170 | /* Which table. */ |
175 | char name[IPT_TABLE_MAXNAMELEN]; | 171 | char name[IPT_TABLE_MAXNAMELEN]; |
176 | 172 | ||
@@ -204,8 +200,7 @@ struct ipt_replace | |||
204 | #define ipt_counters_info xt_counters_info | 200 | #define ipt_counters_info xt_counters_info |
205 | 201 | ||
206 | /* The argument to IPT_SO_GET_ENTRIES. */ | 202 | /* The argument to IPT_SO_GET_ENTRIES. */ |
207 | struct ipt_get_entries | 203 | struct ipt_get_entries { |
208 | { | ||
209 | /* Which table: user fills this in. */ | 204 | /* Which table: user fills this in. */ |
210 | char name[IPT_TABLE_MAXNAMELEN]; | 205 | char name[IPT_TABLE_MAXNAMELEN]; |
211 | 206 | ||
@@ -250,20 +245,17 @@ extern struct xt_table *ipt_register_table(struct net *net, | |||
250 | extern void ipt_unregister_table(struct xt_table *table); | 245 | extern void ipt_unregister_table(struct xt_table *table); |
251 | 246 | ||
252 | /* Standard entry. */ | 247 | /* Standard entry. */ |
253 | struct ipt_standard | 248 | struct ipt_standard { |
254 | { | ||
255 | struct ipt_entry entry; | 249 | struct ipt_entry entry; |
256 | struct ipt_standard_target target; | 250 | struct ipt_standard_target target; |
257 | }; | 251 | }; |
258 | 252 | ||
259 | struct ipt_error_target | 253 | struct ipt_error_target { |
260 | { | ||
261 | struct ipt_entry_target target; | 254 | struct ipt_entry_target target; |
262 | char errorname[IPT_FUNCTION_MAXNAMELEN]; | 255 | char errorname[IPT_FUNCTION_MAXNAMELEN]; |
263 | }; | 256 | }; |
264 | 257 | ||
265 | struct ipt_error | 258 | struct ipt_error { |
266 | { | ||
267 | struct ipt_entry entry; | 259 | struct ipt_entry entry; |
268 | struct ipt_error_target target; | 260 | struct ipt_error_target target; |
269 | }; | 261 | }; |
@@ -301,8 +293,7 @@ extern unsigned int ipt_do_table(struct sk_buff *skb, | |||
301 | #ifdef CONFIG_COMPAT | 293 | #ifdef CONFIG_COMPAT |
302 | #include <net/compat.h> | 294 | #include <net/compat.h> |
303 | 295 | ||
304 | struct compat_ipt_entry | 296 | struct compat_ipt_entry { |
305 | { | ||
306 | struct ipt_ip ip; | 297 | struct ipt_ip ip; |
307 | compat_uint_t nfcache; | 298 | compat_uint_t nfcache; |
308 | u_int16_t target_offset; | 299 | u_int16_t target_offset; |
diff --git a/include/linux/netfilter_ipv4/ipt_SAME.h b/include/linux/netfilter_ipv4/ipt_SAME.h index be6e682a85ec..2529660c5b38 100644 --- a/include/linux/netfilter_ipv4/ipt_SAME.h +++ b/include/linux/netfilter_ipv4/ipt_SAME.h | |||
@@ -5,8 +5,7 @@ | |||
5 | 5 | ||
6 | #define IPT_SAME_NODST 0x01 | 6 | #define IPT_SAME_NODST 0x01 |
7 | 7 | ||
8 | struct ipt_same_info | 8 | struct ipt_same_info { |
9 | { | ||
10 | unsigned char info; | 9 | unsigned char info; |
11 | u_int32_t rangesize; | 10 | u_int32_t rangesize; |
12 | u_int32_t ipnum; | 11 | u_int32_t ipnum; |
diff --git a/include/linux/netfilter_ipv4/ipt_ah.h b/include/linux/netfilter_ipv4/ipt_ah.h index 7b9a2ac7adb9..2e555b4d05e3 100644 --- a/include/linux/netfilter_ipv4/ipt_ah.h +++ b/include/linux/netfilter_ipv4/ipt_ah.h | |||
@@ -1,8 +1,7 @@ | |||
1 | #ifndef _IPT_AH_H | 1 | #ifndef _IPT_AH_H |
2 | #define _IPT_AH_H | 2 | #define _IPT_AH_H |
3 | 3 | ||
4 | struct ipt_ah | 4 | struct ipt_ah { |
5 | { | ||
6 | u_int32_t spis[2]; /* Security Parameter Index */ | 5 | u_int32_t spis[2]; /* Security Parameter Index */ |
7 | u_int8_t invflags; /* Inverse flags */ | 6 | u_int8_t invflags; /* Inverse flags */ |
8 | }; | 7 | }; |
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h index a64e1451ac38..b31050d20ae4 100644 --- a/include/linux/netfilter_ipv6/ip6_tables.h +++ b/include/linux/netfilter_ipv6/ip6_tables.h | |||
@@ -88,8 +88,7 @@ struct ip6t_ip6 { | |||
88 | /* This structure defines each of the firewall rules. Consists of 3 | 88 | /* This structure defines each of the firewall rules. Consists of 3 |
89 | parts which are 1) general IP header stuff 2) match specific | 89 | parts which are 1) general IP header stuff 2) match specific |
90 | stuff 3) the target to perform if the rule matches */ | 90 | stuff 3) the target to perform if the rule matches */ |
91 | struct ip6t_entry | 91 | struct ip6t_entry { |
92 | { | ||
93 | struct ip6t_ip6 ipv6; | 92 | struct ip6t_ip6 ipv6; |
94 | 93 | ||
95 | /* Mark with fields that we care about. */ | 94 | /* Mark with fields that we care about. */ |
@@ -111,20 +110,17 @@ struct ip6t_entry | |||
111 | }; | 110 | }; |
112 | 111 | ||
113 | /* Standard entry */ | 112 | /* Standard entry */ |
114 | struct ip6t_standard | 113 | struct ip6t_standard { |
115 | { | ||
116 | struct ip6t_entry entry; | 114 | struct ip6t_entry entry; |
117 | struct ip6t_standard_target target; | 115 | struct ip6t_standard_target target; |
118 | }; | 116 | }; |
119 | 117 | ||
120 | struct ip6t_error_target | 118 | struct ip6t_error_target { |
121 | { | ||
122 | struct ip6t_entry_target target; | 119 | struct ip6t_entry_target target; |
123 | char errorname[IP6T_FUNCTION_MAXNAMELEN]; | 120 | char errorname[IP6T_FUNCTION_MAXNAMELEN]; |
124 | }; | 121 | }; |
125 | 122 | ||
126 | struct ip6t_error | 123 | struct ip6t_error { |
127 | { | ||
128 | struct ip6t_entry entry; | 124 | struct ip6t_entry entry; |
129 | struct ip6t_error_target target; | 125 | struct ip6t_error_target target; |
130 | }; | 126 | }; |
@@ -195,8 +191,7 @@ struct ip6t_error | |||
195 | #define IP6T_UDP_INV_MASK XT_UDP_INV_MASK | 191 | #define IP6T_UDP_INV_MASK XT_UDP_INV_MASK |
196 | 192 | ||
197 | /* ICMP matching stuff */ | 193 | /* ICMP matching stuff */ |
198 | struct ip6t_icmp | 194 | struct ip6t_icmp { |
199 | { | ||
200 | u_int8_t type; /* type to match */ | 195 | u_int8_t type; /* type to match */ |
201 | u_int8_t code[2]; /* range of code */ | 196 | u_int8_t code[2]; /* range of code */ |
202 | u_int8_t invflags; /* Inverse flags */ | 197 | u_int8_t invflags; /* Inverse flags */ |
@@ -206,8 +201,7 @@ struct ip6t_icmp | |||
206 | #define IP6T_ICMP_INV 0x01 /* Invert the sense of type/code test */ | 201 | #define IP6T_ICMP_INV 0x01 /* Invert the sense of type/code test */ |
207 | 202 | ||
208 | /* The argument to IP6T_SO_GET_INFO */ | 203 | /* The argument to IP6T_SO_GET_INFO */ |
209 | struct ip6t_getinfo | 204 | struct ip6t_getinfo { |
210 | { | ||
211 | /* Which table: caller fills this in. */ | 205 | /* Which table: caller fills this in. */ |
212 | char name[IP6T_TABLE_MAXNAMELEN]; | 206 | char name[IP6T_TABLE_MAXNAMELEN]; |
213 | 207 | ||
@@ -229,8 +223,7 @@ struct ip6t_getinfo | |||
229 | }; | 223 | }; |
230 | 224 | ||
231 | /* The argument to IP6T_SO_SET_REPLACE. */ | 225 | /* The argument to IP6T_SO_SET_REPLACE. */ |
232 | struct ip6t_replace | 226 | struct ip6t_replace { |
233 | { | ||
234 | /* Which table. */ | 227 | /* Which table. */ |
235 | char name[IP6T_TABLE_MAXNAMELEN]; | 228 | char name[IP6T_TABLE_MAXNAMELEN]; |
236 | 229 | ||
@@ -264,8 +257,7 @@ struct ip6t_replace | |||
264 | #define ip6t_counters_info xt_counters_info | 257 | #define ip6t_counters_info xt_counters_info |
265 | 258 | ||
266 | /* The argument to IP6T_SO_GET_ENTRIES. */ | 259 | /* The argument to IP6T_SO_GET_ENTRIES. */ |
267 | struct ip6t_get_entries | 260 | struct ip6t_get_entries { |
268 | { | ||
269 | /* Which table: user fills this in. */ | 261 | /* Which table: user fills this in. */ |
270 | char name[IP6T_TABLE_MAXNAMELEN]; | 262 | char name[IP6T_TABLE_MAXNAMELEN]; |
271 | 263 | ||
@@ -330,8 +322,7 @@ extern int ip6_masked_addrcmp(const struct in6_addr *addr1, | |||
330 | #ifdef CONFIG_COMPAT | 322 | #ifdef CONFIG_COMPAT |
331 | #include <net/compat.h> | 323 | #include <net/compat.h> |
332 | 324 | ||
333 | struct compat_ip6t_entry | 325 | struct compat_ip6t_entry { |
334 | { | ||
335 | struct ip6t_ip6 ipv6; | 326 | struct ip6t_ip6 ipv6; |
336 | compat_uint_t nfcache; | 327 | compat_uint_t nfcache; |
337 | u_int16_t target_offset; | 328 | u_int16_t target_offset; |
diff --git a/include/linux/netfilter_ipv6/ip6t_ah.h b/include/linux/netfilter_ipv6/ip6t_ah.h index 8531879eb464..17a745cfb2c7 100644 --- a/include/linux/netfilter_ipv6/ip6t_ah.h +++ b/include/linux/netfilter_ipv6/ip6t_ah.h | |||
@@ -1,8 +1,7 @@ | |||
1 | #ifndef _IP6T_AH_H | 1 | #ifndef _IP6T_AH_H |
2 | #define _IP6T_AH_H | 2 | #define _IP6T_AH_H |
3 | 3 | ||
4 | struct ip6t_ah | 4 | struct ip6t_ah { |
5 | { | ||
6 | u_int32_t spis[2]; /* Security Parameter Index */ | 5 | u_int32_t spis[2]; /* Security Parameter Index */ |
7 | u_int32_t hdrlen; /* Header Length */ | 6 | u_int32_t hdrlen; /* Header Length */ |
8 | u_int8_t hdrres; /* Test of the Reserved Filed */ | 7 | u_int8_t hdrres; /* Test of the Reserved Filed */ |
diff --git a/include/linux/netfilter_ipv6/ip6t_frag.h b/include/linux/netfilter_ipv6/ip6t_frag.h index 66070a0d6dfc..3724d0850920 100644 --- a/include/linux/netfilter_ipv6/ip6t_frag.h +++ b/include/linux/netfilter_ipv6/ip6t_frag.h | |||
@@ -1,8 +1,7 @@ | |||
1 | #ifndef _IP6T_FRAG_H | 1 | #ifndef _IP6T_FRAG_H |
2 | #define _IP6T_FRAG_H | 2 | #define _IP6T_FRAG_H |
3 | 3 | ||
4 | struct ip6t_frag | 4 | struct ip6t_frag { |
5 | { | ||
6 | u_int32_t ids[2]; /* Security Parameter Index */ | 5 | u_int32_t ids[2]; /* Security Parameter Index */ |
7 | u_int32_t hdrlen; /* Header Length */ | 6 | u_int32_t hdrlen; /* Header Length */ |
8 | u_int8_t flags; /* */ | 7 | u_int8_t flags; /* */ |
diff --git a/include/linux/netfilter_ipv6/ip6t_ipv6header.h b/include/linux/netfilter_ipv6/ip6t_ipv6header.h index 51c53fc9c44a..01dfd445596a 100644 --- a/include/linux/netfilter_ipv6/ip6t_ipv6header.h +++ b/include/linux/netfilter_ipv6/ip6t_ipv6header.h | |||
@@ -8,8 +8,7 @@ on whether they contain certain headers */ | |||
8 | #ifndef __IPV6HEADER_H | 8 | #ifndef __IPV6HEADER_H |
9 | #define __IPV6HEADER_H | 9 | #define __IPV6HEADER_H |
10 | 10 | ||
11 | struct ip6t_ipv6header_info | 11 | struct ip6t_ipv6header_info { |
12 | { | ||
13 | u_int8_t matchflags; | 12 | u_int8_t matchflags; |
14 | u_int8_t invflags; | 13 | u_int8_t invflags; |
15 | u_int8_t modeflag; | 14 | u_int8_t modeflag; |
diff --git a/include/linux/netfilter_ipv6/ip6t_mh.h b/include/linux/netfilter_ipv6/ip6t_mh.h index b9ca9a5f74d0..18549bca2d1f 100644 --- a/include/linux/netfilter_ipv6/ip6t_mh.h +++ b/include/linux/netfilter_ipv6/ip6t_mh.h | |||
@@ -2,8 +2,7 @@ | |||
2 | #define _IP6T_MH_H | 2 | #define _IP6T_MH_H |
3 | 3 | ||
4 | /* MH matching stuff */ | 4 | /* MH matching stuff */ |
5 | struct ip6t_mh | 5 | struct ip6t_mh { |
6 | { | ||
7 | u_int8_t types[2]; /* MH type range */ | 6 | u_int8_t types[2]; /* MH type range */ |
8 | u_int8_t invflags; /* Inverse flags */ | 7 | u_int8_t invflags; /* Inverse flags */ |
9 | }; | 8 | }; |
diff --git a/include/linux/netfilter_ipv6/ip6t_opts.h b/include/linux/netfilter_ipv6/ip6t_opts.h index a07e36380ae8..62d89bcd9f9c 100644 --- a/include/linux/netfilter_ipv6/ip6t_opts.h +++ b/include/linux/netfilter_ipv6/ip6t_opts.h | |||
@@ -3,8 +3,7 @@ | |||
3 | 3 | ||
4 | #define IP6T_OPTS_OPTSNR 16 | 4 | #define IP6T_OPTS_OPTSNR 16 |
5 | 5 | ||
6 | struct ip6t_opts | 6 | struct ip6t_opts { |
7 | { | ||
8 | u_int32_t hdrlen; /* Header Length */ | 7 | u_int32_t hdrlen; /* Header Length */ |
9 | u_int8_t flags; /* */ | 8 | u_int8_t flags; /* */ |
10 | u_int8_t invflags; /* Inverse flags */ | 9 | u_int8_t invflags; /* Inverse flags */ |
diff --git a/include/linux/netfilter_ipv6/ip6t_rt.h b/include/linux/netfilter_ipv6/ip6t_rt.h index 52156023e8db..ab91bfd2cd00 100644 --- a/include/linux/netfilter_ipv6/ip6t_rt.h +++ b/include/linux/netfilter_ipv6/ip6t_rt.h | |||
@@ -5,8 +5,7 @@ | |||
5 | 5 | ||
6 | #define IP6T_RT_HOPS 16 | 6 | #define IP6T_RT_HOPS 16 |
7 | 7 | ||
8 | struct ip6t_rt | 8 | struct ip6t_rt { |
9 | { | ||
10 | u_int32_t rt_type; /* Routing Type */ | 9 | u_int32_t rt_type; /* Routing Type */ |
11 | u_int32_t segsleft[2]; /* Segments Left */ | 10 | u_int32_t segsleft[2]; /* Segments Left */ |
12 | u_int32_t hdrlen; /* Header Length */ | 11 | u_int32_t hdrlen; /* Header Length */ |
diff --git a/include/linux/netlink.h b/include/linux/netlink.h index ab5d3126831f..fde27c017326 100644 --- a/include/linux/netlink.h +++ b/include/linux/netlink.h | |||
@@ -29,16 +29,14 @@ | |||
29 | 29 | ||
30 | struct net; | 30 | struct net; |
31 | 31 | ||
32 | struct sockaddr_nl | 32 | struct sockaddr_nl { |
33 | { | ||
34 | sa_family_t nl_family; /* AF_NETLINK */ | 33 | sa_family_t nl_family; /* AF_NETLINK */ |
35 | unsigned short nl_pad; /* zero */ | 34 | unsigned short nl_pad; /* zero */ |
36 | __u32 nl_pid; /* port ID */ | 35 | __u32 nl_pid; /* port ID */ |
37 | __u32 nl_groups; /* multicast groups mask */ | 36 | __u32 nl_groups; /* multicast groups mask */ |
38 | }; | 37 | }; |
39 | 38 | ||
40 | struct nlmsghdr | 39 | struct nlmsghdr { |
41 | { | ||
42 | __u32 nlmsg_len; /* Length of message including header */ | 40 | __u32 nlmsg_len; /* Length of message including header */ |
43 | __u16 nlmsg_type; /* Message content */ | 41 | __u16 nlmsg_type; /* Message content */ |
44 | __u16 nlmsg_flags; /* Additional flags */ | 42 | __u16 nlmsg_flags; /* Additional flags */ |
@@ -94,8 +92,7 @@ struct nlmsghdr | |||
94 | 92 | ||
95 | #define NLMSG_MIN_TYPE 0x10 /* < 0x10: reserved control messages */ | 93 | #define NLMSG_MIN_TYPE 0x10 /* < 0x10: reserved control messages */ |
96 | 94 | ||
97 | struct nlmsgerr | 95 | struct nlmsgerr { |
98 | { | ||
99 | int error; | 96 | int error; |
100 | struct nlmsghdr msg; | 97 | struct nlmsghdr msg; |
101 | }; | 98 | }; |
@@ -106,8 +103,7 @@ struct nlmsgerr | |||
106 | #define NETLINK_BROADCAST_ERROR 4 | 103 | #define NETLINK_BROADCAST_ERROR 4 |
107 | #define NETLINK_NO_ENOBUFS 5 | 104 | #define NETLINK_NO_ENOBUFS 5 |
108 | 105 | ||
109 | struct nl_pktinfo | 106 | struct nl_pktinfo { |
110 | { | ||
111 | __u32 group; | 107 | __u32 group; |
112 | }; | 108 | }; |
113 | 109 | ||
@@ -127,8 +123,7 @@ enum { | |||
127 | * <-------------- nlattr->nla_len --------------> | 123 | * <-------------- nlattr->nla_len --------------> |
128 | */ | 124 | */ |
129 | 125 | ||
130 | struct nlattr | 126 | struct nlattr { |
131 | { | ||
132 | __u16 nla_len; | 127 | __u16 nla_len; |
133 | __u16 nla_type; | 128 | __u16 nla_type; |
134 | }; | 129 | }; |
@@ -161,8 +156,7 @@ static inline struct nlmsghdr *nlmsg_hdr(const struct sk_buff *skb) | |||
161 | return (struct nlmsghdr *)skb->data; | 156 | return (struct nlmsghdr *)skb->data; |
162 | } | 157 | } |
163 | 158 | ||
164 | struct netlink_skb_parms | 159 | struct netlink_skb_parms { |
165 | { | ||
166 | struct ucred creds; /* Skb credentials */ | 160 | struct ucred creds; /* Skb credentials */ |
167 | __u32 pid; | 161 | __u32 pid; |
168 | __u32 dst_group; | 162 | __u32 dst_group; |
@@ -220,8 +214,7 @@ int netlink_sendskb(struct sock *sk, struct sk_buff *skb); | |||
220 | #define NLMSG_DEFAULT_SIZE (NLMSG_GOODSIZE - NLMSG_HDRLEN) | 214 | #define NLMSG_DEFAULT_SIZE (NLMSG_GOODSIZE - NLMSG_HDRLEN) |
221 | 215 | ||
222 | 216 | ||
223 | struct netlink_callback | 217 | struct netlink_callback { |
224 | { | ||
225 | struct sk_buff *skb; | 218 | struct sk_buff *skb; |
226 | const struct nlmsghdr *nlh; | 219 | const struct nlmsghdr *nlh; |
227 | int (*dump)(struct sk_buff * skb, | 220 | int (*dump)(struct sk_buff * skb, |
@@ -231,8 +224,7 @@ struct netlink_callback | |||
231 | long args[6]; | 224 | long args[6]; |
232 | }; | 225 | }; |
233 | 226 | ||
234 | struct netlink_notify | 227 | struct netlink_notify { |
235 | { | ||
236 | struct net *net; | 228 | struct net *net; |
237 | int pid; | 229 | int pid; |
238 | int protocol; | 230 | int protocol; |
diff --git a/include/linux/nilfs2_fs.h b/include/linux/nilfs2_fs.h index ce520402e840..3fe02cf8b65a 100644 --- a/include/linux/nilfs2_fs.h +++ b/include/linux/nilfs2_fs.h | |||
@@ -151,6 +151,8 @@ struct nilfs_super_root { | |||
151 | #define NILFS_MOUNT_BARRIER 0x1000 /* Use block barriers */ | 151 | #define NILFS_MOUNT_BARRIER 0x1000 /* Use block barriers */ |
152 | #define NILFS_MOUNT_STRICT_ORDER 0x2000 /* Apply strict in-order | 152 | #define NILFS_MOUNT_STRICT_ORDER 0x2000 /* Apply strict in-order |
153 | semantics also for data */ | 153 | semantics also for data */ |
154 | #define NILFS_MOUNT_NORECOVERY 0x4000 /* Disable write access during | ||
155 | mount-time recovery */ | ||
154 | 156 | ||
155 | 157 | ||
156 | /** | 158 | /** |
@@ -403,6 +405,28 @@ struct nilfs_segment_summary { | |||
403 | #define NILFS_SS_GC 0x0010 /* segment written for cleaner operation */ | 405 | #define NILFS_SS_GC 0x0010 /* segment written for cleaner operation */ |
404 | 406 | ||
405 | /** | 407 | /** |
408 | * struct nilfs_btree_node - B-tree node | ||
409 | * @bn_flags: flags | ||
410 | * @bn_level: level | ||
411 | * @bn_nchildren: number of children | ||
412 | * @bn_pad: padding | ||
413 | */ | ||
414 | struct nilfs_btree_node { | ||
415 | __u8 bn_flags; | ||
416 | __u8 bn_level; | ||
417 | __le16 bn_nchildren; | ||
418 | __le32 bn_pad; | ||
419 | }; | ||
420 | |||
421 | /* flags */ | ||
422 | #define NILFS_BTREE_NODE_ROOT 0x01 | ||
423 | |||
424 | /* level */ | ||
425 | #define NILFS_BTREE_LEVEL_DATA 0 | ||
426 | #define NILFS_BTREE_LEVEL_NODE_MIN (NILFS_BTREE_LEVEL_DATA + 1) | ||
427 | #define NILFS_BTREE_LEVEL_MAX 14 | ||
428 | |||
429 | /** | ||
406 | * struct nilfs_palloc_group_desc - block group descriptor | 430 | * struct nilfs_palloc_group_desc - block group descriptor |
407 | * @pg_nfrees: number of free entries in block group | 431 | * @pg_nfrees: number of free entries in block group |
408 | */ | 432 | */ |
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h index a8d71ed43a0e..da8ea2e19273 100644 --- a/include/linux/nl80211.h +++ b/include/linux/nl80211.h | |||
@@ -160,6 +160,11 @@ | |||
160 | * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons, | 160 | * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons, |
161 | * partial scan results may be available | 161 | * partial scan results may be available |
162 | * | 162 | * |
163 | * @NL80211_CMD_GET_SURVEY: get survey resuls, e.g. channel occupation | ||
164 | * or noise level | ||
165 | * @NL80211_CMD_NEW_SURVEY_RESULTS: survey data notification (as a reply to | ||
166 | * NL80211_CMD_GET_SURVEY and on the "scan" multicast group) | ||
167 | * | ||
163 | * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain | 168 | * @NL80211_CMD_REG_CHANGE: indicates to userspace the regulatory domain |
164 | * has been changed and provides details of the request information | 169 | * has been changed and provides details of the request information |
165 | * that caused the change such as who initiated the regulatory request | 170 | * that caused the change such as who initiated the regulatory request |
@@ -341,6 +346,13 @@ enum nl80211_commands { | |||
341 | 346 | ||
342 | NL80211_CMD_SET_WIPHY_NETNS, | 347 | NL80211_CMD_SET_WIPHY_NETNS, |
343 | 348 | ||
349 | NL80211_CMD_GET_SURVEY, | ||
350 | NL80211_CMD_NEW_SURVEY_RESULTS, | ||
351 | |||
352 | NL80211_CMD_SET_PMKSA, | ||
353 | NL80211_CMD_DEL_PMKSA, | ||
354 | NL80211_CMD_FLUSH_PMKSA, | ||
355 | |||
344 | /* add new commands above here */ | 356 | /* add new commands above here */ |
345 | 357 | ||
346 | /* used to define NL80211_CMD_MAX below */ | 358 | /* used to define NL80211_CMD_MAX below */ |
@@ -584,6 +596,16 @@ enum nl80211_commands { | |||
584 | * changed then the list changed and the dump should be repeated | 596 | * changed then the list changed and the dump should be repeated |
585 | * completely from scratch. | 597 | * completely from scratch. |
586 | * | 598 | * |
599 | * @NL80211_ATTR_4ADDR: Use 4-address frames on a virtual interface | ||
600 | * | ||
601 | * @NL80211_ATTR_SURVEY_INFO: survey information about a channel, part of | ||
602 | * the survey response for %NL80211_CMD_GET_SURVEY, nested attribute | ||
603 | * containing info as possible, see &enum survey_info. | ||
604 | * | ||
605 | * @NL80211_ATTR_PMKID: PMK material for PMKSA caching. | ||
606 | * @NL80211_ATTR_MAX_NUM_PMKIDS: maximum number of PMKIDs a firmware can | ||
607 | * cache, a wiphy attribute. | ||
608 | * | ||
587 | * @NL80211_ATTR_MAX: highest attribute number currently defined | 609 | * @NL80211_ATTR_MAX: highest attribute number currently defined |
588 | * @__NL80211_ATTR_AFTER_LAST: internal use | 610 | * @__NL80211_ATTR_AFTER_LAST: internal use |
589 | */ | 611 | */ |
@@ -714,6 +736,13 @@ enum nl80211_attrs { | |||
714 | 736 | ||
715 | NL80211_ATTR_PID, | 737 | NL80211_ATTR_PID, |
716 | 738 | ||
739 | NL80211_ATTR_4ADDR, | ||
740 | |||
741 | NL80211_ATTR_SURVEY_INFO, | ||
742 | |||
743 | NL80211_ATTR_PMKID, | ||
744 | NL80211_ATTR_MAX_NUM_PMKIDS, | ||
745 | |||
717 | /* add attributes here, update the policy in nl80211.c */ | 746 | /* add attributes here, update the policy in nl80211.c */ |
718 | 747 | ||
719 | __NL80211_ATTR_AFTER_LAST, | 748 | __NL80211_ATTR_AFTER_LAST, |
@@ -895,14 +924,14 @@ enum nl80211_sta_info { | |||
895 | * | 924 | * |
896 | * @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active | 925 | * @NL80211_MPATH_FLAG_ACTIVE: the mesh path is active |
897 | * @NL80211_MPATH_FLAG_RESOLVING: the mesh path discovery process is running | 926 | * @NL80211_MPATH_FLAG_RESOLVING: the mesh path discovery process is running |
898 | * @NL80211_MPATH_FLAG_DSN_VALID: the mesh path contains a valid DSN | 927 | * @NL80211_MPATH_FLAG_SN_VALID: the mesh path contains a valid SN |
899 | * @NL80211_MPATH_FLAG_FIXED: the mesh path has been manually set | 928 | * @NL80211_MPATH_FLAG_FIXED: the mesh path has been manually set |
900 | * @NL80211_MPATH_FLAG_RESOLVED: the mesh path discovery process succeeded | 929 | * @NL80211_MPATH_FLAG_RESOLVED: the mesh path discovery process succeeded |
901 | */ | 930 | */ |
902 | enum nl80211_mpath_flags { | 931 | enum nl80211_mpath_flags { |
903 | NL80211_MPATH_FLAG_ACTIVE = 1<<0, | 932 | NL80211_MPATH_FLAG_ACTIVE = 1<<0, |
904 | NL80211_MPATH_FLAG_RESOLVING = 1<<1, | 933 | NL80211_MPATH_FLAG_RESOLVING = 1<<1, |
905 | NL80211_MPATH_FLAG_DSN_VALID = 1<<2, | 934 | NL80211_MPATH_FLAG_SN_VALID = 1<<2, |
906 | NL80211_MPATH_FLAG_FIXED = 1<<3, | 935 | NL80211_MPATH_FLAG_FIXED = 1<<3, |
907 | NL80211_MPATH_FLAG_RESOLVED = 1<<4, | 936 | NL80211_MPATH_FLAG_RESOLVED = 1<<4, |
908 | }; | 937 | }; |
@@ -915,7 +944,7 @@ enum nl80211_mpath_flags { | |||
915 | * | 944 | * |
916 | * @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved | 945 | * @__NL80211_MPATH_INFO_INVALID: attribute number 0 is reserved |
917 | * @NL80211_ATTR_MPATH_FRAME_QLEN: number of queued frames for this destination | 946 | * @NL80211_ATTR_MPATH_FRAME_QLEN: number of queued frames for this destination |
918 | * @NL80211_ATTR_MPATH_DSN: destination sequence number | 947 | * @NL80211_ATTR_MPATH_SN: destination sequence number |
919 | * @NL80211_ATTR_MPATH_METRIC: metric (cost) of this mesh path | 948 | * @NL80211_ATTR_MPATH_METRIC: metric (cost) of this mesh path |
920 | * @NL80211_ATTR_MPATH_EXPTIME: expiration time for the path, in msec from now | 949 | * @NL80211_ATTR_MPATH_EXPTIME: expiration time for the path, in msec from now |
921 | * @NL80211_ATTR_MPATH_FLAGS: mesh path flags, enumerated in | 950 | * @NL80211_ATTR_MPATH_FLAGS: mesh path flags, enumerated in |
@@ -926,7 +955,7 @@ enum nl80211_mpath_flags { | |||
926 | enum nl80211_mpath_info { | 955 | enum nl80211_mpath_info { |
927 | __NL80211_MPATH_INFO_INVALID, | 956 | __NL80211_MPATH_INFO_INVALID, |
928 | NL80211_MPATH_INFO_FRAME_QLEN, | 957 | NL80211_MPATH_INFO_FRAME_QLEN, |
929 | NL80211_MPATH_INFO_DSN, | 958 | NL80211_MPATH_INFO_SN, |
930 | NL80211_MPATH_INFO_METRIC, | 959 | NL80211_MPATH_INFO_METRIC, |
931 | NL80211_MPATH_INFO_EXPTIME, | 960 | NL80211_MPATH_INFO_EXPTIME, |
932 | NL80211_MPATH_INFO_FLAGS, | 961 | NL80211_MPATH_INFO_FLAGS, |
@@ -1117,6 +1146,26 @@ enum nl80211_reg_rule_flags { | |||
1117 | }; | 1146 | }; |
1118 | 1147 | ||
1119 | /** | 1148 | /** |
1149 | * enum nl80211_survey_info - survey information | ||
1150 | * | ||
1151 | * These attribute types are used with %NL80211_ATTR_SURVEY_INFO | ||
1152 | * when getting information about a survey. | ||
1153 | * | ||
1154 | * @__NL80211_SURVEY_INFO_INVALID: attribute number 0 is reserved | ||
1155 | * @NL80211_SURVEY_INFO_FREQUENCY: center frequency of channel | ||
1156 | * @NL80211_SURVEY_INFO_NOISE: noise level of channel (u8, dBm) | ||
1157 | */ | ||
1158 | enum nl80211_survey_info { | ||
1159 | __NL80211_SURVEY_INFO_INVALID, | ||
1160 | NL80211_SURVEY_INFO_FREQUENCY, | ||
1161 | NL80211_SURVEY_INFO_NOISE, | ||
1162 | |||
1163 | /* keep last */ | ||
1164 | __NL80211_SURVEY_INFO_AFTER_LAST, | ||
1165 | NL80211_SURVEY_INFO_MAX = __NL80211_SURVEY_INFO_AFTER_LAST - 1 | ||
1166 | }; | ||
1167 | |||
1168 | /** | ||
1120 | * enum nl80211_mntr_flags - monitor configuration flags | 1169 | * enum nl80211_mntr_flags - monitor configuration flags |
1121 | * | 1170 | * |
1122 | * Monitor configuration flags. | 1171 | * Monitor configuration flags. |
@@ -1196,6 +1245,8 @@ enum nl80211_mntr_flags { | |||
1196 | * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs) | 1245 | * @NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME: The interval of time (in TUs) |
1197 | * that it takes for an HWMP information element to propagate across the mesh | 1246 | * that it takes for an HWMP information element to propagate across the mesh |
1198 | * | 1247 | * |
1248 | * @NL80211_MESHCONF_ROOTMODE: whether root mode is enabled or not | ||
1249 | * | ||
1199 | * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute | 1250 | * @NL80211_MESHCONF_ATTR_MAX: highest possible mesh configuration attribute |
1200 | * | 1251 | * |
1201 | * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use | 1252 | * @__NL80211_MESHCONF_ATTR_AFTER_LAST: internal use |
@@ -1215,6 +1266,7 @@ enum nl80211_meshconf_params { | |||
1215 | NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT, | 1266 | NL80211_MESHCONF_HWMP_ACTIVE_PATH_TIMEOUT, |
1216 | NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL, | 1267 | NL80211_MESHCONF_HWMP_PREQ_MIN_INTERVAL, |
1217 | NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME, | 1268 | NL80211_MESHCONF_HWMP_NET_DIAM_TRVS_TIME, |
1269 | NL80211_MESHCONF_HWMP_ROOTMODE, | ||
1218 | 1270 | ||
1219 | /* keep last */ | 1271 | /* keep last */ |
1220 | __NL80211_MESHCONF_ATTR_AFTER_LAST, | 1272 | __NL80211_MESHCONF_ATTR_AFTER_LAST, |
@@ -1277,6 +1329,7 @@ enum nl80211_channel_type { | |||
1277 | * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon | 1329 | * @NL80211_BSS_SIGNAL_UNSPEC: signal strength of the probe response/beacon |
1278 | * in unspecified units, scaled to 0..100 (u8) | 1330 | * in unspecified units, scaled to 0..100 (u8) |
1279 | * @NL80211_BSS_STATUS: status, if this BSS is "used" | 1331 | * @NL80211_BSS_STATUS: status, if this BSS is "used" |
1332 | * @NL80211_BSS_SEEN_MS_AGO: age of this BSS entry in ms | ||
1280 | * @__NL80211_BSS_AFTER_LAST: internal | 1333 | * @__NL80211_BSS_AFTER_LAST: internal |
1281 | * @NL80211_BSS_MAX: highest BSS attribute | 1334 | * @NL80211_BSS_MAX: highest BSS attribute |
1282 | */ | 1335 | */ |
@@ -1291,6 +1344,7 @@ enum nl80211_bss { | |||
1291 | NL80211_BSS_SIGNAL_MBM, | 1344 | NL80211_BSS_SIGNAL_MBM, |
1292 | NL80211_BSS_SIGNAL_UNSPEC, | 1345 | NL80211_BSS_SIGNAL_UNSPEC, |
1293 | NL80211_BSS_STATUS, | 1346 | NL80211_BSS_STATUS, |
1347 | NL80211_BSS_SEEN_MS_AGO, | ||
1294 | 1348 | ||
1295 | /* keep last */ | 1349 | /* keep last */ |
1296 | __NL80211_BSS_AFTER_LAST, | 1350 | __NL80211_BSS_AFTER_LAST, |
diff --git a/include/linux/nl802154.h b/include/linux/nl802154.h index b7d9435d5a9f..33d9f5175109 100644 --- a/include/linux/nl802154.h +++ b/include/linux/nl802154.h | |||
@@ -65,6 +65,9 @@ enum { | |||
65 | IEEE802154_ATTR_SEC, | 65 | IEEE802154_ATTR_SEC, |
66 | 66 | ||
67 | IEEE802154_ATTR_PAGE, | 67 | IEEE802154_ATTR_PAGE, |
68 | IEEE802154_ATTR_CHANNEL_PAGE_LIST, | ||
69 | |||
70 | IEEE802154_ATTR_PHY_NAME, | ||
68 | 71 | ||
69 | __IEEE802154_ATTR_MAX, | 72 | __IEEE802154_ATTR_MAX, |
70 | }; | 73 | }; |
@@ -114,6 +117,9 @@ enum { | |||
114 | IEEE802154_RX_ENABLE_CONF, /* Not supported yet */ | 117 | IEEE802154_RX_ENABLE_CONF, /* Not supported yet */ |
115 | 118 | ||
116 | IEEE802154_LIST_IFACE, | 119 | IEEE802154_LIST_IFACE, |
120 | IEEE802154_LIST_PHY, | ||
121 | IEEE802154_ADD_IFACE, | ||
122 | IEEE802154_DEL_IFACE, | ||
117 | 123 | ||
118 | __IEEE802154_CMD_MAX, | 124 | __IEEE802154_CMD_MAX, |
119 | }; | 125 | }; |
diff --git a/include/linux/notifier.h b/include/linux/notifier.h index 44428d247dbe..fee6c2f68075 100644 --- a/include/linux/notifier.h +++ b/include/linux/notifier.h | |||
@@ -201,6 +201,8 @@ static inline int notifier_to_errno(int ret) | |||
201 | #define NETDEV_PRE_UP 0x000D | 201 | #define NETDEV_PRE_UP 0x000D |
202 | #define NETDEV_BONDING_OLDTYPE 0x000E | 202 | #define NETDEV_BONDING_OLDTYPE 0x000E |
203 | #define NETDEV_BONDING_NEWTYPE 0x000F | 203 | #define NETDEV_BONDING_NEWTYPE 0x000F |
204 | #define NETDEV_POST_INIT 0x0010 | ||
205 | #define NETDEV_UNREGISTER_BATCH 0x0011 | ||
204 | 206 | ||
205 | #define SYS_DOWN 0x0001 /* Notify of system down */ | 207 | #define SYS_DOWN 0x0001 /* Notify of system down */ |
206 | #define SYS_RESTART SYS_DOWN | 208 | #define SYS_RESTART SYS_DOWN |
diff --git a/include/linux/of.h b/include/linux/of.h index 7be2d1043c16..e7facd8fbce8 100644 --- a/include/linux/of.h +++ b/include/linux/of.h | |||
@@ -17,14 +17,117 @@ | |||
17 | */ | 17 | */ |
18 | #include <linux/types.h> | 18 | #include <linux/types.h> |
19 | #include <linux/bitops.h> | 19 | #include <linux/bitops.h> |
20 | #include <linux/kref.h> | ||
20 | #include <linux/mod_devicetable.h> | 21 | #include <linux/mod_devicetable.h> |
21 | 22 | ||
23 | typedef u32 phandle; | ||
24 | typedef u32 ihandle; | ||
25 | |||
26 | struct property { | ||
27 | char *name; | ||
28 | int length; | ||
29 | void *value; | ||
30 | struct property *next; | ||
31 | unsigned long _flags; | ||
32 | unsigned int unique_id; | ||
33 | }; | ||
34 | |||
35 | #if defined(CONFIG_SPARC) | ||
36 | struct of_irq_controller; | ||
37 | #endif | ||
38 | |||
39 | struct device_node { | ||
40 | const char *name; | ||
41 | const char *type; | ||
42 | phandle node; | ||
43 | #if !defined(CONFIG_SPARC) | ||
44 | phandle linux_phandle; | ||
45 | #endif | ||
46 | char *full_name; | ||
47 | |||
48 | struct property *properties; | ||
49 | struct property *deadprops; /* removed properties */ | ||
50 | struct device_node *parent; | ||
51 | struct device_node *child; | ||
52 | struct device_node *sibling; | ||
53 | struct device_node *next; /* next device of same type */ | ||
54 | struct device_node *allnext; /* next in list of all nodes */ | ||
55 | struct proc_dir_entry *pde; /* this node's proc directory */ | ||
56 | struct kref kref; | ||
57 | unsigned long _flags; | ||
58 | void *data; | ||
59 | #if defined(CONFIG_SPARC) | ||
60 | char *path_component_name; | ||
61 | unsigned int unique_id; | ||
62 | struct of_irq_controller *irq_trans; | ||
63 | #endif | ||
64 | }; | ||
65 | |||
66 | static inline int of_node_check_flag(struct device_node *n, unsigned long flag) | ||
67 | { | ||
68 | return test_bit(flag, &n->_flags); | ||
69 | } | ||
70 | |||
71 | static inline void of_node_set_flag(struct device_node *n, unsigned long flag) | ||
72 | { | ||
73 | set_bit(flag, &n->_flags); | ||
74 | } | ||
75 | |||
76 | static inline void | ||
77 | set_node_proc_entry(struct device_node *dn, struct proc_dir_entry *de) | ||
78 | { | ||
79 | dn->pde = de; | ||
80 | } | ||
81 | |||
82 | extern struct device_node *of_find_all_nodes(struct device_node *prev); | ||
83 | |||
84 | #if defined(CONFIG_SPARC) | ||
85 | /* Dummy ref counting routines - to be implemented later */ | ||
86 | static inline struct device_node *of_node_get(struct device_node *node) | ||
87 | { | ||
88 | return node; | ||
89 | } | ||
90 | static inline void of_node_put(struct device_node *node) | ||
91 | { | ||
92 | } | ||
93 | |||
94 | #else | ||
95 | extern struct device_node *of_node_get(struct device_node *node); | ||
96 | extern void of_node_put(struct device_node *node); | ||
97 | #endif | ||
98 | |||
99 | /* | ||
100 | * OF address retreival & translation | ||
101 | */ | ||
102 | |||
103 | /* Helper to read a big number; size is in cells (not bytes) */ | ||
104 | static inline u64 of_read_number(const u32 *cell, int size) | ||
105 | { | ||
106 | u64 r = 0; | ||
107 | while (size--) | ||
108 | r = (r << 32) | *(cell++); | ||
109 | return r; | ||
110 | } | ||
111 | |||
112 | /* Like of_read_number, but we want an unsigned long result */ | ||
113 | #ifdef CONFIG_PPC32 | ||
114 | static inline unsigned long of_read_ulong(const u32 *cell, int size) | ||
115 | { | ||
116 | return cell[size-1]; | ||
117 | } | ||
118 | #else | ||
119 | #define of_read_ulong(cell, size) of_read_number(cell, size) | ||
120 | #endif | ||
121 | |||
22 | #include <asm/prom.h> | 122 | #include <asm/prom.h> |
23 | 123 | ||
24 | /* flag descriptions */ | 124 | /* flag descriptions */ |
25 | #define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ | 125 | #define OF_DYNAMIC 1 /* node and properties were allocated via kmalloc */ |
26 | #define OF_DETACHED 2 /* node has been detached from the device tree */ | 126 | #define OF_DETACHED 2 /* node has been detached from the device tree */ |
27 | 127 | ||
128 | #define OF_IS_DYNAMIC(x) test_bit(OF_DYNAMIC, &x->_flags) | ||
129 | #define OF_MARK_DYNAMIC(x) set_bit(OF_DYNAMIC, &x->_flags) | ||
130 | |||
28 | #define OF_BAD_ADDR ((u64)-1) | 131 | #define OF_BAD_ADDR ((u64)-1) |
29 | 132 | ||
30 | extern struct device_node *of_find_node_by_name(struct device_node *from, | 133 | extern struct device_node *of_find_node_by_name(struct device_node *from, |
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h new file mode 100644 index 000000000000..41d432b13553 --- /dev/null +++ b/include/linux/of_fdt.h | |||
@@ -0,0 +1,86 @@ | |||
1 | /* | ||
2 | * Definitions for working with the Flattened Device Tree data format | ||
3 | * | ||
4 | * Copyright 2009 Benjamin Herrenschmidt, IBM Corp | ||
5 | * benh@kernel.crashing.org | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or | ||
8 | * modify it under the terms of the GNU General Public License | ||
9 | * version 2 as published by the Free Software Foundation. | ||
10 | */ | ||
11 | |||
12 | #ifndef _LINUX_OF_FDT_H | ||
13 | #define _LINUX_OF_FDT_H | ||
14 | |||
15 | #include <linux/types.h> | ||
16 | #include <linux/init.h> | ||
17 | |||
18 | /* Definitions used by the flattened device tree */ | ||
19 | #define OF_DT_HEADER 0xd00dfeed /* marker */ | ||
20 | #define OF_DT_BEGIN_NODE 0x1 /* Start of node, full name */ | ||
21 | #define OF_DT_END_NODE 0x2 /* End node */ | ||
22 | #define OF_DT_PROP 0x3 /* Property: name off, size, | ||
23 | * content */ | ||
24 | #define OF_DT_NOP 0x4 /* nop */ | ||
25 | #define OF_DT_END 0x9 | ||
26 | |||
27 | #define OF_DT_VERSION 0x10 | ||
28 | |||
29 | #ifndef __ASSEMBLY__ | ||
30 | /* | ||
31 | * This is what gets passed to the kernel by prom_init or kexec | ||
32 | * | ||
33 | * The dt struct contains the device tree structure, full pathes and | ||
34 | * property contents. The dt strings contain a separate block with just | ||
35 | * the strings for the property names, and is fully page aligned and | ||
36 | * self contained in a page, so that it can be kept around by the kernel, | ||
37 | * each property name appears only once in this page (cheap compression) | ||
38 | * | ||
39 | * the mem_rsvmap contains a map of reserved ranges of physical memory, | ||
40 | * passing it here instead of in the device-tree itself greatly simplifies | ||
41 | * the job of everybody. It's just a list of u64 pairs (base/size) that | ||
42 | * ends when size is 0 | ||
43 | */ | ||
44 | struct boot_param_header { | ||
45 | u32 magic; /* magic word OF_DT_HEADER */ | ||
46 | u32 totalsize; /* total size of DT block */ | ||
47 | u32 off_dt_struct; /* offset to structure */ | ||
48 | u32 off_dt_strings; /* offset to strings */ | ||
49 | u32 off_mem_rsvmap; /* offset to memory reserve map */ | ||
50 | u32 version; /* format version */ | ||
51 | u32 last_comp_version; /* last compatible version */ | ||
52 | /* version 2 fields below */ | ||
53 | u32 boot_cpuid_phys; /* Physical CPU id we're booting on */ | ||
54 | /* version 3 fields below */ | ||
55 | u32 dt_strings_size; /* size of the DT strings block */ | ||
56 | /* version 17 fields below */ | ||
57 | u32 dt_struct_size; /* size of the DT structure block */ | ||
58 | }; | ||
59 | |||
60 | /* For scanning the flat device-tree at boot time */ | ||
61 | extern int __init of_scan_flat_dt(int (*it)(unsigned long node, | ||
62 | const char *uname, int depth, | ||
63 | void *data), | ||
64 | void *data); | ||
65 | extern void __init *of_get_flat_dt_prop(unsigned long node, const char *name, | ||
66 | unsigned long *size); | ||
67 | extern int __init of_flat_dt_is_compatible(unsigned long node, | ||
68 | const char *name); | ||
69 | extern unsigned long __init of_get_flat_dt_root(void); | ||
70 | |||
71 | /* Other Prototypes */ | ||
72 | extern void finish_device_tree(void); | ||
73 | extern void unflatten_device_tree(void); | ||
74 | extern void early_init_devtree(void *); | ||
75 | extern int machine_is_compatible(const char *compat); | ||
76 | extern void print_properties(struct device_node *node); | ||
77 | extern int prom_n_intr_cells(struct device_node* np); | ||
78 | extern void prom_get_irq_senses(unsigned char *senses, int off, int max); | ||
79 | extern int prom_add_property(struct device_node* np, struct property* prop); | ||
80 | extern int prom_remove_property(struct device_node *np, struct property *prop); | ||
81 | extern int prom_update_property(struct device_node *np, | ||
82 | struct property *newprop, | ||
83 | struct property *oldprop); | ||
84 | |||
85 | #endif /* __ASSEMBLY__ */ | ||
86 | #endif /* _LINUX_OF_FDT_H */ | ||
diff --git a/include/linux/omapfb.h b/include/linux/omapfb.h new file mode 100644 index 000000000000..f46c40ac6d45 --- /dev/null +++ b/include/linux/omapfb.h | |||
@@ -0,0 +1,251 @@ | |||
1 | /* | ||
2 | * File: include/linux/omapfb.h | ||
3 | * | ||
4 | * Framebuffer driver for TI OMAP boards | ||
5 | * | ||
6 | * Copyright (C) 2004 Nokia Corporation | ||
7 | * Author: Imre Deak <imre.deak@nokia.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify it | ||
10 | * under the terms of the GNU General Public License as published by the | ||
11 | * Free Software Foundation; either version 2 of the License, or (at your | ||
12 | * option) any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, but | ||
15 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
17 | * General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License along | ||
20 | * with this program; if not, write to the Free Software Foundation, Inc., | ||
21 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. | ||
22 | */ | ||
23 | |||
24 | #ifndef __LINUX_OMAPFB_H__ | ||
25 | #define __LINUX_OMAPFB_H__ | ||
26 | |||
27 | #include <linux/fb.h> | ||
28 | #include <linux/ioctl.h> | ||
29 | #include <linux/types.h> | ||
30 | |||
31 | /* IOCTL commands. */ | ||
32 | |||
33 | #define OMAP_IOW(num, dtype) _IOW('O', num, dtype) | ||
34 | #define OMAP_IOR(num, dtype) _IOR('O', num, dtype) | ||
35 | #define OMAP_IOWR(num, dtype) _IOWR('O', num, dtype) | ||
36 | #define OMAP_IO(num) _IO('O', num) | ||
37 | |||
38 | #define OMAPFB_MIRROR OMAP_IOW(31, int) | ||
39 | #define OMAPFB_SYNC_GFX OMAP_IO(37) | ||
40 | #define OMAPFB_VSYNC OMAP_IO(38) | ||
41 | #define OMAPFB_SET_UPDATE_MODE OMAP_IOW(40, int) | ||
42 | #define OMAPFB_GET_CAPS OMAP_IOR(42, struct omapfb_caps) | ||
43 | #define OMAPFB_GET_UPDATE_MODE OMAP_IOW(43, int) | ||
44 | #define OMAPFB_LCD_TEST OMAP_IOW(45, int) | ||
45 | #define OMAPFB_CTRL_TEST OMAP_IOW(46, int) | ||
46 | #define OMAPFB_UPDATE_WINDOW_OLD OMAP_IOW(47, struct omapfb_update_window_old) | ||
47 | #define OMAPFB_SET_COLOR_KEY OMAP_IOW(50, struct omapfb_color_key) | ||
48 | #define OMAPFB_GET_COLOR_KEY OMAP_IOW(51, struct omapfb_color_key) | ||
49 | #define OMAPFB_SETUP_PLANE OMAP_IOW(52, struct omapfb_plane_info) | ||
50 | #define OMAPFB_QUERY_PLANE OMAP_IOW(53, struct omapfb_plane_info) | ||
51 | #define OMAPFB_UPDATE_WINDOW OMAP_IOW(54, struct omapfb_update_window) | ||
52 | #define OMAPFB_SETUP_MEM OMAP_IOW(55, struct omapfb_mem_info) | ||
53 | #define OMAPFB_QUERY_MEM OMAP_IOW(56, struct omapfb_mem_info) | ||
54 | #define OMAPFB_WAITFORVSYNC OMAP_IO(57) | ||
55 | #define OMAPFB_MEMORY_READ OMAP_IOR(58, struct omapfb_memory_read) | ||
56 | #define OMAPFB_GET_OVERLAY_COLORMODE OMAP_IOR(59, struct omapfb_ovl_colormode) | ||
57 | #define OMAPFB_WAITFORGO OMAP_IO(60) | ||
58 | #define OMAPFB_GET_VRAM_INFO OMAP_IOR(61, struct omapfb_vram_info) | ||
59 | #define OMAPFB_SET_TEARSYNC OMAP_IOW(62, struct omapfb_tearsync_info) | ||
60 | |||
61 | #define OMAPFB_CAPS_GENERIC_MASK 0x00000fff | ||
62 | #define OMAPFB_CAPS_LCDC_MASK 0x00fff000 | ||
63 | #define OMAPFB_CAPS_PANEL_MASK 0xff000000 | ||
64 | |||
65 | #define OMAPFB_CAPS_MANUAL_UPDATE 0x00001000 | ||
66 | #define OMAPFB_CAPS_TEARSYNC 0x00002000 | ||
67 | #define OMAPFB_CAPS_PLANE_RELOCATE_MEM 0x00004000 | ||
68 | #define OMAPFB_CAPS_PLANE_SCALE 0x00008000 | ||
69 | #define OMAPFB_CAPS_WINDOW_PIXEL_DOUBLE 0x00010000 | ||
70 | #define OMAPFB_CAPS_WINDOW_SCALE 0x00020000 | ||
71 | #define OMAPFB_CAPS_WINDOW_OVERLAY 0x00040000 | ||
72 | #define OMAPFB_CAPS_WINDOW_ROTATE 0x00080000 | ||
73 | #define OMAPFB_CAPS_SET_BACKLIGHT 0x01000000 | ||
74 | |||
75 | /* Values from DSP must map to lower 16-bits */ | ||
76 | #define OMAPFB_FORMAT_MASK 0x00ff | ||
77 | #define OMAPFB_FORMAT_FLAG_DOUBLE 0x0100 | ||
78 | #define OMAPFB_FORMAT_FLAG_TEARSYNC 0x0200 | ||
79 | #define OMAPFB_FORMAT_FLAG_FORCE_VSYNC 0x0400 | ||
80 | #define OMAPFB_FORMAT_FLAG_ENABLE_OVERLAY 0x0800 | ||
81 | #define OMAPFB_FORMAT_FLAG_DISABLE_OVERLAY 0x1000 | ||
82 | |||
83 | #define OMAPFB_MEMTYPE_SDRAM 0 | ||
84 | #define OMAPFB_MEMTYPE_SRAM 1 | ||
85 | #define OMAPFB_MEMTYPE_MAX 1 | ||
86 | |||
87 | enum omapfb_color_format { | ||
88 | OMAPFB_COLOR_RGB565 = 0, | ||
89 | OMAPFB_COLOR_YUV422, | ||
90 | OMAPFB_COLOR_YUV420, | ||
91 | OMAPFB_COLOR_CLUT_8BPP, | ||
92 | OMAPFB_COLOR_CLUT_4BPP, | ||
93 | OMAPFB_COLOR_CLUT_2BPP, | ||
94 | OMAPFB_COLOR_CLUT_1BPP, | ||
95 | OMAPFB_COLOR_RGB444, | ||
96 | OMAPFB_COLOR_YUY422, | ||
97 | |||
98 | OMAPFB_COLOR_ARGB16, | ||
99 | OMAPFB_COLOR_RGB24U, /* RGB24, 32-bit container */ | ||
100 | OMAPFB_COLOR_RGB24P, /* RGB24, 24-bit container */ | ||
101 | OMAPFB_COLOR_ARGB32, | ||
102 | OMAPFB_COLOR_RGBA32, | ||
103 | OMAPFB_COLOR_RGBX32, | ||
104 | }; | ||
105 | |||
106 | struct omapfb_update_window { | ||
107 | __u32 x, y; | ||
108 | __u32 width, height; | ||
109 | __u32 format; | ||
110 | __u32 out_x, out_y; | ||
111 | __u32 out_width, out_height; | ||
112 | __u32 reserved[8]; | ||
113 | }; | ||
114 | |||
115 | struct omapfb_update_window_old { | ||
116 | __u32 x, y; | ||
117 | __u32 width, height; | ||
118 | __u32 format; | ||
119 | }; | ||
120 | |||
121 | enum omapfb_plane { | ||
122 | OMAPFB_PLANE_GFX = 0, | ||
123 | OMAPFB_PLANE_VID1, | ||
124 | OMAPFB_PLANE_VID2, | ||
125 | }; | ||
126 | |||
127 | enum omapfb_channel_out { | ||
128 | OMAPFB_CHANNEL_OUT_LCD = 0, | ||
129 | OMAPFB_CHANNEL_OUT_DIGIT, | ||
130 | }; | ||
131 | |||
132 | struct omapfb_plane_info { | ||
133 | __u32 pos_x; | ||
134 | __u32 pos_y; | ||
135 | __u8 enabled; | ||
136 | __u8 channel_out; | ||
137 | __u8 mirror; | ||
138 | __u8 reserved1; | ||
139 | __u32 out_width; | ||
140 | __u32 out_height; | ||
141 | __u32 reserved2[12]; | ||
142 | }; | ||
143 | |||
144 | struct omapfb_mem_info { | ||
145 | __u32 size; | ||
146 | __u8 type; | ||
147 | __u8 reserved[3]; | ||
148 | }; | ||
149 | |||
150 | struct omapfb_caps { | ||
151 | __u32 ctrl; | ||
152 | __u32 plane_color; | ||
153 | __u32 wnd_color; | ||
154 | }; | ||
155 | |||
156 | enum omapfb_color_key_type { | ||
157 | OMAPFB_COLOR_KEY_DISABLED = 0, | ||
158 | OMAPFB_COLOR_KEY_GFX_DST, | ||
159 | OMAPFB_COLOR_KEY_VID_SRC, | ||
160 | }; | ||
161 | |||
162 | struct omapfb_color_key { | ||
163 | __u8 channel_out; | ||
164 | __u32 background; | ||
165 | __u32 trans_key; | ||
166 | __u8 key_type; | ||
167 | }; | ||
168 | |||
169 | enum omapfb_update_mode { | ||
170 | OMAPFB_UPDATE_DISABLED = 0, | ||
171 | OMAPFB_AUTO_UPDATE, | ||
172 | OMAPFB_MANUAL_UPDATE | ||
173 | }; | ||
174 | |||
175 | struct omapfb_memory_read { | ||
176 | __u16 x; | ||
177 | __u16 y; | ||
178 | __u16 w; | ||
179 | __u16 h; | ||
180 | size_t buffer_size; | ||
181 | void __user *buffer; | ||
182 | }; | ||
183 | |||
184 | struct omapfb_ovl_colormode { | ||
185 | __u8 overlay_idx; | ||
186 | __u8 mode_idx; | ||
187 | __u32 bits_per_pixel; | ||
188 | __u32 nonstd; | ||
189 | struct fb_bitfield red; | ||
190 | struct fb_bitfield green; | ||
191 | struct fb_bitfield blue; | ||
192 | struct fb_bitfield transp; | ||
193 | }; | ||
194 | |||
195 | struct omapfb_vram_info { | ||
196 | __u32 total; | ||
197 | __u32 free; | ||
198 | __u32 largest_free_block; | ||
199 | __u32 reserved[5]; | ||
200 | }; | ||
201 | |||
202 | struct omapfb_tearsync_info { | ||
203 | __u8 enabled; | ||
204 | __u8 reserved1[3]; | ||
205 | __u16 line; | ||
206 | __u16 reserved2; | ||
207 | }; | ||
208 | |||
209 | #ifdef __KERNEL__ | ||
210 | |||
211 | #include <plat/board.h> | ||
212 | |||
213 | #ifdef CONFIG_ARCH_OMAP1 | ||
214 | #define OMAPFB_PLANE_NUM 1 | ||
215 | #else | ||
216 | #define OMAPFB_PLANE_NUM 3 | ||
217 | #endif | ||
218 | |||
219 | struct omapfb_mem_region { | ||
220 | u32 paddr; | ||
221 | void __iomem *vaddr; | ||
222 | unsigned long size; | ||
223 | u8 type; /* OMAPFB_PLANE_MEM_* */ | ||
224 | enum omapfb_color_format format;/* OMAPFB_COLOR_* */ | ||
225 | unsigned format_used:1; /* Must be set when format is set. | ||
226 | * Needed b/c of the badly chosen 0 | ||
227 | * base for OMAPFB_COLOR_* values | ||
228 | */ | ||
229 | unsigned alloc:1; /* allocated by the driver */ | ||
230 | unsigned map:1; /* kernel mapped by the driver */ | ||
231 | }; | ||
232 | |||
233 | struct omapfb_mem_desc { | ||
234 | int region_cnt; | ||
235 | struct omapfb_mem_region region[OMAPFB_PLANE_NUM]; | ||
236 | }; | ||
237 | |||
238 | struct omapfb_platform_data { | ||
239 | struct omap_lcd_config lcd; | ||
240 | struct omapfb_mem_desc mem_desc; | ||
241 | void *ctrl_platform_data; | ||
242 | }; | ||
243 | |||
244 | /* in arch/arm/plat-omap/fb.c */ | ||
245 | extern void omapfb_set_platform_data(struct omapfb_platform_data *data); | ||
246 | extern void omapfb_set_ctrl_platform_data(void *pdata); | ||
247 | extern void omapfb_reserve_sdram(void); | ||
248 | |||
249 | #endif | ||
250 | |||
251 | #endif /* __OMAPFB_H */ | ||
diff --git a/include/linux/pci.h b/include/linux/pci.h index f5c7cd343e56..04771b9c3316 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -218,6 +218,7 @@ struct pci_dev { | |||
218 | unsigned int class; /* 3 bytes: (base,sub,prog-if) */ | 218 | unsigned int class; /* 3 bytes: (base,sub,prog-if) */ |
219 | u8 revision; /* PCI revision, low byte of class word */ | 219 | u8 revision; /* PCI revision, low byte of class word */ |
220 | u8 hdr_type; /* PCI header type (`multi' flag masked out) */ | 220 | u8 hdr_type; /* PCI header type (`multi' flag masked out) */ |
221 | u8 pcie_cap; /* PCI-E capability offset */ | ||
221 | u8 pcie_type; /* PCI-E device/port type */ | 222 | u8 pcie_type; /* PCI-E device/port type */ |
222 | u8 rom_base_reg; /* which config register controls the ROM */ | 223 | u8 rom_base_reg; /* which config register controls the ROM */ |
223 | u8 pin; /* which interrupt pin this device uses */ | 224 | u8 pin; /* which interrupt pin this device uses */ |
@@ -280,6 +281,7 @@ struct pci_dev { | |||
280 | unsigned int is_virtfn:1; | 281 | unsigned int is_virtfn:1; |
281 | unsigned int reset_fn:1; | 282 | unsigned int reset_fn:1; |
282 | unsigned int is_hotplug_bridge:1; | 283 | unsigned int is_hotplug_bridge:1; |
284 | unsigned int aer_firmware_first:1; | ||
283 | pci_dev_flags_t dev_flags; | 285 | pci_dev_flags_t dev_flags; |
284 | atomic_t enable_cnt; /* pci_enable_device has been called */ | 286 | atomic_t enable_cnt; /* pci_enable_device has been called */ |
285 | 287 | ||
@@ -635,7 +637,13 @@ struct pci_dev *pci_get_subsys(unsigned int vendor, unsigned int device, | |||
635 | unsigned int ss_vendor, unsigned int ss_device, | 637 | unsigned int ss_vendor, unsigned int ss_device, |
636 | struct pci_dev *from); | 638 | struct pci_dev *from); |
637 | struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn); | 639 | struct pci_dev *pci_get_slot(struct pci_bus *bus, unsigned int devfn); |
638 | struct pci_dev *pci_get_bus_and_slot(unsigned int bus, unsigned int devfn); | 640 | struct pci_dev *pci_get_domain_bus_and_slot(int domain, unsigned int bus, |
641 | unsigned int devfn); | ||
642 | static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus, | ||
643 | unsigned int devfn) | ||
644 | { | ||
645 | return pci_get_domain_bus_and_slot(0, bus, devfn); | ||
646 | } | ||
639 | struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from); | 647 | struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *from); |
640 | int pci_dev_present(const struct pci_device_id *ids); | 648 | int pci_dev_present(const struct pci_device_id *ids); |
641 | 649 | ||
@@ -701,6 +709,7 @@ void pci_disable_device(struct pci_dev *dev); | |||
701 | void pci_set_master(struct pci_dev *dev); | 709 | void pci_set_master(struct pci_dev *dev); |
702 | void pci_clear_master(struct pci_dev *dev); | 710 | void pci_clear_master(struct pci_dev *dev); |
703 | int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); | 711 | int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); |
712 | int pci_set_cacheline_size(struct pci_dev *dev); | ||
704 | #define HAVE_PCI_SET_MWI | 713 | #define HAVE_PCI_SET_MWI |
705 | int __must_check pci_set_mwi(struct pci_dev *dev); | 714 | int __must_check pci_set_mwi(struct pci_dev *dev); |
706 | int pci_try_set_mwi(struct pci_dev *dev); | 715 | int pci_try_set_mwi(struct pci_dev *dev); |
@@ -1246,6 +1255,8 @@ extern int pci_pci_problems; | |||
1246 | 1255 | ||
1247 | extern unsigned long pci_cardbus_io_size; | 1256 | extern unsigned long pci_cardbus_io_size; |
1248 | extern unsigned long pci_cardbus_mem_size; | 1257 | extern unsigned long pci_cardbus_mem_size; |
1258 | extern u8 pci_dfl_cache_line_size; | ||
1259 | extern u8 pci_cache_line_size; | ||
1249 | 1260 | ||
1250 | extern unsigned long pci_hotplug_io_size; | 1261 | extern unsigned long pci_hotplug_io_size; |
1251 | extern unsigned long pci_hotplug_mem_size; | 1262 | extern unsigned long pci_hotplug_mem_size; |
@@ -1290,5 +1301,34 @@ extern void pci_hp_create_module_link(struct pci_slot *pci_slot); | |||
1290 | extern void pci_hp_remove_module_link(struct pci_slot *pci_slot); | 1301 | extern void pci_hp_remove_module_link(struct pci_slot *pci_slot); |
1291 | #endif | 1302 | #endif |
1292 | 1303 | ||
1304 | /** | ||
1305 | * pci_pcie_cap - get the saved PCIe capability offset | ||
1306 | * @dev: PCI device | ||
1307 | * | ||
1308 | * PCIe capability offset is calculated at PCI device initialization | ||
1309 | * time and saved in the data structure. This function returns saved | ||
1310 | * PCIe capability offset. Using this instead of pci_find_capability() | ||
1311 | * reduces unnecessary search in the PCI configuration space. If you | ||
1312 | * need to calculate PCIe capability offset from raw device for some | ||
1313 | * reasons, please use pci_find_capability() instead. | ||
1314 | */ | ||
1315 | static inline int pci_pcie_cap(struct pci_dev *dev) | ||
1316 | { | ||
1317 | return dev->pcie_cap; | ||
1318 | } | ||
1319 | |||
1320 | /** | ||
1321 | * pci_is_pcie - check if the PCI device is PCI Express capable | ||
1322 | * @dev: PCI device | ||
1323 | * | ||
1324 | * Retrun true if the PCI device is PCI Express capable, false otherwise. | ||
1325 | */ | ||
1326 | static inline bool pci_is_pcie(struct pci_dev *dev) | ||
1327 | { | ||
1328 | return !!pci_pcie_cap(dev); | ||
1329 | } | ||
1330 | |||
1331 | void pci_request_acs(void); | ||
1332 | |||
1293 | #endif /* __KERNEL__ */ | 1333 | #endif /* __KERNEL__ */ |
1294 | #endif /* LINUX_PCI_H */ | 1334 | #endif /* LINUX_PCI_H */ |
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h index 84cf1f3b7838..eae1f864c934 100644 --- a/include/linux/pci_ids.h +++ b/include/linux/pci_ids.h | |||
@@ -1496,9 +1496,10 @@ | |||
1496 | #define PCI_DEVICE_ID_SBE_WANXL400 0x0104 | 1496 | #define PCI_DEVICE_ID_SBE_WANXL400 0x0104 |
1497 | 1497 | ||
1498 | #define PCI_VENDOR_ID_TOSHIBA 0x1179 | 1498 | #define PCI_VENDOR_ID_TOSHIBA 0x1179 |
1499 | #define PCI_DEVICE_ID_TOSHIBA_PICCOLO 0x0102 | 1499 | #define PCI_DEVICE_ID_TOSHIBA_PICCOLO_1 0x0101 |
1500 | #define PCI_DEVICE_ID_TOSHIBA_PICCOLO_1 0x0103 | 1500 | #define PCI_DEVICE_ID_TOSHIBA_PICCOLO_2 0x0102 |
1501 | #define PCI_DEVICE_ID_TOSHIBA_PICCOLO_2 0x0105 | 1501 | #define PCI_DEVICE_ID_TOSHIBA_PICCOLO_3 0x0103 |
1502 | #define PCI_DEVICE_ID_TOSHIBA_PICCOLO_5 0x0105 | ||
1502 | #define PCI_DEVICE_ID_TOSHIBA_TOPIC95 0x060a | 1503 | #define PCI_DEVICE_ID_TOSHIBA_TOPIC95 0x060a |
1503 | #define PCI_DEVICE_ID_TOSHIBA_TOPIC97 0x060f | 1504 | #define PCI_DEVICE_ID_TOSHIBA_TOPIC97 0x060f |
1504 | #define PCI_DEVICE_ID_TOSHIBA_TOPIC100 0x0617 | 1505 | #define PCI_DEVICE_ID_TOSHIBA_TOPIC100 0x0617 |
@@ -1586,6 +1587,8 @@ | |||
1586 | #define PCI_VENDOR_ID_COMPEX 0x11f6 | 1587 | #define PCI_VENDOR_ID_COMPEX 0x11f6 |
1587 | #define PCI_DEVICE_ID_COMPEX_ENET100VG4 0x0112 | 1588 | #define PCI_DEVICE_ID_COMPEX_ENET100VG4 0x0112 |
1588 | 1589 | ||
1590 | #define PCI_VENDOR_ID_PMC_Sierra 0x11f8 | ||
1591 | |||
1589 | #define PCI_VENDOR_ID_RP 0x11fe | 1592 | #define PCI_VENDOR_ID_RP 0x11fe |
1590 | #define PCI_DEVICE_ID_RP32INTF 0x0001 | 1593 | #define PCI_DEVICE_ID_RP32INTF 0x0001 |
1591 | #define PCI_DEVICE_ID_RP8INTF 0x0002 | 1594 | #define PCI_DEVICE_ID_RP8INTF 0x0002 |
@@ -1633,6 +1636,8 @@ | |||
1633 | #define PCI_DEVICE_ID_O2_6730 0x673a | 1636 | #define PCI_DEVICE_ID_O2_6730 0x673a |
1634 | #define PCI_DEVICE_ID_O2_6832 0x6832 | 1637 | #define PCI_DEVICE_ID_O2_6832 0x6832 |
1635 | #define PCI_DEVICE_ID_O2_6836 0x6836 | 1638 | #define PCI_DEVICE_ID_O2_6836 0x6836 |
1639 | #define PCI_DEVICE_ID_O2_6812 0x6872 | ||
1640 | #define PCI_DEVICE_ID_O2_6933 0x6933 | ||
1636 | 1641 | ||
1637 | #define PCI_VENDOR_ID_3DFX 0x121a | 1642 | #define PCI_VENDOR_ID_3DFX 0x121a |
1638 | #define PCI_DEVICE_ID_3DFX_VOODOO 0x0001 | 1643 | #define PCI_DEVICE_ID_3DFX_VOODOO 0x0001 |
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h index dd0bed4f1cf0..9f2ad0aa3c39 100644 --- a/include/linux/pci_regs.h +++ b/include/linux/pci_regs.h | |||
@@ -365,6 +365,11 @@ | |||
365 | #define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */ | 365 | #define PCI_X_STATUS_266MHZ 0x40000000 /* 266 MHz capable */ |
366 | #define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */ | 366 | #define PCI_X_STATUS_533MHZ 0x80000000 /* 533 MHz capable */ |
367 | 367 | ||
368 | /* PCI Bridge Subsystem ID registers */ | ||
369 | |||
370 | #define PCI_SSVID_VENDOR_ID 4 /* PCI-Bridge subsystem vendor id register */ | ||
371 | #define PCI_SSVID_DEVICE_ID 6 /* PCI-Bridge subsystem device id register */ | ||
372 | |||
368 | /* PCI Express capability registers */ | 373 | /* PCI Express capability registers */ |
369 | 374 | ||
370 | #define PCI_EXP_FLAGS 2 /* Capabilities register */ | 375 | #define PCI_EXP_FLAGS 2 /* Capabilities register */ |
@@ -502,6 +507,7 @@ | |||
502 | #define PCI_EXT_CAP_ID_VC 2 | 507 | #define PCI_EXT_CAP_ID_VC 2 |
503 | #define PCI_EXT_CAP_ID_DSN 3 | 508 | #define PCI_EXT_CAP_ID_DSN 3 |
504 | #define PCI_EXT_CAP_ID_PWR 4 | 509 | #define PCI_EXT_CAP_ID_PWR 4 |
510 | #define PCI_EXT_CAP_ID_ACS 13 | ||
505 | #define PCI_EXT_CAP_ID_ARI 14 | 511 | #define PCI_EXT_CAP_ID_ARI 14 |
506 | #define PCI_EXT_CAP_ID_ATS 15 | 512 | #define PCI_EXT_CAP_ID_ATS 15 |
507 | #define PCI_EXT_CAP_ID_SRIOV 16 | 513 | #define PCI_EXT_CAP_ID_SRIOV 16 |
@@ -662,4 +668,16 @@ | |||
662 | #define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */ | 668 | #define PCI_SRIOV_VFM_MO 0x2 /* Active.MigrateOut */ |
663 | #define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */ | 669 | #define PCI_SRIOV_VFM_AV 0x3 /* Active.Available */ |
664 | 670 | ||
671 | /* Access Control Service */ | ||
672 | #define PCI_ACS_CAP 0x04 /* ACS Capability Register */ | ||
673 | #define PCI_ACS_SV 0x01 /* Source Validation */ | ||
674 | #define PCI_ACS_TB 0x02 /* Translation Blocking */ | ||
675 | #define PCI_ACS_RR 0x04 /* P2P Request Redirect */ | ||
676 | #define PCI_ACS_CR 0x08 /* P2P Completion Redirect */ | ||
677 | #define PCI_ACS_UF 0x10 /* Upstream Forwarding */ | ||
678 | #define PCI_ACS_EC 0x20 /* P2P Egress Control */ | ||
679 | #define PCI_ACS_DT 0x40 /* Direct Translated P2P */ | ||
680 | #define PCI_ACS_CTRL 0x06 /* ACS Control Register */ | ||
681 | #define PCI_ACS_EGRESS_CTL_V 0x08 /* ACS Egress Control Vector */ | ||
682 | |||
665 | #endif /* LINUX_PCI_REGS_H */ | 683 | #endif /* LINUX_PCI_REGS_H */ |
diff --git a/include/linux/pcieport_if.h b/include/linux/pcieport_if.h index b4c79545330b..6775532b92a9 100644 --- a/include/linux/pcieport_if.h +++ b/include/linux/pcieport_if.h | |||
@@ -10,10 +10,7 @@ | |||
10 | #define _PCIEPORT_IF_H_ | 10 | #define _PCIEPORT_IF_H_ |
11 | 11 | ||
12 | /* Port Type */ | 12 | /* Port Type */ |
13 | #define PCIE_RC_PORT 4 /* Root port of RC */ | 13 | #define PCIE_ANY_PORT (~0) |
14 | #define PCIE_SW_UPSTREAM_PORT 5 /* Upstream port of Switch */ | ||
15 | #define PCIE_SW_DOWNSTREAM_PORT 6 /* Downstream port of Switch */ | ||
16 | #define PCIE_ANY_PORT 7 | ||
17 | 14 | ||
18 | /* Service Type */ | 15 | /* Service Type */ |
19 | #define PCIE_PORT_SERVICE_PME_SHIFT 0 /* Power Management Event */ | 16 | #define PCIE_PORT_SERVICE_PME_SHIFT 0 /* Power Management Event */ |
@@ -25,17 +22,6 @@ | |||
25 | #define PCIE_PORT_SERVICE_VC_SHIFT 3 /* Virtual Channel */ | 22 | #define PCIE_PORT_SERVICE_VC_SHIFT 3 /* Virtual Channel */ |
26 | #define PCIE_PORT_SERVICE_VC (1 << PCIE_PORT_SERVICE_VC_SHIFT) | 23 | #define PCIE_PORT_SERVICE_VC (1 << PCIE_PORT_SERVICE_VC_SHIFT) |
27 | 24 | ||
28 | /* Root/Upstream/Downstream Port's Interrupt Mode */ | ||
29 | #define PCIE_PORT_NO_IRQ (-1) | ||
30 | #define PCIE_PORT_INTx_MODE 0 | ||
31 | #define PCIE_PORT_MSI_MODE 1 | ||
32 | #define PCIE_PORT_MSIX_MODE 2 | ||
33 | |||
34 | struct pcie_port_data { | ||
35 | int port_type; /* Type of the port */ | ||
36 | int port_irq_mode; /* [0:INTx | 1:MSI | 2:MSI-X] */ | ||
37 | }; | ||
38 | |||
39 | struct pcie_device { | 25 | struct pcie_device { |
40 | int irq; /* Service IRQ/MSI/MSI-X Vector */ | 26 | int irq; /* Service IRQ/MSI/MSI-X Vector */ |
41 | struct pci_dev *port; /* Root/Upstream/Downstream Port */ | 27 | struct pci_dev *port; /* Root/Upstream/Downstream Port */ |
diff --git a/include/linux/perf_counter.h b/include/linux/perf_counter.h index 7b7fbf433cff..e3fb25606706 100644 --- a/include/linux/perf_counter.h +++ b/include/linux/perf_counter.h | |||
@@ -106,6 +106,8 @@ enum perf_sw_ids { | |||
106 | PERF_COUNT_SW_CPU_MIGRATIONS = 4, | 106 | PERF_COUNT_SW_CPU_MIGRATIONS = 4, |
107 | PERF_COUNT_SW_PAGE_FAULTS_MIN = 5, | 107 | PERF_COUNT_SW_PAGE_FAULTS_MIN = 5, |
108 | PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6, | 108 | PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6, |
109 | PERF_COUNT_SW_ALIGNMENT_FAULTS = 7, | ||
110 | PERF_COUNT_SW_EMULATION_FAULTS = 8, | ||
109 | 111 | ||
110 | PERF_COUNT_SW_MAX, /* non-ABI */ | 112 | PERF_COUNT_SW_MAX, /* non-ABI */ |
111 | }; | 113 | }; |
@@ -225,6 +227,7 @@ struct perf_counter_attr { | |||
225 | #define PERF_COUNTER_IOC_RESET _IO ('$', 3) | 227 | #define PERF_COUNTER_IOC_RESET _IO ('$', 3) |
226 | #define PERF_COUNTER_IOC_PERIOD _IOW('$', 4, u64) | 228 | #define PERF_COUNTER_IOC_PERIOD _IOW('$', 4, u64) |
227 | #define PERF_COUNTER_IOC_SET_OUTPUT _IO ('$', 5) | 229 | #define PERF_COUNTER_IOC_SET_OUTPUT _IO ('$', 5) |
230 | #define PERF_COUNTER_IOC_SET_FILTER _IOW('$', 6, char *) | ||
228 | 231 | ||
229 | enum perf_counter_ioc_flags { | 232 | enum perf_counter_ioc_flags { |
230 | PERF_IOC_FLAG_GROUP = 1U << 0, | 233 | PERF_IOC_FLAG_GROUP = 1U << 0, |
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 9e7012689a84..43adbd7f0010 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h | |||
@@ -18,6 +18,10 @@ | |||
18 | #include <linux/ioctl.h> | 18 | #include <linux/ioctl.h> |
19 | #include <asm/byteorder.h> | 19 | #include <asm/byteorder.h> |
20 | 20 | ||
21 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | ||
22 | #include <asm/hw_breakpoint.h> | ||
23 | #endif | ||
24 | |||
21 | /* | 25 | /* |
22 | * User-space ABI bits: | 26 | * User-space ABI bits: |
23 | */ | 27 | */ |
@@ -31,6 +35,7 @@ enum perf_type_id { | |||
31 | PERF_TYPE_TRACEPOINT = 2, | 35 | PERF_TYPE_TRACEPOINT = 2, |
32 | PERF_TYPE_HW_CACHE = 3, | 36 | PERF_TYPE_HW_CACHE = 3, |
33 | PERF_TYPE_RAW = 4, | 37 | PERF_TYPE_RAW = 4, |
38 | PERF_TYPE_BREAKPOINT = 5, | ||
34 | 39 | ||
35 | PERF_TYPE_MAX, /* non-ABI */ | 40 | PERF_TYPE_MAX, /* non-ABI */ |
36 | }; | 41 | }; |
@@ -102,6 +107,8 @@ enum perf_sw_ids { | |||
102 | PERF_COUNT_SW_CPU_MIGRATIONS = 4, | 107 | PERF_COUNT_SW_CPU_MIGRATIONS = 4, |
103 | PERF_COUNT_SW_PAGE_FAULTS_MIN = 5, | 108 | PERF_COUNT_SW_PAGE_FAULTS_MIN = 5, |
104 | PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6, | 109 | PERF_COUNT_SW_PAGE_FAULTS_MAJ = 6, |
110 | PERF_COUNT_SW_ALIGNMENT_FAULTS = 7, | ||
111 | PERF_COUNT_SW_EMULATION_FAULTS = 8, | ||
105 | 112 | ||
106 | PERF_COUNT_SW_MAX, /* non-ABI */ | 113 | PERF_COUNT_SW_MAX, /* non-ABI */ |
107 | }; | 114 | }; |
@@ -207,6 +214,15 @@ struct perf_event_attr { | |||
207 | __u32 wakeup_events; /* wakeup every n events */ | 214 | __u32 wakeup_events; /* wakeup every n events */ |
208 | __u32 wakeup_watermark; /* bytes before wakeup */ | 215 | __u32 wakeup_watermark; /* bytes before wakeup */ |
209 | }; | 216 | }; |
217 | |||
218 | union { | ||
219 | struct { /* Hardware breakpoint info */ | ||
220 | __u64 bp_addr; | ||
221 | __u32 bp_type; | ||
222 | __u32 bp_len; | ||
223 | }; | ||
224 | }; | ||
225 | |||
210 | __u32 __reserved_2; | 226 | __u32 __reserved_2; |
211 | 227 | ||
212 | __u64 __reserved_3; | 228 | __u64 __reserved_3; |
@@ -219,8 +235,9 @@ struct perf_event_attr { | |||
219 | #define PERF_EVENT_IOC_DISABLE _IO ('$', 1) | 235 | #define PERF_EVENT_IOC_DISABLE _IO ('$', 1) |
220 | #define PERF_EVENT_IOC_REFRESH _IO ('$', 2) | 236 | #define PERF_EVENT_IOC_REFRESH _IO ('$', 2) |
221 | #define PERF_EVENT_IOC_RESET _IO ('$', 3) | 237 | #define PERF_EVENT_IOC_RESET _IO ('$', 3) |
222 | #define PERF_EVENT_IOC_PERIOD _IOW('$', 4, u64) | 238 | #define PERF_EVENT_IOC_PERIOD _IOW('$', 4, __u64) |
223 | #define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5) | 239 | #define PERF_EVENT_IOC_SET_OUTPUT _IO ('$', 5) |
240 | #define PERF_EVENT_IOC_SET_FILTER _IOW('$', 6, char *) | ||
224 | 241 | ||
225 | enum perf_event_ioc_flags { | 242 | enum perf_event_ioc_flags { |
226 | PERF_IOC_FLAG_GROUP = 1U << 0, | 243 | PERF_IOC_FLAG_GROUP = 1U << 0, |
@@ -475,6 +492,11 @@ struct hw_perf_event { | |||
475 | s64 remaining; | 492 | s64 remaining; |
476 | struct hrtimer hrtimer; | 493 | struct hrtimer hrtimer; |
477 | }; | 494 | }; |
495 | #ifdef CONFIG_HAVE_HW_BREAKPOINT | ||
496 | union { /* breakpoint */ | ||
497 | struct arch_hw_breakpoint info; | ||
498 | }; | ||
499 | #endif | ||
478 | }; | 500 | }; |
479 | atomic64_t prev_count; | 501 | atomic64_t prev_count; |
480 | u64 sample_period; | 502 | u64 sample_period; |
@@ -543,6 +565,10 @@ struct perf_pending_entry { | |||
543 | void (*func)(struct perf_pending_entry *); | 565 | void (*func)(struct perf_pending_entry *); |
544 | }; | 566 | }; |
545 | 567 | ||
568 | typedef void (*perf_callback_t)(struct perf_event *, void *); | ||
569 | |||
570 | struct perf_sample_data; | ||
571 | |||
546 | /** | 572 | /** |
547 | * struct perf_event - performance event kernel representation: | 573 | * struct perf_event - performance event kernel representation: |
548 | */ | 574 | */ |
@@ -585,7 +611,7 @@ struct perf_event { | |||
585 | u64 tstamp_running; | 611 | u64 tstamp_running; |
586 | u64 tstamp_stopped; | 612 | u64 tstamp_stopped; |
587 | 613 | ||
588 | struct perf_event_attr attr; | 614 | struct perf_event_attr attr; |
589 | struct hw_perf_event hw; | 615 | struct hw_perf_event hw; |
590 | 616 | ||
591 | struct perf_event_context *ctx; | 617 | struct perf_event_context *ctx; |
@@ -633,7 +659,20 @@ struct perf_event { | |||
633 | 659 | ||
634 | struct pid_namespace *ns; | 660 | struct pid_namespace *ns; |
635 | u64 id; | 661 | u64 id; |
662 | |||
663 | void (*overflow_handler)(struct perf_event *event, | ||
664 | int nmi, struct perf_sample_data *data, | ||
665 | struct pt_regs *regs); | ||
666 | |||
667 | #ifdef CONFIG_EVENT_PROFILE | ||
668 | struct event_filter *filter; | ||
636 | #endif | 669 | #endif |
670 | |||
671 | perf_callback_t callback; | ||
672 | |||
673 | perf_callback_t event_callback; | ||
674 | |||
675 | #endif /* CONFIG_PERF_EVENTS */ | ||
637 | }; | 676 | }; |
638 | 677 | ||
639 | /** | 678 | /** |
@@ -706,7 +745,6 @@ struct perf_output_handle { | |||
706 | int nmi; | 745 | int nmi; |
707 | int sample; | 746 | int sample; |
708 | int locked; | 747 | int locked; |
709 | unsigned long flags; | ||
710 | }; | 748 | }; |
711 | 749 | ||
712 | #ifdef CONFIG_PERF_EVENTS | 750 | #ifdef CONFIG_PERF_EVENTS |
@@ -738,6 +776,14 @@ extern int hw_perf_group_sched_in(struct perf_event *group_leader, | |||
738 | struct perf_cpu_context *cpuctx, | 776 | struct perf_cpu_context *cpuctx, |
739 | struct perf_event_context *ctx, int cpu); | 777 | struct perf_event_context *ctx, int cpu); |
740 | extern void perf_event_update_userpage(struct perf_event *event); | 778 | extern void perf_event_update_userpage(struct perf_event *event); |
779 | extern int perf_event_release_kernel(struct perf_event *event); | ||
780 | extern struct perf_event * | ||
781 | perf_event_create_kernel_counter(struct perf_event_attr *attr, | ||
782 | int cpu, | ||
783 | pid_t pid, | ||
784 | perf_callback_t callback); | ||
785 | extern u64 perf_event_read_value(struct perf_event *event, | ||
786 | u64 *enabled, u64 *running); | ||
741 | 787 | ||
742 | struct perf_sample_data { | 788 | struct perf_sample_data { |
743 | u64 type; | 789 | u64 type; |
@@ -814,6 +860,7 @@ extern int sysctl_perf_event_sample_rate; | |||
814 | extern void perf_event_init(void); | 860 | extern void perf_event_init(void); |
815 | extern void perf_tp_event(int event_id, u64 addr, u64 count, | 861 | extern void perf_tp_event(int event_id, u64 addr, u64 count, |
816 | void *record, int entry_size); | 862 | void *record, int entry_size); |
863 | extern void perf_bp_event(struct perf_event *event, void *data); | ||
817 | 864 | ||
818 | #ifndef perf_misc_flags | 865 | #ifndef perf_misc_flags |
819 | #define perf_misc_flags(regs) (user_mode(regs) ? PERF_RECORD_MISC_USER : \ | 866 | #define perf_misc_flags(regs) (user_mode(regs) ? PERF_RECORD_MISC_USER : \ |
@@ -827,6 +874,8 @@ extern int perf_output_begin(struct perf_output_handle *handle, | |||
827 | extern void perf_output_end(struct perf_output_handle *handle); | 874 | extern void perf_output_end(struct perf_output_handle *handle); |
828 | extern void perf_output_copy(struct perf_output_handle *handle, | 875 | extern void perf_output_copy(struct perf_output_handle *handle, |
829 | const void *buf, unsigned int len); | 876 | const void *buf, unsigned int len); |
877 | extern int perf_swevent_get_recursion_context(void); | ||
878 | extern void perf_swevent_put_recursion_context(int rctx); | ||
830 | #else | 879 | #else |
831 | static inline void | 880 | static inline void |
832 | perf_event_task_sched_in(struct task_struct *task, int cpu) { } | 881 | perf_event_task_sched_in(struct task_struct *task, int cpu) { } |
@@ -848,11 +897,15 @@ static inline int perf_event_task_enable(void) { return -EINVAL; } | |||
848 | static inline void | 897 | static inline void |
849 | perf_sw_event(u32 event_id, u64 nr, int nmi, | 898 | perf_sw_event(u32 event_id, u64 nr, int nmi, |
850 | struct pt_regs *regs, u64 addr) { } | 899 | struct pt_regs *regs, u64 addr) { } |
900 | static inline void | ||
901 | perf_bp_event(struct perf_event *event, void *data) { } | ||
851 | 902 | ||
852 | static inline void perf_event_mmap(struct vm_area_struct *vma) { } | 903 | static inline void perf_event_mmap(struct vm_area_struct *vma) { } |
853 | static inline void perf_event_comm(struct task_struct *tsk) { } | 904 | static inline void perf_event_comm(struct task_struct *tsk) { } |
854 | static inline void perf_event_fork(struct task_struct *tsk) { } | 905 | static inline void perf_event_fork(struct task_struct *tsk) { } |
855 | static inline void perf_event_init(void) { } | 906 | static inline void perf_event_init(void) { } |
907 | static inline int perf_swevent_get_recursion_context(void) { return -1; } | ||
908 | static inline void perf_swevent_put_recursion_context(int rctx) { } | ||
856 | 909 | ||
857 | #endif | 910 | #endif |
858 | 911 | ||
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h index 3c842edff388..7f6ba8658abe 100644 --- a/include/linux/pkt_cls.h +++ b/include/linux/pkt_cls.h | |||
@@ -75,8 +75,7 @@ bits 9,10,11: redirect counter - redirect TTL. Loop avoidance | |||
75 | #define SET_TC_AT(v,n) ((V_TC_AT(n)) | (v & ~M_TC_AT)) | 75 | #define SET_TC_AT(v,n) ((V_TC_AT(n)) | (v & ~M_TC_AT)) |
76 | 76 | ||
77 | /* Action attributes */ | 77 | /* Action attributes */ |
78 | enum | 78 | enum { |
79 | { | ||
80 | TCA_ACT_UNSPEC, | 79 | TCA_ACT_UNSPEC, |
81 | TCA_ACT_KIND, | 80 | TCA_ACT_KIND, |
82 | TCA_ACT_OPTIONS, | 81 | TCA_ACT_OPTIONS, |
@@ -108,8 +107,7 @@ enum | |||
108 | #define TC_ACT_JUMP 0x10000000 | 107 | #define TC_ACT_JUMP 0x10000000 |
109 | 108 | ||
110 | /* Action type identifiers*/ | 109 | /* Action type identifiers*/ |
111 | enum | 110 | enum { |
112 | { | ||
113 | TCA_ID_UNSPEC=0, | 111 | TCA_ID_UNSPEC=0, |
114 | TCA_ID_POLICE=1, | 112 | TCA_ID_POLICE=1, |
115 | /* other actions go here */ | 113 | /* other actions go here */ |
@@ -118,8 +116,7 @@ enum | |||
118 | 116 | ||
119 | #define TCA_ID_MAX __TCA_ID_MAX | 117 | #define TCA_ID_MAX __TCA_ID_MAX |
120 | 118 | ||
121 | struct tc_police | 119 | struct tc_police { |
122 | { | ||
123 | __u32 index; | 120 | __u32 index; |
124 | int action; | 121 | int action; |
125 | #define TC_POLICE_UNSPEC TC_ACT_UNSPEC | 122 | #define TC_POLICE_UNSPEC TC_ACT_UNSPEC |
@@ -138,15 +135,13 @@ struct tc_police | |||
138 | __u32 capab; | 135 | __u32 capab; |
139 | }; | 136 | }; |
140 | 137 | ||
141 | struct tcf_t | 138 | struct tcf_t { |
142 | { | ||
143 | __u64 install; | 139 | __u64 install; |
144 | __u64 lastuse; | 140 | __u64 lastuse; |
145 | __u64 expires; | 141 | __u64 expires; |
146 | }; | 142 | }; |
147 | 143 | ||
148 | struct tc_cnt | 144 | struct tc_cnt { |
149 | { | ||
150 | int refcnt; | 145 | int refcnt; |
151 | int bindcnt; | 146 | int bindcnt; |
152 | }; | 147 | }; |
@@ -158,8 +153,7 @@ struct tc_cnt | |||
158 | int refcnt; \ | 153 | int refcnt; \ |
159 | int bindcnt | 154 | int bindcnt |
160 | 155 | ||
161 | enum | 156 | enum { |
162 | { | ||
163 | TCA_POLICE_UNSPEC, | 157 | TCA_POLICE_UNSPEC, |
164 | TCA_POLICE_TBF, | 158 | TCA_POLICE_TBF, |
165 | TCA_POLICE_RATE, | 159 | TCA_POLICE_RATE, |
@@ -182,8 +176,7 @@ enum | |||
182 | #define TC_U32_UNSPEC 0 | 176 | #define TC_U32_UNSPEC 0 |
183 | #define TC_U32_ROOT (0xFFF00000) | 177 | #define TC_U32_ROOT (0xFFF00000) |
184 | 178 | ||
185 | enum | 179 | enum { |
186 | { | ||
187 | TCA_U32_UNSPEC, | 180 | TCA_U32_UNSPEC, |
188 | TCA_U32_CLASSID, | 181 | TCA_U32_CLASSID, |
189 | TCA_U32_HASH, | 182 | TCA_U32_HASH, |
@@ -200,16 +193,14 @@ enum | |||
200 | 193 | ||
201 | #define TCA_U32_MAX (__TCA_U32_MAX - 1) | 194 | #define TCA_U32_MAX (__TCA_U32_MAX - 1) |
202 | 195 | ||
203 | struct tc_u32_key | 196 | struct tc_u32_key { |
204 | { | ||
205 | __be32 mask; | 197 | __be32 mask; |
206 | __be32 val; | 198 | __be32 val; |
207 | int off; | 199 | int off; |
208 | int offmask; | 200 | int offmask; |
209 | }; | 201 | }; |
210 | 202 | ||
211 | struct tc_u32_sel | 203 | struct tc_u32_sel { |
212 | { | ||
213 | unsigned char flags; | 204 | unsigned char flags; |
214 | unsigned char offshift; | 205 | unsigned char offshift; |
215 | unsigned char nkeys; | 206 | unsigned char nkeys; |
@@ -223,15 +214,13 @@ struct tc_u32_sel | |||
223 | struct tc_u32_key keys[0]; | 214 | struct tc_u32_key keys[0]; |
224 | }; | 215 | }; |
225 | 216 | ||
226 | struct tc_u32_mark | 217 | struct tc_u32_mark { |
227 | { | ||
228 | __u32 val; | 218 | __u32 val; |
229 | __u32 mask; | 219 | __u32 mask; |
230 | __u32 success; | 220 | __u32 success; |
231 | }; | 221 | }; |
232 | 222 | ||
233 | struct tc_u32_pcnt | 223 | struct tc_u32_pcnt { |
234 | { | ||
235 | __u64 rcnt; | 224 | __u64 rcnt; |
236 | __u64 rhit; | 225 | __u64 rhit; |
237 | __u64 kcnts[0]; | 226 | __u64 kcnts[0]; |
@@ -249,8 +238,7 @@ struct tc_u32_pcnt | |||
249 | 238 | ||
250 | /* RSVP filter */ | 239 | /* RSVP filter */ |
251 | 240 | ||
252 | enum | 241 | enum { |
253 | { | ||
254 | TCA_RSVP_UNSPEC, | 242 | TCA_RSVP_UNSPEC, |
255 | TCA_RSVP_CLASSID, | 243 | TCA_RSVP_CLASSID, |
256 | TCA_RSVP_DST, | 244 | TCA_RSVP_DST, |
@@ -263,15 +251,13 @@ enum | |||
263 | 251 | ||
264 | #define TCA_RSVP_MAX (__TCA_RSVP_MAX - 1 ) | 252 | #define TCA_RSVP_MAX (__TCA_RSVP_MAX - 1 ) |
265 | 253 | ||
266 | struct tc_rsvp_gpi | 254 | struct tc_rsvp_gpi { |
267 | { | ||
268 | __u32 key; | 255 | __u32 key; |
269 | __u32 mask; | 256 | __u32 mask; |
270 | int offset; | 257 | int offset; |
271 | }; | 258 | }; |
272 | 259 | ||
273 | struct tc_rsvp_pinfo | 260 | struct tc_rsvp_pinfo { |
274 | { | ||
275 | struct tc_rsvp_gpi dpi; | 261 | struct tc_rsvp_gpi dpi; |
276 | struct tc_rsvp_gpi spi; | 262 | struct tc_rsvp_gpi spi; |
277 | __u8 protocol; | 263 | __u8 protocol; |
@@ -282,8 +268,7 @@ struct tc_rsvp_pinfo | |||
282 | 268 | ||
283 | /* ROUTE filter */ | 269 | /* ROUTE filter */ |
284 | 270 | ||
285 | enum | 271 | enum { |
286 | { | ||
287 | TCA_ROUTE4_UNSPEC, | 272 | TCA_ROUTE4_UNSPEC, |
288 | TCA_ROUTE4_CLASSID, | 273 | TCA_ROUTE4_CLASSID, |
289 | TCA_ROUTE4_TO, | 274 | TCA_ROUTE4_TO, |
@@ -299,8 +284,7 @@ enum | |||
299 | 284 | ||
300 | /* FW filter */ | 285 | /* FW filter */ |
301 | 286 | ||
302 | enum | 287 | enum { |
303 | { | ||
304 | TCA_FW_UNSPEC, | 288 | TCA_FW_UNSPEC, |
305 | TCA_FW_CLASSID, | 289 | TCA_FW_CLASSID, |
306 | TCA_FW_POLICE, | 290 | TCA_FW_POLICE, |
@@ -314,8 +298,7 @@ enum | |||
314 | 298 | ||
315 | /* TC index filter */ | 299 | /* TC index filter */ |
316 | 300 | ||
317 | enum | 301 | enum { |
318 | { | ||
319 | TCA_TCINDEX_UNSPEC, | 302 | TCA_TCINDEX_UNSPEC, |
320 | TCA_TCINDEX_HASH, | 303 | TCA_TCINDEX_HASH, |
321 | TCA_TCINDEX_MASK, | 304 | TCA_TCINDEX_MASK, |
@@ -331,8 +314,7 @@ enum | |||
331 | 314 | ||
332 | /* Flow filter */ | 315 | /* Flow filter */ |
333 | 316 | ||
334 | enum | 317 | enum { |
335 | { | ||
336 | FLOW_KEY_SRC, | 318 | FLOW_KEY_SRC, |
337 | FLOW_KEY_DST, | 319 | FLOW_KEY_DST, |
338 | FLOW_KEY_PROTO, | 320 | FLOW_KEY_PROTO, |
@@ -355,14 +337,12 @@ enum | |||
355 | 337 | ||
356 | #define FLOW_KEY_MAX (__FLOW_KEY_MAX - 1) | 338 | #define FLOW_KEY_MAX (__FLOW_KEY_MAX - 1) |
357 | 339 | ||
358 | enum | 340 | enum { |
359 | { | ||
360 | FLOW_MODE_MAP, | 341 | FLOW_MODE_MAP, |
361 | FLOW_MODE_HASH, | 342 | FLOW_MODE_HASH, |
362 | }; | 343 | }; |
363 | 344 | ||
364 | enum | 345 | enum { |
365 | { | ||
366 | TCA_FLOW_UNSPEC, | 346 | TCA_FLOW_UNSPEC, |
367 | TCA_FLOW_KEYS, | 347 | TCA_FLOW_KEYS, |
368 | TCA_FLOW_MODE, | 348 | TCA_FLOW_MODE, |
@@ -383,8 +363,7 @@ enum | |||
383 | 363 | ||
384 | /* Basic filter */ | 364 | /* Basic filter */ |
385 | 365 | ||
386 | enum | 366 | enum { |
387 | { | ||
388 | TCA_BASIC_UNSPEC, | 367 | TCA_BASIC_UNSPEC, |
389 | TCA_BASIC_CLASSID, | 368 | TCA_BASIC_CLASSID, |
390 | TCA_BASIC_EMATCHES, | 369 | TCA_BASIC_EMATCHES, |
@@ -398,8 +377,7 @@ enum | |||
398 | 377 | ||
399 | /* Cgroup classifier */ | 378 | /* Cgroup classifier */ |
400 | 379 | ||
401 | enum | 380 | enum { |
402 | { | ||
403 | TCA_CGROUP_UNSPEC, | 381 | TCA_CGROUP_UNSPEC, |
404 | TCA_CGROUP_ACT, | 382 | TCA_CGROUP_ACT, |
405 | TCA_CGROUP_POLICE, | 383 | TCA_CGROUP_POLICE, |
@@ -411,14 +389,12 @@ enum | |||
411 | 389 | ||
412 | /* Extended Matches */ | 390 | /* Extended Matches */ |
413 | 391 | ||
414 | struct tcf_ematch_tree_hdr | 392 | struct tcf_ematch_tree_hdr { |
415 | { | ||
416 | __u16 nmatches; | 393 | __u16 nmatches; |
417 | __u16 progid; | 394 | __u16 progid; |
418 | }; | 395 | }; |
419 | 396 | ||
420 | enum | 397 | enum { |
421 | { | ||
422 | TCA_EMATCH_TREE_UNSPEC, | 398 | TCA_EMATCH_TREE_UNSPEC, |
423 | TCA_EMATCH_TREE_HDR, | 399 | TCA_EMATCH_TREE_HDR, |
424 | TCA_EMATCH_TREE_LIST, | 400 | TCA_EMATCH_TREE_LIST, |
@@ -426,8 +402,7 @@ enum | |||
426 | }; | 402 | }; |
427 | #define TCA_EMATCH_TREE_MAX (__TCA_EMATCH_TREE_MAX - 1) | 403 | #define TCA_EMATCH_TREE_MAX (__TCA_EMATCH_TREE_MAX - 1) |
428 | 404 | ||
429 | struct tcf_ematch_hdr | 405 | struct tcf_ematch_hdr { |
430 | { | ||
431 | __u16 matchid; | 406 | __u16 matchid; |
432 | __u16 kind; | 407 | __u16 kind; |
433 | __u16 flags; | 408 | __u16 flags; |
@@ -457,8 +432,7 @@ struct tcf_ematch_hdr | |||
457 | #define TCF_EM_REL_MASK 3 | 432 | #define TCF_EM_REL_MASK 3 |
458 | #define TCF_EM_REL_VALID(v) (((v) & TCF_EM_REL_MASK) != TCF_EM_REL_MASK) | 433 | #define TCF_EM_REL_VALID(v) (((v) & TCF_EM_REL_MASK) != TCF_EM_REL_MASK) |
459 | 434 | ||
460 | enum | 435 | enum { |
461 | { | ||
462 | TCF_LAYER_LINK, | 436 | TCF_LAYER_LINK, |
463 | TCF_LAYER_NETWORK, | 437 | TCF_LAYER_NETWORK, |
464 | TCF_LAYER_TRANSPORT, | 438 | TCF_LAYER_TRANSPORT, |
@@ -479,13 +453,11 @@ enum | |||
479 | #define TCF_EM_VLAN 6 | 453 | #define TCF_EM_VLAN 6 |
480 | #define TCF_EM_MAX 6 | 454 | #define TCF_EM_MAX 6 |
481 | 455 | ||
482 | enum | 456 | enum { |
483 | { | ||
484 | TCF_EM_PROG_TC | 457 | TCF_EM_PROG_TC |
485 | }; | 458 | }; |
486 | 459 | ||
487 | enum | 460 | enum { |
488 | { | ||
489 | TCF_EM_OPND_EQ, | 461 | TCF_EM_OPND_EQ, |
490 | TCF_EM_OPND_GT, | 462 | TCF_EM_OPND_GT, |
491 | TCF_EM_OPND_LT | 463 | TCF_EM_OPND_LT |
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h index d51a2b3e221e..2cfa4bc8dea6 100644 --- a/include/linux/pkt_sched.h +++ b/include/linux/pkt_sched.h | |||
@@ -29,8 +29,7 @@ | |||
29 | Particular schedulers may have also their private records. | 29 | Particular schedulers may have also their private records. |
30 | */ | 30 | */ |
31 | 31 | ||
32 | struct tc_stats | 32 | struct tc_stats { |
33 | { | ||
34 | __u64 bytes; /* NUmber of enqueues bytes */ | 33 | __u64 bytes; /* NUmber of enqueues bytes */ |
35 | __u32 packets; /* Number of enqueued packets */ | 34 | __u32 packets; /* Number of enqueued packets */ |
36 | __u32 drops; /* Packets dropped because of lack of resources */ | 35 | __u32 drops; /* Packets dropped because of lack of resources */ |
@@ -42,8 +41,7 @@ struct tc_stats | |||
42 | __u32 backlog; | 41 | __u32 backlog; |
43 | }; | 42 | }; |
44 | 43 | ||
45 | struct tc_estimator | 44 | struct tc_estimator { |
46 | { | ||
47 | signed char interval; | 45 | signed char interval; |
48 | unsigned char ewma_log; | 46 | unsigned char ewma_log; |
49 | }; | 47 | }; |
@@ -75,8 +73,7 @@ struct tc_estimator | |||
75 | #define TC_H_ROOT (0xFFFFFFFFU) | 73 | #define TC_H_ROOT (0xFFFFFFFFU) |
76 | #define TC_H_INGRESS (0xFFFFFFF1U) | 74 | #define TC_H_INGRESS (0xFFFFFFF1U) |
77 | 75 | ||
78 | struct tc_ratespec | 76 | struct tc_ratespec { |
79 | { | ||
80 | unsigned char cell_log; | 77 | unsigned char cell_log; |
81 | unsigned char __reserved; | 78 | unsigned char __reserved; |
82 | unsigned short overhead; | 79 | unsigned short overhead; |
@@ -109,8 +106,7 @@ enum { | |||
109 | 106 | ||
110 | /* FIFO section */ | 107 | /* FIFO section */ |
111 | 108 | ||
112 | struct tc_fifo_qopt | 109 | struct tc_fifo_qopt { |
113 | { | ||
114 | __u32 limit; /* Queue length: bytes for bfifo, packets for pfifo */ | 110 | __u32 limit; /* Queue length: bytes for bfifo, packets for pfifo */ |
115 | }; | 111 | }; |
116 | 112 | ||
@@ -119,8 +115,7 @@ struct tc_fifo_qopt | |||
119 | #define TCQ_PRIO_BANDS 16 | 115 | #define TCQ_PRIO_BANDS 16 |
120 | #define TCQ_MIN_PRIO_BANDS 2 | 116 | #define TCQ_MIN_PRIO_BANDS 2 |
121 | 117 | ||
122 | struct tc_prio_qopt | 118 | struct tc_prio_qopt { |
123 | { | ||
124 | int bands; /* Number of bands */ | 119 | int bands; /* Number of bands */ |
125 | __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */ | 120 | __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */ |
126 | }; | 121 | }; |
@@ -134,8 +129,7 @@ struct tc_multiq_qopt { | |||
134 | 129 | ||
135 | /* TBF section */ | 130 | /* TBF section */ |
136 | 131 | ||
137 | struct tc_tbf_qopt | 132 | struct tc_tbf_qopt { |
138 | { | ||
139 | struct tc_ratespec rate; | 133 | struct tc_ratespec rate; |
140 | struct tc_ratespec peakrate; | 134 | struct tc_ratespec peakrate; |
141 | __u32 limit; | 135 | __u32 limit; |
@@ -143,8 +137,7 @@ struct tc_tbf_qopt | |||
143 | __u32 mtu; | 137 | __u32 mtu; |
144 | }; | 138 | }; |
145 | 139 | ||
146 | enum | 140 | enum { |
147 | { | ||
148 | TCA_TBF_UNSPEC, | 141 | TCA_TBF_UNSPEC, |
149 | TCA_TBF_PARMS, | 142 | TCA_TBF_PARMS, |
150 | TCA_TBF_RTAB, | 143 | TCA_TBF_RTAB, |
@@ -161,8 +154,7 @@ enum | |||
161 | 154 | ||
162 | /* SFQ section */ | 155 | /* SFQ section */ |
163 | 156 | ||
164 | struct tc_sfq_qopt | 157 | struct tc_sfq_qopt { |
165 | { | ||
166 | unsigned quantum; /* Bytes per round allocated to flow */ | 158 | unsigned quantum; /* Bytes per round allocated to flow */ |
167 | int perturb_period; /* Period of hash perturbation */ | 159 | int perturb_period; /* Period of hash perturbation */ |
168 | __u32 limit; /* Maximal packets in queue */ | 160 | __u32 limit; /* Maximal packets in queue */ |
@@ -170,8 +162,7 @@ struct tc_sfq_qopt | |||
170 | unsigned flows; /* Maximal number of flows */ | 162 | unsigned flows; /* Maximal number of flows */ |
171 | }; | 163 | }; |
172 | 164 | ||
173 | struct tc_sfq_xstats | 165 | struct tc_sfq_xstats { |
174 | { | ||
175 | __s32 allot; | 166 | __s32 allot; |
176 | }; | 167 | }; |
177 | 168 | ||
@@ -186,8 +177,7 @@ struct tc_sfq_xstats | |||
186 | 177 | ||
187 | /* RED section */ | 178 | /* RED section */ |
188 | 179 | ||
189 | enum | 180 | enum { |
190 | { | ||
191 | TCA_RED_UNSPEC, | 181 | TCA_RED_UNSPEC, |
192 | TCA_RED_PARMS, | 182 | TCA_RED_PARMS, |
193 | TCA_RED_STAB, | 183 | TCA_RED_STAB, |
@@ -196,8 +186,7 @@ enum | |||
196 | 186 | ||
197 | #define TCA_RED_MAX (__TCA_RED_MAX - 1) | 187 | #define TCA_RED_MAX (__TCA_RED_MAX - 1) |
198 | 188 | ||
199 | struct tc_red_qopt | 189 | struct tc_red_qopt { |
200 | { | ||
201 | __u32 limit; /* HARD maximal queue length (bytes) */ | 190 | __u32 limit; /* HARD maximal queue length (bytes) */ |
202 | __u32 qth_min; /* Min average length threshold (bytes) */ | 191 | __u32 qth_min; /* Min average length threshold (bytes) */ |
203 | __u32 qth_max; /* Max average length threshold (bytes) */ | 192 | __u32 qth_max; /* Max average length threshold (bytes) */ |
@@ -209,8 +198,7 @@ struct tc_red_qopt | |||
209 | #define TC_RED_HARDDROP 2 | 198 | #define TC_RED_HARDDROP 2 |
210 | }; | 199 | }; |
211 | 200 | ||
212 | struct tc_red_xstats | 201 | struct tc_red_xstats { |
213 | { | ||
214 | __u32 early; /* Early drops */ | 202 | __u32 early; /* Early drops */ |
215 | __u32 pdrop; /* Drops due to queue limits */ | 203 | __u32 pdrop; /* Drops due to queue limits */ |
216 | __u32 other; /* Drops due to drop() calls */ | 204 | __u32 other; /* Drops due to drop() calls */ |
@@ -221,8 +209,7 @@ struct tc_red_xstats | |||
221 | 209 | ||
222 | #define MAX_DPs 16 | 210 | #define MAX_DPs 16 |
223 | 211 | ||
224 | enum | 212 | enum { |
225 | { | ||
226 | TCA_GRED_UNSPEC, | 213 | TCA_GRED_UNSPEC, |
227 | TCA_GRED_PARMS, | 214 | TCA_GRED_PARMS, |
228 | TCA_GRED_STAB, | 215 | TCA_GRED_STAB, |
@@ -232,8 +219,7 @@ enum | |||
232 | 219 | ||
233 | #define TCA_GRED_MAX (__TCA_GRED_MAX - 1) | 220 | #define TCA_GRED_MAX (__TCA_GRED_MAX - 1) |
234 | 221 | ||
235 | struct tc_gred_qopt | 222 | struct tc_gred_qopt { |
236 | { | ||
237 | __u32 limit; /* HARD maximal queue length (bytes) */ | 223 | __u32 limit; /* HARD maximal queue length (bytes) */ |
238 | __u32 qth_min; /* Min average length threshold (bytes) */ | 224 | __u32 qth_min; /* Min average length threshold (bytes) */ |
239 | __u32 qth_max; /* Max average length threshold (bytes) */ | 225 | __u32 qth_max; /* Max average length threshold (bytes) */ |
@@ -253,8 +239,7 @@ struct tc_gred_qopt | |||
253 | }; | 239 | }; |
254 | 240 | ||
255 | /* gred setup */ | 241 | /* gred setup */ |
256 | struct tc_gred_sopt | 242 | struct tc_gred_sopt { |
257 | { | ||
258 | __u32 DPs; | 243 | __u32 DPs; |
259 | __u32 def_DP; | 244 | __u32 def_DP; |
260 | __u8 grio; | 245 | __u8 grio; |
@@ -267,8 +252,7 @@ struct tc_gred_sopt | |||
267 | #define TC_HTB_MAXDEPTH 8 | 252 | #define TC_HTB_MAXDEPTH 8 |
268 | #define TC_HTB_PROTOVER 3 /* the same as HTB and TC's major */ | 253 | #define TC_HTB_PROTOVER 3 /* the same as HTB and TC's major */ |
269 | 254 | ||
270 | struct tc_htb_opt | 255 | struct tc_htb_opt { |
271 | { | ||
272 | struct tc_ratespec rate; | 256 | struct tc_ratespec rate; |
273 | struct tc_ratespec ceil; | 257 | struct tc_ratespec ceil; |
274 | __u32 buffer; | 258 | __u32 buffer; |
@@ -277,8 +261,7 @@ struct tc_htb_opt | |||
277 | __u32 level; /* out only */ | 261 | __u32 level; /* out only */ |
278 | __u32 prio; | 262 | __u32 prio; |
279 | }; | 263 | }; |
280 | struct tc_htb_glob | 264 | struct tc_htb_glob { |
281 | { | ||
282 | __u32 version; /* to match HTB/TC */ | 265 | __u32 version; /* to match HTB/TC */ |
283 | __u32 rate2quantum; /* bps->quantum divisor */ | 266 | __u32 rate2quantum; /* bps->quantum divisor */ |
284 | __u32 defcls; /* default class number */ | 267 | __u32 defcls; /* default class number */ |
@@ -287,8 +270,7 @@ struct tc_htb_glob | |||
287 | /* stats */ | 270 | /* stats */ |
288 | __u32 direct_pkts; /* count of non shapped packets */ | 271 | __u32 direct_pkts; /* count of non shapped packets */ |
289 | }; | 272 | }; |
290 | enum | 273 | enum { |
291 | { | ||
292 | TCA_HTB_UNSPEC, | 274 | TCA_HTB_UNSPEC, |
293 | TCA_HTB_PARMS, | 275 | TCA_HTB_PARMS, |
294 | TCA_HTB_INIT, | 276 | TCA_HTB_INIT, |
@@ -299,8 +281,7 @@ enum | |||
299 | 281 | ||
300 | #define TCA_HTB_MAX (__TCA_HTB_MAX - 1) | 282 | #define TCA_HTB_MAX (__TCA_HTB_MAX - 1) |
301 | 283 | ||
302 | struct tc_htb_xstats | 284 | struct tc_htb_xstats { |
303 | { | ||
304 | __u32 lends; | 285 | __u32 lends; |
305 | __u32 borrows; | 286 | __u32 borrows; |
306 | __u32 giants; /* too big packets (rate will not be accurate) */ | 287 | __u32 giants; /* too big packets (rate will not be accurate) */ |
@@ -310,28 +291,24 @@ struct tc_htb_xstats | |||
310 | 291 | ||
311 | /* HFSC section */ | 292 | /* HFSC section */ |
312 | 293 | ||
313 | struct tc_hfsc_qopt | 294 | struct tc_hfsc_qopt { |
314 | { | ||
315 | __u16 defcls; /* default class */ | 295 | __u16 defcls; /* default class */ |
316 | }; | 296 | }; |
317 | 297 | ||
318 | struct tc_service_curve | 298 | struct tc_service_curve { |
319 | { | ||
320 | __u32 m1; /* slope of the first segment in bps */ | 299 | __u32 m1; /* slope of the first segment in bps */ |
321 | __u32 d; /* x-projection of the first segment in us */ | 300 | __u32 d; /* x-projection of the first segment in us */ |
322 | __u32 m2; /* slope of the second segment in bps */ | 301 | __u32 m2; /* slope of the second segment in bps */ |
323 | }; | 302 | }; |
324 | 303 | ||
325 | struct tc_hfsc_stats | 304 | struct tc_hfsc_stats { |
326 | { | ||
327 | __u64 work; /* total work done */ | 305 | __u64 work; /* total work done */ |
328 | __u64 rtwork; /* work done by real-time criteria */ | 306 | __u64 rtwork; /* work done by real-time criteria */ |
329 | __u32 period; /* current period */ | 307 | __u32 period; /* current period */ |
330 | __u32 level; /* class level in hierarchy */ | 308 | __u32 level; /* class level in hierarchy */ |
331 | }; | 309 | }; |
332 | 310 | ||
333 | enum | 311 | enum { |
334 | { | ||
335 | TCA_HFSC_UNSPEC, | 312 | TCA_HFSC_UNSPEC, |
336 | TCA_HFSC_RSC, | 313 | TCA_HFSC_RSC, |
337 | TCA_HFSC_FSC, | 314 | TCA_HFSC_FSC, |
@@ -348,8 +325,7 @@ enum | |||
348 | #define TC_CBQ_MAXLEVEL 8 | 325 | #define TC_CBQ_MAXLEVEL 8 |
349 | #define TC_CBQ_DEF_EWMA 5 | 326 | #define TC_CBQ_DEF_EWMA 5 |
350 | 327 | ||
351 | struct tc_cbq_lssopt | 328 | struct tc_cbq_lssopt { |
352 | { | ||
353 | unsigned char change; | 329 | unsigned char change; |
354 | unsigned char flags; | 330 | unsigned char flags; |
355 | #define TCF_CBQ_LSS_BOUNDED 1 | 331 | #define TCF_CBQ_LSS_BOUNDED 1 |
@@ -368,8 +344,7 @@ struct tc_cbq_lssopt | |||
368 | __u32 avpkt; | 344 | __u32 avpkt; |
369 | }; | 345 | }; |
370 | 346 | ||
371 | struct tc_cbq_wrropt | 347 | struct tc_cbq_wrropt { |
372 | { | ||
373 | unsigned char flags; | 348 | unsigned char flags; |
374 | unsigned char priority; | 349 | unsigned char priority; |
375 | unsigned char cpriority; | 350 | unsigned char cpriority; |
@@ -378,8 +353,7 @@ struct tc_cbq_wrropt | |||
378 | __u32 weight; | 353 | __u32 weight; |
379 | }; | 354 | }; |
380 | 355 | ||
381 | struct tc_cbq_ovl | 356 | struct tc_cbq_ovl { |
382 | { | ||
383 | unsigned char strategy; | 357 | unsigned char strategy; |
384 | #define TC_CBQ_OVL_CLASSIC 0 | 358 | #define TC_CBQ_OVL_CLASSIC 0 |
385 | #define TC_CBQ_OVL_DELAY 1 | 359 | #define TC_CBQ_OVL_DELAY 1 |
@@ -391,30 +365,26 @@ struct tc_cbq_ovl | |||
391 | __u32 penalty; | 365 | __u32 penalty; |
392 | }; | 366 | }; |
393 | 367 | ||
394 | struct tc_cbq_police | 368 | struct tc_cbq_police { |
395 | { | ||
396 | unsigned char police; | 369 | unsigned char police; |
397 | unsigned char __res1; | 370 | unsigned char __res1; |
398 | unsigned short __res2; | 371 | unsigned short __res2; |
399 | }; | 372 | }; |
400 | 373 | ||
401 | struct tc_cbq_fopt | 374 | struct tc_cbq_fopt { |
402 | { | ||
403 | __u32 split; | 375 | __u32 split; |
404 | __u32 defmap; | 376 | __u32 defmap; |
405 | __u32 defchange; | 377 | __u32 defchange; |
406 | }; | 378 | }; |
407 | 379 | ||
408 | struct tc_cbq_xstats | 380 | struct tc_cbq_xstats { |
409 | { | ||
410 | __u32 borrows; | 381 | __u32 borrows; |
411 | __u32 overactions; | 382 | __u32 overactions; |
412 | __s32 avgidle; | 383 | __s32 avgidle; |
413 | __s32 undertime; | 384 | __s32 undertime; |
414 | }; | 385 | }; |
415 | 386 | ||
416 | enum | 387 | enum { |
417 | { | ||
418 | TCA_CBQ_UNSPEC, | 388 | TCA_CBQ_UNSPEC, |
419 | TCA_CBQ_LSSOPT, | 389 | TCA_CBQ_LSSOPT, |
420 | TCA_CBQ_WRROPT, | 390 | TCA_CBQ_WRROPT, |
@@ -459,8 +429,7 @@ enum { | |||
459 | 429 | ||
460 | /* Network emulator */ | 430 | /* Network emulator */ |
461 | 431 | ||
462 | enum | 432 | enum { |
463 | { | ||
464 | TCA_NETEM_UNSPEC, | 433 | TCA_NETEM_UNSPEC, |
465 | TCA_NETEM_CORR, | 434 | TCA_NETEM_CORR, |
466 | TCA_NETEM_DELAY_DIST, | 435 | TCA_NETEM_DELAY_DIST, |
@@ -471,8 +440,7 @@ enum | |||
471 | 440 | ||
472 | #define TCA_NETEM_MAX (__TCA_NETEM_MAX - 1) | 441 | #define TCA_NETEM_MAX (__TCA_NETEM_MAX - 1) |
473 | 442 | ||
474 | struct tc_netem_qopt | 443 | struct tc_netem_qopt { |
475 | { | ||
476 | __u32 latency; /* added delay (us) */ | 444 | __u32 latency; /* added delay (us) */ |
477 | __u32 limit; /* fifo limit (packets) */ | 445 | __u32 limit; /* fifo limit (packets) */ |
478 | __u32 loss; /* random packet loss (0=none ~0=100%) */ | 446 | __u32 loss; /* random packet loss (0=none ~0=100%) */ |
@@ -481,21 +449,18 @@ struct tc_netem_qopt | |||
481 | __u32 jitter; /* random jitter in latency (us) */ | 449 | __u32 jitter; /* random jitter in latency (us) */ |
482 | }; | 450 | }; |
483 | 451 | ||
484 | struct tc_netem_corr | 452 | struct tc_netem_corr { |
485 | { | ||
486 | __u32 delay_corr; /* delay correlation */ | 453 | __u32 delay_corr; /* delay correlation */ |
487 | __u32 loss_corr; /* packet loss correlation */ | 454 | __u32 loss_corr; /* packet loss correlation */ |
488 | __u32 dup_corr; /* duplicate correlation */ | 455 | __u32 dup_corr; /* duplicate correlation */ |
489 | }; | 456 | }; |
490 | 457 | ||
491 | struct tc_netem_reorder | 458 | struct tc_netem_reorder { |
492 | { | ||
493 | __u32 probability; | 459 | __u32 probability; |
494 | __u32 correlation; | 460 | __u32 correlation; |
495 | }; | 461 | }; |
496 | 462 | ||
497 | struct tc_netem_corrupt | 463 | struct tc_netem_corrupt { |
498 | { | ||
499 | __u32 probability; | 464 | __u32 probability; |
500 | __u32 correlation; | 465 | __u32 correlation; |
501 | }; | 466 | }; |
@@ -504,8 +469,7 @@ struct tc_netem_corrupt | |||
504 | 469 | ||
505 | /* DRR */ | 470 | /* DRR */ |
506 | 471 | ||
507 | enum | 472 | enum { |
508 | { | ||
509 | TCA_DRR_UNSPEC, | 473 | TCA_DRR_UNSPEC, |
510 | TCA_DRR_QUANTUM, | 474 | TCA_DRR_QUANTUM, |
511 | __TCA_DRR_MAX | 475 | __TCA_DRR_MAX |
@@ -513,8 +477,7 @@ enum | |||
513 | 477 | ||
514 | #define TCA_DRR_MAX (__TCA_DRR_MAX - 1) | 478 | #define TCA_DRR_MAX (__TCA_DRR_MAX - 1) |
515 | 479 | ||
516 | struct tc_drr_stats | 480 | struct tc_drr_stats { |
517 | { | ||
518 | __u32 deficit; | 481 | __u32 deficit; |
519 | }; | 482 | }; |
520 | 483 | ||
diff --git a/include/linux/pktcdvd.h b/include/linux/pktcdvd.h index d745f5b6c7b0..76e5053e1fac 100644 --- a/include/linux/pktcdvd.h +++ b/include/linux/pktcdvd.h | |||
@@ -30,7 +30,7 @@ | |||
30 | 30 | ||
31 | /* | 31 | /* |
32 | * use drive write caching -- we need deferred error handling to be | 32 | * use drive write caching -- we need deferred error handling to be |
33 | * able to sucessfully recover with this option (drive will return good | 33 | * able to successfully recover with this option (drive will return good |
34 | * status as soon as the cdb is validated). | 34 | * status as soon as the cdb is validated). |
35 | */ | 35 | */ |
36 | #if defined(CONFIG_CDROM_PKTCDVD_WCACHE) | 36 | #if defined(CONFIG_CDROM_PKTCDVD_WCACHE) |
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h index 3c6675c2444b..71ff887ca44e 100644 --- a/include/linux/platform_device.h +++ b/include/linux/platform_device.h | |||
@@ -83,6 +83,8 @@ struct early_platform_driver { | |||
83 | struct platform_driver *pdrv; | 83 | struct platform_driver *pdrv; |
84 | struct list_head list; | 84 | struct list_head list; |
85 | int requested_id; | 85 | int requested_id; |
86 | char *buffer; | ||
87 | int bufsize; | ||
86 | }; | 88 | }; |
87 | 89 | ||
88 | #define EARLY_PLATFORM_ID_UNSET -2 | 90 | #define EARLY_PLATFORM_ID_UNSET -2 |
@@ -102,21 +104,29 @@ extern int early_platform_driver_probe(char *class_str, | |||
102 | int nr_probe, int user_only); | 104 | int nr_probe, int user_only); |
103 | extern void early_platform_cleanup(void); | 105 | extern void early_platform_cleanup(void); |
104 | 106 | ||
107 | #define early_platform_init(class_string, platdrv) \ | ||
108 | early_platform_init_buffer(class_string, platdrv, NULL, 0) | ||
105 | 109 | ||
106 | #ifndef MODULE | 110 | #ifndef MODULE |
107 | #define early_platform_init(class_string, platform_driver) \ | 111 | #define early_platform_init_buffer(class_string, platdrv, buf, bufsiz) \ |
108 | static __initdata struct early_platform_driver early_driver = { \ | 112 | static __initdata struct early_platform_driver early_driver = { \ |
109 | .class_str = class_string, \ | 113 | .class_str = class_string, \ |
110 | .pdrv = platform_driver, \ | 114 | .buffer = buf, \ |
115 | .bufsize = bufsiz, \ | ||
116 | .pdrv = platdrv, \ | ||
111 | .requested_id = EARLY_PLATFORM_ID_UNSET, \ | 117 | .requested_id = EARLY_PLATFORM_ID_UNSET, \ |
112 | }; \ | 118 | }; \ |
113 | static int __init early_platform_driver_setup_func(char *buf) \ | 119 | static int __init early_platform_driver_setup_func(char *buffer) \ |
114 | { \ | 120 | { \ |
115 | return early_platform_driver_register(&early_driver, buf); \ | 121 | return early_platform_driver_register(&early_driver, buffer); \ |
116 | } \ | 122 | } \ |
117 | early_param(class_string, early_platform_driver_setup_func) | 123 | early_param(class_string, early_platform_driver_setup_func) |
118 | #else /* MODULE */ | 124 | #else /* MODULE */ |
119 | #define early_platform_init(class_string, platform_driver) | 125 | #define early_platform_init_buffer(class_string, platdrv, buf, bufsiz) \ |
126 | static inline char *early_platform_driver_setup_func(void) \ | ||
127 | { \ | ||
128 | return bufsiz ? buf : NULL; \ | ||
129 | } | ||
120 | #endif /* MODULE */ | 130 | #endif /* MODULE */ |
121 | 131 | ||
122 | #endif /* _PLATFORM_DEVICE_H_ */ | 132 | #endif /* _PLATFORM_DEVICE_H_ */ |
diff --git a/include/linux/pm.h b/include/linux/pm.h index 3b7e04b95bd2..0d65934246af 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h | |||
@@ -178,9 +178,10 @@ typedef struct pm_message { | |||
178 | * This need not mean that the device should be put into a low power state. | 178 | * This need not mean that the device should be put into a low power state. |
179 | * For example, if the device is behind a link which is about to be turned | 179 | * For example, if the device is behind a link which is about to be turned |
180 | * off, the device may remain at full power. If the device does go to low | 180 | * off, the device may remain at full power. If the device does go to low |
181 | * power and if device_may_wakeup(dev) is true, remote wake-up (i.e., a | 181 | * power and is capable of generating run-time wake-up events, remote |
182 | * hardware mechanism allowing the device to request a change of its power | 182 | * wake-up (i.e., a hardware mechanism allowing the device to request a |
183 | * state, such as PCI PME) should be enabled for it. | 183 | * change of its power state via a wake-up event, such as PCI PME) should |
184 | * be enabled for it. | ||
184 | * | 185 | * |
185 | * @runtime_resume: Put the device into the fully active state in response to a | 186 | * @runtime_resume: Put the device into the fully active state in response to a |
186 | * wake-up event generated by hardware or at the request of software. If | 187 | * wake-up event generated by hardware or at the request of software. If |
@@ -428,6 +429,7 @@ struct dev_pm_info { | |||
428 | unsigned int idle_notification:1; | 429 | unsigned int idle_notification:1; |
429 | unsigned int request_pending:1; | 430 | unsigned int request_pending:1; |
430 | unsigned int deferred_resume:1; | 431 | unsigned int deferred_resume:1; |
432 | unsigned int run_wake:1; | ||
431 | enum rpm_request request; | 433 | enum rpm_request request; |
432 | enum rpm_status runtime_status; | 434 | enum rpm_status runtime_status; |
433 | int runtime_error; | 435 | int runtime_error; |
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 44087044910f..370ce0a6fe4a 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h | |||
@@ -50,6 +50,16 @@ static inline void pm_runtime_put_noidle(struct device *dev) | |||
50 | atomic_add_unless(&dev->power.usage_count, -1, 0); | 50 | atomic_add_unless(&dev->power.usage_count, -1, 0); |
51 | } | 51 | } |
52 | 52 | ||
53 | static inline bool device_run_wake(struct device *dev) | ||
54 | { | ||
55 | return dev->power.run_wake; | ||
56 | } | ||
57 | |||
58 | static inline void device_set_run_wake(struct device *dev, bool enable) | ||
59 | { | ||
60 | dev->power.run_wake = enable; | ||
61 | } | ||
62 | |||
53 | #else /* !CONFIG_PM_RUNTIME */ | 63 | #else /* !CONFIG_PM_RUNTIME */ |
54 | 64 | ||
55 | static inline int pm_runtime_idle(struct device *dev) { return -ENOSYS; } | 65 | static inline int pm_runtime_idle(struct device *dev) { return -ENOSYS; } |
@@ -73,6 +83,8 @@ static inline bool pm_children_suspended(struct device *dev) { return false; } | |||
73 | static inline void pm_suspend_ignore_children(struct device *dev, bool en) {} | 83 | static inline void pm_suspend_ignore_children(struct device *dev, bool en) {} |
74 | static inline void pm_runtime_get_noresume(struct device *dev) {} | 84 | static inline void pm_runtime_get_noresume(struct device *dev) {} |
75 | static inline void pm_runtime_put_noidle(struct device *dev) {} | 85 | static inline void pm_runtime_put_noidle(struct device *dev) {} |
86 | static inline bool device_run_wake(struct device *dev) { return false; } | ||
87 | static inline void device_set_run_wake(struct device *dev, bool enable) {} | ||
76 | 88 | ||
77 | #endif /* !CONFIG_PM_RUNTIME */ | 89 | #endif /* !CONFIG_PM_RUNTIME */ |
78 | 90 | ||
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h index 065a3652a3ea..67608161df6b 100644 --- a/include/linux/posix_acl.h +++ b/include/linux/posix_acl.h | |||
@@ -147,6 +147,20 @@ static inline void forget_cached_acl(struct inode *inode, int type) | |||
147 | if (old != ACL_NOT_CACHED) | 147 | if (old != ACL_NOT_CACHED) |
148 | posix_acl_release(old); | 148 | posix_acl_release(old); |
149 | } | 149 | } |
150 | |||
151 | static inline void forget_all_cached_acls(struct inode *inode) | ||
152 | { | ||
153 | struct posix_acl *old_access, *old_default; | ||
154 | spin_lock(&inode->i_lock); | ||
155 | old_access = inode->i_acl; | ||
156 | old_default = inode->i_default_acl; | ||
157 | inode->i_acl = inode->i_default_acl = ACL_NOT_CACHED; | ||
158 | spin_unlock(&inode->i_lock); | ||
159 | if (old_access != ACL_NOT_CACHED) | ||
160 | posix_acl_release(old_access); | ||
161 | if (old_default != ACL_NOT_CACHED) | ||
162 | posix_acl_release(old_default); | ||
163 | } | ||
150 | #endif | 164 | #endif |
151 | 165 | ||
152 | static inline void cache_no_acl(struct inode *inode) | 166 | static inline void cache_no_acl(struct inode *inode) |
diff --git a/include/linux/preempt.h b/include/linux/preempt.h index 72b1a10a59b6..2e681d9555bd 100644 --- a/include/linux/preempt.h +++ b/include/linux/preempt.h | |||
@@ -105,6 +105,11 @@ struct preempt_notifier; | |||
105 | * @sched_out: we've just been preempted | 105 | * @sched_out: we've just been preempted |
106 | * notifier: struct preempt_notifier for the task being preempted | 106 | * notifier: struct preempt_notifier for the task being preempted |
107 | * next: the task that's kicking us out | 107 | * next: the task that's kicking us out |
108 | * | ||
109 | * Please note that sched_in and out are called under different | ||
110 | * contexts. sched_out is called with rq lock held and irq disabled | ||
111 | * while sched_in is called without rq lock and irq enabled. This | ||
112 | * difference is intentional and depended upon by its users. | ||
108 | */ | 113 | */ |
109 | struct preempt_ops { | 114 | struct preempt_ops { |
110 | void (*sched_in)(struct preempt_notifier *notifier, int cpu); | 115 | void (*sched_in)(struct preempt_notifier *notifier, int cpu); |
diff --git a/include/linux/quota.h b/include/linux/quota.h index 78c48895b12a..ce9a9b2e5cd4 100644 --- a/include/linux/quota.h +++ b/include/linux/quota.h | |||
@@ -376,6 +376,17 @@ static inline unsigned int dquot_generic_flag(unsigned int flags, int type) | |||
376 | return flags >> _DQUOT_STATE_FLAGS; | 376 | return flags >> _DQUOT_STATE_FLAGS; |
377 | } | 377 | } |
378 | 378 | ||
379 | #ifdef CONFIG_QUOTA_NETLINK_INTERFACE | ||
380 | extern void quota_send_warning(short type, unsigned int id, dev_t dev, | ||
381 | const char warntype); | ||
382 | #else | ||
383 | static inline void quota_send_warning(short type, unsigned int id, dev_t dev, | ||
384 | const char warntype) | ||
385 | { | ||
386 | return; | ||
387 | } | ||
388 | #endif /* CONFIG_QUOTA_NETLINK_INTERFACE */ | ||
389 | |||
379 | struct quota_info { | 390 | struct quota_info { |
380 | unsigned int flags; /* Flags for diskquotas on this device */ | 391 | unsigned int flags; /* Flags for diskquotas on this device */ |
381 | struct mutex dqio_mutex; /* lock device while I/O in progress */ | 392 | struct mutex dqio_mutex; /* lock device while I/O in progress */ |
diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h index 00044b856453..668cf1bef030 100644 --- a/include/linux/ratelimit.h +++ b/include/linux/ratelimit.h | |||
@@ -1,20 +1,31 @@ | |||
1 | #ifndef _LINUX_RATELIMIT_H | 1 | #ifndef _LINUX_RATELIMIT_H |
2 | #define _LINUX_RATELIMIT_H | 2 | #define _LINUX_RATELIMIT_H |
3 | |||
3 | #include <linux/param.h> | 4 | #include <linux/param.h> |
5 | #include <linux/spinlock_types.h> | ||
4 | 6 | ||
5 | #define DEFAULT_RATELIMIT_INTERVAL (5 * HZ) | 7 | #define DEFAULT_RATELIMIT_INTERVAL (5 * HZ) |
6 | #define DEFAULT_RATELIMIT_BURST 10 | 8 | #define DEFAULT_RATELIMIT_BURST 10 |
7 | 9 | ||
8 | struct ratelimit_state { | 10 | struct ratelimit_state { |
9 | int interval; | 11 | spinlock_t lock; /* protect the state */ |
10 | int burst; | 12 | |
11 | int printed; | 13 | int interval; |
12 | int missed; | 14 | int burst; |
13 | unsigned long begin; | 15 | int printed; |
16 | int missed; | ||
17 | unsigned long begin; | ||
14 | }; | 18 | }; |
15 | 19 | ||
16 | #define DEFINE_RATELIMIT_STATE(name, interval, burst) \ | 20 | #define DEFINE_RATELIMIT_STATE(name, interval_init, burst_init) \ |
17 | struct ratelimit_state name = {interval, burst,} | 21 | \ |
22 | struct ratelimit_state name = { \ | ||
23 | .lock = __SPIN_LOCK_UNLOCKED(name.lock), \ | ||
24 | .interval = interval_init, \ | ||
25 | .burst = burst_init, \ | ||
26 | } | ||
27 | |||
28 | extern int ___ratelimit(struct ratelimit_state *rs, const char *func); | ||
29 | #define __ratelimit(state) ___ratelimit(state, __func__) | ||
18 | 30 | ||
19 | extern int __ratelimit(struct ratelimit_state *rs); | 31 | #endif /* _LINUX_RATELIMIT_H */ |
20 | #endif | ||
diff --git a/include/linux/rculist.h b/include/linux/rculist.h index 5710f43bbc9e..1bf0f708c4fc 100644 --- a/include/linux/rculist.h +++ b/include/linux/rculist.h | |||
@@ -262,6 +262,20 @@ static inline void list_splice_init_rcu(struct list_head *list, | |||
262 | (pos) = rcu_dereference((pos)->next)) | 262 | (pos) = rcu_dereference((pos)->next)) |
263 | 263 | ||
264 | /** | 264 | /** |
265 | * list_for_each_entry_continue_rcu - continue iteration over list of given type | ||
266 | * @pos: the type * to use as a loop cursor. | ||
267 | * @head: the head for your list. | ||
268 | * @member: the name of the list_struct within the struct. | ||
269 | * | ||
270 | * Continue to iterate over list of given type, continuing after | ||
271 | * the current position. | ||
272 | */ | ||
273 | #define list_for_each_entry_continue_rcu(pos, head, member) \ | ||
274 | for (pos = list_entry_rcu(pos->member.next, typeof(*pos), member); \ | ||
275 | prefetch(pos->member.next), &pos->member != (head); \ | ||
276 | pos = list_entry_rcu(pos->member.next, typeof(*pos), member)) | ||
277 | |||
278 | /** | ||
265 | * hlist_del_rcu - deletes entry from hash list without re-initialization | 279 | * hlist_del_rcu - deletes entry from hash list without re-initialization |
266 | * @n: the element to delete from the hash list. | 280 | * @n: the element to delete from the hash list. |
267 | * | 281 | * |
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h index 3ebd0b7bcb08..24440f4bf476 100644 --- a/include/linux/rcupdate.h +++ b/include/linux/rcupdate.h | |||
@@ -52,11 +52,6 @@ struct rcu_head { | |||
52 | }; | 52 | }; |
53 | 53 | ||
54 | /* Exported common interfaces */ | 54 | /* Exported common interfaces */ |
55 | #ifdef CONFIG_TREE_PREEMPT_RCU | ||
56 | extern void synchronize_rcu(void); | ||
57 | #else /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | ||
58 | #define synchronize_rcu synchronize_sched | ||
59 | #endif /* #else #ifdef CONFIG_TREE_PREEMPT_RCU */ | ||
60 | extern void synchronize_rcu_bh(void); | 55 | extern void synchronize_rcu_bh(void); |
61 | extern void synchronize_sched(void); | 56 | extern void synchronize_sched(void); |
62 | extern void rcu_barrier(void); | 57 | extern void rcu_barrier(void); |
@@ -67,12 +62,11 @@ extern int sched_expedited_torture_stats(char *page); | |||
67 | 62 | ||
68 | /* Internal to kernel */ | 63 | /* Internal to kernel */ |
69 | extern void rcu_init(void); | 64 | extern void rcu_init(void); |
70 | extern void rcu_scheduler_starting(void); | ||
71 | extern int rcu_needs_cpu(int cpu); | ||
72 | extern int rcu_scheduler_active; | ||
73 | 65 | ||
74 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) | 66 | #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) |
75 | #include <linux/rcutree.h> | 67 | #include <linux/rcutree.h> |
68 | #elif defined(CONFIG_TINY_RCU) | ||
69 | #include <linux/rcutiny.h> | ||
76 | #else | 70 | #else |
77 | #error "Unknown RCU implementation specified to kernel configuration" | 71 | #error "Unknown RCU implementation specified to kernel configuration" |
78 | #endif | 72 | #endif |
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h new file mode 100644 index 000000000000..c4ba9a78721e --- /dev/null +++ b/include/linux/rcutiny.h | |||
@@ -0,0 +1,104 @@ | |||
1 | /* | ||
2 | * Read-Copy Update mechanism for mutual exclusion, the Bloatwatch edition. | ||
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 IBM Corporation, 2008 | ||
19 | * | ||
20 | * Author: Paul E. McKenney <paulmck@linux.vnet.ibm.com> | ||
21 | * | ||
22 | * For detailed explanation of Read-Copy Update mechanism see - | ||
23 | * Documentation/RCU | ||
24 | */ | ||
25 | #ifndef __LINUX_TINY_H | ||
26 | #define __LINUX_TINY_H | ||
27 | |||
28 | #include <linux/cache.h> | ||
29 | |||
30 | void rcu_sched_qs(int cpu); | ||
31 | void rcu_bh_qs(int cpu); | ||
32 | |||
33 | #define __rcu_read_lock() preempt_disable() | ||
34 | #define __rcu_read_unlock() preempt_enable() | ||
35 | #define __rcu_read_lock_bh() local_bh_disable() | ||
36 | #define __rcu_read_unlock_bh() local_bh_enable() | ||
37 | #define call_rcu_sched call_rcu | ||
38 | |||
39 | #define rcu_init_sched() do { } while (0) | ||
40 | extern void rcu_check_callbacks(int cpu, int user); | ||
41 | |||
42 | static inline int rcu_needs_cpu(int cpu) | ||
43 | { | ||
44 | return 0; | ||
45 | } | ||
46 | |||
47 | /* | ||
48 | * Return the number of grace periods. | ||
49 | */ | ||
50 | static inline long rcu_batches_completed(void) | ||
51 | { | ||
52 | return 0; | ||
53 | } | ||
54 | |||
55 | /* | ||
56 | * Return the number of bottom-half grace periods. | ||
57 | */ | ||
58 | static inline long rcu_batches_completed_bh(void) | ||
59 | { | ||
60 | return 0; | ||
61 | } | ||
62 | |||
63 | extern int rcu_expedited_torture_stats(char *page); | ||
64 | |||
65 | #define synchronize_rcu synchronize_sched | ||
66 | |||
67 | static inline void synchronize_rcu_expedited(void) | ||
68 | { | ||
69 | synchronize_sched(); | ||
70 | } | ||
71 | |||
72 | static inline void synchronize_rcu_bh_expedited(void) | ||
73 | { | ||
74 | synchronize_sched(); | ||
75 | } | ||
76 | |||
77 | struct notifier_block; | ||
78 | |||
79 | #ifdef CONFIG_NO_HZ | ||
80 | |||
81 | extern void rcu_enter_nohz(void); | ||
82 | extern void rcu_exit_nohz(void); | ||
83 | |||
84 | #else /* #ifdef CONFIG_NO_HZ */ | ||
85 | |||
86 | static inline void rcu_enter_nohz(void) | ||
87 | { | ||
88 | } | ||
89 | |||
90 | static inline void rcu_exit_nohz(void) | ||
91 | { | ||
92 | } | ||
93 | |||
94 | #endif /* #else #ifdef CONFIG_NO_HZ */ | ||
95 | |||
96 | static inline void rcu_scheduler_starting(void) | ||
97 | { | ||
98 | } | ||
99 | |||
100 | static inline void exit_rcu(void) | ||
101 | { | ||
102 | } | ||
103 | |||
104 | #endif /* __LINUX_RCUTINY_H */ | ||
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h index 9642c6bcb399..c93eee5911b0 100644 --- a/include/linux/rcutree.h +++ b/include/linux/rcutree.h | |||
@@ -34,15 +34,15 @@ struct notifier_block; | |||
34 | 34 | ||
35 | extern void rcu_sched_qs(int cpu); | 35 | extern void rcu_sched_qs(int cpu); |
36 | extern void rcu_bh_qs(int cpu); | 36 | extern void rcu_bh_qs(int cpu); |
37 | extern int rcu_cpu_notify(struct notifier_block *self, | ||
38 | unsigned long action, void *hcpu); | ||
39 | extern int rcu_needs_cpu(int cpu); | 37 | extern int rcu_needs_cpu(int cpu); |
38 | extern void rcu_scheduler_starting(void); | ||
40 | extern int rcu_expedited_torture_stats(char *page); | 39 | extern int rcu_expedited_torture_stats(char *page); |
41 | 40 | ||
42 | #ifdef CONFIG_TREE_PREEMPT_RCU | 41 | #ifdef CONFIG_TREE_PREEMPT_RCU |
43 | 42 | ||
44 | extern void __rcu_read_lock(void); | 43 | extern void __rcu_read_lock(void); |
45 | extern void __rcu_read_unlock(void); | 44 | extern void __rcu_read_unlock(void); |
45 | extern void synchronize_rcu(void); | ||
46 | extern void exit_rcu(void); | 46 | extern void exit_rcu(void); |
47 | 47 | ||
48 | #else /* #ifdef CONFIG_TREE_PREEMPT_RCU */ | 48 | #else /* #ifdef CONFIG_TREE_PREEMPT_RCU */ |
@@ -57,7 +57,7 @@ static inline void __rcu_read_unlock(void) | |||
57 | preempt_enable(); | 57 | preempt_enable(); |
58 | } | 58 | } |
59 | 59 | ||
60 | #define __synchronize_sched() synchronize_rcu() | 60 | #define synchronize_rcu synchronize_sched |
61 | 61 | ||
62 | static inline void exit_rcu(void) | 62 | static inline void exit_rcu(void) |
63 | { | 63 | { |
@@ -83,7 +83,6 @@ static inline void synchronize_rcu_bh_expedited(void) | |||
83 | synchronize_sched_expedited(); | 83 | synchronize_sched_expedited(); |
84 | } | 84 | } |
85 | 85 | ||
86 | extern void __rcu_init(void); | ||
87 | extern void rcu_check_callbacks(int cpu, int user); | 86 | extern void rcu_check_callbacks(int cpu, int user); |
88 | 87 | ||
89 | extern long rcu_batches_completed(void); | 88 | extern long rcu_batches_completed(void); |
diff --git a/include/linux/rds.h b/include/linux/rds.h index 89d46e1afbb1..cab4994c2f63 100644 --- a/include/linux/rds.h +++ b/include/linux/rds.h | |||
@@ -56,6 +56,7 @@ | |||
56 | /* deprecated: RDS_BARRIER 4 */ | 56 | /* deprecated: RDS_BARRIER 4 */ |
57 | #define RDS_RECVERR 5 | 57 | #define RDS_RECVERR 5 |
58 | #define RDS_CONG_MONITOR 6 | 58 | #define RDS_CONG_MONITOR 6 |
59 | #define RDS_GET_MR_FOR_DEST 7 | ||
59 | 60 | ||
60 | /* | 61 | /* |
61 | * Control message types for SOL_RDS. | 62 | * Control message types for SOL_RDS. |
@@ -224,6 +225,13 @@ struct rds_get_mr_args { | |||
224 | uint64_t flags; | 225 | uint64_t flags; |
225 | }; | 226 | }; |
226 | 227 | ||
228 | struct rds_get_mr_for_dest_args { | ||
229 | struct sockaddr_storage dest_addr; | ||
230 | struct rds_iovec vec; | ||
231 | u_int64_t cookie_addr; | ||
232 | uint64_t flags; | ||
233 | }; | ||
234 | |||
227 | struct rds_free_mr_args { | 235 | struct rds_free_mr_args { |
228 | rds_rdma_cookie_t cookie; | 236 | rds_rdma_cookie_t cookie; |
229 | u_int64_t flags; | 237 | u_int64_t flags; |
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h index dd31e7bae35c..a05b4a20768d 100644 --- a/include/linux/reiserfs_fs.h +++ b/include/linux/reiserfs_fs.h | |||
@@ -52,11 +52,63 @@ | |||
52 | #define REISERFS_IOC32_GETVERSION FS_IOC32_GETVERSION | 52 | #define REISERFS_IOC32_GETVERSION FS_IOC32_GETVERSION |
53 | #define REISERFS_IOC32_SETVERSION FS_IOC32_SETVERSION | 53 | #define REISERFS_IOC32_SETVERSION FS_IOC32_SETVERSION |
54 | 54 | ||
55 | /* Locking primitives */ | 55 | /* |
56 | /* Right now we are still falling back to (un)lock_kernel, but eventually that | 56 | * Locking primitives. The write lock is a per superblock |
57 | would evolve into real per-fs locks */ | 57 | * special mutex that has properties close to the Big Kernel Lock |
58 | #define reiserfs_write_lock( sb ) lock_kernel() | 58 | * which was used in the previous locking scheme. |
59 | #define reiserfs_write_unlock( sb ) unlock_kernel() | 59 | */ |
60 | void reiserfs_write_lock(struct super_block *s); | ||
61 | void reiserfs_write_unlock(struct super_block *s); | ||
62 | int reiserfs_write_lock_once(struct super_block *s); | ||
63 | void reiserfs_write_unlock_once(struct super_block *s, int lock_depth); | ||
64 | |||
65 | /* | ||
66 | * Several mutexes depend on the write lock. | ||
67 | * However sometimes we want to relax the write lock while we hold | ||
68 | * these mutexes, according to the release/reacquire on schedule() | ||
69 | * properties of the Bkl that were used. | ||
70 | * Reiserfs performances and locking were based on this scheme. | ||
71 | * Now that the write lock is a mutex and not the bkl anymore, doing so | ||
72 | * may result in a deadlock: | ||
73 | * | ||
74 | * A acquire write_lock | ||
75 | * A acquire j_commit_mutex | ||
76 | * A release write_lock and wait for something | ||
77 | * B acquire write_lock | ||
78 | * B can't acquire j_commit_mutex and sleep | ||
79 | * A can't acquire write lock anymore | ||
80 | * deadlock | ||
81 | * | ||
82 | * What we do here is avoiding such deadlock by playing the same game | ||
83 | * than the Bkl: if we can't acquire a mutex that depends on the write lock, | ||
84 | * we release the write lock, wait a bit and then retry. | ||
85 | * | ||
86 | * The mutexes concerned by this hack are: | ||
87 | * - The commit mutex of a journal list | ||
88 | * - The flush mutex | ||
89 | * - The journal lock | ||
90 | * - The inode mutex | ||
91 | */ | ||
92 | static inline void reiserfs_mutex_lock_safe(struct mutex *m, | ||
93 | struct super_block *s) | ||
94 | { | ||
95 | reiserfs_write_unlock(s); | ||
96 | mutex_lock(m); | ||
97 | reiserfs_write_lock(s); | ||
98 | } | ||
99 | |||
100 | /* | ||
101 | * When we schedule, we usually want to also release the write lock, | ||
102 | * according to the previous bkl based locking scheme of reiserfs. | ||
103 | */ | ||
104 | static inline void reiserfs_cond_resched(struct super_block *s) | ||
105 | { | ||
106 | if (need_resched()) { | ||
107 | reiserfs_write_unlock(s); | ||
108 | schedule(); | ||
109 | reiserfs_write_lock(s); | ||
110 | } | ||
111 | } | ||
60 | 112 | ||
61 | struct fid; | 113 | struct fid; |
62 | 114 | ||
@@ -1329,7 +1381,11 @@ static inline loff_t max_reiserfs_offset(struct inode *inode) | |||
1329 | #define get_generation(s) atomic_read (&fs_generation(s)) | 1381 | #define get_generation(s) atomic_read (&fs_generation(s)) |
1330 | #define FILESYSTEM_CHANGED_TB(tb) (get_generation((tb)->tb_sb) != (tb)->fs_gen) | 1382 | #define FILESYSTEM_CHANGED_TB(tb) (get_generation((tb)->tb_sb) != (tb)->fs_gen) |
1331 | #define __fs_changed(gen,s) (gen != get_generation (s)) | 1383 | #define __fs_changed(gen,s) (gen != get_generation (s)) |
1332 | #define fs_changed(gen,s) ({cond_resched(); __fs_changed(gen, s);}) | 1384 | #define fs_changed(gen,s) \ |
1385 | ({ \ | ||
1386 | reiserfs_cond_resched(s); \ | ||
1387 | __fs_changed(gen, s); \ | ||
1388 | }) | ||
1333 | 1389 | ||
1334 | /***************************************************************************/ | 1390 | /***************************************************************************/ |
1335 | /* FIXATE NODES */ | 1391 | /* FIXATE NODES */ |
@@ -2258,8 +2314,7 @@ __u32 r5_hash(const signed char *msg, int len); | |||
2258 | #define SPARE_SPACE 500 | 2314 | #define SPARE_SPACE 500 |
2259 | 2315 | ||
2260 | /* prototypes from ioctl.c */ | 2316 | /* prototypes from ioctl.c */ |
2261 | int reiserfs_ioctl(struct inode *inode, struct file *filp, | 2317 | long reiserfs_ioctl(struct file *filp, unsigned int cmd, unsigned long arg); |
2262 | unsigned int cmd, unsigned long arg); | ||
2263 | long reiserfs_compat_ioctl(struct file *filp, | 2318 | long reiserfs_compat_ioctl(struct file *filp, |
2264 | unsigned int cmd, unsigned long arg); | 2319 | unsigned int cmd, unsigned long arg); |
2265 | int reiserfs_unpack(struct inode *inode, struct file *filp); | 2320 | int reiserfs_unpack(struct inode *inode, struct file *filp); |
diff --git a/include/linux/reiserfs_fs_sb.h b/include/linux/reiserfs_fs_sb.h index dab68bbed675..52c83b6a758a 100644 --- a/include/linux/reiserfs_fs_sb.h +++ b/include/linux/reiserfs_fs_sb.h | |||
@@ -7,6 +7,8 @@ | |||
7 | #ifdef __KERNEL__ | 7 | #ifdef __KERNEL__ |
8 | #include <linux/workqueue.h> | 8 | #include <linux/workqueue.h> |
9 | #include <linux/rwsem.h> | 9 | #include <linux/rwsem.h> |
10 | #include <linux/mutex.h> | ||
11 | #include <linux/sched.h> | ||
10 | #endif | 12 | #endif |
11 | 13 | ||
12 | typedef enum { | 14 | typedef enum { |
@@ -355,6 +357,13 @@ struct reiserfs_sb_info { | |||
355 | struct reiserfs_journal *s_journal; /* pointer to journal information */ | 357 | struct reiserfs_journal *s_journal; /* pointer to journal information */ |
356 | unsigned short s_mount_state; /* reiserfs state (valid, invalid) */ | 358 | unsigned short s_mount_state; /* reiserfs state (valid, invalid) */ |
357 | 359 | ||
360 | /* Serialize writers access, replace the old bkl */ | ||
361 | struct mutex lock; | ||
362 | /* Owner of the lock (can be recursive) */ | ||
363 | struct task_struct *lock_owner; | ||
364 | /* Depth of the lock, start from -1 like the bkl */ | ||
365 | int lock_depth; | ||
366 | |||
358 | /* Comment? -Hans */ | 367 | /* Comment? -Hans */ |
359 | void (*end_io_handler) (struct buffer_head *, int); | 368 | void (*end_io_handler) (struct buffer_head *, int); |
360 | hashf_t s_hash_function; /* pointer to function which is used | 369 | hashf_t s_hash_function; /* pointer to function which is used |
@@ -408,6 +417,17 @@ struct reiserfs_sb_info { | |||
408 | char *s_qf_names[MAXQUOTAS]; | 417 | char *s_qf_names[MAXQUOTAS]; |
409 | int s_jquota_fmt; | 418 | int s_jquota_fmt; |
410 | #endif | 419 | #endif |
420 | #ifdef CONFIG_REISERFS_CHECK | ||
421 | |||
422 | struct tree_balance *cur_tb; /* | ||
423 | * Detects whether more than one | ||
424 | * copy of tb exists per superblock | ||
425 | * as a means of checking whether | ||
426 | * do_balance is executing concurrently | ||
427 | * against another tree reader/writer | ||
428 | * on a same mount point. | ||
429 | */ | ||
430 | #endif | ||
411 | }; | 431 | }; |
412 | 432 | ||
413 | /* Definitions of reiserfs on-disk properties: */ | 433 | /* Definitions of reiserfs on-disk properties: */ |
diff --git a/include/linux/rfkill.h b/include/linux/rfkill.h index 3392c59d2706..97059d08a626 100644 --- a/include/linux/rfkill.h +++ b/include/linux/rfkill.h | |||
@@ -35,6 +35,8 @@ | |||
35 | * @RFKILL_TYPE_UWB: switch is on a ultra wideband device. | 35 | * @RFKILL_TYPE_UWB: switch is on a ultra wideband device. |
36 | * @RFKILL_TYPE_WIMAX: switch is on a WiMAX device. | 36 | * @RFKILL_TYPE_WIMAX: switch is on a WiMAX device. |
37 | * @RFKILL_TYPE_WWAN: switch is on a wireless WAN device. | 37 | * @RFKILL_TYPE_WWAN: switch is on a wireless WAN device. |
38 | * @RFKILL_TYPE_GPS: switch is on a GPS device. | ||
39 | * @RFKILL_TYPE_FM: switch is on a FM radio device. | ||
38 | * @NUM_RFKILL_TYPES: number of defined rfkill types | 40 | * @NUM_RFKILL_TYPES: number of defined rfkill types |
39 | */ | 41 | */ |
40 | enum rfkill_type { | 42 | enum rfkill_type { |
@@ -45,6 +47,7 @@ enum rfkill_type { | |||
45 | RFKILL_TYPE_WIMAX, | 47 | RFKILL_TYPE_WIMAX, |
46 | RFKILL_TYPE_WWAN, | 48 | RFKILL_TYPE_WWAN, |
47 | RFKILL_TYPE_GPS, | 49 | RFKILL_TYPE_GPS, |
50 | RFKILL_TYPE_FM, | ||
48 | NUM_RFKILL_TYPES, | 51 | NUM_RFKILL_TYPES, |
49 | }; | 52 | }; |
50 | 53 | ||
diff --git a/include/linux/route.h b/include/linux/route.h index f7ed35d5e653..6600708311c8 100644 --- a/include/linux/route.h +++ b/include/linux/route.h | |||
@@ -27,8 +27,7 @@ | |||
27 | #include <linux/compiler.h> | 27 | #include <linux/compiler.h> |
28 | 28 | ||
29 | /* This structure gets passed by the SIOCADDRT and SIOCDELRT calls. */ | 29 | /* This structure gets passed by the SIOCADDRT and SIOCDELRT calls. */ |
30 | struct rtentry | 30 | struct rtentry { |
31 | { | ||
32 | unsigned long rt_pad1; | 31 | unsigned long rt_pad1; |
33 | struct sockaddr rt_dst; /* target address */ | 32 | struct sockaddr rt_dst; /* target address */ |
34 | struct sockaddr rt_gateway; /* gateway addr (RTF_GATEWAY) */ | 33 | struct sockaddr rt_gateway; /* gateway addr (RTF_GATEWAY) */ |
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index adf2068d12b5..14fc906ed602 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h | |||
@@ -127,8 +127,7 @@ enum { | |||
127 | with attribute type. | 127 | with attribute type. |
128 | */ | 128 | */ |
129 | 129 | ||
130 | struct rtattr | 130 | struct rtattr { |
131 | { | ||
132 | unsigned short rta_len; | 131 | unsigned short rta_len; |
133 | unsigned short rta_type; | 132 | unsigned short rta_type; |
134 | }; | 133 | }; |
@@ -154,8 +153,7 @@ struct rtattr | |||
154 | * Definitions used in routing table administration. | 153 | * Definitions used in routing table administration. |
155 | ****/ | 154 | ****/ |
156 | 155 | ||
157 | struct rtmsg | 156 | struct rtmsg { |
158 | { | ||
159 | unsigned char rtm_family; | 157 | unsigned char rtm_family; |
160 | unsigned char rtm_dst_len; | 158 | unsigned char rtm_dst_len; |
161 | unsigned char rtm_src_len; | 159 | unsigned char rtm_src_len; |
@@ -171,8 +169,7 @@ struct rtmsg | |||
171 | 169 | ||
172 | /* rtm_type */ | 170 | /* rtm_type */ |
173 | 171 | ||
174 | enum | 172 | enum { |
175 | { | ||
176 | RTN_UNSPEC, | 173 | RTN_UNSPEC, |
177 | RTN_UNICAST, /* Gateway or direct route */ | 174 | RTN_UNICAST, /* Gateway or direct route */ |
178 | RTN_LOCAL, /* Accept locally */ | 175 | RTN_LOCAL, /* Accept locally */ |
@@ -230,8 +227,7 @@ enum | |||
230 | could be assigned a value between UNIVERSE and LINK. | 227 | could be assigned a value between UNIVERSE and LINK. |
231 | */ | 228 | */ |
232 | 229 | ||
233 | enum rt_scope_t | 230 | enum rt_scope_t { |
234 | { | ||
235 | RT_SCOPE_UNIVERSE=0, | 231 | RT_SCOPE_UNIVERSE=0, |
236 | /* User defined values */ | 232 | /* User defined values */ |
237 | RT_SCOPE_SITE=200, | 233 | RT_SCOPE_SITE=200, |
@@ -249,8 +245,7 @@ enum rt_scope_t | |||
249 | 245 | ||
250 | /* Reserved table identifiers */ | 246 | /* Reserved table identifiers */ |
251 | 247 | ||
252 | enum rt_class_t | 248 | enum rt_class_t { |
253 | { | ||
254 | RT_TABLE_UNSPEC=0, | 249 | RT_TABLE_UNSPEC=0, |
255 | /* User defined values */ | 250 | /* User defined values */ |
256 | RT_TABLE_COMPAT=252, | 251 | RT_TABLE_COMPAT=252, |
@@ -263,8 +258,7 @@ enum rt_class_t | |||
263 | 258 | ||
264 | /* Routing message attributes */ | 259 | /* Routing message attributes */ |
265 | 260 | ||
266 | enum rtattr_type_t | 261 | enum rtattr_type_t { |
267 | { | ||
268 | RTA_UNSPEC, | 262 | RTA_UNSPEC, |
269 | RTA_DST, | 263 | RTA_DST, |
270 | RTA_SRC, | 264 | RTA_SRC, |
@@ -298,8 +292,7 @@ enum rtattr_type_t | |||
298 | * and rtt for different paths from multipath. | 292 | * and rtt for different paths from multipath. |
299 | */ | 293 | */ |
300 | 294 | ||
301 | struct rtnexthop | 295 | struct rtnexthop { |
302 | { | ||
303 | unsigned short rtnh_len; | 296 | unsigned short rtnh_len; |
304 | unsigned char rtnh_flags; | 297 | unsigned char rtnh_flags; |
305 | unsigned char rtnh_hops; | 298 | unsigned char rtnh_hops; |
@@ -325,8 +318,7 @@ struct rtnexthop | |||
325 | 318 | ||
326 | /* RTM_CACHEINFO */ | 319 | /* RTM_CACHEINFO */ |
327 | 320 | ||
328 | struct rta_cacheinfo | 321 | struct rta_cacheinfo { |
329 | { | ||
330 | __u32 rta_clntref; | 322 | __u32 rta_clntref; |
331 | __u32 rta_lastuse; | 323 | __u32 rta_lastuse; |
332 | __s32 rta_expires; | 324 | __s32 rta_expires; |
@@ -341,8 +333,7 @@ struct rta_cacheinfo | |||
341 | 333 | ||
342 | /* RTM_METRICS --- array of struct rtattr with types of RTAX_* */ | 334 | /* RTM_METRICS --- array of struct rtattr with types of RTAX_* */ |
343 | 335 | ||
344 | enum | 336 | enum { |
345 | { | ||
346 | RTAX_UNSPEC, | 337 | RTAX_UNSPEC, |
347 | #define RTAX_UNSPEC RTAX_UNSPEC | 338 | #define RTAX_UNSPEC RTAX_UNSPEC |
348 | RTAX_LOCK, | 339 | RTAX_LOCK, |
@@ -377,12 +368,13 @@ enum | |||
377 | #define RTAX_MAX (__RTAX_MAX - 1) | 368 | #define RTAX_MAX (__RTAX_MAX - 1) |
378 | 369 | ||
379 | #define RTAX_FEATURE_ECN 0x00000001 | 370 | #define RTAX_FEATURE_ECN 0x00000001 |
380 | #define RTAX_FEATURE_SACK 0x00000002 | 371 | #define RTAX_FEATURE_NO_SACK 0x00000002 |
381 | #define RTAX_FEATURE_TIMESTAMP 0x00000004 | 372 | #define RTAX_FEATURE_NO_TSTAMP 0x00000004 |
382 | #define RTAX_FEATURE_ALLFRAG 0x00000008 | 373 | #define RTAX_FEATURE_ALLFRAG 0x00000008 |
374 | #define RTAX_FEATURE_NO_WSCALE 0x00000010 | ||
375 | #define RTAX_FEATURE_NO_DSACK 0x00000020 | ||
383 | 376 | ||
384 | struct rta_session | 377 | struct rta_session { |
385 | { | ||
386 | __u8 proto; | 378 | __u8 proto; |
387 | __u8 pad1; | 379 | __u8 pad1; |
388 | __u16 pad2; | 380 | __u16 pad2; |
@@ -407,8 +399,7 @@ struct rta_session | |||
407 | * General form of address family dependent message. | 399 | * General form of address family dependent message. |
408 | ****/ | 400 | ****/ |
409 | 401 | ||
410 | struct rtgenmsg | 402 | struct rtgenmsg { |
411 | { | ||
412 | unsigned char rtgen_family; | 403 | unsigned char rtgen_family; |
413 | }; | 404 | }; |
414 | 405 | ||
@@ -421,8 +412,7 @@ struct rtgenmsg | |||
421 | * on network protocol. | 412 | * on network protocol. |
422 | */ | 413 | */ |
423 | 414 | ||
424 | struct ifinfomsg | 415 | struct ifinfomsg { |
425 | { | ||
426 | unsigned char ifi_family; | 416 | unsigned char ifi_family; |
427 | unsigned char __ifi_pad; | 417 | unsigned char __ifi_pad; |
428 | unsigned short ifi_type; /* ARPHRD_* */ | 418 | unsigned short ifi_type; /* ARPHRD_* */ |
@@ -435,8 +425,7 @@ struct ifinfomsg | |||
435 | * prefix information | 425 | * prefix information |
436 | ****/ | 426 | ****/ |
437 | 427 | ||
438 | struct prefixmsg | 428 | struct prefixmsg { |
439 | { | ||
440 | unsigned char prefix_family; | 429 | unsigned char prefix_family; |
441 | unsigned char prefix_pad1; | 430 | unsigned char prefix_pad1; |
442 | unsigned short prefix_pad2; | 431 | unsigned short prefix_pad2; |
@@ -457,8 +446,7 @@ enum | |||
457 | 446 | ||
458 | #define PREFIX_MAX (__PREFIX_MAX - 1) | 447 | #define PREFIX_MAX (__PREFIX_MAX - 1) |
459 | 448 | ||
460 | struct prefix_cacheinfo | 449 | struct prefix_cacheinfo { |
461 | { | ||
462 | __u32 preferred_time; | 450 | __u32 preferred_time; |
463 | __u32 valid_time; | 451 | __u32 valid_time; |
464 | }; | 452 | }; |
@@ -468,8 +456,7 @@ struct prefix_cacheinfo | |||
468 | * Traffic control messages. | 456 | * Traffic control messages. |
469 | ****/ | 457 | ****/ |
470 | 458 | ||
471 | struct tcmsg | 459 | struct tcmsg { |
472 | { | ||
473 | unsigned char tcm_family; | 460 | unsigned char tcm_family; |
474 | unsigned char tcm__pad1; | 461 | unsigned char tcm__pad1; |
475 | unsigned short tcm__pad2; | 462 | unsigned short tcm__pad2; |
@@ -479,8 +466,7 @@ struct tcmsg | |||
479 | __u32 tcm_info; | 466 | __u32 tcm_info; |
480 | }; | 467 | }; |
481 | 468 | ||
482 | enum | 469 | enum { |
483 | { | ||
484 | TCA_UNSPEC, | 470 | TCA_UNSPEC, |
485 | TCA_KIND, | 471 | TCA_KIND, |
486 | TCA_OPTIONS, | 472 | TCA_OPTIONS, |
@@ -502,8 +488,7 @@ enum | |||
502 | * Neighbor Discovery userland options | 488 | * Neighbor Discovery userland options |
503 | ****/ | 489 | ****/ |
504 | 490 | ||
505 | struct nduseroptmsg | 491 | struct nduseroptmsg { |
506 | { | ||
507 | unsigned char nduseropt_family; | 492 | unsigned char nduseropt_family; |
508 | unsigned char nduseropt_pad1; | 493 | unsigned char nduseropt_pad1; |
509 | unsigned short nduseropt_opts_len; /* Total length of options */ | 494 | unsigned short nduseropt_opts_len; /* Total length of options */ |
@@ -515,8 +500,7 @@ struct nduseroptmsg | |||
515 | /* Followed by one or more ND options */ | 500 | /* Followed by one or more ND options */ |
516 | }; | 501 | }; |
517 | 502 | ||
518 | enum | 503 | enum { |
519 | { | ||
520 | NDUSEROPT_UNSPEC, | 504 | NDUSEROPT_UNSPEC, |
521 | NDUSEROPT_SRCADDR, | 505 | NDUSEROPT_SRCADDR, |
522 | __NDUSEROPT_MAX | 506 | __NDUSEROPT_MAX |
@@ -598,8 +582,7 @@ enum rtnetlink_groups { | |||
598 | #define RTNLGRP_MAX (__RTNLGRP_MAX - 1) | 582 | #define RTNLGRP_MAX (__RTNLGRP_MAX - 1) |
599 | 583 | ||
600 | /* TC action piece */ | 584 | /* TC action piece */ |
601 | struct tcamsg | 585 | struct tcamsg { |
602 | { | ||
603 | unsigned char tca_family; | 586 | unsigned char tca_family; |
604 | unsigned char tca__pad1; | 587 | unsigned char tca__pad1; |
605 | unsigned short tca__pad2; | 588 | unsigned short tca__pad2; |
diff --git a/include/linux/sched.h b/include/linux/sched.h index 75e6e60bf583..89115ec7d43f 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h | |||
@@ -145,7 +145,6 @@ extern unsigned long this_cpu_load(void); | |||
145 | 145 | ||
146 | 146 | ||
147 | extern void calc_global_load(void); | 147 | extern void calc_global_load(void); |
148 | extern u64 cpu_nr_migrations(int cpu); | ||
149 | 148 | ||
150 | extern unsigned long get_parent_ip(unsigned long addr); | 149 | extern unsigned long get_parent_ip(unsigned long addr); |
151 | 150 | ||
@@ -171,8 +170,6 @@ print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq) | |||
171 | } | 170 | } |
172 | #endif | 171 | #endif |
173 | 172 | ||
174 | extern unsigned long long time_sync_thresh; | ||
175 | |||
176 | /* | 173 | /* |
177 | * Task state bitmask. NOTE! These bits are also | 174 | * Task state bitmask. NOTE! These bits are also |
178 | * encoded in fs/proc/array.c: get_task_state(). | 175 | * encoded in fs/proc/array.c: get_task_state(). |
@@ -349,7 +346,6 @@ extern signed long schedule_timeout(signed long timeout); | |||
349 | extern signed long schedule_timeout_interruptible(signed long timeout); | 346 | extern signed long schedule_timeout_interruptible(signed long timeout); |
350 | extern signed long schedule_timeout_killable(signed long timeout); | 347 | extern signed long schedule_timeout_killable(signed long timeout); |
351 | extern signed long schedule_timeout_uninterruptible(signed long timeout); | 348 | extern signed long schedule_timeout_uninterruptible(signed long timeout); |
352 | asmlinkage void __schedule(void); | ||
353 | asmlinkage void schedule(void); | 349 | asmlinkage void schedule(void); |
354 | extern int mutex_spin_on_owner(struct mutex *lock, struct thread_info *owner); | 350 | extern int mutex_spin_on_owner(struct mutex *lock, struct thread_info *owner); |
355 | 351 | ||
@@ -628,6 +624,9 @@ struct signal_struct { | |||
628 | cputime_t utime, stime, cutime, cstime; | 624 | cputime_t utime, stime, cutime, cstime; |
629 | cputime_t gtime; | 625 | cputime_t gtime; |
630 | cputime_t cgtime; | 626 | cputime_t cgtime; |
627 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING | ||
628 | cputime_t prev_utime, prev_stime; | ||
629 | #endif | ||
631 | unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; | 630 | unsigned long nvcsw, nivcsw, cnvcsw, cnivcsw; |
632 | unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; | 631 | unsigned long min_flt, maj_flt, cmin_flt, cmaj_flt; |
633 | unsigned long inblock, oublock, cinblock, coublock; | 632 | unsigned long inblock, oublock, cinblock, coublock; |
@@ -1013,9 +1012,13 @@ static inline struct cpumask *sched_domain_span(struct sched_domain *sd) | |||
1013 | return to_cpumask(sd->span); | 1012 | return to_cpumask(sd->span); |
1014 | } | 1013 | } |
1015 | 1014 | ||
1016 | extern void partition_sched_domains(int ndoms_new, struct cpumask *doms_new, | 1015 | extern void partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[], |
1017 | struct sched_domain_attr *dattr_new); | 1016 | struct sched_domain_attr *dattr_new); |
1018 | 1017 | ||
1018 | /* Allocate an array of sched domains, for partition_sched_domains(). */ | ||
1019 | cpumask_var_t *alloc_sched_domains(unsigned int ndoms); | ||
1020 | void free_sched_domains(cpumask_var_t doms[], unsigned int ndoms); | ||
1021 | |||
1019 | /* Test a flag in parent sched domain */ | 1022 | /* Test a flag in parent sched domain */ |
1020 | static inline int test_sd_parent(struct sched_domain *sd, int flag) | 1023 | static inline int test_sd_parent(struct sched_domain *sd, int flag) |
1021 | { | 1024 | { |
@@ -1033,7 +1036,7 @@ unsigned long default_scale_smt_power(struct sched_domain *sd, int cpu); | |||
1033 | struct sched_domain_attr; | 1036 | struct sched_domain_attr; |
1034 | 1037 | ||
1035 | static inline void | 1038 | static inline void |
1036 | partition_sched_domains(int ndoms_new, struct cpumask *doms_new, | 1039 | partition_sched_domains(int ndoms_new, cpumask_var_t doms_new[], |
1037 | struct sched_domain_attr *dattr_new) | 1040 | struct sched_domain_attr *dattr_new) |
1038 | { | 1041 | { |
1039 | } | 1042 | } |
@@ -1331,7 +1334,9 @@ struct task_struct { | |||
1331 | 1334 | ||
1332 | cputime_t utime, stime, utimescaled, stimescaled; | 1335 | cputime_t utime, stime, utimescaled, stimescaled; |
1333 | cputime_t gtime; | 1336 | cputime_t gtime; |
1337 | #ifndef CONFIG_VIRT_CPU_ACCOUNTING | ||
1334 | cputime_t prev_utime, prev_stime; | 1338 | cputime_t prev_utime, prev_stime; |
1339 | #endif | ||
1335 | unsigned long nvcsw, nivcsw; /* context switch counts */ | 1340 | unsigned long nvcsw, nivcsw; /* context switch counts */ |
1336 | struct timespec start_time; /* monotonic time */ | 1341 | struct timespec start_time; /* monotonic time */ |
1337 | struct timespec real_start_time; /* boot based time */ | 1342 | struct timespec real_start_time; /* boot based time */ |
@@ -1421,17 +1426,17 @@ struct task_struct { | |||
1421 | #endif | 1426 | #endif |
1422 | #ifdef CONFIG_TRACE_IRQFLAGS | 1427 | #ifdef CONFIG_TRACE_IRQFLAGS |
1423 | unsigned int irq_events; | 1428 | unsigned int irq_events; |
1424 | int hardirqs_enabled; | ||
1425 | unsigned long hardirq_enable_ip; | 1429 | unsigned long hardirq_enable_ip; |
1426 | unsigned int hardirq_enable_event; | ||
1427 | unsigned long hardirq_disable_ip; | 1430 | unsigned long hardirq_disable_ip; |
1431 | unsigned int hardirq_enable_event; | ||
1428 | unsigned int hardirq_disable_event; | 1432 | unsigned int hardirq_disable_event; |
1429 | int softirqs_enabled; | 1433 | int hardirqs_enabled; |
1434 | int hardirq_context; | ||
1430 | unsigned long softirq_disable_ip; | 1435 | unsigned long softirq_disable_ip; |
1431 | unsigned int softirq_disable_event; | ||
1432 | unsigned long softirq_enable_ip; | 1436 | unsigned long softirq_enable_ip; |
1437 | unsigned int softirq_disable_event; | ||
1433 | unsigned int softirq_enable_event; | 1438 | unsigned int softirq_enable_event; |
1434 | int hardirq_context; | 1439 | int softirqs_enabled; |
1435 | int softirq_context; | 1440 | int softirq_context; |
1436 | #endif | 1441 | #endif |
1437 | #ifdef CONFIG_LOCKDEP | 1442 | #ifdef CONFIG_LOCKDEP |
@@ -1720,9 +1725,8 @@ static inline void put_task_struct(struct task_struct *t) | |||
1720 | __put_task_struct(t); | 1725 | __put_task_struct(t); |
1721 | } | 1726 | } |
1722 | 1727 | ||
1723 | extern cputime_t task_utime(struct task_struct *p); | 1728 | extern void task_times(struct task_struct *p, cputime_t *ut, cputime_t *st); |
1724 | extern cputime_t task_stime(struct task_struct *p); | 1729 | extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *st); |
1725 | extern cputime_t task_gtime(struct task_struct *p); | ||
1726 | 1730 | ||
1727 | /* | 1731 | /* |
1728 | * Per process flags | 1732 | * Per process flags |
@@ -2086,11 +2090,18 @@ static inline int is_si_special(const struct siginfo *info) | |||
2086 | return info <= SEND_SIG_FORCED; | 2090 | return info <= SEND_SIG_FORCED; |
2087 | } | 2091 | } |
2088 | 2092 | ||
2089 | /* True if we are on the alternate signal stack. */ | 2093 | /* |
2090 | 2094 | * True if we are on the alternate signal stack. | |
2095 | */ | ||
2091 | static inline int on_sig_stack(unsigned long sp) | 2096 | static inline int on_sig_stack(unsigned long sp) |
2092 | { | 2097 | { |
2093 | return (sp - current->sas_ss_sp < current->sas_ss_size); | 2098 | #ifdef CONFIG_STACK_GROWSUP |
2099 | return sp >= current->sas_ss_sp && | ||
2100 | sp - current->sas_ss_sp < current->sas_ss_size; | ||
2101 | #else | ||
2102 | return sp > current->sas_ss_sp && | ||
2103 | sp - current->sas_ss_sp <= current->sas_ss_size; | ||
2104 | #endif | ||
2094 | } | 2105 | } |
2095 | 2106 | ||
2096 | static inline int sas_ss_flags(unsigned long sp) | 2107 | static inline int sas_ss_flags(unsigned long sp) |
diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h index 1ee2c05142f6..899fbb487c94 100644 --- a/include/linux/screen_info.h +++ b/include/linux/screen_info.h | |||
@@ -14,7 +14,8 @@ struct screen_info { | |||
14 | __u16 orig_video_page; /* 0x04 */ | 14 | __u16 orig_video_page; /* 0x04 */ |
15 | __u8 orig_video_mode; /* 0x06 */ | 15 | __u8 orig_video_mode; /* 0x06 */ |
16 | __u8 orig_video_cols; /* 0x07 */ | 16 | __u8 orig_video_cols; /* 0x07 */ |
17 | __u16 unused2; /* 0x08 */ | 17 | __u8 flags; /* 0x08 */ |
18 | __u8 unused2; /* 0x09 */ | ||
18 | __u16 orig_video_ega_bx;/* 0x0a */ | 19 | __u16 orig_video_ega_bx;/* 0x0a */ |
19 | __u16 unused3; /* 0x0c */ | 20 | __u16 unused3; /* 0x0c */ |
20 | __u8 orig_video_lines; /* 0x0e */ | 21 | __u8 orig_video_lines; /* 0x0e */ |
@@ -65,6 +66,8 @@ struct screen_info { | |||
65 | 66 | ||
66 | #define VIDEO_TYPE_EFI 0x70 /* EFI graphic mode */ | 67 | #define VIDEO_TYPE_EFI 0x70 /* EFI graphic mode */ |
67 | 68 | ||
69 | #define VIDEO_FLAGS_NOCURSOR (1 << 0) /* The video mode has no cursor set */ | ||
70 | |||
68 | #ifdef __KERNEL__ | 71 | #ifdef __KERNEL__ |
69 | extern struct screen_info screen_info; | 72 | extern struct screen_info screen_info; |
70 | 73 | ||
diff --git a/include/linux/sctp.h b/include/linux/sctp.h index b464b9d3d242..c20d3ce673c0 100644 --- a/include/linux/sctp.h +++ b/include/linux/sctp.h | |||
@@ -242,6 +242,7 @@ enum { | |||
242 | SCTP_DATA_FIRST_FRAG = 0x02, | 242 | SCTP_DATA_FIRST_FRAG = 0x02, |
243 | SCTP_DATA_NOT_FRAG = 0x03, | 243 | SCTP_DATA_NOT_FRAG = 0x03, |
244 | SCTP_DATA_UNORDERED = 0x04, | 244 | SCTP_DATA_UNORDERED = 0x04, |
245 | SCTP_DATA_SACK_IMM = 0x08, | ||
245 | }; | 246 | }; |
246 | enum { SCTP_DATA_FRAG_MASK = 0x03, }; | 247 | enum { SCTP_DATA_FRAG_MASK = 0x03, }; |
247 | 248 | ||
diff --git a/include/linux/securebits.h b/include/linux/securebits.h index d2c5ed845bcc..33406174cbe8 100644 --- a/include/linux/securebits.h +++ b/include/linux/securebits.h | |||
@@ -1,6 +1,15 @@ | |||
1 | #ifndef _LINUX_SECUREBITS_H | 1 | #ifndef _LINUX_SECUREBITS_H |
2 | #define _LINUX_SECUREBITS_H 1 | 2 | #define _LINUX_SECUREBITS_H 1 |
3 | 3 | ||
4 | /* Each securesetting is implemented using two bits. One bit specifies | ||
5 | whether the setting is on or off. The other bit specify whether the | ||
6 | setting is locked or not. A setting which is locked cannot be | ||
7 | changed from user-level. */ | ||
8 | #define issecure_mask(X) (1 << (X)) | ||
9 | #ifdef __KERNEL__ | ||
10 | #define issecure(X) (issecure_mask(X) & current_cred_xxx(securebits)) | ||
11 | #endif | ||
12 | |||
4 | #define SECUREBITS_DEFAULT 0x00000000 | 13 | #define SECUREBITS_DEFAULT 0x00000000 |
5 | 14 | ||
6 | /* When set UID 0 has no special privileges. When unset, we support | 15 | /* When set UID 0 has no special privileges. When unset, we support |
@@ -12,6 +21,9 @@ | |||
12 | #define SECURE_NOROOT 0 | 21 | #define SECURE_NOROOT 0 |
13 | #define SECURE_NOROOT_LOCKED 1 /* make bit-0 immutable */ | 22 | #define SECURE_NOROOT_LOCKED 1 /* make bit-0 immutable */ |
14 | 23 | ||
24 | #define SECBIT_NOROOT (issecure_mask(SECURE_NOROOT)) | ||
25 | #define SECBIT_NOROOT_LOCKED (issecure_mask(SECURE_NOROOT_LOCKED)) | ||
26 | |||
15 | /* When set, setuid to/from uid 0 does not trigger capability-"fixup". | 27 | /* When set, setuid to/from uid 0 does not trigger capability-"fixup". |
16 | When unset, to provide compatiblility with old programs relying on | 28 | When unset, to provide compatiblility with old programs relying on |
17 | set*uid to gain/lose privilege, transitions to/from uid 0 cause | 29 | set*uid to gain/lose privilege, transitions to/from uid 0 cause |
@@ -19,6 +31,10 @@ | |||
19 | #define SECURE_NO_SETUID_FIXUP 2 | 31 | #define SECURE_NO_SETUID_FIXUP 2 |
20 | #define SECURE_NO_SETUID_FIXUP_LOCKED 3 /* make bit-2 immutable */ | 32 | #define SECURE_NO_SETUID_FIXUP_LOCKED 3 /* make bit-2 immutable */ |
21 | 33 | ||
34 | #define SECBIT_NO_SETUID_FIXUP (issecure_mask(SECURE_NO_SETUID_FIXUP)) | ||
35 | #define SECBIT_NO_SETUID_FIXUP_LOCKED \ | ||
36 | (issecure_mask(SECURE_NO_SETUID_FIXUP_LOCKED)) | ||
37 | |||
22 | /* When set, a process can retain its capabilities even after | 38 | /* When set, a process can retain its capabilities even after |
23 | transitioning to a non-root user (the set-uid fixup suppressed by | 39 | transitioning to a non-root user (the set-uid fixup suppressed by |
24 | bit 2). Bit-4 is cleared when a process calls exec(); setting both | 40 | bit 2). Bit-4 is cleared when a process calls exec(); setting both |
@@ -27,12 +43,8 @@ | |||
27 | #define SECURE_KEEP_CAPS 4 | 43 | #define SECURE_KEEP_CAPS 4 |
28 | #define SECURE_KEEP_CAPS_LOCKED 5 /* make bit-4 immutable */ | 44 | #define SECURE_KEEP_CAPS_LOCKED 5 /* make bit-4 immutable */ |
29 | 45 | ||
30 | /* Each securesetting is implemented using two bits. One bit specifies | 46 | #define SECBIT_KEEP_CAPS (issecure_mask(SECURE_KEEP_CAPS)) |
31 | whether the setting is on or off. The other bit specify whether the | 47 | #define SECBIT_KEEP_CAPS_LOCKED (issecure_mask(SECURE_KEEP_CAPS_LOCKED)) |
32 | setting is locked or not. A setting which is locked cannot be | ||
33 | changed from user-level. */ | ||
34 | #define issecure_mask(X) (1 << (X)) | ||
35 | #define issecure(X) (issecure_mask(X) & current_cred_xxx(securebits)) | ||
36 | 48 | ||
37 | #define SECURE_ALL_BITS (issecure_mask(SECURE_NOROOT) | \ | 49 | #define SECURE_ALL_BITS (issecure_mask(SECURE_NOROOT) | \ |
38 | issecure_mask(SECURE_NO_SETUID_FIXUP) | \ | 50 | issecure_mask(SECURE_NO_SETUID_FIXUP) | \ |
diff --git a/include/linux/security.h b/include/linux/security.h index 239e40d0450b..466cbadbd1ef 100644 --- a/include/linux/security.h +++ b/include/linux/security.h | |||
@@ -447,6 +447,22 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
447 | * @new_dir contains the path structure for parent of the new link. | 447 | * @new_dir contains the path structure for parent of the new link. |
448 | * @new_dentry contains the dentry structure of the new link. | 448 | * @new_dentry contains the dentry structure of the new link. |
449 | * Return 0 if permission is granted. | 449 | * Return 0 if permission is granted. |
450 | * @path_chmod: | ||
451 | * Check for permission to change DAC's permission of a file or directory. | ||
452 | * @dentry contains the dentry structure. | ||
453 | * @mnt contains the vfsmnt structure. | ||
454 | * @mode contains DAC's mode. | ||
455 | * Return 0 if permission is granted. | ||
456 | * @path_chown: | ||
457 | * Check for permission to change owner/group of a file or directory. | ||
458 | * @path contains the path structure. | ||
459 | * @uid contains new owner's ID. | ||
460 | * @gid contains new group's ID. | ||
461 | * Return 0 if permission is granted. | ||
462 | * @path_chroot: | ||
463 | * Check for permission to change root directory. | ||
464 | * @path contains the path structure. | ||
465 | * Return 0 if permission is granted. | ||
450 | * @inode_readlink: | 466 | * @inode_readlink: |
451 | * Check the permission to read the symbolic link. | 467 | * Check the permission to read the symbolic link. |
452 | * @dentry contains the dentry structure for the file link. | 468 | * @dentry contains the dentry structure for the file link. |
@@ -690,6 +706,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts) | |||
690 | * @kernel_module_request: | 706 | * @kernel_module_request: |
691 | * Ability to trigger the kernel to automatically upcall to userspace for | 707 | * Ability to trigger the kernel to automatically upcall to userspace for |
692 | * userspace to load a kernel module with the given name. | 708 | * userspace to load a kernel module with the given name. |
709 | * @kmod_name name of the module requested by the kernel | ||
693 | * Return 0 if successful. | 710 | * Return 0 if successful. |
694 | * @task_setuid: | 711 | * @task_setuid: |
695 | * Check permission before setting one or more of the user identity | 712 | * Check permission before setting one or more of the user identity |
@@ -1488,6 +1505,10 @@ struct security_operations { | |||
1488 | struct dentry *new_dentry); | 1505 | struct dentry *new_dentry); |
1489 | int (*path_rename) (struct path *old_dir, struct dentry *old_dentry, | 1506 | int (*path_rename) (struct path *old_dir, struct dentry *old_dentry, |
1490 | struct path *new_dir, struct dentry *new_dentry); | 1507 | struct path *new_dir, struct dentry *new_dentry); |
1508 | int (*path_chmod) (struct dentry *dentry, struct vfsmount *mnt, | ||
1509 | mode_t mode); | ||
1510 | int (*path_chown) (struct path *path, uid_t uid, gid_t gid); | ||
1511 | int (*path_chroot) (struct path *path); | ||
1491 | #endif | 1512 | #endif |
1492 | 1513 | ||
1493 | int (*inode_alloc_security) (struct inode *inode); | 1514 | int (*inode_alloc_security) (struct inode *inode); |
@@ -1557,7 +1578,7 @@ struct security_operations { | |||
1557 | void (*cred_transfer)(struct cred *new, const struct cred *old); | 1578 | void (*cred_transfer)(struct cred *new, const struct cred *old); |
1558 | int (*kernel_act_as)(struct cred *new, u32 secid); | 1579 | int (*kernel_act_as)(struct cred *new, u32 secid); |
1559 | int (*kernel_create_files_as)(struct cred *new, struct inode *inode); | 1580 | int (*kernel_create_files_as)(struct cred *new, struct inode *inode); |
1560 | int (*kernel_module_request)(void); | 1581 | int (*kernel_module_request)(char *kmod_name); |
1561 | int (*task_setuid) (uid_t id0, uid_t id1, uid_t id2, int flags); | 1582 | int (*task_setuid) (uid_t id0, uid_t id1, uid_t id2, int flags); |
1562 | int (*task_fix_setuid) (struct cred *new, const struct cred *old, | 1583 | int (*task_fix_setuid) (struct cred *new, const struct cred *old, |
1563 | int flags); | 1584 | int flags); |
@@ -1822,7 +1843,7 @@ void security_commit_creds(struct cred *new, const struct cred *old); | |||
1822 | void security_transfer_creds(struct cred *new, const struct cred *old); | 1843 | void security_transfer_creds(struct cred *new, const struct cred *old); |
1823 | int security_kernel_act_as(struct cred *new, u32 secid); | 1844 | int security_kernel_act_as(struct cred *new, u32 secid); |
1824 | int security_kernel_create_files_as(struct cred *new, struct inode *inode); | 1845 | int security_kernel_create_files_as(struct cred *new, struct inode *inode); |
1825 | int security_kernel_module_request(void); | 1846 | int security_kernel_module_request(char *kmod_name); |
1826 | int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags); | 1847 | int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags); |
1827 | int security_task_fix_setuid(struct cred *new, const struct cred *old, | 1848 | int security_task_fix_setuid(struct cred *new, const struct cred *old, |
1828 | int flags); | 1849 | int flags); |
@@ -2387,7 +2408,7 @@ static inline int security_kernel_create_files_as(struct cred *cred, | |||
2387 | return 0; | 2408 | return 0; |
2388 | } | 2409 | } |
2389 | 2410 | ||
2390 | static inline int security_kernel_module_request(void) | 2411 | static inline int security_kernel_module_request(char *kmod_name) |
2391 | { | 2412 | { |
2392 | return 0; | 2413 | return 0; |
2393 | } | 2414 | } |
@@ -2952,6 +2973,10 @@ int security_path_link(struct dentry *old_dentry, struct path *new_dir, | |||
2952 | struct dentry *new_dentry); | 2973 | struct dentry *new_dentry); |
2953 | int security_path_rename(struct path *old_dir, struct dentry *old_dentry, | 2974 | int security_path_rename(struct path *old_dir, struct dentry *old_dentry, |
2954 | struct path *new_dir, struct dentry *new_dentry); | 2975 | struct path *new_dir, struct dentry *new_dentry); |
2976 | int security_path_chmod(struct dentry *dentry, struct vfsmount *mnt, | ||
2977 | mode_t mode); | ||
2978 | int security_path_chown(struct path *path, uid_t uid, gid_t gid); | ||
2979 | int security_path_chroot(struct path *path); | ||
2955 | #else /* CONFIG_SECURITY_PATH */ | 2980 | #else /* CONFIG_SECURITY_PATH */ |
2956 | static inline int security_path_unlink(struct path *dir, struct dentry *dentry) | 2981 | static inline int security_path_unlink(struct path *dir, struct dentry *dentry) |
2957 | { | 2982 | { |
@@ -3001,6 +3026,23 @@ static inline int security_path_rename(struct path *old_dir, | |||
3001 | { | 3026 | { |
3002 | return 0; | 3027 | return 0; |
3003 | } | 3028 | } |
3029 | |||
3030 | static inline int security_path_chmod(struct dentry *dentry, | ||
3031 | struct vfsmount *mnt, | ||
3032 | mode_t mode) | ||
3033 | { | ||
3034 | return 0; | ||
3035 | } | ||
3036 | |||
3037 | static inline int security_path_chown(struct path *path, uid_t uid, gid_t gid) | ||
3038 | { | ||
3039 | return 0; | ||
3040 | } | ||
3041 | |||
3042 | static inline int security_path_chroot(struct path *path) | ||
3043 | { | ||
3044 | return 0; | ||
3045 | } | ||
3004 | #endif /* CONFIG_SECURITY_PATH */ | 3046 | #endif /* CONFIG_SECURITY_PATH */ |
3005 | 3047 | ||
3006 | #ifdef CONFIG_KEYS | 3048 | #ifdef CONFIG_KEYS |
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h index db532ce288be..8c3dd36fe91a 100644 --- a/include/linux/serial_core.h +++ b/include/linux/serial_core.h | |||
@@ -179,6 +179,9 @@ | |||
179 | /* BCM63xx family SoCs */ | 179 | /* BCM63xx family SoCs */ |
180 | #define PORT_BCM63XX 89 | 180 | #define PORT_BCM63XX 89 |
181 | 181 | ||
182 | /* Aeroflex Gaisler GRLIB APBUART */ | ||
183 | #define PORT_APBUART 90 | ||
184 | |||
182 | #ifdef __KERNEL__ | 185 | #ifdef __KERNEL__ |
183 | 186 | ||
184 | #include <linux/compiler.h> | 187 | #include <linux/compiler.h> |
diff --git a/include/linux/serial_reg.h b/include/linux/serial_reg.h index 850db2e80510..cf9327c051ad 100644 --- a/include/linux/serial_reg.h +++ b/include/linux/serial_reg.h | |||
@@ -216,10 +216,10 @@ | |||
216 | 216 | ||
217 | #define UART_IIR_TOD 0x08 /* Character Timeout Indication Detected */ | 217 | #define UART_IIR_TOD 0x08 /* Character Timeout Indication Detected */ |
218 | 218 | ||
219 | #define UART_FCR_PXAR1 0x00 /* receive FIFO treshold = 1 */ | 219 | #define UART_FCR_PXAR1 0x00 /* receive FIFO threshold = 1 */ |
220 | #define UART_FCR_PXAR8 0x40 /* receive FIFO treshold = 8 */ | 220 | #define UART_FCR_PXAR8 0x40 /* receive FIFO threshold = 8 */ |
221 | #define UART_FCR_PXAR16 0x80 /* receive FIFO treshold = 16 */ | 221 | #define UART_FCR_PXAR16 0x80 /* receive FIFO threshold = 16 */ |
222 | #define UART_FCR_PXAR32 0xc0 /* receive FIFO treshold = 32 */ | 222 | #define UART_FCR_PXAR32 0xc0 /* receive FIFO threshold = 32 */ |
223 | 223 | ||
224 | 224 | ||
225 | 225 | ||
diff --git a/include/linux/serio.h b/include/linux/serio.h index a640bc2afe76..e2f3044d4a4a 100644 --- a/include/linux/serio.h +++ b/include/linux/serio.h | |||
@@ -215,5 +215,6 @@ static inline void serio_unpin_driver(struct serio *serio) | |||
215 | #define SERIO_INEXIO 0x37 | 215 | #define SERIO_INEXIO 0x37 |
216 | #define SERIO_TOUCHIT213 0x38 | 216 | #define SERIO_TOUCHIT213 0x38 |
217 | #define SERIO_W8001 0x39 | 217 | #define SERIO_W8001 0x39 |
218 | #define SERIO_DYNAPRO 0x3a | ||
218 | 219 | ||
219 | #endif | 220 | #endif |
diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h index 68e212ff9dde..4ef246f14654 100644 --- a/include/linux/sh_intc.h +++ b/include/linux/sh_intc.h | |||
@@ -57,10 +57,8 @@ struct intc_desc { | |||
57 | struct intc_sense_reg *sense_regs; | 57 | struct intc_sense_reg *sense_regs; |
58 | unsigned int nr_sense_regs; | 58 | unsigned int nr_sense_regs; |
59 | char *name; | 59 | char *name; |
60 | #if defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4A) | ||
61 | struct intc_mask_reg *ack_regs; | 60 | struct intc_mask_reg *ack_regs; |
62 | unsigned int nr_ack_regs; | 61 | unsigned int nr_ack_regs; |
63 | #endif | ||
64 | }; | 62 | }; |
65 | 63 | ||
66 | #define _INTC_ARRAY(a) a, sizeof(a)/sizeof(*a) | 64 | #define _INTC_ARRAY(a) a, sizeof(a)/sizeof(*a) |
@@ -73,7 +71,6 @@ struct intc_desc symbol __initdata = { \ | |||
73 | chipname, \ | 71 | chipname, \ |
74 | } | 72 | } |
75 | 73 | ||
76 | #if defined(CONFIG_CPU_SH3) || defined(CONFIG_CPU_SH4A) | ||
77 | #define DECLARE_INTC_DESC_ACK(symbol, chipname, vectors, groups, \ | 74 | #define DECLARE_INTC_DESC_ACK(symbol, chipname, vectors, groups, \ |
78 | mask_regs, prio_regs, sense_regs, ack_regs) \ | 75 | mask_regs, prio_regs, sense_regs, ack_regs) \ |
79 | struct intc_desc symbol __initdata = { \ | 76 | struct intc_desc symbol __initdata = { \ |
@@ -83,9 +80,11 @@ struct intc_desc symbol __initdata = { \ | |||
83 | chipname, \ | 80 | chipname, \ |
84 | _INTC_ARRAY(ack_regs), \ | 81 | _INTC_ARRAY(ack_regs), \ |
85 | } | 82 | } |
86 | #endif | ||
87 | 83 | ||
88 | void __init register_intc_controller(struct intc_desc *desc); | 84 | void __init register_intc_controller(struct intc_desc *desc); |
89 | int intc_set_priority(unsigned int irq, unsigned int prio); | 85 | int intc_set_priority(unsigned int irq, unsigned int prio); |
90 | 86 | ||
87 | int reserve_irq_vector(unsigned int irq); | ||
88 | void reserve_irq_legacy(void); | ||
89 | |||
91 | #endif /* __SH_INTC_H */ | 90 | #endif /* __SH_INTC_H */ |
diff --git a/include/linux/sh_pfc.h b/include/linux/sh_pfc.h new file mode 100644 index 000000000000..07c08af9f8f6 --- /dev/null +++ b/include/linux/sh_pfc.h | |||
@@ -0,0 +1,96 @@ | |||
1 | /* | ||
2 | * SuperH Pin Function Controller Support | ||
3 | * | ||
4 | * Copyright (c) 2008 Magnus Damm | ||
5 | * | ||
6 | * This file is subject to the terms and conditions of the GNU General Public | ||
7 | * License. See the file "COPYING" in the main directory of this archive | ||
8 | * for more details. | ||
9 | */ | ||
10 | |||
11 | #ifndef __SH_PFC_H | ||
12 | #define __SH_PFC_H | ||
13 | |||
14 | #include <asm-generic/gpio.h> | ||
15 | |||
16 | typedef unsigned short pinmux_enum_t; | ||
17 | typedef unsigned short pinmux_flag_t; | ||
18 | |||
19 | #define PINMUX_TYPE_NONE 0 | ||
20 | #define PINMUX_TYPE_FUNCTION 1 | ||
21 | #define PINMUX_TYPE_GPIO 2 | ||
22 | #define PINMUX_TYPE_OUTPUT 3 | ||
23 | #define PINMUX_TYPE_INPUT 4 | ||
24 | #define PINMUX_TYPE_INPUT_PULLUP 5 | ||
25 | #define PINMUX_TYPE_INPUT_PULLDOWN 6 | ||
26 | |||
27 | #define PINMUX_FLAG_TYPE (0x7) | ||
28 | #define PINMUX_FLAG_WANT_PULLUP (1 << 3) | ||
29 | #define PINMUX_FLAG_WANT_PULLDOWN (1 << 4) | ||
30 | |||
31 | #define PINMUX_FLAG_DBIT_SHIFT 5 | ||
32 | #define PINMUX_FLAG_DBIT (0x1f << PINMUX_FLAG_DBIT_SHIFT) | ||
33 | #define PINMUX_FLAG_DREG_SHIFT 10 | ||
34 | #define PINMUX_FLAG_DREG (0x3f << PINMUX_FLAG_DREG_SHIFT) | ||
35 | |||
36 | struct pinmux_gpio { | ||
37 | pinmux_enum_t enum_id; | ||
38 | pinmux_flag_t flags; | ||
39 | }; | ||
40 | |||
41 | #define PINMUX_GPIO(gpio, data_or_mark) [gpio] = { data_or_mark } | ||
42 | #define PINMUX_DATA(data_or_mark, ids...) data_or_mark, ids, 0 | ||
43 | |||
44 | struct pinmux_cfg_reg { | ||
45 | unsigned long reg, reg_width, field_width; | ||
46 | unsigned long *cnt; | ||
47 | pinmux_enum_t *enum_ids; | ||
48 | }; | ||
49 | |||
50 | #define PINMUX_CFG_REG(name, r, r_width, f_width) \ | ||
51 | .reg = r, .reg_width = r_width, .field_width = f_width, \ | ||
52 | .cnt = (unsigned long [r_width / f_width]) {}, \ | ||
53 | .enum_ids = (pinmux_enum_t [(r_width / f_width) * (1 << f_width)]) \ | ||
54 | |||
55 | struct pinmux_data_reg { | ||
56 | unsigned long reg, reg_width, reg_shadow; | ||
57 | pinmux_enum_t *enum_ids; | ||
58 | }; | ||
59 | |||
60 | #define PINMUX_DATA_REG(name, r, r_width) \ | ||
61 | .reg = r, .reg_width = r_width, \ | ||
62 | .enum_ids = (pinmux_enum_t [r_width]) \ | ||
63 | |||
64 | struct pinmux_range { | ||
65 | pinmux_enum_t begin; | ||
66 | pinmux_enum_t end; | ||
67 | pinmux_enum_t force; | ||
68 | }; | ||
69 | |||
70 | struct pinmux_info { | ||
71 | char *name; | ||
72 | pinmux_enum_t reserved_id; | ||
73 | struct pinmux_range data; | ||
74 | struct pinmux_range input; | ||
75 | struct pinmux_range input_pd; | ||
76 | struct pinmux_range input_pu; | ||
77 | struct pinmux_range output; | ||
78 | struct pinmux_range mark; | ||
79 | struct pinmux_range function; | ||
80 | |||
81 | unsigned first_gpio, last_gpio; | ||
82 | |||
83 | struct pinmux_gpio *gpios; | ||
84 | struct pinmux_cfg_reg *cfg_regs; | ||
85 | struct pinmux_data_reg *data_regs; | ||
86 | |||
87 | pinmux_enum_t *gpio_data; | ||
88 | unsigned int gpio_data_size; | ||
89 | |||
90 | unsigned long *gpio_in_use; | ||
91 | struct gpio_chip chip; | ||
92 | }; | ||
93 | |||
94 | int register_pinmux(struct pinmux_info *pip); | ||
95 | |||
96 | #endif /* __SH_PFC_H */ | ||
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index bcdd6606f468..ae836fded530 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h | |||
@@ -299,7 +299,7 @@ typedef unsigned char *sk_buff_data_t; | |||
299 | * @nfctinfo: Relationship of this skb to the connection | 299 | * @nfctinfo: Relationship of this skb to the connection |
300 | * @nfct_reasm: netfilter conntrack re-assembly pointer | 300 | * @nfct_reasm: netfilter conntrack re-assembly pointer |
301 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c | 301 | * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c |
302 | * @iif: ifindex of device we arrived on | 302 | * @skb_iif: ifindex of device we arrived on |
303 | * @queue_mapping: Queue mapping for multiqueue devices | 303 | * @queue_mapping: Queue mapping for multiqueue devices |
304 | * @tc_index: Traffic control index | 304 | * @tc_index: Traffic control index |
305 | * @tc_verd: traffic control verdict | 305 | * @tc_verd: traffic control verdict |
@@ -366,7 +366,7 @@ struct sk_buff { | |||
366 | struct nf_bridge_info *nf_bridge; | 366 | struct nf_bridge_info *nf_bridge; |
367 | #endif | 367 | #endif |
368 | 368 | ||
369 | int iif; | 369 | int skb_iif; |
370 | #ifdef CONFIG_NET_SCHED | 370 | #ifdef CONFIG_NET_SCHED |
371 | __u16 tc_index; /* traffic control index */ | 371 | __u16 tc_index; /* traffic control index */ |
372 | #ifdef CONFIG_NET_CLS_ACT | 372 | #ifdef CONFIG_NET_CLS_ACT |
@@ -389,8 +389,10 @@ struct sk_buff { | |||
389 | #ifdef CONFIG_NETWORK_SECMARK | 389 | #ifdef CONFIG_NETWORK_SECMARK |
390 | __u32 secmark; | 390 | __u32 secmark; |
391 | #endif | 391 | #endif |
392 | 392 | union { | |
393 | __u32 mark; | 393 | __u32 mark; |
394 | __u32 dropcount; | ||
395 | }; | ||
394 | 396 | ||
395 | __u16 vlan_tci; | 397 | __u16 vlan_tci; |
396 | 398 | ||
@@ -414,14 +416,6 @@ struct sk_buff { | |||
414 | 416 | ||
415 | #include <asm/system.h> | 417 | #include <asm/system.h> |
416 | 418 | ||
417 | #ifdef CONFIG_HAS_DMA | ||
418 | #include <linux/dma-mapping.h> | ||
419 | extern int skb_dma_map(struct device *dev, struct sk_buff *skb, | ||
420 | enum dma_data_direction dir); | ||
421 | extern void skb_dma_unmap(struct device *dev, struct sk_buff *skb, | ||
422 | enum dma_data_direction dir); | ||
423 | #endif | ||
424 | |||
425 | static inline struct dst_entry *skb_dst(const struct sk_buff *skb) | 419 | static inline struct dst_entry *skb_dst(const struct sk_buff *skb) |
426 | { | 420 | { |
427 | return (struct dst_entry *)skb->_skb_dst; | 421 | return (struct dst_entry *)skb->_skb_dst; |
@@ -489,8 +483,7 @@ extern int skb_append_datato_frags(struct sock *sk, struct sk_buff *skb, | |||
489 | int len,int odd, struct sk_buff *skb), | 483 | int len,int odd, struct sk_buff *skb), |
490 | void *from, int length); | 484 | void *from, int length); |
491 | 485 | ||
492 | struct skb_seq_state | 486 | struct skb_seq_state { |
493 | { | ||
494 | __u32 lower_offset; | 487 | __u32 lower_offset; |
495 | __u32 upper_offset; | 488 | __u32 upper_offset; |
496 | __u32 frag_idx; | 489 | __u32 frag_idx; |
@@ -1489,6 +1482,16 @@ static inline struct sk_buff *netdev_alloc_skb(struct net_device *dev, | |||
1489 | return __netdev_alloc_skb(dev, length, GFP_ATOMIC); | 1482 | return __netdev_alloc_skb(dev, length, GFP_ATOMIC); |
1490 | } | 1483 | } |
1491 | 1484 | ||
1485 | static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev, | ||
1486 | unsigned int length) | ||
1487 | { | ||
1488 | struct sk_buff *skb = netdev_alloc_skb(dev, length + NET_IP_ALIGN); | ||
1489 | |||
1490 | if (NET_IP_ALIGN && skb) | ||
1491 | skb_reserve(skb, NET_IP_ALIGN); | ||
1492 | return skb; | ||
1493 | } | ||
1494 | |||
1492 | extern struct page *__netdev_alloc_page(struct net_device *dev, gfp_t gfp_mask); | 1495 | extern struct page *__netdev_alloc_page(struct net_device *dev, gfp_t gfp_mask); |
1493 | 1496 | ||
1494 | /** | 1497 | /** |
diff --git a/include/linux/smp.h b/include/linux/smp.h index 39c64bae776d..7a0570e6a596 100644 --- a/include/linux/smp.h +++ b/include/linux/smp.h | |||
@@ -76,6 +76,9 @@ void smp_call_function_many(const struct cpumask *mask, | |||
76 | void __smp_call_function_single(int cpuid, struct call_single_data *data, | 76 | void __smp_call_function_single(int cpuid, struct call_single_data *data, |
77 | int wait); | 77 | int wait); |
78 | 78 | ||
79 | int smp_call_function_any(const struct cpumask *mask, | ||
80 | void (*func)(void *info), void *info, int wait); | ||
81 | |||
79 | /* | 82 | /* |
80 | * Generic and arch helpers | 83 | * Generic and arch helpers |
81 | */ | 84 | */ |
@@ -137,9 +140,15 @@ static inline void smp_send_reschedule(int cpu) { } | |||
137 | #define smp_prepare_boot_cpu() do {} while (0) | 140 | #define smp_prepare_boot_cpu() do {} while (0) |
138 | #define smp_call_function_many(mask, func, info, wait) \ | 141 | #define smp_call_function_many(mask, func, info, wait) \ |
139 | (up_smp_call_function(func, info)) | 142 | (up_smp_call_function(func, info)) |
140 | static inline void init_call_single_data(void) | 143 | static inline void init_call_single_data(void) { } |
144 | |||
145 | static inline int | ||
146 | smp_call_function_any(const struct cpumask *mask, void (*func)(void *info), | ||
147 | void *info, int wait) | ||
141 | { | 148 | { |
149 | return smp_call_function_single(0, func, info, wait); | ||
142 | } | 150 | } |
151 | |||
143 | #endif /* !SMP */ | 152 | #endif /* !SMP */ |
144 | 153 | ||
145 | /* | 154 | /* |
diff --git a/include/linux/smp_lock.h b/include/linux/smp_lock.h index 813be59bf345..2ea1dd1ba21c 100644 --- a/include/linux/smp_lock.h +++ b/include/linux/smp_lock.h | |||
@@ -24,8 +24,21 @@ static inline int reacquire_kernel_lock(struct task_struct *task) | |||
24 | return 0; | 24 | return 0; |
25 | } | 25 | } |
26 | 26 | ||
27 | extern void __lockfunc lock_kernel(void) __acquires(kernel_lock); | 27 | extern void __lockfunc |
28 | extern void __lockfunc unlock_kernel(void) __releases(kernel_lock); | 28 | _lock_kernel(const char *func, const char *file, int line) |
29 | __acquires(kernel_lock); | ||
30 | |||
31 | extern void __lockfunc | ||
32 | _unlock_kernel(const char *func, const char *file, int line) | ||
33 | __releases(kernel_lock); | ||
34 | |||
35 | #define lock_kernel() do { \ | ||
36 | _lock_kernel(__func__, __FILE__, __LINE__); \ | ||
37 | } while (0) | ||
38 | |||
39 | #define unlock_kernel() do { \ | ||
40 | _unlock_kernel(__func__, __FILE__, __LINE__); \ | ||
41 | } while (0) | ||
29 | 42 | ||
30 | /* | 43 | /* |
31 | * Various legacy drivers don't really need the BKL in a specific | 44 | * Various legacy drivers don't really need the BKL in a specific |
@@ -41,8 +54,8 @@ static inline void cycle_kernel_lock(void) | |||
41 | 54 | ||
42 | #else | 55 | #else |
43 | 56 | ||
44 | #define lock_kernel() do { } while(0) | 57 | #define lock_kernel() |
45 | #define unlock_kernel() do { } while(0) | 58 | #define unlock_kernel() |
46 | #define release_kernel_lock(task) do { } while(0) | 59 | #define release_kernel_lock(task) do { } while(0) |
47 | #define cycle_kernel_lock() do { } while(0) | 60 | #define cycle_kernel_lock() do { } while(0) |
48 | #define reacquire_kernel_lock(task) 0 | 61 | #define reacquire_kernel_lock(task) 0 |
diff --git a/include/linux/smsc911x.h b/include/linux/smsc911x.h index 5241e4fb4eca..7144e8aa1e41 100644 --- a/include/linux/smsc911x.h +++ b/include/linux/smsc911x.h | |||
@@ -30,6 +30,7 @@ struct smsc911x_platform_config { | |||
30 | unsigned int irq_type; | 30 | unsigned int irq_type; |
31 | unsigned int flags; | 31 | unsigned int flags; |
32 | phy_interface_t phy_interface; | 32 | phy_interface_t phy_interface; |
33 | unsigned char mac[6]; | ||
33 | }; | 34 | }; |
34 | 35 | ||
35 | /* Constants for platform_device irq polarity configuration */ | 36 | /* Constants for platform_device irq polarity configuration */ |
diff --git a/include/linux/socket.h b/include/linux/socket.h index 3273a0c5043b..7b3aae2052a6 100644 --- a/include/linux/socket.h +++ b/include/linux/socket.h | |||
@@ -24,6 +24,9 @@ struct __kernel_sockaddr_storage { | |||
24 | #include <linux/types.h> /* pid_t */ | 24 | #include <linux/types.h> /* pid_t */ |
25 | #include <linux/compiler.h> /* __user */ | 25 | #include <linux/compiler.h> /* __user */ |
26 | 26 | ||
27 | #define __sockaddr_check_size(size) \ | ||
28 | BUILD_BUG_ON(((size) > sizeof(struct __kernel_sockaddr_storage))) | ||
29 | |||
27 | #ifdef __KERNEL__ | 30 | #ifdef __KERNEL__ |
28 | # ifdef CONFIG_PROC_FS | 31 | # ifdef CONFIG_PROC_FS |
29 | struct seq_file; | 32 | struct seq_file; |
@@ -65,6 +68,12 @@ struct msghdr { | |||
65 | unsigned msg_flags; | 68 | unsigned msg_flags; |
66 | }; | 69 | }; |
67 | 70 | ||
71 | /* For recvmmsg/sendmmsg */ | ||
72 | struct mmsghdr { | ||
73 | struct msghdr msg_hdr; | ||
74 | unsigned msg_len; | ||
75 | }; | ||
76 | |||
68 | /* | 77 | /* |
69 | * POSIX 1003.1g - ancillary data object information | 78 | * POSIX 1003.1g - ancillary data object information |
70 | * Ancillary data consits of a sequence of pairs of | 79 | * Ancillary data consits of a sequence of pairs of |
@@ -312,6 +321,10 @@ extern int move_addr_to_user(struct sockaddr *kaddr, int klen, void __user *uadd | |||
312 | extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr *kaddr); | 321 | extern int move_addr_to_kernel(void __user *uaddr, int ulen, struct sockaddr *kaddr); |
313 | extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); | 322 | extern int put_cmsg(struct msghdr*, int level, int type, int len, void *data); |
314 | 323 | ||
324 | struct timespec; | ||
325 | |||
326 | extern int __sys_recvmmsg(int fd, struct mmsghdr __user *mmsg, unsigned int vlen, | ||
327 | unsigned int flags, struct timespec *timeout); | ||
315 | #endif | 328 | #endif |
316 | #endif /* not kernel and not glibc */ | 329 | #endif /* not kernel and not glibc */ |
317 | #endif /* _LINUX_SOCKET_H */ | 330 | #endif /* _LINUX_SOCKET_H */ |
diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h index eed4254bd503..3274c507b8a9 100644 --- a/include/linux/spi/spi_bitbang.h +++ b/include/linux/spi/spi_bitbang.h | |||
@@ -15,7 +15,7 @@ | |||
15 | * Some hardware works well with requests at spi_transfer scope: | 15 | * Some hardware works well with requests at spi_transfer scope: |
16 | * | 16 | * |
17 | * - Drivers leveraging smarter hardware, with fifos or DMA; or for half | 17 | * - Drivers leveraging smarter hardware, with fifos or DMA; or for half |
18 | * duplex (MicroWire) controllers. Provide chipslect() and txrx_bufs(), | 18 | * duplex (MicroWire) controllers. Provide chipselect() and txrx_bufs(), |
19 | * and custom setup()/cleanup() methods. | 19 | * and custom setup()/cleanup() methods. |
20 | */ | 20 | */ |
21 | 21 | ||
diff --git a/include/linux/spi/wl12xx.h b/include/linux/spi/wl12xx.h index 11430cab2aad..aed64ed3dc8a 100644 --- a/include/linux/spi/wl12xx.h +++ b/include/linux/spi/wl12xx.h | |||
@@ -26,6 +26,7 @@ | |||
26 | 26 | ||
27 | struct wl12xx_platform_data { | 27 | struct wl12xx_platform_data { |
28 | void (*set_power)(bool enable); | 28 | void (*set_power)(bool enable); |
29 | bool use_eeprom; | ||
29 | }; | 30 | }; |
30 | 31 | ||
31 | #endif | 32 | #endif |
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h index f0ca7a7a1757..71dccfeb0d88 100644 --- a/include/linux/spinlock.h +++ b/include/linux/spinlock.h | |||
@@ -79,8 +79,6 @@ | |||
79 | */ | 79 | */ |
80 | #include <linux/spinlock_types.h> | 80 | #include <linux/spinlock_types.h> |
81 | 81 | ||
82 | extern int __lockfunc generic__raw_read_trylock(raw_rwlock_t *lock); | ||
83 | |||
84 | /* | 82 | /* |
85 | * Pull the __raw*() functions/declarations (UP-nondebug doesnt need them): | 83 | * Pull the __raw*() functions/declarations (UP-nondebug doesnt need them): |
86 | */ | 84 | */ |
@@ -102,7 +100,7 @@ do { \ | |||
102 | 100 | ||
103 | #else | 101 | #else |
104 | # define spin_lock_init(lock) \ | 102 | # define spin_lock_init(lock) \ |
105 | do { *(lock) = SPIN_LOCK_UNLOCKED; } while (0) | 103 | do { *(lock) = __SPIN_LOCK_UNLOCKED(lock); } while (0) |
106 | #endif | 104 | #endif |
107 | 105 | ||
108 | #ifdef CONFIG_DEBUG_SPINLOCK | 106 | #ifdef CONFIG_DEBUG_SPINLOCK |
@@ -116,7 +114,7 @@ do { \ | |||
116 | } while (0) | 114 | } while (0) |
117 | #else | 115 | #else |
118 | # define rwlock_init(lock) \ | 116 | # define rwlock_init(lock) \ |
119 | do { *(lock) = RW_LOCK_UNLOCKED; } while (0) | 117 | do { *(lock) = __RW_LOCK_UNLOCKED(lock); } while (0) |
120 | #endif | 118 | #endif |
121 | 119 | ||
122 | #define spin_is_locked(lock) __raw_spin_is_locked(&(lock)->raw_lock) | 120 | #define spin_is_locked(lock) __raw_spin_is_locked(&(lock)->raw_lock) |
diff --git a/include/linux/spinlock_api_smp.h b/include/linux/spinlock_api_smp.h index 7a7e18fc2415..8264a7f459bc 100644 --- a/include/linux/spinlock_api_smp.h +++ b/include/linux/spinlock_api_smp.h | |||
@@ -60,137 +60,118 @@ void __lockfunc _read_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | |||
60 | void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) | 60 | void __lockfunc _write_unlock_irqrestore(rwlock_t *lock, unsigned long flags) |
61 | __releases(lock); | 61 | __releases(lock); |
62 | 62 | ||
63 | /* | 63 | #ifdef CONFIG_INLINE_SPIN_LOCK |
64 | * We inline the unlock functions in the nondebug case: | ||
65 | */ | ||
66 | #if !defined(CONFIG_DEBUG_SPINLOCK) && !defined(CONFIG_PREEMPT) | ||
67 | #define __always_inline__spin_unlock | ||
68 | #define __always_inline__read_unlock | ||
69 | #define __always_inline__write_unlock | ||
70 | #define __always_inline__spin_unlock_irq | ||
71 | #define __always_inline__read_unlock_irq | ||
72 | #define __always_inline__write_unlock_irq | ||
73 | #endif | ||
74 | |||
75 | #ifndef CONFIG_DEBUG_SPINLOCK | ||
76 | #ifndef CONFIG_GENERIC_LOCKBREAK | ||
77 | |||
78 | #ifdef __always_inline__spin_lock | ||
79 | #define _spin_lock(lock) __spin_lock(lock) | 64 | #define _spin_lock(lock) __spin_lock(lock) |
80 | #endif | 65 | #endif |
81 | 66 | ||
82 | #ifdef __always_inline__read_lock | 67 | #ifdef CONFIG_INLINE_READ_LOCK |
83 | #define _read_lock(lock) __read_lock(lock) | 68 | #define _read_lock(lock) __read_lock(lock) |
84 | #endif | 69 | #endif |
85 | 70 | ||
86 | #ifdef __always_inline__write_lock | 71 | #ifdef CONFIG_INLINE_WRITE_LOCK |
87 | #define _write_lock(lock) __write_lock(lock) | 72 | #define _write_lock(lock) __write_lock(lock) |
88 | #endif | 73 | #endif |
89 | 74 | ||
90 | #ifdef __always_inline__spin_lock_bh | 75 | #ifdef CONFIG_INLINE_SPIN_LOCK_BH |
91 | #define _spin_lock_bh(lock) __spin_lock_bh(lock) | 76 | #define _spin_lock_bh(lock) __spin_lock_bh(lock) |
92 | #endif | 77 | #endif |
93 | 78 | ||
94 | #ifdef __always_inline__read_lock_bh | 79 | #ifdef CONFIG_INLINE_READ_LOCK_BH |
95 | #define _read_lock_bh(lock) __read_lock_bh(lock) | 80 | #define _read_lock_bh(lock) __read_lock_bh(lock) |
96 | #endif | 81 | #endif |
97 | 82 | ||
98 | #ifdef __always_inline__write_lock_bh | 83 | #ifdef CONFIG_INLINE_WRITE_LOCK_BH |
99 | #define _write_lock_bh(lock) __write_lock_bh(lock) | 84 | #define _write_lock_bh(lock) __write_lock_bh(lock) |
100 | #endif | 85 | #endif |
101 | 86 | ||
102 | #ifdef __always_inline__spin_lock_irq | 87 | #ifdef CONFIG_INLINE_SPIN_LOCK_IRQ |
103 | #define _spin_lock_irq(lock) __spin_lock_irq(lock) | 88 | #define _spin_lock_irq(lock) __spin_lock_irq(lock) |
104 | #endif | 89 | #endif |
105 | 90 | ||
106 | #ifdef __always_inline__read_lock_irq | 91 | #ifdef CONFIG_INLINE_READ_LOCK_IRQ |
107 | #define _read_lock_irq(lock) __read_lock_irq(lock) | 92 | #define _read_lock_irq(lock) __read_lock_irq(lock) |
108 | #endif | 93 | #endif |
109 | 94 | ||
110 | #ifdef __always_inline__write_lock_irq | 95 | #ifdef CONFIG_INLINE_WRITE_LOCK_IRQ |
111 | #define _write_lock_irq(lock) __write_lock_irq(lock) | 96 | #define _write_lock_irq(lock) __write_lock_irq(lock) |
112 | #endif | 97 | #endif |
113 | 98 | ||
114 | #ifdef __always_inline__spin_lock_irqsave | 99 | #ifdef CONFIG_INLINE_SPIN_LOCK_IRQSAVE |
115 | #define _spin_lock_irqsave(lock) __spin_lock_irqsave(lock) | 100 | #define _spin_lock_irqsave(lock) __spin_lock_irqsave(lock) |
116 | #endif | 101 | #endif |
117 | 102 | ||
118 | #ifdef __always_inline__read_lock_irqsave | 103 | #ifdef CONFIG_INLINE_READ_LOCK_IRQSAVE |
119 | #define _read_lock_irqsave(lock) __read_lock_irqsave(lock) | 104 | #define _read_lock_irqsave(lock) __read_lock_irqsave(lock) |
120 | #endif | 105 | #endif |
121 | 106 | ||
122 | #ifdef __always_inline__write_lock_irqsave | 107 | #ifdef CONFIG_INLINE_WRITE_LOCK_IRQSAVE |
123 | #define _write_lock_irqsave(lock) __write_lock_irqsave(lock) | 108 | #define _write_lock_irqsave(lock) __write_lock_irqsave(lock) |
124 | #endif | 109 | #endif |
125 | 110 | ||
126 | #endif /* !CONFIG_GENERIC_LOCKBREAK */ | 111 | #ifdef CONFIG_INLINE_SPIN_TRYLOCK |
127 | |||
128 | #ifdef __always_inline__spin_trylock | ||
129 | #define _spin_trylock(lock) __spin_trylock(lock) | 112 | #define _spin_trylock(lock) __spin_trylock(lock) |
130 | #endif | 113 | #endif |
131 | 114 | ||
132 | #ifdef __always_inline__read_trylock | 115 | #ifdef CONFIG_INLINE_READ_TRYLOCK |
133 | #define _read_trylock(lock) __read_trylock(lock) | 116 | #define _read_trylock(lock) __read_trylock(lock) |
134 | #endif | 117 | #endif |
135 | 118 | ||
136 | #ifdef __always_inline__write_trylock | 119 | #ifdef CONFIG_INLINE_WRITE_TRYLOCK |
137 | #define _write_trylock(lock) __write_trylock(lock) | 120 | #define _write_trylock(lock) __write_trylock(lock) |
138 | #endif | 121 | #endif |
139 | 122 | ||
140 | #ifdef __always_inline__spin_trylock_bh | 123 | #ifdef CONFIG_INLINE_SPIN_TRYLOCK_BH |
141 | #define _spin_trylock_bh(lock) __spin_trylock_bh(lock) | 124 | #define _spin_trylock_bh(lock) __spin_trylock_bh(lock) |
142 | #endif | 125 | #endif |
143 | 126 | ||
144 | #ifdef __always_inline__spin_unlock | 127 | #ifdef CONFIG_INLINE_SPIN_UNLOCK |
145 | #define _spin_unlock(lock) __spin_unlock(lock) | 128 | #define _spin_unlock(lock) __spin_unlock(lock) |
146 | #endif | 129 | #endif |
147 | 130 | ||
148 | #ifdef __always_inline__read_unlock | 131 | #ifdef CONFIG_INLINE_READ_UNLOCK |
149 | #define _read_unlock(lock) __read_unlock(lock) | 132 | #define _read_unlock(lock) __read_unlock(lock) |
150 | #endif | 133 | #endif |
151 | 134 | ||
152 | #ifdef __always_inline__write_unlock | 135 | #ifdef CONFIG_INLINE_WRITE_UNLOCK |
153 | #define _write_unlock(lock) __write_unlock(lock) | 136 | #define _write_unlock(lock) __write_unlock(lock) |
154 | #endif | 137 | #endif |
155 | 138 | ||
156 | #ifdef __always_inline__spin_unlock_bh | 139 | #ifdef CONFIG_INLINE_SPIN_UNLOCK_BH |
157 | #define _spin_unlock_bh(lock) __spin_unlock_bh(lock) | 140 | #define _spin_unlock_bh(lock) __spin_unlock_bh(lock) |
158 | #endif | 141 | #endif |
159 | 142 | ||
160 | #ifdef __always_inline__read_unlock_bh | 143 | #ifdef CONFIG_INLINE_READ_UNLOCK_BH |
161 | #define _read_unlock_bh(lock) __read_unlock_bh(lock) | 144 | #define _read_unlock_bh(lock) __read_unlock_bh(lock) |
162 | #endif | 145 | #endif |
163 | 146 | ||
164 | #ifdef __always_inline__write_unlock_bh | 147 | #ifdef CONFIG_INLINE_WRITE_UNLOCK_BH |
165 | #define _write_unlock_bh(lock) __write_unlock_bh(lock) | 148 | #define _write_unlock_bh(lock) __write_unlock_bh(lock) |
166 | #endif | 149 | #endif |
167 | 150 | ||
168 | #ifdef __always_inline__spin_unlock_irq | 151 | #ifdef CONFIG_INLINE_SPIN_UNLOCK_IRQ |
169 | #define _spin_unlock_irq(lock) __spin_unlock_irq(lock) | 152 | #define _spin_unlock_irq(lock) __spin_unlock_irq(lock) |
170 | #endif | 153 | #endif |
171 | 154 | ||
172 | #ifdef __always_inline__read_unlock_irq | 155 | #ifdef CONFIG_INLINE_READ_UNLOCK_IRQ |
173 | #define _read_unlock_irq(lock) __read_unlock_irq(lock) | 156 | #define _read_unlock_irq(lock) __read_unlock_irq(lock) |
174 | #endif | 157 | #endif |
175 | 158 | ||
176 | #ifdef __always_inline__write_unlock_irq | 159 | #ifdef CONFIG_INLINE_WRITE_UNLOCK_IRQ |
177 | #define _write_unlock_irq(lock) __write_unlock_irq(lock) | 160 | #define _write_unlock_irq(lock) __write_unlock_irq(lock) |
178 | #endif | 161 | #endif |
179 | 162 | ||
180 | #ifdef __always_inline__spin_unlock_irqrestore | 163 | #ifdef CONFIG_INLINE_SPIN_UNLOCK_IRQRESTORE |
181 | #define _spin_unlock_irqrestore(lock, flags) __spin_unlock_irqrestore(lock, flags) | 164 | #define _spin_unlock_irqrestore(lock, flags) __spin_unlock_irqrestore(lock, flags) |
182 | #endif | 165 | #endif |
183 | 166 | ||
184 | #ifdef __always_inline__read_unlock_irqrestore | 167 | #ifdef CONFIG_INLINE_READ_UNLOCK_IRQRESTORE |
185 | #define _read_unlock_irqrestore(lock, flags) __read_unlock_irqrestore(lock, flags) | 168 | #define _read_unlock_irqrestore(lock, flags) __read_unlock_irqrestore(lock, flags) |
186 | #endif | 169 | #endif |
187 | 170 | ||
188 | #ifdef __always_inline__write_unlock_irqrestore | 171 | #ifdef CONFIG_INLINE_WRITE_UNLOCK_IRQRESTORE |
189 | #define _write_unlock_irqrestore(lock, flags) __write_unlock_irqrestore(lock, flags) | 172 | #define _write_unlock_irqrestore(lock, flags) __write_unlock_irqrestore(lock, flags) |
190 | #endif | 173 | #endif |
191 | 174 | ||
192 | #endif /* CONFIG_DEBUG_SPINLOCK */ | ||
193 | |||
194 | static inline int __spin_trylock(spinlock_t *lock) | 175 | static inline int __spin_trylock(spinlock_t *lock) |
195 | { | 176 | { |
196 | preempt_disable(); | 177 | preempt_disable(); |
diff --git a/include/linux/srcu.h b/include/linux/srcu.h index aca0eee53930..4765d97dcafb 100644 --- a/include/linux/srcu.h +++ b/include/linux/srcu.h | |||
@@ -48,6 +48,7 @@ void cleanup_srcu_struct(struct srcu_struct *sp); | |||
48 | int srcu_read_lock(struct srcu_struct *sp) __acquires(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); | 49 | void srcu_read_unlock(struct srcu_struct *sp, int idx) __releases(sp); |
50 | void synchronize_srcu(struct srcu_struct *sp); | 50 | void synchronize_srcu(struct srcu_struct *sp); |
51 | void synchronize_srcu_expedited(struct srcu_struct *sp); | ||
51 | long srcu_batches_completed(struct srcu_struct *sp); | 52 | long srcu_batches_completed(struct srcu_struct *sp); |
52 | 53 | ||
53 | #endif | 54 | #endif |
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h index 3d0a9ff24f01..24f988547361 100644 --- a/include/linux/ssb/ssb.h +++ b/include/linux/ssb/ssb.h | |||
@@ -269,7 +269,8 @@ struct ssb_bus { | |||
269 | 269 | ||
270 | const struct ssb_bus_ops *ops; | 270 | const struct ssb_bus_ops *ops; |
271 | 271 | ||
272 | /* The core in the basic address register window. (PCI bus only) */ | 272 | /* The core currently mapped into the MMIO window. |
273 | * Not valid on all host-buses. So don't use outside of SSB. */ | ||
273 | struct ssb_device *mapped_device; | 274 | struct ssb_device *mapped_device; |
274 | union { | 275 | union { |
275 | /* Currently mapped PCMCIA segment. (bustype == SSB_BUSTYPE_PCMCIA only) */ | 276 | /* Currently mapped PCMCIA segment. (bustype == SSB_BUSTYPE_PCMCIA only) */ |
@@ -281,14 +282,17 @@ struct ssb_bus { | |||
281 | * On PCMCIA-host busses this is used to protect the whole MMIO access. */ | 282 | * On PCMCIA-host busses this is used to protect the whole MMIO access. */ |
282 | spinlock_t bar_lock; | 283 | spinlock_t bar_lock; |
283 | 284 | ||
284 | /* The bus this backplane is running on. */ | 285 | /* The host-bus this backplane is running on. */ |
285 | enum ssb_bustype bustype; | 286 | enum ssb_bustype bustype; |
286 | /* Pointer to the PCI bus (only valid if bustype == SSB_BUSTYPE_PCI). */ | 287 | /* Pointers to the host-bus. Check bustype before using any of these pointers. */ |
287 | struct pci_dev *host_pci; | 288 | union { |
288 | /* Pointer to the PCMCIA device (only if bustype == SSB_BUSTYPE_PCMCIA). */ | 289 | /* Pointer to the PCI bus (only valid if bustype == SSB_BUSTYPE_PCI). */ |
289 | struct pcmcia_device *host_pcmcia; | 290 | struct pci_dev *host_pci; |
290 | /* Pointer to the SDIO device (only if bustype == SSB_BUSTYPE_SDIO). */ | 291 | /* Pointer to the PCMCIA device (only if bustype == SSB_BUSTYPE_PCMCIA). */ |
291 | struct sdio_func *host_sdio; | 292 | struct pcmcia_device *host_pcmcia; |
293 | /* Pointer to the SDIO device (only if bustype == SSB_BUSTYPE_SDIO). */ | ||
294 | struct sdio_func *host_sdio; | ||
295 | }; | ||
292 | 296 | ||
293 | /* See enum ssb_quirks */ | 297 | /* See enum ssb_quirks */ |
294 | unsigned int quirks; | 298 | unsigned int quirks; |
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h index 73b1f1cec423..febedcf67c7e 100644 --- a/include/linux/swiotlb.h +++ b/include/linux/swiotlb.h | |||
@@ -7,6 +7,8 @@ struct device; | |||
7 | struct dma_attrs; | 7 | struct dma_attrs; |
8 | struct scatterlist; | 8 | struct scatterlist; |
9 | 9 | ||
10 | extern int swiotlb_force; | ||
11 | |||
10 | /* | 12 | /* |
11 | * Maximum allowable number of contiguous slabs to map, | 13 | * Maximum allowable number of contiguous slabs to map, |
12 | * must be a power of 2. What is the appropriate value ? | 14 | * must be a power of 2. What is the appropriate value ? |
@@ -20,8 +22,7 @@ struct scatterlist; | |||
20 | */ | 22 | */ |
21 | #define IO_TLB_SHIFT 11 | 23 | #define IO_TLB_SHIFT 11 |
22 | 24 | ||
23 | extern void | 25 | extern void swiotlb_init(int verbose); |
24 | swiotlb_init(void); | ||
25 | 26 | ||
26 | extern void | 27 | extern void |
27 | *swiotlb_alloc_coherent(struct device *hwdev, size_t size, | 28 | *swiotlb_alloc_coherent(struct device *hwdev, size_t size, |
@@ -88,4 +89,11 @@ swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr); | |||
88 | extern int | 89 | extern int |
89 | swiotlb_dma_supported(struct device *hwdev, u64 mask); | 90 | swiotlb_dma_supported(struct device *hwdev, u64 mask); |
90 | 91 | ||
92 | #ifdef CONFIG_SWIOTLB | ||
93 | extern void __init swiotlb_free(void); | ||
94 | #else | ||
95 | static inline void swiotlb_free(void) { } | ||
96 | #endif | ||
97 | |||
98 | extern void swiotlb_print_info(void); | ||
91 | #endif /* __LINUX_SWIOTLB_H */ | 99 | #endif /* __LINUX_SWIOTLB_H */ |
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h index a990ace1a838..939a61507ac5 100644 --- a/include/linux/syscalls.h +++ b/include/linux/syscalls.h | |||
@@ -25,6 +25,7 @@ struct linux_dirent64; | |||
25 | struct list_head; | 25 | struct list_head; |
26 | struct msgbuf; | 26 | struct msgbuf; |
27 | struct msghdr; | 27 | struct msghdr; |
28 | struct mmsghdr; | ||
28 | struct msqid_ds; | 29 | struct msqid_ds; |
29 | struct new_utsname; | 30 | struct new_utsname; |
30 | struct nfsctl_arg; | 31 | struct nfsctl_arg; |
@@ -99,37 +100,16 @@ struct perf_event_attr; | |||
99 | #define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) | 100 | #define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) |
100 | 101 | ||
101 | #ifdef CONFIG_EVENT_PROFILE | 102 | #ifdef CONFIG_EVENT_PROFILE |
102 | #define TRACE_SYS_ENTER_PROFILE(sname) \ | ||
103 | static int prof_sysenter_enable_##sname(void) \ | ||
104 | { \ | ||
105 | return reg_prof_syscall_enter("sys"#sname); \ | ||
106 | } \ | ||
107 | \ | ||
108 | static void prof_sysenter_disable_##sname(void) \ | ||
109 | { \ | ||
110 | unreg_prof_syscall_enter("sys"#sname); \ | ||
111 | } | ||
112 | |||
113 | #define TRACE_SYS_EXIT_PROFILE(sname) \ | ||
114 | static int prof_sysexit_enable_##sname(void) \ | ||
115 | { \ | ||
116 | return reg_prof_syscall_exit("sys"#sname); \ | ||
117 | } \ | ||
118 | \ | ||
119 | static void prof_sysexit_disable_##sname(void) \ | ||
120 | { \ | ||
121 | unreg_prof_syscall_exit("sys"#sname); \ | ||
122 | } | ||
123 | 103 | ||
124 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) \ | 104 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) \ |
125 | .profile_count = ATOMIC_INIT(-1), \ | 105 | .profile_count = ATOMIC_INIT(-1), \ |
126 | .profile_enable = prof_sysenter_enable_##sname, \ | 106 | .profile_enable = prof_sysenter_enable, \ |
127 | .profile_disable = prof_sysenter_disable_##sname, | 107 | .profile_disable = prof_sysenter_disable, |
128 | 108 | ||
129 | #define TRACE_SYS_EXIT_PROFILE_INIT(sname) \ | 109 | #define TRACE_SYS_EXIT_PROFILE_INIT(sname) \ |
130 | .profile_count = ATOMIC_INIT(-1), \ | 110 | .profile_count = ATOMIC_INIT(-1), \ |
131 | .profile_enable = prof_sysexit_enable_##sname, \ | 111 | .profile_enable = prof_sysexit_enable, \ |
132 | .profile_disable = prof_sysexit_disable_##sname, | 112 | .profile_disable = prof_sysexit_disable, |
133 | #else | 113 | #else |
134 | #define TRACE_SYS_ENTER_PROFILE(sname) | 114 | #define TRACE_SYS_ENTER_PROFILE(sname) |
135 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) | 115 | #define TRACE_SYS_ENTER_PROFILE_INIT(sname) |
@@ -153,74 +133,46 @@ static void prof_sysexit_disable_##sname(void) \ | |||
153 | #define __SC_STR_TDECL6(t, a, ...) #t, __SC_STR_TDECL5(__VA_ARGS__) | 133 | #define __SC_STR_TDECL6(t, a, ...) #t, __SC_STR_TDECL5(__VA_ARGS__) |
154 | 134 | ||
155 | #define SYSCALL_TRACE_ENTER_EVENT(sname) \ | 135 | #define SYSCALL_TRACE_ENTER_EVENT(sname) \ |
136 | static const struct syscall_metadata __syscall_meta_##sname; \ | ||
156 | static struct ftrace_event_call event_enter_##sname; \ | 137 | static struct ftrace_event_call event_enter_##sname; \ |
157 | struct trace_event enter_syscall_print_##sname = { \ | 138 | static struct trace_event enter_syscall_print_##sname = { \ |
158 | .trace = print_syscall_enter, \ | 139 | .trace = print_syscall_enter, \ |
159 | }; \ | 140 | }; \ |
160 | static int init_enter_##sname(void) \ | ||
161 | { \ | ||
162 | int num, id; \ | ||
163 | num = syscall_name_to_nr("sys"#sname); \ | ||
164 | if (num < 0) \ | ||
165 | return -ENOSYS; \ | ||
166 | id = register_ftrace_event(&enter_syscall_print_##sname);\ | ||
167 | if (!id) \ | ||
168 | return -ENODEV; \ | ||
169 | event_enter_##sname.id = id; \ | ||
170 | set_syscall_enter_id(num, id); \ | ||
171 | INIT_LIST_HEAD(&event_enter_##sname.fields); \ | ||
172 | return 0; \ | ||
173 | } \ | ||
174 | TRACE_SYS_ENTER_PROFILE(sname); \ | ||
175 | static struct ftrace_event_call __used \ | 141 | static struct ftrace_event_call __used \ |
176 | __attribute__((__aligned__(4))) \ | 142 | __attribute__((__aligned__(4))) \ |
177 | __attribute__((section("_ftrace_events"))) \ | 143 | __attribute__((section("_ftrace_events"))) \ |
178 | event_enter_##sname = { \ | 144 | event_enter_##sname = { \ |
179 | .name = "sys_enter"#sname, \ | 145 | .name = "sys_enter"#sname, \ |
180 | .system = "syscalls", \ | 146 | .system = "syscalls", \ |
181 | .event = &event_syscall_enter, \ | 147 | .event = &enter_syscall_print_##sname, \ |
182 | .raw_init = init_enter_##sname, \ | 148 | .raw_init = init_syscall_trace, \ |
183 | .show_format = syscall_enter_format, \ | 149 | .show_format = syscall_enter_format, \ |
184 | .define_fields = syscall_enter_define_fields, \ | 150 | .define_fields = syscall_enter_define_fields, \ |
185 | .regfunc = reg_event_syscall_enter, \ | 151 | .regfunc = reg_event_syscall_enter, \ |
186 | .unregfunc = unreg_event_syscall_enter, \ | 152 | .unregfunc = unreg_event_syscall_enter, \ |
187 | .data = "sys"#sname, \ | 153 | .data = (void *)&__syscall_meta_##sname,\ |
188 | TRACE_SYS_ENTER_PROFILE_INIT(sname) \ | 154 | TRACE_SYS_ENTER_PROFILE_INIT(sname) \ |
189 | } | 155 | } |
190 | 156 | ||
191 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ | 157 | #define SYSCALL_TRACE_EXIT_EVENT(sname) \ |
158 | static const struct syscall_metadata __syscall_meta_##sname; \ | ||
192 | static struct ftrace_event_call event_exit_##sname; \ | 159 | static struct ftrace_event_call event_exit_##sname; \ |
193 | struct trace_event exit_syscall_print_##sname = { \ | 160 | static struct trace_event exit_syscall_print_##sname = { \ |
194 | .trace = print_syscall_exit, \ | 161 | .trace = print_syscall_exit, \ |
195 | }; \ | 162 | }; \ |
196 | static int init_exit_##sname(void) \ | ||
197 | { \ | ||
198 | int num, id; \ | ||
199 | num = syscall_name_to_nr("sys"#sname); \ | ||
200 | if (num < 0) \ | ||
201 | return -ENOSYS; \ | ||
202 | id = register_ftrace_event(&exit_syscall_print_##sname);\ | ||
203 | if (!id) \ | ||
204 | return -ENODEV; \ | ||
205 | event_exit_##sname.id = id; \ | ||
206 | set_syscall_exit_id(num, id); \ | ||
207 | INIT_LIST_HEAD(&event_exit_##sname.fields); \ | ||
208 | return 0; \ | ||
209 | } \ | ||
210 | TRACE_SYS_EXIT_PROFILE(sname); \ | ||
211 | static struct ftrace_event_call __used \ | 163 | static struct ftrace_event_call __used \ |
212 | __attribute__((__aligned__(4))) \ | 164 | __attribute__((__aligned__(4))) \ |
213 | __attribute__((section("_ftrace_events"))) \ | 165 | __attribute__((section("_ftrace_events"))) \ |
214 | event_exit_##sname = { \ | 166 | event_exit_##sname = { \ |
215 | .name = "sys_exit"#sname, \ | 167 | .name = "sys_exit"#sname, \ |
216 | .system = "syscalls", \ | 168 | .system = "syscalls", \ |
217 | .event = &event_syscall_exit, \ | 169 | .event = &exit_syscall_print_##sname, \ |
218 | .raw_init = init_exit_##sname, \ | 170 | .raw_init = init_syscall_trace, \ |
219 | .show_format = syscall_exit_format, \ | 171 | .show_format = syscall_exit_format, \ |
220 | .define_fields = syscall_exit_define_fields, \ | 172 | .define_fields = syscall_exit_define_fields, \ |
221 | .regfunc = reg_event_syscall_exit, \ | 173 | .regfunc = reg_event_syscall_exit, \ |
222 | .unregfunc = unreg_event_syscall_exit, \ | 174 | .unregfunc = unreg_event_syscall_exit, \ |
223 | .data = "sys"#sname, \ | 175 | .data = (void *)&__syscall_meta_##sname,\ |
224 | TRACE_SYS_EXIT_PROFILE_INIT(sname) \ | 176 | TRACE_SYS_EXIT_PROFILE_INIT(sname) \ |
225 | } | 177 | } |
226 | 178 | ||
@@ -677,6 +629,9 @@ asmlinkage long sys_recv(int, void __user *, size_t, unsigned); | |||
677 | asmlinkage long sys_recvfrom(int, void __user *, size_t, unsigned, | 629 | asmlinkage long sys_recvfrom(int, void __user *, size_t, unsigned, |
678 | struct sockaddr __user *, int __user *); | 630 | struct sockaddr __user *, int __user *); |
679 | asmlinkage long sys_recvmsg(int fd, struct msghdr __user *msg, unsigned flags); | 631 | asmlinkage long sys_recvmsg(int fd, struct msghdr __user *msg, unsigned flags); |
632 | asmlinkage long sys_recvmmsg(int fd, struct mmsghdr __user *msg, | ||
633 | unsigned int vlen, unsigned flags, | ||
634 | struct timespec __user *timeout); | ||
680 | asmlinkage long sys_socket(int, int, int); | 635 | asmlinkage long sys_socket(int, int, int); |
681 | asmlinkage long sys_socketpair(int, int, int, int __user *); | 636 | asmlinkage long sys_socketpair(int, int, int, int __user *); |
682 | asmlinkage long sys_socketcall(int call, unsigned long __user *args); | 637 | asmlinkage long sys_socketcall(int call, unsigned long __user *args); |
@@ -879,4 +834,8 @@ int kernel_execve(const char *filename, char *const argv[], char *const envp[]); | |||
879 | asmlinkage long sys_perf_event_open( | 834 | asmlinkage long sys_perf_event_open( |
880 | struct perf_event_attr __user *attr_uptr, | 835 | struct perf_event_attr __user *attr_uptr, |
881 | pid_t pid, int cpu, int group_fd, unsigned long flags); | 836 | pid_t pid, int cpu, int group_fd, unsigned long flags); |
837 | |||
838 | asmlinkage long sys_mmap_pgoff(unsigned long addr, unsigned long len, | ||
839 | unsigned long prot, unsigned long flags, | ||
840 | unsigned long fd, unsigned long pgoff); | ||
882 | #endif | 841 | #endif |
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 1e4743ee6831..877ba039e6a4 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -15,9 +15,6 @@ | |||
15 | ** The kernel will then return -ENOTDIR to any application using | 15 | ** The kernel will then return -ENOTDIR to any application using |
16 | ** the old binary interface. | 16 | ** the old binary interface. |
17 | ** | 17 | ** |
18 | ** For new interfaces unless you really need a binary number | ||
19 | ** please use CTL_UNNUMBERED. | ||
20 | ** | ||
21 | **************************************************************** | 18 | **************************************************************** |
22 | **************************************************************** | 19 | **************************************************************** |
23 | */ | 20 | */ |
@@ -50,12 +47,6 @@ struct __sysctl_args { | |||
50 | 47 | ||
51 | /* Top-level names: */ | 48 | /* Top-level names: */ |
52 | 49 | ||
53 | /* For internal pattern-matching use only: */ | ||
54 | #ifdef __KERNEL__ | ||
55 | #define CTL_NONE 0 | ||
56 | #define CTL_UNNUMBERED CTL_NONE /* sysctl without a binary number */ | ||
57 | #endif | ||
58 | |||
59 | enum | 50 | enum |
60 | { | 51 | { |
61 | CTL_KERN=1, /* General kernel info and control */ | 52 | CTL_KERN=1, /* General kernel info and control */ |
@@ -98,8 +89,8 @@ enum | |||
98 | KERN_VERSION=4, /* string: compile time info */ | 89 | KERN_VERSION=4, /* string: compile time info */ |
99 | KERN_SECUREMASK=5, /* struct: maximum rights mask */ | 90 | KERN_SECUREMASK=5, /* struct: maximum rights mask */ |
100 | KERN_PROF=6, /* table: profiling information */ | 91 | KERN_PROF=6, /* table: profiling information */ |
101 | KERN_NODENAME=7, | 92 | KERN_NODENAME=7, /* string: hostname */ |
102 | KERN_DOMAINNAME=8, | 93 | KERN_DOMAINNAME=8, /* string: domainname */ |
103 | 94 | ||
104 | KERN_PANIC=15, /* int: panic timeout */ | 95 | KERN_PANIC=15, /* int: panic timeout */ |
105 | KERN_REALROOTDEV=16, /* real root device to mount after initrd */ | 96 | KERN_REALROOTDEV=16, /* real root device to mount after initrd */ |
@@ -111,8 +102,8 @@ enum | |||
111 | KERN_PPC_HTABRECLAIM=25, /* turn htab reclaimation on/off on PPC */ | 102 | KERN_PPC_HTABRECLAIM=25, /* turn htab reclaimation on/off on PPC */ |
112 | KERN_PPC_ZEROPAGED=26, /* turn idle page zeroing on/off on PPC */ | 103 | KERN_PPC_ZEROPAGED=26, /* turn idle page zeroing on/off on PPC */ |
113 | KERN_PPC_POWERSAVE_NAP=27, /* use nap mode for power saving */ | 104 | KERN_PPC_POWERSAVE_NAP=27, /* use nap mode for power saving */ |
114 | KERN_MODPROBE=28, | 105 | KERN_MODPROBE=28, /* string: modprobe path */ |
115 | KERN_SG_BIG_BUFF=29, | 106 | KERN_SG_BIG_BUFF=29, /* int: sg driver reserved buffer size */ |
116 | KERN_ACCT=30, /* BSD process accounting parameters */ | 107 | KERN_ACCT=30, /* BSD process accounting parameters */ |
117 | KERN_PPC_L2CR=31, /* l2cr register on PPC */ | 108 | KERN_PPC_L2CR=31, /* l2cr register on PPC */ |
118 | 109 | ||
@@ -159,7 +150,7 @@ enum | |||
159 | KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */ | 150 | KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */ |
160 | KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */ | 151 | KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */ |
161 | KERN_COMPAT_LOG=73, /* int: print compat layer messages */ | 152 | KERN_COMPAT_LOG=73, /* int: print compat layer messages */ |
162 | KERN_MAX_LOCK_DEPTH=74, | 153 | KERN_MAX_LOCK_DEPTH=74, /* int: rtmutex's maximum lock depth */ |
163 | KERN_NMI_WATCHDOG=75, /* int: enable/disable nmi watchdog */ | 154 | KERN_NMI_WATCHDOG=75, /* int: enable/disable nmi watchdog */ |
164 | KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */ | 155 | KERN_PANIC_ON_NMI=76, /* int: whether we will panic on an unrecovered */ |
165 | }; | 156 | }; |
@@ -490,6 +481,7 @@ enum | |||
490 | NET_IPV4_CONF_PROMOTE_SECONDARIES=20, | 481 | NET_IPV4_CONF_PROMOTE_SECONDARIES=20, |
491 | NET_IPV4_CONF_ARP_ACCEPT=21, | 482 | NET_IPV4_CONF_ARP_ACCEPT=21, |
492 | NET_IPV4_CONF_ARP_NOTIFY=22, | 483 | NET_IPV4_CONF_ARP_NOTIFY=22, |
484 | NET_IPV4_CONF_ACCEPT_LOCAL=23, | ||
493 | __NET_IPV4_CONF_MAX | 485 | __NET_IPV4_CONF_MAX |
494 | }; | 486 | }; |
495 | 487 | ||
@@ -972,10 +964,6 @@ extern int sysctl_perm(struct ctl_table_root *root, | |||
972 | 964 | ||
973 | typedef struct ctl_table ctl_table; | 965 | typedef struct ctl_table ctl_table; |
974 | 966 | ||
975 | typedef int ctl_handler (struct ctl_table *table, | ||
976 | void __user *oldval, size_t __user *oldlenp, | ||
977 | void __user *newval, size_t newlen); | ||
978 | |||
979 | typedef int proc_handler (struct ctl_table *ctl, int write, | 967 | typedef int proc_handler (struct ctl_table *ctl, int write, |
980 | void __user *buffer, size_t *lenp, loff_t *ppos); | 968 | void __user *buffer, size_t *lenp, loff_t *ppos); |
981 | 969 | ||
@@ -996,21 +984,10 @@ extern int proc_doulongvec_minmax(struct ctl_table *, int, | |||
996 | extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, | 984 | extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, |
997 | void __user *, size_t *, loff_t *); | 985 | void __user *, size_t *, loff_t *); |
998 | 986 | ||
999 | extern int do_sysctl (int __user *name, int nlen, | ||
1000 | void __user *oldval, size_t __user *oldlenp, | ||
1001 | void __user *newval, size_t newlen); | ||
1002 | |||
1003 | extern ctl_handler sysctl_data; | ||
1004 | extern ctl_handler sysctl_string; | ||
1005 | extern ctl_handler sysctl_intvec; | ||
1006 | extern ctl_handler sysctl_jiffies; | ||
1007 | extern ctl_handler sysctl_ms_jiffies; | ||
1008 | |||
1009 | |||
1010 | /* | 987 | /* |
1011 | * Register a set of sysctl names by calling register_sysctl_table | 988 | * Register a set of sysctl names by calling register_sysctl_table |
1012 | * with an initialised array of struct ctl_table's. An entry with zero | 989 | * with an initialised array of struct ctl_table's. An entry with |
1013 | * ctl_name and NULL procname terminates the table. table->de will be | 990 | * NULL procname terminates the table. table->de will be |
1014 | * set up by the registration and need not be initialised in advance. | 991 | * set up by the registration and need not be initialised in advance. |
1015 | * | 992 | * |
1016 | * sysctl names can be mirrored automatically under /proc/sys. The | 993 | * sysctl names can be mirrored automatically under /proc/sys. The |
@@ -1023,24 +1000,11 @@ extern ctl_handler sysctl_ms_jiffies; | |||
1023 | * under /proc; non-leaf nodes will be represented by directories. A | 1000 | * under /proc; non-leaf nodes will be represented by directories. A |
1024 | * null procname disables /proc mirroring at this node. | 1001 | * null procname disables /proc mirroring at this node. |
1025 | * | 1002 | * |
1026 | * sysctl entries with a zero ctl_name will not be available through | ||
1027 | * the binary sysctl interface. | ||
1028 | * | ||
1029 | * sysctl(2) can automatically manage read and write requests through | 1003 | * sysctl(2) can automatically manage read and write requests through |
1030 | * the sysctl table. The data and maxlen fields of the ctl_table | 1004 | * the sysctl table. The data and maxlen fields of the ctl_table |
1031 | * struct enable minimal validation of the values being written to be | 1005 | * struct enable minimal validation of the values being written to be |
1032 | * performed, and the mode field allows minimal authentication. | 1006 | * performed, and the mode field allows minimal authentication. |
1033 | * | 1007 | * |
1034 | * More sophisticated management can be enabled by the provision of a | ||
1035 | * strategy routine with the table entry. This will be called before | ||
1036 | * any automatic read or write of the data is performed. | ||
1037 | * | ||
1038 | * The strategy routine may return: | ||
1039 | * <0: Error occurred (error is passed to user process) | ||
1040 | * 0: OK - proceed with automatic read or write. | ||
1041 | * >0: OK - read or write has been done by the strategy routine, so | ||
1042 | * return immediately. | ||
1043 | * | ||
1044 | * There must be a proc_handler routine for any terminal nodes | 1008 | * There must be a proc_handler routine for any terminal nodes |
1045 | * mirrored under /proc/sys (non-terminals are handled by a built-in | 1009 | * mirrored under /proc/sys (non-terminals are handled by a built-in |
1046 | * directory handler). Several default handlers are available to | 1010 | * directory handler). Several default handlers are available to |
@@ -1050,7 +1014,6 @@ extern ctl_handler sysctl_ms_jiffies; | |||
1050 | /* A sysctl table is an array of struct ctl_table: */ | 1014 | /* A sysctl table is an array of struct ctl_table: */ |
1051 | struct ctl_table | 1015 | struct ctl_table |
1052 | { | 1016 | { |
1053 | int ctl_name; /* Binary ID */ | ||
1054 | const char *procname; /* Text ID for /proc/sys, or zero */ | 1017 | const char *procname; /* Text ID for /proc/sys, or zero */ |
1055 | void *data; | 1018 | void *data; |
1056 | int maxlen; | 1019 | int maxlen; |
@@ -1058,7 +1021,6 @@ struct ctl_table | |||
1058 | struct ctl_table *child; | 1021 | struct ctl_table *child; |
1059 | struct ctl_table *parent; /* Automatically set */ | 1022 | struct ctl_table *parent; /* Automatically set */ |
1060 | proc_handler *proc_handler; /* Callback for text formatting */ | 1023 | proc_handler *proc_handler; /* Callback for text formatting */ |
1061 | ctl_handler *strategy; /* Callback function for all r/w */ | ||
1062 | void *extra1; | 1024 | void *extra1; |
1063 | void *extra2; | 1025 | void *extra2; |
1064 | }; | 1026 | }; |
@@ -1092,7 +1054,6 @@ struct ctl_table_header | |||
1092 | /* struct ctl_path describes where in the hierarchy a table is added */ | 1054 | /* struct ctl_path describes where in the hierarchy a table is added */ |
1093 | struct ctl_path { | 1055 | struct ctl_path { |
1094 | const char *procname; | 1056 | const char *procname; |
1095 | int ctl_name; | ||
1096 | }; | 1057 | }; |
1097 | 1058 | ||
1098 | void register_sysctl_root(struct ctl_table_root *root); | 1059 | void register_sysctl_root(struct ctl_table_root *root); |
diff --git a/include/linux/tc_act/tc_defact.h b/include/linux/tc_act/tc_defact.h index 964f473af0f0..6f65d07c7ce2 100644 --- a/include/linux/tc_act/tc_defact.h +++ b/include/linux/tc_act/tc_defact.h | |||
@@ -3,13 +3,11 @@ | |||
3 | 3 | ||
4 | #include <linux/pkt_cls.h> | 4 | #include <linux/pkt_cls.h> |
5 | 5 | ||
6 | struct tc_defact | 6 | struct tc_defact { |
7 | { | ||
8 | tc_gen; | 7 | tc_gen; |
9 | }; | 8 | }; |
10 | 9 | ||
11 | enum | 10 | enum { |
12 | { | ||
13 | TCA_DEF_UNSPEC, | 11 | TCA_DEF_UNSPEC, |
14 | TCA_DEF_TM, | 12 | TCA_DEF_TM, |
15 | TCA_DEF_PARMS, | 13 | TCA_DEF_PARMS, |
diff --git a/include/linux/tc_act/tc_gact.h b/include/linux/tc_act/tc_gact.h index e895c0a39629..f7bf94eed510 100644 --- a/include/linux/tc_act/tc_gact.h +++ b/include/linux/tc_act/tc_gact.h | |||
@@ -5,14 +5,12 @@ | |||
5 | #include <linux/pkt_cls.h> | 5 | #include <linux/pkt_cls.h> |
6 | 6 | ||
7 | #define TCA_ACT_GACT 5 | 7 | #define TCA_ACT_GACT 5 |
8 | struct tc_gact | 8 | struct tc_gact { |
9 | { | ||
10 | tc_gen; | 9 | tc_gen; |
11 | 10 | ||
12 | }; | 11 | }; |
13 | 12 | ||
14 | struct tc_gact_p | 13 | struct tc_gact_p { |
15 | { | ||
16 | #define PGACT_NONE 0 | 14 | #define PGACT_NONE 0 |
17 | #define PGACT_NETRAND 1 | 15 | #define PGACT_NETRAND 1 |
18 | #define PGACT_DETERM 2 | 16 | #define PGACT_DETERM 2 |
@@ -22,8 +20,7 @@ struct tc_gact_p | |||
22 | int paction; | 20 | int paction; |
23 | }; | 21 | }; |
24 | 22 | ||
25 | enum | 23 | enum { |
26 | { | ||
27 | TCA_GACT_UNSPEC, | 24 | TCA_GACT_UNSPEC, |
28 | TCA_GACT_TM, | 25 | TCA_GACT_TM, |
29 | TCA_GACT_PARMS, | 26 | TCA_GACT_PARMS, |
diff --git a/include/linux/tc_act/tc_ipt.h b/include/linux/tc_act/tc_ipt.h index 4b6f7b6c7a79..a2335563d21f 100644 --- a/include/linux/tc_act/tc_ipt.h +++ b/include/linux/tc_act/tc_ipt.h | |||
@@ -5,8 +5,7 @@ | |||
5 | 5 | ||
6 | #define TCA_ACT_IPT 6 | 6 | #define TCA_ACT_IPT 6 |
7 | 7 | ||
8 | enum | 8 | enum { |
9 | { | ||
10 | TCA_IPT_UNSPEC, | 9 | TCA_IPT_UNSPEC, |
11 | TCA_IPT_TABLE, | 10 | TCA_IPT_TABLE, |
12 | TCA_IPT_HOOK, | 11 | TCA_IPT_HOOK, |
diff --git a/include/linux/tc_act/tc_mirred.h b/include/linux/tc_act/tc_mirred.h index 0a99ab60d610..7561750e8fd6 100644 --- a/include/linux/tc_act/tc_mirred.h +++ b/include/linux/tc_act/tc_mirred.h | |||
@@ -10,15 +10,13 @@ | |||
10 | #define TCA_INGRESS_REDIR 3 /* packet redirect to INGRESS*/ | 10 | #define TCA_INGRESS_REDIR 3 /* packet redirect to INGRESS*/ |
11 | #define TCA_INGRESS_MIRROR 4 /* mirror packet to INGRESS */ | 11 | #define TCA_INGRESS_MIRROR 4 /* mirror packet to INGRESS */ |
12 | 12 | ||
13 | struct tc_mirred | 13 | struct tc_mirred { |
14 | { | ||
15 | tc_gen; | 14 | tc_gen; |
16 | int eaction; /* one of IN/EGRESS_MIRROR/REDIR */ | 15 | int eaction; /* one of IN/EGRESS_MIRROR/REDIR */ |
17 | __u32 ifindex; /* ifindex of egress port */ | 16 | __u32 ifindex; /* ifindex of egress port */ |
18 | }; | 17 | }; |
19 | 18 | ||
20 | enum | 19 | enum { |
21 | { | ||
22 | TCA_MIRRED_UNSPEC, | 20 | TCA_MIRRED_UNSPEC, |
23 | TCA_MIRRED_TM, | 21 | TCA_MIRRED_TM, |
24 | TCA_MIRRED_PARMS, | 22 | TCA_MIRRED_PARMS, |
diff --git a/include/linux/tc_act/tc_nat.h b/include/linux/tc_act/tc_nat.h index e7cf31e8ba79..6663aeba0b9a 100644 --- a/include/linux/tc_act/tc_nat.h +++ b/include/linux/tc_act/tc_nat.h | |||
@@ -6,8 +6,7 @@ | |||
6 | 6 | ||
7 | #define TCA_ACT_NAT 9 | 7 | #define TCA_ACT_NAT 9 |
8 | 8 | ||
9 | enum | 9 | enum { |
10 | { | ||
11 | TCA_NAT_UNSPEC, | 10 | TCA_NAT_UNSPEC, |
12 | TCA_NAT_PARMS, | 11 | TCA_NAT_PARMS, |
13 | TCA_NAT_TM, | 12 | TCA_NAT_TM, |
@@ -17,8 +16,7 @@ enum | |||
17 | 16 | ||
18 | #define TCA_NAT_FLAG_EGRESS 1 | 17 | #define TCA_NAT_FLAG_EGRESS 1 |
19 | 18 | ||
20 | struct tc_nat | 19 | struct tc_nat { |
21 | { | ||
22 | tc_gen; | 20 | tc_gen; |
23 | __be32 old_addr; | 21 | __be32 old_addr; |
24 | __be32 new_addr; | 22 | __be32 new_addr; |
diff --git a/include/linux/tc_act/tc_pedit.h b/include/linux/tc_act/tc_pedit.h index 54ce9064115a..716cfabcd5b2 100644 --- a/include/linux/tc_act/tc_pedit.h +++ b/include/linux/tc_act/tc_pedit.h | |||
@@ -6,8 +6,7 @@ | |||
6 | 6 | ||
7 | #define TCA_ACT_PEDIT 7 | 7 | #define TCA_ACT_PEDIT 7 |
8 | 8 | ||
9 | enum | 9 | enum { |
10 | { | ||
11 | TCA_PEDIT_UNSPEC, | 10 | TCA_PEDIT_UNSPEC, |
12 | TCA_PEDIT_TM, | 11 | TCA_PEDIT_TM, |
13 | TCA_PEDIT_PARMS, | 12 | TCA_PEDIT_PARMS, |
@@ -15,8 +14,7 @@ enum | |||
15 | }; | 14 | }; |
16 | #define TCA_PEDIT_MAX (__TCA_PEDIT_MAX - 1) | 15 | #define TCA_PEDIT_MAX (__TCA_PEDIT_MAX - 1) |
17 | 16 | ||
18 | struct tc_pedit_key | 17 | struct tc_pedit_key { |
19 | { | ||
20 | __u32 mask; /* AND */ | 18 | __u32 mask; /* AND */ |
21 | __u32 val; /*XOR */ | 19 | __u32 val; /*XOR */ |
22 | __u32 off; /*offset */ | 20 | __u32 off; /*offset */ |
@@ -25,8 +23,7 @@ struct tc_pedit_key | |||
25 | __u32 shift; | 23 | __u32 shift; |
26 | }; | 24 | }; |
27 | 25 | ||
28 | struct tc_pedit_sel | 26 | struct tc_pedit_sel { |
29 | { | ||
30 | tc_gen; | 27 | tc_gen; |
31 | unsigned char nkeys; | 28 | unsigned char nkeys; |
32 | unsigned char flags; | 29 | unsigned char flags; |
diff --git a/include/linux/tc_act/tc_skbedit.h b/include/linux/tc_act/tc_skbedit.h index a14e461a7af7..7a2e910a5f08 100644 --- a/include/linux/tc_act/tc_skbedit.h +++ b/include/linux/tc_act/tc_skbedit.h | |||
@@ -26,6 +26,7 @@ | |||
26 | 26 | ||
27 | #define SKBEDIT_F_PRIORITY 0x1 | 27 | #define SKBEDIT_F_PRIORITY 0x1 |
28 | #define SKBEDIT_F_QUEUE_MAPPING 0x2 | 28 | #define SKBEDIT_F_QUEUE_MAPPING 0x2 |
29 | #define SKBEDIT_F_MARK 0x4 | ||
29 | 30 | ||
30 | struct tc_skbedit { | 31 | struct tc_skbedit { |
31 | tc_gen; | 32 | tc_gen; |
@@ -37,6 +38,7 @@ enum { | |||
37 | TCA_SKBEDIT_PARMS, | 38 | TCA_SKBEDIT_PARMS, |
38 | TCA_SKBEDIT_PRIORITY, | 39 | TCA_SKBEDIT_PRIORITY, |
39 | TCA_SKBEDIT_QUEUE_MAPPING, | 40 | TCA_SKBEDIT_QUEUE_MAPPING, |
41 | TCA_SKBEDIT_MARK, | ||
40 | __TCA_SKBEDIT_MAX | 42 | __TCA_SKBEDIT_MAX |
41 | }; | 43 | }; |
42 | #define TCA_SKBEDIT_MAX (__TCA_SKBEDIT_MAX - 1) | 44 | #define TCA_SKBEDIT_MAX (__TCA_SKBEDIT_MAX - 1) |
diff --git a/include/linux/tc_ematch/tc_em_cmp.h b/include/linux/tc_ematch/tc_em_cmp.h index 38e7f7b25ec2..f34bb1bae083 100644 --- a/include/linux/tc_ematch/tc_em_cmp.h +++ b/include/linux/tc_ematch/tc_em_cmp.h | |||
@@ -4,8 +4,7 @@ | |||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/pkt_cls.h> | 5 | #include <linux/pkt_cls.h> |
6 | 6 | ||
7 | struct tcf_em_cmp | 7 | struct tcf_em_cmp { |
8 | { | ||
9 | __u32 val; | 8 | __u32 val; |
10 | __u32 mask; | 9 | __u32 mask; |
11 | __u16 off; | 10 | __u16 off; |
@@ -15,8 +14,7 @@ struct tcf_em_cmp | |||
15 | __u8 opnd:4; | 14 | __u8 opnd:4; |
16 | }; | 15 | }; |
17 | 16 | ||
18 | enum | 17 | enum { |
19 | { | ||
20 | TCF_EM_ALIGN_U8 = 1, | 18 | TCF_EM_ALIGN_U8 = 1, |
21 | TCF_EM_ALIGN_U16 = 2, | 19 | TCF_EM_ALIGN_U16 = 2, |
22 | TCF_EM_ALIGN_U32 = 4 | 20 | TCF_EM_ALIGN_U32 = 4 |
diff --git a/include/linux/tc_ematch/tc_em_meta.h b/include/linux/tc_ematch/tc_em_meta.h index dcfb733fa1f6..0864206ec1a3 100644 --- a/include/linux/tc_ematch/tc_em_meta.h +++ b/include/linux/tc_ematch/tc_em_meta.h | |||
@@ -4,8 +4,7 @@ | |||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/pkt_cls.h> | 5 | #include <linux/pkt_cls.h> |
6 | 6 | ||
7 | enum | 7 | enum { |
8 | { | ||
9 | TCA_EM_META_UNSPEC, | 8 | TCA_EM_META_UNSPEC, |
10 | TCA_EM_META_HDR, | 9 | TCA_EM_META_HDR, |
11 | TCA_EM_META_LVALUE, | 10 | TCA_EM_META_LVALUE, |
@@ -14,8 +13,7 @@ enum | |||
14 | }; | 13 | }; |
15 | #define TCA_EM_META_MAX (__TCA_EM_META_MAX - 1) | 14 | #define TCA_EM_META_MAX (__TCA_EM_META_MAX - 1) |
16 | 15 | ||
17 | struct tcf_meta_val | 16 | struct tcf_meta_val { |
18 | { | ||
19 | __u16 kind; | 17 | __u16 kind; |
20 | __u8 shift; | 18 | __u8 shift; |
21 | __u8 op; | 19 | __u8 op; |
@@ -26,16 +24,14 @@ struct tcf_meta_val | |||
26 | #define TCF_META_ID_MASK 0x7ff | 24 | #define TCF_META_ID_MASK 0x7ff |
27 | #define TCF_META_ID(kind) ((kind) & TCF_META_ID_MASK) | 25 | #define TCF_META_ID(kind) ((kind) & TCF_META_ID_MASK) |
28 | 26 | ||
29 | enum | 27 | enum { |
30 | { | ||
31 | TCF_META_TYPE_VAR, | 28 | TCF_META_TYPE_VAR, |
32 | TCF_META_TYPE_INT, | 29 | TCF_META_TYPE_INT, |
33 | __TCF_META_TYPE_MAX | 30 | __TCF_META_TYPE_MAX |
34 | }; | 31 | }; |
35 | #define TCF_META_TYPE_MAX (__TCF_META_TYPE_MAX - 1) | 32 | #define TCF_META_TYPE_MAX (__TCF_META_TYPE_MAX - 1) |
36 | 33 | ||
37 | enum | 34 | enum { |
38 | { | ||
39 | TCF_META_ID_VALUE, | 35 | TCF_META_ID_VALUE, |
40 | TCF_META_ID_RANDOM, | 36 | TCF_META_ID_RANDOM, |
41 | TCF_META_ID_LOADAVG_0, | 37 | TCF_META_ID_LOADAVG_0, |
@@ -87,8 +83,7 @@ enum | |||
87 | }; | 83 | }; |
88 | #define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1) | 84 | #define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1) |
89 | 85 | ||
90 | struct tcf_meta_hdr | 86 | struct tcf_meta_hdr { |
91 | { | ||
92 | struct tcf_meta_val left; | 87 | struct tcf_meta_val left; |
93 | struct tcf_meta_val right; | 88 | struct tcf_meta_val right; |
94 | }; | 89 | }; |
diff --git a/include/linux/tc_ematch/tc_em_nbyte.h b/include/linux/tc_ematch/tc_em_nbyte.h index 9ed8c2e58488..7172cfb999c1 100644 --- a/include/linux/tc_ematch/tc_em_nbyte.h +++ b/include/linux/tc_ematch/tc_em_nbyte.h | |||
@@ -4,8 +4,7 @@ | |||
4 | #include <linux/types.h> | 4 | #include <linux/types.h> |
5 | #include <linux/pkt_cls.h> | 5 | #include <linux/pkt_cls.h> |
6 | 6 | ||
7 | struct tcf_em_nbyte | 7 | struct tcf_em_nbyte { |
8 | { | ||
9 | __u16 off; | 8 | __u16 off; |
10 | __u16 len:12; | 9 | __u16 len:12; |
11 | __u8 layer:4; | 10 | __u8 layer:4; |
diff --git a/include/linux/tc_ematch/tc_em_text.h b/include/linux/tc_ematch/tc_em_text.h index d12a73a225fc..5aac4045ba88 100644 --- a/include/linux/tc_ematch/tc_em_text.h +++ b/include/linux/tc_ematch/tc_em_text.h | |||
@@ -6,8 +6,7 @@ | |||
6 | 6 | ||
7 | #define TC_EM_TEXT_ALGOSIZ 16 | 7 | #define TC_EM_TEXT_ALGOSIZ 16 |
8 | 8 | ||
9 | struct tcf_em_text | 9 | struct tcf_em_text { |
10 | { | ||
11 | char algo[TC_EM_TEXT_ALGOSIZ]; | 10 | char algo[TC_EM_TEXT_ALGOSIZ]; |
12 | __u16 from_offset; | 11 | __u16 from_offset; |
13 | __u16 to_offset; | 12 | __u16 to_offset; |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index 61723a7c21fe..7fee8a4df931 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -81,6 +81,12 @@ enum { | |||
81 | TCP_DATA_OFFSET = __cpu_to_be32(0xF0000000) | 81 | TCP_DATA_OFFSET = __cpu_to_be32(0xF0000000) |
82 | }; | 82 | }; |
83 | 83 | ||
84 | /* | ||
85 | * TCP general constants | ||
86 | */ | ||
87 | #define TCP_MSS_DEFAULT 536U /* IPv4 (RFC1122, RFC2581) */ | ||
88 | #define TCP_MSS_DESIRED 1220U /* IPv6 (tunneled), EDNS0 (RFC3226) */ | ||
89 | |||
84 | /* TCP socket options */ | 90 | /* TCP socket options */ |
85 | #define TCP_NODELAY 1 /* Turn off Nagle's algorithm. */ | 91 | #define TCP_NODELAY 1 /* Turn off Nagle's algorithm. */ |
86 | #define TCP_MAXSEG 2 /* Limit MSS */ | 92 | #define TCP_MAXSEG 2 /* Limit MSS */ |
@@ -96,14 +102,15 @@ enum { | |||
96 | #define TCP_QUICKACK 12 /* Block/reenable quick acks */ | 102 | #define TCP_QUICKACK 12 /* Block/reenable quick acks */ |
97 | #define TCP_CONGESTION 13 /* Congestion control algorithm */ | 103 | #define TCP_CONGESTION 13 /* Congestion control algorithm */ |
98 | #define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */ | 104 | #define TCP_MD5SIG 14 /* TCP MD5 Signature (RFC2385) */ |
105 | #define TCP_COOKIE_TRANSACTIONS 15 /* TCP Cookie Transactions */ | ||
99 | 106 | ||
107 | /* for TCP_INFO socket option */ | ||
100 | #define TCPI_OPT_TIMESTAMPS 1 | 108 | #define TCPI_OPT_TIMESTAMPS 1 |
101 | #define TCPI_OPT_SACK 2 | 109 | #define TCPI_OPT_SACK 2 |
102 | #define TCPI_OPT_WSCALE 4 | 110 | #define TCPI_OPT_WSCALE 4 |
103 | #define TCPI_OPT_ECN 8 | 111 | #define TCPI_OPT_ECN 8 |
104 | 112 | ||
105 | enum tcp_ca_state | 113 | enum tcp_ca_state { |
106 | { | ||
107 | TCP_CA_Open = 0, | 114 | TCP_CA_Open = 0, |
108 | #define TCPF_CA_Open (1<<TCP_CA_Open) | 115 | #define TCPF_CA_Open (1<<TCP_CA_Open) |
109 | TCP_CA_Disorder = 1, | 116 | TCP_CA_Disorder = 1, |
@@ -116,8 +123,7 @@ enum tcp_ca_state | |||
116 | #define TCPF_CA_Loss (1<<TCP_CA_Loss) | 123 | #define TCPF_CA_Loss (1<<TCP_CA_Loss) |
117 | }; | 124 | }; |
118 | 125 | ||
119 | struct tcp_info | 126 | struct tcp_info { |
120 | { | ||
121 | __u8 tcpi_state; | 127 | __u8 tcpi_state; |
122 | __u8 tcpi_ca_state; | 128 | __u8 tcpi_ca_state; |
123 | __u8 tcpi_retransmits; | 129 | __u8 tcpi_retransmits; |
@@ -170,6 +176,30 @@ struct tcp_md5sig { | |||
170 | __u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* key (binary) */ | 176 | __u8 tcpm_key[TCP_MD5SIG_MAXKEYLEN]; /* key (binary) */ |
171 | }; | 177 | }; |
172 | 178 | ||
179 | /* for TCP_COOKIE_TRANSACTIONS (TCPCT) socket option */ | ||
180 | #define TCP_COOKIE_MIN 8 /* 64-bits */ | ||
181 | #define TCP_COOKIE_MAX 16 /* 128-bits */ | ||
182 | #define TCP_COOKIE_PAIR_SIZE (2*TCP_COOKIE_MAX) | ||
183 | |||
184 | /* Flags for both getsockopt and setsockopt */ | ||
185 | #define TCP_COOKIE_IN_ALWAYS (1 << 0) /* Discard SYN without cookie */ | ||
186 | #define TCP_COOKIE_OUT_NEVER (1 << 1) /* Prohibit outgoing cookies, | ||
187 | * supercedes everything. */ | ||
188 | |||
189 | /* Flags for getsockopt */ | ||
190 | #define TCP_S_DATA_IN (1 << 2) /* Was data received? */ | ||
191 | #define TCP_S_DATA_OUT (1 << 3) /* Was data sent? */ | ||
192 | |||
193 | /* TCP_COOKIE_TRANSACTIONS data */ | ||
194 | struct tcp_cookie_transactions { | ||
195 | __u16 tcpct_flags; /* see above */ | ||
196 | __u8 __tcpct_pad1; /* zero */ | ||
197 | __u8 tcpct_cookie_desired; /* bytes */ | ||
198 | __u16 tcpct_s_data_desired; /* bytes of variable data */ | ||
199 | __u16 tcpct_used; /* bytes in value */ | ||
200 | __u8 tcpct_value[TCP_MSS_DEFAULT]; | ||
201 | }; | ||
202 | |||
173 | #ifdef __KERNEL__ | 203 | #ifdef __KERNEL__ |
174 | 204 | ||
175 | #include <linux/skbuff.h> | 205 | #include <linux/skbuff.h> |
@@ -217,26 +247,38 @@ struct tcp_options_received { | |||
217 | sack_ok : 4, /* SACK seen on SYN packet */ | 247 | sack_ok : 4, /* SACK seen on SYN packet */ |
218 | snd_wscale : 4, /* Window scaling received from sender */ | 248 | snd_wscale : 4, /* Window scaling received from sender */ |
219 | rcv_wscale : 4; /* Window scaling to send to receiver */ | 249 | rcv_wscale : 4; /* Window scaling to send to receiver */ |
220 | /* SACKs data */ | 250 | u8 cookie_plus:6, /* bytes in authenticator/cookie option */ |
251 | cookie_out_never:1, | ||
252 | cookie_in_always:1; | ||
221 | u8 num_sacks; /* Number of SACK blocks */ | 253 | u8 num_sacks; /* Number of SACK blocks */ |
222 | u16 user_mss; /* mss requested by user in ioctl */ | 254 | u16 user_mss; /* mss requested by user in ioctl */ |
223 | u16 mss_clamp; /* Maximal mss, negotiated at connection setup */ | 255 | u16 mss_clamp; /* Maximal mss, negotiated at connection setup */ |
224 | }; | 256 | }; |
225 | 257 | ||
258 | static inline void tcp_clear_options(struct tcp_options_received *rx_opt) | ||
259 | { | ||
260 | rx_opt->tstamp_ok = rx_opt->sack_ok = 0; | ||
261 | rx_opt->wscale_ok = rx_opt->snd_wscale = 0; | ||
262 | rx_opt->cookie_plus = 0; | ||
263 | } | ||
264 | |||
226 | /* This is the max number of SACKS that we'll generate and process. It's safe | 265 | /* This is the max number of SACKS that we'll generate and process. It's safe |
227 | * to increse this, although since: | 266 | * to increase this, although since: |
228 | * size = TCPOLEN_SACK_BASE_ALIGNED (4) + n * TCPOLEN_SACK_PERBLOCK (8) | 267 | * size = TCPOLEN_SACK_BASE_ALIGNED (4) + n * TCPOLEN_SACK_PERBLOCK (8) |
229 | * only four options will fit in a standard TCP header */ | 268 | * only four options will fit in a standard TCP header */ |
230 | #define TCP_NUM_SACKS 4 | 269 | #define TCP_NUM_SACKS 4 |
231 | 270 | ||
271 | struct tcp_cookie_values; | ||
272 | struct tcp_request_sock_ops; | ||
273 | |||
232 | struct tcp_request_sock { | 274 | struct tcp_request_sock { |
233 | struct inet_request_sock req; | 275 | struct inet_request_sock req; |
234 | #ifdef CONFIG_TCP_MD5SIG | 276 | #ifdef CONFIG_TCP_MD5SIG |
235 | /* Only used by TCP MD5 Signature so far. */ | 277 | /* Only used by TCP MD5 Signature so far. */ |
236 | const struct tcp_request_sock_ops *af_specific; | 278 | const struct tcp_request_sock_ops *af_specific; |
237 | #endif | 279 | #endif |
238 | u32 rcv_isn; | 280 | u32 rcv_isn; |
239 | u32 snt_isn; | 281 | u32 snt_isn; |
240 | }; | 282 | }; |
241 | 283 | ||
242 | static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req) | 284 | static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req) |
@@ -406,6 +448,12 @@ struct tcp_sock { | |||
406 | /* TCP MD5 Signature Option information */ | 448 | /* TCP MD5 Signature Option information */ |
407 | struct tcp_md5sig_info *md5sig_info; | 449 | struct tcp_md5sig_info *md5sig_info; |
408 | #endif | 450 | #endif |
451 | |||
452 | /* When the cookie options are generated and exchanged, then this | ||
453 | * object holds a reference to them (cookie_values->kref). Also | ||
454 | * contains related tcp_cookie_transactions fields. | ||
455 | */ | ||
456 | struct tcp_cookie_values *cookie_values; | ||
409 | }; | 457 | }; |
410 | 458 | ||
411 | static inline struct tcp_sock *tcp_sk(const struct sock *sk) | 459 | static inline struct tcp_sock *tcp_sk(const struct sock *sk) |
@@ -424,6 +472,10 @@ struct tcp_timewait_sock { | |||
424 | u16 tw_md5_keylen; | 472 | u16 tw_md5_keylen; |
425 | u8 tw_md5_key[TCP_MD5SIG_MAXKEYLEN]; | 473 | u8 tw_md5_key[TCP_MD5SIG_MAXKEYLEN]; |
426 | #endif | 474 | #endif |
475 | /* Few sockets in timewait have cookies; in that case, then this | ||
476 | * object holds a reference to them (tw_cookie_values->kref). | ||
477 | */ | ||
478 | struct tcp_cookie_values *tw_cookie_values; | ||
427 | }; | 479 | }; |
428 | 480 | ||
429 | static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk) | 481 | static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk) |
@@ -431,6 +483,6 @@ static inline struct tcp_timewait_sock *tcp_twsk(const struct sock *sk) | |||
431 | return (struct tcp_timewait_sock *)sk; | 483 | return (struct tcp_timewait_sock *)sk; |
432 | } | 484 | } |
433 | 485 | ||
434 | #endif | 486 | #endif /* __KERNEL__ */ |
435 | 487 | ||
436 | #endif /* _LINUX_TCP_H */ | 488 | #endif /* _LINUX_TCP_H */ |
diff --git a/include/linux/tick.h b/include/linux/tick.h index 0482229c07db..d2ae79e21be3 100644 --- a/include/linux/tick.h +++ b/include/linux/tick.h | |||
@@ -43,6 +43,7 @@ enum tick_nohz_mode { | |||
43 | * @idle_exittime: Time when the idle state was left | 43 | * @idle_exittime: Time when the idle state was left |
44 | * @idle_sleeptime: Sum of the time slept in idle with sched tick stopped | 44 | * @idle_sleeptime: Sum of the time slept in idle with sched tick stopped |
45 | * @sleep_length: Duration of the current idle sleep | 45 | * @sleep_length: Duration of the current idle sleep |
46 | * @do_timer_lst: CPU was the last one doing do_timer before going idle | ||
46 | */ | 47 | */ |
47 | struct tick_sched { | 48 | struct tick_sched { |
48 | struct hrtimer sched_timer; | 49 | struct hrtimer sched_timer; |
@@ -64,6 +65,7 @@ struct tick_sched { | |||
64 | unsigned long last_jiffies; | 65 | unsigned long last_jiffies; |
65 | unsigned long next_jiffies; | 66 | unsigned long next_jiffies; |
66 | ktime_t idle_expires; | 67 | ktime_t idle_expires; |
68 | int do_timer_last; | ||
67 | }; | 69 | }; |
68 | 70 | ||
69 | extern void __init tick_init(void); | 71 | extern void __init tick_init(void); |
@@ -98,6 +100,9 @@ extern int tick_check_oneshot_change(int allow_nohz); | |||
98 | extern struct tick_sched *tick_get_tick_sched(int cpu); | 100 | extern struct tick_sched *tick_get_tick_sched(int cpu); |
99 | extern void tick_check_idle(int cpu); | 101 | extern void tick_check_idle(int cpu); |
100 | extern int tick_oneshot_mode_active(void); | 102 | extern int tick_oneshot_mode_active(void); |
103 | # ifndef arch_needs_cpu | ||
104 | # define arch_needs_cpu(cpu) (0) | ||
105 | # endif | ||
101 | # else | 106 | # else |
102 | static inline void tick_clock_notify(void) { } | 107 | static inline void tick_clock_notify(void) { } |
103 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } | 108 | static inline int tick_check_oneshot_change(int allow_nohz) { return 0; } |
diff --git a/include/linux/time.h b/include/linux/time.h index fe04e5ef6a59..6e026e45a179 100644 --- a/include/linux/time.h +++ b/include/linux/time.h | |||
@@ -148,6 +148,7 @@ extern void monotonic_to_bootbased(struct timespec *ts); | |||
148 | 148 | ||
149 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); | 149 | extern struct timespec timespec_trunc(struct timespec t, unsigned gran); |
150 | extern int timekeeping_valid_for_hres(void); | 150 | extern int timekeeping_valid_for_hres(void); |
151 | extern u64 timekeeping_max_deferment(void); | ||
151 | extern void update_wall_time(void); | 152 | extern void update_wall_time(void); |
152 | extern void update_xtime_cache(u64 nsec); | 153 | extern void update_xtime_cache(u64 nsec); |
153 | extern void timekeeping_leap_insert(int leapsecond); | 154 | extern void timekeeping_leap_insert(int leapsecond); |
diff --git a/include/linux/timex.h b/include/linux/timex.h index e6967d10d9e5..94f8faecdcbc 100644 --- a/include/linux/timex.h +++ b/include/linux/timex.h | |||
@@ -115,13 +115,16 @@ struct timex { | |||
115 | #define ADJ_OFFSET_SS_READ 0xa001 /* read-only adjtime */ | 115 | #define ADJ_OFFSET_SS_READ 0xa001 /* read-only adjtime */ |
116 | #endif | 116 | #endif |
117 | 117 | ||
118 | /* xntp 3.4 compatibility names */ | 118 | /* NTP userland likes the MOD_ prefix better */ |
119 | #define MOD_OFFSET ADJ_OFFSET | 119 | #define MOD_OFFSET ADJ_OFFSET |
120 | #define MOD_FREQUENCY ADJ_FREQUENCY | 120 | #define MOD_FREQUENCY ADJ_FREQUENCY |
121 | #define MOD_MAXERROR ADJ_MAXERROR | 121 | #define MOD_MAXERROR ADJ_MAXERROR |
122 | #define MOD_ESTERROR ADJ_ESTERROR | 122 | #define MOD_ESTERROR ADJ_ESTERROR |
123 | #define MOD_STATUS ADJ_STATUS | 123 | #define MOD_STATUS ADJ_STATUS |
124 | #define MOD_TIMECONST ADJ_TIMECONST | 124 | #define MOD_TIMECONST ADJ_TIMECONST |
125 | #define MOD_TAI ADJ_TAI | ||
126 | #define MOD_MICRO ADJ_MICRO | ||
127 | #define MOD_NANO ADJ_NANO | ||
125 | 128 | ||
126 | 129 | ||
127 | /* | 130 | /* |
@@ -261,11 +264,7 @@ static inline int ntp_synced(void) | |||
261 | 264 | ||
262 | #define NTP_SCALE_SHIFT 32 | 265 | #define NTP_SCALE_SHIFT 32 |
263 | 266 | ||
264 | #ifdef CONFIG_NO_HZ | ||
265 | #define NTP_INTERVAL_FREQ (2) | ||
266 | #else | ||
267 | #define NTP_INTERVAL_FREQ (HZ) | 267 | #define NTP_INTERVAL_FREQ (HZ) |
268 | #endif | ||
269 | #define NTP_INTERVAL_LENGTH (NSEC_PER_SEC/NTP_INTERVAL_FREQ) | 268 | #define NTP_INTERVAL_LENGTH (NSEC_PER_SEC/NTP_INTERVAL_FREQ) |
270 | 269 | ||
271 | /* Returns how long ticks are at present, in ns / 2^NTP_SCALE_SHIFT. */ | 270 | /* Returns how long ticks are at present, in ns / 2^NTP_SCALE_SHIFT. */ |
diff --git a/include/linux/tpm.h b/include/linux/tpm.h index 3338b3f5c21a..ac5d1c1285d9 100644 --- a/include/linux/tpm.h +++ b/include/linux/tpm.h | |||
@@ -27,9 +27,16 @@ | |||
27 | */ | 27 | */ |
28 | #define TPM_ANY_NUM 0xFFFF | 28 | #define TPM_ANY_NUM 0xFFFF |
29 | 29 | ||
30 | #if defined(CONFIG_TCG_TPM) | 30 | #if defined(CONFIG_TCG_TPM) || defined(CONFIG_TCG_TPM_MODULE) |
31 | 31 | ||
32 | extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); | 32 | extern int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf); |
33 | extern int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash); | 33 | extern int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash); |
34 | #else | ||
35 | static inline int tpm_pcr_read(u32 chip_num, int pcr_idx, u8 *res_buf) { | ||
36 | return -ENODEV; | ||
37 | } | ||
38 | static inline int tpm_pcr_extend(u32 chip_num, int pcr_idx, const u8 *hash) { | ||
39 | return -ENODEV; | ||
40 | } | ||
34 | #endif | 41 | #endif |
35 | #endif | 42 | #endif |
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h index 2aac8a83e89b..f59604ed0ec6 100644 --- a/include/linux/tracepoint.h +++ b/include/linux/tracepoint.h | |||
@@ -280,6 +280,12 @@ static inline void tracepoint_synchronize_unregister(void) | |||
280 | * TRACE_EVENT_FN to perform any (un)registration work. | 280 | * TRACE_EVENT_FN to perform any (un)registration work. |
281 | */ | 281 | */ |
282 | 282 | ||
283 | #define DECLARE_EVENT_CLASS(name, proto, args, tstruct, assign, print) | ||
284 | #define DEFINE_EVENT(template, name, proto, args) \ | ||
285 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | ||
286 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | ||
287 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | ||
288 | |||
283 | #define TRACE_EVENT(name, proto, args, struct, assign, print) \ | 289 | #define TRACE_EVENT(name, proto, args, struct, assign, print) \ |
284 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) | 290 | DECLARE_TRACE(name, PARAMS(proto), PARAMS(args)) |
285 | #define TRACE_EVENT_FN(name, proto, args, struct, \ | 291 | #define TRACE_EVENT_FN(name, proto, args, struct, \ |
diff --git a/include/linux/ucb1400.h b/include/linux/ucb1400.h index adb44066680c..1b4790911052 100644 --- a/include/linux/ucb1400.h +++ b/include/linux/ucb1400.h | |||
@@ -110,6 +110,10 @@ struct ucb1400 { | |||
110 | struct platform_device *ucb1400_gpio; | 110 | struct platform_device *ucb1400_gpio; |
111 | }; | 111 | }; |
112 | 112 | ||
113 | struct ucb1400_pdata { | ||
114 | int irq; | ||
115 | }; | ||
116 | |||
113 | static inline u16 ucb1400_reg_read(struct snd_ac97 *ac97, u16 reg) | 117 | static inline u16 ucb1400_reg_read(struct snd_ac97 *ac97, u16 reg) |
114 | { | 118 | { |
115 | return ac97->bus->ops->read(ac97, reg); | 119 | return ac97->bus->ops->read(ac97, reg); |
diff --git a/include/linux/udp.h b/include/linux/udp.h index 0cf5c4c0ec81..03f72a2ba028 100644 --- a/include/linux/udp.h +++ b/include/linux/udp.h | |||
@@ -45,16 +45,19 @@ static inline struct udphdr *udp_hdr(const struct sk_buff *skb) | |||
45 | return (struct udphdr *)skb_transport_header(skb); | 45 | return (struct udphdr *)skb_transport_header(skb); |
46 | } | 46 | } |
47 | 47 | ||
48 | #define UDP_HTABLE_SIZE 128 | 48 | #define UDP_HTABLE_SIZE_MIN (CONFIG_BASE_SMALL ? 128 : 256) |
49 | 49 | ||
50 | static inline int udp_hashfn(struct net *net, const unsigned num) | 50 | static inline int udp_hashfn(struct net *net, unsigned num, unsigned mask) |
51 | { | 51 | { |
52 | return (num + net_hash_mix(net)) & (UDP_HTABLE_SIZE - 1); | 52 | return (num + net_hash_mix(net)) & mask; |
53 | } | 53 | } |
54 | 54 | ||
55 | struct udp_sock { | 55 | struct udp_sock { |
56 | /* inet_sock has to be the first member */ | 56 | /* inet_sock has to be the first member */ |
57 | struct inet_sock inet; | 57 | struct inet_sock inet; |
58 | #define udp_port_hash inet.sk.__sk_common.skc_u16hashes[0] | ||
59 | #define udp_portaddr_hash inet.sk.__sk_common.skc_u16hashes[1] | ||
60 | #define udp_portaddr_node inet.sk.__sk_common.skc_portaddr_node | ||
58 | int pending; /* Any pending frames ? */ | 61 | int pending; /* Any pending frames ? */ |
59 | unsigned int corkflag; /* Cork is required */ | 62 | unsigned int corkflag; /* Cork is required */ |
60 | __u16 encap_type; /* Is this an Encapsulation socket? */ | 63 | __u16 encap_type; /* Is this an Encapsulation socket? */ |
@@ -85,6 +88,12 @@ static inline struct udp_sock *udp_sk(const struct sock *sk) | |||
85 | return (struct udp_sock *)sk; | 88 | return (struct udp_sock *)sk; |
86 | } | 89 | } |
87 | 90 | ||
91 | #define udp_portaddr_for_each_entry(__sk, node, list) \ | ||
92 | hlist_nulls_for_each_entry(__sk, node, list, __sk_common.skc_portaddr_node) | ||
93 | |||
94 | #define udp_portaddr_for_each_entry_rcu(__sk, node, list) \ | ||
95 | hlist_nulls_for_each_entry_rcu(__sk, node, list, __sk_common.skc_portaddr_node) | ||
96 | |||
88 | #define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag) | 97 | #define IS_UDPLITE(__sk) (udp_sk(__sk)->pcflag) |
89 | 98 | ||
90 | #endif | 99 | #endif |
diff --git a/include/linux/usb.h b/include/linux/usb.h index a34fa89f1474..e101a2d04d75 100644 --- a/include/linux/usb.h +++ b/include/linux/usb.h | |||
@@ -331,6 +331,7 @@ struct usb_bus { | |||
331 | u8 otg_port; /* 0, or number of OTG/HNP port */ | 331 | u8 otg_port; /* 0, or number of OTG/HNP port */ |
332 | unsigned is_b_host:1; /* true during some HNP roleswitches */ | 332 | unsigned is_b_host:1; /* true during some HNP roleswitches */ |
333 | unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ | 333 | unsigned b_hnp_enable:1; /* OTG: did A-Host enable HNP? */ |
334 | unsigned sg_tablesize; /* 0 or largest number of sg list entries */ | ||
334 | 335 | ||
335 | int devnum_next; /* Next open device number in | 336 | int devnum_next; /* Next open device number in |
336 | * round-robin allocation */ | 337 | * round-robin allocation */ |
@@ -428,11 +429,9 @@ struct usb_tt; | |||
428 | * @last_busy: time of last use | 429 | * @last_busy: time of last use |
429 | * @autosuspend_delay: in jiffies | 430 | * @autosuspend_delay: in jiffies |
430 | * @connect_time: time device was first connected | 431 | * @connect_time: time device was first connected |
431 | * @auto_pm: autosuspend/resume in progress | ||
432 | * @do_remote_wakeup: remote wakeup should be enabled | 432 | * @do_remote_wakeup: remote wakeup should be enabled |
433 | * @reset_resume: needs reset instead of resume | 433 | * @reset_resume: needs reset instead of resume |
434 | * @autosuspend_disabled: autosuspend disabled by the user | 434 | * @autosuspend_disabled: autosuspend disabled by the user |
435 | * @autoresume_disabled: autoresume disabled by the user | ||
436 | * @skip_sys_resume: skip the next system resume | 435 | * @skip_sys_resume: skip the next system resume |
437 | * @wusb_dev: if this is a Wireless USB device, link to the WUSB | 436 | * @wusb_dev: if this is a Wireless USB device, link to the WUSB |
438 | * specific data for the device. | 437 | * specific data for the device. |
@@ -513,11 +512,9 @@ struct usb_device { | |||
513 | int autosuspend_delay; | 512 | int autosuspend_delay; |
514 | unsigned long connect_time; | 513 | unsigned long connect_time; |
515 | 514 | ||
516 | unsigned auto_pm:1; | ||
517 | unsigned do_remote_wakeup:1; | 515 | unsigned do_remote_wakeup:1; |
518 | unsigned reset_resume:1; | 516 | unsigned reset_resume:1; |
519 | unsigned autosuspend_disabled:1; | 517 | unsigned autosuspend_disabled:1; |
520 | unsigned autoresume_disabled:1; | ||
521 | unsigned skip_sys_resume:1; | 518 | unsigned skip_sys_resume:1; |
522 | #endif | 519 | #endif |
523 | struct wusb_dev *wusb_dev; | 520 | struct wusb_dev *wusb_dev; |
@@ -543,22 +540,20 @@ extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id); | |||
543 | 540 | ||
544 | /* USB autosuspend and autoresume */ | 541 | /* USB autosuspend and autoresume */ |
545 | #ifdef CONFIG_USB_SUSPEND | 542 | #ifdef CONFIG_USB_SUSPEND |
546 | extern int usb_autopm_set_interface(struct usb_interface *intf); | ||
547 | extern int usb_autopm_get_interface(struct usb_interface *intf); | 543 | extern int usb_autopm_get_interface(struct usb_interface *intf); |
548 | extern void usb_autopm_put_interface(struct usb_interface *intf); | 544 | extern void usb_autopm_put_interface(struct usb_interface *intf); |
549 | extern int usb_autopm_get_interface_async(struct usb_interface *intf); | 545 | extern int usb_autopm_get_interface_async(struct usb_interface *intf); |
550 | extern void usb_autopm_put_interface_async(struct usb_interface *intf); | 546 | extern void usb_autopm_put_interface_async(struct usb_interface *intf); |
551 | 547 | ||
552 | static inline void usb_autopm_enable(struct usb_interface *intf) | 548 | static inline void usb_autopm_get_interface_no_resume( |
549 | struct usb_interface *intf) | ||
553 | { | 550 | { |
554 | atomic_set(&intf->pm_usage_cnt, 0); | 551 | atomic_inc(&intf->pm_usage_cnt); |
555 | usb_autopm_set_interface(intf); | ||
556 | } | 552 | } |
557 | 553 | static inline void usb_autopm_put_interface_no_suspend( | |
558 | static inline void usb_autopm_disable(struct usb_interface *intf) | 554 | struct usb_interface *intf) |
559 | { | 555 | { |
560 | atomic_set(&intf->pm_usage_cnt, 1); | 556 | atomic_dec(&intf->pm_usage_cnt); |
561 | usb_autopm_set_interface(intf); | ||
562 | } | 557 | } |
563 | 558 | ||
564 | static inline void usb_mark_last_busy(struct usb_device *udev) | 559 | static inline void usb_mark_last_busy(struct usb_device *udev) |
@@ -568,12 +563,8 @@ static inline void usb_mark_last_busy(struct usb_device *udev) | |||
568 | 563 | ||
569 | #else | 564 | #else |
570 | 565 | ||
571 | static inline int usb_autopm_set_interface(struct usb_interface *intf) | ||
572 | { return 0; } | ||
573 | |||
574 | static inline int usb_autopm_get_interface(struct usb_interface *intf) | 566 | static inline int usb_autopm_get_interface(struct usb_interface *intf) |
575 | { return 0; } | 567 | { return 0; } |
576 | |||
577 | static inline int usb_autopm_get_interface_async(struct usb_interface *intf) | 568 | static inline int usb_autopm_get_interface_async(struct usb_interface *intf) |
578 | { return 0; } | 569 | { return 0; } |
579 | 570 | ||
@@ -581,9 +572,11 @@ static inline void usb_autopm_put_interface(struct usb_interface *intf) | |||
581 | { } | 572 | { } |
582 | static inline void usb_autopm_put_interface_async(struct usb_interface *intf) | 573 | static inline void usb_autopm_put_interface_async(struct usb_interface *intf) |
583 | { } | 574 | { } |
584 | static inline void usb_autopm_enable(struct usb_interface *intf) | 575 | static inline void usb_autopm_get_interface_no_resume( |
576 | struct usb_interface *intf) | ||
585 | { } | 577 | { } |
586 | static inline void usb_autopm_disable(struct usb_interface *intf) | 578 | static inline void usb_autopm_put_interface_no_suspend( |
579 | struct usb_interface *intf) | ||
587 | { } | 580 | { } |
588 | static inline void usb_mark_last_busy(struct usb_device *udev) | 581 | static inline void usb_mark_last_busy(struct usb_device *udev) |
589 | { } | 582 | { } |
@@ -626,6 +619,10 @@ extern struct usb_interface *usb_ifnum_to_if(const struct usb_device *dev, | |||
626 | unsigned ifnum); | 619 | unsigned ifnum); |
627 | extern struct usb_host_interface *usb_altnum_to_altsetting( | 620 | extern struct usb_host_interface *usb_altnum_to_altsetting( |
628 | const struct usb_interface *intf, unsigned int altnum); | 621 | const struct usb_interface *intf, unsigned int altnum); |
622 | extern struct usb_host_interface *usb_find_alt_setting( | ||
623 | struct usb_host_config *config, | ||
624 | unsigned int iface_num, | ||
625 | unsigned int alt_num); | ||
629 | 626 | ||
630 | 627 | ||
631 | /** | 628 | /** |
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h index 4f6bb3d2160e..738ea1a691cb 100644 --- a/include/linux/usb/composite.h +++ b/include/linux/usb/composite.h | |||
@@ -127,6 +127,7 @@ struct usb_function { | |||
127 | /* private: */ | 127 | /* private: */ |
128 | /* internals */ | 128 | /* internals */ |
129 | struct list_head list; | 129 | struct list_head list; |
130 | DECLARE_BITMAP(endpoints, 32); | ||
130 | }; | 131 | }; |
131 | 132 | ||
132 | int usb_add_function(struct usb_configuration *, struct usb_function *); | 133 | int usb_add_function(struct usb_configuration *, struct usb_function *); |
diff --git a/include/linux/usb/otg.h b/include/linux/usb/otg.h index 2443c0e7a80c..52bb917641f0 100644 --- a/include/linux/usb/otg.h +++ b/include/linux/usb/otg.h | |||
@@ -33,6 +33,23 @@ enum usb_otg_state { | |||
33 | OTG_STATE_A_VBUS_ERR, | 33 | OTG_STATE_A_VBUS_ERR, |
34 | }; | 34 | }; |
35 | 35 | ||
36 | #define USB_OTG_PULLUP_ID (1 << 0) | ||
37 | #define USB_OTG_PULLDOWN_DP (1 << 1) | ||
38 | #define USB_OTG_PULLDOWN_DM (1 << 2) | ||
39 | #define USB_OTG_EXT_VBUS_INDICATOR (1 << 3) | ||
40 | #define USB_OTG_DRV_VBUS (1 << 4) | ||
41 | #define USB_OTG_DRV_VBUS_EXT (1 << 5) | ||
42 | |||
43 | struct otg_transceiver; | ||
44 | |||
45 | /* for transceivers connected thru an ULPI interface, the user must | ||
46 | * provide access ops | ||
47 | */ | ||
48 | struct otg_io_access_ops { | ||
49 | int (*read)(struct otg_transceiver *otg, u32 reg); | ||
50 | int (*write)(struct otg_transceiver *otg, u32 val, u32 reg); | ||
51 | }; | ||
52 | |||
36 | /* | 53 | /* |
37 | * the otg driver needs to interact with both device side and host side | 54 | * the otg driver needs to interact with both device side and host side |
38 | * usb controllers. it decides which controller is active at a given | 55 | * usb controllers. it decides which controller is active at a given |
@@ -42,6 +59,7 @@ enum usb_otg_state { | |||
42 | struct otg_transceiver { | 59 | struct otg_transceiver { |
43 | struct device *dev; | 60 | struct device *dev; |
44 | const char *label; | 61 | const char *label; |
62 | unsigned int flags; | ||
45 | 63 | ||
46 | u8 default_a; | 64 | u8 default_a; |
47 | enum usb_otg_state state; | 65 | enum usb_otg_state state; |
@@ -49,10 +67,17 @@ struct otg_transceiver { | |||
49 | struct usb_bus *host; | 67 | struct usb_bus *host; |
50 | struct usb_gadget *gadget; | 68 | struct usb_gadget *gadget; |
51 | 69 | ||
70 | struct otg_io_access_ops *io_ops; | ||
71 | void __iomem *io_priv; | ||
72 | |||
52 | /* to pass extra port status to the root hub */ | 73 | /* to pass extra port status to the root hub */ |
53 | u16 port_status; | 74 | u16 port_status; |
54 | u16 port_change; | 75 | u16 port_change; |
55 | 76 | ||
77 | /* initialize/shutdown the OTG controller */ | ||
78 | int (*init)(struct otg_transceiver *otg); | ||
79 | void (*shutdown)(struct otg_transceiver *otg); | ||
80 | |||
56 | /* bind/unbind the host controller */ | 81 | /* bind/unbind the host controller */ |
57 | int (*set_host)(struct otg_transceiver *otg, | 82 | int (*set_host)(struct otg_transceiver *otg, |
58 | struct usb_bus *host); | 83 | struct usb_bus *host); |
@@ -65,6 +90,10 @@ struct otg_transceiver { | |||
65 | int (*set_power)(struct otg_transceiver *otg, | 90 | int (*set_power)(struct otg_transceiver *otg, |
66 | unsigned mA); | 91 | unsigned mA); |
67 | 92 | ||
93 | /* effective for A-peripheral, ignored for B devices */ | ||
94 | int (*set_vbus)(struct otg_transceiver *otg, | ||
95 | bool enabled); | ||
96 | |||
68 | /* for non-OTG B devices: set transceiver into suspend mode */ | 97 | /* for non-OTG B devices: set transceiver into suspend mode */ |
69 | int (*set_suspend)(struct otg_transceiver *otg, | 98 | int (*set_suspend)(struct otg_transceiver *otg, |
70 | int suspend); | 99 | int suspend); |
@@ -85,6 +114,38 @@ extern int otg_set_transceiver(struct otg_transceiver *); | |||
85 | extern void usb_nop_xceiv_register(void); | 114 | extern void usb_nop_xceiv_register(void); |
86 | extern void usb_nop_xceiv_unregister(void); | 115 | extern void usb_nop_xceiv_unregister(void); |
87 | 116 | ||
117 | /* helpers for direct access thru low-level io interface */ | ||
118 | static inline int otg_io_read(struct otg_transceiver *otg, u32 reg) | ||
119 | { | ||
120 | if (otg->io_ops && otg->io_ops->read) | ||
121 | return otg->io_ops->read(otg, reg); | ||
122 | |||
123 | return -EINVAL; | ||
124 | } | ||
125 | |||
126 | static inline int otg_io_write(struct otg_transceiver *otg, u32 reg, u32 val) | ||
127 | { | ||
128 | if (otg->io_ops && otg->io_ops->write) | ||
129 | return otg->io_ops->write(otg, reg, val); | ||
130 | |||
131 | return -EINVAL; | ||
132 | } | ||
133 | |||
134 | static inline int | ||
135 | otg_init(struct otg_transceiver *otg) | ||
136 | { | ||
137 | if (otg->init) | ||
138 | return otg->init(otg); | ||
139 | |||
140 | return 0; | ||
141 | } | ||
142 | |||
143 | static inline void | ||
144 | otg_shutdown(struct otg_transceiver *otg) | ||
145 | { | ||
146 | if (otg->shutdown) | ||
147 | otg->shutdown(otg); | ||
148 | } | ||
88 | 149 | ||
89 | /* for usb host and peripheral controller drivers */ | 150 | /* for usb host and peripheral controller drivers */ |
90 | extern struct otg_transceiver *otg_get_transceiver(void); | 151 | extern struct otg_transceiver *otg_get_transceiver(void); |
@@ -97,6 +158,12 @@ otg_start_hnp(struct otg_transceiver *otg) | |||
97 | return otg->start_hnp(otg); | 158 | return otg->start_hnp(otg); |
98 | } | 159 | } |
99 | 160 | ||
161 | /* Context: can sleep */ | ||
162 | static inline int | ||
163 | otg_set_vbus(struct otg_transceiver *otg, bool enabled) | ||
164 | { | ||
165 | return otg->set_vbus(otg, enabled); | ||
166 | } | ||
100 | 167 | ||
101 | /* for HCDs */ | 168 | /* for HCDs */ |
102 | static inline int | 169 | static inline int |
@@ -105,7 +172,6 @@ otg_set_host(struct otg_transceiver *otg, struct usb_bus *host) | |||
105 | return otg->set_host(otg, host); | 172 | return otg->set_host(otg, host); |
106 | } | 173 | } |
107 | 174 | ||
108 | |||
109 | /* for usb peripheral controller drivers */ | 175 | /* for usb peripheral controller drivers */ |
110 | 176 | ||
111 | /* Context: can sleep */ | 177 | /* Context: can sleep */ |
diff --git a/include/linux/usb/ulpi.h b/include/linux/usb/ulpi.h new file mode 100644 index 000000000000..20675c6ebc4d --- /dev/null +++ b/include/linux/usb/ulpi.h | |||
@@ -0,0 +1,7 @@ | |||
1 | #ifndef __LINUX_USB_ULPI_H | ||
2 | #define __LINUX_USB_ULPI_H | ||
3 | |||
4 | struct otg_transceiver *otg_ulpi_create(struct otg_io_access_ops *ops, | ||
5 | unsigned int flags); | ||
6 | |||
7 | #endif /* __LINUX_USB_ULPI_H */ | ||
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h index f81473052059..8ce61359bf73 100644 --- a/include/linux/usb/usbnet.h +++ b/include/linux/usb/usbnet.h | |||
@@ -55,6 +55,7 @@ struct usbnet { | |||
55 | struct sk_buff_head done; | 55 | struct sk_buff_head done; |
56 | struct sk_buff_head rxq_pause; | 56 | struct sk_buff_head rxq_pause; |
57 | struct urb *interrupt; | 57 | struct urb *interrupt; |
58 | struct usb_anchor deferred; | ||
58 | struct tasklet_struct bh; | 59 | struct tasklet_struct bh; |
59 | 60 | ||
60 | struct work_struct kevent; | 61 | struct work_struct kevent; |
@@ -65,6 +66,8 @@ struct usbnet { | |||
65 | # define EVENT_STS_SPLIT 3 | 66 | # define EVENT_STS_SPLIT 3 |
66 | # define EVENT_LINK_RESET 4 | 67 | # define EVENT_LINK_RESET 4 |
67 | # define EVENT_RX_PAUSED 5 | 68 | # define EVENT_RX_PAUSED 5 |
69 | # define EVENT_DEV_WAKING 6 | ||
70 | # define EVENT_DEV_ASLEEP 7 | ||
68 | }; | 71 | }; |
69 | 72 | ||
70 | static inline struct usb_driver *driver_of(struct usb_interface *intf) | 73 | static inline struct usb_driver *driver_of(struct usb_interface *intf) |
@@ -90,7 +93,9 @@ struct driver_info { | |||
90 | #define FLAG_WLAN 0x0080 /* use "wlan%d" names */ | 93 | #define FLAG_WLAN 0x0080 /* use "wlan%d" names */ |
91 | #define FLAG_AVOID_UNLINK_URBS 0x0100 /* don't unlink urbs at usbnet_stop() */ | 94 | #define FLAG_AVOID_UNLINK_URBS 0x0100 /* don't unlink urbs at usbnet_stop() */ |
92 | #define FLAG_SEND_ZLP 0x0200 /* hw requires ZLPs are sent */ | 95 | #define FLAG_SEND_ZLP 0x0200 /* hw requires ZLPs are sent */ |
96 | #define FLAG_WWAN 0x0400 /* use "wwan%d" names */ | ||
93 | 97 | ||
98 | #define FLAG_LINK_INTR 0x0800 /* updates link (carrier) status */ | ||
94 | 99 | ||
95 | /* init device ... can sleep, or cause probe() failure */ | 100 | /* init device ... can sleep, or cause probe() failure */ |
96 | int (*bind)(struct usbnet *, struct usb_interface *); | 101 | int (*bind)(struct usbnet *, struct usb_interface *); |
@@ -107,6 +112,9 @@ struct driver_info { | |||
107 | /* see if peer is connected ... can sleep */ | 112 | /* see if peer is connected ... can sleep */ |
108 | int (*check_connect)(struct usbnet *); | 113 | int (*check_connect)(struct usbnet *); |
109 | 114 | ||
115 | /* (dis)activate runtime power management */ | ||
116 | int (*manage_power)(struct usbnet *, int); | ||
117 | |||
110 | /* for status polling */ | 118 | /* for status polling */ |
111 | void (*status)(struct usbnet *, struct urb *); | 119 | void (*status)(struct usbnet *, struct urb *); |
112 | 120 | ||
diff --git a/include/linux/usb/wusb.h b/include/linux/usb/wusb.h index 429c631d2aad..63ebdcc5dda6 100644 --- a/include/linux/usb/wusb.h +++ b/include/linux/usb/wusb.h | |||
@@ -74,7 +74,7 @@ enum { | |||
74 | * WUSB defines that CHIDs, CDIDs and CKs are a 16 byte string of | 74 | * WUSB defines that CHIDs, CDIDs and CKs are a 16 byte string of |
75 | * data. In order to avoid confusion and enforce types, we wrap it. | 75 | * data. In order to avoid confusion and enforce types, we wrap it. |
76 | * | 76 | * |
77 | * Make it packed, as we use it in some hw defintions. | 77 | * Make it packed, as we use it in some hw definitions. |
78 | */ | 78 | */ |
79 | struct wusb_ckhdid { | 79 | struct wusb_ckhdid { |
80 | u8 data[16]; | 80 | u8 data[16]; |
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h index 3d15fb9bc116..a4b947e470a5 100644 --- a/include/linux/usb_usual.h +++ b/include/linux/usb_usual.h | |||
@@ -56,7 +56,9 @@ | |||
56 | US_FLAG(SANE_SENSE, 0x00008000) \ | 56 | US_FLAG(SANE_SENSE, 0x00008000) \ |
57 | /* Sane Sense (> 18 bytes) */ \ | 57 | /* Sane Sense (> 18 bytes) */ \ |
58 | US_FLAG(CAPACITY_OK, 0x00010000) \ | 58 | US_FLAG(CAPACITY_OK, 0x00010000) \ |
59 | /* READ CAPACITY response is correct */ | 59 | /* READ CAPACITY response is correct */ \ |
60 | US_FLAG(BAD_SENSE, 0x00020000) \ | ||
61 | /* Bad Sense (never more than 18 bytes) */ | ||
60 | 62 | ||
61 | #define US_FLAG(name, value) US_FL_##name = value , | 63 | #define US_FLAG(name, value) US_FL_##name = value , |
62 | enum { US_DO_ALL_FLAGS }; | 64 | enum { US_DO_ALL_FLAGS }; |
diff --git a/include/linux/user-return-notifier.h b/include/linux/user-return-notifier.h new file mode 100644 index 000000000000..9c4a445bb43c --- /dev/null +++ b/include/linux/user-return-notifier.h | |||
@@ -0,0 +1,49 @@ | |||
1 | #ifndef _LINUX_USER_RETURN_NOTIFIER_H | ||
2 | #define _LINUX_USER_RETURN_NOTIFIER_H | ||
3 | |||
4 | #ifdef CONFIG_USER_RETURN_NOTIFIER | ||
5 | |||
6 | #include <linux/list.h> | ||
7 | #include <linux/sched.h> | ||
8 | |||
9 | struct user_return_notifier { | ||
10 | void (*on_user_return)(struct user_return_notifier *urn); | ||
11 | struct hlist_node link; | ||
12 | }; | ||
13 | |||
14 | |||
15 | void user_return_notifier_register(struct user_return_notifier *urn); | ||
16 | void user_return_notifier_unregister(struct user_return_notifier *urn); | ||
17 | |||
18 | static inline void propagate_user_return_notify(struct task_struct *prev, | ||
19 | struct task_struct *next) | ||
20 | { | ||
21 | if (test_tsk_thread_flag(prev, TIF_USER_RETURN_NOTIFY)) { | ||
22 | clear_tsk_thread_flag(prev, TIF_USER_RETURN_NOTIFY); | ||
23 | set_tsk_thread_flag(next, TIF_USER_RETURN_NOTIFY); | ||
24 | } | ||
25 | } | ||
26 | |||
27 | void fire_user_return_notifiers(void); | ||
28 | |||
29 | static inline void clear_user_return_notifier(struct task_struct *p) | ||
30 | { | ||
31 | clear_tsk_thread_flag(p, TIF_USER_RETURN_NOTIFY); | ||
32 | } | ||
33 | |||
34 | #else | ||
35 | |||
36 | struct user_return_notifier {}; | ||
37 | |||
38 | static inline void propagate_user_return_notify(struct task_struct *prev, | ||
39 | struct task_struct *next) | ||
40 | { | ||
41 | } | ||
42 | |||
43 | static inline void fire_user_return_notifiers(void) {} | ||
44 | |||
45 | static inline void clear_user_return_notifier(struct task_struct *p) {} | ||
46 | |||
47 | #endif | ||
48 | |||
49 | #endif | ||
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h index b59e78c57161..32b92298fd79 100644 --- a/include/linux/videodev2.h +++ b/include/linux/videodev2.h | |||
@@ -361,6 +361,7 @@ struct v4l2_pix_format { | |||
361 | #define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ | 361 | #define V4L2_PIX_FMT_PJPG v4l2_fourcc('P', 'J', 'P', 'G') /* Pixart 73xx JPEG */ |
362 | #define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */ | 362 | #define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */ |
363 | #define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */ | 363 | #define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */ |
364 | #define V4L2_PIX_FMT_STV0680 v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */ | ||
364 | 365 | ||
365 | /* | 366 | /* |
366 | * F O R M A T E N U M E R A T I O N | 367 | * F O R M A T E N U M E R A T I O N |
@@ -490,7 +491,7 @@ struct v4l2_jpegcompression { | |||
490 | * you do, leave them untouched. | 491 | * you do, leave them untouched. |
491 | * Inluding less markers will make the | 492 | * Inluding less markers will make the |
492 | * resulting code smaller, but there will | 493 | * resulting code smaller, but there will |
493 | * be fewer aplications which can read it. | 494 | * be fewer applications which can read it. |
494 | * The presence of the APP and COM marker | 495 | * The presence of the APP and COM marker |
495 | * is influenced by APP_len and COM_len | 496 | * is influenced by APP_len and COM_len |
496 | * ONLY, not by this property! */ | 497 | * ONLY, not by this property! */ |
@@ -563,6 +564,7 @@ struct v4l2_framebuffer { | |||
563 | #define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010 | 564 | #define V4L2_FBUF_CAP_LOCAL_ALPHA 0x0010 |
564 | #define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020 | 565 | #define V4L2_FBUF_CAP_GLOBAL_ALPHA 0x0020 |
565 | #define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040 | 566 | #define V4L2_FBUF_CAP_LOCAL_INV_ALPHA 0x0040 |
567 | #define V4L2_FBUF_CAP_SRC_CHROMAKEY 0x0080 | ||
566 | /* Flags for the 'flags' field. */ | 568 | /* Flags for the 'flags' field. */ |
567 | #define V4L2_FBUF_FLAG_PRIMARY 0x0001 | 569 | #define V4L2_FBUF_FLAG_PRIMARY 0x0001 |
568 | #define V4L2_FBUF_FLAG_OVERLAY 0x0002 | 570 | #define V4L2_FBUF_FLAG_OVERLAY 0x0002 |
@@ -570,6 +572,7 @@ struct v4l2_framebuffer { | |||
570 | #define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008 | 572 | #define V4L2_FBUF_FLAG_LOCAL_ALPHA 0x0008 |
571 | #define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010 | 573 | #define V4L2_FBUF_FLAG_GLOBAL_ALPHA 0x0010 |
572 | #define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020 | 574 | #define V4L2_FBUF_FLAG_LOCAL_INV_ALPHA 0x0020 |
575 | #define V4L2_FBUF_FLAG_SRC_CHROMAKEY 0x0040 | ||
573 | 576 | ||
574 | struct v4l2_clip { | 577 | struct v4l2_clip { |
575 | struct v4l2_rect c; | 578 | struct v4l2_rect c; |
@@ -912,8 +915,10 @@ enum v4l2_colorfx { | |||
912 | #define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32) | 915 | #define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32) |
913 | #define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33) | 916 | #define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33) |
914 | 917 | ||
918 | #define V4L2_CID_ROTATE (V4L2_CID_BASE+34) | ||
919 | #define V4L2_CID_BG_COLOR (V4L2_CID_BASE+35) | ||
915 | /* last CID + 1 */ | 920 | /* last CID + 1 */ |
916 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+34) | 921 | #define V4L2_CID_LASTP1 (V4L2_CID_BASE+36) |
917 | 922 | ||
918 | /* MPEG-class control IDs defined by V4L2 */ | 923 | /* MPEG-class control IDs defined by V4L2 */ |
919 | #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) | 924 | #define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) |
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h index c0c4e1103a73..7f56db4a79f0 100644 --- a/include/linux/vt_kern.h +++ b/include/linux/vt_kern.h | |||
@@ -110,6 +110,7 @@ extern char con_buf[CON_BUF_SIZE]; | |||
110 | extern struct mutex con_buf_mtx; | 110 | extern struct mutex con_buf_mtx; |
111 | extern char vt_dont_switch; | 111 | extern char vt_dont_switch; |
112 | extern int default_utf8; | 112 | extern int default_utf8; |
113 | extern int global_cursor_default; | ||
113 | 114 | ||
114 | struct vt_spawn_console { | 115 | struct vt_spawn_console { |
115 | spinlock_t lock; | 116 | spinlock_t lock; |
@@ -130,4 +131,6 @@ struct vt_notifier_param { | |||
130 | extern int register_vt_notifier(struct notifier_block *nb); | 131 | extern int register_vt_notifier(struct notifier_block *nb); |
131 | extern int unregister_vt_notifier(struct notifier_block *nb); | 132 | extern int unregister_vt_notifier(struct notifier_block *nb); |
132 | 133 | ||
134 | extern void hide_boot_cursor(bool hide); | ||
135 | |||
133 | #endif /* _VT_KERN_H */ | 136 | #endif /* _VT_KERN_H */ |
diff --git a/include/linux/wimax/debug.h b/include/linux/wimax/debug.h index c703e0340423..db8096e88533 100644 --- a/include/linux/wimax/debug.h +++ b/include/linux/wimax/debug.h | |||
@@ -450,4 +450,76 @@ do { \ | |||
450 | }) | 450 | }) |
451 | 451 | ||
452 | 452 | ||
453 | static inline | ||
454 | void d_submodule_set(struct d_level *d_level, size_t d_level_size, | ||
455 | const char *submodule, u8 level, const char *tag) | ||
456 | { | ||
457 | struct d_level *itr, *top; | ||
458 | int index = -1; | ||
459 | |||
460 | for (itr = d_level, top = itr + d_level_size; itr < top; itr++) { | ||
461 | index++; | ||
462 | if (itr->name == NULL) { | ||
463 | printk(KERN_ERR "%s: itr->name NULL?? (%p, #%d)\n", | ||
464 | tag, itr, index); | ||
465 | continue; | ||
466 | } | ||
467 | if (!strcmp(itr->name, submodule)) { | ||
468 | itr->level = level; | ||
469 | return; | ||
470 | } | ||
471 | } | ||
472 | printk(KERN_ERR "%s: unknown submodule %s\n", tag, submodule); | ||
473 | } | ||
474 | |||
475 | |||
476 | /** | ||
477 | * d_parse_params - Parse a string with debug parameters from the | ||
478 | * command line | ||
479 | * | ||
480 | * @d_level: level structure (D_LEVEL) | ||
481 | * @d_level_size: number of items in the level structure | ||
482 | * (D_LEVEL_SIZE). | ||
483 | * @_params: string with the parameters; this is a space (not tab!) | ||
484 | * separated list of NAME:VALUE, where value is the debug level | ||
485 | * and NAME is the name of the submodule. | ||
486 | * @tag: string for error messages (example: MODULE.ARGNAME). | ||
487 | */ | ||
488 | static inline | ||
489 | void d_parse_params(struct d_level *d_level, size_t d_level_size, | ||
490 | const char *_params, const char *tag) | ||
491 | { | ||
492 | char submodule[130], *params, *params_orig, *token, *colon; | ||
493 | unsigned level, tokens; | ||
494 | |||
495 | if (_params == NULL) | ||
496 | return; | ||
497 | params_orig = kstrdup(_params, GFP_KERNEL); | ||
498 | params = params_orig; | ||
499 | while (1) { | ||
500 | token = strsep(¶ms, " "); | ||
501 | if (token == NULL) | ||
502 | break; | ||
503 | if (*token == '\0') /* eat joint spaces */ | ||
504 | continue; | ||
505 | /* kernel's sscanf %s eats until whitespace, so we | ||
506 | * replace : by \n so it doesn't get eaten later by | ||
507 | * strsep */ | ||
508 | colon = strchr(token, ':'); | ||
509 | if (colon != NULL) | ||
510 | *colon = '\n'; | ||
511 | tokens = sscanf(token, "%s\n%u", submodule, &level); | ||
512 | if (colon != NULL) | ||
513 | *colon = ':'; /* set back, for error messages */ | ||
514 | if (tokens == 2) | ||
515 | d_submodule_set(d_level, d_level_size, | ||
516 | submodule, level, tag); | ||
517 | else | ||
518 | printk(KERN_ERR "%s: can't parse '%s' as a " | ||
519 | "SUBMODULE:LEVEL (%d tokens)\n", | ||
520 | tag, token, tokens); | ||
521 | } | ||
522 | kfree(params_orig); | ||
523 | } | ||
524 | |||
453 | #endif /* #ifndef __debug__h__ */ | 525 | #endif /* #ifndef __debug__h__ */ |
diff --git a/include/linux/wimax/i2400m.h b/include/linux/wimax/i2400m.h index 433693ef2bb0..62d356153565 100644 --- a/include/linux/wimax/i2400m.h +++ b/include/linux/wimax/i2400m.h | |||
@@ -138,7 +138,7 @@ struct i2400m_bcf_hdr { | |||
138 | __le32 module_id; | 138 | __le32 module_id; |
139 | __le32 module_vendor; | 139 | __le32 module_vendor; |
140 | __le32 date; /* BCD YYYMMDD */ | 140 | __le32 date; /* BCD YYYMMDD */ |
141 | __le32 size; | 141 | __le32 size; /* in dwords */ |
142 | __le32 key_size; /* in dwords */ | 142 | __le32 key_size; /* in dwords */ |
143 | __le32 modulus_size; /* in dwords */ | 143 | __le32 modulus_size; /* in dwords */ |
144 | __le32 exponent_size; /* in dwords */ | 144 | __le32 exponent_size; /* in dwords */ |
@@ -168,16 +168,6 @@ enum i2400m_brh { | |||
168 | }; | 168 | }; |
169 | 169 | ||
170 | 170 | ||
171 | /* Constants for bcf->module_id */ | ||
172 | enum i2400m_bcf_mod_id { | ||
173 | /* Firmware file carries its own pokes -- pokes are a set of | ||
174 | * magical values that have to be written in certain memory | ||
175 | * addresses to get the device up and ready for firmware | ||
176 | * download when it is in non-signed boot mode. */ | ||
177 | I2400M_BCF_MOD_ID_POKES = 0x000000001, | ||
178 | }; | ||
179 | |||
180 | |||
181 | /** | 171 | /** |
182 | * i2400m_bootrom_header - Header for a boot-mode command | 172 | * i2400m_bootrom_header - Header for a boot-mode command |
183 | * | 173 | * |
@@ -276,6 +266,7 @@ enum { | |||
276 | I2400M_WARM_RESET_BARKER = 0x50f750f7, | 266 | I2400M_WARM_RESET_BARKER = 0x50f750f7, |
277 | I2400M_NBOOT_BARKER = 0xdeadbeef, | 267 | I2400M_NBOOT_BARKER = 0xdeadbeef, |
278 | I2400M_SBOOT_BARKER = 0x0ff1c1a1, | 268 | I2400M_SBOOT_BARKER = 0x0ff1c1a1, |
269 | I2400M_SBOOT_BARKER_6050 = 0x80000001, | ||
279 | I2400M_ACK_BARKER = 0xfeedbabe, | 270 | I2400M_ACK_BARKER = 0xfeedbabe, |
280 | I2400M_D2H_MSG_BARKER = 0xbeefbabe, | 271 | I2400M_D2H_MSG_BARKER = 0xbeefbabe, |
281 | }; | 272 | }; |
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h index cf24c20de9e4..9466e860d8c2 100644 --- a/include/linux/workqueue.h +++ b/include/linux/workqueue.h | |||
@@ -25,6 +25,7 @@ typedef void (*work_func_t)(struct work_struct *work); | |||
25 | struct work_struct { | 25 | struct work_struct { |
26 | atomic_long_t data; | 26 | atomic_long_t data; |
27 | #define WORK_STRUCT_PENDING 0 /* T if work item pending execution */ | 27 | #define WORK_STRUCT_PENDING 0 /* T if work item pending execution */ |
28 | #define WORK_STRUCT_STATIC 1 /* static initializer (debugobjects) */ | ||
28 | #define WORK_STRUCT_FLAG_MASK (3UL) | 29 | #define WORK_STRUCT_FLAG_MASK (3UL) |
29 | #define WORK_STRUCT_WQ_DATA_MASK (~WORK_STRUCT_FLAG_MASK) | 30 | #define WORK_STRUCT_WQ_DATA_MASK (~WORK_STRUCT_FLAG_MASK) |
30 | struct list_head entry; | 31 | struct list_head entry; |
@@ -35,6 +36,7 @@ struct work_struct { | |||
35 | }; | 36 | }; |
36 | 37 | ||
37 | #define WORK_DATA_INIT() ATOMIC_LONG_INIT(0) | 38 | #define WORK_DATA_INIT() ATOMIC_LONG_INIT(0) |
39 | #define WORK_DATA_STATIC_INIT() ATOMIC_LONG_INIT(2) | ||
38 | 40 | ||
39 | struct delayed_work { | 41 | struct delayed_work { |
40 | struct work_struct work; | 42 | struct work_struct work; |
@@ -63,7 +65,7 @@ struct execute_work { | |||
63 | #endif | 65 | #endif |
64 | 66 | ||
65 | #define __WORK_INITIALIZER(n, f) { \ | 67 | #define __WORK_INITIALIZER(n, f) { \ |
66 | .data = WORK_DATA_INIT(), \ | 68 | .data = WORK_DATA_STATIC_INIT(), \ |
67 | .entry = { &(n).entry, &(n).entry }, \ | 69 | .entry = { &(n).entry, &(n).entry }, \ |
68 | .func = (f), \ | 70 | .func = (f), \ |
69 | __WORK_INIT_LOCKDEP_MAP(#n, &(n)) \ | 71 | __WORK_INIT_LOCKDEP_MAP(#n, &(n)) \ |
@@ -91,6 +93,14 @@ struct execute_work { | |||
91 | #define PREPARE_DELAYED_WORK(_work, _func) \ | 93 | #define PREPARE_DELAYED_WORK(_work, _func) \ |
92 | PREPARE_WORK(&(_work)->work, (_func)) | 94 | PREPARE_WORK(&(_work)->work, (_func)) |
93 | 95 | ||
96 | #ifdef CONFIG_DEBUG_OBJECTS_WORK | ||
97 | extern void __init_work(struct work_struct *work, int onstack); | ||
98 | extern void destroy_work_on_stack(struct work_struct *work); | ||
99 | #else | ||
100 | static inline void __init_work(struct work_struct *work, int onstack) { } | ||
101 | static inline void destroy_work_on_stack(struct work_struct *work) { } | ||
102 | #endif | ||
103 | |||
94 | /* | 104 | /* |
95 | * initialize all of a work item in one go | 105 | * initialize all of a work item in one go |
96 | * | 106 | * |
@@ -99,24 +109,36 @@ struct execute_work { | |||
99 | * to generate better code. | 109 | * to generate better code. |
100 | */ | 110 | */ |
101 | #ifdef CONFIG_LOCKDEP | 111 | #ifdef CONFIG_LOCKDEP |
102 | #define INIT_WORK(_work, _func) \ | 112 | #define __INIT_WORK(_work, _func, _onstack) \ |
103 | do { \ | 113 | do { \ |
104 | static struct lock_class_key __key; \ | 114 | static struct lock_class_key __key; \ |
105 | \ | 115 | \ |
116 | __init_work((_work), _onstack); \ | ||
106 | (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ | 117 | (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ |
107 | lockdep_init_map(&(_work)->lockdep_map, #_work, &__key, 0);\ | 118 | lockdep_init_map(&(_work)->lockdep_map, #_work, &__key, 0);\ |
108 | INIT_LIST_HEAD(&(_work)->entry); \ | 119 | INIT_LIST_HEAD(&(_work)->entry); \ |
109 | PREPARE_WORK((_work), (_func)); \ | 120 | PREPARE_WORK((_work), (_func)); \ |
110 | } while (0) | 121 | } while (0) |
111 | #else | 122 | #else |
112 | #define INIT_WORK(_work, _func) \ | 123 | #define __INIT_WORK(_work, _func, _onstack) \ |
113 | do { \ | 124 | do { \ |
125 | __init_work((_work), _onstack); \ | ||
114 | (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ | 126 | (_work)->data = (atomic_long_t) WORK_DATA_INIT(); \ |
115 | INIT_LIST_HEAD(&(_work)->entry); \ | 127 | INIT_LIST_HEAD(&(_work)->entry); \ |
116 | PREPARE_WORK((_work), (_func)); \ | 128 | PREPARE_WORK((_work), (_func)); \ |
117 | } while (0) | 129 | } while (0) |
118 | #endif | 130 | #endif |
119 | 131 | ||
132 | #define INIT_WORK(_work, _func) \ | ||
133 | do { \ | ||
134 | __INIT_WORK((_work), (_func), 0); \ | ||
135 | } while (0) | ||
136 | |||
137 | #define INIT_WORK_ON_STACK(_work, _func) \ | ||
138 | do { \ | ||
139 | __INIT_WORK((_work), (_func), 1); \ | ||
140 | } while (0) | ||
141 | |||
120 | #define INIT_DELAYED_WORK(_work, _func) \ | 142 | #define INIT_DELAYED_WORK(_work, _func) \ |
121 | do { \ | 143 | do { \ |
122 | INIT_WORK(&(_work)->work, (_func)); \ | 144 | INIT_WORK(&(_work)->work, (_func)); \ |
@@ -125,22 +147,16 @@ struct execute_work { | |||
125 | 147 | ||
126 | #define INIT_DELAYED_WORK_ON_STACK(_work, _func) \ | 148 | #define INIT_DELAYED_WORK_ON_STACK(_work, _func) \ |
127 | do { \ | 149 | do { \ |
128 | INIT_WORK(&(_work)->work, (_func)); \ | 150 | INIT_WORK_ON_STACK(&(_work)->work, (_func)); \ |
129 | init_timer_on_stack(&(_work)->timer); \ | 151 | init_timer_on_stack(&(_work)->timer); \ |
130 | } while (0) | 152 | } while (0) |
131 | 153 | ||
132 | #define INIT_DELAYED_WORK_DEFERRABLE(_work, _func) \ | 154 | #define INIT_DELAYED_WORK_DEFERRABLE(_work, _func) \ |
133 | do { \ | 155 | do { \ |
134 | INIT_WORK(&(_work)->work, (_func)); \ | 156 | INIT_WORK(&(_work)->work, (_func)); \ |
135 | init_timer_deferrable(&(_work)->timer); \ | 157 | init_timer_deferrable(&(_work)->timer); \ |
136 | } while (0) | 158 | } while (0) |
137 | 159 | ||
138 | #define INIT_DELAYED_WORK_ON_STACK(_work, _func) \ | ||
139 | do { \ | ||
140 | INIT_WORK(&(_work)->work, (_func)); \ | ||
141 | init_timer_on_stack(&(_work)->timer); \ | ||
142 | } while (0) | ||
143 | |||
144 | /** | 160 | /** |
145 | * work_pending - Find out whether a work item is currently pending | 161 | * work_pending - Find out whether a work item is currently pending |
146 | * @work: The work item in question | 162 | * @work: The work item in question |
diff --git a/include/linux/writeback.h b/include/linux/writeback.h index 66ebddcff664..705f01fe413a 100644 --- a/include/linux/writeback.h +++ b/include/linux/writeback.h | |||
@@ -49,6 +49,7 @@ struct writeback_control { | |||
49 | unsigned nonblocking:1; /* Don't get stuck on request queues */ | 49 | unsigned nonblocking:1; /* Don't get stuck on request queues */ |
50 | unsigned encountered_congestion:1; /* An output: a queue is full */ | 50 | unsigned encountered_congestion:1; /* An output: a queue is full */ |
51 | unsigned for_kupdate:1; /* A kupdate writeback */ | 51 | unsigned for_kupdate:1; /* A kupdate writeback */ |
52 | unsigned for_background:1; /* A background writeback */ | ||
52 | unsigned for_reclaim:1; /* Invoked from the page allocator */ | 53 | unsigned for_reclaim:1; /* Invoked from the page allocator */ |
53 | unsigned range_cyclic:1; /* range_start is cyclic */ | 54 | unsigned range_cyclic:1; /* range_start is cyclic */ |
54 | unsigned more_io:1; /* more io to be dispatched */ | 55 | unsigned more_io:1; /* more io to be dispatched */ |
diff --git a/include/linux/x25.h b/include/linux/x25.h index d035e4e87d07..6450a7f12074 100644 --- a/include/linux/x25.h +++ b/include/linux/x25.h | |||
@@ -25,6 +25,7 @@ | |||
25 | #define SIOCX25SENDCALLACCPT (SIOCPROTOPRIVATE + 9) | 25 | #define SIOCX25SENDCALLACCPT (SIOCPROTOPRIVATE + 9) |
26 | #define SIOCX25GDTEFACILITIES (SIOCPROTOPRIVATE + 10) | 26 | #define SIOCX25GDTEFACILITIES (SIOCPROTOPRIVATE + 10) |
27 | #define SIOCX25SDTEFACILITIES (SIOCPROTOPRIVATE + 11) | 27 | #define SIOCX25SDTEFACILITIES (SIOCPROTOPRIVATE + 11) |
28 | #define SIOCX25SCAUSEDIAG (SIOCPROTOPRIVATE + 12) | ||
28 | 29 | ||
29 | /* | 30 | /* |
30 | * Values for {get,set}sockopt. | 31 | * Values for {get,set}sockopt. |
diff --git a/include/linux/xfrm.h b/include/linux/xfrm.h index 2d4ec15abaca..29e04beb1fc9 100644 --- a/include/linux/xfrm.h +++ b/include/linux/xfrm.h | |||
@@ -10,8 +10,7 @@ | |||
10 | /* Structure to encapsulate addresses. I do not want to use | 10 | /* Structure to encapsulate addresses. I do not want to use |
11 | * "standard" structure. My apologies. | 11 | * "standard" structure. My apologies. |
12 | */ | 12 | */ |
13 | typedef union | 13 | typedef union { |
14 | { | ||
15 | __be32 a4; | 14 | __be32 a4; |
16 | __be32 a6[4]; | 15 | __be32 a6[4]; |
17 | } xfrm_address_t; | 16 | } xfrm_address_t; |
@@ -20,8 +19,7 @@ typedef union | |||
20 | * the state by (spi,daddr,ah/esp) or to store information about | 19 | * the state by (spi,daddr,ah/esp) or to store information about |
21 | * spi, protocol and tunnel address on output. | 20 | * spi, protocol and tunnel address on output. |
22 | */ | 21 | */ |
23 | struct xfrm_id | 22 | struct xfrm_id { |
24 | { | ||
25 | xfrm_address_t daddr; | 23 | xfrm_address_t daddr; |
26 | __be32 spi; | 24 | __be32 spi; |
27 | __u8 proto; | 25 | __u8 proto; |
@@ -45,8 +43,7 @@ struct xfrm_sec_ctx { | |||
45 | 43 | ||
46 | /* Selector, used as selector both on policy rules (SPD) and SAs. */ | 44 | /* Selector, used as selector both on policy rules (SPD) and SAs. */ |
47 | 45 | ||
48 | struct xfrm_selector | 46 | struct xfrm_selector { |
49 | { | ||
50 | xfrm_address_t daddr; | 47 | xfrm_address_t daddr; |
51 | xfrm_address_t saddr; | 48 | xfrm_address_t saddr; |
52 | __be16 dport; | 49 | __be16 dport; |
@@ -63,8 +60,7 @@ struct xfrm_selector | |||
63 | 60 | ||
64 | #define XFRM_INF (~(__u64)0) | 61 | #define XFRM_INF (~(__u64)0) |
65 | 62 | ||
66 | struct xfrm_lifetime_cfg | 63 | struct xfrm_lifetime_cfg { |
67 | { | ||
68 | __u64 soft_byte_limit; | 64 | __u64 soft_byte_limit; |
69 | __u64 hard_byte_limit; | 65 | __u64 hard_byte_limit; |
70 | __u64 soft_packet_limit; | 66 | __u64 soft_packet_limit; |
@@ -75,16 +71,14 @@ struct xfrm_lifetime_cfg | |||
75 | __u64 hard_use_expires_seconds; | 71 | __u64 hard_use_expires_seconds; |
76 | }; | 72 | }; |
77 | 73 | ||
78 | struct xfrm_lifetime_cur | 74 | struct xfrm_lifetime_cur { |
79 | { | ||
80 | __u64 bytes; | 75 | __u64 bytes; |
81 | __u64 packets; | 76 | __u64 packets; |
82 | __u64 add_time; | 77 | __u64 add_time; |
83 | __u64 use_time; | 78 | __u64 use_time; |
84 | }; | 79 | }; |
85 | 80 | ||
86 | struct xfrm_replay_state | 81 | struct xfrm_replay_state { |
87 | { | ||
88 | __u32 oseq; | 82 | __u32 oseq; |
89 | __u32 seq; | 83 | __u32 seq; |
90 | __u32 bitmap; | 84 | __u32 bitmap; |
@@ -96,6 +90,13 @@ struct xfrm_algo { | |||
96 | char alg_key[0]; | 90 | char alg_key[0]; |
97 | }; | 91 | }; |
98 | 92 | ||
93 | struct xfrm_algo_auth { | ||
94 | char alg_name[64]; | ||
95 | unsigned int alg_key_len; /* in bits */ | ||
96 | unsigned int alg_trunc_len; /* in bits */ | ||
97 | char alg_key[0]; | ||
98 | }; | ||
99 | |||
99 | struct xfrm_algo_aead { | 100 | struct xfrm_algo_aead { |
100 | char alg_name[64]; | 101 | char alg_name[64]; |
101 | unsigned int alg_key_len; /* in bits */ | 102 | unsigned int alg_key_len; /* in bits */ |
@@ -109,16 +110,14 @@ struct xfrm_stats { | |||
109 | __u32 integrity_failed; | 110 | __u32 integrity_failed; |
110 | }; | 111 | }; |
111 | 112 | ||
112 | enum | 113 | enum { |
113 | { | ||
114 | XFRM_POLICY_TYPE_MAIN = 0, | 114 | XFRM_POLICY_TYPE_MAIN = 0, |
115 | XFRM_POLICY_TYPE_SUB = 1, | 115 | XFRM_POLICY_TYPE_SUB = 1, |
116 | XFRM_POLICY_TYPE_MAX = 2, | 116 | XFRM_POLICY_TYPE_MAX = 2, |
117 | XFRM_POLICY_TYPE_ANY = 255 | 117 | XFRM_POLICY_TYPE_ANY = 255 |
118 | }; | 118 | }; |
119 | 119 | ||
120 | enum | 120 | enum { |
121 | { | ||
122 | XFRM_POLICY_IN = 0, | 121 | XFRM_POLICY_IN = 0, |
123 | XFRM_POLICY_OUT = 1, | 122 | XFRM_POLICY_OUT = 1, |
124 | XFRM_POLICY_FWD = 2, | 123 | XFRM_POLICY_FWD = 2, |
@@ -126,8 +125,7 @@ enum | |||
126 | XFRM_POLICY_MAX = 3 | 125 | XFRM_POLICY_MAX = 3 |
127 | }; | 126 | }; |
128 | 127 | ||
129 | enum | 128 | enum { |
130 | { | ||
131 | XFRM_SHARE_ANY, /* No limitations */ | 129 | XFRM_SHARE_ANY, /* No limitations */ |
132 | XFRM_SHARE_SESSION, /* For this session only */ | 130 | XFRM_SHARE_SESSION, /* For this session only */ |
133 | XFRM_SHARE_USER, /* For this user only */ | 131 | XFRM_SHARE_USER, /* For this user only */ |
@@ -283,6 +281,7 @@ enum xfrm_attr_type_t { | |||
283 | XFRMA_MIGRATE, | 281 | XFRMA_MIGRATE, |
284 | XFRMA_ALG_AEAD, /* struct xfrm_algo_aead */ | 282 | XFRMA_ALG_AEAD, /* struct xfrm_algo_aead */ |
285 | XFRMA_KMADDRESS, /* struct xfrm_user_kmaddress */ | 283 | XFRMA_KMADDRESS, /* struct xfrm_user_kmaddress */ |
284 | XFRMA_ALG_AUTH_TRUNC, /* struct xfrm_algo_auth */ | ||
286 | __XFRMA_MAX | 285 | __XFRMA_MAX |
287 | 286 | ||
288 | #define XFRMA_MAX (__XFRMA_MAX - 1) | 287 | #define XFRMA_MAX (__XFRMA_MAX - 1) |
diff --git a/include/media/cx25840.h b/include/media/cx25840.h index 2c3fbaa33f74..0b0cb1776796 100644 --- a/include/media/cx25840.h +++ b/include/media/cx25840.h | |||
@@ -84,6 +84,7 @@ enum cx25840_video_input { | |||
84 | CX25840_NONE0_CH3 = 0x80000080, | 84 | CX25840_NONE0_CH3 = 0x80000080, |
85 | CX25840_NONE1_CH3 = 0x800000c0, | 85 | CX25840_NONE1_CH3 = 0x800000c0, |
86 | CX25840_SVIDEO_ON = 0x80000100, | 86 | CX25840_SVIDEO_ON = 0x80000100, |
87 | CX25840_COMPONENT_ON = 0x80000200, | ||
87 | }; | 88 | }; |
88 | 89 | ||
89 | enum cx25840_audio_input { | 90 | enum cx25840_audio_input { |
diff --git a/include/media/davinci/vpfe_capture.h b/include/media/davinci/vpfe_capture.h index 71d8982e13ff..d863e5e8426d 100644 --- a/include/media/davinci/vpfe_capture.h +++ b/include/media/davinci/vpfe_capture.h | |||
@@ -83,6 +83,8 @@ struct vpfe_subdev_info { | |||
83 | struct vpfe_config { | 83 | struct vpfe_config { |
84 | /* Number of sub devices connected to vpfe */ | 84 | /* Number of sub devices connected to vpfe */ |
85 | int num_subdevs; | 85 | int num_subdevs; |
86 | /* i2c bus adapter no */ | ||
87 | int i2c_adapter_id; | ||
86 | /* information about each subdev */ | 88 | /* information about each subdev */ |
87 | struct vpfe_subdev_info *sub_devs; | 89 | struct vpfe_subdev_info *sub_devs; |
88 | /* evm card info */ | 90 | /* evm card info */ |
diff --git a/include/media/ir-common.h b/include/media/ir-common.h index 29f0e53cff94..e41a99ee353e 100644 --- a/include/media/ir-common.h +++ b/include/media/ir-common.h | |||
@@ -26,14 +26,16 @@ | |||
26 | #include <linux/input.h> | 26 | #include <linux/input.h> |
27 | #include <linux/workqueue.h> | 27 | #include <linux/workqueue.h> |
28 | #include <linux/interrupt.h> | 28 | #include <linux/interrupt.h> |
29 | #include <linux/spinlock.h> | ||
30 | |||
31 | extern int media_ir_debug; /* media_ir_debug level (0,1,2) */ | ||
32 | #define IR_dprintk(level, fmt, arg...) if (media_ir_debug >= level) \ | ||
33 | printk(KERN_DEBUG "%s: " fmt , __func__, ## arg) | ||
29 | 34 | ||
30 | #define IR_TYPE_RC5 1 | 35 | #define IR_TYPE_RC5 1 |
31 | #define IR_TYPE_PD 2 /* Pulse distance encoded IR */ | 36 | #define IR_TYPE_PD 2 /* Pulse distance encoded IR */ |
32 | #define IR_TYPE_OTHER 99 | 37 | #define IR_TYPE_OTHER 99 |
33 | 38 | ||
34 | #define IR_KEYTAB_TYPE u32 | ||
35 | #define IR_KEYTAB_SIZE 128 /* enougth for rc5, probably need more some day */ | ||
36 | |||
37 | struct ir_scancode { | 39 | struct ir_scancode { |
38 | u16 scancode; | 40 | u16 scancode; |
39 | u32 keycode; | 41 | u32 keycode; |
@@ -42,11 +44,9 @@ struct ir_scancode { | |||
42 | struct ir_scancode_table { | 44 | struct ir_scancode_table { |
43 | struct ir_scancode *scan; | 45 | struct ir_scancode *scan; |
44 | int size; | 46 | int size; |
47 | spinlock_t lock; | ||
45 | }; | 48 | }; |
46 | 49 | ||
47 | #define IR_KEYCODE(tab,code) (((unsigned)code < IR_KEYTAB_SIZE) \ | ||
48 | ? tab[code] : KEY_RESERVED) | ||
49 | |||
50 | #define RC5_START(x) (((x)>>12)&3) | 50 | #define RC5_START(x) (((x)>>12)&3) |
51 | #define RC5_TOGGLE(x) (((x)>>11)&1) | 51 | #define RC5_TOGGLE(x) (((x)>>11)&1) |
52 | #define RC5_ADDR(x) (((x)>>6)&31) | 52 | #define RC5_ADDR(x) (((x)>>6)&31) |
@@ -55,11 +55,11 @@ struct ir_scancode_table { | |||
55 | struct ir_input_state { | 55 | struct ir_input_state { |
56 | /* configuration */ | 56 | /* configuration */ |
57 | int ir_type; | 57 | int ir_type; |
58 | IR_KEYTAB_TYPE ir_codes[IR_KEYTAB_SIZE]; | 58 | |
59 | struct ir_scancode_table keytable; | ||
59 | 60 | ||
60 | /* key info */ | 61 | /* key info */ |
61 | u32 ir_raw; /* raw data */ | 62 | u32 ir_key; /* ir scancode */ |
62 | u32 ir_key; /* ir key code */ | ||
63 | u32 keycode; /* linux key code */ | 63 | u32 keycode; /* linux key code */ |
64 | int keypressed; /* current state */ | 64 | int keypressed; /* current state */ |
65 | }; | 65 | }; |
@@ -102,20 +102,36 @@ struct card_ir { | |||
102 | struct tasklet_struct tlet; | 102 | struct tasklet_struct tlet; |
103 | }; | 103 | }; |
104 | 104 | ||
105 | void ir_input_init(struct input_dev *dev, struct ir_input_state *ir, | 105 | /* Routines from ir-functions.c */ |
106 | |||
107 | int ir_input_init(struct input_dev *dev, struct ir_input_state *ir, | ||
106 | int ir_type, struct ir_scancode_table *ir_codes); | 108 | int ir_type, struct ir_scancode_table *ir_codes); |
107 | void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); | 109 | void ir_input_nokey(struct input_dev *dev, struct ir_input_state *ir); |
108 | void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir, | 110 | void ir_input_keydown(struct input_dev *dev, struct ir_input_state *ir, |
109 | u32 ir_key, u32 ir_raw); | 111 | u32 ir_key); |
110 | u32 ir_extract_bits(u32 data, u32 mask); | 112 | u32 ir_extract_bits(u32 data, u32 mask); |
111 | int ir_dump_samples(u32 *samples, int count); | 113 | int ir_dump_samples(u32 *samples, int count); |
112 | int ir_decode_biphase(u32 *samples, int count, int low, int high); | 114 | int ir_decode_biphase(u32 *samples, int count, int low, int high); |
113 | int ir_decode_pulsedistance(u32 *samples, int count, int low, int high); | 115 | int ir_decode_pulsedistance(u32 *samples, int count, int low, int high); |
116 | u32 ir_rc5_decode(unsigned int code); | ||
114 | 117 | ||
115 | void ir_rc5_timer_end(unsigned long data); | 118 | void ir_rc5_timer_end(unsigned long data); |
116 | void ir_rc5_timer_keyup(unsigned long data); | 119 | void ir_rc5_timer_keyup(unsigned long data); |
117 | 120 | ||
118 | /* Keymaps to be used by other modules */ | 121 | /* Routines from ir-keytable.c */ |
122 | |||
123 | u32 ir_g_keycode_from_table(struct input_dev *input_dev, | ||
124 | u32 scancode); | ||
125 | |||
126 | int ir_set_keycode_table(struct input_dev *input_dev, | ||
127 | struct ir_scancode_table *rc_tab); | ||
128 | |||
129 | int ir_roundup_tablesize(int n_elems); | ||
130 | int ir_copy_table(struct ir_scancode_table *destin, | ||
131 | const struct ir_scancode_table *origin); | ||
132 | void ir_input_free(struct input_dev *input_dev); | ||
133 | |||
134 | /* scancode->keycode map tables from ir-keymaps.c */ | ||
119 | 135 | ||
120 | extern struct ir_scancode_table ir_codes_empty_table; | 136 | extern struct ir_scancode_table ir_codes_empty_table; |
121 | extern struct ir_scancode_table ir_codes_avermedia_table; | 137 | extern struct ir_scancode_table ir_codes_avermedia_table; |
@@ -150,6 +166,7 @@ extern struct ir_scancode_table ir_codes_rc5_tv_table; | |||
150 | extern struct ir_scancode_table ir_codes_winfast_table; | 166 | extern struct ir_scancode_table ir_codes_winfast_table; |
151 | extern struct ir_scancode_table ir_codes_pinnacle_color_table; | 167 | extern struct ir_scancode_table ir_codes_pinnacle_color_table; |
152 | extern struct ir_scancode_table ir_codes_hauppauge_new_table; | 168 | extern struct ir_scancode_table ir_codes_hauppauge_new_table; |
169 | extern struct ir_scancode_table ir_codes_rc5_hauppauge_new_table; | ||
153 | extern struct ir_scancode_table ir_codes_npgtech_table; | 170 | extern struct ir_scancode_table ir_codes_npgtech_table; |
154 | extern struct ir_scancode_table ir_codes_norwood_table; | 171 | extern struct ir_scancode_table ir_codes_norwood_table; |
155 | extern struct ir_scancode_table ir_codes_proteus_2309_table; | 172 | extern struct ir_scancode_table ir_codes_proteus_2309_table; |
@@ -172,6 +189,8 @@ extern struct ir_scancode_table ir_codes_ati_tv_wonder_hd_600_table; | |||
172 | extern struct ir_scancode_table ir_codes_kworld_plus_tv_analog_table; | 189 | extern struct ir_scancode_table ir_codes_kworld_plus_tv_analog_table; |
173 | extern struct ir_scancode_table ir_codes_kaiomy_table; | 190 | extern struct ir_scancode_table ir_codes_kaiomy_table; |
174 | extern struct ir_scancode_table ir_codes_dm1105_nec_table; | 191 | extern struct ir_scancode_table ir_codes_dm1105_nec_table; |
192 | extern struct ir_scancode_table ir_codes_tevii_nec_table; | ||
193 | extern struct ir_scancode_table ir_codes_tbs_nec_table; | ||
175 | extern struct ir_scancode_table ir_codes_evga_indtube_table; | 194 | extern struct ir_scancode_table ir_codes_evga_indtube_table; |
176 | extern struct ir_scancode_table ir_codes_terratec_cinergy_xs_table; | 195 | extern struct ir_scancode_table ir_codes_terratec_cinergy_xs_table; |
177 | extern struct ir_scancode_table ir_codes_videomate_s350_table; | 196 | extern struct ir_scancode_table ir_codes_videomate_s350_table; |
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h index cf16689adba7..91942dbe64e3 100644 --- a/include/media/v4l2-chip-ident.h +++ b/include/media/v4l2-chip-ident.h | |||
@@ -64,6 +64,7 @@ enum { | |||
64 | V4L2_IDENT_OV9650 = 254, | 64 | V4L2_IDENT_OV9650 = 254, |
65 | V4L2_IDENT_OV9655 = 255, | 65 | V4L2_IDENT_OV9655 = 255, |
66 | V4L2_IDENT_SOI968 = 256, | 66 | V4L2_IDENT_SOI968 = 256, |
67 | V4L2_IDENT_OV9640 = 257, | ||
67 | 68 | ||
68 | /* module saa7146: reserved range 300-309 */ | 69 | /* module saa7146: reserved range 300-309 */ |
69 | V4L2_IDENT_SAA7146 = 300, | 70 | V4L2_IDENT_SAA7146 = 300, |
@@ -72,6 +73,7 @@ enum { | |||
72 | V4L2_IDENT_CX23418_843 = 403, /* Integrated A/V Decoder on the '418 */ | 73 | V4L2_IDENT_CX23418_843 = 403, /* Integrated A/V Decoder on the '418 */ |
73 | V4L2_IDENT_CX23415 = 415, | 74 | V4L2_IDENT_CX23415 = 415, |
74 | V4L2_IDENT_CX23416 = 416, | 75 | V4L2_IDENT_CX23416 = 416, |
76 | V4L2_IDENT_CX23417 = 417, | ||
75 | V4L2_IDENT_CX23418 = 418, | 77 | V4L2_IDENT_CX23418 = 418, |
76 | 78 | ||
77 | /* module au0828 */ | 79 | /* module au0828 */ |
@@ -129,6 +131,9 @@ enum { | |||
129 | V4L2_IDENT_SAA6752HS = 6752, | 131 | V4L2_IDENT_SAA6752HS = 6752, |
130 | V4L2_IDENT_SAA6752HS_AC3 = 6753, | 132 | V4L2_IDENT_SAA6752HS_AC3 = 6753, |
131 | 133 | ||
134 | /* modules tef6862: just ident 6862 */ | ||
135 | V4L2_IDENT_TEF6862 = 6862, | ||
136 | |||
132 | /* module adv7170: just ident 7170 */ | 137 | /* module adv7170: just ident 7170 */ |
133 | V4L2_IDENT_ADV7170 = 7170, | 138 | V4L2_IDENT_ADV7170 = 7170, |
134 | 139 | ||
@@ -165,12 +170,27 @@ enum { | |||
165 | /* module mt9v011, just ident 8243 */ | 170 | /* module mt9v011, just ident 8243 */ |
166 | V4L2_IDENT_MT9V011 = 8243, | 171 | V4L2_IDENT_MT9V011 = 8243, |
167 | 172 | ||
173 | /* module cx23885 and cx25840 */ | ||
174 | V4L2_IDENT_CX23885 = 8850, | ||
175 | V4L2_IDENT_CX23885_AV = 8851, /* Integrated A/V decoder */ | ||
176 | V4L2_IDENT_CX23887 = 8870, | ||
177 | V4L2_IDENT_CX23887_AV = 8871, /* Integrated A/V decoder */ | ||
178 | V4L2_IDENT_CX23888 = 8880, | ||
179 | V4L2_IDENT_CX23888_AV = 8881, /* Integrated A/V decoder */ | ||
180 | V4L2_IDENT_CX23888_IR = 8882, /* Integrated infrared controller */ | ||
181 | |||
168 | /* module tw9910: just ident 9910 */ | 182 | /* module tw9910: just ident 9910 */ |
169 | V4L2_IDENT_TW9910 = 9910, | 183 | V4L2_IDENT_TW9910 = 9910, |
170 | 184 | ||
171 | /* module sn9c20x: just ident 10000 */ | 185 | /* module sn9c20x: just ident 10000 */ |
172 | V4L2_IDENT_SN9C20X = 10000, | 186 | V4L2_IDENT_SN9C20X = 10000, |
173 | 187 | ||
188 | /* module cx231xx and cx25840 */ | ||
189 | V4L2_IDENT_CX2310X_AV = 23099, /* Integrated A/V decoder; not in '100 */ | ||
190 | V4L2_IDENT_CX23100 = 23100, | ||
191 | V4L2_IDENT_CX23101 = 23101, | ||
192 | V4L2_IDENT_CX23102 = 23102, | ||
193 | |||
174 | /* module msp3400: reserved range 34000-34999 and 44000-44999 */ | 194 | /* module msp3400: reserved range 34000-34999 and 44000-44999 */ |
175 | V4L2_IDENT_MSPX4XX = 34000, /* generic MSPX4XX identifier, only | 195 | V4L2_IDENT_MSPX4XX = 34000, /* generic MSPX4XX identifier, only |
176 | use internally (tveeprom.c). */ | 196 | use internally (tveeprom.c). */ |
@@ -264,6 +284,9 @@ enum { | |||
264 | 284 | ||
265 | /* module m52790: just ident 52790 */ | 285 | /* module m52790: just ident 52790 */ |
266 | V4L2_IDENT_M52790 = 52790, | 286 | V4L2_IDENT_M52790 = 52790, |
287 | |||
288 | /* Sharp RJ54N1CB0C, 0xCB0C = 51980 */ | ||
289 | V4L2_IDENT_RJ54N1CB0C = 51980, | ||
267 | }; | 290 | }; |
268 | 291 | ||
269 | #endif | 292 | #endif |
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h index d411345f244b..00bf17608453 100644 --- a/include/media/v4l2-subdev.h +++ b/include/media/v4l2-subdev.h | |||
@@ -23,6 +23,16 @@ | |||
23 | 23 | ||
24 | #include <media/v4l2-common.h> | 24 | #include <media/v4l2-common.h> |
25 | 25 | ||
26 | /* generic v4l2_device notify callback notification values */ | ||
27 | #define V4L2_SUBDEV_IR_RX_NOTIFY _IOW('v', 0, u32) | ||
28 | #define V4L2_SUBDEV_IR_RX_FIFO_SERVICE_REQ 0x00000001 | ||
29 | #define V4L2_SUBDEV_IR_RX_END_OF_RX_DETECTED 0x00000002 | ||
30 | #define V4L2_SUBDEV_IR_RX_HW_FIFO_OVERRUN 0x00000004 | ||
31 | #define V4L2_SUBDEV_IR_RX_SW_FIFO_OVERRUN 0x00000008 | ||
32 | |||
33 | #define V4L2_SUBDEV_IR_TX_NOTIFY _IOW('v', 1, u32) | ||
34 | #define V4L2_SUBDEV_IR_TX_FIFO_SERVICE_REQ 0x00000001 | ||
35 | |||
26 | struct v4l2_device; | 36 | struct v4l2_device; |
27 | struct v4l2_subdev; | 37 | struct v4l2_subdev; |
28 | struct tuner_setup; | 38 | struct tuner_setup; |
@@ -96,6 +106,9 @@ struct v4l2_decode_vbi_line { | |||
96 | 106 | ||
97 | s_gpio: set GPIO pins. Very simple right now, might need to be extended with | 107 | s_gpio: set GPIO pins. Very simple right now, might need to be extended with |
98 | a direction argument if needed. | 108 | a direction argument if needed. |
109 | |||
110 | s_power: puts subdevice in power saving mode (on == 0) or normal operation | ||
111 | mode (on == 1). | ||
99 | */ | 112 | */ |
100 | struct v4l2_subdev_core_ops { | 113 | struct v4l2_subdev_core_ops { |
101 | int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); | 114 | int (*g_chip_ident)(struct v4l2_subdev *sd, struct v4l2_dbg_chip_ident *chip); |
@@ -118,6 +131,7 @@ struct v4l2_subdev_core_ops { | |||
118 | int (*g_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg); | 131 | int (*g_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg); |
119 | int (*s_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg); | 132 | int (*s_register)(struct v4l2_subdev *sd, struct v4l2_dbg_register *reg); |
120 | #endif | 133 | #endif |
134 | int (*s_power)(struct v4l2_subdev *sd, int on); | ||
121 | }; | 135 | }; |
122 | 136 | ||
123 | /* s_mode: switch the tuner to a specific tuner mode. Replacement of s_radio. | 137 | /* s_mode: switch the tuner to a specific tuner mode. Replacement of s_radio. |
@@ -127,8 +141,6 @@ struct v4l2_subdev_core_ops { | |||
127 | s_type_addr: sets tuner type and its I2C addr. | 141 | s_type_addr: sets tuner type and its I2C addr. |
128 | 142 | ||
129 | s_config: sets tda9887 specific stuff, like port1, port2 and qss | 143 | s_config: sets tda9887 specific stuff, like port1, port2 and qss |
130 | |||
131 | s_standby: puts tuner on powersaving state, disabling it, except for i2c. | ||
132 | */ | 144 | */ |
133 | struct v4l2_subdev_tuner_ops { | 145 | struct v4l2_subdev_tuner_ops { |
134 | int (*s_mode)(struct v4l2_subdev *sd, enum v4l2_tuner_type); | 146 | int (*s_mode)(struct v4l2_subdev *sd, enum v4l2_tuner_type); |
@@ -141,7 +153,6 @@ struct v4l2_subdev_tuner_ops { | |||
141 | int (*s_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm); | 153 | int (*s_modulator)(struct v4l2_subdev *sd, struct v4l2_modulator *vm); |
142 | int (*s_type_addr)(struct v4l2_subdev *sd, struct tuner_setup *type); | 154 | int (*s_type_addr)(struct v4l2_subdev *sd, struct tuner_setup *type); |
143 | int (*s_config)(struct v4l2_subdev *sd, const struct v4l2_priv_tun_config *config); | 155 | int (*s_config)(struct v4l2_subdev *sd, const struct v4l2_priv_tun_config *config); |
144 | int (*s_standby)(struct v4l2_subdev *sd); | ||
145 | }; | 156 | }; |
146 | 157 | ||
147 | /* s_clock_freq: set the frequency (in Hz) of the audio clock output. | 158 | /* s_clock_freq: set the frequency (in Hz) of the audio clock output. |
@@ -231,11 +242,95 @@ struct v4l2_subdev_video_ops { | |||
231 | int (*enum_frameintervals)(struct v4l2_subdev *sd, struct v4l2_frmivalenum *fival); | 242 | int (*enum_frameintervals)(struct v4l2_subdev *sd, struct v4l2_frmivalenum *fival); |
232 | }; | 243 | }; |
233 | 244 | ||
245 | /* | ||
246 | interrupt_service_routine: Called by the bridge chip's interrupt service | ||
247 | handler, when an IR interrupt status has be raised due to this subdev, | ||
248 | so that this subdev can handle the details. It may schedule work to be | ||
249 | performed later. It must not sleep. *Called from an IRQ context*. | ||
250 | |||
251 | [rt]x_g_parameters: Get the current operating parameters and state of the | ||
252 | the IR receiver or transmitter. | ||
253 | |||
254 | [rt]x_s_parameters: Set the current operating parameters and state of the | ||
255 | the IR receiver or transmitter. It is recommended to call | ||
256 | [rt]x_g_parameters first to fill out the current state, and only change | ||
257 | the fields that need to be changed. Upon return, the actual device | ||
258 | operating parameters and state will be returned. Note that hardware | ||
259 | limitations may prevent the actual settings from matching the requested | ||
260 | settings - e.g. an actual carrier setting of 35,904 Hz when 36,000 Hz | ||
261 | was requested. An exception is when the shutdown parameter is true. | ||
262 | The last used operational parameters will be returned, but the actual | ||
263 | state of the hardware be different to minimize power consumption and | ||
264 | processing when shutdown is true. | ||
265 | |||
266 | rx_read: Reads received codes or pulse width data. | ||
267 | The semantics are similar to a non-blocking read() call. | ||
268 | |||
269 | tx_write: Writes codes or pulse width data for transmission. | ||
270 | The semantics are similar to a non-blocking write() call. | ||
271 | */ | ||
272 | |||
273 | enum v4l2_subdev_ir_mode { | ||
274 | V4L2_SUBDEV_IR_MODE_PULSE_WIDTH, /* space & mark widths in nanosecs */ | ||
275 | }; | ||
276 | |||
277 | /* Data format of data read or written for V4L2_SUBDEV_IR_MODE_PULSE_WIDTH */ | ||
278 | #define V4L2_SUBDEV_IR_PULSE_MAX_WIDTH_NS 0x7fffffff | ||
279 | #define V4L2_SUBDEV_IR_PULSE_LEVEL_MASK 0x80000000 | ||
280 | #define V4L2_SUBDEV_IR_PULSE_RX_SEQ_END 0xffffffff | ||
281 | |||
282 | struct v4l2_subdev_ir_parameters { | ||
283 | /* Either Rx or Tx */ | ||
284 | unsigned int bytes_per_data_element; /* of data in read or write call */ | ||
285 | enum v4l2_subdev_ir_mode mode; | ||
286 | |||
287 | bool enable; | ||
288 | bool interrupt_enable; | ||
289 | bool shutdown; /* true: set hardware to low/no power, false: normal */ | ||
290 | |||
291 | bool modulation; /* true: uses carrier, false: baseband */ | ||
292 | u32 max_pulse_width; /* ns, valid only for baseband signal */ | ||
293 | unsigned int carrier_freq; /* Hz, valid only for modulated signal*/ | ||
294 | unsigned int duty_cycle; /* percent, valid only for modulated signal*/ | ||
295 | bool invert; /* logically invert sense of mark/space */ | ||
296 | |||
297 | /* Rx only */ | ||
298 | u32 noise_filter_min_width; /* ns, min time of a valid pulse */ | ||
299 | unsigned int carrier_range_lower; /* Hz, valid only for modulated sig */ | ||
300 | unsigned int carrier_range_upper; /* Hz, valid only for modulated sig */ | ||
301 | u32 resolution; /* ns */ | ||
302 | }; | ||
303 | |||
304 | struct v4l2_subdev_ir_ops { | ||
305 | /* Common to receiver and transmitter */ | ||
306 | int (*interrupt_service_routine)(struct v4l2_subdev *sd, | ||
307 | u32 status, bool *handled); | ||
308 | |||
309 | /* Receiver */ | ||
310 | int (*rx_read)(struct v4l2_subdev *sd, u8 *buf, size_t count, | ||
311 | ssize_t *num); | ||
312 | |||
313 | int (*rx_g_parameters)(struct v4l2_subdev *sd, | ||
314 | struct v4l2_subdev_ir_parameters *params); | ||
315 | int (*rx_s_parameters)(struct v4l2_subdev *sd, | ||
316 | struct v4l2_subdev_ir_parameters *params); | ||
317 | |||
318 | /* Transmitter */ | ||
319 | int (*tx_write)(struct v4l2_subdev *sd, u8 *buf, size_t count, | ||
320 | ssize_t *num); | ||
321 | |||
322 | int (*tx_g_parameters)(struct v4l2_subdev *sd, | ||
323 | struct v4l2_subdev_ir_parameters *params); | ||
324 | int (*tx_s_parameters)(struct v4l2_subdev *sd, | ||
325 | struct v4l2_subdev_ir_parameters *params); | ||
326 | }; | ||
327 | |||
234 | struct v4l2_subdev_ops { | 328 | struct v4l2_subdev_ops { |
235 | const struct v4l2_subdev_core_ops *core; | 329 | const struct v4l2_subdev_core_ops *core; |
236 | const struct v4l2_subdev_tuner_ops *tuner; | 330 | const struct v4l2_subdev_tuner_ops *tuner; |
237 | const struct v4l2_subdev_audio_ops *audio; | 331 | const struct v4l2_subdev_audio_ops *audio; |
238 | const struct v4l2_subdev_video_ops *video; | 332 | const struct v4l2_subdev_video_ops *video; |
333 | const struct v4l2_subdev_ir_ops *ir; | ||
239 | }; | 334 | }; |
240 | 335 | ||
241 | #define V4L2_SUBDEV_NAME_SIZE 32 | 336 | #define V4L2_SUBDEV_NAME_SIZE 32 |
@@ -290,7 +385,7 @@ static inline void v4l2_subdev_init(struct v4l2_subdev *sd, | |||
290 | Example: err = v4l2_subdev_call(sd, core, g_chip_ident, &chip); | 385 | Example: err = v4l2_subdev_call(sd, core, g_chip_ident, &chip); |
291 | */ | 386 | */ |
292 | #define v4l2_subdev_call(sd, o, f, args...) \ | 387 | #define v4l2_subdev_call(sd, o, f, args...) \ |
293 | (!(sd) ? -ENODEV : (((sd) && (sd)->ops->o && (sd)->ops->o->f) ? \ | 388 | (!(sd) ? -ENODEV : (((sd)->ops->o && (sd)->ops->o->f) ? \ |
294 | (sd)->ops->o->f((sd) , ##args) : -ENOIOCTLCMD)) | 389 | (sd)->ops->o->f((sd) , ##args) : -ENOIOCTLCMD)) |
295 | 390 | ||
296 | /* Send a notification to v4l2_device. */ | 391 | /* Send a notification to v4l2_device. */ |
diff --git a/include/media/videobuf-core.h b/include/media/videobuf-core.h index 1c5946c44758..316fdccdcaa0 100644 --- a/include/media/videobuf-core.h +++ b/include/media/videobuf-core.h | |||
@@ -166,7 +166,7 @@ struct videobuf_queue { | |||
166 | enum v4l2_field field; | 166 | enum v4l2_field field; |
167 | enum v4l2_field last; /* for field=V4L2_FIELD_ALTERNATE */ | 167 | enum v4l2_field last; /* for field=V4L2_FIELD_ALTERNATE */ |
168 | struct videobuf_buffer *bufs[VIDEO_MAX_FRAME]; | 168 | struct videobuf_buffer *bufs[VIDEO_MAX_FRAME]; |
169 | struct videobuf_queue_ops *ops; | 169 | const struct videobuf_queue_ops *ops; |
170 | struct videobuf_qtype_ops *int_ops; | 170 | struct videobuf_qtype_ops *int_ops; |
171 | 171 | ||
172 | unsigned int streaming:1; | 172 | unsigned int streaming:1; |
@@ -195,7 +195,7 @@ void *videobuf_queue_to_vmalloc (struct videobuf_queue* q, | |||
195 | struct videobuf_buffer *buf); | 195 | struct videobuf_buffer *buf); |
196 | 196 | ||
197 | void videobuf_queue_core_init(struct videobuf_queue *q, | 197 | void videobuf_queue_core_init(struct videobuf_queue *q, |
198 | struct videobuf_queue_ops *ops, | 198 | const struct videobuf_queue_ops *ops, |
199 | struct device *dev, | 199 | struct device *dev, |
200 | spinlock_t *irqlock, | 200 | spinlock_t *irqlock, |
201 | enum v4l2_buf_type type, | 201 | enum v4l2_buf_type type, |
diff --git a/include/media/videobuf-dma-contig.h b/include/media/videobuf-dma-contig.h index 549386681aab..ebaa9bc1ee8d 100644 --- a/include/media/videobuf-dma-contig.h +++ b/include/media/videobuf-dma-contig.h | |||
@@ -17,7 +17,7 @@ | |||
17 | #include <media/videobuf-core.h> | 17 | #include <media/videobuf-core.h> |
18 | 18 | ||
19 | void videobuf_queue_dma_contig_init(struct videobuf_queue *q, | 19 | void videobuf_queue_dma_contig_init(struct videobuf_queue *q, |
20 | struct videobuf_queue_ops *ops, | 20 | const struct videobuf_queue_ops *ops, |
21 | struct device *dev, | 21 | struct device *dev, |
22 | spinlock_t *irqlock, | 22 | spinlock_t *irqlock, |
23 | enum v4l2_buf_type type, | 23 | enum v4l2_buf_type type, |
diff --git a/include/media/videobuf-dma-sg.h b/include/media/videobuf-dma-sg.h index dda47f0082e9..53e72f787175 100644 --- a/include/media/videobuf-dma-sg.h +++ b/include/media/videobuf-dma-sg.h | |||
@@ -103,7 +103,7 @@ struct videobuf_dmabuf *videobuf_to_dma (struct videobuf_buffer *buf); | |||
103 | void *videobuf_sg_alloc(size_t size); | 103 | void *videobuf_sg_alloc(size_t size); |
104 | 104 | ||
105 | void videobuf_queue_sg_init(struct videobuf_queue* q, | 105 | void videobuf_queue_sg_init(struct videobuf_queue* q, |
106 | struct videobuf_queue_ops *ops, | 106 | const struct videobuf_queue_ops *ops, |
107 | struct device *dev, | 107 | struct device *dev, |
108 | spinlock_t *irqlock, | 108 | spinlock_t *irqlock, |
109 | enum v4l2_buf_type type, | 109 | enum v4l2_buf_type type, |
diff --git a/include/media/videobuf-dvb.h b/include/media/videobuf-dvb.h index 6ba4f1271d23..07cf4b9d0a65 100644 --- a/include/media/videobuf-dvb.h +++ b/include/media/videobuf-dvb.h | |||
@@ -42,7 +42,9 @@ int videobuf_dvb_register_bus(struct videobuf_dvb_frontends *f, | |||
42 | void *adapter_priv, | 42 | void *adapter_priv, |
43 | struct device *device, | 43 | struct device *device, |
44 | short *adapter_nr, | 44 | short *adapter_nr, |
45 | int mfe_shared); | 45 | int mfe_shared, |
46 | int (*fe_ioctl_override)(struct dvb_frontend *, | ||
47 | unsigned int, void *, unsigned int)); | ||
46 | 48 | ||
47 | void videobuf_dvb_unregister_bus(struct videobuf_dvb_frontends *f); | 49 | void videobuf_dvb_unregister_bus(struct videobuf_dvb_frontends *f); |
48 | 50 | ||
diff --git a/include/media/videobuf-vmalloc.h b/include/media/videobuf-vmalloc.h index e87222c6a125..4b419a257a7d 100644 --- a/include/media/videobuf-vmalloc.h +++ b/include/media/videobuf-vmalloc.h | |||
@@ -30,8 +30,8 @@ struct videobuf_vmalloc_memory | |||
30 | }; | 30 | }; |
31 | 31 | ||
32 | void videobuf_queue_vmalloc_init(struct videobuf_queue* q, | 32 | void videobuf_queue_vmalloc_init(struct videobuf_queue* q, |
33 | struct videobuf_queue_ops *ops, | 33 | const struct videobuf_queue_ops *ops, |
34 | void *dev, | 34 | struct device *dev, |
35 | spinlock_t *irqlock, | 35 | spinlock_t *irqlock, |
36 | enum v4l2_buf_type type, | 36 | enum v4l2_buf_type type, |
37 | enum v4l2_field field, | 37 | enum v4l2_field field, |
diff --git a/include/net/ah.h b/include/net/ah.h index ae1c322f4242..f0129f79a31a 100644 --- a/include/net/ah.h +++ b/include/net/ah.h | |||
@@ -1,43 +1,20 @@ | |||
1 | #ifndef _NET_AH_H | 1 | #ifndef _NET_AH_H |
2 | #define _NET_AH_H | 2 | #define _NET_AH_H |
3 | 3 | ||
4 | #include <linux/crypto.h> | 4 | #include <linux/skbuff.h> |
5 | #include <net/xfrm.h> | ||
6 | 5 | ||
7 | /* This is the maximum truncated ICV length that we know of. */ | 6 | /* This is the maximum truncated ICV length that we know of. */ |
8 | #define MAX_AH_AUTH_LEN 12 | 7 | #define MAX_AH_AUTH_LEN 12 |
9 | 8 | ||
10 | struct ah_data | 9 | struct crypto_ahash; |
11 | { | 10 | |
12 | u8 *work_icv; | 11 | struct ah_data { |
13 | int icv_full_len; | 12 | int icv_full_len; |
14 | int icv_trunc_len; | 13 | int icv_trunc_len; |
15 | 14 | ||
16 | struct crypto_hash *tfm; | 15 | struct crypto_ahash *ahash; |
17 | }; | 16 | }; |
18 | 17 | ||
19 | static inline int ah_mac_digest(struct ah_data *ahp, struct sk_buff *skb, | ||
20 | u8 *auth_data) | ||
21 | { | ||
22 | struct hash_desc desc; | ||
23 | int err; | ||
24 | |||
25 | desc.tfm = ahp->tfm; | ||
26 | desc.flags = 0; | ||
27 | |||
28 | memset(auth_data, 0, ahp->icv_trunc_len); | ||
29 | err = crypto_hash_init(&desc); | ||
30 | if (unlikely(err)) | ||
31 | goto out; | ||
32 | err = skb_icv_walk(skb, &desc, 0, skb->len, crypto_hash_update); | ||
33 | if (unlikely(err)) | ||
34 | goto out; | ||
35 | err = crypto_hash_final(&desc, ahp->work_icv); | ||
36 | |||
37 | out: | ||
38 | return err; | ||
39 | } | ||
40 | |||
41 | struct ip_auth_hdr; | 18 | struct ip_auth_hdr; |
42 | 19 | ||
43 | static inline struct ip_auth_hdr *ip_auth_hdr(const struct sk_buff *skb) | 20 | static inline struct ip_auth_hdr *ip_auth_hdr(const struct sk_buff *skb) |
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h index 718394e2c01e..04a6908e38d2 100644 --- a/include/net/bluetooth/bluetooth.h +++ b/include/net/bluetooth/bluetooth.h | |||
@@ -121,7 +121,7 @@ struct bt_sock_list { | |||
121 | rwlock_t lock; | 121 | rwlock_t lock; |
122 | }; | 122 | }; |
123 | 123 | ||
124 | int bt_sock_register(int proto, struct net_proto_family *ops); | 124 | int bt_sock_register(int proto, const struct net_proto_family *ops); |
125 | int bt_sock_unregister(int proto); | 125 | int bt_sock_unregister(int proto); |
126 | void bt_sock_link(struct bt_sock_list *l, struct sock *s); | 126 | void bt_sock_link(struct bt_sock_list *l, struct sock *s); |
127 | void bt_sock_unlink(struct bt_sock_list *l, struct sock *s); | 127 | void bt_sock_unlink(struct bt_sock_list *l, struct sock *s); |
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h index 7b640aeddb64..7b86094a894b 100644 --- a/include/net/bluetooth/hci_core.h +++ b/include/net/bluetooth/hci_core.h | |||
@@ -367,22 +367,6 @@ static inline void hci_conn_put(struct hci_conn *conn) | |||
367 | } | 367 | } |
368 | } | 368 | } |
369 | 369 | ||
370 | /* ----- HCI tasks ----- */ | ||
371 | static inline void hci_sched_cmd(struct hci_dev *hdev) | ||
372 | { | ||
373 | tasklet_schedule(&hdev->cmd_task); | ||
374 | } | ||
375 | |||
376 | static inline void hci_sched_rx(struct hci_dev *hdev) | ||
377 | { | ||
378 | tasklet_schedule(&hdev->rx_task); | ||
379 | } | ||
380 | |||
381 | static inline void hci_sched_tx(struct hci_dev *hdev) | ||
382 | { | ||
383 | tasklet_schedule(&hdev->tx_task); | ||
384 | } | ||
385 | |||
386 | /* ----- HCI Devices ----- */ | 370 | /* ----- HCI Devices ----- */ |
387 | static inline void __hci_dev_put(struct hci_dev *d) | 371 | static inline void __hci_dev_put(struct hci_dev *d) |
388 | { | 372 | { |
@@ -437,28 +421,7 @@ int hci_inquiry(void __user *arg); | |||
437 | 421 | ||
438 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); | 422 | void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); |
439 | 423 | ||
440 | /* Receive frame from HCI drivers */ | 424 | int hci_recv_frame(struct sk_buff *skb); |
441 | static inline int hci_recv_frame(struct sk_buff *skb) | ||
442 | { | ||
443 | struct hci_dev *hdev = (struct hci_dev *) skb->dev; | ||
444 | if (!hdev || (!test_bit(HCI_UP, &hdev->flags) | ||
445 | && !test_bit(HCI_INIT, &hdev->flags))) { | ||
446 | kfree_skb(skb); | ||
447 | return -ENXIO; | ||
448 | } | ||
449 | |||
450 | /* Incomming skb */ | ||
451 | bt_cb(skb)->incoming = 1; | ||
452 | |||
453 | /* Time stamp */ | ||
454 | __net_timestamp(skb); | ||
455 | |||
456 | /* Queue frame for rx task */ | ||
457 | skb_queue_tail(&hdev->rx_q, skb); | ||
458 | hci_sched_rx(hdev); | ||
459 | return 0; | ||
460 | } | ||
461 | |||
462 | int hci_recv_fragment(struct hci_dev *hdev, int type, void *data, int count); | 425 | int hci_recv_fragment(struct hci_dev *hdev, int type, void *data, int count); |
463 | 426 | ||
464 | int hci_register_sysfs(struct hci_dev *hdev); | 427 | int hci_register_sysfs(struct hci_dev *hdev); |
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h index 9516f4b4a3c2..17a689f27a6a 100644 --- a/include/net/bluetooth/l2cap.h +++ b/include/net/bluetooth/l2cap.h | |||
@@ -324,7 +324,6 @@ struct l2cap_pinfo { | |||
324 | 324 | ||
325 | __u8 next_tx_seq; | 325 | __u8 next_tx_seq; |
326 | __u8 expected_ack_seq; | 326 | __u8 expected_ack_seq; |
327 | __u8 req_seq; | ||
328 | __u8 expected_tx_seq; | 327 | __u8 expected_tx_seq; |
329 | __u8 buffer_seq; | 328 | __u8 buffer_seq; |
330 | __u8 buffer_seq_srej; | 329 | __u8 buffer_seq_srej; |
@@ -375,6 +374,7 @@ struct l2cap_pinfo { | |||
375 | #define L2CAP_CONN_SEND_PBIT 0x10 | 374 | #define L2CAP_CONN_SEND_PBIT 0x10 |
376 | #define L2CAP_CONN_REMOTE_BUSY 0x20 | 375 | #define L2CAP_CONN_REMOTE_BUSY 0x20 |
377 | #define L2CAP_CONN_LOCAL_BUSY 0x40 | 376 | #define L2CAP_CONN_LOCAL_BUSY 0x40 |
377 | #define L2CAP_CONN_REJ_ACT 0x80 | ||
378 | 378 | ||
379 | #define __mod_retrans_timer() mod_timer(&l2cap_pi(sk)->retrans_timer, \ | 379 | #define __mod_retrans_timer() mod_timer(&l2cap_pi(sk)->retrans_timer, \ |
380 | jiffies + msecs_to_jiffies(L2CAP_DEFAULT_RETRANS_TO)); | 380 | jiffies + msecs_to_jiffies(L2CAP_DEFAULT_RETRANS_TO)); |
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h index 3d874c620219..0884b9a0f778 100644 --- a/include/net/cfg80211.h +++ b/include/net/cfg80211.h | |||
@@ -206,10 +206,12 @@ struct ieee80211_supported_band { | |||
206 | * struct vif_params - describes virtual interface parameters | 206 | * struct vif_params - describes virtual interface parameters |
207 | * @mesh_id: mesh ID to use | 207 | * @mesh_id: mesh ID to use |
208 | * @mesh_id_len: length of the mesh ID | 208 | * @mesh_id_len: length of the mesh ID |
209 | * @use_4addr: use 4-address frames | ||
209 | */ | 210 | */ |
210 | struct vif_params { | 211 | struct vif_params { |
211 | u8 *mesh_id; | 212 | u8 *mesh_id; |
212 | int mesh_id_len; | 213 | int mesh_id_len; |
214 | int use_4addr; | ||
213 | }; | 215 | }; |
214 | 216 | ||
215 | /** | 217 | /** |
@@ -233,6 +235,35 @@ struct key_params { | |||
233 | }; | 235 | }; |
234 | 236 | ||
235 | /** | 237 | /** |
238 | * enum survey_info_flags - survey information flags | ||
239 | * | ||
240 | * Used by the driver to indicate which info in &struct survey_info | ||
241 | * it has filled in during the get_survey(). | ||
242 | */ | ||
243 | enum survey_info_flags { | ||
244 | SURVEY_INFO_NOISE_DBM = 1<<0, | ||
245 | }; | ||
246 | |||
247 | /** | ||
248 | * struct survey_info - channel survey response | ||
249 | * | ||
250 | * Used by dump_survey() to report back per-channel survey information. | ||
251 | * | ||
252 | * @channel: the channel this survey record reports, mandatory | ||
253 | * @filled: bitflag of flags from &enum survey_info_flags | ||
254 | * @noise: channel noise in dBm. This and all following fields are | ||
255 | * optional | ||
256 | * | ||
257 | * This structure can later be expanded with things like | ||
258 | * channel duty cycle etc. | ||
259 | */ | ||
260 | struct survey_info { | ||
261 | struct ieee80211_channel *channel; | ||
262 | u32 filled; | ||
263 | s8 noise; | ||
264 | }; | ||
265 | |||
266 | /** | ||
236 | * struct beacon_parameters - beacon parameters | 267 | * struct beacon_parameters - beacon parameters |
237 | * | 268 | * |
238 | * Used to configure the beacon for an interface. | 269 | * Used to configure the beacon for an interface. |
@@ -418,7 +449,7 @@ enum monitor_flags { | |||
418 | * in during get_station() or dump_station(). | 449 | * in during get_station() or dump_station(). |
419 | * | 450 | * |
420 | * MPATH_INFO_FRAME_QLEN: @frame_qlen filled | 451 | * MPATH_INFO_FRAME_QLEN: @frame_qlen filled |
421 | * MPATH_INFO_DSN: @dsn filled | 452 | * MPATH_INFO_SN: @sn filled |
422 | * MPATH_INFO_METRIC: @metric filled | 453 | * MPATH_INFO_METRIC: @metric filled |
423 | * MPATH_INFO_EXPTIME: @exptime filled | 454 | * MPATH_INFO_EXPTIME: @exptime filled |
424 | * MPATH_INFO_DISCOVERY_TIMEOUT: @discovery_timeout filled | 455 | * MPATH_INFO_DISCOVERY_TIMEOUT: @discovery_timeout filled |
@@ -427,7 +458,7 @@ enum monitor_flags { | |||
427 | */ | 458 | */ |
428 | enum mpath_info_flags { | 459 | enum mpath_info_flags { |
429 | MPATH_INFO_FRAME_QLEN = BIT(0), | 460 | MPATH_INFO_FRAME_QLEN = BIT(0), |
430 | MPATH_INFO_DSN = BIT(1), | 461 | MPATH_INFO_SN = BIT(1), |
431 | MPATH_INFO_METRIC = BIT(2), | 462 | MPATH_INFO_METRIC = BIT(2), |
432 | MPATH_INFO_EXPTIME = BIT(3), | 463 | MPATH_INFO_EXPTIME = BIT(3), |
433 | MPATH_INFO_DISCOVERY_TIMEOUT = BIT(4), | 464 | MPATH_INFO_DISCOVERY_TIMEOUT = BIT(4), |
@@ -442,7 +473,7 @@ enum mpath_info_flags { | |||
442 | * | 473 | * |
443 | * @filled: bitfield of flags from &enum mpath_info_flags | 474 | * @filled: bitfield of flags from &enum mpath_info_flags |
444 | * @frame_qlen: number of queued frames for this destination | 475 | * @frame_qlen: number of queued frames for this destination |
445 | * @dsn: destination sequence number | 476 | * @sn: target sequence number |
446 | * @metric: metric (cost) of this mesh path | 477 | * @metric: metric (cost) of this mesh path |
447 | * @exptime: expiration time for the mesh path from now, in msecs | 478 | * @exptime: expiration time for the mesh path from now, in msecs |
448 | * @flags: mesh path flags | 479 | * @flags: mesh path flags |
@@ -456,7 +487,7 @@ enum mpath_info_flags { | |||
456 | struct mpath_info { | 487 | struct mpath_info { |
457 | u32 filled; | 488 | u32 filled; |
458 | u32 frame_qlen; | 489 | u32 frame_qlen; |
459 | u32 dsn; | 490 | u32 sn; |
460 | u32 metric; | 491 | u32 metric; |
461 | u32 exptime; | 492 | u32 exptime; |
462 | u32 discovery_timeout; | 493 | u32 discovery_timeout; |
@@ -506,6 +537,7 @@ struct mesh_config { | |||
506 | u32 dot11MeshHWMPactivePathTimeout; | 537 | u32 dot11MeshHWMPactivePathTimeout; |
507 | u16 dot11MeshHWMPpreqMinInterval; | 538 | u16 dot11MeshHWMPpreqMinInterval; |
508 | u16 dot11MeshHWMPnetDiameterTraversalTime; | 539 | u16 dot11MeshHWMPnetDiameterTraversalTime; |
540 | u8 dot11MeshHWMPRootMode; | ||
509 | }; | 541 | }; |
510 | 542 | ||
511 | /** | 543 | /** |
@@ -839,6 +871,19 @@ struct cfg80211_bitrate_mask { | |||
839 | u32 fixed; /* fixed bitrate, 0 == not fixed */ | 871 | u32 fixed; /* fixed bitrate, 0 == not fixed */ |
840 | u32 maxrate; /* in kbps, 0 == no limit */ | 872 | u32 maxrate; /* in kbps, 0 == no limit */ |
841 | }; | 873 | }; |
874 | /** | ||
875 | * struct cfg80211_pmksa - PMK Security Association | ||
876 | * | ||
877 | * This structure is passed to the set/del_pmksa() method for PMKSA | ||
878 | * caching. | ||
879 | * | ||
880 | * @bssid: The AP's BSSID. | ||
881 | * @pmkid: The PMK material itself. | ||
882 | */ | ||
883 | struct cfg80211_pmksa { | ||
884 | u8 *bssid; | ||
885 | u8 *pmkid; | ||
886 | }; | ||
842 | 887 | ||
843 | /** | 888 | /** |
844 | * struct cfg80211_ops - backend description for wireless configuration | 889 | * struct cfg80211_ops - backend description for wireless configuration |
@@ -941,7 +986,16 @@ struct cfg80211_bitrate_mask { | |||
941 | * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting | 986 | * @rfkill_poll: polls the hw rfkill line, use cfg80211 reporting |
942 | * functions to adjust rfkill hw state | 987 | * functions to adjust rfkill hw state |
943 | * | 988 | * |
989 | * @dump_survey: get site survey information. | ||
990 | * | ||
944 | * @testmode_cmd: run a test mode command | 991 | * @testmode_cmd: run a test mode command |
992 | * | ||
993 | * @set_pmksa: Cache a PMKID for a BSSID. This is mostly useful for fullmac | ||
994 | * devices running firmwares capable of generating the (re) association | ||
995 | * RSN IE. It allows for faster roaming between WPA2 BSSIDs. | ||
996 | * @del_pmksa: Delete a cached PMKID. | ||
997 | * @flush_pmksa: Flush all cached PMKIDs. | ||
998 | * | ||
945 | */ | 999 | */ |
946 | struct cfg80211_ops { | 1000 | struct cfg80211_ops { |
947 | int (*suspend)(struct wiphy *wiphy); | 1001 | int (*suspend)(struct wiphy *wiphy); |
@@ -1060,6 +1114,15 @@ struct cfg80211_ops { | |||
1060 | const u8 *peer, | 1114 | const u8 *peer, |
1061 | const struct cfg80211_bitrate_mask *mask); | 1115 | const struct cfg80211_bitrate_mask *mask); |
1062 | 1116 | ||
1117 | int (*dump_survey)(struct wiphy *wiphy, struct net_device *netdev, | ||
1118 | int idx, struct survey_info *info); | ||
1119 | |||
1120 | int (*set_pmksa)(struct wiphy *wiphy, struct net_device *netdev, | ||
1121 | struct cfg80211_pmksa *pmksa); | ||
1122 | int (*del_pmksa)(struct wiphy *wiphy, struct net_device *netdev, | ||
1123 | struct cfg80211_pmksa *pmksa); | ||
1124 | int (*flush_pmksa)(struct wiphy *wiphy, struct net_device *netdev); | ||
1125 | |||
1063 | /* some temporary stuff to finish wext */ | 1126 | /* some temporary stuff to finish wext */ |
1064 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, | 1127 | int (*set_power_mgmt)(struct wiphy *wiphy, struct net_device *dev, |
1065 | bool enabled, int timeout); | 1128 | bool enabled, int timeout); |
@@ -1071,27 +1134,50 @@ struct cfg80211_ops { | |||
1071 | */ | 1134 | */ |
1072 | 1135 | ||
1073 | /** | 1136 | /** |
1074 | * struct wiphy - wireless hardware description | 1137 | * enum wiphy_flags - wiphy capability flags |
1075 | * @idx: the wiphy index assigned to this item | 1138 | * |
1076 | * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name> | 1139 | * @WIPHY_FLAG_CUSTOM_REGULATORY: tells us the driver for this device |
1077 | * @custom_regulatory: tells us the driver for this device | ||
1078 | * has its own custom regulatory domain and cannot identify the | 1140 | * has its own custom regulatory domain and cannot identify the |
1079 | * ISO / IEC 3166 alpha2 it belongs to. When this is enabled | 1141 | * ISO / IEC 3166 alpha2 it belongs to. When this is enabled |
1080 | * we will disregard the first regulatory hint (when the | 1142 | * we will disregard the first regulatory hint (when the |
1081 | * initiator is %REGDOM_SET_BY_CORE). | 1143 | * initiator is %REGDOM_SET_BY_CORE). |
1082 | * @strict_regulatory: tells us the driver for this device will ignore | 1144 | * @WIPHY_FLAG_STRICT_REGULATORY: tells us the driver for this device will |
1083 | * regulatory domain settings until it gets its own regulatory domain | 1145 | * ignore regulatory domain settings until it gets its own regulatory |
1084 | * via its regulatory_hint(). After its gets its own regulatory domain | 1146 | * domain via its regulatory_hint(). After its gets its own regulatory |
1085 | * it will only allow further regulatory domain settings to further | 1147 | * domain it will only allow further regulatory domain settings to |
1086 | * enhance compliance. For example if channel 13 and 14 are disabled | 1148 | * further enhance compliance. For example if channel 13 and 14 are |
1087 | * by this regulatory domain no user regulatory domain can enable these | 1149 | * disabled by this regulatory domain no user regulatory domain can |
1088 | * channels at a later time. This can be used for devices which do not | 1150 | * enable these channels at a later time. This can be used for devices |
1089 | * have calibration information gauranteed for frequencies or settings | 1151 | * which do not have calibration information gauranteed for frequencies |
1090 | * outside of its regulatory domain. | 1152 | * or settings outside of its regulatory domain. |
1091 | * @disable_beacon_hints: enable this if your driver needs to ensure that | 1153 | * @WIPHY_FLAG_DISABLE_BEACON_HINTS: enable this if your driver needs to ensure |
1092 | * passive scan flags and beaconing flags may not be lifted by cfg80211 | 1154 | * that passive scan flags and beaconing flags may not be lifted by |
1093 | * due to regulatory beacon hints. For more information on beacon | 1155 | * cfg80211 due to regulatory beacon hints. For more information on beacon |
1094 | * hints read the documenation for regulatory_hint_found_beacon() | 1156 | * hints read the documenation for regulatory_hint_found_beacon() |
1157 | * @WIPHY_FLAG_NETNS_OK: if not set, do not allow changing the netns of this | ||
1158 | * wiphy at all | ||
1159 | * @WIPHY_FLAG_PS_ON_BY_DEFAULT: if set to true, powersave will be enabled | ||
1160 | * by default -- this flag will be set depending on the kernel's default | ||
1161 | * on wiphy_new(), but can be changed by the driver if it has a good | ||
1162 | * reason to override the default | ||
1163 | * @WIPHY_FLAG_4ADDR_AP: supports 4addr mode even on AP (with a single station | ||
1164 | * on a VLAN interface) | ||
1165 | * @WIPHY_FLAG_4ADDR_STATION: supports 4addr mode even as a station | ||
1166 | */ | ||
1167 | enum wiphy_flags { | ||
1168 | WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), | ||
1169 | WIPHY_FLAG_STRICT_REGULATORY = BIT(1), | ||
1170 | WIPHY_FLAG_DISABLE_BEACON_HINTS = BIT(2), | ||
1171 | WIPHY_FLAG_NETNS_OK = BIT(3), | ||
1172 | WIPHY_FLAG_PS_ON_BY_DEFAULT = BIT(4), | ||
1173 | WIPHY_FLAG_4ADDR_AP = BIT(5), | ||
1174 | WIPHY_FLAG_4ADDR_STATION = BIT(6), | ||
1175 | }; | ||
1176 | |||
1177 | /** | ||
1178 | * struct wiphy - wireless hardware description | ||
1179 | * @idx: the wiphy index assigned to this item | ||
1180 | * @class_dev: the class device representing /sys/class/ieee80211/<wiphy-name> | ||
1095 | * @reg_notifier: the driver's regulatory notification callback | 1181 | * @reg_notifier: the driver's regulatory notification callback |
1096 | * @regd: the driver's regulatory domain, if one was requested via | 1182 | * @regd: the driver's regulatory domain, if one was requested via |
1097 | * the regulatory_hint() API. This can be used by the driver | 1183 | * the regulatory_hint() API. This can be used by the driver |
@@ -1106,11 +1192,6 @@ struct cfg80211_ops { | |||
1106 | * -1 = fragmentation disabled, only odd values >= 256 used | 1192 | * -1 = fragmentation disabled, only odd values >= 256 used |
1107 | * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled | 1193 | * @rts_threshold: RTS threshold (dot11RTSThreshold); -1 = RTS/CTS disabled |
1108 | * @net: the network namespace this wiphy currently lives in | 1194 | * @net: the network namespace this wiphy currently lives in |
1109 | * @netnsok: if set to false, do not allow changing the netns of this | ||
1110 | * wiphy at all | ||
1111 | * @ps_default: default for powersave, will be set depending on the | ||
1112 | * kernel's default on wiphy_new(), but can be changed by the | ||
1113 | * driver if it has a good reason to override the default | ||
1114 | */ | 1195 | */ |
1115 | struct wiphy { | 1196 | struct wiphy { |
1116 | /* assign these fields before you register the wiphy */ | 1197 | /* assign these fields before you register the wiphy */ |
@@ -1121,12 +1202,7 @@ struct wiphy { | |||
1121 | /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ | 1202 | /* Supported interface modes, OR together BIT(NL80211_IFTYPE_...) */ |
1122 | u16 interface_modes; | 1203 | u16 interface_modes; |
1123 | 1204 | ||
1124 | bool custom_regulatory; | 1205 | u32 flags; |
1125 | bool strict_regulatory; | ||
1126 | bool disable_beacon_hints; | ||
1127 | |||
1128 | bool netnsok; | ||
1129 | bool ps_default; | ||
1130 | 1206 | ||
1131 | enum cfg80211_signal_type signal_type; | 1207 | enum cfg80211_signal_type signal_type; |
1132 | 1208 | ||
@@ -1142,6 +1218,11 @@ struct wiphy { | |||
1142 | u32 frag_threshold; | 1218 | u32 frag_threshold; |
1143 | u32 rts_threshold; | 1219 | u32 rts_threshold; |
1144 | 1220 | ||
1221 | char fw_version[ETHTOOL_BUSINFO_LEN]; | ||
1222 | u32 hw_version; | ||
1223 | |||
1224 | u8 max_num_pmkids; | ||
1225 | |||
1145 | /* If multiple wiphys are registered and you're handed e.g. | 1226 | /* If multiple wiphys are registered and you're handed e.g. |
1146 | * a regular netdev with assigned ieee80211_ptr, you won't | 1227 | * a regular netdev with assigned ieee80211_ptr, you won't |
1147 | * know whether it points to a wiphy your driver has registered | 1228 | * know whether it points to a wiphy your driver has registered |
@@ -1171,6 +1252,10 @@ struct wiphy { | |||
1171 | struct net *_net; | 1252 | struct net *_net; |
1172 | #endif | 1253 | #endif |
1173 | 1254 | ||
1255 | #ifdef CONFIG_CFG80211_WEXT | ||
1256 | const struct iw_handler_def *wext; | ||
1257 | #endif | ||
1258 | |||
1174 | char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); | 1259 | char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); |
1175 | }; | 1260 | }; |
1176 | 1261 | ||
@@ -1314,6 +1399,10 @@ struct cfg80211_cached_keys; | |||
1314 | * @ssid_len: (private) Used by the internal configuration code | 1399 | * @ssid_len: (private) Used by the internal configuration code |
1315 | * @wext: (private) Used by the internal wireless extensions compat code | 1400 | * @wext: (private) Used by the internal wireless extensions compat code |
1316 | * @wext_bssid: (private) Used by the internal wireless extensions compat code | 1401 | * @wext_bssid: (private) Used by the internal wireless extensions compat code |
1402 | * @use_4addr: indicates 4addr mode is used on this interface, must be | ||
1403 | * set by driver (if supported) on add_interface BEFORE registering the | ||
1404 | * netdev and may otherwise be used by driver read-only, will be update | ||
1405 | * by cfg80211 on change_interface | ||
1317 | */ | 1406 | */ |
1318 | struct wireless_dev { | 1407 | struct wireless_dev { |
1319 | struct wiphy *wiphy; | 1408 | struct wiphy *wiphy; |
@@ -1327,6 +1416,8 @@ struct wireless_dev { | |||
1327 | 1416 | ||
1328 | struct work_struct cleanup_work; | 1417 | struct work_struct cleanup_work; |
1329 | 1418 | ||
1419 | bool use_4addr; | ||
1420 | |||
1330 | /* currently used for IBSS and SME - might be rearranged later */ | 1421 | /* currently used for IBSS and SME - might be rearranged later */ |
1331 | u8 ssid[IEEE80211_MAX_SSID_LEN]; | 1422 | u8 ssid[IEEE80211_MAX_SSID_LEN]; |
1332 | u8 ssid_len; | 1423 | u8 ssid_len; |
@@ -1345,7 +1436,7 @@ struct wireless_dev { | |||
1345 | struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES]; | 1436 | struct cfg80211_internal_bss *auth_bsses[MAX_AUTH_BSSES]; |
1346 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ | 1437 | struct cfg80211_internal_bss *current_bss; /* associated / joined */ |
1347 | 1438 | ||
1348 | #ifdef CONFIG_WIRELESS_EXT | 1439 | #ifdef CONFIG_CFG80211_WEXT |
1349 | /* wext data */ | 1440 | /* wext data */ |
1350 | struct { | 1441 | struct { |
1351 | struct cfg80211_ibss_params ibss; | 1442 | struct cfg80211_ibss_params ibss; |
@@ -1776,6 +1867,18 @@ void cfg80211_send_rx_auth(struct net_device *dev, const u8 *buf, size_t len); | |||
1776 | void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr); | 1867 | void cfg80211_send_auth_timeout(struct net_device *dev, const u8 *addr); |
1777 | 1868 | ||
1778 | /** | 1869 | /** |
1870 | * __cfg80211_auth_canceled - notify cfg80211 that authentication was canceled | ||
1871 | * @dev: network device | ||
1872 | * @addr: The MAC address of the device with which the authentication timed out | ||
1873 | * | ||
1874 | * When a pending authentication had no action yet, the driver may decide | ||
1875 | * to not send a deauth frame, but in that case must calls this function | ||
1876 | * to tell cfg80211 about this decision. It is only valid to call this | ||
1877 | * function within the deauth() callback. | ||
1878 | */ | ||
1879 | void __cfg80211_auth_canceled(struct net_device *dev, const u8 *addr); | ||
1880 | |||
1881 | /** | ||
1779 | * cfg80211_send_rx_assoc - notification of processed association | 1882 | * cfg80211_send_rx_assoc - notification of processed association |
1780 | * @dev: network device | 1883 | * @dev: network device |
1781 | * @buf: (re)association response frame (header + body) | 1884 | * @buf: (re)association response frame (header + body) |
@@ -1802,30 +1905,45 @@ void cfg80211_send_assoc_timeout(struct net_device *dev, const u8 *addr); | |||
1802 | * @dev: network device | 1905 | * @dev: network device |
1803 | * @buf: deauthentication frame (header + body) | 1906 | * @buf: deauthentication frame (header + body) |
1804 | * @len: length of the frame data | 1907 | * @len: length of the frame data |
1805 | * @cookie: cookie from ->deauth if called within that callback, | ||
1806 | * %NULL otherwise | ||
1807 | * | 1908 | * |
1808 | * This function is called whenever deauthentication has been processed in | 1909 | * This function is called whenever deauthentication has been processed in |
1809 | * station mode. This includes both received deauthentication frames and | 1910 | * station mode. This includes both received deauthentication frames and |
1810 | * locally generated ones. This function may sleep. | 1911 | * locally generated ones. This function may sleep. |
1811 | */ | 1912 | */ |
1812 | void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len, | 1913 | void cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len); |
1813 | void *cookie); | 1914 | |
1915 | /** | ||
1916 | * __cfg80211_send_deauth - notification of processed deauthentication | ||
1917 | * @dev: network device | ||
1918 | * @buf: deauthentication frame (header + body) | ||
1919 | * @len: length of the frame data | ||
1920 | * | ||
1921 | * Like cfg80211_send_deauth(), but doesn't take the wdev lock. | ||
1922 | */ | ||
1923 | void __cfg80211_send_deauth(struct net_device *dev, const u8 *buf, size_t len); | ||
1814 | 1924 | ||
1815 | /** | 1925 | /** |
1816 | * cfg80211_send_disassoc - notification of processed disassociation | 1926 | * cfg80211_send_disassoc - notification of processed disassociation |
1817 | * @dev: network device | 1927 | * @dev: network device |
1818 | * @buf: disassociation response frame (header + body) | 1928 | * @buf: disassociation response frame (header + body) |
1819 | * @len: length of the frame data | 1929 | * @len: length of the frame data |
1820 | * @cookie: cookie from ->disassoc if called within that callback, | ||
1821 | * %NULL otherwise | ||
1822 | * | 1930 | * |
1823 | * This function is called whenever disassociation has been processed in | 1931 | * This function is called whenever disassociation has been processed in |
1824 | * station mode. This includes both received disassociation frames and locally | 1932 | * station mode. This includes both received disassociation frames and locally |
1825 | * generated ones. This function may sleep. | 1933 | * generated ones. This function may sleep. |
1826 | */ | 1934 | */ |
1827 | void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len, | 1935 | void cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, size_t len); |
1828 | void *cookie); | 1936 | |
1937 | /** | ||
1938 | * __cfg80211_send_disassoc - notification of processed disassociation | ||
1939 | * @dev: network device | ||
1940 | * @buf: disassociation response frame (header + body) | ||
1941 | * @len: length of the frame data | ||
1942 | * | ||
1943 | * Like cfg80211_send_disassoc(), but doesn't take the wdev lock. | ||
1944 | */ | ||
1945 | void __cfg80211_send_disassoc(struct net_device *dev, const u8 *buf, | ||
1946 | size_t len); | ||
1829 | 1947 | ||
1830 | /** | 1948 | /** |
1831 | * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP) | 1949 | * cfg80211_michael_mic_failure - notification of Michael MIC failure (TKIP) |
diff --git a/include/net/compat.h b/include/net/compat.h index 7c3002832d05..3c7d4e38fa1d 100644 --- a/include/net/compat.h +++ b/include/net/compat.h | |||
@@ -18,6 +18,11 @@ struct compat_msghdr { | |||
18 | compat_uint_t msg_flags; | 18 | compat_uint_t msg_flags; |
19 | }; | 19 | }; |
20 | 20 | ||
21 | struct compat_mmsghdr { | ||
22 | struct compat_msghdr msg_hdr; | ||
23 | compat_uint_t msg_len; | ||
24 | }; | ||
25 | |||
21 | struct compat_cmsghdr { | 26 | struct compat_cmsghdr { |
22 | compat_size_t cmsg_len; | 27 | compat_size_t cmsg_len; |
23 | compat_int_t cmsg_level; | 28 | compat_int_t cmsg_level; |
@@ -28,13 +33,20 @@ extern int compat_sock_get_timestamp(struct sock *, struct timeval __user *); | |||
28 | extern int compat_sock_get_timestampns(struct sock *, struct timespec __user *); | 33 | extern int compat_sock_get_timestampns(struct sock *, struct timespec __user *); |
29 | 34 | ||
30 | #else /* defined(CONFIG_COMPAT) */ | 35 | #else /* defined(CONFIG_COMPAT) */ |
31 | #define compat_msghdr msghdr /* to avoid compiler warnings */ | 36 | /* |
37 | * To avoid compiler warnings: | ||
38 | */ | ||
39 | #define compat_msghdr msghdr | ||
40 | #define compat_mmsghdr mmsghdr | ||
32 | #endif /* defined(CONFIG_COMPAT) */ | 41 | #endif /* defined(CONFIG_COMPAT) */ |
33 | 42 | ||
34 | extern int get_compat_msghdr(struct msghdr *, struct compat_msghdr __user *); | 43 | extern int get_compat_msghdr(struct msghdr *, struct compat_msghdr __user *); |
35 | extern int verify_compat_iovec(struct msghdr *, struct iovec *, struct sockaddr *, int); | 44 | extern int verify_compat_iovec(struct msghdr *, struct iovec *, struct sockaddr *, int); |
36 | extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsigned); | 45 | extern asmlinkage long compat_sys_sendmsg(int,struct compat_msghdr __user *,unsigned); |
37 | extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned); | 46 | extern asmlinkage long compat_sys_recvmsg(int,struct compat_msghdr __user *,unsigned); |
47 | extern asmlinkage long compat_sys_recvmmsg(int, struct compat_mmsghdr __user *, | ||
48 | unsigned, unsigned, | ||
49 | struct timespec __user *); | ||
38 | extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *); | 50 | extern asmlinkage long compat_sys_getsockopt(int, int, int, char __user *, int __user *); |
39 | extern int put_cmsg_compat(struct msghdr*, int, int, int, void *); | 51 | extern int put_cmsg_compat(struct msghdr*, int, int, int, void *); |
40 | 52 | ||
diff --git a/include/net/dn_dev.h b/include/net/dn_dev.h index cee46821dc53..511a459ec10f 100644 --- a/include/net/dn_dev.h +++ b/include/net/dn_dev.h | |||
@@ -75,7 +75,6 @@ struct dn_dev_parms { | |||
75 | unsigned long t3; /* Default value of t3 */ | 75 | unsigned long t3; /* Default value of t3 */ |
76 | int priority; /* Priority to be a router */ | 76 | int priority; /* Priority to be a router */ |
77 | char *name; /* Name for sysctl */ | 77 | char *name; /* Name for sysctl */ |
78 | int ctl_name; /* Index for sysctl */ | ||
79 | int (*up)(struct net_device *); | 78 | int (*up)(struct net_device *); |
80 | void (*down)(struct net_device *); | 79 | void (*down)(struct net_device *); |
81 | void (*timer3)(struct net_device *, struct dn_ifaddr *ifa); | 80 | void (*timer3)(struct net_device *, struct dn_ifaddr *ifa); |
@@ -97,16 +96,14 @@ struct dn_dev { | |||
97 | unsigned long uptime; /* Time device went up in jiffies */ | 96 | unsigned long uptime; /* Time device went up in jiffies */ |
98 | }; | 97 | }; |
99 | 98 | ||
100 | struct dn_short_packet | 99 | struct dn_short_packet { |
101 | { | ||
102 | __u8 msgflg; | 100 | __u8 msgflg; |
103 | __le16 dstnode; | 101 | __le16 dstnode; |
104 | __le16 srcnode; | 102 | __le16 srcnode; |
105 | __u8 forward; | 103 | __u8 forward; |
106 | } __attribute__((packed)); | 104 | } __attribute__((packed)); |
107 | 105 | ||
108 | struct dn_long_packet | 106 | struct dn_long_packet { |
109 | { | ||
110 | __u8 msgflg; | 107 | __u8 msgflg; |
111 | __u8 d_area; | 108 | __u8 d_area; |
112 | __u8 d_subarea; | 109 | __u8 d_subarea; |
@@ -122,8 +119,7 @@ struct dn_long_packet | |||
122 | 119 | ||
123 | /*------------------------- DRP - Routing messages ---------------------*/ | 120 | /*------------------------- DRP - Routing messages ---------------------*/ |
124 | 121 | ||
125 | struct endnode_hello_message | 122 | struct endnode_hello_message { |
126 | { | ||
127 | __u8 msgflg; | 123 | __u8 msgflg; |
128 | __u8 tiver[3]; | 124 | __u8 tiver[3]; |
129 | __u8 id[6]; | 125 | __u8 id[6]; |
@@ -138,8 +134,7 @@ struct endnode_hello_message | |||
138 | __u8 data[2]; | 134 | __u8 data[2]; |
139 | } __attribute__((packed)); | 135 | } __attribute__((packed)); |
140 | 136 | ||
141 | struct rtnode_hello_message | 137 | struct rtnode_hello_message { |
142 | { | ||
143 | __u8 msgflg; | 138 | __u8 msgflg; |
144 | __u8 tiver[3]; | 139 | __u8 tiver[3]; |
145 | __u8 id[6]; | 140 | __u8 id[6]; |
diff --git a/include/net/dn_fib.h b/include/net/dn_fib.h index c378be7bf960..52da6c3dd50d 100644 --- a/include/net/dn_fib.h +++ b/include/net/dn_fib.h | |||
@@ -4,8 +4,7 @@ | |||
4 | /* WARNING: The ordering of these elements must match ordering | 4 | /* WARNING: The ordering of these elements must match ordering |
5 | * of RTA_* rtnetlink attribute numbers. | 5 | * of RTA_* rtnetlink attribute numbers. |
6 | */ | 6 | */ |
7 | struct dn_kern_rta | 7 | struct dn_kern_rta { |
8 | { | ||
9 | void *rta_dst; | 8 | void *rta_dst; |
10 | void *rta_src; | 9 | void *rta_src; |
11 | int *rta_iif; | 10 | int *rta_iif; |
diff --git a/include/net/dn_nsp.h b/include/net/dn_nsp.h index 96e816b6974d..17d43d2db5ec 100644 --- a/include/net/dn_nsp.h +++ b/include/net/dn_nsp.h | |||
@@ -70,30 +70,26 @@ extern struct sk_buff *dn_alloc_send_skb(struct sock *sk, size_t *size, int nobl | |||
70 | 70 | ||
71 | /* Data Messages (data segment/interrupt/link service) */ | 71 | /* Data Messages (data segment/interrupt/link service) */ |
72 | 72 | ||
73 | struct nsp_data_seg_msg | 73 | struct nsp_data_seg_msg { |
74 | { | ||
75 | __u8 msgflg; | 74 | __u8 msgflg; |
76 | __le16 dstaddr; | 75 | __le16 dstaddr; |
77 | __le16 srcaddr; | 76 | __le16 srcaddr; |
78 | } __attribute__((packed)); | 77 | } __attribute__((packed)); |
79 | 78 | ||
80 | struct nsp_data_opt_msg | 79 | struct nsp_data_opt_msg { |
81 | { | ||
82 | __le16 acknum; | 80 | __le16 acknum; |
83 | __le16 segnum; | 81 | __le16 segnum; |
84 | __le16 lsflgs; | 82 | __le16 lsflgs; |
85 | } __attribute__((packed)); | 83 | } __attribute__((packed)); |
86 | 84 | ||
87 | struct nsp_data_opt_msg1 | 85 | struct nsp_data_opt_msg1 { |
88 | { | ||
89 | __le16 acknum; | 86 | __le16 acknum; |
90 | __le16 segnum; | 87 | __le16 segnum; |
91 | } __attribute__((packed)); | 88 | } __attribute__((packed)); |
92 | 89 | ||
93 | 90 | ||
94 | /* Acknowledgment Message (data/other data) */ | 91 | /* Acknowledgment Message (data/other data) */ |
95 | struct nsp_data_ack_msg | 92 | struct nsp_data_ack_msg { |
96 | { | ||
97 | __u8 msgflg; | 93 | __u8 msgflg; |
98 | __le16 dstaddr; | 94 | __le16 dstaddr; |
99 | __le16 srcaddr; | 95 | __le16 srcaddr; |
@@ -101,16 +97,14 @@ struct nsp_data_ack_msg | |||
101 | } __attribute__((packed)); | 97 | } __attribute__((packed)); |
102 | 98 | ||
103 | /* Connect Acknowledgment Message */ | 99 | /* Connect Acknowledgment Message */ |
104 | struct nsp_conn_ack_msg | 100 | struct nsp_conn_ack_msg { |
105 | { | ||
106 | __u8 msgflg; | 101 | __u8 msgflg; |
107 | __le16 dstaddr; | 102 | __le16 dstaddr; |
108 | } __attribute__((packed)); | 103 | } __attribute__((packed)); |
109 | 104 | ||
110 | 105 | ||
111 | /* Connect Initiate/Retransmit Initiate/Connect Confirm */ | 106 | /* Connect Initiate/Retransmit Initiate/Connect Confirm */ |
112 | struct nsp_conn_init_msg | 107 | struct nsp_conn_init_msg { |
113 | { | ||
114 | __u8 msgflg; | 108 | __u8 msgflg; |
115 | #define NSP_CI 0x18 /* Connect Initiate */ | 109 | #define NSP_CI 0x18 /* Connect Initiate */ |
116 | #define NSP_RCI 0x68 /* Retrans. Conn Init */ | 110 | #define NSP_RCI 0x68 /* Retrans. Conn Init */ |
@@ -126,8 +120,7 @@ struct nsp_conn_init_msg | |||
126 | } __attribute__((packed)); | 120 | } __attribute__((packed)); |
127 | 121 | ||
128 | /* Disconnect Initiate/Disconnect Confirm */ | 122 | /* Disconnect Initiate/Disconnect Confirm */ |
129 | struct nsp_disconn_init_msg | 123 | struct nsp_disconn_init_msg { |
130 | { | ||
131 | __u8 msgflg; | 124 | __u8 msgflg; |
132 | __le16 dstaddr; | 125 | __le16 dstaddr; |
133 | __le16 srcaddr; | 126 | __le16 srcaddr; |
@@ -136,8 +129,7 @@ struct nsp_disconn_init_msg | |||
136 | 129 | ||
137 | 130 | ||
138 | 131 | ||
139 | struct srcobj_fmt | 132 | struct srcobj_fmt { |
140 | { | ||
141 | __u8 format; | 133 | __u8 format; |
142 | __u8 task; | 134 | __u8 task; |
143 | __le16 grpcode; | 135 | __le16 grpcode; |
diff --git a/include/net/dst.h b/include/net/dst.h index 5a900ddcf10d..387cb3cfde7e 100644 --- a/include/net/dst.h +++ b/include/net/dst.h | |||
@@ -36,8 +36,7 @@ | |||
36 | 36 | ||
37 | struct sk_buff; | 37 | struct sk_buff; |
38 | 38 | ||
39 | struct dst_entry | 39 | struct dst_entry { |
40 | { | ||
41 | struct rcu_head rcu_head; | 40 | struct rcu_head rcu_head; |
42 | struct dst_entry *child; | 41 | struct dst_entry *child; |
43 | struct net_device *dev; | 42 | struct net_device *dev; |
@@ -111,6 +110,12 @@ dst_metric(const struct dst_entry *dst, int metric) | |||
111 | return dst->metrics[metric-1]; | 110 | return dst->metrics[metric-1]; |
112 | } | 111 | } |
113 | 112 | ||
113 | static inline u32 | ||
114 | dst_feature(const struct dst_entry *dst, u32 feature) | ||
115 | { | ||
116 | return (dst ? dst_metric(dst, RTAX_FEATURES) & feature : 0); | ||
117 | } | ||
118 | |||
114 | static inline u32 dst_mtu(const struct dst_entry *dst) | 119 | static inline u32 dst_mtu(const struct dst_entry *dst) |
115 | { | 120 | { |
116 | u32 mtu = dst_metric(dst, RTAX_MTU); | 121 | u32 mtu = dst_metric(dst, RTAX_MTU); |
@@ -136,7 +141,7 @@ static inline void set_dst_metric_rtt(struct dst_entry *dst, int metric, | |||
136 | static inline u32 | 141 | static inline u32 |
137 | dst_allfrag(const struct dst_entry *dst) | 142 | dst_allfrag(const struct dst_entry *dst) |
138 | { | 143 | { |
139 | int ret = dst_metric(dst, RTAX_FEATURES) & RTAX_FEATURE_ALLFRAG; | 144 | int ret = dst_feature(dst, RTAX_FEATURE_ALLFRAG); |
140 | /* Yes, _exactly_. This is paranoia. */ | 145 | /* Yes, _exactly_. This is paranoia. */ |
141 | barrier(); | 146 | barrier(); |
142 | return ret; | 147 | return ret; |
@@ -222,11 +227,19 @@ static inline void dst_confirm(struct dst_entry *dst) | |||
222 | neigh_confirm(dst->neighbour); | 227 | neigh_confirm(dst->neighbour); |
223 | } | 228 | } |
224 | 229 | ||
225 | static inline void dst_negative_advice(struct dst_entry **dst_p) | 230 | static inline void dst_negative_advice(struct dst_entry **dst_p, |
231 | struct sock *sk) | ||
226 | { | 232 | { |
227 | struct dst_entry * dst = *dst_p; | 233 | struct dst_entry * dst = *dst_p; |
228 | if (dst && dst->ops->negative_advice) | 234 | if (dst && dst->ops->negative_advice) { |
229 | *dst_p = dst->ops->negative_advice(dst); | 235 | *dst_p = dst->ops->negative_advice(dst); |
236 | |||
237 | if (dst != *dst_p) { | ||
238 | extern void sk_reset_txq(struct sock *sk); | ||
239 | |||
240 | sk_reset_txq(sk); | ||
241 | } | ||
242 | } | ||
230 | } | 243 | } |
231 | 244 | ||
232 | static inline void dst_link_failure(struct sk_buff *skb) | 245 | static inline void dst_link_failure(struct sk_buff *skb) |
diff --git a/include/net/fib_rules.h b/include/net/fib_rules.h index ca4b2e840078..c07ac9650ebc 100644 --- a/include/net/fib_rules.h +++ b/include/net/fib_rules.h | |||
@@ -7,12 +7,11 @@ | |||
7 | #include <net/flow.h> | 7 | #include <net/flow.h> |
8 | #include <net/rtnetlink.h> | 8 | #include <net/rtnetlink.h> |
9 | 9 | ||
10 | struct fib_rule | 10 | struct fib_rule { |
11 | { | ||
12 | struct list_head list; | 11 | struct list_head list; |
13 | atomic_t refcnt; | 12 | atomic_t refcnt; |
14 | int ifindex; | 13 | int iifindex; |
15 | char ifname[IFNAMSIZ]; | 14 | int oifindex; |
16 | u32 mark; | 15 | u32 mark; |
17 | u32 mark_mask; | 16 | u32 mark_mask; |
18 | u32 pref; | 17 | u32 pref; |
@@ -21,19 +20,19 @@ struct fib_rule | |||
21 | u8 action; | 20 | u8 action; |
22 | u32 target; | 21 | u32 target; |
23 | struct fib_rule * ctarget; | 22 | struct fib_rule * ctarget; |
23 | char iifname[IFNAMSIZ]; | ||
24 | char oifname[IFNAMSIZ]; | ||
24 | struct rcu_head rcu; | 25 | struct rcu_head rcu; |
25 | struct net * fr_net; | 26 | struct net * fr_net; |
26 | }; | 27 | }; |
27 | 28 | ||
28 | struct fib_lookup_arg | 29 | struct fib_lookup_arg { |
29 | { | ||
30 | void *lookup_ptr; | 30 | void *lookup_ptr; |
31 | void *result; | 31 | void *result; |
32 | struct fib_rule *rule; | 32 | struct fib_rule *rule; |
33 | }; | 33 | }; |
34 | 34 | ||
35 | struct fib_rules_ops | 35 | struct fib_rules_ops { |
36 | { | ||
37 | int family; | 36 | int family; |
38 | struct list_head list; | 37 | struct list_head list; |
39 | int rule_size; | 38 | int rule_size; |
@@ -67,10 +66,12 @@ struct fib_rules_ops | |||
67 | struct list_head rules_list; | 66 | struct list_head rules_list; |
68 | struct module *owner; | 67 | struct module *owner; |
69 | struct net *fro_net; | 68 | struct net *fro_net; |
69 | struct rcu_head rcu; | ||
70 | }; | 70 | }; |
71 | 71 | ||
72 | #define FRA_GENERIC_POLICY \ | 72 | #define FRA_GENERIC_POLICY \ |
73 | [FRA_IFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \ | 73 | [FRA_IIFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \ |
74 | [FRA_OIFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \ | ||
74 | [FRA_PRIORITY] = { .type = NLA_U32 }, \ | 75 | [FRA_PRIORITY] = { .type = NLA_U32 }, \ |
75 | [FRA_FWMARK] = { .type = NLA_U32 }, \ | 76 | [FRA_FWMARK] = { .type = NLA_U32 }, \ |
76 | [FRA_FWMASK] = { .type = NLA_U32 }, \ | 77 | [FRA_FWMASK] = { .type = NLA_U32 }, \ |
@@ -102,7 +103,7 @@ static inline u32 frh_get_table(struct fib_rule_hdr *frh, struct nlattr **nla) | |||
102 | return frh->table; | 103 | return frh->table; |
103 | } | 104 | } |
104 | 105 | ||
105 | extern int fib_rules_register(struct fib_rules_ops *); | 106 | extern struct fib_rules_ops *fib_rules_register(struct fib_rules_ops *, struct net *); |
106 | extern void fib_rules_unregister(struct fib_rules_ops *); | 107 | extern void fib_rules_unregister(struct fib_rules_ops *); |
107 | extern void fib_rules_cleanup_ops(struct fib_rules_ops *); | 108 | extern void fib_rules_cleanup_ops(struct fib_rules_ops *); |
108 | 109 | ||
diff --git a/include/net/gen_stats.h b/include/net/gen_stats.h index c1488553e349..fa157712e982 100644 --- a/include/net/gen_stats.h +++ b/include/net/gen_stats.h | |||
@@ -6,8 +6,7 @@ | |||
6 | #include <linux/rtnetlink.h> | 6 | #include <linux/rtnetlink.h> |
7 | #include <linux/pkt_sched.h> | 7 | #include <linux/pkt_sched.h> |
8 | 8 | ||
9 | struct gnet_dump | 9 | struct gnet_dump { |
10 | { | ||
11 | spinlock_t * lock; | 10 | spinlock_t * lock; |
12 | struct sk_buff * skb; | 11 | struct sk_buff * skb; |
13 | struct nlattr * tail; | 12 | struct nlattr * tail; |
@@ -30,6 +29,7 @@ extern int gnet_stats_start_copy_compat(struct sk_buff *skb, int type, | |||
30 | extern int gnet_stats_copy_basic(struct gnet_dump *d, | 29 | extern int gnet_stats_copy_basic(struct gnet_dump *d, |
31 | struct gnet_stats_basic_packed *b); | 30 | struct gnet_stats_basic_packed *b); |
32 | extern int gnet_stats_copy_rate_est(struct gnet_dump *d, | 31 | extern int gnet_stats_copy_rate_est(struct gnet_dump *d, |
32 | const struct gnet_stats_basic_packed *b, | ||
33 | struct gnet_stats_rate_est *r); | 33 | struct gnet_stats_rate_est *r); |
34 | extern int gnet_stats_copy_queue(struct gnet_dump *d, | 34 | extern int gnet_stats_copy_queue(struct gnet_dump *d, |
35 | struct gnet_stats_queue *q); | 35 | struct gnet_stats_queue *q); |
diff --git a/include/net/genetlink.h b/include/net/genetlink.h index 2a1c06874c42..eb551baafc04 100644 --- a/include/net/genetlink.h +++ b/include/net/genetlink.h | |||
@@ -13,8 +13,7 @@ | |||
13 | * @list: list entry for linking | 13 | * @list: list entry for linking |
14 | * @family: pointer to family, need not be set before registering | 14 | * @family: pointer to family, need not be set before registering |
15 | */ | 15 | */ |
16 | struct genl_multicast_group | 16 | struct genl_multicast_group { |
17 | { | ||
18 | struct genl_family *family; /* private */ | 17 | struct genl_family *family; /* private */ |
19 | struct list_head list; /* private */ | 18 | struct list_head list; /* private */ |
20 | char name[GENL_NAMSIZ]; | 19 | char name[GENL_NAMSIZ]; |
@@ -35,8 +34,7 @@ struct genl_multicast_group | |||
35 | * @family_list: family list | 34 | * @family_list: family list |
36 | * @mcast_groups: multicast groups list | 35 | * @mcast_groups: multicast groups list |
37 | */ | 36 | */ |
38 | struct genl_family | 37 | struct genl_family { |
39 | { | ||
40 | unsigned int id; | 38 | unsigned int id; |
41 | unsigned int hdrsize; | 39 | unsigned int hdrsize; |
42 | char name[GENL_NAMSIZ]; | 40 | char name[GENL_NAMSIZ]; |
@@ -58,8 +56,7 @@ struct genl_family | |||
58 | * @userhdr: user specific header | 56 | * @userhdr: user specific header |
59 | * @attrs: netlink attributes | 57 | * @attrs: netlink attributes |
60 | */ | 58 | */ |
61 | struct genl_info | 59 | struct genl_info { |
62 | { | ||
63 | u32 snd_seq; | 60 | u32 snd_seq; |
64 | u32 snd_pid; | 61 | u32 snd_pid; |
65 | struct nlmsghdr * nlhdr; | 62 | struct nlmsghdr * nlhdr; |
@@ -102,8 +99,7 @@ static inline void genl_info_net_set(struct genl_info *info, struct net *net) | |||
102 | * @done: completion callback for dumps | 99 | * @done: completion callback for dumps |
103 | * @ops_list: operations list | 100 | * @ops_list: operations list |
104 | */ | 101 | */ |
105 | struct genl_ops | 102 | struct genl_ops { |
106 | { | ||
107 | u8 cmd; | 103 | u8 cmd; |
108 | unsigned int flags; | 104 | unsigned int flags; |
109 | const struct nla_policy *policy; | 105 | const struct nla_policy *policy; |
diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h index 23c3f3d97779..9d3d86aaccbb 100644 --- a/include/net/ieee80211_radiotap.h +++ b/include/net/ieee80211_radiotap.h | |||
@@ -80,7 +80,7 @@ struct ieee80211_radiotap_header { | |||
80 | * Additional extensions are made | 80 | * Additional extensions are made |
81 | * by setting bit 31. | 81 | * by setting bit 31. |
82 | */ | 82 | */ |
83 | }; | 83 | } __packed; |
84 | 84 | ||
85 | /* Name Data type Units | 85 | /* Name Data type Units |
86 | * ---- --------- ----- | 86 | * ---- --------- ----- |
diff --git a/include/net/ieee802154_netdev.h b/include/net/ieee802154_netdev.h index 5dc6a61952de..57430555487a 100644 --- a/include/net/ieee802154_netdev.h +++ b/include/net/ieee802154_netdev.h | |||
@@ -74,8 +74,12 @@ static inline int mac_cb_type(struct sk_buff *skb) | |||
74 | #define IEEE802154_MAC_SCAN_PASSIVE 2 | 74 | #define IEEE802154_MAC_SCAN_PASSIVE 2 |
75 | #define IEEE802154_MAC_SCAN_ORPHAN 3 | 75 | #define IEEE802154_MAC_SCAN_ORPHAN 3 |
76 | 76 | ||
77 | struct wpan_phy; | ||
77 | /* | 78 | /* |
78 | * This should be located at net_device->ml_priv | 79 | * This should be located at net_device->ml_priv |
80 | * | ||
81 | * get_phy should increment the reference counting on returned phy. | ||
82 | * Use wpan_wpy_put to put that reference. | ||
79 | */ | 83 | */ |
80 | struct ieee802154_mlme_ops { | 84 | struct ieee802154_mlme_ops { |
81 | int (*assoc_req)(struct net_device *dev, | 85 | int (*assoc_req)(struct net_device *dev, |
@@ -94,18 +98,20 @@ struct ieee802154_mlme_ops { | |||
94 | int (*scan_req)(struct net_device *dev, | 98 | int (*scan_req)(struct net_device *dev, |
95 | u8 type, u32 channels, u8 page, u8 duration); | 99 | u8 type, u32 channels, u8 page, u8 duration); |
96 | 100 | ||
101 | struct wpan_phy *(*get_phy)(const struct net_device *dev); | ||
102 | |||
97 | /* | 103 | /* |
98 | * FIXME: these should become the part of PIB/MIB interface. | 104 | * FIXME: these should become the part of PIB/MIB interface. |
99 | * However we still don't have IB interface of any kind | 105 | * However we still don't have IB interface of any kind |
100 | */ | 106 | */ |
101 | u16 (*get_pan_id)(struct net_device *dev); | 107 | u16 (*get_pan_id)(const struct net_device *dev); |
102 | u16 (*get_short_addr)(struct net_device *dev); | 108 | u16 (*get_short_addr)(const struct net_device *dev); |
103 | u8 (*get_dsn)(struct net_device *dev); | 109 | u8 (*get_dsn)(const struct net_device *dev); |
104 | u8 (*get_bsn)(struct net_device *dev); | 110 | u8 (*get_bsn)(const struct net_device *dev); |
105 | }; | 111 | }; |
106 | 112 | ||
107 | static inline struct ieee802154_mlme_ops *ieee802154_mlme_ops( | 113 | static inline struct ieee802154_mlme_ops *ieee802154_mlme_ops( |
108 | struct net_device *dev) | 114 | const struct net_device *dev) |
109 | { | 115 | { |
110 | return dev->ml_priv; | 116 | return dev->ml_priv; |
111 | } | 117 | } |
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h index 38b78132019b..e9d69d198495 100644 --- a/include/net/if_inet6.h +++ b/include/net/if_inet6.h | |||
@@ -32,8 +32,7 @@ | |||
32 | 32 | ||
33 | #ifdef __KERNEL__ | 33 | #ifdef __KERNEL__ |
34 | 34 | ||
35 | struct inet6_ifaddr | 35 | struct inet6_ifaddr { |
36 | { | ||
37 | struct in6_addr addr; | 36 | struct in6_addr addr; |
38 | __u32 prefix_len; | 37 | __u32 prefix_len; |
39 | 38 | ||
@@ -67,8 +66,7 @@ struct inet6_ifaddr | |||
67 | int dead; | 66 | int dead; |
68 | }; | 67 | }; |
69 | 68 | ||
70 | struct ip6_sf_socklist | 69 | struct ip6_sf_socklist { |
71 | { | ||
72 | unsigned int sl_max; | 70 | unsigned int sl_max; |
73 | unsigned int sl_count; | 71 | unsigned int sl_count; |
74 | struct in6_addr sl_addr[0]; | 72 | struct in6_addr sl_addr[0]; |
@@ -79,8 +77,7 @@ struct ip6_sf_socklist | |||
79 | 77 | ||
80 | #define IP6_SFBLOCK 10 /* allocate this many at once */ | 78 | #define IP6_SFBLOCK 10 /* allocate this many at once */ |
81 | 79 | ||
82 | struct ipv6_mc_socklist | 80 | struct ipv6_mc_socklist { |
83 | { | ||
84 | struct in6_addr addr; | 81 | struct in6_addr addr; |
85 | int ifindex; | 82 | int ifindex; |
86 | struct ipv6_mc_socklist *next; | 83 | struct ipv6_mc_socklist *next; |
@@ -89,8 +86,7 @@ struct ipv6_mc_socklist | |||
89 | struct ip6_sf_socklist *sflist; | 86 | struct ip6_sf_socklist *sflist; |
90 | }; | 87 | }; |
91 | 88 | ||
92 | struct ip6_sf_list | 89 | struct ip6_sf_list { |
93 | { | ||
94 | struct ip6_sf_list *sf_next; | 90 | struct ip6_sf_list *sf_next; |
95 | struct in6_addr sf_addr; | 91 | struct in6_addr sf_addr; |
96 | unsigned long sf_count[2]; /* include/exclude counts */ | 92 | unsigned long sf_count[2]; /* include/exclude counts */ |
@@ -105,8 +101,7 @@ struct ip6_sf_list | |||
105 | #define MAF_NOREPORT 0x08 | 101 | #define MAF_NOREPORT 0x08 |
106 | #define MAF_GSQUERY 0x10 | 102 | #define MAF_GSQUERY 0x10 |
107 | 103 | ||
108 | struct ifmcaddr6 | 104 | struct ifmcaddr6 { |
109 | { | ||
110 | struct in6_addr mca_addr; | 105 | struct in6_addr mca_addr; |
111 | struct inet6_dev *idev; | 106 | struct inet6_dev *idev; |
112 | struct ifmcaddr6 *next; | 107 | struct ifmcaddr6 *next; |
@@ -126,15 +121,13 @@ struct ifmcaddr6 | |||
126 | 121 | ||
127 | /* Anycast stuff */ | 122 | /* Anycast stuff */ |
128 | 123 | ||
129 | struct ipv6_ac_socklist | 124 | struct ipv6_ac_socklist { |
130 | { | ||
131 | struct in6_addr acl_addr; | 125 | struct in6_addr acl_addr; |
132 | int acl_ifindex; | 126 | int acl_ifindex; |
133 | struct ipv6_ac_socklist *acl_next; | 127 | struct ipv6_ac_socklist *acl_next; |
134 | }; | 128 | }; |
135 | 129 | ||
136 | struct ifacaddr6 | 130 | struct ifacaddr6 { |
137 | { | ||
138 | struct in6_addr aca_addr; | 131 | struct in6_addr aca_addr; |
139 | struct inet6_dev *aca_idev; | 132 | struct inet6_dev *aca_idev; |
140 | struct rt6_info *aca_rt; | 133 | struct rt6_info *aca_rt; |
@@ -157,8 +150,7 @@ struct ipv6_devstat { | |||
157 | DEFINE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg); | 150 | DEFINE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg); |
158 | }; | 151 | }; |
159 | 152 | ||
160 | struct inet6_dev | 153 | struct inet6_dev { |
161 | { | ||
162 | struct net_device *dev; | 154 | struct net_device *dev; |
163 | 155 | ||
164 | struct inet6_ifaddr *addr_list; | 156 | struct inet6_ifaddr *addr_list; |
diff --git a/include/net/inet6_hashtables.h b/include/net/inet6_hashtables.h index 22c73a77cd99..92838d3a1ab7 100644 --- a/include/net/inet6_hashtables.h +++ b/include/net/inet6_hashtables.h | |||
@@ -46,8 +46,8 @@ static inline int inet6_sk_ehashfn(const struct sock *sk) | |||
46 | const struct ipv6_pinfo *np = inet6_sk(sk); | 46 | const struct ipv6_pinfo *np = inet6_sk(sk); |
47 | const struct in6_addr *laddr = &np->rcv_saddr; | 47 | const struct in6_addr *laddr = &np->rcv_saddr; |
48 | const struct in6_addr *faddr = &np->daddr; | 48 | const struct in6_addr *faddr = &np->daddr; |
49 | const __u16 lport = inet->num; | 49 | const __u16 lport = inet->inet_num; |
50 | const __be16 fport = inet->dport; | 50 | const __be16 fport = inet->inet_dport; |
51 | struct net *net = sock_net(sk); | 51 | struct net *net = sock_net(sk); |
52 | 52 | ||
53 | return inet6_ehashfn(net, laddr, lport, faddr, fport); | 53 | return inet6_ehashfn(net, laddr, lport, faddr, fport); |
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h index d522dcf3031a..41cbddd25b70 100644 --- a/include/net/inet_hashtables.h +++ b/include/net/inet_hashtables.h | |||
@@ -92,8 +92,8 @@ static inline struct net *ib_net(struct inet_bind_bucket *ib) | |||
92 | return read_pnet(&ib->ib_net); | 92 | return read_pnet(&ib->ib_net); |
93 | } | 93 | } |
94 | 94 | ||
95 | #define inet_bind_bucket_for_each(tb, node, head) \ | 95 | #define inet_bind_bucket_for_each(tb, pos, head) \ |
96 | hlist_for_each_entry(tb, node, head, node) | 96 | hlist_for_each_entry(tb, pos, head, node) |
97 | 97 | ||
98 | struct inet_bind_hashbucket { | 98 | struct inet_bind_hashbucket { |
99 | spinlock_t lock; | 99 | spinlock_t lock; |
@@ -125,7 +125,7 @@ struct inet_hashinfo { | |||
125 | */ | 125 | */ |
126 | struct inet_ehash_bucket *ehash; | 126 | struct inet_ehash_bucket *ehash; |
127 | spinlock_t *ehash_locks; | 127 | spinlock_t *ehash_locks; |
128 | unsigned int ehash_size; | 128 | unsigned int ehash_mask; |
129 | unsigned int ehash_locks_mask; | 129 | unsigned int ehash_locks_mask; |
130 | 130 | ||
131 | /* Ok, let's try this, I give up, we do need a local binding | 131 | /* Ok, let's try this, I give up, we do need a local binding |
@@ -158,7 +158,7 @@ static inline struct inet_ehash_bucket *inet_ehash_bucket( | |||
158 | struct inet_hashinfo *hashinfo, | 158 | struct inet_hashinfo *hashinfo, |
159 | unsigned int hash) | 159 | unsigned int hash) |
160 | { | 160 | { |
161 | return &hashinfo->ehash[hash & (hashinfo->ehash_size - 1)]; | 161 | return &hashinfo->ehash[hash & hashinfo->ehash_mask]; |
162 | } | 162 | } |
163 | 163 | ||
164 | static inline spinlock_t *inet_ehash_lockp( | 164 | static inline spinlock_t *inet_ehash_lockp( |
@@ -241,7 +241,7 @@ static inline int inet_lhashfn(struct net *net, const unsigned short num) | |||
241 | 241 | ||
242 | static inline int inet_sk_listen_hashfn(const struct sock *sk) | 242 | static inline int inet_sk_listen_hashfn(const struct sock *sk) |
243 | { | 243 | { |
244 | return inet_lhashfn(sock_net(sk), inet_sk(sk)->num); | 244 | return inet_lhashfn(sock_net(sk), inet_sk(sk)->inet_num); |
245 | } | 245 | } |
246 | 246 | ||
247 | /* Caller must disable local BH processing. */ | 247 | /* Caller must disable local BH processing. */ |
@@ -301,8 +301,8 @@ typedef __u64 __bitwise __addrpair; | |||
301 | #endif /* __BIG_ENDIAN */ | 301 | #endif /* __BIG_ENDIAN */ |
302 | #define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ | 302 | #define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ |
303 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ | 303 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ |
304 | ((*((__addrpair *)&(inet_sk(__sk)->daddr))) == (__cookie)) && \ | 304 | ((*((__addrpair *)&(inet_sk(__sk)->inet_daddr))) == (__cookie)) && \ |
305 | ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ | 305 | ((*((__portpair *)&(inet_sk(__sk)->inet_dport))) == (__ports)) && \ |
306 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) | 306 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) |
307 | #define INET_TW_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ | 307 | #define INET_TW_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif)\ |
308 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ | 308 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ |
@@ -313,9 +313,9 @@ typedef __u64 __bitwise __addrpair; | |||
313 | #define INET_ADDR_COOKIE(__name, __saddr, __daddr) | 313 | #define INET_ADDR_COOKIE(__name, __saddr, __daddr) |
314 | #define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif) \ | 314 | #define INET_MATCH(__sk, __net, __hash, __cookie, __saddr, __daddr, __ports, __dif) \ |
315 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ | 315 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ |
316 | (inet_sk(__sk)->daddr == (__saddr)) && \ | 316 | (inet_sk(__sk)->inet_daddr == (__saddr)) && \ |
317 | (inet_sk(__sk)->rcv_saddr == (__daddr)) && \ | 317 | (inet_sk(__sk)->inet_rcv_saddr == (__daddr)) && \ |
318 | ((*((__portpair *)&(inet_sk(__sk)->dport))) == (__ports)) && \ | 318 | ((*((__portpair *)&(inet_sk(__sk)->inet_dport))) == (__ports)) && \ |
319 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) | 319 | (!((__sk)->sk_bound_dev_if) || ((__sk)->sk_bound_dev_if == (__dif)))) |
320 | #define INET_TW_MATCH(__sk, __net, __hash,__cookie, __saddr, __daddr, __ports, __dif) \ | 320 | #define INET_TW_MATCH(__sk, __net, __hash,__cookie, __saddr, __daddr, __ports, __dif) \ |
321 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ | 321 | (((__sk)->sk_hash == (__hash)) && net_eq(sock_net(__sk), (__net)) && \ |
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h index 47004f35cc7e..bd4c53f75ac0 100644 --- a/include/net/inet_sock.h +++ b/include/net/inet_sock.h | |||
@@ -93,14 +93,14 @@ struct rtable; | |||
93 | * | 93 | * |
94 | * @sk - ancestor class | 94 | * @sk - ancestor class |
95 | * @pinet6 - pointer to IPv6 control block | 95 | * @pinet6 - pointer to IPv6 control block |
96 | * @daddr - Foreign IPv4 addr | 96 | * @inet_daddr - Foreign IPv4 addr |
97 | * @rcv_saddr - Bound local IPv4 addr | 97 | * @inet_rcv_saddr - Bound local IPv4 addr |
98 | * @dport - Destination port | 98 | * @inet_dport - Destination port |
99 | * @num - Local port | 99 | * @inet_num - Local port |
100 | * @saddr - Sending source | 100 | * @inet_saddr - Sending source |
101 | * @uc_ttl - Unicast TTL | 101 | * @uc_ttl - Unicast TTL |
102 | * @sport - Source port | 102 | * @inet_sport - Source port |
103 | * @id - ID counter for DF pkts | 103 | * @inet_id - ID counter for DF pkts |
104 | * @tos - TOS | 104 | * @tos - TOS |
105 | * @mc_ttl - Multicasting TTL | 105 | * @mc_ttl - Multicasting TTL |
106 | * @is_icsk - is this an inet_connection_sock? | 106 | * @is_icsk - is this an inet_connection_sock? |
@@ -115,16 +115,16 @@ struct inet_sock { | |||
115 | struct ipv6_pinfo *pinet6; | 115 | struct ipv6_pinfo *pinet6; |
116 | #endif | 116 | #endif |
117 | /* Socket demultiplex comparisons on incoming packets. */ | 117 | /* Socket demultiplex comparisons on incoming packets. */ |
118 | __be32 daddr; | 118 | __be32 inet_daddr; |
119 | __be32 rcv_saddr; | 119 | __be32 inet_rcv_saddr; |
120 | __be16 dport; | 120 | __be16 inet_dport; |
121 | __u16 num; | 121 | __u16 inet_num; |
122 | __be32 saddr; | 122 | __be32 inet_saddr; |
123 | __s16 uc_ttl; | 123 | __s16 uc_ttl; |
124 | __u16 cmsg_flags; | 124 | __u16 cmsg_flags; |
125 | struct ip_options *opt; | 125 | struct ip_options *opt; |
126 | __be16 sport; | 126 | __be16 inet_sport; |
127 | __u16 id; | 127 | __u16 inet_id; |
128 | __u8 tos; | 128 | __u8 tos; |
129 | __u8 mc_ttl; | 129 | __u8 mc_ttl; |
130 | __u8 pmtudisc; | 130 | __u8 pmtudisc; |
@@ -190,10 +190,10 @@ static inline unsigned int inet_ehashfn(struct net *net, | |||
190 | static inline int inet_sk_ehashfn(const struct sock *sk) | 190 | static inline int inet_sk_ehashfn(const struct sock *sk) |
191 | { | 191 | { |
192 | const struct inet_sock *inet = inet_sk(sk); | 192 | const struct inet_sock *inet = inet_sk(sk); |
193 | const __be32 laddr = inet->rcv_saddr; | 193 | const __be32 laddr = inet->inet_rcv_saddr; |
194 | const __u16 lport = inet->num; | 194 | const __u16 lport = inet->inet_num; |
195 | const __be32 faddr = inet->daddr; | 195 | const __be32 faddr = inet->inet_daddr; |
196 | const __be16 fport = inet->dport; | 196 | const __be16 fport = inet->inet_dport; |
197 | struct net *net = sock_net(sk); | 197 | struct net *net = sock_net(sk); |
198 | 198 | ||
199 | return inet_ehashfn(net, laddr, lport, faddr, fport); | 199 | return inet_ehashfn(net, laddr, lport, faddr, fport); |
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h index f93ad90a601b..b801ade2295e 100644 --- a/include/net/inet_timewait_sock.h +++ b/include/net/inet_timewait_sock.h | |||
@@ -194,11 +194,13 @@ static inline struct inet_timewait_sock *inet_twsk(const struct sock *sk) | |||
194 | static inline __be32 inet_rcv_saddr(const struct sock *sk) | 194 | static inline __be32 inet_rcv_saddr(const struct sock *sk) |
195 | { | 195 | { |
196 | return likely(sk->sk_state != TCP_TIME_WAIT) ? | 196 | return likely(sk->sk_state != TCP_TIME_WAIT) ? |
197 | inet_sk(sk)->rcv_saddr : inet_twsk(sk)->tw_rcv_saddr; | 197 | inet_sk(sk)->inet_rcv_saddr : inet_twsk(sk)->tw_rcv_saddr; |
198 | } | 198 | } |
199 | 199 | ||
200 | extern void inet_twsk_put(struct inet_timewait_sock *tw); | 200 | extern void inet_twsk_put(struct inet_timewait_sock *tw); |
201 | 201 | ||
202 | extern int inet_twsk_unhash(struct inet_timewait_sock *tw); | ||
203 | |||
202 | extern struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, | 204 | extern struct inet_timewait_sock *inet_twsk_alloc(const struct sock *sk, |
203 | const int state); | 205 | const int state); |
204 | 206 | ||
@@ -212,14 +214,14 @@ extern void inet_twsk_schedule(struct inet_timewait_sock *tw, | |||
212 | extern void inet_twsk_deschedule(struct inet_timewait_sock *tw, | 214 | extern void inet_twsk_deschedule(struct inet_timewait_sock *tw, |
213 | struct inet_timewait_death_row *twdr); | 215 | struct inet_timewait_death_row *twdr); |
214 | 216 | ||
215 | extern void inet_twsk_purge(struct net *net, struct inet_hashinfo *hashinfo, | 217 | extern void inet_twsk_purge(struct inet_hashinfo *hashinfo, |
216 | struct inet_timewait_death_row *twdr, int family); | 218 | struct inet_timewait_death_row *twdr, int family); |
217 | 219 | ||
218 | static inline | 220 | static inline |
219 | struct net *twsk_net(const struct inet_timewait_sock *twsk) | 221 | struct net *twsk_net(const struct inet_timewait_sock *twsk) |
220 | { | 222 | { |
221 | #ifdef CONFIG_NET_NS | 223 | #ifdef CONFIG_NET_NS |
222 | return twsk->tw_net; | 224 | return rcu_dereference(twsk->tw_net); |
223 | #else | 225 | #else |
224 | return &init_net; | 226 | return &init_net; |
225 | #endif | 227 | #endif |
@@ -229,7 +231,7 @@ static inline | |||
229 | void twsk_net_set(struct inet_timewait_sock *twsk, struct net *net) | 231 | void twsk_net_set(struct inet_timewait_sock *twsk, struct net *net) |
230 | { | 232 | { |
231 | #ifdef CONFIG_NET_NS | 233 | #ifdef CONFIG_NET_NS |
232 | twsk->tw_net = net; | 234 | rcu_assign_pointer(twsk->tw_net, net); |
233 | #endif | 235 | #endif |
234 | } | 236 | } |
235 | #endif /* _INET_TIMEWAIT_SOCK_ */ | 237 | #endif /* _INET_TIMEWAIT_SOCK_ */ |
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h index 15e1f8fe4c1f..87b1df0d4d8c 100644 --- a/include/net/inetpeer.h +++ b/include/net/inetpeer.h | |||
@@ -13,20 +13,19 @@ | |||
13 | #include <linux/spinlock.h> | 13 | #include <linux/spinlock.h> |
14 | #include <asm/atomic.h> | 14 | #include <asm/atomic.h> |
15 | 15 | ||
16 | struct inet_peer | 16 | struct inet_peer { |
17 | { | ||
18 | /* group together avl_left,avl_right,v4daddr to speedup lookups */ | 17 | /* group together avl_left,avl_right,v4daddr to speedup lookups */ |
19 | struct inet_peer *avl_left, *avl_right; | 18 | struct inet_peer *avl_left, *avl_right; |
20 | __be32 v4daddr; /* peer's address */ | 19 | __be32 v4daddr; /* peer's address */ |
21 | __u16 avl_height; | 20 | __u32 avl_height; |
22 | __u16 ip_id_count; /* IP ID for the next packet */ | ||
23 | struct list_head unused; | 21 | struct list_head unused; |
24 | __u32 dtime; /* the time of last use of not | 22 | __u32 dtime; /* the time of last use of not |
25 | * referenced entries */ | 23 | * referenced entries */ |
26 | atomic_t refcnt; | 24 | atomic_t refcnt; |
27 | atomic_t rid; /* Frag reception counter */ | 25 | atomic_t rid; /* Frag reception counter */ |
26 | atomic_t ip_id_count; /* IP ID for the next packet */ | ||
28 | __u32 tcp_ts; | 27 | __u32 tcp_ts; |
29 | unsigned long tcp_ts_stamp; | 28 | __u32 tcp_ts_stamp; |
30 | }; | 29 | }; |
31 | 30 | ||
32 | void inet_initpeers(void) __init; | 31 | void inet_initpeers(void) __init; |
@@ -37,17 +36,11 @@ struct inet_peer *inet_getpeer(__be32 daddr, int create); | |||
37 | /* can be called from BH context or outside */ | 36 | /* can be called from BH context or outside */ |
38 | extern void inet_putpeer(struct inet_peer *p); | 37 | extern void inet_putpeer(struct inet_peer *p); |
39 | 38 | ||
40 | extern spinlock_t inet_peer_idlock; | ||
41 | /* can be called with or without local BH being disabled */ | 39 | /* can be called with or without local BH being disabled */ |
42 | static inline __u16 inet_getid(struct inet_peer *p, int more) | 40 | static inline __u16 inet_getid(struct inet_peer *p, int more) |
43 | { | 41 | { |
44 | __u16 id; | 42 | more++; |
45 | 43 | return atomic_add_return(more, &p->ip_id_count) - more; | |
46 | spin_lock_bh(&inet_peer_idlock); | ||
47 | id = p->ip_id_count; | ||
48 | p->ip_id_count += 1 + more; | ||
49 | spin_unlock_bh(&inet_peer_idlock); | ||
50 | return id; | ||
51 | } | 44 | } |
52 | 45 | ||
53 | #endif /* _NET_INETPEER_H */ | 46 | #endif /* _NET_INETPEER_H */ |
diff --git a/include/net/ip.h b/include/net/ip.h index 2f47e5482b55..e6b9d12d5f62 100644 --- a/include/net/ip.h +++ b/include/net/ip.h | |||
@@ -33,8 +33,7 @@ | |||
33 | 33 | ||
34 | struct sock; | 34 | struct sock; |
35 | 35 | ||
36 | struct inet_skb_parm | 36 | struct inet_skb_parm { |
37 | { | ||
38 | struct ip_options opt; /* Compiled IP options */ | 37 | struct ip_options opt; /* Compiled IP options */ |
39 | unsigned char flags; | 38 | unsigned char flags; |
40 | 39 | ||
@@ -50,8 +49,7 @@ static inline unsigned int ip_hdrlen(const struct sk_buff *skb) | |||
50 | return ip_hdr(skb)->ihl * 4; | 49 | return ip_hdr(skb)->ihl * 4; |
51 | } | 50 | } |
52 | 51 | ||
53 | struct ipcm_cookie | 52 | struct ipcm_cookie { |
54 | { | ||
55 | __be32 addr; | 53 | __be32 addr; |
56 | int oif; | 54 | int oif; |
57 | struct ip_options *opt; | 55 | struct ip_options *opt; |
@@ -60,8 +58,7 @@ struct ipcm_cookie | |||
60 | 58 | ||
61 | #define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb)) | 59 | #define IPCB(skb) ((struct inet_skb_parm*)((skb)->cb)) |
62 | 60 | ||
63 | struct ip_ra_chain | 61 | struct ip_ra_chain { |
64 | { | ||
65 | struct ip_ra_chain *next; | 62 | struct ip_ra_chain *next; |
66 | struct sock *sk; | 63 | struct sock *sk; |
67 | void (*destructor)(struct sock *); | 64 | void (*destructor)(struct sock *); |
@@ -159,8 +156,7 @@ static inline __u8 ip_reply_arg_flowi_flags(const struct ip_reply_arg *arg) | |||
159 | void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg, | 156 | void ip_send_reply(struct sock *sk, struct sk_buff *skb, struct ip_reply_arg *arg, |
160 | unsigned int len); | 157 | unsigned int len); |
161 | 158 | ||
162 | struct ipv4_config | 159 | struct ipv4_config { |
163 | { | ||
164 | int log_martians; | 160 | int log_martians; |
165 | int no_pmtu_disc; | 161 | int no_pmtu_disc; |
166 | }; | 162 | }; |
@@ -240,8 +236,8 @@ static inline void ip_select_ident(struct iphdr *iph, struct dst_entry *dst, str | |||
240 | * does not change, they drop every other packet in | 236 | * does not change, they drop every other packet in |
241 | * a TCP stream using header compression. | 237 | * a TCP stream using header compression. |
242 | */ | 238 | */ |
243 | iph->id = (sk && inet_sk(sk)->daddr) ? | 239 | iph->id = (sk && inet_sk(sk)->inet_daddr) ? |
244 | htons(inet_sk(sk)->id++) : 0; | 240 | htons(inet_sk(sk)->inet_id++) : 0; |
245 | } else | 241 | } else |
246 | __ip_select_ident(iph, dst, 0); | 242 | __ip_select_ident(iph, dst, 0); |
247 | } | 243 | } |
@@ -249,9 +245,9 @@ static inline void ip_select_ident(struct iphdr *iph, struct dst_entry *dst, str | |||
249 | static inline void ip_select_ident_more(struct iphdr *iph, struct dst_entry *dst, struct sock *sk, int more) | 245 | static inline void ip_select_ident_more(struct iphdr *iph, struct dst_entry *dst, struct sock *sk, int more) |
250 | { | 246 | { |
251 | if (iph->frag_off & htons(IP_DF)) { | 247 | if (iph->frag_off & htons(IP_DF)) { |
252 | if (sk && inet_sk(sk)->daddr) { | 248 | if (sk && inet_sk(sk)->inet_daddr) { |
253 | iph->id = htons(inet_sk(sk)->id); | 249 | iph->id = htons(inet_sk(sk)->inet_id); |
254 | inet_sk(sk)->id += 1 + more; | 250 | inet_sk(sk)->inet_id += 1 + more; |
255 | } else | 251 | } else |
256 | iph->id = 0; | 252 | iph->id = 0; |
257 | } else | 253 | } else |
@@ -317,7 +313,7 @@ static inline void ip_ib_mc_map(__be32 naddr, const unsigned char *broadcast, ch | |||
317 | 313 | ||
318 | static __inline__ void inet_reset_saddr(struct sock *sk) | 314 | static __inline__ void inet_reset_saddr(struct sock *sk) |
319 | { | 315 | { |
320 | inet_sk(sk)->rcv_saddr = inet_sk(sk)->saddr = 0; | 316 | inet_sk(sk)->inet_rcv_saddr = inet_sk(sk)->inet_saddr = 0; |
321 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) | 317 | #if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE) |
322 | if (sk->sk_family == PF_INET6) { | 318 | if (sk->sk_family == PF_INET6) { |
323 | struct ipv6_pinfo *np = inet6_sk(sk); | 319 | struct ipv6_pinfo *np = inet6_sk(sk); |
@@ -336,8 +332,7 @@ extern int ip_call_ra_chain(struct sk_buff *skb); | |||
336 | * Functions provided by ip_fragment.c | 332 | * Functions provided by ip_fragment.c |
337 | */ | 333 | */ |
338 | 334 | ||
339 | enum ip_defrag_users | 335 | enum ip_defrag_users { |
340 | { | ||
341 | IP_DEFRAG_LOCAL_DELIVER, | 336 | IP_DEFRAG_LOCAL_DELIVER, |
342 | IP_DEFRAG_CALL_RA_CHAIN, | 337 | IP_DEFRAG_CALL_RA_CHAIN, |
343 | IP_DEFRAG_CONNTRACK_IN, | 338 | IP_DEFRAG_CONNTRACK_IN, |
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h index 15b492a9aa79..257808188add 100644 --- a/include/net/ip6_fib.h +++ b/include/net/ip6_fib.h | |||
@@ -30,8 +30,7 @@ | |||
30 | 30 | ||
31 | struct rt6_info; | 31 | struct rt6_info; |
32 | 32 | ||
33 | struct fib6_config | 33 | struct fib6_config { |
34 | { | ||
35 | u32 fc_table; | 34 | u32 fc_table; |
36 | u32 fc_metric; | 35 | u32 fc_metric; |
37 | int fc_dst_len; | 36 | int fc_dst_len; |
@@ -51,8 +50,7 @@ struct fib6_config | |||
51 | struct nl_info fc_nlinfo; | 50 | struct nl_info fc_nlinfo; |
52 | }; | 51 | }; |
53 | 52 | ||
54 | struct fib6_node | 53 | struct fib6_node { |
55 | { | ||
56 | struct fib6_node *parent; | 54 | struct fib6_node *parent; |
57 | struct fib6_node *left; | 55 | struct fib6_node *left; |
58 | struct fib6_node *right; | 56 | struct fib6_node *right; |
@@ -78,16 +76,14 @@ struct fib6_node | |||
78 | * | 76 | * |
79 | */ | 77 | */ |
80 | 78 | ||
81 | struct rt6key | 79 | struct rt6key { |
82 | { | ||
83 | struct in6_addr addr; | 80 | struct in6_addr addr; |
84 | int plen; | 81 | int plen; |
85 | }; | 82 | }; |
86 | 83 | ||
87 | struct fib6_table; | 84 | struct fib6_table; |
88 | 85 | ||
89 | struct rt6_info | 86 | struct rt6_info { |
90 | { | ||
91 | union { | 87 | union { |
92 | struct dst_entry dst; | 88 | struct dst_entry dst; |
93 | } u; | 89 | } u; |
@@ -127,8 +123,7 @@ static inline struct inet6_dev *ip6_dst_idev(struct dst_entry *dst) | |||
127 | return ((struct rt6_info *)dst)->rt6i_idev; | 123 | return ((struct rt6_info *)dst)->rt6i_idev; |
128 | } | 124 | } |
129 | 125 | ||
130 | struct fib6_walker_t | 126 | struct fib6_walker_t { |
131 | { | ||
132 | struct fib6_walker_t *prev, *next; | 127 | struct fib6_walker_t *prev, *next; |
133 | struct fib6_node *root, *node; | 128 | struct fib6_node *root, *node; |
134 | struct rt6_info *leaf; | 129 | struct rt6_info *leaf; |
diff --git a/include/net/ip6_route.h b/include/net/ip6_route.h index 0e1b8aebaff8..4a808de7c0f6 100644 --- a/include/net/ip6_route.h +++ b/include/net/ip6_route.h | |||
@@ -103,8 +103,7 @@ extern void rt6_pmtu_discovery(struct in6_addr *daddr, | |||
103 | 103 | ||
104 | struct netlink_callback; | 104 | struct netlink_callback; |
105 | 105 | ||
106 | struct rt6_rtnl_dump_arg | 106 | struct rt6_rtnl_dump_arg { |
107 | { | ||
108 | struct sk_buff *skb; | 107 | struct sk_buff *skb; |
109 | struct netlink_callback *cb; | 108 | struct netlink_callback *cb; |
110 | struct net *net; | 109 | struct net *net; |
diff --git a/include/net/ip_fib.h b/include/net/ip_fib.h index 4d22fabc7719..c93f94edc610 100644 --- a/include/net/ip_fib.h +++ b/include/net/ip_fib.h | |||
@@ -144,18 +144,21 @@ struct fib_table { | |||
144 | struct hlist_node tb_hlist; | 144 | struct hlist_node tb_hlist; |
145 | u32 tb_id; | 145 | u32 tb_id; |
146 | int tb_default; | 146 | int tb_default; |
147 | int (*tb_lookup)(struct fib_table *tb, const struct flowi *flp, struct fib_result *res); | ||
148 | int (*tb_insert)(struct fib_table *, struct fib_config *); | ||
149 | int (*tb_delete)(struct fib_table *, struct fib_config *); | ||
150 | int (*tb_dump)(struct fib_table *table, struct sk_buff *skb, | ||
151 | struct netlink_callback *cb); | ||
152 | int (*tb_flush)(struct fib_table *table); | ||
153 | void (*tb_select_default)(struct fib_table *table, | ||
154 | const struct flowi *flp, struct fib_result *res); | ||
155 | |||
156 | unsigned char tb_data[0]; | 147 | unsigned char tb_data[0]; |
157 | }; | 148 | }; |
158 | 149 | ||
150 | extern int fib_table_lookup(struct fib_table *tb, const struct flowi *flp, | ||
151 | struct fib_result *res); | ||
152 | extern int fib_table_insert(struct fib_table *, struct fib_config *); | ||
153 | extern int fib_table_delete(struct fib_table *, struct fib_config *); | ||
154 | extern int fib_table_dump(struct fib_table *table, struct sk_buff *skb, | ||
155 | struct netlink_callback *cb); | ||
156 | extern int fib_table_flush(struct fib_table *table); | ||
157 | extern void fib_table_select_default(struct fib_table *table, | ||
158 | const struct flowi *flp, | ||
159 | struct fib_result *res); | ||
160 | |||
161 | |||
159 | #ifndef CONFIG_IP_MULTIPLE_TABLES | 162 | #ifndef CONFIG_IP_MULTIPLE_TABLES |
160 | 163 | ||
161 | #define TABLE_LOCAL_INDEX 0 | 164 | #define TABLE_LOCAL_INDEX 0 |
@@ -182,11 +185,11 @@ static inline int fib_lookup(struct net *net, const struct flowi *flp, | |||
182 | struct fib_table *table; | 185 | struct fib_table *table; |
183 | 186 | ||
184 | table = fib_get_table(net, RT_TABLE_LOCAL); | 187 | table = fib_get_table(net, RT_TABLE_LOCAL); |
185 | if (!table->tb_lookup(table, flp, res)) | 188 | if (!fib_table_lookup(table, flp, res)) |
186 | return 0; | 189 | return 0; |
187 | 190 | ||
188 | table = fib_get_table(net, RT_TABLE_MAIN); | 191 | table = fib_get_table(net, RT_TABLE_MAIN); |
189 | if (!table->tb_lookup(table, flp, res)) | 192 | if (!fib_table_lookup(table, flp, res)) |
190 | return 0; | 193 | return 0; |
191 | return -ENETUNREACH; | 194 | return -ENETUNREACH; |
192 | } | 195 | } |
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h index 98978e73f666..8dc3296b7bea 100644 --- a/include/net/ip_vs.h +++ b/include/net/ip_vs.h | |||
@@ -251,8 +251,7 @@ struct ip_vs_estimator { | |||
251 | u32 outbps; | 251 | u32 outbps; |
252 | }; | 252 | }; |
253 | 253 | ||
254 | struct ip_vs_stats | 254 | struct ip_vs_stats { |
255 | { | ||
256 | struct ip_vs_stats_user ustats; /* statistics */ | 255 | struct ip_vs_stats_user ustats; /* statistics */ |
257 | struct ip_vs_estimator est; /* estimator */ | 256 | struct ip_vs_estimator est; /* estimator */ |
258 | 257 | ||
@@ -518,8 +517,7 @@ struct ip_vs_scheduler { | |||
518 | /* | 517 | /* |
519 | * The application module object (a.k.a. app incarnation) | 518 | * The application module object (a.k.a. app incarnation) |
520 | */ | 519 | */ |
521 | struct ip_vs_app | 520 | struct ip_vs_app { |
522 | { | ||
523 | struct list_head a_list; /* member in app list */ | 521 | struct list_head a_list; /* member in app list */ |
524 | int type; /* IP_VS_APP_TYPE_xxx */ | 522 | int type; /* IP_VS_APP_TYPE_xxx */ |
525 | char *name; /* application module name */ | 523 | char *name; /* application module name */ |
diff --git a/include/net/ipip.h b/include/net/ipip.h index 87acf8f3a155..11e8513d2d07 100644 --- a/include/net/ipip.h +++ b/include/net/ipip.h | |||
@@ -7,8 +7,15 @@ | |||
7 | /* Keep error state on tunnel for 30 sec */ | 7 | /* Keep error state on tunnel for 30 sec */ |
8 | #define IPTUNNEL_ERR_TIMEO (30*HZ) | 8 | #define IPTUNNEL_ERR_TIMEO (30*HZ) |
9 | 9 | ||
10 | struct ip_tunnel | 10 | /* 6rd prefix/relay information */ |
11 | { | 11 | struct ip_tunnel_6rd_parm { |
12 | struct in6_addr prefix; | ||
13 | __be32 relay_prefix; | ||
14 | u16 prefixlen; | ||
15 | u16 relay_prefixlen; | ||
16 | }; | ||
17 | |||
18 | struct ip_tunnel { | ||
12 | struct ip_tunnel *next; | 19 | struct ip_tunnel *next; |
13 | struct net_device *dev; | 20 | struct net_device *dev; |
14 | 21 | ||
@@ -23,15 +30,19 @@ struct ip_tunnel | |||
23 | 30 | ||
24 | struct ip_tunnel_parm parms; | 31 | struct ip_tunnel_parm parms; |
25 | 32 | ||
33 | /* for SIT */ | ||
34 | #ifdef CONFIG_IPV6_SIT_6RD | ||
35 | struct ip_tunnel_6rd_parm ip6rd; | ||
36 | #endif | ||
26 | struct ip_tunnel_prl_entry *prl; /* potential router list */ | 37 | struct ip_tunnel_prl_entry *prl; /* potential router list */ |
27 | unsigned int prl_count; /* # of entries in PRL */ | 38 | unsigned int prl_count; /* # of entries in PRL */ |
28 | }; | 39 | }; |
29 | 40 | ||
30 | struct ip_tunnel_prl_entry | 41 | struct ip_tunnel_prl_entry { |
31 | { | ||
32 | struct ip_tunnel_prl_entry *next; | 42 | struct ip_tunnel_prl_entry *next; |
33 | __be32 addr; | 43 | __be32 addr; |
34 | u16 flags; | 44 | u16 flags; |
45 | struct rcu_head rcu_head; | ||
35 | }; | 46 | }; |
36 | 47 | ||
37 | #define IPTUNNEL_XMIT() do { \ | 48 | #define IPTUNNEL_XMIT() do { \ |
@@ -42,9 +53,9 @@ struct ip_tunnel_prl_entry | |||
42 | ip_select_ident(iph, &rt->u.dst, NULL); \ | 53 | ip_select_ident(iph, &rt->u.dst, NULL); \ |
43 | \ | 54 | \ |
44 | err = ip_local_out(skb); \ | 55 | err = ip_local_out(skb); \ |
45 | if (net_xmit_eval(err) == 0) { \ | 56 | if (likely(net_xmit_eval(err) == 0)) { \ |
46 | stats->tx_bytes += pkt_len; \ | 57 | txq->tx_bytes += pkt_len; \ |
47 | stats->tx_packets++; \ | 58 | txq->tx_packets++; \ |
48 | } else { \ | 59 | } else { \ |
49 | stats->tx_errors++; \ | 60 | stats->tx_errors++; \ |
50 | stats->tx_aborted_errors++; \ | 61 | stats->tx_aborted_errors++; \ |
diff --git a/include/net/ipv6.h b/include/net/ipv6.h index 8c31d8a0c1fe..92db8617d188 100644 --- a/include/net/ipv6.h +++ b/include/net/ipv6.h | |||
@@ -160,8 +160,7 @@ extern struct ctl_path net_ipv6_ctl_path[]; | |||
160 | #define ICMP6MSGIN_INC_STATS_BH(net, idev, field) \ | 160 | #define ICMP6MSGIN_INC_STATS_BH(net, idev, field) \ |
161 | _DEVINC(net, icmpv6msg, _BH, idev, field) | 161 | _DEVINC(net, icmpv6msg, _BH, idev, field) |
162 | 162 | ||
163 | struct ip6_ra_chain | 163 | struct ip6_ra_chain { |
164 | { | ||
165 | struct ip6_ra_chain *next; | 164 | struct ip6_ra_chain *next; |
166 | struct sock *sk; | 165 | struct sock *sk; |
167 | int sel; | 166 | int sel; |
@@ -176,8 +175,7 @@ extern rwlock_t ip6_ra_lock; | |||
176 | ancillary data and passed to IPv6. | 175 | ancillary data and passed to IPv6. |
177 | */ | 176 | */ |
178 | 177 | ||
179 | struct ipv6_txoptions | 178 | struct ipv6_txoptions { |
180 | { | ||
181 | /* Length of this structure */ | 179 | /* Length of this structure */ |
182 | int tot_len; | 180 | int tot_len; |
183 | 181 | ||
@@ -194,8 +192,7 @@ struct ipv6_txoptions | |||
194 | /* Option buffer, as read by IPV6_PKTOPTIONS, starts here. */ | 192 | /* Option buffer, as read by IPV6_PKTOPTIONS, starts here. */ |
195 | }; | 193 | }; |
196 | 194 | ||
197 | struct ip6_flowlabel | 195 | struct ip6_flowlabel { |
198 | { | ||
199 | struct ip6_flowlabel *next; | 196 | struct ip6_flowlabel *next; |
200 | __be32 label; | 197 | __be32 label; |
201 | atomic_t users; | 198 | atomic_t users; |
@@ -212,8 +209,7 @@ struct ip6_flowlabel | |||
212 | #define IPV6_FLOWINFO_MASK cpu_to_be32(0x0FFFFFFF) | 209 | #define IPV6_FLOWINFO_MASK cpu_to_be32(0x0FFFFFFF) |
213 | #define IPV6_FLOWLABEL_MASK cpu_to_be32(0x000FFFFF) | 210 | #define IPV6_FLOWLABEL_MASK cpu_to_be32(0x000FFFFF) |
214 | 211 | ||
215 | struct ipv6_fl_socklist | 212 | struct ipv6_fl_socklist { |
216 | { | ||
217 | struct ipv6_fl_socklist *next; | 213 | struct ipv6_fl_socklist *next; |
218 | struct ip6_flowlabel *fl; | 214 | struct ip6_flowlabel *fl; |
219 | }; | 215 | }; |
diff --git a/include/net/iw_handler.h b/include/net/iw_handler.h index e9054a283fde..b2b98f3fa265 100644 --- a/include/net/iw_handler.h +++ b/include/net/iw_handler.h | |||
@@ -300,8 +300,7 @@ | |||
300 | * This struct is also my long term insurance. I can add new fields here | 300 | * This struct is also my long term insurance. I can add new fields here |
301 | * without breaking the prototype of iw_handler... | 301 | * without breaking the prototype of iw_handler... |
302 | */ | 302 | */ |
303 | struct iw_request_info | 303 | struct iw_request_info { |
304 | { | ||
305 | __u16 cmd; /* Wireless Extension command */ | 304 | __u16 cmd; /* Wireless Extension command */ |
306 | __u16 flags; /* More to come ;-) */ | 305 | __u16 flags; /* More to come ;-) */ |
307 | }; | 306 | }; |
@@ -321,20 +320,20 @@ typedef int (*iw_handler)(struct net_device *dev, struct iw_request_info *info, | |||
321 | * shared by all driver instances... Same for the members... | 320 | * shared by all driver instances... Same for the members... |
322 | * This will be linked from net_device in <linux/netdevice.h> | 321 | * This will be linked from net_device in <linux/netdevice.h> |
323 | */ | 322 | */ |
324 | struct iw_handler_def | 323 | struct iw_handler_def { |
325 | { | ||
326 | /* Number of handlers defined (more precisely, index of the | ||
327 | * last defined handler + 1) */ | ||
328 | __u16 num_standard; | ||
329 | __u16 num_private; | ||
330 | /* Number of private arg description */ | ||
331 | __u16 num_private_args; | ||
332 | 324 | ||
333 | /* Array of handlers for standard ioctls | 325 | /* Array of handlers for standard ioctls |
334 | * We will call dev->wireless_handlers->standard[ioctl - SIOCSIWCOMMIT] | 326 | * We will call dev->wireless_handlers->standard[ioctl - SIOCSIWCOMMIT] |
335 | */ | 327 | */ |
336 | const iw_handler * standard; | 328 | const iw_handler * standard; |
329 | /* Number of handlers defined (more precisely, index of the | ||
330 | * last defined handler + 1) */ | ||
331 | __u16 num_standard; | ||
337 | 332 | ||
333 | #ifdef CONFIG_WEXT_PRIV | ||
334 | __u16 num_private; | ||
335 | /* Number of private arg description */ | ||
336 | __u16 num_private_args; | ||
338 | /* Array of handlers for private ioctls | 337 | /* Array of handlers for private ioctls |
339 | * Will call dev->wireless_handlers->private[ioctl - SIOCIWFIRSTPRIV] | 338 | * Will call dev->wireless_handlers->private[ioctl - SIOCIWFIRSTPRIV] |
340 | */ | 339 | */ |
@@ -344,6 +343,7 @@ struct iw_handler_def | |||
344 | * can put it in any order you want and should not leave holes... | 343 | * can put it in any order you want and should not leave holes... |
345 | * We will automatically export that to user space... */ | 344 | * We will automatically export that to user space... */ |
346 | const struct iw_priv_args * private_args; | 345 | const struct iw_priv_args * private_args; |
346 | #endif | ||
347 | 347 | ||
348 | /* New location of get_wireless_stats, to de-bloat struct net_device. | 348 | /* New location of get_wireless_stats, to de-bloat struct net_device. |
349 | * The old pointer in struct net_device will be gradually phased | 349 | * The old pointer in struct net_device will be gradually phased |
@@ -370,8 +370,7 @@ struct iw_handler_def | |||
370 | /* | 370 | /* |
371 | * Describe how a standard IOCTL looks like. | 371 | * Describe how a standard IOCTL looks like. |
372 | */ | 372 | */ |
373 | struct iw_ioctl_description | 373 | struct iw_ioctl_description { |
374 | { | ||
375 | __u8 header_type; /* NULL, iw_point or other */ | 374 | __u8 header_type; /* NULL, iw_point or other */ |
376 | __u8 token_type; /* Future */ | 375 | __u8 token_type; /* Future */ |
377 | __u16 token_size; /* Granularity of payload */ | 376 | __u16 token_size; /* Granularity of payload */ |
@@ -393,8 +392,7 @@ struct iw_ioctl_description | |||
393 | /* | 392 | /* |
394 | * Instance specific spy data, i.e. addresses spied and quality for them. | 393 | * Instance specific spy data, i.e. addresses spied and quality for them. |
395 | */ | 394 | */ |
396 | struct iw_spy_data | 395 | struct iw_spy_data { |
397 | { | ||
398 | /* --- Standard spy support --- */ | 396 | /* --- Standard spy support --- */ |
399 | int spy_number; | 397 | int spy_number; |
400 | u_char spy_address[IW_MAX_SPY][ETH_ALEN]; | 398 | u_char spy_address[IW_MAX_SPY][ETH_ALEN]; |
diff --git a/include/net/mac80211.h b/include/net/mac80211.h index 998c30fc8981..2aff4906b2ae 100644 --- a/include/net/mac80211.h +++ b/include/net/mac80211.h | |||
@@ -219,7 +219,7 @@ struct ieee80211_bss_conf { | |||
219 | * | 219 | * |
220 | * These flags are used with the @flags member of &ieee80211_tx_info. | 220 | * These flags are used with the @flags member of &ieee80211_tx_info. |
221 | * | 221 | * |
222 | * @IEEE80211_TX_CTL_REQ_TX_STATUS: request TX status callback for this frame. | 222 | * @IEEE80211_TX_CTL_REQ_TX_STATUS: require TX status callback for this frame. |
223 | * @IEEE80211_TX_CTL_ASSIGN_SEQ: The driver has to assign a sequence | 223 | * @IEEE80211_TX_CTL_ASSIGN_SEQ: The driver has to assign a sequence |
224 | * number to this frame, taking care of not overwriting the fragment | 224 | * number to this frame, taking care of not overwriting the fragment |
225 | * number and increasing the sequence number only when the | 225 | * number and increasing the sequence number only when the |
@@ -390,10 +390,12 @@ struct ieee80211_tx_rate { | |||
390 | * @control: union for control data | 390 | * @control: union for control data |
391 | * @status: union for status data | 391 | * @status: union for status data |
392 | * @driver_data: array of driver_data pointers | 392 | * @driver_data: array of driver_data pointers |
393 | * @ampdu_ack_len: number of aggregated frames. | 393 | * @ampdu_ack_len: number of acked aggregated frames. |
394 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | 394 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. |
395 | * @ampdu_ack_map: block ack bit map for the aggregation. | 395 | * @ampdu_ack_map: block ack bit map for the aggregation. |
396 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | 396 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. |
397 | * @ampdu_len: number of aggregated frames. | ||
398 | * relevant only if IEEE80211_TX_STATUS_AMPDU was set. | ||
397 | * @ack_signal: signal strength of the ACK frame | 399 | * @ack_signal: signal strength of the ACK frame |
398 | */ | 400 | */ |
399 | struct ieee80211_tx_info { | 401 | struct ieee80211_tx_info { |
@@ -428,7 +430,8 @@ struct ieee80211_tx_info { | |||
428 | u8 ampdu_ack_len; | 430 | u8 ampdu_ack_len; |
429 | u64 ampdu_ack_map; | 431 | u64 ampdu_ack_map; |
430 | int ack_signal; | 432 | int ack_signal; |
431 | /* 8 bytes free */ | 433 | u8 ampdu_len; |
434 | /* 7 bytes free */ | ||
432 | } status; | 435 | } status; |
433 | struct { | 436 | struct { |
434 | struct ieee80211_tx_rate driver_rates[ | 437 | struct ieee80211_tx_rate driver_rates[ |
@@ -494,7 +497,6 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info) | |||
494 | * @RX_FLAG_MMIC_ERROR: Michael MIC error was reported on this frame. | 497 | * @RX_FLAG_MMIC_ERROR: Michael MIC error was reported on this frame. |
495 | * Use together with %RX_FLAG_MMIC_STRIPPED. | 498 | * Use together with %RX_FLAG_MMIC_STRIPPED. |
496 | * @RX_FLAG_DECRYPTED: This frame was decrypted in hardware. | 499 | * @RX_FLAG_DECRYPTED: This frame was decrypted in hardware. |
497 | * @RX_FLAG_RADIOTAP: This frame starts with a radiotap header. | ||
498 | * @RX_FLAG_MMIC_STRIPPED: the Michael MIC is stripped off this frame, | 500 | * @RX_FLAG_MMIC_STRIPPED: the Michael MIC is stripped off this frame, |
499 | * verification has been done by the hardware. | 501 | * verification has been done by the hardware. |
500 | * @RX_FLAG_IV_STRIPPED: The IV/ICV are stripped from this frame. | 502 | * @RX_FLAG_IV_STRIPPED: The IV/ICV are stripped from this frame. |
@@ -511,11 +513,13 @@ ieee80211_tx_info_clear_status(struct ieee80211_tx_info *info) | |||
511 | * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index | 513 | * @RX_FLAG_HT: HT MCS was used and rate_idx is MCS index |
512 | * @RX_FLAG_40MHZ: HT40 (40 MHz) was used | 514 | * @RX_FLAG_40MHZ: HT40 (40 MHz) was used |
513 | * @RX_FLAG_SHORT_GI: Short guard interval was used | 515 | * @RX_FLAG_SHORT_GI: Short guard interval was used |
516 | * @RX_FLAG_INTERNAL_CMTR: set internally after frame was reported | ||
517 | * on cooked monitor to avoid double-reporting it for multiple | ||
518 | * virtual interfaces | ||
514 | */ | 519 | */ |
515 | enum mac80211_rx_flags { | 520 | enum mac80211_rx_flags { |
516 | RX_FLAG_MMIC_ERROR = 1<<0, | 521 | RX_FLAG_MMIC_ERROR = 1<<0, |
517 | RX_FLAG_DECRYPTED = 1<<1, | 522 | RX_FLAG_DECRYPTED = 1<<1, |
518 | RX_FLAG_RADIOTAP = 1<<2, | ||
519 | RX_FLAG_MMIC_STRIPPED = 1<<3, | 523 | RX_FLAG_MMIC_STRIPPED = 1<<3, |
520 | RX_FLAG_IV_STRIPPED = 1<<4, | 524 | RX_FLAG_IV_STRIPPED = 1<<4, |
521 | RX_FLAG_FAILED_FCS_CRC = 1<<5, | 525 | RX_FLAG_FAILED_FCS_CRC = 1<<5, |
@@ -525,6 +529,7 @@ enum mac80211_rx_flags { | |||
525 | RX_FLAG_HT = 1<<9, | 529 | RX_FLAG_HT = 1<<9, |
526 | RX_FLAG_40MHZ = 1<<10, | 530 | RX_FLAG_40MHZ = 1<<10, |
527 | RX_FLAG_SHORT_GI = 1<<11, | 531 | RX_FLAG_SHORT_GI = 1<<11, |
532 | RX_FLAG_INTERNAL_CMTR = 1<<12, | ||
528 | }; | 533 | }; |
529 | 534 | ||
530 | /** | 535 | /** |
@@ -554,7 +559,7 @@ struct ieee80211_rx_status { | |||
554 | int freq; | 559 | int freq; |
555 | int signal; | 560 | int signal; |
556 | int noise; | 561 | int noise; |
557 | int qual; | 562 | int __deprecated qual; |
558 | int antenna; | 563 | int antenna; |
559 | int rate_idx; | 564 | int rate_idx; |
560 | int flag; | 565 | int flag; |
@@ -565,7 +570,9 @@ struct ieee80211_rx_status { | |||
565 | * | 570 | * |
566 | * Flags to define PHY configuration options | 571 | * Flags to define PHY configuration options |
567 | * | 572 | * |
568 | * @IEEE80211_CONF_RADIOTAP: add radiotap header at receive time (if supported) | 573 | * @IEEE80211_CONF_MONITOR: there's a monitor interface present -- use this |
574 | * to determine for example whether to calculate timestamps for packets | ||
575 | * or not, do not use instead of filter flags! | ||
569 | * @IEEE80211_CONF_PS: Enable 802.11 power save mode (managed mode only) | 576 | * @IEEE80211_CONF_PS: Enable 802.11 power save mode (managed mode only) |
570 | * @IEEE80211_CONF_IDLE: The device is running, but idle; if the flag is set | 577 | * @IEEE80211_CONF_IDLE: The device is running, but idle; if the flag is set |
571 | * the driver should be prepared to handle configuration requests but | 578 | * the driver should be prepared to handle configuration requests but |
@@ -574,7 +581,7 @@ struct ieee80211_rx_status { | |||
574 | * it can also be unset in that case when monitor interfaces are active. | 581 | * it can also be unset in that case when monitor interfaces are active. |
575 | */ | 582 | */ |
576 | enum ieee80211_conf_flags { | 583 | enum ieee80211_conf_flags { |
577 | IEEE80211_CONF_RADIOTAP = (1<<0), | 584 | IEEE80211_CONF_MONITOR = (1<<0), |
578 | IEEE80211_CONF_PS = (1<<1), | 585 | IEEE80211_CONF_PS = (1<<1), |
579 | IEEE80211_CONF_IDLE = (1<<2), | 586 | IEEE80211_CONF_IDLE = (1<<2), |
580 | }; | 587 | }; |
@@ -584,7 +591,7 @@ enum ieee80211_conf_flags { | |||
584 | * enum ieee80211_conf_changed - denotes which configuration changed | 591 | * enum ieee80211_conf_changed - denotes which configuration changed |
585 | * | 592 | * |
586 | * @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed | 593 | * @IEEE80211_CONF_CHANGE_LISTEN_INTERVAL: the listen interval changed |
587 | * @IEEE80211_CONF_CHANGE_RADIOTAP: the radiotap flag changed | 594 | * @IEEE80211_CONF_CHANGE_MONITOR: the monitor flag changed |
588 | * @IEEE80211_CONF_CHANGE_PS: the PS flag or dynamic PS timeout changed | 595 | * @IEEE80211_CONF_CHANGE_PS: the PS flag or dynamic PS timeout changed |
589 | * @IEEE80211_CONF_CHANGE_POWER: the TX power changed | 596 | * @IEEE80211_CONF_CHANGE_POWER: the TX power changed |
590 | * @IEEE80211_CONF_CHANGE_CHANNEL: the channel/channel_type changed | 597 | * @IEEE80211_CONF_CHANGE_CHANNEL: the channel/channel_type changed |
@@ -593,7 +600,7 @@ enum ieee80211_conf_flags { | |||
593 | */ | 600 | */ |
594 | enum ieee80211_conf_changed { | 601 | enum ieee80211_conf_changed { |
595 | IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2), | 602 | IEEE80211_CONF_CHANGE_LISTEN_INTERVAL = BIT(2), |
596 | IEEE80211_CONF_CHANGE_RADIOTAP = BIT(3), | 603 | IEEE80211_CONF_CHANGE_MONITOR = BIT(3), |
597 | IEEE80211_CONF_CHANGE_PS = BIT(4), | 604 | IEEE80211_CONF_CHANGE_PS = BIT(4), |
598 | IEEE80211_CONF_CHANGE_POWER = BIT(5), | 605 | IEEE80211_CONF_CHANGE_POWER = BIT(5), |
599 | IEEE80211_CONF_CHANGE_CHANNEL = BIT(6), | 606 | IEEE80211_CONF_CHANGE_CHANNEL = BIT(6), |
@@ -852,6 +859,19 @@ enum ieee80211_tkip_key_type { | |||
852 | * any particular flags. There are some exceptions to this rule, | 859 | * any particular flags. There are some exceptions to this rule, |
853 | * however, so you are advised to review these flags carefully. | 860 | * however, so you are advised to review these flags carefully. |
854 | * | 861 | * |
862 | * @IEEE80211_HW_HAS_RATE_CONTROL: | ||
863 | * The hardware or firmware includes rate control, and cannot be | ||
864 | * controlled by the stack. As such, no rate control algorithm | ||
865 | * should be instantiated, and the TX rate reported to userspace | ||
866 | * will be taken from the TX status instead of the rate control | ||
867 | * algorithm. | ||
868 | * Note that this requires that the driver implement a number of | ||
869 | * callbacks so it has the correct information, it needs to have | ||
870 | * the @set_rts_threshold callback and must look at the BSS config | ||
871 | * @use_cts_prot for G/N protection, @use_short_slot for slot | ||
872 | * timing in 2.4 GHz and @use_short_preamble for preambles for | ||
873 | * CCK frames. | ||
874 | * | ||
855 | * @IEEE80211_HW_RX_INCLUDES_FCS: | 875 | * @IEEE80211_HW_RX_INCLUDES_FCS: |
856 | * Indicates that received frames passed to the stack include | 876 | * Indicates that received frames passed to the stack include |
857 | * the FCS at the end. | 877 | * the FCS at the end. |
@@ -910,6 +930,7 @@ enum ieee80211_tkip_key_type { | |||
910 | * avoid waking up cpu. | 930 | * avoid waking up cpu. |
911 | */ | 931 | */ |
912 | enum ieee80211_hw_flags { | 932 | enum ieee80211_hw_flags { |
933 | IEEE80211_HW_HAS_RATE_CONTROL = 1<<0, | ||
913 | IEEE80211_HW_RX_INCLUDES_FCS = 1<<1, | 934 | IEEE80211_HW_RX_INCLUDES_FCS = 1<<1, |
914 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2, | 935 | IEEE80211_HW_HOST_BROADCAST_PS_BUFFERING = 1<<2, |
915 | IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3, | 936 | IEEE80211_HW_2GHZ_SHORT_SLOT_INCAPABLE = 1<<3, |
@@ -1511,6 +1532,7 @@ struct ieee80211_ops { | |||
1511 | void (*reset_tsf)(struct ieee80211_hw *hw); | 1532 | void (*reset_tsf)(struct ieee80211_hw *hw); |
1512 | int (*tx_last_beacon)(struct ieee80211_hw *hw); | 1533 | int (*tx_last_beacon)(struct ieee80211_hw *hw); |
1513 | int (*ampdu_action)(struct ieee80211_hw *hw, | 1534 | int (*ampdu_action)(struct ieee80211_hw *hw, |
1535 | struct ieee80211_vif *vif, | ||
1514 | enum ieee80211_ampdu_mlme_action action, | 1536 | enum ieee80211_ampdu_mlme_action action, |
1515 | struct ieee80211_sta *sta, u16 tid, u16 *ssn); | 1537 | struct ieee80211_sta *sta, u16 tid, u16 *ssn); |
1516 | 1538 | ||
@@ -1667,15 +1689,14 @@ void ieee80211_restart_hw(struct ieee80211_hw *hw); | |||
1667 | * ieee80211_rx - receive frame | 1689 | * ieee80211_rx - receive frame |
1668 | * | 1690 | * |
1669 | * Use this function to hand received frames to mac80211. The receive | 1691 | * Use this function to hand received frames to mac80211. The receive |
1670 | * buffer in @skb must start with an IEEE 802.11 header or a radiotap | 1692 | * buffer in @skb must start with an IEEE 802.11 header. |
1671 | * header if %RX_FLAG_RADIOTAP is set in the @status flags. | ||
1672 | * | 1693 | * |
1673 | * This function may not be called in IRQ context. Calls to this function | 1694 | * This function may not be called in IRQ context. Calls to this function |
1674 | * for a single hardware must be synchronized against each other. Calls | 1695 | * for a single hardware must be synchronized against each other. Calls to |
1675 | * to this function and ieee80211_rx_irqsafe() may not be mixed for a | 1696 | * this function, ieee80211_rx_ni() and ieee80211_rx_irqsafe() may not be |
1676 | * single hardware. | 1697 | * mixed for a single hardware. |
1677 | * | 1698 | * |
1678 | * Note that right now, this function must be called with softirqs disabled. | 1699 | * In process context use instead ieee80211_rx_ni(). |
1679 | * | 1700 | * |
1680 | * @hw: the hardware this frame came in on | 1701 | * @hw: the hardware this frame came in on |
1681 | * @skb: the buffer to receive, owned by mac80211 after this call | 1702 | * @skb: the buffer to receive, owned by mac80211 after this call |
@@ -1688,8 +1709,8 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb); | |||
1688 | * Like ieee80211_rx() but can be called in IRQ context | 1709 | * Like ieee80211_rx() but can be called in IRQ context |
1689 | * (internally defers to a tasklet.) | 1710 | * (internally defers to a tasklet.) |
1690 | * | 1711 | * |
1691 | * Calls to this function and ieee80211_rx() may not be mixed for a | 1712 | * Calls to this function, ieee80211_rx() or ieee80211_rx_ni() may not |
1692 | * single hardware. | 1713 | * be mixed for a single hardware. |
1693 | * | 1714 | * |
1694 | * @hw: the hardware this frame came in on | 1715 | * @hw: the hardware this frame came in on |
1695 | * @skb: the buffer to receive, owned by mac80211 after this call | 1716 | * @skb: the buffer to receive, owned by mac80211 after this call |
@@ -1697,6 +1718,26 @@ void ieee80211_rx(struct ieee80211_hw *hw, struct sk_buff *skb); | |||
1697 | void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb); | 1718 | void ieee80211_rx_irqsafe(struct ieee80211_hw *hw, struct sk_buff *skb); |
1698 | 1719 | ||
1699 | /** | 1720 | /** |
1721 | * ieee80211_rx_ni - receive frame (in process context) | ||
1722 | * | ||
1723 | * Like ieee80211_rx() but can be called in process context | ||
1724 | * (internally disables bottom halves). | ||
1725 | * | ||
1726 | * Calls to this function, ieee80211_rx() and ieee80211_rx_irqsafe() may | ||
1727 | * not be mixed for a single hardware. | ||
1728 | * | ||
1729 | * @hw: the hardware this frame came in on | ||
1730 | * @skb: the buffer to receive, owned by mac80211 after this call | ||
1731 | */ | ||
1732 | static inline void ieee80211_rx_ni(struct ieee80211_hw *hw, | ||
1733 | struct sk_buff *skb) | ||
1734 | { | ||
1735 | local_bh_disable(); | ||
1736 | ieee80211_rx(hw, skb); | ||
1737 | local_bh_enable(); | ||
1738 | } | ||
1739 | |||
1740 | /** | ||
1700 | * ieee80211_tx_status - transmit status callback | 1741 | * ieee80211_tx_status - transmit status callback |
1701 | * | 1742 | * |
1702 | * Call this function for all transmitted frames after they have been | 1743 | * Call this function for all transmitted frames after they have been |
@@ -1730,19 +1771,45 @@ void ieee80211_tx_status_irqsafe(struct ieee80211_hw *hw, | |||
1730 | struct sk_buff *skb); | 1771 | struct sk_buff *skb); |
1731 | 1772 | ||
1732 | /** | 1773 | /** |
1733 | * ieee80211_beacon_get - beacon generation function | 1774 | * ieee80211_beacon_get_tim - beacon generation function |
1734 | * @hw: pointer obtained from ieee80211_alloc_hw(). | 1775 | * @hw: pointer obtained from ieee80211_alloc_hw(). |
1735 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | 1776 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. |
1777 | * @tim_offset: pointer to variable that will receive the TIM IE offset. | ||
1778 | * Set to 0 if invalid (in non-AP modes). | ||
1779 | * @tim_length: pointer to variable that will receive the TIM IE length, | ||
1780 | * (including the ID and length bytes!). | ||
1781 | * Set to 0 if invalid (in non-AP modes). | ||
1782 | * | ||
1783 | * If the driver implements beaconing modes, it must use this function to | ||
1784 | * obtain the beacon frame/template. | ||
1736 | * | 1785 | * |
1737 | * If the beacon frames are generated by the host system (i.e., not in | 1786 | * If the beacon frames are generated by the host system (i.e., not in |
1738 | * hardware/firmware), the low-level driver uses this function to receive | 1787 | * hardware/firmware), the driver uses this function to get each beacon |
1739 | * the next beacon frame from the 802.11 code. The low-level is responsible | 1788 | * frame from mac80211 -- it is responsible for calling this function |
1740 | * for calling this function before beacon data is needed (e.g., based on | 1789 | * before the beacon is needed (e.g. based on hardware interrupt). |
1741 | * hardware interrupt). Returned skb is used only once and low-level driver | 1790 | * |
1742 | * is responsible for freeing it. | 1791 | * If the beacon frames are generated by the device, then the driver |
1792 | * must use the returned beacon as the template and change the TIM IE | ||
1793 | * according to the current DTIM parameters/TIM bitmap. | ||
1794 | * | ||
1795 | * The driver is responsible for freeing the returned skb. | ||
1743 | */ | 1796 | */ |
1744 | struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, | 1797 | struct sk_buff *ieee80211_beacon_get_tim(struct ieee80211_hw *hw, |
1745 | struct ieee80211_vif *vif); | 1798 | struct ieee80211_vif *vif, |
1799 | u16 *tim_offset, u16 *tim_length); | ||
1800 | |||
1801 | /** | ||
1802 | * ieee80211_beacon_get - beacon generation function | ||
1803 | * @hw: pointer obtained from ieee80211_alloc_hw(). | ||
1804 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | ||
1805 | * | ||
1806 | * See ieee80211_beacon_get_tim(). | ||
1807 | */ | ||
1808 | static inline struct sk_buff *ieee80211_beacon_get(struct ieee80211_hw *hw, | ||
1809 | struct ieee80211_vif *vif) | ||
1810 | { | ||
1811 | return ieee80211_beacon_get_tim(hw, vif, NULL, NULL); | ||
1812 | } | ||
1746 | 1813 | ||
1747 | /** | 1814 | /** |
1748 | * ieee80211_rts_get - RTS frame generation function | 1815 | * ieee80211_rts_get - RTS frame generation function |
@@ -1987,8 +2054,7 @@ void ieee80211_queue_delayed_work(struct ieee80211_hw *hw, | |||
1987 | 2054 | ||
1988 | /** | 2055 | /** |
1989 | * ieee80211_start_tx_ba_session - Start a tx Block Ack session. | 2056 | * ieee80211_start_tx_ba_session - Start a tx Block Ack session. |
1990 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | 2057 | * @sta: the station for which to start a BA session |
1991 | * @ra: receiver address of the BA session recipient | ||
1992 | * @tid: the TID to BA on. | 2058 | * @tid: the TID to BA on. |
1993 | * | 2059 | * |
1994 | * Return: success if addBA request was sent, failure otherwise | 2060 | * Return: success if addBA request was sent, failure otherwise |
@@ -1997,22 +2063,22 @@ void ieee80211_queue_delayed_work(struct ieee80211_hw *hw, | |||
1997 | * the need to start aggregation on a certain RA/TID, the session level | 2063 | * the need to start aggregation on a certain RA/TID, the session level |
1998 | * will be managed by the mac80211. | 2064 | * will be managed by the mac80211. |
1999 | */ | 2065 | */ |
2000 | int ieee80211_start_tx_ba_session(struct ieee80211_hw *hw, u8 *ra, u16 tid); | 2066 | int ieee80211_start_tx_ba_session(struct ieee80211_sta *sta, u16 tid); |
2001 | 2067 | ||
2002 | /** | 2068 | /** |
2003 | * ieee80211_start_tx_ba_cb - low level driver ready to aggregate. | 2069 | * ieee80211_start_tx_ba_cb - low level driver ready to aggregate. |
2004 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | 2070 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf |
2005 | * @ra: receiver address of the BA session recipient. | 2071 | * @ra: receiver address of the BA session recipient. |
2006 | * @tid: the TID to BA on. | 2072 | * @tid: the TID to BA on. |
2007 | * | 2073 | * |
2008 | * This function must be called by low level driver once it has | 2074 | * This function must be called by low level driver once it has |
2009 | * finished with preparations for the BA session. | 2075 | * finished with preparations for the BA session. |
2010 | */ | 2076 | */ |
2011 | void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid); | 2077 | void ieee80211_start_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u16 tid); |
2012 | 2078 | ||
2013 | /** | 2079 | /** |
2014 | * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. | 2080 | * ieee80211_start_tx_ba_cb_irqsafe - low level driver ready to aggregate. |
2015 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | 2081 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf |
2016 | * @ra: receiver address of the BA session recipient. | 2082 | * @ra: receiver address of the BA session recipient. |
2017 | * @tid: the TID to BA on. | 2083 | * @tid: the TID to BA on. |
2018 | * | 2084 | * |
@@ -2020,13 +2086,12 @@ void ieee80211_start_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u16 tid); | |||
2020 | * finished with preparations for the BA session. | 2086 | * finished with preparations for the BA session. |
2021 | * This version of the function is IRQ-safe. | 2087 | * This version of the function is IRQ-safe. |
2022 | */ | 2088 | */ |
2023 | void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, | 2089 | void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, const u8 *ra, |
2024 | u16 tid); | 2090 | u16 tid); |
2025 | 2091 | ||
2026 | /** | 2092 | /** |
2027 | * ieee80211_stop_tx_ba_session - Stop a Block Ack session. | 2093 | * ieee80211_stop_tx_ba_session - Stop a Block Ack session. |
2028 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | 2094 | * @sta: the station whose BA session to stop |
2029 | * @ra: receiver address of the BA session recipient | ||
2030 | * @tid: the TID to stop BA. | 2095 | * @tid: the TID to stop BA. |
2031 | * @initiator: if indicates initiator DELBA frame will be sent. | 2096 | * @initiator: if indicates initiator DELBA frame will be sent. |
2032 | * | 2097 | * |
@@ -2036,24 +2101,23 @@ void ieee80211_start_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, | |||
2036 | * the need to stop aggregation on a certain RA/TID, the session level | 2101 | * the need to stop aggregation on a certain RA/TID, the session level |
2037 | * will be managed by the mac80211. | 2102 | * will be managed by the mac80211. |
2038 | */ | 2103 | */ |
2039 | int ieee80211_stop_tx_ba_session(struct ieee80211_hw *hw, | 2104 | int ieee80211_stop_tx_ba_session(struct ieee80211_sta *sta, u16 tid, |
2040 | u8 *ra, u16 tid, | ||
2041 | enum ieee80211_back_parties initiator); | 2105 | enum ieee80211_back_parties initiator); |
2042 | 2106 | ||
2043 | /** | 2107 | /** |
2044 | * ieee80211_stop_tx_ba_cb - low level driver ready to stop aggregate. | 2108 | * ieee80211_stop_tx_ba_cb - low level driver ready to stop aggregate. |
2045 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | 2109 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf |
2046 | * @ra: receiver address of the BA session recipient. | 2110 | * @ra: receiver address of the BA session recipient. |
2047 | * @tid: the desired TID to BA on. | 2111 | * @tid: the desired TID to BA on. |
2048 | * | 2112 | * |
2049 | * This function must be called by low level driver once it has | 2113 | * This function must be called by low level driver once it has |
2050 | * finished with preparations for the BA session tear down. | 2114 | * finished with preparations for the BA session tear down. |
2051 | */ | 2115 | */ |
2052 | void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid); | 2116 | void ieee80211_stop_tx_ba_cb(struct ieee80211_vif *vif, u8 *ra, u8 tid); |
2053 | 2117 | ||
2054 | /** | 2118 | /** |
2055 | * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate. | 2119 | * ieee80211_stop_tx_ba_cb_irqsafe - low level driver ready to stop aggregate. |
2056 | * @hw: pointer as obtained from ieee80211_alloc_hw(). | 2120 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf |
2057 | * @ra: receiver address of the BA session recipient. | 2121 | * @ra: receiver address of the BA session recipient. |
2058 | * @tid: the desired TID to BA on. | 2122 | * @tid: the desired TID to BA on. |
2059 | * | 2123 | * |
@@ -2061,22 +2125,75 @@ void ieee80211_stop_tx_ba_cb(struct ieee80211_hw *hw, u8 *ra, u8 tid); | |||
2061 | * finished with preparations for the BA session tear down. | 2125 | * finished with preparations for the BA session tear down. |
2062 | * This version of the function is IRQ-safe. | 2126 | * This version of the function is IRQ-safe. |
2063 | */ | 2127 | */ |
2064 | void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_hw *hw, const u8 *ra, | 2128 | void ieee80211_stop_tx_ba_cb_irqsafe(struct ieee80211_vif *vif, const u8 *ra, |
2065 | u16 tid); | 2129 | u16 tid); |
2066 | 2130 | ||
2067 | /** | 2131 | /** |
2068 | * ieee80211_find_sta - find a station | 2132 | * ieee80211_find_sta - find a station |
2069 | * | 2133 | * |
2070 | * @hw: pointer as obtained from ieee80211_alloc_hw() | 2134 | * @vif: virtual interface to look for station on |
2071 | * @addr: station's address | 2135 | * @addr: station's address |
2072 | * | 2136 | * |
2073 | * This function must be called under RCU lock and the | 2137 | * This function must be called under RCU lock and the |
2074 | * resulting pointer is only valid under RCU lock as well. | 2138 | * resulting pointer is only valid under RCU lock as well. |
2075 | */ | 2139 | */ |
2076 | struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_hw *hw, | 2140 | struct ieee80211_sta *ieee80211_find_sta(struct ieee80211_vif *vif, |
2077 | const u8 *addr); | 2141 | const u8 *addr); |
2078 | 2142 | ||
2079 | /** | 2143 | /** |
2144 | * ieee80211_find_sta_by_hw - find a station on hardware | ||
2145 | * | ||
2146 | * @hw: pointer as obtained from ieee80211_alloc_hw() | ||
2147 | * @addr: station's address | ||
2148 | * | ||
2149 | * This function must be called under RCU lock and the | ||
2150 | * resulting pointer is only valid under RCU lock as well. | ||
2151 | * | ||
2152 | * NOTE: This function should not be used! When mac80211 is converted | ||
2153 | * internally to properly keep track of stations on multiple | ||
2154 | * virtual interfaces, it will not always know which station to | ||
2155 | * return here since a single address might be used by multiple | ||
2156 | * logical stations (e.g. consider a station connecting to another | ||
2157 | * BSSID on the same AP hardware without disconnecting first). | ||
2158 | * | ||
2159 | * DO NOT USE THIS FUNCTION. | ||
2160 | */ | ||
2161 | struct ieee80211_sta *ieee80211_find_sta_by_hw(struct ieee80211_hw *hw, | ||
2162 | const u8 *addr); | ||
2163 | |||
2164 | /** | ||
2165 | * ieee80211_sta_block_awake - block station from waking up | ||
2166 | * @hw: the hardware | ||
2167 | * @pubsta: the station | ||
2168 | * @block: whether to block or unblock | ||
2169 | * | ||
2170 | * Some devices require that all frames that are on the queues | ||
2171 | * for a specific station that went to sleep are flushed before | ||
2172 | * a poll response or frames after the station woke up can be | ||
2173 | * delivered to that it. Note that such frames must be rejected | ||
2174 | * by the driver as filtered, with the appropriate status flag. | ||
2175 | * | ||
2176 | * This function allows implementing this mode in a race-free | ||
2177 | * manner. | ||
2178 | * | ||
2179 | * To do this, a driver must keep track of the number of frames | ||
2180 | * still enqueued for a specific station. If this number is not | ||
2181 | * zero when the station goes to sleep, the driver must call | ||
2182 | * this function to force mac80211 to consider the station to | ||
2183 | * be asleep regardless of the station's actual state. Once the | ||
2184 | * number of outstanding frames reaches zero, the driver must | ||
2185 | * call this function again to unblock the station. That will | ||
2186 | * cause mac80211 to be able to send ps-poll responses, and if | ||
2187 | * the station queried in the meantime then frames will also | ||
2188 | * be sent out as a result of this. Additionally, the driver | ||
2189 | * will be notified that the station woke up some time after | ||
2190 | * it is unblocked, regardless of whether the station actually | ||
2191 | * woke up while blocked or not. | ||
2192 | */ | ||
2193 | void ieee80211_sta_block_awake(struct ieee80211_hw *hw, | ||
2194 | struct ieee80211_sta *pubsta, bool block); | ||
2195 | |||
2196 | /** | ||
2080 | * ieee80211_beacon_loss - inform hardware does not receive beacons | 2197 | * ieee80211_beacon_loss - inform hardware does not receive beacons |
2081 | * | 2198 | * |
2082 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. | 2199 | * @vif: &struct ieee80211_vif pointer from &struct ieee80211_if_init_conf. |
diff --git a/include/net/neighbour.h b/include/net/neighbour.h index 3817fda82a80..0302f31a2fb7 100644 --- a/include/net/neighbour.h +++ b/include/net/neighbour.h | |||
@@ -37,8 +37,7 @@ | |||
37 | 37 | ||
38 | struct neighbour; | 38 | struct neighbour; |
39 | 39 | ||
40 | struct neigh_parms | 40 | struct neigh_parms { |
41 | { | ||
42 | #ifdef CONFIG_NET_NS | 41 | #ifdef CONFIG_NET_NS |
43 | struct net *net; | 42 | struct net *net; |
44 | #endif | 43 | #endif |
@@ -70,8 +69,7 @@ struct neigh_parms | |||
70 | int locktime; | 69 | int locktime; |
71 | }; | 70 | }; |
72 | 71 | ||
73 | struct neigh_statistics | 72 | struct neigh_statistics { |
74 | { | ||
75 | unsigned long allocs; /* number of allocated neighs */ | 73 | unsigned long allocs; /* number of allocated neighs */ |
76 | unsigned long destroys; /* number of destroyed neighs */ | 74 | unsigned long destroys; /* number of destroyed neighs */ |
77 | unsigned long hash_grows; /* number of hash resizes */ | 75 | unsigned long hash_grows; /* number of hash resizes */ |
@@ -97,8 +95,7 @@ struct neigh_statistics | |||
97 | preempt_enable(); \ | 95 | preempt_enable(); \ |
98 | } while (0) | 96 | } while (0) |
99 | 97 | ||
100 | struct neighbour | 98 | struct neighbour { |
101 | { | ||
102 | struct neighbour *next; | 99 | struct neighbour *next; |
103 | struct neigh_table *tbl; | 100 | struct neigh_table *tbl; |
104 | struct neigh_parms *parms; | 101 | struct neigh_parms *parms; |
@@ -122,8 +119,7 @@ struct neighbour | |||
122 | u8 primary_key[0]; | 119 | u8 primary_key[0]; |
123 | }; | 120 | }; |
124 | 121 | ||
125 | struct neigh_ops | 122 | struct neigh_ops { |
126 | { | ||
127 | int family; | 123 | int family; |
128 | void (*solicit)(struct neighbour *, struct sk_buff*); | 124 | void (*solicit)(struct neighbour *, struct sk_buff*); |
129 | void (*error_report)(struct neighbour *, struct sk_buff*); | 125 | void (*error_report)(struct neighbour *, struct sk_buff*); |
@@ -133,8 +129,7 @@ struct neigh_ops | |||
133 | int (*queue_xmit)(struct sk_buff*); | 129 | int (*queue_xmit)(struct sk_buff*); |
134 | }; | 130 | }; |
135 | 131 | ||
136 | struct pneigh_entry | 132 | struct pneigh_entry { |
137 | { | ||
138 | struct pneigh_entry *next; | 133 | struct pneigh_entry *next; |
139 | #ifdef CONFIG_NET_NS | 134 | #ifdef CONFIG_NET_NS |
140 | struct net *net; | 135 | struct net *net; |
@@ -149,8 +144,7 @@ struct pneigh_entry | |||
149 | */ | 144 | */ |
150 | 145 | ||
151 | 146 | ||
152 | struct neigh_table | 147 | struct neigh_table { |
153 | { | ||
154 | struct neigh_table *next; | 148 | struct neigh_table *next; |
155 | int family; | 149 | int family; |
156 | int entry_size; | 150 | int entry_size; |
@@ -264,8 +258,7 @@ extern int neigh_sysctl_register(struct net_device *dev, | |||
264 | struct neigh_parms *p, | 258 | struct neigh_parms *p, |
265 | int p_id, int pdev_id, | 259 | int p_id, int pdev_id, |
266 | char *p_name, | 260 | char *p_name, |
267 | proc_handler *proc_handler, | 261 | proc_handler *proc_handler); |
268 | ctl_handler *strategy); | ||
269 | extern void neigh_sysctl_unregister(struct neigh_parms *p); | 262 | extern void neigh_sysctl_unregister(struct neigh_parms *p); |
270 | 263 | ||
271 | static inline void __neigh_parms_put(struct neigh_parms *parms) | 264 | static inline void __neigh_parms_put(struct neigh_parms *parms) |
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h index a1202841aadd..f307e133d14c 100644 --- a/include/net/net_namespace.h +++ b/include/net/net_namespace.h | |||
@@ -28,6 +28,10 @@ struct ctl_table_header; | |||
28 | struct net_generic; | 28 | struct net_generic; |
29 | struct sock; | 29 | struct sock; |
30 | 30 | ||
31 | |||
32 | #define NETDEV_HASHBITS 8 | ||
33 | #define NETDEV_HASHENTRIES (1 << NETDEV_HASHBITS) | ||
34 | |||
31 | struct net { | 35 | struct net { |
32 | atomic_t count; /* To decided when the network | 36 | atomic_t count; /* To decided when the network |
33 | * namespace should be freed. | 37 | * namespace should be freed. |
@@ -38,7 +42,8 @@ struct net { | |||
38 | */ | 42 | */ |
39 | #endif | 43 | #endif |
40 | struct list_head list; /* list of network namespaces */ | 44 | struct list_head list; /* list of network namespaces */ |
41 | struct work_struct work; /* work struct for freeing */ | 45 | struct list_head cleanup_list; /* namespaces on death row */ |
46 | struct list_head exit_list; /* Use only net_mutex */ | ||
42 | 47 | ||
43 | struct proc_dir_entry *proc_net; | 48 | struct proc_dir_entry *proc_net; |
44 | struct proc_dir_entry *proc_net_stat; | 49 | struct proc_dir_entry *proc_net_stat; |
@@ -80,7 +85,7 @@ struct net { | |||
80 | #ifdef CONFIG_XFRM | 85 | #ifdef CONFIG_XFRM |
81 | struct netns_xfrm xfrm; | 86 | struct netns_xfrm xfrm; |
82 | #endif | 87 | #endif |
83 | #ifdef CONFIG_WIRELESS_EXT | 88 | #ifdef CONFIG_WEXT_CORE |
84 | struct sk_buff_head wext_nlevents; | 89 | struct sk_buff_head wext_nlevents; |
85 | #endif | 90 | #endif |
86 | struct net_generic *gen; | 91 | struct net_generic *gen; |
@@ -232,6 +237,9 @@ struct pernet_operations { | |||
232 | struct list_head list; | 237 | struct list_head list; |
233 | int (*init)(struct net *net); | 238 | int (*init)(struct net *net); |
234 | void (*exit)(struct net *net); | 239 | void (*exit)(struct net *net); |
240 | void (*exit_batch)(struct list_head *net_exit_list); | ||
241 | int *id; | ||
242 | size_t size; | ||
235 | }; | 243 | }; |
236 | 244 | ||
237 | /* | 245 | /* |
@@ -255,12 +263,8 @@ struct pernet_operations { | |||
255 | */ | 263 | */ |
256 | extern int register_pernet_subsys(struct pernet_operations *); | 264 | extern int register_pernet_subsys(struct pernet_operations *); |
257 | extern void unregister_pernet_subsys(struct pernet_operations *); | 265 | extern void unregister_pernet_subsys(struct pernet_operations *); |
258 | extern int register_pernet_gen_subsys(int *id, struct pernet_operations *); | ||
259 | extern void unregister_pernet_gen_subsys(int id, struct pernet_operations *); | ||
260 | extern int register_pernet_device(struct pernet_operations *); | 266 | extern int register_pernet_device(struct pernet_operations *); |
261 | extern void unregister_pernet_device(struct pernet_operations *); | 267 | extern void unregister_pernet_device(struct pernet_operations *); |
262 | extern int register_pernet_gen_device(int *id, struct pernet_operations *); | ||
263 | extern void unregister_pernet_gen_device(int id, struct pernet_operations *); | ||
264 | 268 | ||
265 | struct ctl_path; | 269 | struct ctl_path; |
266 | struct ctl_table; | 270 | struct ctl_table; |
diff --git a/include/net/netfilter/nf_conntrack_ecache.h b/include/net/netfilter/nf_conntrack_ecache.h index 4f20d58e2ab7..475facc3051a 100644 --- a/include/net/netfilter/nf_conntrack_ecache.h +++ b/include/net/netfilter/nf_conntrack_ecache.h | |||
@@ -13,8 +13,7 @@ | |||
13 | #include <net/netfilter/nf_conntrack_extend.h> | 13 | #include <net/netfilter/nf_conntrack_extend.h> |
14 | 14 | ||
15 | /* Connection tracking event types */ | 15 | /* Connection tracking event types */ |
16 | enum ip_conntrack_events | 16 | enum ip_conntrack_events { |
17 | { | ||
18 | IPCT_NEW = 0, /* new conntrack */ | 17 | IPCT_NEW = 0, /* new conntrack */ |
19 | IPCT_RELATED = 1, /* related conntrack */ | 18 | IPCT_RELATED = 1, /* related conntrack */ |
20 | IPCT_DESTROY = 2, /* destroyed conntrack */ | 19 | IPCT_DESTROY = 2, /* destroyed conntrack */ |
diff --git a/include/net/netfilter/nf_conntrack_expect.h b/include/net/netfilter/nf_conntrack_expect.h index a9652806d0df..9a2b9cb52271 100644 --- a/include/net/netfilter/nf_conntrack_expect.h +++ b/include/net/netfilter/nf_conntrack_expect.h | |||
@@ -9,8 +9,7 @@ | |||
9 | extern unsigned int nf_ct_expect_hsize; | 9 | extern unsigned int nf_ct_expect_hsize; |
10 | extern unsigned int nf_ct_expect_max; | 10 | extern unsigned int nf_ct_expect_max; |
11 | 11 | ||
12 | struct nf_conntrack_expect | 12 | struct nf_conntrack_expect { |
13 | { | ||
14 | /* Conntrack expectation list member */ | 13 | /* Conntrack expectation list member */ |
15 | struct hlist_node lnode; | 14 | struct hlist_node lnode; |
16 | 15 | ||
@@ -64,8 +63,7 @@ static inline struct net *nf_ct_exp_net(struct nf_conntrack_expect *exp) | |||
64 | #endif | 63 | #endif |
65 | } | 64 | } |
66 | 65 | ||
67 | struct nf_conntrack_expect_policy | 66 | struct nf_conntrack_expect_policy { |
68 | { | ||
69 | unsigned int max_expected; | 67 | unsigned int max_expected; |
70 | unsigned int timeout; | 68 | unsigned int timeout; |
71 | }; | 69 | }; |
diff --git a/include/net/netfilter/nf_conntrack_extend.h b/include/net/netfilter/nf_conntrack_extend.h index 7f8fc5d123c5..e192dc17c583 100644 --- a/include/net/netfilter/nf_conntrack_extend.h +++ b/include/net/netfilter/nf_conntrack_extend.h | |||
@@ -3,8 +3,7 @@ | |||
3 | 3 | ||
4 | #include <net/netfilter/nf_conntrack.h> | 4 | #include <net/netfilter/nf_conntrack.h> |
5 | 5 | ||
6 | enum nf_ct_ext_id | 6 | enum nf_ct_ext_id { |
7 | { | ||
8 | NF_CT_EXT_HELPER, | 7 | NF_CT_EXT_HELPER, |
9 | NF_CT_EXT_NAT, | 8 | NF_CT_EXT_NAT, |
10 | NF_CT_EXT_ACCT, | 9 | NF_CT_EXT_ACCT, |
@@ -65,8 +64,7 @@ __nf_ct_ext_add(struct nf_conn *ct, enum nf_ct_ext_id id, gfp_t gfp); | |||
65 | 64 | ||
66 | #define NF_CT_EXT_F_PREALLOC 0x0001 | 65 | #define NF_CT_EXT_F_PREALLOC 0x0001 |
67 | 66 | ||
68 | struct nf_ct_ext_type | 67 | struct nf_ct_ext_type { |
69 | { | ||
70 | /* Destroys relationships (can be NULL). */ | 68 | /* Destroys relationships (can be NULL). */ |
71 | void (*destroy)(struct nf_conn *ct); | 69 | void (*destroy)(struct nf_conn *ct); |
72 | /* Called when realloacted (can be NULL). | 70 | /* Called when realloacted (can be NULL). |
diff --git a/include/net/netfilter/nf_conntrack_helper.h b/include/net/netfilter/nf_conntrack_helper.h index 1b7068000927..d015de92e03f 100644 --- a/include/net/netfilter/nf_conntrack_helper.h +++ b/include/net/netfilter/nf_conntrack_helper.h | |||
@@ -16,8 +16,7 @@ struct module; | |||
16 | 16 | ||
17 | #define NF_CT_HELPER_NAME_LEN 16 | 17 | #define NF_CT_HELPER_NAME_LEN 16 |
18 | 18 | ||
19 | struct nf_conntrack_helper | 19 | struct nf_conntrack_helper { |
20 | { | ||
21 | struct hlist_node hnode; /* Internal use. */ | 20 | struct hlist_node hnode; /* Internal use. */ |
22 | 21 | ||
23 | const char *name; /* name of the module */ | 22 | const char *name; /* name of the module */ |
diff --git a/include/net/netfilter/nf_conntrack_l3proto.h b/include/net/netfilter/nf_conntrack_l3proto.h index 9f99d36d5de9..a7547611e8f1 100644 --- a/include/net/netfilter/nf_conntrack_l3proto.h +++ b/include/net/netfilter/nf_conntrack_l3proto.h | |||
@@ -16,8 +16,7 @@ | |||
16 | #include <linux/seq_file.h> | 16 | #include <linux/seq_file.h> |
17 | #include <net/netfilter/nf_conntrack.h> | 17 | #include <net/netfilter/nf_conntrack.h> |
18 | 18 | ||
19 | struct nf_conntrack_l3proto | 19 | struct nf_conntrack_l3proto { |
20 | { | ||
21 | /* L3 Protocol Family number. ex) PF_INET */ | 20 | /* L3 Protocol Family number. ex) PF_INET */ |
22 | u_int16_t l3proto; | 21 | u_int16_t l3proto; |
23 | 22 | ||
diff --git a/include/net/netfilter/nf_conntrack_l4proto.h b/include/net/netfilter/nf_conntrack_l4proto.h index 3767fb41e541..ca6dcf3445ab 100644 --- a/include/net/netfilter/nf_conntrack_l4proto.h +++ b/include/net/netfilter/nf_conntrack_l4proto.h | |||
@@ -15,8 +15,7 @@ | |||
15 | 15 | ||
16 | struct seq_file; | 16 | struct seq_file; |
17 | 17 | ||
18 | struct nf_conntrack_l4proto | 18 | struct nf_conntrack_l4proto { |
19 | { | ||
20 | /* L3 Protocol number. */ | 19 | /* L3 Protocol number. */ |
21 | u_int16_t l3proto; | 20 | u_int16_t l3proto; |
22 | 21 | ||
diff --git a/include/net/netfilter/nf_conntrack_tuple.h b/include/net/netfilter/nf_conntrack_tuple.h index 2628c154d40e..4ee44c84a304 100644 --- a/include/net/netfilter/nf_conntrack_tuple.h +++ b/include/net/netfilter/nf_conntrack_tuple.h | |||
@@ -26,8 +26,7 @@ | |||
26 | 26 | ||
27 | /* The protocol-specific manipulable parts of the tuple: always in | 27 | /* The protocol-specific manipulable parts of the tuple: always in |
28 | network order! */ | 28 | network order! */ |
29 | union nf_conntrack_man_proto | 29 | union nf_conntrack_man_proto { |
30 | { | ||
31 | /* Add other protocols here. */ | 30 | /* Add other protocols here. */ |
32 | __be16 all; | 31 | __be16 all; |
33 | 32 | ||
@@ -52,8 +51,7 @@ union nf_conntrack_man_proto | |||
52 | }; | 51 | }; |
53 | 52 | ||
54 | /* The manipulable part of the tuple. */ | 53 | /* The manipulable part of the tuple. */ |
55 | struct nf_conntrack_man | 54 | struct nf_conntrack_man { |
56 | { | ||
57 | union nf_inet_addr u3; | 55 | union nf_inet_addr u3; |
58 | union nf_conntrack_man_proto u; | 56 | union nf_conntrack_man_proto u; |
59 | /* Layer 3 protocol */ | 57 | /* Layer 3 protocol */ |
@@ -61,8 +59,7 @@ struct nf_conntrack_man | |||
61 | }; | 59 | }; |
62 | 60 | ||
63 | /* This contains the information to distinguish a connection. */ | 61 | /* This contains the information to distinguish a connection. */ |
64 | struct nf_conntrack_tuple | 62 | struct nf_conntrack_tuple { |
65 | { | ||
66 | struct nf_conntrack_man src; | 63 | struct nf_conntrack_man src; |
67 | 64 | ||
68 | /* These are the parts of the tuple which are fixed. */ | 65 | /* These are the parts of the tuple which are fixed. */ |
@@ -100,8 +97,7 @@ struct nf_conntrack_tuple | |||
100 | } dst; | 97 | } dst; |
101 | }; | 98 | }; |
102 | 99 | ||
103 | struct nf_conntrack_tuple_mask | 100 | struct nf_conntrack_tuple_mask { |
104 | { | ||
105 | struct { | 101 | struct { |
106 | union nf_inet_addr u3; | 102 | union nf_inet_addr u3; |
107 | union nf_conntrack_man_proto u; | 103 | union nf_conntrack_man_proto u; |
diff --git a/include/net/netfilter/nf_nat.h b/include/net/netfilter/nf_nat.h index 8df0b7f7fc6e..f5f09f032a90 100644 --- a/include/net/netfilter/nf_nat.h +++ b/include/net/netfilter/nf_nat.h | |||
@@ -5,8 +5,7 @@ | |||
5 | 5 | ||
6 | #define NF_NAT_MAPPING_TYPE_MAX_NAMELEN 16 | 6 | #define NF_NAT_MAPPING_TYPE_MAX_NAMELEN 16 |
7 | 7 | ||
8 | enum nf_nat_manip_type | 8 | enum nf_nat_manip_type { |
9 | { | ||
10 | IP_NAT_MANIP_SRC, | 9 | IP_NAT_MANIP_SRC, |
11 | IP_NAT_MANIP_DST | 10 | IP_NAT_MANIP_DST |
12 | }; | 11 | }; |
@@ -30,8 +29,7 @@ struct nf_nat_seq { | |||
30 | }; | 29 | }; |
31 | 30 | ||
32 | /* Single range specification. */ | 31 | /* Single range specification. */ |
33 | struct nf_nat_range | 32 | struct nf_nat_range { |
34 | { | ||
35 | /* Set to OR of flags above. */ | 33 | /* Set to OR of flags above. */ |
36 | unsigned int flags; | 34 | unsigned int flags; |
37 | 35 | ||
@@ -43,8 +41,7 @@ struct nf_nat_range | |||
43 | }; | 41 | }; |
44 | 42 | ||
45 | /* For backwards compat: don't use in modern code. */ | 43 | /* For backwards compat: don't use in modern code. */ |
46 | struct nf_nat_multi_range_compat | 44 | struct nf_nat_multi_range_compat { |
47 | { | ||
48 | unsigned int rangesize; /* Must be 1. */ | 45 | unsigned int rangesize; /* Must be 1. */ |
49 | 46 | ||
50 | /* hangs off end. */ | 47 | /* hangs off end. */ |
@@ -57,8 +54,7 @@ struct nf_nat_multi_range_compat | |||
57 | #include <net/netfilter/nf_conntrack_extend.h> | 54 | #include <net/netfilter/nf_conntrack_extend.h> |
58 | 55 | ||
59 | /* per conntrack: nat application helper private data */ | 56 | /* per conntrack: nat application helper private data */ |
60 | union nf_conntrack_nat_help | 57 | union nf_conntrack_nat_help { |
61 | { | ||
62 | /* insert nat helper private data here */ | 58 | /* insert nat helper private data here */ |
63 | struct nf_nat_pptp nat_pptp_info; | 59 | struct nf_nat_pptp nat_pptp_info; |
64 | }; | 60 | }; |
@@ -66,8 +62,7 @@ union nf_conntrack_nat_help | |||
66 | struct nf_conn; | 62 | struct nf_conn; |
67 | 63 | ||
68 | /* The structure embedded in the conntrack structure. */ | 64 | /* The structure embedded in the conntrack structure. */ |
69 | struct nf_conn_nat | 65 | struct nf_conn_nat { |
70 | { | ||
71 | struct hlist_node bysource; | 66 | struct hlist_node bysource; |
72 | struct nf_nat_seq seq[IP_CT_DIR_MAX]; | 67 | struct nf_nat_seq seq[IP_CT_DIR_MAX]; |
73 | struct nf_conn *ct; | 68 | struct nf_conn *ct; |
diff --git a/include/net/netfilter/nf_nat_protocol.h b/include/net/netfilter/nf_nat_protocol.h index f3662c4394ef..c398017ccfa3 100644 --- a/include/net/netfilter/nf_nat_protocol.h +++ b/include/net/netfilter/nf_nat_protocol.h | |||
@@ -6,8 +6,7 @@ | |||
6 | 6 | ||
7 | struct nf_nat_range; | 7 | struct nf_nat_range; |
8 | 8 | ||
9 | struct nf_nat_protocol | 9 | struct nf_nat_protocol { |
10 | { | ||
11 | /* Protocol number. */ | 10 | /* Protocol number. */ |
12 | unsigned int protonum; | 11 | unsigned int protonum; |
13 | 12 | ||
diff --git a/include/net/netns/generic.h b/include/net/netns/generic.h index 0c04fd2a700b..ff4982ab84b6 100644 --- a/include/net/netns/generic.h +++ b/include/net/netns/generic.h | |||
@@ -12,9 +12,11 @@ | |||
12 | * stuff on the struct net without explicit struct net modification | 12 | * stuff on the struct net without explicit struct net modification |
13 | * | 13 | * |
14 | * The rules are simple: | 14 | * The rules are simple: |
15 | * 1. register the ops with register_pernet_gen_device to get the id | 15 | * 1. set pernet_operations->id. After register_pernet_device you |
16 | * of your private pointer; | 16 | * will have the id of your private pointer. |
17 | * 2. call net_assign_generic() to put the private data on the struct | 17 | * 2. Either set pernet_operations->size (to have the code allocate and |
18 | * free a private structure pointed to from struct net ) or | ||
19 | * call net_assign_generic() to put the private data on the struct | ||
18 | * net (most preferably this should be done in the ->init callback | 20 | * net (most preferably this should be done in the ->init callback |
19 | * of the ops registered); | 21 | * of the ops registered); |
20 | * 3. do not change this pointer while the net is alive; | 22 | * 3. do not change this pointer while the net is alive; |
diff --git a/include/net/netns/xfrm.h b/include/net/netns/xfrm.h index 1ba912749caa..56f8e5585df7 100644 --- a/include/net/netns/xfrm.h +++ b/include/net/netns/xfrm.h | |||
@@ -43,6 +43,7 @@ struct netns_xfrm { | |||
43 | struct work_struct policy_hash_work; | 43 | struct work_struct policy_hash_work; |
44 | 44 | ||
45 | struct sock *nlsk; | 45 | struct sock *nlsk; |
46 | struct sock *nlsk_stash; | ||
46 | 47 | ||
47 | u32 sysctl_aevent_etime; | 48 | u32 sysctl_aevent_etime; |
48 | u32 sysctl_aevent_rseqth; | 49 | u32 sysctl_aevent_rseqth; |
diff --git a/include/net/phonet/phonet.h b/include/net/phonet/phonet.h index d43f71b5ec00..7b114079a51b 100644 --- a/include/net/phonet/phonet.h +++ b/include/net/phonet/phonet.h | |||
@@ -46,7 +46,9 @@ static inline struct pn_sock *pn_sk(struct sock *sk) | |||
46 | 46 | ||
47 | extern const struct proto_ops phonet_dgram_ops; | 47 | extern const struct proto_ops phonet_dgram_ops; |
48 | 48 | ||
49 | void pn_sock_init(void); | ||
49 | struct sock *pn_find_sock_by_sa(struct net *net, const struct sockaddr_pn *sa); | 50 | struct sock *pn_find_sock_by_sa(struct net *net, const struct sockaddr_pn *sa); |
51 | void pn_deliver_sock_broadcast(struct net *net, struct sk_buff *skb); | ||
50 | void phonet_get_local_port_range(int *min, int *max); | 52 | void phonet_get_local_port_range(int *min, int *max); |
51 | void pn_sock_hash(struct sock *sk); | 53 | void pn_sock_hash(struct sock *sk); |
52 | void pn_sock_unhash(struct sock *sk); | 54 | void pn_sock_unhash(struct sock *sk); |
diff --git a/include/net/phonet/pn_dev.h b/include/net/phonet/pn_dev.h index 44c923c9e21d..d7b989ca3d63 100644 --- a/include/net/phonet/pn_dev.h +++ b/include/net/phonet/pn_dev.h | |||
@@ -25,7 +25,7 @@ | |||
25 | 25 | ||
26 | struct phonet_device_list { | 26 | struct phonet_device_list { |
27 | struct list_head list; | 27 | struct list_head list; |
28 | spinlock_t lock; | 28 | struct mutex lock; |
29 | }; | 29 | }; |
30 | 30 | ||
31 | struct phonet_device_list *phonet_device_list(struct net *net); | 31 | struct phonet_device_list *phonet_device_list(struct net *net); |
@@ -47,6 +47,12 @@ u8 phonet_address_get(struct net_device *dev, u8 addr); | |||
47 | int phonet_address_lookup(struct net *net, u8 addr); | 47 | int phonet_address_lookup(struct net *net, u8 addr); |
48 | void phonet_address_notify(int event, struct net_device *dev, u8 addr); | 48 | void phonet_address_notify(int event, struct net_device *dev, u8 addr); |
49 | 49 | ||
50 | int phonet_route_add(struct net_device *dev, u8 daddr); | ||
51 | int phonet_route_del(struct net_device *dev, u8 daddr); | ||
52 | void rtm_phonet_notify(int event, struct net_device *dev, u8 dst); | ||
53 | struct net_device *phonet_route_get(struct net *net, u8 daddr); | ||
54 | struct net_device *phonet_route_output(struct net *net, u8 daddr); | ||
55 | |||
50 | #define PN_NO_ADDR 0xff | 56 | #define PN_NO_ADDR 0xff |
51 | 57 | ||
52 | extern const struct file_operations pn_sock_seq_fops; | 58 | extern const struct file_operations pn_sock_seq_fops; |
diff --git a/include/net/pkt_cls.h b/include/net/pkt_cls.h index d1ca31444644..dd3031aed9d5 100644 --- a/include/net/pkt_cls.h +++ b/include/net/pkt_cls.h | |||
@@ -7,8 +7,7 @@ | |||
7 | 7 | ||
8 | /* Basic packet classifier frontend definitions. */ | 8 | /* Basic packet classifier frontend definitions. */ |
9 | 9 | ||
10 | struct tcf_walker | 10 | struct tcf_walker { |
11 | { | ||
12 | int stop; | 11 | int stop; |
13 | int skip; | 12 | int skip; |
14 | int count; | 13 | int count; |
@@ -61,8 +60,7 @@ tcf_unbind_filter(struct tcf_proto *tp, struct tcf_result *r) | |||
61 | tp->q->ops->cl_ops->unbind_tcf(tp->q, cl); | 60 | tp->q->ops->cl_ops->unbind_tcf(tp->q, cl); |
62 | } | 61 | } |
63 | 62 | ||
64 | struct tcf_exts | 63 | struct tcf_exts { |
65 | { | ||
66 | #ifdef CONFIG_NET_CLS_ACT | 64 | #ifdef CONFIG_NET_CLS_ACT |
67 | struct tc_action *action; | 65 | struct tc_action *action; |
68 | #endif | 66 | #endif |
@@ -71,8 +69,7 @@ struct tcf_exts | |||
71 | /* Map to export classifier specific extension TLV types to the | 69 | /* Map to export classifier specific extension TLV types to the |
72 | * generic extensions API. Unsupported extensions must be set to 0. | 70 | * generic extensions API. Unsupported extensions must be set to 0. |
73 | */ | 71 | */ |
74 | struct tcf_ext_map | 72 | struct tcf_ext_map { |
75 | { | ||
76 | int action; | 73 | int action; |
77 | int police; | 74 | int police; |
78 | }; | 75 | }; |
@@ -143,8 +140,7 @@ extern int tcf_exts_dump_stats(struct sk_buff *skb, struct tcf_exts *exts, | |||
143 | /** | 140 | /** |
144 | * struct tcf_pkt_info - packet information | 141 | * struct tcf_pkt_info - packet information |
145 | */ | 142 | */ |
146 | struct tcf_pkt_info | 143 | struct tcf_pkt_info { |
147 | { | ||
148 | unsigned char * ptr; | 144 | unsigned char * ptr; |
149 | int nexthdr; | 145 | int nexthdr; |
150 | }; | 146 | }; |
@@ -162,8 +158,7 @@ struct tcf_ematch_ops; | |||
162 | * @datalen: length of the ematch specific configuration data | 158 | * @datalen: length of the ematch specific configuration data |
163 | * @data: ematch specific data | 159 | * @data: ematch specific data |
164 | */ | 160 | */ |
165 | struct tcf_ematch | 161 | struct tcf_ematch { |
166 | { | ||
167 | struct tcf_ematch_ops * ops; | 162 | struct tcf_ematch_ops * ops; |
168 | unsigned long data; | 163 | unsigned long data; |
169 | unsigned int datalen; | 164 | unsigned int datalen; |
@@ -211,8 +206,7 @@ static inline int tcf_em_early_end(struct tcf_ematch *em, int result) | |||
211 | * @hdr: ematch tree header supplied by userspace | 206 | * @hdr: ematch tree header supplied by userspace |
212 | * @matches: array of ematches | 207 | * @matches: array of ematches |
213 | */ | 208 | */ |
214 | struct tcf_ematch_tree | 209 | struct tcf_ematch_tree { |
215 | { | ||
216 | struct tcf_ematch_tree_hdr hdr; | 210 | struct tcf_ematch_tree_hdr hdr; |
217 | struct tcf_ematch * matches; | 211 | struct tcf_ematch * matches; |
218 | 212 | ||
@@ -230,8 +224,7 @@ struct tcf_ematch_tree | |||
230 | * @owner: owner, must be set to THIS_MODULE | 224 | * @owner: owner, must be set to THIS_MODULE |
231 | * @link: link to previous/next ematch module (internal use) | 225 | * @link: link to previous/next ematch module (internal use) |
232 | */ | 226 | */ |
233 | struct tcf_ematch_ops | 227 | struct tcf_ematch_ops { |
234 | { | ||
235 | int kind; | 228 | int kind; |
236 | int datalen; | 229 | int datalen; |
237 | int (*change)(struct tcf_proto *, void *, | 230 | int (*change)(struct tcf_proto *, void *, |
@@ -302,8 +295,7 @@ static inline int tcf_em_tree_match(struct sk_buff *skb, | |||
302 | 295 | ||
303 | #else /* CONFIG_NET_EMATCH */ | 296 | #else /* CONFIG_NET_EMATCH */ |
304 | 297 | ||
305 | struct tcf_ematch_tree | 298 | struct tcf_ematch_tree { |
306 | { | ||
307 | }; | 299 | }; |
308 | 300 | ||
309 | #define tcf_em_tree_validate(tp, tb, t) ((void)(t), 0) | 301 | #define tcf_em_tree_validate(tp, tb, t) ((void)(t), 0) |
@@ -351,9 +343,9 @@ tcf_match_indev(struct sk_buff *skb, char *indev) | |||
351 | struct net_device *dev; | 343 | struct net_device *dev; |
352 | 344 | ||
353 | if (indev[0]) { | 345 | if (indev[0]) { |
354 | if (!skb->iif) | 346 | if (!skb->skb_iif) |
355 | return 0; | 347 | return 0; |
356 | dev = __dev_get_by_index(dev_net(skb->dev), skb->iif); | 348 | dev = __dev_get_by_index(dev_net(skb->dev), skb->skb_iif); |
357 | if (!dev || strcmp(indev, dev->name)) | 349 | if (!dev || strcmp(indev, dev->name)) |
358 | return 0; | 350 | return 0; |
359 | } | 351 | } |
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h index f911ec7598ef..2d567265363e 100644 --- a/include/net/pkt_sched.h +++ b/include/net/pkt_sched.h | |||
@@ -5,8 +5,7 @@ | |||
5 | #include <linux/ktime.h> | 5 | #include <linux/ktime.h> |
6 | #include <net/sch_generic.h> | 6 | #include <net/sch_generic.h> |
7 | 7 | ||
8 | struct qdisc_walker | 8 | struct qdisc_walker { |
9 | { | ||
10 | int stop; | 9 | int stop; |
11 | int skip; | 10 | int skip; |
12 | int count; | 11 | int count; |
diff --git a/include/net/protocol.h b/include/net/protocol.h index 60249e51b669..f1effdd3c265 100644 --- a/include/net/protocol.h +++ b/include/net/protocol.h | |||
@@ -47,8 +47,7 @@ struct net_protocol { | |||
47 | }; | 47 | }; |
48 | 48 | ||
49 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) | 49 | #if defined(CONFIG_IPV6) || defined (CONFIG_IPV6_MODULE) |
50 | struct inet6_protocol | 50 | struct inet6_protocol { |
51 | { | ||
52 | int (*handler)(struct sk_buff *skb); | 51 | int (*handler)(struct sk_buff *skb); |
53 | 52 | ||
54 | void (*err_handler)(struct sk_buff *skb, | 53 | void (*err_handler)(struct sk_buff *skb, |
@@ -83,10 +82,6 @@ struct inet_protosw { | |||
83 | struct proto *prot; | 82 | struct proto *prot; |
84 | const struct proto_ops *ops; | 83 | const struct proto_ops *ops; |
85 | 84 | ||
86 | int capability; /* Which (if any) capability do | ||
87 | * we need to use this socket | ||
88 | * interface? | ||
89 | */ | ||
90 | char no_check; /* checksum on rcv/xmit/none? */ | 85 | char no_check; /* checksum on rcv/xmit/none? */ |
91 | unsigned char flags; /* See INET_PROTOSW_* below. */ | 86 | unsigned char flags; /* See INET_PROTOSW_* below. */ |
92 | }; | 87 | }; |
diff --git a/include/net/red.h b/include/net/red.h index 3cf31d466a81..995108e54d9f 100644 --- a/include/net/red.h +++ b/include/net/red.h | |||
@@ -90,8 +90,7 @@ | |||
90 | #define RED_STAB_SIZE 256 | 90 | #define RED_STAB_SIZE 256 |
91 | #define RED_STAB_MASK (RED_STAB_SIZE - 1) | 91 | #define RED_STAB_MASK (RED_STAB_SIZE - 1) |
92 | 92 | ||
93 | struct red_stats | 93 | struct red_stats { |
94 | { | ||
95 | u32 prob_drop; /* Early probability drops */ | 94 | u32 prob_drop; /* Early probability drops */ |
96 | u32 prob_mark; /* Early probability marks */ | 95 | u32 prob_mark; /* Early probability marks */ |
97 | u32 forced_drop; /* Forced drops, qavg > max_thresh */ | 96 | u32 forced_drop; /* Forced drops, qavg > max_thresh */ |
@@ -101,8 +100,7 @@ struct red_stats | |||
101 | u32 backlog; | 100 | u32 backlog; |
102 | }; | 101 | }; |
103 | 102 | ||
104 | struct red_parms | 103 | struct red_parms { |
105 | { | ||
106 | /* Parameters */ | 104 | /* Parameters */ |
107 | u32 qth_min; /* Min avg length threshold: A scaled */ | 105 | u32 qth_min; /* Min avg length threshold: A scaled */ |
108 | u32 qth_max; /* Max avg length threshold: A scaled */ | 106 | u32 qth_max; /* Max avg length threshold: A scaled */ |
diff --git a/include/net/request_sock.h b/include/net/request_sock.h index c7190846e128..c9b50ebd9ce9 100644 --- a/include/net/request_sock.h +++ b/include/net/request_sock.h | |||
@@ -27,13 +27,19 @@ struct sk_buff; | |||
27 | struct dst_entry; | 27 | struct dst_entry; |
28 | struct proto; | 28 | struct proto; |
29 | 29 | ||
30 | /* empty to "strongly type" an otherwise void parameter. | ||
31 | */ | ||
32 | struct request_values { | ||
33 | }; | ||
34 | |||
30 | struct request_sock_ops { | 35 | struct request_sock_ops { |
31 | int family; | 36 | int family; |
32 | int obj_size; | 37 | int obj_size; |
33 | struct kmem_cache *slab; | 38 | struct kmem_cache *slab; |
34 | char *slab_name; | 39 | char *slab_name; |
35 | int (*rtx_syn_ack)(struct sock *sk, | 40 | int (*rtx_syn_ack)(struct sock *sk, |
36 | struct request_sock *req); | 41 | struct request_sock *req, |
42 | struct request_values *rvp); | ||
37 | void (*send_ack)(struct sock *sk, struct sk_buff *skb, | 43 | void (*send_ack)(struct sock *sk, struct sk_buff *skb, |
38 | struct request_sock *req); | 44 | struct request_sock *req); |
39 | void (*send_reset)(struct sock *sk, | 45 | void (*send_reset)(struct sock *sk, |
diff --git a/include/net/route.h b/include/net/route.h index 40f6346ef496..bce6dd68d27b 100644 --- a/include/net/route.h +++ b/include/net/route.h | |||
@@ -49,10 +49,8 @@ | |||
49 | 49 | ||
50 | struct fib_nh; | 50 | struct fib_nh; |
51 | struct inet_peer; | 51 | struct inet_peer; |
52 | struct rtable | 52 | struct rtable { |
53 | { | 53 | union { |
54 | union | ||
55 | { | ||
56 | struct dst_entry dst; | 54 | struct dst_entry dst; |
57 | } u; | 55 | } u; |
58 | 56 | ||
@@ -77,16 +75,14 @@ struct rtable | |||
77 | struct inet_peer *peer; /* long-living peer info */ | 75 | struct inet_peer *peer; /* long-living peer info */ |
78 | }; | 76 | }; |
79 | 77 | ||
80 | struct ip_rt_acct | 78 | struct ip_rt_acct { |
81 | { | ||
82 | __u32 o_bytes; | 79 | __u32 o_bytes; |
83 | __u32 o_packets; | 80 | __u32 o_packets; |
84 | __u32 i_bytes; | 81 | __u32 i_bytes; |
85 | __u32 i_packets; | 82 | __u32 i_packets; |
86 | }; | 83 | }; |
87 | 84 | ||
88 | struct rt_cache_stat | 85 | struct rt_cache_stat { |
89 | { | ||
90 | unsigned int in_hit; | 86 | unsigned int in_hit; |
91 | unsigned int in_slow_tot; | 87 | unsigned int in_slow_tot; |
92 | unsigned int in_slow_mc; | 88 | unsigned int in_slow_mc; |
@@ -112,6 +108,7 @@ extern int ip_rt_init(void); | |||
112 | extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw, | 108 | extern void ip_rt_redirect(__be32 old_gw, __be32 dst, __be32 new_gw, |
113 | __be32 src, struct net_device *dev); | 109 | __be32 src, struct net_device *dev); |
114 | extern void rt_cache_flush(struct net *net, int how); | 110 | extern void rt_cache_flush(struct net *net, int how); |
111 | extern void rt_cache_flush_batch(void); | ||
115 | extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); | 112 | extern int __ip_route_output_key(struct net *, struct rtable **, const struct flowi *flp); |
116 | extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp); | 113 | extern int ip_route_output_key(struct net *, struct rtable **, struct flowi *flp); |
117 | extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); | 114 | extern int ip_route_output_flow(struct net *, struct rtable **rp, struct flowi *flp, struct sock *sk, int flags); |
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h index c3aa044d3fc3..48d3efcb0880 100644 --- a/include/net/rtnetlink.h +++ b/include/net/rtnetlink.h | |||
@@ -55,13 +55,15 @@ struct rtnl_link_ops { | |||
55 | int (*validate)(struct nlattr *tb[], | 55 | int (*validate)(struct nlattr *tb[], |
56 | struct nlattr *data[]); | 56 | struct nlattr *data[]); |
57 | 57 | ||
58 | int (*newlink)(struct net_device *dev, | 58 | int (*newlink)(struct net *src_net, |
59 | struct net_device *dev, | ||
59 | struct nlattr *tb[], | 60 | struct nlattr *tb[], |
60 | struct nlattr *data[]); | 61 | struct nlattr *data[]); |
61 | int (*changelink)(struct net_device *dev, | 62 | int (*changelink)(struct net_device *dev, |
62 | struct nlattr *tb[], | 63 | struct nlattr *tb[], |
63 | struct nlattr *data[]); | 64 | struct nlattr *data[]); |
64 | void (*dellink)(struct net_device *dev); | 65 | void (*dellink)(struct net_device *dev, |
66 | struct list_head *head); | ||
65 | 67 | ||
66 | size_t (*get_size)(const struct net_device *dev); | 68 | size_t (*get_size)(const struct net_device *dev); |
67 | int (*fill_info)(struct sk_buff *skb, | 69 | int (*fill_info)(struct sk_buff *skb, |
@@ -82,8 +84,9 @@ extern void rtnl_kill_links(struct net *net, struct rtnl_link_ops *ops); | |||
82 | extern int rtnl_link_register(struct rtnl_link_ops *ops); | 84 | extern int rtnl_link_register(struct rtnl_link_ops *ops); |
83 | extern void rtnl_link_unregister(struct rtnl_link_ops *ops); | 85 | extern void rtnl_link_unregister(struct rtnl_link_ops *ops); |
84 | 86 | ||
85 | extern struct net_device *rtnl_create_link(struct net *net, char *ifname, | 87 | extern struct net *rtnl_link_get_net(struct net *src_net, struct nlattr *tb[]); |
86 | const struct rtnl_link_ops *ops, struct nlattr *tb[]); | 88 | extern struct net_device *rtnl_create_link(struct net *src_net, struct net *net, |
89 | char *ifname, const struct rtnl_link_ops *ops, struct nlattr *tb[]); | ||
87 | extern const struct nla_policy ifla_policy[IFLA_MAX+1]; | 90 | extern const struct nla_policy ifla_policy[IFLA_MAX+1]; |
88 | 91 | ||
89 | #define MODULE_ALIAS_RTNL_LINK(kind) MODULE_ALIAS("rtnl-link-" kind) | 92 | #define MODULE_ALIAS_RTNL_LINK(kind) MODULE_ALIAS("rtnl-link-" kind) |
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index c33180dd42b4..dad558bc06fa 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h | |||
@@ -15,16 +15,14 @@ struct qdisc_walker; | |||
15 | struct tcf_walker; | 15 | struct tcf_walker; |
16 | struct module; | 16 | struct module; |
17 | 17 | ||
18 | struct qdisc_rate_table | 18 | struct qdisc_rate_table { |
19 | { | ||
20 | struct tc_ratespec rate; | 19 | struct tc_ratespec rate; |
21 | u32 data[256]; | 20 | u32 data[256]; |
22 | struct qdisc_rate_table *next; | 21 | struct qdisc_rate_table *next; |
23 | int refcnt; | 22 | int refcnt; |
24 | }; | 23 | }; |
25 | 24 | ||
26 | enum qdisc_state_t | 25 | enum qdisc_state_t { |
27 | { | ||
28 | __QDISC_STATE_RUNNING, | 26 | __QDISC_STATE_RUNNING, |
29 | __QDISC_STATE_SCHED, | 27 | __QDISC_STATE_SCHED, |
30 | __QDISC_STATE_DEACTIVATED, | 28 | __QDISC_STATE_DEACTIVATED, |
@@ -37,8 +35,7 @@ struct qdisc_size_table { | |||
37 | u16 data[]; | 35 | u16 data[]; |
38 | }; | 36 | }; |
39 | 37 | ||
40 | struct Qdisc | 38 | struct Qdisc { |
41 | { | ||
42 | int (*enqueue)(struct sk_buff *skb, struct Qdisc *dev); | 39 | int (*enqueue)(struct sk_buff *skb, struct Qdisc *dev); |
43 | struct sk_buff * (*dequeue)(struct Qdisc *dev); | 40 | struct sk_buff * (*dequeue)(struct Qdisc *dev); |
44 | unsigned flags; | 41 | unsigned flags; |
@@ -78,8 +75,7 @@ struct Qdisc | |||
78 | struct gnet_stats_queue qstats; | 75 | struct gnet_stats_queue qstats; |
79 | }; | 76 | }; |
80 | 77 | ||
81 | struct Qdisc_class_ops | 78 | struct Qdisc_class_ops { |
82 | { | ||
83 | /* Child qdisc manipulation */ | 79 | /* Child qdisc manipulation */ |
84 | struct netdev_queue * (*select_queue)(struct Qdisc *, struct tcmsg *); | 80 | struct netdev_queue * (*select_queue)(struct Qdisc *, struct tcmsg *); |
85 | int (*graft)(struct Qdisc *, unsigned long cl, | 81 | int (*graft)(struct Qdisc *, unsigned long cl, |
@@ -108,8 +104,7 @@ struct Qdisc_class_ops | |||
108 | struct gnet_dump *); | 104 | struct gnet_dump *); |
109 | }; | 105 | }; |
110 | 106 | ||
111 | struct Qdisc_ops | 107 | struct Qdisc_ops { |
112 | { | ||
113 | struct Qdisc_ops *next; | 108 | struct Qdisc_ops *next; |
114 | const struct Qdisc_class_ops *cl_ops; | 109 | const struct Qdisc_class_ops *cl_ops; |
115 | char id[IFNAMSIZ]; | 110 | char id[IFNAMSIZ]; |
@@ -133,14 +128,12 @@ struct Qdisc_ops | |||
133 | }; | 128 | }; |
134 | 129 | ||
135 | 130 | ||
136 | struct tcf_result | 131 | struct tcf_result { |
137 | { | ||
138 | unsigned long class; | 132 | unsigned long class; |
139 | u32 classid; | 133 | u32 classid; |
140 | }; | 134 | }; |
141 | 135 | ||
142 | struct tcf_proto_ops | 136 | struct tcf_proto_ops { |
143 | { | ||
144 | struct tcf_proto_ops *next; | 137 | struct tcf_proto_ops *next; |
145 | char kind[IFNAMSIZ]; | 138 | char kind[IFNAMSIZ]; |
146 | 139 | ||
@@ -164,8 +157,7 @@ struct tcf_proto_ops | |||
164 | struct module *owner; | 157 | struct module *owner; |
165 | }; | 158 | }; |
166 | 159 | ||
167 | struct tcf_proto | 160 | struct tcf_proto { |
168 | { | ||
169 | /* Fast access part */ | 161 | /* Fast access part */ |
170 | struct tcf_proto *next; | 162 | struct tcf_proto *next; |
171 | void *root; | 163 | void *root; |
@@ -261,14 +253,12 @@ extern struct Qdisc_ops noop_qdisc_ops; | |||
261 | extern struct Qdisc_ops pfifo_fast_ops; | 253 | extern struct Qdisc_ops pfifo_fast_ops; |
262 | extern struct Qdisc_ops mq_qdisc_ops; | 254 | extern struct Qdisc_ops mq_qdisc_ops; |
263 | 255 | ||
264 | struct Qdisc_class_common | 256 | struct Qdisc_class_common { |
265 | { | ||
266 | u32 classid; | 257 | u32 classid; |
267 | struct hlist_node hnode; | 258 | struct hlist_node hnode; |
268 | }; | 259 | }; |
269 | 260 | ||
270 | struct Qdisc_class_hash | 261 | struct Qdisc_class_hash { |
271 | { | ||
272 | struct hlist_head *hash; | 262 | struct hlist_head *hash; |
273 | unsigned int hashsize; | 263 | unsigned int hashsize; |
274 | unsigned int hashmask; | 264 | unsigned int hashmask; |
diff --git a/include/net/scm.h b/include/net/scm.h index cf48c800e926..8360e47aa7e3 100644 --- a/include/net/scm.h +++ b/include/net/scm.h | |||
@@ -12,15 +12,13 @@ | |||
12 | */ | 12 | */ |
13 | #define SCM_MAX_FD 255 | 13 | #define SCM_MAX_FD 255 |
14 | 14 | ||
15 | struct scm_fp_list | 15 | struct scm_fp_list { |
16 | { | ||
17 | struct list_head list; | 16 | struct list_head list; |
18 | int count; | 17 | int count; |
19 | struct file *fp[SCM_MAX_FD]; | 18 | struct file *fp[SCM_MAX_FD]; |
20 | }; | 19 | }; |
21 | 20 | ||
22 | struct scm_cookie | 21 | struct scm_cookie { |
23 | { | ||
24 | struct ucred creds; /* Skb credentials */ | 22 | struct ucred creds; /* Skb credentials */ |
25 | struct scm_fp_list *fp; /* Passed files */ | 23 | struct scm_fp_list *fp; /* Passed files */ |
26 | #ifdef CONFIG_SECURITY_NETWORK | 24 | #ifdef CONFIG_SECURITY_NETWORK |
@@ -88,8 +86,7 @@ static inline void scm_passec(struct socket *sock, struct msghdr *msg, struct sc | |||
88 | static __inline__ void scm_recv(struct socket *sock, struct msghdr *msg, | 86 | static __inline__ void scm_recv(struct socket *sock, struct msghdr *msg, |
89 | struct scm_cookie *scm, int flags) | 87 | struct scm_cookie *scm, int flags) |
90 | { | 88 | { |
91 | if (!msg->msg_control) | 89 | if (!msg->msg_control) { |
92 | { | ||
93 | if (test_bit(SOCK_PASSCRED, &sock->flags) || scm->fp) | 90 | if (test_bit(SOCK_PASSCRED, &sock->flags) || scm->fp) |
94 | msg->msg_flags |= MSG_CTRUNC; | 91 | msg->msg_flags |= MSG_CTRUNC; |
95 | scm_destroy(scm); | 92 | scm_destroy(scm); |
diff --git a/include/net/sctp/constants.h b/include/net/sctp/constants.h index 58f714a3b670..63908840eef0 100644 --- a/include/net/sctp/constants.h +++ b/include/net/sctp/constants.h | |||
@@ -308,6 +308,10 @@ enum { SCTP_MAX_GABS = 16 }; | |||
308 | 308 | ||
309 | #define SCTP_DEFAULT_MINWINDOW 1500 /* default minimum rwnd size */ | 309 | #define SCTP_DEFAULT_MINWINDOW 1500 /* default minimum rwnd size */ |
310 | #define SCTP_DEFAULT_MAXWINDOW 65535 /* default rwnd size */ | 310 | #define SCTP_DEFAULT_MAXWINDOW 65535 /* default rwnd size */ |
311 | #define SCTP_DEFAULT_RWND_SHIFT 4 /* by default, update on 1/16 of | ||
312 | * rcvbuf, which is 1/8 of initial | ||
313 | * window | ||
314 | */ | ||
311 | #define SCTP_DEFAULT_MAXSEGMENT 1500 /* MTU size, this is the limit | 315 | #define SCTP_DEFAULT_MAXSEGMENT 1500 /* MTU size, this is the limit |
312 | * to which we will raise the P-MTU. | 316 | * to which we will raise the P-MTU. |
313 | */ | 317 | */ |
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h index 8a6d5297de16..78740ec57d5d 100644 --- a/include/net/sctp/sctp.h +++ b/include/net/sctp/sctp.h | |||
@@ -227,8 +227,7 @@ DECLARE_SNMP_STAT(struct sctp_mib, sctp_statistics); | |||
227 | #endif /* !TEST_FRAME */ | 227 | #endif /* !TEST_FRAME */ |
228 | 228 | ||
229 | /* sctp mib definitions */ | 229 | /* sctp mib definitions */ |
230 | enum | 230 | enum { |
231 | { | ||
232 | SCTP_MIB_NUM = 0, | 231 | SCTP_MIB_NUM = 0, |
233 | SCTP_MIB_CURRESTAB, /* CurrEstab */ | 232 | SCTP_MIB_CURRESTAB, /* CurrEstab */ |
234 | SCTP_MIB_ACTIVEESTABS, /* ActiveEstabs */ | 233 | SCTP_MIB_ACTIVEESTABS, /* ActiveEstabs */ |
diff --git a/include/net/sctp/sm.h b/include/net/sctp/sm.h index c1dd89365833..851c813adb3a 100644 --- a/include/net/sctp/sm.h +++ b/include/net/sctp/sm.h | |||
@@ -243,7 +243,8 @@ struct sctp_chunk *sctp_make_op_error(const struct sctp_association *, | |||
243 | const struct sctp_chunk *chunk, | 243 | const struct sctp_chunk *chunk, |
244 | __be16 cause_code, | 244 | __be16 cause_code, |
245 | const void *payload, | 245 | const void *payload, |
246 | size_t paylen); | 246 | size_t paylen, |
247 | size_t reserve_tail); | ||
247 | 248 | ||
248 | struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *, | 249 | struct sctp_chunk *sctp_make_asconf_update_ip(struct sctp_association *, |
249 | union sctp_addr *, | 250 | union sctp_addr *, |
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h index 0a474568b003..ff3017744711 100644 --- a/include/net/sctp/structs.h +++ b/include/net/sctp/structs.h | |||
@@ -231,6 +231,11 @@ extern struct sctp_globals { | |||
231 | /* Flag to indicate whether computing and verifying checksum | 231 | /* Flag to indicate whether computing and verifying checksum |
232 | * is disabled. */ | 232 | * is disabled. */ |
233 | int checksum_disable; | 233 | int checksum_disable; |
234 | |||
235 | /* Threshold for rwnd update SACKS. Receive buffer shifted this many | ||
236 | * bits is an indicator of when to send and window update SACK. | ||
237 | */ | ||
238 | int rwnd_update_shift; | ||
234 | } sctp_globals; | 239 | } sctp_globals; |
235 | 240 | ||
236 | #define sctp_rto_initial (sctp_globals.rto_initial) | 241 | #define sctp_rto_initial (sctp_globals.rto_initial) |
@@ -267,6 +272,7 @@ extern struct sctp_globals { | |||
267 | #define sctp_prsctp_enable (sctp_globals.prsctp_enable) | 272 | #define sctp_prsctp_enable (sctp_globals.prsctp_enable) |
268 | #define sctp_auth_enable (sctp_globals.auth_enable) | 273 | #define sctp_auth_enable (sctp_globals.auth_enable) |
269 | #define sctp_checksum_disable (sctp_globals.checksum_disable) | 274 | #define sctp_checksum_disable (sctp_globals.checksum_disable) |
275 | #define sctp_rwnd_upd_shift (sctp_globals.rwnd_update_shift) | ||
270 | 276 | ||
271 | /* SCTP Socket type: UDP or TCP style. */ | 277 | /* SCTP Socket type: UDP or TCP style. */ |
272 | typedef enum { | 278 | typedef enum { |
@@ -935,6 +941,8 @@ struct sctp_transport { | |||
935 | /* Data that has been sent, but not acknowledged. */ | 941 | /* Data that has been sent, but not acknowledged. */ |
936 | __u32 flight_size; | 942 | __u32 flight_size; |
937 | 943 | ||
944 | __u32 burst_limited; /* Holds old cwnd when max.burst is applied */ | ||
945 | |||
938 | /* TSN marking the fast recovery exit point */ | 946 | /* TSN marking the fast recovery exit point */ |
939 | __u32 fast_recovery_exit; | 947 | __u32 fast_recovery_exit; |
940 | 948 | ||
@@ -943,12 +951,6 @@ struct sctp_transport { | |||
943 | /* Source address. */ | 951 | /* Source address. */ |
944 | union sctp_addr saddr; | 952 | union sctp_addr saddr; |
945 | 953 | ||
946 | /* When was the last time(in jiffies) that a data packet was sent on | ||
947 | * this transport? This is used to adjust the cwnd when the transport | ||
948 | * becomes inactive. | ||
949 | */ | ||
950 | unsigned long last_time_used; | ||
951 | |||
952 | /* Heartbeat interval: The endpoint sends out a Heartbeat chunk to | 954 | /* Heartbeat interval: The endpoint sends out a Heartbeat chunk to |
953 | * the destination address every heartbeat interval. | 955 | * the destination address every heartbeat interval. |
954 | */ | 956 | */ |
@@ -987,7 +989,7 @@ struct sctp_transport { | |||
987 | int init_sent_count; | 989 | int init_sent_count; |
988 | 990 | ||
989 | /* state : The current state of this destination, | 991 | /* state : The current state of this destination, |
990 | * : i.e. SCTP_ACTIVE, SCTP_INACTIVE, SCTP_UNKOWN. | 992 | * : i.e. SCTP_ACTIVE, SCTP_INACTIVE, SCTP_UNKNOWN. |
991 | */ | 993 | */ |
992 | int state; | 994 | int state; |
993 | 995 | ||
@@ -1069,6 +1071,8 @@ void sctp_transport_put(struct sctp_transport *); | |||
1069 | void sctp_transport_update_rto(struct sctp_transport *, __u32); | 1071 | void sctp_transport_update_rto(struct sctp_transport *, __u32); |
1070 | void sctp_transport_raise_cwnd(struct sctp_transport *, __u32, __u32); | 1072 | void sctp_transport_raise_cwnd(struct sctp_transport *, __u32, __u32); |
1071 | void sctp_transport_lower_cwnd(struct sctp_transport *, sctp_lower_cwnd_t); | 1073 | void sctp_transport_lower_cwnd(struct sctp_transport *, sctp_lower_cwnd_t); |
1074 | void sctp_transport_burst_limited(struct sctp_transport *); | ||
1075 | void sctp_transport_burst_reset(struct sctp_transport *); | ||
1072 | unsigned long sctp_transport_timeout(struct sctp_transport *); | 1076 | unsigned long sctp_transport_timeout(struct sctp_transport *); |
1073 | void sctp_transport_reset(struct sctp_transport *); | 1077 | void sctp_transport_reset(struct sctp_transport *); |
1074 | void sctp_transport_update_pmtu(struct sctp_transport *, u32); | 1078 | void sctp_transport_update_pmtu(struct sctp_transport *, u32); |
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h index be2334aaf52e..2b2769c5ca9f 100644 --- a/include/net/sctp/user.h +++ b/include/net/sctp/user.h | |||
@@ -60,96 +60,49 @@ typedef __s32 sctp_assoc_t; | |||
60 | /* The following symbols come from the Sockets API Extensions for | 60 | /* The following symbols come from the Sockets API Extensions for |
61 | * SCTP <draft-ietf-tsvwg-sctpsocket-07.txt>. | 61 | * SCTP <draft-ietf-tsvwg-sctpsocket-07.txt>. |
62 | */ | 62 | */ |
63 | enum sctp_optname { | 63 | #define SCTP_RTOINFO 0 |
64 | SCTP_RTOINFO, | 64 | #define SCTP_ASSOCINFO 1 |
65 | #define SCTP_RTOINFO SCTP_RTOINFO | 65 | #define SCTP_INITMSG 2 |
66 | SCTP_ASSOCINFO, | 66 | #define SCTP_NODELAY 3 /* Get/set nodelay option. */ |
67 | #define SCTP_ASSOCINFO SCTP_ASSOCINFO | 67 | #define SCTP_AUTOCLOSE 4 |
68 | SCTP_INITMSG, | 68 | #define SCTP_SET_PEER_PRIMARY_ADDR 5 |
69 | #define SCTP_INITMSG SCTP_INITMSG | 69 | #define SCTP_PRIMARY_ADDR 6 |
70 | SCTP_NODELAY, /* Get/set nodelay option. */ | 70 | #define SCTP_ADAPTATION_LAYER 7 |
71 | #define SCTP_NODELAY SCTP_NODELAY | 71 | #define SCTP_DISABLE_FRAGMENTS 8 |
72 | SCTP_AUTOCLOSE, | 72 | #define SCTP_PEER_ADDR_PARAMS 9 |
73 | #define SCTP_AUTOCLOSE SCTP_AUTOCLOSE | 73 | #define SCTP_DEFAULT_SEND_PARAM 10 |
74 | SCTP_SET_PEER_PRIMARY_ADDR, | 74 | #define SCTP_EVENTS 11 |
75 | #define SCTP_SET_PEER_PRIMARY_ADDR SCTP_SET_PEER_PRIMARY_ADDR | 75 | #define SCTP_I_WANT_MAPPED_V4_ADDR 12 /* Turn on/off mapped v4 addresses */ |
76 | SCTP_PRIMARY_ADDR, | 76 | #define SCTP_MAXSEG 13 /* Get/set maximum fragment. */ |
77 | #define SCTP_PRIMARY_ADDR SCTP_PRIMARY_ADDR | 77 | #define SCTP_STATUS 14 |
78 | SCTP_ADAPTATION_LAYER, | 78 | #define SCTP_GET_PEER_ADDR_INFO 15 |
79 | #define SCTP_ADAPTATION_LAYER SCTP_ADAPTATION_LAYER | 79 | #define SCTP_DELAYED_ACK_TIME 16 |
80 | SCTP_DISABLE_FRAGMENTS, | 80 | #define SCTP_DELAYED_ACK SCTP_DELAYED_ACK_TIME |
81 | #define SCTP_DISABLE_FRAGMENTS SCTP_DISABLE_FRAGMENTS | 81 | #define SCTP_CONTEXT 17 |
82 | SCTP_PEER_ADDR_PARAMS, | 82 | #define SCTP_FRAGMENT_INTERLEAVE 18 |
83 | #define SCTP_PEER_ADDR_PARAMS SCTP_PEER_ADDR_PARAMS | 83 | #define SCTP_PARTIAL_DELIVERY_POINT 19 /* Set/Get partial delivery point */ |
84 | SCTP_DEFAULT_SEND_PARAM, | 84 | #define SCTP_MAX_BURST 20 /* Set/Get max burst */ |
85 | #define SCTP_DEFAULT_SEND_PARAM SCTP_DEFAULT_SEND_PARAM | 85 | #define SCTP_AUTH_CHUNK 21 /* Set only: add a chunk type to authenticate */ |
86 | SCTP_EVENTS, | 86 | #define SCTP_HMAC_IDENT 22 |
87 | #define SCTP_EVENTS SCTP_EVENTS | 87 | #define SCTP_AUTH_KEY 23 |
88 | SCTP_I_WANT_MAPPED_V4_ADDR, /* Turn on/off mapped v4 addresses */ | 88 | #define SCTP_AUTH_ACTIVE_KEY 24 |
89 | #define SCTP_I_WANT_MAPPED_V4_ADDR SCTP_I_WANT_MAPPED_V4_ADDR | 89 | #define SCTP_AUTH_DELETE_KEY 25 |
90 | SCTP_MAXSEG, /* Get/set maximum fragment. */ | 90 | #define SCTP_PEER_AUTH_CHUNKS 26 /* Read only */ |
91 | #define SCTP_MAXSEG SCTP_MAXSEG | 91 | #define SCTP_LOCAL_AUTH_CHUNKS 27 /* Read only */ |
92 | SCTP_STATUS, | 92 | #define SCTP_GET_ASSOC_NUMBER 28 /* Read only */ |
93 | #define SCTP_STATUS SCTP_STATUS | 93 | |
94 | SCTP_GET_PEER_ADDR_INFO, | 94 | /* Internal Socket Options. Some of the sctp library functions are |
95 | #define SCTP_GET_PEER_ADDR_INFO SCTP_GET_PEER_ADDR_INFO | 95 | * implemented using these socket options. |
96 | SCTP_DELAYED_ACK, | 96 | */ |
97 | #define SCTP_DELAYED_ACK_TIME SCTP_DELAYED_ACK | 97 | #define SCTP_SOCKOPT_BINDX_ADD 100 /* BINDX requests for adding addrs */ |
98 | #define SCTP_DELAYED_ACK SCTP_DELAYED_ACK | 98 | #define SCTP_SOCKOPT_BINDX_REM 101 /* BINDX requests for removing addrs. */ |
99 | SCTP_CONTEXT, /* Receive Context */ | 99 | #define SCTP_SOCKOPT_PEELOFF 102 /* peel off association. */ |
100 | #define SCTP_CONTEXT SCTP_CONTEXT | 100 | /* Options 104-106 are deprecated and removed. Do not use this space */ |
101 | SCTP_FRAGMENT_INTERLEAVE, | 101 | #define SCTP_SOCKOPT_CONNECTX_OLD 107 /* CONNECTX old requests. */ |
102 | #define SCTP_FRAGMENT_INTERLEAVE SCTP_FRAGMENT_INTERLEAVE | 102 | #define SCTP_GET_PEER_ADDRS 108 /* Get all peer addresss. */ |
103 | SCTP_PARTIAL_DELIVERY_POINT, /* Set/Get partial delivery point */ | 103 | #define SCTP_GET_LOCAL_ADDRS 109 /* Get all local addresss. */ |
104 | #define SCTP_PARTIAL_DELIVERY_POINT SCTP_PARTIAL_DELIVERY_POINT | 104 | #define SCTP_SOCKOPT_CONNECTX 110 /* CONNECTX requests. */ |
105 | SCTP_MAX_BURST, /* Set/Get max burst */ | 105 | #define SCTP_SOCKOPT_CONNECTX3 111 /* CONNECTX requests (updated) */ |
106 | #define SCTP_MAX_BURST SCTP_MAX_BURST | ||
107 | SCTP_AUTH_CHUNK, /* Set only: add a chunk type to authenticat */ | ||
108 | #define SCTP_AUTH_CHUNK SCTP_AUTH_CHUNK | ||
109 | SCTP_HMAC_IDENT, | ||
110 | #define SCTP_HMAC_IDENT SCTP_HMAC_IDENT | ||
111 | SCTP_AUTH_KEY, | ||
112 | #define SCTP_AUTH_KEY SCTP_AUTH_KEY | ||
113 | SCTP_AUTH_ACTIVE_KEY, | ||
114 | #define SCTP_AUTH_ACTIVE_KEY SCTP_AUTH_ACTIVE_KEY | ||
115 | SCTP_AUTH_DELETE_KEY, | ||
116 | #define SCTP_AUTH_DELETE_KEY SCTP_AUTH_DELETE_KEY | ||
117 | SCTP_PEER_AUTH_CHUNKS, /* Read only */ | ||
118 | #define SCTP_PEER_AUTH_CHUNKS SCTP_PEER_AUTH_CHUNKS | ||
119 | SCTP_LOCAL_AUTH_CHUNKS, /* Read only */ | ||
120 | #define SCTP_LOCAL_AUTH_CHUNKS SCTP_LOCAL_AUTH_CHUNKS | ||
121 | SCTP_GET_ASSOC_NUMBER, /* Read only */ | ||
122 | #define SCTP_GET_ASSOC_NUMBER SCTP_GET_ASSOC_NUMBER | ||
123 | |||
124 | |||
125 | /* Internal Socket Options. Some of the sctp library functions are | ||
126 | * implemented using these socket options. | ||
127 | */ | ||
128 | SCTP_SOCKOPT_BINDX_ADD = 100,/* BINDX requests for adding addresses. */ | ||
129 | #define SCTP_SOCKOPT_BINDX_ADD SCTP_SOCKOPT_BINDX_ADD | ||
130 | SCTP_SOCKOPT_BINDX_REM, /* BINDX requests for removing addresses. */ | ||
131 | #define SCTP_SOCKOPT_BINDX_REM SCTP_SOCKOPT_BINDX_REM | ||
132 | SCTP_SOCKOPT_PEELOFF, /* peel off association. */ | ||
133 | #define SCTP_SOCKOPT_PEELOFF SCTP_SOCKOPT_PEELOFF | ||
134 | SCTP_GET_PEER_ADDRS_NUM_OLD, /* Get number of peer addresss. */ | ||
135 | #define SCTP_GET_PEER_ADDRS_NUM_OLD SCTP_GET_PEER_ADDRS_NUM_OLD | ||
136 | SCTP_GET_PEER_ADDRS_OLD, /* Get all peer addresss. */ | ||
137 | #define SCTP_GET_PEER_ADDRS_OLD SCTP_GET_PEER_ADDRS_OLD | ||
138 | SCTP_GET_LOCAL_ADDRS_NUM_OLD, /* Get number of local addresss. */ | ||
139 | #define SCTP_GET_LOCAL_ADDRS_NUM_OLD SCTP_GET_LOCAL_ADDRS_NUM_OLD | ||
140 | SCTP_GET_LOCAL_ADDRS_OLD, /* Get all local addresss. */ | ||
141 | #define SCTP_GET_LOCAL_ADDRS_OLD SCTP_GET_LOCAL_ADDRS_OLD | ||
142 | SCTP_SOCKOPT_CONNECTX_OLD, /* CONNECTX old requests. */ | ||
143 | #define SCTP_SOCKOPT_CONNECTX_OLD SCTP_SOCKOPT_CONNECTX_OLD | ||
144 | SCTP_GET_PEER_ADDRS, /* Get all peer addresss. */ | ||
145 | #define SCTP_GET_PEER_ADDRS SCTP_GET_PEER_ADDRS | ||
146 | SCTP_GET_LOCAL_ADDRS, /* Get all local addresss. */ | ||
147 | #define SCTP_GET_LOCAL_ADDRS SCTP_GET_LOCAL_ADDRS | ||
148 | SCTP_SOCKOPT_CONNECTX, /* CONNECTX requests. */ | ||
149 | #define SCTP_SOCKOPT_CONNECTX SCTP_SOCKOPT_CONNECTX | ||
150 | SCTP_SOCKOPT_CONNECTX3, /* CONNECTX requests. (new implementation) */ | ||
151 | #define SCTP_SOCKOPT_CONNECTX3 SCTP_SOCKOPT_CONNECTX3 | ||
152 | }; | ||
153 | 106 | ||
154 | /* | 107 | /* |
155 | * 5.2.1 SCTP Initiation Structure (SCTP_INIT) | 108 | * 5.2.1 SCTP Initiation Structure (SCTP_INIT) |
@@ -206,6 +159,7 @@ enum sctp_sinfo_flags { | |||
206 | SCTP_UNORDERED = 1, /* Send/receive message unordered. */ | 159 | SCTP_UNORDERED = 1, /* Send/receive message unordered. */ |
207 | SCTP_ADDR_OVER = 2, /* Override the primary destination. */ | 160 | SCTP_ADDR_OVER = 2, /* Override the primary destination. */ |
208 | SCTP_ABORT=4, /* Send an ABORT message to the peer. */ | 161 | SCTP_ABORT=4, /* Send an ABORT message to the peer. */ |
162 | SCTP_SACK_IMMEDIATELY = 8, /* SACK should be sent without delay */ | ||
209 | SCTP_EOF=MSG_FIN, /* Initiate graceful shutdown process. */ | 163 | SCTP_EOF=MSG_FIN, /* Initiate graceful shutdown process. */ |
210 | }; | 164 | }; |
211 | 165 | ||
diff --git a/include/net/sock.h b/include/net/sock.h index 9f96394f694e..3f1a4804bb3f 100644 --- a/include/net/sock.h +++ b/include/net/sock.h | |||
@@ -105,14 +105,17 @@ struct net; | |||
105 | /** | 105 | /** |
106 | * struct sock_common - minimal network layer representation of sockets | 106 | * struct sock_common - minimal network layer representation of sockets |
107 | * @skc_node: main hash linkage for various protocol lookup tables | 107 | * @skc_node: main hash linkage for various protocol lookup tables |
108 | * @skc_nulls_node: main hash linkage for UDP/UDP-Lite protocol | 108 | * @skc_nulls_node: main hash linkage for TCP/UDP/UDP-Lite protocol |
109 | * @skc_refcnt: reference count | 109 | * @skc_refcnt: reference count |
110 | * @skc_tx_queue_mapping: tx queue number for this connection | ||
110 | * @skc_hash: hash value used with various protocol lookup tables | 111 | * @skc_hash: hash value used with various protocol lookup tables |
112 | * @skc_u16hashes: two u16 hash values used by UDP lookup tables | ||
111 | * @skc_family: network address family | 113 | * @skc_family: network address family |
112 | * @skc_state: Connection state | 114 | * @skc_state: Connection state |
113 | * @skc_reuse: %SO_REUSEADDR setting | 115 | * @skc_reuse: %SO_REUSEADDR setting |
114 | * @skc_bound_dev_if: bound device index if != 0 | 116 | * @skc_bound_dev_if: bound device index if != 0 |
115 | * @skc_bind_node: bind hash linkage for various protocol lookup tables | 117 | * @skc_bind_node: bind hash linkage for various protocol lookup tables |
118 | * @skc_portaddr_node: second hash linkage for UDP/UDP-Lite protocol | ||
116 | * @skc_prot: protocol handlers inside a network family | 119 | * @skc_prot: protocol handlers inside a network family |
117 | * @skc_net: reference to the network namespace of this socket | 120 | * @skc_net: reference to the network namespace of this socket |
118 | * | 121 | * |
@@ -128,13 +131,20 @@ struct sock_common { | |||
128 | struct hlist_nulls_node skc_nulls_node; | 131 | struct hlist_nulls_node skc_nulls_node; |
129 | }; | 132 | }; |
130 | atomic_t skc_refcnt; | 133 | atomic_t skc_refcnt; |
134 | int skc_tx_queue_mapping; | ||
131 | 135 | ||
132 | unsigned int skc_hash; | 136 | union { |
137 | unsigned int skc_hash; | ||
138 | __u16 skc_u16hashes[2]; | ||
139 | }; | ||
133 | unsigned short skc_family; | 140 | unsigned short skc_family; |
134 | volatile unsigned char skc_state; | 141 | volatile unsigned char skc_state; |
135 | unsigned char skc_reuse; | 142 | unsigned char skc_reuse; |
136 | int skc_bound_dev_if; | 143 | int skc_bound_dev_if; |
137 | struct hlist_node skc_bind_node; | 144 | union { |
145 | struct hlist_node skc_bind_node; | ||
146 | struct hlist_nulls_node skc_portaddr_node; | ||
147 | }; | ||
138 | struct proto *skc_prot; | 148 | struct proto *skc_prot; |
139 | #ifdef CONFIG_NET_NS | 149 | #ifdef CONFIG_NET_NS |
140 | struct net *skc_net; | 150 | struct net *skc_net; |
@@ -215,6 +225,7 @@ struct sock { | |||
215 | #define sk_node __sk_common.skc_node | 225 | #define sk_node __sk_common.skc_node |
216 | #define sk_nulls_node __sk_common.skc_nulls_node | 226 | #define sk_nulls_node __sk_common.skc_nulls_node |
217 | #define sk_refcnt __sk_common.skc_refcnt | 227 | #define sk_refcnt __sk_common.skc_refcnt |
228 | #define sk_tx_queue_mapping __sk_common.skc_tx_queue_mapping | ||
218 | 229 | ||
219 | #define sk_copy_start __sk_common.skc_hash | 230 | #define sk_copy_start __sk_common.skc_hash |
220 | #define sk_hash __sk_common.skc_hash | 231 | #define sk_hash __sk_common.skc_hash |
@@ -504,6 +515,8 @@ enum sock_flags { | |||
504 | SOCK_TIMESTAMPING_SOFTWARE, /* %SOF_TIMESTAMPING_SOFTWARE */ | 515 | SOCK_TIMESTAMPING_SOFTWARE, /* %SOF_TIMESTAMPING_SOFTWARE */ |
505 | SOCK_TIMESTAMPING_RAW_HARDWARE, /* %SOF_TIMESTAMPING_RAW_HARDWARE */ | 516 | SOCK_TIMESTAMPING_RAW_HARDWARE, /* %SOF_TIMESTAMPING_RAW_HARDWARE */ |
506 | SOCK_TIMESTAMPING_SYS_HARDWARE, /* %SOF_TIMESTAMPING_SYS_HARDWARE */ | 517 | SOCK_TIMESTAMPING_SYS_HARDWARE, /* %SOF_TIMESTAMPING_SYS_HARDWARE */ |
518 | SOCK_FASYNC, /* fasync() active */ | ||
519 | SOCK_RXQ_OVFL, | ||
507 | }; | 520 | }; |
508 | 521 | ||
509 | static inline void sock_copy_flags(struct sock *nsk, struct sock *osk) | 522 | static inline void sock_copy_flags(struct sock *nsk, struct sock *osk) |
@@ -1092,8 +1105,29 @@ static inline void sock_put(struct sock *sk) | |||
1092 | extern int sk_receive_skb(struct sock *sk, struct sk_buff *skb, | 1105 | extern int sk_receive_skb(struct sock *sk, struct sk_buff *skb, |
1093 | const int nested); | 1106 | const int nested); |
1094 | 1107 | ||
1108 | static inline void sk_tx_queue_set(struct sock *sk, int tx_queue) | ||
1109 | { | ||
1110 | sk->sk_tx_queue_mapping = tx_queue; | ||
1111 | } | ||
1112 | |||
1113 | static inline void sk_tx_queue_clear(struct sock *sk) | ||
1114 | { | ||
1115 | sk->sk_tx_queue_mapping = -1; | ||
1116 | } | ||
1117 | |||
1118 | static inline int sk_tx_queue_get(const struct sock *sk) | ||
1119 | { | ||
1120 | return sk->sk_tx_queue_mapping; | ||
1121 | } | ||
1122 | |||
1123 | static inline bool sk_tx_queue_recorded(const struct sock *sk) | ||
1124 | { | ||
1125 | return (sk && sk->sk_tx_queue_mapping >= 0); | ||
1126 | } | ||
1127 | |||
1095 | static inline void sk_set_socket(struct sock *sk, struct socket *sock) | 1128 | static inline void sk_set_socket(struct sock *sk, struct socket *sock) |
1096 | { | 1129 | { |
1130 | sk_tx_queue_clear(sk); | ||
1097 | sk->sk_socket = sock; | 1131 | sk->sk_socket = sock; |
1098 | } | 1132 | } |
1099 | 1133 | ||
@@ -1150,6 +1184,7 @@ __sk_dst_set(struct sock *sk, struct dst_entry *dst) | |||
1150 | { | 1184 | { |
1151 | struct dst_entry *old_dst; | 1185 | struct dst_entry *old_dst; |
1152 | 1186 | ||
1187 | sk_tx_queue_clear(sk); | ||
1153 | old_dst = sk->sk_dst_cache; | 1188 | old_dst = sk->sk_dst_cache; |
1154 | sk->sk_dst_cache = dst; | 1189 | sk->sk_dst_cache = dst; |
1155 | dst_release(old_dst); | 1190 | dst_release(old_dst); |
@@ -1168,6 +1203,7 @@ __sk_dst_reset(struct sock *sk) | |||
1168 | { | 1203 | { |
1169 | struct dst_entry *old_dst; | 1204 | struct dst_entry *old_dst; |
1170 | 1205 | ||
1206 | sk_tx_queue_clear(sk); | ||
1171 | old_dst = sk->sk_dst_cache; | 1207 | old_dst = sk->sk_dst_cache; |
1172 | sk->sk_dst_cache = NULL; | 1208 | sk->sk_dst_cache = NULL; |
1173 | dst_release(old_dst); | 1209 | dst_release(old_dst); |
@@ -1396,7 +1432,7 @@ static inline unsigned long sock_wspace(struct sock *sk) | |||
1396 | 1432 | ||
1397 | static inline void sk_wake_async(struct sock *sk, int how, int band) | 1433 | static inline void sk_wake_async(struct sock *sk, int how, int band) |
1398 | { | 1434 | { |
1399 | if (sk->sk_socket && sk->sk_socket->fasync_list) | 1435 | if (sock_flag(sk, SOCK_FASYNC)) |
1400 | sock_wake_async(sk->sk_socket, how, band); | 1436 | sock_wake_async(sk->sk_socket, how, band); |
1401 | } | 1437 | } |
1402 | 1438 | ||
@@ -1492,6 +1528,8 @@ sock_recv_timestamp(struct msghdr *msg, struct sock *sk, struct sk_buff *skb) | |||
1492 | sk->sk_stamp = kt; | 1528 | sk->sk_stamp = kt; |
1493 | } | 1529 | } |
1494 | 1530 | ||
1531 | extern void sock_recv_ts_and_drops(struct msghdr *msg, struct sock *sk, struct sk_buff *skb); | ||
1532 | |||
1495 | /** | 1533 | /** |
1496 | * sock_tx_timestamp - checks whether the outgoing packet is to be time stamped | 1534 | * sock_tx_timestamp - checks whether the outgoing packet is to be time stamped |
1497 | * @msg: outgoing packet | 1535 | * @msg: outgoing packet |
diff --git a/include/net/tc_act/tc_skbedit.h b/include/net/tc_act/tc_skbedit.h index 6abb3ed3ebf7..e103fe02f375 100644 --- a/include/net/tc_act/tc_skbedit.h +++ b/include/net/tc_act/tc_skbedit.h | |||
@@ -26,7 +26,9 @@ struct tcf_skbedit { | |||
26 | struct tcf_common common; | 26 | struct tcf_common common; |
27 | u32 flags; | 27 | u32 flags; |
28 | u32 priority; | 28 | u32 priority; |
29 | u32 mark; | ||
29 | u16 queue_mapping; | 30 | u16 queue_mapping; |
31 | /* XXX: 16-bit pad here? */ | ||
30 | }; | 32 | }; |
31 | #define to_skbedit(pc) \ | 33 | #define to_skbedit(pc) \ |
32 | container_of(pc, struct tcf_skbedit, common) | 34 | container_of(pc, struct tcf_skbedit, common) |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 03a49c703377..5740b85bc5a0 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/dmaengine.h> | 30 | #include <linux/dmaengine.h> |
31 | #include <linux/crypto.h> | 31 | #include <linux/crypto.h> |
32 | #include <linux/cryptohash.h> | 32 | #include <linux/cryptohash.h> |
33 | #include <linux/kref.h> | ||
33 | 34 | ||
34 | #include <net/inet_connection_sock.h> | 35 | #include <net/inet_connection_sock.h> |
35 | #include <net/inet_timewait_sock.h> | 36 | #include <net/inet_timewait_sock.h> |
@@ -62,9 +63,6 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
62 | /* Minimal accepted MSS. It is (60+60+8) - (20+20). */ | 63 | /* Minimal accepted MSS. It is (60+60+8) - (20+20). */ |
63 | #define TCP_MIN_MSS 88U | 64 | #define TCP_MIN_MSS 88U |
64 | 65 | ||
65 | /* Minimal RCV_MSS. */ | ||
66 | #define TCP_MIN_RCVMSS 536U | ||
67 | |||
68 | /* The least MTU to use for probing */ | 66 | /* The least MTU to use for probing */ |
69 | #define TCP_BASE_MSS 512 | 67 | #define TCP_BASE_MSS 512 |
70 | 68 | ||
@@ -167,6 +165,7 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
167 | #define TCPOPT_SACK 5 /* SACK Block */ | 165 | #define TCPOPT_SACK 5 /* SACK Block */ |
168 | #define TCPOPT_TIMESTAMP 8 /* Better RTT estimations/PAWS */ | 166 | #define TCPOPT_TIMESTAMP 8 /* Better RTT estimations/PAWS */ |
169 | #define TCPOPT_MD5SIG 19 /* MD5 Signature (RFC2385) */ | 167 | #define TCPOPT_MD5SIG 19 /* MD5 Signature (RFC2385) */ |
168 | #define TCPOPT_COOKIE 253 /* Cookie extension (experimental) */ | ||
170 | 169 | ||
171 | /* | 170 | /* |
172 | * TCP option lengths | 171 | * TCP option lengths |
@@ -177,6 +176,10 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); | |||
177 | #define TCPOLEN_SACK_PERM 2 | 176 | #define TCPOLEN_SACK_PERM 2 |
178 | #define TCPOLEN_TIMESTAMP 10 | 177 | #define TCPOLEN_TIMESTAMP 10 |
179 | #define TCPOLEN_MD5SIG 18 | 178 | #define TCPOLEN_MD5SIG 18 |
179 | #define TCPOLEN_COOKIE_BASE 2 /* Cookie-less header extension */ | ||
180 | #define TCPOLEN_COOKIE_PAIR 3 /* Cookie pair header extension */ | ||
181 | #define TCPOLEN_COOKIE_MIN (TCPOLEN_COOKIE_BASE+TCP_COOKIE_MIN) | ||
182 | #define TCPOLEN_COOKIE_MAX (TCPOLEN_COOKIE_BASE+TCP_COOKIE_MAX) | ||
180 | 183 | ||
181 | /* But this is what stacks really send out. */ | 184 | /* But this is what stacks really send out. */ |
182 | #define TCPOLEN_TSTAMP_ALIGNED 12 | 185 | #define TCPOLEN_TSTAMP_ALIGNED 12 |
@@ -237,6 +240,7 @@ extern int sysctl_tcp_base_mss; | |||
237 | extern int sysctl_tcp_workaround_signed_windows; | 240 | extern int sysctl_tcp_workaround_signed_windows; |
238 | extern int sysctl_tcp_slow_start_after_idle; | 241 | extern int sysctl_tcp_slow_start_after_idle; |
239 | extern int sysctl_tcp_max_ssthresh; | 242 | extern int sysctl_tcp_max_ssthresh; |
243 | extern int sysctl_tcp_cookie_size; | ||
240 | 244 | ||
241 | extern atomic_t tcp_memory_allocated; | 245 | extern atomic_t tcp_memory_allocated; |
242 | extern struct percpu_counter tcp_sockets_allocated; | 246 | extern struct percpu_counter tcp_sockets_allocated; |
@@ -343,11 +347,6 @@ static inline void tcp_dec_quickack_mode(struct sock *sk, | |||
343 | 347 | ||
344 | extern void tcp_enter_quickack_mode(struct sock *sk); | 348 | extern void tcp_enter_quickack_mode(struct sock *sk); |
345 | 349 | ||
346 | static inline void tcp_clear_options(struct tcp_options_received *rx_opt) | ||
347 | { | ||
348 | rx_opt->tstamp_ok = rx_opt->sack_ok = rx_opt->wscale_ok = rx_opt->snd_wscale = 0; | ||
349 | } | ||
350 | |||
351 | #define TCP_ECN_OK 1 | 350 | #define TCP_ECN_OK 1 |
352 | #define TCP_ECN_QUEUE_CWR 2 | 351 | #define TCP_ECN_QUEUE_CWR 2 |
353 | #define TCP_ECN_DEMAND_CWR 4 | 352 | #define TCP_ECN_DEMAND_CWR 4 |
@@ -359,8 +358,7 @@ TCP_ECN_create_request(struct request_sock *req, struct tcphdr *th) | |||
359 | inet_rsk(req)->ecn_ok = 1; | 358 | inet_rsk(req)->ecn_ok = 1; |
360 | } | 359 | } |
361 | 360 | ||
362 | enum tcp_tw_status | 361 | enum tcp_tw_status { |
363 | { | ||
364 | TCP_TW_SUCCESS = 0, | 362 | TCP_TW_SUCCESS = 0, |
365 | TCP_TW_RST = 1, | 363 | TCP_TW_RST = 1, |
366 | TCP_TW_ACK = 2, | 364 | TCP_TW_ACK = 2, |
@@ -409,7 +407,9 @@ extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, | |||
409 | 407 | ||
410 | extern void tcp_parse_options(struct sk_buff *skb, | 408 | extern void tcp_parse_options(struct sk_buff *skb, |
411 | struct tcp_options_received *opt_rx, | 409 | struct tcp_options_received *opt_rx, |
412 | int estab); | 410 | u8 **hvpp, |
411 | int estab, | ||
412 | struct dst_entry *dst); | ||
413 | 413 | ||
414 | extern u8 *tcp_parse_md5sig_option(struct tcphdr *th); | 414 | extern u8 *tcp_parse_md5sig_option(struct tcphdr *th); |
415 | 415 | ||
@@ -443,7 +443,8 @@ extern int tcp_connect(struct sock *sk); | |||
443 | 443 | ||
444 | extern struct sk_buff * tcp_make_synack(struct sock *sk, | 444 | extern struct sk_buff * tcp_make_synack(struct sock *sk, |
445 | struct dst_entry *dst, | 445 | struct dst_entry *dst, |
446 | struct request_sock *req); | 446 | struct request_sock *req, |
447 | struct request_values *rvp); | ||
447 | 448 | ||
448 | extern int tcp_disconnect(struct sock *sk, int flags); | 449 | extern int tcp_disconnect(struct sock *sk, int flags); |
449 | 450 | ||
@@ -1228,6 +1229,7 @@ static inline void tcp_write_queue_purge(struct sock *sk) | |||
1228 | while ((skb = __skb_dequeue(&sk->sk_write_queue)) != NULL) | 1229 | while ((skb = __skb_dequeue(&sk->sk_write_queue)) != NULL) |
1229 | sk_wmem_free_skb(sk, skb); | 1230 | sk_wmem_free_skb(sk, skb); |
1230 | sk_mem_reclaim(sk); | 1231 | sk_mem_reclaim(sk); |
1232 | tcp_clear_all_retrans_hints(tcp_sk(sk)); | ||
1231 | } | 1233 | } |
1232 | 1234 | ||
1233 | static inline struct sk_buff *tcp_write_queue_head(struct sock *sk) | 1235 | static inline struct sk_buff *tcp_write_queue_head(struct sock *sk) |
@@ -1260,7 +1262,7 @@ static inline struct sk_buff *tcp_write_queue_prev(struct sock *sk, struct sk_bu | |||
1260 | skb_queue_walk_from_safe(&(sk)->sk_write_queue, skb, tmp) | 1262 | skb_queue_walk_from_safe(&(sk)->sk_write_queue, skb, tmp) |
1261 | 1263 | ||
1262 | /* This function calculates a "timeout" which is equivalent to the timeout of a | 1264 | /* This function calculates a "timeout" which is equivalent to the timeout of a |
1263 | * TCP connection after "boundary" unsucessful, exponentially backed-off | 1265 | * TCP connection after "boundary" unsuccessful, exponentially backed-off |
1264 | * retransmissions with an initial RTO of TCP_RTO_MIN. | 1266 | * retransmissions with an initial RTO of TCP_RTO_MIN. |
1265 | */ | 1267 | */ |
1266 | static inline bool retransmits_timed_out(const struct sock *sk, | 1268 | static inline bool retransmits_timed_out(const struct sock *sk, |
@@ -1480,6 +1482,91 @@ struct tcp_request_sock_ops { | |||
1480 | #endif | 1482 | #endif |
1481 | }; | 1483 | }; |
1482 | 1484 | ||
1485 | /* Using SHA1 for now, define some constants. | ||
1486 | */ | ||
1487 | #define COOKIE_DIGEST_WORDS (SHA_DIGEST_WORDS) | ||
1488 | #define COOKIE_MESSAGE_WORDS (SHA_MESSAGE_BYTES / 4) | ||
1489 | #define COOKIE_WORKSPACE_WORDS (COOKIE_DIGEST_WORDS + COOKIE_MESSAGE_WORDS) | ||
1490 | |||
1491 | extern int tcp_cookie_generator(u32 *bakery); | ||
1492 | |||
1493 | /** | ||
1494 | * struct tcp_cookie_values - each socket needs extra space for the | ||
1495 | * cookies, together with (optional) space for any SYN data. | ||
1496 | * | ||
1497 | * A tcp_sock contains a pointer to the current value, and this is | ||
1498 | * cloned to the tcp_timewait_sock. | ||
1499 | * | ||
1500 | * @cookie_pair: variable data from the option exchange. | ||
1501 | * | ||
1502 | * @cookie_desired: user specified tcpct_cookie_desired. Zero | ||
1503 | * indicates default (sysctl_tcp_cookie_size). | ||
1504 | * After cookie sent, remembers size of cookie. | ||
1505 | * Range 0, TCP_COOKIE_MIN to TCP_COOKIE_MAX. | ||
1506 | * | ||
1507 | * @s_data_desired: user specified tcpct_s_data_desired. When the | ||
1508 | * constant payload is specified (@s_data_constant), | ||
1509 | * holds its length instead. | ||
1510 | * Range 0 to TCP_MSS_DESIRED. | ||
1511 | * | ||
1512 | * @s_data_payload: constant data that is to be included in the | ||
1513 | * payload of SYN or SYNACK segments when the | ||
1514 | * cookie option is present. | ||
1515 | */ | ||
1516 | struct tcp_cookie_values { | ||
1517 | struct kref kref; | ||
1518 | u8 cookie_pair[TCP_COOKIE_PAIR_SIZE]; | ||
1519 | u8 cookie_pair_size; | ||
1520 | u8 cookie_desired; | ||
1521 | u16 s_data_desired:11, | ||
1522 | s_data_constant:1, | ||
1523 | s_data_in:1, | ||
1524 | s_data_out:1, | ||
1525 | s_data_unused:2; | ||
1526 | u8 s_data_payload[0]; | ||
1527 | }; | ||
1528 | |||
1529 | static inline void tcp_cookie_values_release(struct kref *kref) | ||
1530 | { | ||
1531 | kfree(container_of(kref, struct tcp_cookie_values, kref)); | ||
1532 | } | ||
1533 | |||
1534 | /* The length of constant payload data. Note that s_data_desired is | ||
1535 | * overloaded, depending on s_data_constant: either the length of constant | ||
1536 | * data (returned here) or the limit on variable data. | ||
1537 | */ | ||
1538 | static inline int tcp_s_data_size(const struct tcp_sock *tp) | ||
1539 | { | ||
1540 | return (tp->cookie_values != NULL && tp->cookie_values->s_data_constant) | ||
1541 | ? tp->cookie_values->s_data_desired | ||
1542 | : 0; | ||
1543 | } | ||
1544 | |||
1545 | /** | ||
1546 | * struct tcp_extend_values - tcp_ipv?.c to tcp_output.c workspace. | ||
1547 | * | ||
1548 | * As tcp_request_sock has already been extended in other places, the | ||
1549 | * only remaining method is to pass stack values along as function | ||
1550 | * parameters. These parameters are not needed after sending SYNACK. | ||
1551 | * | ||
1552 | * @cookie_bakery: cryptographic secret and message workspace. | ||
1553 | * | ||
1554 | * @cookie_plus: bytes in authenticator/cookie option, copied from | ||
1555 | * struct tcp_options_received (above). | ||
1556 | */ | ||
1557 | struct tcp_extend_values { | ||
1558 | struct request_values rv; | ||
1559 | u32 cookie_bakery[COOKIE_WORKSPACE_WORDS]; | ||
1560 | u8 cookie_plus:6, | ||
1561 | cookie_out_never:1, | ||
1562 | cookie_in_always:1; | ||
1563 | }; | ||
1564 | |||
1565 | static inline struct tcp_extend_values *tcp_xv(struct request_values *rvp) | ||
1566 | { | ||
1567 | return (struct tcp_extend_values *)rvp; | ||
1568 | } | ||
1569 | |||
1483 | extern void tcp_v4_init(void); | 1570 | extern void tcp_v4_init(void); |
1484 | extern void tcp_init(void); | 1571 | extern void tcp_init(void); |
1485 | 1572 | ||
diff --git a/include/net/udp.h b/include/net/udp.h index f98abd2ce709..5348d80b25bb 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
@@ -50,16 +50,49 @@ struct udp_skb_cb { | |||
50 | }; | 50 | }; |
51 | #define UDP_SKB_CB(__skb) ((struct udp_skb_cb *)((__skb)->cb)) | 51 | #define UDP_SKB_CB(__skb) ((struct udp_skb_cb *)((__skb)->cb)) |
52 | 52 | ||
53 | /** | ||
54 | * struct udp_hslot - UDP hash slot | ||
55 | * | ||
56 | * @head: head of list of sockets | ||
57 | * @count: number of sockets in 'head' list | ||
58 | * @lock: spinlock protecting changes to head/count | ||
59 | */ | ||
53 | struct udp_hslot { | 60 | struct udp_hslot { |
54 | struct hlist_nulls_head head; | 61 | struct hlist_nulls_head head; |
62 | int count; | ||
55 | spinlock_t lock; | 63 | spinlock_t lock; |
56 | } __attribute__((aligned(2 * sizeof(long)))); | 64 | } __attribute__((aligned(2 * sizeof(long)))); |
65 | |||
66 | /** | ||
67 | * struct udp_table - UDP table | ||
68 | * | ||
69 | * @hash: hash table, sockets are hashed on (local port) | ||
70 | * @hash2: hash table, sockets are hashed on (local port, local address) | ||
71 | * @mask: number of slots in hash tables, minus 1 | ||
72 | * @log: log2(number of slots in hash table) | ||
73 | */ | ||
57 | struct udp_table { | 74 | struct udp_table { |
58 | struct udp_hslot hash[UDP_HTABLE_SIZE]; | 75 | struct udp_hslot *hash; |
76 | struct udp_hslot *hash2; | ||
77 | unsigned int mask; | ||
78 | unsigned int log; | ||
59 | }; | 79 | }; |
60 | extern struct udp_table udp_table; | 80 | extern struct udp_table udp_table; |
61 | extern void udp_table_init(struct udp_table *); | 81 | extern void udp_table_init(struct udp_table *, const char *); |
62 | 82 | static inline struct udp_hslot *udp_hashslot(struct udp_table *table, | |
83 | struct net *net, unsigned num) | ||
84 | { | ||
85 | return &table->hash[udp_hashfn(net, num, table->mask)]; | ||
86 | } | ||
87 | /* | ||
88 | * For secondary hash, net_hash_mix() is performed before calling | ||
89 | * udp_hashslot2(), this explains difference with udp_hashslot() | ||
90 | */ | ||
91 | static inline struct udp_hslot *udp_hashslot2(struct udp_table *table, | ||
92 | unsigned int hash) | ||
93 | { | ||
94 | return &table->hash2[hash & table->mask]; | ||
95 | } | ||
63 | 96 | ||
64 | /* Note: this must match 'valbool' in sock_setsockopt */ | 97 | /* Note: this must match 'valbool' in sock_setsockopt */ |
65 | #define UDP_CSUM_NOXMIT 1 | 98 | #define UDP_CSUM_NOXMIT 1 |
@@ -125,7 +158,8 @@ static inline void udp_lib_close(struct sock *sk, long timeout) | |||
125 | } | 158 | } |
126 | 159 | ||
127 | extern int udp_lib_get_port(struct sock *sk, unsigned short snum, | 160 | extern int udp_lib_get_port(struct sock *sk, unsigned short snum, |
128 | int (*)(const struct sock*,const struct sock*)); | 161 | int (*)(const struct sock *,const struct sock *), |
162 | unsigned int hash2_nulladdr); | ||
129 | 163 | ||
130 | /* net/ipv4/udp.c */ | 164 | /* net/ipv4/udp.c */ |
131 | extern int udp_get_port(struct sock *sk, unsigned short snum, | 165 | extern int udp_get_port(struct sock *sk, unsigned short snum, |
diff --git a/include/net/wext.h b/include/net/wext.h index 3f2b94de2cfa..4f6e7423174c 100644 --- a/include/net/wext.h +++ b/include/net/wext.h | |||
@@ -1,29 +1,19 @@ | |||
1 | #ifndef __NET_WEXT_H | 1 | #ifndef __NET_WEXT_H |
2 | #define __NET_WEXT_H | 2 | #define __NET_WEXT_H |
3 | 3 | ||
4 | /* | 4 | #include <net/iw_handler.h> |
5 | * wireless extensions interface to the core code | ||
6 | */ | ||
7 | 5 | ||
8 | struct net; | 6 | struct net; |
9 | 7 | ||
10 | #ifdef CONFIG_WIRELESS_EXT | 8 | #ifdef CONFIG_WEXT_CORE |
11 | extern int wext_proc_init(struct net *net); | ||
12 | extern void wext_proc_exit(struct net *net); | ||
13 | extern int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd, | 9 | extern int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd, |
14 | void __user *arg); | 10 | void __user *arg); |
15 | extern int compat_wext_handle_ioctl(struct net *net, unsigned int cmd, | 11 | extern int compat_wext_handle_ioctl(struct net *net, unsigned int cmd, |
16 | unsigned long arg); | 12 | unsigned long arg); |
13 | |||
17 | extern struct iw_statistics *get_wireless_stats(struct net_device *dev); | 14 | extern struct iw_statistics *get_wireless_stats(struct net_device *dev); |
15 | extern int call_commit_handler(struct net_device *dev); | ||
18 | #else | 16 | #else |
19 | static inline int wext_proc_init(struct net *net) | ||
20 | { | ||
21 | return 0; | ||
22 | } | ||
23 | static inline void wext_proc_exit(struct net *net) | ||
24 | { | ||
25 | return; | ||
26 | } | ||
27 | static inline int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd, | 17 | static inline int wext_handle_ioctl(struct net *net, struct ifreq *ifr, unsigned int cmd, |
28 | void __user *arg) | 18 | void __user *arg) |
29 | { | 19 | { |
@@ -36,4 +26,35 @@ static inline int compat_wext_handle_ioctl(struct net *net, unsigned int cmd, | |||
36 | } | 26 | } |
37 | #endif | 27 | #endif |
38 | 28 | ||
29 | #ifdef CONFIG_WEXT_PROC | ||
30 | extern int wext_proc_init(struct net *net); | ||
31 | extern void wext_proc_exit(struct net *net); | ||
32 | #else | ||
33 | static inline int wext_proc_init(struct net *net) | ||
34 | { | ||
35 | return 0; | ||
36 | } | ||
37 | static inline void wext_proc_exit(struct net *net) | ||
38 | { | ||
39 | return; | ||
40 | } | ||
41 | #endif | ||
42 | |||
43 | #ifdef CONFIG_WEXT_PRIV | ||
44 | int ioctl_private_call(struct net_device *dev, struct iwreq *iwr, | ||
45 | unsigned int cmd, struct iw_request_info *info, | ||
46 | iw_handler handler); | ||
47 | int compat_private_call(struct net_device *dev, struct iwreq *iwr, | ||
48 | unsigned int cmd, struct iw_request_info *info, | ||
49 | iw_handler handler); | ||
50 | int iw_handler_get_private(struct net_device * dev, | ||
51 | struct iw_request_info * info, | ||
52 | union iwreq_data * wrqu, | ||
53 | char * extra); | ||
54 | #else | ||
55 | #define ioctl_private_call NULL | ||
56 | #define compat_private_call NULL | ||
57 | #endif | ||
58 | |||
59 | |||
39 | #endif /* __NET_WEXT_H */ | 60 | #endif /* __NET_WEXT_H */ |
diff --git a/include/net/wimax.h b/include/net/wimax.h index 2af7bf839f23..3461aa1df1e0 100644 --- a/include/net/wimax.h +++ b/include/net/wimax.h | |||
@@ -79,7 +79,7 @@ | |||
79 | * drivers have to only report state changes due to external | 79 | * drivers have to only report state changes due to external |
80 | * conditions. | 80 | * conditions. |
81 | * | 81 | * |
82 | * All API operations are 'atomic', serialized thorough a mutex in the | 82 | * All API operations are 'atomic', serialized through a mutex in the |
83 | * `struct wimax_dev`. | 83 | * `struct wimax_dev`. |
84 | * | 84 | * |
85 | * EXPORTING TO USER SPACE THROUGH GENERIC NETLINK | 85 | * EXPORTING TO USER SPACE THROUGH GENERIC NETLINK |
@@ -195,6 +195,12 @@ | |||
195 | * defining the `struct nla_policy` for each message, it has to have | 195 | * defining the `struct nla_policy` for each message, it has to have |
196 | * an array size of WIMAX_GNL_ATTR_MAX+1. | 196 | * an array size of WIMAX_GNL_ATTR_MAX+1. |
197 | * | 197 | * |
198 | * The op_*() function pointers will not be called if the wimax_dev is | ||
199 | * in a state <= %WIMAX_ST_UNINITIALIZED. The exception is: | ||
200 | * | ||
201 | * - op_reset: can be called at any time after wimax_dev_add() has | ||
202 | * been called. | ||
203 | * | ||
198 | * THE PIPE INTERFACE: | 204 | * THE PIPE INTERFACE: |
199 | * | 205 | * |
200 | * This interface is kept intentionally simple. The driver can send | 206 | * This interface is kept intentionally simple. The driver can send |
diff --git a/include/net/wpan-phy.h b/include/net/wpan-phy.h index 547b1e271ac9..85926231c07a 100644 --- a/include/net/wpan-phy.h +++ b/include/net/wpan-phy.h | |||
@@ -34,20 +34,32 @@ struct wpan_phy { | |||
34 | */ | 34 | */ |
35 | u8 current_channel; | 35 | u8 current_channel; |
36 | u8 current_page; | 36 | u8 current_page; |
37 | u32 channels_supported; | 37 | u32 channels_supported[32]; |
38 | u8 transmit_power; | 38 | u8 transmit_power; |
39 | u8 cca_mode; | 39 | u8 cca_mode; |
40 | 40 | ||
41 | struct device dev; | 41 | struct device dev; |
42 | int idx; | 42 | int idx; |
43 | 43 | ||
44 | struct net_device *(*add_iface)(struct wpan_phy *phy, | ||
45 | const char *name); | ||
46 | void (*del_iface)(struct wpan_phy *phy, struct net_device *dev); | ||
47 | |||
44 | char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); | 48 | char priv[0] __attribute__((__aligned__(NETDEV_ALIGN))); |
45 | }; | 49 | }; |
46 | 50 | ||
51 | #define to_phy(_dev) container_of(_dev, struct wpan_phy, dev) | ||
52 | |||
47 | struct wpan_phy *wpan_phy_alloc(size_t priv_size); | 53 | struct wpan_phy *wpan_phy_alloc(size_t priv_size); |
48 | int wpan_phy_register(struct device *parent, struct wpan_phy *phy); | 54 | static inline void wpan_phy_set_dev(struct wpan_phy *phy, struct device *dev) |
55 | { | ||
56 | phy->dev.parent = dev; | ||
57 | } | ||
58 | int wpan_phy_register(struct wpan_phy *phy); | ||
49 | void wpan_phy_unregister(struct wpan_phy *phy); | 59 | void wpan_phy_unregister(struct wpan_phy *phy); |
50 | void wpan_phy_free(struct wpan_phy *phy); | 60 | void wpan_phy_free(struct wpan_phy *phy); |
61 | /* Same semantics as for class_for_each_device */ | ||
62 | int wpan_phy_for_each(int (*fn)(struct wpan_phy *phy, void *data), void *data); | ||
51 | 63 | ||
52 | static inline void *wpan_phy_priv(struct wpan_phy *phy) | 64 | static inline void *wpan_phy_priv(struct wpan_phy *phy) |
53 | { | 65 | { |
@@ -56,6 +68,12 @@ static inline void *wpan_phy_priv(struct wpan_phy *phy) | |||
56 | } | 68 | } |
57 | 69 | ||
58 | struct wpan_phy *wpan_phy_find(const char *str); | 70 | struct wpan_phy *wpan_phy_find(const char *str); |
71 | |||
72 | static inline void wpan_phy_put(struct wpan_phy *phy) | ||
73 | { | ||
74 | put_device(&phy->dev); | ||
75 | } | ||
76 | |||
59 | static inline const char *wpan_phy_name(struct wpan_phy *phy) | 77 | static inline const char *wpan_phy_name(struct wpan_phy *phy) |
60 | { | 78 | { |
61 | return dev_name(&phy->dev); | 79 | return dev_name(&phy->dev); |
diff --git a/include/net/x25.h b/include/net/x25.h index 2cda04011568..9baa07dc7d17 100644 --- a/include/net/x25.h +++ b/include/net/x25.h | |||
@@ -287,8 +287,14 @@ extern unsigned long x25_display_timer(struct sock *); | |||
287 | extern void x25_check_rbuf(struct sock *); | 287 | extern void x25_check_rbuf(struct sock *); |
288 | 288 | ||
289 | /* sysctl_net_x25.c */ | 289 | /* sysctl_net_x25.c */ |
290 | #ifdef CONFIG_SYSCTL | ||
290 | extern void x25_register_sysctl(void); | 291 | extern void x25_register_sysctl(void); |
291 | extern void x25_unregister_sysctl(void); | 292 | extern void x25_unregister_sysctl(void); |
293 | #else | ||
294 | static inline void x25_register_sysctl(void) {}; | ||
295 | static inline void x25_unregister_sysctl(void) {}; | ||
296 | #endif /* CONFIG_SYSCTL */ | ||
297 | |||
292 | struct x25_skb_cb { | 298 | struct x25_skb_cb { |
293 | unsigned flags; | 299 | unsigned flags; |
294 | }; | 300 | }; |
diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 223e90a44824..6d85861ab990 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h | |||
@@ -19,6 +19,9 @@ | |||
19 | #include <net/route.h> | 19 | #include <net/route.h> |
20 | #include <net/ipv6.h> | 20 | #include <net/ipv6.h> |
21 | #include <net/ip6_fib.h> | 21 | #include <net/ip6_fib.h> |
22 | |||
23 | #include <linux/interrupt.h> | ||
24 | |||
22 | #ifdef CONFIG_XFRM_STATISTICS | 25 | #ifdef CONFIG_XFRM_STATISTICS |
23 | #include <net/snmp.h> | 26 | #include <net/snmp.h> |
24 | #endif | 27 | #endif |
@@ -121,8 +124,7 @@ struct xfrm_state_walk { | |||
121 | }; | 124 | }; |
122 | 125 | ||
123 | /* Full description of state of transformer. */ | 126 | /* Full description of state of transformer. */ |
124 | struct xfrm_state | 127 | struct xfrm_state { |
125 | { | ||
126 | #ifdef CONFIG_NET_NS | 128 | #ifdef CONFIG_NET_NS |
127 | struct net *xs_net; | 129 | struct net *xs_net; |
128 | #endif | 130 | #endif |
@@ -160,7 +162,7 @@ struct xfrm_state | |||
160 | struct xfrm_lifetime_cfg lft; | 162 | struct xfrm_lifetime_cfg lft; |
161 | 163 | ||
162 | /* Data for transformer */ | 164 | /* Data for transformer */ |
163 | struct xfrm_algo *aalg; | 165 | struct xfrm_algo_auth *aalg; |
164 | struct xfrm_algo *ealg; | 166 | struct xfrm_algo *ealg; |
165 | struct xfrm_algo *calg; | 167 | struct xfrm_algo *calg; |
166 | struct xfrm_algo_aead *aead; | 168 | struct xfrm_algo_aead *aead; |
@@ -199,7 +201,7 @@ struct xfrm_state | |||
199 | struct xfrm_stats stats; | 201 | struct xfrm_stats stats; |
200 | 202 | ||
201 | struct xfrm_lifetime_cur curlft; | 203 | struct xfrm_lifetime_cur curlft; |
202 | struct timer_list timer; | 204 | struct tasklet_hrtimer mtimer; |
203 | 205 | ||
204 | /* Last used time */ | 206 | /* Last used time */ |
205 | unsigned long lastused; | 207 | unsigned long lastused; |
@@ -237,8 +239,7 @@ enum { | |||
237 | }; | 239 | }; |
238 | 240 | ||
239 | /* callback structure passed from either netlink or pfkey */ | 241 | /* callback structure passed from either netlink or pfkey */ |
240 | struct km_event | 242 | struct km_event { |
241 | { | ||
242 | union { | 243 | union { |
243 | u32 hard; | 244 | u32 hard; |
244 | u32 proto; | 245 | u32 proto; |
@@ -313,8 +314,7 @@ extern int xfrm_state_unregister_afinfo(struct xfrm_state_afinfo *afinfo); | |||
313 | 314 | ||
314 | extern void xfrm_state_delete_tunnel(struct xfrm_state *x); | 315 | extern void xfrm_state_delete_tunnel(struct xfrm_state *x); |
315 | 316 | ||
316 | struct xfrm_type | 317 | struct xfrm_type { |
317 | { | ||
318 | char *description; | 318 | char *description; |
319 | struct module *owner; | 319 | struct module *owner; |
320 | __u8 proto; | 320 | __u8 proto; |
@@ -420,8 +420,7 @@ static inline struct xfrm_mode *xfrm_ip2inner_mode(struct xfrm_state *x, int ipp | |||
420 | return x->inner_mode_iaf; | 420 | return x->inner_mode_iaf; |
421 | } | 421 | } |
422 | 422 | ||
423 | struct xfrm_tmpl | 423 | struct xfrm_tmpl { |
424 | { | ||
425 | /* id in template is interpreted as: | 424 | /* id in template is interpreted as: |
426 | * daddr - destination of tunnel, may be zero for transport mode. | 425 | * daddr - destination of tunnel, may be zero for transport mode. |
427 | * spi - zero to acquire spi. Not zero if spi is static, then | 426 | * spi - zero to acquire spi. Not zero if spi is static, then |
@@ -468,8 +467,7 @@ struct xfrm_policy_walk { | |||
468 | u32 seq; | 467 | u32 seq; |
469 | }; | 468 | }; |
470 | 469 | ||
471 | struct xfrm_policy | 470 | struct xfrm_policy { |
472 | { | ||
473 | #ifdef CONFIG_NET_NS | 471 | #ifdef CONFIG_NET_NS |
474 | struct net *xp_net; | 472 | struct net *xp_net; |
475 | #endif | 473 | #endif |
@@ -538,8 +536,7 @@ struct xfrm_migrate { | |||
538 | /* default seq threshold size */ | 536 | /* default seq threshold size */ |
539 | #define XFRM_AE_SEQT_SIZE 2 | 537 | #define XFRM_AE_SEQT_SIZE 2 |
540 | 538 | ||
541 | struct xfrm_mgr | 539 | struct xfrm_mgr { |
542 | { | ||
543 | struct list_head list; | 540 | struct list_head list; |
544 | char *id; | 541 | char *id; |
545 | int (*notify)(struct xfrm_state *x, struct km_event *c); | 542 | int (*notify)(struct xfrm_state *x, struct km_event *c); |
@@ -626,8 +623,7 @@ struct xfrm_spi_skb_cb { | |||
626 | #define XFRM_SPI_SKB_CB(__skb) ((struct xfrm_spi_skb_cb *)&((__skb)->cb[0])) | 623 | #define XFRM_SPI_SKB_CB(__skb) ((struct xfrm_spi_skb_cb *)&((__skb)->cb[0])) |
627 | 624 | ||
628 | /* Audit Information */ | 625 | /* Audit Information */ |
629 | struct xfrm_audit | 626 | struct xfrm_audit { |
630 | { | ||
631 | u32 secid; | 627 | u32 secid; |
632 | uid_t loginuid; | 628 | uid_t loginuid; |
633 | u32 sessionid; | 629 | u32 sessionid; |
@@ -871,8 +867,7 @@ static inline int xfrm_sec_ctx_match(struct xfrm_sec_ctx *s1, struct xfrm_sec_ct | |||
871 | * bundles differing by session id. All the bundles grow from a parent | 867 | * bundles differing by session id. All the bundles grow from a parent |
872 | * policy rule. | 868 | * policy rule. |
873 | */ | 869 | */ |
874 | struct xfrm_dst | 870 | struct xfrm_dst { |
875 | { | ||
876 | union { | 871 | union { |
877 | struct dst_entry dst; | 872 | struct dst_entry dst; |
878 | struct rtable rt; | 873 | struct rtable rt; |
@@ -907,8 +902,7 @@ static inline void xfrm_dst_destroy(struct xfrm_dst *xdst) | |||
907 | 902 | ||
908 | extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev); | 903 | extern void xfrm_dst_ifdown(struct dst_entry *dst, struct net_device *dev); |
909 | 904 | ||
910 | struct sec_path | 905 | struct sec_path { |
911 | { | ||
912 | atomic_t refcnt; | 906 | atomic_t refcnt; |
913 | int len; | 907 | int len; |
914 | struct xfrm_state *xvec[XFRM_MAX_DEPTH]; | 908 | struct xfrm_state *xvec[XFRM_MAX_DEPTH]; |
@@ -1500,9 +1494,6 @@ struct scatterlist; | |||
1500 | typedef int (icv_update_fn_t)(struct hash_desc *, struct scatterlist *, | 1494 | typedef int (icv_update_fn_t)(struct hash_desc *, struct scatterlist *, |
1501 | unsigned int); | 1495 | unsigned int); |
1502 | 1496 | ||
1503 | extern int skb_icv_walk(const struct sk_buff *skb, struct hash_desc *tfm, | ||
1504 | int offset, int len, icv_update_fn_t icv_update); | ||
1505 | |||
1506 | static inline int xfrm_addr_cmp(xfrm_address_t *a, xfrm_address_t *b, | 1497 | static inline int xfrm_addr_cmp(xfrm_address_t *a, xfrm_address_t *b, |
1507 | int family) | 1498 | int family) |
1508 | { | 1499 | { |
@@ -1541,12 +1532,22 @@ static inline int xfrm_alg_len(struct xfrm_algo *alg) | |||
1541 | return sizeof(*alg) + ((alg->alg_key_len + 7) / 8); | 1532 | return sizeof(*alg) + ((alg->alg_key_len + 7) / 8); |
1542 | } | 1533 | } |
1543 | 1534 | ||
1535 | static inline int xfrm_alg_auth_len(struct xfrm_algo_auth *alg) | ||
1536 | { | ||
1537 | return sizeof(*alg) + ((alg->alg_key_len + 7) / 8); | ||
1538 | } | ||
1539 | |||
1544 | #ifdef CONFIG_XFRM_MIGRATE | 1540 | #ifdef CONFIG_XFRM_MIGRATE |
1545 | static inline struct xfrm_algo *xfrm_algo_clone(struct xfrm_algo *orig) | 1541 | static inline struct xfrm_algo *xfrm_algo_clone(struct xfrm_algo *orig) |
1546 | { | 1542 | { |
1547 | return kmemdup(orig, xfrm_alg_len(orig), GFP_KERNEL); | 1543 | return kmemdup(orig, xfrm_alg_len(orig), GFP_KERNEL); |
1548 | } | 1544 | } |
1549 | 1545 | ||
1546 | static inline struct xfrm_algo_auth *xfrm_algo_auth_clone(struct xfrm_algo_auth *orig) | ||
1547 | { | ||
1548 | return kmemdup(orig, xfrm_alg_auth_len(orig), GFP_KERNEL); | ||
1549 | } | ||
1550 | |||
1550 | static inline void xfrm_states_put(struct xfrm_state **states, int n) | 1551 | static inline void xfrm_states_put(struct xfrm_state **states, int n) |
1551 | { | 1552 | { |
1552 | int i; | 1553 | int i; |
diff --git a/include/pcmcia/cs.h b/include/pcmcia/cs.h index 904468a191ef..afc2bfb9e917 100644 --- a/include/pcmcia/cs.h +++ b/include/pcmcia/cs.h | |||
@@ -15,6 +15,10 @@ | |||
15 | #ifndef _LINUX_CS_H | 15 | #ifndef _LINUX_CS_H |
16 | #define _LINUX_CS_H | 16 | #define _LINUX_CS_H |
17 | 17 | ||
18 | #ifdef __KERNEL__ | ||
19 | #include <linux/interrupt.h> | ||
20 | #endif | ||
21 | |||
18 | /* For AccessConfigurationRegister */ | 22 | /* For AccessConfigurationRegister */ |
19 | typedef struct conf_reg_t { | 23 | typedef struct conf_reg_t { |
20 | u_char Function; | 24 | u_char Function; |
@@ -111,11 +115,9 @@ typedef struct io_req_t { | |||
111 | 115 | ||
112 | /* For RequestIRQ and ReleaseIRQ */ | 116 | /* For RequestIRQ and ReleaseIRQ */ |
113 | typedef struct irq_req_t { | 117 | typedef struct irq_req_t { |
114 | u_int Attributes; | 118 | u_int Attributes; |
115 | u_int AssignedIRQ; | 119 | u_int AssignedIRQ; |
116 | u_int IRQInfo1, IRQInfo2; /* IRQInfo2 is ignored */ | 120 | irq_handler_t Handler; |
117 | void *Handler; | ||
118 | void *Instance; | ||
119 | } irq_req_t; | 121 | } irq_req_t; |
120 | 122 | ||
121 | /* Attributes for RequestIRQ and ReleaseIRQ */ | 123 | /* Attributes for RequestIRQ and ReleaseIRQ */ |
@@ -125,7 +127,7 @@ typedef struct irq_req_t { | |||
125 | #define IRQ_TYPE_DYNAMIC_SHARING 0x02 | 127 | #define IRQ_TYPE_DYNAMIC_SHARING 0x02 |
126 | #define IRQ_FORCED_PULSE 0x04 | 128 | #define IRQ_FORCED_PULSE 0x04 |
127 | #define IRQ_FIRST_SHARED 0x08 | 129 | #define IRQ_FIRST_SHARED 0x08 |
128 | #define IRQ_HANDLE_PRESENT 0x10 | 130 | //#define IRQ_HANDLE_PRESENT 0x10 |
129 | #define IRQ_PULSE_ALLOCATED 0x100 | 131 | #define IRQ_PULSE_ALLOCATED 0x100 |
130 | 132 | ||
131 | /* Bits in IRQInfo1 field */ | 133 | /* Bits in IRQInfo1 field */ |
diff --git a/include/pcmcia/cs_types.h b/include/pcmcia/cs_types.h index 315965a37930..f5e3b8386c8f 100644 --- a/include/pcmcia/cs_types.h +++ b/include/pcmcia/cs_types.h | |||
@@ -26,8 +26,7 @@ typedef u_int event_t; | |||
26 | typedef u_char cisdata_t; | 26 | typedef u_char cisdata_t; |
27 | typedef u_short page_t; | 27 | typedef u_short page_t; |
28 | 28 | ||
29 | struct window_t; | 29 | typedef unsigned long window_handle_t; |
30 | typedef struct window_t *window_handle_t; | ||
31 | 30 | ||
32 | struct region_t; | 31 | struct region_t; |
33 | typedef struct region_t *memory_handle_t; | 32 | typedef struct region_t *memory_handle_t; |
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h index a2be80b9a095..d403c12f7978 100644 --- a/include/pcmcia/ds.h +++ b/include/pcmcia/ds.h | |||
@@ -34,6 +34,7 @@ | |||
34 | struct pcmcia_socket; | 34 | struct pcmcia_socket; |
35 | struct pcmcia_device; | 35 | struct pcmcia_device; |
36 | struct config_t; | 36 | struct config_t; |
37 | struct net_device; | ||
37 | 38 | ||
38 | /* dynamic device IDs for PCMCIA device drivers. See | 39 | /* dynamic device IDs for PCMCIA device drivers. See |
39 | * Documentation/pcmcia/driver.txt for details. | 40 | * Documentation/pcmcia/driver.txt for details. |
@@ -137,65 +138,39 @@ struct pcmcia_device { | |||
137 | #define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev) | 138 | #define to_pcmcia_dev(n) container_of(n, struct pcmcia_device, dev) |
138 | #define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv) | 139 | #define to_pcmcia_drv(n) container_of(n, struct pcmcia_driver, drv) |
139 | 140 | ||
140 | /* deprecated -- don't use! */ | ||
141 | #define handle_to_dev(handle) (handle->dev) | ||
142 | 141 | ||
143 | 142 | /* | |
144 | /* (deprecated) error reporting by PCMCIA devices. Use dev_printk() | 143 | * CIS access. |
145 | * or dev_dbg() directly in the driver, without referring to pcmcia_error_func() | 144 | * |
146 | * and/or pcmcia_error_ret() for those functions will go away soon. | 145 | * Please use the following functions to access CIS tuples: |
147 | */ | 146 | * - pcmcia_get_tuple() |
148 | enum service { | 147 | * - pcmcia_loop_tuple() |
149 | AccessConfigurationRegister, AddSocketServices, | 148 | * - pcmcia_get_mac_from_cis() |
150 | AdjustResourceInfo, CheckEraseQueue, CloseMemory, CopyMemory, | 149 | * |
151 | DeregisterClient, DeregisterEraseQueue, GetCardServicesInfo, | 150 | * To parse a tuple_t, pcmcia_parse_tuple() exists. Its interface |
152 | GetClientInfo, GetConfigurationInfo, GetEventMask, | 151 | * might change in future. |
153 | GetFirstClient, GetFirstPartion, GetFirstRegion, GetFirstTuple, | ||
154 | GetNextClient, GetNextPartition, GetNextRegion, GetNextTuple, | ||
155 | GetStatus, GetTupleData, MapLogSocket, MapLogWindow, MapMemPage, | ||
156 | MapPhySocket, MapPhyWindow, ModifyConfiguration, ModifyWindow, | ||
157 | OpenMemory, ParseTuple, ReadMemory, RegisterClient, | ||
158 | RegisterEraseQueue, RegisterMTD, RegisterTimer, | ||
159 | ReleaseConfiguration, ReleaseExclusive, ReleaseIO, ReleaseIRQ, | ||
160 | ReleaseSocketMask, ReleaseWindow, ReplaceSocketServices, | ||
161 | RequestConfiguration, RequestExclusive, RequestIO, RequestIRQ, | ||
162 | RequestSocketMask, RequestWindow, ResetCard, ReturnSSEntry, | ||
163 | SetEventMask, SetRegion, ValidateCIS, VendorSpecific, | ||
164 | WriteMemory, BindDevice, BindMTD, ReportError, | ||
165 | SuspendCard, ResumeCard, EjectCard, InsertCard, ReplaceCIS, | ||
166 | GetFirstWindow, GetNextWindow, GetMemPage | ||
167 | }; | ||
168 | const char *pcmcia_error_func(int func); | ||
169 | const char *pcmcia_error_ret(int ret); | ||
170 | |||
171 | #define cs_error(p_dev, func, ret) \ | ||
172 | { \ | ||
173 | dev_printk(KERN_NOTICE, &p_dev->dev, \ | ||
174 | "%s : %s\n", \ | ||
175 | pcmcia_error_func(func), \ | ||
176 | pcmcia_error_ret(ret)); \ | ||
177 | } | ||
178 | |||
179 | /* CIS access. | ||
180 | * Use the pcmcia_* versions in PCMCIA drivers | ||
181 | */ | 152 | */ |
182 | int pcmcia_parse_tuple(tuple_t *tuple, cisparse_t *parse); | ||
183 | 153 | ||
184 | int pccard_get_first_tuple(struct pcmcia_socket *s, unsigned int function, | 154 | /* get the very first CIS entry of type @code. Note that buf is pointer |
185 | tuple_t *tuple); | 155 | * to u8 *buf; and that you need to kfree(buf) afterwards. */ |
186 | #define pcmcia_get_first_tuple(p_dev, tuple) \ | 156 | size_t pcmcia_get_tuple(struct pcmcia_device *p_dev, cisdata_t code, |
187 | pccard_get_first_tuple(p_dev->socket, p_dev->func, tuple) | 157 | u8 **buf); |
188 | 158 | ||
189 | int pccard_get_next_tuple(struct pcmcia_socket *s, unsigned int function, | 159 | /* loop over CIS entries */ |
190 | tuple_t *tuple); | 160 | int pcmcia_loop_tuple(struct pcmcia_device *p_dev, cisdata_t code, |
191 | #define pcmcia_get_next_tuple(p_dev, tuple) \ | 161 | int (*loop_tuple) (struct pcmcia_device *p_dev, |
192 | pccard_get_next_tuple(p_dev->socket, p_dev->func, tuple) | 162 | tuple_t *tuple, |
163 | void *priv_data), | ||
164 | void *priv_data); | ||
193 | 165 | ||
194 | int pccard_get_tuple_data(struct pcmcia_socket *s, tuple_t *tuple); | 166 | /* get the MAC address from CISTPL_FUNCE */ |
195 | #define pcmcia_get_tuple_data(p_dev, tuple) \ | 167 | int pcmcia_get_mac_from_cis(struct pcmcia_device *p_dev, |
196 | pccard_get_tuple_data(p_dev->socket, tuple) | 168 | struct net_device *dev); |
197 | 169 | ||
198 | 170 | ||
171 | /* parse a tuple_t */ | ||
172 | int pcmcia_parse_tuple(tuple_t *tuple, cisparse_t *parse); | ||
173 | |||
199 | /* loop CIS entries for valid configuration */ | 174 | /* loop CIS entries for valid configuration */ |
200 | int pcmcia_loop_config(struct pcmcia_device *p_dev, | 175 | int pcmcia_loop_config(struct pcmcia_device *p_dev, |
201 | int (*conf_check) (struct pcmcia_device *p_dev, | 176 | int (*conf_check) (struct pcmcia_device *p_dev, |
@@ -221,12 +196,11 @@ int pcmcia_request_irq(struct pcmcia_device *p_dev, irq_req_t *req); | |||
221 | int pcmcia_request_configuration(struct pcmcia_device *p_dev, | 196 | int pcmcia_request_configuration(struct pcmcia_device *p_dev, |
222 | config_req_t *req); | 197 | config_req_t *req); |
223 | 198 | ||
224 | int pcmcia_request_window(struct pcmcia_device **p_dev, win_req_t *req, | 199 | int pcmcia_request_window(struct pcmcia_device *p_dev, win_req_t *req, |
225 | window_handle_t *wh); | 200 | window_handle_t *wh); |
226 | int pcmcia_release_window(window_handle_t win); | 201 | int pcmcia_release_window(struct pcmcia_device *p_dev, window_handle_t win); |
227 | 202 | int pcmcia_map_mem_page(struct pcmcia_device *p_dev, window_handle_t win, | |
228 | int pcmcia_get_mem_page(window_handle_t win, memreq_t *req); | 203 | memreq_t *req); |
229 | int pcmcia_map_mem_page(window_handle_t win, memreq_t *req); | ||
230 | 204 | ||
231 | int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); | 205 | int pcmcia_modify_configuration(struct pcmcia_device *p_dev, modconf_t *mod); |
232 | void pcmcia_disable_device(struct pcmcia_device *p_dev); | 206 | void pcmcia_disable_device(struct pcmcia_device *p_dev); |
diff --git a/include/pcmcia/ss.h b/include/pcmcia/ss.h index e0f6feb8588c..7c23be706f12 100644 --- a/include/pcmcia/ss.h +++ b/include/pcmcia/ss.h | |||
@@ -107,15 +107,6 @@ typedef struct io_window_t { | |||
107 | struct resource *res; | 107 | struct resource *res; |
108 | } io_window_t; | 108 | } io_window_t; |
109 | 109 | ||
110 | #define WINDOW_MAGIC 0xB35C | ||
111 | typedef struct window_t { | ||
112 | u_short magic; | ||
113 | u_short index; | ||
114 | struct pcmcia_device *handle; | ||
115 | struct pcmcia_socket *sock; | ||
116 | pccard_mem_map ctl; | ||
117 | } window_t; | ||
118 | |||
119 | /* Maximum number of IO windows per socket */ | 110 | /* Maximum number of IO windows per socket */ |
120 | #define MAX_IO_WIN 2 | 111 | #define MAX_IO_WIN 2 |
121 | 112 | ||
@@ -155,7 +146,7 @@ struct pcmcia_socket { | |||
155 | u_int Config; | 146 | u_int Config; |
156 | } irq; | 147 | } irq; |
157 | io_window_t io[MAX_IO_WIN]; | 148 | io_window_t io[MAX_IO_WIN]; |
158 | window_t win[MAX_WIN]; | 149 | pccard_mem_map win[MAX_WIN]; |
159 | struct list_head cis_cache; | 150 | struct list_head cis_cache; |
160 | size_t fake_cis_len; | 151 | size_t fake_cis_len; |
161 | u8 *fake_cis; | 152 | u8 *fake_cis; |
@@ -172,7 +163,7 @@ struct pcmcia_socket { | |||
172 | u_int irq_mask; | 163 | u_int irq_mask; |
173 | u_int map_size; | 164 | u_int map_size; |
174 | u_int io_offset; | 165 | u_int io_offset; |
175 | u_char pci_irq; | 166 | u_int pci_irq; |
176 | struct pci_dev * cb_dev; | 167 | struct pci_dev * cb_dev; |
177 | 168 | ||
178 | 169 | ||
diff --git a/include/scsi/Kbuild b/include/scsi/Kbuild index 33b2750e9283..b3a0ee6b2f1c 100644 --- a/include/scsi/Kbuild +++ b/include/scsi/Kbuild | |||
@@ -2,3 +2,4 @@ header-y += scsi.h | |||
2 | header-y += scsi_netlink.h | 2 | header-y += scsi_netlink.h |
3 | header-y += scsi_netlink_fc.h | 3 | header-y += scsi_netlink_fc.h |
4 | header-y += scsi_bsg_fc.h | 4 | header-y += scsi_bsg_fc.h |
5 | header-y += fc/ | ||
diff --git a/include/scsi/fc/Kbuild b/include/scsi/fc/Kbuild new file mode 100644 index 000000000000..56603813c6cd --- /dev/null +++ b/include/scsi/fc/Kbuild | |||
@@ -0,0 +1,4 @@ | |||
1 | header-y += fc_els.h | ||
2 | header-y += fc_fs.h | ||
3 | header-y += fc_gs.h | ||
4 | header-y += fc_ns.h | ||
diff --git a/include/scsi/fc/fc_els.h b/include/scsi/fc/fc_els.h index 195ca014d3ce..f94328132a26 100644 --- a/include/scsi/fc/fc_els.h +++ b/include/scsi/fc/fc_els.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #ifndef _FC_ELS_H_ | 20 | #ifndef _FC_ELS_H_ |
21 | #define _FC_ELS_H_ | 21 | #define _FC_ELS_H_ |
22 | 22 | ||
23 | #include <linux/types.h> | ||
24 | |||
23 | /* | 25 | /* |
24 | * Fibre Channel Switch - Enhanced Link Services definitions. | 26 | * Fibre Channel Switch - Enhanced Link Services definitions. |
25 | * From T11 FC-LS Rev 1.2 June 7, 2005. | 27 | * From T11 FC-LS Rev 1.2 June 7, 2005. |
@@ -248,10 +250,12 @@ struct fc_els_csp { | |||
248 | /* | 250 | /* |
249 | * sp_features | 251 | * sp_features |
250 | */ | 252 | */ |
251 | #define FC_SP_FT_CIRO 0x8000 /* continuously increasing rel. off. */ | 253 | #define FC_SP_FT_NPIV 0x8000 /* multiple N_Port_ID support (FLOGI) */ |
254 | #define FC_SP_FT_CIRO 0x8000 /* continuously increasing rel off (PLOGI) */ | ||
252 | #define FC_SP_FT_CLAD 0x8000 /* clean address (in FLOGI LS_ACC) */ | 255 | #define FC_SP_FT_CLAD 0x8000 /* clean address (in FLOGI LS_ACC) */ |
253 | #define FC_SP_FT_RAND 0x4000 /* random relative offset */ | 256 | #define FC_SP_FT_RAND 0x4000 /* random relative offset */ |
254 | #define FC_SP_FT_VAL 0x2000 /* valid vendor version level */ | 257 | #define FC_SP_FT_VAL 0x2000 /* valid vendor version level */ |
258 | #define FC_SP_FT_NPIV_ACC 0x2000 /* NPIV assignment (FLOGI LS_ACC) */ | ||
255 | #define FC_SP_FT_FPORT 0x1000 /* F port (1) vs. N port (0) */ | 259 | #define FC_SP_FT_FPORT 0x1000 /* F port (1) vs. N port (0) */ |
256 | #define FC_SP_FT_ABB 0x0800 /* alternate BB_credit management */ | 260 | #define FC_SP_FT_ABB 0x0800 /* alternate BB_credit management */ |
257 | #define FC_SP_FT_EDTR 0x0400 /* E_D_TOV Resolution is nanoseconds */ | 261 | #define FC_SP_FT_EDTR 0x0400 /* E_D_TOV Resolution is nanoseconds */ |
diff --git a/include/scsi/fc/fc_fcoe.h b/include/scsi/fc/fc_fcoe.h index ccb3dbe90463..e6ad3d2ae475 100644 --- a/include/scsi/fc/fc_fcoe.h +++ b/include/scsi/fc/fc_fcoe.h | |||
@@ -86,6 +86,18 @@ struct fcoe_crc_eof { | |||
86 | #define FCOE_MIN_FRAME 46 | 86 | #define FCOE_MIN_FRAME 46 |
87 | 87 | ||
88 | /* | 88 | /* |
89 | * FCoE Link Error Status Block: T11 FC-BB-5 Rev2.0, Clause 7.10. | ||
90 | */ | ||
91 | struct fcoe_fc_els_lesb { | ||
92 | __be32 lesb_link_fail; /* link failure count */ | ||
93 | __be32 lesb_vlink_fail; /* virtual link failure count */ | ||
94 | __be32 lesb_miss_fka; /* missing FIP keep-alive count */ | ||
95 | __be32 lesb_symb_err; /* symbol error during carrier count */ | ||
96 | __be32 lesb_err_block; /* errored block count */ | ||
97 | __be32 lesb_fcs_error; /* frame check sequence error count */ | ||
98 | }; | ||
99 | |||
100 | /* | ||
89 | * fc_fcoe_set_mac - Store OUI + DID into MAC address field. | 101 | * fc_fcoe_set_mac - Store OUI + DID into MAC address field. |
90 | * @mac: mac address to be set | 102 | * @mac: mac address to be set |
91 | * @did: fc dest id to use | 103 | * @did: fc dest id to use |
diff --git a/include/scsi/fc/fc_fcp.h b/include/scsi/fc/fc_fcp.h index 5d38f1989f37..747e2c7d88d6 100644 --- a/include/scsi/fc/fc_fcp.h +++ b/include/scsi/fc/fc_fcp.h | |||
@@ -83,6 +83,8 @@ struct fcp_cmnd32 { | |||
83 | * fc_tm_flags - task management flags field. | 83 | * fc_tm_flags - task management flags field. |
84 | */ | 84 | */ |
85 | #define FCP_TMF_CLR_ACA 0x40 /* clear ACA condition */ | 85 | #define FCP_TMF_CLR_ACA 0x40 /* clear ACA condition */ |
86 | #define FCP_TMF_TGT_RESET 0x20 /* target reset task management, | ||
87 | deprecated as of FCP-3 */ | ||
86 | #define FCP_TMF_LUN_RESET 0x10 /* logical unit reset task management */ | 88 | #define FCP_TMF_LUN_RESET 0x10 /* logical unit reset task management */ |
87 | #define FCP_TMF_CLR_TASK_SET 0x04 /* clear task set */ | 89 | #define FCP_TMF_CLR_TASK_SET 0x04 /* clear task set */ |
88 | #define FCP_TMF_ABT_TASK_SET 0x02 /* abort task set */ | 90 | #define FCP_TMF_ABT_TASK_SET 0x02 /* abort task set */ |
@@ -196,4 +198,10 @@ struct fcp_srr { | |||
196 | __u8 srr_resvd2[3]; /* reserved */ | 198 | __u8 srr_resvd2[3]; /* reserved */ |
197 | }; | 199 | }; |
198 | 200 | ||
201 | /* | ||
202 | * Feature bits in name server FC-4 Features object. | ||
203 | */ | ||
204 | #define FCP_FEAT_TARG (1 << 0) /* target function supported */ | ||
205 | #define FCP_FEAT_INIT (1 << 1) /* initiator function supported */ | ||
206 | |||
199 | #endif /* _FC_FCP_H_ */ | 207 | #endif /* _FC_FCP_H_ */ |
diff --git a/include/scsi/fc/fc_fip.h b/include/scsi/fc/fc_fip.h index 3d138c1fcf8a..17baa19380f0 100644 --- a/include/scsi/fc/fc_fip.h +++ b/include/scsi/fc/fc_fip.h | |||
@@ -214,11 +214,21 @@ struct fip_vn_desc { | |||
214 | */ | 214 | */ |
215 | struct fip_fka_desc { | 215 | struct fip_fka_desc { |
216 | struct fip_desc fd_desc; | 216 | struct fip_desc fd_desc; |
217 | __u8 fd_resvd[2]; | 217 | __u8 fd_resvd; |
218 | __u8 fd_flags; /* bit0 is fka disable flag */ | ||
218 | __be32 fd_fka_period; /* adv./keep-alive period in mS */ | 219 | __be32 fd_fka_period; /* adv./keep-alive period in mS */ |
219 | } __attribute__((packed)); | 220 | } __attribute__((packed)); |
220 | 221 | ||
221 | /* | 222 | /* |
223 | * flags for fip_fka_desc.fd_flags | ||
224 | */ | ||
225 | enum fip_fka_flags { | ||
226 | FIP_FKA_ADV_D = 0x01, /* no need for FKA from ENode */ | ||
227 | }; | ||
228 | |||
229 | /* FIP_DT_FKA flags */ | ||
230 | |||
231 | /* | ||
222 | * FIP_DT_VENDOR descriptor. | 232 | * FIP_DT_VENDOR descriptor. |
223 | */ | 233 | */ |
224 | struct fip_vendor_desc { | 234 | struct fip_vendor_desc { |
diff --git a/include/scsi/fc/fc_fs.h b/include/scsi/fc/fc_fs.h index ac4cd38c860e..50f28b143451 100644 --- a/include/scsi/fc/fc_fs.h +++ b/include/scsi/fc/fc_fs.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #ifndef _FC_FS_H_ | 20 | #ifndef _FC_FS_H_ |
21 | #define _FC_FS_H_ | 21 | #define _FC_FS_H_ |
22 | 22 | ||
23 | #include <linux/types.h> | ||
24 | |||
23 | /* | 25 | /* |
24 | * Fibre Channel Framing and Signalling definitions. | 26 | * Fibre Channel Framing and Signalling definitions. |
25 | * From T11 FC-FS-2 Rev 0.90 - 9 August 2005. | 27 | * From T11 FC-FS-2 Rev 0.90 - 9 August 2005. |
diff --git a/include/scsi/fc/fc_gs.h b/include/scsi/fc/fc_gs.h index 324dd0e3c622..a37346d47eb1 100644 --- a/include/scsi/fc/fc_gs.h +++ b/include/scsi/fc/fc_gs.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #ifndef _FC_GS_H_ | 20 | #ifndef _FC_GS_H_ |
21 | #define _FC_GS_H_ | 21 | #define _FC_GS_H_ |
22 | 22 | ||
23 | #include <linux/types.h> | ||
24 | |||
23 | /* | 25 | /* |
24 | * Fibre Channel Services - Common Transport. | 26 | * Fibre Channel Services - Common Transport. |
25 | * From T11.org FC-GS-2 Rev 5.3 November 1998. | 27 | * From T11.org FC-GS-2 Rev 5.3 November 1998. |
diff --git a/include/scsi/fc/fc_ns.h b/include/scsi/fc/fc_ns.h index 790d7b97d4bc..e7d3ac497d7d 100644 --- a/include/scsi/fc/fc_ns.h +++ b/include/scsi/fc/fc_ns.h | |||
@@ -20,6 +20,8 @@ | |||
20 | #ifndef _FC_NS_H_ | 20 | #ifndef _FC_NS_H_ |
21 | #define _FC_NS_H_ | 21 | #define _FC_NS_H_ |
22 | 22 | ||
23 | #include <linux/types.h> | ||
24 | |||
23 | /* | 25 | /* |
24 | * Fibre Channel Services - Name Service (dNS) | 26 | * Fibre Channel Services - Name Service (dNS) |
25 | * From T11.org FC-GS-2 Rev 5.3 November 1998. | 27 | * From T11.org FC-GS-2 Rev 5.3 November 1998. |
@@ -44,9 +46,12 @@ enum fc_ns_req { | |||
44 | FC_NS_GID_FT = 0x0171, /* get IDs by FC4 type */ | 46 | FC_NS_GID_FT = 0x0171, /* get IDs by FC4 type */ |
45 | FC_NS_GPN_FT = 0x0172, /* get port names by FC4 type */ | 47 | FC_NS_GPN_FT = 0x0172, /* get port names by FC4 type */ |
46 | FC_NS_GID_PT = 0x01a1, /* get IDs by port type */ | 48 | FC_NS_GID_PT = 0x01a1, /* get IDs by port type */ |
47 | FC_NS_RFT_ID = 0x0217, /* reg FC4 type for ID */ | ||
48 | FC_NS_RPN_ID = 0x0212, /* reg port name for ID */ | 49 | FC_NS_RPN_ID = 0x0212, /* reg port name for ID */ |
49 | FC_NS_RNN_ID = 0x0213, /* reg node name for ID */ | 50 | FC_NS_RNN_ID = 0x0213, /* reg node name for ID */ |
51 | FC_NS_RFT_ID = 0x0217, /* reg FC4 type for ID */ | ||
52 | FC_NS_RSPN_ID = 0x0218, /* reg symbolic port name */ | ||
53 | FC_NS_RFF_ID = 0x021f, /* reg FC4 Features for ID */ | ||
54 | FC_NS_RSNN_NN = 0x0239, /* reg symbolic node name */ | ||
50 | }; | 55 | }; |
51 | 56 | ||
52 | /* | 57 | /* |
@@ -156,4 +161,32 @@ struct fc_ns_rn_id { | |||
156 | __be64 fr_wwn; /* node name or port name */ | 161 | __be64 fr_wwn; /* node name or port name */ |
157 | } __attribute__((__packed__)); | 162 | } __attribute__((__packed__)); |
158 | 163 | ||
164 | /* | ||
165 | * RSNN_NN request - register symbolic node name | ||
166 | */ | ||
167 | struct fc_ns_rsnn { | ||
168 | __be64 fr_wwn; /* node name */ | ||
169 | __u8 fr_name_len; | ||
170 | char fr_name[]; | ||
171 | } __attribute__((__packed__)); | ||
172 | |||
173 | /* | ||
174 | * RSPN_ID request - register symbolic port name | ||
175 | */ | ||
176 | struct fc_ns_rspn { | ||
177 | struct fc_ns_fid fr_fid; /* port ID object */ | ||
178 | __u8 fr_name_len; | ||
179 | char fr_name[]; | ||
180 | } __attribute__((__packed__)); | ||
181 | |||
182 | /* | ||
183 | * RFF_ID request - register FC-4 Features for ID. | ||
184 | */ | ||
185 | struct fc_ns_rff_id { | ||
186 | struct fc_ns_fid fr_fid; /* port ID object */ | ||
187 | __u8 fr_resvd[2]; | ||
188 | __u8 fr_feat; /* FC-4 Feature bits */ | ||
189 | __u8 fr_type; /* FC-4 type */ | ||
190 | } __attribute__((__packed__)); | ||
191 | |||
159 | #endif /* _FC_NS_H_ */ | 192 | #endif /* _FC_NS_H_ */ |
diff --git a/include/scsi/fc_encode.h b/include/scsi/fc_encode.h index 27dad703824f..8eb0a0fc0a71 100644 --- a/include/scsi/fc_encode.h +++ b/include/scsi/fc_encode.h | |||
@@ -32,7 +32,10 @@ struct fc_ct_req { | |||
32 | struct fc_ns_gid_ft gid; | 32 | struct fc_ns_gid_ft gid; |
33 | struct fc_ns_rn_id rn; | 33 | struct fc_ns_rn_id rn; |
34 | struct fc_ns_rft rft; | 34 | struct fc_ns_rft rft; |
35 | struct fc_ns_rff_id rff; | ||
35 | struct fc_ns_fid fid; | 36 | struct fc_ns_fid fid; |
37 | struct fc_ns_rsnn snn; | ||
38 | struct fc_ns_rspn spn; | ||
36 | } payload; | 39 | } payload; |
37 | }; | 40 | }; |
38 | 41 | ||
@@ -109,6 +112,7 @@ static inline int fc_ct_fill(struct fc_lport *lport, | |||
109 | enum fc_fh_type *fh_type) | 112 | enum fc_fh_type *fh_type) |
110 | { | 113 | { |
111 | struct fc_ct_req *ct; | 114 | struct fc_ct_req *ct; |
115 | size_t len; | ||
112 | 116 | ||
113 | switch (op) { | 117 | switch (op) { |
114 | case FC_NS_GPN_FT: | 118 | case FC_NS_GPN_FT: |
@@ -128,12 +132,41 @@ static inline int fc_ct_fill(struct fc_lport *lport, | |||
128 | ct->payload.rft.fts = lport->fcts; | 132 | ct->payload.rft.fts = lport->fcts; |
129 | break; | 133 | break; |
130 | 134 | ||
131 | case FC_NS_RPN_ID: | 135 | case FC_NS_RFF_ID: |
136 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rff_id)); | ||
137 | hton24(ct->payload.rff.fr_fid.fp_fid, | ||
138 | fc_host_port_id(lport->host)); | ||
139 | ct->payload.rff.fr_type = FC_TYPE_FCP; | ||
140 | if (lport->service_params & FCP_SPPF_INIT_FCN) | ||
141 | ct->payload.rff.fr_feat = FCP_FEAT_INIT; | ||
142 | if (lport->service_params & FCP_SPPF_TARG_FCN) | ||
143 | ct->payload.rff.fr_feat |= FCP_FEAT_TARG; | ||
144 | break; | ||
145 | |||
146 | case FC_NS_RNN_ID: | ||
132 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rn_id)); | 147 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rn_id)); |
133 | hton24(ct->payload.rn.fr_fid.fp_fid, | 148 | hton24(ct->payload.rn.fr_fid.fp_fid, |
134 | fc_host_port_id(lport->host)); | 149 | fc_host_port_id(lport->host)); |
135 | ct->payload.rft.fts = lport->fcts; | 150 | put_unaligned_be64(lport->wwnn, &ct->payload.rn.fr_wwn); |
136 | put_unaligned_be64(lport->wwpn, &ct->payload.rn.fr_wwn); | 151 | break; |
152 | |||
153 | case FC_NS_RSPN_ID: | ||
154 | len = strnlen(fc_host_symbolic_name(lport->host), 255); | ||
155 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rspn) + len); | ||
156 | hton24(ct->payload.spn.fr_fid.fp_fid, | ||
157 | fc_host_port_id(lport->host)); | ||
158 | strncpy(ct->payload.spn.fr_name, | ||
159 | fc_host_symbolic_name(lport->host), len); | ||
160 | ct->payload.spn.fr_name_len = len; | ||
161 | break; | ||
162 | |||
163 | case FC_NS_RSNN_NN: | ||
164 | len = strnlen(fc_host_symbolic_name(lport->host), 255); | ||
165 | ct = fc_ct_hdr_fill(fp, op, sizeof(struct fc_ns_rsnn) + len); | ||
166 | put_unaligned_be64(lport->wwnn, &ct->payload.snn.fr_wwn); | ||
167 | strncpy(ct->payload.snn.fr_name, | ||
168 | fc_host_symbolic_name(lport->host), len); | ||
169 | ct->payload.snn.fr_name_len = len; | ||
137 | break; | 170 | break; |
138 | 171 | ||
139 | default: | 172 | default: |
@@ -198,6 +231,31 @@ static inline void fc_flogi_fill(struct fc_lport *lport, struct fc_frame *fp) | |||
198 | sp->sp_bb_data = htons((u16) lport->mfs); | 231 | sp->sp_bb_data = htons((u16) lport->mfs); |
199 | cp = &flogi->fl_cssp[3 - 1]; /* class 3 parameters */ | 232 | cp = &flogi->fl_cssp[3 - 1]; /* class 3 parameters */ |
200 | cp->cp_class = htons(FC_CPC_VALID | FC_CPC_SEQ); | 233 | cp->cp_class = htons(FC_CPC_VALID | FC_CPC_SEQ); |
234 | if (lport->does_npiv) | ||
235 | sp->sp_features = htons(FC_SP_FT_NPIV); | ||
236 | } | ||
237 | |||
238 | /** | ||
239 | * fc_fdisc_fill - Fill in a fdisc request frame. | ||
240 | */ | ||
241 | static inline void fc_fdisc_fill(struct fc_lport *lport, struct fc_frame *fp) | ||
242 | { | ||
243 | struct fc_els_csp *sp; | ||
244 | struct fc_els_cssp *cp; | ||
245 | struct fc_els_flogi *fdisc; | ||
246 | |||
247 | fdisc = fc_frame_payload_get(fp, sizeof(*fdisc)); | ||
248 | memset(fdisc, 0, sizeof(*fdisc)); | ||
249 | fdisc->fl_cmd = (u8) ELS_FDISC; | ||
250 | put_unaligned_be64(lport->wwpn, &fdisc->fl_wwpn); | ||
251 | put_unaligned_be64(lport->wwnn, &fdisc->fl_wwnn); | ||
252 | sp = &fdisc->fl_csp; | ||
253 | sp->sp_hi_ver = 0x20; | ||
254 | sp->sp_lo_ver = 0x20; | ||
255 | sp->sp_bb_cred = htons(10); /* this gets set by gateway */ | ||
256 | sp->sp_bb_data = htons((u16) lport->mfs); | ||
257 | cp = &fdisc->fl_cssp[3 - 1]; /* class 3 parameters */ | ||
258 | cp->cp_class = htons(FC_CPC_VALID | FC_CPC_SEQ); | ||
201 | } | 259 | } |
202 | 260 | ||
203 | /** | 261 | /** |
@@ -296,6 +354,10 @@ static inline int fc_els_fill(struct fc_lport *lport, | |||
296 | fc_flogi_fill(lport, fp); | 354 | fc_flogi_fill(lport, fp); |
297 | break; | 355 | break; |
298 | 356 | ||
357 | case ELS_FDISC: | ||
358 | fc_fdisc_fill(lport, fp); | ||
359 | break; | ||
360 | |||
299 | case ELS_LOGO: | 361 | case ELS_LOGO: |
300 | fc_logo_fill(lport, fp); | 362 | fc_logo_fill(lport, fp); |
301 | break; | 363 | break; |
diff --git a/include/scsi/fc_frame.h b/include/scsi/fc_frame.h index c35d2383cc26..4d3e9c7b7c57 100644 --- a/include/scsi/fc_frame.h +++ b/include/scsi/fc_frame.h | |||
@@ -28,6 +28,8 @@ | |||
28 | #include <scsi/fc/fc_fcp.h> | 28 | #include <scsi/fc/fc_fcp.h> |
29 | #include <scsi/fc/fc_encaps.h> | 29 | #include <scsi/fc/fc_encaps.h> |
30 | 30 | ||
31 | #include <linux/if_ether.h> | ||
32 | |||
31 | /* | 33 | /* |
32 | * The fc_frame interface is used to pass frame data between functions. | 34 | * The fc_frame interface is used to pass frame data between functions. |
33 | * The frame includes the data buffer, length, and SOF / EOF delimiter types. | 35 | * The frame includes the data buffer, length, and SOF / EOF delimiter types. |
@@ -37,6 +39,9 @@ | |||
37 | #define FC_FRAME_HEADROOM 32 /* headroom for VLAN + FCoE headers */ | 39 | #define FC_FRAME_HEADROOM 32 /* headroom for VLAN + FCoE headers */ |
38 | #define FC_FRAME_TAILROOM 8 /* trailer space for FCoE */ | 40 | #define FC_FRAME_TAILROOM 8 /* trailer space for FCoE */ |
39 | 41 | ||
42 | /* Max number of skb frags allowed, reserving one for fcoe_crc_eof page */ | ||
43 | #define FC_FRAME_SG_LEN (MAX_SKB_FRAGS - 1) | ||
44 | |||
40 | #define fp_skb(fp) (&((fp)->skb)) | 45 | #define fp_skb(fp) (&((fp)->skb)) |
41 | #define fr_hdr(fp) ((fp)->skb.data) | 46 | #define fr_hdr(fp) ((fp)->skb.data) |
42 | #define fr_len(fp) ((fp)->skb.len) | 47 | #define fr_len(fp) ((fp)->skb.len) |
@@ -64,6 +69,7 @@ struct fcoe_rcv_info { | |||
64 | enum fc_sof fr_sof; /* start of frame delimiter */ | 69 | enum fc_sof fr_sof; /* start of frame delimiter */ |
65 | enum fc_eof fr_eof; /* end of frame delimiter */ | 70 | enum fc_eof fr_eof; /* end of frame delimiter */ |
66 | u8 fr_flags; /* flags - see below */ | 71 | u8 fr_flags; /* flags - see below */ |
72 | u8 granted_mac[ETH_ALEN]; /* FCoE MAC address */ | ||
67 | }; | 73 | }; |
68 | 74 | ||
69 | 75 | ||
@@ -94,17 +100,7 @@ static inline void fc_frame_init(struct fc_frame *fp) | |||
94 | } | 100 | } |
95 | 101 | ||
96 | struct fc_frame *fc_frame_alloc_fill(struct fc_lport *, size_t payload_len); | 102 | struct fc_frame *fc_frame_alloc_fill(struct fc_lport *, size_t payload_len); |
97 | 103 | struct fc_frame *_fc_frame_alloc(size_t payload_len); | |
98 | struct fc_frame *__fc_frame_alloc(size_t payload_len); | ||
99 | |||
100 | /* | ||
101 | * Get frame for sending via port. | ||
102 | */ | ||
103 | static inline struct fc_frame *_fc_frame_alloc(struct fc_lport *dev, | ||
104 | size_t payload_len) | ||
105 | { | ||
106 | return __fc_frame_alloc(payload_len); | ||
107 | } | ||
108 | 104 | ||
109 | /* | 105 | /* |
110 | * Allocate fc_frame structure and buffer. Set the initial length to | 106 | * Allocate fc_frame structure and buffer. Set the initial length to |
@@ -118,10 +114,10 @@ static inline struct fc_frame *fc_frame_alloc(struct fc_lport *dev, size_t len) | |||
118 | * Note: Since len will often be a constant multiple of 4, | 114 | * Note: Since len will often be a constant multiple of 4, |
119 | * this check will usually be evaluated and eliminated at compile time. | 115 | * this check will usually be evaluated and eliminated at compile time. |
120 | */ | 116 | */ |
121 | if ((len % 4) != 0) | 117 | if (len && len % 4) |
122 | fp = fc_frame_alloc_fill(dev, len); | 118 | fp = fc_frame_alloc_fill(dev, len); |
123 | else | 119 | else |
124 | fp = _fc_frame_alloc(dev, len); | 120 | fp = _fc_frame_alloc(len); |
125 | return fp; | 121 | return fp; |
126 | } | 122 | } |
127 | 123 | ||
diff --git a/include/scsi/iscsi_if.h b/include/scsi/iscsi_if.h index d67dda2b6aa0..66d377b9c72b 100644 --- a/include/scsi/iscsi_if.h +++ b/include/scsi/iscsi_if.h | |||
@@ -311,6 +311,8 @@ enum iscsi_param { | |||
311 | ISCSI_PARAM_IFACE_NAME, | 311 | ISCSI_PARAM_IFACE_NAME, |
312 | ISCSI_PARAM_ISID, | 312 | ISCSI_PARAM_ISID, |
313 | ISCSI_PARAM_INITIATOR_NAME, | 313 | ISCSI_PARAM_INITIATOR_NAME, |
314 | |||
315 | ISCSI_PARAM_TGT_RESET_TMO, | ||
314 | /* must always be last */ | 316 | /* must always be last */ |
315 | ISCSI_PARAM_MAX, | 317 | ISCSI_PARAM_MAX, |
316 | }; | 318 | }; |
@@ -350,6 +352,7 @@ enum iscsi_param { | |||
350 | #define ISCSI_IFACE_NAME (1ULL << ISCSI_PARAM_IFACE_NAME) | 352 | #define ISCSI_IFACE_NAME (1ULL << ISCSI_PARAM_IFACE_NAME) |
351 | #define ISCSI_ISID (1ULL << ISCSI_PARAM_ISID) | 353 | #define ISCSI_ISID (1ULL << ISCSI_PARAM_ISID) |
352 | #define ISCSI_INITIATOR_NAME (1ULL << ISCSI_PARAM_INITIATOR_NAME) | 354 | #define ISCSI_INITIATOR_NAME (1ULL << ISCSI_PARAM_INITIATOR_NAME) |
355 | #define ISCSI_TGT_RESET_TMO (1ULL << ISCSI_PARAM_TGT_RESET_TMO) | ||
353 | 356 | ||
354 | /* iSCSI HBA params */ | 357 | /* iSCSI HBA params */ |
355 | enum iscsi_host_param { | 358 | enum iscsi_host_param { |
diff --git a/include/scsi/iscsi_proto.h b/include/scsi/iscsi_proto.h index f2a2c1169486..dd0a52cea95a 100644 --- a/include/scsi/iscsi_proto.h +++ b/include/scsi/iscsi_proto.h | |||
@@ -279,6 +279,8 @@ struct iscsi_tm { | |||
279 | #define ISCSI_TM_FUNC_TARGET_COLD_RESET 7 | 279 | #define ISCSI_TM_FUNC_TARGET_COLD_RESET 7 |
280 | #define ISCSI_TM_FUNC_TASK_REASSIGN 8 | 280 | #define ISCSI_TM_FUNC_TASK_REASSIGN 8 |
281 | 281 | ||
282 | #define ISCSI_TM_FUNC_VALUE(hdr) ((hdr)->flags & ISCSI_FLAG_TM_FUNC_MASK) | ||
283 | |||
282 | /* SCSI Task Management Response Header */ | 284 | /* SCSI Task Management Response Header */ |
283 | struct iscsi_tm_rsp { | 285 | struct iscsi_tm_rsp { |
284 | uint8_t opcode; | 286 | uint8_t opcode; |
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h index 65dc9aacbf70..4b912eee33e5 100644 --- a/include/scsi/libfc.h +++ b/include/scsi/libfc.h | |||
@@ -26,6 +26,7 @@ | |||
26 | 26 | ||
27 | #include <scsi/scsi_transport.h> | 27 | #include <scsi/scsi_transport.h> |
28 | #include <scsi/scsi_transport_fc.h> | 28 | #include <scsi/scsi_transport_fc.h> |
29 | #include <scsi/scsi_bsg_fc.h> | ||
29 | 30 | ||
30 | #include <scsi/fc/fc_fcp.h> | 31 | #include <scsi/fc/fc_fcp.h> |
31 | #include <scsi/fc/fc_ns.h> | 32 | #include <scsi/fc/fc_ns.h> |
@@ -34,67 +35,6 @@ | |||
34 | 35 | ||
35 | #include <scsi/fc_frame.h> | 36 | #include <scsi/fc_frame.h> |
36 | 37 | ||
37 | #define FC_LIBFC_LOGGING 0x01 /* General logging, not categorized */ | ||
38 | #define FC_LPORT_LOGGING 0x02 /* lport layer logging */ | ||
39 | #define FC_DISC_LOGGING 0x04 /* discovery layer logging */ | ||
40 | #define FC_RPORT_LOGGING 0x08 /* rport layer logging */ | ||
41 | #define FC_FCP_LOGGING 0x10 /* I/O path logging */ | ||
42 | #define FC_EM_LOGGING 0x20 /* Exchange Manager logging */ | ||
43 | #define FC_EXCH_LOGGING 0x40 /* Exchange/Sequence logging */ | ||
44 | #define FC_SCSI_LOGGING 0x80 /* SCSI logging (mostly error handling) */ | ||
45 | |||
46 | extern unsigned int fc_debug_logging; | ||
47 | |||
48 | #define FC_CHECK_LOGGING(LEVEL, CMD) \ | ||
49 | do { \ | ||
50 | if (unlikely(fc_debug_logging & LEVEL)) \ | ||
51 | do { \ | ||
52 | CMD; \ | ||
53 | } while (0); \ | ||
54 | } while (0) | ||
55 | |||
56 | #define FC_LIBFC_DBG(fmt, args...) \ | ||
57 | FC_CHECK_LOGGING(FC_LIBFC_LOGGING, \ | ||
58 | printk(KERN_INFO "libfc: " fmt, ##args)) | ||
59 | |||
60 | #define FC_LPORT_DBG(lport, fmt, args...) \ | ||
61 | FC_CHECK_LOGGING(FC_LPORT_LOGGING, \ | ||
62 | printk(KERN_INFO "host%u: lport %6x: " fmt, \ | ||
63 | (lport)->host->host_no, \ | ||
64 | fc_host_port_id((lport)->host), ##args)) | ||
65 | |||
66 | #define FC_DISC_DBG(disc, fmt, args...) \ | ||
67 | FC_CHECK_LOGGING(FC_DISC_LOGGING, \ | ||
68 | printk(KERN_INFO "host%u: disc: " fmt, \ | ||
69 | (disc)->lport->host->host_no, \ | ||
70 | ##args)) | ||
71 | |||
72 | #define FC_RPORT_ID_DBG(lport, port_id, fmt, args...) \ | ||
73 | FC_CHECK_LOGGING(FC_RPORT_LOGGING, \ | ||
74 | printk(KERN_INFO "host%u: rport %6x: " fmt, \ | ||
75 | (lport)->host->host_no, \ | ||
76 | (port_id), ##args)) | ||
77 | |||
78 | #define FC_RPORT_DBG(rdata, fmt, args...) \ | ||
79 | FC_RPORT_ID_DBG((rdata)->local_port, (rdata)->ids.port_id, fmt, ##args) | ||
80 | |||
81 | #define FC_FCP_DBG(pkt, fmt, args...) \ | ||
82 | FC_CHECK_LOGGING(FC_FCP_LOGGING, \ | ||
83 | printk(KERN_INFO "host%u: fcp: %6x: " fmt, \ | ||
84 | (pkt)->lp->host->host_no, \ | ||
85 | pkt->rport->port_id, ##args)) | ||
86 | |||
87 | #define FC_EXCH_DBG(exch, fmt, args...) \ | ||
88 | FC_CHECK_LOGGING(FC_EXCH_LOGGING, \ | ||
89 | printk(KERN_INFO "host%u: xid %4x: " fmt, \ | ||
90 | (exch)->lp->host->host_no, \ | ||
91 | exch->xid, ##args)) | ||
92 | |||
93 | #define FC_SCSI_DBG(lport, fmt, args...) \ | ||
94 | FC_CHECK_LOGGING(FC_SCSI_LOGGING, \ | ||
95 | printk(KERN_INFO "host%u: scsi: " fmt, \ | ||
96 | (lport)->host->host_no, ##args)) | ||
97 | |||
98 | /* | 38 | /* |
99 | * libfc error codes | 39 | * libfc error codes |
100 | */ | 40 | */ |
@@ -115,15 +55,28 @@ do { \ | |||
115 | p[2] = ((v) & 0xFF); \ | 55 | p[2] = ((v) & 0xFF); \ |
116 | } while (0) | 56 | } while (0) |
117 | 57 | ||
118 | /* | 58 | /** |
119 | * FC HBA status | 59 | * enum fc_lport_state - Local port states |
60 | * @LPORT_ST_DISABLED: Disabled | ||
61 | * @LPORT_ST_FLOGI: Fabric login (FLOGI) sent | ||
62 | * @LPORT_ST_DNS: Waiting for name server remote port to become ready | ||
63 | * @LPORT_ST_RPN_ID: Register port name by ID (RPN_ID) sent | ||
64 | * @LPORT_ST_RFT_ID: Register Fibre Channel types by ID (RFT_ID) sent | ||
65 | * @LPORT_ST_RFF_ID: Register FC-4 Features by ID (RFF_ID) sent | ||
66 | * @LPORT_ST_SCR: State Change Register (SCR) sent | ||
67 | * @LPORT_ST_READY: Ready for use | ||
68 | * @LPORT_ST_LOGO: Local port logout (LOGO) sent | ||
69 | * @LPORT_ST_RESET: Local port reset | ||
120 | */ | 70 | */ |
121 | enum fc_lport_state { | 71 | enum fc_lport_state { |
122 | LPORT_ST_DISABLED = 0, | 72 | LPORT_ST_DISABLED = 0, |
123 | LPORT_ST_FLOGI, | 73 | LPORT_ST_FLOGI, |
124 | LPORT_ST_DNS, | 74 | LPORT_ST_DNS, |
125 | LPORT_ST_RPN_ID, | 75 | LPORT_ST_RNN_ID, |
76 | LPORT_ST_RSNN_NN, | ||
77 | LPORT_ST_RSPN_ID, | ||
126 | LPORT_ST_RFT_ID, | 78 | LPORT_ST_RFT_ID, |
79 | LPORT_ST_RFF_ID, | ||
127 | LPORT_ST_SCR, | 80 | LPORT_ST_SCR, |
128 | LPORT_ST_READY, | 81 | LPORT_ST_READY, |
129 | LPORT_ST_LOGO, | 82 | LPORT_ST_LOGO, |
@@ -136,15 +89,28 @@ enum fc_disc_event { | |||
136 | DISC_EV_FAILED | 89 | DISC_EV_FAILED |
137 | }; | 90 | }; |
138 | 91 | ||
92 | /** | ||
93 | * enum fc_rport_state - Remote port states | ||
94 | * @RPORT_ST_INIT: Initialized | ||
95 | * @RPORT_ST_PLOGI: Waiting for PLOGI completion | ||
96 | * @RPORT_ST_PRLI: Waiting for PRLI completion | ||
97 | * @RPORT_ST_RTV: Waiting for RTV completion | ||
98 | * @RPORT_ST_READY: Ready for use | ||
99 | * @RPORT_ST_LOGO: Remote port logout (LOGO) sent | ||
100 | * @RPORT_ST_ADISC: Discover Address sent | ||
101 | * @RPORT_ST_DELETE: Remote port being deleted | ||
102 | * @RPORT_ST_RESTART: Remote port being deleted and will restart | ||
103 | */ | ||
139 | enum fc_rport_state { | 104 | enum fc_rport_state { |
140 | RPORT_ST_INIT, /* initialized */ | 105 | RPORT_ST_INIT, |
141 | RPORT_ST_PLOGI, /* waiting for PLOGI completion */ | 106 | RPORT_ST_PLOGI, |
142 | RPORT_ST_PRLI, /* waiting for PRLI completion */ | 107 | RPORT_ST_PRLI, |
143 | RPORT_ST_RTV, /* waiting for RTV completion */ | 108 | RPORT_ST_RTV, |
144 | RPORT_ST_READY, /* ready for use */ | 109 | RPORT_ST_READY, |
145 | RPORT_ST_LOGO, /* port logout sent */ | 110 | RPORT_ST_LOGO, |
146 | RPORT_ST_ADISC, /* Discover Address sent */ | 111 | RPORT_ST_ADISC, |
147 | RPORT_ST_DELETE, /* port being deleted */ | 112 | RPORT_ST_DELETE, |
113 | RPORT_ST_RESTART, | ||
148 | }; | 114 | }; |
149 | 115 | ||
150 | /** | 116 | /** |
@@ -155,12 +121,20 @@ enum fc_rport_state { | |||
155 | * @port_id: Port ID of the discovered port | 121 | * @port_id: Port ID of the discovered port |
156 | */ | 122 | */ |
157 | struct fc_disc_port { | 123 | struct fc_disc_port { |
158 | struct fc_lport *lp; | 124 | struct fc_lport *lp; |
159 | struct list_head peers; | 125 | struct list_head peers; |
160 | struct work_struct rport_work; | 126 | struct work_struct rport_work; |
161 | u32 port_id; | 127 | u32 port_id; |
162 | }; | 128 | }; |
163 | 129 | ||
130 | /** | ||
131 | * enum fc_rport_event - Remote port events | ||
132 | * @RPORT_EV_NONE: No event | ||
133 | * @RPORT_EV_READY: Remote port is ready for use | ||
134 | * @RPORT_EV_FAILED: State machine failed, remote port is not ready | ||
135 | * @RPORT_EV_STOP: Remote port has been stopped | ||
136 | * @RPORT_EV_LOGO: Remote port logout (LOGO) sent | ||
137 | */ | ||
164 | enum fc_rport_event { | 138 | enum fc_rport_event { |
165 | RPORT_EV_NONE = 0, | 139 | RPORT_EV_NONE = 0, |
166 | RPORT_EV_READY, | 140 | RPORT_EV_READY, |
@@ -171,6 +145,10 @@ enum fc_rport_event { | |||
171 | 145 | ||
172 | struct fc_rport_priv; | 146 | struct fc_rport_priv; |
173 | 147 | ||
148 | /** | ||
149 | * struct fc_rport_operations - Operations for a remote port | ||
150 | * @event_callback: Function to be called for remote port events | ||
151 | */ | ||
174 | struct fc_rport_operations { | 152 | struct fc_rport_operations { |
175 | void (*event_callback)(struct fc_lport *, struct fc_rport_priv *, | 153 | void (*event_callback)(struct fc_lport *, struct fc_rport_priv *, |
176 | enum fc_rport_event); | 154 | enum fc_rport_event); |
@@ -178,11 +156,11 @@ struct fc_rport_operations { | |||
178 | 156 | ||
179 | /** | 157 | /** |
180 | * struct fc_rport_libfc_priv - libfc internal information about a remote port | 158 | * struct fc_rport_libfc_priv - libfc internal information about a remote port |
181 | * @local_port: Fibre Channel host port instance | 159 | * @local_port: The associated local port |
182 | * @rp_state: indicates READY for I/O or DELETE when blocked. | 160 | * @rp_state: Indicates READY for I/O or DELETE when blocked |
183 | * @flags: REC and RETRY supported flags | 161 | * @flags: REC and RETRY supported flags |
184 | * @e_d_tov: error detect timeout value (in msec) | 162 | * @e_d_tov: Error detect timeout value (in msec) |
185 | * @r_a_tov: resource allocation timeout value (in msec) | 163 | * @r_a_tov: Resource allocation timeout value (in msec) |
186 | */ | 164 | */ |
187 | struct fc_rport_libfc_priv { | 165 | struct fc_rport_libfc_priv { |
188 | struct fc_lport *local_port; | 166 | struct fc_lport *local_port; |
@@ -195,47 +173,66 @@ struct fc_rport_libfc_priv { | |||
195 | }; | 173 | }; |
196 | 174 | ||
197 | /** | 175 | /** |
198 | * struct fc_rport_priv - libfc rport and discovery info about a remote port | 176 | * struct fc_rport_priv - libfc remote port and discovery info |
199 | * @local_port: Fibre Channel host port instance | 177 | * @local_port: The associated local port |
200 | * @rport: transport remote port | 178 | * @rport: The FC transport remote port |
201 | * @kref: reference counter | 179 | * @kref: Reference counter |
202 | * @rp_state: state tracks progress of PLOGI, PRLI, and RTV exchanges | 180 | * @rp_state: Enumeration that tracks progress of PLOGI, PRLI, |
203 | * @ids: remote port identifiers and roles | 181 | * and RTV exchanges |
204 | * @flags: REC and RETRY supported flags | 182 | * @ids: The remote port identifiers and roles |
205 | * @max_seq: maximum number of concurrent sequences | 183 | * @flags: REC and RETRY supported flags |
206 | * @disc_id: discovery identifier | 184 | * @max_seq: Maximum number of concurrent sequences |
207 | * @maxframe_size: maximum frame size | 185 | * @disc_id: The discovery identifier |
208 | * @retries: retry count in current state | 186 | * @maxframe_size: The maximum frame size |
209 | * @e_d_tov: error detect timeout value (in msec) | 187 | * @retries: The retry count for the current state |
210 | * @r_a_tov: resource allocation timeout value (in msec) | 188 | * @e_d_tov: Error detect timeout value (in msec) |
211 | * @rp_mutex: mutex protects rport | 189 | * @r_a_tov: Resource allocation timeout value (in msec) |
212 | * @retry_work: | 190 | * @rp_mutex: The mutex that protects the remote port |
213 | * @event_callback: Callback for rport READY, FAILED or LOGO | 191 | * @retry_work: Handle for retries |
192 | * @event_callback: Callback when READY, FAILED or LOGO states complete | ||
214 | */ | 193 | */ |
215 | struct fc_rport_priv { | 194 | struct fc_rport_priv { |
216 | struct fc_lport *local_port; | 195 | struct fc_lport *local_port; |
217 | struct fc_rport *rport; | 196 | struct fc_rport *rport; |
218 | struct kref kref; | 197 | struct kref kref; |
219 | enum fc_rport_state rp_state; | 198 | enum fc_rport_state rp_state; |
220 | struct fc_rport_identifiers ids; | 199 | struct fc_rport_identifiers ids; |
221 | u16 flags; | 200 | u16 flags; |
222 | u16 max_seq; | 201 | u16 max_seq; |
223 | u16 disc_id; | 202 | u16 disc_id; |
224 | u16 maxframe_size; | 203 | u16 maxframe_size; |
225 | unsigned int retries; | 204 | unsigned int retries; |
226 | unsigned int e_d_tov; | 205 | unsigned int e_d_tov; |
227 | unsigned int r_a_tov; | 206 | unsigned int r_a_tov; |
228 | struct mutex rp_mutex; | 207 | struct mutex rp_mutex; |
229 | struct delayed_work retry_work; | 208 | struct delayed_work retry_work; |
230 | enum fc_rport_event event; | 209 | enum fc_rport_event event; |
231 | struct fc_rport_operations *ops; | 210 | struct fc_rport_operations *ops; |
232 | struct list_head peers; | 211 | struct list_head peers; |
233 | struct work_struct event_work; | 212 | struct work_struct event_work; |
234 | u32 supported_classes; | 213 | u32 supported_classes; |
235 | }; | 214 | }; |
236 | 215 | ||
237 | /* | 216 | /** |
238 | * fcoe stats structure | 217 | * struct fcoe_dev_stats - fcoe stats structure |
218 | * @SecondsSinceLastReset: Seconds since the last reset | ||
219 | * @TxFrames: Number of transmitted frames | ||
220 | * @TxWords: Number of transmitted words | ||
221 | * @RxFrames: Number of received frames | ||
222 | * @RxWords: Number of received words | ||
223 | * @ErrorFrames: Number of received error frames | ||
224 | * @DumpedFrames: Number of dumped frames | ||
225 | * @LinkFailureCount: Number of link failures | ||
226 | * @LossOfSignalCount: Number for signal losses | ||
227 | * @InvalidTxWordCount: Number of invalid transmitted words | ||
228 | * @InvalidCRCCount: Number of invalid CRCs | ||
229 | * @InputRequests: Number of input requests | ||
230 | * @OutputRequests: Number of output requests | ||
231 | * @ControlRequests: Number of control requests | ||
232 | * @InputMegabytes: Number of received megabytes | ||
233 | * @OutputMegabytes: Number of transmitted megabytes | ||
234 | * @VLinkFailureCount: Number of virtual link failures | ||
235 | * @MissDiscAdvCount: Number of missing FIP discovery advertisement | ||
239 | */ | 236 | */ |
240 | struct fcoe_dev_stats { | 237 | struct fcoe_dev_stats { |
241 | u64 SecondsSinceLastReset; | 238 | u64 SecondsSinceLastReset; |
@@ -254,12 +251,17 @@ struct fcoe_dev_stats { | |||
254 | u64 ControlRequests; | 251 | u64 ControlRequests; |
255 | u64 InputMegabytes; | 252 | u64 InputMegabytes; |
256 | u64 OutputMegabytes; | 253 | u64 OutputMegabytes; |
254 | u64 VLinkFailureCount; | ||
255 | u64 MissDiscAdvCount; | ||
257 | }; | 256 | }; |
258 | 257 | ||
259 | /* | 258 | /** |
260 | * els data is used for passing ELS respone specific | 259 | * struct fc_seq_els_data - ELS data used for passing ELS specific responses |
261 | * data to send ELS response mainly using infomation | 260 | * @fp: The ELS frame |
262 | * in exchange and sequence in EM layer. | 261 | * @reason: The reason for rejection |
262 | * @explan: The explaination of the rejection | ||
263 | * | ||
264 | * Mainly used by the exchange manager layer. | ||
263 | */ | 265 | */ |
264 | struct fc_seq_els_data { | 266 | struct fc_seq_els_data { |
265 | struct fc_frame *fp; | 267 | struct fc_frame *fp; |
@@ -267,77 +269,87 @@ struct fc_seq_els_data { | |||
267 | enum fc_els_rjt_explan explan; | 269 | enum fc_els_rjt_explan explan; |
268 | }; | 270 | }; |
269 | 271 | ||
270 | /* | 272 | /** |
271 | * FCP request structure, one for each scsi cmd request | 273 | * struct fc_fcp_pkt - FCP request structure (one for each scsi_cmnd request) |
274 | * @lp: The associated local port | ||
275 | * @state: The state of the I/O | ||
276 | * @tgt_flags: Target's flags | ||
277 | * @ref_cnt: Reference count | ||
278 | * @scsi_pkt_lock: Lock to protect the SCSI packet (must be taken before the | ||
279 | * host_lock if both are to be held at the same time) | ||
280 | * @cmd: The SCSI command (set and clear with the host_lock held) | ||
281 | * @list: Tracks queued commands (accessed with the host_lock held) | ||
282 | * @timer: The command timer | ||
283 | * @tm_done: Completion indicator | ||
284 | * @wait_for_comp: Indicator to wait for completion of the I/O (in jiffies) | ||
285 | * @start_time: Timestamp indicating the start of the I/O (in jiffies) | ||
286 | * @end_time: Timestamp indicating the end of the I/O (in jiffies) | ||
287 | * @last_pkt_time: Timestamp of the last frame received (in jiffies) | ||
288 | * @data_len: The length of the data | ||
289 | * @cdb_cmd: The CDB command | ||
290 | * @xfer_len: The transfer length | ||
291 | * @xfer_ddp: Indicates if this transfer used DDP (XID of the exchange | ||
292 | * will be set here if DDP was setup) | ||
293 | * @xfer_contig_end: The offset into the buffer if the buffer is contiguous | ||
294 | * (Tx and Rx) | ||
295 | * @max_payload: The maximum payload size (in bytes) | ||
296 | * @io_status: SCSI result (upper 24 bits) | ||
297 | * @cdb_status: CDB status | ||
298 | * @status_code: FCP I/O status | ||
299 | * @scsi_comp_flags: Completion flags (bit 3 Underrun bit 2: overrun) | ||
300 | * @req_flags: Request flags (bit 0: read bit:1 write) | ||
301 | * @scsi_resid: SCSI residule length | ||
302 | * @rport: The remote port that the SCSI command is targeted at | ||
303 | * @seq_ptr: The sequence that will carry the SCSI command | ||
304 | * @recov_retry: Number of recovery retries | ||
305 | * @recov_seq: The sequence for REC or SRR | ||
272 | */ | 306 | */ |
273 | struct fc_fcp_pkt { | 307 | struct fc_fcp_pkt { |
274 | /* | 308 | /* Housekeeping information */ |
275 | * housekeeping stuff | 309 | struct fc_lport *lp; |
276 | */ | 310 | u16 state; |
277 | struct fc_lport *lp; /* handle to hba struct */ | 311 | u16 tgt_flags; |
278 | u16 state; /* scsi_pkt state state */ | 312 | atomic_t ref_cnt; |
279 | u16 tgt_flags; /* target flags */ | 313 | spinlock_t scsi_pkt_lock; |
280 | atomic_t ref_cnt; /* fcp pkt ref count */ | 314 | |
281 | spinlock_t scsi_pkt_lock; /* Must be taken before the host lock | 315 | /* SCSI I/O related information */ |
282 | * if both are held at the same time */ | 316 | struct scsi_cmnd *cmd; |
283 | /* | 317 | struct list_head list; |
284 | * SCSI I/O related stuff | 318 | |
285 | */ | 319 | /* Timeout related information */ |
286 | struct scsi_cmnd *cmd; /* scsi command pointer. set/clear | 320 | struct timer_list timer; |
287 | * under host lock */ | ||
288 | struct list_head list; /* tracks queued commands. access under | ||
289 | * host lock */ | ||
290 | /* | ||
291 | * timeout related stuff | ||
292 | */ | ||
293 | struct timer_list timer; /* command timer */ | ||
294 | struct completion tm_done; | 321 | struct completion tm_done; |
295 | int wait_for_comp; | 322 | int wait_for_comp; |
296 | unsigned long start_time; /* start jiffie */ | 323 | unsigned long start_time; |
297 | unsigned long end_time; /* end jiffie */ | 324 | unsigned long end_time; |
298 | unsigned long last_pkt_time; /* jiffies of last frame received */ | 325 | unsigned long last_pkt_time; |
299 | 326 | ||
300 | /* | 327 | /* SCSI command and data transfer information */ |
301 | * scsi cmd and data transfer information | 328 | u32 data_len; |
302 | */ | 329 | |
303 | u32 data_len; | 330 | /* Transport related veriables */ |
304 | /* | 331 | struct fcp_cmnd cdb_cmd; |
305 | * transport related veriables | 332 | size_t xfer_len; |
306 | */ | 333 | u16 xfer_ddp; |
307 | struct fcp_cmnd cdb_cmd; | 334 | u32 xfer_contig_end; |
308 | size_t xfer_len; | 335 | u16 max_payload; |
309 | u16 xfer_ddp; /* this xfer is ddped */ | 336 | |
310 | u32 xfer_contig_end; /* offset of end of contiguous xfer */ | 337 | /* SCSI/FCP return status */ |
311 | u16 max_payload; /* max payload size in bytes */ | 338 | u32 io_status; |
312 | 339 | u8 cdb_status; | |
313 | /* | 340 | u8 status_code; |
314 | * scsi/fcp return status | 341 | u8 scsi_comp_flags; |
315 | */ | 342 | u32 req_flags; |
316 | u32 io_status; /* SCSI result upper 24 bits */ | 343 | u32 scsi_resid; |
317 | u8 cdb_status; | 344 | |
318 | u8 status_code; /* FCP I/O status */ | 345 | /* Associated structures */ |
319 | /* bit 3 Underrun bit 2: overrun */ | 346 | struct fc_rport *rport; |
320 | u8 scsi_comp_flags; | 347 | struct fc_seq *seq_ptr; |
321 | u32 req_flags; /* bit 0: read bit:1 write */ | 348 | |
322 | u32 scsi_resid; /* residule length */ | 349 | /* Error Processing information */ |
323 | 350 | u8 recov_retry; | |
324 | struct fc_rport *rport; /* remote port pointer */ | 351 | struct fc_seq *recov_seq; |
325 | struct fc_seq *seq_ptr; /* current sequence pointer */ | ||
326 | /* | ||
327 | * Error Processing | ||
328 | */ | ||
329 | u8 recov_retry; /* count of recovery retries */ | ||
330 | struct fc_seq *recov_seq; /* sequence for REC or SRR */ | ||
331 | }; | 352 | }; |
332 | /* | ||
333 | * FC_FCP HELPER FUNCTIONS | ||
334 | *****************************/ | ||
335 | static inline bool fc_fcp_is_read(const struct fc_fcp_pkt *fsp) | ||
336 | { | ||
337 | if (fsp && fsp->cmd) | ||
338 | return fsp->cmd->sc_data_direction == DMA_FROM_DEVICE; | ||
339 | return false; | ||
340 | } | ||
341 | 353 | ||
342 | /* | 354 | /* |
343 | * Structure and function definitions for managing Fibre Channel Exchanges | 355 | * Structure and function definitions for managing Fibre Channel Exchanges |
@@ -350,23 +362,51 @@ static inline bool fc_fcp_is_read(const struct fc_fcp_pkt *fsp) | |||
350 | 362 | ||
351 | struct fc_exch_mgr; | 363 | struct fc_exch_mgr; |
352 | struct fc_exch_mgr_anchor; | 364 | struct fc_exch_mgr_anchor; |
353 | extern u16 fc_cpu_mask; /* cpu mask for possible cpus */ | 365 | extern u16 fc_cpu_mask; /* cpu mask for possible cpus */ |
354 | 366 | ||
355 | /* | 367 | /** |
356 | * Sequence. | 368 | * struct fc_seq - FC sequence |
369 | * @id: The sequence ID | ||
370 | * @ssb_stat: Status flags for the sequence status block (SSB) | ||
371 | * @cnt: Number of frames sent so far | ||
372 | * @rec_data: FC-4 value for REC | ||
357 | */ | 373 | */ |
358 | struct fc_seq { | 374 | struct fc_seq { |
359 | u8 id; /* seq ID */ | 375 | u8 id; |
360 | u16 ssb_stat; /* status flags for sequence status block */ | 376 | u16 ssb_stat; |
361 | u16 cnt; /* frames sent so far on sequence */ | 377 | u16 cnt; |
362 | u32 rec_data; /* FC-4 value for REC */ | 378 | u32 rec_data; |
363 | }; | 379 | }; |
364 | 380 | ||
365 | #define FC_EX_DONE (1 << 0) /* ep is completed */ | 381 | #define FC_EX_DONE (1 << 0) /* ep is completed */ |
366 | #define FC_EX_RST_CLEANUP (1 << 1) /* reset is forcing completion */ | 382 | #define FC_EX_RST_CLEANUP (1 << 1) /* reset is forcing completion */ |
367 | 383 | ||
368 | /* | 384 | /** |
369 | * Exchange. | 385 | * struct fc_exch - Fibre Channel Exchange |
386 | * @em: Exchange manager | ||
387 | * @pool: Exchange pool | ||
388 | * @state: The exchange's state | ||
389 | * @xid: The exchange ID | ||
390 | * @ex_list: Handle used by the EM to track free exchanges | ||
391 | * @ex_lock: Lock that protects the exchange | ||
392 | * @ex_refcnt: Reference count | ||
393 | * @timeout_work: Handle for timeout handler | ||
394 | * @lp: The local port that this exchange is on | ||
395 | * @oxid: Originator's exchange ID | ||
396 | * @rxid: Responder's exchange ID | ||
397 | * @oid: Originator's FCID | ||
398 | * @sid: Source FCID | ||
399 | * @did: Destination FCID | ||
400 | * @esb_stat: ESB exchange status | ||
401 | * @r_a_tov: Resouce allocation time out value (in msecs) | ||
402 | * @seq_id: The next sequence ID to use | ||
403 | * @f_ctl: F_CTL flags for the sequence | ||
404 | * @fh_type: The frame type | ||
405 | * @class: The class of service | ||
406 | * @seq: The sequence in use on this exchange | ||
407 | * @resp: Callback for responses on this exchange | ||
408 | * @destructor: Called when destroying the exchange | ||
409 | * @arg: Passed as a void pointer to the resp() callback | ||
370 | * | 410 | * |
371 | * Locking notes: The ex_lock protects following items: | 411 | * Locking notes: The ex_lock protects following items: |
372 | * state, esb_stat, f_ctl, seq.ssb_stat | 412 | * state, esb_stat, f_ctl, seq.ssb_stat |
@@ -374,76 +414,59 @@ struct fc_seq { | |||
374 | * sequence allocation | 414 | * sequence allocation |
375 | */ | 415 | */ |
376 | struct fc_exch { | 416 | struct fc_exch { |
377 | struct fc_exch_mgr *em; /* exchange manager */ | 417 | struct fc_exch_mgr *em; |
378 | struct fc_exch_pool *pool; /* per cpu exches pool */ | 418 | struct fc_exch_pool *pool; |
379 | u32 state; /* internal driver state */ | 419 | u32 state; |
380 | u16 xid; /* our exchange ID */ | 420 | u16 xid; |
381 | struct list_head ex_list; /* free or busy list linkage */ | 421 | struct list_head ex_list; |
382 | spinlock_t ex_lock; /* lock covering exchange state */ | 422 | spinlock_t ex_lock; |
383 | atomic_t ex_refcnt; /* reference counter */ | 423 | atomic_t ex_refcnt; |
384 | struct delayed_work timeout_work; /* timer for upper level protocols */ | 424 | struct delayed_work timeout_work; |
385 | struct fc_lport *lp; /* fc device instance */ | 425 | struct fc_lport *lp; |
386 | u16 oxid; /* originator's exchange ID */ | 426 | u16 oxid; |
387 | u16 rxid; /* responder's exchange ID */ | 427 | u16 rxid; |
388 | u32 oid; /* originator's FCID */ | 428 | u32 oid; |
389 | u32 sid; /* source FCID */ | 429 | u32 sid; |
390 | u32 did; /* destination FCID */ | 430 | u32 did; |
391 | u32 esb_stat; /* exchange status for ESB */ | 431 | u32 esb_stat; |
392 | u32 r_a_tov; /* r_a_tov from rport (msec) */ | 432 | u32 r_a_tov; |
393 | u8 seq_id; /* next sequence ID to use */ | 433 | u8 seq_id; |
394 | u32 f_ctl; /* F_CTL flags for sequences */ | 434 | u32 f_ctl; |
395 | u8 fh_type; /* frame type */ | 435 | u8 fh_type; |
396 | enum fc_class class; /* class of service */ | 436 | enum fc_class class; |
397 | struct fc_seq seq; /* single sequence */ | 437 | struct fc_seq seq; |
398 | /* | 438 | |
399 | * Handler for responses to this current exchange. | 439 | void (*resp)(struct fc_seq *, struct fc_frame *, void *); |
400 | */ | 440 | void *arg; |
401 | void (*resp)(struct fc_seq *, struct fc_frame *, void *); | 441 | |
402 | void (*destructor)(struct fc_seq *, void *); | 442 | void (*destructor)(struct fc_seq *, void *); |
403 | /* | 443 | |
404 | * arg is passed as void pointer to exchange | ||
405 | * resp and destructor handlers | ||
406 | */ | ||
407 | void *arg; | ||
408 | }; | 444 | }; |
409 | #define fc_seq_exch(sp) container_of(sp, struct fc_exch, seq) | 445 | #define fc_seq_exch(sp) container_of(sp, struct fc_exch, seq) |
410 | 446 | ||
411 | struct libfc_function_template { | ||
412 | 447 | ||
448 | struct libfc_function_template { | ||
413 | /* | 449 | /* |
414 | * Interface to send a FC frame | 450 | * Interface to send a FC frame |
415 | * | 451 | * |
416 | * STATUS: REQUIRED | 452 | * STATUS: REQUIRED |
417 | */ | 453 | */ |
418 | int (*frame_send)(struct fc_lport *lp, struct fc_frame *fp); | 454 | int (*frame_send)(struct fc_lport *, struct fc_frame *); |
419 | 455 | ||
420 | /* | 456 | /* |
421 | * Interface to send ELS/CT frames | 457 | * Interface to send ELS/CT frames |
422 | * | 458 | * |
423 | * STATUS: OPTIONAL | 459 | * STATUS: OPTIONAL |
424 | */ | 460 | */ |
425 | struct fc_seq *(*elsct_send)(struct fc_lport *lport, | 461 | struct fc_seq *(*elsct_send)(struct fc_lport *, u32 did, |
426 | u32 did, | 462 | struct fc_frame *, unsigned int op, |
427 | struct fc_frame *fp, | ||
428 | unsigned int op, | ||
429 | void (*resp)(struct fc_seq *, | 463 | void (*resp)(struct fc_seq *, |
430 | struct fc_frame *fp, | 464 | struct fc_frame *, void *arg), |
431 | void *arg), | ||
432 | void *arg, u32 timer_msec); | 465 | void *arg, u32 timer_msec); |
433 | 466 | ||
434 | /* | 467 | /* |
435 | * Send the FC frame payload using a new exchange and sequence. | 468 | * Send the FC frame payload using a new exchange and sequence. |
436 | * | 469 | * |
437 | * The frame pointer with some of the header's fields must be | ||
438 | * filled before calling exch_seq_send(), those fields are, | ||
439 | * | ||
440 | * - routing control | ||
441 | * - FC port did | ||
442 | * - FC port sid | ||
443 | * - FC header type | ||
444 | * - frame control | ||
445 | * - parameter or relative offset | ||
446 | * | ||
447 | * The exchange response handler is set in this routine to resp() | 470 | * The exchange response handler is set in this routine to resp() |
448 | * function pointer. It can be called in two scenarios: if a timeout | 471 | * function pointer. It can be called in two scenarios: if a timeout |
449 | * occurs or if a response frame is received for the exchange. The | 472 | * occurs or if a response frame is received for the exchange. The |
@@ -464,14 +487,13 @@ struct libfc_function_template { | |||
464 | * | 487 | * |
465 | * STATUS: OPTIONAL | 488 | * STATUS: OPTIONAL |
466 | */ | 489 | */ |
467 | struct fc_seq *(*exch_seq_send)(struct fc_lport *lp, | 490 | struct fc_seq *(*exch_seq_send)(struct fc_lport *, struct fc_frame *, |
468 | struct fc_frame *fp, | 491 | void (*resp)(struct fc_seq *, |
469 | void (*resp)(struct fc_seq *sp, | 492 | struct fc_frame *, |
470 | struct fc_frame *fp, | 493 | void *), |
471 | void *arg), | 494 | void (*destructor)(struct fc_seq *, |
472 | void (*destructor)(struct fc_seq *sp, | 495 | void *), |
473 | void *arg), | 496 | void *, unsigned int timer_msec); |
474 | void *arg, unsigned int timer_msec); | ||
475 | 497 | ||
476 | /* | 498 | /* |
477 | * Sets up the DDP context for a given exchange id on the given | 499 | * Sets up the DDP context for a given exchange id on the given |
@@ -479,22 +501,28 @@ struct libfc_function_template { | |||
479 | * | 501 | * |
480 | * STATUS: OPTIONAL | 502 | * STATUS: OPTIONAL |
481 | */ | 503 | */ |
482 | int (*ddp_setup)(struct fc_lport *lp, u16 xid, | 504 | int (*ddp_setup)(struct fc_lport *, u16, struct scatterlist *, |
483 | struct scatterlist *sgl, unsigned int sgc); | 505 | unsigned int); |
484 | /* | 506 | /* |
485 | * Completes the DDP transfer and returns the length of data DDPed | 507 | * Completes the DDP transfer and returns the length of data DDPed |
486 | * for the given exchange id. | 508 | * for the given exchange id. |
487 | * | 509 | * |
488 | * STATUS: OPTIONAL | 510 | * STATUS: OPTIONAL |
489 | */ | 511 | */ |
490 | int (*ddp_done)(struct fc_lport *lp, u16 xid); | 512 | int (*ddp_done)(struct fc_lport *, u16); |
513 | /* | ||
514 | * Allow LLD to fill its own Link Error Status Block | ||
515 | * | ||
516 | * STATUS: OPTIONAL | ||
517 | */ | ||
518 | void (*get_lesb)(struct fc_lport *, struct fc_els_lesb *lesb); | ||
491 | /* | 519 | /* |
492 | * Send a frame using an existing sequence and exchange. | 520 | * Send a frame using an existing sequence and exchange. |
493 | * | 521 | * |
494 | * STATUS: OPTIONAL | 522 | * STATUS: OPTIONAL |
495 | */ | 523 | */ |
496 | int (*seq_send)(struct fc_lport *lp, struct fc_seq *sp, | 524 | int (*seq_send)(struct fc_lport *, struct fc_seq *, |
497 | struct fc_frame *fp); | 525 | struct fc_frame *); |
498 | 526 | ||
499 | /* | 527 | /* |
500 | * Send an ELS response using infomation from a previous | 528 | * Send an ELS response using infomation from a previous |
@@ -502,8 +530,8 @@ struct libfc_function_template { | |||
502 | * | 530 | * |
503 | * STATUS: OPTIONAL | 531 | * STATUS: OPTIONAL |
504 | */ | 532 | */ |
505 | void (*seq_els_rsp_send)(struct fc_seq *sp, enum fc_els_cmd els_cmd, | 533 | void (*seq_els_rsp_send)(struct fc_seq *, enum fc_els_cmd, |
506 | struct fc_seq_els_data *els_data); | 534 | struct fc_seq_els_data *); |
507 | 535 | ||
508 | /* | 536 | /* |
509 | * Abort an exchange and sequence. Generally called because of a | 537 | * Abort an exchange and sequence. Generally called because of a |
@@ -515,7 +543,7 @@ struct libfc_function_template { | |||
515 | * | 543 | * |
516 | * STATUS: OPTIONAL | 544 | * STATUS: OPTIONAL |
517 | */ | 545 | */ |
518 | int (*seq_exch_abort)(const struct fc_seq *req_sp, | 546 | int (*seq_exch_abort)(const struct fc_seq *, |
519 | unsigned int timer_msec); | 547 | unsigned int timer_msec); |
520 | 548 | ||
521 | /* | 549 | /* |
@@ -524,14 +552,14 @@ struct libfc_function_template { | |||
524 | * | 552 | * |
525 | * STATUS: OPTIONAL | 553 | * STATUS: OPTIONAL |
526 | */ | 554 | */ |
527 | void (*exch_done)(struct fc_seq *sp); | 555 | void (*exch_done)(struct fc_seq *); |
528 | 556 | ||
529 | /* | 557 | /* |
530 | * Start a new sequence on the same exchange/sequence tuple. | 558 | * Start a new sequence on the same exchange/sequence tuple. |
531 | * | 559 | * |
532 | * STATUS: OPTIONAL | 560 | * STATUS: OPTIONAL |
533 | */ | 561 | */ |
534 | struct fc_seq *(*seq_start_next)(struct fc_seq *sp); | 562 | struct fc_seq *(*seq_start_next)(struct fc_seq *); |
535 | 563 | ||
536 | /* | 564 | /* |
537 | * Reset an exchange manager, completing all sequences and exchanges. | 565 | * Reset an exchange manager, completing all sequences and exchanges. |
@@ -540,8 +568,7 @@ struct libfc_function_template { | |||
540 | * | 568 | * |
541 | * STATUS: OPTIONAL | 569 | * STATUS: OPTIONAL |
542 | */ | 570 | */ |
543 | void (*exch_mgr_reset)(struct fc_lport *, | 571 | void (*exch_mgr_reset)(struct fc_lport *, u32 s_id, u32 d_id); |
544 | u32 s_id, u32 d_id); | ||
545 | 572 | ||
546 | /* | 573 | /* |
547 | * Flush the rport work queue. Generally used before shutdown. | 574 | * Flush the rport work queue. Generally used before shutdown. |
@@ -555,8 +582,8 @@ struct libfc_function_template { | |||
555 | * | 582 | * |
556 | * STATUS: OPTIONAL | 583 | * STATUS: OPTIONAL |
557 | */ | 584 | */ |
558 | void (*lport_recv)(struct fc_lport *lp, struct fc_seq *sp, | 585 | void (*lport_recv)(struct fc_lport *, struct fc_seq *, |
559 | struct fc_frame *fp); | 586 | struct fc_frame *); |
560 | 587 | ||
561 | /* | 588 | /* |
562 | * Reset the local port. | 589 | * Reset the local port. |
@@ -566,6 +593,26 @@ struct libfc_function_template { | |||
566 | int (*lport_reset)(struct fc_lport *); | 593 | int (*lport_reset)(struct fc_lport *); |
567 | 594 | ||
568 | /* | 595 | /* |
596 | * Set the local port FC_ID. | ||
597 | * | ||
598 | * This may be provided by the LLD to allow it to be | ||
599 | * notified when the local port is assigned a FC-ID. | ||
600 | * | ||
601 | * The frame, if non-NULL, is the incoming frame with the | ||
602 | * FLOGI LS_ACC or FLOGI, and may contain the granted MAC | ||
603 | * address for the LLD. The frame pointer may be NULL if | ||
604 | * no MAC is associated with this assignment (LOGO or PLOGI). | ||
605 | * | ||
606 | * If FC_ID is non-zero, r_a_tov and e_d_tov must be valid. | ||
607 | * | ||
608 | * Note: this is called with the local port mutex held. | ||
609 | * | ||
610 | * STATUS: OPTIONAL | ||
611 | */ | ||
612 | void (*lport_set_port_id)(struct fc_lport *, u32 port_id, | ||
613 | struct fc_frame *); | ||
614 | |||
615 | /* | ||
569 | * Create a remote port with a given port ID | 616 | * Create a remote port with a given port ID |
570 | * | 617 | * |
571 | * STATUS: OPTIONAL | 618 | * STATUS: OPTIONAL |
@@ -622,31 +669,31 @@ struct libfc_function_template { | |||
622 | * | 669 | * |
623 | * STATUS: OPTIONAL | 670 | * STATUS: OPTIONAL |
624 | */ | 671 | */ |
625 | int (*fcp_cmd_send)(struct fc_lport *lp, struct fc_fcp_pkt *fsp, | 672 | int (*fcp_cmd_send)(struct fc_lport *, struct fc_fcp_pkt *, |
626 | void (*resp)(struct fc_seq *, struct fc_frame *fp, | 673 | void (*resp)(struct fc_seq *, struct fc_frame *, |
627 | void *arg)); | 674 | void *)); |
628 | 675 | ||
629 | /* | 676 | /* |
630 | * Cleanup the FCP layer, used durring link down and reset | 677 | * Cleanup the FCP layer, used durring link down and reset |
631 | * | 678 | * |
632 | * STATUS: OPTIONAL | 679 | * STATUS: OPTIONAL |
633 | */ | 680 | */ |
634 | void (*fcp_cleanup)(struct fc_lport *lp); | 681 | void (*fcp_cleanup)(struct fc_lport *); |
635 | 682 | ||
636 | /* | 683 | /* |
637 | * Abort all I/O on a local port | 684 | * Abort all I/O on a local port |
638 | * | 685 | * |
639 | * STATUS: OPTIONAL | 686 | * STATUS: OPTIONAL |
640 | */ | 687 | */ |
641 | void (*fcp_abort_io)(struct fc_lport *lp); | 688 | void (*fcp_abort_io)(struct fc_lport *); |
642 | 689 | ||
643 | /* | 690 | /* |
644 | * Receive a request for the discovery layer. | 691 | * Receive a request for the discovery layer. |
645 | * | 692 | * |
646 | * STATUS: OPTIONAL | 693 | * STATUS: OPTIONAL |
647 | */ | 694 | */ |
648 | void (*disc_recv_req)(struct fc_seq *, | 695 | void (*disc_recv_req)(struct fc_seq *, struct fc_frame *, |
649 | struct fc_frame *, struct fc_lport *); | 696 | struct fc_lport *); |
650 | 697 | ||
651 | /* | 698 | /* |
652 | * Start discovery for a local port. | 699 | * Start discovery for a local port. |
@@ -675,419 +722,340 @@ struct libfc_function_template { | |||
675 | void (*disc_stop_final) (struct fc_lport *); | 722 | void (*disc_stop_final) (struct fc_lport *); |
676 | }; | 723 | }; |
677 | 724 | ||
678 | /* information used by the discovery layer */ | 725 | /** |
726 | * struct fc_disc - Discovery context | ||
727 | * @retry_count: Number of retries | ||
728 | * @pending: 1 if discovery is pending, 0 if not | ||
729 | * @requesting: 1 if discovery has been requested, 0 if not | ||
730 | * @seq_count: Number of sequences used for discovery | ||
731 | * @buf_len: Length of the discovery buffer | ||
732 | * @disc_id: Discovery ID | ||
733 | * @rports: List of discovered remote ports | ||
734 | * @lport: The local port that discovery is for | ||
735 | * @disc_mutex: Mutex that protects the discovery context | ||
736 | * @partial_buf: Partial name buffer (if names are returned | ||
737 | * in multiple frames) | ||
738 | * @disc_work: handle for delayed work context | ||
739 | * @disc_callback: Callback routine called when discovery completes | ||
740 | */ | ||
679 | struct fc_disc { | 741 | struct fc_disc { |
680 | unsigned char retry_count; | 742 | unsigned char retry_count; |
681 | unsigned char pending; | 743 | unsigned char pending; |
682 | unsigned char requested; | 744 | unsigned char requested; |
683 | unsigned short seq_count; | 745 | unsigned short seq_count; |
684 | unsigned char buf_len; | 746 | unsigned char buf_len; |
685 | u16 disc_id; | 747 | u16 disc_id; |
748 | |||
749 | struct list_head rports; | ||
750 | struct fc_lport *lport; | ||
751 | struct mutex disc_mutex; | ||
752 | struct fc_gpn_ft_resp partial_buf; | ||
753 | struct delayed_work disc_work; | ||
686 | 754 | ||
687 | void (*disc_callback)(struct fc_lport *, | 755 | void (*disc_callback)(struct fc_lport *, |
688 | enum fc_disc_event); | 756 | enum fc_disc_event); |
689 | |||
690 | struct list_head rports; | ||
691 | struct fc_lport *lport; | ||
692 | struct mutex disc_mutex; | ||
693 | struct fc_gpn_ft_resp partial_buf; /* partial name buffer */ | ||
694 | struct delayed_work disc_work; | ||
695 | }; | 757 | }; |
696 | 758 | ||
759 | /** | ||
760 | * struct fc_lport - Local port | ||
761 | * @host: The SCSI host associated with a local port | ||
762 | * @ema_list: Exchange manager anchor list | ||
763 | * @dns_rdata: The directory server remote port | ||
764 | * @ptp_rdata: Point to point remote port | ||
765 | * @scsi_priv: FCP layer internal data | ||
766 | * @disc: Discovery context | ||
767 | * @vports: Child vports if N_Port | ||
768 | * @vport: Parent vport if VN_Port | ||
769 | * @tt: Libfc function template | ||
770 | * @link_up: Link state (1 = link up, 0 = link down) | ||
771 | * @qfull: Queue state (1 queue is full, 0 queue is not full) | ||
772 | * @state: Identifies the state | ||
773 | * @boot_time: Timestamp indicating when the local port came online | ||
774 | * @host_stats: SCSI host statistics | ||
775 | * @dev_stats: FCoE device stats (TODO: libfc should not be | ||
776 | * FCoE aware) | ||
777 | * @retry_count: Number of retries in the current state | ||
778 | * @wwpn: World Wide Port Name | ||
779 | * @wwnn: World Wide Node Name | ||
780 | * @service_params: Common service parameters | ||
781 | * @e_d_tov: Error detection timeout value | ||
782 | * @r_a_tov: Resouce allocation timeout value | ||
783 | * @rnid_gen: RNID information | ||
784 | * @sg_supp: Indicates if scatter gather is supported | ||
785 | * @seq_offload: Indicates if sequence offload is supported | ||
786 | * @crc_offload: Indicates if CRC offload is supported | ||
787 | * @lro_enabled: Indicates if large receive offload is supported | ||
788 | * @does_npiv: Supports multiple vports | ||
789 | * @npiv_enabled: Switch/fabric allows NPIV | ||
790 | * @mfs: The maximum Fibre Channel payload size | ||
791 | * @max_retry_count: The maximum retry attempts | ||
792 | * @max_rport_retry_count: The maximum remote port retry attempts | ||
793 | * @lro_xid: The maximum XID for LRO | ||
794 | * @lso_max: The maximum large offload send size | ||
795 | * @fcts: FC-4 type mask | ||
796 | * @lp_mutex: Mutex to protect the local port | ||
797 | * @list: Handle for list of local ports | ||
798 | * @retry_work: Handle to local port for delayed retry context | ||
799 | */ | ||
697 | struct fc_lport { | 800 | struct fc_lport { |
698 | struct list_head list; | ||
699 | |||
700 | /* Associations */ | 801 | /* Associations */ |
701 | struct Scsi_Host *host; | 802 | struct Scsi_Host *host; |
702 | struct list_head ema_list; | 803 | struct list_head ema_list; |
703 | struct fc_rport_priv *dns_rp; | 804 | struct fc_rport_priv *dns_rdata; |
704 | struct fc_rport_priv *ptp_rp; | 805 | struct fc_rport_priv *ptp_rdata; |
705 | void *scsi_priv; | 806 | void *scsi_priv; |
706 | struct fc_disc disc; | 807 | struct fc_disc disc; |
808 | |||
809 | /* Virtual port information */ | ||
810 | struct list_head vports; | ||
811 | struct fc_vport *vport; | ||
707 | 812 | ||
708 | /* Operational Information */ | 813 | /* Operational Information */ |
709 | struct libfc_function_template tt; | 814 | struct libfc_function_template tt; |
710 | u8 link_up; | 815 | u8 link_up; |
711 | u8 qfull; | 816 | u8 qfull; |
712 | enum fc_lport_state state; | 817 | enum fc_lport_state state; |
713 | unsigned long boot_time; | 818 | unsigned long boot_time; |
714 | 819 | struct fc_host_statistics host_stats; | |
715 | struct fc_host_statistics host_stats; | 820 | struct fcoe_dev_stats *dev_stats; |
716 | struct fcoe_dev_stats *dev_stats; | 821 | u8 retry_count; |
717 | 822 | ||
718 | u64 wwpn; | 823 | /* Fabric information */ |
719 | u64 wwnn; | 824 | u64 wwpn; |
720 | u8 retry_count; | 825 | u64 wwnn; |
826 | unsigned int service_params; | ||
827 | unsigned int e_d_tov; | ||
828 | unsigned int r_a_tov; | ||
829 | struct fc_els_rnid_gen rnid_gen; | ||
721 | 830 | ||
722 | /* Capabilities */ | 831 | /* Capabilities */ |
723 | u32 sg_supp:1; /* scatter gather supported */ | 832 | u32 sg_supp:1; |
724 | u32 seq_offload:1; /* seq offload supported */ | 833 | u32 seq_offload:1; |
725 | u32 crc_offload:1; /* crc offload supported */ | 834 | u32 crc_offload:1; |
726 | u32 lro_enabled:1; /* large receive offload */ | 835 | u32 lro_enabled:1; |
727 | u32 mfs; /* max FC payload size */ | 836 | u32 does_npiv:1; |
728 | unsigned int service_params; | 837 | u32 npiv_enabled:1; |
729 | unsigned int e_d_tov; | 838 | u32 mfs; |
730 | unsigned int r_a_tov; | 839 | u8 max_retry_count; |
731 | u8 max_retry_count; | 840 | u8 max_rport_retry_count; |
732 | u8 max_rport_retry_count; | 841 | u16 link_speed; |
733 | u16 link_speed; | 842 | u16 link_supported_speeds; |
734 | u16 link_supported_speeds; | 843 | u16 lro_xid; |
735 | u16 lro_xid; /* max xid for fcoe lro */ | 844 | unsigned int lso_max; |
736 | unsigned int lso_max; /* max large send size */ | 845 | struct fc_ns_fts fcts; |
737 | struct fc_ns_fts fcts; /* FC-4 type masks */ | ||
738 | struct fc_els_rnid_gen rnid_gen; /* RNID information */ | ||
739 | |||
740 | /* Semaphores */ | ||
741 | struct mutex lp_mutex; | ||
742 | 846 | ||
743 | /* Miscellaneous */ | 847 | /* Miscellaneous */ |
744 | struct delayed_work retry_work; | 848 | struct mutex lp_mutex; |
745 | struct delayed_work disc_work; | 849 | struct list_head list; |
850 | struct delayed_work retry_work; | ||
746 | }; | 851 | }; |
747 | 852 | ||
748 | /* | 853 | /* |
749 | * FC_LPORT HELPER FUNCTIONS | 854 | * FC_LPORT HELPER FUNCTIONS |
750 | *****************************/ | 855 | *****************************/ |
751 | static inline int fc_lport_test_ready(struct fc_lport *lp) | 856 | |
857 | /** | ||
858 | * fc_lport_test_ready() - Determine if a local port is in the READY state | ||
859 | * @lport: The local port to test | ||
860 | */ | ||
861 | static inline int fc_lport_test_ready(struct fc_lport *lport) | ||
752 | { | 862 | { |
753 | return lp->state == LPORT_ST_READY; | 863 | return lport->state == LPORT_ST_READY; |
754 | } | 864 | } |
755 | 865 | ||
756 | static inline void fc_set_wwnn(struct fc_lport *lp, u64 wwnn) | 866 | /** |
867 | * fc_set_wwnn() - Set the World Wide Node Name of a local port | ||
868 | * @lport: The local port whose WWNN is to be set | ||
869 | * @wwnn: The new WWNN | ||
870 | */ | ||
871 | static inline void fc_set_wwnn(struct fc_lport *lport, u64 wwnn) | ||
757 | { | 872 | { |
758 | lp->wwnn = wwnn; | 873 | lport->wwnn = wwnn; |
759 | } | 874 | } |
760 | 875 | ||
761 | static inline void fc_set_wwpn(struct fc_lport *lp, u64 wwnn) | 876 | /** |
877 | * fc_set_wwpn() - Set the World Wide Port Name of a local port | ||
878 | * @lport: The local port whose WWPN is to be set | ||
879 | * @wwnn: The new WWPN | ||
880 | */ | ||
881 | static inline void fc_set_wwpn(struct fc_lport *lport, u64 wwnn) | ||
762 | { | 882 | { |
763 | lp->wwpn = wwnn; | 883 | lport->wwpn = wwnn; |
764 | } | 884 | } |
765 | 885 | ||
766 | static inline void fc_lport_state_enter(struct fc_lport *lp, | 886 | /** |
887 | * fc_lport_state_enter() - Change a local port's state | ||
888 | * @lport: The local port whose state is to change | ||
889 | * @state: The new state | ||
890 | */ | ||
891 | static inline void fc_lport_state_enter(struct fc_lport *lport, | ||
767 | enum fc_lport_state state) | 892 | enum fc_lport_state state) |
768 | { | 893 | { |
769 | if (state != lp->state) | 894 | if (state != lport->state) |
770 | lp->retry_count = 0; | 895 | lport->retry_count = 0; |
771 | lp->state = state; | 896 | lport->state = state; |
772 | } | 897 | } |
773 | 898 | ||
774 | static inline int fc_lport_init_stats(struct fc_lport *lp) | 899 | /** |
900 | * fc_lport_init_stats() - Allocate per-CPU statistics for a local port | ||
901 | * @lport: The local port whose statistics are to be initialized | ||
902 | */ | ||
903 | static inline int fc_lport_init_stats(struct fc_lport *lport) | ||
775 | { | 904 | { |
776 | /* allocate per cpu stats block */ | 905 | lport->dev_stats = alloc_percpu(struct fcoe_dev_stats); |
777 | lp->dev_stats = alloc_percpu(struct fcoe_dev_stats); | 906 | if (!lport->dev_stats) |
778 | if (!lp->dev_stats) | ||
779 | return -ENOMEM; | 907 | return -ENOMEM; |
780 | return 0; | 908 | return 0; |
781 | } | 909 | } |
782 | 910 | ||
783 | static inline void fc_lport_free_stats(struct fc_lport *lp) | 911 | /** |
912 | * fc_lport_free_stats() - Free memory for a local port's statistics | ||
913 | * @lport: The local port whose statistics are to be freed | ||
914 | */ | ||
915 | static inline void fc_lport_free_stats(struct fc_lport *lport) | ||
784 | { | 916 | { |
785 | free_percpu(lp->dev_stats); | 917 | free_percpu(lport->dev_stats); |
786 | } | 918 | } |
787 | 919 | ||
788 | static inline struct fcoe_dev_stats *fc_lport_get_stats(struct fc_lport *lp) | 920 | /** |
921 | * fc_lport_get_stats() - Get a local port's statistics | ||
922 | * @lport: The local port whose statistics are to be retreived | ||
923 | */ | ||
924 | static inline struct fcoe_dev_stats *fc_lport_get_stats(struct fc_lport *lport) | ||
789 | { | 925 | { |
790 | return per_cpu_ptr(lp->dev_stats, smp_processor_id()); | 926 | return per_cpu_ptr(lport->dev_stats, smp_processor_id()); |
791 | } | 927 | } |
792 | 928 | ||
793 | static inline void *lport_priv(const struct fc_lport *lp) | 929 | /** |
930 | * lport_priv() - Return the private data from a local port | ||
931 | * @lport: The local port whose private data is to be retreived | ||
932 | */ | ||
933 | static inline void *lport_priv(const struct fc_lport *lport) | ||
794 | { | 934 | { |
795 | return (void *)(lp + 1); | 935 | return (void *)(lport + 1); |
796 | } | 936 | } |
797 | 937 | ||
798 | /** | 938 | /** |
799 | * libfc_host_alloc() - Allocate a Scsi_Host with room for the fc_lport | 939 | * libfc_host_alloc() - Allocate a Scsi_Host with room for a local port and |
800 | * @sht: ptr to the scsi host templ | 940 | * LLD private data |
801 | * @priv_size: size of private data after fc_lport | 941 | * @sht: The SCSI host template |
942 | * @priv_size: Size of private data | ||
802 | * | 943 | * |
803 | * Returns: ptr to Scsi_Host | 944 | * Returns: libfc lport |
804 | */ | 945 | */ |
805 | static inline struct Scsi_Host * | 946 | static inline struct fc_lport * |
806 | libfc_host_alloc(struct scsi_host_template *sht, int priv_size) | 947 | libfc_host_alloc(struct scsi_host_template *sht, int priv_size) |
807 | { | 948 | { |
808 | return scsi_host_alloc(sht, sizeof(struct fc_lport) + priv_size); | 949 | struct fc_lport *lport; |
950 | struct Scsi_Host *shost; | ||
951 | |||
952 | shost = scsi_host_alloc(sht, sizeof(*lport) + priv_size); | ||
953 | if (!shost) | ||
954 | return NULL; | ||
955 | lport = shost_priv(shost); | ||
956 | lport->host = shost; | ||
957 | INIT_LIST_HEAD(&lport->ema_list); | ||
958 | INIT_LIST_HEAD(&lport->vports); | ||
959 | return lport; | ||
809 | } | 960 | } |
810 | 961 | ||
811 | /* | 962 | /* |
812 | * LOCAL PORT LAYER | 963 | * FC_FCP HELPER FUNCTIONS |
813 | *****************************/ | 964 | *****************************/ |
814 | int fc_lport_init(struct fc_lport *lp); | 965 | static inline bool fc_fcp_is_read(const struct fc_fcp_pkt *fsp) |
815 | 966 | { | |
816 | /* | 967 | if (fsp && fsp->cmd) |
817 | * Destroy the specified local port by finding and freeing all | 968 | return fsp->cmd->sc_data_direction == DMA_FROM_DEVICE; |
818 | * fc_rports associated with it and then by freeing the fc_lport | 969 | return false; |
819 | * itself. | 970 | } |
820 | */ | ||
821 | int fc_lport_destroy(struct fc_lport *lp); | ||
822 | |||
823 | /* | ||
824 | * Logout the specified local port from the fabric | ||
825 | */ | ||
826 | int fc_fabric_logoff(struct fc_lport *lp); | ||
827 | |||
828 | /* | ||
829 | * Initiate the LP state machine. This handler will use fc_host_attr | ||
830 | * to store the FLOGI service parameters, so fc_host_attr must be | ||
831 | * initialized before calling this handler. | ||
832 | */ | ||
833 | int fc_fabric_login(struct fc_lport *lp); | ||
834 | 971 | ||
835 | /* | 972 | /* |
836 | * The link is up for the given local port. | 973 | * LOCAL PORT LAYER |
837 | */ | 974 | *****************************/ |
975 | int fc_lport_init(struct fc_lport *); | ||
976 | int fc_lport_destroy(struct fc_lport *); | ||
977 | int fc_fabric_logoff(struct fc_lport *); | ||
978 | int fc_fabric_login(struct fc_lport *); | ||
979 | void __fc_linkup(struct fc_lport *); | ||
838 | void fc_linkup(struct fc_lport *); | 980 | void fc_linkup(struct fc_lport *); |
839 | 981 | void __fc_linkdown(struct fc_lport *); | |
840 | /* | ||
841 | * Link is down for the given local port. | ||
842 | */ | ||
843 | void fc_linkdown(struct fc_lport *); | 982 | void fc_linkdown(struct fc_lport *); |
844 | 983 | void fc_vport_setlink(struct fc_lport *); | |
845 | /* | 984 | void fc_vports_linkchange(struct fc_lport *); |
846 | * Configure the local port. | ||
847 | */ | ||
848 | int fc_lport_config(struct fc_lport *); | 985 | int fc_lport_config(struct fc_lport *); |
849 | |||
850 | /* | ||
851 | * Reset the local port. | ||
852 | */ | ||
853 | int fc_lport_reset(struct fc_lport *); | 986 | int fc_lport_reset(struct fc_lport *); |
854 | 987 | int fc_set_mfs(struct fc_lport *, u32 mfs); | |
855 | /* | 988 | struct fc_lport *libfc_vport_create(struct fc_vport *, int privsize); |
856 | * Set the mfs or reset | 989 | struct fc_lport *fc_vport_id_lookup(struct fc_lport *, u32 port_id); |
857 | */ | 990 | int fc_lport_bsg_request(struct fc_bsg_job *); |
858 | int fc_set_mfs(struct fc_lport *lp, u32 mfs); | ||
859 | |||
860 | 991 | ||
861 | /* | 992 | /* |
862 | * REMOTE PORT LAYER | 993 | * REMOTE PORT LAYER |
863 | *****************************/ | 994 | *****************************/ |
864 | int fc_rport_init(struct fc_lport *lp); | 995 | int fc_rport_init(struct fc_lport *); |
865 | void fc_rport_terminate_io(struct fc_rport *rp); | 996 | void fc_rport_terminate_io(struct fc_rport *); |
866 | 997 | ||
867 | /* | 998 | /* |
868 | * DISCOVERY LAYER | 999 | * DISCOVERY LAYER |
869 | *****************************/ | 1000 | *****************************/ |
870 | int fc_disc_init(struct fc_lport *lp); | 1001 | int fc_disc_init(struct fc_lport *); |
871 | |||
872 | 1002 | ||
873 | /* | 1003 | /* |
874 | * SCSI LAYER | 1004 | * FCP LAYER |
875 | *****************************/ | 1005 | *****************************/ |
876 | /* | ||
877 | * Initialize the SCSI block of libfc | ||
878 | */ | ||
879 | int fc_fcp_init(struct fc_lport *); | 1006 | int fc_fcp_init(struct fc_lport *); |
880 | |||
881 | /* | ||
882 | * This section provides an API which allows direct interaction | ||
883 | * with the SCSI-ml. Each of these functions satisfies a function | ||
884 | * pointer defined in Scsi_Host and therefore is always called | ||
885 | * directly from the SCSI-ml. | ||
886 | */ | ||
887 | int fc_queuecommand(struct scsi_cmnd *sc_cmd, | ||
888 | void (*done)(struct scsi_cmnd *)); | ||
889 | |||
890 | /* | ||
891 | * complete processing of a fcp packet | ||
892 | * | ||
893 | * This function may sleep if a fsp timer is pending. | ||
894 | * The host lock must not be held by caller. | ||
895 | */ | ||
896 | void fc_fcp_complete(struct fc_fcp_pkt *fsp); | ||
897 | |||
898 | /* | ||
899 | * Send an ABTS frame to the target device. The sc_cmd argument | ||
900 | * is a pointer to the SCSI command to be aborted. | ||
901 | */ | ||
902 | int fc_eh_abort(struct scsi_cmnd *sc_cmd); | ||
903 | |||
904 | /* | ||
905 | * Reset a LUN by sending send the tm cmd to the target. | ||
906 | */ | ||
907 | int fc_eh_device_reset(struct scsi_cmnd *sc_cmd); | ||
908 | |||
909 | /* | ||
910 | * Reset the host adapter. | ||
911 | */ | ||
912 | int fc_eh_host_reset(struct scsi_cmnd *sc_cmd); | ||
913 | |||
914 | /* | ||
915 | * Check rport status. | ||
916 | */ | ||
917 | int fc_slave_alloc(struct scsi_device *sdev); | ||
918 | |||
919 | /* | ||
920 | * Adjust the queue depth. | ||
921 | */ | ||
922 | int fc_change_queue_depth(struct scsi_device *sdev, int qdepth); | ||
923 | |||
924 | /* | ||
925 | * Change the tag type. | ||
926 | */ | ||
927 | int fc_change_queue_type(struct scsi_device *sdev, int tag_type); | ||
928 | |||
929 | /* | ||
930 | * Free memory pools used by the FCP layer. | ||
931 | */ | ||
932 | void fc_fcp_destroy(struct fc_lport *); | 1007 | void fc_fcp_destroy(struct fc_lport *); |
933 | 1008 | ||
934 | /* | 1009 | /* |
935 | * Set up direct-data placement for this I/O request | 1010 | * SCSI INTERACTION LAYER |
936 | */ | 1011 | *****************************/ |
937 | void fc_fcp_ddp_setup(struct fc_fcp_pkt *fsp, u16 xid); | 1012 | int fc_queuecommand(struct scsi_cmnd *, |
1013 | void (*done)(struct scsi_cmnd *)); | ||
1014 | int fc_eh_abort(struct scsi_cmnd *); | ||
1015 | int fc_eh_device_reset(struct scsi_cmnd *); | ||
1016 | int fc_eh_host_reset(struct scsi_cmnd *); | ||
1017 | int fc_slave_alloc(struct scsi_device *); | ||
1018 | int fc_change_queue_depth(struct scsi_device *, int qdepth, int reason); | ||
1019 | int fc_change_queue_type(struct scsi_device *, int tag_type); | ||
938 | 1020 | ||
939 | /* | 1021 | /* |
940 | * ELS/CT interface | 1022 | * ELS/CT interface |
941 | *****************************/ | 1023 | *****************************/ |
942 | /* | 1024 | int fc_elsct_init(struct fc_lport *); |
943 | * Initializes ELS/CT interface | 1025 | struct fc_seq *fc_elsct_send(struct fc_lport *, u32 did, |
944 | */ | 1026 | struct fc_frame *, |
945 | int fc_elsct_init(struct fc_lport *lp); | 1027 | unsigned int op, |
1028 | void (*resp)(struct fc_seq *, | ||
1029 | struct fc_frame *, | ||
1030 | void *arg), | ||
1031 | void *arg, u32 timer_msec); | ||
1032 | void fc_lport_flogi_resp(struct fc_seq *, struct fc_frame *, void *); | ||
1033 | void fc_lport_logo_resp(struct fc_seq *, struct fc_frame *, void *); | ||
946 | 1034 | ||
947 | 1035 | ||
948 | /* | 1036 | /* |
949 | * EXCHANGE MANAGER LAYER | 1037 | * EXCHANGE MANAGER LAYER |
950 | *****************************/ | 1038 | *****************************/ |
951 | /* | 1039 | int fc_exch_init(struct fc_lport *); |
952 | * Initializes Exchange Manager related | 1040 | struct fc_exch_mgr_anchor *fc_exch_mgr_add(struct fc_lport *, |
953 | * function pointers in struct libfc_function_template. | 1041 | struct fc_exch_mgr *, |
954 | */ | ||
955 | int fc_exch_init(struct fc_lport *lp); | ||
956 | |||
957 | /* | ||
958 | * Adds Exchange Manager (EM) mp to lport. | ||
959 | * | ||
960 | * Adds specified mp to lport using struct fc_exch_mgr_anchor, | ||
961 | * the struct fc_exch_mgr_anchor allows same EM sharing by | ||
962 | * more than one lport with their specified match function, | ||
963 | * the match function is used in allocating exchange from | ||
964 | * added mp. | ||
965 | */ | ||
966 | struct fc_exch_mgr_anchor *fc_exch_mgr_add(struct fc_lport *lport, | ||
967 | struct fc_exch_mgr *mp, | ||
968 | bool (*match)(struct fc_frame *)); | 1042 | bool (*match)(struct fc_frame *)); |
969 | 1043 | void fc_exch_mgr_del(struct fc_exch_mgr_anchor *); | |
970 | /* | 1044 | int fc_exch_mgr_list_clone(struct fc_lport *src, struct fc_lport *dst); |
971 | * Deletes Exchange Manager (EM) from lport by removing | 1045 | struct fc_exch_mgr *fc_exch_mgr_alloc(struct fc_lport *, enum fc_class class, |
972 | * its anchor ema from lport. | 1046 | u16 min_xid, u16 max_xid, |
973 | * | ||
974 | * If removed anchor ema was the last user of its associated EM | ||
975 | * then also destroys associated EM. | ||
976 | */ | ||
977 | void fc_exch_mgr_del(struct fc_exch_mgr_anchor *ema); | ||
978 | |||
979 | /* | ||
980 | * Allocates an Exchange Manager (EM). | ||
981 | * | ||
982 | * The EM manages exchanges for their allocation and | ||
983 | * free, also allows exchange lookup for received | ||
984 | * frame. | ||
985 | * | ||
986 | * The class is used for initializing FC class of | ||
987 | * allocated exchange from EM. | ||
988 | * | ||
989 | * The min_xid and max_xid will limit new | ||
990 | * exchange ID (XID) within this range for | ||
991 | * a new exchange. | ||
992 | * The LLD may choose to have multiple EMs, | ||
993 | * e.g. one EM instance per CPU receive thread in LLD. | ||
994 | * | ||
995 | * Specified match function is used in allocating exchanges | ||
996 | * from newly allocated EM. | ||
997 | */ | ||
998 | struct fc_exch_mgr *fc_exch_mgr_alloc(struct fc_lport *lp, | ||
999 | enum fc_class class, | ||
1000 | u16 min_xid, | ||
1001 | u16 max_xid, | ||
1002 | bool (*match)(struct fc_frame *)); | 1047 | bool (*match)(struct fc_frame *)); |
1003 | 1048 | void fc_exch_mgr_free(struct fc_lport *); | |
1004 | /* | 1049 | void fc_exch_recv(struct fc_lport *, struct fc_frame *); |
1005 | * Free all exchange managers of a lport. | ||
1006 | */ | ||
1007 | void fc_exch_mgr_free(struct fc_lport *lport); | ||
1008 | |||
1009 | /* | ||
1010 | * Receive a frame on specified local port and exchange manager. | ||
1011 | */ | ||
1012 | void fc_exch_recv(struct fc_lport *lp, struct fc_frame *fp); | ||
1013 | |||
1014 | /* | ||
1015 | * This function is for exch_seq_send function pointer in | ||
1016 | * struct libfc_function_template, see comment block on | ||
1017 | * exch_seq_send for description of this function. | ||
1018 | */ | ||
1019 | struct fc_seq *fc_exch_seq_send(struct fc_lport *lp, | ||
1020 | struct fc_frame *fp, | ||
1021 | void (*resp)(struct fc_seq *sp, | ||
1022 | struct fc_frame *fp, | ||
1023 | void *arg), | ||
1024 | void (*destructor)(struct fc_seq *sp, | ||
1025 | void *arg), | ||
1026 | void *arg, u32 timer_msec); | ||
1027 | |||
1028 | /* | ||
1029 | * send a frame using existing sequence and exchange. | ||
1030 | */ | ||
1031 | int fc_seq_send(struct fc_lport *lp, struct fc_seq *sp, struct fc_frame *fp); | ||
1032 | |||
1033 | /* | ||
1034 | * Send ELS response using mainly infomation | ||
1035 | * in exchange and sequence in EM layer. | ||
1036 | */ | ||
1037 | void fc_seq_els_rsp_send(struct fc_seq *sp, enum fc_els_cmd els_cmd, | ||
1038 | struct fc_seq_els_data *els_data); | ||
1039 | |||
1040 | /* | ||
1041 | * This function is for seq_exch_abort function pointer in | ||
1042 | * struct libfc_function_template, see comment block on | ||
1043 | * seq_exch_abort for description of this function. | ||
1044 | */ | ||
1045 | int fc_seq_exch_abort(const struct fc_seq *req_sp, unsigned int timer_msec); | ||
1046 | |||
1047 | /* | ||
1048 | * Indicate that an exchange/sequence tuple is complete and the memory | ||
1049 | * allocated for the related objects may be freed. | ||
1050 | */ | ||
1051 | void fc_exch_done(struct fc_seq *sp); | ||
1052 | |||
1053 | /* | ||
1054 | * Allocate a new exchange and sequence pair. | ||
1055 | */ | ||
1056 | struct fc_exch *fc_exch_alloc(struct fc_lport *lport, struct fc_frame *fp); | ||
1057 | /* | ||
1058 | * Start a new sequence on the same exchange as the supplied sequence. | ||
1059 | */ | ||
1060 | struct fc_seq *fc_seq_start_next(struct fc_seq *sp); | ||
1061 | |||
1062 | |||
1063 | /* | ||
1064 | * Reset all EMs of a lport, releasing its all sequences and | ||
1065 | * exchanges. If sid is non-zero, then reset only exchanges | ||
1066 | * we sourced from that FID. If did is non-zero, reset only | ||
1067 | * exchanges destined to that FID. | ||
1068 | */ | ||
1069 | void fc_exch_mgr_reset(struct fc_lport *, u32 s_id, u32 d_id); | 1050 | void fc_exch_mgr_reset(struct fc_lport *, u32 s_id, u32 d_id); |
1070 | 1051 | ||
1071 | /* | 1052 | /* |
1072 | * Functions for fc_functions_template | 1053 | * Functions for fc_functions_template |
1073 | */ | 1054 | */ |
1074 | void fc_get_host_speed(struct Scsi_Host *shost); | 1055 | void fc_get_host_speed(struct Scsi_Host *); |
1075 | void fc_get_host_port_type(struct Scsi_Host *shost); | 1056 | void fc_get_host_port_type(struct Scsi_Host *); |
1076 | void fc_get_host_port_state(struct Scsi_Host *shost); | 1057 | void fc_get_host_port_state(struct Scsi_Host *); |
1077 | void fc_set_rport_loss_tmo(struct fc_rport *rport, u32 timeout); | 1058 | void fc_set_rport_loss_tmo(struct fc_rport *, u32 timeout); |
1078 | struct fc_host_statistics *fc_get_host_stats(struct Scsi_Host *); | 1059 | struct fc_host_statistics *fc_get_host_stats(struct Scsi_Host *); |
1079 | 1060 | ||
1080 | /* | ||
1081 | * module setup functions. | ||
1082 | */ | ||
1083 | int fc_setup_exch_mgr(void); | ||
1084 | void fc_destroy_exch_mgr(void); | ||
1085 | int fc_setup_rport(void); | ||
1086 | void fc_destroy_rport(void); | ||
1087 | |||
1088 | /* | ||
1089 | * Internal libfc functions. | ||
1090 | */ | ||
1091 | const char *fc_els_resp_type(struct fc_frame *); | ||
1092 | |||
1093 | #endif /* _LIBFC_H_ */ | 1061 | #endif /* _LIBFC_H_ */ |
diff --git a/include/scsi/libfcoe.h b/include/scsi/libfcoe.h index b2410605b740..c603f4a7e7fc 100644 --- a/include/scsi/libfcoe.h +++ b/include/scsi/libfcoe.h | |||
@@ -53,33 +53,36 @@ enum fip_state { | |||
53 | }; | 53 | }; |
54 | 54 | ||
55 | /** | 55 | /** |
56 | * struct fcoe_ctlr - FCoE Controller and FIP state. | 56 | * struct fcoe_ctlr - FCoE Controller and FIP state |
57 | * @state: internal FIP state for network link and FIP or non-FIP mode. | 57 | * @state: internal FIP state for network link and FIP or non-FIP mode. |
58 | * @lp: &fc_lport: libfc local port. | 58 | * @mode: LLD-selected mode. |
59 | * @sel_fcf: currently selected FCF, or NULL. | 59 | * @lp: &fc_lport: libfc local port. |
60 | * @fcfs: list of discovered FCFs. | 60 | * @sel_fcf: currently selected FCF, or NULL. |
61 | * @fcf_count: number of discovered FCF entries. | 61 | * @fcfs: list of discovered FCFs. |
62 | * @sol_time: time when a multicast solicitation was last sent. | 62 | * @fcf_count: number of discovered FCF entries. |
63 | * @sel_time: time after which to select an FCF. | 63 | * @sol_time: time when a multicast solicitation was last sent. |
64 | * @port_ka_time: time of next port keep-alive. | 64 | * @sel_time: time after which to select an FCF. |
65 | * @ctlr_ka_time: time of next controller keep-alive. | 65 | * @port_ka_time: time of next port keep-alive. |
66 | * @timer: timer struct used for all delayed events. | 66 | * @ctlr_ka_time: time of next controller keep-alive. |
67 | * @link_work: &work_struct for doing FCF selection. | 67 | * @timer: timer struct used for all delayed events. |
68 | * @recv_work: &work_struct for receiving FIP frames. | 68 | * @link_work: &work_struct for doing FCF selection. |
69 | * @recv_work: &work_struct for receiving FIP frames. | ||
69 | * @fip_recv_list: list of received FIP frames. | 70 | * @fip_recv_list: list of received FIP frames. |
70 | * @user_mfs: configured maximum FC frame size, including FC header. | 71 | * @user_mfs: configured maximum FC frame size, including FC header. |
71 | * @flogi_oxid: exchange ID of most recent fabric login. | 72 | * @flogi_oxid: exchange ID of most recent fabric login. |
72 | * @flogi_count: number of FLOGI attempts in AUTO mode. | 73 | * @flogi_count: number of FLOGI attempts in AUTO mode. |
73 | * @link: current link status for libfc. | 74 | * @link: current link status for libfc. |
74 | * @last_link: last link state reported to libfc. | 75 | * @last_link: last link state reported to libfc. |
75 | * @map_dest: use the FC_MAP mode for destination MAC addresses. | 76 | * @map_dest: use the FC_MAP mode for destination MAC addresses. |
76 | * @spma: supports SPMA server-provided MACs mode | 77 | * @spma: supports SPMA server-provided MACs mode |
77 | * @dest_addr: MAC address of the selected FC forwarder. | 78 | * @send_ctlr_ka: need to send controller keep alive |
78 | * @ctl_src_addr: the native MAC address of our local port. | 79 | * @send_port_ka: need to send port keep alives |
79 | * @data_src_addr: the assigned MAC address for the local port after FLOGI. | 80 | * @dest_addr: MAC address of the selected FC forwarder. |
80 | * @send: LLD-supplied function to handle sending of FIP Ethernet frames. | 81 | * @ctl_src_addr: the native MAC address of our local port. |
81 | * @update_mac: LLD-supplied function to handle changes to MAC addresses. | 82 | * @send: LLD-supplied function to handle sending FIP Ethernet frames |
82 | * @lock: lock protecting this structure. | 83 | * @update_mac: LLD-supplied function to handle changes to MAC addresses. |
84 | * @get_src_addr: LLD-supplied function to supply a source MAC address. | ||
85 | * @lock: lock protecting this structure. | ||
83 | * | 86 | * |
84 | * This structure is used by all FCoE drivers. It contains information | 87 | * This structure is used by all FCoE drivers. It contains information |
85 | * needed by all FCoE low-level drivers (LLDs) as well as internal state | 88 | * needed by all FCoE low-level drivers (LLDs) as well as internal state |
@@ -87,6 +90,7 @@ enum fip_state { | |||
87 | */ | 90 | */ |
88 | struct fcoe_ctlr { | 91 | struct fcoe_ctlr { |
89 | enum fip_state state; | 92 | enum fip_state state; |
93 | enum fip_state mode; | ||
90 | struct fc_lport *lp; | 94 | struct fc_lport *lp; |
91 | struct fcoe_fcf *sel_fcf; | 95 | struct fcoe_fcf *sel_fcf; |
92 | struct list_head fcfs; | 96 | struct list_head fcfs; |
@@ -104,29 +108,32 @@ struct fcoe_ctlr { | |||
104 | u8 flogi_count; | 108 | u8 flogi_count; |
105 | u8 link; | 109 | u8 link; |
106 | u8 last_link; | 110 | u8 last_link; |
111 | u8 reset_req; | ||
107 | u8 map_dest; | 112 | u8 map_dest; |
108 | u8 spma; | 113 | u8 spma; |
114 | u8 send_ctlr_ka; | ||
115 | u8 send_port_ka; | ||
109 | u8 dest_addr[ETH_ALEN]; | 116 | u8 dest_addr[ETH_ALEN]; |
110 | u8 ctl_src_addr[ETH_ALEN]; | 117 | u8 ctl_src_addr[ETH_ALEN]; |
111 | u8 data_src_addr[ETH_ALEN]; | ||
112 | 118 | ||
113 | void (*send)(struct fcoe_ctlr *, struct sk_buff *); | 119 | void (*send)(struct fcoe_ctlr *, struct sk_buff *); |
114 | void (*update_mac)(struct fcoe_ctlr *, u8 *old, u8 *new); | 120 | void (*update_mac)(struct fc_lport *, u8 *addr); |
121 | u8 * (*get_src_addr)(struct fc_lport *); | ||
115 | spinlock_t lock; | 122 | spinlock_t lock; |
116 | }; | 123 | }; |
117 | 124 | ||
118 | /* | 125 | /** |
119 | * struct fcoe_fcf - Fibre-Channel Forwarder. | 126 | * struct fcoe_fcf - Fibre-Channel Forwarder |
120 | * @list: list linkage. | 127 | * @list: list linkage |
121 | * @time: system time (jiffies) when an advertisement was last received. | 128 | * @time: system time (jiffies) when an advertisement was last received |
122 | * @switch_name: WWN of switch from advertisement. | 129 | * @switch_name: WWN of switch from advertisement |
123 | * @fabric_name: WWN of fabric from advertisement. | 130 | * @fabric_name: WWN of fabric from advertisement |
124 | * @fc_map: FC_MAP value from advertisement. | 131 | * @fc_map: FC_MAP value from advertisement |
125 | * @fcf_mac: Ethernet address of the FCF. | 132 | * @fcf_mac: Ethernet address of the FCF |
126 | * @vfid: virtual fabric ID. | 133 | * @vfid: virtual fabric ID |
127 | * @pri: seletion priority, smaller values are better. | 134 | * @pri: selection priority, smaller values are better |
128 | * @flags: flags received from advertisement. | 135 | * @flags: flags received from advertisement |
129 | * @fka_period: keep-alive period, in jiffies. | 136 | * @fka_period: keep-alive period, in jiffies |
130 | * | 137 | * |
131 | * A Fibre-Channel Forwarder (FCF) is the entity on the Ethernet that | 138 | * A Fibre-Channel Forwarder (FCF) is the entity on the Ethernet that |
132 | * passes FCoE frames on to an FC fabric. This structure represents | 139 | * passes FCoE frames on to an FC fabric. This structure represents |
@@ -148,6 +155,7 @@ struct fcoe_fcf { | |||
148 | u8 pri; | 155 | u8 pri; |
149 | u16 flags; | 156 | u16 flags; |
150 | u32 fka_period; | 157 | u32 fka_period; |
158 | u8 fd_flags:1; | ||
151 | }; | 159 | }; |
152 | 160 | ||
153 | /* FIP API functions */ | 161 | /* FIP API functions */ |
@@ -155,9 +163,10 @@ void fcoe_ctlr_init(struct fcoe_ctlr *); | |||
155 | void fcoe_ctlr_destroy(struct fcoe_ctlr *); | 163 | void fcoe_ctlr_destroy(struct fcoe_ctlr *); |
156 | void fcoe_ctlr_link_up(struct fcoe_ctlr *); | 164 | void fcoe_ctlr_link_up(struct fcoe_ctlr *); |
157 | int fcoe_ctlr_link_down(struct fcoe_ctlr *); | 165 | int fcoe_ctlr_link_down(struct fcoe_ctlr *); |
158 | int fcoe_ctlr_els_send(struct fcoe_ctlr *, struct sk_buff *); | 166 | int fcoe_ctlr_els_send(struct fcoe_ctlr *, struct fc_lport *, struct sk_buff *); |
159 | void fcoe_ctlr_recv(struct fcoe_ctlr *, struct sk_buff *); | 167 | void fcoe_ctlr_recv(struct fcoe_ctlr *, struct sk_buff *); |
160 | int fcoe_ctlr_recv_flogi(struct fcoe_ctlr *, struct fc_frame *fp, u8 *sa); | 168 | int fcoe_ctlr_recv_flogi(struct fcoe_ctlr *, struct fc_lport *, |
169 | struct fc_frame *); | ||
161 | 170 | ||
162 | /* libfcoe funcs */ | 171 | /* libfcoe funcs */ |
163 | u64 fcoe_wwn_from_mac(unsigned char mac[], unsigned int, unsigned int); | 172 | u64 fcoe_wwn_from_mac(unsigned char mac[], unsigned int, unsigned int); |
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h index a72edd4eceec..7394e3bc8f4b 100644 --- a/include/scsi/libiscsi.h +++ b/include/scsi/libiscsi.h | |||
@@ -267,6 +267,7 @@ struct iscsi_session { | |||
267 | /* configuration */ | 267 | /* configuration */ |
268 | int abort_timeout; | 268 | int abort_timeout; |
269 | int lu_reset_timeout; | 269 | int lu_reset_timeout; |
270 | int tgt_reset_timeout; | ||
270 | int initial_r2t_en; | 271 | int initial_r2t_en; |
271 | unsigned max_r2t; | 272 | unsigned max_r2t; |
272 | int imm_data_en; | 273 | int imm_data_en; |
@@ -333,7 +334,8 @@ struct iscsi_host { | |||
333 | /* | 334 | /* |
334 | * scsi host template | 335 | * scsi host template |
335 | */ | 336 | */ |
336 | extern int iscsi_change_queue_depth(struct scsi_device *sdev, int depth); | 337 | extern int iscsi_change_queue_depth(struct scsi_device *sdev, int depth, |
338 | int reason); | ||
337 | extern int iscsi_eh_abort(struct scsi_cmnd *sc); | 339 | extern int iscsi_eh_abort(struct scsi_cmnd *sc); |
338 | extern int iscsi_eh_target_reset(struct scsi_cmnd *sc); | 340 | extern int iscsi_eh_target_reset(struct scsi_cmnd *sc); |
339 | extern int iscsi_eh_device_reset(struct scsi_cmnd *sc); | 341 | extern int iscsi_eh_device_reset(struct scsi_cmnd *sc); |
diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index e78d3b62d8ec..9eaa3f05f954 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h | |||
@@ -634,7 +634,8 @@ extern int sas_target_alloc(struct scsi_target *); | |||
634 | extern int sas_slave_alloc(struct scsi_device *); | 634 | extern int sas_slave_alloc(struct scsi_device *); |
635 | extern int sas_slave_configure(struct scsi_device *); | 635 | extern int sas_slave_configure(struct scsi_device *); |
636 | extern void sas_slave_destroy(struct scsi_device *); | 636 | extern void sas_slave_destroy(struct scsi_device *); |
637 | extern int sas_change_queue_depth(struct scsi_device *, int new_depth); | 637 | extern int sas_change_queue_depth(struct scsi_device *, int new_depth, |
638 | int reason); | ||
638 | extern int sas_change_queue_type(struct scsi_device *, int qt); | 639 | extern int sas_change_queue_type(struct scsi_device *, int qt); |
639 | extern int sas_bios_param(struct scsi_device *, | 640 | extern int sas_bios_param(struct scsi_device *, |
640 | struct block_device *, | 641 | struct block_device *, |
diff --git a/include/scsi/osd_initiator.h b/include/scsi/osd_initiator.h index 02bd9f716357..39d6d1097153 100644 --- a/include/scsi/osd_initiator.h +++ b/include/scsi/osd_initiator.h | |||
@@ -48,7 +48,6 @@ enum osd_std_version { | |||
48 | */ | 48 | */ |
49 | struct osd_dev { | 49 | struct osd_dev { |
50 | struct scsi_device *scsi_device; | 50 | struct scsi_device *scsi_device; |
51 | struct file *file; | ||
52 | unsigned def_timeout; | 51 | unsigned def_timeout; |
53 | 52 | ||
54 | #ifdef OSD_VER1_SUPPORT | 53 | #ifdef OSD_VER1_SUPPORT |
@@ -56,10 +55,24 @@ struct osd_dev { | |||
56 | #endif | 55 | #endif |
57 | }; | 56 | }; |
58 | 57 | ||
59 | /* Retrieve/return osd_dev(s) for use by Kernel clients */ | 58 | /* Unique Identification of an OSD device */ |
60 | struct osd_dev *osduld_path_lookup(const char *dev_name); /*Use IS_ERR/ERR_PTR*/ | 59 | struct osd_dev_info { |
60 | unsigned systemid_len; | ||
61 | u8 systemid[OSD_SYSTEMID_LEN]; | ||
62 | unsigned osdname_len; | ||
63 | u8 *osdname; | ||
64 | }; | ||
65 | |||
66 | /* Retrieve/return osd_dev(s) for use by Kernel clients | ||
67 | * Use IS_ERR/ERR_PTR on returned "osd_dev *". | ||
68 | */ | ||
69 | struct osd_dev *osduld_path_lookup(const char *dev_name); | ||
70 | struct osd_dev *osduld_info_lookup(const struct osd_dev_info *odi); | ||
61 | void osduld_put_device(struct osd_dev *od); | 71 | void osduld_put_device(struct osd_dev *od); |
62 | 72 | ||
73 | const struct osd_dev_info *osduld_device_info(struct osd_dev *od); | ||
74 | bool osduld_device_same(struct osd_dev *od, const struct osd_dev_info *odi); | ||
75 | |||
63 | /* Add/remove test ioctls from external modules */ | 76 | /* Add/remove test ioctls from external modules */ |
64 | typedef int (do_test_fn)(struct osd_dev *od, unsigned cmd, unsigned long arg); | 77 | typedef int (do_test_fn)(struct osd_dev *od, unsigned cmd, unsigned long arg); |
65 | int osduld_register_test(unsigned ioctl, do_test_fn *do_test); | 78 | int osduld_register_test(unsigned ioctl, do_test_fn *do_test); |
@@ -69,8 +82,24 @@ void osduld_unregister_test(unsigned ioctl); | |||
69 | void osd_dev_init(struct osd_dev *od, struct scsi_device *scsi_device); | 82 | void osd_dev_init(struct osd_dev *od, struct scsi_device *scsi_device); |
70 | void osd_dev_fini(struct osd_dev *od); | 83 | void osd_dev_fini(struct osd_dev *od); |
71 | 84 | ||
72 | /* some hi level device operations */ | 85 | /** |
73 | int osd_auto_detect_ver(struct osd_dev *od, void *caps); /* GFP_KERNEL */ | 86 | * osd_auto_detect_ver - Detect the OSD version, return Unique Identification |
87 | * | ||
88 | * @od: OSD target lun handle | ||
89 | * @caps: Capabilities authorizing OSD root read attributes access | ||
90 | * @odi: Retrieved information uniquely identifying the osd target lun | ||
91 | * Note: odi->osdname must be kfreed by caller. | ||
92 | * | ||
93 | * Auto detects the OSD version of the OSD target and sets the @od | ||
94 | * accordingly. Meanwhile also returns the "system id" and "osd name" root | ||
95 | * attributes which uniquely identify the OSD target. This member is usually | ||
96 | * called by the ULD. ULD users should call osduld_device_info(). | ||
97 | * This rutine allocates osd requests and memory at GFP_KERNEL level and might | ||
98 | * sleep. | ||
99 | */ | ||
100 | int osd_auto_detect_ver(struct osd_dev *od, | ||
101 | void *caps, struct osd_dev_info *odi); | ||
102 | |||
74 | static inline struct request_queue *osd_request_queue(struct osd_dev *od) | 103 | static inline struct request_queue *osd_request_queue(struct osd_dev *od) |
75 | { | 104 | { |
76 | return od->scsi_device->request_queue; | 105 | return od->scsi_device->request_queue; |
@@ -84,6 +113,15 @@ static inline void osd_dev_set_ver(struct osd_dev *od, enum osd_std_version v) | |||
84 | #endif | 113 | #endif |
85 | } | 114 | } |
86 | 115 | ||
116 | static inline bool osd_dev_is_ver1(struct osd_dev *od) | ||
117 | { | ||
118 | #ifdef OSD_VER1_SUPPORT | ||
119 | return od->version == OSD_VER1; | ||
120 | #else | ||
121 | return false; | ||
122 | #endif | ||
123 | } | ||
124 | |||
87 | struct osd_request; | 125 | struct osd_request; |
88 | typedef void (osd_req_done_fn)(struct osd_request *or, void *private); | 126 | typedef void (osd_req_done_fn)(struct osd_request *or, void *private); |
89 | 127 | ||
@@ -120,14 +158,9 @@ struct osd_request { | |||
120 | int async_error; | 158 | int async_error; |
121 | }; | 159 | }; |
122 | 160 | ||
123 | /* OSD Version control */ | ||
124 | static inline bool osd_req_is_ver1(struct osd_request *or) | 161 | static inline bool osd_req_is_ver1(struct osd_request *or) |
125 | { | 162 | { |
126 | #ifdef OSD_VER1_SUPPORT | 163 | return osd_dev_is_ver1(or->osd_dev); |
127 | return or->osd_dev->version == OSD_VER1; | ||
128 | #else | ||
129 | return false; | ||
130 | #endif | ||
131 | } | 164 | } |
132 | 165 | ||
133 | /* | 166 | /* |
@@ -234,7 +267,7 @@ int osd_execute_request_async(struct osd_request *or, | |||
234 | * @bad_attr_list - List of failing attributes (optional) | 267 | * @bad_attr_list - List of failing attributes (optional) |
235 | * @max_attr - Size of @bad_attr_list. | 268 | * @max_attr - Size of @bad_attr_list. |
236 | * | 269 | * |
237 | * After execution, sense + return code can be analyzed using this function. The | 270 | * After execution, osd_request results are analyzed using this function. The |
238 | * return code is the final disposition on the error. So it is possible that a | 271 | * return code is the final disposition on the error. So it is possible that a |
239 | * CHECK_CONDITION was returned from target but this will return NO_ERROR, for | 272 | * CHECK_CONDITION was returned from target but this will return NO_ERROR, for |
240 | * example on recovered errors. All parameters are optional if caller does | 273 | * example on recovered errors. All parameters are optional if caller does |
@@ -243,7 +276,31 @@ int osd_execute_request_async(struct osd_request *or, | |||
243 | * of the SCSI_OSD_DPRINT_SENSE Kconfig value. Set @silent if you know the | 276 | * of the SCSI_OSD_DPRINT_SENSE Kconfig value. Set @silent if you know the |
244 | * command would routinely fail, to not spam the dmsg file. | 277 | * command would routinely fail, to not spam the dmsg file. |
245 | */ | 278 | */ |
279 | |||
280 | /** | ||
281 | * osd_err_priority - osd categorized return codes in ascending severity. | ||
282 | * | ||
283 | * The categories are borrowed from the pnfs_osd_errno enum. | ||
284 | * See comments for translated Linux codes returned by osd_req_decode_sense. | ||
285 | */ | ||
286 | enum osd_err_priority { | ||
287 | OSD_ERR_PRI_NO_ERROR = 0, | ||
288 | /* Recoverable, caller should clear_highpage() all pages */ | ||
289 | OSD_ERR_PRI_CLEAR_PAGES = 1, /* -EFAULT */ | ||
290 | OSD_ERR_PRI_RESOURCE = 2, /* -ENOMEM */ | ||
291 | OSD_ERR_PRI_BAD_CRED = 3, /* -EINVAL */ | ||
292 | OSD_ERR_PRI_NO_ACCESS = 4, /* -EACCES */ | ||
293 | OSD_ERR_PRI_UNREACHABLE = 5, /* any other */ | ||
294 | OSD_ERR_PRI_NOT_FOUND = 6, /* -ENOENT */ | ||
295 | OSD_ERR_PRI_NO_SPACE = 7, /* -ENOSPC */ | ||
296 | OSD_ERR_PRI_EIO = 8, /* -EIO */ | ||
297 | }; | ||
298 | |||
246 | struct osd_sense_info { | 299 | struct osd_sense_info { |
300 | u64 out_resid; /* Zero on success otherwise out residual */ | ||
301 | u64 in_resid; /* Zero on success otherwise in residual */ | ||
302 | enum osd_err_priority osd_err_pri; | ||
303 | |||
247 | int key; /* one of enum scsi_sense_keys */ | 304 | int key; /* one of enum scsi_sense_keys */ |
248 | int additional_code ; /* enum osd_additional_sense_codes */ | 305 | int additional_code ; /* enum osd_additional_sense_codes */ |
249 | union { /* Sense specific information */ | 306 | union { /* Sense specific information */ |
diff --git a/include/scsi/osd_protocol.h b/include/scsi/osd_protocol.h index 2cc8e8b1cc19..685661283540 100644 --- a/include/scsi/osd_protocol.h +++ b/include/scsi/osd_protocol.h | |||
@@ -17,6 +17,7 @@ | |||
17 | #define __OSD_PROTOCOL_H__ | 17 | #define __OSD_PROTOCOL_H__ |
18 | 18 | ||
19 | #include <linux/types.h> | 19 | #include <linux/types.h> |
20 | #include <linux/kernel.h> | ||
20 | #include <asm/unaligned.h> | 21 | #include <asm/unaligned.h> |
21 | #include <scsi/scsi.h> | 22 | #include <scsi/scsi.h> |
22 | 23 | ||
diff --git a/include/scsi/osd_sense.h b/include/scsi/osd_sense.h index ff9b33c773c7..91db543a5502 100644 --- a/include/scsi/osd_sense.h +++ b/include/scsi/osd_sense.h | |||
@@ -255,6 +255,9 @@ enum osdv2_cdb_field_offset { | |||
255 | OSD_CFO_STARTING_BYTE = OSD_CDB_OFFSET(v2.start_address), | 255 | OSD_CFO_STARTING_BYTE = OSD_CDB_OFFSET(v2.start_address), |
256 | OSD_CFO_PARTITION_ID = OSD_CDB_OFFSET(partition), | 256 | OSD_CFO_PARTITION_ID = OSD_CDB_OFFSET(partition), |
257 | OSD_CFO_OBJECT_ID = OSD_CDB_OFFSET(object), | 257 | OSD_CFO_OBJECT_ID = OSD_CDB_OFFSET(object), |
258 | OSD_CFO_PERMISSIONS = sizeof(struct osd_cdb_head) + | ||
259 | offsetof(struct osd_capability_head, | ||
260 | permissions_bit_mask), | ||
258 | }; | 261 | }; |
259 | 262 | ||
260 | #endif /* ndef __OSD_SENSE_H__ */ | 263 | #endif /* ndef __OSD_SENSE_H__ */ |
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h index 34c46ab5c31b..8b4deca996ad 100644 --- a/include/scsi/scsi.h +++ b/include/scsi/scsi.h | |||
@@ -94,6 +94,7 @@ struct scsi_cmnd; | |||
94 | #define WRITE_LONG 0x3f | 94 | #define WRITE_LONG 0x3f |
95 | #define CHANGE_DEFINITION 0x40 | 95 | #define CHANGE_DEFINITION 0x40 |
96 | #define WRITE_SAME 0x41 | 96 | #define WRITE_SAME 0x41 |
97 | #define UNMAP 0x42 | ||
97 | #define READ_TOC 0x43 | 98 | #define READ_TOC 0x43 |
98 | #define LOG_SELECT 0x4c | 99 | #define LOG_SELECT 0x4c |
99 | #define LOG_SENSE 0x4d | 100 | #define LOG_SENSE 0x4d |
@@ -122,9 +123,11 @@ struct scsi_cmnd; | |||
122 | #define READ_16 0x88 | 123 | #define READ_16 0x88 |
123 | #define WRITE_16 0x8a | 124 | #define WRITE_16 0x8a |
124 | #define VERIFY_16 0x8f | 125 | #define VERIFY_16 0x8f |
126 | #define WRITE_SAME_16 0x93 | ||
125 | #define SERVICE_ACTION_IN 0x9e | 127 | #define SERVICE_ACTION_IN 0x9e |
126 | /* values for service action in */ | 128 | /* values for service action in */ |
127 | #define SAI_READ_CAPACITY_16 0x10 | 129 | #define SAI_READ_CAPACITY_16 0x10 |
130 | #define SAI_GET_LBA_STATUS 0x12 | ||
128 | /* values for maintenance in */ | 131 | /* values for maintenance in */ |
129 | #define MI_REPORT_TARGET_PGS 0x0a | 132 | #define MI_REPORT_TARGET_PGS 0x0a |
130 | /* values for maintenance out */ | 133 | /* values for maintenance out */ |
@@ -132,6 +135,7 @@ struct scsi_cmnd; | |||
132 | /* values for variable length command */ | 135 | /* values for variable length command */ |
133 | #define READ_32 0x09 | 136 | #define READ_32 0x09 |
134 | #define WRITE_32 0x0b | 137 | #define WRITE_32 0x0b |
138 | #define WRITE_SAME_32 0x0d | ||
135 | 139 | ||
136 | /* Values for T10/04-262r7 */ | 140 | /* Values for T10/04-262r7 */ |
137 | #define ATA_16 0x85 /* 16-byte pass-thru */ | 141 | #define ATA_16 0x85 /* 16-byte pass-thru */ |
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h index f097ae340bc1..7c4449900c24 100644 --- a/include/scsi/scsi_device.h +++ b/include/scsi/scsi_device.h | |||
@@ -81,11 +81,14 @@ struct scsi_device { | |||
81 | struct list_head starved_entry; | 81 | struct list_head starved_entry; |
82 | struct scsi_cmnd *current_cmnd; /* currently active command */ | 82 | struct scsi_cmnd *current_cmnd; /* currently active command */ |
83 | unsigned short queue_depth; /* How deep of a queue we want */ | 83 | unsigned short queue_depth; /* How deep of a queue we want */ |
84 | unsigned short max_queue_depth; /* max queue depth */ | ||
84 | unsigned short last_queue_full_depth; /* These two are used by */ | 85 | unsigned short last_queue_full_depth; /* These two are used by */ |
85 | unsigned short last_queue_full_count; /* scsi_track_queue_full() */ | 86 | unsigned short last_queue_full_count; /* scsi_track_queue_full() */ |
86 | unsigned long last_queue_full_time;/* don't let QUEUE_FULLs on the same | 87 | unsigned long last_queue_full_time; /* last queue full time */ |
87 | jiffie count on our counter, they | 88 | unsigned long queue_ramp_up_period; /* ramp up period in jiffies */ |
88 | could all be from the same event. */ | 89 | #define SCSI_DEFAULT_RAMP_UP_PERIOD (120 * HZ) |
90 | |||
91 | unsigned long last_queue_ramp_up; /* last queue ramp up time */ | ||
89 | 92 | ||
90 | unsigned int id, lun, channel; | 93 | unsigned int id, lun, channel; |
91 | 94 | ||
@@ -175,6 +178,7 @@ struct scsi_dh_devlist { | |||
175 | char *model; | 178 | char *model; |
176 | }; | 179 | }; |
177 | 180 | ||
181 | typedef void (*activate_complete)(void *, int); | ||
178 | struct scsi_device_handler { | 182 | struct scsi_device_handler { |
179 | /* Used by the infrastructure */ | 183 | /* Used by the infrastructure */ |
180 | struct list_head list; /* list of scsi_device_handlers */ | 184 | struct list_head list; /* list of scsi_device_handlers */ |
@@ -186,7 +190,7 @@ struct scsi_device_handler { | |||
186 | int (*check_sense)(struct scsi_device *, struct scsi_sense_hdr *); | 190 | int (*check_sense)(struct scsi_device *, struct scsi_sense_hdr *); |
187 | int (*attach)(struct scsi_device *); | 191 | int (*attach)(struct scsi_device *); |
188 | void (*detach)(struct scsi_device *); | 192 | void (*detach)(struct scsi_device *); |
189 | int (*activate)(struct scsi_device *); | 193 | int (*activate)(struct scsi_device *, activate_complete, void *); |
190 | int (*prep_fn)(struct scsi_device *, struct request *); | 194 | int (*prep_fn)(struct scsi_device *, struct request *); |
191 | int (*set_params)(struct scsi_device *, const char *); | 195 | int (*set_params)(struct scsi_device *, const char *); |
192 | }; | 196 | }; |
diff --git a/include/scsi/scsi_dh.h b/include/scsi/scsi_dh.h index ff2407405b42..e3f2db212ddc 100644 --- a/include/scsi/scsi_dh.h +++ b/include/scsi/scsi_dh.h | |||
@@ -56,14 +56,16 @@ enum { | |||
56 | SCSI_DH_DRIVER_MAX, | 56 | SCSI_DH_DRIVER_MAX, |
57 | }; | 57 | }; |
58 | #if defined(CONFIG_SCSI_DH) || defined(CONFIG_SCSI_DH_MODULE) | 58 | #if defined(CONFIG_SCSI_DH) || defined(CONFIG_SCSI_DH_MODULE) |
59 | extern int scsi_dh_activate(struct request_queue *); | 59 | extern int scsi_dh_activate(struct request_queue *, activate_complete, void *); |
60 | extern int scsi_dh_handler_exist(const char *); | 60 | extern int scsi_dh_handler_exist(const char *); |
61 | extern int scsi_dh_attach(struct request_queue *, const char *); | 61 | extern int scsi_dh_attach(struct request_queue *, const char *); |
62 | extern void scsi_dh_detach(struct request_queue *); | 62 | extern void scsi_dh_detach(struct request_queue *); |
63 | extern int scsi_dh_set_params(struct request_queue *, const char *); | 63 | extern int scsi_dh_set_params(struct request_queue *, const char *); |
64 | #else | 64 | #else |
65 | static inline int scsi_dh_activate(struct request_queue *req) | 65 | static inline int scsi_dh_activate(struct request_queue *req, |
66 | activate_complete fn, void *data) | ||
66 | { | 67 | { |
68 | fn(data, 0); | ||
67 | return 0; | 69 | return 0; |
68 | } | 70 | } |
69 | static inline int scsi_dh_handler_exist(const char *name) | 71 | static inline int scsi_dh_handler_exist(const char *name) |
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index 47941fc5aba7..c50a97fc76f9 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h | |||
@@ -43,6 +43,12 @@ struct blk_queue_tags; | |||
43 | #define DISABLE_CLUSTERING 0 | 43 | #define DISABLE_CLUSTERING 0 |
44 | #define ENABLE_CLUSTERING 1 | 44 | #define ENABLE_CLUSTERING 1 |
45 | 45 | ||
46 | enum { | ||
47 | SCSI_QDEPTH_DEFAULT, /* default requested change, e.g. from sysfs */ | ||
48 | SCSI_QDEPTH_QFULL, /* scsi-ml requested due to queue full */ | ||
49 | SCSI_QDEPTH_RAMP_UP, /* scsi-ml requested due to threshhold event */ | ||
50 | }; | ||
51 | |||
46 | struct scsi_host_template { | 52 | struct scsi_host_template { |
47 | struct module *module; | 53 | struct module *module; |
48 | const char *name; | 54 | const char *name; |
@@ -294,7 +300,7 @@ struct scsi_host_template { | |||
294 | * | 300 | * |
295 | * Status: OPTIONAL | 301 | * Status: OPTIONAL |
296 | */ | 302 | */ |
297 | int (* change_queue_depth)(struct scsi_device *, int); | 303 | int (* change_queue_depth)(struct scsi_device *, int, int); |
298 | 304 | ||
299 | /* | 305 | /* |
300 | * Fill in this function to allow the changing of tag types | 306 | * Fill in this function to allow the changing of tag types |
@@ -677,6 +683,12 @@ struct Scsi_Host { | |||
677 | void *shost_data; | 683 | void *shost_data; |
678 | 684 | ||
679 | /* | 685 | /* |
686 | * Points to the physical bus device we'd use to do DMA | ||
687 | * Needed just in case we have virtual hosts. | ||
688 | */ | ||
689 | struct device *dma_dev; | ||
690 | |||
691 | /* | ||
680 | * We should ensure that this is aligned, both for better performance | 692 | * We should ensure that this is aligned, both for better performance |
681 | * and also because some compilers (m68k) don't automatically force | 693 | * and also because some compilers (m68k) don't automatically force |
682 | * alignment to a long boundary. | 694 | * alignment to a long boundary. |
@@ -720,7 +732,9 @@ extern int scsi_queue_work(struct Scsi_Host *, struct work_struct *); | |||
720 | extern void scsi_flush_work(struct Scsi_Host *); | 732 | extern void scsi_flush_work(struct Scsi_Host *); |
721 | 733 | ||
722 | extern struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *, int); | 734 | extern struct Scsi_Host *scsi_host_alloc(struct scsi_host_template *, int); |
723 | extern int __must_check scsi_add_host(struct Scsi_Host *, struct device *); | 735 | extern int __must_check scsi_add_host_with_dma(struct Scsi_Host *, |
736 | struct device *, | ||
737 | struct device *); | ||
724 | extern void scsi_scan_host(struct Scsi_Host *); | 738 | extern void scsi_scan_host(struct Scsi_Host *); |
725 | extern void scsi_rescan_device(struct device *); | 739 | extern void scsi_rescan_device(struct device *); |
726 | extern void scsi_remove_host(struct Scsi_Host *); | 740 | extern void scsi_remove_host(struct Scsi_Host *); |
@@ -731,6 +745,12 @@ extern const char *scsi_host_state_name(enum scsi_host_state); | |||
731 | 745 | ||
732 | extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *); | 746 | extern u64 scsi_calculate_bounce_limit(struct Scsi_Host *); |
733 | 747 | ||
748 | static inline int __must_check scsi_add_host(struct Scsi_Host *host, | ||
749 | struct device *dev) | ||
750 | { | ||
751 | return scsi_add_host_with_dma(host, dev, dev); | ||
752 | } | ||
753 | |||
734 | static inline struct device *scsi_get_device(struct Scsi_Host *shost) | 754 | static inline struct device *scsi_get_device(struct Scsi_Host *shost) |
735 | { | 755 | { |
736 | return shost->shost_gendev.parent; | 756 | return shost->shost_gendev.parent; |
diff --git a/include/scsi/scsi_transport_fc.h b/include/scsi/scsi_transport_fc.h index fc50bd64aa4e..8e86a94faf06 100644 --- a/include/scsi/scsi_transport_fc.h +++ b/include/scsi/scsi_transport_fc.h | |||
@@ -807,5 +807,6 @@ void fc_host_post_vendor_event(struct Scsi_Host *shost, u32 event_number, | |||
807 | struct fc_vport *fc_vport_create(struct Scsi_Host *shost, int channel, | 807 | struct fc_vport *fc_vport_create(struct Scsi_Host *shost, int channel, |
808 | struct fc_vport_identifiers *); | 808 | struct fc_vport_identifiers *); |
809 | int fc_vport_terminate(struct fc_vport *vport); | 809 | int fc_vport_terminate(struct fc_vport *vport); |
810 | void fc_block_scsi_eh(struct scsi_cmnd *cmnd); | ||
810 | 811 | ||
811 | #endif /* SCSI_TRANSPORT_FC_H */ | 812 | #endif /* SCSI_TRANSPORT_FC_H */ |
diff --git a/include/sound/Kbuild b/include/sound/Kbuild index fd054a344324..e9dd9369ecb9 100644 --- a/include/sound/Kbuild +++ b/include/sound/Kbuild | |||
@@ -2,7 +2,6 @@ header-y += asound_fm.h | |||
2 | header-y += hdsp.h | 2 | header-y += hdsp.h |
3 | header-y += hdspm.h | 3 | header-y += hdspm.h |
4 | header-y += sfnt_info.h | 4 | header-y += sfnt_info.h |
5 | header-y += sscape_ioctl.h | ||
6 | 5 | ||
7 | unifdef-y += asequencer.h | 6 | unifdef-y += asequencer.h |
8 | unifdef-y += asound.h | 7 | unifdef-y += asound.h |
diff --git a/include/sound/ac97_codec.h b/include/sound/ac97_codec.h index 3dae3f799b9b..49400459b477 100644 --- a/include/sound/ac97_codec.h +++ b/include/sound/ac97_codec.h | |||
@@ -593,7 +593,7 @@ enum { | |||
593 | 593 | ||
594 | struct ac97_quirk { | 594 | struct ac97_quirk { |
595 | unsigned short subvendor; /* PCI subsystem vendor id */ | 595 | unsigned short subvendor; /* PCI subsystem vendor id */ |
596 | unsigned short subdevice; /* PCI sybsystem device id */ | 596 | unsigned short subdevice; /* PCI subsystem device id */ |
597 | unsigned short mask; /* device id bit mask, 0 = accept all */ | 597 | unsigned short mask; /* device id bit mask, 0 = accept all */ |
598 | unsigned int codec_id; /* codec id (if any), 0 = accept all */ | 598 | unsigned int codec_id; /* codec id (if any), 0 = accept all */ |
599 | const char *name; /* name shown as info */ | 599 | const char *name; /* name shown as info */ |
diff --git a/include/sound/aci.h b/include/sound/aci.h new file mode 100644 index 000000000000..ee639d355ef0 --- /dev/null +++ b/include/sound/aci.h | |||
@@ -0,0 +1,90 @@ | |||
1 | #ifndef _ACI_H_ | ||
2 | #define _ACI_H_ | ||
3 | |||
4 | #define ACI_REG_COMMAND 0 /* write register offset */ | ||
5 | #define ACI_REG_STATUS 1 /* read register offset */ | ||
6 | #define ACI_REG_BUSY 2 /* busy register offset */ | ||
7 | #define ACI_REG_RDS 2 /* PCM20: RDS register offset */ | ||
8 | #define ACI_MINTIME 500 /* ACI time out limit */ | ||
9 | |||
10 | #define ACI_SET_MUTE 0x0d | ||
11 | #define ACI_SET_POWERAMP 0x0f | ||
12 | #define ACI_SET_TUNERMUTE 0xa3 | ||
13 | #define ACI_SET_TUNERMONO 0xa4 | ||
14 | #define ACI_SET_IDE 0xd0 | ||
15 | #define ACI_SET_WSS 0xd1 | ||
16 | #define ACI_SET_SOLOMODE 0xd2 | ||
17 | #define ACI_SET_PREAMP 0x03 | ||
18 | #define ACI_GET_PREAMP 0x21 | ||
19 | #define ACI_WRITE_TUNE 0xa7 | ||
20 | #define ACI_READ_TUNERSTEREO 0xa8 | ||
21 | #define ACI_READ_TUNERSTATION 0xa9 | ||
22 | #define ACI_READ_VERSION 0xf1 | ||
23 | #define ACI_READ_IDCODE 0xf2 | ||
24 | #define ACI_INIT 0xff | ||
25 | #define ACI_STATUS 0xf0 | ||
26 | #define ACI_S_GENERAL 0x00 | ||
27 | #define ACI_ERROR_OP 0xdf | ||
28 | |||
29 | /* ACI Mixer */ | ||
30 | |||
31 | /* These are the values for the right channel GET registers. | ||
32 | Add an offset of 0x01 for the left channel register. | ||
33 | (left=right+0x01) */ | ||
34 | |||
35 | #define ACI_GET_MASTER 0x03 | ||
36 | #define ACI_GET_MIC 0x05 | ||
37 | #define ACI_GET_LINE 0x07 | ||
38 | #define ACI_GET_CD 0x09 | ||
39 | #define ACI_GET_SYNTH 0x0b | ||
40 | #define ACI_GET_PCM 0x0d | ||
41 | #define ACI_GET_LINE1 0x10 /* Radio on PCM20 */ | ||
42 | #define ACI_GET_LINE2 0x12 | ||
43 | |||
44 | #define ACI_GET_EQ1 0x22 /* from Bass ... */ | ||
45 | #define ACI_GET_EQ2 0x24 | ||
46 | #define ACI_GET_EQ3 0x26 | ||
47 | #define ACI_GET_EQ4 0x28 | ||
48 | #define ACI_GET_EQ5 0x2a | ||
49 | #define ACI_GET_EQ6 0x2c | ||
50 | #define ACI_GET_EQ7 0x2e /* ... to Treble */ | ||
51 | |||
52 | /* And these are the values for the right channel SET registers. | ||
53 | For left channel access you have to add an offset of 0x08. | ||
54 | MASTER is an exception, which needs an offset of 0x01 */ | ||
55 | |||
56 | #define ACI_SET_MASTER 0x00 | ||
57 | #define ACI_SET_MIC 0x30 | ||
58 | #define ACI_SET_LINE 0x31 | ||
59 | #define ACI_SET_CD 0x34 | ||
60 | #define ACI_SET_SYNTH 0x33 | ||
61 | #define ACI_SET_PCM 0x32 | ||
62 | #define ACI_SET_LINE1 0x35 /* Radio on PCM20 */ | ||
63 | #define ACI_SET_LINE2 0x36 | ||
64 | |||
65 | #define ACI_SET_EQ1 0x40 /* from Bass ... */ | ||
66 | #define ACI_SET_EQ2 0x41 | ||
67 | #define ACI_SET_EQ3 0x42 | ||
68 | #define ACI_SET_EQ4 0x43 | ||
69 | #define ACI_SET_EQ5 0x44 | ||
70 | #define ACI_SET_EQ6 0x45 | ||
71 | #define ACI_SET_EQ7 0x46 /* ... to Treble */ | ||
72 | |||
73 | struct snd_miro_aci { | ||
74 | unsigned long aci_port; | ||
75 | int aci_vendor; | ||
76 | int aci_product; | ||
77 | int aci_version; | ||
78 | int aci_amp; | ||
79 | int aci_preamp; | ||
80 | int aci_solomode; | ||
81 | |||
82 | struct mutex aci_mutex; | ||
83 | }; | ||
84 | |||
85 | int snd_aci_cmd(struct snd_miro_aci *aci, int write1, int write2, int write3); | ||
86 | |||
87 | struct snd_miro_aci *snd_aci_get_aci(void); | ||
88 | |||
89 | #endif /* _ACI_H_ */ | ||
90 | |||
diff --git a/include/sound/ak4113.h b/include/sound/ak4113.h new file mode 100644 index 000000000000..8988edae1609 --- /dev/null +++ b/include/sound/ak4113.h | |||
@@ -0,0 +1,321 @@ | |||
1 | #ifndef __SOUND_AK4113_H | ||
2 | #define __SOUND_AK4113_H | ||
3 | |||
4 | /* | ||
5 | * Routines for Asahi Kasei AK4113 | ||
6 | * Copyright (c) by Jaroslav Kysela <perex@perex.cz>, | ||
7 | * Copyright (c) by Pavel Hofman <pavel.hofman@ivitera.com>, | ||
8 | * | ||
9 | * | ||
10 | * This program is free software; you can redistribute it and/or modify | ||
11 | * it under the terms of the GNU General Public License as published by | ||
12 | * the Free Software Foundation; either version 2 of the License, or | ||
13 | * (at your option) any later version. | ||
14 | * | ||
15 | * This program is distributed in the hope that it will be useful, | ||
16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
18 | * GNU General Public License for more details. | ||
19 | * | ||
20 | * You should have received a copy of the GNU General Public License | ||
21 | * along with this program; if not, write to the Free Software | ||
22 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
23 | * | ||
24 | */ | ||
25 | |||
26 | /* AK4113 registers */ | ||
27 | /* power down */ | ||
28 | #define AK4113_REG_PWRDN 0x00 | ||
29 | /* format control */ | ||
30 | #define AK4113_REG_FORMAT 0x01 | ||
31 | /* input/output control */ | ||
32 | #define AK4113_REG_IO0 0x02 | ||
33 | /* input/output control */ | ||
34 | #define AK4113_REG_IO1 0x03 | ||
35 | /* interrupt0 mask */ | ||
36 | #define AK4113_REG_INT0_MASK 0x04 | ||
37 | /* interrupt1 mask */ | ||
38 | #define AK4113_REG_INT1_MASK 0x05 | ||
39 | /* DAT mask & DTS select */ | ||
40 | #define AK4113_REG_DATDTS 0x06 | ||
41 | /* receiver status 0 */ | ||
42 | #define AK4113_REG_RCS0 0x07 | ||
43 | /* receiver status 1 */ | ||
44 | #define AK4113_REG_RCS1 0x08 | ||
45 | /* receiver status 2 */ | ||
46 | #define AK4113_REG_RCS2 0x09 | ||
47 | /* RX channel status byte 0 */ | ||
48 | #define AK4113_REG_RXCSB0 0x0a | ||
49 | /* RX channel status byte 1 */ | ||
50 | #define AK4113_REG_RXCSB1 0x0b | ||
51 | /* RX channel status byte 2 */ | ||
52 | #define AK4113_REG_RXCSB2 0x0c | ||
53 | /* RX channel status byte 3 */ | ||
54 | #define AK4113_REG_RXCSB3 0x0d | ||
55 | /* RX channel status byte 4 */ | ||
56 | #define AK4113_REG_RXCSB4 0x0e | ||
57 | /* burst preamble Pc byte 0 */ | ||
58 | #define AK4113_REG_Pc0 0x0f | ||
59 | /* burst preamble Pc byte 1 */ | ||
60 | #define AK4113_REG_Pc1 0x10 | ||
61 | /* burst preamble Pd byte 0 */ | ||
62 | #define AK4113_REG_Pd0 0x11 | ||
63 | /* burst preamble Pd byte 1 */ | ||
64 | #define AK4113_REG_Pd1 0x12 | ||
65 | /* Q-subcode address + control */ | ||
66 | #define AK4113_REG_QSUB_ADDR 0x13 | ||
67 | /* Q-subcode track */ | ||
68 | #define AK4113_REG_QSUB_TRACK 0x14 | ||
69 | /* Q-subcode index */ | ||
70 | #define AK4113_REG_QSUB_INDEX 0x15 | ||
71 | /* Q-subcode minute */ | ||
72 | #define AK4113_REG_QSUB_MINUTE 0x16 | ||
73 | /* Q-subcode second */ | ||
74 | #define AK4113_REG_QSUB_SECOND 0x17 | ||
75 | /* Q-subcode frame */ | ||
76 | #define AK4113_REG_QSUB_FRAME 0x18 | ||
77 | /* Q-subcode zero */ | ||
78 | #define AK4113_REG_QSUB_ZERO 0x19 | ||
79 | /* Q-subcode absolute minute */ | ||
80 | #define AK4113_REG_QSUB_ABSMIN 0x1a | ||
81 | /* Q-subcode absolute second */ | ||
82 | #define AK4113_REG_QSUB_ABSSEC 0x1b | ||
83 | /* Q-subcode absolute frame */ | ||
84 | #define AK4113_REG_QSUB_ABSFRM 0x1c | ||
85 | |||
86 | /* sizes */ | ||
87 | #define AK4113_REG_RXCSB_SIZE ((AK4113_REG_RXCSB4-AK4113_REG_RXCSB0)+1) | ||
88 | #define AK4113_REG_QSUB_SIZE ((AK4113_REG_QSUB_ABSFRM-AK4113_REG_QSUB_ADDR)\ | ||
89 | +1) | ||
90 | |||
91 | #define AK4113_WRITABLE_REGS (AK4113_REG_DATDTS + 1) | ||
92 | |||
93 | /* AK4113_REG_PWRDN bits */ | ||
94 | /* Channel Status Select */ | ||
95 | #define AK4113_CS12 (1<<7) | ||
96 | /* Block Start & C/U Output Mode */ | ||
97 | #define AK4113_BCU (1<<6) | ||
98 | /* Master Clock Operation Select */ | ||
99 | #define AK4113_CM1 (1<<5) | ||
100 | /* Master Clock Operation Select */ | ||
101 | #define AK4113_CM0 (1<<4) | ||
102 | /* Master Clock Frequency Select */ | ||
103 | #define AK4113_OCKS1 (1<<3) | ||
104 | /* Master Clock Frequency Select */ | ||
105 | #define AK4113_OCKS0 (1<<2) | ||
106 | /* 0 = power down, 1 = normal operation */ | ||
107 | #define AK4113_PWN (1<<1) | ||
108 | /* 0 = reset & initialize (except thisregister), 1 = normal operation */ | ||
109 | #define AK4113_RST (1<<0) | ||
110 | |||
111 | /* AK4113_REQ_FORMAT bits */ | ||
112 | /* V/TX Output select: 0 = Validity Flag Output, 1 = TX */ | ||
113 | #define AK4113_VTX (1<<7) | ||
114 | /* Audio Data Control */ | ||
115 | #define AK4113_DIF2 (1<<6) | ||
116 | /* Audio Data Control */ | ||
117 | #define AK4113_DIF1 (1<<5) | ||
118 | /* Audio Data Control */ | ||
119 | #define AK4113_DIF0 (1<<4) | ||
120 | /* Deemphasis Autodetect Enable (1 = enable) */ | ||
121 | #define AK4113_DEAU (1<<3) | ||
122 | /* 32kHz-48kHz Deemphasis Control */ | ||
123 | #define AK4113_DEM1 (1<<2) | ||
124 | /* 32kHz-48kHz Deemphasis Control */ | ||
125 | #define AK4113_DEM0 (1<<1) | ||
126 | #define AK4113_DEM_OFF (AK4113_DEM0) | ||
127 | #define AK4113_DEM_44KHZ (0) | ||
128 | #define AK4113_DEM_48KHZ (AK4113_DEM1) | ||
129 | #define AK4113_DEM_32KHZ (AK4113_DEM0|AK4113_DEM1) | ||
130 | /* STDO: 16-bit, right justified */ | ||
131 | #define AK4113_DIF_16R (0) | ||
132 | /* STDO: 18-bit, right justified */ | ||
133 | #define AK4113_DIF_18R (AK4113_DIF0) | ||
134 | /* STDO: 20-bit, right justified */ | ||
135 | #define AK4113_DIF_20R (AK4113_DIF1) | ||
136 | /* STDO: 24-bit, right justified */ | ||
137 | #define AK4113_DIF_24R (AK4113_DIF1|AK4113_DIF0) | ||
138 | /* STDO: 24-bit, left justified */ | ||
139 | #define AK4113_DIF_24L (AK4113_DIF2) | ||
140 | /* STDO: I2S */ | ||
141 | #define AK4113_DIF_24I2S (AK4113_DIF2|AK4113_DIF0) | ||
142 | /* STDO: 24-bit, left justified; LRCLK, BICK = Input */ | ||
143 | #define AK4113_DIF_I24L (AK4113_DIF2|AK4113_DIF1) | ||
144 | /* STDO: I2S; LRCLK, BICK = Input */ | ||
145 | #define AK4113_DIF_I24I2S (AK4113_DIF2|AK4113_DIF1|AK4113_DIF0) | ||
146 | |||
147 | /* AK4113_REG_IO0 */ | ||
148 | /* XTL1=0,XTL0=0 -> 11.2896Mhz; XTL1=0,XTL0=1 -> 12.288Mhz */ | ||
149 | #define AK4113_XTL1 (1<<6) | ||
150 | /* XTL1=1,XTL0=0 -> 24.576Mhz; XTL1=1,XTL0=1 -> use channel status */ | ||
151 | #define AK4113_XTL0 (1<<5) | ||
152 | /* Block Start Signal Output: 0 = U-bit, 1 = C-bit (req. BCU = 1) */ | ||
153 | #define AK4113_UCE (1<<4) | ||
154 | /* TX Output Enable (1 = enable) */ | ||
155 | #define AK4113_TXE (1<<3) | ||
156 | /* Output Through Data Selector for TX pin */ | ||
157 | #define AK4113_OPS2 (1<<2) | ||
158 | /* Output Through Data Selector for TX pin */ | ||
159 | #define AK4113_OPS1 (1<<1) | ||
160 | /* Output Through Data Selector for TX pin */ | ||
161 | #define AK4113_OPS0 (1<<0) | ||
162 | /* 11.2896 MHz ref. Xtal freq. */ | ||
163 | #define AK4113_XTL_11_2896M (0) | ||
164 | /* 12.288 MHz ref. Xtal freq. */ | ||
165 | #define AK4113_XTL_12_288M (AK4113_XTL0) | ||
166 | /* 24.576 MHz ref. Xtal freq. */ | ||
167 | #define AK4113_XTL_24_576M (AK4113_XTL1) | ||
168 | |||
169 | /* AK4113_REG_IO1 */ | ||
170 | /* Interrupt 0 pin Hold */ | ||
171 | #define AK4113_EFH1 (1<<7) | ||
172 | /* Interrupt 0 pin Hold */ | ||
173 | #define AK4113_EFH0 (1<<6) | ||
174 | #define AK4113_EFH_512LRCLK (0) | ||
175 | #define AK4113_EFH_1024LRCLK (AK4113_EFH0) | ||
176 | #define AK4113_EFH_2048LRCLK (AK4113_EFH1) | ||
177 | #define AK4113_EFH_4096LRCLK (AK4113_EFH1|AK4113_EFH0) | ||
178 | /* PLL Lock Time: 0 = 384/fs, 1 = 1/fs */ | ||
179 | #define AK4113_FAST (1<<5) | ||
180 | /* MCKO2 Output Select: 0 = CMx/OCKSx, 1 = Xtal */ | ||
181 | #define AK4113_XMCK (1<<4) | ||
182 | /* MCKO2 Output Freq. Select: 0 = x1, 1 = x0.5 (req. XMCK = 1) */ | ||
183 | #define AK4113_DIV (1<<3) | ||
184 | /* Input Recovery Data Select */ | ||
185 | #define AK4113_IPS2 (1<<2) | ||
186 | /* Input Recovery Data Select */ | ||
187 | #define AK4113_IPS1 (1<<1) | ||
188 | /* Input Recovery Data Select */ | ||
189 | #define AK4113_IPS0 (1<<0) | ||
190 | #define AK4113_IPS(x) ((x)&7) | ||
191 | |||
192 | /* AK4113_REG_INT0_MASK && AK4113_REG_INT1_MASK*/ | ||
193 | /* mask enable for QINT bit */ | ||
194 | #define AK4113_MQI (1<<7) | ||
195 | /* mask enable for AUTO bit */ | ||
196 | #define AK4113_MAUT (1<<6) | ||
197 | /* mask enable for CINT bit */ | ||
198 | #define AK4113_MCIT (1<<5) | ||
199 | /* mask enable for UNLOCK bit */ | ||
200 | #define AK4113_MULK (1<<4) | ||
201 | /* mask enable for V bit */ | ||
202 | #define AK4113_V (1<<3) | ||
203 | /* mask enable for STC bit */ | ||
204 | #define AK4113_STC (1<<2) | ||
205 | /* mask enable for AUDN bit */ | ||
206 | #define AK4113_MAN (1<<1) | ||
207 | /* mask enable for PAR bit */ | ||
208 | #define AK4113_MPR (1<<0) | ||
209 | |||
210 | /* AK4113_REG_DATDTS */ | ||
211 | /* DAT Start ID Counter */ | ||
212 | #define AK4113_DCNT (1<<4) | ||
213 | /* DTS-CD 16-bit Sync Word Detect */ | ||
214 | #define AK4113_DTS16 (1<<3) | ||
215 | /* DTS-CD 14-bit Sync Word Detect */ | ||
216 | #define AK4113_DTS14 (1<<2) | ||
217 | /* mask enable for DAT bit (if 1, no INT1 effect */ | ||
218 | #define AK4113_MDAT1 (1<<1) | ||
219 | /* mask enable for DAT bit (if 1, no INT0 effect */ | ||
220 | #define AK4113_MDAT0 (1<<0) | ||
221 | |||
222 | /* AK4113_REG_RCS0 */ | ||
223 | /* Q-subcode buffer interrupt, 0 = no change, 1 = changed */ | ||
224 | #define AK4113_QINT (1<<7) | ||
225 | /* Non-PCM or DTS stream auto detection, 0 = no detect, 1 = detect */ | ||
226 | #define AK4113_AUTO (1<<6) | ||
227 | /* channel status buffer interrupt, 0 = no change, 1 = change */ | ||
228 | #define AK4113_CINT (1<<5) | ||
229 | /* PLL lock status, 0 = lock, 1 = unlock */ | ||
230 | #define AK4113_UNLCK (1<<4) | ||
231 | /* Validity bit, 0 = valid, 1 = invalid */ | ||
232 | #define AK4113_V (1<<3) | ||
233 | /* sampling frequency or Pre-emphasis change, 0 = no detect, 1 = detect */ | ||
234 | #define AK4113_STC (1<<2) | ||
235 | /* audio bit output, 0 = audio, 1 = non-audio */ | ||
236 | #define AK4113_AUDION (1<<1) | ||
237 | /* parity error or biphase error status, 0 = no error, 1 = error */ | ||
238 | #define AK4113_PAR (1<<0) | ||
239 | |||
240 | /* AK4113_REG_RCS1 */ | ||
241 | /* sampling frequency detection */ | ||
242 | #define AK4113_FS3 (1<<7) | ||
243 | #define AK4113_FS2 (1<<6) | ||
244 | #define AK4113_FS1 (1<<5) | ||
245 | #define AK4113_FS0 (1<<4) | ||
246 | /* Pre-emphasis detect, 0 = OFF, 1 = ON */ | ||
247 | #define AK4113_PEM (1<<3) | ||
248 | /* DAT Start ID Detect, 0 = no detect, 1 = detect */ | ||
249 | #define AK4113_DAT (1<<2) | ||
250 | /* DTS-CD bit audio stream detect, 0 = no detect, 1 = detect */ | ||
251 | #define AK4113_DTSCD (1<<1) | ||
252 | /* Non-PCM bit stream detection, 0 = no detect, 1 = detect */ | ||
253 | #define AK4113_NPCM (1<<0) | ||
254 | #define AK4113_FS_8000HZ (AK4113_FS3|AK4113_FS0) | ||
255 | #define AK4113_FS_11025HZ (AK4113_FS2|AK4113_FS0) | ||
256 | #define AK4113_FS_16000HZ (AK4113_FS2|AK4113_FS1|AK4113_FS0) | ||
257 | #define AK4113_FS_22050HZ (AK4113_FS2) | ||
258 | #define AK4113_FS_24000HZ (AK4113_FS2|AK4113_FS1) | ||
259 | #define AK4113_FS_32000HZ (AK4113_FS1|AK4113_FS0) | ||
260 | #define AK4113_FS_44100HZ (0) | ||
261 | #define AK4113_FS_48000HZ (AK4113_FS1) | ||
262 | #define AK4113_FS_64000HZ (AK4113_FS3|AK4113_FS1|AK4113_FS0) | ||
263 | #define AK4113_FS_88200HZ (AK4113_FS3) | ||
264 | #define AK4113_FS_96000HZ (AK4113_FS3|AK4113_FS1) | ||
265 | #define AK4113_FS_176400HZ (AK4113_FS3|AK4113_FS2) | ||
266 | #define AK4113_FS_192000HZ (AK4113_FS3|AK4113_FS2|AK4113_FS1) | ||
267 | |||
268 | /* AK4113_REG_RCS2 */ | ||
269 | /* CRC for Q-subcode, 0 = no error, 1 = error */ | ||
270 | #define AK4113_QCRC (1<<1) | ||
271 | /* CRC for channel status, 0 = no error, 1 = error */ | ||
272 | #define AK4113_CCRC (1<<0) | ||
273 | |||
274 | /* flags for snd_ak4113_check_rate_and_errors() */ | ||
275 | #define AK4113_CHECK_NO_STAT (1<<0) /* no statistics */ | ||
276 | #define AK4113_CHECK_NO_RATE (1<<1) /* no rate check */ | ||
277 | |||
278 | #define AK4113_CONTROLS 13 | ||
279 | |||
280 | typedef void (ak4113_write_t)(void *private_data, unsigned char addr, | ||
281 | unsigned char data); | ||
282 | typedef unsigned char (ak4113_read_t)(void *private_data, unsigned char addr); | ||
283 | |||
284 | struct ak4113 { | ||
285 | struct snd_card *card; | ||
286 | ak4113_write_t *write; | ||
287 | ak4113_read_t *read; | ||
288 | void *private_data; | ||
289 | unsigned int init:1; | ||
290 | spinlock_t lock; | ||
291 | unsigned char regmap[AK4113_WRITABLE_REGS]; | ||
292 | struct snd_kcontrol *kctls[AK4113_CONTROLS]; | ||
293 | struct snd_pcm_substream *substream; | ||
294 | unsigned long parity_errors; | ||
295 | unsigned long v_bit_errors; | ||
296 | unsigned long qcrc_errors; | ||
297 | unsigned long ccrc_errors; | ||
298 | unsigned char rcs0; | ||
299 | unsigned char rcs1; | ||
300 | unsigned char rcs2; | ||
301 | struct delayed_work work; | ||
302 | unsigned int check_flags; | ||
303 | void *change_callback_private; | ||
304 | void (*change_callback)(struct ak4113 *ak4113, unsigned char c0, | ||
305 | unsigned char c1); | ||
306 | }; | ||
307 | |||
308 | int snd_ak4113_create(struct snd_card *card, ak4113_read_t *read, | ||
309 | ak4113_write_t *write, | ||
310 | const unsigned char pgm[AK4113_WRITABLE_REGS], | ||
311 | void *private_data, struct ak4113 **r_ak4113); | ||
312 | void snd_ak4113_reg_write(struct ak4113 *ak4113, unsigned char reg, | ||
313 | unsigned char mask, unsigned char val); | ||
314 | void snd_ak4113_reinit(struct ak4113 *ak4113); | ||
315 | int snd_ak4113_build(struct ak4113 *ak4113, | ||
316 | struct snd_pcm_substream *capture_substream); | ||
317 | int snd_ak4113_external_rate(struct ak4113 *ak4113); | ||
318 | int snd_ak4113_check_rate_and_errors(struct ak4113 *ak4113, unsigned int flags); | ||
319 | |||
320 | #endif /* __SOUND_AK4113_H */ | ||
321 | |||
diff --git a/include/sound/ak4114.h b/include/sound/ak4114.h index d293d36a66b8..3ce69fd92523 100644 --- a/include/sound/ak4114.h +++ b/include/sound/ak4114.h | |||
@@ -95,13 +95,13 @@ | |||
95 | 95 | ||
96 | /* AK4114_REG_IO0 */ | 96 | /* AK4114_REG_IO0 */ |
97 | #define AK4114_TX1E (1<<7) /* TX1 Output Enable (1 = enable) */ | 97 | #define AK4114_TX1E (1<<7) /* TX1 Output Enable (1 = enable) */ |
98 | #define AK4114_OPS12 (1<<2) /* Output Though Data Selector for TX1 pin */ | 98 | #define AK4114_OPS12 (1<<6) /* Output Data Selector for TX1 pin */ |
99 | #define AK4114_OPS11 (1<<1) /* Output Though Data Selector for TX1 pin */ | 99 | #define AK4114_OPS11 (1<<5) /* Output Data Selector for TX1 pin */ |
100 | #define AK4114_OPS10 (1<<0) /* Output Though Data Selector for TX1 pin */ | 100 | #define AK4114_OPS10 (1<<4) /* Output Data Selector for TX1 pin */ |
101 | #define AK4114_TX0E (1<<3) /* TX0 Output Enable (1 = enable) */ | 101 | #define AK4114_TX0E (1<<3) /* TX0 Output Enable (1 = enable) */ |
102 | #define AK4114_OPS02 (1<<2) /* Output Though Data Selector for TX0 pin */ | 102 | #define AK4114_OPS02 (1<<2) /* Output Data Selector for TX0 pin */ |
103 | #define AK4114_OPS01 (1<<1) /* Output Though Data Selector for TX0 pin */ | 103 | #define AK4114_OPS01 (1<<1) /* Output Data Selector for TX0 pin */ |
104 | #define AK4114_OPS00 (1<<0) /* Output Though Data Selector for TX0 pin */ | 104 | #define AK4114_OPS00 (1<<0) /* Output Data Selector for TX0 pin */ |
105 | 105 | ||
106 | /* AK4114_REG_IO1 */ | 106 | /* AK4114_REG_IO1 */ |
107 | #define AK4114_EFH1 (1<<7) /* Interrupt 0 pin Hold */ | 107 | #define AK4114_EFH1 (1<<7) /* Interrupt 0 pin Hold */ |
diff --git a/include/sound/ak4xxx-adda.h b/include/sound/ak4xxx-adda.h index 891cf1aea8b1..030b87c2f6d4 100644 --- a/include/sound/ak4xxx-adda.h +++ b/include/sound/ak4xxx-adda.h | |||
@@ -68,7 +68,7 @@ struct snd_akm4xxx { | |||
68 | enum { | 68 | enum { |
69 | SND_AK4524, SND_AK4528, SND_AK4529, | 69 | SND_AK4524, SND_AK4528, SND_AK4529, |
70 | SND_AK4355, SND_AK4358, SND_AK4381, | 70 | SND_AK4355, SND_AK4358, SND_AK4381, |
71 | SND_AK5365 | 71 | SND_AK5365, SND_AK4620, |
72 | } type; | 72 | } type; |
73 | 73 | ||
74 | /* (array) information of combined codecs */ | 74 | /* (array) information of combined codecs */ |
@@ -76,6 +76,9 @@ struct snd_akm4xxx { | |||
76 | const struct snd_akm4xxx_adc_channel *adc_info; | 76 | const struct snd_akm4xxx_adc_channel *adc_info; |
77 | 77 | ||
78 | struct snd_ak4xxx_ops ops; | 78 | struct snd_ak4xxx_ops ops; |
79 | unsigned int num_chips; | ||
80 | unsigned int total_regs; | ||
81 | const char *name; | ||
79 | }; | 82 | }; |
80 | 83 | ||
81 | void snd_akm4xxx_write(struct snd_akm4xxx *ak, int chip, unsigned char reg, | 84 | void snd_akm4xxx_write(struct snd_akm4xxx *ak, int chip, unsigned char reg, |
diff --git a/include/sound/control.h b/include/sound/control.h index ef96f07aa03b..112374dc0c58 100644 --- a/include/sound/control.h +++ b/include/sound/control.h | |||
@@ -56,7 +56,6 @@ struct snd_kcontrol_new { | |||
56 | 56 | ||
57 | struct snd_kcontrol_volatile { | 57 | struct snd_kcontrol_volatile { |
58 | struct snd_ctl_file *owner; /* locked */ | 58 | struct snd_ctl_file *owner; /* locked */ |
59 | pid_t owner_pid; | ||
60 | unsigned int access; /* access rights */ | 59 | unsigned int access; /* access rights */ |
61 | }; | 60 | }; |
62 | 61 | ||
@@ -87,10 +86,12 @@ struct snd_kctl_event { | |||
87 | 86 | ||
88 | #define snd_kctl_event(n) list_entry(n, struct snd_kctl_event, list) | 87 | #define snd_kctl_event(n) list_entry(n, struct snd_kctl_event, list) |
89 | 88 | ||
89 | struct pid; | ||
90 | |||
90 | struct snd_ctl_file { | 91 | struct snd_ctl_file { |
91 | struct list_head list; /* list of all control files */ | 92 | struct list_head list; /* list of all control files */ |
92 | struct snd_card *card; | 93 | struct snd_card *card; |
93 | pid_t pid; | 94 | struct pid *pid; |
94 | int prefer_pcm_subdevice; | 95 | int prefer_pcm_subdevice; |
95 | int prefer_rawmidi_subdevice; | 96 | int prefer_rawmidi_subdevice; |
96 | wait_queue_head_t change_sleep; | 97 | wait_queue_head_t change_sleep; |
diff --git a/include/sound/cs4231-regs.h b/include/sound/cs4231-regs.h index 92647532c454..66d28c2cb53d 100644 --- a/include/sound/cs4231-regs.h +++ b/include/sound/cs4231-regs.h | |||
@@ -70,7 +70,6 @@ | |||
70 | #define AD1845_PWR_DOWN 0x1b /* power down control */ | 70 | #define AD1845_PWR_DOWN 0x1b /* power down control */ |
71 | #define CS4235_LEFT_MASTER 0x1b /* left master output control */ | 71 | #define CS4235_LEFT_MASTER 0x1b /* left master output control */ |
72 | #define CS4231_REC_FORMAT 0x1c /* clock and data format - record - bits 7-0 MCE */ | 72 | #define CS4231_REC_FORMAT 0x1c /* clock and data format - record - bits 7-0 MCE */ |
73 | #define CS4231_PLY_VAR_FREQ 0x1d /* playback variable frequency */ | ||
74 | #define AD1845_CLOCK 0x1d /* crystal clock select and total power down */ | 73 | #define AD1845_CLOCK 0x1d /* crystal clock select and total power down */ |
75 | #define CS4235_RIGHT_MASTER 0x1d /* right master output control */ | 74 | #define CS4235_RIGHT_MASTER 0x1d /* right master output control */ |
76 | #define CS4231_REC_UPR_CNT 0x1e /* record upper count */ | 75 | #define CS4231_REC_UPR_CNT 0x1e /* record upper count */ |
diff --git a/include/sound/pcm.h b/include/sound/pcm.h index de6d981de5d6..c83a4a79f16b 100644 --- a/include/sound/pcm.h +++ b/include/sound/pcm.h | |||
@@ -348,6 +348,8 @@ struct snd_pcm_group { /* keep linked substreams */ | |||
348 | int count; | 348 | int count; |
349 | }; | 349 | }; |
350 | 350 | ||
351 | struct pid; | ||
352 | |||
351 | struct snd_pcm_substream { | 353 | struct snd_pcm_substream { |
352 | struct snd_pcm *pcm; | 354 | struct snd_pcm *pcm; |
353 | struct snd_pcm_str *pstr; | 355 | struct snd_pcm_str *pstr; |
@@ -379,6 +381,7 @@ struct snd_pcm_substream { | |||
379 | atomic_t mmap_count; | 381 | atomic_t mmap_count; |
380 | unsigned int f_flags; | 382 | unsigned int f_flags; |
381 | void (*pcm_release)(struct snd_pcm_substream *); | 383 | void (*pcm_release)(struct snd_pcm_substream *); |
384 | struct pid *pid; | ||
382 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) | 385 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) |
383 | /* -- OSS things -- */ | 386 | /* -- OSS things -- */ |
384 | struct snd_pcm_oss_substream oss; | 387 | struct snd_pcm_oss_substream oss; |
diff --git a/include/sound/rawmidi.h b/include/sound/rawmidi.h index c23c26585700..2480e7d10dcf 100644 --- a/include/sound/rawmidi.h +++ b/include/sound/rawmidi.h | |||
@@ -46,6 +46,7 @@ | |||
46 | struct snd_rawmidi; | 46 | struct snd_rawmidi; |
47 | struct snd_rawmidi_substream; | 47 | struct snd_rawmidi_substream; |
48 | struct snd_seq_port_info; | 48 | struct snd_seq_port_info; |
49 | struct pid; | ||
49 | 50 | ||
50 | struct snd_rawmidi_ops { | 51 | struct snd_rawmidi_ops { |
51 | int (*open) (struct snd_rawmidi_substream * substream); | 52 | int (*open) (struct snd_rawmidi_substream * substream); |
@@ -97,6 +98,7 @@ struct snd_rawmidi_substream { | |||
97 | struct snd_rawmidi_str *pstr; | 98 | struct snd_rawmidi_str *pstr; |
98 | char name[32]; | 99 | char name[32]; |
99 | struct snd_rawmidi_runtime *runtime; | 100 | struct snd_rawmidi_runtime *runtime; |
101 | struct pid *pid; | ||
100 | /* hardware layer */ | 102 | /* hardware layer */ |
101 | struct snd_rawmidi_ops *ops; | 103 | struct snd_rawmidi_ops *ops; |
102 | }; | 104 | }; |
diff --git a/include/sound/sh_dac_audio.h b/include/sound/sh_dac_audio.h new file mode 100644 index 000000000000..f5deaf1ddb9f --- /dev/null +++ b/include/sound/sh_dac_audio.h | |||
@@ -0,0 +1,21 @@ | |||
1 | /* | ||
2 | * SH_DAC specific configuration, for the dac_audio platform_device | ||
3 | * | ||
4 | * Copyright (C) 2009 Rafael Ignacio Zurita <rizurita@yahoo.com> | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify it | ||
7 | * under the terms of the GNU General Public License version 2 as published | ||
8 | * by the Free Software Foundation. | ||
9 | */ | ||
10 | |||
11 | #ifndef __INCLUDE_SH_DAC_AUDIO_H | ||
12 | #define __INCLUDE_SH_DAC_AUDIO_H | ||
13 | |||
14 | struct dac_audio_pdata { | ||
15 | int buffer_size; | ||
16 | int channel; | ||
17 | void (*start)(struct dac_audio_pdata *pd); | ||
18 | void (*stop)(struct dac_audio_pdata *pd); | ||
19 | }; | ||
20 | |||
21 | #endif /* __INCLUDE_SH_DAC_AUDIO_H */ | ||
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h index 97ca9af414dc..ca24e7f7a3f5 100644 --- a/include/sound/soc-dai.h +++ b/include/sound/soc-dai.h | |||
@@ -30,6 +30,7 @@ struct snd_pcm_substream; | |||
30 | #define SND_SOC_DAIFMT_DSP_A 3 /* L data MSB after FRM LRC */ | 30 | #define SND_SOC_DAIFMT_DSP_A 3 /* L data MSB after FRM LRC */ |
31 | #define SND_SOC_DAIFMT_DSP_B 4 /* L data MSB during FRM LRC */ | 31 | #define SND_SOC_DAIFMT_DSP_B 4 /* L data MSB during FRM LRC */ |
32 | #define SND_SOC_DAIFMT_AC97 5 /* AC97 */ | 32 | #define SND_SOC_DAIFMT_AC97 5 /* AC97 */ |
33 | #define SND_SOC_DAIFMT_PDM 6 /* Pulse density modulation */ | ||
33 | 34 | ||
34 | /* left and right justified also known as MSB and LSB respectively */ | 35 | /* left and right justified also known as MSB and LSB respectively */ |
35 | #define SND_SOC_DAIFMT_MSB SND_SOC_DAIFMT_LEFT_J | 36 | #define SND_SOC_DAIFMT_MSB SND_SOC_DAIFMT_LEFT_J |
@@ -106,7 +107,7 @@ int snd_soc_dai_set_clkdiv(struct snd_soc_dai *dai, | |||
106 | int div_id, int div); | 107 | int div_id, int div); |
107 | 108 | ||
108 | int snd_soc_dai_set_pll(struct snd_soc_dai *dai, | 109 | int snd_soc_dai_set_pll(struct snd_soc_dai *dai, |
109 | int pll_id, unsigned int freq_in, unsigned int freq_out); | 110 | int pll_id, int source, unsigned int freq_in, unsigned int freq_out); |
110 | 111 | ||
111 | /* Digital Audio interface formatting */ | 112 | /* Digital Audio interface formatting */ |
112 | int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); | 113 | int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); |
@@ -114,6 +115,10 @@ int snd_soc_dai_set_fmt(struct snd_soc_dai *dai, unsigned int fmt); | |||
114 | int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, | 115 | int snd_soc_dai_set_tdm_slot(struct snd_soc_dai *dai, |
115 | unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width); | 116 | unsigned int tx_mask, unsigned int rx_mask, int slots, int slot_width); |
116 | 117 | ||
118 | int snd_soc_dai_set_channel_map(struct snd_soc_dai *dai, | ||
119 | unsigned int tx_num, unsigned int *tx_slot, | ||
120 | unsigned int rx_num, unsigned int *rx_slot); | ||
121 | |||
117 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); | 122 | int snd_soc_dai_set_tristate(struct snd_soc_dai *dai, int tristate); |
118 | 123 | ||
119 | /* Digital Audio Interface mute */ | 124 | /* Digital Audio Interface mute */ |
@@ -136,8 +141,8 @@ struct snd_soc_dai_ops { | |||
136 | */ | 141 | */ |
137 | int (*set_sysclk)(struct snd_soc_dai *dai, | 142 | int (*set_sysclk)(struct snd_soc_dai *dai, |
138 | int clk_id, unsigned int freq, int dir); | 143 | int clk_id, unsigned int freq, int dir); |
139 | int (*set_pll)(struct snd_soc_dai *dai, | 144 | int (*set_pll)(struct snd_soc_dai *dai, int pll_id, int source, |
140 | int pll_id, unsigned int freq_in, unsigned int freq_out); | 145 | unsigned int freq_in, unsigned int freq_out); |
141 | int (*set_clkdiv)(struct snd_soc_dai *dai, int div_id, int div); | 146 | int (*set_clkdiv)(struct snd_soc_dai *dai, int div_id, int div); |
142 | 147 | ||
143 | /* | 148 | /* |
@@ -148,6 +153,9 @@ struct snd_soc_dai_ops { | |||
148 | int (*set_tdm_slot)(struct snd_soc_dai *dai, | 153 | int (*set_tdm_slot)(struct snd_soc_dai *dai, |
149 | unsigned int tx_mask, unsigned int rx_mask, | 154 | unsigned int tx_mask, unsigned int rx_mask, |
150 | int slots, int slot_width); | 155 | int slots, int slot_width); |
156 | int (*set_channel_map)(struct snd_soc_dai *dai, | ||
157 | unsigned int tx_num, unsigned int *tx_slot, | ||
158 | unsigned int rx_num, unsigned int *rx_slot); | ||
151 | int (*set_tristate)(struct snd_soc_dai *dai, int tristate); | 159 | int (*set_tristate)(struct snd_soc_dai *dai, int tristate); |
152 | 160 | ||
153 | /* | 161 | /* |
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h index c1410e3191e3..c5c95e1da65b 100644 --- a/include/sound/soc-dapm.h +++ b/include/sound/soc-dapm.h | |||
@@ -206,6 +206,12 @@ | |||
206 | .get = snd_soc_dapm_get_enum_double, \ | 206 | .get = snd_soc_dapm_get_enum_double, \ |
207 | .put = snd_soc_dapm_put_enum_double, \ | 207 | .put = snd_soc_dapm_put_enum_double, \ |
208 | .private_value = (unsigned long)&xenum } | 208 | .private_value = (unsigned long)&xenum } |
209 | #define SOC_DAPM_ENUM_VIRT(xname, xenum) \ | ||
210 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | ||
211 | .info = snd_soc_info_enum_double, \ | ||
212 | .get = snd_soc_dapm_get_enum_virt, \ | ||
213 | .put = snd_soc_dapm_put_enum_virt, \ | ||
214 | .private_value = (unsigned long)&xenum } | ||
209 | #define SOC_DAPM_VALUE_ENUM(xname, xenum) \ | 215 | #define SOC_DAPM_VALUE_ENUM(xname, xenum) \ |
210 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ | 216 | { .iface = SNDRV_CTL_ELEM_IFACE_MIXER, .name = xname, \ |
211 | .info = snd_soc_info_enum_double, \ | 217 | .info = snd_soc_info_enum_double, \ |
@@ -260,6 +266,10 @@ int snd_soc_dapm_get_enum_double(struct snd_kcontrol *kcontrol, | |||
260 | struct snd_ctl_elem_value *ucontrol); | 266 | struct snd_ctl_elem_value *ucontrol); |
261 | int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol, | 267 | int snd_soc_dapm_put_enum_double(struct snd_kcontrol *kcontrol, |
262 | struct snd_ctl_elem_value *ucontrol); | 268 | struct snd_ctl_elem_value *ucontrol); |
269 | int snd_soc_dapm_get_enum_virt(struct snd_kcontrol *kcontrol, | ||
270 | struct snd_ctl_elem_value *ucontrol); | ||
271 | int snd_soc_dapm_put_enum_virt(struct snd_kcontrol *kcontrol, | ||
272 | struct snd_ctl_elem_value *ucontrol); | ||
263 | int snd_soc_dapm_get_value_enum_double(struct snd_kcontrol *kcontrol, | 273 | int snd_soc_dapm_get_value_enum_double(struct snd_kcontrol *kcontrol, |
264 | struct snd_ctl_elem_value *ucontrol); | 274 | struct snd_ctl_elem_value *ucontrol); |
265 | int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol, | 275 | int snd_soc_dapm_put_value_enum_double(struct snd_kcontrol *kcontrol, |
@@ -333,6 +343,10 @@ struct snd_soc_dapm_route { | |||
333 | const char *sink; | 343 | const char *sink; |
334 | const char *control; | 344 | const char *control; |
335 | const char *source; | 345 | const char *source; |
346 | |||
347 | /* Note: currently only supported for links where source is a supply */ | ||
348 | int (*connected)(struct snd_soc_dapm_widget *source, | ||
349 | struct snd_soc_dapm_widget *sink); | ||
336 | }; | 350 | }; |
337 | 351 | ||
338 | /* dapm audio path between two widgets */ | 352 | /* dapm audio path between two widgets */ |
@@ -349,6 +363,9 @@ struct snd_soc_dapm_path { | |||
349 | u32 connect:1; /* source and sink widgets are connected */ | 363 | u32 connect:1; /* source and sink widgets are connected */ |
350 | u32 walked:1; /* path has been walked */ | 364 | u32 walked:1; /* path has been walked */ |
351 | 365 | ||
366 | int (*connected)(struct snd_soc_dapm_widget *source, | ||
367 | struct snd_soc_dapm_widget *sink); | ||
368 | |||
352 | struct list_head list_source; | 369 | struct list_head list_source; |
353 | struct list_head list_sink; | 370 | struct list_head list_sink; |
354 | struct list_head list; | 371 | struct list_head list; |
diff --git a/include/sound/soc.h b/include/sound/soc.h index 475cb7ed6bec..0d7718f9280d 100644 --- a/include/sound/soc.h +++ b/include/sound/soc.h | |||
@@ -223,15 +223,15 @@ int snd_soc_codec_set_cache_io(struct snd_soc_codec *codec, | |||
223 | int addr_bits, int data_bits, | 223 | int addr_bits, int data_bits, |
224 | enum snd_soc_control_type control); | 224 | enum snd_soc_control_type control); |
225 | 225 | ||
226 | #ifdef CONFIG_PM | ||
227 | int snd_soc_suspend_device(struct device *dev); | ||
228 | int snd_soc_resume_device(struct device *dev); | ||
229 | #endif | ||
230 | |||
231 | /* pcm <-> DAI connect */ | 226 | /* pcm <-> DAI connect */ |
232 | void snd_soc_free_pcms(struct snd_soc_device *socdev); | 227 | void snd_soc_free_pcms(struct snd_soc_device *socdev); |
233 | int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid); | 228 | int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid); |
234 | int snd_soc_init_card(struct snd_soc_device *socdev); | 229 | |
230 | /* Utility functions to get clock rates from various things */ | ||
231 | int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); | ||
232 | int snd_soc_params_to_frame_size(struct snd_pcm_hw_params *params); | ||
233 | int snd_soc_calc_bclk(int fs, int sample_size, int channels, int tdm_slots); | ||
234 | int snd_soc_params_to_bclk(struct snd_pcm_hw_params *parms); | ||
235 | 235 | ||
236 | /* set runtime hw params */ | 236 | /* set runtime hw params */ |
237 | int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream, | 237 | int snd_soc_set_runtime_hwparams(struct snd_pcm_substream *substream, |
@@ -333,6 +333,8 @@ struct snd_soc_jack_gpio { | |||
333 | int debounce_time; | 333 | int debounce_time; |
334 | struct snd_soc_jack *jack; | 334 | struct snd_soc_jack *jack; |
335 | struct work_struct work; | 335 | struct work_struct work; |
336 | |||
337 | int (*jack_status_check)(void); | ||
336 | }; | 338 | }; |
337 | #endif | 339 | #endif |
338 | 340 | ||
@@ -413,6 +415,7 @@ struct snd_soc_codec { | |||
413 | unsigned int num_dai; | 415 | unsigned int num_dai; |
414 | 416 | ||
415 | #ifdef CONFIG_DEBUG_FS | 417 | #ifdef CONFIG_DEBUG_FS |
418 | struct dentry *debugfs_codec_root; | ||
416 | struct dentry *debugfs_reg; | 419 | struct dentry *debugfs_reg; |
417 | struct dentry *debugfs_pop_time; | 420 | struct dentry *debugfs_pop_time; |
418 | struct dentry *debugfs_dapm; | 421 | struct dentry *debugfs_dapm; |
diff --git a/include/sound/sscape_ioctl.h b/include/sound/sscape_ioctl.h deleted file mode 100644 index 0d8885969c64..000000000000 --- a/include/sound/sscape_ioctl.h +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | #ifndef SSCAPE_IOCTL_H | ||
2 | #define SSCAPE_IOCTL_H | ||
3 | |||
4 | |||
5 | struct sscape_bootblock | ||
6 | { | ||
7 | unsigned char code[256]; | ||
8 | unsigned version; | ||
9 | }; | ||
10 | |||
11 | #define SSCAPE_MICROCODE_SIZE 65536 | ||
12 | |||
13 | struct sscape_microcode | ||
14 | { | ||
15 | unsigned char __user *code; | ||
16 | }; | ||
17 | |||
18 | #define SND_SSCAPE_LOAD_BOOTB _IOWR('P', 100, struct sscape_bootblock) | ||
19 | #define SND_SSCAPE_LOAD_MCODE _IOW ('P', 101, struct sscape_microcode) | ||
20 | |||
21 | #endif | ||
diff --git a/include/sound/tlv320dac33-plat.h b/include/sound/tlv320dac33-plat.h new file mode 100644 index 000000000000..5858d06a7ffa --- /dev/null +++ b/include/sound/tlv320dac33-plat.h | |||
@@ -0,0 +1,20 @@ | |||
1 | /* | ||
2 | * Platform header for Texas Instruments TLV320DAC33 codec driver | ||
3 | * | ||
4 | * Author: Peter Ujfalusi <peter.ujfalusi@nokia.com> | ||
5 | * | ||
6 | * Copyright: (C) 2009 Nokia Corporation | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify | ||
9 | * it under the terms of the GNU General Public License version 2 as | ||
10 | * published by the Free Software Foundation. | ||
11 | */ | ||
12 | |||
13 | #ifndef __TLV320DAC33_PLAT_H | ||
14 | #define __TLV320DAC33_PLAT_H | ||
15 | |||
16 | struct tlv320dac33_platform_data { | ||
17 | int power_gpio; | ||
18 | }; | ||
19 | |||
20 | #endif /* __TLV320DAC33_PLAT_H */ | ||
diff --git a/include/sound/tpa6130a2-plat.h b/include/sound/tpa6130a2-plat.h new file mode 100644 index 000000000000..e8c901e749d8 --- /dev/null +++ b/include/sound/tpa6130a2-plat.h | |||
@@ -0,0 +1,30 @@ | |||
1 | /* | ||
2 | * TPA6130A2 driver platform header | ||
3 | * | ||
4 | * Copyright (C) Nokia Corporation | ||
5 | * | ||
6 | * Written by Peter Ujfalusi <peter.ujfalusi@nokia.com> | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or | ||
9 | * modify it under the terms of the GNU General Public License | ||
10 | * version 2 as published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, but | ||
13 | * WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | ||
15 | * General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | ||
20 | * 02110-1301 USA | ||
21 | */ | ||
22 | |||
23 | #ifndef TPA6130A2_PLAT_H | ||
24 | #define TPA6130A2_PLAT_H | ||
25 | |||
26 | struct tpa6130a2_platform_data { | ||
27 | int power_gpio; | ||
28 | }; | ||
29 | |||
30 | #endif | ||
diff --git a/include/sound/wm8993.h b/include/sound/wm8993.h index 9c661f2f8cda..eee19f63c0d8 100644 --- a/include/sound/wm8993.h +++ b/include/sound/wm8993.h | |||
@@ -36,7 +36,7 @@ struct wm8993_platform_data { | |||
36 | unsigned int micbias1_lvl:1; | 36 | unsigned int micbias1_lvl:1; |
37 | unsigned int micbias2_lvl:1; | 37 | unsigned int micbias2_lvl:1; |
38 | 38 | ||
39 | /* Jack detect threashold levels, see datasheet for values */ | 39 | /* Jack detect threshold levels, see datasheet for values */ |
40 | unsigned int jd_scthr:2; | 40 | unsigned int jd_scthr:2; |
41 | unsigned int jd_thr:2; | 41 | unsigned int jd_thr:2; |
42 | }; | 42 | }; |
diff --git a/include/sound/wss.h b/include/sound/wss.h index 6d65f322f1d5..fd01f22825cd 100644 --- a/include/sound/wss.h +++ b/include/sound/wss.h | |||
@@ -154,7 +154,6 @@ int snd_wss_create(struct snd_card *card, | |||
154 | unsigned short hardware, | 154 | unsigned short hardware, |
155 | unsigned short hwshare, | 155 | unsigned short hwshare, |
156 | struct snd_wss **rchip); | 156 | struct snd_wss **rchip); |
157 | int snd_wss_free(struct snd_wss *chip); | ||
158 | int snd_wss_pcm(struct snd_wss *chip, int device, struct snd_pcm **rpcm); | 157 | int snd_wss_pcm(struct snd_wss *chip, int device, struct snd_pcm **rpcm); |
159 | int snd_wss_timer(struct snd_wss *chip, int device, struct snd_timer **rtimer); | 158 | int snd_wss_timer(struct snd_wss *chip, int device, struct snd_timer **rtimer); |
160 | int snd_wss_mixer(struct snd_wss *chip); | 159 | int snd_wss_mixer(struct snd_wss *chip); |
diff --git a/include/trace/define_trace.h b/include/trace/define_trace.h index 2a4b3bf74033..5acfb1eb4df9 100644 --- a/include/trace/define_trace.h +++ b/include/trace/define_trace.h | |||
@@ -31,6 +31,14 @@ | |||
31 | assign, print, reg, unreg) \ | 31 | assign, print, reg, unreg) \ |
32 | DEFINE_TRACE_FN(name, reg, unreg) | 32 | DEFINE_TRACE_FN(name, reg, unreg) |
33 | 33 | ||
34 | #undef DEFINE_EVENT | ||
35 | #define DEFINE_EVENT(template, name, proto, args) \ | ||
36 | DEFINE_TRACE(name) | ||
37 | |||
38 | #undef DEFINE_EVENT_PRINT | ||
39 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | ||
40 | DEFINE_TRACE(name) | ||
41 | |||
34 | #undef DECLARE_TRACE | 42 | #undef DECLARE_TRACE |
35 | #define DECLARE_TRACE(name, proto, args) \ | 43 | #define DECLARE_TRACE(name, proto, args) \ |
36 | DEFINE_TRACE(name) | 44 | DEFINE_TRACE(name) |
@@ -63,6 +71,9 @@ | |||
63 | 71 | ||
64 | #undef TRACE_EVENT | 72 | #undef TRACE_EVENT |
65 | #undef TRACE_EVENT_FN | 73 | #undef TRACE_EVENT_FN |
74 | #undef DECLARE_EVENT_CLASS | ||
75 | #undef DEFINE_EVENT | ||
76 | #undef DEFINE_EVENT_PRINT | ||
66 | #undef TRACE_HEADER_MULTI_READ | 77 | #undef TRACE_HEADER_MULTI_READ |
67 | 78 | ||
68 | /* Only undef what we defined in this file */ | 79 | /* Only undef what we defined in this file */ |
diff --git a/include/trace/events/bkl.h b/include/trace/events/bkl.h new file mode 100644 index 000000000000..1af72dc24278 --- /dev/null +++ b/include/trace/events/bkl.h | |||
@@ -0,0 +1,61 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM bkl | ||
3 | |||
4 | #if !defined(_TRACE_BKL_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_BKL_H | ||
6 | |||
7 | #include <linux/tracepoint.h> | ||
8 | |||
9 | TRACE_EVENT(lock_kernel, | ||
10 | |||
11 | TP_PROTO(const char *func, const char *file, int line), | ||
12 | |||
13 | TP_ARGS(func, file, line), | ||
14 | |||
15 | TP_STRUCT__entry( | ||
16 | __field( int, depth ) | ||
17 | __field_ext( const char *, func, FILTER_PTR_STRING ) | ||
18 | __field_ext( const char *, file, FILTER_PTR_STRING ) | ||
19 | __field( int, line ) | ||
20 | ), | ||
21 | |||
22 | TP_fast_assign( | ||
23 | /* We want to record the lock_depth after lock is acquired */ | ||
24 | __entry->depth = current->lock_depth + 1; | ||
25 | __entry->func = func; | ||
26 | __entry->file = file; | ||
27 | __entry->line = line; | ||
28 | ), | ||
29 | |||
30 | TP_printk("depth=%d file:line=%s:%d func=%s()", __entry->depth, | ||
31 | __entry->file, __entry->line, __entry->func) | ||
32 | ); | ||
33 | |||
34 | TRACE_EVENT(unlock_kernel, | ||
35 | |||
36 | TP_PROTO(const char *func, const char *file, int line), | ||
37 | |||
38 | TP_ARGS(func, file, line), | ||
39 | |||
40 | TP_STRUCT__entry( | ||
41 | __field(int, depth ) | ||
42 | __field(const char *, func ) | ||
43 | __field(const char *, file ) | ||
44 | __field(int, line ) | ||
45 | ), | ||
46 | |||
47 | TP_fast_assign( | ||
48 | __entry->depth = current->lock_depth; | ||
49 | __entry->func = func; | ||
50 | __entry->file = file; | ||
51 | __entry->line = line; | ||
52 | ), | ||
53 | |||
54 | TP_printk("depth=%d file:line=%s:%d func=%s()", __entry->depth, | ||
55 | __entry->file, __entry->line, __entry->func) | ||
56 | ); | ||
57 | |||
58 | #endif /* _TRACE_BKL_H */ | ||
59 | |||
60 | /* This part must be outside protection */ | ||
61 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/block.h b/include/trace/events/block.h index 00405b5f624a..5fb72733331e 100644 --- a/include/trace/events/block.h +++ b/include/trace/events/block.h | |||
@@ -8,7 +8,7 @@ | |||
8 | #include <linux/blkdev.h> | 8 | #include <linux/blkdev.h> |
9 | #include <linux/tracepoint.h> | 9 | #include <linux/tracepoint.h> |
10 | 10 | ||
11 | TRACE_EVENT(block_rq_abort, | 11 | DECLARE_EVENT_CLASS(block_rq_with_error, |
12 | 12 | ||
13 | TP_PROTO(struct request_queue *q, struct request *rq), | 13 | TP_PROTO(struct request_queue *q, struct request *rq), |
14 | 14 | ||
@@ -40,41 +40,28 @@ TRACE_EVENT(block_rq_abort, | |||
40 | __entry->nr_sector, __entry->errors) | 40 | __entry->nr_sector, __entry->errors) |
41 | ); | 41 | ); |
42 | 42 | ||
43 | TRACE_EVENT(block_rq_insert, | 43 | DEFINE_EVENT(block_rq_with_error, block_rq_abort, |
44 | 44 | ||
45 | TP_PROTO(struct request_queue *q, struct request *rq), | 45 | TP_PROTO(struct request_queue *q, struct request *rq), |
46 | 46 | ||
47 | TP_ARGS(q, rq), | 47 | TP_ARGS(q, rq) |
48 | ); | ||
48 | 49 | ||
49 | TP_STRUCT__entry( | 50 | DEFINE_EVENT(block_rq_with_error, block_rq_requeue, |
50 | __field( dev_t, dev ) | ||
51 | __field( sector_t, sector ) | ||
52 | __field( unsigned int, nr_sector ) | ||
53 | __field( unsigned int, bytes ) | ||
54 | __array( char, rwbs, 6 ) | ||
55 | __array( char, comm, TASK_COMM_LEN ) | ||
56 | __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) | ||
57 | ), | ||
58 | 51 | ||
59 | TP_fast_assign( | 52 | TP_PROTO(struct request_queue *q, struct request *rq), |
60 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; | ||
61 | __entry->sector = blk_pc_request(rq) ? 0 : blk_rq_pos(rq); | ||
62 | __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq); | ||
63 | __entry->bytes = blk_pc_request(rq) ? blk_rq_bytes(rq) : 0; | ||
64 | 53 | ||
65 | blk_fill_rwbs_rq(__entry->rwbs, rq); | 54 | TP_ARGS(q, rq) |
66 | blk_dump_cmd(__get_str(cmd), rq); | 55 | ); |
67 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
68 | ), | ||
69 | 56 | ||
70 | TP_printk("%d,%d %s %u (%s) %llu + %u [%s]", | 57 | DEFINE_EVENT(block_rq_with_error, block_rq_complete, |
71 | MAJOR(__entry->dev), MINOR(__entry->dev), | 58 | |
72 | __entry->rwbs, __entry->bytes, __get_str(cmd), | 59 | TP_PROTO(struct request_queue *q, struct request *rq), |
73 | (unsigned long long)__entry->sector, | 60 | |
74 | __entry->nr_sector, __entry->comm) | 61 | TP_ARGS(q, rq) |
75 | ); | 62 | ); |
76 | 63 | ||
77 | TRACE_EVENT(block_rq_issue, | 64 | DECLARE_EVENT_CLASS(block_rq, |
78 | 65 | ||
79 | TP_PROTO(struct request_queue *q, struct request *rq), | 66 | TP_PROTO(struct request_queue *q, struct request *rq), |
80 | 67 | ||
@@ -86,7 +73,7 @@ TRACE_EVENT(block_rq_issue, | |||
86 | __field( unsigned int, nr_sector ) | 73 | __field( unsigned int, nr_sector ) |
87 | __field( unsigned int, bytes ) | 74 | __field( unsigned int, bytes ) |
88 | __array( char, rwbs, 6 ) | 75 | __array( char, rwbs, 6 ) |
89 | __array( char, comm, TASK_COMM_LEN ) | 76 | __array( char, comm, TASK_COMM_LEN ) |
90 | __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) | 77 | __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) |
91 | ), | 78 | ), |
92 | 79 | ||
@@ -108,68 +95,18 @@ TRACE_EVENT(block_rq_issue, | |||
108 | __entry->nr_sector, __entry->comm) | 95 | __entry->nr_sector, __entry->comm) |
109 | ); | 96 | ); |
110 | 97 | ||
111 | TRACE_EVENT(block_rq_requeue, | 98 | DEFINE_EVENT(block_rq, block_rq_insert, |
112 | 99 | ||
113 | TP_PROTO(struct request_queue *q, struct request *rq), | 100 | TP_PROTO(struct request_queue *q, struct request *rq), |
114 | 101 | ||
115 | TP_ARGS(q, rq), | 102 | TP_ARGS(q, rq) |
116 | |||
117 | TP_STRUCT__entry( | ||
118 | __field( dev_t, dev ) | ||
119 | __field( sector_t, sector ) | ||
120 | __field( unsigned int, nr_sector ) | ||
121 | __field( int, errors ) | ||
122 | __array( char, rwbs, 6 ) | ||
123 | __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) | ||
124 | ), | ||
125 | |||
126 | TP_fast_assign( | ||
127 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; | ||
128 | __entry->sector = blk_pc_request(rq) ? 0 : blk_rq_pos(rq); | ||
129 | __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq); | ||
130 | __entry->errors = rq->errors; | ||
131 | |||
132 | blk_fill_rwbs_rq(__entry->rwbs, rq); | ||
133 | blk_dump_cmd(__get_str(cmd), rq); | ||
134 | ), | ||
135 | |||
136 | TP_printk("%d,%d %s (%s) %llu + %u [%d]", | ||
137 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
138 | __entry->rwbs, __get_str(cmd), | ||
139 | (unsigned long long)__entry->sector, | ||
140 | __entry->nr_sector, __entry->errors) | ||
141 | ); | 103 | ); |
142 | 104 | ||
143 | TRACE_EVENT(block_rq_complete, | 105 | DEFINE_EVENT(block_rq, block_rq_issue, |
144 | 106 | ||
145 | TP_PROTO(struct request_queue *q, struct request *rq), | 107 | TP_PROTO(struct request_queue *q, struct request *rq), |
146 | 108 | ||
147 | TP_ARGS(q, rq), | 109 | TP_ARGS(q, rq) |
148 | |||
149 | TP_STRUCT__entry( | ||
150 | __field( dev_t, dev ) | ||
151 | __field( sector_t, sector ) | ||
152 | __field( unsigned int, nr_sector ) | ||
153 | __field( int, errors ) | ||
154 | __array( char, rwbs, 6 ) | ||
155 | __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) | ||
156 | ), | ||
157 | |||
158 | TP_fast_assign( | ||
159 | __entry->dev = rq->rq_disk ? disk_devt(rq->rq_disk) : 0; | ||
160 | __entry->sector = blk_pc_request(rq) ? 0 : blk_rq_pos(rq); | ||
161 | __entry->nr_sector = blk_pc_request(rq) ? 0 : blk_rq_sectors(rq); | ||
162 | __entry->errors = rq->errors; | ||
163 | |||
164 | blk_fill_rwbs_rq(__entry->rwbs, rq); | ||
165 | blk_dump_cmd(__get_str(cmd), rq); | ||
166 | ), | ||
167 | |||
168 | TP_printk("%d,%d %s (%s) %llu + %u [%d]", | ||
169 | MAJOR(__entry->dev), MINOR(__entry->dev), | ||
170 | __entry->rwbs, __get_str(cmd), | ||
171 | (unsigned long long)__entry->sector, | ||
172 | __entry->nr_sector, __entry->errors) | ||
173 | ); | 110 | ); |
174 | 111 | ||
175 | TRACE_EVENT(block_bio_bounce, | 112 | TRACE_EVENT(block_bio_bounce, |
@@ -228,7 +165,7 @@ TRACE_EVENT(block_bio_complete, | |||
228 | __entry->nr_sector, __entry->error) | 165 | __entry->nr_sector, __entry->error) |
229 | ); | 166 | ); |
230 | 167 | ||
231 | TRACE_EVENT(block_bio_backmerge, | 168 | DECLARE_EVENT_CLASS(block_bio, |
232 | 169 | ||
233 | TP_PROTO(struct request_queue *q, struct bio *bio), | 170 | TP_PROTO(struct request_queue *q, struct bio *bio), |
234 | 171 | ||
@@ -256,63 +193,28 @@ TRACE_EVENT(block_bio_backmerge, | |||
256 | __entry->nr_sector, __entry->comm) | 193 | __entry->nr_sector, __entry->comm) |
257 | ); | 194 | ); |
258 | 195 | ||
259 | TRACE_EVENT(block_bio_frontmerge, | 196 | DEFINE_EVENT(block_bio, block_bio_backmerge, |
260 | 197 | ||
261 | TP_PROTO(struct request_queue *q, struct bio *bio), | 198 | TP_PROTO(struct request_queue *q, struct bio *bio), |
262 | 199 | ||
263 | TP_ARGS(q, bio), | 200 | TP_ARGS(q, bio) |
264 | |||
265 | TP_STRUCT__entry( | ||
266 | __field( dev_t, dev ) | ||
267 | __field( sector_t, sector ) | ||
268 | __field( unsigned, nr_sector ) | ||
269 | __array( char, rwbs, 6 ) | ||
270 | __array( char, comm, TASK_COMM_LEN ) | ||
271 | ), | ||
272 | |||
273 | TP_fast_assign( | ||
274 | __entry->dev = bio->bi_bdev->bd_dev; | ||
275 | __entry->sector = bio->bi_sector; | ||
276 | __entry->nr_sector = bio->bi_size >> 9; | ||
277 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); | ||
278 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
279 | ), | ||
280 | |||
281 | TP_printk("%d,%d %s %llu + %u [%s]", | ||
282 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, | ||
283 | (unsigned long long)__entry->sector, | ||
284 | __entry->nr_sector, __entry->comm) | ||
285 | ); | 201 | ); |
286 | 202 | ||
287 | TRACE_EVENT(block_bio_queue, | 203 | DEFINE_EVENT(block_bio, block_bio_frontmerge, |
288 | 204 | ||
289 | TP_PROTO(struct request_queue *q, struct bio *bio), | 205 | TP_PROTO(struct request_queue *q, struct bio *bio), |
290 | 206 | ||
291 | TP_ARGS(q, bio), | 207 | TP_ARGS(q, bio) |
208 | ); | ||
292 | 209 | ||
293 | TP_STRUCT__entry( | 210 | DEFINE_EVENT(block_bio, block_bio_queue, |
294 | __field( dev_t, dev ) | ||
295 | __field( sector_t, sector ) | ||
296 | __field( unsigned int, nr_sector ) | ||
297 | __array( char, rwbs, 6 ) | ||
298 | __array( char, comm, TASK_COMM_LEN ) | ||
299 | ), | ||
300 | 211 | ||
301 | TP_fast_assign( | 212 | TP_PROTO(struct request_queue *q, struct bio *bio), |
302 | __entry->dev = bio->bi_bdev->bd_dev; | ||
303 | __entry->sector = bio->bi_sector; | ||
304 | __entry->nr_sector = bio->bi_size >> 9; | ||
305 | blk_fill_rwbs(__entry->rwbs, bio->bi_rw, bio->bi_size); | ||
306 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
307 | ), | ||
308 | 213 | ||
309 | TP_printk("%d,%d %s %llu + %u [%s]", | 214 | TP_ARGS(q, bio) |
310 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, | ||
311 | (unsigned long long)__entry->sector, | ||
312 | __entry->nr_sector, __entry->comm) | ||
313 | ); | 215 | ); |
314 | 216 | ||
315 | TRACE_EVENT(block_getrq, | 217 | DECLARE_EVENT_CLASS(block_get_rq, |
316 | 218 | ||
317 | TP_PROTO(struct request_queue *q, struct bio *bio, int rw), | 219 | TP_PROTO(struct request_queue *q, struct bio *bio, int rw), |
318 | 220 | ||
@@ -341,33 +243,18 @@ TRACE_EVENT(block_getrq, | |||
341 | __entry->nr_sector, __entry->comm) | 243 | __entry->nr_sector, __entry->comm) |
342 | ); | 244 | ); |
343 | 245 | ||
344 | TRACE_EVENT(block_sleeprq, | 246 | DEFINE_EVENT(block_get_rq, block_getrq, |
345 | 247 | ||
346 | TP_PROTO(struct request_queue *q, struct bio *bio, int rw), | 248 | TP_PROTO(struct request_queue *q, struct bio *bio, int rw), |
347 | 249 | ||
348 | TP_ARGS(q, bio, rw), | 250 | TP_ARGS(q, bio, rw) |
251 | ); | ||
349 | 252 | ||
350 | TP_STRUCT__entry( | 253 | DEFINE_EVENT(block_get_rq, block_sleeprq, |
351 | __field( dev_t, dev ) | ||
352 | __field( sector_t, sector ) | ||
353 | __field( unsigned int, nr_sector ) | ||
354 | __array( char, rwbs, 6 ) | ||
355 | __array( char, comm, TASK_COMM_LEN ) | ||
356 | ), | ||
357 | 254 | ||
358 | TP_fast_assign( | 255 | TP_PROTO(struct request_queue *q, struct bio *bio, int rw), |
359 | __entry->dev = bio ? bio->bi_bdev->bd_dev : 0; | ||
360 | __entry->sector = bio ? bio->bi_sector : 0; | ||
361 | __entry->nr_sector = bio ? bio->bi_size >> 9 : 0; | ||
362 | blk_fill_rwbs(__entry->rwbs, | ||
363 | bio ? bio->bi_rw : 0, __entry->nr_sector); | ||
364 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
365 | ), | ||
366 | 256 | ||
367 | TP_printk("%d,%d %s %llu + %u [%s]", | 257 | TP_ARGS(q, bio, rw) |
368 | MAJOR(__entry->dev), MINOR(__entry->dev), __entry->rwbs, | ||
369 | (unsigned long long)__entry->sector, | ||
370 | __entry->nr_sector, __entry->comm) | ||
371 | ); | 258 | ); |
372 | 259 | ||
373 | TRACE_EVENT(block_plug, | 260 | TRACE_EVENT(block_plug, |
@@ -387,7 +274,7 @@ TRACE_EVENT(block_plug, | |||
387 | TP_printk("[%s]", __entry->comm) | 274 | TP_printk("[%s]", __entry->comm) |
388 | ); | 275 | ); |
389 | 276 | ||
390 | TRACE_EVENT(block_unplug_timer, | 277 | DECLARE_EVENT_CLASS(block_unplug, |
391 | 278 | ||
392 | TP_PROTO(struct request_queue *q), | 279 | TP_PROTO(struct request_queue *q), |
393 | 280 | ||
@@ -406,23 +293,18 @@ TRACE_EVENT(block_unplug_timer, | |||
406 | TP_printk("[%s] %d", __entry->comm, __entry->nr_rq) | 293 | TP_printk("[%s] %d", __entry->comm, __entry->nr_rq) |
407 | ); | 294 | ); |
408 | 295 | ||
409 | TRACE_EVENT(block_unplug_io, | 296 | DEFINE_EVENT(block_unplug, block_unplug_timer, |
410 | 297 | ||
411 | TP_PROTO(struct request_queue *q), | 298 | TP_PROTO(struct request_queue *q), |
412 | 299 | ||
413 | TP_ARGS(q), | 300 | TP_ARGS(q) |
301 | ); | ||
414 | 302 | ||
415 | TP_STRUCT__entry( | 303 | DEFINE_EVENT(block_unplug, block_unplug_io, |
416 | __field( int, nr_rq ) | ||
417 | __array( char, comm, TASK_COMM_LEN ) | ||
418 | ), | ||
419 | 304 | ||
420 | TP_fast_assign( | 305 | TP_PROTO(struct request_queue *q), |
421 | __entry->nr_rq = q->rq.count[READ] + q->rq.count[WRITE]; | ||
422 | memcpy(__entry->comm, current->comm, TASK_COMM_LEN); | ||
423 | ), | ||
424 | 306 | ||
425 | TP_printk("[%s] %d", __entry->comm, __entry->nr_rq) | 307 | TP_ARGS(q) |
426 | ); | 308 | ); |
427 | 309 | ||
428 | TRACE_EVENT(block_split, | 310 | TRACE_EVENT(block_split, |
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h index d09550bf3f95..d0b6cd3afb2f 100644 --- a/include/trace/events/ext4.h +++ b/include/trace/events/ext4.h | |||
@@ -38,7 +38,7 @@ TRACE_EVENT(ext4_free_inode, | |||
38 | __entry->blocks = inode->i_blocks; | 38 | __entry->blocks = inode->i_blocks; |
39 | ), | 39 | ), |
40 | 40 | ||
41 | TP_printk("dev %s ino %lu mode %d uid %u gid %u blocks %llu", | 41 | TP_printk("dev %s ino %lu mode 0%o uid %u gid %u blocks %llu", |
42 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, | 42 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, |
43 | __entry->mode, __entry->uid, __entry->gid, | 43 | __entry->mode, __entry->uid, __entry->gid, |
44 | (unsigned long long) __entry->blocks) | 44 | (unsigned long long) __entry->blocks) |
@@ -61,7 +61,7 @@ TRACE_EVENT(ext4_request_inode, | |||
61 | __entry->mode = mode; | 61 | __entry->mode = mode; |
62 | ), | 62 | ), |
63 | 63 | ||
64 | TP_printk("dev %s dir %lu mode %d", | 64 | TP_printk("dev %s dir %lu mode 0%o", |
65 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->dir, | 65 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->dir, |
66 | __entry->mode) | 66 | __entry->mode) |
67 | ); | 67 | ); |
@@ -85,12 +85,12 @@ TRACE_EVENT(ext4_allocate_inode, | |||
85 | __entry->mode = mode; | 85 | __entry->mode = mode; |
86 | ), | 86 | ), |
87 | 87 | ||
88 | TP_printk("dev %s ino %lu dir %lu mode %d", | 88 | TP_printk("dev %s ino %lu dir %lu mode 0%o", |
89 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, | 89 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, |
90 | (unsigned long) __entry->dir, __entry->mode) | 90 | (unsigned long) __entry->dir, __entry->mode) |
91 | ); | 91 | ); |
92 | 92 | ||
93 | TRACE_EVENT(ext4_write_begin, | 93 | DECLARE_EVENT_CLASS(ext4__write_begin, |
94 | 94 | ||
95 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, | 95 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, |
96 | unsigned int flags), | 96 | unsigned int flags), |
@@ -118,7 +118,23 @@ TRACE_EVENT(ext4_write_begin, | |||
118 | __entry->pos, __entry->len, __entry->flags) | 118 | __entry->pos, __entry->len, __entry->flags) |
119 | ); | 119 | ); |
120 | 120 | ||
121 | TRACE_EVENT(ext4_ordered_write_end, | 121 | DEFINE_EVENT(ext4__write_begin, ext4_write_begin, |
122 | |||
123 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, | ||
124 | unsigned int flags), | ||
125 | |||
126 | TP_ARGS(inode, pos, len, flags) | ||
127 | ); | ||
128 | |||
129 | DEFINE_EVENT(ext4__write_begin, ext4_da_write_begin, | ||
130 | |||
131 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, | ||
132 | unsigned int flags), | ||
133 | |||
134 | TP_ARGS(inode, pos, len, flags) | ||
135 | ); | ||
136 | |||
137 | DECLARE_EVENT_CLASS(ext4__write_end, | ||
122 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, | 138 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, |
123 | unsigned int copied), | 139 | unsigned int copied), |
124 | 140 | ||
@@ -145,57 +161,36 @@ TRACE_EVENT(ext4_ordered_write_end, | |||
145 | __entry->pos, __entry->len, __entry->copied) | 161 | __entry->pos, __entry->len, __entry->copied) |
146 | ); | 162 | ); |
147 | 163 | ||
148 | TRACE_EVENT(ext4_writeback_write_end, | 164 | DEFINE_EVENT(ext4__write_end, ext4_ordered_write_end, |
165 | |||
149 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, | 166 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, |
150 | unsigned int copied), | 167 | unsigned int copied), |
151 | 168 | ||
152 | TP_ARGS(inode, pos, len, copied), | 169 | TP_ARGS(inode, pos, len, copied) |
170 | ); | ||
153 | 171 | ||
154 | TP_STRUCT__entry( | 172 | DEFINE_EVENT(ext4__write_end, ext4_writeback_write_end, |
155 | __field( dev_t, dev ) | ||
156 | __field( ino_t, ino ) | ||
157 | __field( loff_t, pos ) | ||
158 | __field( unsigned int, len ) | ||
159 | __field( unsigned int, copied ) | ||
160 | ), | ||
161 | 173 | ||
162 | TP_fast_assign( | 174 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, |
163 | __entry->dev = inode->i_sb->s_dev; | 175 | unsigned int copied), |
164 | __entry->ino = inode->i_ino; | ||
165 | __entry->pos = pos; | ||
166 | __entry->len = len; | ||
167 | __entry->copied = copied; | ||
168 | ), | ||
169 | 176 | ||
170 | TP_printk("dev %s ino %lu pos %llu len %u copied %u", | 177 | TP_ARGS(inode, pos, len, copied) |
171 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, | ||
172 | __entry->pos, __entry->len, __entry->copied) | ||
173 | ); | 178 | ); |
174 | 179 | ||
175 | TRACE_EVENT(ext4_journalled_write_end, | 180 | DEFINE_EVENT(ext4__write_end, ext4_journalled_write_end, |
181 | |||
176 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, | 182 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, |
177 | unsigned int copied), | 183 | unsigned int copied), |
178 | TP_ARGS(inode, pos, len, copied), | ||
179 | 184 | ||
180 | TP_STRUCT__entry( | 185 | TP_ARGS(inode, pos, len, copied) |
181 | __field( dev_t, dev ) | 186 | ); |
182 | __field( ino_t, ino ) | ||
183 | __field( loff_t, pos ) | ||
184 | __field( unsigned int, len ) | ||
185 | __field( unsigned int, copied ) | ||
186 | ), | ||
187 | 187 | ||
188 | TP_fast_assign( | 188 | DEFINE_EVENT(ext4__write_end, ext4_da_write_end, |
189 | __entry->dev = inode->i_sb->s_dev; | ||
190 | __entry->ino = inode->i_ino; | ||
191 | __entry->pos = pos; | ||
192 | __entry->len = len; | ||
193 | __entry->copied = copied; | ||
194 | ), | ||
195 | 189 | ||
196 | TP_printk("dev %s ino %lu pos %llu len %u copied %u", | 190 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, |
197 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, | 191 | unsigned int copied), |
198 | __entry->pos, __entry->len, __entry->copied) | 192 | |
193 | TP_ARGS(inode, pos, len, copied) | ||
199 | ); | 194 | ); |
200 | 195 | ||
201 | TRACE_EVENT(ext4_writepage, | 196 | TRACE_EVENT(ext4_writepage, |
@@ -310,7 +305,6 @@ TRACE_EVENT(ext4_da_writepages_result, | |||
310 | __field( int, ret ) | 305 | __field( int, ret ) |
311 | __field( int, pages_written ) | 306 | __field( int, pages_written ) |
312 | __field( long, pages_skipped ) | 307 | __field( long, pages_skipped ) |
313 | __field( char, encountered_congestion ) | ||
314 | __field( char, more_io ) | 308 | __field( char, more_io ) |
315 | __field( char, no_nrwrite_index_update ) | 309 | __field( char, no_nrwrite_index_update ) |
316 | __field( pgoff_t, writeback_index ) | 310 | __field( pgoff_t, writeback_index ) |
@@ -322,75 +316,20 @@ TRACE_EVENT(ext4_da_writepages_result, | |||
322 | __entry->ret = ret; | 316 | __entry->ret = ret; |
323 | __entry->pages_written = pages_written; | 317 | __entry->pages_written = pages_written; |
324 | __entry->pages_skipped = wbc->pages_skipped; | 318 | __entry->pages_skipped = wbc->pages_skipped; |
325 | __entry->encountered_congestion = wbc->encountered_congestion; | ||
326 | __entry->more_io = wbc->more_io; | 319 | __entry->more_io = wbc->more_io; |
327 | __entry->no_nrwrite_index_update = wbc->no_nrwrite_index_update; | 320 | __entry->no_nrwrite_index_update = wbc->no_nrwrite_index_update; |
328 | __entry->writeback_index = inode->i_mapping->writeback_index; | 321 | __entry->writeback_index = inode->i_mapping->writeback_index; |
329 | ), | 322 | ), |
330 | 323 | ||
331 | TP_printk("dev %s ino %lu ret %d pages_written %d pages_skipped %ld congestion %d more_io %d no_nrwrite_index_update %d writeback_index %lu", | 324 | TP_printk("dev %s ino %lu ret %d pages_written %d pages_skipped %ld more_io %d no_nrwrite_index_update %d writeback_index %lu", |
332 | jbd2_dev_to_name(__entry->dev), | 325 | jbd2_dev_to_name(__entry->dev), |
333 | (unsigned long) __entry->ino, __entry->ret, | 326 | (unsigned long) __entry->ino, __entry->ret, |
334 | __entry->pages_written, __entry->pages_skipped, | 327 | __entry->pages_written, __entry->pages_skipped, |
335 | __entry->encountered_congestion, __entry->more_io, | 328 | __entry->more_io, |
336 | __entry->no_nrwrite_index_update, | 329 | __entry->no_nrwrite_index_update, |
337 | (unsigned long) __entry->writeback_index) | 330 | (unsigned long) __entry->writeback_index) |
338 | ); | 331 | ); |
339 | 332 | ||
340 | TRACE_EVENT(ext4_da_write_begin, | ||
341 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, | ||
342 | unsigned int flags), | ||
343 | |||
344 | TP_ARGS(inode, pos, len, flags), | ||
345 | |||
346 | TP_STRUCT__entry( | ||
347 | __field( dev_t, dev ) | ||
348 | __field( ino_t, ino ) | ||
349 | __field( loff_t, pos ) | ||
350 | __field( unsigned int, len ) | ||
351 | __field( unsigned int, flags ) | ||
352 | ), | ||
353 | |||
354 | TP_fast_assign( | ||
355 | __entry->dev = inode->i_sb->s_dev; | ||
356 | __entry->ino = inode->i_ino; | ||
357 | __entry->pos = pos; | ||
358 | __entry->len = len; | ||
359 | __entry->flags = flags; | ||
360 | ), | ||
361 | |||
362 | TP_printk("dev %s ino %lu pos %llu len %u flags %u", | ||
363 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, | ||
364 | __entry->pos, __entry->len, __entry->flags) | ||
365 | ); | ||
366 | |||
367 | TRACE_EVENT(ext4_da_write_end, | ||
368 | TP_PROTO(struct inode *inode, loff_t pos, unsigned int len, | ||
369 | unsigned int copied), | ||
370 | |||
371 | TP_ARGS(inode, pos, len, copied), | ||
372 | |||
373 | TP_STRUCT__entry( | ||
374 | __field( dev_t, dev ) | ||
375 | __field( ino_t, ino ) | ||
376 | __field( loff_t, pos ) | ||
377 | __field( unsigned int, len ) | ||
378 | __field( unsigned int, copied ) | ||
379 | ), | ||
380 | |||
381 | TP_fast_assign( | ||
382 | __entry->dev = inode->i_sb->s_dev; | ||
383 | __entry->ino = inode->i_ino; | ||
384 | __entry->pos = pos; | ||
385 | __entry->len = len; | ||
386 | __entry->copied = copied; | ||
387 | ), | ||
388 | |||
389 | TP_printk("dev %s ino %lu pos %llu len %u copied %u", | ||
390 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, | ||
391 | __entry->pos, __entry->len, __entry->copied) | ||
392 | ); | ||
393 | |||
394 | TRACE_EVENT(ext4_discard_blocks, | 333 | TRACE_EVENT(ext4_discard_blocks, |
395 | TP_PROTO(struct super_block *sb, unsigned long long blk, | 334 | TP_PROTO(struct super_block *sb, unsigned long long blk, |
396 | unsigned long long count), | 335 | unsigned long long count), |
@@ -650,30 +589,32 @@ TRACE_EVENT(ext4_allocate_blocks, | |||
650 | 589 | ||
651 | TRACE_EVENT(ext4_free_blocks, | 590 | TRACE_EVENT(ext4_free_blocks, |
652 | TP_PROTO(struct inode *inode, __u64 block, unsigned long count, | 591 | TP_PROTO(struct inode *inode, __u64 block, unsigned long count, |
653 | int metadata), | 592 | int flags), |
654 | 593 | ||
655 | TP_ARGS(inode, block, count, metadata), | 594 | TP_ARGS(inode, block, count, flags), |
656 | 595 | ||
657 | TP_STRUCT__entry( | 596 | TP_STRUCT__entry( |
658 | __field( dev_t, dev ) | 597 | __field( dev_t, dev ) |
659 | __field( ino_t, ino ) | 598 | __field( ino_t, ino ) |
599 | __field( umode_t, mode ) | ||
660 | __field( __u64, block ) | 600 | __field( __u64, block ) |
661 | __field( unsigned long, count ) | 601 | __field( unsigned long, count ) |
662 | __field( int, metadata ) | 602 | __field( int, flags ) |
663 | |||
664 | ), | 603 | ), |
665 | 604 | ||
666 | TP_fast_assign( | 605 | TP_fast_assign( |
667 | __entry->dev = inode->i_sb->s_dev; | 606 | __entry->dev = inode->i_sb->s_dev; |
668 | __entry->ino = inode->i_ino; | 607 | __entry->ino = inode->i_ino; |
608 | __entry->mode = inode->i_mode; | ||
669 | __entry->block = block; | 609 | __entry->block = block; |
670 | __entry->count = count; | 610 | __entry->count = count; |
671 | __entry->metadata = metadata; | 611 | __entry->flags = flags; |
672 | ), | 612 | ), |
673 | 613 | ||
674 | TP_printk("dev %s ino %lu block %llu count %lu metadata %d", | 614 | TP_printk("dev %s ino %lu mode 0%o block %llu count %lu flags %d", |
675 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, | 615 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, |
676 | __entry->block, __entry->count, __entry->metadata) | 616 | __entry->mode, __entry->block, __entry->count, |
617 | __entry->flags) | ||
677 | ); | 618 | ); |
678 | 619 | ||
679 | TRACE_EVENT(ext4_sync_file, | 620 | TRACE_EVENT(ext4_sync_file, |
@@ -907,6 +848,32 @@ TRACE_EVENT(ext4_mballoc_free, | |||
907 | __entry->result_len, __entry->result_logical) | 848 | __entry->result_len, __entry->result_logical) |
908 | ); | 849 | ); |
909 | 850 | ||
851 | TRACE_EVENT(ext4_forget, | ||
852 | TP_PROTO(struct inode *inode, int is_metadata, __u64 block), | ||
853 | |||
854 | TP_ARGS(inode, is_metadata, block), | ||
855 | |||
856 | TP_STRUCT__entry( | ||
857 | __field( dev_t, dev ) | ||
858 | __field( ino_t, ino ) | ||
859 | __field( umode_t, mode ) | ||
860 | __field( int, is_metadata ) | ||
861 | __field( __u64, block ) | ||
862 | ), | ||
863 | |||
864 | TP_fast_assign( | ||
865 | __entry->dev = inode->i_sb->s_dev; | ||
866 | __entry->ino = inode->i_ino; | ||
867 | __entry->mode = inode->i_mode; | ||
868 | __entry->is_metadata = is_metadata; | ||
869 | __entry->block = block; | ||
870 | ), | ||
871 | |||
872 | TP_printk("dev %s ino %lu mode 0%o is_metadata %d block %llu", | ||
873 | jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino, | ||
874 | __entry->mode, __entry->is_metadata, __entry->block) | ||
875 | ); | ||
876 | |||
910 | #endif /* _TRACE_EXT4_H */ | 877 | #endif /* _TRACE_EXT4_H */ |
911 | 878 | ||
912 | /* This part must be outside protection */ | 879 | /* This part must be outside protection */ |
diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h index b89f9db4a404..0e4cfb694fe7 100644 --- a/include/trace/events/irq.h +++ b/include/trace/events/irq.h | |||
@@ -48,7 +48,7 @@ TRACE_EVENT(irq_handler_entry, | |||
48 | __assign_str(name, action->name); | 48 | __assign_str(name, action->name); |
49 | ), | 49 | ), |
50 | 50 | ||
51 | TP_printk("irq=%d handler=%s", __entry->irq, __get_str(name)) | 51 | TP_printk("irq=%d name=%s", __entry->irq, __get_str(name)) |
52 | ); | 52 | ); |
53 | 53 | ||
54 | /** | 54 | /** |
@@ -78,22 +78,11 @@ TRACE_EVENT(irq_handler_exit, | |||
78 | __entry->ret = ret; | 78 | __entry->ret = ret; |
79 | ), | 79 | ), |
80 | 80 | ||
81 | TP_printk("irq=%d return=%s", | 81 | TP_printk("irq=%d ret=%s", |
82 | __entry->irq, __entry->ret ? "handled" : "unhandled") | 82 | __entry->irq, __entry->ret ? "handled" : "unhandled") |
83 | ); | 83 | ); |
84 | 84 | ||
85 | /** | 85 | DECLARE_EVENT_CLASS(softirq, |
86 | * softirq_entry - called immediately before the softirq handler | ||
87 | * @h: pointer to struct softirq_action | ||
88 | * @vec: pointer to first struct softirq_action in softirq_vec array | ||
89 | * | ||
90 | * The @h parameter, contains a pointer to the struct softirq_action | ||
91 | * which has a pointer to the action handler that is called. By subtracting | ||
92 | * the @vec pointer from the @h pointer, we can determine the softirq | ||
93 | * number. Also, when used in combination with the softirq_exit tracepoint | ||
94 | * we can determine the softirq latency. | ||
95 | */ | ||
96 | TRACE_EVENT(softirq_entry, | ||
97 | 86 | ||
98 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), | 87 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), |
99 | 88 | ||
@@ -107,11 +96,29 @@ TRACE_EVENT(softirq_entry, | |||
107 | __entry->vec = (int)(h - vec); | 96 | __entry->vec = (int)(h - vec); |
108 | ), | 97 | ), |
109 | 98 | ||
110 | TP_printk("softirq=%d action=%s", __entry->vec, | 99 | TP_printk("vec=%d [action=%s]", __entry->vec, |
111 | show_softirq_name(__entry->vec)) | 100 | show_softirq_name(__entry->vec)) |
112 | ); | 101 | ); |
113 | 102 | ||
114 | /** | 103 | /** |
104 | * softirq_entry - called immediately before the softirq handler | ||
105 | * @h: pointer to struct softirq_action | ||
106 | * @vec: pointer to first struct softirq_action in softirq_vec array | ||
107 | * | ||
108 | * The @h parameter, contains a pointer to the struct softirq_action | ||
109 | * which has a pointer to the action handler that is called. By subtracting | ||
110 | * the @vec pointer from the @h pointer, we can determine the softirq | ||
111 | * number. Also, when used in combination with the softirq_exit tracepoint | ||
112 | * we can determine the softirq latency. | ||
113 | */ | ||
114 | DEFINE_EVENT(softirq, softirq_entry, | ||
115 | |||
116 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), | ||
117 | |||
118 | TP_ARGS(h, vec) | ||
119 | ); | ||
120 | |||
121 | /** | ||
115 | * softirq_exit - called immediately after the softirq handler returns | 122 | * softirq_exit - called immediately after the softirq handler returns |
116 | * @h: pointer to struct softirq_action | 123 | * @h: pointer to struct softirq_action |
117 | * @vec: pointer to first struct softirq_action in softirq_vec array | 124 | * @vec: pointer to first struct softirq_action in softirq_vec array |
@@ -122,22 +129,11 @@ TRACE_EVENT(softirq_entry, | |||
122 | * combination with the softirq_entry tracepoint we can determine the softirq | 129 | * combination with the softirq_entry tracepoint we can determine the softirq |
123 | * latency. | 130 | * latency. |
124 | */ | 131 | */ |
125 | TRACE_EVENT(softirq_exit, | 132 | DEFINE_EVENT(softirq, softirq_exit, |
126 | 133 | ||
127 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), | 134 | TP_PROTO(struct softirq_action *h, struct softirq_action *vec), |
128 | 135 | ||
129 | TP_ARGS(h, vec), | 136 | TP_ARGS(h, vec) |
130 | |||
131 | TP_STRUCT__entry( | ||
132 | __field( int, vec ) | ||
133 | ), | ||
134 | |||
135 | TP_fast_assign( | ||
136 | __entry->vec = (int)(h - vec); | ||
137 | ), | ||
138 | |||
139 | TP_printk("softirq=%d action=%s", __entry->vec, | ||
140 | show_softirq_name(__entry->vec)) | ||
141 | ); | 137 | ); |
142 | 138 | ||
143 | #endif /* _TRACE_IRQ_H */ | 139 | #endif /* _TRACE_IRQ_H */ |
diff --git a/include/trace/events/jbd2.h b/include/trace/events/jbd2.h index 3c60b75adb9e..96b370a050de 100644 --- a/include/trace/events/jbd2.h +++ b/include/trace/events/jbd2.h | |||
@@ -30,7 +30,7 @@ TRACE_EVENT(jbd2_checkpoint, | |||
30 | jbd2_dev_to_name(__entry->dev), __entry->result) | 30 | jbd2_dev_to_name(__entry->dev), __entry->result) |
31 | ); | 31 | ); |
32 | 32 | ||
33 | TRACE_EVENT(jbd2_start_commit, | 33 | DECLARE_EVENT_CLASS(jbd2_commit, |
34 | 34 | ||
35 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), | 35 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
36 | 36 | ||
@@ -53,73 +53,32 @@ TRACE_EVENT(jbd2_start_commit, | |||
53 | __entry->sync_commit) | 53 | __entry->sync_commit) |
54 | ); | 54 | ); |
55 | 55 | ||
56 | TRACE_EVENT(jbd2_commit_locking, | 56 | DEFINE_EVENT(jbd2_commit, jbd2_start_commit, |
57 | 57 | ||
58 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), | 58 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
59 | 59 | ||
60 | TP_ARGS(journal, commit_transaction), | 60 | TP_ARGS(journal, commit_transaction) |
61 | |||
62 | TP_STRUCT__entry( | ||
63 | __field( dev_t, dev ) | ||
64 | __field( char, sync_commit ) | ||
65 | __field( int, transaction ) | ||
66 | ), | ||
67 | |||
68 | TP_fast_assign( | ||
69 | __entry->dev = journal->j_fs_dev->bd_dev; | ||
70 | __entry->sync_commit = commit_transaction->t_synchronous_commit; | ||
71 | __entry->transaction = commit_transaction->t_tid; | ||
72 | ), | ||
73 | |||
74 | TP_printk("dev %s transaction %d sync %d", | ||
75 | jbd2_dev_to_name(__entry->dev), __entry->transaction, | ||
76 | __entry->sync_commit) | ||
77 | ); | 61 | ); |
78 | 62 | ||
79 | TRACE_EVENT(jbd2_commit_flushing, | 63 | DEFINE_EVENT(jbd2_commit, jbd2_commit_locking, |
80 | 64 | ||
81 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), | 65 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
82 | 66 | ||
83 | TP_ARGS(journal, commit_transaction), | 67 | TP_ARGS(journal, commit_transaction) |
84 | |||
85 | TP_STRUCT__entry( | ||
86 | __field( dev_t, dev ) | ||
87 | __field( char, sync_commit ) | ||
88 | __field( int, transaction ) | ||
89 | ), | ||
90 | |||
91 | TP_fast_assign( | ||
92 | __entry->dev = journal->j_fs_dev->bd_dev; | ||
93 | __entry->sync_commit = commit_transaction->t_synchronous_commit; | ||
94 | __entry->transaction = commit_transaction->t_tid; | ||
95 | ), | ||
96 | |||
97 | TP_printk("dev %s transaction %d sync %d", | ||
98 | jbd2_dev_to_name(__entry->dev), __entry->transaction, | ||
99 | __entry->sync_commit) | ||
100 | ); | 68 | ); |
101 | 69 | ||
102 | TRACE_EVENT(jbd2_commit_logging, | 70 | DEFINE_EVENT(jbd2_commit, jbd2_commit_flushing, |
103 | 71 | ||
104 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), | 72 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
105 | 73 | ||
106 | TP_ARGS(journal, commit_transaction), | 74 | TP_ARGS(journal, commit_transaction) |
75 | ); | ||
107 | 76 | ||
108 | TP_STRUCT__entry( | 77 | DEFINE_EVENT(jbd2_commit, jbd2_commit_logging, |
109 | __field( dev_t, dev ) | ||
110 | __field( char, sync_commit ) | ||
111 | __field( int, transaction ) | ||
112 | ), | ||
113 | 78 | ||
114 | TP_fast_assign( | 79 | TP_PROTO(journal_t *journal, transaction_t *commit_transaction), |
115 | __entry->dev = journal->j_fs_dev->bd_dev; | ||
116 | __entry->sync_commit = commit_transaction->t_synchronous_commit; | ||
117 | __entry->transaction = commit_transaction->t_tid; | ||
118 | ), | ||
119 | 80 | ||
120 | TP_printk("dev %s transaction %d sync %d", | 81 | TP_ARGS(journal, commit_transaction) |
121 | jbd2_dev_to_name(__entry->dev), __entry->transaction, | ||
122 | __entry->sync_commit) | ||
123 | ); | 82 | ); |
124 | 83 | ||
125 | TRACE_EVENT(jbd2_end_commit, | 84 | TRACE_EVENT(jbd2_end_commit, |
diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h index eaf46bdd18a5..3adca0ca9dbe 100644 --- a/include/trace/events/kmem.h +++ b/include/trace/events/kmem.h | |||
@@ -44,7 +44,7 @@ | |||
44 | {(unsigned long)__GFP_MOVABLE, "GFP_MOVABLE"} \ | 44 | {(unsigned long)__GFP_MOVABLE, "GFP_MOVABLE"} \ |
45 | ) : "GFP_NOWAIT" | 45 | ) : "GFP_NOWAIT" |
46 | 46 | ||
47 | TRACE_EVENT(kmalloc, | 47 | DECLARE_EVENT_CLASS(kmem_alloc, |
48 | 48 | ||
49 | TP_PROTO(unsigned long call_site, | 49 | TP_PROTO(unsigned long call_site, |
50 | const void *ptr, | 50 | const void *ptr, |
@@ -78,41 +78,23 @@ TRACE_EVENT(kmalloc, | |||
78 | show_gfp_flags(__entry->gfp_flags)) | 78 | show_gfp_flags(__entry->gfp_flags)) |
79 | ); | 79 | ); |
80 | 80 | ||
81 | TRACE_EVENT(kmem_cache_alloc, | 81 | DEFINE_EVENT(kmem_alloc, kmalloc, |
82 | 82 | ||
83 | TP_PROTO(unsigned long call_site, | 83 | TP_PROTO(unsigned long call_site, const void *ptr, |
84 | const void *ptr, | 84 | size_t bytes_req, size_t bytes_alloc, gfp_t gfp_flags), |
85 | size_t bytes_req, | ||
86 | size_t bytes_alloc, | ||
87 | gfp_t gfp_flags), | ||
88 | 85 | ||
89 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags), | 86 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags) |
87 | ); | ||
90 | 88 | ||
91 | TP_STRUCT__entry( | 89 | DEFINE_EVENT(kmem_alloc, kmem_cache_alloc, |
92 | __field( unsigned long, call_site ) | ||
93 | __field( const void *, ptr ) | ||
94 | __field( size_t, bytes_req ) | ||
95 | __field( size_t, bytes_alloc ) | ||
96 | __field( gfp_t, gfp_flags ) | ||
97 | ), | ||
98 | 90 | ||
99 | TP_fast_assign( | 91 | TP_PROTO(unsigned long call_site, const void *ptr, |
100 | __entry->call_site = call_site; | 92 | size_t bytes_req, size_t bytes_alloc, gfp_t gfp_flags), |
101 | __entry->ptr = ptr; | ||
102 | __entry->bytes_req = bytes_req; | ||
103 | __entry->bytes_alloc = bytes_alloc; | ||
104 | __entry->gfp_flags = gfp_flags; | ||
105 | ), | ||
106 | 93 | ||
107 | TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s", | 94 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags) |
108 | __entry->call_site, | ||
109 | __entry->ptr, | ||
110 | __entry->bytes_req, | ||
111 | __entry->bytes_alloc, | ||
112 | show_gfp_flags(__entry->gfp_flags)) | ||
113 | ); | 95 | ); |
114 | 96 | ||
115 | TRACE_EVENT(kmalloc_node, | 97 | DECLARE_EVENT_CLASS(kmem_alloc_node, |
116 | 98 | ||
117 | TP_PROTO(unsigned long call_site, | 99 | TP_PROTO(unsigned long call_site, |
118 | const void *ptr, | 100 | const void *ptr, |
@@ -150,45 +132,25 @@ TRACE_EVENT(kmalloc_node, | |||
150 | __entry->node) | 132 | __entry->node) |
151 | ); | 133 | ); |
152 | 134 | ||
153 | TRACE_EVENT(kmem_cache_alloc_node, | 135 | DEFINE_EVENT(kmem_alloc_node, kmalloc_node, |
154 | 136 | ||
155 | TP_PROTO(unsigned long call_site, | 137 | TP_PROTO(unsigned long call_site, const void *ptr, |
156 | const void *ptr, | 138 | size_t bytes_req, size_t bytes_alloc, |
157 | size_t bytes_req, | 139 | gfp_t gfp_flags, int node), |
158 | size_t bytes_alloc, | ||
159 | gfp_t gfp_flags, | ||
160 | int node), | ||
161 | 140 | ||
162 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node), | 141 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node) |
142 | ); | ||
163 | 143 | ||
164 | TP_STRUCT__entry( | 144 | DEFINE_EVENT(kmem_alloc_node, kmem_cache_alloc_node, |
165 | __field( unsigned long, call_site ) | ||
166 | __field( const void *, ptr ) | ||
167 | __field( size_t, bytes_req ) | ||
168 | __field( size_t, bytes_alloc ) | ||
169 | __field( gfp_t, gfp_flags ) | ||
170 | __field( int, node ) | ||
171 | ), | ||
172 | 145 | ||
173 | TP_fast_assign( | 146 | TP_PROTO(unsigned long call_site, const void *ptr, |
174 | __entry->call_site = call_site; | 147 | size_t bytes_req, size_t bytes_alloc, |
175 | __entry->ptr = ptr; | 148 | gfp_t gfp_flags, int node), |
176 | __entry->bytes_req = bytes_req; | ||
177 | __entry->bytes_alloc = bytes_alloc; | ||
178 | __entry->gfp_flags = gfp_flags; | ||
179 | __entry->node = node; | ||
180 | ), | ||
181 | 149 | ||
182 | TP_printk("call_site=%lx ptr=%p bytes_req=%zu bytes_alloc=%zu gfp_flags=%s node=%d", | 150 | TP_ARGS(call_site, ptr, bytes_req, bytes_alloc, gfp_flags, node) |
183 | __entry->call_site, | ||
184 | __entry->ptr, | ||
185 | __entry->bytes_req, | ||
186 | __entry->bytes_alloc, | ||
187 | show_gfp_flags(__entry->gfp_flags), | ||
188 | __entry->node) | ||
189 | ); | 151 | ); |
190 | 152 | ||
191 | TRACE_EVENT(kfree, | 153 | DECLARE_EVENT_CLASS(kmem_free, |
192 | 154 | ||
193 | TP_PROTO(unsigned long call_site, const void *ptr), | 155 | TP_PROTO(unsigned long call_site, const void *ptr), |
194 | 156 | ||
@@ -207,23 +169,18 @@ TRACE_EVENT(kfree, | |||
207 | TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr) | 169 | TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr) |
208 | ); | 170 | ); |
209 | 171 | ||
210 | TRACE_EVENT(kmem_cache_free, | 172 | DEFINE_EVENT(kmem_free, kfree, |
211 | 173 | ||
212 | TP_PROTO(unsigned long call_site, const void *ptr), | 174 | TP_PROTO(unsigned long call_site, const void *ptr), |
213 | 175 | ||
214 | TP_ARGS(call_site, ptr), | 176 | TP_ARGS(call_site, ptr) |
177 | ); | ||
215 | 178 | ||
216 | TP_STRUCT__entry( | 179 | DEFINE_EVENT(kmem_free, kmem_cache_free, |
217 | __field( unsigned long, call_site ) | ||
218 | __field( const void *, ptr ) | ||
219 | ), | ||
220 | 180 | ||
221 | TP_fast_assign( | 181 | TP_PROTO(unsigned long call_site, const void *ptr), |
222 | __entry->call_site = call_site; | ||
223 | __entry->ptr = ptr; | ||
224 | ), | ||
225 | 182 | ||
226 | TP_printk("call_site=%lx ptr=%p", __entry->call_site, __entry->ptr) | 183 | TP_ARGS(call_site, ptr) |
227 | ); | 184 | ); |
228 | 185 | ||
229 | TRACE_EVENT(mm_page_free_direct, | 186 | TRACE_EVENT(mm_page_free_direct, |
@@ -299,7 +256,7 @@ TRACE_EVENT(mm_page_alloc, | |||
299 | show_gfp_flags(__entry->gfp_flags)) | 256 | show_gfp_flags(__entry->gfp_flags)) |
300 | ); | 257 | ); |
301 | 258 | ||
302 | TRACE_EVENT(mm_page_alloc_zone_locked, | 259 | DECLARE_EVENT_CLASS(mm_page, |
303 | 260 | ||
304 | TP_PROTO(struct page *page, unsigned int order, int migratetype), | 261 | TP_PROTO(struct page *page, unsigned int order, int migratetype), |
305 | 262 | ||
@@ -325,29 +282,22 @@ TRACE_EVENT(mm_page_alloc_zone_locked, | |||
325 | __entry->order == 0) | 282 | __entry->order == 0) |
326 | ); | 283 | ); |
327 | 284 | ||
328 | TRACE_EVENT(mm_page_pcpu_drain, | 285 | DEFINE_EVENT(mm_page, mm_page_alloc_zone_locked, |
329 | 286 | ||
330 | TP_PROTO(struct page *page, int order, int migratetype), | 287 | TP_PROTO(struct page *page, unsigned int order, int migratetype), |
331 | 288 | ||
332 | TP_ARGS(page, order, migratetype), | 289 | TP_ARGS(page, order, migratetype) |
290 | ); | ||
333 | 291 | ||
334 | TP_STRUCT__entry( | 292 | DEFINE_EVENT_PRINT(mm_page, mm_page_pcpu_drain, |
335 | __field( struct page *, page ) | ||
336 | __field( int, order ) | ||
337 | __field( int, migratetype ) | ||
338 | ), | ||
339 | 293 | ||
340 | TP_fast_assign( | 294 | TP_PROTO(struct page *page, unsigned int order, int migratetype), |
341 | __entry->page = page; | 295 | |
342 | __entry->order = order; | 296 | TP_ARGS(page, order, migratetype), |
343 | __entry->migratetype = migratetype; | ||
344 | ), | ||
345 | 297 | ||
346 | TP_printk("page=%p pfn=%lu order=%d migratetype=%d", | 298 | TP_printk("page=%p pfn=%lu order=%d migratetype=%d", |
347 | __entry->page, | 299 | __entry->page, page_to_pfn(__entry->page), |
348 | page_to_pfn(__entry->page), | 300 | __entry->order, __entry->migratetype) |
349 | __entry->order, | ||
350 | __entry->migratetype) | ||
351 | ); | 301 | ); |
352 | 302 | ||
353 | TRACE_EVENT(mm_page_alloc_extfrag, | 303 | TRACE_EVENT(mm_page_alloc_extfrag, |
diff --git a/include/trace/events/lockdep.h b/include/trace/events/lock.h index bcf1d209a00d..a870ba125aa8 100644 --- a/include/trace/events/lockdep.h +++ b/include/trace/events/lock.h | |||
@@ -1,8 +1,8 @@ | |||
1 | #undef TRACE_SYSTEM | 1 | #undef TRACE_SYSTEM |
2 | #define TRACE_SYSTEM lockdep | 2 | #define TRACE_SYSTEM lock |
3 | 3 | ||
4 | #if !defined(_TRACE_LOCKDEP_H) || defined(TRACE_HEADER_MULTI_READ) | 4 | #if !defined(_TRACE_LOCK_H) || defined(TRACE_HEADER_MULTI_READ) |
5 | #define _TRACE_LOCKDEP_H | 5 | #define _TRACE_LOCK_H |
6 | 6 | ||
7 | #include <linux/lockdep.h> | 7 | #include <linux/lockdep.h> |
8 | #include <linux/tracepoint.h> | 8 | #include <linux/tracepoint.h> |
@@ -90,7 +90,7 @@ TRACE_EVENT(lock_acquired, | |||
90 | #endif | 90 | #endif |
91 | #endif | 91 | #endif |
92 | 92 | ||
93 | #endif /* _TRACE_LOCKDEP_H */ | 93 | #endif /* _TRACE_LOCK_H */ |
94 | 94 | ||
95 | /* This part must be outside protection */ | 95 | /* This part must be outside protection */ |
96 | #include <trace/define_trace.h> | 96 | #include <trace/define_trace.h> |
diff --git a/include/trace/events/mce.h b/include/trace/events/mce.h new file mode 100644 index 000000000000..7eee77895cb3 --- /dev/null +++ b/include/trace/events/mce.h | |||
@@ -0,0 +1,69 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM mce | ||
3 | |||
4 | #if !defined(_TRACE_MCE_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_MCE_H | ||
6 | |||
7 | #include <linux/ktime.h> | ||
8 | #include <linux/tracepoint.h> | ||
9 | #include <asm/mce.h> | ||
10 | |||
11 | TRACE_EVENT(mce_record, | ||
12 | |||
13 | TP_PROTO(struct mce *m), | ||
14 | |||
15 | TP_ARGS(m), | ||
16 | |||
17 | TP_STRUCT__entry( | ||
18 | __field( u64, mcgcap ) | ||
19 | __field( u64, mcgstatus ) | ||
20 | __field( u8, bank ) | ||
21 | __field( u64, status ) | ||
22 | __field( u64, addr ) | ||
23 | __field( u64, misc ) | ||
24 | __field( u64, ip ) | ||
25 | __field( u8, cs ) | ||
26 | __field( u64, tsc ) | ||
27 | __field( u64, walltime ) | ||
28 | __field( u32, cpu ) | ||
29 | __field( u32, cpuid ) | ||
30 | __field( u32, apicid ) | ||
31 | __field( u32, socketid ) | ||
32 | __field( u8, cpuvendor ) | ||
33 | ), | ||
34 | |||
35 | TP_fast_assign( | ||
36 | __entry->mcgcap = m->mcgcap; | ||
37 | __entry->mcgstatus = m->mcgstatus; | ||
38 | __entry->bank = m->bank; | ||
39 | __entry->status = m->status; | ||
40 | __entry->addr = m->addr; | ||
41 | __entry->misc = m->misc; | ||
42 | __entry->ip = m->ip; | ||
43 | __entry->cs = m->cs; | ||
44 | __entry->tsc = m->tsc; | ||
45 | __entry->walltime = m->time; | ||
46 | __entry->cpu = m->extcpu; | ||
47 | __entry->cpuid = m->cpuid; | ||
48 | __entry->apicid = m->apicid; | ||
49 | __entry->socketid = m->socketid; | ||
50 | __entry->cpuvendor = m->cpuvendor; | ||
51 | ), | ||
52 | |||
53 | TP_printk("CPU: %d, MCGc/s: %llx/%llx, MC%d: %016Lx, ADDR/MISC: %016Lx/%016Lx, RIP: %02x:<%016Lx>, TSC: %llx, PROCESSOR: %u:%x, TIME: %llu, SOCKET: %u, APIC: %x", | ||
54 | __entry->cpu, | ||
55 | __entry->mcgcap, __entry->mcgstatus, | ||
56 | __entry->bank, __entry->status, | ||
57 | __entry->addr, __entry->misc, | ||
58 | __entry->cs, __entry->ip, | ||
59 | __entry->tsc, | ||
60 | __entry->cpuvendor, __entry->cpuid, | ||
61 | __entry->walltime, | ||
62 | __entry->socketid, | ||
63 | __entry->apicid) | ||
64 | ); | ||
65 | |||
66 | #endif /* _TRACE_MCE_H */ | ||
67 | |||
68 | /* This part must be outside protection */ | ||
69 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/module.h b/include/trace/events/module.h index 84160fb18478..4b0f48ba16a6 100644 --- a/include/trace/events/module.h +++ b/include/trace/events/module.h | |||
@@ -51,7 +51,7 @@ TRACE_EVENT(module_free, | |||
51 | TP_printk("%s", __get_str(name)) | 51 | TP_printk("%s", __get_str(name)) |
52 | ); | 52 | ); |
53 | 53 | ||
54 | TRACE_EVENT(module_get, | 54 | DECLARE_EVENT_CLASS(module_refcnt, |
55 | 55 | ||
56 | TP_PROTO(struct module *mod, unsigned long ip, int refcnt), | 56 | TP_PROTO(struct module *mod, unsigned long ip, int refcnt), |
57 | 57 | ||
@@ -73,26 +73,18 @@ TRACE_EVENT(module_get, | |||
73 | __get_str(name), (void *)__entry->ip, __entry->refcnt) | 73 | __get_str(name), (void *)__entry->ip, __entry->refcnt) |
74 | ); | 74 | ); |
75 | 75 | ||
76 | TRACE_EVENT(module_put, | 76 | DEFINE_EVENT(module_refcnt, module_get, |
77 | 77 | ||
78 | TP_PROTO(struct module *mod, unsigned long ip, int refcnt), | 78 | TP_PROTO(struct module *mod, unsigned long ip, int refcnt), |
79 | 79 | ||
80 | TP_ARGS(mod, ip, refcnt), | 80 | TP_ARGS(mod, ip, refcnt) |
81 | ); | ||
81 | 82 | ||
82 | TP_STRUCT__entry( | 83 | DEFINE_EVENT(module_refcnt, module_put, |
83 | __field( unsigned long, ip ) | ||
84 | __field( int, refcnt ) | ||
85 | __string( name, mod->name ) | ||
86 | ), | ||
87 | 84 | ||
88 | TP_fast_assign( | 85 | TP_PROTO(struct module *mod, unsigned long ip, int refcnt), |
89 | __entry->ip = ip; | ||
90 | __entry->refcnt = refcnt; | ||
91 | __assign_str(name, mod->name); | ||
92 | ), | ||
93 | 86 | ||
94 | TP_printk("%s call_site=%pf refcnt=%d", | 87 | TP_ARGS(mod, ip, refcnt) |
95 | __get_str(name), (void *)__entry->ip, __entry->refcnt) | ||
96 | ); | 88 | ); |
97 | 89 | ||
98 | TRACE_EVENT(module_request, | 90 | TRACE_EVENT(module_request, |
diff --git a/include/trace/events/power.h b/include/trace/events/power.h index ea6d579261ad..c4efe9b8280d 100644 --- a/include/trace/events/power.h +++ b/include/trace/events/power.h | |||
@@ -16,9 +16,7 @@ enum { | |||
16 | }; | 16 | }; |
17 | #endif | 17 | #endif |
18 | 18 | ||
19 | 19 | DECLARE_EVENT_CLASS(power, | |
20 | |||
21 | TRACE_EVENT(power_start, | ||
22 | 20 | ||
23 | TP_PROTO(unsigned int type, unsigned int state), | 21 | TP_PROTO(unsigned int type, unsigned int state), |
24 | 22 | ||
@@ -37,42 +35,36 @@ TRACE_EVENT(power_start, | |||
37 | TP_printk("type=%lu state=%lu", (unsigned long)__entry->type, (unsigned long)__entry->state) | 35 | TP_printk("type=%lu state=%lu", (unsigned long)__entry->type, (unsigned long)__entry->state) |
38 | ); | 36 | ); |
39 | 37 | ||
40 | TRACE_EVENT(power_end, | 38 | DEFINE_EVENT(power, power_start, |
41 | |||
42 | TP_PROTO(int dummy), | ||
43 | 39 | ||
44 | TP_ARGS(dummy), | 40 | TP_PROTO(unsigned int type, unsigned int state), |
45 | 41 | ||
46 | TP_STRUCT__entry( | 42 | TP_ARGS(type, state) |
47 | __field( u64, dummy ) | 43 | ); |
48 | ), | ||
49 | 44 | ||
50 | TP_fast_assign( | 45 | DEFINE_EVENT(power, power_frequency, |
51 | __entry->dummy = 0xffff; | ||
52 | ), | ||
53 | 46 | ||
54 | TP_printk("dummy=%lu", (unsigned long)__entry->dummy) | 47 | TP_PROTO(unsigned int type, unsigned int state), |
55 | 48 | ||
49 | TP_ARGS(type, state) | ||
56 | ); | 50 | ); |
57 | 51 | ||
52 | TRACE_EVENT(power_end, | ||
58 | 53 | ||
59 | TRACE_EVENT(power_frequency, | 54 | TP_PROTO(int dummy), |
60 | |||
61 | TP_PROTO(unsigned int type, unsigned int state), | ||
62 | 55 | ||
63 | TP_ARGS(type, state), | 56 | TP_ARGS(dummy), |
64 | 57 | ||
65 | TP_STRUCT__entry( | 58 | TP_STRUCT__entry( |
66 | __field( u64, type ) | 59 | __field( u64, dummy ) |
67 | __field( u64, state ) | ||
68 | ), | 60 | ), |
69 | 61 | ||
70 | TP_fast_assign( | 62 | TP_fast_assign( |
71 | __entry->type = type; | 63 | __entry->dummy = 0xffff; |
72 | __entry->state = state; | ||
73 | ), | 64 | ), |
74 | 65 | ||
75 | TP_printk("type=%lu state=%lu", (unsigned long)__entry->type, (unsigned long) __entry->state) | 66 | TP_printk("dummy=%lu", (unsigned long)__entry->dummy) |
67 | |||
76 | ); | 68 | ); |
77 | 69 | ||
78 | #endif /* _TRACE_POWER_H */ | 70 | #endif /* _TRACE_POWER_H */ |
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h index 4069c43f4187..cfceb0b73e20 100644 --- a/include/trace/events/sched.h +++ b/include/trace/events/sched.h | |||
@@ -26,7 +26,7 @@ TRACE_EVENT(sched_kthread_stop, | |||
26 | __entry->pid = t->pid; | 26 | __entry->pid = t->pid; |
27 | ), | 27 | ), |
28 | 28 | ||
29 | TP_printk("task %s:%d", __entry->comm, __entry->pid) | 29 | TP_printk("comm=%s pid=%d", __entry->comm, __entry->pid) |
30 | ); | 30 | ); |
31 | 31 | ||
32 | /* | 32 | /* |
@@ -46,7 +46,7 @@ TRACE_EVENT(sched_kthread_stop_ret, | |||
46 | __entry->ret = ret; | 46 | __entry->ret = ret; |
47 | ), | 47 | ), |
48 | 48 | ||
49 | TP_printk("ret %d", __entry->ret) | 49 | TP_printk("ret=%d", __entry->ret) |
50 | ); | 50 | ); |
51 | 51 | ||
52 | /* | 52 | /* |
@@ -73,7 +73,7 @@ TRACE_EVENT(sched_wait_task, | |||
73 | __entry->prio = p->prio; | 73 | __entry->prio = p->prio; |
74 | ), | 74 | ), |
75 | 75 | ||
76 | TP_printk("task %s:%d [%d]", | 76 | TP_printk("comm=%s pid=%d prio=%d", |
77 | __entry->comm, __entry->pid, __entry->prio) | 77 | __entry->comm, __entry->pid, __entry->prio) |
78 | ); | 78 | ); |
79 | 79 | ||
@@ -83,7 +83,7 @@ TRACE_EVENT(sched_wait_task, | |||
83 | * (NOTE: the 'rq' argument is not used by generic trace events, | 83 | * (NOTE: the 'rq' argument is not used by generic trace events, |
84 | * but used by the latency tracer plugin. ) | 84 | * but used by the latency tracer plugin. ) |
85 | */ | 85 | */ |
86 | TRACE_EVENT(sched_wakeup, | 86 | DECLARE_EVENT_CLASS(sched_wakeup_template, |
87 | 87 | ||
88 | TP_PROTO(struct rq *rq, struct task_struct *p, int success), | 88 | TP_PROTO(struct rq *rq, struct task_struct *p, int success), |
89 | 89 | ||
@@ -94,7 +94,7 @@ TRACE_EVENT(sched_wakeup, | |||
94 | __field( pid_t, pid ) | 94 | __field( pid_t, pid ) |
95 | __field( int, prio ) | 95 | __field( int, prio ) |
96 | __field( int, success ) | 96 | __field( int, success ) |
97 | __field( int, cpu ) | 97 | __field( int, target_cpu ) |
98 | ), | 98 | ), |
99 | 99 | ||
100 | TP_fast_assign( | 100 | TP_fast_assign( |
@@ -102,46 +102,27 @@ TRACE_EVENT(sched_wakeup, | |||
102 | __entry->pid = p->pid; | 102 | __entry->pid = p->pid; |
103 | __entry->prio = p->prio; | 103 | __entry->prio = p->prio; |
104 | __entry->success = success; | 104 | __entry->success = success; |
105 | __entry->cpu = task_cpu(p); | 105 | __entry->target_cpu = task_cpu(p); |
106 | ), | 106 | ), |
107 | 107 | ||
108 | TP_printk("task %s:%d [%d] success=%d [%03d]", | 108 | TP_printk("comm=%s pid=%d prio=%d success=%d target_cpu=%03d", |
109 | __entry->comm, __entry->pid, __entry->prio, | 109 | __entry->comm, __entry->pid, __entry->prio, |
110 | __entry->success, __entry->cpu) | 110 | __entry->success, __entry->target_cpu) |
111 | ); | 111 | ); |
112 | 112 | ||
113 | DEFINE_EVENT(sched_wakeup_template, sched_wakeup, | ||
114 | TP_PROTO(struct rq *rq, struct task_struct *p, int success), | ||
115 | TP_ARGS(rq, p, success)); | ||
116 | |||
113 | /* | 117 | /* |
114 | * Tracepoint for waking up a new task: | 118 | * Tracepoint for waking up a new task: |
115 | * | 119 | * |
116 | * (NOTE: the 'rq' argument is not used by generic trace events, | 120 | * (NOTE: the 'rq' argument is not used by generic trace events, |
117 | * but used by the latency tracer plugin. ) | 121 | * but used by the latency tracer plugin. ) |
118 | */ | 122 | */ |
119 | TRACE_EVENT(sched_wakeup_new, | 123 | DEFINE_EVENT(sched_wakeup_template, sched_wakeup_new, |
120 | 124 | TP_PROTO(struct rq *rq, struct task_struct *p, int success), | |
121 | TP_PROTO(struct rq *rq, struct task_struct *p, int success), | 125 | TP_ARGS(rq, p, success)); |
122 | |||
123 | TP_ARGS(rq, p, success), | ||
124 | |||
125 | TP_STRUCT__entry( | ||
126 | __array( char, comm, TASK_COMM_LEN ) | ||
127 | __field( pid_t, pid ) | ||
128 | __field( int, prio ) | ||
129 | __field( int, success ) | ||
130 | __field( int, cpu ) | ||
131 | ), | ||
132 | |||
133 | TP_fast_assign( | ||
134 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); | ||
135 | __entry->pid = p->pid; | ||
136 | __entry->prio = p->prio; | ||
137 | __entry->success = success; | ||
138 | __entry->cpu = task_cpu(p); | ||
139 | ), | ||
140 | |||
141 | TP_printk("task %s:%d [%d] success=%d [%03d]", | ||
142 | __entry->comm, __entry->pid, __entry->prio, | ||
143 | __entry->success, __entry->cpu) | ||
144 | ); | ||
145 | 126 | ||
146 | /* | 127 | /* |
147 | * Tracepoint for task switches, performed by the scheduler: | 128 | * Tracepoint for task switches, performed by the scheduler: |
@@ -176,7 +157,7 @@ TRACE_EVENT(sched_switch, | |||
176 | __entry->next_prio = next->prio; | 157 | __entry->next_prio = next->prio; |
177 | ), | 158 | ), |
178 | 159 | ||
179 | TP_printk("task %s:%d [%d] (%s) ==> %s:%d [%d]", | 160 | TP_printk("prev_comm=%s prev_pid=%d prev_prio=%d prev_state=%s ==> next_comm=%s next_pid=%d next_prio=%d", |
180 | __entry->prev_comm, __entry->prev_pid, __entry->prev_prio, | 161 | __entry->prev_comm, __entry->prev_pid, __entry->prev_prio, |
181 | __entry->prev_state ? | 162 | __entry->prev_state ? |
182 | __print_flags(__entry->prev_state, "|", | 163 | __print_flags(__entry->prev_state, "|", |
@@ -211,15 +192,12 @@ TRACE_EVENT(sched_migrate_task, | |||
211 | __entry->dest_cpu = dest_cpu; | 192 | __entry->dest_cpu = dest_cpu; |
212 | ), | 193 | ), |
213 | 194 | ||
214 | TP_printk("task %s:%d [%d] from: %d to: %d", | 195 | TP_printk("comm=%s pid=%d prio=%d orig_cpu=%d dest_cpu=%d", |
215 | __entry->comm, __entry->pid, __entry->prio, | 196 | __entry->comm, __entry->pid, __entry->prio, |
216 | __entry->orig_cpu, __entry->dest_cpu) | 197 | __entry->orig_cpu, __entry->dest_cpu) |
217 | ); | 198 | ); |
218 | 199 | ||
219 | /* | 200 | DECLARE_EVENT_CLASS(sched_process_template, |
220 | * Tracepoint for freeing a task: | ||
221 | */ | ||
222 | TRACE_EVENT(sched_process_free, | ||
223 | 201 | ||
224 | TP_PROTO(struct task_struct *p), | 202 | TP_PROTO(struct task_struct *p), |
225 | 203 | ||
@@ -237,34 +215,24 @@ TRACE_EVENT(sched_process_free, | |||
237 | __entry->prio = p->prio; | 215 | __entry->prio = p->prio; |
238 | ), | 216 | ), |
239 | 217 | ||
240 | TP_printk("task %s:%d [%d]", | 218 | TP_printk("comm=%s pid=%d prio=%d", |
241 | __entry->comm, __entry->pid, __entry->prio) | 219 | __entry->comm, __entry->pid, __entry->prio) |
242 | ); | 220 | ); |
243 | 221 | ||
244 | /* | 222 | /* |
245 | * Tracepoint for a task exiting: | 223 | * Tracepoint for freeing a task: |
246 | */ | 224 | */ |
247 | TRACE_EVENT(sched_process_exit, | 225 | DEFINE_EVENT(sched_process_template, sched_process_free, |
226 | TP_PROTO(struct task_struct *p), | ||
227 | TP_ARGS(p)); | ||
228 | |||
248 | 229 | ||
249 | TP_PROTO(struct task_struct *p), | 230 | /* |
250 | 231 | * Tracepoint for a task exiting: | |
251 | TP_ARGS(p), | 232 | */ |
252 | 233 | DEFINE_EVENT(sched_process_template, sched_process_exit, | |
253 | TP_STRUCT__entry( | 234 | TP_PROTO(struct task_struct *p), |
254 | __array( char, comm, TASK_COMM_LEN ) | 235 | TP_ARGS(p)); |
255 | __field( pid_t, pid ) | ||
256 | __field( int, prio ) | ||
257 | ), | ||
258 | |||
259 | TP_fast_assign( | ||
260 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); | ||
261 | __entry->pid = p->pid; | ||
262 | __entry->prio = p->prio; | ||
263 | ), | ||
264 | |||
265 | TP_printk("task %s:%d [%d]", | ||
266 | __entry->comm, __entry->pid, __entry->prio) | ||
267 | ); | ||
268 | 236 | ||
269 | /* | 237 | /* |
270 | * Tracepoint for a waiting task: | 238 | * Tracepoint for a waiting task: |
@@ -287,7 +255,7 @@ TRACE_EVENT(sched_process_wait, | |||
287 | __entry->prio = current->prio; | 255 | __entry->prio = current->prio; |
288 | ), | 256 | ), |
289 | 257 | ||
290 | TP_printk("task %s:%d [%d]", | 258 | TP_printk("comm=%s pid=%d prio=%d", |
291 | __entry->comm, __entry->pid, __entry->prio) | 259 | __entry->comm, __entry->pid, __entry->prio) |
292 | ); | 260 | ); |
293 | 261 | ||
@@ -314,46 +282,16 @@ TRACE_EVENT(sched_process_fork, | |||
314 | __entry->child_pid = child->pid; | 282 | __entry->child_pid = child->pid; |
315 | ), | 283 | ), |
316 | 284 | ||
317 | TP_printk("parent %s:%d child %s:%d", | 285 | TP_printk("comm=%s pid=%d child_comm=%s child_pid=%d", |
318 | __entry->parent_comm, __entry->parent_pid, | 286 | __entry->parent_comm, __entry->parent_pid, |
319 | __entry->child_comm, __entry->child_pid) | 287 | __entry->child_comm, __entry->child_pid) |
320 | ); | 288 | ); |
321 | 289 | ||
322 | /* | 290 | /* |
323 | * Tracepoint for sending a signal: | ||
324 | */ | ||
325 | TRACE_EVENT(sched_signal_send, | ||
326 | |||
327 | TP_PROTO(int sig, struct task_struct *p), | ||
328 | |||
329 | TP_ARGS(sig, p), | ||
330 | |||
331 | TP_STRUCT__entry( | ||
332 | __field( int, sig ) | ||
333 | __array( char, comm, TASK_COMM_LEN ) | ||
334 | __field( pid_t, pid ) | ||
335 | ), | ||
336 | |||
337 | TP_fast_assign( | ||
338 | memcpy(__entry->comm, p->comm, TASK_COMM_LEN); | ||
339 | __entry->pid = p->pid; | ||
340 | __entry->sig = sig; | ||
341 | ), | ||
342 | |||
343 | TP_printk("sig: %d task %s:%d", | ||
344 | __entry->sig, __entry->comm, __entry->pid) | ||
345 | ); | ||
346 | |||
347 | /* | ||
348 | * XXX the below sched_stat tracepoints only apply to SCHED_OTHER/BATCH/IDLE | 291 | * XXX the below sched_stat tracepoints only apply to SCHED_OTHER/BATCH/IDLE |
349 | * adding sched_stat support to SCHED_FIFO/RR would be welcome. | 292 | * adding sched_stat support to SCHED_FIFO/RR would be welcome. |
350 | */ | 293 | */ |
351 | 294 | DECLARE_EVENT_CLASS(sched_stat_template, | |
352 | /* | ||
353 | * Tracepoint for accounting wait time (time the task is runnable | ||
354 | * but not actually running due to scheduler contention). | ||
355 | */ | ||
356 | TRACE_EVENT(sched_stat_wait, | ||
357 | 295 | ||
358 | TP_PROTO(struct task_struct *tsk, u64 delay), | 296 | TP_PROTO(struct task_struct *tsk, u64 delay), |
359 | 297 | ||
@@ -374,11 +312,36 @@ TRACE_EVENT(sched_stat_wait, | |||
374 | __perf_count(delay); | 312 | __perf_count(delay); |
375 | ), | 313 | ), |
376 | 314 | ||
377 | TP_printk("task: %s:%d wait: %Lu [ns]", | 315 | TP_printk("comm=%s pid=%d delay=%Lu [ns]", |
378 | __entry->comm, __entry->pid, | 316 | __entry->comm, __entry->pid, |
379 | (unsigned long long)__entry->delay) | 317 | (unsigned long long)__entry->delay) |
380 | ); | 318 | ); |
381 | 319 | ||
320 | |||
321 | /* | ||
322 | * Tracepoint for accounting wait time (time the task is runnable | ||
323 | * but not actually running due to scheduler contention). | ||
324 | */ | ||
325 | DEFINE_EVENT(sched_stat_template, sched_stat_wait, | ||
326 | TP_PROTO(struct task_struct *tsk, u64 delay), | ||
327 | TP_ARGS(tsk, delay)); | ||
328 | |||
329 | /* | ||
330 | * Tracepoint for accounting sleep time (time the task is not runnable, | ||
331 | * including iowait, see below). | ||
332 | */ | ||
333 | DEFINE_EVENT(sched_stat_template, sched_stat_sleep, | ||
334 | TP_PROTO(struct task_struct *tsk, u64 delay), | ||
335 | TP_ARGS(tsk, delay)); | ||
336 | |||
337 | /* | ||
338 | * Tracepoint for accounting iowait time (time the task is not runnable | ||
339 | * due to waiting on IO to complete). | ||
340 | */ | ||
341 | DEFINE_EVENT(sched_stat_template, sched_stat_iowait, | ||
342 | TP_PROTO(struct task_struct *tsk, u64 delay), | ||
343 | TP_ARGS(tsk, delay)); | ||
344 | |||
382 | /* | 345 | /* |
383 | * Tracepoint for accounting runtime (time the task is executing | 346 | * Tracepoint for accounting runtime (time the task is executing |
384 | * on a CPU). | 347 | * on a CPU). |
@@ -406,72 +369,12 @@ TRACE_EVENT(sched_stat_runtime, | |||
406 | __perf_count(runtime); | 369 | __perf_count(runtime); |
407 | ), | 370 | ), |
408 | 371 | ||
409 | TP_printk("task: %s:%d runtime: %Lu [ns], vruntime: %Lu [ns]", | 372 | TP_printk("comm=%s pid=%d runtime=%Lu [ns] vruntime=%Lu [ns]", |
410 | __entry->comm, __entry->pid, | 373 | __entry->comm, __entry->pid, |
411 | (unsigned long long)__entry->runtime, | 374 | (unsigned long long)__entry->runtime, |
412 | (unsigned long long)__entry->vruntime) | 375 | (unsigned long long)__entry->vruntime) |
413 | ); | 376 | ); |
414 | 377 | ||
415 | /* | ||
416 | * Tracepoint for accounting sleep time (time the task is not runnable, | ||
417 | * including iowait, see below). | ||
418 | */ | ||
419 | TRACE_EVENT(sched_stat_sleep, | ||
420 | |||
421 | TP_PROTO(struct task_struct *tsk, u64 delay), | ||
422 | |||
423 | TP_ARGS(tsk, delay), | ||
424 | |||
425 | TP_STRUCT__entry( | ||
426 | __array( char, comm, TASK_COMM_LEN ) | ||
427 | __field( pid_t, pid ) | ||
428 | __field( u64, delay ) | ||
429 | ), | ||
430 | |||
431 | TP_fast_assign( | ||
432 | memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN); | ||
433 | __entry->pid = tsk->pid; | ||
434 | __entry->delay = delay; | ||
435 | ) | ||
436 | TP_perf_assign( | ||
437 | __perf_count(delay); | ||
438 | ), | ||
439 | |||
440 | TP_printk("task: %s:%d sleep: %Lu [ns]", | ||
441 | __entry->comm, __entry->pid, | ||
442 | (unsigned long long)__entry->delay) | ||
443 | ); | ||
444 | |||
445 | /* | ||
446 | * Tracepoint for accounting iowait time (time the task is not runnable | ||
447 | * due to waiting on IO to complete). | ||
448 | */ | ||
449 | TRACE_EVENT(sched_stat_iowait, | ||
450 | |||
451 | TP_PROTO(struct task_struct *tsk, u64 delay), | ||
452 | |||
453 | TP_ARGS(tsk, delay), | ||
454 | |||
455 | TP_STRUCT__entry( | ||
456 | __array( char, comm, TASK_COMM_LEN ) | ||
457 | __field( pid_t, pid ) | ||
458 | __field( u64, delay ) | ||
459 | ), | ||
460 | |||
461 | TP_fast_assign( | ||
462 | memcpy(__entry->comm, tsk->comm, TASK_COMM_LEN); | ||
463 | __entry->pid = tsk->pid; | ||
464 | __entry->delay = delay; | ||
465 | ) | ||
466 | TP_perf_assign( | ||
467 | __perf_count(delay); | ||
468 | ), | ||
469 | |||
470 | TP_printk("task: %s:%d iowait: %Lu [ns]", | ||
471 | __entry->comm, __entry->pid, | ||
472 | (unsigned long long)__entry->delay) | ||
473 | ); | ||
474 | |||
475 | #endif /* _TRACE_SCHED_H */ | 378 | #endif /* _TRACE_SCHED_H */ |
476 | 379 | ||
477 | /* This part must be outside protection */ | 380 | /* This part must be outside protection */ |
diff --git a/include/trace/events/signal.h b/include/trace/events/signal.h new file mode 100644 index 000000000000..a510b75ac304 --- /dev/null +++ b/include/trace/events/signal.h | |||
@@ -0,0 +1,173 @@ | |||
1 | #undef TRACE_SYSTEM | ||
2 | #define TRACE_SYSTEM signal | ||
3 | |||
4 | #if !defined(_TRACE_SIGNAL_H) || defined(TRACE_HEADER_MULTI_READ) | ||
5 | #define _TRACE_SIGNAL_H | ||
6 | |||
7 | #include <linux/signal.h> | ||
8 | #include <linux/sched.h> | ||
9 | #include <linux/tracepoint.h> | ||
10 | |||
11 | #define TP_STORE_SIGINFO(__entry, info) \ | ||
12 | do { \ | ||
13 | if (info == SEND_SIG_NOINFO) { \ | ||
14 | __entry->errno = 0; \ | ||
15 | __entry->code = SI_USER; \ | ||
16 | } else if (info == SEND_SIG_PRIV) { \ | ||
17 | __entry->errno = 0; \ | ||
18 | __entry->code = SI_KERNEL; \ | ||
19 | } else { \ | ||
20 | __entry->errno = info->si_errno; \ | ||
21 | __entry->code = info->si_code; \ | ||
22 | } \ | ||
23 | } while (0) | ||
24 | |||
25 | /** | ||
26 | * signal_generate - called when a signal is generated | ||
27 | * @sig: signal number | ||
28 | * @info: pointer to struct siginfo | ||
29 | * @task: pointer to struct task_struct | ||
30 | * | ||
31 | * Current process sends a 'sig' signal to 'task' process with | ||
32 | * 'info' siginfo. If 'info' is SEND_SIG_NOINFO or SEND_SIG_PRIV, | ||
33 | * 'info' is not a pointer and you can't access its field. Instead, | ||
34 | * SEND_SIG_NOINFO means that si_code is SI_USER, and SEND_SIG_PRIV | ||
35 | * means that si_code is SI_KERNEL. | ||
36 | */ | ||
37 | TRACE_EVENT(signal_generate, | ||
38 | |||
39 | TP_PROTO(int sig, struct siginfo *info, struct task_struct *task), | ||
40 | |||
41 | TP_ARGS(sig, info, task), | ||
42 | |||
43 | TP_STRUCT__entry( | ||
44 | __field( int, sig ) | ||
45 | __field( int, errno ) | ||
46 | __field( int, code ) | ||
47 | __array( char, comm, TASK_COMM_LEN ) | ||
48 | __field( pid_t, pid ) | ||
49 | ), | ||
50 | |||
51 | TP_fast_assign( | ||
52 | __entry->sig = sig; | ||
53 | TP_STORE_SIGINFO(__entry, info); | ||
54 | memcpy(__entry->comm, task->comm, TASK_COMM_LEN); | ||
55 | __entry->pid = task->pid; | ||
56 | ), | ||
57 | |||
58 | TP_printk("sig=%d errno=%d code=%d comm=%s pid=%d", | ||
59 | __entry->sig, __entry->errno, __entry->code, | ||
60 | __entry->comm, __entry->pid) | ||
61 | ); | ||
62 | |||
63 | /** | ||
64 | * signal_deliver - called when a signal is delivered | ||
65 | * @sig: signal number | ||
66 | * @info: pointer to struct siginfo | ||
67 | * @ka: pointer to struct k_sigaction | ||
68 | * | ||
69 | * A 'sig' signal is delivered to current process with 'info' siginfo, | ||
70 | * and it will be handled by 'ka'. ka->sa.sa_handler can be SIG_IGN or | ||
71 | * SIG_DFL. | ||
72 | * Note that some signals reported by signal_generate tracepoint can be | ||
73 | * lost, ignored or modified (by debugger) before hitting this tracepoint. | ||
74 | * This means, this can show which signals are actually delivered, but | ||
75 | * matching generated signals and delivered signals may not be correct. | ||
76 | */ | ||
77 | TRACE_EVENT(signal_deliver, | ||
78 | |||
79 | TP_PROTO(int sig, struct siginfo *info, struct k_sigaction *ka), | ||
80 | |||
81 | TP_ARGS(sig, info, ka), | ||
82 | |||
83 | TP_STRUCT__entry( | ||
84 | __field( int, sig ) | ||
85 | __field( int, errno ) | ||
86 | __field( int, code ) | ||
87 | __field( unsigned long, sa_handler ) | ||
88 | __field( unsigned long, sa_flags ) | ||
89 | ), | ||
90 | |||
91 | TP_fast_assign( | ||
92 | __entry->sig = sig; | ||
93 | TP_STORE_SIGINFO(__entry, info); | ||
94 | __entry->sa_handler = (unsigned long)ka->sa.sa_handler; | ||
95 | __entry->sa_flags = ka->sa.sa_flags; | ||
96 | ), | ||
97 | |||
98 | TP_printk("sig=%d errno=%d code=%d sa_handler=%lx sa_flags=%lx", | ||
99 | __entry->sig, __entry->errno, __entry->code, | ||
100 | __entry->sa_handler, __entry->sa_flags) | ||
101 | ); | ||
102 | |||
103 | /** | ||
104 | * signal_overflow_fail - called when signal queue is overflow | ||
105 | * @sig: signal number | ||
106 | * @group: signal to process group or not (bool) | ||
107 | * @info: pointer to struct siginfo | ||
108 | * | ||
109 | * Kernel fails to generate 'sig' signal with 'info' siginfo, because | ||
110 | * siginfo queue is overflow, and the signal is dropped. | ||
111 | * 'group' is not 0 if the signal will be sent to a process group. | ||
112 | * 'sig' is always one of RT signals. | ||
113 | */ | ||
114 | TRACE_EVENT(signal_overflow_fail, | ||
115 | |||
116 | TP_PROTO(int sig, int group, struct siginfo *info), | ||
117 | |||
118 | TP_ARGS(sig, group, info), | ||
119 | |||
120 | TP_STRUCT__entry( | ||
121 | __field( int, sig ) | ||
122 | __field( int, group ) | ||
123 | __field( int, errno ) | ||
124 | __field( int, code ) | ||
125 | ), | ||
126 | |||
127 | TP_fast_assign( | ||
128 | __entry->sig = sig; | ||
129 | __entry->group = group; | ||
130 | TP_STORE_SIGINFO(__entry, info); | ||
131 | ), | ||
132 | |||
133 | TP_printk("sig=%d group=%d errno=%d code=%d", | ||
134 | __entry->sig, __entry->group, __entry->errno, __entry->code) | ||
135 | ); | ||
136 | |||
137 | /** | ||
138 | * signal_lose_info - called when siginfo is lost | ||
139 | * @sig: signal number | ||
140 | * @group: signal to process group or not (bool) | ||
141 | * @info: pointer to struct siginfo | ||
142 | * | ||
143 | * Kernel generates 'sig' signal but loses 'info' siginfo, because siginfo | ||
144 | * queue is overflow. | ||
145 | * 'group' is not 0 if the signal will be sent to a process group. | ||
146 | * 'sig' is always one of non-RT signals. | ||
147 | */ | ||
148 | TRACE_EVENT(signal_lose_info, | ||
149 | |||
150 | TP_PROTO(int sig, int group, struct siginfo *info), | ||
151 | |||
152 | TP_ARGS(sig, group, info), | ||
153 | |||
154 | TP_STRUCT__entry( | ||
155 | __field( int, sig ) | ||
156 | __field( int, group ) | ||
157 | __field( int, errno ) | ||
158 | __field( int, code ) | ||
159 | ), | ||
160 | |||
161 | TP_fast_assign( | ||
162 | __entry->sig = sig; | ||
163 | __entry->group = group; | ||
164 | TP_STORE_SIGINFO(__entry, info); | ||
165 | ), | ||
166 | |||
167 | TP_printk("sig=%d group=%d errno=%d code=%d", | ||
168 | __entry->sig, __entry->group, __entry->errno, __entry->code) | ||
169 | ); | ||
170 | #endif /* _TRACE_SIGNAL_H */ | ||
171 | |||
172 | /* This part must be outside protection */ | ||
173 | #include <trace/define_trace.h> | ||
diff --git a/include/trace/events/syscalls.h b/include/trace/events/syscalls.h index 397dff2dbd5a..fb726ac7caee 100644 --- a/include/trace/events/syscalls.h +++ b/include/trace/events/syscalls.h | |||
@@ -1,5 +1,6 @@ | |||
1 | #undef TRACE_SYSTEM | 1 | #undef TRACE_SYSTEM |
2 | #define TRACE_SYSTEM syscalls | 2 | #define TRACE_SYSTEM raw_syscalls |
3 | #define TRACE_INCLUDE_FILE syscalls | ||
3 | 4 | ||
4 | #if !defined(_TRACE_EVENTS_SYSCALLS_H) || defined(TRACE_HEADER_MULTI_READ) | 5 | #if !defined(_TRACE_EVENTS_SYSCALLS_H) || defined(TRACE_HEADER_MULTI_READ) |
5 | #define _TRACE_EVENTS_SYSCALLS_H | 6 | #define _TRACE_EVENTS_SYSCALLS_H |
diff --git a/include/trace/events/timer.h b/include/trace/events/timer.h index 1844c48d640e..e5ce87a0498d 100644 --- a/include/trace/events/timer.h +++ b/include/trace/events/timer.h | |||
@@ -26,7 +26,7 @@ TRACE_EVENT(timer_init, | |||
26 | __entry->timer = timer; | 26 | __entry->timer = timer; |
27 | ), | 27 | ), |
28 | 28 | ||
29 | TP_printk("timer %p", __entry->timer) | 29 | TP_printk("timer=%p", __entry->timer) |
30 | ); | 30 | ); |
31 | 31 | ||
32 | /** | 32 | /** |
@@ -54,7 +54,7 @@ TRACE_EVENT(timer_start, | |||
54 | __entry->now = jiffies; | 54 | __entry->now = jiffies; |
55 | ), | 55 | ), |
56 | 56 | ||
57 | TP_printk("timer %p: func %pf, expires %lu, timeout %ld", | 57 | TP_printk("timer=%p function=%pf expires=%lu [timeout=%ld]", |
58 | __entry->timer, __entry->function, __entry->expires, | 58 | __entry->timer, __entry->function, __entry->expires, |
59 | (long)__entry->expires - __entry->now) | 59 | (long)__entry->expires - __entry->now) |
60 | ); | 60 | ); |
@@ -81,7 +81,7 @@ TRACE_EVENT(timer_expire_entry, | |||
81 | __entry->now = jiffies; | 81 | __entry->now = jiffies; |
82 | ), | 82 | ), |
83 | 83 | ||
84 | TP_printk("timer %p: now %lu", __entry->timer, __entry->now) | 84 | TP_printk("timer=%p now=%lu", __entry->timer, __entry->now) |
85 | ); | 85 | ); |
86 | 86 | ||
87 | /** | 87 | /** |
@@ -108,7 +108,7 @@ TRACE_EVENT(timer_expire_exit, | |||
108 | __entry->timer = timer; | 108 | __entry->timer = timer; |
109 | ), | 109 | ), |
110 | 110 | ||
111 | TP_printk("timer %p", __entry->timer) | 111 | TP_printk("timer=%p", __entry->timer) |
112 | ); | 112 | ); |
113 | 113 | ||
114 | /** | 114 | /** |
@@ -129,7 +129,7 @@ TRACE_EVENT(timer_cancel, | |||
129 | __entry->timer = timer; | 129 | __entry->timer = timer; |
130 | ), | 130 | ), |
131 | 131 | ||
132 | TP_printk("timer %p", __entry->timer) | 132 | TP_printk("timer=%p", __entry->timer) |
133 | ); | 133 | ); |
134 | 134 | ||
135 | /** | 135 | /** |
@@ -140,24 +140,24 @@ TRACE_EVENT(timer_cancel, | |||
140 | */ | 140 | */ |
141 | TRACE_EVENT(hrtimer_init, | 141 | TRACE_EVENT(hrtimer_init, |
142 | 142 | ||
143 | TP_PROTO(struct hrtimer *timer, clockid_t clockid, | 143 | TP_PROTO(struct hrtimer *hrtimer, clockid_t clockid, |
144 | enum hrtimer_mode mode), | 144 | enum hrtimer_mode mode), |
145 | 145 | ||
146 | TP_ARGS(timer, clockid, mode), | 146 | TP_ARGS(hrtimer, clockid, mode), |
147 | 147 | ||
148 | TP_STRUCT__entry( | 148 | TP_STRUCT__entry( |
149 | __field( void *, timer ) | 149 | __field( void *, hrtimer ) |
150 | __field( clockid_t, clockid ) | 150 | __field( clockid_t, clockid ) |
151 | __field( enum hrtimer_mode, mode ) | 151 | __field( enum hrtimer_mode, mode ) |
152 | ), | 152 | ), |
153 | 153 | ||
154 | TP_fast_assign( | 154 | TP_fast_assign( |
155 | __entry->timer = timer; | 155 | __entry->hrtimer = hrtimer; |
156 | __entry->clockid = clockid; | 156 | __entry->clockid = clockid; |
157 | __entry->mode = mode; | 157 | __entry->mode = mode; |
158 | ), | 158 | ), |
159 | 159 | ||
160 | TP_printk("hrtimer %p, clockid %s, mode %s", __entry->timer, | 160 | TP_printk("hrtimer=%p clockid=%s mode=%s", __entry->hrtimer, |
161 | __entry->clockid == CLOCK_REALTIME ? | 161 | __entry->clockid == CLOCK_REALTIME ? |
162 | "CLOCK_REALTIME" : "CLOCK_MONOTONIC", | 162 | "CLOCK_REALTIME" : "CLOCK_MONOTONIC", |
163 | __entry->mode == HRTIMER_MODE_ABS ? | 163 | __entry->mode == HRTIMER_MODE_ABS ? |
@@ -170,26 +170,26 @@ TRACE_EVENT(hrtimer_init, | |||
170 | */ | 170 | */ |
171 | TRACE_EVENT(hrtimer_start, | 171 | TRACE_EVENT(hrtimer_start, |
172 | 172 | ||
173 | TP_PROTO(struct hrtimer *timer), | 173 | TP_PROTO(struct hrtimer *hrtimer), |
174 | 174 | ||
175 | TP_ARGS(timer), | 175 | TP_ARGS(hrtimer), |
176 | 176 | ||
177 | TP_STRUCT__entry( | 177 | TP_STRUCT__entry( |
178 | __field( void *, timer ) | 178 | __field( void *, hrtimer ) |
179 | __field( void *, function ) | 179 | __field( void *, function ) |
180 | __field( s64, expires ) | 180 | __field( s64, expires ) |
181 | __field( s64, softexpires ) | 181 | __field( s64, softexpires ) |
182 | ), | 182 | ), |
183 | 183 | ||
184 | TP_fast_assign( | 184 | TP_fast_assign( |
185 | __entry->timer = timer; | 185 | __entry->hrtimer = hrtimer; |
186 | __entry->function = timer->function; | 186 | __entry->function = hrtimer->function; |
187 | __entry->expires = hrtimer_get_expires(timer).tv64; | 187 | __entry->expires = hrtimer_get_expires(hrtimer).tv64; |
188 | __entry->softexpires = hrtimer_get_softexpires(timer).tv64; | 188 | __entry->softexpires = hrtimer_get_softexpires(hrtimer).tv64; |
189 | ), | 189 | ), |
190 | 190 | ||
191 | TP_printk("hrtimer %p, func %pf, expires %llu, softexpires %llu", | 191 | TP_printk("hrtimer=%p function=%pf expires=%llu softexpires=%llu", |
192 | __entry->timer, __entry->function, | 192 | __entry->hrtimer, __entry->function, |
193 | (unsigned long long)ktime_to_ns((ktime_t) { | 193 | (unsigned long long)ktime_to_ns((ktime_t) { |
194 | .tv64 = __entry->expires }), | 194 | .tv64 = __entry->expires }), |
195 | (unsigned long long)ktime_to_ns((ktime_t) { | 195 | (unsigned long long)ktime_to_ns((ktime_t) { |
@@ -206,23 +206,22 @@ TRACE_EVENT(hrtimer_start, | |||
206 | */ | 206 | */ |
207 | TRACE_EVENT(hrtimer_expire_entry, | 207 | TRACE_EVENT(hrtimer_expire_entry, |
208 | 208 | ||
209 | TP_PROTO(struct hrtimer *timer, ktime_t *now), | 209 | TP_PROTO(struct hrtimer *hrtimer, ktime_t *now), |
210 | 210 | ||
211 | TP_ARGS(timer, now), | 211 | TP_ARGS(hrtimer, now), |
212 | 212 | ||
213 | TP_STRUCT__entry( | 213 | TP_STRUCT__entry( |
214 | __field( void *, timer ) | 214 | __field( void *, hrtimer ) |
215 | __field( s64, now ) | 215 | __field( s64, now ) |
216 | ), | 216 | ), |
217 | 217 | ||
218 | TP_fast_assign( | 218 | TP_fast_assign( |
219 | __entry->timer = timer; | 219 | __entry->hrtimer = hrtimer; |
220 | __entry->now = now->tv64; | 220 | __entry->now = now->tv64; |
221 | ), | 221 | ), |
222 | 222 | ||
223 | TP_printk("hrtimer %p, now %llu", __entry->timer, | 223 | TP_printk("hrtimer=%p now=%llu", __entry->hrtimer, |
224 | (unsigned long long)ktime_to_ns((ktime_t) { | 224 | (unsigned long long)ktime_to_ns((ktime_t) { .tv64 = __entry->now })) |
225 | .tv64 = __entry->now })) | ||
226 | ); | 225 | ); |
227 | 226 | ||
228 | /** | 227 | /** |
@@ -234,40 +233,40 @@ TRACE_EVENT(hrtimer_expire_entry, | |||
234 | */ | 233 | */ |
235 | TRACE_EVENT(hrtimer_expire_exit, | 234 | TRACE_EVENT(hrtimer_expire_exit, |
236 | 235 | ||
237 | TP_PROTO(struct hrtimer *timer), | 236 | TP_PROTO(struct hrtimer *hrtimer), |
238 | 237 | ||
239 | TP_ARGS(timer), | 238 | TP_ARGS(hrtimer), |
240 | 239 | ||
241 | TP_STRUCT__entry( | 240 | TP_STRUCT__entry( |
242 | __field( void *, timer ) | 241 | __field( void *, hrtimer ) |
243 | ), | 242 | ), |
244 | 243 | ||
245 | TP_fast_assign( | 244 | TP_fast_assign( |
246 | __entry->timer = timer; | 245 | __entry->hrtimer = hrtimer; |
247 | ), | 246 | ), |
248 | 247 | ||
249 | TP_printk("hrtimer %p", __entry->timer) | 248 | TP_printk("hrtimer=%p", __entry->hrtimer) |
250 | ); | 249 | ); |
251 | 250 | ||
252 | /** | 251 | /** |
253 | * hrtimer_cancel - called when the hrtimer is canceled | 252 | * hrtimer_cancel - called when the hrtimer is canceled |
254 | * @timer: pointer to struct hrtimer | 253 | * @hrtimer: pointer to struct hrtimer |
255 | */ | 254 | */ |
256 | TRACE_EVENT(hrtimer_cancel, | 255 | TRACE_EVENT(hrtimer_cancel, |
257 | 256 | ||
258 | TP_PROTO(struct hrtimer *timer), | 257 | TP_PROTO(struct hrtimer *hrtimer), |
259 | 258 | ||
260 | TP_ARGS(timer), | 259 | TP_ARGS(hrtimer), |
261 | 260 | ||
262 | TP_STRUCT__entry( | 261 | TP_STRUCT__entry( |
263 | __field( void *, timer ) | 262 | __field( void *, hrtimer ) |
264 | ), | 263 | ), |
265 | 264 | ||
266 | TP_fast_assign( | 265 | TP_fast_assign( |
267 | __entry->timer = timer; | 266 | __entry->hrtimer = hrtimer; |
268 | ), | 267 | ), |
269 | 268 | ||
270 | TP_printk("hrtimer %p", __entry->timer) | 269 | TP_printk("hrtimer=%p", __entry->hrtimer) |
271 | ); | 270 | ); |
272 | 271 | ||
273 | /** | 272 | /** |
@@ -302,7 +301,7 @@ TRACE_EVENT(itimer_state, | |||
302 | __entry->interval_usec = value->it_interval.tv_usec; | 301 | __entry->interval_usec = value->it_interval.tv_usec; |
303 | ), | 302 | ), |
304 | 303 | ||
305 | TP_printk("which %d, expires %lu, it_value %lu.%lu, it_interval %lu.%lu", | 304 | TP_printk("which=%d expires=%lu it_value=%lu.%lu it_interval=%lu.%lu", |
306 | __entry->which, __entry->expires, | 305 | __entry->which, __entry->expires, |
307 | __entry->value_sec, __entry->value_usec, | 306 | __entry->value_sec, __entry->value_usec, |
308 | __entry->interval_sec, __entry->interval_usec) | 307 | __entry->interval_sec, __entry->interval_usec) |
@@ -332,7 +331,7 @@ TRACE_EVENT(itimer_expire, | |||
332 | __entry->pid = pid_nr(pid); | 331 | __entry->pid = pid_nr(pid); |
333 | ), | 332 | ), |
334 | 333 | ||
335 | TP_printk("which %d, pid %d, now %lu", __entry->which, | 334 | TP_printk("which=%d pid=%d now=%lu", __entry->which, |
336 | (int) __entry->pid, __entry->now) | 335 | (int) __entry->pid, __entry->now) |
337 | ); | 336 | ); |
338 | 337 | ||
diff --git a/include/trace/events/workqueue.h b/include/trace/events/workqueue.h index e4612dbd7ba6..d6c974474e70 100644 --- a/include/trace/events/workqueue.h +++ b/include/trace/events/workqueue.h | |||
@@ -8,7 +8,7 @@ | |||
8 | #include <linux/sched.h> | 8 | #include <linux/sched.h> |
9 | #include <linux/tracepoint.h> | 9 | #include <linux/tracepoint.h> |
10 | 10 | ||
11 | TRACE_EVENT(workqueue_insertion, | 11 | DECLARE_EVENT_CLASS(workqueue, |
12 | 12 | ||
13 | TP_PROTO(struct task_struct *wq_thread, struct work_struct *work), | 13 | TP_PROTO(struct task_struct *wq_thread, struct work_struct *work), |
14 | 14 | ||
@@ -30,26 +30,18 @@ TRACE_EVENT(workqueue_insertion, | |||
30 | __entry->thread_pid, __entry->func) | 30 | __entry->thread_pid, __entry->func) |
31 | ); | 31 | ); |
32 | 32 | ||
33 | TRACE_EVENT(workqueue_execution, | 33 | DEFINE_EVENT(workqueue, workqueue_insertion, |
34 | 34 | ||
35 | TP_PROTO(struct task_struct *wq_thread, struct work_struct *work), | 35 | TP_PROTO(struct task_struct *wq_thread, struct work_struct *work), |
36 | 36 | ||
37 | TP_ARGS(wq_thread, work), | 37 | TP_ARGS(wq_thread, work) |
38 | ); | ||
38 | 39 | ||
39 | TP_STRUCT__entry( | 40 | DEFINE_EVENT(workqueue, workqueue_execution, |
40 | __array(char, thread_comm, TASK_COMM_LEN) | ||
41 | __field(pid_t, thread_pid) | ||
42 | __field(work_func_t, func) | ||
43 | ), | ||
44 | 41 | ||
45 | TP_fast_assign( | 42 | TP_PROTO(struct task_struct *wq_thread, struct work_struct *work), |
46 | memcpy(__entry->thread_comm, wq_thread->comm, TASK_COMM_LEN); | ||
47 | __entry->thread_pid = wq_thread->pid; | ||
48 | __entry->func = work->func; | ||
49 | ), | ||
50 | 43 | ||
51 | TP_printk("thread=%s:%d func=%pf", __entry->thread_comm, | 44 | TP_ARGS(wq_thread, work) |
52 | __entry->thread_pid, __entry->func) | ||
53 | ); | 45 | ); |
54 | 46 | ||
55 | /* Trace the creation of one workqueue thread on a cpu */ | 47 | /* Trace the creation of one workqueue thread on a cpu */ |
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h index cc0d9667e182..d1b3de9c1a71 100644 --- a/include/trace/ftrace.h +++ b/include/trace/ftrace.h | |||
@@ -18,6 +18,26 @@ | |||
18 | 18 | ||
19 | #include <linux/ftrace_event.h> | 19 | #include <linux/ftrace_event.h> |
20 | 20 | ||
21 | /* | ||
22 | * DECLARE_EVENT_CLASS can be used to add a generic function | ||
23 | * handlers for events. That is, if all events have the same | ||
24 | * parameters and just have distinct trace points. | ||
25 | * Each tracepoint can be defined with DEFINE_EVENT and that | ||
26 | * will map the DECLARE_EVENT_CLASS to the tracepoint. | ||
27 | * | ||
28 | * TRACE_EVENT is a one to one mapping between tracepoint and template. | ||
29 | */ | ||
30 | #undef TRACE_EVENT | ||
31 | #define TRACE_EVENT(name, proto, args, tstruct, assign, print) \ | ||
32 | DECLARE_EVENT_CLASS(name, \ | ||
33 | PARAMS(proto), \ | ||
34 | PARAMS(args), \ | ||
35 | PARAMS(tstruct), \ | ||
36 | PARAMS(assign), \ | ||
37 | PARAMS(print)); \ | ||
38 | DEFINE_EVENT(name, name, PARAMS(proto), PARAMS(args)); | ||
39 | |||
40 | |||
21 | #undef __field | 41 | #undef __field |
22 | #define __field(type, item) type item; | 42 | #define __field(type, item) type item; |
23 | 43 | ||
@@ -36,15 +56,21 @@ | |||
36 | #undef TP_STRUCT__entry | 56 | #undef TP_STRUCT__entry |
37 | #define TP_STRUCT__entry(args...) args | 57 | #define TP_STRUCT__entry(args...) args |
38 | 58 | ||
39 | #undef TRACE_EVENT | 59 | #undef DECLARE_EVENT_CLASS |
40 | #define TRACE_EVENT(name, proto, args, tstruct, assign, print) \ | 60 | #define DECLARE_EVENT_CLASS(name, proto, args, tstruct, assign, print) \ |
41 | struct ftrace_raw_##name { \ | 61 | struct ftrace_raw_##name { \ |
42 | struct trace_entry ent; \ | 62 | struct trace_entry ent; \ |
43 | tstruct \ | 63 | tstruct \ |
44 | char __data[0]; \ | 64 | char __data[0]; \ |
45 | }; \ | 65 | }; |
66 | #undef DEFINE_EVENT | ||
67 | #define DEFINE_EVENT(template, name, proto, args) \ | ||
46 | static struct ftrace_event_call event_##name | 68 | static struct ftrace_event_call event_##name |
47 | 69 | ||
70 | #undef DEFINE_EVENT_PRINT | ||
71 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | ||
72 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) | ||
73 | |||
48 | #undef __cpparg | 74 | #undef __cpparg |
49 | #define __cpparg(arg...) arg | 75 | #define __cpparg(arg...) arg |
50 | 76 | ||
@@ -89,12 +115,19 @@ | |||
89 | #undef __string | 115 | #undef __string |
90 | #define __string(item, src) __dynamic_array(char, item, -1) | 116 | #define __string(item, src) __dynamic_array(char, item, -1) |
91 | 117 | ||
92 | #undef TRACE_EVENT | 118 | #undef DECLARE_EVENT_CLASS |
93 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ | 119 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
94 | struct ftrace_data_offsets_##call { \ | 120 | struct ftrace_data_offsets_##call { \ |
95 | tstruct; \ | 121 | tstruct; \ |
96 | }; | 122 | }; |
97 | 123 | ||
124 | #undef DEFINE_EVENT | ||
125 | #define DEFINE_EVENT(template, name, proto, args) | ||
126 | |||
127 | #undef DEFINE_EVENT_PRINT | ||
128 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | ||
129 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) | ||
130 | |||
98 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 131 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
99 | 132 | ||
100 | /* | 133 | /* |
@@ -120,9 +153,10 @@ | |||
120 | #undef __field | 153 | #undef __field |
121 | #define __field(type, item) \ | 154 | #define __field(type, item) \ |
122 | ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \ | 155 | ret = trace_seq_printf(s, "\tfield:" #type " " #item ";\t" \ |
123 | "offset:%u;\tsize:%u;\n", \ | 156 | "offset:%u;\tsize:%u;\tsigned:%u;\n", \ |
124 | (unsigned int)offsetof(typeof(field), item), \ | 157 | (unsigned int)offsetof(typeof(field), item), \ |
125 | (unsigned int)sizeof(field.item)); \ | 158 | (unsigned int)sizeof(field.item), \ |
159 | (unsigned int)is_signed_type(type)); \ | ||
126 | if (!ret) \ | 160 | if (!ret) \ |
127 | return 0; | 161 | return 0; |
128 | 162 | ||
@@ -132,19 +166,21 @@ | |||
132 | #undef __array | 166 | #undef __array |
133 | #define __array(type, item, len) \ | 167 | #define __array(type, item, len) \ |
134 | ret = trace_seq_printf(s, "\tfield:" #type " " #item "[" #len "];\t" \ | 168 | ret = trace_seq_printf(s, "\tfield:" #type " " #item "[" #len "];\t" \ |
135 | "offset:%u;\tsize:%u;\n", \ | 169 | "offset:%u;\tsize:%u;\tsigned:%u;\n", \ |
136 | (unsigned int)offsetof(typeof(field), item), \ | 170 | (unsigned int)offsetof(typeof(field), item), \ |
137 | (unsigned int)sizeof(field.item)); \ | 171 | (unsigned int)sizeof(field.item), \ |
172 | (unsigned int)is_signed_type(type)); \ | ||
138 | if (!ret) \ | 173 | if (!ret) \ |
139 | return 0; | 174 | return 0; |
140 | 175 | ||
141 | #undef __dynamic_array | 176 | #undef __dynamic_array |
142 | #define __dynamic_array(type, item, len) \ | 177 | #define __dynamic_array(type, item, len) \ |
143 | ret = trace_seq_printf(s, "\tfield:__data_loc " #type "[] " #item ";\t"\ | 178 | ret = trace_seq_printf(s, "\tfield:__data_loc " #type "[] " #item ";\t"\ |
144 | "offset:%u;\tsize:%u;\n", \ | 179 | "offset:%u;\tsize:%u;\tsigned:%u;\n", \ |
145 | (unsigned int)offsetof(typeof(field), \ | 180 | (unsigned int)offsetof(typeof(field), \ |
146 | __data_loc_##item), \ | 181 | __data_loc_##item), \ |
147 | (unsigned int)sizeof(field.__data_loc_##item)); \ | 182 | (unsigned int)sizeof(field.__data_loc_##item), \ |
183 | (unsigned int)is_signed_type(type)); \ | ||
148 | if (!ret) \ | 184 | if (!ret) \ |
149 | return 0; | 185 | return 0; |
150 | 186 | ||
@@ -159,7 +195,7 @@ | |||
159 | #undef __get_str | 195 | #undef __get_str |
160 | 196 | ||
161 | #undef TP_printk | 197 | #undef TP_printk |
162 | #define TP_printk(fmt, args...) "%s, %s\n", #fmt, __stringify(args) | 198 | #define TP_printk(fmt, args...) "\"%s\", %s\n", fmt, __stringify(args) |
163 | 199 | ||
164 | #undef TP_fast_assign | 200 | #undef TP_fast_assign |
165 | #define TP_fast_assign(args...) args | 201 | #define TP_fast_assign(args...) args |
@@ -167,17 +203,50 @@ | |||
167 | #undef TP_perf_assign | 203 | #undef TP_perf_assign |
168 | #define TP_perf_assign(args...) | 204 | #define TP_perf_assign(args...) |
169 | 205 | ||
170 | #undef TRACE_EVENT | 206 | #undef DECLARE_EVENT_CLASS |
171 | #define TRACE_EVENT(call, proto, args, tstruct, func, print) \ | 207 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, func, print) \ |
172 | static int \ | 208 | static int \ |
173 | ftrace_format_##call(struct ftrace_event_call *unused, \ | 209 | ftrace_format_setup_##call(struct ftrace_event_call *unused, \ |
174 | struct trace_seq *s) \ | 210 | struct trace_seq *s) \ |
175 | { \ | 211 | { \ |
176 | struct ftrace_raw_##call field __attribute__((unused)); \ | 212 | struct ftrace_raw_##call field __attribute__((unused)); \ |
177 | int ret = 0; \ | 213 | int ret = 0; \ |
178 | \ | 214 | \ |
179 | tstruct; \ | 215 | tstruct; \ |
180 | \ | 216 | \ |
217 | return ret; \ | ||
218 | } \ | ||
219 | \ | ||
220 | static int \ | ||
221 | ftrace_format_##call(struct ftrace_event_call *unused, \ | ||
222 | struct trace_seq *s) \ | ||
223 | { \ | ||
224 | int ret = 0; \ | ||
225 | \ | ||
226 | ret = ftrace_format_setup_##call(unused, s); \ | ||
227 | if (!ret) \ | ||
228 | return ret; \ | ||
229 | \ | ||
230 | ret = trace_seq_printf(s, "\nprint fmt: " print); \ | ||
231 | \ | ||
232 | return ret; \ | ||
233 | } | ||
234 | |||
235 | #undef DEFINE_EVENT | ||
236 | #define DEFINE_EVENT(template, name, proto, args) | ||
237 | |||
238 | #undef DEFINE_EVENT_PRINT | ||
239 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | ||
240 | static int \ | ||
241 | ftrace_format_##name(struct ftrace_event_call *unused, \ | ||
242 | struct trace_seq *s) \ | ||
243 | { \ | ||
244 | int ret = 0; \ | ||
245 | \ | ||
246 | ret = ftrace_format_setup_##template(unused, s); \ | ||
247 | if (!ret) \ | ||
248 | return ret; \ | ||
249 | \ | ||
181 | trace_seq_printf(s, "\nprint fmt: " print); \ | 250 | trace_seq_printf(s, "\nprint fmt: " print); \ |
182 | \ | 251 | \ |
183 | return ret; \ | 252 | return ret; \ |
@@ -252,10 +321,11 @@ ftrace_format_##call(struct ftrace_event_call *unused, \ | |||
252 | ftrace_print_symbols_seq(p, value, symbols); \ | 321 | ftrace_print_symbols_seq(p, value, symbols); \ |
253 | }) | 322 | }) |
254 | 323 | ||
255 | #undef TRACE_EVENT | 324 | #undef DECLARE_EVENT_CLASS |
256 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ | 325 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
257 | static enum print_line_t \ | 326 | static enum print_line_t \ |
258 | ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | 327 | ftrace_raw_output_id_##call(int event_id, const char *name, \ |
328 | struct trace_iterator *iter, int flags) \ | ||
259 | { \ | 329 | { \ |
260 | struct trace_seq *s = &iter->seq; \ | 330 | struct trace_seq *s = &iter->seq; \ |
261 | struct ftrace_raw_##call *field; \ | 331 | struct ftrace_raw_##call *field; \ |
@@ -265,6 +335,47 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | |||
265 | \ | 335 | \ |
266 | entry = iter->ent; \ | 336 | entry = iter->ent; \ |
267 | \ | 337 | \ |
338 | if (entry->type != event_id) { \ | ||
339 | WARN_ON_ONCE(1); \ | ||
340 | return TRACE_TYPE_UNHANDLED; \ | ||
341 | } \ | ||
342 | \ | ||
343 | field = (typeof(field))entry; \ | ||
344 | \ | ||
345 | p = &get_cpu_var(ftrace_event_seq); \ | ||
346 | trace_seq_init(p); \ | ||
347 | ret = trace_seq_printf(s, "%s: ", name); \ | ||
348 | if (ret) \ | ||
349 | ret = trace_seq_printf(s, print); \ | ||
350 | put_cpu(); \ | ||
351 | if (!ret) \ | ||
352 | return TRACE_TYPE_PARTIAL_LINE; \ | ||
353 | \ | ||
354 | return TRACE_TYPE_HANDLED; \ | ||
355 | } | ||
356 | |||
357 | #undef DEFINE_EVENT | ||
358 | #define DEFINE_EVENT(template, name, proto, args) \ | ||
359 | static enum print_line_t \ | ||
360 | ftrace_raw_output_##name(struct trace_iterator *iter, int flags) \ | ||
361 | { \ | ||
362 | return ftrace_raw_output_id_##template(event_##name.id, \ | ||
363 | #name, iter, flags); \ | ||
364 | } | ||
365 | |||
366 | #undef DEFINE_EVENT_PRINT | ||
367 | #define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ | ||
368 | static enum print_line_t \ | ||
369 | ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | ||
370 | { \ | ||
371 | struct trace_seq *s = &iter->seq; \ | ||
372 | struct ftrace_raw_##template *field; \ | ||
373 | struct trace_entry *entry; \ | ||
374 | struct trace_seq *p; \ | ||
375 | int ret; \ | ||
376 | \ | ||
377 | entry = iter->ent; \ | ||
378 | \ | ||
268 | if (entry->type != event_##call.id) { \ | 379 | if (entry->type != event_##call.id) { \ |
269 | WARN_ON_ONCE(1); \ | 380 | WARN_ON_ONCE(1); \ |
270 | return TRACE_TYPE_UNHANDLED; \ | 381 | return TRACE_TYPE_UNHANDLED; \ |
@@ -274,14 +385,16 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | |||
274 | \ | 385 | \ |
275 | p = &get_cpu_var(ftrace_event_seq); \ | 386 | p = &get_cpu_var(ftrace_event_seq); \ |
276 | trace_seq_init(p); \ | 387 | trace_seq_init(p); \ |
277 | ret = trace_seq_printf(s, #call ": " print); \ | 388 | ret = trace_seq_printf(s, "%s: ", #call); \ |
389 | if (ret) \ | ||
390 | ret = trace_seq_printf(s, print); \ | ||
278 | put_cpu(); \ | 391 | put_cpu(); \ |
279 | if (!ret) \ | 392 | if (!ret) \ |
280 | return TRACE_TYPE_PARTIAL_LINE; \ | 393 | return TRACE_TYPE_PARTIAL_LINE; \ |
281 | \ | 394 | \ |
282 | return TRACE_TYPE_HANDLED; \ | 395 | return TRACE_TYPE_HANDLED; \ |
283 | } | 396 | } |
284 | 397 | ||
285 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 398 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
286 | 399 | ||
287 | #undef __field_ext | 400 | #undef __field_ext |
@@ -315,8 +428,8 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | |||
315 | #undef __string | 428 | #undef __string |
316 | #define __string(item, src) __dynamic_array(char, item, -1) | 429 | #define __string(item, src) __dynamic_array(char, item, -1) |
317 | 430 | ||
318 | #undef TRACE_EVENT | 431 | #undef DECLARE_EVENT_CLASS |
319 | #define TRACE_EVENT(call, proto, args, tstruct, func, print) \ | 432 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, func, print) \ |
320 | static int \ | 433 | static int \ |
321 | ftrace_define_fields_##call(struct ftrace_event_call *event_call) \ | 434 | ftrace_define_fields_##call(struct ftrace_event_call *event_call) \ |
322 | { \ | 435 | { \ |
@@ -332,6 +445,13 @@ ftrace_define_fields_##call(struct ftrace_event_call *event_call) \ | |||
332 | return ret; \ | 445 | return ret; \ |
333 | } | 446 | } |
334 | 447 | ||
448 | #undef DEFINE_EVENT | ||
449 | #define DEFINE_EVENT(template, name, proto, args) | ||
450 | |||
451 | #undef DEFINE_EVENT_PRINT | ||
452 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | ||
453 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) | ||
454 | |||
335 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 455 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
336 | 456 | ||
337 | /* | 457 | /* |
@@ -358,10 +478,10 @@ ftrace_define_fields_##call(struct ftrace_event_call *event_call) \ | |||
358 | __data_size += (len) * sizeof(type); | 478 | __data_size += (len) * sizeof(type); |
359 | 479 | ||
360 | #undef __string | 480 | #undef __string |
361 | #define __string(item, src) __dynamic_array(char, item, strlen(src) + 1) \ | 481 | #define __string(item, src) __dynamic_array(char, item, strlen(src) + 1) |
362 | 482 | ||
363 | #undef TRACE_EVENT | 483 | #undef DECLARE_EVENT_CLASS |
364 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ | 484 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
365 | static inline int ftrace_get_offsets_##call( \ | 485 | static inline int ftrace_get_offsets_##call( \ |
366 | struct ftrace_data_offsets_##call *__data_offsets, proto) \ | 486 | struct ftrace_data_offsets_##call *__data_offsets, proto) \ |
367 | { \ | 487 | { \ |
@@ -373,6 +493,13 @@ static inline int ftrace_get_offsets_##call( \ | |||
373 | return __data_size; \ | 493 | return __data_size; \ |
374 | } | 494 | } |
375 | 495 | ||
496 | #undef DEFINE_EVENT | ||
497 | #define DEFINE_EVENT(template, name, proto, args) | ||
498 | |||
499 | #undef DEFINE_EVENT_PRINT | ||
500 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | ||
501 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) | ||
502 | |||
376 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 503 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
377 | 504 | ||
378 | #ifdef CONFIG_EVENT_PROFILE | 505 | #ifdef CONFIG_EVENT_PROFILE |
@@ -394,21 +521,28 @@ static inline int ftrace_get_offsets_##call( \ | |||
394 | * | 521 | * |
395 | */ | 522 | */ |
396 | 523 | ||
397 | #undef TRACE_EVENT | 524 | #undef DECLARE_EVENT_CLASS |
398 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ | 525 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) |
526 | |||
527 | #undef DEFINE_EVENT | ||
528 | #define DEFINE_EVENT(template, name, proto, args) \ | ||
399 | \ | 529 | \ |
400 | static void ftrace_profile_##call(proto); \ | 530 | static void ftrace_profile_##name(proto); \ |
401 | \ | 531 | \ |
402 | static int ftrace_profile_enable_##call(void) \ | 532 | static int ftrace_profile_enable_##name(struct ftrace_event_call *unused)\ |
403 | { \ | 533 | { \ |
404 | return register_trace_##call(ftrace_profile_##call); \ | 534 | return register_trace_##name(ftrace_profile_##name); \ |
405 | } \ | 535 | } \ |
406 | \ | 536 | \ |
407 | static void ftrace_profile_disable_##call(void) \ | 537 | static void ftrace_profile_disable_##name(struct ftrace_event_call *unused)\ |
408 | { \ | 538 | { \ |
409 | unregister_trace_##call(ftrace_profile_##call); \ | 539 | unregister_trace_##name(ftrace_profile_##name); \ |
410 | } | 540 | } |
411 | 541 | ||
542 | #undef DEFINE_EVENT_PRINT | ||
543 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | ||
544 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) | ||
545 | |||
412 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 546 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
413 | 547 | ||
414 | #endif | 548 | #endif |
@@ -423,7 +557,7 @@ static void ftrace_profile_disable_##call(void) \ | |||
423 | * event_trace_printk(_RET_IP_, "<call>: " <fmt>); | 557 | * event_trace_printk(_RET_IP_, "<call>: " <fmt>); |
424 | * } | 558 | * } |
425 | * | 559 | * |
426 | * static int ftrace_reg_event_<call>(void) | 560 | * static int ftrace_reg_event_<call>(struct ftrace_event_call *unused) |
427 | * { | 561 | * { |
428 | * int ret; | 562 | * int ret; |
429 | * | 563 | * |
@@ -434,7 +568,7 @@ static void ftrace_profile_disable_##call(void) \ | |||
434 | * return ret; | 568 | * return ret; |
435 | * } | 569 | * } |
436 | * | 570 | * |
437 | * static void ftrace_unreg_event_<call>(void) | 571 | * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused) |
438 | * { | 572 | * { |
439 | * unregister_trace_<call>(ftrace_event_<call>); | 573 | * unregister_trace_<call>(ftrace_event_<call>); |
440 | * } | 574 | * } |
@@ -469,7 +603,7 @@ static void ftrace_profile_disable_##call(void) \ | |||
469 | * trace_current_buffer_unlock_commit(buffer, event, irq_flags, pc); | 603 | * trace_current_buffer_unlock_commit(buffer, event, irq_flags, pc); |
470 | * } | 604 | * } |
471 | * | 605 | * |
472 | * static int ftrace_raw_reg_event_<call>(void) | 606 | * static int ftrace_raw_reg_event_<call>(struct ftrace_event_call *unused) |
473 | * { | 607 | * { |
474 | * int ret; | 608 | * int ret; |
475 | * | 609 | * |
@@ -480,7 +614,7 @@ static void ftrace_profile_disable_##call(void) \ | |||
480 | * return ret; | 614 | * return ret; |
481 | * } | 615 | * } |
482 | * | 616 | * |
483 | * static void ftrace_unreg_event_<call>(void) | 617 | * static void ftrace_unreg_event_<call>(struct ftrace_event_call *unused) |
484 | * { | 618 | * { |
485 | * unregister_trace_<call>(ftrace_raw_event_<call>); | 619 | * unregister_trace_<call>(ftrace_raw_event_<call>); |
486 | * } | 620 | * } |
@@ -489,7 +623,7 @@ static void ftrace_profile_disable_##call(void) \ | |||
489 | * .trace = ftrace_raw_output_<call>, <-- stage 2 | 623 | * .trace = ftrace_raw_output_<call>, <-- stage 2 |
490 | * }; | 624 | * }; |
491 | * | 625 | * |
492 | * static int ftrace_raw_init_event_<call>(void) | 626 | * static int ftrace_raw_init_event_<call>(struct ftrace_event_call *unused) |
493 | * { | 627 | * { |
494 | * int id; | 628 | * int id; |
495 | * | 629 | * |
@@ -547,15 +681,13 @@ static void ftrace_profile_disable_##call(void) \ | |||
547 | #define __assign_str(dst, src) \ | 681 | #define __assign_str(dst, src) \ |
548 | strcpy(__get_str(dst), src); | 682 | strcpy(__get_str(dst), src); |
549 | 683 | ||
550 | #undef TRACE_EVENT | 684 | #undef DECLARE_EVENT_CLASS |
551 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ | 685 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
552 | \ | 686 | \ |
553 | static struct ftrace_event_call event_##call; \ | 687 | static void ftrace_raw_event_id_##call(struct ftrace_event_call *event_call, \ |
554 | \ | 688 | proto) \ |
555 | static void ftrace_raw_event_##call(proto) \ | ||
556 | { \ | 689 | { \ |
557 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ | 690 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ |
558 | struct ftrace_event_call *event_call = &event_##call; \ | ||
559 | struct ring_buffer_event *event; \ | 691 | struct ring_buffer_event *event; \ |
560 | struct ftrace_raw_##call *entry; \ | 692 | struct ftrace_raw_##call *entry; \ |
561 | struct ring_buffer *buffer; \ | 693 | struct ring_buffer *buffer; \ |
@@ -569,7 +701,7 @@ static void ftrace_raw_event_##call(proto) \ | |||
569 | __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ | 701 | __data_size = ftrace_get_offsets_##call(&__data_offsets, args); \ |
570 | \ | 702 | \ |
571 | event = trace_current_buffer_lock_reserve(&buffer, \ | 703 | event = trace_current_buffer_lock_reserve(&buffer, \ |
572 | event_##call.id, \ | 704 | event_call->id, \ |
573 | sizeof(*entry) + __data_size, \ | 705 | sizeof(*entry) + __data_size, \ |
574 | irq_flags, pc); \ | 706 | irq_flags, pc); \ |
575 | if (!event) \ | 707 | if (!event) \ |
@@ -584,9 +716,17 @@ static void ftrace_raw_event_##call(proto) \ | |||
584 | if (!filter_current_check_discard(buffer, event_call, entry, event)) \ | 716 | if (!filter_current_check_discard(buffer, event_call, entry, event)) \ |
585 | trace_nowake_buffer_unlock_commit(buffer, \ | 717 | trace_nowake_buffer_unlock_commit(buffer, \ |
586 | event, irq_flags, pc); \ | 718 | event, irq_flags, pc); \ |
719 | } | ||
720 | |||
721 | #undef DEFINE_EVENT | ||
722 | #define DEFINE_EVENT(template, call, proto, args) \ | ||
723 | \ | ||
724 | static void ftrace_raw_event_##call(proto) \ | ||
725 | { \ | ||
726 | ftrace_raw_event_id_##template(&event_##call, args); \ | ||
587 | } \ | 727 | } \ |
588 | \ | 728 | \ |
589 | static int ftrace_raw_reg_event_##call(void *ptr) \ | 729 | static int ftrace_raw_reg_event_##call(struct ftrace_event_call *unused)\ |
590 | { \ | 730 | { \ |
591 | int ret; \ | 731 | int ret; \ |
592 | \ | 732 | \ |
@@ -597,7 +737,7 @@ static int ftrace_raw_reg_event_##call(void *ptr) \ | |||
597 | return ret; \ | 737 | return ret; \ |
598 | } \ | 738 | } \ |
599 | \ | 739 | \ |
600 | static void ftrace_raw_unreg_event_##call(void *ptr) \ | 740 | static void ftrace_raw_unreg_event_##call(struct ftrace_event_call *unused)\ |
601 | { \ | 741 | { \ |
602 | unregister_trace_##call(ftrace_raw_event_##call); \ | 742 | unregister_trace_##call(ftrace_raw_event_##call); \ |
603 | } \ | 743 | } \ |
@@ -606,7 +746,7 @@ static struct trace_event ftrace_event_type_##call = { \ | |||
606 | .trace = ftrace_raw_output_##call, \ | 746 | .trace = ftrace_raw_output_##call, \ |
607 | }; \ | 747 | }; \ |
608 | \ | 748 | \ |
609 | static int ftrace_raw_init_event_##call(void) \ | 749 | static int ftrace_raw_init_event_##call(struct ftrace_event_call *unused)\ |
610 | { \ | 750 | { \ |
611 | int id; \ | 751 | int id; \ |
612 | \ | 752 | \ |
@@ -616,7 +756,36 @@ static int ftrace_raw_init_event_##call(void) \ | |||
616 | event_##call.id = id; \ | 756 | event_##call.id = id; \ |
617 | INIT_LIST_HEAD(&event_##call.fields); \ | 757 | INIT_LIST_HEAD(&event_##call.fields); \ |
618 | return 0; \ | 758 | return 0; \ |
619 | } \ | 759 | } |
760 | |||
761 | #undef DEFINE_EVENT_PRINT | ||
762 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | ||
763 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) | ||
764 | |||
765 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | ||
766 | |||
767 | #undef DECLARE_EVENT_CLASS | ||
768 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) | ||
769 | |||
770 | #undef DEFINE_EVENT | ||
771 | #define DEFINE_EVENT(template, call, proto, args) \ | ||
772 | \ | ||
773 | static struct ftrace_event_call __used \ | ||
774 | __attribute__((__aligned__(4))) \ | ||
775 | __attribute__((section("_ftrace_events"))) event_##call = { \ | ||
776 | .name = #call, \ | ||
777 | .system = __stringify(TRACE_SYSTEM), \ | ||
778 | .event = &ftrace_event_type_##call, \ | ||
779 | .raw_init = ftrace_raw_init_event_##call, \ | ||
780 | .regfunc = ftrace_raw_reg_event_##call, \ | ||
781 | .unregfunc = ftrace_raw_unreg_event_##call, \ | ||
782 | .show_format = ftrace_format_##template, \ | ||
783 | .define_fields = ftrace_define_fields_##template, \ | ||
784 | _TRACE_PROFILE_INIT(call) \ | ||
785 | } | ||
786 | |||
787 | #undef DEFINE_EVENT_PRINT | ||
788 | #define DEFINE_EVENT_PRINT(template, call, proto, args, print) \ | ||
620 | \ | 789 | \ |
621 | static struct ftrace_event_call __used \ | 790 | static struct ftrace_event_call __used \ |
622 | __attribute__((__aligned__(4))) \ | 791 | __attribute__((__aligned__(4))) \ |
@@ -628,7 +797,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
628 | .regfunc = ftrace_raw_reg_event_##call, \ | 797 | .regfunc = ftrace_raw_reg_event_##call, \ |
629 | .unregfunc = ftrace_raw_unreg_event_##call, \ | 798 | .unregfunc = ftrace_raw_unreg_event_##call, \ |
630 | .show_format = ftrace_format_##call, \ | 799 | .show_format = ftrace_format_##call, \ |
631 | .define_fields = ftrace_define_fields_##call, \ | 800 | .define_fields = ftrace_define_fields_##template, \ |
632 | _TRACE_PROFILE_INIT(call) \ | 801 | _TRACE_PROFILE_INIT(call) \ |
633 | } | 802 | } |
634 | 803 | ||
@@ -646,6 +815,7 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
646 | * struct ftrace_event_call *event_call = &event_<call>; | 815 | * struct ftrace_event_call *event_call = &event_<call>; |
647 | * extern void perf_tp_event(int, u64, u64, void *, int); | 816 | * extern void perf_tp_event(int, u64, u64, void *, int); |
648 | * struct ftrace_raw_##call *entry; | 817 | * struct ftrace_raw_##call *entry; |
818 | * struct perf_trace_buf *trace_buf; | ||
649 | * u64 __addr = 0, __count = 1; | 819 | * u64 __addr = 0, __count = 1; |
650 | * unsigned long irq_flags; | 820 | * unsigned long irq_flags; |
651 | * struct trace_entry *ent; | 821 | * struct trace_entry *ent; |
@@ -670,14 +840,25 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
670 | * __cpu = smp_processor_id(); | 840 | * __cpu = smp_processor_id(); |
671 | * | 841 | * |
672 | * if (in_nmi()) | 842 | * if (in_nmi()) |
673 | * raw_data = rcu_dereference(trace_profile_buf_nmi); | 843 | * trace_buf = rcu_dereference(perf_trace_buf_nmi); |
674 | * else | 844 | * else |
675 | * raw_data = rcu_dereference(trace_profile_buf); | 845 | * trace_buf = rcu_dereference(perf_trace_buf); |
676 | * | 846 | * |
677 | * if (!raw_data) | 847 | * if (!trace_buf) |
678 | * goto end; | 848 | * goto end; |
679 | * | 849 | * |
680 | * raw_data = per_cpu_ptr(raw_data, __cpu); | 850 | * trace_buf = per_cpu_ptr(trace_buf, __cpu); |
851 | * | ||
852 | * // Avoid recursion from perf that could mess up the buffer | ||
853 | * if (trace_buf->recursion++) | ||
854 | * goto end_recursion; | ||
855 | * | ||
856 | * raw_data = trace_buf->buf; | ||
857 | * | ||
858 | * // Make recursion update visible before entering perf_tp_event | ||
859 | * // so that we protect from perf recursions. | ||
860 | * | ||
861 | * barrier(); | ||
681 | * | 862 | * |
682 | * //zero dead bytes from alignment to avoid stack leak to userspace: | 863 | * //zero dead bytes from alignment to avoid stack leak to userspace: |
683 | * *(u64 *)(&raw_data[__entry_size - sizeof(u64)]) = 0ULL; | 864 | * *(u64 *)(&raw_data[__entry_size - sizeof(u64)]) = 0ULL; |
@@ -704,21 +885,26 @@ __attribute__((section("_ftrace_events"))) event_##call = { \ | |||
704 | #undef __perf_count | 885 | #undef __perf_count |
705 | #define __perf_count(c) __count = (c) | 886 | #define __perf_count(c) __count = (c) |
706 | 887 | ||
707 | #undef TRACE_EVENT | 888 | #undef DECLARE_EVENT_CLASS |
708 | #define TRACE_EVENT(call, proto, args, tstruct, assign, print) \ | 889 | #define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ |
709 | static void ftrace_profile_##call(proto) \ | 890 | static void \ |
891 | ftrace_profile_templ_##call(struct ftrace_event_call *event_call, \ | ||
892 | proto) \ | ||
710 | { \ | 893 | { \ |
711 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ | 894 | struct ftrace_data_offsets_##call __maybe_unused __data_offsets;\ |
712 | struct ftrace_event_call *event_call = &event_##call; \ | 895 | extern int perf_swevent_get_recursion_context(void); \ |
713 | extern void perf_tp_event(int, u64, u64, void *, int); \ | 896 | extern void perf_swevent_put_recursion_context(int rctx); \ |
897 | extern void perf_tp_event(int, u64, u64, void *, int); \ | ||
714 | struct ftrace_raw_##call *entry; \ | 898 | struct ftrace_raw_##call *entry; \ |
715 | u64 __addr = 0, __count = 1; \ | 899 | u64 __addr = 0, __count = 1; \ |
716 | unsigned long irq_flags; \ | 900 | unsigned long irq_flags; \ |
717 | struct trace_entry *ent; \ | 901 | struct trace_entry *ent; \ |
718 | int __entry_size; \ | 902 | int __entry_size; \ |
719 | int __data_size; \ | 903 | int __data_size; \ |
904 | char *trace_buf; \ | ||
720 | char *raw_data; \ | 905 | char *raw_data; \ |
721 | int __cpu; \ | 906 | int __cpu; \ |
907 | int rctx; \ | ||
722 | int pc; \ | 908 | int pc; \ |
723 | \ | 909 | \ |
724 | pc = preempt_count(); \ | 910 | pc = preempt_count(); \ |
@@ -733,17 +919,22 @@ static void ftrace_profile_##call(proto) \ | |||
733 | return; \ | 919 | return; \ |
734 | \ | 920 | \ |
735 | local_irq_save(irq_flags); \ | 921 | local_irq_save(irq_flags); \ |
922 | \ | ||
923 | rctx = perf_swevent_get_recursion_context(); \ | ||
924 | if (rctx < 0) \ | ||
925 | goto end_recursion; \ | ||
926 | \ | ||
736 | __cpu = smp_processor_id(); \ | 927 | __cpu = smp_processor_id(); \ |
737 | \ | 928 | \ |
738 | if (in_nmi()) \ | 929 | if (in_nmi()) \ |
739 | raw_data = rcu_dereference(trace_profile_buf_nmi); \ | 930 | trace_buf = rcu_dereference(perf_trace_buf_nmi); \ |
740 | else \ | 931 | else \ |
741 | raw_data = rcu_dereference(trace_profile_buf); \ | 932 | trace_buf = rcu_dereference(perf_trace_buf); \ |
742 | \ | 933 | \ |
743 | if (!raw_data) \ | 934 | if (!trace_buf) \ |
744 | goto end; \ | 935 | goto end; \ |
745 | \ | 936 | \ |
746 | raw_data = per_cpu_ptr(raw_data, __cpu); \ | 937 | raw_data = per_cpu_ptr(trace_buf, __cpu); \ |
747 | \ | 938 | \ |
748 | *(u64 *)(&raw_data[__entry_size - sizeof(u64)]) = 0ULL; \ | 939 | *(u64 *)(&raw_data[__entry_size - sizeof(u64)]) = 0ULL; \ |
749 | entry = (struct ftrace_raw_##call *)raw_data; \ | 940 | entry = (struct ftrace_raw_##call *)raw_data; \ |
@@ -759,10 +950,25 @@ static void ftrace_profile_##call(proto) \ | |||
759 | __entry_size); \ | 950 | __entry_size); \ |
760 | \ | 951 | \ |
761 | end: \ | 952 | end: \ |
953 | perf_swevent_put_recursion_context(rctx); \ | ||
954 | end_recursion: \ | ||
762 | local_irq_restore(irq_flags); \ | 955 | local_irq_restore(irq_flags); \ |
763 | \ | 956 | \ |
764 | } | 957 | } |
765 | 958 | ||
959 | #undef DEFINE_EVENT | ||
960 | #define DEFINE_EVENT(template, call, proto, args) \ | ||
961 | static void ftrace_profile_##call(proto) \ | ||
962 | { \ | ||
963 | struct ftrace_event_call *event_call = &event_##call; \ | ||
964 | \ | ||
965 | ftrace_profile_templ_##template(event_call, args); \ | ||
966 | } | ||
967 | |||
968 | #undef DEFINE_EVENT_PRINT | ||
969 | #define DEFINE_EVENT_PRINT(template, name, proto, args, print) \ | ||
970 | DEFINE_EVENT(template, name, PARAMS(proto), PARAMS(args)) | ||
971 | |||
766 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) | 972 | #include TRACE_INCLUDE(TRACE_INCLUDE_FILE) |
767 | #endif /* CONFIG_EVENT_PROFILE */ | 973 | #endif /* CONFIG_EVENT_PROFILE */ |
768 | 974 | ||
diff --git a/include/trace/power.h b/include/trace/power.h deleted file mode 100644 index ef204666e983..000000000000 --- a/include/trace/power.h +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | #ifndef _TRACE_POWER_H | ||
2 | #define _TRACE_POWER_H | ||
3 | |||
4 | #include <linux/ktime.h> | ||
5 | #include <linux/tracepoint.h> | ||
6 | |||
7 | enum { | ||
8 | POWER_NONE = 0, | ||
9 | POWER_CSTATE = 1, | ||
10 | POWER_PSTATE = 2, | ||
11 | }; | ||
12 | |||
13 | struct power_trace { | ||
14 | ktime_t stamp; | ||
15 | ktime_t end; | ||
16 | int type; | ||
17 | int state; | ||
18 | }; | ||
19 | |||
20 | DECLARE_TRACE(power_start, | ||
21 | TP_PROTO(struct power_trace *it, unsigned int type, unsigned int state), | ||
22 | TP_ARGS(it, type, state)); | ||
23 | |||
24 | DECLARE_TRACE(power_mark, | ||
25 | TP_PROTO(struct power_trace *it, unsigned int type, unsigned int state), | ||
26 | TP_ARGS(it, type, state)); | ||
27 | |||
28 | DECLARE_TRACE(power_end, | ||
29 | TP_PROTO(struct power_trace *it), | ||
30 | TP_ARGS(it)); | ||
31 | |||
32 | #endif /* _TRACE_POWER_H */ | ||
diff --git a/include/trace/syscall.h b/include/trace/syscall.h index 5dc283ba5ae0..961fda3556bb 100644 --- a/include/trace/syscall.h +++ b/include/trace/syscall.h | |||
@@ -12,51 +12,48 @@ | |||
12 | * A syscall entry in the ftrace syscalls array. | 12 | * A syscall entry in the ftrace syscalls array. |
13 | * | 13 | * |
14 | * @name: name of the syscall | 14 | * @name: name of the syscall |
15 | * @syscall_nr: number of the syscall | ||
15 | * @nb_args: number of parameters it takes | 16 | * @nb_args: number of parameters it takes |
16 | * @types: list of types as strings | 17 | * @types: list of types as strings |
17 | * @args: list of args as strings (args[i] matches types[i]) | 18 | * @args: list of args as strings (args[i] matches types[i]) |
18 | * @enter_id: associated ftrace enter event id | ||
19 | * @exit_id: associated ftrace exit event id | ||
20 | * @enter_event: associated syscall_enter trace event | 19 | * @enter_event: associated syscall_enter trace event |
21 | * @exit_event: associated syscall_exit trace event | 20 | * @exit_event: associated syscall_exit trace event |
22 | */ | 21 | */ |
23 | struct syscall_metadata { | 22 | struct syscall_metadata { |
24 | const char *name; | 23 | const char *name; |
24 | int syscall_nr; | ||
25 | int nb_args; | 25 | int nb_args; |
26 | const char **types; | 26 | const char **types; |
27 | const char **args; | 27 | const char **args; |
28 | int enter_id; | ||
29 | int exit_id; | ||
30 | 28 | ||
31 | struct ftrace_event_call *enter_event; | 29 | struct ftrace_event_call *enter_event; |
32 | struct ftrace_event_call *exit_event; | 30 | struct ftrace_event_call *exit_event; |
33 | }; | 31 | }; |
34 | 32 | ||
35 | #ifdef CONFIG_FTRACE_SYSCALLS | 33 | #ifdef CONFIG_FTRACE_SYSCALLS |
36 | extern struct syscall_metadata *syscall_nr_to_meta(int nr); | 34 | extern unsigned long arch_syscall_addr(int nr); |
37 | extern int syscall_name_to_nr(char *name); | 35 | extern int init_syscall_trace(struct ftrace_event_call *call); |
38 | void set_syscall_enter_id(int num, int id); | 36 | |
39 | void set_syscall_exit_id(int num, int id); | ||
40 | extern struct trace_event event_syscall_enter; | ||
41 | extern struct trace_event event_syscall_exit; | ||
42 | extern int reg_event_syscall_enter(void *ptr); | ||
43 | extern void unreg_event_syscall_enter(void *ptr); | ||
44 | extern int reg_event_syscall_exit(void *ptr); | ||
45 | extern void unreg_event_syscall_exit(void *ptr); | ||
46 | extern int syscall_enter_format(struct ftrace_event_call *call, | 37 | extern int syscall_enter_format(struct ftrace_event_call *call, |
47 | struct trace_seq *s); | 38 | struct trace_seq *s); |
48 | extern int syscall_exit_format(struct ftrace_event_call *call, | 39 | extern int syscall_exit_format(struct ftrace_event_call *call, |
49 | struct trace_seq *s); | 40 | struct trace_seq *s); |
50 | extern int syscall_enter_define_fields(struct ftrace_event_call *call); | 41 | extern int syscall_enter_define_fields(struct ftrace_event_call *call); |
51 | extern int syscall_exit_define_fields(struct ftrace_event_call *call); | 42 | extern int syscall_exit_define_fields(struct ftrace_event_call *call); |
43 | extern int reg_event_syscall_enter(struct ftrace_event_call *call); | ||
44 | extern void unreg_event_syscall_enter(struct ftrace_event_call *call); | ||
45 | extern int reg_event_syscall_exit(struct ftrace_event_call *call); | ||
46 | extern void unreg_event_syscall_exit(struct ftrace_event_call *call); | ||
47 | extern int | ||
48 | ftrace_format_syscall(struct ftrace_event_call *call, struct trace_seq *s); | ||
52 | enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags); | 49 | enum print_line_t print_syscall_enter(struct trace_iterator *iter, int flags); |
53 | enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags); | 50 | enum print_line_t print_syscall_exit(struct trace_iterator *iter, int flags); |
54 | #endif | 51 | #endif |
55 | #ifdef CONFIG_EVENT_PROFILE | 52 | #ifdef CONFIG_EVENT_PROFILE |
56 | int reg_prof_syscall_enter(char *name); | 53 | int prof_sysenter_enable(struct ftrace_event_call *call); |
57 | void unreg_prof_syscall_enter(char *name); | 54 | void prof_sysenter_disable(struct ftrace_event_call *call); |
58 | int reg_prof_syscall_exit(char *name); | 55 | int prof_sysexit_enable(struct ftrace_event_call *call); |
59 | void unreg_prof_syscall_exit(char *name); | 56 | void prof_sysexit_disable(struct ftrace_event_call *call); |
60 | 57 | ||
61 | #endif | 58 | #endif |
62 | 59 | ||
diff --git a/include/video/pxa168fb.h b/include/video/pxa168fb.h index b5cc72fe0461..8c2f385a90ea 100644 --- a/include/video/pxa168fb.h +++ b/include/video/pxa168fb.h | |||
@@ -117,8 +117,6 @@ struct pxa168fb_mach_info { | |||
117 | unsigned invert_composite_blank:1; | 117 | unsigned invert_composite_blank:1; |
118 | unsigned invert_pix_val_ena:1; | 118 | unsigned invert_pix_val_ena:1; |
119 | unsigned invert_pixclock:1; | 119 | unsigned invert_pixclock:1; |
120 | unsigned invert_vsync:1; | ||
121 | unsigned invert_hsync:1; | ||
122 | unsigned panel_rbswap:1; | 120 | unsigned panel_rbswap:1; |
123 | unsigned active:1; | 121 | unsigned active:1; |
124 | unsigned enable_lcd:1; | 122 | unsigned enable_lcd:1; |
diff --git a/include/video/sgivw.h b/include/video/sgivw.h index 55f2a7c024af..f6aa5692e74b 100644 --- a/include/video/sgivw.h +++ b/include/video/sgivw.h | |||
@@ -351,7 +351,7 @@ typedef enum { | |||
351 | struct dbe_timing_info | 351 | struct dbe_timing_info |
352 | { | 352 | { |
353 | dbe_timing_t type; | 353 | dbe_timing_t type; |
354 | int flags; | 354 | int flags; |
355 | short width; /* Monitor resolution */ | 355 | short width; /* Monitor resolution */ |
356 | short height; | 356 | short height; |
357 | int fields_sec; /* fields/sec (Hz -3 dec. places */ | 357 | int fields_sec; /* fields/sec (Hz -3 dec. places */ |
@@ -389,11 +389,11 @@ struct dbe_timing_info dbeVTimings[] = { | |||
389 | { | 389 | { |
390 | DBE_VT_640_480_60, | 390 | DBE_VT_640_480_60, |
391 | /* flags, width, height, fields_sec, cfreq */ | 391 | /* flags, width, height, fields_sec, cfreq */ |
392 | 0, 640, 480, 59940, 25175, | 392 | 0, 640, 480, 59940, 25175, |
393 | /* htotal, hblank_start, hblank_end, hsync_start, hsync_end */ | 393 | /* htotal, hblank_start, hblank_end, hsync_start, hsync_end */ |
394 | 800, 640, 800, 656, 752, | 394 | 800, 640, 800, 656, 752, |
395 | /* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */ | 395 | /* vtotal, vblank_start, vblank_end, vsync_start, vsync_end */ |
396 | 525, 480, 525, 490, 492, | 396 | 525, 480, 525, 490, 492, |
397 | /* pll_m, pll_n, pll_p */ | 397 | /* pll_m, pll_n, pll_p */ |
398 | 15, 2, 3 | 398 | 15, 2, 3 |
399 | }, | 399 | }, |
@@ -650,7 +650,7 @@ struct dbe_timing_info dbeVTimings[] = { | |||
650 | /* pll_m, pll_n, pll_p */ | 650 | /* pll_m, pll_n, pll_p */ |
651 | 6, 1, 0 | 651 | 6, 1, 0 |
652 | }, | 652 | }, |
653 | 653 | ||
654 | { | 654 | { |
655 | DBE_VT_1920_1200_60, | 655 | DBE_VT_1920_1200_60, |
656 | /* flags, width, height, fields_sec, cfreq */ | 656 | /* flags, width, height, fields_sec, cfreq */ |
@@ -676,7 +676,6 @@ struct dbe_timing_info dbeVTimings[] = { | |||
676 | } | 676 | } |
677 | }; | 677 | }; |
678 | 678 | ||
679 | #define DBE_VT_SIZE (sizeof(dbeVTimings)/sizeof(dbeVTimings[0])) | ||
680 | #endif // INCLUDE_TIMING_TABLE_DATA | 679 | #endif // INCLUDE_TIMING_TABLE_DATA |
681 | 680 | ||
682 | #endif // ! __SGIVWFB_H__ | 681 | #endif // ! __SGIVWFB_H__ |
diff --git a/include/xen/xen.h b/include/xen/xen.h new file mode 100644 index 000000000000..a16402418d31 --- /dev/null +++ b/include/xen/xen.h | |||
@@ -0,0 +1,32 @@ | |||
1 | #ifndef _XEN_XEN_H | ||
2 | #define _XEN_XEN_H | ||
3 | |||
4 | enum xen_domain_type { | ||
5 | XEN_NATIVE, /* running on bare hardware */ | ||
6 | XEN_PV_DOMAIN, /* running in a PV domain */ | ||
7 | XEN_HVM_DOMAIN, /* running in a Xen hvm domain */ | ||
8 | }; | ||
9 | |||
10 | #ifdef CONFIG_XEN | ||
11 | extern enum xen_domain_type xen_domain_type; | ||
12 | #else | ||
13 | #define xen_domain_type XEN_NATIVE | ||
14 | #endif | ||
15 | |||
16 | #define xen_domain() (xen_domain_type != XEN_NATIVE) | ||
17 | #define xen_pv_domain() (xen_domain() && \ | ||
18 | xen_domain_type == XEN_PV_DOMAIN) | ||
19 | #define xen_hvm_domain() (xen_domain() && \ | ||
20 | xen_domain_type == XEN_HVM_DOMAIN) | ||
21 | |||
22 | #ifdef CONFIG_XEN_DOM0 | ||
23 | #include <xen/interface/xen.h> | ||
24 | #include <asm/xen/hypervisor.h> | ||
25 | |||
26 | #define xen_initial_domain() (xen_pv_domain() && \ | ||
27 | xen_start_info->flags & SIF_INITDOMAIN) | ||
28 | #else /* !CONFIG_XEN_DOM0 */ | ||
29 | #define xen_initial_domain() (0) | ||
30 | #endif /* CONFIG_XEN_DOM0 */ | ||
31 | |||
32 | #endif /* _XEN_XEN_H */ | ||