qeth: default BLKT values for new OSA/3 hardware
authorEinar Lueck <elelueck@de.ibm.com>
Mon, 11 Jan 2010 02:50:52 +0000 (02:50 +0000)
committerDavid S. Miller <davem@davemloft.net>
Thu, 14 Jan 2010 04:34:57 +0000 (20:34 -0800)
Set default BLKT values for new OSA/3 hardware.

Signed-off-by: Einar Lueck <elelueck@de.ibm.com>
Signed-off-by: Frank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/qeth_core_main.c
drivers/s390/net/qeth_core_sys.c

index 2c8e9da8753f8d29dc82d6cd2ae8f7f69ce7d581..fa8a519218acc81f1b4af5e252d5cb8fc5beb4a6 100644 (file)
@@ -1362,26 +1362,29 @@ static int qeth_read_conf_data(struct qeth_card *card, void **buffer,
        return ret;
 }
 
-static int qeth_get_unitaddr(struct qeth_card *card)
+static void qeth_configure_unitaddr(struct qeth_card *card, char *prcd)
 {
-       int length;
-       char *prcd;
-       int rc;
-
-       QETH_DBF_TEXT(SETUP, 2, "getunit");
-       rc = qeth_read_conf_data(card, (void **) &prcd, &length);
-       if (rc) {
-               QETH_DBF_MESSAGE(2, "%s qeth_read_conf_data returned %i\n",
-                       dev_name(&card->gdev->dev), rc);
-               return rc;
-       }
+       QETH_DBF_TEXT(SETUP, 2, "cfgunit");
        card->info.chpid = prcd[30];
        card->info.unit_addr2 = prcd[31];
        card->info.cula = prcd[63];
        card->info.guestlan = ((prcd[0x10] == _ascebc['V']) &&
                               (prcd[0x11] == _ascebc['M']));
-       kfree(prcd);
-       return 0;
+}
+
+static void qeth_configure_blkt_default(struct qeth_card *card, char *prcd)
+{
+       QETH_DBF_TEXT(SETUP, 2, "cfgblkt");
+
+       if (prcd[74] == 0xF0 && prcd[75] == 0xF0 && prcd[76] == 0xF5) {
+               card->info.blkt.time_total = 250;
+               card->info.blkt.inter_packet = 5;
+               card->info.blkt.inter_packet_jumbo = 15;
+       } else {
+               card->info.blkt.time_total = 0;
+               card->info.blkt.inter_packet = 0;
+               card->info.blkt.inter_packet_jumbo = 0;
+       }
 }
 
 static void qeth_init_tokens(struct qeth_card *card)
@@ -4169,6 +4172,8 @@ void qeth_core_free_discipline(struct qeth_card *card)
 static void qeth_determine_capabilities(struct qeth_card *card)
 {
        int rc;
+       int length;
+       char *prcd;
 
        QETH_DBF_TEXT(SETUP, 2, "detcapab");
        rc = ccw_device_set_online(CARD_DDEV(card));
@@ -4177,11 +4182,17 @@ static void qeth_determine_capabilities(struct qeth_card *card)
                goto out;
        }
 
-       rc = qeth_get_unitaddr(card);
+
+       rc = qeth_read_conf_data(card, (void **) &prcd, &length);
        if (rc) {
+               QETH_DBF_MESSAGE(2, "%s qeth_read_conf_data returned %i\n",
+                       dev_name(&card->gdev->dev), rc);
                QETH_DBF_TEXT_(SETUP, 2, "5err%d", rc);
                goto out_offline;
        }
+       qeth_configure_unitaddr(card, prcd);
+       qeth_configure_blkt_default(card, prcd);
+       kfree(prcd);
 
        rc = qdio_get_ssqd_desc(CARD_DDEV(card), &card->ssqd);
        if (rc)
index ac2239a4f133914e8ceb7578e6e91f48e2eb7b32..88ae4357136a01e0f2fa8c1f04b604af069158a5 100644 (file)
@@ -539,7 +539,7 @@ static ssize_t qeth_dev_blkt_total_store(struct device *dev,
        struct qeth_card *card = dev_get_drvdata(dev);
 
        return qeth_dev_blkt_store(card, buf, count,
-                                  &card->info.blkt.time_total, 1000);
+                                  &card->info.blkt.time_total, 5000);
 }
 
 
@@ -561,7 +561,7 @@ static ssize_t qeth_dev_blkt_inter_store(struct device *dev,
        struct qeth_card *card = dev_get_drvdata(dev);
 
        return qeth_dev_blkt_store(card, buf, count,
-                                  &card->info.blkt.inter_packet, 100);
+                                  &card->info.blkt.inter_packet, 1000);
 }
 
 static DEVICE_ATTR(inter, 0644, qeth_dev_blkt_inter_show,
@@ -582,7 +582,7 @@ static ssize_t qeth_dev_blkt_inter_jumbo_store(struct device *dev,
        struct qeth_card *card = dev_get_drvdata(dev);
 
        return qeth_dev_blkt_store(card, buf, count,
-                                  &card->info.blkt.inter_packet_jumbo, 100);
+                                  &card->info.blkt.inter_packet_jumbo, 1000);
 }
 
 static DEVICE_ATTR(inter_jumbo, 0644, qeth_dev_blkt_inter_jumbo_show,