forked from luck/tmp_suning_uos_patched
qeth: Fix IPA_CMD_QIPASSIST return code handling
Return codes of IPA_CMD_QIPASSIST are not checked, especially the ones which indicate that the command is not supported. As a result, the device driver would not enable all available features on older card generations. This patch adds proper checking and sets the bare minimum in the supported functions flags to avoid follow-on errors. Signed-off-by: Stefan Raspl <raspl@linux.vnet.ibm.com> Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com> Reviewed-by: Ursula Braun <ursula.braun@de.ibm.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
80928805ba
commit
a134884ac0
@ -2942,13 +2942,33 @@ static int qeth_query_ipassists_cb(struct qeth_card *card,
|
||||
QETH_DBF_TEXT(SETUP, 2, "qipasscb");
|
||||
|
||||
cmd = (struct qeth_ipa_cmd *) data;
|
||||
|
||||
switch (cmd->hdr.return_code) {
|
||||
case IPA_RC_NOTSUPP:
|
||||
case IPA_RC_L2_UNSUPPORTED_CMD:
|
||||
QETH_DBF_TEXT(SETUP, 2, "ipaunsup");
|
||||
card->options.ipa4.supported_funcs |= IPA_SETADAPTERPARMS;
|
||||
card->options.ipa6.supported_funcs |= IPA_SETADAPTERPARMS;
|
||||
return -0;
|
||||
default:
|
||||
if (cmd->hdr.return_code) {
|
||||
QETH_DBF_MESSAGE(1, "%s IPA_CMD_QIPASSIST: Unhandled "
|
||||
"rc=%d\n",
|
||||
dev_name(&card->gdev->dev),
|
||||
cmd->hdr.return_code);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (cmd->hdr.prot_version == QETH_PROT_IPV4) {
|
||||
card->options.ipa4.supported_funcs = cmd->hdr.ipa_supported;
|
||||
card->options.ipa4.enabled_funcs = cmd->hdr.ipa_enabled;
|
||||
} else {
|
||||
} else if (cmd->hdr.prot_version == QETH_PROT_IPV6) {
|
||||
card->options.ipa6.supported_funcs = cmd->hdr.ipa_supported;
|
||||
card->options.ipa6.enabled_funcs = cmd->hdr.ipa_enabled;
|
||||
}
|
||||
} else
|
||||
QETH_DBF_MESSAGE(1, "%s IPA_CMD_QIPASSIST: Flawed LIC detected"
|
||||
"\n", dev_name(&card->gdev->dev));
|
||||
QETH_DBF_TEXT(SETUP, 2, "suppenbl");
|
||||
QETH_DBF_TEXT_(SETUP, 2, "%08x", (__u32)cmd->hdr.ipa_supported);
|
||||
QETH_DBF_TEXT_(SETUP, 2, "%08x", (__u32)cmd->hdr.ipa_enabled);
|
||||
|
@ -626,10 +626,13 @@ static int qeth_l2_request_initial_mac(struct qeth_card *card)
|
||||
QETH_DBF_TEXT(SETUP, 2, "doL2init");
|
||||
QETH_DBF_TEXT_(SETUP, 2, "doL2%s", CARD_BUS_ID(card));
|
||||
|
||||
rc = qeth_query_setadapterparms(card);
|
||||
if (rc) {
|
||||
QETH_DBF_MESSAGE(2, "could not query adapter parameters on "
|
||||
"device %s: x%x\n", CARD_BUS_ID(card), rc);
|
||||
if (qeth_is_supported(card, IPA_SETADAPTERPARMS)) {
|
||||
rc = qeth_query_setadapterparms(card);
|
||||
if (rc) {
|
||||
QETH_DBF_MESSAGE(2, "could not query adapter "
|
||||
"parameters on device %s: x%x\n",
|
||||
CARD_BUS_ID(card), rc);
|
||||
}
|
||||
}
|
||||
|
||||
if (card->info.type == QETH_CARD_TYPE_IQD ||
|
||||
|
Loading…
Reference in New Issue
Block a user