chp.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  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. #define CHP_STATUS_STANDBY 0
  14. #define CHP_STATUS_CONFIGURED 1
  15. #define CHP_STATUS_RESERVED 2
  16. #define CHP_STATUS_NOT_RECOGNIZED 3
  17. static inline int chp_test_bit(u8 *bitmap, int num)
  18. {
  19. int byte = num >> 3;
  20. int mask = 128 >> (num & 7);
  21. return (bitmap[byte] & mask) ? 1 : 0;
  22. }
  23. struct channel_path {
  24. struct chp_id chpid;
  25. int state;
  26. struct channel_path_desc desc;
  27. /* Channel-measurement related stuff: */
  28. int cmg;
  29. int shared;
  30. void *cmg_chars;
  31. struct device dev;
  32. };
  33. int chp_get_status(struct chp_id chpid);
  34. u8 chp_get_sch_opm(struct subchannel *sch);
  35. int chp_is_registered(struct chp_id chpid);
  36. void *chp_get_chp_desc(struct chp_id chpid);
  37. void chp_process_crw(int id, int available);
  38. void chp_remove_cmg_attr(struct channel_path *chp);
  39. int chp_add_cmg_attr(struct channel_path *chp);
  40. int chp_new(struct chp_id chpid);
  41. void chp_cfg_schedule(struct chp_id chpid, int configure);
  42. void chp_cfg_cancel_deconfigure(struct chp_id chpid);
  43. int chp_info_get_status(struct chp_id chpid);
  44. #endif /* S390_CHP_H */