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

s390/qeth: make TSO controls protocol-agnostic

In preparation for IPv6 TSO, turn the protocol version into a parameter
for the TSO control code.
Signed-off-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 139ce90a
...@@ -6396,27 +6396,27 @@ static int qeth_set_ipa_csum(struct qeth_card *card, bool on, int cstype, ...@@ -6396,27 +6396,27 @@ static int qeth_set_ipa_csum(struct qeth_card *card, bool on, int cstype,
return rc ? -EIO : 0; return rc ? -EIO : 0;
} }
static int qeth_set_ipa_tso(struct qeth_card *card, int on) static int qeth_set_tso_off(struct qeth_card *card,
enum qeth_prot_versions prot)
{ {
int rc; return qeth_send_simple_setassparms_prot(card, IPA_OUTBOUND_TSO,
IPA_CMD_ASS_STOP, 0, prot);
}
QETH_CARD_TEXT(card, 3, "sttso"); static int qeth_set_tso_on(struct qeth_card *card,
enum qeth_prot_versions prot)
{
return qeth_send_simple_setassparms_prot(card, IPA_OUTBOUND_TSO,
IPA_CMD_ASS_START, 0, prot);
}
if (on) { static int qeth_set_ipa_tso(struct qeth_card *card, bool on,
rc = qeth_send_simple_setassparms(card, IPA_OUTBOUND_TSO, enum qeth_prot_versions prot)
IPA_CMD_ASS_START, 0); {
if (rc) { int rc = on ? qeth_set_tso_on(card, prot) :
dev_warn(&card->gdev->dev, qeth_set_tso_off(card, prot);
"Starting outbound TCP segmentation offload for %s failed\n",
QETH_CARD_IFNAME(card)); return rc ? -EIO : 0;
return -EIO;
}
dev_info(&card->gdev->dev, "Outbound TSO enabled\n");
} else {
rc = qeth_send_simple_setassparms(card, IPA_OUTBOUND_TSO,
IPA_CMD_ASS_STOP, 0);
}
return rc;
} }
static int qeth_set_ipa_rx_csum(struct qeth_card *card, bool on) static int qeth_set_ipa_rx_csum(struct qeth_card *card, bool on)
...@@ -6493,8 +6493,9 @@ int qeth_set_features(struct net_device *dev, netdev_features_t features) ...@@ -6493,8 +6493,9 @@ int qeth_set_features(struct net_device *dev, netdev_features_t features)
if (rc) if (rc)
changed ^= NETIF_F_RXCSUM; changed ^= NETIF_F_RXCSUM;
} }
if ((changed & NETIF_F_TSO)) { if (changed & NETIF_F_TSO) {
rc = qeth_set_ipa_tso(card, features & NETIF_F_TSO ? 1 : 0); rc = qeth_set_ipa_tso(card, features & NETIF_F_TSO,
QETH_PROT_IPV4);
if (rc) if (rc)
changed ^= NETIF_F_TSO; changed ^= NETIF_F_TSO;
} }
......
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