Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | #ifndef S390_CHSC_H |
| 2 | #define S390_CHSC_H |
| 3 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | #define CHSC_SEI_ACC_CHPID 1 |
| 5 | #define CHSC_SEI_ACC_LINKADDR 2 |
| 6 | #define CHSC_SEI_ACC_FULLLINKADDR 3 |
| 7 | |
Cornelia Huck | fb6958a | 2006-01-06 00:19:25 -0800 | [diff] [blame] | 8 | #define CHSC_SDA_OC_MSS 0x2 |
| 9 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 10 | struct chsc_header { |
| 11 | u16 length; |
| 12 | u16 code; |
| 13 | }; |
| 14 | |
Cornelia Huck | 495a5b4 | 2006-03-24 03:15:14 -0800 | [diff] [blame^] | 15 | #define NR_MEASUREMENT_CHARS 5 |
| 16 | struct cmg_chars { |
| 17 | u32 values[NR_MEASUREMENT_CHARS]; |
| 18 | }; |
| 19 | |
| 20 | #define NR_MEASUREMENT_ENTRIES 8 |
| 21 | struct cmg_entry { |
| 22 | u32 values[NR_MEASUREMENT_ENTRIES]; |
| 23 | }; |
| 24 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 25 | struct channel_path_desc { |
| 26 | u8 flags; |
| 27 | u8 lsn; |
| 28 | u8 desc; |
| 29 | u8 chpid; |
| 30 | u8 swla; |
| 31 | u8 zeroes; |
| 32 | u8 chla; |
| 33 | u8 chpp; |
| 34 | }; |
| 35 | |
| 36 | struct channel_path { |
| 37 | int id; |
| 38 | int state; |
| 39 | struct channel_path_desc desc; |
Cornelia Huck | 495a5b4 | 2006-03-24 03:15:14 -0800 | [diff] [blame^] | 40 | /* Channel-measurement related stuff: */ |
| 41 | int cmg; |
| 42 | int shared; |
| 43 | void *cmg_chars; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 44 | struct device dev; |
| 45 | }; |
| 46 | |
| 47 | extern void s390_process_css( void ); |
| 48 | extern void chsc_validate_chpids(struct subchannel *); |
| 49 | extern void chpid_is_actually_online(int); |
| 50 | |
| 51 | struct css_general_char { |
| 52 | u64 : 41; |
| 53 | u32 aif : 1; /* bit 41 */ |
| 54 | u32 : 3; |
| 55 | u32 mcss : 1; /* bit 45 */ |
| 56 | u32 : 2; |
| 57 | u32 ext_mb : 1; /* bit 48 */ |
| 58 | u32 : 7; |
| 59 | u32 aif_tdd : 1; /* bit 56 */ |
Frank Pavlic | 8129ee1 | 2006-01-06 00:19:20 -0800 | [diff] [blame] | 60 | u32 : 1; |
| 61 | u32 qebsm : 1; /* bit 58 */ |
| 62 | u32 : 8; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 63 | u32 aif_osa : 1; /* bit 67 */ |
| 64 | u32 : 28; |
| 65 | }__attribute__((packed)); |
| 66 | |
| 67 | struct css_chsc_char { |
| 68 | u64 res; |
Cornelia Huck | 495a5b4 | 2006-03-24 03:15:14 -0800 | [diff] [blame^] | 69 | u64 : 20; |
| 70 | u32 secm : 1; /* bit 84 */ |
| 71 | u32 : 1; |
| 72 | u32 scmc : 1; /* bit 86 */ |
| 73 | u32 : 20; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 74 | u32 scssc : 1; /* bit 107 */ |
| 75 | u32 scsscf : 1; /* bit 108 */ |
| 76 | u32 : 19; |
| 77 | }__attribute__((packed)); |
| 78 | |
| 79 | extern struct css_general_char css_general_characteristics; |
| 80 | extern struct css_chsc_char css_chsc_characteristics; |
| 81 | |
| 82 | extern int chsc_determine_css_characteristics(void); |
| 83 | extern int css_characteristics_avail; |
| 84 | |
| 85 | extern void *chsc_get_chp_desc(struct subchannel*, int); |
Cornelia Huck | a28c694 | 2006-01-06 00:19:23 -0800 | [diff] [blame] | 86 | |
Cornelia Huck | fb6958a | 2006-01-06 00:19:25 -0800 | [diff] [blame] | 87 | extern int chsc_enable_facility(int); |
Cornelia Huck | 495a5b4 | 2006-03-24 03:15:14 -0800 | [diff] [blame^] | 88 | struct channel_subsystem; |
| 89 | extern int chsc_secm(struct channel_subsystem *, int); |
Cornelia Huck | fb6958a | 2006-01-06 00:19:25 -0800 | [diff] [blame] | 90 | |
Cornelia Huck | 501fe31 | 2006-02-03 03:03:52 -0800 | [diff] [blame] | 91 | #define to_channelpath(device) container_of(device, struct channel_path, dev) |
Cornelia Huck | a28c694 | 2006-01-06 00:19:23 -0800 | [diff] [blame] | 92 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 93 | #endif |