openpromio.h 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef _SPARC_OPENPROMIO_H
  2. #define _SPARC_OPENPROMIO_H
  3. #include <linux/compiler.h>
  4. #include <linux/ioctl.h>
  5. #include <linux/types.h>
  6. /*
  7. * SunOS and Solaris /dev/openprom definitions. The ioctl values
  8. * were chosen to be exactly equal to the SunOS equivalents.
  9. */
  10. struct openpromio
  11. {
  12. u_int oprom_size; /* Actual size of the oprom_array. */
  13. char oprom_array[1]; /* Holds property names and values. */
  14. };
  15. #define OPROMMAXPARAM 4096 /* Maximum size of oprom_array. */
  16. #define OPROMGETOPT 0x20004F01
  17. #define OPROMSETOPT 0x20004F02
  18. #define OPROMNXTOPT 0x20004F03
  19. #define OPROMSETOPT2 0x20004F04
  20. #define OPROMNEXT 0x20004F05
  21. #define OPROMCHILD 0x20004F06
  22. #define OPROMGETPROP 0x20004F07
  23. #define OPROMNXTPROP 0x20004F08
  24. #define OPROMU2P 0x20004F09
  25. #define OPROMGETCONS 0x20004F0A
  26. #define OPROMGETFBNAME 0x20004F0B
  27. #define OPROMGETBOOTARGS 0x20004F0C
  28. /* Linux extensions */ /* Arguments in oprom_array: */
  29. #define OPROMSETCUR 0x20004FF0 /* int node - Sets current node */
  30. #define OPROMPCI2NODE 0x20004FF1 /* int pci_bus, pci_devfn - Sets current node to PCI device's node */
  31. #define OPROMPATH2NODE 0x20004FF2 /* char path[] - Set current node from fully qualified PROM path */
  32. /*
  33. * Return values from OPROMGETCONS:
  34. */
  35. #define OPROMCONS_NOT_WSCONS 0
  36. #define OPROMCONS_STDIN_IS_KBD 0x1 /* stdin device is kbd */
  37. #define OPROMCONS_STDOUT_IS_FB 0x2 /* stdout is a framebuffer */
  38. #define OPROMCONS_OPENPROM 0x4 /* supports openboot */
  39. /*
  40. * NetBSD/OpenBSD /dev/openprom definitions.
  41. */
  42. struct opiocdesc
  43. {
  44. int op_nodeid; /* PROM Node ID (value-result) */
  45. int op_namelen; /* Length of op_name. */
  46. char __user *op_name; /* Pointer to the property name. */
  47. int op_buflen; /* Length of op_buf (value-result) */
  48. char __user *op_buf; /* Pointer to buffer. */
  49. };
  50. #define OPIOCGET _IOWR('O', 1, struct opiocdesc)
  51. #define OPIOCSET _IOW('O', 2, struct opiocdesc)
  52. #define OPIOCNEXTPROP _IOWR('O', 3, struct opiocdesc)
  53. #define OPIOCGETOPTNODE _IOR('O', 4, int)
  54. #define OPIOCGETNEXT _IOWR('O', 5, int)
  55. #define OPIOCGETCHILD _IOWR('O', 6, int)
  56. #endif /* _SPARC_OPENPROMIO_H */