aic_isapnp.c 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /* $OpenBSD: aic_isapnp.c,v 1.1 2002/09/03 16:30:55 mickey Exp $ */
  2. /*
  3. * Copyright (c) 2002 Anders Arnholm
  4. * All rights reserved.
  5. *
  6. * Redistribution and use in source and binary forms, with or without
  7. * modification, are permitted provided that the following conditions
  8. * are met:
  9. * 1. Redistributions of source code must retain the above copyright
  10. * notice, this list of conditions and the following disclaimer.
  11. * 2. Redistributions in binary form must reproduce the above copyright
  12. * notice, this list of conditions and the following disclaimer in the
  13. * documentation and/or other materials provided with the distribution.
  14. * 3. The name of the author may not be used to endorse or promote products
  15. * derived from this software without specific prior written permission.
  16. *
  17. * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
  18. * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  19. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  20. * DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
  21. * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  22. * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  23. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  24. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  25. * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
  26. * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  27. * POSSIBILITY OF SUCH DAMAGE.
  28. */
  29. /*
  30. * Acknowledgements: Many of the algorithms used in this driver are
  31. * inspired by the work of Julian Elischer (julian@tfs.com),
  32. * Charles Hannum (mycroft@duality.gnu.ai.mit.edu) and Jarle Greipsland.
  33. * Thanks a million!
  34. */
  35. #include <sys/param.h>
  36. #include <sys/systm.h>
  37. #include <sys/device.h>
  38. #include <machine/bus.h>
  39. #include <scsi/scsi_all.h>
  40. #include <scsi/scsiconf.h>
  41. #include <dev/isa/isavar.h>
  42. #include <dev/ic/aic6360var.h>
  43. int aic_isapnp_match(struct device *, void *, void *);
  44. void aic_isapnp_attach(struct device *, struct device *, void *);
  45. struct cfattach aic_isapnp_ca = {
  46. sizeof(struct aic_softc), aic_isapnp_match, aic_isapnp_attach
  47. };
  48. /*
  49. * INITIALIZATION ROUTINES (match, attach ++)
  50. */
  51. /*
  52. * aic_isapnp_match: isapnp code does the probing for us, and other configured
  53. * and other configured card are found by aic_isa_match
  54. */
  55. int
  56. aic_isapnp_match(parent, match, aux)
  57. struct device *parent;
  58. void *match, *aux;
  59. {
  60. AIC_TRACE(("aic: aic_isapnp_match\n"));
  61. return(1);
  62. }
  63. /*
  64. * Attach the AIC6360, takes the data from isapnp and feads into aicattach.
  65. */
  66. void
  67. aic_isapnp_attach(parent, self, aux)
  68. struct device *parent, *self;
  69. void *aux;
  70. {
  71. struct aic_softc *sc = (void *)self;
  72. struct isa_attach_args *ia = aux;
  73. AIC_TRACE(("aic: aic_isapnp_attach\n"));
  74. sc->sc_iot = ia->ia_iot;
  75. sc->sc_ioh = ia->ia_ioh;
  76. sc->sc_irq = ia->ia_irq;
  77. sc->sc_drq = ia->ia_drq;
  78. AIC_TRACE(("aic: aic_isapnp_attach isa_intr_establish(...)\n"));
  79. sc->sc_ih = isa_intr_establish(ia->ia_ic, ia->ia_irq, IST_EDGE,
  80. IPL_BIO, aicintr, sc, sc->sc_dev.dv_xname);
  81. AIC_TRACE(("aic: aic_isapnp_attach aicattach(0x%08x, 0x%08x, %d, %d)\n",
  82. sc->sc_iot, sc->sc_ioh, sc->sc_irq, sc->sc_drq));
  83. aicattach(sc);
  84. }