devfs-types.h 535 B

12345678910111213141516171819202122232425262728293031323334
  1. #pragma once
  2. #include <filesystem/VFS/VFS.h>
  3. /**
  4. * @brief devfs_private_file_info_t的type字段值
  5. *
  6. */
  7. enum
  8. {
  9. DEV_TYPE_UNDEF = 0,
  10. DEV_TYPE_CHAR = 1,
  11. };
  12. /**
  13. * @brief 字符设备的sub_type字段值
  14. *
  15. */
  16. enum
  17. {
  18. CHAR_DEV_STYPE_PS2 = 1,
  19. CHAR_DEV_STYPE_USB,
  20. CHAR_DEV_STYPE_BLUETOOTH,
  21. };
  22. /**
  23. * @brief 设备文件私有信息结构体
  24. *
  25. */
  26. struct devfs_private_inode_info_t
  27. {
  28. uint16_t type; // 设备主类型
  29. uint16_t sub_type; // 设备子类型
  30. struct vfs_file_operations_t *f_ops;
  31. };