diff options
Diffstat (limited to 'drivers/s390/net/qeth_main.c')
-rw-r--r-- | drivers/s390/net/qeth_main.c | 61 |
1 files changed, 29 insertions, 32 deletions
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index 99cceb242ec4..f8f55cc468ba 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.251 $) |
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 (fpavlic@de.ibm.com) and | 12 | * Frank Pavlic (fpavlic@de.ibm.com) and |
13 | * Thomas Spatzier <tspat@de.ibm.com> | 13 | * Thomas Spatzier <tspat@de.ibm.com> |
14 | * | 14 | * |
15 | * $Revision: 1.242 $ $Date: 2005/05/04 20:19:18 $ | 15 | * $Revision: 1.251 $ $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 |
@@ -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.251 $" |
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 | /** |
@@ -518,7 +518,8 @@ __qeth_set_offline(struct ccwgroup_device *cgdev, int recovery_mode) | |||
518 | 518 | ||
519 | QETH_DBF_TEXT(setup, 3, "setoffl"); | 519 | QETH_DBF_TEXT(setup, 3, "setoffl"); |
520 | QETH_DBF_HEX(setup, 3, &card, sizeof(void *)); | 520 | QETH_DBF_HEX(setup, 3, &card, sizeof(void *)); |
521 | 521 | ||
522 | netif_carrier_off(card->dev); | ||
522 | recover_flag = card->state; | 523 | recover_flag = card->state; |
523 | if (qeth_stop_card(card, recovery_mode) == -ERESTARTSYS){ | 524 | if (qeth_stop_card(card, recovery_mode) == -ERESTARTSYS){ |
524 | PRINT_WARN("Stopping card %s interrupted by user!\n", | 525 | PRINT_WARN("Stopping card %s interrupted by user!\n", |
@@ -1020,7 +1021,6 @@ void | |||
1020 | qeth_schedule_recovery(struct qeth_card *card) | 1021 | qeth_schedule_recovery(struct qeth_card *card) |
1021 | { | 1022 | { |
1022 | QETH_DBF_TEXT(trace,2,"startrec"); | 1023 | QETH_DBF_TEXT(trace,2,"startrec"); |
1023 | |||
1024 | if (qeth_set_thread_start_bit(card, QETH_RECOVER_THREAD) == 0) | 1024 | if (qeth_set_thread_start_bit(card, QETH_RECOVER_THREAD) == 0) |
1025 | schedule_work(&card->kernel_thread_starter); | 1025 | schedule_work(&card->kernel_thread_starter); |
1026 | } | 1026 | } |
@@ -1710,7 +1710,6 @@ qeth_check_ipa_data(struct qeth_card *card, struct qeth_cmd_buffer *iob) | |||
1710 | "IP address reset.\n", | 1710 | "IP address reset.\n", |
1711 | QETH_CARD_IFNAME(card), | 1711 | QETH_CARD_IFNAME(card), |
1712 | card->info.chpid); | 1712 | card->info.chpid); |
1713 | netif_carrier_on(card->dev); | ||
1714 | qeth_schedule_recovery(card); | 1713 | qeth_schedule_recovery(card); |
1715 | return NULL; | 1714 | return NULL; |
1716 | case IPA_CMD_MODCCID: | 1715 | case IPA_CMD_MODCCID: |
@@ -1959,7 +1958,7 @@ qeth_osn_send_ipa_cmd(struct qeth_card *card, struct qeth_cmd_buffer *iob, | |||
1959 | { | 1958 | { |
1960 | u16 s1, s2; | 1959 | u16 s1, s2; |
1961 | 1960 | ||
1962 | QETH_DBF_TEXT(trace,4,"osndipa"); | 1961 | QETH_DBF_TEXT(trace,4,"osndipa"); |
1963 | 1962 | ||
1964 | qeth_prepare_ipa_cmd(card, iob, QETH_PROT_OSN2); | 1963 | qeth_prepare_ipa_cmd(card, iob, QETH_PROT_OSN2); |
1965 | s1 = (u16)(IPA_PDU_HEADER_SIZE + data_len); | 1964 | s1 = (u16)(IPA_PDU_HEADER_SIZE + data_len); |
@@ -2203,24 +2202,21 @@ qeth_ulp_setup(struct qeth_card *card) | |||
2203 | } | 2202 | } |
2204 | 2203 | ||
2205 | static inline int | 2204 | static inline int |
2206 | qeth_check_for_inbound_error(struct qeth_qdio_buffer *buf, | 2205 | qeth_check_qdio_errors(struct qdio_buffer *buf, unsigned int qdio_error, |
2207 | unsigned int qdio_error, | 2206 | unsigned int siga_error, const char *dbftext) |
2208 | unsigned int siga_error) | ||
2209 | { | 2207 | { |
2210 | int rc = 0; | ||
2211 | |||
2212 | if (qdio_error || siga_error) { | 2208 | if (qdio_error || siga_error) { |
2213 | QETH_DBF_TEXT(trace, 2, "qdinerr"); | 2209 | QETH_DBF_TEXT(trace, 2, dbftext); |
2214 | QETH_DBF_TEXT(qerr, 2, "qdinerr"); | 2210 | QETH_DBF_TEXT(qerr, 2, dbftext); |
2215 | QETH_DBF_TEXT_(qerr, 2, " F15=%02X", | 2211 | QETH_DBF_TEXT_(qerr, 2, " F15=%02X", |
2216 | buf->buffer->element[15].flags & 0xff); | 2212 | buf->element[15].flags & 0xff); |
2217 | QETH_DBF_TEXT_(qerr, 2, " F14=%02X", | 2213 | QETH_DBF_TEXT_(qerr, 2, " F14=%02X", |
2218 | buf->buffer->element[14].flags & 0xff); | 2214 | buf->element[14].flags & 0xff); |
2219 | QETH_DBF_TEXT_(qerr, 2, " qerr=%X", qdio_error); | 2215 | QETH_DBF_TEXT_(qerr, 2, " qerr=%X", qdio_error); |
2220 | QETH_DBF_TEXT_(qerr, 2, " serr=%X", siga_error); | 2216 | QETH_DBF_TEXT_(qerr, 2, " serr=%X", siga_error); |
2221 | rc = 1; | 2217 | return 1; |
2222 | } | 2218 | } |
2223 | return rc; | 2219 | return 0; |
2224 | } | 2220 | } |
2225 | 2221 | ||
2226 | static inline struct sk_buff * | 2222 | static inline struct sk_buff * |
@@ -2769,8 +2765,9 @@ qeth_qdio_input_handler(struct ccw_device * ccwdev, unsigned int status, | |||
2769 | for (i = first_element; i < (first_element + count); ++i) { | 2765 | for (i = first_element; i < (first_element + count); ++i) { |
2770 | index = i % QDIO_MAX_BUFFERS_PER_Q; | 2766 | index = i % QDIO_MAX_BUFFERS_PER_Q; |
2771 | buffer = &card->qdio.in_q->bufs[index]; | 2767 | buffer = &card->qdio.in_q->bufs[index]; |
2772 | if (!((status == QDIO_STATUS_LOOK_FOR_ERROR) && | 2768 | if (!((status & QDIO_STATUS_LOOK_FOR_ERROR) && |
2773 | qeth_check_for_inbound_error(buffer, qdio_err, siga_err))) | 2769 | qeth_check_qdio_errors(buffer->buffer, |
2770 | qdio_err, siga_err,"qinerr"))) | ||
2774 | qeth_process_inbound_buffer(card, buffer, index); | 2771 | qeth_process_inbound_buffer(card, buffer, index); |
2775 | /* clear buffer and give back to hardware */ | 2772 | /* clear buffer and give back to hardware */ |
2776 | qeth_put_buffer_pool_entry(card, buffer->pool_entry); | 2773 | qeth_put_buffer_pool_entry(card, buffer->pool_entry); |
@@ -2785,12 +2782,13 @@ qeth_qdio_input_handler(struct ccw_device * ccwdev, unsigned int status, | |||
2785 | static inline int | 2782 | static inline int |
2786 | qeth_handle_send_error(struct qeth_card *card, | 2783 | qeth_handle_send_error(struct qeth_card *card, |
2787 | struct qeth_qdio_out_buffer *buffer, | 2784 | struct qeth_qdio_out_buffer *buffer, |
2788 | int qdio_err, int siga_err) | 2785 | unsigned int qdio_err, unsigned int siga_err) |
2789 | { | 2786 | { |
2790 | int sbalf15 = buffer->buffer->element[15].flags & 0xff; | 2787 | int sbalf15 = buffer->buffer->element[15].flags & 0xff; |
2791 | int cc = siga_err & 3; | 2788 | int cc = siga_err & 3; |
2792 | 2789 | ||
2793 | QETH_DBF_TEXT(trace, 6, "hdsnderr"); | 2790 | QETH_DBF_TEXT(trace, 6, "hdsnderr"); |
2791 | qeth_check_qdio_errors(buffer->buffer, qdio_err, siga_err, "qouterr"); | ||
2794 | switch (cc) { | 2792 | switch (cc) { |
2795 | case 0: | 2793 | case 0: |
2796 | if (qdio_err){ | 2794 | if (qdio_err){ |
@@ -3047,7 +3045,8 @@ qeth_qdio_output_handler(struct ccw_device * ccwdev, unsigned int status, | |||
3047 | for(i = first_element; i < (first_element + count); ++i){ | 3045 | for(i = first_element; i < (first_element + count); ++i){ |
3048 | buffer = &queue->bufs[i % QDIO_MAX_BUFFERS_PER_Q]; | 3046 | buffer = &queue->bufs[i % QDIO_MAX_BUFFERS_PER_Q]; |
3049 | /*we only handle the KICK_IT error by doing a recovery */ | 3047 | /*we only handle the KICK_IT error by doing a recovery */ |
3050 | if (qeth_handle_send_error(card, buffer, qdio_error, siga_error) | 3048 | if (qeth_handle_send_error(card, buffer, |
3049 | qdio_error, siga_error) | ||
3051 | == QETH_SEND_ERROR_KICK_IT){ | 3050 | == QETH_SEND_ERROR_KICK_IT){ |
3052 | netif_stop_queue(card->dev); | 3051 | netif_stop_queue(card->dev); |
3053 | qeth_schedule_recovery(card); | 3052 | qeth_schedule_recovery(card); |
@@ -3289,7 +3288,6 @@ qeth_init_qdio_info(struct qeth_card *card) | |||
3289 | card->qdio.in_buf_pool.buf_count = card->qdio.init_pool.buf_count; | 3288 | card->qdio.in_buf_pool.buf_count = card->qdio.init_pool.buf_count; |
3290 | INIT_LIST_HEAD(&card->qdio.in_buf_pool.entry_list); | 3289 | INIT_LIST_HEAD(&card->qdio.in_buf_pool.entry_list); |
3291 | INIT_LIST_HEAD(&card->qdio.init_pool.entry_list); | 3290 | INIT_LIST_HEAD(&card->qdio.init_pool.entry_list); |
3292 | /* outbound */ | ||
3293 | } | 3291 | } |
3294 | 3292 | ||
3295 | static int | 3293 | static int |
@@ -3731,6 +3729,9 @@ qeth_verify_vlan_dev(struct net_device *dev, struct qeth_card *card) | |||
3731 | break; | 3729 | break; |
3732 | } | 3730 | } |
3733 | } | 3731 | } |
3732 | if (rc && !(VLAN_DEV_INFO(dev)->real_dev->priv == (void *)card)) | ||
3733 | return 0; | ||
3734 | |||
3734 | #endif | 3735 | #endif |
3735 | return rc; | 3736 | return rc; |
3736 | } | 3737 | } |
@@ -3807,10 +3808,8 @@ qeth_open(struct net_device *dev) | |||
3807 | card->data.state = CH_STATE_UP; | 3808 | card->data.state = CH_STATE_UP; |
3808 | card->state = CARD_STATE_UP; | 3809 | card->state = CARD_STATE_UP; |
3809 | 3810 | ||
3810 | if (!card->lan_online){ | 3811 | if (!card->lan_online && netif_carrier_ok(dev)) |
3811 | if (netif_carrier_ok(dev)) | 3812 | netif_carrier_off(dev); |
3812 | netif_carrier_off(dev); | ||
3813 | } | ||
3814 | return 0; | 3813 | return 0; |
3815 | } | 3814 | } |
3816 | 3815 | ||
@@ -5870,10 +5869,8 @@ qeth_add_multicast_ipv6(struct qeth_card *card) | |||
5870 | struct inet6_dev *in6_dev; | 5869 | struct inet6_dev *in6_dev; |
5871 | 5870 | ||
5872 | QETH_DBF_TEXT(trace,4,"chkmcv6"); | 5871 | QETH_DBF_TEXT(trace,4,"chkmcv6"); |
5873 | if ((card->options.layer2 == 0) && | 5872 | if (!qeth_is_supported(card, IPA_IPV6)) |
5874 | (!qeth_is_supported(card, IPA_IPV6)) ) | ||
5875 | return ; | 5873 | return ; |
5876 | |||
5877 | in6_dev = in6_dev_get(card->dev); | 5874 | in6_dev = in6_dev_get(card->dev); |
5878 | if (in6_dev == NULL) | 5875 | if (in6_dev == NULL) |
5879 | return; | 5876 | return; |
@@ -7936,8 +7933,8 @@ __qeth_set_online(struct ccwgroup_device *gdev, int recovery_mode) | |||
7936 | QETH_DBF_TEXT_(setup, 2, "6err%d", rc); | 7933 | QETH_DBF_TEXT_(setup, 2, "6err%d", rc); |
7937 | goto out_remove; | 7934 | goto out_remove; |
7938 | } | 7935 | } |
7939 | /*maybe it was set offline without ifconfig down | 7936 | netif_carrier_on(card->dev); |
7940 | * we can also use this state for recovery purposes*/ | 7937 | |
7941 | qeth_set_allowed_threads(card, 0xffffffff, 0); | 7938 | qeth_set_allowed_threads(card, 0xffffffff, 0); |
7942 | if (recover_flag == CARD_STATE_RECOVER) | 7939 | if (recover_flag == CARD_STATE_RECOVER) |
7943 | qeth_start_again(card, recovery_mode); | 7940 | qeth_start_again(card, recovery_mode); |