Christian Borntraeger | 6b979de | 2005-06-25 14:55:32 -0700 | [diff] [blame] | 1 | /* |
Heiko Carstens | a53c8fa | 2012-07-20 11:15:04 +0200 | [diff] [blame] | 2 | * Copyright IBM Corp. 2004, 2005 |
Christian Borntraeger | 45af3af | 2006-09-20 15:59:24 +0200 | [diff] [blame] | 3 | * Interface implementation for communication with the z/VM control program |
Christian Borntraeger | 6b979de | 2005-06-25 14:55:32 -0700 | [diff] [blame] | 4 | * Version 1.0 |
| 5 | * Author(s): Christian Borntraeger <cborntra@de.ibm.com> |
| 6 | * |
| 7 | * |
| 8 | * z/VMs CP offers the possibility to issue commands via the diagnose code 8 |
| 9 | * this driver implements a character device that issues these commands and |
| 10 | * returns the answer of CP. |
| 11 | * |
| 12 | * The idea of this driver is based on cpint from Neale Ferguson |
| 13 | */ |
| 14 | |
Christian Borntraeger | 6b979de | 2005-06-25 14:55:32 -0700 | [diff] [blame] | 15 | #include <linux/ioctl.h> |
Christian Borntraeger | d9d119f | 2007-07-17 13:36:05 +0200 | [diff] [blame] | 16 | #include <linux/mutex.h> |
Christian Borntraeger | 6b979de | 2005-06-25 14:55:32 -0700 | [diff] [blame] | 17 | |
| 18 | #define VMCP_GETCODE _IOR(0x10, 1, int) |
| 19 | #define VMCP_SETBUF _IOW(0x10, 2, int) |
| 20 | #define VMCP_GETSIZE _IOR(0x10, 3, int) |
| 21 | |
| 22 | struct vmcp_session { |
| 23 | unsigned int bufsize; |
| 24 | char *response; |
| 25 | int resp_size; |
| 26 | int resp_code; |
| 27 | /* As we use copy_from/to_user, which might * |
| 28 | * sleep and cannot use a spinlock */ |
Christian Borntraeger | d9d119f | 2007-07-17 13:36:05 +0200 | [diff] [blame] | 29 | struct mutex mutex; |
Christian Borntraeger | 6b979de | 2005-06-25 14:55:32 -0700 | [diff] [blame] | 30 | }; |