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