diff options
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/acpi.h | 10 | ||||
-rw-r--r-- | include/linux/cper.h | 86 | ||||
-rw-r--r-- | include/linux/ipmi.h | 38 | ||||
-rw-r--r-- | include/linux/ipmi_smi.h | 8 | ||||
-rw-r--r-- | include/linux/suspend.h | 17 | ||||
-rw-r--r-- | include/linux/thermal.h | 47 |
6 files changed, 175 insertions, 31 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h index 67c91b4418b0..eb176bb1b15b 100644 --- a/include/linux/acpi.h +++ b/include/linux/acpi.h | |||
@@ -352,4 +352,14 @@ static inline int acpi_table_parse(char *id, | |||
352 | return -1; | 352 | return -1; |
353 | } | 353 | } |
354 | #endif /* !CONFIG_ACPI */ | 354 | #endif /* !CONFIG_ACPI */ |
355 | |||
356 | #ifdef CONFIG_ACPI_SLEEP | ||
357 | int suspend_nvs_register(unsigned long start, unsigned long size); | ||
358 | #else | ||
359 | static inline int suspend_nvs_register(unsigned long a, unsigned long b) | ||
360 | { | ||
361 | return 0; | ||
362 | } | ||
363 | #endif | ||
364 | |||
355 | #endif /*_LINUX_ACPI_H*/ | 365 | #endif /*_LINUX_ACPI_H*/ |
diff --git a/include/linux/cper.h b/include/linux/cper.h index bf972f81e2a7..3104aaff5dd0 100644 --- a/include/linux/cper.h +++ b/include/linux/cper.h | |||
@@ -39,10 +39,12 @@ | |||
39 | * Severity difinition for error_severity in struct cper_record_header | 39 | * Severity difinition for error_severity in struct cper_record_header |
40 | * and section_severity in struct cper_section_descriptor | 40 | * and section_severity in struct cper_section_descriptor |
41 | */ | 41 | */ |
42 | #define CPER_SEV_RECOVERABLE 0x0 | 42 | enum { |
43 | #define CPER_SEV_FATAL 0x1 | 43 | CPER_SEV_RECOVERABLE, |
44 | #define CPER_SEV_CORRECTED 0x2 | 44 | CPER_SEV_FATAL, |
45 | #define CPER_SEV_INFORMATIONAL 0x3 | 45 | CPER_SEV_CORRECTED, |
46 | CPER_SEV_INFORMATIONAL, | ||
47 | }; | ||
46 | 48 | ||
47 | /* | 49 | /* |
48 | * Validation bits difinition for validation_bits in struct | 50 | * Validation bits difinition for validation_bits in struct |
@@ -201,6 +203,47 @@ | |||
201 | UUID_LE(0x036F84E1, 0x7F37, 0x428c, 0xA7, 0x9E, 0x57, 0x5F, \ | 203 | UUID_LE(0x036F84E1, 0x7F37, 0x428c, 0xA7, 0x9E, 0x57, 0x5F, \ |
202 | 0xDF, 0xAA, 0x84, 0xEC) | 204 | 0xDF, 0xAA, 0x84, 0xEC) |
203 | 205 | ||
206 | #define CPER_PROC_VALID_TYPE 0x0001 | ||
207 | #define CPER_PROC_VALID_ISA 0x0002 | ||
208 | #define CPER_PROC_VALID_ERROR_TYPE 0x0004 | ||
209 | #define CPER_PROC_VALID_OPERATION 0x0008 | ||
210 | #define CPER_PROC_VALID_FLAGS 0x0010 | ||
211 | #define CPER_PROC_VALID_LEVEL 0x0020 | ||
212 | #define CPER_PROC_VALID_VERSION 0x0040 | ||
213 | #define CPER_PROC_VALID_BRAND_INFO 0x0080 | ||
214 | #define CPER_PROC_VALID_ID 0x0100 | ||
215 | #define CPER_PROC_VALID_TARGET_ADDRESS 0x0200 | ||
216 | #define CPER_PROC_VALID_REQUESTOR_ID 0x0400 | ||
217 | #define CPER_PROC_VALID_RESPONDER_ID 0x0800 | ||
218 | #define CPER_PROC_VALID_IP 0x1000 | ||
219 | |||
220 | #define CPER_MEM_VALID_ERROR_STATUS 0x0001 | ||
221 | #define CPER_MEM_VALID_PHYSICAL_ADDRESS 0x0002 | ||
222 | #define CPER_MEM_VALID_PHYSICAL_ADDRESS_MASK 0x0004 | ||
223 | #define CPER_MEM_VALID_NODE 0x0008 | ||
224 | #define CPER_MEM_VALID_CARD 0x0010 | ||
225 | #define CPER_MEM_VALID_MODULE 0x0020 | ||
226 | #define CPER_MEM_VALID_BANK 0x0040 | ||
227 | #define CPER_MEM_VALID_DEVICE 0x0080 | ||
228 | #define CPER_MEM_VALID_ROW 0x0100 | ||
229 | #define CPER_MEM_VALID_COLUMN 0x0200 | ||
230 | #define CPER_MEM_VALID_BIT_POSITION 0x0400 | ||
231 | #define CPER_MEM_VALID_REQUESTOR_ID 0x0800 | ||
232 | #define CPER_MEM_VALID_RESPONDER_ID 0x1000 | ||
233 | #define CPER_MEM_VALID_TARGET_ID 0x2000 | ||
234 | #define CPER_MEM_VALID_ERROR_TYPE 0x4000 | ||
235 | |||
236 | #define CPER_PCIE_VALID_PORT_TYPE 0x0001 | ||
237 | #define CPER_PCIE_VALID_VERSION 0x0002 | ||
238 | #define CPER_PCIE_VALID_COMMAND_STATUS 0x0004 | ||
239 | #define CPER_PCIE_VALID_DEVICE_ID 0x0008 | ||
240 | #define CPER_PCIE_VALID_SERIAL_NUMBER 0x0010 | ||
241 | #define CPER_PCIE_VALID_BRIDGE_CONTROL_STATUS 0x0020 | ||
242 | #define CPER_PCIE_VALID_CAPABILITY 0x0040 | ||
243 | #define CPER_PCIE_VALID_AER_INFO 0x0080 | ||
244 | |||
245 | #define CPER_PCIE_SLOT_SHIFT 3 | ||
246 | |||
204 | /* | 247 | /* |
205 | * All tables and structs must be byte-packed to match CPER | 248 | * All tables and structs must be byte-packed to match CPER |
206 | * specification, since the tables are provided by the system BIOS | 249 | * specification, since the tables are provided by the system BIOS |
@@ -306,6 +349,41 @@ struct cper_sec_mem_err { | |||
306 | __u8 error_type; | 349 | __u8 error_type; |
307 | }; | 350 | }; |
308 | 351 | ||
352 | struct cper_sec_pcie { | ||
353 | __u64 validation_bits; | ||
354 | __u32 port_type; | ||
355 | struct { | ||
356 | __u8 minor; | ||
357 | __u8 major; | ||
358 | __u8 reserved[2]; | ||
359 | } version; | ||
360 | __u16 command; | ||
361 | __u16 status; | ||
362 | __u32 reserved; | ||
363 | struct { | ||
364 | __u16 vendor_id; | ||
365 | __u16 device_id; | ||
366 | __u8 class_code[3]; | ||
367 | __u8 function; | ||
368 | __u8 device; | ||
369 | __u16 segment; | ||
370 | __u8 bus; | ||
371 | __u8 secondary_bus; | ||
372 | __u16 slot; | ||
373 | __u8 reserved; | ||
374 | } device_id; | ||
375 | struct { | ||
376 | __u32 lower; | ||
377 | __u32 upper; | ||
378 | } serial_number; | ||
379 | struct { | ||
380 | __u16 secondary_status; | ||
381 | __u16 control; | ||
382 | } bridge; | ||
383 | __u8 capability[60]; | ||
384 | __u8 aer_info[96]; | ||
385 | }; | ||
386 | |||
309 | /* Reset to default packing */ | 387 | /* Reset to default packing */ |
310 | #pragma pack() | 388 | #pragma pack() |
311 | 389 | ||
diff --git a/include/linux/ipmi.h b/include/linux/ipmi.h index 65aae34759de..045f2f275cd0 100644 --- a/include/linux/ipmi.h +++ b/include/linux/ipmi.h | |||
@@ -454,6 +454,44 @@ unsigned int ipmi_addr_length(int addr_type); | |||
454 | /* Validate that the given IPMI address is valid. */ | 454 | /* Validate that the given IPMI address is valid. */ |
455 | int ipmi_validate_addr(struct ipmi_addr *addr, int len); | 455 | int ipmi_validate_addr(struct ipmi_addr *addr, int len); |
456 | 456 | ||
457 | /* | ||
458 | * How did the IPMI driver find out about the device? | ||
459 | */ | ||
460 | enum ipmi_addr_src { | ||
461 | SI_INVALID = 0, SI_HOTMOD, SI_HARDCODED, SI_SPMI, SI_ACPI, SI_SMBIOS, | ||
462 | SI_PCI, SI_DEVICETREE, SI_DEFAULT | ||
463 | }; | ||
464 | |||
465 | union ipmi_smi_info_union { | ||
466 | /* | ||
467 | * the acpi_info element is defined for the SI_ACPI | ||
468 | * address type | ||
469 | */ | ||
470 | struct { | ||
471 | void *acpi_handle; | ||
472 | } acpi_info; | ||
473 | }; | ||
474 | |||
475 | struct ipmi_smi_info { | ||
476 | enum ipmi_addr_src addr_src; | ||
477 | |||
478 | /* | ||
479 | * Base device for the interface. Don't forget to put this when | ||
480 | * you are done. | ||
481 | */ | ||
482 | struct device *dev; | ||
483 | |||
484 | /* | ||
485 | * The addr_info provides more detailed info for some IPMI | ||
486 | * devices, depending on the addr_src. Currently only SI_ACPI | ||
487 | * info is provided. | ||
488 | */ | ||
489 | union ipmi_smi_info_union addr_info; | ||
490 | }; | ||
491 | |||
492 | /* This is to get the private info of ipmi_smi_t */ | ||
493 | extern int ipmi_get_smi_info(int if_num, struct ipmi_smi_info *data); | ||
494 | |||
457 | #endif /* __KERNEL__ */ | 495 | #endif /* __KERNEL__ */ |
458 | 496 | ||
459 | 497 | ||
diff --git a/include/linux/ipmi_smi.h b/include/linux/ipmi_smi.h index 4b48318ac542..906590aa6907 100644 --- a/include/linux/ipmi_smi.h +++ b/include/linux/ipmi_smi.h | |||
@@ -39,6 +39,7 @@ | |||
39 | #include <linux/module.h> | 39 | #include <linux/module.h> |
40 | #include <linux/device.h> | 40 | #include <linux/device.h> |
41 | #include <linux/platform_device.h> | 41 | #include <linux/platform_device.h> |
42 | #include <linux/ipmi.h> | ||
42 | 43 | ||
43 | /* This files describes the interface for IPMI system management interface | 44 | /* This files describes the interface for IPMI system management interface |
44 | drivers to bind into the IPMI message handler. */ | 45 | drivers to bind into the IPMI message handler. */ |
@@ -86,6 +87,13 @@ struct ipmi_smi_handlers { | |||
86 | int (*start_processing)(void *send_info, | 87 | int (*start_processing)(void *send_info, |
87 | ipmi_smi_t new_intf); | 88 | ipmi_smi_t new_intf); |
88 | 89 | ||
90 | /* | ||
91 | * Get the detailed private info of the low level interface and store | ||
92 | * it into the structure of ipmi_smi_data. For example: the | ||
93 | * ACPI device handle will be returned for the pnp_acpi IPMI device. | ||
94 | */ | ||
95 | int (*get_smi_info)(void *send_info, struct ipmi_smi_info *data); | ||
96 | |||
89 | /* Called to enqueue an SMI message to be sent. This | 97 | /* Called to enqueue an SMI message to be sent. This |
90 | operation is not allowed to fail. If an error occurs, it | 98 | operation is not allowed to fail. If an error occurs, it |
91 | should report back the error in a received message. It may | 99 | should report back the error in a received message. It may |
diff --git a/include/linux/suspend.h b/include/linux/suspend.h index c1f499835b2a..5a89e3612875 100644 --- a/include/linux/suspend.h +++ b/include/linux/suspend.h | |||
@@ -258,23 +258,6 @@ static inline int hibernate(void) { return -ENOSYS; } | |||
258 | static inline bool system_entering_hibernation(void) { return false; } | 258 | static inline bool system_entering_hibernation(void) { return false; } |
259 | #endif /* CONFIG_HIBERNATION */ | 259 | #endif /* CONFIG_HIBERNATION */ |
260 | 260 | ||
261 | #ifdef CONFIG_SUSPEND_NVS | ||
262 | extern int suspend_nvs_register(unsigned long start, unsigned long size); | ||
263 | extern int suspend_nvs_alloc(void); | ||
264 | extern void suspend_nvs_free(void); | ||
265 | extern void suspend_nvs_save(void); | ||
266 | extern void suspend_nvs_restore(void); | ||
267 | #else /* CONFIG_SUSPEND_NVS */ | ||
268 | static inline int suspend_nvs_register(unsigned long a, unsigned long b) | ||
269 | { | ||
270 | return 0; | ||
271 | } | ||
272 | static inline int suspend_nvs_alloc(void) { return 0; } | ||
273 | static inline void suspend_nvs_free(void) {} | ||
274 | static inline void suspend_nvs_save(void) {} | ||
275 | static inline void suspend_nvs_restore(void) {} | ||
276 | #endif /* CONFIG_SUSPEND_NVS */ | ||
277 | |||
278 | #ifdef CONFIG_PM_SLEEP | 261 | #ifdef CONFIG_PM_SLEEP |
279 | void save_processor_state(void); | 262 | void save_processor_state(void); |
280 | void restore_processor_state(void); | 263 | void restore_processor_state(void); |
diff --git a/include/linux/thermal.h b/include/linux/thermal.h index 1de8b9eb841b..8651556dbd52 100644 --- a/include/linux/thermal.h +++ b/include/linux/thermal.h | |||
@@ -77,7 +77,7 @@ struct thermal_cooling_device { | |||
77 | char type[THERMAL_NAME_LENGTH]; | 77 | char type[THERMAL_NAME_LENGTH]; |
78 | struct device device; | 78 | struct device device; |
79 | void *devdata; | 79 | void *devdata; |
80 | struct thermal_cooling_device_ops *ops; | 80 | const struct thermal_cooling_device_ops *ops; |
81 | struct list_head node; | 81 | struct list_head node; |
82 | }; | 82 | }; |
83 | 83 | ||
@@ -114,7 +114,7 @@ struct thermal_zone_device { | |||
114 | int last_temperature; | 114 | int last_temperature; |
115 | bool passive; | 115 | bool passive; |
116 | unsigned int forced_passive; | 116 | unsigned int forced_passive; |
117 | struct thermal_zone_device_ops *ops; | 117 | const struct thermal_zone_device_ops *ops; |
118 | struct list_head cooling_devices; | 118 | struct list_head cooling_devices; |
119 | struct idr idr; | 119 | struct idr idr; |
120 | struct mutex lock; /* protect cooling devices list */ | 120 | struct mutex lock; /* protect cooling devices list */ |
@@ -127,13 +127,41 @@ struct thermal_zone_device { | |||
127 | struct thermal_hwmon_attr temp_crit; /* hwmon sys attr */ | 127 | struct thermal_hwmon_attr temp_crit; /* hwmon sys attr */ |
128 | #endif | 128 | #endif |
129 | }; | 129 | }; |
130 | /* Adding event notification support elements */ | ||
131 | #define THERMAL_GENL_FAMILY_NAME "thermal_event" | ||
132 | #define THERMAL_GENL_VERSION 0x01 | ||
133 | #define THERMAL_GENL_MCAST_GROUP_NAME "thermal_mc_group" | ||
134 | |||
135 | enum events { | ||
136 | THERMAL_AUX0, | ||
137 | THERMAL_AUX1, | ||
138 | THERMAL_CRITICAL, | ||
139 | THERMAL_DEV_FAULT, | ||
140 | }; | ||
141 | |||
142 | struct thermal_genl_event { | ||
143 | u32 orig; | ||
144 | enum events event; | ||
145 | }; | ||
146 | /* attributes of thermal_genl_family */ | ||
147 | enum { | ||
148 | THERMAL_GENL_ATTR_UNSPEC, | ||
149 | THERMAL_GENL_ATTR_EVENT, | ||
150 | __THERMAL_GENL_ATTR_MAX, | ||
151 | }; | ||
152 | #define THERMAL_GENL_ATTR_MAX (__THERMAL_GENL_ATTR_MAX - 1) | ||
153 | |||
154 | /* commands supported by the thermal_genl_family */ | ||
155 | enum { | ||
156 | THERMAL_GENL_CMD_UNSPEC, | ||
157 | THERMAL_GENL_CMD_EVENT, | ||
158 | __THERMAL_GENL_CMD_MAX, | ||
159 | }; | ||
160 | #define THERMAL_GENL_CMD_MAX (__THERMAL_GENL_CMD_MAX - 1) | ||
130 | 161 | ||
131 | struct thermal_zone_device *thermal_zone_device_register(char *, int, void *, | 162 | struct thermal_zone_device *thermal_zone_device_register(char *, int, void *, |
132 | struct | 163 | const struct thermal_zone_device_ops *, int tc1, int tc2, |
133 | thermal_zone_device_ops | 164 | int passive_freq, int polling_freq); |
134 | *, int tc1, int tc2, | ||
135 | int passive_freq, | ||
136 | int polling_freq); | ||
137 | void thermal_zone_device_unregister(struct thermal_zone_device *); | 165 | void thermal_zone_device_unregister(struct thermal_zone_device *); |
138 | 166 | ||
139 | int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, | 167 | int thermal_zone_bind_cooling_device(struct thermal_zone_device *, int, |
@@ -142,9 +170,8 @@ int thermal_zone_unbind_cooling_device(struct thermal_zone_device *, int, | |||
142 | struct thermal_cooling_device *); | 170 | struct thermal_cooling_device *); |
143 | void thermal_zone_device_update(struct thermal_zone_device *); | 171 | void thermal_zone_device_update(struct thermal_zone_device *); |
144 | struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, | 172 | struct thermal_cooling_device *thermal_cooling_device_register(char *, void *, |
145 | struct | 173 | const struct thermal_cooling_device_ops *); |
146 | thermal_cooling_device_ops | ||
147 | *); | ||
148 | void thermal_cooling_device_unregister(struct thermal_cooling_device *); | 174 | void thermal_cooling_device_unregister(struct thermal_cooling_device *); |
175 | extern int generate_netlink_event(u32 orig, enum events event); | ||
149 | 176 | ||
150 | #endif /* __THERMAL_H__ */ | 177 | #endif /* __THERMAL_H__ */ |