diff options
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/block/Kconfig | 10 | ||||
-rw-r--r-- | drivers/s390/block/Makefile | 1 | ||||
-rw-r--r-- | drivers/s390/block/dasd_cmb.c | 128 | ||||
-rw-r--r-- | drivers/s390/block/dasd_ioctl.c | 22 |
4 files changed, 22 insertions, 139 deletions
diff --git a/drivers/s390/block/Kconfig b/drivers/s390/block/Kconfig index 6f50cc9323d9..baf9cc3ebae3 100644 --- a/drivers/s390/block/Kconfig +++ b/drivers/s390/block/Kconfig | |||
@@ -55,14 +55,4 @@ config DASD_DIAG | |||
55 | Disks under VM. If you are not running under VM or unsure what it is, | 55 | Disks under VM. If you are not running under VM or unsure what it is, |
56 | say "N". | 56 | say "N". |
57 | 57 | ||
58 | config DASD_CMB | ||
59 | tristate "Compatibility interface for DASD channel measurement blocks" | ||
60 | depends on DASD | ||
61 | help | ||
62 | This driver provides an additional interface to the channel measurement | ||
63 | facility, which is normally accessed though sysfs, with a set of | ||
64 | ioctl functions specific to the dasd driver. | ||
65 | This is only needed if you want to use applications written for | ||
66 | linux-2.4 dasd channel measurement facility interface. | ||
67 | |||
68 | endif | 58 | endif |
diff --git a/drivers/s390/block/Makefile b/drivers/s390/block/Makefile index 58c6780134f7..163e97554f50 100644 --- a/drivers/s390/block/Makefile +++ b/drivers/s390/block/Makefile | |||
@@ -12,6 +12,5 @@ obj-$(CONFIG_DASD) += dasd_mod.o | |||
12 | obj-$(CONFIG_DASD_DIAG) += dasd_diag_mod.o | 12 | obj-$(CONFIG_DASD_DIAG) += dasd_diag_mod.o |
13 | obj-$(CONFIG_DASD_ECKD) += dasd_eckd_mod.o | 13 | obj-$(CONFIG_DASD_ECKD) += dasd_eckd_mod.o |
14 | obj-$(CONFIG_DASD_FBA) += dasd_fba_mod.o | 14 | obj-$(CONFIG_DASD_FBA) += dasd_fba_mod.o |
15 | obj-$(CONFIG_DASD_CMB) += dasd_cmb.o | ||
16 | obj-$(CONFIG_BLK_DEV_XPRAM) += xpram.o | 15 | obj-$(CONFIG_BLK_DEV_XPRAM) += xpram.o |
17 | obj-$(CONFIG_DCSSBLK) += dcssblk.o | 16 | obj-$(CONFIG_DCSSBLK) += dcssblk.o |
diff --git a/drivers/s390/block/dasd_cmb.c b/drivers/s390/block/dasd_cmb.c deleted file mode 100644 index e88f73ee72ce..000000000000 --- a/drivers/s390/block/dasd_cmb.c +++ /dev/null | |||
@@ -1,128 +0,0 @@ | |||
1 | /* | ||
2 | * Linux on zSeries Channel Measurement Facility support | ||
3 | * (dasd device driver interface) | ||
4 | * | ||
5 | * Copyright 2000,2003 IBM Corporation | ||
6 | * | ||
7 | * Author: Arnd Bergmann <arndb@de.ibm.com> | ||
8 | * | ||
9 | * This program is free software; you can redistribute it and/or modify | ||
10 | * it under the terms of the GNU General Public License as published by | ||
11 | * the Free Software Foundation; either version 2, or (at your option) | ||
12 | * any later version. | ||
13 | * | ||
14 | * This program is distributed in the hope that it will be useful, | ||
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
17 | * GNU General Public License for more details. | ||
18 | * | ||
19 | * You should have received a copy of the GNU General Public License | ||
20 | * along with this program; if not, write to the Free Software | ||
21 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
22 | */ | ||
23 | #include <linux/init.h> | ||
24 | #include <linux/module.h> | ||
25 | #include <asm/ccwdev.h> | ||
26 | #include <asm/cmb.h> | ||
27 | |||
28 | #include "dasd_int.h" | ||
29 | |||
30 | static int | ||
31 | dasd_ioctl_cmf_enable(struct block_device *bdev, int no, long args) | ||
32 | { | ||
33 | struct dasd_device *device; | ||
34 | |||
35 | device = bdev->bd_disk->private_data; | ||
36 | if (!device) | ||
37 | return -EINVAL; | ||
38 | |||
39 | return enable_cmf(device->cdev); | ||
40 | } | ||
41 | |||
42 | static int | ||
43 | dasd_ioctl_cmf_disable(struct block_device *bdev, int no, long args) | ||
44 | { | ||
45 | struct dasd_device *device; | ||
46 | |||
47 | device = bdev->bd_disk->private_data; | ||
48 | if (!device) | ||
49 | return -EINVAL; | ||
50 | |||
51 | return disable_cmf(device->cdev); | ||
52 | } | ||
53 | |||
54 | static int | ||
55 | dasd_ioctl_readall_cmb(struct block_device *bdev, int no, long args) | ||
56 | { | ||
57 | struct dasd_device *device; | ||
58 | struct cmbdata __user *udata; | ||
59 | struct cmbdata data; | ||
60 | size_t size; | ||
61 | int ret; | ||
62 | |||
63 | device = bdev->bd_disk->private_data; | ||
64 | if (!device) | ||
65 | return -EINVAL; | ||
66 | udata = (void __user *) args; | ||
67 | size = _IOC_SIZE(no); | ||
68 | |||
69 | if (!access_ok(VERIFY_WRITE, udata, size)) | ||
70 | return -EFAULT; | ||
71 | ret = cmf_readall(device->cdev, &data); | ||
72 | if (ret) | ||
73 | return ret; | ||
74 | if (copy_to_user(udata, &data, min(size, sizeof(*udata)))) | ||
75 | return -EFAULT; | ||
76 | return 0; | ||
77 | } | ||
78 | |||
79 | /* module initialization below here. dasd already provides a mechanism | ||
80 | * to dynamically register ioctl functions, so we simply use this. */ | ||
81 | static inline int | ||
82 | ioctl_reg(unsigned int no, dasd_ioctl_fn_t handler) | ||
83 | { | ||
84 | return dasd_ioctl_no_register(THIS_MODULE, no, handler); | ||
85 | } | ||
86 | |||
87 | static inline void | ||
88 | ioctl_unreg(unsigned int no, dasd_ioctl_fn_t handler) | ||
89 | { | ||
90 | dasd_ioctl_no_unregister(THIS_MODULE, no, handler); | ||
91 | } | ||
92 | |||
93 | static void | ||
94 | dasd_cmf_exit(void) | ||
95 | { | ||
96 | ioctl_unreg(BIODASDCMFENABLE, dasd_ioctl_cmf_enable); | ||
97 | ioctl_unreg(BIODASDCMFDISABLE, dasd_ioctl_cmf_disable); | ||
98 | ioctl_unreg(BIODASDREADALLCMB, dasd_ioctl_readall_cmb); | ||
99 | } | ||
100 | |||
101 | static int __init | ||
102 | dasd_cmf_init(void) | ||
103 | { | ||
104 | int ret; | ||
105 | ret = ioctl_reg (BIODASDCMFENABLE, dasd_ioctl_cmf_enable); | ||
106 | if (ret) | ||
107 | goto err; | ||
108 | ret = ioctl_reg (BIODASDCMFDISABLE, dasd_ioctl_cmf_disable); | ||
109 | if (ret) | ||
110 | goto err; | ||
111 | ret = ioctl_reg (BIODASDREADALLCMB, dasd_ioctl_readall_cmb); | ||
112 | if (ret) | ||
113 | goto err; | ||
114 | |||
115 | return 0; | ||
116 | err: | ||
117 | dasd_cmf_exit(); | ||
118 | |||
119 | return ret; | ||
120 | } | ||
121 | |||
122 | module_init(dasd_cmf_init); | ||
123 | module_exit(dasd_cmf_exit); | ||
124 | |||
125 | MODULE_AUTHOR("Arnd Bergmann <arndb@de.ibm.com>"); | ||
126 | MODULE_LICENSE("GPL"); | ||
127 | MODULE_DESCRIPTION("channel measurement facility interface for dasd\n" | ||
128 | "Copyright 2003 IBM Corporation\n"); | ||
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c index bb6caf46bbd9..c8319bef2730 100644 --- a/drivers/s390/block/dasd_ioctl.c +++ b/drivers/s390/block/dasd_ioctl.c | |||
@@ -16,6 +16,7 @@ | |||
16 | #include <linux/blkpg.h> | 16 | #include <linux/blkpg.h> |
17 | 17 | ||
18 | #include <asm/ccwdev.h> | 18 | #include <asm/ccwdev.h> |
19 | #include <asm/cmb.h> | ||
19 | #include <asm/uaccess.h> | 20 | #include <asm/uaccess.h> |
20 | 21 | ||
21 | /* This is ugly... */ | 22 | /* This is ugly... */ |
@@ -406,6 +407,21 @@ dasd_ioctl_set_ro(struct block_device *bdev, void __user *argp) | |||
406 | return dasd_set_feature(device->cdev, DASD_FEATURE_READONLY, intval); | 407 | return dasd_set_feature(device->cdev, DASD_FEATURE_READONLY, intval); |
407 | } | 408 | } |
408 | 409 | ||
410 | static int | ||
411 | dasd_ioctl_readall_cmb(struct dasd_device *device, unsigned int cmd, | ||
412 | unsigned long arg) | ||
413 | { | ||
414 | struct cmbdata __user *argp = (void __user *) arg; | ||
415 | size_t size = _IOC_SIZE(cmd); | ||
416 | struct cmbdata data; | ||
417 | int ret; | ||
418 | |||
419 | ret = cmf_readall(device->cdev, &data); | ||
420 | if (!ret && copy_to_user(argp, &data, min(size, sizeof(*argp)))) | ||
421 | return -EFAULT; | ||
422 | return ret; | ||
423 | } | ||
424 | |||
409 | int | 425 | int |
410 | dasd_ioctl(struct inode *inode, struct file *file, | 426 | dasd_ioctl(struct inode *inode, struct file *file, |
411 | unsigned int cmd, unsigned long arg) | 427 | unsigned int cmd, unsigned long arg) |
@@ -447,6 +463,12 @@ dasd_ioctl(struct inode *inode, struct file *file, | |||
447 | return dasd_ioctl_set_ro(bdev, argp); | 463 | return dasd_ioctl_set_ro(bdev, argp); |
448 | case DASDAPIVER: | 464 | case DASDAPIVER: |
449 | return dasd_ioctl_api_version(argp); | 465 | return dasd_ioctl_api_version(argp); |
466 | case BIODASDCMFENABLE: | ||
467 | return enable_cmf(device->cdev); | ||
468 | case BIODASDCMFDISABLE: | ||
469 | return disable_cmf(device->cdev); | ||
470 | case BIODASDREADALLCMB: | ||
471 | return dasd_ioctl_readall_cmb(device, cmd, arg); | ||
450 | default: | 472 | default: |
451 | /* if the discipline has an ioctl method try it. */ | 473 | /* if the discipline has an ioctl method try it. */ |
452 | if (device->discipline->ioctl) { | 474 | if (device->discipline->ioctl) { |