pnpbios.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. /*
  2. * Include file for the interface to a PnP BIOS
  3. *
  4. * Original BIOS code (C) 1998 Christian Schmidt (chr.schmidt@tu-bs.de)
  5. * PnP handler parts (c) 1998 Tom Lees <tom@lpsg.demon.co.uk>
  6. * Minor reorganizations by David Hinds <dahinds@users.sourceforge.net>
  7. *
  8. * This program is free software; you can redistribute it and/or modify it
  9. * under the terms of the GNU General Public License as published by the
  10. * Free Software Foundation; either version 2, or (at your option) any
  11. * later version.
  12. *
  13. * This program is distributed in the hope that it will be useful, but
  14. * WITHOUT ANY WARRANTY; without even the implied warranty of
  15. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  16. * General Public License for more details.
  17. *
  18. * You should have received a copy of the GNU General Public License
  19. * along with this program; if not, write to the Free Software
  20. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  21. */
  22. #ifndef _LINUX_PNPBIOS_H
  23. #define _LINUX_PNPBIOS_H
  24. #ifdef __KERNEL__
  25. #include <linux/types.h>
  26. #include <linux/pnp.h>
  27. /*
  28. * Return codes
  29. */
  30. #define PNP_SUCCESS 0x00
  31. #define PNP_NOT_SET_STATICALLY 0x7f
  32. #define PNP_UNKNOWN_FUNCTION 0x81
  33. #define PNP_FUNCTION_NOT_SUPPORTED 0x82
  34. #define PNP_INVALID_HANDLE 0x83
  35. #define PNP_BAD_PARAMETER 0x84
  36. #define PNP_SET_FAILED 0x85
  37. #define PNP_EVENTS_NOT_PENDING 0x86
  38. #define PNP_SYSTEM_NOT_DOCKED 0x87
  39. #define PNP_NO_ISA_PNP_CARDS 0x88
  40. #define PNP_UNABLE_TO_DETERMINE_DOCK_CAPABILITIES 0x89
  41. #define PNP_CONFIG_CHANGE_FAILED_NO_BATTERY 0x8a
  42. #define PNP_CONFIG_CHANGE_FAILED_RESOURCE_CONFLICT 0x8b
  43. #define PNP_BUFFER_TOO_SMALL 0x8c
  44. #define PNP_USE_ESCD_SUPPORT 0x8d
  45. #define PNP_MESSAGE_NOT_SUPPORTED 0x8e
  46. #define PNP_HARDWARE_ERROR 0x8f
  47. #define ESCD_SUCCESS 0x00
  48. #define ESCD_IO_ERROR_READING 0x55
  49. #define ESCD_INVALID 0x56
  50. #define ESCD_BUFFER_TOO_SMALL 0x59
  51. #define ESCD_NVRAM_TOO_SMALL 0x5a
  52. #define ESCD_FUNCTION_NOT_SUPPORTED 0x81
  53. /*
  54. * Events that can be received by "get event"
  55. */
  56. #define PNPEV_ABOUT_TO_CHANGE_CONFIG 0x0001
  57. #define PNPEV_DOCK_CHANGED 0x0002
  58. #define PNPEV_SYSTEM_DEVICE_CHANGED 0x0003
  59. #define PNPEV_CONFIG_CHANGED_FAILED 0x0004
  60. #define PNPEV_UNKNOWN_SYSTEM_EVENT 0xffff
  61. /* 0x8000 through 0xfffe are OEM defined */
  62. /*
  63. * Messages that should be sent through "send message"
  64. */
  65. #define PNPMSG_OK 0x00
  66. #define PNPMSG_ABORT 0x01
  67. #define PNPMSG_UNDOCK_DEFAULT_ACTION 0x40
  68. #define PNPMSG_POWER_OFF 0x41
  69. #define PNPMSG_PNP_OS_ACTIVE 0x42
  70. #define PNPMSG_PNP_OS_INACTIVE 0x43
  71. /*
  72. * Plug and Play BIOS flags
  73. */
  74. #define PNPBIOS_NO_DISABLE 0x0001
  75. #define PNPBIOS_NO_CONFIG 0x0002
  76. #define PNPBIOS_OUTPUT 0x0004
  77. #define PNPBIOS_INPUT 0x0008
  78. #define PNPBIOS_BOOTABLE 0x0010
  79. #define PNPBIOS_DOCK 0x0020
  80. #define PNPBIOS_REMOVABLE 0x0040
  81. #define pnpbios_is_static(x) (((x)->flags & 0x0100) == 0x0000)
  82. #define pnpbios_is_dynamic(x) ((x)->flags & 0x0080)
  83. /*
  84. * Function Parameters
  85. */
  86. #define PNPMODE_STATIC 1
  87. #define PNPMODE_DYNAMIC 0
  88. /* 0x8000 through 0xffff are OEM defined */
  89. #pragma pack(1)
  90. struct pnp_dev_node_info {
  91. __u16 no_nodes;
  92. __u16 max_node_size;
  93. };
  94. struct pnp_docking_station_info {
  95. __u32 location_id;
  96. __u32 serial;
  97. __u16 capabilities;
  98. };
  99. struct pnp_isa_config_struc {
  100. __u8 revision;
  101. __u8 no_csns;
  102. __u16 isa_rd_data_port;
  103. __u16 reserved;
  104. };
  105. struct escd_info_struc {
  106. __u16 min_escd_write_size;
  107. __u16 escd_size;
  108. __u32 nv_storage_base;
  109. };
  110. struct pnp_bios_node {
  111. __u16 size;
  112. __u8 handle;
  113. __u32 eisa_id;
  114. __u8 type_code[3];
  115. __u16 flags;
  116. __u8 data[0];
  117. };
  118. #pragma pack()
  119. #ifdef CONFIG_PNPBIOS
  120. /* non-exported */
  121. extern struct pnp_dev_node_info node_info;
  122. extern int pnp_bios_dev_node_info (struct pnp_dev_node_info *data);
  123. extern int pnp_bios_get_dev_node (u8 *nodenum, char config, struct pnp_bios_node *data);
  124. extern int pnp_bios_set_dev_node (u8 nodenum, char config, struct pnp_bios_node *data);
  125. extern int pnp_bios_get_stat_res (char *info);
  126. extern int pnp_bios_isapnp_config (struct pnp_isa_config_struc *data);
  127. extern int pnp_bios_escd_info (struct escd_info_struc *data);
  128. extern int pnp_bios_read_escd (char *data, u32 nvram_base);
  129. extern int pnp_bios_dock_station_info(struct pnp_docking_station_info *data);
  130. #define needed 0
  131. #if needed
  132. extern int pnp_bios_get_event (u16 *message);
  133. extern int pnp_bios_send_message (u16 message);
  134. extern int pnp_bios_set_stat_res (char *info);
  135. extern int pnp_bios_apm_id_table (char *table, u16 *size);
  136. extern int pnp_bios_write_escd (char *data, u32 nvram_base);
  137. #endif
  138. #endif /* CONFIG_PNPBIOS */
  139. #endif /* __KERNEL__ */
  140. #endif /* _LINUX_PNPBIOS_H */