diff options
| author | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-05-15 10:26:50 -0400 |
|---|---|---|
| committer | Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> | 2013-05-15 10:26:50 -0400 |
| commit | 12e04ffcd93b25dfd726d46338c2ee7d23de556e (patch) | |
| tree | f91479a62805619168994fd3ee55e3ffa23fc24e /include/linux/efi.h | |
| parent | 9eff37a8713939f218ab8bf0dc93f1d67af7b8b4 (diff) | |
| parent | f722406faae2d073cc1d01063d1123c35425939e (diff) | |
Merge tag 'v3.10-rc1' into stable/for-linus-3.10
Linux 3.10-rc1
* tag 'v3.10-rc1': (12273 commits)
Linux 3.10-rc1
[SCSI] qla2xxx: Update firmware link in Kconfig file.
[SCSI] iscsi class, qla4xxx: fix sess/conn refcounting when find fns are used
[SCSI] sas: unify the pointlessly separated enums sas_dev_type and sas_device_type
[SCSI] pm80xx: thermal, sas controller config and error handling update
[SCSI] pm80xx: NCQ error handling changes
[SCSI] pm80xx: WWN Modification for PM8081/88/89 controllers
[SCSI] pm80xx: Changed module name and debug messages update
[SCSI] pm80xx: Firmware flash memory free fix, with addition of new memory region for it
[SCSI] pm80xx: SPC new firmware changes for device id 0x8081 alone
[SCSI] pm80xx: Added SPCv/ve specific hardware functionalities and relevant changes in common files
[SCSI] pm80xx: MSI-X implementation for using 64 interrupts
[SCSI] pm80xx: Updated common functions common for SPC and SPCv/ve
[SCSI] pm80xx: Multiple inbound/outbound queue configuration
[SCSI] pm80xx: Added SPCv/ve specific ids, variables and modify for SPC
[SCSI] lpfc: fix up Kconfig dependencies
[SCSI] Handle MLQUEUE busy response in scsi_send_eh_cmnd
dm cache: set config value
dm cache: move config fns
dm thin: generate event when metadata threshold passed
...
Diffstat (limited to 'include/linux/efi.h')
| -rw-r--r-- | include/linux/efi.h | 99 |
1 files changed, 90 insertions, 9 deletions
diff --git a/include/linux/efi.h b/include/linux/efi.h index 9bf2f1fcae27..2bc0ad78d058 100644 --- a/include/linux/efi.h +++ b/include/linux/efi.h | |||
| @@ -333,6 +333,7 @@ typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules, | |||
| 333 | unsigned long count, | 333 | unsigned long count, |
| 334 | u64 *max_size, | 334 | u64 *max_size, |
| 335 | int *reset_type); | 335 | int *reset_type); |
| 336 | typedef efi_status_t efi_query_variable_store_t(u32 attributes, unsigned long size); | ||
| 336 | 337 | ||
| 337 | /* | 338 | /* |
| 338 | * EFI Configuration Table and GUID definitions | 339 | * EFI Configuration Table and GUID definitions |
| @@ -575,9 +576,15 @@ extern void efi_enter_virtual_mode (void); /* switch EFI to virtual mode, if pos | |||
| 575 | #ifdef CONFIG_X86 | 576 | #ifdef CONFIG_X86 |
| 576 | extern void efi_late_init(void); | 577 | extern void efi_late_init(void); |
| 577 | extern void efi_free_boot_services(void); | 578 | extern void efi_free_boot_services(void); |
| 579 | extern efi_status_t efi_query_variable_store(u32 attributes, unsigned long size); | ||
| 578 | #else | 580 | #else |
| 579 | static inline void efi_late_init(void) {} | 581 | static inline void efi_late_init(void) {} |
| 580 | static inline void efi_free_boot_services(void) {} | 582 | static inline void efi_free_boot_services(void) {} |
| 583 | |||
| 584 | static inline efi_status_t efi_query_variable_store(u32 attributes, unsigned long size) | ||
| 585 | { | ||
| 586 | return EFI_SUCCESS; | ||
| 587 | } | ||
| 581 | #endif | 588 | #endif |
| 582 | extern void __iomem *efi_lookup_mapped_addr(u64 phys_addr); | 589 | extern void __iomem *efi_lookup_mapped_addr(u64 phys_addr); |
| 583 | extern u64 efi_get_iobase (void); | 590 | extern u64 efi_get_iobase (void); |
| @@ -663,6 +670,12 @@ static inline int efi_enabled(int facility) | |||
| 663 | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS | \ | 670 | EFI_VARIABLE_TIME_BASED_AUTHENTICATED_WRITE_ACCESS | \ |
| 664 | EFI_VARIABLE_APPEND_WRITE) | 671 | EFI_VARIABLE_APPEND_WRITE) |
| 665 | /* | 672 | /* |
| 673 | * Length of a GUID string (strlen("aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee")) | ||
| 674 | * not including trailing NUL | ||
| 675 | */ | ||
| 676 | #define EFI_VARIABLE_GUID_LEN 36 | ||
| 677 | |||
| 678 | /* | ||
| 666 | * The type of search to perform when calling boottime->locate_handle | 679 | * The type of search to perform when calling boottime->locate_handle |
| 667 | */ | 680 | */ |
| 668 | #define EFI_LOCATE_ALL_HANDLES 0 | 681 | #define EFI_LOCATE_ALL_HANDLES 0 |
| @@ -719,7 +732,6 @@ static inline void memrange_efi_to_native(u64 *addr, u64 *npages) | |||
| 719 | *addr &= PAGE_MASK; | 732 | *addr &= PAGE_MASK; |
| 720 | } | 733 | } |
| 721 | 734 | ||
| 722 | #if defined(CONFIG_EFI_VARS) || defined(CONFIG_EFI_VARS_MODULE) | ||
| 723 | /* | 735 | /* |
| 724 | * EFI Variable support. | 736 | * EFI Variable support. |
| 725 | * | 737 | * |
| @@ -731,7 +743,7 @@ struct efivar_operations { | |||
| 731 | efi_get_variable_t *get_variable; | 743 | efi_get_variable_t *get_variable; |
| 732 | efi_get_next_variable_t *get_next_variable; | 744 | efi_get_next_variable_t *get_next_variable; |
| 733 | efi_set_variable_t *set_variable; | 745 | efi_set_variable_t *set_variable; |
| 734 | efi_query_variable_info_t *query_variable_info; | 746 | efi_query_variable_store_t *query_variable_store; |
| 735 | }; | 747 | }; |
| 736 | 748 | ||
| 737 | struct efivars { | 749 | struct efivars { |
| @@ -745,19 +757,88 @@ struct efivars { | |||
| 745 | * which is protected by the BKL, so that path is safe. | 757 | * which is protected by the BKL, so that path is safe. |
| 746 | */ | 758 | */ |
| 747 | spinlock_t lock; | 759 | spinlock_t lock; |
| 748 | struct list_head list; | ||
| 749 | struct kset *kset; | 760 | struct kset *kset; |
| 750 | struct kobject *kobject; | 761 | struct kobject *kobject; |
| 751 | struct bin_attribute *new_var, *del_var; | ||
| 752 | const struct efivar_operations *ops; | 762 | const struct efivar_operations *ops; |
| 753 | struct efivar_entry *walk_entry; | ||
| 754 | struct pstore_info efi_pstore_info; | ||
| 755 | }; | 763 | }; |
| 756 | 764 | ||
| 757 | int register_efivars(struct efivars *efivars, | 765 | /* |
| 766 | * The maximum size of VariableName + Data = 1024 | ||
| 767 | * Therefore, it's reasonable to save that much | ||
| 768 | * space in each part of the structure, | ||
| 769 | * and we use a page for reading/writing. | ||
| 770 | */ | ||
| 771 | |||
| 772 | struct efi_variable { | ||
| 773 | efi_char16_t VariableName[1024/sizeof(efi_char16_t)]; | ||
| 774 | efi_guid_t VendorGuid; | ||
| 775 | unsigned long DataSize; | ||
| 776 | __u8 Data[1024]; | ||
| 777 | efi_status_t Status; | ||
| 778 | __u32 Attributes; | ||
| 779 | } __attribute__((packed)); | ||
| 780 | |||
| 781 | struct efivar_entry { | ||
| 782 | struct efi_variable var; | ||
| 783 | struct list_head list; | ||
| 784 | struct kobject kobj; | ||
| 785 | }; | ||
| 786 | |||
| 787 | extern struct list_head efivar_sysfs_list; | ||
| 788 | |||
| 789 | static inline void | ||
| 790 | efivar_unregister(struct efivar_entry *var) | ||
| 791 | { | ||
| 792 | kobject_put(&var->kobj); | ||
| 793 | } | ||
| 794 | |||
| 795 | int efivars_register(struct efivars *efivars, | ||
| 758 | const struct efivar_operations *ops, | 796 | const struct efivar_operations *ops, |
| 759 | struct kobject *parent_kobj); | 797 | struct kobject *kobject); |
| 760 | void unregister_efivars(struct efivars *efivars); | 798 | int efivars_unregister(struct efivars *efivars); |
| 799 | struct kobject *efivars_kobject(void); | ||
| 800 | |||
| 801 | int efivar_init(int (*func)(efi_char16_t *, efi_guid_t, unsigned long, void *), | ||
| 802 | void *data, bool atomic, bool duplicates, | ||
| 803 | struct list_head *head); | ||
| 804 | |||
| 805 | void efivar_entry_add(struct efivar_entry *entry, struct list_head *head); | ||
| 806 | void efivar_entry_remove(struct efivar_entry *entry); | ||
| 807 | |||
| 808 | int __efivar_entry_delete(struct efivar_entry *entry); | ||
| 809 | int efivar_entry_delete(struct efivar_entry *entry); | ||
| 810 | |||
| 811 | int efivar_entry_size(struct efivar_entry *entry, unsigned long *size); | ||
| 812 | int __efivar_entry_get(struct efivar_entry *entry, u32 *attributes, | ||
| 813 | unsigned long *size, void *data); | ||
| 814 | int efivar_entry_get(struct efivar_entry *entry, u32 *attributes, | ||
| 815 | unsigned long *size, void *data); | ||
| 816 | int efivar_entry_set(struct efivar_entry *entry, u32 attributes, | ||
| 817 | unsigned long size, void *data, struct list_head *head); | ||
| 818 | int efivar_entry_set_get_size(struct efivar_entry *entry, u32 attributes, | ||
| 819 | unsigned long *size, void *data, bool *set); | ||
| 820 | int efivar_entry_set_safe(efi_char16_t *name, efi_guid_t vendor, u32 attributes, | ||
| 821 | bool block, unsigned long size, void *data); | ||
| 822 | |||
| 823 | void efivar_entry_iter_begin(void); | ||
| 824 | void efivar_entry_iter_end(void); | ||
| 825 | |||
| 826 | int __efivar_entry_iter(int (*func)(struct efivar_entry *, void *), | ||
| 827 | struct list_head *head, void *data, | ||
| 828 | struct efivar_entry **prev); | ||
| 829 | int efivar_entry_iter(int (*func)(struct efivar_entry *, void *), | ||
| 830 | struct list_head *head, void *data); | ||
| 831 | |||
| 832 | struct efivar_entry *efivar_entry_find(efi_char16_t *name, efi_guid_t guid, | ||
| 833 | struct list_head *head, bool remove); | ||
| 834 | |||
| 835 | bool efivar_validate(struct efi_variable *var, u8 *data, unsigned long len); | ||
| 836 | |||
| 837 | extern struct work_struct efivar_work; | ||
| 838 | void efivar_run_worker(void); | ||
| 839 | |||
| 840 | #if defined(CONFIG_EFI_VARS) || defined(CONFIG_EFI_VARS_MODULE) | ||
| 841 | int efivars_sysfs_init(void); | ||
| 761 | 842 | ||
| 762 | #endif /* CONFIG_EFI_VARS */ | 843 | #endif /* CONFIG_EFI_VARS */ |
| 763 | 844 | ||
