io.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * This file is part of the UCB release of Plan 9. It is subject to the license
  3. * terms in the LICENSE file found in the top-level directory of this
  4. * distribution and at http://akaros.cs.berkeley.edu/files/Plan9License. No
  5. * part of the UCB release of Plan 9, including this file, may be copied,
  6. * modified, propagated, or distributed except according to the terms contained
  7. * in the LICENSE file.
  8. */
  9. enum {
  10. MaxScsi = 4,
  11. NTarget = 16,
  12. Maxnets = 8,
  13. };
  14. /*
  15. * SCSI support code.
  16. */
  17. enum {
  18. STblank =-6, /* blank block */
  19. STnomem =-5, /* buffer allocation failed */
  20. STtimeout =-4, /* bus timeout */
  21. STownid =-3, /* playing with myself */
  22. STharderr =-2, /* controller error of some kind */
  23. STinit =-1, /* */
  24. STok = 0, /* good */
  25. STcheck = 0x02, /* check condition */
  26. STcondmet = 0x04, /* condition met/good */
  27. STbusy = 0x08, /* busy */
  28. STintok = 0x10, /* intermediate/good */
  29. STintcondmet = 0x14, /* intermediate/condition met/good */
  30. STresconf = 0x18, /* reservation conflict */
  31. STterminated = 0x22, /* command terminated */
  32. STqfull = 0x28, /* queue full */
  33. };
  34. typedef struct Target {
  35. Scsi *sc; /* from openscsi */
  36. int ctlrno;
  37. int targetno;
  38. uchar* inquiry;
  39. uchar* sense;
  40. QLock;
  41. char id[NAMELEN];
  42. int ok;
  43. } Target;