~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/sed-opal.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 /*
  3  * Copyright © 2016 Intel Corporation
  4  *
  5  * Authors:
  6  *    Rafael Antognolli <rafael.antognolli@intel.com>
  7  *    Scott  Bauer      <scott.bauer@intel.com>
  8  */
  9 
 10 #ifndef LINUX_OPAL_H
 11 #define LINUX_OPAL_H
 12 
 13 #include <uapi/linux/sed-opal.h>
 14 #include <linux/compiler_types.h>
 15 #include <linux/types.h>
 16 
 17 struct opal_dev;
 18 
 19 typedef int (sec_send_recv)(void *data, u16 spsp, u8 secp, void *buffer,
 20                 size_t len, bool send);
 21 
 22 #ifdef CONFIG_BLK_SED_OPAL
 23 void free_opal_dev(struct opal_dev *dev);
 24 bool opal_unlock_from_suspend(struct opal_dev *dev);
 25 struct opal_dev *init_opal_dev(void *data, sec_send_recv *send_recv);
 26 int sed_ioctl(struct opal_dev *dev, unsigned int cmd, void __user *ioctl_ptr);
 27 
 28 #define OPAL_AUTH_KEY           "opal-boot-pin"
 29 #define OPAL_AUTH_KEY_PREV      "opal-boot-pin-prev"
 30 
 31 static inline bool is_sed_ioctl(unsigned int cmd)
 32 {
 33         switch (cmd) {
 34         case IOC_OPAL_SAVE:
 35         case IOC_OPAL_LOCK_UNLOCK:
 36         case IOC_OPAL_TAKE_OWNERSHIP:
 37         case IOC_OPAL_ACTIVATE_LSP:
 38         case IOC_OPAL_SET_PW:
 39         case IOC_OPAL_ACTIVATE_USR:
 40         case IOC_OPAL_REVERT_TPR:
 41         case IOC_OPAL_LR_SETUP:
 42         case IOC_OPAL_ADD_USR_TO_LR:
 43         case IOC_OPAL_ENABLE_DISABLE_MBR:
 44         case IOC_OPAL_ERASE_LR:
 45         case IOC_OPAL_SECURE_ERASE_LR:
 46         case IOC_OPAL_PSID_REVERT_TPR:
 47         case IOC_OPAL_MBR_DONE:
 48         case IOC_OPAL_WRITE_SHADOW_MBR:
 49         case IOC_OPAL_GENERIC_TABLE_RW:
 50         case IOC_OPAL_GET_STATUS:
 51         case IOC_OPAL_GET_LR_STATUS:
 52         case IOC_OPAL_GET_GEOMETRY:
 53         case IOC_OPAL_DISCOVERY:
 54         case IOC_OPAL_REVERT_LSP:
 55                 return true;
 56         }
 57         return false;
 58 }
 59 #else
 60 static inline void free_opal_dev(struct opal_dev *dev)
 61 {
 62 }
 63 
 64 static inline bool is_sed_ioctl(unsigned int cmd)
 65 {
 66         return false;
 67 }
 68 
 69 static inline int sed_ioctl(struct opal_dev *dev, unsigned int cmd,
 70                             void __user *ioctl_ptr)
 71 {
 72         return 0;
 73 }
 74 static inline bool opal_unlock_from_suspend(struct opal_dev *dev)
 75 {
 76         return false;
 77 }
 78 #define init_opal_dev(data, send_recv)          NULL
 79 #endif /* CONFIG_BLK_SED_OPAL */
 80 #endif /* LINUX_OPAL_H */
 81 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php