Commit a60389ab authored by Einar Lueck's avatar Einar Lueck Committed by David S. Miller

qeth: default BLKT values for new OSA/3 hardware

Set default BLKT values for new OSA/3 hardware.
Signed-off-by: default avatarEinar Lueck <elelueck@de.ibm.com>
Signed-off-by: default avatarFrank Blaschka <frank.blaschka@de.ibm.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 84b66683
...@@ -1362,26 +1362,29 @@ static int qeth_read_conf_data(struct qeth_card *card, void **buffer, ...@@ -1362,26 +1362,29 @@ static int qeth_read_conf_data(struct qeth_card *card, void **buffer,
return ret; return ret;
} }
static int qeth_get_unitaddr(struct qeth_card *card) static void qeth_configure_unitaddr(struct qeth_card *card, char *prcd)
{ {
int length; QETH_DBF_TEXT(SETUP, 2, "cfgunit");
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;
}
card->info.chpid = prcd[30]; card->info.chpid = prcd[30];
card->info.unit_addr2 = prcd[31]; card->info.unit_addr2 = prcd[31];
card->info.cula = prcd[63]; card->info.cula = prcd[63];
card->info.guestlan = ((prcd[0x10] == _ascebc['V']) && card->info.guestlan = ((prcd[0x10] == _ascebc['V']) &&
(prcd[0x11] == _ascebc['M'])); (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) static void qeth_init_tokens(struct qeth_card *card)
...@@ -4169,6 +4172,8 @@ void qeth_core_free_discipline(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) static void qeth_determine_capabilities(struct qeth_card *card)
{ {
int rc; int rc;
int length;
char *prcd;
QETH_DBF_TEXT(SETUP, 2, "detcapab"); QETH_DBF_TEXT(SETUP, 2, "detcapab");
rc = ccw_device_set_online(CARD_DDEV(card)); rc = ccw_device_set_online(CARD_DDEV(card));
...@@ -4177,11 +4182,17 @@ static void qeth_determine_capabilities(struct qeth_card *card) ...@@ -4177,11 +4182,17 @@ static void qeth_determine_capabilities(struct qeth_card *card)
goto out; goto out;
} }
rc = qeth_get_unitaddr(card);
rc = qeth_read_conf_data(card, (void **) &prcd, &length);
if (rc) { 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); QETH_DBF_TEXT_(SETUP, 2, "5err%d", rc);
goto out_offline; 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); rc = qdio_get_ssqd_desc(CARD_DDEV(card), &card->ssqd);
if (rc) if (rc)
......
...@@ -539,7 +539,7 @@ static ssize_t qeth_dev_blkt_total_store(struct device *dev, ...@@ -539,7 +539,7 @@ static ssize_t qeth_dev_blkt_total_store(struct device *dev,
struct qeth_card *card = dev_get_drvdata(dev); struct qeth_card *card = dev_get_drvdata(dev);
return qeth_dev_blkt_store(card, buf, count, 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, ...@@ -561,7 +561,7 @@ static ssize_t qeth_dev_blkt_inter_store(struct device *dev,
struct qeth_card *card = dev_get_drvdata(dev); struct qeth_card *card = dev_get_drvdata(dev);
return qeth_dev_blkt_store(card, buf, count, 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, 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, ...@@ -582,7 +582,7 @@ static ssize_t qeth_dev_blkt_inter_jumbo_store(struct device *dev,
struct qeth_card *card = dev_get_drvdata(dev); struct qeth_card *card = dev_get_drvdata(dev);
return qeth_dev_blkt_store(card, buf, count, 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, static DEVICE_ATTR(inter_jumbo, 0644, qeth_dev_blkt_inter_jumbo_show,
......
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