mca-legacy.h 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. /* -*- mode: c; c-basic-offset: 8 -*- */
  2. /* This is the function prototypes for the old legacy MCA interface
  3. *
  4. * Please move your driver to the new sysfs based one instead */
  5. #ifndef _LINUX_MCA_LEGACY_H
  6. #define _LINUX_MCA_LEGACY_H
  7. #include <linux/mca.h>
  8. #warning "MCA legacy - please move your driver to the new sysfs api"
  9. /* MCA_NOTFOUND is an error condition. The other two indicate
  10. * motherboard POS registers contain the adapter. They might be
  11. * returned by the mca_find_adapter() function, and can be used as
  12. * arguments to mca_read_stored_pos(). I'm not going to allow direct
  13. * access to the motherboard registers until we run across an adapter
  14. * that requires it. We don't know enough about them to know if it's
  15. * safe.
  16. *
  17. * See Documentation/mca.txt or one of the existing drivers for
  18. * more information.
  19. */
  20. #define MCA_NOTFOUND (-1)
  21. /* Returns the slot of the first enabled adapter matching id. User can
  22. * specify a starting slot beyond zero, to deal with detecting multiple
  23. * devices. Returns MCA_NOTFOUND if id not found. Also checks the
  24. * integrated adapters.
  25. */
  26. extern int mca_find_adapter(int id, int start);
  27. extern int mca_find_unused_adapter(int id, int start);
  28. extern int mca_is_adapter_used(int slot);
  29. extern int mca_mark_as_used(int slot);
  30. extern void mca_mark_as_unused(int slot);
  31. /* gets a byte out of POS register (stored in memory) */
  32. extern unsigned char mca_read_stored_pos(int slot, int reg);
  33. /* This can be expanded later. Right now, it gives us a way of
  34. * getting meaningful information into the MCA_info structure,
  35. * so we can have a more interesting /proc/mca.
  36. */
  37. extern void mca_set_adapter_name(int slot, char* name);
  38. /* These routines actually mess with the hardware POS registers. They
  39. * temporarily disable the device (and interrupts), so make sure you know
  40. * what you're doing if you use them. Furthermore, writing to a POS may
  41. * result in two devices trying to share a resource, which in turn can
  42. * result in multiple devices sharing memory spaces, IRQs, or even trashing
  43. * hardware. YOU HAVE BEEN WARNED.
  44. *
  45. * You can only access slots with this. Motherboard registers are off
  46. * limits.
  47. */
  48. /* read a byte from the specified POS register. */
  49. extern unsigned char mca_read_pos(int slot, int reg);
  50. /* write a byte to the specified POS register. */
  51. extern void mca_write_pos(int slot, int reg, unsigned char byte);
  52. #endif