diff options
author | Frank Pavlic <fpavlic@de.ibm.com> | 2006-09-15 10:27:02 -0400 |
---|---|---|
committer | Jeff Garzik <jeff@garzik.org> | 2006-09-17 01:03:08 -0400 |
commit | 8b98a37c4b00f3fbcf162281bd4595777e61241b (patch) | |
tree | 3d3dfe8a3d1872dbc6bd6cca37a4454952310203 /drivers/s390/net | |
parent | f956b6902eabbff249000287c7b36cd65761d8b8 (diff) |
[PATCH] s390: qeth driver fixes [6/6]
[PATCH 9/9] s390: qeth driver fixes [6/6]
From: Frank Pavlic <fpavlic@de.ibm.com>
- Hipersockets has no IPV6 support, thus prevent issueing
SETRTG_IPV6 control commands on Hipersockets devices.
- fixed error handling in qeth_sysfs_(un)register
Signed-off-by: Frank Pavlic <fpavlic@de.ibm.com>
Signed-off-by: Jeff Garzik <jeff@garzik.org>
Diffstat (limited to 'drivers/s390/net')
-rw-r--r-- | drivers/s390/net/qeth_main.c | 59 |
1 files changed, 39 insertions, 20 deletions
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index a1b2e6fd38ca..5613b4564fa2 100644 --- a/drivers/s390/net/qeth_main.c +++ b/drivers/s390/net/qeth_main.c | |||
@@ -7344,6 +7344,8 @@ qeth_setrouting_v6(struct qeth_card *card) | |||
7344 | QETH_DBF_TEXT(trace,3,"setrtg6"); | 7344 | QETH_DBF_TEXT(trace,3,"setrtg6"); |
7345 | #ifdef CONFIG_QETH_IPV6 | 7345 | #ifdef CONFIG_QETH_IPV6 |
7346 | 7346 | ||
7347 | if (!qeth_is_supported(card, IPA_IPV6)) | ||
7348 | return 0; | ||
7347 | qeth_correct_routing_type(card, &card->options.route6.type, | 7349 | qeth_correct_routing_type(card, &card->options.route6.type, |
7348 | QETH_PROT_IPV6); | 7350 | QETH_PROT_IPV6); |
7349 | 7351 | ||
@@ -8544,34 +8546,44 @@ qeth_ipv6_uninit(void) | |||
8544 | static void | 8546 | static void |
8545 | qeth_sysfs_unregister(void) | 8547 | qeth_sysfs_unregister(void) |
8546 | { | 8548 | { |
8549 | s390_root_dev_unregister(qeth_root_dev); | ||
8547 | qeth_remove_driver_attributes(); | 8550 | qeth_remove_driver_attributes(); |
8548 | ccw_driver_unregister(&qeth_ccw_driver); | 8551 | ccw_driver_unregister(&qeth_ccw_driver); |
8549 | ccwgroup_driver_unregister(&qeth_ccwgroup_driver); | 8552 | ccwgroup_driver_unregister(&qeth_ccwgroup_driver); |
8550 | s390_root_dev_unregister(qeth_root_dev); | ||
8551 | } | 8553 | } |
8554 | |||
8552 | /** | 8555 | /** |
8553 | * register qeth at sysfs | 8556 | * register qeth at sysfs |
8554 | */ | 8557 | */ |
8555 | static int | 8558 | static int |
8556 | qeth_sysfs_register(void) | 8559 | qeth_sysfs_register(void) |
8557 | { | 8560 | { |
8558 | int rc=0; | 8561 | int rc; |
8559 | 8562 | ||
8560 | rc = ccwgroup_driver_register(&qeth_ccwgroup_driver); | 8563 | rc = ccwgroup_driver_register(&qeth_ccwgroup_driver); |
8561 | if (rc) | 8564 | if (rc) |
8562 | return rc; | 8565 | goto out; |
8566 | |||
8563 | rc = ccw_driver_register(&qeth_ccw_driver); | 8567 | rc = ccw_driver_register(&qeth_ccw_driver); |
8564 | if (rc) | 8568 | if (rc) |
8565 | return rc; | 8569 | goto out_ccw_driver; |
8570 | |||
8566 | rc = qeth_create_driver_attributes(); | 8571 | rc = qeth_create_driver_attributes(); |
8567 | if (rc) | 8572 | if (rc) |
8568 | return rc; | 8573 | goto out_qeth_attr; |
8574 | |||
8569 | qeth_root_dev = s390_root_dev_register("qeth"); | 8575 | qeth_root_dev = s390_root_dev_register("qeth"); |
8570 | if (IS_ERR(qeth_root_dev)) { | 8576 | rc = IS_ERR(qeth_root_dev) ? PTR_ERR(qeth_root_dev) : 0; |
8571 | rc = PTR_ERR(qeth_root_dev); | 8577 | if (!rc) |
8572 | return rc; | 8578 | goto out; |
8573 | } | 8579 | |
8574 | return 0; | 8580 | qeth_remove_driver_attributes(); |
8581 | out_qeth_attr: | ||
8582 | ccw_driver_unregister(&qeth_ccw_driver); | ||
8583 | out_ccw_driver: | ||
8584 | ccwgroup_driver_unregister(&qeth_ccwgroup_driver); | ||
8585 | out: | ||
8586 | return rc; | ||
8575 | } | 8587 | } |
8576 | 8588 | ||
8577 | /*** | 8589 | /*** |
@@ -8580,7 +8592,7 @@ qeth_sysfs_register(void) | |||
8580 | static int __init | 8592 | static int __init |
8581 | qeth_init(void) | 8593 | qeth_init(void) |
8582 | { | 8594 | { |
8583 | int rc=0; | 8595 | int rc; |
8584 | 8596 | ||
8585 | PRINT_INFO("loading %s\n", version); | 8597 | PRINT_INFO("loading %s\n", version); |
8586 | 8598 | ||
@@ -8589,20 +8601,26 @@ qeth_init(void) | |||
8589 | spin_lock_init(&qeth_notify_lock); | 8601 | spin_lock_init(&qeth_notify_lock); |
8590 | rwlock_init(&qeth_card_list.rwlock); | 8602 | rwlock_init(&qeth_card_list.rwlock); |
8591 | 8603 | ||
8592 | if (qeth_register_dbf_views()) | 8604 | rc = qeth_register_dbf_views(); |
8605 | if (rc) | ||
8593 | goto out_err; | 8606 | goto out_err; |
8594 | if (qeth_sysfs_register()) | 8607 | |
8595 | goto out_sysfs; | 8608 | rc = qeth_sysfs_register(); |
8609 | if (rc) | ||
8610 | goto out_dbf; | ||
8596 | 8611 | ||
8597 | #ifdef CONFIG_QETH_IPV6 | 8612 | #ifdef CONFIG_QETH_IPV6 |
8598 | if (qeth_ipv6_init()) { | 8613 | rc = qeth_ipv6_init(); |
8599 | PRINT_ERR("Out of memory during ipv6 init.\n"); | 8614 | if (rc) { |
8615 | PRINT_ERR("Out of memory during ipv6 init code = %d\n", rc); | ||
8600 | goto out_sysfs; | 8616 | goto out_sysfs; |
8601 | } | 8617 | } |
8602 | #endif /* QETH_IPV6 */ | 8618 | #endif /* QETH_IPV6 */ |
8603 | if (qeth_register_notifiers()) | 8619 | rc = qeth_register_notifiers(); |
8620 | if (rc) | ||
8604 | goto out_ipv6; | 8621 | goto out_ipv6; |
8605 | if (qeth_create_procfs_entries()) | 8622 | rc = qeth_create_procfs_entries(); |
8623 | if (rc) | ||
8606 | goto out_notifiers; | 8624 | goto out_notifiers; |
8607 | 8625 | ||
8608 | return rc; | 8626 | return rc; |
@@ -8612,12 +8630,13 @@ out_notifiers: | |||
8612 | out_ipv6: | 8630 | out_ipv6: |
8613 | #ifdef CONFIG_QETH_IPV6 | 8631 | #ifdef CONFIG_QETH_IPV6 |
8614 | qeth_ipv6_uninit(); | 8632 | qeth_ipv6_uninit(); |
8615 | #endif /* QETH_IPV6 */ | ||
8616 | out_sysfs: | 8633 | out_sysfs: |
8634 | #endif /* QETH_IPV6 */ | ||
8617 | qeth_sysfs_unregister(); | 8635 | qeth_sysfs_unregister(); |
8636 | out_dbf: | ||
8618 | qeth_unregister_dbf_views(); | 8637 | qeth_unregister_dbf_views(); |
8619 | out_err: | 8638 | out_err: |
8620 | PRINT_ERR("Initialization failed"); | 8639 | PRINT_ERR("Initialization failed with code %d\n", rc); |
8621 | return rc; | 8640 | return rc; |
8622 | } | 8641 | } |
8623 | 8642 | ||