Commit bdb0cc12 authored by Julian Wiedmann's avatar Julian Wiedmann Committed by David S. Miller

s390/qeth: fine-tune MAC Address-related errnos

Return the correct errnos when .ndo_set_mac_address fails to set a new
MAC address.
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ee1e52d1
...@@ -52,11 +52,11 @@ static int qeth_l2_setdelmac_makerc(struct qeth_card *card, u16 retcode) ...@@ -52,11 +52,11 @@ static int qeth_l2_setdelmac_makerc(struct qeth_card *card, u16 retcode)
break; break;
case IPA_RC_L2_DUP_MAC: case IPA_RC_L2_DUP_MAC:
case IPA_RC_L2_DUP_LAYER3_MAC: case IPA_RC_L2_DUP_LAYER3_MAC:
rc = -EEXIST; rc = -EADDRINUSE;
break; break;
case IPA_RC_L2_MAC_NOT_AUTH_BY_HYP: case IPA_RC_L2_MAC_NOT_AUTH_BY_HYP:
case IPA_RC_L2_MAC_NOT_AUTH_BY_ADP: case IPA_RC_L2_MAC_NOT_AUTH_BY_ADP:
rc = -EPERM; rc = -EADDRNOTAVAIL;
break; break;
case IPA_RC_L2_MAC_NOT_FOUND: case IPA_RC_L2_MAC_NOT_FOUND:
rc = -ENOENT; rc = -ENOENT;
...@@ -105,11 +105,11 @@ static int qeth_l2_send_setmac(struct qeth_card *card, __u8 *mac) ...@@ -105,11 +105,11 @@ static int qeth_l2_send_setmac(struct qeth_card *card, __u8 *mac)
"MAC address %pM successfully registered\n", mac); "MAC address %pM successfully registered\n", mac);
} else { } else {
switch (rc) { switch (rc) {
case -EEXIST: case -EADDRINUSE:
dev_warn(&card->gdev->dev, dev_warn(&card->gdev->dev,
"MAC address %pM already exists\n", mac); "MAC address %pM already exists\n", mac);
break; break;
case -EPERM: case -EADDRNOTAVAIL:
dev_warn(&card->gdev->dev, dev_warn(&card->gdev->dev,
"MAC address %pM is not authorized\n", mac); "MAC address %pM is not authorized\n", mac);
break; break;
...@@ -126,7 +126,7 @@ static int qeth_l2_write_mac(struct qeth_card *card, u8 *mac) ...@@ -126,7 +126,7 @@ static int qeth_l2_write_mac(struct qeth_card *card, u8 *mac)
QETH_CARD_TEXT(card, 2, "L2Wmac"); QETH_CARD_TEXT(card, 2, "L2Wmac");
rc = qeth_l2_send_setdelmac(card, mac, cmd); rc = qeth_l2_send_setdelmac(card, mac, cmd);
if (rc == -EEXIST) if (rc == -EADDRINUSE)
QETH_DBF_MESSAGE(2, "MAC already registered on device %x\n", QETH_DBF_MESSAGE(2, "MAC already registered on device %x\n",
CARD_DEVID(card)); CARD_DEVID(card));
else if (rc) else if (rc)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment