chp.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /*
  2. * drivers/s390/cio/chp.h
  3. *
  4. * Copyright IBM Corp. 2007
  5. * Author(s): Peter Oberparleiter <peter.oberparleiter@de.ibm.com>
  6. */
  7. #ifndef S390_CHP_H
  8. #define S390_CHP_H S390_CHP_H
  9. #include <linux/types.h>
  10. #include <linux/device.h>
  11. #include <asm/chpid.h>
  12. #include "chsc.h"
  13. #include "css.h"
  14. #define CHP_STATUS_STANDBY 0
  15. #define CHP_STATUS_CONFIGURED 1
  16. #define CHP_STATUS_RESERVED 2
  17. #define CHP_STATUS_NOT_RECOGNIZED 3
  18. #define CHP_ONLINE 0
  19. #define CHP_OFFLINE 1
  20. #define CHP_VARY_ON 2
  21. #define CHP_VARY_OFF 3
  22. struct chp_link {
  23. struct chp_id chpid;
  24. u32 fla_mask;
  25. u16 fla;
  26. };
  27. static inline int chp_test_bit(u8 *bitmap, int num)
  28. {
  29. int byte = num >> 3;
  30. int mask = 128 >> (num & 7);
  31. return (bitmap[byte] & mask) ? 1 : 0;
  32. }
  33. struct channel_path {
  34. struct chp_id chpid;
  35. int state;
  36. struct channel_path_desc desc;
  37. /* Channel-measurement related stuff: */
  38. int cmg;
  39. int shared;
  40. void *cmg_chars;
  41. struct device dev;
  42. };
  43. int chp_get_status(struct chp_id chpid);
  44. u8 chp_get_sch_opm(struct subchannel *sch);
  45. int chp_is_registered(struct chp_id chpid);
  46. void *chp_get_chp_desc(struct chp_id chpid);
  47. void chp_remove_cmg_attr(struct channel_path *chp);
  48. int chp_add_cmg_attr(struct channel_path *chp);
  49. int chp_new(struct chp_id chpid);
  50. void chp_cfg_schedule(struct chp_id chpid, int configure);
  51. void chp_cfg_cancel_deconfigure(struct chp_id chpid);
  52. int chp_info_get_status(struct chp_id chpid);
  53. int chp_ssd_get_mask(struct chsc_ssd_info *, struct chp_link *);
  54. #endif /* S390_CHP_H */