blk_device.h 989 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. /*
  2. * Copyright (c) 2006-2020, RT-Thread Development Team
  3. *
  4. * SPDX-License-Identifier: Apache-2.0
  5. *
  6. * Change Logs:
  7. * Date Author Notes
  8. * 2020-08-19 lizhirui first version
  9. */
  10. #ifndef __BLK_DEVICE_H__
  11. #define __BLK_DEVICE_H__
  12. #include <rtconfig.h>
  13. #include <ext4_mbr.h>
  14. #define DEV_TYPE_UNKNOWN 0xff /* not connected */
  15. #define DEV_TYPE_HARDDISK 0x00 /* harddisk */
  16. #define DEV_TYPE_TAPE 0x01 /* Tape */
  17. #define DEV_TYPE_CDROM 0x05 /* CD-ROM */
  18. #define DEV_TYPE_OPDISK 0x07 /* optical disk */
  19. struct blk_device
  20. {
  21. struct rt_device parent;
  22. struct ahci_uc_priv *ahci_device;
  23. rt_uint8_t target;
  24. rt_uint8_t lun;
  25. rt_uint8_t type;
  26. #ifdef RT_USING_DFS_LWEXT4
  27. struct ext4_mbr_bdevs ext4_partition;
  28. #endif
  29. rt_bool_t lba48;
  30. rt_uint64_t lba;
  31. rt_uint64_t blksz;
  32. rt_int32_t log2blksz;
  33. char product[21];
  34. char revision[9];
  35. char vendor[41];
  36. };
  37. void blk_device_init(struct blk_device *blk_devices);
  38. #endif