aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/s390/block/dasd_diag.c10
-rw-r--r--drivers/s390/block/dasd_ioctl.c4
-rw-r--r--drivers/s390/char/raw3270.c5
-rw-r--r--drivers/s390/cio/device_ops.c11
-rw-r--r--include/asm-s390/ccwdev.h3
5 files changed, 25 insertions, 8 deletions
diff --git a/drivers/s390/block/dasd_diag.c b/drivers/s390/block/dasd_diag.c
index e810e4a44ed4..eccac1c3b71b 100644
--- a/drivers/s390/block/dasd_diag.c
+++ b/drivers/s390/block/dasd_diag.c
@@ -50,6 +50,7 @@ struct dasd_diag_private {
50 struct dasd_diag_rw_io iob; 50 struct dasd_diag_rw_io iob;
51 struct dasd_diag_init_io iib; 51 struct dasd_diag_init_io iib;
52 blocknum_t pt_block; 52 blocknum_t pt_block;
53 struct ccw_dev_id dev_id;
53}; 54};
54 55
55struct dasd_diag_req { 56struct dasd_diag_req {
@@ -102,7 +103,7 @@ mdsk_init_io(struct dasd_device *device, unsigned int blocksize,
102 iib = &private->iib; 103 iib = &private->iib;
103 memset(iib, 0, sizeof (struct dasd_diag_init_io)); 104 memset(iib, 0, sizeof (struct dasd_diag_init_io));
104 105
105 iib->dev_nr = _ccw_device_get_device_number(device->cdev); 106 iib->dev_nr = private->dev_id.devno;
106 iib->block_size = blocksize; 107 iib->block_size = blocksize;
107 iib->offset = offset; 108 iib->offset = offset;
108 iib->flaga = DASD_DIAG_FLAGA_DEFAULT; 109 iib->flaga = DASD_DIAG_FLAGA_DEFAULT;
@@ -127,7 +128,7 @@ mdsk_term_io(struct dasd_device * device)
127 private = (struct dasd_diag_private *) device->private; 128 private = (struct dasd_diag_private *) device->private;
128 iib = &private->iib; 129 iib = &private->iib;
129 memset(iib, 0, sizeof (struct dasd_diag_init_io)); 130 memset(iib, 0, sizeof (struct dasd_diag_init_io));
130 iib->dev_nr = _ccw_device_get_device_number(device->cdev); 131 iib->dev_nr = private->dev_id.devno;
131 rc = dia250(iib, TERM_BIO); 132 rc = dia250(iib, TERM_BIO);
132 return rc; 133 return rc;
133} 134}
@@ -166,7 +167,7 @@ dasd_start_diag(struct dasd_ccw_req * cqr)
166 private = (struct dasd_diag_private *) device->private; 167 private = (struct dasd_diag_private *) device->private;
167 dreq = (struct dasd_diag_req *) cqr->data; 168 dreq = (struct dasd_diag_req *) cqr->data;
168 169
169 private->iob.dev_nr = _ccw_device_get_device_number(device->cdev); 170 private->iob.dev_nr = private->dev_id.devno;
170 private->iob.key = 0; 171 private->iob.key = 0;
171 private->iob.flags = DASD_DIAG_RWFLAG_ASYNC; 172 private->iob.flags = DASD_DIAG_RWFLAG_ASYNC;
172 private->iob.block_count = dreq->block_count; 173 private->iob.block_count = dreq->block_count;
@@ -323,11 +324,12 @@ dasd_diag_check_device(struct dasd_device *device)
323 "memory allocation failed for private data"); 324 "memory allocation failed for private data");
324 return -ENOMEM; 325 return -ENOMEM;
325 } 326 }
327 ccw_device_get_id(device->cdev, &private->dev_id);
326 device->private = (void *) private; 328 device->private = (void *) private;
327 } 329 }
328 /* Read Device Characteristics */ 330 /* Read Device Characteristics */
329 rdc_data = (void *) &(private->rdc_data); 331 rdc_data = (void *) &(private->rdc_data);
330 rdc_data->dev_nr = _ccw_device_get_device_number(device->cdev); 332 rdc_data->dev_nr = private->dev_id.devno;
331 rdc_data->rdc_len = sizeof (struct dasd_diag_characteristics); 333 rdc_data->rdc_len = sizeof (struct dasd_diag_characteristics);
332 334
333 rc = diag210((struct diag210 *) rdc_data); 335 rc = diag210((struct diag210 *) rdc_data);
diff --git a/drivers/s390/block/dasd_ioctl.c b/drivers/s390/block/dasd_ioctl.c
index 758cfb542865..672eb0a3dd0b 100644
--- a/drivers/s390/block/dasd_ioctl.c
+++ b/drivers/s390/block/dasd_ioctl.c
@@ -255,6 +255,7 @@ dasd_ioctl_information(struct dasd_device *device,
255 unsigned long flags; 255 unsigned long flags;
256 int rc; 256 int rc;
257 struct ccw_device *cdev; 257 struct ccw_device *cdev;
258 struct ccw_dev_id dev_id;
258 259
259 if (!device->discipline->fill_info) 260 if (!device->discipline->fill_info)
260 return -EINVAL; 261 return -EINVAL;
@@ -270,8 +271,9 @@ dasd_ioctl_information(struct dasd_device *device,
270 } 271 }
271 272
272 cdev = device->cdev; 273 cdev = device->cdev;
274 ccw_device_get_id(cdev, &dev_id);
273 275
274 dasd_info->devno = _ccw_device_get_device_number(device->cdev); 276 dasd_info->devno = dev_id.devno;
275 dasd_info->schid = _ccw_device_get_subchannel_number(device->cdev); 277 dasd_info->schid = _ccw_device_get_subchannel_number(device->cdev);
276 dasd_info->cu_type = cdev->id.cu_type; 278 dasd_info->cu_type = cdev->id.cu_type;
277 dasd_info->cu_model = cdev->id.cu_model; 279 dasd_info->cu_model = cdev->id.cu_model;
diff --git a/drivers/s390/char/raw3270.c b/drivers/s390/char/raw3270.c
index 8facd14adb7c..f6ef90ee3e7d 100644
--- a/drivers/s390/char/raw3270.c
+++ b/drivers/s390/char/raw3270.c
@@ -589,9 +589,10 @@ static int
589__raw3270_size_device_vm(struct raw3270 *rp) 589__raw3270_size_device_vm(struct raw3270 *rp)
590{ 590{
591 int rc, model; 591 int rc, model;
592 struct ccw_dev_id dev_id;
592 593
593 raw3270_init_diag210.vrdcdvno = 594 ccw_device_get_id(rp->cdev, &dev_id);
594 _ccw_device_get_device_number(rp->cdev); 595 raw3270_init_diag210.vrdcdvno = dev_id.devno;
595 raw3270_init_diag210.vrdclen = sizeof(struct diag210); 596 raw3270_init_diag210.vrdclen = sizeof(struct diag210);
596 rc = diag210(&raw3270_init_diag210); 597 rc = diag210(&raw3270_init_diag210);
597 if (rc) 598 if (rc)
diff --git a/drivers/s390/cio/device_ops.c b/drivers/s390/cio/device_ops.c
index 16f59fcb66b1..a5d263fb55ae 100644
--- a/drivers/s390/cio/device_ops.c
+++ b/drivers/s390/cio/device_ops.c
@@ -616,6 +616,17 @@ ccw_device_get_chp_desc(struct ccw_device *cdev, int chp_no)
616 return chp_get_chp_desc(chpid); 616 return chp_get_chp_desc(chpid);
617} 617}
618 618
619/**
620 * ccw_device_get_id - obtain a ccw device id
621 * @cdev: device to obtain the id for
622 * @dev_id: where to fill in the values
623 */
624void ccw_device_get_id(struct ccw_device *cdev, struct ccw_dev_id *dev_id)
625{
626 *dev_id = cdev->private->dev_id;
627}
628EXPORT_SYMBOL(ccw_device_get_id);
629
619// FIXME: these have to go: 630// FIXME: these have to go:
620 631
621int 632int
diff --git a/include/asm-s390/ccwdev.h b/include/asm-s390/ccwdev.h
index 6795ecefd15b..4c2e1710f157 100644
--- a/include/asm-s390/ccwdev.h
+++ b/include/asm-s390/ccwdev.h
@@ -16,6 +16,7 @@
16/* structs from asm/cio.h */ 16/* structs from asm/cio.h */
17struct irb; 17struct irb;
18struct ccw1; 18struct ccw1;
19struct ccw_dev_id;
19 20
20/* simplified initializers for struct ccw_device: 21/* simplified initializers for struct ccw_device:
21 * CCW_DEVICE and CCW_DEVICE_DEVTYPE initialize one 22 * CCW_DEVICE and CCW_DEVICE_DEVTYPE initialize one
@@ -175,6 +176,7 @@ extern int ccw_device_set_offline(struct ccw_device *cdev);
175 176
176extern struct ciw *ccw_device_get_ciw(struct ccw_device *, __u32 cmd); 177extern struct ciw *ccw_device_get_ciw(struct ccw_device *, __u32 cmd);
177extern __u8 ccw_device_get_path_mask(struct ccw_device *); 178extern __u8 ccw_device_get_path_mask(struct ccw_device *);
179extern void ccw_device_get_id(struct ccw_device *, struct ccw_dev_id *);
178 180
179#define get_ccwdev_lock(x) (x)->ccwlock 181#define get_ccwdev_lock(x) (x)->ccwlock
180 182
@@ -184,7 +186,6 @@ extern __u8 ccw_device_get_path_mask(struct ccw_device *);
184extern struct ccw_device *ccw_device_probe_console(void); 186extern struct ccw_device *ccw_device_probe_console(void);
185 187
186// FIXME: these have to go 188// FIXME: these have to go
187extern int _ccw_device_get_device_number(struct ccw_device *);
188extern int _ccw_device_get_subchannel_number(struct ccw_device *); 189extern int _ccw_device_get_subchannel_number(struct ccw_device *);
189 190
190extern void *ccw_device_get_chp_desc(struct ccw_device *, int); 191extern void *ccw_device_get_chp_desc(struct ccw_device *, int);