aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Glauber <jang@linux.vnet.ibm.com>2010-05-17 04:00:19 -0400
committerMartin Schwidefsky <sky@mschwide.boeblingen.de.ibm.com>2010-05-17 04:00:17 -0400
commitcc961d400e06e78c7aa39aeab1f001eb8f76ef90 (patch)
tree75a8f9668c6b723e637cc18b6264a3fac4a87112
parentd0c9d4a89fff4352b20ae8704b84cd99a8372f66 (diff)
[S390] qdio: remove API wrappers
Remove qdio API wrappers used by qeth and replace them by calling the appropriate functions directly. Signed-off-by: Jan Glauber <jang@linux.vnet.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--arch/s390/include/asm/qdio.h2
-rw-r--r--drivers/s390/cio/qdio_main.c46
-rw-r--r--drivers/s390/net/qeth_core_main.c17
3 files changed, 13 insertions, 52 deletions
diff --git a/arch/s390/include/asm/qdio.h b/arch/s390/include/asm/qdio.h
index 9b04b1102bbc..0eaae6260274 100644
--- a/arch/s390/include/asm/qdio.h
+++ b/arch/s390/include/asm/qdio.h
@@ -368,14 +368,12 @@ struct qdio_initialize {
368#define QDIO_FLAG_SYNC_OUTPUT 0x02 368#define QDIO_FLAG_SYNC_OUTPUT 0x02
369#define QDIO_FLAG_PCI_OUT 0x10 369#define QDIO_FLAG_PCI_OUT 0x10
370 370
371extern int qdio_initialize(struct qdio_initialize *);
372extern int qdio_allocate(struct qdio_initialize *); 371extern int qdio_allocate(struct qdio_initialize *);
373extern int qdio_establish(struct qdio_initialize *); 372extern int qdio_establish(struct qdio_initialize *);
374extern int qdio_activate(struct ccw_device *); 373extern int qdio_activate(struct ccw_device *);
375 374
376extern int do_QDIO(struct ccw_device *cdev, unsigned int callflags, 375extern int do_QDIO(struct ccw_device *cdev, unsigned int callflags,
377 int q_nr, unsigned int bufnr, unsigned int count); 376 int q_nr, unsigned int bufnr, unsigned int count);
378extern int qdio_cleanup(struct ccw_device*, int);
379extern int qdio_shutdown(struct ccw_device*, int); 377extern int qdio_shutdown(struct ccw_device*, int);
380extern int qdio_free(struct ccw_device *); 378extern int qdio_free(struct ccw_device *);
381extern int qdio_get_ssqd_desc(struct ccw_device *dev, struct qdio_ssqd_desc*); 379extern int qdio_get_ssqd_desc(struct ccw_device *dev, struct qdio_ssqd_desc*);
diff --git a/drivers/s390/cio/qdio_main.c b/drivers/s390/cio/qdio_main.c
index dafb3e5bdad7..00520f9a7a8e 100644
--- a/drivers/s390/cio/qdio_main.c
+++ b/drivers/s390/cio/qdio_main.c
@@ -1023,30 +1023,6 @@ int qdio_get_ssqd_desc(struct ccw_device *cdev,
1023} 1023}
1024EXPORT_SYMBOL_GPL(qdio_get_ssqd_desc); 1024EXPORT_SYMBOL_GPL(qdio_get_ssqd_desc);
1025 1025
1026/**
1027 * qdio_cleanup - shutdown queues and free data structures
1028 * @cdev: associated ccw device
1029 * @how: use halt or clear to shutdown
1030 *
1031 * This function calls qdio_shutdown() for @cdev with method @how.
1032 * and qdio_free(). The qdio_free() return value is ignored since
1033 * !irq_ptr is already checked.
1034 */
1035int qdio_cleanup(struct ccw_device *cdev, int how)
1036{
1037 struct qdio_irq *irq_ptr = cdev->private->qdio_data;
1038 int rc;
1039
1040 if (!irq_ptr)
1041 return -ENODEV;
1042
1043 rc = qdio_shutdown(cdev, how);
1044
1045 qdio_free(cdev);
1046 return rc;
1047}
1048EXPORT_SYMBOL_GPL(qdio_cleanup);
1049
1050static void qdio_shutdown_queues(struct ccw_device *cdev) 1026static void qdio_shutdown_queues(struct ccw_device *cdev)
1051{ 1027{
1052 struct qdio_irq *irq_ptr = cdev->private->qdio_data; 1028 struct qdio_irq *irq_ptr = cdev->private->qdio_data;
@@ -1164,28 +1140,6 @@ int qdio_free(struct ccw_device *cdev)
1164EXPORT_SYMBOL_GPL(qdio_free); 1140EXPORT_SYMBOL_GPL(qdio_free);
1165 1141
1166/** 1142/**
1167 * qdio_initialize - allocate and establish queues for a qdio subchannel
1168 * @init_data: initialization data
1169 *
1170 * This function first allocates queues via qdio_allocate() and on success
1171 * establishes them via qdio_establish().
1172 */
1173int qdio_initialize(struct qdio_initialize *init_data)
1174{
1175 int rc;
1176
1177 rc = qdio_allocate(init_data);
1178 if (rc)
1179 return rc;
1180
1181 rc = qdio_establish(init_data);
1182 if (rc)
1183 qdio_free(init_data->cdev);
1184 return rc;
1185}
1186EXPORT_SYMBOL_GPL(qdio_initialize);
1187
1188/**
1189 * qdio_allocate - allocate qdio queues and associated data 1143 * qdio_allocate - allocate qdio queues and associated data
1190 * @init_data: initialization data 1144 * @init_data: initialization data
1191 */ 1145 */
diff --git a/drivers/s390/net/qeth_core_main.c b/drivers/s390/net/qeth_core_main.c
index 3ba738b2e271..28f71349fdec 100644
--- a/drivers/s390/net/qeth_core_main.c
+++ b/drivers/s390/net/qeth_core_main.c
@@ -1292,13 +1292,14 @@ int qeth_qdio_clear_card(struct qeth_card *card, int use_halt)
1292 QETH_QDIO_CLEANING)) { 1292 QETH_QDIO_CLEANING)) {
1293 case QETH_QDIO_ESTABLISHED: 1293 case QETH_QDIO_ESTABLISHED:
1294 if (card->info.type == QETH_CARD_TYPE_IQD) 1294 if (card->info.type == QETH_CARD_TYPE_IQD)
1295 rc = qdio_cleanup(CARD_DDEV(card), 1295 rc = qdio_shutdown(CARD_DDEV(card),
1296 QDIO_FLAG_CLEANUP_USING_HALT); 1296 QDIO_FLAG_CLEANUP_USING_HALT);
1297 else 1297 else
1298 rc = qdio_cleanup(CARD_DDEV(card), 1298 rc = qdio_shutdown(CARD_DDEV(card),
1299 QDIO_FLAG_CLEANUP_USING_CLEAR); 1299 QDIO_FLAG_CLEANUP_USING_CLEAR);
1300 if (rc) 1300 if (rc)
1301 QETH_DBF_TEXT_(TRACE, 3, "1err%d", rc); 1301 QETH_DBF_TEXT_(TRACE, 3, "1err%d", rc);
1302 qdio_free(CARD_DDEV(card));
1302 atomic_set(&card->qdio.state, QETH_QDIO_ALLOCATED); 1303 atomic_set(&card->qdio.state, QETH_QDIO_ALLOCATED);
1303 break; 1304 break;
1304 case QETH_QDIO_CLEANING: 1305 case QETH_QDIO_CLEANING:
@@ -3810,10 +3811,18 @@ static int qeth_qdio_establish(struct qeth_card *card)
3810 3811
3811 if (atomic_cmpxchg(&card->qdio.state, QETH_QDIO_ALLOCATED, 3812 if (atomic_cmpxchg(&card->qdio.state, QETH_QDIO_ALLOCATED,
3812 QETH_QDIO_ESTABLISHED) == QETH_QDIO_ALLOCATED) { 3813 QETH_QDIO_ESTABLISHED) == QETH_QDIO_ALLOCATED) {
3813 rc = qdio_initialize(&init_data); 3814 rc = qdio_allocate(&init_data);
3814 if (rc) 3815 if (rc) {
3816 atomic_set(&card->qdio.state, QETH_QDIO_ALLOCATED);
3817 goto out;
3818 }
3819 rc = qdio_establish(&init_data);
3820 if (rc) {
3815 atomic_set(&card->qdio.state, QETH_QDIO_ALLOCATED); 3821 atomic_set(&card->qdio.state, QETH_QDIO_ALLOCATED);
3822 qdio_free(CARD_DDEV(card));
3823 }
3816 } 3824 }
3825out:
3817 kfree(out_sbal_ptrs); 3826 kfree(out_sbal_ptrs);
3818 kfree(in_sbal_ptrs); 3827 kfree(in_sbal_ptrs);
3819 kfree(qib_param_field); 3828 kfree(qib_param_field);