diff options
author | Frank Pavlic <fpavlic@de.ibm.com> | 2005-11-10 07:51:17 -0500 |
---|---|---|
committer | Jeff Garzik <jgarzik@pobox.com> | 2005-11-11 08:26:22 -0500 |
commit | e08d88cccbe0dfcfbaffb704d24e19803407935d (patch) | |
tree | 097a17c40ec371e18d5676c0a5c788a3a7d897af /drivers/s390/net | |
parent | d805d7c692e414c3adf01bb414a8c542ac2e67d1 (diff) |
[PATCH] s390: fix recovery failure of non-guestLAN devices
[patch 5/7] s390: fix recovery failure of non-guestLAN devices
From: Frank Pavlic <fpavlic@de.ibm.com>
- Recovery of non-guestLAN Layer 2 device failed due to
trying to register the real MAC address we got from
the READ_MAC adapter parameters command.
We have to keep the "old" MAC address when we process
the reply of a READ_MAC.
Signed-off-by: Frank Pavlic <fpavlic@de.ibm.com>
diffstat:
qeth.h | 12 ++++++------
qeth_main.c | 27 ++++++++++++++++-----------
2 files changed, 22 insertions(+), 17 deletions(-)
Signed-off-by: Jeff Garzik <jgarzik@pobox.com>
Diffstat (limited to 'drivers/s390/net')
-rw-r--r-- | drivers/s390/net/qeth.h | 12 | ||||
-rw-r--r-- | drivers/s390/net/qeth_main.c | 27 |
2 files changed, 22 insertions, 17 deletions
diff --git a/drivers/s390/net/qeth.h b/drivers/s390/net/qeth.h index 635044a4a40b..44b9e14222a9 100644 --- a/drivers/s390/net/qeth.h +++ b/drivers/s390/net/qeth.h | |||
@@ -25,7 +25,7 @@ | |||
25 | 25 | ||
26 | #include "qeth_mpc.h" | 26 | #include "qeth_mpc.h" |
27 | 27 | ||
28 | #define VERSION_QETH_H "$Revision: 1.151 $" | 28 | #define VERSION_QETH_H "$Revision: 1.152 $" |
29 | 29 | ||
30 | #ifdef CONFIG_QETH_IPV6 | 30 | #ifdef CONFIG_QETH_IPV6 |
31 | #define QETH_VERSION_IPV6 ":IPv6" | 31 | #define QETH_VERSION_IPV6 ":IPv6" |
@@ -719,8 +719,6 @@ struct qeth_reply { | |||
719 | atomic_t refcnt; | 719 | atomic_t refcnt; |
720 | }; | 720 | }; |
721 | 721 | ||
722 | #define QETH_BROADCAST_WITH_ECHO 1 | ||
723 | #define QETH_BROADCAST_WITHOUT_ECHO 2 | ||
724 | 722 | ||
725 | struct qeth_card_blkt { | 723 | struct qeth_card_blkt { |
726 | int time_total; | 724 | int time_total; |
@@ -728,8 +726,10 @@ struct qeth_card_blkt { | |||
728 | int inter_packet_jumbo; | 726 | int inter_packet_jumbo; |
729 | }; | 727 | }; |
730 | 728 | ||
731 | 729 | #define QETH_BROADCAST_WITH_ECHO 0x01 | |
732 | 730 | #define QETH_BROADCAST_WITHOUT_ECHO 0x02 | |
731 | #define QETH_LAYER2_MAC_READ 0x01 | ||
732 | #define QETH_LAYER2_MAC_REGISTERED 0x02 | ||
733 | struct qeth_card_info { | 733 | struct qeth_card_info { |
734 | unsigned short unit_addr2; | 734 | unsigned short unit_addr2; |
735 | unsigned short cula; | 735 | unsigned short cula; |
@@ -737,7 +737,7 @@ struct qeth_card_info { | |||
737 | __u16 func_level; | 737 | __u16 func_level; |
738 | char mcl_level[QETH_MCL_LENGTH + 1]; | 738 | char mcl_level[QETH_MCL_LENGTH + 1]; |
739 | int guestlan; | 739 | int guestlan; |
740 | int layer2_mac_registered; | 740 | int mac_bits; |
741 | int portname_required; | 741 | int portname_required; |
742 | int portno; | 742 | int portno; |
743 | char portname[9]; | 743 | char portname[9]; |
diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c index d6844b24a8aa..0f7f5117f1cf 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.238 $) | 3 | * linux/drivers/s390/net/qeth_main.c ($Revision: 1.242 $) |
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.238 $ $Date: 2005/05/04 20:19:18 $ | 15 | * $Revision: 1.242 $ $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.238 $" | 75 | #define VERSION_QETH_C "$Revision: 1.242 $" |
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 | /** |
@@ -3775,7 +3775,7 @@ qeth_open(struct net_device *dev) | |||
3775 | 3775 | ||
3776 | if ( (card->info.type != QETH_CARD_TYPE_OSN) && | 3776 | if ( (card->info.type != QETH_CARD_TYPE_OSN) && |
3777 | (card->options.layer2) && | 3777 | (card->options.layer2) && |
3778 | (!card->info.layer2_mac_registered)) { | 3778 | (!(card->info.mac_bits & QETH_LAYER2_MAC_REGISTERED))) { |
3779 | QETH_DBF_TEXT(trace,4,"nomacadr"); | 3779 | QETH_DBF_TEXT(trace,4,"nomacadr"); |
3780 | return -EPERM; | 3780 | return -EPERM; |
3781 | } | 3781 | } |
@@ -5894,10 +5894,10 @@ qeth_layer2_send_setmac_cb(struct qeth_card *card, | |||
5894 | PRINT_WARN("Error in registering MAC address on " \ | 5894 | PRINT_WARN("Error in registering MAC address on " \ |
5895 | "device %s: x%x\n", CARD_BUS_ID(card), | 5895 | "device %s: x%x\n", CARD_BUS_ID(card), |
5896 | cmd->hdr.return_code); | 5896 | cmd->hdr.return_code); |
5897 | card->info.layer2_mac_registered = 0; | 5897 | card->info.mac_bits &= ~QETH_LAYER2_MAC_REGISTERED; |
5898 | cmd->hdr.return_code = -EIO; | 5898 | cmd->hdr.return_code = -EIO; |
5899 | } else { | 5899 | } else { |
5900 | card->info.layer2_mac_registered = 1; | 5900 | card->info.mac_bits |= QETH_LAYER2_MAC_REGISTERED; |
5901 | memcpy(card->dev->dev_addr,cmd->data.setdelmac.mac, | 5901 | memcpy(card->dev->dev_addr,cmd->data.setdelmac.mac, |
5902 | OSA_ADDR_LEN); | 5902 | OSA_ADDR_LEN); |
5903 | PRINT_INFO("MAC address %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x " | 5903 | PRINT_INFO("MAC address %2.2x:%2.2x:%2.2x:%2.2x:%2.2x:%2.2x " |
@@ -5935,7 +5935,7 @@ qeth_layer2_send_delmac_cb(struct qeth_card *card, | |||
5935 | cmd->hdr.return_code = -EIO; | 5935 | cmd->hdr.return_code = -EIO; |
5936 | return 0; | 5936 | return 0; |
5937 | } | 5937 | } |
5938 | card->info.layer2_mac_registered = 0; | 5938 | card->info.mac_bits &= ~QETH_LAYER2_MAC_REGISTERED; |
5939 | 5939 | ||
5940 | return 0; | 5940 | return 0; |
5941 | } | 5941 | } |
@@ -5943,7 +5943,7 @@ static int | |||
5943 | qeth_layer2_send_delmac(struct qeth_card *card, __u8 *mac) | 5943 | qeth_layer2_send_delmac(struct qeth_card *card, __u8 *mac) |
5944 | { | 5944 | { |
5945 | QETH_DBF_TEXT(trace, 2, "L2Delmac"); | 5945 | QETH_DBF_TEXT(trace, 2, "L2Delmac"); |
5946 | if (!card->info.layer2_mac_registered) | 5946 | if (!(card->info.mac_bits & QETH_LAYER2_MAC_REGISTERED)) |
5947 | return 0; | 5947 | return 0; |
5948 | return qeth_layer2_send_setdelmac(card, mac, IPA_CMD_DELVMAC, | 5948 | return qeth_layer2_send_setdelmac(card, mac, IPA_CMD_DELVMAC, |
5949 | qeth_layer2_send_delmac_cb); | 5949 | qeth_layer2_send_delmac_cb); |
@@ -5965,7 +5965,7 @@ qeth_layer2_set_mac_address(struct net_device *dev, void *p) | |||
5965 | card = (struct qeth_card *) dev->priv; | 5965 | card = (struct qeth_card *) dev->priv; |
5966 | 5966 | ||
5967 | if (!card->options.layer2) { | 5967 | if (!card->options.layer2) { |
5968 | PRINT_WARN("Setting MAC address on %s is not supported" | 5968 | PRINT_WARN("Setting MAC address on %s is not supported " |
5969 | "in Layer 3 mode.\n", dev->name); | 5969 | "in Layer 3 mode.\n", dev->name); |
5970 | QETH_DBF_TEXT(trace, 3, "setmcLY3"); | 5970 | QETH_DBF_TEXT(trace, 3, "setmcLY3"); |
5971 | return -EOPNOTSUPP; | 5971 | return -EOPNOTSUPP; |
@@ -6550,8 +6550,13 @@ qeth_setadpparms_change_macaddr_cb(struct qeth_card *card, | |||
6550 | QETH_DBF_TEXT(trace,4,"chgmaccb"); | 6550 | QETH_DBF_TEXT(trace,4,"chgmaccb"); |
6551 | 6551 | ||
6552 | cmd = (struct qeth_ipa_cmd *) data; | 6552 | cmd = (struct qeth_ipa_cmd *) data; |
6553 | memcpy(card->dev->dev_addr, | 6553 | if (!card->options.layer2 || card->info.guestlan || |
6554 | &cmd->data.setadapterparms.data.change_addr.addr,OSA_ADDR_LEN); | 6554 | !(card->info.mac_bits & QETH_LAYER2_MAC_READ)) { |
6555 | memcpy(card->dev->dev_addr, | ||
6556 | &cmd->data.setadapterparms.data.change_addr.addr, | ||
6557 | OSA_ADDR_LEN); | ||
6558 | card->info.mac_bits |= QETH_LAYER2_MAC_READ; | ||
6559 | } | ||
6555 | qeth_default_setadapterparms_cb(card, reply, (unsigned long) cmd); | 6560 | qeth_default_setadapterparms_cb(card, reply, (unsigned long) cmd); |
6556 | return 0; | 6561 | return 0; |
6557 | } | 6562 | } |