cardbus_exrom.h 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. /* $OpenBSD: cardbus_exrom.h,v 1.4 2013/06/20 09:52:09 mpi Exp $ */
  2. /* $NetBSD: cardbus_exrom.h,v 1.2 1999/12/15 12:28:54 kleink Exp $ */
  3. /*
  4. * Copyright (c) 1999 The NetBSD Foundation, Inc.
  5. * All rights reserved.
  6. *
  7. * This code is derived from software contributed to
  8. * The NetBSD Foundation by Johan Danielsson.
  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. *
  14. * 1. Redistributions of source code must retain the above copyright
  15. * notice, this list of conditions and the following disclaimer.
  16. *
  17. * 2. Redistributions in binary form must reproduce the above copyright
  18. * notice, this list of conditions and the following disclaimer in the
  19. * documentation and/or other materials provided with the distribution.
  20. *
  21. *
  22. * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
  23. * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
  24. * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
  25. * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
  26. * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  27. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  28. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
  29. * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
  30. * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  31. * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  32. * POSSIBILITY OF SUCH DAMAGE.
  33. */
  34. #ifndef _DEV_CARDBUS_CARDBUS_EXROM_H_
  35. #define _DEV_CARDBUS_CARDBUS_EXROM_H_
  36. /* PCI ROM header fields */
  37. #define CARDBUS_EXROM_SIGNATURE 0x00
  38. #define CARDBUS_EXROM_DATA_PTR 0x18
  39. /* PCI ROM data structure fields */
  40. #define CARDBUS_EXROM_DATA_SIGNATURE 0x00 /* Signature ("PCIR") */
  41. #define CARDBUS_EXROM_DATA_VENDOR_ID 0x04 /* Vendor Identification */
  42. #define CARDBUS_EXROM_DATA_DEVICE_ID 0x06 /* Device Identification */
  43. #define CARDBUS_EXROM_DATA_LENGTH 0x0a /* PCI Data Structure Length */
  44. #define CARDBUS_EXROM_DATA_REV 0x0c /* PCI Data Structure Revision */
  45. #define CARDBUS_EXROM_DATA_CLASS_CODE 0x0d /* Class Code */
  46. #define CARDBUS_EXROM_DATA_IMAGE_LENGTH 0x10 /* Image Length */
  47. #define CARDBUS_EXROM_DATA_DATA_REV 0x12 /* Revision Level of Code/Data */
  48. #define CARDBUS_EXROM_DATA_CODE_TYPE 0x14 /* Code Type */
  49. #define CARDBUS_EXROM_DATA_INDICATOR 0x15 /* Indicator */
  50. struct cardbus_rom_image {
  51. unsigned int rom_image; /* image number */
  52. size_t image_size;
  53. bus_space_tag_t romt;
  54. bus_space_handle_t romh; /* subregion */
  55. SIMPLEQ_ENTRY(cardbus_rom_image) next;
  56. };
  57. SIMPLEQ_HEAD(cardbus_rom_image_head, cardbus_rom_image);
  58. int cardbus_read_exrom(bus_space_tag_t, bus_space_handle_t,
  59. struct cardbus_rom_image_head *);
  60. #endif /* !_DEV_CARDBUS_CARDBUS_EXROM_H_ */