diff options
author | Michael Holzheu <holzheu@de.ibm.com> | 2007-05-04 12:47:53 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2007-05-04 12:48:26 -0400 |
commit | e29630627702571eb2b2a0955605b7f8971c82c1 (patch) | |
tree | e223b26946fbf7f5d3ab76f2b5414d2ab8b10836 /drivers/s390/char/tape_3590.c | |
parent | 6c82a8af923b25c2a9a41b7d4ba0bb2806ecc3dc (diff) |
[S390] tape: New read configuration data.
Instead of the deprecated read_conf_data(), implement a new function
tape_3590_read_dev_chars().
Signed-off-by: Michael Holzheu <holzheu@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'drivers/s390/char/tape_3590.c')
-rw-r--r-- | drivers/s390/char/tape_3590.c | 29 |
1 files changed, 25 insertions, 4 deletions
diff --git a/drivers/s390/char/tape_3590.c b/drivers/s390/char/tape_3590.c index 50f5edab83d7..7e2b2ab49264 100644 --- a/drivers/s390/char/tape_3590.c +++ b/drivers/s390/char/tape_3590.c | |||
@@ -788,6 +788,7 @@ tape_3590_done(struct tape_device *device, struct tape_request *request) | |||
788 | case TO_SIZE: | 788 | case TO_SIZE: |
789 | case TO_KEKL_SET: | 789 | case TO_KEKL_SET: |
790 | case TO_KEKL_QUERY: | 790 | case TO_KEKL_QUERY: |
791 | case TO_RDC: | ||
791 | break; | 792 | break; |
792 | } | 793 | } |
793 | return TAPE_IO_SUCCESS; | 794 | return TAPE_IO_SUCCESS; |
@@ -1549,6 +1550,26 @@ tape_3590_irq(struct tape_device *device, struct tape_request *request, | |||
1549 | return TAPE_IO_STOP; | 1550 | return TAPE_IO_STOP; |
1550 | } | 1551 | } |
1551 | 1552 | ||
1553 | |||
1554 | static int tape_3590_read_dev_chars(struct tape_device *device, | ||
1555 | struct tape_3590_rdc_data *rdc_data) | ||
1556 | { | ||
1557 | int rc; | ||
1558 | struct tape_request *request; | ||
1559 | |||
1560 | request = tape_alloc_request(1, sizeof(*rdc_data)); | ||
1561 | if (IS_ERR(request)) | ||
1562 | return PTR_ERR(request); | ||
1563 | request->op = TO_RDC; | ||
1564 | tape_ccw_end(request->cpaddr, CCW_CMD_RDC, sizeof(*rdc_data), | ||
1565 | request->cpdata); | ||
1566 | rc = tape_do_io(device, request); | ||
1567 | if (rc == 0) | ||
1568 | memcpy(rdc_data, request->cpdata, sizeof(*rdc_data)); | ||
1569 | tape_free_request(request); | ||
1570 | return rc; | ||
1571 | } | ||
1572 | |||
1552 | /* | 1573 | /* |
1553 | * Setup device function | 1574 | * Setup device function |
1554 | */ | 1575 | */ |
@@ -1557,7 +1578,7 @@ tape_3590_setup_device(struct tape_device *device) | |||
1557 | { | 1578 | { |
1558 | int rc; | 1579 | int rc; |
1559 | struct tape_3590_disc_data *data; | 1580 | struct tape_3590_disc_data *data; |
1560 | char *rdc_data; | 1581 | struct tape_3590_rdc_data *rdc_data; |
1561 | 1582 | ||
1562 | DBF_EVENT(6, "3590 device setup\n"); | 1583 | DBF_EVENT(6, "3590 device setup\n"); |
1563 | data = kzalloc(sizeof(struct tape_3590_disc_data), GFP_KERNEL | GFP_DMA); | 1584 | data = kzalloc(sizeof(struct tape_3590_disc_data), GFP_KERNEL | GFP_DMA); |
@@ -1566,12 +1587,12 @@ tape_3590_setup_device(struct tape_device *device) | |||
1566 | data->read_back_op = READ_PREVIOUS; | 1587 | data->read_back_op = READ_PREVIOUS; |
1567 | device->discdata = data; | 1588 | device->discdata = data; |
1568 | 1589 | ||
1569 | rdc_data = kmalloc(64, GFP_KERNEL | GFP_DMA); | 1590 | rdc_data = kmalloc(sizeof(*rdc_data), GFP_KERNEL | GFP_DMA); |
1570 | if (!rdc_data) { | 1591 | if (!rdc_data) { |
1571 | rc = -ENOMEM; | 1592 | rc = -ENOMEM; |
1572 | goto fail_kmalloc; | 1593 | goto fail_kmalloc; |
1573 | } | 1594 | } |
1574 | rc = read_dev_chars(device->cdev, (void**)&rdc_data, 64); | 1595 | rc = tape_3590_read_dev_chars(device, rdc_data); |
1575 | if (rc) { | 1596 | if (rc) { |
1576 | DBF_LH(3, "Read device characteristics failed!\n"); | 1597 | DBF_LH(3, "Read device characteristics failed!\n"); |
1577 | goto fail_kmalloc; | 1598 | goto fail_kmalloc; |
@@ -1579,7 +1600,7 @@ tape_3590_setup_device(struct tape_device *device) | |||
1579 | rc = tape_std_assign(device); | 1600 | rc = tape_std_assign(device); |
1580 | if (rc) | 1601 | if (rc) |
1581 | goto fail_rdc_data; | 1602 | goto fail_rdc_data; |
1582 | if (rdc_data[31] == 0x13) { | 1603 | if (rdc_data->data[31] == 0x13) { |
1583 | PRINT_INFO("Device has crypto support\n"); | 1604 | PRINT_INFO("Device has crypto support\n"); |
1584 | data->crypt_info.capability |= TAPE390_CRYPT_SUPPORTED_MASK; | 1605 | data->crypt_info.capability |= TAPE390_CRYPT_SUPPORTED_MASK; |
1585 | tape_3592_disable_crypt(device); | 1606 | tape_3592_disable_crypt(device); |