diff options
author | Frank Pavlic <fpavlic@de.ibm.com> | 2005-12-13 02:21:47 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-12-24 10:05:51 -0500 |
commit | 6c6b3e7c4f93d330b920e6531b579b1f6bae5ac1 (patch) | |
tree | 2a9b6c55774b80934d3bb760434c6b54cdd7c172 /drivers/s390 | |
parent | afcceaa3c7b7fbf7e2b95c5f0dd43547b03292d2 (diff) |
[PATCH] s390: some minor qeth driver fixes
[patch 1/3] s390: some minor qeth driver fixes
From: Frank Pavlic <pavlic@de.ibm.com>
- let's have just one function for both ,input and output queue
to check qdio errors
- add /proc/s390dbf/qeth_qerr entries for outbound processing
- check removed for layer2 device in qeth_add_multicast_ipv6
- NULL pointer dereference with bonding and VLAN device fixed
- minimum length check for portname fixed
Signed-off-by: Frank Pavlic <pavlic@de.ibm.com>
diffstat:
qeth_main.c | 42 +++++++++++++++++++++---------------------
qeth_sys.c | 6 +++---
2 files changed, 24 insertions(+), 24 deletions(-)
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/s390')
-rw-r--r-- | drivers/s390/net/qeth_main.c | 42 | ||||
-rw-r--r-- | drivers/s390/net/qeth_sys.c | 6 |
2 files changed, 24 insertions, 24 deletions
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 99cceb242ec4..5d2d548e5421 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.242 $) | 3 | * linux/drivers/s390/net/qeth_main.c ($Revision: 1.246 $) |
4 | * | 4 | * |
5 | * Linux on zSeries OSA Express and HiperSockets support | 5 | * Linux on zSeries OSA Express and HiperSockets support |
6 | * | 6 | * |
@@ -72,7 +72,7 @@ | |||
72 | #include "qeth_eddp.h" | 72 | #include "qeth_eddp.h" |
73 | #include "qeth_tso.h" | 73 | #include "qeth_tso.h" |
74 | 74 | ||
75 | #define VERSION_QETH_C "$Revision: 1.242 $" | 75 | #define VERSION_QETH_C "$Revision: 1.246 $" |
76 | static const char *version = "qeth S/390 OSA-Express driver"; | 76 | static const char *version = "qeth S/390 OSA-Express driver"; |
77 | 77 | ||
78 | /** | 78 | /** |
@@ -2203,24 +2203,21 @@ qeth_ulp_setup(struct qeth_card *card) | |||
2203 | } | 2203 | } |
2204 | 2204 | ||
2205 | static inline int | 2205 | static inline int |
2206 | qeth_check_for_inbound_error(struct qeth_qdio_buffer *buf, | 2206 | qeth_check_qdio_errors(struct qdio_buffer *buf, unsigned int qdio_error, |
2207 | unsigned int qdio_error, | 2207 | unsigned int siga_error, const char *dbftext) |
2208 | unsigned int siga_error) | ||
2209 | { | 2208 | { |
2210 | int rc = 0; | ||
2211 | |||
2212 | if (qdio_error || siga_error) { | 2209 | if (qdio_error || siga_error) { |
2213 | QETH_DBF_TEXT(trace, 2, "qdinerr"); | 2210 | QETH_DBF_TEXT(trace, 2, dbftext); |
2214 | QETH_DBF_TEXT(qerr, 2, "qdinerr"); | 2211 | QETH_DBF_TEXT(qerr, 2, dbftext); |
2215 | QETH_DBF_TEXT_(qerr, 2, " F15=%02X", | 2212 | QETH_DBF_TEXT_(qerr, 2, " F15=%02X", |
2216 | buf->buffer->element[15].flags & 0xff); | 2213 | buf->element[15].flags & 0xff); |
2217 | QETH_DBF_TEXT_(qerr, 2, " F14=%02X", | 2214 | QETH_DBF_TEXT_(qerr, 2, " F14=%02X", |
2218 | buf->buffer->element[14].flags & 0xff); | 2215 | buf->element[14].flags & 0xff); |
2219 | QETH_DBF_TEXT_(qerr, 2, " qerr=%X", qdio_error); | 2216 | QETH_DBF_TEXT_(qerr, 2, " qerr=%X", qdio_error); |
2220 | QETH_DBF_TEXT_(qerr, 2, " serr=%X", siga_error); | 2217 | QETH_DBF_TEXT_(qerr, 2, " serr=%X", siga_error); |
2221 | rc = 1; | 2218 | return 1; |
2222 | } | 2219 | } |
2223 | return rc; | 2220 | return 0; |
2224 | } | 2221 | } |
2225 | 2222 | ||
2226 | static inline struct sk_buff * | 2223 | static inline struct sk_buff * |
@@ -2769,8 +2766,9 @@ qeth_qdio_input_handler(struct ccw_device * ccwdev, unsigned int status, | |||
2769 | for (i = first_element; i < (first_element + count); ++i) { | 2766 | for (i = first_element; i < (first_element + count); ++i) { |
2770 | index = i % QDIO_MAX_BUFFERS_PER_Q; | 2767 | index = i % QDIO_MAX_BUFFERS_PER_Q; |
2771 | buffer = &card->qdio.in_q->bufs[index]; | 2768 | buffer = &card->qdio.in_q->bufs[index]; |
2772 | if (!((status == QDIO_STATUS_LOOK_FOR_ERROR) && | 2769 | if (!((status & QDIO_STATUS_LOOK_FOR_ERROR) && |
2773 | qeth_check_for_inbound_error(buffer, qdio_err, siga_err))) | 2770 | qeth_check_qdio_errors(buffer->buffer, |
2771 | qdio_err, siga_err,"qinerr"))) | ||
2774 | qeth_process_inbound_buffer(card, buffer, index); | 2772 | qeth_process_inbound_buffer(card, buffer, index); |
2775 | /* clear buffer and give back to hardware */ | 2773 | /* clear buffer and give back to hardware */ |
2776 | qeth_put_buffer_pool_entry(card, buffer->pool_entry); | 2774 | qeth_put_buffer_pool_entry(card, buffer->pool_entry); |
@@ -2785,12 +2783,13 @@ qeth_qdio_input_handler(struct ccw_device * ccwdev, unsigned int status, | |||
2785 | static inline int | 2783 | static inline int |
2786 | qeth_handle_send_error(struct qeth_card *card, | 2784 | qeth_handle_send_error(struct qeth_card *card, |
2787 | struct qeth_qdio_out_buffer *buffer, | 2785 | struct qeth_qdio_out_buffer *buffer, |
2788 | int qdio_err, int siga_err) | 2786 | unsigned int qdio_err, unsigned int siga_err) |
2789 | { | 2787 | { |
2790 | int sbalf15 = buffer->buffer->element[15].flags & 0xff; | 2788 | int sbalf15 = buffer->buffer->element[15].flags & 0xff; |
2791 | int cc = siga_err & 3; | 2789 | int cc = siga_err & 3; |
2792 | 2790 | ||
2793 | QETH_DBF_TEXT(trace, 6, "hdsnderr"); | 2791 | QETH_DBF_TEXT(trace, 6, "hdsnderr"); |
2792 | qeth_check_qdio_errors(buffer->buffer, qdio_err, siga_err, "qouterr"); | ||
2794 | switch (cc) { | 2793 | switch (cc) { |
2795 | case 0: | 2794 | case 0: |
2796 | if (qdio_err){ | 2795 | if (qdio_err){ |
@@ -3047,7 +3046,8 @@ qeth_qdio_output_handler(struct ccw_device * ccwdev, unsigned int status, | |||
3047 | for(i = first_element; i < (first_element + count); ++i){ | 3046 | for(i = first_element; i < (first_element + count); ++i){ |
3048 | buffer = &queue->bufs[i % QDIO_MAX_BUFFERS_PER_Q]; | 3047 | buffer = &queue->bufs[i % QDIO_MAX_BUFFERS_PER_Q]; |
3049 | /*we only handle the KICK_IT error by doing a recovery */ | 3048 | /*we only handle the KICK_IT error by doing a recovery */ |
3050 | if (qeth_handle_send_error(card, buffer, qdio_error, siga_error) | 3049 | if (qeth_handle_send_error(card, buffer, |
3050 | qdio_error, siga_error) | ||
3051 | == QETH_SEND_ERROR_KICK_IT){ | 3051 | == QETH_SEND_ERROR_KICK_IT){ |
3052 | netif_stop_queue(card->dev); | 3052 | netif_stop_queue(card->dev); |
3053 | qeth_schedule_recovery(card); | 3053 | qeth_schedule_recovery(card); |
@@ -3289,7 +3289,6 @@ qeth_init_qdio_info(struct qeth_card *card) | |||
3289 | card->qdio.in_buf_pool.buf_count = card->qdio.init_pool.buf_count; | 3289 | card->qdio.in_buf_pool.buf_count = card->qdio.init_pool.buf_count; |
3290 | INIT_LIST_HEAD(&card->qdio.in_buf_pool.entry_list); | 3290 | INIT_LIST_HEAD(&card->qdio.in_buf_pool.entry_list); |
3291 | INIT_LIST_HEAD(&card->qdio.init_pool.entry_list); | 3291 | INIT_LIST_HEAD(&card->qdio.init_pool.entry_list); |
3292 | /* outbound */ | ||
3293 | } | 3292 | } |
3294 | 3293 | ||
3295 | static int | 3294 | static int |
@@ -3731,6 +3730,9 @@ qeth_verify_vlan_dev(struct net_device *dev, struct qeth_card *card) | |||
3731 | break; | 3730 | break; |
3732 | } | 3731 | } |
3733 | } | 3732 | } |
3733 | if (rc && !(VLAN_DEV_INFO(dev)->real_dev->priv == (void *)card)) | ||
3734 | return 0; | ||
3735 | |||
3734 | #endif | 3736 | #endif |
3735 | return rc; | 3737 | return rc; |
3736 | } | 3738 | } |
@@ -5870,10 +5872,8 @@ qeth_add_multicast_ipv6(struct qeth_card *card) | |||
5870 | struct inet6_dev *in6_dev; | 5872 | struct inet6_dev *in6_dev; |
5871 | 5873 | ||
5872 | QETH_DBF_TEXT(trace,4,"chkmcv6"); | 5874 | QETH_DBF_TEXT(trace,4,"chkmcv6"); |
5873 | if ((card->options.layer2 == 0) && | 5875 | if (!qeth_is_supported(card, IPA_IPV6)) |
5874 | (!qeth_is_supported(card, IPA_IPV6)) ) | ||
5875 | return ; | 5876 | return ; |
5876 | |||
5877 | in6_dev = in6_dev_get(card->dev); | 5877 | in6_dev = in6_dev_get(card->dev); |
5878 | if (in6_dev == NULL) | 5878 | if (in6_dev == NULL) |
5879 | return; | 5879 | return; |
diff --git a/drivers/s390/net/qeth_sys.c b/drivers/s390/net/qeth_sys.c index ddd6019ba092..80925964eb7e 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.58 $) | 3 | * linux/drivers/s390/net/qeth_sys.c ($Revision: 1.59 $) |
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 | ||
23 | const char *VERSION_QETH_SYS_C = "$Revision: 1.58 $"; | 23 | const char *VERSION_QETH_SYS_C = "$Revision: 1.59 $"; |
24 | 24 | ||
25 | /*****************************************************************************/ | 25 | /*****************************************************************************/ |
26 | /* */ | 26 | /* */ |
@@ -160,7 +160,7 @@ qeth_dev_portname_store(struct device *dev, struct device_attribute *attr, const | |||
160 | return -EPERM; | 160 | return -EPERM; |
161 | 161 | ||
162 | tmp = strsep((char **) &buf, "\n"); | 162 | tmp = strsep((char **) &buf, "\n"); |
163 | if ((strlen(tmp) > 8) || (strlen(tmp) < 2)) | 163 | if ((strlen(tmp) > 8) || (strlen(tmp) == 0)) |
164 | return -EINVAL; | 164 | return -EINVAL; |
165 | 165 | ||
166 | card->info.portname[0] = strlen(tmp); | 166 | card->info.portname[0] = strlen(tmp); |