disk.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #pragma src "/sys/src/libdisk"
  2. #pragma lib "libdisk.a"
  3. /* SCSI interface */
  4. typedef struct Scsi Scsi;
  5. struct Scsi {
  6. QLock;
  7. char* inquire;
  8. int rawfd;
  9. int nchange;
  10. ulong changetime;
  11. };
  12. enum {
  13. Sread = 0,
  14. Swrite,
  15. Snone,
  16. };
  17. char* scsierror(int, int);
  18. int scsicmd(Scsi*, uchar*, int, void*, int, int);
  19. int scsi(Scsi*, uchar*, int, void*, int, int);
  20. Scsi* openscsi(char*);
  21. void closescsi(Scsi*);
  22. int scsiready(Scsi*);
  23. extern int scsiverbose;
  24. /* disk partition interface */
  25. typedef struct Disk Disk;
  26. struct Disk {
  27. char *prefix;
  28. char *part;
  29. int fd;
  30. int wfd;
  31. int ctlfd;
  32. int rdonly;
  33. int type;
  34. vlong secs;
  35. vlong secsize;
  36. vlong size;
  37. vlong offset; /* within larger disk, perhaps */
  38. int width; /* of disk size in bytes as decimal string */
  39. int c;
  40. int h;
  41. int s;
  42. int chssrc;
  43. };
  44. Disk* opendisk(char*, int, int);
  45. enum {
  46. Tfile = 0,
  47. Tsd,
  48. Tfloppy,
  49. Gpart = 0, /* partition info source */
  50. Gdisk,
  51. Gguess,
  52. };
  53. /* proto file parsing */
  54. typedef void Protoenum(char *new, char *old, Dir *d, void *a);
  55. typedef void Protowarn(char *msg, void *a);
  56. int rdproto(char*, char*, Protoenum*, Protowarn*, void*);