sdvar.h 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /* $OpenBSD: sdvar.h,v 1.42 2013/10/02 18:59:04 krw Exp $ */
  2. /* $NetBSD: sdvar.h,v 1.7 1998/08/17 00:49:03 mycroft Exp $ */
  3. /*-
  4. * Copyright (c) 1998 The NetBSD Foundation, Inc.
  5. * All rights reserved.
  6. *
  7. * This code is derived from software contributed to The NetBSD Foundation
  8. * by Charles M. Hannum.
  9. *
  10. * Redistribution and use in source and binary forms, with or without
  11. * modification, are permitted provided that the following conditions
  12. * are met:
  13. * 1. Redistributions of source code must retain the above copyright
  14. * notice, this list of conditions and the following disclaimer.
  15. * 2. Redistributions in binary form must reproduce the above copyright
  16. * notice, this list of conditions and the following disclaimer in the
  17. * documentation and/or other materials provided with the distribution.
  18. *
  19. * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  20. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  21. * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  22. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
  23. * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  24. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  25. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  26. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  27. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  28. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  29. * POSSIBILITY OF SUCH DAMAGE.
  30. */
  31. /*
  32. * Originally written by Julian Elischer (julian@dialix.oz.au)
  33. * for TRW Financial Systems for use under the MACH(2.5) operating system.
  34. *
  35. * TRW Financial Systems, in accordance with their agreement with Carnegie
  36. * Mellon University, makes this software available to CMU to distribute
  37. * or use in any manner that they see fit as long as this message is kept with
  38. * the software. For this reason TFS also grants any other persons or
  39. * organisations permission to use or modify this software.
  40. *
  41. * TFS supplies this software to be publicly redistributed
  42. * on the understanding that TFS is not responsible for the correct
  43. * functioning of this software in any circumstances.
  44. *
  45. * Ported to run under 386BSD by Julian Elischer (julian@dialix.oz.au) Sept 1992
  46. */
  47. #ifdef _KERNEL
  48. struct sd_softc {
  49. struct device sc_dev;
  50. struct disk sc_dk;
  51. struct bufq sc_bufq;
  52. int flags;
  53. #define SDF_ANCIENT 0x10 /* disk is ancient; for minphys */
  54. #define SDF_DIRTY 0x20 /* disk is dirty; needs cache flush */
  55. #define SDF_DYING 0x40 /* dying, when deactivated */
  56. #define SDF_WAITING 0x80
  57. #define SDF_THIN 0x01 /* disk is thin provisioned */
  58. struct scsi_link *sc_link; /* contains our targ, lun, etc. */
  59. struct disk_parms {
  60. u_long heads; /* number of heads */
  61. u_long cyls; /* number of cylinders */
  62. u_long sectors; /* number of sectors/track */
  63. u_long secsize; /* number of bytes/sector */
  64. u_int64_t disksize; /* total number sectors */
  65. u_int32_t unmap_sectors; /* maximum sectors/unmap */
  66. u_int32_t unmap_descs; /* maximum descriptors/unmap */
  67. } params;
  68. void *sc_sdhook; /* our shutdown hook */
  69. struct timeout sc_timeout;
  70. struct scsi_xshandler sc_xsh;
  71. };
  72. #define SDGP_RESULT_OK 0 /* parameters obtained */
  73. #define SDGP_RESULT_OFFLINE 1 /* no media, or otherwise losing */
  74. #endif /* _KERNEL */