aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/s390
diff options
context:
space:
mode:
authorFrank Pavlic <pavlic@de.ibm.com>2005-09-14 12:05:31 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-09-14 12:15:31 -0400
commitf3d242e8f2bf12cb45eb35b7d2e69483d1209b13 (patch)
tree379f576536f37f754c46457a6ebca2c5758e12ee /drivers/s390
parent9cb90de84b1d9c4686f12042a3696df38e0114c3 (diff)
[PATCH] s390: qeth driver fixes
[patch 4/4] s390: qeth driver fixes . From: Frank Pavlic <pavlic@de.ibm.com> - Clear read channel first prior to using ccw_device_set_offline. - use QETH_DBF_TEXT instead of QETH_DBF_SPRINTF - invoke qeth_halt_channel and qeth_clear_channel for all channels, even if halt/clear for one of the channel fails. - enable qeth_arp_query function for GuestLAN devices Signed-off-by: Frank Pavlic <pavlic@de.ibm.com> diffstat: qeth.h | 2 - qeth_main.c | 106 +++++++++++++++++++++++++----------------------------------- qeth_sys.c | 11 +++--- 3 files changed, 53 insertions(+), 66 deletions(-) Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/net/qeth.h2
-rw-r--r--drivers/s390/net/qeth_main.c106
-rw-r--r--drivers/s390/net/qeth_sys.c11
3 files changed, 53 insertions, 66 deletions
diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h
index 5c67d5379740..2ad4797ce024 100644
--- a/drivers/s390/net/qeth.h
+++ b/drivers/s390/net/qeth.h
@@ -24,7 +24,7 @@
24 24
25#include "qeth_mpc.h" 25#include "qeth_mpc.h"
26 26
27#define VERSION_QETH_H "$Revision: 1.141 $" 27#define VERSION_QETH_H "$Revision: 1.142 $"
28 28
29#ifdef CONFIG_QETH_IPV6 29#ifdef CONFIG_QETH_IPV6
30#define QETH_VERSION_IPV6 ":IPv6" 30#define QETH_VERSION_IPV6 ":IPv6"
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c
index 6f784c3f43d5..86582cf1e19e 100644
--- a/drivers/s390/net/qeth_main.c
+++ b/drivers/s390/net/qeth_main.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * 2 *
3 * linux/drivers/s390/net/qeth_main.c ($Revision: 1.219 $) 3 * linux/drivers/s390/net/qeth_main.c ($Revision: 1.224 $)
4 * 4 *
5 * Linux on zSeries OSA Express and HiperSockets support 5 * Linux on zSeries OSA Express and HiperSockets support
6 * 6 *
@@ -12,7 +12,7 @@
12 * Frank Pavlic (pavlic@de.ibm.com) and 12 * Frank Pavlic (pavlic@de.ibm.com) and
13 * Thomas Spatzier <tspat@de.ibm.com> 13 * Thomas Spatzier <tspat@de.ibm.com>
14 * 14 *
15 * $Revision: 1.219 $ $Date: 2005/05/04 20:19:18 $ 15 * $Revision: 1.224 $ $Date: 2005/05/04 20:19:18 $
16 * 16 *
17 * This program is free software; you can redistribute it and/or modify 17 * This program is free software; you can redistribute it and/or modify
18 * it under the terms of the GNU General Public License as published by 18 * it under the terms of the GNU General Public License as published by
@@ -29,14 +29,6 @@
29 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 29 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30 */ 30 */
31 31
32/***
33 * eye catcher; just for debugging purposes
34 */
35void volatile
36qeth_eyecatcher(void)
37{
38 return;
39}
40 32
41#include <linux/config.h> 33#include <linux/config.h>
42#include <linux/module.h> 34#include <linux/module.h>
@@ -80,7 +72,7 @@ qeth_eyecatcher(void)
80#include "qeth_eddp.h" 72#include "qeth_eddp.h"
81#include "qeth_tso.h" 73#include "qeth_tso.h"
82 74
83#define VERSION_QETH_C "$Revision: 1.219 $" 75#define VERSION_QETH_C "$Revision: 1.224 $"
84static const char *version = "qeth S/390 OSA-Express driver"; 76static const char *version = "qeth S/390 OSA-Express driver";
85 77
86/** 78/**
@@ -2759,11 +2751,9 @@ qeth_flush_buffers(struct qeth_qdio_out_q *queue, int under_int,
2759 queue->card->perf_stats.outbound_do_qdio_start_time; 2751 queue->card->perf_stats.outbound_do_qdio_start_time;
2760#endif 2752#endif
2761 if (rc){ 2753 if (rc){
2762 QETH_DBF_SPRINTF(trace, 0, "qeth_flush_buffers: do_QDIO "
2763 "returned error (%i) on device %s.",
2764 rc, CARD_DDEV_ID(queue->card));
2765 QETH_DBF_TEXT(trace, 2, "flushbuf"); 2754 QETH_DBF_TEXT(trace, 2, "flushbuf");
2766 QETH_DBF_TEXT_(trace, 2, " err%d", rc); 2755 QETH_DBF_TEXT_(trace, 2, " err%d", rc);
2756 QETH_DBF_TEXT_(trace, 2, "%s", CARD_DDEV_ID(queue->card));
2767 queue->card->stats.tx_errors += count; 2757 queue->card->stats.tx_errors += count;
2768 /* this must not happen under normal circumstances. if it 2758 /* this must not happen under normal circumstances. if it
2769 * happens something is really wrong -> recover */ 2759 * happens something is really wrong -> recover */
@@ -2909,11 +2899,8 @@ qeth_qdio_output_handler(struct ccw_device * ccwdev, unsigned int status,
2909 QETH_DBF_TEXT(trace, 6, "qdouhdl"); 2899 QETH_DBF_TEXT(trace, 6, "qdouhdl");
2910 if (status & QDIO_STATUS_LOOK_FOR_ERROR) { 2900 if (status & QDIO_STATUS_LOOK_FOR_ERROR) {
2911 if (status & QDIO_STATUS_ACTIVATE_CHECK_CONDITION){ 2901 if (status & QDIO_STATUS_ACTIVATE_CHECK_CONDITION){
2912 QETH_DBF_SPRINTF(trace, 2, "On device %s: " 2902 QETH_DBF_TEXT(trace, 2, "achkcond");
2913 "received active check " 2903 QETH_DBF_TEXT_(trace, 2, "%s", CARD_BUS_ID(card));
2914 "condition (0x%08x).",
2915 CARD_BUS_ID(card), status);
2916 QETH_DBF_TEXT(trace, 2, "chkcond");
2917 QETH_DBF_TEXT_(trace, 2, "%08x", status); 2904 QETH_DBF_TEXT_(trace, 2, "%08x", status);
2918 netif_stop_queue(card->dev); 2905 netif_stop_queue(card->dev);
2919 qeth_schedule_recovery(card); 2906 qeth_schedule_recovery(card);
@@ -3356,26 +3343,32 @@ qeth_halt_channel(struct qeth_channel *channel)
3356static int 3343static int
3357qeth_halt_channels(struct qeth_card *card) 3344qeth_halt_channels(struct qeth_card *card)
3358{ 3345{
3359 int rc = 0; 3346 int rc1 = 0, rc2=0, rc3 = 0;
3360 3347
3361 QETH_DBF_TEXT(trace,3,"haltchs"); 3348 QETH_DBF_TEXT(trace,3,"haltchs");
3362 if ((rc = qeth_halt_channel(&card->read))) 3349 rc1 = qeth_halt_channel(&card->read);
3363 return rc; 3350 rc2 = qeth_halt_channel(&card->write);
3364 if ((rc = qeth_halt_channel(&card->write))) 3351 rc3 = qeth_halt_channel(&card->data);
3365 return rc; 3352 if (rc1)
3366 return qeth_halt_channel(&card->data); 3353 return rc1;
3354 if (rc2)
3355 return rc2;
3356 return rc3;
3367} 3357}
3368static int 3358static int
3369qeth_clear_channels(struct qeth_card *card) 3359qeth_clear_channels(struct qeth_card *card)
3370{ 3360{
3371 int rc = 0; 3361 int rc1 = 0, rc2=0, rc3 = 0;
3372 3362
3373 QETH_DBF_TEXT(trace,3,"clearchs"); 3363 QETH_DBF_TEXT(trace,3,"clearchs");
3374 if ((rc = qeth_clear_channel(&card->read))) 3364 rc1 = qeth_clear_channel(&card->read);
3375 return rc; 3365 rc2 = qeth_clear_channel(&card->write);
3376 if ((rc = qeth_clear_channel(&card->write))) 3366 rc3 = qeth_clear_channel(&card->data);
3377 return rc; 3367 if (rc1)
3378 return qeth_clear_channel(&card->data); 3368 return rc1;
3369 if (rc2)
3370 return rc2;
3371 return rc3;
3379} 3372}
3380 3373
3381static int 3374static int
@@ -3445,23 +3438,23 @@ qeth_mpc_initialize(struct qeth_card *card)
3445 } 3438 }
3446 if ((rc = qeth_cm_enable(card))){ 3439 if ((rc = qeth_cm_enable(card))){
3447 QETH_DBF_TEXT_(setup, 2, "2err%d", rc); 3440 QETH_DBF_TEXT_(setup, 2, "2err%d", rc);
3448 return rc; 3441 goto out_qdio;
3449 } 3442 }
3450 if ((rc = qeth_cm_setup(card))){ 3443 if ((rc = qeth_cm_setup(card))){
3451 QETH_DBF_TEXT_(setup, 2, "3err%d", rc); 3444 QETH_DBF_TEXT_(setup, 2, "3err%d", rc);
3452 return rc; 3445 goto out_qdio;
3453 } 3446 }
3454 if ((rc = qeth_ulp_enable(card))){ 3447 if ((rc = qeth_ulp_enable(card))){
3455 QETH_DBF_TEXT_(setup, 2, "4err%d", rc); 3448 QETH_DBF_TEXT_(setup, 2, "4err%d", rc);
3456 return rc; 3449 goto out_qdio;
3457 } 3450 }
3458 if ((rc = qeth_ulp_setup(card))){ 3451 if ((rc = qeth_ulp_setup(card))){
3459 QETH_DBF_TEXT_(setup, 2, "5err%d", rc); 3452 QETH_DBF_TEXT_(setup, 2, "5err%d", rc);
3460 return rc; 3453 goto out_qdio;
3461 } 3454 }
3462 if ((rc = qeth_alloc_qdio_buffers(card))){ 3455 if ((rc = qeth_alloc_qdio_buffers(card))){
3463 QETH_DBF_TEXT_(setup, 2, "5err%d", rc); 3456 QETH_DBF_TEXT_(setup, 2, "5err%d", rc);
3464 return rc; 3457 goto out_qdio;
3465 } 3458 }
3466 if ((rc = qeth_qdio_establish(card))){ 3459 if ((rc = qeth_qdio_establish(card))){
3467 QETH_DBF_TEXT_(setup, 2, "6err%d", rc); 3460 QETH_DBF_TEXT_(setup, 2, "6err%d", rc);
@@ -4281,7 +4274,7 @@ qeth_send_packet(struct qeth_card *card, struct sk_buff *skb)
4281 int ipv = 0; 4274 int ipv = 0;
4282 int cast_type; 4275 int cast_type;
4283 struct qeth_qdio_out_q *queue; 4276 struct qeth_qdio_out_q *queue;
4284 struct qeth_hdr *hdr; 4277 struct qeth_hdr *hdr = NULL;
4285 int elements_needed = 0; 4278 int elements_needed = 0;
4286 enum qeth_large_send_types large_send = QETH_LARGE_SEND_NO; 4279 enum qeth_large_send_types large_send = QETH_LARGE_SEND_NO;
4287 struct qeth_eddp_context *ctx = NULL; 4280 struct qeth_eddp_context *ctx = NULL;
@@ -4512,7 +4505,11 @@ qeth_arp_set_no_entries(struct qeth_card *card, int no_entries)
4512 4505
4513 QETH_DBF_TEXT(trace,3,"arpstnoe"); 4506 QETH_DBF_TEXT(trace,3,"arpstnoe");
4514 4507
4515 /* TODO: really not supported by GuestLAN? */ 4508 /*
4509 * currently GuestLAN only supports the ARP assist function
4510 * IPA_CMD_ASS_ARP_QUERY_INFO, but not IPA_CMD_ASS_ARP_SET_NO_ENTRIES;
4511 * thus we say EOPNOTSUPP for this ARP function
4512 */
4516 if (card->info.guestlan) 4513 if (card->info.guestlan)
4517 return -EOPNOTSUPP; 4514 return -EOPNOTSUPP;
4518 if (!qeth_is_supported(card,IPA_ARP_PROCESSING)) { 4515 if (!qeth_is_supported(card,IPA_ARP_PROCESSING)) {
@@ -4689,14 +4686,6 @@ qeth_arp_query(struct qeth_card *card, char *udata)
4689 4686
4690 QETH_DBF_TEXT(trace,3,"arpquery"); 4687 QETH_DBF_TEXT(trace,3,"arpquery");
4691 4688
4692 /*
4693 * currently GuestLAN does only deliver all zeros on query arp,
4694 * even though arp processing is supported (according to IPA supp.
4695 * funcs flags); since all zeros is no valueable information,
4696 * we say EOPNOTSUPP for all ARP functions
4697 */
4698 /*if (card->info.guestlan)
4699 return -EOPNOTSUPP; */
4700 if (!qeth_is_supported(card,/*IPA_QUERY_ARP_ADDR_INFO*/ 4689 if (!qeth_is_supported(card,/*IPA_QUERY_ARP_ADDR_INFO*/
4701 IPA_ARP_PROCESSING)) { 4690 IPA_ARP_PROCESSING)) {
4702 PRINT_WARN("ARP processing not supported " 4691 PRINT_WARN("ARP processing not supported "
@@ -4902,10 +4891,9 @@ qeth_arp_add_entry(struct qeth_card *card, struct qeth_arp_cache_entry *entry)
4902 QETH_DBF_TEXT(trace,3,"arpadent"); 4891 QETH_DBF_TEXT(trace,3,"arpadent");
4903 4892
4904 /* 4893 /*
4905 * currently GuestLAN does only deliver all zeros on query arp, 4894 * currently GuestLAN only supports the ARP assist function
4906 * even though arp processing is supported (according to IPA supp. 4895 * IPA_CMD_ASS_ARP_QUERY_INFO, but not IPA_CMD_ASS_ARP_ADD_ENTRY;
4907 * funcs flags); since all zeros is no valueable information, 4896 * thus we say EOPNOTSUPP for this ARP function
4908 * we say EOPNOTSUPP for all ARP functions
4909 */ 4897 */
4910 if (card->info.guestlan) 4898 if (card->info.guestlan)
4911 return -EOPNOTSUPP; 4899 return -EOPNOTSUPP;
@@ -4945,10 +4933,9 @@ qeth_arp_remove_entry(struct qeth_card *card, struct qeth_arp_cache_entry *entry
4945 QETH_DBF_TEXT(trace,3,"arprment"); 4933 QETH_DBF_TEXT(trace,3,"arprment");
4946 4934
4947 /* 4935 /*
4948 * currently GuestLAN does only deliver all zeros on query arp, 4936 * currently GuestLAN only supports the ARP assist function
4949 * even though arp processing is supported (according to IPA supp. 4937 * IPA_CMD_ASS_ARP_QUERY_INFO, but not IPA_CMD_ASS_ARP_REMOVE_ENTRY;
4950 * funcs flags); since all zeros is no valueable information, 4938 * thus we say EOPNOTSUPP for this ARP function
4951 * we say EOPNOTSUPP for all ARP functions
4952 */ 4939 */
4953 if (card->info.guestlan) 4940 if (card->info.guestlan)
4954 return -EOPNOTSUPP; 4941 return -EOPNOTSUPP;
@@ -4986,11 +4973,10 @@ qeth_arp_flush_cache(struct qeth_card *card)
4986 QETH_DBF_TEXT(trace,3,"arpflush"); 4973 QETH_DBF_TEXT(trace,3,"arpflush");
4987 4974
4988 /* 4975 /*
4989 * currently GuestLAN does only deliver all zeros on query arp, 4976 * currently GuestLAN only supports the ARP assist function
4990 * even though arp processing is supported (according to IPA supp. 4977 * IPA_CMD_ASS_ARP_QUERY_INFO, but not IPA_CMD_ASS_ARP_FLUSH_CACHE;
4991 * funcs flags); since all zeros is no valueable information, 4978 * thus we say EOPNOTSUPP for this ARP function
4992 * we say EOPNOTSUPP for all ARP functions 4979 */
4993 */
4994 if (card->info.guestlan || (card->info.type == QETH_CARD_TYPE_IQD)) 4980 if (card->info.guestlan || (card->info.type == QETH_CARD_TYPE_IQD))
4995 return -EOPNOTSUPP; 4981 return -EOPNOTSUPP;
4996 if (!qeth_is_supported(card,IPA_ARP_PROCESSING)) { 4982 if (!qeth_is_supported(card,IPA_ARP_PROCESSING)) {
@@ -8266,7 +8252,6 @@ qeth_init(void)
8266{ 8252{
8267 int rc=0; 8253 int rc=0;
8268 8254
8269 qeth_eyecatcher();
8270 PRINT_INFO("loading %s (%s/%s/%s/%s/%s/%s/%s %s %s)\n", 8255 PRINT_INFO("loading %s (%s/%s/%s/%s/%s/%s/%s %s %s)\n",
8271 version, VERSION_QETH_C, VERSION_QETH_H, 8256 version, VERSION_QETH_C, VERSION_QETH_H,
8272 VERSION_QETH_MPC_H, VERSION_QETH_MPC_C, 8257 VERSION_QETH_MPC_H, VERSION_QETH_MPC_C,
@@ -8347,7 +8332,6 @@ again:
8347 printk("qeth: removed\n"); 8332 printk("qeth: removed\n");
8348} 8333}
8349 8334
8350EXPORT_SYMBOL(qeth_eyecatcher);
8351module_init(qeth_init); 8335module_init(qeth_init);
8352module_exit(qeth_exit); 8336module_exit(qeth_exit);
8353MODULE_AUTHOR("Frank Pavlic <pavlic@de.ibm.com>"); 8337MODULE_AUTHOR("Frank Pavlic <pavlic@de.ibm.com>");
diff --git a/drivers/s390/net/qeth_sys.c b/drivers/s390/net/qeth_sys.c
index 4bdc9046d98e..dda105b73063 100644
--- a/drivers/s390/net/qeth_sys.c
+++ b/drivers/s390/net/qeth_sys.c
@@ -1,6 +1,6 @@
1/* 1/*
2 * 2 *
3 * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.53 $) 3 * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.54 $)
4 * 4 *
5 * Linux on zSeries OSA Express and HiperSockets support 5 * Linux on zSeries OSA Express and HiperSockets support
6 * This file contains code related to sysfs. 6 * This file contains code related to sysfs.
@@ -20,7 +20,7 @@
20#include "qeth_mpc.h" 20#include "qeth_mpc.h"
21#include "qeth_fs.h" 21#include "qeth_fs.h"
22 22
23const char *VERSION_QETH_SYS_C = "$Revision: 1.53 $"; 23const char *VERSION_QETH_SYS_C = "$Revision: 1.54 $";
24 24
25/*****************************************************************************/ 25/*****************************************************************************/
26/* */ 26/* */
@@ -722,10 +722,13 @@ qeth_dev_layer2_store(struct device *dev, struct device_attribute *attr, const c
722 722
723 if (!card) 723 if (!card)
724 return -EINVAL; 724 return -EINVAL;
725 if (card->info.type == QETH_CARD_TYPE_IQD) {
726 PRINT_WARN("Layer2 on Hipersockets is not supported! \n");
727 return -EPERM;
728 }
725 729
726 if (((card->state != CARD_STATE_DOWN) && 730 if (((card->state != CARD_STATE_DOWN) &&
727 (card->state != CARD_STATE_RECOVER)) || 731 (card->state != CARD_STATE_RECOVER)))
728 (card->info.type != QETH_CARD_TYPE_OSAE))
729 return -EPERM; 732 return -EPERM;
730 733
731 i = simple_strtoul(buf, &tmp, 16); 734 i = simple_strtoul(buf, &tmp, 16);