aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2012-03-16 15:15:48 -0400
committerArnd Bergmann <arnd@arndb.de>2012-03-16 15:15:48 -0400
commitab2f75ce55ef6f903348026271e30796f016851f (patch)
tree8e019d460e92ee6ac2b2ea54aa0b93770bf933ef /include
parentf56b71f5d5a3944acdcb0e5e1739574d95ddf61a (diff)
parentda5a70f3519fd6f73ece3eea261a861c9a4d6bbd (diff)
Merge branch 'depends/driver-core' into ux500/dt
Conflicts: drivers/base/cpu.c
Diffstat (limited to 'include')
-rw-r--r--include/acpi/processor.h1
-rw-r--r--include/linux/connector.h1
-rw-r--r--include/linux/cpu.h7
-rw-r--r--include/linux/device.h10
-rw-r--r--include/linux/dynamic_debug.h19
-rw-r--r--include/linux/hyperv.h146
-rw-r--r--include/linux/mod_devicetable.h21
-rw-r--r--include/linux/netdevice.h8
-rw-r--r--include/linux/pci.h13
-rw-r--r--include/linux/printk.h8
-rw-r--r--include/linux/sys_soc.h37
11 files changed, 249 insertions, 22 deletions
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index 8cf7e98a2c7b..9d650476d5dc 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -225,6 +225,7 @@ struct acpi_processor_errata {
225 } piix4; 225 } piix4;
226}; 226};
227 227
228extern void acpi_processor_load_module(struct acpi_processor *pr);
228extern int acpi_processor_preregister_performance(struct 229extern int acpi_processor_preregister_performance(struct
229 acpi_processor_performance 230 acpi_processor_performance
230 __percpu *performance); 231 __percpu *performance);
diff --git a/include/linux/connector.h b/include/linux/connector.h
index 3c9c54fd5690..76384074262d 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -43,6 +43,7 @@
43#define CN_IDX_DRBD 0x8 43#define CN_IDX_DRBD 0x8
44#define CN_VAL_DRBD 0x1 44#define CN_VAL_DRBD 0x1
45#define CN_KVP_IDX 0x9 /* HyperV KVP */ 45#define CN_KVP_IDX 0x9 /* HyperV KVP */
46#define CN_KVP_VAL 0x1 /* queries from the kernel */
46 47
47#define CN_NETLINK_USERS 10 /* Highest index + 1 */ 48#define CN_NETLINK_USERS 10 /* Highest index + 1 */
48 49
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 1f6587590a1a..6e53b4823d7f 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -44,6 +44,13 @@ extern ssize_t arch_cpu_release(const char *, size_t);
44#endif 44#endif
45struct notifier_block; 45struct notifier_block;
46 46
47#ifdef CONFIG_ARCH_HAS_CPU_AUTOPROBE
48extern int arch_cpu_uevent(struct device *dev, struct kobj_uevent_env *env);
49extern ssize_t arch_print_cpu_modalias(struct device *dev,
50 struct device_attribute *attr,
51 char *bufptr);
52#endif
53
47/* 54/*
48 * CPU notifier priorities. 55 * CPU notifier priorities.
49 */ 56 */
diff --git a/include/linux/device.h b/include/linux/device.h
index b63fb393aa58..f62e21689fdd 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -238,8 +238,6 @@ struct device_driver {
238extern int __must_check driver_register(struct device_driver *drv); 238extern int __must_check driver_register(struct device_driver *drv);
239extern void driver_unregister(struct device_driver *drv); 239extern void driver_unregister(struct device_driver *drv);
240 240
241extern struct device_driver *get_driver(struct device_driver *drv);
242extern void put_driver(struct device_driver *drv);
243extern struct device_driver *driver_find(const char *name, 241extern struct device_driver *driver_find(const char *name,
244 struct bus_type *bus); 242 struct bus_type *bus);
245extern int driver_probe_done(void); 243extern int driver_probe_done(void);
@@ -946,14 +944,14 @@ int _dev_info(const struct device *dev, const char *fmt, ...)
946 944
947#define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg) 945#define dev_info(dev, fmt, arg...) _dev_info(dev, fmt, ##arg)
948 946
949#if defined(DEBUG) 947#if defined(CONFIG_DYNAMIC_DEBUG)
950#define dev_dbg(dev, format, arg...) \
951 dev_printk(KERN_DEBUG, dev, format, ##arg)
952#elif defined(CONFIG_DYNAMIC_DEBUG)
953#define dev_dbg(dev, format, ...) \ 948#define dev_dbg(dev, format, ...) \
954do { \ 949do { \
955 dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \ 950 dynamic_dev_dbg(dev, format, ##__VA_ARGS__); \
956} while (0) 951} while (0)
952#elif defined(DEBUG)
953#define dev_dbg(dev, format, arg...) \
954 dev_printk(KERN_DEBUG, dev, format, ##arg)
957#else 955#else
958#define dev_dbg(dev, format, arg...) \ 956#define dev_dbg(dev, format, arg...) \
959({ \ 957({ \
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
index 0564e3c39882..7e3c53a900d8 100644
--- a/include/linux/dynamic_debug.h
+++ b/include/linux/dynamic_debug.h
@@ -15,20 +15,24 @@ struct _ddebug {
15 const char *function; 15 const char *function;
16 const char *filename; 16 const char *filename;
17 const char *format; 17 const char *format;
18 unsigned int lineno:24; 18 unsigned int lineno:18;
19 /* 19 /*
20 * The flags field controls the behaviour at the callsite. 20 * The flags field controls the behaviour at the callsite.
21 * The bits here are changed dynamically when the user 21 * The bits here are changed dynamically when the user
22 * writes commands to <debugfs>/dynamic_debug/control 22 * writes commands to <debugfs>/dynamic_debug/control
23 */ 23 */
24#define _DPRINTK_FLAGS_PRINT (1<<0) /* printk() a message using the format */ 24#define _DPRINTK_FLAGS_NONE 0
25#define _DPRINTK_FLAGS_PRINT (1<<0) /* printk() a message using the format */
25#define _DPRINTK_FLAGS_INCL_MODNAME (1<<1) 26#define _DPRINTK_FLAGS_INCL_MODNAME (1<<1)
26#define _DPRINTK_FLAGS_INCL_FUNCNAME (1<<2) 27#define _DPRINTK_FLAGS_INCL_FUNCNAME (1<<2)
27#define _DPRINTK_FLAGS_INCL_LINENO (1<<3) 28#define _DPRINTK_FLAGS_INCL_LINENO (1<<3)
28#define _DPRINTK_FLAGS_INCL_TID (1<<4) 29#define _DPRINTK_FLAGS_INCL_TID (1<<4)
30#if defined DEBUG
31#define _DPRINTK_FLAGS_DEFAULT _DPRINTK_FLAGS_PRINT
32#else
29#define _DPRINTK_FLAGS_DEFAULT 0 33#define _DPRINTK_FLAGS_DEFAULT 0
34#endif
30 unsigned int flags:8; 35 unsigned int flags:8;
31 char enabled;
32} __attribute__((aligned(8))); 36} __attribute__((aligned(8)));
33 37
34 38
@@ -62,21 +66,20 @@ int __dynamic_netdev_dbg(struct _ddebug *descriptor,
62 .format = (fmt), \ 66 .format = (fmt), \
63 .lineno = __LINE__, \ 67 .lineno = __LINE__, \
64 .flags = _DPRINTK_FLAGS_DEFAULT, \ 68 .flags = _DPRINTK_FLAGS_DEFAULT, \
65 .enabled = false, \
66 } 69 }
67 70
68#define dynamic_pr_debug(fmt, ...) \ 71#define dynamic_pr_debug(fmt, ...) \
69do { \ 72do { \
70 DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ 73 DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
71 if (unlikely(descriptor.enabled)) \ 74 if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT)) \
72 __dynamic_pr_debug(&descriptor, pr_fmt(fmt), \ 75 __dynamic_pr_debug(&descriptor, pr_fmt(fmt), \
73 ##__VA_ARGS__); \ 76 ##__VA_ARGS__); \
74} while (0) 77} while (0)
75 78
76#define dynamic_dev_dbg(dev, fmt, ...) \ 79#define dynamic_dev_dbg(dev, fmt, ...) \
77do { \ 80do { \
78 DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ 81 DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
79 if (unlikely(descriptor.enabled)) \ 82 if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT)) \
80 __dynamic_dev_dbg(&descriptor, dev, fmt, \ 83 __dynamic_dev_dbg(&descriptor, dev, fmt, \
81 ##__VA_ARGS__); \ 84 ##__VA_ARGS__); \
82} while (0) 85} while (0)
@@ -84,7 +87,7 @@ do { \
84#define dynamic_netdev_dbg(dev, fmt, ...) \ 87#define dynamic_netdev_dbg(dev, fmt, ...) \
85do { \ 88do { \
86 DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \ 89 DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
87 if (unlikely(descriptor.enabled)) \ 90 if (unlikely(descriptor.flags & _DPRINTK_FLAGS_PRINT)) \
88 __dynamic_netdev_dbg(&descriptor, dev, fmt, \ 91 __dynamic_netdev_dbg(&descriptor, dev, fmt, \
89 ##__VA_ARGS__); \ 92 ##__VA_ARGS__); \
90} while (0) 93} while (0)
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
index 0ae065a5fcb2..e57a6c6ee0e8 100644
--- a/include/linux/hyperv.h
+++ b/include/linux/hyperv.h
@@ -25,6 +25,147 @@
25#ifndef _HYPERV_H 25#ifndef _HYPERV_H
26#define _HYPERV_H 26#define _HYPERV_H
27 27
28#include <linux/types.h>
29
30/*
31 * An implementation of HyperV key value pair (KVP) functionality for Linux.
32 *
33 *
34 * Copyright (C) 2010, Novell, Inc.
35 * Author : K. Y. Srinivasan <ksrinivasan@novell.com>
36 *
37 */
38
39/*
40 * Maximum value size - used for both key names and value data, and includes
41 * any applicable NULL terminators.
42 *
43 * Note: This limit is somewhat arbitrary, but falls easily within what is
44 * supported for all native guests (back to Win 2000) and what is reasonable
45 * for the IC KVP exchange functionality. Note that Windows Me/98/95 are
46 * limited to 255 character key names.
47 *
48 * MSDN recommends not storing data values larger than 2048 bytes in the
49 * registry.
50 *
51 * Note: This value is used in defining the KVP exchange message - this value
52 * cannot be modified without affecting the message size and compatibility.
53 */
54
55/*
56 * bytes, including any null terminators
57 */
58#define HV_KVP_EXCHANGE_MAX_VALUE_SIZE (2048)
59
60
61/*
62 * Maximum key size - the registry limit for the length of an entry name
63 * is 256 characters, including the null terminator
64 */
65
66#define HV_KVP_EXCHANGE_MAX_KEY_SIZE (512)
67
68/*
69 * In Linux, we implement the KVP functionality in two components:
70 * 1) The kernel component which is packaged as part of the hv_utils driver
71 * is responsible for communicating with the host and responsible for
72 * implementing the host/guest protocol. 2) A user level daemon that is
73 * responsible for data gathering.
74 *
75 * Host/Guest Protocol: The host iterates over an index and expects the guest
76 * to assign a key name to the index and also return the value corresponding to
77 * the key. The host will have atmost one KVP transaction outstanding at any
78 * given point in time. The host side iteration stops when the guest returns
79 * an error. Microsoft has specified the following mapping of key names to
80 * host specified index:
81 *
82 * Index Key Name
83 * 0 FullyQualifiedDomainName
84 * 1 IntegrationServicesVersion
85 * 2 NetworkAddressIPv4
86 * 3 NetworkAddressIPv6
87 * 4 OSBuildNumber
88 * 5 OSName
89 * 6 OSMajorVersion
90 * 7 OSMinorVersion
91 * 8 OSVersion
92 * 9 ProcessorArchitecture
93 *
94 * The Windows host expects the Key Name and Key Value to be encoded in utf16.
95 *
96 * Guest Kernel/KVP Daemon Protocol: As noted earlier, we implement all of the
97 * data gathering functionality in a user mode daemon. The user level daemon
98 * is also responsible for binding the key name to the index as well. The
99 * kernel and user-level daemon communicate using a connector channel.
100 *
101 * The user mode component first registers with the
102 * the kernel component. Subsequently, the kernel component requests, data
103 * for the specified keys. In response to this message the user mode component
104 * fills in the value corresponding to the specified key. We overload the
105 * sequence field in the cn_msg header to define our KVP message types.
106 *
107 *
108 * The kernel component simply acts as a conduit for communication between the
109 * Windows host and the user-level daemon. The kernel component passes up the
110 * index received from the Host to the user-level daemon. If the index is
111 * valid (supported), the corresponding key as well as its
112 * value (both are strings) is returned. If the index is invalid
113 * (not supported), a NULL key string is returned.
114 */
115
116
117/*
118 * Registry value types.
119 */
120
121#define REG_SZ 1
122
123enum hv_kvp_exchg_op {
124 KVP_OP_GET = 0,
125 KVP_OP_SET,
126 KVP_OP_DELETE,
127 KVP_OP_ENUMERATE,
128 KVP_OP_REGISTER,
129 KVP_OP_COUNT /* Number of operations, must be last. */
130};
131
132enum hv_kvp_exchg_pool {
133 KVP_POOL_EXTERNAL = 0,
134 KVP_POOL_GUEST,
135 KVP_POOL_AUTO,
136 KVP_POOL_AUTO_EXTERNAL,
137 KVP_POOL_AUTO_INTERNAL,
138 KVP_POOL_COUNT /* Number of pools, must be last. */
139};
140
141struct hv_kvp_hdr {
142 __u8 operation;
143 __u8 pool;
144 __u16 pad;
145} __attribute__((packed));
146
147struct hv_kvp_exchg_msg_value {
148 __u32 value_type;
149 __u32 key_size;
150 __u32 value_size;
151 __u8 key[HV_KVP_EXCHANGE_MAX_KEY_SIZE];
152 __u8 value[HV_KVP_EXCHANGE_MAX_VALUE_SIZE];
153} __attribute__((packed));
154
155struct hv_kvp_msg_enumerate {
156 __u32 index;
157 struct hv_kvp_exchg_msg_value data;
158} __attribute__((packed));
159
160struct hv_kvp_msg {
161 struct hv_kvp_hdr kvp_hdr;
162 union {
163 struct hv_kvp_msg_enumerate kvp_enum_data;
164 char kvp_version[HV_KVP_EXCHANGE_MAX_KEY_SIZE];
165 } body;
166} __attribute__((packed));
167
168#ifdef __KERNEL__
28#include <linux/scatterlist.h> 169#include <linux/scatterlist.h>
29#include <linux/list.h> 170#include <linux/list.h>
30#include <linux/uuid.h> 171#include <linux/uuid.h>
@@ -870,4 +1011,9 @@ struct hyperv_service_callback {
870extern void vmbus_prep_negotiate_resp(struct icmsg_hdr *, 1011extern void vmbus_prep_negotiate_resp(struct icmsg_hdr *,
871 struct icmsg_negotiate *, u8 *); 1012 struct icmsg_negotiate *, u8 *);
872 1013
1014int hv_kvp_init(struct hv_util_service *);
1015void hv_kvp_deinit(void);
1016void hv_kvp_onchannelcallback(void *);
1017
1018#endif /* __KERNEL__ */
873#endif /* _HYPERV_H */ 1019#endif /* _HYPERV_H */
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 83ac0713ed0a..fb69ad191ad7 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -560,4 +560,25 @@ struct amba_id {
560#endif 560#endif
561}; 561};
562 562
563/*
564 * Match x86 CPUs for CPU specific drivers.
565 * See documentation of "x86_match_cpu" for details.
566 */
567
568struct x86_cpu_id {
569 __u16 vendor;
570 __u16 family;
571 __u16 model;
572 __u16 feature; /* bit index */
573 kernel_ulong_t driver_data;
574};
575
576#define X86_FEATURE_MATCH(x) \
577 { X86_VENDOR_ANY, X86_FAMILY_ANY, X86_MODEL_ANY, x }
578
579#define X86_VENDOR_ANY 0xffff
580#define X86_FAMILY_ANY 0
581#define X86_MODEL_ANY 0
582#define X86_FEATURE_ANY 0 /* Same as FPU, you can't test for that */
583
563#endif /* LINUX_MOD_DEVICETABLE_H */ 584#endif /* LINUX_MOD_DEVICETABLE_H */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 0eac07c95255..f486f635e7b5 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2687,14 +2687,14 @@ int netdev_info(const struct net_device *dev, const char *format, ...);
2687#define MODULE_ALIAS_NETDEV(device) \ 2687#define MODULE_ALIAS_NETDEV(device) \
2688 MODULE_ALIAS("netdev-" device) 2688 MODULE_ALIAS("netdev-" device)
2689 2689
2690#if defined(DEBUG) 2690#if defined(CONFIG_DYNAMIC_DEBUG)
2691#define netdev_dbg(__dev, format, args...) \
2692 netdev_printk(KERN_DEBUG, __dev, format, ##args)
2693#elif defined(CONFIG_DYNAMIC_DEBUG)
2694#define netdev_dbg(__dev, format, args...) \ 2691#define netdev_dbg(__dev, format, args...) \
2695do { \ 2692do { \
2696 dynamic_netdev_dbg(__dev, format, ##args); \ 2693 dynamic_netdev_dbg(__dev, format, ##args); \
2697} while (0) 2694} while (0)
2695#elif defined(DEBUG)
2696#define netdev_dbg(__dev, format, args...) \
2697 netdev_printk(KERN_DEBUG, __dev, format, ##args)
2698#else 2698#else
2699#define netdev_dbg(__dev, format, args...) \ 2699#define netdev_dbg(__dev, format, args...) \
2700({ \ 2700({ \
diff --git a/include/linux/pci.h b/include/linux/pci.h
index a16b1df3deff..d4afd703e948 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -946,6 +946,19 @@ int __must_check __pci_register_driver(struct pci_driver *, struct module *,
946 __pci_register_driver(driver, THIS_MODULE, KBUILD_MODNAME) 946 __pci_register_driver(driver, THIS_MODULE, KBUILD_MODNAME)
947 947
948void pci_unregister_driver(struct pci_driver *dev); 948void pci_unregister_driver(struct pci_driver *dev);
949
950/**
951 * module_pci_driver() - Helper macro for registering a PCI driver
952 * @__pci_driver: pci_driver struct
953 *
954 * Helper macro for PCI drivers which do not do anything special in module
955 * init/exit. This eliminates a lot of boilerplate. Each module may only
956 * use this macro once, and calling it replaces module_init() and module_exit()
957 */
958#define module_pci_driver(__pci_driver) \
959 module_driver(__pci_driver, pci_register_driver, \
960 pci_unregister_driver)
961
949void pci_remove_behind_bridge(struct pci_dev *dev); 962void pci_remove_behind_bridge(struct pci_dev *dev);
950struct pci_driver *pci_dev_driver(const struct pci_dev *dev); 963struct pci_driver *pci_dev_driver(const struct pci_dev *dev);
951int pci_add_dynid(struct pci_driver *drv, 964int pci_add_dynid(struct pci_driver *drv,
diff --git a/include/linux/printk.h b/include/linux/printk.h
index f0e22f75143f..f9abd9357a0c 100644
--- a/include/linux/printk.h
+++ b/include/linux/printk.h
@@ -180,13 +180,13 @@ extern void dump_stack(void) __cold;
180#endif 180#endif
181 181
182/* If you are writing a driver, please use dev_dbg instead */ 182/* If you are writing a driver, please use dev_dbg instead */
183#if defined(DEBUG) 183#if defined(CONFIG_DYNAMIC_DEBUG)
184#define pr_debug(fmt, ...) \
185 printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
186#elif defined(CONFIG_DYNAMIC_DEBUG)
187/* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */ 184/* dynamic_pr_debug() uses pr_fmt() internally so we don't need it here */
188#define pr_debug(fmt, ...) \ 185#define pr_debug(fmt, ...) \
189 dynamic_pr_debug(fmt, ##__VA_ARGS__) 186 dynamic_pr_debug(fmt, ##__VA_ARGS__)
187#elif defined(DEBUG)
188#define pr_debug(fmt, ...) \
189 printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
190#else 190#else
191#define pr_debug(fmt, ...) \ 191#define pr_debug(fmt, ...) \
192 no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__) 192 no_printk(KERN_DEBUG pr_fmt(fmt), ##__VA_ARGS__)
diff --git a/include/linux/sys_soc.h b/include/linux/sys_soc.h
new file mode 100644
index 000000000000..2739ccb69571
--- /dev/null
+++ b/include/linux/sys_soc.h
@@ -0,0 +1,37 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2011
3 * Author: Lee Jones <lee.jones@linaro.org> for ST-Ericsson.
4 * License terms: GNU General Public License (GPL), version 2
5 */
6#ifndef __SOC_BUS_H
7#define __SOC_BUS_H
8
9#include <linux/device.h>
10
11struct soc_device_attribute {
12 const char *machine;
13 const char *family;
14 const char *revision;
15 const char *soc_id;
16};
17
18/**
19 * soc_device_register - register SoC as a device
20 * @soc_plat_dev_attr: Attributes passed from platform to be attributed to a SoC
21 */
22struct soc_device *soc_device_register(
23 struct soc_device_attribute *soc_plat_dev_attr);
24
25/**
26 * soc_device_unregister - unregister SoC device
27 * @dev: SoC device to be unregistered
28 */
29void soc_device_unregister(struct soc_device *soc_dev);
30
31/**
32 * soc_device_to_device - helper function to fetch struct device
33 * @soc: Previously registered SoC device container
34 */
35struct device *soc_device_to_device(struct soc_device *soc);
36
37#endif /* __SOC_BUS_H */