stp4020var.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. /* $OpenBSD: stp4020var.h,v 1.5 2009/04/10 20:54:59 miod Exp $ */
  2. /* $NetBSD: stp4020.c,v 1.23 2002/06/01 23:51:03 lukem 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 Paul Kranenburg.
  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. * STP4020: SBus/PCMCIA bridge supporting one Type-3 PCMCIA card, or up to
  33. * two Type-1 and Type-2 PCMCIA cards..
  34. */
  35. /*
  36. * Per socket data.
  37. */
  38. struct stp4020_socket {
  39. struct stp4020_softc *sc; /* Back link */
  40. int flags;
  41. #define STP4020_SOCKET_BUSY 0x0001
  42. #define STP4020_SOCKET_SHUTDOWN 0x0002
  43. #define STP4020_SOCKET_ENABLING 0x0004
  44. int sense;
  45. int sock; /* Socket number (0 or 1) */
  46. int int_enable; /* ICR0 value for interrupt enabled */
  47. int int_disable; /* ICR0 value for interrupt disabled */
  48. bus_space_tag_t tag; /* socket control space */
  49. bus_space_handle_t regs; /* */
  50. struct device *pcmcia; /* Associated PCMCIA device */
  51. int (*intrhandler) /* Card driver interrupt handler */
  52. (void *);
  53. void *intrarg; /* Card interrupt handler argument */
  54. void *softint; /* softintr cookie */
  55. bus_space_tag_t wintag; /* windows access tag */
  56. struct {
  57. bus_space_handle_t winaddr;/* this window's address */
  58. } windows[STP4020_NWIN];
  59. };
  60. struct stp4020_softc {
  61. struct device sc_dev; /* Base device */
  62. bus_space_tag_t sc_bustag;
  63. pcmcia_chipset_tag_t sc_pct; /* Chipset methods */
  64. struct proc *event_thread; /* event handling thread */
  65. unsigned int events; /* sockets with pending events */
  66. struct stp4020_socket sc_socks[STP4020_NSOCK];
  67. };
  68. void stpattach_common(struct stp4020_softc *, int);
  69. int stp4020_iointr(void *);
  70. int stp4020_statintr(void *);