|
@@ -5513,26 +5513,26 @@ int qeth_send_setassparms(struct qeth_card *card,
|
|
}
|
|
}
|
|
EXPORT_SYMBOL_GPL(qeth_send_setassparms);
|
|
EXPORT_SYMBOL_GPL(qeth_send_setassparms);
|
|
|
|
|
|
-int qeth_send_simple_setassparms(struct qeth_card *card,
|
|
|
|
- enum qeth_ipa_funcs ipa_func,
|
|
|
|
- __u16 cmd_code, long data)
|
|
|
|
|
|
+int qeth_send_simple_setassparms_prot(struct qeth_card *card,
|
|
|
|
+ enum qeth_ipa_funcs ipa_func,
|
|
|
|
+ u16 cmd_code, long data,
|
|
|
|
+ enum qeth_prot_versions prot)
|
|
{
|
|
{
|
|
int rc;
|
|
int rc;
|
|
int length = 0;
|
|
int length = 0;
|
|
struct qeth_cmd_buffer *iob;
|
|
struct qeth_cmd_buffer *iob;
|
|
|
|
|
|
- QETH_CARD_TEXT(card, 4, "simassp4");
|
|
|
|
|
|
+ QETH_CARD_TEXT_(card, 4, "simassp%i", prot);
|
|
if (data)
|
|
if (data)
|
|
length = sizeof(__u32);
|
|
length = sizeof(__u32);
|
|
- iob = qeth_get_setassparms_cmd(card, ipa_func, cmd_code,
|
|
|
|
- length, QETH_PROT_IPV4);
|
|
|
|
|
|
+ iob = qeth_get_setassparms_cmd(card, ipa_func, cmd_code, length, prot);
|
|
if (!iob)
|
|
if (!iob)
|
|
return -ENOMEM;
|
|
return -ENOMEM;
|
|
rc = qeth_send_setassparms(card, iob, length, data,
|
|
rc = qeth_send_setassparms(card, iob, length, data,
|
|
qeth_setassparms_cb, NULL);
|
|
qeth_setassparms_cb, NULL);
|
|
return rc;
|
|
return rc;
|
|
}
|
|
}
|
|
-EXPORT_SYMBOL_GPL(qeth_send_simple_setassparms);
|
|
|
|
|
|
+EXPORT_SYMBOL_GPL(qeth_send_simple_setassparms_prot);
|
|
|
|
|
|
static void qeth_unregister_dbf_views(void)
|
|
static void qeth_unregister_dbf_views(void)
|
|
{
|
|
{
|
|
@@ -6330,14 +6330,15 @@ static int qeth_ipa_checksum_run_cmd_cb(struct qeth_card *card,
|
|
static int qeth_ipa_checksum_run_cmd(struct qeth_card *card,
|
|
static int qeth_ipa_checksum_run_cmd(struct qeth_card *card,
|
|
enum qeth_ipa_funcs ipa_func,
|
|
enum qeth_ipa_funcs ipa_func,
|
|
__u16 cmd_code, long data,
|
|
__u16 cmd_code, long data,
|
|
- struct qeth_checksum_cmd *chksum_cb)
|
|
|
|
|
|
+ struct qeth_checksum_cmd *chksum_cb,
|
|
|
|
+ enum qeth_prot_versions prot)
|
|
{
|
|
{
|
|
struct qeth_cmd_buffer *iob;
|
|
struct qeth_cmd_buffer *iob;
|
|
int rc = -ENOMEM;
|
|
int rc = -ENOMEM;
|
|
|
|
|
|
QETH_CARD_TEXT(card, 4, "chkdocmd");
|
|
QETH_CARD_TEXT(card, 4, "chkdocmd");
|
|
iob = qeth_get_setassparms_cmd(card, ipa_func, cmd_code,
|
|
iob = qeth_get_setassparms_cmd(card, ipa_func, cmd_code,
|
|
- sizeof(__u32), QETH_PROT_IPV4);
|
|
|
|
|
|
+ sizeof(__u32), prot);
|
|
if (iob)
|
|
if (iob)
|
|
rc = qeth_send_setassparms(card, iob, sizeof(__u32), data,
|
|
rc = qeth_send_setassparms(card, iob, sizeof(__u32), data,
|
|
qeth_ipa_checksum_run_cmd_cb,
|
|
qeth_ipa_checksum_run_cmd_cb,
|
|
@@ -6345,7 +6346,8 @@ static int qeth_ipa_checksum_run_cmd(struct qeth_card *card,
|
|
return rc;
|
|
return rc;
|
|
}
|
|
}
|
|
|
|
|
|
-static int qeth_send_checksum_on(struct qeth_card *card, int cstype)
|
|
|
|
|
|
+static int qeth_send_checksum_on(struct qeth_card *card, int cstype,
|
|
|
|
+ enum qeth_prot_versions prot)
|
|
{
|
|
{
|
|
const __u32 required_features = QETH_IPA_CHECKSUM_IP_HDR |
|
|
const __u32 required_features = QETH_IPA_CHECKSUM_IP_HDR |
|
|
QETH_IPA_CHECKSUM_UDP |
|
|
QETH_IPA_CHECKSUM_UDP |
|
|
@@ -6354,7 +6356,7 @@ static int qeth_send_checksum_on(struct qeth_card *card, int cstype)
|
|
int rc;
|
|
int rc;
|
|
|
|
|
|
rc = qeth_ipa_checksum_run_cmd(card, cstype, IPA_CMD_ASS_START, 0,
|
|
rc = qeth_ipa_checksum_run_cmd(card, cstype, IPA_CMD_ASS_START, 0,
|
|
- &chksum_cb);
|
|
|
|
|
|
+ &chksum_cb, prot);
|
|
if (!rc) {
|
|
if (!rc) {
|
|
if ((required_features & chksum_cb.supported) !=
|
|
if ((required_features & chksum_cb.supported) !=
|
|
required_features)
|
|
required_features)
|
|
@@ -6366,37 +6368,42 @@ static int qeth_send_checksum_on(struct qeth_card *card, int cstype)
|
|
QETH_CARD_IFNAME(card));
|
|
QETH_CARD_IFNAME(card));
|
|
}
|
|
}
|
|
if (rc) {
|
|
if (rc) {
|
|
- qeth_send_simple_setassparms(card, cstype, IPA_CMD_ASS_STOP, 0);
|
|
|
|
|
|
+ qeth_send_simple_setassparms_prot(card, cstype,
|
|
|
|
+ IPA_CMD_ASS_STOP, 0, prot);
|
|
dev_warn(&card->gdev->dev,
|
|
dev_warn(&card->gdev->dev,
|
|
- "Starting HW checksumming for %s failed, using SW checksumming\n",
|
|
|
|
- QETH_CARD_IFNAME(card));
|
|
|
|
|
|
+ "Starting HW IPv%d checksumming for %s failed, using SW checksumming\n",
|
|
|
|
+ prot, QETH_CARD_IFNAME(card));
|
|
return rc;
|
|
return rc;
|
|
}
|
|
}
|
|
rc = qeth_ipa_checksum_run_cmd(card, cstype, IPA_CMD_ASS_ENABLE,
|
|
rc = qeth_ipa_checksum_run_cmd(card, cstype, IPA_CMD_ASS_ENABLE,
|
|
- chksum_cb.supported, &chksum_cb);
|
|
|
|
|
|
+ chksum_cb.supported, &chksum_cb,
|
|
|
|
+ prot);
|
|
if (!rc) {
|
|
if (!rc) {
|
|
if ((required_features & chksum_cb.enabled) !=
|
|
if ((required_features & chksum_cb.enabled) !=
|
|
required_features)
|
|
required_features)
|
|
rc = -EIO;
|
|
rc = -EIO;
|
|
}
|
|
}
|
|
if (rc) {
|
|
if (rc) {
|
|
- qeth_send_simple_setassparms(card, cstype, IPA_CMD_ASS_STOP, 0);
|
|
|
|
|
|
+ qeth_send_simple_setassparms_prot(card, cstype,
|
|
|
|
+ IPA_CMD_ASS_STOP, 0, prot);
|
|
dev_warn(&card->gdev->dev,
|
|
dev_warn(&card->gdev->dev,
|
|
- "Enabling HW checksumming for %s failed, using SW checksumming\n",
|
|
|
|
- QETH_CARD_IFNAME(card));
|
|
|
|
|
|
+ "Enabling HW IPv%d checksumming for %s failed, using SW checksumming\n",
|
|
|
|
+ prot, QETH_CARD_IFNAME(card));
|
|
return rc;
|
|
return rc;
|
|
}
|
|
}
|
|
|
|
|
|
- dev_info(&card->gdev->dev, "HW Checksumming (%sbound) enabled\n",
|
|
|
|
- cstype == IPA_INBOUND_CHECKSUM ? "in" : "out");
|
|
|
|
|
|
+ dev_info(&card->gdev->dev, "HW Checksumming (%sbound IPv%d) enabled\n",
|
|
|
|
+ cstype == IPA_INBOUND_CHECKSUM ? "in" : "out", prot);
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static int qeth_set_ipa_csum(struct qeth_card *card, int on, int cstype)
|
|
|
|
|
|
+static int qeth_set_ipa_csum(struct qeth_card *card, bool on, int cstype,
|
|
|
|
+ enum qeth_prot_versions prot)
|
|
{
|
|
{
|
|
- int rc = (on) ? qeth_send_checksum_on(card, cstype)
|
|
|
|
- : qeth_send_simple_setassparms(card, cstype,
|
|
|
|
- IPA_CMD_ASS_STOP, 0);
|
|
|
|
|
|
+ int rc = (on) ? qeth_send_checksum_on(card, cstype, prot)
|
|
|
|
+ : qeth_send_simple_setassparms_prot(card, cstype,
|
|
|
|
+ IPA_CMD_ASS_STOP, 0,
|
|
|
|
+ prot);
|
|
return rc ? -EIO : 0;
|
|
return rc ? -EIO : 0;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -6459,16 +6466,14 @@ int qeth_set_features(struct net_device *dev, netdev_features_t features)
|
|
QETH_DBF_HEX(SETUP, 2, &features, sizeof(features));
|
|
QETH_DBF_HEX(SETUP, 2, &features, sizeof(features));
|
|
|
|
|
|
if ((changed & NETIF_F_IP_CSUM)) {
|
|
if ((changed & NETIF_F_IP_CSUM)) {
|
|
- rc = qeth_set_ipa_csum(card,
|
|
|
|
- features & NETIF_F_IP_CSUM ? 1 : 0,
|
|
|
|
- IPA_OUTBOUND_CHECKSUM);
|
|
|
|
|
|
+ rc = qeth_set_ipa_csum(card, features & NETIF_F_IP_CSUM,
|
|
|
|
+ IPA_OUTBOUND_CHECKSUM, QETH_PROT_IPV4);
|
|
if (rc)
|
|
if (rc)
|
|
changed ^= NETIF_F_IP_CSUM;
|
|
changed ^= NETIF_F_IP_CSUM;
|
|
}
|
|
}
|
|
if ((changed & NETIF_F_RXCSUM)) {
|
|
if ((changed & NETIF_F_RXCSUM)) {
|
|
- rc = qeth_set_ipa_csum(card,
|
|
|
|
- features & NETIF_F_RXCSUM ? 1 : 0,
|
|
|
|
- IPA_INBOUND_CHECKSUM);
|
|
|
|
|
|
+ rc = qeth_set_ipa_csum(card, features & NETIF_F_RXCSUM,
|
|
|
|
+ IPA_INBOUND_CHECKSUM, QETH_PROT_IPV4);
|
|
if (rc)
|
|
if (rc)
|
|
changed ^= NETIF_F_RXCSUM;
|
|
changed ^= NETIF_F_RXCSUM;
|
|
}
|
|
}
|