sec_mod.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef SECMOD_H
  2. #define SECMOD_H
  3. #include <linux/init.h>
  4. #include <linux/types.h>
  5. #include <linux/spinlock.h>
  6. #include <linux/fs.h>
  7. struct sec_ops {
  8. int (*sec_get_rid)(unsigned int *rid);
  9. };
  10. struct sec_mod {
  11. dev_t id;
  12. int init;
  13. spinlock_t lock;
  14. const struct sec_ops *ops;
  15. };
  16. /**************************************************************************
  17. * EXTERNAL VARIABLE
  18. **************************************************************************/
  19. extern const struct sec_ops *sec_get_ops(void);
  20. extern struct semaphore hacc_sem;
  21. /**************************************************************************
  22. * EXTERNAL FUNCTION
  23. **************************************************************************/
  24. extern long sec_core_ioctl(struct file *file, unsigned int cmd, unsigned long arg);
  25. extern void sec_core_init(void);
  26. extern void sec_core_exit(void);
  27. #define NUM_SBC_PUBK_HASH 8
  28. #define NUM_CRYPTO_SEED 16
  29. #define NUM_RID 4
  30. #ifdef CONFIG_OF
  31. /*device information data*/
  32. struct masp_tag {
  33. u32 size;
  34. u32 tag;
  35. unsigned int rom_info_sbc_attr;
  36. unsigned int rom_info_sdl_attr;
  37. unsigned int hw_sbcen;
  38. unsigned int lock_state;
  39. unsigned int rid[NUM_RID];
  40. /*rom_info.m_SEC_KEY.crypto_seed */
  41. unsigned char crypto_seed[NUM_CRYPTO_SEED];
  42. unsigned int sbc_pubk_hash[NUM_SBC_PUBK_HASH];
  43. };
  44. #endif
  45. #endif /* end of SECMOD_H */