/testbed/atapi/ataio.h

http://rtems-atapi.googlecode.com/ · C Header · 55 lines · 36 code · 12 blank · 7 comment · 0 complexity · 115e8faca02881b96da98d5bd746eebd MD5 · raw file

  1. /* $NetBSD: ataio.h,v 1.8 2007/03/04 06:03:40 christos Exp $ */
  2. #ifndef _SYS_ATAIO_H_
  3. #define _SYS_ATAIO_H_
  4. #include <sys/types.h>
  5. #include <sys/ioctl.h>
  6. typedef struct atareq {
  7. u_long flags; /* info about the request status and type */
  8. u_char command; /* command code */
  9. u_char features; /* feature modifier bits for command */
  10. u_char sec_count; /* sector count */
  11. u_char sec_num; /* sector number */
  12. u_char head; /* head number */
  13. u_short cylinder; /* cylinder/lba address */
  14. void * databuf; /* Pointer to I/O data buffer */
  15. u_long datalen; /* length of data buffer */
  16. int timeout; /* Command timeout */
  17. u_char retsts; /* the return status for the command */
  18. u_char error; /* error bits */
  19. } atareq_t;
  20. /* bit definitions for flags */
  21. #define ATACMD_READ 0x00000001
  22. #define ATACMD_WRITE 0x00000002
  23. #define ATACMD_READREG 0x00000004
  24. /* definitions for the return status (retsts) */
  25. #define ATACMD_OK 0x00
  26. #define ATACMD_TIMEOUT 0x01
  27. #define ATACMD_ERROR 0x02
  28. #define ATACMD_DF 0x03
  29. #define ATAIOCCOMMAND _IOWR('Q', 8, atareq_t)
  30. /*
  31. * ATA bus IOCTL
  32. */
  33. /* Scan bus for new devices. */
  34. struct atabusioscan_args {
  35. int at_dev; /* device to scan, -1 for wildcard */
  36. };
  37. #define ATABUSIOSCAN _IOW('A', 50, struct atabusioscan_args)
  38. #define ATABUSIORESET _IO('A', 51) /* reset ATA bus */
  39. struct atabusiodetach_args {
  40. int at_dev; /* device to detach; -1 for wildcard */
  41. };
  42. #define ATABUSIODETACH _IOW('A', 52, struct atabusiodetach_args)
  43. #endif /* _SYS_ATAIO_H_ */